diff --git a/.hgignore b/.hgignore index 0d20d8cd835..b8d633f1b42 100644 --- a/.hgignore +++ b/.hgignore @@ -1,7 +1,7 @@ # use glob syntax. syntax: glob -src/shared/revision.h +src/server/shared/revision.h build/ bin/ .directory @@ -10,15 +10,16 @@ bin/ *~ .git/ win/VC90/*/ +src/tools/bin/*/ +src/tools/map_extractor/VC90/*/ +src/tools/vmap3_assembler/VC90/*/ +src/tools/vmap3_extractor/VC90/*/ +externals/lib/*/ *.ncb *.suo -dep/lib/win32* -src/bindings/scripts/VC90/*/ -src/mangosd/ -src/realmd/ *.*-* # use regexp syntax. syntax: regexp -^src/shared/revision\.h +^src/shared/server/shared/revision\.h diff --git a/.hgtags b/.hgtags index 5c0b56882af..f71252da044 100644 --- a/.hgtags +++ b/.hgtags @@ -26,3 +26,6 @@ b048ef8c4b39afb28c66f5c16a2d2cc5eb8d12d2 3.2.2a-really-last 50ede8e9dc8a83776fb6a0bfe17af9391c17b625 Teacher's & SoulForge's birthday e653a5b8d0100c99337e012e4b66848efd028cfb UP30 556e3ed4965e7f03267e8ae2a6c6ad8a34715ac5 Repository restructuring +01713607e30dfe526819c8151acb0421395e9341 UP31 +0410a47ee355040447f516bde5a7d21775829788 3.3.3a-LAST +1d84e402c47448d0f609c6d8ad8f409a0d24ce48 3.3.5a-clientsupport diff --git a/CMakeLists.txt b/CMakeLists.txt index 874d695da1a..91a8e3dc170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,191 +1,271 @@ +# Copyright (C) 2005-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + project(Trinity) + +# CMake policies cmake_minimum_required(VERSION 2.6) cmake_policy(SET CMP0005 OLD) -include(CheckIncludeFiles) -include(cmake/FindAce.cmake) -include(cmake/FindMySql.cmake) -include(cmake/FindReadline.cmake) -include(cmake/FindTermcap.cmake) -include(cmake/PCH.cmake) +# +# Override configuration-types - we don't use anything else than debug and release +# + +if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CONFIGURATION_TYPES Debug Release) + set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING + "Reset the configurations to what we need" + FORCE) +endif() # Force out-of-source build string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE) -if(BUILDING_IN_SOURCE) - message(FATAL_ERROR "This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, and create a separate build directory and run 'cmake path_to_project [options]' from there.") -endif(BUILDING_IN_SOURCE) + +if( BUILDING_IN_SOURCE ) + message(FATAL_ERROR " + This project requires an out of source build. Remove the file 'CMakeCache.txt' + found in this directory before continuing, create a separate build directory + and run 'cmake path_to_project [options]' from there. + ") +endif() + +# +# Basic packagesearching and setup (further support will be needed, this is a preliminary release!) +# + +include(CheckIncludeFiles) +include(cmake/FindPlatform.cmake) +include(cmake/FindPCHSupport.cmake) + +if(WIN32) + set(ACE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/externals) +endif() + +include(cmake/FindACE.cmake) +include(cmake/FindMySQL.cmake) +include(cmake/FindOpenSSL.cmake) + +# +# *nix-specific packages ( zlib and bzip2 libraries will be built from sourcetree on WIN32-platforms) +# + +if( UNIX ) + include(cmake/FindReadline.cmake) + include(cmake/FindTermcap.cmake) + include(FindZLIB) + include(FindBZip2) +endif() # Select the Release build configuration by default. -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif(NOT CMAKE_BUILD_TYPE) +if( NOT CMAKE_BUILD_TYPE ) + set(CMAKE_BUILD_TYPE "Release") +endif() -CONFIGURE_FILE( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) -add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +if( UNIX ) +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY +) -option(DO_MYSQL "With MySQL support" 1) -option(DO_SCRIPTS "With trinityscripts" 1) +add_custom_target(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" +) +endif() + +option(DO_AUTHSERVER "Build authserver" 1) +option(DO_WORLDSERVER "Build worldserver" 1) option(DO_CLI "With CLI" 1) -option(DO_RA "With RA" 0) option(DO_DEBUG "Debug mode" 0) -option(DO_WARN "Enable all compile warnings" 0) -option(DO_WARN "Enable all compile warnings" 0) -option(CENTOS "CENTOS" 0) -option(DO_SQL "Copy SQL files" 0) option(DO_PCH "Use precompiled headers" 1) -option(DO_TOOLS "Compile tools" 0) +option(DO_RA "With RA" 0) +option(DO_SCRIPTS "With trinityscripts" 1) +option(DO_SQL "Copy SQL files" 0) +option(DO_TOOLS "Build tools" 0) +option(DO_WARN "Enable all compile warnings" 0) + +if( UNIX ) + option(CENTOS "CENTOS" 0) + if( CENTOS ) + add_definitions(-DCENTOS) + find_termcap() + else() + find_readline() + endif() +endif() + +# Set up the installation-prefix +if( PREFIX ) + set(CMAKE_INSTALL_PREFIX ${PREFIX}) +endif() set(GENREV_SRC -src/genrevision/genrevision.cpp + src/genrevision/genrevision.cpp ) -if(DO_DEBUG) - add_executable(genrev - ${GENREV_SRC} - ) - add_custom_target("revision.h" ALL - COMMAND "${CMAKE_BINARY_DIR}/genrev" - ${CMAKE_SOURCE_DIR} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src/shared" - DEPENDS genrev - ) -else (DO_DEBUG) - add_executable(genrev - ${GENREV_SRC} - ) - add_custom_target("revision.h" ALL - COMMAND "${CMAKE_BINARY_DIR}/genrev" - ${CMAKE_SOURCE_DIR} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src/server/shared" - DEPENDS genrev - ) -endif(DO_DEBUG) +# Handle debugmode compiles (this will require further work for proper WIN32-setups) +if( DO_DEBUG ) + set(CMAKE_BUILD_TYPE Debug) +endif() +# +# Generate revision-extractor +# +add_executable(genrev + ${GENREV_SRC} +) + +if( CMAKE_GENERATOR MATCHES "Visual Studio" ) + add_custom_target("revision.h" ALL + COMMAND "${CMAKE_BINARY_DIR}/$(ConfigurationName)/genrev" + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + DEPENDS genrev + ) +else() + add_custom_target("revision.h" ALL + COMMAND "${CMAKE_BINARY_DIR}/genrev" + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + DEPENDS genrev + ) +endif() execute_process( - COMMAND hg tip --template {rev} - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - OUTPUT_VARIABLE HG_REVISION + COMMAND hg tip --template {rev} + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE HG_REVISION ) -message("* TrinityCore revision: ${HG_REVISION}") +message("") +message("* TrinityCore revision : ${HG_REVISION}") +message("* Build binaries in : ${CMAKE_BUILD_TYPE} mode") +message("") -if(PREFIX) - set(CMAKE_INSTALL_PREFIX ${PREFIX}) -endif(PREFIX) +if( NOT CONF_DIR ) + set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc) +endif() -if(CONF_DIR) - -else(CONF_DIR) - set(CONF_DIR ${PREFIX}/etc) -endif(CONF_DIR) set(LIBSDIR ${CMAKE_INSTALL_PREFIX}/lib) -message("* Will install to: ${CMAKE_INSTALL_PREFIX}") -message("* With config dir at: ${CONF_DIR}") -message("* Libs install dir at: ${LIBSDIR}") +message("* Install core to : ${CMAKE_INSTALL_PREFIX}") +message("* Install libraries to : ${LIBSDIR}") +message("* Install configs to : ${CONF_DIR}") +message("") -find_library(SSLLIB NAMES ssl DOC "SSL library") -find_library(ZLIB z "Zlib library") +if( DO_AUTHSERVER ) + message("* Build authserver : Yes (default)") +else() + message("* Build authserver : No") +endif() -if(DO_MYSQL) - message("* With MySQL") - FIND_MYSQL() - ADD_DEFINITIONS(-DDO_MYSQL) -endif(DO_MYSQL) +if( DO_WORLDSERVER ) + message("* Build worldserver : Yes (default)") +else() + message("* Build worldserver : No") +endif() -if(DO_SCRIPTS) - message("* With Trinity Scripts") - ADD_DEFINITIONS(-DDO_SCRIPTS) - add_definitions(-D_TRINITY_SCRIPT_CONFIG='"${CONF_DIR}/trinitycore.conf"') -else (DO_SCRIPTS) - message("* Without Trinity Scripts") -endif(DO_SCRIPTS) +if( DO_SCRIPTS ) + message("* Build Trinityscripts : Yes (default)") + add_definitions(-DDO_SCRIPTS) +else() + message("* Build Trinityscripts : No") +endif() -message("-- Miscellaneus options:") +if( DO_TOOLS ) + message("* Build map/vmap tools : Yes") +else() + message("* Build map/vmap tools : No (default)") +endif() -if(DO_CLI) - message("* With CLI") - add_definitions(-DENABLE_CLI) -else (DO_CLI) - message(* Without CLI) -endif(DO_CLI) +if( DO_CLI ) + message("* Build with CLI : Yes (default)") + add_definitions(-DENABLE_CLI) +else() + message("* Build with CLI : No") +endif() -if(DO_RA) - message("* With RA") - add_definitions(-DENABLE_RA) -else(DO_RA) - message("* Without RA") -endif(DO_RA) +if( DO_RA ) + message("* Build with RA : Yes") + add_definitions(-DENABLE_RA) +else() + message("* Build with RA : No (default)") +endif() -if(DO_DEBUG) - message("* Debug mode ON") - add_definitions(-g -DTRINITY_DEBUG) -endif(DO_DEBUG) +if( DO_DEBUG ) + message("* Build in debug-mode : Yes") + add_definitions(-g -DTRINITY_DEBUG) +else() + message("* Build in debug-mode : No (default)") +endif() -if(DO_WARN) - message("* All warnings mode") +if( DO_PCH ) + message("* Use PCH : Yes (default)") +else() + message("* Use PCH : No") +endif() + +if( DO_WARN ) + message("* Show all warnings : Yes") + if( UNIX ) add_definitions(-Wall -Wfatal-errors -Wextra) -endif(DO_WARN) + endif() +else() + message("* Show compile-warnings : No (default)") + if( UNIX ) + add_definitions(--no-warnings) # makes build look nice, no warnings shown at all, only errors + elseif( WIN32 ) + # Disable warnings in Visual Studio 8 and above + if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267") + endif() + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + endif() +endif() -if(UNIX) - if(CENTOS) - add_definitions(-DCENTOS) - message("* Building with termcap") - FIND_TERMCAP() - else(CENTOS) - message("* Building with readline") - FIND_READLINE() - endif(CENTOS) -endif(UNIX) +if( DO_SQL ) + message("* Install SQL-files : Yes") +else() + message("* Install SQL-files : No (default)") +endif() -FIND_ACE(ACE) -if(ACE_FOUND) - message(STATUS "Found ACE library: ${ACE_LIBRARY}") - message(STATUS "Include dir is: ${ACE_INCLUDE_DIR}") -else(ACE_FOUND) - message(SEND_ERROR "** ACE library not found! Trinity Core cannot be compiled!") - message(SEND_ERROR "** Please build ACE from http://www.cs.wustl.edu/~schmidt/ACE.html") - #For now remove msg about install from repo, as ubuntu/debian don't have needed ver in repos. - #message(SEND_ERROR "** your distro may provide a binary for ACE e.g. for ubuntu try apt-get install libace-dev") - return() - #set(BUILD_ACE 1) - #set(ACE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/ACE_wrappers ${CMAKE_BINARY_DIR}/dep/ACE_wrappers") - #set(ACE_LIBRARY ACE) - #message(STATUS "I will try to build ACE from: ${ACE_INCLUDE_DIR}") - #message(STATUS "And link using: ${ACE_LIBRARY}") -endif(ACE_FOUND) - -#somehow line below don't work. so for now change it to if exist -#check_include_files(${ACE_INCLUDE_DIR}/ace/Stack_Trace.h HAVE_ACE_STACK_TRACE_H) -if(EXISTS ${ACE_INCLUDE_DIR}/ace/Stack_Trace.h) - set(HAVE_ACE_STACK_TRACE_H 1) -else(EXISTS ${ACE_INCLUDE_DIR}/ace/Stack_Trace.h) - message(STATUS "** Your libace is out of date. Please update your libace!") -endif(EXISTS ${ACE_INCLUDE_DIR}/ace/Stack_Trace.h) +message("") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) -if(CMAKE_SYSTEM_NAME MATCHES "Darwin") +# Little tweak for OS X +if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) set(MACOSX 1) set(OSX_LIBS /opt/local/lib/libcrypto.dylib) add_definitions(-D__ASSERTMACROS__) -endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") +endif() +# Some small tweaks for Visual Studio 7 and above. +if( MSVC ) + # Mark 32 bit executables large address aware so they can use > 2GB address space + if(CMAKE_SIZEOF_VOID_P MATCHES 4) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") + endif() +endif() -add_definitions(--no-warnings) #to make build look nice, no gcc nazi warnings. - -set(CMAKE_SKIP_BUILD_RPATH FALSE) -set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +set(CMAKE_SKIP_BUILD_RPATH 0) +set(CMAKE_BUILD_WITH_INSTALL_RPATH 0) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1) -add_subdirectory(dep) +add_subdirectory(externals) add_subdirectory(src) -if(DO_SQL) - message("* Copy SQL files ON") - add_subdirectory(sql) -endif(DO_SQL) +if( DO_SQL ) + add_subdirectory(sql) +endif() + diff --git a/README b/README index 4263f79f7ff..d2bcce8f86c 100644 --- a/README +++ b/README @@ -40,4 +40,4 @@ SQL files to create the database can be found in the sql directory. Files to update your database from an older revision/version can be found in the sql/updates directory. -See the INSTALL.linux file for installation instructions on Linux. +See the docs/UnixInstall.txt file for installation instructions on Linux. diff --git a/THANKS b/THANKS index 1ad0133fe27..8fc39947833 100644 --- a/THANKS +++ b/THANKS @@ -64,4 +64,4 @@ footman, elron103, make_the_king, destros, MetaphysicalDrama, disassebler, Malcrom, Vladmimír Lipták, retriman, hyriuu, Smakapotatis, PainKiller, bkhorizon, n0n4m3, Chesterfield, Frankir, Wowka321, Morpheux, p0wer, Ouden, toshik, laise, yavi, Splinter, Syntec, Arthas, denyde, unholy, -Vaughner, blackmanos, edrinn, Supabad. +Vaughner, blackmanos, edrinn, Supabad, click, silverice, SupaBad, Xanadu diff --git a/cmake/FindACE.cmake b/cmake/FindACE.cmake new file mode 100644 index 00000000000..4ade5f64b03 --- /dev/null +++ b/cmake/FindACE.cmake @@ -0,0 +1,65 @@ +# +# Find the ACE client includes and library +# + +# This module defines +# ACE_INCLUDE_DIR, where to find ace.h +# ACE_LIBRARIES, the libraries to link against +# ACE_FOUND, if false, you cannot build anything that requires ACE + +# also defined, but not for general use are +# ACE_LIBRARY, where to find the ACE library. + +set( ACE_FOUND 0 ) + +if ( UNIX ) + FIND_PATH( ACE_INCLUDE_DIR + NAMES + ace/ACE.h + PATHS + /usr/include + /usr/include/ace + /usr/local/include + /usr/local/include/ace + $ENV{ACE_ROOT} + $ENV{ACE_ROOT}/include + ${CMAKE_SOURCE_DIR}/externals/ace + DOC + "Specify include-directories that might contain ace.h here." + ) + FIND_LIBRARY( ACE_LIBRARY + NAMES + ace ACE + PATHS + /usr/lib + /usr/lib/ace + /usr/local/lib + /usr/local/lib/ace + /usr/local/ace/lib + $ENV{ACE_ROOT}/lib + $ENV{ACE_ROOT} + DOC "Specify library-locations that might contain the ACE library here." + ) + +# FIND_LIBRARY( ACE_EXTRA_LIBRARIES +# NAMES +# z zlib +# PATHS +# /usr/lib +# /usr/local/lib +# DOC +# "if more libraries are necessary to link into ACE, specify them here." +# ) + + if ( ACE_LIBRARY ) + if ( ACE_INCLUDE_DIR ) + set( ACE_FOUND 1 ) + message( STATUS "Found ACE library: ${ACE_LIBRARY}") + message( STATUS "Found ACE headers: ${ACE_INCLUDE_DIR}") + else ( ACE_INCLUDE_DIR ) + message(FATAL_ERROR "Could not find ACE headers! Please install ACE libraries and headers") + endif ( ACE_INCLUDE_DIR ) + endif ( ACE_LIBRARY ) + + mark_as_advanced( ACE_FOUND ACE_LIBRARY ACE_EXTRA_LIBRARIES ACE_INCLUDE_DIR ) +endif (UNIX) diff --git a/cmake/FindAce.cmake b/cmake/FindAce.cmake deleted file mode 100644 index 0721cdecfa4..00000000000 --- a/cmake/FindAce.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# This script is taken from BFilter project, thanks to original authors. -# - Locate the ACE library -# This module defines -# ACE_FOUND -- true if ACE was found -# ACE_LIBRARY -- the library to link against -# ACE_INCLUDE_DIR -- path to ace/ACE.h -MACRO(FIND_ACE LIBNAME) - GET_FILENAME_COMPONENT(parent_dir_ "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) - FIND_PATH( - ACE_INCLUDE_DIR ace/ACE.h - PATHS /usr/include /usr/local/include - "${CMAKE_INSTALL_PREFIX}/include" "${parent_dir_}/ACE_wrappers" - DOC "Path to ace/ACE.h" - ) - - # This prevents it being taken from cache. - but also broke cmake -i, so we dont use it - # SET(ACE_LIBRARY ACE_LIBRARY-NOTFOUND) - - FIND_LIBRARY( - ACE_LIBRARY "${LIBNAME}" - PATHS /usr/lib /usr/local/lib - "${CMAKE_INSTALL_PREFIX}/lib" "${parent_dir_}/ACE_wrappers/ace" - DOC "Path to ACE library file" - ) - IF(ACE_INCLUDE_DIR AND ACE_LIBRARY) - SET(ACE_FOUND TRUE) - ELSE(ACE_INCLUDE_DIR AND ACE_LIBRARY) - SET(ACE_FOUND FALSE) - ENDIF(ACE_INCLUDE_DIR AND ACE_LIBRARY) -ENDMACRO(FIND_ACE) - diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake new file mode 100644 index 00000000000..aa62d89d9b5 --- /dev/null +++ b/cmake/FindMySQL.cmake @@ -0,0 +1,152 @@ +# +# Find the MySQL client includes and library +# + +# This module defines +# MYSQL_INCLUDE_DIR, where to find mysql.h +# MYSQL_LIBRARIES, the libraries to link against to connect to MySQL +# MYSQL_FOUND, if false, you cannot build anything that requires MySQL. + +# also defined, but not for general use are +# MYSQL_LIBRARY, where to find the MySQL library. + +set( MYSQL_FOUND 0 ) + +if( UNIX ) + set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH + "preferred path to MySQL (mysql_config)" + ) + + find_program(MYSQL_CONFIG mysql_config + ${MYSQL_CONFIG_PREFER_PATH} + /usr/local/mysql/bin/ + /usr/local/bin/ + /usr/bin/ + ) + + if( MYSQL_CONFIG ) + message(STATUS "Using mysql-config: ${MYSQL_CONFIG}") + # set INCLUDE_DIR + exec_program(${MYSQL_CONFIG} + ARGS --include + OUTPUT_VARIABLE MY_TMP + ) + + string(REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}") + set(MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL) + #message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}") + # set LIBRARY_DIR + exec_program(${MYSQL_CONFIG} + ARGS --libs_r + OUTPUT_VARIABLE MY_TMP + ) + set(MYSQL_ADD_LIBRARIES "") + string(REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}") + foreach(LIB ${MYSQL_LIB_LIST}) + string(REGEX REPLACE "[ ]*-l([^ ]*)" "\\1" LIB "${LIB}") + list(APPEND MYSQL_ADD_LIBRARIES "${LIB}") + #message("[DEBUG] MYSQL ADD_LIBRARIES : ${MYSQL_ADD_LIBRARIES}") + endforeach(LIB ${MYSQL_LIB_LIST}) + + set(MYSQL_ADD_LIBRARIES_PATH "") + string(REGEX MATCHALL "-L[^ ]*" MYSQL_LIBDIR_LIST "${MY_TMP}") + foreach(LIB ${MYSQL_LIBDIR_LIST}) + string(REGEX REPLACE "[ ]*-L([^ ]*)" "\\1" LIB "${LIB}") + list(APPEND MYSQL_ADD_LIBRARIES_PATH "${LIB}") + #message("[DEBUG] MYSQL ADD_LIBRARIES_PATH : ${MYSQL_ADD_LIBRARIES_PATH}") + endforeach(LIB ${MYSQL_LIBS}) + + else( MYSQL_CONFIG ) + set(MYSQL_ADD_LIBRARIES "") + list(APPEND MYSQL_ADD_LIBRARIES "mysqlclient_r") + endif( MYSQL_CONFIG ) +endif( UNIX ) + +find_path(MYSQL_INCLUDE_DIR + NAMES + mysql.h + PATHS + ${MYSQL_ADD_INCLUDE_PATH} + /usr/include + /usr/include/mysql + /usr/local/include + /usr/local/include/mysql + /usr/local/mysql/include + "C:/Program Files/MySQL/include" + "C:/Program Files/MySQL/MySQL Server 5.0/include" + "C:/Program Files/MySQL/MySQL Server 5.1/include" + "C:/MySQL/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/include" + "c:/msys/local/include" + DOC + "Specify the directory containing mysql.h." +) + +if( UNIX ) +foreach(LIB ${MYSQL_ADD_LIBRARIES}) + find_library( MYSQL_LIBRARY + NAMES + mysql libmysql ${LIB} + PATHS + ${MYSQL_ADD_LIBRARIES_PATH} + /usr/lib + /usr/lib/mysql + /usr/local/lib + /usr/local/lib/mysql + /usr/local/mysql/lib + DOC "Specify the location of the mysql library here." + ) +endforeach(LIB ${MYSQL_ADD_LIBRARY}) +endif( UNIX ) + +if( WIN32 ) + find_library( MYSQL_LIBRARY + NAMES + mysql libmysql ${LIB} + PATHS + ${MYSQL_ADD_LIBRARIES_PATH} + "C:/Program Files/MySQL/lib" + "C:/Program Files/MySQL/MySQL Server 5.0/lib/opt" + "C:/Program Files/MySQL/MySQL Server 5.1/lib/opt" + "C:/MySQL/lib/debug" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" + "c:/msys/local/include" + DOC "Specify the location of the mysql library here." + ) +endif( WIN32 ) + +# On Windows you typically don't need to include any extra libraries +# to build MYSQL stuff. + +if( NOT WIN32 ) + find_library( MYSQL_EXTRA_LIBRARIES + NAMES + z zlib + PATHS + /usr/lib + /usr/local/lib + DOC + "if more libraries are necessary to link in a MySQL client (typically zlib), specify them here." + ) +else( NOT WIN32 ) + set( MYSQL_EXTRA_LIBRARIES "" ) +endif( NOT WIN32 ) + +if( MYSQL_LIBRARY ) + if( MYSQL_INCLUDE_DIR ) + set( MYSQL_FOUND 1 ) + message(STATUS "Found MySQL library: ${MYSQL_LIBRARY}") + message(STATUS "Found MySQL headers: ${MYSQL_INCLUDE_DIR}") + else( MYSQL_INCLUDE_DIR ) + message(FATAL_ERROR "Could not find MySQL headers! Please install the development-libraries and headers.") + endif( MYSQL_INCLUDE_DIR ) + mark_as_advanced( MYSQL_FOUND MYSQL_LIBRARY MYSQL_EXTRA_LIBRARIES MYSQL_INCLUDE_DIR ) +else( MYSQL_LIBRARY ) + message(FATAL_ERROR "Could not find the MySQL libraries! Please install the development-libraries and headers.") +endif( MYSQL_LIBRARY ) diff --git a/cmake/FindMySql.cmake b/cmake/FindMySql.cmake deleted file mode 100644 index e149cd4eaf0..00000000000 --- a/cmake/FindMySql.cmake +++ /dev/null @@ -1,102 +0,0 @@ -# - Find MySQL -# Find the MySQL includes and client library -# This module defines -# MYSQL_INCLUDE_DIR, where to find mysql.h -# MYSQL_LIBRARIES, the libraries needed to use MySQL. -# MYSQL_FOUND, If false, do not try to use MySQL. -# -# Copyright (c) 2006, Jaroslaw Staniek, -# Lot of adustmens by Michal Cihar -# -# vim: expandtab sw=4 ts=4 sts=4: -# -# Redistribution and use is allowed according to the terms of the BSD license. - -MACRO(FIND_MYSQL) -if(UNIX) - set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH - "preferred path to MySQL (mysql_config)") - find_program(MYSQL_CONFIG mysql_config - ${MYSQL_CONFIG_PREFER_PATH} - /usr/local/mysql/bin/ - /usr/local/bin/ - /usr/bin/ - ) - - if(MYSQL_CONFIG) - message(STATUS "Using mysql-config: ${MYSQL_CONFIG}") - # set INCLUDE_DIR - exec_program(${MYSQL_CONFIG} - ARGS --include - OUTPUT_VARIABLE MY_TMP) - - string(REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}") - - set(MYSQL_ADD_INCLUDE_DIR ${MY_TMP} CACHE FILEPATH INTERNAL) - - # set LIBRARY_DIR - exec_program(${MYSQL_CONFIG} - ARGS --libs_r - OUTPUT_VARIABLE MY_TMP) - - set(MYSQL_ADD_LIBRARIES "") - - string(REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}") - foreach(LIB ${MYSQL_LIB_LIST}) - string(REGEX REPLACE "[ ]*-l([^ ]*)" "\\1" LIB "${LIB}") - list(APPEND MYSQL_ADD_LIBRARIES "${LIB}") - endforeach(LIB ${MYSQL_LIBS}) - - set(MYSQL_ADD_LIBRARY_PATH "") - - string(REGEX MATCHALL "-L[^ ]*" MYSQL_LIBDIR_LIST "${MY_TMP}") - foreach(LIB ${MYSQL_LIBDIR_LIST}) - string(REGEX REPLACE "[ ]*-L([^ ]*)" "\\1" LIB "${LIB}") - list(APPEND MYSQL_ADD_LIBRARY_PATH "${LIB}") - endforeach(LIB ${MYSQL_LIBS}) - - else(MYSQL_CONFIG) - set(MYSQL_ADD_LIBRARIES "") - list(APPEND MYSQL_ADD_LIBRARIES "mysqlclient") - endif(MYSQL_CONFIG) -else(UNIX) - set(MYSQL_ADD_INCLUDE_DIR "c:/msys/local/include" CACHE FILEPATH INTERNAL) - set(MYSQL_ADD_LIBRARY_PATH "c:/msys/local/lib" CACHE FILEPATH INTERNAL) -ENDIF(UNIX) - -find_path(MYSQL_INCLUDE_DIR mysql.h - /usr/local/include - /usr/local/include/mysql - /usr/local/mysql/include - /usr/local/mysql/include/mysql - /usr/include - /usr/include/mysql - ${MYSQL_ADD_INCLUDE_DIR} -) - -set(TMP_MYSQL_LIBRARIES "") - -foreach(LIB ${MYSQL_ADD_LIBRARIES}) - find_library("MYSQL_LIBRARIES_${LIB}" NAMES ${LIB} - PATHS - ${MYSQL_ADD_LIBRARY_PATH} - /usr/lib/mysql - /usr/local/lib - /usr/local/lib/mysql - /usr/local/mysql/lib - ) - list(APPEND TMP_MYSQL_LIBRARIES "${MYSQL_LIBRARIES_${LIB}}") -endforeach(LIB ${MYSQL_ADD_LIBRARIES}) - -set(MYSQL_LIBRARIES ${TMP_MYSQL_LIBRARIES} CACHE FILEPATH INTERNAL) - -if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) - set(MYSQL_FOUND TRUE CACHE INTERNAL "MySQL found") - message(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}") -else(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) - set(MYSQL_FOUND FALSE CACHE INTERNAL "MySQL found") - message(STATUS "MySQL not found.") -endif(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) - -mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES) -ENDMACRO(FIND_MYSQL) \ No newline at end of file diff --git a/cmake/FindOpenSSL.cmake b/cmake/FindOpenSSL.cmake new file mode 100644 index 00000000000..d045b539b98 --- /dev/null +++ b/cmake/FindOpenSSL.cmake @@ -0,0 +1,92 @@ +# +# Find the OpenSSL client includes and library +# + +# This module defines +# OPENSSL_INCLUDE_DIR, where to find openssl.h +# OPENSSL_LIBRARIES, the libraries to link against to connect to MySQL +# OPENSSL_FOUND, if false, you cannot build anything that requires MySQL. + +# also defined, but not for general use are +# OPENSSL_LIBRARY, where to find the MySQL library. + +if( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) + # in cache already + set(OPENSSL_FOUND 1) +else( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) + set(OPENSSL_FOUND 0) + + if(WIN32) + if(PLATFORM MATCHES X64) + set(TMP_OPENSSL_INCLUDE_DIR + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/include/openssl" + ) + set(TMP_OPENSSL_LIBRARIES + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/lib" + ) + else() + set(TMP_OPENSSL_INCLUDE_DIR + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include/openssl" + ) + set(TMP_OPENSSL_LIBRARIES + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib" + ) + endif() + endif() + + find_path(OPENSSL_INCLUDE_DIR + NAMES + ssl.h + PATHS + /usr/include + /usr/include/openssl + /usr/local/include + /usr/local/include/openssl + /usr/local/openssl/include + ${TMP_OPENSSL_INCLUDE_DIR} + DOC + "Specify the directory containing openssl.h." + ) + + find_library(OPENSSL_LIBRARIES + NAMES + ssleay32 + ssl + PATHS + /usr/lib + /usr/lib/ssl + /usr/local/lib + /usr/local/lib/ssl + /usr/local/ssl/lib + ${TMP_OPENSSL_LIBRARIES} + DOC "Specify the OpenSSL library here." + ) + + if( WIN32 ) + find_library(OPENSSL_EXTRA_LIBRARIES + NAMES + libeay32 + PATHS + ${TMP_OPENSSL_LIBRARIES} + DOC + "if more libraries are necessary to link in a OpenSSL client, specify them here." + ) + endif( WIN32 ) + + if( OPENSSL_LIBRARIES ) + if( OPENSSL_INCLUDE_DIR ) + set( OPENSSL_FOUND 1 ) + message(STATUS "Found OpenSSL library: ${OPENSSL_LIBRARIES}") + message(STATUS "Found OpenSSL headers: ${OPENSSL_INCLUDE_DIR}") + else ( OPENSSL_INCLUDE_DIR ) + message(FATAL_ERROR "Could not find OpenSSL headers! Please install the development-headers") + endif( OPENSSL_INCLUDE_DIR ) + else( OPENSSL_LIBRARIES ) + message(FATAL_ERROR "Could not find OpenSSL libraries! Please install the library before continuing") + endif( OPENSSL_LIBRARIES ) + mark_as_advanced( OPENSSL_FOUND OPENSSL_LIBRARIES OPENSSL_EXTRA_LIBRARIES OPENSSL_INCLUDE_DIR ) +endif( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) diff --git a/cmake/PCH.cmake b/cmake/FindPCHSupport.cmake similarity index 50% rename from cmake/PCH.cmake rename to cmake/FindPCHSupport.cmake index e7da9349cb6..d96a287e1a3 100644 --- a/cmake/PCH.cmake +++ b/cmake/FindPCHSupport.cmake @@ -1,7 +1,4 @@ -# -# This file is for CMake 2.6 -# -# - Try to find precompiled headers support for GCC 3.4 and 4.x +# - Try to find precompiled headers support for GCC 3.4 and 4.x (and MSVC) # Once done this will define: # # Variable: @@ -16,107 +13,116 @@ IF(CMAKE_COMPILER_IS_GNUCXX) EXEC_PROGRAM( - ${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE gcc_compiler_version) + ${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE gcc_compiler_version + ) #MESSAGE("GCC Version: ${gcc_compiler_version}") IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") + SET(PCHSupport_FOUND TRUE) + ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") + IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") SET(PCHSupport_FOUND TRUE) + ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - + SET(_PCH_include_prefix "-I") +ELSE(CMAKE_COMPILER_IS_GNUCXX) + + IF(WIN32) + SET(PCHSupport_FOUND TRUE) # for experimental msvc support + SET(_PCH_include_prefix "/I") + ELSE(WIN32) + SET(PCHSupport_FOUND FALSE) + ENDIF(WIN32) + ENDIF(CMAKE_COMPILER_IS_GNUCXX) - + MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) - STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) - SET(return_value ${${_flags_var_name}} ) - + SET(${_out_compile_flags} ${${_flags_var_name}} ) + IF(CMAKE_COMPILER_IS_GNUCXX) - GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) - IF(${_targetType} STREQUAL SHARED_LIBRARY) - LIST(APPEND return_value "${return_value} -fPIC") - ENDIF(${_targetType} STREQUAL SHARED_LIBRARY) - + IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32) + LIST(APPEND ${_out_compile_flags} "${${_out_compile_flags}} -fPIC") + ENDIF() + + ELSE(CMAKE_COMPILER_IS_GNUCXX) + ## TODO ... ? or does it work out of the box ENDIF(CMAKE_COMPILER_IS_GNUCXX) - + GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) FOREACH(item ${DIRINC}) - LIST(APPEND return_value "${_PCH_include_prefix}${item}") + LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}${item}") ENDFOREACH(item) - - SET(_build_type "${CMAKE_BUILD_TYPE}") - #MESSAGE(STATUS "build type: `${CMAKE_BUILD_TYPE}'") - - IF (NOT _build_type) - SET(_build_type "Debug") - ENDIF (NOT _build_type) - - string(TOUPPER ${_build_type} _build_type) - SET(_def_name "COMPILE_DEFINITIONS_${_build_type}") - GET_DIRECTORY_PROPERTY(_directory_flags ${_def_name}) - FOREACH(item ${_directory_flags}) - LIST(APPEND return_value "-D${item}") - ENDFOREACH(item) - GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS) - LIST(APPEND ${_out_compile_flags} ${return_value}) - FOREACH(_def ${_directory_flags}) - LIST(APPEND ${_out_compile_flags} "-D${_def}") - ENDFOREACH(_def) + GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) + GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) + #MESSAGE("_directory_flags ${_directory_flags} ${_global_definitions}" ) + LIST(APPEND ${_out_compile_flags} ${_directory_flags}) + LIST(APPEND ${_out_compile_flags} ${_global_definitions}) LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS} ) - - SEPARATE_ARGUMENTS(${_out_compile_flags}) - -ENDMACRO(_PCH_GET_COMPILE_FLAGS) -# -# -# + SEPARATE_ARGUMENTS(${_out_compile_flags}) + +ENDMACRO(_PCH_GET_COMPILE_FLAGS) MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp) SET(${_dephelp} ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch_dephelp.cxx) FILE(WRITE ${${_dephelp}} -"#include \"${_include_file}\" +"#include \"${_include_file}\" int testfunction() { return 0; } " - ) + ) ENDMACRO(_PCH_WRITE_PCHDEP_CXX ) -# -# -# - MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output) - FILE(TO_NATIVE_PATH ${_input} _native_input) - FILE(TO_NATIVE_PATH ${_output} _native_output) - + FILE(TO_NATIVE_PATH ${_input} _native_input) + FILE(TO_NATIVE_PATH ${_output} _native_output) + + + IF(CMAKE_COMPILER_IS_GNUCXX) + IF(CMAKE_CXX_COMPILER_ARG1) + # remove leading space in compiler argument + STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) + + SET(${out_command} + ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} + ) + ELSE(CMAKE_CXX_COMPILER_ARG1) + SET(${out_command} + ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} + ) + ENDIF(CMAKE_CXX_COMPILER_ARG1) + ELSE(CMAKE_COMPILER_IS_GNUCXX) + + SET(_dummy_str "#include <${_input}>") + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch_dummy.cpp ${_dummy_str}) + + SET(${out_command} + ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} /c /Fp${_native_output} /Yc${_native_input} pch_dummy.cpp + ) + #/out:${_output} + + ENDIF(CMAKE_COMPILER_IS_GNUCXX) - IF(CMAKE_COMPILER_IS_GNUCXX) - SET(${out_command} - ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} - ) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - ENDMACRO(_PCH_GET_COMPILE_COMMAND ) -# -# -# + MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn ) FILE(TO_NATIVE_PATH ${_pch_path} _native_pch_path) - + IF(CMAKE_COMPILER_IS_GNUCXX) # for use with distcc and gcc >4.0.1 if preprocessed files are accessible # on all remote machines set @@ -130,22 +136,22 @@ MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn ) SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} " ) ENDIF (_dowarn) ELSE(CMAKE_COMPILER_IS_GNUCXX) - - set(${_cflags} "/Fp${_native_pch_path} /Yu${_header_name}" ) - - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - + + set(${_cflags} "/Fp${_native_pch_path} /Yu${_header_name}" ) + + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + ENDMACRO(_PCH_GET_TARGET_COMPILE_FLAGS ) MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output) GET_FILENAME_COMPONENT(_name ${_input} NAME) GET_FILENAME_COMPONENT(_path ${_input} PATH) - SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.h++") + SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.gch") ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input) MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) - + # to do: test whether compiler flags match between target _targetName # and _pch_output_to_use GET_FILENAME_COMPONENT(_name ${_input} NAME) @@ -159,26 +165,26 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) _PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn}) # MESSAGE("Add flags ${_target_cflags} to ${_targetName} " ) - SET_TARGET_PROPERTIES(${_targetName} - PROPERTIES - COMPILE_FLAGS ${_target_cflags} - ) + SET_TARGET_PROPERTIES(${_targetName} + PROPERTIES + COMPILE_FLAGS ${_target_cflags} + ) ADD_CUSTOM_TARGET(pch_Generate_${_targetName} - DEPENDS ${_pch_output_to_use} - ) - + DEPENDS ${_pch_output_to_use} + ) + ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName} ) - + ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) MACRO(ADD_PRECOMPILED_HEADER _targetName _input) SET(_PCH_current_target ${_targetName}) - + IF(NOT CMAKE_BUILD_TYPE) - MESSAGE(FATAL_ERROR - "This is the ADD_PRECOMPILED_HEADER macro. " + MESSAGE(FATAL_ERROR + "This is the ADD_PRECOMPILED_HEADER macro. " "You must set CMAKE_BUILD_TYPE!" ) ENDIF(NOT CMAKE_BUILD_TYPE) @@ -189,7 +195,6 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input) SET(_dowarn 1) ENDIF("${ARGN}" STREQUAL "0") - GET_FILENAME_COMPONENT(_name ${_input} NAME) GET_FILENAME_COMPONENT(_path ${_input} PATH) GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_input} _output) @@ -200,42 +205,39 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input) _PCH_WRITE_PCHDEP_CXX(${_targetName} ${_input} _pch_dephelp_cxx) IF(${_targetType} STREQUAL SHARED_LIBRARY) - ADD_LIBRARY(${_targetName}_pch_dephelp SHARED ${_pch_dephelp_cxx} ) + ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx} ) ELSE(${_targetType} STREQUAL SHARED_LIBRARY) ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx}) ENDIF(${_targetType} STREQUAL SHARED_LIBRARY) FILE(MAKE_DIRECTORY ${_outdir}) - + _PCH_GET_COMPILE_FLAGS(_compile_FLAGS) - + #MESSAGE("_compile_FLAGS: ${_compile_FLAGS}") - #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}") + #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}") SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${_name} PROPERTIES GENERATED 1) ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name} COMMAND ${CMAKE_COMMAND} -E copy ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} # ensure same directory! Required by gcc DEPENDS ${_input} ) - + #message("_command ${_input} ${_output}") _PCH_GET_COMPILE_COMMAND(_command ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_output} ) - #message("${_command}") - + #message(${_input} ) #message("_output ${_output}") ADD_CUSTOM_COMMAND( - OUTPUT ${_output} + OUTPUT ${_output} COMMAND ${_command} DEPENDS ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_targetName}_pch_dephelp - ) - + ) ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_input} ${_output} ${_dowarn}) ENDMACRO(ADD_PRECOMPILED_HEADER) - # Generates the use of precompiled in a target, # without using depency targets (2 extra for each target) # Using Visual, must also add ${_targetName}_pch to sources @@ -243,73 +245,71 @@ ENDMACRO(ADD_PRECOMPILED_HEADER) MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input) - if(CMAKE_GENERATOR MATCHES Visual*) + if(CMAKE_GENERATOR MATCHES Visual*) - SET(_dummy_str "#include \"${_input}\"\n" - "// This is required to suppress LNK4221. Very annoying.\n" - "void *g_${_targetName}Dummy = 0\;\n") + SET(_dummy_str "#include \"${_input}\"\n" + "// This is required to suppress LNK4221. Very annoying.\n" + "void *g_${_targetName}Dummy = 0\;\n") - # Use of cxx extension for generated files (as Qt does) - SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx) - if(EXISTS ${${_targetName}_pch}) - # Check if contents is the same, if not rewrite - # todo - else(EXISTS ${${_targetName}_pch}) - FILE(WRITE ${${_targetName}_pch} ${_dummy_str}) - endif(EXISTS ${${_targetName}_pch}) - endif(CMAKE_GENERATOR MATCHES Visual*) + # Use of cxx extension for generated files (as Qt does) + SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx) + if(EXISTS ${${_targetName}_pch}) + # Check if contents is the same, if not rewrite + # todo + else(EXISTS ${${_targetName}_pch}) + FILE(WRITE ${${_targetName}_pch} ${_dummy_str}) + endif(EXISTS ${${_targetName}_pch}) + endif(CMAKE_GENERATOR MATCHES Visual*) ENDMACRO(GET_NATIVE_PRECOMPILED_HEADER) - MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _input) - IF( "${ARGN}" STREQUAL "0") - SET(_dowarn 0) - ELSE( "${ARGN}" STREQUAL "0") - SET(_dowarn 1) - ENDIF("${ARGN}" STREQUAL "0") - - if(CMAKE_GENERATOR MATCHES Visual*) - # Auto include the precompile (useful for moc processing, since the use of - # precompiled is specified at the target level - # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) + IF( "${ARGN}" STREQUAL "0") + SET(_dowarn 0) + ELSE( "${ARGN}" STREQUAL "0") + SET(_dowarn 1) + ENDIF("${ARGN}" STREQUAL "0") - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - if (${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - endif(${oldProps} MATCHES NOTFOUND) + if(CMAKE_GENERATOR MATCHES Visual*) + # Auto include the precompile (useful for moc processing, since the use of + # precompiled is specified at the target level + # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) - SET(newProperties "${oldProps} /Yu\"${_input}\" /FI\"${_input}\"") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") - - #also inlude ${oldProps} to have the same compile options - SET_SOURCE_FILES_PROPERTIES(${${_targetName}_pch} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}\"") - - else(CMAKE_GENERATOR MATCHES Visual*) - - if (CMAKE_GENERATOR MATCHES Xcode) - # For Xcode, cmake needs my patch to process - # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties - - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - if (${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - endif(${oldProps} MATCHES NOTFOUND) + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + if (${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + endif(${oldProps} MATCHES NOTFOUND) - # When buiding out of the tree, precompiled may not be located - # Use full path instead. - GET_FILENAME_COMPONENT(fullPath ${_input} ABSOLUTE) + SET(newProperties "${oldProps} /Yu\"${_input}.h\" /FI\"${_input}.h\"") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") + #also inlude ${oldProps} to have the same compile options + SET_SOURCE_FILES_PROPERTIES(${_input}.cpp PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}.h\"") - else (CMAKE_GENERATOR MATCHES Xcode) + else(CMAKE_GENERATOR MATCHES Visual*) - #Fallback to the "old" precompiled suppport - #ADD_PRECOMPILED_HEADER(${_targetName} ${_input} ${_dowarn}) - endif(CMAKE_GENERATOR MATCHES Xcode) - endif(CMAKE_GENERATOR MATCHES Visual*) + if (CMAKE_GENERATOR MATCHES Xcode) + # For Xcode, cmake needs my patch to process + # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties -ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + if (${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + endif(${oldProps} MATCHES NOTFOUND) + # When buiding out of the tree, precompiled may not be located + # Use full path instead. + GET_FILENAME_COMPONENT(fullPath ${_input} ABSOLUTE) + + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") + + else (CMAKE_GENERATOR MATCHES Xcode) + + #Fallback to the "old" precompiled suppport + #ADD_PRECOMPILED_HEADER(${_targetName} ${_input} ${_dowarn}) + endif(CMAKE_GENERATOR MATCHES Xcode) + endif(CMAKE_GENERATOR MATCHES Visual*) + +ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) \ No newline at end of file diff --git a/cmake/FindPlatform.cmake b/cmake/FindPlatform.cmake new file mode 100644 index 00000000000..60ce00149b3 --- /dev/null +++ b/cmake/FindPlatform.cmake @@ -0,0 +1,16 @@ +# default to x86 platform. We'll check for X64 in a bit +SET(PLATFORM X86) + +# This definition is necessary to work around a bug with Intellisense described +# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper +# debugger functionality. + +IF(CMAKE_SIZEOF_VOID_P MATCHES 8) + MESSAGE(STATUS "Detected 64-bit platform.") + if(WIN32) + ADD_DEFINITIONS("-D_WIN64") + ENDIF() + SET (PLATFORM X64) +ELSE() + MESSAGE(STATUS "Detected 32-bit platform.") +ENDIF() diff --git a/opt/cleanup/tab2spaces.sh b/contrib/cleanup/tab2spaces.sh similarity index 100% rename from opt/cleanup/tab2spaces.sh rename to contrib/cleanup/tab2spaces.sh diff --git a/opt/cleanup/whitespace.sh b/contrib/cleanup/whitespace.sh similarity index 100% rename from opt/cleanup/whitespace.sh rename to contrib/cleanup/whitespace.sh diff --git a/opt/conf_merge/README b/contrib/conf_merge/README similarity index 100% rename from opt/conf_merge/README rename to contrib/conf_merge/README diff --git a/opt/conf_merge/index.php b/contrib/conf_merge/index.php similarity index 100% rename from opt/conf_merge/index.php rename to contrib/conf_merge/index.php diff --git a/opt/conf_merge/merge.php b/contrib/conf_merge/merge.php similarity index 100% rename from opt/conf_merge/merge.php rename to contrib/conf_merge/merge.php diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt deleted file mode 100644 index e1398d989ff..00000000000 --- a/dep/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -#if(BUILD_ACE) -#add_subdirectory(ACE_wrappers) -#endif(BUILD_ACE) -#add_subdirectory(include) -#add_subdirectory(lib) -add_subdirectory(src) diff --git a/dep/include/ace/Cleanup.inl b/dep/include/ace/Cleanup.inl deleted file mode 100644 index 9c36d6b1ffd..00000000000 --- a/dep/include/ace/Cleanup.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: Cleanup.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Cleanup::ACE_Cleanup (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dev_Poll_Reactor.inl b/dep/include/ace/Dev_Poll_Reactor.inl deleted file mode 100644 index 98761f63220..00000000000 --- a/dep/include/ace/Dev_Poll_Reactor.inl +++ /dev/null @@ -1,227 +0,0 @@ -// -*- C++ -*- -// -// $Id: Dev_Poll_Reactor.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Log_Msg.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_Dev_Poll_Event_Tuple::ACE_Dev_Poll_Event_Tuple (void) - : event_handler (0), - mask (ACE_Event_Handler::NULL_MASK), - suspended (0) -{ -} - -// --------------------------------------------------------------------- - -#if 0 -ACE_INLINE -ACE_Dev_Poll_Ready_Set::ACE_Dev_Poll_Ready_Set (void) - : pfds (0), - nfds (0) -{ -} -#endif /* 0 */ - -// --------------------------------------------------------------------- - -ACE_INLINE void -ACE_Dev_Poll_Reactor_Handler_Repository::mask (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::mask"); - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - this->handlers_[handle].mask = mask; -} - -ACE_INLINE ACE_Reactor_Mask -ACE_Dev_Poll_Reactor_Handler_Repository::mask (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::mask"); - - ACE_Reactor_Mask mask = ACE_Event_Handler::NULL_MASK; - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - mask = this->handlers_[handle].mask; - - if (mask == ACE_Event_Handler::NULL_MASK) - errno = ENOENT; - - return mask; -} - -ACE_INLINE void -ACE_Dev_Poll_Reactor_Handler_Repository::suspend (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::suspend"); - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - this->handlers_[handle].suspended = 1; -} - -ACE_INLINE void -ACE_Dev_Poll_Reactor_Handler_Repository::resume (ACE_HANDLE handle) -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::resume"); - - // Only bother to search for the handle if it's in range. - if (this->handle_in_range (handle)) - this->handlers_[handle].suspended = 0; -} - -ACE_INLINE int -ACE_Dev_Poll_Reactor_Handler_Repository::suspended (ACE_HANDLE handle) const -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::suspended"); - - if (this->handle_in_range (handle)) - return this->handlers_[handle].suspended; - - return -1; -} - -ACE_INLINE size_t -ACE_Dev_Poll_Reactor_Handler_Repository::size (void) const -{ - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::size"); - - return this->max_size_; -} - -// ----------------------------------------------------------------- - -ACE_INLINE -ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard - (ACE_Event_Handler *eh, - bool do_incr) - : eh_ (eh), - refcounted_ (false) -{ - if (eh == 0) - return; - - this->refcounted_ = - eh->reference_counting_policy ().value () == - ACE_Event_Handler::Reference_Counting_Policy::ENABLED; - - if (do_incr && this->refcounted_) - eh->add_reference (); - - /** - * The below comments were here when I replaced the old refcount - * scheme was replaced. They may still need addressing. -Steve Huston - */ - - /** - * @todo Suspend the handler so that other threads will not cause - * an event that is already in an upcall from being dispatched - * again. - * - * @note The naive approach would be to simply call - * suspend_handler_i() on the reactor. However, that would - * cause a system call (write()) to occur. Obviously this - * can potentially have an adverse affect on performance. - * Ideally, the handler would only be marked as "suspended" in - * the handler repository. If an event arrives for a - * suspended handler that event can be "queued" in a - * "handle readiness queue." "Queued" is quoted since a real - * queue need not be used since duplicate events can be - * coalesced, thus avoiding unbounded queue growth. Event - * coalescing is already done by Linux's event poll driver - * (/dev/epoll) so Solaris' poll driver (/dev/poll) is the - * main concern here. The largest the queue can be is the - * same size as the number of handlers stored in the handler - * repository. - */ -} - -ACE_INLINE -ACE_Dev_Poll_Handler_Guard::~ACE_Dev_Poll_Handler_Guard (void) -{ - if (this->refcounted_ && this->eh_ != 0) - this->eh_->remove_reference (); - - /** - * The below comments were here when I replaced the old refcount - * scheme was replaced. They may still need addressing. -Steve Huston - */ - /** - * @todo Resume the handler so that other threads will be allowed to - * dispatch the handler. - */ -} - -ACE_INLINE void -ACE_Dev_Poll_Handler_Guard::release (void) -{ - this->eh_ = 0; -} - -// --------------------------------------------------------------------- - -ACE_INLINE int -ACE_Dev_Poll_Reactor::upcall (ACE_Event_Handler *event_handler, - int (ACE_Event_Handler::*callback)(ACE_HANDLE), - ACE_HANDLE handle) -{ - // If the handler returns positive value (requesting a reactor - // callback) just call back as many times as the handler requests - // it. Other threads are off handling other things. - int status = 0; - - do - { - status = (event_handler->*callback) (handle); - } - while (status > 0); - - return status; -} - -/************************************************************************/ -// Methods for ACE_Dev_Poll_Reactor::Token_Guard -/************************************************************************/ - -ACE_INLINE -ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard (ACE_Dev_Poll_Reactor_Token &token) - - : token_ (token), - owner_ (0) -{ -} - -ACE_INLINE -ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard (void) -{ - if (this->owner_ == 1) - { - ACE_MT (this->token_.release ()); - this->owner_ = 0; - } -} - -ACE_INLINE void -ACE_Dev_Poll_Reactor::Token_Guard::release_token (void) -{ - if (this->owner_) - { - ACE_MT (this->token_.release ()); - - // We are not the owner anymore.. - this->owner_ = 0; - } -} - -ACE_INLINE int -ACE_Dev_Poll_Reactor::Token_Guard::is_owner (void) -{ - return this->owner_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/OS_Log_Msg_Attributes.inl b/dep/include/ace/OS_Log_Msg_Attributes.inl deleted file mode 100644 index 82619a031ab..00000000000 --- a/dep/include/ace/OS_Log_Msg_Attributes.inl +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -// -// $Id: OS_Log_Msg_Attributes.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -ACE_OS_Log_Msg_Attributes::ACE_OS_Log_Msg_Attributes (void) -{ -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/OS_NS_math.inl b/dep/include/ace/OS_NS_math.inl deleted file mode 100644 index edfeb41869d..00000000000 --- a/dep/include/ace/OS_NS_math.inl +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- -// -// $Id: OS_NS_math.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace ACE_OS { - - ACE_INLINE double - floor (double x) - { - // This method computes the largest integral value not greater than x. - if(x > 0) - return static_cast (x); - else if (static_cast (x) == x) - return x; - else - return static_cast(x) - 1; - } - - ACE_INLINE double - ceil (double x) - { - // This method computes the smallest integral value not less than x. - if (x < 0) - return static_cast (x); - else if (static_cast (x) == x) - return x; - else - return static_cast (x) + 1; - } - - ACE_INLINE double - log2 (double x) - { - return ace_log2_helper (x); - } - -} // ACE_OS namespace - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Obstack_T.inl b/dep/include/ace/Obstack_T.inl deleted file mode 100644 index b3e8669a3ce..00000000000 --- a/dep/include/ace/Obstack_T.inl +++ /dev/null @@ -1,19 +0,0 @@ -// -*- C++ -*- -// -// $Id: Obstack_T.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE size_t -ACE_Obstack_T::length () const -{ - return this->size_ / sizeof (CHAR); -} - -template ACE_INLINE size_t -ACE_Obstack_T::size () const -{ - return this->size_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/SPIPE_Connector.inl b/dep/include/ace/SPIPE_Connector.inl deleted file mode 100644 index f61dd72d5a0..00000000000 --- a/dep/include/ace/SPIPE_Connector.inl +++ /dev/null @@ -1,15 +0,0 @@ -// -*- C++ -*- -// -// $Id: SPIPE_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -ACE_SPIPE_Connector::reset_new_handle (ACE_HANDLE handle) -{ - ACE_UNUSED_ARG (handle); - // Nothing to do here since the handle is not a socket - return 0; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/String_Base.inl b/dep/include/ace/String_Base.inl deleted file mode 100644 index d0fa8ed7e64..00000000000 --- a/dep/include/ace/String_Base.inl +++ /dev/null @@ -1,158 +0,0 @@ -// -*- C++ -*- -// -// $Id: String_Base.inl 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Malloc_Base.h" -#include "ace/Min_Max.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE void -ACE_String_Base::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_String_Base::dump"); -#endif /* ACE_HAS_DUMP */ -} - -// Assignment method (does not copy memory) -template ACE_INLINE ACE_String_Base & -ACE_String_Base::assign_nocopy (const ACE_String_Base &s) -{ - ACE_TRACE ("ACE_String_Base::assign_nocopy"); - this->set (s.rep_, s.len_, false); - return *this; -} - -template ACE_INLINE typename ACE_String_Base::size_type -ACE_String_Base::length (void) const -{ - ACE_TRACE ("ACE_String_Base::length"); - return this->len_; -} - -template ACE_INLINE size_t -ACE_String_Base::capacity (void) const -{ - ACE_TRACE ("ACE_String_Base::capacity"); - return this->buf_len_; -} - -template ACE_INLINE bool -ACE_String_Base::is_empty (void) const -{ - return this->len_ == 0; -} - -template ACE_INLINE bool -ACE_String_Base::empty (void) const -{ - return this->is_empty (); -} - -template ACE_INLINE ACE_String_Base -ACE_String_Base::substr ( - typename ACE_String_Base::size_type offset, - typename ACE_String_Base::size_type length) const -{ - ACE_TRACE ("ACE_String_Base::substr"); - return this->substring (offset, length); -} - -// Return the character in the string. - -template ACE_INLINE const CHAR & -ACE_String_Base::operator[] ( - typename ACE_String_Base::size_type slot) const -{ - ACE_TRACE ("ACE_String_Base::operator[]"); - return this->rep_[slot]; -} - -// Return the character in the string by reference. - -template ACE_INLINE CHAR & -ACE_String_Base::operator[] ( - typename ACE_String_Base::size_type slot) -{ - ACE_TRACE ("ACE_String_Base::operator[]"); - return this->rep_[slot]; -} - -template ACE_INLINE const CHAR * -ACE_String_Base::fast_rep (void) const -{ - return this->rep_; -} - -template ACE_INLINE const CHAR * -ACE_String_Base::c_str (void) const -{ - return this->rep_; -} - -// Less than comparison operator. - -template ACE_INLINE bool -ACE_String_Base::operator < (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::operator <"); - return compare (s) < 0; -} - -// Greater than comparison operator. - -template ACE_INLINE bool -ACE_String_Base::operator > (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::operator >"); - return compare (s) > 0; -} - -// Comparison operator. - -template ACE_INLINE bool -ACE_String_Base::operator!= (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::operator!="); - return !(*this == s); -} - -template ACE_INLINE bool -ACE_String_Base::operator!= (const CHAR *s) const -{ - return !(*this == s); -} - -template ACE_INLINE typename ACE_String_Base::size_type -ACE_String_Base::find (const ACE_String_Base&str, - typename ACE_String_Base::size_type pos) const -{ - ACE_TRACE ("ACE_String_Base::find"); - return this->find (str.rep_, pos); -} - -template ACE_INLINE typename ACE_String_Base::size_type -ACE_String_Base::strstr (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::strstr"); - return this->find (s.rep_); -} - -template ACE_INLINE bool -operator== (const CHAR *s, - const ACE_String_Base &t) -{ - return t == s; -} - -template ACE_INLINE bool -operator!= (const CHAR *s, - const ACE_String_Base &t) -{ - return !(t == s); -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Timer_Queue_Adapters.inl b/dep/include/ace/Timer_Queue_Adapters.inl deleted file mode 100644 index 77011eacf8b..00000000000 --- a/dep/include/ace/Timer_Queue_Adapters.inl +++ /dev/null @@ -1,29 +0,0 @@ -// -*- C++ -*- -// -// $Id: Timer_Queue_Adapters.inl 80826 2008-03-04 14:51:23Z wotte $ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -template ACE_INLINE TQ * -ACE_Thread_Timer_Queue_Adapter::timer_queue (void) const -{ - return this->timer_queue_; -} - -template ACE_INLINE int -ACE_Thread_Timer_Queue_Adapter::timer_queue (TQ *tq) -{ - if (this->delete_timer_queue_) - delete this->timer_queue_; - this->timer_queue_ = tq; - this->delete_timer_queue_ = false; - return 0; -} - -template ACE_INLINE ACE_thread_t -ACE_Thread_Timer_Queue_Adapter::thr_id (void) const -{ - return this->thr_id_; -} - -ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Version.h b/dep/include/ace/Version.h deleted file mode 100644 index ff3f3e64074..00000000000 --- a/dep/include/ace/Version.h +++ /dev/null @@ -1,10 +0,0 @@ - -// -*- C++ -*- -// $Id: Version.h 82705 2008-09-15 11:08:20Z sma $ -// This is file was automatically generated by \$ACE_ROOT/bin/make_release. - -#define ACE_MAJOR_VERSION 5 -#define ACE_MINOR_VERSION 6 -#define ACE_BETA_VERSION 6 -#define ACE_VERSION "5.6.6" - diff --git a/dep/include/ace/config-borland-common.h b/dep/include/ace/config-borland-common.h deleted file mode 100644 index 5c80c872ad7..00000000000 --- a/dep/include/ace/config-borland-common.h +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- -//$Id: config-borland-common.h 82294 2008-07-12 13:03:37Z johnnyw $ - -// The following configuration file contains defines for Borland compilers. - -#ifndef ACE_CONFIG_BORLAND_COMMON_H -#define ACE_CONFIG_BORLAND_COMMON_H -#include /**/ "ace/pre.h" - -#define ACE_HAS_CUSTOM_EXPORT_MACROS -#define ACE_Proper_Export_Flag __declspec (dllexport) -#define ACE_Proper_Import_Flag __declspec (dllimport) -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class __declspec (dllimport) T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllimport) SINGLETON_TYPE ; - -// In later versions of C++Builder we will prefer inline functions by -// default. The debug configuration of ACE is built with functions -// out-of-line, so when linking your application against a debug ACE -// build, you can choose to use the out-of-line functions by adding -// ACE_NO_INLINE=1 to your project settings. -# if !defined (__ACE_INLINE__) -# define __ACE_INLINE__ 1 -# endif /* __ACE_INLINE__ */ - -# define ACE_CC_NAME ACE_TEXT ("Borland C++ Builder") -# define ACE_CC_MAJOR_VERSION (__BORLANDC__ / 0x100) -# define ACE_CC_MINOR_VERSION (__BORLANDC__ % 0x100) -# define ACE_CC_BETA_VERSION (0) - -# ifndef ACE_USING_MCPP_PREPROCESSOR -# define ACE_CC_PREPROCESSOR_ARGS "-q -P- -o%s" -# endif - -# define ACE_EXPORT_NESTED_CLASSES 1 -# define ACE_HAS_CPLUSPLUS_HEADERS 1 -# define ACE_HAS_EXCEPTIONS -# define ACE_HAS_GNU_CSTRING_H 1 -# define ACE_HAS_NONCONST_SELECT_TIMEVAL -# define ACE_HAS_SIG_ATOMIC_T -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_HAS_STDCPP_STL_INCLUDES 1 -# define ACE_HAS_STRERROR -# define ACE_HAS_STRING_CLASS 1 -# define ACE_HAS_TEMPLATE_TYPEDEFS 1 -# define ACE_HAS_USER_MODE_MASKS 1 -# define ACE_LACKS_ACE_IOSTREAM 1 -# define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -# define ACE_LACKS_STRPTIME 1 -# if (__BORLANDC__ < 0x590) -# define ACE_LACKS_PLACEMENT_OPERATOR_DELETE 1 -# endif -# define ACE_LACKS_PRAGMA_ONCE 1 -# define ACE_HAS_NEW_NOTHROW -# define ACE_TEMPLATES_REQUIRE_SOURCE 1 -# define ACE_SIZEOF_LONG_DOUBLE 10 -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%Lu") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDC_LIB 0 -# define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) -# define ACE_LACKS_SWAB - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_BORLAND_COMMON_H */ - diff --git a/dep/include/ace/config-irix6.5.x-sgic++.h b/dep/include/ace/config-irix6.5.x-sgic++.h deleted file mode 100644 index a47126ff5f2..00000000000 --- a/dep/include/ace/config-irix6.5.x-sgic++.h +++ /dev/null @@ -1,19 +0,0 @@ -// -*- C++ -*- -// $Id: config-irix6.5.x-sgic++.h 80826 2008-03-04 14:51:23Z wotte $ - -// Use this file for IRIX 6.5.x - -#ifndef ACE_CONFIG_IRIX65X_H -#define ACE_CONFIG_IRIX65X_H -#include /**/ "ace/pre.h" - -// Include IRIX 6.[234] configuration -#include "ace/config-irix6.x-sgic++.h" - -// Irix 6.5 man pages show that they exist -#undef ACE_LACKS_CONDATTR_PSHARED -#undef ACE_LACKS_MUTEXATTR_PSHARED - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_IRIX65X_H */ - diff --git a/dep/include/ace/config-irix6.x-common.h b/dep/include/ace/config-irix6.x-common.h deleted file mode 100644 index 49bc08f6c4e..00000000000 --- a/dep/include/ace/config-irix6.x-common.h +++ /dev/null @@ -1,257 +0,0 @@ -/* -*- C++ -*- */ -// -// $Id: config-irix6.x-common.h 81697 2008-05-14 18:33:11Z johnnyw $ -// -// This file contains the common configuration options for both -// SGI/MIPSPro C++ and g++ under IRIX 6.X -// -// For IRIX 6.2 there are several patches that should be applied to -// get reliable operation with multi-threading and exceptions. -// Specifically you should get a reasonable current IRIX, Compiler -// and POSIX patch-sets. - -// For IRIX 6.[34] it's less critical, but it's still recommended -// that you apply the applicable patch-sets (IRIX and Compiler I believe). - -// These patches are updated frequently, so you should ask your support -// contact or search SGI's web site (http://www.sgi.com) for the latest -// version. - -// Use this file for IRIX 6.[234] if you have the pthreads patches -// installed. - -#ifndef ACE_CONFIG_IRIX6X_COMMON_H - -#ifndef IRIX6 -# define IRIX6 -#endif - -#if ! defined(ACE_CONFIG_H) -#error "This file may only be included by config-irix6.x-sgic++.h, config-irix6.x-kcc.h or config-irix6.x-g++.h" -#endif - -// The Irix 6.x float.h doesn't allow us to distinguish between a -// double and a long double. So, we have to hard-code this. Thanks -// to Bob Laferriere for figuring it out. -#if defined (_MIPS_SIM) /* 6.X System */ -# include -# if defined (__GNUC__) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# elif defined (_MIPS_SIM_NABI32) && (_MIPS_SIM == _MIPS_SIM_NABI32) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# elif defined (_MIPS_SIM_ABI32) && (_MIPS_SIM == _MIPS_SIM_ABI32) -# define ACE_SIZEOF_LONG_DOUBLE 8 -# elif defined (_MIPS_SIM_ABI64) && (_MIPS_SIM == _MIPS_SIM_ABI64) -# define ACE_SIZEOF_LONG_DOUBLE 16 -# elif !defined (ACE_SIZEOF_LONG_DOUBLE) -# define ACE_SIZEOF_LONG_DOUBLE 8 -# endif -#else -# define ACE_SIZEOF_LONG_DOUBLE 8 /* 5.3 System */ -#endif - -// petern, Next part of it: - -// Platform supports getpagesize() call. -#define ACE_HAS_GETPAGESIZE - -// Platform has no implementation of pthread_condattr_setpshared(), -// even though it supports pthreads! (like Irix 6.2) -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED - -#define ACE_LACKS_SUSECONDS_T - -// Platform/compiler has the sigwait(2) prototype -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Platform requires void * for mmap(). -#define ACE_HAS_VOIDPTR_MMAP - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Irix needs to define bzero() in this odd file -#define ACE_HAS_BSTRING - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST -#ifdef ACE_LACKS_PERFECT_MULTICAST_FILTERING - #undef ACE_LACKS_PERFECT_MULTICAST_FILTERING -#endif -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 - -//************************************************************** -// Not so sure how next lines should look like - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -//************************************************************** - -// IRIX 6.4 and below do not support reentrant netdb functions -// (getprotobyname_r, getprotobynumber_r, gethostbyaddr_r, -// gethostbyname_r, getservbyname_r). -#if (ACE_IRIX_VERS <= 64) && !defined (ACE_HAS_NETDB_REENTRANT_FUNCTIONS) -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#endif /* ACE_HAS_NETDB_REENTRANT_FUNCTIONS */ - -#define ACE_HAS_DIRENT -// Unless the thread enabled version is used the readdir_r interface -// does not get defined in IRIX 6.2 -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_RWLOCK_T - -#define ACE_HAS_GPERF - -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_BROKEN_DGRAM_SENDV - -#define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -#define ACE_PI_CONTROL_BLOCK_ALIGN_LONGS 2 - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// IRIX 6.5 supports AIO -#define ACE_HAS_AIO_CALLS -#define ACE_POSIX_AIOCB_PROACTOR -#define ACE_HAS_SGIDLADD -#define ACE_HAS_P_READ_WRITE -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_STDINT_H -#define ACE_HAS_SYSENT_H -#define ACE_HAS_SYSINFO -#define ACE_HAS_SYS_SYSTEMINFO_H - -// Platform has support for multi-byte character support compliant -// with the XPG4 Worldwide Portability Interface wide-character -// classification. -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// We need to setup a very high address or Naming_Test won't run. -#define ACE_DEFAULT_BASE_ADDR ((char *) (1024U * 1024 * 1024)) - -#define ACE_LACKS_SIGNED_CHAR - -// Platform supports reentrant functions (i.e., all the POSIX *_r -// functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform does not support reentrant password file accessor functiions. -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS - -// uses ctime_r & asctime_r with only two parameters vs. three -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -// Prototypes for both signal() and struct sigaction are consistent. -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -#define ACE_HAS_UALARM - -// Scheduling functions are declared in -#define ACE_NEEDS_SCHED_H - -// Compile using multi-thread libraries by default -#if !defined (ACE_MT_SAFE) - #define ACE_MT_SAFE 1 -#endif /* ACE_MT_SAFE */ - -#if (ACE_MT_SAFE != 0) - -// Add threading support - -#define ACE_HAS_IRIX62_THREADS - -// Needed for the threading stuff? -#include /**/ -#define PTHREAD_MIN_PRIORITY PX_PRIO_MIN -#define PTHREAD_MAX_PRIORITY PX_PRIO_MAX - -// ACE supports threads. -#define ACE_HAS_THREADS - -// Platform has no implementation of pthread_condattr_setpshared(), -// even though it supports pthreads! (like Irix 6.2) -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED - -// IRIX 6.2 supports a variant of POSIX Pthreads, supposedly POSIX 1c -#define ACE_HAS_PTHREADS - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// The pthread_cond_timedwait call does not reset the timer. -#define ACE_LACKS_COND_TIMEDWAIT_RESET 1 - -// When threads are enabled READDIR_R is supported on IRIX. -#undef ACE_LACKS_READDIR_R - -#endif /* (ACE_MT_SAFE == 0) */ - -#endif /* ACE_CONFIG_IRIX6X_COMMON_H */ - diff --git a/dep/include/ace/config-irix6.x-g++.h b/dep/include/ace/config-irix6.x-g++.h deleted file mode 100644 index 91276bdbaad..00000000000 --- a/dep/include/ace/config-irix6.x-g++.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-irix6.x-g++.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for the SGI -// Indigo2EX running Irix 6.2 platform using the GNU C++ Compiler - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so -// this must appear before its #include. -#define ACE_HAS_STRING_CLASS - -#include "ace/config-g++-common.h" -#include "ace/config-irix6.x-common.h" - -// Denotes that GNU has cstring.h as standard -// which redefines memchr() -#define ACE_HAS_GNU_CSTRING_H - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-irix6.x-sgic++.h b/dep/include/ace/config-irix6.x-sgic++.h deleted file mode 100644 index d832995ea8c..00000000000 --- a/dep/include/ace/config-irix6.x-sgic++.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-irix6.x-sgic++.h 81935 2008-06-12 22:01:53Z jtc $ - -// Use this file for IRIX 6.[234] if you have the pthreads patches -// installed. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#include "ace/config-irix6.x-common.h" - -// This is the config file for IRIX 6.2, 6.4 and hopefully 6.3, using -// the SGI C++ compiler (7.1 or higher). - -// The following three should be enabled/disabled together. -#if _COMPILER_VERSION < 720 -#define ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA -#endif /* _COMPILER_VERSION < 720 */ -#define ACE_TEMPLATES_REQUIRE_SOURCE -#define ACE_NEEDS_FUNC_DEFINITIONS - -// Platform supports STREAM pipes (note that this is disabled by -// default, see the manual page on pipe(2) to find out how to enable -// it). -// #define ACE_HAS_STREAM_PIPES - -#if defined (_COMPILER_VERSION) -# define ACE_CC_NAME ACE_TEXT ("SGI/MIPSPro") -# define ACE_CC_MAJOR_VERSION (_COMPILER_VERSION / 100) -# define ACE_CC_MINOR_VERSION (_COMPILER_VERSION % 100) -# define ACE_CC_BETA_VERSION (0) -#endif /* _COMPILER_VERSION */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sco-5.0.0-nothread.h b/dep/include/ace/config-sco-5.0.0-nothread.h deleted file mode 100644 index 7d5c4f4ebef..00000000000 --- a/dep/include/ace/config-sco-5.0.0-nothread.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sco-5.0.0-nothread.h 80826 2008-03-04 14:51:23Z wotte $ - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#include "ace/config-g++-common.h" -#include "ace/config-sco-5.0.0.h" - -#define ACE_HAS_GNU_CSTRING_H - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.4-g++.h b/dep/include/ace/config-sunos5.4-g++.h deleted file mode 100644 index 9622a068232..00000000000 --- a/dep/include/ace/config-sunos5.4-g++.h +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.4-g++.h 81697 2008-05-14 18:33:11Z johnnyw $ - -// The following configuration file is designed to work for SunOS 5.4 -// platforms using the GNU g++ compiler. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so -// this must appear before its #include. -#define ACE_HAS_STRING_CLASS - -#include "ace/config-g++-common.h" -#define ACE_HAS_GNU_CSTRING_H - -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform supports pread() and pwrite() -#define ACE_HAS_P_READ_WRITE - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Sun has the wrong prototype for sendmsg. -#define ACE_HAS_NONCONST_SENDMSG - -// The SunOS 5.x version of rand_r is inconsistent with the header files... -#define ACE_HAS_BROKEN_RANDR - -// Platform supports system configuration information. -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO - -// Platform supports the POSIX regular expression library -#define ACE_HAS_REGEX - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform supports SunOS high resolution timers. -#define ACE_HAS_HI_RES_TIMER - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Platform supports the prusage_t struct. -#define ACE_HAS_PRUSAGE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Platform supports STREAM pipes. -#define ACE_HAS_STREAM_PIPES - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform supports SVR4 gettimeofday() prototype. -#define ACE_HAS_SVR4_GETTIMEOFDAY - -// Platform lacks pthread_sigaction -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK - -// Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff)... -#define ACE_HAS_SVR4_TLI - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST - -/* Turn off the following defines if you want to disable threading. */ -// Compile using multi-thread libraries. -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -# if !defined (_REENTRANT) -# define _REENTRANT -# endif /* _REENTRANT */ -#endif /* !ACE_MT_SAFE */ - -// Platform supports Solaris threads. -#define ACE_HAS_STHREADS - -// Platform supports threads. -#define ACE_HAS_THREADS - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Platform supports reentrant functions (i.e., all the POSIX *_r functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -/* end threading defines */ - -#define ACE_HAS_PRIOCNTL -#define ACE_NEEDS_LWP_PRIO_SET - -// Platform supports TLI timod STREAMS module. -#define ACE_HAS_TIMOD_H - -// Platform supports TLI tiuser header. -#define ACE_HAS_TIUSER_H - -// Platform provides TLI function prototypes. -#define ACE_HAS_TLI_PROTOTYPES - -// Platform supports TLI. -#define ACE_HAS_TLI - -// Use the poll() event demultiplexor rather than select(). -//#define ACE_USE_POLL - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 -#define ACE_HAS_IDTYPE_T -#define ACE_HAS_GPERF -#define ACE_HAS_DIRENT - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.4-sunc++-4.x.h b/dep/include/ace/config-sunos5.4-sunc++-4.x.h deleted file mode 100644 index 8714b8d72fc..00000000000 --- a/dep/include/ace/config-sunos5.4-sunc++-4.x.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-sunos5.4-sunc++-4.x.h 81935 2008-06-12 22:01:53Z jtc $ - -// The following configuration file is designed to work for SunOS 5.4 -// platforms using the SunC++ 4.0.x compiler. - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT - -// Platform supports pread() and pwrite() -#define ACE_HAS_P_READ_WRITE - -#define ACE_HAS_XPG4_MULTIBYTE_CHAR - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Sun has the wrong prototype for sendmsg. -#define ACE_HAS_NONCONST_SENDMSG - -// The SunOS 5.x version of rand_r is inconsistent with the header files... -#define ACE_HAS_BROKEN_RANDR - -// Platform supports system configuration information. -#define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO - -// Platform supports the POSIX regular expression library. -#define ACE_HAS_REGEX - -// Platform supports recvmsg and sendmsg. -#define ACE_HAS_MSG - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Platform supports POSIX O_NONBLOCK semantics. -#define ACE_HAS_POSIX_NONBLOCK - -// Compiler/platform has correctly prototyped header files. -#define ACE_HAS_CPLUSPLUS_HEADERS - -// Compiler/platform supports SunOS high resolution timers. -#define ACE_HAS_HI_RES_TIMER - -// Platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Compiler/platform supports alloca() -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform has -#define ACE_HAS_ALLOCA_H - -// Platform contains . -#define ACE_HAS_POLL - -// Platform supports POSIX timers via timestruc_t. -#define ACE_HAS_POSIX_TIME - -// Platform supports the /proc file system. -#define ACE_HAS_PROC_FS - -// Platform supports the prusage_t struct. -#define ACE_HAS_PRUSAGE_T - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Platform supports SVR4 extended signals. -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_UCONTEXT_T - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Platform supports STREAMS. -#define ACE_HAS_STREAMS - -// Platform supports STREAM pipes. -#define ACE_HAS_STREAM_PIPES - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform supports struct strbuf. -#define ACE_HAS_STRBUF_T - -// Compiler/platform supports SVR4 dynamic linking semantics. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform supports SVR4 gettimeofday() prototype. -#define ACE_HAS_SVR4_GETTIMEOFDAY - -// Compiler/platform supports SVR4 signal typedef. -#define ACE_HAS_SVR4_SIGNAL_T - -// Platform lacks pthread_sigaction -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK - -// Compiler/platform supports SVR4 ACE_TLI (in particular, T_GETNAME stuff)... -#define ACE_HAS_SVR4_TLI - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST - -/* Turn off the following defines if you want to disable threading. */ -// Compile using multi-thread libraries. -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Platform supports Solaris threads. -#define ACE_HAS_STHREADS - -// Platform supports threads. -#define ACE_HAS_THREADS - -// Compiler/platform has thread-specific storage -#define ACE_HAS_THREAD_SPECIFIC_STORAGE - -// Platform supports reentrant functions (i.e., all the POSIX *_r functions). -#define ACE_HAS_REENTRANT_FUNCTIONS - -/* end threading defines */ - -#define ACE_HAS_PRIOCNTL -#define ACE_NEEDS_LWP_PRIO_SET - -// Reactor detects deadlock -// #define ACE_REACTOR_HAS_DEADLOCK_DETECTION - -// Platform supports ACE_TLI timod STREAMS module. -#define ACE_HAS_TIMOD_H - -// Platform supports ACE_TLI tiuser header. -#define ACE_HAS_TIUSER_H - -// Platform provides ACE_TLI function prototypes. -#define ACE_HAS_TLI_PROTOTYPES - -// Platform supports ACE_TLI. -#define ACE_HAS_TLI - -#define ACE_LACKS_LINEBUFFERED_STREAMBUF -#define ACE_LACKS_SIGNED_CHAR - -// Use the poll() event demultiplexor rather than select(). -//#define ACE_USE_POLL - -#define ACE_NEEDS_DEV_IO_CONVERSION - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 -#define ACE_HAS_IDTYPE_T - -#define ACE_HAS_GPERF -#define ACE_HAS_DIRENT - -# if defined (ACE_HAS_EXCEPTIONS) - // If exceptions are enabled and we are using Sun/CC then - // throws an exception instead of returning 0. -# define ACE_NEW_THROWS_EXCEPTIONS -# endif /* ACE_HAS_EXCEPTIONS */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-vxworks5.x.h b/dep/include/ace/config-vxworks5.x.h deleted file mode 100644 index eeb22490090..00000000000 --- a/dep/include/ace/config-vxworks5.x.h +++ /dev/null @@ -1,346 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-vxworks5.x.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 5.5.x platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with Tornado 2.2 or newer. -// 2) The Green Hills 1.8.8 and newer 1.8.9 compilers (not tested -// already for a long time) -// 3) The WindRiver Compiler (formerly known as Diab) - -#ifndef ACE_CONFIG_H -#define ACE_CONFIG_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x551 -#endif /* ! ACE_VXWORKS */ - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX - -# if !defined (ACE_MAIN) -# define ACE_MAIN ace_main -# endif /* ! ACE_MAIN */ - -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if (__GNUC__ == 2) -# define ACE_CDR_IMPLEMENT_WITH_NATIVE_DOUBLE 1 -# endif - -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) - // GNU 3.3+ toolchain supports long long types but fails to define this so STL - // skips some definitions -# if !defined (_GLIBCPP_USE_LONG_LONG) -# define _GLIBCPP_USE_LONG_LONG -# endif -# endif /* (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) */ - -#elif defined (ghs) - // Processor type, if necessary. Green Hills defines "ppc". -# if defined (ppc) -# define ACE_HAS_POWERPC_TIMER -# define ACE_LACKS_CLEARERR -# endif /* ppc */ - -# define ACE_CONFIG_INCLUDE_GHS_COMMON -# include "ace/config-ghs-common.h" - -# define ACE_LACKS_UNISTD_H -# define ACE_LACKS_IOSTREAM_TOTALLY - -// Short-circuit the include of -// Green Hills has a problem with multiply defined functions -// with different parameters. -# define __INCineth - -#elif defined (__DCPLUSPLUS__) || defined (__DCC__) - // Diab 4.2a or later. -# if !defined (ACE_LACKS_PRAGMA_ONCE) - // We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -# endif /* ! ACE_LACKS_PRAGMA_ONCE */ - - // Diab doesn't support VxWorks' iostream libraries. -# define ACE_LACKS_IOSTREAM_TOTALLY -# define ACE_LACKS_ACE_IOSTREAM - -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 0 - -# define ACE_TEMPLATES_REQUIRE_SOURCE - -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R -#define ACE_MKDIR_LACKS_MODE -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_STAT -#define ACE_HAS_NONCONST_SWAB -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_CHDIR -#define ACE_HAS_NONCONST_UNLINK -#define ACE_HAS_NONCONST_OPENDIR -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_IOCTL_INT_3_PARAM -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRDUP_EMULATION -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_ACCESS -#define ACE_LACKS_EXEC -#define ACE_LACKS_FCNTL -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_FSYNC -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETOPT -#define ACE_LACKS_GETPID -#define ACE_LACKS_GETPPID -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_KEY_T -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_MMAP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_NUMERIC_LIMITS -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETHOSTBYADDR -#define ACE_LACKS_GETHOSTBYNAME -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSCALL -#define ACE_LACKS_SYSCONF -#define ACE_LACKS_SYS_SYSCTL_H -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_UMASK -#define ACE_LACKS_UTSNAME_T -#define ACE_LACKS_UNAME -#define ACE_LACKS_STRPTIME -#define ACE_LACKS_VSNPRINTF -#define ACE_LACKS_WAIT -#define ACE_LACKS_WAITPID -#define ACE_LACKS_DUP2 -#define ACE_LACKS_DUP -#define ACE_LACKS_SUSECONDS_T -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_INTPTR_T -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -#endif /* ! ACE_VXWORKS_SPARE */ - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_SETGID -#define ACE_LACKS_GETPGID - -#define ACE_LACKS_PIPE -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_INTTYPES_H -#define ACE_LACKS_UNISTD_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_TIME_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_WCHAR_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SEARCH_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_WCTYPE_H - -// Not sure if these should always be defined. -#define ACE_LACKS_SYS_UN_H - -// Some string things -#define ACE_LACKS_WCSCAT -#define ACE_LACKS_WCSCHR -#define ACE_LACKS_WCSCMP -#define ACE_LACKS_WCSCPY -#define ACE_LACKS_WCSCSPN -#define ACE_LACKS_WCSLEN -#define ACE_LACKS_WCSNCAT -#define ACE_LACKS_WCSNCMP -#define ACE_LACKS_WCSNCPY -#define ACE_LACKS_WCSPBRK -#define ACE_LACKS_WCSRCHR -#define ACE_LACKS_WCSSPN -#define ACE_LACKS_WCSSTR -#define ACE_LACKS_WCSTOK -#define ACE_LACKS_TOWLOWER -#define ACE_LACKS_TOWUPPER -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSTOD -#define ACE_LACKS_WCSTOL -#define ACE_LACKS_WCSTOUL -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_LACKS_SYMLINKS -#define ACE_LACKS_FGETWC -#define ACE_LACKS_FGETWS -#define ACE_LACKS_FPUTWS - -#if defined (ACE_HAS_VXWORKS551_PID) || (ACE_HAS_VXWORKS551_PCD) || (ACE_HAS_VXWORKS551_PNE) -# define ACE_HAS_VXWORKS551_MEDUSA -#endif - -#if defined (ACE_HAS_VXWORKS551_MEDUSA) -# define ACE_HAS_GETIFADDRS -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_LACKS_CONDATTR_PSHARED -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_POSIX_SEM -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_HAS_VXTHREADS -# define ACE_LACKS_PTHREAD_H -# define ACE_LACKS_COND_T -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -// VxWorks does not have the pthread_mutex_timedlock operation, but there is -// an emulation for this when not using the pthread mapping -#define ACE_HAS_MUTEX_TIMEOUTS -#define ACE_HAS_TSS_EMULATION -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) -// If running an Intel Pentium the -// ACE_OS::gethrtime () can use the RDTSC instruction. -# define ACE_HAS_PENTIUM -#endif - -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 -# define ACE_LACKS_LOG2 -# endif -# endif - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-vxworks6.2.h b/dep/include/ace/config-vxworks6.2.h deleted file mode 100644 index f7978b0036e..00000000000 --- a/dep/include/ace/config-vxworks6.2.h +++ /dev/null @@ -1,329 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-vxworks6.2.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 6.2 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.2 - -#ifndef ACE_CONFIG_VXWORKS_6_2_H -#define ACE_CONFIG_VXWORKS_6_2_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x620 -#endif /* ! ACE_VXWORKS */ - -#if defined __RTP__ - // Fix wrong typedef in unistd.h (unsigned short) - #define _SUSECONDS_T - typedef long suseconds_t; -#endif -#include - -// Fix for including right typedef for pid_t in VxTypes.h (int) -#include - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if defined (__RTP__) && !defined (_HAS_C9X) -// Workaround for the fact that under RTP the log2 method can't be used -// without this define set, see TSR560446 -# if !defined (_C99) -# define _C99 -# endif -# endif - -#elif defined (__DCPLUSPLUS__) || defined (__DCC__) - // Diab 4.2a or later. -# if !defined (ACE_LACKS_PRAGMA_ONCE) - // We define it with a -D with make depend. -# define ACE_LACKS_PRAGMA_ONCE -# endif /* ! ACE_LACKS_PRAGMA_ONCE */ - -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_TEMPLATES_REQUIRE_SOURCE - -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -#if !defined __RTP__ -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 in kernel mode -# define ACE_LACKS_LOG2 -# endif -# endif -#endif - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_SWAB -#define ACE_HAS_NONCONST_READV -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_IOCTL_INT_3_PARAM -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_HAS_SYSCTL -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_EXEC -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_KEY_T -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_MMAP -#define ACE_LACKS_MPROTECT -#define ACE_LACKS_MSYNC -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_PIPE -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_UMASK -#define ACE_LACKS_STRPTIME -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -#endif /* ! ACE_VXWORKS_SPARE */ -#define ACE_HAS_GETIFADDRS - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETPGID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_SETGID - -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_FCNTL - -// Some string things -#define ACE_LACKS_STRCASECMP -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_LACKS_SYMLINKS - -#if defined __RTP__ - // We are building for RTP mode - #if !defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_SVR4_DYNAMIC_LINKING - #endif - #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_REGEX_H - #define ACE_LACKS_PUTENV - #define ACE_HAS_SETENV - #define ACE_HAS_3_PARAM_WCSTOK - #define ACE_HAS_WCHAR - #define ACE_HAS_VFWPRINTF - #define ACE_SIZEOF_WCHAR 2 -#else - // We are building for kernel mode - #define ACE_LACKS_INTPTR_T - #define ACE_LACKS_SUSECONDS_T - #define ACE_LACKS_INTTYPES_H - #define ACE_LACKS_STDINT_H - #define ACE_LACKS_UNAME - #define ACE_LACKS_UTSNAME_T - #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS - #define ACE_LACKS_DLFCN_H - #define ACE_LACKS_WAIT - #define ACE_LACKS_WAITPID - #define ACE_LACKS_SYS_TIME_H - #define ACE_LACKS_SYS_SELECT_H - #define ACE_LACKS_STRINGS_H - #define ACE_MKDIR_LACKS_MODE - #define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_SEARCH_H - #define ACE_LACKS_SYSCONF - #define ACE_LACKS_GETPID - #define ACE_LACKS_GETPPID - #define ACE_LACKS_WCHAR_H - #define ACE_LACKS_WCTYPE_H - #define ACE_LACKS_WCSCAT - #define ACE_LACKS_WCSCHR - #define ACE_LACKS_WCSCMP - #define ACE_LACKS_WCSCPY - #define ACE_LACKS_WCSCSPN - #define ACE_LACKS_WCSLEN - #define ACE_LACKS_WCSNCAT - #define ACE_LACKS_WCSNCMP - #define ACE_LACKS_WCSNCPY - #define ACE_LACKS_WCSPBRK - #define ACE_LACKS_WCSRCHR - #define ACE_LACKS_WCSSPN - #define ACE_LACKS_WCSSTR - #define ACE_LACKS_WCSTOK - #define ACE_LACKS_TOWLOWER - #define ACE_LACKS_TOWUPPER - #define ACE_LACKS_WCSTOD - #define ACE_LACKS_WCSTOL - #define ACE_LACKS_WCSTOUL - #define ACE_LACKS_FGETWC - #define ACE_LACKS_FGETWS - #define ACE_LACKS_FPUTWS - #if !defined (ACE_MAIN) - # define ACE_MAIN ace_main - #endif /* ! ACE_MAIN */ -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_POSIX_SEM -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_LACKS_CONDATTR_PSHARED -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_LACKS_PTHREAD_H -# define ACE_HAS_VXTHREADS -# if !defined __RTP__ -// Only when building for kernel mode we can use TSS emulation, in rtp mode -// we can't use the WIND_TCB struct anymore -# define ACE_HAS_TSS_EMULATION -# endif -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_LACKS_COND_T -# define ACE_HAS_MUTEX_TIMEOUTS -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) -// If running an Intel Pentium the -// ACE_OS::gethrtime () can use the RDTSC instruction. -# define ACE_HAS_PENTIUM -#endif - -// VxWorks defines the CPU define MAP, undef it to prevent problems with -// application code -#if defined (MAP) -#undef MAP -#endif /* MAP */ - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#if defined (ACE_HAS_IP_MULTICAST) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_HAS_IP_MULTICAST */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_2_H */ - diff --git a/dep/include/ace/config-vxworks6.3.h b/dep/include/ace/config-vxworks6.3.h deleted file mode 100644 index fe90626e3dc..00000000000 --- a/dep/include/ace/config-vxworks6.3.h +++ /dev/null @@ -1,318 +0,0 @@ -/* -*- C++ -*- */ -// $Id: config-vxworks6.3.h 81850 2008-06-06 08:39:54Z vzykov $ - -// The following configuration file is designed to work for VxWorks -// 6.3 platforms using one of these compilers: -// 1) The GNU g++ compiler that is shipped with VxWorks 6.3 - -#ifndef ACE_CONFIG_VXWORKS_6_3_H -#define ACE_CONFIG_VXWORKS_6_3_H -#include /**/ "ace/pre.h" - -#if ! defined (VXWORKS) -# define VXWORKS -#endif /* ! VXWORKS */ - -#if ! defined (ACE_VXWORKS) -# define ACE_VXWORKS 0x630 -#endif /* ! ACE_VXWORKS */ - -#if ! defined (__ACE_INLINE__) -# define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -// Compiler-specific configuration. -#if defined (__GNUG__) -# include "ace/config-g++-common.h" - -# define ACE_LACKS_IOSTREAM_FX -# define ACE_LACKS_LINEBUFFERED_STREAMBUF - -# if defined (__RTP__) && !defined (_HAS_C9X) -// Workaround for the fact that under RTP the log2 method can't be used -// without this define set, see TSR560446 -# if !defined (_C99) -# define _C99 -# endif -# endif - -#elif defined (__DCC__) -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_TEMPLATES_REQUIRE_SOURCE -#else /* ! __GNUG__ && ! ghs && !__DCC__ */ -# ifdef __cplusplus /* Let it slide for C compilers. */ -# error unsupported compiler on VxWorks -# endif /* __cplusplus */ -#endif /* ! __GNUG__ && ! ghs */ - -#if !defined __RTP__ -# if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) -// These PPC's do lack log2 in kernel mode -# define ACE_LACKS_LOG2 -# endif -# endif -#endif - -// OS-specific configuration -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_GETBY -#define ACE_HAS_NONCONST_SWAB -#define ACE_LACKS_UNIX_SYSLOG -#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 -#define ACE_DEFAULT_THREAD_KEYS 16 -#define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_CLOCK_GETTIME -#define ACE_HAS_CLOCK_SETTIME -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_MSG -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_HAS_SIGACTION_CONSTP2 -#define ACE_HAS_SIGINFO_T -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRERROR -#define ACE_HAS_THREADS -#define ACE_HAS_SYSCTL -#define ACE_LACKS_ALPHASORT -#define ACE_LACKS_EXEC -#define ACE_LACKS_FILELOCKS -#define ACE_LACKS_FORK -#define ACE_LACKS_GETHOSTENT -#define ACE_LACKS_GETSERVBYNAME -#define ACE_LACKS_GETPROTOBYNAME -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETIPNODEBYADDR -#define ACE_LACKS_GETIPNODEBYNAME_IPV6 -#define ACE_LACKS_LSTAT -#define ACE_LACKS_MADVISE -#define ACE_LACKS_MALLOC_H -#define ACE_LACKS_MEMORY_H -#define ACE_LACKS_MKFIFO -#define ACE_LACKS_MKTEMP -#define ACE_LACKS_MKSTEMP -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H -#define ACE_LACKS_PWD_FUNCTIONS -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_READLINK -#define ACE_LACKS_REALPATH -#define ACE_LACKS_PIPE -#define ACE_LACKS_RLIMIT -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SBRK -#define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SEMBUF_T -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_SI_ADDR -#define ACE_LACKS_SOCKETPAIR -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SYSV_SHMEM -#define ACE_LACKS_TELLDIR -#define ACE_LACKS_TEMPNAM -#define ACE_LACKS_TIMESPEC_T -#define ACE_LACKS_TRUNCATE -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_UMASK -#define ACE_LACKS_STRPTIME -#define ACE_PAGE_SIZE 4096 -#define ACE_THR_PRI_FIFO_DEF 101 -#define ACE_THR_PRI_OTHER_DEF ACE_THR_PRI_FIFO_DEF -#define ACE_HAS_SIGTIMEDWAIT -#define ACE_HAS_SIGSUSPEND -#define ACE_HAS_GETIFADDRS - -#define ACE_LACKS_SETEGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_SETSID -#define ACE_LACKS_SETUID -#define ACE_LACKS_SETEUID -#define ACE_LACKS_GETEUID -#define ACE_LACKS_GETUID -#define ACE_LACKS_GETPGID -#define ACE_LACKS_GETEGID -#define ACE_LACKS_GETGID -#define ACE_LACKS_SETGID - -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_FCNTL - -// Some string things -#define ACE_LACKS_ITOW -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_STRTOULL -#define ACE_LACKS_WCSTOULL - -#define ACE_HAS_CHARPTR_SOCKOPT -#define ACE_LACKS_SYMLINKS - -#if defined __RTP__ - // We are building for RTP mode - #if !defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_SVR4_DYNAMIC_LINKING - #endif - #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_REGEX_H - #define ACE_LACKS_PUTENV - #define ACE_HAS_SETENV - #define ACE_HAS_3_PARAM_WCSTOK - #define ACE_HAS_WCHAR - #define ACE_HAS_VFWPRINTF - #define ACE_SIZEOF_WCHAR 2 - #define ACE_HAS_SHM_OPEN - #if defined (ACE_AS_STATIC_LIBS) - # define ACE_HAS_AIO_CALLS - #endif - #define ACE_LACKS_STRCASECMP - // VxWorks seems to either not define this or define as zero up till now - #if !defined (IOV_MAX) || (IOV_MAX == 0) - #define ACE_IOV_MAX 16 - #endif -#else - // We are building for kernel mode - #define ACE_LACKS_SUSECONDS_T - #define ACE_LACKS_INTPTR_T - #define ACE_LACKS_INTTYPES_H - #define ACE_LACKS_STDINT_H - #define ACE_LACKS_UNAME - #define ACE_LACKS_UTSNAME_T - #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS - #define ACE_LACKS_DLFCN_H - #define ACE_LACKS_WAIT - #define ACE_LACKS_WAITPID - #define ACE_LACKS_SYS_TIME_H - #define ACE_LACKS_SYS_SELECT_H - #define ACE_MKDIR_LACKS_MODE - #define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R - #define ACE_LACKS_SEARCH_H - #define ACE_LACKS_SYSCONF - #define ACE_LACKS_GETPID - #define ACE_LACKS_GETPPID - #define ACE_LACKS_WCHAR_H - #define ACE_LACKS_WCTYPE_H - #define ACE_LACKS_WCSCAT - #define ACE_LACKS_WCSCHR - #define ACE_LACKS_WCSCMP - #define ACE_LACKS_WCSCPY - #define ACE_LACKS_WCSCSPN - #define ACE_LACKS_WCSLEN - #define ACE_LACKS_WCSNCAT - #define ACE_LACKS_WCSNCMP - #define ACE_LACKS_WCSNCPY - #define ACE_LACKS_WCSPBRK - #define ACE_LACKS_WCSRCHR - #define ACE_LACKS_WCSSPN - #define ACE_LACKS_WCSSTR - #define ACE_LACKS_WCSTOK - #define ACE_LACKS_TOWLOWER - #define ACE_LACKS_TOWUPPER - #define ACE_LACKS_WCSTOD - #define ACE_LACKS_WCSTOL - #define ACE_LACKS_WCSTOUL - #define ACE_LACKS_FGETWC - #define ACE_LACKS_FGETWS - #define ACE_LACKS_FPUTWS - #define ACE_HAS_IOCTL_INT_3_PARAM - #define ACE_LACKS_MMAP - #define ACE_LACKS_MSYNC - #define ACE_LACKS_MPROTECT - #if !defined (ACE_MAIN) - # define ACE_MAIN ace_main - #endif /* ! ACE_MAIN */ -#endif - -// It is possible to enable pthread support with VxWorks, when the user decides -// to use this, we need some more defines -#if defined ACE_HAS_PTHREADS -# define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_HAS_POSIX_SEM -# define ACE_LACKS_MUTEXATTR_PSHARED -# define ACE_LACKS_CONDATTR_PSHARED -// Include this file, the sys/stat.h file shipped with VxWorks has old types -// and without this include we get a lot of compile errors. A TSR has been filed -// so that hopefully in the future we can zap this include -#include "types/vxTypesOld.h" -#else -# define ACE_LACKS_PTHREAD_H -# define ACE_HAS_VXTHREADS -# if !defined __RTP__ -// Only when building for kernel mode we can use TSS emulation, in rtp mode -// we can't use the WIND_TCB struct anymore -# define ACE_HAS_TSS_EMULATION -# if !defined (ACE_VXWORKS_SPARE) -# define ACE_VXWORKS_SPARE spare4 -# endif /* ! ACE_VXWORKS_SPARE */ -# endif -// VxWorks has no recursive mutexes. This was set in the past but it doesn't -// work with the pthread support, so only set it for the time being when pthread -// is disabled -# define ACE_HAS_RECURSIVE_MUTEXES -# define ACE_LACKS_COND_T -# define ACE_HAS_MUTEX_TIMEOUTS -#endif - -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif - -// Needed include to get all VxWorks CPU types -#include "types/vxCpu.h" -#if defined (CPU) && (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4) - // If running an Intel Pentium the - // ACE_OS::gethrtime () can use the RDTSC instruction. - # define ACE_HAS_PENTIUM -#endif - -// VxWorks defines the CPU define MAP, undef it to prevent problems with -// application code -#if defined (MAP) -#undef MAP -#endif /* MAP */ - -#if !defined (ACE_NEEDS_HUGE_THREAD_STACKSIZE) -# define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 -#endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ - -#if !defined (ACE_NTRACE) -# define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// By default, don't include RCS Id strings in object code. -#if !defined (ACE_USE_RCSID) -#define ACE_USE_RCSID 0 -#endif /* !ACE_USE_RCSID */ - -#if defined (ACE_HAS_IP_MULTICAST) -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_HAS_IP_MULTICAST */ - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_VXWORKS_6_3_H */ - diff --git a/dep/include/ace/config-win32-interix.h b/dep/include/ace/config-win32-interix.h deleted file mode 100644 index d613444fadb..00000000000 --- a/dep/include/ace/config-win32-interix.h +++ /dev/null @@ -1,100 +0,0 @@ -// -*- C++ -*- -// $Id: config-win32-interix.h 80826 2008-03-04 14:51:23Z wotte $ - -// The following configuration file is designed to work for Interix -// platforms using GNU g++ (Interix == Microsoft's Services for Unix) - -#ifndef ACE_CONFIG_WIN32_INTERIX_H -#define ACE_CONFIG_WIN32_INTERIX_H -#include /**/ "ace/pre.h" -#include - -# define ACE_LACKS_SENDMSG -# define ACE_LACKS_RECVMSG -# define ACE_LACKS_STDINT_H -# define ACE_LACKS_INTTYPES_H -# define ACE_LACKS_PRAGMA_ONCE -# define ACE_LACKS_RWLOCK_T -# define ACE_LACKS_GETPGID // Don't have getpgid(), have setpgid() though... -# define ACE_LACKS_UCONTEXT_H -# define ACE_HAS_REENTRANT_FUNCTIONS -# define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS // Don't have gethostbyaddr_r and friends. -# define ACE_HAS_DIRENT -# define ACE_HAS_STDCPP_STL_INCLUDES -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# define ACE_HAS_NONCONST_SELECT_TIMEVAL -# define ACE_HAS_SIGWAIT -# define ACE_HAS_SIGINFO_T - -#include "ace/config-g++-common.h" - -#define ACE_HAS_NEW_NOTHROW // Need to know 'new's failure semantics. - -#if defined (ACE_HAS_THREADS) -#define ACE_HAS_THREADS -#define ACE_HAS_PTHREADS -#define _THREAD_SAFE -#define ACE_MTSAFE 1 -#define ACE_MT_SAFE 1 -#define ACE_LACKS_PTHREAD_YIELD -#define ACE_HAS_MUTEX_TIMEOUTS -#else - error "You need to enable threads for this Interix port." -#endif /* ACE_HAS_THREADS */ - -// INTERIX has the following, just an issue with porting for the moment -#define ACE_LACKS_ACCESS -// END INTERIX has the following.... - -#define ACE_SIZEOF_LONG_DOUBLE 12 -#define ACE_PAGE_SIZE 4096 - -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_SVR4_SIGNAL_T -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_POSIX_TIME // Supports POSIX timers via struct timespec. -#define ACE_LACKS_TIMESPEC_T // Defines struct timespec but not timespec_t. -#define ACE_LACKS_STRRECVFD -#define ACE_LACKS_SETSCHED -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_RTLD_LAZY_V -#define ACE_HAS_POSIX_NONBLOCK -#define ACE_HAS_GETRUSAGE -#define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SEMUN -#define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR -#define ACE_HAS_SVR4_GETTIMEOFDAY -#define ACE_HAS_UALARM -#define ACE_HAS_TERMIOS -#define ACE_HAS_SIGWAIT - -// Turns off the tracing feature. -#if !defined (ACE_NTRACE) -#define ACE_NTRACE 1 -#endif /* ACE_NTRACE */ - -// NOTE: In debugging some of the test apps they would all memory fault in using -// ACE_Errno_Guard. Upon inspection of that code it uses TSS to save ERRNO in -// a TSS pointer. Access to that pointer caused the fault. The work around here -// is to tell ACE we have TSS and use emulation. More investigation is needed to -// determine whether Interix TSS is broken or the correct semantics for usage under -// Interix simply need to be ported. -// To get around the issue ACE_HAS_TSS_EMULATION is defined to use TSS emulation -// however while many test programs that use TSS pass the TSS_Test program fails. -#define ACE_HAS_THREAD_SPECIFIC_STORAGE // We need thread specific storage even though... -#define ACE_HAS_TSS_EMULATION // It would appear to be broken in Interix! - -#include /**/ "ace/post.h" -#endif /* ACE_CONFIG_WIN32_INTERIX_H */ - -/* -The following tests do not run. -Dynamic_Priority_Test.log ACE_HAS_TIMED_MESSAGE_BLOCKS -Enum_Interfaces_Test.log -IOStream_Test.log ACE_IOSTREAM not supported on this platform -*/ - - diff --git a/dep/include/ace/os_include/os_errno.h b/dep/include/ace/os_include/os_errno.h deleted file mode 100644 index 6534aa8c7c8..00000000000 --- a/dep/include/ace/os_include/os_errno.h +++ /dev/null @@ -1,154 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file os_errno.h - * - * system error numbers - * - * $Id: os_errno.h 80826 2008-03-04 14:51:23Z wotte $ - * - * @author Don Hinton - * @author This code was originally in various places including ace/OS.h. - */ -//============================================================================= - -#ifndef ACE_OS_INCLUDE_OS_ERRNO_H -#define ACE_OS_INCLUDE_OS_ERRNO_H - -#include /**/ "ace/pre.h" - -#include "ace/config-lite.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (ACE_LACKS_ERRNO_H) -# include /**/ -#endif /* !ACE_LACKS_ERRNO_H */ - -#if defined (ACE_VXWORKS) -// Needed for VxWorks to pickup errnoSet() -#include /**/ -#endif /* ACE_VXWORKS */ - -// Place all additions (especially function declarations) within extern "C" {} -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if defined (ACE_WIN32) - // error code mapping for windows -# define ETIME ERROR_SEM_TIMEOUT -# define EWOULDBLOCK WSAEWOULDBLOCK -# define EINPROGRESS WSAEINPROGRESS -# define EALREADY WSAEALREADY -# define ENOTSOCK WSAENOTSOCK -# define EDESTADDRREQ WSAEDESTADDRREQ -# define EMSGSIZE WSAEMSGSIZE -# define EPROTOTYPE WSAEPROTOTYPE -# define ENOPROTOOPT WSAENOPROTOOPT -# define EPROTONOSUPPORT WSAEPROTONOSUPPORT -# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -# define EOPNOTSUPP WSAEOPNOTSUPP -# define EPFNOSUPPORT WSAEPFNOSUPPORT -# define EAFNOSUPPORT WSAEAFNOSUPPORT -# define EADDRINUSE WSAEADDRINUSE -# define EADDRNOTAVAIL WSAEADDRNOTAVAIL -# define ENETDOWN WSAENETDOWN -# define ENETUNREACH WSAENETUNREACH -# define ENETRESET WSAENETRESET -# define ECONNABORTED WSAECONNABORTED -# define ECONNRESET WSAECONNRESET -# define ENOBUFS WSAENOBUFS -# define EISCONN WSAEISCONN -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN -# define ETOOMANYREFS WSAETOOMANYREFS -# define ETIMEDOUT WSAETIMEDOUT -# define ECONNREFUSED WSAECONNREFUSED -# define ELOOP WSAELOOP -# define EHOSTDOWN WSAEHOSTDOWN -# define EHOSTUNREACH WSAEHOSTUNREACH -# define EPROCLIM WSAEPROCLIM -# define EUSERS WSAEUSERS -# define EDQUOT WSAEDQUOT -# define ESTALE WSAESTALE -# define EREMOTE WSAEREMOTE - // Grrr! ENAMETOOLONG and ENOTEMPTY are already defined by the horrible - // 'standard' library. - // #define ENAMETOOLONG WSAENAMETOOLONG -# define EADDRINUSE WSAEADDRINUSE - - // CE needs this... -# if !defined (EPERM) -# define EPERM ERROR_ACCESS_DENIED -# endif -#endif /* ACE_WIN32 */ - -#if defined (ACE_HAS_H_ERRNO) -void herror (const char *str); -#endif /* ACE_HAS_H_ERRNO */ - -#if !defined (ACE_WIN32) && defined (ACE_LACKS_T_ERRNO) -extern int t_errno; -#endif /* ACE_WIN32 && ACE_LACKS_T_ERRNO */ - -#if !defined (ENOSYS) -# define ENOSYS EFAULT /* Operation not supported or unknown error. */ -#endif /* !ENOSYS */ - -#if !defined (ENOTSUP) -# define ENOTSUP ENOSYS /* Operation not supported. */ -#endif /* !ENOTSUP */ - -#if !defined (ESUCCESS) -# define ESUCCESS 0 -#endif /* !ESUCCESS */ - -#if !defined (EIDRM) -# define EIDRM 0 -#endif /* !EIDRM */ - -#if !defined (ENFILE) -# define ENFILE EMFILE /* No more socket descriptors are available. */ -#endif /* !ENFILE */ - -#if !defined (ECOMM) - // Not the same, but ECONNABORTED is provided on NT. -# define ECOMM ECONNABORTED -#endif /* ECOMM */ - -#if !defined (EDEADLK) -# define EDEADLK 1000 /* Some large number.... */ -#endif /* !EDEADLK */ - -#if !defined (ENXIO) /* Needed in SOCK_Dgram_Mcast */ -# define ENXIO 6 -#endif /* ENXIO */ - -#if !defined (ETIMEDOUT) && defined (ETIME) -# define ETIMEDOUT ETIME -#endif /* ETIMEDOUT */ - -#if !defined (ETIME) && defined (ETIMEDOUT) -# define ETIME ETIMEDOUT -#endif /* ETIMED */ - -#if !defined (EBUSY) -# define EBUSY ETIME -#endif /* EBUSY */ - -#if !defined (ECANCELED) -# define ECANCELED 125 -#endif /* ECANCELED */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#include /**/ "ace/post.h" -#endif /* ACE_OS_INCLUDE_OS_ERRNO_H */ - diff --git a/dep/include/bzip2/bzlib.h b/dep/include/bzip2/bzlib.h deleted file mode 100644 index c5b75d6d8ff..00000000000 --- a/dep/include/bzip2/bzlib.h +++ /dev/null @@ -1,282 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Public header file for the library. ---*/ -/*--- bzlib.h ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#ifndef _BZLIB_H -#define _BZLIB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define BZ_RUN 0 -#define BZ_FLUSH 1 -#define BZ_FINISH 2 - -#define BZ_OK 0 -#define BZ_RUN_OK 1 -#define BZ_FLUSH_OK 2 -#define BZ_FINISH_OK 3 -#define BZ_STREAM_END 4 -#define BZ_SEQUENCE_ERROR (-1) -#define BZ_PARAM_ERROR (-2) -#define BZ_MEM_ERROR (-3) -#define BZ_DATA_ERROR (-4) -#define BZ_DATA_ERROR_MAGIC (-5) -#define BZ_IO_ERROR (-6) -#define BZ_UNEXPECTED_EOF (-7) -#define BZ_OUTBUFF_FULL (-8) -#define BZ_CONFIG_ERROR (-9) - -typedef - struct { - char *next_in; - unsigned int avail_in; - unsigned int total_in_lo32; - unsigned int total_in_hi32; - - char *next_out; - unsigned int avail_out; - unsigned int total_out_lo32; - unsigned int total_out_hi32; - - void *state; - - void *(*bzalloc)(void *,int,int); - void (*bzfree)(void *,void *); - void *opaque; - } - bz_stream; - - -#ifndef BZ_IMPORT -#define BZ_EXPORT -#endif - -#ifndef BZ_NO_STDIO -/* Need a definitition for FILE */ -#include -#endif - -#ifdef _WIN32 -# include -# ifdef small - /* windows.h define small to char */ -# undef small -# endif -# ifdef BZ_EXPORT -# define BZ_API(func) WINAPI func -# define BZ_EXTERN extern -# else - /* import windows dll dynamically */ -# define BZ_API(func) (WINAPI * func) -# define BZ_EXTERN -# endif -#else -# define BZ_API(func) func -# define BZ_EXTERN extern -#endif - - -/*-- Core (low-level) library functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( - bz_stream* strm, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompress) ( - bz_stream* strm, - int action - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( - bz_stream *strm, - int verbosity, - int small - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( - bz_stream *strm - ); - - - -/*-- High(er) level library functions --*/ - -#ifndef BZ_NO_STDIO -#define BZ_MAX_UNUSED 5000 - -typedef void BZFILE; - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( - int* bzerror, - FILE* f, - int verbosity, - int small, - void* unused, - int nUnused - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( - int* bzerror, - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( - int* bzerror, - BZFILE* b, - void** unused, - int* nUnused - ); - -BZ_EXTERN int BZ_API(BZ2_bzRead) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( - int* bzerror, - FILE* f, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN void BZ_API(BZ2_bzWrite) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in, - unsigned int* nbytes_out - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in_lo32, - unsigned int* nbytes_in_hi32, - unsigned int* nbytes_out_lo32, - unsigned int* nbytes_out_hi32 - ); -#endif - - -/*-- Utility functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int small, - int verbosity - ); - - -/*-- - Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) - to support better zlib compatibility. - This code is not _officially_ part of libbzip2 (yet); - I haven't tested it, documented it, or considered the - threading-safeness of it. - If this code breaks, please contact both Yoshioka and me. ---*/ - -BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( - void - ); - -#ifndef BZ_NO_STDIO -BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( - const char *path, - const char *mode - ); - -BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( - int fd, - const char *mode - ); - -BZ_EXTERN int BZ_API(BZ2_bzread) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzwrite) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzflush) ( - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzclose) ( - BZFILE* b - ); - -BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( - BZFILE *b, - int *errnum - ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/*-------------------------------------------------------------*/ -/*--- end bzlib.h ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/include/mysql/config-netware.h b/dep/include/mysql/config-netware.h deleted file mode 100644 index 0cc47802591..00000000000 --- a/dep/include/mysql/config-netware.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Header for NetWare compatible with MySQL */ - -#ifndef _config_netware_h -#define _config_netware_h - -/* required headers */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* required adjustments */ -#undef HAVE_READDIR_R -#undef HAVE_RWLOCK_INIT -#undef HAVE_SCHED_H -#undef HAVE_SYS_MMAN_H -#undef HAVE_SYNCH_H -#undef HAVE_MMAP -#undef HAVE_RINT - -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -#define HAVE_PTHREAD_SIGMASK 1 -#define HAVE_PTHREAD_YIELD_ZERO_ARG 1 -#define HAVE_BROKEN_REALPATH 1 - -/* changes made to make use of LibC-June-2004 for building purpose */ -#undef HAVE_POSIX_SIGNALS -#undef HAVE_PTHREAD_ATTR_SETSCOPE -#undef HAVE_ALLOC_A -#undef HAVE_FINITE -#undef HAVE_GETPWNAM -#undef HAVE_GETPWUID -#undef HAVE_PTHREAD_SETSCHEDPARAM -#undef HAVE_READLINK -#undef HAVE_STPCPY -/* changes end */ - -/* no libc crypt() function */ -#ifdef HAVE_OPENSSL - #define HAVE_CRYPT 1 -#else - #undef HAVE_CRYPT -#endif /* HAVE_OPENSSL */ - -/* Netware has an ancient zlib */ -#undef HAVE_COMPRESS -#define HAVE_COMPRESS -#undef HAVE_ARCHIVE_DB - -/* include the old function apis */ -#define USE_OLD_FUNCTIONS 1 - -/* no case sensitivity */ -#define FN_NO_CASE_SENCE 1 - -/* the thread alarm is not used */ -#define DONT_USE_THR_ALARM 1 - -/* signals do not interrupt sockets */ -#define SIGNALS_DONT_BREAK_READ 1 - -/* signal by closing the sockets */ -#define SIGNAL_WITH_VIO_CLOSE 1 - -/* On NetWare, stack grows towards lower address*/ -#define STACK_DIRECTION -1 - -/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */ -#define NW_THD_STACKSIZE 65536 - -/* On NetWare, to fix the problem with the deletion of open files */ -#define CANT_DELETE_OPEN_FILES 1 - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define FN_DEVCHAR ':' - -/* default directory information */ -#define DEFAULT_MYSQL_HOME "sys:/mysql" -#define PACKAGE "mysql" -#define DEFAULT_BASEDIR "sys:/" -#define SHAREDIR "share/" -#define DEFAULT_CHARSET_HOME "sys:/mysql/" -#define DATADIR "data/" - -/* 64-bit file system calls */ -#define SIZEOF_OFF_T 8 -#define off_t off64_t -#define chsize chsize64 -#define ftruncate ftruncate64 -#define lseek lseek64 -#define pread pread64 -#define pwrite pwrite64 -#define tell tell64 - -/* do not use the extended time in LibC sys\stat.h */ -#define _POSIX_SOURCE - -/* Some macros for portability */ - -#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; } - -/* extra protection against CPU Hogs on NetWare */ -#define NETWARE_YIELD pthread_yield() -/* Screen mode for help texts */ -#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A) - -#ifdef __cplusplus -} -#endif - -#endif /* _config_netware_h */ - diff --git a/dep/include/mysql/config-os2.h b/dep/include/mysql/config-os2.h deleted file mode 100644 index 440d75af65a..00000000000 --- a/dep/include/mysql/config-os2.h +++ /dev/null @@ -1,836 +0,0 @@ -/* Copyright (C) 2000 MySQL AB & Yuri Dario - All the above parties has a full, independent copyright to - the following code, including the right to use the code in - any manner without any demands from the other parties. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* Defines for OS2 to make it compatible for MySQL */ - -#ifndef __CONFIG_OS2_H__ -#define __CONFIG_OS2_H__ - -#include -#include -#include -#include - -/* Define to name of system eg solaris*/ -#define SYSTEM_TYPE "IBM OS/2 Warp" -/* Define to machine type name eg sun10 */ -#define MACHINE_TYPE "i686" -/* Name of package */ -#define PACKAGE "mysql" -/* Version number of package */ -#define VERSION MYSQL_SERVER_VERSION -/* Default socket */ -#define MYSQL_UNIX_ADDR "\\socket\\MySQL" - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define MY_NFILE 1024 /* This is only used to save filenames */ - -#define HAVE_ACCESS - -#define DEFAULT_MYSQL_HOME "c:\\mysql" -#define DEFAULT_BASEDIR "C:\\" -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/mysql/" -#define _POSIX_PATH_MAX 255 -#define DWORD ULONG - -#define O_SHARE 0x1000 /* Open file in sharing mode */ -#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ -#define S_IROTH S_IREAD /* for my_lib */ - -#define CANT_DELETE_OPEN_FILES /* saves open files in a list, for delayed delete */ - -#define O_NONBLOCK 0x10 - -#define NO_OPEN_3 /* For my_create() */ -#define SIGQUIT SIGTERM /* No SIGQUIT */ -#define SIGALRM 14 /* Alarm */ - -#define NO_FCNTL_NONBLOCK - -#define EFBIG E2BIG -/*#define ENFILE EMFILE */ -/*#define ENAMETOOLONG (EOS2ERR+2) */ -/*#define ETIMEDOUT 145 */ -/*#define EPIPE 146 */ -#define EROFS 147 - -#define sleep(A) DosSleep((A)*1000) -#define closesocket(A) soclose(A) - -#define F_OK 0 -#define W_OK 2 - -#define bzero(x,y) memset((x),'\0',(y)) -#define bcopy(x,y,z) memcpy((y),(x),(z)) -#define bcmp(x,y,z) memcmp((y),(x),(z)) - -#define F_RDLCK 4 /* Read lock. */ -#define F_WRLCK 2 /* Write lock. */ -#define F_UNLCK 0 /* Remove lock. */ - -#define S_IFMT 0x17000 /* Mask for file type */ -#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */ - -#define HUGE_PTR - -#ifdef __cplusplus -extern "C" -#endif -double _cdecl rint( double nr); - -DWORD TlsAlloc( void); -BOOL TlsFree( DWORD); -PVOID TlsGetValue( DWORD); -BOOL TlsSetValue( DWORD, PVOID); - -/* support for > 2GB file size */ -#define SIZEOF_OFF_T 8 -#define lseek(A,B,C) _lseek64( A, B, C) -#define tell(A) _lseek64( A, 0, SEEK_CUR) - -void* dlopen( char* path, int flag); -char* dlerror( void); -void* dlsym( void* hmod, char* fn); -void dlclose( void* hmod); - -/* Some typedefs */ -typedef unsigned long long os_off_t; - -/* config.h. Generated automatically by configure. */ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -/* #undef C_ALLOCA */ - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -/* #undef CRAY_STACKSEG_END */ - -/* Define if you have alloca, as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define if you have and it should be used (not on Ultrix). */ -/* #define HAVE_ALLOCA_H 1 */ - -/* Define if you don't have vprintf but do have _doprnt. */ -/* #undef HAVE_DOPRNT */ - -/* Define if you have a working `mmap' system call. */ -/* #undef HAVE_MMAP */ - -/* Define if system calls automatically restart after interruption - by a signal. */ -/* #undef HAVE_RESTARTABLE_SYSCALLS */ - -/* Define if your struct stat has st_rdev. */ -#define HAVE_ST_RDEV 1 - -/* Define if you have that is POSIX.1 compatible. */ -/* #define HAVE_SYS_WAIT_H 1 */ - -/* Define if you don't have tm_zone but do have the external array - tzname. */ -#define HAVE_TZNAME 1 - -/* Define if utime(file, NULL) sets file's timestamp to the present. */ -#define HAVE_UTIME_NULL 1 - -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - -/* Define as __inline if that's what the C compiler calls it. */ -/* #undef inline */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#define STACK_DIRECTION -1 - -/* Define if the `S_IS*' macros in do not work properly. */ -/* #undef STAT_MACROS_BROKEN */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define if your declares struct tm. */ -/* #undef TM_IN_SYS_TIME */ - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ - -/* Version of .frm files */ -#define DOT_FRM_VERSION 6 - -/* READLINE: */ -#define FIONREAD_IN_SYS_IOCTL 1 - -/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */ -/* #undef GWINSZ_IN_SYS_IOCTL */ - -/* Do we have FIONREAD */ -#define FIONREAD_IN_SYS_IOCTL 1 - -/* atomic_add() from (Linux only) */ -/* #undef HAVE_ATOMIC_ADD */ - -/* atomic_sub() from (Linux only) */ -/* #undef HAVE_ATOMIC_SUB */ - -/* bool is not defined by all C++ compilators */ -#define HAVE_BOOL 1 - -/* Have berkeley db installed */ -/* #define HAVE_BERKELEY_DB 1 */ - -/* DSB style signals ? */ -/* #undef HAVE_BSD_SIGNALS */ - -/* Can netinet be included */ -/* #undef HAVE_BROKEN_NETINET_INCLUDES */ - -/* READLINE: */ -/* #undef HAVE_BSD_SIGNALS */ - -/* ZLIB and compress: */ -#define HAVE_COMPRESS 1 - -/* Define if we are using OSF1 DEC threads */ -/* #undef HAVE_DEC_THREADS */ - -/* Define if we are using OSF1 DEC threads on 3.2 */ -/* #undef HAVE_DEC_3_2_THREADS */ - -/* fp_except from ieeefp.h */ -/* #undef HAVE_FP_EXCEPT */ - -/* READLINE: */ -/* #undef HAVE_GETPW_DECLS */ - -/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines - this with 6 arguments */ -/* #undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE */ - -/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */ -/* #undef HAVE_GETHOSTBYNAME_R_RETURN_INT */ - -/* Define if int8, int16 and int32 types exist */ -/* #undef HAVE_INT_8_16_32 */ - -/* Define if have -lwrap */ -/* #undef HAVE_LIBWRAP */ - -/* Define if we are using Xavier Leroy's LinuxThreads */ -/* #undef HAVE_LINUXTHREADS */ - -/* Do we use user level threads */ -/* #undef HAVE_mit_thread */ - -/* For some non posix threads */ -/* #undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC */ - -/* For some non posix threads */ -/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ - -/* READLINE: */ -#define HAVE_POSIX_SIGNALS 0 - -/* sigwait with one argument */ -/* #undef HAVE_NONPOSIX_SIGWAIT */ - -/* pthread_attr_setscope */ -#define HAVE_PTHREAD_ATTR_SETSCOPE 1 - -/* POSIX readdir_r */ -/* #undef HAVE_READDIR_R */ - -/* POSIX sigwait */ -/* #undef HAVE_SIGWAIT */ - -/* crypt */ -#define HAVE_CRYPT 1 - -/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines - this with 8 arguments */ -/* #undef HAVE_SOLARIS_STYLE_GETHOST */ - -/* Timespec has a ts_sec instead of tv_sev */ -#define HAVE_TIMESPEC_TS_SEC 1 - -/* Have the tzname variable */ -#define HAVE_TZNAME 1 - -/* Define if the system files define uchar */ -/* #undef HAVE_UCHAR */ - -/* Define if the system files define uint */ -/* #undef HAVE_UINT */ - -/* Define if the system files define ulong */ -/* #undef HAVE_ULONG */ - -/* UNIXWARE7 threads are not posix */ -/* #undef HAVE_UNIXWARE7_THREADS */ - -/* new UNIXWARE7 threads that are not yet posix */ -/* #undef HAVE_UNIXWARE7_POSIX */ - -/* READLINE: */ -/* #undef HAVE_USG_SIGHOLD */ - -/* Define if want -lwrap */ -/* #undef LIBWRAP */ - -/* mysql client protocoll version */ -#define PROTOCOL_VERSION 10 - -/* Define if qsort returns void */ -#define QSORT_TYPE_IS_VOID 1 - -/* Define as the return type of qsort (int or void). */ -#define RETQSORTTYPE void - -/* Define as the base type of the last arg to accept */ -#define SOCKET_SIZE_TYPE int - -/* Last argument to get/setsockopt */ -/* #undef SOCKOPT_OPTLEN_TYPE */ - -/* #undef SPEED_T_IN_SYS_TYPES */ -/* #undef SPRINTF_RETURNS_PTR */ -#define SPRINTF_RETURNS_INT 1 -/* #undef SPRINTF_RETURNS_GARBAGE */ - -/* #undef STRUCT_DIRENT_HAS_D_FILENO */ -#define STRUCT_DIRENT_HAS_D_INO 1 - -/* Define if you want to have threaded code. This may be undef on client code */ -#define THREAD 1 - -/* Should be client be thread safe */ -/* #undef THREAD_SAFE_CLIENT */ - -/* READLINE: */ -/* #undef TIOCSTAT_IN_SYS_IOCTL */ - -/* Use multi-byte character routines */ -/* #undef USE_MB */ -/* #undef USE_MB_IDENT */ - -/* Use MySQL RAID */ -/* #undef USE_RAID */ - -/* Use strcoll() functions when comparing and sorting. */ -/* #undef USE_STRCOLL */ - -/* READLINE: */ -#define VOID_SIGHANDLER 1 - -/* The number of bytes in a char. */ -#define SIZEOF_CHAR 1 - -/* The number of bytes in a int. */ -#define SIZEOF_INT 4 - -/* The number of bytes in a long. */ -#define SIZEOF_LONG 4 - -/* The number of bytes in a long long. */ -#define SIZEOF_LONG_LONG 8 - -/* Define if you have the alarm function. */ -#define HAVE_ALARM 1 - -/* Define if you have the atod function. */ -/* #undef HAVE_ATOD */ - -/* Define if you have the bcmp function. */ -#define HAVE_BCMP 1 - -/* Define if you have the bfill function. */ -/* #undef HAVE_BFILL */ - -/* Define if you have the bmove function. */ -/* #undef HAVE_BMOVE */ - -/* Define if you have the bzero function. */ -#define HAVE_BZERO 1 - -/* Define if you have the chsize function. */ -#define HAVE_CHSIZE 1 - -/* Define if you have the cuserid function. */ -/* #define HAVE_CUSERID 1 */ - -/* Define if you have the dlerror function. */ -#define HAVE_DLERROR 1 - -/* Define if you have the dlopen function. */ -#define HAVE_DLOPEN 1 - -/* Define if you have the fchmod function. */ -/* #undef HAVE_FCHMOD */ - -/* Define if you have the fcntl function. */ -/* #define HAVE_FCNTL 1 */ - -/* Define if you have the fconvert function. */ -/* #undef HAVE_FCONVERT */ - -/* Define if you have the finite function. */ -/* #undef HAVE_FINITE */ - -/* Define if you have the fpresetsticky function. */ -/* #undef HAVE_FPRESETSTICKY */ - -/* Define if you have the fpsetmask function. */ -/* #undef HAVE_FPSETMASK */ - -/* Define if you have the fseeko function. */ -/* #undef HAVE_FSEEKO */ - -/* Define if you have the ftruncate function. */ -/* #define HAVE_FTRUNCATE 1 */ - -/* Define if you have the getcwd function. */ -#define HAVE_GETCWD 1 - -/* Define if you have the gethostbyaddr_r function. */ -/* #undef HAVE_GETHOSTBYADDR_R */ - -/* Define if you have the gethostbyname_r function. */ -/* #undef HAVE_GETHOSTBYNAME_R */ - -/* Define if you have the getpagesize function. */ -#define HAVE_GETPAGESIZE 1 - -/* Define if you have the getpass function. */ -/*#define HAVE_GETPASS 1 */ - -/* Define if you have the getpassphrase function. */ -/* #undef HAVE_GETPASSPHRASE */ - -/* Define if you have the getpwnam function. */ -/* #define HAVE_GETPWNAM 1 */ - -/* Define if you have the getpwuid function. */ -/* #define HAVE_GETPWUID 1 */ - -/* Define if you have the getrlimit function. */ -/* #undef HAVE_GETRLIMIT */ - -/* Define if you have the getrusage function. */ -/* #undef HAVE_GETRUSAGE */ - -/* Define if you have the getwd function. */ -#define HAVE_GETWD 1 - -/* Define to 1 if you have the `gmtime_r' function. */ -#define HAVE_GMTIME_R 1 - -/* Define if you have the index function. */ -#define HAVE_INDEX 1 - -/* Define if you have the initgroups function. */ -/* #undef HAVE_INITGROUPS */ - -/* Define if you have the localtime_r function. */ -#define HAVE_LOCALTIME_R 1 - -/* Define if you have the locking function. */ -/* #undef HAVE_LOCKING */ - -/* Define if you have the longjmp function. */ -#define HAVE_LONGJMP 1 - -/* Define if you have the lrand48 function. */ -/* #undef HAVE_LRAND48 */ - -/* Define if you have the lstat function. */ -/* #undef HAVE_LSTAT */ - -/* Define if you have the madvise function. */ -/* #undef HAVE_MADVISE */ - -/* Define if you have the memcpy function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the mkstemp function. */ -/* #define HAVE_MKSTEMP 1 */ - -/* Define if you have the mlockall function. */ -/* #undef HAVE_MLOCKALL */ - -/* Define if you have the perror function. */ -#define HAVE_PERROR 1 - -/* Define if you have the poll function. */ -/* #undef HAVE_POLL */ - -/* Define if you have the pread function. */ -/* #undef HAVE_PREAD */ - -/* Define if you have the pthread_attr_create function. */ -/* #undef HAVE_PTHREAD_ATTR_CREATE */ - -/* Define if you have the pthread_attr_setprio function. */ -#define HAVE_PTHREAD_ATTR_SETPRIO 1 - -/* Define if you have the pthread_attr_setschedparam function. */ -/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ - -/* Define if you have the pthread_attr_setstacksize function. */ -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 - -/* Define if you have the pthread_condattr_create function. */ -/* #undef HAVE_PTHREAD_CONDATTR_CREATE */ - -/* Define if you have the pthread_getsequence_np function. */ -/* #undef HAVE_PTHREAD_GETSEQUENCE_NP */ - -/* Define if you have the pthread_init function. */ -/* #undef HAVE_PTHREAD_INIT */ - -/* Define if you have the pthread_rwlock_rdlock function. */ -/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */ - -/* Define if you have the pthread_setprio function. */ -#define HAVE_PTHREAD_SETPRIO 1 - -/* Define if you have the pthread_setprio_np function. */ -/* #undef HAVE_PTHREAD_SETPRIO_NP */ - -/* Define if you have the pthread_setschedparam function. */ -/* #undef HAVE_PTHREAD_SETSCHEDPARAM */ - -/* Define if you have the pthread_sigmask function. */ -#define HAVE_PTHREAD_SIGMASK 1 - -/* Define if you have the putenv function. */ -#define HAVE_PUTENV 1 - -/* Define if you have the readlink function. */ -/* #undef HAVE_READLINK */ - -/* Define if you have the realpath function. */ -/* #undef HAVE_REALPATH */ - -/* Define if you have the rename function. */ -#define HAVE_RENAME 1 - -/* Define if you have the rint function. */ -#define HAVE_RINT 1 - -/* Define if you have the rwlock_init function. */ -/* #undef HAVE_RWLOCK_INIT */ - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the setenv function. */ -/* #undef HAVE_SETENV */ - -/* Define if you have the setlocale function. */ -#define HAVE_SETLOCALE 1 - -/* Define if you have the setupterm function. */ -/* #undef HAVE_SETUPTERM */ - -/* Define if you have the sighold function. */ -/* #undef HAVE_SIGHOLD */ - -/* Define if you have the sigset function. */ -/* #undef HAVE_SIGSET */ - -/* Define if you have the sigthreadmask function. */ -/* #undef HAVE_SIGTHREADMASK */ - -/* Define if you have the snprintf function. */ -/* #define HAVE_SNPRINTF 1 */ - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the stpcpy function. */ -/* #undef HAVE_STPCPY */ - -/* Define if you have the strcasecmp function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the strcoll function. */ -#define HAVE_STRCOLL 1 - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strnlen function. */ -/* #undef HAVE_STRNLEN */ - -/* Define if you have the strpbrk function. */ -#define HAVE_STRPBRK 1 - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the strtok_r function. */ -/* #undef HAVE_STRTOK_R */ - -/* Define if you have the strtol function. */ -#define HAVE_STRTOL 1 - -/* Define if you have the strtoul function. */ -#define HAVE_STRTOUL 1 - -/* Define if you have the strtoull function. */ -/* #undef HAVE_STRTOULL */ - -/* Define if you have the tcgetattr function. */ -#define HAVE_TCGETATTR 1 - -/* Define if you have the tell function. */ -#define HAVE_TELL 1 - -/* Define if you have the tempnam function. */ -#define HAVE_TEMPNAM 1 - -/* Define if you have the thr_setconcurrency function. */ -/* #undef HAVE_THR_SETCONCURRENCY */ - -/* Define if you have the vidattr function. */ -/* #undef HAVE_VIDATTR */ - -/* Define if you have the header file. */ -/* #define HAVE_ALLOCA_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_ASM_TERMBITS_H */ - -/* Define if you have the header file. */ -#define HAVE_CRYPT_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_CURSES_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_DIRENT_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -#define HAVE_FLOAT_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_FLOATINGPOINT_H */ - -/* Define if you have the header file. */ -/* #define HAVE_GRP_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_IEEEFP_H */ - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_NDIR_H */ - -/* Define if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_PATHS_H */ - -/* Define if you have the header file. */ -/* #define HAVE_PWD_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_SCHED_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SELECT_H */ - -/* Define if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_STRINGS_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYNCH_H */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_DIR_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_FILE_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_MMAN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PTE_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PTEM_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STREAM_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_UN_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_UTIME_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_VADVISE_H */ - -/* Define if you have the header file. */ -/* #define HAVE_SYS_WAIT_H 1 */ - -/* Define if you have the header file. */ -/* #undef HAVE_TERM_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_TERMBITS_H */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMCAP_H 1 */ - -/* Define if you have the header file. */ -/* /#define HAVE_TERMIO_H 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_TERMIOS_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define if you have the header file. */ -#define HAVE_UTIME_H 1 - -/* Define if you have the header file. */ -#define HAVE_VARARGS_H 1 - -/* Define if you have the bind library (-lbind). */ -/* #undef HAVE_LIBBIND */ - -/* Define if you have the c_r library (-lc_r). */ -/* #undef HAVE_LIBC_R */ - -/* Define if you have the compat library (-lcompat). */ -/* #undef HAVE_LIBCOMPAT */ - -/* Define if you have the crypt library (-lcrypt). */ -#define HAVE_LIBCRYPT 1 - -/* Define if you have the dl library (-ldl). */ -#define HAVE_LIBDL 1 - -/* Define if you have the gen library (-lgen). */ -/* #undef HAVE_LIBGEN */ - -/* Define if you have the m library (-lm). */ -#define HAVE_LIBM 1 - -/* Define if you have the nsl library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - -/* Define if you have the nsl_r library (-lnsl_r). */ -/* #undef HAVE_LIBNSL_R */ - -/* Define if you have the pthread library (-lpthread). */ -/* #undef HAVE_LIBPTHREAD */ - -/* Define if you have the socket library (-lsocket). */ -/* #undef HAVE_LIBSOCKET */ - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define to make fseeko etc. visible, on some hosts. */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -#endif /* __CONFIG_OS2_H__ */ - diff --git a/dep/include/mysql/config-win.h b/dep/include/mysql/config-win.h deleted file mode 100644 index 5a4cf162a11..00000000000 --- a/dep/include/mysql/config-win.h +++ /dev/null @@ -1,461 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Defines for Win32 to make it compatible for MySQL */ - -#ifdef __WIN2000__ -/* We have to do this define before including windows.h to get the AWE API -functions */ -#define _WIN32_WINNT 0x0500 -#else -/* Get NT 4.0 functions */ -#define _WIN32_WINNT 0x0400 -#endif - -#if defined(_MSC_VER) && _MSC_VER >= 1400 -/* Avoid endless warnings about sprintf() etc. being unsafe. */ -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -#include -#include -#include /* Because of rint() */ -#include -#include -#include - -#define BIG_TABLES 1 -#define HAVE_SMEM 1 - -#if defined(_WIN64) || defined(WIN64) -#define SYSTEM_TYPE "Win64" -#elif defined(_WIN32) || defined(WIN32) -#define SYSTEM_TYPE "Win32" -#else -#define SYSTEM_TYPE "Windows" -#endif - -#if defined(_M_IA64) -#define MACHINE_TYPE "ia64" -#elif defined(_M_IX86) -#define MACHINE_TYPE "ia32" -#elif defined(_M_ALPHA) -#define MACHINE_TYPE "axp" -#else -#define MACHINE_TYPE "unknown" /* Define to machine type name */ -#endif - -#if !(defined(_WIN64) || defined(WIN64)) -#ifndef _WIN32 -#define _WIN32 /* Compatible with old source */ -#endif -#ifndef __WIN32__ -#define __WIN32__ -#endif -#endif /* _WIN64 */ -#ifndef __WIN__ -#define __WIN__ /* To make it easier in VC++ */ -#endif - -#ifndef MAX_INDEXES -#define MAX_INDEXES 64 -#endif - -/* File and lock constants */ -#define O_SHARE 0x1000 /* Open file in sharing mode */ -#ifdef __BORLANDC__ -#define F_RDLCK LK_NBLCK /* read lock */ -#define F_WRLCK LK_NBRLCK /* write lock */ -#define F_UNLCK LK_UNLCK /* remove lock(s) */ -#else -#define F_RDLCK _LK_NBLCK /* read lock */ -#define F_WRLCK _LK_NBRLCK /* write lock */ -#define F_UNLCK _LK_UNLCK /* remove lock(s) */ -#endif - -#define F_EXCLUSIVE 1 /* We have only exclusive locking */ -#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */ -#define F_OK 0 /* parameter to access() */ -#define W_OK 2 - -#define S_IROTH S_IREAD /* for my_lib */ - -#ifdef __BORLANDC__ -#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ -#define O_TEMPORARY 0 -#define O_SHORT_LIVED 0 -#define SH_DENYNO _SH_DENYNO -#else -#define O_BINARY _O_BINARY /* compability with MSDOS */ -#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */ -#define O_TEMPORARY _O_TEMPORARY -#define O_SHORT_LIVED _O_SHORT_LIVED -#define SH_DENYNO _SH_DENYNO -#endif -#define NO_OPEN_3 /* For my_create() */ - -#define SIGQUIT SIGTERM /* No SIGQUIT */ - -#undef _REENTRANT /* Crashes something for win32 */ -#undef SAFE_MUTEX /* Can't be used on windows */ - -#if defined(_MSC_VER) && _MSC_VER >= 1310 -#define LL(A) A##ll -#define ULL(A) A##ull -#else -#define LL(A) ((__int64) A) -#define ULL(A) ((unsigned __int64) A) -#endif - -#define LONGLONG_MIN LL(0x8000000000000000) -#define LONGLONG_MAX LL(0x7FFFFFFFFFFFFFFF) -#define ULONGLONG_MAX ULL(0xFFFFFFFFFFFFFFFF) - -/* Type information */ - -#if defined(__EMX__) || !defined(HAVE_UINT) -#undef HAVE_UINT -#define HAVE_UINT -typedef unsigned short ushort; -typedef unsigned int uint; -#endif /* defined(__EMX__) || !defined(HAVE_UINT) */ - -typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ -typedef __int64 longlong; -#ifndef HAVE_SIGSET_T -typedef int sigset_t; -#endif -#define longlong_defined -/* - off_t should not be __int64 because of conflicts in header files; - Use my_off_t or os_off_t instead -*/ -#ifndef HAVE_OFF_T -typedef long off_t; -#endif -typedef __int64 os_off_t; -#ifdef _WIN64 -typedef UINT_PTR rf_SetTimer; -#else -#ifndef HAVE_SIZE_T -typedef unsigned int size_t; -#endif -typedef uint rf_SetTimer; -#endif - -#define Socket_defined -#define my_socket SOCKET -#define bool BOOL -#define SIGPIPE SIGINT -#define RETQSORTTYPE void -#define QSORT_TYPE_IS_VOID -#define RETSIGTYPE void -#define SOCKET_SIZE_TYPE int -#define my_socket_defined -#define bool_defined -#define byte_defined -#define HUGE_PTR -#define STDCALL __stdcall /* Used by libmysql.dll */ -#define isnan(X) _isnan(X) -#define finite(X) _finite(X) - -#ifndef UNDEF_THREAD_HACK -#define THREAD -#endif -#define VOID_SIGHANDLER -#define SIZEOF_CHAR 1 -#define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 8 -#define SIZEOF_OFF_T 8 -#ifdef _WIN64 -#define SIZEOF_CHARP 8 -#else -#define SIZEOF_CHARP 4 -#endif -#define HAVE_BROKEN_NETINET_INCLUDES -#ifdef __NT__ -#define HAVE_NAMED_PIPE /* We can only create pipes on NT */ -#endif - -/* ERROR is defined in wingdi.h */ -#undef ERROR - -/* We need to close files to break connections on shutdown */ -#ifndef SIGNAL_WITH_VIO_CLOSE -#define SIGNAL_WITH_VIO_CLOSE -#endif - -/* Use all character sets in MySQL */ -#define USE_MB 1 -#define USE_MB_IDENT 1 -#define USE_STRCOLL 1 - -/* All windows servers should support .sym files */ -#undef USE_SYMDIR -#define USE_SYMDIR - -/* If LOAD DATA LOCAL INFILE should be enabled by default */ -#define ENABLED_LOCAL_INFILE 1 - -/* Convert some simple functions to Posix */ - -#define my_sigset(A,B) signal((A),(B)) -#define finite(A) _finite(A) -#define sleep(A) Sleep((A)*1000) -#define popen(A,B) _popen((A),(B)) -#define pclose(A) _pclose(A) - -#ifndef __BORLANDC__ -#define access(A,B) _access(A,B) -#endif - -#if !defined(__cplusplus) -#define inline __inline -#endif /* __cplusplus */ - -inline double rint(double nr) -{ - double f = floor(nr); - double c = ceil(nr); - return (((c-nr) >= (nr-f)) ? f :c); -} - -#ifdef _WIN64 -#define ulonglong2double(A) ((double) (ulonglong) (A)) -#define my_off_t2double(A) ((double) (my_off_t) (A)) - -#else -inline double ulonglong2double(ulonglong value) -{ - longlong nr=(longlong) value; - if (nr >= 0) - return (double) nr; - return (18446744073709551616.0 + (double) nr); -} -#define my_off_t2double(A) ulonglong2double(A) -#endif /* _WIN64 */ - -#if SIZEOF_OFF_T > 4 -#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C)) -#define tell(A) _telli64(A) -#endif - - -#define STACK_DIRECTION -1 - -/* Optimized store functions for Intel x86 */ - -#ifndef _WIN64 -#define sint2korr(A) (*((int16 *) (A))) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -/* - ATTENTION ! - - Please, note, uint3korr reads 4 bytes (not 3) ! - It means, that you have to provide enough allocated space ! -*/ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#define uint4korr(A) (*((unsigned long *) (A))) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) -#define int2store(T,A) *((uint16*) (T))= (uint16) (A) -#define int3store(T,A) { *(T)= (uchar) ((A));\ - *(T+1)=(uchar) (((uint) (A) >> 8));\ - *(T+2)=(uchar) (((A) >> 16)); } -#define int4store(T,A) *((long *) (T))= (long) (A) -#define int5store(T,A) { *(T)= (uchar)((A));\ - *((T)+1)=(uchar) (((A) >> 8));\ - *((T)+2)=(uchar) (((A) >> 16));\ - *((T)+3)=(uchar) (((A) >> 24)); \ - *((T)+4)=(uchar) (((A) >> 32)); } -#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) - -#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \ - *(((long *) &V)+1) = *(((long*) M)+1); } while(0) -#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \ - *(((long *) T)+1) = *(((long*) &V)+1); } while(0) -#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } -#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float)) -#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float)) -#define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) -#define float8store(V,M) doublestore((V),(M)) -#endif /* _WIN64 */ - -#define HAVE_PERROR -#define HAVE_VFPRINT -#define HAVE_RENAME /* Have rename() as function */ -#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */ -#define HAVE_LONG_JMP /* Have long jump function */ -#define HAVE_LOCKING /* have locking() call */ -#define HAVE_ERRNO_AS_DEFINE /* errno is a define */ -#define HAVE_STDLIB /* everything is include in this file */ -#define HAVE_MEMCPY -#define HAVE_MEMMOVE -#define HAVE_GETCWD -#define HAVE_TELL -#define HAVE_TZNAME -#define HAVE_PUTENV -#define HAVE_SELECT -#define HAVE_SETLOCALE -#define HAVE_SOCKET /* Giangi */ -#define HAVE_FLOAT_H -#define HAVE_LIMITS_H -#define HAVE_STDDEF_H -#define HAVE_RINT /* defined in this file */ -#define NO_FCNTL_NONBLOCK /* No FCNTL */ -#define HAVE_ALLOCA -#define HAVE_STRPBRK -#define HAVE_STRSTR -#define HAVE_COMPRESS -#define HAVE_CREATESEMAPHORE -#define HAVE_ISNAN -#define HAVE_FINITE -#define HAVE_QUERY_CACHE -#define SPRINTF_RETURNS_INT -#define HAVE_SETFILEPOINTER -#define HAVE_VIO_READ_BUFF -#define HAVE_STRNLEN - -#ifndef __NT__ -#undef FILE_SHARE_DELETE -#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */ -#endif - -#ifdef NOT_USED -#define HAVE_SNPRINTF /* Gave link error */ -#define _snprintf snprintf -#endif - -#ifdef _MSC_VER -#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ -#define HAVE_ANSI_INCLUDE -#define HAVE_SYS_UTIME_H -#define HAVE_STRTOUL -#endif -#define my_reinterpret_cast(A) reinterpret_cast -#define my_const_cast(A) const_cast - - -/* MYSQL OPTIONS */ - -#ifdef _CUSTOMCONFIG_ -#include -#else -#define DEFAULT_MYSQL_HOME "c:\\mysql" -#define DATADIR "c:\\mysql\\data" -#define PACKAGE "mysql" -#define DEFAULT_BASEDIR "C:\\" -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/mysql/" -#endif -#ifndef DEFAULT_HOME_ENV -#define DEFAULT_HOME_ENV MYSQL_HOME -#endif -#ifndef DEFAULT_GROUP_SUFFIX_ENV -#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX -#endif - -/* File name handling */ - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define FN_DEVCHAR ':' -#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ -#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ -#define OS_FILE_LIMIT 2048 - -#define DO_NOT_REMOVE_THREAD_WRAPPERS -#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) -#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) -/* The following is only used for statistics, so it should be good enough */ -#ifdef __NT__ /* This should also work on Win98 but .. */ -#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) -#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) -#else -#define thread_safe_add(V,C,L) \ - pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L)); -#define thread_safe_sub(V,C,L) \ - pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L)); -#define statistic_add(V,C,L) (V)+=(C) -#endif -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define statistic_decrement(V,L) thread_safe_decrement((V),(L)) - -#define shared_memory_buffer_length 16000 -#define default_shared_memory_base_name "MYSQL" - -#define MYSQL_DEFAULT_CHARSET_NAME "latin1" -#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" - -#define HAVE_SPATIAL 1 -#define HAVE_RTREE_KEYS 1 - -#define HAVE_OPENSSL 1 -#define HAVE_YASSL 1 - -/* Define charsets you want */ -/* #undef HAVE_CHARSET_armscii8 */ -/* #undef HAVE_CHARSET_ascii */ -#define HAVE_CHARSET_big5 1 -#define HAVE_CHARSET_cp1250 1 -/* #undef HAVE_CHARSET_cp1251 */ -/* #undef HAVE_CHARSET_cp1256 */ -/* #undef HAVE_CHARSET_cp1257 */ -/* #undef HAVE_CHARSET_cp850 */ -/* #undef HAVE_CHARSET_cp852 */ -/* #undef HAVE_CHARSET_cp866 */ -#define HAVE_CHARSET_cp932 1 -/* #undef HAVE_CHARSET_dec8 */ -#define HAVE_CHARSET_eucjpms 1 -#define HAVE_CHARSET_euckr 1 -#define HAVE_CHARSET_gb2312 1 -#define HAVE_CHARSET_gbk 1 -/* #undef HAVE_CHARSET_greek */ -/* #undef HAVE_CHARSET_hebrew */ -/* #undef HAVE_CHARSET_hp8 */ -/* #undef HAVE_CHARSET_keybcs2 */ -/* #undef HAVE_CHARSET_koi8r */ -/* #undef HAVE_CHARSET_koi8u */ -#define HAVE_CHARSET_latin1 1 -#define HAVE_CHARSET_latin2 1 -/* #undef HAVE_CHARSET_latin5 */ -/* #undef HAVE_CHARSET_latin7 */ -/* #undef HAVE_CHARSET_macce */ -/* #undef HAVE_CHARSET_macroman */ -#define HAVE_CHARSET_sjis 1 -/* #undef HAVE_CHARSET_swe7 */ -#define HAVE_CHARSET_tis620 1 -#define HAVE_CHARSET_ucs2 1 -#define HAVE_CHARSET_ujis 1 -#define HAVE_CHARSET_utf8 1 -#define HAVE_UCA_COLLATIONS 1 - - diff --git a/dep/include/mysql/m_string.h b/dep/include/mysql/m_string.h deleted file mode 100644 index 445ba18bf41..00000000000 --- a/dep/include/mysql/m_string.h +++ /dev/null @@ -1,267 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* There may be prolems include all of theese. Try to test in - configure with ones are needed? */ - -/* This is needed for the definitions of strchr... on solaris */ - -#ifndef _m_string_h -#define _m_string_h -#ifndef __USE_GNU -#define __USE_GNU /* We want to use stpcpy */ -#endif -#if defined(HAVE_STRINGS_H) -#include -#endif -#if defined(HAVE_STRING_H) -#include -#endif - -/* need by my_vsnprintf */ -#include - -/* Correct some things for UNIXWARE7 */ -#ifdef HAVE_UNIXWARE7_THREADS -#undef HAVE_STRINGS_H -#undef HAVE_MEMORY_H -#define HAVE_MEMCPY -#ifndef HAVE_MEMMOVE -#define HAVE_MEMMOVE -#endif -#undef HAVE_BCMP -#undef bcopy -#undef bcmp -#undef bzero -#endif /* HAVE_UNIXWARE7_THREADS */ -#ifdef _AIX -#undef HAVE_BCMP -#endif - -/* This is needed for the definitions of bzero... on solaris */ -#if defined(HAVE_STRINGS_H) && !defined(HAVE_mit_thread) -#include -#endif - -/* This is needed for the definitions of memcpy... on solaris */ -#if defined(HAVE_MEMORY_H) && !defined(__cplusplus) -#include -#endif - -#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE) -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# define memset(A,C,B) bfill((A),(B),(C)) -# define memmove(d, s, n) bmove ((d), (s), (n)) -#elif defined(HAVE_MEMMOVE) -# define bmove(d, s, n) memmove((d), (s), (n)) -#else -# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */ -#endif - -/* Unixware 7 */ -#if !defined(HAVE_BFILL) -# define bfill(A,B,C) memset((A),(C),(B)) -# define bmove_align(A,B,C) memcpy((A),(B),(C)) -#endif - -#if !defined(HAVE_BCMP) -# define bcopy(s, d, n) memcpy((d), (s), (n)) -# define bcmp(A,B,C) memcmp((A),(B),(C)) -# define bzero(A,B) memset((A),0,(B)) -# define bmove_align(A,B,C) memcpy((A),(B),(C)) -#endif - -#if defined(__cplusplus) && !defined(OS2) -extern "C" { -#endif - -/* - my_str_malloc() and my_str_free() are assigned to implementations in - strings/alloc.c, but can be overridden in the calling program. - */ -extern void *(*my_str_malloc)(size_t); -extern void (*my_str_free)(void *); - -#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread) -#define strmov(A,B) stpcpy((A),(B)) -#ifndef stpcpy -extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ -#endif -#endif - -/* Declared in int2str() */ -extern char NEAR _dig_vec_upper[]; -extern char NEAR _dig_vec_lower[]; - -/* Defined in strtod.c */ -extern const double log_10[309]; - -#ifdef BAD_STRING_COMPILER -#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) -#else -#define strmov_overlapp(A,B) strmov(A,B) -#define strmake_overlapp(A,B,C) strmake(A,B,C) -#endif - -#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */ -#define memcpy_fixed(A,B,C) bmove((A),(B),(C)) -#else -#define memcpy_fixed(A,B,C) memcpy((A),(B),(C)) -#endif - -#ifdef MSDOS -#undef bmove_align -#define bmove512(A,B,C) bmove_align(A,B,C) -extern void bmove_align(gptr dst,const gptr src,uint len); -#endif - -#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512) -#define bmove512(A,B,C) memcpy(A,B,C) -#endif - - /* Prototypes for string functions */ - -#if !defined(bfill) && !defined(HAVE_BFILL) -extern void bfill(gptr dst,uint len,pchar fill); -#endif - -#if !defined(bzero) && !defined(HAVE_BZERO) -extern void bzero(gptr dst,uint len); -#endif - -#if !defined(bcmp) && !defined(HAVE_BCMP) -extern int bcmp(const char *s1,const char *s2,uint len); -#endif -#ifdef HAVE_purify -extern int my_bcmp(const char *s1,const char *s2,uint len); -#undef bcmp -#define bcmp(A,B,C) my_bcmp((A),(B),(C)) -#endif - -#ifndef bmove512 -extern void bmove512(gptr dst,const gptr src,uint len); -#endif - -#if !defined(HAVE_BMOVE) && !defined(bmove) -extern void bmove(char *dst, const char *src,uint len); -#endif - -extern void bmove_upp(char *dst,const char *src,uint len); -extern void bchange(char *dst,uint old_len,const char *src, - uint new_len,uint tot_len); -extern void strappend(char *s,uint len,pchar fill); -extern char *strend(const char *s); -extern char *strcend(const char *, pchar); -extern char *strfield(char *src,int fields,int chars,int blanks, - int tabch); -extern char *strfill(my_string s,uint len,pchar fill); -extern uint strinstr(const char *str,const char *search); -extern uint r_strinstr(reg1 my_string str,int from, reg4 my_string search); -extern char *strkey(char *dst,char *head,char *tail,char *flags); -extern char *strmake(char *dst,const char *src,uint length); -#ifndef strmake_overlapp -extern char *strmake_overlapp(char *dst,const char *src, uint length); -#endif - -#ifndef strmov -extern char *strmov(char *dst,const char *src); -#endif -extern char *strnmov(char *dst,const char *src,uint n); -extern char *strsuff(const char *src,const char *suffix); -extern char *strcont(const char *src,const char *set); -extern char *strxcat _VARARGS((char *dst,const char *src, ...)); -extern char *strxmov _VARARGS((char *dst,const char *src, ...)); -extern char *strxcpy _VARARGS((char *dst,const char *src, ...)); -extern char *strxncat _VARARGS((char *dst,uint len, const char *src, ...)); -extern char *strxnmov _VARARGS((char *dst,uint len, const char *src, ...)); -extern char *strxncpy _VARARGS((char *dst,uint len, const char *src, ...)); - -/* Prototypes of normal stringfunctions (with may ours) */ - -#ifdef WANT_STRING_PROTOTYPES -extern char *strcat(char *, const char *); -extern char *strchr(const char *, pchar); -extern char *strrchr(const char *, pchar); -extern char *strcpy(char *, const char *); -extern int strcmp(const char *, const char *); -#ifndef __GNUC__ -extern size_t strlen(const char *); -#endif -#endif -#ifndef HAVE_STRNLEN -extern uint strnlen(const char *s, uint n); -#endif - -#if !defined(__cplusplus) -#ifndef HAVE_STRPBRK -extern char *strpbrk(const char *, const char *); -#endif -#ifndef HAVE_STRSTR -extern char *strstr(const char *, const char *); -#endif -#endif -extern int is_prefix(const char *, const char *); - -/* Conversion routines */ -double my_strtod(const char *str, char **end, int *error); -double my_atof(const char *nptr); - -extern char *llstr(longlong value,char *buff); -extern char *ullstr(longlong value,char *buff); -#ifndef HAVE_STRTOUL -extern long strtol(const char *str, char **ptr, int base); -extern ulong strtoul(const char *str, char **ptr, int base); -#endif - -extern char *int2str(long val, char *dst, int radix, int upcase); -extern char *int10_to_str(long val,char *dst,int radix); -extern char *str2int(const char *src,int radix,long lower,long upper, - long *val); -longlong my_strtoll10(const char *nptr, char **endptr, int *error); -#if SIZEOF_LONG == SIZEOF_LONG_LONG -#define longlong2str(A,B,C) int2str((A),(B),(C),1) -#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) -#undef strtoll -#define strtoll(A,B,C) strtol((A),(B),(C)) -#define strtoull(A,B,C) strtoul((A),(B),(C)) -#ifndef HAVE_STRTOULL -#define HAVE_STRTOULL -#endif -#ifndef HAVE_STRTOLL -#define HAVE_STRTOLL -#endif -#else -#ifdef HAVE_LONG_LONG -extern char *longlong2str(longlong val,char *dst,int radix); -extern char *longlong10_to_str(longlong val,char *dst,int radix); -#if (!defined(HAVE_STRTOULL) || defined(HAVE_mit_thread)) || defined(NO_STRTOLL_PROTO) -extern longlong strtoll(const char *str, char **ptr, int base); -extern ulonglong strtoull(const char *str, char **ptr, int base); -#endif -#endif -#endif - -/* my_vsnprintf.c */ - -extern int my_vsnprintf( char *str, size_t n, - const char *format, va_list ap ); -extern int my_snprintf(char *to, size_t n, const char *fmt, ...) - ATTRIBUTE_FORMAT(printf, 3, 4); - -#if defined(__cplusplus) && !defined(OS2) -} -#endif -#endif - diff --git a/dep/include/mysql/my_dbug.h b/dep/include/mysql/my_dbug.h deleted file mode 100644 index 68088e1cc8d..00000000000 --- a/dep/include/mysql/my_dbug.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _dbug_h -#define _dbug_h - -#ifdef __cplusplus -extern "C" { -#endif -#if !defined(DBUG_OFF) && !defined(_lint) -extern int _db_on_,_no_db_; -extern FILE *_db_fp_; -extern char *_db_process_; -extern int _db_keyword_(const char *keyword); -extern int _db_strict_keyword_(const char *keyword); -extern void _db_setjmp_(void); -extern void _db_longjmp_(void); -extern void _db_push_(const char *control); -extern void _db_pop_(void); -extern void _db_enter_(const char *_func_,const char *_file_,uint _line_, - const char **_sfunc_,const char **_sfile_, - uint *_slevel_, char ***); -extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_, - uint *_slevel_); -extern void _db_pargs_(uint _line_,const char *keyword); -extern void _db_doprnt_ _VARARGS((const char *format,...)) - ATTRIBUTE_FORMAT(printf, 1, 2); -extern void _db_dump_(uint _line_,const char *keyword,const char *memory, - uint length); -extern void _db_output_(uint flag); -extern void _db_end_(void); -extern void _db_lock_file(void); -extern void _db_unlock_file(void); - -#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \ - char **_db_framep_; \ - _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \ - &_db_framep_) -#define DBUG_LEAVE \ - (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)) -#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} -#define DBUG_VOID_RETURN {DBUG_LEAVE; return;} -#define DBUG_EXECUTE(keyword,a1) \ - {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} -#define DBUG_PRINT(keyword,arglist) \ - {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} -#define DBUG_PUSH(a1) _db_push_ (a1) -#define DBUG_POP() _db_pop_ () -#define DBUG_PROCESS(a1) (_db_process_ = a1) -#define DBUG_FILE (_db_fp_) -#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) -#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) -#define DBUG_DUMP(keyword,a1,a2)\ - {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}} -#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr) -#define DEBUGGER_OFF _no_db_=1;_db_on_=0; -#define DEBUGGER_ON _no_db_=0 -#define DBUG_END() _db_end_ () -#define DBUG_LOCK_FILE { _db_lock_file(); } -#define DBUG_UNLOCK_FILE { _db_unlock_file(); } -#define DBUG_OUTPUT(A) { _db_output_(A); } -#define DBUG_ASSERT(A) assert(A) -#define DBUG_EXECUTE_IF(keyword,a1) \ - {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}} -#define IF_DBUG(A) A -#else /* No debugger */ - -#define DBUG_ENTER(a1) -#define DBUG_RETURN(a1) return(a1) -#define DBUG_VOID_RETURN return -#define DBUG_EXECUTE(keyword,a1) {} -#define DBUG_EXECUTE_IF(keyword,a1) {} -#define DBUG_PRINT(keyword,arglist) {} -#define DBUG_PUSH(a1) {} -#define DBUG_POP() {} -#define DBUG_PROCESS(a1) {} -#define DBUG_FILE (stderr) -#define DBUG_SETJMP setjmp -#define DBUG_LONGJMP longjmp -#define DBUG_DUMP(keyword,a1,a2) {} -#define DBUG_IN_USE 0 -#define DEBUGGER_OFF -#define DEBUGGER_ON -#define DBUG_END() -#define DBUG_LOCK_FILE -#define DBUG_UNLOCK_FILE -#define DBUG_OUTPUT(A) -#define DBUG_ASSERT(A) {} -#define DBUG_LEAVE -#define IF_DBUG(A) -#endif -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/include/mysql/mysql_version.h b/dep/include/mysql/mysql_version.h deleted file mode 100644 index 0628c9fb331..00000000000 --- a/dep/include/mysql/mysql_version.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright Abandoned 1996, 1999, 2001 MySQL AB - This file is public domain and comes with NO WARRANTY of any kind */ - -/* Version numbers for protocol & mysqld */ - -#ifndef _mysql_version_h -#define _mysql_version_h -#ifdef _CUSTOMCONFIG_ -#include -#else -#define PROTOCOL_VERSION 10 -#define MYSQL_SERVER_VERSION "5.0.56" -#define MYSQL_BASE_VERSION "mysqld-5.0" -#define MYSQL_SERVER_SUFFIX_DEF "-nt" -#define FRM_VER 6 -#define MYSQL_VERSION_ID 50056 -#define MYSQL_PORT 3306 -#define MYSQL_PORT_DEFAULT 0 -#define MYSQL_UNIX_ADDR "/tmp/mysql.sock" -#define MYSQL_CONFIG_NAME "my" -#define MYSQL_COMPILATION_COMMENT "From Sources" - -/* mysqld compile time options */ -#endif /* _CUSTOMCONFIG_ */ - -#ifndef LICENSE -#define LICENSE GPL -#endif /* LICENSE */ - -#endif /* _mysql_version_h */ - diff --git a/dep/include/mysql/raid.h b/dep/include/mysql/raid.h deleted file mode 100644 index 77e668c35b2..00000000000 --- a/dep/include/mysql/raid.h +++ /dev/null @@ -1,159 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Parser needs these defines always, even if USE_RAID is not defined */ -#define RAID_TYPE_0 1 /* Striping */ -#define RAID_TYPE_x 2 /* Some new modes */ -#define RAID_TYPE_y 3 - -#define RAID_DEFAULT_CHUNKS 4 -#define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */ - -C_MODE_START -#define my_raid_type(raid_type) raid_type_string[(int)(raid_type)] -extern const char *raid_type_string[]; -C_MODE_END - -#ifdef DONT_USE_RAID -#undef USE_RAID -#endif -#if defined(USE_RAID) - -#include "my_dir.h" - -/* Trap all occurences of my_...() in source and use our wrapper around this function */ - -#ifdef MAP_TO_USE_RAID -#define my_read(A,B,C,D) my_raid_read(A,B,C,D) -#define my_write(A,B,C,D) my_raid_write(A,B,C,D) -#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E) -#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E) -#define my_chsize(A,B,C,D) my_raid_chsize(A,B,C,D) -#define my_close(A,B) my_raid_close(A,B) -#define my_tell(A,B) my_raid_tell(A,B) -#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D) -#define my_lock(A,B,C,D,E) my_raid_lock(A,B,C,D,E) -#define my_fstat(A,B,C) my_raid_fstat(A,B,C) -#endif /* MAP_TO_USE_RAID */ - -#ifdef __cplusplus -extern "C" { -#endif - - void init_raid(void); - void end_raid(void); - - bool is_raid(File fd); - File my_raid_create(const char *FileName, int CreateFlags, int access_flags, - uint raid_type, uint raid_chunks, ulong raid_chunksize, - myf MyFlags); - File my_raid_open(const char *FileName, int Flags, - uint raid_type, uint raid_chunks, ulong raid_chunksize, - myf MyFlags); - int my_raid_rename(const char *from, const char *to, uint raid_chunks, - myf MyFlags); - int my_raid_delete(const char *from, uint raid_chunks, myf MyFlags); - int my_raid_redel(const char *old_name, const char *new_name, - uint raid_chunks, myf MyFlags); - - my_off_t my_raid_seek(File fd, my_off_t pos, int whence, myf MyFlags); - my_off_t my_raid_tell(File fd, myf MyFlags); - - uint my_raid_write(File,const byte *Buffer, uint Count, myf MyFlags); - uint my_raid_read(File Filedes, byte *Buffer, uint Count, myf MyFlags); - - uint my_raid_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, - myf MyFlags); - uint my_raid_pwrite(int Filedes, const byte *Buffer, uint Count, - my_off_t offset, myf MyFlags); - - int my_raid_lock(File,int locktype, my_off_t start, my_off_t length, - myf MyFlags); - int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags); - int my_raid_close(File, myf MyFlags); - int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags); - -#ifdef __cplusplus -} - -#ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ -#endif - -class RaidName { - public: - RaidName(const char *FileName); - ~RaidName(); - bool IsRaid(); - int Rename(const char * from, const char * to, myf MyFlags); - private: - uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */ - uint _raid_chunks; /* 1..n */ - ulong _raid_chunksize; /* 1..n in bytes */ -}; - -class RaidFd { - public: - RaidFd(uint raid_type, uint raid_chunks , ulong raid_chunksize); - ~RaidFd(); - File Create(const char *FileName, int CreateFlags, int access_flags, - myf MyFlags); - File Open(const char *FileName, int Flags, myf MyFlags); - my_off_t Seek(my_off_t pos,int whence,myf MyFlags); - my_off_t Tell(myf MyFlags); - int Write(const byte *Buffer, uint Count, myf MyFlags); - int Read(const byte *Buffer, uint Count, myf MyFlags); - int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags); - int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags); - int Fstat(int fd, MY_STAT *stat_area, myf MyFlags ); - int Close(myf MyFlags); - static bool IsRaid(File fd); - static DYNAMIC_ARRAY _raid_map; /* Map of RaidFD* */ - private: - - uint _raid_type; /* RAID_TYPE_0 or RAID_TYPE_1 or RAID_TYPE_5 */ - uint _raid_chunks; /* 1..n */ - ulong _raid_chunksize; /* 1..n in bytes */ - - ulong _total_block; /* We are operating with block no x (can be 0..many). */ - uint _this_block; /* can be 0.._raid_chunks */ - uint _remaining_bytes; /* Maximum bytes that can be written in this block */ - - my_off_t _position; - my_off_t _size; /* Cached file size for faster seek(SEEK_END) */ - File _fd; - File *_fd_vector; /* Array of File */ - off_t *_seek_vector; /* Array of cached seek positions */ - - inline void Calculate() - { - DBUG_ENTER("RaidFd::_Calculate"); - DBUG_PRINT("info",("_position: %lu _raid_chunksize: %lu _size: %lu", - (ulong) _position, _raid_chunksize, (ulong) _size)); - - _total_block = (ulong) (_position / _raid_chunksize); - _this_block = _total_block % _raid_chunks; /* can be 0.._raid_chunks */ - _remaining_bytes = (uint) (_raid_chunksize - - (_position - _total_block * _raid_chunksize)); - DBUG_PRINT("info", - ("_total_block: %lu this_block: %d _remaining_bytes: %d", - _total_block, _this_block, _remaining_bytes)); - DBUG_VOID_RETURN; - } -}; - -#endif /* __cplusplus */ -#endif /* USE_RAID */ - diff --git a/dep/include/sockets/Base64.h b/dep/include/sockets/Base64.h deleted file mode 100644 index d4323aaa019..00000000000 --- a/dep/include/sockets/Base64.h +++ /dev/null @@ -1,77 +0,0 @@ -/** \file Base64.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Base64_H -#define _SOCKETS_Base64_H - -#include "sockets-config.h" -#ifdef _MSC_VER -#pragma warning(disable:4514) -#endif - -#include -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** \defgroup util Utilities */ - -/** Base64 encode/decode. - \ingroup util */ -class Base64 -{ -public: - Base64(); - - void encode(FILE *, std::string& , bool add_crlf = true); - void encode(const std::string&, std::string& , bool add_crlf = true); - void encode(const char *, size_t, std::string& , bool add_crlf = true); - void encode(const unsigned char *, size_t, std::string& , bool add_crlf = true); - - void decode(const std::string&, std::string& ); - void decode(const std::string&, unsigned char *, size_t&); - - size_t decode_length(const std::string& ); - -private: - Base64(const Base64& ) {} - Base64& operator=(const Base64& ) { return *this; } -static const char *bstr; -static const char rstr[128]; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Base64_H - - diff --git a/dep/include/sockets/Exception.h b/dep/include/sockets/Exception.h deleted file mode 100644 index bb881b2d74f..00000000000 --- a/dep/include/sockets/Exception.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - ** \file Exception.h - ** \date 2007-09-28 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _Sockets_Exception_H -#define _Sockets_Exception_H - -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Exception -{ -public: - Exception(const std::string& description); - virtual ~Exception() {} - - virtual const std::string ToString() const; - - Exception(const Exception& ) {} // copy constructor - - Exception& operator=(const Exception& ) { return *this; } // assignment operator - -private: - std::string m_description; - -}; - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - -#endif // _Sockets_Exception_H - - diff --git a/dep/include/sockets/File.h b/dep/include/sockets/File.h deleted file mode 100644 index ed322efa2d8..00000000000 --- a/dep/include/sockets/File.h +++ /dev/null @@ -1,82 +0,0 @@ -/** \file File.h - ** \date 2005-04-25 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_File_H -#define _SOCKETS_File_H - -#include "sockets-config.h" -#include "IFile.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** IFile implementation of a disk file. - \ingroup file */ -class File : public IFile -{ -public: - File(); - ~File(); - - bool fopen(const std::string&, const std::string&); - void fclose(); - - size_t fread(char *, size_t, size_t) const; - size_t fwrite(const char *, size_t, size_t); - - char *fgets(char *, int) const; - void fprintf(const char *format, ...); - - off_t size() const; - bool eof() const; - - void reset_read() const; - void reset_write(); - -private: - File(const File& ) {} // copy constructor - File& operator=(const File& ) { return *this; } // assignment operator - - std::string m_path; - std::string m_mode; - FILE *m_fil; - mutable long m_rptr; - long m_wptr; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_File_H - - diff --git a/dep/include/sockets/IFile.h b/dep/include/sockets/IFile.h deleted file mode 100644 index 657c8a4b1d9..00000000000 --- a/dep/include/sockets/IFile.h +++ /dev/null @@ -1,71 +0,0 @@ -/** \file IFile.h - ** \date 2005-04-25 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_IFile_H -#define _SOCKETS_IFile_H - -#include "sockets-config.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** \defgroup file File handling */ -/** Pure virtual file I/O interface. - \ingroup file */ -class IFile -{ -public: - virtual ~IFile() {} - - virtual bool fopen(const std::string&, const std::string&) = 0; - virtual void fclose() = 0; - - virtual size_t fread(char *, size_t, size_t) const = 0; - virtual size_t fwrite(const char *, size_t, size_t) = 0; - - virtual char *fgets(char *, int) const = 0; - virtual void fprintf(const char *format, ...) = 0; - - virtual off_t size() const = 0; - virtual bool eof() const = 0; - - virtual void reset_read() const = 0; - virtual void reset_write() = 0; - -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_IFile_H - - diff --git a/dep/include/sockets/ISocketHandler.h b/dep/include/sockets/ISocketHandler.h deleted file mode 100644 index 940783c104b..00000000000 --- a/dep/include/sockets/ISocketHandler.h +++ /dev/null @@ -1,231 +0,0 @@ -/** \file ISocketHandler.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ISocketHandler_H -#define _SOCKETS_ISocketHandler_H -#include "sockets-config.h" - -#include - -#include "socket_include.h" -#include "Socket.h" -#include "StdLog.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -typedef enum { - LIST_CALLONCONNECT = 0, -#ifdef ENABLE_DETACH - LIST_DETACH, -#endif - LIST_TIMEOUT, - LIST_RETRY, - LIST_CLOSE -} list_t; - -class SocketAddress; -class Mutex; - -/** Socket container class, event generator. - \ingroup basic */ -class ISocketHandler -{ - friend class Socket; - -public: - /** Connection pool class for internal use by the ISocketHandler. - \ingroup internal */ -#ifdef ENABLE_POOL - class PoolSocket : public Socket - { - public: - PoolSocket(ISocketHandler& h,Socket *src) : Socket(h) { - CopyConnection( src ); - SetIsClient(); - } - - void OnRead() { - Handler().LogError(this, "OnRead", 0, "data on hibernating socket", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - } - void OnOptions(int,int,int,SOCKET) {} - - }; -#endif - -public: - virtual ~ISocketHandler() {} - - /** Get mutex reference for threadsafe operations. */ - virtual Mutex& GetMutex() const = 0; - - /** Register StdLog object for error callback. - \param log Pointer to log class */ - virtual void RegStdLog(StdLog *log) = 0; - - /** Log error to log class for print out / storage. */ - virtual void LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t = LOG_LEVEL_WARNING) = 0; - - // ------------------------------------------------------------------------- - // Socket stuff - // ------------------------------------------------------------------------- - /** Add socket instance to socket map. Removal is always automatic. */ - virtual void Add(Socket *) = 0; -private: - /** Remove socket from socket map, used by Socket class. */ - virtual void Remove(Socket *) = 0; -public: - /** Get status of read/write/exception file descriptor set for a socket. */ - virtual void Get(SOCKET s,bool& r,bool& w,bool& e) = 0; - /** Set read/write/exception file descriptor sets (fd_set). */ - virtual void Set(SOCKET s,bool bRead,bool bWrite,bool bException = true) = 0; - - /** Wait for events, generate callbacks. */ - virtual int Select(long sec,long usec) = 0; - /** This method will not return until an event has been detected. */ - virtual int Select() = 0; - /** Wait for events, generate callbacks. */ - virtual int Select(struct timeval *tsel) = 0; - - /** Check that a socket really is handled by this socket handler. */ - virtual bool Valid(Socket *) = 0; - /** Return number of sockets handled by this handler. */ - virtual size_t GetCount() = 0; - - /** Override and return false to deny all incoming connections. - \param p ListenSocket class pointer (use GetPort to identify which one) */ - virtual bool OkToAccept(Socket *p) = 0; - - /** Called by Socket when a socket changes state. */ - virtual void AddList(SOCKET s,list_t which_one,bool add) = 0; - - // ------------------------------------------------------------------------- - // Connection pool - // ------------------------------------------------------------------------- -#ifdef ENABLE_POOL - /** Find available open connection (used by connection pool). */ - virtual ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&) = 0; - /** Enable connection pool (by default disabled). */ - virtual void EnablePool(bool = true) = 0; - /** Check pool status. - \return true if connection pool is enabled */ - virtual bool PoolEnabled() = 0; -#endif // ENABLE_POOL - - // ------------------------------------------------------------------------- - // Socks4 - // ------------------------------------------------------------------------- -#ifdef ENABLE_SOCKS4 - /** Set socks4 server ip that all new tcp sockets should use. */ - virtual void SetSocks4Host(ipaddr_t) = 0; - /** Set socks4 server hostname that all new tcp sockets should use. */ - virtual void SetSocks4Host(const std::string& ) = 0; - /** Set socks4 server port number that all new tcp sockets should use. */ - virtual void SetSocks4Port(port_t) = 0; - /** Set optional socks4 userid. */ - virtual void SetSocks4Userid(const std::string& ) = 0; - /** If connection to socks4 server fails, immediately try direct connection to final host. */ - virtual void SetSocks4TryDirect(bool = true) = 0; - /** Get socks4 server ip. - \return socks4 server ip */ - virtual ipaddr_t GetSocks4Host() = 0; - /** Get socks4 port number. - \return socks4 port number */ - virtual port_t GetSocks4Port() = 0; - /** Get socks4 userid (optional). - \return socks4 userid */ - virtual const std::string& GetSocks4Userid() = 0; - /** Check status of socks4 try direct flag. - \return true if direct connection should be tried if connection to socks4 server fails */ - virtual bool Socks4TryDirect() = 0; -#endif // ENABLE_SOCKS4 - - // ------------------------------------------------------------------------- - // DNS resolve server - // ------------------------------------------------------------------------- -#ifdef ENABLE_RESOLVER - /** Enable asynchronous DNS. - \param port Listen port of asynchronous dns server */ - virtual void EnableResolver(port_t = 16667) = 0; - /** Check resolver status. - \return true if resolver is enabled */ - virtual bool ResolverEnabled() = 0; - /** Queue a dns request. - \param host Hostname to be resolved - \param port Port number will be echoed in Socket::OnResolved callback */ - virtual int Resolve(Socket *,const std::string& host,port_t port) = 0; -#ifdef ENABLE_IPV6 - virtual int Resolve6(Socket *,const std::string& host,port_t port) = 0; -#endif - /** Do a reverse dns lookup. */ - virtual int Resolve(Socket *,ipaddr_t a) = 0; -#ifdef ENABLE_IPV6 - virtual int Resolve(Socket *,in6_addr& a) = 0; -#endif - /** Get listen port of asynchronous dns server. */ - virtual port_t GetResolverPort() = 0; - /** Resolver thread ready for queries. */ - virtual bool ResolverReady() = 0; - /** Returns true if socket waiting for a resolve event. */ - virtual bool Resolving(Socket *) = 0; -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_TRIGGERS - /** Fetch unique trigger id. */ - virtual int TriggerID(Socket *src) = 0; - /** Subscribe socket to trigger id. */ - virtual bool Subscribe(int id, Socket *dst) = 0; - /** Unsubscribe socket from trigger id. */ - virtual bool Unsubscribe(int id, Socket *dst) = 0; - /** Execute OnTrigger for subscribed sockets. - \param id Trigger ID - \param data Data passed from source to destination - \param erase Empty trigger id source and destination maps if 'true', - Leave them in place if 'false' - if a trigger should be called many times */ - virtual void Trigger(int id, Socket::TriggerData& data, bool erase = true) = 0; -#endif // ENABLE_TRIGGERS - -#ifdef ENABLE_DETACH - /** Indicates that the handler runs under SocketThread. */ - virtual void SetSlave(bool x = true) = 0; - /** Indicates that the handler runs under SocketThread. */ - virtual bool IsSlave() = 0; -#endif // ENABLE_DETACH - -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_ISocketHandler_H - - diff --git a/dep/include/sockets/Ipv4Address.h b/dep/include/sockets/Ipv4Address.h deleted file mode 100644 index 71d925254e9..00000000000 --- a/dep/include/sockets/Ipv4Address.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - ** \file Ipv4Address.h - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Ipv4Address_H -#define _SOCKETS_Ipv4Address_H - -#include "sockets-config.h" -#include "SocketAddress.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/* Ipv4 address implementation. - \ingroup basic */ -class Ipv4Address : public SocketAddress -{ -public: - /** Create empty Ipv4 address structure. - \param port Port number */ - Ipv4Address(port_t port = 0); - /** Create Ipv4 address structure. - \param a Socket address in network byte order (as returned by Utility::u2ip) - \param port Port number in host byte order */ - Ipv4Address(ipaddr_t a,port_t port); - /** Create Ipv4 address structure. - \param a Socket address in network byte order - \param port Port number in host byte order */ - Ipv4Address(struct in_addr& a,port_t port); - /** Create Ipv4 address structure. - \param host Hostname to be resolved - \param port Port number in host byte order */ - Ipv4Address(const std::string& host,port_t port); - Ipv4Address(struct sockaddr_in&); - ~Ipv4Address(); - - // SocketAddress implementation - - operator struct sockaddr *(); - operator socklen_t(); - bool operator==(SocketAddress&); - - void SetPort(port_t port); - port_t GetPort(); - - void SetAddress(struct sockaddr *sa); - int GetFamily(); - - bool IsValid(); - std::auto_ptr GetCopy(); - - /** Convert address struct to text. */ - std::string Convert(bool include_port = false); - std::string Reverse(); - - /** Resolve hostname. */ -static bool Resolve(const std::string& hostname,struct in_addr& a); - /** Reverse resolve (IP to hostname). */ -static bool Reverse(struct in_addr& a,std::string& name); - /** Convert address struct to text. */ -static std::string Convert(struct in_addr& a); - -private: - Ipv4Address(const Ipv4Address& ) {} // copy constructor - Ipv4Address& operator=(const Ipv4Address& ) { return *this; } // assignment operator - struct sockaddr_in m_addr; - bool m_valid; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // _SOCKETS_Ipv4Address_H - - diff --git a/dep/include/sockets/Ipv6Address.h b/dep/include/sockets/Ipv6Address.h deleted file mode 100644 index 20c68d8c92d..00000000000 --- a/dep/include/sockets/Ipv6Address.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - ** \file Ipv6Address.h - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Ipv6Address_H -#define _SOCKETS_Ipv6Address_H -#include "sockets-config.h" -#ifdef ENABLE_IPV6 - -#include "SocketAddress.h" -#ifdef IPPROTO_IPV6 -#if defined( _WIN32) && !defined(__CYGWIN__) -typedef unsigned __int32 uint32_t; -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Ipv6 address implementation. - \ingroup basic */ -class Ipv6Address : public SocketAddress -{ -public: - /** Create empty Ipv6 address structure. - \param port Port number */ - Ipv6Address(port_t port = 0); - /** Create Ipv6 address structure. - \param a Socket address in network byte order - \param port Port number in host byte order */ - Ipv6Address(struct in6_addr& a,port_t port); - /** Create Ipv6 address structure. - \param host Hostname to be resolved - \param port Port number in host byte order */ - Ipv6Address(const std::string& host,port_t port); - Ipv6Address(struct sockaddr_in6&); - ~Ipv6Address(); - - // SocketAddress implementation - - operator struct sockaddr *(); - operator socklen_t(); - bool operator==(SocketAddress&); - - void SetPort(port_t port); - port_t GetPort(); - - void SetAddress(struct sockaddr *sa); - int GetFamily(); - - bool IsValid(); - std::auto_ptr GetCopy(); - - /** Convert address struct to text. */ - std::string Convert(bool include_port = false); - std::string Reverse(); - - /** Resolve hostname. */ -static bool Resolve(const std::string& hostname,struct in6_addr& a); - /** Reverse resolve (IP to hostname). */ -static bool Reverse(struct in6_addr& a,std::string& name); - /** Convert address struct to text. */ -static std::string Convert(struct in6_addr& a,bool mixed = false); - - void SetFlowinfo(uint32_t); - uint32_t GetFlowinfo(); -#ifndef _WIN32 - void SetScopeId(uint32_t); - uint32_t GetScopeId(); -#endif - -private: - Ipv6Address(const Ipv6Address& ) {} // copy constructor - Ipv6Address& operator=(const Ipv6Address& ) { return *this; } // assignment operator - struct sockaddr_in6 m_addr; - bool m_valid; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // IPPROTO_IPV6 -#endif // ENABLE_IPV6 -#endif // _SOCKETS_Ipv6Address_H - - diff --git a/dep/include/sockets/ListenSocket.h b/dep/include/sockets/ListenSocket.h deleted file mode 100644 index 8934a809d0e..00000000000 --- a/dep/include/sockets/ListenSocket.h +++ /dev/null @@ -1,418 +0,0 @@ -/** \file ListenSocket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ListenSocket_H -#define _SOCKETS_ListenSocket_H -#include "sockets-config.h" - -#ifdef _WIN32 -#include -#else -#include -#endif - -#include "ISocketHandler.h" -#include "Socket.h" -#include "Utility.h" -#include "SctpSocket.h" -#include "Ipv4Address.h" -#include "Ipv6Address.h" -#ifdef ENABLE_EXCEPTIONS -#include "Exception.h" -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Binds incoming port number to new Socket class X. - \ingroup basic */ -template -class ListenSocket : public Socket -{ -public: - /** Constructor. - \param h ISocketHandler reference - \param use_creator Optional use of creator (default true) */ - ListenSocket(ISocketHandler& h,bool use_creator = true) : Socket(h), m_depth(0), m_creator(NULL) - ,m_bHasCreate(false) - { - if (use_creator) - { - m_creator = new X(h); - Socket *tmp = m_creator -> Create(); - if (tmp && dynamic_cast(tmp)) - { - m_bHasCreate = true; - } - if (tmp) - { - delete tmp; - } - } - } - ~ListenSocket() { - if (m_creator) - { - delete m_creator; - } - } - - /** Close file descriptor. */ - int Close() { - if (GetSocket() != INVALID_SOCKET) - { - closesocket(GetSocket()); - } - return 0; - } - - /** Bind and listen to any interface. - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(port_t port,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(port); - return Bind(ad, depth); - } - else -#endif -#endif - { - Ipv4Address ad(port); - return Bind(ad, depth); - } - } - - int Bind(SocketAddress& ad,int depth) { -#ifdef USE_SCTP - if (dynamic_cast(m_creator)) - { - return Bind(ad, "sctp", depth); - } -#endif - return Bind(ad, "tcp", depth); - } - - /** Bind and listen to any interface, with optional protocol. - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(port_t port,const std::string& protocol,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(port); - return Bind(ad, protocol, depth); - } - else -#endif -#endif - { - Ipv4Address ad(port); - return Bind(ad, protocol, depth); - } - } - - /** Bind and listen to specific interface. - \param intf Interface hostname - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(const std::string& intf,port_t port,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - else -#endif -#endif - { - Ipv4Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - } - - /** Bind and listen to specific interface. - \param intf Interface hostname - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(const std::string& intf,port_t port,const std::string& protocol,int depth = 20) { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, protocol, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - else -#endif -#endif - { - Ipv4Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, protocol, depth); - } - Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL); - return -1; - } - } - - /** Bind and listen to ipv4 interface. - \param a Ipv4 interface address - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(ipaddr_t a,port_t port,int depth = 20) { - Ipv4Address ad(a, port); -#ifdef USE_SCTP - if (dynamic_cast(m_creator)) - { - return Bind(ad, "sctp", depth); - } -#endif - return Bind(ad, "tcp", depth); - } - /** Bind and listen to ipv4 interface. - \param a Ipv4 interface address - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(ipaddr_t a,port_t port,const std::string& protocol,int depth) { - Ipv4Address ad(a, port); - return Bind(ad, protocol, depth); - } - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Bind and listen to ipv6 interface. - \param a Ipv6 interface address - \param port Port (0 is random) - \param depth Listen queue depth */ - int Bind(in6_addr a,port_t port,int depth = 20) { - Ipv6Address ad(a, port); -#ifdef USE_SCTP - if (dynamic_cast(m_creator)) - { - return Bind(ad, "sctp", depth); - } -#endif - return Bind(ad, "tcp", depth); - } - /** Bind and listen to ipv6 interface. - \param a Ipv6 interface address - \param port Port (0 is random) - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(in6_addr a,port_t port,const std::string& protocol,int depth) { - Ipv6Address ad(a, port); - return Bind(ad, protocol, depth); - } -#endif -#endif - - /** Bind and listen to network interface. - \param ad Interface address - \param protocol Network protocol - \param depth Listen queue depth */ - int Bind(SocketAddress& ad,const std::string& protocol,int depth) { - SOCKET s; - if ( (s = CreateSocket(ad.GetFamily(), SOCK_STREAM, protocol)) == INVALID_SOCKET) - { - return -1; - } - if (bind(s, ad, ad) == -1) - { - Handler().LogError(this, "bind", Errno, StrError(Errno), LOG_LEVEL_FATAL); - closesocket(s); -#ifdef ENABLE_EXCEPTIONS - throw Exception("bind() failed for port " + Utility::l2string(ad.GetPort()) + ": " + StrError(Errno)); -#endif - return -1; - } - if (listen(s, depth) == -1) - { - Handler().LogError(this, "listen", Errno, StrError(Errno), LOG_LEVEL_FATAL); - closesocket(s); -#ifdef ENABLE_EXCEPTIONS - throw Exception("listen() failed for port " + Utility::l2string(ad.GetPort()) + ": " + StrError(Errno)); -#endif - return -1; - } - m_depth = depth; - Attach(s); - return 0; - } - - /** Return assigned port number. */ - port_t GetPort() - { - return GetSockPort(); - } - - /** Return listen queue depth. */ - int GetDepth() - { - return m_depth; - } - - /** OnRead on a ListenSocket receives an incoming connection. */ - void OnRead() - { - struct sockaddr sa; - socklen_t sa_len = sizeof(struct sockaddr); - SOCKET a_s = accept(GetSocket(), &sa, &sa_len); - - if (a_s == INVALID_SOCKET) - { - Handler().LogError(this, "accept", Errno, StrError(Errno), LOG_LEVEL_ERROR); - return; - } - if (!Handler().OkToAccept(this)) - { - Handler().LogError(this, "accept", -1, "Not OK to accept", LOG_LEVEL_WARNING); - closesocket(a_s); - return; - } - if (Handler().GetCount() >= FD_SETSIZE) - { - Handler().LogError(this, "accept", (int)Handler().GetCount(), "ISocketHandler fd_set limit reached", LOG_LEVEL_FATAL); - closesocket(a_s); - return; - } - Socket *tmp = m_bHasCreate ? m_creator -> Create() : new X(Handler()); -#ifdef ENABLE_IPV6 - tmp -> SetIpv6( IsIpv6() ); -#endif - tmp -> SetParent(this); - tmp -> Attach(a_s); - tmp -> SetNonblocking(true); - { -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (sa_len == sizeof(struct sockaddr_in6)) - { - struct sockaddr_in6 *p = (struct sockaddr_in6 *)&sa; - if (p -> sin6_family == AF_INET6) - { - Ipv6Address ad(p -> sin6_addr,ntohs(p -> sin6_port)); - ad.SetFlowinfo(p -> sin6_flowinfo); -#ifndef _WIN32 - ad.SetScopeId(p -> sin6_scope_id); -#endif - tmp -> SetRemoteAddress(ad); - } - } -#endif -#endif - if (sa_len == sizeof(struct sockaddr_in)) - { - struct sockaddr_in *p = (struct sockaddr_in *)&sa; - if (p -> sin_family == AF_INET) - { - Ipv4Address ad(p -> sin_addr,ntohs(p -> sin_port)); - tmp -> SetRemoteAddress(ad); - } - } - } - tmp -> SetConnected(true); - tmp -> Init(); - tmp -> SetDeleteByHandler(true); - Handler().Add(tmp); -#ifdef HAVE_OPENSSL - if (tmp -> IsSSL()) // SSL Enabled socket - { - // %! OnSSLAccept calls SSLNegotiate that can finish in this one call. - // %! If that happens and negotiation fails, the 'tmp' instance is - // %! still added to the list of active sockets in the sockethandler. - // %! See bugfix for this in SocketHandler::Select - don't Set rwx - // %! flags if CloseAndDelete() flag is true. - // %! An even better fugbix (see TcpSocket::OnSSLAccept) now avoids - // %! the Add problem altogether, so ignore the above. - // %! (OnSSLAccept does no longer call SSLNegotiate().) - tmp -> OnSSLAccept(); - } - else -#endif - { - tmp -> OnAccept(); - } - } - - /** Please don't use this method. - "accept()" is handled automatically in the OnRead() method. */ - virtual SOCKET Accept(SOCKET socket, struct sockaddr *saptr, socklen_t *lenptr) - { - return accept(socket, saptr, lenptr); - } - - bool HasCreator() { return m_bHasCreate; } - - void OnOptions(int,int,int,SOCKET) { - SetSoReuseaddr(true); - } - -protected: - ListenSocket(const ListenSocket& s) : Socket(s) {} -private: - ListenSocket& operator=(const ListenSocket& ) { return *this; } - int m_depth; - X *m_creator; - bool m_bHasCreate; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_ListenSocket_H - - diff --git a/dep/include/sockets/Lock.h b/dep/include/sockets/Lock.h deleted file mode 100644 index f3bb9273920..00000000000 --- a/dep/include/sockets/Lock.h +++ /dev/null @@ -1,58 +0,0 @@ -/** \file Lock.h - ** \date 2005-08-22 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2005,2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Lock_H -#define _SOCKETS_Lock_H - -#include "sockets-config.h" -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Mutex; - -/** Mutex encapsulation class. - \ingroup threading */ -class Lock -{ -public: - Lock(Mutex&); - ~Lock(); - -private: - Mutex& m_mutex; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif -#endif // _SOCKETS_Lock_H - - diff --git a/dep/include/sockets/Mutex.h b/dep/include/sockets/Mutex.h deleted file mode 100644 index e42a57c3262..00000000000 --- a/dep/include/sockets/Mutex.h +++ /dev/null @@ -1,68 +0,0 @@ -/** \file Mutex.h - ** \date 2004-10-30 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Mutex_H -#define _SOCKETS_Mutex_H - -#include "sockets-config.h" -#ifndef _WIN32 -#include -#else -#include -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Mutex container class, used by Lock. - \ingroup threading */ -class Mutex -{ - friend class Lock; -public: - Mutex(); - ~Mutex(); - - void Lock(); - void Unlock(); -private: -#ifdef _WIN32 - HANDLE m_mutex; -#else - pthread_mutex_t m_mutex; -#endif -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif -#endif // _SOCKETS_Mutex_H - - diff --git a/dep/include/sockets/Parse.h b/dep/include/sockets/Parse.h deleted file mode 100644 index 52bd9327e28..00000000000 --- a/dep/include/sockets/Parse.h +++ /dev/null @@ -1,100 +0,0 @@ -/** \file Parse.h - parse a string - ** - ** Written: 1999-Feb-10 grymse@alhem.net - **/ - -/* -Copyright (C) 1999-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _SOCKETS_Parse_H -#define _SOCKETS_Parse_H - -#include "sockets-config.h" -#ifdef _MSC_VER -#pragma warning(disable:4514) -#endif - -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/***************************************************/ -/* interface of class Parse */ - -/** Splits a string whatever way you want. - \ingroup util */ -class Parse -{ -public: - Parse(); - Parse(const std::string&); - Parse(const std::string&,const std::string&); - Parse(const std::string&,const std::string&,short); - ~Parse(); - short issplit(const char); - void getsplit(); - void getsplit(std::string&); - std::string getword(); - void getword(std::string&); - void getword(std::string&,std::string&,int); - std::string getrest(); - void getrest(std::string&); - long getvalue(); - void setbreak(const char); - int getwordlen(); - int getrestlen(); - void enablebreak(const char c) { - pa_enable = c; - } - void disablebreak(const char c) { - pa_disable = c; - } - void getline(); - void getline(std::string&); - size_t getptr() { return pa_the_ptr; } - void EnableQuote(bool b) { pa_quote = b; } - -private: - std::string pa_the_str; - std::string pa_splits; - std::string pa_ord; - size_t pa_the_ptr; - char pa_breakchar; - char pa_enable; - char pa_disable; - short pa_nospace; - bool pa_quote; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Parse_H - - diff --git a/dep/include/sockets/ResolvServer.h b/dep/include/sockets/ResolvServer.h deleted file mode 100644 index 409c9b7a619..00000000000 --- a/dep/include/sockets/ResolvServer.h +++ /dev/null @@ -1,72 +0,0 @@ -/** \file ResolvServer.h - ** \date 2005-03-24 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ResolvServer_H -#define _SOCKETS_ResolvServer_H -#include "sockets-config.h" -#ifdef ENABLE_RESOLVER -#include "socket_include.h" -#include "Thread.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** \defgroup async Asynchronous DNS */ -/** Async DNS resolver thread. - \ingroup async */ -class ResolvServer : public Thread -{ -public: - ResolvServer(port_t); - ~ResolvServer(); - - void Run(); - void Quit(); - - bool Ready(); - -private: - ResolvServer(const ResolvServer& ) {} // copy constructor - ResolvServer& operator=(const ResolvServer& ) { return *this; } // assignment operator - - bool m_quit; - port_t m_port; - bool m_ready; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // ENABLE_RESOLVER -#endif // _SOCKETS_ResolvServer_H - - diff --git a/dep/include/sockets/ResolvSocket.h b/dep/include/sockets/ResolvSocket.h deleted file mode 100644 index 60743736e08..00000000000 --- a/dep/include/sockets/ResolvSocket.h +++ /dev/null @@ -1,105 +0,0 @@ -/** \file ResolvSocket.h - ** \date 2005-03-24 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_ResolvSocket_H -#define _SOCKETS_ResolvSocket_H -#include "sockets-config.h" -#ifdef ENABLE_RESOLVER -#include "TcpSocket.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Mutex; - -/** Async DNS resolver socket. - \ingroup async */ -class ResolvSocket : public TcpSocket -{ - typedef std::map > cache_t; /* host, result */ - typedef std::map > timeout_t; /* host, time */ - -public: - ResolvSocket(ISocketHandler&); - ResolvSocket(ISocketHandler&, Socket *parent, const std::string& host, port_t port, bool ipv6 = false); - ResolvSocket(ISocketHandler&, Socket *parent, ipaddr_t); -#ifdef ENABLE_IPV6 - ResolvSocket(ISocketHandler&, Socket *parent, in6_addr&); -#endif - ~ResolvSocket(); - - void OnAccept() { m_bServer = true; } - void OnLine(const std::string& line); - void OnDetached(); - void OnDelete(); - - void SetId(int x) { m_resolv_id = x; } - int GetId() { return m_resolv_id; } - - void OnConnect(); - -#ifdef ENABLE_IPV6 - void SetResolveIpv6(bool x = true) { m_resolve_ipv6 = x; } -#endif - -private: - ResolvSocket(const ResolvSocket& s) : TcpSocket(s) {} // copy constructor - ResolvSocket& operator=(const ResolvSocket& ) { return *this; } // assignment operator - - std::string m_query; - std::string m_data; - bool m_bServer; - Socket *m_parent; - int m_resolv_id; - std::string m_resolv_host; - port_t m_resolv_port; - ipaddr_t m_resolv_address; -#ifdef ENABLE_IPV6 - bool m_resolve_ipv6; - in6_addr m_resolv_address6; -#endif - static cache_t m_cache; - static timeout_t m_cache_to; - static Mutex m_cache_mutex; - bool m_cached; -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // ENABLE_RESOLVER -#endif // _SOCKETS_ResolvSocket_H - - diff --git a/dep/include/sockets/SctpSocket.h b/dep/include/sockets/SctpSocket.h deleted file mode 100644 index ed507fb1880..00000000000 --- a/dep/include/sockets/SctpSocket.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - ** \file SctpSocket.h - ** \date 2006-09-04 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_SctpSocket_H -#define _SOCKETS_SctpSocket_H -#include "sockets-config.h" - -#include "StreamSocket.h" -#ifdef USE_SCTP -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -#define SCTP_BUFSIZE_READ 16400 - -class SocketAddress; - -class SctpSocket : public StreamSocket -{ -public: - /** SctpSocket constructor. - \param h Owner - \param type SCTP_STREAM or SCTP_SEQPACKET */ - SctpSocket(ISocketHandler& h,int type); - ~SctpSocket(); - - /** bind() */ - int Bind(const std::string&,port_t); - int Bind(SocketAddress&); - /** sctp_bindx() */ - int AddAddress(const std::string&,port_t); - int AddAddress(SocketAddress&); - /** sctp_bindx() */ - int RemoveAddress(const std::string&,port_t); - int RemoveAddress(SocketAddress&); - - /** connect() */ - int Open(const std::string&,port_t); - int Open(SocketAddress&); - - /** Connect timeout callback. */ - void OnConnectTimeout(); -#ifdef _WIN32 - /** Connection failed reported as exception on win32 */ - void OnException(); -#endif - -#ifndef SOLARIS - /** sctp_connectx() */ - int AddConnection(const std::string&,port_t); - int AddConnection(SocketAddress&); -#endif - - /** Get peer addresses of an association. */ - int getpaddrs(sctp_assoc_t id,std::list&); - /** Get all bound addresses of an association. */ - int getladdrs(sctp_assoc_t id,std::list&); - - /** sctp_peeloff */ - int PeelOff(sctp_assoc_t id); - - /** recvmsg callback */ - virtual void OnReceiveMessage(const char *buf,size_t sz,struct sockaddr *sa,socklen_t sa_len,struct sctp_sndrcvinfo *sinfo,int msg_flags) = 0; - - void OnOptions(int,int,int,SOCKET) {} - - virtual int Protocol(); - -protected: - SctpSocket(const SctpSocket& s) : StreamSocket(s) {} - void OnRead(); - void OnWrite(); - -private: - SctpSocket& operator=(const SctpSocket& s) { return *this; } - int m_type; ///< SCTP_STREAM or SCTP_SEQPACKET - char *m_buf; ///< Temporary receive buffer -}; - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE -#endif - -#endif // USE_SCTP -#endif // _SOCKETS_SctpSocket_H - - diff --git a/dep/include/sockets/Socket.h b/dep/include/sockets/Socket.h deleted file mode 100644 index 23a806b5ea1..00000000000 --- a/dep/include/sockets/Socket.h +++ /dev/null @@ -1,735 +0,0 @@ -/** \file Socket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This software is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Socket_H -#define _SOCKETS_Socket_H -#include "sockets-config.h" - -#include -#include -#include -#ifdef HAVE_OPENSSL -#include -#endif - -#include "socket_include.h" -#include -#include "SocketAddress.h" -#include "Thread.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class ISocketHandler; -class SocketAddress; -class IFile; - -/** \defgroup basic Basic sockets */ -/** Socket base class. - \ingroup basic */ -class Socket -{ - friend class ISocketHandler; -#ifdef ENABLE_DETACH - /** Detached socket run thread. - \ingroup internal */ - class SocketThread : public Thread - { - public: - SocketThread(Socket *p); - ~SocketThread(); - - void Run(); - - private: - Socket *GetSocket() const { return m_socket; } - SocketThread(const SocketThread& s) : m_socket(s.GetSocket()) {} - SocketThread& operator=(const SocketThread& ) { return *this; } - Socket *m_socket; - }; -#endif // ENABLE_DETACH - -#ifdef ENABLE_TRIGGERS -public: - /** Data pass class from source to destination. */ - class TriggerData - { - public: - TriggerData() : m_src(NULL) {} - virtual ~TriggerData() {} - - Socket *GetSource() const { return m_src; } - void SetSource(Socket *x) { m_src = x; } - - private: - Socket *m_src; - }; -#endif // ENABLE_TRIGGERS - - /** Socket mode flags. */ -/* - enum { - // Socket - SOCK_DEL = 0x01, ///< Delete by handler flag - SOCK_CLOSE = 0x02, ///< Close and delete flag - SOCK_DISABLE_READ = 0x04, ///< Disable checking for read events - SOCK_CONNECTED = 0x08, ///< Socket is connected (tcp/udp) - - SOCK_ERASED_BY_HANDLER = 0x10, ///< Set by handler before delete - // HAVE_OPENSSL - SOCK_ENABLE_SSL = 0x20, ///< Enable SSL for this TcpSocket - SOCK_SSL = 0x40, ///< ssl negotiation mode (TcpSocket) - SOCK_SSL_SERVER = 0x80, ///< True if this is an incoming ssl TcpSocket connection - - // ENABLE_IPV6 - SOCK_IPV6 = 0x0100, ///< This is an ipv6 socket if this one is true - // ENABLE_POOL - SOCK_CLIENT = 0x0200, ///< only client connections are pooled - SOCK_RETAIN = 0x0400, ///< keep connection on close - SOCK_LOST = 0x0800, ///< connection lost - - // ENABLE_SOCKS4 - SOCK_SOCKS4 = 0x1000, ///< socks4 negotiation mode (TcpSocket) - // ENABLE_DETACH - SOCK_DETACH = 0x2000, ///< Socket ordered to detach flag - SOCK_DETACHED = 0x4000, ///< Socket has been detached - // StreamSocket - STREAMSOCK_CONNECTING = 0x8000, ///< Flag indicating connection in progress - - STREAMSOCK_FLUSH_BEFORE_CLOSE = 0x010000L, ///< Send all data before closing (default true) - STREAMSOCK_CALL_ON_CONNECT = 0x020000L, ///< OnConnect will be called next ISocketHandler cycle if true - STREAMSOCK_RETRY_CONNECT = 0x040000L, ///< Try another connection attempt next ISocketHandler cycle - STREAMSOCK_LINE_PROTOCOL = 0x080000L, ///< Line protocol mode flag - - }; -*/ - -public: - /** "Default" constructor */ - Socket(ISocketHandler&); - - virtual ~Socket(); - - /** Socket class instantiation method. Used when a "non-standard" constructor - * needs to be used for the socket class. Note: the socket class still needs - * the "default" constructor with one ISocketHandler& as input parameter. - */ - virtual Socket *Create() { return NULL; } - - /** Returns reference to sockethandler that owns the socket. - If the socket is detached, this is a reference to the slave sockethandler. - */ - ISocketHandler& Handler() const; - - /** Returns reference to sockethandler that owns the socket. - This one always returns the reference to the original sockethandler, - even if the socket is detached. - */ - ISocketHandler& MasterHandler() const; - - /** Called by ListenSocket after accept but before socket is added to handler. - * CTcpSocket uses this to create its ICrypt member variable. - * The ICrypt member variable is created by a virtual method, therefore - * it can't be called directly from the CTcpSocket constructor. - * Also used to determine if incoming HTTP connection is normal (port 80) - * or ssl (port 443). - */ - virtual void Init(); - - /** Create a socket file descriptor. - \param af Address family AF_INET / AF_INET6 / ... - \param type SOCK_STREAM / SOCK_DGRAM / ... - \param protocol "tcp" / "udp" / ... */ - SOCKET CreateSocket(int af,int type,const std::string& protocol = ""); - - /** Assign this socket a file descriptor created - by a call to socket() or otherwise. */ - void Attach(SOCKET s); - - /** Return file descriptor assigned to this socket. */ - SOCKET GetSocket(); - - /** Close connection immediately - internal use. - \sa SetCloseAndDelete */ - virtual int Close(); - - /** Add file descriptor to sockethandler fd_set's. */ - void Set(bool bRead,bool bWrite,bool bException = true); - - /** Returns true when socket file descriptor is valid - and socket is not about to be closed. */ - virtual bool Ready(); - - /** Returns pointer to ListenSocket that created this instance - * on an incoming connection. */ - Socket *GetParent(); - - /** Used by ListenSocket to set parent pointer of newly created - * socket instance. */ - void SetParent(Socket *); - - /** Get listening port from ListenSocket<>. */ - virtual port_t GetPort(); - - /** Set socket non-block operation. */ - bool SetNonblocking(bool); - - /** Set socket non-block operation. */ - bool SetNonblocking(bool, SOCKET); - - /** Total lifetime of instance. */ - time_t Uptime(); - - /** Set address/port of last connect() call. */ - void SetClientRemoteAddress(SocketAddress&); - - /** Get address/port of last connect() call. */ - std::auto_ptr GetClientRemoteAddress(); - - /** Common interface for SendBuf used by Tcp and Udp sockets. */ - virtual void SendBuf(const char *,size_t,int = 0); - - /** Common interface for Send used by Tcp and Udp sockets. */ - virtual void Send(const std::string&,int = 0); - - /** Outgoing traffic counter. */ - virtual uint64_t GetBytesSent(bool clear = false); - - /** Incoming traffic counter. */ - virtual uint64_t GetBytesReceived(bool clear = false); - - // LIST_TIMEOUT - - /** Enable timeout control. 0=disable timeout check. */ - void SetTimeout(time_t secs); - - /** Check timeout. \return true if time limit reached */ - bool Timeout(time_t tnow); - - /** Used by ListenSocket. ipv4 and ipv6 */ - void SetRemoteAddress(SocketAddress&); - - /** \name Event callbacks */ - //@{ - - /** Called when there is something to be read from the file descriptor. */ - virtual void OnRead(); - /** Called when there is room for another write on the file descriptor. */ - virtual void OnWrite(); - /** Called on socket exception. */ - virtual void OnException(); - /** Called before a socket class is deleted by the ISocketHandler. */ - virtual void OnDelete(); - /** Called when a connection has completed. */ - virtual void OnConnect(); - /** Called when an incoming connection has been completed. */ - virtual void OnAccept(); - /** Called when a complete line has been read and the socket is in - * line protocol mode. */ - virtual void OnLine(const std::string& ); - /** Called on connect timeout (5s). */ - virtual void OnConnectFailed(); - /** Called when a client socket is created, to set socket options. - \param family AF_INET, AF_INET6, etc - \param type SOCK_STREAM, SOCK_DGRAM, etc - \param protocol Protocol number (tcp, udp, sctp, etc) - \param s Socket file descriptor - */ - virtual void OnOptions(int family,int type,int protocol,SOCKET s) = 0; - /** Connection retry callback - return false to abort connection attempts */ - virtual bool OnConnectRetry(); -#ifdef ENABLE_RECONNECT - /** a reconnect has been made */ - virtual void OnReconnect(); -#endif - /** TcpSocket: When a disconnect has been detected (recv/SSL_read returns 0 bytes). */ - virtual void OnDisconnect(); - /** Timeout callback. */ - virtual void OnTimeout(); - /** Connection timeout. */ - virtual void OnConnectTimeout(); - //@} - - /** \name Socket mode flags, set/reset */ - //@{ - /** Set delete by handler true when you want the sockethandler to - delete the socket instance after use. */ - void SetDeleteByHandler(bool = true); - /** Check delete by handler flag. - \return true if this instance should be deleted by the sockethandler */ - bool DeleteByHandler(); - - // LIST_CLOSE - conditional event queue - - /** Set close and delete to terminate the connection. */ - void SetCloseAndDelete(bool = true); - /** Check close and delete flag. - \return true if this socket should be closed and the instance removed */ - bool CloseAndDelete(); - - /** Return number of seconds since socket was ordered to close. \sa SetCloseAndDelete */ - time_t TimeSinceClose(); - - /** Ignore read events for an output only socket. */ - void DisableRead(bool x = true); - /** Check ignore read events flag. - \return true if read events should be ignored */ - bool IsDisableRead(); - - /** Set connected status. */ - void SetConnected(bool = true); - /** Check connected status. - \return true if connected */ - bool IsConnected(); - - /** Connection lost - error while reading/writing from a socket - TcpSocket only. */ - void SetLost(); - /** Check connection lost status flag, used by TcpSocket only. - \return true if there was an error while r/w causing the socket to close */ - bool Lost(); - - /** Set flag indicating the socket is being actively deleted by the sockethandler. */ - void SetErasedByHandler(bool x = true); - /** Get value of flag indicating socket is deleted by sockethandler. */ - bool ErasedByHandler(); - - //@} - - /** \name Information about remote connection */ - //@{ - /** Returns address of remote end. */ - std::auto_ptr GetRemoteSocketAddress(); - /** Returns address of remote end: ipv4. */ - ipaddr_t GetRemoteIP4(); -#ifdef ENABLE_IPV6 - /** Returns address of remote end: ipv6. */ -#ifdef IPPROTO_IPV6 - struct in6_addr GetRemoteIP6(); -#endif -#endif - /** Returns remote port number: ipv4 and ipv6. */ - port_t GetRemotePort(); - /** Returns remote ip as string? ipv4 and ipv6. */ - std::string GetRemoteAddress(); - /** ipv4 and ipv6(not implemented) */ - std::string GetRemoteHostname(); - //@} - - /** Returns local port number for bound socket file descriptor. */ - port_t GetSockPort(); - /** Returns local ipv4 address for bound socket file descriptor. */ - ipaddr_t GetSockIP4(); - /** Returns local ipv4 address as text for bound socket file descriptor. */ - std::string GetSockAddress(); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Returns local ipv6 address for bound socket file descriptor. */ - struct in6_addr GetSockIP6(); - /** Returns local ipv6 address as text for bound socket file descriptor. */ - std::string GetSockAddress6(); -#endif -#endif - // -------------------------------------------------------------------------- - /** @name IP options - When an ip or socket option is available on all of the operating systems - I'm testing on (linux 2.4.x, _win32, macosx, solaris9 intel) they are not - checked with an #ifdef below. - This might cause a compile error on other operating systems. */ - // -------------------------------------------------------------------------- - - // IP options - //@{ - - bool SetIpOptions(const void *p, socklen_t len); - bool SetIpTOS(unsigned char tos); - unsigned char IpTOS(); - bool SetIpTTL(int ttl); - int IpTTL(); - bool SetIpHdrincl(bool x = true); - bool SetIpMulticastTTL(int); - int IpMulticastTTL(); - bool SetMulticastLoop(bool x = true); - bool IpAddMembership(struct ip_mreq&); - bool IpDropMembership(struct ip_mreq&); - -#ifdef IP_PKTINFO - bool SetIpPktinfo(bool x = true); -#endif -#ifdef IP_RECVTOS - bool SetIpRecvTOS(bool x = true); -#endif -#ifdef IP_RECVTTL - bool SetIpRecvTTL(bool x = true); -#endif -#ifdef IP_RECVOPTS - bool SetIpRecvopts(bool x = true); -#endif -#ifdef IP_RETOPTS - bool SetIpRetopts(bool x = true); -#endif -#ifdef IP_RECVERR - bool SetIpRecverr(bool x = true); -#endif -#ifdef IP_MTU_DISCOVER - bool SetIpMtudiscover(bool x = true); -#endif -#ifdef IP_MTU - int IpMtu(); -#endif -#ifdef IP_ROUTER_ALERT - bool SetIpRouterAlert(bool x = true); -#endif -#ifdef LINUX - bool IpAddMembership(struct ip_mreqn&); -#endif -#ifdef LINUX - bool IpDropMembership(struct ip_mreqn&); -#endif - //@} - - // SOCKET options - /** @name Socket Options */ - //@{ - - bool SoAcceptconn(); - bool SetSoBroadcast(bool x = true); - bool SetSoDebug(bool x = true); - int SoError(); - bool SetSoDontroute(bool x = true); - bool SetSoLinger(int onoff, int linger); - bool SetSoOobinline(bool x = true); - bool SetSoRcvlowat(int); - bool SetSoSndlowat(int); - bool SetSoRcvtimeo(struct timeval&); - bool SetSoSndtimeo(struct timeval&); - bool SetSoRcvbuf(int); - int SoRcvbuf(); - bool SetSoSndbuf(int); - int SoSndbuf(); - int SoType(); - bool SetSoReuseaddr(bool x = true); - bool SetSoKeepalive(bool x = true); - -#ifdef SO_BSDCOMPAT - bool SetSoBsdcompat(bool x = true); -#endif -#ifdef SO_BINDTODEVICE - bool SetSoBindtodevice(const std::string& intf); -#endif -#ifdef SO_PASSCRED - bool SetSoPasscred(bool x = true); -#endif -#ifdef SO_PEERCRED - bool SoPeercred(struct ucred& ); -#endif -#ifdef SO_PRIORITY - bool SetSoPriority(int); -#endif -#ifdef SO_RCVBUFFORCE - bool SetSoRcvbufforce(int); -#endif -#ifdef SO_SNDBUFFORCE - bool SetSoSndbufforce(int); -#endif -#ifdef SO_TIMESTAMP - bool SetSoTimestamp(bool x = true); -#endif -#ifdef SO_NOSIGPIPE - bool SetSoNosigpipe(bool x = true); -#endif - //@} - - // TCP options in TcpSocket.h/TcpSocket.cpp - -#ifdef HAVE_OPENSSL - /** @name SSL Support */ - //@{ - /** SSL client/server support - internal use. \sa TcpSocket */ - virtual void OnSSLConnect(); - /** SSL client/server support - internal use. \sa TcpSocket */ - virtual void OnSSLAccept(); - /** SSL negotiation failed for client connect. */ - virtual void OnSSLConnectFailed(); - /** SSL negotiation failed for server accept. */ - virtual void OnSSLAcceptFailed(); - /** new SSL support */ - virtual bool SSLNegotiate(); - /** Check if SSL is Enabled for this TcpSocket. - \return true if this is a TcpSocket with SSL enabled */ - bool IsSSL(); - /** Enable SSL operation for a TcpSocket. */ - void EnableSSL(bool x = true); - /** Still negotiating ssl connection. - \return true if ssl negotiating is still in progress */ - bool IsSSLNegotiate(); - /** Set flag indicating ssl handshaking still in progress. */ - void SetSSLNegotiate(bool x = true); - /** OnAccept called with SSL Enabled. - \return true if this is a TcpSocket with an incoming SSL connection */ - bool IsSSLServer(); - /** Set flag indicating that this is a TcpSocket with incoming SSL connection. */ - void SetSSLServer(bool x = true); - /** SSL; Get pointer to ssl context structure. */ - virtual SSL_CTX *GetSslContext() { return NULL; } - /** SSL; Get pointer to ssl structure. */ - virtual SSL *GetSsl() { return NULL; } - //@} -#endif // HAVE_OPENSSL - -#ifdef ENABLE_IPV6 - /** Enable ipv6 for this socket. */ - void SetIpv6(bool x = true); - /** Check ipv6 socket. - \return true if this is an ipv6 socket */ - bool IsIpv6(); -#endif - -#ifdef ENABLE_POOL - /** @name Connection Pool */ - //@{ - /** Client = connecting TcpSocket. */ - void SetIsClient(); - /** Socket type from socket() call. */ - void SetSocketType(int x); - /** Socket type from socket() call. */ - int GetSocketType(); - /** Protocol type from socket() call. */ - void SetSocketProtocol(const std::string& x); - /** Protocol type from socket() call. */ - const std::string& GetSocketProtocol(); - /** Instruct a client socket to stay open in the connection pool after use. - If you have connected to a server using tcp, you can call SetRetain - to leave the connection open after your socket instance has been deleted. - The next connection you make to the same server will reuse the already - opened connection, if it is still available. - */ - void SetRetain(); - /** Check retain flag. - \return true if the socket should be moved to connection pool after use */ - bool Retain(); - /** Copy connection parameters from sock. */ - void CopyConnection(Socket *sock); - //@} -#endif // ENABLE_POOL - -#ifdef ENABLE_SOCKS4 - /** \name Socks4 support */ - //@{ - /** Socks4 client support internal use. \sa TcpSocket */ - virtual void OnSocks4Connect(); - /** Socks4 client support internal use. \sa TcpSocket */ - virtual void OnSocks4ConnectFailed(); - /** Socks4 client support internal use. \sa TcpSocket */ - virtual bool OnSocks4Read(); - /** Called when the last write caused the tcp output buffer to - * become empty. */ - /** socket still in socks4 negotiation mode */ - bool Socks4(); - /** Set flag indicating Socks4 handshaking in progress */ - void SetSocks4(bool x = true); - - /** Set socks4 server host address to use */ - void SetSocks4Host(ipaddr_t a); - /** Set socks4 server hostname to use. */ - void SetSocks4Host(const std::string& ); - /** Socks4 server port to use. */ - void SetSocks4Port(port_t p); - /** Provide a socks4 userid if required by the socks4 server. */ - void SetSocks4Userid(const std::string& x); - /** Get the ip address of socks4 server to use. - \return socks4 server host address */ - ipaddr_t GetSocks4Host(); - /** Get the socks4 server port to use. - \return socks4 server port */ - port_t GetSocks4Port(); - /** Get socks4 userid. - \return Socks4 userid */ - const std::string& GetSocks4Userid(); - //@} -#endif // ENABLE_SOCKS4 - -#ifdef ENABLE_RESOLVER - /** \name Asynchronous Resolver */ - //@{ - /** Request an asynchronous dns resolution. - \param host hostname to be resolved - \param port port number passed along for the ride - \return Resolve ID */ - int Resolve(const std::string& host,port_t port = 0); -#ifdef ENABLE_IPV6 - int Resolve6(const std::string& host, port_t port = 0); -#endif - /** Callback returning a resolved address. - \param id Resolve ID from Resolve call - \param a resolved ip address - \param port port number passed to Resolve */ - virtual void OnResolved(int id,ipaddr_t a,port_t port); -#ifdef ENABLE_IPV6 - virtual void OnResolved(int id,in6_addr& a,port_t port); -#endif - /** Request asynchronous reverse dns lookup. - \param a in_addr to be translated */ - int Resolve(ipaddr_t a); -#ifdef ENABLE_IPV6 - int Resolve(in6_addr& a); -#endif - /** Callback returning reverse resolve results. - \param id Resolve ID - \param name Resolved hostname */ - virtual void OnReverseResolved(int id,const std::string& name); - /** Callback indicating failed dns lookup. - \param id Resolve ID */ - virtual void OnResolveFailed(int id); - //@} -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_DETACH - /** \name Thread Support */ - //@{ - /** Callback fires when a new socket thread has started and this - socket is ready for operation again. - \sa ResolvSocket */ - virtual void OnDetached(); - - // LIST_DETACH - - /** Internal use. */ - void SetDetach(bool x = true); - /** Check detach flag. - \return true if the socket should detach to its own thread */ - bool IsDetach(); - - /** Internal use. */ - void SetDetached(bool x = true); - /** Check detached flag. - \return true if the socket runs in its own thread. */ - const bool IsDetached() const; - /** Order this socket to start its own thread and call OnDetached - when ready for operation. */ - bool Detach(); - /** Store the slave sockethandler pointer. */ - void SetSlaveHandler(ISocketHandler *); - /** Create new thread for this socket to run detached in. */ - void DetachSocket(); - //@} -#endif // ENABLE_DETACH - - /** Write traffic to an IFile. Socket will not delete this object. */ - void SetTrafficMonitor(IFile *p) { m_traffic_monitor = p; } - -#ifdef ENABLE_TRIGGERS - /** \name Triggers */ - //@{ - /** Subscribe to trigger id. */ - void Subscribe(int id); - /** Unsubscribe from trigger id. */ - void Unsubscribe(int id); - /** Trigger callback, with data passed from source to destination. */ - virtual void OnTrigger(int id, const TriggerData& data); - /** Trigger cancelled because source has been deleted (as in delete). */ - virtual void OnCancelled(int id); - //@} -#endif - -protected: - /** default constructor not available */ - Socket() : m_handler(m_handler) {} - /** copy constructor not available */ - Socket(const Socket& s) : m_handler(s.m_handler) {} - - /** assignment operator not available. */ - Socket& operator=(const Socket& ) { return *this; } - - /** All traffic will be written to this IFile, if set. */ - IFile *GetTrafficMonitor() { return m_traffic_monitor; } - -// unsigned long m_flags; ///< boolean flags, replacing old 'bool' members - -private: - ISocketHandler& m_handler; ///< Reference of ISocketHandler in control of this socket - SOCKET m_socket; ///< File descriptor - bool m_bDel; ///< Delete by handler flag - bool m_bClose; ///< Close and delete flag - time_t m_tCreate; ///< Time in seconds when this socket was created - Socket *m_parent; ///< Pointer to ListenSocket class, valid for incoming sockets - bool m_b_disable_read; ///< Disable checking for read events - bool m_connected; ///< Socket is connected (tcp/udp) - bool m_b_erased_by_handler; ///< Set by handler before delete - time_t m_tClose; ///< Time in seconds when ordered to close - std::auto_ptr m_client_remote_address; ///< Address of last connect() - std::auto_ptr m_remote_address; ///< Remote end address - IFile *m_traffic_monitor; - time_t m_timeout_start; ///< Set by SetTimeout - time_t m_timeout_limit; ///< Defined by SetTimeout - bool m_bLost; ///< connection lost - -#ifdef _WIN32 -static WSAInitializer m_winsock_init; ///< Winsock initialization singleton class -#endif - -#ifdef HAVE_OPENSSL - bool m_b_enable_ssl; ///< Enable SSL for this TcpSocket - bool m_b_ssl; ///< ssl negotiation mode (TcpSocket) - bool m_b_ssl_server; ///< True if this is an incoming ssl TcpSocket connection -#endif - -#ifdef ENABLE_IPV6 - bool m_ipv6; ///< This is an ipv6 socket if this one is true -#endif - -#ifdef ENABLE_POOL - int m_socket_type; ///< Type of socket, from socket() call - std::string m_socket_protocol; ///< Protocol, from socket() call - bool m_bClient; ///< only client connections are pooled - bool m_bRetain; ///< keep connection on close -#endif - -#ifdef ENABLE_SOCKS4 - bool m_bSocks4; ///< socks4 negotiation mode (TcpSocket) - ipaddr_t m_socks4_host; ///< socks4 server address - port_t m_socks4_port; ///< socks4 server port number - std::string m_socks4_userid; ///< socks4 server usedid -#endif - -#ifdef ENABLE_DETACH - bool m_detach; ///< Socket ordered to detach flag - bool m_detached; ///< Socket has been detached - SocketThread *m_pThread; ///< Detach socket thread class pointer - ISocketHandler *m_slave_handler; ///< Actual sockethandler while detached -#endif -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Socket_H - - diff --git a/dep/include/sockets/SocketAddress.h b/dep/include/sockets/SocketAddress.h deleted file mode 100644 index abdbbfd2cf6..00000000000 --- a/dep/include/sockets/SocketAddress.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - ** \file SocketAddress.h - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_SocketAddress_H -#define _SOCKETS_SocketAddress_H - -#include "sockets-config.h" -#include -#include -#include "socket_include.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** - This class and its subclasses is intended to be used as replacement - for the internal data type 'ipaddr_t' and various implementations of - IPv6 addressing found throughout the library. - 'ipaddr_t' is an IPv4 address in network byte order. - 'port_t' is the portnumber in host byte order. - 'struct in6_addr' is an IPv6 address. - 'struct in_addr' is an IPv4 address. - \ingroup basic -*/ -class SocketAddress -{ -public: - virtual ~SocketAddress() {} - - /** Get a pointer to the address struct. */ - virtual operator struct sockaddr *() = 0; - - /** Get length of address struct. */ - virtual operator socklen_t() = 0; - - /** Compare two addresses. */ - virtual bool operator==(SocketAddress&) = 0; - - /** Set port number. - \param port Port number in host byte order */ - virtual void SetPort(port_t port) = 0; - - /** Get port number. - \return Port number in host byte order. */ - virtual port_t GetPort() = 0; - - /** Set socket address. - \param sa Pointer to either 'struct sockaddr_in' or 'struct sockaddr_in6'. */ - virtual void SetAddress(struct sockaddr *sa) = 0; - - /** Convert address to text. */ - virtual std::string Convert(bool include_port) = 0; - - /** Reverse lookup of address. */ - virtual std::string Reverse() = 0; - - /** Get address family. */ - virtual int GetFamily() = 0; - - /** Address structure is valid. */ - virtual bool IsValid() = 0; - - /** Get a copy of this SocketAddress object. */ - virtual std::auto_ptr GetCopy() = 0; -}; - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // _SOCKETS_SocketAddress_H - - diff --git a/dep/include/sockets/SocketHandler.h b/dep/include/sockets/SocketHandler.h deleted file mode 100644 index 5598ec4249b..00000000000 --- a/dep/include/sockets/SocketHandler.h +++ /dev/null @@ -1,265 +0,0 @@ -/** \file SocketHandler.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_SocketHandler_H -#define _SOCKETS_SocketHandler_H - -#include "sockets-config.h" -#include -#include - -#include "socket_include.h" -#include "ISocketHandler.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class Socket; -#ifdef ENABLE_RESOLVER -class ResolvServer; -#endif -class Mutex; - -/** Socket container class, event generator. - \ingroup basic */ -class SocketHandler : public ISocketHandler -{ -protected: - /** Map type for holding file descriptors/socket object pointers. */ - typedef std::map socket_m; - -public: - /** SocketHandler constructor. - \param log Optional log class pointer */ - SocketHandler(StdLog *log = NULL); - - /** SocketHandler threadsafe constructor. - \param mutex Externally declared mutex variable - \param log Optional log class pointer */ - SocketHandler(Mutex& mutex,StdLog *log = NULL); - - ~SocketHandler(); - - /** Get mutex reference for threadsafe operations. */ - Mutex& GetMutex() const; - - /** Register StdLog object for error callback. - \param log Pointer to log class */ - void RegStdLog(StdLog *log); - - /** Log error to log class for print out / storage. */ - void LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t = LOG_LEVEL_WARNING); - - /** Add socket instance to socket map. Removal is always automatic. */ - void Add(Socket *); - - /** Get status of read/write/exception file descriptor set for a socket. */ - void Get(SOCKET s,bool& r,bool& w,bool& e); - - /** Set read/write/exception file descriptor sets (fd_set). */ - void Set(SOCKET s,bool bRead,bool bWrite,bool bException = true); - - /** Wait for events, generate callbacks. */ - int Select(long sec,long usec); - - /** This method will not return until an event has been detected. */ - int Select(); - - /** Wait for events, generate callbacks. */ - int Select(struct timeval *tsel); - - /** Check that a socket really is handled by this socket handler. */ - bool Valid(Socket *); - - /** Return number of sockets handled by this handler. */ - size_t GetCount(); - - /** Override and return false to deny all incoming connections. - \param p ListenSocket class pointer (use GetPort to identify which one) */ - bool OkToAccept(Socket *p); - - /** Called by Socket when a socket changes state. */ - void AddList(SOCKET s,list_t which_one,bool add); - - // Connection pool -#ifdef ENABLE_POOL - /** Find available open connection (used by connection pool). */ - ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&); - /** Enable connection pool (by default disabled). */ - void EnablePool(bool x = true); - /** Check pool status. - \return true if connection pool is enabled */ - bool PoolEnabled(); -#endif // ENABLE_POOL - - // Socks4 -#ifdef ENABLE_SOCKS4 - /** Set socks4 server ip that all new tcp sockets should use. */ - void SetSocks4Host(ipaddr_t); - /** Set socks4 server hostname that all new tcp sockets should use. */ - void SetSocks4Host(const std::string& ); - /** Set socks4 server port number that all new tcp sockets should use. */ - void SetSocks4Port(port_t); - /** Set optional socks4 userid. */ - void SetSocks4Userid(const std::string& ); - /** If connection to socks4 server fails, immediately try direct connection to final host. */ - void SetSocks4TryDirect(bool x = true); - /** Get socks4 server ip. - \return socks4 server ip */ - ipaddr_t GetSocks4Host(); - /** Get socks4 port number. - \return socks4 port number */ - port_t GetSocks4Port(); - /** Get socks4 userid (optional). - \return socks4 userid */ - const std::string& GetSocks4Userid(); - /** Check status of socks4 try direct flag. - \return true if direct connection should be tried if connection to socks4 server fails */ - bool Socks4TryDirect(); -#endif // ENABLE_SOCKS4 - - // DNS resolve server -#ifdef ENABLE_RESOLVER - /** Enable asynchronous DNS. - \param port Listen port of asynchronous dns server */ - void EnableResolver(port_t port = 16667); - /** Check resolver status. - \return true if resolver is enabled */ - bool ResolverEnabled(); - /** Queue a dns request. - \param host Hostname to be resolved - \param port Port number will be echoed in Socket::OnResolved callback */ - int Resolve(Socket *,const std::string& host,port_t port); -#ifdef ENABLE_IPV6 - int Resolve6(Socket *,const std::string& host,port_t port); -#endif - /** Do a reverse dns lookup. */ - int Resolve(Socket *,ipaddr_t a); -#ifdef ENABLE_IPV6 - int Resolve(Socket *,in6_addr& a); -#endif - /** Get listen port of asynchronous dns server. */ - port_t GetResolverPort(); - /** Resolver thread ready for queries. */ - bool ResolverReady(); - /** Returns true if the socket is waiting for a resolve event. */ - bool Resolving(Socket *); -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_TRIGGERS - /** Fetch unique trigger id. */ - int TriggerID(Socket *src); - /** Subscribe socket to trigger id. */ - bool Subscribe(int id, Socket *dst); - /** Unsubscribe socket from trigger id. */ - bool Unsubscribe(int id, Socket *dst); - /** Execute OnTrigger for subscribed sockets. - \param id Trigger ID - \param data Data passed from source to destination - \param erase Empty trigger id source and destination maps if 'true', - Leave them in place if 'false' - if a trigger should be called many times */ - void Trigger(int id, Socket::TriggerData& data, bool erase = true); -#endif // ENABLE_TRIGGERS - -#ifdef ENABLE_DETACH - /** Indicates that the handler runs under SocketThread. */ - void SetSlave(bool x = true); - /** Indicates that the handler runs under SocketThread. */ - bool IsSlave(); -#endif - - /** Sanity check of those accursed lists. */ - void CheckSanity(); - -protected: - socket_m m_sockets; ///< Active sockets map - socket_m m_add; ///< Sockets to be added to sockets map - std::list m_delete; ///< Sockets to be deleted (failed when Add) - -protected: - StdLog *m_stdlog; ///< Registered log class, or NULL - Mutex& m_mutex; ///< Thread safety mutex - bool m_b_use_mutex; ///< Mutex correctly initialized - -private: - void CheckList(socket_v&,const std::string&); ///< Used by CheckSanity - /** Remove socket from socket map, used by Socket class. */ - void Remove(Socket *); - SOCKET m_maxsock; ///< Highest file descriptor + 1 in active sockets list - fd_set m_rfds; ///< file descriptor set monitored for read events - fd_set m_wfds; ///< file descriptor set monitored for write events - fd_set m_efds; ///< file descriptor set monitored for exceptions - int m_preverror; ///< debug select() error - int m_errcnt; ///< debug select() error - time_t m_tlast; ///< timeout control - - // state lists - socket_v m_fds; ///< Active file descriptor list - socket_v m_fds_erase; ///< File descriptors that are to be erased from m_sockets - socket_v m_fds_callonconnect; ///< checklist CallOnConnect -#ifdef ENABLE_DETACH - socket_v m_fds_detach; ///< checklist Detach -#endif - socket_v m_fds_timeout; ///< checklist timeout - socket_v m_fds_retry; ///< checklist retry client connect - socket_v m_fds_close; ///< checklist close and delete - -#ifdef ENABLE_SOCKS4 - ipaddr_t m_socks4_host; ///< Socks4 server host ip - port_t m_socks4_port; ///< Socks4 server port number - std::string m_socks4_userid; ///< Socks4 userid - bool m_bTryDirect; ///< Try direct connection if socks4 server fails -#endif -#ifdef ENABLE_RESOLVER - int m_resolv_id; ///< Resolver id counter - ResolvServer *m_resolver; ///< Resolver thread pointer - port_t m_resolver_port; ///< Resolver listen port - std::map m_resolve_q; ///< resolve queue -#endif -#ifdef ENABLE_POOL - bool m_b_enable_pool; ///< Connection pool enabled if true -#endif -#ifdef ENABLE_TRIGGERS - int m_next_trigger_id; ///< Unique trigger id counter - std::map m_trigger_src; ///< mapping trigger id to source socket - std::map > m_trigger_dst; ///< mapping trigger id to destination sockets -#endif -#ifdef ENABLE_DETACH - bool m_slave; ///< Indicates that this is a ISocketHandler run in SocketThread -#endif -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_SocketHandler_H - - diff --git a/dep/include/sockets/StdLog.h b/dep/include/sockets/StdLog.h deleted file mode 100644 index 3ff68d6e9ea..00000000000 --- a/dep/include/sockets/StdLog.h +++ /dev/null @@ -1,73 +0,0 @@ -/** \file StdLog.h - ** \date 2004-06-01 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_StdLog_H -#define _SOCKETS_StdLog_H - -#include "sockets-config.h" -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** error level enum. */ -typedef enum -{ - LOG_LEVEL_WARNING = 0, - LOG_LEVEL_ERROR, - LOG_LEVEL_FATAL, - LOG_LEVEL_INFO -} loglevel_t; - -class ISocketHandler; -class Socket; - -/** \defgroup logging Log help classes */ -/** Log class interface. - \ingroup logging */ -class StdLog -{ -public: - virtual ~StdLog() {} - - virtual void error(ISocketHandler *,Socket *, - const std::string& user_text, - int err, - const std::string& sys_err, - loglevel_t = LOG_LEVEL_WARNING) = 0; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_StdLog_H - - diff --git a/dep/include/sockets/StdoutLog.h b/dep/include/sockets/StdoutLog.h deleted file mode 100644 index aeb25b3e6e6..00000000000 --- a/dep/include/sockets/StdoutLog.h +++ /dev/null @@ -1,55 +0,0 @@ -/** \file StdoutLog.h - ** \date 2004-06-01 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_StdoutLog_H -#define _SOCKETS_StdoutLog_H - -#include "sockets-config.h" -#include "StdLog.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** StdLog implementation, logs to stdout. - \ingroup logging */ -class StdoutLog : public StdLog -{ -public: - void error(ISocketHandler *,Socket *,const std::string& call,int err,const std::string& sys_err,loglevel_t); -}; - - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_StdoutLog_H - - diff --git a/dep/include/sockets/StreamSocket.h b/dep/include/sockets/StreamSocket.h deleted file mode 100644 index bcce10ffbc5..00000000000 --- a/dep/include/sockets/StreamSocket.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef _StreamSocket_H -#define _StreamSocket_H - -#include "Socket.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** SOCK_STREAM Socket base class. - \ingroup basic */ -class StreamSocket : public Socket -{ -public: - StreamSocket(ISocketHandler& ); - ~StreamSocket(); - - /** Socket should Check Connect on next write event from select(). */ - void SetConnecting(bool = true); - - /** Check connecting flag. - \return true if the socket is still trying to connect */ - bool Connecting(); - - /** Returns true when socket file descriptor is valid, - socket connection is established, and socket is not about to - be closed. */ - bool Ready(); - - /** Set timeout to use for connection attempt. - \param x Timeout in seconds */ - void SetConnectTimeout(int x); - - /** Return number of seconds to wait for a connection. - \return Connection timeout (seconds) */ - int GetConnectTimeout(); - - /** Set flush before close to make a tcp socket completely empty its - output buffer before closing the connection. */ - void SetFlushBeforeClose(bool = true); - - /** Check flush before status. - \return true if the socket should send all data before closing */ - bool GetFlushBeforeClose(); - - /** Define number of connection retries (tcp only). - n = 0 - no retry - n > 0 - number of retries - n = -1 - unlimited retries */ - void SetConnectionRetry(int n); - - /** Get number of maximum connection retries (tcp only). */ - int GetConnectionRetry(); - - /** Increase number of actual connection retries (tcp only). */ - void IncreaseConnectionRetries(); - - /** Get number of actual connection retries (tcp only). */ - int GetConnectionRetries(); - - /** Reset actual connection retries (tcp only). */ - void ResetConnectionRetries(); - - // LIST_CALLONCONNECT - - /** Instruct socket to call OnConnect callback next sockethandler cycle. */ - void SetCallOnConnect(bool x = true); - - /** Check call on connect flag. - \return true if OnConnect() should be called a.s.a.p */ - bool CallOnConnect(); - - // LIST_RETRY - - /** Set flag to initiate a connection attempt after a connection timeout. */ - void SetRetryClientConnect(bool x = true); - - /** Check if a connection attempt should be made. - \return true when another attempt should be made */ - bool RetryClientConnect(); - - /** Called after OnRead if socket is in line protocol mode. - \sa SetLineProtocol */ - /** Enable the OnLine callback. Do not create your own OnRead - * callback when using this. */ - virtual void SetLineProtocol(bool = true); - - /** Check line protocol mode. - \return true if socket is in line protocol mode */ - bool LineProtocol(); - - /** Set shutdown status. */ - void SetShutdown(int); - - /** Get shutdown status. */ - int GetShutdown(); - - /** Returns IPPROTO_TCP or IPPROTO_SCTP */ - virtual int Protocol() = 0; - -protected: - StreamSocket(const StreamSocket& ) {} // copy constructor - -private: - StreamSocket& operator=(const StreamSocket& ) { return *this; } // assignment operator - - bool m_bConnecting; ///< Flag indicating connection in progress - int m_connect_timeout; ///< Connection timeout (seconds) - bool m_flush_before_close; ///< Send all data before closing (default true) - int m_connection_retry; ///< Maximum connection retries (tcp) - int m_retries; ///< Actual number of connection retries (tcp) - bool m_call_on_connect; ///< OnConnect will be called next ISocketHandler cycle if true - bool m_b_retry_connect; ///< Try another connection attempt next ISocketHandler cycle - bool m_line_protocol; ///< Line protocol mode flag - int m_shutdown; ///< Shutdown status -}; - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - -#endif // _StreamSocket_H - - diff --git a/dep/include/sockets/TcpSocket.h b/dep/include/sockets/TcpSocket.h deleted file mode 100644 index de1be8bd8b9..00000000000 --- a/dep/include/sockets/TcpSocket.h +++ /dev/null @@ -1,356 +0,0 @@ -/** \file TcpSocket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_TcpSocket_H -#define _SOCKETS_TcpSocket_H -#include "sockets-config.h" -#include "StreamSocket.h" -#ifdef HAVE_OPENSSL -#include -#include "SSLInitializer.h" -#endif - -#include - -#define TCP_BUFSIZE_READ 16400 -#define TCP_OUTPUT_CAPACITY 1024000 - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -class SocketAddress; - -/** Socket implementation for TCP. - \ingroup basic */ -class TcpSocket : public StreamSocket -{ - /** \defgroup internal Internal utility */ -protected: - /** Buffer class containing one read/write circular buffer. - \ingroup internal */ - class CircularBuffer - { - public: - CircularBuffer(size_t size); - ~CircularBuffer(); - - /** append l bytes from p to buffer */ - bool Write(const char *p,size_t l); - /** copy l bytes from buffer to dest */ - bool Read(char *dest,size_t l); - /** copy l bytes from buffer to dest, dont touch buffer pointers */ - bool SoftRead(char *dest, size_t l); - /** skip l bytes from buffer */ - bool Remove(size_t l); - /** read l bytes from buffer, returns as string. */ - std::string ReadString(size_t l); - - /** total buffer length */ - size_t GetLength(); - /** pointer to circular buffer beginning */ - const char *GetStart(); - /** return number of bytes from circular buffer beginning to buffer physical end */ - size_t GetL(); - /** return free space in buffer, number of bytes until buffer overrun */ - size_t Space(); - - /** return total number of bytes written to this buffer, ever */ - unsigned long ByteCounter(bool clear = false); - - private: - CircularBuffer(const CircularBuffer& /*s*/) {} - CircularBuffer& operator=(const CircularBuffer& ) { return *this; } - char *buf; - size_t m_max; - size_t m_q; - size_t m_b; - size_t m_t; - unsigned long m_count; - }; - /** Output buffer struct. - \ingroup internal */ - struct OUTPUT { - OUTPUT() : _b(0), _t(0), _q(0) {} - OUTPUT(const char *buf, size_t len) : _b(0), _t(len), _q(len) { - memcpy(_buf, buf, len); - } - size_t Space() { - return TCP_OUTPUT_CAPACITY - _t; - } - void Add(const char *buf, size_t len) { - memcpy(_buf + _t, buf, len); - _t += len; - _q += len; - } - size_t Remove(size_t len) { - _b += len; - _q -= len; - return _q; - } - const char *Buf() { - return _buf + _b; - } - size_t Len() { - return _q; - } - size_t _b; - size_t _t; - size_t _q; - char _buf[TCP_OUTPUT_CAPACITY]; - }; - typedef std::list output_l; - -public: - /** Constructor with standard values on input/output buffers. */ - TcpSocket(ISocketHandler& ); - /** Constructor with custom values for i/o buffer. - \param h ISocketHandler reference - \param isize Input buffer size - \param osize Output buffer size */ - TcpSocket(ISocketHandler& h,size_t isize,size_t osize); - ~TcpSocket(); - - /** Open a connection to a remote server. - If you want your socket to connect to a server, - always call Open before Add'ing a socket to the sockethandler. - If not, the connection attempt will not be monitored by the - socket handler... - \param ip IP address - \param port Port number - \param skip_socks Do not use socks4 even if configured */ - bool Open(ipaddr_t ip,port_t port,bool skip_socks = false); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Open connection. - \param ip Ipv6 address - \param port Port number - \param skip_socks Do not use socks4 even if configured */ - bool Open(in6_addr ip,port_t port,bool skip_socks = false); -#endif -#endif - bool Open(SocketAddress&,bool skip_socks = false); - bool Open(SocketAddress&,SocketAddress& bind_address,bool skip_socks = false); - /** Open connection. - \param host Hostname - \param port Port number */ - bool Open(const std::string &host,port_t port); - - /** Connect timeout callback. */ - void OnConnectTimeout(); -#ifdef _WIN32 - /** Connection failed reported as exception on win32 */ - void OnException(); -#endif - - /** Close file descriptor - internal use only. - \sa SetCloseAndDelete */ - int Close(); - - /** Send a string. - \param s String to send - \param f Dummy flags -- not used */ - void Send(const std::string &s,int f = 0); - /** Send string using printf formatting. */ - void Sendf(const char *format, ...); - /** Send buffer of bytes. - \param buf Buffer pointer - \param len Length of data - \param f Dummy flags -- not used */ - void SendBuf(const char *buf,size_t len,int f = 0); - /** This callback is executed after a successful read from the socket. - \param buf Pointer to the data - \param len Length of the data */ - virtual void OnRawData(const char *buf,size_t len); - - /** Called when output buffer has been sent. - Note: Will only be called IF the output buffer has been used. - Send's that was successful without needing the output buffer - will not generate a call to this method. */ - virtual void OnWriteComplete(); - /** Number of bytes in input buffer. */ - size_t GetInputLength(); - /** Number of bytes in output buffer. */ - size_t GetOutputLength(); - - /** Callback fires when a socket in line protocol has read one full line. - \param line Line read */ - void OnLine(const std::string& line); - /** Get counter of number of bytes received. */ - uint64_t GetBytesReceived(bool clear = false); - /** Get counter of number of bytes sent. */ - uint64_t GetBytesSent(bool clear = false); - - /** Socks4 specific callback. */ - void OnSocks4Connect(); - /** Socks4 specific callback. */ - void OnSocks4ConnectFailed(); - /** Socks4 specific callback. - \return 'need_more' */ - bool OnSocks4Read(); - -#ifdef ENABLE_RESOLVER - /** Callback executed when resolver thread has finished a resolve request. */ - void OnResolved(int id,ipaddr_t a,port_t port); -#ifdef ENABLE_IPV6 - void OnResolved(int id,in6_addr& a,port_t port); -#endif -#endif -#ifdef HAVE_OPENSSL - /** Callback for 'New' ssl support - replaces SSLSocket. Internal use. */ - void OnSSLConnect(); - /** Callback for 'New' ssl support - replaces SSLSocket. Internal use. */ - void OnSSLAccept(); - /** This method must be implemented to initialize - the ssl context for an outgoing connection. */ - virtual void InitSSLClient(); - /** This method must be implemented to initialize - the ssl context for an incoming connection. */ - virtual void InitSSLServer(); -#endif - -#ifdef ENABLE_RECONNECT - /** Flag that says a broken connection will try to reconnect. */ - void SetReconnect(bool = true); - /** Check reconnect on lost connection flag status. */ - bool Reconnect(); - /** Flag to determine if a reconnect is in progress. */ - void SetIsReconnect(bool x = true); - /** Socket is reconnecting. */ - bool IsReconnect(); -#endif - - void DisableInputBuffer(bool = true); - - void OnOptions(int,int,int,SOCKET); - - void SetLineProtocol(bool = true); - - // TCP options - bool SetTcpNodelay(bool = true); - - virtual int Protocol(); - - /** Trigger limit for callback OnTransferLimit. */ - void SetTransferLimit(size_t sz); - /** This callback fires when the output buffer drops below the value - set by SetTransferLimit. Default: 0 (disabled). */ - virtual void OnTransferLimit(); - -protected: - TcpSocket(const TcpSocket& ); - void OnRead(); - void OnRead( char *buf, size_t n ); - void OnWrite(); -#ifdef HAVE_OPENSSL - /** SSL; Initialize ssl context for a client socket. - \param meth_in SSL method */ - void InitializeContext(const std::string& context, SSL_METHOD *meth_in = NULL); - /** SSL; Initialize ssl context for a server socket. - \param keyfile Combined private key/certificate file - \param password Password for private key - \param meth_in SSL method */ - void InitializeContext(const std::string& context, const std::string& keyfile, const std::string& password, SSL_METHOD *meth_in = NULL); - /** SSL; Initialize ssl context for a server socket. - \param certfile Separate certificate file - \param keyfile Combined private key/certificate file - \param password Password for private key - \param meth_in SSL method */ - void InitializeContext(const std::string& context, const std::string& certfile, const std::string& keyfile, const std::string& password, SSL_METHOD *meth_in = NULL); - /** SSL; Password callback method. */ -static int SSL_password_cb(char *buf,int num,int rwflag,void *userdata); - /** SSL; Get pointer to ssl context structure. */ - virtual SSL_CTX *GetSslContext(); - /** SSL; Get pointer to ssl structure. */ - virtual SSL *GetSsl(); - /** ssl; still negotiating connection. */ - bool SSLNegotiate(); - /** SSL; Get ssl password. */ - const std::string& GetPassword(); -#endif - - CircularBuffer ibuf; ///< Circular input buffer - -private: - TcpSocket& operator=(const TcpSocket& ) { return *this; } - - /** the actual send() */ - int TryWrite(const char *buf, size_t len); - /** add data to output buffer top */ - void Buffer(const char *buf, size_t len); - - // - bool m_b_input_buffer_disabled; - uint64_t m_bytes_sent; - uint64_t m_bytes_received; - bool m_skip_c; ///< Skip second char of CRLF or LFCR sequence in OnRead - char m_c; ///< First char in CRLF or LFCR sequence - std::string m_line; ///< Current line in line protocol mode -#ifdef SOCKETS_DYNAMIC_TEMP - char *m_buf; ///< temporary read buffer -#endif - output_l m_obuf; ///< output buffer - OUTPUT *m_obuf_top; ///< output buffer on top - size_t m_transfer_limit; - size_t m_output_length; - -#ifdef HAVE_OPENSSL -static SSLInitializer m_ssl_init; - SSL_CTX *m_ssl_ctx; ///< ssl context - SSL *m_ssl; ///< ssl 'socket' - BIO *m_sbio; ///< ssl bio - std::string m_password; ///< ssl password -#endif - -#ifdef ENABLE_SOCKS4 - int m_socks4_state; ///< socks4 support - char m_socks4_vn; ///< socks4 support, temporary variable - char m_socks4_cd; ///< socks4 support, temporary variable - unsigned short m_socks4_dstport; ///< socks4 support - unsigned long m_socks4_dstip; ///< socks4 support -#endif - -#ifdef ENABLE_RESOLVER - int m_resolver_id; ///< Resolver id (if any) for current Open call -#endif - -#ifdef ENABLE_RECONNECT - bool m_b_reconnect; ///< Reconnect on lost connection flag - bool m_b_is_reconnect; ///< Trying to reconnect -#endif - -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_TcpSocket_H - - diff --git a/dep/include/sockets/Thread.h b/dep/include/sockets/Thread.h deleted file mode 100644 index efb766e9ee6..00000000000 --- a/dep/include/sockets/Thread.h +++ /dev/null @@ -1,100 +0,0 @@ -/** \file Thread.h - ** \date 2004-10-30 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Thread_H -#define _SOCKETS_Thread_H - -#include "sockets-config.h" -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -#ifdef _WIN32 -// to be -//typedef DWORD threadfunc_t; -//typedef LPVOID threadparam_t; -//#define STDPREFIX WINAPI -typedef unsigned threadfunc_t; -typedef void * threadparam_t; -#define STDPREFIX __stdcall -#else -#include - -typedef void * threadfunc_t; -typedef void * threadparam_t; -#define STDPREFIX -#endif - -/** \defgroup threading Threading */ -/** Thread base class. -The Thread class is used by the resolver (ResolvServer) and running a detached socket (SocketThread). -When you know some processing will take a long time and will freeze up a socket, there is always the -possibility to call Detach() on that socket before starting the processing. -When the OnDetached() callback is later called the processing can continue, now in its own thread. - \ingroup threading */ -class Thread -{ -public: - Thread(bool release = true); - virtual ~Thread(); - - static threadfunc_t STDPREFIX StartThread(threadparam_t); - - virtual void Run() = 0; - - bool IsRunning(); - void SetRunning(bool x); - bool IsReleased(); - void SetRelease(bool x); - bool DeleteOnExit(); - void SetDeleteOnExit(bool x = true); - bool IsDestructor(); - -private: - Thread(const Thread& ) {} - Thread& operator=(const Thread& ) { return *this; } -#ifdef _WIN32 - HANDLE m_thread; - unsigned m_dwThreadId; -#else - pthread_t m_thread; -#endif - bool m_running; - bool m_release; - bool m_b_delete_on_exit; - bool m_b_destructor; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Thread_H - - diff --git a/dep/include/sockets/UdpSocket.h b/dep/include/sockets/UdpSocket.h deleted file mode 100644 index 3b06c6955bd..00000000000 --- a/dep/include/sockets/UdpSocket.h +++ /dev/null @@ -1,215 +0,0 @@ -/** \file UdpSocket.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_UdpSocket_H -#define _SOCKETS_UdpSocket_H - -#include "sockets-config.h" -#include "Socket.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/** Socket implementation for UDP. - \ingroup basic */ -class UdpSocket : public Socket -{ -public: - /** Constructor. - \param h ISocketHandler reference - \param ibufsz Maximum size of receive message (extra bytes will be truncated) - \param ipv6 'true' if this is an ipv6 socket */ - UdpSocket(ISocketHandler& h,int ibufsz = 16384,bool ipv6 = false, int retries = 0); - ~UdpSocket(); - - /** Called when incoming data has been received. - \param buf Pointer to data - \param len Length of data - \param sa Pointer to sockaddr struct of sender - \param sa_len Length of sockaddr struct */ - virtual void OnRawData(const char *buf,size_t len,struct sockaddr *sa,socklen_t sa_len); - - /** Called when incoming data has been received and read timestamp is enabled. - \param buf Pointer to data - \param len Length of data - \param sa Pointer to sockaddr struct of sender - \param sa_len Length of sockaddr struct - \param ts Timestamp from message */ - virtual void OnRawData(const char *buf,size_t len,struct sockaddr *sa,socklen_t sa_len,struct timeval *ts); - - /** To receive incoming data, call Bind to setup an incoming port. - \param port Incoming port number - \param range Port range to try if ports already in use - \return 0 if bind succeeded */ - int Bind(port_t& port,int range = 1); - /** To receive data on a specific interface:port, use this. - \param intf Interface ip/hostname - \param port Port number - \param range Port range - \return 0 if bind succeeded */ - int Bind(const std::string& intf,port_t& port,int range = 1); - /** To receive data on a specific interface:port, use this. - \param a Ip address - \param port Port number - \param range Port range - \return 0 if bind succeeded */ - int Bind(ipaddr_t a,port_t& port,int range = 1); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** To receive data on a specific interface:port, use this. - \param a Ipv6 address - \param port Port number - \param range Port range - \return 0 if bind succeeded */ - int Bind(in6_addr a,port_t& port,int range = 1); -#endif -#endif - /** To receive data on a specific interface:port, use this. - \param ad Socket address - \param range Port range - \return 0 if bind succeeded */ - int Bind(SocketAddress& ad,int range = 1); - - /** Define remote host. - \param l Address of remote host - \param port Port of remote host - \return true if successful */ - bool Open(ipaddr_t l,port_t port); - /** Define remote host. - \param host Hostname - \param port Port number - \return true if successful */ - bool Open(const std::string& host,port_t port); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Define remote host. - \param a Address of remote host, ipv6 - \param port Port of remote host - \return true if successful */ - bool Open(struct in6_addr& a,port_t port); -#endif -#endif - /** Define remote host. - \param ad Socket address - \return true if successful */ - bool Open(SocketAddress& ad); - - /** Send to specified host */ - void SendToBuf(const std::string& ,port_t,const char *data,int len,int flags = 0); - /** Send to specified address */ - void SendToBuf(ipaddr_t,port_t,const char *data,int len,int flags = 0); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Send to specified ipv6 address */ - void SendToBuf(in6_addr,port_t,const char *data,int len,int flags = 0); -#endif -#endif - /** Send to specified socket address */ - void SendToBuf(SocketAddress& ad,const char *data,int len,int flags = 0); - - /** Send string to specified host */ - void SendTo(const std::string&,port_t,const std::string&,int flags = 0); - /** Send string to specified address */ - void SendTo(ipaddr_t,port_t,const std::string&,int flags = 0); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Send string to specified ipv6 address */ - void SendTo(in6_addr,port_t,const std::string&,int flags = 0); -#endif -#endif - /** Send string to specified socket address */ - void SendTo(SocketAddress& ad,const std::string&,int flags = 0); - - /** Send to connected address */ - void SendBuf(const char *data,size_t,int flags = 0); - /** Send string to connected address. */ - void Send(const std::string& ,int flags = 0); - - /** Set broadcast */ - void SetBroadcast(bool b = true); - /** Check broadcast flag. - \return true broadcast is enabled. */ - bool IsBroadcast(); - - /** multicast */ - void SetMulticastTTL(int ttl = 1); - int GetMulticastTTL(); - void SetMulticastLoop(bool = true); - bool IsMulticastLoop(); - void AddMulticastMembership(const std::string& group,const std::string& intf = "0.0.0.0",int if_index = 0); - void DropMulticastMembership(const std::string& group,const std::string& intf = "0.0.0.0",int if_index = 0); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** multicast, ipv6 only */ - void SetMulticastHops(int = -1); - /** multicast, ipv6 only */ - int GetMulticastHops(); -#endif -#endif - /** Returns true if Bind succeeded. */ - bool IsBound(); - /** Return Bind port number */ - port_t GetPort(); - - void OnOptions(int,int,int,SOCKET) {} - - int GetLastSizeWritten(); - - /** Also read timestamp information from incoming message */ - void SetTimestamp(bool = true); - -protected: - UdpSocket(const UdpSocket& s) : Socket(s) {} - void OnRead(); -#if defined(LINUX) || defined(MACOSX) - /** This method emulates socket recvfrom, but uses messages so we can get the timestamp */ - int ReadTS(char *ioBuf, int inBufSize, struct sockaddr *from, socklen_t fromlen, struct timeval *ts); -#endif - -private: - UdpSocket& operator=(const UdpSocket& ) { return *this; } - /** create before using sendto methods */ - void CreateConnection(); - char *m_ibuf; ///< Input buffer - int m_ibufsz; ///< Size of input buffer - bool m_bind_ok; ///< Bind completed successfully - port_t m_port; ///< Bind port number - int m_last_size_written; - int m_retries; - bool m_b_read_ts; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_UdpSocket_H - - diff --git a/dep/include/sockets/Utility.h b/dep/include/sockets/Utility.h deleted file mode 100644 index 724a94e4b32..00000000000 --- a/dep/include/sockets/Utility.h +++ /dev/null @@ -1,186 +0,0 @@ -/** \file Utility.h - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_Utility_H -#define _SOCKETS_Utility_H - -#include "sockets-config.h" -#include -#include -#include -#include "socket_include.h" -#include -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -#define TWIST_LEN 624 - -class SocketAddress; - -/** Conversion utilities. - \ingroup util */ -class Utility -{ - /** - The Mersenne Twister - http://www.math.keio.ac.jp/~matumoto/emt.html - */ - class Rng { - public: - Rng(unsigned long seed); - - unsigned long Get(); - - private: - int m_value; - unsigned long m_tmp[TWIST_LEN]; - }; - class ncmap_compare { - public: - bool operator()(const std::string& x, const std::string& y) const { - return strcasecmp(x.c_str(), y.c_str()) < 0; - } - }; -public: - template class ncmap : public std::map { - public: - ncmap() {} - }; -public: - static std::string base64(const std::string& str_in); - static std::string base64d(const std::string& str_in); - static std::string l2string(long l); - static std::string bigint2string(uint64_t l); - static uint64_t atoi64(const std::string& str); - static unsigned int hex2unsigned(const std::string& str); - static std::string rfc1738_encode(const std::string& src); - static std::string rfc1738_decode(const std::string& src); - - /** Checks whether a string is a valid ipv4/ipv6 ip number. */ - static bool isipv4(const std::string&); - /** Checks whether a string is a valid ipv4/ipv6 ip number. */ - static bool isipv6(const std::string&); - - /** Hostname to ip resolution ipv4, not asynchronous. */ - static bool u2ip(const std::string&, ipaddr_t&); - static bool u2ip(const std::string&, struct sockaddr_in& sa, int ai_flags = 0); - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Hostname to ip resolution ipv6, not asynchronous. */ - static bool u2ip(const std::string&, struct in6_addr&); - static bool u2ip(const std::string&, struct sockaddr_in6& sa, int ai_flags = 0); -#endif -#endif - - /** Reverse lookup of address to hostname */ - static bool reverse(struct sockaddr *sa, socklen_t sa_len, std::string&, int flags = 0); - static bool reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, std::string& service, int flags = 0); - - static bool u2service(const std::string& name, int& service, int ai_flags = 0); - - /** Convert binary ip address to string: ipv4. */ - static void l2ip(const ipaddr_t,std::string& ); - static void l2ip(const in_addr&,std::string& ); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Convert binary ip address to string: ipv6. */ - static void l2ip(const struct in6_addr&,std::string& ,bool mixed = false); - - /** ipv6 address compare. */ - static int in6_addr_compare(in6_addr,in6_addr); -#endif -#endif - /** ResolveLocal (hostname) - call once before calling any GetLocal method. */ - static void ResolveLocal(); - /** Returns local hostname, ResolveLocal must be called once before using. - \sa ResolveLocal */ - static const std::string& GetLocalHostname(); - /** Returns local ip, ResolveLocal must be called once before using. - \sa ResolveLocal */ - static ipaddr_t GetLocalIP(); - /** Returns local ip number as string. - \sa ResolveLocal */ - static const std::string& GetLocalAddress(); -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - /** Returns local ipv6 ip. - \sa ResolveLocal */ - static const struct in6_addr& GetLocalIP6(); - /** Returns local ipv6 address. - \sa ResolveLocal */ - static const std::string& GetLocalAddress6(); -#endif -#endif - /** Set environment variable. - \param var Name of variable to set - \param value Value */ - static void SetEnv(const std::string& var,const std::string& value); - /** Convert sockaddr struct to human readable string. - \param sa Ptr to sockaddr struct */ - static std::string Sa2String(struct sockaddr *sa); - - /** Get current time in sec/microseconds. */ - static void GetTime(struct timeval *); - - static std::auto_ptr CreateAddress(struct sockaddr *,socklen_t); - - static unsigned long ThreadID(); - - static std::string ToLower(const std::string& str); - static std::string ToUpper(const std::string& str); - - static std::string ToString(double d); - - /** Returns a random 32-bit integer */ - static unsigned long Rnd(); - -private: - static std::string m_host; ///< local hostname - static ipaddr_t m_ip; ///< local ip address - static std::string m_addr; ///< local ip address in string format -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - static struct in6_addr m_local_ip6; ///< local ipv6 address -#endif - static std::string m_local_addr6; ///< local ipv6 address in string format -#endif - static bool m_local_resolved; ///< ResolveLocal has been called if true -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // _SOCKETS_Utility_H - - diff --git a/dep/include/sockets/socket_include.h b/dep/include/sockets/socket_include.h deleted file mode 100644 index 89855a54108..00000000000 --- a/dep/include/sockets/socket_include.h +++ /dev/null @@ -1,290 +0,0 @@ -/** \file socket_include.h - ** \date 2005-04-12 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_socket_include_H -#define _SOCKETS_socket_include_H -#include "sockets-config.h" - -#ifdef _MSC_VER -#pragma warning(disable:4514) -#endif - -// common defines affecting library and applications using library - -/* Define SOCKETS_DYNAMIC_TEMP to use dynamically allocated buffers - in read operations - helps on ECOS */ -#define SOCKETS_DYNAMIC_TEMP - -// platform specific stuff -#if (defined(__unix__) || defined(unix)) && !defined(USG) -#include -#endif -#include - -// int64 -#ifdef _WIN32 -typedef unsigned __int64 uint64_t; -#else -#include -#ifdef SOLARIS -# include -#else -# include -#endif -#endif - -#ifndef _WIN32 -// ---------------------------------------- -// common unix includes / defines -#include -#include -#include -#include -#include -#include -//#include - -// all typedefs in this file will be declared outside the sockets namespace, -// because some os's will already have one or more of the type defined. -typedef int SOCKET; -#define Errno errno -#define StrError strerror - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -// WIN32 adapt -#define closesocket close -#define INVALID_SOCKET -1 -#define SOCKET_ERROR -1 - -#ifndef INADDR_NONE -#define INADDR_NONE ((unsigned long) -1) -#endif // INADDR_NONE - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // !_WIN32 - -// ---------------------------------------- -// Generic -#ifndef SOL_IP -#define SOL_IP IPPROTO_IP -#endif - -// ---------------------------------------- -// OS specific adaptions - -#ifdef SOLARIS -// ---------------------------------------- -// Solaris -typedef unsigned short port_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#define s6_addr16 _S6_un._S6_u8 -#define MSG_NOSIGNAL 0 - -#elif defined __FreeBSD__ -// ---------------------------------------- -// FreeBSD -# if __FreeBSD_version >= 400014 -# define s6_addr16 __u6_addr.__u6_addr16 -# if !defined(MSG_NOSIGNAL) -# define MSG_NOSIGNAL 0 -# endif -# include -typedef in_addr_t ipaddr_t; -typedef in_port_t port_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP -# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP -# else -# error FreeBSD versions prior to 400014 does not support ipv6 -# endif - -#elif defined (__NetBSD__) || defined (__OpenBSD__) -# if !defined(MSG_NOSIGNAL) -# define MSG_NOSIGNAL 0 -# endif -# include -typedef in_addr_t ipaddr_t; -typedef in_port_t port_t; -#elif defined MACOSX -// ---------------------------------------- -// Mac OS X -#include -#ifdef __DARWIN_UNIX03 -typedef unsigned short port_t; -#else -#include -#endif // __DARWIN_UNIX03 -typedef unsigned long ipaddr_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#define s6_addr16 __u6_addr.__u6_addr16 -#define MSG_NOSIGNAL 0 // oops - thanks Derek -#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP -#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP - -#elif defined _WIN32 -// ---------------------------------------- -// Win32 -#ifdef _MSC_VER -#pragma comment(lib, "wsock32.lib") -#endif -#define strcasecmp _stricmp - -typedef unsigned long ipaddr_t; -typedef unsigned short port_t; -typedef int socklen_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -// 1.8.6: define FD_SETSIZE to something bigger than 64 if there are a lot of -// simultaneous connections (must be done before including winsock.h) -#define FD_SETSIZE 1024 - -// windows 2000 with ipv6 preview installed: -// http://msdn.microsoft.com/downloads/sdks/platform/tpipv6.asp -// see the FAQ on how to install -#define WIN32_LEAN_AND_MEAN -#include -#include -#if _MSC_VER < 1200 -#ifndef __CYGWIN__ -#ifdef ENABLE_IPV6 -#include // For IPv6 Tech Preview. -#endif -#endif -#endif // _MSC_VER < 1200 - -#define MSG_NOSIGNAL 0 -//#define SHUT_RDWR 2 -#define SHUT_WR 1 - -#define Errno WSAGetLastError() -const char *StrError(int x); - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -// class WSAInitializer is a part of the Socket class (on win32) -// as a static instance - so whenever an application uses a Socket, -// winsock is initialized -class WSAInitializer // Winsock Initializer -{ -public: - WSAInitializer() { - if (WSAStartup(0x101,&m_wsadata)) - { - exit(-1); - } - } - ~WSAInitializer() { - WSACleanup(); - } -private: - WSADATA m_wsadata; -}; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#else -// ---------------------------------------- -// LINUX -typedef unsigned long ipaddr_t; -typedef unsigned short port_t; -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif -// no defs - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - /** List type containing file descriptors. */ - typedef std::list socket_v; - -#ifdef SOCKETS_NAMESPACE -} -#endif - -// getaddrinfo / getnameinfo replacements -#ifdef NO_GETADDRINFO -#ifndef AI_NUMERICHOST -#define AI_NUMERICHOST 1 -#endif -#ifndef NI_NUMERICHOST -#define NI_NUMERICHOST 1 -#endif -#endif - -#endif // _SOCKETS_socket_include_H - - diff --git a/dep/include/sockets/sockets-config.h b/dep/include/sockets/sockets-config.h deleted file mode 100644 index 1c8dc439092..00000000000 --- a/dep/include/sockets/sockets-config.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - ** \file sockets-config.h - ** \date 2007-04-14 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifndef _SOCKETS_CONFIG_H -#define _SOCKETS_CONFIG_H - -#ifndef _RUN_DP -/* First undefine symbols if already defined. */ -#undef HAVE_OPENSSL -#undef ENABLE_IPV6 -#undef USE_SCTP -#undef NO_GETADDRINFO -#undef ENABLE_POOL -#undef ENABLE_SOCKS4 -#undef ENABLE_RESOLVER -#undef ENABLE_RECONNECT -#undef ENABLE_DETACH -#undef ENABLE_TRIGGERS -#undef ENABLE_EXCEPTIONS -#endif // _RUN_DP - -// define MACOSX for internal socket library checks -#if defined(__APPLE__) && defined(__MACH__) && !defined(MACOSX) -#define MACOSX -#endif - -/* OpenSSL support. */ -//#define HAVE_OPENSSL - -/* Ipv6 support. */ -//#define ENABLE_IPV6 - -/* SCTP support. */ -//#define USE_SCTP - -/* Define NO_GETADDRINFO if your operating system does not support - the "getaddrinfo" and "getnameinfo" function calls. */ -#define NO_GETADDRINFO - -/* Connection pool support. */ -#define ENABLE_POOL - -/* Socks4 client support. */ -//#define ENABLE_SOCKS4 - -/* Asynchronous resolver. */ -#define ENABLE_RESOLVER - -/* Enable TCP reconnect on lost connection. - Socket::OnReconnect - Socket::OnDisconnect -*/ -#define ENABLE_RECONNECT - -/* Enable socket thread detach functionality. */ -#define ENABLE_DETACH - -/* Enable socket to socket triggers. Not yet in use. */ -//#define ENABLE_TRIGGERS - -/* Enabled exceptions. */ -//#define ENABLE_EXCEPTIONS - -/* Resolver uses the detach function so either enable both or disable both. */ -#ifndef ENABLE_DETACH -#undef ENABLE_RESOLVER -#endif - -#endif // _SOCKETS_CONFIG_H - - diff --git a/dep/include/utf8cpp/doc/ReleaseNotes b/dep/include/utf8cpp/doc/ReleaseNotes deleted file mode 100644 index 8541c7a6031..00000000000 --- a/dep/include/utf8cpp/doc/ReleaseNotes +++ /dev/null @@ -1,9 +0,0 @@ -utf8 cpp library -Release 2.1 - -This is a minor feature release - added the function peek_next. - -Changes from version 2.o -- Implemented feature request [ 1770746 ] "Provide a const version of next() (some sort of a peek() ) - -Files included in the release: utf8.h, core.h, checked.h, unchecked.h, utf8cpp.html, ReleaseNotes diff --git a/dep/include/utf8cpp/doc/utf8cpp.html b/dep/include/utf8cpp/doc/utf8cpp.html deleted file mode 100644 index 4ad7e1002a9..00000000000 --- a/dep/include/utf8cpp/doc/utf8cpp.html +++ /dev/null @@ -1,1574 +0,0 @@ - - - - - - - - - UTF8-CPP: UTF-8 with C++ in a Portable Way - - - - -

- UTF8-CPP: UTF-8 with C++ in a Portable Way -

-

- The Sourceforge project page -

- -

- Introduction -

-

- Many C++ developers miss an easy and portable way of handling Unicode encoded - strings. C++ Standard is currently Unicode agnostic, and while some work is being - done to introduce Unicode to the next incarnation called C++0x, for the moment - nothing of the sort is available. In the meantime, developers use 3rd party - libraries like ICU, OS specific capabilities, or simply roll out their own - solutions. -

-

- In order to easily handle UTF-8 encoded Unicode strings, I have come up with a small - generic library. For anybody used to work with STL algorithms and iterators, it should be - easy and natural to use. The code is freely available for any purpose - check out - the license at the beginning of the utf8.h file. If you run into - bugs or performance issues, please let me know and I'll do my best to address them. -

-

- The purpose of this article is not to offer an introduction to Unicode in general, - and UTF-8 in particular. If you are not familiar with Unicode, be sure to check out - Unicode Home Page or some other source of - information for Unicode. Also, it is not my aim to advocate the use of UTF-8 - encoded strings in C++ programs; if you want to handle UTF-8 encoded strings from - C++, I am sure you have good reasons for it. -

-

- Examples of use -

-

- To illustrate the use of this utf8 library, we shall open a file containing UTF-8 - encoded text, check whether it starts with a byte order mark, read each line into a - std::string, check it for validity, convert the text to UTF-16, and - back to UTF-8: -

-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-#include "utf8.h"
-using namespace std;
-int main()
-{
-    if (argc != 2) {
-        cout << "\nUsage: docsample filename\n";
-        return 0;
-    }
-    const char* test_file_path = argv[1];
-    // Open the test file (must be UTF-8 encoded)
-    ifstream fs8(test_file_path);
-    if (!fs8.is_open()) {
-    cout << "Could not open " << test_file_path << endl;
-    return 0;
-    }
-    // Read the first line of the file
-    unsigned line_count = 1;
-    string line;
-    if (!getline(fs8, line)) 
-        return 0;
-    // Look for utf-8 byte-order mark at the beginning
-    if (line.size() > 2) {
-        if (utf8::is_bom(line.c_str()))
-            cout << "There is a byte order mark at the beginning of the file\n";
-    }
-    // Play with all the lines in the file
-    do {
-       // check for invalid utf-8 (for a simple yes/no check, there is also utf8::is_valid function)
-        string::iterator end_it = utf8::find_invalid(line.begin(), line.end());
-        if (end_it != line.end()) {
-            cout << "Invalid UTF-8 encoding detected at line " << line_count << "\n";
-            cout << "This part is fine: " << string(line.begin(), end_it) << "\n";
-        }
-        // Get the line length (at least for the valid part)
-        int length = utf8::distance(line.begin(), end_it);
-        cout << "Length of line " << line_count << " is " << length <<  "\n";
-        // Convert it to utf-16
-        vector<unsigned short> utf16line;
-        utf8::utf8to16(line.begin(), end_it, back_inserter(utf16line));
-        // And back to utf-8
-        string utf8line; 
-        utf8::utf16to8(utf16line.begin(), utf16line.end(), back_inserter(utf8line));
-        // Confirm that the conversion went OK:
-        if (utf8line != string(line.begin(), end_it))
-            cout << "Error in UTF-16 conversion at line: " << line_count << "\n";        
-        getline(fs8, line);
-        line_count++;
-    } while (!fs8.eof());
-    return 0;
-}
-
-

- In the previous code sample, we have seen the use of the following functions from - utf8 namespace: first we used is_bom function to detect - UTF-8 byte order mark at the beginning of the file; then for each line we performed - a detection of invalid UTF-8 sequences with find_invalid; the number - of characters (more precisely - the number of Unicode code points) in each line was - determined with a use of utf8::distance; finally, we have converted - each line to UTF-16 encoding with utf8to16 and back to UTF-8 with - utf16to8. -

-

- Reference -

-

- Functions From utf8 Namespace -

-

- utf8::append -

-

- Available in version 1.0 and later. -

-

- Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence - to a UTF-8 string. -

-
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-   
-
-

- cp: A 32 bit integer representing a code point to append to the - sequence.
- result: An output iterator to the place in the sequence where to - append the code point.
- Return value: An iterator pointing to the place - after the newly appended sequence. -

-

- Example of use: -

-
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-
-

- Note that append does not allocate any memory - it is the burden of - the caller to make sure there is enough memory allocated for the operation. To make - things more interesting, append can add anywhere between 1 and 4 - octets to the sequence. In practice, you would most often want to use - std::back_inserter to ensure that the necessary memory is allocated. -

-

- In case of an invalid code point, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::next -

-

- Available in version 1.0 and later. -

-

- Given the iterator to the beginning of the UTF-8 sequence, it returns the code - point and moves the iterator to the next position. -

-
-template <typename octet_iterator> 
-uint32_t next(octet_iterator& it, octet_iterator end);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - beginning of the next code point.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-
-

- This function is typically used to iterate through a UTF-8 encoded string. -

-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. -

-

- utf8::peek_next -

-

- Available in version 2.1 and later. -

-

- Given the iterator to the beginning of the UTF-8 sequence, it returns the code - point for the following sequence without changing the value of the iterator. -

-
-template <typename octet_iterator> 
-uint32_t peek_next(octet_iterator it, octet_iterator end);
-   
-
-

- it: an iterator pointing to the beginning of an UTF-8 - encoded code point.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = peek_next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. -

-

- utf8::prior -

-

- Available in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator> 
-uint32_t prior(octet_iterator& it, octet_iterator start);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- start: an iterator to the beginning of the sequence where the search - for the beginning of a code point is performed. It is a - safety measure to prevent passing the beginning of the string in the search for a - UTF-8 lead octet.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = prior (w, twochars);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This function has two purposes: one is two iterate backwards through a UTF-8 - encoded string. Note that it is usually a better idea to iterate forward instead, - since utf8::next is faster. The second purpose is to find a beginning - of a UTF-8 sequence if we have a random position within a string. -

-

- it will typically point to the beginning of - a code point, and start will point to the - beginning of the string to ensure we don't go backwards too far. it is - decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence - beginning with that octet is decoded to a 32 bit representation and returned. -

-

- In case pass_end is reached before a UTF-8 lead octet is hit, or if an - invalid UTF-8 sequence is started by the lead octet, an invalid_utf8 - exception is thrown. -

-

- utf8::previous -

-

- Deprecated in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator> 
-uint32_t previous(octet_iterator& it, octet_iterator pass_start);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- pass_start: an iterator to the point in the sequence where the search - for the beginning of a code point is aborted if no result was reached. It is a - safety measure to prevent passing the beginning of the string in the search for a - UTF-8 lead octet.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = previous (w, twochars - 1);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- utf8::previous is deprecated, and utf8::prior should - be used instead, although the existing code can continue using this function. - The problem is the parameter pass_start that points to the position - just before the beginning of the sequence. Standard containers don't have the - concept of "pass start" and the function can not be used with their iterators. -

-

- it will typically point to the beginning of - a code point, and pass_start will point to the octet just before the - beginning of the string to ensure we don't go backwards too far. it is - decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence - beginning with that octet is decoded to a 32 bit representation and returned. -

-

- In case pass_end is reached before a UTF-8 lead octet is hit, or if an - invalid UTF-8 sequence is started by the lead octet, an invalid_utf8 - exception is thrown -

-

- utf8::advance -

-

- Available in version 1.0 and later. -

-

- Advances an iterator by the specified number of code points within an UTF-8 - sequence. -

-
-template <typename octet_iterator, typename distance_type> 
-void advance (octet_iterator& it, distance_type n, octet_iterator end);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - nth following code point.
- n: a positive integer that shows how many code points we want to - advance.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
-

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars;
-advance (w, 2, twochars + 6);
-assert (w == twochars + 5);
-
-

- This function works only "forward". In case of a negative n, there is - no effect. -

-

- In case of an invalid code point, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::distance -

-

- Available in version 1.0 and later. -

-

- Given the iterators to two UTF-8 encoded code points in a seqence, returns the - number of code points between them. -

-
-template <typename octet_iterator> 
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-   
-
-

- first: an iterator to a beginning of a UTF-8 encoded code point.
- last: an iterator to a "post-end" of the last UTF-8 encoded code - point in the sequence we are trying to determine the length. It can be the - beginning of a new code point, or not.
- Return value the distance between the iterators, - in code points. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::distance(twochars, twochars + 5);
-assert (dist == 2);
-
-

- This function is used to find the length (in code points) of a UTF-8 encoded - string. The reason it is called distance, rather than, say, - length is mainly because developers are used that length is an - O(1) function. Computing the length of an UTF-8 string is a linear operation, and - it looked better to model it after std::distance algorithm. -

-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If last does not point to the past-of-end of a UTF-8 seqence, - a utf8::not_enough_room exception is thrown. -

-

- utf8::utf16to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-16 encoded string to UTF-8. -

-
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-16 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-16 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);    
-
-

- In case of invalid UTF-16 sequence, a utf8::invalid_utf16 exception is - thrown. -

-

- utf8::utf8to16 -

-

- Available in version 1.0 and later. -

-

- Converts an UTF-8 encoded string to UTF-16 -

-
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert. < br /> end: an iterator pointing to - pass-the-end of the UTF-8 encoded string to convert.
- result: an output iterator to the place in the UTF-16 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-16 string. -

-

- Example of use: -

-
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If end does not point to the past-of-end of a UTF-8 seqence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::utf32to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-32 encoded string to UTF-8. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-32 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-32 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-int utf32string[] = {0x448, 0x65E5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-
-

- In case of invalid UTF-32 string, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::utf8to32 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-8 encoded string to UTF-32. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-8 encoded string - to convert.
- result: an output iterator to the place in the UTF-32 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-32 string. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If end does not point to the past-of-end of a UTF-8 seqence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::find_invalid -

-

- Available in version 1.0 and later. -

-

- Detects an invalid sequence within a UTF-8 string. -

-
-template <typename octet_iterator> 
-octet_iterator find_invalid(octet_iterator start, octet_iterator end);
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - test for validity.
- end: an iterator pointing to pass-the-end of the UTF-8 string to test - for validity.
- Return value: an iterator pointing to the first - invalid octet in the UTF-8 string. In case none were found, equals - end. -

-

- Example of use: -

-
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-char* invalid = find_invalid(utf_invalid, utf_invalid + 6);
-assert (invalid == utf_invalid + 5);
-
-

- This function is typically used to make sure a UTF-8 string is valid before - processing it with other functions. It is especially important to call it if before - doing any of the unchecked operations on it. -

-

- utf8::is_valid -

-

- Available in version 1.0 and later. -

-

- Checks whether a sequence of octets is a valid UTF-8 string. -

-
-template <typename octet_iterator> 
-bool is_valid(octet_iterator start, octet_iterator end);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - test for validity.
- end: an iterator pointing to pass-the-end of the UTF-8 string to test - for validity.
- Return value: true if the sequence - is a valid UTF-8 string; false if not. -

- Example of use: -
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-bool bvalid = is_valid(utf_invalid, utf_invalid + 6);
-assert (bvalid == false);
-
-

- is_valid is a shorthand for find_invalid(start, end) == - end;. You may want to use it to make sure that a byte seqence is a valid - UTF-8 string without the need to know where it fails if it is not valid. -

-

- utf8::replace_invalid -

-

- Available in version 2.0 and later. -

-

- Replaces all invalid UTF-8 sequences within a string with a replacement marker. -

-
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement);
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - look for invalid UTF-8 sequences.
- end: an iterator pointing to pass-the-end of the UTF-8 string to look - for invalid UTF-8 sequences.
- out: An output iterator to the range where the result of replacement - is stored.
- replacement: A Unicode code point for the replacement marker. The - version without this parameter assumes the value 0xfffd
- Return value: An iterator pointing to the place - after the UTF-8 string with replaced invalid sequences. -

-

- Example of use: -

-
-char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-vector<char> replace_invalid_result;
-replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), back_inserter(replace_invalid_result), '?');
-bvalid = is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
-assert (bvalid);
-char* fixed_invalid_sequence = "a????z";
-assert (std::equal(replace_invalid_result.begin(), replace_invalid_result.end(), fixed_invalid_sequence));
-
-

- replace_invalid does not perform in-place replacement of invalid - sequences. Rather, it produces a copy of the original string with the invalid - sequences replaced with a replacement marker. Therefore, out must not - be in the [start, end] range. -

-

- If end does not point to the past-of-end of a UTF-8 sequence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::is_bom -

-

- Available in version 1.0 and later. -

-

- Checks whether a sequence of three octets is a UTF-8 byte order mark (BOM) -

-
-template <typename octet_iterator> 
-bool is_bom (octet_iterator it);
-
-

- it: beginning of the 3-octet sequence to check
- Return value: true if the sequence - is UTF-8 byte order mark; false if not. -

-

- Example of use: -

-
-unsigned char byte_order_mark[] = {0xef, 0xbb, 0xbf};
-bool bbom = is_bom(byte_order_mark);
-assert (bbom == true);
-
-

- The typical use of this function is to check the first three bytes of a file. If - they form the UTF-8 BOM, we want to skip them before processing the actual UTF-8 - encoded text. -

-

- Types From utf8 Namespace -

-

- utf8::iterator -

-

- Available in version 2.0 and later. -

-

- Adapts the underlying octet iterator to iterate over the sequence of code points, - rather than raw octets. -

-
-template <typename octet_iterator>
-class iterator;
-
- -
Member functions
-
-
iterator();
the deafult constructor; the underlying octet_iterator is - constructed with its default constructor. -
explicit iterator (const octet_iterator& octet_it, - const octet_iterator& range_start, - const octet_iterator& range_end);
a constructor - that initializes the underlying octet_iterator with octet_it - and sets the range in which the iterator is considered valid. -
octet_iterator base () const;
returns the - underlying octet_iterator. -
uint32_t operator * () const;
decodes the utf-8 sequence - the underlying octet_iterator is pointing to and returns the code point. -
bool operator == (const iterator& rhs) - const;
returns true - if the two underlaying iterators are equal. -
bool operator != (const iterator& rhs) - const;
returns true - if the two underlaying iterators are not equal. -
iterator& operator ++ ();
the prefix increment - moves - the iterator to the next UTF-8 encoded code point. -
iterator operator ++ (int);
- the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one. -
iterator& operator -- ();
the prefix decrement - moves - the iterator to the previous UTF-8 encoded code point. -
iterator operator -- (int);
- the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one. -
-

- Example of use: -

-
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::iterator<char*> it(threechars, threechars, threechars + 9);
-utf8::iterator<char*> it2 = it;
-assert (it2 == it);
-assert (*it == 0x10346);
-assert (*(++it) == 0x65e5);
-assert ((*it++) == 0x65e5);
-assert (*it == 0x0448);
-assert (it != it2);
-utf8::iterator<char*> endit (threechars + 9, threechars, threechars + 9);  
-assert (++it == endit);
-assert (*(--it) == 0x0448);
-assert ((*it--) == 0x0448);
-assert (*it == 0x65e5);
-assert (--it == utf8::iterator<char*>(threechars, threechars, threechars + 9));
-assert (*it == 0x10346);
-
-

- The purpose of utf8::iterator adapter is to enable easy iteration as well as the use of STL - algorithms with UTF-8 encoded strings. Increment and decrement operators are implemented in terms of - utf8::next() and utf8::prior() functions. -

-

- Note that utf8::iterator adapter is a checked iterator. It operates on the range specified in - the constructor; any attempt to go out of that range will result in an exception. Even the comparison operators - require both iterator object to be constructed against the same range - otherwise an exception is thrown. Typically, - the range will be determined by sequence container functions begin and end, i.e.: -

-
-std::string s = "example";
-utf8::iterator i (s.begin(), s.begin(), s.end());
-
-

- Functions From utf8::unchecked Namespace -

-

- utf8::unchecked::append -

-

- Available in version 1.0 and later. -

-

- Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence - to a UTF-8 string. -

-
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-   
-
-

- cp: A 32 bit integer representing a code point to append to the - sequence.
- result: An output iterator to the place in the sequence where to - append the code point.
- Return value: An iterator pointing to the place - after the newly appended sequence. -

-

- Example of use: -

-
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = unchecked::append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-
-

- This is a faster but less safe version of utf8::append. It does not - check for validity of the supplied code point, and may produce an invalid UTF-8 - sequence. -

-

- utf8::unchecked::next -

-

- Available in version 1.0 and later. -

-

- Given the iterator to the beginning of a UTF-8 sequence, it returns the code point - and moves the iterator to the next position. -

-
-template <typename octet_iterator>
-uint32_t next(octet_iterator& it);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - beginning of the next code point.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::next(w);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-
-

- This is a faster but less safe version of utf8::next. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::peek_next -

-

- Available in version 2.1 and later. -

-

- Given the iterator to the beginning of a UTF-8 sequence, it returns the code point. -

-
-template <typename octet_iterator>
-uint32_t peek_next(octet_iterator it);
-   
-
-

- it: an iterator pointing to the beginning of an UTF-8 - encoded code point.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::peek_next(w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This is a faster but less safe version of utf8::peek_next. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::prior -

-

- Available in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator>
-uint32_t prior(octet_iterator& it);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::prior (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This is a faster but less safe version of utf8::prior. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::previous (deprecated, see utf8::unchecked::prior) -

-

- Deprecated in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator>
-uint32_t previous(octet_iterator& it);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::previous (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- The reason this function is deprecated is just the consistency with the "checked" - versions, where prior should be used instead of previous. - In fact, unchecked::previous behaves exactly the same as - unchecked::prior -

-

- This is a faster but less safe version of utf8::previous. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::advance -

-

- Available in version 1.0 and later. -

-

- Advances an iterator by the specified number of code points within an UTF-8 - sequence. -

-
-template <typename octet_iterator, typename distance_type>
-void advance (octet_iterator& it, distance_type n);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - nth following code point.
- n: a positive integer that shows how many code points we want to - advance.
-

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-unchecked::advance (w, 2);
-assert (w == twochars + 5);
-
-

- This function works only "forward". In case of a negative n, there is - no effect. -

-

- This is a faster but less safe version of utf8::advance. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::distance -

-

- Available in version 1.0 and later. -

-

- Given the iterators to two UTF-8 encoded code points in a seqence, returns the - number of code points between them. -

-
-template <typename octet_iterator>
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-
-

- first: an iterator to a beginning of a UTF-8 encoded code point.
- last: an iterator to a "post-end" of the last UTF-8 encoded code - point in the sequence we are trying to determine the length. It can be the - beginning of a new code point, or not.
- Return value the distance between the iterators, - in code points. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::unchecked::distance(twochars, twochars + 5);
-assert (dist == 2);
-
-

- This is a faster but less safe version of utf8::distance. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::utf16to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-16 encoded string to UTF-8. -

-
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-16 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-16 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-unchecked::utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);    
-
-

- This is a faster but less safe version of utf8::utf16to8. It does not - check for validity of the supplied UTF-16 sequence. -

-

- utf8::unchecked::utf8to16 -

-

- Available in version 1.0 and later. -

-

- Converts an UTF-8 encoded string to UTF-16 -

-
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert. < br /> end: an iterator pointing to - pass-the-end of the UTF-8 encoded string to convert.
- result: an output iterator to the place in the UTF-16 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-16 string. -

-

- Example of use: -

-
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-unchecked::utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-
-

- This is a faster but less safe version of utf8::utf8to16. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::utf32to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-32 encoded string to UTF-8. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-32 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-32 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-int utf32string[] = {0x448, 0x65e5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-
-

- This is a faster but less safe version of utf8::utf32to8. It does not - check for validity of the supplied UTF-32 sequence. -

-

- utf8::unchecked::utf8to32 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-8 encoded string to UTF-32. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-8 encoded string - to convert.
- result: an output iterator to the place in the UTF-32 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-32 string. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-unchecked::utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-
-

- This is a faster but less safe version of utf8::utf8to32. It does not - check for validity of the supplied UTF-8 sequence. -

-

- Types From utf8::unchecked Namespace -

-

- utf8::iterator -

-

- Available in version 2.0 and later. -

-

- Adapts the underlying octet iterator to iterate over the sequence of code points, - rather than raw octets. -

-
-template <typename octet_iterator>
-class iterator;
-
- -
Member functions
-
-
iterator();
the deafult constructor; the underlying octet_iterator is - constructed with its default constructor. -
explicit iterator (const octet_iterator& octet_it); -
a constructor - that initializes the underlying octet_iterator with octet_it -
octet_iterator base () const;
returns the - underlying octet_iterator. -
uint32_t operator * () const;
decodes the utf-8 sequence - the underlying octet_iterator is pointing to and returns the code point. -
bool operator == (const iterator& rhs) - const;
returns true - if the two underlaying iterators are equal. -
bool operator != (const iterator& rhs) - const;
returns true - if the two underlaying iterators are not equal. -
iterator& operator ++ ();
the prefix increment - moves - the iterator to the next UTF-8 encoded code point. -
iterator operator ++ (int);
- the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one. -
iterator& operator -- ();
the prefix decrement - moves - the iterator to the previous UTF-8 encoded code point. -
iterator operator -- (int);
- the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one. -
-

- Example of use: -

-
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::unchecked::iterator<char*> un_it(threechars);
-utf8::unchecked::iterator<char*> un_it2 = un_it;
-assert (un_it2 == un_it);
-assert (*un_it == 0x10346);
-assert (*(++un_it) == 0x65e5);
-assert ((*un_it++) == 0x65e5);
-assert (*un_it == 0x0448);
-assert (un_it != un_it2);
-utf8::::unchecked::iterator<char*> un_endit (threechars + 9);  
-assert (++un_it == un_endit);
-assert (*(--un_it) == 0x0448);
-assert ((*un_it--) == 0x0448);
-assert (*un_it == 0x65e5);
-assert (--un_it == utf8::unchecked::iterator<char*>(threechars));
-assert (*un_it == 0x10346);
-
-

- This is an unchecked version of utf8::iterator. It is faster in many cases, but offers - no validity or range checks. -

-

- Points of interest -

-

- Design goals and decisions -

-

- The library was designed to be: -

-
    -
  1. - Generic: for better or worse, there are many C++ string classes out there, and - the library should work with as many of them as possible. -
  2. -
  3. - Portable: the library should be portable both accross different platforms and - compilers. The only non-portable code is a small section that declares unsigned - integers of different sizes: three typedefs. They can be changed by the users of - the library if they don't match their platform. The default setting should work - for Windows (both 32 and 64 bit), and most 32 bit and 64 bit Unix derivatives. -
  4. -
  5. - Lightweight: follow the "pay only for what you use" guidline. -
  6. -
  7. - Unintrusive: avoid forcing any particular design or even programming style on the - user. This is a library, not a framework. -
  8. -
-

- Alternatives -

-

- In case you want to look into other means of working with UTF-8 strings from C++, - here is the list of solutions I am aware of: -

-
    -
  1. - ICU Library. It is very powerful, - complete, feature-rich, mature, and widely used. Also big, intrusive, - non-generic, and doesn't play well with the Standard Library. I definitelly - recommend looking at ICU even if you don't plan to use it. -
  2. -
  3. - Glib::ustring. - A class specifically made to work with UTF-8 strings, and also feel like - std::string. If you prefer to have yet another string class in your - code, it may be worth a look. Be aware of the licensing issues, though. -
  4. -
  5. - Platform dependent solutions: Windows and POSIX have functions to convert strings - from one encoding to another. That is only a subset of what my library offers, - but if that is all you need it may be good enough, especially given the fact that - these functions are mature and tested in production. -
  6. -
-

- Conclusion -

-

- Until Unicode becomes officially recognized by the C++ Standard Library, we need to - use other means to work with UTF-8 strings. Template functions I describe in this - article may be a good step in this direction. -

- -
    -
  1. - The Unicode Consortium. -
  2. -
  3. - ICU Library. -
  4. -
  5. - UTF-8 at Wikipedia -
  6. -
  7. - UTF-8 and Unicode FAQ for - Unix/Linux -
  8. -
- - diff --git a/dep/include/vld/vld.h b/dep/include/vld/vld.h deleted file mode 100644 index 72bebd8c4f6..00000000000 --- a/dep/include/vld/vld.h +++ /dev/null @@ -1,105 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// $Id: vld.h,v 1.27 2006/11/12 18:09:20 dmouldin Exp $ -// -// Visual Leak Detector (Version 1.9d) - Import Library Header -// Copyright (c) 2006 Dan Moulding -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// -// See COPYING.txt for the full terms of the GNU Lesser General Public License. -// -//////////////////////////////////////////////////////////////////////////////// - -//#pragma once -#ifndef _VLD_H_ -#define _VLD_H_ - -#ifdef _DEBUG - -#pragma comment(lib, "vld.lib") - -// Force a symbolic reference to the global VisualLeakDetector class object from -// the DLL. This enusres that the DLL is loaded and linked with the program, -// even if no code otherwise imports any of the DLL's exports. -#pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A") - -//////////////////////////////////////////////////////////////////////////////// -// -// Visual Leak Detector APIs -// - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// VLDDisable - Disables Visual Leak Detector's memory leak detection at -// runtime. If memory leak detection is already disabled, then calling this -// function has no effect. -// -// Note: In multithreaded programs, this function operates on a per-thread -// basis. In other words, if you call this function from one thread, then -// memory leak detection is only disabled for that thread. If memory leak -// detection is enabled for other threads, then it will remain enabled for -// those other threads. It was designed to work this way to insulate you, -// the programmer, from having to ensure thread synchronization when calling -// VLDEnable() and VLDDisable(). Without this, calling these two functions -// unsychronized could result in unpredictable and unintended behavior. -// But this also means that if you want to disable memory leak detection -// process-wide, then you need to call this function from every thread in -// the process. -// -// Return Value: -// -// None. -// - -__declspec(dllimport) void VLDDisable (); - -// VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime. -// If memory leak detection is already enabled, which it is by default, then -// calling this function has no effect. -// -// Note: In multithreaded programs, this function operates on a per-thread -// basis. In other words, if you call this function from one thread, then -// memory leak detection is only enabled for that thread. If memory leak -// detection is disabled for other threads, then it will remain disabled for -// those other threads. It was designed to work this way to insulate you, -// the programmer, from having to ensure thread synchronization when calling -// VLDEnable() and VLDDisable(). Without this, calling these two functions -// unsychronized could result in unpredictable and unintended behavior. -// But this also means that if you want to enable memory leak detection -// process-wide, then you need to call this function from every thread in -// the process. -// -// Return Value: -// -// None. -// - -__declspec(dllimport) void VLDEnable (); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#else // !_DEBUG - -#define VLDEnable() -#define VLDDisable() - -#endif // _DEBUG - -#endif // _VLD_H_ - diff --git a/dep/include/zlib/zconf.h b/dep/include/zlib/zconf.h deleted file mode 100644 index 719855a60d4..00000000000 --- a/dep/include/zlib/zconf.h +++ /dev/null @@ -1,333 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ - diff --git a/dep/include/zlib/zlib.h b/dep/include/zlib/zlib.h deleted file mode 100644 index 2ad74617098..00000000000 --- a/dep/include/zlib/zlib.h +++ /dev/null @@ -1,1358 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ - diff --git a/dep/src/CMakeLists.txt b/dep/src/CMakeLists.txt deleted file mode 100644 index a2b27016ce1..00000000000 --- a/dep/src/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_subdirectory(g3dlite) -if (NOT MACOSX) -add_subdirectory(jmalloc) -endif(NOT MACOSX) -add_subdirectory(sockets) -add_subdirectory(zlib) - - -########### install files ############### \ No newline at end of file diff --git a/dep/src/ace/Cleanup.cpp b/dep/src/ace/Cleanup.cpp deleted file mode 100644 index e7736972678..00000000000 --- a/dep/src/ace/Cleanup.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// $Id: Cleanup.cpp 80826 2008-03-04 14:51:23Z wotte $ - -#include "ace/Cleanup.h" - -ACE_RCSID (ace, - Cleanup, - "$Id: Cleanup.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (ACE_HAS_INLINED_OSCALLS) -# include "ace/Cleanup.inl" -#endif /* ACE_HAS_INLINED_OSCALLS */ - -#include "ace/OS_Memory.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -void -ACE_Cleanup::cleanup (void *) -{ - delete this; -} - -ACE_Cleanup::~ACE_Cleanup (void) -{ -} - -/*****************************************************************************/ - -extern "C" void -ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *object, void *param) -{ - object->cleanup (param); -} - -/*****************************************************************************/ - -ACE_Cleanup_Info::ACE_Cleanup_Info (void) - : object_ (0), - cleanup_hook_ (0), - param_ (0) -{ -} - -bool -ACE_Cleanup_Info::operator== (const ACE_Cleanup_Info &o) const -{ - return o.object_ == this->object_ - && o.cleanup_hook_ == this->cleanup_hook_ - && o.param_ == this->param_; -} - -bool -ACE_Cleanup_Info::operator!= (const ACE_Cleanup_Info &o) const -{ - return !(*this == o); -} - -/*****************************************************************************/ - -/** - * @class ACE_Cleanup_Info_Node - * - * @brief For maintaining a list of ACE_Cleanup_Info items. - * - * For internal use by ACE_Object_Manager. - */ -class ACE_Cleanup_Info_Node -{ -public: - ACE_Cleanup_Info_Node (void); - ACE_Cleanup_Info_Node (const ACE_Cleanup_Info &new_info, - ACE_Cleanup_Info_Node *next); - ~ACE_Cleanup_Info_Node (void); - ACE_Cleanup_Info_Node *insert (const ACE_Cleanup_Info &); -private: - ACE_Cleanup_Info cleanup_info_; - ACE_Cleanup_Info_Node *next_; - - friend class ACE_OS_Exit_Info; -}; - -ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void) - : cleanup_info_ (), - next_ (0) -{ -} - -ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (const ACE_Cleanup_Info &new_info, - ACE_Cleanup_Info_Node *next) - : cleanup_info_ (new_info), - next_ (next) -{ -} - -ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void) -{ - delete next_; -} - -ACE_Cleanup_Info_Node * -ACE_Cleanup_Info_Node::insert (const ACE_Cleanup_Info &new_info) -{ - ACE_Cleanup_Info_Node *new_node = 0; - - ACE_NEW_RETURN (new_node, - ACE_Cleanup_Info_Node (new_info, this), - 0); - - return new_node; -} - -/*****************************************************************************/ - -ACE_OS_Exit_Info::ACE_OS_Exit_Info (void) -{ - ACE_NEW (registered_objects_, ACE_Cleanup_Info_Node); -} - -ACE_OS_Exit_Info::~ACE_OS_Exit_Info (void) -{ - delete registered_objects_; - registered_objects_ = 0; -} - -int -ACE_OS_Exit_Info::at_exit_i (void *object, - ACE_CLEANUP_FUNC cleanup_hook, - void *param) -{ - ACE_Cleanup_Info new_info; - new_info.object_ = object; - new_info.cleanup_hook_ = cleanup_hook; - new_info.param_ = param; - - // Return -1 and sets errno if unable to allocate storage. Enqueue - // at the head and dequeue from the head to get LIFO ordering. - - ACE_Cleanup_Info_Node *new_node = 0; - - if ((new_node = registered_objects_->insert (new_info)) == 0) - return -1; - else - { - registered_objects_ = new_node; - return 0; - } -} - -int -ACE_OS_Exit_Info::find (void *object) -{ - // Check for already in queue, and return 1 if so. - for (ACE_Cleanup_Info_Node *iter = registered_objects_; - iter && iter->next_ != 0; - iter = iter->next_) - { - if (iter->cleanup_info_.object_ == object) - { - // The object has already been registered. - return 1; - } - } - - return 0; -} - -void -ACE_OS_Exit_Info::call_hooks (void) -{ - // Call all registered cleanup hooks, in reverse order of - // registration. - for (ACE_Cleanup_Info_Node *iter = registered_objects_; - iter && iter->next_ != 0; - iter = iter->next_) - { - ACE_Cleanup_Info &info = iter->cleanup_info_; - if (info.cleanup_hook_ == reinterpret_cast ( - ACE_CLEANUP_DESTROYER_NAME)) - // The object is an ACE_Cleanup. - ACE_CLEANUP_DESTROYER_NAME ( - reinterpret_cast (info.object_), - info.param_); - else if (info.object_ == &ace_exit_hook_marker) - // The hook is an ACE_EXIT_HOOK. - (* reinterpret_cast (info.cleanup_hook_)) (); - else - (*info.cleanup_hook_) (info.object_, info.param_); - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/ace/String_Base.cpp b/dep/src/ace/String_Base.cpp deleted file mode 100644 index c3e95187625..00000000000 --- a/dep/src/ace/String_Base.cpp +++ /dev/null @@ -1,564 +0,0 @@ -// $Id: String_Base.cpp 81138 2008-03-28 09:18:15Z johnnyw $ - -#ifndef ACE_STRING_BASE_CPP -#define ACE_STRING_BASE_CPP - -#include "ace/ACE.h" -#include "ace/Malloc_Base.h" -#include "ace/String_Base.h" -#include "ace/Auto_Ptr.h" -#include "ace/OS_NS_string.h" - -#include // For std::swap<> - -#if !defined (__ACE_INLINE__) -#include "ace/String_Base.inl" -#endif /* __ACE_INLINE__ */ - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_ALLOC_HOOK_DEFINE(ACE_String_Base) - -template -CHAR ACE_String_Base::NULL_String_ = 0; - -// Default constructor. - -template -ACE_String_Base::ACE_String_Base (ACE_Allocator *the_allocator) - : allocator_ (the_allocator ? the_allocator : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (&ACE_String_Base::NULL_String_), - release_ (false) -{ - ACE_TRACE ("ACE_String_Base::ACE_String_Base"); -} - -// Constructor that actually copies memory. - -template -ACE_String_Base::ACE_String_Base (const CHAR *s, - ACE_Allocator *the_allocator, - bool release) - : allocator_ (the_allocator ? the_allocator : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (false) -{ - ACE_TRACE ("ACE_String_Base::ACE_String_Base"); - this->set (s, release); -} - -template -ACE_String_Base::ACE_String_Base (CHAR c, - ACE_Allocator *the_allocator) - : allocator_ (the_allocator ? the_allocator : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (false) -{ - ACE_TRACE ("ACE_String_Base::ACE_String_Base"); - - this->set (&c, 1, true); -} - -// Constructor that actually copies memory. - -template -ACE_String_Base::ACE_String_Base ( - const CHAR *s, - typename ACE_String_Base::size_type len, - ACE_Allocator *the_allocator, - bool release) - : allocator_ (the_allocator ? the_allocator : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (false) -{ - ACE_TRACE ("ACE_String_Base::ACE_String_Base"); - - this->set (s, len, release); -} - -// Copy constructor. - -template -ACE_String_Base::ACE_String_Base (const ACE_String_Base &s) - : allocator_ (s.allocator_ ? s.allocator_ : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (false) -{ - ACE_TRACE ("ACE_String_Base::ACE_String_Base"); - - this->set (s.rep_, s.len_, true); -} - -template -ACE_String_Base::ACE_String_Base ( - typename ACE_String_Base::size_type len, - CHAR c, - ACE_Allocator *the_allocator) - : allocator_ (the_allocator ? the_allocator : ACE_Allocator::instance ()), - len_ (0), - buf_len_ (0), - rep_ (0), - release_ (false) -{ - ACE_TRACE ("ACE_String_Base::ACE_String_Base"); - - this->resize (len, c); -} - -template -ACE_String_Base::~ACE_String_Base (void) -{ - ACE_TRACE ("ACE_String_Base::~ACE_String_Base"); - - if (this->buf_len_ != 0 && this->release_) - this->allocator_->free (this->rep_); -} - -// this method might benefit from a little restructuring. -template void -ACE_String_Base::set (const CHAR *s, - typename ACE_String_Base::size_type len, - bool release) -{ - // Case 1. Going from memory to more memory - size_type new_buf_len = len + 1; - if (s != 0 && len != 0 && release && this->buf_len_ < new_buf_len) - { - CHAR *temp = 0; - ACE_ALLOCATOR (temp, - (CHAR *) this->allocator_->malloc (new_buf_len * sizeof (CHAR))); - - if (this->buf_len_ != 0 && this->release_) - this->allocator_->free (this->rep_); - - this->rep_ = temp; - this->buf_len_ = new_buf_len; - this->release_ = true; - this->len_ = len; - ACE_OS::memcpy (this->rep_, s, len * sizeof (CHAR)); - this->rep_[len] = 0; - } - else // Case 2. No memory allocation is necessary. - { - // Free memory if necessary and figure out future ownership - if (!release || s == 0 || len == 0) - { - if (this->buf_len_ != 0 && this->release_) - { - this->allocator_->free (this->rep_); - this->release_ = false; - } - } - // Populate data. - if (s == 0 || len == 0) - { - this->buf_len_ = 0; - this->len_ = 0; - this->rep_ = &ACE_String_Base::NULL_String_; - this->release_ = false; - } - else if (!release) // Note: No guarantee that rep_ is null terminated. - { - this->buf_len_ = len; - this->len_ = len; - this->rep_ = const_cast (s); - this->release_ = false; - } - else - { - ACE_OS::memcpy (this->rep_, s, len * sizeof (CHAR)); - this->rep_[len] = 0; - this->len_ = len; - } - } -} - -// Return substring. -template ACE_String_Base -ACE_String_Base::substring ( - typename ACE_String_Base::size_type offset, - typename ACE_String_Base::size_type length) const -{ - ACE_String_Base nill; - size_type count = length; - - // case 1. empty string - if (this->len_ == 0) - return nill; - - // case 2. start pos past our end - if (offset >= this->len_) - return nill; - // No length == empty string. - else if (length == 0) - return nill; - // Get all remaining bytes. - else if (length == npos || count > (this->len_ - offset)) - count = this->len_ - offset; - - return ACE_String_Base (&this->rep_[offset], count, this->allocator_); -} - -template ACE_String_Base & -ACE_String_Base::append (const CHAR* s, - typename ACE_String_Base::size_type slen) -{ - ACE_TRACE ("ACE_String_Base::append(const CHAR*, size_type)"); - if (slen > 0 && slen != npos) - { - // case 1. No memory allocation needed. - if (this->buf_len_ >= this->len_ + slen + 1) - { - // Copy in data from new string. - ACE_OS::memcpy (this->rep_ + this->len_, s, slen * sizeof (CHAR)); - } - else // case 2. Memory reallocation is needed - { - const size_type new_buf_len = - ace_max(this->len_ + slen + 1, this->buf_len_ + this->buf_len_ / 2); - - CHAR *t = 0; - - ACE_ALLOCATOR_RETURN (t, - (CHAR *) this->allocator_->malloc (new_buf_len * sizeof (CHAR)), *this); - - // Copy memory from old string into new string. - ACE_OS::memcpy (t, this->rep_, this->len_ * sizeof (CHAR)); - - ACE_OS::memcpy (t + this->len_, s, slen * sizeof (CHAR)); - - if (this->buf_len_ != 0 && this->release_) - this->allocator_->free (this->rep_); - - this->release_ = true; - this->rep_ = t; - this->buf_len_ = new_buf_len; - } - - this->len_ += slen; - this->rep_[this->len_] = 0; - } - - return *this; -} - -template u_long -ACE_String_Base::hash (void) const -{ - return - ACE::hash_pjw (reinterpret_cast ( - const_cast (this->rep_)), - this->len_ * sizeof (CHAR)); -} - -template void -ACE_String_Base::resize (typename ACE_String_Base::size_type len, - CHAR c) -{ - ACE_TRACE ("ACE_String_Base::resize"); - - fast_resize(len); - ACE_OS::memset (this->rep_, c, this->buf_len_ * sizeof (CHAR)); -} - -template void -ACE_String_Base::fast_resize (size_t len) -{ - ACE_TRACE ("ACE_String_Base::fast_resize"); - - // Only reallocate if we don't have enough space... - if (this->buf_len_ <= len) - { - if (this->buf_len_ != 0 && this->release_) - this->allocator_->free (this->rep_); - - this->rep_ = static_cast - (this->allocator_->malloc ((len + 1) * sizeof (CHAR))); - this->buf_len_ = len + 1; - this->release_ = true; - } - this->len_ = 0; - if (len > 0) - this->rep_[0] = 0; -} - -template void -ACE_String_Base::clear (bool release) -{ - // This can't use set(), because that would free memory if release=false - if (release) - { - if (this->buf_len_ != 0 && this->release_) - this->allocator_->free (this->rep_); - - this->rep_ = &ACE_String_Base::NULL_String_; - this->len_ = 0; - this->buf_len_ = 0; - this->release_ = false; - } - else - { - this->fast_clear (); - } -} - -// Assignment operator (does copy memory). -template ACE_String_Base & -ACE_String_Base::operator= (const CHAR *s) -{ - ACE_TRACE ("ACE_String_Base::operator="); - if (s != 0) - this->set (s, true); - return *this; -} - -// Assignment operator (does copy memory). -template ACE_String_Base & -ACE_String_Base::operator= (const ACE_String_Base &s) -{ - ACE_TRACE ("ACE_String_Base::operator="); - - // Check for self-assignment. - if (this != &s) - { - this->set (s.rep_, s.len_, true); - } - - return *this; -} - -template void -ACE_String_Base::set (const CHAR *s, bool release) -{ - size_t length = 0; - if (s != 0) - length = ACE_OS::strlen (s); - - this->set (s, length, release); -} - -template void -ACE_String_Base::fast_clear (void) -{ - this->len_ = 0; - if (this->release_) - { - // String retains the original buffer. - if (this->rep_ != &ACE_String_Base::NULL_String_) - this->rep_[0] = 0; - } - else - { - // External buffer: string relinquishes control of it. - this->buf_len_ = 0; - this->rep_ = &ACE_String_Base::NULL_String_; - } -} - -// Get a copy of the underlying representation. - -template CHAR * -ACE_String_Base::rep (void) const -{ - ACE_TRACE ("ACE_String_Base::rep"); - - CHAR *new_string; - ACE_NEW_RETURN (new_string, CHAR[this->len_ + 1], 0); - ACE_OS::strsncpy (new_string, this->rep_, this->len_+1); - - return new_string; -} - -template int -ACE_String_Base::compare (const ACE_String_Base &s) const -{ - ACE_TRACE ("ACE_String_Base::compare"); - - if (this->rep_ == s.rep_) - return 0; - - // Pick smaller of the two lengths and perform the comparison. - size_type smaller_length = ace_min (this->len_, s.len_); - - int result = ACE_OS::memcmp (this->rep_, - s.rep_, - smaller_length * sizeof (CHAR)); - - if (!result) - result = static_cast (this->len_ - s.len_); - return result; -} - -// Comparison operator. - -template bool -ACE_String_Base::operator== (const ACE_String_Base &s) const -{ - return this->len_ == s.len_ && - ACE_OS::memcmp (this->rep_, - s.rep_, - this->len_ * sizeof (CHAR)) == 0; -} - -template bool -ACE_String_Base::operator== (const CHAR *s) const -{ - size_t len = ACE_OS::strlen (s); - return this->len_ == len && - ACE_OS::memcmp (this->rep_, - s, - len * sizeof (CHAR)) == 0; -} - -template typename ACE_String_Base::size_type -ACE_String_Base::find ( - const CHAR *s, - typename ACE_String_Base::size_type pos) const -{ - CHAR *substr = this->rep_ + pos; - size_t len = ACE_OS::strlen (s); - CHAR *pointer = ACE_OS::strnstr (substr, s, len); - if (pointer == 0) - return ACE_String_Base::npos; - else - return pointer - this->rep_; -} - -template typename ACE_String_Base::size_type -ACE_String_Base::find ( - CHAR c, - typename ACE_String_Base::size_type pos) const -{ - CHAR *substr = this->rep_ + pos; - CHAR *pointer = ACE_OS::strnchr (substr, c, this->len_ - pos); - if (pointer == 0) - return ACE_String_Base::npos; - else - return pointer - this->rep_; -} - -template typename ACE_String_Base::size_type -ACE_String_Base::rfind ( - CHAR c, - typename ACE_String_Base::size_type pos) const -{ - if (pos == npos || pos > this->len_) - pos = this->len_; - - // Do not change to prefix operator! Proper operation of this loop - // depends on postfix decrement behavior. - for (size_type i = pos; i-- != 0; ) - if (this->rep_[i] == c) - return i; - - return ACE_String_Base::npos; -} - -template void -ACE_String_Base::swap (ACE_String_Base & str) -{ - std::swap (this->allocator_ , str.allocator_); - std::swap (this->len_ , str.len_); - std::swap (this->buf_len_ , str.buf_len_); - std::swap (this->rep_ , str.rep_); - std::swap (this->release_ , str.release_); -} - -// ---------------------------------------------- - -template ACE_String_Base -operator+ (const ACE_String_Base &s, const ACE_String_Base &t) -{ - ACE_String_Base temp (s.length () + t.length ()); - temp += s; - temp += t; - return temp; -} - -template ACE_String_Base -operator+ (const CHAR *s, const ACE_String_Base &t) -{ - size_t slen = 0; - if (s != 0) - slen = ACE_OS::strlen (s); - ACE_String_Base temp (slen + t.length ()); - if (slen > 0) - temp.append (s, slen); - temp += t; - return temp; -} - -template ACE_String_Base -operator+ (const ACE_String_Base &s, const CHAR *t) -{ - size_t tlen = 0; - if (t != 0) - tlen = ACE_OS::strlen (t); - ACE_String_Base temp (s.length () + tlen); - temp += s; - if (tlen > 0) - temp.append (t, tlen); - return temp; -} - -template ACE_String_Base -operator + (const ACE_String_Base &t, - const CHAR c) -{ - ACE_String_Base temp (t.length () + 1); - temp += t; - temp += c; - return temp; -} - -template ACE_String_Base -operator + (const CHAR c, - const ACE_String_Base &t) -{ - ACE_String_Base temp (t.length () + 1); - temp += c; - temp += t; - return temp; -} - -template -ACE_String_Base & -ACE_String_Base::operator+= (const CHAR* s) -{ - size_t slen = 0; - if (s != 0) - slen = ACE_OS::strlen (s); - return this->append (s, slen); -} - -template -ACE_String_Base & -ACE_String_Base::operator+= (const ACE_String_Base &s) -{ - ACE_TRACE ("ACE_String_Base::operator+=(const ACE_String_Base &)"); - return this->append (s.rep_, s.len_); -} - -template -ACE_String_Base & -ACE_String_Base::operator+= (const CHAR c) -{ - ACE_TRACE ("ACE_String_Base::operator+=(const CHAR)"); - const size_type slen = 1; - return this->append (&c, slen); -} - -ACE_END_VERSIONED_NAMESPACE_DECL - -#endif /* ACE_STRING_BASE_CPP */ - diff --git a/dep/src/ace/Time_Value.cpp b/dep/src/ace/Time_Value.cpp deleted file mode 100644 index c895495ec0a..00000000000 --- a/dep/src/ace/Time_Value.cpp +++ /dev/null @@ -1,263 +0,0 @@ -#include "ace/Time_Value.h" - -ACE_RCSID (ace, - Time_Value, - "$Id: Time_Value.cpp 80826 2008-03-04 14:51:23Z wotte $") - -#if !defined (__ACE_INLINE__) -#include "ace/Time_Value.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/Numeric_Limits.h" -#include "ace/If_Then_Else.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - -// Static constant representing `zero-time'. -// Note: this object requires static construction. -const ACE_Time_Value ACE_Time_Value::zero; - -// Constant for maximum time representable. Note that this time -// is not intended for use with select () or other calls that may -// have *their own* implementation-specific maximum time representations. -// Its primary use is in time computations such as those used by the -// dynamic subpriority strategies in the ACE_Dynamic_Message_Queue class. -// Note: this object requires static construction. -const ACE_Time_Value ACE_Time_Value::max_time ( - ACE_Numeric_Limits::max (), - ACE_ONE_SECOND_IN_USECS - 1); - -ACE_ALLOC_HOOK_DEFINE (ACE_Time_Value) - -// Increment microseconds (the only reason this is here is to allow -// the use of ACE_Atomic_Op with ACE_Time_Value). - -ACE_Time_Value -ACE_Time_Value::operator ++ (int) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator ++ (int)"); - ACE_Time_Value tv (*this); - ++*this; - return tv; -} - -ACE_Time_Value & -ACE_Time_Value::operator ++ (void) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator ++ (void)"); - this->usec (this->usec () + 1); - this->normalize (); - return *this; -} - -// Decrement microseconds (the only reason this is here is / to allow -// the use of ACE_Atomic_Op with ACE_Time_Value). - -ACE_Time_Value -ACE_Time_Value::operator -- (int) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator -- (int)"); - ACE_Time_Value tv (*this); - --*this; - return tv; -} - -ACE_Time_Value & -ACE_Time_Value::operator -- (void) -{ - // ACE_OS_TRACE ("ACE_Time_Value::operator -- (void)"); - this->usec (this->usec () - 1); - this->normalize (); - return *this; -} - -#if defined (ACE_WIN32) -// Static constant to remove time skew between FILETIME and POSIX -// time. POSIX and Win32 use different epochs (Jan. 1, 1970 v.s. -// Jan. 1, 1601). The following constant defines the difference -// in 100ns ticks. -// -// In the beginning (Jan. 1, 1601), there was no time and no computer. -// And Bill said: "Let there be time," and there was time.... -# if defined (ACE_LACKS_LONGLONG_T) -const ACE_U_LongLong ACE_Time_Value::FILETIME_to_timval_skew = -ACE_U_LongLong (0xd53e8000, 0x19db1de); -# else -const DWORDLONG ACE_Time_Value::FILETIME_to_timval_skew = -ACE_INT64_LITERAL (0x19db1ded53e8000); -# endif - -// Initializes the ACE_Time_Value object from a Win32 FILETIME - -ACE_Time_Value::ACE_Time_Value (const FILETIME &file_time) -{ - // // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value"); - this->set (file_time); -} - -void ACE_Time_Value::set (const FILETIME &file_time) -{ - // Initializes the ACE_Time_Value object from a Win32 FILETIME -#if defined (ACE_LACKS_LONGLONG_T) - ACE_U_LongLong LL_100ns(file_time.dwLowDateTime, file_time.dwHighDateTime); - LL_100ns -= ACE_Time_Value::FILETIME_to_timval_skew; - // Convert 100ns units to seconds; - this->tv_.tv_sec = (long) (LL_100ns / ((double) (10000 * 1000))); - // Convert remainder to microseconds; - this->tv_.tv_usec = (suseconds_t)((LL_100ns % ((ACE_UINT32)(10000 * 1000))) / 10); -#else - // Don't use a struct initializer, gcc don't like it. - ULARGE_INTEGER _100ns; - _100ns.LowPart = file_time.dwLowDateTime; - _100ns.HighPart = file_time.dwHighDateTime; - - _100ns.QuadPart -= ACE_Time_Value::FILETIME_to_timval_skew; - - // Convert 100ns units to seconds; - this->tv_.tv_sec = (long) (_100ns.QuadPart / (10000 * 1000)); - // Convert remainder to microseconds; - this->tv_.tv_usec = (suseconds_t) ((_100ns.QuadPart % (10000 * 1000)) / 10); -#endif // ACE_LACKS_LONGLONG_T - this->normalize (); -} - -// Returns the value of the object as a Win32 FILETIME. - -ACE_Time_Value::operator FILETIME () const -{ - FILETIME file_time; - // ACE_OS_TRACE ("ACE_Time_Value::operator FILETIME"); - -#if defined (ACE_LACKS_LONGLONG_T) - ACE_U_LongLong LL_sec(this->tv_.tv_sec); - ACE_U_LongLong LL_usec(this->tv_.tv_usec); - ACE_U_LongLong LL_100ns = LL_sec * (ACE_UINT32)(10000 * 1000) + - LL_usec * (ACE_UINT32)10 + - ACE_Time_Value::FILETIME_to_timval_skew; - file_time.dwLowDateTime = LL_100ns.lo(); - file_time.dwHighDateTime = LL_100ns.hi(); -#else - ULARGE_INTEGER _100ns; - _100ns.QuadPart = (((DWORDLONG) this->tv_.tv_sec * (10000 * 1000) + - this->tv_.tv_usec * 10) + - ACE_Time_Value::FILETIME_to_timval_skew); - - file_time.dwLowDateTime = _100ns.LowPart; - file_time.dwHighDateTime = _100ns.HighPart; -#endif //ACE_LACKS_LONGLONG_T - - return file_time; -} - -#endif /* ACE_WIN32 */ - -void -ACE_Time_Value::dump (void) const -{ -#if defined (ACE_HAS_DUMP) - // ACE_OS_TRACE ("ACE_Time_Value::dump"); -#if 0 - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntv_sec_ = %d"), this->tv_.tv_sec)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntv_usec_ = %d\n"), this->tv_.tv_usec)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* 0 */ -#endif /* ACE_HAS_DUMP */ -} - -void -ACE_Time_Value::normalize (void) -{ - // // ACE_OS_TRACE ("ACE_Time_Value::normalize"); - // From Hans Rohnert... - - if (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS) - { - /*! \todo This loop needs some optimization. - */ - do - { - ++this->tv_.tv_sec; - this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS; - } - while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS); - } - else if (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS) - { - /*! \todo This loop needs some optimization. - */ - do - { - --this->tv_.tv_sec; - this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS; - } - while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS); - } - - if (this->tv_.tv_sec >= 1 && this->tv_.tv_usec < 0) - { - --this->tv_.tv_sec; - this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS; - } -// tv_sec in qnxnto is unsigned -#if !defined ( __QNXNTO__) - else if (this->tv_.tv_sec < 0 && this->tv_.tv_usec > 0) - { - ++this->tv_.tv_sec; - this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS; - } -#endif /* __QNXNTO__ */ -} - -ACE_Time_Value & -ACE_Time_Value::operator *= (double d) -{ - // The floating type to be used in the computations. It should be - // large enough to hold a time_t. We actually want a floating type - // with enough digits in its mantissa to hold a time_t without - // losing precision. For example, if FLT_RADIX is 2 and - // LDBL_MANT_DIG is 64, a long double has a 64 bit wide mantissa, - // which would be sufficient to hold a 64 bit time_t value without - // losing precision. - // - // For now we'll simply go with long double if it is larger than - // time_t. We're hosed if long double isn't large enough. - typedef ACE::If_Then_Else<(sizeof (double) > sizeof (time_t)), - double, - long double>::result_type float_type; - - float_type time_total = - (this->sec () - + static_cast (this->usec ()) / ACE_ONE_SECOND_IN_USECS) * d; - - // shall we saturate the result? - static const float_type max_int = - ACE_Numeric_Limits::max () + 0.999999; - static const float_type min_int = - ACE_Numeric_Limits::min () - 0.999999; - - if (time_total > max_int) - time_total = max_int; - if (time_total < min_int) - time_total = min_int; - - const time_t time_sec = static_cast (time_total); - - time_total -= time_sec; - time_total *= ACE_ONE_SECOND_IN_USECS; - - suseconds_t time_usec = static_cast (time_total); - - // round up the result to save the last usec - if (time_usec > 0 && (time_total - time_usec) >= 0.5) - ++time_usec; - else if (time_usec < 0 && (time_total - time_usec) <= -0.5) - --time_usec; - - this->set (time_sec, time_usec); - - return *this; -} - -ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/src/bzip2/blocksort.c b/dep/src/bzip2/blocksort.c deleted file mode 100644 index bd2dec157fa..00000000000 --- a/dep/src/bzip2/blocksort.c +++ /dev/null @@ -1,1094 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Block sorting machinery ---*/ -/*--- blocksort.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include "bzlib_private.h" - -/*---------------------------------------------*/ -/*--- Fallback O(N log(N)^2) sorting ---*/ -/*--- algorithm, for repetitive blocks ---*/ -/*---------------------------------------------*/ - -/*---------------------------------------------*/ -static -__inline__ -void fallbackSimpleSort ( UInt32* fmap, - UInt32* eclass, - Int32 lo, - Int32 hi ) -{ - Int32 i, j, tmp; - UInt32 ec_tmp; - - if (lo == hi) return; - - if (hi - lo > 3) { - for ( i = hi-4; i >= lo; i-- ) { - tmp = fmap[i]; - ec_tmp = eclass[tmp]; - for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 ) - fmap[j-4] = fmap[j]; - fmap[j-4] = tmp; - } - } - - for ( i = hi-1; i >= lo; i-- ) { - tmp = fmap[i]; - ec_tmp = eclass[tmp]; - for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ ) - fmap[j-1] = fmap[j]; - fmap[j-1] = tmp; - } -} - - -/*---------------------------------------------*/ -#define fswap(zz1, zz2) \ - { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } - -#define fvswap(zzp1, zzp2, zzn) \ -{ \ - Int32 yyp1 = (zzp1); \ - Int32 yyp2 = (zzp2); \ - Int32 yyn = (zzn); \ - while (yyn > 0) { \ - fswap(fmap[yyp1], fmap[yyp2]); \ - yyp1++; yyp2++; yyn--; \ - } \ -} - - -#define fmin(a,b) ((a) < (b)) ? (a) : (b) - -#define fpush(lz,hz) { stackLo[sp] = lz; \ - stackHi[sp] = hz; \ - sp++; } - -#define fpop(lz,hz) { sp--; \ - lz = stackLo[sp]; \ - hz = stackHi[sp]; } - -#define FALLBACK_QSORT_SMALL_THRESH 10 -#define FALLBACK_QSORT_STACK_SIZE 100 - - -static -void fallbackQSort3 ( UInt32* fmap, - UInt32* eclass, - Int32 loSt, - Int32 hiSt ) -{ - Int32 unLo, unHi, ltLo, gtHi, n, m; - Int32 sp, lo, hi; - UInt32 med, r, r3; - Int32 stackLo[FALLBACK_QSORT_STACK_SIZE]; - Int32 stackHi[FALLBACK_QSORT_STACK_SIZE]; - - r = 0; - - sp = 0; - fpush ( loSt, hiSt ); - - while (sp > 0) { - - AssertH ( sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004 ); - - fpop ( lo, hi ); - if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) { - fallbackSimpleSort ( fmap, eclass, lo, hi ); - continue; - } - - /* Random partitioning. Median of 3 sometimes fails to - avoid bad cases. Median of 9 seems to help but - looks rather expensive. This too seems to work but - is cheaper. Guidance for the magic constants - 7621 and 32768 is taken from Sedgewick's algorithms - book, chapter 35. - */ - r = ((r * 7621) + 1) % 32768; - r3 = r % 3; - if (r3 == 0) med = eclass[fmap[lo]]; else - if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else - med = eclass[fmap[hi]]; - - unLo = ltLo = lo; - unHi = gtHi = hi; - - while (1) { - while (1) { - if (unLo > unHi) break; - n = (Int32)eclass[fmap[unLo]] - (Int32)med; - if (n == 0) { - fswap(fmap[unLo], fmap[ltLo]); - ltLo++; unLo++; - continue; - }; - if (n > 0) break; - unLo++; - } - while (1) { - if (unLo > unHi) break; - n = (Int32)eclass[fmap[unHi]] - (Int32)med; - if (n == 0) { - fswap(fmap[unHi], fmap[gtHi]); - gtHi--; unHi--; - continue; - }; - if (n < 0) break; - unHi--; - } - if (unLo > unHi) break; - fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--; - } - - AssertD ( unHi == unLo-1, "fallbackQSort3(2)" ); - - if (gtHi < ltLo) continue; - - n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n); - m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m); - - n = lo + unLo - ltLo - 1; - m = hi - (gtHi - unHi) + 1; - - if (n - lo > hi - m) { - fpush ( lo, n ); - fpush ( m, hi ); - } else { - fpush ( m, hi ); - fpush ( lo, n ); - } - } -} - -#undef fmin -#undef fpush -#undef fpop -#undef fswap -#undef fvswap -#undef FALLBACK_QSORT_SMALL_THRESH -#undef FALLBACK_QSORT_STACK_SIZE - - -/*---------------------------------------------*/ -/* Pre: - nblock > 0 - eclass exists for [0 .. nblock-1] - ((UChar*)eclass) [0 .. nblock-1] holds block - ptr exists for [0 .. nblock-1] - - Post: - ((UChar*)eclass) [0 .. nblock-1] holds block - All other areas of eclass destroyed - fmap [0 .. nblock-1] holds sorted order - bhtab [ 0 .. 2+(nblock/32) ] destroyed -*/ - -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) -#define WORD_BH(zz) bhtab[(zz) >> 5] -#define UNALIGNED_BH(zz) ((zz) & 0x01f) - -static -void fallbackSort ( UInt32* fmap, - UInt32* eclass, - UInt32* bhtab, - Int32 nblock, - Int32 verb ) -{ - Int32 ftab[257]; - Int32 ftabCopy[256]; - Int32 H, i, j, k, l, r, cc, cc1; - Int32 nNotDone; - Int32 nBhtab; - UChar* eclass8 = (UChar*)eclass; - - /*-- - Initial 1-char radix sort to generate - initial fmap and initial BH bits. - --*/ - if (verb >= 4) - VPrintf0 ( " bucket sorting ...\n" ); - for (i = 0; i < 257; i++) ftab[i] = 0; - for (i = 0; i < nblock; i++) ftab[eclass8[i]]++; - for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i]; - for (i = 1; i < 257; i++) ftab[i] += ftab[i-1]; - - for (i = 0; i < nblock; i++) { - j = eclass8[i]; - k = ftab[j] - 1; - ftab[j] = k; - fmap[k] = i; - } - - nBhtab = 2 + (nblock / 32); - for (i = 0; i < nBhtab; i++) bhtab[i] = 0; - for (i = 0; i < 256; i++) SET_BH(ftab[i]); - - /*-- - Inductively refine the buckets. Kind-of an - "exponential radix sort" (!), inspired by the - Manber-Myers suffix array construction algorithm. - --*/ - - /*-- set sentinel bits for block-end detection --*/ - for (i = 0; i < 32; i++) { - SET_BH(nblock + 2*i); - CLEAR_BH(nblock + 2*i + 1); - } - - /*-- the log(N) loop --*/ - H = 1; - while (1) { - - if (verb >= 4) - VPrintf1 ( " depth %6d has ", H ); - - j = 0; - for (i = 0; i < nblock; i++) { - if (ISSET_BH(i)) j = i; - k = fmap[i] - H; if (k < 0) k += nblock; - eclass[k] = j; - } - - nNotDone = 0; - r = -1; - while (1) { - - /*-- find the next non-singleton bucket --*/ - k = r + 1; - while (ISSET_BH(k) && UNALIGNED_BH(k)) k++; - if (ISSET_BH(k)) { - while (WORD_BH(k) == 0xffffffff) k += 32; - while (ISSET_BH(k)) k++; - } - l = k - 1; - if (l >= nblock) break; - while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++; - if (!ISSET_BH(k)) { - while (WORD_BH(k) == 0x00000000) k += 32; - while (!ISSET_BH(k)) k++; - } - r = k - 1; - if (r >= nblock) break; - - /*-- now [l, r] bracket current bucket --*/ - if (r > l) { - nNotDone += (r - l + 1); - fallbackQSort3 ( fmap, eclass, l, r ); - - /*-- scan bucket and generate header bits-- */ - cc = -1; - for (i = l; i <= r; i++) { - cc1 = eclass[fmap[i]]; - if (cc != cc1) { SET_BH(i); cc = cc1; }; - } - } - } - - if (verb >= 4) - VPrintf1 ( "%6d unresolved strings\n", nNotDone ); - - H *= 2; - if (H > nblock || nNotDone == 0) break; - } - - /*-- - Reconstruct the original block in - eclass8 [0 .. nblock-1], since the - previous phase destroyed it. - --*/ - if (verb >= 4) - VPrintf0 ( " reconstructing block ...\n" ); - j = 0; - for (i = 0; i < nblock; i++) { - while (ftabCopy[j] == 0) j++; - ftabCopy[j]--; - eclass8[fmap[i]] = (UChar)j; - } - AssertH ( j < 256, 1005 ); -} - -#undef SET_BH -#undef CLEAR_BH -#undef ISSET_BH -#undef WORD_BH -#undef UNALIGNED_BH - - -/*---------------------------------------------*/ -/*--- The main, O(N^2 log(N)) sorting ---*/ -/*--- algorithm. Faster for "normal" ---*/ -/*--- non-repetitive blocks. ---*/ -/*---------------------------------------------*/ - -/*---------------------------------------------*/ -static -__inline__ -Bool mainGtU ( UInt32 i1, - UInt32 i2, - UChar* block, - UInt16* quadrant, - UInt32 nblock, - Int32* budget ) -{ - Int32 k; - UChar c1, c2; - UInt16 s1, s2; - - AssertD ( i1 != i2, "mainGtU" ); - /* 1 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 2 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 3 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 4 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 5 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 6 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 7 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 8 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 9 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 10 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 11 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 12 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - - k = nblock + 8; - - do { - /* 1 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 2 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 3 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 4 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 5 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 6 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 7 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 8 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - - if (i1 >= nblock) i1 -= nblock; - if (i2 >= nblock) i2 -= nblock; - - k -= 8; - (*budget)--; - } - while (k >= 0); - - return False; -} - - -/*---------------------------------------------*/ -/*-- - Knuth's increments seem to work better - than Incerpi-Sedgewick here. Possibly - because the number of elems to sort is - usually small, typically <= 20. ---*/ -static -Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280, - 9841, 29524, 88573, 265720, - 797161, 2391484 }; - -static -void mainSimpleSort ( UInt32* ptr, - UChar* block, - UInt16* quadrant, - Int32 nblock, - Int32 lo, - Int32 hi, - Int32 d, - Int32* budget ) -{ - Int32 i, j, h, bigN, hp; - UInt32 v; - - bigN = hi - lo + 1; - if (bigN < 2) return; - - hp = 0; - while (incs[hp] < bigN) hp++; - hp--; - - for (; hp >= 0; hp--) { - h = incs[hp]; - - i = lo + h; - while (True) { - - /*-- copy 1 --*/ - if (i > hi) break; - v = ptr[i]; - j = i; - while ( mainGtU ( - ptr[j-h]+d, v+d, block, quadrant, nblock, budget - ) ) { - ptr[j] = ptr[j-h]; - j = j - h; - if (j <= (lo + h - 1)) break; - } - ptr[j] = v; - i++; - - /*-- copy 2 --*/ - if (i > hi) break; - v = ptr[i]; - j = i; - while ( mainGtU ( - ptr[j-h]+d, v+d, block, quadrant, nblock, budget - ) ) { - ptr[j] = ptr[j-h]; - j = j - h; - if (j <= (lo + h - 1)) break; - } - ptr[j] = v; - i++; - - /*-- copy 3 --*/ - if (i > hi) break; - v = ptr[i]; - j = i; - while ( mainGtU ( - ptr[j-h]+d, v+d, block, quadrant, nblock, budget - ) ) { - ptr[j] = ptr[j-h]; - j = j - h; - if (j <= (lo + h - 1)) break; - } - ptr[j] = v; - i++; - - if (*budget < 0) return; - } - } -} - - -/*---------------------------------------------*/ -/*-- - The following is an implementation of - an elegant 3-way quicksort for strings, - described in a paper "Fast Algorithms for - Sorting and Searching Strings", by Robert - Sedgewick and Jon L. Bentley. ---*/ - -#define mswap(zz1, zz2) \ - { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } - -#define mvswap(zzp1, zzp2, zzn) \ -{ \ - Int32 yyp1 = (zzp1); \ - Int32 yyp2 = (zzp2); \ - Int32 yyn = (zzn); \ - while (yyn > 0) { \ - mswap(ptr[yyp1], ptr[yyp2]); \ - yyp1++; yyp2++; yyn--; \ - } \ -} - -static -__inline__ -UChar mmed3 ( UChar a, UChar b, UChar c ) -{ - UChar t; - if (a > b) { t = a; a = b; b = t; }; - if (b > c) { - b = c; - if (a > b) b = a; - } - return b; -} - -#define mmin(a,b) ((a) < (b)) ? (a) : (b) - -#define mpush(lz,hz,dz) { stackLo[sp] = lz; \ - stackHi[sp] = hz; \ - stackD [sp] = dz; \ - sp++; } - -#define mpop(lz,hz,dz) { sp--; \ - lz = stackLo[sp]; \ - hz = stackHi[sp]; \ - dz = stackD [sp]; } - - -#define mnextsize(az) (nextHi[az]-nextLo[az]) - -#define mnextswap(az,bz) \ - { Int32 tz; \ - tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \ - tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \ - tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; } - - -#define MAIN_QSORT_SMALL_THRESH 20 -#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT) -#define MAIN_QSORT_STACK_SIZE 100 - -static -void mainQSort3 ( UInt32* ptr, - UChar* block, - UInt16* quadrant, - Int32 nblock, - Int32 loSt, - Int32 hiSt, - Int32 dSt, - Int32* budget ) -{ - Int32 unLo, unHi, ltLo, gtHi, n, m, med; - Int32 sp, lo, hi, d; - - Int32 stackLo[MAIN_QSORT_STACK_SIZE]; - Int32 stackHi[MAIN_QSORT_STACK_SIZE]; - Int32 stackD [MAIN_QSORT_STACK_SIZE]; - - Int32 nextLo[3]; - Int32 nextHi[3]; - Int32 nextD [3]; - - sp = 0; - mpush ( loSt, hiSt, dSt ); - - while (sp > 0) { - - AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 ); - - mpop ( lo, hi, d ); - if (hi - lo < MAIN_QSORT_SMALL_THRESH || - d > MAIN_QSORT_DEPTH_THRESH) { - mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget ); - if (*budget < 0) return; - continue; - } - - med = (Int32) - mmed3 ( block[ptr[ lo ]+d], - block[ptr[ hi ]+d], - block[ptr[ (lo+hi)>>1 ]+d] ); - - unLo = ltLo = lo; - unHi = gtHi = hi; - - while (True) { - while (True) { - if (unLo > unHi) break; - n = ((Int32)block[ptr[unLo]+d]) - med; - if (n == 0) { - mswap(ptr[unLo], ptr[ltLo]); - ltLo++; unLo++; continue; - }; - if (n > 0) break; - unLo++; - } - while (True) { - if (unLo > unHi) break; - n = ((Int32)block[ptr[unHi]+d]) - med; - if (n == 0) { - mswap(ptr[unHi], ptr[gtHi]); - gtHi--; unHi--; continue; - }; - if (n < 0) break; - unHi--; - } - if (unLo > unHi) break; - mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--; - } - - AssertD ( unHi == unLo-1, "mainQSort3(2)" ); - - if (gtHi < ltLo) { - mpush(lo, hi, d+1 ); - continue; - } - - n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n); - m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m); - - n = lo + unLo - ltLo - 1; - m = hi - (gtHi - unHi) + 1; - - nextLo[0] = lo; nextHi[0] = n; nextD[0] = d; - nextLo[1] = m; nextHi[1] = hi; nextD[1] = d; - nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1; - - if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); - if (mnextsize(1) < mnextsize(2)) mnextswap(1,2); - if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); - - AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" ); - AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" ); - - mpush (nextLo[0], nextHi[0], nextD[0]); - mpush (nextLo[1], nextHi[1], nextD[1]); - mpush (nextLo[2], nextHi[2], nextD[2]); - } -} - -#undef mswap -#undef mvswap -#undef mpush -#undef mpop -#undef mmin -#undef mnextsize -#undef mnextswap -#undef MAIN_QSORT_SMALL_THRESH -#undef MAIN_QSORT_DEPTH_THRESH -#undef MAIN_QSORT_STACK_SIZE - - -/*---------------------------------------------*/ -/* Pre: - nblock > N_OVERSHOOT - block32 exists for [0 .. nblock-1 +N_OVERSHOOT] - ((UChar*)block32) [0 .. nblock-1] holds block - ptr exists for [0 .. nblock-1] - - Post: - ((UChar*)block32) [0 .. nblock-1] holds block - All other areas of block32 destroyed - ftab [0 .. 65536 ] destroyed - ptr [0 .. nblock-1] holds sorted order - if (*budget < 0), sorting was abandoned -*/ - -#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8]) -#define SETMASK (1 << 21) -#define CLEARMASK (~(SETMASK)) - -static -void mainSort ( UInt32* ptr, - UChar* block, - UInt16* quadrant, - UInt32* ftab, - Int32 nblock, - Int32 verb, - Int32* budget ) -{ - Int32 i, j, k, ss, sb; - Int32 runningOrder[256]; - Bool bigDone[256]; - Int32 copyStart[256]; - Int32 copyEnd [256]; - UChar c1; - Int32 numQSorted; - UInt16 s; - if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" ); - - /*-- set up the 2-byte frequency table --*/ - for (i = 65536; i >= 0; i--) ftab[i] = 0; - - j = block[0] << 8; - i = nblock-1; - for (; i >= 3; i -= 4) { - quadrant[i] = 0; - j = (j >> 8) | ( ((UInt16)block[i]) << 8); - ftab[j]++; - quadrant[i-1] = 0; - j = (j >> 8) | ( ((UInt16)block[i-1]) << 8); - ftab[j]++; - quadrant[i-2] = 0; - j = (j >> 8) | ( ((UInt16)block[i-2]) << 8); - ftab[j]++; - quadrant[i-3] = 0; - j = (j >> 8) | ( ((UInt16)block[i-3]) << 8); - ftab[j]++; - } - for (; i >= 0; i--) { - quadrant[i] = 0; - j = (j >> 8) | ( ((UInt16)block[i]) << 8); - ftab[j]++; - } - - /*-- (emphasises close relationship of block & quadrant) --*/ - for (i = 0; i < BZ_N_OVERSHOOT; i++) { - block [nblock+i] = block[i]; - quadrant[nblock+i] = 0; - } - - if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" ); - - /*-- Complete the initial radix sort --*/ - for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1]; - - s = block[0] << 8; - i = nblock-1; - for (; i >= 3; i -= 4) { - s = (s >> 8) | (block[i] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i; - s = (s >> 8) | (block[i-1] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i-1; - s = (s >> 8) | (block[i-2] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i-2; - s = (s >> 8) | (block[i-3] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i-3; - } - for (; i >= 0; i--) { - s = (s >> 8) | (block[i] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i; - } - - /*-- - Now ftab contains the first loc of every small bucket. - Calculate the running order, from smallest to largest - big bucket. - --*/ - for (i = 0; i <= 255; i++) { - bigDone [i] = False; - runningOrder[i] = i; - } - - { - Int32 vv; - Int32 h = 1; - do h = 3 * h + 1; while (h <= 256); - do { - h = h / 3; - for (i = h; i <= 255; i++) { - vv = runningOrder[i]; - j = i; - while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) { - runningOrder[j] = runningOrder[j-h]; - j = j - h; - if (j <= (h - 1)) goto zero; - } - zero: - runningOrder[j] = vv; - } - } while (h != 1); - } - - /*-- - The main sorting loop. - --*/ - - numQSorted = 0; - - for (i = 0; i <= 255; i++) { - - /*-- - Process big buckets, starting with the least full. - Basically this is a 3-step process in which we call - mainQSort3 to sort the small buckets [ss, j], but - also make a big effort to avoid the calls if we can. - --*/ - ss = runningOrder[i]; - - /*-- - Step 1: - Complete the big bucket [ss] by quicksorting - any unsorted small buckets [ss, j], for j != ss. - Hopefully previous pointer-scanning phases have already - completed many of the small buckets [ss, j], so - we don't have to sort them at all. - --*/ - for (j = 0; j <= 255; j++) { - if (j != ss) { - sb = (ss << 8) + j; - if ( ! (ftab[sb] & SETMASK) ) { - Int32 lo = ftab[sb] & CLEARMASK; - Int32 hi = (ftab[sb+1] & CLEARMASK) - 1; - if (hi > lo) { - if (verb >= 4) - VPrintf4 ( " qsort [0x%x, 0x%x] " - "done %d this %d\n", - ss, j, numQSorted, hi - lo + 1 ); - mainQSort3 ( - ptr, block, quadrant, nblock, - lo, hi, BZ_N_RADIX, budget - ); - numQSorted += (hi - lo + 1); - if (*budget < 0) return; - } - } - ftab[sb] |= SETMASK; - } - } - - AssertH ( !bigDone[ss], 1006 ); - - /*-- - Step 2: - Now scan this big bucket [ss] so as to synthesise the - sorted order for small buckets [t, ss] for all t, - including, magically, the bucket [ss,ss] too. - This will avoid doing Real Work in subsequent Step 1's. - --*/ - { - for (j = 0; j <= 255; j++) { - copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK; - copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1; - } - for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) { - k = ptr[j]-1; if (k < 0) k += nblock; - c1 = block[k]; - if (!bigDone[c1]) - ptr[ copyStart[c1]++ ] = k; - } - for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) { - k = ptr[j]-1; if (k < 0) k += nblock; - c1 = block[k]; - if (!bigDone[c1]) - ptr[ copyEnd[c1]-- ] = k; - } - } - - AssertH ( (copyStart[ss]-1 == copyEnd[ss]) - || - /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1. - Necessity for this case is demonstrated by compressing - a sequence of approximately 48.5 million of character - 251; 1.0.0/1.0.1 will then die here. */ - (copyStart[ss] == 0 && copyEnd[ss] == nblock-1), - 1007 ) - - for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK; - - /*-- - Step 3: - The [ss] big bucket is now done. Record this fact, - and update the quadrant descriptors. Remember to - update quadrants in the overshoot area too, if - necessary. The "if (i < 255)" test merely skips - this updating for the last bucket processed, since - updating for the last bucket is pointless. - - The quadrant array provides a way to incrementally - cache sort orderings, as they appear, so as to - make subsequent comparisons in fullGtU() complete - faster. For repetitive blocks this makes a big - difference (but not big enough to be able to avoid - the fallback sorting mechanism, exponential radix sort). - - The precise meaning is: at all times: - - for 0 <= i < nblock and 0 <= j <= nblock - - if block[i] != block[j], - - then the relative values of quadrant[i] and - quadrant[j] are meaningless. - - else { - if quadrant[i] < quadrant[j] - then the string starting at i lexicographically - precedes the string starting at j - - else if quadrant[i] > quadrant[j] - then the string starting at j lexicographically - precedes the string starting at i - - else - the relative ordering of the strings starting - at i and j has not yet been determined. - } - --*/ - bigDone[ss] = True; - - if (i < 255) { - Int32 bbStart = ftab[ss << 8] & CLEARMASK; - Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart; - Int32 shifts = 0; - - while ((bbSize >> shifts) > 65534) shifts++; - - for (j = bbSize-1; j >= 0; j--) { - Int32 a2update = ptr[bbStart + j]; - UInt16 qVal = (UInt16)(j >> shifts); - quadrant[a2update] = qVal; - if (a2update < BZ_N_OVERSHOOT) - quadrant[a2update + nblock] = qVal; - } - AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 ); - } - - } - - if (verb >= 4) - VPrintf3 ( " %d pointers, %d sorted, %d scanned\n", - nblock, numQSorted, nblock - numQSorted ); -} - -#undef BIGFREQ -#undef SETMASK -#undef CLEARMASK - - -/*---------------------------------------------*/ -/* Pre: - nblock > 0 - arr2 exists for [0 .. nblock-1 +N_OVERSHOOT] - ((UChar*)arr2) [0 .. nblock-1] holds block - arr1 exists for [0 .. nblock-1] - - Post: - ((UChar*)arr2) [0 .. nblock-1] holds block - All other areas of block destroyed - ftab [ 0 .. 65536 ] destroyed - arr1 [0 .. nblock-1] holds sorted order -*/ -void BZ2_blockSort ( EState* s ) -{ - UInt32* ptr = s->ptr; - UChar* block = s->block; - UInt32* ftab = s->ftab; - Int32 nblock = s->nblock; - Int32 verb = s->verbosity; - Int32 wfact = s->workFactor; - UInt16* quadrant; - Int32 budget; - Int32 budgetInit; - Int32 i; - - if (nblock < 10000) { - fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); - } else { - /* Calculate the location for quadrant, remembering to get - the alignment right. Assumes that &(block[0]) is at least - 2-byte aligned -- this should be ok since block is really - the first section of arr2. - */ - i = nblock+BZ_N_OVERSHOOT; - if (i & 1) i++; - quadrant = (UInt16*)(&(block[i])); - - /* (wfact-1) / 3 puts the default-factor-30 - transition point at very roughly the same place as - with v0.1 and v0.9.0. - Not that it particularly matters any more, since the - resulting compressed stream is now the same regardless - of whether or not we use the main sort or fallback sort. - */ - if (wfact < 1 ) wfact = 1; - if (wfact > 100) wfact = 100; - budgetInit = nblock * ((wfact-1) / 3); - budget = budgetInit; - - mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget ); - if (verb >= 3) - VPrintf3 ( " %d work, %d block, ratio %5.2f\n", - budgetInit - budget, - nblock, - (float)(budgetInit - budget) / - (float)(nblock==0 ? 1 : nblock) ); - if (budget < 0) { - if (verb >= 2) - VPrintf0 ( " too repetitive; using fallback" - " sorting algorithm\n" ); - fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); - } - } - - s->origPtr = -1; - for (i = 0; i < s->nblock; i++) - if (ptr[i] == 0) - { s->origPtr = i; break; }; - - AssertH( s->origPtr != -1, 1003 ); -} - - -/*-------------------------------------------------------------*/ -/*--- end blocksort.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/bzlib.c b/dep/src/bzip2/bzlib.c deleted file mode 100644 index ef86c91e695..00000000000 --- a/dep/src/bzip2/bzlib.c +++ /dev/null @@ -1,1572 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Library top-level functions. ---*/ -/*--- bzlib.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - -/* CHANGES - 0.9.0 -- original version. - 0.9.0a/b -- no changes in this file. - 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress(). - fixed bzWrite/bzRead to ignore zero-length requests. - fixed bzread to correctly handle read requests after EOF. - wrong parameter order in call to bzDecompressInit in - bzBuffToBuffDecompress. Fixed. -*/ - -#include "bzlib_private.h" - - -/*---------------------------------------------------*/ -/*--- Compression stuff ---*/ -/*---------------------------------------------------*/ - - -/*---------------------------------------------------*/ -#ifndef BZ_NO_STDIO -void BZ2_bz__AssertH__fail ( int errcode ) -{ - fprintf(stderr, - "\n\nbzip2/libbzip2: internal error number %d.\n" - "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" - "when you were using some program which uses libbzip2 as a\n" - "component, you should also report this bug to the author(s)\n" - "of that program. Please make an effort to report this bug;\n" - "timely and accurate bug reports eventually lead to higher\n" - "quality software. Thanks. Julian Seward, 10 December 2007.\n\n", - errcode, - BZ2_bzlibVersion() - ); - - if (errcode == 1007) { - fprintf(stderr, - "\n*** A special note about internal error number 1007 ***\n" - "\n" - "Experience suggests that a common cause of i.e. 1007\n" - "is unreliable memory or other hardware. The 1007 assertion\n" - "just happens to cross-check the results of huge numbers of\n" - "memory reads/writes, and so acts (unintendedly) as a stress\n" - "test of your memory system.\n" - "\n" - "I suggest the following: try compressing the file again,\n" - "possibly monitoring progress in detail with the -vv flag.\n" - "\n" - "* If the error cannot be reproduced, and/or happens at different\n" - " points in compression, you may have a flaky memory system.\n" - " Try a memory-test program. I have used Memtest86\n" - " (www.memtest86.com). At the time of writing it is free (GPLd).\n" - " Memtest86 tests memory much more thorougly than your BIOSs\n" - " power-on test, and may find failures that the BIOS doesn't.\n" - "\n" - "* If the error can be repeatably reproduced, this is a bug in\n" - " bzip2, and I would very much like to hear about it. Please\n" - " let me know, and, ideally, save a copy of the file causing the\n" - " problem -- without which I will be unable to investigate it.\n" - "\n" - ); - } - - exit(3); -} -#endif - - -/*---------------------------------------------------*/ -static -int bz_config_ok ( void ) -{ - if (sizeof(int) != 4) return 0; - if (sizeof(short) != 2) return 0; - if (sizeof(char) != 1) return 0; - return 1; -} - - -/*---------------------------------------------------*/ -static -void* default_bzalloc ( void* opaque, Int32 items, Int32 size ) -{ - void* v = malloc ( items * size ); - return v; -} - -static -void default_bzfree ( void* opaque, void* addr ) -{ - if (addr != NULL) free ( addr ); -} - - -/*---------------------------------------------------*/ -static -void prepare_new_block ( EState* s ) -{ - Int32 i; - s->nblock = 0; - s->numZ = 0; - s->state_out_pos = 0; - BZ_INITIALISE_CRC ( s->blockCRC ); - for (i = 0; i < 256; i++) s->inUse[i] = False; - s->blockNo++; -} - - -/*---------------------------------------------------*/ -static -void init_RL ( EState* s ) -{ - s->state_in_ch = 256; - s->state_in_len = 0; -} - - -static -Bool isempty_RL ( EState* s ) -{ - if (s->state_in_ch < 256 && s->state_in_len > 0) - return False; else - return True; -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompressInit) - ( bz_stream* strm, - int blockSize100k, - int verbosity, - int workFactor ) -{ - Int32 n; - EState* s; - - if (!bz_config_ok()) return BZ_CONFIG_ERROR; - - if (strm == NULL || - blockSize100k < 1 || blockSize100k > 9 || - workFactor < 0 || workFactor > 250) - return BZ_PARAM_ERROR; - - if (workFactor == 0) workFactor = 30; - if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; - if (strm->bzfree == NULL) strm->bzfree = default_bzfree; - - s = BZALLOC( sizeof(EState) ); - if (s == NULL) return BZ_MEM_ERROR; - s->strm = strm; - - s->arr1 = NULL; - s->arr2 = NULL; - s->ftab = NULL; - - n = 100000 * blockSize100k; - s->arr1 = BZALLOC( n * sizeof(UInt32) ); - s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); - s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); - - if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { - if (s->arr1 != NULL) BZFREE(s->arr1); - if (s->arr2 != NULL) BZFREE(s->arr2); - if (s->ftab != NULL) BZFREE(s->ftab); - if (s != NULL) BZFREE(s); - return BZ_MEM_ERROR; - } - - s->blockNo = 0; - s->state = BZ_S_INPUT; - s->mode = BZ_M_RUNNING; - s->combinedCRC = 0; - s->blockSize100k = blockSize100k; - s->nblockMAX = 100000 * blockSize100k - 19; - s->verbosity = verbosity; - s->workFactor = workFactor; - - s->block = (UChar*)s->arr2; - s->mtfv = (UInt16*)s->arr1; - s->zbits = NULL; - s->ptr = (UInt32*)s->arr1; - - strm->state = s; - strm->total_in_lo32 = 0; - strm->total_in_hi32 = 0; - strm->total_out_lo32 = 0; - strm->total_out_hi32 = 0; - init_RL ( s ); - prepare_new_block ( s ); - return BZ_OK; -} - - -/*---------------------------------------------------*/ -static -void add_pair_to_block ( EState* s ) -{ - Int32 i; - UChar ch = (UChar)(s->state_in_ch); - for (i = 0; i < s->state_in_len; i++) { - BZ_UPDATE_CRC( s->blockCRC, ch ); - } - s->inUse[s->state_in_ch] = True; - switch (s->state_in_len) { - case 1: - s->block[s->nblock] = (UChar)ch; s->nblock++; - break; - case 2: - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - break; - case 3: - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - break; - default: - s->inUse[s->state_in_len-4] = True; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = ((UChar)(s->state_in_len-4)); - s->nblock++; - break; - } -} - - -/*---------------------------------------------------*/ -static -void flush_RL ( EState* s ) -{ - if (s->state_in_ch < 256) add_pair_to_block ( s ); - init_RL ( s ); -} - - -/*---------------------------------------------------*/ -#define ADD_CHAR_TO_BLOCK(zs,zchh0) \ -{ \ - UInt32 zchh = (UInt32)(zchh0); \ - /*-- fast track the common case --*/ \ - if (zchh != zs->state_in_ch && \ - zs->state_in_len == 1) { \ - UChar ch = (UChar)(zs->state_in_ch); \ - BZ_UPDATE_CRC( zs->blockCRC, ch ); \ - zs->inUse[zs->state_in_ch] = True; \ - zs->block[zs->nblock] = (UChar)ch; \ - zs->nblock++; \ - zs->state_in_ch = zchh; \ - } \ - else \ - /*-- general, uncommon cases --*/ \ - if (zchh != zs->state_in_ch || \ - zs->state_in_len == 255) { \ - if (zs->state_in_ch < 256) \ - add_pair_to_block ( zs ); \ - zs->state_in_ch = zchh; \ - zs->state_in_len = 1; \ - } else { \ - zs->state_in_len++; \ - } \ -} - - -/*---------------------------------------------------*/ -static -Bool copy_input_until_stop ( EState* s ) -{ - Bool progress_in = False; - - if (s->mode == BZ_M_RUNNING) { - - /*-- fast track the common case --*/ - while (True) { - /*-- block full? --*/ - if (s->nblock >= s->nblockMAX) break; - /*-- no input? --*/ - if (s->strm->avail_in == 0) break; - progress_in = True; - ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); - s->strm->next_in++; - s->strm->avail_in--; - s->strm->total_in_lo32++; - if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; - } - - } else { - - /*-- general, uncommon case --*/ - while (True) { - /*-- block full? --*/ - if (s->nblock >= s->nblockMAX) break; - /*-- no input? --*/ - if (s->strm->avail_in == 0) break; - /*-- flush/finish end? --*/ - if (s->avail_in_expect == 0) break; - progress_in = True; - ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); - s->strm->next_in++; - s->strm->avail_in--; - s->strm->total_in_lo32++; - if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; - s->avail_in_expect--; - } - } - return progress_in; -} - - -/*---------------------------------------------------*/ -static -Bool copy_output_until_stop ( EState* s ) -{ - Bool progress_out = False; - - while (True) { - - /*-- no output space? --*/ - if (s->strm->avail_out == 0) break; - - /*-- block done? --*/ - if (s->state_out_pos >= s->numZ) break; - - progress_out = True; - *(s->strm->next_out) = s->zbits[s->state_out_pos]; - s->state_out_pos++; - s->strm->avail_out--; - s->strm->next_out++; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - return progress_out; -} - - -/*---------------------------------------------------*/ -static -Bool handle_compress ( bz_stream* strm ) -{ - Bool progress_in = False; - Bool progress_out = False; - EState* s = strm->state; - - while (True) { - - if (s->state == BZ_S_OUTPUT) { - progress_out |= copy_output_until_stop ( s ); - if (s->state_out_pos < s->numZ) break; - if (s->mode == BZ_M_FINISHING && - s->avail_in_expect == 0 && - isempty_RL(s)) break; - prepare_new_block ( s ); - s->state = BZ_S_INPUT; - if (s->mode == BZ_M_FLUSHING && - s->avail_in_expect == 0 && - isempty_RL(s)) break; - } - - if (s->state == BZ_S_INPUT) { - progress_in |= copy_input_until_stop ( s ); - if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) { - flush_RL ( s ); - BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) ); - s->state = BZ_S_OUTPUT; - } - else - if (s->nblock >= s->nblockMAX) { - BZ2_compressBlock ( s, False ); - s->state = BZ_S_OUTPUT; - } - else - if (s->strm->avail_in == 0) { - break; - } - } - - } - - return progress_in || progress_out; -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) -{ - Bool progress; - EState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - preswitch: - switch (s->mode) { - - case BZ_M_IDLE: - return BZ_SEQUENCE_ERROR; - - case BZ_M_RUNNING: - if (action == BZ_RUN) { - progress = handle_compress ( strm ); - return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; - } - else - if (action == BZ_FLUSH) { - s->avail_in_expect = strm->avail_in; - s->mode = BZ_M_FLUSHING; - goto preswitch; - } - else - if (action == BZ_FINISH) { - s->avail_in_expect = strm->avail_in; - s->mode = BZ_M_FINISHING; - goto preswitch; - } - else - return BZ_PARAM_ERROR; - - case BZ_M_FLUSHING: - if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect != s->strm->avail_in) - return BZ_SEQUENCE_ERROR; - progress = handle_compress ( strm ); - if (s->avail_in_expect > 0 || !isempty_RL(s) || - s->state_out_pos < s->numZ) return BZ_FLUSH_OK; - s->mode = BZ_M_RUNNING; - return BZ_RUN_OK; - - case BZ_M_FINISHING: - if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect != s->strm->avail_in) - return BZ_SEQUENCE_ERROR; - progress = handle_compress ( strm ); - if (!progress) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect > 0 || !isempty_RL(s) || - s->state_out_pos < s->numZ) return BZ_FINISH_OK; - s->mode = BZ_M_IDLE; - return BZ_STREAM_END; - } - return BZ_OK; /*--not reached--*/ -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) -{ - EState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - if (s->arr1 != NULL) BZFREE(s->arr1); - if (s->arr2 != NULL) BZFREE(s->arr2); - if (s->ftab != NULL) BZFREE(s->ftab); - BZFREE(strm->state); - - strm->state = NULL; - - return BZ_OK; -} - - -/*---------------------------------------------------*/ -/*--- Decompression stuff ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompressInit) - ( bz_stream* strm, - int verbosity, - int small ) -{ - DState* s; - - if (!bz_config_ok()) return BZ_CONFIG_ERROR; - - if (strm == NULL) return BZ_PARAM_ERROR; - if (small != 0 && small != 1) return BZ_PARAM_ERROR; - if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; - - if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; - if (strm->bzfree == NULL) strm->bzfree = default_bzfree; - - s = BZALLOC( sizeof(DState) ); - if (s == NULL) return BZ_MEM_ERROR; - s->strm = strm; - strm->state = s; - s->state = BZ_X_MAGIC_1; - s->bsLive = 0; - s->bsBuff = 0; - s->calculatedCombinedCRC = 0; - strm->total_in_lo32 = 0; - strm->total_in_hi32 = 0; - strm->total_out_lo32 = 0; - strm->total_out_hi32 = 0; - s->smallDecompress = (Bool)small; - s->ll4 = NULL; - s->ll16 = NULL; - s->tt = NULL; - s->currBlockNo = 0; - s->verbosity = verbosity; - - return BZ_OK; -} - - -/*---------------------------------------------------*/ -/* Return True iff data corruption is discovered. - Returns False if there is no problem. -*/ -static -Bool unRLE_obuf_to_output_FAST ( DState* s ) -{ - UChar k1; - - if (s->blockRandomised) { - - while (True) { - /* try to finish existing run */ - while (True) { - if (s->strm->avail_out == 0) return False; - if (s->state_out_len == 0) break; - *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; - BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); - s->state_out_len--; - s->strm->next_out++; - s->strm->avail_out--; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return False; - - /* Only caused by corrupt data stream? */ - if (s->nblock_used > s->save_nblock+1) - return True; - - s->state_out_len = 1; - s->state_out_ch = s->k0; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 2; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 3; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - s->state_out_len = ((Int32)k1) + 4; - BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; - s->k0 ^= BZ_RAND_MASK; s->nblock_used++; - } - - } else { - - /* restore */ - UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC; - UChar c_state_out_ch = s->state_out_ch; - Int32 c_state_out_len = s->state_out_len; - Int32 c_nblock_used = s->nblock_used; - Int32 c_k0 = s->k0; - UInt32* c_tt = s->tt; - UInt32 c_tPos = s->tPos; - char* cs_next_out = s->strm->next_out; - unsigned int cs_avail_out = s->strm->avail_out; - Int32 ro_blockSize100k = s->blockSize100k; - /* end restore */ - - UInt32 avail_out_INIT = cs_avail_out; - Int32 s_save_nblockPP = s->save_nblock+1; - unsigned int total_out_lo32_old; - - while (True) { - - /* try to finish existing run */ - if (c_state_out_len > 0) { - while (True) { - if (cs_avail_out == 0) goto return_notr; - if (c_state_out_len == 1) break; - *( (UChar*)(cs_next_out) ) = c_state_out_ch; - BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); - c_state_out_len--; - cs_next_out++; - cs_avail_out--; - } - s_state_out_len_eq_one: - { - if (cs_avail_out == 0) { - c_state_out_len = 1; goto return_notr; - }; - *( (UChar*)(cs_next_out) ) = c_state_out_ch; - BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); - cs_next_out++; - cs_avail_out--; - } - } - /* Only caused by corrupt data stream? */ - if (c_nblock_used > s_save_nblockPP) - return True; - - /* can a new run be started? */ - if (c_nblock_used == s_save_nblockPP) { - c_state_out_len = 0; goto return_notr; - }; - c_state_out_ch = c_k0; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (k1 != c_k0) { - c_k0 = k1; goto s_state_out_len_eq_one; - }; - if (c_nblock_used == s_save_nblockPP) - goto s_state_out_len_eq_one; - - c_state_out_len = 2; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (c_nblock_used == s_save_nblockPP) continue; - if (k1 != c_k0) { c_k0 = k1; continue; }; - - c_state_out_len = 3; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (c_nblock_used == s_save_nblockPP) continue; - if (k1 != c_k0) { c_k0 = k1; continue; }; - - BZ_GET_FAST_C(k1); c_nblock_used++; - c_state_out_len = ((Int32)k1) + 4; - BZ_GET_FAST_C(c_k0); c_nblock_used++; - } - - return_notr: - total_out_lo32_old = s->strm->total_out_lo32; - s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); - if (s->strm->total_out_lo32 < total_out_lo32_old) - s->strm->total_out_hi32++; - - /* save */ - s->calculatedBlockCRC = c_calculatedBlockCRC; - s->state_out_ch = c_state_out_ch; - s->state_out_len = c_state_out_len; - s->nblock_used = c_nblock_used; - s->k0 = c_k0; - s->tt = c_tt; - s->tPos = c_tPos; - s->strm->next_out = cs_next_out; - s->strm->avail_out = cs_avail_out; - /* end save */ - } - return False; -} - - - -/*---------------------------------------------------*/ -__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) -{ - Int32 nb, na, mid; - nb = 0; - na = 256; - do { - mid = (nb + na) >> 1; - if (indx >= cftab[mid]) nb = mid; else na = mid; - } - while (na - nb != 1); - return nb; -} - - -/*---------------------------------------------------*/ -/* Return True iff data corruption is discovered. - Returns False if there is no problem. -*/ -static -Bool unRLE_obuf_to_output_SMALL ( DState* s ) -{ - UChar k1; - - if (s->blockRandomised) { - - while (True) { - /* try to finish existing run */ - while (True) { - if (s->strm->avail_out == 0) return False; - if (s->state_out_len == 0) break; - *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; - BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); - s->state_out_len--; - s->strm->next_out++; - s->strm->avail_out--; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return False; - - /* Only caused by corrupt data stream? */ - if (s->nblock_used > s->save_nblock+1) - return True; - - s->state_out_len = 1; - s->state_out_ch = s->k0; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 2; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 3; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - s->state_out_len = ((Int32)k1) + 4; - BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; - s->k0 ^= BZ_RAND_MASK; s->nblock_used++; - } - - } else { - - while (True) { - /* try to finish existing run */ - while (True) { - if (s->strm->avail_out == 0) return False; - if (s->state_out_len == 0) break; - *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; - BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); - s->state_out_len--; - s->strm->next_out++; - s->strm->avail_out--; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return False; - - /* Only caused by corrupt data stream? */ - if (s->nblock_used > s->save_nblock+1) - return True; - - s->state_out_len = 1; - s->state_out_ch = s->k0; - BZ_GET_SMALL(k1); s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 2; - BZ_GET_SMALL(k1); s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 3; - BZ_GET_SMALL(k1); s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_SMALL(k1); s->nblock_used++; - s->state_out_len = ((Int32)k1) + 4; - BZ_GET_SMALL(s->k0); s->nblock_used++; - } - - } -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) -{ - Bool corrupt; - DState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - while (True) { - if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; - if (s->state == BZ_X_OUTPUT) { - if (s->smallDecompress) - corrupt = unRLE_obuf_to_output_SMALL ( s ); else - corrupt = unRLE_obuf_to_output_FAST ( s ); - if (corrupt) return BZ_DATA_ERROR; - if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { - BZ_FINALISE_CRC ( s->calculatedBlockCRC ); - if (s->verbosity >= 3) - VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, - s->calculatedBlockCRC ); - if (s->verbosity >= 2) VPrintf0 ( "]" ); - if (s->calculatedBlockCRC != s->storedBlockCRC) - return BZ_DATA_ERROR; - s->calculatedCombinedCRC - = (s->calculatedCombinedCRC << 1) | - (s->calculatedCombinedCRC >> 31); - s->calculatedCombinedCRC ^= s->calculatedBlockCRC; - s->state = BZ_X_BLKHDR_1; - } else { - return BZ_OK; - } - } - if (s->state >= BZ_X_MAGIC_1) { - Int32 r = BZ2_decompress ( s ); - if (r == BZ_STREAM_END) { - if (s->verbosity >= 3) - VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", - s->storedCombinedCRC, s->calculatedCombinedCRC ); - if (s->calculatedCombinedCRC != s->storedCombinedCRC) - return BZ_DATA_ERROR; - return r; - } - if (s->state != BZ_X_OUTPUT) return r; - } - } - - AssertH ( 0, 6001 ); - - return 0; /*NOTREACHED*/ -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) -{ - DState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - if (s->tt != NULL) BZFREE(s->tt); - if (s->ll16 != NULL) BZFREE(s->ll16); - if (s->ll4 != NULL) BZFREE(s->ll4); - - BZFREE(strm->state); - strm->state = NULL; - - return BZ_OK; -} - - -#ifndef BZ_NO_STDIO -/*---------------------------------------------------*/ -/*--- File I/O stuff ---*/ -/*---------------------------------------------------*/ - -#define BZ_SETERR(eee) \ -{ \ - if (bzerror != NULL) *bzerror = eee; \ - if (bzf != NULL) bzf->lastErr = eee; \ -} - -typedef - struct { - FILE* handle; - Char buf[BZ_MAX_UNUSED]; - Int32 bufN; - Bool writing; - bz_stream strm; - Int32 lastErr; - Bool initialisedOk; - } - bzFile; - - -/*---------------------------------------------*/ -static Bool myfeof ( FILE* f ) -{ - Int32 c = fgetc ( f ); - if (c == EOF) return True; - ungetc ( c, f ); - return False; -} - - -/*---------------------------------------------------*/ -BZFILE* BZ_API(BZ2_bzWriteOpen) - ( int* bzerror, - FILE* f, - int blockSize100k, - int verbosity, - int workFactor ) -{ - Int32 ret; - bzFile* bzf = NULL; - - BZ_SETERR(BZ_OK); - - if (f == NULL || - (blockSize100k < 1 || blockSize100k > 9) || - (workFactor < 0 || workFactor > 250) || - (verbosity < 0 || verbosity > 4)) - { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; - - if (ferror(f)) - { BZ_SETERR(BZ_IO_ERROR); return NULL; }; - - bzf = malloc ( sizeof(bzFile) ); - if (bzf == NULL) - { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; - - BZ_SETERR(BZ_OK); - bzf->initialisedOk = False; - bzf->bufN = 0; - bzf->handle = f; - bzf->writing = True; - bzf->strm.bzalloc = NULL; - bzf->strm.bzfree = NULL; - bzf->strm.opaque = NULL; - - if (workFactor == 0) workFactor = 30; - ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, - verbosity, workFactor ); - if (ret != BZ_OK) - { BZ_SETERR(ret); free(bzf); return NULL; }; - - bzf->strm.avail_in = 0; - bzf->initialisedOk = True; - return bzf; -} - - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzWrite) - ( int* bzerror, - BZFILE* b, - void* buf, - int len ) -{ - Int32 n, n2, ret; - bzFile* bzf = (bzFile*)b; - - BZ_SETERR(BZ_OK); - if (bzf == NULL || buf == NULL || len < 0) - { BZ_SETERR(BZ_PARAM_ERROR); return; }; - if (!(bzf->writing)) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - - if (len == 0) - { BZ_SETERR(BZ_OK); return; }; - - bzf->strm.avail_in = len; - bzf->strm.next_in = buf; - - while (True) { - bzf->strm.avail_out = BZ_MAX_UNUSED; - bzf->strm.next_out = bzf->buf; - ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); - if (ret != BZ_RUN_OK) - { BZ_SETERR(ret); return; }; - - if (bzf->strm.avail_out < BZ_MAX_UNUSED) { - n = BZ_MAX_UNUSED - bzf->strm.avail_out; - n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), - n, bzf->handle ); - if (n != n2 || ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - } - - if (bzf->strm.avail_in == 0) - { BZ_SETERR(BZ_OK); return; }; - } -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzWriteClose) - ( int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in, - unsigned int* nbytes_out ) -{ - BZ2_bzWriteClose64 ( bzerror, b, abandon, - nbytes_in, NULL, nbytes_out, NULL ); -} - - -void BZ_API(BZ2_bzWriteClose64) - ( int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in_lo32, - unsigned int* nbytes_in_hi32, - unsigned int* nbytes_out_lo32, - unsigned int* nbytes_out_hi32 ) -{ - Int32 n, n2, ret; - bzFile* bzf = (bzFile*)b; - - if (bzf == NULL) - { BZ_SETERR(BZ_OK); return; }; - if (!(bzf->writing)) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - - if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0; - if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0; - if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0; - if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0; - - if ((!abandon) && bzf->lastErr == BZ_OK) { - while (True) { - bzf->strm.avail_out = BZ_MAX_UNUSED; - bzf->strm.next_out = bzf->buf; - ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); - if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END) - { BZ_SETERR(ret); return; }; - - if (bzf->strm.avail_out < BZ_MAX_UNUSED) { - n = BZ_MAX_UNUSED - bzf->strm.avail_out; - n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), - n, bzf->handle ); - if (n != n2 || ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - } - - if (ret == BZ_STREAM_END) break; - } - } - - if ( !abandon && !ferror ( bzf->handle ) ) { - fflush ( bzf->handle ); - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - } - - if (nbytes_in_lo32 != NULL) - *nbytes_in_lo32 = bzf->strm.total_in_lo32; - if (nbytes_in_hi32 != NULL) - *nbytes_in_hi32 = bzf->strm.total_in_hi32; - if (nbytes_out_lo32 != NULL) - *nbytes_out_lo32 = bzf->strm.total_out_lo32; - if (nbytes_out_hi32 != NULL) - *nbytes_out_hi32 = bzf->strm.total_out_hi32; - - BZ_SETERR(BZ_OK); - BZ2_bzCompressEnd ( &(bzf->strm) ); - free ( bzf ); -} - - -/*---------------------------------------------------*/ -BZFILE* BZ_API(BZ2_bzReadOpen) - ( int* bzerror, - FILE* f, - int verbosity, - int small, - void* unused, - int nUnused ) -{ - bzFile* bzf = NULL; - int ret; - - BZ_SETERR(BZ_OK); - - if (f == NULL || - (small != 0 && small != 1) || - (verbosity < 0 || verbosity > 4) || - (unused == NULL && nUnused != 0) || - (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) - { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; - - if (ferror(f)) - { BZ_SETERR(BZ_IO_ERROR); return NULL; }; - - bzf = malloc ( sizeof(bzFile) ); - if (bzf == NULL) - { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; - - BZ_SETERR(BZ_OK); - - bzf->initialisedOk = False; - bzf->handle = f; - bzf->bufN = 0; - bzf->writing = False; - bzf->strm.bzalloc = NULL; - bzf->strm.bzfree = NULL; - bzf->strm.opaque = NULL; - - while (nUnused > 0) { - bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; - unused = ((void*)( 1 + ((UChar*)(unused)) )); - nUnused--; - } - - ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); - if (ret != BZ_OK) - { BZ_SETERR(ret); free(bzf); return NULL; }; - - bzf->strm.avail_in = bzf->bufN; - bzf->strm.next_in = bzf->buf; - - bzf->initialisedOk = True; - return bzf; -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) -{ - bzFile* bzf = (bzFile*)b; - - BZ_SETERR(BZ_OK); - if (bzf == NULL) - { BZ_SETERR(BZ_OK); return; }; - - if (bzf->writing) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - - if (bzf->initialisedOk) - (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); - free ( bzf ); -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzRead) - ( int* bzerror, - BZFILE* b, - void* buf, - int len ) -{ - Int32 n, ret; - bzFile* bzf = (bzFile*)b; - - BZ_SETERR(BZ_OK); - - if (bzf == NULL || buf == NULL || len < 0) - { BZ_SETERR(BZ_PARAM_ERROR); return 0; }; - - if (bzf->writing) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; }; - - if (len == 0) - { BZ_SETERR(BZ_OK); return 0; }; - - bzf->strm.avail_out = len; - bzf->strm.next_out = buf; - - while (True) { - - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return 0; }; - - if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { - n = fread ( bzf->buf, sizeof(UChar), - BZ_MAX_UNUSED, bzf->handle ); - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return 0; }; - bzf->bufN = n; - bzf->strm.avail_in = bzf->bufN; - bzf->strm.next_in = bzf->buf; - } - - ret = BZ2_bzDecompress ( &(bzf->strm) ); - - if (ret != BZ_OK && ret != BZ_STREAM_END) - { BZ_SETERR(ret); return 0; }; - - if (ret == BZ_OK && myfeof(bzf->handle) && - bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) - { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; - - if (ret == BZ_STREAM_END) - { BZ_SETERR(BZ_STREAM_END); - return len - bzf->strm.avail_out; }; - if (bzf->strm.avail_out == 0) - { BZ_SETERR(BZ_OK); return len; }; - - } - - return 0; /*not reached*/ -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzReadGetUnused) - ( int* bzerror, - BZFILE* b, - void** unused, - int* nUnused ) -{ - bzFile* bzf = (bzFile*)b; - if (bzf == NULL) - { BZ_SETERR(BZ_PARAM_ERROR); return; }; - if (bzf->lastErr != BZ_STREAM_END) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - if (unused == NULL || nUnused == NULL) - { BZ_SETERR(BZ_PARAM_ERROR); return; }; - - BZ_SETERR(BZ_OK); - *nUnused = bzf->strm.avail_in; - *unused = bzf->strm.next_in; -} -#endif - - -/*---------------------------------------------------*/ -/*--- Misc convenience stuff ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzBuffToBuffCompress) - ( char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int blockSize100k, - int verbosity, - int workFactor ) -{ - bz_stream strm; - int ret; - - if (dest == NULL || destLen == NULL || - source == NULL || - blockSize100k < 1 || blockSize100k > 9 || - verbosity < 0 || verbosity > 4 || - workFactor < 0 || workFactor > 250) - return BZ_PARAM_ERROR; - - if (workFactor == 0) workFactor = 30; - strm.bzalloc = NULL; - strm.bzfree = NULL; - strm.opaque = NULL; - ret = BZ2_bzCompressInit ( &strm, blockSize100k, - verbosity, workFactor ); - if (ret != BZ_OK) return ret; - - strm.next_in = source; - strm.next_out = dest; - strm.avail_in = sourceLen; - strm.avail_out = *destLen; - - ret = BZ2_bzCompress ( &strm, BZ_FINISH ); - if (ret == BZ_FINISH_OK) goto output_overflow; - if (ret != BZ_STREAM_END) goto errhandler; - - /* normal termination */ - *destLen -= strm.avail_out; - BZ2_bzCompressEnd ( &strm ); - return BZ_OK; - - output_overflow: - BZ2_bzCompressEnd ( &strm ); - return BZ_OUTBUFF_FULL; - - errhandler: - BZ2_bzCompressEnd ( &strm ); - return ret; -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzBuffToBuffDecompress) - ( char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int small, - int verbosity ) -{ - bz_stream strm; - int ret; - - if (dest == NULL || destLen == NULL || - source == NULL || - (small != 0 && small != 1) || - verbosity < 0 || verbosity > 4) - return BZ_PARAM_ERROR; - - strm.bzalloc = NULL; - strm.bzfree = NULL; - strm.opaque = NULL; - ret = BZ2_bzDecompressInit ( &strm, verbosity, small ); - if (ret != BZ_OK) return ret; - - strm.next_in = source; - strm.next_out = dest; - strm.avail_in = sourceLen; - strm.avail_out = *destLen; - - ret = BZ2_bzDecompress ( &strm ); - if (ret == BZ_OK) goto output_overflow_or_eof; - if (ret != BZ_STREAM_END) goto errhandler; - - /* normal termination */ - *destLen -= strm.avail_out; - BZ2_bzDecompressEnd ( &strm ); - return BZ_OK; - - output_overflow_or_eof: - if (strm.avail_out > 0) { - BZ2_bzDecompressEnd ( &strm ); - return BZ_UNEXPECTED_EOF; - } else { - BZ2_bzDecompressEnd ( &strm ); - return BZ_OUTBUFF_FULL; - }; - - errhandler: - BZ2_bzDecompressEnd ( &strm ); - return ret; -} - - -/*---------------------------------------------------*/ -/*-- - Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) - to support better zlib compatibility. - This code is not _officially_ part of libbzip2 (yet); - I haven't tested it, documented it, or considered the - threading-safeness of it. - If this code breaks, please contact both Yoshioka and me. ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -/*-- - return version like "0.9.5d, 4-Sept-1999". ---*/ -const char * BZ_API(BZ2_bzlibVersion)(void) -{ - return BZ_VERSION; -} - - -#ifndef BZ_NO_STDIO -/*---------------------------------------------------*/ - -#if defined(_WIN32) || defined(OS2) || defined(MSDOS) -# include -# include -# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY) -#else -# define SET_BINARY_MODE(file) -#endif -static -BZFILE * bzopen_or_bzdopen - ( const char *path, /* no use when bzdopen */ - int fd, /* no use when bzdopen */ - const char *mode, - int open_mode) /* bzopen: 0, bzdopen:1 */ -{ - int bzerr; - char unused[BZ_MAX_UNUSED]; - int blockSize100k = 9; - int writing = 0; - char mode2[10] = ""; - FILE *fp = NULL; - BZFILE *bzfp = NULL; - int verbosity = 0; - int workFactor = 30; - int smallMode = 0; - int nUnused = 0; - - if (mode == NULL) return NULL; - while (*mode) { - switch (*mode) { - case 'r': - writing = 0; break; - case 'w': - writing = 1; break; - case 's': - smallMode = 1; break; - default: - if (isdigit((int)(*mode))) { - blockSize100k = *mode-BZ_HDR_0; - } - } - mode++; - } - strcat(mode2, writing ? "w" : "r" ); - strcat(mode2,"b"); /* binary mode */ - - if (open_mode==0) { - if (path==NULL || strcmp(path,"")==0) { - fp = (writing ? stdout : stdin); - SET_BINARY_MODE(fp); - } else { - fp = fopen(path,mode2); - } - } else { -#ifdef BZ_STRICT_ANSI - fp = NULL; -#else - fp = fdopen(fd,mode2); -#endif - } - if (fp == NULL) return NULL; - - if (writing) { - /* Guard against total chaos and anarchy -- JRS */ - if (blockSize100k < 1) blockSize100k = 1; - if (blockSize100k > 9) blockSize100k = 9; - bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, - verbosity,workFactor); - } else { - bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode, - unused,nUnused); - } - if (bzfp == NULL) { - if (fp != stdin && fp != stdout) fclose(fp); - return NULL; - } - return bzfp; -} - - -/*---------------------------------------------------*/ -/*-- - open file for read or write. - ex) bzopen("file","w9") - case path="" or NULL => use stdin or stdout. ---*/ -BZFILE * BZ_API(BZ2_bzopen) - ( const char *path, - const char *mode ) -{ - return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0); -} - - -/*---------------------------------------------------*/ -BZFILE * BZ_API(BZ2_bzdopen) - ( int fd, - const char *mode ) -{ - return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1); -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len ) -{ - int bzerr, nread; - if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0; - nread = BZ2_bzRead(&bzerr,b,buf,len); - if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) { - return nread; - } else { - return -1; - } -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len ) -{ - int bzerr; - - BZ2_bzWrite(&bzerr,b,buf,len); - if(bzerr == BZ_OK){ - return len; - }else{ - return -1; - } -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzflush) (BZFILE *b) -{ - /* do nothing now... */ - return 0; -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzclose) (BZFILE* b) -{ - int bzerr; - FILE *fp; - - if (b==NULL) {return;} - fp = ((bzFile *)b)->handle; - if(((bzFile*)b)->writing){ - BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); - if(bzerr != BZ_OK){ - BZ2_bzWriteClose(NULL,b,1,NULL,NULL); - } - }else{ - BZ2_bzReadClose(&bzerr,b); - } - if(fp!=stdin && fp!=stdout){ - fclose(fp); - } -} - - -/*---------------------------------------------------*/ -/*-- - return last error code ---*/ -static const char *bzerrorstrings[] = { - "OK" - ,"SEQUENCE_ERROR" - ,"PARAM_ERROR" - ,"MEM_ERROR" - ,"DATA_ERROR" - ,"DATA_ERROR_MAGIC" - ,"IO_ERROR" - ,"UNEXPECTED_EOF" - ,"OUTBUFF_FULL" - ,"CONFIG_ERROR" - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ -}; - - -const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) -{ - int err = ((bzFile *)b)->lastErr; - - if(err>0) err = 0; - *errnum = err; - return bzerrorstrings[err*-1]; -} -#endif - - -/*-------------------------------------------------------------*/ -/*--- end bzlib.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/bzlib.h b/dep/src/bzip2/bzlib.h deleted file mode 100644 index c5b75d6d8ff..00000000000 --- a/dep/src/bzip2/bzlib.h +++ /dev/null @@ -1,282 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Public header file for the library. ---*/ -/*--- bzlib.h ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#ifndef _BZLIB_H -#define _BZLIB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define BZ_RUN 0 -#define BZ_FLUSH 1 -#define BZ_FINISH 2 - -#define BZ_OK 0 -#define BZ_RUN_OK 1 -#define BZ_FLUSH_OK 2 -#define BZ_FINISH_OK 3 -#define BZ_STREAM_END 4 -#define BZ_SEQUENCE_ERROR (-1) -#define BZ_PARAM_ERROR (-2) -#define BZ_MEM_ERROR (-3) -#define BZ_DATA_ERROR (-4) -#define BZ_DATA_ERROR_MAGIC (-5) -#define BZ_IO_ERROR (-6) -#define BZ_UNEXPECTED_EOF (-7) -#define BZ_OUTBUFF_FULL (-8) -#define BZ_CONFIG_ERROR (-9) - -typedef - struct { - char *next_in; - unsigned int avail_in; - unsigned int total_in_lo32; - unsigned int total_in_hi32; - - char *next_out; - unsigned int avail_out; - unsigned int total_out_lo32; - unsigned int total_out_hi32; - - void *state; - - void *(*bzalloc)(void *,int,int); - void (*bzfree)(void *,void *); - void *opaque; - } - bz_stream; - - -#ifndef BZ_IMPORT -#define BZ_EXPORT -#endif - -#ifndef BZ_NO_STDIO -/* Need a definitition for FILE */ -#include -#endif - -#ifdef _WIN32 -# include -# ifdef small - /* windows.h define small to char */ -# undef small -# endif -# ifdef BZ_EXPORT -# define BZ_API(func) WINAPI func -# define BZ_EXTERN extern -# else - /* import windows dll dynamically */ -# define BZ_API(func) (WINAPI * func) -# define BZ_EXTERN -# endif -#else -# define BZ_API(func) func -# define BZ_EXTERN extern -#endif - - -/*-- Core (low-level) library functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( - bz_stream* strm, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompress) ( - bz_stream* strm, - int action - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( - bz_stream *strm, - int verbosity, - int small - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( - bz_stream *strm - ); - - - -/*-- High(er) level library functions --*/ - -#ifndef BZ_NO_STDIO -#define BZ_MAX_UNUSED 5000 - -typedef void BZFILE; - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( - int* bzerror, - FILE* f, - int verbosity, - int small, - void* unused, - int nUnused - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( - int* bzerror, - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( - int* bzerror, - BZFILE* b, - void** unused, - int* nUnused - ); - -BZ_EXTERN int BZ_API(BZ2_bzRead) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( - int* bzerror, - FILE* f, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN void BZ_API(BZ2_bzWrite) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in, - unsigned int* nbytes_out - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in_lo32, - unsigned int* nbytes_in_hi32, - unsigned int* nbytes_out_lo32, - unsigned int* nbytes_out_hi32 - ); -#endif - - -/*-- Utility functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int small, - int verbosity - ); - - -/*-- - Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) - to support better zlib compatibility. - This code is not _officially_ part of libbzip2 (yet); - I haven't tested it, documented it, or considered the - threading-safeness of it. - If this code breaks, please contact both Yoshioka and me. ---*/ - -BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( - void - ); - -#ifndef BZ_NO_STDIO -BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( - const char *path, - const char *mode - ); - -BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( - int fd, - const char *mode - ); - -BZ_EXTERN int BZ_API(BZ2_bzread) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzwrite) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzflush) ( - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzclose) ( - BZFILE* b - ); - -BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( - BZFILE *b, - int *errnum - ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/*-------------------------------------------------------------*/ -/*--- end bzlib.h ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/bzlib_private.h b/dep/src/bzip2/bzlib_private.h deleted file mode 100644 index 23427879b18..00000000000 --- a/dep/src/bzip2/bzlib_private.h +++ /dev/null @@ -1,509 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Private header file for the library. ---*/ -/*--- bzlib_private.h ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#ifndef _BZLIB_PRIVATE_H -#define _BZLIB_PRIVATE_H - -#include - -#ifndef BZ_NO_STDIO -#include -#include -#include -#endif - -#include "bzlib.h" - - - -/*-- General stuff. --*/ - -#define BZ_VERSION "1.0.5, 10-Dec-2007" - -typedef char Char; -typedef unsigned char Bool; -typedef unsigned char UChar; -typedef int Int32; -typedef unsigned int UInt32; -typedef short Int16; -typedef unsigned short UInt16; - -#define True ((Bool)1) -#define False ((Bool)0) - -#ifndef __GNUC__ -#define __inline__ /* */ -#endif - -#ifndef BZ_NO_STDIO - -extern void BZ2_bz__AssertH__fail ( int errcode ); -#define AssertH(cond,errcode) \ - { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } - -#if BZ_DEBUG -#define AssertD(cond,msg) \ - { if (!(cond)) { \ - fprintf ( stderr, \ - "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ - exit(1); \ - }} -#else -#define AssertD(cond,msg) /* */ -#endif - -#define VPrintf0(zf) \ - fprintf(stderr,zf) -#define VPrintf1(zf,za1) \ - fprintf(stderr,zf,za1) -#define VPrintf2(zf,za1,za2) \ - fprintf(stderr,zf,za1,za2) -#define VPrintf3(zf,za1,za2,za3) \ - fprintf(stderr,zf,za1,za2,za3) -#define VPrintf4(zf,za1,za2,za3,za4) \ - fprintf(stderr,zf,za1,za2,za3,za4) -#define VPrintf5(zf,za1,za2,za3,za4,za5) \ - fprintf(stderr,zf,za1,za2,za3,za4,za5) - -#else - -extern void bz_internal_error ( int errcode ); -#define AssertH(cond,errcode) \ - { if (!(cond)) bz_internal_error ( errcode ); } -#define AssertD(cond,msg) do { } while (0) -#define VPrintf0(zf) do { } while (0) -#define VPrintf1(zf,za1) do { } while (0) -#define VPrintf2(zf,za1,za2) do { } while (0) -#define VPrintf3(zf,za1,za2,za3) do { } while (0) -#define VPrintf4(zf,za1,za2,za3,za4) do { } while (0) -#define VPrintf5(zf,za1,za2,za3,za4,za5) do { } while (0) - -#endif - - -#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1) -#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp)) - - -/*-- Header bytes. --*/ - -#define BZ_HDR_B 0x42 /* 'B' */ -#define BZ_HDR_Z 0x5a /* 'Z' */ -#define BZ_HDR_h 0x68 /* 'h' */ -#define BZ_HDR_0 0x30 /* '0' */ - -/*-- Constants for the back end. --*/ - -#define BZ_MAX_ALPHA_SIZE 258 -#define BZ_MAX_CODE_LEN 23 - -#define BZ_RUNA 0 -#define BZ_RUNB 1 - -#define BZ_N_GROUPS 6 -#define BZ_G_SIZE 50 -#define BZ_N_ITERS 4 - -#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE)) - - - -/*-- Stuff for randomising repetitive blocks. --*/ - -extern Int32 BZ2_rNums[512]; - -#define BZ_RAND_DECLS \ - Int32 rNToGo; \ - Int32 rTPos \ - -#define BZ_RAND_INIT_MASK \ - s->rNToGo = 0; \ - s->rTPos = 0 \ - -#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0) - -#define BZ_RAND_UPD_MASK \ - if (s->rNToGo == 0) { \ - s->rNToGo = BZ2_rNums[s->rTPos]; \ - s->rTPos++; \ - if (s->rTPos == 512) s->rTPos = 0; \ - } \ - s->rNToGo--; - - - -/*-- Stuff for doing CRCs. --*/ - -extern UInt32 BZ2_crc32Table[256]; - -#define BZ_INITIALISE_CRC(crcVar) \ -{ \ - crcVar = 0xffffffffL; \ -} - -#define BZ_FINALISE_CRC(crcVar) \ -{ \ - crcVar = ~(crcVar); \ -} - -#define BZ_UPDATE_CRC(crcVar,cha) \ -{ \ - crcVar = (crcVar << 8) ^ \ - BZ2_crc32Table[(crcVar >> 24) ^ \ - ((UChar)cha)]; \ -} - - - -/*-- States and modes for compression. --*/ - -#define BZ_M_IDLE 1 -#define BZ_M_RUNNING 2 -#define BZ_M_FLUSHING 3 -#define BZ_M_FINISHING 4 - -#define BZ_S_OUTPUT 1 -#define BZ_S_INPUT 2 - -#define BZ_N_RADIX 2 -#define BZ_N_QSORT 12 -#define BZ_N_SHELL 18 -#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2) - - - - -/*-- Structure holding all the compression-side stuff. --*/ - -typedef - struct { - /* pointer back to the struct bz_stream */ - bz_stream* strm; - - /* mode this stream is in, and whether inputting */ - /* or outputting data */ - Int32 mode; - Int32 state; - - /* remembers avail_in when flush/finish requested */ - UInt32 avail_in_expect; - - /* for doing the block sorting */ - UInt32* arr1; - UInt32* arr2; - UInt32* ftab; - Int32 origPtr; - - /* aliases for arr1 and arr2 */ - UInt32* ptr; - UChar* block; - UInt16* mtfv; - UChar* zbits; - - /* for deciding when to use the fallback sorting algorithm */ - Int32 workFactor; - - /* run-length-encoding of the input */ - UInt32 state_in_ch; - Int32 state_in_len; - BZ_RAND_DECLS; - - /* input and output limits and current posns */ - Int32 nblock; - Int32 nblockMAX; - Int32 numZ; - Int32 state_out_pos; - - /* map of bytes used in block */ - Int32 nInUse; - Bool inUse[256]; - UChar unseqToSeq[256]; - - /* the buffer for bit stream creation */ - UInt32 bsBuff; - Int32 bsLive; - - /* block and combined CRCs */ - UInt32 blockCRC; - UInt32 combinedCRC; - - /* misc administratium */ - Int32 verbosity; - Int32 blockNo; - Int32 blockSize100k; - - /* stuff for coding the MTF values */ - Int32 nMTF; - Int32 mtfFreq [BZ_MAX_ALPHA_SIZE]; - UChar selector [BZ_MAX_SELECTORS]; - UChar selectorMtf[BZ_MAX_SELECTORS]; - - UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - /* second dimension: only 3 needed; 4 makes index calculations faster */ - UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; - - } - EState; - - - -/*-- externs for compression. --*/ - -extern void -BZ2_blockSort ( EState* ); - -extern void -BZ2_compressBlock ( EState*, Bool ); - -extern void -BZ2_bsInitWrite ( EState* ); - -extern void -BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); - -extern void -BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); - - - -/*-- states for decompression. --*/ - -#define BZ_X_IDLE 1 -#define BZ_X_OUTPUT 2 - -#define BZ_X_MAGIC_1 10 -#define BZ_X_MAGIC_2 11 -#define BZ_X_MAGIC_3 12 -#define BZ_X_MAGIC_4 13 -#define BZ_X_BLKHDR_1 14 -#define BZ_X_BLKHDR_2 15 -#define BZ_X_BLKHDR_3 16 -#define BZ_X_BLKHDR_4 17 -#define BZ_X_BLKHDR_5 18 -#define BZ_X_BLKHDR_6 19 -#define BZ_X_BCRC_1 20 -#define BZ_X_BCRC_2 21 -#define BZ_X_BCRC_3 22 -#define BZ_X_BCRC_4 23 -#define BZ_X_RANDBIT 24 -#define BZ_X_ORIGPTR_1 25 -#define BZ_X_ORIGPTR_2 26 -#define BZ_X_ORIGPTR_3 27 -#define BZ_X_MAPPING_1 28 -#define BZ_X_MAPPING_2 29 -#define BZ_X_SELECTOR_1 30 -#define BZ_X_SELECTOR_2 31 -#define BZ_X_SELECTOR_3 32 -#define BZ_X_CODING_1 33 -#define BZ_X_CODING_2 34 -#define BZ_X_CODING_3 35 -#define BZ_X_MTF_1 36 -#define BZ_X_MTF_2 37 -#define BZ_X_MTF_3 38 -#define BZ_X_MTF_4 39 -#define BZ_X_MTF_5 40 -#define BZ_X_MTF_6 41 -#define BZ_X_ENDHDR_2 42 -#define BZ_X_ENDHDR_3 43 -#define BZ_X_ENDHDR_4 44 -#define BZ_X_ENDHDR_5 45 -#define BZ_X_ENDHDR_6 46 -#define BZ_X_CCRC_1 47 -#define BZ_X_CCRC_2 48 -#define BZ_X_CCRC_3 49 -#define BZ_X_CCRC_4 50 - - - -/*-- Constants for the fast MTF decoder. --*/ - -#define MTFA_SIZE 4096 -#define MTFL_SIZE 16 - - - -/*-- Structure holding all the decompression-side stuff. --*/ - -typedef - struct { - /* pointer back to the struct bz_stream */ - bz_stream* strm; - - /* state indicator for this stream */ - Int32 state; - - /* for doing the final run-length decoding */ - UChar state_out_ch; - Int32 state_out_len; - Bool blockRandomised; - BZ_RAND_DECLS; - - /* the buffer for bit stream reading */ - UInt32 bsBuff; - Int32 bsLive; - - /* misc administratium */ - Int32 blockSize100k; - Bool smallDecompress; - Int32 currBlockNo; - Int32 verbosity; - - /* for undoing the Burrows-Wheeler transform */ - Int32 origPtr; - UInt32 tPos; - Int32 k0; - Int32 unzftab[256]; - Int32 nblock_used; - Int32 cftab[257]; - Int32 cftabCopy[257]; - - /* for undoing the Burrows-Wheeler transform (FAST) */ - UInt32 *tt; - - /* for undoing the Burrows-Wheeler transform (SMALL) */ - UInt16 *ll16; - UChar *ll4; - - /* stored and calculated CRCs */ - UInt32 storedBlockCRC; - UInt32 storedCombinedCRC; - UInt32 calculatedBlockCRC; - UInt32 calculatedCombinedCRC; - - /* map of bytes used in block */ - Int32 nInUse; - Bool inUse[256]; - Bool inUse16[16]; - UChar seqToUnseq[256]; - - /* for decoding the MTF values */ - UChar mtfa [MTFA_SIZE]; - Int32 mtfbase[256 / MTFL_SIZE]; - UChar selector [BZ_MAX_SELECTORS]; - UChar selectorMtf[BZ_MAX_SELECTORS]; - UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - - Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - Int32 minLens[BZ_N_GROUPS]; - - /* save area for scalars in the main decompress code */ - Int32 save_i; - Int32 save_j; - Int32 save_t; - Int32 save_alphaSize; - Int32 save_nGroups; - Int32 save_nSelectors; - Int32 save_EOB; - Int32 save_groupNo; - Int32 save_groupPos; - Int32 save_nextSym; - Int32 save_nblockMAX; - Int32 save_nblock; - Int32 save_es; - Int32 save_N; - Int32 save_curr; - Int32 save_zt; - Int32 save_zn; - Int32 save_zvec; - Int32 save_zj; - Int32 save_gSel; - Int32 save_gMinlen; - Int32* save_gLimit; - Int32* save_gBase; - Int32* save_gPerm; - - } - DState; - - - -/*-- Macros for decompression. --*/ - -#define BZ_GET_FAST(cccc) \ - /* c_tPos is unsigned, hence test < 0 is pointless. */ \ - if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \ - s->tPos = s->tt[s->tPos]; \ - cccc = (UChar)(s->tPos & 0xff); \ - s->tPos >>= 8; - -#define BZ_GET_FAST_C(cccc) \ - /* c_tPos is unsigned, hence test < 0 is pointless. */ \ - if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \ - c_tPos = c_tt[c_tPos]; \ - cccc = (UChar)(c_tPos & 0xff); \ - c_tPos >>= 8; - -#define SET_LL4(i,n) \ - { if (((i) & 0x1) == 0) \ - s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \ - s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \ - } - -#define GET_LL4(i) \ - ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF) - -#define SET_LL(i,n) \ - { s->ll16[i] = (UInt16)(n & 0x0000ffff); \ - SET_LL4(i, n >> 16); \ - } - -#define GET_LL(i) \ - (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) - -#define BZ_GET_SMALL(cccc) \ - /* c_tPos is unsigned, hence test < 0 is pointless. */ \ - if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \ - cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \ - s->tPos = GET_LL(s->tPos); - - -/*-- externs for decompression. --*/ - -extern Int32 -BZ2_indexIntoF ( Int32, Int32* ); - -extern Int32 -BZ2_decompress ( DState* ); - -extern void -BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, - Int32, Int32, Int32 ); - - -#endif - - -/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/ - -#ifdef BZ_NO_STDIO -#ifndef NULL -#define NULL 0 -#endif -#endif - - -/*-------------------------------------------------------------*/ -/*--- end bzlib_private.h ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/compress.c b/dep/src/bzip2/compress.c deleted file mode 100644 index 8c80a079700..00000000000 --- a/dep/src/bzip2/compress.c +++ /dev/null @@ -1,672 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Compression machinery (not incl block sorting) ---*/ -/*--- compress.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -/* CHANGES - 0.9.0 -- original version. - 0.9.0a/b -- no changes in this file. - 0.9.0c -- changed setting of nGroups in sendMTFValues() - so as to do a bit better on small files -*/ - -#include "bzlib_private.h" - - -/*---------------------------------------------------*/ -/*--- Bit stream I/O ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -void BZ2_bsInitWrite ( EState* s ) -{ - s->bsLive = 0; - s->bsBuff = 0; -} - - -/*---------------------------------------------------*/ -static -void bsFinishWrite ( EState* s ) -{ - while (s->bsLive > 0) { - s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24); - s->numZ++; - s->bsBuff <<= 8; - s->bsLive -= 8; - } -} - - -/*---------------------------------------------------*/ -#define bsNEEDW(nz) \ -{ \ - while (s->bsLive >= 8) { \ - s->zbits[s->numZ] \ - = (UChar)(s->bsBuff >> 24); \ - s->numZ++; \ - s->bsBuff <<= 8; \ - s->bsLive -= 8; \ - } \ -} - - -/*---------------------------------------------------*/ -static -__inline__ -void bsW ( EState* s, Int32 n, UInt32 v ) -{ - bsNEEDW ( n ); - s->bsBuff |= (v << (32 - s->bsLive - n)); - s->bsLive += n; -} - - -/*---------------------------------------------------*/ -static -void bsPutUInt32 ( EState* s, UInt32 u ) -{ - bsW ( s, 8, (u >> 24) & 0xffL ); - bsW ( s, 8, (u >> 16) & 0xffL ); - bsW ( s, 8, (u >> 8) & 0xffL ); - bsW ( s, 8, u & 0xffL ); -} - - -/*---------------------------------------------------*/ -static -void bsPutUChar ( EState* s, UChar c ) -{ - bsW( s, 8, (UInt32)c ); -} - - -/*---------------------------------------------------*/ -/*--- The back end proper ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -static -void makeMaps_e ( EState* s ) -{ - Int32 i; - s->nInUse = 0; - for (i = 0; i < 256; i++) - if (s->inUse[i]) { - s->unseqToSeq[i] = s->nInUse; - s->nInUse++; - } -} - - -/*---------------------------------------------------*/ -static -void generateMTFValues ( EState* s ) -{ - UChar yy[256]; - Int32 i, j; - Int32 zPend; - Int32 wr; - Int32 EOB; - - /* - After sorting (eg, here), - s->arr1 [ 0 .. s->nblock-1 ] holds sorted order, - and - ((UChar*)s->arr2) [ 0 .. s->nblock-1 ] - holds the original block data. - - The first thing to do is generate the MTF values, - and put them in - ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ]. - Because there are strictly fewer or equal MTF values - than block values, ptr values in this area are overwritten - with MTF values only when they are no longer needed. - - The final compressed bitstream is generated into the - area starting at - (UChar*) (&((UChar*)s->arr2)[s->nblock]) - - These storage aliases are set up in bzCompressInit(), - except for the last one, which is arranged in - compressBlock(). - */ - UInt32* ptr = s->ptr; - UChar* block = s->block; - UInt16* mtfv = s->mtfv; - - makeMaps_e ( s ); - EOB = s->nInUse+1; - - for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0; - - wr = 0; - zPend = 0; - for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i; - - for (i = 0; i < s->nblock; i++) { - UChar ll_i; - AssertD ( wr <= i, "generateMTFValues(1)" ); - j = ptr[i]-1; if (j < 0) j += s->nblock; - ll_i = s->unseqToSeq[block[j]]; - AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" ); - - if (yy[0] == ll_i) { - zPend++; - } else { - - if (zPend > 0) { - zPend--; - while (True) { - if (zPend & 1) { - mtfv[wr] = BZ_RUNB; wr++; - s->mtfFreq[BZ_RUNB]++; - } else { - mtfv[wr] = BZ_RUNA; wr++; - s->mtfFreq[BZ_RUNA]++; - } - if (zPend < 2) break; - zPend = (zPend - 2) / 2; - }; - zPend = 0; - } - { - register UChar rtmp; - register UChar* ryy_j; - register UChar rll_i; - rtmp = yy[1]; - yy[1] = yy[0]; - ryy_j = &(yy[1]); - rll_i = ll_i; - while ( rll_i != rtmp ) { - register UChar rtmp2; - ryy_j++; - rtmp2 = rtmp; - rtmp = *ryy_j; - *ryy_j = rtmp2; - }; - yy[0] = rtmp; - j = ryy_j - &(yy[0]); - mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++; - } - - } - } - - if (zPend > 0) { - zPend--; - while (True) { - if (zPend & 1) { - mtfv[wr] = BZ_RUNB; wr++; - s->mtfFreq[BZ_RUNB]++; - } else { - mtfv[wr] = BZ_RUNA; wr++; - s->mtfFreq[BZ_RUNA]++; - } - if (zPend < 2) break; - zPend = (zPend - 2) / 2; - }; - zPend = 0; - } - - mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++; - - s->nMTF = wr; -} - - -/*---------------------------------------------------*/ -#define BZ_LESSER_ICOST 0 -#define BZ_GREATER_ICOST 15 - -static -void sendMTFValues ( EState* s ) -{ - Int32 v, t, i, j, gs, ge, totc, bt, bc, iter; - Int32 nSelectors, alphaSize, minLen, maxLen, selCtr; - Int32 nGroups, nBytes; - - /*-- - UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - is a global since the decoder also needs it. - - Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - are also globals only used in this proc. - Made global to keep stack frame size small. - --*/ - - - UInt16 cost[BZ_N_GROUPS]; - Int32 fave[BZ_N_GROUPS]; - - UInt16* mtfv = s->mtfv; - - if (s->verbosity >= 3) - VPrintf3( " %d in block, %d after MTF & 1-2 coding, " - "%d+2 syms in use\n", - s->nblock, s->nMTF, s->nInUse ); - - alphaSize = s->nInUse+2; - for (t = 0; t < BZ_N_GROUPS; t++) - for (v = 0; v < alphaSize; v++) - s->len[t][v] = BZ_GREATER_ICOST; - - /*--- Decide how many coding tables to use ---*/ - AssertH ( s->nMTF > 0, 3001 ); - if (s->nMTF < 200) nGroups = 2; else - if (s->nMTF < 600) nGroups = 3; else - if (s->nMTF < 1200) nGroups = 4; else - if (s->nMTF < 2400) nGroups = 5; else - nGroups = 6; - - /*--- Generate an initial set of coding tables ---*/ - { - Int32 nPart, remF, tFreq, aFreq; - - nPart = nGroups; - remF = s->nMTF; - gs = 0; - while (nPart > 0) { - tFreq = remF / nPart; - ge = gs-1; - aFreq = 0; - while (aFreq < tFreq && ge < alphaSize-1) { - ge++; - aFreq += s->mtfFreq[ge]; - } - - if (ge > gs - && nPart != nGroups && nPart != 1 - && ((nGroups-nPart) % 2 == 1)) { - aFreq -= s->mtfFreq[ge]; - ge--; - } - - if (s->verbosity >= 3) - VPrintf5( " initial group %d, [%d .. %d], " - "has %d syms (%4.1f%%)\n", - nPart, gs, ge, aFreq, - (100.0 * (float)aFreq) / (float)(s->nMTF) ); - - for (v = 0; v < alphaSize; v++) - if (v >= gs && v <= ge) - s->len[nPart-1][v] = BZ_LESSER_ICOST; else - s->len[nPart-1][v] = BZ_GREATER_ICOST; - - nPart--; - gs = ge+1; - remF -= aFreq; - } - } - - /*--- - Iterate up to BZ_N_ITERS times to improve the tables. - ---*/ - for (iter = 0; iter < BZ_N_ITERS; iter++) { - - for (t = 0; t < nGroups; t++) fave[t] = 0; - - for (t = 0; t < nGroups; t++) - for (v = 0; v < alphaSize; v++) - s->rfreq[t][v] = 0; - - /*--- - Set up an auxiliary length table which is used to fast-track - the common case (nGroups == 6). - ---*/ - if (nGroups == 6) { - for (v = 0; v < alphaSize; v++) { - s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v]; - s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v]; - s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v]; - } - } - - nSelectors = 0; - totc = 0; - gs = 0; - while (True) { - - /*--- Set group start & end marks. --*/ - if (gs >= s->nMTF) break; - ge = gs + BZ_G_SIZE - 1; - if (ge >= s->nMTF) ge = s->nMTF-1; - - /*-- - Calculate the cost of this group as coded - by each of the coding tables. - --*/ - for (t = 0; t < nGroups; t++) cost[t] = 0; - - if (nGroups == 6 && 50 == ge-gs+1) { - /*--- fast track the common case ---*/ - register UInt32 cost01, cost23, cost45; - register UInt16 icv; - cost01 = cost23 = cost45 = 0; - -# define BZ_ITER(nn) \ - icv = mtfv[gs+(nn)]; \ - cost01 += s->len_pack[icv][0]; \ - cost23 += s->len_pack[icv][1]; \ - cost45 += s->len_pack[icv][2]; \ - - BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4); - BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9); - BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14); - BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19); - BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24); - BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29); - BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34); - BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39); - BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44); - BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49); - -# undef BZ_ITER - - cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16; - cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16; - cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16; - - } else { - /*--- slow version which correctly handles all situations ---*/ - for (i = gs; i <= ge; i++) { - UInt16 icv = mtfv[i]; - for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv]; - } - } - - /*-- - Find the coding table which is best for this group, - and record its identity in the selector table. - --*/ - bc = 999999999; bt = -1; - for (t = 0; t < nGroups; t++) - if (cost[t] < bc) { bc = cost[t]; bt = t; }; - totc += bc; - fave[bt]++; - s->selector[nSelectors] = bt; - nSelectors++; - - /*-- - Increment the symbol frequencies for the selected table. - --*/ - if (nGroups == 6 && 50 == ge-gs+1) { - /*--- fast track the common case ---*/ - -# define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++ - - BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4); - BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9); - BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14); - BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19); - BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24); - BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29); - BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34); - BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39); - BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44); - BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49); - -# undef BZ_ITUR - - } else { - /*--- slow version which correctly handles all situations ---*/ - for (i = gs; i <= ge; i++) - s->rfreq[bt][ mtfv[i] ]++; - } - - gs = ge+1; - } - if (s->verbosity >= 3) { - VPrintf2 ( " pass %d: size is %d, grp uses are ", - iter+1, totc/8 ); - for (t = 0; t < nGroups; t++) - VPrintf1 ( "%d ", fave[t] ); - VPrintf0 ( "\n" ); - } - - /*-- - Recompute the tables based on the accumulated frequencies. - --*/ - /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See - comment in huffman.c for details. */ - for (t = 0; t < nGroups; t++) - BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), - alphaSize, 17 /*20*/ ); - } - - - AssertH( nGroups < 8, 3002 ); - AssertH( nSelectors < 32768 && - nSelectors <= (2 + (900000 / BZ_G_SIZE)), - 3003 ); - - - /*--- Compute MTF values for the selectors. ---*/ - { - UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp; - for (i = 0; i < nGroups; i++) pos[i] = i; - for (i = 0; i < nSelectors; i++) { - ll_i = s->selector[i]; - j = 0; - tmp = pos[j]; - while ( ll_i != tmp ) { - j++; - tmp2 = tmp; - tmp = pos[j]; - pos[j] = tmp2; - }; - pos[0] = tmp; - s->selectorMtf[i] = j; - } - }; - - /*--- Assign actual codes for the tables. --*/ - for (t = 0; t < nGroups; t++) { - minLen = 32; - maxLen = 0; - for (i = 0; i < alphaSize; i++) { - if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; - if (s->len[t][i] < minLen) minLen = s->len[t][i]; - } - AssertH ( !(maxLen > 17 /*20*/ ), 3004 ); - AssertH ( !(minLen < 1), 3005 ); - BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), - minLen, maxLen, alphaSize ); - } - - /*--- Transmit the mapping table. ---*/ - { - Bool inUse16[16]; - for (i = 0; i < 16; i++) { - inUse16[i] = False; - for (j = 0; j < 16; j++) - if (s->inUse[i * 16 + j]) inUse16[i] = True; - } - - nBytes = s->numZ; - for (i = 0; i < 16; i++) - if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0); - - for (i = 0; i < 16; i++) - if (inUse16[i]) - for (j = 0; j < 16; j++) { - if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0); - } - - if (s->verbosity >= 3) - VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes ); - } - - /*--- Now the selectors. ---*/ - nBytes = s->numZ; - bsW ( s, 3, nGroups ); - bsW ( s, 15, nSelectors ); - for (i = 0; i < nSelectors; i++) { - for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1); - bsW(s,1,0); - } - if (s->verbosity >= 3) - VPrintf1( "selectors %d, ", s->numZ-nBytes ); - - /*--- Now the coding tables. ---*/ - nBytes = s->numZ; - - for (t = 0; t < nGroups; t++) { - Int32 curr = s->len[t][0]; - bsW ( s, 5, curr ); - for (i = 0; i < alphaSize; i++) { - while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ }; - while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ }; - bsW ( s, 1, 0 ); - } - } - - if (s->verbosity >= 3) - VPrintf1 ( "code lengths %d, ", s->numZ-nBytes ); - - /*--- And finally, the block data proper ---*/ - nBytes = s->numZ; - selCtr = 0; - gs = 0; - while (True) { - if (gs >= s->nMTF) break; - ge = gs + BZ_G_SIZE - 1; - if (ge >= s->nMTF) ge = s->nMTF-1; - AssertH ( s->selector[selCtr] < nGroups, 3006 ); - - if (nGroups == 6 && 50 == ge-gs+1) { - /*--- fast track the common case ---*/ - UInt16 mtfv_i; - UChar* s_len_sel_selCtr - = &(s->len[s->selector[selCtr]][0]); - Int32* s_code_sel_selCtr - = &(s->code[s->selector[selCtr]][0]); - -# define BZ_ITAH(nn) \ - mtfv_i = mtfv[gs+(nn)]; \ - bsW ( s, \ - s_len_sel_selCtr[mtfv_i], \ - s_code_sel_selCtr[mtfv_i] ) - - BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4); - BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9); - BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14); - BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19); - BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24); - BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29); - BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34); - BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39); - BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44); - BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49); - -# undef BZ_ITAH - - } else { - /*--- slow version which correctly handles all situations ---*/ - for (i = gs; i <= ge; i++) { - bsW ( s, - s->len [s->selector[selCtr]] [mtfv[i]], - s->code [s->selector[selCtr]] [mtfv[i]] ); - } - } - - - gs = ge+1; - selCtr++; - } - AssertH( selCtr == nSelectors, 3007 ); - - if (s->verbosity >= 3) - VPrintf1( "codes %d\n", s->numZ-nBytes ); -} - - -/*---------------------------------------------------*/ -void BZ2_compressBlock ( EState* s, Bool is_last_block ) -{ - if (s->nblock > 0) { - - BZ_FINALISE_CRC ( s->blockCRC ); - s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31); - s->combinedCRC ^= s->blockCRC; - if (s->blockNo > 1) s->numZ = 0; - - if (s->verbosity >= 2) - VPrintf4( " block %d: crc = 0x%08x, " - "combined CRC = 0x%08x, size = %d\n", - s->blockNo, s->blockCRC, s->combinedCRC, s->nblock ); - - BZ2_blockSort ( s ); - } - - s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]); - - /*-- If this is the first block, create the stream header. --*/ - if (s->blockNo == 1) { - BZ2_bsInitWrite ( s ); - bsPutUChar ( s, BZ_HDR_B ); - bsPutUChar ( s, BZ_HDR_Z ); - bsPutUChar ( s, BZ_HDR_h ); - bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) ); - } - - if (s->nblock > 0) { - - bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 ); - bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 ); - bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 ); - - /*-- Now the block's CRC, so it is in a known place. --*/ - bsPutUInt32 ( s, s->blockCRC ); - - /*-- - Now a single bit indicating (non-)randomisation. - As of version 0.9.5, we use a better sorting algorithm - which makes randomisation unnecessary. So always set - the randomised bit to 'no'. Of course, the decoder - still needs to be able to handle randomised blocks - so as to maintain backwards compatibility with - older versions of bzip2. - --*/ - bsW(s,1,0); - - bsW ( s, 24, s->origPtr ); - generateMTFValues ( s ); - sendMTFValues ( s ); - } - - - /*-- If this is the last block, add the stream trailer. --*/ - if (is_last_block) { - - bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 ); - bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 ); - bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 ); - bsPutUInt32 ( s, s->combinedCRC ); - if (s->verbosity >= 2) - VPrintf1( " final combined CRC = 0x%08x\n ", s->combinedCRC ); - bsFinishWrite ( s ); - } -} - - -/*-------------------------------------------------------------*/ -/*--- end compress.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/crctable.c b/dep/src/bzip2/crctable.c deleted file mode 100644 index 215687b2c05..00000000000 --- a/dep/src/bzip2/crctable.c +++ /dev/null @@ -1,104 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Table for doing CRCs ---*/ -/*--- crctable.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include "bzlib_private.h" - -/*-- - I think this is an implementation of the AUTODIN-II, - Ethernet & FDDI 32-bit CRC standard. Vaguely derived - from code by Rob Warnock, in Section 51 of the - comp.compression FAQ. ---*/ - -UInt32 BZ2_crc32Table[256] = { - - /*-- Ugly, innit? --*/ - - 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L, - 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L, - 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L, - 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL, - 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L, - 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L, - 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L, - 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL, - 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L, - 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L, - 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L, - 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL, - 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L, - 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L, - 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L, - 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL, - 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL, - 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L, - 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L, - 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL, - 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL, - 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L, - 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L, - 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL, - 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL, - 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L, - 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L, - 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL, - 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL, - 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L, - 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L, - 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL, - 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L, - 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL, - 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL, - 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L, - 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L, - 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL, - 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL, - 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L, - 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L, - 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL, - 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL, - 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L, - 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L, - 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL, - 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL, - 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L, - 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L, - 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL, - 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L, - 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L, - 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L, - 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL, - 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L, - 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L, - 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L, - 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL, - 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L, - 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L, - 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L, - 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL, - 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L, - 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L -}; - - -/*-------------------------------------------------------------*/ -/*--- end crctable.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/decompress.c b/dep/src/bzip2/decompress.c deleted file mode 100644 index bba5e0fa36d..00000000000 --- a/dep/src/bzip2/decompress.c +++ /dev/null @@ -1,626 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Decompression machinery ---*/ -/*--- decompress.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include "bzlib_private.h" - - -/*---------------------------------------------------*/ -static -void makeMaps_d ( DState* s ) -{ - Int32 i; - s->nInUse = 0; - for (i = 0; i < 256; i++) - if (s->inUse[i]) { - s->seqToUnseq[s->nInUse] = i; - s->nInUse++; - } -} - - -/*---------------------------------------------------*/ -#define RETURN(rrr) \ - { retVal = rrr; goto save_state_and_return; }; - -#define GET_BITS(lll,vvv,nnn) \ - case lll: s->state = lll; \ - while (True) { \ - if (s->bsLive >= nnn) { \ - UInt32 v; \ - v = (s->bsBuff >> \ - (s->bsLive-nnn)) & ((1 << nnn)-1); \ - s->bsLive -= nnn; \ - vvv = v; \ - break; \ - } \ - if (s->strm->avail_in == 0) RETURN(BZ_OK); \ - s->bsBuff \ - = (s->bsBuff << 8) | \ - ((UInt32) \ - (*((UChar*)(s->strm->next_in)))); \ - s->bsLive += 8; \ - s->strm->next_in++; \ - s->strm->avail_in--; \ - s->strm->total_in_lo32++; \ - if (s->strm->total_in_lo32 == 0) \ - s->strm->total_in_hi32++; \ - } - -#define GET_UCHAR(lll,uuu) \ - GET_BITS(lll,uuu,8) - -#define GET_BIT(lll,uuu) \ - GET_BITS(lll,uuu,1) - -/*---------------------------------------------------*/ -#define GET_MTF_VAL(label1,label2,lval) \ -{ \ - if (groupPos == 0) { \ - groupNo++; \ - if (groupNo >= nSelectors) \ - RETURN(BZ_DATA_ERROR); \ - groupPos = BZ_G_SIZE; \ - gSel = s->selector[groupNo]; \ - gMinlen = s->minLens[gSel]; \ - gLimit = &(s->limit[gSel][0]); \ - gPerm = &(s->perm[gSel][0]); \ - gBase = &(s->base[gSel][0]); \ - } \ - groupPos--; \ - zn = gMinlen; \ - GET_BITS(label1, zvec, zn); \ - while (1) { \ - if (zn > 20 /* the longest code */) \ - RETURN(BZ_DATA_ERROR); \ - if (zvec <= gLimit[zn]) break; \ - zn++; \ - GET_BIT(label2, zj); \ - zvec = (zvec << 1) | zj; \ - }; \ - if (zvec - gBase[zn] < 0 \ - || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \ - RETURN(BZ_DATA_ERROR); \ - lval = gPerm[zvec - gBase[zn]]; \ -} - - -/*---------------------------------------------------*/ -Int32 BZ2_decompress ( DState* s ) -{ - UChar uc; - Int32 retVal; - Int32 minLen, maxLen; - bz_stream* strm = s->strm; - - /* stuff that needs to be saved/restored */ - Int32 i; - Int32 j; - Int32 t; - Int32 alphaSize; - Int32 nGroups; - Int32 nSelectors; - Int32 EOB; - Int32 groupNo; - Int32 groupPos; - Int32 nextSym; - Int32 nblockMAX; - Int32 nblock; - Int32 es; - Int32 N; - Int32 curr; - Int32 zt; - Int32 zn; - Int32 zvec; - Int32 zj; - Int32 gSel; - Int32 gMinlen; - Int32* gLimit; - Int32* gBase; - Int32* gPerm; - - if (s->state == BZ_X_MAGIC_1) { - /*initialise the save area*/ - s->save_i = 0; - s->save_j = 0; - s->save_t = 0; - s->save_alphaSize = 0; - s->save_nGroups = 0; - s->save_nSelectors = 0; - s->save_EOB = 0; - s->save_groupNo = 0; - s->save_groupPos = 0; - s->save_nextSym = 0; - s->save_nblockMAX = 0; - s->save_nblock = 0; - s->save_es = 0; - s->save_N = 0; - s->save_curr = 0; - s->save_zt = 0; - s->save_zn = 0; - s->save_zvec = 0; - s->save_zj = 0; - s->save_gSel = 0; - s->save_gMinlen = 0; - s->save_gLimit = NULL; - s->save_gBase = NULL; - s->save_gPerm = NULL; - } - - /*restore from the save area*/ - i = s->save_i; - j = s->save_j; - t = s->save_t; - alphaSize = s->save_alphaSize; - nGroups = s->save_nGroups; - nSelectors = s->save_nSelectors; - EOB = s->save_EOB; - groupNo = s->save_groupNo; - groupPos = s->save_groupPos; - nextSym = s->save_nextSym; - nblockMAX = s->save_nblockMAX; - nblock = s->save_nblock; - es = s->save_es; - N = s->save_N; - curr = s->save_curr; - zt = s->save_zt; - zn = s->save_zn; - zvec = s->save_zvec; - zj = s->save_zj; - gSel = s->save_gSel; - gMinlen = s->save_gMinlen; - gLimit = s->save_gLimit; - gBase = s->save_gBase; - gPerm = s->save_gPerm; - - retVal = BZ_OK; - - switch (s->state) { - - GET_UCHAR(BZ_X_MAGIC_1, uc); - if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC); - - GET_UCHAR(BZ_X_MAGIC_2, uc); - if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC); - - GET_UCHAR(BZ_X_MAGIC_3, uc) - if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC); - - GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8) - if (s->blockSize100k < (BZ_HDR_0 + 1) || - s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC); - s->blockSize100k -= BZ_HDR_0; - - if (s->smallDecompress) { - s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); - s->ll4 = BZALLOC( - ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) - ); - if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR); - } else { - s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) ); - if (s->tt == NULL) RETURN(BZ_MEM_ERROR); - } - - GET_UCHAR(BZ_X_BLKHDR_1, uc); - - if (uc == 0x17) goto endhdr_2; - if (uc != 0x31) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_BLKHDR_2, uc); - if (uc != 0x41) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_BLKHDR_3, uc); - if (uc != 0x59) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_BLKHDR_4, uc); - if (uc != 0x26) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_BLKHDR_5, uc); - if (uc != 0x53) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_BLKHDR_6, uc); - if (uc != 0x59) RETURN(BZ_DATA_ERROR); - - s->currBlockNo++; - if (s->verbosity >= 2) - VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo ); - - s->storedBlockCRC = 0; - GET_UCHAR(BZ_X_BCRC_1, uc); - s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); - GET_UCHAR(BZ_X_BCRC_2, uc); - s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); - GET_UCHAR(BZ_X_BCRC_3, uc); - s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); - GET_UCHAR(BZ_X_BCRC_4, uc); - s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); - - GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1); - - s->origPtr = 0; - GET_UCHAR(BZ_X_ORIGPTR_1, uc); - s->origPtr = (s->origPtr << 8) | ((Int32)uc); - GET_UCHAR(BZ_X_ORIGPTR_2, uc); - s->origPtr = (s->origPtr << 8) | ((Int32)uc); - GET_UCHAR(BZ_X_ORIGPTR_3, uc); - s->origPtr = (s->origPtr << 8) | ((Int32)uc); - - if (s->origPtr < 0) - RETURN(BZ_DATA_ERROR); - if (s->origPtr > 10 + 100000*s->blockSize100k) - RETURN(BZ_DATA_ERROR); - - /*--- Receive the mapping table ---*/ - for (i = 0; i < 16; i++) { - GET_BIT(BZ_X_MAPPING_1, uc); - if (uc == 1) - s->inUse16[i] = True; else - s->inUse16[i] = False; - } - - for (i = 0; i < 256; i++) s->inUse[i] = False; - - for (i = 0; i < 16; i++) - if (s->inUse16[i]) - for (j = 0; j < 16; j++) { - GET_BIT(BZ_X_MAPPING_2, uc); - if (uc == 1) s->inUse[i * 16 + j] = True; - } - makeMaps_d ( s ); - if (s->nInUse == 0) RETURN(BZ_DATA_ERROR); - alphaSize = s->nInUse+2; - - /*--- Now the selectors ---*/ - GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); - GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); - for (i = 0; i < nSelectors; i++) { - j = 0; - while (True) { - GET_BIT(BZ_X_SELECTOR_3, uc); - if (uc == 0) break; - j++; - if (j >= nGroups) RETURN(BZ_DATA_ERROR); - } - s->selectorMtf[i] = j; - } - - /*--- Undo the MTF values for the selectors. ---*/ - { - UChar pos[BZ_N_GROUPS], tmp, v; - for (v = 0; v < nGroups; v++) pos[v] = v; - - for (i = 0; i < nSelectors; i++) { - v = s->selectorMtf[i]; - tmp = pos[v]; - while (v > 0) { pos[v] = pos[v-1]; v--; } - pos[0] = tmp; - s->selector[i] = tmp; - } - } - - /*--- Now the coding tables ---*/ - for (t = 0; t < nGroups; t++) { - GET_BITS(BZ_X_CODING_1, curr, 5); - for (i = 0; i < alphaSize; i++) { - while (True) { - if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR); - GET_BIT(BZ_X_CODING_2, uc); - if (uc == 0) break; - GET_BIT(BZ_X_CODING_3, uc); - if (uc == 0) curr++; else curr--; - } - s->len[t][i] = curr; - } - } - - /*--- Create the Huffman decoding tables ---*/ - for (t = 0; t < nGroups; t++) { - minLen = 32; - maxLen = 0; - for (i = 0; i < alphaSize; i++) { - if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; - if (s->len[t][i] < minLen) minLen = s->len[t][i]; - } - BZ2_hbCreateDecodeTables ( - &(s->limit[t][0]), - &(s->base[t][0]), - &(s->perm[t][0]), - &(s->len[t][0]), - minLen, maxLen, alphaSize - ); - s->minLens[t] = minLen; - } - - /*--- Now the MTF values ---*/ - - EOB = s->nInUse+1; - nblockMAX = 100000 * s->blockSize100k; - groupNo = -1; - groupPos = 0; - - for (i = 0; i <= 255; i++) s->unzftab[i] = 0; - - /*-- MTF init --*/ - { - Int32 ii, jj, kk; - kk = MTFA_SIZE-1; - for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) { - for (jj = MTFL_SIZE-1; jj >= 0; jj--) { - s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj); - kk--; - } - s->mtfbase[ii] = kk + 1; - } - } - /*-- end MTF init --*/ - - nblock = 0; - GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym); - - while (True) { - - if (nextSym == EOB) break; - - if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) { - - es = -1; - N = 1; - do { - if (nextSym == BZ_RUNA) es = es + (0+1) * N; else - if (nextSym == BZ_RUNB) es = es + (1+1) * N; - N = N * 2; - GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym); - } - while (nextSym == BZ_RUNA || nextSym == BZ_RUNB); - - es++; - uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ]; - s->unzftab[uc] += es; - - if (s->smallDecompress) - while (es > 0) { - if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); - s->ll16[nblock] = (UInt16)uc; - nblock++; - es--; - } - else - while (es > 0) { - if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); - s->tt[nblock] = (UInt32)uc; - nblock++; - es--; - }; - - continue; - - } else { - - if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); - - /*-- uc = MTF ( nextSym-1 ) --*/ - { - Int32 ii, jj, kk, pp, lno, off; - UInt32 nn; - nn = (UInt32)(nextSym - 1); - - if (nn < MTFL_SIZE) { - /* avoid general-case expense */ - pp = s->mtfbase[0]; - uc = s->mtfa[pp+nn]; - while (nn > 3) { - Int32 z = pp+nn; - s->mtfa[(z) ] = s->mtfa[(z)-1]; - s->mtfa[(z)-1] = s->mtfa[(z)-2]; - s->mtfa[(z)-2] = s->mtfa[(z)-3]; - s->mtfa[(z)-3] = s->mtfa[(z)-4]; - nn -= 4; - } - while (nn > 0) { - s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; - }; - s->mtfa[pp] = uc; - } else { - /* general case */ - lno = nn / MTFL_SIZE; - off = nn % MTFL_SIZE; - pp = s->mtfbase[lno] + off; - uc = s->mtfa[pp]; - while (pp > s->mtfbase[lno]) { - s->mtfa[pp] = s->mtfa[pp-1]; pp--; - }; - s->mtfbase[lno]++; - while (lno > 0) { - s->mtfbase[lno]--; - s->mtfa[s->mtfbase[lno]] - = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1]; - lno--; - } - s->mtfbase[0]--; - s->mtfa[s->mtfbase[0]] = uc; - if (s->mtfbase[0] == 0) { - kk = MTFA_SIZE-1; - for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) { - for (jj = MTFL_SIZE-1; jj >= 0; jj--) { - s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj]; - kk--; - } - s->mtfbase[ii] = kk + 1; - } - } - } - } - /*-- end uc = MTF ( nextSym-1 ) --*/ - - s->unzftab[s->seqToUnseq[uc]]++; - if (s->smallDecompress) - s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else - s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]); - nblock++; - - GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym); - continue; - } - } - - /* Now we know what nblock is, we can do a better sanity - check on s->origPtr. - */ - if (s->origPtr < 0 || s->origPtr >= nblock) - RETURN(BZ_DATA_ERROR); - - /*-- Set up cftab to facilitate generation of T^(-1) --*/ - s->cftab[0] = 0; - for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; - for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; - for (i = 0; i <= 256; i++) { - if (s->cftab[i] < 0 || s->cftab[i] > nblock) { - /* s->cftab[i] can legitimately be == nblock */ - RETURN(BZ_DATA_ERROR); - } - } - - s->state_out_len = 0; - s->state_out_ch = 0; - BZ_INITIALISE_CRC ( s->calculatedBlockCRC ); - s->state = BZ_X_OUTPUT; - if (s->verbosity >= 2) VPrintf0 ( "rt+rld" ); - - if (s->smallDecompress) { - - /*-- Make a copy of cftab, used in generation of T --*/ - for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i]; - - /*-- compute the T vector --*/ - for (i = 0; i < nblock; i++) { - uc = (UChar)(s->ll16[i]); - SET_LL(i, s->cftabCopy[uc]); - s->cftabCopy[uc]++; - } - - /*-- Compute T^(-1) by pointer reversal on T --*/ - i = s->origPtr; - j = GET_LL(i); - do { - Int32 tmp = GET_LL(j); - SET_LL(j, i); - i = j; - j = tmp; - } - while (i != s->origPtr); - - s->tPos = s->origPtr; - s->nblock_used = 0; - if (s->blockRandomised) { - BZ_RAND_INIT_MASK; - BZ_GET_SMALL(s->k0); s->nblock_used++; - BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; - } else { - BZ_GET_SMALL(s->k0); s->nblock_used++; - } - - } else { - - /*-- compute the T^(-1) vector --*/ - for (i = 0; i < nblock; i++) { - uc = (UChar)(s->tt[i] & 0xff); - s->tt[s->cftab[uc]] |= (i << 8); - s->cftab[uc]++; - } - - s->tPos = s->tt[s->origPtr] >> 8; - s->nblock_used = 0; - if (s->blockRandomised) { - BZ_RAND_INIT_MASK; - BZ_GET_FAST(s->k0); s->nblock_used++; - BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; - } else { - BZ_GET_FAST(s->k0); s->nblock_used++; - } - - } - - RETURN(BZ_OK); - - - - endhdr_2: - - GET_UCHAR(BZ_X_ENDHDR_2, uc); - if (uc != 0x72) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_ENDHDR_3, uc); - if (uc != 0x45) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_ENDHDR_4, uc); - if (uc != 0x38) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_ENDHDR_5, uc); - if (uc != 0x50) RETURN(BZ_DATA_ERROR); - GET_UCHAR(BZ_X_ENDHDR_6, uc); - if (uc != 0x90) RETURN(BZ_DATA_ERROR); - - s->storedCombinedCRC = 0; - GET_UCHAR(BZ_X_CCRC_1, uc); - s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); - GET_UCHAR(BZ_X_CCRC_2, uc); - s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); - GET_UCHAR(BZ_X_CCRC_3, uc); - s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); - GET_UCHAR(BZ_X_CCRC_4, uc); - s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); - - s->state = BZ_X_IDLE; - RETURN(BZ_STREAM_END); - - default: AssertH ( False, 4001 ); - } - - AssertH ( False, 4002 ); - - save_state_and_return: - - s->save_i = i; - s->save_j = j; - s->save_t = t; - s->save_alphaSize = alphaSize; - s->save_nGroups = nGroups; - s->save_nSelectors = nSelectors; - s->save_EOB = EOB; - s->save_groupNo = groupNo; - s->save_groupPos = groupPos; - s->save_nextSym = nextSym; - s->save_nblockMAX = nblockMAX; - s->save_nblock = nblock; - s->save_es = es; - s->save_N = N; - s->save_curr = curr; - s->save_zt = zt; - s->save_zn = zn; - s->save_zvec = zvec; - s->save_zj = zj; - s->save_gSel = gSel; - s->save_gMinlen = gMinlen; - s->save_gLimit = gLimit; - s->save_gBase = gBase; - s->save_gPerm = gPerm; - - return retVal; -} - - -/*-------------------------------------------------------------*/ -/*--- end decompress.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/huffman.c b/dep/src/bzip2/huffman.c deleted file mode 100644 index 87e79e38af0..00000000000 --- a/dep/src/bzip2/huffman.c +++ /dev/null @@ -1,205 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Huffman coding low-level stuff ---*/ -/*--- huffman.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include "bzlib_private.h" - -/*---------------------------------------------------*/ -#define WEIGHTOF(zz0) ((zz0) & 0xffffff00) -#define DEPTHOF(zz1) ((zz1) & 0x000000ff) -#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3)) - -#define ADDWEIGHTS(zw1,zw2) \ - (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \ - (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2))) - -#define UPHEAP(z) \ -{ \ - Int32 zz, tmp; \ - zz = z; tmp = heap[zz]; \ - while (weight[tmp] < weight[heap[zz >> 1]]) { \ - heap[zz] = heap[zz >> 1]; \ - zz >>= 1; \ - } \ - heap[zz] = tmp; \ -} - -#define DOWNHEAP(z) \ -{ \ - Int32 zz, yy, tmp; \ - zz = z; tmp = heap[zz]; \ - while (True) { \ - yy = zz << 1; \ - if (yy > nHeap) break; \ - if (yy < nHeap && \ - weight[heap[yy+1]] < weight[heap[yy]]) \ - yy++; \ - if (weight[tmp] < weight[heap[yy]]) break; \ - heap[zz] = heap[yy]; \ - zz = yy; \ - } \ - heap[zz] = tmp; \ -} - - -/*---------------------------------------------------*/ -void BZ2_hbMakeCodeLengths ( UChar *len, - Int32 *freq, - Int32 alphaSize, - Int32 maxLen ) -{ - /*-- - Nodes and heap entries run from 1. Entry 0 - for both the heap and nodes is a sentinel. - --*/ - Int32 nNodes, nHeap, n1, n2, i, j, k; - Bool tooLong; - - Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; - Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ]; - Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; - - for (i = 0; i < alphaSize; i++) - weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8; - - while (True) { - - nNodes = alphaSize; - nHeap = 0; - - heap[0] = 0; - weight[0] = 0; - parent[0] = -2; - - for (i = 1; i <= alphaSize; i++) { - parent[i] = -1; - nHeap++; - heap[nHeap] = i; - UPHEAP(nHeap); - } - - AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 ); - - while (nHeap > 1) { - n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); - n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); - nNodes++; - parent[n1] = parent[n2] = nNodes; - weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]); - parent[nNodes] = -1; - nHeap++; - heap[nHeap] = nNodes; - UPHEAP(nHeap); - } - - AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 ); - - tooLong = False; - for (i = 1; i <= alphaSize; i++) { - j = 0; - k = i; - while (parent[k] >= 0) { k = parent[k]; j++; } - len[i-1] = j; - if (j > maxLen) tooLong = True; - } - - if (! tooLong) break; - - /* 17 Oct 04: keep-going condition for the following loop used - to be 'i < alphaSize', which missed the last element, - theoretically leading to the possibility of the compressor - looping. However, this count-scaling step is only needed if - one of the generated Huffman code words is longer than - maxLen, which up to and including version 1.0.2 was 20 bits, - which is extremely unlikely. In version 1.0.3 maxLen was - changed to 17 bits, which has minimal effect on compression - ratio, but does mean this scaling step is used from time to - time, enough to verify that it works. - - This means that bzip2-1.0.3 and later will only produce - Huffman codes with a maximum length of 17 bits. However, in - order to preserve backwards compatibility with bitstreams - produced by versions pre-1.0.3, the decompressor must still - handle lengths of up to 20. */ - - for (i = 1; i <= alphaSize; i++) { - j = weight[i] >> 8; - j = 1 + (j / 2); - weight[i] = j << 8; - } - } -} - - -/*---------------------------------------------------*/ -void BZ2_hbAssignCodes ( Int32 *code, - UChar *length, - Int32 minLen, - Int32 maxLen, - Int32 alphaSize ) -{ - Int32 n, vec, i; - - vec = 0; - for (n = minLen; n <= maxLen; n++) { - for (i = 0; i < alphaSize; i++) - if (length[i] == n) { code[i] = vec; vec++; }; - vec <<= 1; - } -} - - -/*---------------------------------------------------*/ -void BZ2_hbCreateDecodeTables ( Int32 *limit, - Int32 *base, - Int32 *perm, - UChar *length, - Int32 minLen, - Int32 maxLen, - Int32 alphaSize ) -{ - Int32 pp, i, j, vec; - - pp = 0; - for (i = minLen; i <= maxLen; i++) - for (j = 0; j < alphaSize; j++) - if (length[j] == i) { perm[pp] = j; pp++; }; - - for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0; - for (i = 0; i < alphaSize; i++) base[length[i]+1]++; - - for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1]; - - for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0; - vec = 0; - - for (i = minLen; i <= maxLen; i++) { - vec += (base[i+1] - base[i]); - limit[i] = vec-1; - vec <<= 1; - } - for (i = minLen + 1; i <= maxLen; i++) - base[i] = ((limit[i-1] + 1) << 1) - base[i]; -} - - -/*-------------------------------------------------------------*/ -/*--- end huffman.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/bzip2/randtable.c b/dep/src/bzip2/randtable.c deleted file mode 100644 index 068b76367bc..00000000000 --- a/dep/src/bzip2/randtable.c +++ /dev/null @@ -1,84 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Table for randomising repetitive blocks ---*/ -/*--- randtable.c ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include "bzlib_private.h" - - -/*---------------------------------------------*/ -Int32 BZ2_rNums[512] = { - 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, - 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, - 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, - 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, - 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, - 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, - 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, - 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, - 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, - 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, - 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, - 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, - 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, - 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, - 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, - 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, - 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, - 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, - 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, - 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, - 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, - 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, - 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, - 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, - 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, - 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, - 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, - 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, - 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, - 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, - 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, - 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, - 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, - 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, - 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, - 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, - 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, - 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, - 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, - 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, - 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, - 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, - 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, - 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, - 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, - 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, - 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, - 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, - 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, - 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, - 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, - 936, 638 -}; - - -/*-------------------------------------------------------------*/ -/*--- end randtable.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/src/g3dlite/AnyVal.cpp b/dep/src/g3dlite/AnyVal.cpp deleted file mode 100644 index 7b98486523a..00000000000 --- a/dep/src/g3dlite/AnyVal.cpp +++ /dev/null @@ -1,1379 +0,0 @@ -/** - @file AnyVal.cpp - @author Morgan McGuire - @maintainer Morgan McGuire - @created 2006-06-11 - @edited 2008-07-14 - */ - -#include "G3D/AnyVal.h" -#include "G3D/Array.h" -#include "G3D/stringutils.h" -#include "G3D/Table.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" -#include "G3D/Matrix2.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/Rect2D.h" -#include "G3D/AABox.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Quat.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -AnyVal AnyVal::fromFile(const std::string& filename) { - TextInput t(filename); - return AnyVal(t); -} - - -void AnyVal::load(const std::string& filename) { - *this = fromFile(filename); -} - - -void AnyVal::save(const std::string& filename) const { - TextOutput t(filename); - serialize(t); - t.commit(); -} - - -AnyVal::AnyVal() : m_type(NIL), m_value(NULL), m_referenceCount(NULL) { -} - - -AnyVal::AnyVal(bool b) : m_type(BOOLEAN), m_value(new bool(b)), m_referenceCount(NULL) { -} - - -AnyVal::AnyVal(G3D::TextInput& t) : m_type(NIL), m_value(NULL), m_referenceCount(NULL) { - deserialize(t); -} - - -/*AnyVal::AnyVal(G3D::BinaryInput& b) { - deserialize(b); -} -*/ - -AnyVal::AnyVal(double v) : m_type(NUMBER), m_referenceCount(NULL) { - m_value = new double(v); -} - - -AnyVal::AnyVal(int v) : m_type(NUMBER), m_referenceCount(NULL) { - m_value = new double(v); -} - - -AnyVal::AnyVal(const Rect2D& v) : m_type(RECT2D), m_referenceCount(NULL) { - m_value = new Rect2D(v); -} - - -AnyVal::AnyVal(const AABox& v) : m_type(AABOX), m_referenceCount(NULL) { - m_value = new AABox(v); -} - - -AnyVal::AnyVal(const Vector2& v) : m_type(VECTOR2), m_referenceCount(NULL) { - m_value = new Vector2(v); -} - - -AnyVal::AnyVal(const Vector3& v) : m_type(VECTOR3), m_referenceCount(NULL) { - m_value = new Vector3(v); -} - - -AnyVal::AnyVal(const Vector4& v) : m_type(VECTOR4), m_referenceCount(NULL) { - m_value = new Vector4(v); -} - - -AnyVal::AnyVal(const Color1& v) : m_type(COLOR1), m_referenceCount(NULL) { - m_value = new Color1(v); -} - - -AnyVal::AnyVal(const Color3& v) : m_type(COLOR3), m_referenceCount(NULL) { - m_value = new Color3(v); -} - - -AnyVal::AnyVal(const Color4& v) : m_type(COLOR4), m_referenceCount(NULL) { - m_value = new Color4(v); -} - - -AnyVal::AnyVal(const std::string& v) : m_type(STRING), m_referenceCount(NULL) { - m_value = new std::string(v); -} - - -AnyVal::AnyVal(const char* v) : m_type(STRING), m_referenceCount(NULL) { - m_value = new std::string(v); -} - - -AnyVal::AnyVal(const Quat& v) : m_type(QUAT), m_referenceCount(NULL) { - m_value = new Quat(v); -} - - -AnyVal::AnyVal(const CoordinateFrame& v) : m_type(COORDINATEFRAME), m_referenceCount(NULL) { - m_value = new CoordinateFrame(v); -} - - -AnyVal::AnyVal(const Matrix2& v) : m_type(MATRIX2), m_referenceCount(NULL) { - m_value = new Matrix2(v); -} - -AnyVal::AnyVal(const Matrix3& v) : m_type(MATRIX3), m_referenceCount(NULL) { - m_value = new Matrix3(v); -} - - -AnyVal::AnyVal(const Matrix4& v) : m_type(MATRIX4), m_referenceCount(NULL) { - m_value = new Matrix4(v); -} - - -AnyVal::AnyVal(const AnyVal& c) : m_type(NIL), m_value(NULL), m_referenceCount(NULL) { - *this = c; -} - - -AnyVal::AnyVal(Type arrayOrTable) : m_type(NIL), m_value(NULL), m_referenceCount(new int(1)) { - // TODO: make AnyVal::createArray() - switch (arrayOrTable) { - case ARRAY: - m_type = ARRAY; - m_value = new Array(); - break; - - case TABLE: - m_type = TABLE; - m_value = new Table(); - break; - - default: - debugAssertM(false, "Cannot construct AnyVal from constants except ARRAY or TABLE."); - } -} - - -AnyVal::~AnyVal() { - deleteValue(); -} - - -void AnyVal::deleteValue() { - if (m_referenceCount) { - --(*m_referenceCount); - if (*m_referenceCount <= 0) { - delete m_referenceCount; - m_referenceCount = NULL; - // Pass through and delete the real object now - } else { - // Someone else is holding a reference, so we can't delete - // the object. - m_referenceCount = NULL; - return; - } - } - - switch (m_type) { - case NIL: - // Nothing to do - break; - - case NUMBER: - delete (double*)m_value; - break; - - case BOOLEAN: - delete (bool*)m_value; - break; - - case STRING: - delete (std::string*)m_value; - break; - - case RECT2D: - delete (Rect2D*)m_value; - break; - - case AABOX: - delete (AABox*)m_value; - break; - - case VECTOR2: - delete (Vector2*)m_value; - break; - - case VECTOR3: - delete (Vector3*)m_value; - break; - - case VECTOR4: - delete (Vector4*)m_value; - break; - - case MATRIX2: - delete (Matrix2*)m_value; - break; - - case MATRIX3: - delete (Matrix3*)m_value; - break; - - case MATRIX4: - delete (Matrix4*)m_value; - break; - - case QUAT: - delete (Quat*)m_value; - break; - - case COORDINATEFRAME: - delete (CoordinateFrame*)m_value; - break; - - case COLOR1: - delete (Color1*)m_value; - break; - - case COLOR3: - delete (Color3*)m_value; - break; - - case COLOR4: - delete (Color4*)m_value; - break; - - case ARRAY: - delete (Array*)m_value; - break; - - case TABLE: - delete (Table*)m_value; - break; - - default: - debugAssertM(false, "Internal error: no destructor for this type."); - } - - m_value = NULL; -} - - -AnyVal& AnyVal::operator=(const AnyVal& v) { - deleteValue(); - - m_type = v.m_type; - - m_referenceCount = v.m_referenceCount; - - if (isSharedType()) { - ++(*m_referenceCount); - m_value = v.m_value; - } else { - m_value = v.copyValue(); - } - - return *this; -} - - -void* AnyVal::copyValue() const { - switch (m_type) { - case NIL: - return NULL; - - case NUMBER: - return new double(*(double*)m_value); - - case BOOLEAN: - return new bool(*(bool*)m_value); - - case STRING: - return new std::string(*(std::string*)m_value); - - case RECT2D: - return new Rect2D(*(Rect2D*)m_value); - - case AABOX: - return new AABox(*(AABox*)m_value); - - case VECTOR2: - return new Vector2(*(Vector2*)m_value); - - case VECTOR3: - return new Vector3(*(Vector3*)m_value); - - case VECTOR4: - return new Vector4(*(Vector4*)m_value); - - case MATRIX2: - return new Matrix2(*(Matrix2*)m_value); - - case MATRIX3: - return new Matrix3(*(Matrix3*)m_value); - - case MATRIX4: - return new Matrix4(*(Matrix4*)m_value); - - case QUAT: - return new Quat(*(Quat*)m_value); - - case COORDINATEFRAME: - return new CoordinateFrame(*(CoordinateFrame*)m_value); - - case COLOR1: - return new Color1(*(Color1*)m_value); - - case COLOR3: - return new Color3(*(Color3*)m_value); - - case COLOR4: - return new Color4(*(Color4*)m_value); - - case ARRAY: - return new Array(*(Array*)m_value); - - case TABLE: - return new Table(*(Table*)m_value); - - default: - debugAssertM(false, "Internal error: no assignment operator for this type."); - return NULL; - } -} - -AnyVal::Type AnyVal::type() const { - return m_type; -} - - -static bool legalIdentifier(const std::string& s) { - if (s.size() == 0) { - return false; - } - - if (! isLetter(s[0]) || (s[0] == '_')) { - return false; - } - - bool ok = true; - - for (unsigned int i = 1; i < s.size(); ++i) { - ok &= isDigit(s[i]) || isLetter(s[i]) || (s[i] == '_'); - } - - return ok; -} - - -void AnyVal::serialize(G3D::TextOutput& t) const { - switch (m_type) { - case NIL: - t.writeSymbol("Nil"); - break; - - case NUMBER: - t.printf("%g", *(double*)m_value); - break; - - case BOOLEAN: - t.writeBoolean(*(bool*)m_value); - break; - - case STRING: - t.writeString(*(std::string*)m_value); - break; - - case RECT2D: - t.printf("R(%g, %g, %g, %g)", ((Rect2D*)m_value)->x0(), ((Rect2D*)m_value)->y0(), - ((Rect2D*)m_value)->width(), ((Rect2D*)m_value)->height()); - break; - - case AABOX: - t.printf("AAB(V3(%g, %g, %g), V3(%g, %g, %g))", - aabox().low().x, - aabox().low().y, - aabox().low().z, - aabox().high().x, - aabox().high().y, - aabox().high().z); - break; - - case VECTOR2: - t.printf("V2(%g, %g)", ((Vector2*)m_value)->x, ((Vector2*)m_value)->y); - break; - - case VECTOR3: - t.printf("V3(%g, %g, %g)", ((Vector3*)m_value)->x, ((Vector3*)m_value)->y, ((Vector3*)m_value)->z); - break; - - case VECTOR4: - t.printf("V4(%g, %g, %g, %g)", ((Vector4*)m_value)->x, ((Vector4*)m_value)->y, ((Vector4*)m_value)->z, ((Vector4*)m_value)->w); - break; - - case MATRIX2: - { - const Matrix2& m = *(Matrix2*)m_value; - t.printf("M2(\n"); - t.pushIndent(); - t.printf("%10.5f, %10.5f,\n%10.5f, %10.5f)", - m[0][0], m[0][1], - m[1][0], m[1][1]); - t.popIndent(); - } - break; - - case MATRIX3: - { - const Matrix3& m = *(Matrix3*)m_value; - t.printf("M3(\n"); - t.pushIndent(); - t.printf("%10.5f, %10.5f, %10.5f,\n%10.5f, %10.5f, %10.5f,\n%10.5f, %10.5f, %10.5f)", - m[0][0], m[0][1], m[0][2], - m[1][0], m[1][1], m[1][2], - m[2][0], m[2][1], m[2][2]); - t.popIndent(); - } - break; - - case MATRIX4: - { - const Matrix4& m = *(Matrix4*)m_value; - t.printf("M4(\n"); - t.pushIndent(); - t.printf( - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f)", - m[0][0], m[0][1], m[0][2], m[0][3], - m[1][0], m[1][1], m[1][2], m[1][3], - m[2][0], m[2][1], m[2][2], m[2][3], - m[3][0], m[3][1], m[3][2], m[3][3]); - t.popIndent(); - } - break; - - case QUAT: - t.printf("Q(%g, %g, %g, %g)", ((Quat*)m_value)->x, ((Quat*)m_value)->y, ((Quat*)m_value)->z, ((Quat*)m_value)->w); - break; - - case COORDINATEFRAME: - { - const CoordinateFrame& c = *(CoordinateFrame*)m_value; - float x,y,z,yaw,pitch,roll; - c.getXYZYPRDegrees(x,y,z,yaw,pitch,roll); - t.printf("CF(V3(%g,%g,%g), %g, %g, %g)", x, y, z, yaw, pitch, roll); - /* - t.pushIndent(); - t.printf( - "CF(\n%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f)", - c.rotation[0][0], c.rotation[0][1], c.rotation[0][2], c.translation.x, - c.rotation[1][0], c.rotation[1][1], c.rotation[1][2], c.translation.y, - c.rotation[2][0], c.rotation[2][1], c.rotation[2][2], c.translation.z); - t.popIndent(); - */ - } - break; - - case COLOR1: - t.printf("C1(%g)", ((Color1*)m_value)->value); - break; - - case COLOR3: - t.printf("C3(%g, %g, %g)", ((Color3*)m_value)->r, ((Color3*)m_value)->g, ((Color3*)m_value)->b); - break; - - case COLOR4: - t.printf("C4(%g, %g, %g, %g)", ((Color4*)m_value)->r, ((Color4*)m_value)->g, ((Color4*)m_value)->b, ((Color4*)m_value)->a); - break; - - case ARRAY: - { - const Array& a = *(Array*)m_value; - t.printf("[\n"); - t.pushIndent(); - for (int i = 0; i < a.size(); ++i) { - a[i].serialize(t); - if (i != a.size() - 1) { - t.printf(", \n"); - } - } - t.printf("]"); - t.popIndent(); - } - break; - - case TABLE: - { - const Table& a = *(Table*)m_value; - t.printf("{\n"); - t.pushIndent(); - Table::Iterator i = a.begin(); - const Table::Iterator end = a.end(); - while (i != end) { - // Quote names that are not legal C++ identifiers - if (! legalIdentifier(i->key)) { - t.printf("'%s' ", i->key.c_str()); - } else { - t.writeSymbol(i->key); - } - t.printf("= "); - - i->value.serialize(t); - - if (i != end) { - t.printf("\n"); - } - ++i; - } - t.popIndent(); - t.printf("}"); - } - break; - - default: - debugAssertM(false, "Internal error: no serialize method for this type."); - } -} - - -std::string AnyVal::toString() const { - TextOutput t; - serialize(t); - std::string s; - t.commitString(s); - return s; -} - -void AnyVal::deserialize(G3D::TextInput& t) { - deleteValue(); - m_type = NIL; - m_value = NULL; - - if (! t.hasMore()) { - return; - } - - switch (t.peek().type()) { - case Token::END: - // should never get here because of the hasMore check above - return; - break; - - case Token::NUMBER: - m_type = NUMBER; - m_value = new double(t.readNumber()); - break; - - case Token::STRING: - m_type = STRING; - m_value = new std::string(t.readString()); - break; - - case Token::NEWLINE: - m_type = STRING; - m_value = new std::string(t.readNewline()); - break; - - case Token::COMMENT: - m_type = STRING; - m_value = new std::string(t.readComment()); - break; - - case Token::BOOLEAN: - m_type = BOOLEAN; - m_value = new bool(t.readBoolean()); - break; - - case Token::SYMBOL: - { - std::string s = t.readSymbol(); - if (s == "NIL") { - break; - - } else if (s == "true") { - - m_type = BOOLEAN; - m_value = new bool(true); - - } else if (s == "false") { - - m_type = BOOLEAN; - m_value = new bool(false); - - } else if (s == "R") { - - m_type = RECT2D; - t.readSymbol("("); - float x,y,w,h; - x = (float)t.readNumber(); - t.readSymbol(","); - y = (float)t.readNumber(); - t.readSymbol(","); - w = (float)t.readNumber(); - t.readSymbol(","); - h = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Rect2D(Rect2D::xywh(x, y, w, h)); - - } else if (s == "AAB") { - - m_type = AABOX; - Vector3 v[2]; - t.readSymbol("("); - for (int i = 0; i < 2; ++i) { - t.readSymbols("V3", "("); - v[i].x = (float)t.readNumber(); - t.readSymbol(","); - v[i].y = (float)t.readNumber(); - t.readSymbol(","); - v[i].z = (float)t.readNumber(); - t.readSymbol(","); - if (i == 0) { - t.readSymbol(","); - } - } - t.readSymbol(")"); - m_value = new AABox(v[0], v[1]); - - } else if (s == "V2") { - - t.readSymbol("("); - Vector2 v; - v.x = (float)t.readNumber(); - t.readSymbol(","); - v.y = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Vector2(v); - m_type = VECTOR2; - - } else if (s == "V3") { - - t.readSymbol("("); - Vector3 v; - v.x = (float)t.readNumber(); - t.readSymbol(","); - v.y = (float)t.readNumber(); - t.readSymbol(","); - v.z = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Vector3(v); - m_type = VECTOR3; - - } else if (s == "V4") { - - t.readSymbol("("); - Vector4 v; - v.x = (float)t.readNumber(); - t.readSymbol(","); - v.y = (float)t.readNumber(); - t.readSymbol(","); - v.z = (float)t.readNumber(); - t.readSymbol(","); - v.w = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Vector4(v); - m_type = VECTOR4; - - } else if (s == "M2") { - - t.readSymbol("("); - Matrix2 m; - for (int r = 0; r < 2; ++r) { - for (int c = 0; c < 2; ++c) { - m[r][c] = (float)t.readNumber(); - if ((c != 1) || (r != 1)) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new Matrix2(m); - m_type = MATRIX2; - - } else if (s == "M3") { - - t.readSymbol("("); - Matrix3 m; - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - m[r][c] = (float)t.readNumber(); - if ((c != 2) || (r != 2)) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new Matrix3(m); - m_type = MATRIX3; - - } else if (s == "M4") { - - t.readSymbol("("); - Matrix4 m; - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - m[r][c] = (float)t.readNumber(); - if ((c != 3) || (r != 3)) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new Matrix4(m); - m_type = MATRIX4; - - } else if (s == "Q") { - - t.readSymbol("("); - Quat q; - q.x = (float)t.readNumber(); - t.readSymbol(","); - q.y = (float)t.readNumber(); - t.readSymbol(","); - q.z = (float)t.readNumber(); - t.readSymbol(","); - q.w = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Quat(q); - m_type = QUAT; - - } else if (s == "CF") { - - t.readSymbol("("); - CoordinateFrame m; - if (t.peek().type() == Token::SYMBOL) { - // Angle format - float x, y, z, yaw, roll, pitch; - t.readSymbols("V3", "("); - x = (float)t.readNumber(); - t.readSymbol(","); - y = (float)t.readNumber(); - t.readSymbol(","); - z = (float)t.readNumber(); - t.readSymbols(")", ","); - yaw = (float)t.readNumber(); - t.readSymbol(","); - pitch = (float)t.readNumber(); - roll = 0; - if (t.peek().string() == ",") { - t.readSymbol(","); - roll = (float)t.readNumber(); - } - m = CoordinateFrame::fromXYZYPRDegrees(x, y, z, yaw, pitch, roll); - } else { - // Matrix format - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - m.rotation[r][c] = (float)t.readNumber(); - } - m.translation[r] = (float)t.readNumber(); - if (r != 2) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new CoordinateFrame(m); - m_type = COORDINATEFRAME; - - } else if (s == "C1") { - - t.readSymbol("("); - float v = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Color1(v); - m_type = COLOR1; - - } else if (s == "C3") { - - t.readSymbol("("); - Color3 c; - c.r = (float)t.readNumber(); - t.readSymbol(","); - c.g = (float)t.readNumber(); - t.readSymbol(","); - c.b = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Color3(c); - m_type = COLOR3; - - } else if (s == "C4") { - - t.readSymbol("("); - Color4 c; - c.r = (float)t.readNumber(); - t.readSymbol(","); - c.g = (float)t.readNumber(); - t.readSymbol(","); - c.b = (float)t.readNumber(); - t.readSymbol(","); - c.a = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Color4(c); - m_type = COLOR4; - - } else if (s == "[") { - - // Array - m_type = ARRAY; - m_value = new Array(); - m_referenceCount = new int(1); - Array& a = *(Array*)m_value; - - Token peek = t.peek(); - while ((peek.type() != Token::SYMBOL) || (peek.string() != "]")) { - // Avoid copying large objects - a.next().deserialize(t); - - peek = t.peek(); - if (peek.type() != Token::SYMBOL) { - throw CorruptText("Expected ',' or ']'", peek); - } else if (peek.string() == ",") { - t.readSymbol(","); - } else if (peek.string() != "]") { - throw CorruptText("Missing ']'", peek); - } - } - t.readSymbol("]"); - - } else if (s == "{") { - - // Table - m_type = TABLE; - m_value = new Table(); - m_referenceCount = new int(1); - Table& a = *(Table*)m_value; - - Token peek = t.peek(); - while ((peek.type() != Token::SYMBOL) || (peek.string() != "}")) { - - std::string key; - // Get the name - if (peek.type() == Token::SYMBOL) { - key = t.readSymbol(); - } else if (peek.extendedType() == Token::SINGLE_QUOTED_TYPE) { - key = t.readString(); - } else { - throw CorruptText("Expected name inside table", peek); - } - - t.readSymbol("="); - - // Avoid copying large values - a.set(key, AnyVal()); - a[key].deserialize(t); - - peek = t.peek(); - if ((peek.type() != Token::SYMBOL) && (peek.extendedType() != Token::SINGLE_QUOTED_TYPE)) { - throw CorruptText("Missing expected name or '}'", peek); - } - } - t.readSymbol("}"); - - } else { - throw CorruptText("Invalid value type.", t.peek()); - } // dispatch on symbol type - } // scope - break; - } -} - - -AnyVal& AnyVal::operator[](const char* key) { - return this->operator[]((std::string)key); -} - - -const AnyVal& AnyVal::operator[](const char* key) const { - return this->operator[]((std::string)key); -} - - -AnyVal& AnyVal::operator[](const std::string& key) { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - makeMutable(); - - Table& t = *(Table*)m_value; - - if (! t.containsKey(key)) { - t.set(key, AnyVal()); - } - - return t[key]; -} - - -const AnyVal& AnyVal::operator[](const std::string& key) const { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - const Table& t = *(const Table*)m_value; - - if (! t.containsKey(key)) { - throw KeyNotFound(key); - } - - return t[key]; -} - - -void AnyVal::append(const AnyVal& v) { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - makeMutable(); - - Array& a = *(Array*)m_value; - a.append(v); -} - - -void AnyVal::getKeys(Array& keys) const { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - const Table& t = *(const Table*)m_value; - t.getKeys(keys); -} - - -int AnyVal::size() const { - switch (m_type) { - case TABLE: - { - const Table& t = *(const Table*)m_value; - return t.size(); - } - - case ARRAY: - { - const Array& a = *(Array*)m_value; - return a.size(); - } - - default: - throw WrongType(ARRAY, m_type); - } -} - - -AnyVal& AnyVal::operator[](int i) { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - makeMutable(); - - Array& a = *(Array*)m_value; - - if (i < 0) { - throw IndexOutOfBounds(i, a.size()); - } - - if (a.size() <= i) { - a.resize(i + 1); - } - - return a[i]; -} - - -const AnyVal& AnyVal::operator[](int i) const { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - - const Array& a = *(Array*)m_value; - - if (a.size() <= i || i < 0) { - throw IndexOutOfBounds(i, a.size()); - } - - return a[i]; -} - - -void AnyVal::makeMutable() { - if (*m_referenceCount > 1) { - // This is a shared instance - --(*m_referenceCount); - m_referenceCount = new int(1); - m_value = copyValue(); - } -} - -bool AnyVal::boolean() const { - if (m_type != BOOLEAN) { - throw WrongType(BOOLEAN, m_type); - } - - return *(bool*)m_value; -} - - -bool AnyVal::boolean(bool defaultVal) const { - if (m_type != BOOLEAN) { - return defaultVal; - } - - return *(bool*)m_value; -} - - -const std::string& AnyVal::string() const { - if (m_type != STRING) { - throw WrongType(STRING, m_type); - } - - return *(std::string*)m_value; -} - - -const std::string& AnyVal::string(const std::string& defaultVal) const { - if (m_type != STRING) { - return defaultVal; - } else { - return *(std::string*)m_value; - } -} - - -double AnyVal::number() const { - if (m_type != NUMBER) { - throw WrongType(NUMBER, m_type); - } - - return *(double*)m_value; -} - - -double AnyVal::number(double defaultVal) const { - if (m_type != NUMBER) { - return defaultVal; - } else { - return *(double*)m_value; - } -} - - -const Rect2D& AnyVal::rect2D() const { - if (m_type != RECT2D) { - throw WrongType(RECT2D, m_type); - } - - return *(Rect2D*)m_value; -} - - -const Rect2D& AnyVal::rect2D(const Rect2D& defaultVal) const { - if (m_type != RECT2D) { - return defaultVal; - } else { - return *(Rect2D*)m_value; - } -} - - -const AABox& AnyVal::aabox() const { - if (m_type != AABOX) { - throw WrongType(AABOX, m_type); - } - - return *(AABox*)m_value; -} - - -const AABox& AnyVal::aabox(const AABox& defaultVal) const { - if (m_type != AABOX) { - return defaultVal; - } else { - return *(AABox*)m_value; - } -} - - -const Color1& AnyVal::color1() const { - if (m_type != COLOR1) { - throw WrongType(COLOR1, m_type); - } - - return *(Color1*)m_value; -} - - -const Color1& AnyVal::color1(const Color1& defaultVal) const { - if (m_type != COLOR1) { - return defaultVal; - } else { - return *(Color1*)m_value; - } -} - - -const Color3& AnyVal::color3() const { - if (m_type != COLOR3) { - throw WrongType(COLOR3, m_type); - } - - return *(Color3*)m_value; -} - - -const Color3& AnyVal::color3(const Color3& defaultVal) const { - if (m_type != COLOR3) { - return defaultVal; - } else { - return *(Color3*)m_value; - } -} - - -const Color4& AnyVal::color4() const { - if (m_type != COLOR4) { - throw WrongType(COLOR4, m_type); - } - - return *(Color4*)m_value; -} - - -const Color4& AnyVal::color4(const Color4& defaultVal) const { - if (m_type != COLOR4) { - return defaultVal; - } else { - return *(Color4*)m_value; - } -} - - -const Vector2& AnyVal::vector2() const { - if (m_type != VECTOR2) { - throw WrongType(VECTOR2, m_type); - } - - return *(Vector2*)m_value; -} - - -const Vector2& AnyVal::vector2(const Vector2& defaultVal) const { - if (m_type != VECTOR2) { - return defaultVal; - } else { - return *(Vector2*)m_value; - } -} - - -const Vector3& AnyVal::vector3() const { - if (m_type != VECTOR3) { - throw WrongType(VECTOR3, m_type); - } - - return *(Vector3*)m_value; -} - - -const Vector3& AnyVal::vector3(const Vector3& defaultVal) const { - if (m_type != VECTOR3) { - return defaultVal; - } else { - return *(Vector3*)m_value; - } -} - - -const Vector4& AnyVal::vector4() const { - if (m_type != VECTOR4) { - throw WrongType(VECTOR4, m_type); - } - - return *(Vector4*)m_value; -} - - -const Vector4& AnyVal::vector4(const Vector4& defaultVal) const { - if (m_type != VECTOR4) { - return defaultVal; - } else { - return *(Vector4*)m_value; - } -} - - -const CoordinateFrame& AnyVal::coordinateFrame() const { - if (m_type != COORDINATEFRAME) { - throw WrongType(COORDINATEFRAME, m_type); - } - - return *(CoordinateFrame*)m_value; -} - - -const CoordinateFrame& AnyVal::coordinateFrame(const CoordinateFrame& defaultVal) const { - if (m_type != COORDINATEFRAME) { - return defaultVal; - } else { - return *(CoordinateFrame*)m_value; - } -} - -const Matrix2& AnyVal::matrix2(const Matrix2& defaultVal) const { - if (m_type != MATRIX2) { - return defaultVal; - } else { - return *(Matrix2*)m_value; - } -} - - -const Matrix2& AnyVal::matrix2() const { - if (m_type != MATRIX2) { - throw WrongType(MATRIX2, m_type); - } - - return *(Matrix2*)m_value; -} - - -const Matrix3& AnyVal::matrix3(const Matrix3& defaultVal) const { - if (m_type != MATRIX3) { - return defaultVal; - } else { - return *(Matrix3*)m_value; - } -} - - -const Matrix3& AnyVal::matrix3() const { - if (m_type != MATRIX3) { - throw WrongType(MATRIX3, m_type); - } - - return *(Matrix3*)m_value; -} - - -const Matrix4& AnyVal::matrix4(const Matrix4& defaultVal) const { - if (m_type != MATRIX4) { - return defaultVal; - } else { - return *(Matrix4*)m_value; - } -} - - -const Matrix4& AnyVal::matrix4() const { - if (m_type != MATRIX4) { - throw WrongType(MATRIX4, m_type); - } - - return *(Matrix4*)m_value; -} - - -const Quat& AnyVal::quat(const Quat& defaultVal) const { - if (m_type != QUAT) { - return defaultVal; - } else { - return *(Quat*)m_value; - } -} - - -const Quat& AnyVal::quat() const { - if (m_type != QUAT) { - throw WrongType(QUAT, m_type); - } - - return *(Quat*)m_value; -} - - -const AnyVal& AnyVal::get(const std::string& key, const AnyVal& defaultVal) const { - if (m_type != TABLE) { - return defaultVal; - } - - const Table& t = *(const Table*)m_value; - - if (t.containsKey(key)) { - return t[key]; - } else { - return defaultVal; - } -} - - -const AnyVal& AnyVal::get(const std::string& key) const { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - const Table& t = *(const Table*)m_value; - - if (t.containsKey(key)) { - return t[key]; - } else { - throw KeyNotFound(key); - } -} - - -const AnyVal& AnyVal::get(int i, const AnyVal& defaultVal) const { - if (m_type != ARRAY) { - return defaultVal; - } - - const Array& a = *(const Array*)m_value; - - if ((i >= 0) && (i < a.size())) { - return a[i]; - } else { - return defaultVal; - } -} - - -const AnyVal& AnyVal::get(int i) const { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - - const Array& a = *(const Array*)m_value; - - if ((i >= 0) && (i < a.size())) { - return a[i]; - } else { - throw IndexOutOfBounds(i, a.size()); - } -} - -} diff --git a/dep/src/g3dlite/AreaMemoryManager.cpp b/dep/src/g3dlite/AreaMemoryManager.cpp deleted file mode 100644 index 00cb33dc91f..00000000000 --- a/dep/src/g3dlite/AreaMemoryManager.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/** - @file AreaMemoryManager.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-01-20 - @edited 2009-01-20 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/AreaMemoryManager.h" -#include "G3D/System.h" - -namespace G3D { - -AreaMemoryManager::Buffer::Buffer(size_t size) : m_size(size), m_used(0) { - // Allocate space for a lot of buffers. - m_first = (uint8*)::malloc(m_size); -} - - -AreaMemoryManager::Buffer::~Buffer() { - ::free(m_first); -} - - -void* AreaMemoryManager::Buffer::alloc(size_t s) { - if (s + m_used > m_size) { - return NULL; - } else { - void* old = m_first + m_used; - m_used += s; - return old; - } -} - - -bool AreaMemoryManager::isThreadsafe() const { - return false; -} - - -AreaMemoryManager::Ref AreaMemoryManager::create(size_t sizeHint) { - return new AreaMemoryManager(sizeHint); -} - - -AreaMemoryManager::AreaMemoryManager(size_t sizeHint) : m_sizeHint(sizeHint) { - debugAssert(sizeHint > 0); -} - - -AreaMemoryManager::~AreaMemoryManager() { - deallocateAll(); -} - - -size_t AreaMemoryManager::bytesAllocated() const { - return m_sizeHint * m_bufferArray.size(); -} - - -void* AreaMemoryManager::alloc(size_t s) { - void* n = (m_bufferArray.size() > 0) ? m_bufferArray.last()->alloc(s) : NULL; - if (n == NULL) { - // This buffer is full - m_bufferArray.append(new Buffer(max(s, m_sizeHint))); - return m_bufferArray.last()->alloc(s); - } else { - return n; - } -} - - -void AreaMemoryManager::free(void* x) { - // Intentionally empty; we block deallocate -} - - -void AreaMemoryManager::deallocateAll() { - m_bufferArray.deleteAll(); - m_bufferArray.clear(); -} - -} diff --git a/dep/src/g3dlite/Box2D.cpp b/dep/src/g3dlite/Box2D.cpp deleted file mode 100644 index ea5a47af1a9..00000000000 --- a/dep/src/g3dlite/Box2D.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/** - @file Box.cpp - Box class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2008-12-27 -*/ - -#include "G3D/Box2D.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Rect2D.h" - -namespace G3D { - -bool Box2D::overlaps1Way(const Box2D& other) const { - for (int a = 0; a < 2; ++a) { - - float t = other.m_corner[0].dot(m_axisin[a]); - - // Find the extent of box 2 on m_axisin a - float tMin = t; - float tMax = t; - - for (int c = 1; c < 4; ++c) { - t = other.m_corner[c].dot(m_axisin[a]); - - if (t < tMin) { - tMin = t; - } else if (t > tMax) { - tMax = t; - } - } - - // We have to subtract off the origin - - // See if [tMin, tMax] intersects [0, 1] - if ((tMin > 1 + origin[a]) || (tMax < origin[a])) { - // There was no intersection along this dimension; - // the boxes cannot possibly overlap. - return false; - } - } - - // There was no dimension along which there is no intersection. - // Therefore the boxes overlap. - return true; -} - - -void Box2D::computeAxes() { - m_axis[0] = m_corner[1] - m_corner[0]; - m_axis[1] = m_corner[3] - m_corner[0]; - - // Make the length of each m_axisin = 1/edge length so we know any - // dot product must be less than 1 to fall within the edge. - float len[2]; - for (int a = 0; a < 2; ++a) { - float lenSq = m_axis[a].squaredLength(); - m_axisin[a] = m_axis[a] / lenSq; - origin[a] = m_corner[0].dot(m_axisin[a]); - len[a] = sqrt(lenSq); - m_axis[a] /= len[a]; - } - - // w * h - m_area = len[0] * len[1]; - - - m_center = (m_corner[0] + m_corner[2]) * 0.5f; -} - - -Box2D::Box2D(const Vector2& center, float w, float h, float angle) { - Vector2 X( cos(angle), sin(angle)); - Vector2 Y(-sin(angle), cos(angle)); - - X *= w / 2; - Y *= h / 2; - - m_corner[0] = center - X - Y; - m_corner[1] = center + X - Y; - m_corner[2] = center + X + Y; - m_corner[3] = center - X + Y; - - computeAxes(); -} - - -Box2D::Box2D(const AABox2D& b) { - for (int i = 0; i < 4; ++i) { - m_corner[i] = b.corner(i); - } - - computeAxes(); -} - - -Box2D::Box2D(const Vector2& min, const Vector2& max) { - *this = Box2D(Rect2D::xyxy(min, max)); -} - - -Box2D::Box2D(const CFrame& frame, Box2D& b) { - for (int i = 0; i < 4; ++i) { - m_corner[i] = frame.pointToWorldSpace(Vector3(b.corner(i), 0)).xy(); - } - computeAxes(); -} - - -} // G3D diff --git a/dep/src/g3dlite/BumpMapPreprocess.cpp b/dep/src/g3dlite/BumpMapPreprocess.cpp deleted file mode 100644 index 20281caf8cb..00000000000 --- a/dep/src/g3dlite/BumpMapPreprocess.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/** - \file BumpMapPreprocess.cpp - - \maintainer Morgan McGuire, http://graphics.cs.williams.edu - - \created 2010-01-28 - \edited 2010-01-28 - - Copyright 2000-2010, Morgan McGuire. - All rights reserved. - */ -#include "G3D/BumpMapPreprocess.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -BumpMapPreprocess::BumpMapPreprocess(const Any& any) { - *this = BumpMapPreprocess(); - for (Any::AnyTable::Iterator it = any.table().begin(); it.hasMore(); ++it) { - const std::string& key = toLower(it->key); - if (key == "lowpassfilter") { - lowPassFilter = it->value; - } else if (key == "zextentpixels") { - zExtentPixels = it->value; - } else if (key == "scalezbynz") { - scaleZByNz = it->value; - } else { - any.verify(false, "Illegal key: " + it->key); - } - } -} - - -BumpMapPreprocess::operator Any() const { - Any any(Any::TABLE, "BumpMapPreprocess"); - any["lowPassFilter"] = lowPassFilter; - any["zExtentPixels"] = zExtentPixels; - any["scaleZByNz"] = scaleZByNz; - return any; -} - -} diff --git a/dep/src/g3dlite/CMakeLists.txt b/dep/src/g3dlite/CMakeLists.txt deleted file mode 100644 index 0a548e44f8b..00000000000 --- a/dep/src/g3dlite/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ - -########### next target ############### - -SET(g3dlite_STAT_SRCS - AABox.cpp - Box.cpp - Crypto.cpp - format.cpp - Matrix3.cpp - Plane.cpp - System.cpp - Triangle.cpp - Vector3.cpp - Vector4.cpp - debugAssert.cpp - fileutils.cpp - g3dmath.cpp - g3dfnmatch.cpp - prompt.cpp - stringutils.cpp - Any.cpp - BinaryFormat.cpp - BinaryInput.cpp - BinaryOutput.cpp - Capsule.cpp - CollisionDetection.cpp - CoordinateFrame.cpp - Cylinder.cpp - Line.cpp - LineSegment.cpp - Log.cpp - Matrix4.cpp - MemoryManager.cpp - Quat.cpp - Random.cpp - Ray.cpp - ReferenceCount.cpp - Sphere.cpp - TextInput.cpp - TextOutput.cpp - UprightFrame.cpp - Vector2.cpp -) - -include_directories( - ${CMAKE_SOURCE_DIR}/dep/include - ${CMAKE_SOURCE_DIR}/dep/include/g3dlite -) - -add_library(g3dlite STATIC ${g3dlite_STAT_SRCS}) - - -########### install files ############### diff --git a/dep/src/g3dlite/Color1.cpp b/dep/src/g3dlite/Color1.cpp deleted file mode 100644 index 04f3f9412b1..00000000000 --- a/dep/src/g3dlite/Color1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - @file Color1.cpp - - Color class. - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-30 - @edited 2009-03-27 - */ - -#include "G3D/platform.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Color3.h" - -namespace G3D { - -const Color1& Color1::one() { - static const Color1 x(1.0f); - return x; -} - - -const Color1& Color1::zero() { - const static Color1 x(0.0f); - return x; -} - - -Color1::Color1(BinaryInput& bi) { - deserialize(bi); -} - - -Color3 Color1::rgb() const { - return Color3(value, value, value); -} - - -void Color1::deserialize(BinaryInput& bi) { - value = bi.readFloat32(); -} - - -void Color1::serialize(BinaryOutput& bo) const { - bo.writeFloat32(value); -} - - -Color1::Color1(const class Color1uint8& other) { - value = other.value / 255.0f; -} - -} // namespace G3D - diff --git a/dep/src/g3dlite/Color1uint8.cpp b/dep/src/g3dlite/Color1uint8.cpp deleted file mode 100644 index 21cd564ba92..00000000000 --- a/dep/src/g3dlite/Color1uint8.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - @file Color1uint8.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-30 - @edited 2007-01-30 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color1.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color1uint8::Color1uint8(const class Color1& c) : value(iClamp(iFloor(c.value * 256), 0, 255)) { -} - - -Color1uint8::Color1uint8(class BinaryInput& bi) { - deserialize(bi); -} - - -void Color1uint8::serialize(class BinaryOutput& bo) const { - bo.writeUInt8(value); -} - - -void Color1uint8::deserialize(class BinaryInput& bi) { - value = bi.readUInt8(); -} - - -} diff --git a/dep/src/g3dlite/Color3.cpp b/dep/src/g3dlite/Color3.cpp deleted file mode 100644 index deb0bd87ee7..00000000000 --- a/dep/src/g3dlite/Color3.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/** - @file Color3.cpp - - Color class. - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-06-02 - @edited 2010-01-28 - */ - -#include "G3D/platform.h" -#include -#include "G3D/Color3.h" -#include "G3D/Vector3.h" -#include "G3D/format.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Color3uint8.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -Color3::Color3(const Any& any) { - *this = Color3::zero(); - any.verifyName("Color3"); - std::string name = toLower(any.name()); - - switch (any.type()) { - case Any::TABLE: - - for (Any::AnyTable::Iterator it = any.table().begin(); it.hasMore(); ++it) { - const std::string& key = toLower(it->key); - if (key == "r") { - r = it->value; - } else if (key == "g") { - g = it->value; - } else if (key == "b") { - b = it->value; - } else { - any.verify(false, "Illegal key: " + it->key); - } - } - break; - - case Any::ARRAY: - if (name == "color3") { - any.verifySize(3); - r = any[0]; - g = any[1]; - b = any[2]; - } else if (name == "color3::one") { - any.verifySize(0); - *this = one(); - } else if (name == "color3::zero") { - any.verifySize(0); - *this = zero(); - } else if (name == "color3::fromargb") { - *this = Color3::fromARGB((int)any[0].number()); - } else { - any.verify(false, "Expected Color3 constructor"); - } - break; - - default: - any.verify(false, "Bad Color3 constructor"); - } -} - - -Color3::operator Any() const { - Any a(Any::ARRAY, "Color3"); - a.append(r, g, b); - return a; -} - - -Color3 Color3::ansiMap(uint32 i) { - static const Color3 map[] = - {Color3::black(), Color3::red() * 0.75f, Color3::green() * 0.75f, Color3::yellow() * 0.75f, - Color3::blue() * 0.75f, Color3::purple() * 0.75f, Color3::cyan() * 0.75f, Color3::white() * 0.75f, - Color3::white() * 0.90f, Color3::red(), Color3::green(), Color3::yellow(), Color3::blue(), - Color3::purple(), Color3::cyan(), Color3::white()}; - - return map[i & 15]; -} - - -Color3 Color3::pastelMap(uint32 i) { - uint32 x = Crypto::crc32(&i, sizeof(uint32)); - // Create fairly bright, saturated colors - Vector3 v(((x >> 22) & 1023) / 1023.0f, - (((x >> 11) & 2047) / 2047.0f) * 0.5f + 0.25f, - ((x & 2047) / 2047.0f) * 0.75f + 0.25f); - return Color3::fromHSV(v); -} - - -const Color3& Color3::red() { - static Color3 c(1.0f, 0.0f, 0.0f); - return c; -} - - -const Color3& Color3::green() { - static Color3 c(0.0f, 1.0f, 0.0f); - return c; -} - - -const Color3& Color3::blue() { - static Color3 c(0.0f, 0.0f, 1.0f); - return c; -} - - -const Color3& Color3::purple() { - static Color3 c(0.7f, 0.0f, 1.0f); - return c; -} - - -const Color3& Color3::cyan() { - static Color3 c(0.0f, 0.7f, 1.0f); - return c; -} - - -const Color3& Color3::yellow() { - static Color3 c(1.0f, 1.0f, 0.0f); - return c; -} - - -const Color3& Color3::brown() { - static Color3 c(0.5f, 0.5f, 0.0f); - return c; -} - - -const Color3& Color3::orange() { - static Color3 c(1.0f, 0.5f, 0.0f); - return c; -} - - -const Color3& Color3::black() { - static Color3 c(0.0f, 0.0f, 0.0f); - return c; -} - -const Color3& Color3::zero() { - static Color3 c(0.0f, 0.0f, 0.0f); - return c; -} - - -const Color3& Color3::one() { - static Color3 c(1.0f, 1.0f, 1.0f); - return c; -} - - -const Color3& Color3::gray() { - static Color3 c(0.7f, 0.7f, 0.7f); - return c; -} - - -const Color3& Color3::white() { - static Color3 c(1, 1, 1); - return c; -} - - -bool Color3::isFinite() const { - return G3D::isFinite(r) && G3D::isFinite(g) && G3D::isFinite(b); -} - - -Color3::Color3(BinaryInput& bi) { - deserialize(bi); -} - - -void Color3::deserialize(BinaryInput& bi) { - r = bi.readFloat32(); - g = bi.readFloat32(); - b = bi.readFloat32(); -} - - -void Color3::serialize(BinaryOutput& bo) const { - bo.writeFloat32(r); - bo.writeFloat32(g); - bo.writeFloat32(b); -} - - -const Color3& Color3::wheelRandom() { - static const Color3 colorArray[8] = - {Color3::blue(), Color3::red(), Color3::green(), - Color3::orange(), Color3::yellow(), - Color3::cyan(), Color3::purple(), Color3::brown()}; - - return colorArray[iRandom(0, 7)]; -} - - -size_t Color3::hashCode() const { - unsigned int rhash = (*(int*)(void*)(&r)); - unsigned int ghash = (*(int*)(void*)(&g)); - unsigned int bhash = (*(int*)(void*)(&b)); - - return rhash + (ghash * 37) + (bhash * 101); -} - - -Color3::Color3(const Vector3& v) { - r = v.x; - g = v.y; - b = v.z; -} - - -Color3::Color3(const class Color3uint8& other) { - r = other.r / 255.0f; - g = other.g / 255.0f; - b = other.b / 255.0f; -} - - -Color3 Color3::fromARGB(uint32 x) { - return Color3((float)((x >> 16) & 0xFF), (float)((x >> 8) & 0xFF), (float)(x & 0xFF)) / 255.0f; -} - -//---------------------------------------------------------------------------- - - -Color3 Color3::random() { - return Color3(uniformRandom(), - uniformRandom(), - uniformRandom()).direction(); -} - -//---------------------------------------------------------------------------- -Color3& Color3::operator/= (float fScalar) { - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - r *= fInvScalar; - g *= fInvScalar; - b *= fInvScalar; - } else { - r = (float)G3D::finf(); - g = (float)G3D::finf(); - b = (float)G3D::finf(); - } - - return *this; -} - -//---------------------------------------------------------------------------- -float Color3::unitize (float fTolerance) { - float fLength = length(); - - if ( fLength > fTolerance ) { - float fInvLength = 1.0f / fLength; - r *= fInvLength; - g *= fInvLength; - b *= fInvLength; - } else { - fLength = 0.0f; - } - - return fLength; -} - -//---------------------------------------------------------------------------- -Color3 Color3::fromHSV(const Vector3& _hsv) { - debugAssertM((_hsv.x <= 1.0f && _hsv.x >= 0.0f) - && (_hsv.y <= 1.0f && _hsv.y >= 0.0f) - && ( _hsv.z <= 1.0f && _hsv.z >= 0.0f), "H,S,V must be between [0,1]"); - const int i = iMin(5, G3D::iFloor(6.0 * _hsv.x)); - const float f = 6.0f * _hsv.x - i; - const float m = _hsv.z * (1.0f - (_hsv.y)); - const float n = _hsv.z * (1.0f - (_hsv.y * f)); - const float k = _hsv.z * (1.0f - (_hsv.y * (1 - f))); - switch(i) { - case 0: - return Color3(_hsv.z, k, m); - - case 1: - return Color3(n, _hsv.z, m); - - case 2: - return Color3(m, _hsv.z, k); - - case 3: - return Color3(m, n, _hsv.z); - - case 4: - return Color3(k, m, _hsv.z); - - case 5: - return Color3(_hsv.z, m, n); - - default: - debugAssertM(false, "fell through switch.."); - } - return Color3::black(); -} - - -Vector3 Color3::toHSV(const Color3& _rgb) { - debugAssertM((_rgb.r <= 1.0f && _rgb.r >= 0.0f) - && (_rgb.g <= 1.0f && _rgb.g >= 0.0f) - && (_rgb.b <= 1.0f && _rgb.b >= 0.0f), "R,G,B must be between [0,1]"); - Vector3 hsv = Vector3::zero(); - hsv.z = G3D::max(G3D::max(_rgb.r, _rgb.g), _rgb.b); - if (G3D::fuzzyEq(hsv.z, 0.0f)) { - return hsv; - } - - const float x = G3D::min(G3D::min(_rgb.r, _rgb.g), _rgb.b); - hsv.y = (hsv.z - x) / hsv.z; - - if (G3D::fuzzyEq(hsv.y, 0.0f)) { - return hsv; - } - - Vector3 rgbN; - rgbN.x = (hsv.z - _rgb.r) / (hsv.z - x); - rgbN.y = (hsv.z - _rgb.g) / (hsv.z - x); - rgbN.z = (hsv.z - _rgb.b) / (hsv.z - x); - - if (_rgb.r == hsv.z) { // note from the max we know that it exactly equals one of the three. - hsv.x = (_rgb.g == x)? 5.0f + rgbN.z : 1.0f - rgbN.y; - } else if (_rgb.g == hsv.z) { - hsv.x = (_rgb.b == x)? 1.0f + rgbN.x : 3.0f - rgbN.z; - } else { - hsv.x = (_rgb.r == x)? 3.0f + rgbN.y : 5.0f - rgbN.x; - } - - hsv.x /= 6.0f; - - return hsv; -} - -Color3 Color3::jetColorMap(const float& val) { - debugAssertM(val <= 1.0f && val >= 0.0f , "value should be in [0,1]"); - - //truncated triangles where sides have slope 4 - Color3 jet; - - jet.r = G3D::min(4.0f * val - 1.5f,-4.0f * val + 4.5f) ; - jet.g = G3D::min(4.0f * val - 0.5f,-4.0f * val + 3.5f) ; - jet.b = G3D::min(4.0f * val + 0.5f,-4.0f * val + 2.5f) ; - - - jet.r = G3D::clamp(jet.r, 0.0f, 1.0f); - jet.g = G3D::clamp(jet.g, 0.0f, 1.0f); - jet.b = G3D::clamp(jet.b, 0.0f, 1.0f); - - return jet; -} - - - - - -std::string Color3::toString() const { - return G3D::format("(%g, %g, %g)", r, g, b); -} - -//---------------------------------------------------------------------------- - -Color3 Color3::rainbowColorMap(float hue) { - return fromHSV(Vector3(hue, 1.0f, 1.0f)); -} - - -}; // namespace - diff --git a/dep/src/g3dlite/Color3uint8.cpp b/dep/src/g3dlite/Color3uint8.cpp deleted file mode 100644 index a744710c752..00000000000 --- a/dep/src/g3dlite/Color3uint8.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - @file Color3uint8.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-04-07 - @edited 2006-01-07 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color3uint8::Color3uint8(const class Color3& c) { - r = iMin(255, iFloor(c.r * 256)); - g = iMin(255, iFloor(c.g * 256)); - b = iMin(255, iFloor(c.b * 256)); -} - - -Color3uint8::Color3uint8(class BinaryInput& bi) { - deserialize(bi); -} - - -void Color3uint8::serialize(class BinaryOutput& bo) const { - bo.writeUInt8(r); - bo.writeUInt8(g); - bo.writeUInt8(b); -} - - -void Color3uint8::deserialize(class BinaryInput& bi) { - r = bi.readUInt8(); - g = bi.readUInt8(); - b = bi.readUInt8(); -} - - -} diff --git a/dep/src/g3dlite/Color4.cpp b/dep/src/g3dlite/Color4.cpp deleted file mode 100644 index eab09eb9c7e..00000000000 --- a/dep/src/g3dlite/Color4.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/** - @file Color4.cpp - - Color class. - - @author Morgan McGuire, http://graphics.cs.williams.edu - @cite Portions by Laura Wollstadt, graphics3d.com - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - - @created 2002-06-25 - @edited 2009-11-10 - */ - -#include -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/Vector4.h" -#include "G3D/format.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -Color4::Color4(const Any& any) { - *this = Color4::zero(); - any.verifyName("Color4"); - - if (any.type() == Any::TABLE) { - for (Any::AnyTable::Iterator it = any.table().begin(); it.hasMore(); ++it) { - const std::string& key = toLower(it->key); - if (key == "r") { - r = it->value; - } else if (key == "g") { - g = it->value; - } else if (key == "b") { - b = it->value; - } else if (key == "a") { - a = it->value; - } else { - any.verify(false, "Illegal key: " + it->key); - } - } - } else if (toLower(any.name()) == "color4") { - r = any[0]; - g = any[1]; - b = any[2]; - a = any[3]; - } else { - any.verifyName("Color4::fromARGB"); - *this = Color4::fromARGB((int)any[0].number()); - } -} - - -Color4::operator Any() const { - Any any(Any::ARRAY, "Color4"); - any.append(r, g, b, a); - return any; -} - - -const Color4& Color4::one() { - const static Color4 x(1.0f, 1.0f, 1.0f, 1.0f); - return x; -} - - -const Color4& Color4::zero() { - static Color4 c(0.0f, 0.0f, 0.0f, 0.0f); - return c; -} - - -const Color4& Color4::inf() { - static Color4 c((float)G3D::finf(), (float)G3D::finf(), (float)G3D::finf(), (float)G3D::finf()); - return c; -} - - -const Color4& Color4::nan() { - static Color4 c((float)G3D::fnan(), (float)G3D::fnan(), (float)G3D::fnan(), (float)G3D::fnan()); - return c; -} - - -const Color4& Color4::clear() { - return Color4::zero(); -} - - -Color4::Color4(const Vector4& v) { - r = v.x; - g = v.y; - b = v.z; - a = v.w; -} - - -Color4::Color4(const Color4uint8& c) : r(c.r), g(c.g), b(c.b), a(c.a) { - *this /= 255.0f; -} - -size_t Color4::hashCode() const { - unsigned int rhash = (*(int*)(void*)(&r)); - unsigned int ghash = (*(int*)(void*)(&g)); - unsigned int bhash = (*(int*)(void*)(&b)); - unsigned int ahash = (*(int*)(void*)(&a)); - - return rhash + (ghash * 37) + (bhash * 101) + (ahash * 241); -} - -Color4 Color4::fromARGB(uint32 x) { - return Color4( - (float)((x >> 16) & 0xFF), - (float)((x >> 8) & 0xFF), - (float)(x & 0xFF), - (float)((x >> 24) & 0xFF)) / 255.0; -} - - -Color4::Color4(BinaryInput& bi) { - deserialize(bi); -} - - -void Color4::deserialize(BinaryInput& bi) { - r = bi.readFloat32(); - g = bi.readFloat32(); - b = bi.readFloat32(); - a = bi.readFloat32(); -} - - -void Color4::serialize(BinaryOutput& bo) const { - bo.writeFloat32(r); - bo.writeFloat32(g); - bo.writeFloat32(b); - bo.writeFloat32(a); -} - - -//---------------------------------------------------------------------------- - -Color4 Color4::operator/ (float fScalar) const { - Color4 kQuot; - - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - kQuot.r = fInvScalar * r; - kQuot.g = fInvScalar * g; - kQuot.b = fInvScalar * b; - kQuot.a = fInvScalar * a; - return kQuot; - - } else { - - return Color4::inf(); - } -} - -//---------------------------------------------------------------------------- - -Color4& Color4::operator/= (float fScalar) { - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - r *= fInvScalar; - g *= fInvScalar; - b *= fInvScalar; - a *= fInvScalar; - } else { - r = (float)G3D::finf(); - g = (float)G3D::finf(); - b = (float)G3D::finf(); - a = (float)G3D::finf(); - } - - return *this; -} - -//---------------------------------------------------------------------------- - -std::string Color4::toString() const { - return G3D::format("(%g, %g, %g, %g)", r, g, b, a); -} - -//---------------------------------------------------------------------------- - -}; // namespace - diff --git a/dep/src/g3dlite/Color4uint8.cpp b/dep/src/g3dlite/Color4uint8.cpp deleted file mode 100644 index 5cc3a578aca..00000000000 --- a/dep/src/g3dlite/Color4uint8.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - @file Color4uint8.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-04-07 - @edited 2006-01-07 - */ -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color4.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color4uint8::Color4uint8(const class Color4& c) { - r = iMin(255, iFloor(c.r * 256)); - g = iMin(255, iFloor(c.g * 256)); - b = iMin(255, iFloor(c.b * 256)); - a = iMin(255, iFloor(c.a * 256)); -} - - -Color4uint8::Color4uint8(class BinaryInput& bi) { - deserialize(bi); -} - - -void Color4uint8::serialize(class BinaryOutput& bo) const { - bo.writeUInt8(r); - bo.writeUInt8(g); - bo.writeUInt8(b); - bo.writeUInt8(a); -} - - -void Color4uint8::deserialize(class BinaryInput& bi) { - r = bi.readUInt8(); - g = bi.readUInt8(); - b = bi.readUInt8(); - a = bi.readUInt8(); -} - - -} diff --git a/dep/src/g3dlite/Cone.cpp b/dep/src/g3dlite/Cone.cpp deleted file mode 100644 index 3104b8424a7..00000000000 --- a/dep/src/g3dlite/Cone.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/** - @file Cone.cpp - - Cone class - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-07-09 - @edited 2006-01-29 -*/ - -#include "G3D/platform.h" -#include "G3D/Cone.h" -#include "G3D/Line.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" - -namespace G3D { - -Cone::Cone(const Vector3 &tip, const Vector3 &direction, float angle) { - this->tip = tip; - this->direction = direction.direction(); - this->angle = angle; - - debugAssert(angle >= 0); - debugAssert(angle <= pi()); -} - -/** - Forms the smallest cone that contains the box. Undefined if - the tip is inside or on the box. - */ -Cone::Cone(const Vector3& tip, const Box& box) { - this->tip = tip; - this->direction = (box.center() - tip).direction(); - - // Find the biggest angle - float smallestDotProduct = direction.dot((box.corner(0) - tip).direction()); - - for (int i = 1; i < 8; ++i) { - float dp = direction.dot((box.corner(i) - tip).direction()); - - debugAssert(dp > 0); - - if (dp < smallestDotProduct) { - smallestDotProduct = dp; - } - } - - angle = acosf(smallestDotProduct); -} - - -bool Cone::intersects(const Sphere& b) const { - // If the bounding sphere contains the tip, then - // they definitely touch. - if (b.contains(this->tip)) { - return true; - } - - // Move the tip backwards, effectively making the cone bigger - // to account for the radius of the sphere. - - Vector3 tip = this->tip - direction * b.radius / sinf(angle); - - return Cone(tip, direction, angle).contains(b.center); -} - - -bool Cone::contains(const Vector3& v) const { - - Vector3 d = (v - tip).direction(); - - float x = d.dot(direction); - - return (x > 0) && (x >= cosf(angle)); -} - -}; // namespace diff --git a/dep/src/g3dlite/ConvexPolyhedron.cpp b/dep/src/g3dlite/ConvexPolyhedron.cpp deleted file mode 100644 index 5fa76e3ed41..00000000000 --- a/dep/src/g3dlite/ConvexPolyhedron.cpp +++ /dev/null @@ -1,457 +0,0 @@ -/** - @file ConvexPolyhedron.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2001-11-11 - @edited 2009-08-10 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/ConvexPolyhedron.h" -#include "G3D/debug.h" - -namespace G3D { - -ConvexPolygon::ConvexPolygon(const Array& __vertex) : _vertex(__vertex) { - // Intentionally empty -} - - -ConvexPolygon::ConvexPolygon(const Vector3& v0, const Vector3& v1, const Vector3& v2) { - _vertex.append(v0, v1, v2); -} - - -bool ConvexPolygon::isEmpty() const { - return (_vertex.length() == 0) || (getArea() <= fuzzyEpsilon); -} - - -float ConvexPolygon::getArea() const { - - if (_vertex.length() < 3) { - return 0; - } - - float sum = 0; - - int length = _vertex.length(); - // Split into triangle fan, compute individual area - for (int v = 2; v < length; v++) { - int i0 = 0; - int i1 = v - 1; - int i2 = v; - - sum += (_vertex[i1] - _vertex[i0]).cross(_vertex[i2] - _vertex[i0]).magnitude() / 2; - } - - return sum; -} - -void ConvexPolygon::cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below) { - DirectedEdge edge; - cut(plane, above, below, edge); -} - -void ConvexPolygon::cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below, DirectedEdge &newEdge) { - above._vertex.resize(0); - below._vertex.resize(0); - - if (isEmpty()) { - //debugPrintf("Empty\n"); - return; - } - - int v = 0; - int length = _vertex.length(); - - - Vector3 polyNormal = normal(); - Vector3 planeNormal= plane.normal(); - - // See if the polygon is *in* the plane. - if (planeNormal.fuzzyEq(polyNormal) || planeNormal.fuzzyEq(-polyNormal)) { - // Polygon is parallel to the plane. It must be either above, - // below, or in the plane. - - double a, b, c, d; - Vector3 pt = _vertex[0]; - - plane.getEquation(a,b,c,d); - float r = (float)(a * pt.x + b * pt.y + c * pt.z + d); - - if (fuzzyGe(r, 0)) { - // The polygon is entirely in the plane. - //debugPrintf("Entirely above\n"); - above = *this; - return; - } else { - //debugPrintf("Entirely below (1)\n"); - below = *this; - return; - } - } - - - // Number of edges crossing the plane. Used for - // debug assertions. - int count = 0; - - // True when the last _vertex we looked at was above the plane - bool lastAbove = plane.halfSpaceContains(_vertex[v]); - - if (lastAbove) { - above._vertex.append(_vertex[v]); - } else { - below._vertex.append(_vertex[v]); - } - - for (v = 1; v < length; v++) { - bool isAbove = plane.halfSpaceContains(_vertex[v]); - - if (lastAbove ^ isAbove) { - // Switched sides. - // Create an interpolated point that lies - // in the plane, between the two points. - Line line = Line::fromTwoPoints(_vertex[v - 1], _vertex[v]); - Vector3 interp = line.intersection(plane); - - if (! interp.isFinite()) { - - // Since the polygon is not in the plane (we checked above), - // it must be the case that this edge (and only this edge) - // is in the plane. This only happens when the polygon is - // entirely below the plane except for one edge. This edge - // forms a degenerate polygon, so just treat the whole polygon - // as below the plane. - below = *this; - above._vertex.resize(0); - //debugPrintf("Entirely below\n"); - return; - } - - above._vertex.append(interp); - below._vertex.append(interp); - if (lastAbove) { - newEdge.stop = interp; - } else { - newEdge.start = interp; - } - count++; - } - - lastAbove = isAbove; - if (lastAbove) { - above._vertex.append(_vertex[v]); - } else { - below._vertex.append(_vertex[v]); - } - } - - // Loop back to the first point, seeing if an interpolated point is - // needed. - bool isAbove = plane.halfSpaceContains(_vertex[0]); - if (lastAbove ^ isAbove) { - Line line = Line::fromTwoPoints(_vertex[length - 1], _vertex[0]); - Vector3 interp = line.intersection(plane); - if (! interp.isFinite()) { - // Since the polygon is not in the plane (we checked above), - // it must be the case that this edge (and only this edge) - // is in the plane. This only happens when the polygon is - // entirely below the plane except for one edge. This edge - // forms a degenerate polygon, so just treat the whole polygon - // as below the plane. - below = *this; - above._vertex.resize(0); - //debugPrintf("Entirely below\n"); - return; - } - - above._vertex.append(interp); - below._vertex.append(interp); - debugAssertM(count < 2, "Convex polygons may only intersect planes at two edges."); - if (lastAbove) { - newEdge.stop = interp; - } else { - newEdge.start = interp; - } - ++count; - } - - debugAssertM((count == 2) || (count == 0), "Convex polygons may only intersect planes at two edges."); -} - - -ConvexPolygon ConvexPolygon::inverse() const { - ConvexPolygon result; - int length = _vertex.length(); - result._vertex.resize(length); - - for (int v = 0; v < length; v++) { - result._vertex[v] = _vertex[length - v - 1]; - } - - return result; -} - - -void ConvexPolygon::removeDuplicateVertices(){ - // Any valid polygon should have 3 or more vertices, but why take chances? - if (_vertex.size() >= 2){ - - // Remove duplicate vertices. - for (int i=0;i<_vertex.size()-1;++i){ - if (_vertex[i].fuzzyEq(_vertex[i+1])){ - _vertex.remove(i+1); - --i; // Don't move forward. - } - } - - // Check the last vertex against the first. - if (_vertex[_vertex.size()-1].fuzzyEq(_vertex[0])){ - _vertex.pop(); - } - } -} - -////////////////////////////////////////////////////////////////////////////// - -ConvexPolyhedron::ConvexPolyhedron(const Array& _face) : face(_face) { - // Intentionally empty -} - - -float ConvexPolyhedron::getVolume() const { - - if (face.length() < 4) { - return 0; - } - - // The volume of any pyramid is 1/3 * h * base area. - // Discussion at: http://nrich.maths.org/mathsf/journalf/oct01/art1/ - - float sum = 0; - - // Choose the first _vertex of the first face as the origin. - // This lets us skip one face, too, and avoids negative heights. - Vector3 v0 = face[0]._vertex[0]; - for (int f = 1; f < face.length(); f++) { - const ConvexPolygon& poly = face[f]; - - float height = (poly._vertex[0] - v0).dot(poly.normal()); - float base = poly.getArea(); - - sum += height * base; - } - - return sum / 3; -} - -bool ConvexPolyhedron::isEmpty() const { - return (face.length() == 0) || (getVolume() <= fuzzyEpsilon); -} - -void ConvexPolyhedron::cut(const Plane& plane, ConvexPolyhedron &above, ConvexPolyhedron &below) { - above.face.resize(0); - below.face.resize(0); - - Array edge; - - int f; - - // See if the plane cuts this polyhedron at all. Detect when - // the polyhedron is entirely to one side or the other. - //{ - int numAbove = 0, numIn = 0, numBelow = 0; - bool ruledOut = false; - double d; - Vector3 abc; - plane.getEquation(abc, d); - - // This number has to be fairly large to prevent precision problems down - // the road. - const float eps = 0.005f; - for (f = face.length() - 1; (f >= 0) && (!ruledOut); f--) { - const ConvexPolygon& poly = face[f]; - for (int v = poly._vertex.length() - 1; (v >= 0) && (!ruledOut); v--) { - double r = abc.dot(poly._vertex[v]) + d; - if (r > eps) { - numAbove++; - } else if (r < -eps) { - numBelow++; - } else { - numIn++; - } - - ruledOut = (numAbove != 0) && (numBelow !=0); - } - } - - if (numBelow == 0) { - above = *this; - return; - } else if (numAbove == 0) { - below = *this; - return; - } - //} - - // Clip each polygon, collecting split edges. - for (f = face.length() - 1; f >= 0; f--) { - ConvexPolygon a, b; - DirectedEdge e; - face[f].cut(plane, a, b, e); - - bool aEmpty = a.isEmpty(); - bool bEmpty = b.isEmpty(); - - //debugPrintf("\n"); - if (! aEmpty) { - //debugPrintf(" Above %f\n", a.getArea()); - above.face.append(a); - } - - if (! bEmpty) { - //debugPrintf(" Below %f\n", b.getArea()); - below.face.append(b); - } - - if (! aEmpty && ! bEmpty) { - //debugPrintf(" == Split\n"); - edge.append(e); - } else { - // Might be the case that the polygon is entirely on - // one side of the plane yet there is an edge we need - // because it touches the plane. - // - // Extract the non-empty _vertex list and examine it. - // If we find exactly one edge in the plane, add that edge. - const Array& _vertex = (aEmpty ? b._vertex : a._vertex); - int L = _vertex.length(); - int count = 0; - for (int v = 0; v < L; v++) { - if (plane.fuzzyContains(_vertex[v]) && plane.fuzzyContains(_vertex[(v + 1) % L])) { - e.start = _vertex[v]; - e.stop = _vertex[(v + 1) % L]; - count++; - } - } - - if (count == 1) { - edge.append(e); - } - } - } - - if (above.face.length() == 1) { - // Only one face above means that this entire - // polyhedron is below the plane. Move that face over. - below.face.append(above.face[0]); - above.face.resize(0); - } else if (below.face.length() == 1) { - // This shouldn't happen, but it arises in practice - // from numerical imprecision. - above.face.append(below.face[0]); - below.face.resize(0); - } - - if ((above.face.length() > 0) && (below.face.length() > 0)) { - // The polyhedron was actually cut; create a cap polygon - ConvexPolygon cap; - - // Collect the final polgyon by sorting the edges - int numVertices = edge.length(); -/*debugPrintf("\n"); -for (int xx=0; xx < numVertices; xx++) { - std::string s1 = edge[xx].start.toString(); - std::string s2 = edge[xx].stop.toString(); - debugPrintf("%s -> %s\n", s1.c_str(), s2.c_str()); -} -*/ - - // Need at least three points to make a polygon - debugAssert(numVertices >= 3); - - Vector3 last_vertex = edge.last().stop; - cap._vertex.append(last_vertex); - - // Search for the next _vertex. Because of accumulating - // numerical error, we have to find the closest match, not - // just the one we expect. - for (int v = numVertices - 1; v >= 0; v--) { - // matching edge index - int index = 0; - int num = edge.length(); - double distance = (edge[index].start - last_vertex).squaredMagnitude(); - for (int e = 1; e < num; e++) { - double d = (edge[e].start - last_vertex).squaredMagnitude(); - - if (d < distance) { - // This is the new closest one - index = e; - distance = d; - } - } - - // Don't tolerate ridiculous error. - debugAssertM(distance < 0.02, "Edge missing while closing polygon."); - - last_vertex = edge[index].stop; - cap._vertex.append(last_vertex); - } - - //debugPrintf("\n"); - //debugPrintf("Cap (both) %f\n", cap.getArea()); - above.face.append(cap); - below.face.append(cap.inverse()); - } - - // Make sure we put enough faces on each polyhedra - debugAssert((above.face.length() == 0) || (above.face.length() >= 4)); - debugAssert((below.face.length() == 0) || (below.face.length() >= 4)); -} - -/////////////////////////////////////////////// - -ConvexPolygon2D::ConvexPolygon2D(const Array& pts, bool reverse) : m_vertex(pts) { - if (reverse) { - m_vertex.reverse(); - } -} - - -bool ConvexPolygon2D::contains(const Vector2& p, bool reverse) const { - // Compute the signed area of each polygon from p to an edge. - // If the area is non-negative for all polygons then p is inside - // the polygon. (To adapt this algorithm for a concave polygon, - // the *sum* of the areas must be non-negative). - - float r = reverse ? -1 : 1; - - for (int i0 = 0; i0 < m_vertex.size(); ++i0) { - int i1 = (i0 + 1) % m_vertex.size(); - const Vector2& v0 = m_vertex[i0]; - const Vector2& v1 = m_vertex[i1]; - - Vector2 e0 = v0 - p; - Vector2 e1 = v1 - p; - - // Area = (1/2) cross product, negated to be ccw in - // a 2D space; we neglect the 1/2 - float area = -(e0.x * e1.y - e0.y * e1.x); - - if (area * r < 0) { - return false; - } - } - - return true; -} - - -} - diff --git a/dep/src/g3dlite/Crypto_md5.cpp b/dep/src/g3dlite/Crypto_md5.cpp deleted file mode 100644 index c7ee535d61e..00000000000 --- a/dep/src/g3dlite/Crypto_md5.cpp +++ /dev/null @@ -1,471 +0,0 @@ -/** - @file Crypto_md5.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - Copyright 2006-2007, Morgan McGuire. All rights reserved. - - @created 2006-03-28 - @edited 2006-04-06 - */ - -#include "G3D/platform.h" -#include "G3D/Crypto.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -#include - -namespace G3D { - - -MD5Hash::MD5Hash(class BinaryInput& b) { - deserialize(b); -} - - -void MD5Hash::deserialize(class BinaryInput& b) { - b.readBytes(value, 16); -} - - -void MD5Hash::serialize(class BinaryOutput& b) const { - b.writeBytes(value, 16); -} - - -typedef unsigned char md5_byte_t; /* 8-bit byte */ -typedef unsigned int md5_word_t; /* 32-bit word */ - -/* Define the state of the MD5 Algorithm. */ -typedef struct md5_state_s { - md5_word_t count[2]; /* message length in bits, lsw first */ - md5_word_t abcd[4]; /* digest buffer */ - md5_byte_t buf[64]; /* accumulate block */ -} md5_state_t; - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Initialize the algorithm. */ -static void md5_init(md5_state_t *pms); - -/* Append a string to the message. */ -static void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); - -/* Finish the message and return the digest. */ -void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); -#ifdef __cplusplus -} -#endif - - - -MD5Hash Crypto::md5(const void* data, size_t n) { - md5_state_t state; - md5_init(&state); - md5_append(&state, (const uint8*)data, (int)n); - - MD5Hash h; - md5_finish(&state, &(h[0])); - return h; -} - -/* - Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - L. Peter Deutsch - ghost@aladdin.com - - */ -/* - Independent implementation of MD5 (RFC 1321). - - This code implements the MD5 Algorithm defined in RFC 1321, whose - text is available at - http://www.ietf.org/rfc/rfc1321.txt - The code is derived from the text of the RFC, including the test suite - (section A.5) but excluding the rest of Appendix A. It does not include - any code or documentation that is identified in the RFC as being - copyrighted. - - The original and principal author of md5.c is L. Peter Deutsch - . Other authors are noted in the change history - that follows (in reverse chronological order): - - 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order - either statically or dynamically; added missing #include - in library. - 2002-03-11 lpd Corrected argument list for main(), and added int return - type, in test program and T value program. - 2002-02-21 lpd Added missing #include in test program. - 2000-07-03 lpd Patched to eliminate warnings about "constant is - unsigned in ANSI C, signed in traditional"; made test program - self-checking. - 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. - 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). - 1999-05-03 lpd Original version. - */ - -/* - * This package supports both compile-time and run-time determination of CPU - * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be - * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is - * defined as non-zero, the code will be compiled to run only on big-endian - * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to - * run on either big- or little-endian CPUs, but will run slightly less - * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. - */ - - -#if defined(G3D_LINUX) || defined(G3D_OSX) -# if defined(G3D_OSX_PPC) -# include -# elif defined(G3D_OSX_INTEL) -# include -# elif defined(__linux__) -# include -# elif defined(__FreeBSD__) -# include -# endif -#else -# define BYTE_ORDER 0 -#endif - -#define T_MASK ((md5_word_t)~0) -#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) -#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) -#define T3 0x242070db -#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) -#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) -#define T6 0x4787c62a -#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) -#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) -#define T9 0x698098d8 -#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) -#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) -#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) -#define T13 0x6b901122 -#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) -#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) -#define T16 0x49b40821 -#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) -#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) -#define T19 0x265e5a51 -#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) -#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) -#define T22 0x02441453 -#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) -#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) -#define T25 0x21e1cde6 -#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) -#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) -#define T28 0x455a14ed -#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) -#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) -#define T31 0x676f02d9 -#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) -#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) -#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) -#define T35 0x6d9d6122 -#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) -#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) -#define T38 0x4bdecfa9 -#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) -#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) -#define T41 0x289b7ec6 -#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) -#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) -#define T44 0x04881d05 -#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) -#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) -#define T47 0x1fa27cf8 -#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) -#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) -#define T50 0x432aff97 -#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) -#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) -#define T53 0x655b59c3 -#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) -#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) -#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) -#define T57 0x6fa87e4f -#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) -#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) -#define T60 0x4e0811a1 -#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) -#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) -#define T63 0x2ad7d2bb -#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) - - -static void -md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) -{ - md5_word_t - a = pms->abcd[0], b = pms->abcd[1], - c = pms->abcd[2], d = pms->abcd[3]; - md5_word_t t; -#if BYTE_ORDER > 0 - /* Define storage only for big-endian CPUs. */ - md5_word_t X[16]; -#else - /* Define storage for little-endian or both types of CPUs. */ - md5_word_t xbuf[16]; - const md5_word_t *X; -#endif - - { -#if BYTE_ORDER == 0 - /* - * Determine dynamically whether this is a big-endian or - * little-endian machine, since we can use a more efficient - * algorithm on the latter. - */ - static const int w = 1; - - if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ -#endif -#if BYTE_ORDER <= 0 /* little-endian */ - { - /* - * On little-endian machines, we can process properly aligned - * data without copying it. - */ - if (!((data - (const md5_byte_t *)0) & 3)) { - /* data are properly aligned */ - X = (const md5_word_t *)data; - } else { - /* not aligned */ - memcpy(xbuf, data, 64); - X = xbuf; - } - } -#endif -#if BYTE_ORDER == 0 - else /* dynamic big-endian */ -#endif -#if BYTE_ORDER >= 0 /* big-endian */ - { - /* - * On big-endian machines, we must arrange the bytes in the - * right order. - */ - const md5_byte_t *xp = data; - int i; - -# if BYTE_ORDER == 0 - X = xbuf; /* (dynamic only) */ -# else -# define xbuf X /* (static only) */ -# endif - for (i = 0; i < 16; ++i, xp += 4) - xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); - } -#endif - } - -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) - - /* Round 1. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ -#define F(x, y, z) (((x) & (y)) | (~(x) & (z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + F(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 7, T1); - SET(d, a, b, c, 1, 12, T2); - SET(c, d, a, b, 2, 17, T3); - SET(b, c, d, a, 3, 22, T4); - SET(a, b, c, d, 4, 7, T5); - SET(d, a, b, c, 5, 12, T6); - SET(c, d, a, b, 6, 17, T7); - SET(b, c, d, a, 7, 22, T8); - SET(a, b, c, d, 8, 7, T9); - SET(d, a, b, c, 9, 12, T10); - SET(c, d, a, b, 10, 17, T11); - SET(b, c, d, a, 11, 22, T12); - SET(a, b, c, d, 12, 7, T13); - SET(d, a, b, c, 13, 12, T14); - SET(c, d, a, b, 14, 17, T15); - SET(b, c, d, a, 15, 22, T16); -#undef SET - - /* Round 2. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ -#define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + G(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 1, 5, T17); - SET(d, a, b, c, 6, 9, T18); - SET(c, d, a, b, 11, 14, T19); - SET(b, c, d, a, 0, 20, T20); - SET(a, b, c, d, 5, 5, T21); - SET(d, a, b, c, 10, 9, T22); - SET(c, d, a, b, 15, 14, T23); - SET(b, c, d, a, 4, 20, T24); - SET(a, b, c, d, 9, 5, T25); - SET(d, a, b, c, 14, 9, T26); - SET(c, d, a, b, 3, 14, T27); - SET(b, c, d, a, 8, 20, T28); - SET(a, b, c, d, 13, 5, T29); - SET(d, a, b, c, 2, 9, T30); - SET(c, d, a, b, 7, 14, T31); - SET(b, c, d, a, 12, 20, T32); -#undef SET - - /* Round 3. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + H(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 5, 4, T33); - SET(d, a, b, c, 8, 11, T34); - SET(c, d, a, b, 11, 16, T35); - SET(b, c, d, a, 14, 23, T36); - SET(a, b, c, d, 1, 4, T37); - SET(d, a, b, c, 4, 11, T38); - SET(c, d, a, b, 7, 16, T39); - SET(b, c, d, a, 10, 23, T40); - SET(a, b, c, d, 13, 4, T41); - SET(d, a, b, c, 0, 11, T42); - SET(c, d, a, b, 3, 16, T43); - SET(b, c, d, a, 6, 23, T44); - SET(a, b, c, d, 9, 4, T45); - SET(d, a, b, c, 12, 11, T46); - SET(c, d, a, b, 15, 16, T47); - SET(b, c, d, a, 2, 23, T48); -#undef SET - - /* Round 4. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ -#define I(x, y, z) ((y) ^ ((x) | ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + I(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 6, T49); - SET(d, a, b, c, 7, 10, T50); - SET(c, d, a, b, 14, 15, T51); - SET(b, c, d, a, 5, 21, T52); - SET(a, b, c, d, 12, 6, T53); - SET(d, a, b, c, 3, 10, T54); - SET(c, d, a, b, 10, 15, T55); - SET(b, c, d, a, 1, 21, T56); - SET(a, b, c, d, 8, 6, T57); - SET(d, a, b, c, 15, 10, T58); - SET(c, d, a, b, 6, 15, T59); - SET(b, c, d, a, 13, 21, T60); - SET(a, b, c, d, 4, 6, T61); - SET(d, a, b, c, 11, 10, T62); - SET(c, d, a, b, 2, 15, T63); - SET(b, c, d, a, 9, 21, T64); -#undef SET - - /* Then perform the following additions. (That is increment each - of the four registers by the value it had before this block - was started.) */ - pms->abcd[0] += a; - pms->abcd[1] += b; - pms->abcd[2] += c; - pms->abcd[3] += d; -} - -void -md5_init(md5_state_t *pms) -{ - pms->count[0] = pms->count[1] = 0; - pms->abcd[0] = 0x67452301; - pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; - pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; - pms->abcd[3] = 0x10325476; -} - -void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) -{ - const md5_byte_t *p = data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; - md5_word_t nbits = (md5_word_t)(nbytes << 3); - - if (nbytes <= 0) - return; - - /* Update the message length. */ - pms->count[1] += nbytes >> 29; - pms->count[0] += nbits; - if (pms->count[0] < nbits) - pms->count[1]++; - - /* Process an initial partial block. */ - if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); - - memcpy(pms->buf + offset, p, copy); - if (offset + copy < 64) - return; - p += copy; - left -= copy; - md5_process(pms, pms->buf); - } - - /* Process full blocks. */ - for (; left >= 64; p += 64, left -= 64) - md5_process(pms, p); - - /* Process a final partial block. */ - if (left) - memcpy(pms->buf, p, left); -} - -void -md5_finish(md5_state_t *pms, md5_byte_t digest[16]) -{ - static const md5_byte_t pad[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - md5_byte_t data[8]; - int i; - - /* Save the length before padding. */ - for (i = 0; i < 8; ++i) - data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); - /* Pad to 56 bytes mod 64. */ - md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); - /* Append the length. */ - md5_append(pms, data, 8); - for (i = 0; i < 16; ++i) - digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); -} - -} diff --git a/dep/src/g3dlite/GCamera.cpp b/dep/src/g3dlite/GCamera.cpp deleted file mode 100644 index 64b0c94543e..00000000000 --- a/dep/src/g3dlite/GCamera.cpp +++ /dev/null @@ -1,502 +0,0 @@ -/** - @file GCamera.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - @author Jeff Marsceill, 08jcm@williams.edu - - @created 2005-07-20 - @edited 2009-11-24 -*/ -#include "G3D/GCamera.h" -#include "G3D/platform.h" -#include "G3D/Rect2D.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Ray.h" -#include "G3D/Matrix4.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -GCamera::GCamera(const Any& any) { - any.verifyName("GCamera"); - any.verifyType(Any::TABLE); - *this = GCamera(); - - const Any::AnyTable& table = any.table(); - Any::AnyTable::Iterator it = table.begin(); - while (it.hasMore()) { - const std::string& k = toUpper(it->key); - if (k == "FOVDIRECTION") { - const std::string& v = toUpper(it->value); - if (v == "HORIZONTAL") { - m_direction = HORIZONTAL; - } else if (v == "VERTICAL") { - m_direction = VERTICAL; - } else { - any.verify(false, "fovDirection must be \"HORIZONTAL\" or \"VERTICAL\""); - } - } else if (k == "COORDINATEFRAME") { - m_cframe = it->value; - } else if (k == "FOVDEGREES") { - m_fieldOfView = toRadians(it->value.number()); - } else if (k == "NEARPLANEZ") { - m_nearPlaneZ = it->value; - } else if (k == "FARPLANEZ") { - m_farPlaneZ = it->value; - } else { - any.verify(false, std::string("Illegal key in table: ") + it->key); - } - ++it; - } -} - - -GCamera::operator Any() const { - Any any(Any::TABLE, "GCamera"); - - any.set("fovDirection", std::string((m_direction == HORIZONTAL) ? "HORIZONTAL" : "VERTICAL")); - any.set("fovDegrees", toDegrees(m_fieldOfView)); - any.set("nearPlaneZ", nearPlaneZ()); - any.set("farPlaneZ", farPlaneZ()); - any.set("coordinateFrame", coordinateFrame()); - - return any; -} - - -GCamera::GCamera() { - setNearPlaneZ(-0.2f); - setFarPlaneZ(-100.0f); - setFieldOfView((float)toRadians(90.0f), HORIZONTAL); -} - - -GCamera::GCamera(const Matrix4& proj, const CFrame& frame) { - float left, right, bottom, top, nearval, farval; - proj.getPerspectiveProjectionParameters(left, right, bottom, top, nearval, farval); - setNearPlaneZ(-nearval); - setFarPlaneZ(-farval); - float x = right; - - // Assume horizontal field of view - setFieldOfView(atan2(x, -m_nearPlaneZ) * 2.0f, HORIZONTAL); - setCoordinateFrame(frame); -} - - -GCamera::~GCamera() { -} - - -void GCamera::getCoordinateFrame(CoordinateFrame& c) const { - c = m_cframe; -} - - -void GCamera::setCoordinateFrame(const CoordinateFrame& c) { - m_cframe = c; -} - - -void GCamera::setFieldOfView(float angle, FOVDirection dir) { - debugAssert((angle < pi()) && (angle > 0)); - - m_fieldOfView = angle; - m_direction = dir; -} - - -float GCamera::imagePlaneDepth() const{ - return -m_nearPlaneZ; -} - -float GCamera::viewportWidth(const Rect2D& viewport) const { - // Compute the side of a square at the near plane based on our field of view - float s = 2.0f * -m_nearPlaneZ * tan(m_fieldOfView * 0.5f); - - if (m_direction == VERTICAL) { - s *= viewport.width() / viewport.height(); - } - - return s; -} - - -float GCamera::viewportHeight(const Rect2D& viewport) const { - // Compute the side of a square at the near plane based on our field of view - float s = 2.0f * -m_nearPlaneZ * tan(m_fieldOfView * 0.5f); - - debugAssert(m_fieldOfView < toRadians(180)); - if (m_direction == HORIZONTAL) { - s *= viewport.height() / viewport.width(); - } - - return s; -} - - -Ray GCamera::worldRay(float x, float y, const Rect2D& viewport) const { - - int screenWidth = iFloor(viewport.width()); - int screenHeight = iFloor(viewport.height()); - - Vector3 origin = m_cframe.translation; - - float cx = screenWidth / 2.0f; - float cy = screenHeight / 2.0f; - - float vw = viewportWidth(viewport); - float vh = viewportHeight(viewport); - - Vector3 direction = Vector3( (x - cx) * vw / screenWidth, - -(y - cy) * vh / screenHeight, - m_nearPlaneZ); - - direction = m_cframe.vectorToWorldSpace(direction); - - // Normalize the direction (we didn't do it before) - direction = direction.direction(); - - return Ray::fromOriginAndDirection(origin, direction); -} - - -void GCamera::getProjectPixelMatrix(const Rect2D& viewport, Matrix4& P) const { - getProjectUnitMatrix(viewport, P); - float screenWidth = viewport.width(); - float screenHeight = viewport.height(); - - float sx = screenWidth / 2.0; - float sy = screenHeight / 2.0; - - P = Matrix4(sx, 0, 0, sx + viewport.x0(), - 0, -sy, 0, sy + viewport.y0(), - 0, 0, 1, 0, - 0, 0, 0, 1) * P; -} - - -void GCamera::getProjectUnitMatrix(const Rect2D& viewport, Matrix4& P) const { - - float screenWidth = viewport.width(); - float screenHeight = viewport.height(); - - float r, l, t, b, n, f, x, y; - - if (m_direction == VERTICAL) { - y = -m_nearPlaneZ * tan(m_fieldOfView / 2); - x = y * (screenWidth / screenHeight); - } else { //m_direction == HORIZONTAL - x = -m_nearPlaneZ * tan(m_fieldOfView / 2); - y = x * (screenHeight / screenWidth); - } - - n = -m_nearPlaneZ; - f = -m_farPlaneZ; - r = x; - l = -x; - t = y; - b = -y; - - P = Matrix4::perspectiveProjection(l, r, b, t, n, f); -} - -Vector3 GCamera::projectUnit(const Vector3& point, const Rect2D& viewport) const { - Matrix4 M; - getProjectUnitMatrix(viewport, M); - - Vector4 cameraSpacePoint(coordinateFrame().pointToObjectSpace(point), 1.0f); - const Vector4& screenSpacePoint = M * cameraSpacePoint; - - return Vector3(screenSpacePoint.xyz() / screenSpacePoint.w); -} - -Vector3 GCamera::project(const Vector3& point, - const Rect2D& viewport) const { - - // Find the point in the homogeneous cube - const Vector3& cube = projectUnit(point, viewport); - - return convertFromUnitToNormal(cube, viewport); -} - -Vector3 GCamera::unprojectUnit(const Vector3& v, const Rect2D& viewport) const { - - const Vector3& projectedPoint = convertFromUnitToNormal(v, viewport); - - return unproject(projectedPoint, viewport); -} - - -Vector3 GCamera::unproject(const Vector3& v, const Rect2D& viewport) const { - - const float n = m_nearPlaneZ; - const float f = m_farPlaneZ; - - float z; - - if (-f >= finf()) { - // Infinite far plane - z = 1.0f / (((-1.0f / n) * v.z) + 1.0f / n); - } else { - z = 1.0f / ((((1.0f / f) - (1.0f / n)) * v.z) + 1.0f / n); - } - - const Ray& ray = worldRay(v.x, v.y, viewport); - - // Find out where the ray reaches the specified depth. - const Vector3& out = ray.origin() + ray.direction() * -z / (ray.direction().dot(m_cframe.lookVector())); - - return out; -} - - -float GCamera::worldToScreenSpaceArea(float area, float z, const Rect2D& viewport) const { - (void)viewport; - if (z >= 0) { - return finf(); - } - return area * (float)square(imagePlaneDepth() / z); -} - - -void GCamera::getClipPlanes( - const Rect2D& viewport, - Array& clip) const { - - Frustum fr; - frustum(viewport, fr); - clip.resize(fr.faceArray.size(), DONT_SHRINK_UNDERLYING_ARRAY); - for (int f = 0; f < clip.size(); ++f) { - clip[f] = fr.faceArray[f].plane; - } -} - - -GCamera::Frustum GCamera::frustum(const Rect2D& viewport) const { - Frustum f; - frustum(viewport, f); - return f; -} - - -void GCamera::frustum(const Rect2D& viewport, Frustum& fr) const { - - // The volume is the convex hull of the vertices definining the view - // frustum and the light source point at infinity. - - const float x = viewportWidth(viewport) / 2; - const float y = viewportHeight(viewport) / 2; - const float zn = m_nearPlaneZ; - const float zf = m_farPlaneZ; - float xx, zz, yy; - - float halfFOV = m_fieldOfView * 0.5f; - - // This computes the normal, which is based on the complement of the - // halfFOV angle, so the equations are "backwards" - if (m_direction == VERTICAL) { - yy = -cosf(halfFOV); - xx = yy * viewport.height() / viewport.width(); - zz = -sinf(halfFOV); - } else { - xx = -cosf(halfFOV); - yy = xx * viewport.width() / viewport.height(); - zz = -sinf(halfFOV); - } - - // Near face (ccw from UR) - fr.vertexPos.append( - Vector4( x, y, zn, 1), - Vector4(-x, y, zn, 1), - Vector4(-x, -y, zn, 1), - Vector4( x, -y, zn, 1)); - - // Far face (ccw from UR, from origin) - if (m_farPlaneZ == -finf()) { - fr.vertexPos.append(Vector4( x, y, zn, 0), - Vector4(-x, y, zn, 0), - Vector4(-x, -y, zn, 0), - Vector4( x, -y, zn, 0)); - } else { - // Finite - const float s = zf / zn; - fr.vertexPos.append(Vector4( x * s, y * s, zf, 1), - Vector4(-x * s, y * s, zf, 1), - Vector4(-x * s, -y * s, zf, 1), - Vector4( x * s, -y * s, zf, 1)); - } - - Frustum::Face face; - - // Near plane (wind backwards so normal faces into frustum) - // Recall that nearPlane, farPlane are positive numbers, so - // we need to negate them to produce actual z values. - face.plane = Plane(Vector3(0,0,-1), Vector3(0,0,m_nearPlaneZ)); - face.vertexIndex[0] = 3; - face.vertexIndex[1] = 2; - face.vertexIndex[2] = 1; - face.vertexIndex[3] = 0; - fr.faceArray.append(face); - - // Right plane - face.plane = Plane(Vector3(xx, 0, zz), Vector3::zero()); - face.vertexIndex[0] = 0; - face.vertexIndex[1] = 4; - face.vertexIndex[2] = 7; - face.vertexIndex[3] = 3; - fr.faceArray.append(face); - - // Left plane - face.plane = Plane(Vector3(-fr.faceArray.last().plane.normal().x, 0, fr.faceArray.last().plane.normal().z), Vector3::zero()); - face.vertexIndex[0] = 5; - face.vertexIndex[1] = 1; - face.vertexIndex[2] = 2; - face.vertexIndex[3] = 6; - fr.faceArray.append(face); - - // Top plane - face.plane = Plane(Vector3(0, yy, zz), Vector3::zero()); - face.vertexIndex[0] = 1; - face.vertexIndex[1] = 5; - face.vertexIndex[2] = 4; - face.vertexIndex[3] = 0; - fr.faceArray.append(face); - - // Bottom plane - face.plane = Plane(Vector3(0, -fr.faceArray.last().plane.normal().y, fr.faceArray.last().plane.normal().z), Vector3::zero()); - face.vertexIndex[0] = 2; - face.vertexIndex[1] = 3; - face.vertexIndex[2] = 7; - face.vertexIndex[3] = 6; - fr.faceArray.append(face); - - // Far plane - if (-m_farPlaneZ < finf()) { - face.plane = Plane(Vector3(0, 0, 1), Vector3(0, 0, m_farPlaneZ)); - face.vertexIndex[0] = 4; - face.vertexIndex[1] = 5; - face.vertexIndex[2] = 6; - face.vertexIndex[3] = 7; - fr.faceArray.append(face); - } - - // Transform vertices to world space - for (int v = 0; v < fr.vertexPos.size(); ++v) { - fr.vertexPos[v] = m_cframe.toWorldSpace(fr.vertexPos[v]); - } - - // Transform planes to world space - for (int p = 0; p < fr.faceArray.size(); ++p) { - // Since there is no scale factor, we don't have to - // worry about the inverse transpose of the normal. - Vector3 normal; - float d; - - fr.faceArray[p].plane.getEquation(normal, d); - - Vector3 newNormal = m_cframe.rotation * normal; - - if (isFinite(d)) { - d = (newNormal * -d + m_cframe.translation).dot(newNormal); - fr.faceArray[p].plane = Plane(newNormal, newNormal * d); - } else { - // When d is infinite, we can't multiply 0's by it without - // generating NaNs. - fr.faceArray[p].plane = Plane::fromEquation(newNormal.x, newNormal.y, newNormal.z, d); - } - } -} - -void GCamera::getNearViewportCorners -(const Rect2D& viewport, - Vector3& outUR, - Vector3& outUL, - Vector3& outLL, - Vector3& outLR) const { - - // Must be kept in sync with getFrustum() - const float w = viewportWidth(viewport) / 2.0f; - const float h = viewportHeight(viewport) / 2.0f; - const float z = nearPlaneZ(); - - // Compute the points - outUR = Vector3( w, h, z); - outUL = Vector3(-w, h, z); - outLL = Vector3(-w, -h, z); - outLR = Vector3( w, -h, z); - - // Take to world space - outUR = m_cframe.pointToWorldSpace(outUR); - outUL = m_cframe.pointToWorldSpace(outUL); - outLR = m_cframe.pointToWorldSpace(outLR); - outLL = m_cframe.pointToWorldSpace(outLL); -} - -void GCamera::getFarViewportCorners( - const Rect2D& viewport, - Vector3& outUR, - Vector3& outUL, - Vector3& outLL, - Vector3& outLR) const { - - // Must be kept in sync with getFrustum() - const float w = viewportWidth(viewport) * m_farPlaneZ / m_nearPlaneZ; - const float h = viewportHeight(viewport) * m_farPlaneZ / m_nearPlaneZ; - const float z = m_farPlaneZ; - - // Compute the points - outUR = Vector3( w/2, h/2, z); - outUL = Vector3(-w/2, h/2, z); - outLL = Vector3(-w/2, -h/2, z); - outLR = Vector3( w/2, -h/2, z); - - // Take to world space - outUR = m_cframe.pointToWorldSpace(outUR); - outUL = m_cframe.pointToWorldSpace(outUL); - outLR = m_cframe.pointToWorldSpace(outLR); - outLL = m_cframe.pointToWorldSpace(outLL); -} - - - -void GCamera::setPosition(const Vector3& t) { - m_cframe.translation = t; -} - - -void GCamera::lookAt(const Vector3& position, const Vector3& up) { - m_cframe.lookAt(position, up); -} - - -void GCamera::serialize(BinaryOutput& bo) const { - bo.writeFloat32(m_fieldOfView); - bo.writeFloat32(imagePlaneDepth()); - debugAssert(nearPlaneZ() < 0.0f); - bo.writeFloat32(nearPlaneZ()); - debugAssert(farPlaneZ() < 0.0f); - bo.writeFloat32(farPlaneZ()); - m_cframe.serialize(bo); - bo.writeInt8(m_direction); -} - - -void GCamera::deserialize(BinaryInput& bi) { - m_fieldOfView = bi.readFloat32(); - m_nearPlaneZ = bi.readFloat32(); - debugAssert(m_nearPlaneZ < 0.0f); - m_farPlaneZ = bi.readFloat32(); - debugAssert(m_farPlaneZ < 0.0f); - m_cframe.deserialize(bi); - m_direction = (FOVDirection)bi.readInt8(); -} - - -Vector3 GCamera::convertFromUnitToNormal(const Vector3& in, const Rect2D& viewport) const{ - return (in + Vector3(1,1,1)) * 0.5 * Vector3(viewport.width(), -viewport.height(), 1) + - Vector3(viewport.x0(), viewport.y1(), 0); -} -} // namespace diff --git a/dep/src/g3dlite/GImage.cpp b/dep/src/g3dlite/GImage.cpp deleted file mode 100644 index 9527e96cf67..00000000000 --- a/dep/src/g3dlite/GImage.cpp +++ /dev/null @@ -1,1166 +0,0 @@ -/** - \file GImage.cpp - \author Morgan McGuire, http://graphics.cs.williams.edu - Copyright 2002-2010, Morgan McGuire - - \created 2002-05-27 - \edited 2010-01-04 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/debug.h" -#include "G3D/stringutils.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" -#include "G3D/fileutils.h" - -#ifdef G3D_LINUX -# include -#else -# include "png.h" -#endif - -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////////////////////// - -namespace G3D { - -void GImage::LtoRGBA( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int v = in[i]; - int i4 = i * 4; - - out[i4 + 0] = v; - out[i4 + 1] = v; - out[i4 + 2] = v; - out[i4 + 3] = 255; - } -} - - -void GImage::LtoRGB( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int v = in[i]; - int i3 = i * 3; - - out[i3 + 0] = v; - out[i3 + 1] = v; - out[i3 + 2] = v; - } -} - - -void GImage::RGBtoRGBA( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 0] = in[i3 + 0]; - out[i4 + 1] = in[i3 + 1]; - out[i4 + 2] = in[i3 + 2]; - out[i4 + 3] = 255; - } -} - - -void GImage::RGBAtoRGB( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i3 + 0] = in[i4 + 0]; - out[i3 + 1] = in[i4 + 1]; - out[i3 + 2] = in[i4 + 2]; - } -} - - -void GImage::RGBtoBGRA( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 2] = in[i3 + 0]; - out[i4 + 1] = in[i3 + 1]; - out[i4 + 0] = in[i3 + 2]; - out[i4 + 3] = 255; - } -} - - - -void GImage::RGBtoBGR( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - - int r = in[i3 + 0]; - int g = in[i3 + 1]; - int b = in[i3 + 2]; - - out[i3 + 2] = r; - out[i3 + 1] = g; - out[i3 + 0] = b; - } -} - - -void GImage::RGBxRGBtoRGBA( - const uint8* colorRGB, - const uint8* alphaRGB, - uint8* out, - int numPixels) { - - for (int i = numPixels - 1; i >= 0; --i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 0] = colorRGB[i3 + 0]; - out[i4 + 1] = colorRGB[i3 + 1]; - out[i4 + 2] = colorRGB[i3 + 2]; - out[i4 + 3] = alphaRGB[i3 + 0]; - } -} - - -void GImage::RGBtoARGB( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 0] = 255; - out[i4 + 1] = in[i3 + 0]; - out[i4 + 2] = in[i3 + 1]; - out[i4 + 3] = in[i3 + 2]; - } -} - - -void GImage::flipRGBVertical( - const uint8* in, - uint8* out, - int width, - int height) { - - - // Allocate a temp row so the operation - // is still safe if in == out - uint8* temp = (uint8*)System::malloc(width * 3); - alwaysAssertM(temp != NULL, "Out of memory"); - - int oneRow = width * 3; - int N = height / 2; - - // if height is an odd value, don't swap odd middle row - for (int i = 0; i < N; ++i) { - int topOff = i * oneRow; - int botOff = (height - i - 1) * oneRow; - System::memcpy(temp, in + topOff, oneRow); - System::memcpy(out + topOff, in + botOff, oneRow); - System::memcpy(out + botOff, temp, oneRow); - } - - System::free(temp); -} - - -void GImage::flipRGBAVertical( - const uint8* in, - uint8* out, - int width, - int height) { - - - // Allocate a temp row so the operation - // is still safe if in == out - uint8* temp = (uint8*)System::malloc(width * 4); - alwaysAssertM(temp != NULL, "Out of memory"); - - int oneRow = width * 4; - - // if height is an odd value, don't swap odd middle row - for (int i = 0; i < height / 2; ++i) { - int topOff = i * oneRow; - int botOff = (height - i - 1) * oneRow; - System::memcpy(temp, in + topOff, oneRow); - System::memcpy(out + topOff, in + botOff, oneRow); - System::memcpy(out + botOff, temp, oneRow); - } - - System::free(temp); -} - -//////////////////////////////////////////////////////////////////////////////////////// - -void GImage::decode( - BinaryInput& input, - Format format) { - - switch (format) { - case PPM_ASCII: - decodePPMASCII(input); - break; - - case PPM_BINARY: - decodePPM(input); - break; - - case PNG: - decodePNG(input); - break; - - case JPEG: - decodeJPEG(input); - break; - - case TGA: - decodeTGA(input); - break; - - case BMP: - decodeBMP(input); - break; - - case ICO: - decodeICO(input); - break; - - case PCX: - decodePCX(input); - break; - - default: - debugAssert(false); - } - - debugAssert(m_width >= 0); - debugAssert(m_height >= 0); - debugAssert(m_channels == 1 || m_channels == 3 || m_channels == 4); - debugAssert(m_byte != NULL); -} - - -void GImage::decodePCX( - BinaryInput& input) { - - uint8 manufacturer = input.readUInt8(); - uint8 version = input.readUInt8(); - uint8 encoding = input.readUInt8(); - uint8 bitsPerPixel = input.readUInt8(); - - uint16 xmin = input.readUInt16(); - uint16 ymin = input.readUInt16(); - uint16 xmax = input.readUInt16(); - uint16 ymax = input.readUInt16(); - - uint16 horizDPI = input.readUInt16(); - uint16 vertDPI = input.readUInt16(); - - Color3uint8 colorMap[16]; - input.readBytes(colorMap, 48); - - input.skip(1); - - uint8 planes = input.readUInt8(); - uint16 bytesPerLine = input.readUInt16(); - uint16 paletteType = input.readUInt16(); - input.skip(4 + 54); - - (void)bytesPerLine; - - m_width = xmax - xmin + 1; - m_height = ymax - ymin + 1; - m_channels = 3; - - if ((manufacturer != 0x0A) || (encoding != 0x01)) { - throw GImage::Error("PCX file is corrupted", input.getFilename()); - } - - (void)version; - (void)vertDPI; - (void)horizDPI; - - if ((bitsPerPixel != 8) || ((planes != 1) && (planes != 3))) { - throw GImage::Error("Only 8-bit paletted and 24-bit PCX files supported.", input.getFilename()); - } - - // Prepare the pointer object for the pixel data - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * 3); - - if ((paletteType == 1) && (planes == 3)) { - - Color3uint8* pixel = pixel3(); - - // Iterate over each scan line - for (int row = 0; row < m_height; ++row) { - // Read each scan line once per plane - for (int plane = 0; plane < planes; ++plane) { - int p = row * m_width; - int p1 = p + m_width; - while (p < p1) { - uint8 value = input.readUInt8(); - int length = 1; - - if (value >= 192) { - // This is the length, not the value. Mask off - // the two high bits and read the true index. - length = value & 0x3F; - value = input.readUInt8(); - } - - // Set the whole run - for (int i = length - 1; i >= 0; --i, ++p) { - debugAssert(p < m_width * m_height); - pixel[p][plane] = value; - } - } - } - } - - } else if (planes == 1) { - - Color3uint8 palette[256]; - - int imageBeginning = input.getPosition(); - int paletteBeginning = input.getLength() - 769; - - input.setPosition(paletteBeginning); - - uint8 dummy = input.readUInt8(); - - if (dummy != 12) { - Log::common()->println("\n*********************"); - Log::common()->printf("Warning: Corrupted PCX file (palette marker byte was missing) \"%s\"\nLoading anyway\n\n", input.getFilename().c_str()); - } - - input.readBytes(palette, sizeof(palette)); - input.setPosition(imageBeginning); - - Color3uint8* pixel = pixel3(); - - // The palette indices are run length encoded. - int p = 0; - while (p < m_width * m_height) { - uint8 index = input.readUInt8(); - uint8 length = 1; - - if (index >= 192) { - // This is the length, not the index. Mask off - // the two high bits and read the true index. - length = index & 0x3F; - index = input.readUInt8(); - } - - Color3uint8 color = palette[index]; - - // Set the whole run - for (int i = length - 1; i >= 0; --i, ++p) { - if (p > m_width * m_height) { - break; - } - pixel[p] = color; - } - - } - - } else { - throw GImage::Error("Unsupported PCX file type.", input.getFilename()); - } -} - - -GImage::Format GImage::resolveFormat(const std::string& filename) { - BinaryInput b(filename, G3D_LITTLE_ENDIAN); - if (b.size() <= 0) { - throw Error("File not found.", filename); - } - - return resolveFormat(filename, b.getCArray(), b.size(), AUTODETECT); -} - - -GImage::Format GImage::resolveFormat( - const std::string& filename, - const uint8* data, - int dataLen, - Format maybeFormat) { - - // Return the provided format if it is specified. - if (maybeFormat != AUTODETECT) { - return maybeFormat; - } - - std::string extension = toUpper(filenameExt(filename)); - - if ((extension == "PPM") || (extension == "PGM") || (extension == "PBM")) { - // There are two PPM formats (binary and ASCII); we handle them differently - if (dataLen > 3) { - if (!memcmp(data, "P6", 2) || !memcmp(data, "P5", 2)) { - return PPM_BINARY; - } else { - return PPM_ASCII; - } - } - } - - Format tmp = stringToFormat(extension); - if ((tmp != AUTODETECT) && (tmp != UNKNOWN)) { - return tmp; - } - - // Try and autodetect from the file itself by looking at the first - // character. - - // We can't look at the character if it is null. - debugAssert(data != NULL); - - if ((dataLen > 3) && (! memcmp(data, "P3", 2) || (! memcmp(data, "P2", 2)) || (! memcmp(data, "P1", 2)))) { - return PPM_ASCII; - } - - if ((dataLen > 3) && (!memcmp(data, "P6", 2) ||!memcmp(data, "P5", 2))) { - return PPM_BINARY; - } - - if (dataLen > 8) { - if (!png_sig_cmp((png_bytep)data, 0, 8)) { - return PNG; - } - } - - if ((dataLen > 0) && (data[0] == 'B')) { - return BMP; - } - - if (dataLen > 10) { - if ((dataLen > 11) && (data[0] == 0xFF) && - (memcmp(&data[6], "JFIF", 4) == 0)) { - return JPEG; - } - } - - if (dataLen > 40) { - if (memcmp(&data[dataLen - 18], "TRUEVISION-XFILE", 16) == 0) { - return TGA; - } - } - - if ((dataLen > 4) && (data[0] == 0) && (data[1] == 0) && (data[2] == 0) && (data[3] == 1)) { - return ICO; - } - - if ((dataLen > 0) && (data[0] == 10)) { - return PCX; - } - - return UNKNOWN; -} - - -GImage::GImage( - const std::string& filename, - Format format, - const MemoryManager::Ref& m) : - m_memMan(m), - m_byte(NULL), - m_channels(0), - m_width(0), - m_height(0) { - - load(filename, format); -} - - -void GImage::load( - const std::string& filename, - Format format) { - - clear(); - - try { - BinaryInput b(filename, G3D_LITTLE_ENDIAN); - if (b.size() <= 0) { - throw Error("File not found.", filename); - } - - alwaysAssertM(this != NULL, "Corrupt GImage"); - decode(b, resolveFormat(filename, b.getCArray(), b.size(), format)); - } catch (const std::string& error) { - throw Error(error, filename); - } -} - - -GImage::GImage( - const uint8* data, - int length, - Format format, - const MemoryManager::Ref& m) : - m_memMan(m), - m_byte(NULL), - m_channels(0), - m_width(0), - m_height(0) { - - BinaryInput b(data, length, G3D_LITTLE_ENDIAN); - // It is safe to cast away the const because we - // know we don't corrupt the data. - - decode(b, resolveFormat("", data, length, format)); -} - - -GImage::GImage( - int width, - int height, - int channels, - const MemoryManager::Ref& mem) : - m_memMan(mem), - m_byte(0), - m_channels(0), - m_width(0), - m_height(0) { - - resize(width, height, channels); -} - - -void GImage::resize( - int width, - int height, - int channels, - bool zero) { - - debugAssert(width >= 0); - debugAssert(height >= 0); - debugAssert(channels >= 1); - - clear(); - - m_width = width; - m_height = height; - m_channels = channels; - size_t sz = width * height * channels; - - if (sz > 0) { - m_byte = (uint8*)m_memMan->alloc(sz); - if (zero) { - System::memset(m_byte, 0, sz); - } - debugAssert(isValidHeapPointer(m_byte)); - } -} - - -void GImage::_copy( - const GImage& other) { - - clear(); - - m_width = other.m_width; - m_height = other.m_height; - m_channels = other.m_channels; - int s = m_width * m_height * m_channels * sizeof(uint8); - m_byte = (uint8*)m_memMan->alloc(s); - debugAssert(isValidHeapPointer(m_byte)); - memcpy(m_byte, other.m_byte, s); -} - - -void GImage::flipHorizontal() { - uint8 temp[4]; - int rowBytes = m_width * m_channels; - for (int y = 0; y < m_height; ++y) { - uint8* row = m_byte + y * rowBytes; - for (int x = 0; x < m_width / 2; ++x) { - System::memcpy(temp, row + x * m_channels, m_channels); - System::memcpy(row + x * m_channels, row + (m_width - x - 1) * m_channels, m_channels); - System::memcpy(row + (m_width - x - 1) * m_channels, temp, m_channels); - } - } -} - - -void GImage::flipVertical() { - uint8* old = m_byte; - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * m_channels); - - // We could do this with only a single-row temp buffer, but then - // we'd have to copy twice as much data. - int rowBytes = m_width * m_channels; - for (int y = 0; y < m_height; ++y) { - System::memcpy(m_byte + y * rowBytes, old + (m_height - y - 1) * rowBytes, rowBytes); - } - - m_memMan->free(old); -} - - -void GImage::rotate90CW(int numTimes) { - - uint8* old = NULL; - numTimes = iWrap(numTimes, 4); - if (numTimes > 0) { - (uint8*)m_memMan->alloc(m_width * m_height * m_channels); - } - for (int j = 0; j < numTimes; ++j) { - { - uint8* temp = old; - uint8* old = m_byte; - m_byte = temp; - } - - { - int temp = m_width; - m_width = m_height; - m_height = temp; - } - - int rowBytes = m_width * m_channels; - for (int y = 0; y < m_height; ++y) { - for (int x = 0; x < m_width; ++x) { - uint8* dst = m_byte + x + y * rowBytes; - uint8* src = old + y + (m_height - x - 1) * rowBytes; - System::memcpy(dst, src, m_channels); - } - } - } - m_memMan->free(old); -} - - - -GImage::GImage( - const GImage& other, - const MemoryManager::Ref& m) : m_memMan(m), m_byte(NULL) { - - _copy(other); -} - - -GImage::~GImage() { - clear(); -} - - -void GImage::clear() { - m_width = 0; - m_height = 0; - m_memMan->free(m_byte); - m_byte = NULL; -} - - -GImage& GImage::operator=(const GImage& other) { - _copy(other); - return *this; -} - - -bool GImage::copySubImage( - GImage & dest, const GImage & src, - int srcX, int srcY, int srcWidth, int srcHeight) { - if ((src.m_width < srcX + srcWidth) || - (src.m_height < srcY + srcHeight) || - (srcY < 0) || - (srcX < 0)) { - - return false; - } - - dest.resize(srcWidth, srcHeight, src.m_channels); - - bool ret; - ret = pasteSubImage(dest, src, 0, 0, srcX, srcY, srcWidth, srcHeight); - debugAssert(ret); - - return true; -} - - -bool GImage::pasteSubImage( - GImage & dest, const GImage & src, - int destX, int destY, - int srcX, int srcY, int srcWidth, int srcHeight) { - - if ((src.m_width < srcX + srcWidth) || - (src.m_height < srcY + srcHeight) || - (dest.m_width < destX + srcWidth) || - (dest.m_height < destY + srcHeight) || - (srcY < 0) || - (srcX < 0) || - (destY < 0) || - (destX < 0) || - (src.channels() != dest.channels())) { - - return false; - } - - for (int i = 0; i < srcHeight; i++) { - const uint8* srcRow = src.byte() + - ((i + srcY) * src.m_width + srcX) * src.channels(); - uint8* destRow = dest.byte() + - ((i + destY) * dest.width() + destX) * dest.channels(); - memcpy(destRow, srcRow, srcWidth * src.m_channels); - } - - return true; -} - - -bool GImage::supportedFormat( - const std::string& format) { - - return (stringToFormat(format) != UNKNOWN); -} - - -GImage::Format GImage::stringToFormat( - const std::string& format) { - - std::string extension = toUpper(format); - - if ((extension == "JPG") || (extension == "JPEG")) { - return JPEG; - } else if (extension == "TGA") { - return TGA; - } else if (extension == "BMP") { - return BMP; - } else if (extension == "PCX") { - return PCX; - } else if (extension == "ICO") { - return ICO; - } else if (extension == "PNG") { - return PNG; - } else { - return UNKNOWN; - } - // Don't put PPM here, since it has two versions -} - - -void GImage::save( - const std::string& filename, - Format format) const { - - BinaryOutput b(filename, G3D_LITTLE_ENDIAN); - encode(resolveFormat(filename, NULL, 0, format), b); - b.commit(false); -} - - -void GImage::encode( - Format format, - uint8*& outData, - int& outLength) const { - - BinaryOutput out; - - encode(format, out); - - outData = (uint8*)System::malloc(out.size()); - debugAssert(outData); - outLength = out.size(); - - out.commit(outData); -} - - -void GImage::encode( - Format format, - BinaryOutput& out) const { - - switch (format) { - case PPM_ASCII: - encodePPMASCII(out); - break; - - case PPM_BINARY: - encodePPM(out); - break; - - case PNG: - encodePNG(out); - break; - - case JPEG: - encodeJPEG(out); - break; - - case BMP: - encodeBMP(out); - break; - - case TGA: - encodeTGA(out); - break; - - default: - debugAssert(false); - } -} - - -void GImage::insertRedAsAlpha(const GImage& alpha, GImage& output) const { - debugAssert(alpha.width() == width()); - debugAssert(alpha.height() == height()); - - // make sure output GImage is valid - if (output.width() != width() || output.height() != height() || output.channels() != 4) { - output.resize(width(), height(), 4); - } - - int N = m_width * m_height; - for (int i = 0; i < N; ++i) { - output.byte()[i * 4 + 0] = byte()[i * m_channels + 0]; - output.byte()[i * 4 + 1] = byte()[i * m_channels + 1]; - output.byte()[i * 4 + 2] = byte()[i * m_channels + 2]; - output.byte()[i * 4 + 3] = alpha.byte()[i * alpha.m_channels]; - } -} - - -void GImage::stripAlpha(GImage& output) const { - - if (output.m_width != m_width || output.m_height != m_height || output.m_channels != 3) { - output.resize(m_width, m_height, 3); - } - - int N = m_width * m_height; - for (int i = 0; i < N; ++i) { - output.byte()[i * 3 + 0] = byte()[i * m_channels + 0]; - output.byte()[i * 3 + 1] = byte()[i * m_channels + 1]; - output.byte()[i * 3 + 2] = byte()[i * m_channels + 2]; - } -} - - -int GImage::sizeInMemory() const { - return sizeof(GImage) + m_width * m_height * m_channels; -} - - -void GImage::computeNormalMap( - const GImage& bump, - GImage& normal, - const BumpMapPreprocess& preprocess) { - computeNormalMap(bump.m_width, bump.m_height, bump.m_channels, - bump.byte(), normal, preprocess); -} - -void GImage::computeNormalMap( - int width, - int height, - int channels, - const uint8* src, - GImage& normal, - const BumpMapPreprocess& preprocess) { - - float whiteHeightInPixels = preprocess.zExtentPixels; - bool lowPassBump = preprocess.lowPassFilter; - bool scaleHeightByNz = preprocess.scaleZByNz; - - if (whiteHeightInPixels < 0.0f) { - // Default setting scales so that a gradient ramp - // over the whole image becomes a 45-degree angle - - // Account for potentially non-square aspect ratios - whiteHeightInPixels = max(width, height) * -whiteHeightInPixels; - } - - debugAssert(whiteHeightInPixels >= 0); - - const int w = width; - const int h = height; - const int stride = channels; - - normal.resize(w, h, 4); - - const uint8* const B = src; - Color4uint8* const N = normal.pixel4(); - - // 1/s for the scale factor that each ELEVATION should be multiplied by. - // We avoid actually multiplying by this and instead just divide it out of z. - float elevationInvScale = 255.0f / whiteHeightInPixels; - - for (int y = 0; y < h; ++y) { - for (int x = 0; x < w; ++x) { - // Index into normal map pixel - int i = x + y * w; - - // Index into bump map *byte* - int j = stride * i; - - Vector3 delta; - - // Get a value from B (with wrapping lookup) relative to (x, y) - // and divide by 255 - #define ELEVATION(DX, DY) ((int)B[(((DX + x + w) % w) + \ - ((DY + y + h) % h) * w) * stride]) - - - // Sobel filter to compute the normal. - // - // Y Filter (X filter is the transpose) - // [ -1 -2 -1 ] - // [ 0 0 0 ] - // [ 1 2 1 ] - - // Write the Y value directly into the x-component so we don't have - // to explicitly compute a cross product at the end. Does not - // go out of bounds because the above is computed mod (width, height) - delta.y = -( ELEVATION(-1, -1) * 1 + ELEVATION( 0, -1) * 2 + ELEVATION( 1, -1) * 1 + - -ELEVATION(-1, 1) * 1 + -ELEVATION( 0, 1) * 2 + -ELEVATION( 1, 1) * 1); - - delta.x = -(-ELEVATION(-1, -1) * 1 + ELEVATION( 1, -1) * 1 + - -ELEVATION(-1, 0) * 2 + ELEVATION( 1, 0) * 2 + - -ELEVATION(-1, 1) * 1 + ELEVATION( 1, 1) * 1); - - // The scale of each filter row is 4, the filter width is two pixels, - // and the "normal" range is 0-255. - delta.z = 4 * 2 * elevationInvScale; - - // Delta is now scaled in pixels; normalize - delta = delta.direction(); - - // Copy over the bump value into the alpha channel. - float H = B[j] / 255.0f; - - if (lowPassBump) { - H = (ELEVATION(-1, -1) + ELEVATION( 0, -1) + ELEVATION(1, -1) + - ELEVATION(-1, 0) + ELEVATION( 0, 0) + ELEVATION(1, 0) + - ELEVATION(-1, 1) + ELEVATION( 0, 1) + ELEVATION(1, 1)) / (255.0f * 9.0f); - } -# undef ELEVATION - - if (scaleHeightByNz) { - // delta.z can't possibly be negative, so we avoid actually - // computing the absolute value. - H *= delta.z; - } - - N[i].a = iRound(H * 255.0f); - - // Pack into byte range - delta = delta * 127.5f + Vector3(127.5f, 127.5f, 127.5f); - N[i].r = iClamp(iRound(delta.x), 0, 255); - N[i].g = iClamp(iRound(delta.y), 0, 255); - N[i].b = iClamp(iRound(delta.z), 0, 255); - } - } -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void GImage::convertToL8() { - switch (m_channels) { - case 1: - return; - - case 3: - { - // Average - Color3uint8* src = (Color3uint8*)m_byte; - m_byte = NULL; - resize(m_width, m_height, 1); - for (int i = m_width * m_height - 1; i >= 0; --i) { - const Color3uint8 s = src[i]; - uint8& d = m_byte[i]; - d = ((int)s.r + (int)s.g + (int)s.b) / 3; - } - m_memMan->free(src); - } - break; - - case 4: - { - // Average - Color4uint8* src = (Color4uint8*)m_byte; - m_byte = NULL; - resize(m_width, m_height, 1); - for (int i = m_width * m_height - 1; i >= 0; --i) { - const Color4uint8 s = src[i]; - uint8& d = m_byte[i]; - d = ((int)s.r + (int)s.g + (int)s.b) / 3; - } - m_memMan->free(src); - } - return; - - default: - alwaysAssertM(false, "Bad number of channels in input image"); - } -} - - -void GImage::convertToRGBA() { - switch (m_channels) { - case 1: - { - // Spread - uint8* old = m_byte; - m_byte = NULL; - resize(m_width, m_height, 4); - for (int i = m_width * m_height - 1; i >= 0; --i) { - const uint8 s = old[i]; - Color4uint8& d = ((Color4uint8*)m_byte)[i]; - d.r = d.g = d.b = s; - d.a = 255; - } - m_memMan->free(m_byte); - } - break; - - case 3: - { - // Add alpha - Color3uint8* old = (Color3uint8*)m_byte; - m_byte = NULL; - resize(m_width, m_height, 4); - for (int i = m_width * m_height - 1; i >= 0; --i) { - const Color3uint8 s = old[i]; - Color4uint8& d = ((Color4uint8*)m_byte)[i]; - d.r = s.r; - d.g = s.g; - d.b = s.b; - d.a = 255; - } - m_memMan->free(old); - } - break; - - case 4: - // Already RGBA - return; - - default: - alwaysAssertM(false, "Bad number of channels in input image"); - } -} - - -void GImage::convertToRGB() { - switch (m_channels) { - case 1: - { - // Spread - uint8* old = m_byte; - m_byte = NULL; - resize(m_width, m_height, 3); - for (int i = m_width * m_height - 1; i >= 0; --i) { - const uint8 s = old[i]; - Color3uint8& d = ((Color3uint8*)m_byte)[i]; - d.r = d.g = d.b = s; - } - m_memMan->free(old); - } - break; - - case 3: - return; - - case 4: - // Strip alpha - { - Color4uint8* old = (Color4uint8*)m_byte; - m_byte = NULL; - resize(m_width, m_height, 3); - for (int i = m_width * m_height - 1; i >= 0; --i) { - const Color4uint8 s = old[i]; - Color3uint8& d = ((Color3uint8*)m_byte)[i]; - d.r = s.r; - d.g = s.g; - d.b = s.b; - } - m_memMan->free(old); - } - break; - - default: - alwaysAssertM(false, "Bad number of channels in input image"); - } -} - - -void GImage::R8G8B8_to_Y8U8V8(int width, int height, const uint8* _in, uint8* _out) { - const Color3uint8* in = reinterpret_cast(_in); - Color3uint8* out = reinterpret_cast(_out); - - Color3uint8 p; - for (int i = width * height - 1; i >= 0; --i) { - p.r = iClamp(iRound(in->r * 0.229 + in->g * 0.587 + in->b * 0.114), 0, 255); - p.g = iClamp(iRound(in->r * -0.147 + in->g * -0.289 + in->b * 0.436) + 127, 0, 255); - p.b = iClamp(iRound(in->r * 0.615 + in->g * -0.515 + in->b * -0.100) + 127, 0, 255); - *out = p; - ++in; - ++out; - } -} - - - -void GImage::Y8U8V8_to_R8G8B8(int width, int height, const uint8* _in, uint8* _out) { - const Color3uint8* in = reinterpret_cast(_in); - Color3uint8* out = reinterpret_cast(_out); - - Color3uint8 p; - for (int i = width * height - 1; i >= 0; --i) { - p.r = iClamp(iRound(in->r * 1.0753 + (in->b - 127) * 1.2256), 0, 255); - p.g = iClamp(iRound(in->r * 1.0753 + (in->g - 127) * -0.3946 + (in->b - 127) * -0.4947), 0, 255); - p.b = iClamp(iRound(in->r * 1.0753 + (in->g - 127) * 2.0320 + (in->b - 127) * 0.0853), 0, 255); - *out = p; - ++in; - ++out; - } -} - - -void GImage::makeCheckerboard(GImage& im, int checkerSize, const Color4uint8& A, const Color4uint8& B) { - for (int y = 0; y < im.m_height; ++y) { - for (int x = 0; x < im.m_width; ++x) { - bool checker = isOdd((x / checkerSize) + (y / checkerSize)); - const Color4uint8& color = checker ? A : B; - for (int c = 0; c < im.m_channels; ++c) { - uint8* v = im.byte() + (x + y * im.m_width) * im.m_channels + c; - *v = color[c]; - } - } - } -} - -} - diff --git a/dep/src/g3dlite/GImage_bayer.cpp b/dep/src/g3dlite/GImage_bayer.cpp deleted file mode 100644 index 3d08e8ade5f..00000000000 --- a/dep/src/g3dlite/GImage_bayer.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/** - @file GImage_bayer.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" - -namespace G3D { - -void GImage::BAYER_G8B8_R8G8_to_Quarter_R8G8B8(int width, int height, const uint8* in, uint8* out) { - debugAssert(in != out); - - int halfHeight = height / 2; - int halfWidth = width / 2; - - int dst_off = 0; - for (int y = 0; y < halfHeight; ++y) { - for (int x = 0; x < halfWidth; ++x) { - // GBRG - int src_off = x*2 + y*2*width; - out[dst_off] = in[src_off+width]; // red - out[dst_off+1] = ((int)in[src_off] + (int)in[src_off+width+1])/2; // green - out[dst_off+2] = in[src_off+1]; // blue - - dst_off = dst_off + 3; - } - } -} - - -void GImage::Quarter_R8G8B8_to_BAYER_G8B8_R8G8(int inWidth, int inHeight, const uint8* in, uint8* out) { - // Undo quarter-size Bayer as best we can. This code isn't very efficient, but it - // also isn't used very frequently. - - debugAssert(out != in); - - int outWidth = 2 * inWidth; - int outHeight = 2 * inHeight; - - for (int y = 0; y < outHeight; ++y) { - for (int x = 0; x < outWidth; ++x) { - const Color3uint8* inp = ((const Color3uint8*)in) + ((x/2) + (y/2)* inWidth); - uint8* outp = out + x + y * outWidth; - - if (isEven(y)) { - // GB row - if (isEven(x)) { - // Green - *outp = inp->g; - } else { - // Blue - *outp = inp->b; - } - } else { - // RG row - if (isEven(x)) { - // Red - *outp = inp->r; - } else { - // Green - *outp = inp->g; - } - } - } - } -} - - -/** Applies a 5x5 filter to monochrome image I (wrapping at the boundaries) */ -static uint8 applyFilter( - const uint8* I, - int x, - int y, - int w, - int h, - const float filter[5][5]) { - - debugAssert(isEven(w)); - debugAssert(isEven(h)); - - float sum = 0.0f; - float denom = 0.0f; - - for (int dy = 0; dy < 5; ++dy) { - int offset = ((y + dy + h - 2) % h) * w; - - for (int dx = 0; dx < 5; ++dx) { - float f = filter[dy][dx]; - sum += f * I[((x + dx + w - 2) % w) + offset]; - denom += f; - } - } - - return (uint8)iClamp(iRound(sum / denom), 0, 255); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -// Bayer conversions -// - -// There are two kinds of rows (GR and BG). -// In each row, there are two kinds of pixels (G/R, B/G). -// We express the four kinds of INPUT pixels as: -// GRG, GRG, BGB, BGG -// -// There are three kinds of OUTPUT pixels: R, G, B. -// Thus there are nominally 12 different I/O combinations, -// but several are impulses because needed output at that -// location *is* the input (e.g., G_GRG and G_BGG). -// -// The following 5x5 row-major filters are named as output_input. - -// Green -static const float G_GRR[5][5] = -{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float G_BGB[5][5] = -{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -// Red -//(the caption in the paper is wrong for this case: -// "R row B column really means R row G column" -static const float R_GRG[5][5] = -{{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}, -{ 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, -{ -1.0f, 4.0f, 5.0f, 4.0f, -1.0f}, -{ 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, -{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}}; - -static const float R_BGG[5][5] = -{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, -{ 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, -{ 0.5f, 0.0f, 5.0f, 0.0f, 0.5f}, -{ 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, -{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float R_BGB[5][5] = -{{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}, -{ 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, -{-3.0f/2.0f, 0.0f, 6.0f, 0.0f, -3.0f/2.0f}, -{ 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, -{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}}; - - -// Blue -//(the caption in the paper is wrong for this case: -// "B row R column really means B row G column") -#define B_BGG R_GRG -#define B_GRG R_BGG -#define B_GRR R_BGB - - -void GImage::BAYER_R8G8_G8B8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // RG row - for (int x = 0; x < w; ++x, ++out) { - // R pixel - { - out->r = in[x + offset]; - out->g = applyFilter(in, x, y, w, h, G_GRR); - out->b = applyFilter(in, x, y, w, h, B_GRR); - } - ++x; ++out; - - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_GRG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_GRG); - } - } - - ++y; - offset += w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - } -} - -static void swapRedAndBlue(int N, Color3uint8* out) { - for (int i = N - 1; i >= 0; --i) { - uint8 tmp = out[i].r; - out[i].r = out[i].b; - out[i].b = tmp; - } -} - -void GImage::BAYER_G8R8_B8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - // Run the equivalent function for red - BAYER_G8B8_R8G8_to_R8G8B8_MHC(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - - -void GImage::BAYER_B8G8_G8R8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - // Run the equivalent function for red - BAYER_R8G8_G8B8_to_R8G8B8_MHC(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - - -void GImage::BAYER_G8B8_R8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - - ++y; - offset += w; - - // RG row - for (int x = 0; x < w; ++x, ++out) { - // R pixel - { - out->r = in[x + offset]; - out->g = applyFilter(in, x, y, w, h, G_GRR); - out->b = applyFilter(in, x, y, w, h, B_GRR); - } - ++x; ++out; - - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_GRG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_GRG); - } - } - } - -} - -#undef B_BGG -#undef B_GRG -#undef B_GRR - -} diff --git a/dep/src/g3dlite/GImage_bmp.cpp b/dep/src/g3dlite/GImage_bmp.cpp deleted file mode 100644 index 425a7e1a1d2..00000000000 --- a/dep/src/g3dlite/GImage_bmp.cpp +++ /dev/null @@ -1,717 +0,0 @@ -/** - @file GImage_bmp.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" - -namespace G3D { - -#ifndef G3D_WIN32 -/** - This is used by the Windows bitmap I/O. - */ -static const int BI_RGB = 0; -#endif - -void GImage::encodeBMP( - BinaryOutput& out) const { - - debugAssert(m_channels == 1 || m_channels == 3); - out.setEndian(G3D_LITTLE_ENDIAN); - - uint8 red; - uint8 green; - uint8 blue; - int pixelBufferSize = m_width * m_height * 3; - int fileHeaderSize = 14; - int infoHeaderSize = 40; - int BMScanWidth; - int BMPadding; - - // First write the BITMAPFILEHEADER - // - // WORD bfType; - // DWORD bfSize; - // WORD bfReserved1; - // WORD bfReserved2; - // DWORD bfOffBits; - - // Type - out.writeUInt8('B'); - out.writeUInt8('M'); - - // File size - out.writeUInt32(fileHeaderSize + infoHeaderSize + pixelBufferSize); - - // Two reserved fields set to zero - out.writeUInt16(0); - out.writeUInt16(0); - - // The offset, in bytes, from the BITMAPFILEHEADER structure - // to the bitmap bits. - out.writeUInt32(infoHeaderSize + fileHeaderSize); - - // Now the BITMAPINFOHEADER - // - // DWORD biSize; - // LONG biWidth; - // LONG biHeight; - // WORD biPlanes; - // WORD biBitCount - // DWORD biCompression; - // DWORD biSizeImage; - // LONG biXPelsPerMeter; - // LONG biYPelsPerMeter; - // DWORD biClrUsed; - // DWORD biClrImportant; - - // Size of the info header - out.writeUInt32(infoHeaderSize); - - // Width and height of the image - out.writeUInt32(m_width); - out.writeUInt32(m_height); - - // Planes ("must be set to 1") - out.writeUInt16(1); - - // BitCount and CompressionType - out.writeUInt16(24); - out.writeUInt32(BI_RGB); - - // Image size ("may be zero for BI_RGB bitmaps") - out.writeUInt32(0); - - // biXPelsPerMeter - out.writeUInt32(0); - // biYPelsPerMeter - out.writeUInt32(0); - - // biClrUsed - out.writeUInt32(0); - - // biClrImportant - out.writeUInt32(0); - - BMScanWidth = m_width * 3; - - if (BMScanWidth & 3) { - BMPadding = 4 - (BMScanWidth & 3); - } else { - BMPadding = 0; - } - - int hStart = m_height - 1; - int hEnd = -1; - int hDir = -1; - int dest; - - // Write the pixel data - for (int h = hStart; h != hEnd; h += hDir) { - dest = m_channels * h * m_width; - for (int w = 0; w < m_width; ++w) { - - if (m_channels == 3) { - red = m_byte[dest]; - green = m_byte[dest + 1]; - blue = m_byte[dest + 2]; - } else { - red = m_byte[dest]; - green = m_byte[dest]; - blue = m_byte[dest]; - } - - out.writeUInt8(blue); - out.writeUInt8(green); - out.writeUInt8(red); - - dest += m_channels; - } - - if (BMPadding > 0) { - out.skip(BMPadding); - } - } -} - - -void GImage::decodeBMP( - BinaryInput& input) { - - // The BMP decoding uses these flags. - static const uint16 PICTURE_NONE = 0x0000; - static const uint16 PICTURE_BITMAP = 0x1000; - - // Compression Flags - static const uint16 PICTURE_UNCOMPRESSED = 0x0100; - static const uint16 PICTURE_MONOCHROME = 0x0001; - static const uint16 PICTURE_4BIT = 0x0002; - static const uint16 PICTURE_8BIT = 0x0004; - static const uint16 PICTURE_16BIT = 0x0008; - static const uint16 PICTURE_24BIT = 0x0010; - static const uint16 PICTURE_32BIT = 0x0020; - - (void)PICTURE_16BIT; - (void)PICTURE_32BIT; - - // This is a simple BMP loader that can handle uncompressed BMP files. - // Verify this is a BMP file by looking for the BM tag. - input.reset(); - std::string tag = input.readString(2); - if (tag != "BM") { - throw Error("Not a BMP file", input.getFilename()); - } - - m_channels = 3; - // Skip to the BITMAPINFOHEADER's width and height - input.skip(16); - - m_width = input.readUInt32(); - m_height = input.readUInt32(); - - // Skip to the bit count and compression type - input.skip(2); - - uint16 bitCount = input.readUInt16(); - uint32 compressionType = input.readUInt32(); - - uint8 red; - uint8 green; - uint8 blue; - uint8 blank; - - // Only uncompressed bitmaps are supported by this code - if ((int32)compressionType != BI_RGB) { - throw Error("BMP images must be uncompressed", input.getFilename()); - } - - uint8* palette = NULL; - - // Create the palette if needed - if (bitCount <= 8) { - - // Skip to the palette color count in the header - input.skip(12); - - int numColors = input.readUInt32(); - - palette = (uint8*)System::malloc(numColors * 3); - debugAssert(palette); - - // Skip past the end of the header to the palette info - input.skip(4); - - int c; - for(c = 0; c < numColors * 3; c += 3) { - // Palette information in bitmaps is stored in BGR_ format. - // That means it's blue-green-red-blank, for each entry. - blue = input.readUInt8(); - green = input.readUInt8(); - red = input.readUInt8(); - blank = input.readUInt8(); - - palette[c] = red; - palette[c + 1] = green; - palette[c + 2] = blue; - } - } - - int hStart = 0; - int hEnd = 0; - int hDir = 0; - - if (m_height < 0) { - m_height = -m_height; - hStart = 0; - hEnd = m_height; - hDir = 1; - } else { - //height = height; - hStart = m_height - 1; - hEnd = -1; - hDir = -1; - } - - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * 3); - debugAssert(m_byte); - - int BMScanWidth; - int BMPadding; - uint8 BMGroup; - uint8 BMPixel8; - int currPixel; - int dest; - int flags = PICTURE_NONE; - - if (bitCount == 1) { - // Note that this file is not necessarily grayscale, since it's possible - // the palette is blue-and-white, or whatever. But of course most image - // programs only write 1-bit images if they're black-and-white. - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_MONOCHROME; - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = (m_width + 7) >> 3; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - // Powers of 2 - int pow2[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 3 * h * m_width; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMGroup = input.readUInt8(); - - // Now we read the pixels. Usually there are eight pixels per byte, - // since each pixel is represented by one bit, but if the width - // is not a multiple of eight, the last byte will have some bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "width" number of pixels. - for (int i = 7; i >= 0; --i) { - if (currPixel < m_width) { - int src = 3 * ((BMGroup & pow2[i]) >> i); - - m_byte[dest] = palette[src]; - m_byte[dest + 1] = palette[src + 1]; - m_byte[dest + 2] = palette[src + 2]; - - ++currPixel; - dest += 3; - } - } - } - } - - } else if (bitCount == 4) { - - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_4BIT; - - // For bitmaps, each scanline is dword-aligned. - int BMScanWidth = (m_width + 1) >> 1; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 3 * h * m_width; - - for (int w = 0; w < BMScanWidth; w++) { - - BMGroup = input.readUInt8(); - int src[2]; - src[0] = 3 * ((BMGroup & 0xF0) >> 4); - src[1] = 3 * (BMGroup & 0x0F); - - // Now we read the pixels. Usually there are two pixels per byte, - // since each pixel is represented by four bits, but if the width - // is not a multiple of two, the last byte will have only four bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "Width" number of pixels. - - for (int i = 0; i < 2; ++i) { - if (currPixel < m_width) { - int tsrc = src[i]; - - m_byte[dest] = palette[tsrc]; - m_byte[dest + 1] = palette[tsrc + 1]; - m_byte[dest + 2] = palette[tsrc + 2]; - - ++currPixel; - dest += 3; - } - } - } - } - - } else if (bitCount == 8) { - - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_8BIT; - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = m_width; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMPixel8 = input.readUInt8(); - - if (currPixel < m_width) { - dest = 3 * ((h * m_width) + currPixel); - int src = 3 * BMPixel8; - - m_byte[dest] = palette[src]; - m_byte[dest + 1] = palette[src + 1]; - m_byte[dest + 2] = palette[src + 2]; - - ++currPixel; - } - } - } - - } else if (bitCount == 16) { - - m_memMan->free(m_byte); - m_byte = NULL; - System::free(palette); - palette = NULL; - throw Error("16-bit bitmaps not supported", input.getFilename()); - - } else if (bitCount == 24) { - input.skip(20); - - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_24BIT; - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = m_width * 3; - - if (BMScanWidth & 3) { - BMPadding = 4 - (BMScanWidth & 3); - } else { - BMPadding = 0; - } - - for (int h = hStart; h != hEnd; h += hDir) { - dest = 3 * h * m_width; - for (int w = 0; w < m_width; ++w) { - - blue = input.readUInt8(); - green = input.readUInt8(); - red = input.readUInt8(); - - m_byte[dest] = red; - m_byte[dest + 1] = green; - m_byte[dest + 2] = blue; - - dest += 3; - } - - if (BMPadding) { - input.skip(2); - } - } - - } else if (bitCount == 32) { - - m_memMan->free(m_byte); - m_byte = NULL; - System::free(palette); - palette = NULL; - throw Error("32 bit bitmaps not supported", input.getFilename()); - - } else { - // We support all possible bit depths, so if the - // code gets here, it's not even a real bitmap. - m_memMan->free(m_byte); - m_byte = NULL; - throw Error("Not a bitmap!", input.getFilename()); - } - - System::free(palette); - palette = NULL; -} - - -void GImage::decodeICO( - BinaryInput& input) { - - // Header - uint16 r = input.readUInt16(); - debugAssert(r == 0); - r = input.readUInt16(); - debugAssert(r == 1); - - // Read the number of icons, although we'll only load the - // first one. - int count = input.readUInt16(); - - m_channels = 4; - - debugAssert(count > 0); - - const uint8* headerBuffer = input.getCArray() + input.getPosition(); - int maxWidth = 0, maxHeight = 0; - int maxHeaderNum = 0; - for (int currentHeader = 0; currentHeader < count; ++currentHeader) { - - const uint8* curHeaderBuffer = headerBuffer + (currentHeader * 16); - int tmpWidth = curHeaderBuffer[0]; - int tmpHeight = curHeaderBuffer[1]; - // Just in case there is a non-square icon, checking area - if ((tmpWidth * tmpHeight) > (maxWidth * maxHeight)) { - maxWidth = tmpWidth; - maxHeight = tmpHeight; - maxHeaderNum = currentHeader; - } - } - - input.skip(maxHeaderNum * 16); - - m_width = input.readUInt8(); - m_height = input.readUInt8(); - int numColors = input.readUInt8(); - - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * m_channels); - debugAssert(m_byte); - - // Bit mask for packed bits - int mask = 0; - - int bitsPerPixel = 8; - - switch (numColors) { - case 2: - mask = 0x01; - bitsPerPixel = 1; - break; - - case 16: - mask = 0x0F; - bitsPerPixel = 4; - break; - - case 0: - numColors = 256; - mask = 0xFF; - bitsPerPixel = 8; - break; - - default: - throw Error("Unsupported ICO color count.", input.getFilename()); - } - - input.skip(5); - // Skip 'size' unused - input.skip(4); - - int offset = input.readUInt32(); - - // Skip over any other icon descriptions - input.setPosition(offset); - - // Skip over bitmap header; it is redundant - input.skip(40); - - Array palette; - palette.resize(numColors, true); - for (int c = 0; c < numColors; ++c) { - palette[c].b = input.readUInt8(); - palette[c].g = input.readUInt8(); - palette[c].r = input.readUInt8(); - palette[c].a = input.readUInt8(); - } - - // The actual image and mask follow - - // The XOR Bitmap is stored as 1-bit, 4-bit or 8-bit uncompressed Bitmap - // using the same encoding as BMP files. The AND Bitmap is stored in as - // 1-bit uncompressed Bitmap. - // - // Pixels are stored bottom-up, left-to-right. Pixel lines are padded - // with zeros to end on a 32bit (4byte) boundary. Every line will have the - // same number of bytes. Color indices are zero based, meaning a pixel color - // of 0 represents the first color table entry, a pixel color of 255 (if there - // are that many) represents the 256th entry. -/* - int bitsPerRow = width * bitsPerPixel; - int bytesPerRow = iCeil((double)bitsPerRow / 8); - // Rows are padded to 32-bit boundaries - bytesPerRow += bytesPerRow % 4; - - // Read the XOR values into the color channel - for (int y = height - 1; y >= 0; --y) { - int x = 0; - // Read the row - for (int i = 0; i < bytesPerRow; ++i) { - uint8 byte = input.readUInt8(); - for (int j = 0; (j < 8) && (x < width); ++x, j += bitsPerPixel) { - int bit = ((byte << j) >> (8 - bitsPerPixel)) & mask; - pixel4(x, y) = colorTable[bit]; - } - } - } -*/ - int hStart = 0; - int hEnd = 0; - int hDir = 0; - - if (m_height < 0) { - m_height = -m_height; - hStart = 0; - hEnd = m_height; - hDir = 1; - } else { - //height = height; - hStart = m_height - 1; - hEnd = -1; - hDir = -1; - } - - int BMScanWidth; - uint8 BMGroup; - uint8 BMPixel8; - int currPixel; - int dest; - - if (bitsPerPixel == 1) { - // Note that this file is not necessarily grayscale, since it's possible - // the palette is blue-and-white, or whatever. But of course most image - // programs only write 1-bit images if they're black-and-white. - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = (m_width + 7) >> 3; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - // Powers of 2 - int pow2[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 3 * h * m_width; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMGroup = input.readUInt8(); - - // Now we read the pixels. Usually there are eight pixels per byte, - // since each pixel is represented by one bit, but if the width - // is not a multiple of eight, the last byte will have some bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "width" number of pixels. - for (int i = 7; i >= 0; --i) { - if (currPixel < m_width) { - int src = ((BMGroup & pow2[i]) >> i); - - m_byte[dest] = palette[src].r; - m_byte[dest + 1] = palette[src].g; - m_byte[dest + 2] = palette[src].b; - - ++currPixel; - dest += 4; - } - } - } - } - - } else if (bitsPerPixel == 4) { - - // For bitmaps, each scanline is dword-aligned. - int BMScanWidth = (m_width + 1) >> 1; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 4 * h * m_width; - - for (int w = 0; w < BMScanWidth; w++) { - - BMGroup = input.readUInt8(); - int src[2]; - src[0] = ((BMGroup & 0xF0) >> 4); - src[1] = (BMGroup & 0x0F); - - // Now we read the pixels. Usually there are two pixels per byte, - // since each pixel is represented by four bits, but if the width - // is not a multiple of two, the last byte will have only four bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "Width" number of pixels. - - for (int i = 0; i < 2; ++i) { - if (currPixel < m_width) { - int tsrc = src[i]; - - m_byte[dest] = palette[tsrc].r; - m_byte[dest + 1] = palette[tsrc].g; - m_byte[dest + 2] = palette[tsrc].b; - - ++currPixel; - dest += 4; - } - } - } - } - - } else if (bitsPerPixel == 8) { - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = m_width; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMPixel8 = input.readUInt8(); - - if (currPixel < m_width) { - dest = 4 * ((h * m_width) + currPixel); - int src = BMPixel8; - - m_byte[dest] = palette[src].r; - m_byte[dest + 1] = palette[src].g; - m_byte[dest + 2] = palette[src].b; - - ++currPixel; - } - } - } - } - - // Read the mask into the alpha channel - int bitsPerRow = m_width; - int bytesPerRow = iCeil((double)bitsPerRow / 8); - - // For bitmaps, each scanline is dword-aligned. - //BMScanWidth = (width + 1) >> 1; - if (bytesPerRow & 3) { - bytesPerRow += 4 - (bytesPerRow & 3); - } - - for (int y = m_height - 1; y >= 0; --y) { - int x = 0; - // Read the row - for (int i = 0; i < bytesPerRow; ++i) { - uint8 byte = input.readUInt8(); - for (int j = 0; (j < 8) && (x < m_width); ++x, ++j) { - int bit = (byte >> (7 - j)) & 0x01; - pixel4(x, y).a = (1 - bit) * 0xFF; - } - } - } - -} - - -} diff --git a/dep/src/g3dlite/GImage_jpeg.cpp b/dep/src/g3dlite/GImage_jpeg.cpp deleted file mode 100644 index 0b0521f31e7..00000000000 --- a/dep/src/g3dlite/GImage_jpeg.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/** - @file GImage_jpeg.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-05-27 - @edited 2009-04-20 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -#include - -extern "C" { -#ifdef G3D_LINUX -# include -# include -#else -# include "jconfig.h" -# include "jpeglib.h" -#endif -} - -namespace G3D { - - -const int jpegQuality = 96; - -/** - The IJG library needs special setup for compress/decompressing - from memory. These classes provide them. - - The format of this class is defined by the IJG library; do not - change it. - */ -class memory_destination_mgr { -public: - struct jpeg_destination_mgr pub; - JOCTET* buffer; - int size; - int count; -}; - -typedef memory_destination_mgr* mem_dest_ptr; - -/** - Signature dictated by IJG. - */ -static void init_destination ( - j_compress_ptr cinfo) { - - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = dest->size; - dest->count=0; -} - -/** - Signature dictated by IJG. - */ -static boolean empty_output_buffer ( - j_compress_ptr cinfo) { - - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = dest->size; - - return TRUE; -} - -/** - Signature dictated by IJG. - */ -static void term_destination ( - j_compress_ptr cinfo) { - - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - dest->count = dest->size - dest->pub.free_in_buffer; -} - -/** - Signature dictated by IJG. - */ -static void jpeg_memory_dest ( - j_compress_ptr cinfo, - JOCTET* buffer, - int size) { - - mem_dest_ptr dest; - - if (cinfo->dest == NULL) { - // First time for this JPEG object; call the - // IJG allocator to get space. - cinfo->dest = (struct jpeg_destination_mgr*) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, - JPOOL_PERMANENT, - sizeof(memory_destination_mgr)); - } - - dest = (mem_dest_ptr) cinfo->dest; - dest->size = size; - dest->buffer = buffer; - dest->pub.init_destination = init_destination; - dest->pub.empty_output_buffer = empty_output_buffer; - dest->pub.term_destination = term_destination; -} - -//////////////////////////////////////////////////////////////////////////////////////// - -#define INPUT_BUF_SIZE 4096 - -/** - Structure dictated by IJG. - */ -class memory_source_mgr { -public: - struct jpeg_source_mgr pub; - int source_size; - unsigned char* source_data; - boolean start_of_data; - JOCTET* buffer; -}; - - -typedef memory_source_mgr* mem_src_ptr; - - -/** - Signature dictated by IJG. - */ -static void init_source( - j_decompress_ptr cinfo) { - - mem_src_ptr src = (mem_src_ptr) cinfo->src; - - src->start_of_data = TRUE; -} - - -/** - Signature dictated by IJG. - */ -static boolean fill_input_buffer( - j_decompress_ptr cinfo) { - - mem_src_ptr src = (mem_src_ptr) cinfo->src; - - size_t bytes_read = 0; - - if (src->source_size > INPUT_BUF_SIZE) - bytes_read = INPUT_BUF_SIZE; - else - bytes_read = src->source_size; - - memcpy (src->buffer, src->source_data, bytes_read); - - src->source_data += bytes_read; - src->source_size -= bytes_read; - - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = bytes_read; - src->start_of_data = FALSE; - - - return TRUE; -} - - -/** - Signature dictated by IJG. - */ -static void skip_input_data( - j_decompress_ptr cinfo, - long num_bytes) { - - mem_src_ptr src = (mem_src_ptr)cinfo->src; - - if (num_bytes > 0) { - while (num_bytes > (long) src->pub.bytes_in_buffer) { - num_bytes -= (long) src->pub.bytes_in_buffer; - boolean s = fill_input_buffer(cinfo); - debugAssert(s); (void)s; - } - - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - - -/** - Signature dictated by IJG. - */ -static void term_source ( - j_decompress_ptr cinfo) { - (void)cinfo; - // Intentionally empty -} - - -/** - Signature dictated by IJG. - */ -static void jpeg_memory_src ( - j_decompress_ptr cinfo, - JOCTET* buffer, - int size) { - - mem_src_ptr src; - - if (cinfo->src == NULL) { - // First time for this JPEG object - cinfo->src = (struct jpeg_source_mgr*) - (*cinfo->mem->alloc_small)( - (j_common_ptr) cinfo, - JPOOL_PERMANENT, - sizeof(memory_source_mgr)); - - src = (mem_src_ptr)cinfo->src; - - src->buffer = (JOCTET*) - (*cinfo->mem->alloc_small)( - (j_common_ptr) cinfo, - JPOOL_PERMANENT, - INPUT_BUF_SIZE * sizeof(JOCTET)); - } - - src = (mem_src_ptr)cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - - // use default method - src->pub.resync_to_restart = jpeg_resync_to_restart; - src->pub.term_source = term_source; - src->source_data = buffer; - src->source_size = size; - - // forces fill_input_buffer on first read - src->pub.bytes_in_buffer = 0; - - // until buffer loaded - src->pub.next_input_byte = NULL; -} - - -void GImage::encodeJPEG( - BinaryOutput& out) const { - - if (m_channels != 3) { - // Convert to three channel - GImage tmp = *this; - tmp.convertToRGB(); - tmp.encodeJPEG(out); - return; - } - - debugAssert(m_channels == 3); - out.setEndian(G3D_LITTLE_ENDIAN); - - // Allocate and initialize a compression object - jpeg_compress_struct cinfo; - jpeg_error_mgr jerr; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - - // Specify the destination for the compressed data. - // (Overestimate the size) - int buffer_size = m_width * m_height * 3 + 200; - JOCTET* compressed_data = (JOCTET*)System::malloc(buffer_size); - jpeg_memory_dest(&cinfo, compressed_data, buffer_size); - - - cinfo.image_width = m_width; - cinfo.image_height = m_height; - - // # of color components per pixel - cinfo.input_components = 3; - - // colorspace of input image - cinfo.in_color_space = JCS_RGB; - cinfo.input_gamma = 1.0; - - // Set parameters for compression, including image size & colorspace - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, jpegQuality, false); - cinfo.smoothing_factor = 0; - cinfo.optimize_coding = TRUE; -// cinfo.dct_method = JDCT_FLOAT; - cinfo.dct_method = JDCT_ISLOW; - cinfo.jpeg_color_space = JCS_YCbCr; - - // Initialize the compressor - jpeg_start_compress(&cinfo, TRUE); - - // Iterate over all scanlines from top to bottom - // pointer to a single row - JSAMPROW row_pointer[1]; - - // JSAMPLEs per row in image_buffer - int row_stride = cinfo.image_width * 3; - while (cinfo.next_scanline < cinfo.image_height) { - row_pointer[0] = &(m_byte[cinfo.next_scanline * row_stride]); - jpeg_write_scanlines(&cinfo, row_pointer, 1); - } - - // Shut down the compressor - jpeg_finish_compress(&cinfo); - - // Figure out how big the result was. - int outLength = ((mem_dest_ptr)cinfo.dest)->count; - - // Release the JPEG compression object - jpeg_destroy_compress(&cinfo); - - // Copy into an appropriately sized output buffer. - out.writeBytes(compressed_data, outLength); - - // Free the conservative buffer. - System::free(compressed_data); - compressed_data = NULL; -} - - -void GImage::decodeJPEG( - BinaryInput& input) { - - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - int loc = 0; - - m_channels = 3; - // We have to set up the error handler, in case initialization fails. - cinfo.err = jpeg_std_error(&jerr); - - // Initialize the JPEG decompression object. - jpeg_create_decompress(&cinfo); - - // Specify data source (eg, a file, for us, memory) - jpeg_memory_src(&cinfo, const_cast(input.getCArray()), input.size()); - - // Read the parameters with jpeg_read_header() - jpeg_read_header(&cinfo, TRUE); - - // Set parameters for decompression - // (We do nothing here since the defaults are fine) - - // Start decompressor - jpeg_start_decompress(&cinfo); - - // Get and set the values of interest to this object - m_width = cinfo.output_width; - m_height = cinfo.output_height; - - // Prepare the pointer object for the pixel data - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * 3); - - // JSAMPLEs per row in output buffer - int bpp = cinfo.output_components; - int row_stride = cinfo.output_width * bpp; - - // Make a one-row-high sample array that will go away when done with image - JSAMPARRAY temp = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - - // Read data on a scanline by scanline basis - while (cinfo.output_scanline < cinfo.output_height) { - - // We may need to adjust the output based on the - // number of channels it has. - switch (bpp) { - case 1: - // Grayscale; decompress to temp. - jpeg_read_scanlines(&cinfo, temp, 1); - - // Expand to three channels - { - uint8* scan = &(m_byte[loc * 3]); - uint8* endScan = scan + (m_width * 3); - uint8* t = *temp; - - while (scan < endScan) { - uint8 value = t[0]; - - // Spread the value 3x. - scan[0] = value; - scan[1] = value; - scan[2] = value; - - scan += 3; - t += 1; - } - } - break; - - case 3: - // Read directly into the array - { - // Need one extra level of indirection. - uint8* scan = m_byte + loc; - JSAMPARRAY ptr = &scan; - jpeg_read_scanlines(&cinfo, ptr, 1); - } - break; - - case 4: - // RGBA; decompress to temp. - jpeg_read_scanlines(&cinfo, temp, 1); - - // Drop the 3rd channel - { - uint8* scan = &(m_byte[loc * 3]); - uint8* endScan = scan + m_width * 3; - uint8* t = *temp; - - while (scan < endScan) { - scan[0] = t[0]; - scan[1] = t[1]; - scan[2] = t[2]; - - scan += 3; - t += 4; - } - } - break; - - default: - throw Error("Unexpected number of channels.", input.getFilename()); - } - - loc += row_stride; - } - - // Finish decompression - jpeg_finish_decompress(&cinfo); - - alwaysAssertM(this, "Corrupt GImage"); - // Release JPEG decompression object - jpeg_destroy_decompress(&cinfo); -} - - -} diff --git a/dep/src/g3dlite/GImage_png.cpp b/dep/src/g3dlite/GImage_png.cpp deleted file mode 100644 index 0a515bf7ed2..00000000000 --- a/dep/src/g3dlite/GImage_png.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/** - @file GImage_png.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-05-27 - @edited 2009-04-20 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" -#include - -namespace G3D { - - -//libpng required function signature -static void png_read_data( - png_structp png_ptr, - png_bytep data, - png_size_t length) { - - - debugAssert( png_ptr->io_ptr != NULL ); - debugAssert( length >= 0 ); - debugAssert( data != NULL ); - - ((BinaryInput*)png_ptr->io_ptr)->readBytes(data, length); -} - -//libpng required function signature -static void png_write_data(png_structp png_ptr, - png_bytep data, - png_size_t length) { - - debugAssert( png_ptr->io_ptr != NULL ); - debugAssert( data != NULL ); - - ((BinaryOutput*)png_ptr->io_ptr)->writeBytes(data, length); -} - -//libpng required function signature -static void png_flush_data( - png_structp png_ptr) { - (void)png_ptr; - //Do nothing. -} - -//libpng required function signature -static void png_error( - png_structp png_ptr, - png_const_charp error_msg) { - - (void)png_ptr; - debugAssert( error_msg != NULL ); - throw GImage::Error(error_msg, "PNG"); -} - - -//libpng required function signature -void png_warning( - png_structp png_ptr, - png_const_charp warning_msg) { - - (void)png_ptr; - debugAssert( warning_msg != NULL ); - Log::common()->println(warning_msg); -} - - -void GImage::encodePNG( - BinaryOutput& out) const { - - debugAssert( m_channels == 1 || m_channels == 3 || m_channels == 4 ); - - if (m_height > (int)(PNG_UINT_32_MAX / png_sizeof(png_bytep))) - throw GImage::Error("Unsupported PNG height.", out.getFilename()); - - out.setEndian(G3D_LITTLE_ENDIAN); - - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, png_error, png_warning); - if (! png_ptr) { - throw GImage::Error("Unable to initialize PNG encoder.", out.getFilename()); - } - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (! info_ptr) { - png_destroy_write_struct(&png_ptr, &info_ptr); - throw GImage::Error("Unable to initialize PNG encoder.", out.getFilename()); - } - - //setup libpng write handler so can use BinaryOutput - png_set_write_fn(png_ptr, (void*)&out, png_write_data, png_flush_data); - png_color_8_struct sig_bit; - - switch (m_channels) { - case 1: - png_set_IHDR(png_ptr, info_ptr, m_width, m_height, 8, PNG_COLOR_TYPE_GRAY, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - sig_bit.red = 0; - sig_bit.green = 0; - sig_bit.blue = 0; - sig_bit.alpha = 0; - sig_bit.gray = 8; - break; - - case 3: - png_set_IHDR(png_ptr, info_ptr, m_width, m_height, 8, PNG_COLOR_TYPE_RGB, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - - sig_bit.red = 8; - sig_bit.green = 8; - sig_bit.blue = 8; - sig_bit.alpha = 0; - sig_bit.gray = 0; - break; - - case 4: - png_set_IHDR(png_ptr, info_ptr, m_width, m_height, 8, PNG_COLOR_TYPE_RGBA, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - sig_bit.red = 8; - sig_bit.green = 8; - sig_bit.blue = 8; - sig_bit.alpha = 8; - sig_bit.gray = 0; - break; - - default: - png_destroy_write_struct(&png_ptr, &info_ptr); - throw GImage::Error("Unsupported number of channels for PNG.", out.getFilename()); - } - - - png_set_sBIT(png_ptr, info_ptr, &sig_bit); - - //write the png header - png_write_info(png_ptr, info_ptr); - - png_bytepp row_pointers = new png_bytep[m_height]; - - for (int i=0; i < m_height; ++i) { - row_pointers[i] = (png_bytep)&m_byte[m_width * m_channels * i]; - } - - png_write_image(png_ptr, row_pointers); - - png_write_end(png_ptr, info_ptr); - - delete[] row_pointers; - - png_destroy_write_struct(&png_ptr, &info_ptr); -} - - -void GImage::decodePNG( - BinaryInput& input) { - - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, png_error, png_warning); - if (png_ptr == NULL) { - throw GImage::Error("Unable to initialize PNG decoder.", input.getFilename()); - } - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - throw GImage::Error("Unable to initialize PNG decoder.", input.getFilename()); - } - - png_infop end_info = png_create_info_struct(png_ptr); - if (end_info == NULL) { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - throw GImage::Error("Unable to initialize PNG decoder.", input.getFilename()); - } - - // now that the libpng structures are setup, change the error handlers and read routines - // to use G3D functions so that BinaryInput can be used. - - png_set_read_fn(png_ptr, (png_voidp)&input, png_read_data); - - // read in sequentially so that three copies of the file are not in memory at once - png_read_info(png_ptr, info_ptr); - - png_uint_32 png_width, png_height; - int bit_depth, color_type, interlace_type; - // this will validate the data it extracts from info_ptr - png_get_IHDR(png_ptr, info_ptr, &png_width, &png_height, &bit_depth, &color_type, - &interlace_type, int_p_NULL, int_p_NULL); - - if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - throw GImage::Error("Unsupported PNG color type - PNG_COLOR_TYPE_GRAY_ALPHA.", input.getFilename()); - } - - m_width = static_cast(png_width); - m_height = static_cast(png_height); - - //swap bytes of 16 bit files to least significant byte first - png_set_swap(png_ptr); - - png_set_strip_16(png_ptr); - - //Expand paletted colors into true RGB triplets - if (color_type == PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png_ptr); - } - - //Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel - if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { - png_set_gray_1_2_4_to_8(png_ptr); - } - - //Expand paletted or RGB images with transparency to full alpha channels - //so the data will be available as RGBA quartets. - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_set_tRNS_to_alpha(png_ptr); - } - - // Fix sub-8 bit_depth to 8bit - if (bit_depth < 8) { - png_set_packing(png_ptr); - } - - if ((color_type == PNG_COLOR_TYPE_RGBA) || - ((color_type == PNG_COLOR_TYPE_PALETTE) && (png_ptr->num_trans > 0)) ) { - - m_channels = 4; - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * 4); - - } else if ((color_type == PNG_COLOR_TYPE_RGB) || - (color_type == PNG_COLOR_TYPE_PALETTE)) { - - m_channels = 3; - m_byte = (uint8*)System::malloc(m_width * m_height * 3); - - } else if (color_type == PNG_COLOR_TYPE_GRAY) { - - m_channels = 1; - - // Round up to the nearest 8 rows to avoid a bug in the PNG decoder - int h = iCeil(m_height / 8) * 8; - int sz = m_width * h; - m_byte = (uint8*)m_memMan->alloc(sz); - - } else { - throw GImage::Error("Unsupported PNG bit-depth or type.", input.getFilename()); - } - - //since we are reading row by row, required to handle interlacing - uint32 number_passes = png_set_interlace_handling(png_ptr); - - png_read_update_info(png_ptr, info_ptr); - - for (uint32 pass = 0; pass < number_passes; ++pass) { - for (uint32 y = 0; y < (uint32)m_height; ++y) { - png_bytep rowPointer = &m_byte[m_width * m_channels * y]; - png_read_rows(png_ptr, &rowPointer, png_bytepp_NULL, 1); - } - } - -// png_read_image(png_ptr, &_byte); - png_read_end(png_ptr, info_ptr); - - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); -} - -} diff --git a/dep/src/g3dlite/GImage_ppm.cpp b/dep/src/g3dlite/GImage_ppm.cpp deleted file mode 100644 index 28f8cdf9ab0..00000000000 --- a/dep/src/g3dlite/GImage_ppm.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/** - @file GImage_ppm.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/Log.h" - -namespace G3D { - -void GImage::encodePPMASCII( - BinaryOutput& out) const { - - TextOutput::Settings ppmOptions; - ppmOptions.convertNewlines = false; - ppmOptions.numColumns = 70; - ppmOptions.wordWrap = TextOutput::Settings::WRAP_WITHOUT_BREAKING; - TextOutput ppm(ppmOptions); - - switch (m_channels) { - case 1: - { - ppm.printf("P2\n%d %d\n255\n", m_width, m_height); - - const Color1uint8* c = this->pixel1(); - // Insert newlines every 70 characters max - for (uint32 i = 0; i < (uint32)(m_width * m_height); ++i) { - ppm.printf("%d%c", c[i].value, (i % (70/4) == 0) ? '\n' : ' '); - } - } - break; - - case 3: - { - ppm.printf("P3\n%d %d\n255\n", m_width, m_height); - - const Color3uint8* c = this->pixel3(); - // Insert newlines every 70 characters max - for (uint32 i = 0; i < (uint32)(m_width * m_height); ++i) { - ppm.printf("%d %d %d%c", c[i].r, c[i].g, c[i].b, - (i % (70/12) == 0) ? - '\n' : ' '); - } - } - break; - default: - alwaysAssertM(false, "PPM requires either 1 or 3 channels exactly."); - } - - const std::string& s = ppm.commitString(); - out.writeBytes(s.c_str(), s.length()); -} - - -void GImage::encodePPM( - BinaryOutput& out) const { - - // http://netpbm.sourceforge.net/doc/ppm.html - if (m_channels == 3) { - std::string header = format("P6 %d %d 255 ", m_width, m_height); - out.writeBytes(header.c_str(), header.size()); - out.writeBytes(this->pixel3(), m_width * m_height * 3); - } else if (m_channels == 1) { - std::string header = format("P5 %d %d 255 ", m_width, m_height); - out.writeBytes(header.c_str(), header.size()); - out.writeBytes(this->pixel1(), m_width * m_height); - } else { - alwaysAssertM(false, "PPM requires either 1 or 3 channels exactly."); - } -} - - -void GImage::decodePPMASCII( - BinaryInput& input) { - - int ppmWidth; - int ppmHeight; - - double maxColor; - - // Create a TextInput object to parse ascii format - // Mixed binary/ascii formats will require more - - const std::string inputStr = input.readString(); - - TextInput::Settings ppmOptions; - ppmOptions.cppLineComments = false; - ppmOptions.otherCommentCharacter = '#'; - ppmOptions.signedNumbers = true; - ppmOptions.singleQuotedStrings = false; - - TextInput ppmInput(TextInput::FROM_STRING, inputStr, ppmOptions); - - //Skip first line in header P# - std::string ppmType = ppmInput.readSymbol(); - - ppmWidth = (int)ppmInput.readNumber(); - ppmHeight = (int)ppmInput.readNumber(); - - // Everything but a PBM will have a max color value - if (ppmType != "P2") { - maxColor = ppmInput.readNumber(); - } else { - maxColor = 255; - } - - if ((ppmWidth < 0) || - (ppmHeight < 0) || - (maxColor <= 0)) { - throw GImage::Error("Invalid PPM Header.", input.getFilename()); - } - - // I don't think it's proper to scale values less than 255 - if (maxColor <= 255.0) { - maxColor = 255.0; - } - - m_width = ppmWidth; - m_height = ppmHeight; - m_channels = 3; - // always scale down to 1 byte per channel - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * 3); - - // Read in the image data. I am not validating if the values match the maxColor - // requirements. I only scale if needed to fit within the byte available. - for (uint32 i = 0; i < (uint32)(m_width * m_height); ++i) { - // read in color and scale to max pixel defined in header - // A max color less than 255 might need to be left alone and not scaled. - Color3uint8& curPixel = *(pixel3() + i); - - if (ppmType == "P3") { - curPixel.r = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - curPixel.g = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - curPixel.b = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - } else if (ppmType == "P2") { - uint8 pixel = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - curPixel.r = pixel; - curPixel.g = pixel; - curPixel.b = pixel; - } else if (ppmType == "P1") { - int pixel = (uint8)(ppmInput.readNumber() * maxColor); - curPixel.r = pixel; - curPixel.g = pixel; - curPixel.b = pixel; - } - } -} - -/** Consumes whitespace up to and including a number, but not the following character */ -static int scanUInt(BinaryInput& input) { - char c = input.readUInt8(); - while (isWhiteSpace(c)) { - c = input.readUInt8(); - } - - std::string s; - s += c; - c = input.readUInt8(); - while (!isWhiteSpace(c)) { - s += c; - c = input.readUInt8(); - } - - // Back up one to avoid consuming the last character - input.setPosition(input.getPosition() - 1); - - int x; - sscanf(s.c_str(), "%d", &x); - return x; -} - - -void GImage::decodePPM( - BinaryInput& input) { - - char head[2]; - int w, h; - - input.readBytes(head, 2); - if (head[0] != 'P' || (head[1] != '6') && (head[1] != '5')) { - throw GImage::Error("Invalid PPM Header.", input.getFilename()); - } - - w = scanUInt(input); - h = scanUInt(input); - - // Skip the max color specifier - scanUInt(input); - - if ((w < 0) || - (h < 0) || - (w > 100000) || - (h > 100000)) { - throw GImage::Error("Invalid PPM size in header.", input.getFilename()); - } - - // Trailing whitespace - input.readUInt8(); - - if (head[1] == '6') { - // 3 channel - resize(w, h, 3); - input.readBytes(m_byte, m_width * m_height * 3); - } else if (head[1] == '5') { - // 1 channel - resize(w, h, 1); - input.readBytes(m_byte, m_width * m_height); - } -} - -} diff --git a/dep/src/g3dlite/GImage_tga.cpp b/dep/src/g3dlite/GImage_tga.cpp deleted file mode 100644 index 9785f879a1f..00000000000 --- a/dep/src/g3dlite/GImage_tga.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/** - @file GImage_tga.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2002-05-27 - @edited 2009-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" - -namespace G3D { - -void GImage::encodeTGA( - BinaryOutput& out) const { - - out.setEndian(G3D_LITTLE_ENDIAN); - - // ID length - out.writeUInt8(0); - - // Color map Type - out.writeUInt8(0); - - // Type - out.writeUInt8(2); - - // Color map - out.skip(5); - - // x, y offsets - out.writeUInt16(0); - out.writeUInt16(0); - - // Width & height - out.writeUInt16(m_width); - out.writeUInt16(m_height); - - // Color depth - if (m_channels == 1) { - // Force RGB mode - out.writeUInt8(8 * 3); - } else { - out.writeUInt8(8 * m_channels); - } - - // Image descriptor - if (m_channels < 4) { - // 0 alpha bits - out.writeUInt8(0); - } else { - // 8 alpha bits - out.writeUInt8(8); - } - - // Image ID (zero length) - - if (m_channels == 1) { - // Pixels are upside down in BGR format. - for (int y = m_height - 1; y >= 0; --y) { - for (int x = 0; x < m_width; ++x) { - uint8 p = (m_byte[(y * m_width + x)]); - out.writeUInt8(p); - out.writeUInt8(p); - out.writeUInt8(p); - } - } - } else if (m_channels == 3) { - // Pixels are upside down in BGR format. - for (int y = m_height - 1; y >= 0; --y) { - for (int x = 0; x < m_width; ++x) { - uint8* p = &(m_byte[3 * (y * m_width + x)]); - out.writeUInt8(p[2]); - out.writeUInt8(p[1]); - out.writeUInt8(p[0]); - } - } - } else { - // Pixels are upside down in BGRA format. - for (int y = m_height - 1; y >= 0; --y) { - for (int x = 0; x < m_width; ++x) { - uint8* p = &(m_byte[4 * (y * m_width + x)]); - out.writeUInt8(p[2]); - out.writeUInt8(p[1]); - out.writeUInt8(p[0]); - out.writeUInt8(p[3]); - } - } - } - - // Write "TRUEVISION-XFILE " 18 bytes from the end - // (with null termination) - out.writeString("TRUEVISION-XFILE "); -} - - -void GImage::decodeTGA( - BinaryInput& input) { - - // This is a simple TGA loader that can handle uncompressed - // truecolor TGA files (TGA type 2). - // Verify this is a TGA file by looking for the TRUEVISION tag. - int pos = input.getPosition(); - input.setPosition(input.size() - 18); - std::string tag = input.readString(16); - if (tag != "TRUEVISION-XFILE") { - throw Error("Not a TGA file", input.getFilename()); - } - - input.setPosition(pos); - - int IDLength = input.readUInt8(); - int colorMapType = input.readUInt8(); - int imageType = input.readUInt8(); - - (void)colorMapType; - - // 2 is the type supported by this routine. - if (imageType != 2) { - throw Error("TGA images must be type 2 (Uncompressed truecolor)", input.getFilename()); - } - - // Color map specification - input.skip(5); - - // Image specification - - // Skip x and y offsets - input.skip(4); - - m_width = input.readInt16(); - m_height = input.readInt16(); - - int colorDepth = input.readUInt8(); - - if ((colorDepth != 24) && (colorDepth != 32)) { - throw Error("TGA files must be 24 or 32 bit.", input.getFilename()); - } - - if (colorDepth == 32) { - m_channels = 4; - } else { - m_channels = 3; - } - - // Image descriptor contains overlay data as well - // as data indicating where the origin is - int imageDescriptor = input.readUInt8(); - (void)imageDescriptor; - - // Image ID - input.skip(IDLength); - - m_byte = (uint8*)m_memMan->alloc(m_width * m_height * m_channels); - debugAssert(m_byte); - - // Pixel data - int x; - int y; - - if (m_channels == 3) { - for (y = m_height - 1; y >= 0; --y) { - for (x = 0; x < m_width; ++x) { - int b = input.readUInt8(); - int g = input.readUInt8(); - int r = input.readUInt8(); - - int i = (x + y * m_width) * 3; - m_byte[i + 0] = r; - m_byte[i + 1] = g; - m_byte[i + 2] = b; - } - } - } else { - for (y = m_height - 1; y >= 0; --y) { - for (x = 0; x < m_width; ++x) { - int b = input.readUInt8(); - int g = input.readUInt8(); - int r = input.readUInt8(); - int a = input.readUInt8(); - - int i = (x + y * m_width) * 4; - m_byte[i + 0] = r; - m_byte[i + 1] = g; - m_byte[i + 2] = b; - m_byte[i + 3] = a; - } - } - } -} - -} diff --git a/dep/src/g3dlite/GLight.cpp b/dep/src/g3dlite/GLight.cpp deleted file mode 100644 index 37c8054ff3d..00000000000 --- a/dep/src/g3dlite/GLight.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/** - @file GLight.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-11-12 - @edited 2009-11-16 -*/ -#include "G3D/GLight.h" -#include "G3D/Sphere.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -GLight::GLight(const Any& any) { - any.verifyName("GLight"); - - if (any.type() == Any::TABLE) { - *this = GLight(); - for (Any::AnyTable::Iterator it = any.table().begin(); it.hasMore(); ++it) { - const std::string& key = toLower(it->key); - if (key == "position") { - position = it->value; - } else if (key == "rightdirection") { - rightDirection = it->value; - } else if (key == "spotdirection") { - spotDirection = it->value; - } else if (key == "spotcutoff") { - spotCutoff = it->value.number(); - } else if (key == "spotsquare") { - spotSquare = it->value.boolean(); - } else if (key == "attenuation") { - attenuation[0] = it->value[0].number(); - attenuation[1] = it->value[1].number(); - attenuation[2] = it->value[2].number(); - } else if (key == "color") { - color = it->value; - } else if (key == "enabled") { - enabled = it->value.boolean(); - } else if (key == "specular") { - specular = it->value.boolean(); - } else if (key == "diffuse") { - diffuse = it->value.boolean(); - } else { - any.verify(false, "Illegal key: " + it->key); - } - } - } else if (toLower(any.name()) == "glight::directional") { - - *this = directional(any[0], any[1], - (any.size() > 2) ? any[2] : Any(true), - (any.size() > 3) ? any[3] : Any(true)); - - } else if (toLower(any.name()) == "glight::point") { - - *this = point(any[0], any[1], - (any.size() > 2) ? any[2] : Any(1), - (any.size() > 3) ? any[3] : Any(0), - (any.size() > 4) ? any[4] : Any(0.5f), - (any.size() > 5) ? any[5] : Any(true), - (any.size() > 6) ? any[6] : Any(true)); - - } else if (toLower(any.name()) == "glight::spot") { - - *this = spot(any[0], any[1], any[2], any[3], - (any.size() > 4) ? any[4] : Any(1), - (any.size() > 5) ? any[5] : Any(0), - (any.size() > 6) ? any[6] : Any(0.5f), - (any.size() > 7) ? any[5] : Any(true), - (any.size() > 8) ? any[6] : Any(true)); - } else { - any.verify(false, "Unrecognized name"); - } -} - - -GLight::operator Any() const { - Any a(Any::TABLE, "GLight"); - a.set("position", position.operator Any()); - a.set("rightDirection", rightDirection.operator Any()); - a.set("spotDirection", spotDirection.operator Any()); - a.set("spotCutoff", spotCutoff); - a.set("spotSquare", spotSquare); - - Any att(Any::ARRAY); - att.append(attenuation[0], attenuation[1], attenuation[2]); - a.set("attenuation", att); - a.set("color", color.operator Any()); - a.set("enabled", enabled); - a.set("specular", specular); - a.set("diffuse", diffuse); - return a; -} - - -GLight::GLight() : - position(0, 0, 0, 0), - rightDirection(0,0,0), - spotDirection(0, 0, -1), - spotCutoff(180), - spotSquare(false), - color(Color3::white()), - enabled(false), - specular(true), - diffuse(true) { - - attenuation[0] = 1.0; - attenuation[1] = 0.0; - attenuation[2] = 0.0; -} - - -GLight GLight::directional(const Vector3& toLight, const Color3& color, bool s, bool d) { - GLight L; - L.position = Vector4(toLight.direction(), 0); - L.color = color; - L.specular = s; - L.diffuse = d; - return L; -} - - -GLight GLight::point(const Vector3& pos, const Color3& color, float constAtt, float linAtt, float quadAtt, bool s, bool d) { - GLight L; - L.position = Vector4(pos, 1); - L.color = color; - L.attenuation[0] = constAtt; - L.attenuation[1] = linAtt; - L.attenuation[2] = quadAtt; - L.specular = s; - L.diffuse = d; - return L; -} - - -GLight GLight::spot(const Vector3& pos, const Vector3& pointDirection, float cutOffAngleDegrees, const Color3& color, float constAtt, float linAtt, float quadAtt, bool s, bool d) { - GLight L; - L.position = Vector4(pos, 1.0f); - L.spotDirection = pointDirection.direction(); - debugAssert(cutOffAngleDegrees <= 90); - L.spotCutoff = cutOffAngleDegrees; - L.color = color; - L.attenuation[0] = constAtt; - L.attenuation[1] = linAtt; - L.attenuation[2] = quadAtt; - L.specular = s; - L.diffuse = d; - return L; -} - - -bool GLight::operator==(const GLight& other) const { - return (position == other.position) && - (rightDirection == other.rightDirection) && - (spotDirection == other.spotDirection) && - (spotCutoff == other.spotCutoff) && - (spotSquare == other.spotSquare) && - (attenuation[0] == other.attenuation[0]) && - (attenuation[1] == other.attenuation[1]) && - (attenuation[2] == other.attenuation[2]) && - (color == other.color) && - (enabled == other.enabled) && - (specular == other.specular) && - (diffuse == other.diffuse); -} - - -bool GLight::operator!=(const GLight& other) const { - return !(*this == other); -} - - -Sphere GLight::effectSphere(float cutoff) const { - if (position.w == 0) { - // Directional light - return Sphere(Vector3::zero(), finf()); - } else { - // Avoid divide by zero - cutoff = max(cutoff, 0.00001f); - float maxIntensity = max(color.r, max(color.g, color.b)); - - float radius = finf(); - - if (attenuation[2] != 0) { - - // Solve I / attenuation.dot(1, r, r^2) < cutoff for r - // - // a[0] + a[1] r + a[2] r^2 > I/cutoff - // - - float a = attenuation[2]; - float b = attenuation[1]; - float c = attenuation[0] - maxIntensity / cutoff; - - float discrim = square(b) - 4 * a * c; - - if (discrim >= 0) { - discrim = sqrt(discrim); - - float r1 = (-b + discrim) / (2 * a); - float r2 = (-b - discrim) / (2 * a); - - if (r1 < 0) { - if (r2 > 0) { - radius = r2; - } - } else if (r2 > 0) { - radius = min(r1, r2); - } else { - radius = r1; - } - } - - } else if (attenuation[1] != 0) { - - // Solve I / attenuation.dot(1, r) < cutoff for r - // - // r * a[1] + a[0] = I / cutoff - // r = (I / cutoff - a[0]) / a[1] - - float radius = (maxIntensity / cutoff - attenuation[0]) / attenuation[1]; - radius = max(radius, 0.0f); - } - - return Sphere(position.xyz(), radius); - - } -} - - -CoordinateFrame GLight::frame() const { - CoordinateFrame f; - if (rightDirection == Vector3::zero()) { - // No specified right direction; choose one automatically - if (position.w == 0) { - // Directional light - f.lookAt(-position.xyz()); - } else { - // Spot light - f.lookAt(spotDirection); - } - } else { - const Vector3& Z = -spotDirection.direction(); - Vector3 X = rightDirection.direction(); - - // Ensure the vectors are not too close together - while (abs(X.dot(Z)) > 0.9f) { - X = Vector3::random(); - } - - // Ensure perpendicular - X -= Z * Z.dot(X); - const Vector3& Y = Z.cross(X); - - f.rotation.setColumn(Vector3::X_AXIS, X); - f.rotation.setColumn(Vector3::Y_AXIS, Y); - f.rotation.setColumn(Vector3::Z_AXIS, Z); - } - f.translation = position.xyz(); - - return f; -} - - -} // G3D diff --git a/dep/src/g3dlite/GThread.cpp b/dep/src/g3dlite/GThread.cpp deleted file mode 100644 index 607e4b3572f..00000000000 --- a/dep/src/g3dlite/GThread.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/** - @file GThread.cpp - - GThread class. - - @created 2005-09-24 - @edited 2005-10-22 - */ - -#include "G3D/GThread.h" -#include "G3D/System.h" -#include "G3D/debugAssert.h" -#include "G3D/GMutex.h" - -namespace G3D { - -namespace _internal { - -class BasicThread: public GThread { -public: - BasicThread(const std::string& name, void (*proc)(void*), void* param): - GThread(name), m_wrapperProc(proc), m_param(param) { } -protected: - virtual void threadMain() { - m_wrapperProc(m_param); - } - -private: - void (*m_wrapperProc)(void*); - - void* m_param; -}; - -} // namespace _internal - - -GThread::GThread(const std::string& name): - m_status(STATUS_CREATED), - m_name(name) { - -#ifdef G3D_WIN32 - m_event = NULL; -#endif - - // system-independent clear of handle - System::memset(&m_handle, 0, sizeof(m_handle)); -} - -GThread::~GThread() { -#ifdef _MSC_VER -# pragma warning( push ) -# pragma warning( disable : 4127 ) -#endif - alwaysAssertM(m_status != STATUS_RUNNING, "Deleting thread while running."); -#ifdef _MSC_VER -# pragma warning( pop ) -#endif - -#ifdef G3D_WIN32 - if (m_event) { - ::CloseHandle(m_event); - } -#endif -} - -GThreadRef GThread::create(const std::string& name, void (*proc)(void*), void* param) { - return new _internal::BasicThread(name, proc, param); -} - - -bool GThread::started() const { - return m_status != STATUS_CREATED; -} - -bool GThread::start(SpawnBehavior behavior) { - - debugAssertM(! started(), "Thread has already executed."); - if (started()) { - return false; - } - - m_status = STATUS_STARTED; - - if (behavior == USE_CURRENT_THREAD) { - // Run on this thread - m_status = STATUS_RUNNING; - threadMain(); - m_status = STATUS_COMPLETED; - return true; - } - -# ifdef G3D_WIN32 - DWORD threadId; - - m_event = ::CreateEvent(NULL, TRUE, FALSE, NULL); - debugAssert(m_event); - - m_handle = ::CreateThread(NULL, 0, &internalThreadProc, this, 0, &threadId); - - if (m_handle == NULL) { - ::CloseHandle(m_event); - m_event = NULL; - } - - return (m_handle != NULL); -# else - if (!pthread_create(&m_handle, NULL, &internalThreadProc, this)) { - return true; - } else { - // system-independent clear of handle - System::memset(&m_handle, 0, sizeof(m_handle)); - - return false; - } -# endif -} - -void GThread::terminate() { - if (m_handle) { -# ifdef G3D_WIN32 - ::TerminateThread(m_handle, 0); -# else - pthread_kill(m_handle, SIGSTOP); -# endif - // system-independent clear of handle - System::memset(&m_handle, 0, sizeof(m_handle)); - } -} - - -bool GThread::running() const{ - return (m_status == STATUS_RUNNING); -} - - -bool GThread::completed() const { - return (m_status == STATUS_COMPLETED); -} - - -void GThread::waitForCompletion() { - if (m_status == STATUS_COMPLETED) { - // Must be done - return; - } - -# ifdef G3D_WIN32 - debugAssert(m_event); - ::WaitForSingleObject(m_event, INFINITE); -# else - debugAssert(m_handle); - pthread_join(m_handle, NULL); -# endif -} - - -#ifdef G3D_WIN32 -DWORD WINAPI GThread::internalThreadProc(LPVOID param) { - GThread* current = reinterpret_cast(param); - debugAssert(current->m_event); - current->m_status = STATUS_RUNNING; - current->threadMain(); - current->m_status = STATUS_COMPLETED; - ::SetEvent(current->m_event); - return 0; -} -#else -void* GThread::internalThreadProc(void* param) { - GThread* current = reinterpret_cast(param); - current->m_status = STATUS_RUNNING; - current->threadMain(); - current->m_status = STATUS_COMPLETED; - return (void*)NULL; -} -#endif - - - -//GMutex implementation -GMutex::GMutex() { -#ifdef G3D_WIN32 - ::InitializeCriticalSection(&m_handle); -#else - int ret = pthread_mutexattr_init(&m_attr); - debugAssert(ret == 0); - ret = pthread_mutexattr_settype(&m_attr, PTHREAD_MUTEX_RECURSIVE); - debugAssert(ret == 0); - ret = pthread_mutex_init(&m_handle, &m_attr); - debugAssert(ret == 0); -#endif -} - -GMutex::~GMutex() { - //TODO: Debug check for locked -#ifdef G3D_WIN32 - ::DeleteCriticalSection(&m_handle); -#else - int ret = pthread_mutex_destroy(&m_handle); - debugAssert(ret == 0); - ret = pthread_mutexattr_destroy(&m_attr); - debugAssert(ret == 0); -#endif -} - -bool GMutex::tryLock() { -#ifdef G3D_WIN32 - return (::TryEnterCriticalSection(&m_handle) != 0); -#else - return (pthread_mutex_trylock(&m_handle) == 0); -#endif -} - -void GMutex::lock() { -#ifdef G3D_WIN32 - ::EnterCriticalSection(&m_handle); -#else - pthread_mutex_lock(&m_handle); -#endif -} - -void GMutex::unlock() { -#ifdef G3D_WIN32 - ::LeaveCriticalSection(&m_handle); -#else - pthread_mutex_unlock(&m_handle); -#endif -} - -} // namespace G3D diff --git a/dep/src/g3dlite/GUniqueID.cpp b/dep/src/g3dlite/GUniqueID.cpp deleted file mode 100644 index 84c853e0e31..00000000000 --- a/dep/src/g3dlite/GUniqueID.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/** - @file GUniqueID.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - */ -#include "G3D/GUniqueID.h" -#include "G3D/BinaryInput.h" -#include "G3D/TextInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/TextOutput.h" -#include "G3D/NetworkDevice.h" - -namespace G3D { - -void GUniqueID::serialize(BinaryOutput& b) const { - b.writeUInt64(id); -} - - -void GUniqueID::deserialize(BinaryInput& b) { - id = b.readUInt64(); -} - -void GUniqueID::serialize(TextOutput& t) const { - t.writeSymbol("("); - t.writeNumber((double)(id >> 32)); - t.writeNumber((double)(id & 0xFFFFFFFF)); - t.writeSymbol(")"); -} - -void GUniqueID::deserialize(TextInput& t) { - t.readSymbol("("); - id = (((uint64)t.readNumber()) << 32) + (uint64)t.readNumber(); - t.readSymbol(")"); -} - - -GUniqueID GUniqueID::create(uint16 tag) { - static uint64 counter = 0; - static uint64 systemID = 0; - - if (systemID == 0) { - // Create a unique ID for this machine/program instance - - // TODO: see ioctl(skfd, SIOCGIFHWADDR, &if_hwaddr) - Array addr; - NetworkDevice::instance()->localHostAddresses(addr); - if (addr.size() > 0) { - systemID |= addr[0].ip(); - } - - union { - float64 ft; - uint64 ut; - }; - ft = System::time(); - systemID = ut << 22; - systemID ^= ((uint64)iRandom(0, 32768)) << 8; - - systemID &= ~((uint64)1023 << 54); - - // Ensure that the systemID is non-zero (vanishingly small probability) - if (systemID == 0) { - systemID = 1; - } - } - - // No need for modulo; we'll all be dead before this counter - // overflows 54 bits - ++counter; - - GUniqueID i; - - i.id = (((uint64)(tag & 1023)) << 54) | (counter ^ systemID); - - return i; -} - -} // G3D diff --git a/dep/src/g3dlite/Image1.cpp b/dep/src/g3dlite/Image1.cpp deleted file mode 100644 index a61f7faa633..00000000000 --- a/dep/src/g3dlite/Image1.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/** - @file Image1.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#include "G3D/Image1.h" -#include "G3D/Image1uint8.h" -#include "G3D/GImage.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image1::Image1(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color1(0.0f)); -} - - -Image1::Ref Image1::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels()) { - case 1: - return fromArray(im.pixel1(), im.width(), im.height(), wrap); - - case 3: - return fromArray(im.pixel3(), im.width(), im.height(), wrap); - - case 4: - return fromArray(im.pixel4(), im.width(), im.height(), wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image1::Ref Image1::fromImage1uint8(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->resize(im->width(), im->height()); - - int N = im->width() * im->height(); - const Color1uint8* src = reinterpret_cast(im->getCArray()); - for (int i = 0; i < N; ++i) { - out->data[i] = Color1(src[i]); - } - - return out; -} - - -Image1::Ref Image1::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image1::Ref Image1::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image1::Ref Image1::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename, fmt); - return out; -} - - -void Image1::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -Image1::Ref Image1::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - -void Image1::copyGImage(const GImage& im) { - switch (im.channels()) { - case 1: - copyArray(im.pixel1(), im.width(), im.height()); - break; - - case 3: - copyArray(im.pixel3(), im.width(), im.height()); - break; - - case 4: - copyArray(im.pixel4(), im.width(), im.height()); - break; - } -} - - -void Image1::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color1* dst = data.getCArray(); - // Convert int8 -> float - for (int i = 0; i < N; ++i) { - dst[i] = Color1(Color3(src[i]).average()); - } -} - - -void Image1::copyArray(const Color4uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color1* dst = data.getCArray(); - - // Strip alpha and convert - for (int i = 0; i < N; ++i) { - dst[i] = Color1(Color3(src[i].rgb()).average()); - } -} - - -void Image1::copyArray(const Color1* src, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), src, w * h * sizeof(Color1)); -} - - -void Image1::copyArray(const Color4* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color1* dst = data.getCArray(); - - // Strip alpha - for (int i = 0; i < N; ++i) { - dst[i] = Color1(src[i].rgb().average()); - } -} - - -void Image1::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i]= Color1(src[i]); - } -} - - -void Image1::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1(src[i].average()); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image1::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 1); - - int N = im.width() * im.height(); - Color1uint8* dst = im.pixel1(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(data[i]); - } - - im.save(filename, fmt); -} - - -const ImageFormat* Image1::format() const { - return ImageFormat::L32F(); -} - -} // G3D diff --git a/dep/src/g3dlite/Image1uint8.cpp b/dep/src/g3dlite/Image1uint8.cpp deleted file mode 100644 index de2cbbc130b..00000000000 --- a/dep/src/g3dlite/Image1uint8.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/** - @file Image1uint8.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2008-01-13 -*/ - -#include "G3D/Image1uint8.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image1.h" -#include "G3D/GImage.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image1uint8::Image1uint8(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color1uint8(0)); -} - - -Image1uint8::Ref Image1uint8::fromImage3uint8(const ReferenceCountedPointer& im) { - return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); -} - - -Image1uint8::Ref Image1uint8::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels()) { - case 1: - return fromArray(im.pixel1(), im.width(), im.height(), wrap); - - case 3: - return fromArray(im.pixel3(), im.width(), im.height(), wrap); - - case 4: - return fromArray(im.pixel4(), im.width(), im.height(), wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image1uint8::Ref Image1uint8::fromImage1(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->copyArray(im->getCArray(), im->width(), im->height()); - - return out; -} - - -Image1uint8::Ref Image1uint8::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image1uint8::Ref Image1uint8::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image1uint8::Ref Image1uint8::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename, fmt); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image1uint8::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -void Image1uint8::copyGImage(const GImage& im) { - switch (im.channels()) { - case 1: - copyArray(im.pixel1(), im.width(), im.height()); - break; - - case 3: - copyArray(im.pixel3(), im.width(), im.height()); - break; - - case 4: - copyArray(im.pixel4(), im.width(), im.height()); - break; - } -} - - -void Image1uint8::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].value = (src[i].r + src[i].g + src[i].b) / 3; - } -} - -void Image1uint8::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(Color1(src[i].average())); - } -} - - -void Image1uint8::copyArray(const Color1uint8* ptr, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), ptr, w * h); -} - - -void Image1uint8::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(src[i]); - } -} - - -void Image1uint8::copyArray(const Color4uint8* ptr, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].value = (ptr[i].r + ptr[i].g + ptr[i].b) / 3; - } -} - - -void Image1uint8::copyArray(const Color4* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(Color1(src[i].rgb().average())); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image1uint8::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 1); - System::memcpy(im.byte(), getCArray(), width() * height()); - im.save(filename, fmt); -} - - -const ImageFormat* Image1uint8::format() const { - return ImageFormat::L8(); -} - -} // G3D diff --git a/dep/src/g3dlite/Image3.cpp b/dep/src/g3dlite/Image3.cpp deleted file mode 100644 index 0d85bdf45da..00000000000 --- a/dep/src/g3dlite/Image3.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/** - @file Image3.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#include "G3D/Image3.h" -#include "G3D/Image3uint8.h" -#include "G3D/GImage.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image3::Image3(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color3::black()); -} - - -Image3::Ref Image3::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels()) { - case 1: - return fromArray(im.pixel1(), im.width(), im.height(), wrap); - - case 3: - return fromArray(im.pixel3(), im.width(), im.height(), wrap); - - case 4: - return fromArray(im.pixel4(), im.width(), im.height(), wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image3::Ref Image3::fromImage3uint8(const ReferenceCountedPointer& im) { - Ref out = createEmpty(im->wrapMode()); - out->resize(im->width(), im->height()); - - int N = im->width() * im->height(); - const Color3uint8* src = reinterpret_cast(im->getCArray()); - for (int i = 0; i < N; ++i) { - out->data[i] = Color3(src[i]); - } - - return out; -} - - -Image3::Ref Image3::createEmpty(int width, int height, WrapMode wrap) { - return new Image3(width, height, wrap); -} - - -Image3::Ref Image3::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image3::Ref Image3::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename, fmt); - return out; -} - - -void Image3::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -Image3::Ref Image3::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image3::copyGImage(const GImage& im) { - switch (im.channels()) { - case 1: - copyArray(im.pixel1(), im.width(), im.height()); - break; - - case 3: - copyArray(im.pixel3(), im.width(), im.height()); - break; - - case 4: - copyArray(im.pixel4(), im.width(), im.height()); - break; - } -} - - -void Image3::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color3* dst = data.getCArray(); - // Convert int8 -> float - for (int i = 0; i < N; ++i) { - dst[i] = Color3(src[i]); - } -} - - -void Image3::copyArray(const Color4uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color3* dst = data.getCArray(); - - // Strip alpha and convert - for (int i = 0; i < N; ++i) { - dst[i] = Color3(src[i].rgb()); - } -} - - -void Image3::copyArray(const Color3* src, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), src, w * h * sizeof(Color3)); -} - - -void Image3::copyArray(const Color4* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color3* dst = data.getCArray(); - - // Strip alpha - for (int i = 0; i < N; ++i) { - dst[i] = src[i].rgb(); - } -} - - -void Image3::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1(src[i]).value; - } -} - - -void Image3::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image3::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 3); - - int N = im.width() * im.height(); - Color3uint8* dst = im.pixel3(); - for (int i = 0; i < N; ++i) { - dst[i] = Color3uint8(data[i]); - } - - im.save(filename, fmt); -} - - -const ImageFormat* Image3::format() const { - return ImageFormat::RGB32F(); -} - -} // G3D diff --git a/dep/src/g3dlite/Image3uint8.cpp b/dep/src/g3dlite/Image3uint8.cpp deleted file mode 100644 index 86595bbd1f6..00000000000 --- a/dep/src/g3dlite/Image3uint8.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/** - @file Image3uint8.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2008-01-08 -*/ - -#include "G3D/Image1uint8.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image3.h" -#include "G3D/GImage.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image3uint8::Ref Image3uint8::fromImage1uint8(const ReferenceCountedPointer& im) { - return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); -} - - -Image3uint8::Image3uint8(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color3::black()); -} - - -Image3uint8::Ref Image3uint8::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels()) { - case 1: - return fromArray(im.pixel1(), im.width(), im.height(), wrap); - - case 3: - return fromArray(im.pixel3(), im.width(), im.height(), wrap); - - case 4: - return fromArray(im.pixel4(), im.width(), im.height(), wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image3uint8::Ref Image3uint8::fromImage3(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->copyArray(im->getCArray(), im->width(), im->height()); - - return out; -} - - -Image3uint8::Ref Image3uint8::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image3uint8::Ref Image3uint8::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image3uint8::Ref Image3uint8::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename, fmt); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image3uint8::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -void Image3uint8::copyGImage(const GImage& im) { - switch (im.channels()) { - case 1: - copyArray(im.pixel1(), im.width(), im.height()); - break; - - case 3: - copyArray(im.pixel3(), im.width(), im.height()); - break; - - case 4: - copyArray(im.pixel4(), im.width(), im.height()); - break; - } -} - - -void Image3uint8::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - } -} - -void Image3uint8::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1uint8(src[i]).value; - } -} - - -void Image3uint8::copyArray(const Color3uint8* ptr, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), ptr, w * h * 3); -} - - -void Image3uint8::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color3uint8(src[i]); - } -} - - -void Image3uint8::copyArray(const Color4uint8* ptr, int w, int h) { - resize(w, h); - - // Copy 3/4 bytes - GImage::RGBAtoRGB((const uint8*)ptr, (uint8*)getCArray(), w * h); -} - - -void Image3uint8::copyArray(const Color4* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color3uint8(src[i].rgb()); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image3uint8::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 3); - System::memcpy(im.byte(), getCArray(), width() * height() * 3); - im.save(filename, fmt); -} - - -ReferenceCountedPointer Image3uint8::getChannel(int c) const { - debugAssert(c >= 0 && c <= 2); - - Image1uint8Ref dst = Image1uint8::createEmpty(width(), height(), wrapMode()); - const Color3uint8* srcArray = getCArray(); - Color1uint8* dstArray = dst->getCArray(); - - const int N = width() * height(); - for (int i = 0; i < N; ++i) { - dstArray[i] = Color1uint8(srcArray[i][c]); - } - - return dst; -} - - -const ImageFormat* Image3uint8::format() const { - return ImageFormat::RGB8(); -} - -} // G3D diff --git a/dep/src/g3dlite/Image4.cpp b/dep/src/g3dlite/Image4.cpp deleted file mode 100644 index c6f2b10640d..00000000000 --- a/dep/src/g3dlite/Image4.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/** - @file Image4.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2008-07-27 -*/ - - -#include "G3D/Image4.h" -#include "G3D/Image4uint8.h" -#include "G3D/GImage.h" -#include "G3D/Color3.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image4::Image4(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color4::zero()); -} - - -Image4::Ref Image4::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels()) { - case 1: - return fromArray(im.pixel1(), im.width(), im.height(), wrap); - - case 3: - return fromArray(im.pixel3(), im.width(), im.height(), wrap); - - case 4: - return fromArray(im.pixel4(), im.width(), im.height(), wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image4::Ref Image4::fromImage4uint8(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->resize(im->width(), im->height()); - - int N = im->width() * im->height(); - const Color4uint8* src = reinterpret_cast(im->getCArray()); - for (int i = 0; i < N; ++i) { - out->data[i] = Color4(src[i]); - } - - return out; -} - - -Image4::Ref Image4::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image4::Ref Image4::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image4::Ref Image4::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -void Image4::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -Image4::Ref Image4::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image4::copyGImage(const GImage& im) { - switch (im.channels()) { - case 1: - copyArray(im.pixel1(), im.width(), im.height()); - break; - - case 3: - copyArray(im.pixel3(), im.width(), im.height()); - break; - - case 4: - copyArray(im.pixel4(), im.width(), im.height()); - break; - } -} - - -void Image4::copyArray(const Color4uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color4* dst = data.getCArray(); - // Convert int8 -> float - for (int i = 0; i < N; ++i) { - dst[i] = Color4(src[i]); - } -} - - -void Image4::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color4* dst = data.getCArray(); - - // Add alpha and convert - for (int i = 0; i < N; ++i) { - dst[i] = Color4(Color3(src[i]), 1.0f); - } -} - - -void Image4::copyArray(const Color4* src, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), src, w * h * sizeof(Color4)); -} - - -void Image4::copyArray(const Color3* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color4* dst = data.getCArray(); - - // Add alpha - for (int i = 0; i < N; ++i) { - dst[i] = Color4(src[i], 1.0f); - } -} - - -void Image4::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1(src[i]).value; - dst[i].a = 1.0f; - } -} - - -void Image4::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - dst[i].a = 1.0f; - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image4::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 4); - - int N = im.width() * im.height(); - Color4uint8* dst = im.pixel4(); - for (int i = 0; i < N; ++i) { - dst[i] = Color4uint8(data[i]); - } - - im.save(filename, fmt); -} - -const ImageFormat* Image4::format() const { - return ImageFormat::RGBA32F(); -} - -} // G3D diff --git a/dep/src/g3dlite/Image4uint8.cpp b/dep/src/g3dlite/Image4uint8.cpp deleted file mode 100644 index a94ddb12d03..00000000000 --- a/dep/src/g3dlite/Image4uint8.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/** - @file Image4uint8.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-01-31 - @edited 2008-07-31 -*/ - -#include "G3D/Image4uint8.h" -#include "G3D/Image4.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image3.h" -#include "G3D/GImage.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image4uint8::Image4uint8(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color4::zero()); -} - - -Image4uint8::Ref Image4uint8::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels()) { - case 1: - return fromArray(im.pixel1(), im.width(), im.height(), wrap); - - case 3: - return fromArray(im.pixel3(), im.width(), im.height(), wrap); - - case 4: - return fromArray(im.pixel4(), im.width(), im.height(), wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image4uint8::Ref Image4uint8::fromImage4(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->copyArray(im->getCArray(), im->width(), im->height()); - - return out; -} - - -Image4uint8::Ref Image4uint8::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image4uint8::Ref Image4uint8::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image4uint8::Ref Image4uint8::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename, fmt); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image4uint8::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -void Image4uint8::copyGImage(const GImage& im) { - switch (im.channels()) { - case 1: - copyArray(im.pixel1(), im.width(), im.height()); - break; - - case 3: - copyArray(im.pixel3(), im.width(), im.height()); - break; - - case 4: - copyArray(im.pixel4(), im.width(), im.height()); - break; - } -} - - -void Image4uint8::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - dst[i].a = 255; - } -} - -void Image4uint8::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1uint8(src[i]).value; - dst[i].a = 255; - } -} - - -void Image4uint8::copyArray(const Color4uint8* ptr, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), ptr, w * h * 4); -} - - -void Image4uint8::copyArray(const Color4* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color4uint8(src[i]); - } -} - - -void Image4uint8::copyArray(const Color3uint8* ptr, int w, int h) { - resize(w, h); - - GImage::RGBtoRGBA((const uint8*)ptr, (uint8*)getCArray(), w * h); -} - - -void Image4uint8::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color4uint8(Color4(src[i], 1.0f)); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image4uint8::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 4); - System::memcpy(im.byte(), getCArray(), width() * height() * 4); - im.save(filename, fmt); -} - - -ReferenceCountedPointer Image4uint8::getChannel(int c) const { - debugAssert(c >= 0 && c <= 3); - - Image1uint8Ref dst = Image1uint8::createEmpty(width(), height(), wrapMode()); - const Color4uint8* srcArray = getCArray(); - Color1uint8* dstArray = dst->getCArray(); - - const int N = width() * height(); - for (int i = 0; i < N; ++i) { - dstArray[i] = Color1uint8(srcArray[i][c]); - } - - return dst; -} - - -const ImageFormat* Image4uint8::format() const { - return ImageFormat::RGBA8(); -} - -} // G3D diff --git a/dep/src/g3dlite/ImageFormat.cpp b/dep/src/g3dlite/ImageFormat.cpp deleted file mode 100644 index 70de878c11e..00000000000 --- a/dep/src/g3dlite/ImageFormat.cpp +++ /dev/null @@ -1,567 +0,0 @@ -/** - @file ImageFormat.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-05-23 - @edited 2009-12-10 - */ - -#include "GLG3D/glheaders.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -ImageFormat::ImageFormat( - int _numComponents, - bool _compressed, - int _glFormat, - int _glBaseFormat, - int _luminanceBits, - int _alphaBits, - int _redBits, - int _greenBits, - int _blueBits, - int _depthBits, - int _stencilBits, - int _hardwareBitsPerTexel, - int _packedBitsPerTexel, - int glDataFormat, - bool _opaque, - bool _floatingPoint, - Code _code, - ColorSpace _colorSpace, - BayerPattern _bayerPattern) : - - numComponents(_numComponents), - compressed(_compressed), - code(_code), - colorSpace(_colorSpace), - bayerPattern(_bayerPattern), - openGLFormat(_glFormat), - openGLBaseFormat(_glBaseFormat), - luminanceBits(_luminanceBits), - alphaBits(_alphaBits), - redBits(_redBits), - greenBits(_greenBits), - blueBits(_blueBits), - stencilBits(_stencilBits), - depthBits(_depthBits), - cpuBitsPerPixel(_packedBitsPerTexel), - packedBitsPerTexel(_packedBitsPerTexel), - openGLBitsPerPixel(_hardwareBitsPerTexel), - hardwareBitsPerTexel(_hardwareBitsPerTexel), - openGLDataFormat(glDataFormat), - opaque(_opaque), - floatingPoint(_floatingPoint) { - - debugAssert(_packedBitsPerTexel <= _hardwareBitsPerTexel); -} - -const ImageFormat* ImageFormat::depth(int depthBits) { - - switch (depthBits) { - case 16: - return DEPTH16(); - - case 24: - return DEPTH24(); - - case 32: - return DEPTH32(); - - default: - debugAssertM(false, "Depth must be 16, 24, or 32."); - return DEPTH32(); - } -} - - -const ImageFormat* ImageFormat::stencil(int bits) { - switch (bits) { - case 1: - return STENCIL1(); - - case 4: - return STENCIL4(); - - case 8: - return STENCIL8(); - - case 16: - return STENCIL16(); - - default: - debugAssertM(false, "Stencil must be 1, 4, 8 or 16."); - return STENCIL16(); - } -} - - - static const std::string nameArray[] = - { - "L8", - "L16", - "L16F", - "L32F", - - "A8", - "A16", - "A16F", - "A32F", - - "LA4", - "LA8", - "LA16", - "LA16F", - "LA32F", - - "RGB5", - "RGB5A1", - "RGB8", - "RGB10", - "RGB10A2", - "RGB16", - "RGB16F", - "RGB32F", - "R11G11B10F", - "RGB9E10F", - - "RGB8I", - "RGB8UI", - - "ARGB8", - "BGR8", - - "RG8", - "RG8I", - "RG8UI", - - "RGBA8", - "RGBA16", - "RGBA16F", - "RGBA32F", - - "RGBA32UI", - - "BAYER_RGGB8", - "BAYER_GRBG8", - "BAYER_GBRG8", - "BAYER_BGGR8", - "BAYER_RGGB32F", - "BAYER_GRBG32F", - "BAYER_GBRG32F", - "BAYER_BGGR32F", - - "HSV8", - "HSV32F", - - "YUV420_PLANAR", - "YUV422", - "YUV444", - - "RGB_DXT1", - "RGBA_DXT1", - "RGBA_DXT3", - "RGBA_DXT5", - - "SRGB8", - "SRGBA8", - - "SL8", - "SLA8", - - "SRGB_DXT1", - "SRGBA_DXT1", - "SRGBA_DXT3", - "SRGBA_DXT5", - - "DEPTH16", - "DEPTH24", - "DEPTH32", - "DEPTH32F", - - "STENCIL1", - "STENCIL4", - "STENCIL8", - "STENCIL16", - - "DEPTH24_STENCIL8", - "" - }; - -const std::string& ImageFormat::name() const { - debugAssert(code < CODE_NUM); - return nameArray[code]; -} - - -const ImageFormat* ImageFormat::fromString(const std::string& s) { - - for (int i = 0; ! nameArray[i].empty(); ++i) { - if (s == nameArray[i]) { - return fromCode(ImageFormat::Code(i)); - } - } - return NULL; -} - - -const ImageFormat* ImageFormat::fromCode(ImageFormat::Code code) { - switch (code) { - case ImageFormat::CODE_L8: - return ImageFormat::L8(); - - case ImageFormat::CODE_L16: - return ImageFormat::L16(); - - case ImageFormat::CODE_L16F: - return ImageFormat::L16F(); - - case ImageFormat::CODE_L32F: - return ImageFormat::L32F(); - - case ImageFormat::CODE_A8: - return ImageFormat::A8(); - - case ImageFormat::CODE_A16: - return ImageFormat::A16(); - - case ImageFormat::CODE_A16F: - return ImageFormat::A16F(); - - case ImageFormat::CODE_A32F: - return ImageFormat::A32F(); - - case ImageFormat::CODE_LA4: - return ImageFormat::LA4(); - - case ImageFormat::CODE_LA8: - return ImageFormat::LA8(); - - case ImageFormat::CODE_LA16: - return ImageFormat::LA16(); - - case ImageFormat::CODE_LA16F: - return ImageFormat::LA16F(); - break; - case ImageFormat::CODE_LA32F: - return ImageFormat::LA32F(); - - case ImageFormat::CODE_RGB5: - return ImageFormat::RGB5(); - - case ImageFormat::CODE_RGB5A1: - return ImageFormat::RGB5A1(); - - case ImageFormat::CODE_RGB8: - return ImageFormat::RGB8(); - - case ImageFormat::CODE_RGB10: - return ImageFormat::RGB10(); - - case ImageFormat::CODE_RGB10A2: - return ImageFormat::RGB10A2(); - - case ImageFormat::CODE_RGB16: - return ImageFormat::RGB16(); - - case ImageFormat::CODE_RGB32F: - return ImageFormat::RGB32F(); - - case ImageFormat::CODE_R11G11B10F: - return ImageFormat::R11G11B10F(); - - case ImageFormat::CODE_RGB9E5F: - return ImageFormat::RGB9E5F(); - - case ImageFormat::CODE_RGB8I: - return ImageFormat::RGB8I(); - - case ImageFormat::CODE_RGB8UI: - return ImageFormat::RGB8UI(); - - case ImageFormat::CODE_ARGB8: - return NULL; - - case ImageFormat::CODE_BGR8: - return ImageFormat::BGR8(); - - case ImageFormat::CODE_RG8: - return ImageFormat::RG8(); - - case ImageFormat::CODE_RG8I: - return ImageFormat::RG8I(); - - case ImageFormat::CODE_RG8UI: - return ImageFormat::RG8UI(); - - case ImageFormat::CODE_RGBA8: - return ImageFormat::RGBA8(); - - case ImageFormat::CODE_RGBA16: - return ImageFormat::RGBA16(); - - case ImageFormat::CODE_RGBA16F: - return ImageFormat::RGBA16F(); - - case ImageFormat::CODE_RGBA32F: - return ImageFormat::RGBA32F(); - - case ImageFormat::CODE_RGBA32UI: - return ImageFormat::RGBA32UI(); - - case ImageFormat::CODE_BAYER_RGGB8: - // TODO - case ImageFormat::CODE_BAYER_GRBG8: - // TODO - case ImageFormat::CODE_BAYER_GBRG8: - // TODO - case ImageFormat::CODE_BAYER_BGGR8: - // TODO - case ImageFormat::CODE_BAYER_RGGB32F: - // TODO - case ImageFormat::CODE_BAYER_GRBG32F: - // TODO - case ImageFormat::CODE_BAYER_GBRG32F: - // TODO - case ImageFormat::CODE_BAYER_BGGR32F: - // TODO - - case ImageFormat::CODE_HSV8: - // TODO - case ImageFormat::CODE_HSV32F: - // TODO - return NULL; - break; - - case ImageFormat::CODE_RGB_DXT1: - return ImageFormat::RGB_DXT1(); - break; - case ImageFormat::CODE_RGBA_DXT1: - return ImageFormat::RGBA_DXT1(); - break; - case ImageFormat::CODE_RGBA_DXT3: - return ImageFormat::RGBA_DXT3(); - break; - case ImageFormat::CODE_RGBA_DXT5: - return ImageFormat::RGBA_DXT5(); - break; - - case ImageFormat::CODE_SRGB8: - return ImageFormat::SRGB8(); - break; - - case ImageFormat::CODE_SRGBA8: - return ImageFormat::SRGBA8(); - break; - - case ImageFormat::CODE_SL8: - return ImageFormat::SL8(); - break; - - case ImageFormat::CODE_SLA8: - return ImageFormat::SLA8(); - break; - - case ImageFormat::CODE_SRGB_DXT1: - return ImageFormat::SRGB_DXT1(); - break; - - case ImageFormat::CODE_SRGBA_DXT1: - return ImageFormat::SRGBA_DXT1(); - break; - - case ImageFormat::CODE_SRGBA_DXT3: - return ImageFormat::SRGBA_DXT3(); - break; - - case ImageFormat::CODE_SRGBA_DXT5: - return ImageFormat::SRGBA_DXT5(); - break; - - case ImageFormat::CODE_DEPTH16: - return ImageFormat::DEPTH16(); - break; - case ImageFormat::CODE_DEPTH24: - return ImageFormat::DEPTH24(); - break; - case ImageFormat::CODE_DEPTH32: - return ImageFormat::DEPTH32(); - break; - case ImageFormat::CODE_DEPTH32F: - return ImageFormat::DEPTH32F(); - break; - - case ImageFormat::CODE_STENCIL1: - return ImageFormat::STENCIL1(); - break; - case ImageFormat::CODE_STENCIL4: - return ImageFormat::STENCIL4(); - break; - case ImageFormat::CODE_STENCIL8: - return ImageFormat::STENCIL8(); - break; - case ImageFormat::CODE_STENCIL16: - return ImageFormat::STENCIL16(); - break; - - case ImageFormat::CODE_DEPTH24_STENCIL8: - return ImageFormat::DEPTH24_STENCIL8(); - break; - - case ImageFormat::CODE_YUV420_PLANAR: - return ImageFormat::YUV420_PLANAR(); - break; - - case ImageFormat::CODE_YUV422: - return ImageFormat::YUV422(); - break; - - case ImageFormat::CODE_YUV444: - return ImageFormat::YUV444(); - break; - - default: - return NULL; - } -} - -// Helper variables for defining texture formats - -// Is floating point format -static const bool FLOAT_FORMAT = true; -static const bool INT_FORMAT = false; - -// Is opaque format (no alpha) -static const bool OPAQUE_FORMAT = true; -static const bool CLEAR_FORMAT = false; - -// Is compressed format (not raw component data) -static const bool COMP_FORMAT = true; -static const bool UNCOMP_FORMAT = false; - -#define DEFINE_TEXTUREFORMAT_METHOD(enumname, cmpnts, cmprssd, glf, glbf, lb, ab, rb, gb, bb, db, sb, hbpt, pbpt, gldf, opq, fp, code, cs) \ - const ImageFormat* ImageFormat::enumname() { \ - static const ImageFormat format(cmpnts, cmprssd, glf, glbf, lb, ab, rb, gb, bb, db, sb, hbpt, pbpt, gldf, opq, fp, code, cs); \ - return &format; } - -DEFINE_TEXTUREFORMAT_METHOD(L8, 1, UNCOMP_FORMAT, GL_LUMINANCE8, GL_LUMINANCE, 8, 0, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, CODE_L8, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(L16, 1, UNCOMP_FORMAT, GL_LUMINANCE16, GL_LUMINANCE, 16, 0, 0, 0, 0, 0, 0, 16, 16,GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INT_FORMAT, CODE_L16, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(L16F, 1, UNCOMP_FORMAT, GL_LUMINANCE16F_ARB,GL_LUMINANCE, 16, 0, 0, 0, 0, 0, 0, 16, 16, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, CODE_L16F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(L32F, 1, UNCOMP_FORMAT, GL_LUMINANCE32F_ARB,GL_LUMINANCE, 32, 0, 0, 0, 0, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, CODE_L32F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A8, 1, UNCOMP_FORMAT, GL_ALPHA8, GL_ALPHA, 0, 8, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, CODE_A8, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A16, 1, UNCOMP_FORMAT, GL_ALPHA16, GL_ALPHA, 0, 16, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, CODE_A16, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A16F, 1, UNCOMP_FORMAT, GL_ALPHA16F_ARB, GL_ALPHA, 0, 16, 0, 0, 0, 0, 0, 16, 16, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, CODE_A16F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A32F, 1, UNCOMP_FORMAT, GL_ALPHA32F_ARB, GL_ALPHA, 0, 32, 0, 0, 0, 0, 0, 32, 32, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, CODE_A32F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA4, 2, UNCOMP_FORMAT, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE_ALPHA, 4, 4, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, CODE_LA4, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA8, 2, UNCOMP_FORMAT, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, 8, 8, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, CODE_LA8, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA16, 2, UNCOMP_FORMAT, GL_LUMINANCE16_ALPHA16, GL_LUMINANCE_ALPHA, 16, 16, 0, 0, 0, 0, 0, 16*2, 16*2, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, CODE_LA16, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA16F, 2, UNCOMP_FORMAT, GL_LUMINANCE_ALPHA16F_ARB, GL_LUMINANCE_ALPHA, 16, 16, 0, 0, 0, 0, 0, 16*2, 16*2, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_LA16F, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA32F, 2, UNCOMP_FORMAT, GL_LUMINANCE_ALPHA32F_ARB, GL_LUMINANCE_ALPHA, 32, 32, 0, 0, 0, 0, 0, 32*2, 32*2, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_LA32F, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(BGR8, 3, UNCOMP_FORMAT, GL_RGB8, GL_BGR, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_BGR8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RG8, 2, UNCOMP_FORMAT, GL_RG8, GL_RG, 0, 0, 8, 8, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RG8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RG8I, 2, UNCOMP_FORMAT, GL_RG8I, GL_RG, 0, 0, 8, 8, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RG8I, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RG8UI, 2, UNCOMP_FORMAT, GL_RG8UI, GL_RG, 0, 0, 8, 8, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RG8UI, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB5, 3, UNCOMP_FORMAT, GL_RGB5, GL_RGBA, 0, 0, 5, 5, 5, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB5, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB5A1, 4, UNCOMP_FORMAT, GL_RGB5_A1, GL_RGBA, 0, 1, 5, 5, 5, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB5A1, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB8, 3, UNCOMP_FORMAT, GL_RGB8, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB10, 3, UNCOMP_FORMAT, GL_RGB10, GL_RGB, 0, 0, 10, 10, 10, 0, 0, 32, 10*3, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB10, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB10A2, 4, UNCOMP_FORMAT, GL_RGB10_A2, GL_RGBA, 0, 2, 10, 10, 10, 0, 0, 32, 32, GL_UNSIGNED_INT_10_10_10_2, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB10A2, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB16, 3, UNCOMP_FORMAT, GL_RGB16, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 16*3, 16*3, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB16, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB16F, 3, UNCOMP_FORMAT, GL_RGB16F_ARB, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 16*3, 16*3, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGB16F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB32F, 3, UNCOMP_FORMAT, GL_RGB32F_ARB, GL_RGB, 0, 0, 32, 32, 32, 0, 0, 32*3, 32*3, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGB32F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA8, 4, UNCOMP_FORMAT, GL_RGBA8, GL_RGBA, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA16, 4, UNCOMP_FORMAT, GL_RGBA16, GL_RGBA, 0, 16, 16, 16, 16, 0, 0, 16*4, 16*4, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA16, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA16F, 4, UNCOMP_FORMAT, GL_RGBA16F_ARB, GL_RGBA, 0, 16, 16, 16, 16, 0, 0, 16*4, 16*4, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGBA16F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA32F, 4, UNCOMP_FORMAT, GL_RGBA32F_ARB, GL_RGBA, 0, 32, 32, 32, 32, 0, 0, 32*4, 32*4, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGBA32F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA32UI, 4, UNCOMP_FORMAT, GL_RGBA32UI, GL_RGBA, 0, 32, 32, 32, 32, 0, 0, 32*4, 32*4, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA32UI, ImageFormat::COLOR_SPACE_RGB); - -// Unsigned -DEFINE_TEXTUREFORMAT_METHOD(R11G11B10F, 3, UNCOMP_FORMAT, GL_R11F_G11F_B10F_EXT, GL_RGB, 0, 0, 11, 11, 10, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_R11G11B10F, ImageFormat::COLOR_SPACE_RGB); - -// Unsigned -DEFINE_TEXTUREFORMAT_METHOD(RGB9E5F, 3, UNCOMP_FORMAT, GL_RGB9_E5_EXT, GL_RGB, 0, 0, 14, 14, 14, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGB9E5F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB8I, 3, UNCOMP_FORMAT, GL_RGB8I_EXT, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB8I, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB8UI, 3, UNCOMP_FORMAT, GL_RGB8UI_EXT, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB8UI, ImageFormat::COLOR_SPACE_RGB); - - -DEFINE_TEXTUREFORMAT_METHOD(RGB_DXT1, 3, COMP_FORMAT, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB_DXT1, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA_DXT1, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA_DXT1, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA_DXT3, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA_DXT3, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA_DXT5, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA_DXT5, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(SRGB8, 3, UNCOMP_FORMAT, GL_SRGB8, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_SRGB8, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SRGBA8, 4, UNCOMP_FORMAT, GL_SRGB8_ALPHA8, GL_RGBA, 0, 8, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_SRGBA8, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SL8, 1, UNCOMP_FORMAT, GL_SLUMINANCE8, GL_LUMINANCE, 8, 0, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_SL8, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SLA8, 2, UNCOMP_FORMAT, GL_SLUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, 8, 8, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_SLA8, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SRGB_DXT1, 3, COMP_FORMAT, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RGB, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_SRGB_DXT1, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SRGBA_DXT1, 4, COMP_FORMAT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_SRGBA_DXT1, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SRGBA_DXT3, 4, COMP_FORMAT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_SRGBA_DXT3, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(SRGBA_DXT5, 4, COMP_FORMAT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_SRGBA_DXT5, ImageFormat::COLOR_SPACE_SRGB); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH16, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT16_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 16, 0, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH16, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH24, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 24, 0, 32, 24, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH24, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH32, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 32, 0, 32, 32, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH32, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH32F, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 32, 0, 32, 32, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_DEPTH32F, ImageFormat::COLOR_SPACE_NONE); - -// These formats are for use with Renderbuffers only! -DEFINE_TEXTUREFORMAT_METHOD(STENCIL1, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX1_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 1, 1, 1, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL1, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(STENCIL4, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX4_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 4, 4, 4, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL4, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(STENCIL8, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX8_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 8, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL8, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(STENCIL16, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX16_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 16, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL16, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH24_STENCIL8, 2, UNCOMP_FORMAT, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL_EXT,0, 0, 0, 0, 0, 24, 8, 32, 32, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH24_STENCIL8, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(YUV420_PLANAR, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 12, 12, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_YUV420_PLANAR, ImageFormat::COLOR_SPACE_YUV); -DEFINE_TEXTUREFORMAT_METHOD(YUV422, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_YUV422, ImageFormat::COLOR_SPACE_YUV); -DEFINE_TEXTUREFORMAT_METHOD(YUV444, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 24, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_YUV444, ImageFormat::COLOR_SPACE_YUV); - -} diff --git a/dep/src/g3dlite/ImageFormat_convert.cpp b/dep/src/g3dlite/ImageFormat_convert.cpp deleted file mode 100644 index ecefe6319c7..00000000000 --- a/dep/src/g3dlite/ImageFormat_convert.cpp +++ /dev/null @@ -1,1307 +0,0 @@ -#include "G3D/ImageFormat.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" - - -namespace G3D { - -// this is the signature for all conversion routines (same parameters as ImageFormat::convert) -typedef void (*ConvertFunc)(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg); - -// this defines the conversion routines for converting between compatible formats -static const int NUM_CONVERT_IMAGE_FORMATS = 5; -struct ConvertAttributes { - ConvertFunc m_converter; - ImageFormat::Code m_sourceFormats[NUM_CONVERT_IMAGE_FORMATS]; - ImageFormat::Code m_destFormats[NUM_CONVERT_IMAGE_FORMATS]; - bool m_handlesSourcePadding; - bool m_handlesDestPadding; - bool m_handleInvertY; -}; - -// forward declare the converters we can use them below -#define DECLARE_CONVERT_FUNC(name) static void name(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg); - -DECLARE_CONVERT_FUNC(l8_to_rgb8); -DECLARE_CONVERT_FUNC(l32f_to_rgb8); -DECLARE_CONVERT_FUNC(rgb8_to_rgba8); -DECLARE_CONVERT_FUNC(rgb8_to_bgr8); -DECLARE_CONVERT_FUNC(rgb8_to_rgba32f); -DECLARE_CONVERT_FUNC(bgr8_to_rgb8); -DECLARE_CONVERT_FUNC(bgr8_to_rgba8); -DECLARE_CONVERT_FUNC(bgr8_to_rgba32f); -DECLARE_CONVERT_FUNC(rgba8_to_rgb8); -DECLARE_CONVERT_FUNC(rgba8_to_bgr8); -DECLARE_CONVERT_FUNC(rgba8_to_rgba32f); -DECLARE_CONVERT_FUNC(rgb32f_to_rgba32f); -DECLARE_CONVERT_FUNC(rgba32f_to_rgb8); -DECLARE_CONVERT_FUNC(rgba32f_to_rgba8); -DECLARE_CONVERT_FUNC(rgba32f_to_bgr8); -DECLARE_CONVERT_FUNC(rgba32f_to_rgb32f); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_rggb8); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_gbrg8); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_grbg8); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_bggr8); -DECLARE_CONVERT_FUNC(bayer_rggb8_to_rgba32f); -DECLARE_CONVERT_FUNC(bayer_gbrg8_to_rgba32f); -DECLARE_CONVERT_FUNC(bayer_grbg8_to_rgba32f); -DECLARE_CONVERT_FUNC(bayer_bggr8_to_rgba32f); -DECLARE_CONVERT_FUNC(rgb8_to_yuv420p); -DECLARE_CONVERT_FUNC(rgb8_to_yuv422); -DECLARE_CONVERT_FUNC(rgb8_to_yuv444); -DECLARE_CONVERT_FUNC(yuv420p_to_rgb8); -DECLARE_CONVERT_FUNC(yuv422_to_rgb8); -DECLARE_CONVERT_FUNC(yuv444_to_rgb8); - -// this is the list of mappings between formats and the routines to perform them -static const ConvertAttributes sConvertMappings[] = { - - // RGB -> RGB color space - // L8 -> - {l8_to_rgb8, {ImageFormat::CODE_L8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - - // L32F -> - {l32f_to_rgb8, {ImageFormat::CODE_L32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - - // RGB8 -> - {rgb8_to_rgba8, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, false, false, true}, - {rgb8_to_bgr8, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, false, false, true}, - {rgb8_to_rgba32f, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // BGR8 -> - {bgr8_to_rgb8, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - {bgr8_to_rgba8, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, false, false, true}, - {bgr8_to_rgba32f, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // RGBA8 -> - {rgba8_to_rgb8, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - {rgba8_to_bgr8, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, false, false, true}, - {rgba8_to_rgba32f, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // RGB32F -> - {rgb32f_to_rgba32f, {ImageFormat::CODE_RGB32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // RGBA32F -> - {rgba32f_to_rgb8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_rgba8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bgr8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_rgb32f, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB32F, ImageFormat::CODE_NONE}, false, true, true}, - - // RGB -> BAYER color space - {rgba32f_to_bayer_rggb8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_RGGB8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bayer_gbrg8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_GBRG8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bayer_grbg8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_GRBG8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bayer_bggr8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_BGGR8, ImageFormat::CODE_NONE}, false, true, true}, - - // BAYER -> RGB color space - {bayer_rggb8_to_rgba32f, {ImageFormat::CODE_BAYER_RGGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - {bayer_gbrg8_to_rgba32f, {ImageFormat::CODE_BAYER_GBRG8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - {bayer_grbg8_to_rgba32f, {ImageFormat::CODE_BAYER_GRBG8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - {bayer_bggr8_to_rgba32f, {ImageFormat::CODE_BAYER_BGGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - - // RGB <-> YUV color space - {rgb8_to_yuv420p, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_YUV420_PLANAR, ImageFormat::CODE_NONE}, false, false, false}, - {rgb8_to_yuv422, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_YUV422, ImageFormat::CODE_NONE}, false, false, false}, - {rgb8_to_yuv444, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_YUV444, ImageFormat::CODE_NONE}, false, false, false}, - {yuv420p_to_rgb8, {ImageFormat::CODE_YUV420_PLANAR, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, false}, - {yuv422_to_rgb8, {ImageFormat::CODE_YUV422, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, false}, - {yuv444_to_rgb8, {ImageFormat::CODE_YUV444, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, false}, -}; - -static ConvertFunc findConverter(TextureFormat::Code sourceCode, TextureFormat::Code destCode, bool needsSourcePadding, bool needsDestPadding, bool needsInvertY) { - int numRoutines = sizeof(sConvertMappings) / sizeof(ConvertAttributes); - for (int routineIndex = 0; routineIndex < numRoutines; ++routineIndex) { - int sourceIndex = 0; - ConvertAttributes routine = sConvertMappings[routineIndex]; - - while (routine.m_sourceFormats[sourceIndex] != ImageFormat::CODE_NONE) { - // check for matching source - if (routine.m_sourceFormats[sourceIndex] == sourceCode) { - int destIndex = 0; - - // now check for matching dest to see if the routine fits - while (routine.m_destFormats[destIndex] != ImageFormat::CODE_NONE) { - - // check if dest format matches and padding + invert rules match - if ((routine.m_destFormats[destIndex] == destCode) && - (!needsSourcePadding || (routine.m_handlesSourcePadding == needsSourcePadding)) && - (!needsDestPadding || (routine.m_handlesDestPadding == needsDestPadding)) && - (!needsInvertY || (routine.m_handleInvertY == needsInvertY))) { - - // found compatible converter - return routine.m_converter; - } - ++destIndex; - } - } - ++sourceIndex; - } - } - - return NULL; -} - -bool conversionAvailable(const ImageFormat* srcFormat, int srcRowPadBits, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY = false) { - bool conversionAvailable = false; - - // check if a conversion is available - if ( (srcFormat->code == dstFormat->code) && (srcRowPadBits == dstRowPadBits) && !invertY) { - conversionAvailable = true; - } else { - ConvertFunc directConverter = findConverter(srcFormat->code, dstFormat->code, srcRowPadBits > 0, dstRowPadBits > 0, invertY); - - conversionAvailable = (directConverter != NULL); - } - - return conversionAvailable; -} - -bool ImageFormat::convert(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, - const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, - bool invertY, BayerAlgorithm bayerAlg) { - - bool conversionAvailable = false; - - // Handle direct copy of image to same format - if ( (srcFormat->code == dstFormat->code) && (srcRowPadBits == dstRowPadBits) && !invertY) { - - System::memcpy(dstBytes[0], srcBytes[0], iCeil(((srcWidth * srcFormat->cpuBitsPerPixel + srcRowPadBits) * srcHeight) / 8.0f)); - conversionAvailable = true; - } else { - // if no direct conversion routine exists, - // then look for conversion to intermediate - // and then from intermediate to dest. - // intermediate format is RGBA32F - ConvertFunc directConverter = findConverter(srcFormat->code, dstFormat->code, srcRowPadBits > 0, dstRowPadBits > 0, invertY); - - // if we have a direct converter, use it, otherwise find intermdiate path - if (directConverter) { - directConverter(srcBytes, srcWidth, srcHeight, srcFormat, srcRowPadBits, dstBytes, dstFormat, dstRowPadBits, invertY, bayerAlg); - conversionAvailable = true; - } else { - ConvertFunc toInterConverter = findConverter(srcFormat->code, ImageFormat::CODE_RGBA32F, srcRowPadBits > 0, false, false);; - ConvertFunc fromInterConverter = findConverter(ImageFormat::CODE_RGBA32F, dstFormat->code, false, dstRowPadBits > 0, invertY);; - - if (toInterConverter && fromInterConverter) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * ImageFormat::RGBA32F()->cpuBitsPerPixel * 8)); - - toInterConverter(srcBytes, srcWidth, srcHeight, srcFormat, srcRowPadBits, tmp, ImageFormat::RGBA32F(), 0, false, bayerAlg); - fromInterConverter(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, dstBytes, dstFormat, dstRowPadBits, invertY, bayerAlg); - - System::free(tmp[0]); - - conversionAvailable = true; - } - } - } - - return conversionAvailable; -} - - -// ******************* -// RGB -> RGB color space conversions -// ******************* - -// L8 -> -static void l8_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - (void)bayerAlg; - (void)dstRowPadBits; - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - - dst[i3 + 0] = src[i]; - dst[i3 + 1] = src[i]; - dst[i3 + 2] = src[i]; - } - } -} - -// L32F -> -static void l32f_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - int srcIndex = 0; - int dstByteOffset = 0; - uint8* dst = static_cast(dstBytes[0]); - const float* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - y - 1); - } - - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) { - Color3uint8& d = *reinterpret_cast(dst + dstByteOffset); - float s = src[srcIndex]; - - uint8 c = iMin(255, iFloor(s * 256)); - d = Color3uint8(c, c, c); - } - } -} - -// RGB8 -> -static void rgb8_to_rgba8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i4 + 0] = src[i3 + 0]; - dst[i4 + 1] = src[i3 + 1]; - dst[i4 + 2] = src[i3 + 2]; - dst[i4 + 3] = 255; - } - } -} - -static void rgb8_to_bgr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - dst[i3 + 0] = src[i3 + 2]; - dst[i3 + 1] = src[i3 + 1]; - dst[i3 + 2] = src[i3 + 0]; - } - } -} - -static void rgb8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3) { - const Color3uint8& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(Color3(s), 1.0f); - } - srcByteOffset += srcRowPadBytes; - } -} - -// BGR8 -> -static void bgr8_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - dst[i3 + 0] = src[i3 + 2]; - dst[i3 + 1] = src[i3 + 1]; - dst[i3 + 2] = src[i3 + 0]; - } - } -} - -static void bgr8_to_rgba8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i4 + 0] = src[i3 + 2]; - dst[i4 + 1] = src[i3 + 1]; - dst[i4 + 2] = src[i3 + 0]; - dst[i4 + 3] = 255; - } - } -} - -static void bgr8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3) { - const Color3uint8& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(Color3(s).bgr(), 1.0f); - } - srcByteOffset += srcRowPadBytes; - } -} - -// RGBA8 -> -static void rgba8_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i3 + 0] = src[i4 + 0]; - dst[i3 + 1] = src[i4 + 1]; - dst[i3 + 2] = src[i4 + 2]; - } - } -} - -static void rgba8_to_bgr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i3 + 0] = src[i4 + 2]; - dst[i3 + 1] = src[i4 + 1]; - dst[i3 + 2] = src[i4 + 0]; - } - } -} - -static void rgba8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 4) { - const Color4uint8& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(s); - } - srcByteOffset += srcRowPadBytes; - } -} - -// RGB32F -> -static void rgb32f_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3 * sizeof(float)) { - const Color3& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(Color3(s), 1.0f); - } - srcByteOffset += srcRowPadBytes; - } -} - -// RGBA32F -> -static void rgba32f_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - y - 1); - } - - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) { - Color3uint8& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - - d = Color3uint8(s.rgb()); - } - dstByteOffset += dstRowPadBytes; - } -} - -static void rgba32f_to_rgba8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - 1 - y); - } - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 4) { - Color4uint8& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - - d = Color4uint8(s); - } - dstByteOffset += dstRowPadBytes; - } -} - -static void rgba32f_to_bgr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - y - 1); - } - - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) { - Color3uint8& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - - d = Color3uint8(s.rgb()).bgr(); - } - dstByteOffset += dstRowPadBytes; - } -} - -static void rgba32f_to_rgb32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - 1 - y); - } - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3 * sizeof(float)) { - Color3& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - d = s.rgb(); - } - dstByteOffset += dstRowPadBytes; - } -} - -// ******************* -// RGB <-> YUV color space conversions -// ******************* - -static uint32 blendPixels(uint32 pixel1, uint32 pixel2) { - static const uint32 rbMask = 0x00FF00FF; - static const uint32 agMask = 0xFF00FF00; - - // Compute two color channels at a time. Use >> 1 for fast division by two - // Using alternating color channels prevents overflow - const uint32 rb = ((pixel1 & rbMask) + (pixel2 & rbMask)) >> 1; - - // Shift first to avoid overflow in alpha channel - const uint32 ag = (((pixel1 & agMask) >> 1) + ((pixel2 & agMask) >> 1)); - - return ((rb & rbMask) | (ag & agMask)); -} - -#define PIXEL_RGB8_TO_YUV_Y(r, g, b) static_cast(iClamp(((66 * r + 129 * g + 25 * b + 128) >> 8) + 16, 0, 255)) -#define PIXEL_RGB8_TO_YUV_U(r, g, b) static_cast(iClamp(((-38 * r - 74 * g + 112 * b + 128) >> 8) + 128, 0, 255)) -#define PIXEL_RGB8_TO_YUV_V(r, g, b) static_cast(iClamp(((112 * r - 94 * g - 18 * b + 128) >> 8) + 128, 0, 255)) - -static void rgb8_to_yuv420p(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0) && (srcHeight % 2 == 0), "Source width and height must be a multiple of two"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - uint8* dstY = static_cast(dstBytes[0]); - uint8* dstU = static_cast(dstBytes[1]); - uint8* dstV = static_cast(dstBytes[2]); - - for (int y = 0; y < srcHeight; y += 2) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert 4-pixel block at a time - int srcPixelOffset0 = y * srcWidth + x; - int srcPixelOffset1 = srcPixelOffset0 + 1; - int srcPixelOffset2 = srcPixelOffset0 + srcWidth; - int srcPixelOffset3 = srcPixelOffset2 + 1; - - int yIndex = y * srcWidth + x; - - dstY[yIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset0].r, src[srcPixelOffset0].g, src[srcPixelOffset0].b); - dstY[yIndex + 1] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset1].r, src[srcPixelOffset1].g, src[srcPixelOffset1].b); - - yIndex += srcWidth; - dstY[yIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset2].r, src[srcPixelOffset2].g, src[srcPixelOffset2].b); - dstY[yIndex + 1] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset3].r, src[srcPixelOffset3].g, src[srcPixelOffset3].b); - - uint32 blendedPixel = blendPixels(src[srcPixelOffset0].asUInt32(), src[srcPixelOffset2].asUInt32()); - Color3uint8 uvSrcColor = Color3uint8::fromARGB(blendedPixel); - - int uvIndex = y / 2 * srcWidth / 2 + x / 2; - dstU[uvIndex] = PIXEL_RGB8_TO_YUV_U(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - dstV[uvIndex] = PIXEL_RGB8_TO_YUV_V(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - } - } -} - -static void rgb8_to_yuv422(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0), "Source width must be a multiple of two"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert 2-pixel horizontal block at a time - int srcIndex = y * srcWidth + x; - int dstIndex = srcIndex * 2; - - uint32 blendedPixel = blendPixels(src[srcIndex].asUInt32(), src[srcIndex + 1].asUInt32()); - Color3uint8 uvSrcColor = Color3uint8::fromARGB(blendedPixel); - - dst[dstIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcIndex].r, src[srcIndex].g, src[srcIndex].b); - - dst[dstIndex + 1] = PIXEL_RGB8_TO_YUV_U(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - - dst[dstIndex + 2] = PIXEL_RGB8_TO_YUV_Y(src[srcIndex + 1].r, src[srcIndex + 1].g, src[srcIndex + 1].b); - - dst[dstIndex + 3] = PIXEL_RGB8_TO_YUV_V(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - - } - } -} - -static void rgb8_to_yuv444(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - - // convert 1-pixels at a time - int index = y * srcWidth + x; - uint8 y = PIXEL_RGB8_TO_YUV_Y(src[index].r, src[index].g, src[index].b); - uint8 u = PIXEL_RGB8_TO_YUV_U(src[index].r, src[index].g, src[index].b); - uint8 v = PIXEL_RGB8_TO_YUV_V(src[index].r, src[index].g, src[index].b); - - dst[index].r = y; - dst[index].g = u; - dst[index].b = v; - } - } -} - - -#define PIXEL_YUV_TO_RGB8_R(y, u, v) static_cast(iClamp((298 * (y - 16) + 409 * (v - 128) + 128) >> 8, 0, 255)) -#define PIXEL_YUV_TO_RGB8_G(y, u, v) static_cast(iClamp((298 * (y - 16) - 100 * (u - 128) - 208 * (v - 128) + 128) >> 8, 0, 255)) -#define PIXEL_YUV_TO_RGB8_B(y, u, v) static_cast(iClamp((298 * (y - 16) + 516 * (u - 128) + 128) >> 8, 0, 255)) - -static void yuv420p_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0) && (srcHeight % 2 == 0), "Source width and height must be a multiple of two"); - - const uint8* srcY = static_cast(srcBytes[0]); - const uint8* srcU = static_cast(srcBytes[1]); - const uint8* srcV = static_cast(srcBytes[2]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert to two rgb pixels in a row - Color3uint8* rgb = &dst[y * srcWidth + x]; - - int yOffset = y * srcWidth + x; - int uvOffset = y / 2 * srcWidth / 2 + x / 2; - - rgb->r = PIXEL_YUV_TO_RGB8_R(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]); - rgb->g = PIXEL_YUV_TO_RGB8_G(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]); - rgb->b = PIXEL_YUV_TO_RGB8_B(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]); - - rgb += 1; - rgb->r = PIXEL_YUV_TO_RGB8_R(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]); - rgb->g = PIXEL_YUV_TO_RGB8_G(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]); - rgb->b = PIXEL_YUV_TO_RGB8_B(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]); - } - } -} - -static void yuv422_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0), "Source width must be a multiple of two"); - - const uint8* src = static_cast(srcBytes[0]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert to two rgb pixels in a row - Color3uint8* rgb = &dst[y * srcWidth + x]; - - int srcIndex = (y * srcWidth + x) * 2; - uint8 y = src[srcIndex]; - uint8 u = src[srcIndex + 1]; - uint8 y2 = src[srcIndex + 2]; - uint8 v = src[srcIndex + 3]; - - rgb->r = PIXEL_YUV_TO_RGB8_R(y, u, v); - rgb->g = PIXEL_YUV_TO_RGB8_G(y, u, v); - rgb->b = PIXEL_YUV_TO_RGB8_B(y, u, v); - - rgb += 1; - rgb->r = PIXEL_YUV_TO_RGB8_R(y2, u, v); - rgb->g = PIXEL_YUV_TO_RGB8_G(y2, u, v); - rgb->b = PIXEL_YUV_TO_RGB8_B(y2, u, v); - } - } -} - -static void yuv444_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - - // convert to one rgb pixels at a time - int index = y * srcWidth + x; - Color3uint8* rgb = &dst[index]; - - rgb->r = PIXEL_YUV_TO_RGB8_R(src[index].r, src[index].g, src[index].b); - rgb->g = PIXEL_YUV_TO_RGB8_G(src[index].r, src[index].g, src[index].b); - rgb->b = PIXEL_YUV_TO_RGB8_B(src[index].r, src[index].g, src[index].b); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -// Bayer conversions -// - -// There are two kinds of rows (GR and BG). -// In each row, there are two kinds of pixels (G/R, B/G). -// We express the four kinds of INPUT pixels as: -// GRG, GRG, BGB, BGG -// -// There are three kinds of OUTPUT pixels: R, G, B. -// Thus there are nominally 12 different I/O combinations, -// but several are impulses because needed output at that -// location *is* the input (e.g., G_GRG and G_BGG). -// -// The following 5x5 row-major filters are named as output_input. - -// Green -static const float G_GRR[5][5] = - {{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float G_BGB[5][5] = - {{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -// Red -//(the caption in the paper is wrong for this case: -// "R row B column really means R row G column" -static const float R_GRG[5][5] = - {{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}, - { 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, - { -1.0f, 4.0f, 5.0f, 4.0f, -1.0f}, - { 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, - { 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}}; - -static const float R_BGG[5][5] = - {{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, - { 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, - { 0.5f, 0.0f, 5.0f, 0.0f, 0.5f}, - { 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, - { 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float R_BGB[5][5] = - {{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}, - { 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, - {-3.0f/2.0f, 0.0f, 6.0f, 0.0f, -3.0f/2.0f}, - { 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, - { 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}}; - - -// Blue -//(the caption in the paper is wrong for this case: -// "B row R column really means B row G column") -#define B_BGG R_GRG -#define B_GRG R_BGG -#define B_GRR R_BGB - -// ===================================================================== -// Helper methods -// ===================================================================== - - -/** Applies a 5x5 filter to monochrome image I (wrapping at the boundaries) */ -static uint8 applyFilter(const uint8* I, - int x, - int y, - int w, - int h, - const float filter[5][5]) { - - debugAssert(isEven(w)); - debugAssert(isEven(h)); - - float sum = 0.0f; - float denom = 0.0f; - - for (int dy = 0; dy < 5; ++dy) { - int offset = ((y + dy + h - 2) % h) * w; - - for (int dx = 0; dx < 5; ++dx) { - float f = filter[dy][dx]; - sum += f * I[((x + dx + w - 2) % w) + offset]; - denom += f; - } - } - - return (uint8)iClamp(iRound(sum / denom), 0, 255); -} - -/** Helper method for Bayer grbg and bggr --> rgb8 */ -static void swapRedAndBlue(int N, Color3uint8* out) { - for (int i = N - 1; i >= 0; --i) { - uint8 tmp = out[i].r; - out[i].r = out[i].b; - out[i].b = tmp; - } -} - -// RGB -> BAYER color space - -// ===================================================================== -// rgb8 --> bayer helpers -// ===================================================================== -static void rgb8_to_bayer_rggb8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for (int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - - // Top right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } - - // Bottom row pixels - for (int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Bottom right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - } -} - - -static void rgb8_to_bayer_grbg8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for (int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Top right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - } - - // Bottom row pixels - for (int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - - // Bottom right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } -} - - -static void rgb8_to_bayer_bggr8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for (int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - - // Top right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } - - // Bottom row pixels - for (int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Bottom right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - } -} - - -static void rgb8_to_bayer_gbrg8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for(int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Top right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - } - - // Bottom row pixels - for(int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - - // Bottom right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } -} - -// ===================================================================== -// rgba32f (-->rgb8) --> bayer converter implementations -// ===================================================================== -static void rgba32f_to_bayer_rggb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_rggb8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -static void rgba32f_to_bayer_gbrg8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_grbg8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -static void rgba32f_to_bayer_grbg8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_gbrg8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -static void rgba32f_to_bayer_bggr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_bggr8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -// BAYER -> RGB color space - -// ===================================================================== -// bayer --> rgb8 helpers -// ===================================================================== -static void bayer_rggb8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // RG row - for (int x = 0; x < w; ++x, ++out) { - // R pixel - { - out->r = in[x + offset]; - out->g = applyFilter(in, x, y, w, h, G_GRR); - out->b = applyFilter(in, x, y, w, h, B_GRR); - } - ++x; ++out; - - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_GRG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_GRG); - } - } - - ++y; - offset += w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - } -} - - - -static void bayer_gbrg8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - } -} - - -static void bayer_grbg8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - // Run the equivalent function for red - bayer_gbrg8_to_rgb8_mhc(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - - -static void bayer_bggr8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - // Run the equivalent function for red - bayer_rggb8_to_rgb8_mhc(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - -// ===================================================================== -// bayer (--> rgb8) --> rgba32f converter implementations -// ===================================================================== -static void bayer_rggb8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_rggb8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - -static void bayer_gbrg8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_grbg8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - -static void bayer_grbg8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_gbrg8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - -static void bayer_bggr8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_bggr8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - - - - - - // TODO: The following region is commented out because so far - // those conversions are not used anywhere else. Until it is - // decided that such conversions are not needed, this region - // remains commented out. - - -// // ===================================================================== -// // bayer --> bgr8 -// // ===================================================================== - -// static void bayer_rggb8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { -// debugAssert(in != _out); - -// Color3uint8* out = (Color3uint8*)_out; - -// for (int y = 0; y < h; ++y) { - -// // Row beginning in the input array. -// int offset = y * w; - -// // RG row -// for (int x = 0; x < w; ++x, ++out) { -// // R pixel -// { -// out->b = in[x + offset]; -// out->g = applyFilter(in, x, y, w, h, G_GRR); -// out->r = applyFilter(in, x, y, w, h, B_GRR); -// } -// ++x; ++out; - -// // G pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_GRG); -// out->g = in[x + offset]; -// out->r = applyFilter(in, x, y, w, h, B_GRG); -// } -// } - -// ++y; -// offset += w; - -// // GB row -// for (int x = 0; x < w; ++x, ++out) { -// // G pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGG); -// out->g = in[x + offset]; -// out->r = applyFilter(in, x, y, w, h, B_BGG); -// } -// ++x; ++out; - -// // B pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGB); -// out->g = applyFilter(in, x, y, w, h, G_BGB); -// out->r = in[x + offset]; -// } -// } -// } -// } - - -// static void bayer_gbrg8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { - -// debugAssert(in != _out); - -// Color3uint8* out = (Color3uint8*)_out; - -// for (int y = 0; y < h; ++y) { - -// // Row beginning in the input array. -// int offset = y * w; - -// // GB row -// for (int x = 0; x < srcWidth; ++x, ++out) { -// // G pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGG); -// out->g = in[x + offset]; -// out->r = applyFilter(in, x, y, w, h, B_BGG); -// } -// ++x; ++out; - -// // B pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGB); -// out->g = applyFilter(in, x, y, w, h, G_BGB); -// out->r = in[x + offset]; -// } -// } -// } -// } - -// static void bayer_grbg8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { -// // Run the equivalent function for red -// bayer_gbrg8_to_bgr8_mhc(w, h, in, _out); - -// // Now swap red and blue -// swapRedAndBlue(srcWidth * h, (Color3uint8*)_out); -// } - -// static void bayer_bggr8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { -// // Run the equivalent function for red -// bayer_rggb8_to_bgr8_mhc(w, h, in, _out); - -// // Now swap red and blue -// swapRedAndBlue(srcWidth * h, (Color3uint8*)_out); -// } - - - -/////////////////////////////////////////////////// - -} // namespace G3D diff --git a/dep/src/g3dlite/Intersect.cpp b/dep/src/g3dlite/Intersect.cpp deleted file mode 100644 index 929a2e4e670..00000000000 --- a/dep/src/g3dlite/Intersect.cpp +++ /dev/null @@ -1,844 +0,0 @@ -/** - @file Intersect.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-06-29 - @edited 2009-06-29 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - - From the G3D Innovation Engine - http://g3d.sf.net - */ -#include "G3D/Intersect.h" - -namespace G3D { - -#ifdef _MSC_VER -// Turn on fast floating-point optimizations -#pragma float_control( push ) -#pragma fp_contract( on ) -#pragma fenv_access( off ) -#pragma float_control( except, off ) -#pragma float_control( precise, off ) -#endif - -bool __fastcall Intersect::rayAABox(const Ray& ray, const AABox& box) { - switch (ray.classification) { - case Ray::MMM: - - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.lo.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.lo.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.lo.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.hi.x + ray.c_zx > 0) - ) - return false; - - return true; - - case Ray::MMP: - - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.lo.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.hi.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.lo.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.hi.x + ray.c_zx > 0) - ) - return false; - - return true; - - case Ray::MPM: - - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.lo.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.lo.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.lo.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.hi.x + ray.c_zx > 0) - ) - return false; - - return true; - - case Ray::MPP: - - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.lo.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.hi.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.lo.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.hi.x + ray.c_zx > 0) - ) - return false; - - return true; - - case Ray::PMM: - - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.hi.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.lo.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.hi.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.lo.x + ray.c_zx < 0) - ) - return false; - - return true; - - case Ray::PMP: - - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.hi.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.hi.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.hi.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.lo.x + ray.c_zx < 0) - ) - return false; - - return true; - - case Ray::PPM: - - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.hi.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.lo.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.hi.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.lo.x + ray.c_zx < 0) - ) - return false; - - return true; - - case Ray::PPP: - - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.hi.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.hi.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.hi.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - return true; - - case Ray::OMM: - - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyk * box.lo.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.hi.z + ray.c_yz > 0) - ) - return false; - - return true; - - case Ray::OMP: - - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyk * box.hi.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.lo.z + ray.c_yz < 0) - ) - return false; - - return true; - - case Ray::OPM: - - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyk * box.lo.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.hi.z + ray.c_yz > 0) - ) - return false; - - return true; - - case Ray::OPP: - - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyk * box.hi.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.lo.z + ray.c_yz < 0) - ) - return false; - - return true; - - case Ray::MOM: - - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.z < box.lo.z) - || (ray.kbyi * box.lo.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.hi.x + ray.c_zx > 0) - ) - return false; - - return true; - - case Ray::MOP: - - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.z > box.hi.z) - || (ray.kbyi * box.lo.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.hi.x + ray.c_zx > 0) - ) - return false; - - return true; - - case Ray::POM: - - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.z < box.lo.z) - || (ray.kbyi * box.hi.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.lo.x + ray.c_zx < 0) - ) - return false; - - return true; - - case Ray::POP: - - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.z > box.hi.z) - || (ray.kbyi * box.hi.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.lo.x + ray.c_zx < 0) - ) - return false; - - return true; - - case Ray::MMO: - - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.y < box.lo.y) - || (ray.jbyi * box.lo.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.hi.x + ray.c_yx > 0) - ) - return false; - - return true; - - case Ray::MPO: - - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.y > box.hi.y) - || (ray.jbyi * box.lo.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.hi.x + ray.c_yx > 0) - ) - return false; - - return true; - - case Ray::PMO: - - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.y < box.lo.y) - || (ray.jbyi * box.hi.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.lo.x + ray.c_yx < 0) - ) - return false; - - return true; - - case Ray::PPO: - - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.y > box.hi.y) - || (ray.jbyi * box.hi.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.lo.x + ray.c_yx < 0) - ) - return false; - - return true; - - case Ray::MOO: - - if((ray.m_origin.x < box.lo.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - ) - return false; - - return true; - - case Ray::POO: - - if((ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - ) - return false; - - return true; - - case Ray::OMO: - - if((ray.m_origin.y < box.lo.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - ) - return false; - - case Ray::OPO: - - if((ray.m_origin.y > box.hi.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - ) - return false; - - case Ray::OOM: - - if((ray.m_origin.z < box.lo.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - ) - return false; - - case Ray::OOP: - - if((ray.m_origin.z > box.hi.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - ) - return false; - - return true; - - } - - return false; -} - - -bool __fastcall Intersect::rayAABox(const Ray& ray, const AABox& box, float& time) { - - switch (ray.classification) { - case Ray::MMM: - { - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.lo.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.lo.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.lo.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.hi.x + ray.c_zx > 0)) { - return false; - } - - // compute the intersection distance - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::MMP: - { - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.lo.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.hi.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.lo.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.hi.x + ray.c_zx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::MPM: - { - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.lo.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.lo.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.lo.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.hi.x + ray.c_zx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::MPP: - { - if ((ray.m_origin.x < box.lo.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.lo.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.hi.x + ray.c_yx > 0) - || (ray.jbyk * box.hi.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.lo.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.hi.x + ray.c_zx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::PMM: - { - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.hi.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.lo.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.hi.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - - case Ray::PMP: - { - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.hi.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.hi.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.hi.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::PPM: - { - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyi * box.hi.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.lo.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.hi.z + ray.c_yz > 0) - || (ray.kbyi * box.hi.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::PPP: - { - if ((ray.m_origin.x > box.hi.x) || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyi * box.hi.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.lo.x + ray.c_yx < 0) - || (ray.jbyk * box.hi.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.lo.z + ray.c_yz < 0) - || (ray.kbyi * box.hi.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::OMM: - { - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyk * box.lo.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.hi.z + ray.c_yz > 0)) { - return false; - } - - time = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::OMP: - { - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyk * box.hi.z - box.hi.y + ray.c_zy > 0) - || (ray.kbyj * box.lo.y - box.lo.z + ray.c_yz < 0)) { - return false; - } - - time = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::OPM: - { - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z < box.lo.z) - || (ray.jbyk * box.lo.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.hi.z + ray.c_yz > 0)) { - return false; - } - - time = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::OPP: - { - if((ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y > box.hi.y) || (ray.m_origin.z > box.hi.z) - || (ray.jbyk * box.hi.z - box.lo.y + ray.c_zy < 0) - || (ray.kbyj * box.hi.y - box.lo.z + ray.c_yz < 0)) { - return false; - } - - time = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - - case Ray::MOM: - { - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.z < box.lo.z) - || (ray.kbyi * box.lo.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.hi.x + ray.c_zx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - - case Ray::MOP: - { - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.z > box.hi.z) - || (ray.kbyi * box.lo.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.hi.x + ray.c_zx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::POM: - { - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.z < box.lo.z) - || (ray.kbyi * box.hi.x - box.hi.z + ray.c_xz > 0) - || (ray.ibyk * box.lo.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t2 = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - - case Ray::POP: - { - if((ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.z > box.hi.z) - || (ray.kbyi * box.hi.x - box.lo.z + ray.c_xz < 0) - || (ray.ibyk * box.hi.z - box.lo.x + ray.c_zx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t2 = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - if (t2 > time) { - time = t2; - } - - return true; - } - - case Ray::MMO: - { - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.y < box.lo.y) - || (ray.jbyi * box.lo.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.hi.x + ray.c_yx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - - return true; - } - - case Ray::MPO: - { - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.y > box.hi.y) - || (ray.jbyi * box.lo.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.hi.x + ray.c_yx > 0)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - - return true; - } - - - case Ray::PMO: - { - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.y < box.lo.y) - || (ray.jbyi * box.hi.x - box.hi.y + ray.c_xy > 0) - || (ray.ibyj * box.lo.y - box.lo.x + ray.c_yx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - - return true; - } - - case Ray::PPO: - { - if((ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z) - || (ray.m_origin.x > box.hi.x) || (ray.m_origin.y > box.hi.y) - || (ray.jbyi * box.hi.x - box.lo.y + ray.c_xy < 0) - || (ray.ibyj * box.hi.y - box.lo.x + ray.c_yx < 0)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - float t1 = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - if (t1 > time) { - time = t1; - } - - return true; - } - - - case Ray::MOO: - { - if((ray.m_origin.x < box.lo.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z)) { - return false; - } - - time = (box.hi.x - ray.m_origin.x) * ray.m_invDirection.x; - return true; - } - - case Ray::POO: - { - if ((ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z)) { - return false; - } - - time = (box.lo.x - ray.m_origin.x) * ray.m_invDirection.x; - return true; - } - - case Ray::OMO: - { - if ((ray.m_origin.y < box.lo.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z)) { - return false; - } - - time = (box.hi.y - ray.m_origin.y) * ray.m_invDirection.y; - return true; - } - - case Ray::OPO: - { - if ((ray.m_origin.y > box.hi.y) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.z < box.lo.z) || (ray.m_origin.z > box.hi.z)) { - return false; - } - - time = (box.lo.y - ray.m_origin.y) * ray.m_invDirection.y; - return true; - } - - - case Ray::OOM: - { - if ((ray.m_origin.z < box.lo.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y)) { - return false; - } - - time = (box.hi.z - ray.m_origin.z) * ray.m_invDirection.z; - return true; - } - - case Ray::OOP: - { - if ((ray.m_origin.z > box.hi.z) - || (ray.m_origin.x < box.lo.x) || (ray.m_origin.x > box.hi.x) - || (ray.m_origin.y < box.lo.y) || (ray.m_origin.y > box.hi.y)) { - return false; - } - - time = (box.lo.z - ray.m_origin.z) * ray.m_invDirection.z; - return true; - } - } - - return false; -} - -#ifdef _MSC_VER -// Turn off fast floating-point optimizations -#pragma float_control( pop ) -#endif - -} diff --git a/dep/src/g3dlite/Makefile.am b/dep/src/g3dlite/Makefile.am deleted file mode 100644 index d37528b4c72..00000000000 --- a/dep/src/g3dlite/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ -## Modified for MaNGOS project -## -## Permission is hereby granted, free of charge, to any person obtaining a copy -## of this software and associated documentation files (the "Software"), to deal -## in the Software without restriction, including without limitation the rights -## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -## copies of the Software, and to permit persons to whom the Software is furnished -## to do so, subject to the following conditions: -## -## The above copyright notice and this permission notice shall be included in all -## copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -## WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -## Process this file with automake to produce Makefile.in - -## CPP flags for includes, defines, etc. -AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../../include -I$(srcdir)/../../include/g3dlite - -noinst_LIBRARIES = libg3dlite.a -libg3dlite_a_SOURCES = \ - AABox.cpp \ - Box.cpp \ - Crypto.cpp \ - format.cpp \ - Matrix3.cpp \ - Plane.cpp \ - System.cpp \ - Triangle.cpp \ - Vector3.cpp \ - Vector4.cpp \ - debugAssert.cpp \ - fileutils.cpp \ - g3dmath.cpp \ - g3dfnmatch.cpp \ - prompt.cpp \ - stringutils.cpp \ - Any.cpp \ - BinaryFormat.cpp \ - BinaryInput.cpp \ - BinaryOutput.cpp \ - Capsule.cpp \ - CollisionDetection.cpp \ - CoordinateFrame.cpp \ - Cylinder.cpp \ - Line.cpp \ - LineSegment.cpp \ - Log.cpp \ - Matrix4.cpp \ - MemoryManager.cpp \ - Quat.cpp \ - Random.cpp \ - Ray.cpp \ - ReferenceCount.cpp \ - Sphere.cpp \ - TextInput.cpp \ - TextOutput.cpp \ - UprightFrame.cpp \ - Vector2.cpp - -EXTRA_DIST = \ - license.html - - diff --git a/dep/src/g3dlite/Matrix.cpp b/dep/src/g3dlite/Matrix.cpp deleted file mode 100644 index 7a668e59e2c..00000000000 --- a/dep/src/g3dlite/Matrix.cpp +++ /dev/null @@ -1,1802 +0,0 @@ -/** - @file Matrix.cpp - @author Morgan McGuire, http://graphics.cs.williams.edu - */ -#include "G3D/Matrix.h" -#include "G3D/TextOutput.h" - -static inline G3D::Matrix::T negate(G3D::Matrix::T x) { - return -x; -} - -namespace G3D { - -int Matrix::debugNumCopyOps = 0; -int Matrix::debugNumAllocOps = 0; - -void Matrix::serialize(TextOutput& t) const { - t.writeSymbol("%"); - t.writeNumber(rows()); - t.writeSymbol("x"); - t.writeNumber(cols()); - t.pushIndent(); - t.writeNewline(); - - t.writeSymbol("["); - for (int r = 0; r < rows(); ++r) { - for (int c = 0; c < cols(); ++c) { - t.writeNumber(impl->get(r, c)); - if (c < cols() - 1) { - t.writeSymbol(","); - } else { - if (r < rows() - 1) { - t.writeSymbol(";"); - t.writeNewline(); - } - } - } - } - t.writeSymbol("]"); - t.popIndent(); - t.writeNewline(); -} - - -std::string Matrix::toString(const std::string& name) const { - std::string s; - - if (name != "") { - s += format("%s = \n", name.c_str()); - } - - s += "["; - for (int r = 0; r < rows(); ++r) { - for (int c = 0; c < cols(); ++c) { - double v = impl->get(r, c); - - if (::fabs(v) < 0.00001) { - // Don't print "negative zero" - s += format("% 10.04g", 0.0); - } else if (v == iRound(v)) { - // Print integers nicely - s += format("% 10.04g", v); - } else { - s += format("% 10.04f", v); - } - - if (c < cols() - 1) { - s += ","; - } else if (r < rows() - 1) { - s += ";\n "; - } else { - s += "]\n"; - } - } - } - return s; -} - - -#define INPLACE(OP)\ - ImplRef A = impl;\ -\ - if (! A.isLastReference()) {\ - impl = new Impl(A->R, A->C);\ - }\ -\ - A->OP(B, *impl); - -Matrix& Matrix::operator*=(const T& B) { - INPLACE(mul) - return *this; -} - - -Matrix& Matrix::operator-=(const T& B) { - INPLACE(sub) - return *this; -} - - -Matrix& Matrix::operator+=(const T& B) { - INPLACE(add) - return *this; -} - - -Matrix& Matrix::operator/=(const T& B) { - INPLACE(div) - return *this; -} - - -Matrix& Matrix::operator*=(const Matrix& B) { - // We can't optimize this one - *this = *this * B; - return *this; -} - - -Matrix& Matrix::operator-=(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(sub) - return *this; -} - - -Matrix& Matrix::operator+=(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(add) - return *this; -} - - -void Matrix::arrayMulInPlace(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(arrayMul) -} - - -void Matrix::arrayDivInPlace(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(arrayDiv) -} - -#undef INPLACE - -Matrix Matrix::fromDiagonal(const Matrix& d) { - debugAssert((d.rows() == 1) || (d.cols() == 1)); - - int n = d.numElements(); - Matrix D = zero(n, n); - for (int i = 0; i < n; ++i) { - D.set(i, i, d.impl->data[i]); - } - - return D; -} - -void Matrix::set(int r, int c, T v) { - if (! impl.isLastReference()) { - // Copy the data before mutating; this object is shared - impl = new Impl(*impl); - } - impl->set(r, c, v); -} - - -void Matrix::setRow(int r, const Matrix& vec) { - debugAssertM(vec.cols() == cols(), - "A row must be set to a vector of the same size."); - debugAssertM(vec.rows() == 1, - "A row must be set to a row vector."); - - debugAssert(r >= 0); - debugAssert(r < rows()); - - if (! impl.isLastReference()) { - // Copy the data before mutating; this object is shared - impl = new Impl(*impl); - } - impl->setRow(r, vec.impl->data); -} - - -void Matrix::setCol(int c, const Matrix& vec) { - debugAssertM(vec.rows() == rows(), - "A column must be set to a vector of the same size."); - debugAssertM(vec.cols() == 1, - "A column must be set to a column vector."); - - debugAssert(c >= 0); - - debugAssert(c < cols()); - - if (! impl.isLastReference()) { - // Copy the data before mutating; this object is shared - impl = new Impl(*impl); - } - impl->setCol(c, vec.impl->data); -} - - -Matrix::T Matrix::get(int r, int c) const { - return impl->get(r, c); -} - - -Matrix Matrix::row(int r) const { - debugAssert(r >= 0); - debugAssert(r < rows()); - Matrix out(1, cols()); - out.impl->setRow(1, impl->elt[r]); - return out; -} - - -Matrix Matrix::col(int c) const { - debugAssert(c >= 0); - debugAssert(c < cols()); - Matrix out(rows(), 1); - - T* outData = out.impl->data; - // Get a pointer to the first element in the column - const T* inElt = &(impl->elt[0][c]); - int R = rows(); - int C = cols(); - for (int r = 0; r < R; ++r) { - outData[r] = *inElt; - // Skip around to the next row - inElt += C; - } - - return out; -} - - -Matrix Matrix::zero(int R, int C) { - Impl* A = new Impl(R, C); - A->setZero(); - return Matrix(A); -} - - -Matrix Matrix::one(int R, int C) { - Impl* A = new Impl(R, C); - for (int i = R * C - 1; i >= 0; --i) { - A->data[i] = 1.0; - } - return Matrix(A); -} - - -Matrix Matrix::random(int R, int C) { - Impl* A = new Impl(R, C); - for (int i = R * C - 1; i >= 0; --i) { - A->data[i] = G3D::uniformRandom(0.0, 1.0); - } - return Matrix(A); -} - - -Matrix Matrix::identity(int N) { - Impl* m = new Impl(N, N); - m->setZero(); - for (int i = 0; i < N; ++i) { - m->elt[i][i] = 1.0; - } - return Matrix(m); -} - - -// Implement an explicit-output unary method by trampolining to the impl -#define TRAMPOLINE_EXPLICIT_1(method)\ -void Matrix::method(Matrix& out) const {\ - if ((out.impl == impl) && impl.isLastReference()) {\ - impl->method(*out.impl);\ - } else {\ - out = this->method();\ - }\ -} - -TRAMPOLINE_EXPLICIT_1(abs) -TRAMPOLINE_EXPLICIT_1(negate) -TRAMPOLINE_EXPLICIT_1(arrayLog) -TRAMPOLINE_EXPLICIT_1(arrayExp) -TRAMPOLINE_EXPLICIT_1(arrayCos) -TRAMPOLINE_EXPLICIT_1(arraySin) - -void Matrix::mulRow(int r, const T& v) { - debugAssert(r >= 0 && r < rows()); - - if (! impl.isLastReference()) { - impl = new Impl(*impl); - } - - impl->mulRow(r, v); -} - - -void Matrix::transpose(Matrix& out) const { - if ((out.impl == impl) && impl.isLastReference() && (impl->R == impl->C)) { - // In place - impl->transpose(*out.impl); - } else { - out = this->transpose(); - } -} - - -Matrix3 Matrix::toMatrix3() const { - debugAssert(impl->R == 3); - debugAssert(impl->C == 3); - return Matrix3( - impl->get(0,0), impl->get(0,1), impl->get(0,2), - impl->get(1,0), impl->get(1,1), impl->get(1,2), - impl->get(2,0), impl->get(2,1), impl->get(2,2)); -} - - -Matrix4 Matrix::toMatrix4() const { - debugAssert(impl->R == 4); - debugAssert(impl->C == 4); - return Matrix4( - impl->get(0,0), impl->get(0,1), impl->get(0,2), impl->get(0,3), - impl->get(1,0), impl->get(1,1), impl->get(1,2), impl->get(1,3), - impl->get(2,0), impl->get(2,1), impl->get(2,2), impl->get(2,3), - impl->get(3,0), impl->get(3,1), impl->get(3,2), impl->get(3,3)); -} - - -Vector2 Matrix::toVector2() const { - debugAssert(impl->R * impl->C == 2); - if (impl->R > impl->C) { - return Vector2(impl->get(0,0), impl->get(1,0)); - } else { - return Vector2(impl->get(0,0), impl->get(0,1)); - } -} - - -Vector3 Matrix::toVector3() const { - debugAssert(impl->R * impl->C == 3); - if (impl->R > impl->C) { - return Vector3(impl->get(0,0), impl->get(1,0), impl->get(2, 0)); - } else { - return Vector3(impl->get(0,0), impl->get(0,1), impl->get(0, 2)); - } -} - - -Vector4 Matrix::toVector4() const { - debugAssert( - ((impl->R == 4) && (impl->C == 1)) || - ((impl->R == 1) && (impl->C == 4))); - - if (impl->R > impl->C) { - return Vector4(impl->get(0,0), impl->get(1,0), impl->get(2, 0), impl->get(3,0)); - } else { - return Vector4(impl->get(0,0), impl->get(0,1), impl->get(0, 2), impl->get(0,3)); - } -} - - -void Matrix::swapRows(int r0, int r1) { - debugAssert(r0 >= 0 && r0 < rows()); - debugAssert(r1 >= 0 && r1 < rows()); - - if (r0 == r1) { - return; - } - - if (! impl.isLastReference()) { - impl = new Impl(*impl); - } - - impl->swapRows(r0, r1); -} - - -void Matrix::swapAndNegateCols(int c0, int c1) { - debugAssert(c0 >= 0 && c0 < cols()); - debugAssert(c1 >= 0 && c1 < cols()); - - if (c0 == c1) { - return; - } - - if (! impl.isLastReference()) { - impl = new Impl(*impl); - } - - impl->swapAndNegateCols(c0, c1); -} - -Matrix Matrix::subMatrix(int r1, int r2, int c1, int c2) const { - debugAssert(r2>=r1); - debugAssert(c2>=c1); - debugAssert(c2=0); - debugAssert(c1>=0); - - Matrix X(r2 - r1 + 1, c2 - c1 + 1); - - for (int r = 0; r < X.rows(); ++r) { - for (int c = 0; c < X.cols(); ++c) { - X.set(r, c, get(r + r1, c + c1)); - } - } - - return X; -} - - -bool Matrix::anyNonZero() const { - return impl->anyNonZero(); -} - - -bool Matrix::allNonZero() const { - return impl->allNonZero(); -} - - -void Matrix::svd(Matrix& U, Array& d, Matrix& V, bool sort) const { - debugAssert(rows() >= cols()); - debugAssertM(&U != &V, "Arguments to SVD must be different matrices"); - debugAssertM(&U != this, "Arguments to SVD must be different matrices"); - debugAssertM(&V != this, "Arguments to SVD must be different matrices"); - - int R = rows(); - int C = cols(); - - // Make sure we don't overwrite a shared matrix - if (! V.impl.isLastReference()) { - V = Matrix::zero(C, C); - } else { - V.impl->setSize(C, C); - } - - if (&U != this || ! impl.isLastReference()) { - // Make a copy of this for in-place SVD - U.impl = new Impl(*impl); - } - - d.resize(C); - const char* ret = svdCore(U.impl->elt, R, C, d.getCArray(), V.impl->elt); - - debugAssertM(ret == NULL, ret); - (void)ret; - - if (sort) { - // Sort the singular values from greatest to least - - Array rank; - rank.resize(C); - for (int c = 0; c < C; ++c) { - rank[c].col = c; - rank[c].value = d[c]; - } - - rank.sort(SORT_INCREASING); - - Matrix Uold = U; - Matrix Vold = V; - - U = Matrix(U.rows(), U.cols()); - V = Matrix(V.rows(), V.cols()); - - // Now permute U, d, and V appropriately - for (int c0 = 0; c0 < C; ++c0) { - const int c1 = rank[c0].col; - - d[c0] = rank[c0].value; - U.setCol(c0, Uold.col(c1)); - V.setCol(c0, Vold.col(c1)); - } - - } -} - - -#define COMPARE_SCALAR(OP)\ -Matrix Matrix::operator OP (const T& scalar) const {\ - int R = rows();\ - int C = cols();\ - int N = R * C;\ - Matrix out = Matrix::zero(R, C);\ -\ - const T* raw = impl->data;\ - T* outRaw = out.impl->data;\ - for (int i = 0; i < N; ++i) {\ - outRaw[i] = raw[i] OP scalar;\ - }\ -\ - return out;\ -} - -COMPARE_SCALAR(<) -COMPARE_SCALAR(<=) -COMPARE_SCALAR(>) -COMPARE_SCALAR(>=) -COMPARE_SCALAR(==) -COMPARE_SCALAR(!=) - -#undef COMPARE_SCALAR - -double Matrix::normSquared() const { - int R = rows(); - int C = cols(); - int N = R * C; - - double sum = 0.0; - - const T* raw = impl->data; - for (int i = 0; i < N; ++i) { - sum += square(raw[i]); - } - - return sum; -} - -double Matrix::norm() const { - return sqrt(normSquared()); -} - -/////////////////////////////////////////////////////////// - -Matrix::Impl::Impl(const Matrix3& M) : elt(NULL), data(NULL), R(0), C(0), dataSize(0){ - setSize(3, 3); - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - set(r, c, M[r][c]); - } - } - -} - - -Matrix::Impl::Impl(const Matrix4& M): elt(NULL), data(NULL), R(0), C(0), dataSize(0) { - setSize(4, 4); - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - set(r, c, M[r][c]); - } - } -} - - -void Matrix::Impl::setSize(int newRows, int newCols) { - if ((R == newRows) && (C == newCols)) { - // Nothing to do - return; - } - - int newSize = newRows * newCols; - - R = newRows; C = newCols; - - // Only allocate if we need more space - // or the size difference is ridiculous - if ((newSize > dataSize) || (newSize < dataSize / 4)) { - System::alignedFree(data); - data = (float*)System::alignedMalloc(R * C * sizeof(T), 16); - ++Matrix::debugNumAllocOps; - dataSize = newSize; - } - - // Construct the row pointers - //delete[] elt; - System::free(elt); - elt = (T**)System::malloc(R * sizeof(T*));// new T*[R]; - - for (int r = 0; r < R; ++ r) { - elt[r] = data + r * C; - } -} - - -Matrix::Impl::~Impl() { - //delete[] elt; - System::free(elt); - System::alignedFree(data); -} - - -Matrix::Impl& Matrix::Impl::operator=(const Impl& m) { - setSize(m.R, m.C); - System::memcpy(data, m.data, R * C * sizeof(T)); - ++Matrix::debugNumCopyOps; - return *this; -} - - -void Matrix::Impl::setZero() { - System::memset(data, 0, R * C * sizeof(T)); -} - - -void Matrix::Impl::swapRows(int r0, int r1) { - T* R0 = elt[r0]; - T* R1 = elt[r1]; - - for (int c = 0; c < C; ++c) { - T temp = R0[c]; - R0[c] = R1[c]; - R1[c] = temp; - } -} - - -void Matrix::Impl::swapAndNegateCols(int c0, int c1) { - for (int r = 0; r < R; ++r) { - T* row = elt[r]; - - const T temp = -row[c0]; - row[c0] = -row[c1]; - row[c1] = temp; - } -} - - -void Matrix::Impl::mulRow(int r, const T& v) { - T* row = elt[r]; - - for (int c = 0; c < C; ++c) { - row[c] *= v; - } -} - - -void Matrix::Impl::mul(const Impl& B, Impl& out) const { - const Impl& A = *this; - - debugAssertM( - (this != &out) && (&B != &out), - "Output argument to mul cannot be the same as an input argument."); - - debugAssert(A.C == B.R); - debugAssert(A.R == out.R); - debugAssert(B.C == out.C); - - for (int r = 0; r < out.R; ++r) { - for (int c = 0; c < out.C; ++c) { - T sum = 0.0; - for (int i = 0; i < A.C; ++i) { - sum += A.get(r, i) * B.get(i, c); - } - out.set(r, c, sum); - } - } -} - - -// We're about to define several similar methods, -// so use a macro to share implementations. This -// must be a macro because the difference between -// the macros is the operation in the inner loop. -#define IMPLEMENT_ARRAY_2(method, OP)\ -void Matrix::Impl::method(const Impl& B, Impl& out) const {\ - const Impl& A = *this;\ - \ - debugAssert(A.C == B.C);\ - debugAssert(A.R == B.R);\ - debugAssert(A.C == out.C);\ - debugAssert(A.R == out.R);\ - \ - for (int i = R * C - 1; i >= 0; --i) {\ - out.data[i] = A.data[i] OP B.data[i];\ - }\ -} - - -#define IMPLEMENT_ARRAY_1(method, f)\ -void Matrix::Impl::method(Impl& out) const {\ - const Impl& A = *this;\ - \ - debugAssert(A.C == out.C);\ - debugAssert(A.R == out.R);\ - \ - for (int i = R * C - 1; i >= 0; --i) {\ - out.data[i] = f(A.data[i]);\ - }\ -} - - -#define IMPLEMENT_ARRAY_SCALAR(method, OP)\ -void Matrix::Impl::method(Matrix::T B, Impl& out) const {\ - const Impl& A = *this;\ - \ - debugAssert(A.C == out.C);\ - debugAssert(A.R == out.R);\ - \ - for (int i = R * C - 1; i >= 0; --i) {\ - out.data[i] = A.data[i] OP B;\ - }\ -} - -IMPLEMENT_ARRAY_2(add, +) -IMPLEMENT_ARRAY_2(sub, -) -IMPLEMENT_ARRAY_2(arrayMul, *) -IMPLEMENT_ARRAY_2(arrayDiv, /) - -IMPLEMENT_ARRAY_SCALAR(add, +) -IMPLEMENT_ARRAY_SCALAR(sub, -) -IMPLEMENT_ARRAY_SCALAR(mul, *) -IMPLEMENT_ARRAY_SCALAR(div, /) - -IMPLEMENT_ARRAY_1(abs, ::fabs) -IMPLEMENT_ARRAY_1(negate, ::negate) -IMPLEMENT_ARRAY_1(arrayLog, ::log) -IMPLEMENT_ARRAY_1(arraySqrt, ::sqrt) -IMPLEMENT_ARRAY_1(arrayExp, ::exp) -IMPLEMENT_ARRAY_1(arrayCos, ::cos) -IMPLEMENT_ARRAY_1(arraySin, ::sin) - -#undef IMPLEMENT_ARRAY_SCALAR -#undef IMPLEMENT_ARRAY_1 -#undef IMPLEMENT_ARRAY_2 - -// lsub is special because the argument order is reversed -void Matrix::Impl::lsub(Matrix::T B, Impl& out) const { - const Impl& A = *this; - - debugAssert(A.C == out.C); - debugAssert(A.R == out.R); - - for (int i = R * C - 1; i >= 0; --i) { - out.data[i] = B - A.data[i]; - } -} - - -void Matrix::Impl::inverseViaAdjoint(Impl& out) const { - debugAssert(&out != this); - - // Inverse = adjoint / determinant - - adjoint(out); - - // Don't call the determinant method when we already have an - // adjoint matrix; there's a faster way of computing it: the dot - // product of the first row and the adjoint's first col. - double det = 0.0; - for (int r = R - 1; r >= 0; --r) { - det += elt[0][r] * out.elt[r][0]; - } - - out.div(Matrix::T(det), out); -} - - -void Matrix::Impl::transpose(Impl& out) const { - debugAssert(out.R == C); - debugAssert(out.C == R); - - if (&out == this) { - // Square matrix in place - for (int r = 0; r < R; ++r) { - for (int c = r + 1; c < C; ++c) { - T temp = get(r, c); - out.set(r, c, get(c, r)); - out.set(c, r, temp); - } - } - } else { - for (int r = 0; r < R; ++r) { - for (int c = 0; c < C; ++c) { - out.set(c, r, get(r, c)); - } - } - } -} - - -void Matrix::Impl::adjoint(Impl& out) const { - cofactor(out); - // Transpose is safe to perform in place - out.transpose(out); -} - - -void Matrix::Impl::cofactor(Impl& out) const { - debugAssert(&out != this); - for(int r = 0; r < R; ++r) { - for(int c = 0; c < C; ++c) { - out.set(r, c, cofactor(r, c)); - } - } -} - - -Matrix::T Matrix::Impl::cofactor(int r, int c) const { - // Strang p. 217 - float s = isEven(r + c) ? 1.0f : -1.0f; - - return s * determinant(r, c); -} - - -Matrix::T Matrix::Impl::determinant(int nr, int nc) const { - debugAssert(R > 0); - debugAssert(C > 0); - Impl A(R - 1, C - 1); - withoutRowAndCol(nr, nc, A); - return A.determinant(); -} - - -void Matrix::Impl::setRow(int r, const T* vals) { - debugAssert(r >= 0); - System::memcpy(elt[r], vals, sizeof(T) * C); -} - - -void Matrix::Impl::setCol(int c, const T* vals) { - for (int r = 0; r < R; ++r) { - elt[r][c] = vals[r]; - } -} - - -Matrix::T Matrix::Impl::determinant() const { - - debugAssert(R == C); - - // Compute using cofactors - switch(R) { - case 0: - return 0; - - case 1: - // Determinant of a 1x1 is the element - return elt[0][0]; - - case 2: - // Determinant of a 2x2 is ad-bc - return elt[0][0] * elt[1][1] - elt[0][1] * elt[1][0]; - - case 3: - { - // Determinant of an nxn matrix is the dot product of the first - // row with the first row of cofactors. The base cases of this - // method get called a lot, so we spell out the implementation - // for the 3x3 case. - - float cofactor00 = elt[1][1] * elt[2][2] - elt[1][2] * elt[2][1]; - float cofactor10 = elt[1][2] * elt[2][0] - elt[1][0] * elt[2][2]; - float cofactor20 = elt[1][0] * elt[2][1] - elt[1][1] * elt[2][0]; - - return Matrix::T( - elt[0][0] * cofactor00 + - elt[0][1] * cofactor10 + - elt[0][2] * cofactor20); - } - - default: - { - // Determinant of an n x n matrix is the dot product of the first - // row with the first row of cofactors - T det = 0; - - for (int c = 0; c < C; ++c) { - det += elt[0][c] * cofactor(0, c); - } - - return det; - } - } -} - - -void Matrix::Impl::withoutRowAndCol(int excludeRow, int excludeCol, Impl& out) const { - debugAssert(out.R == R - 1); - debugAssert(out.C == C - 1); - - for (int r = 0; r < out.R; ++r) { - for (int c = 0; c < out.C; ++c) { - out.elt[r][c] = elt[r + ((r >= excludeRow) ? 1 : 0)][c + ((c >= excludeCol) ? 1 : 0)]; - } - } -} - - -Matrix Matrix::pseudoInverse(float tolerance) const { - if ((cols() == 1) || (rows() == 1)) { - return vectorPseudoInverse(); - } else if ((cols() <= 4) || (rows() <= 4)) { - return partitionPseudoInverse(); - } else { - return svdPseudoInverse(tolerance); - } -} - -/* - Public function for testing purposes only. Use pseudoInverse(), as it contains optimizations for - nonsingular matrices with at least one small (<5) dimension. -*/ -Matrix Matrix::svdPseudoInverse(float tolerance) const { - if (cols() > rows()) { - return transpose().svdPseudoInverse(tolerance).transpose(); - } - - // Matrices from SVD - Matrix U, V; - - // Diagonal elements - Array d; - - svd(U, d, V); - - if (rows() == 1) { - d.resize(1, false); - } - - if (tolerance < 0) { - // TODO: Should be eps(d[0]), which is the largest diagonal - tolerance = G3D::max(rows(), cols()) * 0.0001f; - } - - Matrix X; - - int r = 0; - for (int i = 0; i < d.size(); ++i) { - if (d[i] > tolerance) { - d[i] = Matrix::T(1) / d[i]; - ++r; - } - } - - if (r == 0) { - // There were no non-zero elements - X = zero(cols(), rows()); - } else { - // Use the first r columns - - // Test code (the rest is below) - /* - d.resize(r); - Matrix testU = U.subMatrix(0, U.rows() - 1, 0, r - 1); - Matrix testV = V.subMatrix(0, V.rows() - 1, 0, r - 1); - Matrix testX = testV * Matrix::fromDiagonal(d) * testU.transpose(); - X = testX; - */ - - - // We want to do this: - // - // d.resize(r); - // U = U.subMatrix(0, U.rows() - 1, 0, r - 1); - // X = V * Matrix::fromDiagonal(d) * U.transpose(); - // - // but creating a large diagonal matrix and then - // multiplying by it is wasteful. So we instead - // explicitly perform A = (D * U')' = U * D, and - // then multiply X = V * A'. - - Matrix A = Matrix(U.rows(), r); - - const T* dPtr = d.getCArray(); - for (int i = 0; i < A.rows(); ++i) { - const T* Urow = U.impl->elt[i]; - T* Arow = A.impl->elt[i]; - const int Acols = A.cols(); - for (int j = 0; j < Acols; ++j) { - // A(i,j) = U(i,:) * D(:,j) - // This is non-zero only at j = i because D is diagonal - // A(i,j) = U(i,j) * D(j,j) - Arow[j] = Urow[j] * dPtr[j]; - } - } - - // - // Compute X = V.subMatrix(0, V.rows() - 1, 0, r - 1) * A.transpose() - // - // Avoid the explicit subMatrix call, and by storing A' instead of A, avoid - // both the transpose and the memory incoherence of striding across memory - // in big steps. - - alwaysAssertM(A.cols() == r, - "Internal dimension mismatch during pseudoInverse()"); - alwaysAssertM(V.cols() >= r, - "Internal dimension mismatch during pseudoInverse()"); - - X = Matrix(V.rows(), A.rows()); - T** Xelt = X.impl->elt; - for (int i = 0; i < X.rows(); ++i) { - const T* Vrow = V.impl->elt[i]; - for (int j = 0; j < X.cols(); ++j) { - const T* Arow = A.impl->elt[j]; - T sum = 0; - for (int k = 0; k < r; ++k) { - sum += Vrow[k] * Arow[k]; - } - Xelt[i][j] = sum; - } - } - - /* - // Test that results are the same after optimizations: - Matrix diff = X - testX; - T n = diff.norm(); - debugAssert(n < 0.0001); - */ - } - return X; -} - -// Computes pseudoinverse for a vector -Matrix Matrix::vectorPseudoInverse() const { - // If vector A has nonzero elements: transpose A, then divide each elt. by the squared norm - // If A is zero vector: transpose A - double x = 0.0; - - if (anyNonZero()) { - x = 1.0 / normSquared(); - } - - Matrix A(cols(), rows()); - T** Aelt = A.impl->elt; - for (int r = 0; r < rows(); ++r) { - const T* MyRow = impl->elt[r]; - for (int c = 0; c < cols(); ++c) { - Aelt[c][r] = T(MyRow[c] * x); - } - } - return Matrix(A); -} - - -Matrix Matrix::rowPartPseudoInverse() const{ - int m = rows(); - int n = cols(); - alwaysAssertM((m<=n),"Row-partitioned block matrix pseudoinverse requires Relt; - T** Belt = B.impl->elt; - for (int i = 0; i < m; ++i) { - const T* Arow = Aelt[i]; - for (int j = 0; j < m; ++j) { - const T* Brow = Aelt[j]; - T sum = 0; - for (int k = 0; k < n; ++k) { - sum += Arow[k] * Brow[k]; - } - Belt[i][j] = sum; - } - } - - // B has size m x m - switch (m) { - case 2: - return row2PseudoInverse(B); - - case 3: - return row3PseudoInverse(B); - - case 4: - return row4PseudoInverse(B); - - default: - alwaysAssertM(false, "G3D internal error: Should have used the vector or general case!"); - return Matrix(); - } -} - -Matrix Matrix::colPartPseudoInverse() const{ - int m = rows(); - int n = cols(); - alwaysAssertM((m>=n),"Column-partitioned block matrix pseudoinverse requires R>C"); - // TODO: Put each of the individual cases in its own helper function - // TODO: Push the B computation down into the individual cases - // B = A' * A - Matrix A = *this; - Matrix B = Matrix(n, n); - T** Aelt = A.impl->elt; - T** Belt = B.impl->elt; - for (int i = 0; i < n; ++i) { - for (int j = 0; j < n; ++j) { - T sum = 0; - for (int k = 0; k < m; ++k) { - sum += Aelt[k][i] * Aelt[k][j]; - } - Belt[i][j] = sum; - } - } - - // B has size n x n - switch (n) { - case 2: - return col2PseudoInverse(B); - - case 3: - return col3PseudoInverse(B); - - case 4: - return col4PseudoInverse(B); - - default: - alwaysAssertM(false, "G3D internal error: Should have used the vector or general case!"); - return Matrix(); - } -} - -Matrix Matrix::col2PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - (void)n; - - // Row-major 2x2 matrix - const float B2[2][2] = - {{B.get(0,0), B.get(0,1)}, - {B.get(1,0), B.get(1,1)}}; - - float det = (B2[0][0]*B2[1][1]) - (B2[0][1]*B2[1][0]); - - if (fuzzyEq(det, T(0))) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - // invert using formula at http://www.netsoc.tcd.ie/~jgilbert/maths_site/applets/algebra/matrix_inversion.html - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - float binv00 = B2[1][1]/det, binv01 = -B2[1][0]/det; - float binv10 = -B2[0][1]/det, binv11 = B2[0][0]/det; - for (int j = 0; j < m; ++j) { - const T* Arow = Aelt[j]; - float a0 = Arow[0]; - float a1 = Arow[1]; - Xelt[0][j] = binv00 * a0 + binv01 * a1; - Xelt[1][j] = binv10 * a0 + binv11 * a1; - } - return X; - } -} - -Matrix Matrix::col3PseudoInverse(const Matrix& B) const { - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix3 B3 = B.toMatrix3(); - if (fuzzyEq(B3.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix3 B3inv = B3.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - const T* Arow = Aelt[j]; - T sum = 0; - const float* Binvrow = B3inv[i]; - for (int k = 0; k < n; ++k) { - sum += Binvrow[k] * Arow[k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -Matrix Matrix::col4PseudoInverse(const Matrix& B) const { - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix4 B4 = B.toMatrix4(); - if (fuzzyEq(B4.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix4 B4inv = B4.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - const T* Arow = Aelt[j]; - T sum = 0; - const float* Binvrow = B4inv[i]; - for (int k = 0; k < n; ++k) { - sum += Binvrow[k] * Arow[k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -Matrix Matrix::row2PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - (void)m; - - // Row-major 2x2 matrix - const float B2[2][2] = - {{B.get(0,0), B.get(0,1)}, - {B.get(1,0), B.get(1,1)}}; - - float det = (B2[0][0]*B2[1][1]) - (B2[0][1]*B2[1][0]); - - if (fuzzyEq(det, T(0))) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - // invert using formula at http://www.netsoc.tcd.ie/~jgilbert/maths_site/applets/algebra/matrix_inversion.html - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - float binv00 = B2[1][1]/det, binv01 = -B2[1][0]/det; - float binv10 = -B2[0][1]/det, binv11 = B2[0][0]/det; - for (int j = 0; j < n; ++j) { - Xelt[j][0] = Aelt[0][j] * binv00 + Aelt[1][j] * binv10; - Xelt[j][1] = Aelt[0][j] * binv01 + Aelt[1][j] * binv11; - } - return X; - } -} - -Matrix Matrix::row3PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix3 B3 = B.toMatrix3(); - if (fuzzyEq(B3.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix3 B3inv = B3.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - T sum = 0; - for (int k = 0; k < m; ++k) { - sum += Aelt[k][i] * B3inv[j][k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -Matrix Matrix::row4PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix4 B4 = B.toMatrix4(); - if (fuzzyEq(B4.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix4 B4inv = B4.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - T sum = 0; - for (int k = 0; k < m; ++k) { - sum += Aelt[k][i] * B4inv[j][k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -// Uses the block matrix pseudoinverse to compute the pseudoinverse of a full-rank mxn matrix with m >= n -// http://en.wikipedia.org/wiki/Block_matrix_pseudoinverse -Matrix Matrix::partitionPseudoInverse() const { - - // Logic: - // A^-1 = (A'A)^-1 A' - // A has few (n) columns, so A'A is small (n x n) and fast to invert - - int m = rows(); - int n = cols(); - - if (m < n) { - // TODO: optimize by pushing through the transpose - //return transpose().partitionPseudoInverse().transpose(); - return rowPartPseudoInverse(); - - } else { - return colPartPseudoInverse(); - } -} - -void Matrix::Impl::inverseInPlaceGaussJordan() { - debugAssertM(R == C, - format( - "Cannot perform Gauss-Jordan inverse on a non-square matrix." - " (Argument was %dx%d)", - R, C)); - - // Exchange to float elements -# define SWAP(x, y) {float temp = x; x = y; y = temp;} - - // The integer arrays pivot, rowIndex, and colIndex are - // used for bookkeeping on the pivoting - static Array colIndex, rowIndex, pivot; - - int col = 0, row = 0; - - colIndex.resize(R); - rowIndex.resize(R); - pivot.resize(R); - - static const int NO_PIVOT = -1; - - // Initialize the pivot array to default values. - for (int i = 0; i < R; ++i) { - pivot[i] = NO_PIVOT; - } - - // This is the main loop over the columns to be reduced - // Loop over the columns. - for (int c = 0; c < R; ++c) { - - // Find the largest element and use that as a pivot - float largestMagnitude = 0.0; - - // This is the outer loop of the search for a pivot element - for (int r = 0; r < R; ++r) { - - // Unless we've already found the pivot, keep going - if (pivot[r] != 0) { - - // Find the largest pivot - for (int k = 0; k < R; ++k) { - if (pivot[k] == NO_PIVOT) { - const float mag = fabs(elt[r][k]); - - if (mag >= largestMagnitude) { - largestMagnitude = mag; - row = r; col = k; - } - } - } - } - } - - pivot[col] += 1; - - // Interchange columns so that the pivot element is on the diagonal (we'll have to undo this - // at the end) - if (row != col) { - for (int k = 0; k < R; ++k) { - SWAP(elt[row][k], elt[col][k]) - } - } - - // The pivot is now at [row, col] - rowIndex[c] = row; - colIndex[c] = col; - - double piv = elt[col][col]; - - debugAssertM(piv != 0.0, "Matrix is singular"); - - // Divide everything by the pivot (avoid computing the division - // multiple times). - const double pivotInverse = 1.0 / piv; - elt[col][col] = 1.0; - - for (int k = 0; k < R; ++k) { - elt[col][k] *= Matrix::T(pivotInverse); - } - - // Reduce all rows - for (int r = 0; r < R; ++r) { - // Skip over the pivot row - if (r != col) { - - double oldValue = elt[r][col]; - elt[r][col] = 0.0; - - for (int k = 0; k < R; ++k) { - elt[r][k] -= Matrix::T(elt[col][k] * oldValue); - } - } - } - } - - - // Put the columns back in the correct locations - for (int i = R - 1; i >= 0; --i) { - if (rowIndex[i] != colIndex[i]) { - for (int k = 0; k < R; ++k) { - SWAP(elt[k][rowIndex[i]], elt[k][colIndex[i]]); - } - } - } - -# undef SWAP -} - - -bool Matrix::Impl::anyNonZero() const { - int N = R * C; - for (int i = 0; i < N; ++i) { - if (data[i] != 0.0) { - return true; - } - } - return false; -} - - -bool Matrix::Impl::allNonZero() const { - int N = R * C; - for (int i = 0; i < N; ++i) { - if (data[i] == 0.0) { - return false; - } - } - return true; -} - - -/** Helper for svdCore */ -static double pythag(double a, double b) { - - double at = fabs(a), bt = fabs(b), ct, result; - - if (at > bt) { - ct = bt / at; - result = at * sqrt(1.0 + square(ct)); - } else if (bt > 0.0) { - ct = at / bt; - result = bt * sqrt(1.0 + square(ct)); - } else { - result = 0.0; - } - - return result; -} - -#define SIGN(a, b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) - -const char* Matrix::svdCore(float** U, int rows, int cols, float* D, float** V) { - const int MAX_ITERATIONS = 30; - - int flag, i, its, j, jj, k, l = 0, nm = 0; - double c, f, h, s, x, y, z; - double anorm = 0.0, g = 0.0, scale = 0.0; - - // Temp row vector - double* rv1; - - debugAssertM(rows >= cols, "Must have more rows than columns"); - - rv1 = (double*)System::alignedMalloc(cols * sizeof(double), 16); - debugAssert(rv1); - - // Householder reduction to bidiagonal form - for (i = 0; i < cols; ++i) { - - // Left-hand reduction - l = i + 1; - rv1[i] = scale * g; - g = s = scale = 0.0; - - if (i < rows) { - - for (k = i; k < rows; ++k) { - scale += fabs((double)U[k][i]); - } - - if (scale) { - for (k = i; k < rows; ++k) { - U[k][i] = (float)((double)U[k][i]/scale); - s += ((double)U[k][i] * (double)U[k][i]); - } - - f = (double)U[i][i]; - - // TODO: what is this 2-arg sign function? - g = -SIGN(sqrt(s), f); - h = f * g - s; - U[i][i] = (float)(f - g); - - if (i != cols - 1) { - for (j = l; j < cols; j++) { - - for (s = 0.0, k = i; k < rows; ++k) { - s += ((double)U[k][i] * (double)U[k][j]); - } - - f = s / h; - for (k = i; k < rows; ++k) { - U[k][j] += (float)(f * (double)U[k][i]); - } - } - } - for (k = i; k < rows; ++k) { - U[k][i] = (float)((double)U[k][i]*scale); - } - } - } - D[i] = (float)(scale * g); - - // right-hand reduction - g = s = scale = 0.0; - if (i < rows && i != cols - 1) { - for (k = l; k < cols; ++k) { - scale += fabs((double)U[i][k]); - } - - if (scale) { - for (k = l; k < cols; ++k) { - U[i][k] = (float)((double)U[i][k]/scale); - s += ((double)U[i][k] * (double)U[i][k]); - } - - f = (double)U[i][l]; - g = -SIGN(sqrt(s), f); - h = f * g - s; - U[i][l] = (float)(f - g); - - for (k = l; k < cols; ++k) { - rv1[k] = (double)U[i][k] / h; - } - - if (i != rows - 1) { - - for (j = l; j < rows; ++j) { - for (s = 0.0, k = l; k < cols; ++k) { - s += ((double)U[j][k] * (double)U[i][k]); - } - - for (k = l; k < cols; ++k) { - U[j][k] += (float)(s * rv1[k]); - } - } - } - - for (k = l; k < cols; ++k) { - U[i][k] = (float)((double)U[i][k]*scale); - } - } - } - - anorm = max(anorm, fabs((double)D[i]) + fabs(rv1[i])); - } - - // accumulate the right-hand transformation - for (i = cols - 1; i >= 0; --i) { - if (i < cols - 1) { - if (g) { - for (j = l; j < cols; j++) { - V[j][i] = (float)(((double)U[i][j] / (double)U[i][l]) / g); - } - - // double division to avoid underflow - for (j = l; j < cols; ++j) { - for (s = 0.0, k = l; k < cols; k++) { - s += ((double)U[i][k] * (double)V[k][j]); - } - - for (k = l; k < cols; ++k) { - V[k][j] += (float)(s * (double)V[k][i]); - } - } - } - - for (j = l; j < cols; ++j) { - V[i][j] = V[j][i] = 0.0; - } - } - - V[i][i] = 1.0; - g = rv1[i]; - l = i; - } - - // accumulate the left-hand transformation - for (i = cols - 1; i >= 0; --i) { - l = i + 1; - g = (double)D[i]; - if (i < cols - 1) { - for (j = l; j < cols; ++j) { - U[i][j] = 0.0; - } - } - - if (g) { - g = 1.0 / g; - if (i != cols - 1) { - for (j = l; j < cols; ++j) { - for (s = 0.0, k = l; k < rows; ++k) { - s += ((double)U[k][i] * (double)U[k][j]); - } - - f = (s / (double)U[i][i]) * g; - - for (k = i; k < rows; ++k) { - U[k][j] += (float)(f * (double)U[k][i]); - } - } - } - - for (j = i; j < rows; ++j) { - U[j][i] = (float)((double)U[j][i]*g); - } - - } else { - for (j = i; j < rows; ++j) { - U[j][i] = 0.0; - } - } - ++U[i][i]; - } - - // diagonalize the bidiagonal form - for (k = cols - 1; k >= 0; --k) { - // loop over singular values - for (its = 0; its < MAX_ITERATIONS; ++its) { - // loop over allowed iterations - flag = 1; - - for (l = k; l >= 0; --l) { - // test for splitting - nm = l - 1; - if (fabs(rv1[l]) + anorm == anorm) { - flag = 0; - break; - } - - if (fabs((double)D[nm]) + anorm == anorm) { - break; - } - } - - if (flag) { - c = 0.0; - s = 1.0; - for (i = l; i <= k; ++i) { - f = s * rv1[i]; - if (fabs(f) + anorm != anorm) { - g = (double)D[i]; - h = pythag(f, g); - D[i] = (float)h; - h = 1.0 / h; - c = g * h; - s = (- f * h); - for (j = 0; j < rows; ++j) { - y = (double)U[j][nm]; - z = (double)U[j][i]; - U[j][nm] = (float)(y * c + z * s); - U[j][i] = (float)(z * c - y * s); - } - } - } - } - - z = (double)D[k]; - if (l == k) { - // convergence - if (z < 0.0) { - // make singular value nonnegative - D[k] = (float)(-z); - - for (j = 0; j < cols; ++j) { - V[j][k] = (-V[j][k]); - } - } - break; - } - - if (its >= MAX_ITERATIONS) { - free(rv1); - rv1 = NULL; - return "Failed to converge."; - } - - // shift from bottom 2 x 2 minor - x = (double)D[l]; - nm = k - 1; - y = (double)D[nm]; - g = rv1[nm]; - h = rv1[k]; - f = ((y - z) * (y + z) + (g - h) * (g + h)) / (2.0 * h * y); - g = pythag(f, 1.0); - f = ((x - z) * (x + z) + h * ((y / (f + SIGN(g, f))) - h)) / x; - - // next QR transformation - c = s = 1.0; - for (j = l; j <= nm; ++j) { - i = j + 1; - g = rv1[i]; - y = (double)D[i]; - h = s * g; - g = c * g; - z = pythag(f, h); - rv1[j] = z; - c = f / z; - s = h / z; - f = x * c + g * s; - g = g * c - x * s; - h = y * s; - y = y * c; - - for (jj = 0; jj < cols; ++jj) { - x = (double)V[jj][j]; - z = (double)V[jj][i]; - V[jj][j] = (float)(x * c + z * s); - V[jj][i] = (float)(z * c - x * s); - } - z = pythag(f, h); - D[j] = (float)z; - if (z) { - z = 1.0 / z; - c = f * z; - s = h * z; - } - f = (c * g) + (s * y); - x = (c * y) - (s * g); - for (jj = 0; jj < rows; jj++) { - y = (double)U[jj][j]; - z = (double)U[jj][i]; - U[jj][j] = (float)(y * c + z * s); - U[jj][i] = (float)(z * c - y * s); - } - } - rv1[l] = 0.0; - rv1[k] = f; - D[k] = (float)x; - } - } - - System::alignedFree(rv1); - rv1 = NULL; - - return NULL; -} - -#undef SIGN - -} diff --git a/dep/src/g3dlite/MeshAlg.cpp b/dep/src/g3dlite/MeshAlg.cpp deleted file mode 100644 index 626fed92920..00000000000 --- a/dep/src/g3dlite/MeshAlg.cpp +++ /dev/null @@ -1,637 +0,0 @@ -/** - @file MeshAlg.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2003-09-14 - @edited 2008-09-03 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - - */ - -#include "G3D/MeshAlg.h" -#include "G3D/Table.h" -#include "G3D/Set.h" -#include "G3D/Box.h" -#include "G3D/Sphere.h" -#include "G3D/vectorMath.h" -#include "G3D/AABox.h" -#include "G3D/Image1.h" - -#include - -namespace G3D { - -const int MeshAlg::Face::NONE = INT_MIN; - -void MeshAlg::generateGrid( - Array& vertex, - Array& texCoord, - Array& index, - int wCells, - int hCells, - const Vector2& textureScale, - bool spaceCentered, - bool twoSided, - const CoordinateFrame& xform, - const Image1::Ref& height) { - - vertex.fastClear(); - texCoord.fastClear(); - index.fastClear(); - - // Generate vertices - for (int z = 0; z <= hCells; ++z) { - for (int x = 0; x <= wCells; ++x) { - Vector3 v(x / (float)wCells, 0, z / (float)hCells); - - Vector2 t = v.xz() * textureScale; - - texCoord.append(t); - - if (height.notNull()) { - v.y = height->nearest(v.x * (height->width() - 1), v.z * (height->height() - 1)).value; - } - if (spaceCentered) { - v -= Vector3(0.5f, 0, 0.5f); - } - v = xform.pointToWorldSpace(v); - vertex.append(v); - } - } - - // Generate indices - for (int z = 0; z < hCells; ++z) { - for (int x = 0; x < wCells; ++x) { - int A = x + z * (wCells + 1); - int B = A + 1; - int C = A + (wCells + 1); - int D = C + 1; - - // A B - // *-----* - // | \ | - // | \ | - // *-----* - // C D - - index.append(A, D, B); - index.append(A, C, D); - } - } - - if (twoSided) { - // The index array needs to have reversed winding for the bottom - // and offset by the original number of vertices - Array ti = index; - ti.reverse(); - for (int i = 0; i < ti.size(); ++i) { - ti[i] += vertex.size(); - } - index.append(ti); - - // Duplicate the arrays - vertex.append(Array(vertex)); - texCoord.append(Array(texCoord)); - } -} - -MeshAlg::Face::Face() { - for (int i = 0; i < 3; ++i) { - edgeIndex[i] = 0; - vertexIndex[i] = 0; - } -} - - -MeshAlg::Edge::Edge() { - for (int i = 0; i < 2; ++i) { - vertexIndex[i] = 0; - // Negative face indices are faces that don't exist - faceIndex[i] = -1; - } -} - - -MeshAlg::Geometry& MeshAlg::Geometry::operator=(const MeshAlg::Geometry& src) { - vertexArray.resize(src.vertexArray.size()); - normalArray.resize(src.vertexArray.size()); - - System::memcpy(vertexArray.getCArray(), src.vertexArray.getCArray(), sizeof(Vector3)*vertexArray.size()); - System::memcpy(normalArray.getCArray(), src.normalArray.getCArray(), sizeof(Vector3)*normalArray.size()); - - return *this; -} - - -void MeshAlg::computeNormals( - Geometry& geometry, - const Array& indexArray) { - - Array faceArray; - Array vertexArray; - Array edgeArray; - Array faceNormalArray; - - computeAdjacency(geometry.vertexArray, indexArray, faceArray, edgeArray, vertexArray); - - computeNormals(geometry.vertexArray, faceArray, vertexArray, - geometry.normalArray, faceNormalArray); -} - - -void MeshAlg::computeNormals( - const Array& vertexGeometry, - const Array& faceArray, - const Array< Array >& adjacentFaceArray, - Array& vertexNormalArray, - Array& faceNormalArray) { - - // Construct a fake vertex array for backwards compatibility - Array fakeVertexArray; - fakeVertexArray.resize(adjacentFaceArray.size()); - - for (int v = 0; v < adjacentFaceArray.size(); ++v) { - fakeVertexArray[v].faceIndex.resize(adjacentFaceArray[v].size()); - for (int i = 0; i < fakeVertexArray[v].faceIndex.size(); ++i) { - fakeVertexArray[v].faceIndex[i] = adjacentFaceArray[v][i]; - } - // We leave out the edges because they aren't used to compute normals - } - - computeNormals(vertexGeometry, faceArray, fakeVertexArray, - vertexNormalArray, faceNormalArray); -} - - -void MeshAlg::computeNormals( - const Array& vertexGeometry, - const Array& faceArray, - const Array& vertexArray, - Array& vertexNormalArray, - Array& faceNormalArray) { - - // Face normals (not unit length) - faceNormalArray.resize(faceArray.size()); - for (int f = 0; f < faceArray.size(); ++f) { - const Face& face = faceArray[f]; - - Vector3 vertex[3]; - for (int j = 0; j < 3; ++j) { - vertex[j] = vertexGeometry[face.vertexIndex[j]]; - debugAssert(vertex[j].isFinite()); - } - - faceNormalArray[f] = (vertex[1] - vertex[0]).cross(vertex[2] - vertex[0]); -# ifdef G3D_DEBUG - const Vector3& N = faceNormalArray[f]; - debugAssert(N.isFinite()); -# endif - } - - // Per-vertex normals, computed by averaging - vertexNormalArray.resize(vertexGeometry.size()); - for (int v = 0; v < vertexNormalArray.size(); ++v) { - Vector3 sum = Vector3::zero(); - for (int k = 0; k < vertexArray[v].faceIndex.size(); ++k) { - const int f = vertexArray[v].faceIndex[k]; - sum += faceNormalArray[f]; - } - vertexNormalArray[v] = sum.directionOrZero(); -# ifdef G3D_DEBUG - const Vector3& N = vertexNormalArray[v]; - debugAssert(N.isUnit() || N.isZero()); -# endif - } - - - for (int f = 0; f < faceArray.size(); ++f) { - faceNormalArray[f] = faceNormalArray[f].directionOrZero(); -# ifdef G3D_DEBUG - const Vector3& N = faceNormalArray[f]; - debugAssert(N.isUnit() || N.isZero()); -# endif - } - -} - - -void MeshAlg::computeFaceNormals( - const Array& vertexArray, - const Array& faceArray, - Array& faceNormals, - bool normalize) { - - faceNormals.resize(faceArray.size()); - - for (int f = 0; f < faceArray.size(); ++f) { - const MeshAlg::Face& face = faceArray[f]; - - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& v1 = vertexArray[face.vertexIndex[1]]; - const Vector3& v2 = vertexArray[face.vertexIndex[2]]; - - faceNormals[f] = (v1 - v0).cross(v2 - v0); - } - - if (normalize) { - for (int f = 0; f < faceArray.size(); ++f) { - faceNormals[f] = faceNormals[f].direction(); - } - } -} - - -void MeshAlg::identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& HP, - Array& backface) { - - Vector3 P = HP.xyz(); - - backface.resize(faceArray.size()); - - if (fuzzyEq(HP.w, 0.0)) { - // Infinite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const MeshAlg::Face& face = faceArray[f]; - - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& v1 = vertexArray[face.vertexIndex[1]]; - const Vector3& v2 = vertexArray[face.vertexIndex[2]]; - - const Vector3 N = (v1 - v0).cross(v2 - v0); - - backface[f] = N.dot(P) < 0; - } - } else { - // Finite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const MeshAlg::Face& face = faceArray[f]; - - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& v1 = vertexArray[face.vertexIndex[1]]; - const Vector3& v2 = vertexArray[face.vertexIndex[2]]; - - const Vector3 N = (v1 - v0).cross(v2 - v0); - - backface[f] = N.dot(P - v0) < 0; - } - } -} - - -void MeshAlg::identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& HP, - Array& backface, - const Array& faceNormals) { - - Vector3 P = HP.xyz(); - - backface.resize(faceArray.size()); - - if (fuzzyEq(HP.w, 0.0)) { - // Infinite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const Vector3& N = faceNormals[f]; - backface[f] = N.dot(P) < 0; - } - } else { - // Finite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const MeshAlg::Face& face = faceArray[f]; - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& N = faceNormals[f]; - - backface[f] = N.dot(P - v0) < 0; - } - } -} - - -void MeshAlg::createIndexArray(int n, Array& array, int start, int run, int skip) { - debugAssert(skip >= 0); - debugAssert(run >= 0); - - array.resize(n); - if (skip == 0) { - for (int i = 0; i < n; ++i) { - array[i] = start + i; - } - } else { - int rcount = 0; - int j = start; - for (int i = 0; i < n; ++i) { - array[i] = j; - - ++j; - ++rcount; - - if (rcount == run) { - rcount = 0; - j += skip; - } - } - } -} - - -void MeshAlg::computeAreaStatistics( - const Array& vertexArray, - const Array& indexArray, - double& minEdgeLength, - double& meanEdgeLength, - double& medianEdgeLength, - double& maxEdgeLength, - double& minFaceArea, - double& meanFaceArea, - double& medianFaceArea, - double& maxFaceArea) { - - debugAssert(indexArray.size() % 3 == 0); - - Array area; - area.resize(indexArray.size() / 3); - Array magnitude; - magnitude.resize(indexArray.size()); - - for (int i = 0; i < indexArray.size(); i += 3) { - const Vector3& v0 = vertexArray[indexArray[i]]; - const Vector3& v1 = vertexArray[indexArray[i + 1]]; - const Vector3& v2 = vertexArray[indexArray[i + 2]]; - - area[i / 3] = (v1 - v0).cross(v2 - v0).magnitude() / 2.0; - magnitude[i] = (v1 - v0).magnitude(); - magnitude[i + 1] = (v2 - v1).magnitude(); - magnitude[i + 2] = (v0 - v2).magnitude(); - } - - area.sort(); - magnitude.sort(); - - minEdgeLength = max(0.0, magnitude[0]); - maxEdgeLength = max(0.0, magnitude.last()); - medianEdgeLength = max(0.0, magnitude[magnitude.size() / 2]); - meanEdgeLength = 0; - for (int i = 0; i < magnitude.size(); ++i) { - meanEdgeLength += magnitude[i]; - } - meanEdgeLength /= magnitude.size(); - - minFaceArea = max(0.0, area[0]); - maxFaceArea = max(0.0, area.last()); - medianFaceArea = max(0.0, area[area.size() / 2]); - meanFaceArea = 0; - for (int i = 0; i < area.size(); ++i) { - meanFaceArea += area[i]; - } - meanFaceArea /= area.size(); - - - // Make sure round-off hasn't pushed values less than zero - meanFaceArea = max(0.0, meanFaceArea); - meanEdgeLength = max(0.0, meanEdgeLength); -} - - -int MeshAlg::countBoundaryEdges(const Array& edgeArray) { - int b = 0; - - for (int i = 0; i < edgeArray.size(); ++i) { - if ((edgeArray[i].faceIndex[0] == MeshAlg::Face::NONE) != - (edgeArray[i].faceIndex[1] == MeshAlg::Face::NONE)) { - ++b; - } - } - - return b; -} - -void MeshAlg::computeBounds( - const Array& vertexArray, - const Array& indexArray, - AABox& box, - Sphere& sphere) { - - Array newArray; - newArray.resize(indexArray.size()); - for (int i = 0; i < indexArray.size(); ++i) { - newArray[i] = vertexArray[indexArray[i]]; - } - computeBounds(newArray, box, sphere); -} - - -void MeshAlg::computeBounds( - const Array& vertexArray, - AABox& box, - Sphere& sphere) { - - Vector3 xmin, xmax, ymin, ymax, zmin, zmax; - - // FIRST PASS: find 6 minima/maxima points - xmin.x = ymin.y = zmin.z = finf(); - xmax.x = ymax.y = zmax.z = -finf(); - - for (int v = 0; v < vertexArray.size(); ++v) { - const Vector3& vertex = vertexArray[v]; - - if (vertex.x < xmin.x) { - xmin = vertex; - } - - if (vertex.x > xmax.x) { - xmax = vertex; - } - - if (vertex.y < ymin.y) { - ymin = vertex; - } - - if (vertex.y > ymax.y) { - ymax = vertex; - } - - if (vertex.z < zmin.z) { - zmin = vertex; - } - - if (vertex.z > zmax.z) { - zmax = vertex; - } - } - - // Set points dia1 & dia2 to the maximally separated pair - Vector3 dia1 = xmin; - Vector3 dia2 = xmax; - { - // Set xspan = distance between the 2 points xmin & xmax (squared) - double xspan = (xmax - xmin).squaredMagnitude(); - - // Same for y & z spans - double yspan = (ymax - ymin).squaredMagnitude(); - double zspan = (zmax - zmin).squaredMagnitude(); - - double maxspan = xspan; - - if (yspan > maxspan) { - maxspan = yspan; - dia1 = ymin; - dia2 = ymax; - } - - if (zspan > maxspan) { - maxspan = zspan; - dia1 = zmin; - dia2 = zmax; - } - } - - - // dia1, dia2 is a diameter of initial sphere - - // calc initial center - Vector3 center = (dia1 + dia2) / 2.0; - - // calculate initial radius^2 and radius - Vector3 d = dia2 - sphere.center; - - double radSq = d.squaredMagnitude(); - double rad = sqrt(radSq); - - // SECOND PASS: increment current sphere - double old_to_p, old_to_new; - - for (int v = 0; v < vertexArray.size(); ++v) { - const Vector3& vertex = vertexArray[v]; - - d = vertex - center; - - double old_to_p_sq = d.squaredMagnitude(); - - // do r^2 test first - if (old_to_p_sq > radSq) { - // this point is outside of current sphere - old_to_p = sqrt(old_to_p_sq); - - // calc radius of new sphere - rad = (rad + old_to_p) / 2.0; - - // for next r^2 compare - radSq = rad * rad; - old_to_new = old_to_p - rad; - - // calc center of new sphere - center = (rad * center + old_to_new * vertex) / old_to_p; - } - } - - const Vector3 min(xmin.x, ymin.y, zmin.z); - const Vector3 max(xmax.x, ymax.y, zmax.z); - - box = AABox(min, max); - - const float boxRadSq = (max - min).squaredMagnitude() * 0.25f; - - if (boxRadSq >= radSq){ - if (isNaN(center.x) || ! isFinite(rad)) { - sphere = Sphere(Vector3::zero(), finf()); - } else { - sphere = Sphere(center, rad); - } - } else { - sphere = Sphere((max + min) * 0.5f, sqrt(boxRadSq)); - } -} - -void MeshAlg::computeTangentSpaceBasis( - const Array& vertexArray, - const Array& texCoordArray, - const Array& vertexNormalArray, - const Array& faceArray, - Array& tangent, - Array& binormal) { - - debugAssertM(faceArray.size() != 0, "Unable to calculate valid tangent space without faces."); - - tangent.resize(vertexArray.size()); - binormal.resize(vertexArray.size()); - - // Zero the output arrays. - System::memset(tangent.getCArray(), 0, sizeof(Vector3) * tangent.size()); - System::memset(binormal.getCArray(), 0, sizeof(Vector3) * binormal.size()); - - // Iterate over faces, computing the tangent vectors for each - // vertex. Accumulate those into the tangent and binormal arrays - // and then orthonormalize at the end. - - for (int f = 0; f < faceArray.size(); ++f) { - const Face& face = faceArray[f]; - - const int i0 = face.vertexIndex[0]; - const int i1 = face.vertexIndex[1]; - const int i2 = face.vertexIndex[2]; - - const Vector3& v0 = vertexArray[i0]; - const Vector3& v1 = vertexArray[i1]; - const Vector3& v2 = vertexArray[i2]; - - const Vector2& t0 = texCoordArray[i0]; - const Vector2& t1 = texCoordArray[i1]; - const Vector2& t2 = texCoordArray[i2]; - - // See http://www.terathon.com/code/tangent.html for a derivation of the following code - - // vertex edges - Vector3 ve1 = v1 - v0; - Vector3 ve2 = v2 - v0; - - // texture edges - Vector2 te1 = t1 - t0; - Vector2 te2 = t2 - t0; - - Vector3 n(ve1.cross(ve2).direction()); - Vector3 t, b; - - float r = te1.x * te2.y - te1.y * te2.x; - if (r == 0.0) { - // degenerate case - Vector3::generateOrthonormalBasis(t, b, n, true); - } else { - r = 1.0f / r; - t = (te2.y * ve1 - te1.y * ve2) * r; - b = (te2.x * ve1 - te1.x * ve2) * r; - } - - for (int v = 0; v < 3; ++v) { - int i = face.vertexIndex[v]; - tangent[i] += t; - binormal[i] += b; - } - } - - // Normalize the basis vectors - for (int v = 0; v < vertexArray.size(); ++v) { - // Remove the component parallel to the normal - const Vector3& N = vertexNormalArray[v]; - Vector3& T = tangent[v]; - Vector3& B = binormal[v]; - - debugAssertM(N.isUnit() || N.isZero(), "Input normals must have unit length"); - - T -= T.dot(N) * N; - B -= B.dot(N) * N; - - // Normalize - T = T.directionOrZero(); - B = B.directionOrZero(); - } -} - - - -} // G3D namespace diff --git a/dep/src/g3dlite/MeshAlgAdjacency.cpp b/dep/src/g3dlite/MeshAlgAdjacency.cpp deleted file mode 100644 index 24b5d207c88..00000000000 --- a/dep/src/g3dlite/MeshAlgAdjacency.cpp +++ /dev/null @@ -1,739 +0,0 @@ -/** - @file MeshAlgAdjacency.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2003-09-14 - @edited 2009-04-26 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - - */ - -#include "G3D/Table.h" -#include "G3D/MeshAlg.h" -#include "G3D/Set.h" -#include "G3D/Stopwatch.h" -#include "G3D/SmallArray.h" - -namespace G3D { - -/** Two-level table mapping index 0 -> index 1 -> list of face indices */ -class MeshEdgeTable { -public: - - /** We expect 2 faces per edge. */ - typedef SmallArray FaceIndexArray; - - class Edge { - public: - int i1; - - FaceIndexArray faceIndexArray; - }; - - /** We expect at most 6 edges per vertex; that matches a typical regular grid mesh */ - typedef SmallArray EdgeArray; - - typedef Array< EdgeArray > ET; - -private: - - ET table; - -public: - - void clear() { - table.clear(); - } - - void resize(int maxV) { - table.resize(maxV); - } - - /** - Inserts the faceIndex into the edge's face list. - The index may be a negative number indicating a backface. - - \param v0 Vertex index 0 - \param v1 Vertex index 1 - */ - void insert(int v0, int v1, int faceIndex) { - - debugAssert(v0 <= v1); - EdgeArray& edgeArray = table[v0]; - for (int i = 0; i < edgeArray.size(); ++i) { - if (edgeArray[i].i1 == v1) { - edgeArray[i].faceIndexArray.push(faceIndex); - return; - } - } - - Edge& p = edgeArray.next(); - p.i1 = v1; - p.faceIndexArray.push(faceIndex); - } - - class Iterator { - friend class MeshEdgeTable; - private: - - int m_i0; - /** Pair index */ - int m_p; - ET& m_array; - EdgeArray* m_edgeArray; - bool m_end; - - public: - - int i0() const { - return m_i0; - } - - int i1() const { - return (*m_edgeArray)[m_p].i1; - } - - FaceIndexArray& faceIndex() { - return (*m_edgeArray)[m_p].faceIndexArray; - } - - Iterator& operator++() { - if ((m_i0 >= 0) && (m_p < m_edgeArray->size() - 1)) { - ++m_p; - } else { - // Skip over elements with no face array - do { - ++m_i0; - if (m_i0 == m_array.size()) { - m_end = true; - return *this; - } else { - m_edgeArray = &m_array[m_i0]; - m_p = 0; - } - } while (m_edgeArray->size() == 0); - } - - return *this; - } - - bool hasMore() const { - return ! m_end; - } - - private: - - Iterator(ET& a) : m_i0(-1), m_p(-1), m_array(a), m_edgeArray(NULL), m_end(false) { - ++(*this); - } - - }; - - Iterator begin() { - return Iterator(table); - } -}; - - -/** - Assigns the edge index into the next unassigned edge - index. The edge index may be negative, indicating - a reverse edge. - */ -static void assignEdgeIndex(MeshAlg::Face& face, int e) { - for (int i = 0; i < 3; ++i) { - if (face.edgeIndex[i] == MeshAlg::Face::NONE) { - face.edgeIndex[i] = e; - return; - } - } - - debugAssertM(false, "Face has already been assigned 3 edges"); -} - - -void MeshAlg::computeAdjacency( - const Array& vertexGeometry, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array< Array >& adjacentFaceArray) { - - Array vertexArray; - - computeAdjacency(vertexGeometry, indexArray, faceArray, edgeArray, vertexArray); - - // Convert the vertexArray into adjacentFaceArray - adjacentFaceArray.clear(); - adjacentFaceArray.resize(vertexArray.size()); - for (int v = 0; v < adjacentFaceArray.size(); ++v) { - const SmallArray& src = vertexArray[v].faceIndex; - Array& dst = adjacentFaceArray[v]; - dst.resize(src.size()); - for (int f = 0; f < dst.size(); ++f) { - dst[f] = src[f]; - } - } -} - - -void MeshAlg::computeAdjacency( - const Array& vertexGeometry, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array& vertexArray) { - - MeshEdgeTable edgeTable; - - edgeArray.clear(); - vertexArray.clear(); - faceArray.clear(); - - // Face normals - Array faceNormal; - faceNormal.resize(indexArray.size() / 3); - faceArray.resize(faceNormal.size()); - - // This array has the same size as the vertex array - vertexArray.resize(vertexGeometry.size()); - - edgeTable.resize(vertexArray.size()); - - // Iterate through the triangle list - for (int q = 0, f = 0; q < indexArray.size(); ++f, q += 3) { - - Vector3 vertex[3]; - MeshAlg::Face& face = faceArray[f]; - - // Construct the face - for (int j = 0; j < 3; ++j) { - int v = indexArray[q + j]; - face.vertexIndex[j] = v; - face.edgeIndex[j] = Face::NONE; - - // Store back pointers in the vertices - vertexArray[v].faceIndex.append(f); - - // We'll need these vertices to find the face normal - vertex[j] = vertexGeometry[v]; - } - - // Compute the face normal - const Vector3& N = (vertex[1] - vertex[0]).cross(vertex[2] - vertex[0]); - faceNormal[f] = N.directionOrZero(); - - static const int nextIndex[] = {1, 2, 0}; - - // Add each edge to the edge table. - for (int j = 0; j < 3; ++j) { - const int i0 = indexArray[q + j]; - const int i1 = indexArray[q + nextIndex[j]]; - - if (i0 < i1) { - // The edge was directed in the same manner as in the face - edgeTable.insert(i0, i1, f); - } else { - // The edge was directed in the opposite manner as in the face - edgeTable.insert(i1, i0, ~f); - } - } - } - - // For each edge in the edge table, create an edge in the edge array. - // Collapse every 2 edges from adjacent faces. - - MeshEdgeTable::Iterator cur = edgeTable.begin(); - - Array tempEdgeArray; - while (cur.hasMore()) { - MeshEdgeTable::FaceIndexArray& faceIndexArray = cur.faceIndex(); - - // Process this edge - while (faceIndexArray.size() > 0) { - - // Remove the last index - int f0 = faceIndexArray.pop(); - - // Find the normal to that face - const Vector3& n0 = faceNormal[(f0 >= 0) ? f0 : ~f0]; - - bool found = false; - - // We try to find the matching face with the closest - // normal. This ensures that we don't introduce a lot - // of artificial ridges into flat parts of a mesh. - float ndotn = -2; - int f1 = -1, i1 = -1; - - // Try to find the face with the matching edge - for (int i = faceIndexArray.size() - 1; i >= 0; --i) { - int f = faceIndexArray[i]; - - if ((f >= 0) != (f0 >= 0)) { - // This face contains the oppositely oriented edge - // and has not been assigned too many edges - - const Vector3& n1 = faceNormal[(f >= 0) ? f : ~f]; - float d = n1.dot(n0); - - if (found) { - // We previously found a good face; see if this - // one is better. - if (d > ndotn) { - // This face is better. - ndotn = d; - f1 = f; - i1 = i; - } - } else { - // This is the first face we've found - found = true; - ndotn = d; - f1 = f; - i1 = i; - } - } - } - - // Create the new edge - int e = tempEdgeArray.size(); - Edge& edge = tempEdgeArray.next(); - - edge.vertexIndex[0] = cur.i0(); - edge.vertexIndex[1] = cur.i1(); - - if (f0 >= 0) { - edge.faceIndex[0] = f0; - edge.faceIndex[1] = Face::NONE; - assignEdgeIndex(faceArray[f0], e); - } else { - // The face indices above are two's complemented. - // this code restores them to regular indices. - debugAssert((~f0) >= 0); - edge.faceIndex[1] = ~f0; - edge.faceIndex[0] = Face::NONE; - - // The edge index *does* need to be inverted, however. - assignEdgeIndex(faceArray[~f0], ~e); - } - - if (found) { - // We found a matching face; remove both - // faces from the active list. - faceIndexArray.fastRemove(i1); - - if (f1 >= 0) { - edge.faceIndex[0] = f1; - assignEdgeIndex(faceArray[f1], e); - } else { - edge.faceIndex[1] = ~f1; - assignEdgeIndex(faceArray[~f1], ~e); - } - } - } - - ++cur; - } - - edgeTable.clear(); - - // Move boundary edges to the end of the list and then - // clean up the face references into them - { - // Map old edge indices to new edge indices - Array newIndex; - newIndex.resize(tempEdgeArray.size()); - - // Index of the start and end of the edge array - int i = 0; - int j = tempEdgeArray.size() - 1; - - edgeArray.resize(tempEdgeArray.size()); - for (int e = 0; e < tempEdgeArray.size(); ++e) { - if (tempEdgeArray[e].boundary()) { - newIndex[e] = j; - --j; - } else { - newIndex[e] = i; - ++i; - } - edgeArray[newIndex[e]] = tempEdgeArray[e]; - } - - debugAssertM(i == j + 1, "Counting from front and back of array did not match"); - - // Fix the faces - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - for (int q = 0; q < 3; ++q) { - int e = face.edgeIndex[q]; - if (e < 0) { - // Backwards edge; twiddle before and after conversion - face.edgeIndex[q] = ~newIndex[~e]; - } else { - // Regular edge; remap the index - face.edgeIndex[q] = newIndex[e]; - } - } - } - } - - // Now order the edge indices inside the faces correctly. - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - int e0 = face.edgeIndex[0]; - int e1 = face.edgeIndex[1]; - int e2 = face.edgeIndex[2]; - - // e0 will always remain first. The only - // question is whether e1 and e2 should be swapped. - - // See if e1 begins at the vertex where e1 ends. - const int e0End = (e0 < 0) ? - edgeArray[~e0].vertexIndex[0] : - edgeArray[e0].vertexIndex[1]; - - const int e1Begin = (e1 < 0) ? - edgeArray[~e1].vertexIndex[1] : - edgeArray[e1].vertexIndex[0]; - - if (e0End != e1Begin) { - // We must swap e1 and e2 - face.edgeIndex[1] = e2; - face.edgeIndex[2] = e1; - } - } - - // Fill out the edge adjacency information in the vertex array - for (int e = 0; e < edgeArray.size(); ++e) { - const Edge& edge = edgeArray[e]; - vertexArray[edge.vertexIndex[0]].edgeIndex.append(e); - vertexArray[edge.vertexIndex[1]].edgeIndex.append(~e); - } -} - - -void MeshAlg::weldBoundaryEdges( - Array& faceArray, - Array& edgeArray, - Array& vertexArray) { - - // Copy over the original edge array - Array oldEdgeArray = edgeArray; - - // newEdgeIndex[e] is the new index of the old edge with index e - // Note that newEdgeIndex[e] might be negative, indicating that - // the edge switched direction between the arrays. - Array newEdgeIndex; - newEdgeIndex.resize(edgeArray.size()); - edgeArray.resize(0); - - // boundaryEdgeIndices[v_low] is an array of the indices of - // all boundary edges whose lower vertex is v_low. - Table > boundaryEdgeIndices; - - // Copy over non-boundary edges to the new array - for (int e = 0; e < oldEdgeArray.size(); ++e) { - if (oldEdgeArray[e].boundary()) { - - // Add to the boundary table - const int v_low = iMin(oldEdgeArray[e].vertexIndex[0], oldEdgeArray[e].vertexIndex[1]); - if (! boundaryEdgeIndices.containsKey(v_low)) { - boundaryEdgeIndices.set(v_low, Array()); - } - boundaryEdgeIndices[v_low].append(e); - - // We'll fill out newEdgeIndex[e] later, when we find pairs - - } else { - - // Copy the edge to the new array - newEdgeIndex[e] = edgeArray.size(); - edgeArray.append(oldEdgeArray[e]); - - } - } - - - // Remove all edges from the table that have pairs. - Table >::Iterator cur = boundaryEdgeIndices.begin(); - Table >::Iterator end = boundaryEdgeIndices.end(); - while (cur != end) { - Array& boundaryEdge = cur->value; - - for (int i = 0; i < boundaryEdge.size(); ++i) { - int ei = boundaryEdge[i]; - const Edge& edgei = oldEdgeArray[ei]; - - for (int j = i + 1; j < boundaryEdge.size(); ++j) { - int ej = boundaryEdge[j]; - const Edge& edgej = oldEdgeArray[ej]; - - // See if edge ei is the reverse (match) of edge ej. - - // True if the edges match - bool match = false; - - // True if edgej's vertex indices are reversed from - // edgei's (usually true). - bool reversej = false; - - int u = edgei.vertexIndex[0]; - int v = edgei.vertexIndex[1]; - - if (edgei.faceIndex[0] != Face::NONE) { - // verts|faces - // edgei = [u v A /] - - if (edgej.faceIndex[0] != Face::NONE) { - if ((edgej.vertexIndex[0] == v) && (edgej.vertexIndex[1] == u)) { - // This is the most common of the four cases - - // edgej = [v u B /] - match = true; - reversej = true; - } - } else { - if ((edgej.vertexIndex[0] == u) && (edgej.vertexIndex[1] == v)) { - // edgej = [u v / B] - match = true; - } - } - } else { - // edgei = [u v / A] - if (edgej.faceIndex[0] != Face::NONE) { - if ((edgej.vertexIndex[0] == u) && (edgej.vertexIndex[1] == v)) { - // edgej = [u v B /] - match = true; - } - } else { - if ((edgej.vertexIndex[0] == v) && (edgej.vertexIndex[1] == u)) { - // edgej = [v u / B] - match = true; - reversej = true; - } - } - } - - if (match) { - // ei and ej can be paired as a single edge - int e = edgeArray.size(); - Edge& edge = edgeArray.next(); - - // Follow the direction of edgei. - edge = edgei; - newEdgeIndex[ei] = e; - - // Insert the face index for edgej. - int fj = edgej.faceIndex[0]; - if (fj == Face::NONE) { - fj = edgej.faceIndex[1]; - } - - if (edge.faceIndex[0] == Face::NONE) { - edge.faceIndex[0] = fj; - } else { - edge.faceIndex[1] = fj; - } - - if (reversej) { - // The new edge is backwards of the old edge for ej - newEdgeIndex[ej] = ~e; - } else { - newEdgeIndex[ej] = e; - } - - // Remove both ei and ej from being candidates for future pairing. - // Remove ej first since it comes later in the list (removing - // ei would decrease the index of ej to j - 1). - boundaryEdge.fastRemove(j); - boundaryEdge.fastRemove(i); - - // Re-process element i, which is now a new edge index - --i; - - // Jump out of the j for-loop - break; - } - } - } - ++cur; - } - - // Anything remaining in the table is a real boundary edge; just copy it to - // the end of the array. - cur = boundaryEdgeIndices.begin(); - end = boundaryEdgeIndices.end(); - while (cur != end) { - Array& boundaryEdge = cur->value; - - for (int b = 0; b < boundaryEdge.size(); ++b) { - const int e = boundaryEdge[b]; - - newEdgeIndex[e] = edgeArray.size(); - edgeArray.append(oldEdgeArray[e]); - } - - ++cur; - } - - // Finally, fix up edge indices in the face and vertex arrays - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - for (int i = 0; i < 3; ++i) { - int e = face.edgeIndex[i]; - - if (e < 0) { - face.edgeIndex[i] = ~newEdgeIndex[~e]; - } else { - face.edgeIndex[i] = newEdgeIndex[e]; - } - } - } - - for (int v = 0; v < vertexArray.size(); ++v) { - Vertex& vertex = vertexArray[v]; - for (int i = 0; i < vertex.edgeIndex.size(); ++i) { - int e = vertex.edgeIndex[i]; - - if (e < 0) { - vertex.edgeIndex[i] = ~newEdgeIndex[~e]; - } else { - vertex.edgeIndex[i] = newEdgeIndex[e]; - } - } - } -} - - -void MeshAlg::weldAdjacency( - const Array& originalGeometry, - Array& faceArray, - Array& edgeArray, - Array& vertexArray, - double radius) { - - // Num vertices - const int n = originalGeometry.size(); - - // canonical[v] = first occurance of any vertex near oldVertexArray[v] - Array canonical; - canonical.resize(n); - - Array toNew, toOld; - // Throw away the new vertex array - Array dummy; - computeWeld(originalGeometry, dummy, toNew, toOld, radius); - - for (int v = 0; v < canonical.size(); ++v) { - // Round-trip through the toNew/toOld process. This will give - // us the original vertex. - canonical[v] = toOld[toNew[v]]; - } - - // Destroy vertexArray (we reconstruct it below) - vertexArray.clear(); - vertexArray.resize(n); - - bool hasBoundaryEdges = false; - - // Fix edge vertex indices - for (int e = 0; e < edgeArray.size(); ++e) { - Edge& edge = edgeArray[e]; - - const int v0 = canonical[edge.vertexIndex[0]]; - const int v1 = canonical[edge.vertexIndex[1]]; - - edge.vertexIndex[0] = v0; - edge.vertexIndex[1] = v1; - - vertexArray[v0].edgeIndex.append(e); - vertexArray[v1].edgeIndex.append(~e); - - hasBoundaryEdges = hasBoundaryEdges || edge.boundary(); - } - - // Fix face vertex indices - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - for (int i = 0; i < 3; ++i) { - const int v = canonical[face.vertexIndex[i]]; - - face.vertexIndex[i] = v; - - // Add the back pointer - vertexArray[v].faceIndex.append(f); - } - } - - if (hasBoundaryEdges) { - // As a result of the welding, some of the boundary edges at - // the end of the array may now have mates and no longer be - // boundaries. Try to pair these up. - - weldBoundaryEdges(faceArray, edgeArray, vertexArray); - } -} - - -void MeshAlg::debugCheckConsistency( - const Array& faceArray, - const Array& edgeArray, - const Array& vertexArray) { - -#ifdef _DEBUG - for (int v = 0; v < vertexArray.size(); ++v) { - const MeshAlg::Vertex& vertex = vertexArray[v]; - - for (int i = 0; i < vertex.edgeIndex.size(); ++i) { - const int e = vertex.edgeIndex[i]; - debugAssert(edgeArray[(e >= 0) ? e : ~e].containsVertex(v)); - } - - for (int i = 0; i < vertex.faceIndex.size(); ++i) { - const int f = vertex.faceIndex[i]; - debugAssert(faceArray[f].containsVertex(v)); - } - - } - - for (int e = 0; e < edgeArray.size(); ++e) { - const MeshAlg::Edge& edge = edgeArray[e]; - - for (int i = 0; i < 2; ++i) { - debugAssert((edge.faceIndex[i] == MeshAlg::Face::NONE) || - faceArray[edge.faceIndex[i]].containsEdge(e)); - - debugAssert(vertexArray[edge.vertexIndex[i]].inEdge(e)); - } - } - - // Every face's edge must be on that face - for (int f = 0; f < faceArray.size(); ++f) { - const MeshAlg::Face& face = faceArray[f]; - for (int i = 0; i < 3; ++i) { - int e = face.edgeIndex[i]; - int ei = (e >= 0) ? e : ~e; - debugAssert(edgeArray[ei].inFace(f)); - - // Make sure the edge is oriented appropriately - if (e >= 0) { - debugAssert(edgeArray[ei].faceIndex[0] == (int)f); - } else { - debugAssert(edgeArray[ei].faceIndex[1] == (int)f); - } - - debugAssert(vertexArray[face.vertexIndex[i]].inFace(f)); - } - } -#else - (void)faceArray; - (void)edgeArray; - (void)vertexArray; -#endif // _DEBUG -} - -} // G3D namespace diff --git a/dep/src/g3dlite/MeshAlgWeld.cpp b/dep/src/g3dlite/MeshAlgWeld.cpp deleted file mode 100644 index 6067f17c2fb..00000000000 --- a/dep/src/g3dlite/MeshAlgWeld.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/** - @file MeshAlgWeld.cpp - - The MeshAlg::computeWeld method. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2003-10-22 - @edited 2005-02-24 - - Copyright 2000-2003, Morgan McGuire. - All rights reserved. - - */ - -#include "G3D/MeshAlg.h" -#include "G3D/Table.h" -#include "G3D/Set.h" - -namespace G3D { - -namespace _internal { - -class Welder { -private: - - // Intentionally illegal - Welder& operator=(const Welder& w); - -public: - /** Indices of newVertexArray elements in or near a grid cell. */ - typedef Array List; - - enum {GRID_RES = 32}; - - List grid[GRID_RES][GRID_RES][GRID_RES]; - - const Array& oldVertexArray; - Array& newVertexArray; - Array& toNew; - Array& toOld; - - /** Must be less than one grid cell, not checked */ - const double radius; - - /** (oldVertexArray[i] - offset) * scale is on the range [0, 1] */ - Vector3 offset; - Vector3 scale; - - Welder( - const Array& _oldVertexArray, - Array& _newVertexArray, - Array& _toNew, - Array& _toOld, - double _radius); - - /** - Computes the grid index from an ordinate. - */ - void toGridCoords(Vector3 v, int& x, int& y, int& z) const; - - /** Gets the index of a vertex, adding it to - newVertexArray if necessary. */ - int getIndex(const Vector3& vertex); - - void weld(); -}; - -} // namespace _internal - -} // namespace G3D - -template<> struct HashTrait { - static size_t hashCode(const G3D::_internal::Welder::List* key) { return reinterpret_cast(key); } -}; - -namespace G3D { -namespace _internal { - -Welder::Welder( - const Array& _oldVertexArray, - Array& _newVertexArray, - Array& _toNew, - Array& _toOld, - double _radius) : - oldVertexArray(_oldVertexArray), - newVertexArray(_newVertexArray), - toNew(_toNew), - toOld(_toOld), - radius(_radius) { - - // Compute a scale factor that moves the range - // of all ordinates to [0, 1] - Vector3 minBound = Vector3::inf(); - Vector3 maxBound = -minBound; - - for (int i = 0; i < oldVertexArray.size(); ++i) { - minBound = minBound.min(oldVertexArray[i]); - maxBound = maxBound.max(oldVertexArray[i]); - } - - offset = minBound; - scale = maxBound - minBound; - for (int i = 0; i < 3; ++i) { - // The model might have zero extent along some axis - if (fuzzyEq(scale[i], 0.0)) { - scale[i] = 1.0; - } else { - scale[i] = 1.0 / scale[i]; - } - } -} - - -void Welder::toGridCoords(Vector3 v, int& x, int& y, int& z) const { - v = (v - offset) * scale; - x = iClamp(iFloor(v.x * GRID_RES), 0, GRID_RES - 1); - y = iClamp(iFloor(v.y * GRID_RES), 0, GRID_RES - 1); - z = iClamp(iFloor(v.z * GRID_RES), 0, GRID_RES - 1); -} - - -int Welder::getIndex(const Vector3& vertex) { - - int closestIndex = -1; - double distanceSquared = inf(); - - int ix, iy, iz; - toGridCoords(vertex, ix, iy, iz); - - // Check against all vertices within radius of this grid cube - const List& list = grid[ix][iy][iz]; - - for (int i = 0; i < list.size(); ++i) { - double d = (newVertexArray[list[i]] - vertex).squaredMagnitude(); - - if (d < distanceSquared) { - distanceSquared = d; - closestIndex = list[i]; - } - } - - if (distanceSquared <= radius * radius) { - - return closestIndex; - - } else { - - // This is a new vertex - int newIndex = newVertexArray.size(); - newVertexArray.append(vertex); - - // Create a new vertex and store its index in the - // neighboring grid cells (usually, only 1 neighbor) - - Set neighbors; - - for (float dx = -1; dx <= +1; ++dx) { - for (float dy = -1; dy <= +1; ++dy) { - for (float dz = -1; dz <= +1; ++dz) { - int ix, iy, iz; - toGridCoords(vertex + Vector3(dx, dy, dz) * radius, ix, iy, iz); - neighbors.insert(&(grid[ix][iy][iz])); - } - } - } - - Set::Iterator neighbor(neighbors.begin()); - Set::Iterator none(neighbors.end()); - - while (neighbor != none) { - (*neighbor)->append(newIndex); - ++neighbor; - } - - return newIndex; - } -} - - -void Welder::weld() { - newVertexArray.resize(0); - - // Prime the vertex positions - for (int i = 0; i < oldVertexArray.size(); ++i) { - getIndex(oldVertexArray[i]); - } - - // Now create the official remapping by snapping to - // nearby vertices. - toNew.resize(oldVertexArray.size()); - toOld.resize(newVertexArray.size()); - - for (int oi = 0; oi < oldVertexArray.size(); ++oi) { - toNew[oi] = getIndex(oldVertexArray[oi]); - toOld[toNew[oi]] = oi; - } -} - -} // internal namespace - - -void MeshAlg::computeWeld( - const Array& oldVertexArray, - Array& newVertexArray, - Array& toNew, - Array& toOld, - double radius) { - - _internal::Welder welder(oldVertexArray, newVertexArray, toNew, toOld, radius); - welder.weld(); -} - -} // G3D namespace diff --git a/dep/src/g3dlite/MeshBuilder.cpp b/dep/src/g3dlite/MeshBuilder.cpp deleted file mode 100644 index 1bf2bab5d1c..00000000000 --- a/dep/src/g3dlite/MeshBuilder.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/** - @file MeshBuilder.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-02-27 - @edited 2005-02-24 - */ - -#include "G3D/MeshBuilder.h" -#include "G3D/MeshAlg.h" - -namespace G3D { - -void MeshBuilder::setName(const std::string& n) { - name = n; -} - - -void MeshBuilder::commit(std::string& n, Array& indexArray, Array& outvertexArray) { - n = name; - - // Make the data fit in a unit cube - centerTriList(); - - Array toNew, toOld; - - if (close == MeshBuilder::AUTO_WELD) { - Array index; - MeshAlg::createIndexArray(triList.size(), index); - double minEdgeLen, maxEdgeLen, meanEdgeLen, medianEdgeLen; - double minFaceArea, maxFaceArea, meanFaceArea, medianFaceArea; - MeshAlg::computeAreaStatistics(triList, index, - minEdgeLen, meanEdgeLen, medianEdgeLen, maxEdgeLen, - minFaceArea, meanFaceArea, medianFaceArea, maxFaceArea); - close = minEdgeLen * 0.1; - } - - MeshAlg::computeWeld(triList, outvertexArray, toNew, toOld, close); - - // Construct triangles - for (int t = 0; t < triList.size(); t += 3) { - int index[3]; - - for (int i = 0; i < 3; ++i) { - index[i] = toNew[t + i]; - } - - // Throw out zero size triangles - if ((index[0] != index[1]) && - (index[1] != index[2]) && - (index[2] != index[0])) { - indexArray.append(index[0], index[1], index[2]); - } - } -} - - -void MeshBuilder::centerTriList() { - // Compute the range of the vertices - Vector3 vmin, vmax; - - computeBounds(vmin, vmax); - - Vector3 diagonal = vmax - vmin; - double scale = max(max(diagonal.x, diagonal.y), diagonal.z) / 2; - debugAssert(scale > 0); - - Vector3 translation = vmin + diagonal / 2; - - // Center and scale all vertices in the input list - int v; - - //Matrix3 rot90 = Matrix3::fromAxisAngle(Vector3::UNIT_Y, toRadians(180)) * Matrix3::fromAxisAngle(Vector3::UNIT_X, toRadians(90)); - for (v = 0; v < triList.size(); ++v) { - triList[v] = (triList[v] - translation) / scale; - //triList[v] = rot90 * triList[v]; - } -} - - -void MeshBuilder::computeBounds(Vector3& min, Vector3& max) { - min = Vector3::inf(); - max = -min; - - int v; - for (v = 0; v < triList.size(); ++v) { - min = min.min(triList[v]); - max = max.max(triList[v]); - } -} - - -void MeshBuilder::addTriangle(const Vector3& a, const Vector3& b, const Vector3& c) { - triList.append(a, b, c); - - if (_twoSided) { - triList.append(c, b, a); - } -} - - -void MeshBuilder::addQuad(const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d) { - addTriangle(a, b, c); - addTriangle(a, c, d); -} - - -void MeshBuilder::addTriangle(const Triangle& t) { - addTriangle(t.vertex(0), t.vertex(1), t.vertex(2)); -} - -} // namespace diff --git a/dep/src/g3dlite/NetAddress.cpp b/dep/src/g3dlite/NetAddress.cpp deleted file mode 100644 index 64d692d4763..00000000000 --- a/dep/src/g3dlite/NetAddress.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/** - @file NetMessage.cpp - - @maintainer Morgan McGuire, morgan@cs.brown.edu - @created 2005-02-06 - @edited 2005-02-06 - */ -#include "G3D/platform.h" -#include "G3D/NetAddress.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Array.h" -#include "G3D/stringutils.h" -#include "G3D/System.h" -#include "G3D/NetworkDevice.h" - -#if defined(G3D_LINUX) || defined(G3D_OSX) - #include - #include - #include - #include - #include - #include - #include - #define _alloca alloca - -# ifndef SOCKADDR_IN -# define SOCKADDR_IN struct sockaddr_in -# endif -# ifndef SOCKET -# define SOCKET int -# endif - -// SOCKADDR_IN is supposed to be defined in NetAddress.h -#ifndef SOCKADDR_IN -# error Network headers included in wrong order -#endif -#endif - - -namespace G3D { - -NetAddress::NetAddress() { - System::memset(&addr, 0, sizeof(addr)); -} - -void NetAddress::init(uint32 host, uint16 port) { - if ((host != 0) || (port != 0)) { - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (host == 0) { - host = INADDR_ANY; - } - addr.sin_addr.s_addr = htonl(host); - } else { - System::memset(&addr, 0, sizeof(addr)); - } -} - - -NetAddress::NetAddress( - const std::string& hostname, - uint16 port) { - init(hostname, port); -} - - -void NetAddress::init( - const std::string& hostname, - uint16 port) { - - uint32 addr; - - if (hostname == "") { - addr = INADDR_NONE; - } else { - addr = inet_addr(hostname.c_str()); - } - - // The address wasn't in numeric form, resolve it - if (addr == INADDR_NONE) { - // Get the IP address of the server and store it in host - struct hostent* host = gethostbyname(hostname.c_str()); - - if (host == NULL) { - init(0, 0); - return; - } - - System::memcpy(&addr, host->h_addr_list[0], host->h_length); - } - - if (addr != INADDR_NONE) { - addr = ntohl(addr); - } - init(addr, port); -} - - -NetAddress::NetAddress(uint32 hostip, uint16 port) { - init(hostip, port); -} - - -NetAddress NetAddress::broadcastAddress(uint16 port) { - return NetAddress(NetworkDevice::instance()->broadcastAddressArray()[0], port); -} - - -NetAddress::NetAddress(const std::string& hostnameAndPort) { - - Array part = stringSplit(hostnameAndPort, ':'); - - debugAssert(part.length() == 2); - init(part[0], atoi(part[1].c_str())); -} - - -NetAddress::NetAddress(const SOCKADDR_IN& a) { - addr = a; -} - - -NetAddress::NetAddress(const struct in_addr& addr, uint16 port) { - #ifdef G3D_WIN32 - init(ntohl(addr.S_un.S_addr), port); - #else - init(htonl(addr.s_addr), port); - #endif -} - - -void NetAddress::serialize(class BinaryOutput& b) const { - b.writeUInt32(ip()); - b.writeUInt16(port()); -} - - -void NetAddress::deserialize(class BinaryInput& b) { - uint32 i; - uint16 p; - - i = b.readUInt32(); - p = b.readUInt16(); - - init(i, p); -} - - -bool NetAddress::ok() const { - return addr.sin_family != 0; -} - - -std::string NetAddress::ipString() const { - return format("%s", inet_ntoa(*(in_addr*)&(addr.sin_addr))); -} - - -std::string NetAddress::toString() const { - return ipString() + format(":%d", ntohs(addr.sin_port)); -} - -} diff --git a/dep/src/g3dlite/NetworkDevice.cpp b/dep/src/g3dlite/NetworkDevice.cpp deleted file mode 100644 index 246c97d4dbf..00000000000 --- a/dep/src/g3dlite/NetworkDevice.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -/** - @file NetworkDevice.cpp - - @maintainer Morgan McGuire, morgan@cs.brown.edu - @created 2002-11-22 - @edited 2006-02-24 - */ - -#include -#include -#include "G3D/platform.h" -#include "G3D/TextOutput.h" -#include "G3D/NetworkDevice.h" -#include "G3D/NetAddress.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/stringutils.h" -#include "G3D/debug.h" - -#include - -#if defined(G3D_LINUX) || defined(G3D_OSX) || defined(G3D_FREEBSD) -# include -# include -# include -# include -# include -# ifdef __linux__ -# include -# include -# include -# include -// Match Linux to FreeBSD -# define AF_LINK AF_PACKET -# else -# include -# include -# endif - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #include - - #define _alloca alloca - - /** Define an error code for non-windows platforms. */ - int WSAGetLastError() { - return -1; - } - - #define SOCKET_ERROR -1 - - static std::string socketErrorCode(int code) { - return G3D::format("CODE %d: %s\n", code, strerror(code)); - } - - static std::string socketErrorCode() { - return socketErrorCode(errno); - } - - static const int WSAEWOULDBLOCK = -100; - - typedef int SOCKET; - typedef struct sockaddr_in SOCKADDR_IN; - -#else - - // Windows - static std::string socketErrorCode(int code) { - LPTSTR formatMsg = NULL; - - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - code, - 0, - (LPTSTR)&formatMsg, - 0, - NULL); - - return G3D::format("CODE %d: %s\n", code, formatMsg); - } - - static std::string socketErrorCode() { - return socketErrorCode(GetLastError()); - } - -#endif - - -#ifndef _SOCKLEN_T -# if defined(G3D_WIN32) || defined(G3D_OSX) - typedef int socklen_t; -# endif -#endif - -namespace G3D { - -NetworkDevice* NetworkDevice::s_instance = NULL; - -std::ostream& operator<<(std::ostream& os, const NetAddress& a) { - return os << a.toString(); -} - - -static void logSocketInfo(const SOCKET& sock) { - uint32 val; - socklen_t sz = 4; - int ret; - - ret = getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_RCVBUF = %d\n", val); - - ret = getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_SNDBUF = %d\n", val); - - // Note: timeout = 0 means no timeout - ret = getsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_RCVTIMEO = %d\n", val); - - ret = getsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_SNDTIMEO = %d\n", val); -} - - -///////////////////////////////////////////////////////////////////////////// - -/** Invokes select on one socket. Returns SOCKET_ERROR on error, 0 if - there is no read pending, sock if there a read pending. */ -static int selectOneReadSocket(const SOCKET& sock) { - // 0 time timeout is specified to poll and return immediately - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - // Create a set that contains just this one socket - fd_set socketSet; - FD_ZERO(&socketSet); - FD_SET(sock, &socketSet); - - int ret = select(sock + 1, &socketSet, NULL, NULL, &timeout); - - return ret; -} - - -/** Returns true if the socket has a read pending */ -static bool readWaiting(const SOCKET& sock) { - int ret = selectOneReadSocket(sock); - - switch (ret) { - case SOCKET_ERROR: - logPrintf("ERROR: selectOneReadSocket returned " - "SOCKET_ERROR in readWaiting(). %s", socketErrorCode().c_str()); - // Return true so that we'll force an error on read and close - // the socket. - return true; - - case 0: - return false; - - default: - return true; - } -} - - -/** Invokes select on one socket. */ -static int selectOneWriteSocket(const SOCKET& sock) { - // 0 time timeout is specified to poll and return immediately - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - // Create a set that contains just this one socket - fd_set socketSet; - FD_ZERO(&socketSet); - FD_SET(sock, &socketSet); - - return select(sock + 1, NULL, &socketSet, NULL, &timeout); -} - -/////////////////////////////////////////////////////////////////////////////// - -NetworkDevice* NetworkDevice::instance() { - if (s_instance == NULL) { - s_instance = new NetworkDevice(); - if (! s_instance->init()) { - delete s_instance; - s_instance = NULL; - } - } - return s_instance; -} - - -void NetworkDevice::cleanup() { - if (s_instance) { - s_instance->_cleanup(); - delete s_instance; - s_instance = NULL; - } -} - - -NetworkDevice::NetworkDevice() { - initialized = false; -} - - -NetworkDevice::~NetworkDevice() { -} - - -std::string NetworkDevice::localHostName() const { - char ac[128]; - if (gethostname(ac, sizeof(ac)) == -1) { - Log::common()->printf("Error while getting local host name\n"); - return "localhost"; - } - return gethostbyname(ac)->h_name; -} - -#ifndef G3D_WIN32 -const char* errnoToString() { - switch (errno) { - case EBADF: - return "file descriptor is invalid."; - - case EINVAL: - return "Request or argp is not valid."; - - case ENOTTY: - return - "file descriptor is not associated with a character special device OR " - "The specified request does not apply to the " - "kind of object that the descriptor fildes references."; - - case EADDRNOTAVAIL: - return "Address not available."; - - default: - { - static char buffer[20]; - sprintf(buffer, "Error %d", errno); - return buffer; - } - } -} -#endif - - -NetworkDevice::EthernetAdapter::EthernetAdapter() { - name = ""; - ip = 0; - hostname = ""; - subnet = 0; - broadcast = 0; - for (int i = 0; i < 6; ++i) { - mac[i] = 0; - } -} - -void NetworkDevice::EthernetAdapter::describe(TextOutput& t) const { - t.writeSymbol("{"); - t.pushIndent(); - t.writeNewline(); - - t.writeSymbols("hostname", "="); - t.writeString(hostname); - t.writeNewline(); - - t.writeSymbols("name", "="); - t.writeString(name); - t.writeNewline(); - - t.writeSymbols("ip", "="); - t.writeSymbol(formatIP(ip)); - t.writeNewline(); - - t.writeSymbols("subnet", "="); - t.writeSymbol(formatIP(subnet)); - t.writeNewline(); - - t.writeSymbols("broadcast", "="); - t.writeSymbol(formatIP(broadcast)); - t.writeNewline(); - - t.writeSymbols("mac", "="); - t.writeSymbol(formatMAC(mac)); - t.writeNewline(); - - t.popIndent(); - t.writeSymbol("}"); - t.writeNewline(); -} - - -void NetworkDevice::addAdapter(const EthernetAdapter& a) { - m_adapterArray.append(a); - if (a.broadcast != 0) { - int i = m_broadcastAddresses.findIndex(a.broadcast); - if (i == -1) { - m_broadcastAddresses.append(a.broadcast); - } - } -} - - -std::string NetworkDevice::formatIP(uint32 addr) { - return format("%3d.%3d.%3d.%3d", (addr >> 24) & 0xFF, (addr >> 16) & 0xFF, - (addr >> 8) & 0xFF, addr & 0xFF); -} - - -std::string NetworkDevice::formatMAC(const uint8 MAC[6]) { - return format("%02x:%02x:%02x:%02x:%02x:%02x", MAC[0], MAC[1], MAC[2], MAC[3], MAC[4], MAC[5]); -} - - -#ifdef G3D_WIN32 - -bool NetworkDevice::init() { - debugAssert(! initialized); - - logPrintf("Network Startup"); - logPrintf("Starting WinSock networking.\n"); - WSADATA wsda; - WSAStartup(MAKEWORD(G3D_WINSOCK_MAJOR_VERSION, G3D_WINSOCK_MINOR_VERSION), &wsda); - - std::string hostname = "localhost"; - { - char ac[128]; - if (gethostname(ac, sizeof(ac)) == -1) { - logPrintf("Warning: Error while getting local host name\n"); - } else { - hostname = gethostbyname(ac)->h_name; - } - } - - EthernetAdapter a; - a.hostname = hostname; - a.name = ""; - a.ip = NetAddress(hostname, 0).ip(); - - // TODO: Find subnet on Win32 - a.subnet = 0x0000FFFF; - - // TODO: Find broadcast on Win32 - a.broadcast = 0xFFFFFFFF; - - // TODO: find MAC on Win32 - - addAdapter(a); - - std::string machine = localHostName(); - std::string addr = NetAddress(machine, 0).ipString(); - logPrintf( - "Network:\n" - " Status: %s\n" - " Loaded winsock specification version %d (%d is " - "the highest available)\n" - " %d sockets available\n" - " Largest UDP datagram packet size is %d bytes\n\n", - wsda.szDescription, - wsda.szSystemStatus, - wsda.wVersion, - wsda.wHighVersion, - wsda.iMaxSockets, - wsda.iMaxUdpDg); - - // TODO: WSAIoctl for subnet and broadcast addresses - // http://msdn.microsoft.com/en-us/library/ms741621(VS.85).aspx - // - // TODO: SIO_GET_INTERFACE_LIST - - initialized = true; - - return true; -} -#endif - - -#if defined(G3D_LINUX) || defined(G3D_OSX) || defined(G3D_FREEBSD) - -const sockaddr_in* castToIP4(const sockaddr* addr) { - if (addr == NULL) { - return NULL; - } else if (addr->sa_family == AF_INET) { - // An IPv4 address - return reinterpret_cast(addr); - } else { - // Not an IPv4 address - return NULL; - } -} - -uint32 getIP(const sockaddr_in* addr) { - if (addr != NULL) { - return ntohl(addr->sin_addr.s_addr); - } else { - return 0; - } -} - - -bool NetworkDevice::init() { - debugAssert(! initialized); - - // Used for combining the MAC and ip information - typedef Table AdapterTable; - - AdapterTable table; - - // Head of a linked list of network interfaces on this machine - ifaddrs* ifap = NULL; - - int r = getifaddrs(&ifap); - - if (r != 0) { - logPrintf("ERROR: getifaddrs returned %d\n", r); - return false; - } - - ifaddrs* current = ifap; - - if (current == NULL) { - logPrintf("WARNING: No network interfaces found\n"); - EthernetAdapter a; - a.name = "fallback"; - a.hostname = "localhost"; - a.ip = (127 << 24) | 1; - a.broadcast = 0xFFFFFFFF; - a.subnet = 0x000000FF; - addAdapter(a); - - } else { - - while (current != NULL) { - - bool up = (current->ifa_flags & IFF_UP); - bool loopback = (current->ifa_flags & IFF_LOOPBACK); - - if (! up || loopback) { - // Skip this adapter; it is offline or is a loopback - current = current->ifa_next; - continue; - } - - if (! table.containsKey(current->ifa_name)) { - EthernetAdapter a; - a.name = current->ifa_name; - table.set(a.name, a); - } - - // This adapter must exist because it was created above - EthernetAdapter& adapter = table[current->ifa_name]; - - const sockaddr_in* interfaceAddress = castToIP4(current->ifa_addr); - const sockaddr_in* broadcastAddress = castToIP4(current->ifa_dstaddr); - const sockaddr_in* subnetMask = castToIP4(current->ifa_netmask); - - uint32 ip = getIP(interfaceAddress); - uint32 ba = getIP(broadcastAddress); - uint32 sn = getIP(subnetMask); - - if (ip != 0) { - adapter.ip = ip; - } - - if (ba != 0) { - adapter.broadcast = ba; - } - - if (sn != 0) { - adapter.subnet = sn; - } - - uint8_t* MAC = NULL; - // Extract MAC address - if ((current->ifa_addr != NULL) && (current->ifa_addr->sa_family == AF_LINK)) { -# ifdef __linux__ - { - // Linux - struct ifreq ifr; - - int fd = socket(AF_INET, SOCK_DGRAM, 0); - - ifr.ifr_addr.sa_family = AF_INET; - strcpy(ifr.ifr_name, current->ifa_name); - ioctl(fd, SIOCGIFHWADDR, &ifr); - close(fd); - - MAC = reinterpret_cast(ifr.ifr_hwaddr.sa_data); - } -# else - { - // The MAC address and the interfaceAddress come in as - // different interfaces with the same name. - - // Posix/FreeBSD/Mac OS - sockaddr_dl* sdl = (struct sockaddr_dl *)current->ifa_addr; - MAC = reinterpret_cast(LLADDR(sdl)); - } -# endif - - // See if there was a MAC address - if (MAC != NULL) { - bool anyNonZero = false; - for (int i = 0; i < 6; ++i) { - anyNonZero = anyNonZero || (MAC[i] != 0); - } - if (anyNonZero) { - System::memcpy(adapter.mac, MAC, 6); - } - } - } - - current = current->ifa_next; - } - - freeifaddrs(ifap); - ifap = NULL; - } - - // Extract all interesting adapters from the table - for (AdapterTable::Iterator it = table.begin(); it.hasMore(); ++it) { - const EthernetAdapter& adapter = it->value; - - // Only add adapters that have IP addresses - if (adapter.ip != 0) { - addAdapter(adapter); - } else { - logPrintf("NetworkDevice: Ignored adapter %s because ip = 0\n", adapter.name.c_str()); - } - } - - initialized = true; - - return true; -} - -#endif - - -void NetworkDevice::_cleanup() { - debugAssert(initialized); - - logPrintf("Network Cleanup"); -# ifdef G3D_WIN32 - WSACleanup(); -# endif - logPrintf("Network cleaned up."); -} - -bool NetworkDevice::bind(SOCKET sock, const NetAddress& addr) const { - Log::common()->printf("Binding socket %d on port %d ", - sock, htons(addr.addr.sin_port)); - if (::bind(sock, (struct sockaddr*)&(addr.addr), sizeof(addr.addr)) == - SOCKET_ERROR) { - - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - closesocket(sock); - return false; - } - - Log::common()->println("Ok"); - return true; -} - - -void NetworkDevice::closesocket(SOCKET& sock) const { - if (sock != 0) { - #ifdef G3D_WIN32 - ::closesocket(sock); - #else - close(sock); - #endif - - Log::common()->printf("Closed socket %d\n", sock); - sock = 0; - } -} - - -void NetworkDevice::localHostAddresses(Array& array) const { - array.resize(0); - - char ac[128]; - - if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) { - Log::common()->printf("Error while getting local host name\n"); - return; - } - - struct hostent* phe = gethostbyname(ac); - if (phe == 0) { - Log::common()->printf("Error while getting local host address\n"); - return; - } - - for (int i = 0; (phe->h_addr_list[i] != 0); ++i) { - struct in_addr addr; - memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr)); - array.append(NetAddress(addr)); - } -} - -/////////////////////////////////////////////////////////////////////////////// - -Conduit::Conduit() : binaryOutput("", G3D_LITTLE_ENDIAN) { - sock = 0; - mSent = 0; - mReceived = 0; - bSent = 0; - bReceived = 0; -} - - -Conduit::~Conduit() { - NetworkDevice::instance()->closesocket(sock); -} - - -uint64 Conduit::bytesSent() const { - return bSent; -} - - -uint64 Conduit::bytesReceived() const { - return bReceived; -} - - -uint64 Conduit::messagesSent() const { - return mSent; -} - - -uint64 Conduit::messagesReceived() const { - return mReceived; -} - - -bool Conduit::ok() const { - return (sock != 0) && (sock != SOCKET_ERROR); -} - - -bool Conduit::messageWaiting() { - return readWaiting(sock); -} - - -/** - Increases the send and receive sizes of a socket to 2 MB from 8k - */ -static void increaseBufferSize(SOCKET sock) { - - // Increase the buffer size; the default (8192) is too easy to - // overflow when the network latency is high. - { - uint32 val = 1024 * 1024 * 2; - if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, - (char*)&val, sizeof(val)) == SOCKET_ERROR) { - Log::common()->printf("WARNING: Increasing socket " - "receive buffer to %d failed.\n", val); - Log::common()->println(socketErrorCode()); - } - - if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, - (char*)&val, sizeof(val)) == SOCKET_ERROR) { - Log::common()->printf("WARNING: Increasing socket " - "send buffer to %d failed.\n", val); - Log::common()->println(socketErrorCode()); - } - } -} - -////////////////////////////////////////////////////////////////////////////// - -ReliableConduitRef ReliableConduit::create(const NetAddress& address) { - return new ReliableConduit(address); -} - - -ReliableConduit::ReliableConduit( - const NetAddress& _addr) : state(NO_MESSAGE), receiveBuffer(NULL), - receiveBufferTotalSize(0), receiveBufferUsedSize(0) { - - NetworkDevice* nd = NetworkDevice::instance(); - - messageType = 0; - - addr = _addr; - Log::common()->print("Creating a TCP socket "); - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - - if (sock == SOCKET_ERROR) { - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - return; - } - - Log::common()->println("Ok"); - - // Setup socket options (both constructors should set the same options) - - // Disable Nagle's algorithm (we send lots of small packets) - const int T = true; - if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Disabling Nagel's " - "algorithm failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Disabled Nagel's algorithm."); - } - - // Set the NO LINGER option so the socket doesn't hang around if - // there is unsent data in the queue when it closes. - struct linger ling; - ling.l_onoff = 0; - ling.l_linger = 0; - if (setsockopt(sock, SOL_SOCKET, SO_LINGER, - (const char*)&ling, sizeof(ling)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket no linger failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option no_linger."); - } - - // Set reuse address so that a new server can start up soon after - // an old one has closed. - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket reuseaddr failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option reuseaddr."); - } - - // Ideally, we'd like to specify IPTOS_LOWDELAY as well. - - logSocketInfo(sock); - - increaseBufferSize(sock); - - Log::common()->printf("Created TCP socket %d\n", sock); - - std::string x = addr.toString(); - Log::common()->printf("Connecting to %s on TCP socket %d ", x.c_str(), sock); - - int ret = connect(sock, (struct sockaddr *) &(addr.addr), sizeof(addr.addr)); - - if (ret == WSAEWOULDBLOCK) { - RealTime t = System::time() + 5.0; - // Non-blocking; we must wait until select returns non-zero - while ((selectOneWriteSocket(sock) == 0) && (System::time() < t)) { - System::sleep(0.02); - } - - // TODO: check for failure on the select call - - } else if (ret != 0) { - sock = (SOCKET)SOCKET_ERROR; - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - return; - } - - Log::common()->println("Ok"); -} - - -ReliableConduit::ReliableConduit( - const SOCKET& _sock, - const NetAddress& _addr) : - state(NO_MESSAGE), - receiveBuffer(NULL), - receiveBufferTotalSize(0), - receiveBufferUsedSize(0) { - sock = _sock; - addr = _addr; - - messageType = 0; - - // Setup socket options (both constructors should set the same options) - - // Disable Nagle's algorithm (we send lots of small packets) - const int T = true; - if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Disabling Nagel's algorithm failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Disabled Nagel's algorithm."); - } - - // Set the NO LINGER option so the socket doesn't hang around if - // there is unsent data in the queue when it closes. - struct linger ling; - ling.l_onoff = 0; - ling.l_linger = 0; - if (setsockopt(sock, SOL_SOCKET, SO_LINGER, - (const char*)&ling, sizeof(ling)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket no linger failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option no_linger."); - } - - // Set reuse address so that a new server can start up soon after - // an old one has closed. - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket reuseaddr failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option reuseaddr."); - } - - // Ideally, we'd like to specify IPTOS_LOWDELAY as well. - - logSocketInfo(sock); -} - - -ReliableConduit::~ReliableConduit() { - free(receiveBuffer); - receiveBuffer = NULL; - receiveBufferTotalSize = 0; - receiveBufferUsedSize = 0; -} - - -bool ReliableConduit::messageWaiting() { - switch (state) { - case HOLDING: - // We've already read the message and are waiting - // for a receive call. - return true; - - case RECEIVING: - - if (! ok()) { - return false; - } - // We're currently receiving the message. Read a little more. - receiveIntoBuffer(); - - if (messageSize == receiveBufferUsedSize) { - // We've read the whole mesage. Switch to holding state - // and return true. - state = HOLDING; - return true; - } else { - // There are more bytes left to read. We'll read them on - // the next call. Because the *entire* message is not ready, - // return false. - return false; - } - break; - - case NO_MESSAGE: - if (Conduit::messageWaiting()) { - // Message incoming. Read the header. - - state = RECEIVING; - receiveHeader(); - - // Loop back around now that we're in the receive state; we - // may be able to read the whole message before returning - // to the caller. - return messageWaiting(); - } else { - // No message incoming. - return false; - } - } - - debugAssertM(false, "Should not reach this point"); - return false; -} - - -uint32 ReliableConduit::waitingMessageType() { - // The messageWaiting call is what actually receives the message. - if (messageWaiting()) { - return messageType; - } else { - return 0; - } -} - - -void ReliableConduit::sendBuffer(const BinaryOutput& b) { - NetworkDevice* nd = NetworkDevice::instance(); - int ret = ::send(sock, (const char*)b.getCArray(), b.size(), 0); - - if (ret == SOCKET_ERROR) { - Log::common()->println("Error occured while sending message."); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - return; - } - - ++mSent; - bSent += b.size(); - - // Verify the packet was actually sent - // Conversion to unsigned is safe because -1 is caught earlier - debugAssert(ret == b.size()); -} - - -/** Null serializer. Used by reliable conduit::send(type) */ -class Dummy { -public: - void serialize(BinaryOutput& b) const { (void)b; } -}; - - -void ReliableConduit::send(uint32 type) { - static Dummy dummy; - send(type, dummy); -} - - - -NetAddress ReliableConduit::address() const { - return addr; -} - - -void ReliableConduit::receiveHeader() { - NetworkDevice* nd = NetworkDevice::instance(); - debugAssert(state == RECEIVING); - - // Read the type - uint32 tmp; - int ret = recv(sock, (char*)&tmp, sizeof(tmp), 0); - - // The type is the first four bytes. It is little endian. - if (System::machineEndian() == G3D_LITTLE_ENDIAN) { - messageType = tmp; - } else { - // Swap the byte order - for (int i = 0; i < 4; ++i) { - ((char*)&messageType)[i] = ((char*)&tmp)[3 - i]; - } - } - - if ((ret == SOCKET_ERROR) || (ret != sizeof(messageType))) { - Log::common()->printf("Call to recv failed. ret = %d," - " sizeof(messageType) = %d\n", - (int)ret, (int)sizeof(messageType)); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - messageType = 0; - return; - } - - // Read the size - ret = recv(sock, (char*)&messageSize, sizeof(messageSize), 0); - - if ((ret == SOCKET_ERROR) || (ret != sizeof(messageSize))) { - Log::common()->printf("Call to recv failed. ret = %d," - " sizeof(len) = %d\n", (int)ret, - (int)sizeof(messageSize)); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - messageType = 0; - return; - } - - messageSize = ntohl(messageSize); - debugAssert(messageSize < 6e7); - - debugAssert(receiveBufferUsedSize == 0); - - // Extend the size of the buffer. - if (messageSize > receiveBufferTotalSize) { - receiveBuffer = realloc(receiveBuffer, messageSize); - receiveBufferTotalSize = messageSize; - } - - if (receiveBuffer == NULL) { - Log::common()->println("Could not allocate a memory buffer " - "during receivePacket."); - nd->closesocket(sock); - } - - bReceived += 4; -} - - -void ReliableConduit::receiveIntoBuffer() { - NetworkDevice* nd = NetworkDevice::instance(); - - debugAssert(state == RECEIVING); - debugAssert(messageType != 0); - debugAssertM(receiveBufferUsedSize < messageSize, "Message already received."); - debugAssertM(messageSize >= receiveBufferUsedSize, "Message size overflow."); - - // Read the data itself - int ret = 0; - uint32 left = messageSize - receiveBufferUsedSize; - int count = 0; - while ((ret != SOCKET_ERROR) && (left > 0) && (count < 100)) { - - ret = recv(sock, ((char*)receiveBuffer) + receiveBufferUsedSize, left, 0); - - if (ret > 0) { - left -= ret; - receiveBufferUsedSize += ret; - bReceived += ret; - - if (left > 0) { - // There's still more. Give the machine a chance to read - // more data, but don't wait forever. - - ++count; - System::sleep(0.001); - } - } else { - // Something went wrong; our blocking read returned nothing. - break; - } - } - - if ((ret == 0) || (ret == SOCKET_ERROR)) { - - if (ret == SOCKET_ERROR) { - Log::common()->printf("Call to recv failed. ret = %d," - " sizeof(messageSize) = %d\n", ret, messageSize); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->printf("recv returned 0\n"); - } - nd->closesocket(sock); - return; - } - - ++mReceived; -} - - -/////////////////////////////////////////////////////////////////////////////// -LightweightConduitRef LightweightConduit::create( - uint16 receivePort, - bool enableReceive, - bool enableBroadcast) { - - return new LightweightConduit(receivePort, enableReceive, enableBroadcast); -} - -LightweightConduit::LightweightConduit( - uint16 port, - bool enableReceive, - bool enableBroadcast) { - NetworkDevice* nd = NetworkDevice::instance(); - - Log::common()->print("Creating a UDP socket "); - sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - - if (sock == SOCKET_ERROR) { - sock = 0; - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - return; - } - Log::common()->println("Ok"); - - if (enableReceive) { - debugAssert(port != 0); - if (! nd->bind(sock, NetAddress(0, port))) { - nd->closesocket(sock); - sock = (SOCKET)SOCKET_ERROR; - } - } - - // Figuring out the MTU seems very complicated, so we just set it to 1000, - // which is likely to be safe. See IP_MTU for more information. - MTU = 1000; - - increaseBufferSize(sock); - - if (enableBroadcast) { - int TR = true; - if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, - (const char*)&TR, sizeof(TR)) != 0) { - Log::common()->println("Call to setsockopt failed"); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - sock = 0; - return; - } - } - - Log::common()->printf("Done creating UDP socket %d\n", sock); - - alreadyReadMessage = false; -} - - -LightweightConduit::~LightweightConduit() { -} - - -bool LightweightConduit::receive(NetAddress& sender) { - // This both checks to ensure that a message was waiting and - // actively consumes the message from the network stream if - // it has not been read yet. - uint32 t = waitingMessageType(); - if (t == 0) { - return false; - } - - sender = messageSender; - alreadyReadMessage = false; - - if (messageBuffer.size() < 4) { - // Something went wrong - return false; - } - - return true; -} - - -void LightweightConduit::sendBuffer(const NetAddress& a, BinaryOutput& b) { - NetworkDevice* nd = NetworkDevice::instance(); - if (sendto(sock, (const char*)b.getCArray(), b.size(), 0, - (struct sockaddr *) &(a.addr), sizeof(a.addr)) == SOCKET_ERROR) { - Log::common()->printf("Error occured while sending packet " - "to %s\n", inet_ntoa(a.addr.sin_addr)); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - } else { - ++mSent; - bSent += b.size(); - } -} - - -bool LightweightConduit::messageWaiting() { - // We may have already pulled the message off the network stream - return alreadyReadMessage || Conduit::messageWaiting(); -} - - -uint32 LightweightConduit::waitingMessageType() { - NetworkDevice* nd = NetworkDevice::instance(); - if (! messageWaiting()) { - return 0; - } - - if (! alreadyReadMessage) { - messageBuffer.resize(8192); - - SOCKADDR_IN remote_addr; - int iRemoteAddrLen = sizeof(sockaddr); - - int ret = recvfrom(sock, (char*)messageBuffer.getCArray(), - messageBuffer.size(), 0, (struct sockaddr *) &remote_addr, - (socklen_t*)&iRemoteAddrLen); - - if (ret == SOCKET_ERROR) { - Log::common()->println("Error: recvfrom failed in " - "LightweightConduit::waitingMessageType()."); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - messageBuffer.resize(0); - messageSender = NetAddress(); - messageType = 0; - return 0; - } - - messageSender = NetAddress(remote_addr); - - ++mReceived; - bReceived += ret; - - messageBuffer.resize(ret, DONT_SHRINK_UNDERLYING_ARRAY); - - // The type is the first four bytes. It is little endian. - if (System::machineEndian() == G3D_LITTLE_ENDIAN) { - messageType = *((uint32*)messageBuffer.getCArray()); - } else { - // Swap the byte order - for (int i = 0; i < 4; ++i) { - ((char*)&messageType)[i] = messageBuffer[3 - i]; - } - } - - alreadyReadMessage = true; - } - - return messageType; -} - - -/////////////////////////////////////////////////////////////////////////////// - -NetListenerRef NetListener::create(const uint16 port) { - return new NetListener(port); -} - - -NetListener::NetListener(uint16 port) { - NetworkDevice* nd = NetworkDevice::instance(); - - // Start the listener socket - Log::common()->print("Creating a listener "); - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - - if (sock == SOCKET_ERROR) { - Log::common()->printf("FAIL"); - Log::common()->println(socketErrorCode()); - return; - } - Log::common()->println("Ok"); - - const int T = true; - - // Set reuse address so that a new server can start up soon after - // an old one has closed. - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket reuseaddr failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option reuseaddr."); - } - - - if (! nd->bind(sock, NetAddress(0, port))) { - Log::common()->printf("Unable to bind!\n"); - nd->closesocket(sock); - sock = (SOCKET)SOCKET_ERROR; - return; - } - - Log::common()->printf("Listening on port %5d ", port); - - // listen is supposed to return 0 when there is no error. - // The 2nd argument is the number of connections to allow pending - // at any time. - int L = listen(sock, 100); - if (L == SOCKET_ERROR) { - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - sock = (SOCKET)SOCKET_ERROR; - return; - } - Log::common()->println("Ok"); - Log::common()->printf("Now listening on socket %d.\n\n", sock); -} - - -NetListener::~NetListener() { - NetworkDevice* nd = NetworkDevice::instance(); - nd->closesocket(sock); -} - - -ReliableConduitRef NetListener::waitForConnection() { - NetworkDevice* nd = NetworkDevice::instance(); - // The address of the connecting host - SOCKADDR_IN remote_addr; - int iAddrLen = sizeof(remote_addr); - - Log::common()->println("Blocking in NetListener::waitForConnection()."); - - SOCKET sClient = accept(sock, (struct sockaddr*) &remote_addr, - (socklen_t*)&iAddrLen); - - if (sClient == SOCKET_ERROR) { - Log::common()->println("Error in NetListener::acceptConnection."); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - return NULL; - } - - Log::common()->printf("%s connected, transferred to socket %d.\n", - inet_ntoa(remote_addr.sin_addr), sClient); - - #ifndef G3D_WIN32 - return new ReliableConduit(sClient, - NetAddress(htonl(remote_addr.sin_addr.s_addr), - ntohs(remote_addr.sin_port))); - #else - return new ReliableConduit(sClient, - NetAddress(ntohl(remote_addr.sin_addr.S_un.S_addr), - ntohs(remote_addr.sin_port))); - #endif -} - - -bool NetListener::ok() const { - return (sock != 0) && (sock != SOCKET_ERROR); -} - - -bool NetListener::clientWaiting() const { - return readWaiting(sock); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void NetworkDevice::describeSystem( - TextOutput& t) { - - t.writeSymbols("Network", "{"); - t.writeNewline(); - t.pushIndent(); - - for (int i = 0; i < m_adapterArray.size(); ++i) { - m_adapterArray[i].describe(t); - } - - - t.popIndent(); - t.writeSymbols("}"); - t.writeNewline(); - t.writeNewline(); -} - - -void NetworkDevice::describeSystem( - std::string& s) { - - TextOutput t; - describeSystem(t); - t.commitString(s); -} - -} // namespace diff --git a/dep/src/g3dlite/PhysicsFrame.cpp b/dep/src/g3dlite/PhysicsFrame.cpp deleted file mode 100644 index 28ba8f8d477..00000000000 --- a/dep/src/g3dlite/PhysicsFrame.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** - @file PhysicsFrame.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-07-09 - @edited 2006-01-25 -*/ - -#include "G3D/platform.h" -#include "G3D/PhysicsFrame.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -PhysicsFrame::PhysicsFrame() { - translation = Vector3::zero(); - rotation = Quat(); -} - - -PhysicsFrame::PhysicsFrame( - const CoordinateFrame& coordinateFrame) { - - translation = coordinateFrame.translation; - rotation = Quat(coordinateFrame.rotation); -} - - -PhysicsFrame PhysicsFrame::operator*(const PhysicsFrame& other) const { - PhysicsFrame result; - - result.rotation = rotation * other.rotation; - result.translation = translation + rotation.toRotationMatrix() * other.translation; - - return result; -} - - -CoordinateFrame PhysicsFrame::toCoordinateFrame() const { - CoordinateFrame f; - - f.translation = translation; - f.rotation = rotation.toRotationMatrix(); - - return f; -} - - -PhysicsFrame PhysicsFrame::lerp( - const PhysicsFrame& other, - float alpha) const { - - PhysicsFrame result; - - result.translation = translation.lerp(other.translation, alpha); - result.rotation = rotation.slerp(other.rotation, alpha); - - return result; -} - - -void PhysicsFrame::deserialize(class BinaryInput& b) { - translation.deserialize(b); - rotation.deserialize(b); -} - - -void PhysicsFrame::serialize(class BinaryOutput& b) const { - translation.serialize(b); - rotation.serialize(b); -} - - -}; // namespace - diff --git a/dep/src/g3dlite/PrecomputedRandom.cpp b/dep/src/g3dlite/PrecomputedRandom.cpp deleted file mode 100644 index 387ded35195..00000000000 --- a/dep/src/g3dlite/PrecomputedRandom.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/** - @file PrecomputedRandom.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2009-03-31 - @edited 2009-07-01 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/PrecomputedRandom.h" -#include "G3D/System.h" - -namespace G3D { - -PrecomputedRandom::PrecomputedRandom(int dataSize, uint32 seed) : - Random((void*)NULL), - m_hemiUniform(NULL), - m_sphereBits(NULL), - m_modMask(dataSize - 1), - m_freeData(true) { - - alwaysAssertM(isPow2(dataSize), "dataSize must be a power of 2"); - m_index = seed & m_modMask; - - HemiUniformData* h; - SphereBitsData* s; - m_hemiUniform = h = (HemiUniformData*) System::malloc(sizeof(HemiUniformData) * dataSize); - m_sphereBits = s = (SphereBitsData*) System::malloc(sizeof(SphereBitsData) * dataSize); - - Random r; - - for (int i = 0; i < dataSize; ++i) { - h[i].uniform = r.uniform(); - r.cosHemi(h[i].cosHemiX, h[i].cosHemiY, h[i].cosHemiZ); - - s[i].bits = r.bits(); - r.sphere(s[i].sphereX, s[i].sphereY, s[i].sphereZ); - } - -} - - -PrecomputedRandom::PrecomputedRandom(const HemiUniformData* data1, const SphereBitsData* data2, int dataSize, uint32 seed) : - Random((void*)NULL), - m_hemiUniform(data1), - m_sphereBits(data2), - m_modMask(dataSize - 1), - m_freeData(false) { - - m_index = seed & m_modMask; - alwaysAssertM(isPow2(dataSize), "dataSize must be a power of 2"); -} - - -PrecomputedRandom::~PrecomputedRandom() { - if (m_freeData) { - System::free(const_cast(m_hemiUniform)); - System::free(const_cast(m_sphereBits)); - } -} - -float PrecomputedRandom::uniform(float low, float high) { - m_index = (m_index + 1) & m_modMask; - return low + m_hemiUniform[m_index].uniform * (high - low); -} - - -float PrecomputedRandom::uniform() { - m_index = (m_index + 1) & m_modMask; - return m_hemiUniform[m_index].uniform; -} - - -void PrecomputedRandom::cosHemi(float& x, float& y, float& z) { - m_index = (m_index + 1) & m_modMask; - x = m_hemiUniform[m_index].cosHemiX; - y = m_hemiUniform[m_index].cosHemiY; - z = m_hemiUniform[m_index].cosHemiZ; -} - -void PrecomputedRandom::cosPowHemi(const float k, float& x, float& y, float& z) { - // Computing a cosPowHemi costs 4 slow functions (pow, sqrt, sin, - // cos). We can do it with two, given a cosHemi sample, basically - // saving the cost of sin and cos and making a single 128-byte - // memory read (for a vector) instead of two (for adjacent uniform - // floats). - - // cos^1 distribution sample - float cos1; - cosHemi(x, y, cos1); - - // Fix the distribution by adjusting the cosine: - // rnd(cos^k t) = (rnd(cos(t))^2)^(1/k) - - // produces cos^k distribution sample - z = pow(cos1, 2.0f / (1.0f + k)); - - // Rescale x and y by sqrt(1.0f - square(z)) / sqrt(x*x + y*y). - // Add a very tiny offset to handle the (almost impossibly unlikely) case where - // z = 1 and x^2+y^2 = 0. - static const float eps = 0.000001f; - const float s = sqrt((1.0f + eps - square(z)) / (square(x) + square(y) + eps)); - - x *= s; - y *= s; -} - - -uint32 PrecomputedRandom::bits() { - m_index = (m_index + 1) & m_modMask; - return m_sphereBits[m_index].bits; -} - - -void PrecomputedRandom::sphere(float& x, float& y, float& z) { - m_index = (m_index + 1) & m_modMask; - x = m_sphereBits[m_index].sphereX; - y = m_sphereBits[m_index].sphereY; - z = m_sphereBits[m_index].sphereZ; -} - -} diff --git a/dep/src/g3dlite/Rect2D.cpp b/dep/src/g3dlite/Rect2D.cpp deleted file mode 100644 index e4148315a58..00000000000 --- a/dep/src/g3dlite/Rect2D.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/** - @file Rect2D.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-11-13 - @created 2009-11-16 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/Rect2D.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -/** \param any Must either Rect2D::xywh(#, #, #, #) or Rect2D::xyxy(#, #, #, #)*/ -Rect2D::Rect2D(const Any& any) { - any.verifyName("Rect2D"); - any.verifyType(Any::ARRAY); - any.verifySize(4); - if (toUpper(any.name()) == "RECT2D::XYWH") { - *this = Rect2D::xywh(any[0], any[1], any[2], any[3]); - } else { - any.verifyName("Rect2D::xyxy"); - *this = Rect2D::xyxy(any[0], any[1], any[2], any[3]); - } -} - - -/** Converts the Rect2D to an Any. */ -Rect2D::operator Any() const { - Any any(Any::ARRAY, "Rect2D::xywh"); - any.append(x0(), y0(), width(), height()); - return any; -} - -} diff --git a/dep/src/g3dlite/SplineBase.cpp b/dep/src/g3dlite/SplineBase.cpp deleted file mode 100644 index 41221624b06..00000000000 --- a/dep/src/g3dlite/SplineBase.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include "G3D/platform.h" -#include "G3D/Spline.h" - -namespace G3D { - -float SplineBase::getFinalInterval() const { - if (! cyclic) { - return 0; - } else if (finalInterval <= 0) { - int N = time.size(); - if (N >= 2) { - return (time[1] - time[0] + time[N - 1] - time[N - 2]) * 0.5f; - } else { - return 1.0f; - } - } else { - return finalInterval; - } -} - - -Matrix4 SplineBase::computeBasis() { - // The standard Catmull-Rom spline basis (e.g., Watt & Watt p108) - // is for [u^3 u^2 u^1 u^0] * B * [p[0] p[1] p[2] p[3]]^T. - // We need a basis formed for: - // - // U * C * [2*p'[1] p[1] p[2] 2*p'[2]]^T - // - // U * C * [p2-p0 p1 p2 p3-p1]^T - // - // To make this transformation, compute the differences of columns in C: - // For [p0 p1 p2 p3] - Matrix4 basis = - Matrix4( -1, 3, -3, 1, - 2, -5, 4, -1, - -1, 0, 1, 0, - 0, 2, 0, 0) * 0.5f; - - // For [-p0 p1 p2 p3]^T - basis.setColumn(0, -basis.column(0)); - - // For [-p0 p1 p2 p3-p1]^T - basis.setColumn(1, basis.column(1) + basis.column(3)); - - // For [p2-p0 p1 p2 p3-p1]^T - basis.setColumn(2, basis.column(2) - basis.column(0)); - - return basis; -} - - -float SplineBase::duration() const { - if (time.size() == 0) { - return 0; - } else { - return time.last() - time[0] + getFinalInterval(); - } -} - - -void SplineBase::computeIndexInBounds(float s, int& i, float& u) const { - int N = time.size(); - float t0 = time[0]; - float tn = time[N - 1]; - - i = iFloor((N - 1) * (s - t0) / (tn - t0)); - - // Inclusive bounds for binary search - int hi = N - 1; - int lo = 0; - - while ((time[i] > s) || (time[i + 1] <= s)) { - - if (time[i] > s) { - // too big - hi = i - 1; - } else if (time[i + 1] <= s) { - // too small - lo = i + 1; - } - - i = (hi + lo) / 2; - } - - // Having exited the above loop, i must be correct, so compute u. - u = (s - time[i]) / (time[i + 1] - time[i]); -} - - -void SplineBase::computeIndex(float s, int& i, float& u) const { - int N = time.size(); - debugAssertM(N > 0, "No control points"); - float t0 = time[0]; - float tn = time[N - 1]; - - if (N < 2) { - // No control points to work with - i = 0; - u = 0.0; - } else if (cyclic) { - float fi = getFinalInterval(); - - // Cyclic spline - if ((s < t0) || (s >= tn + fi)) { - // Cyclic, off the bottom or top - - // Compute offset and reduce to the in-bounds case - - float d = duration(); - // Number of times we wrapped around the cyclic array - int wraps = iFloor((s - t0) / d); - - debugAssert(s - d * wraps >= t0); - debugAssert(s - d * wraps < tn + getFinalInterval()); - - computeIndex(s - d * wraps, i, u); - i += wraps * N; - - } else if (s >= tn) { - debugAssert(s < tn + fi); - // Cyclic, off the top but before the end of the last interval - i = N - 1; - u = (s - tn) / fi; - - } else { - // Cyclic, in bounds - computeIndexInBounds(s, i, u); - } - - } else { - // Non-cyclic - - if (s < t0) { - // Non-cyclic, off the bottom. Assume points are spaced - // following the first time interval. - - float dt = time[1] - t0; - float x = (s - t0) / dt; - i = iFloor(x); - u = x - i; - - } else if (s >= tn) { - // Non-cyclic, off the top. Assume points are spaced following - // the last time interval. - - float dt = tn - time[N - 2]; - float x = N - 1 + (s - tn) / dt; - i = iFloor(x); - u = x - i; - - } else { - // In bounds, non-cyclic. Assume a regular - // distribution (which gives O(1) for uniform spacing) - // and then binary search to handle the general case - // efficiently. - computeIndexInBounds(s, i, u); - - } // if in bounds - } // if cyclic -} - -} diff --git a/dep/src/g3dlite/Stopwatch.cpp b/dep/src/g3dlite/Stopwatch.cpp deleted file mode 100644 index 9b785d50295..00000000000 --- a/dep/src/g3dlite/Stopwatch.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/** - @file Stopwatch.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2005-10-05 - @edited 2009-03-14 - - Copyright 2000-2009, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/Stopwatch.h" -#include "G3D/System.h" - -namespace G3D { - -Stopwatch::Stopwatch(const std::string& myName) : - myName(myName), - inBetween(false), lastTockTime(-1), - lastDuration(0), lastCycleCount(0), m_fps(0), emwaFPS(0), - m_smoothFPS(0), emwaDuration(0) { - computeOverhead(); - reset(); -} - - -void Stopwatch::computeOverhead() { - cycleOverhead = 0; - tick(); - tock(); - cycleOverhead = elapsedCycles(); -} - - -void Stopwatch::tick() { - // This is 'alwaysAssert' instead of 'debugAssert' - // since people rarely profile in debug mode. - alwaysAssertM(! inBetween, "Stopwatch::tick() called twice in a row."); - inBetween = true; - - // We read RDTSC twice here, but it is more abstract to implement this - // way and at least we're reading the cycle count last. - timeStart = System::time(); - System::beginCycleCount(cycleStart); -} - - -void Stopwatch::tock() { - System::endCycleCount(cycleStart); - RealTime now = System::time(); - lastDuration = now - timeStart; - if (abs(emwaDuration - lastDuration) > max(emwaDuration, lastDuration) * 0.50) { - // Off by more than 50% - emwaDuration = lastDuration; - } else { - emwaDuration = lastDuration * 0.05 + emwaDuration * 0.95; - } - - lastCycleCount = cycleStart - cycleOverhead; - if (lastCycleCount < 0) { - lastCycleCount = 0; - } - - if (lastTockTime != -1.0) { - m_fps = 1.0 / (now - lastTockTime); - - const double blend = 0.01; - emwaFPS = m_fps * blend + emwaFPS * (1.0 - blend); - - double maxDiscrepancyPercentage = 0.25; - if (abs(emwaFPS - m_fps) > max(emwaFPS, m_fps) * maxDiscrepancyPercentage) { - // The difference between emwa and m_fps is way off, so - // update emwa directly. - emwaFPS = m_fps * 0.20 + emwaFPS * 0.80; - } - - // Update m_smoothFPS only when the value varies significantly. - // We round so as to not mislead the user as to the accuracy of - // the number. - if (m_smoothFPS == 0) { - m_smoothFPS = m_fps; - } else if (emwaFPS <= 20) { - if (::fabs(m_smoothFPS - emwaFPS) > 0.75) { - // Small number and display is off by more than 0.75; round to the nearest 0.1 - m_smoothFPS = floor(emwaFPS * 10.0 + 0.5) / 10.0; - } - } else if (::fabs(m_smoothFPS - emwaFPS) > 1.25) { - // Large number and display is off by more than 1.25; round to the nearest 1.0 - m_smoothFPS = floor(emwaFPS + 0.5); - } - } - lastTockTime = now; - - alwaysAssertM(inBetween, "Stopwatch::tock() called without matching tick."); - inBetween = false; -} - - -void Stopwatch::reset() { - prevTime = startTime = System::time(); - prevMark = "start"; -} - - -void Stopwatch::after(const std::string& s) { - RealTime now = System::time(); - debugPrintf("%s: %10s - %8fs since %s (%fs since start)\n", - myName.c_str(), - s.c_str(), - now - prevTime, - prevMark.c_str(), - now - startTime); - prevTime = now; - prevMark = s; -} - -} - diff --git a/dep/src/g3dlite/ThreadSet.cpp b/dep/src/g3dlite/ThreadSet.cpp deleted file mode 100644 index ee3895fe9de..00000000000 --- a/dep/src/g3dlite/ThreadSet.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "G3D/ThreadSet.h" - -namespace G3D { - -int ThreadSet::size() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - int s = m_thread.size(); - me->m_lock.unlock(); - return s; -} - - -int ThreadSet::numStarted() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - int count = 0; - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->started()) { - ++count; - } - } - me->m_lock.unlock(); - return count; -} - - -void ThreadSet::start(GThread::SpawnBehavior lastBehavior) const { - ThreadSet* me = const_cast(this); - - Array unstarted; - me->m_lock.lock(); - // Find the unstarted threads - for (int i = 0; i < m_thread.size(); ++i) { - if (! m_thread[i]->started()) { - unstarted.append(m_thread[i]); - } - } - - int last = unstarted.size(); - if (lastBehavior == GThread::USE_CURRENT_THREAD) { - // Save the last unstarted for the current thread - --last; - } - - for (int i = 0; i < last; ++i) { - unstarted[i]->start(GThread::USE_NEW_THREAD); - } - - me->m_lock.unlock(); - - // Start the last one on my thread - if ((unstarted.size() > 0) && (lastBehavior == GThread::USE_CURRENT_THREAD)) { - unstarted.last()->start(GThread::USE_CURRENT_THREAD); - } -} - - -void ThreadSet::terminate() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->started()) { - m_thread[i]->terminate(); - } - } - me->m_lock.unlock(); -} - - -void ThreadSet::waitForCompletion() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->started()) { - m_thread[i]->waitForCompletion(); - } - } - me->m_lock.unlock(); -} - - -int ThreadSet::removeCompleted() { - m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->completed()) { - m_thread.fastRemove(i); - --i; - } - } - - int s = m_thread.size(); - m_lock.unlock(); - return s; -} - - -void ThreadSet::clear() { - m_lock.lock(); - m_thread.clear(); - m_lock.unlock(); -} - - -int ThreadSet::insert(const ThreadRef& t) { - m_lock.lock(); - bool found = false; - for (int i = 0; i < m_thread.size() && ! found; ++i) { - found = (m_thread[i] == t); - } - if (! found) { - m_thread.append(t); - } - int s = m_thread.size(); - m_lock.unlock(); - return s; -} - - -bool ThreadSet::remove(const ThreadRef& t) { - m_lock.lock(); - bool found = false; - for (int i = 0; i < m_thread.size() && ! found; ++i) { - found = (m_thread[i] == t); - if (found) { - m_thread.fastRemove(i); - } - } - m_lock.unlock(); - return found; -} - - -bool ThreadSet::contains(const ThreadRef& t) const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - bool found = false; - for (int i = 0; i < m_thread.size() && ! found; ++i) { - found = (m_thread[i] == t); - } - me->m_lock.unlock(); - return found; -} - - -ThreadSet::Iterator ThreadSet::begin() { - return m_thread.begin(); -} - - -ThreadSet::Iterator ThreadSet::end() { - return m_thread.end(); -} - - -ThreadSet::ConstIterator ThreadSet::begin() const { - return m_thread.begin(); -} - - -ThreadSet::ConstIterator ThreadSet::end() const { - return m_thread.end(); -} - - -} // namespace G3D diff --git a/dep/src/g3dlite/Vector2int16.cpp b/dep/src/g3dlite/Vector2int16.cpp deleted file mode 100644 index 2a4035a4d09..00000000000 --- a/dep/src/g3dlite/Vector2int16.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - @file Vector2int16.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-08-09 - @edited 2006-01-29 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector2int16.h" -#include "G3D/Vector2.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Vector2int16::Vector2int16(const class Vector2& v) { - x = (int16)iFloor(v.x + 0.5); - y = (int16)iFloor(v.y + 0.5); -} - - -Vector2int16::Vector2int16(class BinaryInput& bi) { - deserialize(bi); -} - - -void Vector2int16::serialize(class BinaryOutput& bo) const { - bo.writeInt16(x); - bo.writeInt16(y); -} - - -void Vector2int16::deserialize(class BinaryInput& bi) { - x = bi.readInt16(); - y = bi.readInt16(); -} - - -Vector2int16 Vector2int16::clamp(const Vector2int16& lo, const Vector2int16& hi) { - return Vector2int16(iClamp(x, lo.x, hi.x), iClamp(y, lo.y, hi.y)); -} - - -} diff --git a/dep/src/g3dlite/Vector3int16.cpp b/dep/src/g3dlite/Vector3int16.cpp deleted file mode 100644 index 44069b85d8c..00000000000 --- a/dep/src/g3dlite/Vector3int16.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/** - @file Vector3int16.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2003-04-07 - @edited 2006-01-17 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3int16.h" -#include "G3D/Vector3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/format.h" - -namespace G3D { - -Vector3int16::Vector3int16(const class Vector3& v) { - x = (int16)iFloor(v.x + 0.5); - y = (int16)iFloor(v.y + 0.5); - z = (int16)iFloor(v.z + 0.5); -} - - -Vector3int16::Vector3int16(class BinaryInput& bi) { - deserialize(bi); -} - - -void Vector3int16::serialize(class BinaryOutput& bo) const { - bo.writeInt16(x); - bo.writeInt16(y); - bo.writeInt16(z); -} - - -void Vector3int16::deserialize(class BinaryInput& bi) { - x = bi.readInt16(); - y = bi.readInt16(); - z = bi.readInt16(); -} - -std::string Vector3int16::toString() const { - return G3D::format("(%d, %d, %d)", x, y, z); -} - -} diff --git a/dep/src/g3dlite/Vector3int32.cpp b/dep/src/g3dlite/Vector3int32.cpp deleted file mode 100644 index 3bd8e9f2bc2..00000000000 --- a/dep/src/g3dlite/Vector3int32.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - @file Vector3int32.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - - @created 2008-07-01 - @edited 2008-07-01 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3int32.h" -#include "G3D/Vector3int16.h" -#include "G3D/Vector3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/format.h" - -namespace G3D { - -Vector3int32::Vector3int32(const class Vector3& v) { - x = (int32)iFloor(v.x + 0.5); - y = (int32)iFloor(v.y + 0.5); - z = (int32)iFloor(v.z + 0.5); -} - - -Vector3int32::Vector3int32(const class Vector3int16& v) { - x = v.x; - y = v.y; - z = v.z; -} - - -Vector3int32::Vector3int32(class BinaryInput& bi) { - deserialize(bi); -} - - -void Vector3int32::serialize(class BinaryOutput& bo) const { - bo.writeInt32(x); - bo.writeInt32(y); - bo.writeInt32(z); -} - - -void Vector3int32::deserialize(class BinaryInput& bi) { - x = bi.readInt32(); - y = bi.readInt32(); - z = bi.readInt32(); -} - -std::string Vector3int32::toString() const { - return G3D::format("(%d, %d, %d)", x, y, z); -} - -} diff --git a/dep/src/g3dlite/Vector4int8.cpp b/dep/src/g3dlite/Vector4int8.cpp deleted file mode 100644 index 70bd143e01d..00000000000 --- a/dep/src/g3dlite/Vector4int8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - @file Vector4int8.cpp - - Homogeneous vector class. - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2007-02-09 - @edited 2007-02-09 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/Vector4int8.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include - -namespace G3D { - -Vector4int8::Vector4int8(const Vector4& source) { - x = iClamp(iRound(source.x), -128, 127); - y = iClamp(iRound(source.y), -128, 127); - z = iClamp(iRound(source.z), -128, 127); - w = iClamp(iRound(source.w), -128, 127); -} - -Vector4int8::Vector4int8(const Vector3& source, int8 w) : w(w) { - x = iClamp(iRound(source.x), -128, 127); - y = iClamp(iRound(source.y), -128, 127); - z = iClamp(iRound(source.z), -128, 127); -} - -Vector4int8::Vector4int8(class BinaryInput& b) { - deserialize(b); -} - -void Vector4int8::serialize(class BinaryOutput& b) const { - // Intentionally write individual bytes to avoid endian issues - b.writeInt8(x); - b.writeInt8(y); - b.writeInt8(z); - b.writeInt8(w); -} - -void Vector4int8::deserialize(class BinaryInput& b) { - x = b.readInt8(); - y = b.readInt8(); - z = b.readInt8(); - w = b.readInt8(); -} - -} // namespace G3D - diff --git a/dep/src/g3dlite/Welder.cpp b/dep/src/g3dlite/Welder.cpp deleted file mode 100644 index b4f752f38bd..00000000000 --- a/dep/src/g3dlite/Welder.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/** - @file Welder.cpp - - @author Morgan McGuire, Kyle Whitson, Corey Taylor - - @created 2008-07-30 - @edited 2009-11-29 - */ - -#include "G3D/platform.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Sphere.h" -#include "G3D/PointHashGrid.h" -#include "G3D/Welder.h" -#include "G3D/Stopwatch.h" // for profiling -#include "G3D/AreaMemoryManager.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { namespace _internal{ - - -/** Used by WeldHelper2::smoothNormals. */ -class VN { -public: - Vector3 vertex; - Vector3 normal; - - VN() {} - VN(const Vector3& v, const Vector3& n) : vertex(v), normal(n) {} -}; - -/** Used by WeldHelper::getIndex to maintain a list of vertices by location. */ -class VNTi { -public: - Vector3 vertex; - Vector3 normal; - Vector2 texCoord; - int index; - - VNTi() : index(0) {} - - VNTi(const Vector3& v, const Vector3& n, const Vector2& t, int i) : - vertex(v), normal(n), texCoord(t), index(i) {} -}; - - -}} // G3D - -template <> struct HashTrait { - static size_t hashCode(const G3D::_internal::VN& k) { return static_cast(k.vertex.hashCode()); } -}; -template <> struct HashTrait { - static size_t hashCode(const G3D::_internal::VNTi& k) { return static_cast(k.vertex.hashCode()); } -}; - - -template<> struct EqualsTrait { - static bool equals(const G3D::_internal::VN& a, const G3D::_internal::VN& b) { return a.vertex == b.vertex; } -}; -template<> struct EqualsTrait { - static bool equals(const G3D::_internal::VNTi& a, const G3D::_internal::VNTi& b) { return a.vertex == b.vertex; } -}; - -template<> struct PositionTrait { - static void getPosition(const G3D::_internal::VN& v, G3D::Vector3& p) { p = v.vertex; } -}; -template<> struct PositionTrait { - static void getPosition(const G3D::_internal::VNTi& v, G3D::Vector3& p) { p = v.vertex; } -}; - -namespace G3D { namespace _internal { - -class WeldHelper { -private: - /** Used by getIndex and updateTriLists */ - PointHashGrid weldGrid; - - Array* outputVertexArray; - Array* outputNormalArray; - Array* outputTexCoordArray; - - float vertexWeldRadius; - /** Squared radius allowed for welding similar normals. */ - float normalWeldRadius2; - float texCoordWeldRadius2; - - float normalSmoothingAngle; - - /** - Returns the index of the vertex in - outputVertexArray/outputNormalArray/outputTexCoordArray - that is within the global tolerances of v,n,t. If there - is no such vertex, adds it to the arrays and returns that index. - - Called from updateTriLists(). - */ - int getIndex(const Vector3& v, const Vector3& n, const Vector2& t) { - PointHashGrid::SphereIterator it = - weldGrid.beginSphereIntersection(Sphere(v, vertexWeldRadius)); - - if (n.isZero()) { - // Don't bother trying to match the surface normal, since this vertex has no surface normal. - while (it.hasMore()) { - if ((t - it->texCoord).squaredLength() <= texCoordWeldRadius2) { - // This is the vertex - return it->index; - } - ++it; - } - } else { - while (it.hasMore()) { - if (((n - it->normal).squaredLength() <= normalWeldRadius2) && - ((t - it->texCoord).squaredLength() <= texCoordWeldRadius2)) { - // This is the vertex - return it->index; - } - ++it; - } - } - - // Note that a sliver triangle processed before its neighbors may reach here - // with a zero length normal. - - // The vertex does not exist. Create it. - const int i = outputVertexArray->size(); - outputVertexArray->append(v); - outputNormalArray->append(n); - outputTexCoordArray->append(t); - - // Store in the grid so that it will be remembered. - weldGrid.insert(VNTi(v, n, t, i)); - - return i; - } - - - /** - Updates each indexArray to refer to vertices in the - outputVertexArray. - - Called from process() - */ - void updateTriLists( - Array*>& indexArrayArray, - const Array& vertexArray, - const Array& normalArray, - const Array& texCoordArray) { - - // Compute a hash grid so that we can find neighbors quickly. - // It begins empty and is extended as the tri lists are iterated - // through. - weldGrid.clear(); - - // Process all triLists - int numTriLists = indexArrayArray.size(); - int u = 0; - for (int t = 0; t < numTriLists; ++t) { - Array& triList = *(indexArrayArray[t]); - - // For all vertices in this list - for (int v = 0; v < triList.size(); ++v) { - // This vertex mapped to u in the flatVertexArray - triList[v] = getIndex(vertexArray[u], normalArray[u], texCoordArray[u]); - - /* -# ifdef G3D_DEBUG - { - int i = triList[v]; - Vector3 N = normalArray[i]; - debugAssertM(N.length() > 0.9f, "Produced non-unit normal"); - } -# endif - */ - ++u; - } - } - } - - /** Expands the indexed triangle lists into a triangle list. - - Called from process() */ - void unroll( - const Array*>& indexArrayArray, - const Array& vertexArray, - const Array& texCoordArray, - Array& unrolledVertexArray, - Array& unrolledTexCoordArray) { - - int numTriLists = indexArrayArray.size(); - for (int t = 0; t < numTriLists; ++t) { - const Array& triList = *(indexArrayArray[t]); - for (int v = 0; v < triList.size(); ++v) { - int i = triList[v]; - unrolledVertexArray.append(vertexArray[i]); - unrolledTexCoordArray.append(texCoordArray[i]); - } - } - } - - /** For every three vertices, compute the face normal and store it three times. - Sliver triangles have a zero surface normal, which we will later take to - match *any* surface normal. */ - void computeFaceNormals( - const Array& vertexArray, - Array& faceNormalArray) { - - debugAssertM(vertexArray.size() % 3 == 0, "Input is not a triangle soup"); - debugAssertM(faceNormalArray.size() == 0, "Output must start empty."); - - for (int v = 0; v < vertexArray.size(); v += 3) { - const Vector3& e0 = vertexArray[v + 1] - vertexArray[v]; - const Vector3& e1 = vertexArray[v + 2] - vertexArray[v]; - - // Note that the length may be zero in the case of sliver polygons, e.g., - // those correcting a T-junction. - const Vector3& n = e0.cross(e1).directionOrZero(); - - // Append the normal once per vertex. - faceNormalArray.append(n, n, n); - } - } - - /** - Computes @a smoothNormalArray, whose elements are those of normalArray averaged - with neighbors within the angular cutoff. - */ - void smoothNormals( - const Array& vertexArray, - const Array& normalArray, - Array& smoothNormalArray) { - - // Create an area memory manager for fast deallocation - MemoryManager::Ref mm = AreaMemoryManager::create(iRound(sizeof(VN) * normalArray.size() * 1.5)); - - if (normalSmoothingAngle <= 0) { - smoothNormalArray = normalArray; - return; - } - - const float cosThresholdAngle = (float)cos(normalSmoothingAngle); - - debugAssert(vertexArray.size() == normalArray.size()); - smoothNormalArray.resize(normalArray.size()); - - // Compute a hash grid so that we can find neighbors quickly. - PointHashGrid grid(vertexWeldRadius, mm); - for (int v = 0; v < normalArray.size(); ++v) { - grid.insert(VN(vertexArray[v], normalArray[v])); - } - - for (int v = 0; v < normalArray.size(); ++v) { - // Compute the sum of all nearby normals within the cutoff angle. - // Search within the vertexWeldRadius, since those are the vertices - // that will collapse to the same point. - PointHashGrid::SphereIterator it = - grid.beginSphereIntersection(Sphere(vertexArray[v], vertexWeldRadius)); - - Vector3 sum; - - const Vector3& original = normalArray[v]; - while (it.hasMore()) { - const Vector3& N = it->normal; - const float cosAngle = N.dot(original); - - if (cosAngle > cosThresholdAngle) { - // This normal is close enough to consider - sum += N; - } - ++it; - } - - const Vector3& average = sum.directionOrZero(); - - const bool indeterminate = average.isZero(); - // Never "smooth" a normal so far that it points backwards - const bool backFacing = original.dot(average) < 0; - - if (indeterminate || backFacing) { - // Revert to the face normal - smoothNormalArray[v] = original; - } else { - // Average available normals - smoothNormalArray[v] = average; - } - } - } - -public: - - - /** - Algorithm: - - 1. Unroll the indexed triangle list into a triangle list, where - there are duplicated vertices. - - 2. Compute face normals for all triangles, and expand those into - the triangle vertices. - - 3. At each vertex, average all normals that are within normalSmoothingAngle. - - 4. Generate output indexArrayArray. While doing so, merge all vertices where - the distance between position, texCoord, and normal is within the thresholds. - */ - void process( - Array& vertexArray, - Array& texCoordArray, - Array& normalArray, - Array*>& indexArrayArray, - float normAngle, - float texRadius, - float normRadius) { - - normalSmoothingAngle = normAngle; - normalWeldRadius2 = square(normRadius); - texCoordWeldRadius2 = square(texRadius); - - const bool hasTexCoords = (texCoordArray.size() > 0); - - if (hasTexCoords) { - debugAssertM(vertexArray.size() == texCoordArray.size(), - "Input arrays are not parallel."); - } - - Array unrolledVertexArray; - Array unrolledFaceNormalArray; - Array unrolledSmoothNormalArray; - Array unrolledTexCoordArray; - - if (! hasTexCoords) { - // Generate all zero texture coordinates - texCoordArray.resize(vertexArray.size()); - } - - // Generate a flat (unrolled) triangle list with texture coordinates. - unroll(indexArrayArray, vertexArray, texCoordArray, - unrolledVertexArray, unrolledTexCoordArray); - - // Put the output back into the input slots. - outputVertexArray = &vertexArray; - outputNormalArray = &normalArray; - outputTexCoordArray = &texCoordArray; - outputVertexArray->fastClear(); - outputNormalArray->fastClear(); - outputTexCoordArray->fastClear(); - - // For every three vertices, generate their face normal and store it at - // each vertex. The output array has the same length as the input. - computeFaceNormals(unrolledVertexArray, unrolledFaceNormalArray); - - // Compute smooth normals at vertices. - if (unrolledFaceNormalArray.size() > 0) { - smoothNormals(unrolledVertexArray, unrolledFaceNormalArray, unrolledSmoothNormalArray); - unrolledFaceNormalArray.clear(); - } - - // Regenerate the triangle lists - updateTriLists(indexArrayArray, unrolledVertexArray, unrolledSmoothNormalArray, unrolledTexCoordArray); - - if (! hasTexCoords) { - // Throw away the generated texCoords - texCoordArray.resize(0); - } - } - - WeldHelper(float vertRadius) : - weldGrid(vertRadius), - vertexWeldRadius(vertRadius) {} - -}; -} // Internal - -void Welder::weld( - Array& vertexArray, - Array& texCoordArray, - Array& normalArray, - Array*>& indexArrayArray, - const Welder::Settings& settings) { - - _internal::WeldHelper(settings.vertexWeldRadius).process( - vertexArray, texCoordArray, normalArray, indexArrayArray, - settings.normalSmoothingAngle, settings.textureWeldRadius, settings.normalWeldRadius); -} - - -Welder::Settings::Settings(const Any& any) { - *this = Settings(); - any.verifyName("Welder::Settings"); - for (Any::AnyTable::Iterator it = any.table().begin(); it.hasMore(); ++it) { - const std::string& key = toLower(it->key); - if (key == "normalsmoothingangle") { - normalSmoothingAngle = it->value; - } else if (key == "vertexweldradius") { - vertexWeldRadius = it->value; - } else if (key == "textureweldradius") { - textureWeldRadius = it->value; - } else if (key == "normalweldradius") { - normalWeldRadius = it->value; - } else { - any.verify(false, "Illegal key: " + it->key); - } - } -} - -Welder::Settings::operator Any() const { - Any a(Any::TABLE, "Welder::Settings"); - a.set("normalSmoothingAngle", normalSmoothingAngle); - a.set("vertexWeldRadius", vertexWeldRadius); - a.set("textureWeldRadius", textureWeldRadius); - a.set("normalWeldRadius", normalWeldRadius); - return a; -} - -} // G3D diff --git a/dep/src/g3dlite/WinMain.cpp b/dep/src/g3dlite/WinMain.cpp deleted file mode 100644 index 3cee71084e4..00000000000 --- a/dep/src/g3dlite/WinMain.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - Dervied from SDL_main.c, which was placed in the public domain by Sam Lantinga 4/13/98 - - The WinMain function -- calls your program's main() function -*/ - -#include "G3D/platform.h" - -#ifdef G3D_WIN32 - -#include -#include -#include - -#ifdef main -# ifndef _WIN32_WCE_EMULATION -# undef main -# endif /* _WIN32_WCE_EMULATION */ -#endif /* main */ - -#if defined(_WIN32_WCE) && _WIN32_WCE < 300 -/* seems to be undefined in Win CE although in online help */ -#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) -#endif /* _WIN32_WCE < 300 */ - -// Turn off the G3D for loop scoping for C++ -#ifdef for -# undef for -#endif - -extern int main(int argc, const char** argv); - -/* Parse a command line buffer into arguments */ -static int ParseCommandLine(char *cmdline, char **argv) { - char *bufp; - int argc; - - argc = 0; - for (bufp = cmdline; *bufp;) { - /* Skip leading whitespace */ - while (isspace(*bufp)) { - ++bufp; - } - /* Skip over argument */ - if (*bufp == '"') { - ++bufp; - if (*bufp) { - if (argv) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while (*bufp && (*bufp != '"')) { - ++bufp; - } - } else { - if (*bufp) { - if (argv) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while (*bufp && !isspace(*bufp)) { - ++bufp; - } - } - if (*bufp) { - if (argv) { - *bufp = '\0'; - } - ++bufp; - } - } - if (argv) { - argv[argc] = NULL; - } - return (argc); -} - -/* Show an error message */ -static void ShowError(const char *title, const char *message) { -/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ -#ifdef USE_MESSAGEBOX - MessageBox(NULL, message, title, MB_ICONEXCLAMATION | MB_OK); -#else - fprintf(stderr, "%s: %s\n", title, message); -#endif -} - -/* Pop up an out of memory message, returns to Windows */ -static BOOL OutOfMemory(void) { - ShowError("Fatal Error", "Out of memory - aborting"); - return FALSE; -} - - -int WINAPI G3D_WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) { - char **argv; - int argc; - int status; - char *cmdline; -# ifdef _WIN32_WCE - wchar_t *bufp; - int nLen; -# else - char *bufp; - size_t nLen; -# endif - (void)sw; - (void)szCmdLine; - (void)hInst; - (void)hPrev; - -#ifdef _WIN32_WCE -#error WinCE not supported - /* - nLen = wcslen(szCmdLine) + 128 + 1; - bufp = SDL_stack_alloc(wchar_t, nLen * 2); - wcscpy(bufp, TEXT("\"")); - GetModuleFileName(NULL, bufp + 1, 128 - 3); - wcscpy(bufp + wcslen(bufp), TEXT("\" ")); - wcsncpy(bufp + wcslen(bufp), szCmdLine, nLen - wcslen(bufp)); - nLen = wcslen(bufp) + 1; - cmdline = SDL_stack_alloc(char, nLen); - if (cmdline == NULL) { - return OutOfMemory(); - } - WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); - */ -#else - /* Grab the command line */ - bufp = GetCommandLineA(); - nLen = strlen(bufp) + 1; - cmdline = (char*)malloc(sizeof(char) * nLen); - if (cmdline == NULL) { - return OutOfMemory(); - } - strncpy(cmdline, bufp, nLen); -#endif - - /* Parse it into argv and argc */ - argc = ParseCommandLine(cmdline, NULL); - argv = (char**)malloc(sizeof(char*) * (argc + 1)); - if (argv == NULL) { - return OutOfMemory(); - } - ParseCommandLine(cmdline, argv); - - /* Run the main program */ - status = main(argc, (const char**)argv); - free(argv); - free(cmdline); - - return status; -} - -#endif // if Win32 diff --git a/dep/src/g3dlite/constants.cpp b/dep/src/g3dlite/constants.cpp deleted file mode 100644 index 52cad3cd90b..00000000000 --- a/dep/src/g3dlite/constants.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/** - @file constants.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @created 2009-05-20 - @edited 2010-01-29 -*/ -#include "G3D/constants.h" -#include "G3D/Any.h" -#include "G3D/stringutils.h" - -namespace G3D { - -const std::string MirrorQuality::str[] = {"NONE", "STATIC_ENV", "DYNAMIC_PLANAR", "DYNAMIC_ENV", "BEST"}; -const MirrorQuality::Value MirrorQuality::enm[] = {MirrorQuality::NONE, MirrorQuality::STATIC_ENV, - MirrorQuality::DYNAMIC_PLANAR, MirrorQuality::DYNAMIC_ENV, MirrorQuality::BEST}; - -MirrorQuality::MirrorQuality(const class Any& any) { - *this = any; -} - - -MirrorQuality& MirrorQuality::operator=(const Any& any) { - const std::string& s = toUpper(any.string()); - - for (int i = 0; ! str[i].empty(); ++i) { - if (s == str[i]) { - value = enm[i]; - return *this; - } - } - - any.verify(false, "Unrecognized MirrorQuality constant"); - return *this; -} - - -MirrorQuality::operator Any() const { - return toString(); -} - - -const std::string& MirrorQuality::toString() const { - return str[value]; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -const std::string RefractionQuality::str[] = {"NONE", "STATIC_ENV", "DYNAMIC_FLAT", "DYNAMIC_FLAT_MULTILAYER", "DYNAMIC_ENV", "BEST"}; -const RefractionQuality::Value RefractionQuality::enm[] = {RefractionQuality::NONE, RefractionQuality::STATIC_ENV, - RefractionQuality::DYNAMIC_FLAT, RefractionQuality::DYNAMIC_FLAT_MULTILAYER, RefractionQuality::DYNAMIC_ENV, RefractionQuality::BEST}; - -RefractionQuality::RefractionQuality(const class Any& any) { - *this = any; -} - - -RefractionQuality& RefractionQuality::operator=(const Any& any) { - const std::string& s = toUpper(any.string()); - - for (int i = 0; ! str[i].empty(); ++i) { - if (s == str[i]) { - value = enm[i]; - return *this; - } - } - - any.verify(false, "Unrecognized RefractionQuality constant"); - return *this; -} - - -RefractionQuality::operator Any() const { - return toString(); -} - - -const std::string& RefractionQuality::toString() const { - return str[value]; -} - -} // G3D diff --git a/dep/src/g3dlite/filter.cpp b/dep/src/g3dlite/filter.cpp deleted file mode 100644 index 72d6f0e05a7..00000000000 --- a/dep/src/g3dlite/filter.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - @file filter.cpp - - @author Morgan McGuire, http://graphics.cs.williams.edu - @created 2007-03-01 - @edited 2007-03-01 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ -#include "G3D/filter.h" - -namespace G3D { - -void gaussian1D(Array& coeff, int N, float std) { - coeff.resize(N); - float sum = 0.0f; - for (int i = 0; i < N; ++i) { - float x = i - (N - 1) / 2.0f; - float p = -square(x / std) / 2.0f; - float y = exp(p); - coeff[i] = y; - sum += y; - } - - for (int i = 0; i < N; ++i) { - coeff[i] /= sum; - } -} - - -} // namespace diff --git a/dep/src/g3dlite/license.cpp b/dep/src/g3dlite/license.cpp deleted file mode 100644 index 5049184cf9b..00000000000 --- a/dep/src/g3dlite/license.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/** - @file license.cpp - - @author Morgan McGuire, graphics3d.com - - @created 2004-04-15 - @edited 2004-04-15 -*/ - -#include "G3D/format.h" -#include - -namespace G3D { - -std::string license() { - return format( - -"This software is based in part on the PNG Reference Library which is\n" -"Copyright (c) 2004 Glenn Randers-Pehrson\n\n" -"This software is based in part on the work of the Independent JPEG Group.\n\n" -"This software is based on part on the FFmpeg libavformat and libavcodec libraries\n" -"(\"FFmpeg\", http://ffmpeg.mplayerhq.hu), which are included under the terms of the\n" -"GNU Lesser General Public License (LGPL), (http://www.gnu.org/copyleft/lesser.html).\n\n" -"%s" -"This program uses the G3D Library (http://g3d.sf.net), which\n" -"is licensed under the \"Modified BSD\" Open Source license. The G3D library\n" -"source code is Copyright © 2000-2010, Morgan McGuire, All rights reserved.\n" -"This program uses The OpenGL Extension Wrangler Library, which \n" -"is licensed under the \"Modified BSD\" Open Source license. \n" -"The OpenGL Extension Wrangler Library source code is\n" -"Copyright (C) 2002-2008, Milan Ikits \n" -"Copyright (C) 2002-2008, Marcelo E. Magallon \n" -"Copyright (C) 2002, Lev Povalahev\n" -"All rights reserved.\n\n" -"The Modified BSD license is below, and requires the following statement:\n" -"\n" -"Redistribution and use in source and binary forms, with or without \n" -"modification, are permitted provided that the following conditions are met:\n" -"\n" -"* Redistributions of source code must retain the above copyright notice, \n" -" this list of conditions and the following disclaimer.\n" -"* Redistributions in binary form must reproduce the above copyright notice, \n" -" this list of conditions and the following disclaimer in the documentation \n" -" and/or other materials provided with the distribution.\n" -"* The name of the author may be used to endorse or promote products \n" -" derived from this software without specific prior written permission.\n" -"\n" -"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n" -"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n" -"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" -"ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n" -"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n" -"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n" -"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n" -"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n" -"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n" -"ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n" -"THE POSSIBILITY OF SUCH DAMAGE.\n" -"\n\n" -"G3D VERSION %d\n", - -#ifdef G3D_WIN32 - "" // Win32 doesn't use SDL -#else - "This software uses the Simple DirectMedia Layer library (\"SDL\",\n" - "http://www.libsdl.org), which is included under the terms of the\n" - "GNU Lesser General Public License, (http://www.gnu.org/copyleft/lesser.html).\n\n" -#endif -, -G3D_VER); -} - -} diff --git a/dep/src/g3dlite/license.html b/dep/src/g3dlite/license.html deleted file mode 100644 index 11c33882248..00000000000 --- a/dep/src/g3dlite/license.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - G3D Innovation Engine: License - - - - -
- - - - - - - - - -
- - - - - -
- Support Forum       - Library Source       - SourceForge Page       - Web Page -
-
-
- - - Wiki Doc - - - Data - - - API Index - - - APIs by Level - - - APIs by Task - -
-
-
- -
- - - - -
- - -

License

-Intent of License

-

(This section is informal and not legally binding.)

-


- This library is free code-- you can use it without charge and it is minimally legally encumbered. Unlike some other free libraries, we do not require you to release your source code or make your own program open source.

-

I intend the license (below) to protect me and the other contributors from liability and allow you to use the source however you want. You can make your own closed or open-source programs, sell them, give them away, whatever.

-

The license for G3D itself and the libaries included in the G3D distribution create certain documentation obligations for you. For convenience, G3D::license is a function that returns the license string you must put in your documentation. G3D::GApp will automatically write a file (g3d-license.txt) to disk with the contents of this license unless you tell it not to, thus automatically satisfying your documentation requirement after the first time you run a G3D program.

-

Most of the data resources have either entered the public domain and have been in several published papers or are data that I have explicitly received permission to distribute with G3D. The G3D fonts are actually font images, not TrueType font descriptions and may be freely distributed. As a rule of thumb, you can freely use and distribute anything you find in the data directory but may need permission to use it in a commercial product. Check the various copyright.txt files in the data directories for specific information.

-

You are required by the BSD license to acknowledge G3D in your documentation. This can be as minimal as a note buried in the fine print at the end of a manual or a text file accompanying your program. I appreciate it if you acknowledged the library more publicly but you aren't required to.

-

Likewise, you are encouraged but not required to submit patches to improve the library for the benefit of all. Post bugs, patches, and questions to the g3d-users forum linked at the top of this page.

-

-Morgan McGuire <morgan@cs.williams.edu>

-
-

-License

-

G3D is licensed under the BSD license, with portions controlled by the IJG license, PNG Reference Library license.

-

-
-osi-certified-120x100.gif -
-

-

This product uses software from the G3D project (http://g3d.sf.net)

-

Copyright © 2000-2010, Morgan McGuire

-

All rights reserved.

-

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

-

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

-

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.

-

Neither the name of Morgan McGuire, Williams College, Brown University, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

-

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.

-
- -
-G3D Innovation Engine documentation generated on Thu Mar 25 14:54:30 2010 using -doxygen - 1.6.1
- - - - - - - - - diff --git a/dep/src/g3dlite/uint128.cpp b/dep/src/g3dlite/uint128.cpp deleted file mode 100644 index 1f596fc3e51..00000000000 --- a/dep/src/g3dlite/uint128.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/** - @file uint128.cpp - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - @author Kyle Whitson - - @created 2008-07-17 - @edited 2008-07-17 - */ - -#include "G3D/uint128.h" - -namespace G3D { - -/** Adds two 64-bit integers, placing the result and the overflow into 64-bit integers.*/ -static void addAndCarry(const uint64& _a, const uint64& _b, uint64& carry, uint64& result) { - - // Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros. - // This eliminates the need to and with 0xFFFFFFFF. - uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32}; - uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32}; - - uint64 tmp = uint64(a[0]) + b[0]; - - result = tmp & 0xFFFFFFFF; - uint32 c = tmp >> 32; - - tmp = uint64(c) + a[1] + b[1]; - result += tmp << 32; - carry = (tmp >> 32); -} - -/** Multiplies two unsigned 64-bit integers, placing the result into one 64-bit int and the overflow into another.*/ -void multiplyAndCarry(const uint64& _a, const uint64& _b, uint64& carry, uint64& result) { - - // Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros. - // This eliminates the need to and with 0xFFFFFFFF. - uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32}; - uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32}; - - uint64 prod [2][2]; - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 2; ++j) { - prod[i][j] = uint64(a[i]) * b[j]; - } - } - - // The product of the low bits of a and b will always fit into the result - result = prod[0][0]; - - // The product of the high bits of a and b will never fit into the result - carry = prod[1][1]; - - // The high 32 bits of prod[0][1] and prod[1][0] will never fit into the result - carry += prod[0][1] >> 32; - carry += prod[1][0] >> 32; - - uint64 tmp; - addAndCarry(result, (prod[0][1] << 32), tmp, result); - carry += tmp; - addAndCarry(result, (prod[1][0] << 32), tmp, result); - carry += tmp; -} - - -uint128::uint128(const uint64& hi, const uint64& lo) : hi(hi), lo(lo) { -} - -uint128::uint128(const uint64& lo) : hi(0), lo(lo) { -} - -uint128& uint128::operator+=(const uint128& x) { - - G3D::uint64 carry; - addAndCarry(lo, x.lo, carry, lo); - - // Adding the carry will change hi. Save the old hi bits in case this == x. - const uint64 xHi = x.hi; - hi += carry; - hi += xHi; - return *this; -} - -uint128& uint128::operator*=(const uint128& x) { - - // The low bits will get overwritten when doing the multiply, so back up both (in case &x == this) - const uint64 oldLo = lo; - const uint64 oldXLo = x.lo; - - G3D::uint64 carry; - multiplyAndCarry(oldLo, oldXLo, carry, lo); - - // Overflow doesn't matter here because the result is going into hi - any overflow will exceed the capacity of a 128-bit number - // Note: hi * x.hi will always overflow, since (x * 2^64) * (y * 2^64) = x*y*(2^128). The largest number expressable in 128 bits is - // 2^128 - 1. - hi = carry + (oldLo * x.hi) + (hi * oldXLo); - - return *this; -} - -uint128& uint128::operator^=(const uint128& x) { - hi ^= x.hi; - lo ^= x.lo; - return *this; -} - -uint128& uint128::operator&=(const uint128& x) { - hi &= x.hi; - lo &= x.lo; - return *this; -} - -uint128& uint128::operator|=(const uint128& x) { - hi |= x.hi; - lo |= x.lo; - return *this; -} - -bool uint128::operator==(const uint128& x) { - return (hi == x.hi) && (lo == x.lo); -} - -uint128& uint128::operator>>=(const int x) { - - //Before shifting, mask out the bits that will be shifted out of hi. - //Put a 1 in the first bit that will not be lost in the shift, then subtract 1 to get the mask. - uint64 mask = ((uint64)1L << x) - 1; - uint64 tmp = hi & mask; - hi >>= x; - - //Shift lo and add the bits shifted down from hi - lo = (lo >> x) + (tmp << (64 - x)); - - return *this; -} - -uint128& uint128::operator<<=(const int x) { - - //Before shifting, mask out the bits that will be shifted out of lo. - //Put a 1 in the last bit that will be lost in the shift, then subtract 1 to get the logical inverse of the mask. - //A bitwise NOT will then produce the correct mask. - uint64 mask = ~((((uint64)1L) << (64 - x)) - 1); - uint64 tmp = lo & mask; - lo <<= x; - - //Shift hi and add the bits shifted up from lo - hi = (hi << x) + (tmp >> (64 - x)); - - return *this; -} - -uint128 uint128::operator&(const uint128& x) { - return uint128(hi & x.hi, lo & x.lo); -} -} diff --git a/dep/src/jmalloc/CMakeLists.txt b/dep/src/jmalloc/CMakeLists.txt deleted file mode 100644 index c3e4e81782c..00000000000 --- a/dep/src/jmalloc/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -SET(jmalloc_STAT_SRC - arena.c - chunk.c - chunk_mmap.c - ckh.c - extent.c - huge.c - mb.c - prof.c - tcache.c - base.c - chunk_dss.c - chunk_swap.c - ctl.c - hash.c - jemalloc.c - mutex.c - stats.c - ) - -include_directories( - ${CMAKE_SOURCE_DIR}/dep/include - ) - -add_definitions(-D_GNU_SOURCE -D_REENTRANT) - -add_library(jmalloc STATIC ${jmalloc_STAT_SRC}) \ No newline at end of file diff --git a/dep/src/jmalloc/arena.c b/dep/src/jmalloc/arena.c deleted file mode 100644 index e74b4701907..00000000000 --- a/dep/src/jmalloc/arena.c +++ /dev/null @@ -1,2446 +0,0 @@ -#define JEMALLOC_ARENA_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -size_t opt_lg_qspace_max = LG_QSPACE_MAX_DEFAULT; -size_t opt_lg_cspace_max = LG_CSPACE_MAX_DEFAULT; -ssize_t opt_lg_dirty_mult = LG_DIRTY_MULT_DEFAULT; -uint8_t const *small_size2bin; - -/* Various bin-related settings. */ -unsigned nqbins; -unsigned ncbins; -unsigned nsbins; -unsigned nbins; -size_t qspace_max; -size_t cspace_min; -size_t cspace_max; -size_t sspace_min; -size_t sspace_max; - -size_t lg_mspace; -size_t mspace_mask; - -/* - * const_small_size2bin is a static constant lookup table that in the common - * case can be used as-is for small_size2bin. For dynamically linked programs, - * this avoids a page of memory overhead per process. - */ -#define S2B_1(i) i, -#define S2B_2(i) S2B_1(i) S2B_1(i) -#define S2B_4(i) S2B_2(i) S2B_2(i) -#define S2B_8(i) S2B_4(i) S2B_4(i) -#define S2B_16(i) S2B_8(i) S2B_8(i) -#define S2B_32(i) S2B_16(i) S2B_16(i) -#define S2B_64(i) S2B_32(i) S2B_32(i) -#define S2B_128(i) S2B_64(i) S2B_64(i) -#define S2B_256(i) S2B_128(i) S2B_128(i) -/* - * The number of elements in const_small_size2bin is dependent on page size - * and on the definition for SUBPAGE. If SUBPAGE changes, the '- 255' must also - * change, along with the addition/removal of static lookup table element - * definitions. - */ -static const uint8_t const_small_size2bin[STATIC_PAGE_SIZE - 255] = { - S2B_1(0xffU) /* 0 */ -#if (LG_QUANTUM == 4) -/* 16-byte quantum **********************/ -# ifdef JEMALLOC_TINY -# if (LG_TINY_MIN == 2) - S2B_4(0) /* 4 */ - S2B_4(1) /* 8 */ - S2B_8(2) /* 16 */ -# define S2B_QMIN 2 -# elif (LG_TINY_MIN == 3) - S2B_8(0) /* 8 */ - S2B_8(1) /* 16 */ -# define S2B_QMIN 1 -# else -# error "Unsupported LG_TINY_MIN" -# endif -# else - S2B_16(0) /* 16 */ -# define S2B_QMIN 0 -# endif - S2B_16(S2B_QMIN + 1) /* 32 */ - S2B_16(S2B_QMIN + 2) /* 48 */ - S2B_16(S2B_QMIN + 3) /* 64 */ - S2B_16(S2B_QMIN + 4) /* 80 */ - S2B_16(S2B_QMIN + 5) /* 96 */ - S2B_16(S2B_QMIN + 6) /* 112 */ - S2B_16(S2B_QMIN + 7) /* 128 */ -# define S2B_CMIN (S2B_QMIN + 8) -#else -/* 8-byte quantum ***********************/ -# ifdef JEMALLOC_TINY -# if (LG_TINY_MIN == 2) - S2B_4(0) /* 4 */ - S2B_4(1) /* 8 */ -# define S2B_QMIN 1 -# else -# error "Unsupported LG_TINY_MIN" -# endif -# else - S2B_8(0) /* 8 */ -# define S2B_QMIN 0 -# endif - S2B_8(S2B_QMIN + 1) /* 16 */ - S2B_8(S2B_QMIN + 2) /* 24 */ - S2B_8(S2B_QMIN + 3) /* 32 */ - S2B_8(S2B_QMIN + 4) /* 40 */ - S2B_8(S2B_QMIN + 5) /* 48 */ - S2B_8(S2B_QMIN + 6) /* 56 */ - S2B_8(S2B_QMIN + 7) /* 64 */ - S2B_8(S2B_QMIN + 8) /* 72 */ - S2B_8(S2B_QMIN + 9) /* 80 */ - S2B_8(S2B_QMIN + 10) /* 88 */ - S2B_8(S2B_QMIN + 11) /* 96 */ - S2B_8(S2B_QMIN + 12) /* 104 */ - S2B_8(S2B_QMIN + 13) /* 112 */ - S2B_8(S2B_QMIN + 14) /* 120 */ - S2B_8(S2B_QMIN + 15) /* 128 */ -# define S2B_CMIN (S2B_QMIN + 16) -#endif -/****************************************/ - S2B_64(S2B_CMIN + 0) /* 192 */ - S2B_64(S2B_CMIN + 1) /* 256 */ - S2B_64(S2B_CMIN + 2) /* 320 */ - S2B_64(S2B_CMIN + 3) /* 384 */ - S2B_64(S2B_CMIN + 4) /* 448 */ - S2B_64(S2B_CMIN + 5) /* 512 */ -# define S2B_SMIN (S2B_CMIN + 6) - S2B_256(S2B_SMIN + 0) /* 768 */ - S2B_256(S2B_SMIN + 1) /* 1024 */ - S2B_256(S2B_SMIN + 2) /* 1280 */ - S2B_256(S2B_SMIN + 3) /* 1536 */ - S2B_256(S2B_SMIN + 4) /* 1792 */ - S2B_256(S2B_SMIN + 5) /* 2048 */ - S2B_256(S2B_SMIN + 6) /* 2304 */ - S2B_256(S2B_SMIN + 7) /* 2560 */ - S2B_256(S2B_SMIN + 8) /* 2816 */ - S2B_256(S2B_SMIN + 9) /* 3072 */ - S2B_256(S2B_SMIN + 10) /* 3328 */ - S2B_256(S2B_SMIN + 11) /* 3584 */ - S2B_256(S2B_SMIN + 12) /* 3840 */ -#if (STATIC_PAGE_SHIFT == 13) - S2B_256(S2B_SMIN + 13) /* 4096 */ - S2B_256(S2B_SMIN + 14) /* 4352 */ - S2B_256(S2B_SMIN + 15) /* 4608 */ - S2B_256(S2B_SMIN + 16) /* 4864 */ - S2B_256(S2B_SMIN + 17) /* 5120 */ - S2B_256(S2B_SMIN + 18) /* 5376 */ - S2B_256(S2B_SMIN + 19) /* 5632 */ - S2B_256(S2B_SMIN + 20) /* 5888 */ - S2B_256(S2B_SMIN + 21) /* 6144 */ - S2B_256(S2B_SMIN + 22) /* 6400 */ - S2B_256(S2B_SMIN + 23) /* 6656 */ - S2B_256(S2B_SMIN + 24) /* 6912 */ - S2B_256(S2B_SMIN + 25) /* 7168 */ - S2B_256(S2B_SMIN + 26) /* 7424 */ - S2B_256(S2B_SMIN + 27) /* 7680 */ - S2B_256(S2B_SMIN + 28) /* 7936 */ -#endif -}; -#undef S2B_1 -#undef S2B_2 -#undef S2B_4 -#undef S2B_8 -#undef S2B_16 -#undef S2B_32 -#undef S2B_64 -#undef S2B_128 -#undef S2B_256 -#undef S2B_QMIN -#undef S2B_CMIN -#undef S2B_SMIN - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static void arena_run_split(arena_t *arena, arena_run_t *run, size_t size, - bool large, bool zero); -static arena_chunk_t *arena_chunk_alloc(arena_t *arena); -static void arena_chunk_dealloc(arena_t *arena, arena_chunk_t *chunk); -static arena_run_t *arena_run_alloc(arena_t *arena, size_t size, bool large, - bool zero); -static void arena_purge(arena_t *arena); -static void arena_run_dalloc(arena_t *arena, arena_run_t *run, bool dirty); -static void arena_run_trim_head(arena_t *arena, arena_chunk_t *chunk, - arena_run_t *run, size_t oldsize, size_t newsize); -static void arena_run_trim_tail(arena_t *arena, arena_chunk_t *chunk, - arena_run_t *run, size_t oldsize, size_t newsize, bool dirty); -static arena_run_t *arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin); -static void *arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin); -static size_t arena_bin_run_size_calc(arena_bin_t *bin, size_t min_run_size); -static void arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, - arena_run_t *run, arena_bin_t *bin); -static void arena_ralloc_large_shrink(arena_t *arena, arena_chunk_t *chunk, - void *ptr, size_t size, size_t oldsize); -static bool arena_ralloc_large_grow(arena_t *arena, arena_chunk_t *chunk, - void *ptr, size_t size, size_t oldsize); -static bool arena_ralloc_large(void *ptr, size_t size, size_t oldsize); -#ifdef JEMALLOC_TINY -static size_t pow2_ceil(size_t x); -#endif -static bool small_size2bin_init(void); -#ifdef JEMALLOC_DEBUG -static void small_size2bin_validate(void); -#endif -static bool small_size2bin_init_hard(void); - -/******************************************************************************/ - -static inline int -arena_run_comp(arena_chunk_map_t *a, arena_chunk_map_t *b) -{ - uintptr_t a_mapelm = (uintptr_t)a; - uintptr_t b_mapelm = (uintptr_t)b; - - assert(a != NULL); - assert(b != NULL); - - return ((a_mapelm > b_mapelm) - (a_mapelm < b_mapelm)); -} - -/* Generate red-black tree functions. */ -rb_gen(static JEMALLOC_ATTR(unused), arena_run_tree_, arena_run_tree_t, - arena_chunk_map_t, u.rb_link, arena_run_comp) - -static inline int -arena_avail_comp(arena_chunk_map_t *a, arena_chunk_map_t *b) -{ - int ret; - size_t a_size = a->bits & ~PAGE_MASK; - size_t b_size = b->bits & ~PAGE_MASK; - - assert((a->bits & CHUNK_MAP_KEY) == CHUNK_MAP_KEY || (a->bits & - CHUNK_MAP_DIRTY) == (b->bits & CHUNK_MAP_DIRTY)); - - ret = (a_size > b_size) - (a_size < b_size); - if (ret == 0) { - uintptr_t a_mapelm, b_mapelm; - - if ((a->bits & CHUNK_MAP_KEY) != CHUNK_MAP_KEY) - a_mapelm = (uintptr_t)a; - else { - /* - * Treat keys as though they are lower than anything - * else. - */ - a_mapelm = 0; - } - b_mapelm = (uintptr_t)b; - - ret = (a_mapelm > b_mapelm) - (a_mapelm < b_mapelm); - } - - return (ret); -} - -/* Generate red-black tree functions. */ -rb_gen(static JEMALLOC_ATTR(unused), arena_avail_tree_, arena_avail_tree_t, - arena_chunk_map_t, u.rb_link, arena_avail_comp) - -static inline void * -arena_run_reg_alloc(arena_run_t *run, arena_bin_t *bin) -{ - void *ret; - - assert(run->magic == ARENA_RUN_MAGIC); - assert(run->nfree > 0); - - run->nfree--; - ret = run->avail; - if (ret != NULL) { - run->avail = *(void **)ret; - /* Double free can cause assertion failure.*/ - assert(ret != NULL); - /* Write-after free can cause assertion failure. */ - assert((uintptr_t)ret >= (uintptr_t)run + - (uintptr_t)bin->reg0_offset); - assert((uintptr_t)ret < (uintptr_t)run->next); - assert(((uintptr_t)ret - ((uintptr_t)run + - (uintptr_t)bin->reg0_offset)) % (uintptr_t)bin->reg_size == - 0); - return (ret); - } - ret = run->next; - run->next = (void *)((uintptr_t)ret + (uintptr_t)bin->reg_size); - assert(ret != NULL); - return (ret); -} - -static inline void -arena_run_reg_dalloc(arena_run_t *run, void *ptr) -{ - - assert(run->nfree < run->bin->nregs); - /* Freeing an interior pointer can cause assertion failure. */ - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % (uintptr_t)run->bin->reg_size - == 0); - - *(void **)ptr = run->avail; - run->avail = ptr; - run->nfree++; -} - -static void -arena_run_split(arena_t *arena, arena_run_t *run, size_t size, bool large, - bool zero) -{ - arena_chunk_t *chunk; - size_t old_ndirty, run_ind, total_pages, need_pages, rem_pages, i; - size_t flag_dirty; - arena_avail_tree_t *runs_avail; - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); - old_ndirty = chunk->ndirty; - run_ind = (unsigned)(((uintptr_t)run - (uintptr_t)chunk) - >> PAGE_SHIFT); - flag_dirty = chunk->map[run_ind].bits & CHUNK_MAP_DIRTY; - runs_avail = (flag_dirty != 0) ? &arena->runs_avail_dirty : - &arena->runs_avail_clean; - total_pages = (chunk->map[run_ind].bits & ~PAGE_MASK) >> - PAGE_SHIFT; - assert((chunk->map[run_ind+total_pages-1].bits & CHUNK_MAP_DIRTY) == - flag_dirty); - need_pages = (size >> PAGE_SHIFT); - assert(need_pages > 0); - assert(need_pages <= total_pages); - rem_pages = total_pages - need_pages; - - arena_avail_tree_remove(runs_avail, &chunk->map[run_ind]); - arena->nactive += need_pages; - - /* Keep track of trailing unused pages for later use. */ - if (rem_pages > 0) { - if (flag_dirty != 0) { - chunk->map[run_ind+need_pages].bits = (rem_pages << - PAGE_SHIFT) | CHUNK_MAP_DIRTY; - chunk->map[run_ind+total_pages-1].bits = (rem_pages << - PAGE_SHIFT) | CHUNK_MAP_DIRTY; - } else { - chunk->map[run_ind+need_pages].bits = (rem_pages << - PAGE_SHIFT) | (chunk->map[run_ind+need_pages].bits & - CHUNK_MAP_ZEROED); - chunk->map[run_ind+total_pages-1].bits = (rem_pages << - PAGE_SHIFT) | - (chunk->map[run_ind+total_pages-1].bits & - CHUNK_MAP_ZEROED); - } - arena_avail_tree_insert(runs_avail, - &chunk->map[run_ind+need_pages]); - } - - /* Update dirty page accounting. */ - if (flag_dirty != 0) { - chunk->ndirty -= need_pages; - arena->ndirty -= need_pages; - } - - /* - * Update the page map separately for large vs. small runs, since it is - * possible to avoid iteration for large mallocs. - */ - if (large) { - if (zero) { - if (flag_dirty == 0) { - /* - * The run is clean, so some pages may be - * zeroed (i.e. never before touched). - */ - for (i = 0; i < need_pages; i++) { - if ((chunk->map[run_ind + i].bits & - CHUNK_MAP_ZEROED) == 0) { - memset((void *)((uintptr_t) - chunk + ((run_ind + i) << - PAGE_SHIFT)), 0, - PAGE_SIZE); - } - } - } else { - /* - * The run is dirty, so all pages must be - * zeroed. - */ - memset((void *)((uintptr_t)chunk + (run_ind << - PAGE_SHIFT)), 0, (need_pages << - PAGE_SHIFT)); - } - } - - /* - * Set the last element first, in case the run only contains one - * page (i.e. both statements set the same element). - */ - chunk->map[run_ind+need_pages-1].bits = CHUNK_MAP_LARGE | - CHUNK_MAP_ALLOCATED | flag_dirty; - chunk->map[run_ind].bits = size | CHUNK_MAP_LARGE | -#ifdef JEMALLOC_PROF - CHUNK_MAP_CLASS_MASK | -#endif - CHUNK_MAP_ALLOCATED | flag_dirty; - } else { - assert(zero == false); - /* - * Propagate the dirty flag to the allocated small run, so that - * arena_dalloc_bin_run() has the ability to conditionally trim - * clean pages. - */ - chunk->map[run_ind].bits = CHUNK_MAP_ALLOCATED | flag_dirty; - for (i = 1; i < need_pages - 1; i++) { - chunk->map[run_ind + i].bits = (i << PAGE_SHIFT) - | CHUNK_MAP_ALLOCATED; - } - chunk->map[run_ind + need_pages - 1].bits = ((need_pages - 1) << - PAGE_SHIFT) | CHUNK_MAP_ALLOCATED | flag_dirty; - } -} - -static arena_chunk_t * -arena_chunk_alloc(arena_t *arena) -{ - arena_chunk_t *chunk; - size_t i; - - if (arena->spare != NULL) { - arena_avail_tree_t *runs_avail; - - chunk = arena->spare; - arena->spare = NULL; - - /* Insert the run into the appropriate runs_avail_* tree. */ - if ((chunk->map[arena_chunk_header_npages].bits & - CHUNK_MAP_DIRTY) == 0) - runs_avail = &arena->runs_avail_clean; - else - runs_avail = &arena->runs_avail_dirty; - arena_avail_tree_insert(runs_avail, - &chunk->map[arena_chunk_header_npages]); - } else { - bool zero; - size_t zeroed; - - zero = false; - malloc_mutex_unlock(&arena->lock); - chunk = (arena_chunk_t *)chunk_alloc(chunksize, &zero); - malloc_mutex_lock(&arena->lock); - if (chunk == NULL) - return (NULL); -#ifdef JEMALLOC_STATS - arena->stats.mapped += chunksize; -#endif - - chunk->arena = arena; - ql_elm_new(chunk, link_dirty); - chunk->dirtied = false; - - /* - * Claim that no pages are in use, since the header is merely - * overhead. - */ - chunk->ndirty = 0; - - /* - * Initialize the map to contain one maximal free untouched run. - * Mark the pages as zeroed iff chunk_alloc() returned a zeroed - * chunk. - */ - zeroed = zero ? CHUNK_MAP_ZEROED : 0; - for (i = 0; i < arena_chunk_header_npages; i++) - chunk->map[i].bits = 0; - chunk->map[i].bits = arena_maxclass | zeroed; - for (i++; i < chunk_npages-1; i++) - chunk->map[i].bits = zeroed; - chunk->map[chunk_npages-1].bits = arena_maxclass | zeroed; - - /* Insert the run into the runs_avail_clean tree. */ - arena_avail_tree_insert(&arena->runs_avail_clean, - &chunk->map[arena_chunk_header_npages]); - } - - return (chunk); -} - -static void -arena_chunk_dealloc(arena_t *arena, arena_chunk_t *chunk) -{ - arena_avail_tree_t *runs_avail; - - while (arena->spare != NULL) { - arena_chunk_t *spare = arena->spare; - - arena->spare = NULL; - if (spare->dirtied) { - ql_remove(&chunk->arena->chunks_dirty, spare, - link_dirty); - arena->ndirty -= spare->ndirty; - } - malloc_mutex_unlock(&arena->lock); - chunk_dealloc((void *)spare, chunksize); - malloc_mutex_lock(&arena->lock); -#ifdef JEMALLOC_STATS - arena->stats.mapped -= chunksize; -#endif - } - - /* - * Remove run from the appropriate runs_avail_* tree, so that the arena - * does not use it. - */ - if ((chunk->map[arena_chunk_header_npages].bits & - CHUNK_MAP_DIRTY) == 0) - runs_avail = &arena->runs_avail_clean; - else - runs_avail = &arena->runs_avail_dirty; - arena_avail_tree_remove(runs_avail, - &chunk->map[arena_chunk_header_npages]); - - arena->spare = chunk; -} - -static arena_run_t * -arena_run_alloc(arena_t *arena, size_t size, bool large, bool zero) -{ - arena_chunk_t *chunk; - arena_run_t *run; - arena_chunk_map_t *mapelm, key; - - assert(size <= arena_maxclass); - assert((size & PAGE_MASK) == 0); - - /* Search the arena's chunks for the lowest best fit. */ - key.bits = size | CHUNK_MAP_KEY; - mapelm = arena_avail_tree_nsearch(&arena->runs_avail_dirty, &key); - if (mapelm != NULL) { - arena_chunk_t *run_chunk = CHUNK_ADDR2BASE(mapelm); - size_t pageind = ((uintptr_t)mapelm - (uintptr_t)run_chunk->map) - / sizeof(arena_chunk_map_t); - - run = (arena_run_t *)((uintptr_t)run_chunk + (pageind << - PAGE_SHIFT)); - arena_run_split(arena, run, size, large, zero); - return (run); - } - mapelm = arena_avail_tree_nsearch(&arena->runs_avail_clean, &key); - if (mapelm != NULL) { - arena_chunk_t *run_chunk = CHUNK_ADDR2BASE(mapelm); - size_t pageind = ((uintptr_t)mapelm - (uintptr_t)run_chunk->map) - / sizeof(arena_chunk_map_t); - - run = (arena_run_t *)((uintptr_t)run_chunk + (pageind << - PAGE_SHIFT)); - arena_run_split(arena, run, size, large, zero); - return (run); - } - - /* - * No usable runs. Create a new chunk from which to allocate the run. - */ - chunk = arena_chunk_alloc(arena); - if (chunk != NULL) { - run = (arena_run_t *)((uintptr_t)chunk + - (arena_chunk_header_npages << PAGE_SHIFT)); - arena_run_split(arena, run, size, large, zero); - return (run); - } - - /* - * arena_chunk_alloc() failed, but another thread may have made - * sufficient memory available while this one dropped arena->lock in - * arena_chunk_alloc(), so search one more time. - */ - mapelm = arena_avail_tree_nsearch(&arena->runs_avail_dirty, &key); - if (mapelm != NULL) { - arena_chunk_t *run_chunk = CHUNK_ADDR2BASE(mapelm); - size_t pageind = ((uintptr_t)mapelm - (uintptr_t)run_chunk->map) - / sizeof(arena_chunk_map_t); - - run = (arena_run_t *)((uintptr_t)run_chunk + (pageind << - PAGE_SHIFT)); - arena_run_split(arena, run, size, large, zero); - return (run); - } - mapelm = arena_avail_tree_nsearch(&arena->runs_avail_clean, &key); - if (mapelm != NULL) { - arena_chunk_t *run_chunk = CHUNK_ADDR2BASE(mapelm); - size_t pageind = ((uintptr_t)mapelm - (uintptr_t)run_chunk->map) - / sizeof(arena_chunk_map_t); - - run = (arena_run_t *)((uintptr_t)run_chunk + (pageind << - PAGE_SHIFT)); - arena_run_split(arena, run, size, large, zero); - return (run); - } - - return (NULL); -} - -static inline void -arena_maybe_purge(arena_t *arena) -{ - - /* Enforce opt_lg_dirty_mult. */ - if (opt_lg_dirty_mult >= 0 && arena->ndirty > arena->npurgatory && - (arena->ndirty - arena->npurgatory) > chunk_npages && - (arena->nactive >> opt_lg_dirty_mult) < (arena->ndirty - - arena->npurgatory)) - arena_purge(arena); -} - -static inline void -arena_chunk_purge(arena_t *arena, arena_chunk_t *chunk) -{ - ql_head(arena_chunk_map_t) mapelms; - arena_chunk_map_t *mapelm; - size_t pageind, flag_zeroed; -#ifdef JEMALLOC_DEBUG - size_t ndirty; -#endif -#ifdef JEMALLOC_STATS - size_t nmadvise; -#endif - - ql_new(&mapelms); - - flag_zeroed = -#ifdef JEMALLOC_SWAP - swap_enabled ? 0 : -#endif - CHUNK_MAP_ZEROED; - - /* - * If chunk is the spare, temporarily re-allocate it, 1) so that its - * run is reinserted into runs_avail_dirty, and 2) so that it cannot be - * completely discarded by another thread while arena->lock is dropped - * by this thread. Note that the arena_run_dalloc() call will - * implicitly deallocate the chunk, so no explicit action is required - * in this function to deallocate the chunk. - * - * Note that once a chunk contains dirty pages, it cannot again contain - * a single run unless 1) it is a dirty run, or 2) this function purges - * dirty pages and causes the transition to a single clean run. Thus - * (chunk == arena->spare) is possible, but it is not possible for - * this function to be called on the spare unless it contains a dirty - * run. - */ - if (chunk == arena->spare) { - assert((chunk->map[arena_chunk_header_npages].bits & - CHUNK_MAP_DIRTY) != 0); - arena_chunk_alloc(arena); - } - - /* Temporarily allocate all free dirty runs within chunk. */ - for (pageind = arena_chunk_header_npages; pageind < chunk_npages;) { - mapelm = &chunk->map[pageind]; - if ((mapelm->bits & CHUNK_MAP_ALLOCATED) == 0) { - size_t npages; - - npages = mapelm->bits >> PAGE_SHIFT; - assert(pageind + npages <= chunk_npages); - if (mapelm->bits & CHUNK_MAP_DIRTY) { - size_t i; - - arena_avail_tree_remove( - &arena->runs_avail_dirty, mapelm); - - /* - * Update internal elements in the page map, so - * that CHUNK_MAP_ZEROED is properly set. - * madvise(..., MADV_DONTNEED) results in - * zero-filled pages for anonymous mappings, - * but not for file-backed mappings. - */ - mapelm->bits = (npages << PAGE_SHIFT) | - CHUNK_MAP_LARGE | CHUNK_MAP_ALLOCATED | - flag_zeroed; - for (i = 1; i < npages - 1; i++) { - chunk->map[pageind + i].bits = - flag_zeroed; - } - if (npages > 1) { - chunk->map[pageind + npages - 1].bits = - (npages << PAGE_SHIFT) | - CHUNK_MAP_LARGE | CHUNK_MAP_ALLOCATED | - flag_zeroed; - } - - arena->nactive += npages; - /* Append to list for later processing. */ - ql_elm_new(mapelm, u.ql_link); - ql_tail_insert(&mapelms, mapelm, u.ql_link); - } - - pageind += npages; - } else { - /* Skip allocated run. */ - if (mapelm->bits & CHUNK_MAP_LARGE) - pageind += mapelm->bits >> PAGE_SHIFT; - else { - arena_run_t *run = (arena_run_t *)((uintptr_t) - chunk + (uintptr_t)(pageind << PAGE_SHIFT)); - - assert((mapelm->bits >> PAGE_SHIFT) == 0); - assert(run->magic == ARENA_RUN_MAGIC); - pageind += run->bin->run_size >> PAGE_SHIFT; - } - } - } - assert(pageind == chunk_npages); - -#ifdef JEMALLOC_DEBUG - ndirty = chunk->ndirty; -#endif -#ifdef JEMALLOC_STATS - arena->stats.purged += chunk->ndirty; -#endif - arena->ndirty -= chunk->ndirty; - chunk->ndirty = 0; - ql_remove(&arena->chunks_dirty, chunk, link_dirty); - chunk->dirtied = false; - - malloc_mutex_unlock(&arena->lock); -#ifdef JEMALLOC_STATS - nmadvise = 0; -#endif - ql_foreach(mapelm, &mapelms, u.ql_link) { - size_t pageind = ((uintptr_t)mapelm - (uintptr_t)chunk->map) / - sizeof(arena_chunk_map_t); - size_t npages = mapelm->bits >> PAGE_SHIFT; - - assert(pageind + npages <= chunk_npages); -#ifdef JEMALLOC_DEBUG - assert(ndirty >= npages); - ndirty -= npages; -#endif - madvise((void *)((uintptr_t)chunk + (pageind << PAGE_SHIFT)), - (npages << PAGE_SHIFT), MADV_DONTNEED); -#ifdef JEMALLOC_STATS - nmadvise++; -#endif - } -#ifdef JEMALLOC_DEBUG - assert(ndirty == 0); -#endif - malloc_mutex_lock(&arena->lock); -#ifdef JEMALLOC_STATS - arena->stats.nmadvise += nmadvise; -#endif - - /* Deallocate runs. */ - for (mapelm = ql_first(&mapelms); mapelm != NULL; - mapelm = ql_first(&mapelms)) { - size_t pageind = ((uintptr_t)mapelm - (uintptr_t)chunk->map) / - sizeof(arena_chunk_map_t); - arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)(pageind << PAGE_SHIFT)); - - ql_remove(&mapelms, mapelm, u.ql_link); - arena_run_dalloc(arena, run, false); - } -} - -static void -arena_purge(arena_t *arena) -{ - arena_chunk_t *chunk; - size_t npurgatory; -#ifdef JEMALLOC_DEBUG - size_t ndirty = 0; - - ql_foreach(chunk, &arena->chunks_dirty, link_dirty) { - assert(chunk->dirtied); - ndirty += chunk->ndirty; - } - assert(ndirty == arena->ndirty); -#endif - assert(arena->ndirty > arena->npurgatory); - assert(arena->ndirty > chunk_npages); - assert((arena->nactive >> opt_lg_dirty_mult) < arena->ndirty); - -#ifdef JEMALLOC_STATS - arena->stats.npurge++; -#endif - - /* - * Compute the minimum number of pages that this thread should try to - * purge, and add the result to arena->npurgatory. This will keep - * multiple threads from racing to reduce ndirty below the threshold. - */ - npurgatory = (arena->ndirty - arena->npurgatory) - (arena->nactive >> - opt_lg_dirty_mult); - arena->npurgatory += npurgatory; - - while (npurgatory > 0) { - /* Get next chunk with dirty pages. */ - chunk = ql_first(&arena->chunks_dirty); - if (chunk == NULL) { - /* - * This thread was unable to purge as many pages as - * originally intended, due to races with other threads - * that either did some of the purging work, or re-used - * dirty pages. - */ - arena->npurgatory -= npurgatory; - return; - } - while (chunk->ndirty == 0) { - ql_remove(&arena->chunks_dirty, chunk, link_dirty); - chunk->dirtied = false; - chunk = ql_first(&arena->chunks_dirty); - if (chunk == NULL) { - /* Same logic as for above. */ - arena->npurgatory -= npurgatory; - return; - } - } - - if (chunk->ndirty > npurgatory) { - /* - * This thread will, at a minimum, purge all the dirty - * pages in chunk, so set npurgatory to reflect this - * thread's commitment to purge the pages. This tends - * to reduce the chances of the following scenario: - * - * 1) This thread sets arena->npurgatory such that - * (arena->ndirty - arena->npurgatory) is at the - * threshold. - * 2) This thread drops arena->lock. - * 3) Another thread causes one or more pages to be - * dirtied, and immediately determines that it must - * purge dirty pages. - * - * If this scenario *does* play out, that's okay, - * because all of the purging work being done really - * needs to happen. - */ - arena->npurgatory += chunk->ndirty - npurgatory; - npurgatory = chunk->ndirty; - } - - arena->npurgatory -= chunk->ndirty; - npurgatory -= chunk->ndirty; - arena_chunk_purge(arena, chunk); - } -} - -static void -arena_run_dalloc(arena_t *arena, arena_run_t *run, bool dirty) -{ - arena_chunk_t *chunk; - size_t size, run_ind, run_pages, flag_dirty; - arena_avail_tree_t *runs_avail; - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run); - run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) - >> PAGE_SHIFT); - assert(run_ind >= arena_chunk_header_npages); - assert(run_ind < chunk_npages); - if ((chunk->map[run_ind].bits & CHUNK_MAP_LARGE) != 0) - size = chunk->map[run_ind].bits & ~PAGE_MASK; - else - size = run->bin->run_size; - run_pages = (size >> PAGE_SHIFT); - arena->nactive -= run_pages; - - /* - * The run is dirty if the caller claims to have dirtied it, as well as - * if it was already dirty before being allocated. - */ - if ((chunk->map[run_ind].bits & CHUNK_MAP_DIRTY) != 0) - dirty = true; - flag_dirty = dirty ? CHUNK_MAP_DIRTY : 0; - runs_avail = dirty ? &arena->runs_avail_dirty : - &arena->runs_avail_clean; - - /* Mark pages as unallocated in the chunk map. */ - if (dirty) { - chunk->map[run_ind].bits = size | flag_dirty; - chunk->map[run_ind+run_pages-1].bits = size | flag_dirty; - - chunk->ndirty += run_pages; - arena->ndirty += run_pages; - } else { - chunk->map[run_ind].bits = size | (chunk->map[run_ind].bits & - CHUNK_MAP_ZEROED); - chunk->map[run_ind+run_pages-1].bits = size | - (chunk->map[run_ind+run_pages-1].bits & CHUNK_MAP_ZEROED); - } - - /* Try to coalesce forward. */ - if (run_ind + run_pages < chunk_npages && - (chunk->map[run_ind+run_pages].bits & CHUNK_MAP_ALLOCATED) == 0 && - (chunk->map[run_ind+run_pages].bits & CHUNK_MAP_DIRTY) == - flag_dirty) { - size_t nrun_size = chunk->map[run_ind+run_pages].bits & - ~PAGE_MASK; - - /* - * Remove successor from runs_avail; the coalesced run is - * inserted later. - */ - arena_avail_tree_remove(runs_avail, - &chunk->map[run_ind+run_pages]); - - size += nrun_size; - run_pages = size >> PAGE_SHIFT; - - assert((chunk->map[run_ind+run_pages-1].bits & ~PAGE_MASK) - == nrun_size); - chunk->map[run_ind].bits = size | (chunk->map[run_ind].bits & - CHUNK_MAP_FLAGS_MASK); - chunk->map[run_ind+run_pages-1].bits = size | - (chunk->map[run_ind+run_pages-1].bits & - CHUNK_MAP_FLAGS_MASK); - } - - /* Try to coalesce backward. */ - if (run_ind > arena_chunk_header_npages && (chunk->map[run_ind-1].bits & - CHUNK_MAP_ALLOCATED) == 0 && (chunk->map[run_ind-1].bits & - CHUNK_MAP_DIRTY) == flag_dirty) { - size_t prun_size = chunk->map[run_ind-1].bits & ~PAGE_MASK; - - run_ind -= prun_size >> PAGE_SHIFT; - - /* - * Remove predecessor from runs_avail; the coalesced run is - * inserted later. - */ - arena_avail_tree_remove(runs_avail, &chunk->map[run_ind]); - - size += prun_size; - run_pages = size >> PAGE_SHIFT; - - assert((chunk->map[run_ind].bits & ~PAGE_MASK) == prun_size); - chunk->map[run_ind].bits = size | (chunk->map[run_ind].bits & - CHUNK_MAP_FLAGS_MASK); - chunk->map[run_ind+run_pages-1].bits = size | - (chunk->map[run_ind+run_pages-1].bits & - CHUNK_MAP_FLAGS_MASK); - } - - /* Insert into runs_avail, now that coalescing is complete. */ - arena_avail_tree_insert(runs_avail, &chunk->map[run_ind]); - - /* - * Deallocate chunk if it is now completely unused. The bit - * manipulation checks whether the first run is unallocated and extends - * to the end of the chunk. - */ - if ((chunk->map[arena_chunk_header_npages].bits & (~PAGE_MASK | - CHUNK_MAP_ALLOCATED)) == arena_maxclass) - arena_chunk_dealloc(arena, chunk); - - /* - * It is okay to do dirty page processing even if the chunk was - * deallocated above, since in that case it is the spare. Waiting - * until after possible chunk deallocation to do dirty processing - * allows for an old spare to be fully deallocated, thus decreasing the - * chances of spuriously crossing the dirty page purging threshold. - */ - if (dirty) { - if (chunk->dirtied == false) { - ql_tail_insert(&arena->chunks_dirty, chunk, link_dirty); - chunk->dirtied = true; - } - arena_maybe_purge(arena); - } -} - -static void -arena_run_trim_head(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, - size_t oldsize, size_t newsize) -{ - size_t pageind = ((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT; - size_t head_npages = (oldsize - newsize) >> PAGE_SHIFT; - size_t flags = chunk->map[pageind].bits & CHUNK_MAP_FLAGS_MASK; - - assert(oldsize > newsize); - - /* - * Update the chunk map so that arena_run_dalloc() can treat the - * leading run as separately allocated. - */ - assert(chunk->map[pageind].bits & CHUNK_MAP_LARGE); - assert(chunk->map[pageind].bits & CHUNK_MAP_ALLOCATED); - chunk->map[pageind].bits = (oldsize - newsize) | flags; - chunk->map[pageind+head_npages].bits = newsize | flags; - - arena_run_dalloc(arena, run, false); -} - -static void -arena_run_trim_tail(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, - size_t oldsize, size_t newsize, bool dirty) -{ - size_t pageind = ((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT; - size_t npages = newsize >> PAGE_SHIFT; - size_t flags = chunk->map[pageind].bits & CHUNK_MAP_FLAGS_MASK; - - assert(oldsize > newsize); - - /* - * Update the chunk map so that arena_run_dalloc() can treat the - * trailing run as separately allocated. - */ - assert(chunk->map[pageind].bits & CHUNK_MAP_LARGE); - assert(chunk->map[pageind].bits & CHUNK_MAP_ALLOCATED); - chunk->map[pageind].bits = newsize | flags; - chunk->map[pageind+npages-1].bits = newsize | flags; - chunk->map[pageind+npages].bits = (oldsize - newsize) | flags; - - arena_run_dalloc(arena, (arena_run_t *)((uintptr_t)run + newsize), - dirty); -} - -static arena_run_t * -arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin) -{ - arena_chunk_map_t *mapelm; - arena_run_t *run; - - /* Look for a usable run. */ - mapelm = arena_run_tree_first(&bin->runs); - if (mapelm != NULL) { - arena_chunk_t *chunk; - size_t pageind; - - /* run is guaranteed to have available space. */ - arena_run_tree_remove(&bin->runs, mapelm); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(mapelm); - pageind = (((uintptr_t)mapelm - (uintptr_t)chunk->map) / - sizeof(arena_chunk_map_t)); - run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - - (mapelm->bits >> PAGE_SHIFT)) - << PAGE_SHIFT)); -#ifdef JEMALLOC_STATS - bin->stats.reruns++; -#endif - return (run); - } - /* No existing runs have any space available. */ - - /* Allocate a new run. */ - malloc_mutex_unlock(&bin->lock); - /******************************/ - malloc_mutex_lock(&arena->lock); - run = arena_run_alloc(arena, bin->run_size, false, false); - if (run != NULL) { - /* Initialize run internals. */ - run->bin = bin; - run->avail = NULL; - run->next = (void *)(((uintptr_t)run) + - (uintptr_t)bin->reg0_offset); - run->nfree = bin->nregs; -#ifdef JEMALLOC_DEBUG - run->magic = ARENA_RUN_MAGIC; -#endif - } - malloc_mutex_unlock(&arena->lock); - /********************************/ - malloc_mutex_lock(&bin->lock); - if (run != NULL) { -#ifdef JEMALLOC_STATS - bin->stats.nruns++; - bin->stats.curruns++; - if (bin->stats.curruns > bin->stats.highruns) - bin->stats.highruns = bin->stats.curruns; -#endif - return (run); - } - - /* - * arena_run_alloc() failed, but another thread may have made - * sufficient memory available while this one dopped bin->lock above, - * so search one more time. - */ - mapelm = arena_run_tree_first(&bin->runs); - if (mapelm != NULL) { - arena_chunk_t *chunk; - size_t pageind; - - /* run is guaranteed to have available space. */ - arena_run_tree_remove(&bin->runs, mapelm); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(mapelm); - pageind = (((uintptr_t)mapelm - (uintptr_t)chunk->map) / - sizeof(arena_chunk_map_t)); - run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - - (mapelm->bits >> PAGE_SHIFT)) - << PAGE_SHIFT)); -#ifdef JEMALLOC_STATS - bin->stats.reruns++; -#endif - return (run); - } - - return (NULL); -} - -/* Re-fill bin->runcur, then call arena_run_reg_alloc(). */ -static void * -arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin) -{ - void *ret; - arena_run_t *run; - - bin->runcur = NULL; - run = arena_bin_nonfull_run_get(arena, bin); - if (bin->runcur != NULL && bin->runcur->nfree > 0) { - /* - * Another thread updated runcur while this one ran without the - * bin lock in arena_bin_nonfull_run_get(). - */ - assert(bin->runcur->magic == ARENA_RUN_MAGIC); - assert(bin->runcur->nfree > 0); - ret = arena_run_reg_alloc(bin->runcur, bin); - if (run != NULL) { - malloc_mutex_unlock(&bin->lock); - malloc_mutex_lock(&arena->lock); - arena_run_dalloc(arena, run, false); - malloc_mutex_unlock(&arena->lock); - malloc_mutex_lock(&bin->lock); - } - return (ret); - } - - if (run == NULL) - return (NULL); - - bin->runcur = run; - - assert(bin->runcur->magic == ARENA_RUN_MAGIC); - assert(bin->runcur->nfree > 0); - - return (arena_run_reg_alloc(bin->runcur, bin)); -} - -#ifdef JEMALLOC_PROF -void -arena_prof_accum(arena_t *arena, uint64_t accumbytes) -{ - - if (prof_interval != 0) { - arena->prof_accumbytes += accumbytes; - if (arena->prof_accumbytes >= prof_interval) { - prof_idump(); - arena->prof_accumbytes -= prof_interval; - } - } -} -#endif - -#ifdef JEMALLOC_TCACHE -void -arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind -# ifdef JEMALLOC_PROF - , uint64_t prof_accumbytes -# endif - ) -{ - unsigned i, nfill; - arena_bin_t *bin; - arena_run_t *run; - void *ptr; - - assert(tbin->ncached == 0); - -#ifdef JEMALLOC_PROF - malloc_mutex_lock(&arena->lock); - arena_prof_accum(arena, prof_accumbytes); - malloc_mutex_unlock(&arena->lock); -#endif - bin = &arena->bins[binind]; - malloc_mutex_lock(&bin->lock); - for (i = 0, nfill = (tbin->ncached_max >> 1); i < nfill; i++) { - if ((run = bin->runcur) != NULL && run->nfree > 0) - ptr = arena_run_reg_alloc(run, bin); - else - ptr = arena_bin_malloc_hard(arena, bin); - if (ptr == NULL) - break; - *(void **)ptr = tbin->avail; - tbin->avail = ptr; - } -#ifdef JEMALLOC_STATS - bin->stats.allocated += (i - tbin->ncached) * bin->reg_size; - bin->stats.nmalloc += i; - bin->stats.nrequests += tbin->tstats.nrequests; - bin->stats.nfills++; - tbin->tstats.nrequests = 0; -#endif - malloc_mutex_unlock(&bin->lock); - tbin->ncached = i; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; -} -#endif - -/* - * Calculate bin->run_size such that it meets the following constraints: - * - * *) bin->run_size >= min_run_size - * *) bin->run_size <= arena_maxclass - * *) run header overhead <= RUN_MAX_OVRHD (or header overhead relaxed). - * *) run header size < PAGE_SIZE - * - * bin->nregs and bin->reg0_offset are also calculated here, since these - * settings are all interdependent. - */ -static size_t -arena_bin_run_size_calc(arena_bin_t *bin, size_t min_run_size) -{ - size_t try_run_size, good_run_size; - uint32_t try_nregs, good_nregs; - uint32_t try_hdr_size, good_hdr_size; -#ifdef JEMALLOC_PROF - uint32_t try_cnt0_offset, good_cnt0_offset; -#endif - uint32_t try_reg0_offset, good_reg0_offset; - - assert(min_run_size >= PAGE_SIZE); - assert(min_run_size <= arena_maxclass); - - /* - * Calculate known-valid settings before entering the run_size - * expansion loop, so that the first part of the loop always copies - * valid settings. - * - * The do..while loop iteratively reduces the number of regions until - * the run header and the regions no longer overlap. A closed formula - * would be quite messy, since there is an interdependency between the - * header's mask length and the number of regions. - */ - try_run_size = min_run_size; - try_nregs = ((try_run_size - sizeof(arena_run_t)) / bin->reg_size) - + 1; /* Counter-act try_nregs-- in loop. */ - do { - try_nregs--; - try_hdr_size = sizeof(arena_run_t); -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote == false) { - /* Pad to a quantum boundary. */ - try_hdr_size = QUANTUM_CEILING(try_hdr_size); - try_cnt0_offset = try_hdr_size; - /* Add space for one (prof_thr_cnt_t *) per region. */ - try_hdr_size += try_nregs * sizeof(prof_thr_cnt_t *); - } else - try_cnt0_offset = 0; -#endif - try_reg0_offset = try_run_size - (try_nregs * bin->reg_size); - } while (try_hdr_size > try_reg0_offset); - - /* run_size expansion loop. */ - do { - /* - * Copy valid settings before trying more aggressive settings. - */ - good_run_size = try_run_size; - good_nregs = try_nregs; - good_hdr_size = try_hdr_size; -#ifdef JEMALLOC_PROF - good_cnt0_offset = try_cnt0_offset; -#endif - good_reg0_offset = try_reg0_offset; - - /* Try more aggressive settings. */ - try_run_size += PAGE_SIZE; - try_nregs = ((try_run_size - sizeof(arena_run_t)) / - bin->reg_size) + 1; /* Counter-act try_nregs-- in loop. */ - do { - try_nregs--; - try_hdr_size = sizeof(arena_run_t); -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote == false) { - /* Pad to a quantum boundary. */ - try_hdr_size = QUANTUM_CEILING(try_hdr_size); - try_cnt0_offset = try_hdr_size; - /* - * Add space for one (prof_thr_cnt_t *) per - * region. - */ - try_hdr_size += try_nregs * - sizeof(prof_thr_cnt_t *); - } -#endif - try_reg0_offset = try_run_size - (try_nregs * - bin->reg_size); - } while (try_hdr_size > try_reg0_offset); - } while (try_run_size <= arena_maxclass - && try_run_size <= arena_maxclass - && RUN_MAX_OVRHD * (bin->reg_size << 3) > RUN_MAX_OVRHD_RELAX - && (try_reg0_offset << RUN_BFP) > RUN_MAX_OVRHD * try_run_size - && try_hdr_size < PAGE_SIZE); - - assert(good_hdr_size <= good_reg0_offset); - - /* Copy final settings. */ - bin->run_size = good_run_size; - bin->nregs = good_nregs; -#ifdef JEMALLOC_PROF - bin->cnt0_offset = good_cnt0_offset; -#endif - bin->reg0_offset = good_reg0_offset; - - return (good_run_size); -} - -void * -arena_malloc_small(arena_t *arena, size_t size, bool zero) -{ - void *ret; - arena_bin_t *bin; - arena_run_t *run; - size_t binind; - - binind = small_size2bin[size]; - assert(binind < nbins); - bin = &arena->bins[binind]; - size = bin->reg_size; - - malloc_mutex_lock(&bin->lock); - if ((run = bin->runcur) != NULL && run->nfree > 0) - ret = arena_run_reg_alloc(run, bin); - else - ret = arena_bin_malloc_hard(arena, bin); - - if (ret == NULL) { - malloc_mutex_unlock(&bin->lock); - return (NULL); - } - -#ifdef JEMALLOC_STATS - bin->stats.allocated += size; - bin->stats.nmalloc++; - bin->stats.nrequests++; -#endif - malloc_mutex_unlock(&bin->lock); -#ifdef JEMALLOC_PROF - if (isthreaded == false) { - malloc_mutex_lock(&arena->lock); - arena_prof_accum(arena, size); - malloc_mutex_unlock(&arena->lock); - } -#endif - - if (zero == false) { -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - } else - memset(ret, 0, size); - - return (ret); -} - -void * -arena_malloc_large(arena_t *arena, size_t size, bool zero) -{ - void *ret; - - /* Large allocation. */ - size = PAGE_CEILING(size); - malloc_mutex_lock(&arena->lock); - ret = (void *)arena_run_alloc(arena, size, true, zero); - if (ret == NULL) { - malloc_mutex_unlock(&arena->lock); - return (NULL); - } -#ifdef JEMALLOC_STATS - arena->stats.nmalloc_large++; - arena->stats.nrequests_large++; - arena->stats.allocated_large += size; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nmalloc++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nrequests++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns++; - if (arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns > - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns) { - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns = - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns; - } -#endif -#ifdef JEMALLOC_PROF - arena_prof_accum(arena, size); -#endif - malloc_mutex_unlock(&arena->lock); - - if (zero == false) { -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - } - - return (ret); -} - -void * -arena_malloc(size_t size, bool zero) -{ - - assert(size != 0); - assert(QUANTUM_CEILING(size) <= arena_maxclass); - - if (size <= small_maxclass) { -#ifdef JEMALLOC_TCACHE - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - return (tcache_alloc_small(tcache, size, zero)); - else - -#endif - return (arena_malloc_small(choose_arena(), size, zero)); - } else { -#ifdef JEMALLOC_TCACHE - if (size <= tcache_maxclass) { - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - return (tcache_alloc_large(tcache, size, zero)); - else { - return (arena_malloc_large(choose_arena(), - size, zero)); - } - } else -#endif - return (arena_malloc_large(choose_arena(), size, zero)); - } -} - -/* Only handles large allocations that require more than page alignment. */ -void * -arena_palloc(arena_t *arena, size_t alignment, size_t size, size_t alloc_size) -{ - void *ret; - size_t offset; - arena_chunk_t *chunk; - - assert((size & PAGE_MASK) == 0); - assert((alignment & PAGE_MASK) == 0); - - malloc_mutex_lock(&arena->lock); - ret = (void *)arena_run_alloc(arena, alloc_size, true, false); - if (ret == NULL) { - malloc_mutex_unlock(&arena->lock); - return (NULL); - } - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ret); - - offset = (uintptr_t)ret & (alignment - 1); - assert((offset & PAGE_MASK) == 0); - assert(offset < alloc_size); - if (offset == 0) - arena_run_trim_tail(arena, chunk, ret, alloc_size, size, false); - else { - size_t leadsize, trailsize; - - leadsize = alignment - offset; - if (leadsize > 0) { - arena_run_trim_head(arena, chunk, ret, alloc_size, - alloc_size - leadsize); - ret = (void *)((uintptr_t)ret + leadsize); - } - - trailsize = alloc_size - leadsize - size; - if (trailsize != 0) { - /* Trim trailing space. */ - assert(trailsize < alloc_size); - arena_run_trim_tail(arena, chunk, ret, size + trailsize, - size, false); - } - } - -#ifdef JEMALLOC_STATS - arena->stats.nmalloc_large++; - arena->stats.nrequests_large++; - arena->stats.allocated_large += size; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nmalloc++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nrequests++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns++; - if (arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns > - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns) { - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns = - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns; - } -#endif - malloc_mutex_unlock(&arena->lock); - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - return (ret); -} - -/* Return the size of the allocation pointed to by ptr. */ -size_t -arena_salloc(const void *ptr) -{ - size_t ret; - arena_chunk_t *chunk; - size_t pageind, mapbits; - - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapbits = chunk->map[pageind].bits; - assert((mapbits & CHUNK_MAP_ALLOCATED) != 0); - if ((mapbits & CHUNK_MAP_LARGE) == 0) { - arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << - PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % run->bin->reg_size == - 0); - ret = run->bin->reg_size; - } else { - assert(((uintptr_t)ptr & PAGE_MASK) == 0); - ret = mapbits & ~PAGE_MASK; - assert(ret != 0); - } - - return (ret); -} - -#ifdef JEMALLOC_PROF -void -arena_prof_promoted(const void *ptr, size_t size) -{ - arena_chunk_t *chunk; - size_t pageind, binind; - - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - assert(isalloc(ptr) == PAGE_SIZE); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - binind = small_size2bin[size]; - assert(binind < nbins); - chunk->map[pageind].bits = (chunk->map[pageind].bits & - ~CHUNK_MAP_CLASS_MASK) | (binind << CHUNK_MAP_CLASS_SHIFT); -} - -size_t -arena_salloc_demote(const void *ptr) -{ - size_t ret; - arena_chunk_t *chunk; - size_t pageind, mapbits; - - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapbits = chunk->map[pageind].bits; - assert((mapbits & CHUNK_MAP_ALLOCATED) != 0); - if ((mapbits & CHUNK_MAP_LARGE) == 0) { - arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << - PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % run->bin->reg_size == - 0); - ret = run->bin->reg_size; - } else { - assert(((uintptr_t)ptr & PAGE_MASK) == 0); - ret = mapbits & ~PAGE_MASK; - if (prof_promote && ret == PAGE_SIZE && (mapbits & - CHUNK_MAP_CLASS_MASK) != CHUNK_MAP_CLASS_MASK) { - size_t binind = ((mapbits & CHUNK_MAP_CLASS_MASK) >> - CHUNK_MAP_CLASS_SHIFT); - assert(binind < nbins); - ret = chunk->arena->bins[binind].reg_size; - } - assert(ret != 0); - } - - return (ret); -} - -static inline unsigned -arena_run_regind(arena_run_t *run, arena_bin_t *bin, const void *ptr, - size_t size) -{ - unsigned shift, diff, regind; - - assert(run->magic == ARENA_RUN_MAGIC); - - /* - * Avoid doing division with a variable divisor if possible. Using - * actual division here can reduce allocator throughput by over 20%! - */ - diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - bin->reg0_offset); - - /* Rescale (factor powers of 2 out of the numerator and denominator). */ - shift = ffs(size) - 1; - diff >>= shift; - size >>= shift; - - if (size == 1) { - /* The divisor was a power of 2. */ - regind = diff; - } else { - /* - * To divide by a number D that is not a power of two we - * multiply by (2^21 / D) and then right shift by 21 positions. - * - * X / D - * - * becomes - * - * (X * size_invs[D - 3]) >> SIZE_INV_SHIFT - * - * We can omit the first three elements, because we never - * divide by 0, and 1 and 2 are both powers of two, which are - * handled above. - */ -#define SIZE_INV_SHIFT 21 -#define SIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s)) + 1) - static const unsigned size_invs[] = { - SIZE_INV(3), - SIZE_INV(4), SIZE_INV(5), SIZE_INV(6), SIZE_INV(7), - SIZE_INV(8), SIZE_INV(9), SIZE_INV(10), SIZE_INV(11), - SIZE_INV(12), SIZE_INV(13), SIZE_INV(14), SIZE_INV(15), - SIZE_INV(16), SIZE_INV(17), SIZE_INV(18), SIZE_INV(19), - SIZE_INV(20), SIZE_INV(21), SIZE_INV(22), SIZE_INV(23), - SIZE_INV(24), SIZE_INV(25), SIZE_INV(26), SIZE_INV(27), - SIZE_INV(28), SIZE_INV(29), SIZE_INV(30), SIZE_INV(31) - }; - - if (size <= ((sizeof(size_invs) / sizeof(unsigned)) + 2)) - regind = (diff * size_invs[size - 3]) >> SIZE_INV_SHIFT; - else - regind = diff / size; -#undef SIZE_INV -#undef SIZE_INV_SHIFT - } - assert(diff == regind * size); - assert(regind < bin->nregs); - - return (regind); -} - -prof_thr_cnt_t * -arena_prof_cnt_get(const void *ptr) -{ - prof_thr_cnt_t *ret; - arena_chunk_t *chunk; - size_t pageind, mapbits; - - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapbits = chunk->map[pageind].bits; - assert((mapbits & CHUNK_MAP_ALLOCATED) != 0); - if ((mapbits & CHUNK_MAP_LARGE) == 0) { - if (prof_promote) - ret = (prof_thr_cnt_t *)(uintptr_t)1U; - else { - arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << - PAGE_SHIFT)); - arena_bin_t *bin = run->bin; - unsigned regind; - - assert(run->magic == ARENA_RUN_MAGIC); - regind = arena_run_regind(run, bin, ptr, bin->reg_size); - ret = *(prof_thr_cnt_t **)((uintptr_t)run + - bin->cnt0_offset + (regind * - sizeof(prof_thr_cnt_t *))); - } - } else - ret = chunk->map[pageind].prof_cnt; - - return (ret); -} - -void -arena_prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt) -{ - arena_chunk_t *chunk; - size_t pageind, mapbits; - - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapbits = chunk->map[pageind].bits; - assert((mapbits & CHUNK_MAP_ALLOCATED) != 0); - if ((mapbits & CHUNK_MAP_LARGE) == 0) { - if (prof_promote == false) { - arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapbits >> PAGE_SHIFT)) << - PAGE_SHIFT)); - arena_bin_t *bin = run->bin; - unsigned regind; - - assert(run->magic == ARENA_RUN_MAGIC); - regind = arena_run_regind(run, bin, ptr, bin->reg_size); - - *((prof_thr_cnt_t **)((uintptr_t)run + bin->cnt0_offset - + (regind * sizeof(prof_thr_cnt_t *)))) = cnt; - } else - assert((uintptr_t)cnt == (uintptr_t)1U); - } else - chunk->map[pageind].prof_cnt = cnt; -} -#endif - -static void -arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run, - arena_bin_t *bin) -{ - size_t npages, run_ind, past; - - /* Dissociate run from bin. */ - if (run == bin->runcur) - bin->runcur = NULL; - else if (bin->nregs != 1) { - size_t run_pageind = (((uintptr_t)run - (uintptr_t)chunk)) >> - PAGE_SHIFT; - arena_chunk_map_t *run_mapelm = &chunk->map[run_pageind]; - /* - * This block's conditional is necessary because if the run - * only contains one region, then it never gets inserted into - * the non-full runs tree. - */ - arena_run_tree_remove(&bin->runs, run_mapelm); - } - - malloc_mutex_unlock(&bin->lock); - /******************************/ - npages = bin->run_size >> PAGE_SHIFT; - run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) >> PAGE_SHIFT); - past = (size_t)(((uintptr_t)run->next - (uintptr_t)1U - - (uintptr_t)chunk) >> PAGE_SHIFT) + 1; - malloc_mutex_lock(&arena->lock); - - /* - * If the run was originally clean, and some pages were never touched, - * trim the clean pages before deallocating the dirty portion of the - * run. - */ - if ((chunk->map[run_ind].bits & CHUNK_MAP_DIRTY) == 0 && past - run_ind - < npages) { - /* - * Trim clean pages. Convert to large run beforehand. Set the - * last map element first, in case this is a one-page run. - */ - chunk->map[run_ind+npages-1].bits = CHUNK_MAP_LARGE | - (chunk->map[run_ind].bits & CHUNK_MAP_FLAGS_MASK); - chunk->map[run_ind].bits = bin->run_size | CHUNK_MAP_LARGE | - (chunk->map[run_ind].bits & CHUNK_MAP_FLAGS_MASK); - arena_run_trim_tail(arena, chunk, run, (npages << PAGE_SHIFT), - ((npages - (past - run_ind)) << PAGE_SHIFT), false); - npages = past - run_ind; - } -#ifdef JEMALLOC_DEBUG - run->magic = 0; -#endif - arena_run_dalloc(arena, run, true); - malloc_mutex_unlock(&arena->lock); - /****************************/ - malloc_mutex_lock(&bin->lock); -#ifdef JEMALLOC_STATS - bin->stats.curruns--; -#endif -} - -void -arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, - arena_chunk_map_t *mapelm) -{ - size_t pageind; - arena_run_t *run; - arena_bin_t *bin; -#if (defined(JEMALLOC_FILL) || defined(JEMALLOC_STATS)) - size_t size; -#endif - - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - bin = run->bin; -#if (defined(JEMALLOC_FILL) || defined(JEMALLOC_STATS)) - size = bin->reg_size; -#endif - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ptr, 0x5a, size); -#endif - - arena_run_reg_dalloc(run, ptr); - - if (run->nfree == bin->nregs) - arena_dalloc_bin_run(arena, chunk, run, bin); - else if (run->nfree == 1 && run != bin->runcur) { - /* - * Make sure that bin->runcur always refers to the lowest - * non-full run, if one exists. - */ - if (bin->runcur == NULL) - bin->runcur = run; - else if ((uintptr_t)run < (uintptr_t)bin->runcur) { - /* Switch runcur. */ - if (bin->runcur->nfree > 0) { - arena_chunk_t *runcur_chunk = - CHUNK_ADDR2BASE(bin->runcur); - size_t runcur_pageind = - (((uintptr_t)bin->runcur - - (uintptr_t)runcur_chunk)) >> PAGE_SHIFT; - arena_chunk_map_t *runcur_mapelm = - &runcur_chunk->map[runcur_pageind]; - - /* Insert runcur. */ - arena_run_tree_insert(&bin->runs, - runcur_mapelm); - } - bin->runcur = run; - } else { - size_t run_pageind = (((uintptr_t)run - - (uintptr_t)chunk)) >> PAGE_SHIFT; - arena_chunk_map_t *run_mapelm = - &chunk->map[run_pageind]; - - assert(arena_run_tree_search(&bin->runs, run_mapelm) == - NULL); - arena_run_tree_insert(&bin->runs, run_mapelm); - } - } - -#ifdef JEMALLOC_STATS - bin->stats.allocated -= size; - bin->stats.ndalloc++; -#endif -} - -#ifdef JEMALLOC_STATS -void -arena_stats_merge(arena_t *arena, size_t *nactive, size_t *ndirty, - arena_stats_t *astats, malloc_bin_stats_t *bstats, - malloc_large_stats_t *lstats) -{ - unsigned i; - - malloc_mutex_lock(&arena->lock); - *nactive += arena->nactive; - *ndirty += arena->ndirty; - - astats->mapped += arena->stats.mapped; - astats->npurge += arena->stats.npurge; - astats->nmadvise += arena->stats.nmadvise; - astats->purged += arena->stats.purged; - astats->allocated_large += arena->stats.allocated_large; - astats->nmalloc_large += arena->stats.nmalloc_large; - astats->ndalloc_large += arena->stats.ndalloc_large; - astats->nrequests_large += arena->stats.nrequests_large; - - for (i = 0; i < nlclasses; i++) { - lstats[i].nmalloc += arena->stats.lstats[i].nmalloc; - lstats[i].ndalloc += arena->stats.lstats[i].ndalloc; - lstats[i].nrequests += arena->stats.lstats[i].nrequests; - lstats[i].highruns += arena->stats.lstats[i].highruns; - lstats[i].curruns += arena->stats.lstats[i].curruns; - } - malloc_mutex_unlock(&arena->lock); - - for (i = 0; i < nbins; i++) { - arena_bin_t *bin = &arena->bins[i]; - - malloc_mutex_lock(&bin->lock); - bstats[i].allocated += bin->stats.allocated; - bstats[i].nmalloc += bin->stats.nmalloc; - bstats[i].ndalloc += bin->stats.ndalloc; - bstats[i].nrequests += bin->stats.nrequests; -#ifdef JEMALLOC_TCACHE - bstats[i].nfills += bin->stats.nfills; - bstats[i].nflushes += bin->stats.nflushes; -#endif - bstats[i].nruns += bin->stats.nruns; - bstats[i].reruns += bin->stats.reruns; - bstats[i].highruns += bin->stats.highruns; - bstats[i].curruns += bin->stats.curruns; - malloc_mutex_unlock(&bin->lock); - } -} -#endif - -void -arena_dalloc_large(arena_t *arena, arena_chunk_t *chunk, void *ptr) -{ - - /* Large allocation. */ -#ifdef JEMALLOC_FILL -# ifndef JEMALLOC_STATS - if (opt_junk) -# endif -#endif - { -#if (defined(JEMALLOC_FILL) || defined(JEMALLOC_STATS)) - size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> - PAGE_SHIFT; - size_t size = chunk->map[pageind].bits & ~PAGE_MASK; -#endif - -#ifdef JEMALLOC_FILL -# ifdef JEMALLOC_STATS - if (opt_junk) -# endif - memset(ptr, 0x5a, size); -#endif -#ifdef JEMALLOC_STATS - arena->stats.ndalloc_large++; - arena->stats.allocated_large -= size; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].ndalloc++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns--; -#endif - } - - arena_run_dalloc(arena, (arena_run_t *)ptr, true); -} - -static void -arena_ralloc_large_shrink(arena_t *arena, arena_chunk_t *chunk, void *ptr, - size_t size, size_t oldsize) -{ - - assert(size < oldsize); - - /* - * Shrink the run, and make trailing pages available for other - * allocations. - */ - malloc_mutex_lock(&arena->lock); - arena_run_trim_tail(arena, chunk, (arena_run_t *)ptr, oldsize, size, - true); -#ifdef JEMALLOC_STATS - arena->stats.ndalloc_large++; - arena->stats.allocated_large -= oldsize; - arena->stats.lstats[(oldsize >> PAGE_SHIFT) - 1].ndalloc++; - arena->stats.lstats[(oldsize >> PAGE_SHIFT) - 1].curruns--; - - arena->stats.nmalloc_large++; - arena->stats.nrequests_large++; - arena->stats.allocated_large += size; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nmalloc++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nrequests++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns++; - if (arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns > - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns) { - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns = - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns; - } -#endif - malloc_mutex_unlock(&arena->lock); -} - -static bool -arena_ralloc_large_grow(arena_t *arena, arena_chunk_t *chunk, void *ptr, - size_t size, size_t oldsize) -{ - size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT; - size_t npages = oldsize >> PAGE_SHIFT; - - assert(oldsize == (chunk->map[pageind].bits & ~PAGE_MASK)); - - /* Try to extend the run. */ - assert(size > oldsize); - malloc_mutex_lock(&arena->lock); - if (pageind + npages < chunk_npages && (chunk->map[pageind+npages].bits - & CHUNK_MAP_ALLOCATED) == 0 && (chunk->map[pageind+npages].bits & - ~PAGE_MASK) >= size - oldsize) { - /* - * The next run is available and sufficiently large. Split the - * following run, then merge the first part with the existing - * allocation. - */ - arena_run_split(arena, (arena_run_t *)((uintptr_t)chunk + - ((pageind+npages) << PAGE_SHIFT)), size - oldsize, true, - false); - - chunk->map[pageind].bits = size | CHUNK_MAP_LARGE | - CHUNK_MAP_ALLOCATED; - chunk->map[pageind+npages].bits = CHUNK_MAP_LARGE | - CHUNK_MAP_ALLOCATED; - -#ifdef JEMALLOC_STATS - arena->stats.ndalloc_large++; - arena->stats.allocated_large -= oldsize; - arena->stats.lstats[(oldsize >> PAGE_SHIFT) - 1].ndalloc++; - arena->stats.lstats[(oldsize >> PAGE_SHIFT) - 1].curruns--; - - arena->stats.nmalloc_large++; - arena->stats.nrequests_large++; - arena->stats.allocated_large += size; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nmalloc++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].nrequests++; - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns++; - if (arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns > - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns) { - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].highruns = - arena->stats.lstats[(size >> PAGE_SHIFT) - 1].curruns; - } -#endif - malloc_mutex_unlock(&arena->lock); - return (false); - } - malloc_mutex_unlock(&arena->lock); - - return (true); -} - -/* - * Try to resize a large allocation, in order to avoid copying. This will - * always fail if growing an object, and the following run is already in use. - */ -static bool -arena_ralloc_large(void *ptr, size_t size, size_t oldsize) -{ - size_t psize; - - psize = PAGE_CEILING(size); - if (psize == oldsize) { - /* Same size class. */ -#ifdef JEMALLOC_FILL - if (opt_junk && size < oldsize) { - memset((void *)((uintptr_t)ptr + size), 0x5a, oldsize - - size); - } -#endif - return (false); - } else { - arena_chunk_t *chunk; - arena_t *arena; - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - arena = chunk->arena; - assert(arena->magic == ARENA_MAGIC); - - if (psize < oldsize) { -#ifdef JEMALLOC_FILL - /* Fill before shrinking in order avoid a race. */ - if (opt_junk) { - memset((void *)((uintptr_t)ptr + size), 0x5a, - oldsize - size); - } -#endif - arena_ralloc_large_shrink(arena, chunk, ptr, psize, - oldsize); - return (false); - } else { - bool ret = arena_ralloc_large_grow(arena, chunk, ptr, - psize, oldsize); -#ifdef JEMALLOC_FILL - if (ret == false && opt_zero) { - memset((void *)((uintptr_t)ptr + oldsize), 0, - size - oldsize); - } -#endif - return (ret); - } - } -} - -void * -arena_ralloc(void *ptr, size_t size, size_t oldsize) -{ - void *ret; - size_t copysize; - - /* Try to avoid moving the allocation. */ - if (oldsize <= arena_maxclass) { - if (oldsize <= small_maxclass) { - if (size <= small_maxclass && small_size2bin[size] == - small_size2bin[oldsize]) - goto IN_PLACE; - } else { - assert(size <= arena_maxclass); - if (size > small_maxclass) { - if (arena_ralloc_large(ptr, size, oldsize) == - false) - return (ptr); - } - } - } - - /* - * If we get here, then size and oldsize are different enough that we - * need to move the object. In that case, fall back to allocating new - * space and copying. - */ - ret = arena_malloc(size, false); - if (ret == NULL) - return (NULL); - - /* Junk/zero-filling were already done by arena_malloc(). */ - copysize = (size < oldsize) ? size : oldsize; - memcpy(ret, ptr, copysize); - idalloc(ptr); - return (ret); -IN_PLACE: -#ifdef JEMALLOC_FILL - if (opt_junk && size < oldsize) - memset((void *)((uintptr_t)ptr + size), 0x5a, oldsize - size); - else if (opt_zero && size > oldsize) - memset((void *)((uintptr_t)ptr + oldsize), 0, size - oldsize); -#endif - return (ptr); -} - -bool -arena_new(arena_t *arena, unsigned ind) -{ - unsigned i; - arena_bin_t *bin; - size_t prev_run_size; - - arena->ind = ind; - - if (malloc_mutex_init(&arena->lock)) - return (true); - -#ifdef JEMALLOC_STATS - memset(&arena->stats, 0, sizeof(arena_stats_t)); - arena->stats.lstats = (malloc_large_stats_t *)base_alloc(nlclasses * - sizeof(malloc_large_stats_t)); - if (arena->stats.lstats == NULL) - return (true); - memset(arena->stats.lstats, 0, nlclasses * - sizeof(malloc_large_stats_t)); -# ifdef JEMALLOC_TCACHE - ql_new(&arena->tcache_ql); -# endif -#endif - -#ifdef JEMALLOC_PROF - arena->prof_accumbytes = 0; -#endif - - /* Initialize chunks. */ - ql_new(&arena->chunks_dirty); - arena->spare = NULL; - - arena->nactive = 0; - arena->ndirty = 0; - arena->npurgatory = 0; - - arena_avail_tree_new(&arena->runs_avail_clean); - arena_avail_tree_new(&arena->runs_avail_dirty); - - /* Initialize bins. */ - prev_run_size = PAGE_SIZE; - - i = 0; -#ifdef JEMALLOC_TINY - /* (2^n)-spaced tiny bins. */ - for (; i < ntbins; i++) { - bin = &arena->bins[i]; - if (malloc_mutex_init(&bin->lock)) - return (true); - bin->runcur = NULL; - arena_run_tree_new(&bin->runs); - - bin->reg_size = (1U << (LG_TINY_MIN + i)); - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - -#ifdef JEMALLOC_STATS - memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); -#endif - } -#endif - - /* Quantum-spaced bins. */ - for (; i < ntbins + nqbins; i++) { - bin = &arena->bins[i]; - if (malloc_mutex_init(&bin->lock)) - return (true); - bin->runcur = NULL; - arena_run_tree_new(&bin->runs); - - bin->reg_size = (i - ntbins + 1) << LG_QUANTUM; - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - -#ifdef JEMALLOC_STATS - memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); -#endif - } - - /* Cacheline-spaced bins. */ - for (; i < ntbins + nqbins + ncbins; i++) { - bin = &arena->bins[i]; - if (malloc_mutex_init(&bin->lock)) - return (true); - bin->runcur = NULL; - arena_run_tree_new(&bin->runs); - - bin->reg_size = cspace_min + ((i - (ntbins + nqbins)) << - LG_CACHELINE); - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - -#ifdef JEMALLOC_STATS - memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); -#endif - } - - /* Subpage-spaced bins. */ - for (; i < nbins; i++) { - bin = &arena->bins[i]; - if (malloc_mutex_init(&bin->lock)) - return (true); - bin->runcur = NULL; - arena_run_tree_new(&bin->runs); - - bin->reg_size = sspace_min + ((i - (ntbins + nqbins + ncbins)) - << LG_SUBPAGE); - - prev_run_size = arena_bin_run_size_calc(bin, prev_run_size); - -#ifdef JEMALLOC_STATS - memset(&bin->stats, 0, sizeof(malloc_bin_stats_t)); -#endif - } - -#ifdef JEMALLOC_DEBUG - arena->magic = ARENA_MAGIC; -#endif - - return (false); -} - -#ifdef JEMALLOC_TINY -/* Compute the smallest power of 2 that is >= x. */ -static size_t -pow2_ceil(size_t x) -{ - - x--; - x |= x >> 1; - x |= x >> 2; - x |= x >> 4; - x |= x >> 8; - x |= x >> 16; -#if (SIZEOF_PTR == 8) - x |= x >> 32; -#endif - x++; - return (x); -} -#endif - -#ifdef JEMALLOC_DEBUG -static void -small_size2bin_validate(void) -{ - size_t i, size, binind; - - assert(small_size2bin[0] == 0xffU); - i = 1; -# ifdef JEMALLOC_TINY - /* Tiny. */ - for (; i < (1U << LG_TINY_MIN); i++) { - size = pow2_ceil(1U << LG_TINY_MIN); - binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - assert(small_size2bin[i] == binind); - } - for (; i < qspace_min; i++) { - size = pow2_ceil(i); - binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - assert(small_size2bin[i] == binind); - } -# endif - /* Quantum-spaced. */ - for (; i <= qspace_max; i++) { - size = QUANTUM_CEILING(i); - binind = ntbins + (size >> LG_QUANTUM) - 1; - assert(small_size2bin[i] == binind); - } - /* Cacheline-spaced. */ - for (; i <= cspace_max; i++) { - size = CACHELINE_CEILING(i); - binind = ntbins + nqbins + ((size - cspace_min) >> - LG_CACHELINE); - assert(small_size2bin[i] == binind); - } - /* Sub-page. */ - for (; i <= sspace_max; i++) { - size = SUBPAGE_CEILING(i); - binind = ntbins + nqbins + ncbins + ((size - sspace_min) - >> LG_SUBPAGE); - assert(small_size2bin[i] == binind); - } -} -#endif - -static bool -small_size2bin_init(void) -{ - - if (opt_lg_qspace_max != LG_QSPACE_MAX_DEFAULT - || opt_lg_cspace_max != LG_CSPACE_MAX_DEFAULT - || sizeof(const_small_size2bin) != small_maxclass + 1) - return (small_size2bin_init_hard()); - - small_size2bin = const_small_size2bin; -#ifdef JEMALLOC_DEBUG - assert(sizeof(const_small_size2bin) == small_maxclass + 1); - small_size2bin_validate(); -#endif - return (false); -} - -static bool -small_size2bin_init_hard(void) -{ - size_t i, size, binind; - uint8_t *custom_small_size2bin; - - assert(opt_lg_qspace_max != LG_QSPACE_MAX_DEFAULT - || opt_lg_cspace_max != LG_CSPACE_MAX_DEFAULT - || sizeof(const_small_size2bin) != small_maxclass + 1); - - custom_small_size2bin = (uint8_t *)base_alloc(small_maxclass + 1); - if (custom_small_size2bin == NULL) - return (true); - - custom_small_size2bin[0] = 0xffU; - i = 1; -#ifdef JEMALLOC_TINY - /* Tiny. */ - for (; i < (1U << LG_TINY_MIN); i++) { - size = pow2_ceil(1U << LG_TINY_MIN); - binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - custom_small_size2bin[i] = binind; - } - for (; i < qspace_min; i++) { - size = pow2_ceil(i); - binind = ffs((int)(size >> (LG_TINY_MIN + 1))); - custom_small_size2bin[i] = binind; - } -#endif - /* Quantum-spaced. */ - for (; i <= qspace_max; i++) { - size = QUANTUM_CEILING(i); - binind = ntbins + (size >> LG_QUANTUM) - 1; - custom_small_size2bin[i] = binind; - } - /* Cacheline-spaced. */ - for (; i <= cspace_max; i++) { - size = CACHELINE_CEILING(i); - binind = ntbins + nqbins + ((size - cspace_min) >> - LG_CACHELINE); - custom_small_size2bin[i] = binind; - } - /* Sub-page. */ - for (; i <= sspace_max; i++) { - size = SUBPAGE_CEILING(i); - binind = ntbins + nqbins + ncbins + ((size - sspace_min) >> - LG_SUBPAGE); - custom_small_size2bin[i] = binind; - } - - small_size2bin = custom_small_size2bin; -#ifdef JEMALLOC_DEBUG - small_size2bin_validate(); -#endif - return (false); -} - -bool -arena_boot(void) -{ - size_t header_size; - - /* Set variables according to the value of opt_lg_[qc]space_max. */ - qspace_max = (1U << opt_lg_qspace_max); - cspace_min = CACHELINE_CEILING(qspace_max); - if (cspace_min == qspace_max) - cspace_min += CACHELINE; - cspace_max = (1U << opt_lg_cspace_max); - sspace_min = SUBPAGE_CEILING(cspace_max); - if (sspace_min == cspace_max) - sspace_min += SUBPAGE; - assert(sspace_min < PAGE_SIZE); - sspace_max = PAGE_SIZE - SUBPAGE; - -#ifdef JEMALLOC_TINY - assert(LG_QUANTUM >= LG_TINY_MIN); -#endif - assert(ntbins <= LG_QUANTUM); - nqbins = qspace_max >> LG_QUANTUM; - ncbins = ((cspace_max - cspace_min) >> LG_CACHELINE) + 1; - nsbins = ((sspace_max - sspace_min) >> LG_SUBPAGE) + 1; - nbins = ntbins + nqbins + ncbins + nsbins; - - /* - * The small_size2bin lookup table uses uint8_t to encode each bin - * index, so we cannot support more than 256 small size classes. This - * limit is difficult to exceed (not even possible with 16B quantum and - * 4KiB pages), and such configurations are impractical, but - * nonetheless we need to protect against this case in order to avoid - * undefined behavior. - * - * Further constrain nbins to 255 if prof_promote is true, since all - * small size classes, plus a "not small" size class must be stored in - * 8 bits of arena_chunk_map_t's bits field. - */ -#ifdef JEMALLOC_PROF - if (opt_prof && prof_promote) { - if (nbins > 255) { - char line_buf[UMAX2S_BUFSIZE]; - malloc_write(": Too many small size classes ("); - malloc_write(umax2s(nbins, 10, line_buf)); - malloc_write(" > max 255)\n"); - abort(); - } - } else -#endif - if (nbins > 256) { - char line_buf[UMAX2S_BUFSIZE]; - malloc_write(": Too many small size classes ("); - malloc_write(umax2s(nbins, 10, line_buf)); - malloc_write(" > max 256)\n"); - abort(); - } - - if (small_size2bin_init()) - return (true); - - /* - * Compute the header size such that it is large enough to contain the - * page map. - */ - header_size = sizeof(arena_chunk_t) + - (sizeof(arena_chunk_map_t) * (chunk_npages - 1)); - arena_chunk_header_npages = (header_size >> PAGE_SHIFT) + - ((header_size & PAGE_MASK) != 0); - arena_maxclass = chunksize - (arena_chunk_header_npages << PAGE_SHIFT); - - return (false); -} diff --git a/dep/src/jmalloc/base.c b/dep/src/jmalloc/base.c deleted file mode 100644 index 605197eaced..00000000000 --- a/dep/src/jmalloc/base.c +++ /dev/null @@ -1,106 +0,0 @@ -#define JEMALLOC_BASE_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -malloc_mutex_t base_mtx; - -/* - * Current pages that are being used for internal memory allocations. These - * pages are carved up in cacheline-size quanta, so that there is no chance of - * false cache line sharing. - */ -static void *base_pages; -static void *base_next_addr; -static void *base_past_addr; /* Addr immediately past base_pages. */ -static extent_node_t *base_nodes; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static bool base_pages_alloc(size_t minsize); - -/******************************************************************************/ - -static bool -base_pages_alloc(size_t minsize) -{ - size_t csize; - bool zero; - - assert(minsize != 0); - csize = CHUNK_CEILING(minsize); - zero = false; - base_pages = chunk_alloc(csize, &zero); - if (base_pages == NULL) - return (true); - base_next_addr = base_pages; - base_past_addr = (void *)((uintptr_t)base_pages + csize); - - return (false); -} - -void * -base_alloc(size_t size) -{ - void *ret; - size_t csize; - - /* Round size up to nearest multiple of the cacheline size. */ - csize = CACHELINE_CEILING(size); - - malloc_mutex_lock(&base_mtx); - /* Make sure there's enough space for the allocation. */ - if ((uintptr_t)base_next_addr + csize > (uintptr_t)base_past_addr) { - if (base_pages_alloc(csize)) { - malloc_mutex_unlock(&base_mtx); - return (NULL); - } - } - /* Allocate. */ - ret = base_next_addr; - base_next_addr = (void *)((uintptr_t)base_next_addr + csize); - malloc_mutex_unlock(&base_mtx); - - return (ret); -} - -extent_node_t * -base_node_alloc(void) -{ - extent_node_t *ret; - - malloc_mutex_lock(&base_mtx); - if (base_nodes != NULL) { - ret = base_nodes; - base_nodes = *(extent_node_t **)ret; - malloc_mutex_unlock(&base_mtx); - } else { - malloc_mutex_unlock(&base_mtx); - ret = (extent_node_t *)base_alloc(sizeof(extent_node_t)); - } - - return (ret); -} - -void -base_node_dealloc(extent_node_t *node) -{ - - malloc_mutex_lock(&base_mtx); - *(extent_node_t **)node = base_nodes; - base_nodes = node; - malloc_mutex_unlock(&base_mtx); -} - -bool -base_boot(void) -{ - - base_nodes = NULL; - if (malloc_mutex_init(&base_mtx)) - return (true); - - return (false); -} diff --git a/dep/src/jmalloc/chunk.c b/dep/src/jmalloc/chunk.c deleted file mode 100644 index e6e3bcd195a..00000000000 --- a/dep/src/jmalloc/chunk.c +++ /dev/null @@ -1,150 +0,0 @@ -#define JEMALLOC_CHUNK_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -size_t opt_lg_chunk = LG_CHUNK_DEFAULT; -#ifdef JEMALLOC_SWAP -bool opt_overcommit = true; -#endif - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -malloc_mutex_t chunks_mtx; -chunk_stats_t stats_chunks; -#endif - -/* Various chunk-related settings. */ -size_t chunksize; -size_t chunksize_mask; /* (chunksize - 1). */ -size_t chunk_npages; -size_t arena_chunk_header_npages; -size_t arena_maxclass; /* Max size class for arenas. */ - -/******************************************************************************/ - -/* - * If the caller specifies (*zero == false), it is still possible to receive - * zeroed memory, in which case *zero is toggled to true. arena_chunk_alloc() - * takes advantage of this to avoid demanding zeroed chunks, but taking - * advantage of them if they are returned. - */ -void * -chunk_alloc(size_t size, bool *zero) -{ - void *ret; - - assert(size != 0); - assert((size & chunksize_mask) == 0); - -#ifdef JEMALLOC_SWAP - if (swap_enabled) { - ret = chunk_alloc_swap(size, zero); - if (ret != NULL) - goto RETURN; - } - - if (swap_enabled == false || opt_overcommit) { -#endif -#ifdef JEMALLOC_DSS - ret = chunk_alloc_dss(size, zero); - if (ret != NULL) - goto RETURN; -#endif - ret = chunk_alloc_mmap(size); - if (ret != NULL) { - *zero = true; - goto RETURN; - } -#ifdef JEMALLOC_SWAP - } -#endif - - /* All strategies for allocation failed. */ - ret = NULL; -RETURN: -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - if (ret != NULL) { -# ifdef JEMALLOC_PROF - bool udump; -# endif - malloc_mutex_lock(&chunks_mtx); -# ifdef JEMALLOC_STATS - stats_chunks.nchunks += (size / chunksize); -# endif - stats_chunks.curchunks += (size / chunksize); - if (stats_chunks.curchunks > stats_chunks.highchunks) { - stats_chunks.highchunks = stats_chunks.curchunks; -# ifdef JEMALLOC_PROF - udump = true; -# endif - } -# ifdef JEMALLOC_PROF - else - udump = false; -# endif - malloc_mutex_unlock(&chunks_mtx); -# ifdef JEMALLOC_PROF - if (opt_prof && opt_prof_udump && udump) - prof_udump(); -# endif - } -#endif - - assert(CHUNK_ADDR2BASE(ret) == ret); - return (ret); -} - -void -chunk_dealloc(void *chunk, size_t size) -{ - - assert(chunk != NULL); - assert(CHUNK_ADDR2BASE(chunk) == chunk); - assert(size != 0); - assert((size & chunksize_mask) == 0); - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - malloc_mutex_lock(&chunks_mtx); - stats_chunks.curchunks -= (size / chunksize); - malloc_mutex_unlock(&chunks_mtx); -#endif - -#ifdef JEMALLOC_SWAP - if (swap_enabled && chunk_dealloc_swap(chunk, size) == false) - return; -#endif -#ifdef JEMALLOC_DSS - if (chunk_dealloc_dss(chunk, size) == false) - return; -#endif - chunk_dealloc_mmap(chunk, size); -} - -bool -chunk_boot(void) -{ - - /* Set variables according to the value of opt_lg_chunk. */ - chunksize = (1LU << opt_lg_chunk); - assert(chunksize >= PAGE_SIZE); - chunksize_mask = chunksize - 1; - chunk_npages = (chunksize >> PAGE_SHIFT); - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - if (malloc_mutex_init(&chunks_mtx)) - return (true); - memset(&stats_chunks, 0, sizeof(chunk_stats_t)); -#endif - -#ifdef JEMALLOC_SWAP - if (chunk_swap_boot()) - return (true); -#endif -#ifdef JEMALLOC_DSS - if (chunk_dss_boot()) - return (true); -#endif - - return (false); -} diff --git a/dep/src/jmalloc/chunk_dss.c b/dep/src/jmalloc/chunk_dss.c deleted file mode 100644 index d9bd63c3ac4..00000000000 --- a/dep/src/jmalloc/chunk_dss.c +++ /dev/null @@ -1,268 +0,0 @@ -#define JEMALLOC_CHUNK_DSS_C_ -#include "jemalloc/internal/jemalloc_internal.h" -#ifdef JEMALLOC_DSS -/******************************************************************************/ -/* Data. */ - -malloc_mutex_t dss_mtx; - -/* Base address of the DSS. */ -static void *dss_base; -/* Current end of the DSS, or ((void *)-1) if the DSS is exhausted. */ -static void *dss_prev; -/* Current upper limit on DSS addresses. */ -static void *dss_max; - -/* - * Trees of chunks that were previously allocated (trees differ only in node - * ordering). These are used when allocating chunks, in an attempt to re-use - * address space. Depending on function, different tree orderings are needed, - * which is why there are two trees with the same contents. - */ -static extent_tree_t dss_chunks_szad; -static extent_tree_t dss_chunks_ad; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static void *chunk_recycle_dss(size_t size, bool *zero); -static extent_node_t *chunk_dealloc_dss_record(void *chunk, size_t size); - -/******************************************************************************/ - -static void * -chunk_recycle_dss(size_t size, bool *zero) -{ - extent_node_t *node, key; - - key.addr = NULL; - key.size = size; - malloc_mutex_lock(&dss_mtx); - node = extent_tree_szad_nsearch(&dss_chunks_szad, &key); - if (node != NULL) { - void *ret = node->addr; - - /* Remove node from the tree. */ - extent_tree_szad_remove(&dss_chunks_szad, node); - if (node->size == size) { - extent_tree_ad_remove(&dss_chunks_ad, node); - base_node_dealloc(node); - } else { - /* - * Insert the remainder of node's address range as a - * smaller chunk. Its position within dss_chunks_ad - * does not change. - */ - assert(node->size > size); - node->addr = (void *)((uintptr_t)node->addr + size); - node->size -= size; - extent_tree_szad_insert(&dss_chunks_szad, node); - } - malloc_mutex_unlock(&dss_mtx); - - if (*zero) - memset(ret, 0, size); - return (ret); - } - malloc_mutex_unlock(&dss_mtx); - - return (NULL); -} - -void * -chunk_alloc_dss(size_t size, bool *zero) -{ - void *ret; - - ret = chunk_recycle_dss(size, zero); - if (ret != NULL) - return (ret); - - /* - * sbrk() uses a signed increment argument, so take care not to - * interpret a huge allocation request as a negative increment. - */ - if ((intptr_t)size < 0) - return (NULL); - - malloc_mutex_lock(&dss_mtx); - if (dss_prev != (void *)-1) { - intptr_t incr; - - /* - * The loop is necessary to recover from races with other - * threads that are using the DSS for something other than - * malloc. - */ - do { - /* Get the current end of the DSS. */ - dss_max = sbrk(0); - - /* - * Calculate how much padding is necessary to - * chunk-align the end of the DSS. - */ - incr = (intptr_t)size - - (intptr_t)CHUNK_ADDR2OFFSET(dss_max); - if (incr == (intptr_t)size) - ret = dss_max; - else { - ret = (void *)((intptr_t)dss_max + incr); - incr += size; - } - - dss_prev = sbrk(incr); - if (dss_prev == dss_max) { - /* Success. */ - dss_max = (void *)((intptr_t)dss_prev + incr); - malloc_mutex_unlock(&dss_mtx); - *zero = true; - return (ret); - } - } while (dss_prev != (void *)-1); - } - malloc_mutex_unlock(&dss_mtx); - - return (NULL); -} - -static extent_node_t * -chunk_dealloc_dss_record(void *chunk, size_t size) -{ - extent_node_t *xnode, *node, *prev, key; - - xnode = NULL; - while (true) { - key.addr = (void *)((uintptr_t)chunk + size); - node = extent_tree_ad_nsearch(&dss_chunks_ad, &key); - /* Try to coalesce forward. */ - if (node != NULL && node->addr == key.addr) { - /* - * Coalesce chunk with the following address range. - * This does not change the position within - * dss_chunks_ad, so only remove/insert from/into - * dss_chunks_szad. - */ - extent_tree_szad_remove(&dss_chunks_szad, node); - node->addr = chunk; - node->size += size; - extent_tree_szad_insert(&dss_chunks_szad, node); - break; - } else if (xnode == NULL) { - /* - * It is possible that base_node_alloc() will cause a - * new base chunk to be allocated, so take care not to - * deadlock on dss_mtx, and recover if another thread - * deallocates an adjacent chunk while this one is busy - * allocating xnode. - */ - malloc_mutex_unlock(&dss_mtx); - xnode = base_node_alloc(); - malloc_mutex_lock(&dss_mtx); - if (xnode == NULL) - return (NULL); - } else { - /* Coalescing forward failed, so insert a new node. */ - node = xnode; - xnode = NULL; - node->addr = chunk; - node->size = size; - extent_tree_ad_insert(&dss_chunks_ad, node); - extent_tree_szad_insert(&dss_chunks_szad, node); - break; - } - } - /* Discard xnode if it ended up unused do to a race. */ - if (xnode != NULL) - base_node_dealloc(xnode); - - /* Try to coalesce backward. */ - prev = extent_tree_ad_prev(&dss_chunks_ad, node); - if (prev != NULL && (void *)((uintptr_t)prev->addr + prev->size) == - chunk) { - /* - * Coalesce chunk with the previous address range. This does - * not change the position within dss_chunks_ad, so only - * remove/insert node from/into dss_chunks_szad. - */ - extent_tree_szad_remove(&dss_chunks_szad, prev); - extent_tree_ad_remove(&dss_chunks_ad, prev); - - extent_tree_szad_remove(&dss_chunks_szad, node); - node->addr = prev->addr; - node->size += prev->size; - extent_tree_szad_insert(&dss_chunks_szad, node); - - base_node_dealloc(prev); - } - - return (node); -} - -bool -chunk_dealloc_dss(void *chunk, size_t size) -{ - bool ret; - - malloc_mutex_lock(&dss_mtx); - if ((uintptr_t)chunk >= (uintptr_t)dss_base - && (uintptr_t)chunk < (uintptr_t)dss_max) { - extent_node_t *node; - - /* Try to coalesce with other unused chunks. */ - node = chunk_dealloc_dss_record(chunk, size); - if (node != NULL) { - chunk = node->addr; - size = node->size; - } - - /* Get the current end of the DSS. */ - dss_max = sbrk(0); - - /* - * Try to shrink the DSS if this chunk is at the end of the - * DSS. The sbrk() call here is subject to a race condition - * with threads that use brk(2) or sbrk(2) directly, but the - * alternative would be to leak memory for the sake of poorly - * designed multi-threaded programs. - */ - if ((void *)((uintptr_t)chunk + size) == dss_max - && (dss_prev = sbrk(-(intptr_t)size)) == dss_max) { - /* Success. */ - dss_max = (void *)((intptr_t)dss_prev - (intptr_t)size); - - if (node != NULL) { - extent_tree_szad_remove(&dss_chunks_szad, node); - extent_tree_ad_remove(&dss_chunks_ad, node); - base_node_dealloc(node); - } - } else - madvise(chunk, size, MADV_DONTNEED); - - ret = false; - goto RETURN; - } - - ret = true; -RETURN: - malloc_mutex_unlock(&dss_mtx); - return (ret); -} - -bool -chunk_dss_boot(void) -{ - - if (malloc_mutex_init(&dss_mtx)) - return (true); - dss_base = sbrk(0); - dss_prev = dss_base; - dss_max = dss_base; - extent_tree_szad_new(&dss_chunks_szad); - extent_tree_ad_new(&dss_chunks_ad); - - return (false); -} - -/******************************************************************************/ -#endif /* JEMALLOC_DSS */ diff --git a/dep/src/jmalloc/chunk_mmap.c b/dep/src/jmalloc/chunk_mmap.c deleted file mode 100644 index 8f0711384e3..00000000000 --- a/dep/src/jmalloc/chunk_mmap.c +++ /dev/null @@ -1,201 +0,0 @@ -#define JEMALLOC_CHUNK_MMAP_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -/* - * Used by chunk_alloc_mmap() to decide whether to attempt the fast path and - * potentially avoid some system calls. We can get away without TLS here, - * since the state of mmap_unaligned only affects performance, rather than - * correct function. - */ -static -#ifndef NO_TLS - __thread -#endif - bool mmap_unaligned -#ifndef NO_TLS - JEMALLOC_ATTR(tls_model("initial-exec")) -#endif - ; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static void *pages_map(void *addr, size_t size); -static void pages_unmap(void *addr, size_t size); -static void *chunk_alloc_mmap_slow(size_t size, bool unaligned); - -/******************************************************************************/ - -static void * -pages_map(void *addr, size_t size) -{ - void *ret; - - /* - * We don't use MAP_FIXED here, because it can cause the *replacement* - * of existing mappings, and we only want to create new mappings. - */ - ret = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, - -1, 0); - assert(ret != NULL); - - if (ret == MAP_FAILED) - ret = NULL; - else if (addr != NULL && ret != addr) { - /* - * We succeeded in mapping memory, but not in the right place. - */ - if (munmap(ret, size) == -1) { - char buf[STRERROR_BUF]; - - strerror_r(errno, buf, sizeof(buf)); - malloc_write(": Error in munmap(): "); - malloc_write(buf); - malloc_write("\n"); - if (opt_abort) - abort(); - } - ret = NULL; - } - - assert(ret == NULL || (addr == NULL && ret != addr) - || (addr != NULL && ret == addr)); - return (ret); -} - -static void -pages_unmap(void *addr, size_t size) -{ - - if (munmap(addr, size) == -1) { - char buf[STRERROR_BUF]; - - strerror_r(errno, buf, sizeof(buf)); - malloc_write(": Error in munmap(): "); - malloc_write(buf); - malloc_write("\n"); - if (opt_abort) - abort(); - } -} - -static void * -chunk_alloc_mmap_slow(size_t size, bool unaligned) -{ - void *ret; - size_t offset; - - /* Beware size_t wrap-around. */ - if (size + chunksize <= size) - return (NULL); - - ret = pages_map(NULL, size + chunksize); - if (ret == NULL) - return (NULL); - - /* Clean up unneeded leading/trailing space. */ - offset = CHUNK_ADDR2OFFSET(ret); - if (offset != 0) { - /* Note that mmap() returned an unaligned mapping. */ - unaligned = true; - - /* Leading space. */ - pages_unmap(ret, chunksize - offset); - - ret = (void *)((uintptr_t)ret + - (chunksize - offset)); - - /* Trailing space. */ - pages_unmap((void *)((uintptr_t)ret + size), - offset); - } else { - /* Trailing space only. */ - pages_unmap((void *)((uintptr_t)ret + size), - chunksize); - } - - /* - * If mmap() returned an aligned mapping, reset mmap_unaligned so that - * the next chunk_alloc_mmap() execution tries the fast allocation - * method. - */ - if (unaligned == false) - mmap_unaligned = false; - - return (ret); -} - -void * -chunk_alloc_mmap(size_t size) -{ - void *ret; - - /* - * Ideally, there would be a way to specify alignment to mmap() (like - * NetBSD has), but in the absence of such a feature, we have to work - * hard to efficiently create aligned mappings. The reliable, but - * slow method is to create a mapping that is over-sized, then trim the - * excess. However, that always results in at least one call to - * pages_unmap(). - * - * A more optimistic approach is to try mapping precisely the right - * amount, then try to append another mapping if alignment is off. In - * practice, this works out well as long as the application is not - * interleaving mappings via direct mmap() calls. If we do run into a - * situation where there is an interleaved mapping and we are unable to - * extend an unaligned mapping, our best option is to switch to the - * slow method until mmap() returns another aligned mapping. This will - * tend to leave a gap in the memory map that is too small to cause - * later problems for the optimistic method. - * - * Another possible confounding factor is address space layout - * randomization (ASLR), which causes mmap(2) to disregard the - * requested address. mmap_unaligned tracks whether the previous - * chunk_alloc_mmap() execution received any unaligned or relocated - * mappings, and if so, the current execution will immediately fall - * back to the slow method. However, we keep track of whether the fast - * method would have succeeded, and if so, we make a note to try the - * fast method next time. - */ - - if (mmap_unaligned == false) { - size_t offset; - - ret = pages_map(NULL, size); - if (ret == NULL) - return (NULL); - - offset = CHUNK_ADDR2OFFSET(ret); - if (offset != 0) { - mmap_unaligned = true; - /* Try to extend chunk boundary. */ - if (pages_map((void *)((uintptr_t)ret + size), - chunksize - offset) == NULL) { - /* - * Extension failed. Clean up, then revert to - * the reliable-but-expensive method. - */ - pages_unmap(ret, size); - ret = chunk_alloc_mmap_slow(size, true); - } else { - /* Clean up unneeded leading space. */ - pages_unmap(ret, chunksize - offset); - ret = (void *)((uintptr_t)ret + (chunksize - - offset)); - } - } - } else - ret = chunk_alloc_mmap_slow(size, false); - - return (ret); -} - -void -chunk_dealloc_mmap(void *chunk, size_t size) -{ - - pages_unmap(chunk, size); -} diff --git a/dep/src/jmalloc/chunk_swap.c b/dep/src/jmalloc/chunk_swap.c deleted file mode 100644 index b8c880f0a17..00000000000 --- a/dep/src/jmalloc/chunk_swap.c +++ /dev/null @@ -1,383 +0,0 @@ -#define JEMALLOC_CHUNK_SWAP_C_ -#include "jemalloc/internal/jemalloc_internal.h" -#ifdef JEMALLOC_SWAP -/******************************************************************************/ -/* Data. */ - -malloc_mutex_t swap_mtx; -bool swap_enabled; -bool swap_prezeroed; -size_t swap_nfds; -int *swap_fds; -#ifdef JEMALLOC_STATS -size_t swap_avail; -#endif - -/* Base address of the mmap()ed file(s). */ -static void *swap_base; -/* Current end of the space in use (<= swap_max). */ -static void *swap_end; -/* Absolute upper limit on file-backed addresses. */ -static void *swap_max; - -/* - * Trees of chunks that were previously allocated (trees differ only in node - * ordering). These are used when allocating chunks, in an attempt to re-use - * address space. Depending on function, different tree orderings are needed, - * which is why there are two trees with the same contents. - */ -static extent_tree_t swap_chunks_szad; -static extent_tree_t swap_chunks_ad; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static void *chunk_recycle_swap(size_t size, bool *zero); -static extent_node_t *chunk_dealloc_swap_record(void *chunk, size_t size); - -/******************************************************************************/ - -static void * -chunk_recycle_swap(size_t size, bool *zero) -{ - extent_node_t *node, key; - - key.addr = NULL; - key.size = size; - malloc_mutex_lock(&swap_mtx); - node = extent_tree_szad_nsearch(&swap_chunks_szad, &key); - if (node != NULL) { - void *ret = node->addr; - - /* Remove node from the tree. */ - extent_tree_szad_remove(&swap_chunks_szad, node); - if (node->size == size) { - extent_tree_ad_remove(&swap_chunks_ad, node); - base_node_dealloc(node); - } else { - /* - * Insert the remainder of node's address range as a - * smaller chunk. Its position within swap_chunks_ad - * does not change. - */ - assert(node->size > size); - node->addr = (void *)((uintptr_t)node->addr + size); - node->size -= size; - extent_tree_szad_insert(&swap_chunks_szad, node); - } -#ifdef JEMALLOC_STATS - swap_avail -= size; -#endif - malloc_mutex_unlock(&swap_mtx); - - if (*zero) - memset(ret, 0, size); - return (ret); - } - malloc_mutex_unlock(&swap_mtx); - - return (NULL); -} - -void * -chunk_alloc_swap(size_t size, bool *zero) -{ - void *ret; - - assert(swap_enabled); - - ret = chunk_recycle_swap(size, zero); - if (ret != NULL) - return (ret); - - malloc_mutex_lock(&swap_mtx); - if ((uintptr_t)swap_end + size <= (uintptr_t)swap_max) { - ret = swap_end; - swap_end = (void *)((uintptr_t)swap_end + size); -#ifdef JEMALLOC_STATS - swap_avail -= size; -#endif - malloc_mutex_unlock(&swap_mtx); - - if (swap_prezeroed) - *zero = true; - else if (*zero) - memset(ret, 0, size); - } else { - malloc_mutex_unlock(&swap_mtx); - return (NULL); - } - - return (ret); -} - -static extent_node_t * -chunk_dealloc_swap_record(void *chunk, size_t size) -{ - extent_node_t *xnode, *node, *prev, key; - - xnode = NULL; - while (true) { - key.addr = (void *)((uintptr_t)chunk + size); - node = extent_tree_ad_nsearch(&swap_chunks_ad, &key); - /* Try to coalesce forward. */ - if (node != NULL && node->addr == key.addr) { - /* - * Coalesce chunk with the following address range. - * This does not change the position within - * swap_chunks_ad, so only remove/insert from/into - * swap_chunks_szad. - */ - extent_tree_szad_remove(&swap_chunks_szad, node); - node->addr = chunk; - node->size += size; - extent_tree_szad_insert(&swap_chunks_szad, node); - break; - } else if (xnode == NULL) { - /* - * It is possible that base_node_alloc() will cause a - * new base chunk to be allocated, so take care not to - * deadlock on swap_mtx, and recover if another thread - * deallocates an adjacent chunk while this one is busy - * allocating xnode. - */ - malloc_mutex_unlock(&swap_mtx); - xnode = base_node_alloc(); - malloc_mutex_lock(&swap_mtx); - if (xnode == NULL) - return (NULL); - } else { - /* Coalescing forward failed, so insert a new node. */ - node = xnode; - xnode = NULL; - node->addr = chunk; - node->size = size; - extent_tree_ad_insert(&swap_chunks_ad, node); - extent_tree_szad_insert(&swap_chunks_szad, node); - break; - } - } - /* Discard xnode if it ended up unused do to a race. */ - if (xnode != NULL) - base_node_dealloc(xnode); - - /* Try to coalesce backward. */ - prev = extent_tree_ad_prev(&swap_chunks_ad, node); - if (prev != NULL && (void *)((uintptr_t)prev->addr + prev->size) == - chunk) { - /* - * Coalesce chunk with the previous address range. This does - * not change the position within swap_chunks_ad, so only - * remove/insert node from/into swap_chunks_szad. - */ - extent_tree_szad_remove(&swap_chunks_szad, prev); - extent_tree_ad_remove(&swap_chunks_ad, prev); - - extent_tree_szad_remove(&swap_chunks_szad, node); - node->addr = prev->addr; - node->size += prev->size; - extent_tree_szad_insert(&swap_chunks_szad, node); - - base_node_dealloc(prev); - } - - return (node); -} - -bool -chunk_dealloc_swap(void *chunk, size_t size) -{ - bool ret; - - assert(swap_enabled); - - malloc_mutex_lock(&swap_mtx); - if ((uintptr_t)chunk >= (uintptr_t)swap_base - && (uintptr_t)chunk < (uintptr_t)swap_max) { - extent_node_t *node; - - /* Try to coalesce with other unused chunks. */ - node = chunk_dealloc_swap_record(chunk, size); - if (node != NULL) { - chunk = node->addr; - size = node->size; - } - - /* - * Try to shrink the in-use memory if this chunk is at the end - * of the in-use memory. - */ - if ((void *)((uintptr_t)chunk + size) == swap_end) { - swap_end = (void *)((uintptr_t)swap_end - size); - - if (node != NULL) { - extent_tree_szad_remove(&swap_chunks_szad, - node); - extent_tree_ad_remove(&swap_chunks_ad, node); - base_node_dealloc(node); - } - } else - madvise(chunk, size, MADV_DONTNEED); - - ret = false; - goto RETURN; - } - - ret = true; -RETURN: -#ifdef JEMALLOC_STATS - swap_avail += size; -#endif - malloc_mutex_unlock(&swap_mtx); - return (ret); -} - -bool -chunk_swap_enable(const int *fds, unsigned nfds, bool prezeroed) -{ - bool ret; - unsigned i; - off_t off; - void *vaddr; - size_t cumsize, voff; - size_t sizes[nfds]; - - malloc_mutex_lock(&swap_mtx); - - /* Get file sizes. */ - for (i = 0, cumsize = 0; i < nfds; i++) { - off = lseek(fds[i], 0, SEEK_END); - if (off == ((off_t)-1)) { - ret = true; - goto RETURN; - } - if (PAGE_CEILING(off) != off) { - /* Truncate to a multiple of the page size. */ - off &= ~PAGE_MASK; - if (ftruncate(fds[i], off) != 0) { - ret = true; - goto RETURN; - } - } - sizes[i] = off; - if (cumsize + off < cumsize) { - /* - * Cumulative file size is greater than the total - * address space. Bail out while it's still obvious - * what the problem is. - */ - ret = true; - goto RETURN; - } - cumsize += off; - } - - /* Round down to a multiple of the chunk size. */ - cumsize &= ~chunksize_mask; - if (cumsize == 0) { - ret = true; - goto RETURN; - } - - /* - * Allocate a chunk-aligned region of anonymous memory, which will - * be the final location for the memory-mapped files. - */ - vaddr = chunk_alloc_mmap(cumsize); - if (vaddr == NULL) { - ret = true; - goto RETURN; - } - - /* Overlay the files onto the anonymous mapping. */ - for (i = 0, voff = 0; i < nfds; i++) { - void *addr = mmap((void *)((uintptr_t)vaddr + voff), sizes[i], - PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fds[i], 0); - if (addr == MAP_FAILED) { - char buf[STRERROR_BUF]; - - strerror_r(errno, buf, sizeof(buf)); - malloc_write( - ": Error in mmap(..., MAP_FIXED, ...): "); - malloc_write(buf); - malloc_write("\n"); - if (opt_abort) - abort(); - if (munmap(vaddr, voff) == -1) { - strerror_r(errno, buf, sizeof(buf)); - malloc_write(": Error in munmap(): "); - malloc_write(buf); - malloc_write("\n"); - } - ret = true; - goto RETURN; - } - assert(addr == (void *)((uintptr_t)vaddr + voff)); - - /* - * Tell the kernel that the mapping will be accessed randomly, - * and that it should not gratuitously sync pages to the - * filesystem. - */ -#ifdef MADV_RANDOM - madvise(addr, sizes[i], MADV_RANDOM); -#endif -#ifdef MADV_NOSYNC - madvise(addr, sizes[i], MADV_NOSYNC); -#endif - - voff += sizes[i]; - } - - swap_prezeroed = prezeroed; - swap_base = vaddr; - swap_end = swap_base; - swap_max = (void *)((uintptr_t)vaddr + cumsize); - - /* Copy the fds array for mallctl purposes. */ - swap_fds = (int *)base_alloc(nfds * sizeof(int)); - if (swap_fds == NULL) { - ret = true; - goto RETURN; - } - memcpy(swap_fds, fds, nfds * sizeof(int)); - swap_nfds = nfds; - -#ifdef JEMALLOC_STATS - swap_avail = cumsize; -#endif - - swap_enabled = true; - - ret = false; -RETURN: - malloc_mutex_unlock(&swap_mtx); - return (ret); -} - -bool -chunk_swap_boot(void) -{ - - if (malloc_mutex_init(&swap_mtx)) - return (true); - - swap_enabled = false; - swap_prezeroed = false; /* swap.* mallctl's depend on this. */ - swap_nfds = 0; - swap_fds = NULL; -#ifdef JEMALLOC_STATS - swap_avail = 0; -#endif - swap_base = NULL; - swap_end = NULL; - swap_max = NULL; - - extent_tree_szad_new(&swap_chunks_szad); - extent_tree_ad_new(&swap_chunks_ad); - - return (false); -} - -/******************************************************************************/ -#endif /* JEMALLOC_SWAP */ diff --git a/dep/src/jmalloc/ckh.c b/dep/src/jmalloc/ckh.c deleted file mode 100644 index a0c4162aa19..00000000000 --- a/dep/src/jmalloc/ckh.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - ******************************************************************************* - * Implementation of (2^1+,2) cuckoo hashing, where 2^1+ indicates that each - * hash bucket contains 2^n cells, for n >= 1, and 2 indicates that two hash - * functions are employed. The original cuckoo hashing algorithm was described - * in: - * - * Pagh, R., F.F. Rodler (2004) Cuckoo Hashing. Journal of Algorithms - * 51(2):122-144. - * - * Generalization of cuckoo hashing was discussed in: - * - * Erlingsson, U., M. Manasse, F. McSherry (2006) A cool and practical - * alternative to traditional hash tables. In Proceedings of the 7th - * Workshop on Distributed Data and Structures (WDAS'06), Santa Clara, CA, - * January 2006. - * - * This implementation uses precisely two hash functions because that is the - * fewest that can work, and supporting multiple hashes is an implementation - * burden. Here is a reproduction of Figure 1 from Erlingsson et al. (2006) - * that shows approximate expected maximum load factors for various - * configurations: - * - * | #cells/bucket | - * #hashes | 1 | 2 | 4 | 8 | - * --------+-------+-------+-------+-------+ - * 1 | 0.006 | 0.006 | 0.03 | 0.12 | - * 2 | 0.49 | 0.86 |>0.93< |>0.96< | - * 3 | 0.91 | 0.97 | 0.98 | 0.999 | - * 4 | 0.97 | 0.99 | 0.999 | | - * - * The number of cells per bucket is chosen such that a bucket fits in one cache - * line. So, on 32- and 64-bit systems, we use (8,2) and (4,2) cuckoo hashing, - * respectively. - * - ******************************************************************************/ -#define CKH_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static bool ckh_grow(ckh_t *ckh); -static void ckh_shrink(ckh_t *ckh); - -/******************************************************************************/ - -/* - * Search bucket for key and return the cell number if found; SIZE_T_MAX - * otherwise. - */ -JEMALLOC_INLINE size_t -ckh_bucket_search(ckh_t *ckh, size_t bucket, const void *key) -{ - ckhc_t *cell; - unsigned i; - - for (i = 0; i < (ZU(1) << LG_CKH_BUCKET_CELLS); i++) { - cell = &ckh->tab[(bucket << LG_CKH_BUCKET_CELLS) + i]; - if (cell->key != NULL && ckh->keycomp(key, cell->key)) - return ((bucket << LG_CKH_BUCKET_CELLS) + i); - } - - return (SIZE_T_MAX); -} - -/* - * Search table for key and return cell number if found; SIZE_T_MAX otherwise. - */ -JEMALLOC_INLINE size_t -ckh_isearch(ckh_t *ckh, const void *key) -{ - size_t hash1, hash2, bucket, cell; - - assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); - - ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2); - - /* Search primary bucket. */ - bucket = hash1 & ((ZU(1) << ckh->lg_curbuckets) - 1); - cell = ckh_bucket_search(ckh, bucket, key); - if (cell != SIZE_T_MAX) - return (cell); - - /* Search secondary bucket. */ - bucket = hash2 & ((ZU(1) << ckh->lg_curbuckets) - 1); - cell = ckh_bucket_search(ckh, bucket, key); - return (cell); -} - -JEMALLOC_INLINE bool -ckh_try_bucket_insert(ckh_t *ckh, size_t bucket, const void *key, - const void *data) -{ - ckhc_t *cell; - unsigned offset, i; - - /* - * Cycle through the cells in the bucket, starting at a random position. - * The randomness avoids worst-case search overhead as buckets fill up. - */ - prn32(offset, LG_CKH_BUCKET_CELLS, ckh->prn_state, CKH_A, CKH_C); - for (i = 0; i < (ZU(1) << LG_CKH_BUCKET_CELLS); i++) { - cell = &ckh->tab[(bucket << LG_CKH_BUCKET_CELLS) + - ((i + offset) & ((ZU(1) << LG_CKH_BUCKET_CELLS) - 1))]; - if (cell->key == NULL) { - cell->key = key; - cell->data = data; - ckh->count++; - return (false); - } - } - - return (true); -} - -/* - * No space is available in bucket. Randomly evict an item, then try to find an - * alternate location for that item. Iteratively repeat this - * eviction/relocation procedure until either success or detection of an - * eviction/relocation bucket cycle. - */ -JEMALLOC_INLINE bool -ckh_evict_reloc_insert(ckh_t *ckh, size_t argbucket, void const **argkey, - void const **argdata) -{ - const void *key, *data, *tkey, *tdata; - ckhc_t *cell; - size_t hash1, hash2, bucket, tbucket; - unsigned i; - - bucket = argbucket; - key = *argkey; - data = *argdata; - while (true) { - /* - * Choose a random item within the bucket to evict. This is - * critical to correct function, because without (eventually) - * evicting all items within a bucket during iteration, it - * would be possible to get stuck in an infinite loop if there - * were an item for which both hashes indicated the same - * bucket. - */ - prn32(i, LG_CKH_BUCKET_CELLS, ckh->prn_state, CKH_A, CKH_C); - cell = &ckh->tab[(bucket << LG_CKH_BUCKET_CELLS) + i]; - assert(cell->key != NULL); - - /* Swap cell->{key,data} and {key,data} (evict). */ - tkey = cell->key; tdata = cell->data; - cell->key = key; cell->data = data; - key = tkey; data = tdata; - -#ifdef CKH_COUNT - ckh->nrelocs++; -#endif - - /* Find the alternate bucket for the evicted item. */ - ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2); - tbucket = hash2 & ((ZU(1) << ckh->lg_curbuckets) - 1); - if (tbucket == bucket) { - tbucket = hash1 & ((ZU(1) << ckh->lg_curbuckets) - 1); - /* - * It may be that (tbucket == bucket) still, if the - * item's hashes both indicate this bucket. However, - * we are guaranteed to eventually escape this bucket - * during iteration, assuming pseudo-random item - * selection (true randomness would make infinite - * looping a remote possibility). The reason we can - * never get trapped forever is that there are two - * cases: - * - * 1) This bucket == argbucket, so we will quickly - * detect an eviction cycle and terminate. - * 2) An item was evicted to this bucket from another, - * which means that at least one item in this bucket - * has hashes that indicate distinct buckets. - */ - } - /* Check for a cycle. */ - if (tbucket == argbucket) { - *argkey = key; - *argdata = data; - return (true); - } - - bucket = tbucket; - if (ckh_try_bucket_insert(ckh, bucket, key, data) == false) - return (false); - } -} - -JEMALLOC_INLINE bool -ckh_try_insert(ckh_t *ckh, void const**argkey, void const**argdata) -{ - size_t hash1, hash2, bucket; - const void *key = *argkey; - const void *data = *argdata; - - ckh->hash(key, ckh->lg_curbuckets, &hash1, &hash2); - - /* Try to insert in primary bucket. */ - bucket = hash1 & ((ZU(1) << ckh->lg_curbuckets) - 1); - if (ckh_try_bucket_insert(ckh, bucket, key, data) == false) - return (false); - - /* Try to insert in secondary bucket. */ - bucket = hash2 & ((ZU(1) << ckh->lg_curbuckets) - 1); - if (ckh_try_bucket_insert(ckh, bucket, key, data) == false) - return (false); - - /* - * Try to find a place for this item via iterative eviction/relocation. - */ - return (ckh_evict_reloc_insert(ckh, bucket, argkey, argdata)); -} - -/* - * Try to rebuild the hash table from scratch by inserting all items from the - * old table into the new. - */ -JEMALLOC_INLINE bool -ckh_rebuild(ckh_t *ckh, ckhc_t *aTab) -{ - size_t count, i, nins; - const void *key, *data; - - count = ckh->count; - ckh->count = 0; - for (i = nins = 0; nins < count; i++) { - if (aTab[i].key != NULL) { - key = aTab[i].key; - data = aTab[i].data; - if (ckh_try_insert(ckh, &key, &data)) { - ckh->count = count; - return (true); - } - nins++; - } - } - - return (false); -} - -static bool -ckh_grow(ckh_t *ckh) -{ - bool ret; - ckhc_t *tab, *ttab; - size_t lg_curcells; - unsigned lg_prevbuckets; - -#ifdef CKH_COUNT - ckh->ngrows++; -#endif - - /* - * It is possible (though unlikely, given well behaved hashes) that the - * table will have to be doubled more than once in order to create a - * usable table. - */ - lg_prevbuckets = ckh->lg_curbuckets; - lg_curcells = ckh->lg_curbuckets + LG_CKH_BUCKET_CELLS; - while (true) { - lg_curcells++; - tab = (ckhc_t *) ipalloc((ZU(1) << LG_CACHELINE), - sizeof(ckhc_t) << lg_curcells); - if (tab == NULL) { - ret = true; - goto RETURN; - } - memset(tab, 0, sizeof(ckhc_t) << lg_curcells); - /* Swap in new table. */ - ttab = ckh->tab; - ckh->tab = tab; - tab = ttab; - ckh->lg_curbuckets = lg_curcells - LG_CKH_BUCKET_CELLS; - - if (ckh_rebuild(ckh, tab) == false) { - idalloc(tab); - break; - } - - /* Rebuilding failed, so back out partially rebuilt table. */ - idalloc(ckh->tab); - ckh->tab = tab; - ckh->lg_curbuckets = lg_prevbuckets; - } - - ret = false; -RETURN: - return (ret); -} - -static void -ckh_shrink(ckh_t *ckh) -{ - ckhc_t *tab, *ttab; - size_t lg_curcells; - unsigned lg_prevbuckets; - - /* - * It is possible (though unlikely, given well behaved hashes) that the - * table rebuild will fail. - */ - lg_prevbuckets = ckh->lg_curbuckets; - lg_curcells = ckh->lg_curbuckets + LG_CKH_BUCKET_CELLS - 1; - tab = (ckhc_t *)ipalloc((ZU(1) << LG_CACHELINE), - sizeof(ckhc_t) << lg_curcells); - if (tab == NULL) { - /* - * An OOM error isn't worth propagating, since it doesn't - * prevent this or future operations from proceeding. - */ - return; - } - memset(tab, 0, sizeof(ckhc_t) << lg_curcells); - /* Swap in new table. */ - ttab = ckh->tab; - ckh->tab = tab; - tab = ttab; - ckh->lg_curbuckets = lg_curcells - LG_CKH_BUCKET_CELLS; - - if (ckh_rebuild(ckh, tab) == false) { - idalloc(tab); -#ifdef CKH_COUNT - ckh->nshrinks++; -#endif - return; - } - - /* Rebuilding failed, so back out partially rebuilt table. */ - idalloc(ckh->tab); - ckh->tab = tab; - ckh->lg_curbuckets = lg_prevbuckets; -#ifdef CKH_COUNT - ckh->nshrinkfails++; -#endif -} - -bool -ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, ckh_keycomp_t *keycomp) -{ - bool ret; - size_t mincells; - unsigned lg_mincells; - - assert(minitems > 0); - assert(hash != NULL); - assert(keycomp != NULL); - -#ifdef CKH_COUNT - ckh->ngrows = 0; - ckh->nshrinks = 0; - ckh->nshrinkfails = 0; - ckh->ninserts = 0; - ckh->nrelocs = 0; -#endif - ckh->prn_state = 42; /* Value doesn't really matter. */ - ckh->count = 0; - - /* - * Find the minimum power of 2 that is large enough to fit aBaseCount - * entries. We are using (2+,2) cuckoo hashing, which has an expected - * maximum load factor of at least ~0.86, so 0.75 is a conservative load - * factor that will typically allow 2^aLgMinItems to fit without ever - * growing the table. - */ - assert(LG_CKH_BUCKET_CELLS > 0); - mincells = ((minitems + (3 - (minitems % 3))) / 3) << 2; - for (lg_mincells = LG_CKH_BUCKET_CELLS; - (ZU(1) << lg_mincells) < mincells; - lg_mincells++) - ; /* Do nothing. */ - ckh->lg_minbuckets = lg_mincells - LG_CKH_BUCKET_CELLS; - ckh->lg_curbuckets = lg_mincells - LG_CKH_BUCKET_CELLS; - ckh->hash = hash; - ckh->keycomp = keycomp; - - ckh->tab = (ckhc_t *)ipalloc((ZU(1) << LG_CACHELINE), - sizeof(ckhc_t) << lg_mincells); - if (ckh->tab == NULL) { - ret = true; - goto RETURN; - } - memset(ckh->tab, 0, sizeof(ckhc_t) << lg_mincells); - -#ifdef JEMALLOC_DEBUG - ckh->magic = CKH_MAGIG; -#endif - - ret = false; -RETURN: - return (ret); -} - -void -ckh_delete(ckh_t *ckh) -{ - - assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); - -#ifdef CKH_VERBOSE - malloc_printf( - "%s(%p): ngrows: %"PRIu64", nshrinks: %"PRIu64"," - " nshrinkfails: %"PRIu64", ninserts: %"PRIu64"," - " nrelocs: %"PRIu64"\n", __func__, ckh, - (unsigned long long)ckh->ngrows, - (unsigned long long)ckh->nshrinks, - (unsigned long long)ckh->nshrinkfails, - (unsigned long long)ckh->ninserts, - (unsigned long long)ckh->nrelocs); -#endif - - idalloc(ckh->tab); -#ifdef JEMALLOC_DEBUG - memset(ckh, 0x5a, sizeof(ckh_t)); -#endif -} - -size_t -ckh_count(ckh_t *ckh) -{ - - assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); - - return (ckh->count); -} - -bool -ckh_iter(ckh_t *ckh, size_t *tabind, void **key, void **data) -{ - size_t i, ncells; - - for (i = *tabind, ncells = (ZU(1) << (ckh->lg_curbuckets + - LG_CKH_BUCKET_CELLS)); i < ncells; i++) { - if (ckh->tab[i].key != NULL) { - if (key != NULL) - *key = (void *)ckh->tab[i].key; - if (data != NULL) - *data = (void *)ckh->tab[i].data; - *tabind = i + 1; - return (false); - } - } - - return (true); -} - -bool -ckh_insert(ckh_t *ckh, const void *key, const void *data) -{ - bool ret; - - assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); - assert(ckh_search(ckh, key, NULL, NULL)); - -#ifdef CKH_COUNT - ckh->ninserts++; -#endif - - while (ckh_try_insert(ckh, &key, &data)) { - if (ckh_grow(ckh)) { - ret = true; - goto RETURN; - } - } - - ret = false; -RETURN: - return (ret); -} - -bool -ckh_remove(ckh_t *ckh, const void *searchkey, void **key, void **data) -{ - size_t cell; - - assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); - - cell = ckh_isearch(ckh, searchkey); - if (cell != SIZE_T_MAX) { - if (key != NULL) - *key = (void *)ckh->tab[cell].key; - if (data != NULL) - *data = (void *)ckh->tab[cell].data; - ckh->tab[cell].key = NULL; - ckh->tab[cell].data = NULL; /* Not necessary. */ - - ckh->count--; - /* Try to halve the table if it is less than 1/4 full. */ - if (ckh->count < (ZU(1) << (ckh->lg_curbuckets - + LG_CKH_BUCKET_CELLS - 2)) && ckh->lg_curbuckets - > ckh->lg_minbuckets) { - /* Ignore error due to OOM. */ - ckh_shrink(ckh); - } - - return (false); - } - - return (true); -} - -bool -ckh_search(ckh_t *ckh, const void *searchkey, void **key, void **data) -{ - size_t cell; - - assert(ckh != NULL); - assert(ckh->magic = CKH_MAGIG); - - cell = ckh_isearch(ckh, searchkey); - if (cell != SIZE_T_MAX) { - if (key != NULL) - *key = (void *)ckh->tab[cell].key; - if (data != NULL) - *data = (void *)ckh->tab[cell].data; - return (false); - } - - return (true); -} - -void -ckh_string_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2) -{ - size_t ret1, ret2; - uint64_t h; - - assert(minbits <= 32 || (SIZEOF_PTR == 8 && minbits <= 64)); - assert(hash1 != NULL); - assert(hash2 != NULL); - - h = hash(key, strlen((const char *)key), 0x94122f335b332aeaLLU); - if (minbits <= 32) { - /* - * Avoid doing multiple hashes, since a single hash provides - * enough bits. - */ - ret1 = h & ZU(0xffffffffU); - ret2 = h >> 32; - } else { - ret1 = h; - ret2 = hash(key, strlen((const char *)key), - 0x8432a476666bbc13U); - } - - *hash1 = ret1; - *hash2 = ret2; -} - -bool -ckh_string_keycomp(const void *k1, const void *k2) -{ - - assert(k1 != NULL); - assert(k2 != NULL); - - return (strcmp((char *)k1, (char *)k2) ? false : true); -} - -void -ckh_pointer_hash(const void *key, unsigned minbits, size_t *hash1, - size_t *hash2) -{ - size_t ret1, ret2; - uint64_t h; - - assert(minbits <= 32 || (SIZEOF_PTR == 8 && minbits <= 64)); - assert(hash1 != NULL); - assert(hash2 != NULL); - - h = hash(&key, sizeof(void *), 0xd983396e68886082LLU); - if (minbits <= 32) { - /* - * Avoid doing multiple hashes, since a single hash provides - * enough bits. - */ - ret1 = h & ZU(0xffffffffU); - ret2 = h >> 32; - } else { - assert(SIZEOF_PTR == 8); - ret1 = h; - ret2 = hash(&key, sizeof(void *), 0x5e2be9aff8709a5dLLU); - } - - *hash1 = ret1; - *hash2 = ret2; -} - -bool -ckh_pointer_keycomp(const void *k1, const void *k2) -{ - - return ((k1 == k2) ? true : false); -} diff --git a/dep/src/jmalloc/ctl.c b/dep/src/jmalloc/ctl.c deleted file mode 100644 index ffb732d5bef..00000000000 --- a/dep/src/jmalloc/ctl.c +++ /dev/null @@ -1,1482 +0,0 @@ -#define JEMALLOC_CTL_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -static malloc_mutex_t ctl_mtx; -static bool ctl_initialized; -static uint64_t ctl_epoch; -static ctl_stats_t ctl_stats; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -#define CTL_PROTO(n) \ -static int n##_ctl(const size_t *mib, size_t miblen, void *oldp, \ - size_t *oldlenp, void *newp, size_t newlen); - -#define INDEX_PROTO(n) \ -const ctl_node_t *n##_index(const size_t *mib, size_t miblen, \ - size_t i); - -#ifdef JEMALLOC_STATS -static bool ctl_arena_init(ctl_arena_stats_t *astats); -#endif -static void ctl_arena_clear(ctl_arena_stats_t *astats); -#ifdef JEMALLOC_STATS -static void ctl_arena_stats_amerge(ctl_arena_stats_t *cstats, - arena_t *arena); -static void ctl_arena_stats_smerge(ctl_arena_stats_t *sstats, - ctl_arena_stats_t *astats); -#endif -static void ctl_arena_refresh(arena_t *arena, unsigned i); -static void ctl_refresh(void); -static bool ctl_init(void); -static int ctl_lookup(const char *name, ctl_node_t const **nodesp, - size_t *mibp, size_t *depthp); - -CTL_PROTO(version) -CTL_PROTO(epoch) -#ifdef JEMALLOC_TCACHE -CTL_PROTO(tcache_flush) -#endif -CTL_PROTO(config_debug) -CTL_PROTO(config_dss) -CTL_PROTO(config_dynamic_page_shift) -CTL_PROTO(config_fill) -CTL_PROTO(config_lazy_lock) -CTL_PROTO(config_prof) -CTL_PROTO(config_prof_libgcc) -CTL_PROTO(config_prof_libunwind) -CTL_PROTO(config_stats) -CTL_PROTO(config_swap) -CTL_PROTO(config_sysv) -CTL_PROTO(config_tcache) -CTL_PROTO(config_tiny) -CTL_PROTO(config_tls) -CTL_PROTO(config_xmalloc) -CTL_PROTO(opt_abort) -#ifdef JEMALLOC_FILL -CTL_PROTO(opt_junk) -#endif -#ifdef JEMALLOC_SYSV -CTL_PROTO(opt_sysv) -#endif -#ifdef JEMALLOC_XMALLOC -CTL_PROTO(opt_xmalloc) -#endif -#ifdef JEMALLOC_ZERO -CTL_PROTO(opt_zero) -#endif -#ifdef JEMALLOC_TCACHE -CTL_PROTO(opt_tcache) -CTL_PROTO(opt_lg_tcache_gc_sweep) -#endif -#ifdef JEMALLOC_PROF -CTL_PROTO(opt_prof) -CTL_PROTO(opt_prof_active) -CTL_PROTO(opt_lg_prof_bt_max) -CTL_PROTO(opt_lg_prof_sample) -CTL_PROTO(opt_lg_prof_interval) -CTL_PROTO(opt_prof_udump) -CTL_PROTO(opt_prof_leak) -#endif -CTL_PROTO(opt_stats_print) -CTL_PROTO(opt_lg_qspace_max) -CTL_PROTO(opt_lg_cspace_max) -CTL_PROTO(opt_lg_dirty_mult) -CTL_PROTO(opt_lg_chunk) -#ifdef JEMALLOC_SWAP -CTL_PROTO(opt_overcommit) -#endif -CTL_PROTO(arenas_bin_i_size) -CTL_PROTO(arenas_bin_i_nregs) -CTL_PROTO(arenas_bin_i_run_size) -INDEX_PROTO(arenas_bin_i) -CTL_PROTO(arenas_lrun_i_size) -INDEX_PROTO(arenas_lrun_i) -CTL_PROTO(arenas_narenas) -CTL_PROTO(arenas_initialized) -CTL_PROTO(arenas_quantum) -CTL_PROTO(arenas_cacheline) -CTL_PROTO(arenas_subpage) -CTL_PROTO(arenas_pagesize) -CTL_PROTO(arenas_chunksize) -#ifdef JEMALLOC_TINY -CTL_PROTO(arenas_tspace_min) -CTL_PROTO(arenas_tspace_max) -#endif -CTL_PROTO(arenas_qspace_min) -CTL_PROTO(arenas_qspace_max) -CTL_PROTO(arenas_cspace_min) -CTL_PROTO(arenas_cspace_max) -CTL_PROTO(arenas_sspace_min) -CTL_PROTO(arenas_sspace_max) -#ifdef JEMALLOC_TCACHE -CTL_PROTO(arenas_tcache_max) -#endif -CTL_PROTO(arenas_ntbins) -CTL_PROTO(arenas_nqbins) -CTL_PROTO(arenas_ncbins) -CTL_PROTO(arenas_nsbins) -CTL_PROTO(arenas_nbins) -#ifdef JEMALLOC_TCACHE -CTL_PROTO(arenas_nhbins) -#endif -CTL_PROTO(arenas_nlruns) -#ifdef JEMALLOC_PROF -CTL_PROTO(prof_active) -CTL_PROTO(prof_dump) -CTL_PROTO(prof_interval) -#endif -#ifdef JEMALLOC_STATS -CTL_PROTO(stats_chunks_current) -CTL_PROTO(stats_chunks_total) -CTL_PROTO(stats_chunks_high) -CTL_PROTO(stats_huge_allocated) -CTL_PROTO(stats_huge_nmalloc) -CTL_PROTO(stats_huge_ndalloc) -CTL_PROTO(stats_arenas_i_small_allocated) -CTL_PROTO(stats_arenas_i_small_nmalloc) -CTL_PROTO(stats_arenas_i_small_ndalloc) -CTL_PROTO(stats_arenas_i_small_nrequests) -CTL_PROTO(stats_arenas_i_large_allocated) -CTL_PROTO(stats_arenas_i_large_nmalloc) -CTL_PROTO(stats_arenas_i_large_ndalloc) -CTL_PROTO(stats_arenas_i_large_nrequests) -CTL_PROTO(stats_arenas_i_bins_j_allocated) -CTL_PROTO(stats_arenas_i_bins_j_nmalloc) -CTL_PROTO(stats_arenas_i_bins_j_ndalloc) -CTL_PROTO(stats_arenas_i_bins_j_nrequests) -#ifdef JEMALLOC_TCACHE -CTL_PROTO(stats_arenas_i_bins_j_nfills) -CTL_PROTO(stats_arenas_i_bins_j_nflushes) -#endif -CTL_PROTO(stats_arenas_i_bins_j_nruns) -CTL_PROTO(stats_arenas_i_bins_j_nreruns) -CTL_PROTO(stats_arenas_i_bins_j_highruns) -CTL_PROTO(stats_arenas_i_bins_j_curruns) -INDEX_PROTO(stats_arenas_i_bins_j) -CTL_PROTO(stats_arenas_i_lruns_j_nmalloc) -CTL_PROTO(stats_arenas_i_lruns_j_ndalloc) -CTL_PROTO(stats_arenas_i_lruns_j_nrequests) -CTL_PROTO(stats_arenas_i_lruns_j_highruns) -CTL_PROTO(stats_arenas_i_lruns_j_curruns) -INDEX_PROTO(stats_arenas_i_lruns_j) -#endif -CTL_PROTO(stats_arenas_i_pactive) -CTL_PROTO(stats_arenas_i_pdirty) -#ifdef JEMALLOC_STATS -CTL_PROTO(stats_arenas_i_mapped) -CTL_PROTO(stats_arenas_i_npurge) -CTL_PROTO(stats_arenas_i_nmadvise) -CTL_PROTO(stats_arenas_i_purged) -#endif -INDEX_PROTO(stats_arenas_i) -#ifdef JEMALLOC_STATS -CTL_PROTO(stats_allocated) -CTL_PROTO(stats_active) -CTL_PROTO(stats_mapped) -#endif -#ifdef JEMALLOC_SWAP -# ifdef JEMALLOC_STATS -CTL_PROTO(swap_avail) -# endif -CTL_PROTO(swap_prezeroed) -CTL_PROTO(swap_nfds) -CTL_PROTO(swap_fds) -#endif - -/******************************************************************************/ -/* mallctl tree. */ - -/* Maximum tree depth. */ -#define CTL_MAX_DEPTH 6 - -#define NAME(n) true, {.named = {n -#define CHILD(c) sizeof(c##_node) / sizeof(ctl_node_t), c##_node}}, NULL -#define CTL(c) 0, NULL}}, c##_ctl - -/* - * Only handles internal indexed nodes, since there are currently no external - * ones. - */ -#define INDEX(i) false, {.indexed = {i##_index}}, NULL - -#ifdef JEMALLOC_TCACHE -static const ctl_node_t tcache_node[] = { - {NAME("flush"), CTL(tcache_flush)} -}; -#endif - -static const ctl_node_t config_node[] = { - {NAME("debug"), CTL(config_debug)}, - {NAME("dss"), CTL(config_dss)}, - {NAME("dynamic_page_shift"), CTL(config_dynamic_page_shift)}, - {NAME("fill"), CTL(config_fill)}, - {NAME("lazy_lock"), CTL(config_lazy_lock)}, - {NAME("prof"), CTL(config_prof)}, - {NAME("prof_libgcc"), CTL(config_prof_libgcc)}, - {NAME("prof_libunwind"), CTL(config_prof_libunwind)}, - {NAME("stats"), CTL(config_stats)}, - {NAME("swap"), CTL(config_swap)}, - {NAME("sysv"), CTL(config_sysv)}, - {NAME("tcache"), CTL(config_tcache)}, - {NAME("tiny"), CTL(config_tiny)}, - {NAME("tls"), CTL(config_tls)}, - {NAME("xmalloc"), CTL(config_xmalloc)} -}; - -static const ctl_node_t opt_node[] = { - {NAME("abort"), CTL(opt_abort)}, -#ifdef JEMALLOC_FILL - {NAME("junk"), CTL(opt_junk)}, -#endif -#ifdef JEMALLOC_SYSV - {NAME("sysv"), CTL(opt_sysv)}, -#endif -#ifdef JEMALLOC_XMALLOC - {NAME("xmalloc"), CTL(opt_xmalloc)}, -#endif -#ifdef JEMALLOC_ZERO - {NAME("zero"), CTL(opt_zero)}, -#endif -#ifdef JEMALLOC_TCACHE - {NAME("tcache"), CTL(opt_tcache)}, - {NAME("lg_tcache_gc_sweep"), CTL(opt_lg_tcache_gc_sweep)}, -#endif -#ifdef JEMALLOC_PROF - {NAME("prof"), CTL(opt_prof)}, - {NAME("prof_active"), CTL(opt_prof_active)}, - {NAME("lg_prof_bt_max"), CTL(opt_lg_prof_bt_max)}, - {NAME("lg_prof_sample"), CTL(opt_lg_prof_sample)}, - {NAME("lg_prof_interval"), CTL(opt_lg_prof_interval)}, - {NAME("prof_udump"), CTL(opt_prof_udump)}, - {NAME("prof_leak"), CTL(opt_prof_leak)}, -#endif - {NAME("stats_print"), CTL(opt_stats_print)}, - {NAME("lg_qspace_max"), CTL(opt_lg_qspace_max)}, - {NAME("lg_cspace_max"), CTL(opt_lg_cspace_max)}, - {NAME("lg_dirty_mult"), CTL(opt_lg_dirty_mult)}, - {NAME("lg_chunk"), CTL(opt_lg_chunk)} -#ifdef JEMALLOC_SWAP - , - {NAME("overcommit"), CTL(opt_overcommit)} -#endif -}; - -static const ctl_node_t arenas_bin_i_node[] = { - {NAME("size"), CTL(arenas_bin_i_size)}, - {NAME("nregs"), CTL(arenas_bin_i_nregs)}, - {NAME("run_size"), CTL(arenas_bin_i_run_size)} -}; -static const ctl_node_t super_arenas_bin_i_node[] = { - {NAME(""), CHILD(arenas_bin_i)} -}; - -static const ctl_node_t arenas_bin_node[] = { - {INDEX(arenas_bin_i)} -}; - -static const ctl_node_t arenas_lrun_i_node[] = { - {NAME("size"), CTL(arenas_lrun_i_size)} -}; -static const ctl_node_t super_arenas_lrun_i_node[] = { - {NAME(""), CHILD(arenas_lrun_i)} -}; - -static const ctl_node_t arenas_lrun_node[] = { - {INDEX(arenas_lrun_i)} -}; - -static const ctl_node_t arenas_node[] = { - {NAME("narenas"), CTL(arenas_narenas)}, - {NAME("initialized"), CTL(arenas_initialized)}, - {NAME("quantum"), CTL(arenas_quantum)}, - {NAME("cacheline"), CTL(arenas_cacheline)}, - {NAME("subpage"), CTL(arenas_subpage)}, - {NAME("pagesize"), CTL(arenas_pagesize)}, - {NAME("chunksize"), CTL(arenas_chunksize)}, -#ifdef JEMALLOC_TINY - {NAME("tspace_min"), CTL(arenas_tspace_min)}, - {NAME("tspace_max"), CTL(arenas_tspace_max)}, -#endif - {NAME("qspace_min"), CTL(arenas_qspace_min)}, - {NAME("qspace_max"), CTL(arenas_qspace_max)}, - {NAME("cspace_min"), CTL(arenas_cspace_min)}, - {NAME("cspace_max"), CTL(arenas_cspace_max)}, - {NAME("sspace_min"), CTL(arenas_sspace_min)}, - {NAME("sspace_max"), CTL(arenas_sspace_max)}, -#ifdef JEMALLOC_TCACHE - {NAME("tcache_max"), CTL(arenas_tcache_max)}, -#endif - {NAME("ntbins"), CTL(arenas_ntbins)}, - {NAME("nqbins"), CTL(arenas_nqbins)}, - {NAME("ncbins"), CTL(arenas_ncbins)}, - {NAME("nsbins"), CTL(arenas_nsbins)}, - {NAME("nbins"), CTL(arenas_nbins)}, -#ifdef JEMALLOC_TCACHE - {NAME("nhbins"), CTL(arenas_nhbins)}, -#endif - {NAME("bin"), CHILD(arenas_bin)}, - {NAME("nlruns"), CTL(arenas_nlruns)}, - {NAME("lrun"), CHILD(arenas_lrun)} -}; - -#ifdef JEMALLOC_PROF -static const ctl_node_t prof_node[] = { - {NAME("active"), CTL(prof_active)}, - {NAME("dump"), CTL(prof_dump)}, - {NAME("interval"), CTL(prof_interval)} -}; -#endif - -#ifdef JEMALLOC_STATS -static const ctl_node_t stats_chunks_node[] = { - {NAME("current"), CTL(stats_chunks_current)}, - {NAME("total"), CTL(stats_chunks_total)}, - {NAME("high"), CTL(stats_chunks_high)} -}; - -static const ctl_node_t stats_huge_node[] = { - {NAME("allocated"), CTL(stats_huge_allocated)}, - {NAME("nmalloc"), CTL(stats_huge_nmalloc)}, - {NAME("ndalloc"), CTL(stats_huge_ndalloc)} -}; - -static const ctl_node_t stats_arenas_i_small_node[] = { - {NAME("allocated"), CTL(stats_arenas_i_small_allocated)}, - {NAME("nmalloc"), CTL(stats_arenas_i_small_nmalloc)}, - {NAME("ndalloc"), CTL(stats_arenas_i_small_ndalloc)}, - {NAME("nrequests"), CTL(stats_arenas_i_small_nrequests)} -}; - -static const ctl_node_t stats_arenas_i_large_node[] = { - {NAME("allocated"), CTL(stats_arenas_i_large_allocated)}, - {NAME("nmalloc"), CTL(stats_arenas_i_large_nmalloc)}, - {NAME("ndalloc"), CTL(stats_arenas_i_large_ndalloc)}, - {NAME("nrequests"), CTL(stats_arenas_i_large_nrequests)} -}; - -static const ctl_node_t stats_arenas_i_bins_j_node[] = { - {NAME("allocated"), CTL(stats_arenas_i_bins_j_allocated)}, - {NAME("nmalloc"), CTL(stats_arenas_i_bins_j_nmalloc)}, - {NAME("ndalloc"), CTL(stats_arenas_i_bins_j_ndalloc)}, - {NAME("nrequests"), CTL(stats_arenas_i_bins_j_nrequests)}, -#ifdef JEMALLOC_TCACHE - {NAME("nfills"), CTL(stats_arenas_i_bins_j_nfills)}, - {NAME("nflushes"), CTL(stats_arenas_i_bins_j_nflushes)}, -#endif - {NAME("nruns"), CTL(stats_arenas_i_bins_j_nruns)}, - {NAME("nreruns"), CTL(stats_arenas_i_bins_j_nreruns)}, - {NAME("highruns"), CTL(stats_arenas_i_bins_j_highruns)}, - {NAME("curruns"), CTL(stats_arenas_i_bins_j_curruns)} -}; -static const ctl_node_t super_stats_arenas_i_bins_j_node[] = { - {NAME(""), CHILD(stats_arenas_i_bins_j)} -}; - -static const ctl_node_t stats_arenas_i_bins_node[] = { - {INDEX(stats_arenas_i_bins_j)} -}; - -static const ctl_node_t stats_arenas_i_lruns_j_node[] = { - {NAME("nmalloc"), CTL(stats_arenas_i_lruns_j_nmalloc)}, - {NAME("ndalloc"), CTL(stats_arenas_i_lruns_j_ndalloc)}, - {NAME("nrequests"), CTL(stats_arenas_i_lruns_j_nrequests)}, - {NAME("highruns"), CTL(stats_arenas_i_lruns_j_highruns)}, - {NAME("curruns"), CTL(stats_arenas_i_lruns_j_curruns)} -}; -static const ctl_node_t super_stats_arenas_i_lruns_j_node[] = { - {NAME(""), CHILD(stats_arenas_i_lruns_j)} -}; - -static const ctl_node_t stats_arenas_i_lruns_node[] = { - {INDEX(stats_arenas_i_lruns_j)} -}; -#endif - -static const ctl_node_t stats_arenas_i_node[] = { - {NAME("pactive"), CTL(stats_arenas_i_pactive)}, - {NAME("pdirty"), CTL(stats_arenas_i_pdirty)} -#ifdef JEMALLOC_STATS - , - {NAME("mapped"), CTL(stats_arenas_i_mapped)}, - {NAME("npurge"), CTL(stats_arenas_i_npurge)}, - {NAME("nmadvise"), CTL(stats_arenas_i_nmadvise)}, - {NAME("purged"), CTL(stats_arenas_i_purged)}, - {NAME("small"), CHILD(stats_arenas_i_small)}, - {NAME("large"), CHILD(stats_arenas_i_large)}, - {NAME("bins"), CHILD(stats_arenas_i_bins)}, - {NAME("lruns"), CHILD(stats_arenas_i_lruns)} -#endif -}; -static const ctl_node_t super_stats_arenas_i_node[] = { - {NAME(""), CHILD(stats_arenas_i)} -}; - -static const ctl_node_t stats_arenas_node[] = { - {INDEX(stats_arenas_i)} -}; - -static const ctl_node_t stats_node[] = { -#ifdef JEMALLOC_STATS - {NAME("allocated"), CTL(stats_allocated)}, - {NAME("active"), CTL(stats_active)}, - {NAME("mapped"), CTL(stats_mapped)}, - {NAME("chunks"), CHILD(stats_chunks)}, - {NAME("huge"), CHILD(stats_huge)}, -#endif - {NAME("arenas"), CHILD(stats_arenas)} -}; - -#ifdef JEMALLOC_SWAP -static const ctl_node_t swap_node[] = { -# ifdef JEMALLOC_STATS - {NAME("avail"), CTL(swap_avail)}, -# endif - {NAME("prezeroed"), CTL(swap_prezeroed)}, - {NAME("nfds"), CTL(swap_nfds)}, - {NAME("fds"), CTL(swap_fds)} -}; -#endif - -static const ctl_node_t root_node[] = { - {NAME("version"), CTL(version)}, - {NAME("epoch"), CTL(epoch)}, -#ifdef JEMALLOC_TCACHE - {NAME("tcache"), CHILD(tcache)}, -#endif - {NAME("config"), CHILD(config)}, - {NAME("opt"), CHILD(opt)}, - {NAME("arenas"), CHILD(arenas)}, -#ifdef JEMALLOC_PROF - {NAME("prof"), CHILD(prof)}, -#endif - {NAME("stats"), CHILD(stats)} -#ifdef JEMALLOC_SWAP - , - {NAME("swap"), CHILD(swap)} -#endif -}; -static const ctl_node_t super_root_node[] = { - {NAME(""), CHILD(root)} -}; - -#undef NAME -#undef CHILD -#undef CTL -#undef INDEX - -/******************************************************************************/ - -#ifdef JEMALLOC_STATS -static bool -ctl_arena_init(ctl_arena_stats_t *astats) -{ - - if (astats->bstats == NULL) { - astats->bstats = (malloc_bin_stats_t *)base_alloc(nbins * - sizeof(malloc_bin_stats_t)); - if (astats->bstats == NULL) - return (true); - } - if (astats->lstats == NULL) { - astats->lstats = (malloc_large_stats_t *)base_alloc(nlclasses * - sizeof(malloc_large_stats_t)); - if (astats->lstats == NULL) - return (true); - } - - return (false); -} -#endif - -static void -ctl_arena_clear(ctl_arena_stats_t *astats) -{ - - astats->pactive = 0; - astats->pdirty = 0; -#ifdef JEMALLOC_STATS - memset(&astats->astats, 0, sizeof(arena_stats_t)); - astats->allocated_small = 0; - astats->nmalloc_small = 0; - astats->ndalloc_small = 0; - astats->nrequests_small = 0; - memset(astats->bstats, 0, nbins * sizeof(malloc_bin_stats_t)); - memset(astats->lstats, 0, nlclasses * sizeof(malloc_large_stats_t)); -#endif -} - -#ifdef JEMALLOC_STATS -static void -ctl_arena_stats_amerge(ctl_arena_stats_t *cstats, arena_t *arena) -{ - unsigned i; - - arena_stats_merge(arena, &cstats->pactive, &cstats->pdirty, - &cstats->astats, cstats->bstats, cstats->lstats); - - for (i = 0; i < nbins; i++) { - cstats->allocated_small += cstats->bstats[i].allocated; - cstats->nmalloc_small += cstats->bstats[i].nmalloc; - cstats->ndalloc_small += cstats->bstats[i].ndalloc; - cstats->nrequests_small += cstats->bstats[i].nrequests; - } -} - -static void -ctl_arena_stats_smerge(ctl_arena_stats_t *sstats, ctl_arena_stats_t *astats) -{ - unsigned i; - - sstats->pactive += astats->pactive; - sstats->pdirty += astats->pdirty; - - sstats->astats.mapped += astats->astats.mapped; - sstats->astats.npurge += astats->astats.npurge; - sstats->astats.nmadvise += astats->astats.nmadvise; - sstats->astats.purged += astats->astats.purged; - - sstats->allocated_small += astats->allocated_small; - sstats->nmalloc_small += astats->nmalloc_small; - sstats->ndalloc_small += astats->ndalloc_small; - sstats->nrequests_small += astats->nrequests_small; - - sstats->astats.allocated_large += astats->astats.allocated_large; - sstats->astats.nmalloc_large += astats->astats.nmalloc_large; - sstats->astats.ndalloc_large += astats->astats.ndalloc_large; - sstats->astats.nrequests_large += astats->astats.nrequests_large; - - for (i = 0; i < nlclasses; i++) { - sstats->lstats[i].nmalloc += astats->lstats[i].nmalloc; - sstats->lstats[i].ndalloc += astats->lstats[i].ndalloc; - sstats->lstats[i].nrequests += astats->lstats[i].nrequests; - sstats->lstats[i].highruns += astats->lstats[i].highruns; - sstats->lstats[i].curruns += astats->lstats[i].curruns; - } - - for (i = 0; i < nbins; i++) { - sstats->bstats[i].allocated += astats->bstats[i].allocated; - sstats->bstats[i].nmalloc += astats->bstats[i].nmalloc; - sstats->bstats[i].ndalloc += astats->bstats[i].ndalloc; - sstats->bstats[i].nrequests += astats->bstats[i].nrequests; -#ifdef JEMALLOC_TCACHE - sstats->bstats[i].nfills += astats->bstats[i].nfills; - sstats->bstats[i].nflushes += astats->bstats[i].nflushes; -#endif - sstats->bstats[i].nruns += astats->bstats[i].nruns; - sstats->bstats[i].reruns += astats->bstats[i].reruns; - sstats->bstats[i].highruns += astats->bstats[i].highruns; - sstats->bstats[i].curruns += astats->bstats[i].curruns; - } -} -#endif - -static void -ctl_arena_refresh(arena_t *arena, unsigned i) -{ - ctl_arena_stats_t *astats = &ctl_stats.arenas[i]; - ctl_arena_stats_t *sstats = &ctl_stats.arenas[narenas]; - - ctl_arena_clear(astats); - -#ifdef JEMALLOC_STATS - ctl_arena_stats_amerge(astats, arena); - /* Merge into sum stats as well. */ - ctl_arena_stats_smerge(sstats, astats); -#else - astats->pactive += arena->nactive; - astats->pdirty += arena->ndirty; - /* Merge into sum stats as well. */ - sstats->pactive += arena->nactive; - sstats->pdirty += arena->ndirty; -#endif -} - -static void -ctl_refresh(void) -{ - unsigned i; - arena_t *tarenas[narenas]; - -#ifdef JEMALLOC_STATS - malloc_mutex_lock(&chunks_mtx); - ctl_stats.chunks.current = stats_chunks.curchunks; - ctl_stats.chunks.total = stats_chunks.nchunks; - ctl_stats.chunks.high = stats_chunks.highchunks; - malloc_mutex_unlock(&chunks_mtx); - - malloc_mutex_lock(&huge_mtx); - ctl_stats.huge.allocated = huge_allocated; - ctl_stats.huge.nmalloc = huge_nmalloc; - ctl_stats.huge.ndalloc = huge_ndalloc; - malloc_mutex_unlock(&huge_mtx); -#endif - - /* - * Clear sum stats, since they will be merged into by - * ctl_arena_refresh(). - */ - ctl_arena_clear(&ctl_stats.arenas[narenas]); - - malloc_mutex_lock(&arenas_lock); - memcpy(tarenas, arenas, sizeof(arena_t *) * narenas); - malloc_mutex_unlock(&arenas_lock); - for (i = 0; i < narenas; i++) { - bool initialized = (tarenas[i] != NULL); - - ctl_stats.arenas[i].initialized = initialized; - if (initialized) - ctl_arena_refresh(tarenas[i], i); - } - -#ifdef JEMALLOC_STATS - ctl_stats.allocated = ctl_stats.arenas[narenas].allocated_small - + ctl_stats.arenas[narenas].astats.allocated_large - + ctl_stats.huge.allocated; - ctl_stats.active = (ctl_stats.arenas[narenas].pactive << PAGE_SHIFT) - + ctl_stats.huge.allocated; - ctl_stats.mapped = (ctl_stats.chunks.current << opt_lg_chunk); - -# ifdef JEMALLOC_SWAP - malloc_mutex_lock(&swap_mtx); - ctl_stats.swap_avail = swap_avail; - malloc_mutex_unlock(&swap_mtx); -# endif -#endif - - ctl_epoch++; -} - -static bool -ctl_init(void) -{ - - if (ctl_initialized == false) { -#ifdef JEMALLOC_STATS - unsigned i; -#endif - - /* - * Allocate space for one extra arena stats element, which - * contains summed stats across all arenas. - */ - ctl_stats.arenas = (ctl_arena_stats_t *)base_alloc( - (narenas + 1) * sizeof(ctl_arena_stats_t)); - if (ctl_stats.arenas == NULL) - return (true); - memset(ctl_stats.arenas, 0, (narenas + 1) * - sizeof(ctl_arena_stats_t)); - - /* - * Initialize all stats structures, regardless of whether they - * ever get used. Lazy initialization would allow errors to - * cause inconsistent state to be viewable by the application. - */ -#ifdef JEMALLOC_STATS - for (i = 0; i <= narenas; i++) { - if (ctl_arena_init(&ctl_stats.arenas[i])) - return (true); - } -#endif - ctl_stats.arenas[narenas].initialized = true; - - ctl_epoch = 0; - ctl_refresh(); - ctl_initialized = true; - } - - return (false); -} - -static int -ctl_lookup(const char *name, ctl_node_t const **nodesp, size_t *mibp, - size_t *depthp) -{ - int ret; - const char *elm, *tdot, *dot; - size_t elen, i, j; - const ctl_node_t *node; - - elm = name; - /* Equivalent to strchrnul(). */ - dot = ((tdot = strchr(elm, '.')) != NULL) ? tdot : strchr(elm, '\0'); - elen = (size_t)((uintptr_t)dot - (uintptr_t)elm); - if (elen == 0) { - ret = ENOENT; - goto RETURN; - } - node = super_root_node; - for (i = 0; i < *depthp; i++) { - assert(node->named); - assert(node->u.named.nchildren > 0); - if (node->u.named.children[0].named) { - const ctl_node_t *pnode = node; - - /* Children are named. */ - for (j = 0; j < node->u.named.nchildren; j++) { - const ctl_node_t *child = - &node->u.named.children[j]; - if (strlen(child->u.named.name) == elen - && strncmp(elm, child->u.named.name, - elen) == 0) { - node = child; - if (nodesp != NULL) - nodesp[i] = node; - mibp[i] = j; - break; - } - } - if (node == pnode) { - ret = ENOENT; - goto RETURN; - } - } else { - unsigned long index; - const ctl_node_t *inode; - - /* Children are indexed. */ - index = strtoul(elm, NULL, 10); - if (index == ULONG_MAX) { - ret = ENOENT; - goto RETURN; - } - - inode = &node->u.named.children[0]; - node = inode->u.indexed.index(mibp, *depthp, - index); - if (node == NULL) { - ret = ENOENT; - goto RETURN; - } - - if (nodesp != NULL) - nodesp[i] = node; - mibp[i] = (size_t)index; - } - - if (node->ctl != NULL) { - /* Terminal node. */ - if (*dot != '\0') { - /* - * The name contains more elements than are - * in this path through the tree. - */ - ret = ENOENT; - goto RETURN; - } - /* Complete lookup successful. */ - *depthp = i + 1; - break; - } - - /* Update elm. */ - if (*dot == '\0') { - /* No more elements. */ - ret = ENOENT; - goto RETURN; - } - elm = &dot[1]; - dot = ((tdot = strchr(elm, '.')) != NULL) ? tdot : - strchr(elm, '\0'); - elen = (size_t)((uintptr_t)dot - (uintptr_t)elm); - } - - ret = 0; -RETURN: - return (ret); -} - -int -ctl_byname(const char *name, void *oldp, size_t *oldlenp, void *newp, - size_t newlen) -{ - int ret; - size_t depth; - ctl_node_t const *nodes[CTL_MAX_DEPTH]; - size_t mib[CTL_MAX_DEPTH]; - - malloc_mutex_lock(&ctl_mtx); - if (ctl_init()) { - ret = EAGAIN; - goto RETURN; - } - - depth = CTL_MAX_DEPTH; - ret = ctl_lookup(name, nodes, mib, &depth); - if (ret != 0) - goto RETURN; - - if (nodes[depth-1]->ctl == NULL) { - /* The name refers to a partial path through the ctl tree. */ - ret = ENOENT; - goto RETURN; - } - ret = nodes[depth-1]->ctl(mib, depth, oldp, oldlenp, newp, newlen); - -RETURN: - malloc_mutex_unlock(&ctl_mtx); - return(ret); -} - -int -ctl_nametomib(const char *name, size_t *mibp, size_t *miblenp) -{ - int ret; - - malloc_mutex_lock(&ctl_mtx); - if (ctl_init()) { - ret = EAGAIN; - goto RETURN; - } - - ret = ctl_lookup(name, NULL, mibp, miblenp); - -RETURN: - malloc_mutex_unlock(&ctl_mtx); - return(ret); -} - -int -ctl_bymib(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int ret; - const ctl_node_t *node; - size_t i; - - malloc_mutex_lock(&ctl_mtx); - if (ctl_init()) { - ret = EAGAIN; - goto RETURN; - } - - /* Iterate down the tree. */ - node = super_root_node; - for (i = 0; i < miblen; i++) { - if (node->u.named.children[0].named) { - /* Children are named. */ - if (node->u.named.nchildren <= mib[i]) { - ret = ENOENT; - goto RETURN; - } - node = &node->u.named.children[mib[i]]; - } else { - const ctl_node_t *inode; - - /* Indexed element. */ - inode = &node->u.named.children[0]; - node = inode->u.indexed.index(mib, miblen, mib[i]); - if (node == NULL) { - ret = ENOENT; - goto RETURN; - } - } - } - - /* Call the ctl function. */ - if (node->ctl == NULL) { - /* Partial MIB. */ - ret = ENOENT; - goto RETURN; - } - ret = node->ctl(mib, miblen, oldp, oldlenp, newp, newlen); - -RETURN: - malloc_mutex_unlock(&ctl_mtx); - return(ret); -} - -bool -ctl_boot(void) -{ - - if (malloc_mutex_init(&ctl_mtx)) - return (true); - - ctl_initialized = false; - - return (false); -} - -/******************************************************************************/ -/* *_ctl() functions. */ - -#define READONLY() do { \ - if (newp != NULL || newlen != 0) { \ - ret = EPERM; \ - goto RETURN; \ - } \ -} while (0) - -#define WRITEONLY() do { \ - if (oldp != NULL || oldlenp != NULL) { \ - ret = EPERM; \ - goto RETURN; \ - } \ -} while (0) - -#define VOID() do { \ - READONLY(); \ - WRITEONLY(); \ -} while (0) - -#define READ(v, t) do { \ - if (oldp != NULL && oldlenp != NULL) { \ - if (*oldlenp != sizeof(t)) { \ - size_t copylen = (sizeof(t) <= *oldlenp) \ - ? sizeof(t) : *oldlenp; \ - memcpy(oldp, (void *)&v, copylen); \ - ret = EINVAL; \ - goto RETURN; \ - } else \ - *(t *)oldp = v; \ - } \ -} while (0) - -#define WRITE(v, t) do { \ - if (newp != NULL) { \ - if (newlen != sizeof(t)) { \ - ret = EINVAL; \ - goto RETURN; \ - } \ - v = *(t *)newp; \ - } \ -} while (0) - -#define CTL_RO_GEN(n, v, t) \ -static int \ -n##_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, \ - void *newp, size_t newlen) \ -{ \ - int ret; \ - t oldval; \ - \ - READONLY(); \ - oldval = v; \ - READ(oldval, t); \ - \ - ret = 0; \ -RETURN: \ - return (ret); \ -} - -#define CTL_RO_TRUE_GEN(n) \ -static int \ -n##_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, \ - void *newp, size_t newlen) \ -{ \ - int ret; \ - bool oldval; \ - \ - READONLY(); \ - oldval = true; \ - READ(oldval, bool); \ - \ - ret = 0; \ -RETURN: \ - return (ret); \ -} - -#define CTL_RO_FALSE_GEN(n) \ -static int \ -n##_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, \ - void *newp, size_t newlen) \ -{ \ - int ret; \ - bool oldval; \ - \ - READONLY(); \ - oldval = false; \ - READ(oldval, bool); \ - \ - ret = 0; \ -RETURN: \ - return (ret); \ -} - -CTL_RO_GEN(version, JEMALLOC_VERSION, const char *) - -static int -epoch_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int ret; - uint64_t newval; - - newval = 0; - WRITE(newval, uint64_t); - if (newval != 0) - ctl_refresh(); - READ(ctl_epoch, uint64_t); - - ret = 0; -RETURN: - return (ret); -} - -#ifdef JEMALLOC_TCACHE -static int -tcache_flush_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int ret; - tcache_t *tcache; - - VOID(); - - tcache = tcache_tls; - if (tcache == NULL) { - ret = 0; - goto RETURN; - } - tcache_destroy(tcache); - tcache_tls = NULL; - - ret = 0; -RETURN: - return (ret); -} -#endif - -/******************************************************************************/ - -#ifdef JEMALLOC_DEBUG -CTL_RO_TRUE_GEN(config_debug) -#else -CTL_RO_FALSE_GEN(config_debug) -#endif - -#ifdef JEMALLOC_DSS -CTL_RO_TRUE_GEN(config_dss) -#else -CTL_RO_FALSE_GEN(config_dss) -#endif - -#ifdef JEMALLOC_DYNAMIC_PAGE_SHIFT -CTL_RO_TRUE_GEN(config_dynamic_page_shift) -#else -CTL_RO_FALSE_GEN(config_dynamic_page_shift) -#endif - -#ifdef JEMALLOC_FILL -CTL_RO_TRUE_GEN(config_fill) -#else -CTL_RO_FALSE_GEN(config_fill) -#endif - -#ifdef JEMALLOC_LAZY_LOCK -CTL_RO_TRUE_GEN(config_lazy_lock) -#else -CTL_RO_FALSE_GEN(config_lazy_lock) -#endif - -#ifdef JEMALLOC_PROF -CTL_RO_TRUE_GEN(config_prof) -#else -CTL_RO_FALSE_GEN(config_prof) -#endif - -#ifdef JEMALLOC_PROF_LIBGCC -CTL_RO_TRUE_GEN(config_prof_libgcc) -#else -CTL_RO_FALSE_GEN(config_prof_libgcc) -#endif - -#ifdef JEMALLOC_PROF_LIBUNWIND -CTL_RO_TRUE_GEN(config_prof_libunwind) -#else -CTL_RO_FALSE_GEN(config_prof_libunwind) -#endif - -#ifdef JEMALLOC_STATS -CTL_RO_TRUE_GEN(config_stats) -#else -CTL_RO_FALSE_GEN(config_stats) -#endif - -#ifdef JEMALLOC_SWAP -CTL_RO_TRUE_GEN(config_swap) -#else -CTL_RO_FALSE_GEN(config_swap) -#endif - -#ifdef JEMALLOC_SYSV -CTL_RO_TRUE_GEN(config_sysv) -#else -CTL_RO_FALSE_GEN(config_sysv) -#endif - -#ifdef JEMALLOC_TCACHE -CTL_RO_TRUE_GEN(config_tcache) -#else -CTL_RO_FALSE_GEN(config_tcache) -#endif - -#ifdef JEMALLOC_TINY -CTL_RO_TRUE_GEN(config_tiny) -#else -CTL_RO_FALSE_GEN(config_tiny) -#endif - -#ifdef JEMALLOC_TLS -CTL_RO_TRUE_GEN(config_tls) -#else -CTL_RO_FALSE_GEN(config_tls) -#endif - -#ifdef JEMALLOC_XMALLOC -CTL_RO_TRUE_GEN(config_xmalloc) -#else -CTL_RO_FALSE_GEN(config_xmalloc) -#endif - -/******************************************************************************/ - -CTL_RO_GEN(opt_abort, opt_abort, bool) -#ifdef JEMALLOC_FILL -CTL_RO_GEN(opt_junk, opt_junk, bool) -#endif -#ifdef JEMALLOC_SYSV -CTL_RO_GEN(opt_sysv, opt_sysv, bool) -#endif -#ifdef JEMALLOC_XMALLOC -CTL_RO_GEN(opt_xmalloc, opt_xmalloc, bool) -#endif -#ifdef JEMALLOC_ZERO -CTL_RO_GEN(opt_zero, opt_zero, bool) -#endif -#ifdef JEMALLOC_TCACHE -CTL_RO_GEN(opt_tcache, opt_tcache, bool) -CTL_RO_GEN(opt_lg_tcache_gc_sweep, opt_lg_tcache_gc_sweep, ssize_t) -#endif -#ifdef JEMALLOC_PROF -CTL_RO_GEN(opt_prof, opt_prof, bool) -CTL_RO_GEN(opt_prof_active, opt_prof_active, bool) -CTL_RO_GEN(opt_lg_prof_bt_max, opt_lg_prof_bt_max, size_t) -CTL_RO_GEN(opt_lg_prof_sample, opt_lg_prof_sample, size_t) -CTL_RO_GEN(opt_lg_prof_interval, opt_lg_prof_interval, ssize_t) -CTL_RO_GEN(opt_prof_udump, opt_prof_udump, bool) -CTL_RO_GEN(opt_prof_leak, opt_prof_leak, bool) -#endif -CTL_RO_GEN(opt_stats_print, opt_stats_print, bool) -CTL_RO_GEN(opt_lg_qspace_max, opt_lg_qspace_max, size_t) -CTL_RO_GEN(opt_lg_cspace_max, opt_lg_cspace_max, size_t) -CTL_RO_GEN(opt_lg_dirty_mult, opt_lg_dirty_mult, ssize_t) -CTL_RO_GEN(opt_lg_chunk, opt_lg_chunk, size_t) -#ifdef JEMALLOC_SWAP -CTL_RO_GEN(opt_overcommit, opt_overcommit, bool) -#endif - -/******************************************************************************/ - -CTL_RO_GEN(arenas_bin_i_size, arenas[0]->bins[mib[2]].reg_size, size_t) -CTL_RO_GEN(arenas_bin_i_nregs, arenas[0]->bins[mib[2]].nregs, uint32_t) -CTL_RO_GEN(arenas_bin_i_run_size, arenas[0]->bins[mib[2]].run_size, size_t) -const ctl_node_t * -arenas_bin_i_index(const size_t *mib, size_t miblen, size_t i) -{ - - if (i > nbins) - return (NULL); - return (super_arenas_bin_i_node); -} - -CTL_RO_GEN(arenas_lrun_i_size, ((mib[2]+1) << PAGE_SHIFT), size_t) -const ctl_node_t * -arenas_lrun_i_index(const size_t *mib, size_t miblen, size_t i) -{ - - if (i > nlclasses) - return (NULL); - return (super_arenas_lrun_i_node); -} - -CTL_RO_GEN(arenas_narenas, narenas, unsigned) - -static int -arenas_initialized_ctl(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen) -{ - int ret; - unsigned nread, i; - - READONLY(); - if (*oldlenp != narenas * sizeof(bool)) { - ret = EINVAL; - nread = (*oldlenp < narenas * sizeof(bool)) - ? (*oldlenp / sizeof(bool)) : narenas; - } else { - ret = 0; - nread = narenas; - } - - for (i = 0; i < nread; i++) - ((bool *)oldp)[i] = ctl_stats.arenas[i].initialized; - -RETURN: - return (ret); -} - -CTL_RO_GEN(arenas_quantum, QUANTUM, size_t) -CTL_RO_GEN(arenas_cacheline, CACHELINE, size_t) -CTL_RO_GEN(arenas_subpage, SUBPAGE, size_t) -CTL_RO_GEN(arenas_pagesize, PAGE_SIZE, size_t) -CTL_RO_GEN(arenas_chunksize, chunksize, size_t) -#ifdef JEMALLOC_TINY -CTL_RO_GEN(arenas_tspace_min, (1U << LG_TINY_MIN), size_t) -CTL_RO_GEN(arenas_tspace_max, (qspace_min >> 1), size_t) -#endif -CTL_RO_GEN(arenas_qspace_min, qspace_min, size_t) -CTL_RO_GEN(arenas_qspace_max, qspace_max, size_t) -CTL_RO_GEN(arenas_cspace_min, cspace_min, size_t) -CTL_RO_GEN(arenas_cspace_max, cspace_max, size_t) -CTL_RO_GEN(arenas_sspace_min, sspace_min, size_t) -CTL_RO_GEN(arenas_sspace_max, sspace_max, size_t) -#ifdef JEMALLOC_TCACHE -CTL_RO_GEN(arenas_tcache_max, tcache_maxclass, size_t) -#endif -CTL_RO_GEN(arenas_ntbins, ntbins, unsigned) -CTL_RO_GEN(arenas_nqbins, nqbins, unsigned) -CTL_RO_GEN(arenas_ncbins, ncbins, unsigned) -CTL_RO_GEN(arenas_nsbins, nsbins, unsigned) -CTL_RO_GEN(arenas_nbins, nbins, unsigned) -#ifdef JEMALLOC_TCACHE -CTL_RO_GEN(arenas_nhbins, nhbins, unsigned) -#endif -CTL_RO_GEN(arenas_nlruns, nlclasses, size_t) - -/******************************************************************************/ - -#ifdef JEMALLOC_PROF -static int -prof_active_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int ret; - bool oldval; - - oldval = opt_prof_active; - if (newp != NULL) { - /* - * The memory barriers will tend to make opt_prof_active - * propagate faster on systems with weak memory ordering. - */ - mb_write(); - WRITE(opt_prof_active, bool); - mb_write(); - } - READ(oldval, bool); - - ret = 0; -RETURN: - return (ret); -} - -static int -prof_dump_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int ret; - const char *filename = NULL; - - WRITEONLY(); - WRITE(filename, const char *); - - if (prof_mdump(filename)) { - ret = EFAULT; - goto RETURN; - } - - ret = 0; -RETURN: - return (ret); -} - -CTL_RO_GEN(prof_interval, prof_interval, uint64_t) -#endif - -/******************************************************************************/ - -#ifdef JEMALLOC_STATS -CTL_RO_GEN(stats_chunks_current, ctl_stats.chunks.current, size_t) -CTL_RO_GEN(stats_chunks_total, ctl_stats.chunks.total, uint64_t) -CTL_RO_GEN(stats_chunks_high, ctl_stats.chunks.high, size_t) -CTL_RO_GEN(stats_huge_allocated, huge_allocated, size_t) -CTL_RO_GEN(stats_huge_nmalloc, huge_nmalloc, uint64_t) -CTL_RO_GEN(stats_huge_ndalloc, huge_ndalloc, uint64_t) -CTL_RO_GEN(stats_arenas_i_small_allocated, - ctl_stats.arenas[mib[2]].allocated_small, size_t) -CTL_RO_GEN(stats_arenas_i_small_nmalloc, - ctl_stats.arenas[mib[2]].nmalloc_small, uint64_t) -CTL_RO_GEN(stats_arenas_i_small_ndalloc, - ctl_stats.arenas[mib[2]].ndalloc_small, uint64_t) -CTL_RO_GEN(stats_arenas_i_small_nrequests, - ctl_stats.arenas[mib[2]].nrequests_small, uint64_t) -CTL_RO_GEN(stats_arenas_i_large_allocated, - ctl_stats.arenas[mib[2]].astats.allocated_large, size_t) -CTL_RO_GEN(stats_arenas_i_large_nmalloc, - ctl_stats.arenas[mib[2]].astats.nmalloc_large, uint64_t) -CTL_RO_GEN(stats_arenas_i_large_ndalloc, - ctl_stats.arenas[mib[2]].astats.ndalloc_large, uint64_t) -CTL_RO_GEN(stats_arenas_i_large_nrequests, - ctl_stats.arenas[mib[2]].astats.nrequests_large, uint64_t) - -CTL_RO_GEN(stats_arenas_i_bins_j_allocated, - ctl_stats.arenas[mib[2]].bstats[mib[4]].allocated, size_t) -CTL_RO_GEN(stats_arenas_i_bins_j_nmalloc, - ctl_stats.arenas[mib[2]].bstats[mib[4]].nmalloc, uint64_t) -CTL_RO_GEN(stats_arenas_i_bins_j_ndalloc, - ctl_stats.arenas[mib[2]].bstats[mib[4]].ndalloc, uint64_t) -CTL_RO_GEN(stats_arenas_i_bins_j_nrequests, - ctl_stats.arenas[mib[2]].bstats[mib[4]].nrequests, uint64_t) -#ifdef JEMALLOC_TCACHE -CTL_RO_GEN(stats_arenas_i_bins_j_nfills, - ctl_stats.arenas[mib[2]].bstats[mib[4]].nfills, uint64_t) -CTL_RO_GEN(stats_arenas_i_bins_j_nflushes, - ctl_stats.arenas[mib[2]].bstats[mib[4]].nflushes, uint64_t) -#endif -CTL_RO_GEN(stats_arenas_i_bins_j_nruns, - ctl_stats.arenas[mib[2]].bstats[mib[4]].nruns, uint64_t) -CTL_RO_GEN(stats_arenas_i_bins_j_nreruns, - ctl_stats.arenas[mib[2]].bstats[mib[4]].reruns, uint64_t) -CTL_RO_GEN(stats_arenas_i_bins_j_highruns, - ctl_stats.arenas[mib[2]].bstats[mib[4]].highruns, size_t) -CTL_RO_GEN(stats_arenas_i_bins_j_curruns, - ctl_stats.arenas[mib[2]].bstats[mib[4]].curruns, size_t) - -const ctl_node_t * -stats_arenas_i_bins_j_index(const size_t *mib, size_t miblen, size_t j) -{ - - if (j > nbins) - return (NULL); - return (super_stats_arenas_i_bins_j_node); -} - -CTL_RO_GEN(stats_arenas_i_lruns_j_nmalloc, - ctl_stats.arenas[mib[2]].lstats[mib[4]].nmalloc, uint64_t) -CTL_RO_GEN(stats_arenas_i_lruns_j_ndalloc, - ctl_stats.arenas[mib[2]].lstats[mib[4]].ndalloc, uint64_t) -CTL_RO_GEN(stats_arenas_i_lruns_j_nrequests, - ctl_stats.arenas[mib[2]].lstats[mib[4]].nrequests, uint64_t) -CTL_RO_GEN(stats_arenas_i_lruns_j_curruns, - ctl_stats.arenas[mib[2]].lstats[mib[4]].curruns, size_t) -CTL_RO_GEN(stats_arenas_i_lruns_j_highruns, - ctl_stats.arenas[mib[2]].lstats[mib[4]].highruns, size_t) - -const ctl_node_t * -stats_arenas_i_lruns_j_index(const size_t *mib, size_t miblen, size_t j) -{ - - if (j > nlclasses) - return (NULL); - return (super_stats_arenas_i_lruns_j_node); -} - -#endif -CTL_RO_GEN(stats_arenas_i_pactive, ctl_stats.arenas[mib[2]].pactive, size_t) -CTL_RO_GEN(stats_arenas_i_pdirty, ctl_stats.arenas[mib[2]].pdirty, size_t) -#ifdef JEMALLOC_STATS -CTL_RO_GEN(stats_arenas_i_mapped, ctl_stats.arenas[mib[2]].astats.mapped, - size_t) -CTL_RO_GEN(stats_arenas_i_npurge, ctl_stats.arenas[mib[2]].astats.npurge, - uint64_t) -CTL_RO_GEN(stats_arenas_i_nmadvise, ctl_stats.arenas[mib[2]].astats.nmadvise, - uint64_t) -CTL_RO_GEN(stats_arenas_i_purged, ctl_stats.arenas[mib[2]].astats.purged, - uint64_t) -#endif - -const ctl_node_t * -stats_arenas_i_index(const size_t *mib, size_t miblen, size_t i) -{ - - if (ctl_stats.arenas[i].initialized == false) - return (NULL); - return (super_stats_arenas_i_node); -} - -#ifdef JEMALLOC_STATS -CTL_RO_GEN(stats_allocated, ctl_stats.allocated, size_t) -CTL_RO_GEN(stats_active, ctl_stats.active, size_t) -CTL_RO_GEN(stats_mapped, ctl_stats.mapped, size_t) -#endif - -/******************************************************************************/ - -#ifdef JEMALLOC_SWAP -# ifdef JEMALLOC_STATS -CTL_RO_GEN(swap_avail, ctl_stats.swap_avail, size_t) -# endif - -static int -swap_prezeroed_ctl(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen) -{ - int ret; - - if (swap_enabled) { - READONLY(); - } else { - /* - * swap_prezeroed isn't actually used by the swap code until it - * is set during a successful chunk_swap_enabled() call. We - * use it here to store the value that we'll pass to - * chunk_swap_enable() in a swap.fds mallctl(). This is not - * very clean, but the obvious alternatives are even worse. - */ - WRITE(swap_prezeroed, bool); - } - - READ(swap_prezeroed, bool); - - ret = 0; -RETURN: - return (ret); -} - -CTL_RO_GEN(swap_nfds, swap_nfds, size_t) - -static int -swap_fds_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) -{ - int ret; - - if (swap_enabled) { - READONLY(); - } else if (newp != NULL) { - size_t nfds = newlen / sizeof(int); - - { - int fds[nfds]; - - memcpy(fds, newp, nfds * sizeof(int)); - if (chunk_swap_enable(fds, nfds, swap_prezeroed)) { - ret = EFAULT; - goto RETURN; - } - } - } - - if (oldp != NULL && oldlenp != NULL) { - if (*oldlenp != swap_nfds * sizeof(int)) { - size_t copylen = (swap_nfds * sizeof(int) <= *oldlenp) - ? swap_nfds * sizeof(int) : *oldlenp; - - memcpy(oldp, swap_fds, copylen); - ret = EINVAL; - goto RETURN; - } else - memcpy(oldp, swap_fds, *oldlenp); - } - - ret = 0; -RETURN: - return (ret); -} -#endif diff --git a/dep/src/jmalloc/extent.c b/dep/src/jmalloc/extent.c deleted file mode 100644 index 3c04d3aa5d1..00000000000 --- a/dep/src/jmalloc/extent.c +++ /dev/null @@ -1,41 +0,0 @@ -#define JEMALLOC_EXTENT_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ - -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) -static inline int -extent_szad_comp(extent_node_t *a, extent_node_t *b) -{ - int ret; - size_t a_size = a->size; - size_t b_size = b->size; - - ret = (a_size > b_size) - (a_size < b_size); - if (ret == 0) { - uintptr_t a_addr = (uintptr_t)a->addr; - uintptr_t b_addr = (uintptr_t)b->addr; - - ret = (a_addr > b_addr) - (a_addr < b_addr); - } - - return (ret); -} - -/* Generate red-black tree functions. */ -rb_gen(, extent_tree_szad_, extent_tree_t, extent_node_t, link_szad, - extent_szad_comp) -#endif - -static inline int -extent_ad_comp(extent_node_t *a, extent_node_t *b) -{ - uintptr_t a_addr = (uintptr_t)a->addr; - uintptr_t b_addr = (uintptr_t)b->addr; - - return ((a_addr > b_addr) - (a_addr < b_addr)); -} - -/* Generate red-black tree functions. */ -rb_gen(, extent_tree_ad_, extent_tree_t, extent_node_t, link_ad, - extent_ad_comp) diff --git a/dep/src/jmalloc/hash.c b/dep/src/jmalloc/hash.c deleted file mode 100644 index 6a13d7a03c0..00000000000 --- a/dep/src/jmalloc/hash.c +++ /dev/null @@ -1,2 +0,0 @@ -#define HASH_C_ -#include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/src/jmalloc/huge.c b/dep/src/jmalloc/huge.c deleted file mode 100644 index d35aa5cdd00..00000000000 --- a/dep/src/jmalloc/huge.c +++ /dev/null @@ -1,298 +0,0 @@ -#define JEMALLOC_HUGE_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -#ifdef JEMALLOC_STATS -uint64_t huge_nmalloc; -uint64_t huge_ndalloc; -size_t huge_allocated; -#endif - -malloc_mutex_t huge_mtx; - -/******************************************************************************/ - -/* Tree of chunks that are stand-alone huge allocations. */ -static extent_tree_t huge; - -void * -huge_malloc(size_t size, bool zero) -{ - void *ret; - size_t csize; - extent_node_t *node; - - /* Allocate one or more contiguous chunks for this request. */ - - csize = CHUNK_CEILING(size); - if (csize == 0) { - /* size is large enough to cause size_t wrap-around. */ - return (NULL); - } - - /* Allocate an extent node with which to track the chunk. */ - node = base_node_alloc(); - if (node == NULL) - return (NULL); - - ret = chunk_alloc(csize, &zero); - if (ret == NULL) { - base_node_dealloc(node); - return (NULL); - } - - /* Insert node into huge. */ - node->addr = ret; - node->size = csize; - - malloc_mutex_lock(&huge_mtx); - extent_tree_ad_insert(&huge, node); -#ifdef JEMALLOC_STATS - huge_nmalloc++; - huge_allocated += csize; -#endif - malloc_mutex_unlock(&huge_mtx); - -#ifdef JEMALLOC_FILL - if (zero == false) { - if (opt_junk) - memset(ret, 0xa5, csize); - else if (opt_zero) - memset(ret, 0, csize); - } -#endif - - return (ret); -} - -/* Only handles large allocations that require more than chunk alignment. */ -void * -huge_palloc(size_t alignment, size_t size) -{ - void *ret; - size_t alloc_size, chunk_size, offset; - extent_node_t *node; - bool zero; - - /* - * This allocation requires alignment that is even larger than chunk - * alignment. This means that huge_malloc() isn't good enough. - * - * Allocate almost twice as many chunks as are demanded by the size or - * alignment, in order to assure the alignment can be achieved, then - * unmap leading and trailing chunks. - */ - assert(alignment >= chunksize); - - chunk_size = CHUNK_CEILING(size); - - if (size >= alignment) - alloc_size = chunk_size + alignment - chunksize; - else - alloc_size = (alignment << 1) - chunksize; - - /* Allocate an extent node with which to track the chunk. */ - node = base_node_alloc(); - if (node == NULL) - return (NULL); - - zero = false; - ret = chunk_alloc(alloc_size, &zero); - if (ret == NULL) { - base_node_dealloc(node); - return (NULL); - } - - offset = (uintptr_t)ret & (alignment - 1); - assert((offset & chunksize_mask) == 0); - assert(offset < alloc_size); - if (offset == 0) { - /* Trim trailing space. */ - chunk_dealloc((void *)((uintptr_t)ret + chunk_size), alloc_size - - chunk_size); - } else { - size_t trailsize; - - /* Trim leading space. */ - chunk_dealloc(ret, alignment - offset); - - ret = (void *)((uintptr_t)ret + (alignment - offset)); - - trailsize = alloc_size - (alignment - offset) - chunk_size; - if (trailsize != 0) { - /* Trim trailing space. */ - assert(trailsize < alloc_size); - chunk_dealloc((void *)((uintptr_t)ret + chunk_size), - trailsize); - } - } - - /* Insert node into huge. */ - node->addr = ret; - node->size = chunk_size; - - malloc_mutex_lock(&huge_mtx); - extent_tree_ad_insert(&huge, node); -#ifdef JEMALLOC_STATS - huge_nmalloc++; - huge_allocated += chunk_size; -#endif - malloc_mutex_unlock(&huge_mtx); - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, chunk_size); - else if (opt_zero) - memset(ret, 0, chunk_size); -#endif - - return (ret); -} - -void * -huge_ralloc(void *ptr, size_t size, size_t oldsize) -{ - void *ret; - size_t copysize; - - /* Avoid moving the allocation if the size class would not change. */ - if (oldsize > arena_maxclass && - CHUNK_CEILING(size) == CHUNK_CEILING(oldsize)) { -#ifdef JEMALLOC_FILL - if (opt_junk && size < oldsize) { - memset((void *)((uintptr_t)ptr + size), 0x5a, oldsize - - size); - } else if (opt_zero && size > oldsize) { - memset((void *)((uintptr_t)ptr + oldsize), 0, size - - oldsize); - } -#endif - return (ptr); - } - - /* - * If we get here, then size and oldsize are different enough that we - * need to use a different size class. In that case, fall back to - * allocating new space and copying. - */ - ret = huge_malloc(size, false); - if (ret == NULL) - return (NULL); - - copysize = (size < oldsize) ? size : oldsize; - memcpy(ret, ptr, copysize); - idalloc(ptr); - return (ret); -} - -void -huge_dalloc(void *ptr) -{ - extent_node_t *node, key; - - malloc_mutex_lock(&huge_mtx); - - /* Extract from tree of huge allocations. */ - key.addr = ptr; - node = extent_tree_ad_search(&huge, &key); - assert(node != NULL); - assert(node->addr == ptr); - extent_tree_ad_remove(&huge, node); - -#ifdef JEMALLOC_STATS - huge_ndalloc++; - huge_allocated -= node->size; -#endif - - malloc_mutex_unlock(&huge_mtx); - - /* Unmap chunk. */ -#ifdef JEMALLOC_FILL -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) - if (opt_junk) - memset(node->addr, 0x5a, node->size); -#endif -#endif - chunk_dealloc(node->addr, node->size); - - base_node_dealloc(node); -} - -size_t -huge_salloc(const void *ptr) -{ - size_t ret; - extent_node_t *node, key; - - malloc_mutex_lock(&huge_mtx); - - /* Extract from tree of huge allocations. */ - key.addr = __DECONST(void *, ptr); - node = extent_tree_ad_search(&huge, &key); - assert(node != NULL); - - ret = node->size; - - malloc_mutex_unlock(&huge_mtx); - - return (ret); -} - -#ifdef JEMALLOC_PROF -prof_thr_cnt_t * -huge_prof_cnt_get(const void *ptr) -{ - prof_thr_cnt_t *ret; - extent_node_t *node, key; - - malloc_mutex_lock(&huge_mtx); - - /* Extract from tree of huge allocations. */ - key.addr = __DECONST(void *, ptr); - node = extent_tree_ad_search(&huge, &key); - assert(node != NULL); - - ret = node->prof_cnt; - - malloc_mutex_unlock(&huge_mtx); - - return (ret); -} - -void -huge_prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt) -{ - extent_node_t *node, key; - - malloc_mutex_lock(&huge_mtx); - - /* Extract from tree of huge allocations. */ - key.addr = __DECONST(void *, ptr); - node = extent_tree_ad_search(&huge, &key); - assert(node != NULL); - - node->prof_cnt = cnt; - - malloc_mutex_unlock(&huge_mtx); -} -#endif - -bool -huge_boot(void) -{ - - /* Initialize chunks data. */ - if (malloc_mutex_init(&huge_mtx)) - return (true); - extent_tree_ad_new(&huge); - -#ifdef JEMALLOC_STATS - huge_nmalloc = 0; - huge_ndalloc = 0; - huge_allocated = 0; -#endif - - return (false); -} diff --git a/dep/src/jmalloc/jemalloc.c b/dep/src/jmalloc/jemalloc.c deleted file mode 100644 index e01de0d5066..00000000000 --- a/dep/src/jmalloc/jemalloc.c +++ /dev/null @@ -1,1349 +0,0 @@ -/*- - * This allocator implementation is designed to provide scalable performance - * for multi-threaded programs on multi-processor systems. The following - * features are included for this purpose: - * - * + Multiple arenas are used if there are multiple CPUs, which reduces lock - * contention and cache sloshing. - * - * + Thread-specific caching is used if there are multiple threads, which - * reduces the amount of locking. - * - * + Cache line sharing between arenas is avoided for internal data - * structures. - * - * + Memory is managed in chunks and runs (chunks can be split into runs), - * rather than as individual pages. This provides a constant-time - * mechanism for associating allocations with particular arenas. - * - * Allocation requests are rounded up to the nearest size class, and no record - * of the original request size is maintained. Allocations are broken into - * categories according to size class. Assuming 1 MiB chunks, 4 KiB pages and - * a 16 byte quantum on a 32-bit system, the size classes in each category are - * as follows: - * - * |========================================| - * | Category | Subcategory | Size | - * |========================================| - * | Small | Tiny | 2 | - * | | | 4 | - * | | | 8 | - * | |------------------+----------| - * | | Quantum-spaced | 16 | - * | | | 32 | - * | | | 48 | - * | | | ... | - * | | | 96 | - * | | | 112 | - * | | | 128 | - * | |------------------+----------| - * | | Cacheline-spaced | 192 | - * | | | 256 | - * | | | 320 | - * | | | 384 | - * | | | 448 | - * | | | 512 | - * | |------------------+----------| - * | | Sub-page | 760 | - * | | | 1024 | - * | | | 1280 | - * | | | ... | - * | | | 3328 | - * | | | 3584 | - * | | | 3840 | - * |========================================| - * | Large | 4 KiB | - * | | 8 KiB | - * | | 12 KiB | - * | | ... | - * | | 1012 KiB | - * | | 1016 KiB | - * | | 1020 KiB | - * |========================================| - * | Huge | 1 MiB | - * | | 2 MiB | - * | | 3 MiB | - * | | ... | - * |========================================| - * - * Different mechanisms are used accoding to category: - * - * Small: Each size class is segregated into its own set of runs. Each run - * maintains a bitmap of which regions are free/allocated. - * - * Large : Each allocation is backed by a dedicated run. Metadata are stored - * in the associated arena chunk header maps. - * - * Huge : Each allocation is backed by a dedicated contiguous set of chunks. - * Metadata are stored in a separate red-black tree. - * - ******************************************************************************* - */ - -#define JEMALLOC_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -malloc_mutex_t arenas_lock; -arena_t **arenas; -unsigned narenas; -#ifndef NO_TLS -static unsigned next_arena; -#endif - -#ifndef NO_TLS -__thread arena_t *arenas_map JEMALLOC_ATTR(tls_model("initial-exec")); -#endif - -/* Set to true once the allocator has been initialized. */ -static bool malloc_initialized = false; - -/* Used to let the initializing thread recursively allocate. */ -static pthread_t malloc_initializer = (unsigned long)0; - -/* Used to avoid initialization races. */ -static malloc_mutex_t init_lock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; - -#ifdef DYNAMIC_PAGE_SHIFT -size_t pagesize; -size_t pagesize_mask; -size_t lg_pagesize; -#endif - -unsigned ncpus; - -/* Runtime configuration options. */ -const char *JEMALLOC_P(malloc_options) - JEMALLOC_ATTR(visibility("default")); -#ifdef JEMALLOC_DEBUG -bool opt_abort = true; -# ifdef JEMALLOC_FILL -bool opt_junk = true; -# endif -#else -bool opt_abort = false; -# ifdef JEMALLOC_FILL -bool opt_junk = false; -# endif -#endif -#ifdef JEMALLOC_SYSV -bool opt_sysv = false; -#endif -#ifdef JEMALLOC_XMALLOC -bool opt_xmalloc = false; -#endif -#ifdef JEMALLOC_FILL -bool opt_zero = false; -#endif -static int opt_narenas_lshift = 0; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static void wrtmessage(void *cbopaque, const char *s); -static void stats_print_atexit(void); -static unsigned malloc_ncpus(void); -static bool malloc_init_hard(void); -static void jemalloc_prefork(void); -static void jemalloc_postfork(void); - -/******************************************************************************/ -/* malloc_message() setup. */ - -#ifdef JEMALLOC_HAVE_ATTR -JEMALLOC_ATTR(visibility("hidden")) -#else -static -#endif -void -wrtmessage(void *cbopaque, const char *s) -{ - - write(STDERR_FILENO, s, strlen(s)); -} - -void (*JEMALLOC_P(malloc_message))(void *, const char *s) - JEMALLOC_ATTR(visibility("default")) = wrtmessage; - -/******************************************************************************/ -/* - * Begin miscellaneous support functions. - */ - -/* Create a new arena and insert it into the arenas array at index ind. */ -arena_t * -arenas_extend(unsigned ind) -{ - arena_t *ret; - - /* Allocate enough space for trailing bins. */ - ret = (arena_t *)base_alloc(sizeof(arena_t) - + (sizeof(arena_bin_t) * (nbins - 1))); - if (ret != NULL && arena_new(ret, ind) == false) { - arenas[ind] = ret; - return (ret); - } - /* Only reached if there is an OOM error. */ - - /* - * OOM here is quite inconvenient to propagate, since dealing with it - * would require a check for failure in the fast path. Instead, punt - * by using arenas[0]. In practice, this is an extremely unlikely - * failure. - */ - malloc_write(": Error initializing arena\n"); - if (opt_abort) - abort(); - - return (arenas[0]); -} - -#ifndef NO_TLS -/* - * Choose an arena based on a per-thread value (slow-path code only, called - * only by choose_arena()). - */ -arena_t * -choose_arena_hard(void) -{ - arena_t *ret; - - if (narenas > 1) { - malloc_mutex_lock(&arenas_lock); - if ((ret = arenas[next_arena]) == NULL) - ret = arenas_extend(next_arena); - next_arena = (next_arena + 1) % narenas; - malloc_mutex_unlock(&arenas_lock); - } else - ret = arenas[0]; - - arenas_map = ret; - - return (ret); -} -#endif - -static void -stats_print_atexit(void) -{ - -#if (defined(JEMALLOC_TCACHE) && defined(JEMALLOC_STATS)) - unsigned i; - - /* - * Merge stats from extant threads. This is racy, since individual - * threads do not lock when recording tcache stats events. As a - * consequence, the final stats may be slightly out of date by the time - * they are reported, if other threads continue to allocate. - */ - for (i = 0; i < narenas; i++) { - arena_t *arena = arenas[i]; - if (arena != NULL) { - tcache_t *tcache; - - /* - * tcache_stats_merge() locks bins, so if any code is - * introduced that acquires both arena and bin locks in - * the opposite order, deadlocks may result. - */ - malloc_mutex_lock(&arena->lock); - ql_foreach(tcache, &arena->tcache_ql, link) { - tcache_stats_merge(tcache, arena); - } - malloc_mutex_unlock(&arena->lock); - } - } -#endif - JEMALLOC_P(malloc_stats_print)(NULL, NULL, NULL); -} - -/* - * End miscellaneous support functions. - */ -/******************************************************************************/ -/* - * Begin initialization functions. - */ - -static unsigned -malloc_ncpus(void) -{ - unsigned ret; - long result; - - result = sysconf(_SC_NPROCESSORS_ONLN); - if (result == -1) { - /* Error. */ - ret = 1; - } - ret = (unsigned)result; - - return (ret); -} - -/* - * FreeBSD's pthreads implementation calls malloc(3), so the malloc - * implementation has to take pains to avoid infinite recursion during - * initialization. - */ -static inline bool -malloc_init(void) -{ - - if (malloc_initialized == false) - return (malloc_init_hard()); - - return (false); -} - -static bool -malloc_init_hard(void) -{ - unsigned i; - int linklen; - char buf[PATH_MAX + 1]; - const char *opts; - arena_t *init_arenas[1]; - - malloc_mutex_lock(&init_lock); - if (malloc_initialized || malloc_initializer == pthread_self()) { - /* - * Another thread initialized the allocator before this one - * acquired init_lock, or this thread is the initializing - * thread, and it is recursively allocating. - */ - malloc_mutex_unlock(&init_lock); - return (false); - } - if (malloc_initializer != (unsigned long)0) { - /* Busy-wait until the initializing thread completes. */ - do { - malloc_mutex_unlock(&init_lock); - CPU_SPINWAIT; - malloc_mutex_lock(&init_lock); - } while (malloc_initialized == false); - return (false); - } - -#ifdef DYNAMIC_PAGE_SHIFT - /* Get page size. */ - { - long result; - - result = sysconf(_SC_PAGESIZE); - assert(result != -1); - pagesize = (unsigned)result; - - /* - * We assume that pagesize is a power of 2 when calculating - * pagesize_mask and lg_pagesize. - */ - assert(((result - 1) & result) == 0); - pagesize_mask = result - 1; - lg_pagesize = ffs((int)result) - 1; - } -#endif - - for (i = 0; i < 3; i++) { - unsigned j; - - /* Get runtime configuration. */ - switch (i) { - case 0: - if ((linklen = readlink("/etc/jemalloc.conf", buf, - sizeof(buf) - 1)) != -1) { - /* - * Use the contents of the "/etc/jemalloc.conf" - * symbolic link's name. - */ - buf[linklen] = '\0'; - opts = buf; - } else { - /* No configuration specified. */ - buf[0] = '\0'; - opts = buf; - } - break; - case 1: - if ((opts = getenv("JEMALLOC_OPTIONS")) != NULL) { - /* - * Do nothing; opts is already initialized to - * the value of the JEMALLOC_OPTIONS - * environment variable. - */ - } else { - /* No configuration specified. */ - buf[0] = '\0'; - opts = buf; - } - break; - case 2: - if (JEMALLOC_P(malloc_options) != NULL) { - /* - * Use options that were compiled into the - * program. - */ - opts = JEMALLOC_P(malloc_options); - } else { - /* No configuration specified. */ - buf[0] = '\0'; - opts = buf; - } - break; - default: - /* NOTREACHED */ - assert(false); - buf[0] = '\0'; - opts = buf; - } - - for (j = 0; opts[j] != '\0'; j++) { - unsigned k, nreps; - bool nseen; - - /* Parse repetition count, if any. */ - for (nreps = 0, nseen = false;; j++, nseen = true) { - switch (opts[j]) { - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - nreps *= 10; - nreps += opts[j] - '0'; - break; - default: - goto MALLOC_OUT; - } - } -MALLOC_OUT: - if (nseen == false) - nreps = 1; - - for (k = 0; k < nreps; k++) { - switch (opts[j]) { - case 'a': - opt_abort = false; - break; - case 'A': - opt_abort = true; - break; -#ifdef JEMALLOC_PROF - case 'b': - if (opt_lg_prof_bt_max > 0) - opt_lg_prof_bt_max--; - break; - case 'B': - if (opt_lg_prof_bt_max < LG_PROF_BT_MAX) - opt_lg_prof_bt_max++; - break; -#endif - case 'c': - if (opt_lg_cspace_max - 1 > - opt_lg_qspace_max && - opt_lg_cspace_max > - LG_CACHELINE) - opt_lg_cspace_max--; - break; - case 'C': - if (opt_lg_cspace_max < PAGE_SHIFT - - 1) - opt_lg_cspace_max++; - break; - case 'd': - if (opt_lg_dirty_mult + 1 < - (sizeof(size_t) << 3)) - opt_lg_dirty_mult++; - break; - case 'D': - if (opt_lg_dirty_mult >= 0) - opt_lg_dirty_mult--; - break; -#ifdef JEMALLOC_PROF - case 'e': - opt_prof_active = false; - break; - case 'E': - opt_prof_active = true; - break; - case 'f': - opt_prof = false; - break; - case 'F': - opt_prof = true; - break; -#endif -#ifdef JEMALLOC_TCACHE - case 'g': - if (opt_lg_tcache_gc_sweep >= 0) - opt_lg_tcache_gc_sweep--; - break; - case 'G': - if (opt_lg_tcache_gc_sweep + 1 < - (sizeof(size_t) << 3)) - opt_lg_tcache_gc_sweep++; - break; - case 'h': - opt_tcache = false; - break; - case 'H': - opt_tcache = true; - break; -#endif -#ifdef JEMALLOC_PROF - case 'i': - if (opt_lg_prof_interval >= 0) - opt_lg_prof_interval--; - break; - case 'I': - if (opt_lg_prof_interval + 1 < - (sizeof(uint64_t) << 3)) - opt_lg_prof_interval++; - break; -#endif -#ifdef JEMALLOC_FILL - case 'j': - opt_junk = false; - break; - case 'J': - opt_junk = true; - break; -#endif - case 'k': - /* - * Chunks always require at least one - * header page, plus one data page. - */ - if ((1U << (opt_lg_chunk - 1)) >= - (2U << PAGE_SHIFT)) - opt_lg_chunk--; - break; - case 'K': - if (opt_lg_chunk + 1 < - (sizeof(size_t) << 3)) - opt_lg_chunk++; - break; -#ifdef JEMALLOC_PROF - case 'l': - opt_prof_leak = false; - break; - case 'L': - opt_prof_leak = true; - break; -#endif -#ifdef JEMALLOC_TCACHE - case 'm': - if (opt_lg_tcache_maxclass >= 0) - opt_lg_tcache_maxclass--; - break; - case 'M': - if (opt_lg_tcache_maxclass + 1 < - (sizeof(size_t) << 3)) - opt_lg_tcache_maxclass++; - break; -#endif - case 'n': - opt_narenas_lshift--; - break; - case 'N': - opt_narenas_lshift++; - break; -#ifdef JEMALLOC_SWAP - case 'o': - opt_overcommit = false; - break; - case 'O': - opt_overcommit = true; - break; -#endif - case 'p': - opt_stats_print = false; - break; - case 'P': - opt_stats_print = true; - break; - case 'q': - if (opt_lg_qspace_max > LG_QUANTUM) - opt_lg_qspace_max--; - break; - case 'Q': - if (opt_lg_qspace_max + 1 < - opt_lg_cspace_max) - opt_lg_qspace_max++; - break; -#ifdef JEMALLOC_PROF - case 's': - if (opt_lg_prof_sample > 0) - opt_lg_prof_sample--; - break; - case 'S': - if (opt_lg_prof_sample + 1 < - (sizeof(uint64_t) << 3)) - opt_lg_prof_sample++; - break; - case 'u': - opt_prof_udump = false; - break; - case 'U': - opt_prof_udump = true; - break; -#endif -#ifdef JEMALLOC_SYSV - case 'v': - opt_sysv = false; - break; - case 'V': - opt_sysv = true; - break; -#endif -#ifdef JEMALLOC_XMALLOC - case 'x': - opt_xmalloc = false; - break; - case 'X': - opt_xmalloc = true; - break; -#endif -#ifdef JEMALLOC_FILL - case 'z': - opt_zero = false; - break; - case 'Z': - opt_zero = true; - break; -#endif - default: { - char cbuf[2]; - - cbuf[0] = opts[j]; - cbuf[1] = '\0'; - malloc_write( - ": Unsupported character " - "in malloc options: '"); - malloc_write(cbuf); - malloc_write("'\n"); - } - } - } - } - } - - /* Register fork handlers. */ - if (pthread_atfork(jemalloc_prefork, jemalloc_postfork, - jemalloc_postfork) != 0) { - malloc_write(": Error in pthread_atfork()\n"); - if (opt_abort) - abort(); - } - - if (ctl_boot()) { - malloc_mutex_unlock(&init_lock); - return (true); - } - - if (opt_stats_print) { - /* Print statistics at exit. */ - if (atexit(stats_print_atexit) != 0) { - malloc_write(": Error in atexit()\n"); - if (opt_abort) - abort(); - } - } - - if (chunk_boot()) { - malloc_mutex_unlock(&init_lock); - return (true); - } - - if (base_boot()) { - malloc_mutex_unlock(&init_lock); - return (true); - } - -#ifdef JEMALLOC_PROF - prof_boot0(); -#endif - - if (arena_boot()) { - malloc_mutex_unlock(&init_lock); - return (true); - } - -#ifdef JEMALLOC_TCACHE - tcache_boot(); -#endif - - if (huge_boot()) { - malloc_mutex_unlock(&init_lock); - return (true); - } - - /* - * Create enough scaffolding to allow recursive allocation in - * malloc_ncpus(). - */ - narenas = 1; - arenas = init_arenas; - memset(arenas, 0, sizeof(arena_t *) * narenas); - - /* - * Initialize one arena here. The rest are lazily created in - * choose_arena_hard(). - */ - arenas_extend(0); - if (arenas[0] == NULL) { - malloc_mutex_unlock(&init_lock); - return (true); - } - -#ifndef NO_TLS - /* - * Assign the initial arena to the initial thread, in order to avoid - * spurious creation of an extra arena if the application switches to - * threaded mode. - */ - arenas_map = arenas[0]; -#endif - - malloc_mutex_init(&arenas_lock); - -#ifdef JEMALLOC_PROF - if (prof_boot1()) { - malloc_mutex_unlock(&init_lock); - return (true); - } -#endif - - /* Get number of CPUs. */ - malloc_initializer = pthread_self(); - malloc_mutex_unlock(&init_lock); - ncpus = malloc_ncpus(); - malloc_mutex_lock(&init_lock); - - if (ncpus > 1) { - /* - * For SMP systems, create more than one arena per CPU by - * default. - */ - opt_narenas_lshift += 2; - } - - /* Determine how many arenas to use. */ - narenas = ncpus; - if (opt_narenas_lshift > 0) { - if ((narenas << opt_narenas_lshift) > narenas) - narenas <<= opt_narenas_lshift; - /* - * Make sure not to exceed the limits of what base_alloc() can - * handle. - */ - if (narenas * sizeof(arena_t *) > chunksize) - narenas = chunksize / sizeof(arena_t *); - } else if (opt_narenas_lshift < 0) { - if ((narenas >> -opt_narenas_lshift) < narenas) - narenas >>= -opt_narenas_lshift; - /* Make sure there is at least one arena. */ - if (narenas == 0) - narenas = 1; - } - -#ifdef NO_TLS - if (narenas > 1) { - static const unsigned primes[] = {1, 3, 5, 7, 11, 13, 17, 19, - 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, - 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, - 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, - 223, 227, 229, 233, 239, 241, 251, 257, 263}; - unsigned nprimes, parenas; - - /* - * Pick a prime number of hash arenas that is more than narenas - * so that direct hashing of pthread_self() pointers tends to - * spread allocations evenly among the arenas. - */ - assert((narenas & 1) == 0); /* narenas must be even. */ - nprimes = (sizeof(primes) >> LG_SIZEOF_INT); - parenas = primes[nprimes - 1]; /* In case not enough primes. */ - for (i = 1; i < nprimes; i++) { - if (primes[i] > narenas) { - parenas = primes[i]; - break; - } - } - narenas = parenas; - } -#endif - -#ifndef NO_TLS - next_arena = 0; -#endif - - /* Allocate and initialize arenas. */ - arenas = (arena_t **)base_alloc(sizeof(arena_t *) * narenas); - if (arenas == NULL) { - malloc_mutex_unlock(&init_lock); - return (true); - } - /* - * Zero the array. In practice, this should always be pre-zeroed, - * since it was just mmap()ed, but let's be sure. - */ - memset(arenas, 0, sizeof(arena_t *) * narenas); - /* Copy the pointer to the one arena that was already initialized. */ - arenas[0] = init_arenas[0]; - - malloc_initialized = true; - malloc_mutex_unlock(&init_lock); - return (false); -} - -/* - * End initialization functions. - */ -/******************************************************************************/ -/* - * Begin malloc(3)-compatible functions. - */ - -JEMALLOC_ATTR(malloc) -JEMALLOC_ATTR(visibility("default")) -void * -JEMALLOC_P(malloc)(size_t size) -{ - void *ret; -#ifdef JEMALLOC_PROF - prof_thr_cnt_t *cnt; -#endif - - if (malloc_init()) { - ret = NULL; - goto OOM; - } - - if (size == 0) { -#ifdef JEMALLOC_SYSV - if (opt_sysv == false) -#endif - size = 1; -#ifdef JEMALLOC_SYSV - else { -# ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in malloc(): " - "invalid size 0\n"); - abort(); - } -# endif - ret = NULL; - goto RETURN; - } -#endif - } - -#ifdef JEMALLOC_PROF - if (opt_prof) { - if ((cnt = prof_alloc_prep(size)) == NULL) { - ret = NULL; - goto OOM; - } - if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && size <= - small_maxclass) { - ret = imalloc(small_maxclass+1); - if (ret != NULL) - arena_prof_promoted(ret, size); - } else - ret = imalloc(size); - } else -#endif - ret = imalloc(size); - -OOM: - if (ret == NULL) { -#ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in malloc(): " - "out of memory\n"); - abort(); - } -#endif - errno = ENOMEM; - } - -#ifdef JEMALLOC_SYSV -RETURN: -#endif -#ifdef JEMALLOC_PROF - if (opt_prof && ret != NULL) - prof_malloc(ret, cnt); -#endif - return (ret); -} - -JEMALLOC_ATTR(nonnull(1)) -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) -{ - int ret; - void *result; -#ifdef JEMALLOC_PROF - prof_thr_cnt_t *cnt; -#endif - - if (malloc_init()) - result = NULL; - else { - if (size == 0) { -#ifdef JEMALLOC_SYSV - if (opt_sysv == false) -#endif - size = 1; -#ifdef JEMALLOC_SYSV - else { -# ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in " - "posix_memalign(): invalid size " - "0\n"); - abort(); - } -# endif - result = NULL; - *memptr = NULL; - ret = 0; - goto RETURN; - } -#endif - } - - /* Make sure that alignment is a large enough power of 2. */ - if (((alignment - 1) & alignment) != 0 - || alignment < sizeof(void *)) { -#ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in " - "posix_memalign(): invalid alignment\n"); - abort(); - } -#endif - result = NULL; - ret = EINVAL; - goto RETURN; - } - -#ifdef JEMALLOC_PROF - if (opt_prof) { - if ((cnt = prof_alloc_prep(size)) == NULL) { - result = NULL; - ret = EINVAL; - } else { - if (prof_promote && (uintptr_t)cnt != - (uintptr_t)1U && size <= small_maxclass) { - result = ipalloc(alignment, - small_maxclass+1); - if (result != NULL) { - arena_prof_promoted(result, - size); - } - } else - result = ipalloc(alignment, size); - } - } else -#endif - result = ipalloc(alignment, size); - } - - if (result == NULL) { -#ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in posix_memalign(): " - "out of memory\n"); - abort(); - } -#endif - ret = ENOMEM; - goto RETURN; - } - - *memptr = result; - ret = 0; - -RETURN: -#ifdef JEMALLOC_PROF - if (opt_prof && result != NULL) - prof_malloc(result, cnt); -#endif - return (ret); -} - -JEMALLOC_ATTR(malloc) -JEMALLOC_ATTR(visibility("default")) -void * -JEMALLOC_P(calloc)(size_t num, size_t size) -{ - void *ret; - size_t num_size; -#ifdef JEMALLOC_PROF - prof_thr_cnt_t *cnt; -#endif - - if (malloc_init()) { - num_size = 0; - ret = NULL; - goto RETURN; - } - - num_size = num * size; - if (num_size == 0) { -#ifdef JEMALLOC_SYSV - if ((opt_sysv == false) && ((num == 0) || (size == 0))) -#endif - num_size = 1; -#ifdef JEMALLOC_SYSV - else { - ret = NULL; - goto RETURN; - } -#endif - /* - * Try to avoid division here. We know that it isn't possible to - * overflow during multiplication if neither operand uses any of the - * most significant half of the bits in a size_t. - */ - } else if (((num | size) & (SIZE_T_MAX << (sizeof(size_t) << 2))) - && (num_size / size != num)) { - /* size_t overflow. */ - ret = NULL; - goto RETURN; - } - -#ifdef JEMALLOC_PROF - if (opt_prof) { - if ((cnt = prof_alloc_prep(num_size)) == NULL) { - ret = NULL; - goto RETURN; - } - if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && num_size - <= small_maxclass) { - ret = icalloc(small_maxclass+1); - if (ret != NULL) - arena_prof_promoted(ret, num_size); - } else - ret = icalloc(num_size); - } else -#endif - ret = icalloc(num_size); - -RETURN: - if (ret == NULL) { -#ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in calloc(): out of " - "memory\n"); - abort(); - } -#endif - errno = ENOMEM; - } - -#ifdef JEMALLOC_PROF - if (opt_prof && ret != NULL) - prof_malloc(ret, cnt); -#endif - return (ret); -} - -JEMALLOC_ATTR(visibility("default")) -void * -JEMALLOC_P(realloc)(void *ptr, size_t size) -{ - void *ret; -#ifdef JEMALLOC_PROF - size_t old_size; - prof_thr_cnt_t *cnt, *old_cnt; -#endif - - if (size == 0) { -#ifdef JEMALLOC_SYSV - if (opt_sysv == false) -#endif - size = 1; -#ifdef JEMALLOC_SYSV - else { - if (ptr != NULL) { -#ifdef JEMALLOC_PROF - if (opt_prof) { - old_size = isalloc(ptr); - old_cnt = prof_cnt_get(ptr); - cnt = NULL; - } -#endif - idalloc(ptr); - } -#ifdef JEMALLOC_PROF - else if (opt_prof) { - old_size = 0; - old_cnt = NULL; - cnt = NULL; - } -#endif - ret = NULL; - goto RETURN; - } -#endif - } - - if (ptr != NULL) { - assert(malloc_initialized || malloc_initializer == - pthread_self()); - -#ifdef JEMALLOC_PROF - if (opt_prof) { - old_size = isalloc(ptr); - old_cnt = prof_cnt_get(ptr); - if ((cnt = prof_alloc_prep(size)) == NULL) { - ret = NULL; - goto OOM; - } - if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && - size <= small_maxclass) { - ret = iralloc(ptr, small_maxclass+1); - if (ret != NULL) - arena_prof_promoted(ret, size); - } else - ret = iralloc(ptr, size); - } else -#endif - ret = iralloc(ptr, size); - -#ifdef JEMALLOC_PROF -OOM: -#endif - if (ret == NULL) { -#ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in realloc(): " - "out of memory\n"); - abort(); - } -#endif - errno = ENOMEM; - } - } else { -#ifdef JEMALLOC_PROF - if (opt_prof) { - old_size = 0; - old_cnt = NULL; - } -#endif - if (malloc_init()) { -#ifdef JEMALLOC_PROF - if (opt_prof) - cnt = NULL; -#endif - ret = NULL; - } else { -#ifdef JEMALLOC_PROF - if (opt_prof) { - if ((cnt = prof_alloc_prep(size)) == NULL) - ret = NULL; - else { - if (prof_promote && (uintptr_t)cnt != - (uintptr_t)1U && size <= - small_maxclass) { - ret = imalloc(small_maxclass+1); - if (ret != NULL) { - arena_prof_promoted(ret, - size); - } - } else - ret = imalloc(size); - } - } else -#endif - ret = imalloc(size); - } - - if (ret == NULL) { -#ifdef JEMALLOC_XMALLOC - if (opt_xmalloc) { - malloc_write(": Error in realloc(): " - "out of memory\n"); - abort(); - } -#endif - errno = ENOMEM; - } - } - -#ifdef JEMALLOC_SYSV -RETURN: -#endif -#ifdef JEMALLOC_PROF - if (opt_prof) - prof_realloc(ret, cnt, ptr, old_size, old_cnt); -#endif - return (ret); -} - -JEMALLOC_ATTR(visibility("default")) -void -JEMALLOC_P(free)(void *ptr) -{ - - if (ptr != NULL) { - assert(malloc_initialized || malloc_initializer == - pthread_self()); - -#ifdef JEMALLOC_PROF - if (opt_prof) - prof_free(ptr); -#endif - idalloc(ptr); - } -} - -/* - * End malloc(3)-compatible functions. - */ -/******************************************************************************/ -/* - * Begin non-standard functions. - */ - -JEMALLOC_ATTR(visibility("default")) -size_t -JEMALLOC_P(malloc_usable_size)(const void *ptr) -{ - size_t ret; - - assert(ptr != NULL); - ret = isalloc(ptr); - - return (ret); -} - -#ifdef JEMALLOC_SWAP -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(malloc_swap_enable)(const int *fds, unsigned nfds, int prezeroed) -{ - - /* - * Make sure malloc is initialized, because we need page size, chunk - * size, etc. - */ - if (malloc_init()) - return (-1); - - return (chunk_swap_enable(fds, nfds, (prezeroed != 0)) ? -1 : 0); -} -#endif - -JEMALLOC_ATTR(visibility("default")) -void -JEMALLOC_P(malloc_stats_print)(void (*write_cb)(void *, const char *), - void *cbopaque, const char *opts) -{ - - stats_print(write_cb, cbopaque, opts); -} - -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(mallctl)(const char *name, void *oldp, size_t *oldlenp, void *newp, - size_t newlen) -{ - - if (malloc_init()) - return (EAGAIN); - - return (ctl_byname(name, oldp, oldlenp, newp, newlen)); -} - -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(mallctlnametomib)(const char *name, size_t *mibp, size_t *miblenp) -{ - - if (malloc_init()) - return (EAGAIN); - - return (ctl_nametomib(name, mibp, miblenp)); -} - -JEMALLOC_ATTR(visibility("default")) -int -JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen) -{ - - if (malloc_init()) - return (EAGAIN); - - return (ctl_bymib(mib, miblen, oldp, oldlenp, newp, newlen)); -} - -/* - * End non-standard functions. - */ -/******************************************************************************/ - -/* - * The following functions are used by threading libraries for protection of - * malloc during fork(). These functions are only called if the program is - * running in threaded mode, so there is no need to check whether the program - * is threaded here. - */ - -static void -jemalloc_prefork(void) -{ - unsigned i; - - /* Acquire all mutexes in a safe order. */ - - malloc_mutex_lock(&arenas_lock); - for (i = 0; i < narenas; i++) { - if (arenas[i] != NULL) - malloc_mutex_lock(&arenas[i]->lock); - } - - malloc_mutex_lock(&base_mtx); - - malloc_mutex_lock(&huge_mtx); - -#ifdef JEMALLOC_DSS - malloc_mutex_lock(&dss_mtx); -#endif - -#ifdef JEMALLOC_SWAP - malloc_mutex_lock(&swap_mtx); -#endif -} - -static void -jemalloc_postfork(void) -{ - unsigned i; - - /* Release all mutexes, now that fork() has completed. */ - -#ifdef JEMALLOC_SWAP - malloc_mutex_unlock(&swap_mtx); -#endif - -#ifdef JEMALLOC_DSS - malloc_mutex_unlock(&dss_mtx); -#endif - - malloc_mutex_unlock(&huge_mtx); - - malloc_mutex_unlock(&base_mtx); - - for (i = 0; i < narenas; i++) { - if (arenas[i] != NULL) - malloc_mutex_unlock(&arenas[i]->lock); - } - malloc_mutex_unlock(&arenas_lock); -} diff --git a/dep/src/jmalloc/mb.c b/dep/src/jmalloc/mb.c deleted file mode 100644 index 30a1a2e997a..00000000000 --- a/dep/src/jmalloc/mb.c +++ /dev/null @@ -1,2 +0,0 @@ -#define MB_C_ -#include "jemalloc/internal/jemalloc_internal.h" diff --git a/dep/src/jmalloc/mutex.c b/dep/src/jmalloc/mutex.c deleted file mode 100644 index 3b6081a4c4f..00000000000 --- a/dep/src/jmalloc/mutex.c +++ /dev/null @@ -1,70 +0,0 @@ -#define JEMALLOC_MUTEX_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -/******************************************************************************/ -/* Data. */ - -#ifdef JEMALLOC_LAZY_LOCK -bool isthreaded = false; -#endif - -#ifdef JEMALLOC_LAZY_LOCK -static void pthread_create_once(void); -#endif - -/******************************************************************************/ -/* - * We intercept pthread_create() calls in order to toggle isthreaded if the - * process goes multi-threaded. - */ - -#ifdef JEMALLOC_LAZY_LOCK -static int (*pthread_create_fptr)(pthread_t *__restrict, const pthread_attr_t *, - void *(*)(void *), void *__restrict); - -static void -pthread_create_once(void) -{ - - pthread_create_fptr = dlsym(RTLD_NEXT, "pthread_create"); - if (pthread_create_fptr == NULL) { - malloc_write(": Error in dlsym(RTLD_NEXT, " - "\"pthread_create\")\n"); - abort(); - } - - isthreaded = true; -} - -JEMALLOC_ATTR(visibility("default")) -int -pthread_create(pthread_t *__restrict thread, - const pthread_attr_t *__restrict attr, void *(*start_routine)(void *), - void *__restrict arg) -{ - static pthread_once_t once_control = PTHREAD_ONCE_INIT; - - pthread_once(&once_control, pthread_create_once); - - return (pthread_create_fptr(thread, attr, start_routine, arg)); -} -#endif - -/******************************************************************************/ - -bool -malloc_mutex_init(malloc_mutex_t *mutex) -{ - pthread_mutexattr_t attr; - - if (pthread_mutexattr_init(&attr) != 0) - return (true); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); - if (pthread_mutex_init(mutex, &attr) != 0) { - pthread_mutexattr_destroy(&attr); - return (true); - } - pthread_mutexattr_destroy(&attr); - - return (false); -} diff --git a/dep/src/jmalloc/prof.c b/dep/src/jmalloc/prof.c deleted file mode 100644 index 6326188e50f..00000000000 --- a/dep/src/jmalloc/prof.c +++ /dev/null @@ -1,1328 +0,0 @@ -#define JEMALLOC_PROF_C_ -#include "jemalloc/internal/jemalloc_internal.h" -#ifdef JEMALLOC_PROF -/******************************************************************************/ - -#ifdef JEMALLOC_PROF_LIBGCC -#include -#endif - -#ifdef JEMALLOC_PROF_LIBUNWIND -#define UNW_LOCAL_ONLY -#include -#endif - -#include - -/******************************************************************************/ -/* Data. */ - -bool opt_prof = false; -bool opt_prof_active = true; -size_t opt_lg_prof_bt_max = LG_PROF_BT_MAX_DEFAULT; -size_t opt_lg_prof_sample = LG_PROF_SAMPLE_DEFAULT; -ssize_t opt_lg_prof_interval = LG_PROF_INTERVAL_DEFAULT; -bool opt_prof_udump = false; -bool opt_prof_leak = false; - -uint64_t prof_interval; -bool prof_promote; - -/* - * Global hash of (prof_bt_t *)-->(prof_ctx_t *). This is the master data - * structure that knows about all backtraces ever captured. - */ -static ckh_t bt2ctx; -static malloc_mutex_t bt2ctx_mtx; - -/* - * Thread-specific hash of (prof_bt_t *)-->(prof_thr_cnt_t *). Each thread - * keeps a cache of backtraces, with associated thread-specific prof_thr_cnt_t - * objects. Other threads may read the prof_thr_cnt_t contents, but no others - * will ever write them. - * - * Upon thread exit, the thread must merge all the prof_thr_cnt_t counter data - * into the associated prof_ctx_t objects, and unlink/free the prof_thr_cnt_t - * objects. - */ -static __thread ckh_t *bt2cnt_tls JEMALLOC_ATTR(tls_model("initial-exec")); - -/* - * Same contents as b2cnt, but initialized such that the TSD destructor is - * called when a thread exits, so that bt2cnt_tls contents can be merged, - * unlinked, and deallocated. - */ -static pthread_key_t bt2cnt_tsd; - -/* (1U << opt_lg_prof_bt_max). */ -static unsigned prof_bt_max; - -static __thread uint64_t prof_sample_prn_state - JEMALLOC_ATTR(tls_model("initial-exec")); -static __thread uint64_t prof_sample_threshold - JEMALLOC_ATTR(tls_model("initial-exec")); -static __thread uint64_t prof_sample_accum - JEMALLOC_ATTR(tls_model("initial-exec")); - -static malloc_mutex_t prof_dump_seq_mtx; -static uint64_t prof_dump_seq; -static uint64_t prof_dump_iseq; -static uint64_t prof_dump_mseq; -static uint64_t prof_dump_useq; - -/* - * This buffer is rather large for stack allocation, so use a single buffer for - * all profile dumps. The buffer is implicitly protected by bt2ctx_mtx, since - * it must be locked anyway during dumping. - */ -static char prof_dump_buf[PROF_DUMP_BUF_SIZE]; -static unsigned prof_dump_buf_end; -static int prof_dump_fd; - -/* Do not dump any profiles until bootstrapping is complete. */ -static bool prof_booted = false; - -static malloc_mutex_t enq_mtx; -static bool enq; -static bool enq_idump; -static bool enq_udump; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static prof_bt_t *bt_dup(prof_bt_t *bt); -static void bt_init(prof_bt_t *bt, void **vec); -#ifdef JEMALLOC_PROF_LIBGCC -static _Unwind_Reason_Code prof_unwind_init_callback( - struct _Unwind_Context *context, void *arg); -static _Unwind_Reason_Code prof_unwind_callback( - struct _Unwind_Context *context, void *arg); -#endif -static void prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max); -static prof_thr_cnt_t *prof_lookup(prof_bt_t *bt); -static void prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt); -static bool prof_flush(bool propagate_err); -static bool prof_write(const char *s, bool propagate_err); -static void prof_ctx_merge(prof_ctx_t *ctx, prof_cnt_t *cnt_all, - size_t *leak_nctx); -static bool prof_dump_ctx(prof_ctx_t *ctx, prof_bt_t *bt, - bool propagate_err); -static bool prof_dump_maps(bool propagate_err); -static bool prof_dump(const char *filename, bool leakcheck, - bool propagate_err); -static void prof_dump_filename(char *filename, char v, int64_t vseq); -static void prof_fdump(void); -static void prof_bt_hash(const void *key, unsigned minbits, size_t *hash1, - size_t *hash2); -static bool prof_bt_keycomp(const void *k1, const void *k2); -static void bt2cnt_thread_cleanup(void *arg); - -/******************************************************************************/ - -static void -bt_init(prof_bt_t *bt, void **vec) -{ - - bt->vec = vec; - bt->len = 0; -} - -static prof_bt_t * -bt_dup(prof_bt_t *bt) -{ - prof_bt_t *ret; - - /* - * Create a single allocation that has space for vec immediately - * following the prof_bt_t structure. The backtraces that get - * stored in the backtrace caches are copied from stack-allocated - * temporary variables, so size is known at creation time. Making this - * a contiguous object improves cache locality. - */ - ret = (prof_bt_t *)imalloc(QUANTUM_CEILING(sizeof(prof_bt_t)) + - (bt->len * sizeof(void *))); - if (ret == NULL) - return (NULL); - ret->vec = (void **)((uintptr_t)ret + - QUANTUM_CEILING(sizeof(prof_bt_t))); - memcpy(ret->vec, bt->vec, bt->len * sizeof(void *)); - ret->len = bt->len; - - return (ret); -} - -static inline void -prof_enter(void) -{ - - malloc_mutex_lock(&enq_mtx); - enq = true; - malloc_mutex_unlock(&enq_mtx); - - malloc_mutex_lock(&bt2ctx_mtx); -} - -static inline void -prof_leave(void) -{ - bool idump, udump; - - malloc_mutex_unlock(&bt2ctx_mtx); - - malloc_mutex_lock(&enq_mtx); - enq = false; - idump = enq_idump; - enq_idump = false; - udump = enq_udump; - enq_udump = false; - malloc_mutex_unlock(&enq_mtx); - - if (idump) - prof_idump(); - if (udump) - prof_udump(); -} - -#ifdef JEMALLOC_PROF_LIBGCC -static _Unwind_Reason_Code -prof_unwind_init_callback(struct _Unwind_Context *context, void *arg) -{ - - return (_URC_NO_REASON); -} - -static _Unwind_Reason_Code -prof_unwind_callback(struct _Unwind_Context *context, void *arg) -{ - prof_unwind_data_t *data = (prof_unwind_data_t *)arg; - - if (data->nignore > 0) - data->nignore--; - else { - data->bt->vec[data->bt->len] = (void *)_Unwind_GetIP(context); - data->bt->len++; - if (data->bt->len == data->max) - return (_URC_END_OF_STACK); - } - - return (_URC_NO_REASON); -} - -static void -prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) -{ - prof_unwind_data_t data = {bt, nignore, max}; - - _Unwind_Backtrace(prof_unwind_callback, &data); -} -#elif defined(JEMALLOC_PROF_LIBUNWIND) -static void -prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) -{ - unw_context_t uc; - unw_cursor_t cursor; - unsigned i; - int err; - - assert(bt->len == 0); - assert(bt->vec != NULL); - assert(max <= (1U << opt_lg_prof_bt_max)); - - unw_getcontext(&uc); - unw_init_local(&cursor, &uc); - - /* Throw away (nignore+1) stack frames, if that many exist. */ - for (i = 0; i < nignore + 1; i++) { - err = unw_step(&cursor); - if (err <= 0) - return; - } - - /* - * Iterate over stack frames until there are no more. Heap-allocate - * and iteratively grow a larger bt if necessary. - */ - for (i = 0; i < max; i++) { - unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *)&bt->vec[i]); - err = unw_step(&cursor); - if (err <= 0) { - bt->len = i; - break; - } - } -} -#else -static void -prof_backtrace(prof_bt_t *bt, unsigned nignore, unsigned max) -{ -#define NIGNORE 3 -#define BT_FRAME(i) \ - if ((i) < NIGNORE + max) { \ - void *p; \ - if (__builtin_frame_address(i) == 0) \ - return; \ - p = __builtin_return_address(i); \ - if (p == NULL) \ - return; \ - if (i >= NIGNORE) { \ - bt->vec[(i) - NIGNORE] = p; \ - bt->len = (i) - NIGNORE + 1; \ - } \ - } else \ - return; - - assert(max <= (1U << opt_lg_prof_bt_max)); - - /* - * Ignore the first three frames, since they are: - * - * 0: prof_backtrace() - * 1: prof_alloc_prep() - * 2: malloc(), calloc(), etc. - */ -#if 1 - assert(nignore + 1 == NIGNORE); -#else - BT_FRAME(0) - BT_FRAME(1) - BT_FRAME(2) -#endif - BT_FRAME(3) - BT_FRAME(4) - BT_FRAME(5) - BT_FRAME(6) - BT_FRAME(7) - BT_FRAME(8) - BT_FRAME(9) - - BT_FRAME(10) - BT_FRAME(11) - BT_FRAME(12) - BT_FRAME(13) - BT_FRAME(14) - BT_FRAME(15) - BT_FRAME(16) - BT_FRAME(17) - BT_FRAME(18) - BT_FRAME(19) - - BT_FRAME(20) - BT_FRAME(21) - BT_FRAME(22) - BT_FRAME(23) - BT_FRAME(24) - BT_FRAME(25) - BT_FRAME(26) - BT_FRAME(27) - BT_FRAME(28) - BT_FRAME(29) - - BT_FRAME(30) - BT_FRAME(31) - BT_FRAME(32) - BT_FRAME(33) - BT_FRAME(34) - BT_FRAME(35) - BT_FRAME(36) - BT_FRAME(37) - BT_FRAME(38) - BT_FRAME(39) - - BT_FRAME(40) - BT_FRAME(41) - BT_FRAME(42) - BT_FRAME(43) - BT_FRAME(44) - BT_FRAME(45) - BT_FRAME(46) - BT_FRAME(47) - BT_FRAME(48) - BT_FRAME(49) - - BT_FRAME(50) - BT_FRAME(51) - BT_FRAME(52) - BT_FRAME(53) - BT_FRAME(54) - BT_FRAME(55) - BT_FRAME(56) - BT_FRAME(57) - BT_FRAME(58) - BT_FRAME(59) - - BT_FRAME(60) - BT_FRAME(61) - BT_FRAME(62) - BT_FRAME(63) - BT_FRAME(64) - BT_FRAME(65) - BT_FRAME(66) - BT_FRAME(67) - BT_FRAME(68) - BT_FRAME(69) - - BT_FRAME(70) - BT_FRAME(71) - BT_FRAME(72) - BT_FRAME(73) - BT_FRAME(74) - BT_FRAME(75) - BT_FRAME(76) - BT_FRAME(77) - BT_FRAME(78) - BT_FRAME(79) - - BT_FRAME(80) - BT_FRAME(81) - BT_FRAME(82) - BT_FRAME(83) - BT_FRAME(84) - BT_FRAME(85) - BT_FRAME(86) - BT_FRAME(87) - BT_FRAME(88) - BT_FRAME(89) - - BT_FRAME(90) - BT_FRAME(91) - BT_FRAME(92) - BT_FRAME(93) - BT_FRAME(94) - BT_FRAME(95) - BT_FRAME(96) - BT_FRAME(97) - BT_FRAME(98) - BT_FRAME(99) - - BT_FRAME(100) - BT_FRAME(101) - BT_FRAME(102) - BT_FRAME(103) - BT_FRAME(104) - BT_FRAME(105) - BT_FRAME(106) - BT_FRAME(107) - BT_FRAME(108) - BT_FRAME(109) - - BT_FRAME(110) - BT_FRAME(111) - BT_FRAME(112) - BT_FRAME(113) - BT_FRAME(114) - BT_FRAME(115) - BT_FRAME(116) - BT_FRAME(117) - BT_FRAME(118) - BT_FRAME(119) - - BT_FRAME(120) - BT_FRAME(121) - BT_FRAME(122) - BT_FRAME(123) - BT_FRAME(124) - BT_FRAME(125) - BT_FRAME(126) - BT_FRAME(127) - - /* Extras to compensate for NIGNORE. */ - BT_FRAME(128) - BT_FRAME(129) - BT_FRAME(130) -#undef BT_FRAME -} -#endif - -static prof_thr_cnt_t * -prof_lookup(prof_bt_t *bt) -{ - prof_thr_cnt_t *ret; - ckh_t *bt2cnt = bt2cnt_tls; - - if (bt2cnt == NULL) { - /* Initialize an empty cache for this thread. */ - bt2cnt = (ckh_t *)imalloc(sizeof(ckh_t)); - if (bt2cnt == NULL) - return (NULL); - if (ckh_new(bt2cnt, PROF_CKH_MINITEMS, prof_bt_hash, - prof_bt_keycomp)) { - idalloc(bt2cnt); - return (NULL); - } - bt2cnt_tls = bt2cnt; - } - - if (ckh_search(bt2cnt, bt, NULL, (void **)&ret)) { - prof_bt_t *btkey; - prof_ctx_t *ctx; - - /* - * This thread's cache lacks bt. Look for it in the global - * cache. - */ - prof_enter(); - if (ckh_search(&bt2ctx, bt, (void **)&btkey, (void **)&ctx)) { - - /* bt has never been seen before. Insert it. */ - ctx = (prof_ctx_t *)imalloc(sizeof(prof_ctx_t)); - if (ctx == NULL) { - prof_leave(); - return (NULL); - } - btkey = bt_dup(bt); - if (btkey == NULL) { - prof_leave(); - idalloc(ctx); - return (NULL); - } - if (malloc_mutex_init(&ctx->lock)) { - prof_leave(); - idalloc(btkey); - idalloc(ctx); - return (NULL); - } - memset(&ctx->cnt_merged, 0, sizeof(prof_cnt_t)); - ql_new(&ctx->cnts_ql); - if (ckh_insert(&bt2ctx, btkey, ctx)) { - /* OOM. */ - prof_leave(); - idalloc(btkey); - idalloc(ctx); - return (NULL); - } - } - prof_leave(); - - /* Link a prof_thd_cnt_t into ctx for this thread. */ - ret = (prof_thr_cnt_t *)imalloc(sizeof(prof_thr_cnt_t)); - if (ret == NULL) - return (NULL); - ql_elm_new(ret, link); - ret->ctx = ctx; - ret->epoch = 0; - memset(&ret->cnts, 0, sizeof(prof_cnt_t)); - if (ckh_insert(bt2cnt, btkey, ret)) { - idalloc(ret); - return (NULL); - } - malloc_mutex_lock(&ctx->lock); - ql_tail_insert(&ctx->cnts_ql, ret, link); - malloc_mutex_unlock(&ctx->lock); - } - - return (ret); -} - -static inline void -prof_sample_threshold_update(void) -{ - uint64_t r; - double u; - - /* - * Compute prof_sample_threshold as a geometrically distributed random - * variable with mean (2^opt_lg_prof_sample). - */ - prn64(r, 53, prof_sample_prn_state, (uint64_t)1125899906842625LLU, - 1058392653243283975); - u = (double)r * (1.0/9007199254740992.0L); - prof_sample_threshold = (uint64_t)(log(u) / - log(1.0 - (1.0 / (double)((uint64_t)1U << opt_lg_prof_sample)))) - + (uint64_t)1U; -} - -prof_thr_cnt_t * -prof_alloc_prep(size_t size) -{ - prof_thr_cnt_t *ret; - void *vec[prof_bt_max]; - prof_bt_t bt; - - if (opt_prof_active == false) { - /* Sampling is currently inactive, so avoid sampling. */ - ret = (prof_thr_cnt_t *)(uintptr_t)1U; - } else if (opt_lg_prof_sample == 0) { - /* - * Don't bother with sampling logic, since sampling interval is - * 1. - */ - bt_init(&bt, vec); - prof_backtrace(&bt, 2, prof_bt_max); - ret = prof_lookup(&bt); - } else { - if (prof_sample_threshold == 0) { - /* - * Initialize. Seed the prng differently for each - * thread. - */ - prof_sample_prn_state = (uint64_t)(uintptr_t)&size; - prof_sample_threshold_update(); - } - - /* - * Determine whether to capture a backtrace based on whether - * size is enough for prof_accum to reach - * prof_sample_threshold. However, delay updating these - * variables until prof_{m,re}alloc(), because we don't know - * for sure that the allocation will succeed. - * - * Use subtraction rather than addition to avoid potential - * integer overflow. - */ - if (size >= prof_sample_threshold - prof_sample_accum) { - bt_init(&bt, vec); - prof_backtrace(&bt, 2, prof_bt_max); - ret = prof_lookup(&bt); - } else - ret = (prof_thr_cnt_t *)(uintptr_t)1U; - } - - return (ret); -} - -prof_thr_cnt_t * -prof_cnt_get(const void *ptr) -{ - prof_thr_cnt_t *ret; - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { - /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - - ret = arena_prof_cnt_get(ptr); - } else - ret = huge_prof_cnt_get(ptr); - - return (ret); -} - -static void -prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt) -{ - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { - /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - - arena_prof_cnt_set(ptr, cnt); - } else - huge_prof_cnt_set(ptr, cnt); -} - -static inline void -prof_sample_accum_update(size_t size) -{ - - if (opt_lg_prof_sample == 0) { - /* - * Don't bother with sampling logic, since sampling interval is - * 1. - */ - return; - } - - /* Take care to avoid integer overflow. */ - if (size >= prof_sample_threshold - prof_sample_accum) { - prof_sample_accum -= (prof_sample_threshold - size); - /* Compute new prof_sample_threshold. */ - prof_sample_threshold_update(); - while (prof_sample_accum >= prof_sample_threshold) { - prof_sample_accum -= prof_sample_threshold; - prof_sample_threshold_update(); - } - } else - prof_sample_accum += size; -} - -void -prof_malloc(const void *ptr, prof_thr_cnt_t *cnt) -{ - size_t size = isalloc(ptr); - - assert(ptr != NULL); - - prof_cnt_set(ptr, cnt); - prof_sample_accum_update(size); - - if ((uintptr_t)cnt > (uintptr_t)1U) { - cnt->epoch++; - /*********/ - mb_write(); - /*********/ - cnt->cnts.curobjs++; - cnt->cnts.curbytes += size; - cnt->cnts.accumobjs++; - cnt->cnts.accumbytes += size; - /*********/ - mb_write(); - /*********/ - cnt->epoch++; - /*********/ - mb_write(); - /*********/ - } -} - -void -prof_realloc(const void *ptr, prof_thr_cnt_t *cnt, const void *old_ptr, - size_t old_size, prof_thr_cnt_t *old_cnt) -{ - size_t size = isalloc(ptr); - - if (ptr != NULL) { - prof_cnt_set(ptr, cnt); - prof_sample_accum_update(size); - } - - if ((uintptr_t)old_cnt > (uintptr_t)1U) - old_cnt->epoch++; - if ((uintptr_t)cnt > (uintptr_t)1U) - cnt->epoch++; - /*********/ - mb_write(); - /*********/ - if ((uintptr_t)old_cnt > (uintptr_t)1U) { - old_cnt->cnts.curobjs--; - old_cnt->cnts.curbytes -= old_size; - } - if ((uintptr_t)cnt > (uintptr_t)1U) { - cnt->cnts.curobjs++; - cnt->cnts.curbytes += size; - cnt->cnts.accumobjs++; - cnt->cnts.accumbytes += size; - } - /*********/ - mb_write(); - /*********/ - if ((uintptr_t)old_cnt > (uintptr_t)1U) - old_cnt->epoch++; - if ((uintptr_t)cnt > (uintptr_t)1U) - cnt->epoch++; - /*********/ - mb_write(); /* Not strictly necessary. */ -} - -void -prof_free(const void *ptr) -{ - prof_thr_cnt_t *cnt = prof_cnt_get(ptr); - - if ((uintptr_t)cnt > (uintptr_t)1) { - size_t size = isalloc(ptr); - - cnt->epoch++; - /*********/ - mb_write(); - /*********/ - cnt->cnts.curobjs--; - cnt->cnts.curbytes -= size; - /*********/ - mb_write(); - /*********/ - cnt->epoch++; - /*********/ - mb_write(); - /*********/ - } -} - -static bool -prof_flush(bool propagate_err) -{ - bool ret = false; - ssize_t err; - - err = write(prof_dump_fd, prof_dump_buf, prof_dump_buf_end); - if (err == -1) { - if (propagate_err == false) { - malloc_write(": write() failed during heap " - "profile flush\n"); - if (opt_abort) - abort(); - } - ret = true; - } - prof_dump_buf_end = 0; - - return (ret); -} - -static bool -prof_write(const char *s, bool propagate_err) -{ - unsigned i, slen, n; - - i = 0; - slen = strlen(s); - while (i < slen) { - /* Flush the buffer if it is full. */ - if (prof_dump_buf_end == PROF_DUMP_BUF_SIZE) - if (prof_flush(propagate_err) && propagate_err) - return (true); - - if (prof_dump_buf_end + slen <= PROF_DUMP_BUF_SIZE) { - /* Finish writing. */ - n = slen - i; - } else { - /* Write as much of s as will fit. */ - n = PROF_DUMP_BUF_SIZE - prof_dump_buf_end; - } - memcpy(&prof_dump_buf[prof_dump_buf_end], &s[i], n); - prof_dump_buf_end += n; - i += n; - } - - return (false); -} - -static void -prof_ctx_merge(prof_ctx_t *ctx, prof_cnt_t *cnt_all, size_t *leak_nctx) -{ - prof_thr_cnt_t *thr_cnt; - prof_cnt_t tcnt; - - malloc_mutex_lock(&ctx->lock); - - memcpy(&ctx->cnt_dump, &ctx->cnt_merged, sizeof(prof_cnt_t)); - ql_foreach(thr_cnt, &ctx->cnts_ql, link) { - volatile unsigned *epoch = &thr_cnt->epoch; - - while (true) { - unsigned epoch0 = *epoch; - - /* Make sure epoch is even. */ - if (epoch0 & 1U) - continue; - - memcpy(&tcnt, &thr_cnt->cnts, sizeof(prof_cnt_t)); - - /* Terminate if epoch didn't change while reading. */ - if (*epoch == epoch0) - break; - } - - ctx->cnt_dump.curobjs += tcnt.curobjs; - ctx->cnt_dump.curbytes += tcnt.curbytes; - ctx->cnt_dump.accumobjs += tcnt.accumobjs; - ctx->cnt_dump.accumbytes += tcnt.accumbytes; - - if (tcnt.curobjs != 0) - (*leak_nctx)++; - } - - /* Merge into cnt_all. */ - cnt_all->curobjs += ctx->cnt_dump.curobjs; - cnt_all->curbytes += ctx->cnt_dump.curbytes; - cnt_all->accumobjs += ctx->cnt_dump.accumobjs; - cnt_all->accumbytes += ctx->cnt_dump.accumbytes; - - malloc_mutex_unlock(&ctx->lock); -} - -static bool -prof_dump_ctx(prof_ctx_t *ctx, prof_bt_t *bt, bool propagate_err) -{ - char buf[UMAX2S_BUFSIZE]; - unsigned i; - - if (prof_write(umax2s(ctx->cnt_dump.curobjs, 10, buf), propagate_err) - || prof_write(": ", propagate_err) - || prof_write(umax2s(ctx->cnt_dump.curbytes, 10, buf), - propagate_err) - || prof_write(" [", propagate_err) - || prof_write(umax2s(ctx->cnt_dump.accumobjs, 10, buf), - propagate_err) - || prof_write(": ", propagate_err) - || prof_write(umax2s(ctx->cnt_dump.accumbytes, 10, buf), - propagate_err) - || prof_write("] @", propagate_err)) - return (true); - - for (i = 0; i < bt->len; i++) { - if (prof_write(" 0x", propagate_err) - || prof_write(umax2s((uintptr_t)bt->vec[i], 16, buf), - propagate_err)) - return (true); - } - - if (prof_write("\n", propagate_err)) - return (true); - - return (false); -} - -static bool -prof_dump_maps(bool propagate_err) -{ - int mfd; - char buf[UMAX2S_BUFSIZE]; - char *s; - unsigned i, slen; - /* /proc//maps\0 */ - char mpath[6 + UMAX2S_BUFSIZE - + 5 + 1]; - - i = 0; - - s = "/proc/"; - slen = strlen(s); - memcpy(&mpath[i], s, slen); - i += slen; - - s = umax2s(getpid(), 10, buf); - slen = strlen(s); - memcpy(&mpath[i], s, slen); - i += slen; - - s = "/maps"; - slen = strlen(s); - memcpy(&mpath[i], s, slen); - i += slen; - - mpath[i] = '\0'; - - mfd = open(mpath, O_RDONLY); - if (mfd != -1) { - ssize_t nread; - - if (prof_write("\nMAPPED_LIBRARIES:\n", propagate_err) && - propagate_err) - return (true); - nread = 0; - do { - prof_dump_buf_end += nread; - if (prof_dump_buf_end == PROF_DUMP_BUF_SIZE) { - /* Make space in prof_dump_buf before read(). */ - if (prof_flush(propagate_err) && propagate_err) - return (true); - } - nread = read(mfd, &prof_dump_buf[prof_dump_buf_end], - PROF_DUMP_BUF_SIZE - prof_dump_buf_end); - } while (nread > 0); - close(mfd); - } else - return (true); - - return (false); -} - -static bool -prof_dump(const char *filename, bool leakcheck, bool propagate_err) -{ - prof_cnt_t cnt_all; - size_t tabind; - prof_bt_t *bt; - prof_ctx_t *ctx; - char buf[UMAX2S_BUFSIZE]; - size_t leak_nctx; - - prof_enter(); - prof_dump_fd = creat(filename, 0644); - if (prof_dump_fd == -1) { - if (propagate_err == false) { - malloc_write(": creat(\""); - malloc_write(filename); - malloc_write("\", 0644) failed\n"); - if (opt_abort) - abort(); - } - goto ERROR; - } - - /* Merge per thread profile stats, and sum them in cnt_all. */ - memset(&cnt_all, 0, sizeof(prof_cnt_t)); - leak_nctx = 0; - for (tabind = 0; ckh_iter(&bt2ctx, &tabind, NULL, (void **)&ctx) - == false;) { - prof_ctx_merge(ctx, &cnt_all, &leak_nctx); - } - - /* Dump profile header. */ - if (prof_write("heap profile: ", propagate_err) - || prof_write(umax2s(cnt_all.curobjs, 10, buf), propagate_err) - || prof_write(": ", propagate_err) - || prof_write(umax2s(cnt_all.curbytes, 10, buf), propagate_err) - || prof_write(" [", propagate_err) - || prof_write(umax2s(cnt_all.accumobjs, 10, buf), propagate_err) - || prof_write(": ", propagate_err) - || prof_write(umax2s(cnt_all.accumbytes, 10, buf), propagate_err)) - goto ERROR; - - if (opt_lg_prof_sample == 0) { - if (prof_write("] @ heapprofile\n", propagate_err)) - goto ERROR; - } else { - if (prof_write("] @ heap_v2/", propagate_err) - || prof_write(umax2s((uint64_t)1U << opt_lg_prof_sample, 10, - buf), propagate_err) - || prof_write("\n", propagate_err)) - goto ERROR; - } - - /* Dump per ctx profile stats. */ - for (tabind = 0; ckh_iter(&bt2ctx, &tabind, (void **)&bt, (void **)&ctx) - == false;) { - if (prof_dump_ctx(ctx, bt, propagate_err)) - goto ERROR; - } - - /* Dump /proc//maps if possible. */ - if (prof_dump_maps(propagate_err)) - goto ERROR; - - if (prof_flush(propagate_err)) - goto ERROR; - close(prof_dump_fd); - prof_leave(); - - if (leakcheck && cnt_all.curbytes != 0) { - malloc_write(": Leak summary: "); - malloc_write(umax2s(cnt_all.curbytes, 10, buf)); - malloc_write((cnt_all.curbytes != 1) ? " bytes, " : " byte, "); - malloc_write(umax2s(cnt_all.curobjs, 10, buf)); - malloc_write((cnt_all.curobjs != 1) ? " objects, " : - " object, "); - malloc_write(umax2s(leak_nctx, 10, buf)); - malloc_write((leak_nctx != 1) ? " contexts\n" : " context\n"); - malloc_write(": Run pprof on \""); - malloc_write(filename); - malloc_write("\" for leak detail\n"); - } - - return (false); -ERROR: - prof_leave(); - return (true); -} - -#define DUMP_FILENAME_BUFSIZE (PATH_MAX+ UMAX2S_BUFSIZE \ - + 1 \ - + UMAX2S_BUFSIZE \ - + 2 \ - + UMAX2S_BUFSIZE \ - + 5 + 1) -static void -prof_dump_filename(char *filename, char v, int64_t vseq) -{ - char buf[UMAX2S_BUFSIZE]; - char *s; - unsigned i, slen; - - /* - * Construct a filename of the form: - * - * ...v.heap\0 - * or - * jeprof...v.heap\0 - */ - - i = 0; - - /* - * Use JEMALLOC_PROF_PREFIX if it's set, and if it is short enough to - * avoid overflowing DUMP_FILENAME_BUFSIZE. The result may exceed - * PATH_MAX, but creat(2) will catch that problem. - */ - if ((s = getenv("JEMALLOC_PROF_PREFIX")) != NULL - && strlen(s) + (DUMP_FILENAME_BUFSIZE - PATH_MAX) <= PATH_MAX) { - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - s = "."; - } else - s = "jeprof."; - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - s = umax2s(getpid(), 10, buf); - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - s = "."; - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - s = umax2s(prof_dump_seq, 10, buf); - prof_dump_seq++; - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - s = "."; - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - filename[i] = v; - i++; - - if (vseq != 0xffffffffffffffffLLU) { - s = umax2s(vseq, 10, buf); - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - } - - s = ".heap"; - slen = strlen(s); - memcpy(&filename[i], s, slen); - i += slen; - - filename[i] = '\0'; -} - -static void -prof_fdump(void) -{ - char filename[DUMP_FILENAME_BUFSIZE]; - - if (prof_booted == false) - return; - - malloc_mutex_lock(&prof_dump_seq_mtx); - prof_dump_filename(filename, 'f', 0xffffffffffffffffLLU); - malloc_mutex_unlock(&prof_dump_seq_mtx); - prof_dump(filename, opt_prof_leak, false); -} - -void -prof_idump(void) -{ - char filename[DUMP_FILENAME_BUFSIZE]; - - if (prof_booted == false) - return; - malloc_mutex_lock(&enq_mtx); - if (enq) { - enq_idump = true; - malloc_mutex_unlock(&enq_mtx); - return; - } - malloc_mutex_unlock(&enq_mtx); - - malloc_mutex_lock(&prof_dump_seq_mtx); - prof_dump_filename(filename, 'i', prof_dump_iseq); - prof_dump_iseq++; - malloc_mutex_unlock(&prof_dump_seq_mtx); - prof_dump(filename, false, false); -} - -bool -prof_mdump(const char *filename) -{ - char filename_buf[DUMP_FILENAME_BUFSIZE]; - - if (opt_prof == false || prof_booted == false) - return (true); - - if (filename == NULL) { - /* No filename specified, so automatically generate one. */ - malloc_mutex_lock(&prof_dump_seq_mtx); - prof_dump_filename(filename_buf, 'm', prof_dump_mseq); - prof_dump_mseq++; - malloc_mutex_unlock(&prof_dump_seq_mtx); - filename = filename_buf; - } - return (prof_dump(filename, false, true)); -} - -void -prof_udump(void) -{ - char filename[DUMP_FILENAME_BUFSIZE]; - - if (prof_booted == false) - return; - malloc_mutex_lock(&enq_mtx); - if (enq) { - enq_udump = true; - malloc_mutex_unlock(&enq_mtx); - return; - } - malloc_mutex_unlock(&enq_mtx); - - malloc_mutex_lock(&prof_dump_seq_mtx); - prof_dump_filename(filename, 'u', prof_dump_useq); - prof_dump_useq++; - malloc_mutex_unlock(&prof_dump_seq_mtx); - prof_dump(filename, false, false); -} - -static void -prof_bt_hash(const void *key, unsigned minbits, size_t *hash1, size_t *hash2) -{ - size_t ret1, ret2; - uint64_t h; - prof_bt_t *bt = (prof_bt_t *)key; - - assert(minbits <= 32 || (SIZEOF_PTR == 8 && minbits <= 64)); - assert(hash1 != NULL); - assert(hash2 != NULL); - - h = hash(bt->vec, bt->len * sizeof(void *), 0x94122f335b332aeaLLU); - if (minbits <= 32) { - /* - * Avoid doing multiple hashes, since a single hash provides - * enough bits. - */ - ret1 = h & ZU(0xffffffffU); - ret2 = h >> 32; - } else { - ret1 = h; - ret2 = hash(bt->vec, bt->len * sizeof(void *), - 0x8432a476666bbc13U); - } - - *hash1 = ret1; - *hash2 = ret2; -} - -static bool -prof_bt_keycomp(const void *k1, const void *k2) -{ - const prof_bt_t *bt1 = (prof_bt_t *)k1; - const prof_bt_t *bt2 = (prof_bt_t *)k2; - - if (bt1->len != bt2->len) - return (false); - return (memcmp(bt1->vec, bt2->vec, bt1->len * sizeof(void *)) == 0); -} - -static void -bt2cnt_thread_cleanup(void *arg) -{ - ckh_t *bt2cnt; - - bt2cnt = bt2cnt_tls; - if (bt2cnt != NULL) { - ql_head(prof_thr_cnt_t) cnts_ql; - size_t tabind; - prof_thr_cnt_t *cnt; - - /* Iteratively merge cnt's into the global stats. */ - ql_new(&cnts_ql); - tabind = 0; - while (ckh_iter(bt2cnt, &tabind, NULL, (void **)&cnt) == - false) { - prof_ctx_t *ctx = cnt->ctx; - /* Merge stats and detach from ctx. */ - malloc_mutex_lock(&ctx->lock); - ctx->cnt_merged.curobjs += cnt->cnts.curobjs; - ctx->cnt_merged.curbytes += cnt->cnts.curbytes; - ctx->cnt_merged.accumobjs += cnt->cnts.accumobjs; - ctx->cnt_merged.accumbytes += cnt->cnts.accumbytes; - ql_remove(&ctx->cnts_ql, cnt, link); - malloc_mutex_unlock(&ctx->lock); - - /* - * Stash cnt for deletion after finishing with - * ckh_iter(). - */ - ql_tail_insert(&cnts_ql, cnt, link); - } - - /* - * Delete the hash table now that cnts_ql has a list of all - * cnt's. - */ - ckh_delete(bt2cnt); - idalloc(bt2cnt); - bt2cnt_tls = NULL; - - /* Delete cnt's. */ - while ((cnt = ql_last(&cnts_ql, link)) != NULL) { - ql_remove(&cnts_ql, cnt, link); - idalloc(cnt); - } - } -} - -void -prof_boot0(void) -{ - - /* - * opt_prof and prof_promote must be in their final state before any - * arenas are initialized, so this function must be executed early. - */ - - if (opt_prof_leak && opt_prof == false) { - /* - * Enable opt_prof, but in such a way that profiles are never - * automatically dumped. - */ - opt_prof = true; - opt_prof_udump = false; - prof_interval = 0; - } else if (opt_prof) { - if (opt_lg_prof_interval >= 0) { - prof_interval = (((uint64_t)1U) << - opt_lg_prof_interval); - } else - prof_interval = 0; - } - - prof_promote = (opt_prof && opt_lg_prof_sample > PAGE_SHIFT); -} - -bool -prof_boot1(void) -{ - - if (opt_prof) { - if (ckh_new(&bt2ctx, PROF_CKH_MINITEMS, prof_bt_hash, - prof_bt_keycomp)) - return (true); - if (malloc_mutex_init(&bt2ctx_mtx)) - return (true); - if (pthread_key_create(&bt2cnt_tsd, bt2cnt_thread_cleanup) - != 0) { - malloc_write( - ": Error in pthread_key_create()\n"); - abort(); - } - - prof_bt_max = (1U << opt_lg_prof_bt_max); - if (malloc_mutex_init(&prof_dump_seq_mtx)) - return (true); - - if (malloc_mutex_init(&enq_mtx)) - return (true); - enq = false; - enq_idump = false; - enq_udump = false; - - if (atexit(prof_fdump) != 0) { - malloc_write(": Error in atexit()\n"); - if (opt_abort) - abort(); - } - } - -#ifdef JEMALLOC_PROF_LIBGCC - /* - * Cause the backtracing machinery to allocate its internal state - * before enabling profiling. - */ - _Unwind_Backtrace(prof_unwind_init_callback, NULL); -#endif - - prof_booted = true; - - return (false); -} - -/******************************************************************************/ -#endif /* JEMALLOC_PROF */ diff --git a/dep/src/jmalloc/stats.c b/dep/src/jmalloc/stats.c deleted file mode 100644 index 9dc75293731..00000000000 --- a/dep/src/jmalloc/stats.c +++ /dev/null @@ -1,717 +0,0 @@ -#define JEMALLOC_STATS_C_ -#include "jemalloc/internal/jemalloc_internal.h" - -#define CTL_GET(n, v, t) do { \ - size_t sz = sizeof(t); \ - xmallctl(n, v, &sz, NULL, 0); \ -} while (0) - -#define CTL_I_GET(n, v, t) do { \ - size_t mib[6]; \ - size_t miblen = sizeof(mib) / sizeof(size_t); \ - size_t sz = sizeof(t); \ - xmallctlnametomib(n, mib, &miblen); \ - mib[2] = i; \ - xmallctlbymib(mib, miblen, v, &sz, NULL, 0); \ -} while (0) - -#define CTL_J_GET(n, v, t) do { \ - size_t mib[6]; \ - size_t miblen = sizeof(mib) / sizeof(size_t); \ - size_t sz = sizeof(t); \ - xmallctlnametomib(n, mib, &miblen); \ - mib[2] = j; \ - xmallctlbymib(mib, miblen, v, &sz, NULL, 0); \ -} while (0) - -#define CTL_IJ_GET(n, v, t) do { \ - size_t mib[6]; \ - size_t miblen = sizeof(mib) / sizeof(size_t); \ - size_t sz = sizeof(t); \ - xmallctlnametomib(n, mib, &miblen); \ - mib[2] = i; \ - mib[4] = j; \ - xmallctlbymib(mib, miblen, v, &sz, NULL, 0); \ -} while (0) - -/******************************************************************************/ -/* Data. */ - -bool opt_stats_print = false; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -#ifdef JEMALLOC_STATS -static void malloc_vcprintf(void (*write_cb)(void *, const char *), - void *cbopaque, const char *format, va_list ap); -static void stats_arena_bins_print(void (*write_cb)(void *, const char *), - void *cbopaque, unsigned i); -static void stats_arena_lruns_print(void (*write_cb)(void *, const char *), - void *cbopaque, unsigned i); -static void stats_arena_print(void (*write_cb)(void *, const char *), - void *cbopaque, unsigned i); -#endif - -/******************************************************************************/ - -/* - * We don't want to depend on vsnprintf() for production builds, since that can - * cause unnecessary bloat for static binaries. umax2s() provides minimal - * integer printing functionality, so that malloc_printf() use can be limited to - * JEMALLOC_STATS code. - */ -char * -umax2s(uintmax_t x, unsigned base, char *s) -{ - unsigned i; - - i = UMAX2S_BUFSIZE - 1; - s[i] = '\0'; - switch (base) { - case 10: - do { - i--; - s[i] = "0123456789"[x % 10]; - x /= 10; - } while (x > 0); - break; - case 16: - do { - i--; - s[i] = "0123456789abcdef"[x & 0xf]; - x >>= 4; - } while (x > 0); - break; - default: - do { - i--; - s[i] = "0123456789abcdefghijklmnopqrstuvwxyz"[x % base]; - x /= base; - } while (x > 0); - } - - return (&s[i]); -} - -#ifdef JEMALLOC_STATS -static void -malloc_vcprintf(void (*write_cb)(void *, const char *), void *cbopaque, - const char *format, va_list ap) -{ - char buf[4096]; - - if (write_cb == NULL) { - /* - * The caller did not provide an alternate write_cb callback - * function, so use the default one. malloc_write() is an - * inline function, so use malloc_message() directly here. - */ - write_cb = JEMALLOC_P(malloc_message); - cbopaque = NULL; - } - - vsnprintf(buf, sizeof(buf), format, ap); - write_cb(cbopaque, buf); -} - -/* - * Print to a callback function in such a way as to (hopefully) avoid memory - * allocation. - */ -JEMALLOC_ATTR(format(printf, 3, 4)) -void -malloc_cprintf(void (*write_cb)(void *, const char *), void *cbopaque, - const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - malloc_vcprintf(write_cb, cbopaque, format, ap); - va_end(ap); -} - -/* - * Print to stderr in such a way as to (hopefully) avoid memory allocation. - */ -JEMALLOC_ATTR(format(printf, 1, 2)) -void -malloc_printf(const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - malloc_vcprintf(NULL, NULL, format, ap); - va_end(ap); -} -#endif - -#ifdef JEMALLOC_STATS -static void -stats_arena_bins_print(void (*write_cb)(void *, const char *), void *cbopaque, - unsigned i) -{ - size_t pagesize; - bool config_tcache; - unsigned nbins, j, gap_start; - - CTL_GET("arenas.pagesize", &pagesize, size_t); - - CTL_GET("config.tcache", &config_tcache, bool); - if (config_tcache) { - malloc_cprintf(write_cb, cbopaque, - "bins: bin size regs pgs allocated nmalloc" - " ndalloc nrequests nfills nflushes" - " newruns reruns maxruns curruns\n"); - } else { - malloc_cprintf(write_cb, cbopaque, - "bins: bin size regs pgs allocated nmalloc" - " ndalloc newruns reruns maxruns" - " curruns\n"); - } - CTL_GET("arenas.nbins", &nbins, unsigned); - for (j = 0, gap_start = UINT_MAX; j < nbins; j++) { - uint64_t nruns; - - CTL_IJ_GET("stats.arenas.0.bins.0.nruns", &nruns, uint64_t); - if (nruns == 0) { - if (gap_start == UINT_MAX) - gap_start = j; - } else { - unsigned ntbins_, nqbins, ncbins, nsbins; - size_t reg_size, run_size, allocated; - uint32_t nregs; - uint64_t nmalloc, ndalloc, nrequests, nfills, nflushes; - uint64_t reruns; - size_t highruns, curruns; - - if (gap_start != UINT_MAX) { - if (j > gap_start + 1) { - /* Gap of more than one size class. */ - malloc_cprintf(write_cb, cbopaque, - "[%u..%u]\n", gap_start, - j - 1); - } else { - /* Gap of one size class. */ - malloc_cprintf(write_cb, cbopaque, - "[%u]\n", gap_start); - } - gap_start = UINT_MAX; - } - CTL_GET("arenas.ntbins", &ntbins_, unsigned); - CTL_GET("arenas.nqbins", &nqbins, unsigned); - CTL_GET("arenas.ncbins", &ncbins, unsigned); - CTL_GET("arenas.nsbins", &nsbins, unsigned); - CTL_J_GET("arenas.bin.0.size", ®_size, size_t); - CTL_J_GET("arenas.bin.0.nregs", &nregs, uint32_t); - CTL_J_GET("arenas.bin.0.run_size", &run_size, size_t); - CTL_IJ_GET("stats.arenas.0.bins.0.allocated", - &allocated, size_t); - CTL_IJ_GET("stats.arenas.0.bins.0.nmalloc", - &nmalloc, uint64_t); - CTL_IJ_GET("stats.arenas.0.bins.0.ndalloc", - &ndalloc, uint64_t); - if (config_tcache) { - CTL_IJ_GET("stats.arenas.0.bins.0.nrequests", - &nrequests, uint64_t); - CTL_IJ_GET("stats.arenas.0.bins.0.nfills", - &nfills, uint64_t); - CTL_IJ_GET("stats.arenas.0.bins.0.nflushes", - &nflushes, uint64_t); - } - CTL_IJ_GET("stats.arenas.0.bins.0.nreruns", &reruns, - uint64_t); - CTL_IJ_GET("stats.arenas.0.bins.0.highruns", &highruns, - size_t); - CTL_IJ_GET("stats.arenas.0.bins.0.curruns", &curruns, - size_t); - if (config_tcache) { - malloc_cprintf(write_cb, cbopaque, - "%13u %1s %5zu %4u %3zu %12zu %12"PRIu64 - " %12"PRIu64" %12"PRIu64" %12"PRIu64 - " %12"PRIu64" %12"PRIu64" %12"PRIu64 - " %12zu %12zu\n", - j, - j < ntbins_ ? "T" : j < ntbins_ + nqbins ? - "Q" : j < ntbins_ + nqbins + ncbins ? "C" : - "S", - reg_size, nregs, run_size / pagesize, - allocated, nmalloc, ndalloc, nrequests, - nfills, nflushes, nruns, reruns, highruns, - curruns); - } else { - malloc_cprintf(write_cb, cbopaque, - "%13u %1s %5zu %4u %3zu %12zu %12"PRIu64 - " %12"PRIu64" %12"PRIu64" %12"PRIu64 - " %12zu %12zu\n", - j, - j < ntbins_ ? "T" : j < ntbins_ + nqbins ? - "Q" : j < ntbins_ + nqbins + ncbins ? "C" : - "S", - reg_size, nregs, run_size / pagesize, - allocated, nmalloc, ndalloc, nruns, reruns, - highruns, curruns); - } - } - } - if (gap_start != UINT_MAX) { - if (j > gap_start + 1) { - /* Gap of more than one size class. */ - malloc_cprintf(write_cb, cbopaque, "[%u..%u]\n", - gap_start, j - 1); - } else { - /* Gap of one size class. */ - malloc_cprintf(write_cb, cbopaque, "[%u]\n", gap_start); - } - } -} - -static void -stats_arena_lruns_print(void (*write_cb)(void *, const char *), void *cbopaque, - unsigned i) -{ - size_t pagesize, nlruns, j; - ssize_t gap_start; - - CTL_GET("arenas.pagesize", &pagesize, size_t); - - malloc_cprintf(write_cb, cbopaque, - "large: size pages nmalloc ndalloc nrequests" - " maxruns curruns\n"); - CTL_GET("arenas.nlruns", &nlruns, size_t); - for (j = 0, gap_start = -1; j < nlruns; j++) { - uint64_t nmalloc, ndalloc, nrequests; - size_t run_size, highruns, curruns; - - CTL_IJ_GET("stats.arenas.0.lruns.0.nmalloc", &nmalloc, - uint64_t); - CTL_IJ_GET("stats.arenas.0.lruns.0.ndalloc", &ndalloc, - uint64_t); - CTL_IJ_GET("stats.arenas.0.lruns.0.nrequests", &nrequests, - uint64_t); - if (nrequests == 0) { - if (gap_start == -1) - gap_start = j; - } else { - CTL_J_GET("arenas.lrun.0.size", &run_size, size_t); - CTL_IJ_GET("stats.arenas.0.lruns.0.highruns", &highruns, - size_t); - CTL_IJ_GET("stats.arenas.0.lruns.0.curruns", &curruns, - size_t); - if (gap_start != -1) { - malloc_cprintf(write_cb, cbopaque, "[%zu]\n", - j - gap_start); - gap_start = -1; - } - malloc_cprintf(write_cb, cbopaque, - "%13zu %5zu %12"PRIu64" %12"PRIu64" %12"PRIu64 - " %12zu %12zu\n", - run_size, run_size / pagesize, nmalloc, ndalloc, - nrequests, highruns, curruns); - } - } - if (gap_start != -1) - malloc_cprintf(write_cb, cbopaque, "[%zu]\n", j - gap_start); -} - -static void -stats_arena_print(void (*write_cb)(void *, const char *), void *cbopaque, - unsigned i) -{ - size_t pagesize, pactive, pdirty, mapped; - uint64_t npurge, nmadvise, purged; - size_t small_allocated; - uint64_t small_nmalloc, small_ndalloc, small_nrequests; - size_t large_allocated; - uint64_t large_nmalloc, large_ndalloc, large_nrequests; - - CTL_GET("arenas.pagesize", &pagesize, size_t); - - CTL_I_GET("stats.arenas.0.pactive", &pactive, size_t); - CTL_I_GET("stats.arenas.0.pdirty", &pdirty, size_t); - CTL_I_GET("stats.arenas.0.npurge", &npurge, uint64_t); - CTL_I_GET("stats.arenas.0.nmadvise", &nmadvise, uint64_t); - CTL_I_GET("stats.arenas.0.purged", &purged, uint64_t); - malloc_cprintf(write_cb, cbopaque, - "dirty pages: %zu:%zu active:dirty, %"PRIu64" sweep%s," - " %"PRIu64" madvise%s, %"PRIu64" purged\n", - pactive, pdirty, npurge, npurge == 1 ? "" : "s", - nmadvise, nmadvise == 1 ? "" : "s", purged); - - malloc_cprintf(write_cb, cbopaque, - " allocated nmalloc ndalloc nrequests\n"); - CTL_I_GET("stats.arenas.0.small.allocated", &small_allocated, size_t); - CTL_I_GET("stats.arenas.0.small.nmalloc", &small_nmalloc, uint64_t); - CTL_I_GET("stats.arenas.0.small.ndalloc", &small_ndalloc, uint64_t); - CTL_I_GET("stats.arenas.0.small.nrequests", &small_nrequests, uint64_t); - malloc_cprintf(write_cb, cbopaque, - "small: %12zu %12"PRIu64" %12"PRIu64" %12"PRIu64"\n", - small_allocated, small_nmalloc, small_ndalloc, small_nrequests); - CTL_I_GET("stats.arenas.0.large.allocated", &large_allocated, size_t); - CTL_I_GET("stats.arenas.0.large.nmalloc", &large_nmalloc, uint64_t); - CTL_I_GET("stats.arenas.0.large.ndalloc", &large_ndalloc, uint64_t); - CTL_I_GET("stats.arenas.0.large.nrequests", &large_nrequests, uint64_t); - malloc_cprintf(write_cb, cbopaque, - "large: %12zu %12"PRIu64" %12"PRIu64" %12"PRIu64"\n", - large_allocated, large_nmalloc, large_ndalloc, large_nrequests); - malloc_cprintf(write_cb, cbopaque, - "total: %12zu %12"PRIu64" %12"PRIu64" %12"PRIu64"\n", - small_allocated + large_allocated, - small_nmalloc + large_nmalloc, - small_ndalloc + large_ndalloc, - small_nrequests + large_nrequests); - malloc_cprintf(write_cb, cbopaque, "active: %12zu\n", - pactive * pagesize ); - CTL_I_GET("stats.arenas.0.mapped", &mapped, size_t); - malloc_cprintf(write_cb, cbopaque, "mapped: %12zu\n", mapped); - - stats_arena_bins_print(write_cb, cbopaque, i); - stats_arena_lruns_print(write_cb, cbopaque, i); -} -#endif - -void -stats_print(void (*write_cb)(void *, const char *), void *cbopaque, - const char *opts) -{ - uint64_t epoch; - size_t u64sz; - char s[UMAX2S_BUFSIZE]; - bool general = true; - bool merged = true; - bool unmerged = true; - bool bins = true; - bool large = true; - - /* Refresh stats, in case mallctl() was called by the application. */ - epoch = 1; - u64sz = sizeof(uint64_t); - xmallctl("epoch", &epoch, &u64sz, &epoch, sizeof(uint64_t)); - - if (write_cb == NULL) { - /* - * The caller did not provide an alternate write_cb callback - * function, so use the default one. malloc_write() is an - * inline function, so use malloc_message() directly here. - */ - write_cb = JEMALLOC_P(malloc_message); - cbopaque = NULL; - } - - if (opts != NULL) { - unsigned i; - - for (i = 0; opts[i] != '\0'; i++) { - switch (opts[i]) { - case 'g': - general = false; - break; - case 'm': - merged = false; - break; - case 'a': - unmerged = false; - break; - case 'b': - bins = false; - break; - case 'l': - large = false; - break; - default:; - } - } - } - - write_cb(cbopaque, "___ Begin jemalloc statistics ___\n"); - if (general) { - int err; - const char *cpv; - bool bv; - unsigned uv; - ssize_t ssv; - size_t sv, bsz, ssz; - - bsz = sizeof(bool); - ssz = sizeof(size_t); - - CTL_GET("version", &cpv, const char *); - write_cb(cbopaque, "Version: "); - write_cb(cbopaque, cpv); - write_cb(cbopaque, "\n"); - CTL_GET("config.debug", &bv, bool); - write_cb(cbopaque, "Assertions "); - write_cb(cbopaque, bv ? "enabled" : "disabled"); - write_cb(cbopaque, "\n"); - - write_cb(cbopaque, "Boolean JEMALLOC_OPTIONS: "); - if ((err = JEMALLOC_P(mallctl)("opt.abort", &bv, &bsz, NULL, 0)) - == 0) - write_cb(cbopaque, bv ? "A" : "a"); - if ((err = JEMALLOC_P(mallctl)("prof.active", &bv, &bsz, - NULL, 0)) == 0) - write_cb(cbopaque, bv ? "E" : "e"); - if ((err = JEMALLOC_P(mallctl)("opt.prof", &bv, &bsz, NULL, 0)) - == 0) - write_cb(cbopaque, bv ? "F" : "f"); - if ((err = JEMALLOC_P(mallctl)("opt.tcache", &bv, &bsz, NULL, - 0)) == 0) - write_cb(cbopaque, bv ? "H" : "h"); - if ((err = JEMALLOC_P(mallctl)("opt.junk", &bv, &bsz, NULL, 0)) - == 0) - write_cb(cbopaque, bv ? "J" : "j"); - if ((err = JEMALLOC_P(mallctl)("opt.prof_leak", &bv, &bsz, NULL, - 0)) == 0) - write_cb(cbopaque, bv ? "L" : "l"); - if ((err = JEMALLOC_P(mallctl)("opt.overcommit", &bv, &bsz, - NULL, 0)) == 0) - write_cb(cbopaque, bv ? "O" : "o"); - if ((err = JEMALLOC_P(mallctl)("opt.stats_print", &bv, &bsz, - NULL, 0)) == 0) - write_cb(cbopaque, bv ? "P" : "p"); - if ((err = JEMALLOC_P(mallctl)("opt.prof_udump", &bv, &bsz, - NULL, 0)) == 0) - write_cb(cbopaque, bv ? "U" : "u"); - if ((err = JEMALLOC_P(mallctl)("opt.sysv", &bv, &bsz, NULL, 0)) - == 0) - write_cb(cbopaque, bv ? "V" : "v"); - if ((err = JEMALLOC_P(mallctl)("opt.xmalloc", &bv, &bsz, NULL, - 0)) == 0) - write_cb(cbopaque, bv ? "X" : "x"); - if ((err = JEMALLOC_P(mallctl)("opt.zero", &bv, &bsz, NULL, 0)) - == 0) - write_cb(cbopaque, bv ? "Z" : "z"); - write_cb(cbopaque, "\n"); - - write_cb(cbopaque, "CPUs: "); - write_cb(cbopaque, umax2s(ncpus, 10, s)); - write_cb(cbopaque, "\n"); - - CTL_GET("arenas.narenas", &uv, unsigned); - write_cb(cbopaque, "Max arenas: "); - write_cb(cbopaque, umax2s(uv, 10, s)); - write_cb(cbopaque, "\n"); - - write_cb(cbopaque, "Pointer size: "); - write_cb(cbopaque, umax2s(sizeof(void *), 10, s)); - write_cb(cbopaque, "\n"); - - CTL_GET("arenas.quantum", &sv, size_t); - write_cb(cbopaque, "Quantum size: "); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "\n"); - - CTL_GET("arenas.cacheline", &sv, size_t); - write_cb(cbopaque, "Cacheline size (assumed): "); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "\n"); - - CTL_GET("arenas.subpage", &sv, size_t); - write_cb(cbopaque, "Subpage spacing: "); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "\n"); - - if ((err = JEMALLOC_P(mallctl)("arenas.tspace_min", &sv, &ssz, - NULL, 0)) == 0) { - write_cb(cbopaque, "Tiny 2^n-spaced sizes: ["); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, ".."); - - CTL_GET("arenas.tspace_max", &sv, size_t); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "]\n"); - } - - CTL_GET("arenas.qspace_min", &sv, size_t); - write_cb(cbopaque, "Quantum-spaced sizes: ["); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, ".."); - CTL_GET("arenas.qspace_max", &sv, size_t); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "]\n"); - - CTL_GET("arenas.cspace_min", &sv, size_t); - write_cb(cbopaque, "Cacheline-spaced sizes: ["); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, ".."); - CTL_GET("arenas.cspace_max", &sv, size_t); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "]\n"); - - CTL_GET("arenas.sspace_min", &sv, size_t); - write_cb(cbopaque, "Subpage-spaced sizes: ["); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, ".."); - CTL_GET("arenas.sspace_max", &sv, size_t); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "]\n"); - - CTL_GET("opt.lg_dirty_mult", &ssv, ssize_t); - if (ssv >= 0) { - write_cb(cbopaque, - "Min active:dirty page ratio per arena: "); - write_cb(cbopaque, umax2s((1U << ssv), 10, s)); - write_cb(cbopaque, ":1\n"); - } else { - write_cb(cbopaque, - "Min active:dirty page ratio per arena: N/A\n"); - } - if ((err = JEMALLOC_P(mallctl)("arenas.tcache_max", &sv, - &ssz, NULL, 0)) == 0) { - write_cb(cbopaque, - "Maximum thread-cached size class: "); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, "\n"); - } - if ((err = JEMALLOC_P(mallctl)("opt.lg_tcache_gc_sweep", &ssv, - &ssz, NULL, 0)) == 0) { - size_t tcache_gc_sweep = (1U << ssv); - bool tcache_enabled; - CTL_GET("opt.tcache", &tcache_enabled, bool); - write_cb(cbopaque, "Thread cache GC sweep interval: "); - write_cb(cbopaque, tcache_enabled && ssv >= 0 ? - umax2s(tcache_gc_sweep, 10, s) : "N/A"); - write_cb(cbopaque, "\n"); - } - if ((err = JEMALLOC_P(mallctl)("opt.prof", &bv, &bsz, NULL, 0)) - == 0 && bv) { - CTL_GET("opt.lg_prof_bt_max", &sv, size_t); - write_cb(cbopaque, "Maximum profile backtrace depth: "); - write_cb(cbopaque, umax2s((1U << sv), 10, s)); - write_cb(cbopaque, "\n"); - - CTL_GET("opt.lg_prof_sample", &sv, size_t); - write_cb(cbopaque, "Average profile sample interval: "); - write_cb(cbopaque, umax2s((1U << sv), 10, s)); - write_cb(cbopaque, " (2^"); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, ")\n"); - - CTL_GET("opt.lg_prof_interval", &ssv, ssize_t); - write_cb(cbopaque, "Average profile dump interval: "); - if (ssv >= 0) { - write_cb(cbopaque, umax2s((1U << ssv), 10, s)); - write_cb(cbopaque, " (2^"); - write_cb(cbopaque, umax2s(ssv, 10, s)); - write_cb(cbopaque, ")\n"); - } else - write_cb(cbopaque, "N/A\n"); - } - CTL_GET("arenas.chunksize", &sv, size_t); - write_cb(cbopaque, "Chunk size: "); - write_cb(cbopaque, umax2s(sv, 10, s)); - CTL_GET("opt.lg_chunk", &sv, size_t); - write_cb(cbopaque, " (2^"); - write_cb(cbopaque, umax2s(sv, 10, s)); - write_cb(cbopaque, ")\n"); - } - -#ifdef JEMALLOC_STATS - { - int err; - size_t ssz; - size_t allocated, active, mapped; - size_t chunks_current, chunks_high, swap_avail; - uint64_t chunks_total; - size_t huge_allocated; - uint64_t huge_nmalloc, huge_ndalloc; - - ssz = sizeof(size_t); - - CTL_GET("stats.allocated", &allocated, size_t); - CTL_GET("stats.active", &active, size_t); - CTL_GET("stats.mapped", &mapped, size_t); - malloc_cprintf(write_cb, cbopaque, - "Allocated: %zu, active: %zu, mapped: %zu\n", allocated, - active, mapped); - - /* Print chunk stats. */ - CTL_GET("stats.chunks.total", &chunks_total, uint64_t); - CTL_GET("stats.chunks.high", &chunks_high, size_t); - CTL_GET("stats.chunks.current", &chunks_current, size_t); - if ((err = JEMALLOC_P(mallctl)("swap.avail", &swap_avail, &ssz, - NULL, 0)) == 0) { - size_t lg_chunk; - - malloc_cprintf(write_cb, cbopaque, "chunks: nchunks " - "highchunks curchunks swap_avail\n"); - CTL_GET("opt.lg_chunk", &lg_chunk, size_t); - malloc_cprintf(write_cb, cbopaque, - " %13"PRIu64"%13zu%13zu%13zu\n", - chunks_total, chunks_high, chunks_current, - swap_avail << lg_chunk); - } else { - malloc_cprintf(write_cb, cbopaque, "chunks: nchunks " - "highchunks curchunks\n"); - malloc_cprintf(write_cb, cbopaque, - " %13"PRIu64"%13zu%13zu\n", - chunks_total, chunks_high, chunks_current); - } - - /* Print huge stats. */ - CTL_GET("stats.huge.nmalloc", &huge_nmalloc, uint64_t); - CTL_GET("stats.huge.ndalloc", &huge_ndalloc, uint64_t); - CTL_GET("stats.huge.allocated", &huge_allocated, size_t); - malloc_cprintf(write_cb, cbopaque, - "huge: nmalloc ndalloc allocated\n"); - malloc_cprintf(write_cb, cbopaque, - " %12"PRIu64" %12"PRIu64" %12zu\n", - huge_nmalloc, huge_ndalloc, huge_allocated); - - if (merged) { - unsigned narenas; - - CTL_GET("arenas.narenas", &narenas, unsigned); - { - bool initialized[narenas]; - size_t isz; - unsigned i, ninitialized; - - isz = sizeof(initialized); - xmallctl("arenas.initialized", initialized, - &isz, NULL, 0); - for (i = ninitialized = 0; i < narenas; i++) { - if (initialized[i]) - ninitialized++; - } - - if (ninitialized > 1) { - /* Print merged arena stats. */ - malloc_cprintf(write_cb, cbopaque, - "\nMerged arenas stats:\n"); - stats_arena_print(write_cb, cbopaque, - narenas); - } - } - } - - if (unmerged) { - unsigned narenas; - - /* Print stats for each arena. */ - - CTL_GET("arenas.narenas", &narenas, unsigned); - { - bool initialized[narenas]; - size_t isz; - unsigned i; - - isz = sizeof(initialized); - xmallctl("arenas.initialized", initialized, - &isz, NULL, 0); - - for (i = 0; i < narenas; i++) { - if (initialized[i]) { - malloc_cprintf(write_cb, - cbopaque, - "\narenas[%u]:\n", i); - stats_arena_print(write_cb, - cbopaque, i); - } - } - } - } - } -#endif /* #ifdef JEMALLOC_STATS */ - write_cb(cbopaque, "--- End jemalloc statistics ---\n"); -} diff --git a/dep/src/jmalloc/tcache.c b/dep/src/jmalloc/tcache.c deleted file mode 100644 index ce6ec996159..00000000000 --- a/dep/src/jmalloc/tcache.c +++ /dev/null @@ -1,403 +0,0 @@ -#define JEMALLOC_TCACHE_C_ -#include "jemalloc/internal/jemalloc_internal.h" -#ifdef JEMALLOC_TCACHE -/******************************************************************************/ -/* Data. */ - -bool opt_tcache = true; -ssize_t opt_lg_tcache_maxclass = LG_TCACHE_MAXCLASS_DEFAULT; -ssize_t opt_lg_tcache_gc_sweep = LG_TCACHE_GC_SWEEP_DEFAULT; - -/* Map of thread-specific caches. */ -__thread tcache_t *tcache_tls JEMALLOC_ATTR(tls_model("initial-exec")); - -/* - * Same contents as tcache, but initialized such that the TSD destructor is - * called when a thread exits, so that the cache can be cleaned up. - */ -static pthread_key_t tcache_tsd; - -size_t nhbins; -size_t tcache_maxclass; -unsigned tcache_gc_incr; - -/******************************************************************************/ -/* Function prototypes for non-inline static functions. */ - -static void tcache_thread_cleanup(void *arg); - -/******************************************************************************/ - -void * -tcache_alloc_small_hard(tcache_t *tcache, tcache_bin_t *tbin, size_t binind) -{ - void *ret; - - arena_tcache_fill_small(tcache->arena, tbin, binind -#ifdef JEMALLOC_PROF - , tcache->prof_accumbytes -#endif - ); -#ifdef JEMALLOC_PROF - tcache->prof_accumbytes = 0; -#endif - ret = tcache_alloc_easy(tbin); - - return (ret); -} - -void -tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache_t *tcache -#endif - ) -{ - void *flush, *deferred, *ptr; - unsigned i, nflush, ndeferred; - - assert(binind < nbins); - assert(rem <= tbin->ncached); - - for (flush = tbin->avail, nflush = tbin->ncached - rem; flush != NULL; - flush = deferred, nflush = ndeferred) { - /* Lock the arena bin associated with the first object. */ - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(flush); - arena_t *arena = chunk->arena; - arena_bin_t *bin = &arena->bins[binind]; - -#ifdef JEMALLOC_PROF - if (arena == tcache->arena) { - malloc_mutex_lock(&arena->lock); - arena_prof_accum(arena, tcache->prof_accumbytes); - malloc_mutex_unlock(&arena->lock); - tcache->prof_accumbytes = 0; - } -#endif - - malloc_mutex_lock(&bin->lock); -#ifdef JEMALLOC_STATS - if (arena == tcache->arena) { - bin->stats.nflushes++; - bin->stats.nrequests += tbin->tstats.nrequests; - tbin->tstats.nrequests = 0; - } -#endif - deferred = NULL; - ndeferred = 0; - for (i = 0; i < nflush; i++) { - ptr = flush; - assert(ptr != NULL); - flush = *(void **)ptr; - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk->arena == arena) { - size_t pageind = (((uintptr_t)ptr - - (uintptr_t)chunk) >> PAGE_SHIFT); - arena_chunk_map_t *mapelm = - &chunk->map[pageind]; - arena_dalloc_bin(arena, chunk, ptr, mapelm); - } else { - /* - * This object was allocated via a different - * arena bin than the one that is currently - * locked. Stash the object, so that it can be - * handled in a future pass. - */ - *(void **)ptr = deferred; - deferred = ptr; - ndeferred++; - } - } - malloc_mutex_unlock(&bin->lock); - - if (flush != NULL) { - /* - * This was the first pass, and rem cached objects - * remain. - */ - tbin->avail = flush; - } - } - - tbin->ncached = rem; - if (tbin->ncached < tbin->low_water) - tbin->low_water = tbin->ncached; -} - -void -tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache_t *tcache -#endif - ) -{ - void *flush, *deferred, *ptr; - unsigned i, nflush, ndeferred; - - assert(binind < nhbins); - assert(rem <= tbin->ncached); - - for (flush = tbin->avail, nflush = tbin->ncached - rem; flush != NULL; - flush = deferred, nflush = ndeferred) { - /* Lock the arena associated with the first object. */ - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(flush); - arena_t *arena = chunk->arena; - - malloc_mutex_lock(&arena->lock); -#if (defined(JEMALLOC_PROF) || defined(JEMALLOC_STATS)) - if (arena == tcache->arena) { -#endif -#ifdef JEMALLOC_PROF - arena_prof_accum(arena, tcache->prof_accumbytes); - tcache->prof_accumbytes = 0; -#endif -#ifdef JEMALLOC_STATS - arena->stats.nrequests_large += tbin->tstats.nrequests; - arena->stats.lstats[binind - nbins].nrequests += - tbin->tstats.nrequests; - tbin->tstats.nrequests = 0; -#endif -#if (defined(JEMALLOC_PROF) || defined(JEMALLOC_STATS)) - } -#endif - deferred = NULL; - ndeferred = 0; - for (i = 0; i < nflush; i++) { - ptr = flush; - assert(ptr != NULL); - flush = *(void **)ptr; - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk->arena == arena) - arena_dalloc_large(arena, chunk, ptr); - else { - /* - * This object was allocated via a different - * arena than the one that is currently locked. - * Stash the object, so that it can be handled - * in a future pass. - */ - *(void **)ptr = deferred; - deferred = ptr; - ndeferred++; - } - } - malloc_mutex_unlock(&arena->lock); - - if (flush != NULL) { - /* - * This was the first pass, and rem cached objects - * remain. - */ - tbin->avail = flush; - } - } - - tbin->ncached = rem; - if (tbin->ncached < tbin->low_water) - tbin->low_water = tbin->ncached; -} - -tcache_t * -tcache_create(arena_t *arena) -{ - tcache_t *tcache; - size_t size; - unsigned i; - - size = sizeof(tcache_t) + (sizeof(tcache_bin_t) * (nhbins - 1)); - /* - * Round up to the nearest multiple of the cacheline size, in order to - * avoid the possibility of false cacheline sharing. - * - * That this works relies on the same logic as in ipalloc(). - */ - size = (size + CACHELINE_MASK) & (-CACHELINE); - - if (size <= small_maxclass) - tcache = (tcache_t *)arena_malloc_small(arena, size, true); - else - tcache = (tcache_t *)icalloc(size); - - if (tcache == NULL) - return (NULL); - -#ifdef JEMALLOC_STATS - /* Link into list of extant tcaches. */ - malloc_mutex_lock(&arena->lock); - ql_elm_new(tcache, link); - ql_tail_insert(&arena->tcache_ql, tcache, link); - malloc_mutex_unlock(&arena->lock); -#endif - - tcache->arena = arena; - assert((TCACHE_NSLOTS_SMALL_MAX & 1U) == 0); - for (i = 0; i < nbins; i++) { - if ((arena->bins[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MAX) { - tcache->tbins[i].ncached_max = (arena->bins[i].nregs << - 1); - } else - tcache->tbins[i].ncached_max = TCACHE_NSLOTS_SMALL_MAX; - } - for (; i < nhbins; i++) - tcache->tbins[i].ncached_max = TCACHE_NSLOTS_LARGE; - - tcache_tls = tcache; - pthread_setspecific(tcache_tsd, tcache); - - return (tcache); -} - -void -tcache_destroy(tcache_t *tcache) -{ - unsigned i; - -#ifdef JEMALLOC_STATS - /* Unlink from list of extant tcaches. */ - malloc_mutex_lock(&tcache->arena->lock); - ql_remove(&tcache->arena->tcache_ql, tcache, link); - malloc_mutex_unlock(&tcache->arena->lock); - tcache_stats_merge(tcache, tcache->arena); -#endif - - for (i = 0; i < nbins; i++) { - tcache_bin_t *tbin = &tcache->tbins[i]; - tcache_bin_flush_small(tbin, i, 0 -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - -#ifdef JEMALLOC_STATS - if (tbin->tstats.nrequests != 0) { - arena_t *arena = tcache->arena; - arena_bin_t *bin = &arena->bins[i]; - malloc_mutex_lock(&bin->lock); - bin->stats.nrequests += tbin->tstats.nrequests; - malloc_mutex_unlock(&bin->lock); - } -#endif - } - - for (; i < nhbins; i++) { - tcache_bin_t *tbin = &tcache->tbins[i]; - tcache_bin_flush_large(tbin, i, 0 -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - -#ifdef JEMALLOC_STATS - if (tbin->tstats.nrequests != 0) { - arena_t *arena = tcache->arena; - malloc_mutex_lock(&arena->lock); - arena->stats.nrequests_large += tbin->tstats.nrequests; - arena->stats.lstats[i - nbins].nrequests += - tbin->tstats.nrequests; - malloc_mutex_unlock(&arena->lock); - } -#endif - } - -#ifdef JEMALLOC_PROF - if (tcache->prof_accumbytes > 0) { - malloc_mutex_lock(&tcache->arena->lock); - arena_prof_accum(tcache->arena, tcache->prof_accumbytes); - malloc_mutex_unlock(&tcache->arena->lock); - } -#endif - - if (arena_salloc(tcache) <= small_maxclass) { - arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache); - arena_t *arena = chunk->arena; - size_t pageind = (((uintptr_t)tcache - (uintptr_t)chunk) >> - PAGE_SHIFT); - arena_chunk_map_t *mapelm = &chunk->map[pageind]; - arena_run_t *run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << - PAGE_SHIFT)); - arena_bin_t *bin = run->bin; - - malloc_mutex_lock(&bin->lock); - arena_dalloc_bin(arena, chunk, tcache, mapelm); - malloc_mutex_unlock(&bin->lock); - } else - idalloc(tcache); -} - -static void -tcache_thread_cleanup(void *arg) -{ - tcache_t *tcache = (tcache_t *)arg; - - assert(tcache == tcache_tls); - if (tcache != NULL) { - assert(tcache != (void *)(uintptr_t)1); - tcache_destroy(tcache); - tcache_tls = (void *)(uintptr_t)1; - } -} - -#ifdef JEMALLOC_STATS -void -tcache_stats_merge(tcache_t *tcache, arena_t *arena) -{ - unsigned i; - - /* Merge and reset tcache stats. */ - for (i = 0; i < nbins; i++) { - arena_bin_t *bin = &arena->bins[i]; - tcache_bin_t *tbin = &tcache->tbins[i]; - malloc_mutex_lock(&bin->lock); - bin->stats.nrequests += tbin->tstats.nrequests; - malloc_mutex_unlock(&bin->lock); - tbin->tstats.nrequests = 0; - } - - for (; i < nhbins; i++) { - malloc_large_stats_t *lstats = &arena->stats.lstats[i - nbins]; - tcache_bin_t *tbin = &tcache->tbins[i]; - arena->stats.nrequests_large += tbin->tstats.nrequests; - lstats->nrequests += tbin->tstats.nrequests; - tbin->tstats.nrequests = 0; - } -} -#endif - -void -tcache_boot(void) -{ - - if (opt_tcache) { - /* - * If necessary, clamp opt_lg_tcache_maxclass, now that - * small_maxclass and arena_maxclass are known. - */ - if (opt_lg_tcache_maxclass < 0 || (1U << - opt_lg_tcache_maxclass) < small_maxclass) - tcache_maxclass = small_maxclass; - else if ((1U << opt_lg_tcache_maxclass) > arena_maxclass) - tcache_maxclass = arena_maxclass; - else - tcache_maxclass = (1U << opt_lg_tcache_maxclass); - - nhbins = nbins + (tcache_maxclass >> PAGE_SHIFT); - - /* Compute incremental GC event threshold. */ - if (opt_lg_tcache_gc_sweep >= 0) { - tcache_gc_incr = ((1U << opt_lg_tcache_gc_sweep) / - nbins) + (((1U << opt_lg_tcache_gc_sweep) % nbins == - 0) ? 0 : 1); - } else - tcache_gc_incr = 0; - - if (pthread_key_create(&tcache_tsd, tcache_thread_cleanup) != - 0) { - malloc_write( - ": Error in pthread_key_create()\n"); - abort(); - } - } -} -/******************************************************************************/ -#endif /* JEMALLOC_TCACHE */ diff --git a/dep/src/sockets/Base64.cpp b/dep/src/sockets/Base64.cpp deleted file mode 100644 index f7f12f5edff..00000000000 --- a/dep/src/sockets/Base64.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/** \file Base64.cpp - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Base64.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -const char *Base64::bstr = - "ABCDEFGHIJKLMNOPQ" - "RSTUVWXYZabcdefgh" - "ijklmnopqrstuvwxy" - "z0123456789+/"; - -const char Base64::rstr[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, - 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0}; - -Base64::Base64() -{ -} - -void Base64::encode(FILE *fil, std::string& output, bool add_crlf) -{ - size_t remain; - size_t i = 0; - size_t o = 0; - char input[4]; - - output = ""; - remain = fread(input,1,3,fil); - while (remain > 0) - { - if (add_crlf && o && o % 76 == 0) - output += "\n"; - switch (remain) - { - case 1: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) ]; - output += "=="; - break; - case 2: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ]; - output += bstr[ ((input[i + 1] << 2) & 0x3c) ]; - output += "="; - break; - default: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ]; - output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ]; - output += bstr[ (input[i + 2] & 0x3f) ]; - } - o += 4; - // - remain = fread(input,1,3,fil); - } -} - -void Base64::encode(const std::string& str_in, std::string& str_out, bool add_crlf) -{ - encode(str_in.c_str(), str_in.size(), str_out, add_crlf); -} - -void Base64::encode(const char* input,size_t l,std::string& output, bool add_crlf) -{ - size_t i = 0; - size_t o = 0; - - output = ""; - while (i < l) - { - size_t remain = l - i; - if (add_crlf && o && o % 76 == 0) - output += "\n"; - switch (remain) - { - case 1: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) ]; - output += "=="; - break; - case 2: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ]; - output += bstr[ ((input[i + 1] << 2) & 0x3c) ]; - output += "="; - break; - default: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ]; - output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ]; - output += bstr[ (input[i + 2] & 0x3f) ]; - } - o += 4; - i += 3; - } -} - -void Base64::encode(const unsigned char* input,size_t l,std::string& output,bool add_crlf) -{ - size_t i = 0; - size_t o = 0; - - output = ""; - while (i < l) - { - size_t remain = l - i; - if (add_crlf && o && o % 76 == 0) - output += "\n"; - switch (remain) - { - case 1: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) ]; - output += "=="; - break; - case 2: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ]; - output += bstr[ ((input[i + 1] << 2) & 0x3c) ]; - output += "="; - break; - default: - output += bstr[ ((input[i] >> 2) & 0x3f) ]; - output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ]; - output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ]; - output += bstr[ (input[i + 2] & 0x3f) ]; - } - o += 4; - i += 3; - } -} - -void Base64::decode(const std::string& input,std::string& output) -{ - size_t i = 0; - size_t l = input.size(); - - output = ""; - while (i < l) - { - while (i < l && (input[i] == 13 || input[i] == 10)) - i++; - if (i < l) - { - char b1 = (char)((rstr[(int)input[i]] << 2 & 0xfc) + - (rstr[(int)input[i + 1]] >> 4 & 0x03)); - output += b1; - if (input[i + 2] != '=') - { - char b2 = (char)((rstr[(int)input[i + 1]] << 4 & 0xf0) + - (rstr[(int)input[i + 2]] >> 2 & 0x0f)); - output += b2; - } - if (input[i + 3] != '=') - { - char b3 = (char)((rstr[(int)input[i + 2]] << 6 & 0xc0) + - rstr[(int)input[i + 3]]); - output += b3; - } - i += 4; - } - } -} - -void Base64::decode(const std::string& input, unsigned char *output, size_t& sz) -{ - size_t i = 0; - size_t l = input.size(); - size_t j = 0; - - while (i < l) - { - while (i < l && (input[i] == 13 || input[i] == 10)) - i++; - if (i < l) - { - unsigned char b1 = (unsigned char)((rstr[(int)input[i]] << 2 & 0xfc) + - (rstr[(int)input[i + 1]] >> 4 & 0x03)); - if (output) - { - output[j] = b1; - } - j++; - if (input[i + 2] != '=') - { - unsigned char b2 = (unsigned char)((rstr[(int)input[i + 1]] << 4 & 0xf0) + - (rstr[(int)input[i + 2]] >> 2 & 0x0f)); - if (output) - { - output[j] = b2; - } - j++; - } - if (input[i + 3] != '=') - { - unsigned char b3 = (unsigned char)((rstr[(int)input[i + 2]] << 6 & 0xc0) + - rstr[(int)input[i + 3]]); - if (output) - { - output[j] = b3; - } - j++; - } - i += 4; - } - } - sz = j; -} - -size_t Base64::decode_length(const std::string& str64) -{ - if (str64.empty() || str64.size() % 4) - return 0; - size_t l = 3 * (str64.size() / 4 - 1) + 1; - if (str64[str64.size() - 2] != '=') - l++; - if (str64[str64.size() - 1] != '=') - l++; - return l; -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/CMakeLists.txt b/dep/src/sockets/CMakeLists.txt deleted file mode 100644 index a47c8dee75f..00000000000 --- a/dep/src/sockets/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -SET(trinitysockets_STAT_SRCS - Base64.cpp - Exception.cpp - Ipv4Address.cpp - Ipv6Address.cpp - Lock.cpp - Mutex.cpp - Parse.cpp - ResolvServer.cpp - ResolvSocket.cpp - Socket.cpp - SocketHandler.cpp - StdoutLog.cpp - StreamSocket.cpp - TcpSocket.cpp - Thread.cpp - UdpSocket.cpp - Utility.cpp - socket_include.cpp -) - -include_directories( - ${CMAKE_SOURCE_DIR}/dep/include/sockets -) - -add_library(trinitysockets STATIC ${trinitysockets_STAT_SRCS}) diff --git a/dep/src/sockets/Exception.cpp b/dep/src/sockets/Exception.cpp deleted file mode 100644 index 4d79aeef813..00000000000 --- a/dep/src/sockets/Exception.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - ** \file Exception.cpp - ** \date 2007-09-28 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif -#include "Exception.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -Exception::Exception(const std::string& description) : m_description(description) -{ -} - -const std::string Exception::ToString() const -{ - return m_description; -} - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - - diff --git a/dep/src/sockets/Ipv4Address.cpp b/dep/src/sockets/Ipv4Address.cpp deleted file mode 100644 index 03935038951..00000000000 --- a/dep/src/sockets/Ipv4Address.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/** - ** \file Ipv4Address.cpp - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Ipv4Address.h" -#include "Utility.h" -#include "Parse.h" -#ifndef _WIN32 -#include -#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -Ipv4Address::Ipv4Address(port_t port) : m_valid(true) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin_family = AF_INET; - m_addr.sin_port = htons( port ); -} - -Ipv4Address::Ipv4Address(ipaddr_t a,port_t port) : m_valid(true) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin_family = AF_INET; - m_addr.sin_port = htons( port ); - memcpy(&m_addr.sin_addr, &a, sizeof(struct in_addr)); -} - -Ipv4Address::Ipv4Address(struct in_addr& a,port_t port) : m_valid(true) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin_family = AF_INET; - m_addr.sin_port = htons( port ); - m_addr.sin_addr = a; -} - -Ipv4Address::Ipv4Address(const std::string& host,port_t port) : m_valid(false) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin_family = AF_INET; - m_addr.sin_port = htons( port ); - { - ipaddr_t a; - if (Utility::u2ip(host, a)) - { - memcpy(&m_addr.sin_addr, &a, sizeof(struct in_addr)); - m_valid = true; - } - } -} - -Ipv4Address::Ipv4Address(struct sockaddr_in& sa) -{ - m_addr = sa; - m_valid = sa.sin_family == AF_INET; -} - -Ipv4Address::~Ipv4Address() -{ -} - -Ipv4Address::operator struct sockaddr *() -{ - return (struct sockaddr *)&m_addr; -} - -Ipv4Address::operator socklen_t() -{ - return sizeof(struct sockaddr_in); -} - -void Ipv4Address::SetPort(port_t port) -{ - m_addr.sin_port = htons( port ); -} - -port_t Ipv4Address::GetPort() -{ - return ntohs( m_addr.sin_port ); -} - -bool Ipv4Address::Resolve(const std::string& hostname,struct in_addr& a) -{ - struct sockaddr_in sa; - memset(&a, 0, sizeof(a)); - if (Utility::isipv4(hostname)) - { - if (!Utility::u2ip(hostname, sa, AI_NUMERICHOST)) - return false; - a = sa.sin_addr; - return true; - } - if (!Utility::u2ip(hostname, sa)) - return false; - a = sa.sin_addr; - return true; -} - -bool Ipv4Address::Reverse(struct in_addr& a,std::string& name) -{ - struct sockaddr_in sa; - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; - sa.sin_addr = a; - return Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name); -} - -std::string Ipv4Address::Convert(bool include_port) -{ - if (include_port) - return Convert(m_addr.sin_addr) + ":" + Utility::l2string(GetPort()); - return Convert(m_addr.sin_addr); -} - -std::string Ipv4Address::Convert(struct in_addr& a) -{ - struct sockaddr_in sa; - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; - sa.sin_addr = a; - std::string name; - Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name, NI_NUMERICHOST); - return name; -} - -void Ipv4Address::SetAddress(struct sockaddr *sa) -{ - memcpy(&m_addr, sa, sizeof(struct sockaddr_in)); -} - -int Ipv4Address::GetFamily() -{ - return m_addr.sin_family; -} - -bool Ipv4Address::IsValid() -{ - return m_valid; -} - -bool Ipv4Address::operator==(SocketAddress& a) -{ - if (a.GetFamily() != GetFamily()) - return false; - if ((socklen_t)a != sizeof(m_addr)) - return false; - struct sockaddr *sa = a; - struct sockaddr_in *p = (struct sockaddr_in *)sa; - if (p -> sin_port != m_addr.sin_port) - return false; - if (memcmp(&p -> sin_addr, &m_addr.sin_addr, 4)) - return false; - return true; -} - -std::auto_ptr Ipv4Address::GetCopy() -{ - return std::auto_ptr(new Ipv4Address(m_addr)); -} - -std::string Ipv4Address::Reverse() -{ - std::string tmp; - Reverse(m_addr.sin_addr, tmp); - return tmp; -} - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - - diff --git a/dep/src/sockets/Ipv6Address.cpp b/dep/src/sockets/Ipv6Address.cpp deleted file mode 100644 index 3208b5098fa..00000000000 --- a/dep/src/sockets/Ipv6Address.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/** - ** \file Ipv6Address.cpp - ** \date 2006-09-21 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2007 Anders Hedstrom - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Ipv6Address.h" -#ifdef ENABLE_IPV6 - -#include "Utility.h" -#include "Parse.h" -#ifndef _WIN32 -#include -#endif -#ifdef IPPROTO_IPV6 - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -Ipv6Address::Ipv6Address(port_t port) : m_valid(true) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin6_family = AF_INET6; - m_addr.sin6_port = htons( port ); -} - -Ipv6Address::Ipv6Address(struct in6_addr& a,port_t port) : m_valid(true) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin6_family = AF_INET6; - m_addr.sin6_port = htons( port ); - m_addr.sin6_addr = a; -} - -Ipv6Address::Ipv6Address(const std::string& host,port_t port) : m_valid(false) -{ - memset(&m_addr, 0, sizeof(m_addr)); - m_addr.sin6_family = AF_INET6; - m_addr.sin6_port = htons( port ); - { - struct in6_addr a; - if (Utility::u2ip(host, a)) - { - m_addr.sin6_addr = a; - m_valid = true; - } - } -} - -Ipv6Address::Ipv6Address(struct sockaddr_in6& sa) -{ - m_addr = sa; - m_valid = sa.sin6_family == AF_INET6; -} - -Ipv6Address::~Ipv6Address() -{ -} - -Ipv6Address::operator struct sockaddr *() -{ - return (struct sockaddr *)&m_addr; -} - -Ipv6Address::operator socklen_t() -{ - return sizeof(struct sockaddr_in6); -} - -void Ipv6Address::SetPort(port_t port) -{ - m_addr.sin6_port = htons( port ); -} - -port_t Ipv6Address::GetPort() -{ - return ntohs( m_addr.sin6_port ); -} - -bool Ipv6Address::Resolve(const std::string& hostname,struct in6_addr& a) -{ - struct sockaddr_in6 sa; - memset(&a, 0, sizeof(a)); - if (Utility::isipv6(hostname)) - { - if (!Utility::u2ip(hostname, sa, AI_NUMERICHOST)) - return false; - a = sa.sin6_addr; - return true; - } - if (!Utility::u2ip(hostname, sa)) - return false; - a = sa.sin6_addr; - return true; -} - -bool Ipv6Address::Reverse(struct in6_addr& a,std::string& name) -{ - struct sockaddr_in6 sa; - memset(&sa, 0, sizeof(sa)); - sa.sin6_family = AF_INET6; - sa.sin6_addr = a; - return Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name); -} - -std::string Ipv6Address::Convert(bool include_port) -{ - if (include_port) - return Convert(m_addr.sin6_addr) + ":" + Utility::l2string(GetPort()); - return Convert(m_addr.sin6_addr); -} - -std::string Ipv6Address::Convert(struct in6_addr& a,bool mixed) -{ - char slask[100]; // l2ip temporary - *slask = 0; - unsigned int prev = 0; - bool skipped = false; - bool ok_to_skip = true; - if (mixed) - { - unsigned short x; - unsigned short addr16[8]; - memcpy(addr16, &a, sizeof(addr16)); - for (size_t i = 0; i < 6; i++) - { - x = ntohs(addr16[i]); - if (*slask && (x || !ok_to_skip || prev)) - strcat(slask,":"); - if (x || !ok_to_skip) - { - sprintf(slask + strlen(slask),"%x", x); - if (x && skipped) - ok_to_skip = false; - } - else - { - skipped = true; - } - prev = x; - } - x = ntohs(addr16[6]); - sprintf(slask + strlen(slask),":%u.%u",x / 256,x & 255); - x = ntohs(addr16[7]); - sprintf(slask + strlen(slask),".%u.%u",x / 256,x & 255); - } - else - { - struct sockaddr_in6 sa; - memset(&sa, 0, sizeof(sa)); - sa.sin6_family = AF_INET6; - sa.sin6_addr = a; - std::string name; - Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name, NI_NUMERICHOST); - return name; - } - return slask; -} - -void Ipv6Address::SetAddress(struct sockaddr *sa) -{ - memcpy(&m_addr, sa, sizeof(struct sockaddr_in6)); -} - -int Ipv6Address::GetFamily() -{ - return m_addr.sin6_family; -} - -void Ipv6Address::SetFlowinfo(uint32_t x) -{ - m_addr.sin6_flowinfo = x; -} - -uint32_t Ipv6Address::GetFlowinfo() -{ - return m_addr.sin6_flowinfo; -} - -#ifndef _WIN32 -void Ipv6Address::SetScopeId(uint32_t x) -{ - m_addr.sin6_scope_id = x; -} - -uint32_t Ipv6Address::GetScopeId() -{ - return m_addr.sin6_scope_id; -} -#endif - -bool Ipv6Address::IsValid() -{ - return m_valid; -} - -bool Ipv6Address::operator==(SocketAddress& a) -{ - if (a.GetFamily() != GetFamily()) - return false; - if ((socklen_t)a != sizeof(m_addr)) - return false; - struct sockaddr *sa = a; - struct sockaddr_in6 *p = (struct sockaddr_in6 *)sa; - if (p -> sin6_port != m_addr.sin6_port) - return false; - if (memcmp(&p -> sin6_addr, &m_addr.sin6_addr, sizeof(struct in6_addr))) - return false; - return true; -} - -std::auto_ptr Ipv6Address::GetCopy() -{ - return std::auto_ptr(new Ipv6Address(m_addr)); -} - -std::string Ipv6Address::Reverse() -{ - std::string tmp; - Reverse(m_addr.sin6_addr, tmp); - return tmp; -} - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif -#endif // IPPROTO_IPV6 -#endif // ENABLE_IPV6 - - diff --git a/dep/src/sockets/Lock.cpp b/dep/src/sockets/Lock.cpp deleted file mode 100644 index b75664cfbdc..00000000000 --- a/dep/src/sockets/Lock.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** \file Lock.cpp - ** \date 2005-08-22 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2005,2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Mutex.h" -#include "Lock.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -Lock::Lock(Mutex& m) : m_mutex(m) -{ - m_mutex.Lock(); -} - -Lock::~Lock() -{ - m_mutex.Unlock(); -} - - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/Mutex.cpp b/dep/src/sockets/Mutex.cpp deleted file mode 100644 index 681e85cee5b..00000000000 --- a/dep/src/sockets/Mutex.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** \file Mutex.cpp - ** \date 2004-10-30 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Mutex.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -Mutex::Mutex() -{ -#ifdef _WIN32 - m_mutex = ::CreateMutex(NULL, FALSE, NULL); -#else - pthread_mutex_init(&m_mutex, NULL); -#endif -} - -Mutex::~Mutex() -{ -#ifdef _WIN32 - ::CloseHandle(m_mutex); -#else - pthread_mutex_destroy(&m_mutex); -#endif -} - -void Mutex::Lock() -{ -#ifdef _WIN32 - /*DWORD d =*/ WaitForSingleObject(m_mutex, INFINITE); - /// \todo check 'd' for result -#else - pthread_mutex_lock(&m_mutex); -#endif -} - -void Mutex::Unlock() -{ -#ifdef _WIN32 - ::ReleaseMutex(m_mutex); -#else - pthread_mutex_unlock(&m_mutex); -#endif -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/Parse.cpp b/dep/src/sockets/Parse.cpp deleted file mode 100644 index 2967859f23d..00000000000 --- a/dep/src/sockets/Parse.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/** \file Parse.cpp - parse a string - ** - ** Written: 1999-Feb-10 grymse@alhem.net - **/ - -/* -Copyright (C) 1999-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include -#include - -#include "Parse.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -/* implementation of class Parse */ - -Parse::Parse() -:pa_the_str("") -,pa_splits("") -,pa_ord("") -,pa_the_ptr(0) -,pa_breakchar(0) -,pa_enable(0) -,pa_disable(0) -,pa_nospace(0) -,pa_quote(false) -{ -} - -Parse::Parse(const std::string&s) -:pa_the_str(s) -,pa_splits("") -,pa_ord("") -,pa_the_ptr(0) -,pa_breakchar(0) -,pa_enable(0) -,pa_disable(0) -,pa_nospace(0) -,pa_quote(false) -{ -} - -Parse::Parse(const std::string&s,const std::string&sp) -:pa_the_str(s) -,pa_splits(sp) -,pa_ord("") -,pa_the_ptr(0) -,pa_breakchar(0) -,pa_enable(0) -,pa_disable(0) -,pa_nospace(0) -,pa_quote(false) -{ -} - -Parse::Parse(const std::string&s,const std::string&sp,short /*nospace*/) -:pa_the_str(s) -,pa_splits(sp) -,pa_ord("") -,pa_the_ptr(0) -,pa_breakchar(0) -,pa_enable(0) -,pa_disable(0) -,pa_nospace(1) -,pa_quote(false) -{ -} - -Parse::~Parse() -{ -} - -#define C ((pa_the_ptr l(h); - - if (l.Bind("127.0.0.1", m_port)) - { - return; - } - h.Add(&l); - - m_ready = true; - while (!m_quit && IsRunning() ) - { - h.Select(0, 500000); - } - SetRunning(false); -} - -void ResolvServer::Quit() -{ - m_quit = true; -} - -bool ResolvServer::Ready() -{ - return m_ready; -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // ENABLE_RESOLVER - - diff --git a/dep/src/sockets/ResolvSocket.cpp b/dep/src/sockets/ResolvSocket.cpp deleted file mode 100644 index 636de276426..00000000000 --- a/dep/src/sockets/ResolvSocket.cpp +++ /dev/null @@ -1,426 +0,0 @@ -/** \file ResolvSocket.cpp - ** \date 2005-03-24 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifdef _WIN32 -#ifdef _MSC_VER -#pragma warning(disable:4786) -#pragma warning(disable:4503) -#endif -#else -#include -#endif -#include "ResolvSocket.h" -#ifdef ENABLE_RESOLVER -#include "Utility.h" -#include "Parse.h" -#include "ISocketHandler.h" -#include "Lock.h" -#include "Mutex.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -//#ifdef _DEBUG -//#define DEB(x) x -//#else -#define DEB(x) -//#endif - -// static -ResolvSocket::cache_t ResolvSocket::m_cache; -ResolvSocket::timeout_t ResolvSocket::m_cache_to; -Mutex ResolvSocket::m_cache_mutex; - -ResolvSocket::ResolvSocket(ISocketHandler& h) -:TcpSocket(h) -,m_bServer(false) -,m_parent(NULL) -#ifdef ENABLE_IPV6 -,m_resolve_ipv6(false) -#endif -,m_cached(false) -{ - SetLineProtocol(); -} - -ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, const std::string& host, port_t port, bool ipv6) -:TcpSocket(h) -,m_bServer(false) -,m_parent(parent) -,m_resolv_host(host) -,m_resolv_port(port) -#ifdef ENABLE_IPV6 -,m_resolve_ipv6(ipv6) -#endif -,m_cached(false) -{ - SetLineProtocol(); -} - -ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, ipaddr_t a) -:TcpSocket(h) -,m_bServer(false) -,m_parent(parent) -,m_resolv_port(0) -,m_resolv_address(a) -#ifdef ENABLE_IPV6 -,m_resolve_ipv6(false) -#endif -,m_cached(false) -{ - SetLineProtocol(); -} - -#ifdef ENABLE_IPV6 -ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, in6_addr& a) -:TcpSocket(h) -,m_bServer(false) -,m_parent(parent) -,m_resolv_port(0) -,m_resolve_ipv6(true) -,m_resolv_address6(a) -,m_cached(false) -{ - SetLineProtocol(); -} -#endif - -ResolvSocket::~ResolvSocket() -{ -} - -void ResolvSocket::OnLine(const std::string& line) -{ - Parse pa(line, ":"); - if (m_bServer) - { - m_query = pa.getword(); - m_data = pa.getrest(); -DEB( fprintf(stderr, " *** ResolvSocket server; query=%s, data=%s\n", m_query.c_str(), m_data.c_str());) - // %! check cache - { - Lock lock(m_cache_mutex); - if (m_cache[m_query].find(m_data) != m_cache[m_query].end()) - { - if (time(NULL) - m_cache_to[m_query][m_data] < 3600) // ttl - { - std::string result = m_cache[m_query][m_data]; -DEB(fprintf(stderr, " *** Returning cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), result.c_str());) - Send("Cached\n"); - if (!result.size()) /* failed */ - { - Send("Failed\n\n"); - SetCloseAndDelete(); - return; - } - else - if (m_query == "gethostbyname") - { - Send("A: " + result + "\n\n"); - SetCloseAndDelete(); - return; - } - else -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (m_query == "gethostbyname2") - { - Send("AAAA: " + result + "\n\n"); - SetCloseAndDelete(); - return; - } - else -#endif -#endif - if (m_query == "gethostbyaddr") - { - Send("Name: " + result + "\n\n"); - SetCloseAndDelete(); - return; - } - } - } - } - if (!Detach()) // detach failed? - { - SetCloseAndDelete(); - } - return; - } - std::string key = pa.getword(); - std::string value = pa.getrest(); -DEB( fprintf(stderr, " *** ResolvSocket response; %s: %s\n", key.c_str(), value.c_str());) - - if (key == "Cached") - { - m_cached = true; - } - else - if (key == "Failed" && m_parent) - { -DEB( fprintf(stderr, " ************ Resolve failed\n");) - if (Handler().Resolving(m_parent) || Handler().Valid(m_parent)) - { - m_parent -> OnResolveFailed(m_resolv_id); - } - // update cache - if (!m_cached) - { - Lock lock(m_cache_mutex); -DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());) - m_cache[m_query][m_data] = value; - m_cache_to[m_query][m_data] = time(NULL); - } - m_parent = NULL; - } - else - if (key == "Name" && !m_resolv_host.size() && m_parent) - { - if (Handler().Resolving(m_parent) || Handler().Valid(m_parent)) - { - m_parent -> OnReverseResolved(m_resolv_id, value); - } - // update cache - if (!m_cached) - { - Lock lock(m_cache_mutex); -DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());) - m_cache[m_query][m_data] = value; - m_cache_to[m_query][m_data] = time(NULL); - } - m_parent = NULL; - } - else - if (key == "A" && m_parent) - { - if (Handler().Resolving(m_parent) || Handler().Valid(m_parent)) - { - ipaddr_t l; - Utility::u2ip(value, l); // ip2ipaddr_t - m_parent -> OnResolved(m_resolv_id, l, m_resolv_port); - } - // update cache - if (!m_cached) - { - Lock lock(m_cache_mutex); -DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());) - m_cache[m_query][m_data] = value; - m_cache_to[m_query][m_data] = time(NULL); - } - m_parent = NULL; // always use first ip in case there are several - } -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - else - if (key == "AAAA" && m_parent) - { - if (Handler().Resolving(m_parent) || Handler().Valid(m_parent)) - { - in6_addr a; - Utility::u2ip(value, a); - m_parent -> OnResolved(m_resolv_id, a, m_resolv_port); - } - // update cache - if (!m_cached) - { - Lock lock(m_cache_mutex); -DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());) - m_cache[m_query][m_data] = value; - m_cache_to[m_query][m_data] = time(NULL); - } - m_parent = NULL; - } -#endif -#endif -} - -void ResolvSocket::OnDetached() -{ -DEB( fprintf(stderr, " *** ResolvSocket::OnDetached(); query=%s, data=%s\n", m_query.c_str(), m_data.c_str());) - if (m_query == "gethostbyname") - { - struct sockaddr_in sa; - if (Utility::u2ip(m_data, sa)) - { - std::string ip; - Utility::l2ip(sa.sin_addr, ip); - Send("A: " + ip + "\n"); - } - else - { - Send("Failed\n"); - } - Send("\n"); - } - else -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (m_query == "gethostbyname2") - { - struct sockaddr_in6 sa; - if (Utility::u2ip(m_data, sa)) - { - std::string ip; - Utility::l2ip(sa.sin6_addr, ip); - Send("AAAA: " + ip + "\n"); - } - else - { - Send("Failed\n"); - } - Send("\n"); - } - else -#endif -#endif - if (m_query == "gethostbyaddr") - { - if (Utility::isipv4( m_data )) - { - struct sockaddr_in sa; - if (!Utility::u2ip(m_data, sa, AI_NUMERICHOST)) - { - Send("Failed: convert to sockaddr_in failed\n"); - } - else - { - std::string name; - if (!Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), name)) - { - Send("Failed: ipv4 reverse lookup of " + m_data + "\n"); - } - else - { - Send("Name: " + name + "\n"); - } - } - } - else -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (Utility::isipv6( m_data )) - { - struct sockaddr_in6 sa; - if (!Utility::u2ip(m_data, sa, AI_NUMERICHOST)) - { - Send("Failed: convert to sockaddr_in6 failed\n"); - } - else - { - std::string name; - if (!Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), name)) - { - Send("Failed: ipv6 reverse lookup of " + m_data + "\n"); - } - else - { - Send("Name: " + name + "\n"); - } - } - } - else -#endif -#endif - { - Send("Failed: malformed address\n"); - } - Send("\n"); - } - else - { - std::string msg = "Unknown query type: " + m_query; - Handler().LogError(this, "OnDetached", 0, msg); - Send("Unknown\n\n"); - } - SetCloseAndDelete(); -} - -void ResolvSocket::OnConnect() -{ - if (!m_resolv_host.empty()) - { -#ifdef ENABLE_IPV6 - std::string msg = (m_resolve_ipv6 ? "gethostbyname2 " : "gethostbyname ") + m_resolv_host + "\n"; - m_query = m_resolve_ipv6 ? "gethostbyname2" : "gethostbyname"; -#else - std::string msg = "gethostbyname " + m_resolv_host + "\n"; - m_query = "gethostbyname"; -#endif - m_data = m_resolv_host; - Send( msg ); - return; - } -#ifdef ENABLE_IPV6 - if (m_resolve_ipv6) - { - std::string tmp; - Utility::l2ip(m_resolv_address6, tmp); - m_query = "gethostbyaddr"; - m_data = tmp; - std::string msg = "gethostbyaddr " + tmp + "\n"; - Send( msg ); - } -#endif - std::string tmp; - Utility::l2ip(m_resolv_address, tmp); - m_query = "gethostbyaddr"; - m_data = tmp; - std::string msg = "gethostbyaddr " + tmp + "\n"; - Send( msg ); -} - -void ResolvSocket::OnDelete() -{ - if (m_parent) - { - if (Handler().Resolving(m_parent) || Handler().Valid(m_parent)) - { - m_parent -> OnResolveFailed(m_resolv_id); - } - // update cache - if (!m_cached) - { - Lock lock(m_cache_mutex); - std::string value; -DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());) - m_cache[m_query][m_data] = value; - m_cache_to[m_query][m_data] = time(NULL); - } - m_parent = NULL; - } -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - -#endif // ENABLE_RESOLVER - - diff --git a/dep/src/sockets/Socket.cpp b/dep/src/sockets/Socket.cpp deleted file mode 100644 index f53cd27621e..00000000000 --- a/dep/src/sockets/Socket.cpp +++ /dev/null @@ -1,1726 +0,0 @@ -/** \file Socket.cpp - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Socket.h" -#ifdef _WIN32 -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif -#include -#else -#include -#include -#endif -#include -#include - -#include "ISocketHandler.h" -#include "Utility.h" - -#include "SocketAddress.h" -#include "SocketHandler.h" -#ifdef ENABLE_EXCEPTIONS -#include "Exception.h" -#endif -#include "Ipv4Address.h" - -//#ifdef _DEBUG -//#define DEB(x) x; fflush(stderr); -//#else -#define DEB(x) -//#endif - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -// statics -#ifdef _WIN32 -WSAInitializer Socket::m_winsock_init; -#endif - -Socket::Socket(ISocketHandler& h) -//:m_flags(0) -:m_handler(h) -,m_socket( INVALID_SOCKET ) -,m_bDel(false) -,m_bClose(false) -,m_tCreate(time(NULL)) -,m_parent(NULL) -,m_b_disable_read(false) -,m_connected(false) -,m_b_erased_by_handler(false) -,m_tClose(0) -,m_client_remote_address(NULL) -,m_remote_address(NULL) -,m_traffic_monitor(NULL) -,m_bLost(false) -#ifdef HAVE_OPENSSL -,m_b_enable_ssl(false) -,m_b_ssl(false) -,m_b_ssl_server(false) -#endif -#ifdef ENABLE_IPV6 -,m_ipv6(false) -#endif -#ifdef ENABLE_POOL -,m_socket_type(0) -,m_bClient(false) -,m_bRetain(false) -#endif -#ifdef ENABLE_SOCKS4 -,m_bSocks4(false) -,m_socks4_host(h.GetSocks4Host()) -,m_socks4_port(h.GetSocks4Port()) -,m_socks4_userid(h.GetSocks4Userid()) -#endif -#ifdef ENABLE_DETACH -,m_detach(false) -,m_detached(false) -,m_pThread(NULL) -,m_slave_handler(NULL) -#endif -{ -} - -Socket::~Socket() -{ - Handler().Remove(this); - if (m_socket != INVALID_SOCKET -#ifdef ENABLE_POOL - && !m_bRetain -#endif - ) - { - Close(); - } -} - -void Socket::Init() -{ -} - -void Socket::OnRead() -{ -} - -void Socket::OnWrite() -{ -} - -void Socket::OnException() -{ - // %! exception doesn't always mean something bad happened, this code should be reworked - // errno valid here? - int err = SoError(); - Handler().LogError(this, "exception on select", err, StrError(err), LOG_LEVEL_FATAL); - SetCloseAndDelete(); -} - -void Socket::OnDelete() -{ -} - -void Socket::OnConnect() -{ -} - -void Socket::OnAccept() -{ -} - -int Socket::Close() -{ - if (m_socket == INVALID_SOCKET) // this could happen - { - Handler().LogError(this, "Socket::Close", 0, "file descriptor invalid", LOG_LEVEL_WARNING); - return 0; - } - int n; - if ((n = closesocket(m_socket)) == -1) - { - // failed... - Handler().LogError(this, "close", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - Handler().Set(m_socket, false, false, false); // remove from fd_set's - Handler().AddList(m_socket, LIST_CALLONCONNECT, false); -#ifdef ENABLE_DETACH - Handler().AddList(m_socket, LIST_DETACH, false); -#endif - Handler().AddList(m_socket, LIST_TIMEOUT, false); - Handler().AddList(m_socket, LIST_RETRY, false); - Handler().AddList(m_socket, LIST_CLOSE, false); - m_socket = INVALID_SOCKET; - return n; -} - -SOCKET Socket::CreateSocket(int af,int type, const std::string& protocol) -{ - struct protoent *p = NULL; - SOCKET s; - -#ifdef ENABLE_POOL - m_socket_type = type; - m_socket_protocol = protocol; -#endif - if (!protocol.empty()) - { - p = getprotobyname( protocol.c_str() ); - if (!p) - { - Handler().LogError(this, "getprotobyname", Errno, StrError(Errno), LOG_LEVEL_FATAL); - SetCloseAndDelete(); -#ifdef ENABLE_EXCEPTIONS - throw Exception(std::string("getprotobyname() failed: ") + StrError(Errno)); -#endif - return INVALID_SOCKET; - } - } - int protno = p ? p -> p_proto : 0; - - s = socket(af, type, protno); - if (s == INVALID_SOCKET) - { - Handler().LogError(this, "socket", Errno, StrError(Errno), LOG_LEVEL_FATAL); - SetCloseAndDelete(); -#ifdef ENABLE_EXCEPTIONS - throw Exception(std::string("socket() failed: ") + StrError(Errno)); -#endif - return INVALID_SOCKET; - } - Attach(s); - OnOptions(af, type, protno, s); - Attach(INVALID_SOCKET); - return s; -} - -void Socket::Attach(SOCKET s) -{ - m_socket = s; -} - -SOCKET Socket::GetSocket() -{ - return m_socket; -} - -void Socket::SetDeleteByHandler(bool x) -{ - m_bDel = x; -} - -bool Socket::DeleteByHandler() -{ - return m_bDel; -} - -void Socket::SetCloseAndDelete(bool x) -{ - if (x != m_bClose) - { - Handler().AddList(m_socket, LIST_CLOSE, x); - m_bClose = x; - if (x) - { - m_tClose = time(NULL); - } - } -} - -bool Socket::CloseAndDelete() -{ - return m_bClose; -} - -void Socket::SetRemoteAddress(SocketAddress& ad) //struct sockaddr* sa, socklen_t l) -{ - m_remote_address = ad.GetCopy(); -} - -std::auto_ptr Socket::GetRemoteSocketAddress() -{ - return m_remote_address -> GetCopy(); -} - -ISocketHandler& Socket::Handler() const -{ -#ifdef ENABLE_DETACH - if (IsDetached()) - return *m_slave_handler; -#endif - return m_handler; -} - -ISocketHandler& Socket::MasterHandler() const -{ - return m_handler; -} - -ipaddr_t Socket::GetRemoteIP4() -{ - ipaddr_t l = 0; -#ifdef ENABLE_IPV6 - if (m_ipv6) - { - Handler().LogError(this, "GetRemoteIP4", 0, "get ipv4 address for ipv6 socket", LOG_LEVEL_WARNING); - } -#endif - if (m_remote_address.get() != NULL) - { - struct sockaddr *p = *m_remote_address; - struct sockaddr_in *sa = (struct sockaddr_in *)p; - memcpy(&l, &sa -> sin_addr, sizeof(struct in_addr)); - } - return l; -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -struct in6_addr Socket::GetRemoteIP6() -{ - if (!m_ipv6) - { - Handler().LogError(this, "GetRemoteIP6", 0, "get ipv6 address for ipv4 socket", LOG_LEVEL_WARNING); - } - struct sockaddr_in6 fail; - if (m_remote_address.get() != NULL) - { - struct sockaddr *p = *m_remote_address; - memcpy(&fail, p, sizeof(struct sockaddr_in6)); - } - else - { - memset(&fail, 0, sizeof(struct sockaddr_in6)); - } - return fail.sin6_addr; -} -#endif -#endif - -port_t Socket::GetRemotePort() -{ - if (!m_remote_address.get()) - { - return 0; - } - return m_remote_address -> GetPort(); -} - -std::string Socket::GetRemoteAddress() -{ - if (!m_remote_address.get()) - { - return ""; - } - return m_remote_address -> Convert(false); -} - -std::string Socket::GetRemoteHostname() -{ - if (!m_remote_address.get()) - { - return ""; - } - return m_remote_address -> Reverse(); -} - -bool Socket::SetNonblocking(bool bNb) -{ -#ifdef _WIN32 - unsigned long l = bNb ? 1 : 0; - int n = ioctlsocket(m_socket, FIONBIO, &l); - if (n != 0) - { - Handler().LogError(this, "ioctlsocket(FIONBIO)", Errno, ""); - return false; - } - return true; -#else - if (bNb) - { - if (fcntl(m_socket, F_SETFL, O_NONBLOCK) == -1) - { - Handler().LogError(this, "fcntl(F_SETFL, O_NONBLOCK)", Errno, StrError(Errno), LOG_LEVEL_ERROR); - return false; - } - } - else - { - if (fcntl(m_socket, F_SETFL, 0) == -1) - { - Handler().LogError(this, "fcntl(F_SETFL, 0)", Errno, StrError(Errno), LOG_LEVEL_ERROR); - return false; - } - } - return true; -#endif -} - -bool Socket::SetNonblocking(bool bNb, SOCKET s) -{ -#ifdef _WIN32 - unsigned long l = bNb ? 1 : 0; - int n = ioctlsocket(s, FIONBIO, &l); - if (n != 0) - { - Handler().LogError(this, "ioctlsocket(FIONBIO)", Errno, ""); - return false; - } - return true; -#else - if (bNb) - { - if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) - { - Handler().LogError(this, "fcntl(F_SETFL, O_NONBLOCK)", Errno, StrError(Errno), LOG_LEVEL_ERROR); - return false; - } - } - else - { - if (fcntl(s, F_SETFL, 0) == -1) - { - Handler().LogError(this, "fcntl(F_SETFL, 0)", Errno, StrError(Errno), LOG_LEVEL_ERROR); - return false; - } - } - return true; -#endif -} - -void Socket::Set(bool bRead, bool bWrite, bool bException) -{ - Handler().Set(m_socket, bRead, bWrite, bException); -} - -bool Socket::Ready() -{ - if (m_socket != INVALID_SOCKET && !CloseAndDelete()) - return true; - return false; -} - -void Socket::OnLine(const std::string& ) -{ -} - -void Socket::OnConnectFailed() -{ -} - -Socket *Socket::GetParent() -{ - return m_parent; -} - -void Socket::SetParent(Socket *x) -{ - m_parent = x; -} - -port_t Socket::GetPort() -{ - Handler().LogError(this, "GetPort", 0, "GetPort only implemented for ListenSocket", LOG_LEVEL_WARNING); - return 0; -} - -bool Socket::OnConnectRetry() -{ - return true; -} - -#ifdef ENABLE_RECONNECT -void Socket::OnReconnect() -{ -} -#endif - -time_t Socket::Uptime() -{ - return time(NULL) - m_tCreate; -} - -#ifdef ENABLE_IPV6 -void Socket::SetIpv6(bool x) -{ - m_ipv6 = x; -} - -bool Socket::IsIpv6() -{ - return m_ipv6; -} -#endif - -void Socket::DisableRead(bool x) -{ - m_b_disable_read = x; -} - -bool Socket::IsDisableRead() -{ - return m_b_disable_read; -} - -void Socket::SendBuf(const char *,size_t,int) -{ -} - -void Socket::Send(const std::string&,int) -{ -} - -void Socket::SetConnected(bool x) -{ - m_connected = x; -} - -bool Socket::IsConnected() -{ - return m_connected; -} - -void Socket::OnDisconnect() -{ -} - -void Socket::SetLost() -{ - m_bLost = true; -} - -bool Socket::Lost() -{ - return m_bLost; -} - -void Socket::SetErasedByHandler(bool x) -{ - m_b_erased_by_handler = x; -} - -bool Socket::ErasedByHandler() -{ - return m_b_erased_by_handler; -} - -time_t Socket::TimeSinceClose() -{ - return time(NULL) - m_tClose; -} - -void Socket::SetClientRemoteAddress(SocketAddress& ad) -{ - if (!ad.IsValid()) - { - Handler().LogError(this, "SetClientRemoteAddress", 0, "remote address not valid", LOG_LEVEL_ERROR); - } - m_client_remote_address = ad.GetCopy(); -} - -std::auto_ptr Socket::GetClientRemoteAddress() -{ - if (!m_client_remote_address.get()) - { - Handler().LogError(this, "GetClientRemoteAddress", 0, "remote address not yet set", LOG_LEVEL_ERROR); - } - return m_client_remote_address -> GetCopy(); -} - -uint64_t Socket::GetBytesSent(bool) -{ - return 0; -} - -uint64_t Socket::GetBytesReceived(bool) -{ - return 0; -} - -#ifdef HAVE_OPENSSL -void Socket::OnSSLConnect() -{ -} - -void Socket::OnSSLAccept() -{ -} - -bool Socket::SSLNegotiate() -{ - return false; -} - -bool Socket::IsSSL() -{ - return m_b_enable_ssl; -} - -void Socket::EnableSSL(bool x) -{ - m_b_enable_ssl = x; -} - -bool Socket::IsSSLNegotiate() -{ - return m_b_ssl; -} - -void Socket::SetSSLNegotiate(bool x) -{ - m_b_ssl = x; -} - -bool Socket::IsSSLServer() -{ - return m_b_ssl_server; -} - -void Socket::SetSSLServer(bool x) -{ - m_b_ssl_server = x; -} - -void Socket::OnSSLConnectFailed() -{ -} - -void Socket::OnSSLAcceptFailed() -{ -} -#endif // HAVE_OPENSSL - -#ifdef ENABLE_POOL -void Socket::CopyConnection(Socket *sock) -{ - Attach( sock -> GetSocket() ); -#ifdef ENABLE_IPV6 - SetIpv6( sock -> IsIpv6() ); -#endif - SetSocketType( sock -> GetSocketType() ); - SetSocketProtocol( sock -> GetSocketProtocol() ); - - SetClientRemoteAddress( *sock -> GetClientRemoteAddress() ); - SetRemoteAddress( *sock -> GetRemoteSocketAddress() ); -} - -void Socket::SetIsClient() -{ - m_bClient = true; -} - -void Socket::SetSocketType(int x) -{ - m_socket_type = x; -} - -int Socket::GetSocketType() -{ - return m_socket_type; -} - -void Socket::SetSocketProtocol(const std::string& x) -{ - m_socket_protocol = x; -} - -const std::string& Socket::GetSocketProtocol() -{ - return m_socket_protocol; -} - -void Socket::SetRetain() -{ - if (m_bClient) m_bRetain = true; -} - -bool Socket::Retain() -{ - return m_bRetain; -} - -#endif // ENABLE_POOL - -#ifdef ENABLE_SOCKS4 -void Socket::OnSocks4Connect() -{ - Handler().LogError(this, "OnSocks4Connect", 0, "Use with TcpSocket only"); -} - -void Socket::OnSocks4ConnectFailed() -{ - Handler().LogError(this, "OnSocks4ConnectFailed", 0, "Use with TcpSocket only"); -} - -bool Socket::OnSocks4Read() -{ - Handler().LogError(this, "OnSocks4Read", 0, "Use with TcpSocket only"); - return true; -} - -void Socket::SetSocks4Host(const std::string& host) -{ - Utility::u2ip(host, m_socks4_host); -} - -bool Socket::Socks4() -{ - return m_bSocks4; -} - -void Socket::SetSocks4(bool x) -{ - m_bSocks4 = x; -} - -void Socket::SetSocks4Host(ipaddr_t a) -{ - m_socks4_host = a; -} - -void Socket::SetSocks4Port(port_t p) -{ - m_socks4_port = p; -} - -void Socket::SetSocks4Userid(const std::string& x) -{ - m_socks4_userid = x; -} - -ipaddr_t Socket::GetSocks4Host() -{ - return m_socks4_host; -} - -port_t Socket::GetSocks4Port() -{ - return m_socks4_port; -} - -const std::string& Socket::GetSocks4Userid() -{ - return m_socks4_userid; -} -#endif // ENABLE_SOCKS4 - -#ifdef ENABLE_DETACH -bool Socket::Detach() -{ - if (!DeleteByHandler()) - return false; - if (m_pThread) - return false; - if (m_detached) - return false; - SetDetach(); - return true; -} - -void Socket::DetachSocket() -{ - SetDetached(); - m_pThread = new SocketThread(this); - m_pThread -> SetRelease(true); -} - -void Socket::OnDetached() -{ -} - -void Socket::SetDetach(bool x) -{ - Handler().AddList(m_socket, LIST_DETACH, x); - m_detach = x; -} - -bool Socket::IsDetach() -{ - return m_detach; -} - -void Socket::SetDetached(bool x) -{ - m_detached = x; -} - -const bool Socket::IsDetached() const -{ - return m_detached; -} - -void Socket::SetSlaveHandler(ISocketHandler *p) -{ - m_slave_handler = p; -} - -Socket::SocketThread::SocketThread(Socket *p) -:Thread(false) -,m_socket(p) -{ - // Creator will release -} - -Socket::SocketThread::~SocketThread() -{ - if (IsRunning()) - { - SetRelease(true); - SetRunning(false); -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } -} - -void Socket::SocketThread::Run() -{ - SocketHandler h; - h.SetSlave(); - h.Add(m_socket); - m_socket -> SetSlaveHandler(&h); - m_socket -> OnDetached(); - while (h.GetCount() && IsRunning()) - { - h.Select(0, 500000); - } - // m_socket now deleted oops - // yeah oops m_socket delete its socket thread, that means this - // so Socket will no longer delete its socket thread, instead we do this: - SetDeleteOnExit(); -} -#endif // ENABLE_DETACH - -#ifdef ENABLE_RESOLVER -int Socket::Resolve(const std::string& host,port_t port) -{ - return Handler().Resolve(this, host, port); -} - -#ifdef ENABLE_IPV6 -int Socket::Resolve6(const std::string& host,port_t port) -{ - return Handler().Resolve6(this, host, port); -} -#endif - -int Socket::Resolve(ipaddr_t a) -{ - return Handler().Resolve(this, a); -} - -#ifdef ENABLE_IPV6 -int Socket::Resolve(in6_addr& a) -{ - return Handler().Resolve(this, a); -} -#endif - -void Socket::OnResolved(int,ipaddr_t,port_t) -{ -} - -#ifdef ENABLE_IPV6 -void Socket::OnResolved(int,in6_addr&,port_t) -{ -} -#endif - -void Socket::OnReverseResolved(int,const std::string&) -{ -} - -void Socket::OnResolveFailed(int) -{ -} -#endif // ENABLE_RESOLVER - -/* IP options */ - -bool Socket::SetIpOptions(const void *p, socklen_t len) -{ -#ifdef IP_OPTIONS - if (setsockopt(GetSocket(), IPPROTO_IP, IP_OPTIONS, (char *)p, len) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_OPTIONS)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_OPTIONS", LOG_LEVEL_INFO); - return false; -#endif -} - -#ifdef IP_PKTINFO -bool Socket::SetIpPktinfo(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_PKTINFO, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_PKTINFO)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef IP_RECVTOS -bool Socket::SetIpRecvTOS(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVTOS, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVTOS)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef IP_RECVTTL -bool Socket::SetIpRecvTTL(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVTTL, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVTTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef IP_RECVOPTS -bool Socket::SetIpRecvopts(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVOPTS, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVOPTS)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef IP_RETOPTS -bool Socket::SetIpRetopts(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_RETOPTS, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RETOPTS)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -bool Socket::SetIpTOS(unsigned char tos) -{ -#ifdef IP_TOS - if (setsockopt(GetSocket(), IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(tos)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_TOS)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_TOS", LOG_LEVEL_INFO); - return false; -#endif -} - -unsigned char Socket::IpTOS() -{ - unsigned char tos = 0; -#ifdef IP_TOS - socklen_t len = sizeof(tos); - if (getsockopt(GetSocket(), IPPROTO_IP, IP_TOS, (char *)&tos, &len) == -1) - { - Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_TOS)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "ip option not available", 0, "IP_TOS", LOG_LEVEL_INFO); -#endif - return tos; -} - -bool Socket::SetIpTTL(int ttl) -{ -#ifdef IP_TTL - if (setsockopt(GetSocket(), IPPROTO_IP, IP_TTL, (char *)&ttl, sizeof(ttl)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_TTL", LOG_LEVEL_INFO); - return false; -#endif -} - -int Socket::IpTTL() -{ - int ttl = 0; -#ifdef IP_TTL - socklen_t len = sizeof(ttl); - if (getsockopt(GetSocket(), IPPROTO_IP, IP_TTL, (char *)&ttl, &len) == -1) - { - Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "ip option not available", 0, "IP_TTL", LOG_LEVEL_INFO); -#endif - return ttl; -} - -bool Socket::SetIpHdrincl(bool x) -{ -#ifdef IP_HDRINCL - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_HDRINCL, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_HDRINCL)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_HDRINCL", LOG_LEVEL_INFO); - return false; -#endif -} - -#ifdef IP_RECVERR -bool Socket::SetIpRecverr(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVERR, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVERR)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef IP_MTU_DISCOVER -bool Socket::SetIpMtudiscover(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_MTU_DISCOVER, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_MTU_DISCOVER)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef IP_MTU -int Socket::IpMtu() -{ - int mtu = 0; - socklen_t len = sizeof(mtu); - if (getsockopt(GetSocket(), IPPROTO_IP, IP_MTU, (char *)&mtu, &len) == -1) - { - Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_MTU)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } - return mtu; -} -#endif - -#ifdef IP_ROUTER_ALERT -bool Socket::SetIpRouterAlert(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_ROUTER_ALERT, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_ROUTER_ALERT)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -bool Socket::SetIpMulticastTTL(int ttl) -{ -#ifdef IP_MULTICAST_TTL - if (setsockopt(GetSocket(), IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(ttl)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_MULTICAST_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_MULTICAST_TTL", LOG_LEVEL_INFO); - return false; -#endif -} - -int Socket::IpMulticastTTL() -{ - int ttl = 0; -#ifdef IP_MULTICAST_TTL - socklen_t len = sizeof(ttl); - if (getsockopt(GetSocket(), IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, &len) == -1) - { - Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_MULTICAST_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "ip option not available", 0, "IP_MULTICAST_TTL", LOG_LEVEL_INFO); -#endif - return ttl; -} - -bool Socket::SetMulticastLoop(bool x) -{ -#ifdef IP_MULTICAST_LOOP - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_MULTICAST_LOOP)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_MULTICAST_LOOP", LOG_LEVEL_INFO); - return false; -#endif -} - -#ifdef LINUX -bool Socket::IpAddMembership(struct ip_mreqn& ref) -{ -#ifdef IP_ADD_MEMBERSHIP - if (setsockopt(GetSocket(), IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreqn)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_ADD_MEMBERSHIP", LOG_LEVEL_INFO); - return false; -#endif -} -#endif - -bool Socket::IpAddMembership(struct ip_mreq& ref) -{ -#ifdef IP_ADD_MEMBERSHIP - if (setsockopt(GetSocket(), IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreq)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_ADD_MEMBERSHIP", LOG_LEVEL_INFO); - return false; -#endif -} - -#ifdef LINUX -bool Socket::IpDropMembership(struct ip_mreqn& ref) -{ -#ifdef IP_DROP_MEMBERSHIP - if (setsockopt(GetSocket(), IPPROTO_IP, IP_DROP_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreqn)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_DROP_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_DROP_MEMBERSHIP", LOG_LEVEL_INFO); - return false; -#endif -} -#endif - -bool Socket::IpDropMembership(struct ip_mreq& ref) -{ -#ifdef IP_DROP_MEMBERSHIP - if (setsockopt(GetSocket(), IPPROTO_IP, IP_DROP_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreq)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_DROP_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "ip option not available", 0, "IP_DROP_MEMBERSHIP", LOG_LEVEL_INFO); - return false; -#endif -} - -/* SOCKET options */ - -bool Socket::SetSoReuseaddr(bool x) -{ -#ifdef SO_REUSEADDR - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_REUSEADDR, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_REUSEADDR)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_REUSEADDR", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoKeepalive(bool x) -{ -#ifdef SO_KEEPALIVE - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_KEEPALIVE, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_KEEPALIVE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_KEEPALIVE", LOG_LEVEL_INFO); - return false; -#endif -} - -#ifdef SO_NOSIGPIPE -bool Socket::SetSoNosigpipe(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_NOSIGPIPE, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_NOSIGPIPE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -bool Socket::SoAcceptconn() -{ - int value = 0; -#ifdef SO_ACCEPTCONN - socklen_t len = sizeof(value); - if (getsockopt(GetSocket(), SOL_SOCKET, SO_ACCEPTCONN, (char *)&value, &len) == -1) - { - Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_ACCEPTCONN)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "socket option not available", 0, "SO_ACCEPTCONN", LOG_LEVEL_INFO); -#endif - return value ? true : false; -} - -#ifdef SO_BSDCOMPAT -bool Socket::SetSoBsdcompat(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_BSDCOMPAT, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_BSDCOMPAT)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef SO_BINDTODEVICE -bool Socket::SetSoBindtodevice(const std::string& intf) -{ - if (setsockopt(GetSocket(), SOL_SOCKET, SO_BINDTODEVICE, (char *)intf.c_str(), intf.size()) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_BINDTODEVICE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -bool Socket::SetSoBroadcast(bool x) -{ -#ifdef SO_BROADCAST - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_BROADCAST)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_BROADCAST", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoDebug(bool x) -{ -#ifdef SO_DEBUG - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_DEBUG, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_DEBUG)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_DEBUG", LOG_LEVEL_INFO); - return false; -#endif -} - -int Socket::SoError() -{ - int value = 0; -#ifdef SO_ERROR - socklen_t len = sizeof(value); - if (getsockopt(GetSocket(), SOL_SOCKET, SO_ERROR, (char *)&value, &len) == -1) - { - Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_ERROR)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "socket option not available", 0, "SO_ERROR", LOG_LEVEL_INFO); -#endif - return value; -} - -bool Socket::SetSoDontroute(bool x) -{ -#ifdef SO_DONTROUTE - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_DONTROUTE, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_DONTROUTE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_DONTROUTE", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoLinger(int onoff, int linger) -{ -#ifdef SO_LINGER - struct linger stl; - stl.l_onoff = onoff; - stl.l_linger = linger; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_LINGER, (char *)&stl, sizeof(stl)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_LINGER)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_LINGER", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoOobinline(bool x) -{ -#ifdef SO_OOBINLINE - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_OOBINLINE, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_OOBINLINE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_OOBINLINE", LOG_LEVEL_INFO); - return false; -#endif -} - -#ifdef SO_PASSCRED -bool Socket::SetSoPasscred(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_PASSCRED, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_PASSCRED)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef SO_PEERCRED -bool Socket::SoPeercred(struct ucred& ucr) -{ - if (setsockopt(GetSocket(), SOL_SOCKET, SO_PEERCRED, (char *)&ucr, sizeof(ucr)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_PEERCRED)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef SO_PRIORITY -bool Socket::SetSoPriority(int x) -{ - if (setsockopt(GetSocket(), SOL_SOCKET, SO_PRIORITY, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_PRIORITY)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -bool Socket::SetSoRcvlowat(int x) -{ -#ifdef SO_RCVLOWAT - if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVLOWAT, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVLOWAT)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_RCVLOWAT", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoSndlowat(int x) -{ -#ifdef SO_SNDLOWAT - if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDLOWAT, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDLOWAT)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_SNDLOWAT", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoRcvtimeo(struct timeval& tv) -{ -#ifdef SO_RCVTIMEO - if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVTIMEO)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_RCVTIMEO", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoSndtimeo(struct timeval& tv) -{ -#ifdef SO_SNDTIMEO - if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDTIMEO)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_SNDTIMEO", LOG_LEVEL_INFO); - return false; -#endif -} - -bool Socket::SetSoRcvbuf(int x) -{ -#ifdef SO_RCVBUF - if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVBUF, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_RCVBUF", LOG_LEVEL_INFO); - return false; -#endif -} - -int Socket::SoRcvbuf() -{ - int value = 0; -#ifdef SO_RCVBUF - socklen_t len = sizeof(value); - if (getsockopt(GetSocket(), SOL_SOCKET, SO_RCVBUF, (char *)&value, &len) == -1) - { - Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_RCVBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "socket option not available", 0, "SO_RCVBUF", LOG_LEVEL_INFO); -#endif - return value; -} - -#ifdef SO_RCVBUFFORCE -bool Socket::SetSoRcvbufforce(int x) -{ - if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVBUFFORCE, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVBUFFORCE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -bool Socket::SetSoSndbuf(int x) -{ -#ifdef SO_SNDBUF - if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDBUF, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "SO_SNDBUF", LOG_LEVEL_INFO); - return false; -#endif -} - -int Socket::SoSndbuf() -{ - int value = 0; -#ifdef SO_SNDBUF - socklen_t len = sizeof(value); - if (getsockopt(GetSocket(), SOL_SOCKET, SO_SNDBUF, (char *)&value, &len) == -1) - { - Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_SNDBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "socket option not available", 0, "SO_SNDBUF", LOG_LEVEL_INFO); -#endif - return value; -} - -#ifdef SO_SNDBUFFORCE -bool Socket::SetSoSndbufforce(int x) -{ - if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDBUFFORCE, (char *)&x, sizeof(x)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDBUFFORCE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -#ifdef SO_TIMESTAMP -bool Socket::SetSoTimestamp(bool x) -{ - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_SOCKET, SO_TIMESTAMP, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_TIMESTAMP)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -} -#endif - -int Socket::SoType() -{ - int value = 0; -#ifdef SO_TYPE - socklen_t len = sizeof(value); - if (getsockopt(GetSocket(), SOL_SOCKET, SO_TYPE, (char *)&value, &len) == -1) - { - Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_TYPE)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - } -#else - Handler().LogError(this, "socket option not available", 0, "SO_TYPE", LOG_LEVEL_INFO); -#endif - return value; -} - -#ifdef ENABLE_TRIGGERS -void Socket::Subscribe(int id) -{ - Handler().Subscribe(id, this); -} - -void Socket::Unsubscribe(int id) -{ - Handler().Unsubscribe(id, this); -} - -void Socket::OnTrigger(int, const TriggerData&) -{ -} - -void Socket::OnCancelled(int) -{ -} -#endif - -void Socket::SetTimeout(time_t secs) -{ - if (!secs) - { - Handler().AddList(m_socket, LIST_TIMEOUT, false); - return; - } - Handler().AddList(m_socket, LIST_TIMEOUT, true); - m_timeout_start = time(NULL); - m_timeout_limit = secs; -} - -void Socket::OnTimeout() -{ -} - -void Socket::OnConnectTimeout() -{ -} - -bool Socket::Timeout(time_t tnow) -{ - if (tnow - m_timeout_start > m_timeout_limit) - return true; - return false; -} - -/** Returns local port number for bound socket file descriptor. */ -port_t Socket::GetSockPort() -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - struct sockaddr_in6 sa; - socklen_t sockaddr_length = sizeof(struct sockaddr_in6); - if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1) - memset(&sa, 0, sizeof(sa)); - return ntohs(sa.sin6_port); - } -#endif -#endif - struct sockaddr_in sa; - socklen_t sockaddr_length = sizeof(struct sockaddr_in); - if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1) - memset(&sa, 0, sizeof(sa)); - return ntohs(sa.sin_port); -} - -/** Returns local ipv4 address for bound socket file descriptor. */ -ipaddr_t Socket::GetSockIP4() -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - return 0; - } -#endif -#endif - struct sockaddr_in sa; - socklen_t sockaddr_length = sizeof(struct sockaddr_in); - if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1) - memset(&sa, 0, sizeof(sa)); - ipaddr_t a; - memcpy(&a, &sa.sin_addr, 4); - return a; -} - -/** Returns local ipv4 address as text for bound socket file descriptor. */ -std::string Socket::GetSockAddress() -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - return ""; - } -#endif -#endif - struct sockaddr_in sa; - socklen_t sockaddr_length = sizeof(struct sockaddr_in); - if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1) - memset(&sa, 0, sizeof(sa)); - Ipv4Address addr( sa ); - return addr.Convert(); -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -/** Returns local ipv6 address for bound socket file descriptor. */ -struct in6_addr Socket::GetSockIP6() -{ - if (IsIpv6()) - { - struct sockaddr_in6 sa; - socklen_t sockaddr_length = sizeof(struct sockaddr_in6); - if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1) - memset(&sa, 0, sizeof(sa)); - return sa.sin6_addr; - } - struct in6_addr a; - memset(&a, 0, sizeof(a)); - return a; -} - -/** Returns local ipv6 address as text for bound socket file descriptor. */ -std::string Socket::GetSockAddress6() -{ - if (IsIpv6()) - { - struct sockaddr_in6 sa; - socklen_t sockaddr_length = sizeof(struct sockaddr_in6); - if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1) - memset(&sa, 0, sizeof(sa)); - Ipv6Address addr( sa ); - return addr.Convert(); - } - return ""; -} -#endif -#endif - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/SocketHandler.cpp b/dep/src/sockets/SocketHandler.cpp deleted file mode 100644 index acf71fb2efa..00000000000 --- a/dep/src/sockets/SocketHandler.cpp +++ /dev/null @@ -1,1377 +0,0 @@ -/** \file SocketHandler.cpp - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifdef _WIN32 -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif -#endif -#include -#include -#include -#include - -#include "SocketHandler.h" -#include "UdpSocket.h" -#include "ResolvSocket.h" -#include "ResolvServer.h" -#include "TcpSocket.h" -#include "Mutex.h" -#include "Utility.h" -#include "SocketAddress.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -//#ifdef _DEBUG -//#define DEB(x) x; fflush(stderr); -//#else -#define DEB(x) -//#endif - -SocketHandler::SocketHandler(StdLog *p) -:m_stdlog(p) -,m_mutex(m_mutex) -,m_b_use_mutex(false) -,m_maxsock(0) -,m_preverror(-1) -,m_errcnt(0) -,m_tlast(0) -#ifdef ENABLE_SOCKS4 -,m_socks4_host(0) -,m_socks4_port(0) -,m_bTryDirect(false) -#endif -#ifdef ENABLE_RESOLVER -,m_resolv_id(0) -,m_resolver(NULL) -#endif -#ifdef ENABLE_POOL -,m_b_enable_pool(false) -#endif -#ifdef ENABLE_TRIGGERS -,m_next_trigger_id(0) -#endif -#ifdef ENABLE_DETACH -,m_slave(false) -#endif -{ - FD_ZERO(&m_rfds); - FD_ZERO(&m_wfds); - FD_ZERO(&m_efds); -} - -SocketHandler::SocketHandler(Mutex& mutex,StdLog *p) -:m_stdlog(p) -,m_mutex(mutex) -,m_b_use_mutex(true) -,m_maxsock(0) -,m_preverror(-1) -,m_errcnt(0) -,m_tlast(0) -#ifdef ENABLE_SOCKS4 -,m_socks4_host(0) -,m_socks4_port(0) -,m_bTryDirect(false) -#endif -#ifdef ENABLE_RESOLVER -,m_resolv_id(0) -,m_resolver(NULL) -#endif -#ifdef ENABLE_POOL -,m_b_enable_pool(false) -#endif -#ifdef ENABLE_TRIGGERS -,m_next_trigger_id(0) -#endif -#ifdef ENABLE_DETACH -,m_slave(false) -#endif -{ - m_mutex.Lock(); - FD_ZERO(&m_rfds); - FD_ZERO(&m_wfds); - FD_ZERO(&m_efds); -} - -SocketHandler::~SocketHandler() -{ -#ifdef ENABLE_RESOLVER - if (m_resolver) - { - m_resolver -> Quit(); - } -#endif - { - while (m_sockets.size()) - { -DEB( fprintf(stderr, "Emptying sockets list in SocketHandler destructor, %d instances\n", (int)m_sockets.size());) - socket_m::iterator it = m_sockets.begin(); - Socket *p = it -> second; - if (p) - { -DEB( fprintf(stderr, " fd %d\n", p -> GetSocket());) - p -> Close(); -DEB( fprintf(stderr, " fd closed %d\n", p -> GetSocket());) -// p -> OnDelete(); // hey, I turn this back on. what's the worst that could happen??!! - // MinionSocket breaks, calling MinderHandler methods in OnDelete - - // MinderHandler is already gone when that happens... - - // only delete socket when controlled - // ie master sockethandler can delete non-detached sockets - // and a slave sockethandler can only delete a detach socket - if (p -> DeleteByHandler() -#ifdef ENABLE_DETACH - && !(m_slave ^ p -> IsDetached()) -#endif - ) - { - p -> SetErasedByHandler(); - delete p; - } - m_sockets.erase(it); - } - else - { - m_sockets.erase(it); - } -DEB( fprintf(stderr, "next\n");) - } -DEB( fprintf(stderr, "/Emptying sockets list in SocketHandler destructor, %d instances\n", (int)m_sockets.size());) - } -#ifdef ENABLE_RESOLVER - if (m_resolver) - { - delete m_resolver; - } -#endif - if (m_b_use_mutex) - { - m_mutex.Unlock(); - } -} - -Mutex& SocketHandler::GetMutex() const -{ - return m_mutex; -} - -#ifdef ENABLE_DETACH -void SocketHandler::SetSlave(bool x) -{ - m_slave = x; -} - -bool SocketHandler::IsSlave() -{ - return m_slave; -} -#endif - -void SocketHandler::RegStdLog(StdLog *log) -{ - m_stdlog = log; -} - -void SocketHandler::LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t) -{ - if (m_stdlog) - { - m_stdlog -> error(this, p, user_text, err, sys_err, t); - } -} - -void SocketHandler::Add(Socket *p) -{ - if (p -> GetSocket() == INVALID_SOCKET) - { - LogError(p, "Add", -1, "Invalid socket", LOG_LEVEL_WARNING); - if (p -> CloseAndDelete()) - { - m_delete.push_back(p); - } - return; - } - if (m_add.find(p -> GetSocket()) != m_add.end()) - { - LogError(p, "Add", (int)p -> GetSocket(), "Attempt to add socket already in add queue", LOG_LEVEL_FATAL); - m_delete.push_back(p); - return; - } - m_add[p -> GetSocket()] = p; -} - -void SocketHandler::Get(SOCKET s,bool& r,bool& w,bool& e) -{ - if (s >= 0) - { - r = FD_ISSET(s, &m_rfds) ? true : false; - w = FD_ISSET(s, &m_wfds) ? true : false; - e = FD_ISSET(s, &m_efds) ? true : false; - } -} - -void SocketHandler::Set(SOCKET s,bool bRead,bool bWrite,bool bException) -{ -DEB( fprintf(stderr, "Set(%d, %s, %s, %s)\n", s, bRead ? "true" : "false", bWrite ? "true" : "false", bException ? "true" : "false");) - if (s >= 0) - { - if (bRead) - { - if (!FD_ISSET(s, &m_rfds)) - { - FD_SET(s, &m_rfds); - } - } - else - { - FD_CLR(s, &m_rfds); - } - if (bWrite) - { - if (!FD_ISSET(s, &m_wfds)) - { - FD_SET(s, &m_wfds); - } - } - else - { - FD_CLR(s, &m_wfds); - } - if (bException) - { - if (!FD_ISSET(s, &m_efds)) - { - FD_SET(s, &m_efds); - } - } - else - { - FD_CLR(s, &m_efds); - } - } -} - -int SocketHandler::Select(long sec,long usec) -{ - struct timeval tv; - tv.tv_sec = sec; - tv.tv_usec = usec; - return Select(&tv); -} - -int SocketHandler::Select() -{ - if (!m_fds_callonconnect.empty() || -#ifdef ENABLE_DETACH - (!m_slave && !m_fds_detach.empty()) || -#endif - !m_fds_timeout.empty() || - !m_fds_retry.empty() || - !m_fds_close.empty() || - !m_fds_erase.empty()) - { - return Select(0, 200000); - } - return Select(NULL); -} - -int SocketHandler::Select(struct timeval *tsel) -{ - size_t ignore = 0; - while (m_add.size() > ignore) - { - if (m_sockets.size() >= FD_SETSIZE) - { - LogError(NULL, "Select", (int)m_sockets.size(), "FD_SETSIZE reached", LOG_LEVEL_WARNING); - break; - } - socket_m::iterator it = m_add.begin(); - SOCKET s = it -> first; - Socket *p = it -> second; -DEB( fprintf(stderr, "Trying to add fd %d, m_add.size() %d, ignore %d\n", (int)s, (int)m_add.size(), (int)ignore);) - // - if (m_sockets.find(p -> GetSocket()) != m_sockets.end()) - { - LogError(p, "Add", (int)p -> GetSocket(), "Attempt to add socket already in controlled queue", LOG_LEVEL_FATAL); - // %! it's a dup, don't add to delete queue, just ignore it - m_delete.push_back(p); - m_add.erase(it); -// ignore++; - continue; - } - if (!p -> CloseAndDelete()) - { - StreamSocket *scp = dynamic_cast(p); - if (scp && scp -> Connecting()) // 'Open' called before adding socket - { - Set(s,false,true); - } - else - { - TcpSocket *tcp = dynamic_cast(p); - bool bWrite = tcp ? tcp -> GetOutputLength() != 0 : false; - if (p -> IsDisableRead()) - { - Set(s, false, bWrite); - } - else - { - Set(s, true, bWrite); - } - } - m_maxsock = (s > m_maxsock) ? s : m_maxsock; - } - else - { - LogError(p, "Add", (int)p -> GetSocket(), "Trying to add socket with SetCloseAndDelete() true", LOG_LEVEL_WARNING); - } - // only add to m_fds (process fd_set events) if - // slave handler and detached/detaching socket - // master handler and non-detached socket -#ifdef ENABLE_DETACH - if (!(m_slave ^ p -> IsDetach())) -#endif - { - m_fds.push_back(s); - } - m_sockets[s] = p; - // - m_add.erase(it); - } -#ifdef MACOSX - fd_set rfds; - fd_set wfds; - fd_set efds; - FD_COPY(&m_rfds, &rfds); - FD_COPY(&m_wfds, &wfds); - FD_COPY(&m_efds, &efds); -#else - fd_set rfds = m_rfds; - fd_set wfds = m_wfds; - fd_set efds = m_efds; -#endif - int n; - if (m_b_use_mutex) - { - m_mutex.Unlock(); - n = select( (int)(m_maxsock + 1),&rfds,&wfds,&efds,tsel); - m_mutex.Lock(); - } - else - { - n = select( (int)(m_maxsock + 1),&rfds,&wfds,&efds,tsel); - } - if (n == -1) - { - /* - EBADF An invalid file descriptor was given in one of the sets. - EINTR A non blocked signal was caught. - EINVAL n is negative. Or struct timeval contains bad time values (<0). - ENOMEM select was unable to allocate memory for internal tables. - */ - if (Errno != m_preverror || m_errcnt++ % 10000 == 0) - { - LogError(NULL, "select", Errno, StrError(Errno)); -DEB( fprintf(stderr, "m_maxsock: %d\n", m_maxsock); - fprintf(stderr, "%s\n", Errno == EINVAL ? "EINVAL" : - Errno == EINTR ? "EINTR" : - Errno == EBADF ? "EBADF" : - Errno == ENOMEM ? "ENOMEM" : ""); - // test bad fd - for (SOCKET i = 0; i <= m_maxsock; i++) - { - bool t = false; - FD_ZERO(&rfds); - FD_ZERO(&wfds); - FD_ZERO(&efds); - if (FD_ISSET(i, &m_rfds)) - { - FD_SET(i, &rfds); - t = true; - } - if (FD_ISSET(i, &m_wfds)) - { - FD_SET(i, &wfds); - t = true; - } - if (FD_ISSET(i, &m_efds)) - { - FD_SET(i, &efds); - t = true; - } - if (t && m_sockets.find(i) == m_sockets.end()) - { - fprintf(stderr, "Bad fd in fd_set: %d\n", i); - } - } -) // DEB - m_preverror = Errno; - } - /// \todo rebuild fd_set's from active sockets list (m_sockets) here - } - else - if (!n) - { - m_preverror = -1; - } - else - if (n > 0) - { - for (socket_v::iterator it2 = m_fds.begin(); it2 != m_fds.end() && n; it2++) - { - SOCKET i = *it2; - if (FD_ISSET(i, &rfds)) - { - socket_m::iterator itmp = m_sockets.find(i); - if (itmp != m_sockets.end()) // found - { - Socket *p = itmp -> second; - // new SSL negotiate method -#ifdef HAVE_OPENSSL - if (p -> IsSSLNegotiate()) - { - p -> SSLNegotiate(); - } - else -#endif - { - p -> OnRead(); - } - } - else - { - LogError(NULL, "GetSocket/handler/1", (int)i, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - n--; - } - if (FD_ISSET(i, &wfds)) - { - socket_m::iterator itmp = m_sockets.find(i); - if (itmp != m_sockets.end()) // found - { - Socket *p = itmp -> second; - // new SSL negotiate method -#ifdef HAVE_OPENSSL - if (p -> IsSSLNegotiate()) - { - p -> SSLNegotiate(); - } - else -#endif - { - p -> OnWrite(); - } - } - else - { - LogError(NULL, "GetSocket/handler/2", (int)i, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - n--; - } - if (FD_ISSET(i, &efds)) - { - socket_m::iterator itmp = m_sockets.find(i); - if (itmp != m_sockets.end()) // found - { - Socket *p = itmp -> second; - p -> OnException(); - } - else - { - LogError(NULL, "GetSocket/handler/3", (int)i, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - n--; - } - } // m_fds loop - m_preverror = -1; - } // if (n > 0) - - // check CallOnConnect - EVENT - if (!m_fds_callonconnect.empty()) - { - socket_v tmp = m_fds_callonconnect; - for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++) - { - Socket *p = NULL; - { - socket_m::iterator itmp = m_sockets.find(*it); - if (itmp != m_sockets.end()) // found - { - p = itmp -> second; - } - else - { - LogError(NULL, "GetSocket/handler/4", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - } - if (p) - { -// if (p -> CallOnConnect() && p -> Ready() ) - { - p -> SetConnected(); // moved here from inside if (tcp) check below -#ifdef HAVE_OPENSSL - if (p -> IsSSL()) // SSL Enabled socket - p -> OnSSLConnect(); - else -#endif -#ifdef ENABLE_SOCKS4 - if (p -> Socks4()) - p -> OnSocks4Connect(); - else -#endif - { - TcpSocket *tcp = dynamic_cast(p); - if (tcp) - { - if (tcp -> GetOutputLength()) - { - p -> OnWrite(); - } - } -#ifdef ENABLE_RECONNECT - if (tcp && tcp -> IsReconnect()) - p -> OnReconnect(); - else -#endif - { -// LogError(p, "Calling OnConnect", 0, "Because CallOnConnect", LOG_LEVEL_INFO); - p -> OnConnect(); - } - } -// p -> SetCallOnConnect( false ); - AddList(p -> GetSocket(), LIST_CALLONCONNECT, false); - } - } - } - } -#ifdef ENABLE_DETACH - // check detach of socket if master handler - EVENT - if (!m_slave && !m_fds_detach.empty()) - { - // %! why not using tmp list here??!? - for (socket_v::iterator it = m_fds_detach.begin(); it != m_fds_detach.end(); it++) - { - Socket *p = NULL; - { - socket_m::iterator itmp = m_sockets.find(*it); - if (itmp != m_sockets.end()) // found - { - p = itmp -> second; - } - else - { - LogError(NULL, "GetSocket/handler/5", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - } - if (p) - { -// if (p -> IsDetach()) - { - Set(p -> GetSocket(), false, false, false); - // After DetachSocket(), all calls to Handler() will return a reference - // to the new slave SocketHandler running in the new thread. - p -> DetachSocket(); - // Adding the file descriptor to m_fds_erase will now also remove the - // socket from the detach queue - tnx knightmad - m_fds_erase.push_back(p -> GetSocket()); - } - } - } - } -#endif - // check Connecting - connection timeout - conditional event - if (m_fds_timeout.size()) - { - time_t tnow = time(NULL); - if (tnow != m_tlast) - { - socket_v tmp = m_fds_timeout; -DEB( fprintf(stderr, "Checking %d socket(s) for timeout\n", tmp.size());) - for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++) - { - Socket *p = NULL; - { - socket_m::iterator itmp = m_sockets.find(*it); - if (itmp != m_sockets.end()) // found - { - p = itmp -> second; - } - else - { - itmp = m_add.find(*it); - if (itmp != m_add.end()) - { - p = itmp -> second; - } - else - { - LogError(NULL, "GetSocket/handler/6", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - } - } - if (p) - { - if (p -> Timeout(tnow)) - { - StreamSocket *scp = dynamic_cast(p); - if (scp && scp -> Connecting()) - p -> OnConnectTimeout(); - else - p -> OnTimeout(); - p -> SetTimeout(0); - } - } - } - m_tlast = tnow; - } // tnow != tlast - } - // check retry client connect - EVENT - if (!m_fds_retry.empty()) - { - socket_v tmp = m_fds_retry; - for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++) - { - Socket *p = NULL; - { - socket_m::iterator itmp = m_sockets.find(*it); - if (itmp != m_sockets.end()) // found - { - p = itmp -> second; - } - else - { - LogError(NULL, "GetSocket/handler/7", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - } - if (p) - { -// if (p -> RetryClientConnect()) - { - TcpSocket *tcp = dynamic_cast(p); - SOCKET nn = *it; //(*it3).first; - tcp -> SetRetryClientConnect(false); -DEB( fprintf(stderr, "Close() before retry client connect\n");) - p -> Close(); // removes from m_fds_retry - std::auto_ptr ad = p -> GetClientRemoteAddress(); - if (ad.get()) - { - tcp -> Open(*ad); - } - else - { - LogError(p, "RetryClientConnect", 0, "no address", LOG_LEVEL_ERROR); - } - Add(p); - m_fds_erase.push_back(nn); - } - } - } - } - // check close and delete - conditional event - if (!m_fds_close.empty()) - { - socket_v tmp = m_fds_close; -DEB( fprintf(stderr, "m_fds_close.size() == %d\n", (int)m_fds_close.size());) - for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++) - { - Socket *p = NULL; - { - socket_m::iterator itmp = m_sockets.find(*it); - if (itmp != m_sockets.end()) // found - { - p = itmp -> second; - } - else - { - itmp = m_add.find(*it); - if (itmp != m_add.end()) - { - p = itmp -> second; - } - else - { - LogError(NULL, "GetSocket/handler/8", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING); - } - } - } - if (p) - { -// if (p -> CloseAndDelete() ) - { - TcpSocket *tcp = dynamic_cast(p); - // new graceful tcp - flush and close timeout 5s - if (tcp && p -> IsConnected() && tcp -> GetFlushBeforeClose() && -#ifdef HAVE_OPENSSL - !tcp -> IsSSL() && -#endif - p -> TimeSinceClose() < 5) - { -DEB( fprintf(stderr, " close(1)\n");) - if (tcp -> GetOutputLength()) - { - LogError(p, "Closing", (int)tcp -> GetOutputLength(), "Sending all data before closing", LOG_LEVEL_INFO); - } - else // shutdown write when output buffer is empty - if (!(tcp -> GetShutdown() & SHUT_WR)) - { - SOCKET nn = *it; - if (nn != INVALID_SOCKET && shutdown(nn, SHUT_WR) == -1) - { - LogError(p, "graceful shutdown", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - tcp -> SetShutdown(SHUT_WR); - } - } - else -#ifdef ENABLE_RECONNECT - if (tcp && p -> IsConnected() && tcp -> Reconnect()) - { - SOCKET nn = *it; //(*it3).first; -DEB( fprintf(stderr, " close(2) fd %d\n", nn);) - p -> SetCloseAndDelete(false); - tcp -> SetIsReconnect(); - p -> SetConnected(false); -DEB( fprintf(stderr, "Close() before reconnect\n");) - p -> Close(); // dispose of old file descriptor (Open creates a new) - p -> OnDisconnect(); - std::auto_ptr ad = p -> GetClientRemoteAddress(); - if (ad.get()) - { - tcp -> Open(*ad); - } - else - { - LogError(p, "Reconnect", 0, "no address", LOG_LEVEL_ERROR); - } - tcp -> ResetConnectionRetries(); - Add(p); - m_fds_erase.push_back(nn); - } - else -#endif - { - SOCKET nn = *it; //(*it3).first; -DEB( fprintf(stderr, " close(3) fd %d GetSocket() %d\n", nn, p -> GetSocket());) - if (tcp && p -> IsConnected() && tcp -> GetOutputLength()) - { - LogError(p, "Closing", (int)tcp -> GetOutputLength(), "Closing socket while data still left to send", LOG_LEVEL_WARNING); - } -#ifdef ENABLE_POOL - if (p -> Retain() && !p -> Lost()) - { - PoolSocket *p2 = new PoolSocket(*this, p); - p2 -> SetDeleteByHandler(); - Add(p2); - // - p -> SetCloseAndDelete(false); // added - remove from m_fds_close - } - else -#endif // ENABLE_POOL - { - Set(p -> GetSocket(),false,false,false); -DEB( fprintf(stderr, "Close() before OnDelete\n");) - p -> Close(); - } - p -> OnDelete(); - if (p -> DeleteByHandler()) - { - p -> SetErasedByHandler(); - } - m_fds_erase.push_back(nn); - } - } - } - } - } - - // check erased sockets - bool check_max_fd = false; - while (!m_fds_erase.empty()) - { - socket_v::iterator it = m_fds_erase.begin(); - SOCKET nn = *it; -#ifdef ENABLE_DETACH - { - for (socket_v::iterator it = m_fds_detach.begin(); it != m_fds_detach.end(); it++) - { - if (*it == nn) - { - m_fds_detach.erase(it); - break; - } - } - } -#endif - { - for (socket_v::iterator it = m_fds.begin(); it != m_fds.end(); it++) - { - if (*it == nn) - { - m_fds.erase(it); - break; - } - } - } - { - socket_m::iterator it = m_sockets.find(nn); - if (it != m_sockets.end()) - { - Socket *p = it -> second; - /* Sometimes a SocketThread class can finish its run before the master - sockethandler gets here. In that case, the SocketThread has set the - 'ErasedByHandler' flag on the socket which will make us end up with a - double delete on the socket instance. - The fix is to make sure that the master sockethandler only can delete - non-detached sockets, and a slave sockethandler only can delete - detach sockets. */ - if (p -> ErasedByHandler() -#ifdef ENABLE_DETACH - && !(m_slave ^ p -> IsDetached()) -#endif - ) - { -#ifdef ENABLE_TRIGGERS - bool again = false; - do - { - again = false; - for (std::map::iterator it = m_trigger_src.begin(); it != m_trigger_src.end(); it++) - { - int id = it -> first; - Socket *src = it -> second; - if (src == p) - { - for (std::map::iterator it = m_trigger_dst[id].begin(); it != m_trigger_dst[id].end(); it++) - { - Socket *dst = it -> first; - if (Valid(dst)) - { - dst -> OnCancelled(id); - } - } - m_trigger_src.erase(m_trigger_src.find(id)); - m_trigger_dst.erase(m_trigger_dst.find(id)); - again = true; - break; - } - } - } while (again); -#endif - delete p; - } - m_sockets.erase(it); - } - } - m_fds_erase.erase(it); - check_max_fd = true; - } - // calculate max file descriptor for select() call - if (check_max_fd) - { - m_maxsock = 0; - for (socket_v::iterator it = m_fds.begin(); it != m_fds.end(); it++) - { - SOCKET s = *it; - m_maxsock = s > m_maxsock ? s : m_maxsock; - } - } - // remove Add's that fizzed - while (!m_delete.empty()) - { - std::list::iterator it = m_delete.begin(); - Socket *p = *it; - p -> OnDelete(); - m_delete.erase(it); - if (p -> DeleteByHandler() -#ifdef ENABLE_DETACH - && !(m_slave ^ p -> IsDetached()) -#endif - ) - { - p -> SetErasedByHandler(); -#ifdef ENABLE_TRIGGERS - bool again = false; - do - { - again = false; - for (std::map::iterator it = m_trigger_src.begin(); it != m_trigger_src.end(); it++) - { - int id = it -> first; - Socket *src = it -> second; - if (src == p) - { - for (std::map::iterator it = m_trigger_dst[id].begin(); it != m_trigger_dst[id].end(); it++) - { - Socket *dst = it -> first; - if (Valid(dst)) - { - dst -> OnCancelled(id); - } - } - m_trigger_src.erase(m_trigger_src.find(id)); - m_trigger_dst.erase(m_trigger_dst.find(id)); - again = true; - break; - } - } - } while (again); -#endif - delete p; - } - } - return n; -} - -#ifdef ENABLE_RESOLVER -bool SocketHandler::Resolving(Socket *p0) -{ - std::map::iterator it = m_resolve_q.find(p0); - return it != m_resolve_q.end(); -} -#endif - -bool SocketHandler::Valid(Socket *p0) -{ - for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++) - { - Socket *p = it -> second; - if (p0 == p) - return true; - } - return false; -} - -bool SocketHandler::OkToAccept(Socket *) -{ - return true; -} - -size_t SocketHandler::GetCount() -{ -/* -printf(" m_sockets : %d\n", m_sockets.size()); -printf(" m_add : %d\n", m_add.size()); -printf(" m_delete : %d\n", m_delete.size()); -*/ - return m_sockets.size() + m_add.size() + m_delete.size(); -} - -#ifdef ENABLE_SOCKS4 -void SocketHandler::SetSocks4Host(ipaddr_t a) -{ - m_socks4_host = a; -} - -void SocketHandler::SetSocks4Host(const std::string& host) -{ - Utility::u2ip(host, m_socks4_host); -} - -void SocketHandler::SetSocks4Port(port_t port) -{ - m_socks4_port = port; -} - -void SocketHandler::SetSocks4Userid(const std::string& id) -{ - m_socks4_userid = id; -} -#endif - -#ifdef ENABLE_RESOLVER -int SocketHandler::Resolve(Socket *p,const std::string& host,port_t port) -{ - // check cache - ResolvSocket *resolv = new ResolvSocket(*this, p, host, port); - resolv -> SetId(++m_resolv_id); - resolv -> SetDeleteByHandler(); - ipaddr_t local; - Utility::u2ip("127.0.0.1", local); - if (!resolv -> Open(local, m_resolver_port)) - { - LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL); - } - Add(resolv); - m_resolve_q[p] = true; -DEB( fprintf(stderr, " *** Resolve '%s:%d' id#%d m_resolve_q size: %d p: %p\n", host.c_str(), port, resolv -> GetId(), m_resolve_q.size(), p);) - return resolv -> GetId(); -} - -#ifdef ENABLE_IPV6 -int SocketHandler::Resolve6(Socket *p,const std::string& host,port_t port) -{ - // check cache - ResolvSocket *resolv = new ResolvSocket(*this, p, host, port, true); - resolv -> SetId(++m_resolv_id); - resolv -> SetDeleteByHandler(); - ipaddr_t local; - Utility::u2ip("127.0.0.1", local); - if (!resolv -> Open(local, m_resolver_port)) - { - LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL); - } - Add(resolv); - m_resolve_q[p] = true; - return resolv -> GetId(); -} -#endif - -int SocketHandler::Resolve(Socket *p,ipaddr_t a) -{ - // check cache - ResolvSocket *resolv = new ResolvSocket(*this, p, a); - resolv -> SetId(++m_resolv_id); - resolv -> SetDeleteByHandler(); - ipaddr_t local; - Utility::u2ip("127.0.0.1", local); - if (!resolv -> Open(local, m_resolver_port)) - { - LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL); - } - Add(resolv); - m_resolve_q[p] = true; - return resolv -> GetId(); -} - -#ifdef ENABLE_IPV6 -int SocketHandler::Resolve(Socket *p,in6_addr& a) -{ - // check cache - ResolvSocket *resolv = new ResolvSocket(*this, p, a); - resolv -> SetId(++m_resolv_id); - resolv -> SetDeleteByHandler(); - ipaddr_t local; - Utility::u2ip("127.0.0.1", local); - if (!resolv -> Open(local, m_resolver_port)) - { - LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL); - } - Add(resolv); - m_resolve_q[p] = true; - return resolv -> GetId(); -} -#endif - -void SocketHandler::EnableResolver(port_t port) -{ - if (!m_resolver) - { - m_resolver_port = port; - m_resolver = new ResolvServer(port); - } -} - -bool SocketHandler::ResolverReady() -{ - return m_resolver ? m_resolver -> Ready() : false; -} -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_SOCKS4 -void SocketHandler::SetSocks4TryDirect(bool x) -{ - m_bTryDirect = x; -} - -ipaddr_t SocketHandler::GetSocks4Host() -{ - return m_socks4_host; -} - -port_t SocketHandler::GetSocks4Port() -{ - return m_socks4_port; -} - -const std::string& SocketHandler::GetSocks4Userid() -{ - return m_socks4_userid; -} - -bool SocketHandler::Socks4TryDirect() -{ - return m_bTryDirect; -} -#endif - -#ifdef ENABLE_RESOLVER -bool SocketHandler::ResolverEnabled() -{ - return m_resolver ? true : false; -} - -port_t SocketHandler::GetResolverPort() -{ - return m_resolver_port; -} -#endif // ENABLE_RESOLVER - -#ifdef ENABLE_POOL -ISocketHandler::PoolSocket *SocketHandler::FindConnection(int type,const std::string& protocol,SocketAddress& ad) -{ - for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end() && !m_sockets.empty(); it++) - { - PoolSocket *pools = dynamic_cast(it -> second); - if (pools) - { - if (pools -> GetSocketType() == type && - pools -> GetSocketProtocol() == protocol && -// %! pools -> GetClientRemoteAddress() && - *pools -> GetClientRemoteAddress() == ad) - { - m_sockets.erase(it); - pools -> SetRetain(); // avoid Close in Socket destructor - return pools; // Caller is responsible that this socket is deleted - } - } - } - return NULL; -} - -void SocketHandler::EnablePool(bool x) -{ - m_b_enable_pool = x; -} - -bool SocketHandler::PoolEnabled() -{ - return m_b_enable_pool; -} -#endif - -void SocketHandler::Remove(Socket *p) -{ -#ifdef ENABLE_RESOLVER - std::map::iterator it4 = m_resolve_q.find(p); - if (it4 != m_resolve_q.end()) - m_resolve_q.erase(it4); -#endif - if (p -> ErasedByHandler()) - { - return; - } - for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++) - { - if (it -> second == p) - { - LogError(p, "Remove", -1, "Socket destructor called while still in use", LOG_LEVEL_WARNING); - m_sockets.erase(it); - return; - } - } - for (socket_m::iterator it2 = m_add.begin(); it2 != m_add.end(); it2++) - { - if ((*it2).second == p) - { - LogError(p, "Remove", -2, "Socket destructor called while still in use", LOG_LEVEL_WARNING); - m_add.erase(it2); - return; - } - } - for (std::list::iterator it3 = m_delete.begin(); it3 != m_delete.end(); it3++) - { - if (*it3 == p) - { - LogError(p, "Remove", -3, "Socket destructor called while still in use", LOG_LEVEL_WARNING); - m_delete.erase(it3); - return; - } - } -} - -void SocketHandler::CheckSanity() -{ - CheckList(m_fds, "active sockets"); // active sockets - CheckList(m_fds_erase, "sockets to be erased"); // should always be empty anyway - CheckList(m_fds_callonconnect, "checklist CallOnConnect"); -#ifdef ENABLE_DETACH - CheckList(m_fds_detach, "checklist Detach"); -#endif - CheckList(m_fds_timeout, "checklist Timeout"); - CheckList(m_fds_retry, "checklist retry client connect"); - CheckList(m_fds_close, "checklist close and delete"); -} - -void SocketHandler::CheckList(socket_v& ref,const std::string& listname) -{ - for (socket_v::iterator it = ref.begin(); it != ref.end(); it++) - { - SOCKET s = *it; - if (m_sockets.find(s) != m_sockets.end()) - continue; - if (m_add.find(s) != m_add.end()) - continue; - bool found = false; - for (std::list::iterator it = m_delete.begin(); it != m_delete.end(); it++) - { - Socket *p = *it; - if (p -> GetSocket() == s) - { - found = true; - break; - } - } - if (!found) - { - fprintf(stderr, "CheckList failed for \"%s\": fd %d\n", listname.c_str(), s); - } - } -} - -void SocketHandler::AddList(SOCKET s,list_t which_one,bool add) -{ - if (s == INVALID_SOCKET) - { -DEB( fprintf(stderr, "AddList: invalid_socket\n");) - return; - } - socket_v& ref = - (which_one == LIST_CALLONCONNECT) ? m_fds_callonconnect : -#ifdef ENABLE_DETACH - (which_one == LIST_DETACH) ? m_fds_detach : -#endif - (which_one == LIST_TIMEOUT) ? m_fds_timeout : - (which_one == LIST_RETRY) ? m_fds_retry : - (which_one == LIST_CLOSE) ? m_fds_close : m_fds_close; - if (add) - { -#ifdef ENABLE_DETACH -DEB( fprintf(stderr, "AddList; %5d: %s: %s\n", s, (which_one == LIST_CALLONCONNECT) ? "CallOnConnect" : - (which_one == LIST_DETACH) ? "Detach" : - (which_one == LIST_TIMEOUT) ? "Timeout" : - (which_one == LIST_RETRY) ? "Retry" : - (which_one == LIST_CLOSE) ? "Close" : "", - add ? "Add" : "Remove");) -#else -DEB( fprintf(stderr, "AddList; %5d: %s: %s\n", s, (which_one == LIST_CALLONCONNECT) ? "CallOnConnect" : - (which_one == LIST_TIMEOUT) ? "Timeout" : - (which_one == LIST_RETRY) ? "Retry" : - (which_one == LIST_CLOSE) ? "Close" : "", - add ? "Add" : "Remove");) -#endif - } - if (add) - { - for (socket_v::iterator it = ref.begin(); it != ref.end(); it++) - { - if (*it == s) // already there - { - return; - } - } - ref.push_back(s); - return; - } - // remove - for (socket_v::iterator it = ref.begin(); it != ref.end(); it++) - { - if (*it == s) - { - ref.erase(it); - break; - } - } -//DEB( fprintf(stderr, "/AddList\n");) -} - -#ifdef ENABLE_TRIGGERS -int SocketHandler::TriggerID(Socket *src) -{ - int id = m_next_trigger_id++; - m_trigger_src[id] = src; - return id; -} - -bool SocketHandler::Subscribe(int id, Socket *dst) -{ - if (m_trigger_src.find(id) != m_trigger_src.end()) - { - std::map::iterator it = m_trigger_dst[id].find(dst); - if (it != m_trigger_dst[id].end()) - { - m_trigger_dst[id][dst] = true; - return true; - } - LogError(dst, "Subscribe", id, "Already subscribed", LOG_LEVEL_INFO); - return false; - } - LogError(dst, "Subscribe", id, "Trigger id not found", LOG_LEVEL_INFO); - return false; -} - -bool SocketHandler::Unsubscribe(int id, Socket *dst) -{ - if (m_trigger_src.find(id) != m_trigger_src.end()) - { - std::map::iterator it = m_trigger_dst[id].find(dst); - if (it != m_trigger_dst[id].end()) - { - m_trigger_dst[id].erase(it); - return true; - } - LogError(dst, "Unsubscribe", id, "Not subscribed", LOG_LEVEL_INFO); - return false; - } - LogError(dst, "Unsubscribe", id, "Trigger id not found", LOG_LEVEL_INFO); - return false; -} - -void SocketHandler::Trigger(int id, Socket::TriggerData& data, bool erase) -{ - if (m_trigger_src.find(id) != m_trigger_src.end()) - { - data.SetSource( m_trigger_src[id] ); - for (std::map::iterator it = m_trigger_dst[id].begin(); it != m_trigger_dst[id].end(); it++) - { - Socket *dst = it -> first; - if (Valid(dst)) - { - dst -> OnTrigger(id, data); - } - } - if (erase) - { - m_trigger_src.erase(m_trigger_src.find(id)); - m_trigger_dst.erase(m_trigger_dst.find(id)); - } - } - else - { - LogError(NULL, "Trigger", id, "Trigger id not found", LOG_LEVEL_INFO); - } -} -#endif // ENABLE_TRIGGERS - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/StdoutLog.cpp b/dep/src/sockets/StdoutLog.cpp deleted file mode 100644 index e745a6d3358..00000000000 --- a/dep/src/sockets/StdoutLog.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/** \file StdoutLog.cpp - ** \date 2004-06-01 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include - -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif - -#include - -#include "ISocketHandler.h" -#include "Socket.h" -#include "StdoutLog.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - - -void StdoutLog::error(ISocketHandler *,Socket *sock,const std::string& call,int err,const std::string& sys_err,loglevel_t lvl) -{ - time_t t = time(NULL); - struct tm tp; -#ifdef _WIN32 - memcpy(&tp, localtime(&t), sizeof(tp)); -#else - localtime_r(&t, &tp); -#endif - std::string level; - - switch (lvl) - { - case LOG_LEVEL_WARNING: - level = "Warning"; - break; - case LOG_LEVEL_ERROR: - level = "Error"; - break; - case LOG_LEVEL_FATAL: - level = "Fatal"; - break; - case LOG_LEVEL_INFO: - level = "Info"; - break; - } - if (sock) - { - printf("%d-%02d-%02d %02d:%02d:%02d :: fd %d :: %s: %d %s (%s)\n", - tp.tm_year + 1900, - tp.tm_mon + 1, - tp.tm_mday, - tp.tm_hour,tp.tm_min,tp.tm_sec, - sock -> GetSocket(), - call.c_str(),err,sys_err.c_str(),level.c_str()); - } - else - { - printf("%d-%02d-%02d %02d:%02d:%02d :: %s: %d %s (%s)\n", - tp.tm_year + 1900, - tp.tm_mon + 1, - tp.tm_mday, - tp.tm_hour,tp.tm_min,tp.tm_sec, - call.c_str(),err,sys_err.c_str(),level.c_str()); - } -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/StreamSocket.cpp b/dep/src/sockets/StreamSocket.cpp deleted file mode 100644 index 009abadad8f..00000000000 --- a/dep/src/sockets/StreamSocket.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include "StreamSocket.h" -#include "ISocketHandler.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -StreamSocket::StreamSocket(ISocketHandler& h) : Socket(h) -,m_bConnecting(false) -,m_connect_timeout(5) -,m_flush_before_close(true) -,m_connection_retry(0) -,m_retries(0) -,m_call_on_connect(false) -,m_b_retry_connect(false) -,m_line_protocol(false) -,m_shutdown(0) -{ -} - -StreamSocket::~StreamSocket() -{ -} - -void StreamSocket::SetConnecting(bool x) -{ - if (x != m_bConnecting) - { - m_bConnecting = x; - if (x) - { - SetTimeout( GetConnectTimeout() ); - } - else - { - SetTimeout( 0 ); - } - } -} - -bool StreamSocket::Connecting() -{ - return m_bConnecting; -} - -bool StreamSocket::Ready() -{ - if (GetSocket() != INVALID_SOCKET && !Connecting() && !CloseAndDelete()) - return true; - return false; -} - -void StreamSocket::SetConnectTimeout(int x) -{ - m_connect_timeout = x; -} - -int StreamSocket::GetConnectTimeout() -{ - return m_connect_timeout; -} - -void StreamSocket::SetFlushBeforeClose(bool x) -{ - m_flush_before_close = x; -} - -bool StreamSocket::GetFlushBeforeClose() -{ - return m_flush_before_close; -} - -int StreamSocket::GetConnectionRetry() -{ - return m_connection_retry; -} - -void StreamSocket::SetConnectionRetry(int x) -{ - m_connection_retry = x; -} - -int StreamSocket::GetConnectionRetries() -{ - return m_retries; -} - -void StreamSocket::IncreaseConnectionRetries() -{ - m_retries++; -} - -void StreamSocket::ResetConnectionRetries() -{ - m_retries = 0; -} - -void StreamSocket::SetCallOnConnect(bool x) -{ - Handler().AddList(GetSocket(), LIST_CALLONCONNECT, x); - m_call_on_connect = x; -} - -bool StreamSocket::CallOnConnect() -{ - return m_call_on_connect; -} - -void StreamSocket::SetRetryClientConnect(bool x) -{ - Handler().AddList(GetSocket(), LIST_RETRY, x); - m_b_retry_connect = x; -} - -bool StreamSocket::RetryClientConnect() -{ - return m_b_retry_connect; -} - -void StreamSocket::SetLineProtocol(bool x) -{ - m_line_protocol = x; -} - -bool StreamSocket::LineProtocol() -{ - return m_line_protocol; -} - -void StreamSocket::SetShutdown(int x) -{ - m_shutdown = x; -} - -int StreamSocket::GetShutdown() -{ - return m_shutdown; -} - - -#ifdef SOCKETS_NAMESPACE -} // namespace SOCKETS_NAMESPACE { -#endif - - diff --git a/dep/src/sockets/TcpSocket.cpp b/dep/src/sockets/TcpSocket.cpp deleted file mode 100644 index 5f067b53124..00000000000 --- a/dep/src/sockets/TcpSocket.cpp +++ /dev/null @@ -1,1681 +0,0 @@ -/** \file TcpSocket.cpp - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifdef _WIN32 -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif -#include -#else -#include -#endif -#include "ISocketHandler.h" -#include -#include -#include -#include -#ifdef HAVE_OPENSSL -#include -#include -#endif -#include -#include - -#include "TcpSocket.h" -#include "Utility.h" -#include "Ipv4Address.h" -#include "Ipv6Address.h" -#include "Mutex.h" -#include "IFile.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -//#ifdef _DEBUG -//#define DEB(x) x -//#else -#define DEB(x) -//#endif - -// statics -#ifdef HAVE_OPENSSL -SSLInitializer TcpSocket::m_ssl_init; -#endif - -// thanks, q -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif -TcpSocket::TcpSocket(ISocketHandler& h) : StreamSocket(h) -,ibuf(TCP_BUFSIZE_READ) -,m_b_input_buffer_disabled(false) -,m_bytes_sent(0) -,m_bytes_received(0) -,m_skip_c(false) -#ifdef SOCKETS_DYNAMIC_TEMP -,m_buf(new char[TCP_BUFSIZE_READ + 1]) -#endif -,m_obuf_top(NULL) -,m_transfer_limit(0) -,m_output_length(0) -#ifdef HAVE_OPENSSL -,m_ssl_ctx(NULL) -,m_ssl(NULL) -,m_sbio(NULL) -#endif -#ifdef ENABLE_SOCKS4 -,m_socks4_state(0) -#endif -#ifdef ENABLE_RESOLVER -,m_resolver_id(0) -#endif -#ifdef ENABLE_RECONNECT -,m_b_reconnect(false) -,m_b_is_reconnect(false) -#endif -{ -} -#ifdef _MSC_VER -#pragma warning(default:4355) -#endif - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif -TcpSocket::TcpSocket(ISocketHandler& h,size_t isize,size_t osize) : StreamSocket(h) -,ibuf(isize) -,m_b_input_buffer_disabled(false) -,m_bytes_sent(0) -,m_bytes_received(0) -,m_skip_c(false) -#ifdef SOCKETS_DYNAMIC_TEMP -,m_buf(new char[TCP_BUFSIZE_READ + 1]) -#endif -,m_obuf_top(NULL) -,m_transfer_limit(0) -,m_output_length(0) -#ifdef HAVE_OPENSSL -,m_ssl_ctx(NULL) -,m_ssl(NULL) -,m_sbio(NULL) -#endif -#ifdef ENABLE_SOCKS4 -,m_socks4_state(0) -#endif -#ifdef ENABLE_RESOLVER -,m_resolver_id(0) -#endif -#ifdef ENABLE_RECONNECT -,m_b_reconnect(false) -,m_b_is_reconnect(false) -#endif -{ -} -#ifdef _MSC_VER -#pragma warning(default:4355) -#endif - -TcpSocket::~TcpSocket() -{ -#ifdef SOCKETS_DYNAMIC_TEMP - delete[] m_buf; -#endif - // %! empty m_obuf - while (m_obuf.size()) - { - output_l::iterator it = m_obuf.begin(); - OUTPUT *p = *it; - delete p; - m_obuf.erase(it); - } -#ifdef HAVE_OPENSSL - if (m_ssl) - { - SSL_free(m_ssl); - } -#endif -} - -bool TcpSocket::Open(ipaddr_t ip,port_t port,bool skip_socks) -{ - Ipv4Address ad(ip, port); - Ipv4Address local; - return Open(ad, local, skip_socks); -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -bool TcpSocket::Open(in6_addr ip,port_t port,bool skip_socks) -{ - Ipv6Address ad(ip, port); - return Open(ad, skip_socks); -} -#endif -#endif - -bool TcpSocket::Open(SocketAddress& ad,bool skip_socks) -{ - Ipv4Address bind_ad("0.0.0.0", 0); - return Open(ad, bind_ad, skip_socks); -} - -bool TcpSocket::Open(SocketAddress& ad,SocketAddress& bind_ad,bool skip_socks) -{ - if (!ad.IsValid()) - { - Handler().LogError(this, "Open", 0, "Invalid SocketAddress", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - return false; - } - if (Handler().GetCount() >= FD_SETSIZE) - { - Handler().LogError(this, "Open", 0, "no space left in fd_set", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - return false; - } - SetConnecting(false); -#ifdef ENABLE_SOCKS4 - SetSocks4(false); -#endif - // check for pooling -#ifdef ENABLE_POOL - if (Handler().PoolEnabled()) - { - ISocketHandler::PoolSocket *pools = Handler().FindConnection(SOCK_STREAM, "tcp", ad); - if (pools) - { - CopyConnection( pools ); - delete pools; - - SetIsClient(); - SetCallOnConnect(); // ISocketHandler must call OnConnect - Handler().LogError(this, "SetCallOnConnect", 0, "Found pooled connection", LOG_LEVEL_INFO); - return true; - } - } -#endif - // if not, create new connection - SOCKET s = CreateSocket(ad.GetFamily(), SOCK_STREAM, "tcp"); - if (s == INVALID_SOCKET) - { - return false; - } - // socket must be nonblocking for async connect - if (!SetNonblocking(true, s)) - { - SetCloseAndDelete(); - closesocket(s); - return false; - } -#ifdef ENABLE_POOL - SetIsClient(); // client because we connect -#endif - SetClientRemoteAddress(ad); - int n = 0; - if (bind_ad.GetPort() != 0) - { - bind(s, bind_ad, bind_ad); - } -#ifdef ENABLE_SOCKS4 - if (!skip_socks && GetSocks4Host() && GetSocks4Port()) - { - Ipv4Address sa(GetSocks4Host(), GetSocks4Port()); - { - std::string sockshost; - Utility::l2ip(GetSocks4Host(), sockshost); - Handler().LogError(this, "Open", 0, "Connecting to socks4 server @ " + sockshost + ":" + - Utility::l2string(GetSocks4Port()), LOG_LEVEL_INFO); - } - SetSocks4(); - n = connect(s, sa, sa); - SetRemoteAddress(sa); - } - else -#endif - { - n = connect(s, ad, ad); - SetRemoteAddress(ad); - } - if (n == -1) - { - // check error code that means a connect is in progress -#ifdef _WIN32 - if (Errno == WSAEWOULDBLOCK) -#else - if (Errno == EINPROGRESS) -#endif - { - Attach(s); - SetConnecting( true ); // this flag will control fd_set's - } - else -#ifdef ENABLE_SOCKS4 - if (Socks4() && Handler().Socks4TryDirect() ) // retry - { - closesocket(s); - return Open(ad, true); - } - else -#endif -#ifdef ENABLE_RECONNECT - if (Reconnect()) - { - Handler().LogError(this, "connect: failed, reconnect pending", Errno, StrError(Errno), LOG_LEVEL_INFO); - Attach(s); - SetConnecting( true ); // this flag will control fd_set's - } - else -#endif - { - Handler().LogError(this, "connect: failed", Errno, StrError(Errno), LOG_LEVEL_FATAL); - SetCloseAndDelete(); - closesocket(s); - return false; - } - } - else - { - Attach(s); - SetCallOnConnect(); // ISocketHandler must call OnConnect - } - - // 'true' means connected or connecting(not yet connected) - // 'false' means something failed - return true; //!Connecting(); -} - -bool TcpSocket::Open(const std::string &host,port_t port) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { -#ifdef ENABLE_RESOLVER - if (!Handler().ResolverEnabled() || Utility::isipv6(host) ) - { -#endif - in6_addr a; - if (!Utility::u2ip(host, a)) - { - SetCloseAndDelete(); - return false; - } - Ipv6Address ad(a, port); - Ipv6Address local; - return Open(ad, local); -#ifdef ENABLE_RESOLVER - } - m_resolver_id = Resolve6(host, port); - return true; -#endif - } -#endif -#endif -#ifdef ENABLE_RESOLVER - if (!Handler().ResolverEnabled() || Utility::isipv4(host) ) - { -#endif - ipaddr_t l; - if (!Utility::u2ip(host,l)) - { - SetCloseAndDelete(); - return false; - } - Ipv4Address ad(l, port); - Ipv4Address local; - return Open(ad, local); -#ifdef ENABLE_RESOLVER - } - // resolve using async resolver thread - m_resolver_id = Resolve(host, port); - return true; -#endif -} - -#ifdef ENABLE_RESOLVER -void TcpSocket::OnResolved(int id,ipaddr_t a,port_t port) -{ -DEB( fprintf(stderr, "TcpSocket::OnResolved id %d addr %x port %d\n", id, a, port);) - if (id == m_resolver_id) - { - if (a && port) - { - Ipv4Address ad(a, port); - Ipv4Address local; - if (Open(ad, local)) - { - if (!Handler().Valid(this)) - { - Handler().Add(this); - } - } - } - else - { - Handler().LogError(this, "OnResolved", 0, "Resolver failed", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - } - } - else - { - Handler().LogError(this, "OnResolved", id, "Resolver returned wrong job id", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - } -} - -#ifdef ENABLE_IPV6 -void TcpSocket::OnResolved(int id,in6_addr& a,port_t port) -{ - if (id == m_resolver_id) - { - Ipv6Address ad(a, port); - if (ad.IsValid()) - { - Ipv6Address local; - if (Open(ad, local)) - { - if (!Handler().Valid(this)) - { - Handler().Add(this); - } - } - } - } - else - { - Handler().LogError(this, "OnResolved", id, "Resolver returned wrong job id", LOG_LEVEL_FATAL); - SetCloseAndDelete(); - } -} -#endif -#endif - -void TcpSocket::OnRead() -{ - int n = 0; -#ifdef SOCKETS_DYNAMIC_TEMP - char *buf = m_buf; -#else - char buf[TCP_BUFSIZE_READ]; -#endif -#ifdef HAVE_OPENSSL - if (IsSSL()) - { - if (!Ready()) - return; - n = SSL_read(m_ssl, buf, TCP_BUFSIZE_READ); - if (n == -1) - { - n = SSL_get_error(m_ssl, n); - switch (n) - { - case SSL_ERROR_NONE: - case SSL_ERROR_WANT_READ: - case SSL_ERROR_WANT_WRITE: - break; - case SSL_ERROR_ZERO_RETURN: -DEB( fprintf(stderr, "SSL_read() returns zero - closing socket\n");) - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - break; - default: -DEB( fprintf(stderr, "SSL read problem, errcode = %d\n",n);) - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - } - return; - } - else - if (!n) - { - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - SetShutdown(SHUT_WR); - return; - } - else - if (n > 0 && n <= TCP_BUFSIZE_READ) - { - m_bytes_received += n; - if (GetTrafficMonitor()) - { - GetTrafficMonitor() -> fwrite(buf, 1, n); - } - if (!m_b_input_buffer_disabled && !ibuf.Write(buf,n)) - { - Handler().LogError(this, "OnRead(ssl)", 0, "ibuf overflow", LOG_LEVEL_WARNING); - } - } - else - { - Handler().LogError(this, "OnRead(ssl)", n, "abnormal value from SSL_read", LOG_LEVEL_ERROR); - } - } - else -#endif // HAVE_OPENSSL - { - n = recv(GetSocket(), buf, TCP_BUFSIZE_READ, MSG_NOSIGNAL); - if (n == -1) - { - Handler().LogError(this, "read", Errno, StrError(Errno), LOG_LEVEL_FATAL); - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - return; - } - else - if (!n) - { - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - SetShutdown(SHUT_WR); - return; - } - else - if (n > 0 && n <= TCP_BUFSIZE_READ) - { - m_bytes_received += n; - if (GetTrafficMonitor()) - { - GetTrafficMonitor() -> fwrite(buf, 1, n); - } - if (!m_b_input_buffer_disabled && !ibuf.Write(buf,n)) - { - Handler().LogError(this, "OnRead", 0, "ibuf overflow", LOG_LEVEL_WARNING); - } - } - else - { - Handler().LogError(this, "OnRead", n, "abnormal value from recv", LOG_LEVEL_ERROR); - } - } - // - OnRead( buf, n ); -} - -void TcpSocket::OnRead( char *buf, size_t n ) -{ - // unbuffered - if (n > 0 && n <= TCP_BUFSIZE_READ) - { - if (LineProtocol()) - { - buf[n] = 0; - size_t i = 0; - if (m_skip_c && (buf[i] == 13 || buf[i] == 10) && buf[i] != m_c) - { - m_skip_c = false; - i++; - } - size_t x = i; - for (; i < n && LineProtocol(); i++) - { - while ((buf[i] == 13 || buf[i] == 10) && LineProtocol()) - { - char c = buf[i]; - buf[i] = 0; - if (buf[x]) - { - m_line += (buf + x); - } - OnLine( m_line ); - i++; - m_skip_c = true; - m_c = c; - if (i < n && (buf[i] == 13 || buf[i] == 10) && buf[i] != c) - { - m_skip_c = false; - i++; - } - x = i; - m_line = ""; - } - if (!LineProtocol()) - { - break; - } - } - if (!LineProtocol()) - { - if (i < n) - { - OnRawData(buf + i, n - i); - } - } - else - if (buf[x]) - { - m_line += (buf + x); - } - } - else - { - OnRawData(buf, n); - } - } - if (m_b_input_buffer_disabled) - { - return; - } - // further processing: socks4 -#ifdef ENABLE_SOCKS4 - if (Socks4()) - { - bool need_more = false; - while (GetInputLength() && !need_more && !CloseAndDelete()) - { - need_more = OnSocks4Read(); - } - } -#endif -} - -void TcpSocket::OnWriteComplete() -{ -} - -void TcpSocket::OnWrite() -{ - if (Connecting()) - { - int err = SoError(); - - // don't reset connecting flag on error here, we want the OnConnectFailed timeout later on - if (!err) // ok - { - Set(!IsDisableRead(), false); - SetConnecting(false); - SetCallOnConnect(); - return; - } - Handler().LogError(this, "tcp: connect failed", err, StrError(err), LOG_LEVEL_FATAL); - Set(false, false); // no more monitoring because connection failed - - // failed -#ifdef ENABLE_SOCKS4 - if (Socks4()) - { - // %! leave 'Connecting' flag set? - OnSocks4ConnectFailed(); - return; - } -#endif - if (GetConnectionRetry() == -1 || - (GetConnectionRetry() && GetConnectionRetries() < GetConnectionRetry()) ) - { - // even though the connection failed at once, only retry after - // the connection timeout. - // should we even try to connect again, when CheckConnect returns - // false it's because of a connection error - not a timeout... - return; - } - SetConnecting(false); - SetCloseAndDelete( true ); - /// \todo state reason why connect failed - OnConnectFailed(); - return; - } - // try send next block in buffer - // if full block is sent, repeat - // if all blocks are sent, reset m_wfds - - bool repeat = false; - size_t sz = m_transfer_limit ? GetOutputLength() : 0; - do - { - output_l::iterator it = m_obuf.begin(); - OUTPUT *p = *it; - repeat = false; - int n = TryWrite(p -> Buf(), p -> Len()); - if (n > 0) - { - size_t left = p -> Remove(n); - m_output_length -= n; - if (!left) - { - delete p; - m_obuf.erase(it); - if (!m_obuf.size()) - { - m_obuf_top = NULL; - OnWriteComplete(); - } - else - { - repeat = true; - } - } - } - } while (repeat); - - if (m_transfer_limit && sz > m_transfer_limit && GetOutputLength() < m_transfer_limit) - { - OnTransferLimit(); - } - - // check output buffer set, set/reset m_wfds accordingly - { - bool br; - bool bw; - bool bx; - Handler().Get(GetSocket(), br, bw, bx); - if (m_obuf.size()) - Set(br, true); - else - Set(br, false); - } -} - -int TcpSocket::TryWrite(const char *buf, size_t len) -{ - int n = 0; -#ifdef HAVE_OPENSSL - if (IsSSL()) - { - n = SSL_write(m_ssl, buf, (int)len); - if (n == -1) - { - int errnr = SSL_get_error(m_ssl, n); - if ( errnr != SSL_ERROR_WANT_READ && errnr != SSL_ERROR_WANT_WRITE ) - { - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - const char *errbuf = ERR_error_string(errnr, NULL); - Handler().LogError(this, "OnWrite/SSL_write", errnr, errbuf, LOG_LEVEL_FATAL); - } - return 0; - } - else - if (!n) - { - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); -DEB( int errnr = SSL_get_error(m_ssl, n); - const char *errbuf = ERR_error_string(errnr, NULL); - fprintf(stderr, "SSL_write() returns 0: %d : %s\n",errnr, errbuf);) - } - } - else -#endif // HAVE_OPENSSL - { - n = send(GetSocket(), buf, (int)len, MSG_NOSIGNAL); - if (n == -1) - { - // normal error codes: - // WSAEWOULDBLOCK - // EAGAIN or EWOULDBLOCK -#ifdef _WIN32 - if (Errno != WSAEWOULDBLOCK) -#else - if (Errno != EWOULDBLOCK) -#endif - { - Handler().LogError(this, "send", Errno, StrError(Errno), LOG_LEVEL_FATAL); - OnDisconnect(); - SetCloseAndDelete(true); - SetFlushBeforeClose(false); - SetLost(); - } - return 0; - } - } - if (n > 0) - { - m_bytes_sent += n; - if (GetTrafficMonitor()) - { - GetTrafficMonitor() -> fwrite(buf, 1, n); - } - } - return n; -} - -void TcpSocket::Buffer(const char *buf, size_t len) -{ - size_t ptr = 0; - m_output_length += len; - while (ptr < len) - { - // buf/len => pbuf/sz - size_t space = 0; - if (m_obuf_top && (space = m_obuf_top -> Space()) > 0) - { - const char *pbuf = buf + ptr; - size_t sz = len - ptr; - if (space >= sz) - { - m_obuf_top -> Add(pbuf, sz); - ptr += sz; - } - else - { - m_obuf_top -> Add(pbuf, space); - ptr += space; - } - } - else - { - m_obuf_top = new OUTPUT; - m_obuf.push_back( m_obuf_top ); - } - } -} - -void TcpSocket::Send(const std::string &str,int i) -{ - SendBuf(str.c_str(),str.size(),i); -} - -void TcpSocket::SendBuf(const char *buf,size_t len,int) -{ - if (!Ready() && !Connecting()) - { - Handler().LogError(this, "SendBuf", -1, "Attempt to write to a non-ready socket" ); // warning - if (GetSocket() == INVALID_SOCKET) - Handler().LogError(this, "SendBuf", 0, " * GetSocket() == INVALID_SOCKET", LOG_LEVEL_INFO); - if (Connecting()) - Handler().LogError(this, "SendBuf", 0, " * Connecting()", LOG_LEVEL_INFO); - if (CloseAndDelete()) - Handler().LogError(this, "SendBuf", 0, " * CloseAndDelete()", LOG_LEVEL_INFO); - return; - } - if (!IsConnected()) - { - Handler().LogError(this, "SendBuf", -1, "Attempt to write to a non-connected socket, will be sent on connect" ); // warning - Buffer(buf, len); - return; - } - if (m_obuf_top) - { - Buffer(buf, len); - return; - } - int n = TryWrite(buf, len); - if (n >= 0 && n < (int)len) - { - Buffer(buf + n, len - n); - } - // if ( data in buffer || !IsConnected ) - // { - // add to buffer - // } - // else - // try_send - // if any data is unsent, buffer it and set m_wfds - - // check output buffer set, set/reset m_wfds accordingly - { - bool br; - bool bw; - bool bx; - Handler().Get(GetSocket(), br, bw, bx); - if (m_obuf.size()) - Set(br, true); - else - Set(br, false); - } -} - -void TcpSocket::OnLine(const std::string& ) -{ -} - -#ifdef _MSC_VER -#pragma warning(disable:4355) -#endif -TcpSocket::TcpSocket(const TcpSocket& s) -:StreamSocket(s) -,ibuf(0) -{ -} -#ifdef _MSC_VER -#pragma warning(default:4355) -#endif - -#ifdef ENABLE_SOCKS4 -void TcpSocket::OnSocks4Connect() -{ - char request[1000]; - memset(request, 0, sizeof(request)); - request[0] = 4; // socks v4 - request[1] = 1; // command code: CONNECT - { - std::auto_ptr ad = GetClientRemoteAddress(); - if (ad.get()) - { - struct sockaddr *p0 = (struct sockaddr *)*ad; - struct sockaddr_in *p = (struct sockaddr_in *)p0; - if (p -> sin_family == AF_INET) - { - memcpy(request + 2, &p -> sin_port, 2); // nwbo is ok here - memcpy(request + 4, &p -> sin_addr, sizeof(struct in_addr)); - } - else - { - /// \todo warn - } - } - else - { - /// \todo warn - } - } - strcpy(request + 8, GetSocks4Userid().c_str()); - size_t length = GetSocks4Userid().size() + 8 + 1; - SendBuf(request, length); - m_socks4_state = 0; -} - -void TcpSocket::OnSocks4ConnectFailed() -{ - Handler().LogError(this,"OnSocks4ConnectFailed",0,"connection to socks4 server failed, trying direct connection",LOG_LEVEL_WARNING); - if (!Handler().Socks4TryDirect()) - { - SetConnecting(false); - SetCloseAndDelete(); - OnConnectFailed(); // just in case - } - else - { - SetRetryClientConnect(); - } -} - -bool TcpSocket::OnSocks4Read() -{ - switch (m_socks4_state) - { - case 0: - ibuf.Read(&m_socks4_vn, 1); - m_socks4_state = 1; - break; - case 1: - ibuf.Read(&m_socks4_cd, 1); - m_socks4_state = 2; - break; - case 2: - if (GetInputLength() > 1) - { - ibuf.Read( (char *)&m_socks4_dstport, 2); - m_socks4_state = 3; - } - else - { - return true; - } - break; - case 3: - if (GetInputLength() > 3) - { - ibuf.Read( (char *)&m_socks4_dstip, 4); - SetSocks4(false); - - switch (m_socks4_cd) - { - case 90: - OnConnect(); - Handler().LogError(this, "OnSocks4Read", 0, "Connection established", LOG_LEVEL_INFO); - break; - case 91: - case 92: - case 93: - Handler().LogError(this,"OnSocks4Read",m_socks4_cd,"socks4 server reports connect failed",LOG_LEVEL_FATAL); - SetConnecting(false); - SetCloseAndDelete(); - OnConnectFailed(); - break; - default: - Handler().LogError(this,"OnSocks4Read",m_socks4_cd,"socks4 server unrecognized response",LOG_LEVEL_FATAL); - SetCloseAndDelete(); - break; - } - } - else - { - return true; - } - break; - } - return false; -} -#endif - -void TcpSocket::Sendf(const char *format, ...) -{ - va_list ap; - va_start(ap, format); - char slask[5000]; // vsprintf / vsnprintf temporary -#ifdef _WIN32 - vsprintf(slask, format, ap); -#else - vsnprintf(slask, 5000, format, ap); -#endif - va_end(ap); - Send( slask ); -} - -#ifdef HAVE_OPENSSL -void TcpSocket::OnSSLConnect() -{ - SetNonblocking(true); - { - if (m_ssl_ctx) - { -DEB( fprintf(stderr, "SSL Context already initialized - closing socket\n");) - SetCloseAndDelete(true); - return; - } - InitSSLClient(); - } - if (m_ssl_ctx) - { - /* Connect the SSL socket */ - m_ssl = SSL_new(m_ssl_ctx); - if (!m_ssl) - { -DEB( fprintf(stderr, " m_ssl is NULL\n");) - SetCloseAndDelete(true); - return; - } - SSL_set_mode(m_ssl, SSL_MODE_AUTO_RETRY); - m_sbio = BIO_new_socket((int)GetSocket(), BIO_NOCLOSE); - if (!m_sbio) - { -DEB( fprintf(stderr, " m_sbio is NULL\n");) - SetCloseAndDelete(true); - return; - } - SSL_set_bio(m_ssl, m_sbio, m_sbio); - if (!SSLNegotiate()) - { - SetSSLNegotiate(); - } - } - else - { - SetCloseAndDelete(); - } -} - -void TcpSocket::OnSSLAccept() -{ - SetNonblocking(true); - { - if (m_ssl_ctx) - { -DEB( fprintf(stderr, "SSL Context already initialized - closing socket\n");) - SetCloseAndDelete(true); - return; - } - InitSSLServer(); - SetSSLServer(); - } - if (m_ssl_ctx) - { - m_ssl = SSL_new(m_ssl_ctx); - if (!m_ssl) - { -DEB( fprintf(stderr, " m_ssl is NULL\n");) - SetCloseAndDelete(true); - return; - } - SSL_set_mode(m_ssl, SSL_MODE_AUTO_RETRY); - m_sbio = BIO_new_socket((int)GetSocket(), BIO_NOCLOSE); - if (!m_sbio) - { -DEB( fprintf(stderr, " m_sbio is NULL\n");) - SetCloseAndDelete(true); - return; - } - SSL_set_bio(m_ssl, m_sbio, m_sbio); -// if (!SSLNegotiate()) - { - SetSSLNegotiate(); - } - } -} - -bool TcpSocket::SSLNegotiate() -{ - if (!IsSSLServer()) // client - { - int r = SSL_connect(m_ssl); - if (r > 0) - { - SetSSLNegotiate(false); - /// \todo: resurrect certificate check... client -// CheckCertificateChain( "");//ServerHOST); - SetNonblocking(false); - // - { - SetConnected(); - if (GetOutputLength()) - { - OnWrite(); - } - } -#ifdef ENABLE_RECONNECT - if (IsReconnect()) - OnReconnect(); - else -#endif - { - OnConnect(); - } - Handler().LogError(this, "SSLNegotiate/SSL_connect", 0, "Connection established", LOG_LEVEL_INFO); - return true; - } - else - if (!r) - { - Handler().LogError(this, "SSLNegotiate/SSL_connect", 0, "Connection failed", LOG_LEVEL_INFO); - SetSSLNegotiate(false); - SetCloseAndDelete(); - OnSSLConnectFailed(); - } - else - { - r = SSL_get_error(m_ssl, r); - if (r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE) - { - Handler().LogError(this, "SSLNegotiate/SSL_connect", -1, "Connection failed", LOG_LEVEL_INFO); -DEB( fprintf(stderr, "SSL_connect() failed - closing socket, return code: %d\n",r);) - SetSSLNegotiate(false); - SetCloseAndDelete(true); - OnSSLConnectFailed(); - } - } - } - else // server - { - int r = SSL_accept(m_ssl); - if (r > 0) - { - SetSSLNegotiate(false); - /// \todo: resurrect certificate check... server -// CheckCertificateChain( "");//ClientHOST); - SetNonblocking(false); - // - { - SetConnected(); - if (GetOutputLength()) - { - OnWrite(); - } - } - OnAccept(); - Handler().LogError(this, "SSLNegotiate/SSL_accept", 0, "Connection established", LOG_LEVEL_INFO); - return true; - } - else - if (!r) - { - Handler().LogError(this, "SSLNegotiate/SSL_accept", 0, "Connection failed", LOG_LEVEL_INFO); - SetSSLNegotiate(false); - SetCloseAndDelete(); - OnSSLAcceptFailed(); - } - else - { - r = SSL_get_error(m_ssl, r); - if (r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE) - { - Handler().LogError(this, "SSLNegotiate/SSL_accept", -1, "Connection failed", LOG_LEVEL_INFO); -DEB( fprintf(stderr, "SSL_accept() failed - closing socket, return code: %d\n",r);) - SetSSLNegotiate(false); - SetCloseAndDelete(true); - OnSSLAcceptFailed(); - } - } - } - return false; -} - -void TcpSocket::InitSSLClient() -{ - InitializeContext("", SSLv23_method()); -} - -void TcpSocket::InitSSLServer() -{ - Handler().LogError(this, "InitSSLServer", 0, "You MUST implement your own InitSSLServer method", LOG_LEVEL_FATAL); - SetCloseAndDelete(); -} - -void TcpSocket::InitializeContext(const std::string& context, SSL_METHOD *meth_in) -{ - /* Create our context*/ - static std::map client_contexts; - if (client_contexts.find(context) == client_contexts.end()) - { - SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method(); - m_ssl_ctx = client_contexts[context] = SSL_CTX_new(meth); - SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY); - } - else - { - m_ssl_ctx = client_contexts[context]; - } -} - -void TcpSocket::InitializeContext(const std::string& context,const std::string& keyfile,const std::string& password,SSL_METHOD *meth_in) -{ - /* Create our context*/ - static std::map server_contexts; - if (server_contexts.find(context) == server_contexts.end()) - { - SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method(); - m_ssl_ctx = server_contexts[context] = SSL_CTX_new(meth); - SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY); - // session id - if (!context.empty()) - SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)context.c_str(), (unsigned int)context.size()); - else - SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)"--empty--", 9); - } - else - { - m_ssl_ctx = server_contexts[context]; - } - - /* Load our keys and certificates*/ - if (!(SSL_CTX_use_certificate_file(m_ssl_ctx, keyfile.c_str(), SSL_FILETYPE_PEM))) - { - Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read certificate file " + keyfile, LOG_LEVEL_FATAL); - } - - m_password = password; - SSL_CTX_set_default_passwd_cb(m_ssl_ctx, SSL_password_cb); - SSL_CTX_set_default_passwd_cb_userdata(m_ssl_ctx, this); - if (!(SSL_CTX_use_PrivateKey_file(m_ssl_ctx, keyfile.c_str(), SSL_FILETYPE_PEM))) - { - Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read private key file " + keyfile, LOG_LEVEL_FATAL); - } -} - -void TcpSocket::InitializeContext(const std::string& context,const std::string& certfile,const std::string& keyfile,const std::string& password,SSL_METHOD *meth_in) -{ - /* Create our context*/ - static std::map server_contexts; - if (server_contexts.find(context) == server_contexts.end()) - { - SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method(); - m_ssl_ctx = server_contexts[context] = SSL_CTX_new(meth); - SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY); - // session id - if (context.size()) - SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)context.c_str(), (unsigned int)context.size()); - else - SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)"--empty--", 9); - } - else - { - m_ssl_ctx = server_contexts[context]; - } - - /* Load our keys and certificates*/ - if (!(SSL_CTX_use_certificate_file(m_ssl_ctx, certfile.c_str(), SSL_FILETYPE_PEM))) - { - Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read certificate file " + keyfile, LOG_LEVEL_FATAL); - } - - m_password = password; - SSL_CTX_set_default_passwd_cb(m_ssl_ctx, SSL_password_cb); - SSL_CTX_set_default_passwd_cb_userdata(m_ssl_ctx, this); - if (!(SSL_CTX_use_PrivateKey_file(m_ssl_ctx, keyfile.c_str(), SSL_FILETYPE_PEM))) - { - Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read private key file " + keyfile, LOG_LEVEL_FATAL); - } -} - -int TcpSocket::SSL_password_cb(char *buf,int num,int rwflag,void *userdata) -{ - Socket *p0 = static_cast(userdata); - TcpSocket *p = dynamic_cast(p0); - std::string pw = p ? p -> GetPassword() : ""; - if ( (size_t)num < pw.size() + 1) - { - return 0; - } - strcpy(buf,pw.c_str()); - return (int)pw.size(); -} -#endif // HAVE_OPENSSL - -int TcpSocket::Close() -{ - if (GetSocket() == INVALID_SOCKET) // this could happen - { - Handler().LogError(this, "Socket::Close", 0, "file descriptor invalid", LOG_LEVEL_WARNING); - return 0; - } - int n; - SetNonblocking(true); - if (!Lost() && IsConnected() && !(GetShutdown() & SHUT_WR)) - { - if (shutdown(GetSocket(), SHUT_WR) == -1) - { - // failed... - Handler().LogError(this, "shutdown", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - } - // - char tmp[1000]; - if (!Lost() && (n = recv(GetSocket(),tmp,1000,0)) >= 0) - { - if (n) - { - Handler().LogError(this, "read() after shutdown", n, "bytes read", LOG_LEVEL_WARNING); - } - } -#ifdef HAVE_OPENSSL - if (IsSSL() && m_ssl) - SSL_shutdown(m_ssl); - if (m_ssl) - { - SSL_free(m_ssl); - m_ssl = NULL; - } -#endif - return Socket::Close(); -} - -#ifdef HAVE_OPENSSL -SSL_CTX *TcpSocket::GetSslContext() -{ - if (!m_ssl_ctx) - Handler().LogError(this, "GetSslContext", 0, "SSL Context is NULL; check InitSSLServer/InitSSLClient", LOG_LEVEL_WARNING); - return m_ssl_ctx; -} - -SSL *TcpSocket::GetSsl() -{ - if (!m_ssl) - Handler().LogError(this, "GetSsl", 0, "SSL is NULL; check InitSSLServer/InitSSLClient", LOG_LEVEL_WARNING); - return m_ssl; -} -#endif - -#ifdef ENABLE_RECONNECT -void TcpSocket::SetReconnect(bool x) -{ - m_b_reconnect = x; -} -#endif - -void TcpSocket::OnRawData(const char *buf_in,size_t len) -{ -} - -size_t TcpSocket::GetInputLength() -{ - return ibuf.GetLength(); -} - -size_t TcpSocket::GetOutputLength() -{ - return m_output_length; -} - -uint64_t TcpSocket::GetBytesReceived(bool clear) -{ - uint64_t z = m_bytes_received; - if (clear) - m_bytes_received = 0; - return z; -} - -uint64_t TcpSocket::GetBytesSent(bool clear) -{ - uint64_t z = m_bytes_sent; - if (clear) - m_bytes_sent = 0; - return z; -} - -#ifdef ENABLE_RECONNECT -bool TcpSocket::Reconnect() -{ - return m_b_reconnect; -} - -void TcpSocket::SetIsReconnect(bool x) -{ - m_b_is_reconnect = x; -} - -bool TcpSocket::IsReconnect() -{ - return m_b_is_reconnect; -} -#endif - -#ifdef HAVE_OPENSSL -const std::string& TcpSocket::GetPassword() -{ - return m_password; -} -#endif - -void TcpSocket::DisableInputBuffer(bool x) -{ - m_b_input_buffer_disabled = x; -} - -void TcpSocket::OnOptions(int family,int type,int protocol,SOCKET s) -{ -DEB( fprintf(stderr, "Socket::OnOptions()\n");) -#ifdef SO_NOSIGPIPE - SetSoNosigpipe(true); -#endif - SetSoReuseaddr(true); - SetSoKeepalive(true); -} - -void TcpSocket::SetLineProtocol(bool x) -{ - StreamSocket::SetLineProtocol(x); - DisableInputBuffer(x); -} - -bool TcpSocket::SetTcpNodelay(bool x) -{ -#ifdef TCP_NODELAY - int optval = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_TCP, TCP_NODELAY, (char *)&optval, sizeof(optval)) == -1) - { - Handler().LogError(this, "setsockopt(IPPROTO_TCP, TCP_NODELAY)", Errno, StrError(Errno), LOG_LEVEL_FATAL); - return false; - } - return true; -#else - Handler().LogError(this, "socket option not available", 0, "TCP_NODELAY", LOG_LEVEL_INFO); - return false; -#endif -} - -TcpSocket::CircularBuffer::CircularBuffer(size_t size) -:buf(new char[2 * size]) -,m_max(size) -,m_q(0) -,m_b(0) -,m_t(0) -,m_count(0) -{ -} - -TcpSocket::CircularBuffer::~CircularBuffer() -{ - delete[] buf; -} - -bool TcpSocket::CircularBuffer::Write(const char *s,size_t l) -{ - if (m_q + l > m_max) - { - return false; // overflow - } - m_count += (unsigned long)l; - if (m_t + l > m_max) // block crosses circular border - { - size_t l1 = m_max - m_t; // size left until circular border crossing - // always copy full block to buffer(buf) + top pointer(m_t) - // because we have doubled the buffer size for performance reasons - memcpy(buf + m_t, s, l); - memcpy(buf, s + l1, l - l1); - m_t = l - l1; - m_q += l; - } - else - { - memcpy(buf + m_t, s, l); - memcpy(buf + m_max + m_t, s, l); - m_t += l; - if (m_t >= m_max) - m_t -= m_max; - m_q += l; - } - return true; -} - -bool TcpSocket::CircularBuffer::Read(char *s,size_t l) -{ - if (l > m_q) - { - return false; // not enough chars - } - if (m_b + l > m_max) // block crosses circular border - { - size_t l1 = m_max - m_b; - if (s) - { - memcpy(s, buf + m_b, l1); - memcpy(s + l1, buf, l - l1); - } - m_b = l - l1; - m_q -= l; - } - else - { - if (s) - { - memcpy(s, buf + m_b, l); - } - m_b += l; - if (m_b >= m_max) - m_b -= m_max; - m_q -= l; - } - if (!m_q) - { - m_b = m_t = 0; - } - return true; -} - -bool TcpSocket::CircularBuffer::SoftRead(char *s, size_t l) -{ - if (l > m_q) - { - return false; - } - if (m_b + l > m_max) // block crosses circular border - { - size_t l1 = m_max - m_b; - if (s) - { - memcpy(s, buf + m_b, l1); - memcpy(s + l1, buf, l - l1); - } - } - else - { - if (s) - { - memcpy(s, buf + m_b, l); - } - } - return true; -} - -bool TcpSocket::CircularBuffer::Remove(size_t l) -{ - return Read(NULL, l); -} - -size_t TcpSocket::CircularBuffer::GetLength() -{ - return m_q; -} - -const char *TcpSocket::CircularBuffer::GetStart() -{ - return buf + m_b; -} - -size_t TcpSocket::CircularBuffer::GetL() -{ - return (m_b + m_q > m_max) ? m_max - m_b : m_q; -} - -size_t TcpSocket::CircularBuffer::Space() -{ - return m_max - m_q; -} - -unsigned long TcpSocket::CircularBuffer::ByteCounter(bool clear) -{ - if (clear) - { - unsigned long x = m_count; - m_count = 0; - return x; - } - return m_count; -} - -std::string TcpSocket::CircularBuffer::ReadString(size_t l) -{ - char *sz = new char[l + 1]; - if (!Read(sz, l)) // failed, debug printout in Read() method - { - delete[] sz; - return ""; - } - sz[l] = 0; - std::string tmp = sz; - delete[] sz; - return tmp; -} - -void TcpSocket::OnConnectTimeout() -{ - Handler().LogError(this, "connect", -1, "connect timeout", LOG_LEVEL_FATAL); -#ifdef ENABLE_SOCKS4 - if (Socks4()) - { - OnSocks4ConnectFailed(); - // retry direct connection - } - else -#endif - if (GetConnectionRetry() == -1 || - (GetConnectionRetry() && GetConnectionRetries() < GetConnectionRetry()) ) - { - IncreaseConnectionRetries(); - // ask socket via OnConnectRetry callback if we should continue trying - if (OnConnectRetry()) - { - SetRetryClientConnect(); - } - else - { - SetCloseAndDelete( true ); - /// \todo state reason why connect failed - OnConnectFailed(); - } - } - else - { - SetCloseAndDelete(true); - /// \todo state reason why connect failed - OnConnectFailed(); - } - // - SetConnecting(false); -} - -#ifdef _WIN32 -void TcpSocket::OnException() -{ - if (Connecting()) - { -#ifdef ENABLE_SOCKS4 - if (Socks4()) - OnSocks4ConnectFailed(); - else -#endif - if (GetConnectionRetry() == -1 || - (GetConnectionRetry() && - GetConnectionRetries() < GetConnectionRetry() )) - { - // even though the connection failed at once, only retry after - // the connection timeout - // should we even try to connect again, when CheckConnect returns - // false it's because of a connection error - not a timeout... - } - else - { - SetConnecting(false); // tnx snibbe - SetCloseAndDelete(); - OnConnectFailed(); - } - return; - } - // %! exception doesn't always mean something bad happened, this code should be reworked - // errno valid here? - int err = SoError(); - Handler().LogError(this, "exception on select", err, StrError(err), LOG_LEVEL_FATAL); - SetCloseAndDelete(); -} -#endif // _WIN32 - -int TcpSocket::Protocol() -{ - return IPPROTO_TCP; -} - -void TcpSocket::SetTransferLimit(size_t sz) -{ - m_transfer_limit = sz; -} - -void TcpSocket::OnTransferLimit() -{ -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/Thread.cpp b/dep/src/sockets/Thread.cpp deleted file mode 100644 index 773e9f214fa..00000000000 --- a/dep/src/sockets/Thread.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/** \file Thread.cpp - ** \date 2004-10-30 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include -#ifdef _WIN32 -#include -#include "socket_include.h" -#else -#include -#endif - -#include "Thread.h" - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -Thread::Thread(bool release) -:m_thread(0) -,m_running(true) -,m_release(false) -,m_b_delete_on_exit(false) -,m_b_destructor(false) -{ -#ifdef _WIN32 -// m_thread = ::CreateThread(NULL, 0, StartThread, this, 0, &m_dwThreadId); - m_thread = (HANDLE)_beginthreadex(NULL, 0, &StartThread, this, 0, &m_dwThreadId); -#else - pthread_attr_t attr; - - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); - if (pthread_create(&m_thread,&attr, StartThread,this) == -1) - { - perror("Thread: create failed"); - SetRunning(false); - } -// pthread_attr_destroy(&attr); -#endif - m_release = release; -} - -Thread::~Thread() -{ - m_b_destructor = true; - if (m_running) - { - SetRelease(true); - SetRunning(false); -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } -#ifdef _WIN32 - if (m_thread) - ::CloseHandle(m_thread); -#endif -} - -threadfunc_t STDPREFIX Thread::StartThread(threadparam_t zz) -{ - Thread *p = (Thread *)zz; - - while (p -> m_running && !p -> m_release) - { -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } - if (p -> m_running) - { - p -> Run(); - } - p -> SetRunning(false); // if return - if (p -> DeleteOnExit() && !p -> IsDestructor()) - { - delete p; - } -#ifdef _WIN32 - _endthreadex(0); -#endif - return (threadfunc_t)NULL; -} - -bool Thread::IsRunning() -{ - return m_running; -} - -void Thread::SetRunning(bool x) -{ - m_running = x; -} - -bool Thread::IsReleased() -{ - return m_release; -} - -void Thread::SetRelease(bool x) -{ - m_release = x; -} - -bool Thread::DeleteOnExit() -{ - return m_b_delete_on_exit; -} - -void Thread::SetDeleteOnExit(bool x) -{ - m_b_delete_on_exit = x; -} - -bool Thread::IsDestructor() -{ - return m_b_destructor; -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/UdpSocket.cpp b/dep/src/sockets/UdpSocket.cpp deleted file mode 100644 index a3d393c00e2..00000000000 --- a/dep/src/sockets/UdpSocket.cpp +++ /dev/null @@ -1,810 +0,0 @@ -/** \file UdpSocket.cpp - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#ifdef _WIN32 -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif -#include -#else -#include -#endif - -#include "ISocketHandler.h" -#include "UdpSocket.h" -#include "Utility.h" -#include "Ipv4Address.h" -#include "Ipv6Address.h" -#ifdef ENABLE_EXCEPTIONS -#include "Exception.h" -#endif -// include this to see strange sights -//#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -UdpSocket::UdpSocket(ISocketHandler& h, int ibufsz, bool ipv6, int retries) : Socket(h) -, m_ibuf(new char[ibufsz]) -, m_ibufsz(ibufsz) -, m_bind_ok(false) -, m_port(0) -, m_last_size_written(-1) -, m_retries(retries) -, m_b_read_ts(false) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - SetIpv6(ipv6); -#endif -#endif -} - -UdpSocket::~UdpSocket() -{ - Close(); - delete[] m_ibuf; -} - -int UdpSocket::Bind(port_t &port, int range) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(port); - return Bind(ad, range); - } -#endif -#endif - Ipv4Address ad(port); - return Bind(ad, range); -} - -int UdpSocket::Bind(const std::string& intf, port_t &port, int range) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, range); - } - SetCloseAndDelete(); - return -1; - } -#endif -#endif - Ipv4Address ad(intf, port); - if (ad.IsValid()) - { - return Bind(ad, range); - } - SetCloseAndDelete(); - return -1; -} - -int UdpSocket::Bind(ipaddr_t a, port_t &port, int range) -{ - Ipv4Address ad(a, port); - return Bind(ad, range); -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -int UdpSocket::Bind(in6_addr a, port_t &port, int range) -{ - Ipv6Address ad(a, port); - return Bind(ad, range); -} -#endif -#endif - -int UdpSocket::Bind(SocketAddress& ad, int range) -{ - if (GetSocket() == INVALID_SOCKET) - { - Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp")); - } - if (GetSocket() != INVALID_SOCKET) - { - SetNonblocking(true); - int n = bind(GetSocket(), ad, ad); - int tries = range; - while (n == -1 && tries--) - { - ad.SetPort(ad.GetPort() + 1); - n = bind(GetSocket(), ad, ad); - } - if (n == -1) - { - Handler().LogError(this, "bind", Errno, StrError(Errno), LOG_LEVEL_FATAL); - SetCloseAndDelete(); -#ifdef ENABLE_EXCEPTIONS - throw Exception("bind() failed for UdpSocket, port:range: " + Utility::l2string(ad.GetPort()) + ":" + Utility::l2string(range)); -#endif - return -1; - } - m_bind_ok = true; - m_port = ad.GetPort(); - return 0; - } - return -1; -} - -/** if you wish to use Send, first Open a connection */ -bool UdpSocket::Open(ipaddr_t l, port_t port) -{ - Ipv4Address ad(l, port); - return Open(ad); -} - -bool UdpSocket::Open(const std::string& host, port_t port) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(host, port); - if (ad.IsValid()) - { - return Open(ad); - } - return false; - } -#endif -#endif - Ipv4Address ad(host, port); - if (ad.IsValid()) - { - return Open(ad); - } - return false; -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -bool UdpSocket::Open(struct in6_addr& a, port_t port) -{ - Ipv6Address ad(a, port); - return Open(ad); -} -#endif -#endif - -bool UdpSocket::Open(SocketAddress& ad) -{ - if (GetSocket() == INVALID_SOCKET) - { - Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp")); - } - if (GetSocket() != INVALID_SOCKET) - { - SetNonblocking(true); - if (connect(GetSocket(), ad, ad) == -1) - { - Handler().LogError(this, "connect", Errno, StrError(Errno), LOG_LEVEL_FATAL); - SetCloseAndDelete(); - return false; - } - SetConnected(); - return true; - } - return false; -} - -void UdpSocket::CreateConnection() -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - if (GetSocket() == INVALID_SOCKET) - { - SOCKET s = CreateSocket(AF_INET6, SOCK_DGRAM, "udp"); - if (s == INVALID_SOCKET) - { - return; - } - SetNonblocking(true, s); - Attach(s); - } - return; - } -#endif -#endif - if (GetSocket() == INVALID_SOCKET) - { - SOCKET s = CreateSocket(AF_INET, SOCK_DGRAM, "udp"); - if (s == INVALID_SOCKET) - { - return; - } - SetNonblocking(true, s); - Attach(s); - } -} - -/** send to specified address */ -void UdpSocket::SendToBuf(const std::string& h, port_t p, const char *data, int len, int flags) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - Ipv6Address ad(h, p); - if (ad.IsValid()) - { - SendToBuf(ad, data, len, flags); - } - return; - } -#endif -#endif - Ipv4Address ad(h, p); - if (ad.IsValid()) - { - SendToBuf(ad, data, len, flags); - } -} - -/** send to specified address */ -void UdpSocket::SendToBuf(ipaddr_t a, port_t p, const char *data, int len, int flags) -{ - Ipv4Address ad(a, p); - SendToBuf(ad, data, len, flags); -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -void UdpSocket::SendToBuf(in6_addr a, port_t p, const char *data, int len, int flags) -{ - Ipv6Address ad(a, p); - SendToBuf(ad, data, len, flags); -} -#endif -#endif - -void UdpSocket::SendToBuf(SocketAddress& ad, const char *data, int len, int flags) -{ - if (GetSocket() == INVALID_SOCKET) - { - Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp")); - } - if (GetSocket() != INVALID_SOCKET) - { - SetNonblocking(true); - if ((m_last_size_written = sendto(GetSocket(), data, len, flags, ad, ad)) == -1) - { - Handler().LogError(this, "sendto", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - } -} - -void UdpSocket::SendTo(const std::string& a, port_t p, const std::string& str, int flags) -{ - SendToBuf(a, p, str.c_str(), (int)str.size(), flags); -} - -void UdpSocket::SendTo(ipaddr_t a, port_t p, const std::string& str, int flags) -{ - SendToBuf(a, p, str.c_str(), (int)str.size(), flags); -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -void UdpSocket::SendTo(in6_addr a, port_t p, const std::string& str, int flags) -{ - SendToBuf(a, p, str.c_str(), (int)str.size(), flags); -} -#endif -#endif - -void UdpSocket::SendTo(SocketAddress& ad, const std::string& str, int flags) -{ - SendToBuf(ad, str.c_str(), (int)str.size(), flags); -} - -/** send to connected address */ -void UdpSocket::SendBuf(const char *data, size_t len, int flags) -{ - if (!IsConnected()) - { - Handler().LogError(this, "SendBuf", 0, "not connected", LOG_LEVEL_ERROR); - return; - } - if ((m_last_size_written = send(GetSocket(), data, (int)len, flags)) == -1) - { - Handler().LogError(this, "send", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } -} - -void UdpSocket::Send(const std::string& str, int flags) -{ - SendBuf(str.c_str(), (int)str.size(), flags); -} - -#if defined(LINUX) || defined(MACOSX) -int UdpSocket::ReadTS(char *ioBuf, int inBufSize, struct sockaddr *from, socklen_t fromlen, struct timeval *ts) -{ - struct msghdr msg; - struct iovec vec[1]; - union { - struct cmsghdr cm; -#ifdef MACOSX -#ifdef __DARWIN_UNIX03 -#define ALIGNBYTES __DARWIN_ALIGNBYTES -#endif -#define myALIGN(p) (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES) -#define myCMSG_SPACE(l) (myALIGN(sizeof(struct cmsghdr)) + myALIGN(l)) - char data[ myCMSG_SPACE(sizeof(struct timeval)) ]; -#else - char data[ CMSG_SPACE(sizeof(struct timeval)) ]; -#endif - } cmsg_un; - struct cmsghdr *cmsg; - struct timeval *tv; - - vec[0].iov_base = ioBuf; - vec[0].iov_len = inBufSize; - - memset(&msg, 0, sizeof(msg)); - memset(from, 0, fromlen); - memset(ioBuf, 0, inBufSize); - memset(&cmsg_un, 0, sizeof(cmsg_un)); - - msg.msg_name = (caddr_t)from; - msg.msg_namelen = fromlen; - msg.msg_iov = vec; - msg.msg_iovlen = 1; - msg.msg_control = cmsg_un.data; - msg.msg_controllen = sizeof(cmsg_un.data); - msg.msg_flags = 0; - - // Original version - for reference only - //int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); - - int n = recvmsg(GetSocket(), &msg, MSG_DONTWAIT); - - // now ioBuf will contain the data, as if we used recvfrom - - // Now get the time - if(n != -1 && msg.msg_controllen >= sizeof(struct cmsghdr) && !(msg.msg_flags & MSG_CTRUNC)) - { - tv = 0; - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) - { - if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP) - { - tv = (struct timeval *)CMSG_DATA(cmsg); - } - } - if (tv) - { - memcpy(ts, tv, sizeof(struct timeval)); - } - } - // The address is in network order, but that's OK right now - return n; -} -#endif - -void UdpSocket::OnRead() -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - struct sockaddr_in6 sa; - socklen_t sa_len = sizeof(sa); - if (m_b_read_ts) - { - struct timeval ts; - Utility::GetTime(&ts); -#if !defined(LINUX) && !defined(MACOSX) - int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); -#else - int n = ReadTS(m_ibuf, m_ibufsz, (struct sockaddr *)&sa, sa_len, &ts); -#endif - if (n > 0) - { - this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len, &ts); - } - else - if (n == -1) - { -#ifdef _WIN32 - if (Errno != WSAEWOULDBLOCK) -#else - if (Errno != EWOULDBLOCK) -#endif - Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - return; - } - int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); - int q = m_retries; // receive max 10 at one cycle - while (n > 0) - { - if (sa_len != sizeof(sa)) - { - Handler().LogError(this, "recvfrom", 0, "unexpected address struct size", LOG_LEVEL_WARNING); - } - this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len); - if (!q--) - break; - // - n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); - } - if (n == -1) - { -#ifdef _WIN32 - if (Errno != WSAEWOULDBLOCK) -#else - if (Errno != EWOULDBLOCK) -#endif - Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - return; - } -#endif -#endif - struct sockaddr_in sa; - socklen_t sa_len = sizeof(sa); - if (m_b_read_ts) - { - struct timeval ts; - Utility::GetTime(&ts); -#if !defined(LINUX) && !defined(MACOSX) - int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); -#else - int n = ReadTS(m_ibuf, m_ibufsz, (struct sockaddr *)&sa, sa_len, &ts); -#endif - if (n > 0) - { - this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len, &ts); - } - else - if (n == -1) - { -#ifdef _WIN32 - if (Errno != WSAEWOULDBLOCK) -#else - if (Errno != EWOULDBLOCK) -#endif - Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } - return; - } - int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); - int q = m_retries; - while (n > 0) - { - if (sa_len != sizeof(sa)) - { - Handler().LogError(this, "recvfrom", 0, "unexpected address struct size", LOG_LEVEL_WARNING); - } - this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len); - if (!q--) - break; - // - n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len); - } - if (n == -1) - { -#ifdef _WIN32 - if (Errno != WSAEWOULDBLOCK) -#else - if (Errno != EWOULDBLOCK) -#endif - Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR); - } -} - -void UdpSocket::SetBroadcast(bool b) -{ - int one = 1; - int zero = 0; - - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } - if (b) - { - if (setsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *) &one, sizeof(one)) == -1) - { - Handler().LogError(this, "SetBroadcast", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - } - else - { - if (setsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *) &zero, sizeof(zero)) == -1) - { - Handler().LogError(this, "SetBroadcast", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - } -} - -bool UdpSocket::IsBroadcast() -{ - int is_broadcast = 0; - socklen_t size; - - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } - if (getsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *)&is_broadcast, &size) == -1) - { - Handler().LogError(this, "IsBroadcast", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - return is_broadcast != 0; -} - -void UdpSocket::SetMulticastTTL(int ttl) -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } - if (setsockopt(GetSocket(), SOL_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(int)) == -1) - { - Handler().LogError(this, "SetMulticastTTL", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } -} - -int UdpSocket::GetMulticastTTL() -{ - int ttl = 0; - socklen_t size = sizeof(int); - - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } - if (getsockopt(GetSocket(), SOL_IP, IP_MULTICAST_TTL, (char *)&ttl, &size) == -1) - { - Handler().LogError(this, "GetMulticastTTL", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - return ttl; -} - -void UdpSocket::SetMulticastLoop(bool x) -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - int val = x ? 1 : 0; - if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (char *)&val, sizeof(int)) == -1) - { - Handler().LogError(this, "SetMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - return; - } -#endif -#endif - int val = x ? 1 : 0; - if (setsockopt(GetSocket(), SOL_IP, IP_MULTICAST_LOOP, (char *)&val, sizeof(int)) == -1) - { - Handler().LogError(this, "SetMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } -} - -bool UdpSocket::IsMulticastLoop() -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - int is_loop = 0; - socklen_t size = sizeof(int); - if (getsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (char *)&is_loop, &size) == -1) - { - Handler().LogError(this, "IsMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - return is_loop ? true : false; - } -#endif -#endif - int is_loop = 0; - socklen_t size = sizeof(int); - if (getsockopt(GetSocket(), SOL_IP, IP_MULTICAST_LOOP, (char *)&is_loop, &size) == -1) - { - Handler().LogError(this, "IsMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - return is_loop ? true : false; -} - -void UdpSocket::AddMulticastMembership(const std::string& group, const std::string& local_if, int if_index) -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - struct ipv6_mreq x; - struct in6_addr addr; - if (Utility::u2ip( group, addr )) - { - x.ipv6mr_multiaddr = addr; - x.ipv6mr_interface = if_index; - if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, (char *)&x, sizeof(struct ipv6_mreq)) == -1) - { - Handler().LogError(this, "AddMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - } - return; - } -#endif -#endif - struct ip_mreq x; // ip_mreqn - ipaddr_t addr; - if (Utility::u2ip( group, addr )) - { - memcpy(&x.imr_multiaddr.s_addr, &addr, sizeof(addr)); - Utility::u2ip( local_if, addr); - memcpy(&x.imr_interface.s_addr, &addr, sizeof(addr)); -// x.imr_ifindex = if_index; - if (setsockopt(GetSocket(), SOL_IP, IP_ADD_MEMBERSHIP, (char *)&x, sizeof(struct ip_mreq)) == -1) - { - Handler().LogError(this, "AddMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - } -} - -void UdpSocket::DropMulticastMembership(const std::string& group, const std::string& local_if, int if_index) -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (IsIpv6()) - { - struct ipv6_mreq x; - struct in6_addr addr; - if (Utility::u2ip( group, addr )) - { - x.ipv6mr_multiaddr = addr; - x.ipv6mr_interface = if_index; - if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, (char *)&x, sizeof(struct ipv6_mreq)) == -1) - { - Handler().LogError(this, "DropMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - } - return; - } -#endif -#endif - struct ip_mreq x; // ip_mreqn - ipaddr_t addr; - if (Utility::u2ip( group, addr )) - { - memcpy(&x.imr_multiaddr.s_addr, &addr, sizeof(addr)); - Utility::u2ip( local_if, addr); - memcpy(&x.imr_interface.s_addr, &addr, sizeof(addr)); -// x.imr_ifindex = if_index; - if (setsockopt(GetSocket(), SOL_IP, IP_DROP_MEMBERSHIP, (char *)&x, sizeof(struct ip_mreq)) == -1) - { - Handler().LogError(this, "DropMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - } -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -void UdpSocket::SetMulticastHops(int hops) -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } - if (!IsIpv6()) - { - Handler().LogError(this, "SetMulticastHops", 0, "Ipv6 only", LOG_LEVEL_ERROR); - return; - } - if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&hops, sizeof(int)) == -1) - { - Handler().LogError(this, "SetMulticastHops", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } -} - -int UdpSocket::GetMulticastHops() -{ - if (GetSocket() == INVALID_SOCKET) - { - CreateConnection(); - } - if (!IsIpv6()) - { - Handler().LogError(this, "SetMulticastHops", 0, "Ipv6 only", LOG_LEVEL_ERROR); - return -1; - } - int hops = 0; - socklen_t size = sizeof(int); - if (getsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&hops, &size) == -1) - { - Handler().LogError(this, "GetMulticastHops", Errno, StrError(Errno), LOG_LEVEL_WARNING); - } - return hops; -} -#endif // IPPROTO_IPV6 -#endif - -bool UdpSocket::IsBound() -{ - return m_bind_ok; -} - -void UdpSocket::OnRawData(const char *buf, size_t len, struct sockaddr *sa, socklen_t sa_len) -{ -} - -void UdpSocket::OnRawData(const char *buf, size_t len, struct sockaddr *sa, socklen_t sa_len, struct timeval *ts) -{ -} - -port_t UdpSocket::GetPort() -{ - return m_port; -} - -int UdpSocket::GetLastSizeWritten() -{ - return m_last_size_written; -} - -void UdpSocket::SetTimestamp(bool x) -{ - m_b_read_ts = x; -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/Utility.cpp b/dep/src/sockets/Utility.cpp deleted file mode 100644 index 7c093fc0832..00000000000 --- a/dep/src/sockets/Utility.cpp +++ /dev/null @@ -1,960 +0,0 @@ -/** \file Utility.cpp - ** \date 2004-02-13 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "Utility.h" -#include "Parse.h" -#include "Ipv4Address.h" -#include "Ipv6Address.h" -#include "Base64.h" -#include -#ifdef _WIN32 -#include -#else -#include -#include -#endif -#include - -#ifdef SOCKETS_NAMESPACE -namespace SOCKETS_NAMESPACE { -#endif - -// defines for the random number generator -#define TWIST_IA 397 -#define TWIST_IB (TWIST_LEN - TWIST_IA) -#define UMASK 0x80000000 -#define LMASK 0x7FFFFFFF -#define MATRIX_A 0x9908B0DF -#define TWIST(b,i,j) ((b)[i] & UMASK) | ((b)[j] & LMASK) -#define MAGIC_TWIST(s) (((s) & 1) * MATRIX_A) - -// statics -std::string Utility::m_host; -bool Utility::m_local_resolved = false; -ipaddr_t Utility::m_ip = 0; -std::string Utility::m_addr; -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -struct in6_addr Utility::m_local_ip6; -std::string Utility::m_local_addr6; -#endif -#endif - -std::string Utility::base64(const std::string& str_in) -{ - std::string str; - Base64 m_b; - m_b.encode(str_in, str, false); // , false == do not add cr/lf - return str; -} - -std::string Utility::base64d(const std::string& str_in) -{ - std::string str; - Base64 m_b; - m_b.decode(str_in, str); - return str; -} - -std::string Utility::l2string(long l) -{ - std::string str; - char tmp[100]; - sprintf(tmp,"%ld",l); - str = tmp; - return str; -} - -std::string Utility::bigint2string(uint64_t l) -{ - std::string str; - uint64_t tmp = l; - while (tmp) - { - uint64_t a = tmp % 10; - str = (char)(a + 48) + str; - tmp /= 10; - } - if (str.empty()) - { - str = "0"; - } - return str; -} - -uint64_t Utility::atoi64(const std::string& str) -{ - uint64_t l = 0; - for (size_t i = 0; i < str.size(); i++) - { - l = l * 10 + str[i] - 48; - } - return l; -} - -unsigned int Utility::hex2unsigned(const std::string& str) -{ - unsigned int r = 0; - for (size_t i = 0; i < str.size(); i++) - { - r = r * 16 + str[i] - 48 - ((str[i] >= 'A') ? 7 : 0) - ((str[i] >= 'a') ? 32 : 0); - } - return r; -} - -/* -* Encode string per RFC1738 URL encoding rules -* tnx rstaveley -*/ -std::string Utility::rfc1738_encode(const std::string& src) -{ -static char hex[] = "0123456789ABCDEF"; - std::string dst; - for (size_t i = 0; i < src.size(); i++) - { - if (isalnum(src[i])) - { - dst += src[i]; - } - else - if (src[i] == ' ') - { - dst += '+'; - } - else - { - unsigned char c = static_cast(src[i]); - dst += '%'; - dst += hex[c / 16]; - dst += hex[c % 16]; - } - } - return dst; -} // rfc1738_encode - -/* -* Decode string per RFC1738 URL encoding rules -* tnx rstaveley -*/ -std::string Utility::rfc1738_decode(const std::string& src) -{ - std::string dst; - for (size_t i = 0; i < src.size(); i++) - { - if (src[i] == '%' && isxdigit(src[i + 1]) && isxdigit(src[i + 2])) - { - char c1 = src[++i]; - char c2 = src[++i]; - c1 = c1 - 48 - ((c1 >= 'A') ? 7 : 0) - ((c1 >= 'a') ? 32 : 0); - c2 = c2 - 48 - ((c2 >= 'A') ? 7 : 0) - ((c2 >= 'a') ? 32 : 0); - dst += (char)(c1 * 16 + c2); - } - else - if (src[i] == '+') - { - dst += ' '; - } - else - { - dst += src[i]; - } - } - return dst; -} // rfc1738_decode - -bool Utility::isipv4(const std::string& str) -{ - int dots = 0; - // %! ignore :port? - for (size_t i = 0; i < str.size(); i++) - { - if (str[i] == '.') - dots++; - else - if (!isdigit(str[i])) - return false; - } - if (dots != 3) - return false; - return true; -} - -bool Utility::isipv6(const std::string& str) -{ - size_t qc = 0; - size_t qd = 0; - for (size_t i = 0; i < str.size(); i++) - { - qc += (str[i] == ':') ? 1 : 0; - qd += (str[i] == '.') ? 1 : 0; - } - if (qc > 7) - { - return false; - } - if (qd && qd != 3) - { - return false; - } - Parse pa(str,":."); - std::string tmp = pa.getword(); - while (!tmp.empty()) - { - if (tmp.size() > 4) - { - return false; - } - for (size_t i = 0; i < tmp.size(); i++) - { - if (tmp[i] < '0' || (tmp[i] > '9' && tmp[i] < 'A') || - (tmp[i] > 'F' && tmp[i] < 'a') || tmp[i] > 'f') - { - return false; - } - } - // - tmp = pa.getword(); - } - return true; -} - -bool Utility::u2ip(const std::string& str, ipaddr_t& l) -{ - struct sockaddr_in sa; - bool r = Utility::u2ip(str, sa); - memcpy(&l, &sa.sin_addr, sizeof(l)); - return r; -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -bool Utility::u2ip(const std::string& str, struct in6_addr& l) -{ - struct sockaddr_in6 sa; - bool r = Utility::u2ip(str, sa); - l = sa.sin6_addr; - return r; -} -#endif -#endif - -void Utility::l2ip(const ipaddr_t ip, std::string& str) -{ - struct sockaddr_in sa; - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; - memcpy(&sa.sin_addr, &ip, sizeof(sa.sin_addr)); - Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), str, NI_NUMERICHOST); -} - -void Utility::l2ip(const in_addr& ip, std::string& str) -{ - struct sockaddr_in sa; - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; - sa.sin_addr = ip; - Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), str, NI_NUMERICHOST); -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -void Utility::l2ip(const struct in6_addr& ip, std::string& str,bool mixed) -{ - char slask[100]; // l2ip temporary - *slask = 0; - unsigned int prev = 0; - bool skipped = false; - bool ok_to_skip = true; - if (mixed) - { - unsigned short x; - unsigned short addr16[8]; - memcpy(addr16, &ip, sizeof(addr16)); - for (size_t i = 0; i < 6; i++) - { - x = ntohs(addr16[i]); - if (*slask && (x || !ok_to_skip || prev)) - strcat(slask,":"); - if (x || !ok_to_skip) - { - sprintf(slask + strlen(slask),"%x", x); - if (x && skipped) - ok_to_skip = false; - } - else - { - skipped = true; - } - prev = x; - } - x = ntohs(addr16[6]); - sprintf(slask + strlen(slask),":%u.%u",x / 256,x & 255); - x = ntohs(addr16[7]); - sprintf(slask + strlen(slask),".%u.%u",x / 256,x & 255); - } - else - { - struct sockaddr_in6 sa; - memset(&sa, 0, sizeof(sa)); - sa.sin6_family = AF_INET6; - sa.sin6_addr = ip; - Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), str, NI_NUMERICHOST); - return; - } - str = slask; -} - -int Utility::in6_addr_compare(in6_addr a,in6_addr b) -{ - for (size_t i = 0; i < 16; i++) - { - if (a.s6_addr[i] < b.s6_addr[i]) - return -1; - if (a.s6_addr[i] > b.s6_addr[i]) - return 1; - } - return 0; -} -#endif -#endif - -void Utility::ResolveLocal() -{ - char h[256]; - - // get local hostname and translate into ip-address - *h = 0; - gethostname(h,255); - { - if (Utility::u2ip(h, m_ip)) - { - Utility::l2ip(m_ip, m_addr); - } - } -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - memset(&m_local_ip6, 0, sizeof(m_local_ip6)); - { - if (Utility::u2ip(h, m_local_ip6)) - { - Utility::l2ip(m_local_ip6, m_local_addr6); - } - } -#endif -#endif - m_host = h; - m_local_resolved = true; -} - -const std::string& Utility::GetLocalHostname() -{ - if (!m_local_resolved) - { - ResolveLocal(); - } - return m_host; -} - -ipaddr_t Utility::GetLocalIP() -{ - if (!m_local_resolved) - { - ResolveLocal(); - } - return m_ip; -} - -const std::string& Utility::GetLocalAddress() -{ - if (!m_local_resolved) - { - ResolveLocal(); - } - return m_addr; -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -const struct in6_addr& Utility::GetLocalIP6() -{ - if (!m_local_resolved) - { - ResolveLocal(); - } - return m_local_ip6; -} - -const std::string& Utility::GetLocalAddress6() -{ - if (!m_local_resolved) - { - ResolveLocal(); - } - return m_local_addr6; -} -#endif -#endif - -void Utility::SetEnv(const std::string& var,const std::string& value) -{ -#if (defined(SOLARIS8) || defined(SOLARIS)) - { - static std::map vmap; - if (vmap.find(var) != vmap.end()) - { - delete[] vmap[var]; - } - vmap[var] = new char[var.size() + 1 + value.size() + 1]; - sprintf(vmap[var], "%s=%s", var.c_str(), value.c_str()); - putenv( vmap[var] ); - } -#elif defined _WIN32 - { - std::string slask = var + "=" + value; - _putenv( (char *)slask.c_str()); - } -#else - setenv(var.c_str(), value.c_str(), 1); -#endif -} - -std::string Utility::Sa2String(struct sockaddr *sa) -{ -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - if (sa -> sa_family == AF_INET6) - { - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa; - std::string tmp; - Utility::l2ip(sa6 -> sin6_addr, tmp); - return tmp + ":" + Utility::l2string(ntohs(sa6 -> sin6_port)); - } -#endif -#endif - if (sa -> sa_family == AF_INET) - { - struct sockaddr_in *sa4 = (struct sockaddr_in *)sa; - ipaddr_t a; - memcpy(&a, &sa4 -> sin_addr, 4); - std::string tmp; - Utility::l2ip(a, tmp); - return tmp + ":" + Utility::l2string(ntohs(sa4 -> sin_port)); - } - return ""; -} - -void Utility::GetTime(struct timeval *p) -{ -#ifdef _WIN32 - FILETIME ft; // Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC). - GetSystemTimeAsFileTime(&ft); - uint64_t tt; - memcpy(&tt, &ft, sizeof(tt)); - tt /= 10; // make it usecs - p->tv_sec = (long)tt / 1000000; - p->tv_usec = (long)tt % 1000000; -#else - gettimeofday(p, NULL); -#endif -} - -std::auto_ptr Utility::CreateAddress(struct sockaddr *sa,socklen_t sa_len) -{ - switch (sa -> sa_family) - { - case AF_INET: - if (sa_len == sizeof(struct sockaddr_in)) - { - struct sockaddr_in *p = (struct sockaddr_in *)sa; - return std::auto_ptr(new Ipv4Address(*p)); - } - break; -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 - case AF_INET6: - if (sa_len == sizeof(struct sockaddr_in6)) - { - struct sockaddr_in6 *p = (struct sockaddr_in6 *)sa; - return std::auto_ptr(new Ipv6Address(*p)); - } - break; -#endif -#endif - } - return std::auto_ptr(NULL); -} - -bool Utility::u2ip(const std::string& host, struct sockaddr_in& sa, int ai_flags) -{ - memset(&sa, 0, sizeof(sa)); - sa.sin_family = AF_INET; -#ifdef NO_GETADDRINFO - if ((ai_flags & AI_NUMERICHOST) != 0 || isipv4(host)) - { - Parse pa((char *)host.c_str(), "."); - union { - struct { - unsigned char b1; - unsigned char b2; - unsigned char b3; - unsigned char b4; - } a; - ipaddr_t l; - } u; - u.a.b1 = static_cast(pa.getvalue()); - u.a.b2 = static_cast(pa.getvalue()); - u.a.b3 = static_cast(pa.getvalue()); - u.a.b4 = static_cast(pa.getvalue()); - memcpy(&sa.sin_addr, &u.l, sizeof(sa.sin_addr)); - return true; - } -#ifndef LINUX - struct hostent *he = gethostbyname( host.c_str() ); - if (!he) - { - return false; - } - memcpy(&sa.sin_addr, he -> h_addr, sizeof(sa.sin_addr)); -#else - struct hostent he; - struct hostent *result = NULL; - int myerrno = 0; - char buf[2000]; - int n = gethostbyname_r(host.c_str(), &he, buf, sizeof(buf), &result, &myerrno); - if (n || !result) - { - return false; - } - if (he.h_addr_list && he.h_addr_list[0]) - memcpy(&sa.sin_addr, he.h_addr, 4); - else - return false; -#endif - return true; -#else - struct addrinfo hints; - memset(&hints, 0, sizeof(hints)); - // AI_NUMERICHOST - // AI_CANONNAME - // AI_PASSIVE - server - // AI_ADDRCONFIG - // AI_V4MAPPED - // AI_ALL - // AI_NUMERICSERV - hints.ai_flags = ai_flags; - hints.ai_family = AF_INET; - hints.ai_socktype = 0; - hints.ai_protocol = 0; - struct addrinfo *res; - if (Utility::isipv4(host)) - hints.ai_flags |= AI_NUMERICHOST; - int n = getaddrinfo(host.c_str(), NULL, &hints, &res); - if (!n) - { - std::vector vec; - struct addrinfo *ai = res; - while (ai) - { - if (ai -> ai_addrlen == sizeof(sa)) - vec.push_back( ai ); - ai = ai -> ai_next; - } - if (vec.empty()) - return false; - ai = vec[Utility::Rnd() % vec.size()]; - { - memcpy(&sa, ai -> ai_addr, ai -> ai_addrlen); - } - freeaddrinfo(res); - return true; - } - std::string error = "Error: "; -#ifndef __CYGWIN__ - error += gai_strerror(n); -#endif - return false; -#endif // NO_GETADDRINFO -} - -#ifdef ENABLE_IPV6 -#ifdef IPPROTO_IPV6 -bool Utility::u2ip(const std::string& host, struct sockaddr_in6& sa, int ai_flags) -{ - memset(&sa, 0, sizeof(sa)); - sa.sin6_family = AF_INET6; -#ifdef NO_GETADDRINFO - if ((ai_flags & AI_NUMERICHOST) != 0 || isipv6(host)) - { - std::list vec; - size_t x = 0; - for (size_t i = 0; i <= host.size(); i++) - { - if (i == host.size() || host[i] == ':') - { - std::string s = host.substr(x, i - x); - // - if (strstr(s.c_str(),".")) // x.x.x.x - { - Parse pa(s,"."); - char slask[100]; // u2ip temporary hex2string conversion - unsigned long b0 = static_cast(pa.getvalue()); - unsigned long b1 = static_cast(pa.getvalue()); - unsigned long b2 = static_cast(pa.getvalue()); - unsigned long b3 = static_cast(pa.getvalue()); - sprintf(slask,"%lx",b0 * 256 + b1); - vec.push_back(slask); - sprintf(slask,"%lx",b2 * 256 + b3); - vec.push_back(slask); - } - else - { - vec.push_back(s); - } - // - x = i + 1; - } - } - size_t sz = vec.size(); // number of byte pairs - size_t i = 0; // index in in6_addr.in6_u.u6_addr16[] ( 0 .. 7 ) - unsigned short addr16[8]; - for (std::list::iterator it = vec.begin(); it != vec.end(); it++) - { - std::string bytepair = *it; - if (!bytepair.empty()) - { - addr16[i++] = htons(Utility::hex2unsigned(bytepair)); - } - else - { - addr16[i++] = 0; - while (sz++ < 8) - { - addr16[i++] = 0; - } - } - } - memcpy(&sa.sin6_addr, addr16, sizeof(addr16)); - return true; - } -#ifdef SOLARIS - int errnum = 0; - struct hostent *he = getipnodebyname( host.c_str(), AF_INET6, 0, &errnum ); -#else - struct hostent *he = gethostbyname2( host.c_str(), AF_INET6 ); -#endif - if (!he) - { - return false; - } - memcpy(&sa.sin6_addr,he -> h_addr_list[0],he -> h_length); -#ifdef SOLARIS - free(he); -#endif - return true; -#else - struct addrinfo hints; - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = ai_flags; - hints.ai_family = AF_INET6; - hints.ai_socktype = 0; - hints.ai_protocol = 0; - struct addrinfo *res; - if (Utility::isipv6(host)) - hints.ai_flags |= AI_NUMERICHOST; - int n = getaddrinfo(host.c_str(), NULL, &hints, &res); - if (!n) - { - std::vector vec; - struct addrinfo *ai = res; - while (ai) - { - if (ai -> ai_addrlen == sizeof(sa)) - vec.push_back( ai ); - ai = ai -> ai_next; - } - if (vec.empty()) - return false; - ai = vec[Utility::Rnd() % vec.size()]; - { - memcpy(&sa, ai -> ai_addr, ai -> ai_addrlen); - } - freeaddrinfo(res); - return true; - } - std::string error = "Error: "; -#ifndef __CYGWIN__ - error += gai_strerror(n); -#endif - return false; -#endif // NO_GETADDRINFO -} -#endif // IPPROTO_IPV6 -#endif // ENABLE_IPV6 - -bool Utility::reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, int flags) -{ - std::string service; - return Utility::reverse(sa, sa_len, hostname, service, flags); -} - -bool Utility::reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, std::string& service, int flags) -{ - hostname = ""; - service = ""; -#ifdef NO_GETADDRINFO - switch (sa -> sa_family) - { - case AF_INET: - if (flags & NI_NUMERICHOST) - { - union { - struct { - unsigned char b1; - unsigned char b2; - unsigned char b3; - unsigned char b4; - } a; - ipaddr_t l; - } u; - struct sockaddr_in *sa_in = (struct sockaddr_in *)sa; - memcpy(&u.l, &sa_in -> sin_addr, sizeof(u.l)); - char tmp[100]; - sprintf(tmp, "%u.%u.%u.%u", u.a.b1, u.a.b2, u.a.b3, u.a.b4); - hostname = tmp; - return true; - } - else - { - struct sockaddr_in *sa_in = (struct sockaddr_in *)sa; - struct hostent *h = gethostbyaddr( (const char *)&sa_in -> sin_addr, sizeof(sa_in -> sin_addr), AF_INET); - if (h) - { - hostname = h -> h_name; - return true; - } - } - break; -#ifdef ENABLE_IPV6 - case AF_INET6: - if (flags & NI_NUMERICHOST) - { - char slask[100]; // l2ip temporary - *slask = 0; - unsigned int prev = 0; - bool skipped = false; - bool ok_to_skip = true; - { - unsigned short addr16[8]; - struct sockaddr_in6 *sa_in6 = (struct sockaddr_in6 *)sa; - memcpy(addr16, &sa_in6 -> sin6_addr, sizeof(addr16)); - for (size_t i = 0; i < 8; i++) - { - unsigned short x = ntohs(addr16[i]); - if (*slask && (x || !ok_to_skip || prev)) - strcat(slask,":"); - if (x || !ok_to_skip) - { - sprintf(slask + strlen(slask),"%x", x); - if (x && skipped) - ok_to_skip = false; - } - else - { - skipped = true; - } - prev = x; - } - } - if (!*slask) - strcpy(slask, "::"); - hostname = slask; - return true; - } - else - { - // %! TODO: ipv6 reverse lookup - struct sockaddr_in6 *sa_in = (struct sockaddr_in6 *)sa; - struct hostent *h = gethostbyaddr( (const char *)&sa_in -> sin6_addr, sizeof(sa_in -> sin6_addr), AF_INET6); - if (h) - { - hostname = h -> h_name; - return true; - } - } - break; -#endif - } - return false; -#else - char host[NI_MAXHOST]; - char serv[NI_MAXSERV]; - // NI_NOFQDN - // NI_NUMERICHOST - // NI_NAMEREQD - // NI_NUMERICSERV - // NI_DGRAM - int n = getnameinfo(sa, sa_len, host, sizeof(host), serv, sizeof(serv), flags); - if (n) - { - // EAI_AGAIN - // EAI_BADFLAGS - // EAI_FAIL - // EAI_FAMILY - // EAI_MEMORY - // EAI_NONAME - // EAI_OVERFLOW - // EAI_SYSTEM - return false; - } - hostname = host; - service = serv; - return true; -#endif // NO_GETADDRINFO -} - -bool Utility::u2service(const std::string& name, int& service, int ai_flags) -{ -#ifdef NO_GETADDRINFO - // %! - return false; -#else - struct addrinfo hints; - service = 0; - memset(&hints, 0, sizeof(hints)); - // AI_NUMERICHOST - // AI_CANONNAME - // AI_PASSIVE - server - // AI_ADDRCONFIG - // AI_V4MAPPED - // AI_ALL - // AI_NUMERICSERV - hints.ai_flags = ai_flags; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = 0; - hints.ai_protocol = 0; - struct addrinfo *res; - int n = getaddrinfo(NULL, name.c_str(), &hints, &res); - if (!n) - { - service = res -> ai_protocol; - freeaddrinfo(res); - return true; - } - return false; -#endif // NO_GETADDRINFO -} - -unsigned long Utility::ThreadID() -{ -#ifdef _WIN32 - return GetCurrentThreadId(); -#else - return (unsigned long)pthread_self(); -#endif -} - -std::string Utility::ToLower(const std::string& str) -{ - std::string r; - for (size_t i = 0; i < str.size(); i++) - { - if (str[i] >= 'A' && str[i] <= 'Z') - r += str[i] | 32; - else - r += str[i]; - } - return r; -} - -std::string Utility::ToUpper(const std::string& str) -{ - std::string r; - for (size_t i = 0; i < str.size(); i++) - { - if (str[i] >= 'a' && str[i] <= 'z') - r += (char)(str[i] - 32); - else - r += str[i]; - } - return r; -} - -std::string Utility::ToString(double d) -{ - char tmp[100]; - sprintf(tmp, "%f", d); - return tmp; -} - -unsigned long Utility::Rnd() -{ -static Utility::Rng generator( (unsigned long)time(NULL) ); - return generator.Get(); -} - -Utility::Rng::Rng(unsigned long seed) : m_value( 0 ) -{ - m_tmp[0]= seed & 0xffffffffUL; - for (int i = 1; i < TWIST_LEN; i++) - { - m_tmp[i] = (1812433253UL * (m_tmp[i - 1] ^ (m_tmp[i - 1] >> 30)) + i); - } -} - -unsigned long Utility::Rng::Get() -{ - unsigned long val = m_tmp[m_value]; - ++m_value; - if (m_value == TWIST_LEN) - { - for (int i = 0; i < TWIST_IB; ++i) - { - unsigned long s = TWIST(m_tmp, i, i + 1); - m_tmp[i] = m_tmp[i + TWIST_IA] ^ (s >> 1) ^ MAGIC_TWIST(s); - } - { - for (int i = 0; i < TWIST_LEN - 1; ++i) - { - unsigned long s = TWIST(m_tmp, i, i + 1); - m_tmp[i] = m_tmp[i - TWIST_IB] ^ (s >> 1) ^ MAGIC_TWIST(s); - } - } - unsigned long s = TWIST(m_tmp, TWIST_LEN - 1, 0); - m_tmp[TWIST_LEN - 1] = m_tmp[TWIST_IA - 1] ^ (s >> 1) ^ MAGIC_TWIST(s); - - m_value = 0; - } - return val; -} - -#ifdef SOCKETS_NAMESPACE -} -#endif - - diff --git a/dep/src/sockets/network_kist.txt b/dep/src/sockets/network_kist.txt deleted file mode 100644 index f6597bf9c77..00000000000 --- a/dep/src/sockets/network_kist.txt +++ /dev/null @@ -1,20 +0,0 @@ -The following are the only .cpp files used from the new network library (v2.2.8) This file is just for future reference. - -Base64.cpp -Exception.cpp -Ipv4Address.cpp -Ipv6Address.cpp -Lock.cpp -Mutex.cpp -Parse.cpp -ResolvServer.cpp -ResolvSocket.cpp -Socket.cpp -SocketHandler.cpp -socket_include.cpp -StdoutLog.cpp -StreamSocket.cpp -TcpSocket.cpp -Thread.cpp -UdpSocket.cpp -Utility.cpp diff --git a/dep/src/sockets/socket_include.cpp b/dep/src/sockets/socket_include.cpp deleted file mode 100644 index 290602c1b52..00000000000 --- a/dep/src/sockets/socket_include.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/** \file socket_include.cpp - ** \date 2004-11-28 - ** \author grymse@alhem.net -**/ -/* -Copyright (C) 2004-2007 Anders Hedstrom - -This library is made available under the terms of the GNU GPL. - -If you would like to use this library in a closed-source application, -a separate license agreement is available. For information about -the closed-source license agreement for the C++ sockets library, -please visit http://www.alhem.net/Sockets/license.html and/or -email license@alhem.net. - -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 the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include - -// only to be included in win32 projects -const char *StrError(int x) -{ -static char tmp[100]; - switch (x) - { - case 10004: return "Interrupted function call."; - case 10013: return "Permission denied."; - case 10014: return "Bad address."; - case 10022: return "Invalid argument."; - case 10024: return "Too many open files."; - case 10035: return "Resource temporarily unavailable."; - case 10036: return "Operation now in progress."; - case 10037: return "Operation already in progress."; - case 10038: return "Socket operation on nonsocket."; - case 10039: return "Destination address required."; - case 10040: return "Message too long."; - case 10041: return "Protocol wrong type for socket."; - case 10042: return "Bad protocol option."; - case 10043: return "Protocol not supported."; - case 10044: return "Socket type not supported."; - case 10045: return "Operation not supported."; - case 10046: return "Protocol family not supported."; - case 10047: return "Address family not supported by protocol family."; - case 10048: return "Address already in use."; - case 10049: return "Cannot assign requested address."; - case 10050: return "Network is down."; - case 10051: return "Network is unreachable."; - case 10052: return "Network dropped connection on reset."; - case 10053: return "Software caused connection abort."; - case 10054: return "Connection reset by peer."; - case 10055: return "No buffer space available."; - case 10056: return "Socket is already connected."; - case 10057: return "Socket is not connected."; - case 10058: return "Cannot send after socket shutdown."; - case 10060: return "Connection timed out."; - case 10061: return "Connection refused."; - case 10064: return "Host is down."; - case 10065: return "No route to host."; - case 10067: return "Too many processes."; - case 10091: return "Network subsystem is unavailable."; - case 10092: return "Winsock.dll version out of range."; - case 10093: return "Successful WSAStartup not yet performed."; - case 10101: return "Graceful shutdown in progress."; - case 10109: return "Class type not found."; - case 11001: return "Host not found."; - case 11002: return "Nonauthoritative host not found."; - case 11003: return "This is a nonrecoverable error."; - case 11004: return "Valid name, no data record of requested type."; - - default: - break; - } - sprintf(tmp, "Winsock error code: %d", x); - return tmp; -} - - diff --git a/dep/src/zlib/CMakeLists.txt b/dep/src/zlib/CMakeLists.txt deleted file mode 100644 index b8803e81c11..00000000000 --- a/dep/src/zlib/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ - -########### next target ############### - -SET(zlib_STAT_SRCS - adler32.c - compress.c - crc32.c - deflate.c - example.c - gzio.c - infback.c - inffast.c - inflate.c - inftrees.c - trees.c - uncompr.c - zutil.c -) - -add_library(zlib STATIC ${zlib_STAT_SRCS}) diff --git a/dep/src/zlib/adler32.c b/dep/src/zlib/adler32.c deleted file mode 100644 index 007ba26277c..00000000000 --- a/dep/src/zlib/adler32.c +++ /dev/null @@ -1,149 +0,0 @@ -/* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -#define BASE 65521UL /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -/* use NO_DIVIDE if your processor does not do division in hardware */ -#ifdef NO_DIVIDE -# define MOD(a) \ - do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -# define MOD4(a) \ - do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -#else -# define MOD(a) a %= BASE -# define MOD4(a) a %= BASE -#endif - -/* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ - unsigned long sum2; - unsigned n; - - /* split Adler-32 into component sums */ - sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) - adler -= BASE; - sum2 += adler; - if (sum2 >= BASE) - sum2 -= BASE; - return adler | (sum2 << 16); - } - - /* initial Adler-32 value (deferred check for len == 1 speed) */ - if (buf == Z_NULL) - return 1L; - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) - adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -/* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ - unsigned long sum1; - unsigned long sum2; - unsigned rem; - - /* the derivation of this formula is left as an exercise for the reader */ - rem = (unsigned)(len2 % BASE); - sum1 = adler1 & 0xffff; - sum2 = rem * sum1; - MOD(sum2); - sum1 += (adler2 & 0xffff) + BASE - 1; - sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; - if (sum1 > BASE) sum1 -= BASE; - if (sum1 > BASE) sum1 -= BASE; - if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); - if (sum2 > BASE) sum2 -= BASE; - return sum1 | (sum2 << 16); -} diff --git a/dep/src/zlib/compress.c b/dep/src/zlib/compress.c deleted file mode 100644 index df04f0148e6..00000000000 --- a/dep/src/zlib/compress.c +++ /dev/null @@ -1,79 +0,0 @@ -/* compress.c -- compress a memory buffer - * Copyright (C) 1995-2003 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; -#ifdef MAXSEG_64K - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; -#endif - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - stream.opaque = (voidpf)0; - - err = deflateInit(&stream, level); - if (err != Z_OK) return err; - - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; - - err = deflateEnd(&stream); - return err; -} - -/* =========================================================================== - */ -int ZEXPORT compress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); -} - -/* =========================================================================== - If the default memLevel or windowBits for deflateInit() is changed, then - this function needs to be updated. - */ -uLong ZEXPORT compressBound (sourceLen) - uLong sourceLen; -{ - return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11; -} diff --git a/dep/src/zlib/crc32.c b/dep/src/zlib/crc32.c deleted file mode 100644 index f658a9ef55e..00000000000 --- a/dep/src/zlib/crc32.c +++ /dev/null @@ -1,423 +0,0 @@ -/* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Thanks to Rodney Brown for his contribution of faster - * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing - * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results in about a - * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. - */ - -/* @(#) $Id$ */ - -/* - Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore - protection on the static variables used to control the first-use generation - of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should - first call get_crc_table() to initialize the tables before allowing more than - one thread to use crc32(). - */ - -#ifdef MAKECRCH -# include -# ifndef DYNAMIC_CRC_TABLE -# define DYNAMIC_CRC_TABLE -# endif /* !DYNAMIC_CRC_TABLE */ -#endif /* MAKECRCH */ - -#include "zutil.h" /* for STDC and FAR definitions */ - -#define local static - -/* Find a four-byte integer type for crc32_little() and crc32_big(). */ -#ifndef NOBYFOUR -# ifdef STDC /* need ANSI C limits.h to determine sizes */ -# include -# define BYFOUR -# if (UINT_MAX == 0xffffffffUL) - typedef unsigned int u4; -# else -# if (ULONG_MAX == 0xffffffffUL) - typedef unsigned long u4; -# else -# if (USHRT_MAX == 0xffffffffUL) - typedef unsigned short u4; -# else -# undef BYFOUR /* can't find a four-byte integer type! */ -# endif -# endif -# endif -# endif /* STDC */ -#endif /* !NOBYFOUR */ - -/* Definitions for doing the crc four data bytes at a time. */ -#ifdef BYFOUR -# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \ - (((w)&0xff00)<<8)+(((w)&0xff)<<24)) - local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, unsigned)); - local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, unsigned)); -# define TBLS 8 -#else -# define TBLS 1 -#endif /* BYFOUR */ - -/* Local functions for crc concatenation */ -local unsigned long gf2_matrix_times OF((unsigned long *mat, - unsigned long vec)); -local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); - -#ifdef DYNAMIC_CRC_TABLE - -local volatile int crc_table_empty = 1; -local unsigned long FAR crc_table[TBLS][256]; -local void make_crc_table OF((void)); -#ifdef MAKECRCH - local void write_table OF((FILE *, const unsigned long FAR *)); -#endif /* MAKECRCH */ -/* - Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: - x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. - - Polynomials over GF(2) are represented in binary, one bit per coefficient, - with the lowest powers in the most significant bit. Then adding polynomials - is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the - polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - where a mod b means the remainder after dividing a by b. - - This calculation is done using the shift-register method of multiplying and - taking the remainder. The register is initialized to zero, and for each - incoming bit, x^32 is added mod p to the register if the bit is a one (where - x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - x (which is shifting right by one and adding x^32 mod p if the bit shifted - out is a one). We start with the highest power (least significant bit) of - q and repeat for all eight bits of q. - - The first table is simply the CRC of all possible eight bit values. This is - all the information needed to generate CRCs on data a byte at a time for all - combinations of CRC register values and incoming bytes. The remaining tables - allow for word-at-a-time CRC calculation for both big-endian and little- - endian machines, where a word is four bytes. -*/ -local void make_crc_table() -{ - unsigned long c; - int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ - /* terms of polynomial defining this crc (except x^32): */ - static volatile int first = 1; /* flag to limit concurrent making */ - static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - /* See if another task is already doing this (not thread-safe, but better - than nothing -- significantly reduces duration of vulnerability in - case the advice about DYNAMIC_CRC_TABLE is ignored) */ - if (first) { - first = 0; - - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (unsigned long)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } - -#ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, - and then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = REV(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = REV(c); - } - } -#endif /* BYFOUR */ - - crc_table_empty = 0; - } - else { /* not first */ - /* wait for the other guy to finish (not efficient, but rare) */ - while (crc_table_empty) - ; - } - -#ifdef MAKECRCH - /* write out CRC tables to crc32.h */ - { - FILE *out; - - out = fopen("crc32.h", "w"); - if (out == NULL) return; - fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); - fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const unsigned long FAR "); - fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); - write_table(out, crc_table[0]); -# ifdef BYFOUR - fprintf(out, "#ifdef BYFOUR\n"); - for (k = 1; k < 8; k++) { - fprintf(out, " },\n {\n"); - write_table(out, crc_table[k]); - } - fprintf(out, "#endif\n"); -# endif /* BYFOUR */ - fprintf(out, " }\n};\n"); - fclose(out); - } -#endif /* MAKECRCH */ -} - -#ifdef MAKECRCH -local void write_table(out, table) - FILE *out; - const unsigned long FAR *table; -{ - int n; - - for (n = 0; n < 256; n++) - fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n], - n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); -} -#endif /* MAKECRCH */ - -#else /* !DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Tables of CRC-32s of all single-byte values, made by make_crc_table(). - */ -#include "crc32.h" -#endif /* DYNAMIC_CRC_TABLE */ - -/* ========================================================================= - * This function can be used by asm versions of crc32() - */ -const unsigned long FAR * ZEXPORT get_crc_table() -{ -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - return (const unsigned long FAR *)crc_table; -} - -/* ========================================================================= */ -#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) -#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 - -/* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - if (buf == Z_NULL) return 0UL; - -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - -#ifdef BYFOUR - if (sizeof(void *) == sizeof(ptrdiff_t)) { - u4 endian; - - endian = 1; - if (*((unsigned char *)(&endian))) - return crc32_little(crc, buf, len); - else - return crc32_big(crc, buf, len); - } -#endif /* BYFOUR */ - crc = crc ^ 0xffffffffUL; - while (len >= 8) { - DO8; - len -= 8; - } - if (len) do { - DO1; - } while (--len); - return crc ^ 0xffffffffUL; -} - -#ifdef BYFOUR - -/* ========================================================================= */ -#define DOLIT4 c ^= *buf4++; \ - c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ - crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] -#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 - -/* ========================================================================= */ -local unsigned long crc32_little(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - register u4 c; - register const u4 FAR *buf4; - - c = (u4)crc; - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - len--; - } - - buf4 = (const u4 FAR *)(const void FAR *)buf; - while (len >= 32) { - DOLIT32; - len -= 32; - } - while (len >= 4) { - DOLIT4; - len -= 4; - } - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); - } while (--len); - c = ~c; - return (unsigned long)c; -} - -/* ========================================================================= */ -#define DOBIG4 c ^= *++buf4; \ - c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ - crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] -#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 - -/* ========================================================================= */ -local unsigned long crc32_big(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - register u4 c; - register const u4 FAR *buf4; - - c = REV((u4)crc); - c = ~c; - while (len && ((ptrdiff_t)buf & 3)) { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - len--; - } - - buf4 = (const u4 FAR *)(const void FAR *)buf; - buf4--; - while (len >= 32) { - DOBIG32; - len -= 32; - } - while (len >= 4) { - DOBIG4; - len -= 4; - } - buf4++; - buf = (const unsigned char FAR *)buf4; - - if (len) do { - c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); - } while (--len); - c = ~c; - return (unsigned long)(REV(c)); -} - -#endif /* BYFOUR */ - -#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ - -/* ========================================================================= */ -local unsigned long gf2_matrix_times(mat, vec) - unsigned long *mat; - unsigned long vec; -{ - unsigned long sum; - - sum = 0; - while (vec) { - if (vec & 1) - sum ^= *mat; - vec >>= 1; - mat++; - } - return sum; -} - -/* ========================================================================= */ -local void gf2_matrix_square(square, mat) - unsigned long *square; - unsigned long *mat; -{ - int n; - - for (n = 0; n < GF2_DIM; n++) - square[n] = gf2_matrix_times(mat, mat[n]); -} - -/* ========================================================================= */ -uLong ZEXPORT crc32_combine(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off_t len2; -{ - int n; - unsigned long row; - unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ - unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ - - /* degenerate case */ - if (len2 == 0) - return crc1; - - /* put operator for one zero bit in odd */ - odd[0] = 0xedb88320L; /* CRC-32 polynomial */ - row = 1; - for (n = 1; n < GF2_DIM; n++) { - odd[n] = row; - row <<= 1; - } - - /* put operator for two zero bits in even */ - gf2_matrix_square(even, odd); - - /* put operator for four zero bits in odd */ - gf2_matrix_square(odd, even); - - /* apply len2 zeros to crc1 (first square will put the operator for one - zero byte, eight zero bits, in even) */ - do { - /* apply zeros operator for this bit of len2 */ - gf2_matrix_square(even, odd); - if (len2 & 1) - crc1 = gf2_matrix_times(even, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - if (len2 == 0) - break; - - /* another iteration of the loop with odd and even swapped */ - gf2_matrix_square(odd, even); - if (len2 & 1) - crc1 = gf2_matrix_times(odd, crc1); - len2 >>= 1; - - /* if no more bits set, then done */ - } while (len2 != 0); - - /* return combined crc */ - crc1 ^= crc2; - return crc1; -} diff --git a/dep/src/zlib/crc32.h b/dep/src/zlib/crc32.h deleted file mode 100644 index dfd1deaa522..00000000000 --- a/dep/src/zlib/crc32.h +++ /dev/null @@ -1,442 +0,0 @@ -/* crc32.h -- tables for rapid CRC calculation - * Generated automatically by crc32.c - */ - -local const unsigned long FAR crc_table[TBLS][256] = -{ - { - 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, - 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, - 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, - 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, - 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, - 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, - 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, - 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, - 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, - 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, - 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, - 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, - 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, - 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, - 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, - 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, - 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, - 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, - 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, - 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, - 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, - 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, - 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, - 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, - 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, - 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, - 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, - 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, - 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, - 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, - 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, - 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, - 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, - 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, - 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, - 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, - 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, - 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, - 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, - 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, - 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, - 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, - 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, - 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, - 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, - 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, - 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, - 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, - 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, - 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, - 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, - 0x2d02ef8dUL -#ifdef BYFOUR - }, - { - 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, - 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, - 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, - 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, - 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, - 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, - 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, - 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, - 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, - 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, - 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, - 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, - 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, - 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, - 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, - 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, - 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, - 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, - 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, - 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, - 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, - 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, - 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, - 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, - 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, - 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, - 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, - 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, - 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, - 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, - 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, - 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, - 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, - 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, - 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, - 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, - 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, - 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, - 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, - 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, - 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, - 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, - 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, - 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, - 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, - 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, - 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, - 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, - 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, - 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, - 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, - 0x9324fd72UL - }, - { - 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, - 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, - 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, - 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, - 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, - 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, - 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, - 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, - 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, - 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, - 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, - 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, - 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, - 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, - 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, - 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, - 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, - 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, - 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, - 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, - 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, - 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, - 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, - 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, - 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, - 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, - 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, - 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, - 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, - 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, - 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, - 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, - 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, - 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, - 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, - 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, - 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, - 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, - 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, - 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, - 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, - 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, - 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, - 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, - 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, - 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, - 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, - 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, - 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, - 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, - 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, - 0xbe9834edUL - }, - { - 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, - 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, - 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, - 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, - 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, - 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, - 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, - 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, - 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, - 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, - 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, - 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, - 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, - 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, - 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, - 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, - 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, - 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, - 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, - 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, - 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, - 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, - 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, - 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, - 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, - 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, - 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, - 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, - 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, - 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, - 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, - 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, - 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, - 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, - 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, - 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, - 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, - 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, - 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, - 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, - 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, - 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, - 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, - 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, - 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, - 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, - 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, - 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, - 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, - 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, - 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, - 0xde0506f1UL - }, - { - 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, - 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, - 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, - 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, - 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, - 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, - 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, - 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, - 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, - 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, - 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, - 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, - 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, - 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, - 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, - 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, - 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, - 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, - 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, - 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, - 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, - 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, - 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, - 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, - 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, - 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, - 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, - 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, - 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, - 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, - 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, - 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, - 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, - 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, - 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, - 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, - 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, - 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, - 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, - 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, - 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, - 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, - 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, - 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, - 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, - 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, - 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, - 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, - 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, - 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, - 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, - 0x8def022dUL - }, - { - 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, - 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, - 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, - 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, - 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, - 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, - 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, - 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, - 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, - 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, - 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, - 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, - 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, - 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, - 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, - 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, - 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, - 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, - 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, - 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, - 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, - 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, - 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, - 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, - 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, - 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, - 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, - 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, - 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, - 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, - 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, - 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, - 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, - 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, - 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, - 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, - 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, - 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, - 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, - 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, - 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, - 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, - 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, - 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, - 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, - 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, - 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, - 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, - 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, - 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, - 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, - 0x72fd2493UL - }, - { - 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, - 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, - 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, - 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, - 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, - 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, - 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, - 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, - 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, - 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, - 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, - 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, - 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, - 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, - 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, - 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, - 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, - 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, - 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, - 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, - 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, - 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, - 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, - 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, - 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, - 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, - 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, - 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, - 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, - 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, - 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, - 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, - 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, - 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, - 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, - 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, - 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, - 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, - 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, - 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, - 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, - 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, - 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, - 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, - 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, - 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, - 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, - 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, - 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, - 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, - 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, - 0xed3498beUL - }, - { - 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, - 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, - 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, - 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, - 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, - 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, - 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, - 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, - 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, - 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, - 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, - 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, - 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, - 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, - 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, - 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, - 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, - 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, - 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, - 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, - 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, - 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, - 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, - 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, - 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, - 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, - 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, - 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, - 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, - 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, - 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, - 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, - 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, - 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, - 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, - 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, - 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, - 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, - 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, - 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, - 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, - 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, - 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, - 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, - 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, - 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, - 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, - 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, - 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, - 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, - 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, - 0xf10605deUL -#endif - } -}; - diff --git a/dep/src/zlib/deflate.c b/dep/src/zlib/deflate.c deleted file mode 100644 index 2ed78a7d2a1..00000000000 --- a/dep/src/zlib/deflate.c +++ /dev/null @@ -1,1734 +0,0 @@ -/* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process depends on being able to identify portions - * of the input text which are identical to earlier input (within a - * sliding window trailing behind the input currently being processed). - * - * The most straightforward technique turns out to be the fastest for - * most input files: try all possible matches and select the longest. - * The key feature of this algorithm is that insertions into the string - * dictionary are very simple and thus fast, and deletions are avoided - * completely. Insertions are performed at each input character, whereas - * string matches are performed only when the previous match ends. So it - * is preferable to spend more time in matches to allow very fast string - * insertions and avoid deletions. The matching algorithm for small - * strings is inspired from that of Rabin & Karp. A brute force approach - * is used to find longer strings when a small match has been found. - * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze - * (by Leonid Broukhis). - * A previous version of this file used a more sophisticated algorithm - * (by Fiala and Greene) which is guaranteed to run in linear amortized - * time, but has a larger average cost, uses more memory and is patented. - * However the F&G algorithm may be faster for some highly redundant - * files if the parameter max_chain_length (described below) is too large. - * - * ACKNOWLEDGEMENTS - * - * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and - * I found it in 'freeze' written by Leonid Broukhis. - * Thanks to many people for bug reports and testing. - * - * REFERENCES - * - * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". - * Available in http://www.ietf.org/rfc/rfc1951.txt - * - * A description of the Rabin and Karp algorithm is given in the book - * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. - * - * Fiala,E.R., and Greene,D.H. - * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 - * - */ - -/* @(#) $Id$ */ - -#include "deflate.h" - -const char deflate_copyright[] = - " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* =========================================================================== - * Function prototypes. - */ -typedef enum { - need_more, /* block not completed, need more input or more output */ - block_done, /* block flush performed */ - finish_started, /* finish started, need only more output at next deflate */ - finish_done /* finish done, accept no more input or output */ -} block_state; - -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); -/* Compression function. Returns the block state after the call. */ - -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); -#ifndef FASTEST -local block_state deflate_slow OF((deflate_state *s, int flush)); -#endif -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifndef FASTEST -#ifdef ASMV - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else -local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif -#endif -local uInt longest_match_fast OF((deflate_state *s, IPos cur_match)); - -#ifdef DEBUG -local void check_match OF((deflate_state *s, IPos start, IPos match, - int length)); -#endif - -/* =========================================================================== - * Local data - */ - -#define NIL 0 -/* Tail of hash chains */ - -#ifndef TOO_FAR -# define TOO_FAR 4096 -#endif -/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -typedef struct config_s { - ush good_length; /* reduce lazy search above this match length */ - ush max_lazy; /* do not perform lazy search above this match length */ - ush nice_length; /* quit search above this match length */ - ush max_chain; - compress_func func; -} config; - -#ifdef FASTEST -local const config configuration_table[2] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ -#else -local const config configuration_table[10] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ -/* 2 */ {4, 5, 16, 8, deflate_fast}, -/* 3 */ {4, 6, 32, 32, deflate_fast}, - -/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ -/* 5 */ {8, 16, 32, 32, deflate_slow}, -/* 6 */ {8, 16, 128, 128, deflate_slow}, -/* 7 */ {8, 32, 128, 256, deflate_slow}, -/* 8 */ {32, 128, 258, 1024, deflate_slow}, -/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ -#endif - -/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 - * For deflate_fast() (levels <= 3) good is ignored and lazy has a different - * meaning. - */ - -#define EQUAL 0 -/* result of memcmp for equal strings */ - -#ifndef NO_DUMMY_DECL -struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ -#endif - -/* =========================================================================== - * Update a hash value with the given input byte - * IN assertion: all calls to to UPDATE_HASH are made with consecutive - * input characters, so that a running hash key can be computed from the - * previous key instead of complete recalculation each time. - */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) - -/* =========================================================================== - * Insert string str in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * If this file is compiled with -DFASTEST, the compression level is forced - * to 1, and no hash chains are maintained. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of str are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ -#ifdef FASTEST -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#else -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#endif - -/* =========================================================================== - * Initialize the hash table (avoiding 64K overflow for 16 bit systems). - * prev[] will be initialized on the fly. - */ -#define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); - -/* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; - int level; - const char *version; - int stream_size; -{ - return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); - /* To do: ignore strm->next_in if we use it as window */ -} - -/* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) - z_streamp strm; - int level; - int method; - int windowBits; - int memLevel; - int strategy; - const char *version; - int stream_size; -{ - deflate_state *s; - int wrap = 1; - static const char my_version[] = ZLIB_VERSION; - - ushf *overlay; - /* We overlay pending_buf and d_buf+l_buf. This works since the average - * output size for (length,distance) codes is <= 24 bits. - */ - - if (version == Z_NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } - if (strm == Z_NULL) return Z_STREAM_ERROR; - - strm->msg = Z_NULL; - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } -#ifdef GZIP - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } -#endif - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ - s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); - if (s == Z_NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; - s->strm = strm; - - s->wrap = wrap; - s->gzhead = Z_NULL; - s->w_bits = windowBits; - s->w_size = 1 << s->w_bits; - s->w_mask = s->w_size - 1; - - s->hash_bits = memLevel + 7; - s->hash_size = 1 << s->hash_bits; - s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); - - s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); - s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); - s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); - - s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - s->pending_buf = (uchf *) overlay; - s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); - - if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || - s->pending_buf == Z_NULL) { - s->status = FINISH_STATE; - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); - deflateEnd (strm); - return Z_MEM_ERROR; - } - s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - - s->level = level; - s->strategy = strategy; - s->method = (Byte)method; - - return deflateReset(strm); -} - -/* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; -{ - deflate_state *s; - uInt length = dictLength; - uInt n; - IPos hash_head = 0; - - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || - strm->state->wrap == 2 || - (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) - return Z_STREAM_ERROR; - - s = strm->state; - if (s->wrap) - strm->adler = adler32(strm->adler, dictionary, dictLength); - - if (length < MIN_MATCH) return Z_OK; - if (length > MAX_DIST(s)) { - length = MAX_DIST(s); - dictionary += dictLength - length; /* use the tail of the dictionary */ - } - zmemcpy(s->window, dictionary, length); - s->strstart = length; - s->block_start = (long)length; - - /* Insert all strings in the hash table (except for the last two bytes). - * s->lookahead stays null, so s->ins_h will be recomputed at the next - * call of fill_window. - */ - s->ins_h = s->window[0]; - UPDATE_HASH(s, s->ins_h, s->window[1]); - for (n = 0; n <= length - MIN_MATCH; n++) { - INSERT_STRING(s, n, hash_head); - } - if (hash_head) hash_head = 0; /* to make compiler happy */ - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; -{ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { - return Z_STREAM_ERROR; - } - - strm->total_in = strm->total_out = 0; - strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ - strm->data_type = Z_UNKNOWN; - - s = (deflate_state *)strm->state; - s->pending = 0; - s->pending_out = s->pending_buf; - - if (s->wrap < 0) { - s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ - } - s->status = s->wrap ? INIT_STATE : BUSY_STATE; - strm->adler = -#ifdef GZIP - s->wrap == 2 ? crc32(0L, Z_NULL, 0) : -#endif - adler32(0L, Z_NULL, 0); - s->last_flush = Z_NO_FLUSH; - - _tr_init(s); - lm_init(s); - - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) - z_streamp strm; - gz_headerp head; -{ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - if (strm->state->wrap != 2) return Z_STREAM_ERROR; - strm->state->gzhead = head; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) - z_streamp strm; - int bits; - int value; -{ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - strm->state->bi_valid = bits; - strm->state->bi_buf = (ush)(value & ((1 << bits) - 1)); - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; - int level; - int strategy; -{ - deflate_state *s; - compress_func func; - int err = Z_OK; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - s = strm->state; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - func = configuration_table[s->level].func; - - if (func != configuration_table[level].func && strm->total_in != 0) { - /* Flush the last buffer: */ - err = deflate(strm, Z_PARTIAL_FLUSH); - } - if (s->level != level) { - s->level = level; - s->max_lazy_match = configuration_table[level].max_lazy; - s->good_match = configuration_table[level].good_length; - s->nice_match = configuration_table[level].nice_length; - s->max_chain_length = configuration_table[level].max_chain; - } - s->strategy = strategy; - return err; -} - -/* ========================================================================= */ -int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) - z_streamp strm; - int good_length; - int max_lazy; - int nice_length; - int max_chain; -{ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - s = strm->state; - s->good_match = good_length; - s->max_lazy_match = max_lazy; - s->nice_match = nice_length; - s->max_chain_length = max_chain; - return Z_OK; -} - -/* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. - * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. - * - * This function could be more sophisticated to provide closer upper bounds - * for every combination of windowBits and memLevel, as well as wrap. - * But even the conservative upper bound of about 14% expansion does not - * seem onerous for output buffer allocation. - */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; -{ - deflate_state *s; - uLong destLen; - - /* conservative upper bound */ - destLen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11; - - /* if can't get parameters, return conservative bound */ - if (strm == Z_NULL || strm->state == Z_NULL) - return destLen; - - /* if not default parameters, return conservative bound */ - s = strm->state; - if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return destLen; - - /* default settings: return tight bound for that case */ - return compressBound(sourceLen); -} - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -local void putShortMSB (s, b) - deflate_state *s; - uInt b; -{ - put_byte(s, (Byte)(b >> 8)); - put_byte(s, (Byte)(b & 0xff)); -} - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->next_out buffer and copying into it. - * (See also read_buf()). - */ -local void flush_pending(strm) - z_streamp strm; -{ - unsigned len = strm->state->pending; - - if (len > strm->avail_out) len = strm->avail_out; - if (len == 0) return; - - zmemcpy(strm->next_out, strm->state->pending_out, len); - strm->next_out += len; - strm->state->pending_out += len; - strm->total_out += len; - strm->avail_out -= len; - strm->state->pending -= len; - if (strm->state->pending == 0) { - strm->state->pending_out = strm->state->pending_buf; - } -} - -/* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; - int flush; -{ - int old_flush; /* value of flush param for previous deflate call */ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL || - flush > Z_FINISH || flush < 0) { - return Z_STREAM_ERROR; - } - s = strm->state; - - if (strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0) || - (s->status == FINISH_STATE && flush != Z_FINISH)) { - ERR_RETURN(strm, Z_STREAM_ERROR); - } - if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - - s->strm = strm; /* just in case */ - old_flush = s->last_flush; - s->last_flush = flush; - - /* Write the header */ - if (s->status == INIT_STATE) { -#ifdef GZIP - if (s->wrap == 2) { - strm->adler = crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (s->gzhead == NULL) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s->status = BUSY_STATE; - } - else { - put_byte(s, (s->gzhead->text ? 1 : 0) + - (s->gzhead->hcrc ? 2 : 0) + - (s->gzhead->extra == Z_NULL ? 0 : 4) + - (s->gzhead->name == Z_NULL ? 0 : 8) + - (s->gzhead->comment == Z_NULL ? 0 : 16) - ); - put_byte(s, (Byte)(s->gzhead->time & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, s->gzhead->os & 0xff); - if (s->gzhead->extra != NULL) { - put_byte(s, s->gzhead->extra_len & 0xff); - put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); - } - if (s->gzhead->hcrc) - strm->adler = crc32(strm->adler, s->pending_buf, - s->pending); - s->gzindex = 0; - s->status = EXTRA_STATE; - } - } - else -#endif - { - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags; - - if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) - level_flags = 0; - else if (s->level < 6) - level_flags = 1; - else if (s->level == 6) - level_flags = 2; - else - level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); - - s->status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - strm->adler = adler32(0L, Z_NULL, 0); - } - } -#ifdef GZIP - if (s->status == EXTRA_STATE) { - if (s->gzhead->extra != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - - while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) - break; - } - put_byte(s, s->gzhead->extra[s->gzindex]); - s->gzindex++; - } - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (s->gzindex == s->gzhead->extra_len) { - s->gzindex = 0; - s->status = NAME_STATE; - } - } - else - s->status = NAME_STATE; - } - if (s->status == NAME_STATE) { - if (s->gzhead->name != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - int val; - - do { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; - } - } - val = s->gzhead->name[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) { - s->gzindex = 0; - s->status = COMMENT_STATE; - } - } - else - s->status = COMMENT_STATE; - } - if (s->status == COMMENT_STATE) { - if (s->gzhead->comment != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - int val; - - do { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; - } - } - val = s->gzhead->comment[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) - s->status = HCRC_STATE; - } - else - s->status = HCRC_STATE; - } - if (s->status == HCRC_STATE) { - if (s->gzhead->hcrc) { - if (s->pending + 2 > s->pending_buf_size) - flush_pending(strm); - if (s->pending + 2 <= s->pending_buf_size) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - strm->adler = crc32(0L, Z_NULL, 0); - s->status = BUSY_STATE; - } - } - else - s->status = BUSY_STATE; - } -#endif - - /* Flush as much pending output as possible */ - if (s->pending != 0) { - flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s->last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm->avail_in == 0 && flush <= old_flush && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm->avail_in != 0 || s->lookahead != 0 || - (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { - block_state bstate; - - bstate = (*(configuration_table[s->level].func))(s, flush); - - if (bstate == finish_started || bstate == finish_done) { - s->status = FINISH_STATE; - } - if (bstate == need_more || bstate == finish_started) { - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate == block_done) { - if (flush == Z_PARTIAL_FLUSH) { - _tr_align(s); - } else { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block(s, (char*)0, 0L, 0); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush == Z_FULL_FLUSH) { - CLEAR_HASH(s); /* forget history */ - } - } - flush_pending(strm); - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - Assert(strm->avail_out > 0, "bug2"); - - if (flush != Z_FINISH) return Z_OK; - if (s->wrap <= 0) return Z_STREAM_END; - - /* Write the trailer */ -#ifdef GZIP - if (s->wrap == 2) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); - put_byte(s, (Byte)(strm->total_in & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); - } - else -#endif - { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ - return s->pending != 0 ? Z_OK : Z_STREAM_END; -} - -/* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; -{ - int status; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - - status = strm->state->status; - if (status != INIT_STATE && - status != EXTRA_STATE && - status != NAME_STATE && - status != COMMENT_STATE && - status != HCRC_STATE && - status != BUSY_STATE && - status != FINISH_STATE) { - return Z_STREAM_ERROR; - } - - /* Deallocate in reverse order of allocations: */ - TRY_FREE(strm, strm->state->pending_buf); - TRY_FREE(strm, strm->state->head); - TRY_FREE(strm, strm->state->prev); - TRY_FREE(strm, strm->state->window); - - ZFREE(strm, strm->state); - strm->state = Z_NULL; - - return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; -} - -/* ========================================================================= - * Copy the source state to the destination state. - * To simplify the source, this is not supported for 16-bit MSDOS (which - * doesn't have enough memory anyway to duplicate compression states). - */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; -{ -#ifdef MAXSEG_64K - return Z_STREAM_ERROR; -#else - deflate_state *ds; - deflate_state *ss; - ushf *overlay; - - if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { - return Z_STREAM_ERROR; - } - - ss = source->state; - - zmemcpy(dest, source, sizeof(z_stream)); - - ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); - if (ds == Z_NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; - zmemcpy(ds, ss, sizeof(deflate_state)); - ds->strm = dest; - - ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); - ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); - ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); - ds->pending_buf = (uchf *) overlay; - - if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || - ds->pending_buf == Z_NULL) { - deflateEnd (dest); - return Z_MEM_ERROR; - } - /* following zmemcpy do not work for 16-bit MSDOS */ - zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); - zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); - zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); - - ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); - ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); - ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; - - ds->l_desc.dyn_tree = ds->dyn_ltree; - ds->d_desc.dyn_tree = ds->dyn_dtree; - ds->bl_desc.dyn_tree = ds->bl_tree; - - return Z_OK; -#endif /* MAXSEG_64K */ -} - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local int read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, strm->next_in, len); - } -#ifdef GZIP - else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, strm->next_in, len); - } -#endif - zmemcpy(buf, strm->next_in, len); - strm->next_in += len; - strm->total_in += len; - - return (int)len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init (s) - deflate_state *s; -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif -} - -#ifndef FASTEST -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - unsigned chain_length = s->max_chain_length;/* max hash chain length */ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ - int nice_match = s->nice_match; /* stop if match long enough */ - IPos limit = s->strstart > (IPos)MAX_DIST(s) ? - s->strstart - (IPos)MAX_DIST(s) : NIL; - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - Posf *prev = s->prev; - uInt wmask = s->w_mask; - -#ifdef UNALIGNED_OK - /* Compare two bytes at a time. Note: this is not always beneficial. - * Try with and without -DUNALIGNED_OK to check. - */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); -#else - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; - register Byte scan_end = scan[best_len]; -#endif - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s->prev_length >= s->good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - Assert(cur_match < s->strstart, "no future"); - match = s->window + cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ -#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) - /* This code assumes sizeof(unsigned short) == 2. Do not use - * UNALIGNED_OK if your compiler uses a different size. - */ - if (*(ushf*)(match+best_len-1) != scan_end || - *(ushf*)match != scan_start) continue; - - /* It is not necessary to compare scan[2] and match[2] since they are - * always equal when the other bytes match, given that the hash keys - * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient - * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is - * necessary to put more guard bytes at the end of the window, or - * to check more often for insufficient lookahead. - */ - Assert(scan[2] == match[2], "scan[2]?"); - scan++, match++; - do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - scan < strend); - /* The funny "do {}" generates better code on most compilers */ - - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - if (*scan == *match) scan++; - - len = (MAX_MATCH - 1) - (int)(strend-scan); - scan = strend - (MAX_MATCH-1); - -#else /* UNALIGNED_OK */ - - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match++; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - scan = strend - MAX_MATCH; - -#endif /* UNALIGNED_OK */ - - if (len > best_len) { - s->match_start = cur_match; - best_len = len; - if (len >= nice_match) break; -#ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); -#else - scan_end1 = scan[best_len-1]; - scan_end = scan[best_len]; -#endif - } - } while ((cur_match = prev[cur_match & wmask]) > limit - && --chain_length != 0); - - if ((uInt)best_len <= s->lookahead) return (uInt)best_len; - return s->lookahead; -} -#endif /* ASMV */ -#endif /* FASTEST */ - -/* --------------------------------------------------------------------------- - * Optimized version for level == 1 or strategy == Z_RLE only - */ -local uInt longest_match_fast(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - Assert(cur_match < s->strstart, "no future"); - - match = s->window + cur_match; - - /* Return failure if the match length is less than 2: - */ - if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match += 2; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - - if (len < MIN_MATCH) return MIN_MATCH - 1; - - s->match_start = cur_match; - return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; -} - -#ifdef DEBUG -/* =========================================================================== - * Check that the match at match_start is indeed a match. - */ -local void check_match(s, start, match, length) - deflate_state *s; - IPos start, match; - int length; -{ - /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); - do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); - z_error("invalid match"); - } - if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); - do { putc(s->window[start++], stderr); } while (--length != 0); - } -} -#else -# define check_match(s, start, match, length) -#endif /* DEBUG */ - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window(s) - deflate_state *s; -{ - register unsigned n, m; - register Posf *p; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (sizeof(int) <= 2) { - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) - */ - more--; - } - } - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s->strstart >= wsize+MAX_DIST(s)) { - - zmemcpy(s->window, s->window+wsize, (unsigned)wsize); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (long) wsize; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - /* %%% avoid this when Z_RLE */ - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - } while (--n); - - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif - more += wsize; - } - if (s->strm->avail_in == 0) return; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - Assert(more >= 2, "more < 2"); - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead >= MIN_MATCH) { - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); -} - -/* =========================================================================== - * Flush the current block, with given end-of-file flag. - * IN assertion: strstart is set to the end of the current match. - */ -#define FLUSH_BLOCK_ONLY(s, eof) { \ - _tr_flush_block(s, (s->block_start >= 0L ? \ - (charf *)&s->window[(unsigned)s->block_start] : \ - (charf *)Z_NULL), \ - (ulg)((long)s->strstart - s->block_start), \ - (eof)); \ - s->block_start = s->strstart; \ - flush_pending(s->strm); \ - Tracev((stderr,"[FLUSH]")); \ -} - -/* Same but force premature exit if necessary. */ -#define FLUSH_BLOCK(s, eof) { \ - FLUSH_BLOCK_ONLY(s, eof); \ - if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; -{ - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - ulg max_block_size = 0xffff; - ulg max_start; - - if (max_block_size > s->pending_buf_size - 5) { - max_block_size = s->pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (; ; ) { - /* Fill the window as much as possible: */ - if (s->lookahead <= 1) { - - Assert(s->strstart < s->w_size+MAX_DIST(s) || - s->block_start >= (long)s->w_size, "slide too late"); - - fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; - - if (s->lookahead == 0) break; /* flush the current block */ - } - Assert(s->block_start >= 0L, "block gone"); - - s->strstart += s->lookahead; - s->lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - max_start = s->block_start + max_block_size; - if (s->strstart == 0 || (ulg)s->strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s->lookahead = (uInt)(s->strstart - max_start); - s->strstart = (uInt)max_start; - FLUSH_BLOCK(s, 0); - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { - FLUSH_BLOCK(s, 0); - } - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -local block_state deflate_fast(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head = NIL; /* head of the hash chain */ - int bflush; /* set if current block must be flushed */ - - for (; ; ) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ -#ifdef FASTEST - if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) || - (s->strategy == Z_RLE && s->strstart - hash_head == 1)) { - s->match_length = longest_match_fast (s, hash_head); - } -#else - if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { - s->match_length = longest_match (s, hash_head); - } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { - s->match_length = longest_match_fast (s, hash_head); - } -#endif - /* longest_match() or longest_match_fast() sets match_start */ - } - if (s->match_length >= MIN_MATCH) { - check_match(s, s->strstart, s->match_start, s->match_length); - - _tr_tally_dist(s, s->strstart - s->match_start, - s->match_length - MIN_MATCH, bflush); - - s->lookahead -= s->match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ -#ifndef FASTEST - if (s->match_length <= s->max_insert_length && - s->lookahead >= MIN_MATCH) { - s->match_length--; /* string at strstart already in table */ - do { - s->strstart++; - INSERT_STRING(s, s->strstart, hash_head); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s->match_length != 0); - s->strstart++; - } else -#endif - { - s->strstart += s->match_length; - s->match_length = 0; - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -#ifndef FASTEST -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -local block_state deflate_slow(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head = NIL; /* head of hash chain */ - int bflush; /* set if current block must be flushed */ - - /* Process the input block. */ - for (; ; ) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - */ - s->prev_length = s->match_length, s->prev_match = s->match_start; - s->match_length = MIN_MATCH-1; - - if (hash_head != NIL && s->prev_length < s->max_lazy_match && - s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { - s->match_length = longest_match (s, hash_head); - } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { - s->match_length = longest_match_fast (s, hash_head); - } - /* longest_match() or longest_match_fast() sets match_start */ - - if (s->match_length <= 5 && (s->strategy == Z_FILTERED -#if TOO_FAR <= 32767 - || (s->match_length == MIN_MATCH && - s->strstart - s->match_start > TOO_FAR) -#endif - )) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s->match_length = MIN_MATCH-1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { - uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - check_match(s, s->strstart-1, s->prev_match, s->prev_length); - - _tr_tally_dist(s, s->strstart -1 - s->prev_match, - s->prev_length - MIN_MATCH, bflush); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s->lookahead -= s->prev_length-1; - s->prev_length -= 2; - do { - if (++s->strstart <= max_insert) { - INSERT_STRING(s, s->strstart, hash_head); - } - } while (--s->prev_length != 0); - s->match_available = 0; - s->match_length = MIN_MATCH-1; - s->strstart++; - - if (bflush) FLUSH_BLOCK(s, 0); - - } else if (s->match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - if (bflush) { - FLUSH_BLOCK_ONLY(s, 0); - } - s->strstart++; - s->lookahead--; - if (s->strm->avail_out == 0) return need_more; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s->match_available = 1; - s->strstart++; - s->lookahead--; - } - } - Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - s->match_available = 0; - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} -#endif /* FASTEST */ - -#if 0 -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -local block_state deflate_rle(s, flush) - deflate_state *s; - int flush; -{ - int bflush; /* set if current block must be flushed */ - uInt run; /* length of run */ - uInt max; /* maximum length of run */ - uInt prev; /* byte at distance one to match */ - Bytef *scan; /* scan for end of run */ - - for (; ; ) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest encodable run. - */ - if (s->lookahead < MAX_MATCH) { - fill_window(s); - if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - run = 0; - if (s->strstart > 0) { /* if there is a previous byte, that is */ - max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH; - scan = s->window + s->strstart - 1; - prev = *scan++; - do { - if (*scan++ != prev) - break; - } while (++run < max); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (run >= MIN_MATCH) { - check_match(s, s->strstart, s->strstart - 1, run); - _tr_tally_dist(s, 1, run - MIN_MATCH, bflush); - s->lookahead -= run; - s->strstart += run; - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} -#endif diff --git a/dep/src/zlib/deflate.h b/dep/src/zlib/deflate.h deleted file mode 100644 index ad1f46a8dae..00000000000 --- a/dep/src/zlib/deflate.h +++ /dev/null @@ -1,330 +0,0 @@ -/* deflate.h -- internal compression state - * Copyright (C) 1995-2004 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef DEFLATE_H -#define DEFLATE_H - -#include "zutil.h" - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer creation by deflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip encoding - should be left enabled. */ -#ifndef NO_GZIP -# define GZIP -#endif - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 -/* Stream status */ - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ - Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to supress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - - uInt lit_bufsize; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - int last_eob_len; /* bit length of EOB code for last block */ - -#ifdef DEBUG - ulg compressed_len; /* total bit length of compressed file mod 2^32 */ - ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ -#endif - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - -} FAR deflate_state; - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - - /* in trees.c */ -void _tr_init OF((deflate_state *s)); -int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); -void _tr_align OF((deflate_state *s)); -void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -#ifndef DEBUG -/* Inline versions of _tr_tally for speed: */ - -#if defined(GEN_TREES_H) || !defined(STDC) - extern uch _length_code[]; - extern uch _dist_code[]; -#else - extern const uch _length_code[]; - extern const uch _dist_code[]; -#endif - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -#else -# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) -# define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) -#endif - -#endif /* DEFLATE_H */ - diff --git a/dep/src/zlib/example.c b/dep/src/zlib/example.c deleted file mode 100644 index 73799eac8cc..00000000000 --- a/dep/src/zlib/example.c +++ /dev/null @@ -1,565 +0,0 @@ -/* example.c -- usage example of the zlib compression library - * Copyright (C) 1995-2004 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include -#include "zlib.h" - -#ifdef STDC -# include -# include -#endif - -#if defined(VMS) || defined(RISCOS) -# define TESTFILE "foo-gz" -#else -# define TESTFILE "foo.gz" -#endif - -#define CHECK_ERR(err, msg) { \ - if (err != Z_OK) { \ - fprintf(stderr, "%s error: %d\n", msg, err); \ - exit(1); \ - } \ -} - -const char hello[] = "hello, hello!"; -/* "hello world" would be more standard, but the repeated "hello" - * stresses the compression code better, sorry... - */ - -const char dictionary[] = "hello"; -uLong dictId; /* Adler32 value of the dictionary */ - -void test_compress OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_gzio OF((const char *fname, - Byte *uncompr, uLong uncomprLen)); -void test_deflate OF((Byte *compr, uLong comprLen)); -void test_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_large_deflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_large_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_flush OF((Byte *compr, uLong *comprLen)); -void test_sync OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_dict_deflate OF((Byte *compr, uLong comprLen)); -void test_dict_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -int main OF((int argc, char *argv[])); - -/* =========================================================================== - * Test compress() and uncompress() - */ -void test_compress(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - uLong len = (uLong)strlen(hello)+1; - - err = compress(compr, &comprLen, (const Bytef*)hello, len); - CHECK_ERR(err, "compress"); - - strcpy((char*)uncompr, "garbage"); - - err = uncompress(uncompr, &uncomprLen, compr, comprLen); - CHECK_ERR(err, "uncompress"); - - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad uncompress\n"); - exit(1); - } else { - printf("uncompress(): %s\n", (char *)uncompr); - } -} - -/* =========================================================================== - * Test read/write of .gz files - */ -void test_gzio(fname, uncompr, uncomprLen) - const char *fname; /* compressed file name */ - Byte *uncompr; - uLong uncomprLen; -{ -#ifdef NO_GZCOMPRESS - fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); -#else - int err; - int len = (int)strlen(hello)+1; - gzFile file; - z_off_t pos; - - file = gzopen(fname, "wb"); - if (file == NULL) { - fprintf(stderr, "gzopen error\n"); - exit(1); - } - gzputc(file, 'h'); - if (gzputs(file, "ello") != 4) { - fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err)); - exit(1); - } - if (gzprintf(file, ", %s!", "hello") != 8) { - fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err)); - exit(1); - } - gzseek(file, 1L, SEEK_CUR); /* add one zero byte */ - gzclose(file); - - file = gzopen(fname, "rb"); - if (file == NULL) { - fprintf(stderr, "gzopen error\n"); - exit(1); - } - strcpy((char*)uncompr, "garbage"); - - if (gzread(file, uncompr, (unsigned)uncomprLen) != len) { - fprintf(stderr, "gzread err: %s\n", gzerror(file, &err)); - exit(1); - } - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad gzread: %s\n", (char*)uncompr); - exit(1); - } else { - printf("gzread(): %s\n", (char*)uncompr); - } - - pos = gzseek(file, -8L, SEEK_CUR); - if (pos != 6 || gztell(file) != pos) { - fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", - (long)pos, (long)gztell(file)); - exit(1); - } - - if (gzgetc(file) != ' ') { - fprintf(stderr, "gzgetc error\n"); - exit(1); - } - - if (gzungetc(' ', file) != ' ') { - fprintf(stderr, "gzungetc error\n"); - exit(1); - } - - gzgets(file, (char*)uncompr, (int)uncomprLen); - if (strlen((char*)uncompr) != 7) { /* " hello!" */ - fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); - exit(1); - } - if (strcmp((char*)uncompr, hello + 6)) { - fprintf(stderr, "bad gzgets after gzseek\n"); - exit(1); - } else { - printf("gzgets() after gzseek: %s\n", (char*)uncompr); - } - - gzclose(file); -#endif -} - -/* =========================================================================== - * Test deflate() with small buffers - */ -void test_deflate(compr, comprLen) - Byte *compr; - uLong comprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - uLong len = (uLong)strlen(hello)+1; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); - CHECK_ERR(err, "deflateInit"); - - c_stream.next_in = (Bytef*)hello; - c_stream.next_out = compr; - - while (c_stream.total_in != len && c_stream.total_out < comprLen) { - c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */ - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - } - /* Finish the stream, still forcing small buffers: */ - for (; ; ) { - c_stream.avail_out = 1; - err = deflate(&c_stream, Z_FINISH); - if (err == Z_STREAM_END) break; - CHECK_ERR(err, "deflate"); - } - - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); -} - -/* =========================================================================== - * Test inflate() with small buffers - */ -void test_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = 0; - d_stream.next_out = uncompr; - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) { - d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */ - err = inflate(&d_stream, Z_NO_FLUSH); - if (err == Z_STREAM_END) break; - CHECK_ERR(err, "inflate"); - } - - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad inflate\n"); - exit(1); - } else { - printf("inflate(): %s\n", (char *)uncompr); - } -} - -/* =========================================================================== - * Test deflate() with large buffers and dynamic change of compression level - */ -void test_large_deflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_BEST_SPEED); - CHECK_ERR(err, "deflateInit"); - - c_stream.next_out = compr; - c_stream.avail_out = (uInt)comprLen; - - /* At this point, uncompr is still mostly zeroes, so it should compress - * very well: - */ - c_stream.next_in = uncompr; - c_stream.avail_in = (uInt)uncomprLen; - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - if (c_stream.avail_in != 0) { - fprintf(stderr, "deflate not greedy\n"); - exit(1); - } - - /* Feed in already compressed data and switch to no compression: */ - deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); - c_stream.next_in = compr; - c_stream.avail_in = (uInt)comprLen/2; - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - - /* Switch back to compressing mode: */ - deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED); - c_stream.next_in = uncompr; - c_stream.avail_in = (uInt)uncomprLen; - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - - err = deflate(&c_stream, Z_FINISH); - if (err != Z_STREAM_END) { - fprintf(stderr, "deflate should report Z_STREAM_END\n"); - exit(1); - } - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); -} - -/* =========================================================================== - * Test inflate() with large buffers - */ -void test_large_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = (uInt)comprLen; - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - for (; ; ) { - d_stream.next_out = uncompr; /* discard the output */ - d_stream.avail_out = (uInt)uncomprLen; - err = inflate(&d_stream, Z_NO_FLUSH); - if (err == Z_STREAM_END) break; - CHECK_ERR(err, "large inflate"); - } - - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - if (d_stream.total_out != 2*uncomprLen + comprLen/2) { - fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out); - exit(1); - } else { - printf("large_inflate(): OK\n"); - } -} - -/* =========================================================================== - * Test deflate() with full flush - */ -void test_flush(compr, comprLen) - Byte *compr; - uLong *comprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - uInt len = (uInt)strlen(hello)+1; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); - CHECK_ERR(err, "deflateInit"); - - c_stream.next_in = (Bytef*)hello; - c_stream.next_out = compr; - c_stream.avail_in = 3; - c_stream.avail_out = (uInt)*comprLen; - err = deflate(&c_stream, Z_FULL_FLUSH); - CHECK_ERR(err, "deflate"); - - compr[3]++; /* force an error in first compressed block */ - c_stream.avail_in = len - 3; - - err = deflate(&c_stream, Z_FINISH); - if (err != Z_STREAM_END) { - CHECK_ERR(err, "deflate"); - } - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); - - *comprLen = c_stream.total_out; -} - -/* =========================================================================== - * Test inflateSync() - */ -void test_sync(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = 2; /* just read the zlib header */ - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - d_stream.next_out = uncompr; - d_stream.avail_out = (uInt)uncomprLen; - - inflate(&d_stream, Z_NO_FLUSH); - CHECK_ERR(err, "inflate"); - - d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */ - err = inflateSync(&d_stream); /* but skip the damaged part */ - CHECK_ERR(err, "inflateSync"); - - err = inflate(&d_stream, Z_FINISH); - if (err != Z_DATA_ERROR) { - fprintf(stderr, "inflate should report DATA_ERROR\n"); - /* Because of incorrect adler32 */ - exit(1); - } - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - printf("after inflateSync(): hel%s\n", (char *)uncompr); -} - -/* =========================================================================== - * Test deflate() with preset dictionary - */ -void test_dict_deflate(compr, comprLen) - Byte *compr; - uLong comprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_BEST_COMPRESSION); - CHECK_ERR(err, "deflateInit"); - - err = deflateSetDictionary(&c_stream, - (const Bytef*)dictionary, sizeof(dictionary)); - CHECK_ERR(err, "deflateSetDictionary"); - - dictId = c_stream.adler; - c_stream.next_out = compr; - c_stream.avail_out = (uInt)comprLen; - - c_stream.next_in = (Bytef*)hello; - c_stream.avail_in = (uInt)strlen(hello)+1; - - err = deflate(&c_stream, Z_FINISH); - if (err != Z_STREAM_END) { - fprintf(stderr, "deflate should report Z_STREAM_END\n"); - exit(1); - } - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); -} - -/* =========================================================================== - * Test inflate() with a preset dictionary - */ -void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = (uInt)comprLen; - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - d_stream.next_out = uncompr; - d_stream.avail_out = (uInt)uncomprLen; - - for (; ; ) { - err = inflate(&d_stream, Z_NO_FLUSH); - if (err == Z_STREAM_END) break; - if (err == Z_NEED_DICT) { - if (d_stream.adler != dictId) { - fprintf(stderr, "unexpected dictionary"); - exit(1); - } - err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary, - sizeof(dictionary)); - } - CHECK_ERR(err, "inflate with dict"); - } - - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad inflate with dict\n"); - exit(1); - } else { - printf("inflate with dictionary: %s\n", (char *)uncompr); - } -} - -/* =========================================================================== - * Usage: example [output.gz [input.gz]] - */ - -int main(argc, argv) - int argc; - char *argv[]; -{ - Byte *compr, *uncompr; - uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ - uLong uncomprLen = comprLen; - static const char* myVersion = ZLIB_VERSION; - - if (zlibVersion()[0] != myVersion[0]) { - fprintf(stderr, "incompatible zlib version\n"); - exit(1); - - } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) { - fprintf(stderr, "warning: different zlib version\n"); - } - - printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n", - ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags()); - - compr = (Byte*)calloc((uInt)comprLen, 1); - uncompr = (Byte*)calloc((uInt)uncomprLen, 1); - /* compr and uncompr are cleared to avoid reading uninitialized - * data and to ensure that uncompr compresses well. - */ - if (compr == Z_NULL || uncompr == Z_NULL) { - printf("out of memory\n"); - exit(1); - } - test_compress(compr, comprLen, uncompr, uncomprLen); - - test_gzio((argc > 1 ? argv[1] : TESTFILE), - uncompr, uncomprLen); - - test_deflate(compr, comprLen); - test_inflate(compr, comprLen, uncompr, uncomprLen); - - test_large_deflate(compr, comprLen, uncompr, uncomprLen); - test_large_inflate(compr, comprLen, uncompr, uncomprLen); - - test_flush(compr, &comprLen); - test_sync(compr, comprLen, uncompr, uncomprLen); - comprLen = uncomprLen; - - test_dict_deflate(compr, comprLen); - test_dict_inflate(compr, comprLen, uncompr, uncomprLen); - - free(compr); - free(uncompr); - - return 0; -} diff --git a/dep/src/zlib/gzio.c b/dep/src/zlib/gzio.c deleted file mode 100644 index 64dcae88107..00000000000 --- a/dep/src/zlib/gzio.c +++ /dev/null @@ -1,1018 +0,0 @@ -/* gzio.c -- IO on .gz files - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Compile this file with -DNO_GZCOMPRESS to avoid the compression code. - */ - -/* @(#) $Id$ */ - -#include - -#include "zutil.h" - -#ifdef NO_DEFLATE /* for compatibility with old definition */ -# define NO_GZCOMPRESS -#endif - -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - -#ifndef Z_BUFSIZE -# ifdef MAXSEG_64K -# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ -# else -# define Z_BUFSIZE 16384 -# endif -#endif -#ifndef Z_PRINTF_BUFSIZE -# define Z_PRINTF_BUFSIZE 4096 -#endif - -#ifdef __MVS__ -# pragma map (fdopen , "\174\174FDOPEN") - FILE *fdopen(int, const char *); -#endif - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern void free OF((voidpf ptr)); -#endif - -#define ALLOC(size) malloc(size) -#define TRYFREE(p) {if (p) free(p);} - -static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -/* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -typedef struct gz_stream { - z_stream stream; - int z_err; /* error code for last stream operation */ - int z_eof; /* set if end of input file */ - FILE *file; /* .gz file */ - Byte *inbuf; /* input buffer */ - Byte *outbuf; /* output buffer */ - uLong crc; /* crc32 of uncompressed data */ - char *msg; /* error message */ - char *path; /* path name for debugging only */ - int transparent; /* 1 if input file is not a .gz file */ - char mode; /* 'w' or 'r' */ - z_off_t start; /* start of compressed data in file (header skipped) */ - z_off_t in; /* bytes into deflate or inflate */ - z_off_t out; /* bytes out of deflate or inflate */ - int back; /* one character push-back */ - int last; /* true if push-back is last character */ -} gz_stream; - -local gzFile gz_open OF((const char *path, const char *mode, int fd)); -local int do_flush OF((gzFile file, int flush)); -local int get_byte OF((gz_stream *s)); -local void check_header OF((gz_stream *s)); -local int destroy OF((gz_stream *s)); -local void putLong OF((FILE *file, uLong x)); -local uLong getLong OF((gz_stream *s)); - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb"). The file is given either by file descriptor - or path name (if fd == -1). - gz_open returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). -*/ -local gzFile gz_open (path, mode, fd) - const char *path; - const char *mode; - int fd; -{ - int err; - int level = Z_DEFAULT_COMPRESSION; /* compression level */ - int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ - char *p = (char*)mode; - gz_stream *s; - char fmode[80]; /* copy of mode, without the compression level */ - char *m = fmode; - - if (!path || !mode) return Z_NULL; - - s = (gz_stream *)ALLOC(sizeof(gz_stream)); - if (!s) return Z_NULL; - - s->stream.zalloc = (alloc_func)0; - s->stream.zfree = (free_func)0; - s->stream.opaque = (voidpf)0; - s->stream.next_in = s->inbuf = Z_NULL; - s->stream.next_out = s->outbuf = Z_NULL; - s->stream.avail_in = s->stream.avail_out = 0; - s->file = NULL; - s->z_err = Z_OK; - s->z_eof = 0; - s->in = 0; - s->out = 0; - s->back = EOF; - s->crc = crc32(0L, Z_NULL, 0); - s->msg = NULL; - s->transparent = 0; - - s->path = (char*)ALLOC(strlen(path)+1); - if (s->path == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - strcpy(s->path, path); /* do this early for debugging */ - - s->mode = '\0'; - do { - if (*p == 'r') s->mode = 'r'; - if (*p == 'w' || *p == 'a') s->mode = 'w'; - if (*p >= '0' && *p <= '9') { - level = *p - '0'; - } else if (*p == 'f') { - strategy = Z_FILTERED; - } else if (*p == 'h') { - strategy = Z_HUFFMAN_ONLY; - } else if (*p == 'R') { - strategy = Z_RLE; - } else { - *m++ = *p; /* copy the mode */ - } - } while (*p++ && m != fmode + sizeof(fmode)); - if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateInit2(&(s->stream), level, - Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); - /* windowBits is passed < 0 to suppress zlib header */ - - s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); -#endif - if (err != Z_OK || s->outbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } else { - s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); - - err = inflateInit2(&(s->stream), -MAX_WBITS); - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are - * present after the compressed stream. - */ - if (err != Z_OK || s->inbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } - s->stream.avail_out = Z_BUFSIZE; - - errno = 0; - s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); - - if (s->file == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - if (s->mode == 'w') { - /* Write a very simple .gz header: - */ - fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], - Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); - s->start = 10L; - /* We use 10L instead of ftell(s->file) to because ftell causes an - * fflush on some systems. This version of the library doesn't use - * start anyway in write mode, so this initialization is not - * necessary. - */ - } else { - check_header(s); /* skip the .gz header */ - s->start = ftell(s->file) - s->stream.avail_in; - } - - return (gzFile)s; -} - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. -*/ -gzFile ZEXPORT gzopen (path, mode) - const char *path; - const char *mode; -{ - return gz_open (path, mode, -1); -} - -/* =========================================================================== - Associate a gzFile with the file descriptor fd. fd is not dup'ed here - to mimic the behavio(u)r of fdopen. -*/ -gzFile ZEXPORT gzdopen (fd, mode) - int fd; - const char *mode; -{ - char name[46]; /* allow for up to 128-bit integers */ - - if (fd < 0) return (gzFile)Z_NULL; - sprintf(name, "", fd); /* for debugging */ - - return gz_open (name, mode, fd); -} - -/* =========================================================================== - * Update the compression level and strategy - */ -int ZEXPORT gzsetparams (file, level, strategy) - gzFile file; - int level; - int strategy; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - /* Make room to allow flushing */ - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { - s->z_err = Z_ERRNO; - } - s->stream.avail_out = Z_BUFSIZE; - } - - return deflateParams (&(s->stream), level, strategy); -} - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ -local int get_byte(s) - gz_stream *s; -{ - if (s->z_eof) return EOF; - if (s->stream.avail_in == 0) { - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) s->z_err = Z_ERRNO; - return EOF; - } - s->stream.next_in = s->inbuf; - } - s->stream.avail_in--; - return *(s->stream.next_in)++; -} - -/* =========================================================================== - Check the gzip header of a gz_stream opened for reading. Set the stream - mode to transparent if the gzip magic header is not present; set s->err - to Z_DATA_ERROR if the magic header is present but the rest of the header - is incorrect. - IN assertion: the stream s has already been created sucessfully; - s->stream.avail_in is zero for the first time, but may be non-zero - for concatenated .gz files. -*/ -local void check_header(s) - gz_stream *s; -{ - int method; /* method byte */ - int flags; /* flags byte */ - uInt len; - int c; - - /* Assure two bytes in the buffer so we can peek ahead -- handle case - where first byte of header is at the end of the buffer after the last - gzip segment */ - len = s->stream.avail_in; - if (len < 2) { - if (len) s->inbuf[0] = s->stream.next_in[0]; - errno = 0; - len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); - if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; - s->stream.avail_in += len; - s->stream.next_in = s->inbuf; - if (s->stream.avail_in < 2) { - s->transparent = s->stream.avail_in; - return; - } - } - - /* Peek ahead to check the gzip magic header */ - if (s->stream.next_in[0] != gz_magic[0] || - s->stream.next_in[1] != gz_magic[1]) { - s->transparent = 1; - return; - } - s->stream.avail_in -= 2; - s->stream.next_in += 2; - - /* Check the rest of the gzip header */ - method = get_byte(s); - flags = get_byte(s); - if (method != Z_DEFLATED || (flags & RESERVED) != 0) { - s->z_err = Z_DATA_ERROR; - return; - } - - /* Discard time, xflags and OS code: */ - for (len = 0; len < 6; len++) (void)get_byte(s); - - if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ - len = (uInt)get_byte(s); - len += ((uInt)get_byte(s))<<8; - /* len is garbage if EOF but the loop below will quit anyway */ - while (len-- != 0 && get_byte(s) != EOF) ; - } - if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ - for (len = 0; len < 2; len++) (void)get_byte(s); - } - s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; -} - - /* =========================================================================== - * Cleanup then free the given gz_stream. Return a zlib error code. - Try freeing in the reverse order of allocations. - */ -local int destroy (s) - gz_stream *s; -{ - int err = Z_OK; - - if (!s) return Z_STREAM_ERROR; - - TRYFREE(s->msg); - - if (s->stream.state != NULL) { - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateEnd(&(s->stream)); -#endif - } else if (s->mode == 'r') { - err = inflateEnd(&(s->stream)); - } - } - if (s->file != NULL && fclose(s->file)) { -#ifdef ESPIPE - if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ -#endif - err = Z_ERRNO; - } - if (s->z_err < 0) err = s->z_err; - - TRYFREE(s->inbuf); - TRYFREE(s->outbuf); - TRYFREE(s->path); - TRYFREE(s); - return err; -} - -/* =========================================================================== - Reads the given number of uncompressed bytes from the compressed file. - gzread returns the number of bytes actually read (0 for end of file). -*/ -int ZEXPORT gzread (file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - Bytef *start = (Bytef*)buf; /* starting point for crc computation */ - Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ - - if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; - - if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; - if (s->z_err == Z_STREAM_END) return 0; /* EOF */ - - next_out = (Byte*)buf; - s->stream.next_out = (Bytef*)buf; - s->stream.avail_out = len; - - if (s->stream.avail_out && s->back != EOF) { - *next_out++ = s->back; - s->stream.next_out++; - s->stream.avail_out--; - s->back = EOF; - s->out++; - start++; - if (s->last) { - s->z_err = Z_STREAM_END; - return 1; - } - } - - while (s->stream.avail_out != 0) { - - if (s->transparent) { - /* Copy first the lookahead bytes: */ - uInt n = s->stream.avail_in; - if (n > s->stream.avail_out) n = s->stream.avail_out; - if (n > 0) { - zmemcpy(s->stream.next_out, s->stream.next_in, n); - next_out += n; - s->stream.next_out = next_out; - s->stream.next_in += n; - s->stream.avail_out -= n; - s->stream.avail_in -= n; - } - if (s->stream.avail_out > 0) { - s->stream.avail_out -= - (uInt)fread(next_out, 1, s->stream.avail_out, s->file); - } - len -= s->stream.avail_out; - s->in += len; - s->out += len; - if (len == 0) s->z_eof = 1; - return (int)len; - } - if (s->stream.avail_in == 0 && !s->z_eof) { - - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) { - s->z_err = Z_ERRNO; - break; - } - } - s->stream.next_in = s->inbuf; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = inflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - - if (s->z_err == Z_STREAM_END) { - /* Check CRC and original size */ - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - start = s->stream.next_out; - - if (getLong(s) != s->crc) { - s->z_err = Z_DATA_ERROR; - } else { - (void)getLong(s); - /* The uncompressed length returned by above getlong() may be - * different from s->out in case of concatenated .gz files. - * Check for such files: - */ - check_header(s); - if (s->z_err == Z_OK) { - inflateReset(&(s->stream)); - s->crc = crc32(0L, Z_NULL, 0); - } - } - } - if (s->z_err != Z_OK || s->z_eof) break; - } - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - - if (len == s->stream.avail_out && - (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) - return -1; - return (int)(len - s->stream.avail_out); -} - -/* =========================================================================== - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ -int ZEXPORT gzgetc(file) - gzFile file; -{ - unsigned char c; - - return gzread(file, &c, 1) == 1 ? c : -1; -} - -/* =========================================================================== - Push one byte back onto the stream. -*/ -int ZEXPORT gzungetc(c, file) - int c; - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF; - s->back = c; - s->out--; - s->last = (s->z_err == Z_STREAM_END); - if (s->last) s->z_err = Z_OK; - s->z_eof = 0; - return c; -} - -/* =========================================================================== - Reads bytes from the compressed file until len-1 characters are - read, or a newline character is read and transferred to buf, or an - end-of-file condition is encountered. The string is then terminated - with a null character. - gzgets returns buf, or Z_NULL in case of error. - - The current implementation is not optimized at all. -*/ -char * ZEXPORT gzgets(file, buf, len) - gzFile file; - char *buf; - int len; -{ - char *b = buf; - if (buf == Z_NULL || len <= 0) return Z_NULL; - - while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ; - *buf = '\0'; - return b == buf && len > 0 ? Z_NULL : b; -} - -#ifndef NO_GZCOMPRESS -/* =========================================================================== - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of bytes actually written (0 in case of error). -*/ -int ZEXPORT gzwrite (file, buf, len) - gzFile file; - voidpc buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.next_in = (Bytef*)buf; - s->stream.avail_in = len; - - while (s->stream.avail_in != 0) { - - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { - s->z_err = Z_ERRNO; - break; - } - s->stream.avail_out = Z_BUFSIZE; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = deflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - if (s->z_err != Z_OK) break; - } - s->crc = crc32(s->crc, (const Bytef *)buf, len); - - return (int)(len - s->stream.avail_in); -} - -/* =========================================================================== - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). -*/ -#ifdef STDC -#include - -int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...) -{ - char buf[Z_PRINTF_BUFSIZE]; - va_list va; - int len; - - buf[sizeof(buf) - 1] = 0; - va_start(va, format); -#ifdef NO_vsnprintf -# ifdef HAS_vsprintf_void - (void)vsprintf(buf, format, va); - va_end(va); - for (len = 0; len < sizeof(buf); len++) - if (buf[len] == 0) break; -# else - len = vsprintf(buf, format, va); - va_end(va); -# endif -#else -# ifdef HAS_vsnprintf_void - (void)vsnprintf(buf, sizeof(buf), format, va); - va_end(va); - len = strlen(buf); -# else - len = vsnprintf(buf, sizeof(buf), format, va); - va_end(va); -# endif -#endif - if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0) - return 0; - return gzwrite(file, buf, (unsigned)len); -} -#else /* not ANSI C */ - -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - gzFile file; - const char *format; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; -{ - char buf[Z_PRINTF_BUFSIZE]; - int len; - - buf[sizeof(buf) - 1] = 0; -#ifdef NO_snprintf -# ifdef HAS_sprintf_void - sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - for (len = 0; len < sizeof(buf); len++) - if (buf[len] == 0) break; -# else - len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#else -# ifdef HAS_snprintf_void - snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - len = strlen(buf); -# else - len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#endif - if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0) - return 0; - return gzwrite(file, buf, len); -} -#endif - -/* =========================================================================== - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; -{ - unsigned char cc = (unsigned char) c; /* required for big endian systems */ - - return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1; -} - -/* =========================================================================== - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ -int ZEXPORT gzputs(file, s) - gzFile file; - const char *s; -{ - return gzwrite(file, (char*)s, (unsigned)strlen(s)); -} - -/* =========================================================================== - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. -*/ -local int do_flush (file, flush) - gzFile file; - int flush; -{ - uInt len; - int done = 0; - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.avail_in = 0; /* should be zero already anyway */ - - for (; ; ) { - len = Z_BUFSIZE - s->stream.avail_out; - - if (len != 0) { - if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) { - s->z_err = Z_ERRNO; - return Z_ERRNO; - } - s->stream.next_out = s->outbuf; - s->stream.avail_out = Z_BUFSIZE; - } - if (done) break; - s->out += s->stream.avail_out; - s->z_err = deflate(&(s->stream), flush); - s->out -= s->stream.avail_out; - - /* Ignore the second of two consecutive flushes: */ - if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK; - - /* deflate has finished flushing only when it hasn't used up - * all the available space in the output buffer: - */ - done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END); - - if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break; - } - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; -} - -int ZEXPORT gzflush (file, flush) - gzFile file; - int flush; -{ - gz_stream *s = (gz_stream*)file; - int err = do_flush (file, flush); - - if (err) return err; - fflush(s->file); - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; -} -#endif /* NO_GZCOMPRESS */ - -/* =========================================================================== - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error. - SEEK_END is not implemented, returns error. - In this version of the library, gzseek can be extremely slow. -*/ -z_off_t ZEXPORT gzseek (file, offset, whence) - gzFile file; - z_off_t offset; - int whence; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || whence == SEEK_END || - s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) { - return -1L; - } - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - return -1L; -#else - if (whence == SEEK_SET) { - offset -= s->in; - } - if (offset < 0) return -1L; - - /* At this point, offset is the number of zero bytes to write. */ - if (s->inbuf == Z_NULL) { - s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */ - if (s->inbuf == Z_NULL) return -1L; - zmemzero(s->inbuf, Z_BUFSIZE); - } - while (offset > 0) { - uInt size = Z_BUFSIZE; - if (offset < Z_BUFSIZE) size = (uInt)offset; - - size = gzwrite(file, s->inbuf, size); - if (size == 0) return -1L; - - offset -= size; - } - return s->in; -#endif - } - /* Rest of function is for reading only */ - - /* compute absolute position */ - if (whence == SEEK_CUR) { - offset += s->out; - } - if (offset < 0) return -1L; - - if (s->transparent) { - /* map to fseek */ - s->back = EOF; - s->stream.avail_in = 0; - s->stream.next_in = s->inbuf; - if (fseek(s->file, offset, SEEK_SET) < 0) return -1L; - - s->in = s->out = offset; - return offset; - } - - /* For a negative seek, rewind and use positive seek */ - if (offset >= s->out) { - offset -= s->out; - } else if (gzrewind(file) < 0) { - return -1L; - } - /* offset is now the number of bytes to skip. */ - - if (offset != 0 && s->outbuf == Z_NULL) { - s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); - if (s->outbuf == Z_NULL) return -1L; - } - if (offset && s->back != EOF) { - s->back = EOF; - s->out++; - offset--; - if (s->last) s->z_err = Z_STREAM_END; - } - while (offset > 0) { - int size = Z_BUFSIZE; - if (offset < Z_BUFSIZE) size = (int)offset; - - size = gzread(file, s->outbuf, (uInt)size); - if (size <= 0) return -1L; - offset -= size; - } - return s->out; -} - -/* =========================================================================== - Rewinds input file. -*/ -int ZEXPORT gzrewind (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r') return -1; - - s->z_err = Z_OK; - s->z_eof = 0; - s->back = EOF; - s->stream.avail_in = 0; - s->stream.next_in = s->inbuf; - s->crc = crc32(0L, Z_NULL, 0); - if (!s->transparent) (void)inflateReset(&s->stream); - s->in = 0; - s->out = 0; - return fseek(s->file, s->start, SEEK_SET); -} - -/* =========================================================================== - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. -*/ -z_off_t ZEXPORT gztell (file) - gzFile file; -{ - return gzseek(file, 0L, SEEK_CUR); -} - -/* =========================================================================== - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ -int ZEXPORT gzeof (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - /* With concatenated compressed files that can have embedded - * crc trailers, z_eof is no longer the only/best indicator of EOF - * on a gz_stream. Handle end-of-stream error explicitly here. - */ - if (s == NULL || s->mode != 'r') return 0; - if (s->z_eof) return 1; - return s->z_err == Z_STREAM_END; -} - -/* =========================================================================== - Returns 1 if reading and doing so transparently, otherwise zero. -*/ -int ZEXPORT gzdirect (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r') return 0; - return s->transparent; -} - -/* =========================================================================== - Outputs a long in LSB order to the given file -*/ -local void putLong (file, x) - FILE *file; - uLong x; -{ - int n; - for (n = 0; n < 4; n++) { - fputc((int)(x & 0xff), file); - x >>= 8; - } -} - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets z_err in case - of error. -*/ -local uLong getLong (s) - gz_stream *s; -{ - uLong x = (uLong)get_byte(s); - int c; - - x += ((uLong)get_byte(s))<<8; - x += ((uLong)get_byte(s))<<16; - c = get_byte(s); - if (c == EOF) s->z_err = Z_DATA_ERROR; - x += ((uLong)c)<<24; - return x; -} - -/* =========================================================================== - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. -*/ -int ZEXPORT gzclose (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return Z_STREAM_ERROR; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - return Z_STREAM_ERROR; -#else - if (do_flush (file, Z_FINISH) != Z_OK) - return destroy((gz_stream*)file); - - putLong (s->file, s->crc); - putLong (s->file, (uLong)(s->in & 0xffffffff)); -#endif - } - return destroy((gz_stream*)file); -} - -#ifdef STDC -# define zstrerror(errnum) strerror(errnum) -#else -# define zstrerror(errnum) "" -#endif - -/* =========================================================================== - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ -const char * ZEXPORT gzerror (file, errnum) - gzFile file; - int *errnum; -{ - char *m; - gz_stream *s = (gz_stream*)file; - - if (s == NULL) { - *errnum = Z_STREAM_ERROR; - return (const char*)ERR_MSG(Z_STREAM_ERROR); - } - *errnum = s->z_err; - if (*errnum == Z_OK) return (const char*)""; - - m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg); - - if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err); - - TRYFREE(s->msg); - s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); - if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR); - strcpy(s->msg, s->path); - strcat(s->msg, ": "); - strcat(s->msg, m); - return (const char*)s->msg; -} - -/* =========================================================================== - Clear the error and end-of-file flags, and do the same for the real file. -*/ -void ZEXPORT gzclearerr (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return; - if (s->z_err != Z_STREAM_END) s->z_err = Z_OK; - s->z_eof = 0; - clearerr(s->file); -} diff --git a/dep/src/zlib/infback.c b/dep/src/zlib/infback.c deleted file mode 100644 index 1acf0a56d75..00000000000 --- a/dep/src/zlib/infback.c +++ /dev/null @@ -1,623 +0,0 @@ -/* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - This code is largely copied from inflate.c. Normally either infback.o or - inflate.o would be linked into an application--not both. The interface - with inffast.c is retained so that optimized assembler-coded versions of - inflate_fast() can be used with either inflate.c or infback.c. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - -/* - strm provides memory allocation functions in zalloc and zfree, or - Z_NULL to use the library memory allocation functions. - - windowBits is in the range 8..15, and window is a user-supplied - window and output buffer that is 2**windowBits bytes. - */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL || window == Z_NULL || - windowBits < 8 || windowBits > 15) - return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *)ZALLOC(strm, 1, - sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - state->dmax = 32768U; - state->wbits = windowBits; - state->wsize = 1U << windowBits; - state->window = window; - state->write = 0; - state->whave = 0; - return Z_OK; -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -/* Macros for inflateBack(): */ - -/* Load returned state from inflate_fast() */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Set state from registers for inflate_fast() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Assure that some input is available. If input is requested, but denied, - then return a Z_BUF_ERROR from inflateBack(). */ -#define PULL() \ - do { \ - if (have == 0) { \ - have = in(in_desc, &next); \ - if (have == 0) { \ - next = Z_NULL; \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflateBack() - with an error if there is no input available. */ -#define PULLBYTE() \ - do { \ - PULL(); \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflateBack() with - an error. */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Assure that some output space is available, by writing out the window - if it's full. If the write fails, return from inflateBack() with a - Z_BUF_ERROR. */ -#define ROOM() \ - do { \ - if (left == 0) { \ - put = state->window; \ - left = state->wsize; \ - state->whave = left; \ - if (out(out_desc, put, left)) { \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* - strm provides the memory allocation functions and window buffer on input, - and provides information on the unused input on return. For Z_DATA_ERROR - returns, strm will also provide an error message. - - in() and out() are the call-back input and output functions. When - inflateBack() needs more input, it calls in(). When inflateBack() has - filled the window with output, or when it completes with data in the - window, it calls out() to write out the data. The application must not - change the provided input until in() is called again or inflateBack() - returns. The application must not change the window/output buffer until - inflateBack() returns. - - in() and out() are called with a descriptor parameter provided in the - inflateBack() call. This parameter can be a structure that provides the - information required to do the read or write, as well as accumulated - information on the input and output such as totals and check values. - - in() should return zero on failure. out() should return non-zero on - failure. If either in() or out() fails, than inflateBack() returns a - Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it - was in() or out() that caused in the error. Otherwise, inflateBack() - returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format - error, or Z_MEM_ERROR if it could not allocate memory for the state. - inflateBack() can also return Z_STREAM_ERROR if the input parameters - are not correct, i.e. strm is Z_NULL or the state was not initialized. - */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - /* Check that the strm exists and that the state was initialized */ - if (strm == Z_NULL || strm->state == Z_NULL) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* Reset the state */ - strm->msg = Z_NULL; - state->mode = TYPE; - state->last = 0; - state->whave = 0; - next = strm->next_in; - have = next != Z_NULL ? strm->avail_in : 0; - hold = 0; - bits = 0; - put = state->window; - left = state->wsize; - - /* Inflate until end of block marked as last */ - for (;;) - switch (state->mode) { - case TYPE: - /* determine and dispatch block type */ - if (state->last) { - BYTEBITS(); - state->mode = DONE; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - - case STORED: - /* get and verify stored block length */ - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - - /* copy stored block from input to output */ - while (state->length != 0) { - copy = state->length; - PULL(); - ROOM(); - if (copy > have) copy = have; - if (copy > left) copy = left; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - - case TABLE: - /* get dynamic table entries descriptor */ - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - - /* get code length code lengths (not a typo) */ - state->have = 0; - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - - /* get length and distance code code lengths */ - state->have = 0; - while (state->have < state->nlen + state->ndist) { - for (; ; ) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = (unsigned)(state->lens[state->have - 1]); - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - - case LEN: - /* use inflate_fast() if we have enough input and output */ - if (have >= 6 && left >= 258) { - RESTORE(); - if (state->whave < state->wsize) - state->whave = state->wsize - left; - inflate_fast(strm, state->wsize); - LOAD(); - break; - } - - /* get a literal, length, or end-of-block code */ - for (; ; ) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (; ; ) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - - /* process literal */ - if (this.op == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - ROOM(); - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - } - - /* process end of block */ - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - - /* invalid code */ - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - - /* length code -- get extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - - /* get distance code */ - for (; ; ) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (; ; ) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - - /* get distance extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } - if (state->offset > state->wsize - (state->whave < state->wsize ? - left : 0)) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - - /* copy match from window to output */ - do { - ROOM(); - copy = state->wsize - state->offset; - if (copy < left) { - from = put + copy; - copy = left - copy; - } - else { - from = put - state->offset; - copy = left; - } - if (copy > state->length) copy = state->length; - state->length -= copy; - left -= copy; - do { - *put++ = *from++; - } while (--copy); - } while (state->length != 0); - break; - - case DONE: - /* inflate stream terminated properly -- write leftover output */ - ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } - goto inf_leave; - - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - - default: /* can't happen, but makes compilers happy */ - ret = Z_STREAM_ERROR; - goto inf_leave; - } - - /* Return unused input */ - inf_leave: - strm->next_in = next; - strm->avail_in = have; - return ret; -} - -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} diff --git a/dep/src/zlib/inffast.c b/dep/src/zlib/inffast.c deleted file mode 100644 index bbee92ed1e6..00000000000 --- a/dep/src/zlib/inffast.c +++ /dev/null @@ -1,318 +0,0 @@ -/* inffast.c -- fast decoding - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifndef ASMINF - -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ -#else -# define OFF 1 -# define PUP(a) *++(a) -#endif - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ - unsigned char FAR *out; /* local strm->next_out */ - unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ - unsigned char FAR *end; /* while out < end, enough space available */ -#ifdef INFLATE_STRICT - unsigned dmax; /* maximum distance from zlib header */ -#endif - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ - unsigned long hold; /* local strm->hold */ - unsigned bits; /* local strm->bits */ - code const FAR *lcode; /* local strm->lencode */ - code const FAR *dcode; /* local strm->distcode */ - unsigned lmask; /* mask for first level of length codes */ - unsigned dmask; /* mask for first level of distance codes */ - code this; /* retrieved table entry */ - unsigned op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - unsigned len; /* match length, unused bytes */ - unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; - last = in + (strm->avail_in - 5); - out = strm->next_out - OFF; - beg = out - (start - strm->avail_out); - end = out + (strm->avail_out - 257); -#ifdef INFLATE_STRICT - dmax = state->dmax; -#endif - wsize = state->wsize; - whave = state->whave; - write = state->write; - window = state->window; - hold = state->hold; - bits = state->bits; - lcode = state->lencode; - dcode = state->distcode; - lmask = (1U << state->lenbits) - 1; - dmask = (1U << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - do { - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = lcode[hold & lmask]; - dolen: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op == 0) { /* literal */ - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - PUP(out) = (unsigned char)(this.val); - } - else if (op & 16) { /* length base */ - len = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - len += (unsigned)hold & ((1U << op) - 1); - hold >>= op; - bits -= op; - } - Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = dcode[hold & dmask]; - dodist: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op & 16) { /* distance base */ - dist = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - } - dist += (unsigned)hold & ((1U << op) - 1); -#ifdef INFLATE_STRICT - if (dist > dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - hold >>= op; - bits -= op; - Tracevv((stderr, "inflate: distance %u\n", dist)); - op = (unsigned)(out - beg); /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - from = window - OFF; - if (write == 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - else if (write < op) { /* wrap around window */ - from += wsize + write - op; - op -= write; - if (op < len) { /* some from end of window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = window - OFF; - if (write < len) { /* some from start of window */ - op = write; - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - } - else { /* contiguous in window */ - from += write - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - else { - from = out - dist; /* copy direct from output */ - do { /* minimum length is three */ - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } while (len > 2); - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - } - else if ((op & 64) == 0) { /* 2nd level distance code */ - this = dcode[this.val + (hold & ((1U << op) - 1))]; - goto dodist; - } - else { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - } - else if ((op & 64) == 0) { /* 2nd level length code */ - this = lcode[this.val + (hold & ((1U << op) - 1))]; - goto dolen; - } - else if (op & 32) { /* end-of-block */ - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - else { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - } while (in < last && out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - in -= len; - bits -= len << 3; - hold &= (1U << bits) - 1; - - /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; - strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); - strm->avail_out = (unsigned)(out < end ? - 257 + (end - out) : 257 - (out - end)); - state->hold = hold; - state->bits = bits; - return; -} - -/* - inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - - Using bit fields for code structure - - Different op definition to avoid & for extra bits (do & for table bits) - - Three separate decoding do-loops for direct, window, and write == 0 - - Special case for distance > 1 copies to do overlapped load and store copy - - Explicit branch predictions (based on measured branch probabilities) - - Deferring match copy and interspersed it with decoding subsequent codes - - Swapping literal/length else - - Swapping window/direct else - - Larger unrolled copy loops (three is about right) - - Moving len -= 3 statement into middle of loop - */ - -#endif /* !ASMINF */ diff --git a/dep/src/zlib/inffast.h b/dep/src/zlib/inffast.h deleted file mode 100644 index c66fae6da2c..00000000000 --- a/dep/src/zlib/inffast.h +++ /dev/null @@ -1,12 +0,0 @@ -/* inffast.h -- header to use inffast.c - * Copyright (C) 1995-2003 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -void inflate_fast OF((z_streamp strm, unsigned start)); - diff --git a/dep/src/zlib/inffixed.h b/dep/src/zlib/inffixed.h deleted file mode 100644 index 3757019557f..00000000000 --- a/dep/src/zlib/inffixed.h +++ /dev/null @@ -1,95 +0,0 @@ - /* inffixed.h -- table for decoding fixed codes - * Generated automatically by makefixed(). - */ - - /* WARNING: this file should *not* be used by applications. It - is part of the implementation of the compression library and - is subject to change. Applications should only use zlib.h. - */ - - static const code lenfix[512] = { - {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, - {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, - {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, - {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, - {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, - {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, - {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, - {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, - {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, - {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, - {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, - {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, - {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, - {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, - {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, - {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, - {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, - {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, - {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, - {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, - {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, - {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, - {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, - {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, - {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, - {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, - {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, - {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, - {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, - {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, - {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, - {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, - {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, - {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, - {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, - {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, - {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, - {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, - {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, - {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, - {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, - {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, - {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, - {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, - {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, - {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, - {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, - {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, - {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, - {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, - {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, - {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, - {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, - {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, - {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, - {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, - {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, - {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, - {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, - {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, - {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, - {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, - {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, - {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, - {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, - {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, - {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, - {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, - {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, - {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, - {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, - {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, - {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, - {0,9,255} - }; - - static const code distfix[32] = { - {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, - {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, - {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, - {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, - {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, - {22,5,193},{64,5,0} - }; - diff --git a/dep/src/zlib/inflate.c b/dep/src/zlib/inflate.c deleted file mode 100644 index fcefa8ceff3..00000000000 --- a/dep/src/zlib/inflate.c +++ /dev/null @@ -1,1368 +0,0 @@ -/* inflate.c -- zlib decompression - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * Change history: - * - * 1.2.beta0 24 Nov 2002 - * - First version -- complete rewrite of inflate to simplify code, avoid - * creation of window when not needed, minimize use of window when it is - * needed, make inffast.c even faster, implement gzip decoding, and to - * improve code readability and style over the previous zlib inflate code - * - * 1.2.beta1 25 Nov 2002 - * - Use pointers for available input and output checking in inffast.c - * - Remove input and output counters in inffast.c - * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 - * - Remove unnecessary second byte pull from length extra in inffast.c - * - Unroll direct copy to three copies per loop in inffast.c - * - * 1.2.beta2 4 Dec 2002 - * - Change external routine names to reduce potential conflicts - * - Correct filename to inffixed.h for fixed tables in inflate.c - * - Make hbuf[] unsigned char to match parameter type in inflate.c - * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) - * to avoid negation problem on Alphas (64 bit) in inflate.c - * - * 1.2.beta3 22 Dec 2002 - * - Add comments on state->bits assertion in inffast.c - * - Add comments on op field in inftrees.h - * - Fix bug in reuse of allocated window after inflateReset() - * - Remove bit fields--back to byte structure for speed - * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths - * - Change post-increments to pre-increments in inflate_fast(), PPC biased? - * - Add compile time option, POSTINC, to use post-increments instead (Intel?) - * - Make MATCH copy in inflate() much faster for when inflate_fast() not used - * - Use local copies of stream next and avail values, as well as local bit - * buffer and bit count in inflate()--for speed when inflate_fast() not used - * - * 1.2.beta4 1 Jan 2003 - * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings - * - Move a comment on output buffer sizes from inffast.c to inflate.c - * - Add comments in inffast.c to introduce the inflate_fast() routine - * - Rearrange window copies in inflate_fast() for speed and simplification - * - Unroll last copy for window match in inflate_fast() - * - Use local copies of window variables in inflate_fast() for speed - * - Pull out common write == 0 case for speed in inflate_fast() - * - Make op and len in inflate_fast() unsigned for consistency - * - Add FAR to lcode and dcode declarations in inflate_fast() - * - Simplified bad distance check in inflate_fast() - * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new - * source file infback.c to provide a call-back interface to inflate for - * programs like gzip and unzip -- uses window as output buffer to avoid - * window copying - * - * 1.2.beta5 1 Jan 2003 - * - Improved inflateBack() interface to allow the caller to provide initial - * input in strm. - * - Fixed stored blocks bug in inflateBack() - * - * 1.2.beta6 4 Jan 2003 - * - Added comments in inffast.c on effectiveness of POSTINC - * - Typecasting all around to reduce compiler warnings - * - Changed loops from while (1) or do {} while (1) to for (; ; ), again to - * make compilers happy - * - Changed type of window in inflateBackInit() to unsigned char * - * - * 1.2.beta7 27 Jan 2003 - * - Changed many types to unsigned or unsigned short to avoid warnings - * - Added inflateCopy() function - * - * 1.2.0 9 Mar 2003 - * - Changed inflateBack() interface to provide separate opaque descriptors - * for the in() and out() functions - * - Changed inflateBack() argument and in_func typedef to swap the length - * and buffer address return values for the input function - * - Check next_in and next_out for Z_NULL on entry to inflate() - * - * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifdef MAKEFIXED -# ifndef BUILDFIXED -# define BUILDFIXED -# endif -#endif - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, unsigned out)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, - unsigned len)); - -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - strm->total_in = strm->total_out = state->total = 0; - strm->msg = Z_NULL; - strm->adler = 1; /* to support ill-conceived Java test suite */ - state->mode = HEAD; - state->last = 0; - state->havedict = 0; - state->dmax = 32768U; - state->head = Z_NULL; - state->wsize = 0; - state->whave = 0; - state->write = 0; - state->hold = 0; - state->bits = 0; - state->lencode = state->distcode = state->next = state->codes; - Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; - value &= (1L << bits) - 1; - state->hold += value << state->bits; - state->bits += bits; - return Z_OK; -} - -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL) return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *) - ZALLOC(strm, 1, sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - if (windowBits < 0) { - state->wrap = 0; - windowBits = -windowBits; - } - else { - state->wrap = (windowBits >> 4) + 1; -#ifdef GUNZIP - if (windowBits < 48) windowBits &= 15; -#endif - } - if (windowBits < 8 || windowBits > 15) { - ZFREE(strm, state); - strm->state = Z_NULL; - return Z_STREAM_ERROR; - } - state->wbits = (unsigned)windowBits; - state->window = Z_NULL; - return inflateReset(strm); -} - -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ - return inflateInit2_(strm, DEF_WBITS, version, stream_size); -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -#ifdef MAKEFIXED -#include - -/* - Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also - defines BUILDFIXED, so the tables are built on the fly. makefixed() writes - those tables to stdout, which would be piped to inffixed.h. A small program - can simply call makefixed to do this: - - void makefixed(void); - - int main(void) - { - makefixed(); - return 0; - } - - Then that can be linked with zlib built with MAKEFIXED defined and run: - - a.out > inffixed.h - */ -void makefixed() -{ - unsigned low, size; - struct inflate_state state; - - fixedtables(&state); - puts(" /* inffixed.h -- table for decoding fixed codes"); - puts(" * Generated automatically by makefixed()."); - puts(" */"); - puts(""); - puts(" /* WARNING: this file should *not* be used by applications."); - puts(" It is part of the implementation of this library and is"); - puts(" subject to change. Applications should only use zlib.h."); - puts(" */"); - puts(""); - size = 1U << 9; - printf(" static const code lenfix[%u] = {", size); - low = 0; - for (; ; ) { - if ((low % 7) == 0) printf("\n "); - printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits, - state.lencode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); - size = 1U << 5; - printf("\n static const code distfix[%u] = {", size); - low = 0; - for (; ; ) { - if ((low % 6) == 0) printf("\n "); - printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, - state.distcode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); -} -#endif /* MAKEFIXED */ - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -local int updatewindow(strm, out) -z_streamp strm; -unsigned out; -{ - struct inflate_state FAR *state; - unsigned copy, dist; - - state = (struct inflate_state FAR *)strm->state; - - /* if it hasn't been done already, allocate space for the window */ - if (state->window == Z_NULL) { - state->window = (unsigned char FAR *) - ZALLOC(strm, 1U << state->wbits, - sizeof(unsigned char)); - if (state->window == Z_NULL) return 1; - } - - /* if window not in use yet, initialize */ - if (state->wsize == 0) { - state->wsize = 1U << state->wbits; - state->write = 0; - state->whave = 0; - } - - /* copy state->wsize or less output bytes into the circular window */ - copy = out - strm->avail_out; - if (copy >= state->wsize) { - zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); - state->write = 0; - state->whave = state->wsize; - } - else { - dist = state->wsize - state->write; - if (dist > copy) dist = copy; - zmemcpy(state->window + state->write, strm->next_out - copy, dist); - copy -= dist; - if (copy) { - zmemcpy(state->window, strm->next_out - copy, copy); - state->write = copy; - state->whave = state->wsize; - } - else { - state->write += dist; - if (state->write == state->wsize) state->write = 0; - if (state->whave < state->wsize) state->whave += dist; - } - } - return 0; -} - -/* Macros for inflate(): */ - -/* check function to use adler32() for zlib or crc32() for gzip */ -#ifdef GUNZIP -# define UPDATE(check, buf, len) \ - (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) -#else -# define UPDATE(check, buf, len) adler32(check, buf, len) -#endif - -/* check macros for header crc */ -#ifdef GUNZIP -# define CRC2(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - check = crc32(check, hbuf, 2); \ - } while (0) - -# define CRC4(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - hbuf[2] = (unsigned char)((word) >> 16); \ - hbuf[3] = (unsigned char)((word) >> 24); \ - check = crc32(check, hbuf, 4); \ - } while (0) -#endif - -/* Load registers with state in inflate() for speed */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Restore state from registers in inflate() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflate() - if there is no input available. */ -#define PULLBYTE() \ - do { \ - if (have == 0) goto inf_leave; \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflate(). */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Reverse the bytes in a 32-bit value */ -#define REVERSE(q) \ - ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ - (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) - -/* - inflate() uses a state machine to process as much input data and generate as - much output data as possible before returning. The state machine is - structured roughly as follows: - - for (; ; ) switch (state) { - ... - case STATEn: - if (not enough input data or output space to make progress) - return; - ... make progress ... - state = STATEm; - break; - ... - } - - so when inflate() is called again, the same case is attempted again, and - if the appropriate resources are provided, the machine proceeds to the - next state. The NEEDBITS() macro is usually the way the state evaluates - whether it can proceed or should return. NEEDBITS() does the return if - the requested bits are not available. The typical use of the BITS macros - is: - - NEEDBITS(n); - ... do something with BITS(n) ... - DROPBITS(n); - - where NEEDBITS(n) either returns from inflate() if there isn't enough - input left to load n bits into the accumulator, or it continues. BITS(n) - gives the low n bits in the accumulator. When done, DROPBITS(n) drops - the low n bits off the accumulator. INITBITS() clears the accumulator - and sets the number of available bits to zero. BYTEBITS() discards just - enough bits to put the accumulator on a byte boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. - - NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return - if there is no input available. The decoding of variable length codes uses - PULLBYTE() directly in order to pull just enough bytes to decode the next - code, and no more. - - Some states loop until they get enough input, making sure that enough - state information is maintained to continue the loop where it left off - if NEEDBITS() returns in the loop. For example, want, need, and keep - would all have to actually be part of the saved state in case NEEDBITS() - returns: - - case STATEw: - while (want < need) { - NEEDBITS(n); - keep[want++] = BITS(n); - DROPBITS(n); - } - state = STATEx; - case STATEx: - - As shown above, if the next state is also the next case, then the break - is omitted. - - A state may also return if there is not enough output space available to - complete that state. Those states are copying stored data, writing a - literal byte, and copying a matching string. - - When returning, a "goto inf_leave" is used to update the total counters, - update the check value, and determine whether any progress has been made - during that inflate() call in order to return the proper return code. - Progress is defined as a change in either strm->avail_in or strm->avail_out. - When there is a window, goto inf_leave will update the window with the last - output written. If a goto inf_leave occurs in the middle of decompression - and there is no window currently, goto inf_leave will create one and copy - output to the window for the next call of inflate(). - - In this implementation, the flush parameter of inflate() only affects the - return code (per zlib.h). inflate() always writes as much as possible to - strm->next_out, given the space available and the provided input--the effect - documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers - the allocation of and copying into a sliding window until necessary, which - provides the effect documented in zlib.h for Z_FINISH when the entire input - stream available. So the only thing the flush parameter actually does is: - when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it - will return Z_BUF_ERROR if it has not reached the end of the stream. - */ - -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned in, out; /* save starting available input and output */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ -#ifdef GUNZIP - unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ -#endif - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0)) - return Z_STREAM_ERROR; - - state = (struct inflate_state FAR *)strm->state; - if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ - LOAD(); - in = have; - out = left; - ret = Z_OK; - for (;;) - switch (state->mode) { - case HEAD: - if (state->wrap == 0) { - state->mode = TYPEDO; - break; - } - NEEDBITS(16); -#ifdef GUNZIP - if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ - state->check = crc32(0L, Z_NULL, 0); - CRC2(state->check, hold); - INITBITS(); - state->mode = FLAGS; - break; - } - state->flags = 0; /* expect zlib header */ - if (state->head != Z_NULL) - state->head->done = -1; - if (!(state->wrap & 1) || /* check if zlib header allowed */ -#else - if ( -#endif - ((BITS(8) << 8) + (hold >> 8)) % 31) { - strm->msg = (char *)"incorrect header check"; - state->mode = BAD; - break; - } - if (BITS(4) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - DROPBITS(4); - len = BITS(4) + 8; - if (len > state->wbits) { - strm->msg = (char *)"invalid window size"; - state->mode = BAD; - break; - } - state->dmax = 1U << len; - Tracev((stderr, "inflate: zlib header ok\n")); - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = hold & 0x200 ? DICTID : TYPE; - INITBITS(); - break; -#ifdef GUNZIP - case FLAGS: - NEEDBITS(16); - state->flags = (int)(hold); - if ((state->flags & 0xff) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - if (state->flags & 0xe000) { - strm->msg = (char *)"unknown header flags set"; - state->mode = BAD; - break; - } - if (state->head != Z_NULL) - state->head->text = (int)((hold >> 8) & 1); - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = TIME; - case TIME: - NEEDBITS(32); - if (state->head != Z_NULL) - state->head->time = hold; - if (state->flags & 0x0200) CRC4(state->check, hold); - INITBITS(); - state->mode = OS; - case OS: - NEEDBITS(16); - if (state->head != Z_NULL) { - state->head->xflags = (int)(hold & 0xff); - state->head->os = (int)(hold >> 8); - } - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = EXLEN; - case EXLEN: - if (state->flags & 0x0400) { - NEEDBITS(16); - state->length = (unsigned)(hold); - if (state->head != Z_NULL) - state->head->extra_len = (unsigned)hold; - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - } - else if (state->head != Z_NULL) - state->head->extra = Z_NULL; - state->mode = EXTRA; - case EXTRA: - if (state->flags & 0x0400) { - copy = state->length; - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); - } - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - state->length -= copy; - } - if (state->length) goto inf_leave; - } - state->length = 0; - state->mode = NAME; - case NAME: - if (state->flags & 0x0800) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->name != Z_NULL && - state->length < state->head->name_max) - state->head->name[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->name = Z_NULL; - state->length = 0; - state->mode = COMMENT; - case COMMENT: - if (state->flags & 0x1000) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->comment != Z_NULL && - state->length < state->head->comm_max) - state->head->comment[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->comment = Z_NULL; - state->mode = HCRC; - case HCRC: - if (state->flags & 0x0200) { - NEEDBITS(16); - if (hold != (state->check & 0xffff)) { - strm->msg = (char *)"header crc mismatch"; - state->mode = BAD; - break; - } - INITBITS(); - } - if (state->head != Z_NULL) { - state->head->hcrc = (int)((state->flags >> 9) & 1); - state->head->done = 1; - } - strm->adler = state->check = crc32(0L, Z_NULL, 0); - state->mode = TYPE; - break; -#endif - case DICTID: - NEEDBITS(32); - strm->adler = state->check = REVERSE(hold); - INITBITS(); - state->mode = DICT; - case DICT: - if (state->havedict == 0) { - RESTORE(); - return Z_NEED_DICT; - } - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = TYPE; - case TYPE: - if (flush == Z_BLOCK) goto inf_leave; - case TYPEDO: - if (state->last) { - BYTEBITS(); - state->mode = CHECK; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - case STORED: - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - state->mode = COPY; - case COPY: - copy = state->length; - if (copy) { - if (copy > have) copy = have; - if (copy > left) copy = left; - if (copy == 0) goto inf_leave; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - break; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - case TABLE: - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - state->have = 0; - state->mode = LENLENS; - case LENLENS: - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - state->have = 0; - state->mode = CODELENS; - case CODELENS: - while (state->have < state->nlen + state->ndist) { - for (; ; ) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = state->lens[state->have - 1]; - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - RESTORE(); - inflate_fast(strm, out); - LOAD(); - break; - } - for (; ; ) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (; ; ) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - if ((int)(this.op) == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - state->mode = LIT; - break; - } - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - state->extra = (unsigned)(this.op) & 15; - state->mode = LENEXT; - case LENEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - state->mode = DIST; - case DIST: - for (; ; ) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (; ; ) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - state->extra = (unsigned)(this.op) & 15; - state->mode = DISTEXT; - case DISTEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } -#ifdef INFLATE_STRICT - if (state->offset > state->dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - if (state->offset > state->whave + out - left) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - state->mode = MATCH; - case MATCH: - if (left == 0) goto inf_leave; - copy = out - left; - if (state->offset > copy) { /* copy from window */ - copy = state->offset - copy; - if (copy > state->write) { - copy -= state->write; - from = state->window + (state->wsize - copy); - } - else - from = state->window + (state->write - copy); - if (copy > state->length) copy = state->length; - } - else { /* copy from output */ - from = put - state->offset; - copy = state->length; - } - if (copy > left) copy = left; - left -= copy; - state->length -= copy; - do { - *put++ = *from++; - } while (--copy); - if (state->length == 0) state->mode = LEN; - break; - case LIT: - if (left == 0) goto inf_leave; - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - case CHECK: - if (state->wrap) { - NEEDBITS(32); - out -= left; - strm->total_out += out; - state->total += out; - if (out) - strm->adler = state->check = - UPDATE(state->check, put - out, out); - out = left; - if (( -#ifdef GUNZIP - state->flags ? hold : -#endif - REVERSE(hold)) != state->check) { - strm->msg = (char *)"incorrect data check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: check matches trailer\n")); - } -#ifdef GUNZIP - state->mode = LENGTH; - case LENGTH: - if (state->wrap && state->flags) { - NEEDBITS(32); - if (hold != (state->total & 0xffffffffUL)) { - strm->msg = (char *)"incorrect length check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: length matches trailer\n")); - } -#endif - state->mode = DONE; - case DONE: - ret = Z_STREAM_END; - goto inf_leave; - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - inf_leave: - RESTORE(); - if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) - if (updatewindow(strm, out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - in -= strm->avail_in; - out -= strm->avail_out; - strm->total_in += in; - strm->total_out += out; - state->total += out; - if (state->wrap && out) - strm->adler = state->check = - UPDATE(state->check, strm->next_out - out, out); - strm->data_type = state->bits + (state->last ? 64 : 0) + - (state->mode == TYPE ? 128 : 0); - if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) - ret = Z_BUF_ERROR; - return ret; -} - -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->window != Z_NULL) ZFREE(strm, state->window); - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} - -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ - struct inflate_state FAR *state; - unsigned long id; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->wrap != 0 && state->mode != DICT) - return Z_STREAM_ERROR; - - /* check for correct dictionary id */ - if (state->mode == DICT) { - id = adler32(0L, Z_NULL, 0); - id = adler32(id, dictionary, dictLength); - if (id != state->check) - return Z_DATA_ERROR; - } - - /* copy dictionary to window */ - if (updatewindow(strm, strm->avail_out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - if (dictLength > state->wsize) { - zmemcpy(state->window, dictionary + dictLength - state->wsize, - state->wsize); - state->whave = state->wsize; - } - else { - zmemcpy(state->window + state->wsize - dictLength, dictionary, - dictLength); - state->whave = dictLength; - } - state->havedict = 1; - Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ - struct inflate_state FAR *state; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; - - /* save header structure */ - state->head = head; - head->done = 0; - return Z_OK; -} - -/* - Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found - or when out of input. When called, *have is the number of pattern bytes - found in order so far, in 0..3. On return *have is updated to the new - state. If on return *have equals four, then the pattern was found and the - return value is how many bytes were read including the last byte of the - pattern. If *have is less than four, then the pattern has not been found - yet and the return value is len. In the latter case, syncsearch() can be - called again with more data and the *have state. *have is initialized to - zero for the first call. - */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -unsigned char FAR *buf; -unsigned len; -{ - unsigned got; - unsigned next; - - got = *have; - next = 0; - while (next < len && got < 4) { - if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) - got++; - else if (buf[next]) - got = 0; - else - got = 4 - got; - next++; - } - *have = got; - return next; -} - -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ - unsigned len; /* number of bytes to look at or looked at */ - unsigned long in, out; /* temporary to save total_in and total_out */ - unsigned char buf[4]; /* to restore bit buffer to byte string */ - struct inflate_state FAR *state; - - /* check parameters */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; - - /* if first time, start search in bit buffer */ - if (state->mode != SYNC) { - state->mode = SYNC; - state->hold <<= state->bits & 7; - state->bits -= state->bits & 7; - len = 0; - while (state->bits >= 8) { - buf[len++] = (unsigned char)(state->hold); - state->hold >>= 8; - state->bits -= 8; - } - state->have = 0; - syncsearch(&(state->have), buf, len); - } - - /* search available input */ - len = syncsearch(&(state->have), strm->next_in, strm->avail_in); - strm->avail_in -= len; - strm->next_in += len; - strm->total_in += len; - - /* return no joy or set up to restart inflate() on a new block */ - if (state->have != 4) return Z_DATA_ERROR; - in = strm->total_in; out = strm->total_out; - inflateReset(strm); - strm->total_in = in; strm->total_out = out; - state->mode = TYPE; - return Z_OK; -} - -/* - Returns true if inflate is currently at the end of a block generated by - Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - implementation to provide an additional safety check. PPP uses - Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored - block. When decompressing, PPP checks that at the end of input packet, - inflate is waiting for these length bytes. - */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - return state->mode == STORED && state->bits == 0; -} - -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ - struct inflate_state FAR *state; - struct inflate_state FAR *copy; - unsigned char FAR *window; - unsigned wsize; - - /* check input */ - if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || - source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)source->state; - - /* allocate space */ - copy = (struct inflate_state FAR *) - ZALLOC(source, 1, sizeof(struct inflate_state)); - if (copy == Z_NULL) return Z_MEM_ERROR; - window = Z_NULL; - if (state->window != Z_NULL) { - window = (unsigned char FAR *) - ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); - if (window == Z_NULL) { - ZFREE(source, copy); - return Z_MEM_ERROR; - } - } - - /* copy state */ - zmemcpy(dest, source, sizeof(z_stream)); - zmemcpy(copy, state, sizeof(struct inflate_state)); - if (state->lencode >= state->codes && - state->lencode <= state->codes + ENOUGH - 1) { - copy->lencode = copy->codes + (state->lencode - state->codes); - copy->distcode = copy->codes + (state->distcode - state->codes); - } - copy->next = copy->codes + (state->next - state->codes); - if (window != Z_NULL) { - wsize = 1U << state->wbits; - zmemcpy(window, state->window, wsize); - } - copy->window = window; - dest->state = (struct internal_state FAR *)copy; - return Z_OK; -} diff --git a/dep/src/zlib/inflate.h b/dep/src/zlib/inflate.h deleted file mode 100644 index 7c05e08fcba..00000000000 --- a/dep/src/zlib/inflate.h +++ /dev/null @@ -1,116 +0,0 @@ -/* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer decoding by inflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip decoding - should be left enabled. */ -#ifndef NO_GZIP -# define GUNZIP -#endif - -/* Possible inflate modes between inflate() calls */ -typedef enum { - HEAD, /* i: waiting for magic header */ - FLAGS, /* i: waiting for method and flags (gzip) */ - TIME, /* i: waiting for modification time (gzip) */ - OS, /* i: waiting for extra flags and operating system (gzip) */ - EXLEN, /* i: waiting for extra length (gzip) */ - EXTRA, /* i: waiting for extra bytes (gzip) */ - NAME, /* i: waiting for end of file name (gzip) */ - COMMENT, /* i: waiting for end of comment (gzip) */ - HCRC, /* i: waiting for header crc (gzip) */ - DICTID, /* i: waiting for dictionary check value */ - DICT, /* waiting for inflateSetDictionary() call */ - TYPE, /* i: waiting for type bits, including last-flag bit */ - TYPEDO, /* i: same, but skip check to exit inflate on new block */ - STORED, /* i: waiting for stored size (length and complement) */ - COPY, /* i/o: waiting for input or output to copy stored block */ - TABLE, /* i: waiting for dynamic block table lengths */ - LENLENS, /* i: waiting for code length code lengths */ - CODELENS, /* i: waiting for length/lit and distance code lengths */ - LEN, /* i: waiting for length/lit code */ - LENEXT, /* i: waiting for length extra bits */ - DIST, /* i: waiting for distance code */ - DISTEXT, /* i: waiting for distance extra bits */ - MATCH, /* o: waiting for output space to copy string */ - LIT, /* o: waiting for output space to write literal */ - CHECK, /* i: waiting for 32-bit check value */ - LENGTH, /* i: waiting for 32-bit length (gzip) */ - DONE, /* finished check, done -- remain here until reset */ - BAD, /* got a data error -- remain here until reset */ - MEM, /* got an inflate() memory error -- remain here until reset */ - SYNC /* looking for synchronization bytes to restart inflate() */ -} inflate_mode; - -/* - State transitions between above modes - - - (most modes can go to the BAD or MEM mode -- not shown for clarity) - - Process header: - HEAD -> (gzip) or (zlib) - (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME - NAME -> COMMENT -> HCRC -> TYPE - (zlib) -> DICTID or TYPE - DICTID -> DICT -> TYPE - Read deflate blocks: - TYPE -> STORED or TABLE or LEN or CHECK - STORED -> COPY -> TYPE - TABLE -> LENLENS -> CODELENS -> LEN - Read deflate codes: - LEN -> LENEXT or LIT or TYPE - LENEXT -> DIST -> DISTEXT -> MATCH -> LEN - LIT -> LEN - Process trailer: - CHECK -> LENGTH -> DONE - */ - -/* state maintained between inflate() calls. Approximately 7K bytes. */ -struct inflate_state { - inflate_mode mode; /* current inflate mode */ - int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ - unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ - unsigned long check; /* protected copy of check value */ - unsigned long total; /* protected copy of output count */ - gz_headerp head; /* where to save gzip header information */ - /* sliding window */ - unsigned wbits; /* log base 2 of requested window size */ - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ - /* bit accumulator */ - unsigned long hold; /* input bit accumulator */ - unsigned bits; /* number of bits in "in" */ - /* for string and stored block copying */ - unsigned length; /* literal or length of data to copy */ - unsigned offset; /* distance back to copy string from */ - /* for table and code decoding */ - unsigned extra; /* extra bits needed */ - /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ - unsigned lenbits; /* index bits for lencode */ - unsigned distbits; /* index bits for distcode */ - /* dynamic table building */ - unsigned ncode; /* number of code length code lengths */ - unsigned nlen; /* number of length code lengths */ - unsigned ndist; /* number of distance code lengths */ - unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ - unsigned short lens[320]; /* temporary storage for code lengths */ - unsigned short work[288]; /* work area for code table building */ - code codes[ENOUGH]; /* space for code tables */ -}; - diff --git a/dep/src/zlib/inftrees.c b/dep/src/zlib/inftrees.c deleted file mode 100644 index 3a3fabc4bea..00000000000 --- a/dep/src/zlib/inftrees.c +++ /dev/null @@ -1,329 +0,0 @@ -/* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" - -#define MAXBITS 15 - -const char inflate_copyright[] = - " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* - Build a set of tables to decode the provided canonical Huffman code. - The code lengths are lens[0..codes-1]. The result starts at *table, - whose indices are 0..2^bits-1. work is a writable array of at least - lens shorts, which is used as a work area. type is the type of code - to be generated, CODES, LENS, or DISTS. On return, zero is success, - -1 is an invalid code, and +1 means that ENOUGH isn't enough. table - on return points to the next available entry's address. bits is the - requested root table index bits, and on return it is the actual root - table index bits. It will differ if the request is greater than the - longest code or if it is less than the shortest code. - */ -int inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ - unsigned len; /* a code's length in bits */ - unsigned sym; /* index of code symbols */ - unsigned min, max; /* minimum and maximum code lengths */ - unsigned root; /* number of index bits for root table */ - unsigned curr; /* number of index bits for current table */ - unsigned drop; /* code bits to drop for sub-table */ - int left; /* number of prefix codes available */ - unsigned used; /* code entries in table used */ - unsigned huff; /* Huffman code */ - unsigned incr; /* for incrementing code, index */ - unsigned fill; /* index for replicating entries */ - unsigned low; /* low bits for current root entry */ - unsigned mask; /* mask for low root bits */ - code this; /* table entry for duplication */ - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ - unsigned short count[MAXBITS+1]; /* number of codes of each length */ - unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ - static const unsigned short lbase[31] = { /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - static const unsigned short lext[31] = { /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; - static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0}; - static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64}; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) - count[len] = 0; - for (sym = 0; sym < codes; sym++) - count[lens[sym]]++; - - /* bound code lengths, force root to be within code lengths */ - root = *bits; - for (max = MAXBITS; max >= 1; max--) - if (count[max] != 0) break; - if (root > max) root = max; - if (max == 0) { /* no symbols to code at all */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)1; - this.val = (unsigned short)0; - *(*table)++ = this; /* make a table to force an error */ - *(*table)++ = this; - *bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min <= MAXBITS; min++) - if (count[min] != 0) break; - if (root < min) root = min; - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) return -1; /* over-subscribed */ - } - if (left > 0 && (type == CODES || max != 1)) - return -1; /* incomplete set */ - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) - offs[len + 1] = offs[len] + count[len]; - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) - if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked when a LENS table is being made - against the space in *table, ENOUGH, minus the maximum space needed by - the worst case distance code, MAXD. This should never happen, but the - sufficiency of ENOUGH has not been proven exhaustively, hence the check. - This assumes that when type == LENS, bits == 9. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - switch (type) { - case CODES: - base = extra = work; /* dummy value--not used */ - end = 19; - break; - case LENS: - base = lbase; - base -= 257; - extra = lext; - extra -= 257; - end = 256; - break; - default: /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize state for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = *table; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = (unsigned)(-1); /* trigger new sub-table when len > root */ - used = 1U << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* process all codes and make table entries */ - for (; ; ) { - /* create table entry */ - this.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { - this.op = (unsigned char)0; - this.val = work[sym]; - } - else if ((int)(work[sym]) > end) { - this.op = (unsigned char)(extra[work[sym]]); - this.val = base[work[sym]]; - } - else { - this.op = (unsigned char)(32 + 64); /* end of block */ - this.val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1U << (len - drop); - fill = 1U << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - next[(huff >> drop) + fill] = this; - } while (fill != 0); - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - - /* go to next symbol, update count, len */ - sym++; - if (--(count[len]) == 0) { - if (len == max) break; - len = lens[work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) != low) { - /* if first time, transition to sub-tables */ - if (drop == 0) - drop = root; - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = (int)(1 << curr); - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) break; - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1U << curr; - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* point entry in root table to sub-table */ - low = huff & mask; - (*table)[low].op = (unsigned char)curr; - (*table)[low].bits = (unsigned char)root; - (*table)[low].val = (unsigned short)(next - *table); - } - } - - /* - Fill in rest of table for incomplete codes. This loop is similar to the - loop above in incrementing huff for table indices. It is assumed that - len is equal to curr + drop, so there is no loop needed to increment - through high index bits. When the current sub-table is filled, the loop - drops back to the root table to fill in any remaining entries there. - */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)(len - drop); - this.val = (unsigned short)0; - while (huff != 0) { - /* when done with sub-table, drop back to root table */ - if (drop != 0 && (huff & mask) != low) { - drop = 0; - len = root; - next = *table; - this.bits = (unsigned char)len; - } - - /* put invalid code marker in table */ - next[huff >> drop] = this; - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - } - - /* set return parameters */ - *table += used; - *bits = root; - return 0; -} diff --git a/dep/src/zlib/inftrees.h b/dep/src/zlib/inftrees.h deleted file mode 100644 index 977ee2f78f5..00000000000 --- a/dep/src/zlib/inftrees.h +++ /dev/null @@ -1,56 +0,0 @@ -/* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* Structure for decoding tables. Each entry provides either the - information needed to do the operation requested by the code that - indexed that table entry, or it provides a pointer to another - table that indexes more bits of the code. op indicates whether - the entry is a pointer to another table, a literal, a length or - distance, an end-of-block, or an invalid code. For a table - pointer, the low four bits of op is the number of index bits of - that table. For a length or distance, the low four bits of op - is the number of extra bits to get after the code. bits is - the number of bits in this code or part of the code to drop off - of the bit buffer. val is the actual byte to output in the case - of a literal, the base length or distance, or the offset from - the current table to the next table. Each entry is four bytes. */ -typedef struct { - unsigned char op; /* operation, extra bits, table bits */ - unsigned char bits; /* bits in this part of the code */ - unsigned short val; /* offset in table or code value */ -} code; - -/* op values as set by inflate_table(): - 00000000 - literal - 0000tttt - table link, tttt != 0 is the number of table index bits - 0001eeee - length or distance, eeee is the number of extra bits - 01100000 - end of block - 01000000 - invalid code - */ - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1444 code structures (852 for length/literals - and 592 for distances, the latter actually the result of an - exhaustive search). The true maximum is not known, but the value - below is more than safe. */ -#define ENOUGH 2048 -#define MAXD 592 - -/* Type of code to build for inftable() */ -typedef enum { - CODES, - LENS, - DISTS -} codetype; - -extern int inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); - diff --git a/dep/src/zlib/trees.c b/dep/src/zlib/trees.c deleted file mode 100644 index bf8720a8b32..00000000000 --- a/dep/src/zlib/trees.c +++ /dev/null @@ -1,1217 +0,0 @@ -/* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2005 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process uses several Huffman trees. The more - * common source values are represented by shorter bit sequences. - * - * Each code tree is stored in a compressed form which is itself - * a Huffman encoding of the lengths of all the code strings (in - * ascending order by source values). The actual code strings are - * reconstructed from the lengths in the inflate process, as described - * in the deflate specification. - * - * REFERENCES - * - * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". - * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc - * - * Storer, James A. - * Data Compression: Methods and Theory, pp. 49-50. - * Computer Science Press, 1988. ISBN 0-7167-8156-5. - * - * Sedgewick, R. - * Algorithms, p290. - * Addison-Wesley, 1983. ISBN 0-201-06672-6. - */ - -/* @(#) $Id$ */ - -/* #define GEN_TREES_H */ - -#include "deflate.h" - -#ifdef DEBUG -# include -#endif - -/* =========================================================================== - * Constants - */ - -#define MAX_BL_BITS 7 -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -#define END_BLOCK 256 -/* end of block literal code */ - -#define REP_3_6 16 -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -#define REPZ_3_10 17 -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -#define REPZ_11_138 18 -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ - = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; - -local const int extra_dbits[D_CODES] /* extra bits for each distance code */ - = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ - = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; - -local const uch bl_order[BL_CODES] - = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -#define Buf_size (8 * 2*sizeof(char)) -/* Number of bits used within bi_buf. (bi_buf might be implemented on - * more than 16 bits on some systems.) - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ - -#if defined(GEN_TREES_H) || !defined(STDC) -/* non ANSI compilers may not accept trees.h */ - -local ct_data static_ltree[L_CODES+2]; -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -local ct_data static_dtree[D_CODES]; -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -uch _dist_code[DIST_CODE_LEN]; -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -uch _length_code[MAX_MATCH-MIN_MATCH+1]; -/* length code for each normalized match length (0 == MIN_MATCH) */ - -local int base_length[LENGTH_CODES]; -/* First normalized length for each code (0 = MIN_MATCH) */ - -local int base_dist[D_CODES]; -/* First normalized distance for each code (0 = distance of 1) */ - -#else -# include "trees.h" -#endif /* GEN_TREES_H */ - -struct static_tree_desc_s { - const ct_data *static_tree; /* static tree or NULL */ - const intf *extra_bits; /* extra bits for each code or NULL */ - int extra_base; /* base index for extra_bits */ - int elems; /* max number of elements in the tree */ - int max_length; /* max bit length for the codes */ -}; - -local static_tree_desc static_l_desc = -{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; - -local static_tree_desc static_d_desc = -{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; - -local static_tree_desc static_bl_desc = -{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; - -/* =========================================================================== - * Local (static) routines in this file. - */ - -local void tr_static_init OF((void)); -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); -local void set_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned value, int length)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); -local void copy_block OF((deflate_state *s, charf *buf, unsigned len, - int header)); - -#ifdef GEN_TREES_H -local void gen_trees_header OF((void)); -#endif - -#ifndef DEBUG -# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) - /* Send a code of the given tree. c and tree must not have side effects */ - -#else /* DEBUG */ -# define send_code(s, c, tree) \ - { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ - send_bits(s, tree[c].Code, tree[c].Len); } -#endif - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -#ifdef DEBUG -local void send_bits OF((deflate_state *s, int value, int length)); - -local void send_bits(s, value, length) - deflate_state *s; - int value; /* value to send */ - int length; /* number of bits */ -{ - Tracevv((stderr," l %2d v %4x ", length, value)); - Assert(length > 0 && length <= 15, "invalid length"); - s->bits_sent += (ulg)length; - - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (s->bi_valid > (int)Buf_size - length) { - s->bi_buf |= (value << s->bi_valid); - put_short(s, s->bi_buf); - s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); - s->bi_valid += length - Buf_size; - } else { - s->bi_buf |= value << s->bi_valid; - s->bi_valid += length; - } -} -#else /* !DEBUG */ - -#define send_bits(s, value, length) \ -{ int len = length;\ - if (s->bi_valid > (int)Buf_size - len) {\ - int val = value;\ - s->bi_buf |= (val << s->bi_valid);\ - put_short(s, s->bi_buf);\ - s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ - s->bi_valid += len - Buf_size;\ - } else {\ - s->bi_buf |= (value) << s->bi_valid;\ - s->bi_valid += len;\ - }\ -} -#endif /* DEBUG */ - -/* the arguments must not have side effects */ - -/* =========================================================================== - * Initialize the various 'constant' tables. - */ -local void tr_static_init() -{ -#if defined(GEN_TREES_H) || !defined(STDC) - static int static_init_done = 0; - int n; /* iterates over tree elements */ - int bits; /* bit counter */ - int length; /* length value */ - int code; /* code value */ - int dist; /* distance index */ - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - if (static_init_done) return; - - /* For some embedded targets, global variables are not initialized: */ - static_l_desc.static_tree = static_ltree; - static_l_desc.extra_bits = extra_lbits; - static_d_desc.static_tree = static_dtree; - static_d_desc.extra_bits = extra_dbits; - static_bl_desc.extra_bits = extra_blbits; - - /* Initialize the mapping length (0..255) -> length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES-1; code++) { - base_length[code] = length; - for (n = 0; n < (1< dist code (0..29) */ - dist = 0; - for (code = 0 ; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { - _dist_code[256 + dist++] = (uch)code; - } - } - Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; - n = 0; - while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; - while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; - while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; - while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n].Len = 5; - static_dtree[n].Code = bi_reverse((unsigned)n, 5); - } - static_init_done = 1; - -# ifdef GEN_TREES_H - gen_trees_header(); -# endif -#endif /* defined(GEN_TREES_H) || !defined(STDC) */ -} - -/* =========================================================================== - * Genererate the file trees.h describing the static trees. - */ -#ifdef GEN_TREES_H -# ifndef DEBUG -# include -# endif - -# define SEPARATOR(i, last, width) \ - ((i) == (last)? "\n};\n\n" : \ - ((i) % (width) == (width)-1 ? ",\n" : ", ")) - -void gen_trees_header() -{ - FILE *header = fopen("trees.h", "w"); - int i; - - Assert (header != NULL, "Can't open trees.h"); - fprintf(header, - "/* header created automatically with -DGEN_TREES_H */\n\n"); - - fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); - for (i = 0; i < L_CODES+2; i++) { - fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, - static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); - } - - fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, - static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); - } - - fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n"); - for (i = 0; i < DIST_CODE_LEN; i++) { - fprintf(header, "%2u%s", _dist_code[i], - SEPARATOR(i, DIST_CODE_LEN-1, 20)); - } - - fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); - for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { - fprintf(header, "%2u%s", _length_code[i], - SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); - } - - fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); - for (i = 0; i < LENGTH_CODES; i++) { - fprintf(header, "%1u%s", base_length[i], - SEPARATOR(i, LENGTH_CODES-1, 20)); - } - - fprintf(header, "local const int base_dist[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "%5u%s", base_dist[i], - SEPARATOR(i, D_CODES-1, 10)); - } - - fclose(header); -} -#endif /* GEN_TREES_H */ - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -void _tr_init(s) - deflate_state *s; -{ - tr_static_init(); - - s->l_desc.dyn_tree = s->dyn_ltree; - s->l_desc.stat_desc = &static_l_desc; - - s->d_desc.dyn_tree = s->dyn_dtree; - s->d_desc.stat_desc = &static_d_desc; - - s->bl_desc.dyn_tree = s->bl_tree; - s->bl_desc.stat_desc = &static_bl_desc; - - s->bi_buf = 0; - s->bi_valid = 0; - s->last_eob_len = 8; /* enough lookahead for inflate */ -#ifdef DEBUG - s->compressed_len = 0L; - s->bits_sent = 0L; -#endif - - /* Initialize the first block of the first file: */ - init_block(s); -} - -/* =========================================================================== - * Initialize a new block. - */ -local void init_block(s) - deflate_state *s; -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->last_lit = s->matches = 0; -} - -#define SMALLEST 1 -/* Index within the heap array of least frequent node in the Huffman tree */ - -/* =========================================================================== - * Remove the smallest element from the heap and recreate the heap with - * one less element. Updates heap and heap_len. - */ -#define pqremove(s, tree, top) \ -{\ - top = s->heap[SMALLEST]; \ - s->heap[SMALLEST] = s->heap[s->heap_len--]; \ - pqdownheap(s, tree, SMALLEST); \ -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -#define smaller(tree, n, m, depth) \ - (tree[n].Freq < tree[m].Freq || \ - (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -local void pqdownheap(s, tree, k) - deflate_state *s; - ct_data *tree; /* the tree to restore */ - int k; /* node to move down */ -{ - int v = s->heap[k]; - int j = k << 1; /* left son of k */ - while (j <= s->heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s->heap[j], s->depth)) break; - - /* Exchange v with the smallest son */ - s->heap[k] = s->heap[j]; k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s->heap[k] = v; -} - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -local void gen_bitlen(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ - ct_data *tree = desc->dyn_tree; - int max_code = desc->max_code; - const ct_data *stree = desc->stat_desc->static_tree; - const intf *extra = desc->stat_desc->extra_bits; - int base = desc->stat_desc->extra_base; - int max_length = desc->stat_desc->max_length; - int h; /* heap index */ - int n, m; /* iterate over the tree elements */ - int bits; /* bit length */ - int xbits; /* extra bits */ - ush f; /* frequency */ - int overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { - n = s->heap[h]; - bits = tree[tree[n].Dad].Len + 1; - if (bits > max_length) bits = max_length, overflow++; - tree[n].Len = (ush)bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) continue; /* not a leaf node */ - - s->bl_count[bits]++; - xbits = 0; - if (n >= base) xbits = extra[n-base]; - f = tree[n].Freq; - s->opt_len += (ulg)f * (bits + xbits); - if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); - } - if (overflow == 0) return; - - Trace((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length-1; - while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ - s->bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = s->bl_count[bits]; - while (n != 0) { - m = s->heap[--h]; - if (m > max_code) continue; - if ((unsigned) tree[m].Len != (unsigned) bits) { - Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s->opt_len += ((long)bits - (long)tree[m].Len) - *(long)tree[m].Freq; - tree[m].Len = (ush)bits; - } - n--; - } - } -} - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes (tree, max_code, bl_count) - ct_data *tree; /* the tree to decorate */ - int max_code; /* largest code with non zero frequency */ - ushf *bl_count; /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; - const ct_data *stree = desc->stat_desc->static_tree; - int elems = desc->stat_desc->elems; - int n, m; /* iterate over heap elements */ - int max_code = -1; /* largest code with non zero frequency */ - int node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s->heap_len = 0, s->heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].Freq != 0) { - s->heap[++(s->heap_len)] = max_code = n; - s->depth[n] = 0; - } else { - tree[n].Len = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s->heap_len < 2) { - node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); - tree[node].Freq = 1; - s->depth[node] = 0; - s->opt_len--; if (stree) s->static_len -= stree[node].Len; - /* node is 0 or 1 so it does not have extra bits */ - } - desc->max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - pqremove(s, tree, n); /* n = node of least frequency */ - m = s->heap[SMALLEST]; /* m = node of next least frequency */ - - s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ - s->heap[--(s->heap_max)] = m; - - /* Create a new node father of n and m */ - tree[node].Freq = tree[n].Freq + tree[m].Freq; - s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? - s->depth[n] : s->depth[m]) + 1); - tree[n].Dad = tree[m].Dad = (ush)node; -#ifdef DUMP_BL_TREE - if (tree == s->bl_tree) { - fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", - node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); - } -#endif - /* and insert the new node in the heap */ - s->heap[SMALLEST] = node++; - pqdownheap(s, tree, SMALLEST); - - } while (s->heap_len >= 2); - - s->heap[--(s->heap_max)] = s->heap[SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, (tree_desc *)desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes ((ct_data *)tree, max_code, s->bl_count); -} - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -local void scan_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; - } else if (curlen != 0) { - if (curlen != prevlen) s->bl_tree[curlen].Freq++; - s->bl_tree[REP_3_6].Freq++; - } else if (count <= 10) { - s->bl_tree[REPZ_3_10].Freq++; - } else { - s->bl_tree[REPZ_11_138].Freq++; - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -local void send_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen == 0) max_count = 138, min_count = 3; - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { send_code(s, curlen, s->bl_tree); } while (--count != 0); - - } else if (curlen != 0) { - if (curlen != prevlen) { - send_code(s, curlen, s->bl_tree); count--; - } - Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); - - } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -local int build_bl_tree(s) - deflate_state *s; -{ - int max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); - scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { - if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*(max_blindex+1) + 5+5+4; - Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - s->opt_len, s->static_len)); - - return max_blindex; -} - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -local void send_all_trees(s, lcodes, dcodes, blcodes) - deflate_state *s; - int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - int rank; /* index in bl_order */ - - Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - "too many codes"); - Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); - } - Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ - Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ - Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - -/* =========================================================================== - * Send a stored block - */ -void _tr_stored_block(s, buf, stored_len, eof) - deflate_state *s; - charf *buf; /* input block */ - ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ -#ifdef DEBUG - s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; - s->compressed_len += (stored_len + 4) << 3; -#endif - copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ -} - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - * The current inflate code requires 9 bits of lookahead. If the - * last two codes for the previous block (real code plus EOB) were coded - * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode - * the last real code. In this case we send two empty static blocks instead - * of one. (There are no problems if the previous block is stored or fixed.) - * To simplify the code, we assume the worst case of last real code encoded - * on one bit only. - */ -void _tr_align(s) - deflate_state *s; -{ - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG - s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ -#endif - bi_flush(s); - /* Of the 10 bits for the empty block, we have already sent - * (10 - bi_valid) bits. The lookahead for the last real code (before - * the EOB of the previous block) was thus at least one plus the length - * of the EOB plus what we have just sent of the empty static block. - */ - if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG - s->compressed_len += 10L; -#endif - bi_flush(s); - } - s->last_eob_len = 7; -} - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -void _tr_flush_block(s, buf, stored_len, eof) - deflate_state *s; - charf *buf; /* input block, or NULL if too old */ - ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ -{ - ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - int max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s->level > 0) { - - /* Check if the file is binary or text */ - if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) - set_data_type(s); - - /* Construct the literal and distance trees */ - build_tree(s, (tree_desc *)(&(s->l_desc))); - Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - - build_tree(s, (tree_desc *)(&(s->d_desc))); - Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; - - Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - s->last_lit)); - - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; - - } else { - Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - -#ifdef FORCE_STORED - if (buf != (char*)0) { /* force stored block */ -#else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { - /* 4: two words for the lengths */ -#endif - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, eof); - -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+eof, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); -#ifdef DEBUG - s->compressed_len += 3 + s->static_len; -#endif - } else { - send_bits(s, (DYN_TREES<<1)+eof, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); - compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); -#ifdef DEBUG - s->compressed_len += 3 + s->opt_len; -#endif - } - Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (eof) { - bi_windup(s); -#ifdef DEBUG - s->compressed_len += 7; /* align on byte boundary */ -#endif - } - Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*eof)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -int _tr_tally (s, dist, lc) - deflate_state *s; - unsigned dist; /* distance of matched string */ - unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - s->d_buf[s->last_lit] = (ush)dist; - s->l_buf[s->last_lit++] = (uch)lc; - if (dist == 0) { - /* lc is the unmatched char */ - s->dyn_ltree[lc].Freq++; - } else { - s->matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - Assert((ush)dist < (ush)MAX_DIST(s) && - (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; - s->dyn_dtree[d_code(dist)].Freq++; - } - -#ifdef TRUNCATE_BLOCK - /* Try to guess if it is profitable to stop the current block here */ - if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { - /* Compute an upper bound for the compressed length */ - ulg out_length = (ulg)s->last_lit*8L; - ulg in_length = (ulg)((long)s->strstart - s->block_start); - int dcode; - for (dcode = 0; dcode < D_CODES; dcode++) { - out_length += (ulg)s->dyn_dtree[dcode].Freq * - (5L+extra_dbits[dcode]); - } - out_length >>= 3; - Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", - s->last_lit, in_length, out_length, - 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; - } -#endif - return (s->last_lit == s->lit_bufsize-1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - ct_data *ltree; /* literal tree */ - ct_data *dtree; /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned lx = 0; /* running index in l_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->last_lit != 0) do { - dist = s->d_buf[lx]; - lc = s->l_buf[lx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - "pendingBuf overflow"); - - } while (lx < s->last_lit); - - send_code(s, END_BLOCK, ltree); - s->last_eob_len = ltree[END_BLOCK].Len; -} - -/* =========================================================================== - * Set the data type to BINARY or TEXT, using a crude approximation: - * set it to Z_TEXT if all symbols are either printable characters (33 to 255) - * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise. - * IN assertion: the fields Freq of dyn_ltree are set. - */ -local void set_data_type(s) - deflate_state *s; -{ - int n; - - for (n = 0; n < 9; n++) - if (s->dyn_ltree[n].Freq != 0) - break; - if (n == 9) - for (n = 14; n < 32; n++) - if (s->dyn_ltree[n].Freq != 0) - break; - s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY; -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse(code, len) - unsigned code; /* the value to invert */ - int len; /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush(s) - deflate_state *s; -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup(s) - deflate_state *s; -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef DEBUG - s->bits_sent = (s->bits_sent+7) & ~7; -#endif -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -local void copy_block(s, buf, len, header) - deflate_state *s; - charf *buf; /* the input data */ - unsigned len; /* its length */ - int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - s->last_eob_len = 8; /* enough lookahead for inflate */ - - if (header) { - put_short(s, (ush)len); - put_short(s, (ush)~len); -#ifdef DEBUG - s->bits_sent += 2*16; -#endif - } -#ifdef DEBUG - s->bits_sent += (ulg)len<<3; -#endif - while (len--) { - put_byte(s, *buf++); - } -} diff --git a/dep/src/zlib/trees.h b/dep/src/zlib/trees.h deleted file mode 100644 index ba8cd78357b..00000000000 --- a/dep/src/zlib/trees.h +++ /dev/null @@ -1,129 +0,0 @@ -/* header created automatically with -DGEN_TREES_H */ - -local const ct_data static_ltree[L_CODES+2] = { -{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, -{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, -{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, -{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, -{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, -{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, -{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, -{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, -{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, -{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, -{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, -{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, -{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, -{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, -{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, -{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, -{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, -{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, -{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, -{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, -{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, -{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, -{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, -{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, -{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, -{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, -{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, -{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, -{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, -{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, -{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, -{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, -{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, -{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, -{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, -{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, -{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, -{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, -{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, -{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, -{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, -{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, -{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, -{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, -{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, -{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, -{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, -{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, -{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, -{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, -{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, -{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, -{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, -{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, -{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, -{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, -{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, -{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} -}; - -local const ct_data static_dtree[D_CODES] = { -{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, -{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, -{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, -{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, -{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, -{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} -}; - -const uch _dist_code[DIST_CODE_LEN] = { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, -18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 -}; - -const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, -13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, -17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, -19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 -}; - -local const int base_length[LENGTH_CODES] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, -64, 80, 96, 112, 128, 160, 192, 224, 0 -}; - -local const int base_dist[D_CODES] = { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, - 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, - 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 -}; - - diff --git a/dep/src/zlib/uncompr.c b/dep/src/zlib/uncompr.c deleted file mode 100644 index b59e3d0defb..00000000000 --- a/dep/src/zlib/uncompr.c +++ /dev/null @@ -1,61 +0,0 @@ -/* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2003 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#include "zlib.h" - -/* =========================================================================== - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *destLen = stream.total_out; - - err = inflateEnd(&stream); - return err; -} diff --git a/dep/src/zlib/zconf.h b/dep/src/zlib/zconf.h deleted file mode 100644 index 719855a60d4..00000000000 --- a/dep/src/zlib/zconf.h +++ /dev/null @@ -1,333 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ - diff --git a/dep/src/zlib/zlib.h b/dep/src/zlib/zlib.h deleted file mode 100644 index 3898076f565..00000000000 --- a/dep/src/zlib/zlib.h +++ /dev/null @@ -1,1348 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ - diff --git a/dep/src/zlib/zutil.c b/dep/src/zlib/zutil.c deleted file mode 100644 index 9116a331be4..00000000000 --- a/dep/src/zlib/zutil.c +++ /dev/null @@ -1,314 +0,0 @@ -/* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include "zutil.h" - -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - -const char * const z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ -""}; - -const char * ZEXPORT zlibVersion() -{ - return ZLIB_VERSION; -} - -uLong ZEXPORT zlibCompileFlags() -{ - uLong flags; - - flags = 0; - switch (sizeof(uInt)) { - case 2: break; - case 4: flags += 1; break; - case 8: flags += 2; break; - default: flags += 3; - } - switch (sizeof(uLong)) { - case 2: break; - case 4: flags += 1 << 2; break; - case 8: flags += 2 << 2; break; - default: flags += 3 << 2; - } - switch (sizeof(voidpf)) { - case 2: break; - case 4: flags += 1 << 4; break; - case 8: flags += 2 << 4; break; - default: flags += 3 << 4; - } - switch (sizeof(z_off_t)) { - case 2: break; - case 4: flags += 1 << 6; break; - case 8: flags += 2 << 6; break; - default: flags += 3 << 6; - } -#ifdef DEBUG - flags += 1 << 8; -#endif -#if defined(ASMV) || defined(ASMINF) - flags += 1 << 9; -#endif -#ifdef ZLIB_WINAPI - flags += 1 << 10; -#endif -#ifdef BUILDFIXED - flags += 1 << 12; -#endif -#ifdef DYNAMIC_CRC_TABLE - flags += 1 << 13; -#endif -#ifdef NO_GZCOMPRESS - flags += 1L << 16; -#endif -#ifdef NO_GZIP - flags += 1L << 17; -#endif -#ifdef PKZIP_BUG_WORKAROUND - flags += 1L << 20; -#endif -#ifdef FASTEST - flags += 1L << 21; -#endif -#ifdef STDC -# ifdef NO_vsnprintf - flags += 1L << 25; -# ifdef HAS_vsprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_vsnprintf_void - flags += 1L << 26; -# endif -# endif -#else - flags += 1L << 24; -# ifdef NO_snprintf - flags += 1L << 25; -# ifdef HAS_sprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_snprintf_void - flags += 1L << 26; -# endif -# endif -#endif - return flags; -} - -#ifdef DEBUG - -# ifndef verbose -# define verbose 0 -# endif -int z_verbose = verbose; - -void z_error (m) - char *m; -{ - fprintf(stderr, "%s\n", m); - exit(1); -} -#endif - -/* exported to allow conversion of error code to string for compress() and - * uncompress() - */ -const char * ZEXPORT zError(err) - int err; -{ - return ERR_MSG(err); -} - -#if defined(_WIN32_WCE) - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. - */ - int errno = 0; -#endif - -#ifndef HAVE_MEMCPY - -void zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = *source++; /* ??? to be unrolled */ - } while (--len != 0); -} - -int zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ - uInt j; - - for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; - } - return 0; -} - -void zmemzero(dest, len) - Bytef* dest; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = 0; /* ??? to be unrolled */ - } while (--len != 0); -} -#endif - -#ifdef SYS16BIT - -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -# define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - voidpf org_ptr; - voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - voidpf buf = opaque; /* just to make some compilers happy */ - ulg bsize = (ulg)items*size; - - /* If we allocate less than 65520 bytes, we assume that farmalloc - * will return a usable pointer which doesn't have to be normalized. - */ - if (bsize < 65520L) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - int n; - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = 0; n < next_ptr; n++) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - ptr = opaque; /* just to make some compilers happy */ - Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - -#ifdef M_I86 -/* Microsoft C in 16-bit mode */ - -# define MY_ZCALLOC - -#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) -# define _halloc halloc -# define _hfree hfree -#endif - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - return _halloc((long)items, size); -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - _hfree(ptr); -} - -#endif /* M_I86 */ - -#endif /* SYS16BIT */ - -#ifndef MY_ZCALLOC /* Any system without a special alloc function */ - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); -#endif - -voidpf zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ - if (opaque) items += size - size; /* make compiler happy */ - return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : - (voidpf)calloc(items, size); -} - -void zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ - free(ptr); - if (opaque) return; /* make compiler happy */ -} - -#endif /* MY_ZCALLOC */ diff --git a/dep/src/zlib/zutil.h b/dep/src/zlib/zutil.h deleted file mode 100644 index 7f40ca4d975..00000000000 --- a/dep/src/zlib/zutil.h +++ /dev/null @@ -1,269 +0,0 @@ -/* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef ZUTIL_H -#define ZUTIL_H - -#define ZLIB_INTERNAL -#include "zlib.h" - -#ifdef STDC -# ifndef _WIN32_WCE -# include -# endif -# include -# include -#endif -#ifdef NO_ERRNO_H -# ifdef _WIN32_WCE - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. We rename it to - * avoid conflict with other libraries that use the same workaround. - */ -# define errno z_errno -# endif - extern int errno; -#else -# ifndef _WIN32_WCE -# include -# endif -#endif - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - -extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ -/* (size given to avoid silly warnings with Visual C++) */ - -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] - -#define ERR_RETURN(strm,err) \ - return (strm->msg = (char*)ERR_MSG(err), (err)) -/* To be used only when the state is known to be valid */ - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) -# define OS_CODE 0x00 -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# include -# endif -#endif - -#ifdef AMIGA -# define OS_CODE 0x01 -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 -# define F_OPEN(name, mode) \ - fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 -#endif - -#ifdef OS2 -# define OS_CODE 0x06 -# ifdef M_I86 - #include -# endif -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -#endif - -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - -#ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ -# define OS_CODE 0x0b -# endif -#endif - -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - - /* common defaults */ - -#ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) fopen((name), (mode)) -#endif - - /* functions */ - -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#ifndef HAVE_VSNPRINTF -# ifdef MSDOS - /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ -# define NO_vsnprintf -# endif -# ifdef __TURBOC__ -# define NO_vsnprintf -# endif -# ifdef WIN32 - /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) -# define vsnprintf _vsnprintf -# endif -# endif -# ifdef __SASC -# define NO_vsnprintf -# endif -#endif -#ifdef VMS -# define NO_vsnprintf -#endif - -#if defined(pyr) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy memcpy -# define zmemcmp memcmp -# define zmemzero(dest, len) memset(dest, 0, len) -# endif -#else - extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - extern void zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef DEBUG -# include - extern int z_verbose; - extern void z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - -voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); -void zcfree OF((voidpf opaque, voidpf ptr)); - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} - -#endif /* ZUTIL_H */ - diff --git a/doc/AuctionHouseBot.txt b/docs/AuctionHouseBot.txt similarity index 100% rename from doc/AuctionHouseBot.txt rename to docs/AuctionHouseBot.txt diff --git a/doc/DocStructure.dox b/docs/DocStructure.dox similarity index 100% rename from doc/DocStructure.dox rename to docs/DocStructure.dox diff --git a/doc/Doxyfile.in b/docs/Doxyfile.in similarity index 100% rename from doc/Doxyfile.in rename to docs/Doxyfile.in diff --git a/doc/EventAI.txt b/docs/EventAI.txt similarity index 100% rename from doc/EventAI.txt rename to docs/EventAI.txt diff --git a/doc/HowToScript.txt b/docs/HowToScript.txt similarity index 100% rename from doc/HowToScript.txt rename to docs/HowToScript.txt diff --git a/doc/TextTables.txt b/docs/TextTables.txt similarity index 100% rename from doc/TextTables.txt rename to docs/TextTables.txt diff --git a/doc/UnixInstall.txt b/docs/UnixInstall.txt similarity index 100% rename from doc/UnixInstall.txt rename to docs/UnixInstall.txt diff --git a/docs/gpl-2.0.txt b/docs/gpl-2.0.txt new file mode 100644 index 00000000000..d159169d105 --- /dev/null +++ b/docs/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt new file mode 100644 index 00000000000..e39a61a1c14 --- /dev/null +++ b/externals/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + add_subdirectory(jemalloc) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "Windows") + add_subdirectory(ace) + add_subdirectory(zlib) + add_subdirectory(bzip2) +endif() + +add_subdirectory(g3dlite) +add_subdirectory(sockets) + +# temporary disable libmpq building (through CMake at least) for now +# - needs a proper CMakeLists.txt +#add_subdirectory(libmpq) diff --git a/externals/PackageList.txt b/externals/PackageList.txt new file mode 100644 index 00000000000..2954f91db4a --- /dev/null +++ b/externals/PackageList.txt @@ -0,0 +1,53 @@ +TrinityCore uses (parts of or in whole) the following opensource software : + +ACE (ADAPTIVE Communication Environment) + http://www.cs.wustl.edu/~schmidt/ACE.html + Version: 5.7.9 + +bzip2 (a freely available, patent free, high-quality data compressor) + http://www.bzip.org/ + Version: 1.0.5 + +G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License) + http://g3d.sourceforge.net/ + Version: 6.09 + +jemalloc (a general-purpose scalable concurrent malloc-implementation) + http://www.canonware.com/jemalloc/ + Version: 1.0.0 + +libMPQ (a library for reading MPQ files) + https://libmpq.org/ + Version: 1.0.4 + +MersenneTwister (a very fast random number generator) + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + Version: 0.4.2 + +SFMT (SIMD-oriented Fast Mersenne Twister) + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html + Version: 1.3.3 + +MySQL (the world's most popular open source database software) + http://www.mysql.com/about/ + Version: 6.0.2 + +OpenSSL (an opensource toolkit implementing SSL v2/v3 and TLS v1 protocols) + http://www.openssl.org/ + Version: UNKNOWN + +sockets (a GPL licensed C++ class library wrapping the berkeley sockets C API) + http://www.alhem.net/Sockets/ + Version: UNKNOWN + +utf8-cpp (UTF-8 with C++ in a Portable Way) + http://utfcpp.sourceforge.net/ + Version: 2.3 + +vld (a free open-source memory leak detection system for Visual C++) + http://sites.google.com/site/dmoulding/vld + Version: 1.0 + +zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) + http://www.zlib.net/ + Version: 1.2.5 diff --git a/externals/SFMT/SFMT-alti.h b/externals/SFMT/SFMT-alti.h new file mode 100644 index 00000000000..df3186cbbd7 --- /dev/null +++ b/externals/SFMT/SFMT-alti.h @@ -0,0 +1,156 @@ +/** + * @file SFMT-alti.h + * + * @brief SIMD oriented Fast Mersenne Twister(SFMT) + * pseudorandom number generator + * + * @author Mutsuo Saito (Hiroshima University) + * @author Makoto Matsumoto (Hiroshima University) + * + * Copyright (C) 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima + * University. All rights reserved. + * + * The new BSD License is applied to this software. + * see LICENSE.txt + */ + +#ifndef SFMT_ALTI_H +#define SFMT_ALTI_H + +inline static vector unsigned int vec_recursion(vector unsigned int a, + vector unsigned int b, + vector unsigned int c, + vector unsigned int d) + ALWAYSINLINE; + +/** + * This function represents the recursion formula in AltiVec and BIG ENDIAN. + * @param a a 128-bit part of the interal state array + * @param b a 128-bit part of the interal state array + * @param c a 128-bit part of the interal state array + * @param d a 128-bit part of the interal state array + * @return output + */ +inline static vector unsigned int vec_recursion(vector unsigned int a, + vector unsigned int b, + vector unsigned int c, + vector unsigned int d) { + + const vector unsigned int sl1 = ALTI_SL1; + const vector unsigned int sr1 = ALTI_SR1; +#ifdef ONLY64 + const vector unsigned int mask = ALTI_MSK64; + const vector unsigned char perm_sl = ALTI_SL2_PERM64; + const vector unsigned char perm_sr = ALTI_SR2_PERM64; +#else + const vector unsigned int mask = ALTI_MSK; + const vector unsigned char perm_sl = ALTI_SL2_PERM; + const vector unsigned char perm_sr = ALTI_SR2_PERM; +#endif + vector unsigned int v, w, x, y, z; + x = vec_perm(a, (vector unsigned int)perm_sl, perm_sl); + v = a; + y = vec_sr(b, sr1); + z = vec_perm(c, (vector unsigned int)perm_sr, perm_sr); + w = vec_sl(d, sl1); + z = vec_xor(z, w); + y = vec_and(y, mask); + v = vec_xor(v, x); + z = vec_xor(z, y); + z = vec_xor(z, v); + return z; +} + +/** + * This function fills the internal state array with pseudorandom + * integers. + */ +inline static void gen_rand_all(void) { + int i; + vector unsigned int r, r1, r2; + + r1 = sfmt[N - 2].s; + r2 = sfmt[N - 1].s; + for (i = 0; i < N - POS1; i++) { + r = vec_recursion(sfmt[i].s, sfmt[i + POS1].s, r1, r2); + sfmt[i].s = r; + r1 = r2; + r2 = r; + } + for (; i < N; i++) { + r = vec_recursion(sfmt[i].s, sfmt[i + POS1 - N].s, r1, r2); + sfmt[i].s = r; + r1 = r2; + r2 = r; + } +} + +/** + * This function fills the user-specified array with pseudorandom + * integers. + * + * @param array an 128-bit array to be filled by pseudorandom numbers. + * @param size number of 128-bit pesudorandom numbers to be generated. + */ +inline static void gen_rand_array(w128_t *array, int size) { + int i, j; + vector unsigned int r, r1, r2; + + r1 = sfmt[N - 2].s; + r2 = sfmt[N - 1].s; + for (i = 0; i < N - POS1; i++) { + r = vec_recursion(sfmt[i].s, sfmt[i + POS1].s, r1, r2); + array[i].s = r; + r1 = r2; + r2 = r; + } + for (; i < N; i++) { + r = vec_recursion(sfmt[i].s, array[i + POS1 - N].s, r1, r2); + array[i].s = r; + r1 = r2; + r2 = r; + } + /* main loop */ + for (; i < size - N; i++) { + r = vec_recursion(array[i - N].s, array[i + POS1 - N].s, r1, r2); + array[i].s = r; + r1 = r2; + r2 = r; + } + for (j = 0; j < 2 * N - size; j++) { + sfmt[j].s = array[j + size - N].s; + } + for (; i < size; i++) { + r = vec_recursion(array[i - N].s, array[i + POS1 - N].s, r1, r2); + array[i].s = r; + sfmt[j++].s = r; + r1 = r2; + r2 = r; + } +} + +#ifndef ONLY64 +#if defined(__APPLE__) +#define ALTI_SWAP (vector unsigned char) \ + (4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11) +#else +#define ALTI_SWAP {4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11} +#endif +/** + * This function swaps high and low 32-bit of 64-bit integers in user + * specified array. + * + * @param array an 128-bit array to be swaped. + * @param size size of 128-bit array. + */ +inline static void swap(w128_t *array, int size) { + int i; + const vector unsigned char perm = ALTI_SWAP; + + for (i = 0; i < size; i++) { + array[i].s = vec_perm(array[i].s, (vector unsigned int)perm, perm); + } +} +#endif + +#endif diff --git a/externals/SFMT/SFMT-params.h b/externals/SFMT/SFMT-params.h new file mode 100644 index 00000000000..661bbf26a28 --- /dev/null +++ b/externals/SFMT/SFMT-params.h @@ -0,0 +1,97 @@ +#ifndef SFMT_PARAMS_H +#define SFMT_PARAMS_H + +#if !defined(MEXP) +#ifdef __GNUC__ + #warning "MEXP is not defined. I assume MEXP is 19937." +#endif + #define MEXP 19937 +#endif +/*----------------- + BASIC DEFINITIONS + -----------------*/ +/** Mersenne Exponent. The period of the sequence + * is a multiple of 2^MEXP-1. + * #define MEXP 19937 */ +/** SFMT generator has an internal state array of 128-bit integers, + * and N is its size. */ +#define N (MEXP / 128 + 1) +/** N32 is the size of internal state array when regarded as an array + * of 32-bit integers.*/ +#define N32 (N * 4) +/** N64 is the size of internal state array when regarded as an array + * of 64-bit integers.*/ +#define N64 (N * 2) + +/*---------------------- + the parameters of SFMT + following definitions are in paramsXXXX.h file. + ----------------------*/ +/** the pick up position of the array. +#define POS1 122 +*/ + +/** the parameter of shift left as four 32-bit registers. +#define SL1 18 + */ + +/** the parameter of shift left as one 128-bit register. + * The 128-bit integer is shifted by (SL2 * 8) bits. +#define SL2 1 +*/ + +/** the parameter of shift right as four 32-bit registers. +#define SR1 11 +*/ + +/** the parameter of shift right as one 128-bit register. + * The 128-bit integer is shifted by (SL2 * 8) bits. +#define SR2 1 +*/ + +/** A bitmask, used in the recursion. These parameters are introduced + * to break symmetry of SIMD. +#define MSK1 0xdfffffefU +#define MSK2 0xddfecb7fU +#define MSK3 0xbffaffffU +#define MSK4 0xbffffff6U +*/ + +/** These definitions are part of a 128-bit period certification vector. +#define PARITY1 0x00000001U +#define PARITY2 0x00000000U +#define PARITY3 0x00000000U +#define PARITY4 0xc98e126aU +*/ + +#if MEXP == 607 + #include "SFMT-params607.h" +#elif MEXP == 1279 + #include "SFMT-params1279.h" +#elif MEXP == 2281 + #include "SFMT-params2281.h" +#elif MEXP == 4253 + #include "SFMT-params4253.h" +#elif MEXP == 11213 + #include "SFMT-params11213.h" +#elif MEXP == 19937 + #include "SFMT-params19937.h" +#elif MEXP == 44497 + #include "SFMT-params44497.h" +#elif MEXP == 86243 + #include "SFMT-params86243.h" +#elif MEXP == 132049 + #include "SFMT-params132049.h" +#elif MEXP == 216091 + #include "SFMT-params216091.h" +#else +#ifdef __GNUC__ + #error "MEXP is not valid." + #undef MEXP +#else + #undef MEXP +#endif + +#endif + +#endif /* SFMT_PARAMS_H */ diff --git a/externals/SFMT/SFMT-sse2.h b/externals/SFMT/SFMT-sse2.h new file mode 100644 index 00000000000..4e91d9c6121 --- /dev/null +++ b/externals/SFMT/SFMT-sse2.h @@ -0,0 +1,121 @@ +/** + * @file SFMT-sse2.h + * @brief SIMD oriented Fast Mersenne Twister(SFMT) for Intel SSE2 + * + * @author Mutsuo Saito (Hiroshima University) + * @author Makoto Matsumoto (Hiroshima University) + * + * @note We assume LITTLE ENDIAN in this file + * + * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima + * University. All rights reserved. + * + * The new BSD License is applied to this software, see LICENSE.txt + */ + +#ifndef SFMT_SSE2_H +#define SFMT_SSE2_H + +PRE_ALWAYS static __m128i mm_recursion(__m128i *a, __m128i *b, __m128i c, + __m128i d, __m128i mask) ALWAYSINLINE; + +/** + * This function represents the recursion formula. + * @param a a 128-bit part of the interal state array + * @param b a 128-bit part of the interal state array + * @param c a 128-bit part of the interal state array + * @param d a 128-bit part of the interal state array + * @param mask 128-bit mask + * @return output + */ +PRE_ALWAYS static __m128i mm_recursion(__m128i *a, __m128i *b, + __m128i c, __m128i d, __m128i mask) { + __m128i v, x, y, z; + + x = _mm_load_si128(a); + y = _mm_srli_epi32(*b, SR1); + z = _mm_srli_si128(c, SR2); + v = _mm_slli_epi32(d, SL1); + z = _mm_xor_si128(z, x); + z = _mm_xor_si128(z, v); + x = _mm_slli_si128(x, SL2); + y = _mm_and_si128(y, mask); + z = _mm_xor_si128(z, x); + z = _mm_xor_si128(z, y); + return z; +} + +/** + * This function fills the internal state array with pseudorandom + * integers. + */ +inline static void gen_rand_all(void) { + int i; + __m128i r, r1, r2, mask; + mask = _mm_set_epi32(MSK4, MSK3, MSK2, MSK1); + + r1 = _mm_load_si128(&sfmt[N - 2].si); + r2 = _mm_load_si128(&sfmt[N - 1].si); + for (i = 0; i < N - POS1; i++) { + r = mm_recursion(&sfmt[i].si, &sfmt[i + POS1].si, r1, r2, mask); + _mm_store_si128(&sfmt[i].si, r); + r1 = r2; + r2 = r; + } + for (; i < N; i++) { + r = mm_recursion(&sfmt[i].si, &sfmt[i + POS1 - N].si, r1, r2, mask); + _mm_store_si128(&sfmt[i].si, r); + r1 = r2; + r2 = r; + } +} + +/** + * This function fills the user-specified array with pseudorandom + * integers. + * + * @param array an 128-bit array to be filled by pseudorandom numbers. + * @param size number of 128-bit pesudorandom numbers to be generated. + */ +inline static void gen_rand_array(w128_t *array, int size) { + int i, j; + __m128i r, r1, r2, mask; + mask = _mm_set_epi32(MSK4, MSK3, MSK2, MSK1); + + r1 = _mm_load_si128(&sfmt[N - 2].si); + r2 = _mm_load_si128(&sfmt[N - 1].si); + for (i = 0; i < N - POS1; i++) { + r = mm_recursion(&sfmt[i].si, &sfmt[i + POS1].si, r1, r2, mask); + _mm_store_si128(&array[i].si, r); + r1 = r2; + r2 = r; + } + for (; i < N; i++) { + r = mm_recursion(&sfmt[i].si, &array[i + POS1 - N].si, r1, r2, mask); + _mm_store_si128(&array[i].si, r); + r1 = r2; + r2 = r; + } + /* main loop */ + for (; i < size - N; i++) { + r = mm_recursion(&array[i - N].si, &array[i + POS1 - N].si, r1, r2, + mask); + _mm_store_si128(&array[i].si, r); + r1 = r2; + r2 = r; + } + for (j = 0; j < 2 * N - size; j++) { + r = _mm_load_si128(&array[j + size - N].si); + _mm_store_si128(&sfmt[j].si, r); + } + for (; i < size; i++) { + r = mm_recursion(&array[i - N].si, &array[i + POS1 - N].si, r1, r2, + mask); + _mm_store_si128(&array[i].si, r); + _mm_store_si128(&sfmt[j++].si, r); + r1 = r2; + r2 = r; + } +} + +#endif diff --git a/externals/SFMT/SFMT.c b/externals/SFMT/SFMT.c new file mode 100644 index 00000000000..d36465d9e14 --- /dev/null +++ b/externals/SFMT/SFMT.c @@ -0,0 +1,620 @@ +/** + * @file SFMT.c + * @brief SIMD oriented Fast Mersenne Twister(SFMT) + * + * @author Mutsuo Saito (Hiroshima University) + * @author Makoto Matsumoto (Hiroshima University) + * + * Copyright (C) 2006,2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima + * University. All rights reserved. + * + * The new BSD License is applied to this software, see LICENSE.txt + */ +#include +#include +#include "SFMT.h" +#include "SFMT-params.h" + +#if defined(__BIG_ENDIAN__) && !defined(__amd64) && !defined(BIG_ENDIAN64) +#define BIG_ENDIAN64 1 +#endif +#if defined(HAVE_ALTIVEC) && !defined(BIG_ENDIAN64) +#define BIG_ENDIAN64 1 +#endif +#if defined(ONLY64) && !defined(BIG_ENDIAN64) + #if defined(__GNUC__) + #error "-DONLY64 must be specified with -DBIG_ENDIAN64" + #endif +#undef ONLY64 +#endif +/*------------------------------------------------------ + 128-bit SIMD data type for Altivec, SSE2 or standard C + ------------------------------------------------------*/ +#if defined(HAVE_ALTIVEC) + #if !defined(__APPLE__) + #include + #endif +/** 128-bit data structure */ +union W128_T { + vector unsigned int s; + uint32_t u[4]; +}; +/** 128-bit data type */ +typedef union W128_T w128_t; + +#elif defined(HAVE_SSE2) + #include + +/** 128-bit data structure */ +union W128_T { + __m128i si; + uint32_t u[4]; +}; +/** 128-bit data type */ +typedef union W128_T w128_t; + +#else + +/** 128-bit data structure */ +struct W128_T { + uint32_t u[4]; +}; +/** 128-bit data type */ +typedef struct W128_T w128_t; + +#endif + +/*-------------------------------------- + FILE GLOBAL VARIABLES + internal state, index counter and flag + --------------------------------------*/ +/** the 128-bit internal state array */ +static w128_t sfmt[N]; +/** the 32bit integer pointer to the 128-bit internal state array */ +static uint32_t *psfmt32 = &sfmt[0].u[0]; +#if !defined(BIG_ENDIAN64) || defined(ONLY64) +/** the 64bit integer pointer to the 128-bit internal state array */ +static uint64_t *psfmt64 = (uint64_t *)&sfmt[0].u[0]; +#endif +/** index counter to the 32-bit internal state array */ +static int idx; +/** a flag: it is 0 if and only if the internal state is not yet + * initialized. */ +static int initialized = 0; +/** a parity check vector which certificate the period of 2^{MEXP} */ +static uint32_t parity[4] = {PARITY1, PARITY2, PARITY3, PARITY4}; + +/*---------------- + STATIC FUNCTIONS + ----------------*/ +inline static int idxof(int i); +inline static void rshift128(w128_t *out, w128_t const *in, int shift); +inline static void lshift128(w128_t *out, w128_t const *in, int shift); +inline static void gen_rand_all(void); +inline static void gen_rand_array(w128_t *array, int size); +inline static uint32_t func1(uint32_t x); +inline static uint32_t func2(uint32_t x); +static void period_certification(void); +#if defined(BIG_ENDIAN64) && !defined(ONLY64) +inline static void swap(w128_t *array, int size); +#endif + +#if defined(HAVE_ALTIVEC) + #include "SFMT-alti.h" +#elif defined(HAVE_SSE2) + #include "SFMT-sse2.h" +#endif + +/** + * This function simulate a 64-bit index of LITTLE ENDIAN + * in BIG ENDIAN machine. + */ +#ifdef ONLY64 +inline static int idxof(int i) { + return i ^ 1; +} +#else +inline static int idxof(int i) { + return i; +} +#endif +/** + * This function simulates SIMD 128-bit right shift by the standard C. + * The 128-bit integer given in in is shifted by (shift * 8) bits. + * This function simulates the LITTLE ENDIAN SIMD. + * @param out the output of this function + * @param in the 128-bit data to be shifted + * @param shift the shift value + */ +#ifdef ONLY64 +inline static void rshift128(w128_t *out, w128_t const *in, int shift) { + uint64_t th, tl, oh, ol; + + th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]); + tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]); + + oh = th >> (shift * 8); + ol = tl >> (shift * 8); + ol |= th << (64 - shift * 8); + out->u[0] = (uint32_t)(ol >> 32); + out->u[1] = (uint32_t)ol; + out->u[2] = (uint32_t)(oh >> 32); + out->u[3] = (uint32_t)oh; +} +#else +inline static void rshift128(w128_t *out, w128_t const *in, int shift) { + uint64_t th, tl, oh, ol; + + th = ((uint64_t)in->u[3] << 32) | ((uint64_t)in->u[2]); + tl = ((uint64_t)in->u[1] << 32) | ((uint64_t)in->u[0]); + + oh = th >> (shift * 8); + ol = tl >> (shift * 8); + ol |= th << (64 - shift * 8); + out->u[1] = (uint32_t)(ol >> 32); + out->u[0] = (uint32_t)ol; + out->u[3] = (uint32_t)(oh >> 32); + out->u[2] = (uint32_t)oh; +} +#endif +/** + * This function simulates SIMD 128-bit left shift by the standard C. + * The 128-bit integer given in in is shifted by (shift * 8) bits. + * This function simulates the LITTLE ENDIAN SIMD. + * @param out the output of this function + * @param in the 128-bit data to be shifted + * @param shift the shift value + */ +#ifdef ONLY64 +inline static void lshift128(w128_t *out, w128_t const *in, int shift) { + uint64_t th, tl, oh, ol; + + th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]); + tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]); + + oh = th << (shift * 8); + ol = tl << (shift * 8); + oh |= tl >> (64 - shift * 8); + out->u[0] = (uint32_t)(ol >> 32); + out->u[1] = (uint32_t)ol; + out->u[2] = (uint32_t)(oh >> 32); + out->u[3] = (uint32_t)oh; +} +#else +inline static void lshift128(w128_t *out, w128_t const *in, int shift) { + uint64_t th, tl, oh, ol; + + th = ((uint64_t)in->u[3] << 32) | ((uint64_t)in->u[2]); + tl = ((uint64_t)in->u[1] << 32) | ((uint64_t)in->u[0]); + + oh = th << (shift * 8); + ol = tl << (shift * 8); + oh |= tl >> (64 - shift * 8); + out->u[1] = (uint32_t)(ol >> 32); + out->u[0] = (uint32_t)ol; + out->u[3] = (uint32_t)(oh >> 32); + out->u[2] = (uint32_t)oh; +} +#endif + +/** + * This function represents the recursion formula. + * @param r output + * @param a a 128-bit part of the internal state array + * @param b a 128-bit part of the internal state array + * @param c a 128-bit part of the internal state array + * @param d a 128-bit part of the internal state array + */ +#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2)) +#ifdef ONLY64 +inline static void do_recursion(w128_t *r, w128_t *a, w128_t *b, w128_t *c, + w128_t *d) { + w128_t x; + w128_t y; + + lshift128(&x, a, SL2); + rshift128(&y, c, SR2); + r->u[0] = a->u[0] ^ x.u[0] ^ ((b->u[0] >> SR1) & MSK2) ^ y.u[0] + ^ (d->u[0] << SL1); + r->u[1] = a->u[1] ^ x.u[1] ^ ((b->u[1] >> SR1) & MSK1) ^ y.u[1] + ^ (d->u[1] << SL1); + r->u[2] = a->u[2] ^ x.u[2] ^ ((b->u[2] >> SR1) & MSK4) ^ y.u[2] + ^ (d->u[2] << SL1); + r->u[3] = a->u[3] ^ x.u[3] ^ ((b->u[3] >> SR1) & MSK3) ^ y.u[3] + ^ (d->u[3] << SL1); +} +#else +inline static void do_recursion(w128_t *r, w128_t *a, w128_t *b, w128_t *c, + w128_t *d) { + w128_t x; + w128_t y; + + lshift128(&x, a, SL2); + rshift128(&y, c, SR2); + r->u[0] = a->u[0] ^ x.u[0] ^ ((b->u[0] >> SR1) & MSK1) ^ y.u[0] + ^ (d->u[0] << SL1); + r->u[1] = a->u[1] ^ x.u[1] ^ ((b->u[1] >> SR1) & MSK2) ^ y.u[1] + ^ (d->u[1] << SL1); + r->u[2] = a->u[2] ^ x.u[2] ^ ((b->u[2] >> SR1) & MSK3) ^ y.u[2] + ^ (d->u[2] << SL1); + r->u[3] = a->u[3] ^ x.u[3] ^ ((b->u[3] >> SR1) & MSK4) ^ y.u[3] + ^ (d->u[3] << SL1); +} +#endif +#endif + +#if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2)) +/** + * This function fills the internal state array with pseudorandom + * integers. + */ +inline static void gen_rand_all(void) { + int i; + w128_t *r1, *r2; + + r1 = &sfmt[N - 2]; + r2 = &sfmt[N - 1]; + for (i = 0; i < N - POS1; i++) { + do_recursion(&sfmt[i], &sfmt[i], &sfmt[i + POS1], r1, r2); + r1 = r2; + r2 = &sfmt[i]; + } + for (; i < N; i++) { + do_recursion(&sfmt[i], &sfmt[i], &sfmt[i + POS1 - N], r1, r2); + r1 = r2; + r2 = &sfmt[i]; + } +} + +/** + * This function fills the user-specified array with pseudorandom + * integers. + * + * @param array an 128-bit array to be filled by pseudorandom numbers. + * @param size number of 128-bit pseudorandom numbers to be generated. + */ +inline static void gen_rand_array(w128_t *array, int size) { + int i, j; + w128_t *r1, *r2; + + r1 = &sfmt[N - 2]; + r2 = &sfmt[N - 1]; + for (i = 0; i < N - POS1; i++) { + do_recursion(&array[i], &sfmt[i], &sfmt[i + POS1], r1, r2); + r1 = r2; + r2 = &array[i]; + } + for (; i < N; i++) { + do_recursion(&array[i], &sfmt[i], &array[i + POS1 - N], r1, r2); + r1 = r2; + r2 = &array[i]; + } + for (; i < size - N; i++) { + do_recursion(&array[i], &array[i - N], &array[i + POS1 - N], r1, r2); + r1 = r2; + r2 = &array[i]; + } + for (j = 0; j < 2 * N - size; j++) { + sfmt[j] = array[j + size - N]; + } + for (; i < size; i++, j++) { + do_recursion(&array[i], &array[i - N], &array[i + POS1 - N], r1, r2); + r1 = r2; + r2 = &array[i]; + sfmt[j] = array[i]; + } +} +#endif + +#if defined(BIG_ENDIAN64) && !defined(ONLY64) && !defined(HAVE_ALTIVEC) +inline static void swap(w128_t *array, int size) { + int i; + uint32_t x, y; + + for (i = 0; i < size; i++) { + x = array[i].u[0]; + y = array[i].u[2]; + array[i].u[0] = array[i].u[1]; + array[i].u[2] = array[i].u[3]; + array[i].u[1] = x; + array[i].u[3] = y; + } +} +#endif +/** + * This function represents a function used in the initialization + * by init_by_array + * @param x 32-bit integer + * @return 32-bit integer + */ +static uint32_t func1(uint32_t x) { + return (x ^ (x >> 27)) * (uint32_t)1664525UL; +} + +/** + * This function represents a function used in the initialization + * by init_by_array + * @param x 32-bit integer + * @return 32-bit integer + */ +static uint32_t func2(uint32_t x) { + return (x ^ (x >> 27)) * (uint32_t)1566083941UL; +} + +/** + * This function certificate the period of 2^{MEXP} + */ +static void period_certification(void) { + int inner = 0; + int i, j; + uint32_t work; + + for (i = 0; i < 4; i++) + inner ^= psfmt32[idxof(i)] & parity[i]; + for (i = 16; i > 0; i >>= 1) + inner ^= inner >> i; + inner &= 1; + /* check OK */ + if (inner == 1) { + return; + } + /* check NG, and modification */ + for (i = 0; i < 4; i++) { + work = 1; + for (j = 0; j < 32; j++) { + if ((work & parity[i]) != 0) { + psfmt32[idxof(i)] ^= work; + return; + } + work = work << 1; + } + } +} + +/*---------------- + PUBLIC FUNCTIONS + ----------------*/ +/** + * This function returns the identification string. + * The string shows the word size, the Mersenne exponent, + * and all parameters of this generator. + */ +const char *get_idstring(void) { + return IDSTR; +} + +/** + * This function returns the minimum size of array used for \b + * fill_array32() function. + * @return minimum size of array used for fill_array32() function. + */ +int get_min_array_size32(void) { + return N32; +} + +/** + * This function returns the minimum size of array used for \b + * fill_array64() function. + * @return minimum size of array used for fill_array64() function. + */ +int get_min_array_size64(void) { + return N64; +} + +#ifndef ONLY64 +/** + * This function generates and returns 32-bit pseudorandom number. + * init_gen_rand or init_by_array must be called before this function. + * @return 32-bit pseudorandom number + */ +uint32_t gen_rand32(void) { + uint32_t r; + + assert(initialized); + if (idx >= N32) { + gen_rand_all(); + idx = 0; + } + r = psfmt32[idx++]; + return r; +} +#endif +/** + * This function generates and returns 64-bit pseudorandom number. + * init_gen_rand or init_by_array must be called before this function. + * The function gen_rand64 should not be called after gen_rand32, + * unless an initialization is again executed. + * @return 64-bit pseudorandom number + */ +uint64_t gen_rand64(void) { +#if defined(BIG_ENDIAN64) && !defined(ONLY64) + uint32_t r1, r2; +#else + uint64_t r; +#endif + + assert(initialized); + assert(idx % 2 == 0); + + if (idx >= N32) { + gen_rand_all(); + idx = 0; + } +#if defined(BIG_ENDIAN64) && !defined(ONLY64) + r1 = psfmt32[idx]; + r2 = psfmt32[idx + 1]; + idx += 2; + return ((uint64_t)r2 << 32) | r1; +#else + r = psfmt64[idx / 2]; + idx += 2; + return r; +#endif +} + +#ifndef ONLY64 +/** + * This function generates pseudorandom 32-bit integers in the + * specified array[] by one call. The number of pseudorandom integers + * is specified by the argument size, which must be at least 624 and a + * multiple of four. The generation by this function is much faster + * than the following gen_rand function. + * + * For initialization, init_gen_rand or init_by_array must be called + * before the first call of this function. This function can not be + * used after calling gen_rand function, without initialization. + * + * @param array an array where pseudorandom 32-bit integers are filled + * by this function. The pointer to the array must be \b "aligned" + * (namely, must be a multiple of 16) in the SIMD version, since it + * refers to the address of a 128-bit integer. In the standard C + * version, the pointer is arbitrary. + * + * @param size the number of 32-bit pseudorandom integers to be + * generated. size must be a multiple of 4, and greater than or equal + * to (MEXP / 128 + 1) * 4. + * + * @note \b memalign or \b posix_memalign is available to get aligned + * memory. Mac OSX doesn't have these functions, but \b malloc of OSX + * returns the pointer to the aligned memory block. + */ +void fill_array32(uint32_t *array, int size) { + assert(initialized); + assert(idx == N32); + assert(size % 4 == 0); + assert(size >= N32); + + gen_rand_array((w128_t *)array, size / 4); + idx = N32; +} +#endif + +/** + * This function generates pseudorandom 64-bit integers in the + * specified array[] by one call. The number of pseudorandom integers + * is specified by the argument size, which must be at least 312 and a + * multiple of two. The generation by this function is much faster + * than the following gen_rand function. + * + * For initialization, init_gen_rand or init_by_array must be called + * before the first call of this function. This function can not be + * used after calling gen_rand function, without initialization. + * + * @param array an array where pseudorandom 64-bit integers are filled + * by this function. The pointer to the array must be "aligned" + * (namely, must be a multiple of 16) in the SIMD version, since it + * refers to the address of a 128-bit integer. In the standard C + * version, the pointer is arbitrary. + * + * @param size the number of 64-bit pseudorandom integers to be + * generated. size must be a multiple of 2, and greater than or equal + * to (MEXP / 128 + 1) * 2 + * + * @note \b memalign or \b posix_memalign is available to get aligned + * memory. Mac OSX doesn't have these functions, but \b malloc of OSX + * returns the pointer to the aligned memory block. + */ +void fill_array64(uint64_t *array, int size) { + assert(initialized); + assert(idx == N32); + assert(size % 2 == 0); + assert(size >= N64); + + gen_rand_array((w128_t *)array, size / 2); + idx = N32; + +#if defined(BIG_ENDIAN64) && !defined(ONLY64) + swap((w128_t *)array, size /2); +#endif +} + +/** + * This function initializes the internal state array with a 32-bit + * integer seed. + * + * @param seed a 32-bit integer used as the seed. + */ +void init_gen_rand(uint32_t seed) { + int i; + + psfmt32[idxof(0)] = seed; + for (i = 1; i < N32; i++) { + psfmt32[idxof(i)] = 1812433253UL * (psfmt32[idxof(i - 1)] + ^ (psfmt32[idxof(i - 1)] >> 30)) + + i; + } + idx = N32; + period_certification(); + initialized = 1; +} + +/** + * This function initializes the internal state array, + * with an array of 32-bit integers used as the seeds + * @param init_key the array of 32-bit integers, used as a seed. + * @param key_length the length of init_key. + */ +void init_by_array(uint32_t *init_key, int key_length) { + int i, j, count; + uint32_t r; + int lag; + int mid; + int size = N * 4; + + if (size >= 623) { + lag = 11; + } else if (size >= 68) { + lag = 7; + } else if (size >= 39) { + lag = 5; + } else { + lag = 3; + } + mid = (size - lag) / 2; + + memset(sfmt, 0x8b, sizeof(sfmt)); + if (key_length + 1 > N32) { + count = key_length + 1; + } else { + count = N32; + } + r = func1(psfmt32[idxof(0)] ^ psfmt32[idxof(mid)] + ^ psfmt32[idxof(N32 - 1)]); + psfmt32[idxof(mid)] += r; + r += key_length; + psfmt32[idxof(mid + lag)] += r; + psfmt32[idxof(0)] = r; + + count--; + for (i = 1, j = 0; (j < count) && (j < key_length); j++) { + r = func1(psfmt32[idxof(i)] ^ psfmt32[idxof((i + mid) % N32)] + ^ psfmt32[idxof((i + N32 - 1) % N32)]); + psfmt32[idxof((i + mid) % N32)] += r; + r += init_key[j] + i; + psfmt32[idxof((i + mid + lag) % N32)] += r; + psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + for (; j < count; j++) { + r = func1(psfmt32[idxof(i)] ^ psfmt32[idxof((i + mid) % N32)] + ^ psfmt32[idxof((i + N32 - 1) % N32)]); + psfmt32[idxof((i + mid) % N32)] += r; + r += i; + psfmt32[idxof((i + mid + lag) % N32)] += r; + psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + for (j = 0; j < N32; j++) { + r = func2(psfmt32[idxof(i)] + psfmt32[idxof((i + mid) % N32)] + + psfmt32[idxof((i + N32 - 1) % N32)]); + psfmt32[idxof((i + mid) % N32)] ^= r; + r -= i; + psfmt32[idxof((i + mid + lag) % N32)] ^= r; + psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + + idx = N32; + period_certification(); + initialized = 1; +} diff --git a/externals/SFMT/SFMT.h b/externals/SFMT/SFMT.h new file mode 100644 index 00000000000..7c8b35e9e95 --- /dev/null +++ b/externals/SFMT/SFMT.h @@ -0,0 +1,157 @@ +/** + * @file SFMT.h + * + * @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom + * number generator + * + * @author Mutsuo Saito (Hiroshima University) + * @author Makoto Matsumoto (Hiroshima University) + * + * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima + * University. All rights reserved. + * + * The new BSD License is applied to this software. + * see LICENSE.txt + * + * @note We assume that your system has inttypes.h. If your system + * doesn't have inttypes.h, you have to typedef uint32_t and uint64_t, + * and you have to define PRIu64 and PRIx64 in this file as follows: + * @verbatim + typedef unsigned int uint32_t + typedef unsigned long long uint64_t + #define PRIu64 "llu" + #define PRIx64 "llx" +@endverbatim + * uint32_t must be exactly 32-bit unsigned integer type (no more, no + * less), and uint64_t must be exactly 64-bit unsigned integer type. + * PRIu64 and PRIx64 are used for printf function to print 64-bit + * unsigned int and 64-bit unsigned int in hexadecimal format. + */ + +#ifndef SFMT_H +#define SFMT_H + +#include + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + #include +#elif defined(_MSC_VER) || defined(__BORLANDC__) + typedef unsigned int uint32_t; + typedef unsigned __int64 uint64_t; + #define inline __inline +#else + #include + #if defined(__GNUC__) + #define inline __inline__ + #endif +#endif + +#ifndef PRIu64 + #if defined(_MSC_VER) || defined(__BORLANDC__) + #define PRIu64 "I64u" + #define PRIx64 "I64x" + #else + #define PRIu64 "llu" + #define PRIx64 "llx" + #endif +#endif + +#if defined(__GNUC__) +#define ALWAYSINLINE __attribute__((always_inline)) +#else +#define ALWAYSINLINE +#endif + +#if defined(_MSC_VER) + #if _MSC_VER >= 1200 + #define PRE_ALWAYS __forceinline + #else + #define PRE_ALWAYS inline + #endif +#else + #define PRE_ALWAYS inline +#endif + +uint32_t gen_rand32(void); +uint64_t gen_rand64(void); +void fill_array32(uint32_t *array, int size); +void fill_array64(uint64_t *array, int size); +void init_gen_rand(uint32_t seed); +void init_by_array(uint32_t *init_key, int key_length); +const char *get_idstring(void); +int get_min_array_size32(void); +int get_min_array_size64(void); + +/* These real versions are due to Isaku Wada */ +/** generates a random number on [0,1]-real-interval */ +inline static double to_real1(uint32_t v) +{ + return v * (1.0/4294967295.0); + /* divided by 2^32-1 */ +} + +/** generates a random number on [0,1]-real-interval */ +inline static double genrand_real1(void) +{ + return to_real1(gen_rand32()); +} + +/** generates a random number on [0,1)-real-interval */ +inline static double to_real2(uint32_t v) +{ + return v * (1.0/4294967296.0); + /* divided by 2^32 */ +} + +/** generates a random number on [0,1)-real-interval */ +inline static double genrand_real2(void) +{ + return to_real2(gen_rand32()); +} + +/** generates a random number on (0,1)-real-interval */ +inline static double to_real3(uint32_t v) +{ + return (((double)v) + 0.5)*(1.0/4294967296.0); + /* divided by 2^32 */ +} + +/** generates a random number on (0,1)-real-interval */ +inline static double genrand_real3(void) +{ + return to_real3(gen_rand32()); +} +/** These real versions are due to Isaku Wada */ + +/** generates a random number on [0,1) with 53-bit resolution*/ +inline static double to_res53(uint64_t v) +{ + return v * (1.0/18446744073709551616.0L); +} + +/** generates a random number on [0,1) with 53-bit resolution from two + * 32 bit integers */ +inline static double to_res53_mix(uint32_t x, uint32_t y) +{ + return to_res53(x | ((uint64_t)y << 32)); +} + +/** generates a random number on [0,1) with 53-bit resolution + */ +inline static double genrand_res53(void) +{ + return to_res53(gen_rand64()); +} + +/** generates a random number on [0,1) with 53-bit resolution + using 32bit integer. + */ +inline static double genrand_res53_mix(void) +{ + uint32_t x, y; + + x = gen_rand32(); + y = gen_rand32(); + return to_res53_mix(x, y); +} +#endif diff --git a/dep/src/ace/ACE.cpp b/externals/ace/ACE.cpp similarity index 93% rename from dep/src/ace/ACE.cpp rename to externals/ace/ACE.cpp index 9780df8e829..24fb3839ca2 100644 --- a/dep/src/ace/ACE.cpp +++ b/externals/ace/ACE.cpp @@ -1,4 +1,4 @@ -// $Id: ACE.cpp 82581 2008-08-11 08:58:24Z johnnyw $ +// $Id: ACE.cpp 88193 2009-12-16 09:14:06Z mcorino $ #include "ace/ACE.h" @@ -37,9 +37,11 @@ extern "C" int maxFiles; # include "ace/OS_NS_poll.h" #endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ + ACE_RCSID (ace, ACE, - "$Id: ACE.cpp 82581 2008-08-11 08:58:24Z johnnyw $") + "$Id: ACE.cpp 88193 2009-12-16 09:14:06Z mcorino $") + // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -60,6 +62,7 @@ namespace ACE char debug_; } + int ACE::out_of_handles (int error) { @@ -160,11 +163,18 @@ ACE::compiler_beta_version (void) #endif } +ACE_TCHAR +ACE::nibble2hex (u_int n) +{ + // Yes, this works for UNICODE + return ACE_TEXT ("0123456789abcdef")[n & 0x0f]; +} + bool ACE::debug (void) { static const char* debug = ACE_OS::getenv ("ACE_DEBUG"); - return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0'): false); + return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0') : false); } void @@ -370,7 +380,6 @@ ACE::hash_pjw (const wchar_t *str) } #endif /* ACE_HAS_WCHAR */ -#if !defined (ACE_HAS_WINCE) ACE_TCHAR * ACE::strenvdup (const ACE_TCHAR *str) { @@ -378,7 +387,6 @@ ACE::strenvdup (const ACE_TCHAR *str) return ACE_OS::strenvdup (str); } -#endif /* ACE_HAS_WINCE */ /* @@ -2303,6 +2311,7 @@ ACE::restore_non_blocking_mode (ACE_HANDLE handle, } } + // Format buffer into printable format. This is useful for debugging. // Portions taken from mdump by J.P. Knight (J.P.Knight@lut.ac.uk) // Modifications by Todd Montgomery. @@ -2326,7 +2335,7 @@ ACE::format_hexdump (const char *buffer, size_t i; - size_t lines = size / 16; + size_t const lines = size / 16; for (i = 0; i < lines; i++) { size_t j; @@ -2350,7 +2359,11 @@ ACE::format_hexdump (const char *buffer, textver[j] = 0; ACE_OS::sprintf (obuf, +#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_TEXT (" %ls\n"), +#else ACE_TEXT (" %s\n"), +#endif textver); while (*obuf != '\0') @@ -2391,7 +2404,11 @@ ACE::format_hexdump (const char *buffer, textver[i] = 0; ACE_OS::sprintf (obuf, +#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_TEXT (" %ls\n"), +#else ACE_TEXT (" %s\n"), +#endif textver); } return size; @@ -2405,6 +2422,22 @@ ACE_TCHAR * ACE::timestamp (ACE_TCHAR date_and_time[], size_t date_and_timelen, bool return_pointer_to_first_digit) +{ + return ACE::timestamp (ACE_Time_Value::zero, + date_and_time, + date_and_timelen, + return_pointer_to_first_digit); +} + +// Returns the given timestamp in the form +// "hour:minute:second:microsecond." The month, day, and year are +// also stored in the beginning of the date_and_time array. + +ACE_TCHAR * +ACE::timestamp (const ACE_Time_Value& time_value, + ACE_TCHAR date_and_time[], + size_t date_and_timelen, + bool return_pointer_to_first_digit) { //ACE_TRACE ("ACE::timestamp"); @@ -2415,52 +2448,57 @@ ACE::timestamp (ACE_TCHAR date_and_time[], } #if defined (WIN32) - // Emulate Unix. Win32 does NOT support all the UNIX versions - // below, so DO we need this ifdef. - static const ACE_TCHAR *day_of_week_name[] = - { - ACE_TEXT ("Sun"), - ACE_TEXT ("Mon"), - ACE_TEXT ("Tue"), - ACE_TEXT ("Wed"), - ACE_TEXT ("Thu"), - ACE_TEXT ("Fri"), - ACE_TEXT ("Sat") - }; - - static const ACE_TCHAR *month_name[] = - { - ACE_TEXT ("Jan"), - ACE_TEXT ("Feb"), - ACE_TEXT ("Mar"), - ACE_TEXT ("Apr"), - ACE_TEXT ("May"), - ACE_TEXT ("Jun"), - ACE_TEXT ("Jul"), - ACE_TEXT ("Aug"), - ACE_TEXT ("Sep"), - ACE_TEXT ("Oct"), - ACE_TEXT ("Nov"), - ACE_TEXT ("Dec") - }; - - SYSTEMTIME local; - ::GetLocalTime (&local); - - ACE_OS::sprintf (date_and_time, - ACE_TEXT ("%3s %3s %2d %04d %02d:%02d:%02d.%06d"), - day_of_week_name[local.wDayOfWeek], - month_name[local.wMonth - 1], - (int) local.wDay, - (int) local.wYear, - (int) local.wHour, - (int) local.wMinute, - (int) local.wSecond, - (int) (local.wMilliseconds * 1000)); - return &date_and_time[15 + (return_pointer_to_first_digit != 0)]; -#else /* UNIX */ + if (time_value == ACE_Time_Value::zero) + { + // Emulate Unix. Win32 does NOT support all the UNIX versions + // below, so DO we need this ifdef. + static const ACE_TCHAR *day_of_week_name[] = + { + ACE_TEXT ("Sun"), + ACE_TEXT ("Mon"), + ACE_TEXT ("Tue"), + ACE_TEXT ("Wed"), + ACE_TEXT ("Thu"), + ACE_TEXT ("Fri"), + ACE_TEXT ("Sat") + }; + + static const ACE_TCHAR *month_name[] = + { + ACE_TEXT ("Jan"), + ACE_TEXT ("Feb"), + ACE_TEXT ("Mar"), + ACE_TEXT ("Apr"), + ACE_TEXT ("May"), + ACE_TEXT ("Jun"), + ACE_TEXT ("Jul"), + ACE_TEXT ("Aug"), + ACE_TEXT ("Sep"), + ACE_TEXT ("Oct"), + ACE_TEXT ("Nov"), + ACE_TEXT ("Dec") + }; + + SYSTEMTIME local; + ::GetLocalTime (&local); + + ACE_OS::sprintf (date_and_time, + ACE_TEXT ("%3s %3s %2d %04d %02d:%02d:%02d.%06d"), + day_of_week_name[local.wDayOfWeek], + month_name[local.wMonth - 1], + (int) local.wDay, + (int) local.wYear, + (int) local.wHour, + (int) local.wMinute, + (int) local.wSecond, + (int) (local.wMilliseconds * 1000)); + return &date_and_time[15 + (return_pointer_to_first_digit != 0)]; + } +#endif /* WIN32 */ ACE_TCHAR timebuf[26]; // This magic number is based on the ctime(3c) man page. - ACE_Time_Value cur_time = ACE_OS::gettimeofday (); + ACE_Time_Value cur_time = + (time_value == ACE_Time_Value::zero) ? + ACE_Time_Value (ACE_OS::gettimeofday ()) : time_value; time_t secs = cur_time.sec (); ACE_OS::ctime_r (&secs, @@ -2489,7 +2527,6 @@ ACE::timestamp (ACE_TCHAR date_and_time[], cur_time.usec ()); date_and_time[33] = '\0'; return &date_and_time[15 + (return_pointer_to_first_digit != 0)]; -#endif /* WIN32 */ } // This function rounds the request to a multiple of the page size. @@ -2534,14 +2571,14 @@ ACE::handle_timed_complete (ACE_HANDLE h, #else ACE_Handle_Set rd_handles; ACE_Handle_Set wr_handles; - rd_handles.set_bit (h); wr_handles.set_bit (h); #endif /* !ACE_WIN32 && ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ #if defined (ACE_WIN32) // Winsock is different - it sets the exception bit for failed connect, - // unlike other platforms, where the read bit is set. + // unlike other platforms, where the write bit is set for both success + // and fail. ACE_Handle_Set ex_handles; ex_handles.set_bit (h); #endif /* ACE_WIN32 */ @@ -2561,11 +2598,19 @@ ACE::handle_timed_complete (ACE_HANDLE h, int n = ACE_OS::poll (&fds, 1, timeout); # else - int n = ACE_OS::select (int (h) + 1, - rd_handles, - wr_handles, - 0, - timeout); + int n = 0; + if (is_tli) + n = ACE_OS::select (int (h) + 1, + rd_handles, + wr_handles, + 0, + timeout); + else + n = ACE_OS::select (int (h) + 1, + 0, + wr_handles, + 0, + timeout); # endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ #endif /* ACE_WIN32 */ @@ -2579,11 +2624,14 @@ ACE::handle_timed_complete (ACE_HANDLE h, return ACE_INVALID_HANDLE; } - // Usually, a ready-for-write handle is successfully connected, and - // ready-for-read (exception on Win32) is a failure. On fails, we - // need to grab the error code via getsockopt. On possible success for - // any platform where we can't tell just from select() (e.g. AIX), - // we also need to check for success/fail. + // On Windows, a ready-for-write handle is successfully connected, and + // ready-for-exception is a failure. On fails, we need to grab the error + // code via getsockopt. + // On BSD sockets using select(), the handle becomes writable on + // completion either success or fail, so if the select() does not time + // out, we need to check for success/fail. + // It is believed that TLI sockets use the readable=fail, writeable=success + // but that hasn't been as well tested. #if defined (ACE_WIN32) ACE_UNUSED_ARG (is_tli); @@ -2595,34 +2643,20 @@ ACE::handle_timed_complete (ACE_HANDLE h, need_to_check = true; known_failure = true; } -#elif defined (ACE_VXWORKS) - ACE_UNUSED_ARG (is_tli); - - // Force the check on VxWorks. The read handle for "h" is not set, - // so "need_to_check" is false at this point. The write handle is - // set, for what it's worth. - need_to_check = true; #else if (is_tli) - # if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) need_to_check = (fds.revents & POLLIN) && !(fds.revents & POLLOUT); # else - need_to_check = rd_handles.is_set (h) && !wr_handles.is_set (h); + need_to_check = rd_handles.is_set (h) && !wr_handles.is_set (h); # endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ else -#if defined(AIX) - // AIX is broken... both success and failed connect will set the - // write handle only, so always check. - need_to_check = true; -#else # if defined (ACE_HAS_POLL) && defined (ACE_HAS_LIMITED_SELECT) - need_to_check = (fds.revents & POLLIN); + need_to_check = (fds.revents & POLLIN); # else - need_to_check = rd_handles.is_set (h); + need_to_check = true; # endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ -#endif /* AIX */ #endif /* ACE_WIN32 */ if (need_to_check) @@ -2677,7 +2711,7 @@ ACE::handle_timed_complete (ACE_HANDLE h, int ACE::handle_timed_accept (ACE_HANDLE listener, ACE_Time_Value *timeout, - int restart) + bool restart) { ACE_TRACE ("ACE::handle_timed_accept"); // Make sure we don't bomb out on erroneous values. @@ -2729,9 +2763,7 @@ ACE::handle_timed_accept (ACE_HANDLE listener, return -1; /* NOTREACHED */ case 0: - if (timeout != 0 - && timeout->sec () == 0 - && timeout->usec () == 0) + if (timeout != 0 && *timeout == ACE_Time_Value::zero) errno = EWOULDBLOCK; else errno = ETIMEDOUT; @@ -2970,6 +3002,7 @@ ACE::gcd (u_long x, u_long y) return x; } + // Calculates the minimum enclosing frame size for the given values. u_long ACE::minimum_frame_size (u_long period1, u_long period2) @@ -3013,6 +3046,7 @@ ACE::minimum_frame_size (u_long period1, u_long period2) } } + u_long ACE::is_prime (const u_long n, const u_long min_factor, @@ -3380,27 +3414,82 @@ ACE::strnew (const wchar_t *s) } #endif /* ACE_HAS_WCHAR */ -inline static bool equal_char(char a, char b, bool case_sensitive) +// helper functions for ACE::wild_match() +namespace { - if (case_sensitive) - return a == b; - return ACE_OS::ace_tolower(a) == ACE_OS::ace_tolower(b); + + inline bool equal_char (char a, char b, bool case_sensitive) + { + if (case_sensitive) + return a == b; + return ACE_OS::ace_tolower (a) == ACE_OS::ace_tolower (b); + } + + // precond: *p == '[' start of char class + // postcond: *p == ']' end of the char class + inline bool equal_class (char s, const char *&p, bool case_sensitive) + { + ++p; + bool negate = false; + if (*p == '!') + { + negate = true; + ++p; + } + // ] and - are regular in 1st position + for (bool first = true; *p && (first || *p != ']'); ++p) + { + if (!first && *p == '-' && p[1] != ']') + { + if (!p[1] || p[1] <= p[-1]) // invalid range + { + continue; + } + // Since we are in the POSIX locale, only the basic ASCII + // characters are allowed as the range endpoints. These characters + // are the same values in both signed and unsigned chars so we + // don't have to account for any "pathological cases." + for (char range = p[-1] + 1; range <= p[1]; ++range) + { + if (equal_char (s, range, case_sensitive)) + { + while (*++p != ']') {} + return !negate; + } + } + ++p; // consume the character 1 past the - + } + else if (equal_char (s, *p, case_sensitive)) + { + while (*++p != ']') {} + return !negate; + } + first = false; + } + return negate; + } } bool -ACE::wild_match(const char* str, const char* pat, bool case_sensitive) +ACE::wild_match(const char *str, const char *pat, bool case_sensitive, + bool character_classes) { if (str == pat) return true; if (pat == 0 || str == 0) return false; - bool star = false; - const char* s = str; - const char* p = pat; + bool star = false, escape = false; + const char *s = str; + const char *p = pat; while (*s != '\0') { - if (*p == '*') + if (!escape && *p == '\\') + { + ++p; + escape = true; + } + else if (!escape && *p == '*') { star = true; pat = p; @@ -3410,22 +3499,38 @@ ACE::wild_match(const char* str, const char* pat, bool case_sensitive) return true; p = pat; } - else if (*p == '?') + else if (!escape && *p == '?') { ++s; ++p; } - else if (! equal_char(*s, *p, case_sensitive)) + else if (!escape && character_classes && *p == '[') + { + if (equal_class (*s, p, case_sensitive)) + { + ++p; + } + else + { + if (!star) + return false; + p = pat; + } + ++s; + } + else if (!equal_char (*s, *p, case_sensitive)) { if (!star) return false; - s = ++str; + ++s; p = pat; + escape = false; } else { ++s; ++p; + escape = false; } } if (*p == '*') @@ -3436,4 +3541,3 @@ ACE::wild_match(const char* str, const char* pat, bool case_sensitive) // Close versioned namespace, if enabled by the user. ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/ACE.h b/externals/ace/ACE.h similarity index 95% rename from dep/include/ace/ACE.h rename to externals/ace/ACE.h index ea7a3fa02e4..56ce13cfd75 100644 --- a/dep/include/ace/ACE.h +++ b/externals/ace/ACE.h @@ -4,7 +4,7 @@ /** * @file ACE.h * - * $Id: ACE.h 82581 2008-08-11 08:58:24Z johnnyw $ + * $Id: ACE.h 88193 2009-12-16 09:14:06Z mcorino $ * * This file contains value added ACE functions that extend the * behavior of the UNIX and Win32 OS calls. @@ -90,7 +90,13 @@ namespace ACE /// Simple wildcard matching function supporting '*' and '?' /// return true if string s matches pattern. - extern ACE_Export bool wild_match(const char* s, const char* pattern, bool case_sensitive = true); + /// If character_classes is true, '[' is treated as a wildcard character + /// as described in the fnmatch() POSIX API. The following POSIX "bracket + /// expression" features are not implemented: collating symbols, equivalence + /// class expressions, and character class expressions. The POSIX locale is + /// assumed. + extern ACE_Export bool wild_match(const char* s, const char* pattern, + bool case_sensitive = true, bool character_classes = false); /** * @name I/O operations @@ -354,7 +360,7 @@ namespace ACE */ extern ACE_Export int handle_timed_accept (ACE_HANDLE listener, ACE_Time_Value *timeout, - int restart); + bool restart); /** * Wait up to @a timeout amount of time to complete an actively @@ -384,7 +390,6 @@ namespace ACE extern ACE_Export int max_handles (void); // = String functions -#if !defined (ACE_HAS_WINCE) /** * Return a dynamically allocated duplicate of @a str, substituting * the environment variable if @c str[0] @c == @c '$'. Note that @@ -392,7 +397,6 @@ namespace ACE * by @c ACE_OS::free. */ extern ACE_Export ACE_TCHAR *strenvdup (const ACE_TCHAR *str); -#endif /* ACE_HAS_WINCE */ /// Returns a pointer to the "end" of the string, i.e., the character /// past the '\0'. @@ -414,6 +418,9 @@ namespace ACE /// @c ACE_OS::malloc to allocate the new string. extern ACE_Export char *strnnew (const char *str, size_t n); + /// Determine if a specified pathname is "dot dir" (ie. "." or ".."). + ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const char *s); + #if defined (ACE_HAS_WCHAR) extern ACE_Export const wchar_t *strend (const wchar_t *s); @@ -425,6 +432,8 @@ namespace ACE extern ACE_Export wchar_t *strnnew (const wchar_t *str, size_t n); + ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const wchar_t *s); + #endif /* ACE_HAS_WCHAR */ /** @@ -464,6 +473,22 @@ namespace ACE ACE_TCHAR delim = ACE_DIRECTORY_SEPARATOR_CHAR); + /** + * Returns the given timestamp in the form + * "hour:minute:second:microsecond." The month, day, and year are + * also stored in the beginning of the @a date_and_time array, which + * is a user-supplied array of size @a time_len> @c ACE_TCHARs. + * Returns 0 if unsuccessful, else returns pointer to beginning of the + * "time" portion of @a date_and_time. If @a + * return_pointer_to_first_digit is 0 then return a pointer to the + * space before the time, else return a pointer to the beginning of + * the time portion. + */ + extern ACE_Export ACE_TCHAR *timestamp (const ACE_Time_Value& time_value, + ACE_TCHAR date_and_time[], + size_t time_len, + bool return_pointer_to_first_digit = false); + /** * Returns the current timestamp in the form * "hour:minute:second:microsecond." The month, day, and year are @@ -618,7 +643,7 @@ namespace ACE ACE_NAMESPACE_INLINE_FUNCTION u_long log2 (u_long num); /// Hex conversion utility. - ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR nibble2hex (u_int n); + extern ACE_Export ACE_TCHAR nibble2hex (u_int n); /// Convert a hex character to its byte representation. ACE_NAMESPACE_INLINE_FUNCTION u_char hex2byte (ACE_TCHAR c); @@ -822,4 +847,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ACE_H */ - diff --git a/dep/include/ace/ACE.inl b/externals/ace/ACE.inl similarity index 93% rename from dep/include/ace/ACE.inl rename to externals/ace/ACE.inl index 8e92cb2bc39..4be80bfb64c 100644 --- a/dep/include/ace/ACE.inl +++ b/externals/ace/ACE.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: ACE.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ACE.inl 87366 2009-11-05 20:16:30Z olli $ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_Thread.h" @@ -10,6 +10,7 @@ // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL + // Wrappers for methods that have been moved to ACE_OS. ACE_INLINE ssize_t @@ -283,6 +284,22 @@ ACE::strdelete (wchar_t *s) } #endif /* ACE_HAS_WCHAR */ +ACE_INLINE bool +ACE::isdotdir (const char *s) +{ + return (s[0] == '.' && + ((s[1] == 0) || (s[1] == '.' && s[2] == 0))); +} + +#if defined (ACE_HAS_WCHAR) +ACE_INLINE bool +ACE::isdotdir (const wchar_t *s) +{ + return (s[0] == ACE_TEXT ('.') && + ((s[1] == 0) || (s[1] == ACE_TEXT ('.') && s[2] == 0))); +} +#endif /* ACE_HAS_WCHAR */ + ACE_INLINE void ACE::unique_name (const void *object, ACE_TCHAR *name, @@ -302,24 +319,6 @@ ACE::log2 (u_long num) return log; } -ACE_INLINE ACE_TCHAR -ACE::nibble2hex (u_int n) -{ - // Hexadecimal characters. -#if defined (ACE_VXWORKS) && !defined (__DCPLUSPLUS__) - // temporary solution to prevent Windriver GNU toolchains from spewing - // loads of warnings when inlining. - // problem (incorrect warning leftover from older GNU) has been reported as - // TSR to Windriver. - const ACE_TCHAR hex_chars[] = ACE_TEXT ("0123456789abcdef"); -#else - static const ACE_TCHAR hex_chars[] = ACE_TEXT ("0123456789abcdef"); -#endif - - // Yes, this works for UNICODE - return hex_chars[n & 0x0f]; -} - ACE_INLINE int ACE::map_errno (int error) { diff --git a/externals/ace/ACE.pc.in b/externals/ace/ACE.pc.in new file mode 100644 index 00000000000..90b2a9eebd7 --- /dev/null +++ b/externals/ace/ACE.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: ACE +Description: ADAPTIVE Communication Environment +Version: @VERSION@ +Libs: -L${libdir} -lACE @LIBS@ +Cflags: -I${includedir} diff --git a/dep/src/ace/ACE_crc32.cpp b/externals/ace/ACE_crc32.cpp similarity index 100% rename from dep/src/ace/ACE_crc32.cpp rename to externals/ace/ACE_crc32.cpp index 40608e8f7bc..70d93e6b598 100644 --- a/dep/src/ace/ACE_crc32.cpp +++ b/externals/ace/ACE_crc32.cpp @@ -6,6 +6,7 @@ ACE_RCSID (ace, ACE_crc32, "$Id: ACE_crc32.cpp 80826 2008-03-04 14:51:23Z wotte $") + namespace { /*****************************************************************/ @@ -158,4 +159,3 @@ ACE::crc32 (const iovec *iov, int len, ACE_UINT32 crc) ACE_END_VERSIONED_NAMESPACE_DECL #undef COMPUTE - diff --git a/dep/src/ace/ACE_crc_ccitt.cpp b/externals/ace/ACE_crc_ccitt.cpp similarity index 99% rename from dep/src/ace/ACE_crc_ccitt.cpp rename to externals/ace/ACE_crc_ccitt.cpp index 4e9b4a2f98e..ef7f5d65bd1 100644 --- a/dep/src/ace/ACE_crc_ccitt.cpp +++ b/externals/ace/ACE_crc_ccitt.cpp @@ -126,4 +126,3 @@ ACE::crc_ccitt (const iovec *iov, int len, ACE_UINT16 crc) ACE_END_VERSIONED_NAMESPACE_DECL #undef COMPUTE - diff --git a/dep/include/ace/ACE_export.h b/externals/ace/ACE_export.h similarity index 99% rename from dep/include/ace/ACE_export.h rename to externals/ace/ACE_export.h index 60e79b01f1f..8ad2a33ebaf 100644 --- a/dep/include/ace/ACE_export.h +++ b/externals/ace/ACE_export.h @@ -74,4 +74,3 @@ #endif /* ACE_EXPORT_H */ // End of auto generated file. - diff --git a/dep/src/ace/ARGV.cpp b/externals/ace/ARGV.cpp similarity index 99% rename from dep/src/ace/ARGV.cpp rename to externals/ace/ARGV.cpp index a30809b2ec1..edfd4efa790 100644 --- a/dep/src/ace/ARGV.cpp +++ b/externals/ace/ARGV.cpp @@ -381,4 +381,3 @@ ACE_ARGV_T::create_buf_from_queue (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ARGV_CPP */ - diff --git a/dep/include/ace/ARGV.h b/externals/ace/ARGV.h similarity index 99% rename from dep/include/ace/ARGV.h rename to externals/ace/ARGV.h index c2995a451f2..66e71810a95 100644 --- a/dep/include/ace/ARGV.h +++ b/externals/ace/ARGV.h @@ -331,4 +331,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ARGUMENT_VECTOR_H */ - diff --git a/dep/include/ace/ARGV.inl b/externals/ace/ARGV.inl similarity index 100% rename from dep/include/ace/ARGV.inl rename to externals/ace/ARGV.inl diff --git a/dep/src/ace/ATM_Acceptor.cpp b/externals/ace/ATM_Acceptor.cpp similarity index 97% rename from dep/src/ace/ATM_Acceptor.cpp rename to externals/ace/ATM_Acceptor.cpp index af2e0e1f695..7e835658f01 100644 --- a/dep/src/ace/ATM_Acceptor.cpp +++ b/externals/ace/ATM_Acceptor.cpp @@ -1,8 +1,8 @@ -// $Id: ATM_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ATM_Acceptor.cpp 84262 2009-01-29 10:34:33Z johnnyw $ #include "ace/ATM_Acceptor.h" -ACE_RCSID(ace, ATM_Acceptor, "$Id: ATM_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, ATM_Acceptor, "$Id: ATM_Acceptor.cpp 84262 2009-01-29 10:34:33Z johnnyw $") #if defined (ACE_HAS_ATM) @@ -14,6 +14,7 @@ ACE_RCSID(ace, ATM_Acceptor, "$Id: ATM_Acceptor.cpp 80826 2008-03-04 14:51:23Z w #include "ace/ATM_Acceptor.inl" #endif /* __ACE_INLINE__ */ + // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -80,7 +81,7 @@ ACE_ATM_Acceptor::get_local_addr (ACE_ATM_Addr &local_addr) return -1; } - return (0); + return 0; #else ACE_UNUSED_ARG (local_addr); @@ -235,8 +236,8 @@ int ACE_ATM_Acceptor::accept (ACE_ATM_Stream &new_sap, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle, + bool restart, + bool reset_new_handle, ACE_ATM_Params params, ACE_ATM_QoS qos) { @@ -297,12 +298,12 @@ ACE_ATM_Acceptor::accept (ACE_ATM_Stream &new_sap, ACE_UNUSED_ARG (reset_new_handle); ACE_UNUSED_ARG (params); ACE_UNUSED_ARG (qos); - return (0); + return 0; #endif /* ACE_HAS_FORE_ATM_XTI */ } // Close versioned namespace, if enabled by the user. ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_HAS_ATM */ +#endif /* ACE_HAS_ATM */ diff --git a/dep/include/ace/ATM_Acceptor.h b/externals/ace/ATM_Acceptor.h similarity index 95% rename from dep/include/ace/ATM_Acceptor.h rename to externals/ace/ATM_Acceptor.h index 762a8c2122c..1241a228caa 100644 --- a/dep/include/ace/ATM_Acceptor.h +++ b/externals/ace/ATM_Acceptor.h @@ -4,12 +4,13 @@ /** * @file ATM_Acceptor.h * - * $Id: ATM_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: ATM_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Joe Hoffert */ //============================================================================= + #ifndef ACE_ATM_ACCEPTOR_H #define ACE_ATM_ACCEPTOR_H #include /**/ "ace/pre.h" @@ -87,8 +88,8 @@ public: int accept (ACE_ATM_Stream &new_sap, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0, + bool restart = true, + bool reset_new_handle = false, ACE_ATM_Params params = ACE_ATM_Params(), ACE_ATM_QoS qos = ACE_ATM_QoS()); @@ -112,6 +113,7 @@ private: // Close versioned namespace, if enabled by the user. ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/ATM_Acceptor.inl" #endif /* __ACE_INLINE__ */ @@ -119,4 +121,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ #include /**/ "ace/post.h" #endif /* ACE_ATM_ACCEPTOR_H */ - diff --git a/dep/include/ace/ATM_Acceptor.inl b/externals/ace/ATM_Acceptor.inl similarity index 100% rename from dep/include/ace/ATM_Acceptor.inl rename to externals/ace/ATM_Acceptor.inl diff --git a/dep/src/ace/ATM_Addr.cpp b/externals/ace/ATM_Addr.cpp similarity index 98% rename from dep/src/ace/ATM_Addr.cpp rename to externals/ace/ATM_Addr.cpp index 033816743ea..991498d6668 100644 --- a/dep/src/ace/ATM_Addr.cpp +++ b/externals/ace/ATM_Addr.cpp @@ -1,4 +1,4 @@ -// $Id: ATM_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ATM_Addr.cpp 84565 2009-02-23 08:20:39Z johnnyw $ // Defines the Internet domain address family address format. @@ -15,7 +15,7 @@ #include "ace/ATM_Addr.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, ATM_Addr, "$Id: ATM_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, ATM_Addr, "$Id: ATM_Addr.cpp 84565 2009-02-23 08:20:39Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -100,6 +100,7 @@ ACE_ATM_Addr::ACE_ATM_Addr (const ATM_Addr *sap, this->set (sap, selector); } + ACE_ATM_Addr::ACE_ATM_Addr (const ACE_TCHAR sap[], u_char selector) #if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2) @@ -337,7 +338,7 @@ ACE_ATM_Addr::string_to_addr (const ACE_TCHAR sap[]) } if (WSALookupServiceEnd (hLookup) == SOCKET_ERROR) { - ACE_OS::printf ("Error : WSALookupServiceEnd failed! %d \n", + ACE_OS::printf ("Error : WSALookupServiceEnd failed! %d\n", ::WSAGetLastError ()); errno = EINVAL; return -1; @@ -519,4 +520,3 @@ ACE_ATM_Addr::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ - diff --git a/dep/include/ace/ATM_Addr.h b/externals/ace/ATM_Addr.h similarity index 100% rename from dep/include/ace/ATM_Addr.h rename to externals/ace/ATM_Addr.h index 3c586f10a11..7fa93f1492c 100644 --- a/dep/include/ace/ATM_Addr.h +++ b/externals/ace/ATM_Addr.h @@ -187,6 +187,7 @@ private: // Close versioned namespace, if enabled by the user. ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/ATM_Addr.inl" #endif /* __ACE_INLINE__ */ @@ -194,4 +195,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ #include /**/ "ace/post.h" #endif /* ACE_ATM_ADDR_H */ - diff --git a/dep/include/ace/ATM_Addr.inl b/externals/ace/ATM_Addr.inl similarity index 100% rename from dep/include/ace/ATM_Addr.inl rename to externals/ace/ATM_Addr.inl diff --git a/dep/src/ace/ATM_Connector.cpp b/externals/ace/ATM_Connector.cpp similarity index 99% rename from dep/src/ace/ATM_Connector.cpp rename to externals/ace/ATM_Connector.cpp index 7d68ed88bd2..c1ce226adce 100644 --- a/dep/src/ace/ATM_Connector.cpp +++ b/externals/ace/ATM_Connector.cpp @@ -136,4 +136,3 @@ ACE_ATM_Connector::connect (ACE_ATM_Stream &new_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ - diff --git a/dep/include/ace/ATM_Connector.h b/externals/ace/ATM_Connector.h similarity index 98% rename from dep/include/ace/ATM_Connector.h rename to externals/ace/ATM_Connector.h index e8657e91a23..940fc5a307f 100644 --- a/dep/include/ace/ATM_Connector.h +++ b/externals/ace/ATM_Connector.h @@ -4,7 +4,7 @@ /** * @file ATM_Connector.h * - * $Id: ATM_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: ATM_Connector.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Joe Hoffert */ @@ -136,7 +136,7 @@ public: ACE_ATM_QoS &qos); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); // = Meta-type info typedef ACE_ATM_Addr PEER_ADDR; @@ -162,4 +162,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ #include /**/ "ace/post.h" #endif /* ACE_ATM_CONNECTOR_H */ - diff --git a/dep/include/ace/ATM_Connector.inl b/externals/ace/ATM_Connector.inl similarity index 97% rename from dep/include/ace/ATM_Connector.inl rename to externals/ace/ATM_Connector.inl index 0b89cbf0828..10d1623f6c3 100644 --- a/dep/include/ace/ATM_Connector.inl +++ b/externals/ace/ATM_Connector.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: ATM_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ATM_Connector.inl 84565 2009-02-23 08:20:39Z johnnyw $ // Open versioned namespace, if enabled by the user. ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -96,7 +96,7 @@ ACE_ATM_Connector::add_leaf (ACE_ATM_Stream ¤t_stream, return (result != ACE_INVALID_HANDLE); #elif defined (ACE_HAS_LINUX_ATM) - ACE_OS::printf("ATM_Connector(add_leaf): not yet implemented in Linux \n"); + ACE_OS::printf("ATM_Connector(add_leaf): not yet implemented in Linux\n"); ACE_UNUSED_ARG(current_stream); ACE_UNUSED_ARG(remote_sap); @@ -114,7 +114,7 @@ ACE_ATM_Connector::add_leaf (ACE_ATM_Stream ¤t_stream, } ACE_INLINE -int +bool ACE_ATM_Connector::reset_new_handle (ACE_HANDLE handle) { #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) @@ -124,7 +124,7 @@ ACE_ATM_Connector::reset_new_handle (ACE_HANDLE handle) 0); #else /* !defined ACE_HAS_WINSOCK2 */ ACE_UNUSED_ARG (handle); - return 0; + return false; #endif /* ACE_WIN32 */ } diff --git a/dep/src/ace/ATM_Params.cpp b/externals/ace/ATM_Params.cpp similarity index 99% rename from dep/src/ace/ATM_Params.cpp rename to externals/ace/ATM_Params.cpp index d3e5116b0f8..70a05f1d71b 100644 --- a/dep/src/ace/ATM_Params.cpp +++ b/externals/ace/ATM_Params.cpp @@ -18,4 +18,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ - diff --git a/dep/include/ace/ATM_Params.h b/externals/ace/ATM_Params.h similarity index 100% rename from dep/include/ace/ATM_Params.h rename to externals/ace/ATM_Params.h index c460afbd3c2..d1e8c923118 100644 --- a/dep/include/ace/ATM_Params.h +++ b/externals/ace/ATM_Params.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_ATM_PARAMS_H #define ACE_ATM_PARAMS_H #include /**/ "ace/pre.h" @@ -211,4 +212,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ #include /**/ "ace/post.h" #endif /* ACE_ATM_PARAMS_H */ - diff --git a/dep/include/ace/ATM_Params.inl b/externals/ace/ATM_Params.inl similarity index 100% rename from dep/include/ace/ATM_Params.inl rename to externals/ace/ATM_Params.inl diff --git a/dep/src/ace/ATM_QoS.cpp b/externals/ace/ATM_QoS.cpp similarity index 99% rename from dep/src/ace/ATM_QoS.cpp rename to externals/ace/ATM_QoS.cpp index 60e4cafad3f..5f83d3a14d2 100644 --- a/dep/src/ace/ATM_QoS.cpp +++ b/externals/ace/ATM_QoS.cpp @@ -1,8 +1,8 @@ -// $Id: ATM_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ATM_QoS.cpp 84262 2009-01-29 10:34:33Z johnnyw $ #include "ace/ATM_QoS.h" -ACE_RCSID(ace, ATM_QoS, "$Id: ATM_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, ATM_QoS, "$Id: ATM_QoS.cpp 84262 2009-01-29 10:34:33Z johnnyw $") #if defined (ACE_HAS_ATM) @@ -451,7 +451,7 @@ ACE_ATM_QoS::construct_options (ACE_HANDLE fd, ACE_UNUSED_ARG (rate); ACE_UNUSED_ARG (flags); ACE_UNUSED_ARG (len); - return (0); + return 0; #elif defined (ACE_HAS_FORE_ATM_XTI) struct t_opthdr *popt; char *buf; @@ -621,7 +621,7 @@ ACE_ATM_QoS::construct_options (ACE_HANDLE fd, ACE_UNUSED_ARG (rate); ACE_UNUSED_ARG (flag); ACE_UNUSED_ARG (len); - return (0); + return 0; #endif /* ACE_HAS_FORE_ATM_WS2 */ } @@ -629,4 +629,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ - diff --git a/dep/include/ace/ATM_QoS.h b/externals/ace/ATM_QoS.h similarity index 100% rename from dep/include/ace/ATM_QoS.h rename to externals/ace/ATM_QoS.h index 927005aa68d..4e35f3fddb4 100644 --- a/dep/include/ace/ATM_QoS.h +++ b/externals/ace/ATM_QoS.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_ATM_QoS_H #define ACE_ATM_QoS_H #include /**/ "ace/pre.h" @@ -112,4 +113,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ #include /**/ "ace/post.h" #endif /* ACE_ATM_QoS_H */ - diff --git a/dep/include/ace/ATM_QoS.inl b/externals/ace/ATM_QoS.inl similarity index 100% rename from dep/include/ace/ATM_QoS.inl rename to externals/ace/ATM_QoS.inl diff --git a/dep/src/ace/ATM_Stream.cpp b/externals/ace/ATM_Stream.cpp similarity index 97% rename from dep/src/ace/ATM_Stream.cpp rename to externals/ace/ATM_Stream.cpp index 83b4625436d..a9dc0461fa2 100644 --- a/dep/src/ace/ATM_Stream.cpp +++ b/externals/ace/ATM_Stream.cpp @@ -1,8 +1,8 @@ -// $Id: ATM_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ATM_Stream.cpp 84262 2009-01-29 10:34:33Z johnnyw $ #include "ace/ATM_Stream.h" -ACE_RCSID (ace, ATM_Stream, "$Id: ATM_Stream.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID (ace, ATM_Stream, "$Id: ATM_Stream.cpp 84262 2009-01-29 10:34:33Z johnnyw $") #if defined (ACE_HAS_ATM) @@ -216,7 +216,7 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, vpi = conn_prop.vpi; vci = conn_prop.vci; - return (0); + return 0; #elif defined (ACE_HAS_FORE_ATM_WS2) ATM_CONNECTION_ID connID; DWORD bytes = 0; @@ -278,14 +278,13 @@ ACE_ATM_Stream::get_vpi_vci (ACE_UINT16 &vpi, ACE_UNUSED_ARG (vci); ACE_UNUSED_ARG (vpi); - return (-1); + return -1; #endif /* SO_ATMPVC || SO_VCID */ #else - return (-1); + return -1; #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */ } ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ - diff --git a/dep/include/ace/ATM_Stream.h b/externals/ace/ATM_Stream.h similarity index 100% rename from dep/include/ace/ATM_Stream.h rename to externals/ace/ATM_Stream.h index 2d31c7654d1..41ffb0da32e 100644 --- a/dep/include/ace/ATM_Stream.h +++ b/externals/ace/ATM_Stream.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_ATM_STREAM_H #define ACE_ATM_STREAM_H #include /**/ "ace/pre.h" @@ -104,4 +105,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ATM */ #include /**/ "ace/post.h" #endif /* ACE_ATM_STREAM_H */ - diff --git a/dep/include/ace/ATM_Stream.inl b/externals/ace/ATM_Stream.inl similarity index 97% rename from dep/include/ace/ATM_Stream.inl rename to externals/ace/ATM_Stream.inl index 087c1ed440b..007e25832a5 100644 --- a/dep/include/ace/ATM_Stream.inl +++ b/externals/ace/ATM_Stream.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: ATM_Stream.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: ATM_Stream.inl 84262 2009-01-29 10:34:33Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -103,7 +103,7 @@ ACE_ATM_Stream::recv (void *buf, ACE_UNUSED_ARG(buf); ACE_UNUSED_ARG(n); ACE_UNUSED_ARG(flags); - return (0); + return 0; #endif /* ACE_HAS_FORE_ATM_XTI */ } @@ -126,7 +126,7 @@ ACE_ATM_Stream::send_n (const void *buf, ACE_UNUSED_ARG(buf); ACE_UNUSED_ARG(n); ACE_UNUSED_ARG(flags); - return (0); + return 0; #endif /* ACE_HAS_FORE_ATM_XTI */ } diff --git a/dep/src/ace/Acceptor.cpp b/externals/ace/Acceptor.cpp similarity index 98% rename from dep/src/ace/Acceptor.cpp rename to externals/ace/Acceptor.cpp index 01b7f8da632..e2e1ad7b8e7 100644 --- a/dep/src/ace/Acceptor.cpp +++ b/externals/ace/Acceptor.cpp @@ -17,7 +17,7 @@ ACE_RCSID (ace, Acceptor, - "$Id: Acceptor.cpp 81991 2008-06-16 19:05:40Z elliott_c $") + "$Id: Acceptor.cpp 84935 2009-03-22 19:21:58Z schmidt $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -287,12 +287,23 @@ ACE_Acceptor::accept_svc_handler // created handle. This is because the newly created handle will // inherit the properties of the listen handle, including its event // associations. - int reset_new_handle = this->reactor ()->uses_event_associations (); + + ACE_Reactor *reactor = this->reactor (); + bool reset_new_handle; + + if (reactor) + reset_new_handle = reactor->uses_event_associations (); + else + { + // Acceptor is closed, so reject this call + errno = EINVAL; + return -1; + } if (this->acceptor ().accept (svc_handler->peer (), // stream 0, // remote address 0, // timeout - 1, // restart + true, // restart reset_new_handle // reset new handler ) == -1) { @@ -984,7 +995,7 @@ template int ACE_Oneshot_Acceptor::register_handler (SVC_HANDLER *svc_handler, const ACE_Synch_Options &synch_options, - int restart) + bool restart) { ACE_TRACE ("ACE_Oneshot_Acceptor::register_handler"); // Can't do this if we don't have a Reactor. @@ -1037,8 +1048,8 @@ ACE_Oneshot_Acceptor::shared_accept (SVC_HANDLER *svc_handler, ACE_PEER_ACCEPTOR_ADDR *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) + bool restart, + bool reset_new_handle) { ACE_TRACE ("ACE_Oneshot_Acceptor::shared_accept"); if (svc_handler == 0) @@ -1074,8 +1085,8 @@ ACE_Oneshot_Acceptor::accept (SVC_HANDLER *svc_handler, ACE_PEER_ACCEPTOR_ADDR *remote_addr, const ACE_Synch_Options &synch_options, - int restart, - int reset_new_handle) + bool restart, + bool reset_new_handle) { ACE_TRACE ("ACE_Oneshot_Acceptor::accept"); // Note that if timeout == ACE_Time_Value (x, y) where (x > 0 || y > @@ -1128,7 +1139,7 @@ ACE_Oneshot_Acceptor::handle_input (ACE_HANDLE // created handle. This is because the newly created handle will // inherit the properties of the listen handle, including its event // associations. - int reset_new_handle = this->reactor ()->uses_event_associations (); + bool const reset_new_handle = this->reactor ()->uses_event_associations (); // There is a use-case whereby this object will be gone upon return // from shared_accept - if the Svc_Handler deletes this Oneshot_Acceptor @@ -1233,4 +1244,3 @@ ACE_Oneshot_Acceptor::operator ACE_PEER_ACCEPT ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ACCEPTOR_CPP */ - diff --git a/dep/include/ace/Acceptor.h b/externals/ace/Acceptor.h similarity index 91% rename from dep/include/ace/Acceptor.h rename to externals/ace/Acceptor.h index 8f0f16935fb..64cf488b9d4 100644 --- a/dep/include/ace/Acceptor.h +++ b/externals/ace/Acceptor.h @@ -4,7 +4,7 @@ /** * @file Acceptor.h * - * $Id: Acceptor.h 81460 2008-04-28 11:34:23Z elliott_c $ + * $Id: Acceptor.h 88800 2010-02-01 23:18:34Z shuston $ * * @author Douglas C. Schmidt */ @@ -89,7 +89,7 @@ public: * @param use_select Affects behavior when called back by the reactor * when a connection can be accepted. If non-zero, * this object will accept all pending connections, - * intead of just the one that triggered the reactor + * instead of just the one that triggered the reactor * callback. Uses ACE_OS::select() internally to * detect any remaining acceptable connections. * The default is 1. @@ -128,7 +128,7 @@ public: * @param use_select Affects behavior when called back by the reactor * when a connection can be accepted. If non-zero, * this object will accept all pending connections, - * intead of just the one that triggered the reactor + * instead of just the one that triggered the reactor * callback. Uses ACE_OS::select() internally to * detect any remaining acceptable connections. * The default is 1. @@ -187,7 +187,7 @@ protected: /** * Bridge method for accepting the new connection into the - * . The default behavior delegates to the + * @a svc_handler. The default behavior delegates to the * PEER_ACCEPTOR::accept. */ virtual int accept_svc_handler (SVC_HANDLER *svc_handler); @@ -339,7 +339,7 @@ public: * @param use_select Affects behavior when called back by the reactor * when a connection can be accepted. If non-zero, * this object will accept all pending connections, - * intead of just the one that triggered the reactor + * instead of just the one that triggered the reactor * callback. Uses ACE_OS::select() internally to * detect any remaining acceptable connections. * The default is 1. @@ -503,21 +503,30 @@ protected: * @class ACE_Oneshot_Acceptor * * @brief Generic factory for passively connecting clients and creating - * exactly one service handler (SVC_HANDLER). + * exactly one service handler of the type SVC_HANDLER specified in the + * template. * - * This class works similarly to the regular {ACE_Acceptor}, + * This class works similarly to the regular ACE_Acceptor, but * with the following differences: - * 1. This class doesn't automagically register {this} with the - * {ACE_Reactor} since it expects to have its {accept} method - * called directly. However, it stashes the {ACE_Reactor} - * pointer away in case it's needed later to finish accepting - * a connection asynchronously. - * 2. The class doesn't need an {ACE_Creation_Strategy} (since - * the user supplies the SVC_HANDLER) or an - * {ACE_Accept_Strategy} (since this class only accepts one - * connection and then removes all traces of itself from the - * {ACE_Reactor} if it was registered for asynchronous - * accepts). + * -# ACE_Oneshot_Acceptor doesn't automatically register itself with the + * ACE_Reactor; the caller is expected to call the accept() method + * directly. Since a later call to accept() may require a reactor, + * the constructor and open() methods both accept an ACE_Reactor pointer + * which is saved in case it's needed in accept(). + * -# ACE_Oneshot_Acceptor doesn't need an ACE_Creation_Strategy (because + * the user supplies the SVC_HANDLER) or an ACE_Accept_Strategy (because + * this class only accepts one connection and then removes all traces of + * itself from the ACE_Reactor if it was registered for asynchronous + * accepts). + * + * The usage model for ACE_Oneshot_Acceptor is: + * - Instantiate an object and establish its local address to listen at. + * This can be accomplished using either the address-accepting constructor + * (but there's no error indication) or the default constructor followed + * by a call to open(). + * - Call the accept() method. This will attempt to accept a connection + * immediately. If there is no immediately available connection to accept, + * behavior is governed by the ACE_Synch_Options argument passed to open(). */ template class ACE_Oneshot_Acceptor : public ACE_Service_Object @@ -535,10 +544,10 @@ public: /** * Initialize the appropriate strategies for concurrency and then - * open the {peer_acceptor} at the designated {local_addr}. Note - * that unlike the {ACE_Acceptor} and {ACE_Strategy_Acceptor}, this - * method does NOT register {this} acceptor with the {reactor} at - * this point -- it just stashes the {reactor} away in case it's + * open the acceptor at the designated @a local_addr. Note + * that unlike ACE_Acceptor and ACE_Strategy_Acceptor, this + * method does NOT register this acceptor with the @a reactor at + * this point -- the @a reactor parameter is saved in case it's * needed later. */ ACE_Oneshot_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, @@ -547,10 +556,10 @@ public: /** * Initialize the appropriate strategies for concurrency and then - * open the {peer_acceptor} at the designated {local_addr}. Note - * that unlike the {ACE_Acceptor} and {ACE_Strategy_Acceptor}, this - * method does NOT register {this} acceptor with the {reactor} at - * this point -- it just stashes the {reactor} away in case it's + * open the acceptor at the designated @a local_addr. Note + * that unlike ACE_Acceptor and ACE_Strategy_Acceptor, this + * method does NOT register this acceptor with the @a reactor at + * this point -- the @a reactor parameter is saved in case it's * needed later. */ int open (const ACE_PEER_ACCEPTOR_ADDR &, @@ -566,8 +575,8 @@ public: virtual int accept (SVC_HANDLER * = 0, ACE_PEER_ACCEPTOR_ADDR *remote_addr = 0, const ACE_Synch_Options &synch_options = ACE_Synch_Options::defaults, - int restart = 1, - int reset_new_handle = 0); + bool restart = true, + bool reset_new_handle = false); /// Cancel a oneshot acceptor that was started asynchronously. virtual int cancel (void); @@ -603,8 +612,8 @@ protected: int shared_accept (SVC_HANDLER *svc_handler, ACE_PEER_ACCEPTOR_ADDR *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle); + bool restart, + bool reset_new_handle); // = Demultiplexing hooks. /// Returns the listening acceptor's {ACE_HANDLE}. @@ -652,13 +661,13 @@ private: */ int register_handler (SVC_HANDLER *svc_handler, const ACE_Synch_Options &options, - int restart); + bool restart); /// Hold the svc_handler_ across asynchrony boundaries. SVC_HANDLER *svc_handler_; /// Hold the restart flag across asynchrony boundaries. - int restart_; + bool restart_; /// Factory that establishes connections passively. ACE_PEER_ACCEPTOR peer_acceptor_; @@ -684,4 +693,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ACCEPTOR_H */ - diff --git a/dep/src/ace/Activation_Queue.cpp b/externals/ace/Activation_Queue.cpp similarity index 97% rename from dep/src/ace/Activation_Queue.cpp rename to externals/ace/Activation_Queue.cpp index 9701af2e236..37be7a46a7a 100644 --- a/dep/src/ace/Activation_Queue.cpp +++ b/externals/ace/Activation_Queue.cpp @@ -11,7 +11,7 @@ ACE_RCSID (ace, Activation_Queue, - "$Id: Activation_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Activation_Queue.cpp 84565 2009-02-23 08:20:39Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -23,7 +23,7 @@ ACE_Activation_Queue::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_queue_ = %d\n"), this->delete_queue_)); - ACE_DEBUG ((LM_INFO, ACE_TEXT ("queue_: \n"))); + ACE_DEBUG ((LM_INFO, ACE_TEXT ("queue_:\n"))); if (this->queue_) this->queue_->dump(); else @@ -136,4 +136,3 @@ ACE_Activation_Queue::enqueue (ACE_Method_Request *mr, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Activation_Queue.h b/externals/ace/Activation_Queue.h similarity index 99% rename from dep/include/ace/Activation_Queue.h rename to externals/ace/Activation_Queue.h index 69197c1b72d..454640474c1 100644 --- a/dep/include/ace/Activation_Queue.h +++ b/externals/ace/Activation_Queue.h @@ -171,4 +171,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ACTIVATION_QUEUE_H */ - diff --git a/dep/include/ace/Activation_Queue.inl b/externals/ace/Activation_Queue.inl similarity index 100% rename from dep/include/ace/Activation_Queue.inl rename to externals/ace/Activation_Queue.inl diff --git a/dep/src/ace/Active_Map_Manager.cpp b/externals/ace/Active_Map_Manager.cpp similarity index 99% rename from dep/src/ace/Active_Map_Manager.cpp rename to externals/ace/Active_Map_Manager.cpp index 0f3d5485cde..6ec891b5d10 100644 --- a/dep/src/ace/Active_Map_Manager.cpp +++ b/externals/ace/Active_Map_Manager.cpp @@ -7,4 +7,3 @@ ACE_RCSID(ace, Active_Map_Manager, "$Id: Active_Map_Manager.cpp 80826 2008-03-04 #if !defined (__ACE_INLINE__) #include "ace/Active_Map_Manager.inl" #endif /* __ACE_INLINE__ */ - diff --git a/dep/include/ace/Active_Map_Manager.h b/externals/ace/Active_Map_Manager.h similarity index 96% rename from dep/include/ace/Active_Map_Manager.h rename to externals/ace/Active_Map_Manager.h index c72d6dbba4c..744abc0df03 100644 --- a/dep/include/ace/Active_Map_Manager.h +++ b/externals/ace/Active_Map_Manager.h @@ -4,12 +4,13 @@ /** * @file Active_Map_Manager.h * - * $Id: Active_Map_Manager.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Active_Map_Manager.h 83956 2008-12-03 07:57:38Z johnnyw $ * * @author Irfan Pyarali */ //============================================================================= + #ifndef ACE_ACTIVE_MAP_MANAGER_H #define ACE_ACTIVE_MAP_MANAGER_H #include /**/ "ace/pre.h" @@ -77,7 +78,7 @@ public: // = This really should be protected but because of template // friends, they are not. - /// Increment the number. + /// Increment the slot_generation number. void increment_slot_generation_count (void); private: @@ -113,4 +114,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ACTIVE_MAP_MANAGER_H */ - diff --git a/dep/include/ace/Active_Map_Manager.inl b/externals/ace/Active_Map_Manager.inl similarity index 100% rename from dep/include/ace/Active_Map_Manager.inl rename to externals/ace/Active_Map_Manager.inl diff --git a/dep/src/ace/Active_Map_Manager_T.cpp b/externals/ace/Active_Map_Manager_T.cpp similarity index 99% rename from dep/src/ace/Active_Map_Manager_T.cpp rename to externals/ace/Active_Map_Manager_T.cpp index 1d87e44bc54..732cc295117 100644 --- a/dep/src/ace/Active_Map_Manager_T.cpp +++ b/externals/ace/Active_Map_Manager_T.cpp @@ -20,4 +20,3 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Active_Map_Manager) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ACTIVE_MAP_MANAGER_T_CPP */ - diff --git a/dep/include/ace/Active_Map_Manager_T.h b/externals/ace/Active_Map_Manager_T.h similarity index 88% rename from dep/include/ace/Active_Map_Manager_T.h rename to externals/ace/Active_Map_Manager_T.h index 660f0bbbec4..80eaada26a1 100644 --- a/dep/include/ace/Active_Map_Manager_T.h +++ b/externals/ace/Active_Map_Manager_T.h @@ -4,12 +4,13 @@ /** * @file Active_Map_Manager_T.h * - * $Id: Active_Map_Manager_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Active_Map_Manager_T.h 84316 2009-02-03 19:46:05Z johnnyw $ * * @author Irfan Pyarali */ //============================================================================= + #ifndef ACE_ACTIVE_MAP_MANAGER_T_H #define ACE_ACTIVE_MAP_MANAGER_T_H #include /**/ "ace/pre.h" @@ -52,22 +53,22 @@ public: typedef REVERSE_ITERATOR reverse_iterator; // = Initialization and termination methods. - /// Initialize a with the ACE_DEFAULT_MAP_SIZE. + /// Initialize a Active_Map_Manager with the ACE_DEFAULT_MAP_SIZE. ACE_Active_Map_Manager (ACE_Allocator *alloc = 0); - /// Initialize a with @a size entries. + /// Initialize a Active_Map_Manager with @a size entries. ACE_Active_Map_Manager (size_t size, ACE_Allocator *alloc = 0); - /// Close down a and release dynamically + /// Close down a Active_Map_Manager and release dynamically /// allocated resources. ~ACE_Active_Map_Manager (void); - /// Initialize a with size @a length. + /// Initialize a Active_Map_Manager with size @a length. int open (size_t length = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0); - /// Close down a and release dynamically + /// Close down a Active_Map_Manager and release dynamically /// allocated resources. int close (void); @@ -83,8 +84,8 @@ public: /** * Reserves a slot in the internal structure and returns the key and * a pointer to the value. User should place their @a value into - * <*internal_value>. This method is useful in reducing the number - * of copies required in some cases. Note that is + * @a internal_value. This method is useful in reducing the number + * of copies required in some cases. Note that @a internal_value is * only a temporary pointer and will change when the map resizes. * Therefore, the user should use the pointer immediately and not * hold on to it. @@ -125,8 +126,8 @@ public: /** * Locate @a value associated with @a key. The value is returned via - * and hence a copy is saved. Note that - * is only a temporary pointer and will change when + * @a internal_value and hence a copy is saved. Note that + * @a internal_value is only a temporary pointer and will change when * the map resizes. Therefore, the user should use the pointer * immediately and not hold on to it. */ @@ -147,8 +148,8 @@ public: /** * Locate @a value associated with @a key. The value is returned via - * and hence a copy is saved. Note that - * is only a temporary pointer and will change when + * @a internal_value and hence a copy is saved. Note that + * @a internal_value is only a temporary pointer and will change when * the map resizes or when this slot is reused. Therefore, the user * should use the pointer immediately and not hold on to it. */ @@ -208,4 +209,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ACTIVE_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Active_Map_Manager_T.inl b/externals/ace/Active_Map_Manager_T.inl similarity index 100% rename from dep/include/ace/Active_Map_Manager_T.inl rename to externals/ace/Active_Map_Manager_T.inl diff --git a/dep/src/ace/Addr.cpp b/externals/ace/Addr.cpp similarity index 91% rename from dep/src/ace/Addr.cpp rename to externals/ace/Addr.cpp index 6944bfea740..af78d91b9ca 100644 --- a/dep/src/ace/Addr.cpp +++ b/externals/ace/Addr.cpp @@ -1,10 +1,10 @@ -// $Id: Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Addr.cpp 84619 2009-02-26 12:26:16Z johnnyw $ #include "ace/Addr.h" ACE_RCSID (ace, Addr, - "$Id: Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Addr.cpp 84619 2009-02-26 12:26:16Z johnnyw $") #if !defined (__ACE_INLINE__) #include "ace/Addr.inl" @@ -21,6 +21,7 @@ const ACE_Addr ACE_Addr::sap_any (AF_ANY, -1); ACE_ALLOC_HOOK_DEFINE(ACE_Addr) + // Initializes instance variables. Note that 0 is an unspecified // protocol family type... @@ -68,4 +69,3 @@ ACE_Addr::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Addr.h b/externals/ace/Addr.h similarity index 99% rename from dep/include/ace/Addr.h rename to externals/ace/Addr.h index fa9b5d757b6..e58ffe2c0f5 100644 --- a/dep/include/ace/Addr.h +++ b/externals/ace/Addr.h @@ -101,4 +101,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ADDR_H */ - diff --git a/dep/include/ace/Addr.inl b/externals/ace/Addr.inl similarity index 81% rename from dep/include/ace/Addr.inl rename to externals/ace/Addr.inl index 44fd495a6e9..0ff355eaeb7 100644 --- a/dep/include/ace/Addr.inl +++ b/externals/ace/Addr.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Addr.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Addr.inl 87295 2009-11-02 14:45:59Z johnnyw $ // Return the address of the address. @@ -20,32 +20,28 @@ ACE_Addr::operator != (const ACE_Addr &sap) const sap.addr_size_ != this->addr_size_ ); } -// Return the size of the address. - +/// Return the size of the address. ACE_INLINE int ACE_Addr::get_size (void) const { return this->addr_size_; } -// Sets the size of the address. - +/// Sets the size of the address. ACE_INLINE void ACE_Addr::set_size (int size) { this->addr_size_ = size; } -// Return the type of the address. - +/// Return the type of the address. ACE_INLINE int ACE_Addr::get_type (void) const { return this->addr_type_; } -// Set the type of the address. - +/// Set the type of the address. ACE_INLINE void ACE_Addr::set_type (int type) { diff --git a/dep/src/ace/Arg_Shifter.cpp b/externals/ace/Arg_Shifter.cpp similarity index 97% rename from dep/src/ace/Arg_Shifter.cpp rename to externals/ace/Arg_Shifter.cpp index da1337d9f4b..5a7182c3423 100644 --- a/dep/src/ace/Arg_Shifter.cpp +++ b/externals/ace/Arg_Shifter.cpp @@ -9,7 +9,7 @@ ACE_RCSID (ace, Arg_Shifter, - "$Id: Arg_Shifter.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Arg_Shifter.cpp 83749 2008-11-14 18:39:10Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -133,8 +133,7 @@ ACE_Arg_Shifter_T::cur_arg_strncasecmp (const CHAR_TYPE *flag) flag, flag_length) == 0) { - if (ACE_OS::strlen(temp_[current_index_]) == - flag_length) + if (ACE_OS::strlen(temp_[current_index_]) == flag_length) { // match and lengths are equal return 0; @@ -228,4 +227,3 @@ ACE_Arg_Shifter_T::num_ignored_args (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ATOMIC_OP_T_CPP */ - diff --git a/dep/include/ace/Arg_Shifter.h b/externals/ace/Arg_Shifter.h similarity index 97% rename from dep/include/ace/Arg_Shifter.h rename to externals/ace/Arg_Shifter.h index b5700c9f98f..2e5f0b0f5e7 100644 --- a/dep/include/ace/Arg_Shifter.h +++ b/externals/ace/Arg_Shifter.h @@ -4,7 +4,7 @@ /** * @file Arg_Shifter.h * - * $Id: Arg_Shifter.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Arg_Shifter.h 83891 2008-11-28 11:01:50Z johnnyw $ * * @author Seth Widoff */ @@ -106,7 +106,7 @@ public: * If the current argument does not match flag * If there is no parameter found after a 'matched' flag * - * If the flag is matched and the flag and paramter DO NOT RUN + * If the flag is matched and the flag and parameter DO NOT RUN * together, the flag is consumed, the parameter is returned, * and the new current argument is the parameter value. * ie '-foobarflag VALUE' leaves the new cur arg == "VALUE" @@ -118,7 +118,7 @@ public: const CHAR_TYPE *get_the_parameter (const CHAR_TYPE* flag); /** - * Check if the current argument matches (case insensitive) + * Check if the current argument matches (case insensitive) @a flag * * ------------------------------------------------------------ * @@ -219,4 +219,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ARG_SHIFTER_H */ - diff --git a/dep/src/ace/Argv_Type_Converter.cpp b/externals/ace/Argv_Type_Converter.cpp similarity index 88% rename from dep/src/ace/Argv_Type_Converter.cpp rename to externals/ace/Argv_Type_Converter.cpp index 3679fbc0737..1ebeeb4cc30 100644 --- a/dep/src/ace/Argv_Type_Converter.cpp +++ b/externals/ace/Argv_Type_Converter.cpp @@ -1,4 +1,4 @@ -// $Id: Argv_Type_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Argv_Type_Converter.cpp 85772 2009-06-23 20:14:18Z mitza $ #include "ace/Argv_Type_Converter.h" @@ -8,7 +8,7 @@ ACE_RCSID (ace, Argv_Type_Converter, - "$Id: Argv_Type_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Argv_Type_Converter.cpp 85772 2009-06-23 20:14:18Z mitza $") #include "ace/OS_NS_string.h" #include "ace/OS_Errno.h" @@ -32,6 +32,7 @@ ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, wchar_t** argv) } #endif // ACE_USES_WCHAR + ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, char **argv) : saved_argc_(argc), char_argv_(argv) @@ -103,14 +104,14 @@ ACE_Argv_Type_Converter::initialize (void) } } + void ACE_Argv_Type_Converter::align_char_with_wchar (void) { - int wchar_argv_index = 0; - wchar_t* match_argv = this->wchar_argv_[0]; // pick the initial entry - - while (wchar_argv_index < this->saved_argc_) + for (int wchar_argv_index = 0; wchar_argv_index < this->saved_argc_; + ++wchar_argv_index) { + wchar_t *match_argv = this->wchar_argv_[wchar_argv_index]; // if n'th entries of both argv lists are different if (ACE_OS::strcmp (this->char_argv_[wchar_argv_index], ACE_TEXT_ALWAYS_CHAR (match_argv)) != 0) @@ -130,9 +131,6 @@ ACE_Argv_Type_Converter::align_char_with_wchar (void) } } } - - // move to the next wchar argv list entry - match_argv = this->wchar_argv_[++wchar_argv_index]; } this->cleanup (); @@ -141,11 +139,10 @@ ACE_Argv_Type_Converter::align_char_with_wchar (void) void ACE_Argv_Type_Converter::align_wchar_with_char (void) { - int char_argv_index = 0; - char* match_argv = this->char_argv_[0]; // pick the initial entry - - while (char_argv_index < saved_argc_) + for (int char_argv_index = 0; char_argv_index < saved_argc_; + ++char_argv_index) { + char* match_argv = this->char_argv_[char_argv_index]; // if n'th entries of both argv lists are different if (ACE_OS::strcmp ( ACE_TEXT_ALWAYS_CHAR (this->wchar_argv_[char_argv_index]), @@ -166,9 +163,6 @@ ACE_Argv_Type_Converter::align_wchar_with_char (void) } } } - - // move to the next wchar argv list entry - match_argv = this->char_argv_[++char_argv_index]; } this->cleanup(); @@ -200,4 +194,3 @@ ACE_Argv_Type_Converter::cleanup (void) #endif // ACE_USES_WCHAR ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Argv_Type_Converter.h b/externals/ace/Argv_Type_Converter.h similarity index 92% rename from dep/include/ace/Argv_Type_Converter.h rename to externals/ace/Argv_Type_Converter.h index 957a431a6c3..d41d839b671 100644 --- a/dep/include/ace/Argv_Type_Converter.h +++ b/externals/ace/Argv_Type_Converter.h @@ -4,7 +4,7 @@ /** * @file Argv_Type_Converter.h * - * $Id: Argv_Type_Converter.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Argv_Type_Converter.h 83891 2008-11-28 11:01:50Z johnnyw $ * * @author Si Mong Park */ @@ -29,7 +29,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * * @brief To convert 'char' input/command line parameter to 'wchar_t'. * - * This class is to convert 'char' type command line paramter to + * This class is to convert 'char' type command line parameter to * wide-character (wchar_t) format and stores the copy of it. * This is useful for all classes that use 'char**' argv but cannot * be converted into 'ACE_TCHAR**' version. @@ -54,7 +54,7 @@ public: /// Returns the pointer of ASCII (char) command line. char** get_ASCII_argv (void); - /// Returns the number of sub paramters (argc). + /// Returns the number of sub parameters (argc). int& get_argc (void); private: @@ -83,7 +83,7 @@ private: #endif // ACE_USES_WCHAR private: - /// Original number of input paramter, same as 'argc'. + /// Original number of input parameter, same as 'argc'. int &saved_argc_; /// Data member pointer that contains converted argv in ACE_ANTI_TCHAR. @@ -117,4 +117,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ARGV_TYPE_CONVERTER_H */ - diff --git a/dep/include/ace/Argv_Type_Converter.inl b/externals/ace/Argv_Type_Converter.inl similarity index 100% rename from dep/include/ace/Argv_Type_Converter.inl rename to externals/ace/Argv_Type_Converter.inl diff --git a/dep/include/ace/Array.h b/externals/ace/Array.h similarity index 99% rename from dep/include/ace/Array.h rename to externals/ace/Array.h index 8ef7f094ac8..3caaa7b719b 100644 --- a/dep/include/ace/Array.h +++ b/externals/ace/Array.h @@ -27,4 +27,3 @@ #include /**/ "ace/post.h" #endif /* ACE_ARRAY_H */ - diff --git a/dep/src/ace/Array_Base.cpp b/externals/ace/Array_Base.cpp similarity index 99% rename from dep/src/ace/Array_Base.cpp rename to externals/ace/Array_Base.cpp index 8136d2e5309..49e42e1ad98 100644 --- a/dep/src/ace/Array_Base.cpp +++ b/externals/ace/Array_Base.cpp @@ -233,4 +233,3 @@ ACE_Array_Iterator::next (T *&item) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ARRAY_BASE_CPP */ - diff --git a/dep/include/ace/Array_Base.h b/externals/ace/Array_Base.h similarity index 94% rename from dep/include/ace/Array_Base.h rename to externals/ace/Array_Base.h index feef89eda01..0d6620a6ca6 100644 --- a/dep/include/ace/Array_Base.h +++ b/externals/ace/Array_Base.h @@ -4,7 +4,7 @@ /** * @file Array_Base.h * - * $Id: Array_Base.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Array_Base.h 84477 2009-02-16 13:30:38Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -118,7 +118,7 @@ public: size_type size (void) const; /** - * Changes the size of the array to match . + * Changes the size of the array to match @a new_size. * It copies the old contents into the new array. * Return -1 on failure. */ @@ -128,7 +128,7 @@ public: size_type max_size (void) const; /** - * Changes the size of the array to match . + * Changes the size of the array to match @a new_size. * It copies the old contents into the new array. * Return -1 on failure. * It does not affect new_size @@ -166,11 +166,11 @@ public: protected: /// Returns 1 if @a slot is within range, i.e., 0 >= @a slot < - /// , else returns 0. + /// @c cur_size_, else returns 0. bool in_range (size_type slot) const; - /// Maximum size of the array, i.e., the total number of elements - /// in . + /// Maximum size of the array, i.e., the total number of @c T elements + /// in @c array_. size_type max_size_; /** @@ -212,7 +212,7 @@ public: // = Iteration methods. - /// Pass back the that hasn't been seen in the Array. + /// Pass back the @a next_item that hasn't been seen in the Array. /// Returns 0 when all items have been seen, else 1. int next (T *&next_item); @@ -254,4 +254,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ARRAY_BASE_H */ - diff --git a/dep/include/ace/Array_Base.inl b/externals/ace/Array_Base.inl similarity index 100% rename from dep/include/ace/Array_Base.inl rename to externals/ace/Array_Base.inl diff --git a/dep/src/ace/Array_Map.cpp b/externals/ace/Array_Map.cpp similarity index 99% rename from dep/src/ace/Array_Map.cpp rename to externals/ace/Array_Map.cpp index c66a21ddc73..5530a8b54b6 100644 --- a/dep/src/ace/Array_Map.cpp +++ b/externals/ace/Array_Map.cpp @@ -297,4 +297,3 @@ operator< (ACE_Array_Map const & lhs, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ARRAY_MAP_CPP */ - diff --git a/dep/include/ace/Array_Map.h b/externals/ace/Array_Map.h similarity index 98% rename from dep/include/ace/Array_Map.h rename to externals/ace/Array_Map.h index f7b79a4be39..1515ea45529 100644 --- a/dep/include/ace/Array_Map.h +++ b/externals/ace/Array_Map.h @@ -4,7 +4,7 @@ /** * @file Array_Map.h * - * $Id: Array_Map.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Array_Map.h 84136 2009-01-12 11:01:17Z johnnyw $ * * Light weight array-based map with fast iteration but linear * (i.e. O(n)) search times. STL-style interface is exposed. @@ -16,6 +16,7 @@ */ //============================================================================= + #ifndef ACE_ARRAY_MAP_H #define ACE_ARRAY_MAP_H @@ -40,7 +41,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * (i.e. O(n)) search times. * * Map implementation that focuses on small footprint and fast - * iteration. Search times are, however, linear (O(n)) meaning that + * iteration. Search times are, however, linear (O(n)) meaning that * this map isn't suitable for large data sets that will be searched * in performance critical areas of code. Iteration over large data * sets, however, is faster than linked list-based maps, for example, @@ -297,4 +298,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ARRAY_MAP_H */ - diff --git a/dep/include/ace/Array_Map.inl b/externals/ace/Array_Map.inl similarity index 100% rename from dep/include/ace/Array_Map.inl rename to externals/ace/Array_Map.inl diff --git a/dep/src/ace/Assert.cpp b/externals/ace/Assert.cpp similarity index 99% rename from dep/src/ace/Assert.cpp rename to externals/ace/Assert.cpp index 3faf3426d07..4a71c9e5a9d 100644 --- a/dep/src/ace/Assert.cpp +++ b/externals/ace/Assert.cpp @@ -22,4 +22,3 @@ __ace_assert(const char *file, int line, const ACE_TCHAR *expression) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Assert.h b/externals/ace/Assert.h similarity index 81% rename from dep/include/ace/Assert.h rename to externals/ace/Assert.h index 5bdf56f0531..89363d4c69a 100644 --- a/dep/include/ace/Assert.h +++ b/externals/ace/Assert.h @@ -4,7 +4,7 @@ /** * @file Assert.h * - * $Id: Assert.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Assert.h 82808 2008-09-23 11:27:27Z smcqueen $ * * @author Douglas C. Schmidt */ @@ -23,17 +23,18 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Export void __ace_assert(const char *file, int line, const ACE_TCHAR *expression); ACE_END_VERSIONED_NAMESPACE_DECL +#define ACE_TEST_ASSERT(X) \ + ((X) \ + ? static_cast(0) \ + : ACE_VERSIONED_NAMESPACE_NAME::__ace_assert(__FILE__, __LINE__, ACE_TEXT_CHAR_TO_TCHAR (#X))) + #if defined (ACE_NDEBUG) #define ACE_ASSERT(x) \ (static_cast(0)) #else -#define ACE_ASSERT(X) \ - ((X) \ - ? static_cast(0) \ - : ACE_VERSIONED_NAMESPACE_NAME::__ace_assert(__FILE__, __LINE__, ACE_TEXT_CHAR_TO_TCHAR (#X))) +#define ACE_ASSERT(X) ACE_TEST_ASSERT(X) #endif /* ACE_NDEBUG */ #include /**/ "ace/post.h" #endif /* ACE_ASSERT */ - diff --git a/dep/src/ace/Asynch_Acceptor.cpp b/externals/ace/Asynch_Acceptor.cpp similarity index 98% rename from dep/src/ace/Asynch_Acceptor.cpp rename to externals/ace/Asynch_Acceptor.cpp index 50122caa9a5..3afb27c7b7d 100644 --- a/dep/src/ace/Asynch_Acceptor.cpp +++ b/externals/ace/Asynch_Acceptor.cpp @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: Asynch_Acceptor.cpp 82444 2008-07-28 13:33:07Z johnnyw $ +// $Id: Asynch_Acceptor.cpp 85213 2009-04-29 16:34:20Z shuston $ #ifndef ACE_ASYNCH_ACCEPTOR_C #define ACE_ASYNCH_ACCEPTOR_C @@ -10,7 +10,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -ACE_RCSID(ace, Asynch_Acceptor, "$Id: Asynch_Acceptor.cpp 82444 2008-07-28 13:33:07Z johnnyw $") +ACE_RCSID(ace, Asynch_Acceptor, "$Id: Asynch_Acceptor.cpp 85213 2009-04-29 16:34:20Z shuston $") #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) // This only works on platforms that support async i/o. @@ -338,7 +338,7 @@ ACE_Asynch_Acceptor::handle_accept (const ACE_Asynch_Accept::Result &re && result.error () != ECANCELED #endif ) - this->accept (this->bytes_to_read_); + this->accept (this->bytes_to_read_, result.act ()); } template int @@ -512,4 +512,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS */ #endif /* ACE_ASYNCH_ACCEPTOR_C */ - diff --git a/dep/include/ace/Asynch_Acceptor.h b/externals/ace/Asynch_Acceptor.h similarity index 99% rename from dep/include/ace/Asynch_Acceptor.h rename to externals/ace/Asynch_Acceptor.h index e14126d3f1f..29872d59482 100644 --- a/dep/include/ace/Asynch_Acceptor.h +++ b/externals/ace/Asynch_Acceptor.h @@ -279,4 +279,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ #include /**/ "ace/post.h" #endif /* ACE_ASYNCH_ACCEPTOR_H */ - diff --git a/dep/src/ace/Asynch_Connector.cpp b/externals/ace/Asynch_Connector.cpp similarity index 99% rename from dep/src/ace/Asynch_Connector.cpp rename to externals/ace/Asynch_Connector.cpp index 3a5fac78068..3d493069f00 100644 --- a/dep/src/ace/Asynch_Connector.cpp +++ b/externals/ace/Asynch_Connector.cpp @@ -294,4 +294,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS */ #endif /* ACE_ASYNCH_CONNECTOR_CPP */ - diff --git a/dep/include/ace/Asynch_Connector.h b/externals/ace/Asynch_Connector.h similarity index 99% rename from dep/include/ace/Asynch_Connector.h rename to externals/ace/Asynch_Connector.h index 569242cba22..7c7969cc20d 100644 --- a/dep/include/ace/Asynch_Connector.h +++ b/externals/ace/Asynch_Connector.h @@ -77,6 +77,7 @@ public: */ virtual int cancel (void); + /** * Template method to validate peer before service is opened. * This method is called when the connection attempt completes, @@ -127,6 +128,7 @@ protected: /// This is called when an outstanding accept completes. virtual void handle_connect (const ACE_Asynch_Connect::Result &result); + /// This parses the address from read buffer. void parse_address (const ACE_Asynch_Connect::Result &result, ACE_INET_Addr &remote_address, @@ -167,4 +169,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS */ #include /**/ "ace/post.h" #endif /* ACE_ASYNCH_CONNECTOR_H */ - diff --git a/dep/src/ace/Asynch_IO.cpp b/externals/ace/Asynch_IO.cpp similarity index 99% rename from dep/src/ace/Asynch_IO.cpp rename to externals/ace/Asynch_IO.cpp index ad7dedfc671..26bba31a3a9 100644 --- a/dep/src/ace/Asynch_IO.cpp +++ b/externals/ace/Asynch_IO.cpp @@ -710,6 +710,8 @@ ACE_Asynch_Accept::Result::implementation (void) const return this->implementation_; } + + // ********************************************************************* ACE_Asynch_Connect::ACE_Asynch_Connect (void) @@ -793,6 +795,7 @@ ACE_Asynch_Connect::Result::connect_handle (void) const return this->implementation ()->connect_handle (); } + ACE_Asynch_Connect_Result_Impl * ACE_Asynch_Connect::Result::implementation (void) const { @@ -1188,6 +1191,7 @@ ACE_Service_Handler::open (ACE_HANDLE, { } + // ************************************************************ ACE_Asynch_Read_Dgram::ACE_Asynch_Read_Dgram (void) @@ -1301,6 +1305,7 @@ ACE_Asynch_Read_Dgram::Result::implementation (void) const // ************************************************************ + ACE_Asynch_Write_Dgram::ACE_Asynch_Write_Dgram (void) : implementation_ (0) { @@ -1407,4 +1412,3 @@ ACE_Asynch_Write_Dgram::Result::~Result (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ - diff --git a/dep/include/ace/Asynch_IO.h b/externals/ace/Asynch_IO.h similarity index 97% rename from dep/include/ace/Asynch_IO.h rename to externals/ace/Asynch_IO.h index 00b24b82e74..641e22a8de4 100644 --- a/dep/include/ace/Asynch_IO.h +++ b/externals/ace/Asynch_IO.h @@ -4,7 +4,7 @@ /** * @file Asynch_IO.h * - * $Id: Asynch_IO.h 81870 2008-06-09 20:53:53Z shuston $ + * $Id: Asynch_IO.h 84837 2009-03-16 13:01:15Z johnnyw $ * * This works on Win32 (defined (ACE_WIN32) && !defined * (ACE_HAS_WINCE)) platforms and on POSIX4 platforms with {aio_*} @@ -167,6 +167,7 @@ public: */ int signal_number (void) const; + /// Destructor. virtual ~ACE_Asynch_Result (void); @@ -249,6 +250,7 @@ public: */ int cancel (void); + // = Access methods. /// Return the underlying proactor. @@ -409,6 +411,9 @@ public: /// The implementation class. ACE_Asynch_Read_Stream_Result_Impl *implementation_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Read_Stream &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Read_Stream (const ACE_Asynch_Read_Stream &)) }; // Forward declarations @@ -562,6 +567,9 @@ public: /// Implementation class. ACE_Asynch_Write_Stream_Result_Impl *implementation_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Write_Stream &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Write_Stream (const ACE_Asynch_Write_Stream &)) }; // Forward declarations @@ -710,6 +718,9 @@ public: /// one auto generated by MSVC is flagged as infinitely recursive void operator= (Result &) {} }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Read_File &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Read_File (const ACE_Asynch_Read_File &)) }; // Forward declarations @@ -843,6 +854,9 @@ public: /// one auto generated by MSVC is flagged as infinitely recursive void operator= (Result &) {}; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Write_File &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Write_File (const ACE_Asynch_Write_File &)) }; // Forward declarations @@ -980,6 +994,9 @@ public: /// Impelmentation class. ACE_Asynch_Accept_Result_Impl *implementation_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Accept &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Accept (const ACE_Asynch_Accept &)) }; // Forward declarations class ACE_Asynch_Connect_Result_Impl; @@ -1074,6 +1091,9 @@ public: /// Impelmentation class. ACE_Asynch_Connect_Result_Impl *implementation_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Connect &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Connect (const ACE_Asynch_Connect &)) }; // Forward declarations @@ -1285,8 +1305,12 @@ public: /// Target data structure. ACE_TRANSMIT_FILE_BUFFERS transmit_buffers_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Transmit_File &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Transmit_File (const ACE_Asynch_Transmit_File &)) }; + // Forward declarations class ACE_Asynch_Read_Dgram_Result_Impl; class ACE_Asynch_Read_Dgram_Impl; @@ -1419,6 +1443,9 @@ public: /// The implementation class. ACE_Asynch_Read_Dgram_Result_Impl *implementation_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Read_Dgram &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Read_Dgram (const ACE_Asynch_Read_Dgram &)) }; // Forward declarations @@ -1549,8 +1576,12 @@ public: /// Implementation class. ACE_Asynch_Write_Dgram_Result_Impl *implementation_; }; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Asynch_Write_Dgram &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Asynch_Write_Dgram (const ACE_Asynch_Write_Dgram &)) }; + /** * @class ACE_Handler * @@ -1728,4 +1759,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 || ACE_HAS_AIO_CALLS*/ #include /**/ "ace/post.h" #endif /* ACE_ASYNCH_IO_H */ - diff --git a/dep/src/ace/Asynch_IO_Impl.cpp b/externals/ace/Asynch_IO_Impl.cpp similarity index 99% rename from dep/src/ace/Asynch_IO_Impl.cpp rename to externals/ace/Asynch_IO_Impl.cpp index 5bfc8b4c749..b4b47eda55c 100644 --- a/dep/src/ace/Asynch_IO_Impl.cpp +++ b/externals/ace/Asynch_IO_Impl.cpp @@ -115,4 +115,3 @@ ACE_Asynch_Write_Dgram_Result_Impl::ACE_Asynch_Write_Dgram_Result_Impl (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ - diff --git a/dep/include/ace/Asynch_IO_Impl.h b/externals/ace/Asynch_IO_Impl.h similarity index 99% rename from dep/include/ace/Asynch_IO_Impl.h rename to externals/ace/Asynch_IO_Impl.h index 087a292f813..06eb5c10a87 100644 --- a/dep/include/ace/Asynch_IO_Impl.h +++ b/externals/ace/Asynch_IO_Impl.h @@ -515,6 +515,7 @@ protected: ACE_Asynch_Accept_Result_Impl (void); }; + /** * @class ACE_Asynch_Connect_Impl * @@ -565,6 +566,7 @@ protected: ACE_Asynch_Connect_Result_Impl (void); }; + /** * @class ACE_Asynch_Transmit_File_Impl * @@ -633,6 +635,7 @@ protected: ACE_Asynch_Transmit_File_Result_Impl (void); }; + /** * @class ACE_Asynch_Read_Dgram_Impl * @@ -811,4 +814,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ #include /**/ "ace/post.h" #endif /* ACE_ASYNCH_IO_IMPL_H */ - diff --git a/dep/include/ace/Asynch_IO_Impl.inl b/externals/ace/Asynch_IO_Impl.inl similarity index 99% rename from dep/include/ace/Asynch_IO_Impl.inl rename to externals/ace/Asynch_IO_Impl.inl index 8e37772f5c9..60dc69dfb31 100644 --- a/dep/include/ace/Asynch_IO_Impl.inl +++ b/externals/ace/Asynch_IO_Impl.inl @@ -90,6 +90,7 @@ ACE_Asynch_Connect_Result_Impl::ACE_Asynch_Connect_Result_Impl (void) { } + ACE_INLINE ACE_Asynch_Transmit_File_Impl::ACE_Asynch_Transmit_File_Impl (void) : ACE_Asynch_Operation_Impl () diff --git a/dep/src/ace/Asynch_Pseudo_Task.cpp b/externals/ace/Asynch_Pseudo_Task.cpp similarity index 99% rename from dep/src/ace/Asynch_Pseudo_Task.cpp rename to externals/ace/Asynch_Pseudo_Task.cpp index 891cb0cf4d0..94f0d6980ed 100644 --- a/dep/src/ace/Asynch_Pseudo_Task.cpp +++ b/externals/ace/Asynch_Pseudo_Task.cpp @@ -69,6 +69,8 @@ ACE_Asynch_Pseudo_Task::svc (void) return 0; } + + int ACE_Asynch_Pseudo_Task::register_io_handler (ACE_HANDLE handle, ACE_Event_Handler *handler, @@ -126,4 +128,3 @@ ACE_Asynch_Pseudo_Task::resume_io_handler (ACE_HANDLE handle) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Asynch_Pseudo_Task.h b/externals/ace/Asynch_Pseudo_Task.h similarity index 99% rename from dep/include/ace/Asynch_Pseudo_Task.h rename to externals/ace/Asynch_Pseudo_Task.h index 4c5a94feca4..6e2c3a1d427 100644 --- a/dep/include/ace/Asynch_Pseudo_Task.h +++ b/externals/ace/Asynch_Pseudo_Task.h @@ -71,4 +71,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ASYNCH_PSEUDO_TASK_H */ - diff --git a/dep/src/ace/Atomic_Op.cpp b/externals/ace/Atomic_Op.cpp similarity index 92% rename from dep/src/ace/Atomic_Op.cpp rename to externals/ace/Atomic_Op.cpp index 473c482adcd..10731e3c396 100644 --- a/dep/src/ace/Atomic_Op.cpp +++ b/externals/ace/Atomic_Op.cpp @@ -1,11 +1,11 @@ -// $Id: Atomic_Op.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Atomic_Op.cpp 89905 2010-04-16 13:04:47Z johnnyw $ #include "ace/Atomic_Op.h" #include "ace/OS_NS_unistd.h" ACE_RCSID (ace, Atomic_Op, - "$Id: Atomic_Op.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Atomic_Op.cpp 89905 2010-04-16 13:04:47Z johnnyw $") #if !defined (__ACE_INLINE__) #include "ace/Atomic_Op.inl" @@ -34,8 +34,8 @@ single_cpu_increment (volatile long *value) unsigned long addr = reinterpret_cast (value); asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp + 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_add_long ( reinterpret_cast (value), 1); #elif defined(__GNUC__) && defined(PPC) @@ -58,8 +58,8 @@ single_cpu_decrement (volatile long *value) unsigned long addr = reinterpret_cast (value); asm( "xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp - 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_add_long ( reinterpret_cast (value), -1); #elif defined(__GNUC__) && defined(PPC) @@ -81,8 +81,8 @@ single_cpu_exchange (volatile long *value, long rhs) unsigned long addr = reinterpret_cast (value); asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_swap_long ( reinterpret_cast (value), rhs); #elif defined(__GNUC__) && defined(PPC) @@ -104,8 +104,8 @@ single_cpu_exchange_add (volatile long *value, long rhs) unsigned long addr = reinterpret_cast (value); asm( "xadd %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_swap_add_long ( reinterpret_cast (value), rhs); #elif defined(__GNUC__) && defined(PPC) @@ -147,8 +147,8 @@ multi_cpu_increment (volatile long *value) unsigned long addr = reinterpret_cast (value); asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp + 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_add_long ( reinterpret_cast (value), 1); #else /* ACE_HAS_INTEL_ASSEMBLY*/ @@ -165,8 +165,8 @@ multi_cpu_decrement (volatile long *value) unsigned long addr = reinterpret_cast (value); asm( "lock ; xadd %0, (%1)" : "+r"(tmp) : "r"(addr) ); return tmp - 1; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_add_long ( reinterpret_cast (value), -1); #else /* ACE_HAS_INTEL_ASSEMBLY*/ @@ -183,8 +183,8 @@ multi_cpu_exchange (volatile long *value, long rhs) // The XCHG instruction automatically follows LOCK semantics asm( "xchg %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_swap_long ( reinterpret_cast (value), rhs); #else /* ACE_HAS_INTEL_ASSEMBLY*/ @@ -201,8 +201,8 @@ multi_cpu_exchange_add (volatile long *value, long rhs) unsigned long addr = reinterpret_cast (value); asm( "lock ; xadd %0, (%1)" : "+r"(rhs) : "r"(addr) ); return rhs; -#elif defined (sun) || \ - (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64))) +#elif !defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && (defined (sun) || \ + (defined (__SUNPRO_CC) && (defined (__i386) || defined (__x86_64)))) return ace_atomic_swap_add_long ( reinterpret_cast (value), rhs); #elif defined (WIN32) && !defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) @@ -308,4 +308,3 @@ ACE_Atomic_Op::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ - diff --git a/dep/include/ace/Atomic_Op.h b/externals/ace/Atomic_Op.h similarity index 53% rename from dep/include/ace/Atomic_Op.h rename to externals/ace/Atomic_Op.h index c750999af4c..8ebc6c6d8b9 100644 --- a/dep/include/ace/Atomic_Op.h +++ b/externals/ace/Atomic_Op.h @@ -4,7 +4,7 @@ /** * @file Atomic_Op.h * - * $Id: Atomic_Op.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Atomic_Op.h 89936 2010-04-20 13:04:53Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -43,16 +43,26 @@ # endif /* ACE_HAS_INTERLOCKED_EXCHANGEADD */ # elif defined (ACE_HAS_INTEL_ASSEMBLY) # define ACE_HAS_BUILTIN_ATOMIC_OP +# elif defined (ACE_HAS_VXATOMICLIB) +# define ACE_HAS_BUILTIN_ATOMIC_OP +# elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) && !defined (ACE_HAS_BUILTIN_ATOMIC_OP) +# define ACE_HAS_BUILTIN_ATOMIC_OP # endif /* WIN32 */ #endif /* ACE_HAS_THREADS */ -#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) +// If we have the GCC Atomic builtin support, use it +#if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1) +# undef ACE_HAS_BUILTIN_ATOMIC_OP +#endif + +// Include the templates here. +#include "ace/Atomic_Op_GCC_T.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL +#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) + /** - * @class ACE_Atomic_Op - * * @brief Specialization of ACE_Atomic_Op for platforms that * support atomic integer operations. * @@ -63,64 +73,64 @@ template<> class ACE_Export ACE_Atomic_Op { public: - /// Initialize to 0. + /// Initialize @c value_ to 0. ACE_Atomic_Op (void); - /// Initialize to c. + /// Initialize @c value_ to c. ACE_Atomic_Op (long c); /// Manage copying... ACE_Atomic_Op (const ACE_Atomic_Op &c); - /// Atomically pre-increment . + /// Atomically pre-increment @c value_. long operator++ (void); - /// Atomically post-increment . + /// Atomically post-increment @c value_. long operator++ (int); - /// Atomically increment by rhs. + /// Atomically increment @c value_ by rhs. long operator+= (long rhs); - /// Atomically pre-decrement . + /// Atomically pre-decrement @c value_. long operator-- (void); - /// Atomically post-decrement . + /// Atomically post-decrement @c value_. long operator-- (int); - /// Atomically decrement by rhs. + /// Atomically decrement @c value_ by rhs. long operator-= (long rhs); - /// Atomically compare with rhs. + /// Atomically compare @c value_ with rhs. bool operator== (long rhs) const; - /// Atomically compare with rhs. + /// Atomically compare @c value_ with rhs. bool operator!= (long rhs) const; - /// Atomically check if greater than or equal to rhs. + /// Atomically check if @c value_ greater than or equal to rhs. bool operator>= (long rhs) const; - /// Atomically check if greater than rhs. + /// Atomically check if @c value_ greater than rhs. bool operator> (long rhs) const; - /// Atomically check if less than or equal to rhs. + /// Atomically check if @c value_ less than or equal to rhs. bool operator<= (long rhs) const; - /// Atomically check if less than rhs. + /// Atomically check if @c value_ less than rhs. bool operator< (long rhs) const; - /// Atomically assign rhs to . + /// Atomically assign rhs to @c value_. ACE_Atomic_Op &operator= (long rhs); - /// Atomically assign to . + /// Atomically assign to @c value_. ACE_Atomic_Op &operator= (const ACE_Atomic_Op &rhs); - /// Explicitly return . + /// Explicitly return @c value_. long value (void) const; /// Dump the state of an object. void dump (void) const; - /// Explicitly return (by reference). + /// Explicitly return @c value_ (by reference). volatile long &value_i (void); // ACE_ALLOC_HOOK_DECLARE; @@ -150,8 +160,6 @@ private: }; /** - * @class ACE_Atomic_Op - * * @brief Specialization of ACE_Atomic_Op for platforms that * support atomic integer operations. * @@ -162,64 +170,64 @@ template<> class ACE_Export ACE_Atomic_Op { public: - /// Initialize to 0. + /// Initialize @c value_ to 0. ACE_Atomic_Op (void); - /// Initialize to c. + /// Initialize @c value_ to c. ACE_Atomic_Op (unsigned long c); /// Manage copying... ACE_Atomic_Op (const ACE_Atomic_Op &c); - /// Atomically pre-increment . + /// Atomically pre-increment @c value_. unsigned long operator++ (void); - /// Atomically post-increment . + /// Atomically post-increment @c value_. unsigned long operator++ (int); - /// Atomically increment by rhs. + /// Atomically increment @c value_ by rhs. unsigned long operator+= (unsigned long rhs); - /// Atomically pre-decrement . + /// Atomically pre-decrement @c value_. unsigned long operator-- (void); - /// Atomically post-decrement . + /// Atomically post-decrement @c value_. unsigned long operator-- (int); - /// Atomically decrement by rhs. + /// Atomically decrement @c value_ by rhs. unsigned long operator-= (unsigned long rhs); - /// Atomically compare with rhs. + /// Atomically compare @c value_ with rhs. bool operator== (unsigned long rhs) const; - /// Atomically compare with rhs. + /// Atomically compare @c value_ with rhs. bool operator!= (unsigned long rhs) const; - /// Atomically check if greater than or equal to rhs. + /// Atomically check if @c value_ greater than or equal to rhs. bool operator>= (unsigned long rhs) const; - /// Atomically check if greater than rhs. + /// Atomically check if @c value_ greater than rhs. bool operator> (unsigned long rhs) const; - /// Atomically check if less than or equal to rhs. + /// Atomically check if @c value_ less than or equal to rhs. bool operator<= (unsigned long rhs) const; - /// Atomically check if less than rhs. + /// Atomically check if @c value_ less than rhs. bool operator< (unsigned long rhs) const; - /// Atomically assign rhs to . + /// Atomically assign rhs to @c value_. ACE_Atomic_Op &operator= (unsigned long rhs); - /// Atomically assign to . + /// Atomically assign to @c value_. ACE_Atomic_Op &operator= (const ACE_Atomic_Op &rhs); - /// Explicitly return . + /// Explicitly return @c value_. unsigned long value (void) const; /// Dump the state of an object. void dump (void) const; - /// Explicitly return (by reference). + /// Explicitly return @c value_ (by reference). volatile unsigned long &value_i (void); // ACE_ALLOC_HOOK_DECLARE; @@ -231,9 +239,9 @@ public: private: - // This function cannot be supported by this template specialization. - // If you need access to an underlying lock, use the ACE_Atomic_Op_Ex - // template instead. + /// This function cannot be supported by this template specialization. + /// If you need access to an underlying lock, use the ACE_Atomic_Op_Ex + /// template instead. ACE_Thread_Mutex &mutex (void); private: @@ -248,14 +256,100 @@ private: static long (*exchange_add_fn_) (volatile long *, long); }; -ACE_END_VERSIONED_NAMESPACE_DECL +#endif /* !ACE_HAS_BUILTIN_ATOMIC_OP */ + +#if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1) + +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (int c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (int rhs); +}; + +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (unsigned int c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (unsigned int rhs); +}; + +// If we have built in atomic op, use that, the assignment operator +// is faster for a long/unsinged long +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (long c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (long rhs); +}; + +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (unsigned long c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (unsigned long rhs); +}; + +#if !defined (ACE_LACKS_GCC_ATOMIC_BUILTINS_2) +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (short c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (short rhs); +}; + +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (unsigned short c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (unsigned short rhs); +}; +#endif + +#if !defined (ACE_LACKS_GCC_ATOMIC_BUILTINS_1) +template<> +class ACE_Export ACE_Atomic_Op +: public ACE_Atomic_Op_GCC +{ +public: + ACE_Atomic_Op (void); + ACE_Atomic_Op (bool c); + ACE_Atomic_Op (const ACE_Atomic_Op &c); + ACE_Atomic_Op &operator= (bool rhs); +}; +#endif #endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ +ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/Atomic_Op.inl" #endif /* __ACE_INLINE__ */ #include /**/ "ace/post.h" #endif /*ACE_ATOMIC_OP_H*/ - diff --git a/dep/include/ace/Atomic_Op.inl b/externals/ace/Atomic_Op.inl similarity index 56% rename from dep/include/ace/Atomic_Op.inl rename to externals/ace/Atomic_Op.inl index 8735fa8d85a..6dcade6c04d 100644 --- a/dep/include/ace/Atomic_Op.inl +++ b/externals/ace/Atomic_Op.inl @@ -1,17 +1,24 @@ // -*- C++ -*- // -// $Id: Atomic_Op.inl 80826 2008-03-04 14:51:23Z wotte $ - -#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) +// $Id: Atomic_Op.inl 89905 2010-04-16 13:04:47Z johnnyw $ #if defined (ACE_HAS_INTRINSIC_INTERLOCKED) -# include "ace/os_include/os_intrin.h" - -#pragma intrinsic (_InterlockedExchange, _InterlockedExchangeAdd, _InterlockedIncrement, _InterlockedDecrement) +# include "ace/os_include/os_intrin.h" +# pragma intrinsic (_InterlockedExchange, _InterlockedExchangeAdd, _InterlockedIncrement, _InterlockedDecrement) #endif /* ACE_HAS_INTRINSIC_INTERLOCKED */ +#if defined (ACE_HAS_VXATOMICLIB) +# include +#endif + +#if defined (ACE_HAS_SOLARIS_ATOMIC_LIB) +# include +#endif + ACE_BEGIN_VERSIONED_NAMESPACE_DECL +#if defined (ACE_HAS_BUILTIN_ATOMIC_OP) + ACE_INLINE ACE_Atomic_Op::ACE_Atomic_Op (void) : value_ (0) @@ -38,6 +45,10 @@ ACE_Atomic_Op::operator++ (void) return ::_InterlockedIncrement (const_cast (&this->value_)); #elif defined (WIN32) return ::InterlockedIncrement (const_cast (&this->value_)); +#elif defined (ACE_HAS_VXATOMICLIB) + return ::vxAtomicInc (reinterpret_cast (const_cast (&this->value_))) + 1; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_inc_ulong_nv (reinterpret_cast(&this->value_)); #else /* WIN32 */ return (*increment_fn_) (&this->value_); #endif /* WIN32 */ @@ -56,6 +67,10 @@ ACE_Atomic_Op::operator-- (void) return ::_InterlockedDecrement (const_cast (&this->value_)); #elif defined (WIN32) return ::InterlockedDecrement (const_cast (&this->value_)); +#elif defined (ACE_HAS_VXATOMICLIB) + return ::vxAtomicDec (reinterpret_cast (const_cast (&this->value_))) - 1; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_dec_ulong_nv (reinterpret_cast(&this->value_)); #else /* WIN32 */ return (*decrement_fn_) (&this->value_); #endif /* WIN32 */ @@ -76,6 +91,10 @@ ACE_Atomic_Op::operator+= (long rhs) #elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) return ::InterlockedExchangeAdd (const_cast (&this->value_), rhs) + rhs; +#elif defined (ACE_HAS_VXATOMICLIB) + return ::vxAtomicAdd (reinterpret_cast (const_cast (&this->value_)), rhs) + rhs; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_add_long_nv (reinterpret_cast(&this->value_), rhs); #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return (*exchange_add_fn_) (&this->value_, rhs) + rhs; #endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ @@ -90,6 +109,10 @@ ACE_Atomic_Op::operator-= (long rhs) #elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) return ::InterlockedExchangeAdd (const_cast (&this->value_), -rhs) - rhs; +#elif defined (ACE_HAS_VXATOMICLIB) + return ::vxAtomicSub (reinterpret_cast (const_cast (&this->value_)), rhs) - rhs; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_add_long_nv (reinterpret_cast(&this->value_), -rhs); #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return (*exchange_add_fn_) (&this->value_, -rhs) - rhs; #endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ @@ -138,6 +161,10 @@ ACE_Atomic_Op::operator= (long rhs) ::_InterlockedExchange (const_cast (&this->value_), rhs); #elif defined (WIN32) ::InterlockedExchange (const_cast (&this->value_), rhs); +#elif defined (ACE_HAS_VXATOMICLIB) + ::vxAtomicSet (reinterpret_cast (const_cast (&this->value_)), rhs); +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + ::atomic_swap_ulong (reinterpret_cast(&this->value_), rhs); #else /* WIN32 */ (*exchange_fn_) (&this->value_, rhs); #endif /* WIN32 */ @@ -152,6 +179,10 @@ ACE_Atomic_Op::operator= ( ::_InterlockedExchange (const_cast (&this->value_), rhs.value_); #elif defined (WIN32) ::InterlockedExchange (const_cast (&this->value_), rhs.value_); +#elif defined (ACE_HAS_VXATOMICLIB) + ::vxAtomicSet (reinterpret_cast (const_cast (&this->value_)), rhs.value_); +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + ::atomic_swap_ulong (reinterpret_cast(&this->value_), rhs.value_); #else /* WIN32 */ (*exchange_fn_) (&this->value_, rhs.value_); #endif /* WIN32 */ @@ -170,6 +201,7 @@ ACE_Atomic_Op::value_i (void) return this->value_; } + ACE_INLINE ACE_Atomic_Op::ACE_Atomic_Op (void) : value_ (0) @@ -196,6 +228,10 @@ ACE_Atomic_Op::operator++ (void) return static_cast (::_InterlockedIncrement (const_cast (reinterpret_cast(&this->value_)))); #elif defined (WIN32) return static_cast (::InterlockedIncrement (const_cast (reinterpret_cast(&this->value_)))); +#elif defined (ACE_HAS_VXATOMICLIB) + return static_cast (::vxAtomicInc (reinterpret_cast (const_cast (reinterpret_cast(&this->value_))))) + 1; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_inc_ulong_nv (&this->value_); #else /* WIN32 */ return static_cast ((*increment_fn_) (reinterpret_cast (&this->value_))); #endif /* WIN32 */ @@ -214,6 +250,10 @@ ACE_Atomic_Op::operator-- (void) return static_cast (::_InterlockedDecrement (const_cast (reinterpret_cast(&this->value_)))); #elif defined (WIN32) return static_cast (::InterlockedDecrement (const_cast (reinterpret_cast(&this->value_)))); +#elif defined (ACE_HAS_VXATOMICLIB) + return static_cast (::vxAtomicDec (reinterpret_cast (const_cast (reinterpret_cast(&this->value_))))) - 1; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_dec_ulong_nv (&this->value_); #else /* WIN32 */ return static_cast ((*decrement_fn_) (reinterpret_cast (&this->value_))); #endif /* WIN32 */ @@ -234,6 +274,10 @@ ACE_Atomic_Op::operator+= (unsigned long rhs) #elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) return static_cast (::InterlockedExchangeAdd (const_cast (reinterpret_cast (&this->value_)), rhs)) + rhs; +#elif defined (ACE_HAS_VXATOMICLIB) + return static_cast (::vxAtomicAdd (reinterpret_cast (const_cast (reinterpret_cast(&this->value_))), rhs)) + rhs; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_add_long_nv (&this->value_, rhs); #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ return static_cast ((*exchange_add_fn_) (reinterpret_cast (&this->value_), rhs)) + rhs; #endif /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ @@ -248,6 +292,10 @@ ACE_Atomic_Op::operator-= (unsigned long rhs) #elif defined (WIN32) && defined (ACE_HAS_INTERLOCKED_EXCHANGEADD) return static_cast (::InterlockedExchangeAdd (const_cast (reinterpret_cast(&this->value_)), -static_cast(rhs))) - rhs; +#elif defined (ACE_HAS_VXATOMICLIB) + return static_cast (::vxAtomicSub (reinterpret_cast (const_cast (reinterpret_cast(&this->value_))), rhs)) - rhs; +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + return ::atomic_add_long_nv (&this->value_, -rhs); #else /* WIN32 && ACE_HAS_INTERLOCKED_EXCHANGEADD */ long l_rhs = static_cast (rhs); return static_cast ((*exchange_add_fn_) (reinterpret_cast (&this->value_), -l_rhs)) - rhs; @@ -297,6 +345,10 @@ ACE_Atomic_Op::operator= (unsigned long rhs) ::_InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs); #elif defined (WIN32) ::InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs); +#elif defined (ACE_HAS_VXATOMICLIB) + ::vxAtomicSet (reinterpret_cast (const_cast (reinterpret_cast (&this->value_))), rhs); +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + ::atomic_swap_ulong (&this->value_, rhs); #else /* WIN32 */ (*exchange_fn_) (reinterpret_cast (&this->value_), rhs); #endif /* WIN32 */ @@ -311,6 +363,10 @@ ACE_Atomic_Op::operator= ( ::_InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs.value_); #elif defined (WIN32) ::InterlockedExchange (const_cast (reinterpret_cast (&this->value_)), rhs.value_); +#elif defined (ACE_HAS_VXATOMICLIB) + ::vxAtomicSet (reinterpret_cast (const_cast (reinterpret_cast (&this->value_))), rhs.value_); +#elif defined (ACE_HAS_SOLARIS_ATOMIC_LIB) + ::atomic_swap_ulong (&this->value_, rhs.value_); #else /* WIN32 */ (*exchange_fn_) (reinterpret_cast (&this->value_), rhs.value_); #endif /* WIN32 */ @@ -329,6 +385,198 @@ ACE_Atomic_Op::value_i (void) return this->value_; } +#endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ + +#if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1) + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC () +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (int c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (int rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} + + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC() +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (unsigned int c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (unsigned int rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC() +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (long c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (long rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC () +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (unsigned long c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (unsigned long rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} + +#if !defined (ACE_LACKS_GCC_ATOMIC_BUILTINS_2) +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC() +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (short c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (short rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC () +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (unsigned short c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (unsigned short rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} +#endif + +#if !defined (ACE_LACKS_GCC_ATOMIC_BUILTINS_1) +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (void) : + ACE_Atomic_Op_GCC () +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (bool c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op::ACE_Atomic_Op (const ACE_Atomic_Op &c) : + ACE_Atomic_Op_GCC(c) +{ +} + +ACE_INLINE +ACE_Atomic_Op& +ACE_Atomic_Op::operator= (bool rhs) +{ + ACE_Atomic_Op_GCC::operator= (rhs); + return *this; +} +#endif + +#endif /* ACE_HAS_GCC_ATOMIC_BUILTINS==1 */ + ACE_END_VERSIONED_NAMESPACE_DECL -#endif /* ACE_HAS_BUILTIN_ATOMIC_OP */ diff --git a/externals/ace/Atomic_Op_GCC_T.cpp b/externals/ace/Atomic_Op_GCC_T.cpp new file mode 100644 index 00000000000..bbe6ec676ec --- /dev/null +++ b/externals/ace/Atomic_Op_GCC_T.cpp @@ -0,0 +1,29 @@ +// $Id: Atomic_Op_GCC_T.cpp 89345 2010-03-05 13:04:51Z johnnyw $ + +#include "ace/OS_NS_unistd.h" + +ACE_RCSID (ace, + Atomic_Op_GCC, + "$Id: Atomic_Op_GCC_T.cpp 89345 2010-03-05 13:04:51Z johnnyw $") + +#if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1) + +#if !defined (__ACE_INLINE__) +#include "ace/Atomic_Op_GCC_T.inl" +#endif /* __ACE_INLINE__ */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +template +void +ACE_Atomic_Op_GCC::dump (void) const +{ +#if defined (ACE_HAS_DUMP) + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +#endif /* ACE_HAS_DUMP */ +} + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* ACE_HAS_GCC_ATOMIC_BUILTINS */ diff --git a/externals/ace/Atomic_Op_GCC_T.h b/externals/ace/Atomic_Op_GCC_T.h new file mode 100644 index 00000000000..92bc771dda6 --- /dev/null +++ b/externals/ace/Atomic_Op_GCC_T.h @@ -0,0 +1,136 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Atomic_Op_GCC_T.h + * + * $Id: Atomic_Op_GCC_T.h 89339 2010-03-05 12:20:47Z johnnyw $ + * + * @author Johnny Willemsen +class ACE_Export ACE_Atomic_Op_GCC +{ +public: + /// Atomically pre-increment @c value_. + T operator++ (void); + + /// Atomically post-increment @c value_. + T operator++ (int); + + /// Atomically increment @c value_ by rhs. + T operator+= (T rhs); + + /// Atomically pre-decrement @c value_. + T operator-- (void); + + /// Atomically post-decrement @c value_. + T operator-- (int); + + /// Atomically decrement @c value_ by rhs. + T operator-= (T rhs); + + /// Atomically compare @c value_ with rhs. + bool operator== (T rhs) const; + + /// Atomically compare @c value_ with rhs. + bool operator!= (T rhs) const; + + /// Atomically check if @c value_ greater than or equal to rhs. + bool operator>= (T rhs) const; + + /// Atomically check if @c value_ greater than rhs. + bool operator> (T rhs) const; + + /// Atomically check if @c value_ less than or equal to rhs. + bool operator<= (T rhs) const; + + /// Atomically check if @c value_ less than rhs. + bool operator< (T rhs) const; + + /// Explicitly return @c value_. + T value (void) const; + + /// Dump the state of an object. + void dump (void) const; + + /// Explicitly return @c value_ (by reference). + volatile T &value_i (void); + + // ACE_ALLOC_HOOK_DECLARE; + // Declare the dynamic allocation hooks. + +protected: + /// Atomically assign rhs to @c value_. + ACE_Atomic_Op_GCC &operator= (T rhs); + + /// Atomically assign to @c value_. + ACE_Atomic_Op_GCC &operator= (const ACE_Atomic_Op_GCC &rhs); + + /// Initialize @c value_ to 0. + ACE_Atomic_Op_GCC (void); + + /// Initialize @c value_ to c. + ACE_Atomic_Op_GCC (T c); + + /// Manage copying... + ACE_Atomic_Op_GCC (const ACE_Atomic_Op_GCC &c); + +private: + + // This function cannot be supported by this template specialization. + // If you need access to an underlying lock, use the ACE_Atomic_Op_Ex + // template instead. + ACE_Thread_Mutex &mutex (void); + +private: + + /// Current object decorated by the atomic op. + volatile T value_; +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#if defined (__ACE_INLINE__) +#include "ace/Atomic_Op_GCC_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Atomic_Op_GCC_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Atomic_Op_GCC_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#endif /* ACE_HAS_GCC_ATOMIC_BUILTINS */ + +#include /**/ "ace/post.h" +#endif /*ACE_ATOMIC_OP_GCC_T_H*/ diff --git a/externals/ace/Atomic_Op_GCC_T.inl b/externals/ace/Atomic_Op_GCC_T.inl new file mode 100644 index 00000000000..c6fe027022b --- /dev/null +++ b/externals/ace/Atomic_Op_GCC_T.inl @@ -0,0 +1,148 @@ +// -*- C++ -*- +// +// $Id: Atomic_Op_GCC_T.inl 89391 2010-03-08 13:53:30Z johnnyw $ + +#if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1) + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +template +ACE_INLINE +ACE_Atomic_Op_GCC::ACE_Atomic_Op_GCC (void) + : value_ (0) +{ +} + +template +ACE_INLINE +ACE_Atomic_Op_GCC::ACE_Atomic_Op_GCC (T c) + : value_ (c) +{ +} + +template +ACE_INLINE +ACE_Atomic_Op_GCC::ACE_Atomic_Op_GCC ( + const ACE_Atomic_Op_GCC &rhs) + : value_ (rhs.value_) +{ +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::operator++ (void) +{ + return __sync_add_and_fetch (&this->value_, 1); +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::operator++ (int) +{ + return __sync_fetch_and_add (&this->value_, 1); +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::operator-- (void) +{ + return __sync_sub_and_fetch (&this->value_, 1); +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::operator-- (int) +{ + return __sync_fetch_and_sub (&this->value_, 1); +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::operator+= (T rhs) +{ + return __sync_add_and_fetch (&this->value_, rhs); +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::operator-= (T rhs) +{ + return __sync_sub_and_fetch (&this->value_, rhs); +} + +template +ACE_INLINE bool +ACE_Atomic_Op_GCC::operator== (T rhs) const +{ + return (this->value_ == rhs); +} + +template +ACE_INLINE bool +ACE_Atomic_Op_GCC::operator!= (T rhs) const +{ + return (this->value_ != rhs); +} + +template +ACE_INLINE bool +ACE_Atomic_Op_GCC::operator>= (T rhs) const +{ + return (this->value_ >= rhs); +} + +template +ACE_INLINE bool +ACE_Atomic_Op_GCC::operator> (T rhs) const +{ + return (this->value_ > rhs); +} + +template +ACE_INLINE bool +ACE_Atomic_Op_GCC::operator<= (T rhs) const +{ + return (this->value_ <= rhs); +} + +template +ACE_INLINE bool +ACE_Atomic_Op_GCC::operator< (T rhs) const +{ + return (this->value_ < rhs); +} + +template +ACE_INLINE ACE_Atomic_Op_GCC & +ACE_Atomic_Op_GCC::operator= (T rhs) +{ + (void) __sync_lock_test_and_set (&this->value_, rhs); + return *this; +} + +template +ACE_INLINE ACE_Atomic_Op_GCC & +ACE_Atomic_Op_GCC::operator= ( + const ACE_Atomic_Op_GCC &rhs) +{ + (void) __sync_lock_test_and_set (&this->value_, rhs.value_); + return *this; +} + +template +ACE_INLINE T +ACE_Atomic_Op_GCC::value (void) const +{ + return this->value_; +} + +template +ACE_INLINE volatile T & +ACE_Atomic_Op_GCC::value_i (void) +{ + return this->value_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* ACE_HAS_GCC_ATOMIC_BUILTINS */ diff --git a/dep/src/ace/Atomic_Op_Sparc.c b/externals/ace/Atomic_Op_Sparc.c similarity index 100% rename from dep/src/ace/Atomic_Op_Sparc.c rename to externals/ace/Atomic_Op_Sparc.c diff --git a/dep/include/ace/Atomic_Op_Sparc.h b/externals/ace/Atomic_Op_Sparc.h similarity index 99% rename from dep/include/ace/Atomic_Op_Sparc.h rename to externals/ace/Atomic_Op_Sparc.h index d521520c9ec..75b9ad6eaa2 100644 --- a/dep/include/ace/Atomic_Op_Sparc.h +++ b/externals/ace/Atomic_Op_Sparc.h @@ -12,4 +12,3 @@ extern "C" } #endif /* ACE_ATOMIC_OP_SPARC_H */ - diff --git a/dep/src/ace/Atomic_Op_T.cpp b/externals/ace/Atomic_Op_T.cpp similarity index 93% rename from dep/src/ace/Atomic_Op_T.cpp rename to externals/ace/Atomic_Op_T.cpp index bb47112e10a..fcaa529b8e6 100644 --- a/dep/src/ace/Atomic_Op_T.cpp +++ b/externals/ace/Atomic_Op_T.cpp @@ -20,7 +20,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op_Ex) ACE_ALLOC_HOOK_DEFINE(ACE_Atomic_Op) -ACE_RCSID(ace, Atomic_Op_T, "$Id: Atomic_Op_T.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Atomic_Op_T, "$Id: Atomic_Op_T.cpp 85141 2009-04-22 08:48:30Z johnnyw $") // ************************************************* template ACE_LOCK & @@ -38,7 +38,7 @@ ACE_Atomic_Op_Ex::dump (void) const // ACE_TRACE ("ACE_Atomic_Op_Ex::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->mutex_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP, this)); #endif /* ACE_HAS_DUMP */ } @@ -80,4 +80,3 @@ ACE_Atomic_Op::ACE_Atomic_Op ( ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_ATOMIC_OP_T_CPP */ - diff --git a/dep/include/ace/Atomic_Op_T.h b/externals/ace/Atomic_Op_T.h similarity index 99% rename from dep/include/ace/Atomic_Op_T.h rename to externals/ace/Atomic_Op_T.h index afd163c58e9..13bd7dbbf88 100644 --- a/dep/include/ace/Atomic_Op_T.h +++ b/externals/ace/Atomic_Op_T.h @@ -367,4 +367,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_ATOMIC_OP_T_H*/ - diff --git a/dep/include/ace/Atomic_Op_T.inl b/externals/ace/Atomic_Op_T.inl similarity index 99% rename from dep/include/ace/Atomic_Op_T.inl rename to externals/ace/Atomic_Op_T.inl index 2ac73d9fd39..ff051b0cbce 100644 --- a/dep/include/ace/Atomic_Op_T.inl +++ b/externals/ace/Atomic_Op_T.inl @@ -195,6 +195,7 @@ ACE_Atomic_Op::ACE_Atomic_Op ( // ACE_TRACE ("ACE_Atomic_Op::ACE_Atomic_Op"); } + template ACE_INLINE ACE_Atomic_Op & ACE_Atomic_Op::operator= ( diff --git a/dep/src/ace/Auto_Event.cpp b/externals/ace/Auto_Event.cpp similarity index 99% rename from dep/src/ace/Auto_Event.cpp rename to externals/ace/Auto_Event.cpp index 875b7ad05cd..51efcf7605b 100644 --- a/dep/src/ace/Auto_Event.cpp +++ b/externals/ace/Auto_Event.cpp @@ -47,4 +47,3 @@ ACE_Auto_Event::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Auto_Event.h b/externals/ace/Auto_Event.h similarity index 99% rename from dep/include/ace/Auto_Event.h rename to externals/ace/Auto_Event.h index 307c89cddae..042f82ed2ff 100644 --- a/dep/include/ace/Auto_Event.h +++ b/externals/ace/Auto_Event.h @@ -71,4 +71,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_AUTO_EVENT_H */ - diff --git a/dep/include/ace/Auto_Event.inl b/externals/ace/Auto_Event.inl similarity index 100% rename from dep/include/ace/Auto_Event.inl rename to externals/ace/Auto_Event.inl diff --git a/dep/src/ace/Auto_Functor.cpp b/externals/ace/Auto_Functor.cpp similarity index 99% rename from dep/src/ace/Auto_Functor.cpp rename to externals/ace/Auto_Functor.cpp index f0f8296e0be..9d0dc79aa52 100644 --- a/dep/src/ace/Auto_Functor.cpp +++ b/externals/ace/Auto_Functor.cpp @@ -37,4 +37,3 @@ ACE_Utils::Auto_Functor::reset(X * p, Functor f) ACE_END_VERSIONED_NAMESPACE_DECL #endif /*ACE_AUTO_FUNCTOR_CPP*/ - diff --git a/dep/include/ace/Auto_Functor.h b/externals/ace/Auto_Functor.h similarity index 99% rename from dep/include/ace/Auto_Functor.h rename to externals/ace/Auto_Functor.h index 339054506be..2c2b81eb265 100644 --- a/dep/include/ace/Auto_Functor.h +++ b/externals/ace/Auto_Functor.h @@ -125,4 +125,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_AUTO_FUNCTOR_H*/ - diff --git a/dep/include/ace/Auto_Functor.inl b/externals/ace/Auto_Functor.inl similarity index 100% rename from dep/include/ace/Auto_Functor.inl rename to externals/ace/Auto_Functor.inl diff --git a/dep/src/ace/Auto_IncDec_T.cpp b/externals/ace/Auto_IncDec_T.cpp similarity index 99% rename from dep/src/ace/Auto_IncDec_T.cpp rename to externals/ace/Auto_IncDec_T.cpp index 668b4c81cdc..ccef122edcf 100644 --- a/dep/src/ace/Auto_IncDec_T.cpp +++ b/externals/ace/Auto_IncDec_T.cpp @@ -32,4 +32,3 @@ ACE_Auto_IncDec::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_AUTO_INCDEC_T_CPP */ - diff --git a/dep/include/ace/Auto_IncDec_T.h b/externals/ace/Auto_IncDec_T.h similarity index 92% rename from dep/include/ace/Auto_IncDec_T.h rename to externals/ace/Auto_IncDec_T.h index 8a8840e84b2..8fcdb0bcd76 100644 --- a/dep/include/ace/Auto_IncDec_T.h +++ b/externals/ace/Auto_IncDec_T.h @@ -4,12 +4,13 @@ /** * @file Auto_IncDec_T.h * - * $Id: Auto_IncDec_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Auto_IncDec_T.h 84675 2009-03-02 11:44:35Z johnnyw $ * * @author Edan Ayal */ //============================================================================= + #ifndef ACE_AUTO_INCDEC_T_H #define ACE_AUTO_INCDEC_T_H @@ -59,8 +60,8 @@ private: // = Prevent assignment and initialization. ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Auto_IncDec &)) - ACE_UNIMPLEMENTED_FUNC (ACE_Auto_IncDec (const - ACE_Auto_IncDec &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Auto_IncDec (const + ACE_Auto_IncDec &)) }; ACE_END_VERSIONED_NAMESPACE_DECL @@ -88,4 +89,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_AUTO_INCDEC_T_H */ - diff --git a/dep/include/ace/Auto_IncDec_T.inl b/externals/ace/Auto_IncDec_T.inl similarity index 100% rename from dep/include/ace/Auto_IncDec_T.inl rename to externals/ace/Auto_IncDec_T.inl diff --git a/dep/src/ace/Auto_Ptr.cpp b/externals/ace/Auto_Ptr.cpp similarity index 99% rename from dep/src/ace/Auto_Ptr.cpp rename to externals/ace/Auto_Ptr.cpp index 56fc9af0ee5..791bd482a23 100644 --- a/dep/src/ace/Auto_Ptr.cpp +++ b/externals/ace/Auto_Ptr.cpp @@ -19,4 +19,3 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Auto_Basic_Array_Ptr) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_AUTO_PTR_CPP */ - diff --git a/dep/include/ace/Auto_Ptr.h b/externals/ace/Auto_Ptr.h similarity index 99% rename from dep/include/ace/Auto_Ptr.h rename to externals/ace/Auto_Ptr.h index ce52100609b..3183019aceb 100644 --- a/dep/include/ace/Auto_Ptr.h +++ b/externals/ace/Auto_Ptr.h @@ -32,6 +32,7 @@ # pragma warning(disable: 4284) #endif /* _MSC_VER */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -178,6 +179,7 @@ public: X *operator-> () const; }; + /** * @brief Reset given @c auto_ptr element to new element. * @@ -238,4 +240,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_AUTO_PTR_H */ - diff --git a/dep/include/ace/Auto_Ptr.inl b/externals/ace/Auto_Ptr.inl similarity index 100% rename from dep/include/ace/Auto_Ptr.inl rename to externals/ace/Auto_Ptr.inl diff --git a/dep/src/ace/Barrier.cpp b/externals/ace/Barrier.cpp similarity index 94% rename from dep/src/ace/Barrier.cpp rename to externals/ace/Barrier.cpp index 515a73f95a9..29e7422600c 100644 --- a/dep/src/ace/Barrier.cpp +++ b/externals/ace/Barrier.cpp @@ -1,4 +1,4 @@ -// $Id: Barrier.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Barrier.cpp 84282 2009-01-30 15:04:29Z msmit $ #include "ace/Barrier.h" @@ -17,7 +17,7 @@ ACE_RCSID (ace, Barrier, - "$Id: Barrier.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Barrier.cpp 84282 2009-01-30 15:04:29Z msmit $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -31,8 +31,7 @@ ACE_Sub_Barrier::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->barrier_finished_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("running_threads_ = %d"), this->running_threads_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("running_threads_ = %d\n"), this->running_threads_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } @@ -195,4 +194,3 @@ ACE_Process_Barrier::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/Barrier.h b/externals/ace/Barrier.h similarity index 99% rename from dep/include/ace/Barrier.h rename to externals/ace/Barrier.h index 5fc9b9e8b7d..189ff07e4cc 100644 --- a/dep/include/ace/Barrier.h +++ b/externals/ace/Barrier.h @@ -213,4 +213,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_BARRIER_H */ - diff --git a/dep/include/ace/Barrier.inl b/externals/ace/Barrier.inl similarity index 100% rename from dep/include/ace/Barrier.inl rename to externals/ace/Barrier.inl diff --git a/dep/src/ace/Base_Thread_Adapter.cpp b/externals/ace/Base_Thread_Adapter.cpp similarity index 96% rename from dep/src/ace/Base_Thread_Adapter.cpp rename to externals/ace/Base_Thread_Adapter.cpp index d74f1934161..eac2c14903c 100644 --- a/dep/src/ace/Base_Thread_Adapter.cpp +++ b/externals/ace/Base_Thread_Adapter.cpp @@ -1,10 +1,10 @@ -// $Id: Base_Thread_Adapter.cpp 81239 2008-04-04 22:28:48Z iliyan $ +// $Id: Base_Thread_Adapter.cpp 84340 2009-02-05 22:28:08Z stallions $ #include "ace/Base_Thread_Adapter.h" ACE_RCSID (ace, Base_Thread_Adapter, - "$Id: Base_Thread_Adapter.cpp 81239 2008-04-04 22:28:48Z iliyan $") + "$Id: Base_Thread_Adapter.cpp 84340 2009-02-05 22:28:08Z stallions $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/Base_Thread_Adapter.inl" @@ -126,4 +126,3 @@ ACE_THREAD_ADAPTER_NAME (void *args) return status; } - diff --git a/dep/include/ace/Base_Thread_Adapter.h b/externals/ace/Base_Thread_Adapter.h similarity index 99% rename from dep/include/ace/Base_Thread_Adapter.h rename to externals/ace/Base_Thread_Adapter.h index 968535917d2..b36d18e4f13 100644 --- a/dep/include/ace/Base_Thread_Adapter.h +++ b/externals/ace/Base_Thread_Adapter.h @@ -67,8 +67,11 @@ protected: long flags_; }; + + class ACE_Service_Gestalt; + /** * @class ACE_Base_Thread_Adapter * @@ -190,4 +193,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_BASE_THREAD_ADAPTER_H */ - diff --git a/dep/include/ace/Base_Thread_Adapter.inl b/externals/ace/Base_Thread_Adapter.inl similarity index 100% rename from dep/include/ace/Base_Thread_Adapter.inl rename to externals/ace/Base_Thread_Adapter.inl diff --git a/dep/src/ace/Based_Pointer_Repository.cpp b/externals/ace/Based_Pointer_Repository.cpp similarity index 99% rename from dep/src/ace/Based_Pointer_Repository.cpp rename to externals/ace/Based_Pointer_Repository.cpp index c9bf92f78ee..4ebe8b82c7a 100644 --- a/dep/src/ace/Based_Pointer_Repository.cpp +++ b/externals/ace/Based_Pointer_Repository.cpp @@ -117,4 +117,3 @@ template ACE_Singleton * #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Based_Pointer_Repository.h b/externals/ace/Based_Pointer_Repository.h similarity index 90% rename from dep/include/ace/Based_Pointer_Repository.h rename to externals/ace/Based_Pointer_Repository.h index 4cb49cb078b..d549ce15326 100644 --- a/dep/include/ace/Based_Pointer_Repository.h +++ b/externals/ace/Based_Pointer_Repository.h @@ -4,7 +4,7 @@ /** * @file Based_Pointer_Repository.h * - * $Id: Based_Pointer_Repository.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Based_Pointer_Repository.h 84837 2009-03-16 13:01:15Z johnnyw $ * * @author Dietrich Quehl * @author Douglas C. Schmidt @@ -26,6 +26,7 @@ #include "ace/Synch_Traits.h" #include "ace/os_include/os_stddef.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Forward decl., using the "Cheshire Cat" technique. @@ -70,6 +71,9 @@ private: /// order to avoid circular #include dependencies. ACE_Based_Pointer_Repository_Rep *rep_; +private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Based_Pointer_Repository &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Based_Pointer_Repository (const ACE_Based_Pointer_Repository &)) }; // ---------------------------------- @@ -88,4 +92,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_BASED_POINTER_REPOSITORY_H */ - diff --git a/dep/src/ace/Based_Pointer_T.cpp b/externals/ace/Based_Pointer_T.cpp similarity index 99% rename from dep/src/ace/Based_Pointer_T.cpp rename to externals/ace/Based_Pointer_T.cpp index 81943797418..b85774db48d 100644 --- a/dep/src/ace/Based_Pointer_T.cpp +++ b/externals/ace/Based_Pointer_T.cpp @@ -119,4 +119,3 @@ ACE_Based_Pointer::ACE_Based_Pointer (const ACE_Based_Pointer * @author Boris Kolpackov @@ -223,7 +223,7 @@ public: /// Allows us to check for NULL on all ACE_Strong_Bound_Ptr /// objects. - int null (void) const; + bool null (void) const; /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; @@ -359,7 +359,7 @@ public: long remove_ref (void); /// Allows us to check for NULL on all ACE_Weak_Bound_Ptr objects. - int null (void) const; + bool null (void) const; /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; @@ -386,4 +386,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_BOUND_PTR_H */ - diff --git a/dep/include/ace/Bound_Ptr.inl b/externals/ace/Bound_Ptr.inl similarity index 98% rename from dep/include/ace/Bound_Ptr.inl rename to externals/ace/Bound_Ptr.inl index 3165f6f5acc..399a7bc9b23 100644 --- a/dep/include/ace/Bound_Ptr.inl +++ b/externals/ace/Bound_Ptr.inl @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: Bound_Ptr.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Bound_Ptr.inl 82723 2008-09-16 09:35:44Z johnnyw $ // Bound_Ptr.i @@ -34,6 +34,8 @@ ACE_Bound_Ptr_Counter::create_strong (void) return temp; } + + template inline long ACE_Bound_Ptr_Counter::attach_strong (ACE_Bound_Ptr_Counter* counter) { @@ -286,7 +288,7 @@ ACE_Strong_Bound_Ptr::get (void) const return this->ptr_; } -template inline int +template inline bool ACE_Strong_Bound_Ptr::null (void) const { return this->ptr_ == 0; @@ -451,13 +453,13 @@ ACE_Weak_Bound_Ptr::unsafe_get (void) const return this->ptr_; } -template inline int +template inline bool ACE_Weak_Bound_Ptr::null (void) const { // A weak pointer must behave as though it is automatically set to null // if the underlying object has been deleted. if (COUNTER::object_was_deleted (this->counter_)) - return 1; + return true; return this->ptr_ == 0; } diff --git a/dep/src/ace/CDR_Base.cpp b/externals/ace/CDR_Base.cpp similarity index 98% rename from dep/src/ace/CDR_Base.cpp rename to externals/ace/CDR_Base.cpp index e37dbb71c2f..35393c3f577 100644 --- a/dep/src/ace/CDR_Base.cpp +++ b/externals/ace/CDR_Base.cpp @@ -10,7 +10,7 @@ ACE_RCSID (ace, CDR_Base, - "$Id: CDR_Base.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: CDR_Base.cpp 86825 2009-09-28 17:45:23Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -549,20 +549,22 @@ ACE_CDR::total_length (const ACE_Message_Block* begin, return l; } -void +int ACE_CDR::consolidate (ACE_Message_Block *dst, const ACE_Message_Block *src) { if (src == 0) - return; + return 0; - size_t newsize = + size_t const newsize = ACE_CDR::first_size (ACE_CDR::total_length (src, 0) + ACE_CDR::MAX_ALIGNMENT); - dst->size (newsize); + + if (dst->size (newsize) == -1) + return -1; #if !defined (ACE_CDR_IGNORE_ALIGNMENT) - // We must copy the contents of into the new buffer, but + // We must copy the contents of src into the new buffer, but // respecting the alignment. ptrdiff_t srcalign = ptrdiff_t(src->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT; @@ -586,6 +588,7 @@ ACE_CDR::consolidate (ACE_Message_Block *dst, else dst->wr_ptr (i->length ()); } + return 0; } #if defined (NONNATIVE_LONGLONG) @@ -740,7 +743,7 @@ ACE_CDR::LongDouble::operator ACE_CDR::LongDouble::NativeImpl () const // we have to shift and or the rhs to get the right bytes. size_t li = 1; bool direction = true; - for (size_t ri = 2; li < sizeof (ret); ) { + for (size_t ri = 2; li < sizeof (ret);) { if (direction) { lhs_ptr[li] |= ((copy[ri] >> 4) & 0xf); @@ -797,4 +800,3 @@ ACE_CDR::Float::operator!= (const ACE_CDR::Float & /* rhs */) const #endif /* _UNICOS */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/CDR_Base.h b/externals/ace/CDR_Base.h similarity index 97% rename from dep/include/ace/CDR_Base.h rename to externals/ace/CDR_Base.h index 47db56002ee..12b4a4953fd 100644 --- a/dep/include/ace/CDR_Base.h +++ b/externals/ace/CDR_Base.h @@ -4,7 +4,7 @@ /** * @file CDR_Base.h * - * $Id: CDR_Base.h 82088 2008-06-19 16:22:16Z shuston $ + * $Id: CDR_Base.h 88488 2010-01-12 14:20:13Z olli $ * * ACE Common Data Representation (CDR) basic types. * @@ -24,6 +24,7 @@ */ //============================================================================= + #ifndef ACE_CDR_BASE_H #define ACE_CDR_BASE_H @@ -176,10 +177,14 @@ public: */ static int grow (ACE_Message_Block *mb, size_t minsize); - /// Copy a message block chain into a single message block, - /// preserving the alignment of the first message block of the - /// original stream, not the following message blocks. - static void consolidate (ACE_Message_Block *dst, + /** + * Copy a message block chain into a single message block, + * preserving the alignment of the first message block of the + * original stream, not the following message blocks. + * @retval -1 Failure + * @retval 0 Success. + */ + static int consolidate (ACE_Message_Block *dst, const ACE_Message_Block *src); static size_t total_length (const ACE_Message_Block *begin, @@ -215,7 +220,6 @@ public: // complain about no ANSI C++ long long. typedef longlong_t LongLong; # else - // LynxOS 2.5.0 and Linux don't have u_longlong_t. typedef long long LongLong; # endif /* sun */ # else /* no native 64 bit integer type */ @@ -372,7 +376,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include "ace/CDR_Base.inl" #endif /* __ACE_INLINE__ */ + #include /**/ "ace/post.h" #endif /* ACE_CDR_BASE_H */ - diff --git a/dep/include/ace/CDR_Base.inl b/externals/ace/CDR_Base.inl similarity index 100% rename from dep/include/ace/CDR_Base.inl rename to externals/ace/CDR_Base.inl diff --git a/dep/src/ace/CDR_Size.cpp b/externals/ace/CDR_Size.cpp similarity index 99% rename from dep/src/ace/CDR_Size.cpp rename to externals/ace/CDR_Size.cpp index f3c72df2734..96970927037 100644 --- a/dep/src/ace/CDR_Size.cpp +++ b/externals/ace/CDR_Size.cpp @@ -23,13 +23,13 @@ ACE_SizeCDR::write_wchar (ACE_CDR::WChar x) errno = EACCES; return (this->good_bit_ = false); } - + if (static_cast (major_version_) == 1 && static_cast (minor_version_) == 2) { ACE_CDR::Octet len = static_cast (ACE_OutputCDR::wchar_maxbytes ()); - + if (this->write_1 (&len)) { if (ACE_OutputCDR::wchar_maxbytes () == sizeof(ACE_CDR::WChar)) @@ -65,7 +65,7 @@ ACE_SizeCDR::write_wchar (ACE_CDR::WChar x) errno = EINVAL; return (this->good_bit_ = false); } - + if (ACE_OutputCDR::wchar_maxbytes () == sizeof (ACE_CDR::WChar)) { const void *temp = &x; @@ -76,7 +76,7 @@ ACE_SizeCDR::write_wchar (ACE_CDR::WChar x) ACE_CDR::Short sx = static_cast (x); return this->write_2 (reinterpret_cast (&sx)); } - + ACE_CDR::Octet ox = static_cast (x); return this->write_1 (reinterpret_cast (&ox)); } @@ -138,9 +138,9 @@ ACE_SizeCDR::write_wstring (ACE_CDR::ULong len, this->write_ulong ( ACE_Utils::truncate_cast ( ACE_OutputCDR::wchar_maxbytes () * len)); - + if (good_ulong) - { + { return this->write_wchar_array (x, len); } } @@ -213,6 +213,7 @@ ACE_SizeCDR::write_wchar_array_i (const ACE_CDR::WChar *, return true; } + ACE_CDR::Boolean ACE_SizeCDR::write_array (const void *, size_t size, @@ -259,4 +260,3 @@ operator<< (ACE_SizeCDR &ss, const ACE_CString &x) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/CDR_Size.h b/externals/ace/CDR_Size.h similarity index 99% rename from dep/include/ace/CDR_Size.h rename to externals/ace/CDR_Size.h index 3803310c7f2..a0b3c462ca8 100644 --- a/dep/include/ace/CDR_Size.h +++ b/externals/ace/CDR_Size.h @@ -54,12 +54,15 @@ public: /// Returns @c false if an error has ocurred. bool good_bit (void) const; + /// Reset current size. void reset (void); + /// Return current size. size_t total_length (void) const; + // Return 0 on failure and 1 on success. //@{ @name Size-calculating pseudo-write operations ACE_CDR::Boolean write_boolean (ACE_CDR::Boolean x); @@ -154,6 +157,7 @@ private: size_t align, ACE_CDR::ULong length); + ACE_CDR::Boolean write_wchar_array_i (const ACE_CDR::WChar* x, ACE_CDR::ULong length); @@ -231,7 +235,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* __ACE_INLINE__ */ + #include /**/ "ace/post.h" #endif /* ACE_CDR_SIZE_H */ - diff --git a/dep/include/ace/CDR_Size.inl b/externals/ace/CDR_Size.inl similarity index 99% rename from dep/include/ace/CDR_Size.inl rename to externals/ace/CDR_Size.inl index 5d65ab94c09..4ea81523faf 100644 --- a/dep/include/ace/CDR_Size.inl +++ b/externals/ace/CDR_Size.inl @@ -34,6 +34,7 @@ ACE_SizeCDR::total_length (void) const return this->size_; } + // Encode the CDR stream. ACE_INLINE ACE_CDR::Boolean @@ -251,6 +252,7 @@ ACE_SizeCDR::write_float_array (const ACE_CDR::Float *x, length); } + ACE_INLINE ACE_CDR::Boolean ACE_SizeCDR::write_double_array (const ACE_CDR::Double *x, ACE_CDR::ULong length) @@ -271,8 +273,10 @@ ACE_SizeCDR::write_longdouble_array (const ACE_CDR::LongDouble* x, length); } + // **************************************************************** + ACE_INLINE ACE_CDR::Boolean operator<< (ACE_SizeCDR &ss, ACE_CDR::Char x) { @@ -416,4 +420,5 @@ operator<< (ACE_SizeCDR &ss, ACE_OutputCDR::from_wstring x) (ACE_CDR::Boolean) (ss.good_bit () && (!x.bound_ || len <= x.bound_)); } + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/CDR_Stream.cpp b/externals/ace/CDR_Stream.cpp similarity index 99% rename from dep/src/ace/CDR_Stream.cpp rename to externals/ace/CDR_Stream.cpp index aa313cdff75..74d33be5876 100644 --- a/dep/src/ace/CDR_Stream.cpp +++ b/externals/ace/CDR_Stream.cpp @@ -9,7 +9,7 @@ ACE_RCSID (ace, CDR_Stream, - "$Id: CDR_Stream.cpp 82559 2008-08-07 20:23:07Z parsons $") + "$Id: CDR_Stream.cpp 88653 2010-01-21 23:19:50Z sowayaa $") // **************************************************************** @@ -533,7 +533,7 @@ ACE_OutputCDR::write_8 (const ACE_CDR::ULongLong *x) if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0) { -#if defined (__arm__) +#if defined (__arm__) && !defined (ACE_HAS_IPHONE) // Convert to Intel format (12345678 => 56781234) const char *orig = reinterpret_cast (x); char *target = buf; @@ -633,6 +633,7 @@ ACE_OutputCDR::write_wchar_array_i (const ACE_CDR::WChar *x, return false; } + ACE_CDR::Boolean ACE_OutputCDR::write_array (const void *x, size_t size, @@ -682,6 +683,7 @@ ACE_OutputCDR::write_array (const void *x, return false; } + ACE_CDR::Boolean ACE_OutputCDR::write_boolean_array (const ACE_CDR::Boolean* x, ACE_CDR::ULong length) @@ -745,6 +747,7 @@ ACE_OutputCDR::replace (ACE_CDR::Long x, char* loc) return true; } + ACE_CDR::Boolean ACE_OutputCDR::replace (ACE_CDR::Short x, char* loc) { @@ -767,6 +770,7 @@ ACE_OutputCDR::replace (ACE_CDR::Short x, char* loc) return true; } + int ACE_OutputCDR::consolidate (void) { @@ -811,6 +815,7 @@ ACE_OutputCDR::consolidate (void) return 0; } + ACE_Message_Block* ACE_OutputCDR::find (char* loc) { @@ -1521,6 +1526,7 @@ ACE_InputCDR::read_wchar_array_i (ACE_CDR::WChar* x, return false; } + ACE_CDR::Boolean ACE_InputCDR::read_boolean_array (ACE_CDR::Boolean *x, ACE_CDR::ULong length) @@ -1606,7 +1612,7 @@ ACE_InputCDR::read_8 (ACE_CDR::ULongLong *x) if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0) { #if !defined (ACE_DISABLE_SWAP_ON_READ) -# if defined (__arm__) +# if defined (__arm__) && !defined (ACE_HAS_IPHONE) if (!this->do_byte_swap_) { // Convert from Intel format (12345678 => 56781234) @@ -1888,8 +1894,7 @@ ACE_InputCDR::clone_from (ACE_InputCDR &cdr) ACE_CDR::mb_align (&this->start_); - ACE_Data_Block *db = - this->start_.data_block (); + ACE_Data_Block *db = this->start_.data_block (); // If the size of the data that needs to be copied are higher than // what is available, then do a reallocation. @@ -1897,8 +1902,7 @@ ACE_InputCDR::clone_from (ACE_InputCDR &cdr) { // @@NOTE: We need to probably add another method to the message // block interface to simplify this - db = - cdr.start_.data_block ()->clone_nocopy (); + db = cdr.start_.data_block ()->clone_nocopy (); if (db == 0 || db->size ((wr_bytes) + ACE_CDR::MAX_ALIGNMENT) == -1) @@ -2057,4 +2061,3 @@ operator<< (std::ostream &os, ACE_OutputCDR::from_octet x) #endif /* GEN_OSTREAM_OPS */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/CDR_Stream.h b/externals/ace/CDR_Stream.h similarity index 99% rename from dep/include/ace/CDR_Stream.h rename to externals/ace/CDR_Stream.h index c49a0006266..0a200dc56dd 100644 --- a/dep/include/ace/CDR_Stream.h +++ b/externals/ace/CDR_Stream.h @@ -4,7 +4,7 @@ /** * @file CDR_Stream.h * - * $Id: CDR_Stream.h 82350 2008-07-22 07:36:47Z johnnyw $ + * $Id: CDR_Stream.h 84527 2009-02-19 14:01:42Z johnnyw $ * * ACE Common Data Representation (CDR) marshaling and demarshaling * classes. @@ -59,6 +59,7 @@ #include "Monitor_Size.h" #endif /* ACE_HAS_MONITOR_POINTS==1 */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Char_Codeset_Translator; @@ -119,8 +120,8 @@ public: ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION); /// Build a CDR stream with an initial buffer, it will *not* remove - /// , since it did not allocated it. It's important to be careful - /// with the alignment of . + /// @a data, since it did not allocated it. It's important to be careful + /// with the alignment of @a data. /** * Create an output stream from an arbitrary buffer, care must be * exercised with alignment, because this contructor will align if @@ -253,8 +254,8 @@ public: const ACE_CDR::WChar *x); //@} - /// @note the portion written starts at and ends - /// at . + /// @note the portion written starts at @a x and ends + /// at @a x + @a length. /// The length is *NOT* stored into the CDR stream. //@{ @name Array write operations ACE_CDR::Boolean write_boolean_array (const ACE_CDR::Boolean *x, @@ -517,9 +518,11 @@ private: size_t align, ACE_CDR::ULong length); + ACE_CDR::Boolean write_wchar_array_i (const ACE_CDR::WChar* x, ACE_CDR::ULong length); + /** * Grow the CDR stream. When it returns @a buf contains a pointer to * memory in the CDR stream, with at least @a size bytes ahead of it @@ -599,6 +602,7 @@ protected: static size_t wchar_maxbytes_; }; + // **************************************************************** /** @@ -659,7 +663,7 @@ public: ACE_Lock* lock = 0); /// Create an input stream from an ACE_Data_Block. The - /// indicates whether the can be deleted by the CDR stream + /// indicates whether the @a data can be deleted by the CDR stream /// or not ACE_InputCDR (ACE_Data_Block *data, ACE_Message_Block::Message_Flags flag = 0, @@ -915,7 +919,7 @@ public: */ void exchange_data_blocks (ACE_InputCDR &cdr); - /// Copy the data portion from the @c cdr to this cdr and return the + /// Copy the data portion from the @a cdr to this cdr and return the /// data content (ie. the ACE_Data_Block) from this CDR to the /// caller. /** @@ -1270,6 +1274,7 @@ extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os, extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is, ACE_CString &x); + ACE_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) @@ -1395,4 +1400,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CDR_STREAM_H */ - diff --git a/dep/include/ace/CDR_Stream.inl b/externals/ace/CDR_Stream.inl similarity index 99% rename from dep/include/ace/CDR_Stream.inl rename to externals/ace/CDR_Stream.inl index bf5a6e25cb2..2be60c154dd 100644 --- a/dep/include/ace/CDR_Stream.inl +++ b/externals/ace/CDR_Stream.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: CDR_Stream.inl 82350 2008-07-22 07:36:47Z johnnyw $ +// $Id: CDR_Stream.inl 84206 2009-01-21 02:49:26Z schmidt $ #include "ace/OS_NS_string.h" #include "ace/OS_Memory.h" @@ -411,6 +411,7 @@ ACE_OutputCDR::write_float_array (const ACE_CDR::Float *x, length); } + ACE_INLINE ACE_CDR::Boolean ACE_OutputCDR::write_double_array (const ACE_CDR::Double *x, ACE_CDR::ULong length) @@ -495,6 +496,7 @@ ACE_OutputCDR::get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor) minor = this->minor_version_; } + ACE_INLINE const ACE_Message_Block* ACE_OutputCDR::begin (void) const { @@ -570,7 +572,6 @@ ACE_OutputCDR::current_alignment (size_t current_alignment) this->current_alignment_ = current_alignment; #else ACE_UNUSED_ARG (current_alignment); - return 0; #endif /* ACE_LACKS_CDR_ALIGNMENT */ } @@ -648,6 +649,7 @@ ACE_InputCDR::read_char (ACE_CDR::Char &x) return this->char_translator_->read_char (*this, x); } + ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_short (ACE_CDR::Short &x) { @@ -661,6 +663,7 @@ ACE_InputCDR::read_ushort (ACE_CDR::UShort &x) return this->read_2 (&x); } + ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_long (ACE_CDR::Long &x) { @@ -668,12 +671,14 @@ ACE_InputCDR::read_long (ACE_CDR::Long &x) return this->read_4 (reinterpret_cast (temp)); } + ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_ulong (ACE_CDR::ULong &x) { return this->read_4 (&x); } + ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_longlong (ACE_CDR::LongLong &x) { @@ -901,6 +906,7 @@ ACE_InputCDR::read_float_array (ACE_CDR::Float *x, length); } + ACE_INLINE ACE_CDR::Boolean ACE_InputCDR::read_double_array (ACE_CDR::Double *x, ACE_CDR::ULong length) @@ -1527,6 +1533,7 @@ ACE_InputCDR::wchar_translator (void) const return this->wchar_translator_; } + ACE_INLINE void ACE_InputCDR::char_translator (ACE_Char_Codeset_Translator * ctran) { diff --git a/dep/src/ace/CE_Screen_Output.cpp b/externals/ace/CE_Screen_Output.cpp similarity index 99% rename from dep/src/ace/CE_Screen_Output.cpp rename to externals/ace/CE_Screen_Output.cpp index c5cdc43d208..dfd3d717a1f 100644 --- a/dep/src/ace/CE_Screen_Output.cpp +++ b/externals/ace/CE_Screen_Output.cpp @@ -156,4 +156,3 @@ ACE_CE_Screen_Output& ACE_CE_Screen_Output::operator << (FILE* pFile) ACE_END_VERSIONED_NAMESPACE_DECL #endif // ACE_HAS_WINCE - diff --git a/dep/include/ace/CE_Screen_Output.h b/externals/ace/CE_Screen_Output.h similarity index 99% rename from dep/include/ace/CE_Screen_Output.h rename to externals/ace/CE_Screen_Output.h index e4a3e3d92b0..ba2bc7c02b5 100644 --- a/dep/include/ace/CE_Screen_Output.h +++ b/externals/ace/CE_Screen_Output.h @@ -107,4 +107,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif // ACE_HAS_WINCE #endif // ACE_CE_SCREEN_OUTPUT_H - diff --git a/externals/ace/CMakeLists.txt b/externals/ace/CMakeLists.txt new file mode 100644 index 00000000000..db0dc7cdfee --- /dev/null +++ b/externals/ace/CMakeLists.txt @@ -0,0 +1,337 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# NOTE: Do not use glob here, it would include files we don't want +set(ace_STAT_SRCS + PrecompiledHeaders/WinAcePCH.cpp + ACE.cpp + ACE_crc32.cpp + ACE_crc_ccitt.cpp + ace_wchar.cpp + Activation_Queue.cpp + Active_Map_Manager.cpp + Addr.cpp + Argv_Type_Converter.cpp + Assert.cpp + Asynch_IO.cpp + Asynch_IO_Impl.cpp + Asynch_Pseudo_Task.cpp + ATM_Acceptor.cpp + ATM_Addr.cpp + ATM_Connector.cpp + ATM_Params.cpp + ATM_QoS.cpp + ATM_Stream.cpp + Atomic_Op.cpp + Atomic_Op_Sparc.c + Auto_Event.cpp + Barrier.cpp + Base_Thread_Adapter.cpp + Based_Pointer_Repository.cpp + Basic_Stats.cpp + Basic_Types.cpp + Capabilities.cpp + CDR_Base.cpp + CDR_Size.cpp + CDR_Stream.cpp + Cleanup.cpp + Codecs.cpp + Codeset_IBM1047.cpp + Codeset_Registry.cpp + Codeset_Registry_db.cpp + Condition_Recursive_Thread_Mutex.cpp + Condition_Thread_Mutex.cpp + Configuration.cpp + Configuration_Import_Export.cpp + Connection_Recycling_Strategy.cpp + Containers.cpp + Copy_Disabled.cpp + Countdown_Time.cpp + Date_Time.cpp + DEV.cpp + DEV_Addr.cpp + DEV_Connector.cpp + DEV_IO.cpp + Dev_Poll_Reactor.cpp + Dirent.cpp + Dirent_Selector.cpp + DLL.cpp + DLL_Manager.cpp + Dump.cpp + Dynamic.cpp + Dynamic_Message_Strategy.cpp + Dynamic_Service_Base.cpp + Dynamic_Service_Dependency.cpp + Encoding_Converter.cpp + Encoding_Converter_Factory.cpp + Event.cpp + Event_Handler.cpp + FIFO.cpp + FIFO_Recv.cpp + FIFO_Recv_Msg.cpp + FIFO_Send.cpp + FIFO_Send_Msg.cpp + FILE.cpp + FILE_Addr.cpp + FILE_Connector.cpp + FILE_IO.cpp + File_Lock.cpp + Filecache.cpp + Flag_Manip.cpp + Framework_Component.cpp + Functor.cpp + Functor_String.cpp + Get_Opt.cpp + gethrtime.cpp + Handle_Ops.cpp + Handle_Set.cpp + Hashable.cpp + High_Res_Timer.cpp + ICMP_Socket.cpp + INET_Addr.cpp + Init_ACE.cpp + IO_Cntl_Msg.cpp + IO_SAP.cpp + IOStream.cpp + IPC_SAP.cpp + Lib_Find.cpp + Local_Memory_Pool.cpp + Local_Name_Space.cpp + Local_Tokens.cpp + Lock.cpp + Log_Msg.cpp + Log_Msg_Backend.cpp + Log_Msg_Callback.cpp + Log_Msg_IPC.cpp + Log_Msg_NT_Event_Log.cpp + Log_Msg_UNIX_Syslog.cpp + Log_Record.cpp + Logging_Strategy.cpp + LSOCK.cpp + LSOCK_Acceptor.cpp + LSOCK_CODgram.cpp + LSOCK_Connector.cpp + LSOCK_Dgram.cpp + LSOCK_Stream.cpp + Malloc.cpp + Malloc_Allocator.cpp + Manual_Event.cpp + MEM_Acceptor.cpp + MEM_Addr.cpp + MEM_Connector.cpp + MEM_IO.cpp + Mem_Map.cpp + MEM_SAP.cpp + MEM_Stream.cpp + Message_Block.cpp + Message_Queue.cpp + Message_Queue_NT.cpp + Message_Queue_Vx.cpp + Method_Request.cpp + MMAP_Memory_Pool.cpp + Monitor_Admin.cpp + Monitor_Admin_Manager.cpp + Monitor_Base.cpp + Monitor_Control_Action.cpp + Monitor_Control_Types.cpp + Monitor_Point_Registry.cpp + Monitor_Size.cpp + Msg_WFMO_Reactor.cpp + Multihomed_INET_Addr.cpp + Mutex.cpp + Name_Proxy.cpp + Name_Request_Reply.cpp + Name_Space.cpp + Naming_Context.cpp + Netlink_Addr.cpp + Notification_Queue.cpp + Notification_Strategy.cpp + NT_Service.cpp + Obchunk.cpp + Object_Manager.cpp + Object_Manager_Base.cpp + OS_Errno.cpp + OS_Log_Msg_Attributes.cpp + OS_main.cpp + OS_NS_arpa_inet.cpp + OS_NS_ctype.cpp + OS_NS_dirent.cpp + OS_NS_dlfcn.cpp + OS_NS_errno.cpp + OS_NS_fcntl.cpp + OS_NS_math.cpp + OS_NS_netdb.cpp + OS_NS_poll.cpp + OS_NS_pwd.cpp + OS_NS_regex.cpp + OS_NS_signal.cpp + OS_NS_stdio.cpp + OS_NS_stdlib.cpp + OS_NS_string.cpp + OS_NS_strings.cpp + OS_NS_stropts.cpp + OS_NS_sys_mman.cpp + OS_NS_sys_msg.cpp + OS_NS_sys_resource.cpp + OS_NS_sys_select.cpp + OS_NS_sys_sendfile.cpp + OS_NS_sys_shm.cpp + OS_NS_sys_socket.cpp + OS_NS_sys_stat.cpp + OS_NS_sys_time.cpp + OS_NS_sys_uio.cpp + OS_NS_sys_utsname.cpp + OS_NS_sys_wait.cpp + OS_NS_Thread.cpp + OS_NS_time.cpp + OS_NS_unistd.cpp + OS_NS_wchar.cpp + OS_QoS.cpp + OS_Thread_Adapter.cpp + OS_TLI.cpp + Pagefile_Memory_Pool.cpp + Parse_Node.cpp + PI_Malloc.cpp + Ping_Socket.cpp + Pipe.cpp + POSIX_Asynch_IO.cpp + POSIX_CB_Proactor.cpp + POSIX_Proactor.cpp + Priority_Reactor.cpp + Proactor.cpp + Proactor_Impl.cpp + Process.cpp + Process_Manager.cpp + Process_Mutex.cpp + Process_Semaphore.cpp + Profile_Timer.cpp + Reactor.cpp + Reactor_Impl.cpp + Reactor_Notification_Strategy.cpp + Reactor_Timer_Interface.cpp + Read_Buffer.cpp + Recursive_Thread_Mutex.cpp + Recyclable.cpp + Registry.cpp + Registry_Name_Space.cpp + Remote_Name_Space.cpp + Remote_Tokens.cpp + Rtems_init.c + RW_Mutex.cpp + RW_Process_Mutex.cpp + RW_Thread_Mutex.cpp + Sample_History.cpp + Sbrk_Memory_Pool.cpp + Sched_Params.cpp + Select_Reactor_Base.cpp + Semaphore.cpp + Service_Config.cpp + Service_Gestalt.cpp + Service_Manager.cpp + Service_Object.cpp + Service_Repository.cpp + Service_Types.cpp + Shared_Memory.cpp + Shared_Memory_MM.cpp + Shared_Memory_Pool.cpp + Shared_Memory_SV.cpp + Shared_Object.cpp + Sig_Adapter.cpp + Sig_Handler.cpp + Signal.cpp + SOCK.cpp + SOCK_Acceptor.cpp + SOCK_CODgram.cpp + Sock_Connect.cpp + SOCK_Connector.cpp + SOCK_Dgram.cpp + SOCK_Dgram_Bcast.cpp + SOCK_Dgram_Mcast.cpp + SOCK_IO.cpp + SOCK_Netlink.cpp + SOCK_SEQPACK_Acceptor.cpp + SOCK_SEQPACK_Association.cpp + SOCK_SEQPACK_Connector.cpp + SOCK_Stream.cpp + SPIPE.cpp + SPIPE_Acceptor.cpp + SPIPE_Addr.cpp + SPIPE_Connector.cpp + SPIPE_Stream.cpp + SString.cpp + Stack_Trace.cpp + Stats.cpp + String_Base_Const.cpp + SUN_Proactor.cpp + SV_Message.cpp + SV_Message_Queue.cpp + SV_Semaphore_Complex.cpp + SV_Semaphore_Simple.cpp + SV_Shared_Memory.cpp + Svc_Conf_Lexer.cpp + Svc_Conf_y.cpp + Synch_Options.cpp + System_Time.cpp + Task.cpp + Thread.cpp + Thread_Adapter.cpp + Thread_Control.cpp + Thread_Exit.cpp + Thread_Hook.cpp + Thread_Manager.cpp + Thread_Mutex.cpp + Thread_Semaphore.cpp + Throughput_Stats.cpp + Time_Value.cpp + Timeprobe.cpp + TLI.cpp + TLI_Acceptor.cpp + TLI_Connector.cpp + TLI_Stream.cpp + Token.cpp + Token_Collection.cpp + Token_Invariants.cpp + Token_Manager.cpp + Token_Request_Reply.cpp + TP_Reactor.cpp + Trace.cpp + TSS_Adapter.cpp + TTY_IO.cpp + UNIX_Addr.cpp + UPIPE_Acceptor.cpp + UPIPE_Connector.cpp + UPIPE_Stream.cpp + UTF16_Encoding_Converter.cpp + UTF32_Encoding_Converter.cpp + UTF8_Encoding_Converter.cpp + UUID.cpp + WFMO_Reactor.cpp + WIN32_Asynch_IO.cpp + WIN32_Proactor.cpp + XML_Svc_Conf.cpp + XTI_ATM_Mcast.cpp +) + +include_directories( + ${CMAKE_SOURCE_DIR}/externals + ${CMAKE_SOURCE_DIR}/externals/ace/PrecompiledHeaders + ${CMAKE_SOURCE_DIR}/externals/zlib +) + +# Needed for PCH support +set_source_files_properties(Atomic_Op_Sparc.c Rtems_init.c PROPERTIES LANGUAGE CXX) + +add_definitions(-DACE_BUILD_DLL) + +add_library(ace SHARED ${ace_STAT_SRCS}) + +if(DO_PCH) + add_native_precompiled_header(ace ${CMAKE_SOURCE_DIR}/externals/ace/PrecompiledHeaders/WinAcePCH) +endif() \ No newline at end of file diff --git a/dep/include/ace/CORBA_macros.h b/externals/ace/CORBA_macros.h similarity index 100% rename from dep/include/ace/CORBA_macros.h rename to externals/ace/CORBA_macros.h index 7284e9ae8e3..beab26b7f04 100644 --- a/dep/include/ace/CORBA_macros.h +++ b/externals/ace/CORBA_macros.h @@ -82,6 +82,7 @@ // the macros should still work if you defined your adapter class as // ACE_EXCEPTION_TYPE. + // The following macros assume that an environment variable is passed // in/out of each function that can throw an exception. The type of the // environment variable is defined by ACE_ENV_TYPE. @@ -572,4 +573,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CORBA_MACROS_H */ - diff --git a/dep/src/ace/Cache_Map_Manager_T.cpp b/externals/ace/Cache_Map_Manager_T.cpp similarity index 99% rename from dep/src/ace/Cache_Map_Manager_T.cpp rename to externals/ace/Cache_Map_Manager_T.cpp index 59303acb515..f87031eb0d7 100644 --- a/dep/src/ace/Cache_Map_Manager_T.cpp +++ b/externals/ace/Cache_Map_Manager_T.cpp @@ -418,4 +418,3 @@ ACE_Cache_Map_Iterator ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_CACHE_MAP_MANAGER_T_CPP */ - diff --git a/dep/include/ace/Cache_Map_Manager_T.h b/externals/ace/Cache_Map_Manager_T.h similarity index 99% rename from dep/include/ace/Cache_Map_Manager_T.h rename to externals/ace/Cache_Map_Manager_T.h index 1476597ab54..060a8b38aac 100644 --- a/dep/include/ace/Cache_Map_Manager_T.h +++ b/externals/ace/Cache_Map_Manager_T.h @@ -403,4 +403,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CACHE_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Cache_Map_Manager_T.inl b/externals/ace/Cache_Map_Manager_T.inl similarity index 99% rename from dep/include/ace/Cache_Map_Manager_T.inl rename to externals/ace/Cache_Map_Manager_T.inl index 5c5c4eb593e..bcd48bd33e9 100644 --- a/dep/include/ace/Cache_Map_Manager_T.inl +++ b/externals/ace/Cache_Map_Manager_T.inl @@ -221,6 +221,7 @@ ACE_Cache_Map_Reverse_Iterator ACE_INLINE void ACE_Cache_Map_Reverse_Iterator::dump (void) const { diff --git a/dep/src/ace/Cached_Connect_Strategy_T.cpp b/externals/ace/Cached_Connect_Strategy_T.cpp similarity index 99% rename from dep/src/ace/Cached_Connect_Strategy_T.cpp rename to externals/ace/Cached_Connect_Strategy_T.cpp index abf546c514f..077c6d6a9ae 100644 --- a/dep/src/ace/Cached_Connect_Strategy_T.cpp +++ b/externals/ace/Cached_Connect_Strategy_T.cpp @@ -1,4 +1,4 @@ -//$Id: Cached_Connect_Strategy_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +//$Id: Cached_Connect_Strategy_T.cpp 82771 2008-09-17 18:47:48Z johnnyw $ #ifndef ACE_CACHED_CONNECT_STRATEGY_T_CPP #define ACE_CACHED_CONNECT_STRATEGY_T_CPP @@ -51,7 +51,7 @@ ACE_Cached_Connect_Strategy_Ex::check_hint_i const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry, ACE_Pair > *&entry, @@ -141,7 +141,7 @@ ACE_Cached_Connect_Strategy_Ex::find_or_create_svc_handler_i const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry, ACE_Pair > *&entry, @@ -256,7 +256,7 @@ ACE_Cached_Connect_Strategy_Ex::cached_connect (SVC_HANDLER *&sh, const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms) { @@ -319,7 +319,7 @@ ACE_Cached_Connect_Strategy_Ex::connect_svc_handler_i const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, int& found) @@ -587,7 +587,7 @@ ACE_Bounded_Cached_Connect_Strategy::find_or_create_svc_handler_i const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry, @@ -732,4 +732,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #undef ACE_T2 #endif /* ACE_CACHED_CONNECT_STRATEGY_T_CPP */ - diff --git a/dep/include/ace/Cached_Connect_Strategy_T.h b/externals/ace/Cached_Connect_Strategy_T.h similarity index 97% rename from dep/include/ace/Cached_Connect_Strategy_T.h rename to externals/ace/Cached_Connect_Strategy_T.h index 9f3227b54f1..d062e1eaa7a 100644 --- a/dep/include/ace/Cached_Connect_Strategy_T.h +++ b/externals/ace/Cached_Connect_Strategy_T.h @@ -4,7 +4,7 @@ /** * @file Cached_Connect_Strategy_T.h * - * $Id: Cached_Connect_Strategy_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Cached_Connect_Strategy_T.h 82771 2008-09-17 18:47:48Z johnnyw $ * * @author Kirthika Parameswaran */ @@ -130,7 +130,7 @@ protected: const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry, ACE_Pair > *&entry, @@ -140,7 +140,7 @@ protected: const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry, ACE_Pair > *&entry, @@ -150,7 +150,7 @@ protected: const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, int &found); @@ -168,7 +168,7 @@ protected: const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms); @@ -235,7 +235,7 @@ protected: const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, - int reuse_addr, + bool reuse_addr, int flags, int perms, ACE_Hash_Map_Entry, @@ -260,4 +260,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* CACHED_CONNECT_STRATEGY_T_H */ - diff --git a/dep/src/ace/Caching_Strategies_T.cpp b/externals/ace/Caching_Strategies_T.cpp similarity index 99% rename from dep/src/ace/Caching_Strategies_T.cpp rename to externals/ace/Caching_Strategies_T.cpp index f7c047fb5bb..2b0fd4e764a 100644 --- a/dep/src/ace/Caching_Strategies_T.cpp +++ b/externals/ace/Caching_Strategies_T.cpp @@ -57,4 +57,3 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Null_Caching_Strategy) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_CACHING_STRATEGIES_T_CPP */ - diff --git a/dep/include/ace/Caching_Strategies_T.h b/externals/ace/Caching_Strategies_T.h similarity index 100% rename from dep/include/ace/Caching_Strategies_T.h rename to externals/ace/Caching_Strategies_T.h index e2fa428c3b7..e4b0817aa26 100644 --- a/dep/include/ace/Caching_Strategies_T.h +++ b/externals/ace/Caching_Strategies_T.h @@ -242,6 +242,7 @@ public: int notify_unbind (int result, const ATTRIBUTES &attr); + /// This method acts as a notification about the CONTAINERs trybind /// method call int notify_trybind (int result, @@ -549,4 +550,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CACHING_STRATEGIES_H */ - diff --git a/dep/include/ace/Caching_Strategies_T.inl b/externals/ace/Caching_Strategies_T.inl similarity index 100% rename from dep/include/ace/Caching_Strategies_T.inl rename to externals/ace/Caching_Strategies_T.inl diff --git a/dep/src/ace/Caching_Utility_T.cpp b/externals/ace/Caching_Utility_T.cpp similarity index 99% rename from dep/src/ace/Caching_Utility_T.cpp rename to externals/ace/Caching_Utility_T.cpp index 15e402985cc..a03a4575891 100644 --- a/dep/src/ace/Caching_Utility_T.cpp +++ b/externals/ace/Caching_Utility_T.cpp @@ -497,4 +497,3 @@ ACE_Null_Caching_Utility::minimum ( ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_CACHING_UTILITY_T_CPP */ - diff --git a/dep/include/ace/Caching_Utility_T.h b/externals/ace/Caching_Utility_T.h similarity index 99% rename from dep/include/ace/Caching_Utility_T.h rename to externals/ace/Caching_Utility_T.h index 9859159be4c..5428682d099 100644 --- a/dep/include/ace/Caching_Utility_T.h +++ b/externals/ace/Caching_Utility_T.h @@ -345,4 +345,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CACHING_UTILITY_H */ - diff --git a/dep/src/ace/Capabilities.cpp b/externals/ace/Capabilities.cpp similarity index 100% rename from dep/src/ace/Capabilities.cpp rename to externals/ace/Capabilities.cpp index 95bd812586f..5d46e75472a 100644 --- a/dep/src/ace/Capabilities.cpp +++ b/externals/ace/Capabilities.cpp @@ -13,6 +13,7 @@ ACE_RCSID (ace, Capabilities, "$Id: Capabilities.cpp 80826 2008-03-04 14:51:23Z wotte $") + #define ACE_ESC ((ACE_TCHAR)0x1b) ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -352,4 +353,3 @@ ACE_Capabilities::getent (const ACE_TCHAR *fname, const ACE_TCHAR *name) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Capabilities.h b/externals/ace/Capabilities.h similarity index 99% rename from dep/include/ace/Capabilities.h rename to externals/ace/Capabilities.h index 8c239825e7d..e893d987c08 100644 --- a/dep/include/ace/Capabilities.h +++ b/externals/ace/Capabilities.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_CAPABILITIES_H #define ACE_CAPABILITIES_H #include /**/ "ace/pre.h" @@ -30,6 +31,7 @@ # include "ace/OS_NS_ctype.h" #endif /* ACE_IS_SPLITTING */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -217,4 +219,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* __ACE_CAPABILITIES_H__ */ - diff --git a/dep/include/ace/Capabilities.inl b/externals/ace/Capabilities.inl similarity index 100% rename from dep/include/ace/Capabilities.inl rename to externals/ace/Capabilities.inl diff --git a/externals/ace/Cleanup.cpp b/externals/ace/Cleanup.cpp new file mode 100644 index 00000000000..5c7317ed4da --- /dev/null +++ b/externals/ace/Cleanup.cpp @@ -0,0 +1,181 @@ +// $Id: Cleanup.cpp 84201 2009-01-20 06:26:02Z johnnyw $ + +#include "ace/Cleanup.h" + +ACE_RCSID (ace, + Cleanup, + "$Id: Cleanup.cpp 84201 2009-01-20 06:26:02Z johnnyw $") + +#if !defined (ACE_HAS_INLINED_OSCALLS) +# include "ace/Cleanup.inl" +#endif /* ACE_HAS_INLINED_OSCALLS */ + +#include "ace/OS_Memory.h" +#include "ace/OS_NS_string.h" +#include "ace/os_include/os_typeinfo.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +void +ACE_Cleanup::cleanup (void *) +{ + delete this; +} + +ACE_Cleanup::~ACE_Cleanup (void) +{ +} + +/*****************************************************************************/ + +extern "C" void +ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *object, void *param) +{ + object->cleanup (param); +} + +/*****************************************************************************/ + +ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void) + : object_ (0), + cleanup_hook_ (0), + param_ (0), + name_ (0) +{ +} + +ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void *object, + ACE_CLEANUP_FUNC cleanup_hook, + void *param, + const char *name) + : object_ (object), + cleanup_hook_ (cleanup_hook), + param_ (param), + name_ (name ? ACE_OS::strdup (name) : 0) +{ +} + +ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void) +{ + if (this->name_) + ACE_OS::free ((void *) name_); +} + +bool +ACE_Cleanup_Info_Node::operator== (const ACE_Cleanup_Info_Node &o) const +{ + return o.object_ == this->object_ + && o.cleanup_hook_ == this->cleanup_hook_ + && o.param_ == this->param_; +} + +bool +ACE_Cleanup_Info_Node::operator!= (const ACE_Cleanup_Info_Node &o) const +{ + return !(*this == o); +} + + +/*****************************************************************************/ + +ACE_OS_Exit_Info::ACE_OS_Exit_Info (void) +{ +} + +ACE_OS_Exit_Info::~ACE_OS_Exit_Info (void) +{ +} + +int +ACE_OS_Exit_Info::at_exit_i (void *object, + ACE_CLEANUP_FUNC cleanup_hook, + void *param, + const char* name) +{ + // Return -1 and sets errno if unable to allocate storage. Enqueue + // at the head and dequeue from the head to get LIFO ordering. + ACE_Cleanup_Info_Node *new_node = 0; + + ACE_NEW_RETURN (new_node, + ACE_Cleanup_Info_Node (object, cleanup_hook, param, name), + -1); + + registered_objects_.push_front (new_node); + + return 0; +} + +bool +ACE_OS_Exit_Info::find (void *object) +{ + for (ACE_Cleanup_Info_Node *iter = registered_objects_.head (); + iter != 0; + iter = iter->next ()) + { + if (iter->object () == object) + { + // The object has already been registered. + return true; + } + } + + return false; +} + +bool +ACE_OS_Exit_Info::remove (void *object) +{ + ACE_Cleanup_Info_Node *node = 0; + for (ACE_Cleanup_Info_Node *iter = registered_objects_.head (); + iter != 0; + iter = iter->next ()) + { + if (iter->object () == object) + { + node = iter; + break; + } + } + + if (node) + { + registered_objects_.remove (node); + delete node; + return true; + } + + return false; +} + + +void +ACE_OS_Exit_Info::call_hooks (void) +{ + // Call all registered cleanup hooks, in reverse order of + // registration. + for (ACE_Cleanup_Info_Node *iter = registered_objects_.pop_front (); + iter != 0; + iter = registered_objects_.pop_front ()) + { + if (iter->cleanup_hook () == reinterpret_cast ( + ACE_CLEANUP_DESTROYER_NAME)) + { + // The object is an ACE_Cleanup. + ACE_CLEANUP_DESTROYER_NAME ( + reinterpret_cast (iter->object ()), + iter->param ()); + } + else if (iter->object () == &ace_exit_hook_marker) + { + // The hook is an ACE_EXIT_HOOK. + (* reinterpret_cast (iter->cleanup_hook ())) (); + } + else + { + (*iter->cleanup_hook ()) (iter->object (), iter->param ()); + } + delete iter; + } +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Cleanup.h b/externals/ace/Cleanup.h similarity index 64% rename from dep/include/ace/Cleanup.h rename to externals/ace/Cleanup.h index c38db701360..bd750724fb3 100644 --- a/dep/include/ace/Cleanup.h +++ b/externals/ace/Cleanup.h @@ -4,7 +4,7 @@ /** * @file Cleanup.h * - * $Id: Cleanup.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Cleanup.h 84163 2009-01-15 07:57:27Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -27,6 +27,9 @@ #include /**/ "ace/ACE_export.h" +# include "ace/Intrusive_List.h" +# include "ace/Intrusive_List_Node.h" + #if (defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1) # include "ace/Global_Macros.h" # define ACE_CLEANUP_DESTROYER_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ace_cleanup_destroyer) @@ -54,27 +57,39 @@ public: virtual void cleanup (void *param = 0); }; -// Adapter for cleanup, used by ACE_Object_Manager. +/// Adapter for cleanup, used by ACE_Object_Manager. extern "C" ACE_Export void ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *, void *param = 0); /** - * @class ACE_Cleanup_Info + * @class ACE_Cleanup_Info_Node * - * @brief Hold cleanup information for thread/process + * @brief For maintaining a list of ACE_Cleanup_Info items. + * + * For internal use by ACE_Object_Manager. */ -class ACE_Export ACE_Cleanup_Info +class ACE_Cleanup_Info_Node : public ACE_Intrusive_List_Node { public: - /// Default constructor. - ACE_Cleanup_Info (void); + ACE_Cleanup_Info_Node (void); + ACE_Cleanup_Info_Node (void *object, + ACE_CLEANUP_FUNC cleanup_hook, + void *param, + const char *name); + ~ACE_Cleanup_Info_Node (void); /// Equality operator. - bool operator== (const ACE_Cleanup_Info &o) const; + bool operator== (const ACE_Cleanup_Info_Node &o) const; /// Inequality operator. - bool operator!= (const ACE_Cleanup_Info &o) const; + bool operator!= (const ACE_Cleanup_Info_Node &o) const; + void* object(void); + + ACE_CLEANUP_FUNC cleanup_hook (void); + + void *param (void); +private: /// Point to object that gets passed into the . void *object_; @@ -83,15 +98,20 @@ public: /// Parameter passed to the . void *param_; + + /// Name of the cleanup object + const char *name_; }; -class ACE_Cleanup_Info_Node; +typedef ACE_Intrusive_List ACE_Cleanup_Info_Node_List; /** * @class ACE_OS_Exit_Info * * @brief Hold Object Manager cleanup (exit) information. * + * @internal + * * For internal use by the ACE library, only. */ class ACE_Export ACE_OS_Exit_Info @@ -104,11 +124,15 @@ public: ~ACE_OS_Exit_Info (void); /// Use to register a cleanup hook. - int at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param); + int at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param, const char* name = 0); - /// Look for a registered cleanup hook object. Returns 1 if already - /// registered, 0 if not. - int find (void *object); + /// Look for a registered cleanup hook object. Returns true if already + /// registered, false if not. + bool find (void *object); + + /// Remove a registered cleanup hook object. Returns true if removed + /// false if not. + bool remove (void *object); /// Call all registered cleanup hooks, in reverse order of /// registration. @@ -116,13 +140,12 @@ public: private: /** - * Keeps track of all registered objects. The last node is only - * used to terminate the list (it doesn't contain a valid - * ACE_Cleanup_Info). + * Keeps track of all registered objects. */ - ACE_Cleanup_Info_Node *registered_objects_; + ACE_Cleanup_Info_Node_List registered_objects_; }; + ACE_END_VERSIONED_NAMESPACE_DECL # if defined (ACE_HAS_INLINED_OSCALLS) @@ -135,4 +158,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_CLEANUP_H */ - diff --git a/externals/ace/Cleanup.inl b/externals/ace/Cleanup.inl new file mode 100644 index 00000000000..196a9f4788f --- /dev/null +++ b/externals/ace/Cleanup.inl @@ -0,0 +1,30 @@ +// -*- C++ -*- +// +// $Id: Cleanup.inl 83956 2008-12-03 07:57:38Z johnnyw $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE +ACE_Cleanup::ACE_Cleanup (void) +{ +} + +ACE_INLINE void* +ACE_Cleanup_Info_Node::object(void) +{ + return this->object_; +} + +ACE_INLINE ACE_CLEANUP_FUNC +ACE_Cleanup_Info_Node::cleanup_hook (void) +{ + return this->cleanup_hook_; +} + +ACE_INLINE void * +ACE_Cleanup_Info_Node::param (void) +{ + return this->param_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Cleanup_Strategies_T.cpp b/externals/ace/Cleanup_Strategies_T.cpp similarity index 99% rename from dep/src/ace/Cleanup_Strategies_T.cpp rename to externals/ace/Cleanup_Strategies_T.cpp index b6e95e9692b..32965993774 100644 --- a/dep/src/ace/Cleanup_Strategies_T.cpp +++ b/externals/ace/Cleanup_Strategies_T.cpp @@ -93,4 +93,3 @@ ACE_Null_Cleanup_Strategy::cleanup (CONTAINER &, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_CLEANUP_STRATEGIES_T_CPP */ - diff --git a/dep/include/ace/Cleanup_Strategies_T.h b/externals/ace/Cleanup_Strategies_T.h similarity index 100% rename from dep/include/ace/Cleanup_Strategies_T.h rename to externals/ace/Cleanup_Strategies_T.h index 89775562f6e..ca51b47b10f 100644 --- a/dep/include/ace/Cleanup_Strategies_T.h +++ b/externals/ace/Cleanup_Strategies_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef CLEANUP_STRATEGIES_H #define CLEANUP_STRATEGIES_H #include /**/ "ace/pre.h" @@ -146,4 +147,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* CLEANUP_STRATEGIES_H */ - diff --git a/dep/src/ace/Codecs.cpp b/externals/ace/Codecs.cpp similarity index 99% rename from dep/src/ace/Codecs.cpp rename to externals/ace/Codecs.cpp index d0bb0778304..71491fe1c44 100644 --- a/dep/src/ace/Codecs.cpp +++ b/externals/ace/Codecs.cpp @@ -71,7 +71,7 @@ ACE_Base64::encode (const ACE_Byte* input, result[pos++] = alphabet[bits & 0x3f]; cols += 4; if (cols == max_columns) { - if (is_chunked) + if (is_chunked) result[pos++] = '\n'; cols = 0; } @@ -232,4 +232,3 @@ ACE_Base64::init () } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Codecs.h b/externals/ace/Codecs.h similarity index 100% rename from dep/include/ace/Codecs.h rename to externals/ace/Codecs.h index 5b1b8bbde70..2c4227dd0ad 100644 --- a/dep/include/ace/Codecs.h +++ b/externals/ace/Codecs.h @@ -30,6 +30,7 @@ #include "ace/Basic_Types.h" #include "ace/Global_Macros.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -118,4 +119,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CODECS_H */ - diff --git a/dep/src/ace/Codeset_IBM1047.cpp b/externals/ace/Codeset_IBM1047.cpp similarity index 100% rename from dep/src/ace/Codeset_IBM1047.cpp rename to externals/ace/Codeset_IBM1047.cpp index dde4eafb42c..91582cf4ef3 100644 --- a/dep/src/ace/Codeset_IBM1047.cpp +++ b/externals/ace/Codeset_IBM1047.cpp @@ -13,6 +13,7 @@ */ //============================================================================= + #include "ace/Codeset_IBM1047.h" #if defined (ACE_HAS_EBCDIC) @@ -306,4 +307,3 @@ ACE_ISO8859_IBM1047::write_char_array (ACE_OutputCDR &out, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_EBCDIC */ - diff --git a/dep/include/ace/Codeset_IBM1047.h b/externals/ace/Codeset_IBM1047.h similarity index 100% rename from dep/include/ace/Codeset_IBM1047.h rename to externals/ace/Codeset_IBM1047.h index 5e19763f94c..3caa8881fbf 100644 --- a/dep/include/ace/Codeset_IBM1047.h +++ b/externals/ace/Codeset_IBM1047.h @@ -13,6 +13,7 @@ */ //============================================================================= + #ifndef ACE_CODESET_IMB1047_H #define ACE_CODESET_IMB1047_H #include /**/ "ace/pre.h" @@ -124,4 +125,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CODESET_IMB1047_H */ - diff --git a/dep/src/ace/Codeset_Registry.cpp b/externals/ace/Codeset_Registry.cpp similarity index 99% rename from dep/src/ace/Codeset_Registry.cpp rename to externals/ace/Codeset_Registry.cpp index 789340af33c..c23ef37231a 100644 --- a/dep/src/ace/Codeset_Registry.cpp +++ b/externals/ace/Codeset_Registry.cpp @@ -109,4 +109,3 @@ ACE_Codeset_Registry::get_max_bytes_i (ACE_CDR::ULong codeset_id) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Codeset_Registry.h b/externals/ace/Codeset_Registry.h similarity index 99% rename from dep/include/ace/Codeset_Registry.h rename to externals/ace/Codeset_Registry.h index 80887d9a106..e72c435f82b 100644 --- a/dep/include/ace/Codeset_Registry.h +++ b/externals/ace/Codeset_Registry.h @@ -102,4 +102,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CODESET_REGISTRY_H */ - diff --git a/dep/include/ace/Codeset_Registry.inl b/externals/ace/Codeset_Registry.inl similarity index 100% rename from dep/include/ace/Codeset_Registry.inl rename to externals/ace/Codeset_Registry.inl diff --git a/dep/src/ace/Codeset_Registry_db.cpp b/externals/ace/Codeset_Registry_db.cpp similarity index 99% rename from dep/src/ace/Codeset_Registry_db.cpp rename to externals/ace/Codeset_Registry_db.cpp index 1f900db9b4f..32b38631c6f 100644 --- a/dep/src/ace/Codeset_Registry_db.cpp +++ b/externals/ace/Codeset_Registry_db.cpp @@ -31,4 +31,3 @@ ACE_Codeset_Registry::registry_db_[] = size_t const ACE_Codeset_Registry::num_registry_entries_ = 9; ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Codeset_Symbols.h b/externals/ace/Codeset_Symbols.h similarity index 99% rename from dep/include/ace/Codeset_Symbols.h rename to externals/ace/Codeset_Symbols.h index 2cfb6bc26b6..6ffe198c1a9 100644 --- a/dep/include/ace/Codeset_Symbols.h +++ b/externals/ace/Codeset_Symbols.h @@ -218,4 +218,3 @@ #define ACE_CODESET_ID_TAO_BACKWARD_COMPATIBLE 0xf54414F0U #endif // CODESET_SYMBOLS_H - diff --git a/dep/src/ace/Condition_Recursive_Thread_Mutex.cpp b/externals/ace/Condition_Recursive_Thread_Mutex.cpp similarity index 95% rename from dep/src/ace/Condition_Recursive_Thread_Mutex.cpp rename to externals/ace/Condition_Recursive_Thread_Mutex.cpp index 658100f1818..1f357589f55 100644 --- a/dep/src/ace/Condition_Recursive_Thread_Mutex.cpp +++ b/externals/ace/Condition_Recursive_Thread_Mutex.cpp @@ -3,7 +3,7 @@ /** * @file Condition_Recursive_Thread_Mutex.cpp * - * $Id: Condition_Recursive_Thread_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Condition_Recursive_Thread_Mutex.cpp 89127 2010-02-22 19:58:18Z schmidt $ * * Originally in Synch.cpp * @@ -63,7 +63,7 @@ ACE_Condition::wait (ACE_Recursive_Thread_Mutex &mut const ACE_Time_Value *abstime) { ACE_recursive_mutex_state mutex_state_holder; - ACE_recursive_thread_mutex_t &recursive_mutex = mutex.mutex (); + ACE_recursive_thread_mutex_t &recursive_mutex = mutex.lock (); if (ACE_OS::recursive_mutex_cond_unlock (&recursive_mutex, mutex_state_holder) == -1) @@ -78,7 +78,7 @@ ACE_Condition::wait (ACE_Recursive_Thread_Mutex &mut // returned with the lock held, but waiters primed and waiting to be // released. At cond_wait below, the mutex will be released. // On return, it will be reacquired. - const int result = abstime == 0 + int const result = abstime == 0 ? ACE_OS::cond_wait (&this->cond_, &mutex.get_nesting_mutex ()) : ACE_OS::cond_timedwait (&this->cond_, @@ -127,4 +127,3 @@ ACE_Condition_Recursive_Thread_Mutex::ACE_Condition_Recursive_Thread_Mutex ( ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/Condition_Recursive_Thread_Mutex.h b/externals/ace/Condition_Recursive_Thread_Mutex.h similarity index 93% rename from dep/include/ace/Condition_Recursive_Thread_Mutex.h rename to externals/ace/Condition_Recursive_Thread_Mutex.h index 8625aa2fcea..ac3177da8c8 100644 --- a/dep/include/ace/Condition_Recursive_Thread_Mutex.h +++ b/externals/ace/Condition_Recursive_Thread_Mutex.h @@ -4,7 +4,7 @@ /** * @file Condition_Recursive_Thread_Mutex.h * - * $Id: Condition_Recursive_Thread_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Condition_Recursive_Thread_Mutex.h 86731 2009-09-17 12:23:48Z johnnyw $ * * Moved from Synch.h. * @@ -32,8 +32,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL template class ACE_Condition; /** - * @class ACE_Condition - * * @brief ACE_Condition template specialization written using * @a ACE_Recursive_Thread_Mutex. This allows threads to block until * shared data changes state using recursive mutexes. @@ -57,7 +55,7 @@ public: /** * Block on condition, or until absolute time-of-day has passed. If - * abstime == 0 use "blocking" semantics. Else, if + * abstime == 0 use "blocking" semantics. Else, if @a abstime * != 0 and the call times out before the condition is signaled * returns -1 and sets errno to ETIME. */ @@ -116,4 +114,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONDITION_RECURSIVE_THREAD_MUTEX_H */ - diff --git a/dep/src/ace/Condition_T.cpp b/externals/ace/Condition_T.cpp similarity index 89% rename from dep/src/ace/Condition_T.cpp rename to externals/ace/Condition_T.cpp index 6bc7ce579ce..ae75d9ff359 100644 --- a/dep/src/ace/Condition_T.cpp +++ b/externals/ace/Condition_T.cpp @@ -1,4 +1,4 @@ -// $Id: Condition_T.cpp 81283 2008-04-09 01:28:18Z schmidt $ +// $Id: Condition_T.cpp 89127 2010-02-22 19:58:18Z schmidt $ #ifndef ACE_CONDITION_T_CPP #define ACE_CONDITION_T_CPP @@ -87,7 +87,7 @@ ACE_Condition::wait (void) { // ACE_TRACE ("ACE_Condition::wait"); return ACE_OS::cond_wait (&this->cond_, - &this->mutex_.lock_); + &this->mutex_.lock ()); } template int @@ -96,12 +96,17 @@ ACE_Condition::wait (MUTEX &mutex, { // ACE_TRACE ("ACE_Condition::wait"); if (abstime == 0) + { return ACE_OS::cond_wait (&this->cond_, - &mutex.lock_); + &mutex.lock ()); + } else - return ACE_OS::cond_timedwait (&this->cond_, - &mutex.lock_, - (ACE_Time_Value *) abstime); + { + ACE_Time_Value tv = *abstime; + return ACE_OS::cond_timedwait (&this->cond_, + &mutex.lock (), + &tv); + } } // Peform an "alertable" timed wait. If the argument ABSTIME == 0 @@ -120,4 +125,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ #endif /* ACE_CONDITION_T_CPP */ - diff --git a/dep/include/ace/Condition_T.h b/externals/ace/Condition_T.h similarity index 99% rename from dep/include/ace/Condition_T.h rename to externals/ace/Condition_T.h index 8e6132ec92c..936ce821777 100644 --- a/dep/include/ace/Condition_T.h +++ b/externals/ace/Condition_T.h @@ -165,4 +165,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONDITION_T_H */ - diff --git a/dep/include/ace/Condition_T.inl b/externals/ace/Condition_T.inl similarity index 100% rename from dep/include/ace/Condition_T.inl rename to externals/ace/Condition_T.inl diff --git a/dep/src/ace/Condition_Thread_Mutex.cpp b/externals/ace/Condition_Thread_Mutex.cpp similarity index 99% rename from dep/src/ace/Condition_Thread_Mutex.cpp rename to externals/ace/Condition_Thread_Mutex.cpp index d1142f72172..c9f2620e432 100644 --- a/dep/src/ace/Condition_Thread_Mutex.cpp +++ b/externals/ace/Condition_Thread_Mutex.cpp @@ -124,4 +124,3 @@ ACE_Condition_Thread_Mutex::broadcast (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/Condition_Thread_Mutex.h b/externals/ace/Condition_Thread_Mutex.h similarity index 99% rename from dep/include/ace/Condition_Thread_Mutex.h rename to externals/ace/Condition_Thread_Mutex.h index bc47ae2514a..693ff0820aa 100644 --- a/dep/include/ace/Condition_Thread_Mutex.h +++ b/externals/ace/Condition_Thread_Mutex.h @@ -188,4 +188,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONDITION_THREAD_MUTEX_H */ - diff --git a/dep/include/ace/Condition_Thread_Mutex.inl b/externals/ace/Condition_Thread_Mutex.inl similarity index 100% rename from dep/include/ace/Condition_Thread_Mutex.inl rename to externals/ace/Condition_Thread_Mutex.inl diff --git a/dep/src/ace/Configuration.cpp b/externals/ace/Configuration.cpp similarity index 98% rename from dep/src/ace/Configuration.cpp rename to externals/ace/Configuration.cpp index 9c7f1d278b5..1914f2dc651 100644 --- a/dep/src/ace/Configuration.cpp +++ b/externals/ace/Configuration.cpp @@ -1,9 +1,10 @@ -// $Id: Configuration.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Configuration.cpp 86348 2009-08-04 14:45:29Z shuston $ #include "ace/Configuration.h" #include "ace/Auto_Ptr.h" #include "ace/SString.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_strings.h" +#include "ace/Tokenizer_T.h" // Can remove this when import_config and export_config are removed from // ACE_Configuration. They're deprecated at ACE 5.2. @@ -478,6 +479,7 @@ ACE_Configuration_Win32Registry::ACE_Configuration_Win32Registry (HKEY hKey) root_ = ACE_Configuration_Section_Key (temp); } + ACE_Configuration_Win32Registry::~ACE_Configuration_Win32Registry (void) { } @@ -517,11 +519,7 @@ ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_K KEY_ALL_ACCESS, 0, &result_key, -#if defined (__MINGW32__) (PDWORD) 0 -#else - 0 -#endif /* __MINGW32__ */ )) != ERROR_SUCCESS) { errno = errnum; @@ -539,7 +537,7 @@ ACE_Configuration_Win32Registry::open_section (const ACE_Configuration_Section_K int ACE_Configuration_Win32Registry::remove_section (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* sub_section, - int recursive) + bool recursive) { if (validate_name (sub_section)) return -1; @@ -573,13 +571,12 @@ ACE_Configuration_Win32Registry::remove_section (const ACE_Configuration_Section 0, 0) == ERROR_SUCCESS) { - remove_section (section, name_buffer, 1); + remove_section (section, name_buffer, true); buffer_size = ACE_DEFAULT_BUFSIZE; } } - int errnum; - errnum = ACE_TEXT_RegDeleteKey (base_key, sub_section); + int const errnum = ACE_TEXT_RegDeleteKey (base_key, sub_section); if (errnum != ERROR_SUCCESS) { errno = errnum; @@ -978,6 +975,7 @@ ACE_Configuration_Win32Registry::remove_value (const ACE_Configuration_Section_K return 0; } + int ACE_Configuration_Win32Registry::load_key (const ACE_Configuration_Section_Key& key, HKEY& hKey) @@ -1047,11 +1045,7 @@ ACE_Configuration_Win32Registry::resolve_key (HKEY hKey, KEY_ALL_ACCESS, 0, &subkey, -#if defined (__MINGW32__) (PDWORD) 0 -#else - 0 -#endif /* __MINGW32__ */ )) !=ERROR_SUCCESS) { errno = errnum; @@ -1265,6 +1259,12 @@ ACE_Configuration_Heap::~ACE_Configuration_Heap (void) int ACE_Configuration_Heap::open (size_t default_map_size) { + if (this->allocator_ != 0) + { + errno = EBUSY; + return -1; + } + default_map_size_ = default_map_size; // Create the allocator with the appropriate options. // The name used for the lock is the same as one used @@ -1275,11 +1275,18 @@ ACE_Configuration_Heap::open (size_t default_map_size) return create_index (); } + int ACE_Configuration_Heap::open (const ACE_TCHAR* file_name, void* base_address, size_t default_map_size) { + if (this->allocator_ != 0) + { + errno = EBUSY; + return -1; + } + default_map_size_ = default_map_size; // Make sure that the file name is of the legal length. @@ -1370,6 +1377,7 @@ ACE_Configuration_Heap::load_key (const ACE_Configuration_Section_Key& key, return 0; } + int ACE_Configuration_Heap::add_section (const ACE_Configuration_Section_Key& base, const ACE_TCHAR* sub_section, @@ -1591,7 +1599,7 @@ ACE_Configuration_Heap::open_simple_section (const ACE_Configuration_Section_Key int ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* sub_section, - int recursive) + bool recursive) { ACE_ASSERT (this->allocator_); if (validate_name (sub_section)) @@ -1613,7 +1621,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key section += sub_section; ACE_Configuration_ExtId SectionExtId (section.fast_rep ()); - SECTION_HASH::ENTRY* section_entry; + SECTION_HASH::ENTRY* section_entry = 0; SECTION_HASH* hashmap = index_; if (hashmap->find (SectionExtId, section_entry)) return -1; @@ -1628,7 +1636,7 @@ ACE_Configuration_Heap::remove_section (const ACE_Configuration_Section_Key& key ACE_TString name; while (!enumerate_sections (section, index, name)) { - if (remove_section (section, name.fast_rep (), 1)) + if (remove_section (section, name.fast_rep (), true)) return -1; ++index; @@ -1797,7 +1805,7 @@ ACE_Configuration_Heap::set_string_value (const ACE_Configuration_Section_Key& k return -1; // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; + VALUE_HASH::ENTRY* entry = 0; ACE_Configuration_ExtId item_name (t_name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -1856,7 +1864,7 @@ ACE_Configuration_Heap::set_integer_value (const ACE_Configuration_Section_Key& return -1; // section does not exist // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; + VALUE_HASH::ENTRY* entry = 0; ACE_Configuration_ExtId item_name (t_name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -1906,7 +1914,7 @@ ACE_Configuration_Heap::set_binary_value (const ACE_Configuration_Section_Key& k return -1; // section does not exist // Get the entry for this item (if it exists) - VALUE_HASH::ENTRY* entry; + VALUE_HASH::ENTRY* entry = 0; ACE_Configuration_ExtId item_name (t_name); if (section_int.value_hash_map_->VALUE_HASH::find (item_name, entry) == 0) { @@ -2008,6 +2016,7 @@ ACE_Configuration_Heap::get_integer_value (const ACE_Configuration_Section_Key& return -1; // section does not exist } + // See if it exists first ACE_Configuration_ExtId VExtId (t_name); ACE_Configuration_Value_IntId VIntId; @@ -2095,7 +2104,7 @@ ACE_Configuration_Heap::find_value (const ACE_Configuration_Section_Key& key, // Find it ACE_Configuration_ExtId ValueExtId (t_name); - VALUE_HASH::ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry = 0; if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) return -1; // value does not exist @@ -2125,7 +2134,7 @@ ACE_Configuration_Heap::remove_value (const ACE_Configuration_Section_Key& key, // Find it ACE_Configuration_ExtId ValueExtId (t_name); - VALUE_HASH::ENTRY* value_entry; + VALUE_HASH::ENTRY* value_entry = 0; if (((VALUE_HASH *) IntId.value_hash_map_)->find (ValueExtId, value_entry)) return -1; @@ -2141,4 +2150,3 @@ ACE_Configuration_Heap::remove_value (const ACE_Configuration_Section_Key& key, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Configuration.h b/externals/ace/Configuration.h similarity index 95% rename from dep/include/ace/Configuration.h rename to externals/ace/Configuration.h index 14972e1eca3..3543619017e 100644 --- a/dep/include/ace/Configuration.h +++ b/externals/ace/Configuration.h @@ -4,7 +4,7 @@ /** * @file Configuration.h * - * $Id: Configuration.h 82294 2008-07-12 13:03:37Z johnnyw $ + * $Id: Configuration.h 86348 2009-08-04 14:45:29Z shuston $ * * @author Chris Hafey * @@ -37,6 +37,7 @@ #include "ace/Local_Memory_Pool.h" #include "ace/Synch_Traits.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -176,7 +177,7 @@ public: /** * @param key Section key to remove the named section from. * @param sub_section Name of the section to remove. - * @param recursive If non zero, any subkeys below @a sub_section are + * @param recursive If true, any subkeys below @a sub_section are * removed as well. * * @retval 0 for success. @@ -184,7 +185,7 @@ public: */ virtual int remove_section (const ACE_Configuration_Section_Key &key, const ACE_TCHAR *sub_section, - int recursive) = 0; + bool recursive) = 0; /** * Enumerates through the values in a section. @@ -422,6 +423,7 @@ protected: ACE_Configuration (const ACE_Configuration& rhs); ACE_Configuration& operator= (const ACE_Configuration& rhs); + ACE_Configuration_Section_Key root_; }; @@ -481,7 +483,7 @@ public: virtual int remove_section (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* sub_section, - int recursive); + bool recursive); virtual int enumerate_values (const ACE_Configuration_Section_Key& key, int index, @@ -596,7 +598,7 @@ public: /// allocator name_ was created in void free (ACE_Allocator *alloc); - /// function is required in order for this class to be usable by + /// hash function is required in order for this class to be usable by /// ACE_Hash_Map_Manager. u_long hash (void) const; @@ -789,12 +791,37 @@ public: /// Destructor virtual ~ACE_Configuration_Heap (void); - /// Opens a configuration based on a file name + /** + * Opens a configuration that allocates its memory from a memory-mapped file. + * This makes it possible to persist a configuration to permanent storage. + * This is not the same as exporting the configuration to a file; the + * memory-mapped file is not likely to be very readable by humans. + * + * @param file_name Name of the file to map into memory. + * + * @param base_address Address to map the base of @a file_name to. + * + * @param default_map_size Starting size for the internal hash tables that + * contain configuration information. + * + * @retval 0 for success. + * @retval -1 for error, with errno set to indicate the cause. If open() + * is called multiple times, errno will be @c EBUSY. + */ int open (const ACE_TCHAR* file_name, void* base_address = ACE_DEFAULT_BASE_ADDR, size_t default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE); - /// Opens a heap based configuration + /** + * Opens a configuration that allocates memory from the heap. + * + * @param default_map_size Starting size for the internal hash tables that + * contain configuration information. + * + * @retval 0 for success. + * @retval -1 for error, with errno set to indicate the cause. If open() + * is called multiple times, errno will be @c EBUSY. + */ int open (size_t default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE); virtual int open_section (const ACE_Configuration_Section_Key& base, @@ -803,7 +830,7 @@ public: virtual int remove_section (const ACE_Configuration_Section_Key& key, const ACE_TCHAR* sub_section, - int recursive); + bool recursive); virtual int enumerate_values (const ACE_Configuration_Section_Key& key, int index, @@ -890,4 +917,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONFIGURATION_H */ - diff --git a/dep/include/ace/Configuration.inl b/externals/ace/Configuration.inl similarity index 100% rename from dep/include/ace/Configuration.inl rename to externals/ace/Configuration.inl diff --git a/dep/src/ace/Configuration_Import_Export.cpp b/externals/ace/Configuration_Import_Export.cpp similarity index 99% rename from dep/src/ace/Configuration_Import_Export.cpp rename to externals/ace/Configuration_Import_Export.cpp index 5225ec48331..ae489f05dfa 100644 --- a/dep/src/ace/Configuration_Import_Export.cpp +++ b/externals/ace/Configuration_Import_Export.cpp @@ -1,4 +1,4 @@ -// $Id: Configuration_Import_Export.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Configuration_Import_Export.cpp 84565 2009-02-23 08:20:39Z johnnyw $ #include "ace/Configuration_Import_Export.h" #include "ace/OS_Errno.h" @@ -254,7 +254,7 @@ ACE_Registry_ImpExp::export_section (const ACE_Configuration_Section_Key& sectio ACE_TString header = ACE_TEXT ("["); header += path; header += ACE_TEXT ("]"); - header += ACE_TEXT (" \n"); + header += ACE_TEXT ("\n"); if (ACE_OS::fputs (header.fast_rep (), out) < 0) return -1; // Write out each value @@ -388,6 +388,7 @@ ACE_Registry_ImpExp::process_previous_line_format (ACE_TCHAR* buffer, return 0; } // end read_previous_line_format + ACE_Ini_ImpExp::ACE_Ini_ImpExp (ACE_Configuration& config) : ACE_Config_ImpExp_Base (config) { @@ -667,4 +668,3 @@ ACE_Ini_ImpExp::squish (ACE_TCHAR *src) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Configuration_Import_Export.h b/externals/ace/Configuration_Import_Export.h similarity index 99% rename from dep/include/ace/Configuration_Import_Export.h rename to externals/ace/Configuration_Import_Export.h index ec47bafa144..e93544bee29 100644 --- a/dep/include/ace/Configuration_Import_Export.h +++ b/externals/ace/Configuration_Import_Export.h @@ -213,4 +213,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONFIGURATION_IMPORT_EXPORT_H */ - diff --git a/dep/src/ace/Connection_Recycling_Strategy.cpp b/externals/ace/Connection_Recycling_Strategy.cpp similarity index 99% rename from dep/src/ace/Connection_Recycling_Strategy.cpp rename to externals/ace/Connection_Recycling_Strategy.cpp index 752b2220bb3..78b08884340 100644 --- a/dep/src/ace/Connection_Recycling_Strategy.cpp +++ b/externals/ace/Connection_Recycling_Strategy.cpp @@ -1,7 +1,9 @@ #include "ace/Connection_Recycling_Strategy.h" + ACE_RCSID(ace, Connection_Recycling_Strategy, "$Id: Connection_Recycling_Strategy.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Connection_Recycling_Strategy::~ACE_Connection_Recycling_Strategy (void) @@ -9,4 +11,3 @@ ACE_Connection_Recycling_Strategy::~ACE_Connection_Recycling_Strategy (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Connection_Recycling_Strategy.h b/externals/ace/Connection_Recycling_Strategy.h similarity index 99% rename from dep/include/ace/Connection_Recycling_Strategy.h rename to externals/ace/Connection_Recycling_Strategy.h index 0770c3a6c26..75169638dcf 100644 --- a/dep/include/ace/Connection_Recycling_Strategy.h +++ b/externals/ace/Connection_Recycling_Strategy.h @@ -61,4 +61,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_CONNECTION_RECYCLING_STRATEGY*/ - diff --git a/dep/src/ace/Connector.cpp b/externals/ace/Connector.cpp similarity index 96% rename from dep/src/ace/Connector.cpp rename to externals/ace/Connector.cpp index 6372ffb1a5a..820ca875c16 100644 --- a/dep/src/ace/Connector.cpp +++ b/externals/ace/Connector.cpp @@ -1,4 +1,4 @@ -// $Id: Connector.cpp 81991 2008-06-16 19:05:40Z elliott_c $ +// $Id: Connector.cpp 89510 2010-03-17 12:21:14Z vzykov $ #ifndef ACE_CONNECTOR_CPP #define ACE_CONNECTOR_CPP @@ -24,12 +24,33 @@ ACE_NonBlocking_Connect_Handler::ACE_NonBlocking_Connect_Handler long id) : connector_ (connector) , svc_handler_ (sh) + , cleanup_svc_handler_ (0) , timer_id_ (id) { ACE_TRACE ("ACE_NonBlocking_Connect_Handler::ACE_NonBlocking_Connect_Handler"); this->reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); + + if (this->svc_handler_ != 0 && + this->svc_handler_->reference_counting_policy ().value () == + ACE_Event_Handler::Reference_Counting_Policy::ENABLED) + { + // If SVC_HANDLER is reference counted then NBCH holds a reference + // in cleanup_svc_handle_ which is both a pointer to SVC_HANDLER + // and a flag that triggers remove_reference in NBCH destructor. + this->cleanup_svc_handler_ = sh; + this->cleanup_svc_handler_->add_reference (); + } +} + +template +ACE_NonBlocking_Connect_Handler::~ACE_NonBlocking_Connect_Handler (void) +{ + if (this->cleanup_svc_handler_) + { + this->cleanup_svc_handler_->remove_reference (); + } } template SVC_HANDLER * @@ -119,7 +140,7 @@ ACE_NonBlocking_Connect_Handler::handle_timeout ACE_TRACE ("ACE_NonBlocking_Connect_Handler::handle_timeout"); SVC_HANDLER *svc_handler = 0; - int retval = this->close (svc_handler) ? 0 : -1; + int const retval = this->close (svc_handler) ? 0 : -1; // Forward to the SVC_HANDLER the that was passed in as a // magic cookie during ACE_Connector::connect(). This gives the @@ -145,7 +166,9 @@ ACE_NonBlocking_Connect_Handler::handle_input (ACE_HANDLE) // Close Svc_Handler. if (svc_handler != 0) - svc_handler->close (NORMAL_CLOSE_OPERATION); + { + svc_handler->close (NORMAL_CLOSE_OPERATION); + } return retval; } @@ -162,7 +185,9 @@ ACE_NonBlocking_Connect_Handler::handle_output (ACE_HANDLE handle) int const retval = this->close (svc_handler) ? 0 : -1; if (svc_handler != 0) - connector.initialize_svc_handler (handle, svc_handler); + { + connector.initialize_svc_handler (handle, svc_handler); + } return retval; } @@ -593,7 +618,7 @@ ACE_Connector::initialize_svc_handler { // Try to find out if the reactor uses event associations for the // handles it waits on. If so we need to reset it. - int reset_new_handle = + bool reset_new_handle = this->reactor ()->uses_event_associations (); if (reset_new_handle) @@ -964,4 +989,3 @@ ACE_Strategy_Connector::concurrency_strategy ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_CONNECTOR_C */ - diff --git a/dep/include/ace/Connector.h b/externals/ace/Connector.h similarity index 98% rename from dep/include/ace/Connector.h rename to externals/ace/Connector.h index 73689356501..08ef2aa0b8d 100644 --- a/dep/include/ace/Connector.h +++ b/externals/ace/Connector.h @@ -4,7 +4,7 @@ /** * @file Connector.h * - * $Id: Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Connector.h 89510 2010-03-17 12:21:14Z vzykov $ * * @author Douglas C. Schmidt */ @@ -67,6 +67,9 @@ public: SVC_HANDLER *, long timer_id); + /// Destructor. + ~ACE_NonBlocking_Connect_Handler (void); + /// Close up and return underlying SVC_HANDLER through @c sh. /** * If the return value is true the close was performed succesfully, @@ -127,6 +130,9 @@ private: /// Associated SVC_HANDLER. SVC_HANDLER *svc_handler_; + /// Same as svc_handler_ if svc_handler_ is reference counted. + SVC_HANDLER *cleanup_svc_handler_; + /// Associated timer id. long timer_id_; }; @@ -190,7 +196,7 @@ public: * 1). @a flags and @a perms can be used to pass any flags that are * needed to perform specific operations such as opening a file * within connect with certain permissions. If the connection fails - * the hook on the will be called + * the hook on the @a svc_handler will be called * automatically to prevent resource leaks. */ virtual int connect (SVC_HANDLER *&svc_handler, @@ -209,7 +215,7 @@ public: * context of the internal cache its use is thread-safe. But the * actual svc_handler for the current connection is returned in the * second parameter @a svc_handler. If the connection fails the - * hook on the will be called automatically to + * hook on the @a svc_handler will be called automatically to * prevent resource leaks. */ virtual int connect (SVC_HANDLER *&svc_handler_hint, @@ -561,4 +567,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONNECTOR_H */ - diff --git a/dep/src/ace/Containers.cpp b/externals/ace/Containers.cpp similarity index 99% rename from dep/src/ace/Containers.cpp rename to externals/ace/Containers.cpp index 754ef0e5194..244a9ad4b1b 100644 --- a/dep/src/ace/Containers.cpp +++ b/externals/ace/Containers.cpp @@ -10,4 +10,3 @@ ACE_RCSID (ace, #include "ace/Containers.inl" #endif /* __ACE_INLINE__ */ - diff --git a/dep/include/ace/Containers.h b/externals/ace/Containers.h similarity index 99% rename from dep/include/ace/Containers.h rename to externals/ace/Containers.h index f6f1d35bb60..ecff8e368e4 100644 --- a/dep/include/ace/Containers.h +++ b/externals/ace/Containers.h @@ -69,4 +69,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONTAINERS_H */ - diff --git a/dep/include/ace/Containers.inl b/externals/ace/Containers.inl similarity index 100% rename from dep/include/ace/Containers.inl rename to externals/ace/Containers.inl diff --git a/dep/src/ace/Containers_T.cpp b/externals/ace/Containers_T.cpp similarity index 99% rename from dep/src/ace/Containers_T.cpp rename to externals/ace/Containers_T.cpp index 29a4b35743c..f4b6bd8a7f0 100644 --- a/dep/src/ace/Containers_T.cpp +++ b/externals/ace/Containers_T.cpp @@ -1930,4 +1930,3 @@ ACE_Array::operator== (const ACE_Array &s) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_CONTAINERS_T_CPP */ - diff --git a/dep/include/ace/Containers_T.h b/externals/ace/Containers_T.h similarity index 99% rename from dep/include/ace/Containers_T.h rename to externals/ace/Containers_T.h index d8ba71c64a6..3f5463fe3d6 100644 --- a/dep/include/ace/Containers_T.h +++ b/externals/ace/Containers_T.h @@ -4,7 +4,7 @@ /** * @file Containers_T.h * - * $Id: Containers_T.h 82588 2008-08-11 13:37:41Z johnnyw $ + * $Id: Containers_T.h 88975 2010-02-12 19:19:38Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -40,6 +40,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Allocator; + /** * @class ACE_Bounded_Stack * @@ -172,6 +173,7 @@ private: //---------------------------------------- + /** * @class ACE_Fixed_Stack * @@ -331,6 +333,8 @@ private: T item_; }; + + /** * @class ACE_Unbounded_Stack * @@ -404,6 +408,7 @@ public: // = Classic Stack operations. + ///Push an element onto the top of stack. /** * Place a new item on top of the stack. Returns -1 if the stack @@ -769,6 +774,7 @@ public: ACE_ALLOC_HOOK_DECLARE; }; + /** * @class ACE_Double_Linked_List * @@ -986,6 +992,7 @@ protected: ACE_Allocator *allocator_; }; + template class ACE_DLList; template class ACE_DLList_Iterator; template class ACE_DLList_Reverse_Iterator; @@ -1546,6 +1553,7 @@ private: ssize_t next_; }; + /** * @class ACE_Bounded_Set * @@ -1768,6 +1776,7 @@ private: ACE_Ordered_MultiSet &set_; }; + /** * @class ACE_Ordered_MultiSet * @@ -1984,13 +1993,8 @@ class ACE_Array : public ACE_Array_Base public: // Define a "trait" typedef T TYPE; - typedef ACE_Array_Iterator ITERATOR; - - // = Exceptions. - - // = Initialization and termination methods. - + /// Dynamically create an uninitialized array. /** * Initialize an empty array of the specified size using the provided @@ -2062,4 +2066,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_CONTAINERS_T_H */ - diff --git a/dep/include/ace/Containers_T.inl b/externals/ace/Containers_T.inl similarity index 99% rename from dep/include/ace/Containers_T.inl rename to externals/ace/Containers_T.inl index b387061ac80..912c9df8bb8 100644 --- a/dep/include/ace/Containers_T.inl +++ b/externals/ace/Containers_T.inl @@ -159,6 +159,7 @@ ACE_Unbounded_Stack::size (void) const // --- + // --- template ACE_INLINE int @@ -247,6 +248,8 @@ ACE_Ordered_MultiSet_Iterator::dump (void) const #endif /* ACE_HAS_DUMP */ } + + // -- template ACE_INLINE int @@ -309,6 +312,7 @@ ACE_Array::operator!= (const ACE_Array &s) const // **************************************************************** + // **************************************************************** template ACE_INLINE void @@ -416,6 +420,7 @@ ACE_DLList_Iterator::dump (void) const #endif /* ACE_HAS_DUMP */ } + template ACE_INLINE int ACE_DLList_Reverse_Iterator::remove (void) { @@ -462,6 +467,7 @@ ACE_DLList_Reverse_Iterator::next (void) const return (T *) (temp ? temp->item_ : 0); } + template ACE_INLINE void ACE_DLList_Reverse_Iterator::dump (void) const { diff --git a/dep/src/ace/Copy_Disabled.cpp b/externals/ace/Copy_Disabled.cpp similarity index 99% rename from dep/src/ace/Copy_Disabled.cpp rename to externals/ace/Copy_Disabled.cpp index 8fa35ddb02f..6878311197d 100644 --- a/dep/src/ace/Copy_Disabled.cpp +++ b/externals/ace/Copy_Disabled.cpp @@ -8,10 +8,12 @@ #include "ace/Copy_Disabled.h" + ACE_RCSID (ace, Copy_Disabled, "$Id: Copy_Disabled.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Copy_Disabled::ACE_Copy_Disabled (void) @@ -19,4 +21,3 @@ ACE_Copy_Disabled::ACE_Copy_Disabled (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Copy_Disabled.h b/externals/ace/Copy_Disabled.h similarity index 99% rename from dep/include/ace/Copy_Disabled.h rename to externals/ace/Copy_Disabled.h index 4dd6c2216b5..f7b40e26422 100644 --- a/dep/include/ace/Copy_Disabled.h +++ b/externals/ace/Copy_Disabled.h @@ -63,4 +63,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_COPY_DISABLED_H */ - diff --git a/dep/src/ace/Countdown_Time.cpp b/externals/ace/Countdown_Time.cpp similarity index 67% rename from dep/src/ace/Countdown_Time.cpp rename to externals/ace/Countdown_Time.cpp index 3b3eede4364..d76a0fa4cf5 100644 --- a/dep/src/ace/Countdown_Time.cpp +++ b/externals/ace/Countdown_Time.cpp @@ -3,7 +3,11 @@ ACE_RCSID (ace, Countdown_Time, - "$Id: Countdown_Time.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Countdown_Time.cpp 85382 2009-05-19 06:52:56Z johnnyw $") + +#if !defined (__ACE_INLINE__) +#include "ace/Countdown_Time.inl" +#endif /* __ACE_INLINE__ */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,20 +33,16 @@ ACE_Countdown_Time::start (void) } } -bool -ACE_Countdown_Time::stopped (void) const -{ - return stopped_; -} - void ACE_Countdown_Time::stop (void) { - if (this->max_wait_time_ != 0 && this->stopped_ == false) + if (this->max_wait_time_ != 0 && !this->stopped_) { - ACE_Time_Value elapsed_time = ACE_OS::gettimeofday () - this->start_time_; + ACE_Time_Value const elapsed_time = + ACE_OS::gettimeofday () - this->start_time_; - if (*this->max_wait_time_ > elapsed_time) + if (elapsed_time >= ACE_Time_Value::zero && + *this->max_wait_time_ > elapsed_time) { *this->max_wait_time_ -= elapsed_time; } @@ -56,12 +56,4 @@ ACE_Countdown_Time::stop (void) } } -void -ACE_Countdown_Time::update (void) -{ - this->stop (); - this->start (); -} - ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Countdown_Time.h b/externals/ace/Countdown_Time.h similarity index 87% rename from dep/include/ace/Countdown_Time.h rename to externals/ace/Countdown_Time.h index cc76bed02f4..b9c9a467f62 100644 --- a/dep/include/ace/Countdown_Time.h +++ b/externals/ace/Countdown_Time.h @@ -4,7 +4,7 @@ /** * @file Countdown_Time.h * - * $Id: Countdown_Time.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Countdown_Time.h 85365 2009-05-18 08:27:42Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -22,6 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Time_Value.h" +#include "ace/Copy_Disabled.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -34,7 +35,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * time the stop() method is called the @c max_wait_time is * updated. */ -class ACE_Export ACE_Countdown_Time +class ACE_Export ACE_Countdown_Time : private ACE_Copy_Disabled { public: /// Cache the @a max_wait_time and call @c start(). @@ -67,15 +68,14 @@ private: /// Keeps track of whether we've already been stopped. bool stopped_; - - // Prevent copying - ACE_Countdown_Time (const ACE_Countdown_Time &); - ACE_Countdown_Time &operator= (const ACE_Countdown_Time &); }; ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" -#endif /* ACE_COUNTDOWN_TIME_H */ +#if defined (__ACE_INLINE__) +#include "ace/Countdown_Time.inl" +#endif /* __ACE_INLINE__ */ +#endif /* ACE_COUNTDOWN_TIME_H */ diff --git a/externals/ace/Countdown_Time.inl b/externals/ace/Countdown_Time.inl new file mode 100644 index 00000000000..4a9eb8e0e43 --- /dev/null +++ b/externals/ace/Countdown_Time.inl @@ -0,0 +1,20 @@ +// -*- C++ -*- +// +// $Id: Countdown_Time.inl 85368 2009-05-18 10:23:19Z johnnyw $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE bool +ACE_Countdown_Time::stopped (void) const +{ + return stopped_; +} + +ACE_INLINE void +ACE_Countdown_Time::update (void) +{ + this->stop (); + this->start (); +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/DEV.cpp b/externals/ace/DEV.cpp similarity index 99% rename from dep/src/ace/DEV.cpp rename to externals/ace/DEV.cpp index 7b4fb00f2b2..42178a68e6b 100644 --- a/dep/src/ace/DEV.cpp +++ b/externals/ace/DEV.cpp @@ -41,4 +41,3 @@ ACE_DEV::close (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/DEV.h b/externals/ace/DEV.h similarity index 100% rename from dep/include/ace/DEV.h rename to externals/ace/DEV.h index 21b4783ca4a..86f8d5dc863 100644 --- a/dep/include/ace/DEV.h +++ b/externals/ace/DEV.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_DEV_H #define ACE_DEV_H #include /**/ "ace/pre.h" @@ -75,4 +76,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DEV_H */ - diff --git a/dep/include/ace/DEV.inl b/externals/ace/DEV.inl similarity index 100% rename from dep/include/ace/DEV.inl rename to externals/ace/DEV.inl diff --git a/dep/src/ace/DEV_Addr.cpp b/externals/ace/DEV_Addr.cpp similarity index 99% rename from dep/src/ace/DEV_Addr.cpp rename to externals/ace/DEV_Addr.cpp index 73abb6568aa..64bbb50873c 100644 --- a/dep/src/ace/DEV_Addr.cpp +++ b/externals/ace/DEV_Addr.cpp @@ -106,4 +106,3 @@ ACE_DEV_Addr::operator= (const ACE_DEV_Addr &sa) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/DEV_Addr.h b/externals/ace/DEV_Addr.h similarity index 99% rename from dep/include/ace/DEV_Addr.h rename to externals/ace/DEV_Addr.h index f658cb0207d..49ec5023a7c 100644 --- a/dep/include/ace/DEV_Addr.h +++ b/externals/ace/DEV_Addr.h @@ -88,4 +88,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DEV_ADDR_H */ - diff --git a/dep/include/ace/DEV_Addr.inl b/externals/ace/DEV_Addr.inl similarity index 100% rename from dep/include/ace/DEV_Addr.inl rename to externals/ace/DEV_Addr.inl diff --git a/dep/src/ace/DEV_Connector.cpp b/externals/ace/DEV_Connector.cpp similarity index 99% rename from dep/src/ace/DEV_Connector.cpp rename to externals/ace/DEV_Connector.cpp index 9f4c985b1d4..bdc2530acd8 100644 --- a/dep/src/ace/DEV_Connector.cpp +++ b/externals/ace/DEV_Connector.cpp @@ -8,10 +8,12 @@ #include "ace/DEV_Connector.inl" #endif /* __ACE_INLINE__ */ + ACE_RCSID (ace, DEV_Connector, "$Id: DEV_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_DEV_Connector) @@ -49,4 +51,3 @@ ACE_DEV_Connector::connect (ACE_DEV_IO &new_io, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/DEV_Connector.h b/externals/ace/DEV_Connector.h similarity index 97% rename from dep/include/ace/DEV_Connector.h rename to externals/ace/DEV_Connector.h index 9a949ed92d7..2f71f608882 100644 --- a/dep/include/ace/DEV_Connector.h +++ b/externals/ace/DEV_Connector.h @@ -4,7 +4,7 @@ /** * @file DEV_Connector.h * - * $Id: DEV_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: DEV_Connector.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Gerhard Lenzer and Douglas C. Schmidt */ @@ -22,6 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -86,7 +87,7 @@ public: int perms = 0); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); /// Dump the state of an object. void dump (void) const; @@ -107,4 +108,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DEV_CONNECTOR_H */ - diff --git a/dep/include/ace/DEV_Connector.inl b/externals/ace/DEV_Connector.inl similarity index 85% rename from dep/include/ace/DEV_Connector.inl rename to externals/ace/DEV_Connector.inl index 924a4254791..a57a38b71f4 100644 --- a/dep/include/ace/DEV_Connector.inl +++ b/externals/ace/DEV_Connector.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: DEV_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: DEV_Connector.inl 82723 2008-09-16 09:35:44Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -23,12 +23,11 @@ ACE_DEV_Connector::ACE_DEV_Connector (ACE_DEV_IO &new_io, remote_sap.get_path_name (), ACE_TEXT ("ACE_DEV_IO"))); } -ACE_INLINE int -ACE_DEV_Connector::reset_new_handle (ACE_HANDLE handle) +ACE_INLINE bool +ACE_DEV_Connector::reset_new_handle (ACE_HANDLE) { - ACE_UNUSED_ARG (handle); // Nothing to do here since the handle is not a socket - return 0; + return false; } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/DEV_IO.cpp b/externals/ace/DEV_IO.cpp similarity index 100% rename from dep/src/ace/DEV_IO.cpp rename to externals/ace/DEV_IO.cpp index 82dd891b661..b9a8e1f46b9 100644 --- a/dep/src/ace/DEV_IO.cpp +++ b/externals/ace/DEV_IO.cpp @@ -9,6 +9,7 @@ ACE_RCSID(ace, DEV_IO, "$Id: DEV_IO.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_DEV_IO) @@ -128,4 +129,3 @@ ACE_DEV_IO::recv (size_t n, ...) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/DEV_IO.h b/externals/ace/DEV_IO.h similarity index 99% rename from dep/include/ace/DEV_IO.h rename to externals/ace/DEV_IO.h index e19cfd35603..3b1c3deb334 100644 --- a/dep/include/ace/DEV_IO.h +++ b/externals/ace/DEV_IO.h @@ -183,4 +183,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DEV_IO_H */ - diff --git a/dep/include/ace/DEV_IO.inl b/externals/ace/DEV_IO.inl similarity index 100% rename from dep/include/ace/DEV_IO.inl rename to externals/ace/DEV_IO.inl diff --git a/dep/src/ace/DLL.cpp b/externals/ace/DLL.cpp similarity index 100% rename from dep/src/ace/DLL.cpp rename to externals/ace/DLL.cpp index 7ed04b942c8..cad25110032 100644 --- a/dep/src/ace/DLL.cpp +++ b/externals/ace/DLL.cpp @@ -67,6 +67,7 @@ ACE_DLL::operator= (const ACE_DLL &rhs) return *this; } + // If the library name and the opening mode are specified than on // object creation the library is implicitly opened. @@ -264,4 +265,3 @@ ACE_DLL::set_handle (ACE_SHLIB_HANDLE handle, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/DLL.h b/externals/ace/DLL.h similarity index 99% rename from dep/include/ace/DLL.h rename to externals/ace/DLL.h index afd309d02c4..fa748e8d944 100644 --- a/dep/include/ace/DLL.h +++ b/externals/ace/DLL.h @@ -59,6 +59,7 @@ public: /// Allow assignment ACE_DLL& operator= (const ACE_DLL &rhs); + /** * This constructor performs the actions of open() during construction. * @param dll_name The name or path of the DLL to load. @@ -166,6 +167,7 @@ private: bool close_handle_on_destruction = true, ACE_SHLIB_HANDLE handle = 0); + //private: public: @@ -192,4 +194,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DLL_H */ - diff --git a/dep/src/ace/DLL_Manager.cpp b/externals/ace/DLL_Manager.cpp similarity index 97% rename from dep/src/ace/DLL_Manager.cpp rename to externals/ace/DLL_Manager.cpp index 997c4e13471..9f2578e10aa 100644 --- a/dep/src/ace/DLL_Manager.cpp +++ b/externals/ace/DLL_Manager.cpp @@ -1,4 +1,4 @@ -// $Id: DLL_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: DLL_Manager.cpp 86478 2009-08-13 07:15:05Z johnnyw $ #include "ace/DLL_Manager.h" @@ -151,9 +151,9 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, ACE_ERROR ((LM_ERROR, ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ") ACE_TEXT ("(\'%s\') failed, errno=") - ACE_TEXT ("%d: %s\n"), + ACE_TEXT ("%d: <%s>\n"), name->c_str (), - errno, + ACE_ERRNO_GET, this->error ()->c_str ())); #if defined (AIX) @@ -177,9 +177,9 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"), aix_pathname, open_mode, - ACE_TEXT ((this->handle_ != ACE_SHLIB_INVALID_HANDLE) - ? "succeeded" - : "failed"), + (this->handle_ != ACE_SHLIB_INVALID_HANDLE + ? ACE_TEXT ("succeeded") + : ACE_TEXT ("failed")), this->error()->c_str())); } @@ -233,6 +233,7 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, return 0; } + int ACE_DLL_Handle::close (int unload) { @@ -436,7 +437,7 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, try_names.size (0); if ((try_names.max_size () - try_names.size ()) < 5) try_names.max_size (try_names.max_size () + 5); -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) +#if defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) ACE_TString decorator (ACE_LD_DECORATOR_STR); #endif ACE_TString suffix (ACE_DLL_SUFFIX); @@ -445,7 +446,7 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, for (size_t i = 0; i < 5 && try_names.size () < try_names.max_size (); ++i) { ACE_TString try_this; - size_t j = try_names.size (); + size_t const j = try_names.size (); switch (i) { case 0: // Name + decorator + suffix @@ -454,7 +455,7 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, case 3: // Prefix + name + suffix if ( base_suffix.length () > 0 -#if !(defined(ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK)) +#if !(defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK)) || (i == 1 || i == 3) // No decorator desired; skip #endif ) @@ -467,7 +468,7 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, try_this += base_suffix; else { -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) +#if defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) try_this += decorator; #endif try_this += suffix; @@ -492,6 +493,7 @@ ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, // Pointer to the Singleton instance. ACE_DLL_Manager *ACE_DLL_Manager::instance_ = 0; + ACE_DLL_Manager * ACE_DLL_Manager::instance (int size) { @@ -783,4 +785,3 @@ ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/DLL_Manager.h b/externals/ace/DLL_Manager.h similarity index 100% rename from dep/include/ace/DLL_Manager.h rename to externals/ace/DLL_Manager.h index 9b63c7ead5b..63b9ee04a84 100644 --- a/dep/include/ace/DLL_Manager.h +++ b/externals/ace/DLL_Manager.h @@ -31,6 +31,7 @@ #define ACE_DEFAULT_DLL_MANAGER_SIZE 1024 + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -266,4 +267,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DLL_MANAGER_H */ - diff --git a/dep/src/ace/Date_Time.cpp b/externals/ace/Date_Time.cpp similarity index 99% rename from dep/src/ace/Date_Time.cpp rename to externals/ace/Date_Time.cpp index 8b26d0dd925..eff0f273fe7 100644 --- a/dep/src/ace/Date_Time.cpp +++ b/externals/ace/Date_Time.cpp @@ -8,4 +8,3 @@ #endif /* __ACE_INLINE__ */ ACE_RCSID(ace, Date_Time, "$Id: Date_Time.cpp 80826 2008-03-04 14:51:23Z wotte $") - diff --git a/dep/include/ace/Date_Time.h b/externals/ace/Date_Time.h similarity index 99% rename from dep/include/ace/Date_Time.h rename to externals/ace/Date_Time.h index 7e91549d2a5..a15d435eeb8 100644 --- a/dep/include/ace/Date_Time.h +++ b/externals/ace/Date_Time.h @@ -123,4 +123,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DATE_TIME_H */ - diff --git a/dep/include/ace/Date_Time.inl b/externals/ace/Date_Time.inl similarity index 100% rename from dep/include/ace/Date_Time.inl rename to externals/ace/Date_Time.inl diff --git a/dep/include/ace/Default_Constants.h b/externals/ace/Default_Constants.h similarity index 91% rename from dep/include/ace/Default_Constants.h rename to externals/ace/Default_Constants.h index 9eefd496b9b..1c0743b523c 100644 --- a/dep/include/ace/Default_Constants.h +++ b/externals/ace/Default_Constants.h @@ -4,7 +4,7 @@ /** * @file Default_Constants.h * - * $Id: Default_Constants.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Default_Constants.h 87487 2009-11-12 07:54:39Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -18,7 +18,7 @@ #define ACE_DEFAULT_CONSTANTS_H #include /**/ "ace/pre.h" -// Included just keep compilers that see #pragma dierctive first +// Included just keep compilers that see #pragma directive first // happy. #include /**/ "ace/config-all.h" @@ -26,6 +26,9 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +// For _POSIX_TIMER_MAX +#include "ace/os_include/os_limits.h" + // Define the default constants for ACE. Many of these are used for // the ACE tests and applications. You can change these values by // defining the macros in your config.h file. @@ -62,6 +65,10 @@ #define ACE_DEFAULT_SERVICE_REPOSITORY_SIZE 1024 #endif /* ACE_DEFAULT_SERVICE_REPOSITORY_SIZE */ +#if !defined (ACE_DEFAULT_SERVICE_GESTALT_SIZE) +#define ACE_DEFAULT_SERVICE_GESTALT_SIZE 1024 +#endif /* ACE_DEFAULT_SERVICE_GESTALT_SIZE */ + #if !defined (ACE_REACTOR_NOTIFICATION_ARRAY_SIZE) #define ACE_REACTOR_NOTIFICATION_ARRAY_SIZE 1024 #endif /* ACE_REACTOR_NOTIFICATION_ARRAY_SIZE */ @@ -196,7 +203,7 @@ # define ACE_DEFAULT_TIME_SERVER_STR "ACE_TS_TIME" # endif /* ACE_DEFAULT_TIME_SERVER_STR */ -// Used by the FIFO tests and the Client_Logging_Handler netsvc. +// Used by the FIFO tests # if !defined (ACE_DEFAULT_RENDEZVOUS) # if defined (ACE_HAS_STREAM_PIPES) # define ACE_DEFAULT_RENDEZVOUS ACE_TEXT("/tmp/fifo.ace") @@ -210,13 +217,20 @@ # define ACE_DEFAULT_SYSLOG_FACILITY LOG_USER # endif /* ACE_DEFAULT_SYSLOG_FACILITY */ -# if !defined (ACE_DEFAULT_LOGGER_KEY) +# if !defined (ACE_HAS_STREAM_LOG_MSG_IPC) +# if defined (ACE_HAS_STREAM_PIPES) +# define ACE_HAS_STREAM_LOG_MSG_IPC 1 +# else +# define ACE_HAS_STREAM_LOG_MSG_IPC 0 +# endif /* ACE_HAS_STREAM_PIPES */ +# endif /* !ACE_HAS_STREAM_LOG_MSG_IPC */ -# if defined (ACE_HAS_STREAM_PIPES) -# define ACE_DEFAULT_LOGGER_KEY ACE_TEXT ("/tmp/server_daemon") -# else -# define ACE_DEFAULT_LOGGER_KEY ACE_TEXT ("localhost:20012") -# endif /* ACE_HAS_STREAM_PIPES */ +# if !defined (ACE_DEFAULT_LOGGER_KEY) +# if (ACE_HAS_STREAM_LOG_MSG_IPC == 1) +# define ACE_DEFAULT_LOGGER_KEY ACE_TEXT ("/tmp/server_daemon") +# else +# define ACE_DEFAULT_LOGGER_KEY ACE_TEXT ("localhost:20012") +# endif /* ACE_HAS_STREAM_LOG_MSG_IPC==1 */ # endif /* ACE_DEFAULT_LOGGER_KEY */ // The way to specify the local host for loopback IP. This is usually @@ -299,6 +313,10 @@ # define ACE_DEFAULT_MAP_SIZE 1024 # endif /* ACE_DEFAULT_MAP_SIZE */ +# if defined (ACE_DEFAULT_MAP_SIZE) && (ACE_DEFAULT_MAP_SIZE == 0) +# error ACE_DEFAULT_MAP_SIZE should not be zero +# endif /* ACE_DEFAULT_MAP_SIZE */ + // Defaults for ACE Timer Wheel # if !defined (ACE_DEFAULT_TIMER_WHEEL_SIZE) # define ACE_DEFAULT_TIMER_WHEEL_SIZE 1024 @@ -450,9 +468,13 @@ // Default number of ACE_Event_Handlers supported by // ACE_Timer_Heap. -# if !defined (ACE_DEFAULT_TIMERS) -# define ACE_DEFAULT_TIMERS _POSIX_TIMER_MAX -# endif /* ACE_DEFAULT_TIMERS */ +#if !defined (ACE_DEFAULT_TIMERS) && defined (_POSIX_TIMER_MAX) +# define ACE_DEFAULT_TIMERS _POSIX_TIMER_MAX +#endif /* ACE_DEFAULT_TIMERS */ + +#if !defined (ACE_DEFAULT_TIMERS) || (defined (ACE_DEFAULT_TIMERS) && (ACE_DEFAULT_TIMERS == 0)) +#error ACE_DEFAULT_TIMERS should be defined and not be zero +#endif /* ACE_DEFAULT_TIMERS */ #if defined (ACE_WIN32) # define ACE_PLATFORM_A "Win32" @@ -482,11 +504,9 @@ # define ACE_LD_SEARCH_PATH ACE_TEXT ("PATH") # define ACE_LD_SEARCH_PATH_SEPARATOR_STR ACE_TEXT (";") # define ACE_DLL_SUFFIX ACE_TEXT (".dll") -# if defined (__MINGW32__) -# define ACE_DLL_PREFIX ACE_TEXT ("lib") -# else /* __MINGW32__ */ +# if !defined (ACE_DLL_PREFIX) # define ACE_DLL_PREFIX ACE_TEXT ("") -# endif /* __MINGW32__ */ +# endif /* !ACE_DLL_PREFIX */ #else /* !ACE_WIN32 */ # if !defined (ACE_LD_SEARCH_PATH) # define ACE_LD_SEARCH_PATH ACE_TEXT ("LD_LIBRARY_PATH") @@ -559,6 +579,18 @@ #define ACE_DEFAULT_LOCALNAME ACE_TEXT (ACE_DEFAULT_LOCALNAME_A) #define ACE_DEFAULT_GLOBALNAME ACE_TEXT (ACE_DEFAULT_GLOBALNAME_A) +#if !defined (ACE_DEFAULT_OPEN_PERMS) +# define ACE_DEFAULT_OPEN_PERMS ACE_DEFAULT_FILE_PERMS +#endif /* ACE_DEFAULT_OPEN_PERMS */ + +#if !defined (ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS) +# if defined (ACE_WIN32) +# define ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS ACE_DEFAULT_OPEN_PERMS +# else +# define ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS (S_IRUSR | S_IWUSR) +# endif /* ACE_WIN32 */ +#endif /* ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS */ + # if defined (ACE_WIN32) // The "null" device on Win32. # define ACE_DEV_NULL "nul" @@ -571,4 +603,3 @@ #include /**/ "ace/post.h" #endif /*ACE_DEFAULT_CONSTANTS_H*/ - diff --git a/dep/src/ace/Dev_Poll_Reactor.cpp b/externals/ace/Dev_Poll_Reactor.cpp similarity index 79% rename from dep/src/ace/Dev_Poll_Reactor.cpp rename to externals/ace/Dev_Poll_Reactor.cpp index bcc3127003e..e0adc19a418 100644 --- a/dep/src/ace/Dev_Poll_Reactor.cpp +++ b/externals/ace/Dev_Poll_Reactor.cpp @@ -1,4 +1,4 @@ -// $Id: Dev_Poll_Reactor.cpp 81315 2008-04-10 07:14:15Z johnnyw $ +// $Id: Dev_Poll_Reactor.cpp 90177 2010-05-19 11:44:22Z vzykov $ #include "ace/OS_NS_errno.h" #include "ace/Dev_Poll_Reactor.h" @@ -7,7 +7,7 @@ ACE_RCSID (ace, Dev_Poll_Reactor, - "$Id: Dev_Poll_Reactor.cpp 81315 2008-04-10 07:14:15Z johnnyw $") + "$Id: Dev_Poll_Reactor.cpp 90177 2010-05-19 11:44:22Z vzykov $") #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) @@ -15,9 +15,7 @@ ACE_RCSID (ace, # include "ace/OS_NS_fcntl.h" # include "ace/OS_NS_stropts.h" -# if defined (ACE_HAS_EVENT_POLL) && defined (linux) -# include /**/ -# elif defined (ACE_HAS_DEV_POLL) +# if defined (ACE_HAS_DEV_POLL) # if defined (linux) # include /**/ # elif defined (HPUX_VERS) && HPUX_VERS < 1123 @@ -31,6 +29,7 @@ ACE_RCSID (ace, # include "ace/Dev_Poll_Reactor.inl" #endif /* __ACE_INLINE__ */ + #include "ace/Handle_Set.h" #include "ace/Reactor.h" #include "ace/Timer_Heap.h" @@ -54,6 +53,7 @@ ACE_Dev_Poll_Reactor_Notify::ACE_Dev_Poll_Reactor_Notify (void) #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) , notification_queue_ () #endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ + , dispatching_ (false) { } @@ -135,27 +135,25 @@ ACE_Dev_Poll_Reactor_Notify::notify (ACE_Event_Handler *eh, ACE_UNUSED_ARG (timeout); ACE_Dev_Poll_Handler_Guard eh_guard (eh); - int notification_required = - notification_queue_.push_new_notification (buffer); - - if (notification_required == -1) - return -1; // Also decrement eh's reference count + // When using the queue, the push call indicates whether or not a pipe + // write is needed. If it's not, don't waste pipe space. + int push_result = this->notification_queue_.push_new_notification (buffer); + if (-1 == push_result || 1 == push_result) + return -1 == push_result ? -1 : 0; // Also decrement eh's reference count // The notification has been queued, so it will be delivered at some // point (and may have been already); release the refcnt guard. eh_guard.release (); - if (notification_required == 0) - return 0; - // Now pop the pipe to force the callback for dispatching when ready. If // the send fails due to a full pipe, don't fail - assume the already-sent // pipe bytes will cause the entire notification queue to be processed. + // Note that we don't need a timeout since the pipe is already in + // nonblocking mode and all we want is one attempt. ssize_t n = ACE::send (this->notification_pipe_.write_handle (), (char *) &buffer, - 1, // Only need one byte to pop the pipe - &ACE_Time_Value::zero); - if (n == -1 && (errno != ETIME && errno != EAGAIN)) + 1); // Only need one byte to pop the pipe + if (n == -1 && (errno != EAGAIN)) return -1; return 0; @@ -209,46 +207,40 @@ ACE_Dev_Poll_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, // expensive than simply checking for an EWOULDBLOCK. size_t to_read; char *read_p; - bool have_one = false; #if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) - // For the queued case, we'll try to read one byte (since that's what - // the notify () tried to put in) but we don't need it - notifications can - // be queued even if the pipe fills, so there may be more notifications - // queued than there are bytes in the pipe. - char b; - read_p = &b; - to_read = 1; + // The idea in the queued case is to be sure we never end up with a notify + // queued but no byte in the pipe. If that happens, the notify won't be + // dispatched. So always try to empty the pipe, read the queue, then put + // a byte in if needed. The notify() method is enqueueing then writing the + // pipe, so be sure to do it in the reverse order here to avoid a race + // between removing the last notification from the queue and the notify + // side writing its byte. + char b[1024]; + read_p = b; + to_read = sizeof(b); + (void)ACE::recv (handle, read_p, to_read); - // Before reading the byte, pop a message from the queue and queue a - // new message unless the queue is now empty. The protocol is to - // keep a byte in the pipe as long as the queue is not empty. bool more_messages_queued = false; ACE_Notification_Buffer next; - int result = notification_queue_.pop_next_notification (buffer, more_messages_queued, next); - if (result == 0) - { - // remove the notification byte from the pipe, avoiding notification loop - ACE::recv (handle, read_p, to_read); - return 0; - } - - if (result == -1) - return -1; + if (result <= 0) // Nothing dequeued or error + return result; + // If there are more messages, ensure there's a byte in the pipe + // in case the notification limit stops dequeuing notifies before + // emptying the queue. if (more_messages_queued) (void) ACE::send (this->notification_pipe_.write_handle (), (char *)&next, - 1 /* one byte is enough */, - &ACE_Time_Value::zero); + 1); /* one byte is enough */ + return 1; #else to_read = sizeof buffer; read_p = (char *)&buffer; -#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ ssize_t n = ACE::recv (handle, read_p, to_read); @@ -274,20 +266,22 @@ ACE_Dev_Poll_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, if (n <= 0 && (errno != EWOULDBLOCK && errno != EAGAIN)) return -1; - return have_one ? 1 : 0; + return 0; +#endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ } + int ACE_Dev_Poll_Reactor_Notify::handle_input (ACE_HANDLE handle) { ACE_TRACE ("ACE_Dev_Poll_Reactor_Notify::handle_input"); - // @@ We may end up dispatching this event handler twice: once when - // performing the speculative read on the notification pipe - // handle, and once more when dispatching the IO events. - - // Precondition: this->select_reactor_.token_.current_owner () == - // ACE_Thread::self (); + { + ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->dispatching_lock_, -1)); + if (this->dispatching_) + return 0; + this->dispatching_ = true; + } int number_dispatched = 0; int result = 0; @@ -314,11 +308,7 @@ ACE_Dev_Poll_Reactor_Notify::handle_input (ACE_HANDLE handle) number_dispatched = -1; } - // Enqueue ourselves into the list of waiting threads. When we - // reacquire the token we'll be off and running again with ownership - // of the token. The postcondition of this call is that - // == . - //this->select_reactor_->renew (); + this->dispatching_ = false; return number_dispatched; } @@ -438,55 +428,53 @@ ACE_Dev_Poll_Reactor_Notify::dump (void) const // ----------------------------------------------------------------- -ACE_Dev_Poll_Reactor_Handler_Repository:: -ACE_Dev_Poll_Reactor_Handler_Repository (void) - : max_size_ (0), +ACE_Dev_Poll_Reactor::Handler_Repository::Handler_Repository (void) + : size_ (0), + max_size_ (0), handlers_ (0) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::ACE_Dev_Poll_Reactor_Handler_Repository"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::Handler_Repository"); } -int -ACE_Dev_Poll_Reactor_Handler_Repository::invalid_handle ( +bool +ACE_Dev_Poll_Reactor::Handler_Repository::invalid_handle ( ACE_HANDLE handle) const { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::invalid_handle"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::invalid_handle"); if (handle < 0 || handle >= this->max_size_) { errno = EINVAL; - return 1; + return true; } else - return 0; + return false; } -int -ACE_Dev_Poll_Reactor_Handler_Repository::handle_in_range ( +bool +ACE_Dev_Poll_Reactor::Handler_Repository::handle_in_range ( ACE_HANDLE handle) const { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::handle_in_range"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::handle_in_range"); if (handle >= 0 && handle < this->max_size_) - return 1; + return true; else { errno = EINVAL; - return 0; + return false; } } int -ACE_Dev_Poll_Reactor_Handler_Repository::open (size_t size) +ACE_Dev_Poll_Reactor::Handler_Repository::open (size_t size) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::open"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::open"); this->max_size_ = size; // Try to allocate the memory. - ACE_NEW_RETURN (this->handlers_, - ACE_Dev_Poll_Event_Tuple[size], - -1); + ACE_NEW_RETURN (this->handlers_, Event_Tuple[size], -1); // Try to increase the number of handles if is greater than // the current limit. @@ -494,23 +482,35 @@ ACE_Dev_Poll_Reactor_Handler_Repository::open (size_t size) } int -ACE_Dev_Poll_Reactor_Handler_Repository::unbind_all (void) +ACE_Dev_Poll_Reactor::Handler_Repository::unbind_all (void) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::unbind_all"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::unbind_all"); - // Unbind all of the event handlers. + // Unbind all of the event handlers; similar to remove_handler() on all. for (int handle = 0; handle < this->max_size_; ++handle) - this->unbind (handle); + { + Event_Tuple *entry = this->find (handle); + if (entry == 0) + continue; + + // Check for ref counting now - handle_close () may delete eh. + bool const requires_reference_counting = + entry->event_handler->reference_counting_policy ().value () == + ACE_Event_Handler::Reference_Counting_Policy::ENABLED; + + (void) entry->event_handler->handle_close (handle, entry->mask); + this->unbind (handle, requires_reference_counting); + } return 0; } int -ACE_Dev_Poll_Reactor_Handler_Repository::close (void) +ACE_Dev_Poll_Reactor::Handler_Repository::close (void) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::close"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::close"); if (this->handlers_ != 0) { @@ -523,37 +523,37 @@ ACE_Dev_Poll_Reactor_Handler_Repository::close (void) return 0; } -ACE_Event_Handler * -ACE_Dev_Poll_Reactor_Handler_Repository::find (ACE_HANDLE handle, - size_t *index_p) +ACE_Dev_Poll_Reactor::Event_Tuple * +ACE_Dev_Poll_Reactor::Handler_Repository::find (ACE_HANDLE handle) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::find"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::find"); - ACE_Event_Handler *eh = 0; + Event_Tuple *tuple = 0; // Only bother to search for the if it's in range. - if (this->handle_in_range (handle)) + if (!this->handle_in_range (handle)) { - eh = this->handlers_[handle].event_handler; - if (eh != 0) - { - if (index_p != 0) - *index_p = handle; - } - else - errno = ENOENT; + errno = ERANGE; + return 0; } - return eh; + tuple = &(this->handlers_[handle]); + if (tuple->event_handler == 0) + { + errno = ENOENT; + tuple = 0; + } + + return tuple; } int -ACE_Dev_Poll_Reactor_Handler_Repository::bind ( +ACE_Dev_Poll_Reactor::Handler_Repository::bind ( ACE_HANDLE handle, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::bind"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::bind"); if (event_handler == 0) return -1; @@ -567,25 +567,29 @@ ACE_Dev_Poll_Reactor_Handler_Repository::bind ( this->handlers_[handle].event_handler = event_handler; this->handlers_[handle].mask = mask; event_handler->add_reference (); + ++this->size_; return 0; } int -ACE_Dev_Poll_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, - bool decr_refcnt) +ACE_Dev_Poll_Reactor::Handler_Repository::unbind (ACE_HANDLE handle, + bool decr_refcnt) { - ACE_TRACE ("ACE_Dev_Poll_Reactor_Handler_Repository::unbind"); + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::unbind"); - if (this->find (handle) == 0) + Event_Tuple *entry = this->find (handle); + if (entry == 0) return -1; if (decr_refcnt) - this->handlers_[handle].event_handler->remove_reference (); - this->handlers_[handle].event_handler = 0; - this->handlers_[handle].mask = ACE_Event_Handler::NULL_MASK; - this->handlers_[handle].suspended = 0; + entry->event_handler->remove_reference (); + entry->event_handler = 0; + entry->mask = ACE_Event_Handler::NULL_MASK; + entry->suspended = false; + entry->controlled = false; + --this->size_; return 0; } @@ -599,17 +603,15 @@ ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor (ACE_Sig_Handler *sh, int s_queue) : initialized_ (false) , poll_fd_ (ACE_INVALID_HANDLE) - , size_ (0) // , ready_set_ () #if defined (ACE_HAS_EVENT_POLL) - , events_ (0) - , start_pevents_ (0) - , end_pevents_ (0) -#else + , epoll_wait_in_progress_ (false) +#endif /* ACE_HAS_EVENT_POLL */ +#if defined (ACE_HAS_DEV_POLL) , dp_fds_ (0) , start_pfds_ (0) , end_pfds_ (0) -#endif /* ACE_HAS_EVENT_POLL */ +#endif /* ACE_HAS_DEV_POLL */ , deactivated_ (0) , token_ (*this, s_queue) , lock_adapter_ (token_) @@ -638,7 +640,7 @@ ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor (ACE_Sig_Handler *sh, } ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor (size_t size, - int rs, + bool rs, ACE_Sig_Handler *sh, ACE_Timer_Queue *tq, int disable_notify_pipe, @@ -647,17 +649,12 @@ ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor (size_t size, int s_queue) : initialized_ (false) , poll_fd_ (ACE_INVALID_HANDLE) - , size_ (0) // , ready_set_ () -#if defined (ACE_HAS_EVENT_POLL) - , events_ (0) - , start_pevents_ (0) - , end_pevents_ (0) -#else +#if defined (ACE_HAS_DEV_POLL) , dp_fds_ (0) , start_pfds_ (0) , end_pfds_ (0) -#endif /* ACE_HAS_EVENT_POLL */ +#endif /* ACE_HAS_DEV_POLL */ , deactivated_ (0) , token_ (*this, s_queue) , lock_adapter_ (token_) @@ -691,7 +688,7 @@ ACE_Dev_Poll_Reactor::~ACE_Dev_Poll_Reactor (void) int ACE_Dev_Poll_Reactor::open (size_t size, - int restart, + bool restart, ACE_Sig_Handler *sh, ACE_Timer_Queue *tq, int disable_notify_pipe, @@ -705,6 +702,11 @@ ACE_Dev_Poll_Reactor::open (size_t size, if (this->initialized_) return -1; +#ifdef ACE_HAS_EVENT_POLL + ACE_OS::memset (&this->event_, 0, sizeof (this->event_)); + this->event_.data.fd = ACE_INVALID_HANDLE; +#endif /* ACE_HAS_EVENT_POLL */ + this->restart_ = restart; this->signal_handler_ = sh; this->timer_queue_ = tq; @@ -753,10 +755,7 @@ ACE_Dev_Poll_Reactor::open (size_t size, #if defined (ACE_HAS_EVENT_POLL) - // Allocating event table: - ACE_NEW_RETURN (this->events_, epoll_event[size], -1); - - // Initializing epoll: + // Initialize epoll: this->poll_fd_ = ::epoll_create (size); if (this->poll_fd_ == -1) result = -1; @@ -791,14 +790,12 @@ ACE_Dev_Poll_Reactor::open (size_t size, ACE_Event_Handler::READ_MASK) == -1)) result = -1; - this->size_ = size; - if (result != -1) // We're all set to go. this->initialized_ = true; else // This will close down all the allocated resources properly. - (void) this->close (); + (void) this->close (); return result; } @@ -809,6 +806,7 @@ ACE_Dev_Poll_Reactor::current_info (ACE_HANDLE, size_t & /* size */) ACE_NOTSUP_RETURN (-1); } + int ACE_Dev_Poll_Reactor::set_sig_handler (ACE_Sig_Handler *signal_handler) { @@ -856,13 +854,15 @@ ACE_Dev_Poll_Reactor::close (void) #if defined (ACE_HAS_EVENT_POLL) - delete [] this->events_; - this->events_ = 0; + ACE_OS::memset (&this->event_, 0, sizeof (this->event_)); + this->event_.data.fd = ACE_INVALID_HANDLE; #else delete [] this->dp_fds_; this->dp_fds_ = 0; + this->start_pfds_ = 0; + this->end_pfds_ = 0; #endif /* ACE_HAS_EVENT_POLL */ @@ -873,7 +873,7 @@ ACE_Dev_Poll_Reactor::close (void) this->delete_signal_handler_ = false; } - (void) this->handler_rep_.close (); + (void) this->handler_rep_.close (); if (this->delete_timer_queue_) { @@ -894,14 +894,6 @@ ACE_Dev_Poll_Reactor::close (void) this->poll_fd_ = ACE_INVALID_HANDLE; -#if defined (ACE_HAS_EVENT_POLL) - this->start_pevents_ = 0; - this->end_pevents_ = 0; -#else - this->start_pfds_ = 0; - this->end_pfds_ = 0; -#endif /* ACE_HAS_EVENT_POLL */ - this->initialized_ = false; return result; @@ -941,7 +933,7 @@ ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value * max_wait_time) return 0; #if defined (ACE_HAS_EVENT_POLL) - if (this->start_pevents_ != this->end_pevents_) + if (this->event_.data.fd != ACE_INVALID_HANDLE) #else if (this->start_pfds_ != this->end_pfds_) #endif /* ACE_HAS_EVENT_POLL */ @@ -954,35 +946,51 @@ ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value * max_wait_time) // Check if we have timers to fire. int const timers_pending = - ((this_timeout != 0 && max_wait_time == 0) + ((this_timeout != 0 && max_wait_time == 0) || (this_timeout != 0 && max_wait_time != 0 && *this_timeout != *max_wait_time) ? 1 : 0); long const timeout = - (this_timeout == 0 + (this_timeout == 0 ? -1 /* Infinity */ : static_cast (this_timeout->msec ())); #if defined (ACE_HAS_EVENT_POLL) - // Wait for events. - int const nfds = ::epoll_wait (this->poll_fd_, - this->events_, - this->size_, - static_cast (timeout)); + // See if there are handlers that have to be resumed before waiting. + { + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, grd, this->to_be_resumed_lock_, -1); + this->epoll_wait_in_progress_ = true; + for (Resume_Map::iterator i = this->to_be_resumed_.begin (); + i != this->to_be_resumed_.end (); + ++i) + { + // Make sure that 1) the handle is still registered, + // 2) the registered handler is the one we're waiting to resume. + Event_Tuple *info = this->handler_rep_.find (i->first); + if (info != 0 && info->event_handler == i->second) + { + this->resume_handler_i (i->first); + } + } + this->to_be_resumed_.clear (); + } - if (nfds > 0) - { - this->start_pevents_ = this->events_; - this->end_pevents_ = this->start_pevents_ + nfds; - } + // Wait for an event. + int const nfds = ::epoll_wait (this->poll_fd_, + &this->event_, + 1, + static_cast (timeout)); + // Count on this being an atomic update; at worst, we may get an + // extraneous notify() from dispatch_io_event. + this->epoll_wait_in_progress_ = false; #else struct dvpoll dvp; dvp.dp_fds = this->dp_fds_; - dvp.dp_nfds = this->size_; + dvp.dp_nfds = this->handler_rep_.size (); dvp.dp_timeout = timeout; // Milliseconds // Poll for events @@ -1002,6 +1010,7 @@ ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value * max_wait_time) return (nfds == 0 && timers_pending != 0 ? 1 : nfds); } + int ACE_Dev_Poll_Reactor::handle_events (ACE_Time_Value *max_wait_time) { @@ -1036,18 +1045,17 @@ ACE_Dev_Poll_Reactor::handle_events_i (ACE_Time_Value *max_wait_time, ACE_TRACE ("ACE_Dev_Poll_Reactor::handle_events_i"); int result = 0; - // int active_handle_count = 0; // Poll for events // - // If the underlying ioctl () call was interrupted via the interrupt + // If the underlying event wait call was interrupted via the interrupt // signal (i.e. returned -1 with errno == EINTR) then the loop will // be restarted if so desired. do { result = this->work_pending_i (max_wait_time); - if (result == -1) - ACE_ERROR ((LM_ERROR, "%t: %p\n", "work_pending_i")); + if (result == -1 && (this->restart_ == 0 || errno != EINTR)) + ACE_ERROR ((LM_ERROR, ACE_TEXT("%t: %p\n"), ACE_TEXT("work_pending_i"))); } while (result == -1 && this->restart_ != 0 && errno == EINTR); @@ -1093,10 +1101,7 @@ ACE_Dev_Poll_Reactor::dispatch (Token_Guard &guard) if ((result = this->dispatch_timer_handler (guard)) != 0) return result; - // Check to see if there are no more I/O handles left to - // dispatch AFTER we've handled the timers. - - // Finally, dispatch the I/O handlers. + // If no timer dispatched, check for an I/O event. result = this->dispatch_io_event (guard); return result; @@ -1169,6 +1174,8 @@ int ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) { + // Dispatch a ready event. + // Define bits to check for while dispatching. #if defined (ACE_HAS_EVENT_POLL) const __uint32_t out_event = EPOLLOUT; @@ -1182,6 +1189,17 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) const short err_event = 0; // No known bits for this #endif /* ACE_HAS_EVENT_POLL */ +#if defined (ACE_HAS_EVENT_POLL) + // epoll_wait() pulls one event which is stored in event_. If the handle + // is invalid, there's no event there. Else process it. In any event, we + // have the event, so clear event_ for the next thread. + const ACE_HANDLE handle = this->event_.data.fd; + __uint32_t revents = this->event_.events; + this->event_.data.fd = ACE_INVALID_HANDLE; + this->event_.events = 0; + if (handle != ACE_INVALID_HANDLE) + +#else // Since the underlying event demultiplexing mechansim (`/dev/poll' // or '/dev/epoll') is stateful, and since only one result buffer is // used, all pending events (i.e. those retrieved from a previous @@ -1189,8 +1207,6 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) // polled. As such, the Dev_Poll_Reactor keeps track of the // progress of events that have been dispatched. - // Dispatch the events. - // // Select the first available handle with event (s) pending. Check for // event type in defined order of dispatch: output, exception, input. // When an event is located, clear its bit in the dispatch set. If there @@ -1199,21 +1215,27 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) // // Notice that pfds only contains file descriptors that have // received events. -#if defined (ACE_HAS_EVENT_POLL) - struct epoll_event *& pfds = this->start_pevents_; - if (pfds < this->end_pevents_) -#else struct pollfd *& pfds = this->start_pfds_; + const ACE_HANDLE handle = pfds->fd; + short &revents = pfds->revents; if (pfds < this->end_pfds_) #endif /* ACE_HAS_EVENT_POLL */ + { -#if defined (ACE_HAS_EVENT_POLL) - const ACE_HANDLE handle = pfds->data.fd; - __uint32_t &revents = pfds->events; -#else - const ACE_HANDLE handle = pfds->fd; - short &revents = pfds->revents; + /* When using sys_epoll, we can attach arbitrary user + data to the descriptor, so it can be delivered when + activity is detected. Perhaps we should store event + handler together with descriptor, instead of looking + it up in a repository ? Could it boost performance ? + */ + Event_Tuple *info = this->handler_rep_.find (handle); + if (info == 0) // No registered handler any longer + { +#ifdef ACE_HAS_EVENT_POLL + this->event_.data.fd = ACE_INVALID_HANDLE; // Dump the event #endif /* ACE_HAS_EVENT_POLL */ + return 0; + } // Figure out what to do first in order to make it easier to manage // the bit twiddling and possible pfds increment before releasing @@ -1221,96 +1243,139 @@ ACE_Dev_Poll_Reactor::dispatch_io_event (Token_Guard &guard) // Note that if there's an error (such as the handle was closed // without being removed from the event set) the EPOLLHUP and/or // EPOLLERR bits will be set in revents. - bool disp_out = false; - bool disp_exc = false; - bool disp_in = false; + ACE_Reactor_Mask disp_mask = 0; + ACE_Event_Handler *eh = info->event_handler; + int (ACE_Event_Handler::*callback)(ACE_HANDLE) = 0; if (ACE_BIT_ENABLED (revents, out_event)) { - disp_out = true; + disp_mask = ACE_Event_Handler::WRITE_MASK; + callback = &ACE_Event_Handler::handle_output; ACE_CLR_BITS (revents, out_event); } else if (ACE_BIT_ENABLED (revents, exc_event)) { - disp_exc = true; + disp_mask = ACE_Event_Handler::EXCEPT_MASK; + callback = &ACE_Event_Handler::handle_exception; ACE_CLR_BITS (revents, exc_event); } else if (ACE_BIT_ENABLED (revents, in_event)) { - disp_in = true; + disp_mask = ACE_Event_Handler::READ_MASK; + callback = &ACE_Event_Handler::handle_input; ACE_CLR_BITS (revents, in_event); } else if (ACE_BIT_ENABLED (revents, err_event)) { - this->remove_handler_i (handle, ACE_Event_Handler::ALL_EVENTS_MASK); + this->remove_handler_i (handle, + ACE_Event_Handler::ALL_EVENTS_MASK, + info->event_handler); +#ifdef ACE_HAS_DEV_POLL ++pfds; +#endif /* ACE_HAS_DEV_POLL */ return 1; } else { - ACE_ERROR ((LM_ERROR, ACE_TEXT (" (%t) dispatch_io h %d unknown events 0x%x\n"), handle, revents)); - // ACE_ASSERT (0); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%t) dispatch_io h %d unknown events 0x%x\n"), + handle, revents)); } +#ifdef ACE_HAS_DEV_POLL // Increment the pointer to the next element before we // release the token. Otherwise event handlers end up being // dispatched multiple times for the same poll. if (revents == 0) ++pfds; +#else + // With epoll, events are registered with oneshot, so the handle is + // effectively suspended; future calls to epoll_wait() will select + // the next event, so they're not managed here. + // The hitch to this is that the notify handler is always registered + // WITHOUT oneshot and is never suspended/resumed. This avoids endless + // notify loops caused by the notify handler requiring a resumption + // which requires the token, which requires a notify, etc. described + // in Bugzilla 3714. So, never suspend the notify handler. - /* When using sys_epoll, we can attach arbitrary user - data to the descriptor, so it can be delivered when - activity is detected. Perhaps we should store event - handler together with descriptor, instead of looking - it up in a repository ? Could it boost performance ? - */ - ACE_Event_Handler *eh = this->handler_rep_.find (handle); - - if (eh) + bool reactor_resumes_eh = false; + if (eh != this->notify_handler_) { - // Modify the reference count in an exception-safe way. - // Note that eh could be the notify handler. It's not strictly - // necessary to manage its refcount, but since we don't enable - // the counting policy, it won't do much. Management of the - // notified handlers themselves is done in the notify handler. - ACE_Dev_Poll_Handler_Guard eh_guard (eh); + info->suspended = true; - // Release the reactor token before upcall. - guard.release_token (); + reactor_resumes_eh = + eh->resume_handler () == + ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER; + } +#endif /* ACE_HAS_DEV_POLL */ - // Dispatch the detected event - if (disp_out) - { - const int status = - this->upcall (eh, &ACE_Event_Handler::handle_output, handle); + int status = 0; // gets callback status, below. + { + // Modify the reference count in an exception-safe way. + // Note that eh could be the notify handler. It's not strictly + // necessary to manage its refcount, but since we don't enable + // the counting policy, it won't do much. Management of the + // notified handlers themselves is done in the notify handler. + ACE_Dev_Poll_Handler_Guard eh_guard (eh); - if (status < 0) - // Note that the token is reacquired in remove_handler (). - this->remove_handler (handle, ACE_Event_Handler::WRITE_MASK); - return 1; - } + // Release the reactor token before upcall. + guard.release_token (); - if (disp_exc) - { - const int status = - this->upcall (eh, &ACE_Event_Handler::handle_exception, handle); + // Dispatch the detected event; will do the repeated upcalls + // if callback returns > 0, unless it's the notify handler (which + // returns the number of notfies dispatched, not an indication of + // re-callback requested). If anything other than the notify, come + // back with either 0 or < 0. + status = this->upcall (eh, callback, handle); - if (status < 0) - // Note that the token is reacquired in remove_handler (). - this->remove_handler (handle, ACE_Event_Handler::EXCEPT_MASK); - return 1; - } + if (eh == this->notify_handler_) + return status; - if (disp_in) - { - const int status = - this->upcall (eh, &ACE_Event_Handler::handle_input, handle); + // If the callback returned 0, epoll-based needs to resume the + // suspended handler but dev/poll doesn't. + // The epoll case is optimized to not acquire the token in order + // to resume the handler; the handler is added to a list of those + // that need to be resumed and is handled by the next leader + // that does an epoll_wait(). + // In both epoll and dev/poll cases, if the callback returns <0, + // the token needs to be acquired and the handler checked and + // removed if it hasn't already been. + if (status == 0) + { +#ifdef ACE_HAS_EVENT_POLL + // epoll-based effectively suspends handlers around the upcall. + // If the handler must be resumed, add it to the list. + if (reactor_resumes_eh) + { + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, + grd, + this->to_be_resumed_lock_, + -1); + bool map_was_empty = this->to_be_resumed_.empty(); + this->to_be_resumed_.insert + (Resume_Map::value_type (handle, eh)); + if (this->epoll_wait_in_progress_ && map_was_empty) + this->notify(); + } +#endif /* ACE_HAS_EVENT_POLL */ + return 1; + } - if (status < 0) - // Note that the token is reacquired in remove_handler (). - this->remove_handler (handle, ACE_Event_Handler::READ_MASK); - return 1; - } - } // The reactor token is reacquired upon leaving this scope. + // All state in the handler repository may have changed during the + // upcall while other threads had the token. Thus, reacquire the + // token and evaluate what's needed. If the upcalled handler is still + // the handler of record for handle, continue with checking whether + // or not to remove or resume the handler. + guard.acquire (); + info = this->handler_rep_.find (handle); + if (info != 0 && info->event_handler == eh) + { + if (status < 0) + this->remove_handler_i (handle, disp_mask); + } + } + // Scope close handles eh ref count decrement, if needed. + + return 1; } return 0; @@ -1402,19 +1467,27 @@ ACE_Dev_Poll_Reactor::register_handler_i (ACE_HANDLE handle, #if defined (ACE_HAS_EVENT_POLL) + Event_Tuple *info = this->handler_rep_.find (handle); + struct epoll_event epev; ACE_OS::memset (&epev, 0, sizeof (epev)); static const int op = EPOLL_CTL_ADD; - epev.events = this->reactor_mask_to_poll_event (mask); epev.data.fd = handle; + epev.events = this->reactor_mask_to_poll_event (mask); + // All but the notify handler get registered with oneshot to facilitate + // auto suspend before the upcall. See dispatch_io_event for more + // information. + if (event_handler != this->notify_handler_) + epev.events |= EPOLLONESHOT; if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) { - ACE_ERROR ((LM_ERROR, "%p\n", "epoll_ctl")); - (void) this->handler_rep_.unbind (handle); + ACE_ERROR ((LM_ERROR, ACE_TEXT("%p\n"), ACE_TEXT("epoll_ctl"))); + (void) this->handler_rep_.unbind (handle); return -1; } + info->controlled = true; #endif /* ACE_HAS_EVENT_POLL */ } @@ -1424,10 +1497,11 @@ ACE_Dev_Poll_Reactor::register_handler_i (ACE_HANDLE handle, // again, possibly for different event. Add new mask to the // current one. if (this->mask_ops_i (handle, mask, ACE_Reactor::ADD_MASK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "mask_ops_i"), -1); + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n"), ACE_TEXT("mask_ops_i")), + -1); } -#ifndef ACE_HAS_EVENT_POLL +#ifdef ACE_HAS_DEV_POLL struct pollfd pfd; @@ -1438,10 +1512,10 @@ ACE_Dev_Poll_Reactor::register_handler_i (ACE_HANDLE handle, // Add file descriptor to the "interest set." if (ACE_OS::write (this->poll_fd_, &pfd, sizeof (pfd)) != sizeof (pfd)) { - (void) this->handler_rep_.unbind (handle); + (void) this->handler_rep_.unbind (handle); return -1; } -#endif /*ACE_HAS_EVENT_POLL*/ +#endif /*ACE_HAS_DEV_POLL*/ // Note the fact that we've changed the state of the wait_set_, // which is used by the dispatching loop to determine whether it can @@ -1555,15 +1629,24 @@ ACE_Dev_Poll_Reactor::remove_handler (ACE_HANDLE handle, int ACE_Dev_Poll_Reactor::remove_handler_i (ACE_HANDLE handle, - ACE_Reactor_Mask mask) + ACE_Reactor_Mask mask, + ACE_Event_Handler *eh) { ACE_TRACE ("ACE_Dev_Poll_Reactor::remove_handler_i"); - ACE_Event_Handler *eh = this->handler_rep_.find (handle); - - if (eh == 0 || - this->mask_ops_i (handle, mask, ACE_Reactor::CLR_MASK) == -1) + // If registered event handler not the same as eh, don't mess with + // the mask, but do the proper callback and refcount when needed. + bool handle_reg_changed = true; + Event_Tuple *info = this->handler_rep_.find (handle); + if (info == 0 && eh == 0) // Nothing to work with return -1; + if (info != 0 && (eh == 0 || info->event_handler == eh)) + { + if (this->mask_ops_i (handle, mask, ACE_Reactor::CLR_MASK) == -1) + return -1; + handle_reg_changed = false; + eh = info->event_handler; + } // Check for ref counting now - handle_close () may delete eh. bool const requires_reference_counting = @@ -1571,19 +1654,13 @@ ACE_Dev_Poll_Reactor::remove_handler_i (ACE_HANDLE handle, ACE_Event_Handler::Reference_Counting_Policy::ENABLED; if (ACE_BIT_DISABLED (mask, ACE_Event_Handler::DONT_CALL)) - (void) eh->handle_close (handle, mask); + (void) eh->handle_close (handle, mask); // If there are no longer any outstanding events on the given handle // then remove it from the handler repository. - if (this->handler_rep_.mask (handle) == ACE_Event_Handler::NULL_MASK) + if (!handle_reg_changed && info->mask == ACE_Event_Handler::NULL_MASK) this->handler_rep_.unbind (handle, requires_reference_counting); - // Note the fact that we've changed the state of the wait_set, - // i.e. the "interest set," which is used by the dispatching loop to - // determine whether it can keep going or if it needs to reconsult - // /dev/poll or /dev/epoll. - // this->state_changed_ = 1; - return 0; } @@ -1700,13 +1777,14 @@ ACE_Dev_Poll_Reactor::suspend_handlers (void) ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - size_t const len = this->handler_rep_.size (); + size_t const len = this->handler_rep_.max_size (); for (size_t i = 0; i < len; ++i) - if (this->handler_rep_.suspended (i) == 0 - && this->suspend_handler_i (i) != 0) - return -1; - + { + Event_Tuple *info = this->handler_rep_.find (i); + if (info != 0 && !info->suspended && this->suspend_handler_i (i) != 0) + return -1; + } return 0; } @@ -1715,10 +1793,11 @@ ACE_Dev_Poll_Reactor::suspend_handler_i (ACE_HANDLE handle) { ACE_TRACE ("ACE_Dev_Poll_Reactor::suspend_handler_i"); - if (this->handler_rep_.find (handle) == 0) + Event_Tuple *info = this->handler_rep_.find (handle); + if (info == 0) return -1; - if (this->handler_rep_.suspended (handle)) + if (info->suspended) return 0; // Already suspended. @@ Should this be an error? // Remove the handle from the "interest set." @@ -1738,7 +1817,7 @@ ACE_Dev_Poll_Reactor::suspend_handler_i (ACE_HANDLE handle) if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) return -1; - + info->controlled = false; #else struct pollfd pfd[1]; @@ -1752,7 +1831,7 @@ ACE_Dev_Poll_Reactor::suspend_handler_i (ACE_HANDLE handle) #endif /* ACE_HAS_EVENT_POLL */ - this->handler_rep_.suspend (handle); + info->suspended = true; return 0; } @@ -1809,12 +1888,14 @@ ACE_Dev_Poll_Reactor::resume_handlers (void) ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - size_t const len = this->handler_rep_.size (); + size_t const len = this->handler_rep_.max_size (); for (size_t i = 0; i < len; ++i) - if (this->handler_rep_.suspended (i) - && this->resume_handler_i (i) != 0) - return -1; + { + Event_Tuple *info = this->handler_rep_.find (i); + if (info != 0 && info->suspended && this->resume_handler_i (i) != 0) + return -1; + } return 0; } @@ -1824,14 +1905,19 @@ ACE_Dev_Poll_Reactor::resume_handler_i (ACE_HANDLE handle) { ACE_TRACE ("ACE_Dev_Poll_Reactor::resume_handler_i"); - if (this->handler_rep_.find (handle) == 0 - && this->handler_rep_.suspended (handle) == 0) + Event_Tuple *info = this->handler_rep_.find (handle); + if (info == 0) return -1; - ACE_Reactor_Mask mask = this->handler_rep_.mask (handle); + if (!info->suspended) + return 0; + ACE_Reactor_Mask mask = info->mask; if (mask == ACE_Event_Handler::NULL_MASK) - return -1; + { + info->suspended = false; + return 0; + } // Place the handle back in to the "interest set." // @@ -1841,13 +1927,15 @@ ACE_Dev_Poll_Reactor::resume_handler_i (ACE_HANDLE handle) struct epoll_event epev; ACE_OS::memset (&epev, 0, sizeof (epev)); - static const int op = EPOLL_CTL_ADD; - - epev.events = this->reactor_mask_to_poll_event (mask); + int op = EPOLL_CTL_ADD; + if (info->controlled) + op = EPOLL_CTL_MOD; + epev.events = this->reactor_mask_to_poll_event (mask) | EPOLLONESHOT; epev.data.fd = handle; if (::epoll_ctl (this->poll_fd_, op, handle, &epev) == -1) return -1; + info->controlled = true; #else @@ -1862,7 +1950,7 @@ ACE_Dev_Poll_Reactor::resume_handler_i (ACE_HANDLE handle) #endif /* ACE_HAS_EVENT_POLL */ - this->handler_rep_.resume (handle); + info->suspended = false; return 0; } @@ -1875,12 +1963,12 @@ ACE_Dev_Poll_Reactor::resumable_handler (void) return 0; } -int +bool ACE_Dev_Poll_Reactor::uses_event_associations (void) { // Since the Dev_Poll_Reactor does not do any event associations, - // this method always return zero. - return 0; + // this method always return false. + return false; } long @@ -2038,10 +2126,16 @@ ACE_Dev_Poll_Reactor::find_handler (ACE_HANDLE handle) { ACE_MT (ACE_READ_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, 0)); - ACE_Event_Handler *event_handler = this->handler_rep_.find (handle); - if (event_handler) - event_handler->add_reference (); - return event_handler; + Event_Tuple *info = this->handler_rep_.find (handle); + if (info) + { + info->event_handler->add_reference (); + return info->event_handler; + } + else + { + return 0; + } } int @@ -2053,15 +2147,15 @@ ACE_Dev_Poll_Reactor::handler (ACE_HANDLE handle, ACE_MT (ACE_READ_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); - ACE_Event_Handler *h = this->handler_rep_.find (handle); + Event_Tuple *info = this->handler_rep_.find (handle); - if (h != 0 - && ACE_BIT_CMP_MASK (this->handler_rep_.mask (handle), + if (info != 0 + && ACE_BIT_CMP_MASK (info->mask, mask, // Compare all bits in the mask mask)) { if (event_handler != 0) - *event_handler = h; + *event_handler = info->event_handler; return 0; } @@ -2098,7 +2192,7 @@ ACE_Dev_Poll_Reactor::initialized (void) size_t ACE_Dev_Poll_Reactor::size (void) const { - return this->size_; + return this->handler_rep_.size (); } ACE_Lock & @@ -2144,24 +2238,24 @@ ACE_Dev_Poll_Reactor::owner (ACE_thread_t * /* owner */) return 0; } -int +bool ACE_Dev_Poll_Reactor::restart (void) { ACE_TRACE ("ACE_Dev_Poll_Reactor::restart"); - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); + ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, false)); return this->restart_; } -int -ACE_Dev_Poll_Reactor::restart (int r) +bool +ACE_Dev_Poll_Reactor::restart (bool r) { ACE_TRACE ("ACE_Dev_Poll_Reactor::restart"); - ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, -1)); + ACE_MT (ACE_GUARD_RETURN (ACE_Dev_Poll_Reactor_Token, mon, this->token_, false)); - int current_value = this->restart_; + bool current_value = this->restart_; this->restart_ = r; return current_value; } @@ -2211,13 +2305,14 @@ ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle, { ACE_TRACE ("ACE_Dev_Poll_Reactor::mask_ops_i"); - if (this->handler_rep_.handle_in_range (handle) == 0) + Event_Tuple *info = this->handler_rep_.find (handle); + if (info == 0) return -1; // Block out all signals until method returns. ACE_Sig_Guard sb; - ACE_Reactor_Mask const old_mask = this->handler_rep_.mask (handle); + ACE_Reactor_Mask const old_mask = info->mask; ACE_Reactor_Mask new_mask = old_mask; // Perform GET, CLR, SET, and ADD operations on the interest/wait @@ -2256,12 +2351,15 @@ ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle, } /// Reset the mask for the given handle. - this->handler_rep_.mask (handle, new_mask); + info->mask = new_mask; - if (this->handler_rep_.suspended (handle) == 0) + // Only attempt to alter events for the handle from the + // "interest set" if it hasn't been suspended. If it has been + // suspended, the revised mask will take affect when the + // handle is resumed. The exception is if all the mask bits are + // cleared, we can un-control the fd now. + if (!info->suspended || (info->controlled && new_mask == 0)) { - // Only attempt to alter events for the handle from the - // "interest set" if it hasn't been suspended. short const events = this->reactor_mask_to_poll_event (new_mask); @@ -2297,7 +2395,7 @@ ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle, else { op = EPOLL_CTL_MOD; - epev.events = events; + epev.events = events | EPOLLONESHOT; } epev.data.fd = handle; @@ -2312,7 +2410,7 @@ ACE_Dev_Poll_Reactor::mask_ops_i (ACE_HANDLE handle, ::epoll_ctl (this->poll_fd_, EPOLL_CTL_ADD, handle, &epev) == -1) return -1; } - + info->controlled = (op != EPOLL_CTL_DEL); #else pollfd pfd[1]; @@ -2369,7 +2467,7 @@ ACE_Dev_Poll_Reactor::dump (void) const ACE_TEXT ("initialized_ = %d"), this->initialized_)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("poll_fd_ = %d"), this->poll_fd_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("size_ = %u"), this->size_)); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("size_ = %u"), this->handler_rep_.size ())); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("deactivated_ = %d"), this->deactivated_)); @@ -2461,7 +2559,7 @@ ACE_Dev_Poll_Reactor::Token_Guard::acquire_quietly (ACE_Time_Value *max_wait) return 0; else { - ACE_ERROR ((LM_ERROR, "%t: %p\n", "token acquire_read")); + ACE_ERROR ((LM_ERROR, ACE_TEXT("%t: %p\n"), ACE_TEXT("token acquire_read"))); return -1; } } @@ -2510,4 +2608,3 @@ ACE_Dev_Poll_Reactor::Token_Guard::acquire (ACE_Time_Value *max_wait) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_EVENT_POLL || ACE_HAS_DEV_POLL */ - diff --git a/dep/include/ace/Dev_Poll_Reactor.h b/externals/ace/Dev_Poll_Reactor.h similarity index 85% rename from dep/include/ace/Dev_Poll_Reactor.h rename to externals/ace/Dev_Poll_Reactor.h index 6118d8e0a38..030ad241810 100644 --- a/dep/include/ace/Dev_Poll_Reactor.h +++ b/externals/ace/Dev_Poll_Reactor.h @@ -4,7 +4,7 @@ /** * @file Dev_Poll_Reactor.h * - * $Id: Dev_Poll_Reactor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Dev_Poll_Reactor.h 90177 2010-05-19 11:44:22Z vzykov $ * * @c /dev/poll (or Linux @c sys_epoll) based Reactor implementation. * @@ -12,6 +12,7 @@ */ // ========================================================================= + #ifndef ACE_DEV_POLL_REACTOR_H #define ACE_DEV_POLL_REACTOR_H @@ -42,7 +43,8 @@ #if defined (ACE_HAS_DEV_POLL) struct pollfd; #elif defined (ACE_HAS_EVENT_POLL) -struct epoll_event; +# include "ace/Array_Map.h" +# include /**/ #endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -51,41 +53,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Sig_Handler; class ACE_Dev_Poll_Reactor; -/** - * @class ACE_Dev_Poll_Event_Tuple - * - * @brief Class that associates specific event mask with a given event - * handler. - * - * This class merely provides a means to associate an event mask - * with an event handler. Such an association is needed since it is - * not possible to retrieve the event mask from the "interest set" - * stored in the `/dev/poll' or `/dev/epoll' driver. Without this - * external association, it would not be possible keep track of the - * event mask for a given event handler when suspending it or resuming - * it. - * - * @note An ACE_Handle_Set is not used since the number of handles may - * exceed its capacity (ACE_DEFAULT_SELECT_REACTOR_SIZE). - */ -class ACE_Dev_Poll_Event_Tuple -{ -public: - - /// Constructor. - ACE_Dev_Poll_Event_Tuple (void); - -public: - - /// The event handler. - ACE_Event_Handler *event_handler; - - /// The event mask for the above event handler. - ACE_Reactor_Mask mask; - - /// Flag that states whether or not the event handler is suspended. - char suspended; -}; // --------------------------------------------------------------------- @@ -279,123 +246,10 @@ protected: ACE_Notification_Queue notification_queue_; #endif /* ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ -}; - -// --------------------------------------------------------------------- - -/** - * @class ACE_Dev_Poll_Reactor_Handler_Repository - * - * @internal - - * @brief Used to map ACE_HANDLEs onto the appropriate - * ACE_Event_Handler *. - * - * - * This class is simply a container that maps a handle to its - * corresponding event handler. It is not meant for use outside of - * the Dev_Poll_Reactor. - */ -class ACE_Dev_Poll_Reactor_Handler_Repository -{ -public: - - /// Constructor. - ACE_Dev_Poll_Reactor_Handler_Repository (void); - - /// Initialize a repository of the appropriate @a size. - int open (size_t size); - - /// Close down the repository. - int close (void); - - /** - * @name Repository Manipulation Operations - * - * Methods used to search and modify the handler repository. - */ - //@{ - - /** - * Return the @c ACE_Event_Handler associated with @c ACE_HANDLE. If - * @a index_p is non-zero, then return the index location of the - * handle, if found. - */ - ACE_Event_Handler *find (ACE_HANDLE handle, size_t *index_p = 0); - - /// Set the event mask for event handler associated with the given - /// handle. - void mask (ACE_HANDLE handle, ACE_Reactor_Mask mask); - - /// Retrieve the event mask for the event handler associated with - /// the given handle. - ACE_Reactor_Mask mask (ACE_HANDLE handle); - - /// Mark the event handler associated with the given handle as - /// "suspended." - void suspend (ACE_HANDLE handle); - - /// Mark the event handler associated with the given handle as - /// "resumed." - void resume (ACE_HANDLE handle); - - /// Is the event handler for the given handle suspended? - int suspended (ACE_HANDLE handle) const; - - /// Bind the ACE_Event_Handler to the @c ACE_HANDLE with the - /// appropriate ACE_Reactor_Mask settings. - int bind (ACE_HANDLE handle, - ACE_Event_Handler *handler, - ACE_Reactor_Mask mask); - - /// Remove the binding for @c ACE_HANDLE; optionally decrement the associated - /// handler's reference count. - int unbind (ACE_HANDLE handle, bool decr_refcnt = true); - - /// Remove all the (@c ACE_HANDLE, @c ACE_Event_Handler) tuples. - int unbind_all (void); - - /** - * @name Sanity Checking - * - * Methods used to prevent "out-of-range" errors when indexing the - * underlying handler array. - */ - //@{ - - // Check the @a handle to make sure it's a valid @c ACE_HANDLE that - // within the range of legal handles (i.e., greater than or equal to - // zero and less than @c max_size_). - int invalid_handle (ACE_HANDLE handle) const; - - // Check the handle to make sure it's a valid @c ACE_HANDLE that is - // within the range of currently registered handles (i.e., greater - // than or equal to zero and less than @c max_handlep1_). - int handle_in_range (ACE_HANDLE handle) const; - - //@} - - /// Returns the current table size. - size_t size (void) const; - - /// Dump the state of an object. - void dump (void) const; - - /// Declare the dynamic allocation hooks. - ACE_ALLOC_HOOK_DECLARE; - -private: - - /// Maximum number of handles. - int max_size_; - - /// The underlying array of event handlers. - /** - * The array of event handlers is directly indexed directly using - * an @c ACE_HANDLE value. This is Unix-specific. - */ - ACE_Dev_Poll_Event_Tuple *handlers_; - + /// Lock and flag to say whether we're already dispatching notifies. + /// Purpose is to only dispatch notifies from one thread at a time. + ACE_SYNCH_MUTEX dispatching_lock_; + volatile bool dispatching_; }; // --------------------------------------------------------------------- @@ -443,6 +297,155 @@ typedef ACE_Reactor_Token_T ACE_Dev_Poll_Reactor_Token; class ACE_Export ACE_Dev_Poll_Reactor : public ACE_Reactor_Impl { + + /** + * @struct Event_Tuple + * + * @brief Struct that collects event registration information for a handle. + * + * @internal Internal use only + * + * This struct merely provides a means to associate an event mask + * with an event handler. Such an association is needed since it is + * not possible to retrieve the event mask from the "interest set" + * stored in the `/dev/poll' or `/dev/epoll' driver. Without this + * external association, it would not be possible keep track of the + * event mask for a given event handler when suspending it or resuming + * it. + * + * @note An ACE_Handle_Set is not used since the number of handles may + * exceed its capacity (ACE_DEFAULT_SELECT_REACTOR_SIZE). + */ + struct Event_Tuple + { + /// Constructor to set up defaults. + Event_Tuple (ACE_Event_Handler *eh = 0, + ACE_Reactor_Mask m = ACE_Event_Handler::NULL_MASK, + bool is_suspended = false, + bool is_controlled = false); + + /// The event handler. + ACE_Event_Handler *event_handler; + + /// The event mask for the above event handler. + ACE_Reactor_Mask mask; + + /// Flag that states whether or not the event handler is suspended. + bool suspended; + + /// Flag to say whether or not this handle is registered with epoll. + bool controlled; + }; + + + // --------------------------------------------------------------------- + + /** + * @class Handler_Repository + * + * @internal + * + * @brief Used to map ACE_HANDLEs onto the appropriate Event_Tuple. + * + * This class is simply a container that maps a handle to its + * corresponding event tuple. It is not meant for use outside of + * the Dev_Poll_Reactor. + * + * @note Calls to any method in this class, and any modification to a + * Event_Tuple returned from this class's methods, must be made + * while holding the reactor token. + */ + class Handler_Repository + { + public: + + /// Constructor. + Handler_Repository (void); + + /// Initialize a repository that can map handles up to the value @a size. + /// Since the event tuples are accessed directly using the handle as + /// an index, @a size sets the maximum handle value, minus 1. + int open (size_t size); + + /// Close down the repository. + int close (void); + + /** + * @name Repository Manipulation Operations + * + * Methods used to search and modify the handler repository. + */ + //@{ + + /// Return a pointer to the Event_Tuple associated with @a handle. + /// If there is none associated, returns 0 and sets errno. + Event_Tuple *find (ACE_HANDLE handle); + + + /// Bind the ACE_Event_Handler to the @c ACE_HANDLE with the + /// appropriate ACE_Reactor_Mask settings. + int bind (ACE_HANDLE handle, + ACE_Event_Handler *handler, + ACE_Reactor_Mask mask); + + /// Remove the binding for @a handle; optionally decrement the associated + /// handler's reference count. + int unbind (ACE_HANDLE handle, bool decr_refcnt = true); + + /// Remove all the registered tuples. + int unbind_all (void); + + //@} + + /** + * @name Sanity Checking + * + * Methods used to prevent "out-of-range" errors when indexing the + * underlying handler array. + */ + //@{ + + // Check the @a handle to make sure it's a valid @c ACE_HANDLE that + // within the range of legal handles (i.e., greater than or equal to + // zero and less than @c max_size_). + bool invalid_handle (ACE_HANDLE handle) const; + + // Check the handle to make sure it's a valid @c ACE_HANDLE that is + // within the range of currently registered handles (i.e., greater + // than or equal to zero and less than @c max_handlep1_). + bool handle_in_range (ACE_HANDLE handle) const; + + //@} + + /// Returns the current table size. + size_t size (void) const; + + /// Returns the current table size. + size_t max_size (void) const; + + /// Dump the state of an object. + void dump (void) const; + + /// Declare the dynamic allocation hooks. + ACE_ALLOC_HOOK_DECLARE; + + private: + + /// Current number of handles. + int size_; + + /// Maximum number of handles. + int max_size_; + + /// The underlying array of event handlers. + /** + * The array of event handlers is directly indexed directly using + * an @c ACE_HANDLE value. This is Unix-specific. + */ + Event_Tuple *handlers_; + + }; + public: /// Initialize @c ACE_Dev_Poll_Reactor with the default size. @@ -470,7 +473,7 @@ public: * access violations. */ ACE_Dev_Poll_Reactor (size_t size, - int restart = 0, + bool restart = false, ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0, int disable_notify_pipe = 0, @@ -483,7 +486,7 @@ public: /// Initialization. virtual int open (size_t size, - int restart = 0, + bool restart = false, ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0, int disable_notify_pipe = 0, @@ -621,8 +624,8 @@ public: ACE_Event_Handler **old_sh = 0, ACE_Sig_Action *old_disp = 0); - /// Registers to handle a set of signals using the - /// . + /// Registers @a new_sh to handle a set of signals @a sigset using the + /// @a new_disp. virtual int register_handler (const ACE_Sig_Set &sigset, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp = 0); @@ -646,7 +649,7 @@ public: ACE_Reactor_Mask mask); /** - * Removes all handles in . If @a mask == + * Removes all handles in @a handle_set. If @a mask == * ACE_Event_Handler::DONT_CALL then the method of * the associated s is not invoked. */ @@ -664,7 +667,7 @@ public: ACE_Sig_Action *old_disp = 0, int sigkey = -1); - /// Calls for every signal in . + /// Calls for every signal in @a sigset. virtual int remove_handler (const ACE_Sig_Set &sigset); // = Suspend and resume Handlers. @@ -700,9 +703,9 @@ public: /// the application. virtual int resumable_handler (void); - /// Return 1 if we any event associations were made by the reactor - /// for the handles that it waits on, 0 otherwise. - virtual int uses_event_associations (void); + /// Return true if we any event associations were made by the reactor + /// for the handles that it waits on, false otherwise. + virtual bool uses_event_associations (void); // = Timer management. @@ -792,7 +795,7 @@ public: /** * Set the maximum number of times that ACE_Reactor_Impl will - * iterate and dispatch the that are passed in + * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its * loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this @@ -804,7 +807,7 @@ public: /** * Get the maximum number of times that the ACE_Reactor_Impl will - * iterate and dispatch the that are passed in + * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its * loop. */ @@ -874,7 +877,7 @@ public: virtual int owner (ACE_thread_t *owner); /// Get the existing restart value. - virtual int restart (void); + virtual bool restart (void); /// Set a new value for restart and return the original value. /** @@ -884,7 +887,7 @@ public: * * @return Returns the previous "restart" value. */ - virtual int restart (int r); + virtual bool restart (bool r); /// Set position of the owner thread. /** @@ -1007,8 +1010,12 @@ protected: ACE_Reactor_Mask mask); /// Remove the event handler associated with the given handle and - /// event mask from the "interest set." - int remove_handler_i (ACE_HANDLE handle, ACE_Reactor_Mask mask); + /// event mask from the "interest set." If @a eh is supplied, only + /// do the remove if @eh matches the event handler that's registered + /// for @a handle. + int remove_handler_i (ACE_HANDLE handle, + ACE_Reactor_Mask mask, + ACE_Event_Handler *eh = 0); /// Temporarily remove the given handle from the "interest set." int suspend_handler_i (ACE_HANDLE handle); @@ -1043,33 +1050,34 @@ protected: */ ACE_HANDLE poll_fd_; - /// The maximum number of file descriptors over which demultiplexing - /// will occur. - size_t size_; - /// Track HANDLES we are interested in for various events that must /// be dispatched *without* polling. /// ACE_Dev_Poll_Ready_Set ready_set_; #if defined (ACE_HAS_EVENT_POLL) - /// Table of event structures to be filled by epoll_wait: - struct epoll_event *events_; - - /// Pointer to the next epoll_event array element that contains the next - /// event to be dispatched. - struct epoll_event *start_pevents_; - - /// The last element in the event array plus one. - /** - * The loop that dispatches IO events stops when this->start_pevents_ == - * this->end_pevents_. - */ - struct epoll_event *end_pevents_; + /// Event structure to be filled by epoll_wait. epoll_wait() only gets + /// one event at a time and we rely on it's internals for fairness. + /// If this struct's fd is ACE_INVALID_HANDLE, the rest is indeterminate. + /// If the fd is good, the event is one that's been retrieved by + /// epoll_wait() but not yet processed. + struct epoll_event event_; + /// Event handlers that are suspended/resumed around upcalls are not + /// immediately resumed; they're added to this list for resumption at + /// the next epoll_wait() call. This avoids always needing to acquire the + /// token just to resume a handler. Of course, if there are no other + /// handlers in the to-be-resumed list and an epoll_wait is already in + /// progress, the reactor needs to be notified to force another run around + /// the epoll_wait() call. + typedef ACE_Array_Map Resume_Map; + Resume_Map to_be_resumed_; + volatile bool epoll_wait_in_progress_; + ACE_SYNCH_MUTEX to_be_resumed_lock_; #else /// The pollfd array that `/dev/poll' will feed its results to. struct pollfd *dp_fds_; + /// Pointer to the next pollfd array element that contains the next /// event to be dispatched. struct pollfd *start_pfds_; @@ -1093,7 +1101,7 @@ protected: ACE_Lock_Adapter lock_adapter_; /// The repository that contains all registered event handlers. - ACE_Dev_Poll_Reactor_Handler_Repository handler_rep_; + Handler_Repository handler_rep_; /// Defined as a pointer to allow overriding by derived classes... ACE_Timer_Queue *timer_queue_; @@ -1130,7 +1138,7 @@ protected: /// Restart the handle_events event loop method automatically when /// polling function in use (ioctl() in this case) is interrupted /// via an EINTR signal. - int restart_; + bool restart_; protected: @@ -1189,6 +1197,7 @@ protected: }; + /** * @class ACE_Dev_Poll_Handler_Guard * @@ -1247,4 +1256,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DEV_POLL_REACTOR_H */ - diff --git a/externals/ace/Dev_Poll_Reactor.inl b/externals/ace/Dev_Poll_Reactor.inl new file mode 100644 index 00000000000..2008107bc2c --- /dev/null +++ b/externals/ace/Dev_Poll_Reactor.inl @@ -0,0 +1,146 @@ +// -*- C++ -*- +// +// $Id: Dev_Poll_Reactor.inl 90177 2010-05-19 11:44:22Z vzykov $ + +#include "ace/Log_Msg.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE +ACE_Dev_Poll_Reactor::Event_Tuple::Event_Tuple (ACE_Event_Handler *eh, + ACE_Reactor_Mask m, + bool is_suspended, + bool is_controlled) + : event_handler (eh), + mask (m), + suspended (is_suspended), + controlled (is_controlled) +{ +} + +// --------------------------------------------------------------------- + +#if 0 +ACE_INLINE +ACE_Dev_Poll_Ready_Set::ACE_Dev_Poll_Ready_Set (void) + : pfds (0), + nfds (0) +{ +} +#endif /* 0 */ + +// --------------------------------------------------------------------- + +ACE_INLINE size_t +ACE_Dev_Poll_Reactor::Handler_Repository::size (void) const +{ + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::size"); + + return this->size_; +} + +ACE_INLINE size_t +ACE_Dev_Poll_Reactor::Handler_Repository::max_size (void) const +{ + ACE_TRACE ("ACE_Dev_Poll_Reactor::Handler_Repository::max_size"); + + return this->max_size_; +} + +// ----------------------------------------------------------------- + +ACE_INLINE +ACE_Dev_Poll_Handler_Guard::ACE_Dev_Poll_Handler_Guard + (ACE_Event_Handler *eh, + bool do_incr) + : eh_ (eh), + refcounted_ (false) +{ + if (eh == 0) + return; + + this->refcounted_ = + eh->reference_counting_policy ().value () == + ACE_Event_Handler::Reference_Counting_Policy::ENABLED; + + if (do_incr && this->refcounted_) + eh->add_reference (); +} + +ACE_INLINE +ACE_Dev_Poll_Handler_Guard::~ACE_Dev_Poll_Handler_Guard (void) +{ + if (this->refcounted_ && this->eh_ != 0) + this->eh_->remove_reference (); +} + +ACE_INLINE void +ACE_Dev_Poll_Handler_Guard::release (void) +{ + this->eh_ = 0; +} + +// --------------------------------------------------------------------- + +ACE_INLINE int +ACE_Dev_Poll_Reactor::upcall (ACE_Event_Handler *event_handler, + int (ACE_Event_Handler::*callback)(ACE_HANDLE), + ACE_HANDLE handle) +{ + // If the handler returns positive value (requesting a reactor + // callback) just call back as many times as the handler requests + // it. The handler is suspended internally and other threads are off + // handling other things. + int status = 0; + + do + { + status = (event_handler->*callback) (handle); + } + while (status > 0 && event_handler != this->notify_handler_); + + return status; +} + + +/************************************************************************/ +// Methods for ACE_Dev_Poll_Reactor::Token_Guard +/************************************************************************/ + +ACE_INLINE +ACE_Dev_Poll_Reactor::Token_Guard::Token_Guard (ACE_Dev_Poll_Reactor_Token &token) + + : token_ (token), + owner_ (0) +{ +} + +ACE_INLINE +ACE_Dev_Poll_Reactor::Token_Guard::~Token_Guard (void) +{ + if (this->owner_ == 1) + { + ACE_MT (this->token_.release ()); + this->owner_ = 0; + } +} + +ACE_INLINE void +ACE_Dev_Poll_Reactor::Token_Guard::release_token (void) +{ + if (this->owner_) + { + ACE_MT (this->token_.release ()); + + // We are not the owner anymore.. + this->owner_ = 0; + } +} + +ACE_INLINE int +ACE_Dev_Poll_Reactor::Token_Guard::is_owner (void) +{ + return this->owner_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Dirent.cpp b/externals/ace/Dirent.cpp similarity index 99% rename from dep/src/ace/Dirent.cpp rename to externals/ace/Dirent.cpp index 180642fc0f9..df1290e1e53 100644 --- a/dep/src/ace/Dirent.cpp +++ b/externals/ace/Dirent.cpp @@ -5,4 +5,3 @@ #if !defined (__ACE_INLINE__) #include "ace/Dirent.inl" #endif /* __ACE_INLINE__ */ - diff --git a/dep/include/ace/Dirent.h b/externals/ace/Dirent.h similarity index 94% rename from dep/include/ace/Dirent.h rename to externals/ace/Dirent.h index 036a942c611..8d15e5337da 100644 --- a/dep/include/ace/Dirent.h +++ b/externals/ace/Dirent.h @@ -4,7 +4,7 @@ /** * @file Dirent.h * - * $Id: Dirent.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Dirent.h 84316 2009-02-03 19:46:05Z johnnyw $ * * Define a portable C++ interface to ACE_OS_Dirent directory-entry * manipulation. @@ -39,17 +39,17 @@ public: /// Default constructor. ACE_Dirent (void); - /// Constructor calls + /// Constructor calls @c opendir() explicit ACE_Dirent (const ACE_TCHAR *dirname); /// Opens the directory named by filename and associates a directory /// stream with it. int open (const ACE_TCHAR *filename); - /// Destructor calls . + /// Destructor calls @c closedir(). ~ACE_Dirent (void); - /// Closes the directory stream and frees the structure. + /// Closes the directory stream and frees the ACE_DIR structure. void close (void); // = Iterator methods. @@ -120,4 +120,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DIRENT_H */ - diff --git a/dep/include/ace/Dirent.inl b/externals/ace/Dirent.inl similarity index 100% rename from dep/include/ace/Dirent.inl rename to externals/ace/Dirent.inl diff --git a/dep/src/ace/Dirent_Selector.cpp b/externals/ace/Dirent_Selector.cpp similarity index 99% rename from dep/src/ace/Dirent_Selector.cpp rename to externals/ace/Dirent_Selector.cpp index 875a466e5b3..8fcb5775b29 100644 --- a/dep/src/ace/Dirent_Selector.cpp +++ b/externals/ace/Dirent_Selector.cpp @@ -57,4 +57,3 @@ ACE_Dirent_Selector::close (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Dirent_Selector.h b/externals/ace/Dirent_Selector.h similarity index 99% rename from dep/include/ace/Dirent_Selector.h rename to externals/ace/Dirent_Selector.h index 3356f18723d..20673c473a9 100644 --- a/dep/include/ace/Dirent_Selector.h +++ b/externals/ace/Dirent_Selector.h @@ -73,4 +73,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DIRENT_SELECTOR_H */ - diff --git a/dep/include/ace/Dirent_Selector.inl b/externals/ace/Dirent_Selector.inl similarity index 100% rename from dep/include/ace/Dirent_Selector.inl rename to externals/ace/Dirent_Selector.inl diff --git a/dep/src/ace/Dump.cpp b/externals/ace/Dump.cpp similarity index 99% rename from dep/src/ace/Dump.cpp rename to externals/ace/Dump.cpp index fce6bcc277a..6e5c2d0c3ea 100644 --- a/dep/src/ace/Dump.cpp +++ b/externals/ace/Dump.cpp @@ -139,4 +139,3 @@ ACE_ODB::remove_object (const void *this_ptr) ACE_ODB *ACE_ODB::instance_ = 0; ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Dump.h b/externals/ace/Dump.h similarity index 100% rename from dep/include/ace/Dump.h rename to externals/ace/Dump.h index d94a740bce7..4ccd64adb95 100644 --- a/dep/include/ace/Dump.h +++ b/externals/ace/Dump.h @@ -47,6 +47,7 @@ */ //============================================================================= + #ifndef ACE_DUMP_H #define ACE_DUMP_H #include /**/ "ace/pre.h" @@ -169,4 +170,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DUMP_H */ - diff --git a/dep/src/ace/Dump_T.cpp b/externals/ace/Dump_T.cpp similarity index 99% rename from dep/src/ace/Dump_T.cpp rename to externals/ace/Dump_T.cpp index 5432b1b6e51..da2b62a6fa3 100644 --- a/dep/src/ace/Dump_T.cpp +++ b/externals/ace/Dump_T.cpp @@ -46,4 +46,3 @@ ACE_Dumpable_Adapter::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_DUMP_T_CPP */ - diff --git a/dep/include/ace/Dump_T.h b/externals/ace/Dump_T.h similarity index 100% rename from dep/include/ace/Dump_T.h rename to externals/ace/Dump_T.h index fe18af0cdcf..92b57addce6 100644 --- a/dep/include/ace/Dump_T.h +++ b/externals/ace/Dump_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_DUMP_T_H #define ACE_DUMP_T_H #include /**/ "ace/pre.h" @@ -79,4 +80,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DUMP_T_H */ - diff --git a/dep/src/ace/Dynamic.cpp b/externals/ace/Dynamic.cpp similarity index 99% rename from dep/src/ace/Dynamic.cpp rename to externals/ace/Dynamic.cpp index 2a3f8b0f26d..4eaedad0cfe 100644 --- a/dep/src/ace/Dynamic.cpp +++ b/externals/ace/Dynamic.cpp @@ -32,4 +32,3 @@ template ACE_TSS_Singleton * #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Dynamic.h b/externals/ace/Dynamic.h similarity index 99% rename from dep/include/ace/Dynamic.h rename to externals/ace/Dynamic.h index 6906ebf1267..70dfcd8d90a 100644 --- a/dep/include/ace/Dynamic.h +++ b/externals/ace/Dynamic.h @@ -73,4 +73,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DYNAMIC_H */ - diff --git a/dep/include/ace/Dynamic.inl b/externals/ace/Dynamic.inl similarity index 100% rename from dep/include/ace/Dynamic.inl rename to externals/ace/Dynamic.inl diff --git a/dep/src/ace/Dynamic_Message_Strategy.cpp b/externals/ace/Dynamic_Message_Strategy.cpp similarity index 98% rename from dep/src/ace/Dynamic_Message_Strategy.cpp rename to externals/ace/Dynamic_Message_Strategy.cpp index 1fa3320d5ae..bce5865a1e6 100644 --- a/dep/src/ace/Dynamic_Message_Strategy.cpp +++ b/externals/ace/Dynamic_Message_Strategy.cpp @@ -11,7 +11,7 @@ ACE_RCSID (ace, Dynamic_Message_Strategy, - "$Id: Dynamic_Message_Strategy.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Dynamic_Message_Strategy.cpp 84565 2009-02-23 08:20:39Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -82,6 +82,7 @@ ACE_Dynamic_Message_Strategy::priority_status (ACE_Message_Block & mb, return status; } + // Dump the state of the strategy. void @@ -148,7 +149,7 @@ ACE_Deadline_Message_Strategy::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Dynamic_Message_Strategy base class: \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Dynamic_Message_Strategy base class:\n"))); this->ACE_Dynamic_Message_Strategy::dump (); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nderived class: ACE_Deadline_Message_Strategy\n"))); @@ -191,7 +192,7 @@ ACE_Laxity_Message_Strategy::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Dynamic_Message_Strategy base class: \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Dynamic_Message_Strategy base class:\n"))); this->ACE_Dynamic_Message_Strategy::dump (); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nderived class: ACE_Laxity_Message_Strategy\n"))); @@ -202,4 +203,3 @@ ACE_Laxity_Message_Strategy::dump (void) const // Dump the state of the strategy. ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Dynamic_Message_Strategy.h b/externals/ace/Dynamic_Message_Strategy.h similarity index 99% rename from dep/include/ace/Dynamic_Message_Strategy.h rename to externals/ace/Dynamic_Message_Strategy.h index db6a51bb70e..090ad3a8f82 100644 --- a/dep/include/ace/Dynamic_Message_Strategy.h +++ b/externals/ace/Dynamic_Message_Strategy.h @@ -215,4 +215,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DYNAMIC_MESSAGE_STRATEGY_H */ - diff --git a/dep/include/ace/Dynamic_Message_Strategy.inl b/externals/ace/Dynamic_Message_Strategy.inl similarity index 100% rename from dep/include/ace/Dynamic_Message_Strategy.inl rename to externals/ace/Dynamic_Message_Strategy.inl diff --git a/dep/src/ace/Dynamic_Service.cpp b/externals/ace/Dynamic_Service.cpp similarity index 99% rename from dep/src/ace/Dynamic_Service.cpp rename to externals/ace/Dynamic_Service.cpp index 900419bd846..28d6e4526f2 100644 --- a/dep/src/ace/Dynamic_Service.cpp +++ b/externals/ace/Dynamic_Service.cpp @@ -61,4 +61,3 @@ ACE_Dynamic_Service::instance (const ACE_Service_Gestalt* conf, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_DYNAMIC_SERVICE_CPP */ - diff --git a/dep/include/ace/Dynamic_Service.h b/externals/ace/Dynamic_Service.h similarity index 99% rename from dep/include/ace/Dynamic_Service.h rename to externals/ace/Dynamic_Service.h index fb2469c5418..b90095c766d 100644 --- a/dep/include/ace/Dynamic_Service.h +++ b/externals/ace/Dynamic_Service.h @@ -87,4 +87,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DYNAMIC_SERVICE_H */ - diff --git a/dep/include/ace/Dynamic_Service.inl b/externals/ace/Dynamic_Service.inl similarity index 100% rename from dep/include/ace/Dynamic_Service.inl rename to externals/ace/Dynamic_Service.inl diff --git a/dep/src/ace/Dynamic_Service_Base.cpp b/externals/ace/Dynamic_Service_Base.cpp similarity index 78% rename from dep/src/ace/Dynamic_Service_Base.cpp rename to externals/ace/Dynamic_Service_Base.cpp index 474c485b6ff..ecefcf17207 100644 --- a/dep/src/ace/Dynamic_Service_Base.cpp +++ b/externals/ace/Dynamic_Service_Base.cpp @@ -5,12 +5,14 @@ #include "ace/Service_Types.h" #include "ace/Log_Msg.h" + ACE_RCSID (ace, Dynamic_Service_Base, - "$Id: Dynamic_Service_Base.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Dynamic_Service_Base.cpp 84282 2009-01-30 15:04:29Z msmit $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL + void ACE_Dynamic_Service_Base::dump (void) const { @@ -45,7 +47,7 @@ ACE_Dynamic_Service_Base::find_i (const ACE_Service_Gestalt* &repo, ACE_Service_Gestalt* global = ACE_Service_Config::global (); - for (; (repo->find (name, &svc_rec) == -1) && !no_global; repo = global) + for ( ; (repo->find (name, &svc_rec) == -1) && !no_global; repo = global) { // Check the static repo, too if different if (repo == global) @@ -55,6 +57,7 @@ ACE_Dynamic_Service_Base::find_i (const ACE_Service_Gestalt* &repo, return svc_rec; } + // Get the instance using for specific configuration repository. void * ACE_Dynamic_Service_Base::instance (const ACE_Service_Gestalt* repo, @@ -79,21 +82,25 @@ ACE_Dynamic_Service_Base::instance (const ACE_Service_Gestalt* repo, { ACE_Guard log_guard (*ACE_Log_Msg::instance ()); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("ACE (%P|%t) DSB::instance, repo=%@, name=%s") - ACE_TEXT (" type=%@ => %@"), - repo->repo_, name, type, obj)); - if (repo->repo_ != repo_found->repo_) - ACE_DEBUG ((LM_DEBUG, + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("ACE (%P|%t) DSB::instance, repo=%@, name=%s") + ACE_TEXT (" type=%@ => %@") ACE_TEXT (" [in repo=%@]\n"), + repo->repo_, name, type, obj, repo_found->repo_)); + } else - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("ACE (%P|%t) DSB::instance, repo=%@, name=%s") + ACE_TEXT (" type=%@ => %@\n"), + repo->repo_, name, type, obj)); + } } return obj; } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Dynamic_Service_Base.h b/externals/ace/Dynamic_Service_Base.h similarity index 96% rename from dep/include/ace/Dynamic_Service_Base.h rename to externals/ace/Dynamic_Service_Base.h index 4491a9407d8..31fdadaa152 100644 --- a/dep/include/ace/Dynamic_Service_Base.h +++ b/externals/ace/Dynamic_Service_Base.h @@ -4,7 +4,7 @@ /** * @file Dynamic_Service_Base.h * - * $Id: Dynamic_Service_Base.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Dynamic_Service_Base.h 89454 2010-03-11 09:35:25Z johnnyw $ * * @author Prashant Jain * @author Douglas C. Schmidt @@ -37,7 +37,6 @@ class ACE_Service_Type; */ class ACE_Export ACE_Dynamic_Service_Base { - public: /// Dump the current static of the object void dump (void) const; @@ -72,4 +71,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_DYNAMIC_SERVICE_BASE_H */ - diff --git a/dep/src/ace/Dynamic_Service_Dependency.cpp b/externals/ace/Dynamic_Service_Dependency.cpp similarity index 99% rename from dep/src/ace/Dynamic_Service_Dependency.cpp rename to externals/ace/Dynamic_Service_Dependency.cpp index 8e814af86a7..df7cd0f5d48 100644 --- a/dep/src/ace/Dynamic_Service_Dependency.cpp +++ b/externals/ace/Dynamic_Service_Dependency.cpp @@ -8,8 +8,10 @@ ACE_RCSID (ace, Dynamic_Service_Dependency, "$Id: Dynamic_Service_Dependency.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL + ACE_Dynamic_Service_Dependency::ACE_Dynamic_Service_Dependency (const ACE_TCHAR *principal) { this->init (ACE_Service_Config::current (), principal); @@ -21,6 +23,7 @@ ACE_Dynamic_Service_Dependency::ACE_Dynamic_Service_Dependency (const ACE_Servic this->init (cfg, principal); } + ACE_Dynamic_Service_Dependency::~ACE_Dynamic_Service_Dependency (void) { if (ACE::debug ()) @@ -44,5 +47,5 @@ ACE_Dynamic_Service_Dependency::init (const ACE_Service_Gestalt *cfg, this->tracker_ = st->dll (); } -ACE_END_VERSIONED_NAMESPACE_DECL +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/Dynamic_Service_Dependency.h b/externals/ace/Dynamic_Service_Dependency.h similarity index 99% rename from dep/include/ace/Dynamic_Service_Dependency.h rename to externals/ace/Dynamic_Service_Dependency.h index 21e63bb9411..0f187d0037a 100644 --- a/dep/include/ace/Dynamic_Service_Dependency.h +++ b/externals/ace/Dynamic_Service_Dependency.h @@ -15,6 +15,7 @@ #include /**/ "ace/pre.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -63,7 +64,7 @@ private: ACE_END_VERSIONED_NAMESPACE_DECL + #include /**/ "ace/post.h" #endif /* ACE_DYNAMIC_SERVICE_DEPENDENCY_H */ - diff --git a/dep/src/ace/Encoding_Converter.cpp b/externals/ace/Encoding_Converter.cpp similarity index 99% rename from dep/src/ace/Encoding_Converter.cpp rename to externals/ace/Encoding_Converter.cpp index e01c15ef865..b5fd2b35402 100644 --- a/dep/src/ace/Encoding_Converter.cpp +++ b/externals/ace/Encoding_Converter.cpp @@ -10,4 +10,3 @@ ACE_Encoding_Converter::~ACE_Encoding_Converter (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_WCHAR */ - diff --git a/dep/include/ace/Encoding_Converter.h b/externals/ace/Encoding_Converter.h similarity index 99% rename from dep/include/ace/Encoding_Converter.h rename to externals/ace/Encoding_Converter.h index 8833d3fced8..34d22fa29a1 100644 --- a/dep/include/ace/Encoding_Converter.h +++ b/externals/ace/Encoding_Converter.h @@ -68,4 +68,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ENCODING_CONVERTER_H */ - diff --git a/dep/src/ace/Encoding_Converter_Factory.cpp b/externals/ace/Encoding_Converter_Factory.cpp similarity index 99% rename from dep/src/ace/Encoding_Converter_Factory.cpp rename to externals/ace/Encoding_Converter_Factory.cpp index 3cd365f3ae1..f603ae3e893 100644 --- a/dep/src/ace/Encoding_Converter_Factory.cpp +++ b/externals/ace/Encoding_Converter_Factory.cpp @@ -72,4 +72,3 @@ ACE_Encoding_Converter_Factory::create ( ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_WCHAR */ - diff --git a/dep/include/ace/Encoding_Converter_Factory.h b/externals/ace/Encoding_Converter_Factory.h similarity index 99% rename from dep/include/ace/Encoding_Converter_Factory.h rename to externals/ace/Encoding_Converter_Factory.h index c1311451db5..1441c690bef 100644 --- a/dep/include/ace/Encoding_Converter_Factory.h +++ b/externals/ace/Encoding_Converter_Factory.h @@ -52,4 +52,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ENCODING_CONVERTER_FACTORY_H */ - diff --git a/dep/src/ace/Env_Value_T.cpp b/externals/ace/Env_Value_T.cpp similarity index 99% rename from dep/src/ace/Env_Value_T.cpp rename to externals/ace/Env_Value_T.cpp index 15ff7524ccf..1997bbea484 100644 --- a/dep/src/ace/Env_Value_T.cpp +++ b/externals/ace/Env_Value_T.cpp @@ -10,4 +10,3 @@ #endif /* __ACE_INLINE__ */ #endif /* ACE_ENV_VALUE_T_CPP */ - diff --git a/dep/include/ace/Env_Value_T.h b/externals/ace/Env_Value_T.h similarity index 99% rename from dep/include/ace/Env_Value_T.h rename to externals/ace/Env_Value_T.h index 05b4706c122..df2178a0f11 100644 --- a/dep/include/ace/Env_Value_T.h +++ b/externals/ace/Env_Value_T.h @@ -164,4 +164,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ENV_VALUE_T_H */ - diff --git a/dep/include/ace/Env_Value_T.inl b/externals/ace/Env_Value_T.inl similarity index 100% rename from dep/include/ace/Env_Value_T.inl rename to externals/ace/Env_Value_T.inl diff --git a/dep/src/ace/Event.cpp b/externals/ace/Event.cpp similarity index 99% rename from dep/src/ace/Event.cpp rename to externals/ace/Event.cpp index a5461de4bd9..ea5f86d99d1 100644 --- a/dep/src/ace/Event.cpp +++ b/externals/ace/Event.cpp @@ -91,4 +91,3 @@ ACE_Event::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Event.h b/externals/ace/Event.h similarity index 99% rename from dep/include/ace/Event.h rename to externals/ace/Event.h index 69d819b3978..887b504d8f9 100644 --- a/dep/include/ace/Event.h +++ b/externals/ace/Event.h @@ -141,4 +141,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_EVENT_H */ - diff --git a/dep/include/ace/Event.inl b/externals/ace/Event.inl similarity index 100% rename from dep/include/ace/Event.inl rename to externals/ace/Event.inl diff --git a/dep/src/ace/Event_Handler.cpp b/externals/ace/Event_Handler.cpp similarity index 97% rename from dep/src/ace/Event_Handler.cpp rename to externals/ace/Event_Handler.cpp index 52aa92f99fe..e04e8cb5d10 100644 --- a/dep/src/ace/Event_Handler.cpp +++ b/externals/ace/Event_Handler.cpp @@ -1,5 +1,5 @@ // Event_Handler.cpp -// $Id: Event_Handler.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Event_Handler.cpp 85236 2009-05-01 11:43:56Z johnnyw $ #include "ace/Event_Handler.h" #include "ace/OS_Errno.h" @@ -14,7 +14,7 @@ #include -ACE_RCSID(ace, Event_Handler, "$Id: Event_Handler.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Event_Handler, "$Id: Event_Handler.cpp 85236 2009-05-01 11:43:56Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -145,6 +145,7 @@ ACE_Event_Handler::resume_handler (void) return ACE_Event_Handler::ACE_REACTOR_RESUMES_HANDLER; } + int ACE_Event_Handler::handle_qos (ACE_HANDLE) { @@ -243,8 +244,6 @@ ACE_Event_Handler::reference_counting_policy (void) return this->reference_counting_policy_; } -//#if !defined (ACE_HAS_WINCE) - ACE_THR_FUNC_RETURN ACE_Event_Handler::read_adapter (void *args) { @@ -298,8 +297,6 @@ ACE_Event_Handler::remove_stdin_handler (ACE_Reactor *reactor, #endif /* ACE_WIN32 */ } -//#endif /* ACE_HAS_WINCE */ - // --------------------------------------------------------------------- ACE_Event_Handler_var::ACE_Event_Handler_var (void) @@ -380,6 +377,8 @@ ACE_Event_Handler_var::reset (ACE_Event_Handler *p) // --------------------------------------------------------------------- ACE_Notification_Buffer::ACE_Notification_Buffer (void) + : eh_ (0), + mask_ (ACE_Event_Handler::NULL_MASK) { ACE_TRACE ("ACE_Notification_Buffer::ACE_Notification_Buffer"); } @@ -393,4 +392,3 @@ ACE_Notification_Buffer::ACE_Notification_Buffer (ACE_Event_Handler *eh, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Event_Handler.h b/externals/ace/Event_Handler.h similarity index 97% rename from dep/include/ace/Event_Handler.h rename to externals/ace/Event_Handler.h index e97cca48a46..2e1414ec336 100644 --- a/dep/include/ace/Event_Handler.h +++ b/externals/ace/Event_Handler.h @@ -4,7 +4,7 @@ /** * @file Event_Handler.h * - * $Id: Event_Handler.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Event_Handler.h 86576 2009-08-29 22:42:51Z shuston $ * * @author Douglas C. Schmidt */ @@ -114,7 +114,7 @@ public: /** * Called when timer expires. @a current_time represents the current - * time that the was selected for timeout + * time that the Event_Handler was selected for timeout * dispatching and @a act is the asynchronous completion token that * was passed in when was invoked. */ @@ -153,9 +153,8 @@ public: * return a value more than zero and decide to resume the handler * themseleves. * - * @note This method is only useful for the ACE_TP_Reactor. Sad - * that we have to have this method in a class that is supposed to - * be used across different components in ACE. + * @note This method has an affect only when used with the + * ACE_Dev_Poll_Reactor (and then, only on Linux) or the ACE_TP_Reactor. */ virtual int resume_handler (void); @@ -386,4 +385,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_EVENT_HANDLER_H */ - diff --git a/dep/include/ace/Event_Handler.inl b/externals/ace/Event_Handler.inl similarity index 100% rename from dep/include/ace/Event_Handler.inl rename to externals/ace/Event_Handler.inl diff --git a/dep/src/ace/Event_Handler_T.cpp b/externals/ace/Event_Handler_T.cpp similarity index 99% rename from dep/src/ace/Event_Handler_T.cpp rename to externals/ace/Event_Handler_T.cpp index 76fb69877e5..45d9d4e2767 100644 --- a/dep/src/ace/Event_Handler_T.cpp +++ b/externals/ace/Event_Handler_T.cpp @@ -123,4 +123,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ #endif /* ACE_EVENT_HANDLER_T_CPP */ - diff --git a/dep/include/ace/Event_Handler_T.h b/externals/ace/Event_Handler_T.h similarity index 98% rename from dep/include/ace/Event_Handler_T.h rename to externals/ace/Event_Handler_T.h index 47cc5fd56bf..d86ac333221 100644 --- a/dep/include/ace/Event_Handler_T.h +++ b/externals/ace/Event_Handler_T.h @@ -4,7 +4,7 @@ /** * @file Event_Handler_T.h * - * $Id: Event_Handler_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Event_Handler_T.h 83891 2008-11-28 11:01:50Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -37,7 +37,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * inheritance hierarchy but also would like to integrate with * the ACE_Reactor. Rather than adopt a "mixin" approach, it is * often cleaner to define a template as a subclass of - * ACE_Event_Handler and paramterize it with an operation + * ACE_Event_Handler and parameterize it with an operation * dispatcher type. * When constructing an instantiation of the ACE_Event_Handler_T * object, a set of pointers to member functions must be @@ -189,4 +189,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ #include /**/ "ace/post.h" #endif /* ACE_EVENT_HANDLER_H */ - diff --git a/dep/include/ace/Event_Handler_T.inl b/externals/ace/Event_Handler_T.inl similarity index 100% rename from dep/include/ace/Event_Handler_T.inl rename to externals/ace/Event_Handler_T.inl diff --git a/dep/include/ace/Exception_Macros.h b/externals/ace/Exception_Macros.h similarity index 99% rename from dep/include/ace/Exception_Macros.h rename to externals/ace/Exception_Macros.h index 32805184d04..bb74b1a2129 100644 --- a/dep/include/ace/Exception_Macros.h +++ b/externals/ace/Exception_Macros.h @@ -53,4 +53,3 @@ #include /**/ "ace/post.h" #endif /* ACE_EXCEPTION_MACROS_H */ - diff --git a/dep/src/ace/FIFO.cpp b/externals/ace/FIFO.cpp similarity index 99% rename from dep/src/ace/FIFO.cpp rename to externals/ace/FIFO.cpp index c5ace7f90d9..e3970015c43 100644 --- a/dep/src/ace/FIFO.cpp +++ b/externals/ace/FIFO.cpp @@ -76,4 +76,3 @@ ACE_FIFO::close (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FIFO.h b/externals/ace/FIFO.h similarity index 100% rename from dep/include/ace/FIFO.h rename to externals/ace/FIFO.h index 76090778e8f..2d590563a99 100644 --- a/dep/include/ace/FIFO.h +++ b/externals/ace/FIFO.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_FIFO_H #define ACE_FIFO_H #include /**/ "ace/pre.h" @@ -82,4 +83,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FIFO_H */ - diff --git a/dep/include/ace/FIFO.inl b/externals/ace/FIFO.inl similarity index 100% rename from dep/include/ace/FIFO.inl rename to externals/ace/FIFO.inl diff --git a/dep/src/ace/FIFO_Recv.cpp b/externals/ace/FIFO_Recv.cpp similarity index 99% rename from dep/src/ace/FIFO_Recv.cpp rename to externals/ace/FIFO_Recv.cpp index 08eb20fb469..254e30f21d1 100644 --- a/dep/src/ace/FIFO_Recv.cpp +++ b/externals/ace/FIFO_Recv.cpp @@ -86,4 +86,3 @@ ACE_FIFO_Recv::ACE_FIFO_Recv (const ACE_TCHAR *fifo_name, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FIFO_Recv.h b/externals/ace/FIFO_Recv.h similarity index 100% rename from dep/include/ace/FIFO_Recv.h rename to externals/ace/FIFO_Recv.h index 482b9a1f283..c19d102c82a 100644 --- a/dep/include/ace/FIFO_Recv.h +++ b/externals/ace/FIFO_Recv.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_FIFO_RECV_H #define ACE_FIFO_RECV_H @@ -82,4 +83,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FIFO_RECV_H */ - diff --git a/dep/include/ace/FIFO_Recv.inl b/externals/ace/FIFO_Recv.inl similarity index 100% rename from dep/include/ace/FIFO_Recv.inl rename to externals/ace/FIFO_Recv.inl diff --git a/dep/src/ace/FIFO_Recv_Msg.cpp b/externals/ace/FIFO_Recv_Msg.cpp similarity index 99% rename from dep/src/ace/FIFO_Recv_Msg.cpp rename to externals/ace/FIFO_Recv_Msg.cpp index 5a8cb5c04d5..f389d03d276 100644 --- a/dep/src/ace/FIFO_Recv_Msg.cpp +++ b/externals/ace/FIFO_Recv_Msg.cpp @@ -65,4 +65,3 @@ ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (const ACE_TCHAR *fifo_name, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FIFO_Recv_Msg.h b/externals/ace/FIFO_Recv_Msg.h similarity index 96% rename from dep/include/ace/FIFO_Recv_Msg.h rename to externals/ace/FIFO_Recv_Msg.h index c9ce36a1523..6b691e97f10 100644 --- a/dep/include/ace/FIFO_Recv_Msg.h +++ b/externals/ace/FIFO_Recv_Msg.h @@ -4,12 +4,13 @@ /** * @file FIFO_Recv_Msg.h * - * $Id: FIFO_Recv_Msg.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: FIFO_Recv_Msg.h 84480 2009-02-16 18:58:16Z johnnyw $ * * @author Doug Schmidt */ //============================================================================= + #ifndef ACE_FIFO_RECV_MSG_H #define ACE_FIFO_RECV_MSG_H #include /**/ "ace/pre.h" @@ -108,12 +109,12 @@ public: ssize_t recv (void *buf, size_t len); #if defined (ACE_HAS_STREAM_PIPES) - /// Recv and message via Stream pipes. + /// Recv @a data and @a cntl message via Stream pipes. ssize_t recv (ACE_Str_Buf *data, ACE_Str_Buf *cntl, int *flags); - /// Recv and message via Stream pipes in "band" mode. + /// Recv @a data and @a cntl message via Stream pipes in "band" mode. ssize_t recv (int *band, ACE_Str_Buf *data, ACE_Str_Buf *cntl, @@ -135,4 +136,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FIFO_RECV_MSG_H */ - diff --git a/dep/include/ace/FIFO_Recv_Msg.inl b/externals/ace/FIFO_Recv_Msg.inl similarity index 96% rename from dep/include/ace/FIFO_Recv_Msg.inl rename to externals/ace/FIFO_Recv_Msg.inl index 3055892172b..0a0b0673d38 100644 --- a/dep/include/ace/FIFO_Recv_Msg.inl +++ b/externals/ace/FIFO_Recv_Msg.inl @@ -43,12 +43,12 @@ ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf &recv_msg) ssize_t recv_len = ACE_OS::read (this->get_handle (), (char *) recv_msg.buf, ACE_MIN (remaining, requested)); - + if (recv_len == -1) { return -1; } - + // Tell caller what's really in the buffer. recv_msg.len = static_cast (recv_len); @@ -60,7 +60,7 @@ ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf &recv_msg) // saving the indication here either to read the remainder later. size_t total_msg_size = remaining; remaining -= recv_len; - + while (remaining > 0) { const size_t throw_away = 1024; @@ -68,15 +68,15 @@ ACE_FIFO_Recv_Msg::recv (ACE_Str_Buf &recv_msg) recv_len = ACE_OS::read (this->get_handle (), dev_null, ACE_MIN (remaining, throw_away)); - + if (recv_len == -1) { break; } - + remaining -= recv_len; } - + return ACE_Utils::truncate_cast (total_msg_size); } #endif /* ACE_HAS_STREAM_PIPES */ @@ -118,7 +118,7 @@ ACE_FIFO_Recv_Msg::recv (int *band, int *flags) { ACE_TRACE ("ACE_FIFO_Recv_Msg::recv"); - + if (ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, diff --git a/dep/src/ace/FIFO_Send.cpp b/externals/ace/FIFO_Send.cpp similarity index 99% rename from dep/src/ace/FIFO_Send.cpp rename to externals/ace/FIFO_Send.cpp index 79ea87682d3..720e63c5425 100644 --- a/dep/src/ace/FIFO_Send.cpp +++ b/externals/ace/FIFO_Send.cpp @@ -56,4 +56,3 @@ ACE_FIFO_Send::ACE_FIFO_Send (const ACE_TCHAR *fifo_name, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FIFO_Send.h b/externals/ace/FIFO_Send.h similarity index 100% rename from dep/include/ace/FIFO_Send.h rename to externals/ace/FIFO_Send.h index 414569325d9..cc0fc282f83 100644 --- a/dep/include/ace/FIFO_Send.h +++ b/externals/ace/FIFO_Send.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_FIFO_SEND_H #define ACE_FIFO_SEND_H @@ -72,4 +73,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FIFO_SEND_H */ - diff --git a/dep/include/ace/FIFO_Send.inl b/externals/ace/FIFO_Send.inl similarity index 100% rename from dep/include/ace/FIFO_Send.inl rename to externals/ace/FIFO_Send.inl diff --git a/dep/src/ace/FIFO_Send_Msg.cpp b/externals/ace/FIFO_Send_Msg.cpp similarity index 99% rename from dep/src/ace/FIFO_Send_Msg.cpp rename to externals/ace/FIFO_Send_Msg.cpp index 441a850c354..b3bbae00aed 100644 --- a/dep/src/ace/FIFO_Send_Msg.cpp +++ b/externals/ace/FIFO_Send_Msg.cpp @@ -78,4 +78,3 @@ ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (const ACE_TCHAR *fifo_name, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FIFO_Send_Msg.h b/externals/ace/FIFO_Send_Msg.h similarity index 92% rename from dep/include/ace/FIFO_Send_Msg.h rename to externals/ace/FIFO_Send_Msg.h index 79314a89ad5..434ae108130 100644 --- a/dep/include/ace/FIFO_Send_Msg.h +++ b/externals/ace/FIFO_Send_Msg.h @@ -4,12 +4,13 @@ /** * @file FIFO_Send_Msg.h * - * $Id: FIFO_Send_Msg.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: FIFO_Send_Msg.h 84480 2009-02-16 18:58:16Z johnnyw $ * * @author Doug Schmidt */ //============================================================================= + #ifndef ACE_FIFO_SEND_MSG_H #define ACE_FIFO_SEND_MSG_H #include /**/ "ace/pre.h" @@ -61,12 +62,12 @@ public: ssize_t send (const void *buf, size_t len); #if defined (ACE_HAS_STREAM_PIPES) - /// Send and message via Stream pipes. + /// Send @a data and @a cntl message via Stream pipes. ssize_t send (const ACE_Str_Buf *data, const ACE_Str_Buf *cntl = 0, int flags = 0); - /// Send and message via Stream pipes in "band" mode. + /// Send @a data and @a cntl message via Stream pipes in "band" mode. ssize_t send (int band, const ACE_Str_Buf *data, const ACE_Str_Buf *cntl = 0, @@ -88,4 +89,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FIFO_SEND_MSG_H */ - diff --git a/dep/include/ace/FIFO_Send_Msg.inl b/externals/ace/FIFO_Send_Msg.inl similarity index 100% rename from dep/include/ace/FIFO_Send_Msg.inl rename to externals/ace/FIFO_Send_Msg.inl diff --git a/dep/src/ace/FILE.cpp b/externals/ace/FILE.cpp similarity index 99% rename from dep/src/ace/FILE.cpp rename to externals/ace/FILE.cpp index 50b6342bc89..8fe88d1b09c 100644 --- a/dep/src/ace/FILE.cpp +++ b/externals/ace/FILE.cpp @@ -145,4 +145,3 @@ ACE_FILE::unlink (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FILE.h b/externals/ace/FILE.h similarity index 99% rename from dep/include/ace/FILE.h rename to externals/ace/FILE.h index 44d5ac71d20..407a03379e5 100644 --- a/dep/include/ace/FILE.h +++ b/externals/ace/FILE.h @@ -137,4 +137,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FILE_H */ - diff --git a/dep/include/ace/FILE.inl b/externals/ace/FILE.inl similarity index 100% rename from dep/include/ace/FILE.inl rename to externals/ace/FILE.inl diff --git a/dep/src/ace/FILE_Addr.cpp b/externals/ace/FILE_Addr.cpp similarity index 99% rename from dep/src/ace/FILE_Addr.cpp rename to externals/ace/FILE_Addr.cpp index 4b95a7db874..6d8fbeb775b 100644 --- a/dep/src/ace/FILE_Addr.cpp +++ b/externals/ace/FILE_Addr.cpp @@ -122,4 +122,3 @@ ACE_FILE_Addr::dump (void) const #endif /* ACE_HAS_DUMP */ } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FILE_Addr.h b/externals/ace/FILE_Addr.h similarity index 99% rename from dep/include/ace/FILE_Addr.h rename to externals/ace/FILE_Addr.h index 0604b689e5b..432275b9665 100644 --- a/dep/include/ace/FILE_Addr.h +++ b/externals/ace/FILE_Addr.h @@ -87,4 +87,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FILE_ADDR_H */ - diff --git a/dep/include/ace/FILE_Addr.inl b/externals/ace/FILE_Addr.inl similarity index 99% rename from dep/include/ace/FILE_Addr.inl rename to externals/ace/FILE_Addr.inl index b323911e516..0ae7d31d278 100644 --- a/dep/include/ace/FILE_Addr.inl +++ b/externals/ace/FILE_Addr.inl @@ -2,6 +2,7 @@ // // $Id: FILE_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/SString.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/FILE_Connector.cpp b/externals/ace/FILE_Connector.cpp similarity index 99% rename from dep/src/ace/FILE_Connector.cpp rename to externals/ace/FILE_Connector.cpp index b4f4d09e3c6..b59b1e8913d 100644 --- a/dep/src/ace/FILE_Connector.cpp +++ b/externals/ace/FILE_Connector.cpp @@ -82,4 +82,3 @@ ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FILE_Connector.h b/externals/ace/FILE_Connector.h similarity index 97% rename from dep/include/ace/FILE_Connector.h rename to externals/ace/FILE_Connector.h index 4f87e209d66..624ab3d6a5f 100644 --- a/dep/include/ace/FILE_Connector.h +++ b/externals/ace/FILE_Connector.h @@ -4,7 +4,7 @@ /** * @file FILE_Connector.h * - * $Id: FILE_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: FILE_Connector.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Doug Schmidt */ @@ -90,7 +90,7 @@ public: int perms = ACE_DEFAULT_FILE_PERMS); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); /// Dump the state of an object. void dump (void) const; @@ -111,4 +111,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FILE_CONNECTOR_H */ - diff --git a/dep/include/ace/FILE_Connector.inl b/externals/ace/FILE_Connector.inl similarity index 85% rename from dep/include/ace/FILE_Connector.inl rename to externals/ace/FILE_Connector.inl index deab94e0061..953f661fb05 100644 --- a/dep/include/ace/FILE_Connector.inl +++ b/externals/ace/FILE_Connector.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: FILE_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: FILE_Connector.inl 82723 2008-09-16 09:35:44Z johnnyw $ // Creates a Local ACE_FILE. @@ -25,12 +25,11 @@ ACE_FILE_Connector::ACE_FILE_Connector (ACE_FILE_IO &new_io, ACE_TEXT ("ACE_FILE_IO"))); } -ACE_INLINE int -ACE_FILE_Connector::reset_new_handle (ACE_HANDLE handle) +ACE_INLINE bool +ACE_FILE_Connector::reset_new_handle (ACE_HANDLE) { - ACE_UNUSED_ARG (handle); // Nothing to do here since the handle is not a socket - return 0; + return false; } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/FILE_IO.cpp b/externals/ace/FILE_IO.cpp similarity index 99% rename from dep/src/ace/FILE_IO.cpp rename to externals/ace/FILE_IO.cpp index c68df3e0416..d6bf084dfae 100644 --- a/dep/src/ace/FILE_IO.cpp +++ b/externals/ace/FILE_IO.cpp @@ -143,4 +143,3 @@ ACE_FILE_IO::recvv (iovec *io_vec) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/FILE_IO.h b/externals/ace/FILE_IO.h similarity index 99% rename from dep/include/ace/FILE_IO.h rename to externals/ace/FILE_IO.h index a1a470b8d30..951069e3652 100644 --- a/dep/include/ace/FILE_IO.h +++ b/externals/ace/FILE_IO.h @@ -168,4 +168,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FILE_IO_H */ - diff --git a/dep/include/ace/FILE_IO.inl b/externals/ace/FILE_IO.inl similarity index 100% rename from dep/include/ace/FILE_IO.inl rename to externals/ace/FILE_IO.inl diff --git a/dep/src/ace/File_Lock.cpp b/externals/ace/File_Lock.cpp similarity index 84% rename from dep/src/ace/File_Lock.cpp rename to externals/ace/File_Lock.cpp index 2b06ff26640..9eac8883d48 100644 --- a/dep/src/ace/File_Lock.cpp +++ b/externals/ace/File_Lock.cpp @@ -1,4 +1,4 @@ -// $Id: File_Lock.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: File_Lock.cpp 87213 2009-10-23 13:11:34Z johnnyw $ #include "ace/File_Lock.h" #include "ace/Log_Msg.h" @@ -7,7 +7,7 @@ #include "ace/File_Lock.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, File_Lock, "$Id: File_Lock.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, File_Lock, "$Id: File_Lock.cpp 87213 2009-10-23 13:11:34Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -26,8 +26,8 @@ ACE_File_Lock::dump (void) const } ACE_File_Lock::ACE_File_Lock (ACE_HANDLE h, - int unlink_in_destructor) - : removed_ (0), + bool unlink_in_destructor) + : removed_ (false), unlink_in_destructor_ (unlink_in_destructor) { // ACE_TRACE ("ACE_File_Lock::ACE_File_Lock"); @@ -41,7 +41,7 @@ ACE_File_Lock::ACE_File_Lock (ACE_HANDLE h, ACE_File_Lock::ACE_File_Lock (const ACE_TCHAR *name, int flags, mode_t perms, - int unlink_in_destructor) + bool unlink_in_destructor) : unlink_in_destructor_ (unlink_in_destructor) { // ACE_TRACE ("ACE_File_Lock::ACE_File_Lock"); @@ -59,7 +59,7 @@ ACE_File_Lock::open (const ACE_TCHAR *name, mode_t perms) { // ACE_TRACE ("ACE_File_Lock::open"); - this->removed_ = 0; + this->removed_ = false; return ACE_OS::flock_init (&this->lock_, flags, name, perms); } @@ -70,4 +70,3 @@ ACE_File_Lock::~ACE_File_Lock (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/File_Lock.h b/externals/ace/File_Lock.h similarity index 88% rename from dep/include/ace/File_Lock.h rename to externals/ace/File_Lock.h index c0629762d15..2820f71053d 100644 --- a/dep/include/ace/File_Lock.h +++ b/externals/ace/File_Lock.h @@ -4,7 +4,7 @@ /** * @file File_Lock.h * - * $Id: File_Lock.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: File_Lock.h 87213 2009-10-23 13:11:34Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -44,15 +44,15 @@ public: * zero value for . */ ACE_File_Lock (ACE_HANDLE handle = ACE_INVALID_HANDLE, - int unlink_in_destructor = 1); + bool unlink_in_destructor = true); /// Open the @a filename with @a flags and @a mode and set the result /// to . If you don't want the file unlinked in the - /// destructor pass a zero value for . + /// destructor pass a false value for @a unlink_in_destructor. ACE_File_Lock (const ACE_TCHAR *filename, int flags, mode_t mode = 0, - int unlink_in_destructor = 1); + bool unlink_in_destructor = true); /// Open the @a filename with @a flags and @a mode and set the result to /// . @@ -64,8 +64,8 @@ public: ~ACE_File_Lock (void); /// Remove a File lock by releasing it and closing down the - /// . If is non-0 then we unlink the file. - int remove (int unlink_file = 1); + /// . If @a unlink_file is true then we unlink the file. + int remove (bool unlink_file = true); /** * Note, for interface uniformity with other synchronization @@ -125,10 +125,10 @@ public: /** * Set underlying ACE_HANDLE. Note that this method assumes - * ownership of the and will close it down in . If - * you want the to stay open when is called make - * sure to call on the before closing it. You are - * responsible for the closing the existing before + * ownership of the @a handle and will close it down in . If + * you want the @a handle to stay open when is called make + * sure to call on the @a handle before closing it. You are + * responsible for the closing the existing @a handle before * overwriting it. */ void set_handle (ACE_HANDLE); @@ -148,11 +148,11 @@ protected: /// destructor. This flag isn't protected by a lock, so make sure /// that you don't have multiple threads simultaneously calling /// on the same object, which is a bad idea anyway... - int removed_; + bool removed_; /// Keeps track of whether to unlink the underlying file in the /// destructor. - int unlink_in_destructor_; + bool const unlink_in_destructor_; private: // = Prevent assignment and initialization. @@ -168,4 +168,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FILE_LOCK_H */ - diff --git a/dep/include/ace/File_Lock.inl b/externals/ace/File_Lock.inl similarity index 92% rename from dep/include/ace/File_Lock.inl rename to externals/ace/File_Lock.inl index 20b00039222..cf0cefed16e 100644 --- a/dep/include/ace/File_Lock.inl +++ b/externals/ace/File_Lock.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: File_Lock.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: File_Lock.inl 87213 2009-10-23 13:11:34Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -63,15 +63,15 @@ ACE_File_Lock::release (short whence, ACE_OFF_T start, ACE_OFF_T len) } ACE_INLINE int -ACE_File_Lock::remove (int unlink_file) +ACE_File_Lock::remove (bool unlink_file) { // ACE_TRACE ("ACE_File_Lock::remove"); int result = 0; - if (this->removed_ == 0) + if (!this->removed_) { - this->removed_ = 1; + this->removed_ = true; result = ACE_OS::flock_destroy (&this->lock_, unlink_file); } @@ -90,7 +90,7 @@ ACE_File_Lock::set_handle (ACE_HANDLE h) { // ACE_TRACE ("ACE_File_Lock::set_handle"); this->lock_.handle_ = h; - this->removed_ = 0; + this->removed_ = false; } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Filecache.cpp b/externals/ace/Filecache.cpp similarity index 97% rename from dep/src/ace/Filecache.cpp rename to externals/ace/Filecache.cpp index b57581e5668..494749ca7ce 100644 --- a/dep/src/ace/Filecache.cpp +++ b/externals/ace/Filecache.cpp @@ -1,4 +1,4 @@ -// $Id: Filecache.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Filecache.cpp 83735 2008-11-14 09:41:52Z johnnyw $ #include "ace/Filecache.h" #include "ace/Object_Manager.h" @@ -13,7 +13,7 @@ ACE_RCSID (ace, Filecache, - "$Id: Filecache.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Filecache.cpp 83735 2008-11-14 09:41:52Z johnnyw $") #if defined (ACE_WIN32) // Specifies no sharing flags. @@ -200,6 +200,7 @@ ACE_Filecache_Hash::equal (const ACE_TCHAR *const &id1, #undef ACE_Filecache_Hash #undef ACE_Filecache_Hash_Entry + // ------------- // ACE_Filecache // ------------- @@ -306,6 +307,7 @@ ACE_Filecache::find (const ACE_TCHAR *filename) return this->hash_.find (filename); } + ACE_Filecache_Object * ACE_Filecache::remove (const ACE_TCHAR *filename) { @@ -328,6 +330,7 @@ ACE_Filecache::remove (const ACE_TCHAR *filename) return 0; } + ACE_Filecache_Object * ACE_Filecache::fetch (const ACE_TCHAR *filename, int mapit) { @@ -735,18 +738,9 @@ ACE_Filecache_Object::update (void) const if (ACE_OS::stat (this->filename_, &statbuf) == -1) result = 1; else - // non-portable code may follow -#if defined (ACE_HAS_WINCE) - // Yup, non-portable... there's probably a way to safely implement - // difftime() on WinCE, but for now, this will have to do. It flags - // every file as having changed since cached. - result = 1; -#else result = ACE_OS::difftime (this->stat_.st_mtime, statbuf.st_mtime) < 0; -#endif /* ACE_HAS_WINCE */ return result; } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Filecache.h b/externals/ace/Filecache.h similarity index 100% rename from dep/include/ace/Filecache.h rename to externals/ace/Filecache.h index 126082adc12..60b8a90f620 100644 --- a/dep/include/ace/Filecache.h +++ b/externals/ace/Filecache.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_FILECACHE_H #define ACE_FILECACHE_H @@ -350,4 +351,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FILECACHE_H */ - diff --git a/dep/src/ace/Flag_Manip.cpp b/externals/ace/Flag_Manip.cpp similarity index 99% rename from dep/src/ace/Flag_Manip.cpp rename to externals/ace/Flag_Manip.cpp index 252ea6240da..f9ac4083fa0 100644 --- a/dep/src/ace/Flag_Manip.cpp +++ b/externals/ace/Flag_Manip.cpp @@ -93,4 +93,3 @@ ACE::clr_flags (ACE_HANDLE handle, int flags) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Flag_Manip.h b/externals/ace/Flag_Manip.h similarity index 99% rename from dep/include/ace/Flag_Manip.h rename to externals/ace/Flag_Manip.h index 6bd797e5606..0457dcb4d95 100644 --- a/dep/include/ace/Flag_Manip.h +++ b/externals/ace/Flag_Manip.h @@ -56,4 +56,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FLAG_MANIP_H */ - diff --git a/dep/include/ace/Flag_Manip.inl b/externals/ace/Flag_Manip.inl similarity index 100% rename from dep/include/ace/Flag_Manip.inl rename to externals/ace/Flag_Manip.inl diff --git a/dep/src/ace/Framework_Component.cpp b/externals/ace/Framework_Component.cpp similarity index 98% rename from dep/src/ace/Framework_Component.cpp rename to externals/ace/Framework_Component.cpp index 446df96fa31..7b63ad5eeeb 100644 --- a/dep/src/ace/Framework_Component.cpp +++ b/externals/ace/Framework_Component.cpp @@ -1,5 +1,5 @@ // Framework_Component.cpp -// $Id: Framework_Component.cpp 82238 2008-07-02 12:05:46Z sma $ +// $Id: Framework_Component.cpp 84128 2009-01-09 15:07:40Z johnnyw $ #include "ace/Framework_Component.h" @@ -13,7 +13,7 @@ #include "ace/Recursive_Thread_Mutex.h" #include "ace/OS_NS_string.h" -ACE_RCSID(ace, Framework_Component, "$Id: Framework_Component.cpp 82238 2008-07-02 12:05:46Z sma $") +ACE_RCSID(ace, Framework_Component, "$Id: Framework_Component.cpp 84128 2009-01-09 15:07:40Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -144,7 +144,7 @@ ACE_Framework_Repository::register_component (ACE_Framework_Component *fc) if (i < this->total_size_) { this->component_vector_[i] = fc; - this->current_size_++; + ++this->current_size_; return 0; } @@ -277,4 +277,3 @@ ACE_Framework_Repository::ACE_Framework_Repository (int size) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Framework_Component.h b/externals/ace/Framework_Component.h similarity index 99% rename from dep/include/ace/Framework_Component.h rename to externals/ace/Framework_Component.h index fecd8ccf3bb..941960bf047 100644 --- a/dep/include/ace/Framework_Component.h +++ b/externals/ace/Framework_Component.h @@ -208,4 +208,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FRAMEWORK_COMPONENT_H */ - diff --git a/dep/include/ace/Framework_Component.inl b/externals/ace/Framework_Component.inl similarity index 100% rename from dep/include/ace/Framework_Component.inl rename to externals/ace/Framework_Component.inl diff --git a/dep/src/ace/Framework_Component_T.cpp b/externals/ace/Framework_Component_T.cpp similarity index 99% rename from dep/src/ace/Framework_Component_T.cpp rename to externals/ace/Framework_Component_T.cpp index b4e8130086c..6f0be7b5e2a 100644 --- a/dep/src/ace/Framework_Component_T.cpp +++ b/externals/ace/Framework_Component_T.cpp @@ -31,4 +31,3 @@ ACE_Framework_Component_T::close_singleton (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_FRAMEWORK_COMPONENT_T_CPP */ - diff --git a/dep/include/ace/Framework_Component_T.h b/externals/ace/Framework_Component_T.h similarity index 99% rename from dep/include/ace/Framework_Component_T.h rename to externals/ace/Framework_Component_T.h index f8d365a86c0..2dcef43e384 100644 --- a/dep/include/ace/Framework_Component_T.h +++ b/externals/ace/Framework_Component_T.h @@ -69,4 +69,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FRAMEWORK_COMPONENT_T_H */ - diff --git a/dep/src/ace/Free_List.cpp b/externals/ace/Free_List.cpp similarity index 99% rename from dep/src/ace/Free_List.cpp rename to externals/ace/Free_List.cpp index 924665572de..4da723f4898 100644 --- a/dep/src/ace/Free_List.cpp +++ b/externals/ace/Free_List.cpp @@ -161,4 +161,3 @@ ACE_Locked_Free_List::dealloc (size_t n) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_FREE_LIST_CPP */ - diff --git a/dep/include/ace/Free_List.h b/externals/ace/Free_List.h similarity index 95% rename from dep/include/ace/Free_List.h rename to externals/ace/Free_List.h index ba1f0e4dded..7f2ce593c7a 100644 --- a/dep/include/ace/Free_List.h +++ b/externals/ace/Free_List.h @@ -4,7 +4,7 @@ /** * @file Free_List.h * - * $Id: Free_List.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Free_List.h 84619 2009-02-26 12:26:16Z johnnyw $ * * @author Darrell Brunsch (brunsch@cs.wustl.edu) */ @@ -73,8 +73,8 @@ public: /** * Constructor takes a @a mode (i.e., ACE_FREE_LIST_WITH_POOL or * ACE_PURE_FREE_LIST), a count of the number of nodes to - * , a low and high water mark ( and ) that - * indicate when to allocate more nodes, an increment value () + * @a prealloc, a low and high water mark (@a lwm and @a hwm) that + * indicate when to allocate more nodes, an increment value (@a inc) * that indicates how many nodes to allocate when the list must * grow. */ @@ -148,4 +148,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FREE_LIST_H */ - diff --git a/dep/src/ace/Functor.cpp b/externals/ace/Functor.cpp similarity index 100% rename from dep/src/ace/Functor.cpp rename to externals/ace/Functor.cpp index 29db0244aac..429aaac9f22 100644 --- a/dep/src/ace/Functor.cpp +++ b/externals/ace/Functor.cpp @@ -24,6 +24,7 @@ */ //============================================================================= + #include "ace/Functor_T.h" #include "ace/Functor.h" @@ -40,4 +41,3 @@ ACE_Command_Base::~ACE_Command_Base (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Functor.h b/externals/ace/Functor.h similarity index 90% rename from dep/include/ace/Functor.h rename to externals/ace/Functor.h index bff4cf375b1..ec1d285061f 100644 --- a/dep/include/ace/Functor.h +++ b/externals/ace/Functor.h @@ -4,7 +4,7 @@ /** * @file Functor.h * - * $Id: Functor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Functor.h 86698 2009-09-13 15:58:17Z johnnyw $ * * Non-templatized classes and class template specializations for * implementing function objects that are used in various places @@ -27,6 +27,7 @@ */ //========================================================================== + #ifndef ACE_FUNCTOR_H #define ACE_FUNCTOR_H #include /**/ "ace/pre.h" @@ -88,8 +89,6 @@ template class ACE_Equal_To; template class ACE_Less_Than; /** - * @class ACE_Hash - * * @brief Function object for hashing a char */ template<> @@ -101,8 +100,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a signed char */ template<> @@ -114,8 +111,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing an unsigned char */ template<> @@ -130,8 +125,6 @@ public: // @@ ADD HASHES FOR ACE TYPES /** - * @class ACE_Hash - * * @brief Function object for hashing a 16-bit signed number */ template<> @@ -143,8 +136,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a 16-bit unsigned number */ template<> @@ -156,8 +147,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a 32-bit signed number */ template<> @@ -169,8 +158,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a 32-bit unsigned number */ template<> @@ -182,8 +169,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a 64-bit unsigned number */ template<> @@ -198,8 +183,6 @@ public: #endif /** - * @class ACE_Hash - * * @brief Function object for hashing a short number */ template<> @@ -211,8 +194,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing an unsigned short number */ template<> @@ -224,8 +205,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing an int number */ template<> @@ -237,8 +216,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing an unsigned int number */ template<> @@ -250,8 +227,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a long number */ template<> @@ -263,8 +238,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing an unsigned long number */ template<> @@ -277,8 +250,6 @@ public: #if !defined (ACE_LACKS_LONGLONG_T) && (ACE_SIZEOF_LONG < 8) /** - * @class ACE_Hash - * * @brief Function object for hashing a signed 64-bit number */ template<> @@ -294,8 +265,6 @@ public: // emulation for it in ACE_U_LongLong. #if (ACE_SIZEOF_LONG < 8) /** - * @class ACE_Hash - * * @brief Function object for hashing an unsigned 64-bit number */ template<> @@ -308,8 +277,6 @@ public: #endif /* ACE_SIZEOF_LONG < 8 */ /** - * @class ACE_Hash - * * @brief Function object for hashing a const string */ template<> @@ -321,8 +288,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a string */ template<> @@ -334,8 +299,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a void * */ template<> @@ -346,8 +309,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two const strings are equal. */ template<> @@ -360,8 +321,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two non-const * strings are equal. */ @@ -375,8 +334,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two unsigned * 16 bit ints are equal. */ @@ -390,8 +347,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two * 16 bit ints are equal. */ @@ -405,8 +360,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two unsigned * 32 bit ints are equal. */ @@ -420,8 +373,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two * 32 bit ints are equal. */ @@ -435,8 +386,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two unsigned * 64 bit ints are equal. */ @@ -450,8 +399,6 @@ public: }; /** - * @class ACE_Less_Than - * * @brief Function object for determining whether the first const string * is less than the second const string. */ @@ -465,8 +412,6 @@ public: }; /** - * @class ACE_Less_Than - * * @brief Function object for determining whether the first string * is less than the second string. */ @@ -483,8 +428,6 @@ public: # if ! defined (ACE_LACKS_NATIVE_WCHAR_T) /** - * @class ACE_Hash - * * @brief Function object for hashing a wchar_t */ template<> @@ -496,8 +439,6 @@ public: }; # endif /* ACE_LACKS_NATIVE_WCHAR_T */ /** - * @class ACE_Hash - * * @brief Function object for hashing a const string */ template<> @@ -509,8 +450,6 @@ public: }; /** - * @class ACE_Hash - * * @brief Function object for hashing a string */ template<> @@ -522,8 +461,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two const strings are equal. */ template<> @@ -536,8 +473,6 @@ public: }; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two non-const * strings are equal. */ @@ -551,8 +486,6 @@ public: }; /** - * @class ACE_Less_Than - * * @brief Function object for determining whether the first const string * is less than the second const string. */ @@ -566,8 +499,6 @@ public: }; /** - * @class ACE_Less_Than - * * @brief Function object for determining whether the first string * is less than the second string. */ @@ -590,4 +521,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FUNCTOR_H */ - diff --git a/dep/include/ace/Functor.inl b/externals/ace/Functor.inl similarity index 99% rename from dep/include/ace/Functor.inl rename to externals/ace/Functor.inl index c8477c2b8eb..30e539459a8 100644 --- a/dep/include/ace/Functor.inl +++ b/externals/ace/Functor.inl @@ -24,6 +24,7 @@ */ //============================================================================= + #include "ace/ACE.h" #include "ace/OS_NS_string.h" @@ -237,6 +238,7 @@ ACE_Less_Than::operator () (const char *lhs, const char *rhs) const return (ACE_OS::strcmp (lhs, rhs) < 0) ? 1 : 0; } + #if defined (ACE_HAS_WCHAR) ACE_INLINE unsigned long diff --git a/dep/src/ace/Functor_String.cpp b/externals/ace/Functor_String.cpp similarity index 99% rename from dep/src/ace/Functor_String.cpp rename to externals/ace/Functor_String.cpp index 798c9d26286..c113f5cdf6f 100644 --- a/dep/src/ace/Functor_String.cpp +++ b/externals/ace/Functor_String.cpp @@ -5,4 +5,3 @@ #endif /* __ACE_INLINE__ */ ACE_RCSID(ace, Functor, "$Id: Functor_String.cpp 80826 2008-03-04 14:51:23Z wotte $") - diff --git a/dep/include/ace/Functor_String.h b/externals/ace/Functor_String.h similarity index 88% rename from dep/include/ace/Functor_String.h rename to externals/ace/Functor_String.h index 6167bd5b5b2..2adf561a65f 100644 --- a/dep/include/ace/Functor_String.h +++ b/externals/ace/Functor_String.h @@ -4,7 +4,7 @@ /** * @file Functor_String.h * - * $Id: Functor_String.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Functor_String.h 86698 2009-09-13 15:58:17Z johnnyw $ * * Class template specializations for ACE_*String types implementing * function objects that are used in various places in ATC. They @@ -40,8 +40,6 @@ template class ACE_Equal_To; template class ACE_Less_Than; /** - * @class ACE_Equal_To - * * @brief Function object for determining whether two ACE_CStrings are * equal. */ @@ -53,9 +51,8 @@ public: const ACE_CString &rhs) const; }; + /** - * @class ACE_Hash - * * @brief Function object for hashing a ACE_CString */ template<> @@ -66,9 +63,8 @@ public: unsigned long operator () (const ACE_CString &lhs) const; }; + /** - * @class ACE_Less_Than - * * @brief Function object for determining whether the first const string * is less than the second const string. */ @@ -81,12 +77,11 @@ public: const ACE_CString &rhs) const; }; + #if defined (ACE_USES_WCHAR) /** - * @class ACE_Equal_To - * - * @brief Function object for determining whether two ACE_CStrings are + * @brief Function object for determining whether two ACE_WStrings are * equal. */ template<> @@ -97,9 +92,8 @@ public: const ACE_WString &rhs) const; }; + /** - * @class ACE_Hash - * * @brief Function object for hashing a ACE_WString */ template<> @@ -111,10 +105,8 @@ public: }; /** - * @class ACE_Less_Than - * - * @brief Function object for determining whether the first const string - * is less than the second const string. + * @brief Function object for determining whether the first const wstring + * is less than the second const wstring. */ template<> class ACE_Export ACE_Less_Than @@ -135,4 +127,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_FUNCTOR_STRING_H*/ - diff --git a/dep/include/ace/Functor_String.inl b/externals/ace/Functor_String.inl similarity index 99% rename from dep/include/ace/Functor_String.inl rename to externals/ace/Functor_String.inl index f4155044fce..bdac96386f8 100644 --- a/dep/include/ace/Functor_String.inl +++ b/externals/ace/Functor_String.inl @@ -13,6 +13,7 @@ ACE_Hash::operator () (const ACE_CString &t) const return t.hash (); } + ACE_INLINE int ACE_Equal_To::operator () (const ACE_CString &lhs, const ACE_CString &rhs) const @@ -27,6 +28,7 @@ ACE_Less_Than::operator () (const ACE_CString &lhs, return (lhs < rhs); } + #if defined (ACE_USES_WCHAR) ACE_INLINE unsigned long ACE_Hash::operator () (const ACE_WString &t) const @@ -34,6 +36,7 @@ ACE_Hash::operator () (const ACE_WString &t) const return t.hash (); } + ACE_INLINE int ACE_Equal_To::operator () (const ACE_WString &lhs, const ACE_WString &rhs) const diff --git a/dep/src/ace/Functor_T.cpp b/externals/ace/Functor_T.cpp similarity index 99% rename from dep/src/ace/Functor_T.cpp rename to externals/ace/Functor_T.cpp index b3018ade8b7..213b501aac1 100644 --- a/dep/src/ace/Functor_T.cpp +++ b/externals/ace/Functor_T.cpp @@ -47,4 +47,3 @@ ACE_Command_Callback::execute (void *arg) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_FUNCTOR_T_CPP */ - diff --git a/dep/include/ace/Functor_T.h b/externals/ace/Functor_T.h similarity index 99% rename from dep/include/ace/Functor_T.h rename to externals/ace/Functor_T.h index 13387119f53..f055c3c885e 100644 --- a/dep/include/ace/Functor_T.h +++ b/externals/ace/Functor_T.h @@ -25,6 +25,7 @@ */ //============================================================================= + #ifndef ACE_FUNCTOR_T_H #define ACE_FUNCTOR_T_H #include /**/ "ace/pre.h" @@ -144,6 +145,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include "ace/Functor_T.inl" #endif /* __ACE_INLINE__ */ + #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) #include "ace/Functor_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ @@ -154,4 +156,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FUNCTOR_T_H */ - diff --git a/dep/include/ace/Functor_T.inl b/externals/ace/Functor_T.inl similarity index 100% rename from dep/include/ace/Functor_T.inl rename to externals/ace/Functor_T.inl diff --git a/dep/src/ace/Future.cpp b/externals/ace/Future.cpp similarity index 96% rename from dep/src/ace/Future.cpp rename to externals/ace/Future.cpp index af1321c4bd8..da40c468f31 100644 --- a/dep/src/ace/Future.cpp +++ b/externals/ace/Future.cpp @@ -1,4 +1,4 @@ - // $Id: Future.cpp 80826 2008-03-04 14:51:23Z wotte $ + // $Id: Future.cpp 85358 2009-05-17 10:34:33Z johnnyw $ #ifndef ACE_FUTURE_CPP #define ACE_FUTURE_CPP @@ -9,7 +9,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -ACE_RCSID (ace, Future, "$Id: Future.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID (ace, Future, "$Id: Future.cpp 85358 2009-05-17 10:34:33Z johnnyw $") #if defined (ACE_HAS_THREADS) @@ -54,7 +54,7 @@ ACE_Future_Rep::dump (void) const ACE_DEBUG ((LM_DEBUG, "ref_count_ = %d\n", (int) this->ref_count_)); - ACE_DEBUG ((LM_INFO,"value_: \n")); + ACE_DEBUG ((LM_INFO,"value_:\n")); if (this->value_) ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (NON-NULL)\n"))); else @@ -62,9 +62,9 @@ ACE_Future_Rep::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (NULL)\n"))); //FUZZ: enable check_for_NULL - ACE_DEBUG ((LM_INFO,"value_ready_: \n")); + ACE_DEBUG ((LM_INFO,"value_ready_:\n")); this->value_ready_.dump (); - ACE_DEBUG ((LM_INFO,"value_ready_mutex_: \n")); + ACE_DEBUG ((LM_INFO,"value_ready_mutex_:\n")); this->value_ready_mutex_.dump (); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ @@ -328,8 +328,7 @@ template int ACE_Future::cancel (const T &r) { this->cancel (); - return this->future_rep_->set (r, - *this); + return this->future_rep_->set (r, *this); } template int @@ -346,8 +345,7 @@ template int ACE_Future::set (const T &r) { // Give the pointer to the result to the ACE_Future_Rep. - return this->future_rep_->set (r, - *this); + return this->future_rep_->set (r, *this); } template int @@ -434,4 +432,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ #endif /* ACE_FUTURE_CPP */ - diff --git a/dep/include/ace/Future.h b/externals/ace/Future.h similarity index 99% rename from dep/include/ace/Future.h rename to externals/ace/Future.h index d86efd5a485..e30159eaf96 100644 --- a/dep/include/ace/Future.h +++ b/externals/ace/Future.h @@ -385,4 +385,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_FUTURE_H */ - diff --git a/dep/src/ace/Future_Set.cpp b/externals/ace/Future_Set.cpp similarity index 97% rename from dep/src/ace/Future_Set.cpp rename to externals/ace/Future_Set.cpp index 7c1ae7d9341..a40b0700dc5 100644 --- a/dep/src/ace/Future_Set.cpp +++ b/externals/ace/Future_Set.cpp @@ -1,4 +1,4 @@ -// $Id: Future_Set.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Future_Set.cpp 88128 2009-12-14 02:17:22Z schmidt $ #ifndef ACE_FUTURE_SET_CPP #define ACE_FUTURE_SET_CPP @@ -71,7 +71,7 @@ ACE_Future_Set::insert (ACE_Future &future) // If a new map entry was created, then attach to the future, // otherwise we were already attached to the future or some error // occurred so just delete the future holder. - if ( result == 0 ) + if (result == 0) // Attach ourself to the ACE_Futures list of observer future.attach (this); else @@ -134,4 +134,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ #endif /* ACE_FUTURE_SET_CPP */ - diff --git a/dep/include/ace/Future_Set.h b/externals/ace/Future_Set.h similarity index 93% rename from dep/include/ace/Future_Set.h rename to externals/ace/Future_Set.h index b41fc673986..3d07f4f73e2 100644 --- a/dep/include/ace/Future_Set.h +++ b/externals/ace/Future_Set.h @@ -4,7 +4,7 @@ /** * @file Future_Set.h * - * $Id: Future_Set.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Future_Set.h 88128 2009-12-14 02:17:22Z schmidt $ * * @author John Tucker */ @@ -31,14 +31,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** * @class ACE_Future_Set * - * @brief This class implements a mechanism which allows the values of + * @brief This class implements a mechanism that allows the values of * a collection of ACE_Future objects to be accessed by reader threads * as they become available. The caller(s) provide the ACE_Future_Set * (i.e. the observer...) with the collection of ACE_Future objects - * (i.e. the subjects...) that are to be observed using the - * the ACE_Future_Set::insert() method. The caller(s) may then iterate - * over the collection in the order in which they become readable using - * the ACE_Future_Set::next_readable() method. + * (i.e. the subjects...) that are to be observed using the the + * ACE_Future_Set::insert() method. The caller(s) may then iterate + * over the collection in the order in which they become readable + * using the ACE_Future_Set::next_readable() method. */ template class ACE_Future_Set : public ACE_Future_Observer @@ -144,4 +144,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ #include /**/ "ace/post.h" #endif /* ACE_FUTURE_SET_H */ - diff --git a/dep/src/ace/Get_Opt.cpp b/externals/ace/Get_Opt.cpp similarity index 99% rename from dep/src/ace/Get_Opt.cpp rename to externals/ace/Get_Opt.cpp index 9725171701d..915ff8a87a9 100644 --- a/dep/src/ace/Get_Opt.cpp +++ b/externals/ace/Get_Opt.cpp @@ -732,4 +732,3 @@ ACE_Get_Opt::ACE_Get_Opt_Long_Option::~ACE_Get_Opt_Long_Option (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Get_Opt.h b/externals/ace/Get_Opt.h similarity index 99% rename from dep/include/ace/Get_Opt.h rename to externals/ace/Get_Opt.h index e00518954e6..1c30096ea6d 100644 --- a/dep/include/ace/Get_Opt.h +++ b/externals/ace/Get_Opt.h @@ -4,7 +4,7 @@ /** * @file Get_Opt.h * - * $Id: Get_Opt.h 81840 2008-06-05 13:46:45Z sma $ + * $Id: Get_Opt.h 86367 2009-08-05 09:41:11Z johnnyw $ * * @author Douglas C. Schmidt * @author Don Hinton (added long option support) @@ -182,14 +182,14 @@ public: private: void ACE_Get_Opt_Init (const ACE_TCHAR *optstring); public: - ACE_INLINE ACE_Get_Opt (int argc, + ACE_Get_Opt (int argc, ACE_TCHAR **argv, const ACE_TCHAR *optstring = ACE_TEXT (""), int skip_args = 1, int report_errors = 0, int ordering = PERMUTE_ARGS, int long_only = 0); - ACE_INLINE ACE_Get_Opt (int argc, + ACE_Get_Opt (int argc, ACE_TCHAR **argv, const char *optstring, int skip_args = 1, @@ -492,4 +492,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_GET_OPT_H */ - diff --git a/dep/include/ace/Get_Opt.inl b/externals/ace/Get_Opt.inl similarity index 100% rename from dep/include/ace/Get_Opt.inl rename to externals/ace/Get_Opt.inl diff --git a/dep/include/ace/Global_Macros.h b/externals/ace/Global_Macros.h similarity index 99% rename from dep/include/ace/Global_Macros.h rename to externals/ace/Global_Macros.h index 4d8bb016842..d1bf6420b05 100644 --- a/dep/include/ace/Global_Macros.h +++ b/externals/ace/Global_Macros.h @@ -462,6 +462,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL while (0) # endif /* defined ! ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR */ + /*******************************************************************/ /// Service Objects, i.e., objects dynamically loaded via the service @@ -620,6 +621,7 @@ static ACE_Static_Svc_##SERVICE_CLASS ace_static_svc_##SERVICE_CLASS; #define ACE_MAKE_SVC_CONFIG_FACTORY_NAME(VERSIONED_NAMESPACE,SERVICE_CLASS) ACE_MAKE_SVC_CONFIG_FUNCTION_NAME(_make,VERSIONED_NAMESPACE,SERVICE_CLASS) #define ACE_MAKE_SVC_CONFIG_GOBBLER_NAME(VERSIONED_NAMESPACE,SERVICE_CLASS) ACE_MAKE_SVC_CONFIG_FUNCTION_NAME(_gobble,VERSIONED_NAMESPACE,SERVICE_CLASS) + /// Declare the factory method used to create dynamically loadable /// services. /** @@ -836,6 +838,7 @@ ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (AC # endif /* !defined PIPE_TYPE_MESSAGE */ #endif /* ACE_WIN32 */ + // Some useful abstrations for expressions involving // ACE_Allocator.malloc (). The difference between ACE_NEW_MALLOC* // with ACE_ALLOCATOR* is that they call constructors also. @@ -1116,4 +1119,3 @@ ACE_MAKE_SVC_CONFIG_FACTORY_NAME(ACE_VERSIONED_NAMESPACE_NAME,SERVICE_CLASS) (AC #include /**/ "ace/post.h" #endif /*ACE_GLOBAL_MACROS_H*/ - diff --git a/dep/src/ace/Guard_T.cpp b/externals/ace/Guard_T.cpp similarity index 92% rename from dep/src/ace/Guard_T.cpp rename to externals/ace/Guard_T.cpp index d35e27c4d99..2090ddda2b7 100644 --- a/dep/src/ace/Guard_T.cpp +++ b/externals/ace/Guard_T.cpp @@ -1,4 +1,4 @@ -// $Id: Guard_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Guard_T.cpp 85141 2009-04-22 08:48:30Z johnnyw $ #ifndef ACE_GUARD_T_CPP #define ACE_GUARD_T_CPP @@ -32,7 +32,7 @@ ACE_Guard::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("mutex_ = %x\n"), this->lock_)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("owner_ = %d\n"), this->owner_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP, this)); #endif /* ACE_HAS_DUMP */ } @@ -59,4 +59,3 @@ ACE_Read_Guard::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_GUARD_T_CPP */ - diff --git a/dep/include/ace/Guard_T.h b/externals/ace/Guard_T.h similarity index 96% rename from dep/include/ace/Guard_T.h rename to externals/ace/Guard_T.h index a70bdda713a..aee5c266c63 100644 --- a/dep/include/ace/Guard_T.h +++ b/externals/ace/Guard_T.h @@ -4,7 +4,7 @@ /** * @file Guard_T.h * - * $Id: Guard_T.h 82508 2008-08-05 13:52:48Z johnnyw $ + * $Id: Guard_T.h 83306 2008-10-17 12:19:53Z johnnyw $ * * Moved from Synch.h. * @@ -32,7 +32,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * * @brief This data structure is meant to be used within a method or * function... It performs automatic aquisition and release of - * a parameterized synchronization object . + * a parameterized synchronization object ACE_LOCK. * * The class given as an actual parameter must provide at * the very least the , , , and @@ -52,8 +52,8 @@ public: ACE_Guard (ACE_LOCK &l, bool block); /// Initialise the guard without implicitly acquiring the lock. The - /// parameter indicates whether the guard should release - /// the lock implicitly on destruction. The parameter is + /// @a become_owner parameter indicates whether the guard should release + /// the lock implicitly on destruction. The @a block parameter is /// ignored and is used here to disambiguate with the preceding /// constructor. ACE_Guard (ACE_LOCK &l, bool block, int become_owner); @@ -77,9 +77,9 @@ public: void disown (void); // = Utility methods. - /// 1 if locked, 0 if couldn't acquire the lock + /// true if locked, false if couldn't acquire the lock /// (errno will contain the reason for this). - int locked (void) const; + bool locked (void) const; /// Explicitly remove the lock. int remove (void); @@ -363,4 +363,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_GUARD_T_H */ - diff --git a/dep/include/ace/Guard_T.inl b/externals/ace/Guard_T.inl similarity index 97% rename from dep/include/ace/Guard_T.inl rename to externals/ace/Guard_T.inl index 5fb22b3bac7..3e7d5b61f8d 100644 --- a/dep/include/ace/Guard_T.inl +++ b/externals/ace/Guard_T.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Guard_T.inl 82508 2008-08-05 13:52:48Z johnnyw $ +// $Id: Guard_T.inl 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/RW_Thread_Mutex.h" @@ -65,7 +65,7 @@ ACE_Guard::~ACE_Guard (void) this->release (); } -template ACE_INLINE int +template ACE_INLINE bool ACE_Guard::locked (void) const { return this->owner_ != -1; diff --git a/dep/include/ace/Handle_Gobbler.h b/externals/ace/Handle_Gobbler.h similarity index 100% rename from dep/include/ace/Handle_Gobbler.h rename to externals/ace/Handle_Gobbler.h index ed7107a6302..9d6890a03fc 100644 --- a/dep/include/ace/Handle_Gobbler.h +++ b/externals/ace/Handle_Gobbler.h @@ -11,6 +11,7 @@ */ //============================================================================= + #ifndef ACE_HANDLE_GOBBLER_H #define ACE_HANDLE_GOBBLER_H #include /**/ "ace/pre.h" @@ -65,4 +66,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_HANDLE_GOBBLER_H */ - diff --git a/dep/include/ace/Handle_Gobbler.inl b/externals/ace/Handle_Gobbler.inl similarity index 93% rename from dep/include/ace/Handle_Gobbler.inl rename to externals/ace/Handle_Gobbler.inl index 4b81218e6de..cca9e4bd7be 100644 --- a/dep/include/ace/Handle_Gobbler.inl +++ b/externals/ace/Handle_Gobbler.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Handle_Gobbler.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Handle_Gobbler.inl 85911 2009-07-07 05:45:14Z olli $ // Since this is only included in Handle_Gobbler.h, these should be // inline, not ACE_INLINE. @@ -65,7 +65,7 @@ ACE_Handle_Gobbler::consume_handles (size_t n_handles_to_keep_available) break; } } - if (handle >= FD_SETSIZE) + if (handle >= static_cast(FD_SETSIZE)) break; this->handle_set_.set_bit (handle); } diff --git a/dep/src/ace/Handle_Ops.cpp b/externals/ace/Handle_Ops.cpp similarity index 100% rename from dep/src/ace/Handle_Ops.cpp rename to externals/ace/Handle_Ops.cpp index ed19109b445..0ec856cf1c9 100644 --- a/dep/src/ace/Handle_Ops.cpp +++ b/externals/ace/Handle_Ops.cpp @@ -10,6 +10,7 @@ ACE_RCSID (ace, Handle_Ops, "$Id: Handle_Ops.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_HANDLE @@ -45,4 +46,3 @@ ACE::handle_timed_open (ACE_Time_Value *timeout, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Handle_Ops.h b/externals/ace/Handle_Ops.h similarity index 99% rename from dep/include/ace/Handle_Ops.h rename to externals/ace/Handle_Ops.h index 16ee852725d..c615380f8dd 100644 --- a/dep/include/ace/Handle_Ops.h +++ b/externals/ace/Handle_Ops.h @@ -48,4 +48,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_HANDLE_OPS_H */ - diff --git a/dep/src/ace/Handle_Set.cpp b/externals/ace/Handle_Set.cpp similarity index 98% rename from dep/src/ace/Handle_Set.cpp rename to externals/ace/Handle_Set.cpp index cb460dcb798..168acca86cd 100644 --- a/dep/src/ace/Handle_Set.cpp +++ b/externals/ace/Handle_Set.cpp @@ -1,5 +1,5 @@ // Handle_Set.cpp -// $Id: Handle_Set.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Handle_Set.cpp 83306 2008-10-17 12:19:53Z johnnyw $ #include "ace/Handle_Set.h" @@ -9,7 +9,7 @@ #include "ace/OS_NS_string.h" -ACE_RCSID(ace, Handle_Set, "$Id: Handle_Set.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Handle_Set, "$Id: Handle_Set.cpp 83306 2008-10-17 12:19:53Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -24,11 +24,6 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Handle_Set) # define ACE_MSB_MASK (~((fd_mask) 1 << (NFDBITS - 1))) #endif /* ! ACE_WIN32 */ -#if defined (__BORLANDC__) && !defined (ACE_WIN32) -// The Borland C++ compiler on Linux also doesn't have fds_bits, but has __fds_bits. -#define fds_bits __fds_bits -#endif - #if defined (linux) && __GLIBC__ > 1 && __GLIBC_MINOR__ >= 1 && !defined (_XOPEN_SOURCE) // XPG4.2 requires the fds_bits member name, so it is not enabled by // default on Linux/glibc-2.1.x systems. Instead use "__fds_bits." @@ -499,6 +494,7 @@ ACE_Handle_Set_Iterator::ACE_Handle_Set_Iterator (const ACE_Handle_Set &hs) #endif /* !ACE_WIN32 && !ACE_HAS_BIG_FD_SET */ } + void ACE_Handle_Set_Iterator::reset_state (void) { @@ -567,4 +563,3 @@ ACE_Handle_Set_Iterator::reset_state (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Handle_Set.h b/externals/ace/Handle_Set.h similarity index 98% rename from dep/include/ace/Handle_Set.h rename to externals/ace/Handle_Set.h index 6e33055b4f6..11188f9fc38 100644 --- a/dep/include/ace/Handle_Set.h +++ b/externals/ace/Handle_Set.h @@ -4,7 +4,7 @@ /** * @file Handle_Set.h * - * $Id: Handle_Set.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Handle_Set.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -23,10 +23,6 @@ #include "ace/os_include/sys/os_select.h" #include "ace/os_include/os_limits.h" -#if defined (__QNX__) - typedef long fd_mask; -#endif /* __QNX__ */ - // Default size of the ACE Reactor. #if defined (FD_SETSIZE) int const ACE_FD_SETSIZE = FD_SETSIZE; @@ -238,4 +234,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_HANDLE_SET */ - diff --git a/dep/include/ace/Handle_Set.inl b/externals/ace/Handle_Set.inl similarity index 100% rename from dep/include/ace/Handle_Set.inl rename to externals/ace/Handle_Set.inl diff --git a/dep/src/ace/Hash_Cache_Map_Manager_T.cpp b/externals/ace/Hash_Cache_Map_Manager_T.cpp similarity index 99% rename from dep/src/ace/Hash_Cache_Map_Manager_T.cpp rename to externals/ace/Hash_Cache_Map_Manager_T.cpp index 6601bd4bdd7..2d9f163c5d3 100644 --- a/dep/src/ace/Hash_Cache_Map_Manager_T.cpp +++ b/externals/ace/Hash_Cache_Map_Manager_T.cpp @@ -230,4 +230,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #undef ACE_T2 #endif /* ACE_HASH_CACHE_MAP_MANAGER_T_CPP */ - diff --git a/dep/include/ace/Hash_Cache_Map_Manager_T.h b/externals/ace/Hash_Cache_Map_Manager_T.h similarity index 99% rename from dep/include/ace/Hash_Cache_Map_Manager_T.h rename to externals/ace/Hash_Cache_Map_Manager_T.h index 8fa9703d5b4..7d54e1fba93 100644 --- a/dep/include/ace/Hash_Cache_Map_Manager_T.h +++ b/externals/ace/Hash_Cache_Map_Manager_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef HASH_CACHE_MAP_MANAGER_T_H #define HASH_CACHE_MAP_MANAGER_T_H @@ -195,6 +196,7 @@ protected: ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/Hash_Cache_Map_Manager_T.inl" #endif /* __ACE_INLINE__ */ @@ -210,4 +212,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* HASH_CACHE_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Hash_Cache_Map_Manager_T.inl b/externals/ace/Hash_Cache_Map_Manager_T.inl similarity index 100% rename from dep/include/ace/Hash_Cache_Map_Manager_T.inl rename to externals/ace/Hash_Cache_Map_Manager_T.inl diff --git a/dep/include/ace/Hash_Map_Manager.h b/externals/ace/Hash_Map_Manager.h similarity index 99% rename from dep/include/ace/Hash_Map_Manager.h rename to externals/ace/Hash_Map_Manager.h index 0e253eb4cb9..d6c0c4b8ae3 100644 --- a/dep/include/ace/Hash_Map_Manager.h +++ b/externals/ace/Hash_Map_Manager.h @@ -29,4 +29,3 @@ #include /**/ "ace/post.h" #endif /* ACE_HASH_MAP_MANAGER_H */ - diff --git a/dep/src/ace/Hash_Map_Manager_T.cpp b/externals/ace/Hash_Map_Manager_T.cpp similarity index 97% rename from dep/src/ace/Hash_Map_Manager_T.cpp rename to externals/ace/Hash_Map_Manager_T.cpp index d628ebdcec0..457d7d9037e 100644 --- a/dep/src/ace/Hash_Map_Manager_T.cpp +++ b/externals/ace/Hash_Map_Manager_T.cpp @@ -3,7 +3,7 @@ /** * @file Hash_Map_Manager_T.cpp * - * $Id: Hash_Map_Manager_T.cpp 81735 2008-05-19 19:14:10Z johnnyw $ + * $Id: Hash_Map_Manager_T.cpp 84477 2009-02-16 13:30:38Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -58,12 +58,24 @@ ACE_Hash_Map_Entry::key () return ext_id_; } +template const EXT_ID & +ACE_Hash_Map_Entry::key () const +{ + return ext_id_; +} + template INT_ID & ACE_Hash_Map_Entry::item () { return int_id_; } +template const INT_ID & +ACE_Hash_Map_Entry::item () const +{ + return int_id_; +} + template void ACE_Hash_Map_Entry::dump (void) const { @@ -80,8 +92,8 @@ ACE_Hash_Map_Manager_Ex::dump { #if defined (ACE_HAS_DUMP) ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("total_size_ = %d"), this->total_size_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_)); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("total_size_ = %d\n"), this->total_size_)); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("cur_size_ = %d\n"), this->cur_size_)); this->table_allocator_->dump (); this->entry_allocator_->dump (); this->lock_.dump (); @@ -227,7 +239,7 @@ ACE_Hash_Map_Manager_Ex::bind_ &this->table_[loc]); this->table_[loc].next_ = entry; entry->next_->prev_ = entry; - this->cur_size_++; + ++this->cur_size_; return 0; } else @@ -254,7 +266,7 @@ ACE_Hash_Map_Manager_Ex::trybi &this->table_[loc]); this->table_[loc].next_ = entry; entry->next_->prev_ = entry; - this->cur_size_++; + ++this->cur_size_; return 0; } else @@ -528,4 +540,3 @@ ACE_Hash_Map_Const_Iterator_Base_Ex */ @@ -53,9 +53,15 @@ public: /// Key accessor. EXT_ID& key (void); + /// Read-only key accessor. + const EXT_ID& key (void) const; + /// Item accessor. INT_ID& item (void); + /// Read-only item accessor. + const INT_ID& item (void) const; + /// Key used to look up an entry. /// @deprecated Use key() EXT_ID ext_id_; @@ -553,9 +559,6 @@ protected: /// Accessor of the underlying table ACE_Hash_Map_Entry *table (void); - /// Accessor of the current size attribute - size_t cur_size (void) const; - private: /** * Array of ACE_Hash_Map_Entry *s, each of which points to an @@ -1301,4 +1304,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_HASH_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Hash_Map_Manager_T.inl b/externals/ace/Hash_Map_Manager_T.inl similarity index 99% rename from dep/include/ace/Hash_Map_Manager_T.inl rename to externals/ace/Hash_Map_Manager_T.inl index 3b9cea3d3b4..9525b13a670 100644 --- a/dep/include/ace/Hash_Map_Manager_T.inl +++ b/externals/ace/Hash_Map_Manager_T.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Hash_Map_Manager_T.inl 81082 2008-03-25 09:09:11Z johnnyw $ +// $Id: Hash_Map_Manager_T.inl 84477 2009-02-16 13:30:38Z johnnyw $ #include "ace/Guard_T.h" @@ -436,13 +436,6 @@ ACE_Hash_Map_Manager_Ex::table return this->table_; } -template ACE_INLINE -size_t -ACE_Hash_Map_Manager_Ex::cur_size (void) const -{ - return this->cur_size_; -} - template ::ACE_Hash_Map_With_Allocator (size_t ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HASH_MAP_WITH_ALLOCATOR_T_CPP */ - diff --git a/dep/include/ace/Hash_Map_With_Allocator_T.h b/externals/ace/Hash_Map_With_Allocator_T.h similarity index 99% rename from dep/include/ace/Hash_Map_With_Allocator_T.h rename to externals/ace/Hash_Map_With_Allocator_T.h index 2bc68aede25..8ac9a41ef28 100644 --- a/dep/include/ace/Hash_Map_With_Allocator_T.h +++ b/externals/ace/Hash_Map_With_Allocator_T.h @@ -42,7 +42,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * is meaningful! That is why we need this wrapper, which * insures that appropriate allocator pointer is in place for * each call. - * + * * At some point it would be a good idea to update this class to * use the new "two allocator" technique provided by @c * ACE_Hash_Map_Manager_Ex. @@ -107,6 +107,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL #pragma implementation ("Hash_Map_With_Allocator_T.cpp") #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + #include /**/ "ace/post.h" #endif /* ACE_HASH_MAP_WITH_ALLOCATOR_T_H */ - diff --git a/dep/include/ace/Hash_Map_With_Allocator_T.inl b/externals/ace/Hash_Map_With_Allocator_T.inl similarity index 100% rename from dep/include/ace/Hash_Map_With_Allocator_T.inl rename to externals/ace/Hash_Map_With_Allocator_T.inl diff --git a/dep/src/ace/Hash_Multi_Map_Manager_T.cpp b/externals/ace/Hash_Multi_Map_Manager_T.cpp similarity index 99% rename from dep/src/ace/Hash_Multi_Map_Manager_T.cpp rename to externals/ace/Hash_Multi_Map_Manager_T.cpp index 939bf967433..f4ea66fbb22 100644 --- a/dep/src/ace/Hash_Multi_Map_Manager_T.cpp +++ b/externals/ace/Hash_Multi_Map_Manager_T.cpp @@ -603,4 +603,3 @@ ACE_Hash_Multi_Map_Const_Iterator_Base) bytes each. ACE_Allocator *entry_allocator_; @@ -965,4 +965,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_HASH_MULTI_MAP_MANAGER_T_H */ - diff --git a/dep/include/ace/Hash_Multi_Map_Manager_T.inl b/externals/ace/Hash_Multi_Map_Manager_T.inl similarity index 100% rename from dep/include/ace/Hash_Multi_Map_Manager_T.inl rename to externals/ace/Hash_Multi_Map_Manager_T.inl diff --git a/dep/src/ace/Hashable.cpp b/externals/ace/Hashable.cpp similarity index 99% rename from dep/src/ace/Hashable.cpp rename to externals/ace/Hashable.cpp index 07723697b28..94c25faf1c8 100644 --- a/dep/src/ace/Hashable.cpp +++ b/externals/ace/Hashable.cpp @@ -6,10 +6,12 @@ #include "ace/Hashable.inl" #endif /* __ACE_INLINE __ */ + ACE_RCSID (ace, Hashable, "$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Hashable::~ACE_Hashable (void) @@ -32,4 +34,3 @@ ACE_Hashable::hash (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Hashable.h b/externals/ace/Hashable.h similarity index 99% rename from dep/include/ace/Hashable.h rename to externals/ace/Hashable.h index 88e272cd8b9..83f26ffee19 100644 --- a/dep/include/ace/Hashable.h +++ b/externals/ace/Hashable.h @@ -63,4 +63,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_HASHABLE_H*/ - diff --git a/dep/include/ace/Hashable.inl b/externals/ace/Hashable.inl similarity index 99% rename from dep/include/ace/Hashable.inl rename to externals/ace/Hashable.inl index c279e515f32..352b7794eb9 100644 --- a/dep/include/ace/Hashable.inl +++ b/externals/ace/Hashable.inl @@ -2,6 +2,7 @@ // // $Id: Hashable.inl 80826 2008-03-04 14:51:23Z wotte $ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE diff --git a/dep/src/ace/High_Res_Timer.cpp b/externals/ace/High_Res_Timer.cpp similarity index 94% rename from dep/src/ace/High_Res_Timer.cpp rename to externals/ace/High_Res_Timer.cpp index 03b9d643418..beaaadc48d1 100644 --- a/dep/src/ace/High_Res_Timer.cpp +++ b/externals/ace/High_Res_Timer.cpp @@ -1,4 +1,4 @@ -// $Id: High_Res_Timer.cpp 81030 2008-03-20 12:43:29Z johnnyw $ +// $Id: High_Res_Timer.cpp 89483 2010-03-15 09:48:01Z johnnyw $ // Be very carefull before changing the calculations inside // ACE_High_Res_Timer. The precision matters and we are using integer @@ -22,7 +22,7 @@ #include "ace/OS_NS_stdlib.h" #include "ace/Truncate.h" -ACE_RCSID(ace, High_Res_Timer, "$Id: High_Res_Timer.cpp 81030 2008-03-20 12:43:29Z johnnyw $") +ACE_RCSID(ace, High_Res_Timer, "$Id: High_Res_Timer.cpp 89483 2010-03-15 09:48:01Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -74,6 +74,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL /* static */ int ACE_High_Res_Timer::global_scale_factor_status_ = 0; + #if defined (linux) // Determine the apparent CPU clock speed from /proc/cpuinfo ACE_UINT32 @@ -151,9 +152,12 @@ ACE_High_Res_Timer::get_cpuinfo (void) { // If the line "cpu MHz : xxx" is present, then it's a // reliable measure of the CPU speed - according to the - // kernel-source. - scale_factor = (ACE_UINT32) (mhertz + 0.5); - break; + // kernel-source. It's possible to see a 0 value reported. + if (mhertz > 0.0) + { + scale_factor = (ACE_UINT32) (mhertz + 0.5); + break; + } } else if (::sscanf (buf, "bogomips : %lf\n", &bmips) == 1 || ::sscanf (buf, "BogoMIPS : %lf\n", &bmips) == 1) @@ -192,7 +196,7 @@ ACE_High_Res_Timer::global_scale_factor (void) #if (defined (ACE_WIN32) || defined (ACE_HAS_POWERPC_TIMER) || \ defined (ACE_HAS_PENTIUM) || defined (ACE_HAS_ALPHA_TIMER)) && \ !defined (ACE_HAS_HI_RES_TIMER) && \ - ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || \ + (defined (ACE_WIN32) || \ defined (ghs) || defined (__GNUG__) || \ defined (__INTEL_COMPILER)) // Check if the global scale factor needs to be set, and do if so. @@ -233,7 +237,7 @@ ACE_High_Res_Timer::global_scale_factor (void) # endif /* ! ACE_WIN32 && ! (linux && __alpha__) */ # if !defined (ACE_WIN32) - if (ACE_High_Res_Timer::global_scale_factor_ == 1u) + if (ACE_High_Res_Timer::global_scale_factor_ <= 1u) // Failed to retrieve CPU speed from system, so calculate it. ACE_High_Res_Timer::calibrate (); # endif // (ACE_WIN32) @@ -272,14 +276,11 @@ ACE_High_Res_Timer::calibrate (const ACE_UINT32 usec, i < iterations; ++i) { - const ACE_Time_Value actual_start = - ACE_OS::gettimeofday (); - const ACE_hrtime_t start = - ACE_OS::gethrtime (); + ACE_Time_Value const actual_start = ACE_OS::gettimeofday (); + ACE_hrtime_t const start = ACE_OS::gethrtime (); ACE_OS::sleep (sleep_time); - const ACE_hrtime_t stop = - ACE_OS::gethrtime (); - const ACE_Time_Value actual_delta = + ACE_hrtime_t const stop = ACE_OS::gethrtime (); + ACE_Time_Value const actual_delta = ACE_OS::gettimeofday () - actual_start; // Store the sample. @@ -421,7 +422,6 @@ ACE_High_Res_Timer::elapsed_time_incr (ACE_hrtime_t &nanoseconds) const nanoseconds = nanoseconds >> 10; } -#if !defined (ACE_HAS_WINCE) void ACE_High_Res_Timer::print_ave (const ACE_TCHAR *str, const int count, @@ -477,9 +477,9 @@ ACE_High_Res_Timer::print_total (const ACE_TCHAR *str, // Separate to seconds and nanoseconds. u_long total_secs = - (u_long) (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); + static_cast (total_nanoseconds / (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_UINT32 extra_nsecs = - (ACE_UINT32) (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); + static_cast (total_nanoseconds % (ACE_UINT32) ACE_ONE_SECOND_IN_NSECS); ACE_TCHAR buf[100]; if (count > 1) @@ -506,12 +506,10 @@ ACE_High_Res_Timer::print_total (const ACE_TCHAR *str, buf, ACE_OS::strlen (buf)); } -#endif /* !ACE_HAS_WINCE */ int ACE_High_Res_Timer::get_env_global_scale_factor (const ACE_TCHAR *env) { -#if !defined (ACE_HAS_WINCE) if (env != 0) { const char *env_value = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (env)); @@ -525,11 +523,8 @@ ACE_High_Res_Timer::get_env_global_scale_factor (const ACE_TCHAR *env) } } } -#else - ACE_UNUSED_ARG (env); -#endif /* !ACE_HAS_WINCE */ + return -1; } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/High_Res_Timer.h b/externals/ace/High_Res_Timer.h similarity index 97% rename from dep/include/ace/High_Res_Timer.h rename to externals/ace/High_Res_Timer.h index 83584c39b19..3716597e5cd 100644 --- a/dep/include/ace/High_Res_Timer.h +++ b/externals/ace/High_Res_Timer.h @@ -4,7 +4,7 @@ /** * @file High_Res_Timer.h * - * $Id: High_Res_Timer.h 81286 2008-04-09 07:27:30Z johnnyw $ + * $Id: High_Res_Timer.h 89483 2010-03-15 09:48:01Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -204,12 +204,8 @@ public: /// to start_incr and stop_incr. void elapsed_time_incr (ACE_hrtime_t &nanoseconds) const; -#if !defined (ACE_HAS_WINCE) - // @@ WINCE These two functions are currently not supported on Windows CE. - // However, we should probably use the handle and ACE_Log_Msg to - // print out the result. /// Print total time. - /// @note only use if incremental timings had been used! + /// @note only use @c print_total if incremental timings had been used! void print_total (const ACE_TCHAR *message, const int iterations = 1, ACE_HANDLE handle = ACE_STDOUT) const; @@ -218,7 +214,6 @@ public: void print_ave (const ACE_TCHAR *message, const int iterations = 1, ACE_HANDLE handle = ACE_STDOUT) const; -#endif /* !ACE_HAS_WINCE */ /// Dump the state of an object. void dump (void) const; @@ -313,4 +308,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_HIGH_RES_TIMER_H */ - diff --git a/dep/include/ace/High_Res_Timer.inl b/externals/ace/High_Res_Timer.inl similarity index 97% rename from dep/include/ace/High_Res_Timer.inl rename to externals/ace/High_Res_Timer.inl index 7a20845e496..06241dc0dfc 100644 --- a/dep/include/ace/High_Res_Timer.inl +++ b/externals/ace/High_Res_Timer.inl @@ -1,6 +1,6 @@ // -*- C++ -*- */ // -// $Id: High_Res_Timer.inl 81138 2008-03-28 09:18:15Z johnnyw $ +// $Id: High_Res_Timer.inl 89483 2010-03-15 09:48:01Z johnnyw $ #include "ace/Global_Macros.h" @@ -38,6 +38,7 @@ ACE_High_Res_Timer::hrtime_to_tv (ACE_Time_Value &tv, tv.usec ((long) ((hrt - tmp) / global_scale_factor ())); } + ACE_INLINE ACE_Time_Value ACE_High_Res_Timer::gettimeofday (const ACE_OS::ACE_HRTimer_Op op) { @@ -56,6 +57,7 @@ ACE_High_Res_Timer::gettimeofday (const ACE_OS::ACE_HRTimer_Op op) return tv; } + // Get the current high res timer as the time of day. This is intended // to be used for a gettimeofday replacement in ACE_Timer_Queue and // derived classes so the timers will bebased on high res timers rather @@ -68,6 +70,7 @@ ACE_High_Res_Timer::gettimeofday_hr (void) return ACE_High_Res_Timer::gettimeofday (); } + ACE_INLINE ACE_hrtime_t ACE_High_Res_Timer::gettime (const ACE_OS::ACE_HRTimer_Op op) { @@ -79,7 +82,7 @@ ACE_High_Res_Timer::gettime (const ACE_OS::ACE_HRTimer_Op op) // If there isn't a high-res timer, use gettimeofday (); if (ACE_High_Res_Timer::global_scale_factor_status_ == -1) { - ACE_Time_Value tv = ACE_OS::gettimeofday (); + ACE_Time_Value const tv = ACE_OS::gettimeofday (); // Return the time in microseconds because the global_scale_factor_ // is 1. return tv.sec () * ACE_ONE_SECOND_IN_USECS + tv.usec (); diff --git a/dep/src/ace/ICMP_Socket.cpp b/externals/ace/ICMP_Socket.cpp similarity index 99% rename from dep/src/ace/ICMP_Socket.cpp rename to externals/ace/ICMP_Socket.cpp index 8274805d4ec..6178858f989 100644 --- a/dep/src/ace/ICMP_Socket.cpp +++ b/externals/ace/ICMP_Socket.cpp @@ -9,14 +9,17 @@ #include "ace/OS_NS_netdb.h" #include "ace/OS_NS_sys_socket.h" + ACE_RCSID (ace, ICMP_Socket, "$Id: ICMP_Socket.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE (ACE_ICMP_Socket) + void ACE_ICMP_Socket::dump (void) const { @@ -181,4 +184,3 @@ ACE_ICMP_Socket::calculate_checksum (unsigned short * paddress, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ICMP_SUPPORT == 1 */ - diff --git a/dep/include/ace/ICMP_Socket.h b/externals/ace/ICMP_Socket.h similarity index 99% rename from dep/include/ace/ICMP_Socket.h rename to externals/ace/ICMP_Socket.h index edb179ffb3a..251ec307a4b 100644 --- a/dep/include/ace/ICMP_Socket.h +++ b/externals/ace/ICMP_Socket.h @@ -108,4 +108,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_ICMP_SOCKET_H */ - diff --git a/dep/src/ace/INET_Addr.cpp b/externals/ace/INET_Addr.cpp similarity index 98% rename from dep/src/ace/INET_Addr.cpp rename to externals/ace/INET_Addr.cpp index 20b7bbb382f..c6ef40b56ce 100644 --- a/dep/src/ace/INET_Addr.cpp +++ b/externals/ace/INET_Addr.cpp @@ -1,4 +1,4 @@ -// $Id: INET_Addr.cpp 82434 2008-07-28 11:40:36Z johnnyw $ +// $Id: INET_Addr.cpp 84183 2009-01-19 08:50:16Z johnnyw $ // Defines the Internet domain address family address format. @@ -20,7 +20,7 @@ ACE_RCSID (ace, INET_Addr, - "$Id: INET_Addr.cpp 82434 2008-07-28 11:40:36Z johnnyw $") + "$Id: INET_Addr.cpp 84183 2009-01-19 08:50:16Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -36,7 +36,7 @@ ACE_INET_Addr::addr_to_string (ACE_TCHAR s[], ACE_TRACE ("ACE_INET_Addr::addr_to_string"); // XXX Can we (should we) include the scope id for IPv6 addresses? - char hoststr[MAXHOSTNAMELEN+1]; + char hoststr[MAXHOSTNAMELEN+1]; bool result = false; if (ipaddr_format == 0) @@ -142,6 +142,7 @@ ACE_INET_Addr::is_ip_equal (const ACE_INET_Addr &sap) const return this->get_ip_address () == sap.get_ip_address(); } + u_long ACE_INET_Addr::hash (void) const { @@ -313,6 +314,7 @@ ACE_INET_Addr::set (u_short port_number, return 0; } + // Initializes a ACE_INET_Addr from a PORT_NUMBER and the remote // HOST_NAME. @@ -487,7 +489,7 @@ ACE_INET_Addr::set (const char port_name[], int address_family = PF_UNSPEC; # if defined (ACE_HAS_IPV6) - if (ACE_OS::strcmp (ACE_TEXT_CHAR_TO_TCHAR(protocol), ACE_TEXT ("tcp6")) == 0) + if (ACE_OS::strcmp (protocol, "tcp6") == 0) address_family = AF_INET6; # endif /* ACE_HAS_IPV6 */ @@ -700,18 +702,12 @@ ACE_INET_Addr::ACE_INET_Addr (const char port_name[], : ACE_Addr (determine_type (), sizeof (inet_addr_)) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); -#if !defined (ACE_LACKS_HTONL) this->reset (); if (this->set (port_name, - htonl (inet_address), + ACE_HTONL (inet_address), protocol) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -#else - ACE_UNUSED_ARG (port_name); - ACE_UNUSED_ARG (inet_address); - ACE_UNUSED_ARG (protocol); -#endif } #if defined (ACE_HAS_WCHAR) @@ -721,18 +717,12 @@ ACE_INET_Addr::ACE_INET_Addr (const wchar_t port_name[], : ACE_Addr (determine_type (), sizeof (inet_addr_)) { ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); -#if !defined (ACE_LACKS_HTONL) this->reset (); if (this->set (port_name, - htonl (inet_address), + ACE_HTONL (inet_address), protocol) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("ACE_INET_Addr::ACE_INET_Addr"))); -#else - ACE_UNUSED_ARG (port_name); - ACE_UNUSED_ARG (inet_address); - ACE_UNUSED_ARG (protocol); -#endif } #endif /* ACE_HAS_WCHAR */ @@ -945,6 +935,7 @@ int ACE_INET_Addr::set_address (const char *ip_addr, if (encode) ip4 = ACE_HTONL (ip4); + if (this->get_type () == AF_INET && map == 0) { this->base_set (AF_INET, sizeof (this->inet_addr_.in4_)); #ifdef ACE_HAS_SOCKADDR_IN_SIN_LEN @@ -1155,4 +1146,3 @@ ACE_INET_Addr::get_ip_address (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/INET_Addr.h b/externals/ace/INET_Addr.h similarity index 92% rename from dep/include/ace/INET_Addr.h rename to externals/ace/INET_Addr.h index aadd0de1022..d68e6409cdb 100644 --- a/dep/include/ace/INET_Addr.h +++ b/externals/ace/INET_Addr.h @@ -4,7 +4,7 @@ /** * @file INET_Addr.h * - * $Id: INET_Addr.h 81799 2008-05-28 18:13:58Z jtc $ + * $Id: INET_Addr.h 82789 2008-09-19 14:47:28Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -64,7 +64,7 @@ public: /** * Creates an ACE_INET_Addr from a @a port_number and an Internet - * . This method assumes that @a port_number and + * @a ip_addr. This method assumes that @a port_number and @a ip_addr * are in host byte order. If you have addressing information in * network byte order, @see set(). */ @@ -79,8 +79,8 @@ public: /** * Uses to create an ACE_INET_Addr from a - * , an Internet , and the @a protocol. This - * method assumes that is in host byte order. + * , an Internet @a ip_addr, and the @a protocol. This + * method assumes that @a ip_addr is in host byte order. */ ACE_INET_Addr (const char port_name[], ACE_UINT32 ip_addr, @@ -149,8 +149,8 @@ public: /** * Uses to initialize an ACE_INET_Addr from a - * , an , and the @a protocol. This assumes that - * is already in network byte order. + * , an @a ip_addr, and the @a protocol. This assumes that + * @a ip_addr is already in network byte order. */ int set (const char port_name[], ACE_UINT32 ip_addr, @@ -198,11 +198,11 @@ public: /** * Transform the current ACE_INET_Addr address into string format. - * If is non-0 this produces "ip-number:port-number" - * (e.g., "128.252.166.57:1234"), whereas if is 0 + * If @a ipaddr_format is ttrue this produces "ip-number:port-number" + * (e.g., "128.252.166.57:1234"), whereas if @a ipaddr_format is false * this produces "ip-name:port-number" (e.g., * "tango.cs.wustl.edu:1234"). Returns -1 if the @a size of the - * is too small, else 0. + * @a buffer is too small, else 0. */ virtual int addr_to_string (ACE_TCHAR buffer[], size_t size, @@ -237,12 +237,12 @@ public: /** * Sets the address without affecting the port number. If - * @a encode is enabled then is converted into network + * @a encode is enabled then @a ip_addr is converted into network * byte order, otherwise it is assumed to be in network byte order * already and are passed straight through. The size of the address * is specified in the @a len parameter. - * If is non-zero, IPv6 support has been compiled in, and - * is an IPv4 address, then this address is set to the IPv4-mapped + * If @a map is non-zero, IPv6 support has been compiled in, and + * @a ip_addr is an IPv4 address, then this address is set to the IPv4-mapped * IPv6 address of it. */ int set_address (const char *ip_addr, @@ -263,9 +263,9 @@ public: /** * Return the character representation of the name of the host, - * storing it in the (which is assumed to be - * bytes long). This version is reentrant. If - * is greater than 0 then will be + * storing it in the @a hostname (which is assumed to be + * @a hostnamelen bytes long). This version is reentrant. If + * @a hostnamelen is greater than 0 then @a hostname will be * NUL-terminated even if -1 is returned. */ int get_host_name (char hostname[], @@ -388,4 +388,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_INET_ADDR_H */ - diff --git a/dep/include/ace/INET_Addr.inl b/externals/ace/INET_Addr.inl similarity index 94% rename from dep/include/ace/INET_Addr.inl rename to externals/ace/INET_Addr.inl index e17048e0142..be3d8e6426b 100644 --- a/dep/include/ace/INET_Addr.inl +++ b/externals/ace/INET_Addr.inl @@ -1,6 +1,7 @@ // -*- C++ -*- // -// $Id: INET_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: INET_Addr.inl 88218 2009-12-17 12:32:14Z mcorino $ + #include "ace/OS_NS_string.h" #include "ace/Global_Macros.h" @@ -87,15 +88,13 @@ ACE_INLINE u_short ACE_INET_Addr::get_port_number (void) const { ACE_TRACE ("ACE_INET_Addr::get_port_number"); -#if defined (ACE_LACKS_NTOHS) - ACE_NOTSUP_RETURN (0); -#elif defined (ACE_HAS_IPV6) +#if defined (ACE_HAS_IPV6) if (this->get_type () == PF_INET) - return ntohs (this->inet_addr_.in4_.sin_port); + return ACE_NTOHS (this->inet_addr_.in4_.sin_port); else - return ntohs (this->inet_addr_.in6_.sin6_port); + return ACE_NTOHS (this->inet_addr_.in6_.sin6_port); #else - return ntohs (this->inet_addr_.in4_.sin_port); + return ACE_NTOHS (this->inet_addr_.in4_.sin_port); #endif /* ACE_HAS_IPV6 */ } @@ -217,8 +216,8 @@ ACE_INET_Addr::is_multicast (void) const return this->inet_addr_.in6_.sin6_addr.s6_addr[0] == 0xFF; #endif /* ACE_HAS_IPV6 */ return - this->inet_addr_.in4_.sin_addr.s_addr >= 0xE0000000 && // 224.0.0.0 - this->inet_addr_.in4_.sin_addr.s_addr <= 0xEFFFFFFF; // 239.255.255.255 + (*static_cast ( + static_cast (&this->inet_addr_.in4_.sin_addr.s_addr)) & 0xf0) == 0xe0; } #if defined (ACE_HAS_IPV6) diff --git a/dep/src/ace/IOStream.cpp b/externals/ace/IOStream.cpp similarity index 99% rename from dep/src/ace/IOStream.cpp rename to externals/ace/IOStream.cpp index 4fc8e851212..7ace37ee81b 100644 --- a/dep/src/ace/IOStream.cpp +++ b/externals/ace/IOStream.cpp @@ -48,6 +48,7 @@ ACE_RCSID(ace, IOStream, "$Id: IOStream.cpp 80826 2008-03-04 14:51:23Z wotte $") // a reference to iostream. The second >> has no idea of the ACE_IOStream and // gets invoked on iostream. Probably NOT what you wanted! + // In order to make all of this work the way you want, you have to do this: class myiostream : public iostream @@ -78,6 +79,7 @@ ACE_RCSID(ace, IOStream, "$Id: IOStream.cpp 80826 2008-03-04 14:51:23Z wotte $") // OK // invokes myiostream::operator>> (int&) returning myiostream& + foo >> i >> s; // OK // Because you provided operator>> (int&) in class myiostream, that @@ -661,4 +663,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_LACKS_ACE_IOSTREAM */ #endif /* ACE_IOSTREAM_CPP */ - diff --git a/dep/include/ace/IOStream.h b/externals/ace/IOStream.h similarity index 100% rename from dep/include/ace/IOStream.h rename to externals/ace/IOStream.h index be66c857962..8a135a5e426 100644 --- a/dep/include/ace/IOStream.h +++ b/externals/ace/IOStream.h @@ -427,6 +427,7 @@ typedef ostream& (*__omanip_)(ostream&); #define PUT_PROT(MT,DT,CODE) PUT_SIG(MT,DT) CODE #define PUT_FUNC(MT,DT) PUT_PROT(MT,DT,PUT_CODE) + // These are necessary in case somebody wants to derive from us and // override one of these with a custom approach. @@ -509,4 +510,3 @@ typedef ostream& (*__omanip_)(ostream&); #include /**/ "ace/post.h" #endif /* ACE_IOSTREAM_H */ - diff --git a/dep/src/ace/IOStream_T.cpp b/externals/ace/IOStream_T.cpp similarity index 99% rename from dep/src/ace/IOStream_T.cpp rename to externals/ace/IOStream_T.cpp index 3bf109b6737..3e7817d7c61 100644 --- a/dep/src/ace/IOStream_T.cpp +++ b/externals/ace/IOStream_T.cpp @@ -245,4 +245,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_STRING_CLASS */ #endif /* ACE_LACKS_ACE_IOSTREAM */ #endif /* ACE_IOSTREAM_T_CPP */ - diff --git a/dep/include/ace/IOStream_T.h b/externals/ace/IOStream_T.h similarity index 99% rename from dep/include/ace/IOStream_T.h rename to externals/ace/IOStream_T.h index e0046f921a3..286f1a714d5 100644 --- a/dep/include/ace/IOStream_T.h +++ b/externals/ace/IOStream_T.h @@ -295,4 +295,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_IOSTREAM_T_H */ - diff --git a/dep/include/ace/IOStream_T.inl b/externals/ace/IOStream_T.inl similarity index 100% rename from dep/include/ace/IOStream_T.inl rename to externals/ace/IOStream_T.inl diff --git a/dep/src/ace/IO_Cntl_Msg.cpp b/externals/ace/IO_Cntl_Msg.cpp similarity index 99% rename from dep/src/ace/IO_Cntl_Msg.cpp rename to externals/ace/IO_Cntl_Msg.cpp index 213237298c4..c730f97101c 100644 --- a/dep/src/ace/IO_Cntl_Msg.cpp +++ b/externals/ace/IO_Cntl_Msg.cpp @@ -49,4 +49,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif - diff --git a/dep/include/ace/IO_Cntl_Msg.h b/externals/ace/IO_Cntl_Msg.h similarity index 100% rename from dep/include/ace/IO_Cntl_Msg.h rename to externals/ace/IO_Cntl_Msg.h index fafc1fc7e1a..1b20f53d46a 100644 --- a/dep/include/ace/IO_Cntl_Msg.h +++ b/externals/ace/IO_Cntl_Msg.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_IO_CNTL_MSG_H #define ACE_IO_CNTL_MSG_H @@ -109,4 +110,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_IO_CNTL_MSG_H */ - diff --git a/dep/include/ace/IO_Cntl_Msg.inl b/externals/ace/IO_Cntl_Msg.inl similarity index 100% rename from dep/include/ace/IO_Cntl_Msg.inl rename to externals/ace/IO_Cntl_Msg.inl diff --git a/dep/src/ace/IO_SAP.cpp b/externals/ace/IO_SAP.cpp similarity index 99% rename from dep/src/ace/IO_SAP.cpp rename to externals/ace/IO_SAP.cpp index bfb693f9871..37200bfea7a 100644 --- a/dep/src/ace/IO_SAP.cpp +++ b/externals/ace/IO_SAP.cpp @@ -140,4 +140,3 @@ ACE_IO_SAP::disable (int value) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/IO_SAP.h b/externals/ace/IO_SAP.h similarity index 99% rename from dep/include/ace/IO_SAP.h rename to externals/ace/IO_SAP.h index a9826995195..b460c2346aa 100644 --- a/dep/include/ace/IO_SAP.h +++ b/externals/ace/IO_SAP.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_IO_SAP_H #define ACE_IO_SAP_H #include /**/ "ace/pre.h" @@ -21,6 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -92,4 +94,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_IO_SAP_H */ - diff --git a/dep/include/ace/IO_SAP.inl b/externals/ace/IO_SAP.inl similarity index 100% rename from dep/include/ace/IO_SAP.inl rename to externals/ace/IO_SAP.inl diff --git a/dep/src/ace/IPC_SAP.cpp b/externals/ace/IPC_SAP.cpp similarity index 99% rename from dep/src/ace/IPC_SAP.cpp rename to externals/ace/IPC_SAP.cpp index d257bf60ea5..bc3e9f7afe0 100644 --- a/dep/src/ace/IPC_SAP.cpp +++ b/externals/ace/IPC_SAP.cpp @@ -191,4 +191,3 @@ ACE_IPC_SAP::disable (int value) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/IPC_SAP.h b/externals/ace/IPC_SAP.h similarity index 99% rename from dep/include/ace/IPC_SAP.h rename to externals/ace/IPC_SAP.h index cc924a24ade..43a2125c575 100644 --- a/dep/include/ace/IPC_SAP.h +++ b/externals/ace/IPC_SAP.h @@ -94,4 +94,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_IPC_SAP_H */ - diff --git a/dep/include/ace/IPC_SAP.inl b/externals/ace/IPC_SAP.inl similarity index 100% rename from dep/include/ace/IPC_SAP.inl rename to externals/ace/IPC_SAP.inl diff --git a/dep/include/ace/If_Then_Else.h b/externals/ace/If_Then_Else.h similarity index 99% rename from dep/include/ace/If_Then_Else.h rename to externals/ace/If_Then_Else.h index 67f08f6f8e4..eca1d9dd83a 100644 --- a/dep/include/ace/If_Then_Else.h +++ b/externals/ace/If_Then_Else.h @@ -87,4 +87,3 @@ namespace ACE ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_IF_THEN_ELSE_H */ - diff --git a/dep/src/ace/Init_ACE.cpp b/externals/ace/Init_ACE.cpp similarity index 100% rename from dep/src/ace/Init_ACE.cpp rename to externals/ace/Init_ACE.cpp index a71f73b5992..f0c953f824e 100644 --- a/dep/src/ace/Init_ACE.cpp +++ b/externals/ace/Init_ACE.cpp @@ -6,6 +6,7 @@ ACE_RCSID (ace, Init_ACE, "$Id: Init_ACE.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL unsigned int ACE::init_fini_count_ = 0; @@ -42,4 +43,3 @@ ACE::fini (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Init_ACE.h b/externals/ace/Init_ACE.h similarity index 56% rename from dep/include/ace/Init_ACE.h rename to externals/ace/Init_ACE.h index cc3f5aa6b66..2bbaafc3e9f 100644 --- a/dep/include/ace/Init_ACE.h +++ b/externals/ace/Init_ACE.h @@ -4,13 +4,17 @@ /** * @file Init_ACE.h * - * $Id: Init_ACE.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Init_ACE.h 88794 2010-02-01 19:15:36Z schmidt $ * - * Initialize ACE library services. Can be called only once per - * program invocation. + * Initialize and finalize the ACE library services. You can + * generally execute the @a ACE::init() and @a ACE::fini() sequence + * multiple times, but be aware that nothing that ACE controls (e.g., + * singletons, thread-specific services, loaded services, etc.) will + * survive the @a ACE::fini(). */ //============================================================================= + #ifndef ACE_INIT_ACE_H #define ACE_INIT_ACE_H @@ -27,17 +31,22 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE { /** - * This class implements the functions for the initialization and - * shutting down ACE. These functions are called only once per ACE - * invokation. - * @return Returns 0 on success, -1 on failure, and 1 if it had already been - * called. + * This method initializes the ACE library services and initializes + * ACE's internal resources. Applications should not instantiate + * ACE classes or call methods on objects of these classes until @a + * ACE::init() returns successfully. + + * @return Returns 0 on success, -1 on failure, and 1 if it had + * already been called. */ extern ACE_Export int init (void); /** - * Shut down ACE library services. Can be called only once per - * program invocation. + * Finalize the ACE library services and releases ACE's internal + * resources. In general, do not instantiate ACE classes or call + * methods on objects of these classes after @a ACE::fini() has been + * called. + * * @return Returns 0 on success, -1 on failure, and 1 if it had already been * called. */ @@ -59,4 +68,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_INIT_ACE_H */ - diff --git a/dep/src/ace/Intrusive_Auto_Ptr.cpp b/externals/ace/Intrusive_Auto_Ptr.cpp similarity index 99% rename from dep/src/ace/Intrusive_Auto_Ptr.cpp rename to externals/ace/Intrusive_Auto_Ptr.cpp index 0b27e72e02e..4f9890353c1 100644 --- a/dep/src/ace/Intrusive_Auto_Ptr.cpp +++ b/externals/ace/Intrusive_Auto_Ptr.cpp @@ -20,4 +20,3 @@ ACE_Intrusive_Auto_Ptr::~ACE_Intrusive_Auto_Ptr (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_INTRUSIVE_AUTO_PTR_CPP */ - diff --git a/dep/include/ace/Intrusive_Auto_Ptr.h b/externals/ace/Intrusive_Auto_Ptr.h similarity index 100% rename from dep/include/ace/Intrusive_Auto_Ptr.h rename to externals/ace/Intrusive_Auto_Ptr.h index 375ec292527..9c6ad348236 100644 --- a/dep/include/ace/Intrusive_Auto_Ptr.h +++ b/externals/ace/Intrusive_Auto_Ptr.h @@ -63,6 +63,7 @@ public: return rep_ == 0 ? 0: unspecified_bool; } + // = Initialization and termination methods. /// Constructor that initializes an ACE_Intrusive_Auto_Ptr to @@ -162,4 +163,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_INTRUSIVE_AUTO_PTR_H */ - diff --git a/dep/include/ace/Intrusive_Auto_Ptr.inl b/externals/ace/Intrusive_Auto_Ptr.inl similarity index 99% rename from dep/include/ace/Intrusive_Auto_Ptr.inl rename to externals/ace/Intrusive_Auto_Ptr.inl index aa3e2659930..4feb83db7b1 100644 --- a/dep/include/ace/Intrusive_Auto_Ptr.inl +++ b/externals/ace/Intrusive_Auto_Ptr.inl @@ -143,4 +143,5 @@ template ACE_INLINE bool operator==(ACE_Intrusive_Auto_Ptr return a != b.get(); } + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Intrusive_List.cpp b/externals/ace/Intrusive_List.cpp similarity index 85% rename from dep/src/ace/Intrusive_List.cpp rename to externals/ace/Intrusive_List.cpp index e8a3a951e1d..90ed82de29f 100644 --- a/dep/src/ace/Intrusive_List.cpp +++ b/externals/ace/Intrusive_List.cpp @@ -1,4 +1,4 @@ -// $Id: Intrusive_List.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Intrusive_List.cpp 84273 2009-01-30 12:55:25Z johnnyw $ #ifndef ACE_INTRUSIVE_LIST_CPP #define ACE_INTRUSIVE_LIST_CPP @@ -36,13 +36,14 @@ ACE_Intrusive_List::push_back (T *node) this->head_ = node; node->next (0); node->prev (0); - return; } - - this->tail_->next (node); - node->prev (this->tail_); - node->next (0); - this->tail_ = node; + else + { + this->tail_->next (node); + node->prev (this->tail_); + node->next (0); + this->tail_ = node; + } } template void @@ -54,22 +55,24 @@ ACE_Intrusive_List::push_front (T *node) this->head_ = node; node->next (0); node->prev (0); - return; } - - this->head_->prev (node); - node->next (this->head_); - node->prev (0); - this->head_ = node; + else + { + this->head_->prev (node); + node->next (this->head_); + node->prev (0); + this->head_ = node; + } } template T * ACE_Intrusive_List::pop_front (void) { T *node = this->head_; - if (node == 0) - return 0; - this->unsafe_remove (node); + if (node != 0) + { + this->unsafe_remove (node); + } return node; } @@ -77,9 +80,10 @@ template T * ACE_Intrusive_List::pop_back (void) { T *node = this->tail_; - if (node == 0) - return 0; - this->unsafe_remove (node); + if (node != 0) + { + this->unsafe_remove (node); + } return node; } @@ -151,4 +155,3 @@ ACE_Intrusive_List::check_invariants (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_INTRUSIVE_LIST_CPP */ - diff --git a/dep/include/ace/Intrusive_List.h b/externals/ace/Intrusive_List.h similarity index 91% rename from dep/include/ace/Intrusive_List.h rename to externals/ace/Intrusive_List.h index 24e7cedfc13..d93ec95edb0 100644 --- a/dep/include/ace/Intrusive_List.h +++ b/externals/ace/Intrusive_List.h @@ -4,7 +4,7 @@ /** * @file Intrusive_List.h * - * $Id: Intrusive_List.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Intrusive_List.h 83968 2008-12-04 08:11:41Z johnnyw $ * * @author Carlos O'Ryan */ @@ -14,7 +14,7 @@ #define ACE_INTRUSIVE_LIST_H #include /**/ "ace/pre.h" -#include /**/ "ace/config-all.h" +#include /**/ "ace/config-lite.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -68,12 +68,12 @@ public: // = Check boundary conditions. - /// Returns 1 if the container is empty, otherwise returns 0. - int is_empty (void) const; + /// Returns true if the container is empty, otherwise returns false. + bool is_empty (void) const; - /// Returns 1 if the container is empty, otherwise returns 0. + /// Returns true if the container is empty, otherwise returns false. /// @deprecated Use is_empty() instead. - int empty (void) const; + bool empty (void) const; /// Insert an element at the beginning of the list void push_front (T *node); @@ -142,4 +142,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_INTRUSIVE_LIST_H */ - diff --git a/dep/include/ace/Intrusive_List.inl b/externals/ace/Intrusive_List.inl similarity index 82% rename from dep/include/ace/Intrusive_List.inl rename to externals/ace/Intrusive_List.inl index aac3306962b..028a1aef3b1 100644 --- a/dep/include/ace/Intrusive_List.inl +++ b/externals/ace/Intrusive_List.inl @@ -1,18 +1,18 @@ // -*- C++ -*- // -// $Id: Intrusive_List.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Intrusive_List.inl 83952 2008-12-02 20:01:24Z johnnyw $ #include ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template ACE_INLINE int +template ACE_INLINE bool ACE_Intrusive_List::is_empty (void) const { return this->head_ == 0; } -template ACE_INLINE int +template ACE_INLINE bool ACE_Intrusive_List::empty (void) const { return this->is_empty (); diff --git a/dep/src/ace/Intrusive_List_Node.cpp b/externals/ace/Intrusive_List_Node.cpp similarity index 99% rename from dep/src/ace/Intrusive_List_Node.cpp rename to externals/ace/Intrusive_List_Node.cpp index 347bb677de6..1e14537a4d2 100644 --- a/dep/src/ace/Intrusive_List_Node.cpp +++ b/externals/ace/Intrusive_List_Node.cpp @@ -25,4 +25,3 @@ ACE_Intrusive_List_Node::ACE_Intrusive_List_Node (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_INTRUSIVE_LIST_NODE_CPP */ - diff --git a/dep/include/ace/Intrusive_List_Node.h b/externals/ace/Intrusive_List_Node.h similarity index 94% rename from dep/include/ace/Intrusive_List_Node.h rename to externals/ace/Intrusive_List_Node.h index 21ea961f220..dcfbd89e751 100644 --- a/dep/include/ace/Intrusive_List_Node.h +++ b/externals/ace/Intrusive_List_Node.h @@ -4,7 +4,7 @@ /** * @file Intrusive_List_Node.h * - * $Id: Intrusive_List_Node.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Intrusive_List_Node.h 83968 2008-12-04 08:11:41Z johnnyw $ * * @author Carlos O'Ryan */ @@ -14,7 +14,7 @@ #define ACE_INTRUSIVE_LIST_NODE_H #include /**/ "ace/pre.h" -#include /**/ "ace/config-all.h" +#include /**/ "ace/config-lite.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -37,7 +37,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * confused using such templates, the class is provided as a helper * for our lucky users that only need portability to modern C++ * compilers. - * */ template class ACE_Intrusive_List_Node @@ -83,4 +82,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_INTRUSIVE_LIST_NODE_H */ - diff --git a/dep/include/ace/Intrusive_List_Node.inl b/externals/ace/Intrusive_List_Node.inl similarity index 100% rename from dep/include/ace/Intrusive_List_Node.inl rename to externals/ace/Intrusive_List_Node.inl diff --git a/dep/src/ace/LOCK_SOCK_Acceptor.cpp b/externals/ace/LOCK_SOCK_Acceptor.cpp similarity index 82% rename from dep/src/ace/LOCK_SOCK_Acceptor.cpp rename to externals/ace/LOCK_SOCK_Acceptor.cpp index aa525a9b226..2140454bc0a 100644 --- a/dep/src/ace/LOCK_SOCK_Acceptor.cpp +++ b/externals/ace/LOCK_SOCK_Acceptor.cpp @@ -1,4 +1,4 @@ -// $Id: LOCK_SOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: LOCK_SOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #ifndef ACE_LOCK_SOCK_ACCEPTOR_CPP #define ACE_LOCK_SOCK_ACCEPTOR_CPP @@ -12,8 +12,8 @@ template int ACE_LOCK_SOCK_Acceptor::accept (ACE_SOCK_Stream &stream, ACE_Addr *remote_address, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, -1); @@ -33,4 +33,3 @@ ACE_LOCK_SOCK_Acceptor::lock (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LOCK_SOCK_ACCEPTOR_CPP */ - diff --git a/dep/include/ace/LOCK_SOCK_Acceptor.h b/externals/ace/LOCK_SOCK_Acceptor.h similarity index 91% rename from dep/include/ace/LOCK_SOCK_Acceptor.h rename to externals/ace/LOCK_SOCK_Acceptor.h index 1271b1d9060..6eff834eb13 100644 --- a/dep/include/ace/LOCK_SOCK_Acceptor.h +++ b/externals/ace/LOCK_SOCK_Acceptor.h @@ -4,12 +4,13 @@ /** * @file LOCK_SOCK_Acceptor.h * - * $Id: LOCK_SOCK_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: LOCK_SOCK_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author James Hu and Irfan Pyarali */ //============================================================================= + #ifndef ACE_LOCK_SOCK_ACCEPTOR_H #define ACE_LOCK_SOCK_ACCEPTOR_H #include /**/ "ace/pre.h" @@ -41,8 +42,8 @@ public: int accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; /// Return a reference to the lock. ACE_LOCK &lock (void); @@ -64,4 +65,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOCK_SOCK_ACCEPTOR_H */ - diff --git a/dep/src/ace/LSOCK.cpp b/externals/ace/LSOCK.cpp similarity index 91% rename from dep/src/ace/LSOCK.cpp rename to externals/ace/LSOCK.cpp index 17c210aa9fc..75215157c5e 100644 --- a/dep/src/ace/LSOCK.cpp +++ b/externals/ace/LSOCK.cpp @@ -1,8 +1,8 @@ -// $Id: LSOCK.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: LSOCK.cpp 88869 2010-02-06 11:29:56Z mcorino $ #include "ace/LSOCK.h" -ACE_RCSID(ace, LSOCK, "$Id: LSOCK.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, LSOCK, "$Id: LSOCK.cpp 88869 2010-02-06 11:29:56Z mcorino $") #if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) @@ -59,7 +59,8 @@ ACE_LSOCK::send_handle (const ACE_HANDLE handle) const cmsgptr->cmsg_len = sizeof cmsgbuf; send_msg.msg_control = cmsgbuf; send_msg.msg_controllen = sizeof cmsgbuf; - *(ACE_HANDLE *) CMSG_DATA (cmsgptr) = handle; + ACE_HANDLE *ph = (ACE_HANDLE *) CMSG_DATA (cmsgptr); + *ph = handle; send_msg.msg_flags = 0; #else send_msg.msg_accrights = (char *) &handle; @@ -143,7 +144,9 @@ ACE_LSOCK::recv_handle (ACE_HANDLE &handle, char *pbuf, ssize_t *len) const { #if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) // Close down the socket that was returned by the MSG_PEEK. - ACE_OS::closesocket (*(ACE_HANDLE *) CMSG_DATA ((cmsghdr *) cmsgbuf)); + cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; + ACE_HANDLE * ph = (ACE_HANDLE *) CMSG_DATA (cmsgptr); + ACE_OS::closesocket (*ph); recv_msg.msg_control = cmsgbuf; recv_msg.msg_controllen = sizeof cmsgbuf; #else @@ -158,7 +161,8 @@ ACE_LSOCK::recv_handle (ACE_HANDLE &handle, char *pbuf, ssize_t *len) const { #if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) cmsghdr *cmsgptr = (cmsghdr *) cmsgbuf; - handle = *(ACE_HANDLE *) CMSG_DATA (cmsgptr); + ACE_HANDLE * ph = (ACE_HANDLE *) CMSG_DATA (cmsgptr); + handle = *ph; #endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ return 1; } @@ -179,4 +183,3 @@ ACE_LSOCK::recv_handle (ACE_HANDLE &handle, char *pbuf, ssize_t *len) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/LSOCK.h b/externals/ace/LSOCK.h similarity index 100% rename from dep/include/ace/LSOCK.h rename to externals/ace/LSOCK.h index caec4362e0c..7cf7abc478c 100644 --- a/dep/include/ace/LSOCK.h +++ b/externals/ace/LSOCK.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_LOCAL_SOCK_H #define ACE_LOCAL_SOCK_H @@ -81,4 +82,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_SOCK_H */ - diff --git a/dep/include/ace/LSOCK.inl b/externals/ace/LSOCK.inl similarity index 100% rename from dep/include/ace/LSOCK.inl rename to externals/ace/LSOCK.inl diff --git a/dep/src/ace/LSOCK_Acceptor.cpp b/externals/ace/LSOCK_Acceptor.cpp similarity index 93% rename from dep/src/ace/LSOCK_Acceptor.cpp rename to externals/ace/LSOCK_Acceptor.cpp index ece671beae3..5f24783209d 100644 --- a/dep/src/ace/LSOCK_Acceptor.cpp +++ b/externals/ace/LSOCK_Acceptor.cpp @@ -1,4 +1,4 @@ -// $Id: LSOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: LSOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/LSOCK_Acceptor.h" @@ -8,7 +8,7 @@ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_socket.h" -ACE_RCSID(ace, LSOCK_Acceptor, "$Id: LSOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, LSOCK_Acceptor, "$Id: LSOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -84,8 +84,8 @@ int ACE_LSOCK_Acceptor::accept (ACE_LSOCK_Stream &new_stream, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { ACE_TRACE ("ACE_LSOCK_Acceptor::accept"); @@ -141,4 +141,3 @@ ACE_LSOCK_Acceptor::remove (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/LSOCK_Acceptor.h b/externals/ace/LSOCK_Acceptor.h similarity index 93% rename from dep/include/ace/LSOCK_Acceptor.h rename to externals/ace/LSOCK_Acceptor.h index 625f8f72853..b10c55c5d20 100644 --- a/dep/include/ace/LSOCK_Acceptor.h +++ b/externals/ace/LSOCK_Acceptor.h @@ -4,12 +4,13 @@ /** * @file LSOCK_Acceptor.h * - * $Id: LSOCK_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: LSOCK_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Doug Schmidt */ //============================================================================= + #ifndef ACE_LOCAL_SOCK_ACCEPTOR_H #define ACE_LOCAL_SOCK_ACCEPTOR_H #include /**/ "ace/pre.h" @@ -62,8 +63,8 @@ public: int accept (ACE_LSOCK_Stream &new_ipc_sap, ACE_Addr * = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; /// Close down the ACE_LSOCK and remove the rendezvous point from the /// file system. @@ -92,4 +93,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_SOCK_ACCEPTOR_H */ - diff --git a/dep/src/ace/LSOCK_CODgram.cpp b/externals/ace/LSOCK_CODgram.cpp similarity index 99% rename from dep/src/ace/LSOCK_CODgram.cpp rename to externals/ace/LSOCK_CODgram.cpp index 9f2b23574be..e1e2c0b01cd 100644 --- a/dep/src/ace/LSOCK_CODgram.cpp +++ b/externals/ace/LSOCK_CODgram.cpp @@ -60,4 +60,3 @@ ACE_LSOCK_CODgram::ACE_LSOCK_CODgram (const ACE_Addr &remote, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/LSOCK_CODgram.h b/externals/ace/LSOCK_CODgram.h similarity index 51% rename from dep/include/ace/LSOCK_CODgram.h rename to externals/ace/LSOCK_CODgram.h index 48fb9c63bcf..c2858a8ed70 100644 --- a/dep/include/ace/LSOCK_CODgram.h +++ b/externals/ace/LSOCK_CODgram.h @@ -4,12 +4,13 @@ /** * @file LSOCK_CODgram.h * - * $Id: LSOCK_CODgram.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: LSOCK_CODgram.h 84419 2009-02-11 22:28:11Z shuston $ * * @author Douglas C. Schmidt */ //============================================================================= + #ifndef ACE_LOCAL_SOCK_CODGRAM_H #define ACE_LOCAL_SOCK_CODGRAM_H #include /**/ "ace/pre.h" @@ -31,27 +32,58 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** * @class ACE_LSOCK_CODgram * - * @brief Defines the member functions for the connected + * @brief Defines a fully specified (sometimes called "connected") UNIX-domain * datagram abstraction. + * + * ACE_LSOCK_CODgram provides a way to use a UNIX-domain datagram socket in + * a situation where the local and peer addresses are fully known in advance. + * The "connection-oriented" part of "CODgram" is a misnomer. There is no + * connection used on this type of socket. It merely specifies that both + * endpoint addresses are known in advance of use. Furthermore, this class + * is more suited for use cases where a local endpoint wishes to communicate + * with a single, known peer and may or may not have a specified local address. + * + * If your use case requires receiving datagrams from multiple peers without + * previously known addresses, consider using ACE_LSOCK_Dgram instead. */ class ACE_Export ACE_LSOCK_CODgram : public ACE_SOCK_CODgram, public ACE_LSOCK { public: - // = Initialization methods. - /// Default constructor. + /// Default constructor; requires a call to open() prior to communication. ACE_LSOCK_CODgram (void); - /// Initiate a connected-datagram. + /** + * @name Initialization methods + */ + //@{ + /** + * Initialize a fully-specified datagram socket. + * + * @param remote_sap Remote/peer address. This should be an ACE_UNIX_Addr + * object. It specifies where all sent datagrams will + * be sent to. + * @param local_sap Local address. The local address to receive datagrams + * at. If not specified, an unused address is selected. + * If specified, should be an ACE_UNIX_Addr object. + * + * @sa ACE_UNIX_Addr + */ ACE_LSOCK_CODgram (const ACE_Addr &remote_sap, const ACE_Addr &local_sap = ACE_Addr::sap_any, int protocol_family = PF_UNIX, int protocol = 0); - /// Initiate a connected-datagram. + /** + * Initialize a fully-specified datagram socket. + * + * @retval 0 if no error. + * @retval -1 on error; check errno for an error reason. + */ int open (const ACE_Addr &remote_sap, const ACE_Addr &local_sap = ACE_Addr::sap_any, int protocol_family = PF_UNIX, int protocol = 0); + //@} /// Get underlying handle. ACE_HANDLE get_handle (void) const; @@ -75,4 +107,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_SOCK_CODGRAM_H */ - diff --git a/dep/include/ace/LSOCK_CODgram.inl b/externals/ace/LSOCK_CODgram.inl similarity index 100% rename from dep/include/ace/LSOCK_CODgram.inl rename to externals/ace/LSOCK_CODgram.inl diff --git a/dep/src/ace/LSOCK_Connector.cpp b/externals/ace/LSOCK_Connector.cpp similarity index 99% rename from dep/src/ace/LSOCK_Connector.cpp rename to externals/ace/LSOCK_Connector.cpp index efb2063320e..c1e21b9d542 100644 --- a/dep/src/ace/LSOCK_Connector.cpp +++ b/externals/ace/LSOCK_Connector.cpp @@ -57,4 +57,3 @@ ACE_LSOCK_Connector::ACE_LSOCK_Connector (ACE_LSOCK_Stream &new_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/LSOCK_Connector.h b/externals/ace/LSOCK_Connector.h similarity index 99% rename from dep/include/ace/LSOCK_Connector.h rename to externals/ace/LSOCK_Connector.h index 84946d63a66..03d0fd0a5b1 100644 --- a/dep/include/ace/LSOCK_Connector.h +++ b/externals/ace/LSOCK_Connector.h @@ -89,4 +89,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_SOCK_CONNECTOR_H */ - diff --git a/dep/include/ace/LSOCK_Connector.inl b/externals/ace/LSOCK_Connector.inl similarity index 100% rename from dep/include/ace/LSOCK_Connector.inl rename to externals/ace/LSOCK_Connector.inl diff --git a/dep/src/ace/LSOCK_Dgram.cpp b/externals/ace/LSOCK_Dgram.cpp similarity index 99% rename from dep/src/ace/LSOCK_Dgram.cpp rename to externals/ace/LSOCK_Dgram.cpp index 5cb18a611a4..60e630f0bc0 100644 --- a/dep/src/ace/LSOCK_Dgram.cpp +++ b/externals/ace/LSOCK_Dgram.cpp @@ -69,4 +69,3 @@ ACE_LSOCK_Dgram::ACE_LSOCK_Dgram (const ACE_Addr &local, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/LSOCK_Dgram.h b/externals/ace/LSOCK_Dgram.h similarity index 100% rename from dep/include/ace/LSOCK_Dgram.h rename to externals/ace/LSOCK_Dgram.h index 26a3950a726..e21a3ce9e62 100644 --- a/dep/include/ace/LSOCK_Dgram.h +++ b/externals/ace/LSOCK_Dgram.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_LOCAL_SOCK_DGRAM_H #define ACE_LOCAL_SOCK_DGRAM_H #include /**/ "ace/pre.h" @@ -71,4 +72,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_SOCK_DGRAM_H */ - diff --git a/dep/include/ace/LSOCK_Dgram.inl b/externals/ace/LSOCK_Dgram.inl similarity index 100% rename from dep/include/ace/LSOCK_Dgram.inl rename to externals/ace/LSOCK_Dgram.inl diff --git a/dep/src/ace/LSOCK_Stream.cpp b/externals/ace/LSOCK_Stream.cpp similarity index 99% rename from dep/src/ace/LSOCK_Stream.cpp rename to externals/ace/LSOCK_Stream.cpp index ab8110c7732..f8eae91243d 100644 --- a/dep/src/ace/LSOCK_Stream.cpp +++ b/externals/ace/LSOCK_Stream.cpp @@ -135,4 +135,3 @@ ACE_LSOCK_Stream::recv_msg (iovec iov[], ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/LSOCK_Stream.h b/externals/ace/LSOCK_Stream.h similarity index 100% rename from dep/include/ace/LSOCK_Stream.h rename to externals/ace/LSOCK_Stream.h index 41bb5311d94..3476a51df7b 100644 --- a/dep/include/ace/LSOCK_Stream.h +++ b/externals/ace/LSOCK_Stream.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_LOCAL_SOCK_STREAM_H #define ACE_LOCAL_SOCK_STREAM_H #include /**/ "ace/pre.h" @@ -79,4 +80,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_SOCK_STREAM_H */ - diff --git a/dep/include/ace/LSOCK_Stream.inl b/externals/ace/LSOCK_Stream.inl similarity index 100% rename from dep/include/ace/LSOCK_Stream.inl rename to externals/ace/LSOCK_Stream.inl diff --git a/dep/src/ace/Lib_Find.cpp b/externals/ace/Lib_Find.cpp similarity index 89% rename from dep/src/ace/Lib_Find.cpp rename to externals/ace/Lib_Find.cpp index 4584056b55c..b1a2f6a4160 100644 --- a/dep/src/ace/Lib_Find.cpp +++ b/externals/ace/Lib_Find.cpp @@ -1,4 +1,4 @@ -// $Id: Lib_Find.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Lib_Find.cpp 85473 2009-06-01 08:09:31Z johnnyw $ #include "ace/Lib_Find.h" #include "ace/Log_Msg.h" @@ -26,29 +26,30 @@ extern "C" int LIB$FIND_IMAGE_SYMBOL(...); +/** + * @internal + * + * Implements a class to register symbols and addresses for use with DLL + * symbol retrieval. + * + * OpenVMS restricts symbol length to 31 characters encoding any symbols + * longer than that. In these cases dlsym() only works with the encoded + * names. + * This creates serious problems for the service configurator framework + * where the factory method names often exceed 31 chars and where loading + * is based on retrieval of method pointers using the *full* name. + * For OpenVMS we therefor added this singleton class and the + * ACE_Dynamic_Svc_Registrar class which registers full names and function + * pointers with this singleton at the time the static ACE_Dynamic_Svc_Registrar + * object is created in a (service) DLL. + * By forcing the DLL to load using a common symbol ("NULL") we trigger static + * object creation *before* the full names are referenced. + * Symbol references will be resolved as follows on OpenVMS: + * - first try directly from DLL using the RTL dlsym() function and if that fails; + * - try to find symbol in singleton registry. + */ class ACE_LD_Symbol_Registry { - // @internal - // = TITLE - // Implements a class to register symbols and addresses for use with DLL - // symbol retrieval. - // - // = DESCRIPTION - // OpenVMS restricts symbol length to 31 characters encoding any symbols - // longer than that. In these cases dlsym() only works with the encoded - // names. - // This creates serious problems for the service configurator framework - // where the factory method names often exceed 31 chars and where loading - // is based on retrieval of method pointers using the *full* name. - // For OpenVMS we therefor added this singleton class and the - // ACE_Dynamic_Svc_Registrar class which registers full names and function - // pointers with this singleton at the time the static ACE_Dynamic_Svc_Registrar - // object is created in a (service) DLL. - // By forcing the DLL to load using a common symbol ("NULL") we trigger static - // object creation *before* the full names are referenced. - // Symbol references will be resolved as follows on OpenVMS: - // - first try directly from DLL using the RTL dlsym() function and if that fails; - // - try to find symbol in singleton registry. public: typedef ACE_RB_Tree * #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ #endif -ACE_RCSID(ace, Lib_Find, "$Id: Lib_Find.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Lib_Find, "$Id: Lib_Find.cpp 85473 2009-06-01 08:09:31Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -165,6 +166,7 @@ ACE::ldfind (const ACE_TCHAR* filename, return -1; } + ACE_OS::strcpy(pathname, ACE_DLL_PREFIX); ACE_OS::strcat(pathname, filename); nameDsc.dsc$w_length = ACE_OS::strlen(pathname); @@ -201,12 +203,12 @@ ACE::ldfind (const ACE_TCHAR* filename, ACE_TCHAR tempcopy[MAXPATHLEN + 1]; ACE_TCHAR searchpathname[MAXPATHLEN + 1]; -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) +#if defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) ACE_TCHAR decorator[] = ACE_LD_DECORATOR_STR; ACE_TCHAR searchfilename[MAXPATHLEN + sizeof(decorator) / sizeof (ACE_TCHAR)]; #else ACE_TCHAR searchfilename[MAXPATHLEN + 1]; -#endif /* ACE_WIN32 && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ +#endif /* ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ // Create a copy of filename to work with. if (ACE_OS::strlen (filename) + 1 @@ -283,18 +285,17 @@ ACE::ldfind (const ACE_TCHAR* filename, return -1; } -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - size_t len_searchfilename = ACE_OS::strlen (searchfilename); - if (! has_suffix) - ACE_OS::strcpy (searchfilename + len_searchfilename, - decorator); +#if defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) + size_t const len_searchfilename = ACE_OS::strlen (searchfilename); + if (!has_suffix) + ACE_OS::strcpy (searchfilename + len_searchfilename, decorator); for (int tag = 1; tag >= 0; tag --) { if (tag == 0) searchfilename [len_searchfilename] = 0; -#endif /* ACE_WIN32 && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ +#endif /* ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ // Use absolute pathname if there is one. if (ACE_OS::strlen (searchpathname) > 0) { @@ -374,9 +375,9 @@ ACE::ldfind (const ACE_TCHAR* filename, else if (pathlen > 0) return 0; #else - ACE_TCHAR *ld_path; + ACE_TCHAR *ld_path = 0; # if defined ACE_DEFAULT_LD_SEARCH_PATH - ld_path = ACE_DEFAULT_LD_SEARCH_PATH; + ld_path = const_cast (ACE_DEFAULT_LD_SEARCH_PATH); # else # if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) ld_path = ACE_OS::getenv (ACE_LD_SEARCH_PATH); @@ -497,17 +498,16 @@ ACE::ldfind (const ACE_TCHAR* filename, ACE_OS::free (ld_path_temp); #endif /* ACE_HAS_WINCE */ ACE_OS::free ((void *) ld_path); -#if defined (ACE_HAS_WINCE) && defined (ACE_LD_DECORATOR_STR) && \ - !defined (ACE_DISABLE_DEBUG_DLL_CHECK) +#if defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) if (result == 0 || tag == 0) -#endif /* ACE_HAS_WINCE && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ +#endif /* ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ return result; } #endif /* ACE_WIN32 && !ACE_HAS_WINCE */ } -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) +#if defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) } -#endif /* ACE_WIN32 && ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ +#endif /* ACE_LD_DECORATOR_STR && !ACE_DISABLE_DEBUG_DLL_CHECK */ errno = ENOENT; return -1; @@ -593,8 +593,8 @@ ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) buffer); // Make sure to return -1 if there is an error - if (result == 0 && ::GetLastError () != ERROR_SUCCESS - || result > static_cast (buffer_len)) + if ((result == 0 && ::GetLastError () != ERROR_SUCCESS) + || (result > static_cast (buffer_len))) result = -1; #else /* ACE_WIN32 */ @@ -676,6 +676,7 @@ ACE::strrepl (char *s, char search, char replace) return replaced; } + // Split a string up into 'token'-delimited pieces, ala Perl's // "split". @@ -765,4 +766,3 @@ ACE::strrepl (wchar_t *s, wchar_t search, wchar_t replace) #endif /* ACE_HAS_WCHAR */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Lib_Find.h b/externals/ace/Lib_Find.h similarity index 100% rename from dep/include/ace/Lib_Find.h rename to externals/ace/Lib_Find.h index 05bd068fdb3..133b83ffb7b 100644 --- a/dep/include/ace/Lib_Find.h +++ b/externals/ace/Lib_Find.h @@ -59,6 +59,7 @@ namespace ACE */ extern ACE_Export ACE_TCHAR *ldname (const ACE_TCHAR *entry_point); + #if defined (ACE_OPENVMS) /** * Registers an @a entry_point and its address for later retrieval @@ -128,4 +129,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LIB_FIND_H */ - diff --git a/dep/src/ace/Local_Memory_Pool.cpp b/externals/ace/Local_Memory_Pool.cpp similarity index 99% rename from dep/src/ace/Local_Memory_Pool.cpp rename to externals/ace/Local_Memory_Pool.cpp index ebec0ad75aa..559b6656f30 100644 --- a/dep/src/ace/Local_Memory_Pool.cpp +++ b/externals/ace/Local_Memory_Pool.cpp @@ -142,4 +142,3 @@ ACE_Local_Memory_Pool::round_up (size_t nbytes) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Local_Memory_Pool.h b/externals/ace/Local_Memory_Pool.h similarity index 99% rename from dep/include/ace/Local_Memory_Pool.h rename to externals/ace/Local_Memory_Pool.h index f02b101c0dc..4216a97a713 100644 --- a/dep/include/ace/Local_Memory_Pool.h +++ b/externals/ace/Local_Memory_Pool.h @@ -131,4 +131,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOCAL_MEMORY_POOL_H */ - diff --git a/dep/src/ace/Local_Name_Space.cpp b/externals/ace/Local_Name_Space.cpp similarity index 99% rename from dep/src/ace/Local_Name_Space.cpp rename to externals/ace/Local_Name_Space.cpp index deba2ab215d..b3e13d7d900 100644 --- a/dep/src/ace/Local_Name_Space.cpp +++ b/externals/ace/Local_Name_Space.cpp @@ -167,4 +167,3 @@ ACE_NS_Internal::type (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Local_Name_Space.h b/externals/ace/Local_Name_Space.h similarity index 99% rename from dep/include/ace/Local_Name_Space.h rename to externals/ace/Local_Name_Space.h index 09aadcaa4de..c9606d02bf2 100644 --- a/dep/include/ace/Local_Name_Space.h +++ b/externals/ace/Local_Name_Space.h @@ -130,4 +130,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOCAL_NAME_SPACE_H */ - diff --git a/dep/src/ace/Local_Name_Space_T.cpp b/externals/ace/Local_Name_Space_T.cpp similarity index 99% rename from dep/src/ace/Local_Name_Space_T.cpp rename to externals/ace/Local_Name_Space_T.cpp index 1c249586767..ee545e5dfbf 100644 --- a/dep/src/ace/Local_Name_Space_T.cpp +++ b/externals/ace/Local_Name_Space_T.cpp @@ -1,4 +1,4 @@ -// $Id: Local_Name_Space_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Local_Name_Space_T.cpp 83170 2008-10-13 07:21:38Z johnnyw $ #ifndef ACE_LOCAL_NAME_SPACE_T_CPP #define ACE_LOCAL_NAME_SPACE_T_CPP @@ -813,8 +813,8 @@ ACE_Local_Name_Space::dump_i (void) const const char *type = map_entry->int_id_.type (); #endif /* ! ACE_NLOGGING */ - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("key=%s\nvalue=%s\ntype=%s\n"), - ACE_TEXT_CHAR_TO_TCHAR (key), ACE_TEXT_CHAR_TO_TCHAR (value), ACE_TEXT_CHAR_TO_TCHAR (type))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("key=%C\nvalue=%C\ntype=%C\n"), + key, value, type)); // We need to delete key and value since char_rep allocates // memory for them delete [] key; @@ -964,4 +964,3 @@ ACE_Local_Name_Space::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LOCAL_NAME_SPACE_T_CPP */ - diff --git a/dep/include/ace/Local_Name_Space_T.h b/externals/ace/Local_Name_Space_T.h similarity index 100% rename from dep/include/ace/Local_Name_Space_T.h rename to externals/ace/Local_Name_Space_T.h index a8d556a4eb1..9822a22a6e7 100644 --- a/dep/include/ace/Local_Name_Space_T.h +++ b/externals/ace/Local_Name_Space_T.h @@ -54,6 +54,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL typedef MAP_MANAGER::ITERATOR MAP_ITERATOR; typedef MAP_MANAGER::ENTRY MAP_ENTRY; + /** * @class ACE_Name_Space_Map * @@ -277,4 +278,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOCAL_NAME_SPACE_T_H */ - diff --git a/dep/src/ace/Local_Tokens.cpp b/externals/ace/Local_Tokens.cpp similarity index 99% rename from dep/src/ace/Local_Tokens.cpp rename to externals/ace/Local_Tokens.cpp index 248f7dee9c0..b41c8c31dd0 100644 --- a/dep/src/ace/Local_Tokens.cpp +++ b/externals/ace/Local_Tokens.cpp @@ -12,6 +12,7 @@ #include "ace/Local_Tokens.inl" #endif /* __ACE_INLINE__ */ + ACE_RCSID (ace, Local_Tokens, "$Id: Local_Tokens.cpp 80826 2008-03-04 14:51:23Z wotte $") @@ -868,6 +869,7 @@ ACE_RW_Token::tryacquire (ACE_TPQ_Entry *caller) this->num_writers_--; } + errno = EWOULDBLOCK; ACE_RETURN (-1); @@ -984,6 +986,7 @@ ACE_RW_Token::notify_new_owner (ACE_TPQ_Entry *old_owner) this->owner ()->proxy ()->token_acquired (this->owner ()); } + int ACE_RW_Token::owners (OWNER_STACK &stack, const ACE_TCHAR *id) @@ -1618,4 +1621,3 @@ ACE_Local_WLock::clone (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/include/ace/Local_Tokens.h b/externals/ace/Local_Tokens.h similarity index 99% rename from dep/include/ace/Local_Tokens.h rename to externals/ace/Local_Tokens.h index 611643b7752..603d55626fb 100644 --- a/dep/include/ace/Local_Tokens.h +++ b/externals/ace/Local_Tokens.h @@ -4,7 +4,7 @@ /** * @file Local_Tokens.h * - * $Id: Local_Tokens.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Local_Tokens.h 84477 2009-02-16 13:30:38Z johnnyw $ * * @author Karl-Heinz Dorn * @author Douglas C. Schmidt @@ -223,7 +223,7 @@ public: /// Allows us to pass args to the construction of the TSS object. virtual ACE_TPQ_Entry *make_TSS_TYPE (void) const; - /// Operator overloading and inheritence don't mix. + /// Operator overloading and inheritance don't mix. operator ACE_TPQ_Entry *(void); /// Dump the state of the class. @@ -270,7 +270,7 @@ public: /// Destructor. ~ACE_TPQ_Iterator (void); - /// Pass back the . + /// Pass back the @a next_item. int next (ACE_TPQ_Entry *&next_item); /// Returns 1 when all items have been seen, else 0. @@ -1119,4 +1119,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* __ACE_INLINE__ */ #include /**/ "ace/post.h" #endif /* ACE_LOCAL_MUTEX_H */ - diff --git a/dep/include/ace/Local_Tokens.inl b/externals/ace/Local_Tokens.inl similarity index 99% rename from dep/include/ace/Local_Tokens.inl rename to externals/ace/Local_Tokens.inl index 3d59893f3cf..56b3cb764e2 100644 --- a/dep/include/ace/Local_Tokens.inl +++ b/externals/ace/Local_Tokens.inl @@ -264,6 +264,7 @@ ACE_Local_WLock::ACE_Local_WLock (const ACE_TCHAR *token_name, // ************************************************************ + ACE_INLINE void ACE_Token_Name::operator= (const ACE_Token_Name &rhs) { diff --git a/dep/src/ace/Lock.cpp b/externals/ace/Lock.cpp similarity index 99% rename from dep/src/ace/Lock.cpp rename to externals/ace/Lock.cpp index f3fd45f4b95..eae8c3bd8d0 100644 --- a/dep/src/ace/Lock.cpp +++ b/externals/ace/Lock.cpp @@ -86,4 +86,3 @@ ACE_Adaptive_Lock::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Lock.h b/externals/ace/Lock.h similarity index 99% rename from dep/include/ace/Lock.h rename to externals/ace/Lock.h index 8a2db49e3d0..36f99939b56 100644 --- a/dep/include/ace/Lock.h +++ b/externals/ace/Lock.h @@ -159,4 +159,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOCK_H */ - diff --git a/dep/include/ace/Lock.inl b/externals/ace/Lock.inl similarity index 100% rename from dep/include/ace/Lock.inl rename to externals/ace/Lock.inl diff --git a/dep/src/ace/Lock_Adapter_T.cpp b/externals/ace/Lock_Adapter_T.cpp similarity index 99% rename from dep/src/ace/Lock_Adapter_T.cpp rename to externals/ace/Lock_Adapter_T.cpp index c4685def246..fbe43afd217 100644 --- a/dep/src/ace/Lock_Adapter_T.cpp +++ b/externals/ace/Lock_Adapter_T.cpp @@ -115,4 +115,3 @@ ACE_Lock_Adapter::tryacquire_write_upgrade (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LOCK_ADAPTER_T_CPP */ - diff --git a/dep/include/ace/Lock_Adapter_T.h b/externals/ace/Lock_Adapter_T.h similarity index 96% rename from dep/include/ace/Lock_Adapter_T.h rename to externals/ace/Lock_Adapter_T.h index 1f0f4521dc5..2fe38302ed4 100644 --- a/dep/include/ace/Lock_Adapter_T.h +++ b/externals/ace/Lock_Adapter_T.h @@ -4,7 +4,7 @@ /** * @file Lock_Adapter_T.h * - * $Id: Lock_Adapter_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Lock_Adapter_T.h 84481 2009-02-17 10:58:31Z johnnyw $ * * Moved from Synch.h. * @@ -43,7 +43,7 @@ public: // = Initialization/Finalization methods. - /// Constructor. All locking requests will be forwarded to . + /// Constructor. All locking requests will be forwarded to @a lock. ACE_Lock_Adapter (ACE_LOCKING_MECHANISM &lock); /// Constructor. Since no lock is provided by the user, one will be @@ -121,4 +121,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOCK_ADAPTER_T_H */ - diff --git a/dep/include/ace/Lock_Adapter_T.inl b/externals/ace/Lock_Adapter_T.inl similarity index 100% rename from dep/include/ace/Lock_Adapter_T.inl rename to externals/ace/Lock_Adapter_T.inl diff --git a/dep/src/ace/Log_Msg.cpp b/externals/ace/Log_Msg.cpp similarity index 88% rename from dep/src/ace/Log_Msg.cpp rename to externals/ace/Log_Msg.cpp index 4040a4b1978..4a619ebca15 100644 --- a/dep/src/ace/Log_Msg.cpp +++ b/externals/ace/Log_Msg.cpp @@ -1,4 +1,4 @@ -// $Id: Log_Msg.cpp 82581 2008-08-11 08:58:24Z johnnyw $ +// $Id: Log_Msg.cpp 88331 2009-12-24 09:54:25Z johnnyw $ // We need this to get the status of ACE_NTRACE... #include "ace/config-all.h" @@ -17,6 +17,7 @@ #include "ace/OS_NS_sys_time.h" #include "ace/OS_NS_wchar.h" #include "ace/OS_NS_signal.h" +#include "ace/os_include/os_typeinfo.h" #if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0) # include "ace/Object_Manager_Base.h" @@ -44,20 +45,12 @@ #include "ace/Log_Msg.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, Log_Msg, "$Id: Log_Msg.cpp 82581 2008-08-11 08:58:24Z johnnyw $") +ACE_RCSID(ace, Log_Msg, "$Id: Log_Msg.cpp 88331 2009-12-24 09:54:25Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_Log_Msg) -// only used here... dhinton -#if defined (ACE_HAS_SYS_SIGLIST) -# if !defined (_sys_siglist) -# define _sys_siglist sys_siglist -# endif /* !defined (sys_siglist) */ -//extern char **_sys_siglist; -#endif /* ACE_HAS_SYS_SIGLIST */ - #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) bool ACE_Log_Msg::key_created_ = 0; # if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || \ @@ -137,7 +130,7 @@ public: #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) //FUZZ: disable check_for_lack_ACE_OS - static void close (void); + static void close (void) ACE_GCC_DESTRUCTOR_ATTRIBUTE; //FUZZ: enable check_for_lack_ACE_OS static ACE_Recursive_Thread_Mutex *get_lock (void); @@ -263,7 +256,7 @@ ACE_TSS_CLEANUP_NAME (void *ptr) if (log_msg->thr_desc()!=0) log_msg->thr_desc()->log_msg_cleanup(log_msg); else - delete (ACE_Log_Msg *) ptr; + delete log_msg; } # endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ #endif /* ! ACE_MT_SAFE */ @@ -398,7 +391,9 @@ ACE_Log_Msg::instance (void) { ACE_NEW_RETURN (log_msg_cleanup, ACE_Msg_Log_Cleanup, 0); // Register the instance for destruction at program termination. - ACE_Object_Manager::at_exit (log_msg_cleanup); + ACE_Object_Manager::at_exit (log_msg_cleanup, + 0, + typeid (*log_msg_cleanup).name ()); } return &log_msg_cleanup->object (); @@ -650,11 +645,11 @@ ACE_Log_Msg::ACE_Log_Msg (void) msg_ (0), restart_ (1), // Restart by default... ostream_ (0), + ostream_refcount_ (0), msg_callback_ (0), trace_depth_ (0), trace_active_ (false), tracing_enabled_ (true), // On by default? - delete_ostream_(false), thr_desc_ (0), priority_mask_ (default_priority_mask_), timestamp_ (0) @@ -743,24 +738,30 @@ ACE_Log_Msg::~ACE_Log_Msg (void) } } - // - // do we need to close and clean up? - // - if (this->delete_ostream_) -#if defined (ACE_LACKS_IOSTREAM_TOTALLY) - { - ACE_OS::fclose (this->ostream_); - } -#else - { - delete ostream_; - ostream_ = 0; - } -#endif + this->cleanup_ostream (); delete[] this->msg_; } +void +ACE_Log_Msg::cleanup_ostream () +{ + if (this->ostream_refcount_) + { + if (--*this->ostream_refcount_ == 0) + { + delete this->ostream_refcount_; +#if defined (ACE_LACKS_IOSTREAM_TOTALLY) + ACE_OS::fclose (this->ostream_); +#else + delete this->ostream_; + this->ostream_ = 0; +#endif + } + this->ostream_refcount_ = 0; + } +} + // Open the sender-side of the message queue. int @@ -913,7 +914,8 @@ ACE_Log_Msg::open (const ACE_TCHAR *prog_name, * '@': print a void* pointer (in hexadecimal) * 'r': call the function pointed to by the corresponding argument * 'R': print return status - * 'S': format the appropriate _sys_siglist entry corresponding to var-argument. + * 'S': print out the appropriate signal message corresponding + * to var-argument, e.g., as done by strsignal() * 's': format a character string * 'T': print timestamp in hour:minute:sec:usec format. * 'D': print timestamp in month/day/year hour:minute:sec:usec format. @@ -1016,7 +1018,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // bp is pointer to where to put next part of logged message. // bspace is the number of characters remaining in msg_. ACE_TCHAR *bp = const_cast (this->msg ()); - size_t bspace = ACE_Log_Record::MAXLOGMSGLEN; // Leave room for Nul term. + size_t bspace = ACE_MAXLOGMSGLEN; // Leave room for Nul term. if (this->msg_off_ <= ACE_Log_Record::MAXLOGMSGLEN) bspace -= static_cast (this->msg_off_); @@ -1163,7 +1165,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, case 'A': // ACE_timer_t { ACE_OS::strcpy (fp, ACE_TEXT ("f")); - double value = va_arg (argp, double); + double const value = va_arg (argp, double); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, value); else @@ -1262,16 +1264,20 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ACE_OS::strcpy (fp, ACE_TEXT ("ls: %ls")); + wchar_t *str = va_arg (argp, wchar_t *); #else ACE_OS::strcpy (fp, ACE_TEXT ("s: %s")); + ACE_TCHAR *str = va_arg (argp, ACE_TCHAR *); #endif if (can_check) this_len = ACE_OS::snprintf - (bp, bspace, format, va_arg (argp, ACE_TCHAR *), + (bp, bspace, format, + str ? str : ACE_TEXT ("(null)"), ACE_TEXT_CHAR_TO_TCHAR (msg)); else this_len = ACE_OS::sprintf - (bp, format, va_arg (argp, ACE_TCHAR *), + (bp, format, + str ? str : ACE_TEXT ("(null)"), ACE_TEXT_CHAR_TO_TCHAR (msg)); #if defined (ACE_WIN32) } @@ -1302,6 +1308,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // it into a string. If this doesn't work it // returns "unknown error" which is fine for // our purposes. + ACE_TCHAR *str = va_arg (argp, ACE_TCHAR *); if (lpMsgBuf == 0) { const ACE_TCHAR *message = @@ -1310,12 +1317,12 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, - va_arg (argp, const ACE_TCHAR *), + str ? str : ACE_TEXT ("(null)"), message); else this_len = ACE_OS::sprintf (bp, format, - va_arg (argp, const ACE_TCHAR *), + str ? str : ACE_TEXT ("(null)"), message); } else @@ -1324,12 +1331,12 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, - va_arg (argp, ACE_TCHAR *), + str ? str : ACE_TEXT ("(null)"), lpMsgBuf); else this_len = ACE_OS::sprintf (bp, format, - va_arg (argp, ACE_TCHAR *), + str ? str : ACE_TEXT ("(null)"), lpMsgBuf); // Free the buffer. ::LocalFree (lpMsgBuf); @@ -1341,27 +1348,133 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, } case 'M': // Print the name of the priority of the message. -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); + + // Look at the format precision specifier. .1 is interpreted + // as a single character printout, otherwise we print the name of + // the priority. + + // So, did we find a .1 specifier? Do we need to override it? + if (format[1] == ACE_TEXT('.') && + format[2] == ACE_TEXT('1')) + { + // Yup. + // Print a single character signifying the severity of the message + fp = format; + fp++; + +# if defined (ACE_USES_WCHAR) + +# if defined (ACE_WIN32) // Windows uses 'c' for a wide character + ACE_OS::strcpy (fp, ACE_TEXT ("c")); +# else // Other platforms behave differently +# if defined (HPUX) // HP-Unix compatible + ACE_OS::strcpy (fp, ACE_TEXT ("C")); +# else // Other + ACE_OS::strcpy (fp, ACE_TEXT ("lc")); +# endif /* HPUX */ +# endif + +# else /* ACE_USES_WCHAR */ + + // Non-unicode builds simply use a standard character format specifier + ACE_OS::strcpy (fp, ACE_TEXT ("c")); + +# endif /* ACE_USES_WCHAR */ + + // Below is an optimized (binary search based) + // version of the following simple piece of code: + // + // log_priority == LM_SHUTDOWN ? 'S' : // Shutdown + // log_priority == LM_TRACE ? 'T' : // Trace + // log_priority == LM_DEBUG ? 'D' : // Debug + // log_priority == LM_INFO ? 'I' : // Info + // log_priority == LM_NOTICE ? 'N' : // Notice + // log_priority == LM_WARNING ? 'W' : // Warning + // log_priority == LM_STARTUP ? 'U' : // Startup + // log_priority == LM_ERROR ? 'E' : // Error + // log_priority == LM_CRITICAL ? 'C' : // Critical + // log_priority == LM_ALERT ? 'A' : // Alert + // log_priority == LM_EMERGENCY ? '!' : // Emergency + // '?' // Unknown + + if (can_check) + { + this_len = ACE_OS::snprintf + (bp, bspace, format, +#if !defined (ACE_USES_WCHAR) || defined (ACE_WIN32) + (int) #else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); + (wint_t) #endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - ACE_Log_Record::priority_name (log_priority)); + (log_priority <= LM_WARNING) ? + (log_priority <= LM_DEBUG) ? + (log_priority <= LM_TRACE) ? + (log_priority == LM_SHUTDOWN) ? + ACE_TEXT('S') : ACE_TEXT('T') : ACE_TEXT('D') : + (log_priority <= LM_NOTICE) ? + (log_priority == LM_INFO) ? + ACE_TEXT('I') : ACE_TEXT('N') : ACE_TEXT('W') : + (log_priority <= LM_CRITICAL) ? + (log_priority <= LM_ERROR) ? + (log_priority == LM_STARTUP) ? + ACE_TEXT('U') : ACE_TEXT('E') : ACE_TEXT('C') : + (log_priority <= LM_EMERGENCY) ? + (log_priority == LM_ALERT) ? + ACE_TEXT('A') : ACE_TEXT('!') : ACE_TEXT('?')); + } + else + { + this_len = ACE_OS::sprintf + (bp, format, +#if !defined (ACE_USES_WCHAR) || defined (ACE_WIN32) + (int) +#else + (wint_t) +#endif + (log_priority <= LM_WARNING) ? + (log_priority <= LM_DEBUG) ? + (log_priority <= LM_TRACE) ? + (log_priority == LM_SHUTDOWN) ? + ACE_TEXT('S') : ACE_TEXT('T') : ACE_TEXT('D') : + (log_priority <= LM_NOTICE) ? + (log_priority == LM_INFO) ? + ACE_TEXT('I') : ACE_TEXT('N') : ACE_TEXT('W') : + (log_priority <= LM_CRITICAL) ? + (log_priority <= LM_ERROR) ? + (log_priority == LM_STARTUP) ? + ACE_TEXT('U') : ACE_TEXT('E') : ACE_TEXT('C') : + (log_priority <= LM_EMERGENCY) ? + (log_priority == LM_ALERT) ? + ACE_TEXT('A') : ACE_TEXT('!') : ACE_TEXT('?')); + } + + ACE_UPDATE_COUNT (bspace, this_len); + } else - this_len = ACE_OS::sprintf - (bp, format, - ACE_Log_Record::priority_name (log_priority)); - ACE_UPDATE_COUNT (bspace, this_len); + { + // Nope, print out standard priority_name() string + +#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_OS::strcpy (fp, ACE_TEXT ("ls")); +#else + ACE_OS::strcpy (fp, ACE_TEXT ("s")); +#endif + if (can_check) + this_len = ACE_OS::snprintf + (bp, bspace, format, + ACE_Log_Record::priority_name (log_priority)); + else + this_len = ACE_OS::sprintf + (bp, format, + ACE_Log_Record::priority_name (log_priority)); + ACE_UPDATE_COUNT (bspace, this_len); + } break; case 'm': // Format the string assocated with the errno value. { errno = 0; - char *msg = 0; - msg = ACE_OS::strerror (ACE::map_errno (this->errnum ())); + char *msg = ACE_OS::strerror (ACE::map_errno (this->errnum ())); // Windows can try to translate the errnum using // system calls if strerror() doesn't get anything useful. #if defined (ACE_WIN32) @@ -1520,36 +1633,14 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, case 'S': // format the string for with this signal number. { - int sig = va_arg (argp, int); -#if defined (ACE_HAS_SYS_SIGLIST) - if (sig >= 0 && sig < ACE_NSIG) - { - ACE_OS::strcpy (fp, ACE_TEXT ("s")); - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, _sys_siglist[sig]); - else - this_len = ACE_OS::sprintf - (bp, format, _sys_siglist[sig]); - } - else - { - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, - ACE_TEXT(" %d"), sig); - else - this_len = ACE_OS::sprintf - (bp, ACE_TEXT (" %d"), sig); - } -#else + const int sig = va_arg (argp, int); + ACE_OS::strcpy (fp, ACE_TEXT ("s")); if (can_check) this_len = ACE_OS::snprintf - (bp, bspace, ACE_TEXT ("signal %d"), sig); + (bp, bspace, format, ACE_OS::strsignal(sig)); else this_len = ACE_OS::sprintf - (bp, ACE_TEXT ("signal %d"), sig); -#endif /* ACE_HAS_SYS_SIGLIST */ + (bp, format, ACE_OS::strsignal(sig)); ACE_UPDATE_COUNT (bspace, this_len); break; } @@ -1558,8 +1649,19 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // Weekday Month day year hour:minute:sec.usec { ACE_TCHAR day_and_time[35]; - ACE::timestamp (day_and_time, - sizeof day_and_time / sizeof (ACE_TCHAR)); + // Did we find the flag indicating a time value argument + if (format[1] == ACE_TEXT('#')) + { + ACE_Time_Value* time_value = va_arg (argp, ACE_Time_Value*); + ACE::timestamp (*time_value, + day_and_time, + sizeof day_and_time / sizeof (ACE_TCHAR)); + } + else + { + ACE::timestamp (day_and_time, + sizeof day_and_time / sizeof (ACE_TCHAR)); + } #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ACE_OS::strcpy (fp, ACE_TEXT ("ls")); #else @@ -1583,14 +1685,33 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, #else ACE_OS::strcpy (fp, ACE_TEXT ("s")); #endif - if (can_check) - this_len = ACE_OS::snprintf - (bp, bspace, format, - ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR))); + // Did we find the flag indicating a time value argument + if (format[1] == ACE_TEXT('#')) + { + ACE_Time_Value* time_value = va_arg (argp, ACE_Time_Value*); + if (can_check) + this_len = ACE_OS::snprintf + (bp, bspace, format, + ACE::timestamp (*time_value, + day_and_time, + sizeof day_and_time / sizeof (ACE_TCHAR))); + else + this_len = ACE_OS::sprintf + (bp, format, ACE::timestamp (*time_value, + day_and_time, + sizeof day_and_time / sizeof (ACE_TCHAR))); + } else - this_len = ACE_OS::sprintf - (bp, format, ACE::timestamp (day_and_time, - sizeof day_and_time / sizeof (ACE_TCHAR))); + { + if (can_check) + this_len = ACE_OS::snprintf + (bp, bspace, format, + ACE::timestamp (day_and_time, sizeof day_and_time / sizeof (ACE_TCHAR))); + else + this_len = ACE_OS::sprintf + (bp, format, ACE::timestamp (day_and_time, + sizeof day_and_time / sizeof (ACE_TCHAR))); + } ACE_UPDATE_COUNT (bspace, this_len); break; } @@ -2005,6 +2126,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; } + default: // So, it's not a legit format specifier after all... // Copy from the original % to where we are now, then @@ -2174,6 +2296,7 @@ ACE_Log_Msg::log (ACE_Log_Record &log_record, ACE_MT (ACE_Log_Msg_Manager::init_backend ()); } + if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::LOGGER) || ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SYSLOG)) { @@ -2223,7 +2346,7 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, return 0; ACE_TCHAR* buf = 0; - const size_t buf_sz = + size_t const buf_sz = ACE_Log_Record::MAXLOGMSGLEN - ACE_Log_Record::VERBOSE_LEN - 58; ACE_NEW_RETURN (buf, ACE_TCHAR[buf_sz], -1); @@ -2242,7 +2365,11 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, if (text) sz = ACE_OS::sprintf (msg_buf, +#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_TEXT ("%ls - "), +#else ACE_TEXT ("%s - "), +#endif text); sz += ACE_OS::sprintf (msg_buf + sz, @@ -2270,20 +2397,20 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, } void -ACE_Log_Msg::set (const char *filename, +ACE_Log_Msg::set (const char *file, int line, - int status, - int err, - int rs, + int op_status, + int errnum, + bool restart, ACE_OSTREAM_TYPE *os, ACE_Log_Msg_Callback *c) { ACE_TRACE ("ACE_Log_Msg::set"); - this->file (filename); + this->file (file); this->linenum (line); - this->op_status (status); - this->errnum (err); - this->restart (rs); + this->op_status (op_status); + this->errnum (errnum); + this->restart (restart); this->msg_ostream (os); this->msg_callback (c); } @@ -2409,18 +2536,32 @@ void ACE_Log_Msg::msg_ostream (ACE_OSTREAM_TYPE *m, bool delete_ostream) { if (this->ostream_ == m) - return; - - if (this->delete_ostream_) { -#if defined (ACE_LACKS_IOSTREAM_TOTALLY) - ACE_OS::fclose (this->ostream_); -#else - delete this->ostream_; -#endif + // Same stream, allow user to change the delete_ostream "flag" + if (delete_ostream && !this->ostream_refcount_) + { + ACE_NEW (this->ostream_refcount_, Atomic_ULong (1)); + } + else if (!delete_ostream && this->ostream_refcount_) + { + if (--*this->ostream_refcount_ == 0) + { + delete this->ostream_refcount_; + } + this->ostream_refcount_ = 0; + } + // The other two cases are no-ops, the user has requested the same + // state that's already present. + return; + } + + this->cleanup_ostream (); + + if (delete_ostream) + { + ACE_NEW (this->ostream_refcount_, Atomic_ULong (1)); } - this->delete_ostream_ = delete_ostream; this->ostream_ = m; } @@ -2474,6 +2615,15 @@ ACE_Log_Msg::init_hook (ACE_OS_Log_Msg_Attributes &attributes { ACE_Log_Msg *inherit_log = ACE_LOG_MSG; attributes.ostream_ = inherit_log->msg_ostream (); + if (attributes.ostream_ && inherit_log->ostream_refcount_) + { + ++*inherit_log->ostream_refcount_; + attributes.ostream_refcount_ = inherit_log->ostream_refcount_; + } + else + { + attributes.ostream_refcount_ = 0; + } attributes.priority_mask_ = inherit_log->priority_mask (); attributes.tracing_enabled_ = inherit_log->tracing_enabled (); attributes.restart_ = inherit_log->restart (); @@ -2498,7 +2648,10 @@ ACE_Log_Msg::inherit_hook (ACE_OS_Thread_Descriptor *thr_desc, if (attributes.ostream_) { - new_log->msg_ostream (attributes.ostream_); + new_log->ostream_ = attributes.ostream_; + new_log->ostream_refcount_ = + static_cast (attributes.ostream_refcount_); + new_log->priority_mask (attributes.priority_mask_); if (attributes.tracing_enabled_) @@ -2521,4 +2674,3 @@ ACE_Log_Msg::inherit_hook (ACE_OS_Thread_Descriptor *thr_desc, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Log_Msg.h b/externals/ace/Log_Msg.h similarity index 91% rename from dep/include/ace/Log_Msg.h rename to externals/ace/Log_Msg.h index 3c5eb5e2f23..5f9c346d897 100644 --- a/dep/include/ace/Log_Msg.h +++ b/externals/ace/Log_Msg.h @@ -4,7 +4,7 @@ /** * @file Log_Msg.h * - * $Id: Log_Msg.h 82511 2008-08-05 16:52:44Z shuston $ + * $Id: Log_Msg.h 88331 2009-12-24 09:54:25Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -24,24 +24,40 @@ #include "ace/Default_Constants.h" #include "ace/Log_Priority.h" #include "ace/os_include/os_limits.h" +#include "ace/Atomic_Op.h" +#include "ace/Synch_Traits.h" // The ACE_ASSERT macro used to be defined here, include ace/Assert.h // for backwards compatibility. #include "ace/Assert.h" #if defined (ACE_NLOGGING) -#define ACE_HEX_DUMP(X) do {} while (0) -#define ACE_RETURN(Y) do { return (Y); } while (0) -#define ACE_ERROR_RETURN(X, Y) return (Y) -#define ACE_ERROR_BREAK(X) { break; } -#define ACE_ERROR(X) do {} while (0) -#define ACE_DEBUG(X) do {} while (0) -#define ACE_ERROR_INIT(VALUE, FLAGS) +#if !defined (ACE_HEX_DUMP) +# define ACE_HEX_DUMP(X) do {} while (0) +#endif +#if !defined (ACE_RETURN) +# define ACE_RETURN(Y) do { return (Y); } while (0) +#endif +#if !defined (ACE_ERROR_RETURN) +# define ACE_ERROR_RETURN(X, Y) return (Y) +#endif +#if !defined (ACE_ERROR_BREAK) +# define ACE_ERROR_BREAK(X) { break; } +#endif +#if !defined (ACE_ERROR) +# define ACE_ERROR(X) do {} while (0) +#endif +#if !defined (ACE_DEBUG) +# define ACE_DEBUG(X) do {} while (0) +#endif +#if !defined (ACE_ERROR_INIT) +# define ACE_ERROR_INIT(VALUE, FLAGS) +#endif #else #if !defined (ACE_HEX_DUMP) #define ACE_HEX_DUMP(X) \ do { \ - int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + int const __ace_error = ACE_Log_Msg::last_error_adapter (); \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \ ace___->log_hexdump X; \ @@ -50,7 +66,7 @@ #if !defined (ACE_RETURN) #define ACE_RETURN(Y) \ do { \ - int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + int const __ace_error = ACE_Log_Msg::last_error_adapter (); \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->set (__FILE__, __LINE__, Y, __ace_error, ace___->restart (), \ ace___->msg_ostream (), ace___->msg_callback ()); \ @@ -60,7 +76,7 @@ #if !defined (ACE_ERROR_RETURN) #define ACE_ERROR_RETURN(X, Y) \ do { \ - int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + int const __ace_error = ACE_Log_Msg::last_error_adapter (); \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->conditional_set (__FILE__, __LINE__, Y, __ace_error); \ ace___->log X; \ @@ -70,7 +86,7 @@ #if !defined (ACE_ERROR) #define ACE_ERROR(X) \ do { \ - int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + int const __ace_error = ACE_Log_Msg::last_error_adapter (); \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->conditional_set (__FILE__, __LINE__, -1, __ace_error); \ ace___->log X; \ @@ -79,7 +95,7 @@ #if !defined (ACE_DEBUG) #define ACE_DEBUG(X) \ do { \ - int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + int const __ace_error = ACE_Log_Msg::last_error_adapter (); \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \ ace___->log X; \ @@ -89,7 +105,8 @@ #define ACE_ERROR_INIT(VALUE, FLAGS) \ do { \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ - ace___->set_flags (FLAGS); ace___->op_status (VALUE); \ + ace___->set_flags (FLAGS); \ + ace___->op_status (VALUE); \ } while (0) #endif #if !defined (ACE_ERROR_BREAK) @@ -315,11 +332,11 @@ public: /// Set the field that indicates whether interrupted calls should be /// restarted. - void restart (int); + void restart (bool r); /// Get the field that indicates whether interrupted calls should be /// restarted. - int restart (void) const; + bool restart (void) const; // = Notice that the following two function is equivalent to // "void msg_ostream (HANDLE)" and "HANDLE msg_ostream (void)" @@ -469,7 +486,7 @@ public: int line, int op_status = -1, int errnum = 0, - int restart = 1, + bool restart = true, ACE_OSTREAM_TYPE *os = 0, ACE_Log_Msg_Callback *c = 0); @@ -509,11 +526,16 @@ public: * - '@': print a void* pointer (in hexadecimal) * - 'r': call the function pointed to by the corresponding argument * - 'R': print return status - * - 'S': print out the appropriate _sys_siglist entry corresponding - * to var-argument. + * - 'S': print out the appropriate signal message corresponding + * to var-argument, e.g., as done by strsignal() * - 's': prints a ACE_TCHAR* character string (also see C and W) - * - 'T': print timestamp in hour:minute:sec:usec format. + * - 'T': print timestamp in hour:minute:sec:usec format (plain option, + * i.e. without any flags, prints system supplied timestamp; + * with '#' flag added expects ACE_Time_Value* in argument list) * - 'D': print timestamp as Weekday Month day year hour:minute:sec.usec + * (plain option, i.e. without any flags, prints system supplied + * timestamp; with '#' flag added expects ACE_Time_Value* in + * argument list) * - 't': print thread id (1 if single-threaded) * - 'u': print as unsigned int * - 'w': prints a wide character @@ -583,6 +605,8 @@ public: ACE_ALLOC_HOOK_DECLARE; private: + void cleanup_ostream (); + /// Status of operation (-1 means failure, >= 0 means success). int status_; @@ -602,11 +626,20 @@ private: /// Indicates whether we should restart system calls that are /// interrupted. - int restart_; + bool restart_; /// The ostream where logging messages can be written. ACE_OSTREAM_TYPE *ostream_; + /// This pointer is 0 if we are not reference counting (the user has not + /// passed "true" for the delete_ostream argument to msg_ostream). + /// If we are reference counting, this points to a shared count that will + /// be deleted when it reaches zero. Since we want optional but shared + /// ownership neither std::auto_ptr nor ACE_Strong_Bound_Ptr have the right + /// semantics. *Bound_Ptr also doesn't take advantage of Atomic_Op. + typedef ACE_Atomic_Op Atomic_ULong; + Atomic_ULong *ostream_refcount_; + /// The callback object. ACE_Log_Msg_Callback *msg_callback_; @@ -619,9 +652,6 @@ private: /// Are we allowing tracing in this thread? bool tracing_enabled_; - /// Are we deleting this ostream? - bool delete_ostream_; - /** * If we're running in the context of an ACE_Thread_Manager this * will point to the thread descriptor adapter which holds the @@ -728,6 +758,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define ACE_TSS_CLEANUP_NAME ACE_TSS_cleanup #endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ + LOCAL_EXTERN_PREFIX void ACE_TSS_CLEANUP_NAME (void *ptr); @@ -744,4 +775,3 @@ ACE_TSS_CLEANUP_NAME (void *ptr); #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_H */ - diff --git a/dep/include/ace/Log_Msg.inl b/externals/ace/Log_Msg.inl similarity index 97% rename from dep/include/ace/Log_Msg.inl rename to externals/ace/Log_Msg.inl index e69b59140c7..bb5290331bb 100644 --- a/dep/include/ace/Log_Msg.inl +++ b/externals/ace/Log_Msg.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Log_Msg.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Log_Msg.inl 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" @@ -41,13 +41,13 @@ ACE_Log_Msg::op_status (void) const ACE_INLINE void -ACE_Log_Msg::restart (int r) +ACE_Log_Msg::restart (bool r) { this->restart_ = r; } ACE_INLINE -int +bool ACE_Log_Msg::restart (void) const { return this->restart_; @@ -229,5 +229,7 @@ ACE_Log_Msg::getpid (void) const return ACE_Log_Msg::pid_; } + + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Log_Msg_Backend.cpp b/externals/ace/Log_Msg_Backend.cpp similarity index 100% rename from dep/src/ace/Log_Msg_Backend.cpp rename to externals/ace/Log_Msg_Backend.cpp index 8f7e930ae0d..1d739471fa9 100644 --- a/dep/src/ace/Log_Msg_Backend.cpp +++ b/externals/ace/Log_Msg_Backend.cpp @@ -4,6 +4,7 @@ ACE_RCSID(ace, Log_Msg_Backend, "$Id: Log_Msg_Backend.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Log_Msg_Backend::~ACE_Log_Msg_Backend (void) @@ -11,4 +12,3 @@ ACE_Log_Msg_Backend::~ACE_Log_Msg_Backend (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Log_Msg_Backend.h b/externals/ace/Log_Msg_Backend.h similarity index 100% rename from dep/include/ace/Log_Msg_Backend.h rename to externals/ace/Log_Msg_Backend.h index 84e4956f36b..ba3dba1c948 100644 --- a/dep/include/ace/Log_Msg_Backend.h +++ b/externals/ace/Log_Msg_Backend.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_LOG_MSG_BACKEND_H #define ACE_LOG_MSG_BACKEND_H #include /**/ "ace/pre.h" @@ -85,4 +86,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_BACKEND_H */ - diff --git a/dep/src/ace/Log_Msg_Callback.cpp b/externals/ace/Log_Msg_Callback.cpp similarity index 100% rename from dep/src/ace/Log_Msg_Callback.cpp rename to externals/ace/Log_Msg_Callback.cpp index 7d1a57d5f4a..b38113d24ba 100644 --- a/dep/src/ace/Log_Msg_Callback.cpp +++ b/externals/ace/Log_Msg_Callback.cpp @@ -4,10 +4,10 @@ ACE_RCSID(ace, Log_Msg_Callback, "$Id: Log_Msg_Callback.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Log_Msg_Callback::~ACE_Log_Msg_Callback (void) { } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Log_Msg_Callback.h b/externals/ace/Log_Msg_Callback.h similarity index 99% rename from dep/include/ace/Log_Msg_Callback.h rename to externals/ace/Log_Msg_Callback.h index 4a3f6f77495..f743987b472 100644 --- a/dep/include/ace/Log_Msg_Callback.h +++ b/externals/ace/Log_Msg_Callback.h @@ -67,4 +67,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_CALLBACK_H */ - diff --git a/dep/src/ace/Log_Msg_IPC.cpp b/externals/ace/Log_Msg_IPC.cpp similarity index 86% rename from dep/src/ace/Log_Msg_IPC.cpp rename to externals/ace/Log_Msg_IPC.cpp index 7c61ac45979..830ebdfccb8 100644 --- a/dep/src/ace/Log_Msg_IPC.cpp +++ b/externals/ace/Log_Msg_IPC.cpp @@ -1,11 +1,11 @@ -// $Id: Log_Msg_IPC.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Log_Msg_IPC.cpp 84527 2009-02-19 14:01:42Z johnnyw $ #include "ace/Log_Msg_IPC.h" #include "ace/Log_Record.h" #include "ace/CDR_Stream.h" #include "ace/Truncate.h" -ACE_RCSID(ace, Log_Msg_IPC, "$Id: Log_Msg_IPC.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Log_Msg_IPC, "$Id: Log_Msg_IPC.cpp 84527 2009-02-19 14:01:42Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -64,21 +64,24 @@ ACE_Log_Msg_IPC::log (ACE_Log_Record &log_record) // Insert contents of into payload stream. ACE_OutputCDR payload (max_payload_size); - payload << log_record; + if (!(payload << log_record)) + return -1; // Get the number of bytes used by the CDR stream. If it becomes desireable // to support payloads more than 4GB, this field will need to be changed // to a 64-bit value. - ACE_CDR::ULong length = + ACE_CDR::ULong const length = ACE_Utils::truncate_cast (payload.total_length ()); // Send a header so the receiver can determine the byte order and // size of the incoming CDR stream. ACE_OutputCDR header (ACE_CDR::MAX_ALIGNMENT + 8); - header << ACE_OutputCDR::from_boolean (ACE_CDR_BYTE_ORDER); + if (!(header << ACE_OutputCDR::from_boolean (ACE_CDR_BYTE_ORDER))) + return -1; // Store the size of the payload that follows - header << ACE_CDR::ULong (length); + if (!(header << ACE_CDR::ULong (length))) + return -1; // Use an iovec to send both buffer and payload simultaneously. iovec iov[2]; @@ -87,7 +90,7 @@ ACE_Log_Msg_IPC::log (ACE_Log_Record &log_record) iov[1].iov_base = payload.begin ()->rd_ptr (); iov[1].iov_len = length; -#if defined (ACE_HAS_STREAM_PIPES) +#if (ACE_HAS_STREAM_LOG_MSG_IPC == 1) // Use the API if supported to ensure correct message // queueing according to priority. @@ -105,8 +108,7 @@ ACE_Log_Msg_IPC::log (ACE_Log_Record &log_record) // We're running over sockets, so send header and payload // efficiently using "gather-write". return this->message_queue_.sendv_n (iov, 2); -#endif /* ACE_HAS_STREAM_PIPES */ +#endif /* ACE_HAS_STREAM_LOG_MSG_IPC */ } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Log_Msg_IPC.h b/externals/ace/Log_Msg_IPC.h similarity index 94% rename from dep/include/ace/Log_Msg_IPC.h rename to externals/ace/Log_Msg_IPC.h index 09c975b1c73..958eae27648 100644 --- a/dep/include/ace/Log_Msg_IPC.h +++ b/externals/ace/Log_Msg_IPC.h @@ -4,7 +4,7 @@ /** * @file Log_Msg_IPC.h * - * $Id: Log_Msg_IPC.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Log_Msg_IPC.h 84536 2009-02-20 09:28:48Z johnnyw $ * * @author Carlos O'Ryan */ @@ -20,10 +20,12 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Default_Constants.h" + // IPC conduit between sender and client daemon. This should be // included in the ACE_Log_Msg class, but due to "order of include" // problems it can't be... -#if defined (ACE_HAS_STREAM_PIPES) +#if (ACE_HAS_STREAM_LOG_MSG_IPC == 1) # include "ace/SPIPE_Connector.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL typedef ACE_SPIPE_Stream ACE_LOG_MSG_IPC_STREAM; @@ -77,4 +79,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_H */ - diff --git a/dep/src/ace/Log_Msg_NT_Event_Log.cpp b/externals/ace/Log_Msg_NT_Event_Log.cpp similarity index 90% rename from dep/src/ace/Log_Msg_NT_Event_Log.cpp rename to externals/ace/Log_Msg_NT_Event_Log.cpp index c895373c95d..5835c7243c1 100644 --- a/dep/src/ace/Log_Msg_NT_Event_Log.cpp +++ b/externals/ace/Log_Msg_NT_Event_Log.cpp @@ -1,4 +1,4 @@ -// $Id: Log_Msg_NT_Event_Log.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Log_Msg_NT_Event_Log.cpp 87683 2009-11-20 18:14:36Z schmidt $ #include "ace/config-all.h" @@ -10,7 +10,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" -ACE_RCSID(ace, Log_Msg_NT_Event_Log, "$Id: Log_Msg_NT_Event_Log.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Log_Msg_NT_Event_Log, "$Id: Log_Msg_NT_Event_Log.cpp 87683 2009-11-20 18:14:36Z schmidt $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -106,11 +106,16 @@ ACE_Log_Msg_NT_Event_Log::log (ACE_Log_Record &log_record) // CR-LF. Newline characters on their own do not appear correctly in // the event viewer. We allow for a doubling in the size of the msg // data for the worst case of all newlines. - const ACE_TCHAR* src_msg_data = log_record.msg_data (); - ACE_TCHAR msg_data [ACE_Log_Record::MAXLOGMSGLEN * 2]; + const ACE_TCHAR *src_msg_data = log_record.msg_data (); + ACE_TCHAR msg_data [(ACE_Log_Record::MAXLOGMSGLEN * 2) + 1]; + size_t maxlen = ACE_Log_Record::MAXLOGMSGLEN; + if (ACE_Log_Record::MAXLOGMSGLEN > log_record.msg_data_len ()) + maxlen = log_record.msg_data_len (); + + size_t end = 0; for (size_t i = 0, j = 0; - i < log_record.msg_data_len (); + i < maxlen; ++i) { if (src_msg_data[i] == '\n') @@ -120,7 +125,10 @@ ACE_Log_Msg_NT_Event_Log::log (ACE_Log_Record &log_record) } else msg_data[j++] = src_msg_data[i]; + + end = j; } + msg_data[end] = '\0'; // Map the ACE log record type to an event log type. WORD event_type; @@ -160,4 +168,3 @@ ACE_Log_Msg_NT_Event_Log::log (ACE_Log_Record &log_record) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_LOG_MSG_NT_EVENT_LOG */ - diff --git a/dep/include/ace/Log_Msg_NT_Event_Log.h b/externals/ace/Log_Msg_NT_Event_Log.h similarity index 99% rename from dep/include/ace/Log_Msg_NT_Event_Log.h rename to externals/ace/Log_Msg_NT_Event_Log.h index 66920903ab6..777f8e97f9a 100644 --- a/dep/include/ace/Log_Msg_NT_Event_Log.h +++ b/externals/ace/Log_Msg_NT_Event_Log.h @@ -70,4 +70,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_NT_EVENT_LOG_H */ - diff --git a/dep/src/ace/Log_Msg_UNIX_Syslog.cpp b/externals/ace/Log_Msg_UNIX_Syslog.cpp similarity index 99% rename from dep/src/ace/Log_Msg_UNIX_Syslog.cpp rename to externals/ace/Log_Msg_UNIX_Syslog.cpp index 715886cef18..50e78754653 100644 --- a/dep/src/ace/Log_Msg_UNIX_Syslog.cpp +++ b/externals/ace/Log_Msg_UNIX_Syslog.cpp @@ -205,4 +205,3 @@ ACE_Log_Msg_UNIX_Syslog::convert_log_mask (int lm_mask) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_LACKS_UNIX_SYSLOG */ - diff --git a/dep/include/ace/Log_Msg_UNIX_Syslog.h b/externals/ace/Log_Msg_UNIX_Syslog.h similarity index 99% rename from dep/include/ace/Log_Msg_UNIX_Syslog.h rename to externals/ace/Log_Msg_UNIX_Syslog.h index c781d6ab3e1..3c762e8daa9 100644 --- a/dep/include/ace/Log_Msg_UNIX_Syslog.h +++ b/externals/ace/Log_Msg_UNIX_Syslog.h @@ -74,4 +74,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_MSG_UNIX_SYSLOG_H */ - diff --git a/dep/include/ace/Log_Priority.h b/externals/ace/Log_Priority.h similarity index 99% rename from dep/include/ace/Log_Priority.h rename to externals/ace/Log_Priority.h index 6abffaa0756..3801ef39857 100644 --- a/dep/include/ace/Log_Priority.h +++ b/externals/ace/Log_Priority.h @@ -83,4 +83,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_PRIORITY_H */ - diff --git a/dep/src/ace/Log_Record.cpp b/externals/ace/Log_Record.cpp similarity index 99% rename from dep/src/ace/Log_Record.cpp rename to externals/ace/Log_Record.cpp index 8142dad0d1d..f3ea5d6591c 100644 --- a/dep/src/ace/Log_Record.cpp +++ b/externals/ace/Log_Record.cpp @@ -410,4 +410,3 @@ ACE_Log_Record::print (const ACE_TCHAR host_name[], #endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Log_Record.h b/externals/ace/Log_Record.h similarity index 92% rename from dep/include/ace/Log_Record.h rename to externals/ace/Log_Record.h index 0a19e1f57c4..c7161581a7a 100644 --- a/dep/include/ace/Log_Record.h +++ b/externals/ace/Log_Record.h @@ -4,7 +4,7 @@ /** * @file Log_Record.h * - * $Id: Log_Record.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Log_Record.h 85236 2009-05-01 11:43:56Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -70,8 +70,9 @@ public: /// Default dtor. ~ACE_Log_Record (void); + /// Write the contents of the logging record to the appropriate - /// iff the corresponding type is enabled. + /// if the corresponding type is enabled. int print (const ACE_TCHAR host_name[], u_long verbose_flag, #if !defined (ACE_HAS_WINCE) @@ -82,7 +83,7 @@ public: #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) /// Write the contents of the logging record to the appropriate - /// iff the corresponding type is enabled. + /// @a stream if the corresponding type is enabled. int print (const ACE_TCHAR host_name[], u_long verbose_flag, ACE_OSTREAM_TYPE &stream); @@ -94,23 +95,23 @@ public: /** * Returns a character array with the string form of the - * parameter. This is used for the verbose + * ACE_Log_Priority parameter. This is used for the verbose * printing format. */ static const ACE_TCHAR *priority_name (ACE_Log_Priority p); - // IMPORTANT: @a name must be a statically allocated const ACE_TCHAR* + /// IMPORTANT: @a name must be a statically allocated const ACE_TCHAR* static void priority_name (ACE_Log_Priority p, const ACE_TCHAR *name); // = Marshall/demarshall - /// Encode the for transmission on the network. + /// Encode the @c Log_Record for transmission on the network. /// @deprecated The encode() and decode() metods are deprecated; please use /// the CDR insertion and extraction operators to properly encode and decode /// ACE_Log_Record objects. void encode (void); - /// Decode the received from the network. + /// Decode the @c Log_Record received from the network. /// @deprecated The encode() and decode() metods are deprecated; please use /// the CDR insertion and extraction operators to properly encode and decode /// ACE_Log_Record objects. @@ -197,7 +198,9 @@ private: /// Logging record data ACE_TCHAR *msg_data_; // Heap-allocated text message area - size_t msg_data_size_; // Allocated size of msg_data_ in ACE_TCHARs + + /// Allocated size of msg_data_ in ACE_TCHARs + size_t msg_data_size_; /// disallow copying... ACE_Log_Record (const ACE_Log_Record& rhs); @@ -220,4 +223,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_LOG_RECORD_H */ - diff --git a/dep/include/ace/Log_Record.inl b/externals/ace/Log_Record.inl similarity index 88% rename from dep/include/ace/Log_Record.inl rename to externals/ace/Log_Record.inl index 4fe84ecab07..50cfa70df3e 100644 --- a/dep/include/ace/Log_Record.inl +++ b/externals/ace/Log_Record.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Log_Record.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Log_Record.inl 84183 2009-01-19 08:50:16Z johnnyw $ #include "ace/Global_Macros.h" #include "ace/os_include/arpa/os_inet.h" @@ -20,17 +20,15 @@ ACE_INLINE void ACE_Log_Record::encode (void) { ACE_TRACE ("ACE_Log_Record::encode"); -#if !defined (ACE_LACKS_HTONL) - this->length_ = htonl (this->length_); - this->type_ = htonl (this->type_); + this->length_ = ACE_HTONL (this->length_); + this->type_ = ACE_HTONL (this->type_); // Make sure we don't enclose the sec() and usec() fields until // they've been normalized. // secs_ is commented out because it can be 64 bits. This method is // deprecated; use the CDR operations instead. - // this->secs_ = htonl (this->secs_); - this->usecs_ = htonl (this->usecs_); - this->pid_ = htonl (this->pid_); -#endif /* ACE_LACKS_HTONL */ + // this->secs_ = ACE_HTONL (this->secs_); + this->usecs_ = ACE_HTONL (this->usecs_); + this->pid_ = ACE_HTONL (this->pid_); } ACE_INLINE void diff --git a/dep/src/ace/Logging_Strategy.cpp b/externals/ace/Logging_Strategy.cpp similarity index 93% rename from dep/src/ace/Logging_Strategy.cpp rename to externals/ace/Logging_Strategy.cpp index 6a4be45bae1..1b868d6f696 100644 --- a/dep/src/ace/Logging_Strategy.cpp +++ b/externals/ace/Logging_Strategy.cpp @@ -1,4 +1,4 @@ -// $Id: Logging_Strategy.cpp 81696 2008-05-14 18:15:31Z johnnyw $ +// $Id: Logging_Strategy.cpp 89512 2010-03-17 14:42:24Z vzykov $ #include "ace/Logging_Strategy.h" #include "ace/Service_Config.h" @@ -17,7 +17,7 @@ ACE_RCSID (ace, Logging_Strategy, - "$Id: Logging_Strategy.cpp 81696 2008-05-14 18:15:31Z johnnyw $") + "$Id: Logging_Strategy.cpp 89512 2010-03-17 14:42:24Z vzykov $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -156,7 +156,7 @@ ACE_Logging_Strategy::parse_args (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("f:i:k:m:n:N:op:s:t:w"), 0); - for (int c; (c = get_opt ()) != -1;) + for (int c; (c = get_opt ()) != -1; ) { switch (c) { @@ -386,11 +386,6 @@ ACE_Logging_Strategy::init (int argc, ACE_TCHAR *argv[]) if (this->reactor () == 0) // Use singleton. this->reactor (ACE_Reactor::instance ()); - - this->reactor ()->schedule_timer - (this, 0, - ACE_Time_Value (this->interval_), - ACE_Time_Value (this->interval_)); } } // Now set the flags for Log_Msg @@ -484,7 +479,7 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &, else max_num = count_; - for (int i = max_num ; i > 1 ; i--) + for (int i = max_num ; i > 1 ;i--) { ACE_OS::sprintf (backup, ACE_TEXT ("%s.%d"), @@ -551,6 +546,43 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &, return 0; } +int +ACE_Logging_Strategy::handle_close (ACE_HANDLE, + ACE_Reactor_Mask) +{ + // This will reset reactor member and cancel timer events. + this->reactor (0); + return 0; +} + +void +ACE_Logging_Strategy::reactor (ACE_Reactor *r) +{ + if (this->reactor () != r) + { + if (this->reactor () && this->interval_ > 0 && this->max_size_ > 0) + { + this->reactor ()->cancel_timer (this); + } + + ACE_Service_Object::reactor (r); + + if (this->reactor ()) + { + this->reactor ()->schedule_timer + (this, 0, + ACE_Time_Value (this->interval_), + ACE_Time_Value (this->interval_)); + } + } +} + +ACE_Reactor * +ACE_Logging_Strategy::reactor (void) const +{ + return ACE_Service_Object::reactor (); +} + void ACE_Logging_Strategy::log_msg (ACE_Log_Msg *log_msg) { @@ -563,5 +595,11 @@ ACE_END_VERSIONED_NAMESPACE_DECL // svc.conf file to dynamically initialize the state of the // Logging_Strategy. -ACE_FACTORY_DEFINE (ACE, ACE_Logging_Strategy) +ACE_STATIC_SVC_DEFINE (ACE_Logging_Strategy, + ACE_TEXT ("Logging_Strategy"), + ACE_Service_Type::SERVICE_OBJECT, + &ACE_SVC_NAME (ACE_Logging_Strategy), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0) +ACE_FACTORY_DEFINE (ACE, ACE_Logging_Strategy) diff --git a/dep/include/ace/Logging_Strategy.h b/externals/ace/Logging_Strategy.h similarity index 87% rename from dep/include/ace/Logging_Strategy.h rename to externals/ace/Logging_Strategy.h index 8af68b32593..00a50eae082 100644 --- a/dep/include/ace/Logging_Strategy.h +++ b/externals/ace/Logging_Strategy.h @@ -4,7 +4,7 @@ /** * @file Logging_Strategy.h * - * $Id: Logging_Strategy.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Logging_Strategy.h 89512 2010-03-17 14:42:24Z vzykov $ * * @author Prashant Jain * @author Orlando Ribeiro @@ -93,12 +93,28 @@ public: /** * Timeout handler which tests logfile size. If the current logfile - * size exceeds , the current logfile is closed, saved to + * size exceeds @c max_size_, the current logfile is closed, saved to * logfile.old, and a new logfile is reopened. */ virtual int handle_timeout (const ACE_Time_Value& tv, const void* arg); + /** + * This function helps to cancel timer events for this logging strategy + * in reactor during shutdown. + */ + virtual int handle_close (ACE_HANDLE, + ACE_Reactor_Mask); + + /** + * Reactor accessors. If reactor changes then we need remove this + * event handler from previous reactor and scheduler for timer events + * in a new one. + */ + virtual void reactor (ACE_Reactor *r); + + virtual ACE_Reactor * reactor (void) const; + /** * Parse arguments provided in svc.conf file. * @arg '-f' Pass in the flags (such as OSTREAM, STDERR, LOGGER, VERBOSE, @@ -110,7 +126,7 @@ public: * @arg '-n' Set the program name for the %n format specifier. * @arg '-N' The maximum number of logfiles that we want created. * @arg '-o' Specifies that we want the no standard logfiles ordering - * (fastest processing in ). Default is not to + * (fastest processing in handle_timeout()). Default is not to * order logfiles. * @arg '-p' Pass in the process-wide priorities to either enable (e.g., * DEBUG, INFO, WARNING, NOTICE, ERROR, CRITICAL, ALERT, @@ -136,10 +152,10 @@ protected: void priorities (ACE_TCHAR *priority_string, ACE_Log_Msg::MASK_TYPE mask); - /// Current thread's priority mask set by + /// Current thread's priority mask set by @c priorities u_long thread_priority_mask_; - /// Process-wide priority mask set by + /// Process-wide priority mask set by @c priorities u_long process_priority_mask_; /// Flags we keep track of. @@ -171,7 +187,7 @@ protected: int count_; /// Tells us what is the maximum log file to write. We will write - /// + 1 files (includes the current log file). + /// @c max_file_number_ + 1 files (includes the current log file). /// Default value is 1, i.e., 2 files by default. int max_file_number_; @@ -181,7 +197,7 @@ protected: u_long interval_; /// Maximum logfile size (in KB). Default value is - /// . + /// ACE_DEFAULT_MAX_LOGFILE_SIZE. u_long max_size_; /// ACE_Log_Msg instance to work with @@ -190,7 +206,8 @@ protected: ACE_END_VERSIONED_NAMESPACE_DECL +ACE_STATIC_SVC_DECLARE_EXPORT(ACE, ACE_Logging_Strategy) + ACE_FACTORY_DECLARE (ACE, ACE_Logging_Strategy) #endif /* ACE_LOGGING_STRATEGY_H */ - diff --git a/dep/src/ace/MEM_Acceptor.cpp b/externals/ace/MEM_Acceptor.cpp similarity index 95% rename from dep/src/ace/MEM_Acceptor.cpp rename to externals/ace/MEM_Acceptor.cpp index 76bafc1ef05..9484af92b0f 100644 --- a/dep/src/ace/MEM_Acceptor.cpp +++ b/externals/ace/MEM_Acceptor.cpp @@ -1,4 +1,4 @@ -// $Id: MEM_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: MEM_Acceptor.cpp 84455 2009-02-13 13:31:02Z johnnyw $ #include "ace/MEM_Acceptor.h" @@ -13,7 +13,7 @@ #include "ace/MEM_Acceptor.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, MEM_Acceptor, "$Id: MEM_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, MEM_Acceptor, "$Id: MEM_Acceptor.cpp 84455 2009-02-13 13:31:02Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -82,8 +82,8 @@ int ACE_MEM_Acceptor::accept (ACE_MEM_Stream &new_stream, ACE_MEM_Addr *remote_sap, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) + bool restart, + bool reset_new_handle) { ACE_TRACE ("ACE_MEM_Acceptor::accept"); @@ -192,7 +192,8 @@ ACE_MEM_Acceptor::accept (ACE_MEM_Stream &new_stream, if (ACE::recv (new_handle, &client_signaling, sizeof (ACE_INT16)) == -1) ACE_ERROR_RETURN ((LM_DEBUG, - ACE_TEXT ("ACE_MEM_Acceptor::%p error receiving strategy\n"), ACE_TEXT ("accept")), + ACE_TEXT ("ACE_MEM_Acceptor::%p error receiving strategy\n"), + ACE_TEXT ("accept")), -1); // Ensure minimum buffer size @@ -225,7 +226,7 @@ ACE_MEM_Acceptor::accept (ACE_MEM_Stream &new_stream, int ACE_MEM_Acceptor::shared_accept_finish (ACE_MEM_Stream new_stream, int in_blocking_mode, - int reset_new_handle) const + bool reset_new_handle) const { ACE_TRACE ("ACE_MEM_Acceptor::shared_accept_finish ()"); @@ -263,4 +264,3 @@ ACE_MEM_Acceptor::shared_accept_finish (ACE_MEM_Stream new_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ - diff --git a/dep/include/ace/MEM_Acceptor.h b/externals/ace/MEM_Acceptor.h similarity index 93% rename from dep/include/ace/MEM_Acceptor.h rename to externals/ace/MEM_Acceptor.h index b982ab81642..bc0b02d17a3 100644 --- a/dep/include/ace/MEM_Acceptor.h +++ b/externals/ace/MEM_Acceptor.h @@ -4,7 +4,7 @@ /** * @file MEM_Acceptor.h * - * $Id: MEM_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: MEM_Acceptor.h 84834 2009-03-16 12:28:51Z johnnyw $ * * @author Nanbor Wang */ @@ -58,7 +58,7 @@ public: /// Default constructor. ACE_MEM_Acceptor (void); - /// destructor. + /// Destructor. ~ACE_MEM_Acceptor (void); /// Initiate a passive mode socket. @@ -83,14 +83,14 @@ public: int accept (ACE_MEM_Stream &new_ipc_sap, ACE_MEM_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0); + bool restart = true, + bool reset_new_handle = false); /// Perform operations that must occur after is /// called. int shared_accept_finish (ACE_MEM_Stream new_stream, int in_blocking_mode, - int reset_new_handle) const; + bool reset_new_handle) const; /** * Accessor/mutator of mmap filename prefix. By default, the @@ -155,16 +155,16 @@ protected: int accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; #if !defined (ACE_HAS_WINCE) int accept (ACE_SOCK_Stream &new_stream, ACE_Accept_QoS_Params qos_params, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; #endif // ACE_HAS_WINCE private: @@ -190,4 +190,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MEM_ACCEPTOR_H */ - diff --git a/dep/include/ace/MEM_Acceptor.inl b/externals/ace/MEM_Acceptor.inl similarity index 90% rename from dep/include/ace/MEM_Acceptor.inl rename to externals/ace/MEM_Acceptor.inl index 9bcc211e2b4..270d0ed3c6a 100644 --- a/dep/include/ace/MEM_Acceptor.inl +++ b/externals/ace/MEM_Acceptor.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: MEM_Acceptor.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: MEM_Acceptor.inl 82723 2008-09-16 09:35:44Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -23,8 +23,8 @@ ACE_INLINE int ACE_MEM_Acceptor::accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { return this->ACE_SOCK_Acceptor::accept (new_stream, remote_addr, timeout, restart, reset_new_handle); @@ -36,8 +36,8 @@ ACE_MEM_Acceptor::accept (ACE_SOCK_Stream &new_stream, ACE_Accept_QoS_Params qos_params, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { return this->ACE_SOCK_Acceptor::accept (new_stream, qos_params, remote_addr, timeout, restart, reset_new_handle); diff --git a/dep/src/ace/MEM_Addr.cpp b/externals/ace/MEM_Addr.cpp similarity index 99% rename from dep/src/ace/MEM_Addr.cpp rename to externals/ace/MEM_Addr.cpp index 92069775459..1f6c457ff12 100644 --- a/dep/src/ace/MEM_Addr.cpp +++ b/externals/ace/MEM_Addr.cpp @@ -168,4 +168,3 @@ ACE_MEM_Addr::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ - diff --git a/dep/include/ace/MEM_Addr.h b/externals/ace/MEM_Addr.h similarity index 100% rename from dep/include/ace/MEM_Addr.h rename to externals/ace/MEM_Addr.h index fa7da740f5d..35887b5cc15 100644 --- a/dep/include/ace/MEM_Addr.h +++ b/externals/ace/MEM_Addr.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_MEM_ADDR_H #define ACE_MEM_ADDR_H #include /**/ "ace/pre.h" @@ -152,4 +153,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MEM_ADDR_H */ - diff --git a/dep/include/ace/MEM_Addr.inl b/externals/ace/MEM_Addr.inl similarity index 99% rename from dep/include/ace/MEM_Addr.inl rename to externals/ace/MEM_Addr.inl index 3d7a4235f07..ef19536dfe9 100644 --- a/dep/include/ace/MEM_Addr.inl +++ b/externals/ace/MEM_Addr.inl @@ -2,6 +2,7 @@ // // $Id: MEM_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/Global_Macros.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/MEM_Connector.cpp b/externals/ace/MEM_Connector.cpp similarity index 91% rename from dep/src/ace/MEM_Connector.cpp rename to externals/ace/MEM_Connector.cpp index 7a8d94e7b2b..fe5722a8a39 100644 --- a/dep/src/ace/MEM_Connector.cpp +++ b/externals/ace/MEM_Connector.cpp @@ -1,9 +1,9 @@ // MEM_Connector.cpp -// $Id: MEM_Connector.cpp 81517 2008-04-29 07:23:47Z johnnyw $ +// $Id: MEM_Connector.cpp 83170 2008-10-13 07:21:38Z johnnyw $ #include "ace/MEM_Connector.h" -ACE_RCSID(ace, MEM_Connector, "$Id: MEM_Connector.cpp 81517 2008-04-29 07:23:47Z johnnyw $") +ACE_RCSID(ace, MEM_Connector, "$Id: MEM_Connector.cpp 83170 2008-10-13 07:21:38Z johnnyw $") #if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1) @@ -71,16 +71,17 @@ ACE_MEM_Connector::connect (ACE_MEM_Stream &new_stream, if (!this->address_.same_host (remote_sap)) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) MEM_Connector can't connect ") - ACE_TEXT ("to %s:%d which is not a local endpoint ") - ACE_TEXT ("(local address is %s:%d)\n"), - ACE_TEXT_CHAR_TO_TCHAR (remote_sap.get_host_name ()), + ACE_TEXT ("to %C:%d which is not a local endpoint ") + ACE_TEXT ("(local address is %C:%d)\n"), + remote_sap.get_host_name (), remote_sap.get_port_number (), - ACE_TEXT_CHAR_TO_TCHAR (this->address_.get_host_name ()), + this->address_.get_host_name (), this->address_.get_port_number ()), -1); else this->address_.set_port_number (remote_sap.get_port_number ()); + ACE_SOCK_Stream temp_stream; if (ACE_SOCK_Connector::connect (temp_stream, @@ -92,6 +93,7 @@ ACE_MEM_Connector::connect (ACE_MEM_Stream &new_stream, ACE_TEXT ("ACE_MEM_Connector::connect")), -1); + ACE_HANDLE new_handle = temp_stream.get_handle (); new_stream.set_handle (new_handle); new_stream.disable (ACE_NONBLOCK); @@ -145,4 +147,3 @@ ACE_MEM_Connector::connect (ACE_MEM_Stream &new_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ - diff --git a/dep/include/ace/MEM_Connector.h b/externals/ace/MEM_Connector.h similarity index 97% rename from dep/include/ace/MEM_Connector.h rename to externals/ace/MEM_Connector.h index d976d8d91bf..b9f46f2d855 100644 --- a/dep/include/ace/MEM_Connector.h +++ b/externals/ace/MEM_Connector.h @@ -4,7 +4,7 @@ /** * @file MEM_Connector.h * - * $Id: MEM_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: MEM_Connector.h 84816 2009-03-13 08:16:32Z johnnyw $ * * @author Nanbor Wang */ @@ -67,7 +67,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -112,7 +112,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -177,4 +177,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MEM_CONNECTOR_H */ - diff --git a/dep/include/ace/MEM_Connector.inl b/externals/ace/MEM_Connector.inl similarity index 100% rename from dep/include/ace/MEM_Connector.inl rename to externals/ace/MEM_Connector.inl diff --git a/dep/src/ace/MEM_IO.cpp b/externals/ace/MEM_IO.cpp similarity index 98% rename from dep/src/ace/MEM_IO.cpp rename to externals/ace/MEM_IO.cpp index 8c4db2871c7..84aa42542c3 100644 --- a/dep/src/ace/MEM_IO.cpp +++ b/externals/ace/MEM_IO.cpp @@ -1,5 +1,5 @@ // MEM_IO.cpp -// $Id: MEM_IO.cpp 82559 2008-08-07 20:23:07Z parsons $ +// $Id: MEM_IO.cpp 88708 2010-01-25 18:58:54Z johnnyw $ #include "ace/MEM_IO.h" #include "ace/Handle_Set.h" @@ -10,7 +10,7 @@ #include "ace/MEM_IO.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, MEM_IO, "$Id: MEM_IO.cpp 82559 2008-08-07 20:23:07Z parsons $") +ACE_RCSID(ace, MEM_IO, "$Id: MEM_IO.cpp 88708 2010-01-25 18:58:54Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -54,7 +54,7 @@ ACE_Reactive_MEM_IO::recv_buf (ACE_MEM_SAP_Node *&buf, buf = 0; return 0; } - else if (retv != sizeof (ACE_OFF_T)) + else if (retv != static_cast (sizeof (ACE_OFF_T))) { // Nothing available or we are really screwed. buf = 0; @@ -87,7 +87,7 @@ ACE_Reactive_MEM_IO::send_buf (ACE_MEM_SAP_Node *buf, (const char *) &offset, sizeof (offset), flags, - timeout) != sizeof (offset)) + timeout) != static_cast (sizeof (offset))) { // unsucessful send, release the memory in the shared-memory. this->release_buffer (buf); @@ -280,12 +280,12 @@ ACE_MT_MEM_IO::recv_buf (ACE_MEM_SAP_Node *&buf, ACE_GUARD_RETURN (ACE_SYNCH_PROCESS_MUTEX, ace_mon, *this->recv_channel_.lock_, -1); buf = this->recv_channel_.queue_.read (); - + if (buf != 0) { return ACE_Utils::truncate_cast (buf->size ()); } - + return -1; } } @@ -403,9 +403,9 @@ ACE_MEM_IO::send (const ACE_Message_Block *message_block, reinterpret_cast ( this->deliver_strategy_->acquire_buffer ( ACE_Utils::truncate_cast (len))); - + size_t n = 0; - + while (message_block != 0) { ACE_OS::memcpy (static_cast (buf->data ()) + n, @@ -429,10 +429,11 @@ ACE_MEM_IO::send (const ACE_Message_Block *message_block, 0, timeout); } - + return 0; } + #if 0 ssize_t ACE_MEM_IO::recvv (iovec *io_vec, @@ -571,4 +572,3 @@ ACE_MEM_IO::recv (size_t n, ...) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ - diff --git a/dep/include/ace/MEM_IO.h b/externals/ace/MEM_IO.h similarity index 99% rename from dep/include/ace/MEM_IO.h rename to externals/ace/MEM_IO.h index 5c05bdc444c..8e3f79c0b60 100644 --- a/dep/include/ace/MEM_IO.h +++ b/externals/ace/MEM_IO.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_MEM_IO_H #define ACE_MEM_IO_H #include /**/ "ace/pre.h" @@ -28,6 +29,7 @@ #include "ace/Process_Semaphore.h" #include "ace/Process_Mutex.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Reactive_MEM_IO : public ACE_MEM_SAP @@ -264,6 +266,7 @@ public: int flags, const ACE_Time_Value *timeout); + /// Dump the state of an object. void dump (void) const; @@ -305,4 +308,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_IO_H */ - diff --git a/dep/include/ace/MEM_IO.inl b/externals/ace/MEM_IO.inl similarity index 99% rename from dep/include/ace/MEM_IO.inl rename to externals/ace/MEM_IO.inl index 7e24f74a1eb..e3ec07fc5ce 100644 --- a/dep/include/ace/MEM_IO.inl +++ b/externals/ace/MEM_IO.inl @@ -129,7 +129,7 @@ ACE_MEM_IO::send (const void *buf, const ACE_Time_Value *timeout) { ACE_TRACE ("ACE_MEM_IO::send"); - + if (this->deliver_strategy_ == 0) { return 0; @@ -138,12 +138,12 @@ ACE_MEM_IO::send (const void *buf, ACE_MEM_SAP_Node *sbuf = this->deliver_strategy_->acquire_buffer ( ACE_Utils::truncate_cast (len)); - + if (sbuf == 0) { return -1; // Memory buffer not initialized. } - + ACE_OS::memcpy (sbuf->data (), buf, len); /// @@ -166,17 +166,17 @@ ACE_MEM_IO::recv (void *buf, size_t count = 0; size_t buf_len = this->buf_size_ - this->cur_offset_; - + if (buf_len == 0) { ssize_t blen = // Buffer length this->fetch_recv_buf (flags, timeout); - + if (blen <= 0) { return blen; } - + buf_len = this->buf_size_; } diff --git a/dep/src/ace/MEM_SAP.cpp b/externals/ace/MEM_SAP.cpp similarity index 99% rename from dep/src/ace/MEM_SAP.cpp rename to externals/ace/MEM_SAP.cpp index 3710802c206..6f18b7abe1c 100644 --- a/dep/src/ace/MEM_SAP.cpp +++ b/externals/ace/MEM_SAP.cpp @@ -95,4 +95,3 @@ ACE_MEM_SAP::close_shm_malloc (void) #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/MEM_SAP.h b/externals/ace/MEM_SAP.h similarity index 99% rename from dep/include/ace/MEM_SAP.h rename to externals/ace/MEM_SAP.h index e50b14b0853..8694481cc18 100644 --- a/dep/include/ace/MEM_SAP.h +++ b/externals/ace/MEM_SAP.h @@ -167,4 +167,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_IO_H */ - diff --git a/dep/include/ace/MEM_SAP.inl b/externals/ace/MEM_SAP.inl similarity index 99% rename from dep/include/ace/MEM_SAP.inl rename to externals/ace/MEM_SAP.inl index 94339ac2d78..a006fdc1179 100644 --- a/dep/include/ace/MEM_SAP.inl +++ b/externals/ace/MEM_SAP.inl @@ -32,6 +32,7 @@ ACE_MEM_SAP_Node::data (void) return this + 1; } + ACE_INLINE ACE_MEM_SAP_Node * ACE_MEM_SAP::acquire_buffer (const ssize_t size) { diff --git a/dep/src/ace/MEM_Stream.cpp b/externals/ace/MEM_Stream.cpp similarity index 99% rename from dep/src/ace/MEM_Stream.cpp rename to externals/ace/MEM_Stream.cpp index 3ad616314ad..afcbd4f98d0 100644 --- a/dep/src/ace/MEM_Stream.cpp +++ b/externals/ace/MEM_Stream.cpp @@ -45,4 +45,3 @@ ACE_MEM_Stream::close (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ - diff --git a/dep/include/ace/MEM_Stream.h b/externals/ace/MEM_Stream.h similarity index 100% rename from dep/include/ace/MEM_Stream.h rename to externals/ace/MEM_Stream.h index 0a50cabfe94..f0a2380c398 100644 --- a/dep/include/ace/MEM_Stream.h +++ b/externals/ace/MEM_Stream.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_MEM_STREAM_H #define ACE_MEM_STREAM_H #include /**/ "ace/pre.h" @@ -155,4 +156,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MEM_STREAM_H */ - diff --git a/dep/include/ace/MEM_Stream.inl b/externals/ace/MEM_Stream.inl similarity index 99% rename from dep/include/ace/MEM_Stream.inl rename to externals/ace/MEM_Stream.inl index 1e965aff1b5..e995db5c5f9 100644 --- a/dep/include/ace/MEM_Stream.inl +++ b/externals/ace/MEM_Stream.inl @@ -54,6 +54,7 @@ ACE_MEM_Stream::send_n (const void *buf, size_t n) return this->send (buf, n); } + ACE_INLINE ssize_t ACE_MEM_Stream::recv_n (void *buf, size_t n) { diff --git a/dep/src/ace/MMAP_Memory_Pool.cpp b/externals/ace/MMAP_Memory_Pool.cpp similarity index 98% rename from dep/src/ace/MMAP_Memory_Pool.cpp rename to externals/ace/MMAP_Memory_Pool.cpp index 772bb538bc7..bf42ad33dd5 100644 --- a/dep/src/ace/MMAP_Memory_Pool.cpp +++ b/externals/ace/MMAP_Memory_Pool.cpp @@ -1,4 +1,4 @@ -// $Id: MMAP_Memory_Pool.cpp 82513 2008-08-05 18:52:53Z parsons $ +// $Id: MMAP_Memory_Pool.cpp 87823 2009-11-30 12:38:34Z johnnyw $ // MMAP_Memory_Pool.cpp #include "ace/MMAP_Memory_Pool.h" @@ -20,7 +20,7 @@ ACE_RCSID(ace, MMAP_Memory_Pool, - "$Id: MMAP_Memory_Pool.cpp 82513 2008-08-05 18:52:53Z parsons $") + "$Id: MMAP_Memory_Pool.cpp 87823 2009-11-30 12:38:34Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -44,7 +44,7 @@ ACE_MMAP_Memory_Pool::release (int destroy) #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ if (destroy) - this->mmap_.remove (); + this->mmap_.remove (); else this->mmap_.close (); return 0; @@ -69,9 +69,8 @@ ACE_MMAP_Memory_Pool::sync (int flags) return this->mmap_.sync (len, flags); } -// Sync bytes of the memory region to the backing store starting -// at . - +/// Sync @a len bytes of the memory region to the backing store starting +/// at . int ACE_MMAP_Memory_Pool::sync (void *addr, size_t len, int flags) { @@ -102,6 +101,7 @@ ACE_MMAP_Memory_Pool::protect (int prot) return this->mmap_.protect (len, prot); } + // Change the protection of the pages of the mapped region to // starting at up to bytes. @@ -197,7 +197,7 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool ( { if (this->signal_handler_.register_handler (SIGSEGV, this) == -1) ACE_ERROR ((LM_ERROR, - "%p\n", this->backing_store_name_)); + ACE_TEXT("%p\n"), this->backing_store_name_)); } #endif /* ACE_WIN32 */ } @@ -591,4 +591,3 @@ ACE_Lite_MMAP_Memory_Pool::sync (void *, size_t, int) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/MMAP_Memory_Pool.h b/externals/ace/MMAP_Memory_Pool.h similarity index 99% rename from dep/include/ace/MMAP_Memory_Pool.h rename to externals/ace/MMAP_Memory_Pool.h index aca39757152..b11077d42ff 100644 --- a/dep/include/ace/MMAP_Memory_Pool.h +++ b/externals/ace/MMAP_Memory_Pool.h @@ -345,4 +345,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MMAP_MEMORY_POOL_H */ - diff --git a/dep/include/ace/MMAP_Memory_Pool.inl b/externals/ace/MMAP_Memory_Pool.inl similarity index 100% rename from dep/include/ace/MMAP_Memory_Pool.inl rename to externals/ace/MMAP_Memory_Pool.inl diff --git a/externals/ace/Makefile.in b/externals/ace/Makefile.in new file mode 100644 index 00000000000..946522f08af --- /dev/null +++ b/externals/ace/Makefile.in @@ -0,0 +1,5498 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@BUILD_ACE_FOR_TAO_FALSE@am__append_1 = libACE.la +@BUILD_ACE_FOR_TAO_FALSE@am__append_2 = \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE_export.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ARGV.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ARGV.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ARGV.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Acceptor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Params.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Params.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_QoS.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_QoS.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Activation_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Activation_Queue.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Active_Map_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Active_Map_Manager.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Active_Map_Manager_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Active_Map_Manager_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Active_Map_Manager_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Arg_Shifter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Arg_Shifter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Argv_Type_Converter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Argv_Type_Converter.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Array.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Array_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Array_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Array_Base.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Array_Map.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Array_Map.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Array_Map.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Assert.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_IO_Impl.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_IO_Impl.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_Pseudo_Task.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_Sparc.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_GCC_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_GCC_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_GCC_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Event.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Event.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Functor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Functor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Functor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_IncDec_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_IncDec_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_IncDec_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Ptr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Ptr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Ptr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Barrier.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Barrier.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Base_Thread_Adapter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Base_Thread_Adapter.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Based_Pointer_Repository.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Based_Pointer_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Based_Pointer_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Based_Pointer_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Basic_Stats.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Basic_Stats.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Basic_Types.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Basic_Types.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Bound_Ptr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Bound_Ptr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Base.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Size.h \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Size.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ CORBA_macros.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Cache_Map_Manager_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Cache_Map_Manager_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Cache_Map_Manager_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Cached_Connect_Strategy_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Cached_Connect_Strategy_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Caching_Strategies_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Caching_Strategies_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Caching_Strategies_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Caching_Utility_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Caching_Utility_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Capabilities.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Capabilities.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Cleanup.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Cleanup.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Cleanup_Strategies_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Cleanup_Strategies_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Codecs.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Codeset_IBM1047.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Codeset_Registry.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Codeset_Registry.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_Recursive_Thread_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_Thread_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_Thread_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Configuration.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Configuration.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Configuration_Import_Export.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Connection_Recycling_Strategy.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Containers.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Containers.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Containers_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Containers_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Containers_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Copy_Disabled.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Countdown_Time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Countdown_Time.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV.h \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_IO.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ DLL.h \ +@BUILD_ACE_FOR_TAO_FALSE@ DLL_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Date_Time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Date_Time.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Default_Constants.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dev_Poll_Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dev_Poll_Reactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Dirent.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dirent.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Dirent_Selector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dirent_Selector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Dump.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dump_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dump_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Message_Strategy.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Message_Strategy.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service_Dependency.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Encoding_Converter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Encoding_Converter_Factory.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Env_Value_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Env_Value_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Env_Value_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Event.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Event.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Event_Handler.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Event_Handler.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Event_Handler_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Event_Handler_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Event_Handler_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Exception_Macros.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Recv.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Recv.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Recv_Msg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Recv_Msg.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Send.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Send.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Send_Msg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Send_Msg.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_IO.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ File_Lock.h \ +@BUILD_ACE_FOR_TAO_FALSE@ File_Lock.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Filecache.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Flag_Manip.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Flag_Manip.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Framework_Component.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Framework_Component.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Framework_Component_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Framework_Component_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Free_List.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Free_List.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor_String.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor_String.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Future.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Future.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Future_Set.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Future_Set.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Get_Opt.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Get_Opt.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Global_Macros.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Guard_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Guard_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Guard_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Gobbler.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Gobbler.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Ops.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Set.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Set.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Cache_Map_Manager_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Cache_Map_Manager_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Cache_Map_Manager_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_Manager_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_Manager_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_Manager_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_With_Allocator_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_With_Allocator_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Map_With_Allocator_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Multi_Map_Manager_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Multi_Map_Manager_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Hash_Multi_Map_Manager_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Hashable.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Hashable.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ High_Res_Timer.h \ +@BUILD_ACE_FOR_TAO_FALSE@ High_Res_Timer.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ICMP_Socket.h \ +@BUILD_ACE_FOR_TAO_FALSE@ INET_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ INET_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ IOStream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ IOStream_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ IOStream_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ IOStream_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ IO_Cntl_Msg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ IO_Cntl_Msg.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ IO_SAP.h \ +@BUILD_ACE_FOR_TAO_FALSE@ IO_SAP.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ IPC_SAP.h \ +@BUILD_ACE_FOR_TAO_FALSE@ IPC_SAP.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ If_Then_Else.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Init_ACE.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_Auto_Ptr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_Auto_Ptr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_Auto_Ptr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_List.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_List.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_List.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_List_Node.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_List_Node.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Intrusive_List_Node.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ LOCK_SOCK_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LOCK_SOCK_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_CODgram.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_CODgram.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Dgram.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Dgram.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Lib_Find.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Memory_Pool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Name_Space.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Name_Space_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Name_Space_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Tokens.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Tokens.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Lock.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Lock.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Lock_Adapter_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Lock_Adapter_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Lock_Adapter_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_Backend.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_Callback.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_IPC.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_NT_Event_Log.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_UNIX_Syslog.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Priority.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Record.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Record.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Logging_Strategy.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Acceptor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_IO.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_SAP.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_SAP.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ MMAP_Memory_Pool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ MMAP_Memory_Pool.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_Allocator.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_Allocator.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Managed_Object.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Managed_Object.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Managed_Object.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Manual_Event.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Manual_Event.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Map_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Map_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Map_Manager.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Map_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Map_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Map_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Mem_Map.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Mem_Map.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Memory_Pool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Block.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Block.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Block_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Block_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Block_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_NT.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_NT.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_Vx.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_Vx.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Method_Object.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Method_Request.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Min_Max.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Module.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Module.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Module.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Admin.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Admin_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Base.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Control_Action.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Control_Types.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Point_Registry.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Size.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Msg_WFMO_Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Msg_WFMO_Reactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Multihomed_INET_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Multihomed_INET_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ NT_Service.h \ +@BUILD_ACE_FOR_TAO_FALSE@ NT_Service.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Name_Proxy.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Name_Request_Reply.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Name_Space.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Naming_Context.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Naming_Context.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Netlink_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Netlink_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Node.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Node.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Notification_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Notification_Queue.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Notification_Strategy.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Notification_Strategy.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Null_Barrier.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Null_Condition.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Null_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Null_Semaphore.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Numeric_Limits.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Dirent.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Errno.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Errno.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Log_Msg_Attributes.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Log_Msg_Attributes.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Memory.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_Thread.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_Thread.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_arpa_inet.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_arpa_inet.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_ctype.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_ctype.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_dirent.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_dirent.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_dlfcn.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_dlfcn.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_errno.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_errno.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_fcntl.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_fcntl.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_macros.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_math.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_math.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_netdb.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_netdb.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_poll.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_poll.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_pwd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_pwd.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_regex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_regex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_signal.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_signal.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stdio.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stdio.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stdlib.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stdlib.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_string.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_string.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_strings.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_strings.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stropts.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stropts.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_mman.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_mman.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_msg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_msg.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_resource.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_resource.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_select.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_select.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_sendfile.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_sendfile.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_shm.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_shm.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_socket.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_socket.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_stat.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_stat.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_time.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_uio.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_uio.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_utsname.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_wait.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_wait.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_time.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_unistd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_unistd.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_wchar.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_wctype.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_wctype.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_wchar.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_QoS.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_String.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_TLI.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_TLI.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Thread_Adapter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_main.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Obchunk.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Obchunk.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Object_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Object_Manager.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Object_Manager_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Obstack_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Obstack_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Obstack_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ PI_Malloc.h \ +@BUILD_ACE_FOR_TAO_FALSE@ PI_Malloc.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_Asynch_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_CB_Proactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_Proactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_Proactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Pagefile_Memory_Pool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Pagefile_Memory_Pool.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Pair.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Pair_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Pair_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Pair_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Parse_Node.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Ping_Socket.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Ping_Socket.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Pipe.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Pipe.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Priority_Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Proactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Proactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Proactor_Impl.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Process.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Process.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Manager.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Semaphore.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Semaphore.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Profile_Timer.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Profile_Timer.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ RB_Tree.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ RB_Tree.h \ +@BUILD_ACE_FOR_TAO_FALSE@ RB_Tree.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Process_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Process_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Thread_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Thread_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Impl.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Notification_Strategy.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Notification_Strategy.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Timer_Interface.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Token_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Token_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Read_Buffer.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Read_Buffer.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Recursive_Thread_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Recursive_Thread_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Recyclable.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Recyclable.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcountable.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcountable_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcountable_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcountable_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcounted_Auto_Ptr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcounted_Auto_Ptr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Refcounted_Auto_Ptr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Registry.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Registry_Name_Space.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Remote_Name_Space.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Remote_Tokens.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Remote_Tokens.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Reverse_Lock_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Reverse_Lock_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Reverse_Lock_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Acceptor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_CODgram.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_CODgram.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram_Bcast.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram_Bcast.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram_Mcast.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram_Mcast.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_IO.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Netlink.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Netlink.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Acceptor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Association.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Association.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SString.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SString.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SStringfwd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Stack_Trace.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SUN_Proactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Message.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Message.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Message_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Message_Queue.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Semaphore_Complex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Semaphore_Complex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Semaphore_Simple.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Semaphore_Simple.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Shared_Memory.h \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Shared_Memory.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Sample_History.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Sample_History.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Sbrk_Memory_Pool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Sched_Params.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Sched_Params.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor_Base.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Semaphore.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Semaphore.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Config.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Config.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Gestalt.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Gestalt.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Object.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Object.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Repository.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Repository.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Types.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Types.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_MM.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_MM.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_Pool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_SV.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_SV.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Object.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Object.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Sig_Adapter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Sig_Handler.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Sig_Handler.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Signal.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Signal.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Singleton.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Singleton.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Singleton.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Sock_Connect.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Static_Object_Lock.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Stats.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Stats.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Strategies.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Strategies_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Strategies_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Strategies_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Stream_Modules.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Stream_Modules.h \ +@BUILD_ACE_FOR_TAO_FALSE@ String_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ String_Base.h \ +@BUILD_ACE_FOR_TAO_FALSE@ String_Base.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ String_Base_Const.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Conf.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Conf_Lexer.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Conf_Tokens.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Conf_Token_Table.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Handler.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Handler.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Synch.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Synch_Options.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Synch_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Synch_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Synch_Traits.h \ +@BUILD_ACE_FOR_TAO_FALSE@ System_Time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ TP_Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TP_Reactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ TSS_Adapter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TSS_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TSS_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ TSS_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ TTY_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Task.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Task.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Task_Ex_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Task_Ex_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Task_Ex_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Task_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Task_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Task_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Test_and_Set.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Test_and_Set.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Adapter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Adapter.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Control.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Control.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Exit.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Hook.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Manager.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Mutex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Mutex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Semaphore.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Semaphore.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Throughput_Stats.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Time_Value.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Time_Value.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Timeprobe.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timeprobe.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Timeprobe_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timeprobe_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Hash_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Hash_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Heap_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Heap_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_List_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_List_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue_Adapters.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue_Adapters.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue_Adapters.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Wheel_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Wheel_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Tokenizer_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Tokenizer_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Hash.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Heap.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_List.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Queuefwd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Timer_Wheel.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Token.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Token.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Collection.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Collection.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Invariants.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Manager.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Manager.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Request_Reply.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Request_Reply.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Trace.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Truncate.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Typed_SV_Message.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Typed_SV_Message.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Typed_SV_Message.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Typed_SV_Message_Queue.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Typed_SV_Message_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Typed_SV_Message_Queue.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ UNIX_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UNIX_Addr.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Acceptor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Acceptor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Addr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Connector.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Connector.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Stream.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Stream.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF16_Encoding_Converter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF16_Encoding_Converter.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF32_Encoding_Converter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF8_Encoding_Converter.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UUID.h \ +@BUILD_ACE_FOR_TAO_FALSE@ UUID.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Queue.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Queue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Queue.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Set.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Set.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Set.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Set_Ex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Set_Ex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Unbounded_Set_Ex.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Value_Ptr.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Vector_T.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Vector_T.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Vector_T.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ Version.h \ +@BUILD_ACE_FOR_TAO_FALSE@ Versioned_Namespace.h \ +@BUILD_ACE_FOR_TAO_FALSE@ WFMO_Reactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ WFMO_Reactor.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ WIN32_Asynch_IO.h \ +@BUILD_ACE_FOR_TAO_FALSE@ WIN32_Proactor.h \ +@BUILD_ACE_FOR_TAO_FALSE@ XML_Svc_Conf.h \ +@BUILD_ACE_FOR_TAO_FALSE@ XTI_ATM_Mcast.h \ +@BUILD_ACE_FOR_TAO_FALSE@ XTI_ATM_Mcast.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ ace_wchar.h \ +@BUILD_ACE_FOR_TAO_FALSE@ ace_wchar.inl \ +@BUILD_ACE_FOR_TAO_FALSE@ checked_iterator.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-WinCE.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-all.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-lite.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-macros.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-minimal.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32-borland.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32-common.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32-ghs.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32-msvc-7.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32-msvc-8.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32-msvc.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config-win32.h \ +@BUILD_ACE_FOR_TAO_FALSE@ config.h \ +@BUILD_ACE_FOR_TAO_FALSE@ iosfwd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/arpa/os_inet.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/net/os_if.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/netinet/os_in.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/netinet/os_tcp.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_aio.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_assert.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_byteswap.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_complex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_cpio.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_ctype.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_dirent.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_dlfcn.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_errno.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_fcntl.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_fenv.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_float.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_fmtmsg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_fnmatch.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_ftw.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_glob.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_grp.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_iconv.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_intrin.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_inttypes.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_iso646.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_kstat.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_langinfo.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_libgen.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_limits.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_local.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_math.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_monetary.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_mqueue.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_ndbm.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_netdb.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_nl_types.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_pdh.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_pdhmsg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_poll.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_pthread.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_pwd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_regex.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_sched.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_search.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_semaphore.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_setjmp.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_signal.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_spawn.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stdarg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stdbool.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stddef.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stdint.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stdio.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stdlib.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_string.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_strings.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_stropts.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_syslog.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_tar.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_termios.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_tgmath.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_trace.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_typeinfo.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_ucontext.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_ulimit.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_unistd.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_utime.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_utmpx.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_wchar.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_wctype.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/os_wordexp.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_ipc.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_loadavg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_mman.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_msg.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_pstat.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_resource.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_select.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_sem.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_shm.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_socket.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_stat.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_statvfs.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_sysctl.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_sysinfo.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_time.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_timeb.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_times.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_types.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_uio.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_un.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_utsname.h \ +@BUILD_ACE_FOR_TAO_FALSE@ os_include/sys/os_wait.h \ +@BUILD_ACE_FOR_TAO_FALSE@ post.h \ +@BUILD_ACE_FOR_TAO_FALSE@ pre.h \ +@BUILD_ACE_FOR_TAO_FALSE@ streams.h \ +@BUILD_ACE_FOR_TAO_FALSE@ svc_export.h + +@BUILD_ACE_FOR_TAO_FALSE@am__append_3 = \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE.pc + +@BUILD_ACE_FOR_TAO_FALSE@am__append_4 = \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE.pc + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@am__append_5 = libACE_FlReactor.la +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@am__append_6 = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ FlReactor/ACE_FlReactor_export.h \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ FlReactor/FlReactor.h + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@am__append_7 = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ ACE_FlReactor.pc + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@am__append_8 = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ ACE_FlReactor.pc + +@BUILD_QT_TRUE@am__append_9 = QtReactor/QtReactor_moc.cpp \ +@BUILD_QT_TRUE@ ACE_QtReactor.pc +@BUILD_QT_TRUE@am__append_10 = libACE_QtReactor.la +@BUILD_QT_TRUE@am__append_11 = \ +@BUILD_QT_TRUE@ QtReactor/ACE_QtReactor_export.h \ +@BUILD_QT_TRUE@ QtReactor/QtReactor.h + +@BUILD_QT_TRUE@am__append_12 = \ +@BUILD_QT_TRUE@ ACE_QtReactor.pc + +@BUILD_TK_TRUE@am__append_13 = libACE_TkReactor.la +@BUILD_TK_TRUE@am__append_14 = \ +@BUILD_TK_TRUE@ TkReactor/ACE_TkReactor_export.h \ +@BUILD_TK_TRUE@ TkReactor/TkReactor.h + +@BUILD_TK_TRUE@am__append_15 = \ +@BUILD_TK_TRUE@ ACE_TkReactor.pc + +@BUILD_TK_TRUE@am__append_16 = \ +@BUILD_TK_TRUE@ ACE_TkReactor.pc + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@am__append_17 = libACE_XtReactor.la +@BUILD_X11_TRUE@@BUILD_XT_TRUE@am__append_18 = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ XtReactor/ACE_XtReactor_export.h \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ XtReactor/XtReactor.h + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@am__append_19 = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ ACE_XtReactor.pc + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@am__append_20 = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ ACE_XtReactor.pc + +subdir = ace +DIST_COMMON = README $(am__nobase_include_HEADERS_DIST) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ace.m4 \ + $(top_srcdir)/m4/ace_defines.m4 $(top_srcdir)/m4/ace_func.m4 \ + $(top_srcdir)/m4/ace_functions.m4 \ + $(top_srcdir)/m4/ace_headers.m4 $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/aio.m4 $(top_srcdir)/m4/compiler.m4 \ + $(top_srcdir)/m4/config_h.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/platform.m4 \ + $(top_srcdir)/m4/subsets.m4 $(top_srcdir)/m4/threads.m4 \ + $(top_srcdir)/m4/tls.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libACE_la_LIBADD = +am__libACE_la_SOURCES_DIST = ACE.cpp ACE_crc32.cpp ACE_crc_ccitt.cpp \ + ATM_Acceptor.cpp ATM_Addr.cpp ATM_Connector.cpp ATM_Params.cpp \ + ATM_QoS.cpp ATM_Stream.cpp Activation_Queue.cpp \ + Active_Map_Manager.cpp Addr.cpp Argv_Type_Converter.cpp \ + Assert.cpp Asynch_IO.cpp Asynch_IO_Impl.cpp \ + Asynch_Pseudo_Task.cpp Atomic_Op.cpp Atomic_Op_Sparc.c \ + Auto_Event.cpp Barrier.cpp Base_Thread_Adapter.cpp \ + Based_Pointer_Repository.cpp Basic_Stats.cpp Basic_Types.cpp \ + CDR_Base.cpp CDR_Size.cpp CDR_Stream.cpp Capabilities.cpp \ + Cleanup.cpp Codecs.cpp Codeset_IBM1047.cpp \ + Codeset_Registry.cpp Codeset_Registry_db.cpp \ + Condition_Recursive_Thread_Mutex.cpp \ + Condition_Thread_Mutex.cpp Configuration.cpp \ + Configuration_Import_Export.cpp \ + Connection_Recycling_Strategy.cpp Containers.cpp \ + Copy_Disabled.cpp Countdown_Time.cpp DEV.cpp DEV_Addr.cpp \ + DEV_Connector.cpp DEV_IO.cpp DLL.cpp DLL_Manager.cpp \ + Date_Time.cpp Dev_Poll_Reactor.cpp Dirent.cpp \ + Dirent_Selector.cpp Dump.cpp Dynamic.cpp \ + Dynamic_Message_Strategy.cpp Dynamic_Service_Base.cpp \ + Dynamic_Service_Dependency.cpp Encoding_Converter.cpp \ + Encoding_Converter_Factory.cpp Event.cpp Event_Handler.cpp \ + FIFO.cpp FIFO_Recv.cpp FIFO_Recv_Msg.cpp FIFO_Send.cpp \ + FIFO_Send_Msg.cpp FILE.cpp FILE_Addr.cpp FILE_Connector.cpp \ + FILE_IO.cpp File_Lock.cpp Filecache.cpp Flag_Manip.cpp \ + Framework_Component.cpp Functor.cpp Functor_String.cpp \ + Get_Opt.cpp Handle_Ops.cpp Handle_Set.cpp Hashable.cpp \ + High_Res_Timer.cpp ICMP_Socket.cpp INET_Addr.cpp IOStream.cpp \ + IO_Cntl_Msg.cpp IO_SAP.cpp IPC_SAP.cpp Init_ACE.cpp LSOCK.cpp \ + LSOCK_Acceptor.cpp LSOCK_CODgram.cpp LSOCK_Connector.cpp \ + LSOCK_Dgram.cpp LSOCK_Stream.cpp Lib_Find.cpp \ + Local_Memory_Pool.cpp Local_Name_Space.cpp Local_Tokens.cpp \ + Lock.cpp Log_Msg.cpp Log_Msg_Backend.cpp Log_Msg_Callback.cpp \ + Log_Msg_IPC.cpp Log_Msg_NT_Event_Log.cpp \ + Log_Msg_UNIX_Syslog.cpp Log_Record.cpp Logging_Strategy.cpp \ + MEM_Acceptor.cpp MEM_Addr.cpp MEM_Connector.cpp MEM_IO.cpp \ + MEM_SAP.cpp MEM_Stream.cpp MMAP_Memory_Pool.cpp Malloc.cpp \ + Malloc_Allocator.cpp Manual_Event.cpp Mem_Map.cpp \ + Message_Block.cpp Message_Queue.cpp Message_Queue_NT.cpp \ + Message_Queue_Vx.cpp Method_Request.cpp Monitor_Admin.cpp \ + Monitor_Admin_Manager.cpp Monitor_Base.cpp \ + Monitor_Control_Action.cpp Monitor_Control_Types.cpp \ + Monitor_Point_Registry.cpp Monitor_Size.cpp \ + Msg_WFMO_Reactor.cpp Multihomed_INET_Addr.cpp Mutex.cpp \ + NT_Service.cpp Name_Proxy.cpp Name_Request_Reply.cpp \ + Name_Space.cpp Naming_Context.cpp Netlink_Addr.cpp \ + Notification_Queue.cpp Notification_Strategy.cpp OS_Errno.cpp \ + OS_Log_Msg_Attributes.cpp OS_NS_Thread.cpp OS_NS_arpa_inet.cpp \ + OS_NS_ctype.cpp OS_NS_dirent.cpp OS_NS_dlfcn.cpp \ + OS_NS_errno.cpp OS_NS_fcntl.cpp OS_NS_math.cpp OS_NS_netdb.cpp \ + OS_NS_poll.cpp OS_NS_pwd.cpp OS_NS_regex.cpp OS_NS_signal.cpp \ + OS_NS_stdio.cpp OS_NS_stdlib.cpp OS_NS_string.cpp \ + OS_NS_strings.cpp OS_NS_stropts.cpp OS_NS_sys_mman.cpp \ + OS_NS_sys_msg.cpp OS_NS_sys_resource.cpp OS_NS_sys_select.cpp \ + OS_NS_sys_sendfile.cpp OS_NS_sys_shm.cpp OS_NS_sys_socket.cpp \ + OS_NS_sys_stat.cpp OS_NS_sys_time.cpp OS_NS_sys_uio.cpp \ + OS_NS_sys_utsname.cpp OS_NS_sys_wait.cpp OS_NS_time.cpp \ + OS_NS_unistd.cpp OS_NS_wchar.cpp OS_NS_wctype.cpp OS_QoS.cpp \ + OS_TLI.cpp OS_Thread_Adapter.cpp OS_main.cpp Obchunk.cpp \ + Object_Manager.cpp Object_Manager_Base.cpp PI_Malloc.cpp \ + POSIX_Asynch_IO.cpp POSIX_CB_Proactor.cpp POSIX_Proactor.cpp \ + Pagefile_Memory_Pool.cpp Parse_Node.cpp Ping_Socket.cpp \ + Pipe.cpp Priority_Reactor.cpp Proactor.cpp Proactor_Impl.cpp \ + Process.cpp Process_Manager.cpp Process_Mutex.cpp \ + Process_Semaphore.cpp Profile_Timer.cpp RW_Mutex.cpp \ + RW_Process_Mutex.cpp RW_Thread_Mutex.cpp Reactor.cpp \ + Reactor_Impl.cpp Reactor_Notification_Strategy.cpp \ + Reactor_Timer_Interface.cpp Read_Buffer.cpp \ + Recursive_Thread_Mutex.cpp Recyclable.cpp Registry.cpp \ + Registry_Name_Space.cpp Remote_Name_Space.cpp \ + Remote_Tokens.cpp Rtems_init.c SOCK.cpp SOCK_Acceptor.cpp \ + SOCK_CODgram.cpp SOCK_Connector.cpp SOCK_Dgram.cpp \ + SOCK_Dgram_Bcast.cpp SOCK_Dgram_Mcast.cpp SOCK_IO.cpp \ + SOCK_Netlink.cpp SOCK_SEQPACK_Acceptor.cpp \ + SOCK_SEQPACK_Association.cpp SOCK_SEQPACK_Connector.cpp \ + SOCK_Stream.cpp SPIPE.cpp SPIPE_Acceptor.cpp SPIPE_Addr.cpp \ + SPIPE_Connector.cpp SPIPE_Stream.cpp SString.cpp \ + Stack_Trace.cpp SUN_Proactor.cpp SV_Message.cpp \ + SV_Message_Queue.cpp SV_Semaphore_Complex.cpp \ + SV_Semaphore_Simple.cpp SV_Shared_Memory.cpp \ + Sample_History.cpp Sbrk_Memory_Pool.cpp Sched_Params.cpp \ + Select_Reactor_Base.cpp Semaphore.cpp Service_Config.cpp \ + Service_Gestalt.cpp Service_Manager.cpp Service_Object.cpp \ + Service_Repository.cpp Service_Types.cpp Shared_Memory.cpp \ + Shared_Memory_MM.cpp Shared_Memory_Pool.cpp \ + Shared_Memory_SV.cpp Shared_Object.cpp Sig_Adapter.cpp \ + Sig_Handler.cpp Signal.cpp Sock_Connect.cpp Stats.cpp \ + String_Base_Const.cpp Svc_Conf_Lexer.cpp Svc_Conf_y.cpp \ + Synch_Options.cpp System_Time.cpp TLI.cpp TLI_Acceptor.cpp \ + TLI_Connector.cpp TLI_Stream.cpp TP_Reactor.cpp \ + TSS_Adapter.cpp TTY_IO.cpp Task.cpp Thread.cpp \ + Thread_Adapter.cpp Thread_Control.cpp Thread_Exit.cpp \ + Thread_Hook.cpp Thread_Manager.cpp Thread_Mutex.cpp \ + Thread_Semaphore.cpp Throughput_Stats.cpp Time_Value.cpp \ + Timeprobe.cpp Token.cpp Token_Collection.cpp \ + Token_Invariants.cpp Token_Manager.cpp Token_Request_Reply.cpp \ + Trace.cpp UNIX_Addr.cpp UPIPE_Acceptor.cpp UPIPE_Connector.cpp \ + UPIPE_Stream.cpp UTF16_Encoding_Converter.cpp \ + UTF32_Encoding_Converter.cpp UTF8_Encoding_Converter.cpp \ + UUID.cpp WFMO_Reactor.cpp WIN32_Asynch_IO.cpp \ + WIN32_Proactor.cpp XML_Svc_Conf.cpp XTI_ATM_Mcast.cpp \ + ace_wchar.cpp gethrtime.cpp +@BUILD_ACE_FOR_TAO_FALSE@am_libACE_la_OBJECTS = libACE_la-ACE.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ACE_crc32.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ACE_crc_ccitt.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ATM_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ATM_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ATM_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ATM_Params.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ATM_QoS.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ATM_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Activation_Queue.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Active_Map_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Argv_Type_Converter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Assert.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Asynch_IO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Asynch_IO_Impl.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Asynch_Pseudo_Task.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Atomic_Op.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Atomic_Op_Sparc.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Auto_Event.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Barrier.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Base_Thread_Adapter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Based_Pointer_Repository.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Basic_Stats.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Basic_Types.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-CDR_Base.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-CDR_Size.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-CDR_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Capabilities.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Cleanup.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Codecs.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Codeset_IBM1047.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Codeset_Registry.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Codeset_Registry_db.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Condition_Recursive_Thread_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Condition_Thread_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Configuration.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Configuration_Import_Export.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Connection_Recycling_Strategy.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Containers.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Copy_Disabled.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Countdown_Time.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-DEV.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-DEV_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-DEV_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-DEV_IO.lo libACE_la-DLL.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-DLL_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Date_Time.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dev_Poll_Reactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dirent.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dirent_Selector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dump.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dynamic.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dynamic_Message_Strategy.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dynamic_Service_Base.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Dynamic_Service_Dependency.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Encoding_Converter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Encoding_Converter_Factory.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Event.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Event_Handler.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FIFO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FIFO_Recv.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FIFO_Recv_Msg.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FIFO_Send.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FIFO_Send_Msg.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FILE.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FILE_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FILE_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-FILE_IO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-File_Lock.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Filecache.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Flag_Manip.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Framework_Component.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Functor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Functor_String.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Get_Opt.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Handle_Ops.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Handle_Set.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Hashable.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-High_Res_Timer.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ICMP_Socket.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-INET_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-IOStream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-IO_Cntl_Msg.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-IO_SAP.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-IPC_SAP.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Init_ACE.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-LSOCK.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-LSOCK_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-LSOCK_CODgram.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-LSOCK_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-LSOCK_Dgram.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-LSOCK_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Lib_Find.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Local_Memory_Pool.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Local_Name_Space.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Local_Tokens.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Lock.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Msg.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Msg_Backend.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Msg_Callback.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Msg_IPC.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Msg_NT_Event_Log.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Msg_UNIX_Syslog.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Log_Record.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Logging_Strategy.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MEM_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MEM_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MEM_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MEM_IO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MEM_SAP.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MEM_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-MMAP_Memory_Pool.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Malloc.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Malloc_Allocator.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Manual_Event.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Mem_Map.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Message_Block.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Message_Queue.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Message_Queue_NT.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Message_Queue_Vx.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Method_Request.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Admin.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Admin_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Base.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Control_Action.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Control_Types.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Point_Registry.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Monitor_Size.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Msg_WFMO_Reactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Multihomed_INET_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-NT_Service.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Name_Proxy.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Name_Request_Reply.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Name_Space.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Naming_Context.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Netlink_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Notification_Queue.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Notification_Strategy.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_Errno.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_Log_Msg_Attributes.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_Thread.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_arpa_inet.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_ctype.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_dirent.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_dlfcn.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_errno.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_fcntl.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_math.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_netdb.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_poll.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_pwd.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_regex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_signal.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_stdio.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_stdlib.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_string.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_strings.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_stropts.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_mman.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_msg.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_resource.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_select.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_sendfile.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_shm.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_socket.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_stat.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_time.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_uio.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_utsname.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_sys_wait.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_time.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_unistd.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_wchar.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_NS_wctype.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_QoS.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_TLI.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_Thread_Adapter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-OS_main.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Obchunk.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Object_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Object_Manager_Base.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-PI_Malloc.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-POSIX_Asynch_IO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-POSIX_CB_Proactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-POSIX_Proactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Pagefile_Memory_Pool.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Parse_Node.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Ping_Socket.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Pipe.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Priority_Reactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Proactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Proactor_Impl.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Process.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Process_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Process_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Process_Semaphore.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Profile_Timer.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-RW_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-RW_Process_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-RW_Thread_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Reactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Reactor_Impl.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Reactor_Notification_Strategy.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Reactor_Timer_Interface.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Read_Buffer.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Recursive_Thread_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Recyclable.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Registry.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Registry_Name_Space.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Remote_Name_Space.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Remote_Tokens.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Rtems_init.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_CODgram.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Dgram.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Dgram_Bcast.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Dgram_Mcast.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_IO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Netlink.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_SEQPACK_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_SEQPACK_Association.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_SEQPACK_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SOCK_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SPIPE.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SPIPE_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SPIPE_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SPIPE_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SPIPE_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SString.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Stack_Trace.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SUN_Proactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SV_Message.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SV_Message_Queue.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SV_Semaphore_Complex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SV_Semaphore_Simple.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-SV_Shared_Memory.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Sample_History.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Sbrk_Memory_Pool.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Sched_Params.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Select_Reactor_Base.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Semaphore.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Service_Config.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Service_Gestalt.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Service_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Service_Object.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Service_Repository.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Service_Types.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Shared_Memory.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Shared_Memory_MM.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Shared_Memory_Pool.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Shared_Memory_SV.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Shared_Object.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Sig_Adapter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Sig_Handler.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Signal.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Sock_Connect.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Stats.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-String_Base_Const.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Svc_Conf_Lexer.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Svc_Conf_y.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Synch_Options.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-System_Time.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TLI.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TLI_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TLI_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TLI_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TP_Reactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TSS_Adapter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-TTY_IO.lo libACE_la-Task.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Adapter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Control.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Exit.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Hook.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Mutex.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Thread_Semaphore.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Throughput_Stats.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Time_Value.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Timeprobe.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Token.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Token_Collection.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Token_Invariants.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Token_Manager.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Token_Request_Reply.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-Trace.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UNIX_Addr.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UPIPE_Acceptor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UPIPE_Connector.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UPIPE_Stream.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UTF16_Encoding_Converter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UTF32_Encoding_Converter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UTF8_Encoding_Converter.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-UUID.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-WFMO_Reactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-WIN32_Asynch_IO.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-WIN32_Proactor.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-XML_Svc_Conf.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-XTI_ATM_Mcast.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-ace_wchar.lo \ +@BUILD_ACE_FOR_TAO_FALSE@ libACE_la-gethrtime.lo +libACE_la_OBJECTS = $(am_libACE_la_OBJECTS) +libACE_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libACE_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_ACE_FOR_TAO_FALSE@am_libACE_la_rpath = -rpath $(libdir) +am__DEPENDENCIES_1 = +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@libACE_FlReactor_la_DEPENDENCIES = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ libACE.la \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ $(am__DEPENDENCIES_1) +am__libACE_FlReactor_la_SOURCES_DIST = FlReactor/FlReactor.cpp +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@am_libACE_FlReactor_la_OBJECTS = libACE_FlReactor_la-FlReactor.lo +libACE_FlReactor_la_OBJECTS = $(am_libACE_FlReactor_la_OBJECTS) +libACE_FlReactor_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libACE_FlReactor_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@am_libACE_FlReactor_la_rpath = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ -rpath $(libdir) +@BUILD_QT_TRUE@libACE_QtReactor_la_DEPENDENCIES = libACE.la \ +@BUILD_QT_TRUE@ $(am__DEPENDENCIES_1) +am__libACE_QtReactor_la_SOURCES_DIST = QtReactor/QtReactor.cpp \ + QtReactor/QtReactor_moc.cpp +@BUILD_QT_TRUE@am_libACE_QtReactor_la_OBJECTS = \ +@BUILD_QT_TRUE@ libACE_QtReactor_la-QtReactor.lo \ +@BUILD_QT_TRUE@ libACE_QtReactor_la-QtReactor_moc.lo +libACE_QtReactor_la_OBJECTS = $(am_libACE_QtReactor_la_OBJECTS) +libACE_QtReactor_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libACE_QtReactor_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_QT_TRUE@am_libACE_QtReactor_la_rpath = -rpath $(libdir) +@BUILD_TK_TRUE@libACE_TkReactor_la_DEPENDENCIES = libACE.la \ +@BUILD_TK_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__libACE_TkReactor_la_SOURCES_DIST = TkReactor/TkReactor.cpp +@BUILD_TK_TRUE@am_libACE_TkReactor_la_OBJECTS = \ +@BUILD_TK_TRUE@ libACE_TkReactor_la-TkReactor.lo +libACE_TkReactor_la_OBJECTS = $(am_libACE_TkReactor_la_OBJECTS) +libACE_TkReactor_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libACE_TkReactor_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_TK_TRUE@am_libACE_TkReactor_la_rpath = -rpath $(libdir) +@BUILD_X11_TRUE@@BUILD_XT_TRUE@libACE_XtReactor_la_DEPENDENCIES = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ libACE.la $(am__DEPENDENCIES_1) \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ $(am__DEPENDENCIES_1) +am__libACE_XtReactor_la_SOURCES_DIST = XtReactor/XtReactor.cpp +@BUILD_X11_TRUE@@BUILD_XT_TRUE@am_libACE_XtReactor_la_OBJECTS = libACE_XtReactor_la-XtReactor.lo +libACE_XtReactor_la_OBJECTS = $(am_libACE_XtReactor_la_OBJECTS) +libACE_XtReactor_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libACE_XtReactor_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@am_libACE_XtReactor_la_rpath = -rpath \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ $(libdir) +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/aux_config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libACE_la_SOURCES) $(libACE_FlReactor_la_SOURCES) \ + $(libACE_QtReactor_la_SOURCES) $(libACE_TkReactor_la_SOURCES) \ + $(libACE_XtReactor_la_SOURCES) +DIST_SOURCES = $(am__libACE_la_SOURCES_DIST) \ + $(am__libACE_FlReactor_la_SOURCES_DIST) \ + $(am__libACE_QtReactor_la_SOURCES_DIST) \ + $(am__libACE_TkReactor_la_SOURCES_DIST) \ + $(am__libACE_XtReactor_la_SOURCES_DIST) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +DATA = $(pkgconfig_DATA) +am__nobase_include_HEADERS_DIST = ACE.h ACE.inl ACE_export.h ARGV.cpp \ + ARGV.h ARGV.inl ATM_Acceptor.h ATM_Acceptor.inl ATM_Addr.h \ + ATM_Addr.inl ATM_Connector.h ATM_Connector.inl ATM_Params.h \ + ATM_Params.inl ATM_QoS.h ATM_QoS.inl ATM_Stream.h \ + ATM_Stream.inl Acceptor.cpp Acceptor.h Activation_Queue.h \ + Activation_Queue.inl Active_Map_Manager.h \ + Active_Map_Manager.inl Active_Map_Manager_T.cpp \ + Active_Map_Manager_T.h Active_Map_Manager_T.inl Addr.h \ + Addr.inl Arg_Shifter.cpp Arg_Shifter.h Argv_Type_Converter.h \ + Argv_Type_Converter.inl Array.h Array_Base.cpp Array_Base.h \ + Array_Base.inl Array_Map.cpp Array_Map.h Array_Map.inl \ + Assert.h Asynch_Acceptor.cpp Asynch_Acceptor.h \ + Asynch_Connector.cpp Asynch_Connector.h Asynch_IO.h \ + Asynch_IO_Impl.h Asynch_IO_Impl.inl Asynch_Pseudo_Task.h \ + Atomic_Op.h Atomic_Op.inl Atomic_Op_Sparc.h Atomic_Op_T.cpp \ + Atomic_Op_GCC_T.h Atomic_Op_GCC_T.cpp Atomic_Op_GCC_T.inl \ + Atomic_Op_T.h Atomic_Op_T.inl Auto_Event.h Auto_Event.inl \ + Auto_Functor.cpp Auto_Functor.h Auto_Functor.inl \ + Auto_IncDec_T.cpp Auto_IncDec_T.h Auto_IncDec_T.inl \ + Auto_Ptr.cpp Auto_Ptr.h Auto_Ptr.inl Barrier.h Barrier.inl \ + Base_Thread_Adapter.h Base_Thread_Adapter.inl \ + Based_Pointer_Repository.h Based_Pointer_T.cpp \ + Based_Pointer_T.h Based_Pointer_T.inl Basic_Stats.h \ + Basic_Stats.inl Basic_Types.h Basic_Types.inl Bound_Ptr.h \ + Bound_Ptr.inl CDR_Base.h CDR_Base.inl CDR_Size.h CDR_Size.inl \ + CDR_Stream.h CDR_Stream.inl CORBA_macros.h \ + Cache_Map_Manager_T.cpp Cache_Map_Manager_T.h \ + Cache_Map_Manager_T.inl Cached_Connect_Strategy_T.cpp \ + Cached_Connect_Strategy_T.h Caching_Strategies_T.cpp \ + Caching_Strategies_T.h Caching_Strategies_T.inl \ + Caching_Utility_T.cpp Caching_Utility_T.h Capabilities.h \ + Capabilities.inl Cleanup.h Cleanup.inl \ + Cleanup_Strategies_T.cpp Cleanup_Strategies_T.h Codecs.h \ + Codeset_IBM1047.h Codeset_Registry.h Codeset_Registry.inl \ + Condition_Recursive_Thread_Mutex.h Condition_T.cpp \ + Condition_T.h Condition_T.inl Condition_Thread_Mutex.h \ + Condition_Thread_Mutex.inl Configuration.h Configuration.inl \ + Configuration_Import_Export.h Connection_Recycling_Strategy.h \ + Connector.cpp Connector.h Containers.h Containers.inl \ + Containers_T.cpp Containers_T.h Containers_T.inl \ + Copy_Disabled.h Countdown_Time.h Countdown_Time.inl DEV.h \ + DEV.inl DEV_Addr.h DEV_Addr.inl DEV_Connector.h \ + DEV_Connector.inl DEV_IO.h DEV_IO.inl DLL.h DLL_Manager.h \ + Date_Time.h Date_Time.inl Default_Constants.h \ + Dev_Poll_Reactor.h Dev_Poll_Reactor.inl Dirent.h Dirent.inl \ + Dirent_Selector.h Dirent_Selector.inl Dump.h Dump_T.cpp \ + Dump_T.h Dynamic.h Dynamic.inl Dynamic_Message_Strategy.h \ + Dynamic_Message_Strategy.inl Dynamic_Service.cpp \ + Dynamic_Service.h Dynamic_Service.inl Dynamic_Service_Base.h \ + Dynamic_Service_Dependency.h Encoding_Converter.h \ + Encoding_Converter_Factory.h Env_Value_T.cpp Env_Value_T.h \ + Env_Value_T.inl Event.h Event.inl Event_Handler.h \ + Event_Handler.inl Event_Handler_T.cpp Event_Handler_T.h \ + Event_Handler_T.inl Exception_Macros.h FIFO.h FIFO.inl \ + FIFO_Recv.h FIFO_Recv.inl FIFO_Recv_Msg.h FIFO_Recv_Msg.inl \ + FIFO_Send.h FIFO_Send.inl FIFO_Send_Msg.h FIFO_Send_Msg.inl \ + FILE.h FILE.inl FILE_Addr.h FILE_Addr.inl FILE_Connector.h \ + FILE_Connector.inl FILE_IO.h FILE_IO.inl File_Lock.h \ + File_Lock.inl Filecache.h Flag_Manip.h Flag_Manip.inl \ + Framework_Component.h Framework_Component.inl \ + Framework_Component_T.cpp Framework_Component_T.h \ + Free_List.cpp Free_List.h Functor.h Functor.inl \ + Functor_String.h Functor_String.inl Functor_T.cpp Functor_T.h \ + Functor_T.inl Future.cpp Future.h Future_Set.cpp Future_Set.h \ + Get_Opt.h Get_Opt.inl Global_Macros.h Guard_T.cpp Guard_T.h \ + Guard_T.inl Handle_Gobbler.h Handle_Gobbler.inl Handle_Ops.h \ + Handle_Set.h Handle_Set.inl Hash_Cache_Map_Manager_T.cpp \ + Hash_Cache_Map_Manager_T.h Hash_Cache_Map_Manager_T.inl \ + Hash_Map_Manager.h Hash_Map_Manager_T.cpp Hash_Map_Manager_T.h \ + Hash_Map_Manager_T.inl Hash_Map_With_Allocator_T.cpp \ + Hash_Map_With_Allocator_T.h Hash_Map_With_Allocator_T.inl \ + Hash_Multi_Map_Manager_T.cpp Hash_Multi_Map_Manager_T.h \ + Hash_Multi_Map_Manager_T.inl Hashable.h Hashable.inl \ + High_Res_Timer.h High_Res_Timer.inl ICMP_Socket.h INET_Addr.h \ + INET_Addr.inl IOStream.h IOStream_T.cpp IOStream_T.h \ + IOStream_T.inl IO_Cntl_Msg.h IO_Cntl_Msg.inl IO_SAP.h \ + IO_SAP.inl IPC_SAP.h IPC_SAP.inl If_Then_Else.h Init_ACE.h \ + Intrusive_Auto_Ptr.cpp Intrusive_Auto_Ptr.h \ + Intrusive_Auto_Ptr.inl Intrusive_List.cpp Intrusive_List.h \ + Intrusive_List.inl Intrusive_List_Node.cpp \ + Intrusive_List_Node.h Intrusive_List_Node.inl \ + LOCK_SOCK_Acceptor.cpp LOCK_SOCK_Acceptor.h LSOCK.h LSOCK.inl \ + LSOCK_Acceptor.h LSOCK_CODgram.h LSOCK_CODgram.inl \ + LSOCK_Connector.h LSOCK_Connector.inl LSOCK_Dgram.h \ + LSOCK_Dgram.inl LSOCK_Stream.h LSOCK_Stream.inl Lib_Find.h \ + Local_Memory_Pool.h Local_Name_Space.h Local_Name_Space_T.cpp \ + Local_Name_Space_T.h Local_Tokens.h Local_Tokens.inl Lock.h \ + Lock.inl Lock_Adapter_T.cpp Lock_Adapter_T.h \ + Lock_Adapter_T.inl Log_Msg.h Log_Msg.inl Log_Msg_Backend.h \ + Log_Msg_Callback.h Log_Msg_IPC.h Log_Msg_NT_Event_Log.h \ + Log_Msg_UNIX_Syslog.h Log_Priority.h Log_Record.h \ + Log_Record.inl Logging_Strategy.h MEM_Acceptor.h \ + MEM_Acceptor.inl MEM_Addr.h MEM_Addr.inl MEM_Connector.h \ + MEM_Connector.inl MEM_IO.h MEM_IO.inl MEM_SAP.h MEM_SAP.inl \ + MEM_Stream.h MEM_Stream.inl MMAP_Memory_Pool.h \ + MMAP_Memory_Pool.inl Malloc.h Malloc.inl Malloc_Allocator.h \ + Malloc_Allocator.inl Malloc_Base.h Malloc_T.cpp Malloc_T.h \ + Malloc_T.inl Managed_Object.cpp Managed_Object.h \ + Managed_Object.inl Manual_Event.h Manual_Event.inl \ + Map_Manager.cpp Map_Manager.h Map_Manager.inl Map_T.cpp \ + Map_T.h Map_T.inl Mem_Map.h Mem_Map.inl Memory_Pool.h \ + Message_Block.h Message_Block.inl Message_Block_T.cpp \ + Message_Block_T.h Message_Block_T.inl Message_Queue.h \ + Message_Queue.inl Message_Queue_NT.h Message_Queue_NT.inl \ + Message_Queue_T.cpp Message_Queue_T.h Message_Queue_Vx.h \ + Message_Queue_Vx.inl Method_Object.h Method_Request.h \ + Min_Max.h Module.cpp Module.h Module.inl Monitor_Admin.h \ + Monitor_Admin_Manager.h Monitor_Base.h Monitor_Base.inl \ + Monitor_Control_Action.h Monitor_Control_Types.h \ + Monitor_Point_Registry.h Monitor_Size.h Msg_WFMO_Reactor.h \ + Msg_WFMO_Reactor.inl Multihomed_INET_Addr.h \ + Multihomed_INET_Addr.inl Mutex.h Mutex.inl NT_Service.h \ + NT_Service.inl Name_Proxy.h Name_Request_Reply.h Name_Space.h \ + Naming_Context.h Naming_Context.inl Netlink_Addr.h \ + Netlink_Addr.inl Node.cpp Node.h Notification_Queue.h \ + Notification_Queue.inl Notification_Strategy.h \ + Notification_Strategy.inl Null_Barrier.h Null_Condition.h \ + Null_Mutex.h Null_Semaphore.h Numeric_Limits.h OS.h OS.inl \ + OS_Dirent.h OS_Errno.h OS_Errno.inl OS_Log_Msg_Attributes.h \ + OS_Log_Msg_Attributes.inl OS_Memory.h OS_NS_Thread.h \ + OS_NS_Thread.inl OS_NS_arpa_inet.h OS_NS_arpa_inet.inl \ + OS_NS_ctype.h OS_NS_ctype.inl OS_NS_dirent.h OS_NS_dirent.inl \ + OS_NS_dlfcn.h OS_NS_dlfcn.inl OS_NS_errno.h OS_NS_errno.inl \ + OS_NS_fcntl.h OS_NS_fcntl.inl OS_NS_macros.h OS_NS_math.h \ + OS_NS_math.inl OS_NS_netdb.h OS_NS_netdb.inl OS_NS_poll.h \ + OS_NS_poll.inl OS_NS_pwd.h OS_NS_pwd.inl OS_NS_regex.h \ + OS_NS_regex.inl OS_NS_signal.h OS_NS_signal.inl OS_NS_stdio.h \ + OS_NS_stdio.inl OS_NS_stdlib.h OS_NS_stdlib.inl OS_NS_string.h \ + OS_NS_string.inl OS_NS_strings.h OS_NS_strings.inl \ + OS_NS_stropts.h OS_NS_stropts.inl OS_NS_sys_mman.h \ + OS_NS_sys_mman.inl OS_NS_sys_msg.h OS_NS_sys_msg.inl \ + OS_NS_sys_resource.h OS_NS_sys_resource.inl OS_NS_sys_select.h \ + OS_NS_sys_select.inl OS_NS_sys_sendfile.h \ + OS_NS_sys_sendfile.inl OS_NS_sys_shm.h OS_NS_sys_shm.inl \ + OS_NS_sys_socket.h OS_NS_sys_socket.inl OS_NS_sys_stat.h \ + OS_NS_sys_stat.inl OS_NS_sys_time.h OS_NS_sys_time.inl \ + OS_NS_sys_uio.h OS_NS_sys_uio.inl OS_NS_sys_utsname.h \ + OS_NS_sys_wait.h OS_NS_sys_wait.inl OS_NS_time.h \ + OS_NS_time.inl OS_NS_unistd.h OS_NS_unistd.inl OS_NS_wchar.h \ + OS_NS_wctype.h OS_NS_wctype.inl OS_NS_wchar.inl OS_QoS.h \ + OS_String.h OS_TLI.h OS_TLI.inl OS_Thread_Adapter.h OS_main.h \ + Obchunk.h Obchunk.inl Object_Manager.h Object_Manager.inl \ + Object_Manager_Base.h Obstack_T.cpp Obstack_T.h Obstack_T.inl \ + PI_Malloc.h PI_Malloc.inl POSIX_Asynch_IO.h \ + POSIX_CB_Proactor.h POSIX_Proactor.h POSIX_Proactor.inl \ + Pagefile_Memory_Pool.h Pagefile_Memory_Pool.inl Pair.h \ + Pair_T.cpp Pair_T.h Pair_T.inl Parse_Node.h Ping_Socket.h \ + Ping_Socket.inl Pipe.h Pipe.inl Priority_Reactor.h Proactor.h \ + Proactor.inl Proactor_Impl.h Process.h Process.inl \ + Process_Manager.h Process_Manager.inl Process_Mutex.h \ + Process_Mutex.inl Process_Semaphore.h Process_Semaphore.inl \ + Profile_Timer.h Profile_Timer.inl RB_Tree.cpp RB_Tree.h \ + RB_Tree.inl RW_Mutex.h RW_Mutex.inl RW_Process_Mutex.h \ + RW_Process_Mutex.inl RW_Thread_Mutex.h RW_Thread_Mutex.inl \ + Reactor.h Reactor.inl Reactor_Impl.h \ + Reactor_Notification_Strategy.h \ + Reactor_Notification_Strategy.inl Reactor_Timer_Interface.h \ + Reactor_Token_T.cpp Reactor_Token_T.h Read_Buffer.h \ + Read_Buffer.inl Recursive_Thread_Mutex.h \ + Recursive_Thread_Mutex.inl Recyclable.h Recyclable.inl \ + Refcountable.h Refcountable_T.cpp Refcountable_T.h \ + Refcountable_T.inl Refcounted_Auto_Ptr.cpp \ + Refcounted_Auto_Ptr.h Refcounted_Auto_Ptr.inl Registry.h \ + Registry_Name_Space.h Remote_Name_Space.h Remote_Tokens.h \ + Remote_Tokens.inl Reverse_Lock_T.cpp Reverse_Lock_T.h \ + Reverse_Lock_T.inl SOCK.h SOCK.inl SOCK_Acceptor.h \ + SOCK_Acceptor.inl SOCK_CODgram.h SOCK_CODgram.inl \ + SOCK_Connector.h SOCK_Connector.inl SOCK_Dgram.h \ + SOCK_Dgram.inl SOCK_Dgram_Bcast.h SOCK_Dgram_Bcast.inl \ + SOCK_Dgram_Mcast.h SOCK_Dgram_Mcast.inl SOCK_IO.h SOCK_IO.inl \ + SOCK_Netlink.h SOCK_Netlink.inl SOCK_SEQPACK_Acceptor.h \ + SOCK_SEQPACK_Acceptor.inl SOCK_SEQPACK_Association.h \ + SOCK_SEQPACK_Association.inl SOCK_SEQPACK_Connector.h \ + SOCK_SEQPACK_Connector.inl SOCK_Stream.h SOCK_Stream.inl \ + SPIPE.h SPIPE.inl SPIPE_Acceptor.h SPIPE_Addr.h SPIPE_Addr.inl \ + SPIPE_Connector.h SPIPE_Connector.inl SPIPE_Stream.h \ + SPIPE_Stream.inl SString.h SString.inl SStringfwd.h \ + Stack_Trace.h SUN_Proactor.h SV_Message.h SV_Message.inl \ + SV_Message_Queue.h SV_Message_Queue.inl SV_Semaphore_Complex.h \ + SV_Semaphore_Complex.inl SV_Semaphore_Simple.h \ + SV_Semaphore_Simple.inl SV_Shared_Memory.h \ + SV_Shared_Memory.inl Sample_History.h Sample_History.inl \ + Sbrk_Memory_Pool.h Sched_Params.h Sched_Params.inl \ + Select_Reactor.h Select_Reactor_Base.h Select_Reactor_Base.inl \ + Select_Reactor_T.cpp Select_Reactor_T.h Select_Reactor_T.inl \ + Semaphore.h Semaphore.inl Service_Config.h Service_Config.inl \ + Service_Gestalt.h Service_Gestalt.inl Service_Manager.h \ + Service_Object.h Service_Object.inl Service_Repository.h \ + Service_Repository.inl Service_Types.h Service_Types.inl \ + Shared_Memory.h Shared_Memory_MM.h Shared_Memory_MM.inl \ + Shared_Memory_Pool.h Shared_Memory_SV.h Shared_Memory_SV.inl \ + Shared_Object.h Shared_Object.inl Sig_Adapter.h Sig_Handler.h \ + Sig_Handler.inl Signal.h Signal.inl Singleton.cpp Singleton.h \ + Singleton.inl Sock_Connect.h Static_Object_Lock.h Stats.h \ + Stats.inl Strategies.h Strategies_T.cpp Strategies_T.h \ + Strategies_T.inl Stream.cpp Stream.h Stream.inl \ + Stream_Modules.cpp Stream_Modules.h String_Base.cpp \ + String_Base.h String_Base.inl String_Base_Const.h Svc_Conf.h \ + Svc_Conf_Lexer.h Svc_Conf_Tokens.h Svc_Conf_Token_Table.h \ + Svc_Handler.cpp Svc_Handler.h Synch.h Synch_Options.h \ + Synch_T.cpp Synch_T.h Synch_Traits.h System_Time.h TLI.h \ + TLI.inl TLI_Acceptor.h TLI_Connector.h TLI_Connector.inl \ + TLI_Stream.h TLI_Stream.inl TP_Reactor.h TP_Reactor.inl \ + TSS_Adapter.h TSS_T.cpp TSS_T.h TSS_T.inl TTY_IO.h Task.h \ + Task.inl Task_Ex_T.cpp Task_Ex_T.h Task_Ex_T.inl Task_T.cpp \ + Task_T.h Task_T.inl Test_and_Set.cpp Test_and_Set.h Thread.h \ + Thread.inl Thread_Adapter.h Thread_Adapter.inl \ + Thread_Control.h Thread_Control.inl Thread_Exit.h \ + Thread_Hook.h Thread_Manager.h Thread_Manager.inl \ + Thread_Mutex.h Thread_Mutex.inl Thread_Semaphore.h \ + Thread_Semaphore.inl Throughput_Stats.h Time_Value.h \ + Time_Value.inl Timeprobe.h Timeprobe.inl Timeprobe_T.cpp \ + Timeprobe_T.h Timer_Hash_T.cpp Timer_Hash_T.h Timer_Heap_T.cpp \ + Timer_Heap_T.h Timer_List_T.cpp Timer_List_T.h \ + Timer_Queue_Adapters.cpp Timer_Queue_Adapters.h \ + Timer_Queue_Adapters.inl Timer_Queue_T.cpp Timer_Queue_T.h \ + Timer_Queue_T.inl Timer_Wheel_T.cpp Timer_Wheel_T.h \ + Tokenizer_T.cpp Tokenizer_T.h Timer_Hash.h Timer_Heap.h \ + Timer_List.h Timer_Queue.h Timer_Queuefwd.h Timer_Wheel.h \ + Token.h Token.inl Token_Collection.h Token_Collection.inl \ + Token_Invariants.h Token_Manager.h Token_Manager.inl \ + Token_Request_Reply.h Token_Request_Reply.inl Trace.h \ + Truncate.h Typed_SV_Message.cpp Typed_SV_Message.h \ + Typed_SV_Message.inl Typed_SV_Message_Queue.cpp \ + Typed_SV_Message_Queue.h Typed_SV_Message_Queue.inl \ + UNIX_Addr.h UNIX_Addr.inl UPIPE_Acceptor.h UPIPE_Acceptor.inl \ + UPIPE_Addr.h UPIPE_Connector.h UPIPE_Connector.inl \ + UPIPE_Stream.h UPIPE_Stream.inl UTF16_Encoding_Converter.h \ + UTF16_Encoding_Converter.inl UTF32_Encoding_Converter.h \ + UTF8_Encoding_Converter.h UUID.h UUID.inl Unbounded_Queue.cpp \ + Unbounded_Queue.h Unbounded_Queue.inl Unbounded_Set.cpp \ + Unbounded_Set.h Unbounded_Set.inl Unbounded_Set_Ex.cpp \ + Unbounded_Set_Ex.h Unbounded_Set_Ex.inl Value_Ptr.h \ + Vector_T.cpp Vector_T.h Vector_T.inl Version.h \ + Versioned_Namespace.h WFMO_Reactor.h WFMO_Reactor.inl \ + WIN32_Asynch_IO.h WIN32_Proactor.h XML_Svc_Conf.h \ + XTI_ATM_Mcast.h XTI_ATM_Mcast.inl ace_wchar.h ace_wchar.inl \ + checked_iterator.h config-WinCE.h config-all.h config-lite.h \ + config-macros.h config-minimal.h config-win32-borland.h \ + config-win32-common.h config-win32-ghs.h config-win32-msvc-7.h \ + config-win32-msvc-8.h config-win32-msvc.h config-win32.h \ + config.h iosfwd.h os_include/arpa/os_inet.h \ + os_include/net/os_if.h os_include/netinet/os_in.h \ + os_include/netinet/os_tcp.h os_include/os_aio.h \ + os_include/os_assert.h os_include/os_byteswap.h \ + os_include/os_complex.h os_include/os_cpio.h \ + os_include/os_ctype.h os_include/os_dirent.h \ + os_include/os_dlfcn.h os_include/os_errno.h \ + os_include/os_fcntl.h os_include/os_fenv.h \ + os_include/os_float.h os_include/os_fmtmsg.h \ + os_include/os_fnmatch.h os_include/os_ftw.h \ + os_include/os_glob.h os_include/os_grp.h os_include/os_iconv.h \ + os_include/os_intrin.h os_include/os_inttypes.h \ + os_include/os_iso646.h os_include/os_kstat.h \ + os_include/os_langinfo.h os_include/os_libgen.h \ + os_include/os_limits.h os_include/os_local.h \ + os_include/os_math.h os_include/os_monetary.h \ + os_include/os_mqueue.h os_include/os_ndbm.h \ + os_include/os_netdb.h os_include/os_nl_types.h \ + os_include/os_pdh.h os_include/os_pdhmsg.h \ + os_include/os_poll.h os_include/os_pthread.h \ + os_include/os_pwd.h os_include/os_regex.h \ + os_include/os_sched.h os_include/os_search.h \ + os_include/os_semaphore.h os_include/os_setjmp.h \ + os_include/os_signal.h os_include/os_spawn.h \ + os_include/os_stdarg.h os_include/os_stdbool.h \ + os_include/os_stddef.h os_include/os_stdint.h \ + os_include/os_stdio.h os_include/os_stdlib.h \ + os_include/os_string.h os_include/os_strings.h \ + os_include/os_stropts.h os_include/os_syslog.h \ + os_include/os_tar.h os_include/os_termios.h \ + os_include/os_tgmath.h os_include/os_time.h \ + os_include/os_trace.h os_include/os_typeinfo.h \ + os_include/os_ucontext.h os_include/os_ulimit.h \ + os_include/os_unistd.h os_include/os_utime.h \ + os_include/os_utmpx.h os_include/os_wchar.h \ + os_include/os_wctype.h os_include/os_wordexp.h \ + os_include/sys/os_ipc.h os_include/sys/os_loadavg.h \ + os_include/sys/os_mman.h os_include/sys/os_msg.h \ + os_include/sys/os_pstat.h os_include/sys/os_resource.h \ + os_include/sys/os_select.h os_include/sys/os_sem.h \ + os_include/sys/os_shm.h os_include/sys/os_socket.h \ + os_include/sys/os_stat.h os_include/sys/os_statvfs.h \ + os_include/sys/os_sysctl.h os_include/sys/os_sysinfo.h \ + os_include/sys/os_time.h os_include/sys/os_timeb.h \ + os_include/sys/os_times.h os_include/sys/os_types.h \ + os_include/sys/os_uio.h os_include/sys/os_un.h \ + os_include/sys/os_utsname.h os_include/sys/os_wait.h post.h \ + pre.h streams.h svc_export.h FlReactor/ACE_FlReactor_export.h \ + FlReactor/FlReactor.h QtReactor/ACE_QtReactor_export.h \ + QtReactor/QtReactor.h TkReactor/ACE_TkReactor_export.h \ + TkReactor/TkReactor.h XtReactor/ACE_XtReactor_export.h \ + XtReactor/XtReactor.h +HEADERS = $(nobase_include_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACEXML = @ACEXML@ +ACE_BETA = @ACE_BETA@ +ACE_BZIP2_CPPFLAGS = @ACE_BZIP2_CPPFLAGS@ +ACE_BZIP2_LDFLAGS = @ACE_BZIP2_LDFLAGS@ +ACE_BZIP2_LIBS = @ACE_BZIP2_LIBS@ +ACE_FLTK_CPPFLAGS = @ACE_FLTK_CPPFLAGS@ +ACE_FLTK_LIBS = @ACE_FLTK_LIBS@ +ACE_FOX_CPPFLAGS = @ACE_FOX_CPPFLAGS@ +ACE_FOX_LIBS = @ACE_FOX_LIBS@ +ACE_KERBEROS_INCLUDES = @ACE_KERBEROS_INCLUDES@ +ACE_MAJOR = @ACE_MAJOR@ +ACE_MINOR = @ACE_MINOR@ +ACE_QT_CPPFLAGS = @ACE_QT_CPPFLAGS@ +ACE_QT_LIBS = @ACE_QT_LIBS@ +ACE_TCL_CPPFLAGS = @ACE_TCL_CPPFLAGS@ +ACE_TCL_LIBS = @ACE_TCL_LIBS@ +ACE_TESTS_DIR = @ACE_TESTS_DIR@ +ACE_TK_CPPFLAGS = @ACE_TK_CPPFLAGS@ +ACE_TK_LIBS = @ACE_TK_LIBS@ +ACE_TLS_CPPFLAGS = @ACE_TLS_CPPFLAGS@ +ACE_TLS_LDFLAGS = @ACE_TLS_LDFLAGS@ +ACE_TLS_LIBS = @ACE_TLS_LIBS@ +ACE_VERSION_NAME = @ACE_VERSION_NAME@ +ACE_X11_CPPFLAGS = @ACE_X11_CPPFLAGS@ +ACE_X11_LDFLAGS = @ACE_X11_LDFLAGS@ +ACE_X11_LIBS = @ACE_X11_LIBS@ +ACE_XLIBS = @ACE_XLIBS@ +ACE_XT_CPPFLAGS = @ACE_XT_CPPFLAGS@ +ACE_XT_LDFLAGS = @ACE_XT_LDFLAGS@ +ACE_XT_LIBS = @ACE_XT_LIBS@ +ACE_ZLIB_CPPFLAGS = @ACE_ZLIB_CPPFLAGS@ +ACE_ZLIB_LDFLAGS = @ACE_ZLIB_LDFLAGS@ +ACE_ZLIB_LIBS = @ACE_ZLIB_LIBS@ +ACE_ZZIP_CPPFLAGS = @ACE_ZZIP_CPPFLAGS@ +ACE_ZZIP_LDFLAGS = @ACE_ZZIP_LDFLAGS@ +ACE_ZZIP_LIBS = @ACE_ZZIP_LIBS@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +ASNMP = @ASNMP@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FLTKCONFIG = @FLTKCONFIG@ +FOXCONFIG = @FOXCONFIG@ +GPERF = @GPERF@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KOKYU = @KOKYU@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PROF = @PROF@ +PURIFY = @PURIFY@ +QTDIR = @QTDIR@ +QUANTIFY = @QUANTIFY@ +Qt_CFLAGS = @Qt_CFLAGS@ +Qt_LIBS = @Qt_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAO = @TAO@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +XTREACTOR_TEST_XLIBS = @XTREACTOR_TEST_XLIBS@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@/ace +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +protocols = @protocols@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkgconfigdir = @libdir@/pkgconfig +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) +SUBDIRS = \ + . \ + ETCL \ + Monitor_Control \ + SSL + +CLEANFILES = $(am__append_4) $(am__append_8) $(am__append_9) \ + $(am__append_16) $(am__append_20) +lib_LTLIBRARIES = $(am__append_1) $(am__append_5) $(am__append_10) \ + $(am__append_13) $(am__append_17) +pkgconfig_DATA = $(am__append_3) $(am__append_7) $(am__append_12) \ + $(am__append_15) $(am__append_19) +nobase_include_HEADERS = $(am__append_2) $(am__append_6) \ + $(am__append_11) $(am__append_14) $(am__append_18) +@BUILD_ACE_FOR_TAO_FALSE@libACE_la_CPPFLAGS = \ +@BUILD_ACE_FOR_TAO_FALSE@ -I$(ACE_ROOT) \ +@BUILD_ACE_FOR_TAO_FALSE@ -I$(ACE_BUILDDIR) \ +@BUILD_ACE_FOR_TAO_FALSE@ -DACE_BUILD_DLL + +@BUILD_ACE_FOR_TAO_FALSE@libACE_la_SOURCES = \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE_crc32.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ACE_crc_ccitt.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Params.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_QoS.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ATM_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Activation_Queue.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Active_Map_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Argv_Type_Converter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Assert.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_IO_Impl.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Asynch_Pseudo_Task.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Atomic_Op_Sparc.c \ +@BUILD_ACE_FOR_TAO_FALSE@ Auto_Event.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Barrier.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Base_Thread_Adapter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Based_Pointer_Repository.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Basic_Stats.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Basic_Types.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Size.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ CDR_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Capabilities.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Cleanup.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Codecs.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Codeset_IBM1047.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Codeset_Registry.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Codeset_Registry_db.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_Recursive_Thread_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Condition_Thread_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Configuration.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Configuration_Import_Export.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Connection_Recycling_Strategy.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Containers.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Copy_Disabled.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Countdown_Time.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ DEV_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ DLL.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ DLL_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Date_Time.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dev_Poll_Reactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dirent.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dirent_Selector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dump.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Message_Strategy.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Dynamic_Service_Dependency.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Encoding_Converter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Encoding_Converter_Factory.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Event.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Event_Handler.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Recv.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Recv_Msg.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Send.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FIFO_Send_Msg.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ FILE_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ File_Lock.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Filecache.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Flag_Manip.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Framework_Component.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Functor_String.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Get_Opt.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Ops.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Handle_Set.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Hashable.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ High_Res_Timer.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ICMP_Socket.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ INET_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ IOStream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ IO_Cntl_Msg.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ IO_SAP.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ IPC_SAP.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Init_ACE.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_CODgram.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Dgram.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ LSOCK_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Lib_Find.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Memory_Pool.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Name_Space.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Local_Tokens.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Lock.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_Backend.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_Callback.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_IPC.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_NT_Event_Log.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Msg_UNIX_Syslog.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Log_Record.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Logging_Strategy.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_SAP.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MEM_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ MMAP_Memory_Pool.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Malloc_Allocator.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Manual_Event.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Mem_Map.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Block.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_NT.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Message_Queue_Vx.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Method_Request.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Admin.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Admin_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Control_Action.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Control_Types.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Point_Registry.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Monitor_Size.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Msg_WFMO_Reactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Multihomed_INET_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ NT_Service.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Name_Proxy.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Name_Request_Reply.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Name_Space.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Naming_Context.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Netlink_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Notification_Queue.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Notification_Strategy.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Errno.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Log_Msg_Attributes.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_Thread.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_arpa_inet.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_ctype.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_dirent.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_dlfcn.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_errno.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_fcntl.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_math.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_netdb.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_poll.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_pwd.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_regex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_signal.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stdio.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stdlib.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_string.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_strings.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_stropts.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_mman.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_msg.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_resource.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_select.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_sendfile.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_shm.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_socket.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_stat.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_time.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_uio.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_utsname.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_sys_wait.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_time.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_unistd.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_wchar.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_NS_wctype.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_QoS.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_TLI.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_Thread_Adapter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ OS_main.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Obchunk.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Object_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Object_Manager_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ PI_Malloc.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_Asynch_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_CB_Proactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ POSIX_Proactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Pagefile_Memory_Pool.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Parse_Node.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Ping_Socket.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Pipe.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Priority_Reactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Proactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Proactor_Impl.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Process.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Process_Semaphore.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Profile_Timer.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Process_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ RW_Thread_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Impl.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Notification_Strategy.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Reactor_Timer_Interface.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Read_Buffer.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Recursive_Thread_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Recyclable.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Registry.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Registry_Name_Space.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Remote_Name_Space.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Remote_Tokens.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Rtems_init.c \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_CODgram.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram_Bcast.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Dgram_Mcast.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Netlink.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Association.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_SEQPACK_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SOCK_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SPIPE_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SString.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Stack_Trace.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SUN_Proactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Message.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Message_Queue.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Semaphore_Complex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Semaphore_Simple.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ SV_Shared_Memory.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Sample_History.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Sbrk_Memory_Pool.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Sched_Params.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Select_Reactor_Base.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Semaphore.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Config.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Gestalt.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Object.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Repository.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Service_Types.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_MM.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_Pool.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Memory_SV.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Shared_Object.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Sig_Adapter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Sig_Handler.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Signal.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Sock_Connect.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Stats.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ String_Base_Const.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Conf_Lexer.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Svc_Conf_y.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Synch_Options.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ System_Time.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TLI_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TP_Reactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TSS_Adapter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ TTY_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Task.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Adapter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Control.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Exit.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Hook.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Mutex.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Thread_Semaphore.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Throughput_Stats.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Time_Value.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Timeprobe.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Token.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Collection.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Invariants.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Manager.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Token_Request_Reply.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ Trace.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UNIX_Addr.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Acceptor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Connector.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UPIPE_Stream.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF16_Encoding_Converter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF32_Encoding_Converter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UTF8_Encoding_Converter.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ UUID.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ WFMO_Reactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ WIN32_Asynch_IO.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ WIN32_Proactor.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ XML_Svc_Conf.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ XTI_ATM_Mcast.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ ace_wchar.cpp \ +@BUILD_ACE_FOR_TAO_FALSE@ gethrtime.cpp + +@BUILD_ACE_FOR_TAO_FALSE@libACE_la_LDFLAGS = \ +@BUILD_ACE_FOR_TAO_FALSE@ -release @ACE_VERSION_NAME@ + +EXTRA_DIST = ACE.pc.in ace.rc FlReactor/ACE_FlReactor.pc.in \ + QtReactor/ACE_QtReactor.pc.in TkReactor/ACE_TkReactor.pc.in \ + XtReactor/ACE_XtReactor.pc.in +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@libACE_FlReactor_la_CPPFLAGS = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ -I$(ACE_ROOT) \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ -I$(ACE_BUILDDIR) \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ $(ACE_FLTK_CPPFLAGS) \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ -DACE_FLREACTOR_BUILD_DLL + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@libACE_FlReactor_la_SOURCES = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ FlReactor/FlReactor.cpp + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@libACE_FlReactor_la_LDFLAGS = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ -release @ACE_VERSION_NAME@ $(ACE_FLTK_LDFLAGS) + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@libACE_FlReactor_la_LIBADD = \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ libACE.la \ +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ $(ACE_FLTK_LIBS) + +@BUILD_QT_TRUE@BUILT_SOURCES = \ +@BUILD_QT_TRUE@ QtReactor/QtReactor_moc.cpp + +@BUILD_QT_TRUE@libACE_QtReactor_la_CPPFLAGS = \ +@BUILD_QT_TRUE@ -I$(ACE_ROOT) \ +@BUILD_QT_TRUE@ -I$(ACE_BUILDDIR) \ +@BUILD_QT_TRUE@ $(ACE_QT_CPPFLAGS) \ +@BUILD_QT_TRUE@ -DACE_QTREACTOR_BUILD_DLL + +@BUILD_QT_TRUE@libACE_QtReactor_la_SOURCES = \ +@BUILD_QT_TRUE@ QtReactor/QtReactor.cpp \ +@BUILD_QT_TRUE@ QtReactor/QtReactor_moc.cpp + +@BUILD_QT_TRUE@libACE_QtReactor_la_LDFLAGS = \ +@BUILD_QT_TRUE@ -release @ACE_VERSION_NAME@ $(ACE_QT_LDFLAGS) + +@BUILD_QT_TRUE@libACE_QtReactor_la_LIBADD = \ +@BUILD_QT_TRUE@ libACE.la \ +@BUILD_QT_TRUE@ $(ACE_QT_LIBS) + +@BUILD_TK_TRUE@libACE_TkReactor_la_CPPFLAGS = \ +@BUILD_TK_TRUE@ -I$(ACE_ROOT) \ +@BUILD_TK_TRUE@ -I$(ACE_BUILDDIR) \ +@BUILD_TK_TRUE@ $(ACE_TK_CPPFLAGS) \ +@BUILD_TK_TRUE@ $(ACE_TCL_CPPFLAGS) \ +@BUILD_TK_TRUE@ -DACE_TKREACTOR_BUILD_DLL + +@BUILD_TK_TRUE@libACE_TkReactor_la_SOURCES = \ +@BUILD_TK_TRUE@ TkReactor/TkReactor.cpp + +@BUILD_TK_TRUE@libACE_TkReactor_la_LDFLAGS = \ +@BUILD_TK_TRUE@ -release @ACE_VERSION_NAME@ $(ACE_TK_LDFLAGS) $(ACE_TCL_LDFLAGS) + +@BUILD_TK_TRUE@libACE_TkReactor_la_LIBADD = \ +@BUILD_TK_TRUE@ libACE.la \ +@BUILD_TK_TRUE@ $(ACE_TK_LIBS) \ +@BUILD_TK_TRUE@ $(ACE_TCL_LIBS) + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@libACE_XtReactor_la_CPPFLAGS = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ -I$(ACE_ROOT) \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ -I$(ACE_BUILDDIR) \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ $(ACE_X11_CPPFLAGS) \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ $(ACE_XT_CPPFLAGS) \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ -DACE_XTREACTOR_BUILD_DLL + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@libACE_XtReactor_la_SOURCES = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ XtReactor/XtReactor.cpp + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@libACE_XtReactor_la_LDFLAGS = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ -release @ACE_VERSION_NAME@ $(ACE_X11_LDFLAGS) $(ACE_XT_LDFLAGS) + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@libACE_XtReactor_la_LIBADD = \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ libACE.la \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ $(ACE_XT_LIBS) \ +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ $(ACE_X11_LIBS) + +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ace/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign ace/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status ace/config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libACE.la: $(libACE_la_OBJECTS) $(libACE_la_DEPENDENCIES) + $(libACE_la_LINK) $(am_libACE_la_rpath) $(libACE_la_OBJECTS) $(libACE_la_LIBADD) $(LIBS) +libACE_FlReactor.la: $(libACE_FlReactor_la_OBJECTS) $(libACE_FlReactor_la_DEPENDENCIES) + $(libACE_FlReactor_la_LINK) $(am_libACE_FlReactor_la_rpath) $(libACE_FlReactor_la_OBJECTS) $(libACE_FlReactor_la_LIBADD) $(LIBS) +libACE_QtReactor.la: $(libACE_QtReactor_la_OBJECTS) $(libACE_QtReactor_la_DEPENDENCIES) + $(libACE_QtReactor_la_LINK) $(am_libACE_QtReactor_la_rpath) $(libACE_QtReactor_la_OBJECTS) $(libACE_QtReactor_la_LIBADD) $(LIBS) +libACE_TkReactor.la: $(libACE_TkReactor_la_OBJECTS) $(libACE_TkReactor_la_DEPENDENCIES) + $(libACE_TkReactor_la_LINK) $(am_libACE_TkReactor_la_rpath) $(libACE_TkReactor_la_OBJECTS) $(libACE_TkReactor_la_LIBADD) $(LIBS) +libACE_XtReactor.la: $(libACE_XtReactor_la_OBJECTS) $(libACE_XtReactor_la_DEPENDENCIES) + $(libACE_XtReactor_la_LINK) $(am_libACE_XtReactor_la_rpath) $(libACE_XtReactor_la_OBJECTS) $(libACE_XtReactor_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_FlReactor_la-FlReactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_QtReactor_la-QtReactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_QtReactor_la-QtReactor_moc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_TkReactor_la-TkReactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_XtReactor_la-XtReactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ACE.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ACE_crc32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ACE_crc_ccitt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ATM_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ATM_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ATM_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ATM_Params.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ATM_QoS.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ATM_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Activation_Queue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Active_Map_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Argv_Type_Converter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Assert.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Asynch_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Asynch_IO_Impl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Asynch_Pseudo_Task.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Atomic_Op.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Atomic_Op_Sparc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Auto_Event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Barrier.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Base_Thread_Adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Based_Pointer_Repository.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Basic_Stats.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Basic_Types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-CDR_Base.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-CDR_Size.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-CDR_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Capabilities.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Cleanup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Codecs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Codeset_IBM1047.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Codeset_Registry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Codeset_Registry_db.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Condition_Recursive_Thread_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Condition_Thread_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Configuration.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Configuration_Import_Export.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Connection_Recycling_Strategy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Containers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Copy_Disabled.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Countdown_Time.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-DEV.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-DEV_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-DEV_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-DEV_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-DLL.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-DLL_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Date_Time.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dev_Poll_Reactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dirent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dirent_Selector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dump.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dynamic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dynamic_Message_Strategy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dynamic_Service_Base.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Dynamic_Service_Dependency.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Encoding_Converter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Encoding_Converter_Factory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Event_Handler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FIFO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FIFO_Recv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FIFO_Recv_Msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FIFO_Send.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FIFO_Send_Msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FILE.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FILE_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FILE_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-FILE_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-File_Lock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Filecache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Flag_Manip.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Framework_Component.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Functor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Functor_String.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Get_Opt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Handle_Ops.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Handle_Set.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Hashable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-High_Res_Timer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ICMP_Socket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-INET_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-IOStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-IO_Cntl_Msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-IO_SAP.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-IPC_SAP.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Init_ACE.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-LSOCK.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-LSOCK_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-LSOCK_CODgram.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-LSOCK_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-LSOCK_Dgram.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-LSOCK_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Lib_Find.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Local_Memory_Pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Local_Name_Space.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Local_Tokens.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Lock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Msg_Backend.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Msg_Callback.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Msg_IPC.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Msg_NT_Event_Log.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Msg_UNIX_Syslog.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Log_Record.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Logging_Strategy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MEM_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MEM_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MEM_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MEM_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MEM_SAP.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MEM_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-MMAP_Memory_Pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Malloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Malloc_Allocator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Manual_Event.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Mem_Map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Message_Block.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Message_Queue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Message_Queue_NT.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Message_Queue_Vx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Method_Request.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Admin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Admin_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Base.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Control_Action.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Control_Types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Point_Registry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Monitor_Size.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Msg_WFMO_Reactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Multihomed_INET_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-NT_Service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Name_Proxy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Name_Request_Reply.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Name_Space.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Naming_Context.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Netlink_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Notification_Queue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Notification_Strategy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_Errno.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_Log_Msg_Attributes.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_Thread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_arpa_inet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_ctype.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_dirent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_dlfcn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_errno.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_fcntl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_math.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_netdb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_poll.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_pwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_regex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_signal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_stdio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_stdlib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_string.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_strings.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_stropts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_mman.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_resource.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_select.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_sendfile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_shm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_socket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_stat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_time.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_uio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_utsname.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_sys_wait.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_time.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_unistd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_wchar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_NS_wctype.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_QoS.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_TLI.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_Thread_Adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-OS_main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Obchunk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Object_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Object_Manager_Base.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-PI_Malloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-POSIX_Asynch_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-POSIX_CB_Proactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-POSIX_Proactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Pagefile_Memory_Pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Parse_Node.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Ping_Socket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Pipe.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Priority_Reactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Proactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Proactor_Impl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Process.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Process_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Process_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Process_Semaphore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Profile_Timer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-RW_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-RW_Process_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-RW_Thread_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Reactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Reactor_Impl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Reactor_Notification_Strategy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Reactor_Timer_Interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Read_Buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Recursive_Thread_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Recyclable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Registry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Registry_Name_Space.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Remote_Name_Space.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Remote_Tokens.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Rtems_init.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_CODgram.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Dgram.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Dgram_Bcast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Dgram_Mcast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Netlink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_SEQPACK_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_SEQPACK_Association.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_SEQPACK_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SOCK_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SPIPE.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SPIPE_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SPIPE_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SPIPE_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SPIPE_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SString.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SUN_Proactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SV_Message.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SV_Message_Queue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SV_Semaphore_Complex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SV_Semaphore_Simple.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-SV_Shared_Memory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Sample_History.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Sbrk_Memory_Pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Sched_Params.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Select_Reactor_Base.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Semaphore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Service_Config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Service_Gestalt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Service_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Service_Object.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Service_Repository.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Service_Types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Shared_Memory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Shared_Memory_MM.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Shared_Memory_Pool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Shared_Memory_SV.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Shared_Object.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Sig_Adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Sig_Handler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Signal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Sock_Connect.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Stack_Trace.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Stats.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-String_Base_Const.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Svc_Conf_Lexer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Svc_Conf_y.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Synch_Options.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-System_Time.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TLI.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TLI_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TLI_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TLI_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TP_Reactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TSS_Adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-TTY_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Task.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Control.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Exit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Hook.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Mutex.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Thread_Semaphore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Throughput_Stats.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Time_Value.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Timeprobe.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Token.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Token_Collection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Token_Invariants.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Token_Manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Token_Request_Reply.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-Trace.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UNIX_Addr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UPIPE_Acceptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UPIPE_Connector.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UPIPE_Stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UTF16_Encoding_Converter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UTF32_Encoding_Converter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UTF8_Encoding_Converter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-UUID.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-WFMO_Reactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-WIN32_Asynch_IO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-WIN32_Proactor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-XML_Svc_Conf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-XTI_ATM_Mcast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-ace_wchar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libACE_la-gethrtime.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libACE_la-Atomic_Op_Sparc.lo: Atomic_Op_Sparc.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libACE_la-Atomic_Op_Sparc.lo -MD -MP -MF $(DEPDIR)/libACE_la-Atomic_Op_Sparc.Tpo -c -o libACE_la-Atomic_Op_Sparc.lo `test -f 'Atomic_Op_Sparc.c' || echo '$(srcdir)/'`Atomic_Op_Sparc.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Atomic_Op_Sparc.Tpo $(DEPDIR)/libACE_la-Atomic_Op_Sparc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Atomic_Op_Sparc.c' object='libACE_la-Atomic_Op_Sparc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libACE_la-Atomic_Op_Sparc.lo `test -f 'Atomic_Op_Sparc.c' || echo '$(srcdir)/'`Atomic_Op_Sparc.c + +libACE_la-Rtems_init.lo: Rtems_init.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libACE_la-Rtems_init.lo -MD -MP -MF $(DEPDIR)/libACE_la-Rtems_init.Tpo -c -o libACE_la-Rtems_init.lo `test -f 'Rtems_init.c' || echo '$(srcdir)/'`Rtems_init.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Rtems_init.Tpo $(DEPDIR)/libACE_la-Rtems_init.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Rtems_init.c' object='libACE_la-Rtems_init.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libACE_la-Rtems_init.lo `test -f 'Rtems_init.c' || echo '$(srcdir)/'`Rtems_init.c + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libACE_la-ACE.lo: ACE.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ACE.lo -MD -MP -MF $(DEPDIR)/libACE_la-ACE.Tpo -c -o libACE_la-ACE.lo `test -f 'ACE.cpp' || echo '$(srcdir)/'`ACE.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ACE.Tpo $(DEPDIR)/libACE_la-ACE.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ACE.cpp' object='libACE_la-ACE.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ACE.lo `test -f 'ACE.cpp' || echo '$(srcdir)/'`ACE.cpp + +libACE_la-ACE_crc32.lo: ACE_crc32.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ACE_crc32.lo -MD -MP -MF $(DEPDIR)/libACE_la-ACE_crc32.Tpo -c -o libACE_la-ACE_crc32.lo `test -f 'ACE_crc32.cpp' || echo '$(srcdir)/'`ACE_crc32.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ACE_crc32.Tpo $(DEPDIR)/libACE_la-ACE_crc32.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ACE_crc32.cpp' object='libACE_la-ACE_crc32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ACE_crc32.lo `test -f 'ACE_crc32.cpp' || echo '$(srcdir)/'`ACE_crc32.cpp + +libACE_la-ACE_crc_ccitt.lo: ACE_crc_ccitt.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ACE_crc_ccitt.lo -MD -MP -MF $(DEPDIR)/libACE_la-ACE_crc_ccitt.Tpo -c -o libACE_la-ACE_crc_ccitt.lo `test -f 'ACE_crc_ccitt.cpp' || echo '$(srcdir)/'`ACE_crc_ccitt.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ACE_crc_ccitt.Tpo $(DEPDIR)/libACE_la-ACE_crc_ccitt.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ACE_crc_ccitt.cpp' object='libACE_la-ACE_crc_ccitt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ACE_crc_ccitt.lo `test -f 'ACE_crc_ccitt.cpp' || echo '$(srcdir)/'`ACE_crc_ccitt.cpp + +libACE_la-ATM_Acceptor.lo: ATM_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ATM_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-ATM_Acceptor.Tpo -c -o libACE_la-ATM_Acceptor.lo `test -f 'ATM_Acceptor.cpp' || echo '$(srcdir)/'`ATM_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ATM_Acceptor.Tpo $(DEPDIR)/libACE_la-ATM_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ATM_Acceptor.cpp' object='libACE_la-ATM_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ATM_Acceptor.lo `test -f 'ATM_Acceptor.cpp' || echo '$(srcdir)/'`ATM_Acceptor.cpp + +libACE_la-ATM_Addr.lo: ATM_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ATM_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-ATM_Addr.Tpo -c -o libACE_la-ATM_Addr.lo `test -f 'ATM_Addr.cpp' || echo '$(srcdir)/'`ATM_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ATM_Addr.Tpo $(DEPDIR)/libACE_la-ATM_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ATM_Addr.cpp' object='libACE_la-ATM_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ATM_Addr.lo `test -f 'ATM_Addr.cpp' || echo '$(srcdir)/'`ATM_Addr.cpp + +libACE_la-ATM_Connector.lo: ATM_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ATM_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-ATM_Connector.Tpo -c -o libACE_la-ATM_Connector.lo `test -f 'ATM_Connector.cpp' || echo '$(srcdir)/'`ATM_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ATM_Connector.Tpo $(DEPDIR)/libACE_la-ATM_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ATM_Connector.cpp' object='libACE_la-ATM_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ATM_Connector.lo `test -f 'ATM_Connector.cpp' || echo '$(srcdir)/'`ATM_Connector.cpp + +libACE_la-ATM_Params.lo: ATM_Params.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ATM_Params.lo -MD -MP -MF $(DEPDIR)/libACE_la-ATM_Params.Tpo -c -o libACE_la-ATM_Params.lo `test -f 'ATM_Params.cpp' || echo '$(srcdir)/'`ATM_Params.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ATM_Params.Tpo $(DEPDIR)/libACE_la-ATM_Params.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ATM_Params.cpp' object='libACE_la-ATM_Params.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ATM_Params.lo `test -f 'ATM_Params.cpp' || echo '$(srcdir)/'`ATM_Params.cpp + +libACE_la-ATM_QoS.lo: ATM_QoS.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ATM_QoS.lo -MD -MP -MF $(DEPDIR)/libACE_la-ATM_QoS.Tpo -c -o libACE_la-ATM_QoS.lo `test -f 'ATM_QoS.cpp' || echo '$(srcdir)/'`ATM_QoS.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ATM_QoS.Tpo $(DEPDIR)/libACE_la-ATM_QoS.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ATM_QoS.cpp' object='libACE_la-ATM_QoS.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ATM_QoS.lo `test -f 'ATM_QoS.cpp' || echo '$(srcdir)/'`ATM_QoS.cpp + +libACE_la-ATM_Stream.lo: ATM_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ATM_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-ATM_Stream.Tpo -c -o libACE_la-ATM_Stream.lo `test -f 'ATM_Stream.cpp' || echo '$(srcdir)/'`ATM_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ATM_Stream.Tpo $(DEPDIR)/libACE_la-ATM_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ATM_Stream.cpp' object='libACE_la-ATM_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ATM_Stream.lo `test -f 'ATM_Stream.cpp' || echo '$(srcdir)/'`ATM_Stream.cpp + +libACE_la-Activation_Queue.lo: Activation_Queue.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Activation_Queue.lo -MD -MP -MF $(DEPDIR)/libACE_la-Activation_Queue.Tpo -c -o libACE_la-Activation_Queue.lo `test -f 'Activation_Queue.cpp' || echo '$(srcdir)/'`Activation_Queue.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Activation_Queue.Tpo $(DEPDIR)/libACE_la-Activation_Queue.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Activation_Queue.cpp' object='libACE_la-Activation_Queue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Activation_Queue.lo `test -f 'Activation_Queue.cpp' || echo '$(srcdir)/'`Activation_Queue.cpp + +libACE_la-Active_Map_Manager.lo: Active_Map_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Active_Map_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Active_Map_Manager.Tpo -c -o libACE_la-Active_Map_Manager.lo `test -f 'Active_Map_Manager.cpp' || echo '$(srcdir)/'`Active_Map_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Active_Map_Manager.Tpo $(DEPDIR)/libACE_la-Active_Map_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Active_Map_Manager.cpp' object='libACE_la-Active_Map_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Active_Map_Manager.lo `test -f 'Active_Map_Manager.cpp' || echo '$(srcdir)/'`Active_Map_Manager.cpp + +libACE_la-Addr.lo: Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-Addr.Tpo -c -o libACE_la-Addr.lo `test -f 'Addr.cpp' || echo '$(srcdir)/'`Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Addr.Tpo $(DEPDIR)/libACE_la-Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Addr.cpp' object='libACE_la-Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Addr.lo `test -f 'Addr.cpp' || echo '$(srcdir)/'`Addr.cpp + +libACE_la-Argv_Type_Converter.lo: Argv_Type_Converter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Argv_Type_Converter.lo -MD -MP -MF $(DEPDIR)/libACE_la-Argv_Type_Converter.Tpo -c -o libACE_la-Argv_Type_Converter.lo `test -f 'Argv_Type_Converter.cpp' || echo '$(srcdir)/'`Argv_Type_Converter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Argv_Type_Converter.Tpo $(DEPDIR)/libACE_la-Argv_Type_Converter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Argv_Type_Converter.cpp' object='libACE_la-Argv_Type_Converter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Argv_Type_Converter.lo `test -f 'Argv_Type_Converter.cpp' || echo '$(srcdir)/'`Argv_Type_Converter.cpp + +libACE_la-Assert.lo: Assert.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Assert.lo -MD -MP -MF $(DEPDIR)/libACE_la-Assert.Tpo -c -o libACE_la-Assert.lo `test -f 'Assert.cpp' || echo '$(srcdir)/'`Assert.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Assert.Tpo $(DEPDIR)/libACE_la-Assert.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Assert.cpp' object='libACE_la-Assert.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Assert.lo `test -f 'Assert.cpp' || echo '$(srcdir)/'`Assert.cpp + +libACE_la-Asynch_IO.lo: Asynch_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Asynch_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-Asynch_IO.Tpo -c -o libACE_la-Asynch_IO.lo `test -f 'Asynch_IO.cpp' || echo '$(srcdir)/'`Asynch_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Asynch_IO.Tpo $(DEPDIR)/libACE_la-Asynch_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Asynch_IO.cpp' object='libACE_la-Asynch_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Asynch_IO.lo `test -f 'Asynch_IO.cpp' || echo '$(srcdir)/'`Asynch_IO.cpp + +libACE_la-Asynch_IO_Impl.lo: Asynch_IO_Impl.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Asynch_IO_Impl.lo -MD -MP -MF $(DEPDIR)/libACE_la-Asynch_IO_Impl.Tpo -c -o libACE_la-Asynch_IO_Impl.lo `test -f 'Asynch_IO_Impl.cpp' || echo '$(srcdir)/'`Asynch_IO_Impl.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Asynch_IO_Impl.Tpo $(DEPDIR)/libACE_la-Asynch_IO_Impl.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Asynch_IO_Impl.cpp' object='libACE_la-Asynch_IO_Impl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Asynch_IO_Impl.lo `test -f 'Asynch_IO_Impl.cpp' || echo '$(srcdir)/'`Asynch_IO_Impl.cpp + +libACE_la-Asynch_Pseudo_Task.lo: Asynch_Pseudo_Task.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Asynch_Pseudo_Task.lo -MD -MP -MF $(DEPDIR)/libACE_la-Asynch_Pseudo_Task.Tpo -c -o libACE_la-Asynch_Pseudo_Task.lo `test -f 'Asynch_Pseudo_Task.cpp' || echo '$(srcdir)/'`Asynch_Pseudo_Task.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Asynch_Pseudo_Task.Tpo $(DEPDIR)/libACE_la-Asynch_Pseudo_Task.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Asynch_Pseudo_Task.cpp' object='libACE_la-Asynch_Pseudo_Task.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Asynch_Pseudo_Task.lo `test -f 'Asynch_Pseudo_Task.cpp' || echo '$(srcdir)/'`Asynch_Pseudo_Task.cpp + +libACE_la-Atomic_Op.lo: Atomic_Op.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Atomic_Op.lo -MD -MP -MF $(DEPDIR)/libACE_la-Atomic_Op.Tpo -c -o libACE_la-Atomic_Op.lo `test -f 'Atomic_Op.cpp' || echo '$(srcdir)/'`Atomic_Op.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Atomic_Op.Tpo $(DEPDIR)/libACE_la-Atomic_Op.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Atomic_Op.cpp' object='libACE_la-Atomic_Op.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Atomic_Op.lo `test -f 'Atomic_Op.cpp' || echo '$(srcdir)/'`Atomic_Op.cpp + +libACE_la-Auto_Event.lo: Auto_Event.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Auto_Event.lo -MD -MP -MF $(DEPDIR)/libACE_la-Auto_Event.Tpo -c -o libACE_la-Auto_Event.lo `test -f 'Auto_Event.cpp' || echo '$(srcdir)/'`Auto_Event.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Auto_Event.Tpo $(DEPDIR)/libACE_la-Auto_Event.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Auto_Event.cpp' object='libACE_la-Auto_Event.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Auto_Event.lo `test -f 'Auto_Event.cpp' || echo '$(srcdir)/'`Auto_Event.cpp + +libACE_la-Barrier.lo: Barrier.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Barrier.lo -MD -MP -MF $(DEPDIR)/libACE_la-Barrier.Tpo -c -o libACE_la-Barrier.lo `test -f 'Barrier.cpp' || echo '$(srcdir)/'`Barrier.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Barrier.Tpo $(DEPDIR)/libACE_la-Barrier.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Barrier.cpp' object='libACE_la-Barrier.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Barrier.lo `test -f 'Barrier.cpp' || echo '$(srcdir)/'`Barrier.cpp + +libACE_la-Base_Thread_Adapter.lo: Base_Thread_Adapter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Base_Thread_Adapter.lo -MD -MP -MF $(DEPDIR)/libACE_la-Base_Thread_Adapter.Tpo -c -o libACE_la-Base_Thread_Adapter.lo `test -f 'Base_Thread_Adapter.cpp' || echo '$(srcdir)/'`Base_Thread_Adapter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Base_Thread_Adapter.Tpo $(DEPDIR)/libACE_la-Base_Thread_Adapter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base_Thread_Adapter.cpp' object='libACE_la-Base_Thread_Adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Base_Thread_Adapter.lo `test -f 'Base_Thread_Adapter.cpp' || echo '$(srcdir)/'`Base_Thread_Adapter.cpp + +libACE_la-Based_Pointer_Repository.lo: Based_Pointer_Repository.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Based_Pointer_Repository.lo -MD -MP -MF $(DEPDIR)/libACE_la-Based_Pointer_Repository.Tpo -c -o libACE_la-Based_Pointer_Repository.lo `test -f 'Based_Pointer_Repository.cpp' || echo '$(srcdir)/'`Based_Pointer_Repository.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Based_Pointer_Repository.Tpo $(DEPDIR)/libACE_la-Based_Pointer_Repository.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Based_Pointer_Repository.cpp' object='libACE_la-Based_Pointer_Repository.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Based_Pointer_Repository.lo `test -f 'Based_Pointer_Repository.cpp' || echo '$(srcdir)/'`Based_Pointer_Repository.cpp + +libACE_la-Basic_Stats.lo: Basic_Stats.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Basic_Stats.lo -MD -MP -MF $(DEPDIR)/libACE_la-Basic_Stats.Tpo -c -o libACE_la-Basic_Stats.lo `test -f 'Basic_Stats.cpp' || echo '$(srcdir)/'`Basic_Stats.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Basic_Stats.Tpo $(DEPDIR)/libACE_la-Basic_Stats.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Basic_Stats.cpp' object='libACE_la-Basic_Stats.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Basic_Stats.lo `test -f 'Basic_Stats.cpp' || echo '$(srcdir)/'`Basic_Stats.cpp + +libACE_la-Basic_Types.lo: Basic_Types.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Basic_Types.lo -MD -MP -MF $(DEPDIR)/libACE_la-Basic_Types.Tpo -c -o libACE_la-Basic_Types.lo `test -f 'Basic_Types.cpp' || echo '$(srcdir)/'`Basic_Types.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Basic_Types.Tpo $(DEPDIR)/libACE_la-Basic_Types.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Basic_Types.cpp' object='libACE_la-Basic_Types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Basic_Types.lo `test -f 'Basic_Types.cpp' || echo '$(srcdir)/'`Basic_Types.cpp + +libACE_la-CDR_Base.lo: CDR_Base.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-CDR_Base.lo -MD -MP -MF $(DEPDIR)/libACE_la-CDR_Base.Tpo -c -o libACE_la-CDR_Base.lo `test -f 'CDR_Base.cpp' || echo '$(srcdir)/'`CDR_Base.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-CDR_Base.Tpo $(DEPDIR)/libACE_la-CDR_Base.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CDR_Base.cpp' object='libACE_la-CDR_Base.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-CDR_Base.lo `test -f 'CDR_Base.cpp' || echo '$(srcdir)/'`CDR_Base.cpp + +libACE_la-CDR_Size.lo: CDR_Size.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-CDR_Size.lo -MD -MP -MF $(DEPDIR)/libACE_la-CDR_Size.Tpo -c -o libACE_la-CDR_Size.lo `test -f 'CDR_Size.cpp' || echo '$(srcdir)/'`CDR_Size.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-CDR_Size.Tpo $(DEPDIR)/libACE_la-CDR_Size.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CDR_Size.cpp' object='libACE_la-CDR_Size.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-CDR_Size.lo `test -f 'CDR_Size.cpp' || echo '$(srcdir)/'`CDR_Size.cpp + +libACE_la-CDR_Stream.lo: CDR_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-CDR_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-CDR_Stream.Tpo -c -o libACE_la-CDR_Stream.lo `test -f 'CDR_Stream.cpp' || echo '$(srcdir)/'`CDR_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-CDR_Stream.Tpo $(DEPDIR)/libACE_la-CDR_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CDR_Stream.cpp' object='libACE_la-CDR_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-CDR_Stream.lo `test -f 'CDR_Stream.cpp' || echo '$(srcdir)/'`CDR_Stream.cpp + +libACE_la-Capabilities.lo: Capabilities.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Capabilities.lo -MD -MP -MF $(DEPDIR)/libACE_la-Capabilities.Tpo -c -o libACE_la-Capabilities.lo `test -f 'Capabilities.cpp' || echo '$(srcdir)/'`Capabilities.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Capabilities.Tpo $(DEPDIR)/libACE_la-Capabilities.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Capabilities.cpp' object='libACE_la-Capabilities.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Capabilities.lo `test -f 'Capabilities.cpp' || echo '$(srcdir)/'`Capabilities.cpp + +libACE_la-Cleanup.lo: Cleanup.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Cleanup.lo -MD -MP -MF $(DEPDIR)/libACE_la-Cleanup.Tpo -c -o libACE_la-Cleanup.lo `test -f 'Cleanup.cpp' || echo '$(srcdir)/'`Cleanup.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Cleanup.Tpo $(DEPDIR)/libACE_la-Cleanup.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Cleanup.cpp' object='libACE_la-Cleanup.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Cleanup.lo `test -f 'Cleanup.cpp' || echo '$(srcdir)/'`Cleanup.cpp + +libACE_la-Codecs.lo: Codecs.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Codecs.lo -MD -MP -MF $(DEPDIR)/libACE_la-Codecs.Tpo -c -o libACE_la-Codecs.lo `test -f 'Codecs.cpp' || echo '$(srcdir)/'`Codecs.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Codecs.Tpo $(DEPDIR)/libACE_la-Codecs.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Codecs.cpp' object='libACE_la-Codecs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Codecs.lo `test -f 'Codecs.cpp' || echo '$(srcdir)/'`Codecs.cpp + +libACE_la-Codeset_IBM1047.lo: Codeset_IBM1047.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Codeset_IBM1047.lo -MD -MP -MF $(DEPDIR)/libACE_la-Codeset_IBM1047.Tpo -c -o libACE_la-Codeset_IBM1047.lo `test -f 'Codeset_IBM1047.cpp' || echo '$(srcdir)/'`Codeset_IBM1047.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Codeset_IBM1047.Tpo $(DEPDIR)/libACE_la-Codeset_IBM1047.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Codeset_IBM1047.cpp' object='libACE_la-Codeset_IBM1047.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Codeset_IBM1047.lo `test -f 'Codeset_IBM1047.cpp' || echo '$(srcdir)/'`Codeset_IBM1047.cpp + +libACE_la-Codeset_Registry.lo: Codeset_Registry.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Codeset_Registry.lo -MD -MP -MF $(DEPDIR)/libACE_la-Codeset_Registry.Tpo -c -o libACE_la-Codeset_Registry.lo `test -f 'Codeset_Registry.cpp' || echo '$(srcdir)/'`Codeset_Registry.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Codeset_Registry.Tpo $(DEPDIR)/libACE_la-Codeset_Registry.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Codeset_Registry.cpp' object='libACE_la-Codeset_Registry.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Codeset_Registry.lo `test -f 'Codeset_Registry.cpp' || echo '$(srcdir)/'`Codeset_Registry.cpp + +libACE_la-Codeset_Registry_db.lo: Codeset_Registry_db.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Codeset_Registry_db.lo -MD -MP -MF $(DEPDIR)/libACE_la-Codeset_Registry_db.Tpo -c -o libACE_la-Codeset_Registry_db.lo `test -f 'Codeset_Registry_db.cpp' || echo '$(srcdir)/'`Codeset_Registry_db.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Codeset_Registry_db.Tpo $(DEPDIR)/libACE_la-Codeset_Registry_db.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Codeset_Registry_db.cpp' object='libACE_la-Codeset_Registry_db.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Codeset_Registry_db.lo `test -f 'Codeset_Registry_db.cpp' || echo '$(srcdir)/'`Codeset_Registry_db.cpp + +libACE_la-Condition_Recursive_Thread_Mutex.lo: Condition_Recursive_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Condition_Recursive_Thread_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-Condition_Recursive_Thread_Mutex.Tpo -c -o libACE_la-Condition_Recursive_Thread_Mutex.lo `test -f 'Condition_Recursive_Thread_Mutex.cpp' || echo '$(srcdir)/'`Condition_Recursive_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Condition_Recursive_Thread_Mutex.Tpo $(DEPDIR)/libACE_la-Condition_Recursive_Thread_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Condition_Recursive_Thread_Mutex.cpp' object='libACE_la-Condition_Recursive_Thread_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Condition_Recursive_Thread_Mutex.lo `test -f 'Condition_Recursive_Thread_Mutex.cpp' || echo '$(srcdir)/'`Condition_Recursive_Thread_Mutex.cpp + +libACE_la-Condition_Thread_Mutex.lo: Condition_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Condition_Thread_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-Condition_Thread_Mutex.Tpo -c -o libACE_la-Condition_Thread_Mutex.lo `test -f 'Condition_Thread_Mutex.cpp' || echo '$(srcdir)/'`Condition_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Condition_Thread_Mutex.Tpo $(DEPDIR)/libACE_la-Condition_Thread_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Condition_Thread_Mutex.cpp' object='libACE_la-Condition_Thread_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Condition_Thread_Mutex.lo `test -f 'Condition_Thread_Mutex.cpp' || echo '$(srcdir)/'`Condition_Thread_Mutex.cpp + +libACE_la-Configuration.lo: Configuration.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Configuration.lo -MD -MP -MF $(DEPDIR)/libACE_la-Configuration.Tpo -c -o libACE_la-Configuration.lo `test -f 'Configuration.cpp' || echo '$(srcdir)/'`Configuration.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Configuration.Tpo $(DEPDIR)/libACE_la-Configuration.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Configuration.cpp' object='libACE_la-Configuration.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Configuration.lo `test -f 'Configuration.cpp' || echo '$(srcdir)/'`Configuration.cpp + +libACE_la-Configuration_Import_Export.lo: Configuration_Import_Export.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Configuration_Import_Export.lo -MD -MP -MF $(DEPDIR)/libACE_la-Configuration_Import_Export.Tpo -c -o libACE_la-Configuration_Import_Export.lo `test -f 'Configuration_Import_Export.cpp' || echo '$(srcdir)/'`Configuration_Import_Export.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Configuration_Import_Export.Tpo $(DEPDIR)/libACE_la-Configuration_Import_Export.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Configuration_Import_Export.cpp' object='libACE_la-Configuration_Import_Export.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Configuration_Import_Export.lo `test -f 'Configuration_Import_Export.cpp' || echo '$(srcdir)/'`Configuration_Import_Export.cpp + +libACE_la-Connection_Recycling_Strategy.lo: Connection_Recycling_Strategy.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Connection_Recycling_Strategy.lo -MD -MP -MF $(DEPDIR)/libACE_la-Connection_Recycling_Strategy.Tpo -c -o libACE_la-Connection_Recycling_Strategy.lo `test -f 'Connection_Recycling_Strategy.cpp' || echo '$(srcdir)/'`Connection_Recycling_Strategy.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Connection_Recycling_Strategy.Tpo $(DEPDIR)/libACE_la-Connection_Recycling_Strategy.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Connection_Recycling_Strategy.cpp' object='libACE_la-Connection_Recycling_Strategy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Connection_Recycling_Strategy.lo `test -f 'Connection_Recycling_Strategy.cpp' || echo '$(srcdir)/'`Connection_Recycling_Strategy.cpp + +libACE_la-Containers.lo: Containers.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Containers.lo -MD -MP -MF $(DEPDIR)/libACE_la-Containers.Tpo -c -o libACE_la-Containers.lo `test -f 'Containers.cpp' || echo '$(srcdir)/'`Containers.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Containers.Tpo $(DEPDIR)/libACE_la-Containers.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Containers.cpp' object='libACE_la-Containers.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Containers.lo `test -f 'Containers.cpp' || echo '$(srcdir)/'`Containers.cpp + +libACE_la-Copy_Disabled.lo: Copy_Disabled.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Copy_Disabled.lo -MD -MP -MF $(DEPDIR)/libACE_la-Copy_Disabled.Tpo -c -o libACE_la-Copy_Disabled.lo `test -f 'Copy_Disabled.cpp' || echo '$(srcdir)/'`Copy_Disabled.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Copy_Disabled.Tpo $(DEPDIR)/libACE_la-Copy_Disabled.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Copy_Disabled.cpp' object='libACE_la-Copy_Disabled.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Copy_Disabled.lo `test -f 'Copy_Disabled.cpp' || echo '$(srcdir)/'`Copy_Disabled.cpp + +libACE_la-Countdown_Time.lo: Countdown_Time.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Countdown_Time.lo -MD -MP -MF $(DEPDIR)/libACE_la-Countdown_Time.Tpo -c -o libACE_la-Countdown_Time.lo `test -f 'Countdown_Time.cpp' || echo '$(srcdir)/'`Countdown_Time.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Countdown_Time.Tpo $(DEPDIR)/libACE_la-Countdown_Time.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Countdown_Time.cpp' object='libACE_la-Countdown_Time.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Countdown_Time.lo `test -f 'Countdown_Time.cpp' || echo '$(srcdir)/'`Countdown_Time.cpp + +libACE_la-DEV.lo: DEV.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-DEV.lo -MD -MP -MF $(DEPDIR)/libACE_la-DEV.Tpo -c -o libACE_la-DEV.lo `test -f 'DEV.cpp' || echo '$(srcdir)/'`DEV.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-DEV.Tpo $(DEPDIR)/libACE_la-DEV.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DEV.cpp' object='libACE_la-DEV.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-DEV.lo `test -f 'DEV.cpp' || echo '$(srcdir)/'`DEV.cpp + +libACE_la-DEV_Addr.lo: DEV_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-DEV_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-DEV_Addr.Tpo -c -o libACE_la-DEV_Addr.lo `test -f 'DEV_Addr.cpp' || echo '$(srcdir)/'`DEV_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-DEV_Addr.Tpo $(DEPDIR)/libACE_la-DEV_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DEV_Addr.cpp' object='libACE_la-DEV_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-DEV_Addr.lo `test -f 'DEV_Addr.cpp' || echo '$(srcdir)/'`DEV_Addr.cpp + +libACE_la-DEV_Connector.lo: DEV_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-DEV_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-DEV_Connector.Tpo -c -o libACE_la-DEV_Connector.lo `test -f 'DEV_Connector.cpp' || echo '$(srcdir)/'`DEV_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-DEV_Connector.Tpo $(DEPDIR)/libACE_la-DEV_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DEV_Connector.cpp' object='libACE_la-DEV_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-DEV_Connector.lo `test -f 'DEV_Connector.cpp' || echo '$(srcdir)/'`DEV_Connector.cpp + +libACE_la-DEV_IO.lo: DEV_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-DEV_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-DEV_IO.Tpo -c -o libACE_la-DEV_IO.lo `test -f 'DEV_IO.cpp' || echo '$(srcdir)/'`DEV_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-DEV_IO.Tpo $(DEPDIR)/libACE_la-DEV_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DEV_IO.cpp' object='libACE_la-DEV_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-DEV_IO.lo `test -f 'DEV_IO.cpp' || echo '$(srcdir)/'`DEV_IO.cpp + +libACE_la-DLL.lo: DLL.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-DLL.lo -MD -MP -MF $(DEPDIR)/libACE_la-DLL.Tpo -c -o libACE_la-DLL.lo `test -f 'DLL.cpp' || echo '$(srcdir)/'`DLL.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-DLL.Tpo $(DEPDIR)/libACE_la-DLL.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DLL.cpp' object='libACE_la-DLL.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-DLL.lo `test -f 'DLL.cpp' || echo '$(srcdir)/'`DLL.cpp + +libACE_la-DLL_Manager.lo: DLL_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-DLL_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-DLL_Manager.Tpo -c -o libACE_la-DLL_Manager.lo `test -f 'DLL_Manager.cpp' || echo '$(srcdir)/'`DLL_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-DLL_Manager.Tpo $(DEPDIR)/libACE_la-DLL_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DLL_Manager.cpp' object='libACE_la-DLL_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-DLL_Manager.lo `test -f 'DLL_Manager.cpp' || echo '$(srcdir)/'`DLL_Manager.cpp + +libACE_la-Date_Time.lo: Date_Time.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Date_Time.lo -MD -MP -MF $(DEPDIR)/libACE_la-Date_Time.Tpo -c -o libACE_la-Date_Time.lo `test -f 'Date_Time.cpp' || echo '$(srcdir)/'`Date_Time.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Date_Time.Tpo $(DEPDIR)/libACE_la-Date_Time.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Date_Time.cpp' object='libACE_la-Date_Time.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Date_Time.lo `test -f 'Date_Time.cpp' || echo '$(srcdir)/'`Date_Time.cpp + +libACE_la-Dev_Poll_Reactor.lo: Dev_Poll_Reactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dev_Poll_Reactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dev_Poll_Reactor.Tpo -c -o libACE_la-Dev_Poll_Reactor.lo `test -f 'Dev_Poll_Reactor.cpp' || echo '$(srcdir)/'`Dev_Poll_Reactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dev_Poll_Reactor.Tpo $(DEPDIR)/libACE_la-Dev_Poll_Reactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dev_Poll_Reactor.cpp' object='libACE_la-Dev_Poll_Reactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dev_Poll_Reactor.lo `test -f 'Dev_Poll_Reactor.cpp' || echo '$(srcdir)/'`Dev_Poll_Reactor.cpp + +libACE_la-Dirent.lo: Dirent.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dirent.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dirent.Tpo -c -o libACE_la-Dirent.lo `test -f 'Dirent.cpp' || echo '$(srcdir)/'`Dirent.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dirent.Tpo $(DEPDIR)/libACE_la-Dirent.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dirent.cpp' object='libACE_la-Dirent.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dirent.lo `test -f 'Dirent.cpp' || echo '$(srcdir)/'`Dirent.cpp + +libACE_la-Dirent_Selector.lo: Dirent_Selector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dirent_Selector.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dirent_Selector.Tpo -c -o libACE_la-Dirent_Selector.lo `test -f 'Dirent_Selector.cpp' || echo '$(srcdir)/'`Dirent_Selector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dirent_Selector.Tpo $(DEPDIR)/libACE_la-Dirent_Selector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dirent_Selector.cpp' object='libACE_la-Dirent_Selector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dirent_Selector.lo `test -f 'Dirent_Selector.cpp' || echo '$(srcdir)/'`Dirent_Selector.cpp + +libACE_la-Dump.lo: Dump.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dump.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dump.Tpo -c -o libACE_la-Dump.lo `test -f 'Dump.cpp' || echo '$(srcdir)/'`Dump.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dump.Tpo $(DEPDIR)/libACE_la-Dump.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dump.cpp' object='libACE_la-Dump.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dump.lo `test -f 'Dump.cpp' || echo '$(srcdir)/'`Dump.cpp + +libACE_la-Dynamic.lo: Dynamic.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dynamic.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dynamic.Tpo -c -o libACE_la-Dynamic.lo `test -f 'Dynamic.cpp' || echo '$(srcdir)/'`Dynamic.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dynamic.Tpo $(DEPDIR)/libACE_la-Dynamic.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dynamic.cpp' object='libACE_la-Dynamic.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dynamic.lo `test -f 'Dynamic.cpp' || echo '$(srcdir)/'`Dynamic.cpp + +libACE_la-Dynamic_Message_Strategy.lo: Dynamic_Message_Strategy.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dynamic_Message_Strategy.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dynamic_Message_Strategy.Tpo -c -o libACE_la-Dynamic_Message_Strategy.lo `test -f 'Dynamic_Message_Strategy.cpp' || echo '$(srcdir)/'`Dynamic_Message_Strategy.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dynamic_Message_Strategy.Tpo $(DEPDIR)/libACE_la-Dynamic_Message_Strategy.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dynamic_Message_Strategy.cpp' object='libACE_la-Dynamic_Message_Strategy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dynamic_Message_Strategy.lo `test -f 'Dynamic_Message_Strategy.cpp' || echo '$(srcdir)/'`Dynamic_Message_Strategy.cpp + +libACE_la-Dynamic_Service_Base.lo: Dynamic_Service_Base.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dynamic_Service_Base.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dynamic_Service_Base.Tpo -c -o libACE_la-Dynamic_Service_Base.lo `test -f 'Dynamic_Service_Base.cpp' || echo '$(srcdir)/'`Dynamic_Service_Base.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dynamic_Service_Base.Tpo $(DEPDIR)/libACE_la-Dynamic_Service_Base.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dynamic_Service_Base.cpp' object='libACE_la-Dynamic_Service_Base.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dynamic_Service_Base.lo `test -f 'Dynamic_Service_Base.cpp' || echo '$(srcdir)/'`Dynamic_Service_Base.cpp + +libACE_la-Dynamic_Service_Dependency.lo: Dynamic_Service_Dependency.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Dynamic_Service_Dependency.lo -MD -MP -MF $(DEPDIR)/libACE_la-Dynamic_Service_Dependency.Tpo -c -o libACE_la-Dynamic_Service_Dependency.lo `test -f 'Dynamic_Service_Dependency.cpp' || echo '$(srcdir)/'`Dynamic_Service_Dependency.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Dynamic_Service_Dependency.Tpo $(DEPDIR)/libACE_la-Dynamic_Service_Dependency.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Dynamic_Service_Dependency.cpp' object='libACE_la-Dynamic_Service_Dependency.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Dynamic_Service_Dependency.lo `test -f 'Dynamic_Service_Dependency.cpp' || echo '$(srcdir)/'`Dynamic_Service_Dependency.cpp + +libACE_la-Encoding_Converter.lo: Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Encoding_Converter.lo -MD -MP -MF $(DEPDIR)/libACE_la-Encoding_Converter.Tpo -c -o libACE_la-Encoding_Converter.lo `test -f 'Encoding_Converter.cpp' || echo '$(srcdir)/'`Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Encoding_Converter.Tpo $(DEPDIR)/libACE_la-Encoding_Converter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Encoding_Converter.cpp' object='libACE_la-Encoding_Converter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Encoding_Converter.lo `test -f 'Encoding_Converter.cpp' || echo '$(srcdir)/'`Encoding_Converter.cpp + +libACE_la-Encoding_Converter_Factory.lo: Encoding_Converter_Factory.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Encoding_Converter_Factory.lo -MD -MP -MF $(DEPDIR)/libACE_la-Encoding_Converter_Factory.Tpo -c -o libACE_la-Encoding_Converter_Factory.lo `test -f 'Encoding_Converter_Factory.cpp' || echo '$(srcdir)/'`Encoding_Converter_Factory.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Encoding_Converter_Factory.Tpo $(DEPDIR)/libACE_la-Encoding_Converter_Factory.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Encoding_Converter_Factory.cpp' object='libACE_la-Encoding_Converter_Factory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Encoding_Converter_Factory.lo `test -f 'Encoding_Converter_Factory.cpp' || echo '$(srcdir)/'`Encoding_Converter_Factory.cpp + +libACE_la-Event.lo: Event.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Event.lo -MD -MP -MF $(DEPDIR)/libACE_la-Event.Tpo -c -o libACE_la-Event.lo `test -f 'Event.cpp' || echo '$(srcdir)/'`Event.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Event.Tpo $(DEPDIR)/libACE_la-Event.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Event.cpp' object='libACE_la-Event.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Event.lo `test -f 'Event.cpp' || echo '$(srcdir)/'`Event.cpp + +libACE_la-Event_Handler.lo: Event_Handler.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Event_Handler.lo -MD -MP -MF $(DEPDIR)/libACE_la-Event_Handler.Tpo -c -o libACE_la-Event_Handler.lo `test -f 'Event_Handler.cpp' || echo '$(srcdir)/'`Event_Handler.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Event_Handler.Tpo $(DEPDIR)/libACE_la-Event_Handler.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Event_Handler.cpp' object='libACE_la-Event_Handler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Event_Handler.lo `test -f 'Event_Handler.cpp' || echo '$(srcdir)/'`Event_Handler.cpp + +libACE_la-FIFO.lo: FIFO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FIFO.lo -MD -MP -MF $(DEPDIR)/libACE_la-FIFO.Tpo -c -o libACE_la-FIFO.lo `test -f 'FIFO.cpp' || echo '$(srcdir)/'`FIFO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FIFO.Tpo $(DEPDIR)/libACE_la-FIFO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FIFO.cpp' object='libACE_la-FIFO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FIFO.lo `test -f 'FIFO.cpp' || echo '$(srcdir)/'`FIFO.cpp + +libACE_la-FIFO_Recv.lo: FIFO_Recv.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FIFO_Recv.lo -MD -MP -MF $(DEPDIR)/libACE_la-FIFO_Recv.Tpo -c -o libACE_la-FIFO_Recv.lo `test -f 'FIFO_Recv.cpp' || echo '$(srcdir)/'`FIFO_Recv.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FIFO_Recv.Tpo $(DEPDIR)/libACE_la-FIFO_Recv.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FIFO_Recv.cpp' object='libACE_la-FIFO_Recv.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FIFO_Recv.lo `test -f 'FIFO_Recv.cpp' || echo '$(srcdir)/'`FIFO_Recv.cpp + +libACE_la-FIFO_Recv_Msg.lo: FIFO_Recv_Msg.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FIFO_Recv_Msg.lo -MD -MP -MF $(DEPDIR)/libACE_la-FIFO_Recv_Msg.Tpo -c -o libACE_la-FIFO_Recv_Msg.lo `test -f 'FIFO_Recv_Msg.cpp' || echo '$(srcdir)/'`FIFO_Recv_Msg.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FIFO_Recv_Msg.Tpo $(DEPDIR)/libACE_la-FIFO_Recv_Msg.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FIFO_Recv_Msg.cpp' object='libACE_la-FIFO_Recv_Msg.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FIFO_Recv_Msg.lo `test -f 'FIFO_Recv_Msg.cpp' || echo '$(srcdir)/'`FIFO_Recv_Msg.cpp + +libACE_la-FIFO_Send.lo: FIFO_Send.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FIFO_Send.lo -MD -MP -MF $(DEPDIR)/libACE_la-FIFO_Send.Tpo -c -o libACE_la-FIFO_Send.lo `test -f 'FIFO_Send.cpp' || echo '$(srcdir)/'`FIFO_Send.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FIFO_Send.Tpo $(DEPDIR)/libACE_la-FIFO_Send.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FIFO_Send.cpp' object='libACE_la-FIFO_Send.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FIFO_Send.lo `test -f 'FIFO_Send.cpp' || echo '$(srcdir)/'`FIFO_Send.cpp + +libACE_la-FIFO_Send_Msg.lo: FIFO_Send_Msg.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FIFO_Send_Msg.lo -MD -MP -MF $(DEPDIR)/libACE_la-FIFO_Send_Msg.Tpo -c -o libACE_la-FIFO_Send_Msg.lo `test -f 'FIFO_Send_Msg.cpp' || echo '$(srcdir)/'`FIFO_Send_Msg.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FIFO_Send_Msg.Tpo $(DEPDIR)/libACE_la-FIFO_Send_Msg.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FIFO_Send_Msg.cpp' object='libACE_la-FIFO_Send_Msg.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FIFO_Send_Msg.lo `test -f 'FIFO_Send_Msg.cpp' || echo '$(srcdir)/'`FIFO_Send_Msg.cpp + +libACE_la-FILE.lo: FILE.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FILE.lo -MD -MP -MF $(DEPDIR)/libACE_la-FILE.Tpo -c -o libACE_la-FILE.lo `test -f 'FILE.cpp' || echo '$(srcdir)/'`FILE.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FILE.Tpo $(DEPDIR)/libACE_la-FILE.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FILE.cpp' object='libACE_la-FILE.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FILE.lo `test -f 'FILE.cpp' || echo '$(srcdir)/'`FILE.cpp + +libACE_la-FILE_Addr.lo: FILE_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FILE_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-FILE_Addr.Tpo -c -o libACE_la-FILE_Addr.lo `test -f 'FILE_Addr.cpp' || echo '$(srcdir)/'`FILE_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FILE_Addr.Tpo $(DEPDIR)/libACE_la-FILE_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FILE_Addr.cpp' object='libACE_la-FILE_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FILE_Addr.lo `test -f 'FILE_Addr.cpp' || echo '$(srcdir)/'`FILE_Addr.cpp + +libACE_la-FILE_Connector.lo: FILE_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FILE_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-FILE_Connector.Tpo -c -o libACE_la-FILE_Connector.lo `test -f 'FILE_Connector.cpp' || echo '$(srcdir)/'`FILE_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FILE_Connector.Tpo $(DEPDIR)/libACE_la-FILE_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FILE_Connector.cpp' object='libACE_la-FILE_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FILE_Connector.lo `test -f 'FILE_Connector.cpp' || echo '$(srcdir)/'`FILE_Connector.cpp + +libACE_la-FILE_IO.lo: FILE_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-FILE_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-FILE_IO.Tpo -c -o libACE_la-FILE_IO.lo `test -f 'FILE_IO.cpp' || echo '$(srcdir)/'`FILE_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-FILE_IO.Tpo $(DEPDIR)/libACE_la-FILE_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FILE_IO.cpp' object='libACE_la-FILE_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-FILE_IO.lo `test -f 'FILE_IO.cpp' || echo '$(srcdir)/'`FILE_IO.cpp + +libACE_la-File_Lock.lo: File_Lock.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-File_Lock.lo -MD -MP -MF $(DEPDIR)/libACE_la-File_Lock.Tpo -c -o libACE_la-File_Lock.lo `test -f 'File_Lock.cpp' || echo '$(srcdir)/'`File_Lock.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-File_Lock.Tpo $(DEPDIR)/libACE_la-File_Lock.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='File_Lock.cpp' object='libACE_la-File_Lock.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-File_Lock.lo `test -f 'File_Lock.cpp' || echo '$(srcdir)/'`File_Lock.cpp + +libACE_la-Filecache.lo: Filecache.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Filecache.lo -MD -MP -MF $(DEPDIR)/libACE_la-Filecache.Tpo -c -o libACE_la-Filecache.lo `test -f 'Filecache.cpp' || echo '$(srcdir)/'`Filecache.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Filecache.Tpo $(DEPDIR)/libACE_la-Filecache.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Filecache.cpp' object='libACE_la-Filecache.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Filecache.lo `test -f 'Filecache.cpp' || echo '$(srcdir)/'`Filecache.cpp + +libACE_la-Flag_Manip.lo: Flag_Manip.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Flag_Manip.lo -MD -MP -MF $(DEPDIR)/libACE_la-Flag_Manip.Tpo -c -o libACE_la-Flag_Manip.lo `test -f 'Flag_Manip.cpp' || echo '$(srcdir)/'`Flag_Manip.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Flag_Manip.Tpo $(DEPDIR)/libACE_la-Flag_Manip.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Flag_Manip.cpp' object='libACE_la-Flag_Manip.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Flag_Manip.lo `test -f 'Flag_Manip.cpp' || echo '$(srcdir)/'`Flag_Manip.cpp + +libACE_la-Framework_Component.lo: Framework_Component.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Framework_Component.lo -MD -MP -MF $(DEPDIR)/libACE_la-Framework_Component.Tpo -c -o libACE_la-Framework_Component.lo `test -f 'Framework_Component.cpp' || echo '$(srcdir)/'`Framework_Component.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Framework_Component.Tpo $(DEPDIR)/libACE_la-Framework_Component.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Framework_Component.cpp' object='libACE_la-Framework_Component.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Framework_Component.lo `test -f 'Framework_Component.cpp' || echo '$(srcdir)/'`Framework_Component.cpp + +libACE_la-Functor.lo: Functor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Functor.lo -MD -MP -MF $(DEPDIR)/libACE_la-Functor.Tpo -c -o libACE_la-Functor.lo `test -f 'Functor.cpp' || echo '$(srcdir)/'`Functor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Functor.Tpo $(DEPDIR)/libACE_la-Functor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Functor.cpp' object='libACE_la-Functor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Functor.lo `test -f 'Functor.cpp' || echo '$(srcdir)/'`Functor.cpp + +libACE_la-Functor_String.lo: Functor_String.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Functor_String.lo -MD -MP -MF $(DEPDIR)/libACE_la-Functor_String.Tpo -c -o libACE_la-Functor_String.lo `test -f 'Functor_String.cpp' || echo '$(srcdir)/'`Functor_String.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Functor_String.Tpo $(DEPDIR)/libACE_la-Functor_String.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Functor_String.cpp' object='libACE_la-Functor_String.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Functor_String.lo `test -f 'Functor_String.cpp' || echo '$(srcdir)/'`Functor_String.cpp + +libACE_la-Get_Opt.lo: Get_Opt.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Get_Opt.lo -MD -MP -MF $(DEPDIR)/libACE_la-Get_Opt.Tpo -c -o libACE_la-Get_Opt.lo `test -f 'Get_Opt.cpp' || echo '$(srcdir)/'`Get_Opt.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Get_Opt.Tpo $(DEPDIR)/libACE_la-Get_Opt.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Get_Opt.cpp' object='libACE_la-Get_Opt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Get_Opt.lo `test -f 'Get_Opt.cpp' || echo '$(srcdir)/'`Get_Opt.cpp + +libACE_la-Handle_Ops.lo: Handle_Ops.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Handle_Ops.lo -MD -MP -MF $(DEPDIR)/libACE_la-Handle_Ops.Tpo -c -o libACE_la-Handle_Ops.lo `test -f 'Handle_Ops.cpp' || echo '$(srcdir)/'`Handle_Ops.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Handle_Ops.Tpo $(DEPDIR)/libACE_la-Handle_Ops.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Handle_Ops.cpp' object='libACE_la-Handle_Ops.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Handle_Ops.lo `test -f 'Handle_Ops.cpp' || echo '$(srcdir)/'`Handle_Ops.cpp + +libACE_la-Handle_Set.lo: Handle_Set.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Handle_Set.lo -MD -MP -MF $(DEPDIR)/libACE_la-Handle_Set.Tpo -c -o libACE_la-Handle_Set.lo `test -f 'Handle_Set.cpp' || echo '$(srcdir)/'`Handle_Set.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Handle_Set.Tpo $(DEPDIR)/libACE_la-Handle_Set.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Handle_Set.cpp' object='libACE_la-Handle_Set.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Handle_Set.lo `test -f 'Handle_Set.cpp' || echo '$(srcdir)/'`Handle_Set.cpp + +libACE_la-Hashable.lo: Hashable.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Hashable.lo -MD -MP -MF $(DEPDIR)/libACE_la-Hashable.Tpo -c -o libACE_la-Hashable.lo `test -f 'Hashable.cpp' || echo '$(srcdir)/'`Hashable.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Hashable.Tpo $(DEPDIR)/libACE_la-Hashable.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Hashable.cpp' object='libACE_la-Hashable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Hashable.lo `test -f 'Hashable.cpp' || echo '$(srcdir)/'`Hashable.cpp + +libACE_la-High_Res_Timer.lo: High_Res_Timer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-High_Res_Timer.lo -MD -MP -MF $(DEPDIR)/libACE_la-High_Res_Timer.Tpo -c -o libACE_la-High_Res_Timer.lo `test -f 'High_Res_Timer.cpp' || echo '$(srcdir)/'`High_Res_Timer.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-High_Res_Timer.Tpo $(DEPDIR)/libACE_la-High_Res_Timer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='High_Res_Timer.cpp' object='libACE_la-High_Res_Timer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-High_Res_Timer.lo `test -f 'High_Res_Timer.cpp' || echo '$(srcdir)/'`High_Res_Timer.cpp + +libACE_la-ICMP_Socket.lo: ICMP_Socket.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ICMP_Socket.lo -MD -MP -MF $(DEPDIR)/libACE_la-ICMP_Socket.Tpo -c -o libACE_la-ICMP_Socket.lo `test -f 'ICMP_Socket.cpp' || echo '$(srcdir)/'`ICMP_Socket.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ICMP_Socket.Tpo $(DEPDIR)/libACE_la-ICMP_Socket.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ICMP_Socket.cpp' object='libACE_la-ICMP_Socket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ICMP_Socket.lo `test -f 'ICMP_Socket.cpp' || echo '$(srcdir)/'`ICMP_Socket.cpp + +libACE_la-INET_Addr.lo: INET_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-INET_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-INET_Addr.Tpo -c -o libACE_la-INET_Addr.lo `test -f 'INET_Addr.cpp' || echo '$(srcdir)/'`INET_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-INET_Addr.Tpo $(DEPDIR)/libACE_la-INET_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='INET_Addr.cpp' object='libACE_la-INET_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-INET_Addr.lo `test -f 'INET_Addr.cpp' || echo '$(srcdir)/'`INET_Addr.cpp + +libACE_la-IOStream.lo: IOStream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-IOStream.lo -MD -MP -MF $(DEPDIR)/libACE_la-IOStream.Tpo -c -o libACE_la-IOStream.lo `test -f 'IOStream.cpp' || echo '$(srcdir)/'`IOStream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-IOStream.Tpo $(DEPDIR)/libACE_la-IOStream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='IOStream.cpp' object='libACE_la-IOStream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-IOStream.lo `test -f 'IOStream.cpp' || echo '$(srcdir)/'`IOStream.cpp + +libACE_la-IO_Cntl_Msg.lo: IO_Cntl_Msg.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-IO_Cntl_Msg.lo -MD -MP -MF $(DEPDIR)/libACE_la-IO_Cntl_Msg.Tpo -c -o libACE_la-IO_Cntl_Msg.lo `test -f 'IO_Cntl_Msg.cpp' || echo '$(srcdir)/'`IO_Cntl_Msg.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-IO_Cntl_Msg.Tpo $(DEPDIR)/libACE_la-IO_Cntl_Msg.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='IO_Cntl_Msg.cpp' object='libACE_la-IO_Cntl_Msg.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-IO_Cntl_Msg.lo `test -f 'IO_Cntl_Msg.cpp' || echo '$(srcdir)/'`IO_Cntl_Msg.cpp + +libACE_la-IO_SAP.lo: IO_SAP.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-IO_SAP.lo -MD -MP -MF $(DEPDIR)/libACE_la-IO_SAP.Tpo -c -o libACE_la-IO_SAP.lo `test -f 'IO_SAP.cpp' || echo '$(srcdir)/'`IO_SAP.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-IO_SAP.Tpo $(DEPDIR)/libACE_la-IO_SAP.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='IO_SAP.cpp' object='libACE_la-IO_SAP.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-IO_SAP.lo `test -f 'IO_SAP.cpp' || echo '$(srcdir)/'`IO_SAP.cpp + +libACE_la-IPC_SAP.lo: IPC_SAP.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-IPC_SAP.lo -MD -MP -MF $(DEPDIR)/libACE_la-IPC_SAP.Tpo -c -o libACE_la-IPC_SAP.lo `test -f 'IPC_SAP.cpp' || echo '$(srcdir)/'`IPC_SAP.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-IPC_SAP.Tpo $(DEPDIR)/libACE_la-IPC_SAP.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='IPC_SAP.cpp' object='libACE_la-IPC_SAP.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-IPC_SAP.lo `test -f 'IPC_SAP.cpp' || echo '$(srcdir)/'`IPC_SAP.cpp + +libACE_la-Init_ACE.lo: Init_ACE.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Init_ACE.lo -MD -MP -MF $(DEPDIR)/libACE_la-Init_ACE.Tpo -c -o libACE_la-Init_ACE.lo `test -f 'Init_ACE.cpp' || echo '$(srcdir)/'`Init_ACE.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Init_ACE.Tpo $(DEPDIR)/libACE_la-Init_ACE.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Init_ACE.cpp' object='libACE_la-Init_ACE.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Init_ACE.lo `test -f 'Init_ACE.cpp' || echo '$(srcdir)/'`Init_ACE.cpp + +libACE_la-LSOCK.lo: LSOCK.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-LSOCK.lo -MD -MP -MF $(DEPDIR)/libACE_la-LSOCK.Tpo -c -o libACE_la-LSOCK.lo `test -f 'LSOCK.cpp' || echo '$(srcdir)/'`LSOCK.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-LSOCK.Tpo $(DEPDIR)/libACE_la-LSOCK.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LSOCK.cpp' object='libACE_la-LSOCK.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-LSOCK.lo `test -f 'LSOCK.cpp' || echo '$(srcdir)/'`LSOCK.cpp + +libACE_la-LSOCK_Acceptor.lo: LSOCK_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-LSOCK_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-LSOCK_Acceptor.Tpo -c -o libACE_la-LSOCK_Acceptor.lo `test -f 'LSOCK_Acceptor.cpp' || echo '$(srcdir)/'`LSOCK_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-LSOCK_Acceptor.Tpo $(DEPDIR)/libACE_la-LSOCK_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LSOCK_Acceptor.cpp' object='libACE_la-LSOCK_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-LSOCK_Acceptor.lo `test -f 'LSOCK_Acceptor.cpp' || echo '$(srcdir)/'`LSOCK_Acceptor.cpp + +libACE_la-LSOCK_CODgram.lo: LSOCK_CODgram.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-LSOCK_CODgram.lo -MD -MP -MF $(DEPDIR)/libACE_la-LSOCK_CODgram.Tpo -c -o libACE_la-LSOCK_CODgram.lo `test -f 'LSOCK_CODgram.cpp' || echo '$(srcdir)/'`LSOCK_CODgram.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-LSOCK_CODgram.Tpo $(DEPDIR)/libACE_la-LSOCK_CODgram.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LSOCK_CODgram.cpp' object='libACE_la-LSOCK_CODgram.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-LSOCK_CODgram.lo `test -f 'LSOCK_CODgram.cpp' || echo '$(srcdir)/'`LSOCK_CODgram.cpp + +libACE_la-LSOCK_Connector.lo: LSOCK_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-LSOCK_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-LSOCK_Connector.Tpo -c -o libACE_la-LSOCK_Connector.lo `test -f 'LSOCK_Connector.cpp' || echo '$(srcdir)/'`LSOCK_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-LSOCK_Connector.Tpo $(DEPDIR)/libACE_la-LSOCK_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LSOCK_Connector.cpp' object='libACE_la-LSOCK_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-LSOCK_Connector.lo `test -f 'LSOCK_Connector.cpp' || echo '$(srcdir)/'`LSOCK_Connector.cpp + +libACE_la-LSOCK_Dgram.lo: LSOCK_Dgram.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-LSOCK_Dgram.lo -MD -MP -MF $(DEPDIR)/libACE_la-LSOCK_Dgram.Tpo -c -o libACE_la-LSOCK_Dgram.lo `test -f 'LSOCK_Dgram.cpp' || echo '$(srcdir)/'`LSOCK_Dgram.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-LSOCK_Dgram.Tpo $(DEPDIR)/libACE_la-LSOCK_Dgram.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LSOCK_Dgram.cpp' object='libACE_la-LSOCK_Dgram.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-LSOCK_Dgram.lo `test -f 'LSOCK_Dgram.cpp' || echo '$(srcdir)/'`LSOCK_Dgram.cpp + +libACE_la-LSOCK_Stream.lo: LSOCK_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-LSOCK_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-LSOCK_Stream.Tpo -c -o libACE_la-LSOCK_Stream.lo `test -f 'LSOCK_Stream.cpp' || echo '$(srcdir)/'`LSOCK_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-LSOCK_Stream.Tpo $(DEPDIR)/libACE_la-LSOCK_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LSOCK_Stream.cpp' object='libACE_la-LSOCK_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-LSOCK_Stream.lo `test -f 'LSOCK_Stream.cpp' || echo '$(srcdir)/'`LSOCK_Stream.cpp + +libACE_la-Lib_Find.lo: Lib_Find.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Lib_Find.lo -MD -MP -MF $(DEPDIR)/libACE_la-Lib_Find.Tpo -c -o libACE_la-Lib_Find.lo `test -f 'Lib_Find.cpp' || echo '$(srcdir)/'`Lib_Find.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Lib_Find.Tpo $(DEPDIR)/libACE_la-Lib_Find.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Lib_Find.cpp' object='libACE_la-Lib_Find.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Lib_Find.lo `test -f 'Lib_Find.cpp' || echo '$(srcdir)/'`Lib_Find.cpp + +libACE_la-Local_Memory_Pool.lo: Local_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Local_Memory_Pool.lo -MD -MP -MF $(DEPDIR)/libACE_la-Local_Memory_Pool.Tpo -c -o libACE_la-Local_Memory_Pool.lo `test -f 'Local_Memory_Pool.cpp' || echo '$(srcdir)/'`Local_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Local_Memory_Pool.Tpo $(DEPDIR)/libACE_la-Local_Memory_Pool.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Local_Memory_Pool.cpp' object='libACE_la-Local_Memory_Pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Local_Memory_Pool.lo `test -f 'Local_Memory_Pool.cpp' || echo '$(srcdir)/'`Local_Memory_Pool.cpp + +libACE_la-Local_Name_Space.lo: Local_Name_Space.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Local_Name_Space.lo -MD -MP -MF $(DEPDIR)/libACE_la-Local_Name_Space.Tpo -c -o libACE_la-Local_Name_Space.lo `test -f 'Local_Name_Space.cpp' || echo '$(srcdir)/'`Local_Name_Space.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Local_Name_Space.Tpo $(DEPDIR)/libACE_la-Local_Name_Space.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Local_Name_Space.cpp' object='libACE_la-Local_Name_Space.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Local_Name_Space.lo `test -f 'Local_Name_Space.cpp' || echo '$(srcdir)/'`Local_Name_Space.cpp + +libACE_la-Local_Tokens.lo: Local_Tokens.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Local_Tokens.lo -MD -MP -MF $(DEPDIR)/libACE_la-Local_Tokens.Tpo -c -o libACE_la-Local_Tokens.lo `test -f 'Local_Tokens.cpp' || echo '$(srcdir)/'`Local_Tokens.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Local_Tokens.Tpo $(DEPDIR)/libACE_la-Local_Tokens.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Local_Tokens.cpp' object='libACE_la-Local_Tokens.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Local_Tokens.lo `test -f 'Local_Tokens.cpp' || echo '$(srcdir)/'`Local_Tokens.cpp + +libACE_la-Lock.lo: Lock.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Lock.lo -MD -MP -MF $(DEPDIR)/libACE_la-Lock.Tpo -c -o libACE_la-Lock.lo `test -f 'Lock.cpp' || echo '$(srcdir)/'`Lock.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Lock.Tpo $(DEPDIR)/libACE_la-Lock.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Lock.cpp' object='libACE_la-Lock.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Lock.lo `test -f 'Lock.cpp' || echo '$(srcdir)/'`Lock.cpp + +libACE_la-Log_Msg.lo: Log_Msg.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Msg.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Msg.Tpo -c -o libACE_la-Log_Msg.lo `test -f 'Log_Msg.cpp' || echo '$(srcdir)/'`Log_Msg.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Msg.Tpo $(DEPDIR)/libACE_la-Log_Msg.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Msg.cpp' object='libACE_la-Log_Msg.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Msg.lo `test -f 'Log_Msg.cpp' || echo '$(srcdir)/'`Log_Msg.cpp + +libACE_la-Log_Msg_Backend.lo: Log_Msg_Backend.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Msg_Backend.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Msg_Backend.Tpo -c -o libACE_la-Log_Msg_Backend.lo `test -f 'Log_Msg_Backend.cpp' || echo '$(srcdir)/'`Log_Msg_Backend.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Msg_Backend.Tpo $(DEPDIR)/libACE_la-Log_Msg_Backend.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Msg_Backend.cpp' object='libACE_la-Log_Msg_Backend.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Msg_Backend.lo `test -f 'Log_Msg_Backend.cpp' || echo '$(srcdir)/'`Log_Msg_Backend.cpp + +libACE_la-Log_Msg_Callback.lo: Log_Msg_Callback.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Msg_Callback.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Msg_Callback.Tpo -c -o libACE_la-Log_Msg_Callback.lo `test -f 'Log_Msg_Callback.cpp' || echo '$(srcdir)/'`Log_Msg_Callback.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Msg_Callback.Tpo $(DEPDIR)/libACE_la-Log_Msg_Callback.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Msg_Callback.cpp' object='libACE_la-Log_Msg_Callback.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Msg_Callback.lo `test -f 'Log_Msg_Callback.cpp' || echo '$(srcdir)/'`Log_Msg_Callback.cpp + +libACE_la-Log_Msg_IPC.lo: Log_Msg_IPC.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Msg_IPC.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Msg_IPC.Tpo -c -o libACE_la-Log_Msg_IPC.lo `test -f 'Log_Msg_IPC.cpp' || echo '$(srcdir)/'`Log_Msg_IPC.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Msg_IPC.Tpo $(DEPDIR)/libACE_la-Log_Msg_IPC.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Msg_IPC.cpp' object='libACE_la-Log_Msg_IPC.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Msg_IPC.lo `test -f 'Log_Msg_IPC.cpp' || echo '$(srcdir)/'`Log_Msg_IPC.cpp + +libACE_la-Log_Msg_NT_Event_Log.lo: Log_Msg_NT_Event_Log.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Msg_NT_Event_Log.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Msg_NT_Event_Log.Tpo -c -o libACE_la-Log_Msg_NT_Event_Log.lo `test -f 'Log_Msg_NT_Event_Log.cpp' || echo '$(srcdir)/'`Log_Msg_NT_Event_Log.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Msg_NT_Event_Log.Tpo $(DEPDIR)/libACE_la-Log_Msg_NT_Event_Log.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Msg_NT_Event_Log.cpp' object='libACE_la-Log_Msg_NT_Event_Log.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Msg_NT_Event_Log.lo `test -f 'Log_Msg_NT_Event_Log.cpp' || echo '$(srcdir)/'`Log_Msg_NT_Event_Log.cpp + +libACE_la-Log_Msg_UNIX_Syslog.lo: Log_Msg_UNIX_Syslog.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Msg_UNIX_Syslog.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Msg_UNIX_Syslog.Tpo -c -o libACE_la-Log_Msg_UNIX_Syslog.lo `test -f 'Log_Msg_UNIX_Syslog.cpp' || echo '$(srcdir)/'`Log_Msg_UNIX_Syslog.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Msg_UNIX_Syslog.Tpo $(DEPDIR)/libACE_la-Log_Msg_UNIX_Syslog.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Msg_UNIX_Syslog.cpp' object='libACE_la-Log_Msg_UNIX_Syslog.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Msg_UNIX_Syslog.lo `test -f 'Log_Msg_UNIX_Syslog.cpp' || echo '$(srcdir)/'`Log_Msg_UNIX_Syslog.cpp + +libACE_la-Log_Record.lo: Log_Record.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Log_Record.lo -MD -MP -MF $(DEPDIR)/libACE_la-Log_Record.Tpo -c -o libACE_la-Log_Record.lo `test -f 'Log_Record.cpp' || echo '$(srcdir)/'`Log_Record.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Log_Record.Tpo $(DEPDIR)/libACE_la-Log_Record.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Log_Record.cpp' object='libACE_la-Log_Record.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Log_Record.lo `test -f 'Log_Record.cpp' || echo '$(srcdir)/'`Log_Record.cpp + +libACE_la-Logging_Strategy.lo: Logging_Strategy.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Logging_Strategy.lo -MD -MP -MF $(DEPDIR)/libACE_la-Logging_Strategy.Tpo -c -o libACE_la-Logging_Strategy.lo `test -f 'Logging_Strategy.cpp' || echo '$(srcdir)/'`Logging_Strategy.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Logging_Strategy.Tpo $(DEPDIR)/libACE_la-Logging_Strategy.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Logging_Strategy.cpp' object='libACE_la-Logging_Strategy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Logging_Strategy.lo `test -f 'Logging_Strategy.cpp' || echo '$(srcdir)/'`Logging_Strategy.cpp + +libACE_la-MEM_Acceptor.lo: MEM_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MEM_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-MEM_Acceptor.Tpo -c -o libACE_la-MEM_Acceptor.lo `test -f 'MEM_Acceptor.cpp' || echo '$(srcdir)/'`MEM_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MEM_Acceptor.Tpo $(DEPDIR)/libACE_la-MEM_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MEM_Acceptor.cpp' object='libACE_la-MEM_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MEM_Acceptor.lo `test -f 'MEM_Acceptor.cpp' || echo '$(srcdir)/'`MEM_Acceptor.cpp + +libACE_la-MEM_Addr.lo: MEM_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MEM_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-MEM_Addr.Tpo -c -o libACE_la-MEM_Addr.lo `test -f 'MEM_Addr.cpp' || echo '$(srcdir)/'`MEM_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MEM_Addr.Tpo $(DEPDIR)/libACE_la-MEM_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MEM_Addr.cpp' object='libACE_la-MEM_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MEM_Addr.lo `test -f 'MEM_Addr.cpp' || echo '$(srcdir)/'`MEM_Addr.cpp + +libACE_la-MEM_Connector.lo: MEM_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MEM_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-MEM_Connector.Tpo -c -o libACE_la-MEM_Connector.lo `test -f 'MEM_Connector.cpp' || echo '$(srcdir)/'`MEM_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MEM_Connector.Tpo $(DEPDIR)/libACE_la-MEM_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MEM_Connector.cpp' object='libACE_la-MEM_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MEM_Connector.lo `test -f 'MEM_Connector.cpp' || echo '$(srcdir)/'`MEM_Connector.cpp + +libACE_la-MEM_IO.lo: MEM_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MEM_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-MEM_IO.Tpo -c -o libACE_la-MEM_IO.lo `test -f 'MEM_IO.cpp' || echo '$(srcdir)/'`MEM_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MEM_IO.Tpo $(DEPDIR)/libACE_la-MEM_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MEM_IO.cpp' object='libACE_la-MEM_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MEM_IO.lo `test -f 'MEM_IO.cpp' || echo '$(srcdir)/'`MEM_IO.cpp + +libACE_la-MEM_SAP.lo: MEM_SAP.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MEM_SAP.lo -MD -MP -MF $(DEPDIR)/libACE_la-MEM_SAP.Tpo -c -o libACE_la-MEM_SAP.lo `test -f 'MEM_SAP.cpp' || echo '$(srcdir)/'`MEM_SAP.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MEM_SAP.Tpo $(DEPDIR)/libACE_la-MEM_SAP.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MEM_SAP.cpp' object='libACE_la-MEM_SAP.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MEM_SAP.lo `test -f 'MEM_SAP.cpp' || echo '$(srcdir)/'`MEM_SAP.cpp + +libACE_la-MEM_Stream.lo: MEM_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MEM_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-MEM_Stream.Tpo -c -o libACE_la-MEM_Stream.lo `test -f 'MEM_Stream.cpp' || echo '$(srcdir)/'`MEM_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MEM_Stream.Tpo $(DEPDIR)/libACE_la-MEM_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MEM_Stream.cpp' object='libACE_la-MEM_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MEM_Stream.lo `test -f 'MEM_Stream.cpp' || echo '$(srcdir)/'`MEM_Stream.cpp + +libACE_la-MMAP_Memory_Pool.lo: MMAP_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-MMAP_Memory_Pool.lo -MD -MP -MF $(DEPDIR)/libACE_la-MMAP_Memory_Pool.Tpo -c -o libACE_la-MMAP_Memory_Pool.lo `test -f 'MMAP_Memory_Pool.cpp' || echo '$(srcdir)/'`MMAP_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-MMAP_Memory_Pool.Tpo $(DEPDIR)/libACE_la-MMAP_Memory_Pool.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MMAP_Memory_Pool.cpp' object='libACE_la-MMAP_Memory_Pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-MMAP_Memory_Pool.lo `test -f 'MMAP_Memory_Pool.cpp' || echo '$(srcdir)/'`MMAP_Memory_Pool.cpp + +libACE_la-Malloc.lo: Malloc.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Malloc.lo -MD -MP -MF $(DEPDIR)/libACE_la-Malloc.Tpo -c -o libACE_la-Malloc.lo `test -f 'Malloc.cpp' || echo '$(srcdir)/'`Malloc.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Malloc.Tpo $(DEPDIR)/libACE_la-Malloc.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Malloc.cpp' object='libACE_la-Malloc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Malloc.lo `test -f 'Malloc.cpp' || echo '$(srcdir)/'`Malloc.cpp + +libACE_la-Malloc_Allocator.lo: Malloc_Allocator.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Malloc_Allocator.lo -MD -MP -MF $(DEPDIR)/libACE_la-Malloc_Allocator.Tpo -c -o libACE_la-Malloc_Allocator.lo `test -f 'Malloc_Allocator.cpp' || echo '$(srcdir)/'`Malloc_Allocator.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Malloc_Allocator.Tpo $(DEPDIR)/libACE_la-Malloc_Allocator.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Malloc_Allocator.cpp' object='libACE_la-Malloc_Allocator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Malloc_Allocator.lo `test -f 'Malloc_Allocator.cpp' || echo '$(srcdir)/'`Malloc_Allocator.cpp + +libACE_la-Manual_Event.lo: Manual_Event.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Manual_Event.lo -MD -MP -MF $(DEPDIR)/libACE_la-Manual_Event.Tpo -c -o libACE_la-Manual_Event.lo `test -f 'Manual_Event.cpp' || echo '$(srcdir)/'`Manual_Event.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Manual_Event.Tpo $(DEPDIR)/libACE_la-Manual_Event.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Manual_Event.cpp' object='libACE_la-Manual_Event.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Manual_Event.lo `test -f 'Manual_Event.cpp' || echo '$(srcdir)/'`Manual_Event.cpp + +libACE_la-Mem_Map.lo: Mem_Map.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Mem_Map.lo -MD -MP -MF $(DEPDIR)/libACE_la-Mem_Map.Tpo -c -o libACE_la-Mem_Map.lo `test -f 'Mem_Map.cpp' || echo '$(srcdir)/'`Mem_Map.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Mem_Map.Tpo $(DEPDIR)/libACE_la-Mem_Map.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Mem_Map.cpp' object='libACE_la-Mem_Map.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Mem_Map.lo `test -f 'Mem_Map.cpp' || echo '$(srcdir)/'`Mem_Map.cpp + +libACE_la-Message_Block.lo: Message_Block.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Message_Block.lo -MD -MP -MF $(DEPDIR)/libACE_la-Message_Block.Tpo -c -o libACE_la-Message_Block.lo `test -f 'Message_Block.cpp' || echo '$(srcdir)/'`Message_Block.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Message_Block.Tpo $(DEPDIR)/libACE_la-Message_Block.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Message_Block.cpp' object='libACE_la-Message_Block.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Message_Block.lo `test -f 'Message_Block.cpp' || echo '$(srcdir)/'`Message_Block.cpp + +libACE_la-Message_Queue.lo: Message_Queue.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Message_Queue.lo -MD -MP -MF $(DEPDIR)/libACE_la-Message_Queue.Tpo -c -o libACE_la-Message_Queue.lo `test -f 'Message_Queue.cpp' || echo '$(srcdir)/'`Message_Queue.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Message_Queue.Tpo $(DEPDIR)/libACE_la-Message_Queue.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Message_Queue.cpp' object='libACE_la-Message_Queue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Message_Queue.lo `test -f 'Message_Queue.cpp' || echo '$(srcdir)/'`Message_Queue.cpp + +libACE_la-Message_Queue_NT.lo: Message_Queue_NT.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Message_Queue_NT.lo -MD -MP -MF $(DEPDIR)/libACE_la-Message_Queue_NT.Tpo -c -o libACE_la-Message_Queue_NT.lo `test -f 'Message_Queue_NT.cpp' || echo '$(srcdir)/'`Message_Queue_NT.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Message_Queue_NT.Tpo $(DEPDIR)/libACE_la-Message_Queue_NT.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Message_Queue_NT.cpp' object='libACE_la-Message_Queue_NT.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Message_Queue_NT.lo `test -f 'Message_Queue_NT.cpp' || echo '$(srcdir)/'`Message_Queue_NT.cpp + +libACE_la-Message_Queue_Vx.lo: Message_Queue_Vx.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Message_Queue_Vx.lo -MD -MP -MF $(DEPDIR)/libACE_la-Message_Queue_Vx.Tpo -c -o libACE_la-Message_Queue_Vx.lo `test -f 'Message_Queue_Vx.cpp' || echo '$(srcdir)/'`Message_Queue_Vx.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Message_Queue_Vx.Tpo $(DEPDIR)/libACE_la-Message_Queue_Vx.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Message_Queue_Vx.cpp' object='libACE_la-Message_Queue_Vx.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Message_Queue_Vx.lo `test -f 'Message_Queue_Vx.cpp' || echo '$(srcdir)/'`Message_Queue_Vx.cpp + +libACE_la-Method_Request.lo: Method_Request.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Method_Request.lo -MD -MP -MF $(DEPDIR)/libACE_la-Method_Request.Tpo -c -o libACE_la-Method_Request.lo `test -f 'Method_Request.cpp' || echo '$(srcdir)/'`Method_Request.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Method_Request.Tpo $(DEPDIR)/libACE_la-Method_Request.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Method_Request.cpp' object='libACE_la-Method_Request.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Method_Request.lo `test -f 'Method_Request.cpp' || echo '$(srcdir)/'`Method_Request.cpp + +libACE_la-Monitor_Admin.lo: Monitor_Admin.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Admin.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Admin.Tpo -c -o libACE_la-Monitor_Admin.lo `test -f 'Monitor_Admin.cpp' || echo '$(srcdir)/'`Monitor_Admin.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Admin.Tpo $(DEPDIR)/libACE_la-Monitor_Admin.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Admin.cpp' object='libACE_la-Monitor_Admin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Admin.lo `test -f 'Monitor_Admin.cpp' || echo '$(srcdir)/'`Monitor_Admin.cpp + +libACE_la-Monitor_Admin_Manager.lo: Monitor_Admin_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Admin_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Admin_Manager.Tpo -c -o libACE_la-Monitor_Admin_Manager.lo `test -f 'Monitor_Admin_Manager.cpp' || echo '$(srcdir)/'`Monitor_Admin_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Admin_Manager.Tpo $(DEPDIR)/libACE_la-Monitor_Admin_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Admin_Manager.cpp' object='libACE_la-Monitor_Admin_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Admin_Manager.lo `test -f 'Monitor_Admin_Manager.cpp' || echo '$(srcdir)/'`Monitor_Admin_Manager.cpp + +libACE_la-Monitor_Base.lo: Monitor_Base.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Base.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Base.Tpo -c -o libACE_la-Monitor_Base.lo `test -f 'Monitor_Base.cpp' || echo '$(srcdir)/'`Monitor_Base.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Base.Tpo $(DEPDIR)/libACE_la-Monitor_Base.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Base.cpp' object='libACE_la-Monitor_Base.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Base.lo `test -f 'Monitor_Base.cpp' || echo '$(srcdir)/'`Monitor_Base.cpp + +libACE_la-Monitor_Control_Action.lo: Monitor_Control_Action.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Control_Action.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Control_Action.Tpo -c -o libACE_la-Monitor_Control_Action.lo `test -f 'Monitor_Control_Action.cpp' || echo '$(srcdir)/'`Monitor_Control_Action.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Control_Action.Tpo $(DEPDIR)/libACE_la-Monitor_Control_Action.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Control_Action.cpp' object='libACE_la-Monitor_Control_Action.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Control_Action.lo `test -f 'Monitor_Control_Action.cpp' || echo '$(srcdir)/'`Monitor_Control_Action.cpp + +libACE_la-Monitor_Control_Types.lo: Monitor_Control_Types.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Control_Types.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Control_Types.Tpo -c -o libACE_la-Monitor_Control_Types.lo `test -f 'Monitor_Control_Types.cpp' || echo '$(srcdir)/'`Monitor_Control_Types.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Control_Types.Tpo $(DEPDIR)/libACE_la-Monitor_Control_Types.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Control_Types.cpp' object='libACE_la-Monitor_Control_Types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Control_Types.lo `test -f 'Monitor_Control_Types.cpp' || echo '$(srcdir)/'`Monitor_Control_Types.cpp + +libACE_la-Monitor_Point_Registry.lo: Monitor_Point_Registry.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Point_Registry.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Point_Registry.Tpo -c -o libACE_la-Monitor_Point_Registry.lo `test -f 'Monitor_Point_Registry.cpp' || echo '$(srcdir)/'`Monitor_Point_Registry.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Point_Registry.Tpo $(DEPDIR)/libACE_la-Monitor_Point_Registry.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Point_Registry.cpp' object='libACE_la-Monitor_Point_Registry.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Point_Registry.lo `test -f 'Monitor_Point_Registry.cpp' || echo '$(srcdir)/'`Monitor_Point_Registry.cpp + +libACE_la-Monitor_Size.lo: Monitor_Size.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Monitor_Size.lo -MD -MP -MF $(DEPDIR)/libACE_la-Monitor_Size.Tpo -c -o libACE_la-Monitor_Size.lo `test -f 'Monitor_Size.cpp' || echo '$(srcdir)/'`Monitor_Size.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Monitor_Size.Tpo $(DEPDIR)/libACE_la-Monitor_Size.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Monitor_Size.cpp' object='libACE_la-Monitor_Size.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Monitor_Size.lo `test -f 'Monitor_Size.cpp' || echo '$(srcdir)/'`Monitor_Size.cpp + +libACE_la-Msg_WFMO_Reactor.lo: Msg_WFMO_Reactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Msg_WFMO_Reactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-Msg_WFMO_Reactor.Tpo -c -o libACE_la-Msg_WFMO_Reactor.lo `test -f 'Msg_WFMO_Reactor.cpp' || echo '$(srcdir)/'`Msg_WFMO_Reactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Msg_WFMO_Reactor.Tpo $(DEPDIR)/libACE_la-Msg_WFMO_Reactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Msg_WFMO_Reactor.cpp' object='libACE_la-Msg_WFMO_Reactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Msg_WFMO_Reactor.lo `test -f 'Msg_WFMO_Reactor.cpp' || echo '$(srcdir)/'`Msg_WFMO_Reactor.cpp + +libACE_la-Multihomed_INET_Addr.lo: Multihomed_INET_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Multihomed_INET_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-Multihomed_INET_Addr.Tpo -c -o libACE_la-Multihomed_INET_Addr.lo `test -f 'Multihomed_INET_Addr.cpp' || echo '$(srcdir)/'`Multihomed_INET_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Multihomed_INET_Addr.Tpo $(DEPDIR)/libACE_la-Multihomed_INET_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Multihomed_INET_Addr.cpp' object='libACE_la-Multihomed_INET_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Multihomed_INET_Addr.lo `test -f 'Multihomed_INET_Addr.cpp' || echo '$(srcdir)/'`Multihomed_INET_Addr.cpp + +libACE_la-Mutex.lo: Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-Mutex.Tpo -c -o libACE_la-Mutex.lo `test -f 'Mutex.cpp' || echo '$(srcdir)/'`Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Mutex.Tpo $(DEPDIR)/libACE_la-Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Mutex.cpp' object='libACE_la-Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Mutex.lo `test -f 'Mutex.cpp' || echo '$(srcdir)/'`Mutex.cpp + +libACE_la-NT_Service.lo: NT_Service.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-NT_Service.lo -MD -MP -MF $(DEPDIR)/libACE_la-NT_Service.Tpo -c -o libACE_la-NT_Service.lo `test -f 'NT_Service.cpp' || echo '$(srcdir)/'`NT_Service.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-NT_Service.Tpo $(DEPDIR)/libACE_la-NT_Service.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NT_Service.cpp' object='libACE_la-NT_Service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-NT_Service.lo `test -f 'NT_Service.cpp' || echo '$(srcdir)/'`NT_Service.cpp + +libACE_la-Name_Proxy.lo: Name_Proxy.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Name_Proxy.lo -MD -MP -MF $(DEPDIR)/libACE_la-Name_Proxy.Tpo -c -o libACE_la-Name_Proxy.lo `test -f 'Name_Proxy.cpp' || echo '$(srcdir)/'`Name_Proxy.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Name_Proxy.Tpo $(DEPDIR)/libACE_la-Name_Proxy.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Name_Proxy.cpp' object='libACE_la-Name_Proxy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Name_Proxy.lo `test -f 'Name_Proxy.cpp' || echo '$(srcdir)/'`Name_Proxy.cpp + +libACE_la-Name_Request_Reply.lo: Name_Request_Reply.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Name_Request_Reply.lo -MD -MP -MF $(DEPDIR)/libACE_la-Name_Request_Reply.Tpo -c -o libACE_la-Name_Request_Reply.lo `test -f 'Name_Request_Reply.cpp' || echo '$(srcdir)/'`Name_Request_Reply.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Name_Request_Reply.Tpo $(DEPDIR)/libACE_la-Name_Request_Reply.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Name_Request_Reply.cpp' object='libACE_la-Name_Request_Reply.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Name_Request_Reply.lo `test -f 'Name_Request_Reply.cpp' || echo '$(srcdir)/'`Name_Request_Reply.cpp + +libACE_la-Name_Space.lo: Name_Space.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Name_Space.lo -MD -MP -MF $(DEPDIR)/libACE_la-Name_Space.Tpo -c -o libACE_la-Name_Space.lo `test -f 'Name_Space.cpp' || echo '$(srcdir)/'`Name_Space.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Name_Space.Tpo $(DEPDIR)/libACE_la-Name_Space.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Name_Space.cpp' object='libACE_la-Name_Space.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Name_Space.lo `test -f 'Name_Space.cpp' || echo '$(srcdir)/'`Name_Space.cpp + +libACE_la-Naming_Context.lo: Naming_Context.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Naming_Context.lo -MD -MP -MF $(DEPDIR)/libACE_la-Naming_Context.Tpo -c -o libACE_la-Naming_Context.lo `test -f 'Naming_Context.cpp' || echo '$(srcdir)/'`Naming_Context.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Naming_Context.Tpo $(DEPDIR)/libACE_la-Naming_Context.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Naming_Context.cpp' object='libACE_la-Naming_Context.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Naming_Context.lo `test -f 'Naming_Context.cpp' || echo '$(srcdir)/'`Naming_Context.cpp + +libACE_la-Netlink_Addr.lo: Netlink_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Netlink_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-Netlink_Addr.Tpo -c -o libACE_la-Netlink_Addr.lo `test -f 'Netlink_Addr.cpp' || echo '$(srcdir)/'`Netlink_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Netlink_Addr.Tpo $(DEPDIR)/libACE_la-Netlink_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Netlink_Addr.cpp' object='libACE_la-Netlink_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Netlink_Addr.lo `test -f 'Netlink_Addr.cpp' || echo '$(srcdir)/'`Netlink_Addr.cpp + +libACE_la-Notification_Queue.lo: Notification_Queue.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Notification_Queue.lo -MD -MP -MF $(DEPDIR)/libACE_la-Notification_Queue.Tpo -c -o libACE_la-Notification_Queue.lo `test -f 'Notification_Queue.cpp' || echo '$(srcdir)/'`Notification_Queue.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Notification_Queue.Tpo $(DEPDIR)/libACE_la-Notification_Queue.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Notification_Queue.cpp' object='libACE_la-Notification_Queue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Notification_Queue.lo `test -f 'Notification_Queue.cpp' || echo '$(srcdir)/'`Notification_Queue.cpp + +libACE_la-Notification_Strategy.lo: Notification_Strategy.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Notification_Strategy.lo -MD -MP -MF $(DEPDIR)/libACE_la-Notification_Strategy.Tpo -c -o libACE_la-Notification_Strategy.lo `test -f 'Notification_Strategy.cpp' || echo '$(srcdir)/'`Notification_Strategy.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Notification_Strategy.Tpo $(DEPDIR)/libACE_la-Notification_Strategy.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Notification_Strategy.cpp' object='libACE_la-Notification_Strategy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Notification_Strategy.lo `test -f 'Notification_Strategy.cpp' || echo '$(srcdir)/'`Notification_Strategy.cpp + +libACE_la-OS_Errno.lo: OS_Errno.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_Errno.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_Errno.Tpo -c -o libACE_la-OS_Errno.lo `test -f 'OS_Errno.cpp' || echo '$(srcdir)/'`OS_Errno.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_Errno.Tpo $(DEPDIR)/libACE_la-OS_Errno.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_Errno.cpp' object='libACE_la-OS_Errno.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_Errno.lo `test -f 'OS_Errno.cpp' || echo '$(srcdir)/'`OS_Errno.cpp + +libACE_la-OS_Log_Msg_Attributes.lo: OS_Log_Msg_Attributes.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_Log_Msg_Attributes.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_Log_Msg_Attributes.Tpo -c -o libACE_la-OS_Log_Msg_Attributes.lo `test -f 'OS_Log_Msg_Attributes.cpp' || echo '$(srcdir)/'`OS_Log_Msg_Attributes.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_Log_Msg_Attributes.Tpo $(DEPDIR)/libACE_la-OS_Log_Msg_Attributes.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_Log_Msg_Attributes.cpp' object='libACE_la-OS_Log_Msg_Attributes.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_Log_Msg_Attributes.lo `test -f 'OS_Log_Msg_Attributes.cpp' || echo '$(srcdir)/'`OS_Log_Msg_Attributes.cpp + +libACE_la-OS_NS_Thread.lo: OS_NS_Thread.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_Thread.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_Thread.Tpo -c -o libACE_la-OS_NS_Thread.lo `test -f 'OS_NS_Thread.cpp' || echo '$(srcdir)/'`OS_NS_Thread.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_Thread.Tpo $(DEPDIR)/libACE_la-OS_NS_Thread.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_Thread.cpp' object='libACE_la-OS_NS_Thread.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_Thread.lo `test -f 'OS_NS_Thread.cpp' || echo '$(srcdir)/'`OS_NS_Thread.cpp + +libACE_la-OS_NS_arpa_inet.lo: OS_NS_arpa_inet.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_arpa_inet.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_arpa_inet.Tpo -c -o libACE_la-OS_NS_arpa_inet.lo `test -f 'OS_NS_arpa_inet.cpp' || echo '$(srcdir)/'`OS_NS_arpa_inet.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_arpa_inet.Tpo $(DEPDIR)/libACE_la-OS_NS_arpa_inet.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_arpa_inet.cpp' object='libACE_la-OS_NS_arpa_inet.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_arpa_inet.lo `test -f 'OS_NS_arpa_inet.cpp' || echo '$(srcdir)/'`OS_NS_arpa_inet.cpp + +libACE_la-OS_NS_ctype.lo: OS_NS_ctype.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_ctype.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_ctype.Tpo -c -o libACE_la-OS_NS_ctype.lo `test -f 'OS_NS_ctype.cpp' || echo '$(srcdir)/'`OS_NS_ctype.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_ctype.Tpo $(DEPDIR)/libACE_la-OS_NS_ctype.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_ctype.cpp' object='libACE_la-OS_NS_ctype.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_ctype.lo `test -f 'OS_NS_ctype.cpp' || echo '$(srcdir)/'`OS_NS_ctype.cpp + +libACE_la-OS_NS_dirent.lo: OS_NS_dirent.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_dirent.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_dirent.Tpo -c -o libACE_la-OS_NS_dirent.lo `test -f 'OS_NS_dirent.cpp' || echo '$(srcdir)/'`OS_NS_dirent.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_dirent.Tpo $(DEPDIR)/libACE_la-OS_NS_dirent.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_dirent.cpp' object='libACE_la-OS_NS_dirent.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_dirent.lo `test -f 'OS_NS_dirent.cpp' || echo '$(srcdir)/'`OS_NS_dirent.cpp + +libACE_la-OS_NS_dlfcn.lo: OS_NS_dlfcn.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_dlfcn.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_dlfcn.Tpo -c -o libACE_la-OS_NS_dlfcn.lo `test -f 'OS_NS_dlfcn.cpp' || echo '$(srcdir)/'`OS_NS_dlfcn.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_dlfcn.Tpo $(DEPDIR)/libACE_la-OS_NS_dlfcn.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_dlfcn.cpp' object='libACE_la-OS_NS_dlfcn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_dlfcn.lo `test -f 'OS_NS_dlfcn.cpp' || echo '$(srcdir)/'`OS_NS_dlfcn.cpp + +libACE_la-OS_NS_errno.lo: OS_NS_errno.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_errno.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_errno.Tpo -c -o libACE_la-OS_NS_errno.lo `test -f 'OS_NS_errno.cpp' || echo '$(srcdir)/'`OS_NS_errno.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_errno.Tpo $(DEPDIR)/libACE_la-OS_NS_errno.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_errno.cpp' object='libACE_la-OS_NS_errno.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_errno.lo `test -f 'OS_NS_errno.cpp' || echo '$(srcdir)/'`OS_NS_errno.cpp + +libACE_la-OS_NS_fcntl.lo: OS_NS_fcntl.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_fcntl.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_fcntl.Tpo -c -o libACE_la-OS_NS_fcntl.lo `test -f 'OS_NS_fcntl.cpp' || echo '$(srcdir)/'`OS_NS_fcntl.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_fcntl.Tpo $(DEPDIR)/libACE_la-OS_NS_fcntl.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_fcntl.cpp' object='libACE_la-OS_NS_fcntl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_fcntl.lo `test -f 'OS_NS_fcntl.cpp' || echo '$(srcdir)/'`OS_NS_fcntl.cpp + +libACE_la-OS_NS_math.lo: OS_NS_math.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_math.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_math.Tpo -c -o libACE_la-OS_NS_math.lo `test -f 'OS_NS_math.cpp' || echo '$(srcdir)/'`OS_NS_math.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_math.Tpo $(DEPDIR)/libACE_la-OS_NS_math.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_math.cpp' object='libACE_la-OS_NS_math.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_math.lo `test -f 'OS_NS_math.cpp' || echo '$(srcdir)/'`OS_NS_math.cpp + +libACE_la-OS_NS_netdb.lo: OS_NS_netdb.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_netdb.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_netdb.Tpo -c -o libACE_la-OS_NS_netdb.lo `test -f 'OS_NS_netdb.cpp' || echo '$(srcdir)/'`OS_NS_netdb.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_netdb.Tpo $(DEPDIR)/libACE_la-OS_NS_netdb.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_netdb.cpp' object='libACE_la-OS_NS_netdb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_netdb.lo `test -f 'OS_NS_netdb.cpp' || echo '$(srcdir)/'`OS_NS_netdb.cpp + +libACE_la-OS_NS_poll.lo: OS_NS_poll.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_poll.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_poll.Tpo -c -o libACE_la-OS_NS_poll.lo `test -f 'OS_NS_poll.cpp' || echo '$(srcdir)/'`OS_NS_poll.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_poll.Tpo $(DEPDIR)/libACE_la-OS_NS_poll.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_poll.cpp' object='libACE_la-OS_NS_poll.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_poll.lo `test -f 'OS_NS_poll.cpp' || echo '$(srcdir)/'`OS_NS_poll.cpp + +libACE_la-OS_NS_pwd.lo: OS_NS_pwd.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_pwd.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_pwd.Tpo -c -o libACE_la-OS_NS_pwd.lo `test -f 'OS_NS_pwd.cpp' || echo '$(srcdir)/'`OS_NS_pwd.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_pwd.Tpo $(DEPDIR)/libACE_la-OS_NS_pwd.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_pwd.cpp' object='libACE_la-OS_NS_pwd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_pwd.lo `test -f 'OS_NS_pwd.cpp' || echo '$(srcdir)/'`OS_NS_pwd.cpp + +libACE_la-OS_NS_regex.lo: OS_NS_regex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_regex.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_regex.Tpo -c -o libACE_la-OS_NS_regex.lo `test -f 'OS_NS_regex.cpp' || echo '$(srcdir)/'`OS_NS_regex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_regex.Tpo $(DEPDIR)/libACE_la-OS_NS_regex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_regex.cpp' object='libACE_la-OS_NS_regex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_regex.lo `test -f 'OS_NS_regex.cpp' || echo '$(srcdir)/'`OS_NS_regex.cpp + +libACE_la-OS_NS_signal.lo: OS_NS_signal.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_signal.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_signal.Tpo -c -o libACE_la-OS_NS_signal.lo `test -f 'OS_NS_signal.cpp' || echo '$(srcdir)/'`OS_NS_signal.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_signal.Tpo $(DEPDIR)/libACE_la-OS_NS_signal.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_signal.cpp' object='libACE_la-OS_NS_signal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_signal.lo `test -f 'OS_NS_signal.cpp' || echo '$(srcdir)/'`OS_NS_signal.cpp + +libACE_la-OS_NS_stdio.lo: OS_NS_stdio.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_stdio.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_stdio.Tpo -c -o libACE_la-OS_NS_stdio.lo `test -f 'OS_NS_stdio.cpp' || echo '$(srcdir)/'`OS_NS_stdio.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_stdio.Tpo $(DEPDIR)/libACE_la-OS_NS_stdio.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_stdio.cpp' object='libACE_la-OS_NS_stdio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_stdio.lo `test -f 'OS_NS_stdio.cpp' || echo '$(srcdir)/'`OS_NS_stdio.cpp + +libACE_la-OS_NS_stdlib.lo: OS_NS_stdlib.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_stdlib.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_stdlib.Tpo -c -o libACE_la-OS_NS_stdlib.lo `test -f 'OS_NS_stdlib.cpp' || echo '$(srcdir)/'`OS_NS_stdlib.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_stdlib.Tpo $(DEPDIR)/libACE_la-OS_NS_stdlib.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_stdlib.cpp' object='libACE_la-OS_NS_stdlib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_stdlib.lo `test -f 'OS_NS_stdlib.cpp' || echo '$(srcdir)/'`OS_NS_stdlib.cpp + +libACE_la-OS_NS_string.lo: OS_NS_string.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_string.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_string.Tpo -c -o libACE_la-OS_NS_string.lo `test -f 'OS_NS_string.cpp' || echo '$(srcdir)/'`OS_NS_string.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_string.Tpo $(DEPDIR)/libACE_la-OS_NS_string.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_string.cpp' object='libACE_la-OS_NS_string.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_string.lo `test -f 'OS_NS_string.cpp' || echo '$(srcdir)/'`OS_NS_string.cpp + +libACE_la-OS_NS_strings.lo: OS_NS_strings.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_strings.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_strings.Tpo -c -o libACE_la-OS_NS_strings.lo `test -f 'OS_NS_strings.cpp' || echo '$(srcdir)/'`OS_NS_strings.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_strings.Tpo $(DEPDIR)/libACE_la-OS_NS_strings.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_strings.cpp' object='libACE_la-OS_NS_strings.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_strings.lo `test -f 'OS_NS_strings.cpp' || echo '$(srcdir)/'`OS_NS_strings.cpp + +libACE_la-OS_NS_stropts.lo: OS_NS_stropts.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_stropts.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_stropts.Tpo -c -o libACE_la-OS_NS_stropts.lo `test -f 'OS_NS_stropts.cpp' || echo '$(srcdir)/'`OS_NS_stropts.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_stropts.Tpo $(DEPDIR)/libACE_la-OS_NS_stropts.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_stropts.cpp' object='libACE_la-OS_NS_stropts.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_stropts.lo `test -f 'OS_NS_stropts.cpp' || echo '$(srcdir)/'`OS_NS_stropts.cpp + +libACE_la-OS_NS_sys_mman.lo: OS_NS_sys_mman.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_mman.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_mman.Tpo -c -o libACE_la-OS_NS_sys_mman.lo `test -f 'OS_NS_sys_mman.cpp' || echo '$(srcdir)/'`OS_NS_sys_mman.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_mman.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_mman.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_mman.cpp' object='libACE_la-OS_NS_sys_mman.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_mman.lo `test -f 'OS_NS_sys_mman.cpp' || echo '$(srcdir)/'`OS_NS_sys_mman.cpp + +libACE_la-OS_NS_sys_msg.lo: OS_NS_sys_msg.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_msg.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_msg.Tpo -c -o libACE_la-OS_NS_sys_msg.lo `test -f 'OS_NS_sys_msg.cpp' || echo '$(srcdir)/'`OS_NS_sys_msg.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_msg.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_msg.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_msg.cpp' object='libACE_la-OS_NS_sys_msg.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_msg.lo `test -f 'OS_NS_sys_msg.cpp' || echo '$(srcdir)/'`OS_NS_sys_msg.cpp + +libACE_la-OS_NS_sys_resource.lo: OS_NS_sys_resource.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_resource.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_resource.Tpo -c -o libACE_la-OS_NS_sys_resource.lo `test -f 'OS_NS_sys_resource.cpp' || echo '$(srcdir)/'`OS_NS_sys_resource.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_resource.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_resource.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_resource.cpp' object='libACE_la-OS_NS_sys_resource.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_resource.lo `test -f 'OS_NS_sys_resource.cpp' || echo '$(srcdir)/'`OS_NS_sys_resource.cpp + +libACE_la-OS_NS_sys_select.lo: OS_NS_sys_select.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_select.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_select.Tpo -c -o libACE_la-OS_NS_sys_select.lo `test -f 'OS_NS_sys_select.cpp' || echo '$(srcdir)/'`OS_NS_sys_select.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_select.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_select.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_select.cpp' object='libACE_la-OS_NS_sys_select.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_select.lo `test -f 'OS_NS_sys_select.cpp' || echo '$(srcdir)/'`OS_NS_sys_select.cpp + +libACE_la-OS_NS_sys_sendfile.lo: OS_NS_sys_sendfile.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_sendfile.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_sendfile.Tpo -c -o libACE_la-OS_NS_sys_sendfile.lo `test -f 'OS_NS_sys_sendfile.cpp' || echo '$(srcdir)/'`OS_NS_sys_sendfile.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_sendfile.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_sendfile.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_sendfile.cpp' object='libACE_la-OS_NS_sys_sendfile.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_sendfile.lo `test -f 'OS_NS_sys_sendfile.cpp' || echo '$(srcdir)/'`OS_NS_sys_sendfile.cpp + +libACE_la-OS_NS_sys_shm.lo: OS_NS_sys_shm.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_shm.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_shm.Tpo -c -o libACE_la-OS_NS_sys_shm.lo `test -f 'OS_NS_sys_shm.cpp' || echo '$(srcdir)/'`OS_NS_sys_shm.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_shm.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_shm.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_shm.cpp' object='libACE_la-OS_NS_sys_shm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_shm.lo `test -f 'OS_NS_sys_shm.cpp' || echo '$(srcdir)/'`OS_NS_sys_shm.cpp + +libACE_la-OS_NS_sys_socket.lo: OS_NS_sys_socket.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_socket.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_socket.Tpo -c -o libACE_la-OS_NS_sys_socket.lo `test -f 'OS_NS_sys_socket.cpp' || echo '$(srcdir)/'`OS_NS_sys_socket.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_socket.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_socket.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_socket.cpp' object='libACE_la-OS_NS_sys_socket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_socket.lo `test -f 'OS_NS_sys_socket.cpp' || echo '$(srcdir)/'`OS_NS_sys_socket.cpp + +libACE_la-OS_NS_sys_stat.lo: OS_NS_sys_stat.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_stat.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_stat.Tpo -c -o libACE_la-OS_NS_sys_stat.lo `test -f 'OS_NS_sys_stat.cpp' || echo '$(srcdir)/'`OS_NS_sys_stat.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_stat.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_stat.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_stat.cpp' object='libACE_la-OS_NS_sys_stat.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_stat.lo `test -f 'OS_NS_sys_stat.cpp' || echo '$(srcdir)/'`OS_NS_sys_stat.cpp + +libACE_la-OS_NS_sys_time.lo: OS_NS_sys_time.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_time.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_time.Tpo -c -o libACE_la-OS_NS_sys_time.lo `test -f 'OS_NS_sys_time.cpp' || echo '$(srcdir)/'`OS_NS_sys_time.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_time.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_time.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_time.cpp' object='libACE_la-OS_NS_sys_time.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_time.lo `test -f 'OS_NS_sys_time.cpp' || echo '$(srcdir)/'`OS_NS_sys_time.cpp + +libACE_la-OS_NS_sys_uio.lo: OS_NS_sys_uio.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_uio.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_uio.Tpo -c -o libACE_la-OS_NS_sys_uio.lo `test -f 'OS_NS_sys_uio.cpp' || echo '$(srcdir)/'`OS_NS_sys_uio.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_uio.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_uio.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_uio.cpp' object='libACE_la-OS_NS_sys_uio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_uio.lo `test -f 'OS_NS_sys_uio.cpp' || echo '$(srcdir)/'`OS_NS_sys_uio.cpp + +libACE_la-OS_NS_sys_utsname.lo: OS_NS_sys_utsname.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_utsname.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_utsname.Tpo -c -o libACE_la-OS_NS_sys_utsname.lo `test -f 'OS_NS_sys_utsname.cpp' || echo '$(srcdir)/'`OS_NS_sys_utsname.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_utsname.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_utsname.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_utsname.cpp' object='libACE_la-OS_NS_sys_utsname.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_utsname.lo `test -f 'OS_NS_sys_utsname.cpp' || echo '$(srcdir)/'`OS_NS_sys_utsname.cpp + +libACE_la-OS_NS_sys_wait.lo: OS_NS_sys_wait.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_sys_wait.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_sys_wait.Tpo -c -o libACE_la-OS_NS_sys_wait.lo `test -f 'OS_NS_sys_wait.cpp' || echo '$(srcdir)/'`OS_NS_sys_wait.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_sys_wait.Tpo $(DEPDIR)/libACE_la-OS_NS_sys_wait.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_sys_wait.cpp' object='libACE_la-OS_NS_sys_wait.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_sys_wait.lo `test -f 'OS_NS_sys_wait.cpp' || echo '$(srcdir)/'`OS_NS_sys_wait.cpp + +libACE_la-OS_NS_time.lo: OS_NS_time.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_time.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_time.Tpo -c -o libACE_la-OS_NS_time.lo `test -f 'OS_NS_time.cpp' || echo '$(srcdir)/'`OS_NS_time.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_time.Tpo $(DEPDIR)/libACE_la-OS_NS_time.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_time.cpp' object='libACE_la-OS_NS_time.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_time.lo `test -f 'OS_NS_time.cpp' || echo '$(srcdir)/'`OS_NS_time.cpp + +libACE_la-OS_NS_unistd.lo: OS_NS_unistd.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_unistd.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_unistd.Tpo -c -o libACE_la-OS_NS_unistd.lo `test -f 'OS_NS_unistd.cpp' || echo '$(srcdir)/'`OS_NS_unistd.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_unistd.Tpo $(DEPDIR)/libACE_la-OS_NS_unistd.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_unistd.cpp' object='libACE_la-OS_NS_unistd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_unistd.lo `test -f 'OS_NS_unistd.cpp' || echo '$(srcdir)/'`OS_NS_unistd.cpp + +libACE_la-OS_NS_wchar.lo: OS_NS_wchar.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_wchar.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_wchar.Tpo -c -o libACE_la-OS_NS_wchar.lo `test -f 'OS_NS_wchar.cpp' || echo '$(srcdir)/'`OS_NS_wchar.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_wchar.Tpo $(DEPDIR)/libACE_la-OS_NS_wchar.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_wchar.cpp' object='libACE_la-OS_NS_wchar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_wchar.lo `test -f 'OS_NS_wchar.cpp' || echo '$(srcdir)/'`OS_NS_wchar.cpp + +libACE_la-OS_NS_wctype.lo: OS_NS_wctype.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_NS_wctype.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_NS_wctype.Tpo -c -o libACE_la-OS_NS_wctype.lo `test -f 'OS_NS_wctype.cpp' || echo '$(srcdir)/'`OS_NS_wctype.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_NS_wctype.Tpo $(DEPDIR)/libACE_la-OS_NS_wctype.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_NS_wctype.cpp' object='libACE_la-OS_NS_wctype.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_NS_wctype.lo `test -f 'OS_NS_wctype.cpp' || echo '$(srcdir)/'`OS_NS_wctype.cpp + +libACE_la-OS_QoS.lo: OS_QoS.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_QoS.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_QoS.Tpo -c -o libACE_la-OS_QoS.lo `test -f 'OS_QoS.cpp' || echo '$(srcdir)/'`OS_QoS.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_QoS.Tpo $(DEPDIR)/libACE_la-OS_QoS.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_QoS.cpp' object='libACE_la-OS_QoS.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_QoS.lo `test -f 'OS_QoS.cpp' || echo '$(srcdir)/'`OS_QoS.cpp + +libACE_la-OS_TLI.lo: OS_TLI.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_TLI.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_TLI.Tpo -c -o libACE_la-OS_TLI.lo `test -f 'OS_TLI.cpp' || echo '$(srcdir)/'`OS_TLI.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_TLI.Tpo $(DEPDIR)/libACE_la-OS_TLI.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_TLI.cpp' object='libACE_la-OS_TLI.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_TLI.lo `test -f 'OS_TLI.cpp' || echo '$(srcdir)/'`OS_TLI.cpp + +libACE_la-OS_Thread_Adapter.lo: OS_Thread_Adapter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_Thread_Adapter.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_Thread_Adapter.Tpo -c -o libACE_la-OS_Thread_Adapter.lo `test -f 'OS_Thread_Adapter.cpp' || echo '$(srcdir)/'`OS_Thread_Adapter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_Thread_Adapter.Tpo $(DEPDIR)/libACE_la-OS_Thread_Adapter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_Thread_Adapter.cpp' object='libACE_la-OS_Thread_Adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_Thread_Adapter.lo `test -f 'OS_Thread_Adapter.cpp' || echo '$(srcdir)/'`OS_Thread_Adapter.cpp + +libACE_la-OS_main.lo: OS_main.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-OS_main.lo -MD -MP -MF $(DEPDIR)/libACE_la-OS_main.Tpo -c -o libACE_la-OS_main.lo `test -f 'OS_main.cpp' || echo '$(srcdir)/'`OS_main.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-OS_main.Tpo $(DEPDIR)/libACE_la-OS_main.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OS_main.cpp' object='libACE_la-OS_main.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-OS_main.lo `test -f 'OS_main.cpp' || echo '$(srcdir)/'`OS_main.cpp + +libACE_la-Obchunk.lo: Obchunk.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Obchunk.lo -MD -MP -MF $(DEPDIR)/libACE_la-Obchunk.Tpo -c -o libACE_la-Obchunk.lo `test -f 'Obchunk.cpp' || echo '$(srcdir)/'`Obchunk.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Obchunk.Tpo $(DEPDIR)/libACE_la-Obchunk.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Obchunk.cpp' object='libACE_la-Obchunk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Obchunk.lo `test -f 'Obchunk.cpp' || echo '$(srcdir)/'`Obchunk.cpp + +libACE_la-Object_Manager.lo: Object_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Object_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Object_Manager.Tpo -c -o libACE_la-Object_Manager.lo `test -f 'Object_Manager.cpp' || echo '$(srcdir)/'`Object_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Object_Manager.Tpo $(DEPDIR)/libACE_la-Object_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Object_Manager.cpp' object='libACE_la-Object_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Object_Manager.lo `test -f 'Object_Manager.cpp' || echo '$(srcdir)/'`Object_Manager.cpp + +libACE_la-Object_Manager_Base.lo: Object_Manager_Base.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Object_Manager_Base.lo -MD -MP -MF $(DEPDIR)/libACE_la-Object_Manager_Base.Tpo -c -o libACE_la-Object_Manager_Base.lo `test -f 'Object_Manager_Base.cpp' || echo '$(srcdir)/'`Object_Manager_Base.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Object_Manager_Base.Tpo $(DEPDIR)/libACE_la-Object_Manager_Base.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Object_Manager_Base.cpp' object='libACE_la-Object_Manager_Base.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Object_Manager_Base.lo `test -f 'Object_Manager_Base.cpp' || echo '$(srcdir)/'`Object_Manager_Base.cpp + +libACE_la-PI_Malloc.lo: PI_Malloc.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-PI_Malloc.lo -MD -MP -MF $(DEPDIR)/libACE_la-PI_Malloc.Tpo -c -o libACE_la-PI_Malloc.lo `test -f 'PI_Malloc.cpp' || echo '$(srcdir)/'`PI_Malloc.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-PI_Malloc.Tpo $(DEPDIR)/libACE_la-PI_Malloc.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PI_Malloc.cpp' object='libACE_la-PI_Malloc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-PI_Malloc.lo `test -f 'PI_Malloc.cpp' || echo '$(srcdir)/'`PI_Malloc.cpp + +libACE_la-POSIX_Asynch_IO.lo: POSIX_Asynch_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-POSIX_Asynch_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-POSIX_Asynch_IO.Tpo -c -o libACE_la-POSIX_Asynch_IO.lo `test -f 'POSIX_Asynch_IO.cpp' || echo '$(srcdir)/'`POSIX_Asynch_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-POSIX_Asynch_IO.Tpo $(DEPDIR)/libACE_la-POSIX_Asynch_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='POSIX_Asynch_IO.cpp' object='libACE_la-POSIX_Asynch_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-POSIX_Asynch_IO.lo `test -f 'POSIX_Asynch_IO.cpp' || echo '$(srcdir)/'`POSIX_Asynch_IO.cpp + +libACE_la-POSIX_CB_Proactor.lo: POSIX_CB_Proactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-POSIX_CB_Proactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-POSIX_CB_Proactor.Tpo -c -o libACE_la-POSIX_CB_Proactor.lo `test -f 'POSIX_CB_Proactor.cpp' || echo '$(srcdir)/'`POSIX_CB_Proactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-POSIX_CB_Proactor.Tpo $(DEPDIR)/libACE_la-POSIX_CB_Proactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='POSIX_CB_Proactor.cpp' object='libACE_la-POSIX_CB_Proactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-POSIX_CB_Proactor.lo `test -f 'POSIX_CB_Proactor.cpp' || echo '$(srcdir)/'`POSIX_CB_Proactor.cpp + +libACE_la-POSIX_Proactor.lo: POSIX_Proactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-POSIX_Proactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-POSIX_Proactor.Tpo -c -o libACE_la-POSIX_Proactor.lo `test -f 'POSIX_Proactor.cpp' || echo '$(srcdir)/'`POSIX_Proactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-POSIX_Proactor.Tpo $(DEPDIR)/libACE_la-POSIX_Proactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='POSIX_Proactor.cpp' object='libACE_la-POSIX_Proactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-POSIX_Proactor.lo `test -f 'POSIX_Proactor.cpp' || echo '$(srcdir)/'`POSIX_Proactor.cpp + +libACE_la-Pagefile_Memory_Pool.lo: Pagefile_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Pagefile_Memory_Pool.lo -MD -MP -MF $(DEPDIR)/libACE_la-Pagefile_Memory_Pool.Tpo -c -o libACE_la-Pagefile_Memory_Pool.lo `test -f 'Pagefile_Memory_Pool.cpp' || echo '$(srcdir)/'`Pagefile_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Pagefile_Memory_Pool.Tpo $(DEPDIR)/libACE_la-Pagefile_Memory_Pool.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Pagefile_Memory_Pool.cpp' object='libACE_la-Pagefile_Memory_Pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Pagefile_Memory_Pool.lo `test -f 'Pagefile_Memory_Pool.cpp' || echo '$(srcdir)/'`Pagefile_Memory_Pool.cpp + +libACE_la-Parse_Node.lo: Parse_Node.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Parse_Node.lo -MD -MP -MF $(DEPDIR)/libACE_la-Parse_Node.Tpo -c -o libACE_la-Parse_Node.lo `test -f 'Parse_Node.cpp' || echo '$(srcdir)/'`Parse_Node.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Parse_Node.Tpo $(DEPDIR)/libACE_la-Parse_Node.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Parse_Node.cpp' object='libACE_la-Parse_Node.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Parse_Node.lo `test -f 'Parse_Node.cpp' || echo '$(srcdir)/'`Parse_Node.cpp + +libACE_la-Ping_Socket.lo: Ping_Socket.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Ping_Socket.lo -MD -MP -MF $(DEPDIR)/libACE_la-Ping_Socket.Tpo -c -o libACE_la-Ping_Socket.lo `test -f 'Ping_Socket.cpp' || echo '$(srcdir)/'`Ping_Socket.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Ping_Socket.Tpo $(DEPDIR)/libACE_la-Ping_Socket.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Ping_Socket.cpp' object='libACE_la-Ping_Socket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Ping_Socket.lo `test -f 'Ping_Socket.cpp' || echo '$(srcdir)/'`Ping_Socket.cpp + +libACE_la-Pipe.lo: Pipe.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Pipe.lo -MD -MP -MF $(DEPDIR)/libACE_la-Pipe.Tpo -c -o libACE_la-Pipe.lo `test -f 'Pipe.cpp' || echo '$(srcdir)/'`Pipe.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Pipe.Tpo $(DEPDIR)/libACE_la-Pipe.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Pipe.cpp' object='libACE_la-Pipe.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Pipe.lo `test -f 'Pipe.cpp' || echo '$(srcdir)/'`Pipe.cpp + +libACE_la-Priority_Reactor.lo: Priority_Reactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Priority_Reactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-Priority_Reactor.Tpo -c -o libACE_la-Priority_Reactor.lo `test -f 'Priority_Reactor.cpp' || echo '$(srcdir)/'`Priority_Reactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Priority_Reactor.Tpo $(DEPDIR)/libACE_la-Priority_Reactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Priority_Reactor.cpp' object='libACE_la-Priority_Reactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Priority_Reactor.lo `test -f 'Priority_Reactor.cpp' || echo '$(srcdir)/'`Priority_Reactor.cpp + +libACE_la-Proactor.lo: Proactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Proactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-Proactor.Tpo -c -o libACE_la-Proactor.lo `test -f 'Proactor.cpp' || echo '$(srcdir)/'`Proactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Proactor.Tpo $(DEPDIR)/libACE_la-Proactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Proactor.cpp' object='libACE_la-Proactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Proactor.lo `test -f 'Proactor.cpp' || echo '$(srcdir)/'`Proactor.cpp + +libACE_la-Proactor_Impl.lo: Proactor_Impl.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Proactor_Impl.lo -MD -MP -MF $(DEPDIR)/libACE_la-Proactor_Impl.Tpo -c -o libACE_la-Proactor_Impl.lo `test -f 'Proactor_Impl.cpp' || echo '$(srcdir)/'`Proactor_Impl.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Proactor_Impl.Tpo $(DEPDIR)/libACE_la-Proactor_Impl.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Proactor_Impl.cpp' object='libACE_la-Proactor_Impl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Proactor_Impl.lo `test -f 'Proactor_Impl.cpp' || echo '$(srcdir)/'`Proactor_Impl.cpp + +libACE_la-Process.lo: Process.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Process.lo -MD -MP -MF $(DEPDIR)/libACE_la-Process.Tpo -c -o libACE_la-Process.lo `test -f 'Process.cpp' || echo '$(srcdir)/'`Process.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Process.Tpo $(DEPDIR)/libACE_la-Process.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Process.cpp' object='libACE_la-Process.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Process.lo `test -f 'Process.cpp' || echo '$(srcdir)/'`Process.cpp + +libACE_la-Process_Manager.lo: Process_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Process_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Process_Manager.Tpo -c -o libACE_la-Process_Manager.lo `test -f 'Process_Manager.cpp' || echo '$(srcdir)/'`Process_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Process_Manager.Tpo $(DEPDIR)/libACE_la-Process_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Process_Manager.cpp' object='libACE_la-Process_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Process_Manager.lo `test -f 'Process_Manager.cpp' || echo '$(srcdir)/'`Process_Manager.cpp + +libACE_la-Process_Mutex.lo: Process_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Process_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-Process_Mutex.Tpo -c -o libACE_la-Process_Mutex.lo `test -f 'Process_Mutex.cpp' || echo '$(srcdir)/'`Process_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Process_Mutex.Tpo $(DEPDIR)/libACE_la-Process_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Process_Mutex.cpp' object='libACE_la-Process_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Process_Mutex.lo `test -f 'Process_Mutex.cpp' || echo '$(srcdir)/'`Process_Mutex.cpp + +libACE_la-Process_Semaphore.lo: Process_Semaphore.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Process_Semaphore.lo -MD -MP -MF $(DEPDIR)/libACE_la-Process_Semaphore.Tpo -c -o libACE_la-Process_Semaphore.lo `test -f 'Process_Semaphore.cpp' || echo '$(srcdir)/'`Process_Semaphore.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Process_Semaphore.Tpo $(DEPDIR)/libACE_la-Process_Semaphore.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Process_Semaphore.cpp' object='libACE_la-Process_Semaphore.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Process_Semaphore.lo `test -f 'Process_Semaphore.cpp' || echo '$(srcdir)/'`Process_Semaphore.cpp + +libACE_la-Profile_Timer.lo: Profile_Timer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Profile_Timer.lo -MD -MP -MF $(DEPDIR)/libACE_la-Profile_Timer.Tpo -c -o libACE_la-Profile_Timer.lo `test -f 'Profile_Timer.cpp' || echo '$(srcdir)/'`Profile_Timer.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Profile_Timer.Tpo $(DEPDIR)/libACE_la-Profile_Timer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Profile_Timer.cpp' object='libACE_la-Profile_Timer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Profile_Timer.lo `test -f 'Profile_Timer.cpp' || echo '$(srcdir)/'`Profile_Timer.cpp + +libACE_la-RW_Mutex.lo: RW_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-RW_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-RW_Mutex.Tpo -c -o libACE_la-RW_Mutex.lo `test -f 'RW_Mutex.cpp' || echo '$(srcdir)/'`RW_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-RW_Mutex.Tpo $(DEPDIR)/libACE_la-RW_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RW_Mutex.cpp' object='libACE_la-RW_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-RW_Mutex.lo `test -f 'RW_Mutex.cpp' || echo '$(srcdir)/'`RW_Mutex.cpp + +libACE_la-RW_Process_Mutex.lo: RW_Process_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-RW_Process_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-RW_Process_Mutex.Tpo -c -o libACE_la-RW_Process_Mutex.lo `test -f 'RW_Process_Mutex.cpp' || echo '$(srcdir)/'`RW_Process_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-RW_Process_Mutex.Tpo $(DEPDIR)/libACE_la-RW_Process_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RW_Process_Mutex.cpp' object='libACE_la-RW_Process_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-RW_Process_Mutex.lo `test -f 'RW_Process_Mutex.cpp' || echo '$(srcdir)/'`RW_Process_Mutex.cpp + +libACE_la-RW_Thread_Mutex.lo: RW_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-RW_Thread_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-RW_Thread_Mutex.Tpo -c -o libACE_la-RW_Thread_Mutex.lo `test -f 'RW_Thread_Mutex.cpp' || echo '$(srcdir)/'`RW_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-RW_Thread_Mutex.Tpo $(DEPDIR)/libACE_la-RW_Thread_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RW_Thread_Mutex.cpp' object='libACE_la-RW_Thread_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-RW_Thread_Mutex.lo `test -f 'RW_Thread_Mutex.cpp' || echo '$(srcdir)/'`RW_Thread_Mutex.cpp + +libACE_la-Reactor.lo: Reactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Reactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-Reactor.Tpo -c -o libACE_la-Reactor.lo `test -f 'Reactor.cpp' || echo '$(srcdir)/'`Reactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Reactor.Tpo $(DEPDIR)/libACE_la-Reactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Reactor.cpp' object='libACE_la-Reactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Reactor.lo `test -f 'Reactor.cpp' || echo '$(srcdir)/'`Reactor.cpp + +libACE_la-Reactor_Impl.lo: Reactor_Impl.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Reactor_Impl.lo -MD -MP -MF $(DEPDIR)/libACE_la-Reactor_Impl.Tpo -c -o libACE_la-Reactor_Impl.lo `test -f 'Reactor_Impl.cpp' || echo '$(srcdir)/'`Reactor_Impl.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Reactor_Impl.Tpo $(DEPDIR)/libACE_la-Reactor_Impl.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Reactor_Impl.cpp' object='libACE_la-Reactor_Impl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Reactor_Impl.lo `test -f 'Reactor_Impl.cpp' || echo '$(srcdir)/'`Reactor_Impl.cpp + +libACE_la-Reactor_Notification_Strategy.lo: Reactor_Notification_Strategy.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Reactor_Notification_Strategy.lo -MD -MP -MF $(DEPDIR)/libACE_la-Reactor_Notification_Strategy.Tpo -c -o libACE_la-Reactor_Notification_Strategy.lo `test -f 'Reactor_Notification_Strategy.cpp' || echo '$(srcdir)/'`Reactor_Notification_Strategy.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Reactor_Notification_Strategy.Tpo $(DEPDIR)/libACE_la-Reactor_Notification_Strategy.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Reactor_Notification_Strategy.cpp' object='libACE_la-Reactor_Notification_Strategy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Reactor_Notification_Strategy.lo `test -f 'Reactor_Notification_Strategy.cpp' || echo '$(srcdir)/'`Reactor_Notification_Strategy.cpp + +libACE_la-Reactor_Timer_Interface.lo: Reactor_Timer_Interface.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Reactor_Timer_Interface.lo -MD -MP -MF $(DEPDIR)/libACE_la-Reactor_Timer_Interface.Tpo -c -o libACE_la-Reactor_Timer_Interface.lo `test -f 'Reactor_Timer_Interface.cpp' || echo '$(srcdir)/'`Reactor_Timer_Interface.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Reactor_Timer_Interface.Tpo $(DEPDIR)/libACE_la-Reactor_Timer_Interface.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Reactor_Timer_Interface.cpp' object='libACE_la-Reactor_Timer_Interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Reactor_Timer_Interface.lo `test -f 'Reactor_Timer_Interface.cpp' || echo '$(srcdir)/'`Reactor_Timer_Interface.cpp + +libACE_la-Read_Buffer.lo: Read_Buffer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Read_Buffer.lo -MD -MP -MF $(DEPDIR)/libACE_la-Read_Buffer.Tpo -c -o libACE_la-Read_Buffer.lo `test -f 'Read_Buffer.cpp' || echo '$(srcdir)/'`Read_Buffer.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Read_Buffer.Tpo $(DEPDIR)/libACE_la-Read_Buffer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Read_Buffer.cpp' object='libACE_la-Read_Buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Read_Buffer.lo `test -f 'Read_Buffer.cpp' || echo '$(srcdir)/'`Read_Buffer.cpp + +libACE_la-Recursive_Thread_Mutex.lo: Recursive_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Recursive_Thread_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-Recursive_Thread_Mutex.Tpo -c -o libACE_la-Recursive_Thread_Mutex.lo `test -f 'Recursive_Thread_Mutex.cpp' || echo '$(srcdir)/'`Recursive_Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Recursive_Thread_Mutex.Tpo $(DEPDIR)/libACE_la-Recursive_Thread_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Recursive_Thread_Mutex.cpp' object='libACE_la-Recursive_Thread_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Recursive_Thread_Mutex.lo `test -f 'Recursive_Thread_Mutex.cpp' || echo '$(srcdir)/'`Recursive_Thread_Mutex.cpp + +libACE_la-Recyclable.lo: Recyclable.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Recyclable.lo -MD -MP -MF $(DEPDIR)/libACE_la-Recyclable.Tpo -c -o libACE_la-Recyclable.lo `test -f 'Recyclable.cpp' || echo '$(srcdir)/'`Recyclable.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Recyclable.Tpo $(DEPDIR)/libACE_la-Recyclable.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Recyclable.cpp' object='libACE_la-Recyclable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Recyclable.lo `test -f 'Recyclable.cpp' || echo '$(srcdir)/'`Recyclable.cpp + +libACE_la-Registry.lo: Registry.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Registry.lo -MD -MP -MF $(DEPDIR)/libACE_la-Registry.Tpo -c -o libACE_la-Registry.lo `test -f 'Registry.cpp' || echo '$(srcdir)/'`Registry.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Registry.Tpo $(DEPDIR)/libACE_la-Registry.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Registry.cpp' object='libACE_la-Registry.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Registry.lo `test -f 'Registry.cpp' || echo '$(srcdir)/'`Registry.cpp + +libACE_la-Registry_Name_Space.lo: Registry_Name_Space.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Registry_Name_Space.lo -MD -MP -MF $(DEPDIR)/libACE_la-Registry_Name_Space.Tpo -c -o libACE_la-Registry_Name_Space.lo `test -f 'Registry_Name_Space.cpp' || echo '$(srcdir)/'`Registry_Name_Space.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Registry_Name_Space.Tpo $(DEPDIR)/libACE_la-Registry_Name_Space.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Registry_Name_Space.cpp' object='libACE_la-Registry_Name_Space.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Registry_Name_Space.lo `test -f 'Registry_Name_Space.cpp' || echo '$(srcdir)/'`Registry_Name_Space.cpp + +libACE_la-Remote_Name_Space.lo: Remote_Name_Space.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Remote_Name_Space.lo -MD -MP -MF $(DEPDIR)/libACE_la-Remote_Name_Space.Tpo -c -o libACE_la-Remote_Name_Space.lo `test -f 'Remote_Name_Space.cpp' || echo '$(srcdir)/'`Remote_Name_Space.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Remote_Name_Space.Tpo $(DEPDIR)/libACE_la-Remote_Name_Space.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Remote_Name_Space.cpp' object='libACE_la-Remote_Name_Space.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Remote_Name_Space.lo `test -f 'Remote_Name_Space.cpp' || echo '$(srcdir)/'`Remote_Name_Space.cpp + +libACE_la-Remote_Tokens.lo: Remote_Tokens.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Remote_Tokens.lo -MD -MP -MF $(DEPDIR)/libACE_la-Remote_Tokens.Tpo -c -o libACE_la-Remote_Tokens.lo `test -f 'Remote_Tokens.cpp' || echo '$(srcdir)/'`Remote_Tokens.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Remote_Tokens.Tpo $(DEPDIR)/libACE_la-Remote_Tokens.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Remote_Tokens.cpp' object='libACE_la-Remote_Tokens.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Remote_Tokens.lo `test -f 'Remote_Tokens.cpp' || echo '$(srcdir)/'`Remote_Tokens.cpp + +libACE_la-SOCK.lo: SOCK.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK.Tpo -c -o libACE_la-SOCK.lo `test -f 'SOCK.cpp' || echo '$(srcdir)/'`SOCK.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK.Tpo $(DEPDIR)/libACE_la-SOCK.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK.cpp' object='libACE_la-SOCK.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK.lo `test -f 'SOCK.cpp' || echo '$(srcdir)/'`SOCK.cpp + +libACE_la-SOCK_Acceptor.lo: SOCK_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Acceptor.Tpo -c -o libACE_la-SOCK_Acceptor.lo `test -f 'SOCK_Acceptor.cpp' || echo '$(srcdir)/'`SOCK_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Acceptor.Tpo $(DEPDIR)/libACE_la-SOCK_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Acceptor.cpp' object='libACE_la-SOCK_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Acceptor.lo `test -f 'SOCK_Acceptor.cpp' || echo '$(srcdir)/'`SOCK_Acceptor.cpp + +libACE_la-SOCK_CODgram.lo: SOCK_CODgram.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_CODgram.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_CODgram.Tpo -c -o libACE_la-SOCK_CODgram.lo `test -f 'SOCK_CODgram.cpp' || echo '$(srcdir)/'`SOCK_CODgram.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_CODgram.Tpo $(DEPDIR)/libACE_la-SOCK_CODgram.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_CODgram.cpp' object='libACE_la-SOCK_CODgram.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_CODgram.lo `test -f 'SOCK_CODgram.cpp' || echo '$(srcdir)/'`SOCK_CODgram.cpp + +libACE_la-SOCK_Connector.lo: SOCK_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Connector.Tpo -c -o libACE_la-SOCK_Connector.lo `test -f 'SOCK_Connector.cpp' || echo '$(srcdir)/'`SOCK_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Connector.Tpo $(DEPDIR)/libACE_la-SOCK_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Connector.cpp' object='libACE_la-SOCK_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Connector.lo `test -f 'SOCK_Connector.cpp' || echo '$(srcdir)/'`SOCK_Connector.cpp + +libACE_la-SOCK_Dgram.lo: SOCK_Dgram.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Dgram.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Dgram.Tpo -c -o libACE_la-SOCK_Dgram.lo `test -f 'SOCK_Dgram.cpp' || echo '$(srcdir)/'`SOCK_Dgram.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Dgram.Tpo $(DEPDIR)/libACE_la-SOCK_Dgram.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Dgram.cpp' object='libACE_la-SOCK_Dgram.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Dgram.lo `test -f 'SOCK_Dgram.cpp' || echo '$(srcdir)/'`SOCK_Dgram.cpp + +libACE_la-SOCK_Dgram_Bcast.lo: SOCK_Dgram_Bcast.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Dgram_Bcast.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Dgram_Bcast.Tpo -c -o libACE_la-SOCK_Dgram_Bcast.lo `test -f 'SOCK_Dgram_Bcast.cpp' || echo '$(srcdir)/'`SOCK_Dgram_Bcast.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Dgram_Bcast.Tpo $(DEPDIR)/libACE_la-SOCK_Dgram_Bcast.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Dgram_Bcast.cpp' object='libACE_la-SOCK_Dgram_Bcast.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Dgram_Bcast.lo `test -f 'SOCK_Dgram_Bcast.cpp' || echo '$(srcdir)/'`SOCK_Dgram_Bcast.cpp + +libACE_la-SOCK_Dgram_Mcast.lo: SOCK_Dgram_Mcast.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Dgram_Mcast.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Dgram_Mcast.Tpo -c -o libACE_la-SOCK_Dgram_Mcast.lo `test -f 'SOCK_Dgram_Mcast.cpp' || echo '$(srcdir)/'`SOCK_Dgram_Mcast.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Dgram_Mcast.Tpo $(DEPDIR)/libACE_la-SOCK_Dgram_Mcast.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Dgram_Mcast.cpp' object='libACE_la-SOCK_Dgram_Mcast.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Dgram_Mcast.lo `test -f 'SOCK_Dgram_Mcast.cpp' || echo '$(srcdir)/'`SOCK_Dgram_Mcast.cpp + +libACE_la-SOCK_IO.lo: SOCK_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_IO.Tpo -c -o libACE_la-SOCK_IO.lo `test -f 'SOCK_IO.cpp' || echo '$(srcdir)/'`SOCK_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_IO.Tpo $(DEPDIR)/libACE_la-SOCK_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_IO.cpp' object='libACE_la-SOCK_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_IO.lo `test -f 'SOCK_IO.cpp' || echo '$(srcdir)/'`SOCK_IO.cpp + +libACE_la-SOCK_Netlink.lo: SOCK_Netlink.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Netlink.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Netlink.Tpo -c -o libACE_la-SOCK_Netlink.lo `test -f 'SOCK_Netlink.cpp' || echo '$(srcdir)/'`SOCK_Netlink.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Netlink.Tpo $(DEPDIR)/libACE_la-SOCK_Netlink.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Netlink.cpp' object='libACE_la-SOCK_Netlink.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Netlink.lo `test -f 'SOCK_Netlink.cpp' || echo '$(srcdir)/'`SOCK_Netlink.cpp + +libACE_la-SOCK_SEQPACK_Acceptor.lo: SOCK_SEQPACK_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_SEQPACK_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_SEQPACK_Acceptor.Tpo -c -o libACE_la-SOCK_SEQPACK_Acceptor.lo `test -f 'SOCK_SEQPACK_Acceptor.cpp' || echo '$(srcdir)/'`SOCK_SEQPACK_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_SEQPACK_Acceptor.Tpo $(DEPDIR)/libACE_la-SOCK_SEQPACK_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_SEQPACK_Acceptor.cpp' object='libACE_la-SOCK_SEQPACK_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_SEQPACK_Acceptor.lo `test -f 'SOCK_SEQPACK_Acceptor.cpp' || echo '$(srcdir)/'`SOCK_SEQPACK_Acceptor.cpp + +libACE_la-SOCK_SEQPACK_Association.lo: SOCK_SEQPACK_Association.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_SEQPACK_Association.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_SEQPACK_Association.Tpo -c -o libACE_la-SOCK_SEQPACK_Association.lo `test -f 'SOCK_SEQPACK_Association.cpp' || echo '$(srcdir)/'`SOCK_SEQPACK_Association.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_SEQPACK_Association.Tpo $(DEPDIR)/libACE_la-SOCK_SEQPACK_Association.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_SEQPACK_Association.cpp' object='libACE_la-SOCK_SEQPACK_Association.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_SEQPACK_Association.lo `test -f 'SOCK_SEQPACK_Association.cpp' || echo '$(srcdir)/'`SOCK_SEQPACK_Association.cpp + +libACE_la-SOCK_SEQPACK_Connector.lo: SOCK_SEQPACK_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_SEQPACK_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_SEQPACK_Connector.Tpo -c -o libACE_la-SOCK_SEQPACK_Connector.lo `test -f 'SOCK_SEQPACK_Connector.cpp' || echo '$(srcdir)/'`SOCK_SEQPACK_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_SEQPACK_Connector.Tpo $(DEPDIR)/libACE_la-SOCK_SEQPACK_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_SEQPACK_Connector.cpp' object='libACE_la-SOCK_SEQPACK_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_SEQPACK_Connector.lo `test -f 'SOCK_SEQPACK_Connector.cpp' || echo '$(srcdir)/'`SOCK_SEQPACK_Connector.cpp + +libACE_la-SOCK_Stream.lo: SOCK_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SOCK_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-SOCK_Stream.Tpo -c -o libACE_la-SOCK_Stream.lo `test -f 'SOCK_Stream.cpp' || echo '$(srcdir)/'`SOCK_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SOCK_Stream.Tpo $(DEPDIR)/libACE_la-SOCK_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SOCK_Stream.cpp' object='libACE_la-SOCK_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SOCK_Stream.lo `test -f 'SOCK_Stream.cpp' || echo '$(srcdir)/'`SOCK_Stream.cpp + +libACE_la-SPIPE.lo: SPIPE.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SPIPE.lo -MD -MP -MF $(DEPDIR)/libACE_la-SPIPE.Tpo -c -o libACE_la-SPIPE.lo `test -f 'SPIPE.cpp' || echo '$(srcdir)/'`SPIPE.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SPIPE.Tpo $(DEPDIR)/libACE_la-SPIPE.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SPIPE.cpp' object='libACE_la-SPIPE.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SPIPE.lo `test -f 'SPIPE.cpp' || echo '$(srcdir)/'`SPIPE.cpp + +libACE_la-SPIPE_Acceptor.lo: SPIPE_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SPIPE_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-SPIPE_Acceptor.Tpo -c -o libACE_la-SPIPE_Acceptor.lo `test -f 'SPIPE_Acceptor.cpp' || echo '$(srcdir)/'`SPIPE_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SPIPE_Acceptor.Tpo $(DEPDIR)/libACE_la-SPIPE_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SPIPE_Acceptor.cpp' object='libACE_la-SPIPE_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SPIPE_Acceptor.lo `test -f 'SPIPE_Acceptor.cpp' || echo '$(srcdir)/'`SPIPE_Acceptor.cpp + +libACE_la-SPIPE_Addr.lo: SPIPE_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SPIPE_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-SPIPE_Addr.Tpo -c -o libACE_la-SPIPE_Addr.lo `test -f 'SPIPE_Addr.cpp' || echo '$(srcdir)/'`SPIPE_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SPIPE_Addr.Tpo $(DEPDIR)/libACE_la-SPIPE_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SPIPE_Addr.cpp' object='libACE_la-SPIPE_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SPIPE_Addr.lo `test -f 'SPIPE_Addr.cpp' || echo '$(srcdir)/'`SPIPE_Addr.cpp + +libACE_la-SPIPE_Connector.lo: SPIPE_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SPIPE_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-SPIPE_Connector.Tpo -c -o libACE_la-SPIPE_Connector.lo `test -f 'SPIPE_Connector.cpp' || echo '$(srcdir)/'`SPIPE_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SPIPE_Connector.Tpo $(DEPDIR)/libACE_la-SPIPE_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SPIPE_Connector.cpp' object='libACE_la-SPIPE_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SPIPE_Connector.lo `test -f 'SPIPE_Connector.cpp' || echo '$(srcdir)/'`SPIPE_Connector.cpp + +libACE_la-SPIPE_Stream.lo: SPIPE_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SPIPE_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-SPIPE_Stream.Tpo -c -o libACE_la-SPIPE_Stream.lo `test -f 'SPIPE_Stream.cpp' || echo '$(srcdir)/'`SPIPE_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SPIPE_Stream.Tpo $(DEPDIR)/libACE_la-SPIPE_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SPIPE_Stream.cpp' object='libACE_la-SPIPE_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SPIPE_Stream.lo `test -f 'SPIPE_Stream.cpp' || echo '$(srcdir)/'`SPIPE_Stream.cpp + +libACE_la-SString.lo: SString.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SString.lo -MD -MP -MF $(DEPDIR)/libACE_la-SString.Tpo -c -o libACE_la-SString.lo `test -f 'SString.cpp' || echo '$(srcdir)/'`SString.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SString.Tpo $(DEPDIR)/libACE_la-SString.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SString.cpp' object='libACE_la-SString.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SString.lo `test -f 'SString.cpp' || echo '$(srcdir)/'`SString.cpp + +libACE_la-Stack_Trace.lo: Stack_Trace.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Stack_Trace.lo -MD -MP -MF $(DEPDIR)/libACE_la-Stack_Trace.Tpo -c -o libACE_la-Stack_Trace.lo `test -f 'Stack_Trace.cpp' || echo '$(srcdir)/'`Stack_Trace.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Stack_Trace.Tpo $(DEPDIR)/libACE_la-Stack_Trace.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Stack_Trace.cpp' object='libACE_la-Stack_Trace.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Stack_Trace.lo `test -f 'Stack_Trace.cpp' || echo '$(srcdir)/'`Stack_Trace.cpp + +libACE_la-SUN_Proactor.lo: SUN_Proactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SUN_Proactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-SUN_Proactor.Tpo -c -o libACE_la-SUN_Proactor.lo `test -f 'SUN_Proactor.cpp' || echo '$(srcdir)/'`SUN_Proactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SUN_Proactor.Tpo $(DEPDIR)/libACE_la-SUN_Proactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SUN_Proactor.cpp' object='libACE_la-SUN_Proactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SUN_Proactor.lo `test -f 'SUN_Proactor.cpp' || echo '$(srcdir)/'`SUN_Proactor.cpp + +libACE_la-SV_Message.lo: SV_Message.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SV_Message.lo -MD -MP -MF $(DEPDIR)/libACE_la-SV_Message.Tpo -c -o libACE_la-SV_Message.lo `test -f 'SV_Message.cpp' || echo '$(srcdir)/'`SV_Message.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SV_Message.Tpo $(DEPDIR)/libACE_la-SV_Message.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SV_Message.cpp' object='libACE_la-SV_Message.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SV_Message.lo `test -f 'SV_Message.cpp' || echo '$(srcdir)/'`SV_Message.cpp + +libACE_la-SV_Message_Queue.lo: SV_Message_Queue.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SV_Message_Queue.lo -MD -MP -MF $(DEPDIR)/libACE_la-SV_Message_Queue.Tpo -c -o libACE_la-SV_Message_Queue.lo `test -f 'SV_Message_Queue.cpp' || echo '$(srcdir)/'`SV_Message_Queue.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SV_Message_Queue.Tpo $(DEPDIR)/libACE_la-SV_Message_Queue.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SV_Message_Queue.cpp' object='libACE_la-SV_Message_Queue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SV_Message_Queue.lo `test -f 'SV_Message_Queue.cpp' || echo '$(srcdir)/'`SV_Message_Queue.cpp + +libACE_la-SV_Semaphore_Complex.lo: SV_Semaphore_Complex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SV_Semaphore_Complex.lo -MD -MP -MF $(DEPDIR)/libACE_la-SV_Semaphore_Complex.Tpo -c -o libACE_la-SV_Semaphore_Complex.lo `test -f 'SV_Semaphore_Complex.cpp' || echo '$(srcdir)/'`SV_Semaphore_Complex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SV_Semaphore_Complex.Tpo $(DEPDIR)/libACE_la-SV_Semaphore_Complex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SV_Semaphore_Complex.cpp' object='libACE_la-SV_Semaphore_Complex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SV_Semaphore_Complex.lo `test -f 'SV_Semaphore_Complex.cpp' || echo '$(srcdir)/'`SV_Semaphore_Complex.cpp + +libACE_la-SV_Semaphore_Simple.lo: SV_Semaphore_Simple.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SV_Semaphore_Simple.lo -MD -MP -MF $(DEPDIR)/libACE_la-SV_Semaphore_Simple.Tpo -c -o libACE_la-SV_Semaphore_Simple.lo `test -f 'SV_Semaphore_Simple.cpp' || echo '$(srcdir)/'`SV_Semaphore_Simple.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SV_Semaphore_Simple.Tpo $(DEPDIR)/libACE_la-SV_Semaphore_Simple.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SV_Semaphore_Simple.cpp' object='libACE_la-SV_Semaphore_Simple.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SV_Semaphore_Simple.lo `test -f 'SV_Semaphore_Simple.cpp' || echo '$(srcdir)/'`SV_Semaphore_Simple.cpp + +libACE_la-SV_Shared_Memory.lo: SV_Shared_Memory.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-SV_Shared_Memory.lo -MD -MP -MF $(DEPDIR)/libACE_la-SV_Shared_Memory.Tpo -c -o libACE_la-SV_Shared_Memory.lo `test -f 'SV_Shared_Memory.cpp' || echo '$(srcdir)/'`SV_Shared_Memory.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-SV_Shared_Memory.Tpo $(DEPDIR)/libACE_la-SV_Shared_Memory.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SV_Shared_Memory.cpp' object='libACE_la-SV_Shared_Memory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-SV_Shared_Memory.lo `test -f 'SV_Shared_Memory.cpp' || echo '$(srcdir)/'`SV_Shared_Memory.cpp + +libACE_la-Sample_History.lo: Sample_History.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Sample_History.lo -MD -MP -MF $(DEPDIR)/libACE_la-Sample_History.Tpo -c -o libACE_la-Sample_History.lo `test -f 'Sample_History.cpp' || echo '$(srcdir)/'`Sample_History.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Sample_History.Tpo $(DEPDIR)/libACE_la-Sample_History.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Sample_History.cpp' object='libACE_la-Sample_History.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Sample_History.lo `test -f 'Sample_History.cpp' || echo '$(srcdir)/'`Sample_History.cpp + +libACE_la-Sbrk_Memory_Pool.lo: Sbrk_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Sbrk_Memory_Pool.lo -MD -MP -MF $(DEPDIR)/libACE_la-Sbrk_Memory_Pool.Tpo -c -o libACE_la-Sbrk_Memory_Pool.lo `test -f 'Sbrk_Memory_Pool.cpp' || echo '$(srcdir)/'`Sbrk_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Sbrk_Memory_Pool.Tpo $(DEPDIR)/libACE_la-Sbrk_Memory_Pool.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Sbrk_Memory_Pool.cpp' object='libACE_la-Sbrk_Memory_Pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Sbrk_Memory_Pool.lo `test -f 'Sbrk_Memory_Pool.cpp' || echo '$(srcdir)/'`Sbrk_Memory_Pool.cpp + +libACE_la-Sched_Params.lo: Sched_Params.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Sched_Params.lo -MD -MP -MF $(DEPDIR)/libACE_la-Sched_Params.Tpo -c -o libACE_la-Sched_Params.lo `test -f 'Sched_Params.cpp' || echo '$(srcdir)/'`Sched_Params.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Sched_Params.Tpo $(DEPDIR)/libACE_la-Sched_Params.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Sched_Params.cpp' object='libACE_la-Sched_Params.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Sched_Params.lo `test -f 'Sched_Params.cpp' || echo '$(srcdir)/'`Sched_Params.cpp + +libACE_la-Select_Reactor_Base.lo: Select_Reactor_Base.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Select_Reactor_Base.lo -MD -MP -MF $(DEPDIR)/libACE_la-Select_Reactor_Base.Tpo -c -o libACE_la-Select_Reactor_Base.lo `test -f 'Select_Reactor_Base.cpp' || echo '$(srcdir)/'`Select_Reactor_Base.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Select_Reactor_Base.Tpo $(DEPDIR)/libACE_la-Select_Reactor_Base.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Select_Reactor_Base.cpp' object='libACE_la-Select_Reactor_Base.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Select_Reactor_Base.lo `test -f 'Select_Reactor_Base.cpp' || echo '$(srcdir)/'`Select_Reactor_Base.cpp + +libACE_la-Semaphore.lo: Semaphore.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Semaphore.lo -MD -MP -MF $(DEPDIR)/libACE_la-Semaphore.Tpo -c -o libACE_la-Semaphore.lo `test -f 'Semaphore.cpp' || echo '$(srcdir)/'`Semaphore.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Semaphore.Tpo $(DEPDIR)/libACE_la-Semaphore.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Semaphore.cpp' object='libACE_la-Semaphore.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Semaphore.lo `test -f 'Semaphore.cpp' || echo '$(srcdir)/'`Semaphore.cpp + +libACE_la-Service_Config.lo: Service_Config.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Service_Config.lo -MD -MP -MF $(DEPDIR)/libACE_la-Service_Config.Tpo -c -o libACE_la-Service_Config.lo `test -f 'Service_Config.cpp' || echo '$(srcdir)/'`Service_Config.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Service_Config.Tpo $(DEPDIR)/libACE_la-Service_Config.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Service_Config.cpp' object='libACE_la-Service_Config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Service_Config.lo `test -f 'Service_Config.cpp' || echo '$(srcdir)/'`Service_Config.cpp + +libACE_la-Service_Gestalt.lo: Service_Gestalt.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Service_Gestalt.lo -MD -MP -MF $(DEPDIR)/libACE_la-Service_Gestalt.Tpo -c -o libACE_la-Service_Gestalt.lo `test -f 'Service_Gestalt.cpp' || echo '$(srcdir)/'`Service_Gestalt.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Service_Gestalt.Tpo $(DEPDIR)/libACE_la-Service_Gestalt.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Service_Gestalt.cpp' object='libACE_la-Service_Gestalt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Service_Gestalt.lo `test -f 'Service_Gestalt.cpp' || echo '$(srcdir)/'`Service_Gestalt.cpp + +libACE_la-Service_Manager.lo: Service_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Service_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Service_Manager.Tpo -c -o libACE_la-Service_Manager.lo `test -f 'Service_Manager.cpp' || echo '$(srcdir)/'`Service_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Service_Manager.Tpo $(DEPDIR)/libACE_la-Service_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Service_Manager.cpp' object='libACE_la-Service_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Service_Manager.lo `test -f 'Service_Manager.cpp' || echo '$(srcdir)/'`Service_Manager.cpp + +libACE_la-Service_Object.lo: Service_Object.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Service_Object.lo -MD -MP -MF $(DEPDIR)/libACE_la-Service_Object.Tpo -c -o libACE_la-Service_Object.lo `test -f 'Service_Object.cpp' || echo '$(srcdir)/'`Service_Object.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Service_Object.Tpo $(DEPDIR)/libACE_la-Service_Object.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Service_Object.cpp' object='libACE_la-Service_Object.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Service_Object.lo `test -f 'Service_Object.cpp' || echo '$(srcdir)/'`Service_Object.cpp + +libACE_la-Service_Repository.lo: Service_Repository.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Service_Repository.lo -MD -MP -MF $(DEPDIR)/libACE_la-Service_Repository.Tpo -c -o libACE_la-Service_Repository.lo `test -f 'Service_Repository.cpp' || echo '$(srcdir)/'`Service_Repository.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Service_Repository.Tpo $(DEPDIR)/libACE_la-Service_Repository.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Service_Repository.cpp' object='libACE_la-Service_Repository.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Service_Repository.lo `test -f 'Service_Repository.cpp' || echo '$(srcdir)/'`Service_Repository.cpp + +libACE_la-Service_Types.lo: Service_Types.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Service_Types.lo -MD -MP -MF $(DEPDIR)/libACE_la-Service_Types.Tpo -c -o libACE_la-Service_Types.lo `test -f 'Service_Types.cpp' || echo '$(srcdir)/'`Service_Types.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Service_Types.Tpo $(DEPDIR)/libACE_la-Service_Types.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Service_Types.cpp' object='libACE_la-Service_Types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Service_Types.lo `test -f 'Service_Types.cpp' || echo '$(srcdir)/'`Service_Types.cpp + +libACE_la-Shared_Memory.lo: Shared_Memory.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Shared_Memory.lo -MD -MP -MF $(DEPDIR)/libACE_la-Shared_Memory.Tpo -c -o libACE_la-Shared_Memory.lo `test -f 'Shared_Memory.cpp' || echo '$(srcdir)/'`Shared_Memory.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Shared_Memory.Tpo $(DEPDIR)/libACE_la-Shared_Memory.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Shared_Memory.cpp' object='libACE_la-Shared_Memory.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Shared_Memory.lo `test -f 'Shared_Memory.cpp' || echo '$(srcdir)/'`Shared_Memory.cpp + +libACE_la-Shared_Memory_MM.lo: Shared_Memory_MM.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Shared_Memory_MM.lo -MD -MP -MF $(DEPDIR)/libACE_la-Shared_Memory_MM.Tpo -c -o libACE_la-Shared_Memory_MM.lo `test -f 'Shared_Memory_MM.cpp' || echo '$(srcdir)/'`Shared_Memory_MM.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Shared_Memory_MM.Tpo $(DEPDIR)/libACE_la-Shared_Memory_MM.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Shared_Memory_MM.cpp' object='libACE_la-Shared_Memory_MM.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Shared_Memory_MM.lo `test -f 'Shared_Memory_MM.cpp' || echo '$(srcdir)/'`Shared_Memory_MM.cpp + +libACE_la-Shared_Memory_Pool.lo: Shared_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Shared_Memory_Pool.lo -MD -MP -MF $(DEPDIR)/libACE_la-Shared_Memory_Pool.Tpo -c -o libACE_la-Shared_Memory_Pool.lo `test -f 'Shared_Memory_Pool.cpp' || echo '$(srcdir)/'`Shared_Memory_Pool.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Shared_Memory_Pool.Tpo $(DEPDIR)/libACE_la-Shared_Memory_Pool.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Shared_Memory_Pool.cpp' object='libACE_la-Shared_Memory_Pool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Shared_Memory_Pool.lo `test -f 'Shared_Memory_Pool.cpp' || echo '$(srcdir)/'`Shared_Memory_Pool.cpp + +libACE_la-Shared_Memory_SV.lo: Shared_Memory_SV.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Shared_Memory_SV.lo -MD -MP -MF $(DEPDIR)/libACE_la-Shared_Memory_SV.Tpo -c -o libACE_la-Shared_Memory_SV.lo `test -f 'Shared_Memory_SV.cpp' || echo '$(srcdir)/'`Shared_Memory_SV.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Shared_Memory_SV.Tpo $(DEPDIR)/libACE_la-Shared_Memory_SV.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Shared_Memory_SV.cpp' object='libACE_la-Shared_Memory_SV.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Shared_Memory_SV.lo `test -f 'Shared_Memory_SV.cpp' || echo '$(srcdir)/'`Shared_Memory_SV.cpp + +libACE_la-Shared_Object.lo: Shared_Object.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Shared_Object.lo -MD -MP -MF $(DEPDIR)/libACE_la-Shared_Object.Tpo -c -o libACE_la-Shared_Object.lo `test -f 'Shared_Object.cpp' || echo '$(srcdir)/'`Shared_Object.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Shared_Object.Tpo $(DEPDIR)/libACE_la-Shared_Object.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Shared_Object.cpp' object='libACE_la-Shared_Object.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Shared_Object.lo `test -f 'Shared_Object.cpp' || echo '$(srcdir)/'`Shared_Object.cpp + +libACE_la-Sig_Adapter.lo: Sig_Adapter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Sig_Adapter.lo -MD -MP -MF $(DEPDIR)/libACE_la-Sig_Adapter.Tpo -c -o libACE_la-Sig_Adapter.lo `test -f 'Sig_Adapter.cpp' || echo '$(srcdir)/'`Sig_Adapter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Sig_Adapter.Tpo $(DEPDIR)/libACE_la-Sig_Adapter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Sig_Adapter.cpp' object='libACE_la-Sig_Adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Sig_Adapter.lo `test -f 'Sig_Adapter.cpp' || echo '$(srcdir)/'`Sig_Adapter.cpp + +libACE_la-Sig_Handler.lo: Sig_Handler.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Sig_Handler.lo -MD -MP -MF $(DEPDIR)/libACE_la-Sig_Handler.Tpo -c -o libACE_la-Sig_Handler.lo `test -f 'Sig_Handler.cpp' || echo '$(srcdir)/'`Sig_Handler.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Sig_Handler.Tpo $(DEPDIR)/libACE_la-Sig_Handler.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Sig_Handler.cpp' object='libACE_la-Sig_Handler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Sig_Handler.lo `test -f 'Sig_Handler.cpp' || echo '$(srcdir)/'`Sig_Handler.cpp + +libACE_la-Signal.lo: Signal.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Signal.lo -MD -MP -MF $(DEPDIR)/libACE_la-Signal.Tpo -c -o libACE_la-Signal.lo `test -f 'Signal.cpp' || echo '$(srcdir)/'`Signal.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Signal.Tpo $(DEPDIR)/libACE_la-Signal.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Signal.cpp' object='libACE_la-Signal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Signal.lo `test -f 'Signal.cpp' || echo '$(srcdir)/'`Signal.cpp + +libACE_la-Sock_Connect.lo: Sock_Connect.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Sock_Connect.lo -MD -MP -MF $(DEPDIR)/libACE_la-Sock_Connect.Tpo -c -o libACE_la-Sock_Connect.lo `test -f 'Sock_Connect.cpp' || echo '$(srcdir)/'`Sock_Connect.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Sock_Connect.Tpo $(DEPDIR)/libACE_la-Sock_Connect.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Sock_Connect.cpp' object='libACE_la-Sock_Connect.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Sock_Connect.lo `test -f 'Sock_Connect.cpp' || echo '$(srcdir)/'`Sock_Connect.cpp + +libACE_la-Stats.lo: Stats.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Stats.lo -MD -MP -MF $(DEPDIR)/libACE_la-Stats.Tpo -c -o libACE_la-Stats.lo `test -f 'Stats.cpp' || echo '$(srcdir)/'`Stats.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Stats.Tpo $(DEPDIR)/libACE_la-Stats.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Stats.cpp' object='libACE_la-Stats.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Stats.lo `test -f 'Stats.cpp' || echo '$(srcdir)/'`Stats.cpp + +libACE_la-String_Base_Const.lo: String_Base_Const.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-String_Base_Const.lo -MD -MP -MF $(DEPDIR)/libACE_la-String_Base_Const.Tpo -c -o libACE_la-String_Base_Const.lo `test -f 'String_Base_Const.cpp' || echo '$(srcdir)/'`String_Base_Const.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-String_Base_Const.Tpo $(DEPDIR)/libACE_la-String_Base_Const.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='String_Base_Const.cpp' object='libACE_la-String_Base_Const.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-String_Base_Const.lo `test -f 'String_Base_Const.cpp' || echo '$(srcdir)/'`String_Base_Const.cpp + +libACE_la-Svc_Conf_Lexer.lo: Svc_Conf_Lexer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Svc_Conf_Lexer.lo -MD -MP -MF $(DEPDIR)/libACE_la-Svc_Conf_Lexer.Tpo -c -o libACE_la-Svc_Conf_Lexer.lo `test -f 'Svc_Conf_Lexer.cpp' || echo '$(srcdir)/'`Svc_Conf_Lexer.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Svc_Conf_Lexer.Tpo $(DEPDIR)/libACE_la-Svc_Conf_Lexer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Svc_Conf_Lexer.cpp' object='libACE_la-Svc_Conf_Lexer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Svc_Conf_Lexer.lo `test -f 'Svc_Conf_Lexer.cpp' || echo '$(srcdir)/'`Svc_Conf_Lexer.cpp + +libACE_la-Svc_Conf_y.lo: Svc_Conf_y.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Svc_Conf_y.lo -MD -MP -MF $(DEPDIR)/libACE_la-Svc_Conf_y.Tpo -c -o libACE_la-Svc_Conf_y.lo `test -f 'Svc_Conf_y.cpp' || echo '$(srcdir)/'`Svc_Conf_y.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Svc_Conf_y.Tpo $(DEPDIR)/libACE_la-Svc_Conf_y.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Svc_Conf_y.cpp' object='libACE_la-Svc_Conf_y.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Svc_Conf_y.lo `test -f 'Svc_Conf_y.cpp' || echo '$(srcdir)/'`Svc_Conf_y.cpp + +libACE_la-Synch_Options.lo: Synch_Options.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Synch_Options.lo -MD -MP -MF $(DEPDIR)/libACE_la-Synch_Options.Tpo -c -o libACE_la-Synch_Options.lo `test -f 'Synch_Options.cpp' || echo '$(srcdir)/'`Synch_Options.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Synch_Options.Tpo $(DEPDIR)/libACE_la-Synch_Options.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Synch_Options.cpp' object='libACE_la-Synch_Options.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Synch_Options.lo `test -f 'Synch_Options.cpp' || echo '$(srcdir)/'`Synch_Options.cpp + +libACE_la-System_Time.lo: System_Time.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-System_Time.lo -MD -MP -MF $(DEPDIR)/libACE_la-System_Time.Tpo -c -o libACE_la-System_Time.lo `test -f 'System_Time.cpp' || echo '$(srcdir)/'`System_Time.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-System_Time.Tpo $(DEPDIR)/libACE_la-System_Time.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='System_Time.cpp' object='libACE_la-System_Time.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-System_Time.lo `test -f 'System_Time.cpp' || echo '$(srcdir)/'`System_Time.cpp + +libACE_la-TLI.lo: TLI.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TLI.lo -MD -MP -MF $(DEPDIR)/libACE_la-TLI.Tpo -c -o libACE_la-TLI.lo `test -f 'TLI.cpp' || echo '$(srcdir)/'`TLI.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TLI.Tpo $(DEPDIR)/libACE_la-TLI.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TLI.cpp' object='libACE_la-TLI.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TLI.lo `test -f 'TLI.cpp' || echo '$(srcdir)/'`TLI.cpp + +libACE_la-TLI_Acceptor.lo: TLI_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TLI_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-TLI_Acceptor.Tpo -c -o libACE_la-TLI_Acceptor.lo `test -f 'TLI_Acceptor.cpp' || echo '$(srcdir)/'`TLI_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TLI_Acceptor.Tpo $(DEPDIR)/libACE_la-TLI_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TLI_Acceptor.cpp' object='libACE_la-TLI_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TLI_Acceptor.lo `test -f 'TLI_Acceptor.cpp' || echo '$(srcdir)/'`TLI_Acceptor.cpp + +libACE_la-TLI_Connector.lo: TLI_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TLI_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-TLI_Connector.Tpo -c -o libACE_la-TLI_Connector.lo `test -f 'TLI_Connector.cpp' || echo '$(srcdir)/'`TLI_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TLI_Connector.Tpo $(DEPDIR)/libACE_la-TLI_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TLI_Connector.cpp' object='libACE_la-TLI_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TLI_Connector.lo `test -f 'TLI_Connector.cpp' || echo '$(srcdir)/'`TLI_Connector.cpp + +libACE_la-TLI_Stream.lo: TLI_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TLI_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-TLI_Stream.Tpo -c -o libACE_la-TLI_Stream.lo `test -f 'TLI_Stream.cpp' || echo '$(srcdir)/'`TLI_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TLI_Stream.Tpo $(DEPDIR)/libACE_la-TLI_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TLI_Stream.cpp' object='libACE_la-TLI_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TLI_Stream.lo `test -f 'TLI_Stream.cpp' || echo '$(srcdir)/'`TLI_Stream.cpp + +libACE_la-TP_Reactor.lo: TP_Reactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TP_Reactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-TP_Reactor.Tpo -c -o libACE_la-TP_Reactor.lo `test -f 'TP_Reactor.cpp' || echo '$(srcdir)/'`TP_Reactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TP_Reactor.Tpo $(DEPDIR)/libACE_la-TP_Reactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TP_Reactor.cpp' object='libACE_la-TP_Reactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TP_Reactor.lo `test -f 'TP_Reactor.cpp' || echo '$(srcdir)/'`TP_Reactor.cpp + +libACE_la-TSS_Adapter.lo: TSS_Adapter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TSS_Adapter.lo -MD -MP -MF $(DEPDIR)/libACE_la-TSS_Adapter.Tpo -c -o libACE_la-TSS_Adapter.lo `test -f 'TSS_Adapter.cpp' || echo '$(srcdir)/'`TSS_Adapter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TSS_Adapter.Tpo $(DEPDIR)/libACE_la-TSS_Adapter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TSS_Adapter.cpp' object='libACE_la-TSS_Adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TSS_Adapter.lo `test -f 'TSS_Adapter.cpp' || echo '$(srcdir)/'`TSS_Adapter.cpp + +libACE_la-TTY_IO.lo: TTY_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-TTY_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-TTY_IO.Tpo -c -o libACE_la-TTY_IO.lo `test -f 'TTY_IO.cpp' || echo '$(srcdir)/'`TTY_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-TTY_IO.Tpo $(DEPDIR)/libACE_la-TTY_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TTY_IO.cpp' object='libACE_la-TTY_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-TTY_IO.lo `test -f 'TTY_IO.cpp' || echo '$(srcdir)/'`TTY_IO.cpp + +libACE_la-Task.lo: Task.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Task.lo -MD -MP -MF $(DEPDIR)/libACE_la-Task.Tpo -c -o libACE_la-Task.lo `test -f 'Task.cpp' || echo '$(srcdir)/'`Task.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Task.Tpo $(DEPDIR)/libACE_la-Task.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Task.cpp' object='libACE_la-Task.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Task.lo `test -f 'Task.cpp' || echo '$(srcdir)/'`Task.cpp + +libACE_la-Thread.lo: Thread.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread.Tpo -c -o libACE_la-Thread.lo `test -f 'Thread.cpp' || echo '$(srcdir)/'`Thread.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread.Tpo $(DEPDIR)/libACE_la-Thread.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread.cpp' object='libACE_la-Thread.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread.lo `test -f 'Thread.cpp' || echo '$(srcdir)/'`Thread.cpp + +libACE_la-Thread_Adapter.lo: Thread_Adapter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Adapter.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Adapter.Tpo -c -o libACE_la-Thread_Adapter.lo `test -f 'Thread_Adapter.cpp' || echo '$(srcdir)/'`Thread_Adapter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Adapter.Tpo $(DEPDIR)/libACE_la-Thread_Adapter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Adapter.cpp' object='libACE_la-Thread_Adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Adapter.lo `test -f 'Thread_Adapter.cpp' || echo '$(srcdir)/'`Thread_Adapter.cpp + +libACE_la-Thread_Control.lo: Thread_Control.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Control.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Control.Tpo -c -o libACE_la-Thread_Control.lo `test -f 'Thread_Control.cpp' || echo '$(srcdir)/'`Thread_Control.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Control.Tpo $(DEPDIR)/libACE_la-Thread_Control.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Control.cpp' object='libACE_la-Thread_Control.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Control.lo `test -f 'Thread_Control.cpp' || echo '$(srcdir)/'`Thread_Control.cpp + +libACE_la-Thread_Exit.lo: Thread_Exit.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Exit.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Exit.Tpo -c -o libACE_la-Thread_Exit.lo `test -f 'Thread_Exit.cpp' || echo '$(srcdir)/'`Thread_Exit.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Exit.Tpo $(DEPDIR)/libACE_la-Thread_Exit.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Exit.cpp' object='libACE_la-Thread_Exit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Exit.lo `test -f 'Thread_Exit.cpp' || echo '$(srcdir)/'`Thread_Exit.cpp + +libACE_la-Thread_Hook.lo: Thread_Hook.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Hook.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Hook.Tpo -c -o libACE_la-Thread_Hook.lo `test -f 'Thread_Hook.cpp' || echo '$(srcdir)/'`Thread_Hook.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Hook.Tpo $(DEPDIR)/libACE_la-Thread_Hook.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Hook.cpp' object='libACE_la-Thread_Hook.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Hook.lo `test -f 'Thread_Hook.cpp' || echo '$(srcdir)/'`Thread_Hook.cpp + +libACE_la-Thread_Manager.lo: Thread_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Manager.Tpo -c -o libACE_la-Thread_Manager.lo `test -f 'Thread_Manager.cpp' || echo '$(srcdir)/'`Thread_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Manager.Tpo $(DEPDIR)/libACE_la-Thread_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Manager.cpp' object='libACE_la-Thread_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Manager.lo `test -f 'Thread_Manager.cpp' || echo '$(srcdir)/'`Thread_Manager.cpp + +libACE_la-Thread_Mutex.lo: Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Mutex.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Mutex.Tpo -c -o libACE_la-Thread_Mutex.lo `test -f 'Thread_Mutex.cpp' || echo '$(srcdir)/'`Thread_Mutex.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Mutex.Tpo $(DEPDIR)/libACE_la-Thread_Mutex.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Mutex.cpp' object='libACE_la-Thread_Mutex.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Mutex.lo `test -f 'Thread_Mutex.cpp' || echo '$(srcdir)/'`Thread_Mutex.cpp + +libACE_la-Thread_Semaphore.lo: Thread_Semaphore.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Thread_Semaphore.lo -MD -MP -MF $(DEPDIR)/libACE_la-Thread_Semaphore.Tpo -c -o libACE_la-Thread_Semaphore.lo `test -f 'Thread_Semaphore.cpp' || echo '$(srcdir)/'`Thread_Semaphore.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Thread_Semaphore.Tpo $(DEPDIR)/libACE_la-Thread_Semaphore.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Thread_Semaphore.cpp' object='libACE_la-Thread_Semaphore.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Thread_Semaphore.lo `test -f 'Thread_Semaphore.cpp' || echo '$(srcdir)/'`Thread_Semaphore.cpp + +libACE_la-Throughput_Stats.lo: Throughput_Stats.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Throughput_Stats.lo -MD -MP -MF $(DEPDIR)/libACE_la-Throughput_Stats.Tpo -c -o libACE_la-Throughput_Stats.lo `test -f 'Throughput_Stats.cpp' || echo '$(srcdir)/'`Throughput_Stats.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Throughput_Stats.Tpo $(DEPDIR)/libACE_la-Throughput_Stats.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Throughput_Stats.cpp' object='libACE_la-Throughput_Stats.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Throughput_Stats.lo `test -f 'Throughput_Stats.cpp' || echo '$(srcdir)/'`Throughput_Stats.cpp + +libACE_la-Time_Value.lo: Time_Value.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Time_Value.lo -MD -MP -MF $(DEPDIR)/libACE_la-Time_Value.Tpo -c -o libACE_la-Time_Value.lo `test -f 'Time_Value.cpp' || echo '$(srcdir)/'`Time_Value.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Time_Value.Tpo $(DEPDIR)/libACE_la-Time_Value.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Time_Value.cpp' object='libACE_la-Time_Value.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Time_Value.lo `test -f 'Time_Value.cpp' || echo '$(srcdir)/'`Time_Value.cpp + +libACE_la-Timeprobe.lo: Timeprobe.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Timeprobe.lo -MD -MP -MF $(DEPDIR)/libACE_la-Timeprobe.Tpo -c -o libACE_la-Timeprobe.lo `test -f 'Timeprobe.cpp' || echo '$(srcdir)/'`Timeprobe.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Timeprobe.Tpo $(DEPDIR)/libACE_la-Timeprobe.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Timeprobe.cpp' object='libACE_la-Timeprobe.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Timeprobe.lo `test -f 'Timeprobe.cpp' || echo '$(srcdir)/'`Timeprobe.cpp + +libACE_la-Token.lo: Token.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Token.lo -MD -MP -MF $(DEPDIR)/libACE_la-Token.Tpo -c -o libACE_la-Token.lo `test -f 'Token.cpp' || echo '$(srcdir)/'`Token.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Token.Tpo $(DEPDIR)/libACE_la-Token.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Token.cpp' object='libACE_la-Token.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Token.lo `test -f 'Token.cpp' || echo '$(srcdir)/'`Token.cpp + +libACE_la-Token_Collection.lo: Token_Collection.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Token_Collection.lo -MD -MP -MF $(DEPDIR)/libACE_la-Token_Collection.Tpo -c -o libACE_la-Token_Collection.lo `test -f 'Token_Collection.cpp' || echo '$(srcdir)/'`Token_Collection.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Token_Collection.Tpo $(DEPDIR)/libACE_la-Token_Collection.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Token_Collection.cpp' object='libACE_la-Token_Collection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Token_Collection.lo `test -f 'Token_Collection.cpp' || echo '$(srcdir)/'`Token_Collection.cpp + +libACE_la-Token_Invariants.lo: Token_Invariants.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Token_Invariants.lo -MD -MP -MF $(DEPDIR)/libACE_la-Token_Invariants.Tpo -c -o libACE_la-Token_Invariants.lo `test -f 'Token_Invariants.cpp' || echo '$(srcdir)/'`Token_Invariants.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Token_Invariants.Tpo $(DEPDIR)/libACE_la-Token_Invariants.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Token_Invariants.cpp' object='libACE_la-Token_Invariants.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Token_Invariants.lo `test -f 'Token_Invariants.cpp' || echo '$(srcdir)/'`Token_Invariants.cpp + +libACE_la-Token_Manager.lo: Token_Manager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Token_Manager.lo -MD -MP -MF $(DEPDIR)/libACE_la-Token_Manager.Tpo -c -o libACE_la-Token_Manager.lo `test -f 'Token_Manager.cpp' || echo '$(srcdir)/'`Token_Manager.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Token_Manager.Tpo $(DEPDIR)/libACE_la-Token_Manager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Token_Manager.cpp' object='libACE_la-Token_Manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Token_Manager.lo `test -f 'Token_Manager.cpp' || echo '$(srcdir)/'`Token_Manager.cpp + +libACE_la-Token_Request_Reply.lo: Token_Request_Reply.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Token_Request_Reply.lo -MD -MP -MF $(DEPDIR)/libACE_la-Token_Request_Reply.Tpo -c -o libACE_la-Token_Request_Reply.lo `test -f 'Token_Request_Reply.cpp' || echo '$(srcdir)/'`Token_Request_Reply.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Token_Request_Reply.Tpo $(DEPDIR)/libACE_la-Token_Request_Reply.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Token_Request_Reply.cpp' object='libACE_la-Token_Request_Reply.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Token_Request_Reply.lo `test -f 'Token_Request_Reply.cpp' || echo '$(srcdir)/'`Token_Request_Reply.cpp + +libACE_la-Trace.lo: Trace.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-Trace.lo -MD -MP -MF $(DEPDIR)/libACE_la-Trace.Tpo -c -o libACE_la-Trace.lo `test -f 'Trace.cpp' || echo '$(srcdir)/'`Trace.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-Trace.Tpo $(DEPDIR)/libACE_la-Trace.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Trace.cpp' object='libACE_la-Trace.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-Trace.lo `test -f 'Trace.cpp' || echo '$(srcdir)/'`Trace.cpp + +libACE_la-UNIX_Addr.lo: UNIX_Addr.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UNIX_Addr.lo -MD -MP -MF $(DEPDIR)/libACE_la-UNIX_Addr.Tpo -c -o libACE_la-UNIX_Addr.lo `test -f 'UNIX_Addr.cpp' || echo '$(srcdir)/'`UNIX_Addr.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UNIX_Addr.Tpo $(DEPDIR)/libACE_la-UNIX_Addr.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UNIX_Addr.cpp' object='libACE_la-UNIX_Addr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UNIX_Addr.lo `test -f 'UNIX_Addr.cpp' || echo '$(srcdir)/'`UNIX_Addr.cpp + +libACE_la-UPIPE_Acceptor.lo: UPIPE_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UPIPE_Acceptor.lo -MD -MP -MF $(DEPDIR)/libACE_la-UPIPE_Acceptor.Tpo -c -o libACE_la-UPIPE_Acceptor.lo `test -f 'UPIPE_Acceptor.cpp' || echo '$(srcdir)/'`UPIPE_Acceptor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UPIPE_Acceptor.Tpo $(DEPDIR)/libACE_la-UPIPE_Acceptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UPIPE_Acceptor.cpp' object='libACE_la-UPIPE_Acceptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UPIPE_Acceptor.lo `test -f 'UPIPE_Acceptor.cpp' || echo '$(srcdir)/'`UPIPE_Acceptor.cpp + +libACE_la-UPIPE_Connector.lo: UPIPE_Connector.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UPIPE_Connector.lo -MD -MP -MF $(DEPDIR)/libACE_la-UPIPE_Connector.Tpo -c -o libACE_la-UPIPE_Connector.lo `test -f 'UPIPE_Connector.cpp' || echo '$(srcdir)/'`UPIPE_Connector.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UPIPE_Connector.Tpo $(DEPDIR)/libACE_la-UPIPE_Connector.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UPIPE_Connector.cpp' object='libACE_la-UPIPE_Connector.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UPIPE_Connector.lo `test -f 'UPIPE_Connector.cpp' || echo '$(srcdir)/'`UPIPE_Connector.cpp + +libACE_la-UPIPE_Stream.lo: UPIPE_Stream.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UPIPE_Stream.lo -MD -MP -MF $(DEPDIR)/libACE_la-UPIPE_Stream.Tpo -c -o libACE_la-UPIPE_Stream.lo `test -f 'UPIPE_Stream.cpp' || echo '$(srcdir)/'`UPIPE_Stream.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UPIPE_Stream.Tpo $(DEPDIR)/libACE_la-UPIPE_Stream.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UPIPE_Stream.cpp' object='libACE_la-UPIPE_Stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UPIPE_Stream.lo `test -f 'UPIPE_Stream.cpp' || echo '$(srcdir)/'`UPIPE_Stream.cpp + +libACE_la-UTF16_Encoding_Converter.lo: UTF16_Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UTF16_Encoding_Converter.lo -MD -MP -MF $(DEPDIR)/libACE_la-UTF16_Encoding_Converter.Tpo -c -o libACE_la-UTF16_Encoding_Converter.lo `test -f 'UTF16_Encoding_Converter.cpp' || echo '$(srcdir)/'`UTF16_Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UTF16_Encoding_Converter.Tpo $(DEPDIR)/libACE_la-UTF16_Encoding_Converter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UTF16_Encoding_Converter.cpp' object='libACE_la-UTF16_Encoding_Converter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UTF16_Encoding_Converter.lo `test -f 'UTF16_Encoding_Converter.cpp' || echo '$(srcdir)/'`UTF16_Encoding_Converter.cpp + +libACE_la-UTF32_Encoding_Converter.lo: UTF32_Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UTF32_Encoding_Converter.lo -MD -MP -MF $(DEPDIR)/libACE_la-UTF32_Encoding_Converter.Tpo -c -o libACE_la-UTF32_Encoding_Converter.lo `test -f 'UTF32_Encoding_Converter.cpp' || echo '$(srcdir)/'`UTF32_Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UTF32_Encoding_Converter.Tpo $(DEPDIR)/libACE_la-UTF32_Encoding_Converter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UTF32_Encoding_Converter.cpp' object='libACE_la-UTF32_Encoding_Converter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UTF32_Encoding_Converter.lo `test -f 'UTF32_Encoding_Converter.cpp' || echo '$(srcdir)/'`UTF32_Encoding_Converter.cpp + +libACE_la-UTF8_Encoding_Converter.lo: UTF8_Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UTF8_Encoding_Converter.lo -MD -MP -MF $(DEPDIR)/libACE_la-UTF8_Encoding_Converter.Tpo -c -o libACE_la-UTF8_Encoding_Converter.lo `test -f 'UTF8_Encoding_Converter.cpp' || echo '$(srcdir)/'`UTF8_Encoding_Converter.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UTF8_Encoding_Converter.Tpo $(DEPDIR)/libACE_la-UTF8_Encoding_Converter.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UTF8_Encoding_Converter.cpp' object='libACE_la-UTF8_Encoding_Converter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UTF8_Encoding_Converter.lo `test -f 'UTF8_Encoding_Converter.cpp' || echo '$(srcdir)/'`UTF8_Encoding_Converter.cpp + +libACE_la-UUID.lo: UUID.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-UUID.lo -MD -MP -MF $(DEPDIR)/libACE_la-UUID.Tpo -c -o libACE_la-UUID.lo `test -f 'UUID.cpp' || echo '$(srcdir)/'`UUID.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-UUID.Tpo $(DEPDIR)/libACE_la-UUID.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UUID.cpp' object='libACE_la-UUID.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-UUID.lo `test -f 'UUID.cpp' || echo '$(srcdir)/'`UUID.cpp + +libACE_la-WFMO_Reactor.lo: WFMO_Reactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-WFMO_Reactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-WFMO_Reactor.Tpo -c -o libACE_la-WFMO_Reactor.lo `test -f 'WFMO_Reactor.cpp' || echo '$(srcdir)/'`WFMO_Reactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-WFMO_Reactor.Tpo $(DEPDIR)/libACE_la-WFMO_Reactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='WFMO_Reactor.cpp' object='libACE_la-WFMO_Reactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-WFMO_Reactor.lo `test -f 'WFMO_Reactor.cpp' || echo '$(srcdir)/'`WFMO_Reactor.cpp + +libACE_la-WIN32_Asynch_IO.lo: WIN32_Asynch_IO.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-WIN32_Asynch_IO.lo -MD -MP -MF $(DEPDIR)/libACE_la-WIN32_Asynch_IO.Tpo -c -o libACE_la-WIN32_Asynch_IO.lo `test -f 'WIN32_Asynch_IO.cpp' || echo '$(srcdir)/'`WIN32_Asynch_IO.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-WIN32_Asynch_IO.Tpo $(DEPDIR)/libACE_la-WIN32_Asynch_IO.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='WIN32_Asynch_IO.cpp' object='libACE_la-WIN32_Asynch_IO.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-WIN32_Asynch_IO.lo `test -f 'WIN32_Asynch_IO.cpp' || echo '$(srcdir)/'`WIN32_Asynch_IO.cpp + +libACE_la-WIN32_Proactor.lo: WIN32_Proactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-WIN32_Proactor.lo -MD -MP -MF $(DEPDIR)/libACE_la-WIN32_Proactor.Tpo -c -o libACE_la-WIN32_Proactor.lo `test -f 'WIN32_Proactor.cpp' || echo '$(srcdir)/'`WIN32_Proactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-WIN32_Proactor.Tpo $(DEPDIR)/libACE_la-WIN32_Proactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='WIN32_Proactor.cpp' object='libACE_la-WIN32_Proactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-WIN32_Proactor.lo `test -f 'WIN32_Proactor.cpp' || echo '$(srcdir)/'`WIN32_Proactor.cpp + +libACE_la-XML_Svc_Conf.lo: XML_Svc_Conf.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-XML_Svc_Conf.lo -MD -MP -MF $(DEPDIR)/libACE_la-XML_Svc_Conf.Tpo -c -o libACE_la-XML_Svc_Conf.lo `test -f 'XML_Svc_Conf.cpp' || echo '$(srcdir)/'`XML_Svc_Conf.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-XML_Svc_Conf.Tpo $(DEPDIR)/libACE_la-XML_Svc_Conf.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='XML_Svc_Conf.cpp' object='libACE_la-XML_Svc_Conf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-XML_Svc_Conf.lo `test -f 'XML_Svc_Conf.cpp' || echo '$(srcdir)/'`XML_Svc_Conf.cpp + +libACE_la-XTI_ATM_Mcast.lo: XTI_ATM_Mcast.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-XTI_ATM_Mcast.lo -MD -MP -MF $(DEPDIR)/libACE_la-XTI_ATM_Mcast.Tpo -c -o libACE_la-XTI_ATM_Mcast.lo `test -f 'XTI_ATM_Mcast.cpp' || echo '$(srcdir)/'`XTI_ATM_Mcast.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-XTI_ATM_Mcast.Tpo $(DEPDIR)/libACE_la-XTI_ATM_Mcast.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='XTI_ATM_Mcast.cpp' object='libACE_la-XTI_ATM_Mcast.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-XTI_ATM_Mcast.lo `test -f 'XTI_ATM_Mcast.cpp' || echo '$(srcdir)/'`XTI_ATM_Mcast.cpp + +libACE_la-ace_wchar.lo: ace_wchar.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-ace_wchar.lo -MD -MP -MF $(DEPDIR)/libACE_la-ace_wchar.Tpo -c -o libACE_la-ace_wchar.lo `test -f 'ace_wchar.cpp' || echo '$(srcdir)/'`ace_wchar.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-ace_wchar.Tpo $(DEPDIR)/libACE_la-ace_wchar.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ace_wchar.cpp' object='libACE_la-ace_wchar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-ace_wchar.lo `test -f 'ace_wchar.cpp' || echo '$(srcdir)/'`ace_wchar.cpp + +libACE_la-gethrtime.lo: gethrtime.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_la-gethrtime.lo -MD -MP -MF $(DEPDIR)/libACE_la-gethrtime.Tpo -c -o libACE_la-gethrtime.lo `test -f 'gethrtime.cpp' || echo '$(srcdir)/'`gethrtime.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_la-gethrtime.Tpo $(DEPDIR)/libACE_la-gethrtime.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='gethrtime.cpp' object='libACE_la-gethrtime.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_la-gethrtime.lo `test -f 'gethrtime.cpp' || echo '$(srcdir)/'`gethrtime.cpp + +libACE_FlReactor_la-FlReactor.lo: FlReactor/FlReactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_FlReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_FlReactor_la-FlReactor.lo -MD -MP -MF $(DEPDIR)/libACE_FlReactor_la-FlReactor.Tpo -c -o libACE_FlReactor_la-FlReactor.lo `test -f 'FlReactor/FlReactor.cpp' || echo '$(srcdir)/'`FlReactor/FlReactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_FlReactor_la-FlReactor.Tpo $(DEPDIR)/libACE_FlReactor_la-FlReactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FlReactor/FlReactor.cpp' object='libACE_FlReactor_la-FlReactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_FlReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_FlReactor_la-FlReactor.lo `test -f 'FlReactor/FlReactor.cpp' || echo '$(srcdir)/'`FlReactor/FlReactor.cpp + +libACE_QtReactor_la-QtReactor.lo: QtReactor/QtReactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_QtReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_QtReactor_la-QtReactor.lo -MD -MP -MF $(DEPDIR)/libACE_QtReactor_la-QtReactor.Tpo -c -o libACE_QtReactor_la-QtReactor.lo `test -f 'QtReactor/QtReactor.cpp' || echo '$(srcdir)/'`QtReactor/QtReactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_QtReactor_la-QtReactor.Tpo $(DEPDIR)/libACE_QtReactor_la-QtReactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='QtReactor/QtReactor.cpp' object='libACE_QtReactor_la-QtReactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_QtReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_QtReactor_la-QtReactor.lo `test -f 'QtReactor/QtReactor.cpp' || echo '$(srcdir)/'`QtReactor/QtReactor.cpp + +libACE_QtReactor_la-QtReactor_moc.lo: QtReactor/QtReactor_moc.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_QtReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_QtReactor_la-QtReactor_moc.lo -MD -MP -MF $(DEPDIR)/libACE_QtReactor_la-QtReactor_moc.Tpo -c -o libACE_QtReactor_la-QtReactor_moc.lo `test -f 'QtReactor/QtReactor_moc.cpp' || echo '$(srcdir)/'`QtReactor/QtReactor_moc.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_QtReactor_la-QtReactor_moc.Tpo $(DEPDIR)/libACE_QtReactor_la-QtReactor_moc.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='QtReactor/QtReactor_moc.cpp' object='libACE_QtReactor_la-QtReactor_moc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_QtReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_QtReactor_la-QtReactor_moc.lo `test -f 'QtReactor/QtReactor_moc.cpp' || echo '$(srcdir)/'`QtReactor/QtReactor_moc.cpp + +libACE_TkReactor_la-TkReactor.lo: TkReactor/TkReactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_TkReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_TkReactor_la-TkReactor.lo -MD -MP -MF $(DEPDIR)/libACE_TkReactor_la-TkReactor.Tpo -c -o libACE_TkReactor_la-TkReactor.lo `test -f 'TkReactor/TkReactor.cpp' || echo '$(srcdir)/'`TkReactor/TkReactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_TkReactor_la-TkReactor.Tpo $(DEPDIR)/libACE_TkReactor_la-TkReactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TkReactor/TkReactor.cpp' object='libACE_TkReactor_la-TkReactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_TkReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_TkReactor_la-TkReactor.lo `test -f 'TkReactor/TkReactor.cpp' || echo '$(srcdir)/'`TkReactor/TkReactor.cpp + +libACE_XtReactor_la-XtReactor.lo: XtReactor/XtReactor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_XtReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libACE_XtReactor_la-XtReactor.lo -MD -MP -MF $(DEPDIR)/libACE_XtReactor_la-XtReactor.Tpo -c -o libACE_XtReactor_la-XtReactor.lo `test -f 'XtReactor/XtReactor.cpp' || echo '$(srcdir)/'`XtReactor/XtReactor.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libACE_XtReactor_la-XtReactor.Tpo $(DEPDIR)/libACE_XtReactor_la-XtReactor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='XtReactor/XtReactor.cpp' object='libACE_XtReactor_la-XtReactor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libACE_XtReactor_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libACE_XtReactor_la-XtReactor.lo `test -f 'XtReactor/XtReactor.cpp' || echo '$(srcdir)/'`XtReactor/XtReactor.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files +install-nobase_includeHEADERS: $(nobase_include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ + echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ + $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(includedir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-nobase_includeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS \ + uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-local ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-nobase_includeHEADERS install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nobase_includeHEADERS uninstall-pkgconfigDATA + + +@BUILD_ACE_FOR_TAO_FALSE@ACE.pc: ${top_builddir}/config.status ${srcdir}/ACE.pc.in +@BUILD_ACE_FOR_TAO_FALSE@ ${top_builddir}/config.status --file $@:${srcdir}/ACE.pc.in + +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ACE_FlReactor.pc: ${top_builddir}/config.status ${srcdir}/FlReactor/ACE_FlReactor.pc.in +@BUILD_FL_TRUE@@BUILD_GL_TRUE@@BUILD_X11_TRUE@ ${top_builddir}/config.status --file $@:${srcdir}/FlReactor/ACE_FlReactor.pc.in + +@BUILD_QT_TRUE@QtReactor/QtReactor_moc.cpp: $(srcdir)/QtReactor/QtReactor.h +@BUILD_QT_TRUE@ $(QTDIR)/bin/moc $(srcdir)/QtReactor/QtReactor.h -o QtReactor/QtReactor_moc.cpp + +@BUILD_QT_TRUE@ACE_QtReactor.pc: ${top_builddir}/config.status ${srcdir}/QtReactor/ACE_QtReactor.pc.in +@BUILD_QT_TRUE@ ${top_builddir}/config.status --file $@:${srcdir}/QtReactor/ACE_QtReactor.pc.in + +@BUILD_TK_TRUE@ACE_TkReactor.pc: ${top_builddir}/config.status ${srcdir}/TkReactor/ACE_TkReactor.pc.in +@BUILD_TK_TRUE@ ${top_builddir}/config.status --file $@:${srcdir}/TkReactor/ACE_TkReactor.pc.in + +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ACE_XtReactor.pc: ${top_builddir}/config.status ${srcdir}/XtReactor/ACE_XtReactor.pc.in +@BUILD_X11_TRUE@@BUILD_XT_TRUE@ ${top_builddir}/config.status --file $@:${srcdir}/XtReactor/ACE_XtReactor.pc.in + +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/dep/src/ace/Malloc.cpp b/externals/ace/Malloc.cpp similarity index 96% rename from dep/src/ace/Malloc.cpp rename to externals/ace/Malloc.cpp index 1d6fb1fd83b..b742e92c83b 100644 --- a/dep/src/ace/Malloc.cpp +++ b/externals/ace/Malloc.cpp @@ -1,4 +1,4 @@ -// $Id: Malloc.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Malloc.cpp 84282 2009-01-30 15:04:29Z msmit $ #include "ace/Malloc.h" @@ -10,9 +10,11 @@ #include "ace/Malloc_Base.h" #include "ace/OS_NS_string.h" + ACE_RCSID (ace, Malloc, - "$Id: Malloc.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Malloc.cpp 84282 2009-01-30 15:04:29Z msmit $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -143,14 +145,14 @@ ACE_Control_Block::ACE_Name_Node::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("pointer = %@"), (const char *) this->pointer_)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %@"), (ACE_Name_Node *) this->next_)); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\nname_ = (%@, %s)"), + ACE_TEXT ("\nname_ = (%@, %C)\n"), (const char *) this->name_, (const char *) this->name_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } + #if defined (ACE_HAS_MALLOC_STATS) ACE_Malloc_Stats::ACE_Malloc_Stats (void) : nchunks_ (0), @@ -182,4 +184,3 @@ ACE_Malloc_Stats::dump (void) const #endif /*ACE_HAS_MALLOC_STATS*/ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Malloc.h b/externals/ace/Malloc.h similarity index 99% rename from dep/include/ace/Malloc.h rename to externals/ace/Malloc.h index 4fd88802933..7b59f8ae1d0 100644 --- a/dep/include/ace/Malloc.h +++ b/externals/ace/Malloc.h @@ -33,6 +33,7 @@ # define ACE_PROCESS_MUTEX ACE_SV_Semaphore_Simple # endif /* ACE_HAS_THREADS */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL typedef ACE_Atomic_Op ACE_INT; @@ -95,6 +96,7 @@ typedef ACE_Atomic_Op ACE_INT; | // Name Node linked list pointers. | +-----------------------------------------+ + * Control_Block Only the first ACE_Malloc instance that uses @@ -145,6 +147,7 @@ typedef ACE_Atomic_Op ACE_INT; than the sizeof Control_Block, the control block is initialized to the following diagram: + +------------------------------------- |name_head_; | +-------------------------------------+ @@ -391,4 +394,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MALLOC_H */ - diff --git a/dep/include/ace/Malloc.inl b/externals/ace/Malloc.inl similarity index 100% rename from dep/include/ace/Malloc.inl rename to externals/ace/Malloc.inl diff --git a/dep/src/ace/Malloc_Allocator.cpp b/externals/ace/Malloc_Allocator.cpp similarity index 99% rename from dep/src/ace/Malloc_Allocator.cpp rename to externals/ace/Malloc_Allocator.cpp index 9c53da4a172..4da0e5f8fef 100644 --- a/dep/src/ace/Malloc_Allocator.cpp +++ b/externals/ace/Malloc_Allocator.cpp @@ -359,4 +359,3 @@ ACE_Static_Allocator_Base::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Malloc_Allocator.h b/externals/ace/Malloc_Allocator.h similarity index 99% rename from dep/include/ace/Malloc_Allocator.h rename to externals/ace/Malloc_Allocator.h index bd01df8e6a2..1a562108f95 100644 --- a/dep/include/ace/Malloc_Allocator.h +++ b/externals/ace/Malloc_Allocator.h @@ -144,4 +144,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* MALLOC_ALLOCATOR_H */ - diff --git a/dep/include/ace/Malloc_Allocator.inl b/externals/ace/Malloc_Allocator.inl similarity index 100% rename from dep/include/ace/Malloc_Allocator.inl rename to externals/ace/Malloc_Allocator.inl diff --git a/dep/include/ace/Malloc_Base.h b/externals/ace/Malloc_Base.h similarity index 100% rename from dep/include/ace/Malloc_Base.h rename to externals/ace/Malloc_Base.h index 42feebbc41f..6a13d020ad6 100644 --- a/dep/include/ace/Malloc_Base.h +++ b/externals/ace/Malloc_Base.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_MALLOC_BASE_H #define ACE_MALLOC_BASE_H #include /**/ "ace/pre.h" @@ -165,4 +166,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MALLOC_BASE_H */ - diff --git a/dep/src/ace/Malloc_T.cpp b/externals/ace/Malloc_T.cpp similarity index 99% rename from dep/src/ace/Malloc_T.cpp rename to externals/ace/Malloc_T.cpp index 8411a39f9c5..5a2a1852b95 100644 --- a/dep/src/ace/Malloc_T.cpp +++ b/externals/ace/Malloc_T.cpp @@ -1,4 +1,4 @@ -// $Id: Malloc_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Malloc_T.cpp 84282 2009-01-30 15:04:29Z msmit $ #ifndef ACE_MALLOC_T_CPP #define ACE_MALLOC_T_CPP @@ -1055,8 +1055,7 @@ ACE_Malloc_LIFO_Iterator_T::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->curr_->dump (); this->guard_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %s"), this->name_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %C\n"), this->name_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } @@ -1150,8 +1149,7 @@ ACE_Malloc_FIFO_Iterator_T::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->curr_->dump (); this->guard_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %s"), this->name_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %s\n"), this->name_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } @@ -1260,4 +1258,3 @@ ACE_Malloc_FIFO_Iterator_T::start (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_MALLOC_T_CPP */ - diff --git a/dep/include/ace/Malloc_T.h b/externals/ace/Malloc_T.h similarity index 99% rename from dep/include/ace/Malloc_T.h rename to externals/ace/Malloc_T.h index ade2e37f9e4..2d610eb5915 100644 --- a/dep/include/ace/Malloc_T.h +++ b/externals/ace/Malloc_T.h @@ -929,4 +929,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MALLOC_H */ - diff --git a/dep/include/ace/Malloc_T.inl b/externals/ace/Malloc_T.inl similarity index 99% rename from dep/include/ace/Malloc_T.inl rename to externals/ace/Malloc_T.inl index ffc20dfbe51..46f6c0c146b 100644 --- a/dep/include/ace/Malloc_T.inl +++ b/externals/ace/Malloc_T.inl @@ -168,6 +168,7 @@ ACE_Malloc_FIFO_Iterator::ACE_Malloc_FIFO_Iterator (AC { } + #if 0 template ACE_INLINE void ACE_Malloc_T::init_malloc_header_ptr (void* ptr) diff --git a/dep/src/ace/Managed_Object.cpp b/externals/ace/Managed_Object.cpp similarity index 99% rename from dep/src/ace/Managed_Object.cpp rename to externals/ace/Managed_Object.cpp index efe86c34c46..1e7e9eeb215 100644 --- a/dep/src/ace/Managed_Object.cpp +++ b/externals/ace/Managed_Object.cpp @@ -23,4 +23,3 @@ ACE_Cleanup_Adapter::~ACE_Cleanup_Adapter (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_MANAGED_OBJECT_CPP */ - diff --git a/dep/include/ace/Managed_Object.h b/externals/ace/Managed_Object.h similarity index 99% rename from dep/include/ace/Managed_Object.h rename to externals/ace/Managed_Object.h index f4ac54834d4..d29dc1a5432 100644 --- a/dep/include/ace/Managed_Object.h +++ b/externals/ace/Managed_Object.h @@ -166,4 +166,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MANAGED_OBJECT_H */ - diff --git a/dep/include/ace/Managed_Object.inl b/externals/ace/Managed_Object.inl similarity index 100% rename from dep/include/ace/Managed_Object.inl rename to externals/ace/Managed_Object.inl diff --git a/dep/src/ace/Manual_Event.cpp b/externals/ace/Manual_Event.cpp similarity index 100% rename from dep/src/ace/Manual_Event.cpp rename to externals/ace/Manual_Event.cpp index 504b061a8e9..0b3caead8ec 100644 --- a/dep/src/ace/Manual_Event.cpp +++ b/externals/ace/Manual_Event.cpp @@ -6,6 +6,7 @@ #include "ace/Manual_Event.inl" #endif /* __ACE_INLINE__ */ + ACE_RCSID(ace, Manual_Event, "$Id: Manual_Event.cpp 80826 2008-03-04 14:51:23Z wotte $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -45,4 +46,3 @@ ACE_Manual_Event::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Manual_Event.h b/externals/ace/Manual_Event.h similarity index 100% rename from dep/include/ace/Manual_Event.h rename to externals/ace/Manual_Event.h index ff7774f59fc..4686e35d39d 100644 --- a/dep/include/ace/Manual_Event.h +++ b/externals/ace/Manual_Event.h @@ -69,6 +69,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include "ace/Manual_Event.inl" #endif /* __ACE_INLINE__ */ + #include /**/ "ace/post.h" #endif /* ACE_MANUAL_EVENT_H */ - diff --git a/dep/include/ace/Manual_Event.inl b/externals/ace/Manual_Event.inl similarity index 100% rename from dep/include/ace/Manual_Event.inl rename to externals/ace/Manual_Event.inl diff --git a/dep/include/ace/Map.h b/externals/ace/Map.h similarity index 100% rename from dep/include/ace/Map.h rename to externals/ace/Map.h index 2095d833528..ec675fb1fed 100644 --- a/dep/include/ace/Map.h +++ b/externals/ace/Map.h @@ -12,6 +12,7 @@ */ //============================================================================= + #ifndef ACE_MAP_H #define ACE_MAP_H @@ -29,4 +30,3 @@ #include /**/ "ace/post.h" #endif /* ACE_MAP_H */ - diff --git a/dep/src/ace/Map_Manager.cpp b/externals/ace/Map_Manager.cpp similarity index 99% rename from dep/src/ace/Map_Manager.cpp rename to externals/ace/Map_Manager.cpp index 6c070367f00..f1c8fbd63fb 100644 --- a/dep/src/ace/Map_Manager.cpp +++ b/externals/ace/Map_Manager.cpp @@ -699,4 +699,3 @@ ACE_Map_Reverse_Iterator::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_MAP_MANAGER_CPP */ - diff --git a/dep/include/ace/Map_Manager.h b/externals/ace/Map_Manager.h similarity index 99% rename from dep/include/ace/Map_Manager.h rename to externals/ace/Map_Manager.h index b6e141621fa..4e361216f29 100644 --- a/dep/include/ace/Map_Manager.h +++ b/externals/ace/Map_Manager.h @@ -717,4 +717,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MAP_MANAGER_H */ - diff --git a/dep/include/ace/Map_Manager.inl b/externals/ace/Map_Manager.inl similarity index 100% rename from dep/include/ace/Map_Manager.inl rename to externals/ace/Map_Manager.inl diff --git a/dep/src/ace/Map_T.cpp b/externals/ace/Map_T.cpp similarity index 99% rename from dep/src/ace/Map_T.cpp rename to externals/ace/Map_T.cpp index e5edc166bd3..ef3184c5c2e 100644 --- a/dep/src/ace/Map_T.cpp +++ b/externals/ace/Map_T.cpp @@ -1341,4 +1341,3 @@ ACE_Map_Manager_Adapter::rend_impl (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_MAP_T_CPP */ - diff --git a/dep/include/ace/Map_T.h b/externals/ace/Map_T.h similarity index 99% rename from dep/include/ace/Map_T.h rename to externals/ace/Map_T.h index 1882b354e52..0b400e20bde 100644 --- a/dep/include/ace/Map_T.h +++ b/externals/ace/Map_T.h @@ -4,7 +4,7 @@ /** * @file Map_T.h * - * $Id: Map_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Map_T.h 84316 2009-02-03 19:46:05Z johnnyw $ * * @author Irfan Pyarali */ @@ -1145,11 +1145,11 @@ public: /// Close down and release dynamically allocated resources. virtual ~ACE_Hash_Map_Manager_Ex_Adapter (void); - /// Initialize a with size @a length. + /// Initialize a Map with size @a length. virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0); - /// Close down a and release dynamically allocated resources. + /// Close down a Map and release dynamically allocated resources. virtual int close (void); /** @@ -1204,7 +1204,7 @@ public: virtual int bind_create_key (const VALUE &value); /// Recovers the original key potentially modified by the map during - /// . + /// bind_modify_key(). virtual int recover_key (const KEY &modified_key, KEY &original_key); @@ -1609,4 +1609,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MAP_T_H */ - diff --git a/dep/include/ace/Map_T.inl b/externals/ace/Map_T.inl similarity index 100% rename from dep/include/ace/Map_T.inl rename to externals/ace/Map_T.inl diff --git a/dep/src/ace/Mem_Map.cpp b/externals/ace/Mem_Map.cpp similarity index 100% rename from dep/src/ace/Mem_Map.cpp rename to externals/ace/Mem_Map.cpp index 692839b580b..15b20ec2024 100644 --- a/dep/src/ace/Mem_Map.cpp +++ b/externals/ace/Mem_Map.cpp @@ -19,6 +19,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_Mem_Map) + void ACE_Mem_Map::dump (void) const { @@ -307,4 +308,3 @@ ACE_Mem_Map::remove (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Mem_Map.h b/externals/ace/Mem_Map.h similarity index 99% rename from dep/include/ace/Mem_Map.h rename to externals/ace/Mem_Map.h index 5ef4634cfbd..14410cbf3f0 100644 --- a/dep/include/ace/Mem_Map.h +++ b/externals/ace/Mem_Map.h @@ -233,4 +233,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MEM_MAP_H */ - diff --git a/dep/include/ace/Mem_Map.inl b/externals/ace/Mem_Map.inl similarity index 99% rename from dep/include/ace/Mem_Map.inl rename to externals/ace/Mem_Map.inl index 263847253ab..3fd3235db9b 100644 --- a/dep/include/ace/Mem_Map.inl +++ b/externals/ace/Mem_Map.inl @@ -185,6 +185,7 @@ ACE_Mem_Map::protect (size_t len, int prot) return ACE_OS::mprotect (this->base_addr_, len, prot); } + // Change the protection of all the pages of the mapped region to // starting at base_addr_>. diff --git a/dep/include/ace/Memory_Pool.h b/externals/ace/Memory_Pool.h similarity index 99% rename from dep/include/ace/Memory_Pool.h rename to externals/ace/Memory_Pool.h index d95778754c7..a36e74334c2 100644 --- a/dep/include/ace/Memory_Pool.h +++ b/externals/ace/Memory_Pool.h @@ -29,4 +29,3 @@ #include /**/ "ace/post.h" #endif /* ACE_MEMORY_POOL_H */ - diff --git a/dep/src/ace/Message_Block.cpp b/externals/ace/Message_Block.cpp similarity index 98% rename from dep/src/ace/Message_Block.cpp rename to externals/ace/Message_Block.cpp index 426622cbc24..5afc4ba9004 100644 --- a/dep/src/ace/Message_Block.cpp +++ b/externals/ace/Message_Block.cpp @@ -14,7 +14,7 @@ ACE_RCSID (ace, Message_Block, - "$Id: Message_Block.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Message_Block.cpp 84527 2009-02-19 14:01:42Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -50,6 +50,7 @@ enum ACE_DATA_BLOCK_CLONE_LEAVE }; + // Setup Timeprobes ACE_TIMEPROBE_EVENT_DESCRIPTIONS (ACE_MB_Timeprobe_Description, ACE_MESSAGE_BLOCK_INIT_I_ENTER); @@ -153,7 +154,7 @@ ACE_Data_Block::dump (void) const ACE_TEXT ("cur_size_ = %u\n") ACE_TEXT ("max_size_ = %u\n") ACE_TEXT ("flags_ = %u\n") - ACE_TEXT ("base_ = %u\n") + ACE_TEXT ("base_ = %@\n") ACE_TEXT ("locking_strategy_ = %u\n") ACE_TEXT ("reference_count_ = %u\n") ACE_TEXT ("---------------------------\n"), @@ -178,11 +179,11 @@ ACE_Message_Block::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("-----( Message Block )-----\n") ACE_TEXT ("priority_ = %d\n") - ACE_TEXT ("next_ = %u\n") - ACE_TEXT ("prev_ = %u\n") - ACE_TEXT ("cont_ = %u\n") - ACE_TEXT ("rd_ptr_ = %u\n") - ACE_TEXT ("wr_ptr_ = %u\n") + ACE_TEXT ("next_ = %@\n") + ACE_TEXT ("prev_ = %@\n") + ACE_TEXT ("cont_ = %@\n") + ACE_TEXT ("rd_ptr_ = %@\n") + ACE_TEXT ("wr_ptr_ = %@\n") ACE_TEXT ("---------------------------\n"), this->priority_, this->next_, @@ -814,8 +815,10 @@ ACE_Data_Block::release_no_delete (ACE_Lock *lock) } // This is the case when no lock was passed in else - // Lock to be used is our lock - lock_to_be_used = this->locking_strategy_; + { + // Lock to be used is our lock + lock_to_be_used = this->locking_strategy_; + } // If there's a locking strategy then we need to acquire the lock // before decrementing the count. @@ -826,7 +829,9 @@ ACE_Data_Block::release_no_delete (ACE_Lock *lock) result = this->release_i (); } else - result = this->release_i (); + { + result = this->release_i (); + } return result; } @@ -877,7 +882,7 @@ ACE_Message_Block::release (void) // One guard for all ACE_GUARD_RETURN (ACE_Lock, ace_mon, *lock, 0); - // Call non-guarded release with + // Call non-guarded release with @a lock destroy_dblock = this->release_i (lock); } // This is the case when we have a valid data block but no lock @@ -979,6 +984,7 @@ ACE_Message_Block::~ACE_Message_Block (void) this->prev_ = 0; this->next_ = 0; + this->cont_ = 0; } ACE_Data_Block * @@ -1159,6 +1165,7 @@ ACE_Data_Block::clone_nocopy (ACE_Message_Block::Message_Flags mask, return 0; } + // Set new flags minus the mask... nb->clr_flags (mask | always_clear); return nb; @@ -1269,4 +1276,3 @@ ACE_Data_Block::base (char *msg_data, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Message_Block.h b/externals/ace/Message_Block.h similarity index 95% rename from dep/include/ace/Message_Block.h rename to externals/ace/Message_Block.h index 00b130968e3..cd4545a42e6 100644 --- a/dep/include/ace/Message_Block.h +++ b/externals/ace/Message_Block.h @@ -4,7 +4,7 @@ /** * @file Message_Block.h * - * $Id: Message_Block.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Message_Block.h 86825 2009-09-28 17:45:23Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -33,6 +33,7 @@ class ACE_Allocator; class ACE_Data_Block; class ACE_Lock; + /** * @class ACE_Message_Block * @@ -137,7 +138,7 @@ public: * responsibility to take care of the memory allocated for the * data_block */ - ACE_Message_Block (ACE_Data_Block *, + ACE_Message_Block (ACE_Data_Block *data_block, Message_Flags flags = 0, ACE_Allocator *message_block_allocator = 0); @@ -213,14 +214,14 @@ public: /** * Create an initialized message of type @a type containing @a size * bytes. The @a cont argument initializes the continuation field in - * the . If @a data == 0 then we create and own the + * the Message_Block. If @a data == 0 then we create and own the * @a data, using @a allocator_strategy to get the data if it's non-0. If * @a data != 0 we assume that we have ownership of the @a data till * this object ceases to exist (and don't delete it during * destruction). If @a locking_strategy is non-0 then this is used * to protect regions of code that access shared state (e.g., * reference counting) from race conditions. Note that the @a size - * of the will be @a size, but the @a length will be 0 + * of the Message_Block will be @a size, but the @a length will be 0 * until is set. The @a data_block_allocator is use to * allocate the data blocks while the @a allocator_strategy is used * to allocate the buffers contained by those. @@ -392,7 +393,7 @@ public: */ int copy (const char *buf); - /// Normalizes data in the top-level to align with the base, + /// Normalizes data in the top-level Message_Block to align with the base, /// i.e., it "shifts" the data pointed to by down to the and /// then readjusts to point to and to point /// to + the length of the moved data. Returns -1 and does @@ -404,7 +405,7 @@ public: void reset (void); /// Access all the allocators in the message block. - /// @@todo: Not sure whether we would need finer control while + /// @todo Not sure whether we would need finer control while /// trying to access allocators ie. a method for every allocator. /** * This method returns the allocators only from the first message @@ -485,40 +486,40 @@ public: /// Set the length of the message void length (size_t n); - /// Get the length of the s, including chained - /// s. + /// Get the length of the Message_Blocks, including chained + /// Message_Blocks. size_t total_length (void) const; - /// Get the total number of bytes in all s, including - /// chained s. + /// Get the total number of bytes in all Message_Blocks, including + /// chained Message_Blocks. size_t total_size (void) const; /// Get the total number of bytes and total length in all - /// s, including chained s. + /// Message_Blocks, including chained Message_Blocks. void total_size_and_length (size_t &mb_size, size_t &mb_length) const; - /// Get the number of bytes in the top-level (i.e., - /// does not consider the bytes in chained s). + /// Get the number of bytes in the top-level Message_Block (i.e., + /// does not consider the bytes in chained Message_Blocks). size_t size (void) const; /** - * Set the number of bytes in the top-level , - * reallocating space if necessary. However, the and - * remain at the original offsets into the buffer, even if + * Set the number of bytes in the top-level Message_Block, + * reallocating space if necessary. However, the @c rd_ptr_ and + * @c wr_ptr_ remain at the original offsets into the buffer, even if * it is reallocated. Returns 0 if successful, else -1. */ int size (size_t length); - /// Get the number of allocated bytes in all , including - /// chained s. + /// Get the number of allocated bytes in all Message_Block, including + /// chained Message_Blocks. size_t total_capacity (void) const; - /// Get the number of allocated bytes in the top-level . + /// Get the number of allocated bytes in the top-level Message_Block. size_t capacity (void) const; /// Get the number of bytes available after the in the - /// top-level . + /// top-level Message_Block. size_t space (void) const; //@} @@ -551,14 +552,14 @@ public: /// Set the continuation field. void cont (ACE_Message_Block *); - // = Pointer to the directly ahead in the ACE_Message_Queue. + // = Pointer to the Message_Block directly ahead in the ACE_Message_Queue. /// Get link to next message. ACE_Message_Block *next (void) const; /// Set link to next message. void next (ACE_Message_Block *); - // = Pointer to the directly behind in the ACE_Message_Queue. + // = Pointer to the Message_Block directly behind in the ACE_Message_Queue. /// Get link to prev message. ACE_Message_Block *prev (void) const; @@ -801,7 +802,7 @@ protected: /** * Decrease the reference count, but don't delete the object. * Returns 0 if the object should be removed. - * If is equal to the locking strategy then we assume that + * If @a lock is equal to the locking strategy then we assume that * the lock is beign held by the current thread; this is used to * release all the data blocks in a chain while holding a single * lock. @@ -868,4 +869,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MESSAGE_BLOCK_H */ - diff --git a/dep/include/ace/Message_Block.inl b/externals/ace/Message_Block.inl similarity index 99% rename from dep/include/ace/Message_Block.inl rename to externals/ace/Message_Block.inl index b47b0b552b2..a4c00563cd8 100644 --- a/dep/include/ace/Message_Block.inl +++ b/externals/ace/Message_Block.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Message_Block.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Message_Block.inl 84527 2009-02-19 14:01:42Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -343,6 +343,7 @@ ACE_Message_Block::end (void) const return this->data_block ()->end (); } + ACE_INLINE void ACE_Message_Block::rd_ptr (char *new_ptr) { @@ -396,7 +397,7 @@ ACE_Message_Block::replace_data_block (ACE_Data_Block *db) if (db != 0) { // Set the read and write pointers in the to point - // to the buffer in the . + // to the buffer in the ACE_Data_Block. this->rd_ptr (this->data_block ()->base ()); this->wr_ptr (this->data_block ()->base ()); } diff --git a/dep/src/ace/Message_Block_T.cpp b/externals/ace/Message_Block_T.cpp similarity index 99% rename from dep/src/ace/Message_Block_T.cpp rename to externals/ace/Message_Block_T.cpp index ade7d1b8ef4..bb38ca69448 100644 --- a/dep/src/ace/Message_Block_T.cpp +++ b/externals/ace/Message_Block_T.cpp @@ -52,4 +52,3 @@ ACE_Locked_Data_Block::clone_nocopy (ACE_Message_Block::Message_Flags ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_MESSAGE_BLOCK_T_CPP */ - diff --git a/dep/include/ace/Message_Block_T.h b/externals/ace/Message_Block_T.h similarity index 99% rename from dep/include/ace/Message_Block_T.h rename to externals/ace/Message_Block_T.h index 25615fa4508..b57a25bdc95 100644 --- a/dep/include/ace/Message_Block_T.h +++ b/externals/ace/Message_Block_T.h @@ -86,4 +86,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MESSAGE_BLOCK_T_H */ - diff --git a/dep/include/ace/Message_Block_T.inl b/externals/ace/Message_Block_T.inl similarity index 100% rename from dep/include/ace/Message_Block_T.inl rename to externals/ace/Message_Block_T.inl diff --git a/dep/src/ace/Message_Queue.cpp b/externals/ace/Message_Queue.cpp similarity index 99% rename from dep/src/ace/Message_Queue.cpp rename to externals/ace/Message_Queue.cpp index ba04916c563..fefd67e6797 100644 --- a/dep/src/ace/Message_Queue.cpp +++ b/externals/ace/Message_Queue.cpp @@ -26,4 +26,3 @@ ACE_Message_Queue_Base::state (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Message_Queue.h b/externals/ace/Message_Queue.h similarity index 96% rename from dep/include/ace/Message_Queue.h rename to externals/ace/Message_Queue.h index c9734213409..348cccfaf86 100644 --- a/dep/include/ace/Message_Queue.h +++ b/externals/ace/Message_Queue.h @@ -4,7 +4,7 @@ /** * @file Message_Queue.h * - * $Id: Message_Queue.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Message_Queue.h 88560 2010-01-15 05:02:05Z schmidt $ * * @author Douglas C. Schmidt */ @@ -21,10 +21,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/IO_Cntl_Msg.h" -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) -# include "ace/Synch_Traits.h" /* Needed in ACE_Message_Queue_NT */ -# include "ace/Thread_Mutex.h" /* Needed in ACE_Message_Queue_NT */ -#endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -235,4 +231,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MESSAGE_QUEUE_H */ - diff --git a/dep/include/ace/Message_Queue.inl b/externals/ace/Message_Queue.inl similarity index 100% rename from dep/include/ace/Message_Queue.inl rename to externals/ace/Message_Queue.inl diff --git a/dep/src/ace/Message_Queue_NT.cpp b/externals/ace/Message_Queue_NT.cpp similarity index 97% rename from dep/src/ace/Message_Queue_NT.cpp rename to externals/ace/Message_Queue_NT.cpp index 57155a4dccf..6f828db2378 100644 --- a/dep/src/ace/Message_Queue_NT.cpp +++ b/externals/ace/Message_Queue_NT.cpp @@ -1,5 +1,6 @@ -// $Id: Message_Queue_NT.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Message_Queue_NT.cpp 88560 2010-01-15 05:02:05Z schmidt $ +#include "ace/Message_Queue.h" #include "ace/Message_Queue_NT.h" #include "ace/Log_Msg.h" @@ -9,7 +10,7 @@ ACE_RCSID (ace, Message_Queue_NT, - "$Id: Message_Queue_NT.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Message_Queue_NT.cpp 88560 2010-01-15 05:02:05Z schmidt $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -234,4 +235,3 @@ ACE_Message_Queue_NT::dump (void) const #endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Message_Queue_NT.h b/externals/ace/Message_Queue_NT.h similarity index 97% rename from dep/include/ace/Message_Queue_NT.h rename to externals/ace/Message_Queue_NT.h index ffdc9eb4da2..e959e57cf2b 100644 --- a/dep/include/ace/Message_Queue_NT.h +++ b/externals/ace/Message_Queue_NT.h @@ -4,7 +4,7 @@ /** * @file Message_Queue_NT.h * - * $Id: Message_Queue_NT.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Message_Queue_NT.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -69,7 +69,7 @@ public: // = Enqueue and dequeue methods. /** - * Enqueue an at the end of the queue. + * Enqueue an ACE_Message_Block * at the end of the queue. * Returns -1 on failure, else the number of items still on the * queue. */ @@ -79,7 +79,7 @@ public: ACE_Time_Value *timeout = 0); /** - * Dequeue and return the at the head of the + * Dequeue and return the ACE_Message_Block * at the head of the * queue. Returns -1 on failure, else the number of items still on * the queue. */ @@ -229,4 +229,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MESSAGE_QUEUE_NT_H */ - diff --git a/dep/include/ace/Message_Queue_NT.inl b/externals/ace/Message_Queue_NT.inl similarity index 100% rename from dep/include/ace/Message_Queue_NT.inl rename to externals/ace/Message_Queue_NT.inl diff --git a/dep/src/ace/Message_Queue_T.cpp b/externals/ace/Message_Queue_T.cpp similarity index 98% rename from dep/src/ace/Message_Queue_T.cpp rename to externals/ace/Message_Queue_T.cpp index 7ba4fac659f..6c677c1d555 100644 --- a/dep/src/ace/Message_Queue_T.cpp +++ b/externals/ace/Message_Queue_T.cpp @@ -1,4 +1,4 @@ -// $Id: Message_Queue_T.cpp 82574 2008-08-08 19:35:06Z parsons $ +// $Id: Message_Queue_T.cpp 88560 2010-01-15 05:02:05Z schmidt $ #ifndef ACE_MESSAGE_QUEUE_T_CPP #define ACE_MESSAGE_QUEUE_T_CPP @@ -9,6 +9,10 @@ #include "ace/Log_Msg.h" #include "ace/OS_NS_sys_time.h" +#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) +#include "ace/Message_Queue_NT.h" +#endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -981,9 +985,9 @@ ACE_Message_Queue::dump (void) const this->cur_count_, this->head_, this->tail_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("not_full_cond: \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("not_full_cond:\n"))); not_full_cond_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("not_empty_cond: \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("not_empty_cond:\n"))); not_empty_cond_.dump (); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ @@ -1138,6 +1142,7 @@ ACE_Message_Queue::deactivate_i (int pulse) else this->state_ = ACE_Message_Queue_Base::DEACTIVATED; } + return previous_state; } @@ -1168,12 +1173,12 @@ ACE_Message_Queue::close (void) ACE_TRACE ("ACE_Message_Queue::close"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); - int const result = this->deactivate_i (); + // There's no need to check the return value of deactivate_i() since + // it never fails! + this->deactivate_i (); // Free up the remaining messages on the queue. - this->flush_i (); - - return result; + return this->flush_i (); } template int @@ -1764,6 +1769,7 @@ ACE_Message_Queue::enqueue_head (ACE_Message_Block *new_item, { ACE_TRACE ("ACE_Message_Queue::enqueue_head"); int queue_count = 0; + ACE_Notification_Strategy *notifier = 0; { ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); @@ -1777,12 +1783,17 @@ ACE_Message_Queue::enqueue_head (ACE_Message_Block *new_item, return -1; queue_count = this->enqueue_head_i (new_item); - if (queue_count == -1) return -1; - this->notify (); +#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) + this->monitor_->receive (this->cur_length_); +#endif + notifier = this->notification_strategy_; } + + if (0 != notifier) + notifier->notify(); return queue_count; } @@ -1796,6 +1807,7 @@ ACE_Message_Queue::enqueue_prio (ACE_Message_Block *new_item, { ACE_TRACE ("ACE_Message_Queue::enqueue_prio"); int queue_count = 0; + ACE_Notification_Strategy *notifier = 0; { ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); @@ -1813,8 +1825,13 @@ ACE_Message_Queue::enqueue_prio (ACE_Message_Block *new_item, if (queue_count == -1) return -1; - this->notify (); +#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) + this->monitor_->receive (this->cur_length_); +#endif + notifier = this->notification_strategy_; } + if (0 != notifier) + notifier->notify (); return queue_count; } @@ -1828,6 +1845,7 @@ ACE_Message_Queue::enqueue_deadline (ACE_Message_Block *new_item, { ACE_TRACE ("ACE_Message_Queue::enqueue_deadline"); int queue_count = 0; + ACE_Notification_Strategy *notifier = 0; { ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); @@ -1845,8 +1863,13 @@ ACE_Message_Queue::enqueue_deadline (ACE_Message_Block *new_item, if (queue_count == -1) return -1; - this->notify (); +#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) + this->monitor_->receive (this->cur_length_); +#endif + notifier = this->notification_strategy_; } + if (0 != notifier) + notifier->notify (); return queue_count; } @@ -1867,6 +1890,7 @@ ACE_Message_Queue::enqueue_tail (ACE_Message_Block *new_item, { ACE_TRACE ("ACE_Message_Queue::enqueue_tail"); int queue_count = 0; + ACE_Notification_Strategy *notifier = 0; { ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); @@ -1884,8 +1908,13 @@ ACE_Message_Queue::enqueue_tail (ACE_Message_Block *new_item, if (queue_count == -1) return -1; - this->notify (); +#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) + this->monitor_->receive (this->cur_length_); +#endif + notifier = this->notification_strategy_; } + if (0 != notifier) + notifier->notify (); return queue_count; } @@ -1986,10 +2015,6 @@ ACE_Message_Queue::notify (void) { ACE_TRACE ("ACE_Message_Queue::notify"); -#if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1) - this->monitor_->receive (this->cur_length_); -#endif - // By default, don't do anything. if (this->notification_strategy_ == 0) return 0; @@ -2212,7 +2237,7 @@ ACE_Dynamic_Message_Queue::dump (void) const ACE_TRACE ("ACE_Dynamic_Message_Queue::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Message_Queue (base class): \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE_Message_Queue (base class):\n"))); this->ACE_Message_Queue::dump (); ACE_DEBUG ((LM_DEBUG, @@ -2229,7 +2254,7 @@ ACE_Dynamic_Message_Queue::dump (void) const this->beyond_late_head_, this->beyond_late_tail_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("message_strategy_ : \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("message_strategy_ :\n"))); message_strategy_.dump (); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); @@ -2928,6 +2953,7 @@ ACE_Message_Queue_Factory::create_laxity_message_queue (size_t hw // . #if defined (ACE_VXWORKS) + // factory method for a wrapped VxWorks message queue template ACE_Message_Queue_Vx * @@ -2942,7 +2968,7 @@ ACE_Message_Queue_Factory::create_Vx_message_queue (size_t max_me 0); return tmp; } - // factory method for a wrapped VxWorks message queue +#endif /* defined (ACE_VXWORKS) */ #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) @@ -2953,15 +2979,13 @@ ACE_Message_Queue_Factory::create_NT_message_queue (size_t max_th ACE_Message_Queue_NT *tmp = 0; ACE_NEW_RETURN (tmp, - ACE_Message_Queue_NT (max_threads); + ACE_Message_Queue_NT (max_threads), 0); return tmp; } #endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ -#endif /* defined (ACE_VXWORKS) */ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_MESSAGE_QUEUE_T_CPP */ - diff --git a/dep/include/ace/Message_Queue_T.h b/externals/ace/Message_Queue_T.h similarity index 99% rename from dep/include/ace/Message_Queue_T.h rename to externals/ace/Message_Queue_T.h index 8f5f0217108..e1e9953e892 100644 --- a/dep/include/ace/Message_Queue_T.h +++ b/externals/ace/Message_Queue_T.h @@ -388,6 +388,7 @@ public: //@} + /** @name Water mark (flow control) methods */ //@{ @@ -618,6 +619,7 @@ private: // This typedef is used to get around a compiler bug in g++/vxworks. typedef ACE_Message_Queue ACE_DEFAULT_MESSAGE_QUEUE_TYPE; + /** * @class ACE_Message_Queue_Iterator * @@ -816,6 +818,7 @@ public: virtual int enqueue_head (ACE_Message_Block *new_item, ACE_Time_Value *timeout = 0); + /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; @@ -938,6 +941,7 @@ public: u_long dynamic_priority_max = 0x3FFFFFUL, // 2^(22)-1 u_long dynamic_priority_offset = 0x200000UL); // 2^(22-1) + #if defined (ACE_VXWORKS) /// Factory method for a wrapped VxWorks message queue @@ -1557,4 +1561,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MESSAGE_QUEUE_T_H */ - diff --git a/dep/src/ace/Message_Queue_Vx.cpp b/externals/ace/Message_Queue_Vx.cpp similarity index 100% rename from dep/src/ace/Message_Queue_Vx.cpp rename to externals/ace/Message_Queue_Vx.cpp index 7ffdb1cd0af..9aa465d36e5 100644 --- a/dep/src/ace/Message_Queue_Vx.cpp +++ b/externals/ace/Message_Queue_Vx.cpp @@ -11,6 +11,7 @@ ACE_RCSID (ace, Message_Queue_Vx, "$Id: Message_Queue_Vx.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL #if defined (ACE_VXWORKS) @@ -365,4 +366,3 @@ ACE_Message_Queue_Vx::peek_dequeue_head (ACE_Message_Block *&, #endif /* ACE_VXWORKS */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Message_Queue_Vx.h b/externals/ace/Message_Queue_Vx.h similarity index 96% rename from dep/include/ace/Message_Queue_Vx.h rename to externals/ace/Message_Queue_Vx.h index a442394e25a..5dd65c12478 100644 --- a/dep/include/ace/Message_Queue_Vx.h +++ b/externals/ace/Message_Queue_Vx.h @@ -4,7 +4,7 @@ /** * @file Message_Queue_Vx.h * - * $Id: Message_Queue_Vx.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Message_Queue_Vx.h 85579 2009-06-08 18:46:54Z mitza $ * * @author Douglas C. Schmidt */ @@ -58,11 +58,11 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * * . * * . * * The ability to change low and high water marks after creation. - * * chains. The continuation field of ACE_Message_Block + * * Message_Block chains. The continuation field of ACE_Message_Block * * is ignored; only the first block of a fragment chain is * * recognized. */ -class ACE_Message_Queue_Vx : public ACE_Message_Queue +class ACE_Export ACE_Message_Queue_Vx: public ACE_Message_Queue { public: // = Initialization and termination methods. @@ -225,4 +225,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MESSAGE_QUEUE_VX_H */ - diff --git a/dep/include/ace/Message_Queue_Vx.inl b/externals/ace/Message_Queue_Vx.inl similarity index 100% rename from dep/include/ace/Message_Queue_Vx.inl rename to externals/ace/Message_Queue_Vx.inl diff --git a/dep/include/ace/Method_Object.h b/externals/ace/Method_Object.h similarity index 100% rename from dep/include/ace/Method_Object.h rename to externals/ace/Method_Object.h index 2c75bec61f3..5af98f531a3 100644 --- a/dep/include/ace/Method_Object.h +++ b/externals/ace/Method_Object.h @@ -15,6 +15,7 @@ */ //============================================================================= + #ifndef ACE_METHOD_OBJECT_H #define ACE_METHOD_OBJECT_H #include /**/ "ace/pre.h" @@ -35,4 +36,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_METHOD_OBJECT_H */ - diff --git a/dep/src/ace/Method_Request.cpp b/externals/ace/Method_Request.cpp similarity index 99% rename from dep/src/ace/Method_Request.cpp rename to externals/ace/Method_Request.cpp index 528bf147433..972087c5d8b 100644 --- a/dep/src/ace/Method_Request.cpp +++ b/externals/ace/Method_Request.cpp @@ -28,4 +28,3 @@ ACE_Method_Request::priority (unsigned long prio) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Method_Request.h b/externals/ace/Method_Request.h similarity index 99% rename from dep/include/ace/Method_Request.h rename to externals/ace/Method_Request.h index 2aab2ef3491..156f112472f 100644 --- a/dep/include/ace/Method_Request.h +++ b/externals/ace/Method_Request.h @@ -11,6 +11,7 @@ */ //============================================================================= + #ifndef ACE_METHOD_REQUEST_H #define ACE_METHOD_REQUEST_H @@ -94,6 +95,6 @@ protected: ACE_END_VERSIONED_NAMESPACE_DECL + #include /**/ "ace/post.h" #endif /* ACE_METHOD_REQUEST_H */ - diff --git a/dep/include/ace/Metrics_Cache.h b/externals/ace/Metrics_Cache.h similarity index 99% rename from dep/include/ace/Metrics_Cache.h rename to externals/ace/Metrics_Cache.h index 1fe84b0f17d..7e174d1e8d0 100644 --- a/dep/include/ace/Metrics_Cache.h +++ b/externals/ace/Metrics_Cache.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_METRICS_CACHE_H #define ACE_METRICS_CACHE_H @@ -91,6 +92,7 @@ do { if((METRICS_PTR->metrics_enabled())) { \ METRICS_PTR->report_##NAME##_resume(X); \ } } while (0) + /** * Mystery macros. I could not find where there were functions like 'report_base_metrics_start ()'. All the * start and stop functions had an argument to find the probe in the cache @@ -136,4 +138,3 @@ METRICS_PTR->report_##NAME##_stop(); \ #endif /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */ #endif /* ACE_METRICS_CACHE_H */ - diff --git a/dep/src/ace/Metrics_Cache_T.cpp b/externals/ace/Metrics_Cache_T.cpp similarity index 99% rename from dep/src/ace/Metrics_Cache_T.cpp rename to externals/ace/Metrics_Cache_T.cpp index 12ee533aa09..f94c3f06309 100644 --- a/dep/src/ace/Metrics_Cache_T.cpp +++ b/externals/ace/Metrics_Cache_T.cpp @@ -235,4 +235,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* defined (ACE_COMPILE_TIMEPROBES) */ #endif /* ACE_METRICS_CACHE_CPP */ - diff --git a/dep/include/ace/Metrics_Cache_T.h b/externals/ace/Metrics_Cache_T.h similarity index 100% rename from dep/include/ace/Metrics_Cache_T.h rename to externals/ace/Metrics_Cache_T.h index 4625603357e..dba5c961ca3 100644 --- a/dep/include/ace/Metrics_Cache_T.h +++ b/externals/ace/Metrics_Cache_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_METRICS_CACHE_T_H #define ACE_METRICS_CACHE_T_H @@ -240,4 +241,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* defined (ACE_COMPILE_TIMEPROBES) */ #endif /* ACE_METRICS_CACHE_T_H */ - diff --git a/dep/include/ace/Metrics_Cache_T.inl b/externals/ace/Metrics_Cache_T.inl similarity index 98% rename from dep/include/ace/Metrics_Cache_T.inl rename to externals/ace/Metrics_Cache_T.inl index 98bc73e7243..790aa3db04a 100644 --- a/dep/include/ace/Metrics_Cache_T.inl +++ b/externals/ace/Metrics_Cache_T.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Metrics_Cache_T.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Metrics_Cache_T.inl 83735 2008-11-14 09:41:52Z johnnyw $ #ifndef ACE_METRICS_CACHE_T_INL #define ACE_METRICS_CACHE_T_INL @@ -11,6 +11,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Class ACE_Metrics_Cache // ///////////////////////////// + template ACE_INLINE void ACE_Metrics_Cache::report_enqueue_start (u_long i) @@ -26,7 +27,7 @@ ACE_Metrics_Cache::report_enqueue_start (u_long i) this->interval_initialized_ = 1; ACE_hrtime_t hrtime_now = ACE_OS::gethrtime (); ACE_High_Res_Timer::hrtime_to_tv (this->interval_start_, - hrtime_now); + hrtime_now); this->interval_end_.set (this->interval_start_.sec(), this->interval_start_.usec()); } @@ -40,6 +41,7 @@ ACE_Metrics_Cache::report_enqueue_start (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::report_enqueue_stop (u_long i) @@ -63,6 +65,7 @@ ACE_Metrics_Cache::report_enqueue_stop (u_long i) } + template ACE_INLINE void ACE_Metrics_Cache::report_enqueue_suspend (u_long i) @@ -79,6 +82,7 @@ ACE_Metrics_Cache::report_enqueue_suspend (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::report_enqueue_resume (u_long i) @@ -95,6 +99,7 @@ ACE_Metrics_Cache::report_enqueue_resume (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::report_dequeue_start (u_long i) @@ -124,6 +129,7 @@ ACE_Metrics_Cache::report_dequeue_start (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::report_dequeue_stop (u_long i) @@ -146,6 +152,7 @@ ACE_Metrics_Cache::report_dequeue_stop (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::report_dequeue_suspend (u_long i) @@ -162,6 +169,7 @@ ACE_Metrics_Cache::report_dequeue_suspend (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::report_dequeue_resume (u_long i) @@ -178,6 +186,7 @@ ACE_Metrics_Cache::report_dequeue_resume (u_long i) } } + template ACE_INLINE void ACE_Metrics_Cache::reset_base_statistics () @@ -200,6 +209,7 @@ ACE_Metrics_Cache::reset_base_statistics () } } + // Flips the supplier and consumer positions. template diff --git a/dep/include/ace/Min_Max.h b/externals/ace/Min_Max.h similarity index 99% rename from dep/include/ace/Min_Max.h rename to externals/ace/Min_Max.h index fe22b7e9a77..373862973f8 100644 --- a/dep/include/ace/Min_Max.h +++ b/externals/ace/Min_Max.h @@ -68,4 +68,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MIN_MAX_H */ - diff --git a/dep/src/ace/Module.cpp b/externals/ace/Module.cpp similarity index 95% rename from dep/src/ace/Module.cpp rename to externals/ace/Module.cpp index ab974cae479..286270a9b55 100644 --- a/dep/src/ace/Module.cpp +++ b/externals/ace/Module.cpp @@ -1,4 +1,4 @@ -// $Id: Module.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Module.cpp 84068 2008-12-24 18:32:05Z shuston $ #ifndef ACE_MODULE_CPP #define ACE_MODULE_CPP @@ -83,14 +83,14 @@ ACE_Module::link (ACE_Module *m) } template int -ACE_Module::open (const ACE_TCHAR *mod_name, +ACE_Module::open (const ACE_TCHAR *module_name, ACE_Task *writer_q, ACE_Task *reader_q, void *arg, int flags /* = M_DELETE */) { ACE_TRACE ("ACE_Module::open"); - this->name (mod_name); + this->name (module_name); this->arg_ = arg; // We may already have readers and/or writers. @@ -178,7 +178,7 @@ ACE_Module::~ACE_Module (void) } template -ACE_Module::ACE_Module (const ACE_TCHAR *mod_name, +ACE_Module::ACE_Module (const ACE_TCHAR *module_name, ACE_Task *writer_q, ACE_Task *reader_q, void *args, @@ -190,7 +190,7 @@ ACE_Module::ACE_Module (const ACE_TCHAR *mod_name, this->q_pair_[0] = 0; this->q_pair_[1] = 0; - if (this->open (mod_name, writer_q, reader_q, args, flags) == -1) + if (this->open (module_name, writer_q, reader_q, args, flags) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Module"))); @@ -271,4 +271,3 @@ ACE_Module::close_i (int which, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_MODULE_CPP */ - diff --git a/dep/include/ace/Module.h b/externals/ace/Module.h similarity index 96% rename from dep/include/ace/Module.h rename to externals/ace/Module.h index e749b6365cd..4ae5c285d89 100644 --- a/dep/include/ace/Module.h +++ b/externals/ace/Module.h @@ -4,7 +4,7 @@ /** * @file Module.h * - * $Id: Module.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Module.h 85417 2009-05-22 08:31:42Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -94,8 +94,8 @@ public: int flags = M_DELETE); /** - * Initialize the module with as its identity - * and and as its tasks. Previously register + * Initialize the module with @a module_name as its identity + * and @a reader> and @a writer as its tasks. Previously register * reader or writers or closed down and deleted according to the * value of flags_. Should not be called from within * . @@ -174,7 +174,7 @@ public: private: /// Implements the close operation for either the reader or the - /// writer task (depending on ). + /// writer task (depending on @a which). int close_i (int which, int flags); /// Pair of Tasks that form the "read-side" and "write-side" of the @@ -213,4 +213,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MODULE_H */ - diff --git a/dep/include/ace/Module.inl b/externals/ace/Module.inl similarity index 100% rename from dep/include/ace/Module.inl rename to externals/ace/Module.inl diff --git a/dep/src/ace/Monitor_Admin.cpp b/externals/ace/Monitor_Admin.cpp similarity index 99% rename from dep/src/ace/Monitor_Admin.cpp rename to externals/ace/Monitor_Admin.cpp index 059ee78c180..5c60b2b902e 100644 --- a/dep/src/ace/Monitor_Admin.cpp +++ b/externals/ace/Monitor_Admin.cpp @@ -111,4 +111,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ - diff --git a/dep/include/ace/Monitor_Admin.h b/externals/ace/Monitor_Admin.h similarity index 92% rename from dep/include/ace/Monitor_Admin.h rename to externals/ace/Monitor_Admin.h index 4120d8a1c5e..739722f3456 100644 --- a/dep/include/ace/Monitor_Admin.h +++ b/externals/ace/Monitor_Admin.h @@ -4,7 +4,7 @@ /** * @file Monitor_Admin.h * - * $Id: Monitor_Admin.h 81753 2008-05-21 19:02:47Z parsons $ + * $Id: Monitor_Admin.h 85297 2009-05-07 01:40:41Z parsons $ * * @author Jeff Parsons */ @@ -50,10 +50,10 @@ namespace ACE */ class Monitor_Point_Auto_Updater : public ACE_Event_Handler { - public: - /// Override of ACE base class method. - virtual int handle_timeout (const ACE_Time_Value& interval, - const void* monitor_point); + public: + /// Override of ACE base class method. + virtual int handle_timeout (const ACE_Time_Value& interval, + const void* monitor_point); }; /** @@ -107,4 +107,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // MONITOR_ADMIN_H - diff --git a/dep/src/ace/Monitor_Admin_Manager.cpp b/externals/ace/Monitor_Admin_Manager.cpp similarity index 99% rename from dep/src/ace/Monitor_Admin_Manager.cpp rename to externals/ace/Monitor_Admin_Manager.cpp index 61ebb226af4..aed71e54a02 100644 --- a/dep/src/ace/Monitor_Admin_Manager.cpp +++ b/externals/ace/Monitor_Admin_Manager.cpp @@ -40,4 +40,3 @@ ACE_FACTORY_DEFINE (ACE, MC_ADMINMANAGER) #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ - diff --git a/dep/include/ace/Monitor_Admin_Manager.h b/externals/ace/Monitor_Admin_Manager.h similarity index 99% rename from dep/include/ace/Monitor_Admin_Manager.h rename to externals/ace/Monitor_Admin_Manager.h index 16ae520feb2..72977383fdd 100644 --- a/dep/include/ace/Monitor_Admin_Manager.h +++ b/externals/ace/Monitor_Admin_Manager.h @@ -68,4 +68,3 @@ ACE_FACTORY_DECLARE (ACE, MC_ADMINMANAGER) #include /**/ "ace/post.h" #endif // MONITOR_ADMIN_MANAGER_H - diff --git a/dep/src/ace/Monitor_Base.cpp b/externals/ace/Monitor_Base.cpp similarity index 99% rename from dep/src/ace/Monitor_Base.cpp rename to externals/ace/Monitor_Base.cpp index dfcb1032b2f..a4f3b847e06 100644 --- a/dep/src/ace/Monitor_Base.cpp +++ b/externals/ace/Monitor_Base.cpp @@ -400,4 +400,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ - diff --git a/dep/include/ace/Monitor_Base.h b/externals/ace/Monitor_Base.h similarity index 99% rename from dep/include/ace/Monitor_Base.h rename to externals/ace/Monitor_Base.h index 1ed230f0061..2557e6ea7dd 100644 --- a/dep/include/ace/Monitor_Base.h +++ b/externals/ace/Monitor_Base.h @@ -150,4 +150,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // MONITOR_BASE_H - diff --git a/dep/include/ace/Monitor_Base.inl b/externals/ace/Monitor_Base.inl similarity index 100% rename from dep/include/ace/Monitor_Base.inl rename to externals/ace/Monitor_Base.inl diff --git a/dep/src/ace/Monitor_Control_Action.cpp b/externals/ace/Monitor_Control_Action.cpp similarity index 100% rename from dep/src/ace/Monitor_Control_Action.cpp rename to externals/ace/Monitor_Control_Action.cpp diff --git a/dep/include/ace/Monitor_Control_Action.h b/externals/ace/Monitor_Control_Action.h similarity index 99% rename from dep/include/ace/Monitor_Control_Action.h rename to externals/ace/Monitor_Control_Action.h index ba51b56d382..7831aabd4c1 100644 --- a/dep/include/ace/Monitor_Control_Action.h +++ b/externals/ace/Monitor_Control_Action.h @@ -63,4 +63,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // MONITOR_CONTROL_ACTION_H - diff --git a/dep/src/ace/Monitor_Control_Types.cpp b/externals/ace/Monitor_Control_Types.cpp similarity index 77% rename from dep/src/ace/Monitor_Control_Types.cpp rename to externals/ace/Monitor_Control_Types.cpp index 782227c5684..f60d9117cce 100644 --- a/dep/src/ace/Monitor_Control_Types.cpp +++ b/externals/ace/Monitor_Control_Types.cpp @@ -1,4 +1,4 @@ -// $Id: Monitor_Control_Types.cpp 82328 2008-07-15 17:20:17Z parsons $ +// $Id: Monitor_Control_Types.cpp 84834 2009-03-16 12:28:51Z johnnyw $ #include "ace/Monitor_Control_Types.h" @@ -53,17 +53,20 @@ namespace ACE Monitor_Control_Types::Constraint& Monitor_Control_Types::Constraint::operator= (const Constraint& rhs) { - if (this->control_action != 0) + if (this != &rhs) { - this->control_action->remove_ref (); - } + if (this->control_action != 0) + { + this->control_action->remove_ref (); + } - this->expr = rhs.expr; - this->control_action = rhs.control_action; + this->expr = rhs.expr; + this->control_action = rhs.control_action; - if (this->control_action != 0) - { - this->control_action->add_ref (); + if (this->control_action != 0) + { + this->control_action->add_ref (); + } } return *this; diff --git a/dep/include/ace/Monitor_Control_Types.h b/externals/ace/Monitor_Control_Types.h similarity index 84% rename from dep/include/ace/Monitor_Control_Types.h rename to externals/ace/Monitor_Control_Types.h index db0a12ce046..5e92e524f7c 100644 --- a/dep/include/ace/Monitor_Control_Types.h +++ b/externals/ace/Monitor_Control_Types.h @@ -4,7 +4,7 @@ /** * @file Monitor_Control_Types.h * - * $Id: Monitor_Control_Types.h 82332 2008-07-16 01:00:55Z johnnyw $ + * $Id: Monitor_Control_Types.h 83306 2008-10-17 12:19:53Z johnnyw $ * * @author Jeff Parsons */ @@ -88,13 +88,6 @@ namespace ACE Control_Action* control_action; }; -#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x570) - // Borland C++ Builder 6 and earlier don't handle the second template - // argument correctly. We have to pass it explicitly - typedef ACE_Vector DataList; - typedef ACE_Vector NameList; - typedef ACE_Array_Map > ConstraintList; -#else /** * @brief Used by the admin class as a container for the data from * a group of monitor points. @@ -110,7 +103,6 @@ namespace ACE * @brief Holder for a monitor point's constraints. */ typedef ACE_Array_Map ConstraintList; -#endif }; } } @@ -122,4 +114,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // MONITOR_CONTROL_TYPES_H - diff --git a/dep/src/ace/Monitor_Point_Registry.cpp b/externals/ace/Monitor_Point_Registry.cpp similarity index 99% rename from dep/src/ace/Monitor_Point_Registry.cpp rename to externals/ace/Monitor_Point_Registry.cpp index 0a66ac4c986..4c3844f7ea5 100644 --- a/dep/src/ace/Monitor_Point_Registry.cpp +++ b/externals/ace/Monitor_Point_Registry.cpp @@ -42,7 +42,7 @@ namespace ACE type->add_ref (); status = this->map_.bind (type->name (), type); - + /// Temporary debugging code. // ACE_DEBUG ((LM_DEBUG, "adding %s\n", type->name ())); } @@ -75,7 +75,7 @@ namespace ACE ACE_CString name_str (name, 0, false); status = this->map_.unbind (name_str, mp); - + /// Temporary debugging code. // ACE_DEBUG ((LM_DEBUG, "removing %s\n", name_str.c_str ())); } @@ -170,4 +170,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ - diff --git a/dep/include/ace/Monitor_Point_Registry.h b/externals/ace/Monitor_Point_Registry.h similarity index 99% rename from dep/include/ace/Monitor_Point_Registry.h rename to externals/ace/Monitor_Point_Registry.h index 2c08d695ec1..82dba6caf7d 100644 --- a/dep/include/ace/Monitor_Point_Registry.h +++ b/externals/ace/Monitor_Point_Registry.h @@ -98,4 +98,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // MONITOR_POINT_REGISTRY_H - diff --git a/dep/src/ace/Monitor_Size.cpp b/externals/ace/Monitor_Size.cpp similarity index 99% rename from dep/src/ace/Monitor_Size.cpp rename to externals/ace/Monitor_Size.cpp index d7dbaadf853..f968f9b9bb8 100644 --- a/dep/src/ace/Monitor_Size.cpp +++ b/externals/ace/Monitor_Size.cpp @@ -45,4 +45,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */ - diff --git a/dep/include/ace/Monitor_Size.h b/externals/ace/Monitor_Size.h similarity index 99% rename from dep/include/ace/Monitor_Size.h rename to externals/ace/Monitor_Size.h index bca6815af73..42ec3131233 100644 --- a/dep/include/ace/Monitor_Size.h +++ b/externals/ace/Monitor_Size.h @@ -62,4 +62,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // SIZE_MONITOR_H - diff --git a/dep/src/ace/Msg_WFMO_Reactor.cpp b/externals/ace/Msg_WFMO_Reactor.cpp similarity index 99% rename from dep/src/ace/Msg_WFMO_Reactor.cpp rename to externals/ace/Msg_WFMO_Reactor.cpp index 2b834daa823..e06b698169f 100644 --- a/dep/src/ace/Msg_WFMO_Reactor.cpp +++ b/externals/ace/Msg_WFMO_Reactor.cpp @@ -83,4 +83,3 @@ ACE_Msg_WFMO_Reactor::poll_remaining_handles (DWORD slot) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 && !ACE_LACKS_MSG_WFMO */ - diff --git a/dep/include/ace/Msg_WFMO_Reactor.h b/externals/ace/Msg_WFMO_Reactor.h similarity index 100% rename from dep/include/ace/Msg_WFMO_Reactor.h rename to externals/ace/Msg_WFMO_Reactor.h index 879dcef9c8b..3c1eadd5b40 100644 --- a/dep/include/ace/Msg_WFMO_Reactor.h +++ b/externals/ace/Msg_WFMO_Reactor.h @@ -11,6 +11,7 @@ */ //============================================================================= + #ifndef ACE_MSG_WFMO_REACTOR_H #define ACE_MSG_WFMO_REACTOR_H #include /**/ "ace/pre.h" @@ -117,4 +118,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MSG_WFMO_REACTOR_H */ - diff --git a/dep/include/ace/Msg_WFMO_Reactor.inl b/externals/ace/Msg_WFMO_Reactor.inl similarity index 100% rename from dep/include/ace/Msg_WFMO_Reactor.inl rename to externals/ace/Msg_WFMO_Reactor.inl diff --git a/dep/src/ace/Multihomed_INET_Addr.cpp b/externals/ace/Multihomed_INET_Addr.cpp similarity index 96% rename from dep/src/ace/Multihomed_INET_Addr.cpp rename to externals/ace/Multihomed_INET_Addr.cpp index 37a50b84d02..2f861a0398c 100644 --- a/dep/src/ace/Multihomed_INET_Addr.cpp +++ b/externals/ace/Multihomed_INET_Addr.cpp @@ -1,4 +1,4 @@ -// $Id: Multihomed_INET_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Multihomed_INET_Addr.cpp 83170 2008-10-13 07:21:38Z johnnyw $ // Extends ACE_INET_Addr with support for multi-homed addresses. @@ -11,7 +11,7 @@ ACE_RCSID (ace, Multihomed_INET_Addr, - "$Id: Multihomed_INET_Addr.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Multihomed_INET_Addr.cpp 83170 2008-10-13 07:21:38Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -54,8 +54,8 @@ ACE_Multihomed_INET_Addr::ACE_Multihomed_INET_Addr(u_short port_number, address_family); if (ret) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Invalid INET addr (%s:%u) will be ignored\n"), - ACE_TEXT_CHAR_TO_TCHAR (secondary_host_names[i]), port_number)); + ACE_TEXT ("Invalid INET addr (%C:%u) will be ignored\n"), + secondary_host_names[i], port_number)); this->secondaries_.size(this->secondaries_.size() - 1); } else @@ -291,10 +291,10 @@ ACE_Multihomed_INET_Addr::get_addresses(sockaddr_in6 *addrs, } #endif /* ACE_HAS_IPV6 */ + ACE_Multihomed_INET_Addr::~ACE_Multihomed_INET_Addr (void) { } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Multihomed_INET_Addr.h b/externals/ace/Multihomed_INET_Addr.h similarity index 94% rename from dep/include/ace/Multihomed_INET_Addr.h rename to externals/ace/Multihomed_INET_Addr.h index 88a3fbe3424..976ee813e9f 100644 --- a/dep/include/ace/Multihomed_INET_Addr.h +++ b/externals/ace/Multihomed_INET_Addr.h @@ -4,7 +4,7 @@ /** * @file Multihomed_INET_Addr.h * - * $Id: Multihomed_INET_Addr.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Multihomed_INET_Addr.h 84325 2009-02-04 22:46:30Z shuston $ * * @author Edward R. Mulholland */ @@ -61,11 +61,11 @@ public: * AF_INET6. To specify IPv4, use AF_INET. */ ACE_Multihomed_INET_Addr(u_short port_number, - const char primary_host_name[], - int encode = 1, - int address_family = AF_UNSPEC, - const char *(secondary_host_names[]) = 0, - size_t size = 0); + const char primary_host_name[], + int encode = 1, + int address_family = AF_UNSPEC, + const char *(secondary_host_names[]) = 0, + size_t size = 0); /** * Constructs an ACE_Multihomed_INET_Addr from a @a port_number, @@ -91,6 +91,7 @@ public: int address_family = AF_UNSPEC, const wchar_t *(secondary_host_names[]) = 0, size_t size = 0); + int set (u_short port_number, const wchar_t primary_host_name[], int encode = 1, @@ -196,4 +197,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MULTIHOMED_INET_ADDR_H */ - diff --git a/dep/include/ace/Multihomed_INET_Addr.inl b/externals/ace/Multihomed_INET_Addr.inl similarity index 100% rename from dep/include/ace/Multihomed_INET_Addr.inl rename to externals/ace/Multihomed_INET_Addr.inl diff --git a/dep/src/ace/Mutex.cpp b/externals/ace/Mutex.cpp similarity index 95% rename from dep/src/ace/Mutex.cpp rename to externals/ace/Mutex.cpp index 6f0ab0683a9..65a477f455b 100644 --- a/dep/src/ace/Mutex.cpp +++ b/externals/ace/Mutex.cpp @@ -1,4 +1,4 @@ -// $Id: Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Mutex.cpp 84282 2009-01-30 15:04:29Z msmit $ #include "ace/Mutex.h" @@ -10,9 +10,10 @@ #include "ace/OS_NS_string.h" #include "ace/os_include/sys/os_mman.h" + ACE_RCSID (ace, Mutex, - "$Id: Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Mutex.cpp 84282 2009-01-30 15:04:29Z msmit $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -21,6 +22,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Mutex) void ACE_Mutex::dump (void) const { +#if defined (ACE_HAS_DUMP) // ACE_TRACE ("ACE_Mutex::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); @@ -30,6 +32,7 @@ ACE_Mutex::dump (void) const #endif /* ACE_HAS_PTHREADS || ACE_HAS_STHREADS */ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +#endif /* ACE_HAS_DUMP */ } ACE_Mutex::ACE_Mutex (int type, const ACE_TCHAR *name, @@ -122,4 +125,3 @@ ACE_Mutex::~ACE_Mutex (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Mutex.h b/externals/ace/Mutex.h similarity index 99% rename from dep/include/ace/Mutex.h rename to externals/ace/Mutex.h index d0440263472..e738745940a 100644 --- a/dep/include/ace/Mutex.h +++ b/externals/ace/Mutex.h @@ -190,4 +190,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MUTEX_H */ - diff --git a/dep/include/ace/Mutex.inl b/externals/ace/Mutex.inl similarity index 99% rename from dep/include/ace/Mutex.inl rename to externals/ace/Mutex.inl index 10432e9ede8..8c6c73c8667 100644 --- a/dep/include/ace/Mutex.inl +++ b/externals/ace/Mutex.inl @@ -2,6 +2,7 @@ // // $Id: Mutex.inl 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/OS_NS_sys_mman.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/NT_Service.cpp b/externals/ace/NT_Service.cpp similarity index 99% rename from dep/src/ace/NT_Service.cpp rename to externals/ace/NT_Service.cpp index d2ed4fc5de6..6323bb1e2d1 100644 --- a/dep/src/ace/NT_Service.cpp +++ b/externals/ace/NT_Service.cpp @@ -86,6 +86,7 @@ ACE_NT_Service::fini (void) return this->report_status (SERVICE_STOPPED, 0); } + void ACE_NT_Service::handle_control (DWORD control_code) { @@ -304,6 +305,7 @@ ACE_NT_Service::startup (void) } + void ACE_NT_Service::capture_log_msg_attributes (void) { @@ -318,6 +320,7 @@ ACE_NT_Service::inherit_log_msg_attributes (void) ACE_Log_Msg::inherit_hook (0, this->log_msg_attributes_); } + int ACE_NT_Service::start_svc (ACE_Time_Value *wait_time, DWORD *svc_state, @@ -613,4 +616,3 @@ ACE_NT_Service::wait_for_service_state (DWORD desired_state, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_SERVICES */ - diff --git a/dep/include/ace/NT_Service.h b/externals/ace/NT_Service.h similarity index 100% rename from dep/include/ace/NT_Service.h rename to externals/ace/NT_Service.h index d3202120622..0e1e0a16a84 100644 --- a/dep/include/ace/NT_Service.h +++ b/externals/ace/NT_Service.h @@ -157,6 +157,7 @@ public: /// the macro-generated service function calls it. void svc_handle (const SERVICE_STATUS_HANDLE new_svc_handle); + // = Methods which can be used to do SCP-like functions. The first group // are used to register/insert and remove the service's definition in the // SCM registry. @@ -436,4 +437,3 @@ extern VOID WINAPI ace_nt_svc_main_##SVCNAME (DWORD dwArgc, \ #include /**/ "ace/post.h" #endif /* ACE_SERVICE_OBJECT_H */ - diff --git a/dep/include/ace/NT_Service.inl b/externals/ace/NT_Service.inl similarity index 99% rename from dep/include/ace/NT_Service.inl rename to externals/ace/NT_Service.inl index 66bf6a4c4fe..80c2a7a3764 100644 --- a/dep/include/ace/NT_Service.inl +++ b/externals/ace/NT_Service.inl @@ -24,6 +24,7 @@ ACE_NT_Service::ACE_NT_Service (DWORD start_timeout, svc_status_.dwWaitHint = 0; } + ACE_INLINE ACE_NT_Service::ACE_NT_Service (const ACE_TCHAR *name, const ACE_TCHAR *desc, @@ -45,12 +46,14 @@ ACE_NT_Service::ACE_NT_Service (const ACE_TCHAR *name, svc_status_.dwCheckPoint = 0; } + ACE_INLINE int ACE_NT_Service::svc (void) { return -1; } + ACE_INLINE const ACE_TCHAR * ACE_NT_Service::name (void) const diff --git a/dep/src/ace/Name_Proxy.cpp b/externals/ace/Name_Proxy.cpp similarity index 99% rename from dep/src/ace/Name_Proxy.cpp rename to externals/ace/Name_Proxy.cpp index 19ff0be473d..5755e971eec 100644 --- a/dep/src/ace/Name_Proxy.cpp +++ b/externals/ace/Name_Proxy.cpp @@ -207,4 +207,3 @@ ACE_Name_Proxy::~ACE_Name_Proxy (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Name_Proxy.h b/externals/ace/Name_Proxy.h similarity index 100% rename from dep/include/ace/Name_Proxy.h rename to externals/ace/Name_Proxy.h index cc8790a7fcb..a60a118f457 100644 --- a/dep/include/ace/Name_Proxy.h +++ b/externals/ace/Name_Proxy.h @@ -16,6 +16,7 @@ */ //============================================================================= + #ifndef ACE_NAME_PROXY_H #define ACE_NAME_PROXY_H #include /**/ "ace/pre.h" @@ -98,4 +99,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NAME_PROXY_H */ - diff --git a/dep/src/ace/Name_Request_Reply.cpp b/externals/ace/Name_Request_Reply.cpp similarity index 99% rename from dep/src/ace/Name_Request_Reply.cpp rename to externals/ace/Name_Request_Reply.cpp index ff160d8574a..18329ab9df0 100644 --- a/dep/src/ace/Name_Request_Reply.cpp +++ b/externals/ace/Name_Request_Reply.cpp @@ -575,4 +575,3 @@ ACE_Name_Reply::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Name_Request_Reply.h b/externals/ace/Name_Request_Reply.h similarity index 98% rename from dep/include/ace/Name_Request_Reply.h rename to externals/ace/Name_Request_Reply.h index 23244985216..e8509f10bfc 100644 --- a/dep/include/ace/Name_Request_Reply.h +++ b/externals/ace/Name_Request_Reply.h @@ -4,7 +4,7 @@ /** * @file Name_Request_Reply.h * - * $Id: Name_Request_Reply.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Name_Request_Reply.h 84316 2009-02-03 19:46:05Z johnnyw $ * * Define the format used to exchange messages between the * ACE_Name Server and its clients. @@ -15,6 +15,7 @@ */ //============================================================================= + #ifndef ACE_NAME_REQUEST_REPLY_H #define ACE_NAME_REQUEST_REPLY_H @@ -204,7 +205,7 @@ public: /// Default constructor. ACE_Name_Reply (void); - /// Create a message. + /// Create a ACE_Name_Reply message. ACE_Name_Reply (ACE_UINT32 type, ACE_UINT32 err); // Type of reply. /// Initialize length_ in order to ensure correct byte ordering @@ -262,4 +263,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NAME_REQUEST_REPLY_H */ - diff --git a/dep/src/ace/Name_Space.cpp b/externals/ace/Name_Space.cpp similarity index 89% rename from dep/src/ace/Name_Space.cpp rename to externals/ace/Name_Space.cpp index 4e269d71f6a..9fe88795038 100644 --- a/dep/src/ace/Name_Space.cpp +++ b/externals/ace/Name_Space.cpp @@ -1,11 +1,11 @@ // Name_Space.cpp -// $Id: Name_Space.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Name_Space.cpp 84834 2009-03-16 12:28:51Z johnnyw $ #include "ace/Name_Space.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdlib.h" -ACE_RCSID(ace, Name_Space, "$Id: Name_Space.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Name_Space, "$Id: Name_Space.cpp 84834 2009-03-16 12:28:51Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -17,6 +17,7 @@ ACE_Name_Binding::ACE_Name_Binding (void) ACE_TRACE ("ACE_Name_Binding::ACE_Name_Binding"); } + ACE_Name_Binding::~ACE_Name_Binding (void) { ACE_TRACE ("ACE_Name_Binding::~ACE_Name_Binding"); @@ -41,7 +42,7 @@ ACE_Name_Binding::ACE_Name_Binding (const ACE_Name_Binding &s) ACE_TRACE ("ACE_Name_Binding::ACE_Name_Binding"); } -void +const ACE_Name_Binding& ACE_Name_Binding::operator = (const ACE_Name_Binding &s) { ACE_TRACE ("ACE_Name_Binding::operator ="); @@ -53,6 +54,8 @@ ACE_Name_Binding::operator = (const ACE_Name_Binding &s) this->value_ = s.value_; this->type_ = ACE_OS::strdup (s.type_); } + + return *this; } bool @@ -70,4 +73,3 @@ ACE_Name_Space::~ACE_Name_Space (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Name_Space.h b/externals/ace/Name_Space.h similarity index 97% rename from dep/include/ace/Name_Space.h rename to externals/ace/Name_Space.h index 7106587f459..93b57bd9cf9 100644 --- a/dep/include/ace/Name_Space.h +++ b/externals/ace/Name_Space.h @@ -4,7 +4,7 @@ /** * @file Name_Space.h * - * $Id: Name_Space.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Name_Space.h 84834 2009-03-16 12:28:51Z johnnyw $ * * @author Prashant Jain */ @@ -49,7 +49,7 @@ public: ACE_Name_Binding (const ACE_Name_Binding &); /// Assignment operator. - void operator= (const ACE_Name_Binding &); + const ACE_Name_Binding& operator= (const ACE_Name_Binding &); /// Destructor. ~ACE_Name_Binding (void); @@ -95,6 +95,7 @@ public: const ACE_NS_WString &value_in, const char *type_in = "") = 0; + /** * Overwrite the value or type of an existing name in a * ACE_Name_Space or bind a new name to the context, if it didn't @@ -162,4 +163,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NAME_SPACE_H */ - diff --git a/dep/src/ace/Naming_Context.cpp b/externals/ace/Naming_Context.cpp similarity index 97% rename from dep/src/ace/Naming_Context.cpp rename to externals/ace/Naming_Context.cpp index 03861153e9a..103d9d79352 100644 --- a/dep/src/ace/Naming_Context.cpp +++ b/externals/ace/Naming_Context.cpp @@ -1,4 +1,4 @@ -// $Id: Naming_Context.cpp 81286 2008-04-09 07:27:30Z johnnyw $ +// $Id: Naming_Context.cpp 84565 2009-02-23 08:20:39Z johnnyw $ #include "ace/Get_Opt.h" #include "ace/Naming_Context.h" @@ -14,7 +14,7 @@ # include "ace/Trace.h" #endif /* ACE_HAS_TRACE */ -ACE_RCSID(ace, Naming_Context, "$Id: Naming_Context.cpp 81286 2008-04-09 07:27:30Z johnnyw $") +ACE_RCSID(ace, Naming_Context, "$Id: Naming_Context.cpp 84565 2009-02-23 08:20:39Z johnnyw $") #if !defined (__ACE_INLINE__) #include "ace/Naming_Context.inl" @@ -415,8 +415,8 @@ ACE_Naming_Context::fini (void) } ACE_Name_Options::ACE_Name_Options (void) - : debugging_ (0), - verbosity_ (0), + : debugging_ (false), + verbosity_ (false), use_registry_ (false), nameserver_port_ (ACE_DEFAULT_SERVER_PORT), nameserver_host_ (ACE_OS::strdup (ACE_DEFAULT_SERVER_HOST)), @@ -566,7 +566,7 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("b:c:dh:l:P:p:s:T:vr")); - for (int c; (c = get_opt ()) != -1;) + for (int c; (c = get_opt ()) != -1; ) switch (c) { case 'c': @@ -580,7 +580,7 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[]) } break; case 'd': - this->debugging_ = 1; + this->debugging_ = true; break; case 'r': this->use_registry_ = true; @@ -613,7 +613,7 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[]) #endif /* ACE_HAS_TRACE */ break; case 'v': - this->verbosity_ = 1; + this->verbosity_ = true; break; default: ACE_OS::fprintf (stderr, "%s\n" @@ -624,8 +624,8 @@ ACE_Name_Options::parse_args (int argc, ACE_TCHAR *argv[]) "\t[-p nameserver port]\n" "\t[-s database name]\n" "\t[-b base address]\n" - "\t[-v] (verbose) \n" - "\t[-r] (use Win32 Registry) \n", + "\t[-v] (verbose)\n" + "\t[-r] (use Win32 Registry)\n", argv[0]); /* NOTREACHED */ break; @@ -647,4 +647,3 @@ ACE_STATIC_SVC_DEFINE (ACE_Naming_Context, ACE_Service_Type::DELETE_OBJ, 0) ACE_STATIC_SVC_REQUIRE (ACE_Naming_Context) - diff --git a/dep/include/ace/Naming_Context.h b/externals/ace/Naming_Context.h similarity index 98% rename from dep/include/ace/Naming_Context.h rename to externals/ace/Naming_Context.h index 2ac80a74526..ffc0252eda7 100644 --- a/dep/include/ace/Naming_Context.h +++ b/externals/ace/Naming_Context.h @@ -4,7 +4,7 @@ /** * @file Naming_Context.h * - * $Id: Naming_Context.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Naming_Context.h 84160 2009-01-14 14:13:58Z johnnyw $ * * @author Gerhard Lenzer * @author Douglas C. Schmidt @@ -337,17 +337,17 @@ public: void use_registry (bool x); /// Return debug status - int debug (void); + bool debug (void); /// Return verbose status - int verbose (void); + bool verbose (void); private: /// Extra debugging info - int debugging_; + bool debugging_; /// Extra verbose messages - int verbosity_; + bool verbosity_; /// Use Win32 Registry bool use_registry_; @@ -385,4 +385,3 @@ ACE_STATIC_SVC_DECLARE_EXPORT (ACE, ACE_Naming_Context) #include /**/ "ace/post.h" #endif /* ACE_NAMING_CONTEXT_H */ - diff --git a/dep/include/ace/Naming_Context.inl b/externals/ace/Naming_Context.inl similarity index 89% rename from dep/include/ace/Naming_Context.inl rename to externals/ace/Naming_Context.inl index 917ddce37f3..034442b9394 100644 --- a/dep/include/ace/Naming_Context.inl +++ b/externals/ace/Naming_Context.inl @@ -1,4 +1,4 @@ -// $Id: Naming_Context.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Naming_Context.inl 84160 2009-01-14 14:13:58Z johnnyw $ ACE_INLINE bool ACE_Name_Options::use_registry (void) const @@ -14,7 +14,7 @@ ACE_Name_Options::use_registry (bool x) this->use_registry_ = x; } -ACE_INLINE int +ACE_INLINE bool ACE_Name_Options::verbose (void) { ACE_TRACE ("ACE_Name_Options::verbose"); @@ -35,7 +35,7 @@ ACE_Name_Options::namespace_dir (void) return this->namespace_dir_; } -ACE_INLINE int +ACE_INLINE bool ACE_Name_Options::debug (void) { ACE_TRACE ("ACE_Name_Options::debug"); diff --git a/dep/src/ace/Netlink_Addr.cpp b/externals/ace/Netlink_Addr.cpp similarity index 99% rename from dep/src/ace/Netlink_Addr.cpp rename to externals/ace/Netlink_Addr.cpp index 0f73345b9c5..888febb0aa5 100644 --- a/dep/src/ace/Netlink_Addr.cpp +++ b/externals/ace/Netlink_Addr.cpp @@ -66,4 +66,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif - diff --git a/dep/include/ace/Netlink_Addr.h b/externals/ace/Netlink_Addr.h similarity index 99% rename from dep/include/ace/Netlink_Addr.h rename to externals/ace/Netlink_Addr.h index 8fd5c6b9590..b596068c517 100644 --- a/dep/include/ace/Netlink_Addr.h +++ b/externals/ace/Netlink_Addr.h @@ -117,3 +117,4 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_NETLINK_ADDR_H */ + diff --git a/dep/include/ace/Netlink_Addr.inl b/externals/ace/Netlink_Addr.inl similarity index 99% rename from dep/include/ace/Netlink_Addr.inl rename to externals/ace/Netlink_Addr.inl index 2cb43b73d6c..4ec38fa4a28 100644 --- a/dep/include/ace/Netlink_Addr.inl +++ b/externals/ace/Netlink_Addr.inl @@ -40,6 +40,7 @@ ACE_INLINE int ACE_Netlink_Addr::get_addr_size (void) const return sizeof(this->nl_); } + ACE_INLINE void ACE_Netlink_Addr::set_addr (void *addr, int len){ ACE_OS::memcpy (&this->nl_,addr,len); } diff --git a/dep/src/ace/Node.cpp b/externals/ace/Node.cpp similarity index 99% rename from dep/src/ace/Node.cpp rename to externals/ace/Node.cpp index 03cbdba05da..b1b36fd73d2 100644 --- a/dep/src/ace/Node.cpp +++ b/externals/ace/Node.cpp @@ -44,4 +44,3 @@ ACE_Node::ACE_Node (const ACE_Node &s) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_NODE_CPP */ - diff --git a/dep/include/ace/Node.h b/externals/ace/Node.h similarity index 100% rename from dep/include/ace/Node.h rename to externals/ace/Node.h index c2eb7a7bb3d..57433a70e47 100644 --- a/dep/include/ace/Node.h +++ b/externals/ace/Node.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_NODE_H #define ACE_NODE_H #include /**/ "ace/pre.h" @@ -82,4 +83,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NODE_H */ - diff --git a/dep/src/ace/Notification_Queue.cpp b/externals/ace/Notification_Queue.cpp similarity index 91% rename from dep/src/ace/Notification_Queue.cpp rename to externals/ace/Notification_Queue.cpp index 1faada20c59..8819090527d 100644 --- a/dep/src/ace/Notification_Queue.cpp +++ b/externals/ace/Notification_Queue.cpp @@ -1,4 +1,4 @@ -// $Id: Notification_Queue.cpp 81315 2008-04-10 07:14:15Z johnnyw $ +// $Id: Notification_Queue.cpp 85236 2009-05-01 11:43:56Z johnnyw $ #include "ace/Notification_Queue.h" @@ -26,8 +26,7 @@ ACE_Notification_Queue:: } int -ACE_Notification_Queue:: -open() +ACE_Notification_Queue::open() { ACE_TRACE ("ACE_Notification_Queue::open"); @@ -40,8 +39,7 @@ open() } void -ACE_Notification_Queue:: -reset() +ACE_Notification_Queue::reset() { ACE_TRACE ("ACE_Notification_Queue::reset"); @@ -75,8 +73,8 @@ reset() Buffer_List().swap(free_queue_); } -int ACE_Notification_Queue:: -allocate_more_buffers() +int +ACE_Notification_Queue::allocate_more_buffers() { ACE_TRACE ("ACE_Notification_Queue::allocate_more_buffers"); @@ -101,9 +99,9 @@ allocate_more_buffers() } int -ACE_Notification_Queue:: -purge_pending_notifications(ACE_Event_Handler * eh, - ACE_Reactor_Mask mask) +ACE_Notification_Queue::purge_pending_notifications( + ACE_Event_Handler * eh, + ACE_Reactor_Mask mask) { ACE_TRACE ("ACE_Notification_Queue::purge_pending_notifications"); @@ -155,8 +153,8 @@ purge_pending_notifications(ACE_Event_Handler * eh, return number_purged; } -int ACE_Notification_Queue:: -push_new_notification( +int +ACE_Notification_Queue::push_new_notification( ACE_Notification_Buffer const & buffer) { ACE_TRACE ("ACE_Notification_Queue::push_new_notification"); @@ -210,8 +208,7 @@ ACE_Notification_Queue::pop_next_notification( return 0; } - ACE_Notification_Queue_Node * node = - notify_queue_.pop_front(); + ACE_Notification_Queue_Node * node = notify_queue_.pop_front(); current = node->get(); free_queue_.push_front(node); @@ -226,4 +223,3 @@ ACE_Notification_Queue::pop_next_notification( } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Notification_Queue.h b/externals/ace/Notification_Queue.h similarity index 99% rename from dep/include/ace/Notification_Queue.h rename to externals/ace/Notification_Queue.h index b2ed768fd7a..a9ad1ad245b 100644 --- a/dep/include/ace/Notification_Queue.h +++ b/externals/ace/Notification_Queue.h @@ -154,4 +154,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NOTIFICATION_QUEUE_H */ - diff --git a/dep/include/ace/Notification_Queue.inl b/externals/ace/Notification_Queue.inl similarity index 100% rename from dep/include/ace/Notification_Queue.inl rename to externals/ace/Notification_Queue.inl diff --git a/dep/src/ace/Notification_Strategy.cpp b/externals/ace/Notification_Strategy.cpp similarity index 99% rename from dep/src/ace/Notification_Strategy.cpp rename to externals/ace/Notification_Strategy.cpp index 4ffdda52097..1e022e07953 100644 --- a/dep/src/ace/Notification_Strategy.cpp +++ b/externals/ace/Notification_Strategy.cpp @@ -20,4 +20,3 @@ ACE_Notification_Strategy::~ACE_Notification_Strategy (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Notification_Strategy.h b/externals/ace/Notification_Strategy.h similarity index 99% rename from dep/include/ace/Notification_Strategy.h rename to externals/ace/Notification_Strategy.h index 7467ca06f4b..ba4c558db21 100644 --- a/dep/include/ace/Notification_Strategy.h +++ b/externals/ace/Notification_Strategy.h @@ -73,4 +73,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_NOTIFICATION_STRATEGY_H */ - diff --git a/dep/include/ace/Notification_Strategy.inl b/externals/ace/Notification_Strategy.inl similarity index 100% rename from dep/include/ace/Notification_Strategy.inl rename to externals/ace/Notification_Strategy.inl diff --git a/dep/include/ace/Null_Barrier.h b/externals/ace/Null_Barrier.h similarity index 99% rename from dep/include/ace/Null_Barrier.h rename to externals/ace/Null_Barrier.h index 64e3516d2a6..5cd9ef8386f 100644 --- a/dep/include/ace/Null_Barrier.h +++ b/externals/ace/Null_Barrier.h @@ -57,4 +57,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NULL_BARRIER_H */ - diff --git a/dep/include/ace/Null_Condition.h b/externals/ace/Null_Condition.h similarity index 99% rename from dep/include/ace/Null_Condition.h rename to externals/ace/Null_Condition.h index c693b0a69eb..02131e2134e 100644 --- a/dep/include/ace/Null_Condition.h +++ b/externals/ace/Null_Condition.h @@ -83,4 +83,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NULL_CONDITION_H */ - diff --git a/dep/include/ace/Null_Mutex.h b/externals/ace/Null_Mutex.h similarity index 94% rename from dep/include/ace/Null_Mutex.h rename to externals/ace/Null_Mutex.h index 7cf2304e05d..85aefb0e51d 100644 --- a/dep/include/ace/Null_Mutex.h +++ b/externals/ace/Null_Mutex.h @@ -4,7 +4,7 @@ /** * @file Null_Mutex.h * - * $Id: Null_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Null_Mutex.h 86731 2009-09-17 12:23:48Z johnnyw $ * * Moved from Synch.h. * @@ -31,6 +31,7 @@ #include "ace/Global_Macros.h" #include "ace/OS_Memory.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Time_Value; @@ -123,8 +124,6 @@ template class ACE_Guard; /** - * @class ACE_Guard - * * @brief Template specialization of ACE_Guard for the * ACE_Null_Mutex. * @@ -163,8 +162,8 @@ template class ACE_Write_Guard; /** - * @class ACE_Write_Guard - * + * @brief Template specialization of ACE_Write_Guard for the + * ACE_Null_Mutex. */ template<> class ACE_Export ACE_Write_Guard @@ -187,8 +186,8 @@ template class ACE_Read_Guard; /** - * @class ACE_Read_Guard - * + * @brief Template specialization of ACE_Read)Guard for the + * ACE_Null_Mutex. */ template<> class ACE_Export ACE_Read_Guard @@ -210,8 +209,8 @@ public: template class ACE_Malloc_Lock_Adapter_T; /** - * @class ACE_Malloc_Lock_Adapter_T - * + * @brief Template specialization of ACE_Malloc_Lock_Adapter_T for the + * ACE_Null_Mutex. */ template<> class ACE_Export ACE_Malloc_Lock_Adapter_T @@ -229,4 +228,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NULL_MUTEX_H */ - diff --git a/dep/include/ace/Null_Semaphore.h b/externals/ace/Null_Semaphore.h similarity index 99% rename from dep/include/ace/Null_Semaphore.h rename to externals/ace/Null_Semaphore.h index 4b8112876f6..d7a48cce4d1 100644 --- a/dep/include/ace/Null_Semaphore.h +++ b/externals/ace/Null_Semaphore.h @@ -103,4 +103,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NULL_SEMAPHORE_H */ - diff --git a/dep/include/ace/Numeric_Limits.h b/externals/ace/Numeric_Limits.h similarity index 98% rename from dep/include/ace/Numeric_Limits.h rename to externals/ace/Numeric_Limits.h index 29de41db76b..0a1d5f2e8c3 100644 --- a/dep/include/ace/Numeric_Limits.h +++ b/externals/ace/Numeric_Limits.h @@ -4,7 +4,7 @@ /** * @file Numeric_Limits.h * - * $Id: Numeric_Limits.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Numeric_Limits.h 85057 2009-04-08 10:59:58Z msmit $ * * Traits containing basic integer limits. Useful for template-based * code on platforms that lack @c std::numeric_limits<>. @@ -37,7 +37,7 @@ # include "ace/Basic_Types.h" #else -# ifdef __MINGW32__ +# if defined __MINGW32__ // Windows defines min/max macros that interfere with the // numeric_limits::min/max() traits. Undefine those macros before // including . @@ -71,6 +71,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL template struct ACE_Numeric_Limits; + // ------------------------------------------ // Special cases. template<> @@ -267,4 +268,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_NUMERIC_LIMITS_H */ - diff --git a/dep/src/ace/OS.cpp b/externals/ace/OS.cpp similarity index 99% rename from dep/src/ace/OS.cpp rename to externals/ace/OS.cpp index ed4c108089f..0fd57bdd5e7 100644 --- a/dep/src/ace/OS.cpp +++ b/externals/ace/OS.cpp @@ -51,4 +51,3 @@ ACE_RCSID(ace, OS, "$Id: OS.cpp 80826 2008-03-04 14:51:23Z wotte $") #include "ace/OS_NS_time.cpp" #include "ace/OS_NS_unistd.cpp" #include "ace/OS_NS_wchar.cpp" - diff --git a/dep/include/ace/OS.h b/externals/ace/OS.h similarity index 99% rename from dep/include/ace/OS.h rename to externals/ace/OS.h index bc5fe2f3760..ec6c4ef9eb9 100644 --- a/dep/include/ace/OS.h +++ b/externals/ace/OS.h @@ -109,6 +109,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include "ace/os_include/os_unistd.h" #include "ace/os_include/sys/os_wait.h" + // This needs to go here *first* to avoid problems with AIX. # if defined (ACE_HAS_PTHREADS) # include "ace/os_include/os_pthread.h" @@ -279,6 +280,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include "ace/os_include/os_syslog.h" # endif /* !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SYSLOG) */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -325,4 +327,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_H */ - diff --git a/dep/include/ace/OS.inl b/externals/ace/OS.inl similarity index 81% rename from dep/include/ace/OS.inl rename to externals/ace/OS.inl index 1dafebc2543..852542b5ada 100644 --- a/dep/include/ace/OS.inl +++ b/externals/ace/OS.inl @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: OS.inl 81697 2008-05-14 18:33:11Z johnnyw $ +// $Id: OS.inl 87244 2009-10-27 20:15:48Z olli $ #if !defined (ACE_HAS_INLINED_OSCALLS) # undef ACE_INLINE @@ -41,18 +41,6 @@ using std::strftime; #if !defined (ACE_WIN32) -// Matthew Stevens 7-10-95 Fix GNU GCC 2.7 for memchr() problem. -# if defined (ACE_HAS_GNU_CSTRING_H) -// Define this file to keep /usr/include/memory.h from being included. -# include /**/ -# else -# if defined (ACE_LACKS_MEMORY_H) -# include "ace/os_include/os_string.h" -# else -# include /**/ -# endif /* ACE_LACKS_MEMORY_H */ -# endif /* ACE_HAS_GNU_CSTRING_H */ - // The following are #defines and #includes that must be visible for // ACE to compile it's OS wrapper class implementation correctly. We // put them inside of here to reduce compiler overhead if we're not @@ -82,6 +70,7 @@ using std::strftime; # endif # endif /* ACE_HAS_GETIFADDRS */ + #endif /* WIN32 */ #if defined (ACE_HAS_SHM_OPEN) && defined(INTEGRITY) @@ -89,4 +78,3 @@ using std::strftime; #endif // **************************************************************** - diff --git a/dep/include/ace/OS_Dirent.h b/externals/ace/OS_Dirent.h similarity index 99% rename from dep/include/ace/OS_Dirent.h rename to externals/ace/OS_Dirent.h index e9c0984390c..d05dc170991 100644 --- a/dep/include/ace/OS_Dirent.h +++ b/externals/ace/OS_Dirent.h @@ -30,4 +30,3 @@ #include /**/ "ace/post.h" #endif /* ACE_OS_DIRENT_H */ - diff --git a/dep/src/ace/OS_Errno.cpp b/externals/ace/OS_Errno.cpp similarity index 99% rename from dep/src/ace/OS_Errno.cpp rename to externals/ace/OS_Errno.cpp index 1e1eab82218..15bdbcf2734 100644 --- a/dep/src/ace/OS_Errno.cpp +++ b/externals/ace/OS_Errno.cpp @@ -45,4 +45,3 @@ ACE_CE_Errno::fini () ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ - diff --git a/dep/include/ace/OS_Errno.h b/externals/ace/OS_Errno.h similarity index 88% rename from dep/include/ace/OS_Errno.h rename to externals/ace/OS_Errno.h index 41e33692cb9..bda24ad0a90 100644 --- a/dep/include/ace/OS_Errno.h +++ b/externals/ace/OS_Errno.h @@ -4,7 +4,7 @@ /** * @file OS_Errno.h * - * $Id: OS_Errno.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_Errno.h 83891 2008-11-28 11:01:50Z johnnyw $ * * @author (Originally in OS.h)Doug Schmidt */ @@ -46,20 +46,19 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Errno_Guard { public: - /// Stash the value of into and initialize the - /// to the address of . + /// Stash the value of @a error into @c error_ and initialize the + /// @c errno_ptr_ to the address of @a errno_ref. ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref, int error); - /// Stash the value of @c errno into and initialize the - /// to the address of . + /// Initialize the @c errno_ptr_ to the address of @a errno_ref. ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref); /// Reset the value of @c errno to . ~ACE_Errno_Guard (void); #if defined (ACE_HAS_WINCE_BROKEN_ERRNO) - /// Assign to . + /// Assign @a errno_ref to . int operator= (const ACE_ERRNO_TYPE &errno_ref); #endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ @@ -99,4 +98,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_ERRNO_H */ - diff --git a/dep/include/ace/OS_Errno.inl b/externals/ace/OS_Errno.inl similarity index 100% rename from dep/include/ace/OS_Errno.inl rename to externals/ace/OS_Errno.inl diff --git a/dep/src/ace/OS_Log_Msg_Attributes.cpp b/externals/ace/OS_Log_Msg_Attributes.cpp similarity index 99% rename from dep/src/ace/OS_Log_Msg_Attributes.cpp rename to externals/ace/OS_Log_Msg_Attributes.cpp index 227ead2726c..ead88768017 100644 --- a/dep/src/ace/OS_Log_Msg_Attributes.cpp +++ b/externals/ace/OS_Log_Msg_Attributes.cpp @@ -7,4 +7,3 @@ #endif /* ACE_HAS_INLINED_OSCALLS */ ACE_RCSID(ace, OS_Log_Msg_Attributes, "$Id: OS_Log_Msg_Attributes.cpp 80826 2008-03-04 14:51:23Z wotte $") - diff --git a/dep/include/ace/OS_Log_Msg_Attributes.h b/externals/ace/OS_Log_Msg_Attributes.h similarity index 95% rename from dep/include/ace/OS_Log_Msg_Attributes.h rename to externals/ace/OS_Log_Msg_Attributes.h index ff6bc1180c2..6a1688260ba 100644 --- a/dep/include/ace/OS_Log_Msg_Attributes.h +++ b/externals/ace/OS_Log_Msg_Attributes.h @@ -4,7 +4,7 @@ /** * @file OS_Log_Msg_Attributes.h * - * $Id: OS_Log_Msg_Attributes.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_Log_Msg_Attributes.h 83729 2008-11-13 15:32:36Z mitza $ * * @author Carlos O'Ryan */ @@ -50,6 +50,7 @@ protected: /// Ostream where the new TSS Log_Msg will use. ACE_OSTREAM_TYPE *ostream_; + void *ostream_refcount_; /// Priority_mask to be used in new TSS Log_Msg. unsigned long priority_mask_; @@ -59,7 +60,7 @@ protected: /// Indicates whether we should restart system calls that are /// interrupted. - int restart_; + bool restart_; /// Depth of the nesting for printing traces. int trace_depth_; @@ -88,4 +89,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_LOG_MSG_ATTRIBUTES_H */ - diff --git a/externals/ace/OS_Log_Msg_Attributes.inl b/externals/ace/OS_Log_Msg_Attributes.inl new file mode 100644 index 00000000000..df575b497d0 --- /dev/null +++ b/externals/ace/OS_Log_Msg_Attributes.inl @@ -0,0 +1,22 @@ +// -*- C++ -*- +// +// $Id: OS_Log_Msg_Attributes.inl 84184 2009-01-19 10:18:31Z johnnyw $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE +ACE_OS_Log_Msg_Attributes::ACE_OS_Log_Msg_Attributes (void) : + ostream_ (0), + ostream_refcount_ (0), + priority_mask_ (0), + tracing_enabled_ (0), + restart_ (true), + trace_depth_ (0) +# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , seh_except_selector_ (0), + seh_except_handler_ (0) +# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ +{ +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/include/ace/OS_Memory.h b/externals/ace/OS_Memory.h similarity index 95% rename from dep/include/ace/OS_Memory.h rename to externals/ace/OS_Memory.h index 60590c02159..7a5d94afb3e 100644 --- a/dep/include/ace/OS_Memory.h +++ b/externals/ace/OS_Memory.h @@ -4,7 +4,7 @@ /** * @file OS_Memory.h * - * $Id: OS_Memory.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_Memory.h 86400 2009-08-06 13:52:28Z schmidt $ * * @author Doug Schmidt * @author Jesper S. M|ller @@ -231,9 +231,15 @@ ACE_END_VERSIONED_NAMESPACE_DECL if (POINTER == 0) { errno = ENOMEM; } \ } while (0) -# define ACE_throw_bad_alloc \ - void* gcc_will_complain_if_literal_0_is_returned = 0; \ - return gcc_will_complain_if_literal_0_is_returned +# if !defined (ACE_bad_alloc) + class ACE_bad_alloc_class {}; +# define ACE_bad_alloc ACE_bad_alloc_class +# endif +# if defined (ACE_HAS_MFC) && (ACE_HAS_MFC == 1) +# define ACE_throw_bad_alloc AfxThrowMemoryException () +# else +# define ACE_throw_bad_alloc return 0 +# endif #endif /* ACE_NEW_THROWS_EXCEPTIONS */ @@ -260,7 +266,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * * ~(alignment - 1) = 1...110...0 = T2 * - * Notice that there is a multiple of in the range + * Notice that there is a multiple of @a alignment in the range * [, + T1], also notice that if * * X = ( + T1 ) & T2 @@ -270,7 +276,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL * <= X <= + T1 * * because the & operator only changes the last bits, and since X is a - * multiple of (its last bits are zero) we have found the + * multiple of @a alignment (its last bits are zero) we have found the * multiple we wanted. */ /// Return the next integer aligned to a required boundary @@ -336,4 +342,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_MEMORY_H */ - diff --git a/dep/src/ace/OS_NS_Thread.cpp b/externals/ace/OS_NS_Thread.cpp similarity index 96% rename from dep/src/ace/OS_NS_Thread.cpp rename to externals/ace/OS_NS_Thread.cpp index 16a19501f82..441d69ebb56 100644 --- a/dep/src/ace/OS_NS_Thread.cpp +++ b/externals/ace/OS_NS_Thread.cpp @@ -2,7 +2,7 @@ ACE_RCSID (ace, OS_NS_Thread, - "$Id: OS_NS_Thread.cpp 81345 2008-04-13 07:28:11Z johnnyw $") + "$Id: OS_NS_Thread.cpp 90144 2010-05-14 22:23:14Z mitza $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_Thread.inl" @@ -29,12 +29,13 @@ ACE_MUTEX_LOCK_CLEANUP_ADAPTER_NAME (void *args) ACE_VERSIONED_NAMESPACE_NAME::ACE_OS::mutex_lock_cleanup (args); } + #if !defined(ACE_WIN32) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) # define ACE_BEGINTHREADEX(STACK, STACKSIZE, ENTRY_POINT, ARGS, FLAGS, THR_ID) \ (*THR_ID = ::_beginthreadex ((void(_Optlink*)(void*))ENTRY_POINT, STACK, STACKSIZE, ARGS), *THR_ID) -#elif defined (ACE_HAS_WINCE) && defined (UNDER_CE) && (UNDER_CE >= 211) +#elif defined (ACE_HAS_WINCE) # define ACE_BEGINTHREADEX(STACK, STACKSIZE, ENTRY_POINT, ARGS, FLAGS, THR_ID) \ - CreateThread (0, STACKSIZE, (unsigned long (__stdcall *) (void *)) ENTRY_POINT, ARGS, (FLAGS) & CREATE_SUSPENDED, (unsigned long *) THR_ID) + CreateThread (0, STACKSIZE, (unsigned long (__stdcall *) (void *)) ENTRY_POINT, ARGS, (FLAGS) & (CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION), (unsigned long *) THR_ID) #elif defined(ACE_HAS_WTHREADS) // Green Hills compiler gets confused when __stdcall is imbedded in // parameter list, so we define the type ACE_WIN32THRFUNC_T and use it @@ -116,17 +117,15 @@ ACE_OS_thread_key_t ACE_TSS_Emulation::native_tss_key_; # if defined (ACE_HAS_THR_C_FUNC) extern "C" void -ACE_TSS_Emulation_cleanup (void *ptr) +ACE_TSS_Emulation_cleanup (void *) { - ACE_UNUSED_ARG (ptr); // Really this must be used for ACE_TSS_Emulation code to make the TSS // cleanup } # else void -ACE_TSS_Emulation_cleanup (void *ptr) +ACE_TSS_Emulation_cleanup (void *) { - ACE_UNUSED_ARG (ptr); // Really this must be used for ACE_TSS_Emulation code to make the TSS // cleanup } @@ -244,7 +243,7 @@ ACE_TSS_Emulation::next_key (ACE_thread_key_t &key) { u_int counter = 0; // Loop through all possible keys and check whether a key is free - for (; counter < ACE_TSS_THREAD_KEYS_MAX; counter++) + for ( ;counter < ACE_TSS_THREAD_KEYS_MAX; counter++) { ACE_thread_key_t localkey; # if defined (ACE_HAS_NONSCALAR_THREAD_KEY_T) @@ -599,6 +598,7 @@ private: ACE_thread_key_t in_use_; }; + /*****************************************************************************/ /** * @class TSS_Cleanup_Instance @@ -1140,25 +1140,6 @@ ACE_OS::cleanup_tss (const u_int main_thread) /*****************************************************************************/ #if defined (ACE_LACKS_COND_T) -// NOTE: The ACE_OS::cond_* functions for some non-Unix platforms are -// defined here either because they're too big to be inlined, or -// to avoid use before definition if they were inline. - -// @@ The following functions could be inlined if i could figure where -// to put it among the #ifdefs! -int -ACE_OS::condattr_init (ACE_condattr_t &attributes, int type) -{ - attributes.type = type; - return 0; -} - -int -ACE_OS::condattr_destroy (ACE_condattr_t &) -{ - return 0; -} - int ACE_OS::cond_broadcast (ACE_cond_t *cv) { @@ -1169,7 +1150,7 @@ ACE_OS::cond_broadcast (ACE_cond_t *cv) // This is needed to ensure that and are // consistent relative to each other. ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - int have_waiters = 0; + bool have_waiters = false; if (cv->waiters_ > 0) { @@ -1178,7 +1159,7 @@ ACE_OS::cond_broadcast (ACE_cond_t *cv) // cond_wait() method know how to optimize itself. Be sure to // set this with the held. cv->was_broadcast_ = 1; - have_waiters = 1; + have_waiters = true; } ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); int result = 0; @@ -1316,10 +1297,10 @@ ACE_OS::cond_signal (ACE_cond_t *cv) // value is not in an inconsistent internal state while being // updated by another thread. ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - int have_waiters = cv->waiters_ > 0; + bool const have_waiters = cv->waiters_ > 0; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); - if (have_waiters != 0) + if (have_waiters) return ACE_OS::sema_post (&cv->sema_); else return 0; // No-op @@ -1370,7 +1351,7 @@ ACE_OS::cond_wait (ACE_cond_t *cv, // We're ready to return, so there's one less waiter. --cv->waiters_; - int last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; + bool const last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; // Release the lock so that other collaborating threads can make // progress. @@ -1437,16 +1418,14 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // Prevent race conditions on the count. ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - cv->waiters_++; + ++cv->waiters_; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); int result = 0; ACE_Errno_Guard error (errno, 0); - int msec_timeout; + int msec_timeout = 0; - if (timeout->sec () == 0 && timeout->usec () == 0) - msec_timeout = 0; // Do a "poll." - else + if (timeout != 0 && *timeout != ACE_Time_Value::zero) { // Note that we must convert between absolute time (which is // passed as a parameter) and relative time (which is what @@ -1455,9 +1434,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // Watchout for situations where a context switch has caused the // current time to be > the timeout. - if (relative_time < ACE_Time_Value::zero) - msec_timeout = 0; - else + if (relative_time > ACE_Time_Value::zero) msec_timeout = relative_time.msec (); } @@ -1500,9 +1477,9 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // Reacquire lock to avoid race conditions. ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - cv->waiters_--; + --cv->waiters_; - int last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; + bool const last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); @@ -1585,8 +1562,22 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_THREADS */ } +#else +int +ACE_OS::cond_init (ACE_cond_t *cv, short type, const char *name, void *arg) +{ + ACE_condattr_t attributes; + if (ACE_OS::condattr_init (attributes, type) == 0 + && ACE_OS::cond_init (cv, attributes, name, arg) == 0) + { + (void) ACE_OS::condattr_destroy (attributes); + return 0; + } + return -1; +} +#endif /* ACE_LACKS_COND_T */ -# if defined (ACE_HAS_WTHREADS) +#if defined (ACE_WIN32) && defined (ACE_HAS_WTHREADS) int ACE_OS::cond_timedwait (ACE_cond_t *cv, ACE_thread_mutex_t *external_mutex, @@ -1598,18 +1589,31 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, if (timeout == 0) return ACE_OS::cond_wait (cv, external_mutex); +# if defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + int msec_timeout = 0; + int result = 0; + + ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ()); + // Watchout for situations where a context switch has caused the + // current time to be > the timeout. + if (relative_time > ACE_Time_Value::zero) + msec_timeout = relative_time.msec (); + + ACE_OSCALL (ACE_ADAPT_RETVAL (::SleepConditionVariableCS (cv, external_mutex, msec_timeout), + result), + int, -1, result); + return result; +#else // Prevent race conditions on the count. ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - cv->waiters_++; + ++cv->waiters_; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); int result = 0; int error = 0; - int msec_timeout; + int msec_timeout = 0; - if (timeout->sec () == 0 && timeout->usec () == 0) - msec_timeout = 0; // Do a "poll." - else + if (timeout != 0 && *timeout != ACE_Time_Value::zero) { // Note that we must convert between absolute time (which is // passed as a parameter) and relative time (which is what @@ -1618,9 +1622,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // Watchout for situations where a context switch has caused the // current time to be > the timeout. - if (relative_time < ACE_Time_Value::zero) - msec_timeout = 0; - else + if (relative_time > ACE_Time_Value::zero) msec_timeout = relative_time.msec (); } @@ -1646,9 +1648,9 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, // Reacquire lock to avoid race conditions. ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - cv->waiters_--; + --cv->waiters_; - int last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; + bool const last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); @@ -1675,6 +1677,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, ACE_OS::thread_mutex_lock (external_mutex); errno = error; return result; +# endif # else ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_THREADS */ @@ -1686,8 +1689,13 @@ ACE_OS::cond_wait (ACE_cond_t *cv, { ACE_OS_TRACE ("ACE_OS::cond_wait"); # if defined (ACE_HAS_THREADS) +# if defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + int result; + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::SleepConditionVariableCS (cv, external_mutex, INFINITE), result), + int, -1); +#else ACE_OS::thread_mutex_lock (&cv->waiters_lock_); - cv->waiters_++; + ++cv->waiters_; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); int result = 0; @@ -1718,7 +1726,7 @@ ACE_OS::cond_wait (ACE_cond_t *cv, cv->waiters_--; - int last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; + bool const last_waiter = cv->was_broadcast_ && cv->waiters_ == 0; ACE_OS::thread_mutex_unlock (&cv->waiters_lock_); @@ -1745,25 +1753,12 @@ ACE_OS::cond_wait (ACE_cond_t *cv, // Reset errno in case mutex_lock() also fails... errno = error; return result; +#endif # else ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_THREADS */ } # endif /* ACE_HAS_WTHREADS */ -#else -int -ACE_OS::cond_init (ACE_cond_t *cv, short type, const char *name, void *arg) -{ - ACE_condattr_t attributes; - if (ACE_OS::condattr_init (attributes, type) == 0 - && ACE_OS::cond_init (cv, attributes, name, arg) == 0) - { - (void) ACE_OS::condattr_destroy (attributes); - return 0; - } - return -1; -} -#endif /* ACE_LACKS_COND_T */ /*****************************************************************************/ // CONDITIONS END @@ -1787,7 +1782,7 @@ ACE_OS::mutex_init (ACE_mutex_t *m, ACE_UNUSED_ARG (name); ACE_UNUSED_ARG (sa); -# if defined (ACE_VXWORKS) && (ACE_VXWORKS >= 0x600) && (ACE_VXWORKS <= 0x620) +# if defined (ACE_PTHREAD_MUTEXATTR_T_INITIALIZE) /* Tests show that VxWorks 6.x pthread lib does not only * require zeroing of mutex/condition objects to function correctly * but also of the attribute objects. @@ -1837,7 +1832,7 @@ ACE_OS::mutex_init (ACE_mutex_t *m, if (result == 0) { -# if defined (ACE_VXWORKS)&& (ACE_VXWORKS >= 0x600) && (ACE_VXWORKS <= 0x620) +# if defined (ACE_PTHREAD_MUTEX_T_INITIALIZE) /* VxWorks 6.x API reference states: * If the memory for the mutex variable object has been allocated * dynamically, it is a good policy to always zero out the @@ -1895,7 +1890,7 @@ ACE_OS::mutex_init (ACE_mutex_t *m, ACE_FAIL_RETURN (-1); else { - // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. + // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. ACE_OS::set_errno_to_last_error (); return 0; } @@ -1988,7 +1983,11 @@ ACE_OS::mutex_init (ACE_mutex_t *m, if (m->proc_mutex_ == 0) ACE_FAIL_RETURN (-1); else - return 0; + { + // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. + ACE_OS::set_errno_to_last_error (); + return 0; + } case USYNC_THREAD: return ACE_OS::thread_mutex_init (&m->thr_mutex_, lock_type, @@ -2501,7 +2500,11 @@ ACE_OS::event_init (ACE_event_t *event, if (*event == 0) ACE_FAIL_RETURN (-1); else - return 0; + { + // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. + ACE_OS::set_errno_to_last_error (); + return 0; + } #elif defined (ACE_HAS_THREADS) ACE_UNUSED_ARG (sa); event->eventdata_ = 0; @@ -2767,7 +2770,7 @@ ACE_OS::event_pulse (ACE_event_t *event) event->eventdata_->signal_count_ = event->eventdata_->waiting_threads_; # else event->eventdata_->signal_count_ = event->eventdata_->waiting_threads_; - for (unsigned long i=0; ieventdata_->signal_count_ ; ++i) + for (unsigned long i=0; ieventdata_->signal_count_ ;++i) if (ACE_OS::sema_post(&event->semaphore_) != 0) { event->eventdata_->signal_count_ = 0; @@ -2966,7 +2969,7 @@ ACE_OS::event_timedwait (ACE_event_t *event, #if defined (ACE_WIN32) DWORD result; - if (timeout->sec () == 0 && timeout->usec () == 0) + if (*timeout == ACE_Time_Value::zero) // Do a "poll". result = ::WaitForSingleObject (*event, 0); else @@ -2977,7 +2980,7 @@ ACE_OS::event_timedwait (ACE_event_t *event, // WaitForSingleObjects() expects). // parameter is given in absolute or relative value // depending on parameter . - int msec_timeout; + int msec_timeout = 0; if (use_absolute_time) { // Time is given in absolute time, we should use @@ -2987,9 +2990,7 @@ ACE_OS::event_timedwait (ACE_event_t *event, // Watchout for situations where a context switch has caused // the current time to be > the timeout. Thanks to Norbert // Rapp for pointing this. - if (relative_time < ACE_Time_Value::zero) - msec_timeout = 0; - else + if (relative_time > ACE_Time_Value::zero) msec_timeout = relative_time.msec (); } else @@ -3420,7 +3421,7 @@ ACE_OS::rwlock_init (ACE_rwlock_t *rw, rw->ref_count_ = 0; rw->num_waiting_writers_ = 0; rw->num_waiting_readers_ = 0; - rw->important_writer_ = 0; + rw->important_writer_ = false; result = 0; } ACE_OS::condattr_destroy (attributes); @@ -3824,7 +3825,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func, # if defined (ACE_HAS_PTHREADS) int result; -# if defined (ACE_VXWORKS) && (ACE_VXWORKS >= 0x600) && (ACE_VXWORKS <= 0x620) +# if defined (ACE_PTHREAD_ATTR_T_INITIALIZE) /* Tests show that VxWorks 6.x pthread lib does not only * require zeroing of mutex/condition objects to function correctly * but also of the attribute objects. @@ -4316,10 +4317,15 @@ ACE_OS::thr_create (ACE_THR_FUNC func, // Set the priority of the new thread and then let it // continue, but only if the user didn't start it suspended // in the first place! - ACE_OS::thr_setprio (*thr_handle, priority); + if (ACE_OS::thr_setprio (*thr_handle, priority) != 0) + { + return -1; + } if (start_suspended == 0) - ACE_OS::thr_continue (*thr_handle); + { + ACE_OS::thr_continue (*thr_handle); + } } } # if 0 @@ -4622,6 +4628,14 @@ ACE_OS::thr_get_affinity (ACE_hthread_t thr_id, return -1; } return 0; +#elif defined (ACE_HAS_TASKCPUAFFINITYSET) + ACE_UNUSED_ARG (cpu_set_size); + int result = 0; + if (ACE_ADAPT_RETVAL (::taskCpuAffinitySet (thr_id, *cpu_mask), result) == -1) + { + return -1; + } + return 0; #else ACE_UNUSED_ARG (thr_id); ACE_UNUSED_ARG (cpu_set_size); @@ -4664,6 +4678,13 @@ ACE_OS::thr_set_affinity (ACE_hthread_t thr_id, return -1; } return 0; +#elif defined (ACE_HAS_TASKCPUAFFINITYSET) + int result = 0; + if (ACE_ADAPT_RETVAL (::taskCpuAffinitySet (thr_id, *cpu_mask), result) == -1) + { + return -1; + } + return 0; #else ACE_UNUSED_ARG (thr_id); ACE_UNUSED_ARG (cpu_set_size); @@ -5119,59 +5140,62 @@ add_to_argv (int& argc, char** argv, int max_args, char* string) size_t previous = 0; size_t length = ACE_OS::strlen (string); - // We use <= to make sure that we get the last argument - for (size_t i = 0; i <= length; i++) + if (length > 0) { - // Is it a double quote that hasn't been escaped? - if (string[i] == '\"' && (i == 0 || string[i - 1] != '\\')) + // We use <= to make sure that we get the last argument + for (size_t i = 0; i <= length; i++) { - indouble ^= 1; - if (indouble) + // Is it a double quote that hasn't been escaped? + if (string[i] == '\"' && (i == 0 || string[i - 1] != '\\')) { - // We have just entered a double quoted string, so - // save the starting position of the contents. - previous = i + 1; + indouble ^= 1; + if (indouble) + { + // We have just entered a double quoted string, so + // save the starting position of the contents. + previous = i + 1; + } + else + { + // We have just left a double quoted string, so + // zero out the ending double quote. + string[i] = '\0'; + } } - else + else if (string[i] == '\\') // Escape the next character + { + // The next character is automatically skipped because + // of the memmove(). + ACE_OS::memmove (string + i, string + i + 1, length); + --length; + } + else if (!indouble && + (ACE_OS::ace_isspace (string[i]) || string[i] == '\0')) { - // We have just left a double quoted string, so - // zero out the ending double quote. string[i] = '\0'; - } - } - else if (string[i] == '\\') // Escape the next character - { - // The next character is automatically - // skipped because of the strcpy - ACE_OS::strcpy (string + i, string + i + 1); - length--; - } - else if (!indouble && - (ACE_OS::ace_isspace (string[i]) || string[i] == '\0')) - { - string[i] = '\0'; - if (argc < max_args) - { - argv[argc] = string + previous; - argc++; - } - else - { - ACE_OS::fprintf (stderr, "spae(): number of arguments " - "limited to %d\n", max_args); - } + if (argc < max_args) + { + argv[argc] = string + previous; + ++argc; + } + else + { + ACE_OS::fprintf (stderr, "spae(): number of arguments " + "limited to %d\n", max_args); + } - // Skip over whitespace in between arguments - for (++i; i < length && ACE_OS::ace_isspace (string[i]); ++i) - { + // Skip over whitespace in between arguments + for(++i; i < length && ACE_OS::ace_isspace (string[i]); ++i) + { + } + + // Save the starting point for the next time around + previous = i; + + // Make sure we don't skip over a character due + // to the above loop to skip over whitespace + --i; } - - // Save the starting point for the next time around - previous = i; - - // Make sure we don't skip over a character due - // to the above loop to skip over whitespace - i--; } } } @@ -5297,9 +5321,10 @@ vx_execae (FUNCPTR entry, char* arg, int prio, int opt, int stacksz, ...) int argc = 1; // Peel off arguments to run_main () and put into argv. - if (arg) - add_to_argv(argc, argv, ACE_MAX_ARGS, arg); + { + add_to_argv(argc, argv, ACE_MAX_ARGS, arg); + } // fill unused argv slots with 0 to get rid of leftovers // from previous invocations @@ -5328,5 +5353,18 @@ vx_execae (FUNCPTR entry, char* arg, int prio, int opt, int stacksz, ...) // successful return ret > 0 ? _vx_call_rc : 255; } -#endif /* ACE_VXWORKS && !__RTP__ */ +#if defined(ACE_AS_STATIC_LIBS) && defined (ACE_VXWORKS_DEBUGGING_HELPER) +/** Wind River workbench allows the user to spawn a kernel task as a + "Debug Configuration". Use this function as the entrypoint so that + the arguments are translated into the form that ace_main() requires. + */ +int ace_wb_exec (int arg0, int arg1, int arg2, int arg3, int arg4, + int arg5, int arg6, int arg7, int arg8, int arg9) +{ + return spaef ((FUNCPTR) ace_main, arg0, arg1, arg2, arg3, arg4, + arg5, arg6, arg7, arg8, arg9); +} +#endif /* ACE_AS_STATIC_LIBS && ... */ + +#endif /* ACE_VXWORKS && !__RTP__ */ diff --git a/dep/include/ace/OS_NS_Thread.h b/externals/ace/OS_NS_Thread.h similarity index 98% rename from dep/include/ace/OS_NS_Thread.h rename to externals/ace/OS_NS_Thread.h index 151f0a7c1a1..468b4f60b09 100644 --- a/dep/include/ace/OS_NS_Thread.h +++ b/externals/ace/OS_NS_Thread.h @@ -4,7 +4,7 @@ /** * @file OS_NS_Thread.h * - * $Id: OS_NS_Thread.h 81014 2008-03-19 11:41:31Z johnnyw $ + * $Id: OS_NS_Thread.h 85547 2009-06-07 17:57:11Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -304,6 +304,9 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define THR_DAEMON 0 /* ignore in most places */ # define THR_JOINABLE 0 /* ignore in most places */ # define THR_SUSPENDED CREATE_SUSPENDED +# if !defined (STACK_SIZE_PARAM_IS_A_RESERVATION) +# define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000 +# endif /* STACK_SIZE_PARAM_IS_A_RESERVATION */ # define THR_USE_AFX 0x01000000 # define THR_SCHED_FIFO 0 # define THR_SCHED_RR 0 @@ -314,7 +317,11 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define THR_SCOPE_SYSTEM 0 # endif /* ACE_HAS_PTHREADS / STHREADS / VXWORKS / WTHREADS **********/ -# if defined (ACE_LACKS_COND_T) +# if defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + +typedef CONDITION_VARIABLE ACE_cond_t; + +# elif defined (ACE_LACKS_COND_T) ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -366,6 +373,14 @@ public: size_t was_broadcast_; }; +ACE_END_VERSIONED_NAMESPACE_DECL + +# endif /* ACE_LACKS_COND_T */ + +# if defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) || defined (ACE_LACKS_COND_T) + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + struct ACE_Export ACE_condattr_t { int type; @@ -378,7 +393,7 @@ struct ACE_Export ACE_mutexattr_t ACE_END_VERSIONED_NAMESPACE_DECL -# endif /* ACE_LACKS_COND_T */ +# endif /* ACE_HAS_WTHREADS_CONDITION_VARIABLE || ACE_LACKS_COND_T */ # if defined (ACE_LACKS_RWLOCK_T) && !defined (ACE_HAS_PTHREADS_UNIX98_EXT) @@ -418,7 +433,7 @@ public: int ref_count_; /// Indicate that a reader is trying to upgrade - int important_writer_; + bool important_writer_; /// Condition for the upgrading reader ACE_cond_t waiting_important_writer_; @@ -1019,6 +1034,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define ACE_MUTEX_LOCK_CLEANUP_ADAPTER_NAME ACE_PREPROC_CONCATENATE(ACE_VERSIONED_NAMESPACE_NAME, _ace_mutex_lock_cleanup_adapter) #endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ + # if defined (ACE_HAS_THR_C_FUNC) // This is necessary to work around nasty problems with MVS C++. extern "C" ACE_Export void ACE_MUTEX_LOCK_CLEANUP_ADAPTER_NAME (void *args); @@ -1071,19 +1087,11 @@ namespace ACE_OS { void cleanup_tss (const u_int main_thread); //@{ @name A set of wrappers for condition variables. -#if defined (ACE_LACKS_COND_T) - extern ACE_Export -#else ACE_NAMESPACE_INLINE_FUNCTION -#endif /* ACE_LACKS_COND_T */ int condattr_init (ACE_condattr_t &attributes, int type = ACE_DEFAULT_SYNCH_TYPE); -#if defined (ACE_LACKS_COND_T) - extern ACE_Export -#else ACE_NAMESPACE_INLINE_FUNCTION -#endif /* ACE_LACKS_COND_T */ int condattr_destroy (ACE_condattr_t &attributes); #if defined (ACE_LACKS_COND_T) @@ -1152,7 +1160,7 @@ namespace ACE_OS { #endif /* ACE_LACKS_COND_T */ int cond_timedwait (ACE_cond_t *cv, ACE_mutex_t *m, - ACE_Time_Value *); + ACE_Time_Value *timeout); #if defined (ACE_LACKS_COND_T) extern ACE_Export @@ -1163,20 +1171,12 @@ namespace ACE_OS { ACE_mutex_t *m); # if defined (ACE_WIN32) && defined (ACE_HAS_WTHREADS) -# if defined (ACE_LACKS_COND_T) extern ACE_Export -# else - ACE_NAMESPACE_INLINE_FUNCTION -# endif /* ACE_LACKS_COND_T */ int cond_timedwait (ACE_cond_t *cv, ACE_thread_mutex_t *m, - ACE_Time_Value *); + ACE_Time_Value *timeout); -# if defined (ACE_LACKS_COND_T) extern ACE_Export -# else - ACE_NAMESPACE_INLINE_FUNCTION -# endif /* ACE_LACKS_COND_T */ int cond_wait (ACE_cond_t *cv, ACE_thread_mutex_t *m); # endif /* ACE_WIN32 && ACE_HAS_WTHREADS */ @@ -1231,6 +1231,7 @@ namespace ACE_OS { extern ACE_Export int lwp_setparams (const ACE_Sched_Params &); + //@{ @name A set of wrappers for mutex locks. extern ACE_Export @@ -1316,7 +1317,7 @@ namespace ACE_OS { //@} - /// Low-level interface to (2). + /// Low-level interface to @c priocntl(2). /** * Can't call the following priocntl, because that's a macro on * Solaris. @@ -1365,6 +1366,7 @@ namespace ACE_OS { //@} + //@{ @name A set of wrappers for readers/writer locks. ACE_NAMESPACE_INLINE_FUNCTION @@ -1472,7 +1474,7 @@ namespace ACE_OS { size_t nsops); //@} - /// Friendly interface to (2). + /// Friendly interface to @c priocntl(2). extern ACE_Export int set_scheduling_params (const ACE_Sched_Params &, ACE_id_t id = ACE_SELF); @@ -1611,6 +1613,7 @@ namespace ACE_OS { size_t cpu_set_size, cpu_set_t * cpu_mask); + /** * Set the thread affinity * @@ -2019,4 +2022,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_THREAD_H */ - diff --git a/dep/include/ace/OS_NS_Thread.inl b/externals/ace/OS_NS_Thread.inl similarity index 96% rename from dep/include/ace/OS_NS_Thread.inl rename to externals/ace/OS_NS_Thread.inl index 0c61edd3ec7..b82683f5ab4 100644 --- a/dep/include/ace/OS_NS_Thread.inl +++ b/externals/ace/OS_NS_Thread.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_Thread.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_Thread.inl 87220 2009-10-24 12:20:03Z olli $ #include "ace/OS_NS_macros.h" // for timespec_t, perhaps move it to os_time.h @@ -121,24 +121,15 @@ ACE_OS::thr_equal (ACE_thread_t t1, ACE_thread_t t2) #endif /* ACE_HAS_PTHREADS */ } -#if !defined (ACE_LACKS_COND_T) -// NOTE: The ACE_OS::cond_* functions for Unix platforms are defined -// here because the ACE_OS::sema_* functions below need them. -// However, ACE_WIN32 and VXWORKS define the ACE_OS::cond_* functions -// using the ACE_OS::sema_* functions. So, they are defined in OS.cpp. - ACE_INLINE int ACE_OS::condattr_destroy (ACE_condattr_t &attributes) { #if defined (ACE_HAS_THREADS) # if defined (ACE_HAS_PTHREADS) - pthread_condattr_destroy (&attributes); - -# elif defined (ACE_HAS_STHREADS) +# else attributes.type = 0; - -# endif /* ACE_HAS_PTHREADS vs. ACE_HAS_STHREADS */ +# endif /* ACE_HAS_PTHREADS */ return 0; # else ACE_UNUSED_ARG (attributes); @@ -147,15 +138,14 @@ ACE_OS::condattr_destroy (ACE_condattr_t &attributes) } ACE_INLINE int -ACE_OS::condattr_init (ACE_condattr_t &attributes, - int type) +ACE_OS::condattr_init (ACE_condattr_t &attributes, int type) { ACE_UNUSED_ARG (type); # if defined (ACE_HAS_THREADS) # if defined (ACE_HAS_PTHREADS) int result = -1; -# if defined (ACE_VXWORKS) && (ACE_VXWORKS >= 0x600) && (ACE_VXWORKS <= 0x620) +# if defined (ACE_PTHREAD_CONDATTR_T_INITIALIZE) /* Tests show that VxWorks 6.x pthread lib does not only * require zeroing of mutex/condition objects to function correctly * but also of the attribute objects. @@ -174,17 +164,10 @@ ACE_OS::condattr_init (ACE_condattr_t &attributes, result = -1; // ACE_ADAPT_RETVAL used it for intermediate status return result; -# elif defined (ACE_HAS_STHREADS) - attributes.type = type; - - return 0; - # else - ACE_UNUSED_ARG (attributes); - ACE_UNUSED_ARG (type); - ACE_NOTSUP_RETURN (-1); - -# endif /* ACE_HAS_PTHREADS vs. ACE_HAS_STHREADS */ + attributes.type = type; + return 0; +# endif /* ACE_HAS_PTHREADS */ # else ACE_UNUSED_ARG (attributes); @@ -193,6 +176,12 @@ ACE_OS::condattr_init (ACE_condattr_t &attributes, # endif /* ACE_HAS_THREADS */ } +#if !defined (ACE_LACKS_COND_T) +// NOTE: The ACE_OS::cond_* functions for Unix platforms are defined +// here because the ACE_OS::sema_* functions below need them. +// However, ACE_WIN32 and VXWORKS define the ACE_OS::cond_* functions +// using the ACE_OS::sema_* functions. So, they are defined in OS_NS_Tread.cpp. + ACE_INLINE int ACE_OS::cond_broadcast (ACE_cond_t *cv) { @@ -208,6 +197,9 @@ ACE_OS::cond_broadcast (ACE_cond_t *cv) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_broadcast (cv), result), int, -1); +# elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + ::WakeAllConditionVariable (cv); + return 0; # endif /* ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -226,6 +218,9 @@ ACE_OS::cond_destroy (ACE_cond_t *cv) # elif defined (ACE_HAS_STHREADS) int result; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_destroy (cv), result), int, -1); +# elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + // Windows doesn't have a destroy + return 0; # endif /* ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -246,7 +241,7 @@ ACE_OS::cond_init (ACE_cond_t *cv, # if defined (ACE_HAS_PTHREADS) int result = -1; -# if defined (ACE_VXWORKS) && (ACE_VXWORKS >= 0x600) && (ACE_VXWORKS <= 0x620) +# if defined (ACE_PTHREAD_COND_T_INITIALIZE) /* VxWorks 6.x API reference states: * If the memory for the condition variable object has been allocated * dynamically, it is a good policy to always zero out the @@ -269,6 +264,9 @@ ACE_OS::cond_init (ACE_cond_t *cv, arg), result), int, -1); +# elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + ::InitializeConditionVariable (cv); + return 0; # endif /* ACE_HAS_PTHREADS vs. ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -310,6 +308,9 @@ ACE_OS::cond_signal (ACE_cond_t *cv) # elif defined (ACE_HAS_STHREADS) int result; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_signal (cv), result), int, -1); +# elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + ::WakeConditionVariable (cv); + return 0; # endif /* ACE_HAS_STHREADS */ # else ACE_UNUSED_ARG (cv); @@ -331,6 +332,10 @@ ACE_OS::cond_wait (ACE_cond_t *cv, int result; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_wait (cv, external_mutex), result), int, -1); +# elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + int result; + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::SleepConditionVariableCS (cv, &external_mutex->thr_mutex_, INFINITE), result), + int, -1); # endif /* ACE_HAS_PTHREADS */ # else ACE_UNUSED_ARG (cv); @@ -346,7 +351,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, { ACE_OS_TRACE ("ACE_OS::cond_timedwait"); # if defined (ACE_HAS_THREADS) - int result; + int result = 0; timespec_t ts; if (timeout != 0) @@ -374,6 +379,22 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, (timestruc_t*)&ts), result), int, -1, result); +# elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) + int msec_timeout = 0; + if (timeout != 0) + { + ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ()); + // Watchout for situations where a context switch has caused the + // current time to be > the timeout. + if (relative_time > ACE_Time_Value::zero) + msec_timeout = relative_time.msec (); + } + + ACE_OSCALL (ACE_ADAPT_RETVAL (::SleepConditionVariableCS (cv, &external_mutex->thr_mutex_, msec_timeout), + result), + int, -1, result); + + return result; # endif /* ACE_HAS_STHREADS */ if (timeout != 0) timeout->set (ts); // Update the time value before returning. @@ -418,6 +439,8 @@ ACE_OS::event_init (ACE_event_t *event, if (*event == 0) ACE_FAIL_RETURN (-1); + // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. + ACE_OS::set_errno_to_last_error (); return 0; #else /* ACE_WIN32 */ return ACE_OS::event_init (event, @@ -467,30 +490,11 @@ ACE_OS::recursive_mutex_cond_unlock (ACE_recursive_thread_mutex_t *m, // need to release the lock one fewer times than this thread has acquired // it. Remember how many times, and reacquire it that many more times when // the condition is signaled. - // - // For WinCE, the situation is a bit trickier. CE doesn't have - // RecursionCount, and LockCount has changed semantics over time. - // In CE 3 (and maybe 4?) LockCount is not an indicator of recursion; - // instead, see when it's unlocked by watching the OwnerThread, which will - // change to something other than the current thread when it's been - // unlocked "enough" times. Note that checking for 0 (unlocked) is not - // sufficient. Another thread may acquire the lock between our unlock and - // checking the OwnerThread. So grab our thread ID value first, then - // compare to it in the loop condition. NOTE - the problem with this - // scheme is that we really want to unlock the mutex one _less_ times than - // required to release it for another thread to acquire. With CE 5 we - // can do this by watching LockCount alone. I _think_ it can be done by - // watching LockCount on CE 4 as well (though its meaning is different), - // but I'm leary of changing this code since a user reported success - // with it. - // + // We're using undocumented fields in the CRITICAL_SECTION structure // and they've been known to change across Windows variants and versions./ // So be careful if you need to change these - there may be other // Windows variants that depend on existing values and limits. -# if defined (ACE_HAS_WINCE) && (UNDER_CE < 500) - ACE_thread_t me = ACE_OS::thr_self (); -# endif /* ACE_HAS_WINCE && CE 4 or earlier */ state.relock_count_ = 0; while ( @@ -498,13 +502,8 @@ ACE_OS::recursive_mutex_cond_unlock (ACE_recursive_thread_mutex_t *m, m->LockCount > 0 && m->RecursionCount > 1 # else // WinCE doesn't have RecursionCount and the LockCount semantic - // has changed between versions; pre-Mobile 5 the LockCount - // was 0-indexed, and Mobile 5 has it 1-indexed. -# if (UNDER_CE < 500) - m->LockCount > 0 && m->OwnerThread == (HANDLE)me -# else + // Mobile 5 has it 1-indexed. m->LockCount > 1 -# endif /* UNDER_CE < 500 */ # endif /* ACE_HAS_WINCE */ ) { @@ -573,6 +572,7 @@ ACE_OS::recursive_mutex_cond_unlock (ACE_recursive_thread_mutex_t *m, #endif /* ACE_HAS_THREADS */ } + // This method is called after waiting on a condition variable when a // recursive mutex must be reacquired. If the platform doesn't natively // integrate recursive mutexes and condition variables, it's taken care @@ -1089,7 +1089,7 @@ ACE_OS::rw_trywrlock_upgrade (ACE_rwlock_t *rw) while (rw->ref_count_ > 1) // wait until only I am left { rw->num_waiting_writers_++; // prohibit any more readers - rw->important_writer_ = 1; + rw->important_writer_ = true; if (ACE_OS::cond_wait (&rw->waiting_important_writer_, &rw->lock_) == -1) { @@ -1097,7 +1097,7 @@ ACE_OS::rw_trywrlock_upgrade (ACE_rwlock_t *rw) // we know that we have the lock again, we have this guarantee, // but something went wrong } - rw->important_writer_ = 0; + rw->important_writer_ = false; rw->num_waiting_writers_--; } if (result == 0) @@ -1362,8 +1362,8 @@ ACE_OS::sema_destroy (ACE_sema_t *s) ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CloseHandle (*s), ace_result_), int, -1); # else /* ACE_USES_WINCE_SEMA_SIMULATION */ // Free up underlying objects of the simulated semaphore. - int r1 = ACE_OS::thread_mutex_destroy (&s->lock_); - int r2 = ACE_OS::event_destroy (&s->count_nonzero_); + int const r1 = ACE_OS::thread_mutex_destroy (&s->lock_); + int const r2 = ACE_OS::event_destroy (&s->count_nonzero_); return r1 != 0 || r2 != 0 ? -1 : 0; # endif /* ACE_USES_WINCE_SEMA_SIMULATION */ # elif defined (ACE_VXWORKS) @@ -1571,23 +1571,23 @@ ACE_OS::sema_init (ACE_sema_t *s, if ((s->fd_[0] = ACE_OS::open (name, O_RDONLY | O_NONBLOCK)) == ACE_INVALID_HANDLE || (s->fd_[1] = ACE_OS::open (name, O_WRONLY | O_NONBLOCK)) == ACE_INVALID_HANDLE) - return (-1); + return -1; /* turn off nonblocking for fd_[0] */ if ((flags = ACE_OS::fcntl (s->fd_[0], F_GETFL, 0)) < 0) - return (-1); + return -1; flags &= ~O_NONBLOCK; if (ACE_OS::fcntl (s->fd_[0], F_SETFL, flags) < 0) - return (-1); + return -1; //if (s->name_ && count) if (creator && count) { char c = 1; - for (u_int i=0; ifd_[1], &c, sizeof (char)) != 1) - return (-1); + return -1; } // In the case of process scope semaphores we can already unlink the FIFO now that @@ -1601,7 +1601,7 @@ ACE_OS::sema_init (ACE_sema_t *s, ACE_OS::unlink (name); } - return (0); + return 0; #elif defined (ACE_HAS_THREADS) # if defined (ACE_HAS_STHREADS) ACE_UNUSED_ARG (name); @@ -1641,17 +1641,21 @@ ACE_OS::sema_init (ACE_sema_t *s, // its maximum value initialized to . SECURITY_ATTRIBUTES sa_buffer; SECURITY_DESCRIPTOR sd_buffer; - *s = ::CreateSemaphoreA + *s = ACE_TEXT_CreateSemaphore (ACE_OS::default_win32_security_attributes_r (sa, &sa_buffer, &sd_buffer), count, max, - name); + ACE_TEXT_CHAR_TO_TCHAR (name)); if (*s == 0) ACE_FAIL_RETURN (-1); /* NOTREACHED */ else - return 0; + { + // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. + ACE_OS::set_errno_to_last_error (); + return 0; + } # else /* ACE_USES_WINCE_SEMA_SIMULATION */ int result = -1; @@ -1735,7 +1739,11 @@ ACE_OS::sema_init (ACE_sema_t *s, ACE_FAIL_RETURN (-1); /* NOTREACHED */ else - return 0; + { + // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary. + ACE_OS::set_errno_to_last_error (); + return 0; + } # else /* ACE_USES_WINCE_SEMA_SIMULATION */ int result = -1; @@ -1799,8 +1807,8 @@ ACE_OS::sema_post (ACE_sema_t *s) # elif defined (ACE_USES_FIFO_SEM) char c = 1; if (ACE_OS::write (s->fd_[1], &c, sizeof (char)) == sizeof (char)) - return (0); - return (-1); + return 0; + return -1; # elif defined (ACE_HAS_THREADS) # if defined (ACE_HAS_STHREADS) int result; @@ -1889,10 +1897,10 @@ ACE_OS::sema_trywait (ACE_sema_t *s) /* turn on nonblocking for s->fd_[0] */ if ((flags = ACE_OS::fcntl (s->fd_[0], F_GETFL, 0)) < 0) - return (-1); + return -1; flags |= O_NONBLOCK; if (ACE_OS::fcntl (s->fd_[0], F_SETFL, flags) < 0) - return (-1); + return -1; // read sets errno to EAGAIN if no input rc = ACE_OS::read (s->fd_[0], &c, sizeof (char)); @@ -2009,8 +2017,8 @@ ACE_OS::sema_wait (ACE_sema_t *s) # elif defined (ACE_USES_FIFO_SEM) char c; if (ACE_OS::read (s->fd_[0], &c, sizeof (char)) == 1) - return (0); - return (-1); + return 0; + return -1; # elif defined (ACE_HAS_THREADS) # if defined (ACE_HAS_STHREADS) int result; @@ -2192,13 +2200,13 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) { if (rc == 0) errno = ETIME; - return (-1); + return -1; } } // try to read the signal *but* do *not* block if (rc == 1 && ACE_OS::sema_trywait (s) == 0) - return (0); + return 0; // we were woken for input but someone beat us to it // so we wait again if there is still time @@ -2208,7 +2216,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) // make sure errno is set right errno = ETIME; - return (-1); + return -1; # elif defined (ACE_HAS_THREADS) # if defined (ACE_HAS_STHREADS) ACE_UNUSED_ARG (s); @@ -2258,7 +2266,7 @@ ACE_OS::sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) # if !defined (ACE_USES_WINCE_SEMA_SIMULATION) int msec_timeout; - if (tv.sec () == 0 && tv.usec () == 0) + if (tv == ACE_Time_Value::zero) msec_timeout = 0; // Do a "poll." else { @@ -2454,15 +2462,13 @@ ACE_OS::sigtimedwait (const sigset_t *sset, ACE_OS_TRACE ("ACE_OS::sigtimedwait"); #if defined (ACE_HAS_SIGTIMEDWAIT) timespec_t ts; - timespec_t *tsp; + timespec_t *tsp = 0; if (timeout != 0) { ts = *timeout; // Calls ACE_Time_Value::operator timespec_t(). tsp = &ts; } - else - tsp = 0; ACE_OSCALL_RETURN (::sigtimedwait (sset, info, tsp), int, -1); @@ -2494,20 +2500,15 @@ ACE_OS::sigwait (sigset_t *sset, int *sig) return *sig; #endif /* _POSIX_C_SOURCE - 0 >= 199506L || _POSIX_PTHREAD_SEMANTICS */ # elif defined (ACE_HAS_PTHREADS) - // LynxOS and Digital UNIX have their own hoops to jump through. -# if defined (__Lynx__) - // Second arg is a void **, which we don't need (the selected - // signal number is returned). - *sig = ::sigwait (sset, 0); - return *sig; -# elif defined (DIGITAL_UNIX) && defined (__DECCXX_VER) + // Digital UNIX has own hoops to jump through. +# if defined (DIGITAL_UNIX) && defined (__DECCXX_VER) // DEC cxx (but not g++) needs this direct call to its internal // sigwait (). This allows us to #undef sigwait, so that we can // have ACE_OS::sigwait. cxx gets confused by ACE_OS::sigwait // if sigwait is _not_ #undef'ed. errno = ::_Psigwait (sset, sig); return errno == 0 ? *sig : -1; -# else /* ! __Lynx __ && ! (DIGITAL_UNIX && __DECCXX_VER) */ +# else /* !(DIGITAL_UNIX && __DECCXX_VER) */ # if defined (CYGWIN32) // Cygwin has sigwait definition, but it is not implemented ACE_UNUSED_ARG (sset); @@ -2519,7 +2520,7 @@ ACE_OS::sigwait (sigset_t *sset, int *sig) errno = ::sigwait (sset, sig); return errno == 0 ? *sig : -1; # endif /* CYGWIN32 */ -# endif /* ! __Lynx__ && ! (DIGITAL_UNIX && __DECCXX_VER) */ +# endif /* !(DIGITAL_UNIX && __DECCXX_VER) */ # elif defined (ACE_HAS_WTHREADS) ACE_UNUSED_ARG (sset); ACE_NOTSUP_RETURN (-1); @@ -2673,10 +2674,14 @@ ACE_OS::thr_getprio (ACE_hthread_t ht_id, int &priority, int &policy) # elif defined (ACE_HAS_STHREADS) int result; ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_getprio (ht_id, &priority), result), int, -1); -# elif defined (ACE_HAS_WTHREADS) && !defined (ACE_HAS_WINCE) +# elif defined (ACE_HAS_WTHREADS) ACE_Errno_Guard error (errno); +# if defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_CE_THREAD_PRIORITY) + priority = ::CeGetThreadPriority (ht_id); +# else priority = ::GetThreadPriority (ht_id); +# endif /* defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_CE_THREAD_PRIORITY) */ # if defined (ACE_HAS_PHARLAP) # if defined (ACE_PHARLAP_LABVIEW_RT) @@ -2685,7 +2690,7 @@ ACE_OS::thr_getprio (ACE_hthread_t ht_id, int &priority, int &policy) DWORD timeslice = ::EtsGetTimeSlice (); policy = timeslice == 0 ? ACE_SCHED_OTHER : ACE_SCHED_FIFO; # endif /* ACE_PHARLAP_LABVIEW_RT */ -# else +# elif !defined (ACE_HAS_WINCE) DWORD priority_class = ::GetPriorityClass (::GetCurrentProcess ()); if (priority_class == 0 && (error = ::GetLastError ()) != NO_ERROR) ACE_FAIL_RETURN (-1); @@ -3103,9 +3108,17 @@ ACE_OS::thr_setprio (ACE_hthread_t ht_id, int priority, int policy) result), int, -1); # elif defined (ACE_HAS_WTHREADS) + +# if defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_CE_THREAD_PRIORITY) + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CeSetThreadPriority (ht_id, priority), + ace_result_), + int, -1); +# else ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::SetThreadPriority (ht_id, priority), ace_result_), int, -1); +# endif /* defined (ACE_HAS_WINCE) && !defined (ACE_LACKS_CE_THREAD_PRIORITY) */ + # elif defined (ACE_HAS_VXTHREADS) ACE_OSCALL_RETURN (::taskPrioritySet (ht_id, priority), int, -1); # else @@ -3568,6 +3581,7 @@ ACE_OS_Recursive_Thread_Mutex_Guard::~ACE_OS_Recursive_Thread_Mutex_Guard () #endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ + /*****************************************************************************/ ACE_INLINE diff --git a/dep/src/ace/OS_NS_arpa_inet.cpp b/externals/ace/OS_NS_arpa_inet.cpp similarity index 87% rename from dep/src/ace/OS_NS_arpa_inet.cpp rename to externals/ace/OS_NS_arpa_inet.cpp index cb496c9d0eb..c9379442818 100644 --- a/dep/src/ace/OS_NS_arpa_inet.cpp +++ b/externals/ace/OS_NS_arpa_inet.cpp @@ -1,9 +1,9 @@ // -*- C++ -*- -// $Id: OS_NS_arpa_inet.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_arpa_inet.cpp 88515 2010-01-13 08:47:38Z johnnyw $ #include "ace/OS_NS_arpa_inet.h" -ACE_RCSID(ace, OS_NS_arpa_inet, "$Id: OS_NS_arpa_inet.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_arpa_inet, "$Id: OS_NS_arpa_inet.cpp 88515 2010-01-13 08:47:38Z johnnyw $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_arpa_inet.inl" @@ -36,7 +36,7 @@ ACE_OS::inet_aton (const char *host_name, struct in_addr *addr) addr->s_addr = ip_addr; // Network byte ordered return 1; } -#elif defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x660) +#elif defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x680) // inet_aton() returns OK (0) on success and ERROR (-1) on failure. // Must reset errno first. Refer to WindRiver SPR# 34949, SPR# 36026 ::errnoSet(0); @@ -51,4 +51,3 @@ ACE_OS::inet_aton (const char *host_name, struct in_addr *addr) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_arpa_inet.h b/externals/ace/OS_NS_arpa_inet.h similarity index 99% rename from dep/include/ace/OS_NS_arpa_inet.h rename to externals/ace/OS_NS_arpa_inet.h index dba0f6bd4da..fc8e660ac1f 100644 --- a/dep/include/ace/OS_NS_arpa_inet.h +++ b/externals/ace/OS_NS_arpa_inet.h @@ -72,4 +72,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_ARPA_INET_H */ - diff --git a/dep/include/ace/OS_NS_arpa_inet.inl b/externals/ace/OS_NS_arpa_inet.inl similarity index 94% rename from dep/include/ace/OS_NS_arpa_inet.inl rename to externals/ace/OS_NS_arpa_inet.inl index 71db747c942..22083608ec4 100644 --- a/dep/include/ace/OS_NS_arpa_inet.inl +++ b/externals/ace/OS_NS_arpa_inet.inl @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: OS_NS_arpa_inet.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_arpa_inet.inl 84249 2009-01-28 09:09:41Z johnnyw $ #include "ace/OS_NS_string.h" #include "ace/OS_NS_errno.h" @@ -14,11 +14,11 @@ ACE_OS::inet_addr (const char *name) #if defined (ACE_LACKS_INET_ADDR) ACE_UNUSED_ARG (name); ACE_NOTSUP_RETURN (0); -#elif defined (ACE_HAS_NONCONST_GETBY) +#elif defined (ACE_HAS_NONCONST_INET_ADDR) return ::inet_addr (const_cast (name)); #else return ::inet_addr (name); -#endif /* ACE_HAS_NONCONST_GETBY */ +#endif /* ACE_HAS_NONCONST_INET_ADDR */ } ACE_INLINE char * diff --git a/dep/src/ace/OS_NS_ctype.cpp b/externals/ace/OS_NS_ctype.cpp similarity index 99% rename from dep/src/ace/OS_NS_ctype.cpp rename to externals/ace/OS_NS_ctype.cpp index e8bd11f6c24..d9245606015 100644 --- a/dep/src/ace/OS_NS_ctype.cpp +++ b/externals/ace/OS_NS_ctype.cpp @@ -9,4 +9,3 @@ ACE_RCSID(ace, OS_NS_ctype, "$Id: OS_NS_ctype.cpp 80826 2008-03-04 14:51:23Z wot # include "ace/OS_NS_ctype.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_ctype.h b/externals/ace/OS_NS_ctype.h similarity index 85% rename from dep/include/ace/OS_NS_ctype.h rename to externals/ace/OS_NS_ctype.h index c03143eea90..f87a0c6cc7a 100644 --- a/dep/include/ace/OS_NS_ctype.h +++ b/externals/ace/OS_NS_ctype.h @@ -4,7 +4,7 @@ /** * @file OS_NS_ctype.h * - * $Id: OS_NS_ctype.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_ctype.h 83891 2008-11-28 11:01:50Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -32,6 +32,11 @@ #endif #define ACE_EXPORT_MACRO ACE_Export +#include "ace/os_include/os_ctype.h" +#if defined ACE_HAS_WCHAR +# include "ace/os_include/os_wctype.h" +#endif /* ACE_HAS_WCHAR */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { @@ -56,6 +61,14 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION int ace_isalpha (ACE_TCHAR c); + /// Returns true if the character is a control character. + ACE_NAMESPACE_INLINE_FUNCTION + int ace_isblank (ACE_TCHAR c); + + /// Returns true if the character is a control character. + ACE_NAMESPACE_INLINE_FUNCTION + int ace_isascii (ACE_TCHAR c); + /// Returns true if the character is a control character. ACE_NAMESPACE_INLINE_FUNCTION int ace_iscntrl (ACE_TCHAR c); @@ -112,6 +125,9 @@ namespace ACE_OS { wint_t ace_towupper (wint_t c); #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWUPPER */ + /// Tests @a c for the property specified by the @a desc argument + ACE_NAMESPACE_INLINE_FUNCTION + int ace_isctype (int c, ctype_t desc); //@} } /* namespace ACE_OS */ @@ -128,4 +144,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_CTYPE_H */ - diff --git a/dep/include/ace/OS_NS_ctype.inl b/externals/ace/OS_NS_ctype.inl similarity index 61% rename from dep/include/ace/OS_NS_ctype.inl rename to externals/ace/OS_NS_ctype.inl index 8ca1f1a2976..4d736488b7c 100644 --- a/dep/include/ace/OS_NS_ctype.inl +++ b/externals/ace/OS_NS_ctype.inl @@ -1,11 +1,14 @@ // -*- C++ -*- // -// $Id: OS_NS_ctype.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_ctype.inl 85785 2009-06-24 18:20:42Z mitza $ -#include "ace/os_include/os_ctype.h" -#if defined ACE_HAS_WCHAR -# include "ace/os_include/os_wctype.h" -#endif /* ACE_HAS_WCHAR */ +#if defined (ACE_LACKS_ISCTYPE) +#include "ace/OS_NS_errno.h" +#endif + +#if defined (ACE_USES_WCHAR) && defined (ACE_LACKS_ISWBLANK) && !defined (ACE_LACKS_ISWCTYPE) +#include "ace/OS_NS_wctype.h" +#endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -13,18 +16,59 @@ ACE_INLINE int ACE_OS::ace_isalnum (ACE_TCHAR c) { #if defined (ACE_USES_WCHAR) -# if defined (_MSC_VER) && (_MSC_VER >= 1300) +# if defined (_MSC_VER) // For MSVC 7.x, we need to prevent "illegal" character getting into // isalnum, otherwise, it will crash the program. - return c > 0 && c < 256 && iswalnum (c); + return c > 0 && c < 0xFF && iswalnum (c); # else return iswalnum (c); -# endif /* _MSC_VER && _MSC_VER >= 1300 */ +# endif /* _MSC_VER */ #else /* ACE_USES_WCHAR */ return isalnum ((unsigned char) c); #endif /* ACE_USES_WCHAR */ } +ACE_INLINE int +ACE_OS::ace_isascii (ACE_TCHAR c) +{ +#if defined (ACE_USES_WCHAR) +# if defined (ACE_LACKS_ISWASCII) + if (c < 256) + return isascii (static_cast (c)); + else + return c; +# else + return iswascii (c); +# endif +#else /* ACE_USES_WCHAR */ +# if defined (ACE_LACKS_ISASCII) + return (static_cast(c) <= 0x7F); +#else + return isascii ((unsigned char) c); +#endif /* ACE_LACKS_ISASCII */ +#endif /* ACE_USES_WCHAR */ +} + +ACE_INLINE int +ACE_OS::ace_isblank (ACE_TCHAR c) +{ +#if defined (ACE_USES_WCHAR) +# if defined (ACE_LACKS_ISWBLANK) +# if !defined (ACE_LACKS_ISWCTYPE) + return ace_iswctype (c, _BLANK); +# else + return (c == 0x9) || (c == 0x20); +# endif /* !ACE_LACKS_ISWCTYPE */ +# else + return iswblank (c); +# endif /* ACE_LACKS_ISWBLANK */ +#elif defined (ACE_LACKS_ISBLANK) + return (c == 0x9) || (c == 0x20); +#else /* ACE_USES_WCHAR */ + return isblank ((unsigned char) c); +#endif /* ACE_USES_WCHAR */ +} + ACE_INLINE int ACE_OS::ace_isalpha (ACE_TCHAR c) { @@ -79,6 +123,16 @@ ACE_INLINE int ACE_OS::ace_isprint (ACE_TCHAR c) { #if defined (ACE_USES_WCHAR) +# if defined (ACE_LACKS_CORRECT_ISWPRINT_TAB) + /* The MS CRT has the bug that for tab (\t) iswprint returns true instead of + * false. This has been reported to Microsoft: + * https://connect.microsoft.com/VisualStudio/feedback ID# 381915 + */ + if (c == 0x9) + { + return 0; + } +# endif return iswprint (c); #else /* ACE_USES_WCHAR */ return isprint ((unsigned char) c); @@ -160,4 +214,18 @@ ACE_OS::ace_towupper (wint_t c) } #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWUPPER */ +ACE_INLINE int +ACE_OS::ace_isctype(int c, ctype_t desc) +{ +#if defined (ACE_ISCTYPE_EQUIVALENT) + return ACE_ISCTYPE_EQUIVALENT (c, desc); +#elif !defined (ACE_LACKS_ISCTYPE) + return isctype (c, desc); +#else + ACE_UNUSED_ARG (c); + ACE_UNUSED_ARG (desc); + ACE_NOTSUP_RETURN (-1); +#endif +} + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_NS_dirent.cpp b/externals/ace/OS_NS_dirent.cpp similarity index 93% rename from dep/src/ace/OS_NS_dirent.cpp rename to externals/ace/OS_NS_dirent.cpp index 4a3672c28c5..1d9483c4087 100644 --- a/dep/src/ace/OS_NS_dirent.cpp +++ b/externals/ace/OS_NS_dirent.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_dirent.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_dirent.cpp 90263 2010-05-24 14:44:39Z johnnyw $ #include "ace/OS_NS_dirent.h" -ACE_RCSID(ace, OS_NS_dirent, "$Id: OS_NS_dirent.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_dirent, "$Id: OS_NS_dirent.cpp 90263 2010-05-24 14:44:39Z johnnyw $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_dirent.inl" @@ -21,9 +21,11 @@ ACE_OS::closedir_emulation (ACE_DIR *d) { #if defined (ACE_WIN32) if (d->current_handle_ != INVALID_HANDLE_VALUE) - ::FindClose (d->current_handle_); + { + ::FindClose (d->current_handle_); + d->current_handle_ = INVALID_HANDLE_VALUE; + } - d->current_handle_ = INVALID_HANDLE_VALUE; d->started_reading_ = 0; if (d->dirent_ != 0) { @@ -41,11 +43,11 @@ ACE_DIR * ACE_OS::opendir_emulation (const ACE_TCHAR *filename) { #if defined (ACE_WIN32) -# if defined (ACE_HAS_WINCE) && !defined (INVALID_FILE_ATTRIBUTES) +# if !defined (INVALID_FILE_ATTRIBUTES) # define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF # endif - ACE_DIR *dir; + ACE_DIR *dir = 0; ACE_TCHAR extra[3] = {0,0,0}; // Check if filename is a directory. @@ -72,7 +74,7 @@ ACE_OS::opendir_emulation (const ACE_TCHAR *filename) Phil Mesnier */ - size_t lastchar = ACE_OS::strlen (filename); + size_t const lastchar = ACE_OS::strlen (filename); if (lastchar > 0) { if (filename[lastchar-1] != '*') @@ -122,8 +124,7 @@ ACE_OS::readdir_emulation (ACE_DIR *d) } else { - int retval = ACE_TEXT_FindNextFile (d->current_handle_, - &d->fdata_); + int const retval = ACE_TEXT_FindNextFile (d->current_handle_, &d->fdata_); if (retval == 0) { // Make sure to close the handle explicitly to avoid a leak! @@ -175,7 +176,6 @@ ACE_OS::scandir_emulation (const ACE_TCHAR *dirname, ACE_DIRENT **vector = 0; ACE_DIRENT *dp = 0; int arena_size = 0; - int nfiles = 0; int fail = 0; @@ -272,4 +272,3 @@ ACE_OS::scandir_emulation (const ACE_TCHAR *dirname, #endif /* !ACE_HAS_SCANDIR */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_dirent.h b/externals/ace/OS_NS_dirent.h similarity index 98% rename from dep/include/ace/OS_NS_dirent.h rename to externals/ace/OS_NS_dirent.h index 72f06b91648..caf72b16eb1 100644 --- a/dep/include/ace/OS_NS_dirent.h +++ b/externals/ace/OS_NS_dirent.h @@ -4,7 +4,7 @@ /** * @file OS_NS_dirent.h * - * $Id: OS_NS_dirent.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_dirent.h 85435 2009-05-25 18:52:50Z coryan $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -151,4 +151,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_DIRENT_H */ - diff --git a/dep/include/ace/OS_NS_dirent.inl b/externals/ace/OS_NS_dirent.inl similarity index 100% rename from dep/include/ace/OS_NS_dirent.inl rename to externals/ace/OS_NS_dirent.inl diff --git a/dep/src/ace/OS_NS_dlfcn.cpp b/externals/ace/OS_NS_dlfcn.cpp similarity index 99% rename from dep/src/ace/OS_NS_dlfcn.cpp rename to externals/ace/OS_NS_dlfcn.cpp index 54580ba6523..24218ff4302 100644 --- a/dep/src/ace/OS_NS_dlfcn.cpp +++ b/externals/ace/OS_NS_dlfcn.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_dlfcn, "$Id: OS_NS_dlfcn.cpp 80826 2008-03-04 14:51:23Z wot # include "ace/OS_NS_dlfcn.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_dlfcn.h b/externals/ace/OS_NS_dlfcn.h similarity index 99% rename from dep/include/ace/OS_NS_dlfcn.h rename to externals/ace/OS_NS_dlfcn.h index 13a8e7d0cfa..45cf625dc30 100644 --- a/dep/include/ace/OS_NS_dlfcn.h +++ b/externals/ace/OS_NS_dlfcn.h @@ -67,4 +67,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_DLFCN_H */ - diff --git a/dep/include/ace/OS_NS_dlfcn.inl b/externals/ace/OS_NS_dlfcn.inl similarity index 99% rename from dep/include/ace/OS_NS_dlfcn.inl rename to externals/ace/OS_NS_dlfcn.inl index 9b75ac3ad5c..14960008dd1 100644 --- a/dep/include/ace/OS_NS_dlfcn.inl +++ b/externals/ace/OS_NS_dlfcn.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_dlfcn.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_dlfcn.inl 85341 2009-05-14 11:07:37Z johnnyw $ #include "ace/OS_NS_macros.h" #include "ace/OS_NS_errno.h" @@ -78,7 +78,7 @@ ACE_OS::dlerror (void) { ACE_OS_TRACE ("ACE_OS::dlerror"); # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) - const char *err; + const char *err = 0; # if defined(_M_UNIX) ACE_OSCALL (::_dlerror (), const char *, 0, err); # else /* _M_UNIX */ diff --git a/dep/src/ace/OS_NS_errno.cpp b/externals/ace/OS_NS_errno.cpp similarity index 99% rename from dep/src/ace/OS_NS_errno.cpp rename to externals/ace/OS_NS_errno.cpp index ea3213c0832..ada256d1cbd 100644 --- a/dep/src/ace/OS_NS_errno.cpp +++ b/externals/ace/OS_NS_errno.cpp @@ -9,4 +9,3 @@ ACE_RCSID(ace, OS_NS_errno, "$Id: OS_NS_errno.cpp 80826 2008-03-04 14:51:23Z wot # include "ace/OS_NS_errno.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_errno.h b/externals/ace/OS_NS_errno.h similarity index 90% rename from dep/include/ace/OS_NS_errno.h rename to externals/ace/OS_NS_errno.h index 9ab6d1b1f38..22e3d006d06 100644 --- a/dep/include/ace/OS_NS_errno.h +++ b/externals/ace/OS_NS_errno.h @@ -4,7 +4,7 @@ /** * @file OS_NS_errno.h * - * $Id: OS_NS_errno.h 81286 2008-04-09 07:27:30Z johnnyw $ + * $Id: OS_NS_errno.h 85321 2009-05-12 08:31:31Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -58,7 +58,7 @@ namespace ACE_OS { * Some versions of CE don't support @c errno and some versions' * implementations are busted. So we implement our own. * Our implementation takes up one Tls key, however, it does not - * allocate memory fromt the heap so there's no problem with cleanin + * allocate memory from the heap so there's no problem with cleaning * up the errno when a thread exit. */ class ACE_Export ACE_CE_Errno @@ -82,8 +82,10 @@ private: #if defined (ACE_HAS_WINCE_BROKEN_ERRNO) # define ACE_ERRNO_TYPE ACE_CE_Errno +# define ACE_ERRNO_GET ACE_CE_Errno::instance ()->operator int() #else # define ACE_ERRNO_TYPE int +# define ACE_ERRNO_GET errno #endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ ACE_END_VERSIONED_NAMESPACE_DECL @@ -98,4 +100,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_ERRNO_H */ - diff --git a/dep/include/ace/OS_NS_errno.inl b/externals/ace/OS_NS_errno.inl similarity index 100% rename from dep/include/ace/OS_NS_errno.inl rename to externals/ace/OS_NS_errno.inl diff --git a/dep/src/ace/OS_NS_fcntl.cpp b/externals/ace/OS_NS_fcntl.cpp similarity index 99% rename from dep/src/ace/OS_NS_fcntl.cpp rename to externals/ace/OS_NS_fcntl.cpp index a50e900330a..aa90f7930fd 100644 --- a/dep/src/ace/OS_NS_fcntl.cpp +++ b/externals/ace/OS_NS_fcntl.cpp @@ -243,4 +243,3 @@ ACE_OS::open (const wchar_t *filename, #endif /* ACE_HAS_WCHAR */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_fcntl.h b/externals/ace/OS_NS_fcntl.h similarity index 92% rename from dep/include/ace/OS_NS_fcntl.h rename to externals/ace/OS_NS_fcntl.h index 1fc765ce0bd..0fe86a5f137 100644 --- a/dep/include/ace/OS_NS_fcntl.h +++ b/externals/ace/OS_NS_fcntl.h @@ -4,7 +4,7 @@ /** * @file OS_NS_fcntl.h * - * $Id: OS_NS_fcntl.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_fcntl.h 87487 2009-11-12 07:54:39Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -44,10 +44,6 @@ namespace ACE_OS { int cmd, long arg = 0); -#if !defined (ACE_DEFAULT_OPEN_PERMS) -# define ACE_DEFAULT_OPEN_PERMS ACE_DEFAULT_FILE_PERMS -#endif /* ACE_DEFAULT_OPEN_PERMS */ - /// The O_APPEND flag is only partly supported on Win32. If you specify /// O_APPEND, then the file pointer will be positioned at the end of /// the file initially during open, but it is not re-positioned at @@ -81,4 +77,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_FCNTL_H */ - diff --git a/dep/include/ace/OS_NS_fcntl.inl b/externals/ace/OS_NS_fcntl.inl similarity index 100% rename from dep/include/ace/OS_NS_fcntl.inl rename to externals/ace/OS_NS_fcntl.inl diff --git a/dep/include/ace/OS_NS_macros.h b/externals/ace/OS_NS_macros.h similarity index 99% rename from dep/include/ace/OS_NS_macros.h rename to externals/ace/OS_NS_macros.h index 5568bd46203..a949ce2472c 100644 --- a/dep/include/ace/OS_NS_macros.h +++ b/externals/ace/OS_NS_macros.h @@ -107,7 +107,8 @@ ACE_END_VERSIONED_NAMESPACE_DECL # endif /* _FILE_OFFSET_BITS==64 */ #endif /* ACE_WIN32 */ + + # include /**/ "ace/post.h" #endif /* ACE_OS_NS_MACROS_H */ - diff --git a/dep/src/ace/OS_NS_math.cpp b/externals/ace/OS_NS_math.cpp similarity index 99% rename from dep/src/ace/OS_NS_math.cpp rename to externals/ace/OS_NS_math.cpp index 7cbfd89336c..ae9554c0625 100644 --- a/dep/src/ace/OS_NS_math.cpp +++ b/externals/ace/OS_NS_math.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_math, "$Id: OS_NS_math.cpp 80826 2008-03-04 14:51:23Z wotte # include "ace/OS_NS_math.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_math.h b/externals/ace/OS_NS_math.h similarity index 91% rename from dep/include/ace/OS_NS_math.h rename to externals/ace/OS_NS_math.h index 6207692cb30..9ba3b6632ad 100644 --- a/dep/include/ace/OS_NS_math.h +++ b/externals/ace/OS_NS_math.h @@ -4,7 +4,7 @@ /** * @file OS_NS_math.h * - * $Id: OS_NS_math.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_math.h 89470 2010-03-12 12:12:12Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -34,6 +34,7 @@ #endif #define ACE_EXPORT_MACRO ACE_Export + /* * We inline and undef some functions that may be implemented * as macros on some platforms. This way macro definitions will @@ -62,6 +63,7 @@ inline double ace_log2_helper (double x) meaning the binary logarithm of x using the natural logarithm, for example, is: + log (x) e log (x) = ------- @@ -80,17 +82,24 @@ inline double ace_log2_helper (double x) #endif /* defined (log2) */ } + ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { /// This method computes the largest integral value not greater than x. - ACE_NAMESPACE_INLINE_FUNCTION - double floor (double x); + template + T floor (T x) + { + return ACE_STD_NAMESPACE::floor (x); + } /// This method computes the smallest integral value not less than x. - ACE_NAMESPACE_INLINE_FUNCTION - double ceil (double x); + template + T ceil (T x) + { + return ACE_STD_NAMESPACE::ceil (x); + } /// This method computes the base-2 logarithm of x. ACE_NAMESPACE_INLINE_FUNCTION @@ -110,4 +119,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_MATH_H */ - diff --git a/externals/ace/OS_NS_math.inl b/externals/ace/OS_NS_math.inl new file mode 100644 index 00000000000..e66dc496e5d --- /dev/null +++ b/externals/ace/OS_NS_math.inl @@ -0,0 +1,17 @@ +// -*- C++ -*- +// +// $Id: OS_NS_math.inl 89470 2010-03-12 12:12:12Z olli $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace ACE_OS { + + ACE_INLINE double + log2 (double x) + { + return ace_log2_helper (x); + } + +} // ACE_OS namespace + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_NS_netdb.cpp b/externals/ace/OS_NS_netdb.cpp similarity index 88% rename from dep/src/ace/OS_NS_netdb.cpp rename to externals/ace/OS_NS_netdb.cpp index d0687014c8a..01762a81893 100644 --- a/dep/src/ace/OS_NS_netdb.cpp +++ b/externals/ace/OS_NS_netdb.cpp @@ -1,9 +1,9 @@ // -*- C++ -*- -// $Id: OS_NS_netdb.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_netdb.cpp 89812 2010-04-08 21:27:21Z sowayaa $ #include "ace/OS_NS_netdb.h" -ACE_RCSID(ace, OS_NS_netdb, "$Id: OS_NS_netdb.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_netdb, "$Id: OS_NS_netdb.cpp 89812 2010-04-08 21:27:21Z sowayaa $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_netdb.inl" @@ -240,7 +240,7 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node) result = Netbios (&ncb); - for (int i = 0; i < lenum.length; i++) + for(int i = 0; i < lenum.length; i++) { ACE_OS::memset (&ncb, 0, sizeof(ncb)); ncb.ncb_command = NCBRESET; @@ -276,7 +276,7 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node) # else # if defined (ACE_HAS_PHARLAP_RT) DEVHANDLE ip_dev = (DEVHANDLE)0; - EK_TCPIPCFG *devp; + EK_TCPIPCFG *devp = 0; size_t i; ACE_TCHAR dev_name[16]; @@ -385,6 +385,60 @@ ACE_OS::getmacaddress (struct macaddr_node_t *node) return 0; +#elif defined (ACE_HAS_IPHONE) || defined (ACE_HAS_MAC_OSX) + + const long BUFFERSIZE = 4000; + char buffer[BUFFERSIZE]; + + struct ifconf ifc; + struct ifreq* ifr = 0; + + ACE_HANDLE handle = + ACE_OS::socket (AF_INET, SOCK_DGRAM, 0); + + if (handle == ACE_INVALID_HANDLE) + { + return -1; + } + + ifc.ifc_len = BUFFERSIZE; + ifc.ifc_buf = buffer; + + if (ACE_OS::ioctl (handle, SIOCGIFCONF, &ifc) < 0) + { + ACE_OS::close (handle); + return -1; + } + + for(char* ptr=buffer; ptr < buffer + ifc.ifc_len; ) + { + ifr = (struct ifreq *) ptr; + + if (ifr->ifr_addr.sa_family == AF_LINK) + { + if(ACE_OS::strcmp (ifr->ifr_name, "en0") == 0) + { + struct sockaddr_dl* sdl = + (struct sockaddr_dl *) &ifr->ifr_addr; + + ACE_OS::memcpy (node->node, + LLADDR(sdl), + 6); + } + } + + ptr += sizeof(ifr->ifr_name); + + if(sizeof(ifr->ifr_addr) > ifr->ifr_addr.sa_len) + ptr += sizeof(ifr->ifr_addr); + else + ptr += ifr->ifr_addr.sa_len; + } + + ACE_OS::close (handle); + + return 0; + #else ACE_UNUSED_ARG (node); ACE_NOTSUP_RETURN (-1); @@ -419,4 +473,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # endif /* defined (ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) */ - diff --git a/dep/include/ace/OS_NS_netdb.h b/externals/ace/OS_NS_netdb.h similarity index 100% rename from dep/include/ace/OS_NS_netdb.h rename to externals/ace/OS_NS_netdb.h index 6b29e067b96..0c6bdf43556 100644 --- a/dep/include/ace/OS_NS_netdb.h +++ b/externals/ace/OS_NS_netdb.h @@ -76,6 +76,7 @@ namespace ACE_OS ACE_HOSTENT_DATA buffer, int *h_errnop); + ACE_NAMESPACE_INLINE_FUNCTION struct hostent *getipnodebyaddr (const void *src, size_t len, int family); @@ -143,4 +144,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_NETDB_H */ - diff --git a/dep/include/ace/OS_NS_netdb.inl b/externals/ace/OS_NS_netdb.inl similarity index 98% rename from dep/include/ace/OS_NS_netdb.inl rename to externals/ace/OS_NS_netdb.inl index 508831d4380..55292ecc8ae 100644 --- a/dep/include/ace/OS_NS_netdb.inl +++ b/externals/ace/OS_NS_netdb.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_netdb.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_netdb.inl 86295 2009-07-30 10:41:49Z shuston $ #include "ace/OS_NS_macros.h" #include "ace/OS_NS_string.h" @@ -125,7 +125,7 @@ ACE_OS::gethostbyaddr_r (const char *addr, *h_errnop = h_errno; return (struct hostent *) 0; } -# elif defined (__GLIBC__) || defined (__FreeBSD__) +# elif defined (__GLIBC__) // GNU C library has a different signature ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); @@ -318,7 +318,7 @@ ACE_OS::gethostbyname_r (const char *name, *h_errnop = h_errno; return (struct hostent *) 0; } -# elif defined (__GLIBC__) || defined (__FreeBSD__) +# elif defined (__GLIBC__) // GNU C library has a different signature ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); @@ -410,12 +410,16 @@ ACE_OS::gethostbyname_r (const char *name, # else ACE_UNUSED_ARG (result); ACE_UNUSED_ARG (buffer); - ACE_UNUSED_ARG (h_errnop); - //FUZZ: disable check_for_lack_ACE_OS - ACE_SOCKCALL_RETURN (::gethostbyname (name), - struct hostent *, - 0); + // FUZZ: disable check_for_lack_ACE_OS + struct hostent *result2 = 0; + ACE_SOCKCALL (::gethostbyname (name), + struct hostent *, + 0, + result2); + if (result2 == 0 && h_errnop) + *h_errnop = errno; + return result2; //FUZZ: enable check_for_lack_ACE_OS # endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ } @@ -528,7 +532,7 @@ ACE_OS::getprotobyname_r (const char *name, else return 0; //FUZZ: enable check_for_lack_ACE_OS -# elif defined (__GLIBC__) || defined (__FreeBSD__) +# elif defined (__GLIBC__) // GNU C library has a different signature //FUZZ: disable check_for_lack_ACE_OS if (::getprotobyname_r (name, @@ -609,7 +613,7 @@ ACE_OS::getprotobynumber_r (int proto, //FUZZ: enable check_for_lack_ACE_OS else return 0; -# elif defined (__GLIBC__) || defined (__FreeBSD__) +# elif defined (__GLIBC__) // GNU C library has a different signature //FUZZ: disable check_for_lack_ACE_OS if (::getprotobynumber_r (proto, @@ -695,7 +699,7 @@ ACE_OS::getservbyname_r (const char *svc, //FUZZ: enable check_for_lack_ACE_OS else return (struct servent *) 0; -# elif defined (__GLIBC__) || defined (__FreeBSD__) +# elif defined (__GLIBC__) // GNU C library has a different signature ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA)); diff --git a/dep/src/ace/OS_NS_poll.cpp b/externals/ace/OS_NS_poll.cpp similarity index 99% rename from dep/src/ace/OS_NS_poll.cpp rename to externals/ace/OS_NS_poll.cpp index f31c48e4ac1..0c8523d890f 100644 --- a/dep/src/ace/OS_NS_poll.cpp +++ b/externals/ace/OS_NS_poll.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_poll, "$Id: OS_NS_poll.cpp 80826 2008-03-04 14:51:23Z wotte # include "ace/OS_NS_poll.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_poll.h b/externals/ace/OS_NS_poll.h similarity index 99% rename from dep/include/ace/OS_NS_poll.h rename to externals/ace/OS_NS_poll.h index bf20577bc6b..b18893b1932 100644 --- a/dep/include/ace/OS_NS_poll.h +++ b/externals/ace/OS_NS_poll.h @@ -64,4 +64,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_POLL_H */ - diff --git a/dep/include/ace/OS_NS_poll.inl b/externals/ace/OS_NS_poll.inl similarity index 100% rename from dep/include/ace/OS_NS_poll.inl rename to externals/ace/OS_NS_poll.inl diff --git a/dep/src/ace/OS_NS_pwd.cpp b/externals/ace/OS_NS_pwd.cpp similarity index 99% rename from dep/src/ace/OS_NS_pwd.cpp rename to externals/ace/OS_NS_pwd.cpp index 1c8387a16fa..7a3e5c59b04 100644 --- a/dep/src/ace/OS_NS_pwd.cpp +++ b/externals/ace/OS_NS_pwd.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_pwd, "$Id: OS_NS_pwd.cpp 80826 2008-03-04 14:51:23Z wotte $ # include "ace/OS_NS_pwd.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_pwd.h b/externals/ace/OS_NS_pwd.h similarity index 91% rename from dep/include/ace/OS_NS_pwd.h rename to externals/ace/OS_NS_pwd.h index bf6bb4cea97..f32c247d224 100644 --- a/dep/include/ace/OS_NS_pwd.h +++ b/externals/ace/OS_NS_pwd.h @@ -4,7 +4,7 @@ /** * @file OS_NS_pwd.h * - * $Id: OS_NS_pwd.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_pwd.h 87270 2009-10-29 21:47:47Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -33,10 +33,6 @@ #endif #define ACE_EXPORT_MACRO ACE_Export -# if defined (ACE_HAS_BROKEN_R_ROUTINES) -# undef getpwnam_r -# endif /* ACE_HAS_BROKEN_R_ROUTINES */ - struct passwd; ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -44,6 +40,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { + //@{ @name A set of wrappers for password routines. ACE_NAMESPACE_INLINE_FUNCTION @@ -78,4 +75,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_PWD_H */ - diff --git a/dep/include/ace/OS_NS_pwd.inl b/externals/ace/OS_NS_pwd.inl similarity index 100% rename from dep/include/ace/OS_NS_pwd.inl rename to externals/ace/OS_NS_pwd.inl diff --git a/dep/src/ace/OS_NS_regex.cpp b/externals/ace/OS_NS_regex.cpp similarity index 99% rename from dep/src/ace/OS_NS_regex.cpp rename to externals/ace/OS_NS_regex.cpp index df532281eac..62533a2f45a 100644 --- a/dep/src/ace/OS_NS_regex.cpp +++ b/externals/ace/OS_NS_regex.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_regex, "$Id: OS_NS_regex.cpp 80826 2008-03-04 14:51:23Z wot # include "ace/OS_NS_regex.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_regex.h b/externals/ace/OS_NS_regex.h similarity index 99% rename from dep/include/ace/OS_NS_regex.h rename to externals/ace/OS_NS_regex.h index 8684d087d5d..eccdb69dd5d 100644 --- a/dep/include/ace/OS_NS_regex.h +++ b/externals/ace/OS_NS_regex.h @@ -63,4 +63,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_REGEX_H */ - diff --git a/dep/include/ace/OS_NS_regex.inl b/externals/ace/OS_NS_regex.inl similarity index 100% rename from dep/include/ace/OS_NS_regex.inl rename to externals/ace/OS_NS_regex.inl diff --git a/dep/src/ace/OS_NS_signal.cpp b/externals/ace/OS_NS_signal.cpp similarity index 99% rename from dep/src/ace/OS_NS_signal.cpp rename to externals/ace/OS_NS_signal.cpp index e0b3b612676..bb1c4130564 100644 --- a/dep/src/ace/OS_NS_signal.cpp +++ b/externals/ace/OS_NS_signal.cpp @@ -24,4 +24,3 @@ siginfo_t::siginfo_t (ACE_HANDLE *handles) ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_signal.h b/externals/ace/OS_NS_signal.h similarity index 65% rename from dep/include/ace/OS_NS_signal.h rename to externals/ace/OS_NS_signal.h index d9abed0a666..8dc02c10ab2 100644 --- a/dep/include/ace/OS_NS_signal.h +++ b/externals/ace/OS_NS_signal.h @@ -4,7 +4,7 @@ /** * @file OS_NS_signal.h * - * $Id: OS_NS_signal.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_signal.h 87097 2009-10-14 14:42:24Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -33,6 +33,84 @@ #endif #define ACE_EXPORT_MACRO ACE_Export +#if defined (__Lynx__) +// LynxOS defines pthread_sigmask() in pthread.h +# include "ace/os_include/os_pthread.h" +#endif /* __Lynx__ */ + +/* + * We inline and undef some functions that may be implemented + * as macros on some platforms. This way macro definitions will + * be usable later as there is no way to save the macro definition + * using the pre-processor. + * + */ + +#if !defined (ACE_LACKS_SIGSET) +inline int ace_sigemptyset_helper (sigset_t *s) +{ +# if defined (sigemptyset) + return sigemptyset (s); +# undef sigemptyset +# else + return ACE_STD_NAMESPACE::sigemptyset (s); +# endif /* defined (sigemptyset) */ +} + +inline int ace_sigfillset_helper (sigset_t *s) +{ +# if defined (sigfillset) + return sigfillset (s); +# undef sigfillset +# else + return ACE_STD_NAMESPACE::sigfillset (s); +# endif /* defined (sigfillset) */ +} + +inline int ace_sigaddset_helper (sigset_t *s, int signum) +{ +# if defined (sigaddset) + return sigaddset (s, signum); +# undef sigaddset +# else + return ACE_STD_NAMESPACE::sigaddset (s, signum); +# endif /* defined (sigaddset) */ +} + +inline int ace_sigdelset_helper (sigset_t *s, int signum) +{ +# if defined (sigdelset) + return sigdelset (s, signum); +# undef sigdelset +# else + return ACE_STD_NAMESPACE::sigdelset (s, signum); +# endif /* defined (sigdelset) */ +} + +inline int ace_sigismember_helper (sigset_t *s, int signum) +{ +# if defined (sigismember) + return sigismember (s, signum); +# undef sigismember +# else + return ACE_STD_NAMESPACE::sigismember (s, signum); +# endif /* defined (sigismember) */ +} +#endif /* !defined (ACE_LACKS_SIGSET) */ + +#if defined (ACE_HAS_SIGSUSPEND) +inline int ace_sigsuspend_helper (const sigset_t *s) +{ +# if defined (sigsuspend) + return sigsuspend (s); +# undef sigsuspend +# else + return ACE_STD_NAMESPACE::sigsuspend (s); +# endif /* defined (sigsuspen) */ +} +#endif /* ACE_HAS_SIGSUSPEND */ + + # if !defined (SIG_BLOCK) # define SIG_BLOCK 1 # endif /* SIG_BLOCK */ @@ -133,8 +211,10 @@ namespace ACE_OS { sigset_t *osp); ACE_NAMESPACE_INLINE_FUNCTION - int sigsuspend (const sigset_t *set); + int sigsuspend (const sigset_t *s); + ACE_NAMESPACE_INLINE_FUNCTION + int raise (const int signum); //@} } /* namespace ACE_OS */ @@ -151,4 +231,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SIGNAL_H */ - diff --git a/dep/include/ace/OS_NS_signal.inl b/externals/ace/OS_NS_signal.inl similarity index 75% rename from dep/include/ace/OS_NS_signal.inl rename to externals/ace/OS_NS_signal.inl index 5fae8f0e7fa..d6f6494e118 100644 --- a/dep/include/ace/OS_NS_signal.inl +++ b/externals/ace/OS_NS_signal.inl @@ -1,13 +1,9 @@ // -*- C++ -*- // -// $Id: OS_NS_signal.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_signal.inl 87480 2009-11-11 11:38:15Z olli $ #include "ace/OS_NS_macros.h" #include "ace/OS_NS_errno.h" -#ifndef WIN32 -#include -#include -#endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -82,7 +78,7 @@ ACE_INLINE int sigaddset (sigset_t *s, int signum) { ACE_OS_TRACE ("ACE_OS::sigaddset"); -#if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) +#if defined (ACE_LACKS_SIGSET) if (s == 0) { errno = EFAULT; @@ -96,14 +92,14 @@ sigaddset (sigset_t *s, int signum) *s |= (1 << (signum - 1)) ; return 0 ; #else - ACE_OSCALL_RETURN (::sigaddset (s, signum), int, -1); -#endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ + return ace_sigaddset_helper (s, signum); +#endif /* ACE_LACKS_SIGSET */ } ACE_INLINE int sigdelset (sigset_t *s, int signum) { -#if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) +#if defined (ACE_LACKS_SIGSET) if (s == 0) { errno = EFAULT; @@ -117,14 +113,14 @@ sigdelset (sigset_t *s, int signum) *s &= ~(1 << (signum - 1)) ; return 0; #else - ACE_OSCALL_RETURN (::sigdelset (s, signum), int, -1); -#endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ + return ace_sigdelset_helper (s, signum); +#endif /* ACE_LACKS_SIGSET */ } ACE_INLINE int sigemptyset (sigset_t *s) { -#if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) +#if defined (ACE_LACKS_SIGSET) if (s == 0) { errno = EFAULT; @@ -133,14 +129,14 @@ sigemptyset (sigset_t *s) *s = 0 ; return 0; #else - ACE_OSCALL_RETURN (::sigemptyset (s), int, -1); -#endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ + return ace_sigemptyset_helper (s); +#endif /* ACE_LACKS_SIGSET */ } ACE_INLINE int sigfillset (sigset_t *s) { -#if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) +#if defined (ACE_LACKS_SIGSET) if (s == 0) { errno = EFAULT; @@ -149,14 +145,14 @@ sigfillset (sigset_t *s) *s = ~(sigset_t) 0; return 0 ; #else - ACE_OSCALL_RETURN (::sigfillset (s), int, -1); -#endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ + return ace_sigfillset_helper (s); +#endif /* ACE_LACKS_SIGSET */ } ACE_INLINE int sigismember (sigset_t *s, int signum) { -#if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) +#if defined (ACE_LACKS_SIGSET) if (s == 0) { errno = EFAULT; @@ -176,8 +172,8 @@ sigismember (sigset_t *s, int signum) return -1; // Invalid signum, return error } # endif /* ACE_HAS_SIGISMEMBER_BUG */ - ACE_OSCALL_RETURN (::sigismember (s, signum), int, -1); -#endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ + return ace_sigismember_helper (s, signum); +#endif /* ACE_LACKS_SIGSET */ } ACE_INLINE ACE_SignalHandler @@ -187,11 +183,11 @@ signal (int signum, ACE_SignalHandler func) return 0; else # if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) || !defined (ACE_LACKS_UNIX_SIGNALS) -# if !defined (ACE_HAS_TANDEM_SIGNALS) && !defined (ACE_HAS_LYNXOS_SIGNALS) +# if !defined (ACE_HAS_TANDEM_SIGNALS) && !defined (ACE_HAS_LYNXOS4_SIGNALS) return ::signal (signum, func); # else return (ACE_SignalHandler) ::signal (signum, (void (*)(int)) func); -# endif /* !ACE_HAS_TANDEM_SIGNALS */ +# endif /* !ACE_HAS_TANDEM_SIGNALS && !ACE_HAS_LYNXOS4_SIGNALS */ #else // @@ WINCE: Don't know how to implement signal on WinCE (yet.) ACE_UNUSED_ARG (signum); @@ -203,34 +199,45 @@ signal (int signum, ACE_SignalHandler func) ACE_INLINE int sigprocmask (int how, const sigset_t *nsp, sigset_t *osp) { -#if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) +#if defined (ACE_LACKS_SIGSET) ACE_UNUSED_ARG (how); ACE_UNUSED_ARG (nsp); ACE_UNUSED_ARG (osp); ACE_NOTSUP_RETURN (-1); #else ACE_OSCALL_RETURN (::sigprocmask (how, nsp, osp), int, -1); -#endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ +#endif /* ACE_LACKS_SIGSET */ } ACE_INLINE int -sigsuspend (const sigset_t *sigset) +sigsuspend (const sigset_t *s) { #if defined (ACE_HAS_SIGSUSPEND) - sigset_t s; + sigset_t sigset; - if (sigset == 0) + if (s == 0) { - sigset = &s; - ACE_OS::sigemptyset (&s); + ACE_OS::sigemptyset (&sigset); + s = &sigset; } - ACE_OSCALL_RETURN (::sigsuspend (sigset), int, -1); + return ace_sigsuspend_helper (s); #else - ACE_UNUSED_ARG (sigset); + ACE_UNUSED_ARG (s); ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_SIGSUSPEND */ } +ACE_INLINE int +raise (const int signum) +{ +#if defined (ACE_LACKS_RAISE) + ACE_UNUSED_ARG (signum); + ACE_NOTSUP_RETURN (-1); +#else + ACE_OSCALL_RETURN (::raise (signum), int, -1); +#endif /* ACE_LACKS_RAISE */ +} + } /* end namespace ACE_OS */ ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_NS_stdio.cpp b/externals/ace/OS_NS_stdio.cpp similarity index 81% rename from dep/src/ace/OS_NS_stdio.cpp rename to externals/ace/OS_NS_stdio.cpp index 784382ecd5a..57dd1b07c83 100644 --- a/dep/src/ace/OS_NS_stdio.cpp +++ b/externals/ace/OS_NS_stdio.cpp @@ -1,11 +1,12 @@ -// $Id: OS_NS_stdio.cpp 82586 2008-08-11 12:46:00Z johnnyw $ +// $Id: OS_NS_stdio.cpp 86912 2009-10-04 14:26:19Z schmidt $ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_Thread.h" ACE_RCSID (ace, OS_NS_stdio, - "$Id: OS_NS_stdio.cpp 82586 2008-08-11 12:46:00Z johnnyw $") + "$Id: OS_NS_stdio.cpp 86912 2009-10-04 14:26:19Z schmidt $") + #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_stdio.inl" @@ -73,42 +74,6 @@ ACE_OS::ace_flock_t::dump (void) const /*****************************************************************************/ -#if defined (ACE_USES_WCHAR) -void ACE_OS::checkUnicodeFormat (FILE* fp) -{ - if (fp != 0) - { - // Due to the ACE_TCHAR definition, all default input files, such as - // svc.conf, have to be in Unicode format (small endian) on WinCE - // because ACE has all 'char' converted into ACE_TCHAR. - // However, for TAO, ASCII files, such as IOR file, can still be read - // and be written without any error since given buffers are all in 'char' - // type instead of ACE_TCHAR. Therefore, it is user's reponsibility to - // select correct buffer type. - - // At this point, check if the file is Unicode or not. - ACE_UINT16 first_two_bytes; - size_t numRead = - ACE_OS::fread(&first_two_bytes, sizeof (first_two_bytes), 1, fp); - - if (numRead == 1) - { - if ((first_two_bytes != 0xFFFE) && // not a small endian Unicode file - (first_two_bytes != 0xFEFF)) // not a big endian Unicode file - { - // set file pointer back to the beginning -#if defined (ACE_WIN32) - ACE_OS::fseek(fp, 0, FILE_BEGIN); -#else - ACE_OS::fseek(fp, 0, SEEK_SET); -#endif /* ACE_WIN32 */ - } - } - // if it is a Unicode file, file pointer will be right next to the first - // two-bytes - } -} -#endif // ACE_USES_WCHAR #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) namespace @@ -164,6 +129,11 @@ ACE_OS::fopen (const char *filename, const ACE_TCHAR *mode) { ACE_OS_TRACE ("ACE_OS::fopen"); +#if defined (ACE_LACKS_FOPEN) + ACE_UNUSED_ARG (filename); + ACE_UNUSED_ARG (mode); + ACE_NOTSUP_RETURN (0); +#else int hmode = _O_TEXT; // Let the chips fall where they may if the user passes in a NULL @@ -196,9 +166,6 @@ ACE_OS::fopen (const char *filename, # endif /* defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR)) */ if (fp != 0) { -# if defined (ACE_USES_WCHAR) - checkUnicodeFormat(fp); -# endif // ACE_USES_WCHAR return fp; } ::_close (fd); @@ -207,6 +174,7 @@ ACE_OS::fopen (const char *filename, ACE_OS::close (handle); } return 0; +#endif } #if defined (ACE_HAS_WCHAR) @@ -229,6 +197,11 @@ ACE_OS::fopen (const wchar_t *filename, const ACE_TCHAR *mode) { ACE_OS_TRACE ("ACE_OS::fopen"); +#if defined (ACE_LACKS_FOPEN) + ACE_UNUSED_ARG (filename); + ACE_UNUSED_ARG (mode); + ACE_NOTSUP_RETURN (0); +#else int hmode = _O_TEXT; for (const ACE_TCHAR *mode_ptr = mode; *mode_ptr != 0; mode_ptr++) @@ -254,9 +227,6 @@ ACE_OS::fopen (const wchar_t *filename, # endif /* defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR)) */ if (fp != 0) { -# if defined (ACE_USES_WCHAR) - checkUnicodeFormat(fp); -# endif // ACE_USES_WCHAR return fp; } ::_close (fd); @@ -265,6 +235,7 @@ ACE_OS::fopen (const wchar_t *filename, ACE_OS::close (handle); } return 0; +#endif } #endif /* ACE_HAS_WCHAR */ @@ -277,10 +248,9 @@ int ACE_OS::fprintf (FILE *fp, const char *format, ...) { // ACE_OS_TRACE ("ACE_OS::fprintf"); - int result = 0; va_list ap; va_start (ap, format); - result = ACE_OS::vfprintf (fp, format, ap); + int const result = ACE_OS::vfprintf (fp, format, ap); va_end (ap); return result; } @@ -290,10 +260,9 @@ int ACE_OS::fprintf (FILE *fp, const wchar_t *format, ...) { // ACE_OS_TRACE ("ACE_OS::fprintf"); - int result = 0; va_list ap; va_start (ap, format); - result = ACE_OS::vfprintf (fp, format, ap); + int const result = ACE_OS::vfprintf (fp, format, ap); va_end (ap); return result; } @@ -303,10 +272,9 @@ int ACE_OS::asprintf (char **bufp, const char *format, ...) { // ACE_OS_TRACE ("ACE_OS::asprintf"); - int result; va_list ap; va_start (ap, format); - result = ACE_OS::vasprintf (bufp, format, ap); + int const result = ACE_OS::vasprintf (bufp, format, ap); va_end (ap); return result; } @@ -316,10 +284,9 @@ int ACE_OS::asprintf (wchar_t **bufp, const wchar_t *format, ...) { // ACE_OS_TRACE ("ACE_OS::asprintf"); - int result; va_list ap; va_start (ap, format); - result = ACE_OS::vasprintf (bufp, format, ap); + int const result = ACE_OS::vasprintf (bufp, format, ap); va_end (ap); return result; } @@ -329,10 +296,9 @@ int ACE_OS::printf (const char *format, ...) { // ACE_OS_TRACE ("ACE_OS::printf"); - int result; va_list ap; va_start (ap, format); - result = ACE_OS::vprintf (format, ap); + int const result = ACE_OS::vprintf (format, ap); va_end (ap); return result; } @@ -342,10 +308,9 @@ int ACE_OS::printf (const wchar_t *format, ...) { // ACE_OS_TRACE ("ACE_OS::printf"); - int result; va_list ap; va_start (ap, format); - result = ACE_OS::vprintf (format, ap); + int const result = ACE_OS::vprintf (format, ap); va_end (ap); return result; } @@ -357,7 +322,7 @@ ACE_OS::snprintf (char *buf, size_t maxlen, const char *format, ...) // ACE_OS_TRACE ("ACE_OS::snprintf"); va_list ap; va_start (ap, format); - int result = ACE_OS::vsnprintf (buf, maxlen, format, ap); + int const result = ACE_OS::vsnprintf (buf, maxlen, format, ap); va_end (ap); return result; } @@ -369,7 +334,7 @@ ACE_OS::snprintf (wchar_t *buf, size_t maxlen, const wchar_t *format, ...) // ACE_OS_TRACE ("ACE_OS::snprintf"); va_list ap; va_start (ap, format); - int result = ACE_OS::vsnprintf (buf, maxlen, format, ap); + int const result = ACE_OS::vsnprintf (buf, maxlen, format, ap); va_end (ap); return result; } @@ -381,7 +346,7 @@ ACE_OS::sprintf (char *buf, const char *format, ...) // ACE_OS_TRACE ("ACE_OS::sprintf"); va_list ap; va_start (ap, format); - int result = ACE_OS::vsprintf (buf, format, ap); + int const result = ACE_OS::vsprintf (buf, format, ap); va_end (ap); return result; } @@ -393,7 +358,7 @@ ACE_OS::sprintf (wchar_t *buf, const wchar_t *format, ...) // ACE_OS_TRACE ("ACE_OS::sprintf"); va_list ap; va_start (ap, format); - int result = ACE_OS::vsprintf (buf, format, ap); + int const result = ACE_OS::vsprintf (buf, format, ap); va_end (ap); return result; } @@ -405,7 +370,7 @@ ACE_OS::vasprintf_emulation(char **bufp, const char *format, va_list argptr) { va_list ap; va_copy (ap, argptr); - int size = ACE_OS::vsnprintf(0, 0, format, ap); + int size = ACE_OS::vsnprintf (0, 0, format, ap); va_end (ap); if (size != -1) @@ -459,4 +424,3 @@ ACE_OS::vaswprintf_emulation(wchar_t **bufp, const wchar_t *format, va_list argp #endif /* ACE_HAS_WCHAR */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_stdio.h b/externals/ace/OS_NS_stdio.h similarity index 96% rename from dep/include/ace/OS_NS_stdio.h rename to externals/ace/OS_NS_stdio.h index be497f6cf90..e70a4aa97a0 100644 --- a/dep/include/ace/OS_NS_stdio.h +++ b/externals/ace/OS_NS_stdio.h @@ -4,7 +4,7 @@ /** * @file OS_NS_stdio.h * - * $Id: OS_NS_stdio.h 81840 2008-06-05 13:46:45Z sma $ + * $Id: OS_NS_stdio.h 87143 2009-10-17 10:29:01Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -34,6 +34,10 @@ # include "ace/os_include/os_unistd.h" #endif /* CYGWIN32 || ACE_OPENVMS */ +#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +# include "io.h" +#endif + #if defined (ACE_EXPORT_MACRO) # undef ACE_EXPORT_MACRO #endif @@ -108,6 +112,18 @@ inline int ace_ungetc_helper (int ch, FILE *fp) #endif /* defined (ungetc) */ } +#if !defined ACE_FILENO_EQUIVALENT +inline ACE_HANDLE ace_fileno_helper (FILE *fp) +{ +# if defined (fileno) + return (ACE_HANDLE)fileno (fp); +# undef fileno +# else + return (ACE_HANDLE)ACE_STD_NAMESPACE::fileno (fp); +# endif /* defined (fileno) */ +} +#endif /* !ACE_FILENO_EQUIVALENT */ + #if !defined (ACE_LACKS_CUSERID) && !defined(ACE_HAS_ALT_CUSERID) \ && !defined(ACE_WIN32) && !defined (ACE_VXWORKS) /// Helper for the ACE_OS::cuserid() function @@ -218,10 +234,6 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION int fclose (FILE *fp); -# if defined (fdopen) -# undef fdopen -# endif /* fdopen */ - ACE_NAMESPACE_INLINE_FUNCTION FILE *fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode); @@ -297,6 +309,10 @@ namespace ACE_OS { //@} + + ACE_NAMESPACE_INLINE_FUNCTION + ACE_HANDLE fileno (FILE *stream); + #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) extern ACE_Export #else @@ -539,4 +555,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_STDIO_H */ - diff --git a/dep/include/ace/OS_NS_stdio.inl b/externals/ace/OS_NS_stdio.inl similarity index 93% rename from dep/include/ace/OS_NS_stdio.inl rename to externals/ace/OS_NS_stdio.inl index 2c6894e46c4..64ffc18b950 100644 --- a/dep/include/ace/OS_NS_stdio.inl +++ b/externals/ace/OS_NS_stdio.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_stdio.inl 82444 2008-07-28 13:33:07Z johnnyw $ +// $Id: OS_NS_stdio.inl 87232 2009-10-26 13:25:55Z johnnyw $ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_stdlib.h" @@ -135,11 +135,11 @@ ACE_OS::flock_unlock (ACE_OS::ace_flock_t *lock, DWORD low_len = ACE_LOW_PART (len); DWORD high_len = ACE_HIGH_PART (len); ACE_WIN32CALL_RETURN ( - ACE_ADAPT_RETVAL (::UnlockFile (lock->handle_, - lock->overlapped_.Offset, - lock->overlapped_.OffsetHigh, - low_len, - high_len), + ACE_ADAPT_RETVAL (::UnlockFileEx (lock->handle_, + 0, + low_len, + high_len, + &lock->overlapped_), ace_result_), int, -1); #else lock->lock_.l_whence = whence; @@ -365,12 +365,12 @@ ACE_OS::cuserid (char *user, size_t maxlen) ::remCurIdGet (user, 0); return user; } -#elif defined (__QNXNTO__) || defined (ACE_HAS_PHARLAP) || defined (ACE_HAS_WINCE) +#elif defined (ACE_HAS_PHARLAP) || defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (user); ACE_UNUSED_ARG (maxlen); ACE_NOTSUP_RETURN (0); #elif defined (ACE_WIN32) - BOOL result = GetUserNameA (user, (u_long *) &maxlen); + BOOL const result = GetUserNameA (user, (u_long *) &maxlen); if (result == FALSE) ACE_FAIL_RETURN (0); else @@ -461,7 +461,7 @@ ACE_OS::cuserid (wchar_t *user, size_t maxlen) ACE_UNUSED_ARG (maxlen); ACE_NOTSUP_RETURN (0); # elif defined (ACE_WIN32) - BOOL result = GetUserNameW (user, (u_long *) &maxlen); + BOOL const result = GetUserNameW (user, (u_long *) &maxlen); if (result == FALSE) ACE_FAIL_RETURN (0); else @@ -498,9 +498,15 @@ ACE_OS::fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode) { ACE_OS_TRACE ("ACE_OS::fdopen"); #if defined (ACE_HAS_WINCE) +# if defined (ACE_HAS_NONCONST_WFDOPEN) + ACE_OSCALL_RETURN (::_wfdopen ((int)handle, const_cast (ACE_TEXT_ALWAYS_WCHAR (mode))), + FILE*, + 0); +# else ACE_OSCALL_RETURN (::_wfdopen (handle, ACE_TEXT_ALWAYS_WCHAR (mode)), FILE*, 0); +# endif #elif defined (ACE_WIN32) // kernel file handle -> FILE* conversion... // Options: _O_APPEND, _O_RDONLY and _O_TEXT are lost @@ -511,15 +517,11 @@ ACE_OS::fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode) if (crt_handle != -1) { -# if defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR) - file = ::_fdopen (crt_handle, const_cast (mode)); -# elif defined (ACE_HAS_NONCONST_FDOPEN) && defined (ACE_USES_WCHAR) - file = ::_wfdopen (crt_handle, const_cast (mode)); -# elif defined (ACE_USES_WCHAR) +# if defined (ACE_USES_WCHAR) file = ::_wfdopen (crt_handle, mode); # else file = ::_fdopen (crt_handle, mode); -# endif /* ACE_HAS_NONCONST_FDOPEN */ +# endif /* ACE_USES_WCHAR */ if (!file) { @@ -542,14 +544,6 @@ ACE_INLINE int ACE_OS::fflush (FILE *fp) { ACE_OS_TRACE ("ACE_OS::fflush"); -#if defined (ACE_VXWORKS) - if (fp == 0) - { - // Do not allow fflush(0) on VxWorks - return 0; - } -#endif /* ACE_VXWORKS */ - ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fflush (fp), int, -1); } @@ -587,14 +581,23 @@ ACE_OS::fgets (wchar_t *buf, int size, FILE *fp) } #endif /* ACE_HAS_WCHAR && !ACE_LACKS_FGETWS */ +ACE_INLINE ACE_HANDLE +ACE_OS::fileno (FILE *stream) +{ +#if defined ACE_FILENO_EQUIVALENT + return (ACE_HANDLE)ACE_FILENO_EQUIVALENT (stream); +#else + return ace_fileno_helper (stream); +#endif +} + #if !(defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) // Win32 PC implementation of fopen () is in OS_NS_stdio.cpp. ACE_INLINE FILE * ACE_OS::fopen (const char *filename, const char *mode) { ACE_OS_TRACE ("ACE_OS::fopen"); - ACE_OSCALL_RETURN - (::fopen (filename, mode), FILE *, 0); + ACE_OSCALL_RETURN (::fopen (filename, mode), FILE *, 0); } #if defined (ACE_HAS_WCHAR) @@ -604,17 +607,16 @@ ACE_OS::fopen (const char *filename, const wchar_t *mode) { ACE_OS_TRACE ("ACE_OS::fopen"); ACE_Wide_To_Ascii n_mode (mode); - ACE_OSCALL_RETURN - (::fopen (filename, n_mode.char_rep ()), FILE *, 0); + ACE_OSCALL_RETURN (::fopen (filename, n_mode.char_rep ()), FILE *, 0); } + // Win32 PC implementation of fopen () is in OS_NS_stdio.cpp. ACE_INLINE FILE * ACE_OS::fopen (const wchar_t *filename, const wchar_t *mode) { ACE_OS_TRACE ("ACE_OS::fopen"); #if defined (ACE_HAS_WINCE) - ACE_OSCALL_RETURN - (::_wfopen (filename, mode), FILE *, 0); + ACE_OSCALL_RETURN (::_wfopen (filename, mode), FILE *, 0); #else // Non-Windows doesn't use wchar_t file systems. ACE_Wide_To_Ascii n_filename (filename); @@ -690,7 +692,7 @@ ACE_INLINE FILE * ACE_OS::freopen (const ACE_TCHAR *filename, const ACE_TCHAR *mode, FILE* stream) { ACE_OS_TRACE ("ACE_OS::freopen"); -#if defined (ACE_WIN32) && (defined(ACE_USES_WCHAR) || defined(ACE_HAS_WINCE)) +#if defined (ACE_WIN32) && defined(ACE_USES_WCHAR) ACE_OSCALL_RETURN (::_wfreopen (ACE_TEXT_ALWAYS_WCHAR (filename), ACE_TEXT_ALWAYS_WCHAR (mode), stream), @@ -774,7 +776,7 @@ ACE_OS::perror (const wchar_t *s) #else ACE_Wide_To_Ascii n_s (s); ::perror (n_s.char_rep ()); -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_LACKS_PERROR */ } #endif /* ACE_HAS_WCHAR */ @@ -813,8 +815,8 @@ ACE_OS::rename (const char *old_name, # elif defined (ACE_HAS_WINCE) // Win CE is always wide-char. ACE_UNUSED_ARG (flags); - if (0 != MoveFile (ACE_TEXT_CHAR_TO_TCHAR (old_name), - ACE_TEXT_CHAR_TO_TCHAR (new_name))) + if (0 == ::MoveFile (ACE_TEXT_CHAR_TO_TCHAR (old_name), + ACE_TEXT_CHAR_TO_TCHAR (new_name))) ACE_FAIL_RETURN (-1); return 0; # elif defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_MOVEFILEEX) @@ -846,7 +848,7 @@ ACE_OS::rename (const wchar_t *old_name, ACE_NOTSUP_RETURN (-1); # elif defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (flags); - if (MoveFileW (old_name, new_name) != 0) + if (::MoveFileW (old_name, new_name) == 0) ACE_FAIL_RETURN (-1); return 0; # elif defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_MOVEFILEEX) @@ -879,7 +881,7 @@ ACE_OS::rewind (FILE *fp) #else // This isn't perfect since it doesn't reset EOF, but it's probably // the closest we can get on WINCE. - (void) fseek (fp, 0L, SEEK_SET); + (void) ::fseek (fp, 0L, SEEK_SET); #endif /* ACE_HAS_WINCE */ } @@ -912,7 +914,7 @@ ACE_OS::tempnam (const wchar_t *dir, const wchar_t *pfx) ACE_OSCALL_RETURN (::_wtempnam (const_cast (dir), const_cast (pfx)), wchar_t *, 0); # else ACE_OSCALL_RETURN (::_wtempnam (dir, pfx), wchar_t *, 0); -# endif /* __BORLANDC__ */ +# endif /* ACE_HAS_NONCONST_TEMPNAM */ #else /* ACE_LACKS_TEMPNAM */ // No native wide-char support; convert to narrow and call the char* variant. char *ndir = ACE_Wide_To_Ascii (dir).char_rep (); @@ -1011,8 +1013,10 @@ ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr) # if (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500) || \ (defined (sun) && !(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION-0==4))) || \ defined (ACE_HAS_DINKUM_STL) || defined (__DMC__) || \ - defined (ACE_HAS_VSWPRINTF) || defined (ACE_WIN32_VC9) || \ - (defined (ACE_WIN32_VC8) && !defined (ACE_HAS_WINCE) && \ + defined (ACE_HAS_VSWPRINTF) || \ + (defined (ACE_WIN32_VC10) && !defined (ACE_HAS_WINCE)) || \ + (defined (ACE_WIN32_VC9) && !defined (ACE_HAS_WINCE)) || \ + (defined (ACE_WIN32_VC8) && !defined (ACE_HAS_WINCE) && \ _MSC_FULL_VER > 140050000) // The XPG4/UNIX98/C99 signature of the wide-char sprintf has a @@ -1054,11 +1058,11 @@ ACE_OS::vsnprintf (char *buffer, size_t maxlen, const char *format, va_list ap) result = ::_vsnprintf (buffer, maxlen, format, ap); // Win32 doesn't regard a full buffer with no 0-terminate as an overrun. - if (result == static_cast (maxlen)) + if (result == static_cast (maxlen) && maxlen > 0) buffer[maxlen-1] = '\0'; // Win32 doesn't 0-terminate the string if it overruns maxlen. - if (result == -1) + if (result == -1 && maxlen > 0) buffer[maxlen-1] = '\0'; # endif // In out-of-range conditions, C99 defines vsnprintf() to return the number @@ -1102,25 +1106,23 @@ ACE_OS::vsnprintf (wchar_t *buffer, size_t maxlen, const wchar_t *format, va_lis result = ::_vsnwprintf (buffer, maxlen, format, ap); // Win32 doesn't regard a full buffer with no 0-terminate as an overrun. - if (result == static_cast (maxlen)) + if (result == static_cast (maxlen) && maxlen > 0) buffer[maxlen-1] = '\0'; // Win32 doesn't 0-terminate the string if it overruns maxlen. - if (result == -1) + if (result == -1 && maxlen > 0) buffer[maxlen-1] = '\0'; # else result = vswprintf (buffer, maxlen, format, ap); #endif - // In out-of-range conditions, C99 defines vsnprintf() to return the number - // of characters that would have been written if enough space was available. - // Earlier variants of the vsnprintf() (e.g. UNIX98) defined it to return - // -1. This method follows the C99 standard, but needs to guess at the - // value; uses maxlen + 1. + // In out-of-range conditions, C99 defines vsnprintf() to return the + // number of characters that would have been written if enough space + // was available. Earlier variants of the vsnprintf() (e.g. UNIX98) + // defined it to return -1. This method follows the C99 standard, + // but needs to guess at the value; uses maxlen + 1. if (result == -1) - { - result = static_cast (maxlen + 1); - } + result = static_cast (maxlen + 1); return result; diff --git a/dep/src/ace/OS_NS_stdlib.cpp b/externals/ace/OS_NS_stdlib.cpp similarity index 72% rename from dep/src/ace/OS_NS_stdlib.cpp rename to externals/ace/OS_NS_stdlib.cpp index 4ccd743cc90..c74480227d7 100644 --- a/dep/src/ace/OS_NS_stdlib.cpp +++ b/externals/ace/OS_NS_stdlib.cpp @@ -1,10 +1,10 @@ -// $Id: OS_NS_stdlib.cpp 81804 2008-05-29 16:12:07Z vzykov $ +// $Id: OS_NS_stdlib.cpp 85363 2009-05-18 07:48:11Z johnnyw $ #include "ace/OS_NS_stdlib.h" ACE_RCSID (ace, OS_NS_stdlib, - "$Id: OS_NS_stdlib.cpp 81804 2008-05-29 16:12:07Z vzykov $") + "$Id: OS_NS_stdlib.cpp 85363 2009-05-18 07:48:11Z johnnyw $") #include "ace/Default_Constants.h" @@ -61,17 +61,11 @@ ACE_OS::exit (int status) (*exit_hook_) (); #endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER && !ACE_HAS_WINCE && !ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER */ -#if !defined (ACE_HAS_WINCE) -# if defined (ACE_WIN32) +#if defined (ACE_WIN32) ::ExitProcess ((UINT) status); -# else - ::exit (status); -# endif /* ACE_WIN32 */ #else - // @@ This is not exactly the same as ExitProcess. But this is the - // closest one I can get. - ::TerminateProcess (::GetCurrentProcess (), status); -#endif /* ACE_HAS_WINCE */ + ::exit (status); +#endif /* ACE_WIN32 */ } void @@ -92,7 +86,7 @@ ACE_OS::free (void *ptr) ACE_TCHAR * ACE_OS::getenvstrings (void) { -#if defined (ACE_LACKS_ENV) +#if defined (ACE_LACKS_GETENVSTRINGS) ACE_NOTSUP_RETURN (0); #elif defined (ACE_WIN32) # if defined (ACE_USES_WCHAR) @@ -116,7 +110,7 @@ ACE_OS::strenvdup (const ACE_TCHAR *str) #if defined (ACE_HAS_WINCE) // WinCE doesn't have environment variables so we just skip it. return ACE_OS::strdup (str); -#elif defined (ACE_LACKS_ENV) +#elif defined (ACE_LACKS_STRENVDUP) ACE_UNUSED_ARG (str); ACE_NOTSUP_RETURN (0); #else @@ -343,7 +337,7 @@ ACE_OS::realloc (void *ptr, size_t nbytes) return ACE_REALLOC_FUNC (ACE_MALLOC_T (ptr), nbytes); } -#if defined (ACE_LACKS_REALPATH) && !defined (ACE_HAS_WINCE) +#if defined (ACE_LACKS_REALPATH) char * ACE_OS::realpath (const char *file_name, char *resolved_name) @@ -514,7 +508,7 @@ ACE_OS::realpath (const char *file_name, return rpath; } -#endif /* ACE_LACKS_REALPATH && !ACE_HAS_WINCE */ +#endif /* ACE_LACKS_REALPATH */ #if defined (ACE_LACKS_STRTOL) long @@ -568,7 +562,7 @@ ACE_OS::strtol_emulation (const char *nptr, char **endptr, int base) cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; cutlim = cutoff % (unsigned long)base; cutoff /= (unsigned long)base; - for (acc = 0, any = 0; ; c = *s++) { + for (acc = 0, any = 0;; c = *s++) { if (ACE_OS::ace_isdigit(c)) c -= '0'; else if (ACE_OS::ace_isalpha(c)) @@ -596,6 +590,74 @@ ACE_OS::strtol_emulation (const char *nptr, char **endptr, int base) } #endif /* ACE_LACKS_STRTOL */ +#if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSTOL) +long +ACE_OS::wcstol_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base) +{ + register const wchar_t *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + do { + c = *s++; + } while (ACE_OS::ace_isspace(c)); + if (c == L'-') { + neg = 1; + c = *s++; + } else if (c == L'+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + + /* + * See strtol for comments as to the logic used. + */ + cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; + cutlim = cutoff % (unsigned long)base; + cutoff /= (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (ACE_OS::ace_isdigit(c)) + c -= L'0'; + else if (ACE_OS::ace_isalpha(c)) + c -= ACE_OS::ace_isupper(c) ? L'A' - 10 : L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; + errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = any ? (wchar_t *)s - 1 : (wchar_t *)nptr; + return (acc); +} +#endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSTOL */ + #if defined (ACE_LACKS_STRTOUL) unsigned long ACE_OS::strtoul_emulation (const char *nptr, @@ -633,7 +695,7 @@ ACE_OS::strtoul_emulation (const char *nptr, cutoff = (unsigned long) ULONG_MAX / (unsigned long) base; cutlim = (unsigned long) ULONG_MAX % (unsigned long) base; - for (acc = 0, any = 0; ; c = *s++) + for (acc = 0, any = 0;; c = *s++) { if (ACE_OS::ace_isdigit(c)) c -= '0'; @@ -665,6 +727,213 @@ ACE_OS::strtoul_emulation (const char *nptr, } #endif /* ACE_LACKS_STRTOUL */ + +#if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSTOUL) +unsigned long +ACE_OS::wcstoul_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base) +{ + register const wchar_t *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + do + c = *s++; + while (ACE_OS::ace_isspace(c)); + if (c == L'-') + { + neg = 1; + c = *s++; + } + else if (c == L'+') + c = *s++; + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) + { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + cutoff = (unsigned long) ULONG_MAX / (unsigned long) base; + cutlim = (unsigned long) ULONG_MAX % (unsigned long) base; + + for (acc = 0, any = 0;; c = *s++) + { + if (ACE_OS::ace_isdigit(c)) + c -= L'0'; + else if (ACE_OS::ace_isalpha(c)) + c -= ACE_OS::ace_isupper(c) ? L'A' - 10 : L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else + { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) + { + acc = ULONG_MAX; + errno = ERANGE; + } + else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = any ? (wchar_t *) s - 1 : (wchar_t *) nptr; + return (acc); +} +#endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSTOUL */ + +#if defined (ACE_LACKS_STRTOLL) +ACE_INT64 +ACE_OS::strtoll_emulation (const char *nptr, + char **endptr, + register int base) +{ + register const char *s = nptr; + register ACE_UINT64 acc; + register int c; + register ACE_UINT64 cutoff; + register int neg = 0, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + do { + c = *s++; + } while (ACE_OS::ace_isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + /* + * See strtol for comments as to the logic used. + */ + cutoff = neg ? -(ACE_UINT64)ACE_INT64_MIN : ACE_INT64_MAX; + cutlim = cutoff % (ACE_UINT64)base; + cutoff /= (ACE_UINT64)base; + for (acc = 0, any = 0;; c = *s++) { + if (ACE_OS::ace_isdigit(c)) + c -= '0'; + else if (ACE_OS::ace_isalpha(c)) + c -= ACE_OS::ace_isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? ACE_INT64_MIN : ACE_INT64_MAX; + errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = any ? (char *)s - 1 : (char *)nptr; + return (acc); +} +#endif /* ACE_LACKS_STRTOLL */ + +#if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSTOLL) +ACE_INT64 +ACE_OS::wcstoll_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base) +{ + register const wchar_t *s = nptr; + register ACE_UINT64 acc; + register int c; + register ACE_UINT64 cutoff; + register int neg = 0, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + do { + c = *s++; + } while (ACE_OS::ace_isspace(c)); + if (c == L'-') { + neg = 1; + c = *s++; + } else if (c == L'+') + c = *s++; + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + + /* + * See strtol for comments as to the logic used. + */ + cutoff = neg ? -(ACE_UINT64)ACE_INT64_MIN : ACE_INT64_MAX; + cutlim = cutoff % (ACE_UINT64)base; + cutoff /= (ACE_UINT64)base; + for (acc = 0, any = 0;; c = *s++) { + if (ACE_OS::ace_isdigit(c)) + c -= L'0'; + else if (ACE_OS::ace_isalpha(c)) + c -= ACE_OS::ace_isupper(c) ? L'A' - 10 : L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? ACE_INT64_MIN : ACE_INT64_MAX; + errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = any ? (wchar_t *)s - 1 : (wchar_t *)nptr; + return (acc); +} +#endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSTOLL */ + + #if defined (ACE_LACKS_STRTOULL) ACE_UINT64 ACE_OS::strtoull_emulation (const char *nptr, @@ -703,7 +972,7 @@ ACE_OS::strtoull_emulation (const char *nptr, cutoff = (ACE_UINT64) ACE_UINT64_MAX / (ACE_UINT64) base; cutlim = (ACE_UINT64) ACE_UINT64_MAX % (ACE_UINT64) base; - for (acc = 0, any = 0; ; c = *s++) + for (acc = 0, any = 0;; c = *s++) { if (ACE_OS::ace_isdigit(c)) c -= '0'; @@ -735,6 +1004,76 @@ ACE_OS::strtoull_emulation (const char *nptr, } #endif /* ACE_LACKS_STRTOULL */ +#if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_WCSTOULL) +ACE_UINT64 +ACE_OS::wcstoull_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base) +{ + register const wchar_t *s = nptr; + register ACE_UINT64 acc; + register int c; + register ACE_UINT64 cutoff; + register int neg = 0, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + do + c = *s++; + while (ACE_OS::ace_isspace(c)); + if (c == L'-') + { + neg = 1; + c = *s++; + } + else if (c == L'+') + c = *s++; + if ((base == 0 || base == 16) && + c == L'0' && (*s == L'x' || *s == L'X')) + { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == L'0' ? 8 : 10; + + cutoff = (ACE_UINT64) ACE_UINT64_MAX / (ACE_UINT64) base; + cutlim = (ACE_UINT64) ACE_UINT64_MAX % (ACE_UINT64) base; + + for (acc = 0, any = 0;; c = *s++) + { + if (ACE_OS::ace_isdigit(c)) + c -= L'0'; + else if (ACE_OS::ace_isalpha(c)) + c -= ACE_OS::ace_isupper(c) ? L'A' - 10 : L'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else + { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) + { + acc = ACE_UINT64_MAX; + errno = ERANGE; + } + else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = any ? (wchar_t *) s - 1 : (wchar_t *) nptr; + return (acc); +} +#endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSTOULL */ + #if defined (ACE_LACKS_MKSTEMP) ACE_HANDLE ACE_OS::mkstemp_emulation (ACE_TCHAR * s) @@ -870,4 +1209,3 @@ ACE_OS::setprogname_emulation (const char* progname) #endif /* !ACE_HAS_SETPROGNAME */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_stdlib.h b/externals/ace/OS_NS_stdlib.h similarity index 69% rename from dep/include/ace/OS_NS_stdlib.h rename to externals/ace/OS_NS_stdlib.h index 696d5110eb2..28e11a96be5 100644 --- a/dep/include/ace/OS_NS_stdlib.h +++ b/externals/ace/OS_NS_stdlib.h @@ -4,7 +4,7 @@ /** * @file OS_NS_stdlib.h * - * $Id: OS_NS_stdlib.h 81804 2008-05-29 16:12:07Z vzykov $ + * $Id: OS_NS_stdlib.h 88493 2010-01-12 19:17:42Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -35,10 +35,6 @@ #endif #define ACE_EXPORT_MACRO ACE_Export -# if defined (ACE_HAS_BROKEN_R_ROUTINES) -# undef rand_r -# endif /* ACE_HAS_BROKEN_R_ROUTINES */ - // We need this for MVS... as well as Linux, etc... // On Windows, we explicitly set this up as __cdecl so it's correct even // if building with another calling convention, such as __stdcall. @@ -52,6 +48,42 @@ extern "C" { } #endif /* ACE_WIN32 && _MSC_VER */ +// FreeBSD has atop macro (not related to ACE_OS::atop) +#if defined (atop) +# undef atop +#endif + +/* + * We inline and undef some functions that may be implemented + * as macros on some platforms. This way macro definitions will + * be usable later as there is no way to save the macro definition + * using the pre-processor. + */ + +#if !defined (ACE_LACKS_STRTOLL) && !defined (ACE_STRTOLL_EQUIVALENT) +inline ACE_INT64 ace_strtoll_helper (const char *s, char **ptr, int base) +{ +# if defined (strtoll) + return strtoll (s, ptr, base); +# undef strtoll +# else + return ACE_STD_NAMESPACE::strtoll (s, ptr, base); +# endif /* strtoll */ +} +#endif /* !ACE_LACKS_STRTOLL && !ACE_STRTOLL_EQUIVALENT */ + +#if !defined (ACE_LACKS_STRTOULL) && !defined (ACE_STRTOULL_EQUIVALENT) +inline ACE_INT64 ace_strtoull_helper (const char *s, char **ptr, int base) +{ +# if defined (strtoull) + return strtoull (s, ptr, base); +# undef strtoull +# else + return ACE_STD_NAMESPACE::strtoull (s, ptr, base); +# endif /* strtoull */ +} +#endif /* !ACE_LACKS_STRTOULL && !ACE_STRTOULL_EQUIVALENT */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { @@ -62,33 +94,72 @@ namespace ACE_OS { * */ //@{ - ACE_NAMESPACE_INLINE_FUNCTION void _exit (int status = 0); ACE_NAMESPACE_INLINE_FUNCTION void abort (void); + /** + * Register an at exit hook. The @a name can be used to analyze shutdown + * problems + */ ACE_NAMESPACE_INLINE_FUNCTION - int atexit (ACE_EXIT_HOOK func); + int atexit (ACE_EXIT_HOOK func, const char* name = 0); + /* + * Convert string to integer + */ ACE_NAMESPACE_INLINE_FUNCTION int atoi (const char *s); # if defined (ACE_HAS_WCHAR) + /* + * Convert string to integer + */ ACE_NAMESPACE_INLINE_FUNCTION int atoi (const wchar_t *s); # endif /* ACE_HAS_WCHAR */ - // atop not in spec -# if defined (atop) -# undef atop -# endif /* atop */ + /* + * Convert string to long + */ + ACE_NAMESPACE_INLINE_FUNCTION + long atol (const char *s); + /* + * Convert string to long + */ +# if defined (ACE_HAS_WCHAR) + ACE_NAMESPACE_INLINE_FUNCTION + long atol (const wchar_t *s); +# endif /* ACE_HAS_WCHAR */ + + /* + * Convert string to double + */ + ACE_NAMESPACE_INLINE_FUNCTION + double atof (const char *s); + + /* + * Convert string to double + */ +# if defined (ACE_HAS_WCHAR) + ACE_NAMESPACE_INLINE_FUNCTION + double atof (const wchar_t *s); +# endif /* ACE_HAS_WCHAR */ + + // atop not in spec + /* + * Convert string to pointer + */ ACE_NAMESPACE_INLINE_FUNCTION void *atop (const char *s); # if defined (ACE_HAS_WCHAR) + /* + * Convert string to pointer + */ ACE_NAMESPACE_INLINE_FUNCTION void *atop (const wchar_t *s); # endif /* ACE_HAS_WCHAR */ @@ -171,7 +242,7 @@ namespace ACE_OS { #else extern ACE_Export ACE_TCHAR *mktemp (ACE_TCHAR *s); -#endif /* !ACE_LACKS_MSTEMP */ +#endif /* !ACE_LACKS_MKTEMP */ ACE_NAMESPACE_INLINE_FUNCTION int putenv (const char *string); @@ -191,6 +262,12 @@ namespace ACE_OS { size_t width, ACE_COMPARE_FUNC); + ACE_NAMESPACE_INLINE_FUNCTION + int setenv(const char *envname, const char *envval, int overwrite); + + ACE_NAMESPACE_INLINE_FUNCTION + int unsetenv(const char *name); + ACE_NAMESPACE_INLINE_FUNCTION int rand (void); @@ -200,7 +277,6 @@ namespace ACE_OS { extern ACE_Export void *realloc (void *, size_t); -#if !defined (ACE_HAS_WINCE) # if !defined (ACE_LACKS_REALPATH) ACE_NAMESPACE_INLINE_FUNCTION # else @@ -212,7 +288,6 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION wchar_t *realpath (const wchar_t *file_name, wchar_t *resolved_name); # endif /* ACE_HAS_WCHAR */ -#endif /* ACE_HAS_WINCE */ // exit_hook and set_exit_hook not in spec /// Function that is called by , if non-null. @@ -245,27 +320,27 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION long strtol (const char *s, char **ptr, int base); -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOL) - /// Converts a string to a long value (wchar_t version). - ACE_NAMESPACE_INLINE_FUNCTION - long strtol (const wchar_t *s, wchar_t **ptr, int base); -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOL */ - #if defined (ACE_LACKS_STRTOL) extern ACE_Export long strtol_emulation (const char *nptr, char **endptr, int base); #endif /* ACE_LACKS_STRTOL */ +#if defined (ACE_HAS_WCHAR) + /// Converts a string to a long value (wchar_t version). + ACE_NAMESPACE_INLINE_FUNCTION + long strtol (const wchar_t *s, wchar_t **ptr, int base); + +#if defined (ACE_LACKS_WCSTOL) + extern ACE_Export + long wcstol_emulation (const wchar_t *nptr, wchar_t **endptr, int base); +#endif /* ACE_LACKS_WCSTOL */ + +#endif /* ACE_HAS_WCHAR */ + /// Converts a string to an unsigned long value (char version). ACE_NAMESPACE_INLINE_FUNCTION unsigned long strtoul (const char *s, char **ptr, int base); -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOUL) - /// Converts a string to an unsigned long value (wchar_t version). - ACE_NAMESPACE_INLINE_FUNCTION - unsigned long strtoul (const wchar_t *s, wchar_t **ptr, int base); -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOUL */ - #if defined (ACE_LACKS_STRTOUL) extern ACE_Export unsigned long strtoul_emulation (const char *nptr, @@ -273,16 +348,49 @@ namespace ACE_OS { int base); #endif /* ACE_LACKS_STRTOUL */ - /// Converts a string to a 64 bit int value (char version). +#if defined (ACE_HAS_WCHAR) + /// Converts a string to an unsigned long value (wchar_t version). + ACE_NAMESPACE_INLINE_FUNCTION + unsigned long strtoul (const wchar_t *s, wchar_t **ptr, int base); + +#if defined (ACE_LACKS_WCSTOUL) + extern ACE_Export + unsigned long wcstoul_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base); +#endif /* ACE_LACKS_WCSTOUL */ + +#endif /* ACE_HAS_WCHAR */ + + /// Converts a string to a signed 64 bit int value (char version). + ACE_NAMESPACE_INLINE_FUNCTION + ACE_INT64 strtoll (const char *s, char **ptr, int base); + +#if defined (ACE_LACKS_STRTOLL) + extern ACE_Export + ACE_INT64 strtoll_emulation (const char *nptr, + char **endptr, + int base); +#endif /* ACE_LACKS_STRTOLL */ + +#if defined (ACE_HAS_WCHAR) + /// Converts a string to a signed 64 bit int value (wchar_t version). + ACE_NAMESPACE_INLINE_FUNCTION + ACE_INT64 strtoll (const wchar_t *s, wchar_t **ptr, int base); + +#if defined (ACE_LACKS_WCSTOLL) + extern ACE_Export + ACE_INT64 wcstoll_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base); +#endif /* ACE_LACKS_WCSTOLL */ + +#endif /* ACE_HAS_WCHAR */ + + /// Converts a string to a unsigned 64 bit int value (char version). ACE_NAMESPACE_INLINE_FUNCTION ACE_UINT64 strtoull (const char *s, char **ptr, int base); -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOULL) - /// Converts a string to a 64 bit int value (wchar_t version). - ACE_NAMESPACE_INLINE_FUNCTION - ACE_UINT64 strtoull (const wchar_t *s, wchar_t **ptr, int base); -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOUL */ - #if defined (ACE_LACKS_STRTOULL) extern ACE_Export ACE_UINT64 strtoull_emulation (const char *nptr, @@ -290,6 +398,20 @@ namespace ACE_OS { int base); #endif /* ACE_LACKS_STRTOULL */ +#if defined (ACE_HAS_WCHAR) + /// Converts a string to a unsigned 64 bit int value (wchar_t version). + ACE_NAMESPACE_INLINE_FUNCTION + ACE_UINT64 strtoull (const wchar_t *s, wchar_t **ptr, int base); + +#if defined (ACE_LACKS_WCSTOULL) + extern ACE_Export + ACE_UINT64 wcstoull_emulation (const wchar_t *nptr, + wchar_t **endptr, + int base); +#endif /* ACE_LACKS_WCSTOULL */ + +#endif /* ACE_HAS_WCHAR */ + ACE_NAMESPACE_INLINE_FUNCTION int system (const ACE_TCHAR *s); @@ -329,4 +451,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_STDLIB_H */ - diff --git a/dep/include/ace/OS_NS_stdlib.inl b/externals/ace/OS_NS_stdlib.inl similarity index 77% rename from dep/include/ace/OS_NS_stdlib.inl rename to externals/ace/OS_NS_stdlib.inl index e32929a353b..323149fb211 100644 --- a/dep/include/ace/OS_NS_stdlib.inl +++ b/externals/ace/OS_NS_stdlib.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_stdlib.inl 82643 2008-08-19 14:02:12Z johnnyw $ +// $Id: OS_NS_stdlib.inl 87347 2009-11-05 12:00:29Z olli $ #include "ace/config-all.h" /* Need ACE_TRACE */ #include "ace/Object_Manager_Base.h" @@ -44,9 +44,9 @@ ACE_OS::abort (void) } ACE_INLINE int -ACE_OS::atexit (ACE_EXIT_HOOK func) +ACE_OS::atexit (ACE_EXIT_HOOK func, const char* name) { - return ACE_OS_Object_Manager::instance ()->at_exit (func); + return ACE_OS_Object_Manager::instance ()->at_exit (func, name); } ACE_INLINE int @@ -59,7 +59,7 @@ ACE_OS::atoi (const char *s) ACE_INLINE int ACE_OS::atoi (const wchar_t *s) { -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) && defined (ACE_HAS_WTOI) ACE_OSCALL_RETURN (::_wtoi (s), int, -1); #else /* ACE_WIN32 */ return ACE_OS::atoi (ACE_Wide_To_Ascii (s).char_rep ()); @@ -67,9 +67,43 @@ ACE_OS::atoi (const wchar_t *s) } #endif /* ACE_HAS_WCHAR */ -#if defined (atop) -# undef atop -#endif /* atop */ +ACE_INLINE long +ACE_OS::atol (const char *s) +{ + ACE_OSCALL_RETURN (::atol (s), long, -1); +} + +#if defined (ACE_HAS_WCHAR) +ACE_INLINE long +ACE_OS::atol (const wchar_t *s) +{ +#if defined (ACE_WIN32) && defined (ACE_HAS_WTOL) + ACE_OSCALL_RETURN (::_wtol (s), long, -1); +#else /* ACE_WIN32 */ + return ACE_OS::atol (ACE_Wide_To_Ascii (s).char_rep ()); +#endif /* ACE_WIN32 */ +} +#endif /* ACE_HAS_WCHAR */ + +ACE_INLINE double +ACE_OS::atof (const char *s) +{ + ACE_OSCALL_RETURN (::atof (s), double, -1); +} + +#if defined (ACE_HAS_WCHAR) +ACE_INLINE double +ACE_OS::atof (const wchar_t *s) +{ +#if !defined (ACE_HAS_WTOF) + return ACE_OS::atof (ACE_Wide_To_Ascii (s).char_rep ()); +#elif defined (ACE_WTOF_EQUIVALENT) + ACE_OSCALL_RETURN (ACE_WTOF_EQUIVALENT (s), double, -1); +#else /* ACE_HAS__WTOF */ + ACE_OSCALL_RETURN (::wtof (s), double, -1); +#endif /* ACE_HAS_WTOF */ +} +#endif /* ACE_HAS_WCHAR */ ACE_INLINE void * ACE_OS::atop (const char *s) @@ -133,24 +167,24 @@ ACE_INLINE char * ACE_OS::getenv (const char *symbol) { ACE_OS_TRACE ("ACE_OS::getenv"); -#if defined (ACE_LACKS_ENV) +#if defined (ACE_LACKS_GETENV) ACE_UNUSED_ARG (symbol); ACE_NOTSUP_RETURN (0); -#else /* ACE_LACKS_ENV */ +#else /* ACE_LACKS_GETENV */ ACE_OSCALL_RETURN (::getenv (symbol), char *, 0); -#endif /* ACE_LACKS_ENV */ +#endif /* ACE_LACKS_GETENV */ } #if defined (ACE_HAS_WCHAR) && defined (ACE_WIN32) ACE_INLINE wchar_t * ACE_OS::getenv (const wchar_t *symbol) { -#if defined (ACE_LACKS_ENV) +#if defined (ACE_LACKS_GETENV) ACE_UNUSED_ARG (symbol); ACE_NOTSUP_RETURN (0); #else ACE_OSCALL_RETURN (::_wgetenv (symbol), wchar_t *, 0); -#endif /* ACE_LACKS_ENV */ +#endif /* ACE_LACKS_GETENV */ } #endif /* ACE_HAS_WCHAR && ACE_WIN32 */ @@ -267,21 +301,11 @@ ACE_OS::mktemp (wchar_t *s) #endif /* !ACE_LACKS_MKTEMP */ -#if defined (INTEGRITY) -extern "C" { - int putenv (char *string); -} -#endif - ACE_INLINE int ACE_OS::putenv (const char *string) { ACE_OS_TRACE ("ACE_OS::putenv"); -#if defined (ACE_HAS_WINCE) - // WinCE don't have the concept of environment variables. - ACE_UNUSED_ARG (string); - ACE_NOTSUP_RETURN (-1); -#elif defined (ACE_LACKS_PUTENV) && defined (ACE_HAS_SETENV) +#if defined (ACE_LACKS_PUTENV) && defined (ACE_HAS_SETENV) int result = 0; char *sp = ACE_OS::strchr (const_cast (string), '='); if (sp) @@ -290,7 +314,7 @@ ACE_OS::putenv (const char *string) if (stmp) { stmp[sp - string] = '\0'; - ACE_OSCALL (::setenv (stmp, sp+sizeof (char), 1), int, -1, result); + result = ACE_OS::setenv (stmp, sp+sizeof (char), 1); ACE_OS::free (stmp); } else @@ -300,15 +324,46 @@ ACE_OS::putenv (const char *string) } } else - ACE_OSCALL (::setenv (string, "", 1), int, -1, result); + { + result = ACE_OS::setenv (string, "", 1); + } return result; -#elif defined (ACE_LACKS_ENV) || defined (ACE_LACKS_PUTENV) +#elif defined (ACE_LACKS_PUTENV) ACE_UNUSED_ARG (string); ACE_NOTSUP_RETURN (0); #else /* ! ACE_HAS_WINCE */ ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::putenv (const_cast (string)), int, -1); -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_LACKS_PUTENV && ACE_HAS_SETENV */ +} + +ACE_INLINE int +ACE_OS::setenv(const char *envname, const char *envval, int overwrite) +{ +#if defined (ACE_LACKS_SETENV) + ACE_UNUSED_ARG (envname); + ACE_UNUSED_ARG (envval); + ACE_UNUSED_ARG (overwrite); + ACE_NOTSUP_RETURN (-1); +#else + ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::setenv (envname, envval, overwrite), int, -1); +#endif +} + +ACE_INLINE int +ACE_OS::unsetenv(const char *name) +{ +#if defined (ACE_LACKS_UNSETENV) + ACE_UNUSED_ARG (name); + ACE_NOTSUP_RETURN (-1); +#else +# if defined (ACE_HAS_VOID_UNSETENV) + ::unsetenv (name); + return 0; +#else + ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::unsetenv (name), int, -1); +# endif /* ACE_HAS_VOID_UNSETENV */ +#endif /* ACE_LACKS_UNSETENV */ } #if defined (ACE_HAS_WCHAR) && defined (ACE_WIN32) @@ -316,13 +371,12 @@ ACE_INLINE int ACE_OS::putenv (const wchar_t *string) { ACE_OS_TRACE ("ACE_OS::putenv"); -#if defined (ACE_HAS_WINCE) - // WinCE doesn't have the concept of environment variables. +#if defined (ACE_LACKS_PUTENV) ACE_UNUSED_ARG (string); ACE_NOTSUP_RETURN (-1); #else ACE_OSCALL_RETURN (::_wputenv (string), int, -1); -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_LACKS_PUTENV */ } #endif /* ACE_HAS_WCHAR && ACE_WIN32 */ @@ -390,7 +444,6 @@ ACE_OS::rand_r (ACE_RANDR_TYPE& seed) #endif /* !ACE_WIN32 */ -#if !defined (ACE_HAS_WINCE) # if !defined (ACE_LACKS_REALPATH) ACE_INLINE char * ACE_OS::realpath (const char *file_name, @@ -402,7 +455,6 @@ ACE_OS::realpath (const char *file_name, return ::realpath (file_name, resolved_name); # endif /* ! ACE_WIN32 */ } -# endif /* !ACE_LACKS_REALPATH */ # if defined (ACE_HAS_WCHAR) ACE_INLINE wchar_t * @@ -467,13 +519,17 @@ ACE_OS::strtol (const char *s, char **ptr, int base) #endif /* ACE_LACKS_STRTOL */ } -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOL) +#if defined (ACE_HAS_WCHAR) ACE_INLINE long ACE_OS::strtol (const wchar_t *s, wchar_t **ptr, int base) { +#if defined (ACE_LACKS_WCSTOL) + return ACE_OS::wcstol_emulation (s, ptr, base); +#else return ACE_WCHAR_STD_NAMESPACE::wcstol (s, ptr, base); +#endif /* ACE_LACKS_WCSTOL */ } -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOL */ +#endif /* ACE_HAS_WCHAR */ ACE_INLINE unsigned long ACE_OS::strtoul (const char *s, char **ptr, int base) @@ -485,13 +541,43 @@ ACE_OS::strtoul (const char *s, char **ptr, int base) #endif /* ACE_LACKS_STRTOUL */ } -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOUL) +#if defined (ACE_HAS_WCHAR) ACE_INLINE unsigned long ACE_OS::strtoul (const wchar_t *s, wchar_t **ptr, int base) { +#if defined (ACE_LACKS_WCSTOUL) + return ACE_OS::wcstoul_emulation (s, ptr, base); +#else return ACE_WCHAR_STD_NAMESPACE::wcstoul (s, ptr, base); +#endif /* ACE_LACKS_WCSTOUL */ } -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOUL */ +#endif /* ACE_HAS_WCHAR */ + +ACE_INLINE ACE_INT64 +ACE_OS::strtoll (const char *s, char **ptr, int base) +{ +#if defined (ACE_LACKS_STRTOLL) + return ACE_OS::strtoll_emulation (s, ptr, base); +#elif defined (ACE_STRTOLL_EQUIVALENT) + return ACE_STRTOLL_EQUIVALENT (s, ptr, base); +#else + return ace_strtoll_helper (s, ptr, base); +#endif /* ACE_LACKS_STRTOLL */ +} + +#if defined (ACE_HAS_WCHAR) +ACE_INLINE ACE_INT64 +ACE_OS::strtoll (const wchar_t *s, wchar_t **ptr, int base) +{ +#if defined (ACE_LACKS_WCSTOLL) + return ACE_OS::wcstoll_emulation (s, ptr, base); +#elif defined (ACE_WCSTOLL_EQUIVALENT) + return ACE_WCSTOLL_EQUIVALENT (s, ptr, base); +#else + return ACE_WCHAR_STD_NAMESPACE::wcstoll (s, ptr, base); +#endif /* ACE_LACKS_WCSTOLL */ +} +#endif /* ACE_HAS_WCHAR */ ACE_INLINE ACE_UINT64 ACE_OS::strtoull (const char *s, char **ptr, int base) @@ -501,21 +587,23 @@ ACE_OS::strtoull (const char *s, char **ptr, int base) #elif defined (ACE_STRTOULL_EQUIVALENT) return ACE_STRTOULL_EQUIVALENT (s, ptr, base); #else - return ::strtoull (s, ptr, base); + return ace_strtoull_helper (s, ptr, base); #endif /* ACE_LACKS_STRTOULL */ } -#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOULL) +#if defined (ACE_HAS_WCHAR) ACE_INLINE ACE_UINT64 ACE_OS::strtoull (const wchar_t *s, wchar_t **ptr, int base) { -#if defined (ACE_WCSTOOULL_EQUIVALENT) - return ACE_WCSTOOULL_EQUIVALENT (s, ptr, base); +#if defined (ACE_LACKS_WCSTOULL) + return ACE_OS::wcstoull_emulation (s, ptr, base); +#elif defined (ACE_WCSTOULL_EQUIVALENT) + return ACE_WCSTOULL_EQUIVALENT (s, ptr, base); #else return ACE_WCHAR_STD_NAMESPACE::wcstoull (s, ptr, base); -#endif /* ACE_WIN32 */ +#endif /* ACE_LACKS_WCSTOULL */ } -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOULL */ +#endif /* ACE_HAS_WCHAR */ ACE_INLINE int ACE_OS::system (const ACE_TCHAR *s) diff --git a/dep/src/ace/OS_NS_string.cpp b/externals/ace/OS_NS_string.cpp similarity index 81% rename from dep/src/ace/OS_NS_string.cpp rename to externals/ace/OS_NS_string.cpp index 924d8199af9..d1c45fc872e 100644 --- a/dep/src/ace/OS_NS_string.cpp +++ b/externals/ace/OS_NS_string.cpp @@ -1,25 +1,18 @@ -// $Id: OS_NS_string.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_string.cpp 88331 2009-12-24 09:54:25Z johnnyw $ -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_stdlib.h" #include "ace/ACE.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_stdlib.h" ACE_RCSID (ace, OS_NS_string, - "$Id: OS_NS_string.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: OS_NS_string.cpp 88331 2009-12-24 09:54:25Z johnnyw $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_string.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ -#if defined (ACE_HAS_WCHAR) -# include "ace/OS_NS_stdlib.h" -#endif /* ACE_HAS_WCHAR */ - -#if !defined (ACE_LACKS_STRERROR) -# include "ace/OS_NS_stdio.h" -#endif /* ACE_LACKS_STRERROR */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL #if defined (ACE_LACKS_MEMCHR) @@ -125,6 +118,9 @@ ACE_OS::strerror (int errnum) errmsg = ret_errortext; ACE_SECURECRTCALL (strerror_s (ret_errortext, sizeof(ret_errortext), errnum), char *, 0, errmsg); + if (errnum < 0 || errnum >= _sys_nerr) + g = EINVAL; + return errmsg; #elif defined (ACE_WIN32) if (errnum < 0 || errnum >= _sys_nerr) @@ -147,12 +143,48 @@ ACE_OS::strerror (int errnum) * Just returns "Unknown Error" all the time. */ char * -ACE_OS::strerror_emulation (int errnum) +ACE_OS::strerror_emulation (int) { - return "Unknown Error"; + return const_cast ("Unknown Error"); } #endif /* ACE_LACKS_STRERROR */ + +char * +ACE_OS::strsignal (int signum) +{ + static char signal_text[128]; +#if defined (ACE_HAS_STRSIGNAL) + char *ret_val = 0; + +# if defined (ACE_NEEDS_STRSIGNAL_RANGE_CHECK) + if (signum < 0 || signum >= ACE_NSIG) + ret_val = 0; + else +# endif /* (ACE_NEEDS_STRSIGNAL_RANGE_CHECK */ + ret_val = ACE_STD_NAMESPACE::strsignal (signum); + + if (ret_val <= reinterpret_cast (0)) + { + ACE_OS::sprintf (signal_text, "Unknown signal: %d", signum); + ret_val = signal_text; + } + return ret_val; +#else + if (signum < 0 || signum >= ACE_NSIG) + { + ACE_OS::sprintf (signal_text, "Unknown signal: %d", signum); + return signal_text; + } +# if defined (ACE_SYS_SIGLIST) + return ACE_SYS_SIGLIST[signum]; +# else + ACE_OS::sprintf (signal_text, "Signal: %d", signum); + return signal_text; +# endif /* ACE_SYS_SIGLIST */ +#endif /* ACE_HAS_STRSIGNAL */ +} + const char * ACE_OS::strnchr (const char *s, int c, size_t len) { @@ -167,8 +199,12 @@ const ACE_WCHAR_T * ACE_OS::strnchr (const ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len) { for (size_t i = 0; i < len; ++i) - if (s[i] == c) - return s + i; + { + if (s[i] == c) + { + return s + i; + } + } return 0; } @@ -189,8 +225,10 @@ ACE_OS::strnstr (const char *s1, const char *s2, size_t len2) for (size_t i = 0; i <= len; i++) { if (ACE_OS::memcmp (s1 + i, s2, len2) == 0) - // Found a match! Return the index. - return s1 + i; + { + // Found a match! Return the index. + return s1 + i; + } } return 0; @@ -200,20 +238,22 @@ const ACE_WCHAR_T * ACE_OS::strnstr (const ACE_WCHAR_T *s1, const ACE_WCHAR_T *s2, size_t len2) { // Substring length - const size_t len1 = ACE_OS::strlen (s1); + size_t const len1 = ACE_OS::strlen (s1); // Check if the substring is longer than the string being searched. if (len2 > len1) return 0; // Go upto - const size_t len = len1 - len2; + size_t const len = len1 - len2; for (size_t i = 0; i <= len; i++) { if (ACE_OS::memcmp (s1 + i, s2, len2 * sizeof (ACE_WCHAR_T)) == 0) - // Found a match! Return the index. - return s1 + i; + { + // Found a match! Return the index. + return s1 + i; + } } return 0; @@ -293,7 +333,9 @@ ACE_OS::strsncpy (char *dst, const char *src, size_t maxlen) { *rdst = '\0'; if (rsrc != 0) - strncat (rdst, rsrc, --rmaxlen); + { + ACE_OS::strncat (rdst, rsrc, --rmaxlen); + } } else { @@ -313,11 +355,13 @@ ACE_OS::strsncpy (ACE_WCHAR_T *dst, const ACE_WCHAR_T *src, size_t maxlen) if (rmaxlen > 0) { - if (rdst!=rsrc) + if (rdst!= rsrc) { *rdst = ACE_TEXT_WIDE ('\0'); if (rsrc != 0) - strncat (rdst, rsrc, --rmaxlen); + { + ACE_OS::strncat (rdst, rsrc, --rmaxlen); + } } else { @@ -339,11 +383,11 @@ ACE_OS::strtok_r_emulation (char *s, const char *tokens, char **lasts) *lasts = s; if (*s == 0) // We have reached the end return 0; - size_t l_org = ACE_OS::strlen (s); + size_t const l_org = ACE_OS::strlen (s); s = ::strtok (s, tokens); if (s == 0) return 0; - const size_t l_sub = ACE_OS::strlen (s); + size_t const l_sub = ACE_OS::strlen (s); if (s + l_sub < *lasts + l_org) *lasts = s + l_sub + 1; else @@ -375,4 +419,3 @@ ACE_OS::strtok_r_emulation (ACE_WCHAR_T *s, # endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSTOK */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_string.h b/externals/ace/OS_NS_string.h similarity index 96% rename from dep/include/ace/OS_NS_string.h rename to externals/ace/OS_NS_string.h index d75fbce6ece..2497f2c0c64 100644 --- a/dep/include/ace/OS_NS_string.h +++ b/externals/ace/OS_NS_string.h @@ -4,7 +4,7 @@ /** * @file OS_NS_string.h * - * $Id: OS_NS_string.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_string.h 87481 2009-11-11 11:46:10Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -183,11 +183,9 @@ namespace ACE_OS { wchar_t *strecpy (wchar_t *s, const wchar_t *t); #endif /* ACE_HAS_WCHAR */ - /* - ** Returns a system error message. If the supplied errnum is out of range, - ** a string of the form "Unknown error %d" is used to format the string - ** whose pointer is returned and errno is set to EINVAL. - */ + /// Returns a system error message. If the supplied errnum is out of range, + /// a string of the form "Unknown error %d" is used to format the string + /// whose pointer is returned and errno is set to EINVAL. extern ACE_Export char *strerror (int errnum); @@ -197,6 +195,14 @@ namespace ACE_OS { char *strerror_emulation (int errnum); #endif /* ACE_LACKS_STRERROR */ + + /// Returns a string describing the signal number passed in the + /// argument signum. If the supplied signal number is out of range, + /// a string of the form "Unknown signal %d" is used to format the string + /// whose pointer is returned. + extern ACE_Export + char *strsignal (int signum); + /// Finds the length of a string (char version). ACE_NAMESPACE_INLINE_FUNCTION size_t strlen (const char *s); @@ -469,4 +475,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_STRING_H */ - diff --git a/dep/include/ace/OS_NS_string.inl b/externals/ace/OS_NS_string.inl similarity index 100% rename from dep/include/ace/OS_NS_string.inl rename to externals/ace/OS_NS_string.inl diff --git a/dep/src/ace/OS_NS_strings.cpp b/externals/ace/OS_NS_strings.cpp similarity index 99% rename from dep/src/ace/OS_NS_strings.cpp rename to externals/ace/OS_NS_strings.cpp index 74510861fe0..5b5cfcf4917 100644 --- a/dep/src/ace/OS_NS_strings.cpp +++ b/externals/ace/OS_NS_strings.cpp @@ -82,4 +82,3 @@ ACE_OS::strncasecmp_emulation (const char *s, #endif /* ACE_LACKS_STRCASECMP */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_strings.h b/externals/ace/OS_NS_strings.h similarity index 99% rename from dep/include/ace/OS_NS_strings.h rename to externals/ace/OS_NS_strings.h index 7f1ad48c831..9a9775230ec 100644 --- a/dep/include/ace/OS_NS_strings.h +++ b/externals/ace/OS_NS_strings.h @@ -84,4 +84,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_STRINGS_H */ - diff --git a/dep/include/ace/OS_NS_strings.inl b/externals/ace/OS_NS_strings.inl similarity index 100% rename from dep/include/ace/OS_NS_strings.inl rename to externals/ace/OS_NS_strings.inl diff --git a/dep/src/ace/OS_NS_stropts.cpp b/externals/ace/OS_NS_stropts.cpp similarity index 96% rename from dep/src/ace/OS_NS_stropts.cpp rename to externals/ace/OS_NS_stropts.cpp index 83fb822606b..174133e589d 100644 --- a/dep/src/ace/OS_NS_stropts.cpp +++ b/externals/ace/OS_NS_stropts.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_stropts.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_stropts.cpp 85460 2009-05-29 13:38:50Z msmit $ #include "ace/OS_NS_stropts.h" -ACE_RCSID(ace, OS_NS_stropts, "$Id: OS_NS_stropts.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_stropts, "$Id: OS_NS_stropts.cpp 85460 2009-05-29 13:38:50Z msmit $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_stropts.inl" @@ -47,7 +47,6 @@ ACE_OS::ioctl (ACE_HANDLE socket, # endif /* ACE_HAS_WINSOCK2 */ } -#if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) int ACE_OS::ioctl (ACE_HANDLE socket, unsigned long io_control_code, @@ -98,6 +97,7 @@ ACE_OS::ioctl (ACE_HANDLE socket, 0, 0); + if (result == SOCKET_ERROR) { unsigned long dwErr = ::WSAGetLastError (); @@ -173,6 +173,7 @@ ACE_OS::ioctl (ACE_HANDLE socket, ace_qos.receiving_flowspec (&receiving_flowspec); ace_qos.provider_specific (*((struct iovec *) (&qos->ProviderSpecific))); + return result; } @@ -188,7 +189,5 @@ ACE_OS::ioctl (ACE_HANDLE socket, ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_WINSOCK2 */ } -#endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_stropts.h b/externals/ace/OS_NS_stropts.h similarity index 93% rename from dep/include/ace/OS_NS_stropts.h rename to externals/ace/OS_NS_stropts.h index edae88c3e25..5b96b617c24 100644 --- a/dep/include/ace/OS_NS_stropts.h +++ b/externals/ace/OS_NS_stropts.h @@ -4,7 +4,7 @@ /** * @file OS_NS_stropts.h * - * $Id: OS_NS_stropts.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_stropts.h 85110 2009-04-20 09:18:43Z msmit $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -108,13 +108,13 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION int fdetach (const char *file); - /// UNIX-style . + /// UNIX-style @c ioctl ACE_NAMESPACE_INLINE_FUNCTION int ioctl (ACE_HANDLE handle, ACE_IOCTL_TYPE_ARG2 cmd, void * = 0); - /// QoS-enabled . + /// QoS-enabled @c ioctl extern ACE_Export int ioctl (ACE_HANDLE socket, unsigned long io_control_code, @@ -126,8 +126,7 @@ namespace ACE_OS { ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func); -#if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) - /// QoS-enabled when the I/O control code is either + /// QoS-enabled @c ioctl when the I/O control code is either /// SIO_SET_QOS or SIO_GET_QOS. extern ACE_Export int ioctl (ACE_HANDLE socket, @@ -138,7 +137,6 @@ namespace ACE_OS { unsigned long buffer = 0, ACE_OVERLAPPED *overlapped = 0, ACE_OVERLAPPED_COMPLETION_FUNC func = 0); -#endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */ ACE_NAMESPACE_INLINE_FUNCTION int isastream (ACE_HANDLE handle); @@ -170,4 +168,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_STROPTS_H */ - diff --git a/dep/include/ace/OS_NS_stropts.inl b/externals/ace/OS_NS_stropts.inl similarity index 100% rename from dep/include/ace/OS_NS_stropts.inl rename to externals/ace/OS_NS_stropts.inl diff --git a/dep/src/ace/OS_NS_sys_mman.cpp b/externals/ace/OS_NS_sys_mman.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_mman.cpp rename to externals/ace/OS_NS_sys_mman.cpp index d4224bb5d59..d0b02a9e056 100644 --- a/dep/src/ace/OS_NS_sys_mman.cpp +++ b/externals/ace/OS_NS_sys_mman.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_mman, "$Id: OS_NS_sys_mman.cpp 80826 2008-03-04 14:51:2 # include "ace/OS_NS_sys_mman.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_mman.h b/externals/ace/OS_NS_sys_mman.h similarity index 99% rename from dep/include/ace/OS_NS_sys_mman.h rename to externals/ace/OS_NS_sys_mman.h index b9015a7fa61..c4dd05e83c5 100644 --- a/dep/include/ace/OS_NS_sys_mman.h +++ b/externals/ace/OS_NS_sys_mman.h @@ -95,4 +95,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_MMAN_H */ - diff --git a/dep/include/ace/OS_NS_sys_mman.inl b/externals/ace/OS_NS_sys_mman.inl similarity index 93% rename from dep/include/ace/OS_NS_sys_mman.inl rename to externals/ace/OS_NS_sys_mman.inl index de5935fb9b9..fb8a9a0b657 100644 --- a/dep/include/ace/OS_NS_sys_mman.inl +++ b/externals/ace/OS_NS_sys_mman.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_sys_mman.inl 82171 2008-06-25 13:32:01Z jtc $ +// $Id: OS_NS_sys_mman.inl 85429 2009-05-25 09:53:48Z johnnyw $ #include "ace/OS_NS_fcntl.h" #include "ace/OS_NS_unistd.h" @@ -75,10 +75,14 @@ ACE_OS::mmap (void *addr, if (ACE_BIT_ENABLED (flags, MAP_PRIVATE)) { -# if !defined(ACE_HAS_WINCE) +# if defined(ACE_HAS_WINCE) + // PAGE_WRITECOPY is not avaible on CE, but this should be the same + // as PAGE_READONLY according to MSDN + nt_flags = FILE_MAP_ALL_ACCESS; +# else prot = PAGE_WRITECOPY; -# endif // ACE_HAS_WINCE nt_flags = FILE_MAP_COPY; +# endif // ACE_HAS_WINCE } else if (ACE_BIT_ENABLED (flags, MAP_SHARED)) { @@ -93,7 +97,7 @@ ACE_OS::mmap (void *addr, { SECURITY_ATTRIBUTES sa_buffer; SECURITY_DESCRIPTOR sd_buffer; - const LPSECURITY_ATTRIBUTES attr = + LPSECURITY_ATTRIBUTES const attr = ACE_OS::default_win32_security_attributes_r (sa, &sa_buffer, &sd_buffer); @@ -102,7 +106,7 @@ ACE_OS::mmap (void *addr, attr, prot, 0, - 0, + (file_handle == ACE_INVALID_HANDLE) ? len : 0, file_mapping_name); } @@ -116,20 +120,20 @@ ACE_OS::mmap (void *addr, DWORD low_off = ACE_LOW_PART (off); DWORD high_off = ACE_HIGH_PART (off); -# if !defined (ACE_HAS_WINCE) +# if defined (ACE_HAS_WINCE) + void *addr_mapping = ::MapViewOfFile (*file_mapping, + nt_flags, + high_off, + low_off, + len); +# else void *addr_mapping = ::MapViewOfFileEx (*file_mapping, nt_flags, high_off, low_off, len, addr); -# else - void *addr_mapping = ::MapViewOfFile (*file_mapping, - nt_flags, - high_off, - low_off, - len); -# endif /* ! ACE_HAS_WINCE */ +# endif /* ACE_HAS_WINCE */ // Only close this down if we used the temporary. if (file_mapping == &local_handle) @@ -239,7 +243,7 @@ ACE_OS::shm_open (const ACE_TCHAR *filename, ACE_OS_TRACE ("ACE_OS::shm_open"); #if defined (ACE_HAS_SHM_OPEN) ACE_UNUSED_ARG (sa); -#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x650) +#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670) // With VxWorks the file should just start with / and no other // slashes, so replace all other / by _ ACE_TCHAR buf [MAXPATHLEN + 1]; @@ -271,7 +275,7 @@ ACE_OS::shm_unlink (const ACE_TCHAR *path) { ACE_OS_TRACE ("ACE_OS::shm_unlink"); #if defined (ACE_HAS_SHM_OPEN) -#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x650) +#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x670) // With VxWorks the file should just start with / and no other // slashes, so replace all other / by _ ACE_TCHAR buf [MAXPATHLEN + 1]; diff --git a/dep/src/ace/OS_NS_sys_msg.cpp b/externals/ace/OS_NS_sys_msg.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_msg.cpp rename to externals/ace/OS_NS_sys_msg.cpp index 4cc59b49b2a..3e2b177b765 100644 --- a/dep/src/ace/OS_NS_sys_msg.cpp +++ b/externals/ace/OS_NS_sys_msg.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_msg, "$Id: OS_NS_sys_msg.cpp 80826 2008-03-04 14:51:23Z # include "ace/OS_NS_sys_msg.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_msg.h b/externals/ace/OS_NS_sys_msg.h similarity index 99% rename from dep/include/ace/OS_NS_sys_msg.h rename to externals/ace/OS_NS_sys_msg.h index a2599407d8a..24b4f5057c6 100644 --- a/dep/include/ace/OS_NS_sys_msg.h +++ b/externals/ace/OS_NS_sys_msg.h @@ -75,4 +75,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_MSG_H */ - diff --git a/dep/include/ace/OS_NS_sys_msg.inl b/externals/ace/OS_NS_sys_msg.inl similarity index 100% rename from dep/include/ace/OS_NS_sys_msg.inl rename to externals/ace/OS_NS_sys_msg.inl diff --git a/dep/src/ace/OS_NS_sys_resource.cpp b/externals/ace/OS_NS_sys_resource.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_resource.cpp rename to externals/ace/OS_NS_sys_resource.cpp index 516d9e4d003..58d29f604f9 100644 --- a/dep/src/ace/OS_NS_sys_resource.cpp +++ b/externals/ace/OS_NS_sys_resource.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_resource, "$Id: OS_NS_sys_resource.cpp 80826 2008-03-04 # include "ace/OS_NS_sys_resource.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_resource.h b/externals/ace/OS_NS_sys_resource.h similarity index 100% rename from dep/include/ace/OS_NS_sys_resource.h rename to externals/ace/OS_NS_sys_resource.h index b8467975d5f..009cb13560e 100644 --- a/dep/include/ace/OS_NS_sys_resource.h +++ b/externals/ace/OS_NS_sys_resource.h @@ -46,6 +46,7 @@ namespace ACE_OS int getrusage (int who, struct rusage *rusage); + ACE_NAMESPACE_INLINE_FUNCTION int setrlimit (int resource, const struct rlimit *rl); @@ -64,4 +65,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_RESOURCE_H */ - diff --git a/dep/include/ace/OS_NS_sys_resource.inl b/externals/ace/OS_NS_sys_resource.inl similarity index 100% rename from dep/include/ace/OS_NS_sys_resource.inl rename to externals/ace/OS_NS_sys_resource.inl diff --git a/dep/src/ace/OS_NS_sys_select.cpp b/externals/ace/OS_NS_sys_select.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_select.cpp rename to externals/ace/OS_NS_sys_select.cpp index afe41b7a3e7..9c6588ad43e 100644 --- a/dep/src/ace/OS_NS_sys_select.cpp +++ b/externals/ace/OS_NS_sys_select.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_select, "$Id: OS_NS_sys_select.cpp 80826 2008-03-04 14: # include "ace/OS_NS_sys_select.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_select.h b/externals/ace/OS_NS_sys_select.h similarity index 99% rename from dep/include/ace/OS_NS_sys_select.h rename to externals/ace/OS_NS_sys_select.h index 8425f3eb66c..94e7d84ab50 100644 --- a/dep/include/ace/OS_NS_sys_select.h +++ b/externals/ace/OS_NS_sys_select.h @@ -75,4 +75,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_SELECT_H */ - diff --git a/dep/include/ace/OS_NS_sys_select.inl b/externals/ace/OS_NS_sys_select.inl similarity index 100% rename from dep/include/ace/OS_NS_sys_select.inl rename to externals/ace/OS_NS_sys_select.inl diff --git a/dep/src/ace/OS_NS_sys_sendfile.cpp b/externals/ace/OS_NS_sys_sendfile.cpp similarity index 89% rename from dep/src/ace/OS_NS_sys_sendfile.cpp rename to externals/ace/OS_NS_sys_sendfile.cpp index bf0911d5653..3bb74becc5e 100644 --- a/dep/src/ace/OS_NS_sys_sendfile.cpp +++ b/externals/ace/OS_NS_sys_sendfile.cpp @@ -1,4 +1,4 @@ -// $Id: OS_NS_sys_sendfile.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_sys_sendfile.cpp 84216 2009-01-22 18:34:40Z johnnyw $ #include "ace/OS_NS_sys_sendfile.h" #include "ace/OS_NS_sys_mman.h" @@ -15,7 +15,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -#ifndef ACE_HAS_SENDFILE +#if defined ACE_HAS_SENDFILE && ACE_HAS_SENDFILE == 0 ssize_t ACE_OS::sendfile_emulation (ACE_HANDLE out_fd, ACE_HANDLE in_fd, @@ -48,7 +48,6 @@ ACE_OS::sendfile_emulation (ACE_HANDLE out_fd, return r; } -#endif /* !ACE_HAS_SENDFILE */ +#endif /* ACE_HAS_SENDFILE==0 */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_sys_sendfile.h b/externals/ace/OS_NS_sys_sendfile.h similarity index 89% rename from dep/include/ace/OS_NS_sys_sendfile.h rename to externals/ace/OS_NS_sys_sendfile.h index 3948a88b25e..b39f2a1ec04 100644 --- a/dep/include/ace/OS_NS_sys_sendfile.h +++ b/externals/ace/OS_NS_sys_sendfile.h @@ -4,7 +4,7 @@ /** * @file OS_NS_sys_sendfile.h * - * $Id: OS_NS_sys_sendfile.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_sys_sendfile.h 84216 2009-01-22 18:34:40Z johnnyw $ * * @author Ossama Othman */ @@ -22,12 +22,14 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Basic_Types.h" /* For ssize_t and off_t. */ +#include "ace/config-all.h" #if defined (ACE_EXPORT_MACRO) # undef ACE_EXPORT_MACRO #endif #define ACE_EXPORT_MACRO ACE_Export + ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS @@ -39,13 +41,13 @@ namespace ACE_OS off_t * offset, size_t count); -#ifndef ACE_HAS_SENDFILE +#if defined ACE_HAS_SENDFILE && ACE_HAS_SENDFILE == 0 extern ACE_Export ssize_t sendfile_emulation (ACE_HANDLE out_fd, ACE_HANDLE in_fd, off_t * offset, size_t count); -#endif /* !ACE_HAS_SENDFILE */ +#endif /* ACE_HAS_SENDFILE==0 */ } @@ -62,4 +64,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_SENDFILE_H */ - diff --git a/dep/include/ace/OS_NS_sys_sendfile.inl b/externals/ace/OS_NS_sys_sendfile.inl similarity index 62% rename from dep/include/ace/OS_NS_sys_sendfile.inl rename to externals/ace/OS_NS_sys_sendfile.inl index 72270e8f396..9ea878c43ea 100644 --- a/dep/include/ace/OS_NS_sys_sendfile.inl +++ b/externals/ace/OS_NS_sys_sendfile.inl @@ -1,10 +1,10 @@ // -*- C++ -*- // -// $Id: OS_NS_sys_sendfile.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_sys_sendfile.inl 84216 2009-01-22 18:34:40Z johnnyw $ -#ifdef ACE_HAS_SENDFILE +#if defined ACE_HAS_SENDFILE && ACE_HAS_SENDFILE == 1 # include -#endif /* ACE_HAS_SENDFILE */ +#endif /* ACE_HAS_SENDFILE==1 */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -14,11 +14,11 @@ ACE_OS::sendfile (ACE_HANDLE out_fd, off_t * offset, size_t count) { -#ifdef ACE_HAS_SENDFILE +#if defined ACE_HAS_SENDFILE && ACE_HAS_SENDFILE == 1 return ::sendfile (out_fd, in_fd, offset, count); #else return ACE_OS::sendfile_emulation (out_fd, in_fd, offset, count); -#endif /* ACE_HAS_SENDFILE */ +#endif /* ACE_HAS_SENDFILE==1 */ } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_NS_sys_shm.cpp b/externals/ace/OS_NS_sys_shm.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_shm.cpp rename to externals/ace/OS_NS_sys_shm.cpp index db4792c9476..4c2353935da 100644 --- a/dep/src/ace/OS_NS_sys_shm.cpp +++ b/externals/ace/OS_NS_sys_shm.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_shm, "$Id: OS_NS_sys_shm.cpp 80826 2008-03-04 14:51:23Z # include "ace/OS_NS_sys_shm.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_shm.h b/externals/ace/OS_NS_sys_shm.h similarity index 99% rename from dep/include/ace/OS_NS_sys_shm.h rename to externals/ace/OS_NS_sys_shm.h index bd5cbadc80b..9f34b482bc9 100644 --- a/dep/include/ace/OS_NS_sys_shm.h +++ b/externals/ace/OS_NS_sys_shm.h @@ -72,4 +72,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_SHM_H */ - diff --git a/dep/include/ace/OS_NS_sys_shm.inl b/externals/ace/OS_NS_sys_shm.inl similarity index 100% rename from dep/include/ace/OS_NS_sys_shm.inl rename to externals/ace/OS_NS_sys_shm.inl diff --git a/dep/src/ace/OS_NS_sys_socket.cpp b/externals/ace/OS_NS_sys_socket.cpp similarity index 95% rename from dep/src/ace/OS_NS_sys_socket.cpp rename to externals/ace/OS_NS_sys_socket.cpp index 4c14784dd53..22783a002c3 100644 --- a/dep/src/ace/OS_NS_sys_socket.cpp +++ b/externals/ace/OS_NS_sys_socket.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_sys_socket.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_sys_socket.cpp 85460 2009-05-29 13:38:50Z msmit $ #include "ace/OS_NS_sys_socket.h" -ACE_RCSID(ace, OS_NS_sys_socket, "$Id: OS_NS_sys_socket.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_sys_socket, "$Id: OS_NS_sys_socket.cpp 85460 2009-05-29 13:38:50Z msmit $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_sys_socket.inl" @@ -14,7 +14,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL int ACE_OS::socket_initialized_; #endif /* ACE_WIN32 */ -#if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) ACE_HANDLE ACE_OS::accept (ACE_HANDLE handle, struct sockaddr *addr, @@ -95,7 +94,6 @@ ACE_OS::join_leaf (ACE_HANDLE socket, ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE); # endif /* ACE_HAS_WINSOCK2 */ } -#endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */ int ACE_OS::socket_init (int version_high, int version_low) @@ -159,4 +157,3 @@ ACE_OS::socket_fini (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_sys_socket.h b/externals/ace/OS_NS_sys_socket.h similarity index 90% rename from dep/include/ace/OS_NS_sys_socket.h rename to externals/ace/OS_NS_sys_socket.h index a0e644f190e..fc5d8901cfe 100644 --- a/dep/include/ace/OS_NS_sys_socket.h +++ b/externals/ace/OS_NS_sys_socket.h @@ -4,7 +4,7 @@ /** * @file OS_NS_sys_socket.h * - * $Id: OS_NS_sys_socket.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_sys_socket.h 85110 2009-04-20 09:18:43Z msmit $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -74,24 +74,22 @@ namespace ACE_OS # endif /* ACE_WIN32 */ //@{ @name A set of wrappers for sockets. - /// BSD-style (no QoS). + /// BSD-style @c accept (no QoS). ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen); -#if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) /** - * QoS-enabled , which passes @a qos_params to . If - * the OS platform doesn't support QoS-enabled then the - * @a qos_params are ignored and the BSD-style is called. + * QoS-enabled @c accept, which passes @a qos_params to @c accept. If + * the OS platform doesn't support QoS-enabled @c accept then the + * @a qos_params are ignored and the BSD-style @c accept is called. */ extern ACE_Export ACE_HANDLE accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen, const ACE_Accept_QoS_Params &qos_params); -#endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */ ACE_NAMESPACE_INLINE_FUNCTION int bind (ACE_HANDLE s, @@ -102,24 +100,22 @@ namespace ACE_OS ACE_NAMESPACE_INLINE_FUNCTION int closesocket (ACE_HANDLE s); - /// BSD-style (no QoS). + /// BSD-style @c connect (no QoS). ACE_NAMESPACE_INLINE_FUNCTION int connect (ACE_HANDLE handle, struct sockaddr *addr, int addrlen); -#if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) /** - * QoS-enabled , which passes @a qos_params to . - * If the OS platform doesn't support QoS-enabled then the - * @a qos_params are ignored and the BSD-style is called. + * QoS-enabled @c connect, which passes @a qos_params to @c connect. + * If the OS platform doesn't support QoS-enabled @c connect then the + * @a qos_params are ignored and the BSD-style @c connect is called. */ extern ACE_Export int connect (ACE_HANDLE handle, const sockaddr *addr, int addrlen, const ACE_QoS_Params &qos_params); -#endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */ /// Retrieve information about available transport protocols /// installed on the local machine. Windows specific... @@ -144,14 +140,12 @@ namespace ACE_OS char *optval, int *optlen); -#if !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) /// Joins a leaf node into a QoS-enabled multi-point session. extern ACE_Export ACE_HANDLE join_leaf (ACE_HANDLE socket, const sockaddr *name, int namelen, const ACE_QoS_Params &qos_params); -#endif /* !(defined (ACE_HAS_WINCE) && (UNDER_CE < 500)) */ ACE_NAMESPACE_INLINE_FUNCTION int listen (ACE_HANDLE handle, @@ -227,6 +221,7 @@ namespace ACE_OS const iovec *iov, int iovcnt); + /// Manipulate the options associated with a socket. ACE_NAMESPACE_INLINE_FUNCTION int setsockopt (ACE_HANDLE handle, @@ -299,4 +294,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_SOCKET_H */ - diff --git a/dep/include/ace/OS_NS_sys_socket.inl b/externals/ace/OS_NS_sys_socket.inl similarity index 98% rename from dep/include/ace/OS_NS_sys_socket.inl rename to externals/ace/OS_NS_sys_socket.inl index db63c418d84..925c340aec5 100644 --- a/dep/include/ace/OS_NS_sys_socket.inl +++ b/externals/ace/OS_NS_sys_socket.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_sys_socket.inl 82342 2008-07-17 19:52:57Z shuston $ +// $Id: OS_NS_sys_socket.inl 85632 2009-06-12 19:28:00Z mitza $ #include "ace/OS_NS_errno.h" #include "ace/OS_NS_macros.h" @@ -520,15 +520,12 @@ ACE_OS::recvv (ACE_HANDLE handle, 0, 0); # else - int i, chunklen; - char *chunkp = 0; - // Step through the buffers requested by caller; for each one, cycle // through reads until it's filled or an error occurs. - for (i = 0; i < n && result > 0; ++i) + for (int i = 0; i < n && result > 0; ++i) { - chunkp = buffers[i].iov_base; // Point to part of chunk being read - chunklen = buffers[i].iov_len; // Track how much to read to chunk + char *chunkp = buffers[i].iov_base; // Point to part of chunk being read + int chunklen = buffers[i].iov_len; // Track how much to read to chunk while (chunklen > 0 && result > 0) { result = ::recv ((SOCKET) handle, chunkp, chunklen, 0); @@ -753,7 +750,7 @@ ACE_OS::sendv (ACE_HANDLE handle, // Winsock 2 has WSASend and can do this directly, but Winsock 1 // needs to do the sends one-by-one. -# if (ACE_HAS_WINSOCK2 != 0) +# if (ACE_HAS_WINSOCK2 != 0) && !defined (ACE_DONT_USE_WSASEND) result = ::WSASend ((SOCKET) handle, (WSABUF *) buffers, n, @@ -878,7 +875,7 @@ ACE_OS::setsockopt (ACE_HANDLE handle, -1, result); #if defined (WSAEOPNOTSUPP) - if (result == -1 && errno == WSAEOPNOTSUPP) + if (result == -1 && (errno == WSAEOPNOTSUPP || errno == WSAENOPROTOOPT)) #else if (result == -1) #endif /* WSAEOPNOTSUPP */ diff --git a/dep/src/ace/OS_NS_sys_stat.cpp b/externals/ace/OS_NS_sys_stat.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_stat.cpp rename to externals/ace/OS_NS_sys_stat.cpp index fbb98a3f1ec..1cba079cf76 100644 --- a/dep/src/ace/OS_NS_sys_stat.cpp +++ b/externals/ace/OS_NS_sys_stat.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_stat, "$Id: OS_NS_sys_stat.cpp 80826 2008-03-04 14:51:2 # include "ace/OS_NS_sys_stat.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_stat.h b/externals/ace/OS_NS_sys_stat.h similarity index 99% rename from dep/include/ace/OS_NS_sys_stat.h rename to externals/ace/OS_NS_sys_stat.h index 6aeb8f3095c..36e11a9ebde 100644 --- a/dep/include/ace/OS_NS_sys_stat.h +++ b/externals/ace/OS_NS_sys_stat.h @@ -147,4 +147,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_STAT_H */ - diff --git a/dep/include/ace/OS_NS_sys_stat.inl b/externals/ace/OS_NS_sys_stat.inl similarity index 90% rename from dep/include/ace/OS_NS_sys_stat.inl rename to externals/ace/OS_NS_sys_stat.inl index a5c515df51d..21ab6ed7302 100644 --- a/dep/include/ace/OS_NS_sys_stat.inl +++ b/externals/ace/OS_NS_sys_stat.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_sys_stat.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_sys_stat.inl 84373 2009-02-10 18:21:50Z johnnyw $ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_fcntl.h" @@ -214,10 +214,11 @@ namespace ACE_OS } else { - stp->st_mode = static_cast(fdata.dwFileAttributes); + stp->st_mode = static_cast(fdata.dwFileAttributes); stp->st_size = fdata.nFileSizeLow; - stp->st_atime = ACE_Time_Value (fdata.ftLastAccessTime); - stp->st_mtime = ACE_Time_Value (fdata.ftLastWriteTime); + stp->st_atime = ACE_Time_Value (fdata.ftLastAccessTime).sec (); + stp->st_mtime = ACE_Time_Value (fdata.ftLastWriteTime).sec (); + stp->st_ctime = ACE_Time_Value (fdata.ftCreationTime).sec (); } return 0; #elif defined (ACE_HAS_X86_STAT_MACROS) @@ -252,14 +253,15 @@ namespace ACE_OS } else { - stp->st_mode = static_cast(fdata.dwFileAttributes); + stp->st_mode = static_cast(fdata.dwFileAttributes); stp->st_size = fdata.nFileSizeLow; - stp->st_atime = ACE_Time_Value (fdata.ftLastAccessTime); - stp->st_mtime = ACE_Time_Value (fdata.ftLastWriteTime); + stp->st_atime = ACE_Time_Value (fdata.ftLastAccessTime).sec (); + stp->st_mtime = ACE_Time_Value (fdata.ftLastWriteTime).sec (); + stp->st_ctime = ACE_Time_Value (fdata.ftCreationTime).sec (); } return 0; #elif defined (__BORLANDC__) \ - || (defined (_MSC_VER) && _MSC_VER >= 1300) \ + || defined (_MSC_VER) \ || defined (__MINGW32__) ACE_OSCALL_RETURN (ACE_WSTAT_FUNC_NAME (file, stp), int, -1); #else /* ACE_HAS_WINCE */ @@ -277,9 +279,10 @@ namespace ACE_OS ACE_UNUSED_ARG (cmask); ACE_NOTSUP_RETURN ((mode_t)-1); # elif defined (ACE_HAS_TR24731_2005_CRT) - mode_t old_mode; - ACE_SECURECRTCALL (_umask_s (cmask, &old_mode), mode_t, -1, old_mode); - return old_mode; + int old_mode; + int new_mode = static_cast (cmask); + ACE_SECURECRTCALL (_umask_s (new_mode, &old_mode), mode_t, -1, old_mode); + return static_cast (old_mode); # elif defined (ACE_WIN32) && !defined (__BORLANDC__) ACE_OSCALL_RETURN (::_umask (cmask), mode_t, -1); # else diff --git a/dep/src/ace/OS_NS_sys_time.cpp b/externals/ace/OS_NS_sys_time.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_time.cpp rename to externals/ace/OS_NS_sys_time.cpp index 25c80834830..e1be6798811 100644 --- a/dep/src/ace/OS_NS_sys_time.cpp +++ b/externals/ace/OS_NS_sys_time.cpp @@ -8,4 +8,3 @@ ACE_RCSID(ace, OS_NS_sys_time, "$Id: OS_NS_sys_time.cpp 80826 2008-03-04 14:51:2 # include "ace/OS_NS_sys_time.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_time.h b/externals/ace/OS_NS_sys_time.h similarity index 68% rename from dep/include/ace/OS_NS_sys_time.h rename to externals/ace/OS_NS_sys_time.h index 1efb8c036fd..c3df9319d57 100644 --- a/dep/include/ace/OS_NS_sys_time.h +++ b/externals/ace/OS_NS_sys_time.h @@ -4,7 +4,7 @@ /** * @file OS_NS_sys_time.h * - * $Id: OS_NS_sys_time.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_sys_time.h 87823 2009-11-30 12:38:34Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -37,22 +37,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - ACE_NAMESPACE_INLINE_FUNCTION ACE_Time_Value gettimeofday (void); - -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif } /* namespace ACE_OS */ ACE_END_VERSIONED_NAMESPACE_DECL @@ -67,4 +53,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_TIME_H */ - diff --git a/dep/include/ace/OS_NS_sys_time.inl b/externals/ace/OS_NS_sys_time.inl similarity index 63% rename from dep/include/ace/OS_NS_sys_time.inl rename to externals/ace/OS_NS_sys_time.inl index 1be2d2f3dec..fd747166a23 100644 --- a/dep/include/ace/OS_NS_sys_time.inl +++ b/externals/ace/OS_NS_sys_time.inl @@ -1,44 +1,34 @@ // -*- C++ -*- // -// $Id: OS_NS_sys_time.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_sys_time.inl 89266 2010-02-26 18:30:42Z johnnyw $ #include "ace/os_include/sys/os_time.h" #include "ace/os_include/os_errno.h" -#if defined (ACE_VXWORKS) +#if defined (ACE_VXWORKS) || defined (ACE_HAS_CLOCK_GETTIME_REALTIME) # include "ace/OS_NS_time.h" -#endif /* ACE_VXWORKS */ +#endif /* ACE_VXWORKS || ACE_HAS_CLOCK_REALTIME */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - ACE_INLINE ACE_Time_Value ACE_OS::gettimeofday (void) { // ACE_OS_TRACE ("ACE_OS::gettimeofday"); -#if !defined (ACE_HAS_WINCE)&& !defined (ACE_WIN32) +#if !defined (ACE_WIN32) timeval tv; int result = 0; -#endif // !defined (ACE_HAS_WINCE)&& !defined (ACE_WIN32) +#endif // !defined (ACE_WIN32) -#if (0) +#if defined (ACE_HAS_CLOCK_GETTIME_REALTIME) struct timespec ts; ACE_OSCALL (ACE_OS::clock_gettime (CLOCK_REALTIME, &ts), int, -1, result); tv.tv_sec = ts.tv_sec; tv.tv_usec = ts.tv_nsec / 1000L; // timespec has nsec, but timeval has usec -#elif defined (ACE_HAS_WINCE) +#elif defined (ACE_WIN32) && defined (ACE_LACKS_GETSYSTEMTIMEASFILETIME) SYSTEMTIME tsys; FILETIME tfile; ::GetSystemTime (&tsys); @@ -48,13 +38,6 @@ ACE_OS::gettimeofday (void) FILETIME tfile; ::GetSystemTimeAsFileTime (&tfile); return ACE_Time_Value (tfile); -#if 0 - // From Todd Montgomery... - struct _timeb tb; - ::_ftime (&tb); - tv.tv_sec = tb.time; - tv.tv_usec = 1000 * tb.millitm; -#endif /* 0 */ #elif defined (ACE_HAS_AIX_HI_RES_TIMER) timebasestruct_t tb; @@ -81,16 +64,12 @@ ACE_OS::gettimeofday (void) ACE_OSCALL (::gettimeofday (&tv), int, -1, result); # endif /* ACE_HAS_SVR4_GETTIMEOFDAY */ #endif /* 0 */ -#if !defined (ACE_HAS_WINCE)&& !defined (ACE_WIN32) +#if !defined (ACE_WIN32) if (result == -1) return ACE_Time_Value ((time_t)-1); else return ACE_Time_Value (tv); -#endif // !defined (ACE_HAS_WINCE)&& !defined (ACE_WIN32) +#endif // !defined (ACE_WIN32) } -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif - ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_NS_sys_uio.cpp b/externals/ace/OS_NS_sys_uio.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_uio.cpp rename to externals/ace/OS_NS_sys_uio.cpp index e4cac846e57..c0d59f62db4 100644 --- a/dep/src/ace/OS_NS_sys_uio.cpp +++ b/externals/ace/OS_NS_sys_uio.cpp @@ -128,4 +128,3 @@ ACE_OS::writev_emulation (ACE_HANDLE handle, const iovec *iov, int n) # endif /* ACE_LACKS_WRITEV */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_sys_uio.h b/externals/ace/OS_NS_sys_uio.h similarity index 99% rename from dep/include/ace/OS_NS_sys_uio.h rename to externals/ace/OS_NS_sys_uio.h index c0e54d09770..d08df3d1cd9 100644 --- a/dep/include/ace/OS_NS_sys_uio.h +++ b/externals/ace/OS_NS_sys_uio.h @@ -78,4 +78,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_UIO_H */ - diff --git a/dep/include/ace/OS_NS_sys_uio.inl b/externals/ace/OS_NS_sys_uio.inl similarity index 100% rename from dep/include/ace/OS_NS_sys_uio.inl rename to externals/ace/OS_NS_sys_uio.inl diff --git a/dep/src/ace/OS_NS_sys_utsname.cpp b/externals/ace/OS_NS_sys_utsname.cpp similarity index 92% rename from dep/src/ace/OS_NS_sys_utsname.cpp rename to externals/ace/OS_NS_sys_utsname.cpp index d5450bcf35b..05ec17dc1dc 100644 --- a/dep/src/ace/OS_NS_sys_utsname.cpp +++ b/externals/ace/OS_NS_sys_utsname.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_sys_utsname.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_sys_utsname.cpp 86433 2009-08-09 19:19:12Z johnnyw $ #include "ace/OS_NS_sys_utsname.h" -ACE_RCSID(ace, OS_NS_sys_utsname, "$Id: OS_NS_sys_utsname.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_sys_utsname, "$Id: OS_NS_sys_utsname.cpp 86433 2009-08-09 19:19:12Z johnnyw $") #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdio.h" @@ -58,7 +58,7 @@ ACE_OS::uname (ACE_utsname *name) ) { // Get information from the two structures - const char *os; + const char *os = 0; if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) os = "Windows NT %d.%d"; else @@ -77,7 +77,7 @@ ACE_OS::uname (ACE_utsname *name) // half the space to the processor and half the space to // subtype. The -1 is necessary for because of the space // between processor and subtype in the machine name. - const int bufsize = (sizeof (name->machine) / 2) - 1; + int const bufsize = (sizeof (name->machine) / 2) - 1; char processor[bufsize] = "Unknown"; char subtype[bufsize] = "Unknown"; @@ -101,10 +101,17 @@ ACE_OS::uname (ACE_utsname *name) ACE_OS::strcpy (subtype, "Pentium Pro"); else if (sinfo.wProcessorLevel == 7) // I'm guessing here ACE_OS::strcpy (subtype, "Pentium II"); + else + ACE_OS::sprintf (subtype, "%d", sinfo.wProcessorLevel); break; case PROCESSOR_ARCHITECTURE_MIPS: ACE_OS::strcpy (processor, "MIPS"); - ACE_OS::strcpy (subtype, "R4000"); + if (sinfo.wProcessorLevel == 3) + ACE_OS::strcpy (subtype, "R3000"); + else if (sinfo.wProcessorLevel == 4) + ACE_OS::strcpy (subtype, "R4000"); + else + ACE_OS::sprintf (subtype, "%d", sinfo.wProcessorLevel); break; case PROCESSOR_ARCHITECTURE_ALPHA: ACE_OS::strcpy (processor, "Alpha"); @@ -213,7 +220,7 @@ ACE_OS::uname (ACE_utsname *name) # endif /* ACE_LACKS_HOSTNAME */ #elif defined (ACE_VXWORKS) - size_t maxnamelen = sizeof name->nodename; + size_t const maxnamelen = sizeof name->nodename; ACE_OS::strcpy (name->sysname, "VxWorks"); ACE_OS::strcpy (name->release, kernelVersion()); ACE_OS::strcpy (name->version, sysBspRev ()); @@ -235,4 +242,3 @@ ACE_OS::uname (ACE_utsname *name) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_sys_utsname.h b/externals/ace/OS_NS_sys_utsname.h similarity index 99% rename from dep/include/ace/OS_NS_sys_utsname.h rename to externals/ace/OS_NS_sys_utsname.h index fe3cda91b21..978fecf9ecd 100644 --- a/dep/include/ace/OS_NS_sys_utsname.h +++ b/externals/ace/OS_NS_sys_utsname.h @@ -69,4 +69,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_UTSNAME_H */ - diff --git a/dep/src/ace/OS_NS_sys_wait.cpp b/externals/ace/OS_NS_sys_wait.cpp similarity index 99% rename from dep/src/ace/OS_NS_sys_wait.cpp rename to externals/ace/OS_NS_sys_wait.cpp index beec3030232..2f83bb28efb 100644 --- a/dep/src/ace/OS_NS_sys_wait.cpp +++ b/externals/ace/OS_NS_sys_wait.cpp @@ -7,4 +7,3 @@ ACE_RCSID(ace, OS_NS_sys_wait, "$Id: OS_NS_sys_wait.cpp 80826 2008-03-04 14:51:2 #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_sys_wait.inl" #endif /* ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_NS_sys_wait.h b/externals/ace/OS_NS_sys_wait.h similarity index 96% rename from dep/include/ace/OS_NS_sys_wait.h rename to externals/ace/OS_NS_sys_wait.h index 801b9b08bb6..8cdf6efa408 100644 --- a/dep/include/ace/OS_NS_sys_wait.h +++ b/externals/ace/OS_NS_sys_wait.h @@ -4,7 +4,7 @@ /** * @file OS_NS_sys_wait.h * - * $Id: OS_NS_sys_wait.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_sys_wait.h 83735 2008-11-14 09:41:52Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -59,7 +59,7 @@ namespace ACE_OS ACE_HANDLE handle = 0); /** - * Calls @c ::waitpid on UNIX/POSIX platforms Does not work on Vxworks 5.5.x. + * Calls @c ::waitpid on UNIX/POSIX platforms Does not work on VxWorks 5.5.x. * On Win32, @a pid is ignored if the @a handle is not equal to 0. * Passing the process @a handle is prefer on Win32 because using * @a pid to wait on the project doesn't always work correctly @@ -85,4 +85,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_SYS_WAIT_H */ - diff --git a/dep/include/ace/OS_NS_sys_wait.inl b/externals/ace/OS_NS_sys_wait.inl similarity index 100% rename from dep/include/ace/OS_NS_sys_wait.inl rename to externals/ace/OS_NS_sys_wait.inl diff --git a/dep/src/ace/OS_NS_time.cpp b/externals/ace/OS_NS_time.cpp similarity index 98% rename from dep/src/ace/OS_NS_time.cpp rename to externals/ace/OS_NS_time.cpp index 1ac31e31080..b49fc828753 100644 --- a/dep/src/ace/OS_NS_time.cpp +++ b/externals/ace/OS_NS_time.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_time.cpp 82693 2008-09-09 11:37:41Z johnnyw $ +// $Id: OS_NS_time.cpp 86094 2009-07-17 19:04:11Z schmidt $ #include "ace/OS_NS_time.h" -ACE_RCSID(ace, OS_NS_time, "$Id: OS_NS_time.cpp 82693 2008-09-09 11:37:41Z johnnyw $") +ACE_RCSID(ace, OS_NS_time, "$Id: OS_NS_time.cpp 86094 2009-07-17 19:04:11Z schmidt $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_time.inl" @@ -319,6 +319,7 @@ ACE_OS::mktime (struct tm *t) t_sys.wMonth = t->tm_mon + 1; // SYSTEMTIME is 1-indexed, tm is 0-indexed t_sys.wYear = t->tm_year + 1900; // SYSTEMTIME is real; tm is since 1900 t_sys.wDayOfWeek = t->tm_wday; // Ignored in below function call. + t_sys.wMilliseconds = 0; if (SystemTimeToFileTime (&t_sys, &t_file) == 0) return -1; ACE_Time_Value tv (t_file); @@ -354,7 +355,7 @@ ACE_OS::readPPCTimeBase (u_long &most, u_long &least) } #endif /* ACE_HAS_POWERPC_TIMER && ghs */ -#if defined (ACE_LACKS_STRPTIME) && !defined (ACE_REFUSE_STRPTIME_EMULATION) +#if defined (ACE_LACKS_STRPTIME) char * ACE_OS::strptime_emulation (const char *buf, const char *format, struct tm *tm) { @@ -365,8 +366,6 @@ ACE_OS::strptime_emulation (const char *buf, const char *format, struct tm *tm) if (!buf || !format) return 0; - ACE_OS::memset (tm, 0, sizeof (struct tm)); - while (format[fi] != '\0') { if (percent) @@ -632,7 +631,6 @@ ACE_OS::strptime_getnum (const char *buf, else return 0; } -#endif /* ACE_LACKS_STRPTIME && !ACE_REFUSE_STRPTIME_EMULATION */ +#endif /* ACE_LACKS_STRPTIME */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_time.h b/externals/ace/OS_NS_time.h similarity index 90% rename from dep/include/ace/OS_NS_time.h rename to externals/ace/OS_NS_time.h index 7fc53fda787..dc22f0a0cbd 100644 --- a/dep/include/ace/OS_NS_time.h +++ b/externals/ace/OS_NS_time.h @@ -4,7 +4,7 @@ /** * @file OS_NS_time.h * - * $Id: OS_NS_time.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_NS_time.h 87260 2009-10-29 14:00:43Z olli $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -25,9 +25,10 @@ # pragma once # endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/OS_NS_errno.h" #include "ace/Basic_Types.h" #include "ace/os_include/os_time.h" +#include "ace/OS_NS_errno.h" + #include /**/ "ace/ACE_export.h" #if defined (ACE_EXPORT_MACRO) @@ -35,11 +36,6 @@ #endif #define ACE_EXPORT_MACRO ACE_Export -# if defined (ACE_HAS_BROKEN_R_ROUTINES) -# undef ctime_r -# undef asctime_r -# endif /* ACE_HAS_BROKEN_R_ROUTINES */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Type-safe, and unsigned. @@ -96,7 +92,18 @@ inline long ace_timezone() #endif } + #if !defined (ACE_LACKS_DIFFTIME) +# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) \ + && defined (_MSC_VER) + // The WinCE 6.0 SDK ships with a diff_time that uses __time32_t as type + // not time_t. This resolves in compilation warnings because time_t + // can be 64bit. Disable at this momemt the warning for just this method + // else we get two compile warnings on each source file that includes + // this file. +# pragma warning (push) +# pragma warning (disable: 4244) +# endif /// Helper for the ACE_OS::difftime() function /** * We moved the difftime code that used to be in ACE_OS::difftime() @@ -110,6 +117,10 @@ inline double ace_difftime(time_t t1, time_t t0) { return difftime (t1, t0); } +# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) \ + && defined (_MSC_VER) +# pragma warning (pop) +# endif #endif /* !ACE_LACKS_DIFFTIME */ # if defined (ACE_WIN32) @@ -180,10 +191,6 @@ namespace ACE_OS #endif ACE_TCHAR *ctime_r (const time_t *clock, ACE_TCHAR *buf, int buflen); -# if defined (difftime) -# undef difftime -# endif /* difftime */ - #if !defined (ACE_LACKS_DIFFTIME) ACE_NAMESPACE_INLINE_FUNCTION #else @@ -229,12 +236,16 @@ namespace ACE_OS const char *format, const struct tm *timeptr); + /** + * strptime wrapper. Note that the struct @a tm will always be set to + * zero + */ ACE_NAMESPACE_INLINE_FUNCTION char *strptime (const char *buf, const char *format, struct tm *tm); -# if defined (ACE_LACKS_STRPTIME) && !defined (ACE_REFUSE_STRPTIME_EMULATION) +# if defined (ACE_LACKS_STRPTIME) extern ACE_Export char *strptime_emulation (const char *buf, const char *format, @@ -243,15 +254,11 @@ namespace ACE_OS extern ACE_Export int strptime_getnum (const char *buf, int *num, int *bi, int *fi, int min, int max); -# endif /* ACE_LACKS_STRPTIME && !ACE_REFUSE_STRPTIME_EMULATION */ +# endif /* ACE_LACKS_STRPTIME */ ACE_NAMESPACE_INLINE_FUNCTION time_t time (time_t *tloc = 0); -# if defined (timezone) -# undef timezone -# endif /* timezone */ - ACE_NAMESPACE_INLINE_FUNCTION long timezone (void); @@ -274,6 +281,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # define ACE_GETHRTIME_NAME ACE_gethrtime #endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */ + # if defined (ACE_HAS_INLINED_OSCALLS) # if defined (ACE_INLINE) # undef ACE_INLINE @@ -284,4 +292,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_TIME_H */ - diff --git a/dep/include/ace/OS_NS_time.inl b/externals/ace/OS_NS_time.inl similarity index 94% rename from dep/include/ace/OS_NS_time.inl rename to externals/ace/OS_NS_time.inl index 9a77531a108..ab8da37bba7 100644 --- a/dep/include/ace/OS_NS_time.inl +++ b/externals/ace/OS_NS_time.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_time.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_time.inl 87270 2009-10-29 21:47:47Z olli $ #include "ace/OS_NS_string.h" #include "ace/OS_NS_errno.h" @@ -97,9 +97,7 @@ ACE_INLINE ACE_TCHAR * ACE_OS::ctime (const time_t *t) { ACE_OS_TRACE ("ACE_OS::ctime"); -#if defined (ACE_HAS_BROKEN_CTIME) - ACE_OSCALL_RETURN (::asctime (::localtime (t)), char *, 0); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_WINCE) static ACE_TCHAR buf [ctime_buf_size]; return ACE_OS::ctime_r (t, buf, @@ -124,7 +122,7 @@ ACE_OS::ctime (const time_t *t) # else ACE_OSCALL_RETURN (::ctime (t), char *, 0); # endif /* ACE_USES_WCHAR */ -# endif /* ACE_HAS_BROKEN_CTIME */ +# endif /* ACE_HAS_WINCE */ } #if !defined (ACE_HAS_WINCE) /* CE version in OS.cpp */ @@ -196,7 +194,7 @@ ACE_OS::ctime_r (const time_t *t, ACE_TCHAR *buf, int buflen) return 0; } - ACE_TCHAR *result; + ACE_TCHAR *result = 0; # if defined (ACE_USES_WCHAR) ACE_OSCALL (::_wctime (t), wchar_t *, 0, result); # else /* ACE_USES_WCHAR */ @@ -334,8 +332,9 @@ ACE_OS::gethrtime (const ACE_HRTimer_Op op) ACE_OS::clock_gettime ( #if defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC) CLOCK_MONOTONIC, -#endif /* !ACE_HAS_CLOCK_GETTIME_MONOTONIC */ +#else CLOCK_REALTIME, +#endif /* !ACE_HAS_CLOCK_GETTIME_MONOTONIC */ &ts); // Carefully create the return value to avoid arithmetic overflow @@ -443,17 +442,11 @@ ACE_OS::strftime (char *s, size_t maxsize, const char *format, ACE_INLINE char * ACE_OS::strptime (const char *buf, const char *format, struct tm *tm) { + ACE_OS::memset (tm, 0, sizeof (struct tm)); #if defined (ACE_LACKS_STRPTIME) -# if defined (ACE_REFUSE_STRPTIME_EMULATION) - ACE_UNUSED_ARG (buf); - ACE_UNUSED_ARG (format); - ACE_UNUSED_ARG (tm); - ACE_NOTSUP_RETURN (0); -# else return ACE_OS::strptime_emulation (buf, format, tm); -# endif /* ACE_REFUSE_STRPTIME_EMULATION */ #else - return ::strptime (buf, format, tm); + return ACE_STD_NAMESPACE::strptime (buf, format, tm); #endif /* ACE_LACKS_STRPTIME */ } @@ -461,14 +454,14 @@ ACE_INLINE time_t ACE_OS::time (time_t *tloc) { ACE_OS_TRACE ("ACE_OS::time"); -#if !defined (ACE_HAS_WINCE) - ACE_OSCALL_RETURN (::time (tloc), time_t, (time_t) -1); -#else - time_t retv = ACE_OS::gettimeofday ().sec (); +#if defined (ACE_LACKS_TIME) + time_t const retv = ACE_OS::gettimeofday ().sec (); if (tloc) *tloc = retv; return retv; -#endif /* ACE_HAS_WINCE */ +#else + ACE_OSCALL_RETURN (::time (tloc), time_t, (time_t) -1); +#endif /* ACE_LACKS_TIME */ } // Linux won't compile unless we explicitly use a namespace here. @@ -491,15 +484,13 @@ ACE_OS::timezone (void) ACE_INLINE void ACE_OS::tzset (void) { -#if !defined (ACE_HAS_WINCE) && !defined (ACE_VXWORKS) && !defined(ACE_HAS_RTEMS) && !defined (ACE_HAS_DINKUM_STL) -# if defined (ACE_WIN32) - ::_tzset (); // For Win32. -# else - ::tzset (); // For UNIX platforms. -# endif /* ACE_WIN32 */ -# else +#if defined (ACE_LACKS_TZSET) errno = ENOTSUP; -# endif /* ACE_HAS_WINCE && !VXWORKS && !ACE_HAS_RTEMS && !ACE_HAS_DINKUM_STL */ +#elif defined (ACE_WIN32) + ::_tzset (); // For Win32. +#else + ::tzset (); // For UNIX platforms. +#endif /* ACE_LACKS_TZSET */ } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_NS_unistd.cpp b/externals/ace/OS_NS_unistd.cpp similarity index 89% rename from dep/src/ace/OS_NS_unistd.cpp rename to externals/ace/OS_NS_unistd.cpp index 7aa77e4f693..4579a22d84b 100644 --- a/dep/src/ace/OS_NS_unistd.cpp +++ b/externals/ace/OS_NS_unistd.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_unistd.cpp 82559 2008-08-07 20:23:07Z parsons $ +// $Id: OS_NS_unistd.cpp 85906 2009-07-06 20:52:40Z mitza $ #include "ace/OS_NS_unistd.h" -ACE_RCSID (ace, OS_NS_unistd, "$Id: OS_NS_unistd.cpp 82559 2008-08-07 20:23:07Z parsons $") +ACE_RCSID (ace, OS_NS_unistd, "$Id: OS_NS_unistd.cpp 85906 2009-07-06 20:52:40Z mitza $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_unistd.inl" @@ -19,6 +19,11 @@ ACE_RCSID (ace, OS_NS_unistd, "$Id: OS_NS_unistd.cpp 82559 2008-08-07 20:23:07Z #include "ace/os_include/sys/os_pstat.h" #include "ace/os_include/sys/os_sysctl.h" +#if defined ACE_HAS_VXCPULIB +# include "vxCpuLib.h" +# include "cpuset.h" +#endif /* ACE_HAS_VXCPULIB */ + #if defined (ACE_NEEDS_FTRUNCATE) extern "C" int ftruncate (ACE_HANDLE handle, long len) @@ -64,6 +69,10 @@ ACE_OS::argv_to_string (int argc, bool substitute_env_args, bool quote_args) { +#if defined (ACE_LACKS_STRENVDUP) + ACE_UNUSED_ARG (substitute_env_args); +#endif /* ACE_LACKS_STRENVDUP */ + if (argc <= 0 || argv == 0 || argv[0] == 0) return 0; @@ -75,7 +84,7 @@ ACE_OS::argv_to_string (int argc, for (int i = 0; i < argc; ++i) { -#if !defined (ACE_LACKS_ENV) +#if !defined (ACE_LACKS_STRENVDUP) // Account for environment variables. if (substitute_env_args && ACE_OS::strchr (argv[i], ACE_TEXT ('$')) != 0) @@ -98,7 +107,7 @@ ACE_OS::argv_to_string (int argc, return 0; } } -#endif /* ACE_LACKS_ENV */ +#endif /* ACE_LACKS_STRENVDUP */ // If must quote, we only do it if the arg contains spaces, or // is empty. Perhaps a check for other c | ord(c) <= 32 is in // order? @@ -127,7 +136,8 @@ ACE_OS::argv_to_string (int argc, ++quotes; } argv_p[i] = - (ACE_TCHAR *) ACE_OS::malloc (ACE_OS::strlen (temp) * sizeof (ACE_TCHAR) + quotes + 3); + (ACE_TCHAR *) ACE_OS::malloc ((ACE_OS::strlen (temp) + quotes + 3) + * sizeof (ACE_TCHAR)); if (argv_p[i] == 0) { ACE_OS::free (argv_p); @@ -378,10 +388,12 @@ ACE_OS::num_processors (void) SYSTEM_INFO sys_info; ::GetSystemInfo (&sys_info); return sys_info.dwNumberOfProcessors; +#elif defined (ACE_HAS_VXCPULIB) + return vxCpuConfiguredGet(); #elif defined (_SC_NPROCESSORS_CONF) return ::sysconf (_SC_NPROCESSORS_CONF); #elif defined (ACE_HAS_SYSCTL) - int num_processors; + int num_processors = 0; int mib[2] = { CTL_HW, HW_NCPU }; size_t len = sizeof (num_processors); if (::sysctl (mib, 2, &num_processors, &len, 0, 0) != -1) @@ -418,6 +430,20 @@ ACE_OS::num_processors_online (void) mask >>= 1; } return active_processors; +#elif defined (ACE_HAS_VXCPULIB) + long num_cpu = 0; + cpuset_t cpuset; + CPUSET_ZERO (cpuset); + cpuset = vxCpuEnabledGet(); + unsigned int const maxcpu = vxCpuConfiguredGet(); + for (unsigned int i =0; i < maxcpu; i++) + { + if (CPUSET_ISSET (cpuset, i)) + { + ++num_cpu; + } + } + return num_cpu; #elif defined (_SC_NPROCESSORS_ONLN) return ::sysconf (_SC_NPROCESSORS_ONLN); #elif defined (ACE_HAS_SYSCTL) @@ -486,7 +512,10 @@ ACE_OS::pread (ACE_HANDLE handle, if (original_low_position == INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR) - return -1; + { + ACE_OS::set_errno_to_last_error (); + return -1; + } // Go to the correct position LONG low_offset = ACE_LOW_PART (offset); @@ -497,7 +526,10 @@ ACE_OS::pread (ACE_HANDLE handle, FILE_BEGIN); if (altered_position == INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR) - return -1; + { + ACE_OS::set_errno_to_last_error (); + return -1; + } DWORD bytes_read; @@ -550,7 +582,10 @@ ACE_OS::pread (ACE_HANDLE handle, &original_high_position, FILE_BEGIN) == INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR) - return -1; + { + ACE_OS::set_errno_to_last_error (); + return -1; + } return (ssize_t) bytes_read; @@ -605,27 +640,30 @@ ACE_OS::pwrite (ACE_HANDLE handle, ACE_OS_GUARD // Remember the original file pointer position - LARGE_INTEGER orig_position; - orig_position.QuadPart = 0; - orig_position.LowPart = ::SetFilePointer (handle, - 0, - &orig_position.HighPart, - FILE_CURRENT); - if (orig_position.LowPart == INVALID_SET_FILE_POINTER + LONG original_high_position = 0; + DWORD original_low_position = ::SetFilePointer (handle, + 0, + &original_high_position, + FILE_CURRENT); + + if (original_low_position == INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR) - return -1; + { + ACE_OS::set_errno_to_last_error (); + return -1; + } DWORD bytes_written; - LARGE_INTEGER loffset; - loffset.QuadPart = offset; + LONG low_offset = ACE_LOW_PART (offset); + LONG high_offset = ACE_HIGH_PART (offset); # if defined (ACE_HAS_WIN32_OVERLAPPED_IO) OVERLAPPED overlapped; overlapped.Internal = 0; overlapped.InternalHigh = 0; - overlapped.Offset = loffset.LowPart; - overlapped.OffsetHigh = loffset.HighPart; + overlapped.Offset = low_offset; + overlapped.OffsetHigh = high_offset; overlapped.hEvent = 0; BOOL result = ::WriteFile (handle, @@ -637,35 +675,27 @@ ACE_OS::pwrite (ACE_HANDLE handle, if (result == FALSE) { if (::GetLastError () != ERROR_IO_PENDING) - return -1; - - result = ::GetOverlappedResult (handle, - &overlapped, - &bytes_written, - TRUE); - if (result == FALSE) - return -1; + { + return -1; + } + else + { + result = ::GetOverlappedResult (handle, + &overlapped, + &bytes_written, + TRUE); + if (result == FALSE) + return -1; + } } # else /* ACE_HAS_WIN32_OVERLAPPED_IO */ - // Go to the correct position; if this is a Windows variant without - // overlapped I/O, it probably doesn't have SetFilePointerEx either, - // so manage this with SetFilePointer, changing calls based on the use - // of 64 bit offsets. - DWORD newpos; -# if defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 - newpos = ::SetFilePointer (handle, - loffset.LowPart, - &loffset.HighPart, - FILE_BEGIN); -# else - newpos = ::SetFilePointer (handle, - loffset.LowPart, - 0, - FILE_BEGIN); -# endif /* 64-bit file offsets */ - if (newpos == 0xFFFFFFFF && ::GetLastError () != NO_ERROR) + if (::SetFilePointer (handle, + low_offset, + &high_offset, + FILE_BEGIN) == INVALID_SET_FILE_POINTER + && ::GetLastError () != NO_ERROR) { ACE_OS::set_errno_to_last_error (); return -1; @@ -683,11 +713,14 @@ ACE_OS::pwrite (ACE_HANDLE handle, // Reset the original file pointer position if (::SetFilePointer (handle, - orig_position.LowPart, - &orig_position.HighPart, + original_low_position, + &original_high_position, FILE_BEGIN) == INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR) - return -1; + { + ACE_OS::set_errno_to_last_error (); + return -1; + } return (ssize_t) bytes_written; @@ -734,6 +767,10 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf, ACE_TCHAR **&argv, bool substitute_env_args) { +#if defined (ACE_LACKS_STRENVDUP) + ACE_UNUSED_ARG (substitute_env_args); +#endif /* ACE_LACKS_STRENVDUP */ + // Reset the number of arguments argc = 0; @@ -827,7 +864,7 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf, *cp = ACE_TEXT ('\0'); -#if !defined (ACE_LACKS_ENV) +#if !defined (ACE_LACKS_STRENVDUP) // Check for environment variable substitution here. if (substitute_env_args) { argv[i] = ACE_OS::strenvdup (argp); @@ -841,7 +878,7 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf, } } else -#endif /* ACE_LACKS_ENV */ +#endif /* ACE_LACKS_STRENVDUP */ { argv[i] = ACE_OS::strdup (argp); @@ -898,4 +935,3 @@ ACE_OS::write_n (ACE_HANDLE handle, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_unistd.h b/externals/ace/OS_NS_unistd.h similarity index 95% rename from dep/include/ace/OS_NS_unistd.h rename to externals/ace/OS_NS_unistd.h index b9b7604b797..2b770e62ef6 100644 --- a/dep/include/ace/OS_NS_unistd.h +++ b/externals/ace/OS_NS_unistd.h @@ -4,7 +4,7 @@ /** * @file OS_NS_unistd.h * - * $Id: OS_NS_unistd.h 81156 2008-03-30 20:56:47Z iliyan $ + * $Id: OS_NS_unistd.h 84918 2009-03-20 08:07:01Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -31,6 +31,7 @@ #include "ace/os_include/os_unistd.h" #include "ace/os_include/os_stdio.h" + #if defined (ACE_EXPORT_MACRO) # undef ACE_EXPORT_MACRO #endif @@ -61,7 +62,7 @@ namespace ACE_OS ACE_NAMESPACE_INLINE_FUNCTION long allocation_granularity (void); - // used by ARGV::argv_to_string() and ACE_OS::fork_exec() + /// used by ARGV::argv_to_string() and ACE_OS::fork_exec() extern ACE_Export int argv_to_string (int argc, ACE_TCHAR **argv, @@ -75,7 +76,6 @@ namespace ACE_OS bool substitute_env_args = true, bool quote_args = false); -#if !defined (ACE_LACKS_CHDIR) ACE_NAMESPACE_INLINE_FUNCTION int chdir (const char *path); @@ -83,7 +83,6 @@ namespace ACE_OS ACE_NAMESPACE_INLINE_FUNCTION int chdir (const wchar_t *path); #endif /* ACE_HAS_WCHAR */ -#endif /* ACE_LACKS_CHDIR */ ACE_NAMESPACE_INLINE_FUNCTION int rmdir (const char *path); @@ -99,6 +98,9 @@ namespace ACE_OS ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE dup (ACE_HANDLE handle); + ACE_NAMESPACE_INLINE_FUNCTION + ACE_HANDLE dup (ACE_HANDLE handle, pid_t pid); + ACE_NAMESPACE_INLINE_FUNCTION int dup2 (ACE_HANDLE oldfd, ACE_HANDLE newfd); @@ -140,7 +142,6 @@ namespace ACE_OS extern ACE_Export pid_t fork_exec (ACE_TCHAR *argv[]); - //@} ACE_NAMESPACE_INLINE_FUNCTION @@ -252,11 +253,11 @@ namespace ACE_OS ACE_OVERLAPPED *); /** - * Receive @a len bytes into @a buf from (uses the + * Receive @a len bytes into @a buf from @a handle (uses the * call, which uses the system call on UNIX * and the call on Win32). If errors occur, -1 is * returned. If EOF occurs, 0 is returned. Whatever data has been - * read will be returned to the caller through. + * read will be returned to the caller through @a bytes_transferred. * */ extern ACE_Export @@ -357,7 +358,7 @@ namespace ACE_OS * calls, which is uses the system call on UNIX and the * call on Win32). If errors occur, -1 is returned. If * EOF occurs, 0 is returned. Whatever data has been transmitted - * will be returned to the caller through . + * will be returned to the caller through @a bytes_transferred. */ extern ACE_Export ssize_t write_n (ACE_HANDLE handle, @@ -379,4 +380,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_UNISTD_H */ - diff --git a/dep/include/ace/OS_NS_unistd.inl b/externals/ace/OS_NS_unistd.inl similarity index 93% rename from dep/include/ace/OS_NS_unistd.inl rename to externals/ace/OS_NS_unistd.inl index be2ec3cff25..8de371fdb9a 100644 --- a/dep/include/ace/OS_NS_unistd.inl +++ b/externals/ace/OS_NS_unistd.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: OS_NS_unistd.inl 81696 2008-05-14 18:15:31Z johnnyw $ +// $Id: OS_NS_unistd.inl 88515 2010-01-13 08:47:38Z johnnyw $ #include "ace/OS_NS_sys_utsname.h" #include "ace/OS_NS_string.h" @@ -19,16 +19,17 @@ # include "ace/OS_NS_stdio.h" #endif /* ACE_LACKS_ACCESS */ -#if defined (ACE_VXWORKS) || defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_ACCESS_EMULATION) # include "ace/os_include/os_unistd.h" -# if defined (ACE_VXWORKS) && (((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x660)) || defined (ACE_HAS_VXWORKS551_MEDUSA)) -# if defined (__RTP__) -# include "ace/os_include/os_strings.h" -# else -# include "ace/os_include/os_string.h" -# endif +#endif /* ACE_HAS_ACCESS_EMULATION */ + +#if defined (ACE_VXWORKS) && (((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x680)) || defined (ACE_HAS_VXWORKS551_MEDUSA)) +# if defined (__RTP__) +# include "ace/os_include/os_strings.h" +# else +# include "ace/os_include/os_string.h" # endif -#endif /* VXWORKS || ACE_HAS_WINCE */ +#endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -37,7 +38,7 @@ ACE_OS::access (const char *path, int amode) { ACE_OS_TRACE ("ACE_OS::access"); #if defined (ACE_LACKS_ACCESS) -# if defined (ACE_HAS_WINCE) || defined (ACE_VXWORKS) +# if defined (ACE_HAS_ACCESS_EMULATION) // @@ WINCE: There should be a Win32 API that can do this. // Hard coded read access here. ACE_UNUSED_ARG (amode); @@ -48,12 +49,12 @@ ACE_OS::access (const char *path, int amode) ACE_OS::fclose (handle); return 0; } - return (-1); + return -1; # else ACE_UNUSED_ARG (path); ACE_UNUSED_ARG (amode); ACE_NOTSUP_RETURN (-1); -# endif // ACE_HAS_WINCE +# endif /* ACE_HAS_ACCESS_EMULATION */ #elif defined(ACE_WIN32) // Windows doesn't support checking X_OK(6) ACE_OSCALL_RETURN (::access (path, amode & 6), int, -1); @@ -62,15 +63,16 @@ ACE_OS::access (const char *path, int amode) #endif /* ACE_LACKS_ACCESS */ } + #if defined (ACE_HAS_WCHAR) ACE_INLINE int ACE_OS::access (const wchar_t *path, int amode) { -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +#if defined (ACE_WIN32) && !defined (ACE_LACKS__WACCESS) ACE_OSCALL_RETURN (::_waccess (path, amode), int, -1); #else /* ACE_WIN32 && !ACE_HAS_WINCE */ return ACE_OS::access (ACE_Wide_To_Ascii (path).char_rep (), amode); -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ +#endif /* ACE_WIN32 && !ACE_LACKS__WACCESS */ } #endif /* ACE_HAS_WCHAR */ @@ -116,16 +118,15 @@ ACE_OS::allocation_granularity (void) #endif /* ACE_WIN32 */ } -#if !defined (ACE_LACKS_CHDIR) ACE_INLINE int ACE_OS::chdir (const char *path) { ACE_OS_TRACE ("ACE_OS::chdir"); -#if defined (ACE_HAS_NONCONST_CHDIR) - ACE_OSCALL_RETURN (::chdir (const_cast (path)), int, -1); -#elif defined (ACE_HAS_WINCE) +#if defined (ACE_LACKS_CHDIR) ACE_UNUSED_ARG (path); ACE_NOTSUP_RETURN (-1); +#elif defined (ACE_HAS_NONCONST_CHDIR) + ACE_OSCALL_RETURN (::chdir (const_cast (path)), int, -1); #else ACE_OSCALL_RETURN (::chdir (path), int, -1); #endif /* ACE_HAS_NONCONST_CHDIR */ @@ -135,20 +136,22 @@ ACE_OS::chdir (const char *path) ACE_INLINE int ACE_OS::chdir (const wchar_t *path) { -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +#if defined (ACE_LACKS_CHDIR) + ACE_UNUSED_ARG (path); + ACE_NOTSUP_RETURN (-1); +#elif defined (ACE_WIN32) ACE_OSCALL_RETURN (::_wchdir (path), int, -1); #else /* ACE_WIN32 */ return ACE_OS::chdir (ACE_Wide_To_Ascii (path).char_rep ()); #endif /* ACE_WIN32 */ } #endif /* ACE_HAS_WCHAR */ -#endif /* ACE_LACKS_CHDIR */ ACE_INLINE int ACE_OS::rmdir (const char *path) { #if defined (ACE_HAS_WINCE) - ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::RemoveDirectory (ACE_TEXT_CHAR_TO_TCHAR (path)), + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::RemoveDirectory (ACE_TEXT_CHAR_TO_TCHAR(path)), ace_result_), int, -1); #else @@ -192,7 +195,10 @@ ACE_INLINE ACE_HANDLE ACE_OS::dup (ACE_HANDLE handle) { ACE_OS_TRACE ("ACE_OS::dup"); -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +#if defined (ACE_LACKS_DUP) + ACE_UNUSED_ARG (handle); + ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE); +#elif defined (ACE_WIN32) ACE_HANDLE new_fd; if (::DuplicateHandle(::GetCurrentProcess (), handle, @@ -205,15 +211,42 @@ ACE_OS::dup (ACE_HANDLE handle) else ACE_FAIL_RETURN (ACE_INVALID_HANDLE); /* NOTREACHED */ -#elif defined (ACE_LACKS_DUP) - ACE_UNUSED_ARG (handle); - ACE_NOTSUP_RETURN (-1); -#elif defined (ACE_HAS_WINCE) - ACE_UNUSED_ARG (handle); - ACE_NOTSUP_RETURN (0); #else ACE_OSCALL_RETURN (::dup (handle), ACE_HANDLE, ACE_INVALID_HANDLE); -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ +#endif /* ACE_LACKS_DUP */ +} + +ACE_INLINE ACE_HANDLE +ACE_OS::dup(ACE_HANDLE handle, pid_t pid) +{ + ACE_OS_TRACE("ACE_OS::dup"); +#if defined (ACE_LACKS_DUP) + ACE_UNUSED_ARG (handle); + ACE_UNUSED_ARG (pid); + ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE); +#elif defined (ACE_WIN32) + ACE_HANDLE new_fd; + ACE_HANDLE hTargetProcess = ::OpenProcess (PROCESS_DUP_HANDLE, + FALSE, + pid); + if(::DuplicateHandle(::GetCurrentProcess (), + handle, + hTargetProcess, + &new_fd, + 0, + TRUE, + DUPLICATE_SAME_ACCESS)) + { + ::CloseHandle (hTargetProcess); + return new_fd; + } + else + ACE_FAIL_RETURN (ACE_INVALID_HANDLE); + /*NOTREACHED*/ +#else + ACE_UNUSED_ARG (pid); + ACE_OSCALL_RETURN(::dup(handle), ACE_HANDLE, ACE_INVALID_HANDLE); +#endif /*ACE_WIN32 && !ACE_HAS_WINCE*/ } ACE_INLINE int @@ -555,11 +588,10 @@ ACE_OS::hostname (wchar_t name[], size_t maxnamelen) #else /* ACE_WIN32 && !ACE_HAS_WINCE */ // Emulate using the char version char *char_name = 0; - int result = 0; ACE_NEW_RETURN (char_name, char[maxnamelen], -1); - result = ACE_OS::hostname(char_name, maxnamelen); + int result = ACE_OS::hostname(char_name, maxnamelen); ACE_OS::strcpy (name, ACE_Ascii_To_Wide (char_name).wchar_rep ()); delete [] char_name; @@ -590,9 +622,13 @@ ACE_OS::isatty (ACE_HANDLE handle) ACE_UNUSED_ARG (handle); return 0; #else - int fd = ::_open_osfhandle (intptr_t (handle), 0); - int status = ::_isatty (fd); - ::_close (fd); + int const fd = ::_open_osfhandle (intptr_t (handle), 0); + int status = 0; + if (fd != -1) + { + status = ::_isatty (fd); + ::_close (fd); + } return status; #endif /* ACE_LACKS_ISATTY */ } @@ -749,13 +785,11 @@ ACE_OS::readlink (const char *path, char *buf, size_t bufsiz) ACE_UNUSED_ARG (buf); ACE_UNUSED_ARG (bufsiz); ACE_NOTSUP_RETURN (-1); +# elif defined(ACE_HAS_NONCONST_READLINK) + ACE_OSCALL_RETURN ( + ::readlink (const_cast (path), buf, bufsiz), ssize_t, -1); # else -# if !defined(ACE_HAS_NONCONST_READLINK) - ACE_OSCALL_RETURN (::readlink (path, buf, bufsiz), ssize_t, -1); -# else - ACE_OSCALL_RETURN ( - ::readlink (const_cast (path), buf, bufsiz), ssize_t, -1); -# endif + ACE_OSCALL_RETURN (::readlink (path, buf, bufsiz), ssize_t, -1); # endif /* ACE_LACKS_READLINK */ } @@ -1006,7 +1040,7 @@ ACE_INLINE long ACE_OS::sysinfo (int cmd, char *buf, long count) { ACE_OS_TRACE ("ACE_OS::sysinfo"); -#if defined (ACE_HAS_SYSINFO) +#if defined (ACE_HAS_SYSV_SYSINFO) ACE_OSCALL_RETURN (::sysinfo (cmd, buf, count), long, -1); #else ACE_UNUSED_ARG (cmd); @@ -1014,7 +1048,7 @@ ACE_OS::sysinfo (int cmd, char *buf, long count) ACE_UNUSED_ARG (count); ACE_NOTSUP_RETURN (0); -#endif /* ACE_HAS_SYSINFO */ +#endif /* ACE_HAS_SYSV_SYSINFO */ } ACE_INLINE int diff --git a/dep/src/ace/OS_NS_wchar.cpp b/externals/ace/OS_NS_wchar.cpp similarity index 96% rename from dep/src/ace/OS_NS_wchar.cpp rename to externals/ace/OS_NS_wchar.cpp index 5a0eb7e9af9..a067f3bf56b 100644 --- a/dep/src/ace/OS_NS_wchar.cpp +++ b/externals/ace/OS_NS_wchar.cpp @@ -1,8 +1,8 @@ -// $Id: OS_NS_wchar.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_NS_wchar.cpp 88331 2009-12-24 09:54:25Z johnnyw $ #include "ace/OS_NS_wchar.h" -ACE_RCSID(ace, OS_NS_wchar, "$Id: OS_NS_wchar.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_NS_wchar, "$Id: OS_NS_wchar.cpp 88331 2009-12-24 09:54:25Z johnnyw $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_wchar.inl" @@ -69,7 +69,7 @@ ACE_OS::wcscat_emulation (wchar_t *destination, wchar_t * ACE_OS::wcschr_emulation (const wchar_t *string, wchar_t c) { - for (; *string ; ++string) + for (;*string ; ++string) if (*string == c) return const_cast (string); @@ -84,7 +84,7 @@ ACE_OS::wcscmp_emulation (const ACE_WCHAR_T *string1, { while (*string1 == *string2++) if (*string1++ == 0) - return (0); + return 0; return (*string1 - *--string2); } #endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */ @@ -157,7 +157,7 @@ ACE_OS::wcsicmp_emulation (const wchar_t *s, const wchar_t *t) size_t ACE_OS::wcslen_emulation (const ACE_WCHAR_T *string) { - const ACE_WCHAR_T *s; + const ACE_WCHAR_T *s = 0; for (s = string; *s; ++s) continue; @@ -178,14 +178,14 @@ ACE_OS::wcsncat_emulation (ACE_WCHAR_T *destination, const ACE_WCHAR_T *s = source; while (*d != 0) - d++; + ++d; do { if ((*d = *s++) == 0) break; - d++; + ++d; } while (--count != 0); *d = 0; @@ -285,7 +285,7 @@ wchar_t * ACE_OS::wcspbrk_emulation (const wchar_t *string, const wchar_t *charset) { - const wchar_t *scanp; + const wchar_t *scanp = 0; int c, sc; while ((c = *string++) != 0) @@ -335,7 +335,7 @@ ACE_OS::wcsspn_emulation (const wchar_t *string, const wchar_t *charset) { const wchar_t *p = string; - const wchar_t *spanp; + const wchar_t *spanp = 0; wchar_t c, sc; // Skip any characters in charset, excluding the terminating \0. @@ -375,4 +375,3 @@ ACE_OS::wcsstr_emulation (const wchar_t *string, #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSSTR */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_NS_wchar.h b/externals/ace/OS_NS_wchar.h similarity index 99% rename from dep/include/ace/OS_NS_wchar.h rename to externals/ace/OS_NS_wchar.h index e1201d3884f..4a9843ab845 100644 --- a/dep/include/ace/OS_NS_wchar.h +++ b/externals/ace/OS_NS_wchar.h @@ -197,4 +197,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL # include /**/ "ace/post.h" #endif /* ACE_OS_NS_STDIO_H */ - diff --git a/dep/include/ace/OS_NS_wchar.inl b/externals/ace/OS_NS_wchar.inl similarity index 100% rename from dep/include/ace/OS_NS_wchar.inl rename to externals/ace/OS_NS_wchar.inl diff --git a/externals/ace/OS_NS_wctype.cpp b/externals/ace/OS_NS_wctype.cpp new file mode 100644 index 00000000000..e9e1cf03c8a --- /dev/null +++ b/externals/ace/OS_NS_wctype.cpp @@ -0,0 +1,11 @@ +// -*- C++ -*- +// $Id: OS_NS_wctype.cpp 83891 2008-11-28 11:01:50Z johnnyw $ + +#include "ace/OS_NS_wctype.h" + +ACE_RCSID(ace, OS_NS_wctype, "$Id: OS_NS_wctype.cpp 83891 2008-11-28 11:01:50Z johnnyw $") + +#if !defined (ACE_HAS_INLINED_OSCALLS) +# include "ace/OS_NS_wctype.inl" +#endif /* ACE_HAS_INLINED_OSCALLS */ + diff --git a/externals/ace/OS_NS_wctype.h b/externals/ace/OS_NS_wctype.h new file mode 100644 index 00000000000..47fbfd580a0 --- /dev/null +++ b/externals/ace/OS_NS_wctype.h @@ -0,0 +1,71 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file OS_NS_wctype.h + * + * $Id: OS_NS_wctype.h 83891 2008-11-28 11:01:50Z johnnyw $ + * + * @author Johnny Willemsen + */ +//============================================================================= + +#ifndef ACE_OS_NS_WCTYPE_H +# define ACE_OS_NS_WCTYPE_H + +# include /**/ "ace/pre.h" + +# include "ace/config-all.h" + +# if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +# endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include /**/ "ace/ACE_export.h" + +#if defined (ACE_EXPORT_MACRO) +# undef ACE_EXPORT_MACRO +#endif +#define ACE_EXPORT_MACRO ACE_Export + +#include "ace/os_include/os_ctype.h" +#if defined ACE_HAS_WCHAR +# include "ace/os_include/os_wctype.h" +#endif /* ACE_HAS_WCHAR */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace ACE_OS { + + // these are non-standard names... + + /** @name Functions from + * + * Included are the functions defined in and their + * equivalents. + * + * Since they are often implemented as macros, we don't use the same name + * here. Instead, we change by prepending "ace_". + */ + //@{ +#if defined (ACE_HAS_WCHAR) + /// Tests @a c for the property specified by the @a desc argument + ACE_NAMESPACE_INLINE_FUNCTION + int ace_iswctype(wint_t c, wctype_t desc); +#endif /* ACE_HAS_WCHAR */ + //@} + +} /* namespace ACE_OS */ + +ACE_END_VERSIONED_NAMESPACE_DECL + +# if defined (ACE_HAS_INLINED_OSCALLS) +# if defined (ACE_INLINE) +# undef ACE_INLINE +# endif /* ACE_INLINE */ +# define ACE_INLINE inline +# include "ace/OS_NS_wctype.inl" +# endif /* ACE_HAS_INLINED_OSCALLS */ + +# include /**/ "ace/post.h" +#endif /* ACE_OS_NS_WCTYPE_H */ diff --git a/externals/ace/OS_NS_wctype.inl b/externals/ace/OS_NS_wctype.inl new file mode 100644 index 00000000000..7706471b17a --- /dev/null +++ b/externals/ace/OS_NS_wctype.inl @@ -0,0 +1,25 @@ +// -*- C++ -*- +// +// $Id: OS_NS_wctype.inl 83891 2008-11-28 11:01:50Z johnnyw $ + +#if defined (ACE_LACKS_ISWCTYPE) +#include "ace/OS_NS_errno.h" +#endif + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +#if defined (ACE_HAS_WCHAR) +ACE_INLINE int +ACE_OS::ace_iswctype(wint_t c, wctype_t desc) +{ +#if !defined (ACE_LACKS_ISWCTYPE) + return iswctype (c, desc); +#else + ACE_UNUSED_ARG (c); + ACE_UNUSED_ARG (desc); + ACE_NOTSUP_RETURN (-1); +#endif +} +#endif /* ACE_HAS_WCHAR */ + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/OS_QoS.cpp b/externals/ace/OS_QoS.cpp similarity index 98% rename from dep/src/ace/OS_QoS.cpp rename to externals/ace/OS_QoS.cpp index 0adf6efc01e..4913dd51fa9 100644 --- a/dep/src/ace/OS_QoS.cpp +++ b/externals/ace/OS_QoS.cpp @@ -2,7 +2,7 @@ ///** // * @file OS_QoS.cpp // * -// * $Id: OS_QoS.cpp 80826 2008-03-04 14:51:23Z wotte $ +// * $Id: OS_QoS.cpp 86508 2009-08-14 13:32:40Z johnnyw $ // * // * @brief Contains OS specific data structures for QoS networking. // * @@ -363,7 +363,7 @@ void ACE_QoS::provider_specific (const iovec &ps) { #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) - this->ProviderSpecific = (WSABUF) ((iovec &) ps); + this->ProviderSpecific = (WSABUF) (const_cast (ps)); #else ACE_UNUSED_ARG (ps); #endif /* ACE_HAS_WINSOCK2 */ @@ -474,4 +474,3 @@ ACE_Accept_QoS_Params::callback_data (unsigned long cd) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_QoS.h b/externals/ace/OS_QoS.h similarity index 100% rename from dep/include/ace/OS_QoS.h rename to externals/ace/OS_QoS.h index c1dddf3e01c..74d46afce0e 100644 --- a/dep/include/ace/OS_QoS.h +++ b/externals/ace/OS_QoS.h @@ -390,6 +390,7 @@ typedef int (*ACE_QOS_CONDITION_FUNC) (iovec *caller_id, ACE_SOCK_GROUP *g, unsigned long callbackdata); + /** * @class ACE_Accept_QoS_Params * @@ -446,4 +447,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_QOS_H */ - diff --git a/dep/include/ace/OS_String.h b/externals/ace/OS_String.h similarity index 99% rename from dep/include/ace/OS_String.h rename to externals/ace/OS_String.h index 10ea346fc9c..2d7aa86ad85 100644 --- a/dep/include/ace/OS_String.h +++ b/externals/ace/OS_String.h @@ -30,4 +30,3 @@ #include /**/ "ace/post.h" #endif /* ACE_OS_STRING_H */ - diff --git a/dep/src/ace/OS_TLI.cpp b/externals/ace/OS_TLI.cpp similarity index 99% rename from dep/src/ace/OS_TLI.cpp rename to externals/ace/OS_TLI.cpp index c2754b7b36d..c874388f46f 100644 --- a/dep/src/ace/OS_TLI.cpp +++ b/externals/ace/OS_TLI.cpp @@ -7,4 +7,3 @@ ACE_RCSID(ace, OS_TLI, "$Id: OS_TLI.cpp 80826 2008-03-04 14:51:23Z wotte $") #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_TLI.inl" #endif /* !ACE_HAS_INLINED_OSCALLS */ - diff --git a/dep/include/ace/OS_TLI.h b/externals/ace/OS_TLI.h similarity index 100% rename from dep/include/ace/OS_TLI.h rename to externals/ace/OS_TLI.h index bccc3cd18ae..61a6cd5c026 100644 --- a/dep/include/ace/OS_TLI.h +++ b/externals/ace/OS_TLI.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_OS_TLI_H # define ACE_OS_TLI_H # include /**/ "ace/pre.h" @@ -282,4 +283,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OS_TLI_H */ - diff --git a/dep/include/ace/OS_TLI.inl b/externals/ace/OS_TLI.inl similarity index 100% rename from dep/include/ace/OS_TLI.inl rename to externals/ace/OS_TLI.inl diff --git a/dep/src/ace/OS_Thread_Adapter.cpp b/externals/ace/OS_Thread_Adapter.cpp similarity index 99% rename from dep/src/ace/OS_Thread_Adapter.cpp rename to externals/ace/OS_Thread_Adapter.cpp index 7fa4d1a4896..f65d1acaff2 100644 --- a/dep/src/ace/OS_Thread_Adapter.cpp +++ b/externals/ace/OS_Thread_Adapter.cpp @@ -151,4 +151,3 @@ ACE_OS_Thread_Adapter::invoke (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/OS_Thread_Adapter.h b/externals/ace/OS_Thread_Adapter.h similarity index 96% rename from dep/include/ace/OS_Thread_Adapter.h rename to externals/ace/OS_Thread_Adapter.h index d51bc772168..4dc3cee0911 100644 --- a/dep/include/ace/OS_Thread_Adapter.h +++ b/externals/ace/OS_Thread_Adapter.h @@ -4,7 +4,7 @@ /** * @file OS_Thread_Adapter.h * - * $Id: OS_Thread_Adapter.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: OS_Thread_Adapter.h 85341 2009-05-14 11:07:37Z johnnyw $ * * @author Carlos O'Ryan */ @@ -63,11 +63,9 @@ protected: /// Ensure that this object is allocated on the heap. ~ACE_OS_Thread_Adapter (void); - }; ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_THREAD_ADAPTER_H */ - diff --git a/dep/src/ace/OS_main.cpp b/externals/ace/OS_main.cpp similarity index 74% rename from dep/src/ace/OS_main.cpp rename to externals/ace/OS_main.cpp index 18bcae32d50..790063f7037 100644 --- a/dep/src/ace/OS_main.cpp +++ b/externals/ace/OS_main.cpp @@ -1,8 +1,10 @@ -// $Id: OS_main.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: OS_main.cpp 85662 2009-06-16 15:17:31Z mitza $ #include "ace/OS_main.h" -ACE_RCSID(ace, OS_main, "$Id: OS_main.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, OS_main, "$Id: OS_main.cpp 85662 2009-06-16 15:17:31Z mitza $") + +#if !defined (ACE_DOESNT_DEFINE_MAIN) #if defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) && !defined (ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER) @@ -43,7 +45,8 @@ int ace_os_main_i (int argc, char *argv[]) /* user's entry point, e.g., main */ return vx_ace_main_i_ptr ? (*vx_ace_main_i_ptr) (argc, argv) : (-1); /* what the user calls "main" */ } # else /* !ACE_VXWORKS && !__RTP__ */ -int ace_os_main_i (int argc, char *argv[]) /* user's entry point, e.g., main */ +ACE_Export int +ace_os_main_i (int argc, char *argv[]) /* user's entry point, e.g., main */ { ACE_MAIN_OBJECT_MANAGER return ace_main_i (argc, argv); /* what the user calls "main" */ @@ -100,23 +103,47 @@ ACE_END_VERSIONED_NAMESPACE_DECL // CE only gets a command line string; no argv. So we need to convert it // when the main entrypoint expects argc/argv. ACE_ARGV supports this. # include "ace/OS_NS_string.h" +# include "ace/OS_NS_ctype.h" # include "ace/ACE.h" # include "ace/ARGV.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_Main_Base::~ACE_Main_Base () +{ +} + int ACE_Main_Base::run (HINSTANCE, HINSTANCE, LPWSTR lpCmdLine, int) { ACE_TCHAR cmdline[1024]; - ACE_OS::strcpy (cmdline, ACE_TEXT ("program ")); + ACE_TCHAR msg_file [MAXPATHLEN]; + if (ACE_TEXT_GetModuleFileName (0, msg_file, MAXPATHLEN)) + { + bool quote = false; + for (size_t i(0); !quote && msg_file[i]; ++i) + { + if (ACE_OS::ace_isspace (msg_file[i])) quote = true; + } + ACE_TCHAR *cmd_iter = cmdline; + if (quote) + { + *cmd_iter++ = ACE_TEXT ('"'); + } + ACE_OS::strcpy (cmd_iter, msg_file); + ACE_OS::strcat (cmd_iter, quote ? ACE_TEXT ("\" ") : ACE_TEXT (" ")); + } + else + { + ACE_OS::strcpy (cmdline, ACE_TEXT ("program ")); + } ACE_OS::strcat (cmdline, ACE_TEXT_WCHAR_TO_TCHAR (lpCmdLine)); ACE_ARGV ce_argv (cmdline); ACE::init (); ACE_MAIN_OBJECT_MANAGER - int i = this->run_i (ce_argv.argc (), ce_argv.argv ()); + int const i = this->run_i (ce_argv.argc (), ce_argv.argv ()); ACE::fini (); return i; } @@ -124,5 +151,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # endif /* !ACE_HAS_WINCE */ -# endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER && !ACE_HAS_WINCE && !ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER */ +#endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER && !ACE_HAS_WINCE && !ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER */ + +#endif /* ACE_DOESNT_DEFINE_MAIN */ diff --git a/dep/include/ace/OS_main.h b/externals/ace/OS_main.h similarity index 97% rename from dep/include/ace/OS_main.h rename to externals/ace/OS_main.h index 502aa5da67e..b916280eacb 100644 --- a/dep/include/ace/OS_main.h +++ b/externals/ace/OS_main.h @@ -4,7 +4,7 @@ /** * @file OS_main.h * - * $Id: OS_main.h 81843 2008-06-05 15:47:55Z schmidt $ + * $Id: OS_main.h 85579 2009-06-08 18:46:54Z mitza $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -25,6 +25,8 @@ # pragma once # endif /* ACE_LACKS_PRAGMA_ONCE */ +# if !defined (ACE_DOESNT_DEFINE_MAIN) + # if defined (ACE_HAS_RTEMS) extern char* rtems_progname; # endif /* ACE_HAS_RTEMS */ @@ -139,14 +141,14 @@ ace_main_i # define main \ ACE_MAIN (int, char *[]); /* forward decl to gobble up the 'int' if there is one */ \ ACE_BEGIN_VERSIONED_NAMESPACE_DECL \ -int ace_os_main_i (int, char *[]); \ +ACE_Export int ace_os_main_i (int, char *[]); \ ACE_END_VERSIONED_NAMESPACE_DECL \ int \ ACE_MAIN (int argc, char *argv[]) /* user's entry point, e.g., main */ \ { \ return ace_os_main_i (argc, argv); /* what the user calls "main" */ \ } \ -int \ +ACE_Proper_Export_Flag int \ ace_main_i # elif !defined (ACE_HAS_WINCE) @@ -236,6 +238,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Main_Base { public: + virtual ~ACE_Main_Base (void); int run (HINSTANCE, HINSTANCE, LPWSTR, int); virtual int run_i (int, ACE_TCHAR *[]) = 0; }; @@ -300,7 +303,8 @@ int ace_main_i # endif /* ACE_PSOSIM */ # endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER && !ACE_HAS_WINCE && !ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER */ +#endif /* ACE_DOESNT_DEFINE_MAIN */ + # include /**/ "ace/post.h" #endif /* ACE_OS_MAIN_H */ - diff --git a/dep/src/ace/Obchunk.cpp b/externals/ace/Obchunk.cpp similarity index 99% rename from dep/src/ace/Obchunk.cpp rename to externals/ace/Obchunk.cpp index 71a69d1a3e7..cbe56af7de7 100644 --- a/dep/src/ace/Obchunk.cpp +++ b/externals/ace/Obchunk.cpp @@ -34,4 +34,3 @@ ACE_Obchunk::ACE_Obchunk (size_t size) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Obchunk.h b/externals/ace/Obchunk.h similarity index 100% rename from dep/include/ace/Obchunk.h rename to externals/ace/Obchunk.h index 053b144979e..b76a7f7e3cf 100644 --- a/dep/include/ace/Obchunk.h +++ b/externals/ace/Obchunk.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_OBCHUNK_H #define ACE_OBCHUNK_H #include /**/ "ace/pre.h" @@ -74,4 +75,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OBCHUNK_H */ - diff --git a/dep/include/ace/Obchunk.inl b/externals/ace/Obchunk.inl similarity index 100% rename from dep/include/ace/Obchunk.inl rename to externals/ace/Obchunk.inl diff --git a/dep/src/ace/Object_Manager.cpp b/externals/ace/Object_Manager.cpp similarity index 88% rename from dep/src/ace/Object_Manager.cpp rename to externals/ace/Object_Manager.cpp index 157c26a0441..ec5dbaf63e1 100644 --- a/dep/src/ace/Object_Manager.cpp +++ b/externals/ace/Object_Manager.cpp @@ -1,4 +1,4 @@ -// $Id: Object_Manager.cpp 81450 2008-04-25 21:24:33Z mitza $ +// $Id: Object_Manager.cpp 84218 2009-01-22 19:21:39Z mitza $ #include "ace/Object_Manager.h" #if !defined (ACE_LACKS_ACE_TOKEN) @@ -30,8 +30,13 @@ #include "ace/Null_Mutex.h" #include "ace/Mutex.h" #include "ace/RW_Thread_Mutex.h" +#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \ + defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) \ + && (_MSC_VER >= 1400) // VC++ 8.0 and above. + #include "ace/OS_NS_stdlib.h" +#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE && (_MSC_VER >= 1400) -ACE_RCSID(ace, Object_Manager, "$Id: Object_Manager.cpp 81450 2008-04-25 21:24:33Z mitza $") +ACE_RCSID(ace, Object_Manager, "$Id: Object_Manager.cpp 84218 2009-01-22 19:21:39Z mitza $") #if ! defined (ACE_APPLICATION_PREALLOCATED_OBJECT_DEFINITIONS) # define ACE_APPLICATION_PREALLOCATED_OBJECT_DEFINITIONS @@ -51,6 +56,18 @@ ACE_RCSID(ace, Object_Manager, "$Id: Object_Manager.cpp 81450 2008-04-25 21:24:3 ACE_BEGIN_VERSIONED_NAMESPACE_DECL +// Note the following fix was derived from that proposed by Jochen Kalmbach +// http://blog.kalmbachnet.de/?postid=75 +#if defined (ACE_DISABLE_WIN32_ERROR_WINDOWS) && \ + defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && \ + (_MSC_VER >= 1400) && defined (_M_IX86) +LPTOP_LEVEL_EXCEPTION_FILTER WINAPI ACEdisableSetUnhandledExceptionFilter ( + LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) +{ + return 0; +} +#endif // ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE && (_MSC_VER >= 1400) && _M_IX86 + // Singleton pointer. ACE_Object_Manager *ACE_Object_Manager::instance_ = 0; @@ -257,8 +274,56 @@ ACE_Object_Manager::init (void) // And this will catch all unhandled exceptions. SetUnhandledExceptionFilter (&ACE_UnhandledExceptionFilter); + +# if (_MSC_VER >= 1400) // VC++ 8.0 and above. + // And this will stop the abort system call from being treated as a crash + _set_abort_behavior( 0, _CALL_REPORTFAULT); + + // Note the following fix was derived from that proposed by Jochen Kalmbach + // http://blog.kalmbachnet.de/?postid=75 + // See also: + // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101337 + // + // Starting with VC8 (VS2005), Microsoft changed the behaviour of the CRT in some + // security related and special situations. The are many situations in which our + // ACE_UnhandledExceptionFilter will never be called. This is a major change to + // the previous versions of the CRT and is not very well documented. + // The CRT simply forces the call to the default-debugger without informing the + // registered unhandled exception filter. Jochen's solution is to stop the CRT + // from calling SetUnhandledExceptionFilter() after we have done so above. + // NOTE this only works for intel based windows builds. + +# ifdef _M_IX86 + HMODULE hKernel32 = ACE_TEXT_LoadLibrary (ACE_TEXT ("kernel32.dll")); + if (hKernel32) + { + void *pOrgEntry = + GetProcAddress (hKernel32, "SetUnhandledExceptionFilter"); + if (pOrgEntry) + { + unsigned char newJump[ 100 ]; + DWORD dwOrgEntryAddr = reinterpret_cast (pOrgEntry); + dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far + void *pNewFunc = &ACEdisableSetUnhandledExceptionFilter; + DWORD dwNewEntryAddr = reinterpret_cast (pNewFunc); + DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr; + + newJump[ 0 ] = 0xE9; // JMP absolute + ACE_OS::memcpy (&newJump[ 1 ], &dwRelativeAddr, sizeof (pNewFunc)); + SIZE_T bytesWritten; + WriteProcessMemory ( + GetCurrentProcess (), + pOrgEntry, + newJump, + sizeof (pNewFunc) + 1, + &bytesWritten); + } + } +# endif // _M_IX86 +# endif // (_MSC_VER >= 1400) // VC++ 8.0 and above. #endif /* ACE_DISABLE_WIN32_ERROR_WINDOWS && ACE_WIN32 && !ACE_HAS_WINCE */ + # if !defined (ACE_LACKS_ACE_SVCCONF) ACE_NEW_RETURN (preallocations_, ACE_Object_Manager_Preallocations, @@ -379,7 +444,8 @@ ACE_Object_Manager::instance (void) int ACE_Object_Manager::at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param) + void *param, + const char* name) { ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *instance_->internal_lock_, -1)); @@ -397,7 +463,22 @@ ACE_Object_Manager::at_exit_i (void *object, return -1; } - return exit_info_.at_exit_i (object, cleanup_hook, param); + return exit_info_.at_exit_i (object, cleanup_hook, param, name); +} + +int +ACE_Object_Manager::remove_at_exit_i (void *object) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, + *instance_->internal_lock_, -1)); + + if (shutting_down_i ()) + { + errno = EAGAIN; + return -1; + } + + return exit_info_.remove (object); } #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) @@ -466,7 +547,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock) if (lock == 0) { - ACE_Cleanup_Adapter *lock_adapter; + ACE_Cleanup_Adapter *lock_adapter = 0; ACE_NEW_RETURN (lock_adapter, ACE_Cleanup_Adapter, -1); @@ -476,7 +557,9 @@ ACE_Object_Manager::get_singleton_lock (ACE_Thread_Mutex *&lock) // termination. This call will cause us to grab the // ACE_Object_Manager::instance ()->internal_lock_ // again; that's why it is a recursive lock. - ACE_Object_Manager::at_exit (lock_adapter); + ACE_Object_Manager::at_exit (lock_adapter, + 0, + typeid (*lock_adapter).name ()); } } } @@ -514,7 +597,7 @@ ACE_Object_Manager::get_singleton_lock (ACE_Mutex *&lock) if (lock == 0) { - ACE_Cleanup_Adapter *lock_adapter; + ACE_Cleanup_Adapter *lock_adapter = 0; ACE_NEW_RETURN (lock_adapter, ACE_Cleanup_Adapter, -1); @@ -598,12 +681,13 @@ ACE_Object_Manager::get_singleton_lock (ACE_RW_Thread_Mutex *&lock) if (lock == 0) { - ACE_Cleanup_Adapter *lock_adapter; + ACE_Cleanup_Adapter *lock_adapter = 0; ACE_NEW_RETURN (lock_adapter, ACE_Cleanup_Adapter, -1); lock = &lock_adapter->object (); + // Register the lock for destruction at program // termination. This call will cause us to grab the // ACE_Object_Manager::instance ()->internal_lock_ @@ -757,6 +841,7 @@ ACE_Object_Manager::fini (void) return 0; } + #if !defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) /** * @class ACE_Object_Manager_Manager @@ -884,4 +969,3 @@ ACE_Static_Object_Lock::cleanup_lock (void) #endif /* ACE_HAS_THREADS */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Object_Manager.h b/externals/ace/Object_Manager.h similarity index 95% rename from dep/include/ace/Object_Manager.h rename to externals/ace/Object_Manager.h index 69952d4d018..94b755e1081 100644 --- a/dep/include/ace/Object_Manager.h +++ b/externals/ace/Object_Manager.h @@ -4,7 +4,7 @@ /** * @file Object_Manager.h * - * $Id: Object_Manager.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Object_Manager.h 84163 2009-01-15 07:57:27Z johnnyw $ * * @author David L. Levine * @author Matthias Kerkhoff @@ -237,13 +237,13 @@ public: * Register an ACE_Cleanup object for cleanup at process * termination. The object is deleted via the * . If you need more flexiblity, see the - * method below. For OS's that do not have + * @c other at_exit method below. For OS's that do not have * processes, cleanup takes place at the end of
. Returns 0 * on success. On failure, returns -1 and sets errno to: EAGAIN if * shutting down, ENOMEM if insufficient virtual memory, or EEXIST * if the object (or array) had already been registered. */ - static int at_exit (ACE_Cleanup *object, void *param = 0); + static int at_exit (ACE_Cleanup *object, void *param = 0, const char* name = 0); #if defined (ACE_HAS_TSS_EMULATION) static int init_tss (void); @@ -256,8 +256,8 @@ public: * that is called for the object or array when it to be destroyed. * It may perform any necessary cleanup specific for that object or * its class. "param" is passed as the second parameter to the - * "cleanup_hook" function; the first parameter is the object (or - * array) to be destroyed. "cleanup_hook", for example, may delete + * @a cleanup_hook function; the first parameter is the object (or + * array) to be destroyed. @a cleanup_hook, for example, may delete * the object (or array). For OS's that do not have processes, this * function is the same as . Returns 0 on success. * On failure, returns -1 and sets errno to: EAGAIN if shutting @@ -266,14 +266,18 @@ public: */ static int at_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param); + void *param, + const char* name = 0); + + static int remove_at_exit (void *object); #if 0 /* not implemented yet */ /// Similar to , except that the cleanup_hook is called /// when the current thread exits instead of when the program terminates. static int at_thread_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param); + void *param, + const char* name); #endif /* 0 */ /// Unique identifiers for preallocated objects. Please see @@ -343,7 +347,11 @@ private: /// Register an object or array for deletion at program termination. /// See description of static version above for return values. - int at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param); + int at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, void *param, const char* name); + + /// Remove an object for deletion at program termination. + /// See description of static version above for return values. + int remove_at_exit_i (void *object); #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) public: @@ -461,6 +469,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL ACE_FACTORY_DECLARE (ACE, ACE_Service_Manager) #endif /* ! ACE_LACKS_ACE_SVCCONF */ + #include /**/ "ace/post.h" #endif /* ACE_OBJECT_MANAGER_H */ - diff --git a/dep/include/ace/Object_Manager.inl b/externals/ace/Object_Manager.inl similarity index 64% rename from dep/include/ace/Object_Manager.inl rename to externals/ace/Object_Manager.inl index bcc27af91bf..30dca17ac4c 100644 --- a/dep/include/ace/Object_Manager.inl +++ b/externals/ace/Object_Manager.inl @@ -1,30 +1,41 @@ // -*- C++ -*- // -// $Id: Object_Manager.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Object_Manager.inl 84163 2009-01-15 07:57:27Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_Object_Manager::at_exit (ACE_Cleanup *object, - void *param) + void *param, + const char* name) { return ACE_Object_Manager::instance ()->at_exit_i ( object, (ACE_CLEANUP_FUNC) ACE_CLEANUP_DESTROYER_NAME, - param); + param, + name); } ACE_INLINE int ACE_Object_Manager::at_exit (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param) + void *param, + const char* name) { return ACE_Object_Manager::instance ()->at_exit_i ( object, cleanup_hook, - param); + param, + name); +} + +ACE_INLINE +int +ACE_Object_Manager::remove_at_exit (void *object) +{ + return ACE_Object_Manager::instance ()->remove_at_exit_i (object); } ACE_INLINE diff --git a/dep/src/ace/Object_Manager_Base.cpp b/externals/ace/Object_Manager_Base.cpp similarity index 98% rename from dep/src/ace/Object_Manager_Base.cpp rename to externals/ace/Object_Manager_Base.cpp index cc615fa48b9..2eafbe0f7e3 100644 --- a/dep/src/ace/Object_Manager_Base.cpp +++ b/externals/ace/Object_Manager_Base.cpp @@ -1,8 +1,8 @@ -// $Id: Object_Manager_Base.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Object_Manager_Base.cpp 84163 2009-01-15 07:57:27Z johnnyw $ #include "ace/Object_Manager_Base.h" -ACE_RCSID(ace, Object_Manager_Base, "$Id: Object_Manager_Base.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Object_Manager_Base, "$Id: Object_Manager_Base.cpp 84163 2009-01-15 07:57:27Z johnnyw $") #include "ace/OS_Memory.h" #include "ace/OS_NS_Thread.h" @@ -83,8 +83,8 @@ void *ACE_OS_Object_Manager::preallocated_object[ ACE_OS_Object_Manager::ACE_OS_PREALLOCATED_OBJECTS] = { 0 }; ACE_OS_Object_Manager::ACE_OS_Object_Manager (void) - // default_mask_ isn't initialized, because it's defined by . - : thread_hook_ (0) + : default_mask_ (0) + , thread_hook_ (0) , exit_info_ () #if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) , seh_except_selector_ (ACE_SEH_Default_Exception_Selector) @@ -394,11 +394,12 @@ ACE_OS_Object_Manager::fini (void) int ace_exit_hook_marker = 0; int -ACE_OS_Object_Manager::at_exit (ACE_EXIT_HOOK func) +ACE_OS_Object_Manager::at_exit (ACE_EXIT_HOOK func, const char* name) { return exit_info_.at_exit_i (&ace_exit_hook_marker, reinterpret_cast (func), - 0); + 0, + name); } void @@ -504,4 +505,3 @@ static ACE_OS_Object_Manager_Manager ACE_OS_Object_Manager_Manager_instance; #endif /* ! ACE_HAS_NONSTATIC_OBJECT_MANAGER */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Object_Manager_Base.h b/externals/ace/Object_Manager_Base.h similarity index 97% rename from dep/include/ace/Object_Manager_Base.h rename to externals/ace/Object_Manager_Base.h index 60ca037f885..66df51d96d5 100644 --- a/dep/include/ace/Object_Manager_Base.h +++ b/externals/ace/Object_Manager_Base.h @@ -4,7 +4,7 @@ /** * @file Object_Manager_Base.h * - * $Id: Object_Manager_Base.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Object_Manager_Base.h 84163 2009-01-15 07:57:27Z johnnyw $ * * @author Douglas C. Schmidt * @author Jesper S. M|ller @@ -104,7 +104,7 @@ protected: /** * Flag indicating whether the ACE_Object_Manager was dynamically - * allocated by ACE. (If is was dynamically allocated by the + * allocated by ACE. (If is was dynamically allocated by the * application, then the application is responsible for destroying * it.) */ @@ -122,6 +122,7 @@ extern "C" void ACE_OS_Object_Manager_Internal_Exit_Hook (void); + // @@ This forward declaration should go away. class ACE_Log_Msg; @@ -204,7 +205,7 @@ public: static ACE_OS_Object_Manager *instance (void); /// For support. - int at_exit (ACE_EXIT_HOOK func); + int at_exit (ACE_EXIT_HOOK func, const char* name = 0); //private: /// Singleton instance pointer. @@ -245,4 +246,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OBJECT_MANAGER_BASE_H */ - diff --git a/dep/include/ace/Obstack.h b/externals/ace/Obstack.h similarity index 99% rename from dep/include/ace/Obstack.h rename to externals/ace/Obstack.h index 24ccd6bdfbf..b7b75e7351a 100644 --- a/dep/include/ace/Obstack.h +++ b/externals/ace/Obstack.h @@ -29,4 +29,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OBSTACK_H */ - diff --git a/dep/src/ace/Obstack_T.cpp b/externals/ace/Obstack_T.cpp similarity index 69% rename from dep/src/ace/Obstack_T.cpp rename to externals/ace/Obstack_T.cpp index b63e0ce1f3d..65e07167a8a 100644 --- a/dep/src/ace/Obstack_T.cpp +++ b/externals/ace/Obstack_T.cpp @@ -1,4 +1,4 @@ -// $Id: Obstack_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Obstack_T.cpp 88793 2010-02-01 17:50:34Z cleeland $ #ifndef ACE_OBSTACK_T_CPP #define ACE_OBSTACK_T_CPP @@ -19,11 +19,11 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_Obstack_T) -template void -ACE_Obstack_T::dump (void) const +template void +ACE_Obstack_T::dump (void) const { #if defined (ACE_HAS_DUMP) - ACE_TRACE ("ACE_Obstack_T::dump"); + ACE_TRACE ("ACE_Obstack_T::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("size_ = %d\n"), this->size_)); @@ -33,13 +33,13 @@ ACE_Obstack_T::dump (void) const #endif /* ACE_HAS_DUMP */ } -template int -ACE_Obstack_T::request (size_t len) +template int +ACE_Obstack_T::request (size_t len) { - ACE_TRACE ("ACE_Obstack_T::request"); + ACE_TRACE ("ACE_Obstack_T::request"); // normalize the length. - len *= sizeof (CHAR); + len *= sizeof (ACE_CHAR_T); // Check to see if there's room for the requested length, including // any part of an existing string, if any. @@ -89,15 +89,15 @@ ACE_Obstack_T::request (size_t len) return 0; } -template CHAR * -ACE_Obstack_T::grow (CHAR c) +template ACE_CHAR_T * +ACE_Obstack_T::grow (ACE_CHAR_T c) { - ACE_TRACE ("ACE_Obstack_T::grow"); + ACE_TRACE ("ACE_Obstack_T::grow"); if (this->request (1) == 0) { - CHAR *retv = reinterpret_cast (this->curr_->cur_); - this->curr_->cur_ += sizeof (CHAR); + ACE_CHAR_T *retv = reinterpret_cast (this->curr_->cur_); + this->curr_->cur_ += sizeof (ACE_CHAR_T); *retv = c; return retv; } @@ -105,10 +105,10 @@ ACE_Obstack_T::grow (CHAR c) return 0; } -template ACE_Obchunk * -ACE_Obstack_T::new_chunk (void) +template ACE_Obchunk * +ACE_Obstack_T::new_chunk (void) { - ACE_TRACE ("ACE_Obstack_T::new_chunk"); + ACE_TRACE ("ACE_Obstack_T::new_chunk"); ACE_Obchunk *temp = 0; @@ -120,15 +120,15 @@ ACE_Obstack_T::new_chunk (void) return temp; } -template -ACE_Obstack_T::ACE_Obstack_T (size_t size, +template +ACE_Obstack_T::ACE_Obstack_T (size_t size, ACE_Allocator *allocator_strategy) : allocator_strategy_ (allocator_strategy), size_ (size), head_ (0), curr_ (0) { - ACE_TRACE ("ACE_Obstack_T::ACE_Obstack"); + ACE_TRACE ("ACE_Obstack_T::ACE_Obstack"); if (this->allocator_strategy_ == 0) ACE_ALLOCATOR (this->allocator_strategy_, @@ -138,10 +138,10 @@ ACE_Obstack_T::ACE_Obstack_T (size_t size, this->curr_ = this->head_; } -template -ACE_Obstack_T::~ACE_Obstack_T (void) +template +ACE_Obstack_T::~ACE_Obstack_T (void) { - ACE_TRACE ("ACE_Obstack_T::~ACE_Obstack_T"); + ACE_TRACE ("ACE_Obstack_T::~ACE_Obstack_T"); ACE_Obchunk *temp = this->head_; @@ -154,23 +154,23 @@ ACE_Obstack_T::~ACE_Obstack_T (void) } } -template CHAR * -ACE_Obstack_T::copy (const CHAR *s, +template ACE_CHAR_T * +ACE_Obstack_T::copy (const ACE_CHAR_T *s, size_t len) { - ACE_TRACE ("ACE_Obstack_T::copy"); + ACE_TRACE ("ACE_Obstack_T::copy"); if (this->request (len) != 0) return 0; - size_t tsize = len * sizeof (CHAR); + size_t tsize = len * sizeof (ACE_CHAR_T); ACE_OS::memcpy (this->curr_->cur_, s, tsize); this->curr_->cur_ += tsize ; return this->freeze (); } -template void -ACE_Obstack_T::unwind (void* obj) +template void +ACE_Obstack_T::unwind (void* obj) { if (obj >= this->curr_->contents_ && obj < this->curr_->end_) this->curr_->block_ = this->curr_->cur_ = reinterpret_cast (obj); @@ -178,8 +178,8 @@ ACE_Obstack_T::unwind (void* obj) this->unwind_i (obj); } -template void -ACE_Obstack_T::unwind_i (void* obj) +template void +ACE_Obstack_T::unwind_i (void* obj) { ACE_Obchunk* curr = this->head_; while (curr != 0 && (curr->contents_ > obj || curr->end_ < obj)) @@ -194,29 +194,29 @@ ACE_Obstack_T::unwind_i (void* obj) ACE_TEXT ("Deletion of non-existent object.\n%a"))); } -template void -ACE_Obstack_T::release (void) +template void +ACE_Obstack_T::release (void) { - ACE_TRACE ("ACE_Obstack_T::release"); + ACE_TRACE ("ACE_Obstack_T::release"); this->curr_ = this->head_; this->curr_->block_ = this->curr_->cur_ = this->curr_->contents_; } -template void -ACE_Obstack_T::grow_fast (CHAR c) +template void +ACE_Obstack_T::grow_fast (ACE_CHAR_T c) { - * (reinterpret_cast (this->curr_->cur_)) = c; - this->curr_->cur_ += sizeof (CHAR); + * (reinterpret_cast (this->curr_->cur_)) = c; + this->curr_->cur_ += sizeof (ACE_CHAR_T); } -template CHAR * -ACE_Obstack_T::freeze (void) +template ACE_CHAR_T * +ACE_Obstack_T::freeze (void) { - CHAR *retv = reinterpret_cast (this->curr_->block_); - * (reinterpret_cast (this->curr_->cur_)) = 0; + ACE_CHAR_T *retv = reinterpret_cast (this->curr_->block_); + * (reinterpret_cast (this->curr_->cur_)) = 0; - this->curr_->cur_ += sizeof (CHAR); + this->curr_->cur_ += sizeof (ACE_CHAR_T); this->curr_->block_ = this->curr_->cur_; return retv; } @@ -224,4 +224,3 @@ ACE_Obstack_T::freeze (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_OBSTACK_T_CPP */ - diff --git a/dep/include/ace/Obstack_T.h b/externals/ace/Obstack_T.h similarity index 87% rename from dep/include/ace/Obstack_T.h rename to externals/ace/Obstack_T.h index 130d818199b..d27d43b6ea3 100644 --- a/dep/include/ace/Obstack_T.h +++ b/externals/ace/Obstack_T.h @@ -4,7 +4,7 @@ /** * @file Obstack_T.h * - * $Id: Obstack_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Obstack_T.h 88793 2010-02-01 17:50:34Z cleeland $ * * @author Doug Schmidt * @author Nanbor Wang @@ -34,12 +34,12 @@ class ACE_Allocator; * The implementation is similar to the GNU obstack utility, * which is used extensively in the GCC compiler. */ -template +template class ACE_Obstack_T { public: // = Initialization and termination methods. - ACE_Obstack_T (size_t size = (4096 * sizeof (CHAR)) - sizeof (ACE_Obchunk), + ACE_Obstack_T (size_t size = (4096 * sizeof (ACE_CHAR_T)) - sizeof (ACE_Obchunk), ACE_Allocator *allocator_strategy = 0); ~ACE_Obstack_T (void); @@ -47,32 +47,32 @@ public: /// a new string. Return -1 if fail, 0 if success. int request (size_t len); - /// Inserting a new CHAR \a c into the current building + /// Inserting a new ACE_CHAR_T \a c into the current building /// block without freezing (null terminating) the block. /// This function will create new chunk by checking the /// boundary of current Obchunk. Return /// the location \a c gets inserted to, or 0 if error. - CHAR *grow (CHAR c); + ACE_CHAR_T *grow (ACE_CHAR_T c); - /// Inserting a new CHAR \a c into the current building + /// Inserting a new ACE_CHAR_T \a c into the current building /// block without freezing (null terminating) the block and without /// checking for out-of-bound error. - void grow_fast (CHAR c); + void grow_fast (ACE_CHAR_T c); /// Freeze the current building block by null terminating it. /// Return the starting address of the current building block, 0 /// if error occurs. - CHAR *freeze (void); + ACE_CHAR_T *freeze (void); /// Copy the data into the current Obchunk and freeze the current /// block. Return the starting address of the current building /// block, 0 if error occurs. @a len specify the string length, /// not the actually data size. - CHAR *copy (const CHAR *data, + ACE_CHAR_T *copy (const ACE_CHAR_T *data, size_t len); /// Return the maximum @a length or @a size of a string that can be put - /// into this Obstack. @a size = @a length * sizeof (CHAR). + /// into this Obstack. @a size = @a length * sizeof (ACE_CHAR_T). /// /// @deprecated No need to use this function as you can put objects of /// arbitrary lengths into the obstack now. @@ -132,4 +132,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_OBSTACK_T_H */ - diff --git a/externals/ace/Obstack_T.inl b/externals/ace/Obstack_T.inl new file mode 100644 index 00000000000..dc5665cc764 --- /dev/null +++ b/externals/ace/Obstack_T.inl @@ -0,0 +1,19 @@ +// -*- C++ -*- +// +// $Id: Obstack_T.inl 88793 2010-02-01 17:50:34Z cleeland $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +template ACE_INLINE size_t +ACE_Obstack_T::length () const +{ + return this->size_ / sizeof (ACE_CHAR_T); +} + +template ACE_INLINE size_t +ACE_Obstack_T::size () const +{ + return this->size_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/PI_Malloc.cpp b/externals/ace/PI_Malloc.cpp similarity index 99% rename from dep/src/ace/PI_Malloc.cpp rename to externals/ace/PI_Malloc.cpp index 4e27441f405..979ddd6ba4c 100644 --- a/dep/src/ace/PI_Malloc.cpp +++ b/externals/ace/PI_Malloc.cpp @@ -163,4 +163,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1*/ #endif /* ACE_PI_MALLOC_CPP */ - diff --git a/dep/include/ace/PI_Malloc.h b/externals/ace/PI_Malloc.h similarity index 99% rename from dep/include/ace/PI_Malloc.h rename to externals/ace/PI_Malloc.h index a1167fb6fad..679b71b98ca 100644 --- a/dep/include/ace/PI_Malloc.h +++ b/externals/ace/PI_Malloc.h @@ -211,4 +211,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PI_MALLOC_H */ - diff --git a/dep/include/ace/PI_Malloc.inl b/externals/ace/PI_Malloc.inl similarity index 100% rename from dep/include/ace/PI_Malloc.inl rename to externals/ace/PI_Malloc.inl diff --git a/dep/src/ace/POSIX_Asynch_IO.cpp b/externals/ace/POSIX_Asynch_IO.cpp similarity index 99% rename from dep/src/ace/POSIX_Asynch_IO.cpp rename to externals/ace/POSIX_Asynch_IO.cpp index f8d37719b48..bd5304577d8 100644 --- a/dep/src/ace/POSIX_Asynch_IO.cpp +++ b/externals/ace/POSIX_Asynch_IO.cpp @@ -1,4 +1,4 @@ -// $Id: POSIX_Asynch_IO.cpp 81535 2008-04-29 20:08:52Z shuston $ +// $Id: POSIX_Asynch_IO.cpp 84565 2009-02-23 08:20:39Z johnnyw $ #include "ace/POSIX_Asynch_IO.h" @@ -16,7 +16,8 @@ ACE_RCSID (ace, POSIX_Asynch_IO, - "$Id: POSIX_Asynch_IO.cpp 81535 2008-04-29 20:08:52Z shuston $") + "$Id: POSIX_Asynch_IO.cpp 84565 2009-02-23 08:20:39Z johnnyw $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -701,6 +702,7 @@ ACE_POSIX_Asynch_Write_File::write (ACE_Message_Block &message_block, // ********************************************************************* + size_t ACE_POSIX_Asynch_Accept_Result::bytes_to_read (void) const { @@ -813,7 +815,7 @@ ACE_POSIX_Asynch_Accept::open (const ACE_Handler::Proxy_Ptr &handler_proxy, if (this->flg_open_) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%N:%l:ACE_POSIX_Asynch_Accept::open:") - ACE_TEXT("acceptor already open \n")), + ACE_TEXT("acceptor already open\n")), -1); if (-1 == ACE_POSIX_Asynch_Operation::open (handler_proxy, @@ -1145,6 +1147,7 @@ void ACE_POSIX_Asynch_Connect_Result::connect_handle (ACE_HANDLE handle) this->aio_fildes = handle; } + ACE_POSIX_Asynch_Connect_Result::ACE_POSIX_Asynch_Connect_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE connect_handle, @@ -1317,6 +1320,7 @@ ACE_POSIX_Asynch_Connect::connect (ACE_HANDLE connect_handle, else result = 0; + return 0; } @@ -1448,6 +1452,7 @@ ACE_POSIX_Asynch_Connect::connect_i (ACE_POSIX_Asynch_Connect_Result *result, ACE_NOTREACHED (return 0); } + //@@ New method cancel_uncompleted // It performs cancellation of all pending requests // @@ -1473,7 +1478,7 @@ ACE_POSIX_Asynch_Connect::cancel_uncompleted (bool flg_notify, set.reset (); - for (; iter.next (me) != 0; retval++ , iter.advance ()) + for (; iter.next (me) != 0; retval++ , iter.advance ()) { ACE_HANDLE handle = me->ext_id_; ACE_POSIX_Asynch_Connect_Result* result = me->int_id_ ; @@ -1584,6 +1589,7 @@ ACE_POSIX_Asynch_Connect::handle_output (ACE_HANDLE fd) return 0; } + int ACE_POSIX_Asynch_Connect::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask) { @@ -1713,6 +1719,7 @@ ACE_POSIX_Asynch_Transmit_File_Result::~ACE_POSIX_Asynch_Transmit_File_Result (v { } + // ********************************************************************* /** @@ -1822,6 +1829,7 @@ ACE_POSIX_Asynch_Transmit_Handler::~ACE_POSIX_Asynch_Transmit_Handler (void) mb_->release (); } + // Do the transmission. // Initiate transmitting the header. When that completes // handle_write_stream will be called, there start transmitting the file. @@ -2067,8 +2075,8 @@ ACE_POSIX_Asynch_Transmit_File::transmit_file (ACE_HANDLE file, if (file_size == -1) ACE_ERROR_RETURN ((LM_ERROR, - "Error:%N:%l:%p\n", - "POSIX_Asynch_Transmit_File:filesize failed"), + ACE_TEXT("Error:%N:%l:%p\n"), + ACE_TEXT("POSIX_Asynch_Transmit_File:filesize failed")), -1); if (bytes_to_write == 0) @@ -2076,8 +2084,8 @@ ACE_POSIX_Asynch_Transmit_File::transmit_file (ACE_HANDLE file, if (offset > (size_t) file_size) ACE_ERROR_RETURN ((LM_ERROR, - "Error:%p\n", - "Asynch_Transmit_File:File size is less than offset"), + ACE_TEXT("Error:%p\n"), + ACE_TEXT("Asynch_Transmit_File:File size is less than offset")), -1); if (offset != 0) @@ -2155,6 +2163,7 @@ ACE_POSIX_Asynch_Read_Dgram_Result::saddr () const return (sockaddr *) this->remote_address_->get_addr (); } + int ACE_POSIX_Asynch_Read_Dgram_Result::flags (void) const { @@ -2253,6 +2262,7 @@ ACE_POSIX_Asynch_Write_Dgram_Result::handle (void) const return this->handle_; } + ACE_Message_Block* ACE_POSIX_Asynch_Write_Dgram_Result::message_block () const { @@ -2409,4 +2419,3 @@ ACE_POSIX_Asynch_Write_Dgram::ACE_POSIX_Asynch_Write_Dgram ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS */ - diff --git a/dep/include/ace/POSIX_Asynch_IO.h b/externals/ace/POSIX_Asynch_IO.h similarity index 99% rename from dep/include/ace/POSIX_Asynch_IO.h rename to externals/ace/POSIX_Asynch_IO.h index 713d08f0e95..0f3ed30b41b 100644 --- a/dep/include/ace/POSIX_Asynch_IO.h +++ b/externals/ace/POSIX_Asynch_IO.h @@ -300,6 +300,7 @@ public: virtual ~ACE_POSIX_Asynch_Read_Stream (void); }; + /** * @class ACE_POSIX_Asynch_Write_Stream_Result * @@ -483,6 +484,7 @@ private: int signal_number = 0); }; + /** * @class ACE_POSIX_Asynch_Write_File_Result * @@ -649,6 +651,7 @@ protected: // I/O handle for the new connection. }; + /** * @class ACE_POSIX_Asynch_Accept * @@ -795,6 +798,7 @@ protected: void connect_handle (ACE_HANDLE handle); }; + /** * @class ACE_POSIX_Asynch_Connect * @@ -902,6 +906,7 @@ private: ACE_SYNCH_MUTEX lock_; }; + /** * @class ACE_POSIX_Asynch_Transmit_File_Result * @@ -1031,6 +1036,7 @@ public: virtual ~ACE_POSIX_Asynch_Transmit_File (void); }; + /** * @class ACE_POSIX_Asynch_Read_Dgram * @@ -1210,6 +1216,7 @@ protected: ACE_POSIX_Asynch_Write_Dgram (void); }; + /*****************************************************/ /** @@ -1293,4 +1300,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS */ #endif /* ACE_POSIX_ASYNCH_IO_H */ - diff --git a/dep/src/ace/POSIX_CB_Proactor.cpp b/externals/ace/POSIX_CB_Proactor.cpp similarity index 93% rename from dep/src/ace/POSIX_CB_Proactor.cpp rename to externals/ace/POSIX_CB_Proactor.cpp index 8003781a8c2..6f8e5aed0f5 100644 --- a/dep/src/ace/POSIX_CB_Proactor.cpp +++ b/externals/ace/POSIX_CB_Proactor.cpp @@ -1,4 +1,4 @@ -// $Id: POSIX_CB_Proactor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: POSIX_CB_Proactor.cpp 84455 2009-02-13 13:31:02Z johnnyw $ #include "ace/POSIX_CB_Proactor.h" @@ -11,7 +11,7 @@ ACE_RCSID (ace, POSIX_CB_Proactor, - "$Id: POSIX_CB_Proactor.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: POSIX_CB_Proactor.cpp 84455 2009-02-13 13:31:02Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -75,6 +75,7 @@ ACE_POSIX_CB_Proactor::notify_completion (int sig_num) return this->sema_.release(); } + ssize_t ACE_POSIX_CB_Proactor::allocate_aio_slot (ACE_POSIX_Asynch_Result *result) { @@ -134,9 +135,9 @@ ACE_POSIX_CB_Proactor::handle_events_i (u_long milli_seconds) if (lerror != ETIME && // timeout lerror != EINTR ) // interrupted system call ACE_ERROR ((LM_ERROR, - "%N:%l:(%P | %t)::%p\n", - "ACE_POSIX_CB_Proactor::handle_events:" - "semaphore acquire failed" + ACE_TEXT("%N:%l:(%P | %t)::%p\n"), + ACE_TEXT("ACE_POSIX_CB_Proactor::handle_events:") + ACE_TEXT("semaphore acquire failed") )); } @@ -149,7 +150,7 @@ ACE_POSIX_CB_Proactor::handle_events_i (u_long milli_seconds) int ret_aio = 0; int ret_que = 0; - for (; ; ret_aio++) + for (;; ret_aio++) { ACE_POSIX_Asynch_Result * asynch_result = this->find_completed_aio (error_status, @@ -182,4 +183,3 @@ ACE_POSIX_CB_Proactor::handle_events_i (u_long milli_seconds) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS && !ACE_HAS_BROKEN_SIGEVENT_STRUCT */ - diff --git a/dep/include/ace/POSIX_CB_Proactor.h b/externals/ace/POSIX_CB_Proactor.h similarity index 100% rename from dep/include/ace/POSIX_CB_Proactor.h rename to externals/ace/POSIX_CB_Proactor.h index 8969d57acfe..fc76f82e228 100644 --- a/dep/include/ace/POSIX_CB_Proactor.h +++ b/externals/ace/POSIX_CB_Proactor.h @@ -27,6 +27,7 @@ #include "ace/POSIX_Proactor.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -94,4 +95,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS */ #endif /* ACE_POSIX_CB_PROACTOR_H*/ - diff --git a/dep/src/ace/POSIX_Proactor.cpp b/externals/ace/POSIX_Proactor.cpp similarity index 97% rename from dep/src/ace/POSIX_Proactor.cpp rename to externals/ace/POSIX_Proactor.cpp index b6130f3c5ba..151aa26ab32 100644 --- a/dep/src/ace/POSIX_Proactor.cpp +++ b/externals/ace/POSIX_Proactor.cpp @@ -1,4 +1,4 @@ -// $Id: POSIX_Proactor.cpp 81697 2008-05-14 18:33:11Z johnnyw $ +// $Id: POSIX_Proactor.cpp 86102 2009-07-18 04:15:48Z wotte $ #include "ace/POSIX_Proactor.h" @@ -49,6 +49,7 @@ public: /// Destructor. virtual ~ACE_POSIX_Wakeup_Completion (void); + /// This method calls the 's method. virtual void complete (size_t bytes_transferred = 0, int success = 1, @@ -183,6 +184,7 @@ ACE_POSIX_Proactor::create_asynch_read_stream_result return implementation; } + ACE_Asynch_Write_Stream_Impl * ACE_POSIX_Proactor::create_asynch_write_stream (void) { @@ -218,6 +220,7 @@ ACE_POSIX_Proactor::create_asynch_write_stream_result return implementation; } + ACE_Asynch_Read_File_Impl * ACE_POSIX_Proactor::create_asynch_read_file (void) { @@ -257,6 +260,7 @@ ACE_POSIX_Proactor::create_asynch_read_file_result return implementation; } + ACE_Asynch_Write_File_Impl * ACE_POSIX_Proactor::create_asynch_write_file (void) { @@ -296,6 +300,7 @@ ACE_POSIX_Proactor::create_asynch_write_file_result return implementation; } + ACE_Asynch_Read_Dgram_Impl * ACE_POSIX_Proactor::create_asynch_read_dgram (void) { @@ -336,6 +341,7 @@ ACE_POSIX_Proactor::create_asynch_read_dgram_result return implementation; } + ACE_Asynch_Write_Dgram_Impl * ACE_POSIX_Proactor::create_asynch_write_dgram (void) { @@ -375,6 +381,7 @@ ACE_POSIX_Proactor::create_asynch_write_dgram_result return implementation; } + ACE_Asynch_Accept_Impl * ACE_POSIX_Proactor::create_asynch_accept (void) { @@ -413,6 +420,7 @@ ACE_POSIX_Proactor::create_asynch_accept_result return implementation; } + ACE_Asynch_Connect_Impl * ACE_POSIX_Proactor::create_asynch_connect (void) { @@ -445,6 +453,7 @@ ACE_POSIX_Proactor::create_asynch_connect_result return implementation; } + ACE_Asynch_Transmit_File_Impl * ACE_POSIX_Proactor::create_asynch_transmit_file (void) { @@ -589,6 +598,7 @@ ACE_POSIX_Proactor::get_impl_type (void) return PROACTOR_POSIX; } + /** * @class ACE_AIOCB_Notify_Pipe_Manager * @@ -675,9 +685,9 @@ ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager (ACE_POSIX_AIOCB_Pr 0) // Proactor == -1) ACE_ERROR ((LM_ERROR, - "%N:%l:%p\n", - "ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager:" - "Open on Read Stream failed")); + ACE_TEXT("%N:%l:%p\n"), + ACE_TEXT("ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager:") + ACE_TEXT("Open on Read Stream failed"))); // Issue an asynch_read on the read_stream of the notify pipe. if (this->read_stream_.read (this->message_block_, @@ -686,9 +696,9 @@ ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager (ACE_POSIX_AIOCB_Pr 0) // Priority == -1) ACE_ERROR ((LM_ERROR, - "%N:%l:%p\n", - "ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager:" - "Read from pipe failed")); + ACE_TEXT("%N:%l:%p\n"), + ACE_TEXT("ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager:") + ACE_TEXT("Read from pipe failed"))); } ACE_AIOCB_Notify_Pipe_Manager::~ACE_AIOCB_Notify_Pipe_Manager (void) @@ -716,6 +726,7 @@ ACE_AIOCB_Notify_Pipe_Manager::~ACE_AIOCB_Notify_Pipe_Manager (void) } + int ACE_AIOCB_Notify_Pipe_Manager::notify () { @@ -762,6 +773,7 @@ ACE_AIOCB_Notify_Pipe_Manager::handle_read_stream ACE_TEXT ("ACE_AIOCB_Notify_Pipe_Manager::handle_read_stream:") ACE_TEXT ("Read from pipe failed"))); + // 2. Do the upcalls // this->posix_aiocb_proactor_->process_result_queue (); } @@ -823,6 +835,7 @@ ACE_POSIX_AIOCB_Proactor::get_impl_type (void) return PROACTOR_AIOCB; } + int ACE_POSIX_AIOCB_Proactor::close (void) { @@ -901,6 +914,7 @@ int ACE_POSIX_AIOCB_Proactor::delete_result_aiocb_list (void) char * op = (aiocb_list_[ai]->aio_lio_opcode == LIO_WRITE )? "WRITE":"READ" ; + ACE_ERROR ((LM_ERROR, ACE_TEXT("slot=%d op=%s status=%d xfercnt=%d %s\n"), ai, @@ -1103,6 +1117,7 @@ ACE_POSIX_Asynch_Result * ACE_POSIX_AIOCB_Proactor::getq_result (void) { ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, 0)); + ACE_POSIX_Asynch_Result* result = 0; if (this->result_queue_.dequeue_head (result) != 0) @@ -1111,8 +1126,8 @@ ACE_POSIX_Asynch_Result * ACE_POSIX_AIOCB_Proactor::getq_result (void) // don't waste time if queue is empty - it is normal // or check queue size before dequeue_head // ACE_ERROR_RETURN ((LM_ERROR, -// "%N:%l:(%P | %t):%p\n", -// "ACE_POSIX_AIOCB_Proactor::getq_result failed"), +// ACE_TEXT("%N:%l:(%P | %t):%p\n"), +// ACE_TEXT("ACE_POSIX_AIOCB_Proactor::getq_result failed")), // 0); return result; @@ -1191,7 +1206,7 @@ ACE_POSIX_AIOCB_Proactor::handle_events_i (u_long milli_seconds) int error_status = 0; size_t transfer_count = 0; - for (; ; retval++) + for (;; retval++) { ACE_POSIX_Asynch_Result *asynch_result = find_completed_aio (error_status, @@ -1224,11 +1239,14 @@ ACE_POSIX_AIOCB_Proactor::get_result_status (ACE_POSIX_Asynch_Result *asynch_res transfer_count = 0; // Get the error status of the aio_ operation. - error_status = aio_error (asynch_result); + // The following aio_ptr anathema is required to work around a bug in an over-aggressive + // optimizer in GCC 4.1.2. + aiocb *aio_ptr (asynch_result); + error_status = aio_error (aio_ptr); if (error_status == EINPROGRESS) return 0; // not completed - ssize_t op_return = aio_return (asynch_result); + ssize_t op_return = aio_return (aio_ptr); if (op_return > 0) transfer_count = static_cast (op_return); // else transfer_count is already 0, error_status reports the error. @@ -1285,6 +1303,7 @@ ACE_POSIX_AIOCB_Proactor::find_completed_aio (int &error_status, return asynch_result; } + int ACE_POSIX_AIOCB_Proactor::start_aio (ACE_POSIX_Asynch_Result *result, ACE_POSIX_Proactor::Opcode op) @@ -1409,16 +1428,18 @@ ACE_POSIX_AIOCB_Proactor::start_aio_i (ACE_POSIX_Asynch_Result *result) const ACE_TCHAR *ptype = 0; // Start IO - + // The following aio_ptr anathema is required to work around a bug in + // the optimizer for GCC 4.1.2 + aiocb * aio_ptr (result); switch (result->aio_lio_opcode ) { case LIO_READ : ptype = ACE_TEXT ("read "); - ret_val = aio_read (result); + ret_val = aio_read (aio_ptr); break; case LIO_WRITE : ptype = ACE_TEXT ("write"); - ret_val = aio_write (result); + ret_val = aio_write (aio_ptr); break; default: ptype = ACE_TEXT ("?????"); @@ -1444,6 +1465,7 @@ ACE_POSIX_AIOCB_Proactor::start_aio_i (ACE_POSIX_Asynch_Result *result) return ret_val; } + int ACE_POSIX_AIOCB_Proactor::start_deferred_aio () { @@ -1594,6 +1616,7 @@ ACE_POSIX_AIOCB_Proactor::cancel_aiocb (ACE_POSIX_Asynch_Result * result) return 2; } + // ********************************************************************* #if defined(ACE_HAS_POSIX_REALTIME_SIGNALS) @@ -1638,8 +1661,8 @@ ACE_POSIX_SIG_Proactor::ACE_POSIX_SIG_Proactor (const sigset_t signal_set, // Empty the signal set first. if (sigemptyset (&this->RT_completion_signals_) == -1) ACE_ERROR ((LM_ERROR, - "Error:(%P | %t):%p\n", - "sigemptyset failed")); + ACE_TEXT("Error:(%P | %t):%p\n"), + ACE_TEXT("sigemptyset failed"))); // For each signal number present in the , add it to // the signal set we use, and also set up its process signal action @@ -1651,9 +1674,9 @@ ACE_POSIX_SIG_Proactor::ACE_POSIX_SIG_Proactor (const sigset_t signal_set, si); if (member == -1) ACE_ERROR ((LM_ERROR, - "%N:%l:(%P | %t)::%p\n", - "ACE_POSIX_SIG_Proactor::ACE_POSIX_SIG_Proactor:" - "sigismember failed")); + ACE_TEXT("%N:%l:(%P | %t)::%p\n"), + ACE_TEXT("ACE_POSIX_SIG_Proactor::ACE_POSIX_SIG_Proactor:") + ACE_TEXT("sigismember failed"))); else if (member == 1) { sigaddset (&this->RT_completion_signals_, si); @@ -1706,8 +1729,8 @@ ACE_POSIX_SIG_Proactor::notify_completion (int sig_num) pid_t const pid = ACE_OS::getpid (); if (pid == (pid_t) -1) ACE_ERROR_RETURN ((LM_ERROR, - "Error:%N:%l(%P | %t):%p", - " failed"), + ACE_TEXT("Error:%N:%l(%P | %t):%p"), + ACE_TEXT(" failed")), -1); // Set the signal information. @@ -1724,8 +1747,8 @@ ACE_POSIX_SIG_Proactor::notify_completion (int sig_num) if (errno != EAGAIN) ACE_ERROR_RETURN ((LM_ERROR, - "Error:%N:%l:(%P | %t):%p\n", - " failed"), + ACE_TEXT("Error:%N:%l:(%P | %t):%p\n"), + ACE_TEXT(" failed")), -1); return -1; } @@ -1816,8 +1839,8 @@ ACE_POSIX_SIG_Proactor::setup_signal_handler (int signal_number) const 0); if (sigaction_return == -1) ACE_ERROR_RETURN ((LM_ERROR, - "Error:%p\n", - "Proactor couldnt do sigaction for the RT SIGNAL"), + ACE_TEXT("Error:%p\n"), + ACE_TEXT("Proactor couldnt do sigaction for the RT SIGNAL")), -1); #else ACE_UNUSED_ARG(signal_number); @@ -1825,6 +1848,7 @@ ACE_POSIX_SIG_Proactor::setup_signal_handler (int signal_number) const return 0; } + int ACE_POSIX_SIG_Proactor::block_signals (void) const { @@ -1944,7 +1968,7 @@ ACE_POSIX_SIG_Proactor::handle_events_i (const ACE_Time_Value *timeout) int ret_que = 0; if (flg_aio) - for (; ; ret_aio++) + for (;; ret_aio++) { ACE_POSIX_Asynch_Result *asynch_result = find_completed_aio (error_status, @@ -2004,6 +2028,7 @@ ACE_POSIX_Asynch_Timer::complete (size_t /* bytes_transferred */, handler->handle_time_out (this->time_, this->act ()); } + // ********************************************************************* ACE_POSIX_Wakeup_Completion::ACE_POSIX_Wakeup_Completion @@ -2042,4 +2067,3 @@ ACE_POSIX_Wakeup_Completion::complete (size_t /* bytes_transferred */, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS */ - diff --git a/dep/include/ace/POSIX_Proactor.h b/externals/ace/POSIX_Proactor.h similarity index 99% rename from dep/include/ace/POSIX_Proactor.h rename to externals/ace/POSIX_Proactor.h index da2c48eae6f..991a27515ec 100644 --- a/dep/include/ace/POSIX_Proactor.h +++ b/externals/ace/POSIX_Proactor.h @@ -73,6 +73,7 @@ public: PROACTOR_CB = 4 }; + enum SystemType // open for future extention { ACE_OS_UNDEFINED= 0x0000, @@ -335,6 +336,7 @@ class ACE_Export ACE_POSIX_AIOCB_Proactor : public ACE_POSIX_Proactor friend class ACE_POSIX_Asynch_Accept; friend class ACE_POSIX_Asynch_Connect; + public: /// Constructor defines max number asynchronous operations /// which can be started at the same time @@ -457,6 +459,7 @@ protected: /// Process the internal results queue int process_result_queue (void); + /// This class takes care of doing when we use /// AIO_CONTROL_BLOCKS strategy. ACE_AIOCB_Notify_Pipe_Manager *aiocb_notify_pipe_manager_; @@ -603,6 +606,7 @@ protected: sigset_t RT_completion_signals_; }; + #endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ /** @@ -653,4 +657,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS && ACE_HAS_POSIX_REALTIME_SIGNALS */ #endif /* ACE_POSIX_PROACTOR_H */ - diff --git a/dep/include/ace/POSIX_Proactor.inl b/externals/ace/POSIX_Proactor.inl similarity index 100% rename from dep/include/ace/POSIX_Proactor.inl rename to externals/ace/POSIX_Proactor.inl diff --git a/dep/src/ace/Pagefile_Memory_Pool.cpp b/externals/ace/Pagefile_Memory_Pool.cpp similarity index 98% rename from dep/src/ace/Pagefile_Memory_Pool.cpp rename to externals/ace/Pagefile_Memory_Pool.cpp index 37ac4016fad..e0cce5f6052 100644 --- a/dep/src/ace/Pagefile_Memory_Pool.cpp +++ b/externals/ace/Pagefile_Memory_Pool.cpp @@ -1,4 +1,4 @@ -// $Id: Pagefile_Memory_Pool.cpp 82559 2008-08-07 20:23:07Z parsons $ +// $Id: Pagefile_Memory_Pool.cpp 85318 2009-05-11 18:17:14Z johnnyw $ // Pagefile_Memory_Pool.cpp #include "ace/Pagefile_Memory_Pool.h" @@ -21,7 +21,7 @@ #include "ace/Based_Pointer_Repository.h" #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ -ACE_RCSID(ace, Pagefile_Memory_Pool, "$Id: Pagefile_Memory_Pool.cpp 82559 2008-08-07 20:23:07Z parsons $") +ACE_RCSID(ace, Pagefile_Memory_Pool, "$Id: Pagefile_Memory_Pool.cpp 85318 2009-05-11 18:17:14Z johnnyw $") #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) #if !defined (ACE_HAS_WINCE) @@ -95,6 +95,10 @@ ACE_Pagefile_Memory_Pool::ACE_Pagefile_Memory_Pool (const ACE_TCHAR *backing_sto ACE_TEXT ("_")); } +ACE_Pagefile_Memory_Pool::~ACE_Pagefile_Memory_Pool (void) +{ +} + void * ACE_Pagefile_Memory_Pool::acquire (size_t nbytes, size_t &rounded_bytes) @@ -383,4 +387,3 @@ ACE_Pagefile_Memory_Pool::map (int &first_time, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ - diff --git a/dep/include/ace/Pagefile_Memory_Pool.h b/externals/ace/Pagefile_Memory_Pool.h similarity index 97% rename from dep/include/ace/Pagefile_Memory_Pool.h rename to externals/ace/Pagefile_Memory_Pool.h index 888ca897fac..28fdfe59aaa 100644 --- a/dep/include/ace/Pagefile_Memory_Pool.h +++ b/externals/ace/Pagefile_Memory_Pool.h @@ -4,7 +4,7 @@ /** * @file Pagefile_Memory_Pool.h * - * $Id: Pagefile_Memory_Pool.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Pagefile_Memory_Pool.h 85318 2009-05-11 18:17:14Z johnnyw $ * * @author Dougls C. Schmidt * @author Prashant Jain @@ -67,6 +67,9 @@ public: ACE_Pagefile_Memory_Pool (const ACE_TCHAR *backing_store_name = 0, const OPTIONS *options = 0); + /// Destructor + virtual ~ACE_Pagefile_Memory_Pool (void); + /// Ask system for initial chunk of shared memory. void *init_acquire (size_t nbytes, size_t &rounded_bytes, @@ -199,4 +202,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_MEMORY_POOL_H */ - diff --git a/dep/include/ace/Pagefile_Memory_Pool.inl b/externals/ace/Pagefile_Memory_Pool.inl similarity index 100% rename from dep/include/ace/Pagefile_Memory_Pool.inl rename to externals/ace/Pagefile_Memory_Pool.inl diff --git a/dep/include/ace/Pair.h b/externals/ace/Pair.h similarity index 100% rename from dep/include/ace/Pair.h rename to externals/ace/Pair.h index a92767790d9..39e8575644c 100644 --- a/dep/include/ace/Pair.h +++ b/externals/ace/Pair.h @@ -12,6 +12,7 @@ */ //============================================================================= + #ifndef ACE_PAIR_H #define ACE_PAIR_H @@ -29,4 +30,3 @@ #include /**/ "ace/post.h" #endif /* ACE_PAIR_H */ - diff --git a/dep/src/ace/Pair_T.cpp b/externals/ace/Pair_T.cpp similarity index 99% rename from dep/src/ace/Pair_T.cpp rename to externals/ace/Pair_T.cpp index 64233f3baac..35e5803e6d8 100644 --- a/dep/src/ace/Pair_T.cpp +++ b/externals/ace/Pair_T.cpp @@ -14,4 +14,3 @@ #endif /* __ACE_INLINE__ */ #endif /* ACE_PAIR_T_CPP */ - diff --git a/dep/include/ace/Pair_T.h b/externals/ace/Pair_T.h similarity index 100% rename from dep/include/ace/Pair_T.h rename to externals/ace/Pair_T.h index 313446d3678..2f744ec4d0a 100644 --- a/dep/include/ace/Pair_T.h +++ b/externals/ace/Pair_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_PAIR_T_H #define ACE_PAIR_T_H #include /**/ "ace/pre.h" @@ -126,4 +127,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PAIR_T_H */ - diff --git a/dep/include/ace/Pair_T.inl b/externals/ace/Pair_T.inl similarity index 100% rename from dep/include/ace/Pair_T.inl rename to externals/ace/Pair_T.inl diff --git a/dep/src/ace/Parse_Node.cpp b/externals/ace/Parse_Node.cpp similarity index 85% rename from dep/src/ace/Parse_Node.cpp rename to externals/ace/Parse_Node.cpp index 27d74b905dd..01c286c7222 100644 --- a/dep/src/ace/Parse_Node.cpp +++ b/externals/ace/Parse_Node.cpp @@ -11,18 +11,20 @@ #include "ace/OS_NS_string.h" #include "ace/ARGV.h" +#include + ACE_RCSID (ace, Parse_Node, - "$Id: Parse_Node.cpp 81245 2008-04-05 13:37:47Z johnnyw $") + "$Id: Parse_Node.cpp 86389 2009-08-05 23:35:46Z shuston $") - ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE (ACE_Stream_Node) // Provide the class hierarchy that defines the parse tree of Service // Nodes. - void +void ACE_Stream_Node::dump (void) const { #if defined (ACE_HAS_DUMP) @@ -45,10 +47,21 @@ ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno) ACE_Stream_Type *st = dynamic_cast (const_cast (sst->type ())); - for (const ACE_Static_Node *module = dynamic_cast (this->mods_); + // The modules were linked as popped off the yacc stack, so they're in + // reverse order from the way they should be pushed onto the stream. + // So traverse mods_ and and reverse the list, then iterate over it to push + // the modules in the stream in the correct order. + std::list mod_list; + const ACE_Static_Node *module; + for (module = dynamic_cast (this->mods_); module != 0; module = dynamic_cast (module->link())) + mod_list.push_front (module); + + std::list::const_iterator iter; + for (iter = mod_list.begin (); iter != mod_list.end (); ++iter) { + module = *iter; ACE_ARGV args (module->parameters ()); const ACE_Service_Type *mst = module->record (config); @@ -57,10 +70,14 @@ ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno) if (yyerrno != 0) { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("dynamic initialization failed for Module %s\n"), - module->name ())); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("dynamic initialization failed for Module %s\n"), + module->name ())); + } ++yyerrno; + continue; // Don't try anything else with this one } ACE_Module_Type const * const mt1 = @@ -70,9 +87,12 @@ ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno) if (st->push (mt) == -1) { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("dynamic initialization failed for Stream %s\n"), - this->node_->name ())); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("dynamic initialization failed for Stream %s\n"), + this->node_->name ())); + } ++yyerrno; } @@ -134,6 +154,7 @@ ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops, ACE_TRACE ("ACE_Stream_Node::ACE_Stream_Node"); } + ACE_Stream_Node::~ACE_Stream_Node (void) { ACE_TRACE ("ACE_Stream_Node::~ACE_Stream_Node"); @@ -150,6 +171,7 @@ ACE_Parse_Node::ACE_Parse_Node (void) ACE_TRACE ("ACE_Parse_Node::ACE_Parse_Node"); } + ACE_Parse_Node::ACE_Parse_Node (const ACE_TCHAR *nm) : name_ (ACE::strnew (nm)), next_ (0) @@ -170,6 +192,7 @@ ACE_Parse_Node::print (void) const this->next_->print (); } + ACE_Parse_Node::~ACE_Parse_Node (void) { ACE_TRACE ("ACE_Parse_Node::~ACE_Parse_Node"); @@ -289,6 +312,7 @@ ACE_Remove_Node::apply (ACE_Service_Gestalt *config, int &yyerrno) #endif /* ACE_NLOGGING */ } + ACE_Dynamic_Node::ACE_Dynamic_Node (ACE_Service_Type_Factory const *stf, ACE_TCHAR *parms) : ACE_Static_Node (stf->name (), parms) @@ -392,6 +416,7 @@ ACE_Static_Node::~ACE_Static_Node (void) delete[] this->parameters_; } + ACE_ALLOC_HOOK_DEFINE (ACE_Location_Node) void @@ -459,11 +484,14 @@ ACE_Location_Node::open_dll (int & yyerrno) ++yyerrno; #ifndef ACE_NLOGGING - ACE_TCHAR *errmsg = this->dll_.error (); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) LN::open_dll - Failed to open %s: %s\n"), - this->pathname (), - errmsg ? errmsg : ACE_TEXT ("no error reported"))); + if (ACE::debug ()) + { + ACE_TCHAR *errmsg = this->dll_.error (); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ACE (%P|%t) LN::open_dll - Failed to open %s: %s\n"), + this->pathname (), + errmsg ? errmsg : ACE_TEXT ("no error reported"))); + } #endif /* ACE_NLOGGING */ return -1; @@ -515,12 +543,15 @@ ACE_Object_Node::symbol (ACE_Service_Gestalt *, ++yyerrno; #ifndef ACE_NLOGGING - ACE_TCHAR *errmsg = this->dll_.error (); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) DLL::symbol -") - ACE_TEXT (" Failed for object %s: %s\n"), - object_name, - errmsg ? errmsg : ACE_TEXT ("no error reported"))); + if (ACE::debug ()) + { + ACE_TCHAR *errmsg = this->dll_.error (); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ACE (%P|%t) DLL::symbol -") + ACE_TEXT (" Failed for object %s: %s\n"), + object_name, + errmsg ? errmsg : ACE_TEXT ("no error reported"))); + } #endif /* ACE_NLOGGING */ return 0; @@ -641,12 +672,15 @@ ACE_Function_Node::symbol (ACE_Service_Gestalt *, ++yyerrno; #ifndef ACE_NLOGGING - ACE_TCHAR * const errmsg = this->dll_.error (); - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("DLL::symbol failed for function %s: ") - ACE_TEXT ("%s\n"), - function_name, - errmsg ? errmsg : ACE_TEXT ("no error reported"))); + if (ACE::debug ()) + { + ACE_TCHAR * const errmsg = this->dll_.error (); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("DLL::symbol failed for function %s: ") + ACE_TEXT ("%s\n"), + function_name, + errmsg ? errmsg : ACE_TEXT ("no error reported"))); + } #endif /* ACE_NLOGGING */ return 0; @@ -667,10 +701,13 @@ ACE_Function_Node::symbol (ACE_Service_Gestalt *, if (this->symbol_ == 0) { ++yyerrno; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - this->function_name_), - 0); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + this->function_name_)); + } + return 0; } } return this->symbol_; @@ -760,11 +797,14 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config, if (config->find_static_svc_descriptor (this->function_name_, &ssd) == -1) { ++yyerrno; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) No static service ") - ACE_TEXT ("registered for function %s\n"), - this->function_name_), - 0); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) No static service ") + ACE_TEXT ("registered for function %s\n"), + this->function_name_)); + } + return 0; } if (ssd->alloc_ == 0) @@ -775,11 +815,14 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config, { ++yyerrno; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) No static service factory ") - ACE_TEXT ("function registered for function %s\n"), - this->function_name_), - 0); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) No static service factory ") + ACE_TEXT ("function registered for function %s\n"), + this->function_name_)); + } + return 0; } } @@ -789,10 +832,13 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config, if (this->symbol_ == 0) { ++yyerrno; - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - this->function_name_), - 0); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + this->function_name_)); + } + return 0; } return this->symbol_; @@ -817,16 +863,18 @@ ACE_Service_Type_Factory::ACE_Service_Type_Factory (ACE_TCHAR const *name, { } + ACE_Service_Type_Factory::~ACE_Service_Type_Factory (void) { } + ACE_Service_Type * ACE_Service_Type_Factory::make_service_type (ACE_Service_Gestalt *cfg) const { ACE_TRACE ("ACE_Service_Type_Factory::make_service_type"); - u_int flags = ACE_Service_Type::DELETE_THIS + u_int const flags = ACE_Service_Type::DELETE_THIS | (this->location_->dispose () == 0 ? 0 : ACE_Service_Type::DELETE_OBJ); int yyerrno = 0; @@ -856,10 +904,13 @@ ACE_Service_Type_Factory::make_service_type (ACE_Service_Gestalt *cfg) const } #ifndef ACE_NLOGGING - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE (%P|%t) Unable to create ") - ACE_TEXT ("service object for %s\n"), - this->name ())); + if (ACE::debug ()) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ACE (%P|%t) Unable to create ") + ACE_TEXT ("service object for %s\n"), + this->name ())); + } #endif ++yyerrno; return 0; @@ -871,7 +922,7 @@ ACE_Service_Type_Factory::name (void) const return name_.c_str (); } + ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_CLASSIC_SVC_CONF == 1 */ - diff --git a/dep/include/ace/Parse_Node.h b/externals/ace/Parse_Node.h similarity index 99% rename from dep/include/ace/Parse_Node.h rename to externals/ace/Parse_Node.h index eeb743e26c3..034deef3116 100644 --- a/dep/include/ace/Parse_Node.h +++ b/externals/ace/Parse_Node.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_PARSE_NODE_H #define ACE_PARSE_NODE_H @@ -193,6 +194,7 @@ private: ACE_UNIMPLEMENTED_FUNC (ACE_Static_Node& operator= (const ACE_Static_Node&)) }; + class ACE_Service_Type_Factory; /** @@ -519,4 +521,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PARSE_NODE_H */ - diff --git a/dep/src/ace/Ping_Socket.cpp b/externals/ace/Ping_Socket.cpp similarity index 95% rename from dep/src/ace/Ping_Socket.cpp rename to externals/ace/Ping_Socket.cpp index 56411a3cf5f..399d26edde8 100644 --- a/dep/src/ace/Ping_Socket.cpp +++ b/externals/ace/Ping_Socket.cpp @@ -1,4 +1,4 @@ -// $Id: Ping_Socket.cpp 81737 2008-05-20 09:46:39Z johnnyw $ +// $Id: Ping_Socket.cpp 83247 2008-10-14 22:29:45Z pollockt $ #include "ace/Ping_Socket.h" @@ -9,14 +9,16 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_sys_time.h" #include "ace/OS_NS_sys_socket.h" +# include "ace/OS_NS_unistd.h" #if !defined (__ACE_INLINE__) # include "ace/Ping_Socket.inl" #endif /* !__ACE_INLINE__ */ + ACE_RCSID (ace, Ping_Socket, - "$Id: Ping_Socket.cpp 81737 2008-05-20 09:46:39Z johnnyw $") + "$Id: Ping_Socket.cpp 83247 2008-10-14 22:29:45Z pollockt $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -80,12 +82,14 @@ struct icmp #endif /* #if ! defined (ACE_WIN32) */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL int const ICMP_MIN = 8; // Minimal size of ICMP packet, header only int const ICMP_DATA_LENGTH = 56; // For ICMP data with Echo request ACE_Time_Value const ACE_Ping_Socket::time_default_ (0, 500000); + void ACE_Ping_Socket::dump (void) const { @@ -245,14 +249,15 @@ ACE_Ping_Socket::process_incoming_dgram (char * ptr, ssize_t len) ACE_TEXT ("(%P|%t) ACE_Ping_Socket::process_incoming_dgram") ACE_TEXT (" - ICMP_ECHOREPLY received.\n"))); - if (icmp->icmp_id != getpid ()) + if (icmp->icmp_id != (ACE_OS::getpid () & 0xFFFF)) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) ACE_Ping_Socket::") ACE_TEXT ("process_incoming_dgram ") - ACE_TEXT ("- The ICMP header received is a reply") - ACE_TEXT (" to request of another process.")), + ACE_TEXT ("- The ICMP header received is a reply to request ") + ACE_TEXT ("of another process (%d; expected %d).\n"), + icmp->icmp_id, ACE_OS::getpid()), -1); } if (icmplen < 16) @@ -326,7 +331,7 @@ ACE_Ping_Socket::send_echo_check (ACE_INET_Addr &remote_addr, _icmp = (struct icmp *) this->icmp_send_buff_; _icmp->icmp_type = ICMP_ECHO; _icmp->icmp_code = 0; - _icmp->icmp_id = getpid (); + _icmp->icmp_id = ACE_OS::getpid () & 0xFFFF; _icmp->icmp_seq = sequence_number_++; #if defined (ACE_WIN32) @@ -372,4 +377,3 @@ ACE_Ping_Socket::make_echo_check (ACE_INET_Addr & remote_addr, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_ICMP_SUPPORT == 1 */ - diff --git a/dep/include/ace/Ping_Socket.h b/externals/ace/Ping_Socket.h similarity index 99% rename from dep/include/ace/Ping_Socket.h rename to externals/ace/Ping_Socket.h index 6681d013dbc..213f37fbd47 100644 --- a/dep/include/ace/Ping_Socket.h +++ b/externals/ace/Ping_Socket.h @@ -116,4 +116,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PING_SOCKET_H */ - diff --git a/dep/include/ace/Ping_Socket.inl b/externals/ace/Ping_Socket.inl similarity index 100% rename from dep/include/ace/Ping_Socket.inl rename to externals/ace/Ping_Socket.inl diff --git a/dep/src/ace/Pipe.cpp b/externals/ace/Pipe.cpp similarity index 91% rename from dep/src/ace/Pipe.cpp rename to externals/ace/Pipe.cpp index 717f72e52ea..d2b6965597a 100644 --- a/dep/src/ace/Pipe.cpp +++ b/externals/ace/Pipe.cpp @@ -1,4 +1,4 @@ -// $Id: Pipe.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Pipe.cpp 87115 2009-10-15 11:27:23Z olli $ #include "ace/Pipe.h" #include "ace/SOCK_Acceptor.h" @@ -18,7 +18,7 @@ #include "ace/Pipe.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, Pipe, "$Id: Pipe.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Pipe, "$Id: Pipe.cpp 87115 2009-10-15 11:27:23Z olli $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,8 +29,7 @@ ACE_Pipe::dump (void) const ACE_TRACE ("ACE_Pipe::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("handles_[0] = %d"), this->handles_[0])); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhandles_[1] = %d"), this->handles_[1])); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhandles_[1] = %d\n"), this->handles_[1])); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } @@ -40,7 +39,7 @@ ACE_Pipe::open (int buffer_size) { ACE_TRACE ("ACE_Pipe::open"); -#if defined (ACE_LACKS_SOCKETPAIR) || defined (__Lynx__) +#if defined (ACE_LACKS_SOCKETPAIR) ACE_INET_Addr my_addr; ACE_SOCK_Acceptor acceptor; ACE_SOCK_Connector connector; @@ -97,9 +96,10 @@ ACE_Pipe::open (int buffer_size) } # endif /* ! ACE_LACKS_TCP_NODELAY */ -# if defined (ACE_LACKS_SOCKET_BUFSIZ) +# if defined (ACE_LACKS_SO_RCVBUF) && defined (ACE_LACKS_SO_SNDBUF) ACE_UNUSED_ARG (buffer_size); -# else /* ! ACE_LACKS_SOCKET_BUFSIZ */ +# endif +# if !defined (ACE_LACKS_SO_RCVBUF) if (reader.set_option (SOL_SOCKET, SO_RCVBUF, reinterpret_cast (&buffer_size), @@ -109,16 +109,18 @@ ACE_Pipe::open (int buffer_size) this->close (); return -1; } - else if (writer.set_option (SOL_SOCKET, - SO_SNDBUF, - reinterpret_cast (&buffer_size), - sizeof (buffer_size)) == -1 +# endif /* !ACE_LACKS_SO_RCVBUF */ +# if !defined (ACE_LACKS_SO_SNDBUF) + if (writer.set_option (SOL_SOCKET, + SO_SNDBUF, + reinterpret_cast (&buffer_size), + sizeof (buffer_size)) == -1 && errno != ENOTSUP) { this->close (); return -1; } -# endif /* ! ACE_LACKS_SOCKET_BUFSIZ */ +# endif /* !ACE_LACKS_SO_SNDBUF */ #elif defined (ACE_HAS_STREAM_PIPES) || defined (__QNX__) ACE_UNUSED_ARG (buffer_size); @@ -156,9 +158,10 @@ ACE_Pipe::open (int buffer_size) ACE_TEXT ("%p\n"), ACE_TEXT ("socketpair")), -1); -# if defined (ACE_LACKS_SOCKET_BUFSIZ) +# if defined (ACE_LACKS_SO_SNDBUF) && defined (ACE_LACKS_SO_RCVBUF) ACE_UNUSED_ARG (buffer_size); -# else /* ! ACE_LACKS_SOCKET_BUFSIZ */ +# endif +# if !defined (ACE_LACKS_SO_RCVBUF) if (ACE_OS::setsockopt (this->handles_[0], SOL_SOCKET, SO_RCVBUF, @@ -169,6 +172,8 @@ ACE_Pipe::open (int buffer_size) this->close (); return -1; } +# endif +# if !defined (ACE_LACKS_SO_SNDBUF) if (ACE_OS::setsockopt (this->handles_[1], SOL_SOCKET, SO_SNDBUF, @@ -179,7 +184,7 @@ ACE_Pipe::open (int buffer_size) this->close (); return -1; } -# endif /* ! ACE_LACKS_SOCKET_BUFSIZ */ +# endif /* ! ACE_LACKS_SO_SNDBUF */ # if defined (ACE_OPENVMS) && !defined (ACE_LACKS_TCP_NODELAY) int one = 1; // OpenVMS implements socketpair(AF_UNIX...) by returning AF_INET sockets. @@ -358,4 +363,3 @@ ACE_Pipe::recv (size_t n, ...) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Pipe.h b/externals/ace/Pipe.h similarity index 97% rename from dep/include/ace/Pipe.h rename to externals/ace/Pipe.h index 0dd37ed14d0..b831769da78 100644 --- a/dep/include/ace/Pipe.h +++ b/externals/ace/Pipe.h @@ -4,7 +4,7 @@ /** * @file Pipe.h * - * $Id: Pipe.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Pipe.h 87240 2009-10-27 15:54:10Z schmidt $ * * @author Douglas C. Schmidt */ @@ -122,7 +122,7 @@ public: * This is an interface to ::readv, that doesn't use the struct * iovec explicitly. The ... can be passed as an arbitrary number * of (char *ptr, int len) tuples. However, the count N is the - * *total* number of trailing arguments, *not* a couple of the + * *total* number of trailing arguments, *not* a count of the * number of tuple pairs! */ ssize_t recv (size_t n, ...) const; @@ -163,4 +163,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PIPE_H */ - diff --git a/dep/include/ace/Pipe.inl b/externals/ace/Pipe.inl similarity index 100% rename from dep/include/ace/Pipe.inl rename to externals/ace/Pipe.inl diff --git a/externals/ace/PrecompiledHeaders/WinAcePCH.cpp b/externals/ace/PrecompiledHeaders/WinAcePCH.cpp new file mode 100644 index 00000000000..139597f9cb0 --- /dev/null +++ b/externals/ace/PrecompiledHeaders/WinAcePCH.cpp @@ -0,0 +1,2 @@ + + diff --git a/externals/ace/PrecompiledHeaders/WinAcePCH.h b/externals/ace/PrecompiledHeaders/WinAcePCH.h new file mode 100644 index 00000000000..6ff97bfcf15 --- /dev/null +++ b/externals/ace/PrecompiledHeaders/WinAcePCH.h @@ -0,0 +1,17 @@ + +#ifndef WIN_ACE_PCH +#define WIN_ACE_PCH + +#include "ace/ACE.h" + +#include "ace/Synch_Traits.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Stream.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/Acceptor.h" +#include "ace/Thread_Mutex.h" +#include "ace/Guard_T.h" +#include "ace/Unbounded_Queue.h" +#include "ace/Message_Block.h" + +#endif diff --git a/dep/src/ace/Priority_Reactor.cpp b/externals/ace/Priority_Reactor.cpp similarity index 95% rename from dep/src/ace/Priority_Reactor.cpp rename to externals/ace/Priority_Reactor.cpp index 10a3a80567e..9929b477c29 100644 --- a/dep/src/ace/Priority_Reactor.cpp +++ b/externals/ace/Priority_Reactor.cpp @@ -1,9 +1,9 @@ -// $Id: Priority_Reactor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Priority_Reactor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/Priority_Reactor.h" #include "ace/Malloc_T.h" -ACE_RCSID(ace, Priority_Reactor, "$Id: Priority_Reactor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Priority_Reactor, "$Id: Priority_Reactor.cpp 82723 2008-09-16 09:35:44Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -51,10 +51,10 @@ ACE_Priority_Reactor::ACE_Priority_Reactor (ACE_Sig_Handler *sh, } ACE_Priority_Reactor::ACE_Priority_Reactor (size_t size, - int rs, + bool restart, ACE_Sig_Handler *sh, ACE_Timer_Queue *tq) - : ACE_Select_Reactor (size, rs, sh, tq), + : ACE_Select_Reactor (size, restart, sh, tq), bucket_ (0), tuple_allocator_ (0) { @@ -186,4 +186,3 @@ ACE_Priority_Reactor::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Priority_Reactor.h b/externals/ace/Priority_Reactor.h similarity index 96% rename from dep/include/ace/Priority_Reactor.h rename to externals/ace/Priority_Reactor.h index bdca70ece7a..2f29c4c079d 100644 --- a/dep/include/ace/Priority_Reactor.h +++ b/externals/ace/Priority_Reactor.h @@ -4,7 +4,7 @@ /** * @file Priority_Reactor.h * - * $Id: Priority_Reactor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Priority_Reactor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Carlos O'Ryan */ @@ -45,7 +45,7 @@ public: /// Initialize ACE_Priority_Reactor with size @a size. ACE_Priority_Reactor (size_t size, - int restart = 0, + bool restart = false, ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0); @@ -98,4 +98,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PRIORITY_REACTOR_H */ - diff --git a/dep/src/ace/Proactor.cpp b/externals/ace/Proactor.cpp similarity index 99% rename from dep/src/ace/Proactor.cpp rename to externals/ace/Proactor.cpp index a5e298dde54..f7771aec114 100644 --- a/dep/src/ace/Proactor.cpp +++ b/externals/ace/Proactor.cpp @@ -16,10 +16,12 @@ # include "ace/Service_Config.h" #endif /* !ACE_HAS_WINCE && !ACE_LACKS_ACE_SVCCONF */ + ACE_RCSID (ace, Proactor, "$Id: Proactor.cpp 81535 2008-04-29 20:08:52Z shuston $") + #include "ace/Task_T.h" #include "ace/Log_Msg.h" #include "ace/Framework_Component.h" @@ -813,6 +815,7 @@ ACE_Proactor::implementation (void) const return this->implementation_; } + ACE_Asynch_Read_Stream_Impl * ACE_Proactor::create_asynch_read_stream (void) { @@ -889,6 +892,7 @@ ACE_Proactor::create_asynch_read_stream_result signal_number); } + ACE_Asynch_Write_Stream_Result_Impl * ACE_Proactor::create_asynch_write_stream_result (ACE_Handler::Proxy_Ptr &handler_proxy, @@ -1170,4 +1174,3 @@ ACE_Proactor::event_loop_done (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ - diff --git a/dep/include/ace/Proactor.h b/externals/ace/Proactor.h similarity index 99% rename from dep/include/ace/Proactor.h rename to externals/ace/Proactor.h index 17afb7ecd3f..6b3f34f358f 100644 --- a/dep/include/ace/Proactor.h +++ b/externals/ace/Proactor.h @@ -297,6 +297,7 @@ public: /// method can be restarted. int proactor_reset_event_loop (void); + /// This method adds the @a handle to the I/O completion port. This /// function is a no-op function for Unix systems and returns 0; int register_handle (ACE_HANDLE handle, @@ -627,6 +628,7 @@ protected: /// Mutex to protect work with lists. ACE_SYNCH_MUTEX mutex_; + private: /// Deny access since member-wise won't work... ACE_Proactor (const ACE_Proactor &); @@ -687,4 +689,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PROACTOR_H */ - diff --git a/dep/include/ace/Proactor.inl b/externals/ace/Proactor.inl similarity index 100% rename from dep/include/ace/Proactor.inl rename to externals/ace/Proactor.inl diff --git a/dep/src/ace/Proactor_Impl.cpp b/externals/ace/Proactor_Impl.cpp similarity index 99% rename from dep/src/ace/Proactor_Impl.cpp rename to externals/ace/Proactor_Impl.cpp index 8a7d9b8e6e0..3375540d946 100644 --- a/dep/src/ace/Proactor_Impl.cpp +++ b/externals/ace/Proactor_Impl.cpp @@ -19,4 +19,3 @@ ACE_Proactor_Impl::~ACE_Proactor_Impl (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif - diff --git a/dep/include/ace/Proactor_Impl.h b/externals/ace/Proactor_Impl.h similarity index 100% rename from dep/include/ace/Proactor_Impl.h rename to externals/ace/Proactor_Impl.h index b93606f443e..9668206b2e7 100644 --- a/dep/include/ace/Proactor_Impl.h +++ b/externals/ace/Proactor_Impl.h @@ -11,6 +11,7 @@ */ //============================================================================= + #ifndef ACE_PROACTOR_IMPL_H #define ACE_PROACTOR_IMPL_H #include /**/ "ace/pre.h" @@ -262,4 +263,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ #include /**/ "ace/post.h" #endif /* ACE_PROACTOR_IMPL_H */ - diff --git a/dep/src/ace/Process.cpp b/externals/ace/Process.cpp similarity index 94% rename from dep/src/ace/Process.cpp rename to externals/ace/Process.cpp index 059d57bbbb5..df81864dfe5 100644 --- a/dep/src/ace/Process.cpp +++ b/externals/ace/Process.cpp @@ -1,4 +1,4 @@ -// $Id: Process.cpp 82499 2008-08-04 20:01:17Z shuston $ +// $Id: Process.cpp 87826 2009-11-30 14:02:40Z johnnyw $ #include "ace/Process.h" @@ -17,17 +17,19 @@ #include "ace/OS_NS_errno.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_fcntl.h" #include "ace/OS_Memory.h" #include "ace/Countdown_Time.h" #include "ace/Truncate.h" #include "ace/Vector_T.h" +#include "ace/Tokenizer_T.h" #if defined (ACE_VXWORKS) && (ACE_VXWORKS > 0x600) && defined (__RTP__) # include # include #endif -ACE_RCSID (ace, Process, "$Id: Process.cpp 82499 2008-08-04 20:01:17Z shuston $") +ACE_RCSID (ace, Process, "$Id: Process.cpp 87826 2009-11-30 14:02:40Z johnnyw $") // This function acts as a signal handler for SIGCHLD. We don't really want // to do anything with the signal - it's just needed to interrupt a sleep. @@ -40,6 +42,7 @@ sigchld_nop (int, siginfo_t *, ucontext_t *) } #endif /* ACE_WIN32 */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Process::ACE_Process (void) @@ -136,13 +139,12 @@ ACE_Process::spawn (ACE_Process_Options &options) // like other OS environment. Therefore, it is user's whole responsibility to call // 'ACE_Process_Options::process_name(const ACE_TCHAR *name)' to set the proper // process name (the execution file name with path if needed). - BOOL fork_result = ACE_TEXT_CreateProcess (options.process_name(), options.command_line_buf(), options.get_process_attributes(), // must be NULL in CE options.get_thread_attributes(), // must be NULL in CE - options.handle_inheritence(), // must be false in CE + options.handle_inheritance(), // must be false in CE options.creation_flags(), // must be NULL in CE options.env_buf(), // environment variables, must be NULL in CE options.working_directory(), // must be NULL in CE @@ -174,7 +176,7 @@ ACE_Process::spawn (ACE_Process_Options &options) options.command_line_buf (), options.get_process_attributes (), options.get_thread_attributes (), - options.handle_inheritence (), + options.handle_inheritance (), flags, env_buf, // environment variables options.working_directory (), @@ -453,6 +455,16 @@ ACE_Process::spawn (ACE_Process_Options &options) ACE_OS::close (options.get_stdin ()); ACE_OS::close (options.get_stdout ()); ACE_OS::close (options.get_stderr ()); + if (!options.handle_inheritance ()) + { + // Set close-on-exec for all FDs except standard handles + for (int i = ACE::max_handles () - 1; i >= 0; i--) + { + if (i == ACE_STDIN || i == ACE_STDOUT || i == ACE_STDERR) + continue; + ACE_OS::fcntl (i, F_SETFD, FD_CLOEXEC); + } + } // If we must, set the working directory for the child // process. @@ -782,9 +794,9 @@ ACE_Process::convert_env_buffer (const char* env) const #endif ACE_Process_Options::ACE_Process_Options (bool inherit_environment, - int command_line_buf_len, - int env_buf_len, - int max_env_args) + size_t command_line_buf_len, + size_t env_buf_len, + size_t max_env_args) : #if !defined (ACE_HAS_WINCE) inherit_environment_ (inherit_environment), @@ -794,7 +806,6 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment, #if !defined (ACE_HAS_WINCE) #if defined (ACE_WIN32) environment_inherited_ (0), - handle_inheritence_ (TRUE), process_attributes_ (0), thread_attributes_ (0), #else /* ACE_WIN32 */ @@ -806,6 +817,7 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment, rgid_ ((uid_t) -1), egid_ ((uid_t) -1), #endif /* ACE_WIN32 */ + handle_inheritance_ (true), set_handles_called_ (0), environment_buf_index_ (0), environment_argv_index_ (0), @@ -814,7 +826,7 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment, max_environment_args_ (max_env_args), max_environ_argv_index_ (max_env_args - 1), #endif /* !ACE_HAS_WINCE */ - command_line_argv_calculated_ (0), + command_line_argv_calculated_ (false), command_line_buf_ (0), command_line_copy_ (0), command_line_buf_len_ (command_line_buf_len), @@ -824,6 +836,13 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment, ACE_NEW (command_line_buf_, ACE_TCHAR[command_line_buf_len]); command_line_buf_[0] = '\0'; + process_name_[0] = '\0'; + +#if defined (ACE_HAS_WINCE) + ACE_UNUSED_ARG(inherit_environment); + ACE_UNUSED_ARG(env_buf_len); + ACE_UNUSED_ARG(max_env_args); +#endif #if !defined (ACE_HAS_WINCE) working_directory_[0] = '\0'; @@ -833,7 +852,6 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment, ACE_TCHAR *[max_env_args]); environment_buf_[0] = '\0'; environment_argv_[0] = 0; - process_name_[0] = '\0'; #if defined (ACE_WIN32) ACE_OS::memset ((void *) &this->startup_info_, 0, @@ -914,24 +932,6 @@ ACE_Process_Options::env_argv (void) #endif /* ACE_WIN32 */ -void -ACE_Process_Options::enable_unicode_environment (void) -{ - this->use_unicode_environment_ = true; -} - -void -ACE_Process_Options::disable_unicode_environment (void) -{ - this->use_unicode_environment_ = false; -} - -bool -ACE_Process_Options::use_unicode_environment (void) const -{ - return this->use_unicode_environment_; -} - int ACE_Process_Options::setenv (ACE_TCHAR *envp[]) { @@ -1003,8 +1003,11 @@ ACE_Process_Options::setenv (const ACE_TCHAR *variable_name, va_start (argp, format); // Add the rest of the varargs. - size_t tmp_buflen = DEFAULT_COMMAND_LINE_BUF_LEN > buflen - ? static_cast (DEFAULT_COMMAND_LINE_BUF_LEN) : buflen; + size_t tmp_buflen = buflen; + if (DEFAULT_COMMAND_LINE_BUF_LEN > buflen) + { + tmp_buflen = DEFAULT_COMMAND_LINE_BUF_LEN; + } int retval = 0; ACE_TCHAR *stack_buf = 0; @@ -1145,6 +1148,7 @@ ACE_Process_Options::set_handles (ACE_HANDLE std_in, return 0; // Success. } + void ACE_Process_Options::release_handles () { @@ -1164,6 +1168,7 @@ ACE_Process_Options::release_handles () } #endif /* !ACE_HAS_WINCE */ + ACE_Process_Options::~ACE_Process_Options (void) { #if !defined (ACE_HAS_WINCE) @@ -1178,22 +1183,37 @@ ACE_Process_Options::~ACE_Process_Options (void) int ACE_Process_Options::command_line (const ACE_TCHAR *const argv[]) { - // @@ Factor out the code between this int i = 0; if (argv[i]) { ACE_OS::strcat (command_line_buf_, argv[i]); + while (argv[++i]) { - ACE_OS::strcat (command_line_buf_, - ACE_TEXT (" ")); - ACE_OS::strcat (command_line_buf_, - argv[i]); + // Check to see if the next argument will overflow the + // command_line buffer. + size_t const cur_len = + ACE_OS::strlen (command_line_buf_) + + ACE_OS::strlen (argv[i]) + + 2; + + if (cur_len > command_line_buf_len_) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("ACE_Process:command_line: ") + ACE_TEXT ("command line is ") + ACE_TEXT ("longer than %d\n"), + command_line_buf_len_), + 1); + } + + ACE_OS::strcat (command_line_buf_, ACE_TEXT (" ")); + ACE_OS::strcat (command_line_buf_, argv[i]); } } - command_line_argv_calculated_ = 0; + command_line_argv_calculated_ = false; return 0; // Success. } @@ -1223,7 +1243,7 @@ ACE_Process_Options::command_line (const ACE_TCHAR *format, ...) // Useless macro. va_end (argp); - command_line_argv_calculated_ = 0; + command_line_argv_calculated_ = false; return 0; } @@ -1235,7 +1255,7 @@ ACE_Process_Options::command_line (const ACE_TCHAR *format, ...) int ACE_Process_Options::command_line (const ACE_ANTI_TCHAR *format, ...) { - ACE_ANTI_TCHAR *anti_clb; + ACE_ANTI_TCHAR *anti_clb = 0; ACE_NEW_RETURN (anti_clb, ACE_ANTI_TCHAR[this->command_line_buf_len_], -1); @@ -1257,7 +1277,7 @@ ACE_Process_Options::command_line (const ACE_ANTI_TCHAR *format, ...) delete [] anti_clb; - command_line_argv_calculated_ = 0; + command_line_argv_calculated_ = false; return 0; } #endif /* ACE_HAS_WCHAR && !ACE_HAS_WINCE */ @@ -1278,9 +1298,9 @@ ACE_Process_Options::env_buf (void) ACE_TCHAR * const * ACE_Process_Options::command_line_argv (void) { - if (command_line_argv_calculated_ == 0) + if (!command_line_argv_calculated_) { - command_line_argv_calculated_ = 1; + command_line_argv_calculated_ = true; // We need to free up any previous allocated memory first. ACE::strdelete (command_line_copy_); @@ -1386,4 +1406,3 @@ ACE_Managed_Process::unmanage (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Process.h b/externals/ace/Process.h similarity index 95% rename from dep/include/ace/Process.h rename to externals/ace/Process.h index 6f83dc3bb1c..16325b9308e 100644 --- a/dep/include/ace/Process.h +++ b/externals/ace/Process.h @@ -4,7 +4,7 @@ /** * @file Process.h * - * $Id: Process.h 82233 2008-07-01 22:49:26Z shuston $ + * $Id: Process.h 87826 2009-11-30 14:02:40Z johnnyw $ * * @author Tim Harrison */ @@ -82,9 +82,9 @@ public: * max strlen for command-line arguments. */ ACE_Process_Options (bool inherit_environment = true, - int command_line_buf_len = DEFAULT_COMMAND_LINE_BUF_LEN, - int env_buf_len = ENVIRONMENT_BUFFER, - int max_env_args = MAX_ENVIRONMENT_ARGS); + size_t command_line_buf_len = DEFAULT_COMMAND_LINE_BUF_LEN, + size_t env_buf_len = ENVIRONMENT_BUFFER, + size_t max_env_args = MAX_ENVIRONMENT_ARGS); /// Destructor. ~ACE_Process_Options (void); @@ -113,7 +113,7 @@ public: * Set a single environment variable, @a variable_name. Since * different platforms separate each environment variable * differently, you must call this method once for each variable. - * can be any printf format string. So options->setenv + * @a format can be any printf format string. So options->setenv * ("FOO","one + two = %s", "three") will result in "FOO=one + two = * three". */ @@ -220,9 +220,9 @@ public: /// ACE_Process_Manager to manage groups of processes. pid_t setgroup (pid_t pgrp); - /// Allows disabling of handle inheritence, default is TRUE. - int handle_inheritence (void); - void handle_inheritence (int); + /// Allows disabling of handle inheritance, default is TRUE. + int handle_inheritance (void); + void handle_inheritance (int); /// Cause the specified handle to be passed to a child process /// when it runs a new program image. @@ -351,9 +351,6 @@ protected: ACE_TEXT_STARTUPINFO startup_info_; - /// Default TRUE. - BOOL handle_inheritence_; - /// Pointer to security_buf1_. LPSECURITY_ATTRIBUTES process_attributes_; @@ -379,6 +376,9 @@ protected: uid_t egid_; #endif /* ACE_WIN32 */ + /// Default true. + bool handle_inheritance_; + #if !defined (ACE_HAS_WINCE) /// Is 1 if stdhandles was called. int set_handles_called_; @@ -388,7 +388,7 @@ protected: size_t environment_buf_index_; /// Pointer to environment_argv_. - int environment_argv_index_; + size_t environment_argv_index_; /// Pointer to buffer of the environment settings. ACE_TCHAR *environment_buf_; @@ -400,17 +400,17 @@ protected: ACE_TCHAR **environment_argv_; /// Maximum number of environment variables. Configurable - int max_environment_args_; + size_t max_environment_args_; /// Maximum index of environment_argv_ buffer - int max_environ_argv_index_; + size_t max_environ_argv_index_; /// The current working directory. ACE_TCHAR working_directory_[MAXPATHLEN + 1]; #endif /* !ACE_HAS_WINCE */ /// Ensures command_line_argv is only calculated once. - int command_line_argv_calculated_; + bool command_line_argv_calculated_; /// Pointer to buffer of command-line arguments. E.g., "-f foo -b bar". ACE_TCHAR *command_line_buf_; @@ -420,7 +420,7 @@ protected: ACE_TCHAR *command_line_copy_; /// Max length of command_line_buf_ - int command_line_buf_len_; + size_t command_line_buf_len_; /// Argv-style command-line arguments. ACE_TCHAR *command_line_argv_[MAX_COMMAND_LINE_OPTIONS]; @@ -495,14 +495,14 @@ public: */ virtual void child (pid_t parent); - /// Called by a that is removing this Process from + /// Called by a Process_Manager that is removing this Process from /// its table of managed Processes. Default is to do nothing. virtual void unmanage (void); /** - * Wait for the process we've created to exit. If != 0, it + * Wait for the process we've created to exit. If @a status != 0, it * points to an integer where the function store the exit status of - * child process to. If == then return 0 + * child process to. If @a wait_options == @c WNOHANG then return 0 * and don't block if the child process hasn't exited yet. A return * value of -1 represents the operation failed, otherwise, * the child process id is returned. @@ -514,7 +514,7 @@ public: * Timed wait for the process we've created to exit. A return value * of -1 indicates that the something failed; 0 indicates that a * timeout occurred. Otherwise, the child's process id is returned. - * If != 0, it points to an integer where the function + * If @a status != 0, it points to an integer where the function * stores the child's exit status. * * @note On UNIX platforms this function uses , i.e., it @@ -531,7 +531,7 @@ public: int kill (int signum = SIGINT); /** - * Terminate the process abruptly using . + * Terminate the process abruptly using ACE::terminate_process(). * This call doesn't give the process a chance to cleanup, so use it * with caution... */ @@ -591,6 +591,7 @@ protected: /// Set of handles that were passed to the child process. ACE_Handle_Set handles_passed_; + /// Handle duplicates made for the child process. ACE_Handle_Set dup_handles_; @@ -632,4 +633,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PROCESS_H */ - diff --git a/dep/include/ace/Process.inl b/externals/ace/Process.inl similarity index 92% rename from dep/include/ace/Process.inl rename to externals/ace/Process.inl index 9723ebc8c44..8b68efc0c68 100644 --- a/dep/include/ace/Process.inl +++ b/externals/ace/Process.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Process.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Process.inl 83405 2008-10-23 06:30:06Z johnnyw $ #include "ace/ACE.h" #include "ace/OS_NS_sys_wait.h" @@ -10,6 +10,24 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL +ACE_INLINE void +ACE_Process_Options::enable_unicode_environment (void) +{ + this->use_unicode_environment_ = true; +} + +ACE_INLINE void +ACE_Process_Options::disable_unicode_environment (void) +{ + this->use_unicode_environment_ = false; +} + +ACE_INLINE bool +ACE_Process_Options::use_unicode_environment (void) const +{ + return this->use_unicode_environment_; +} + #if defined (ACE_WIN32) ACE_INLINE PROCESS_INFORMATION @@ -129,24 +147,15 @@ ACE_Process_Options::setgroup (pid_t pgrp) } ACE_INLINE int -ACE_Process_Options::handle_inheritence (void) +ACE_Process_Options::handle_inheritance (void) { -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) - return handle_inheritence_; -#else - ACE_NOTSUP_RETURN (0); // This is a benign error. -#endif /* ACE_WIN32 && ! ACE_HAS_WINCE */ + return handle_inheritance_; } ACE_INLINE void -ACE_Process_Options::handle_inheritence (int hi) +ACE_Process_Options::handle_inheritance (int hi) { -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) - handle_inheritence_ = hi; -#else - ACE_UNUSED_ARG (hi); - ACE_NOTSUP; -#endif /* !ACE_HAS_WINCE */ + handle_inheritance_ = hi; } ACE_INLINE int diff --git a/dep/src/ace/Process_Manager.cpp b/externals/ace/Process_Manager.cpp similarity index 96% rename from dep/src/ace/Process_Manager.cpp rename to externals/ace/Process_Manager.cpp index cf9b1e4b2c6..0c512d76a3b 100644 --- a/dep/src/ace/Process_Manager.cpp +++ b/externals/ace/Process_Manager.cpp @@ -1,4 +1,4 @@ -// $Id: Process_Manager.cpp 82559 2008-08-07 20:23:07Z parsons $ +// $Id: Process_Manager.cpp 89454 2010-03-11 09:35:25Z johnnyw $ // Process_Manager.cpp #include "ace/Process_Manager.h" @@ -19,11 +19,12 @@ #include "ace/OS_NS_signal.h" #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_time.h" +#include "ace/os_include/os_typeinfo.h" #include "ace/Truncate.h" ACE_RCSID (ace, Process_Manager, - "$Id: Process_Manager.cpp 82559 2008-08-07 20:23:07Z parsons $") + "$Id: Process_Manager.cpp 89454 2010-03-11 09:35:25Z johnnyw $") #if defined (ACE_HAS_SIG_C_FUNC) extern "C" void @@ -52,6 +53,7 @@ sigchld_nop (int, siginfo_t *, ucontext_t *) } #endif /* ACE_WIN32 */ + ACE_ALLOC_HOOK_DEFINE(ACE_Process_Manager) // Singleton instance. @@ -130,11 +132,13 @@ ACE_Process_Manager::instance (void) #if defined ACE_HAS_SIG_C_FUNC ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager_cleanup, - 0); + 0, + typeid (*ACE_Process_Manager::instance_).name ()); #else ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager::cleanup, - 0); + 0, + typeid (*ACE_Process_Manager::instance_).name ()); #endif /* ACE_HAS_SIG_C_FUNC */ } @@ -161,11 +165,13 @@ ACE_Process_Manager::instance (ACE_Process_Manager *tm) #if defined ACE_HAS_SIG_C_FUNC ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager_cleanup, - 0); + 0, + typeid (*ACE_Process_Manager::instance_).name ()); #else ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager::cleanup, - 0); + 0, + typeid (*ACE_Process_Manager::instance_).name ()); #endif /* ACE_HAS_SIG_C_FUNC */ ACE_Process_Manager::instance_ = tm; @@ -255,11 +261,12 @@ ACE_Process_Manager::ACE_Process_Manager (size_t size, { ACE_TRACE ("ACE_Process_Manager::ACE_Process_Manager"); - if (this->open (size, - r) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("ACE_Process_Manager"))); + if (this->open (size, r) == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("ACE_Process_Manager"))); + } } // Close up and release all resources. @@ -426,7 +433,7 @@ ACE_Process_Manager::spawn (ACE_Process_Options &options, ACE_Managed_Process, ACE_INVALID_PID); - pid_t const pid = spawn (process, options, event_handler); + pid_t const pid = this->spawn (process, options, event_handler); if (pid == ACE_INVALID_PID || pid == 0) delete process; @@ -639,6 +646,7 @@ ACE_Process_Manager::terminate (pid_t pid, int sig) return ACE_OS::kill (pid, sig); } + int ACE_Process_Manager::set_scheduler (const ACE_Sched_Params & params, pid_t pid) @@ -839,7 +847,7 @@ ACE_Process_Manager::wait (pid_t pid, // WAIT_OBJECT_0 is a pointless comparison because // WAIT_OBJECT_0 is zero and DWORD is unsigned long, so this // test is skipped for Green Hills. Same for mingw. -# if defined (ghs) || defined (__MINGW32__) || (defined (_MSC_VER) && _MSC_VER >= 1300) +# if defined (ghs) || defined (__MINGW32__) || defined (_MSC_VER) ACE_ASSERT (result < WAIT_OBJECT_0 + this->current_count_); # else ACE_ASSERT (result >= WAIT_OBJECT_0 @@ -1019,4 +1027,3 @@ ACE_Process_Manager::notify_proc_handler (size_t i, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Process_Manager.h b/externals/ace/Process_Manager.h similarity index 98% rename from dep/include/ace/Process_Manager.h rename to externals/ace/Process_Manager.h index 53b5ad7d55b..26515476cfc 100644 --- a/dep/include/ace/Process_Manager.h +++ b/externals/ace/Process_Manager.h @@ -4,7 +4,7 @@ /** * @file Process_Manager.h * - * $Id: Process_Manager.h 81014 2008-03-19 11:41:31Z johnnyw $ + * $Id: Process_Manager.h 84619 2009-02-26 12:26:16Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -337,9 +337,9 @@ public: //@} protected: - // = These methods allow a to be an . + // = These methods allow a to be an Event_Handler. - // As an , the automagically + // As an Event_Handler, the automagically // detects child Processes exiting and calls notify_proc_handler() // and remove(). This means that you don't have to (shouldn't!) // call the wait(...) methods yourself. @@ -475,4 +475,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PROCESS_MANAGER_H */ - diff --git a/dep/include/ace/Process_Manager.inl b/externals/ace/Process_Manager.inl similarity index 100% rename from dep/include/ace/Process_Manager.inl rename to externals/ace/Process_Manager.inl diff --git a/dep/src/ace/Process_Mutex.cpp b/externals/ace/Process_Mutex.cpp similarity index 99% rename from dep/src/ace/Process_Mutex.cpp rename to externals/ace/Process_Mutex.cpp index fb86e8af00a..95d6529d933 100644 --- a/dep/src/ace/Process_Mutex.cpp +++ b/externals/ace/Process_Mutex.cpp @@ -88,4 +88,3 @@ ACE_Process_Mutex::~ACE_Process_Mutex (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Process_Mutex.h b/externals/ace/Process_Mutex.h similarity index 72% rename from dep/include/ace/Process_Mutex.h rename to externals/ace/Process_Mutex.h index 8f23211a378..476676e6c98 100644 --- a/dep/include/ace/Process_Mutex.h +++ b/externals/ace/Process_Mutex.h @@ -4,7 +4,7 @@ /** * @file Process_Mutex.h * - * $Id: Process_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Process_Mutex.h 87179 2009-10-20 16:27:01Z shuston $ * * A wrapper for mutexes that can be used across processes on the * same host machine, as well as within a process, of course. @@ -46,36 +46,48 @@ class ACE_Time_Value; * @class ACE_Process_Mutex * * @brief A wrapper for mutexes that can be used across processes on - * the same host machine, as well as within a process, of - * course. + * the same host machine, as well as within a process, of course. * * @attention The mechanism upon which @c ACE_Process_Mutex is based * can be configured at build time to be either @c ACE_SV_Semaphore_Complex - * (on platforms that support it) or @c ACE_Mutex. On platforms that - * require interprocess mutexes be allocated from shared memory (Pthreads - * and UI Threads are examples), @c ACE_SV_Semaphore_Complex provides a - * more reliable mechanism for implementing inter-process mutex than - * @c ACE_Mutex. However, at least on some platforms, - * @c ACE_SV_Semaphore_Complex is limited to a small number of - * objects by the underlying System V IPC kernel parameters. If you - * want to force use of @c ACE_Mutex as the underlying mechanism, set - * @c ACE_USES_MUTEX_FOR_PROCESS_MUTEX in your @c config.h file. - * Also, if you require the ability to do a timed @c acquire(), you must - * set @c ACE_USES_MUTEX_FOR_PROCESS_MUTEX, as timed acquire does not - * work with System V semaphores. - * @attention Currently there is also the operational difference between - * pthreads and semaphores based @c. For semaphore base @c the semaphore - * is destroyed after the last instance of @c in OS. In contrary, pthread based - * @c is destroyed when the owner, namely the process which created the - * first instance of @c destroys the mutex. For protable applications it is better - * to always ensure that the owner of the mutex destroys it after the - * other processes. + * (on platforms that support it) or @c ACE_Mutex. On platforms that offer + * System V IPC (the @c ACE_HAS_SYSV_IPC config macro is defined) + * @c ACE_SV_Semaphore_Complex is the default because it is more convenient + * and easy to use. @c ACE_Mutex is the default on all other platforms. + * On platforms where ACE_SV_Semaphore_Complex is used by default, the + * mechanism can be changed to ACE_Mutex when ACE is built by adding + * @code + * #define ACE_USES_MUTEX_FOR_PROCESS_MUTEX + * @endcode + * to your @c config.h file. + * @par + * Consider these tradeoffs when evaluating whether or not to change + * the default: + * - Some platforms (e.g., Pthreads and UI Threads) require interprocess + * mutexes to be allocated from shared memory. On these platforms, using + * ACE_Mutex as the underlying mechanism requires that ACE_Process_Mutex + * objects be allocated in shared memory. Using ACE_SV_Semaphore_Complex + * avoids this restriction. + * - System V IPC kernel parameters have a low default limit on some + * platforms. This would restrict the number of ACE_Process_Mutex objects + * that can be in use simultaneously when using ACE_SV_Semaphore_Complex. + * - If you require the ability to do a timed @c acquire(), you must + * use ACE_Mutex as the underlying mechanism because timed acquire does not + * work with System V semaphores. + * - When using ACE_Mutex on a Pthreads-based platform, an ACE_Process_Mutex + * object is deleted when the process which created the object destroys + * it, regardless of whether or not there are other processes still + * accessing the ACE_Process_Mutex. Using ACE_SV_Semaphore_Complex avoids + * this problem; the semaphore is destroyed when the last use of the + * object ends. For portable applications it is better to always ensure + * that the owner of the mutex destroys it after all other processes have + * stopped using it. */ class ACE_Export ACE_Process_Mutex { public: /** - * Create a Process_Mutex, passing in the optional @c name. + * Create an ACE_Process_Mutex. * * @param name optional, null-terminated string containing the name of * the object. Multiple users of the same @c ACE_Process_Mutex must use @@ -93,8 +105,7 @@ public: #if defined (ACE_HAS_WCHAR) /** - * Create a Process_Mutex, passing in the optional @c name. (@c wchar_t - * version) + * Create an ACE_Process_Mutex (@c wchar_t version) * * @param name optional, null-terminated string containing the name of * the object. Multiple users of the same @c ACE_Process_Mutex must use @@ -111,6 +122,12 @@ public: mode_t mode = ACE_DEFAULT_FILE_PERMS); #endif /* ACE_HAS_WCHAR */ + /** + * Destructor. + * + * @note The destructor will not release an acquired mutex except + * on Windows. + */ ~ACE_Process_Mutex (void); /** @@ -214,4 +231,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PROCESS_MUTEX_H */ - diff --git a/dep/include/ace/Process_Mutex.inl b/externals/ace/Process_Mutex.inl similarity index 100% rename from dep/include/ace/Process_Mutex.inl rename to externals/ace/Process_Mutex.inl diff --git a/dep/src/ace/Process_Semaphore.cpp b/externals/ace/Process_Semaphore.cpp similarity index 99% rename from dep/src/ace/Process_Semaphore.cpp rename to externals/ace/Process_Semaphore.cpp index 8be6ecf292c..9c84b955eed 100644 --- a/dep/src/ace/Process_Semaphore.cpp +++ b/externals/ace/Process_Semaphore.cpp @@ -109,4 +109,3 @@ ACE_Malloc_Lock_Adapter_T::operator () (const ACE_TCHAR * } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Process_Semaphore.h b/externals/ace/Process_Semaphore.h similarity index 97% rename from dep/include/ace/Process_Semaphore.h rename to externals/ace/Process_Semaphore.h index aa5b8b1aa58..ea614bf691c 100644 --- a/dep/include/ace/Process_Semaphore.h +++ b/externals/ace/Process_Semaphore.h @@ -4,7 +4,7 @@ /** * @file Process_Semaphore.h * - * $Id: Process_Semaphore.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Process_Semaphore.h 86731 2009-09-17 12:23:48Z johnnyw $ * * Wrapper for Dijkstra style general semaphores that work * across processes. @@ -135,8 +135,6 @@ protected: template class ACE_Malloc_Lock_Adapter_T; /** - * @class ACE_Malloc_Lock_Adapter_T - * * @brief Template specialization of ACE_Malloc_Lock_Adapter_T for * ACE_Process_Semaphore. * @@ -152,10 +150,10 @@ public: ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/Process_Semaphore.inl" #endif /* __ACE_INLINE__ */ #include /**/ "ace/post.h" #endif /* ACE_PROCESS_SEMAPHORE_H */ - diff --git a/dep/include/ace/Process_Semaphore.inl b/externals/ace/Process_Semaphore.inl similarity index 100% rename from dep/include/ace/Process_Semaphore.inl rename to externals/ace/Process_Semaphore.inl diff --git a/dep/src/ace/Profile_Timer.cpp b/externals/ace/Profile_Timer.cpp similarity index 99% rename from dep/src/ace/Profile_Timer.cpp rename to externals/ace/Profile_Timer.cpp index 5400836095a..081afa18c6d 100644 --- a/dep/src/ace/Profile_Timer.cpp +++ b/externals/ace/Profile_Timer.cpp @@ -24,6 +24,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_Profile_Timer) + void ACE_Profile_Timer::dump (void) const { @@ -428,6 +429,7 @@ ACE_Profile_Timer::get_rusage (ACE_Profile_Timer::Rusage &usage) usage = 0; } + void ACE_Profile_Timer::elapsed_rusage (ACE_Profile_Timer::Rusage &usage) { @@ -439,4 +441,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE) && !defined (ACE_WIN32) */ - diff --git a/dep/include/ace/Profile_Timer.h b/externals/ace/Profile_Timer.h similarity index 100% rename from dep/include/ace/Profile_Timer.h rename to externals/ace/Profile_Timer.h index 64721603362..247c2796ff1 100644 --- a/dep/include/ace/Profile_Timer.h +++ b/externals/ace/Profile_Timer.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_PROFILE_TIMER_H #define ACE_PROFILE_TIMER_H #include /**/ "ace/pre.h" @@ -136,4 +137,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_PROFILE_TIMER_H */ - diff --git a/dep/include/ace/Profile_Timer.inl b/externals/ace/Profile_Timer.inl similarity index 100% rename from dep/include/ace/Profile_Timer.inl rename to externals/ace/Profile_Timer.inl diff --git a/dep/src/ace/RB_Tree.cpp b/externals/ace/RB_Tree.cpp similarity index 99% rename from dep/src/ace/RB_Tree.cpp rename to externals/ace/RB_Tree.cpp index efbcad514c0..57095be5795 100644 --- a/dep/src/ace/RB_Tree.cpp +++ b/externals/ace/RB_Tree.cpp @@ -1076,7 +1076,7 @@ ACE_RB_Tree::remove_i (ACE_RB_Tree_Node< y->color (z->color ()); z->color (yColor); - //Reassign the y pointer to z because the node that y points to will be + //Reassign the y pointer to z because the node that y points to will be //deleted y = z; } @@ -1248,4 +1248,3 @@ ACE_RB_Tree_Reverse_Iterator::~ACE_RB_Tr ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_RB_TREE_CPP */ - diff --git a/dep/include/ace/RB_Tree.h b/externals/ace/RB_Tree.h similarity index 99% rename from dep/include/ace/RB_Tree.h rename to externals/ace/RB_Tree.h index b02e3e41139..86948e36ce2 100644 --- a/dep/include/ace/RB_Tree.h +++ b/externals/ace/RB_Tree.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_RB_TREE_H #define ACE_RB_TREE_H #include /**/ "ace/pre.h" @@ -207,6 +208,7 @@ public: /// Constructor. ACE_RB_Tree (ACE_Allocator *alloc = 0); + /// Copy constructor. ACE_RB_Tree (const ACE_RB_Tree &rbt); @@ -240,6 +242,7 @@ public: const INT_ID &int_id, ACE_RB_Tree_Node *&entry); + /** * Associate @a ext_id with @a int_id if and only if @a ext_id is not * in the tree. If @a ext_id is already in the tree then the @a int_id @@ -899,4 +902,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ! defined (ACE_RB_TREE_H) */ - diff --git a/dep/include/ace/RB_Tree.inl b/externals/ace/RB_Tree.inl similarity index 99% rename from dep/include/ace/RB_Tree.inl rename to externals/ace/RB_Tree.inl index e4e5ab3d759..7de889abf5b 100644 --- a/dep/include/ace/RB_Tree.inl +++ b/externals/ace/RB_Tree.inl @@ -22,6 +22,7 @@ ACE_RB_Tree_Node::key () return k_; } + // Item accessor. template @@ -32,6 +33,7 @@ ACE_RB_Tree_Node::item () return t_; } + // Set color of the node. template @@ -42,6 +44,7 @@ ACE_RB_Tree_Node::color (ACE_RB_Tree_Node_Base::RB_Tree_Node_Col color_ = c; } + // Get color of the node. template @@ -52,6 +55,7 @@ ACE_RB_Tree_Node::color () return color_; } + // Accessor for node's parent pointer. template @@ -62,6 +66,7 @@ ACE_RB_Tree_Node::parent () return parent_; } + // Mutator for node's parent pointer. template @@ -72,6 +77,8 @@ ACE_RB_Tree_Node::parent (ACE_RB_Tree_Node * p) parent_ = p; } + + // Accessor for node's left child pointer. template @@ -82,6 +89,7 @@ ACE_RB_Tree_Node::left () return left_; } + // Mutator for node's left child pointer. template @@ -92,6 +100,7 @@ ACE_RB_Tree_Node::left (ACE_RB_Tree_Node * l) left_ = l; } + // Accessor for node's right child pointer. template @@ -102,6 +111,7 @@ ACE_RB_Tree_Node::right () return right_; } + // Mutator for node's right child pointer. template @@ -112,10 +122,12 @@ ACE_RB_Tree_Node::right (ACE_RB_Tree_Node * r) right_ = r; } + //////////////////////////////////////////////////////////////////////// // template class ACE_RB_Tree // //////////////////////////////////////////////////////////////////////// + // Initialize an RB Tree. template @@ -153,6 +165,7 @@ ACE_RB_Tree::close (void) return this->close_i (); } + // Associate with . If is already in the // tree then the is not changed. Returns 0 if a // new entry is bound successfully, returns 1 if an attempt is made @@ -170,6 +183,7 @@ ACE_RB_Tree::bind (const EXT_ID &ext_id, return this->insert_i (ext_id, int_id, entry); } + // Same as a normal bind, except the tree entry is also passed back // to the caller. The entry in this case will either be the newly // created entry, or the existing one. @@ -187,6 +201,7 @@ ACE_RB_Tree::bind (const EXT_ID &ext_id, return this->insert_i (ext_id, int_id, entry); } + // Associate with if and only if is not // in the tree. If is already in the tree then the // parameter is assigned the existing value in the tree. Returns 0 @@ -212,6 +227,7 @@ ACE_RB_Tree::trybind (const EXT_ID &ext_ return result; } + // Same as a normal trybind, except the tree entry is also passed // back to the caller. The entry in this case will either be the // newly created entry, or the existing one. @@ -233,9 +249,11 @@ ACE_RB_Tree::trybind (const EXT_ID &ext_ int_id = entry->item (); } + return result; } + // Reassociate with . If is not in the // tree then behaves just like . Returns 0 if a new entry is // bound successfully, returns 1 if an existing entry was rebound, @@ -261,6 +279,7 @@ ACE_RB_Tree::rebind (const EXT_ID &ext_i return result; } + // Same as a normal rebind, except the tree entry is also passed back // to the caller. The entry in this case will either be the newly // created entry, or the existing one. @@ -286,6 +305,7 @@ ACE_RB_Tree::rebind (const EXT_ID &ext_i return result; } + // Associate with . If is not in the tree // then behaves just like . Otherwise, store the old value of // into the "out" parameter and rebind the new parameters. @@ -315,6 +335,7 @@ ACE_RB_Tree::rebind (const EXT_ID &ext_i return result; } + // Same as a normal rebind, except the tree entry is also passed back // to the caller. The entry in this case will either be the newly // created entry, or the existing one. @@ -342,6 +363,7 @@ ACE_RB_Tree::rebind (const EXT_ID &ext_i return result; } + // Associate with . If is not in the tree // then behaves just like . Otherwise, store the old values // of and into the "out" parameters and rebind the @@ -376,6 +398,7 @@ ACE_RB_Tree::rebind (const EXT_ID &ext_i return result; } + // Same as a normal rebind, except the tree entry is also passed back // to the caller. The entry in this case will either be the newly // created entry, or the existing one. @@ -406,6 +429,7 @@ ACE_RB_Tree::rebind (const EXT_ID &ext_i return result; } + // Locate and pass out parameter via . If found, // return 0, returns -1 if not found. @@ -442,6 +466,7 @@ ACE_RB_Tree::find (const EXT_ID &ext_id, return this->find_i (ext_id, entry); } + // Unbind (remove) the from the tree. Don't return the // to the caller (this is useful for collections where the // s are *not* dynamically allocated...). @@ -477,6 +502,7 @@ ACE_RB_Tree::unbind (const EXT_ID &ext_i return -1; } + // Break any association of . Returns the value of // in case the caller needs to deallocate memory. @@ -511,6 +537,7 @@ ACE_RB_Tree::unbind (const EXT_ID &ext_i return -1; } + // Remove entry from the tree. This method should be used with *extreme* // caution, and only for optimization purposes. The node being passed // in had better have been allocated by the tree that is unbinding it. @@ -524,6 +551,7 @@ ACE_RB_Tree::unbind (ACE_RB_Tree_Noderemove_i (entry); } + // Returns a reference to the underlying . This makes it // possible to acquire the lock explicitly, which can be useful in // some cases if you instantiate the with an @@ -539,6 +567,7 @@ ACE_RB_Tree::mutex (void) return this->lock_; } + // Dump the state of an object. template @@ -557,6 +586,7 @@ ACE_RB_Tree::dump (void) const #endif /* ACE_HAS_DUMP */ } + // Return forward iterator positioned at first node in tree. template @@ -568,6 +598,7 @@ ACE_RB_Tree::begin (void) return ACE_RB_Tree_Iterator (*this); } + // Return forward iterator positioned at last node in tree. template @@ -579,6 +610,7 @@ ACE_RB_Tree::end (void) return ACE_RB_Tree_Iterator (); } + // Return reverse iterator positioned at last node in tree. template @@ -590,6 +622,7 @@ ACE_RB_Tree::rbegin (void) return ACE_RB_Tree_Reverse_Iterator (*this); } + // Return reverse iterator positioned at first node in tree. template @@ -601,6 +634,7 @@ ACE_RB_Tree::rend (void) return ACE_RB_Tree_Reverse_Iterator (); } + // Returns a pointer to the item corresponding to the given key, // or 0 if it cannot find the key in the tree. DEPRECATED. @@ -648,6 +682,7 @@ ACE_RB_Tree::insert (const EXT_ID &k, co return this->insert_i (k, t); } + // Removes the item associated with the given key from the // tree and destroys it. Returns 1 if it found the item // and successfully destroyed it, 0 if it did not find the @@ -664,6 +699,7 @@ ACE_RB_Tree::remove (const EXT_ID &k) return this->remove_i (k, i); } + // Destroys all nodes and sets the root pointer null. DEPRECATED template @@ -686,6 +722,7 @@ ACE_RB_Tree::current_size () const return current_size_; } + /////////////////////////////////////////////////////////////////////// // template class // // ACE_RB_Tree_Iterator_Base // @@ -710,6 +747,7 @@ ACE_RB_Tree_Iterator_Base::done (void) c return node_ ? 0 : 1; } + // STL-like iterator dereference operator: returns a reference // to the node underneath the iterator. @@ -721,6 +759,7 @@ ACE_RB_Tree_Iterator_Base::operator* (vo return *(this->node_); } + // STL-like iterator dereference operator: returns a reference // to the node underneath the iterator. @@ -732,6 +771,7 @@ ACE_RB_Tree_Iterator_Base::operator-> (v return this->node_; } + // Returns a reference to the tree over which we're iterating. template ACE_INLINE const ACE_RB_Tree & @@ -741,6 +781,7 @@ ACE_RB_Tree_Iterator_Base::tree (void) return *tree_; } + // Comparison operator: returns 1 if both iterators point to the same position, otherwise 0. template @@ -752,6 +793,7 @@ ACE_RB_Tree_Iterator_Base::operator== return (this->node_ == rbt.node_) ? true : false; } + // Comparison operator: returns 1 if the iterators point to different positions, otherwise 0. template @@ -763,6 +805,7 @@ ACE_RB_Tree_Iterator_Base::operator!= return (this->node_ == rbt.node_) ? false : true; } + // Move forward by one element in the tree. Returns 0 when // there are no more elements in the tree, otherwise 1. @@ -780,6 +823,7 @@ ACE_RB_Tree_Iterator_Base::forward_i (vo return node_ ? 1 : 0; } + // Move back by one element in the tree. Returns 0 when // there are no more elements in the tree, otherwise 1. @@ -797,6 +841,7 @@ ACE_RB_Tree_Iterator_Base::reverse_i (vo return node_ ? 1 : 0; } + ////////////////////////////////////////////////////////////////// // template class // // ACE_RB_Tree_Iterator // @@ -822,6 +867,7 @@ ACE_RB_Tree_Iterator::advance (void) return this->forward_i (); } + // Dump the state of an object. template @@ -835,6 +881,7 @@ ACE_RB_Tree_Iterator::dump (void) const #endif /* ACE_HAS_DUMP */ } + // Prefix advance. template @@ -847,6 +894,7 @@ ACE_RB_Tree_Iterator::operator++ (void) return *this; } + // Postfix advance. template @@ -860,6 +908,7 @@ ACE_RB_Tree_Iterator::operator++ (int) return retv; } + // Prefix reverse. template @@ -872,6 +921,7 @@ ACE_RB_Tree_Iterator::operator-- (void) return *this; } + // Postfix reverse. template @@ -885,6 +935,7 @@ ACE_RB_Tree_Iterator::operator-- (int) return retv; } + // Passes back the under the iterator. Returns 0 if // the iteration has completed, otherwise 1. This method must // be declared and defined in both the derived forward and @@ -910,6 +961,7 @@ ACE_RB_Tree_Iterator::next (ACE_RB_Tree_ return 0; } + // Accessor for key of node under iterator (if any). DEPRECATED. template @@ -920,6 +972,7 @@ ACE_RB_Tree_Iterator::key () return this->node_ ? (&(this->node_->key ())) : 0; } + // Accessor for item of node under iterator (if any). DEPRECATED. template @@ -930,6 +983,7 @@ ACE_RB_Tree_Iterator::item () return this->node_ ? (&(this->node_->item ())) : 0; } + // Move to the first item in the tree. DEPRECATED. template @@ -941,6 +995,7 @@ ACE_RB_Tree_Iterator::first () return this->node_ ? 1 : 0; } + // Move to the last item in the tree. DEPRECATED. template @@ -952,6 +1007,7 @@ ACE_RB_Tree_Iterator::last () return this->node_ ? 1 : 0; } + // Moves to the next item in the tree, // returns 1 if there is a next item, 0 otherwise. DEPRECATED. @@ -964,6 +1020,7 @@ ACE_RB_Tree_Iterator::next () return this->node_ ? 1 : 0; } + // Moves to the previous item in the tree, // returns 1 if there is a previous item, 0 otherwise. DEPRECATED. @@ -976,6 +1033,7 @@ ACE_RB_Tree_Iterator::previous () return this->node_ ? 1 : 0; } + // Returns 0 if the iterator is positioned over a valid ACE_RB_Tree // node, returns 1 if not. DEPRECATED. @@ -987,11 +1045,13 @@ ACE_RB_Tree_Iterator::is_done () return this->node_ ? 0 : 1; } + ////////////////////////////////////////////////////////////////////////// // template class // // ACE_RB_Tree_Reverse_Iterator // ////////////////////////////////////////////////////////////////////////// + template ACE_INLINE ACE_RB_Tree_Reverse_Iterator::ACE_RB_Tree_Reverse_Iterator (void) @@ -1012,6 +1072,7 @@ ACE_RB_Tree_Reverse_Iterator::advance (v return this->reverse_i (); } + // Dump the state of an object. template @@ -1025,6 +1086,7 @@ ACE_RB_Tree_Reverse_Iterator::dump (void #endif /* ACE_HAS_DUMP */ } + // Prefix advance. template @@ -1037,6 +1099,7 @@ ACE_RB_Tree_Reverse_Iterator::operator++ return *this; } + // Postfix advance. template @@ -1050,6 +1113,7 @@ ACE_RB_Tree_Reverse_Iterator::operator++ return retv; } + // Prefix reverse. template @@ -1062,6 +1126,7 @@ ACE_RB_Tree_Reverse_Iterator::operator-- return *this; } + // Postfix reverse. template @@ -1075,6 +1140,7 @@ ACE_RB_Tree_Reverse_Iterator::operator-- return retv; } + // Passes back the under the iterator. Returns 0 if // the iteration has completed, otherwise 1. This method must // be declared and defined in both the derived forward and diff --git a/dep/src/ace/RW_Mutex.cpp b/externals/ace/RW_Mutex.cpp similarity index 86% rename from dep/src/ace/RW_Mutex.cpp rename to externals/ace/RW_Mutex.cpp index 0bf52665615..76ce52d2e79 100644 --- a/dep/src/ace/RW_Mutex.cpp +++ b/externals/ace/RW_Mutex.cpp @@ -1,7 +1,7 @@ /** * @file RW_Mutex.cpp * - * $Id: RW_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $ + * $Id: RW_Mutex.cpp 83934 2008-12-01 13:47:06Z johnnyw $ * * Originally in Synch.cpp * @@ -18,7 +18,7 @@ #include "ace/Log_Msg.h" -ACE_RCSID(ace, RW_Mutex, "$Id: RW_Mutex.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, RW_Mutex, "$Id: RW_Mutex.cpp 83934 2008-12-01 13:47:06Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -35,7 +35,7 @@ ACE_RW_Mutex::dump (void) const } ACE_RW_Mutex::ACE_RW_Mutex (int type, const ACE_TCHAR *name, void *arg) - : removed_ (0) + : removed_ (false) { // ACE_TRACE ("ACE_RW_Mutex::ACE_RW_Mutex"); if (ACE_OS::rwlock_init (&this->lock_, type, name, arg) != 0) @@ -53,4 +53,3 @@ ACE_RW_Mutex::~ACE_RW_Mutex (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/RW_Mutex.h b/externals/ace/RW_Mutex.h similarity index 98% rename from dep/include/ace/RW_Mutex.h rename to externals/ace/RW_Mutex.h index ffb31124475..aaaabdc0b96 100644 --- a/dep/include/ace/RW_Mutex.h +++ b/externals/ace/RW_Mutex.h @@ -4,7 +4,7 @@ /** * @file RW_Mutex.h * - * $Id: RW_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: RW_Mutex.h 83934 2008-12-01 13:47:06Z johnnyw $ * * Moved from Synch.h. * @@ -120,7 +120,7 @@ protected: /// destructor. This flag isn't protected by a lock, so make sure /// that you don't have multiple threads simultaneously calling /// on the same object, which is a bad idea anyway... - int removed_; + bool removed_; private: // = Prevent assignment and initialization. @@ -139,4 +139,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_RW_MUTEX_H */ - diff --git a/dep/include/ace/RW_Mutex.inl b/externals/ace/RW_Mutex.inl similarity index 93% rename from dep/include/ace/RW_Mutex.inl rename to externals/ace/RW_Mutex.inl index b26dc986cc1..3ff9826c52c 100644 --- a/dep/include/ace/RW_Mutex.inl +++ b/externals/ace/RW_Mutex.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: RW_Mutex.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: RW_Mutex.inl 83934 2008-12-01 13:47:06Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -16,9 +16,9 @@ ACE_RW_Mutex::remove (void) { // ACE_TRACE ("ACE_RW_Mutex::remove"); int result = 0; - if (this->removed_ == 0) + if (!this->removed_) { - this->removed_ = 1; + this->removed_ = true; result = ACE_OS::rwlock_destroy (&this->lock_); } return result; diff --git a/dep/src/ace/RW_Process_Mutex.cpp b/externals/ace/RW_Process_Mutex.cpp similarity index 99% rename from dep/src/ace/RW_Process_Mutex.cpp rename to externals/ace/RW_Process_Mutex.cpp index 72a23b89d67..a39de3e346a 100644 --- a/dep/src/ace/RW_Process_Mutex.cpp +++ b/externals/ace/RW_Process_Mutex.cpp @@ -52,4 +52,3 @@ ACE_RW_Process_Mutex::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/RW_Process_Mutex.h b/externals/ace/RW_Process_Mutex.h similarity index 88% rename from dep/include/ace/RW_Process_Mutex.h rename to externals/ace/RW_Process_Mutex.h index d6bb39f67c9..3953c2b4ddf 100644 --- a/dep/include/ace/RW_Process_Mutex.h +++ b/externals/ace/RW_Process_Mutex.h @@ -4,7 +4,7 @@ /** * @file RW_Process_Mutex.h * - * $Id: RW_Process_Mutex.h 81509 2008-04-28 22:00:49Z shuston $ + * $Id: RW_Process_Mutex.h 87487 2009-11-12 07:54:39Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -22,7 +22,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Default_Constants.h" -#include "ace/OS_NS_fcntl.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -44,17 +43,11 @@ class ACE_Export ACE_RW_Process_Mutex public: /// Create a cross-process readers/writer mutex, passing in the optional /// @a name, @a flags and @a mode \sa ACE_File_Lock. - /// If not specified, a name is generated and flags and mode are set - /// to default platform values. -#if defined (ACE_WIN32) + /// If not specified, a name is generated and flags and mode are set + /// to default platform values. ACE_RW_Process_Mutex (const ACE_TCHAR *name = 0, int flags = O_CREAT|O_RDWR, - mode_t mode = ACE_DEFAULT_OPEN_PERMS); -#else - ACE_RW_Process_Mutex (const ACE_TCHAR *name = 0, - int flags = O_CREAT|O_RDWR, - mode_t mode = S_IRUSR | S_IWUSR ); -#endif /* ACE_WIN32 */ + mode_t mode = ACE_DEFAULT_RW_PROCESS_MUTEX_PERMS); ~ACE_RW_Process_Mutex (void); @@ -142,4 +135,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_RW_PROCESS_MUTEX_H */ - diff --git a/dep/include/ace/RW_Process_Mutex.inl b/externals/ace/RW_Process_Mutex.inl similarity index 100% rename from dep/include/ace/RW_Process_Mutex.inl rename to externals/ace/RW_Process_Mutex.inl diff --git a/dep/src/ace/RW_Thread_Mutex.cpp b/externals/ace/RW_Thread_Mutex.cpp similarity index 99% rename from dep/src/ace/RW_Thread_Mutex.cpp rename to externals/ace/RW_Thread_Mutex.cpp index bd1b2ad6111..281f2d4815b 100644 --- a/dep/src/ace/RW_Thread_Mutex.cpp +++ b/externals/ace/RW_Thread_Mutex.cpp @@ -43,4 +43,3 @@ ACE_RW_Thread_Mutex::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/RW_Thread_Mutex.h b/externals/ace/RW_Thread_Mutex.h similarity index 99% rename from dep/include/ace/RW_Thread_Mutex.h rename to externals/ace/RW_Thread_Mutex.h index b8c1c341754..49028296696 100644 --- a/dep/include/ace/RW_Thread_Mutex.h +++ b/externals/ace/RW_Thread_Mutex.h @@ -72,4 +72,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_RW_THREAD_MUTEX_H */ - diff --git a/dep/include/ace/RW_Thread_Mutex.inl b/externals/ace/RW_Thread_Mutex.inl similarity index 100% rename from dep/include/ace/RW_Thread_Mutex.inl rename to externals/ace/RW_Thread_Mutex.inl diff --git a/dep/src/ace/Reactor.cpp b/externals/ace/Reactor.cpp similarity index 98% rename from dep/src/ace/Reactor.cpp rename to externals/ace/Reactor.cpp index 024a36129d2..b575d6d221c 100644 --- a/dep/src/ace/Reactor.cpp +++ b/externals/ace/Reactor.cpp @@ -1,4 +1,4 @@ -// $Id: Reactor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Reactor.cpp 88832 2010-02-04 09:57:42Z johnnyw $ #include "ace/Reactor.h" @@ -53,7 +53,7 @@ ACE_RCSID (ace, Reactor, - "$Id: Reactor.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Reactor.cpp 88832 2010-02-04 09:57:42Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -477,7 +477,9 @@ ACE_Reactor::notify (ACE_Event_Handler *event_handler, // First, try to remember this reactor in the event handler, in case // the event handler goes away before the notification is delivered. if (event_handler != 0 && event_handler->reactor () == 0) - event_handler->reactor (this); + { + event_handler->reactor (this); + } return this->implementation ()->notify (event_handler, mask, tv); } @@ -510,4 +512,3 @@ ACE_Reactor::cancel_timer (long timer_id, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Reactor.h b/externals/ace/Reactor.h similarity index 96% rename from dep/include/ace/Reactor.h rename to externals/ace/Reactor.h index dc89ed4d6cc..6f0fdf35013 100644 --- a/dep/include/ace/Reactor.h +++ b/externals/ace/Reactor.h @@ -4,7 +4,7 @@ /** * @file Reactor.h * - * $Id: Reactor.h 82117 2008-06-22 17:05:12Z schmidt $ + * $Id: Reactor.h 88832 2010-02-04 09:57:42Z johnnyw $ * * @author Irfan Pyarali * @author Douglas C. Schmidt @@ -233,13 +233,13 @@ public: /** * Initialize the ACE_Reactor to manage . - * If is non-0 then the ACE_Reactor's + * If @a restart is false then the ACE_Reactor's * method will be restarted automatically when occurs. If - * or are non-0 they are used as the + * @a signal_handler or @a timer_queue are non-0 they are used as the * signal handler and timer queue, respectively. */ int open (size_t max_number_of_handles, - int restart = 0, + bool restart = false, ACE_Sig_Handler *signal_handler = 0, ACE_Timer_Queue *timer_queue = 0); @@ -281,8 +281,8 @@ public: * that were dispatched, 0 if the @a max_wait_time elapsed without * dispatching any handlers, or -1 if an error occurs. * - * The only difference between and - * is that in the alertable case, the eventloop will + * The only difference between alertable_handle_events() and + * handle_events() is that in the alertable case, the eventloop will * return when the system queues an I/O completion routine or an * Asynchronous Procedure Call. */ @@ -294,8 +294,8 @@ public: * @a max_wait_time value is a reference and can therefore never be * NULL. * - * The only difference between and - * is that in the alertable case, the eventloop will + * The only difference between alertable_handle_events() and + * handle_events() is that in the alertable case, the eventloop will * return when the system queues an I/O completion routine or an * Asynchronous Procedure Call. */ @@ -380,7 +380,7 @@ public: * Shorthand for calling * register_handler(ACE_HANDLE,ACE_Event_Handler*,ACE_Reactor_Mask), * multiple times for the same @a event_handler and @a masks but - * different . + * different @a handles. */ int register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *event_handler, @@ -524,7 +524,7 @@ public: * Resume @a handles. * * Shorthand for calling resume_handler(ACE_HANDLE) with multiple - * . + * @a handles. */ int resume_handler (const ACE_Handle_Set &handles); @@ -656,7 +656,7 @@ public: int cancel_wakeup (ACE_Event_Handler *event_handler, ACE_Reactor_Mask masks_to_be_cleared); - /// Clear @a masks_to_be_cleared from the 's entry. + /// Clear @a masks_to_be_cleared from the @a handle's entry. /// Note that this call does not cause the Reactor to re-examine /// its set of handlers - the new masks will be noticed the next /// time the Reactor waits for activity. If there is no other @@ -703,7 +703,7 @@ public: * Set the maximum number of times that ACE_Reactor will * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its - * loop. By default, this is set to + * ACE_Message_Queue::dequeue() loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this * to a value like "1 or 2" will increase "fairness" (and thus * prevent starvation) at the expense of slightly higher dispatching @@ -715,7 +715,7 @@ public: * Get the maximum number of times that the ACE_Reactor will * iterate and dispatch the ACE_Event_Handler's that are passed in * via the notify queue before breaking out of its - * loop. + * ACE_Message_Queue::dequeue() loop. */ int max_notify_iterations (void); @@ -793,10 +793,10 @@ public: int requeue_position (void); /// Get the existing restart value. - int restart (void); + bool restart (void); /// Set a new value for restart and return the original value. - int restart (int r); + bool restart (bool r); // = Low-level wait_set mask manipulation methods. @@ -819,7 +819,7 @@ public: ACE_Reactor_Mask mask, int ops); - /// GET/SET/ADD/CLR the ready "bit" bound with the and @a mask. + /// GET/SET/ADD/CLR the ready "bit" bound with the @a handle and @a mask. int ready_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, int ops); @@ -835,9 +835,9 @@ public: */ int current_info (ACE_HANDLE handle, size_t &msg_size); - /// Return 1 if we any event associations were made by the reactor - /// for the handles that it waits on, 0 otherwise. - int uses_event_associations (void); + /// Return true if we any event associations were made by the reactor + /// for the handles that it waits on, false otherwise. + bool uses_event_associations (void); /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; @@ -870,6 +870,7 @@ protected: ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/Reactor.inl" #endif /* __ACE_INLINE__ */ @@ -877,4 +878,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REACTOR_H */ - diff --git a/dep/include/ace/Reactor.inl b/externals/ace/Reactor.inl similarity index 98% rename from dep/include/ace/Reactor.inl rename to externals/ace/Reactor.inl index f3f5b17992c..36a89dbf637 100644 --- a/dep/include/ace/Reactor.inl +++ b/externals/ace/Reactor.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Reactor.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Reactor.inl 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/Reactor_Impl.h" @@ -143,7 +143,7 @@ ACE_Reactor::current_info (ACE_HANDLE handle, size_t &size) ACE_INLINE int ACE_Reactor::open (size_t size, - int restart, + bool restart, ACE_Sig_Handler *signal_handler, ACE_Timer_Queue *timer_queue) { @@ -410,14 +410,14 @@ ACE_Reactor::owner (ACE_thread_t *owner) return this->implementation ()->owner (owner); } -ACE_INLINE int +ACE_INLINE bool ACE_Reactor::restart (void) { return this->implementation ()->restart (); } -ACE_INLINE int -ACE_Reactor::restart (int r) +ACE_INLINE bool +ACE_Reactor::restart (bool r) { return this->implementation ()->restart (r); } @@ -479,7 +479,7 @@ ACE_Reactor::size (void) const return this->implementation ()->size (); } -ACE_INLINE int +ACE_INLINE bool ACE_Reactor::uses_event_associations (void) { return this->implementation ()->uses_event_associations (); diff --git a/dep/src/ace/Reactor_Impl.cpp b/externals/ace/Reactor_Impl.cpp similarity index 99% rename from dep/src/ace/Reactor_Impl.cpp rename to externals/ace/Reactor_Impl.cpp index fe0ce99d0b8..dceba327691 100644 --- a/dep/src/ace/Reactor_Impl.cpp +++ b/externals/ace/Reactor_Impl.cpp @@ -13,4 +13,3 @@ ACE_Reactor_Impl::~ACE_Reactor_Impl (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Reactor_Impl.h b/externals/ace/Reactor_Impl.h similarity index 90% rename from dep/include/ace/Reactor_Impl.h rename to externals/ace/Reactor_Impl.h index db5a6ea2524..863c0b4eef6 100644 --- a/dep/include/ace/Reactor_Impl.h +++ b/externals/ace/Reactor_Impl.h @@ -4,12 +4,13 @@ /** * @file Reactor_Impl.h * - * $Id: Reactor_Impl.h 81082 2008-03-25 09:09:11Z johnnyw $ + * $Id: Reactor_Impl.h 84316 2009-02-03 19:46:05Z johnnyw $ * * @author Irfan Pyarali */ //============================================================================= + #ifndef ACE_REACTOR_IMPL_H #define ACE_REACTOR_IMPL_H #include /**/ "ace/pre.h" @@ -90,7 +91,7 @@ public: ACE_Notification_Buffer &buffer) = 0; /** * Set the maximum number of times that the method - * will iterate and dispatch the that are + * will iterate and dispatch the ACE_Event_Handlers that are * passed in via the notify queue before breaking out of the event * loop. By default, this is set to -1, which means "iterate until * the queue is empty." Setting this to a value like "1 or 2" will @@ -101,7 +102,7 @@ public: /** * Get the maximum number of times that the method - * will iterate and dispatch the that are + * will iterate and dispatch the ACE_Event_Handlers that are * passed in via the notify queue before breaking out of its event * loop. */ @@ -132,7 +133,7 @@ public: /// Initialization. virtual int open (size_t size, - int restart = 0, + bool restart = false, ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0, int disable_notify_pipe = 0, @@ -262,15 +263,15 @@ public: ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) = 0; - /// Register @a event_handler with all the in the . + /// Register @a event_handler with all the @a handles in the . virtual int register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask) = 0; /** - * Register to handle the signal @a signum using the - * . Returns the that was previously registered - * (if any), along with the of the signal handler. + * Register @a new_sh to handle the signal @a signum using the + * @a new_disp. Returns the @a old_sh that was previously registered + * (if any), along with the @a old_disp of the signal handler. */ virtual int register_handler (int signum, ACE_Event_Handler *new_sh, @@ -278,8 +279,8 @@ public: ACE_Event_Handler **old_sh = 0, ACE_Sig_Action *old_disp = 0) = 0; - /// Registers to handle a set of signals using the - /// . + /// Registers @a new_sh to handle a set of signals @a sigset using the + /// @a new_disp. virtual int register_handler (const ACE_Sig_Set &sigset, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp = 0) = 0; @@ -294,7 +295,7 @@ public: ACE_Reactor_Mask mask) = 0; /** - * Removes . If @a mask == ACE_Event_Handler::DONT_CALL + * Removes @a handle. If @a mask == ACE_Event_Handler::DONT_CALL * then the method of the associated * is not invoked. */ @@ -302,7 +303,7 @@ public: ACE_Reactor_Mask mask) = 0; /** - * Removes all handles in . If @a mask == + * Removes all handles in @a handle_set. If @a mask == * ACE_Event_Handler::DONT_CALL then the method of * the associated s is not invoked. */ @@ -320,7 +321,7 @@ public: ACE_Sig_Action *old_disp = 0, int sigkey = -1) = 0; - /// Calls for every signal in . + /// Calls for every signal in @a sigset. virtual int remove_handler (const ACE_Sig_Set &sigset) = 0; // = Suspend and resume Handlers. @@ -329,10 +330,10 @@ public: /// to get the handle. virtual int suspend_handler (ACE_Event_Handler *event_handler) = 0; - /// Suspend temporarily. + /// Suspend @a handle temporarily. virtual int suspend_handler (ACE_HANDLE handle) = 0; - /// Suspend all in handle set temporarily. + /// Suspend all @a handles in handle set temporarily. virtual int suspend_handler (const ACE_Handle_Set &handles) = 0; /// Suspend all temporarily. @@ -342,10 +343,10 @@ public: /// get the handle. virtual int resume_handler (ACE_Event_Handler *event_handler) = 0; - /// Resume . + /// Resume @a handle. virtual int resume_handler (ACE_HANDLE handle) = 0; - /// Resume all in handle set. + /// Resume all @a handles in handle set. virtual int resume_handler (const ACE_Handle_Set &handles) = 0; /// Resume all . @@ -356,9 +357,9 @@ public: /// the application virtual int resumable_handler (void) = 0; - /// Return 1 if we any event associations were made by the reactor - /// for the handles that it waits on, 0 otherwise. - virtual int uses_event_associations (void) = 0; + /// Return true if we any event associations were made by the reactor + /// for the handles that it waits on, false otherwise. + virtual bool uses_event_associations (void) = 0; // If we need to reset handles returned from accept/connect. @@ -421,16 +422,16 @@ public: virtual int schedule_wakeup (ACE_Event_Handler *event_handler, ACE_Reactor_Mask masks_to_be_added) = 0; - /// Add @a masks_to_be_added to the 's entry. - /// associated with must already have been registered. + /// Add @a masks_to_be_added to the @a handle's entry. + /// associated with @a handle must already have been registered. virtual int schedule_wakeup (ACE_HANDLE handle, ACE_Reactor_Mask masks_to_be_added) = 0; - /// Clear @a masks_to_be_cleared from the 's entry. + /// Clear @a masks_to_be_cleared from the @a event_handler's entry. virtual int cancel_wakeup (ACE_Event_Handler *event_handler, ACE_Reactor_Mask masks_to_be_cleared) = 0; - /// Clear @a masks_to_be_cleared from the 's entry. + /// Clear @a masks_to_be_cleared from the @a handle's entry. virtual int cancel_wakeup (ACE_HANDLE handle, ACE_Reactor_Mask masks_to_be_cleared) = 0; @@ -448,7 +449,7 @@ public: /** * Set the maximum number of times that ACE_Reactor_Impl will - * iterate and dispatch the that are passed in + * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its * loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this @@ -460,7 +461,7 @@ public: /** * Get the maximum number of times that the ACE_Reactor_Impl will - * iterate and dispatch the that are passed in + * iterate and dispatch the ACE_Event_Handlers that are passed in * via the notify queue before breaking out of its * loop. */ @@ -475,13 +476,13 @@ public: ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK) = 0; /** - * Return the Event_Handler associated with . Return 0 if - * is not registered. + * Return the Event_Handler associated with @a handle. Return 0 if + * @a handle is not registered. */ virtual ACE_Event_Handler *find_handler (ACE_HANDLE handle) = 0; /** - * Check to see if is associated with a valid Event_Handler + * Check to see if @a handle is associated with a valid Event_Handler * bound to @a mask. Return the @a event_handler associated with this * handler if @a event_handler != 0. */ @@ -511,17 +512,17 @@ public: /// Wake up all threads in waiting in the event loop virtual void wakeup_all_threads (void) = 0; - /// Transfers ownership of Reactor_Impl to the . + /// Transfers ownership of Reactor_Impl to the @a new_owner. virtual int owner (ACE_thread_t new_owner, ACE_thread_t *old_owner = 0) = 0; /// Return the ID of the "owner" thread. virtual int owner (ACE_thread_t *owner) = 0; /// Get the existing restart value. - virtual int restart (void) = 0; + virtual bool restart (void) = 0; /// Set a new value for restart and return the original value. - virtual int restart (int r) = 0; + virtual bool restart (bool r) = 0; /// Set position of the owner thread. virtual void requeue_position (int) = 0; @@ -537,7 +538,7 @@ public: ACE_Reactor_Mask mask, int ops) = 0; - /// GET/SET/ADD/CLR the dispatch MASK "bit" bound with the + /// GET/SET/ADD/CLR the dispatch MASK "bit" bound with the @a handle /// and @a mask. virtual int mask_ops (ACE_HANDLE handle, ACE_Reactor_Mask mask, @@ -550,7 +551,7 @@ public: ACE_Reactor_Mask mask, int ops) = 0; - /// GET/SET/ADD/CLR the ready "bit" bound with the and @a mask. + /// GET/SET/ADD/CLR the ready "bit" bound with the @a handle and @a mask. virtual int ready_ops (ACE_HANDLE handle, ACE_Reactor_Mask, int ops) = 0; @@ -566,4 +567,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REACTOR_IMPL_H */ - diff --git a/dep/src/ace/Reactor_Notification_Strategy.cpp b/externals/ace/Reactor_Notification_Strategy.cpp similarity index 99% rename from dep/src/ace/Reactor_Notification_Strategy.cpp rename to externals/ace/Reactor_Notification_Strategy.cpp index 8c216b092de..ca09498ece8 100644 --- a/dep/src/ace/Reactor_Notification_Strategy.cpp +++ b/externals/ace/Reactor_Notification_Strategy.cpp @@ -36,4 +36,3 @@ ACE_Reactor_Notification_Strategy::notify (ACE_Event_Handler *eh, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Reactor_Notification_Strategy.h b/externals/ace/Reactor_Notification_Strategy.h similarity index 99% rename from dep/include/ace/Reactor_Notification_Strategy.h rename to externals/ace/Reactor_Notification_Strategy.h index fd73b36bb67..38e9f3bb4ca 100644 --- a/dep/include/ace/Reactor_Notification_Strategy.h +++ b/externals/ace/Reactor_Notification_Strategy.h @@ -64,4 +64,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_REACTOR_NOTIFICATION_STRATEGY_H */ - diff --git a/dep/include/ace/Reactor_Notification_Strategy.inl b/externals/ace/Reactor_Notification_Strategy.inl similarity index 100% rename from dep/include/ace/Reactor_Notification_Strategy.inl rename to externals/ace/Reactor_Notification_Strategy.inl diff --git a/dep/src/ace/Reactor_Timer_Interface.cpp b/externals/ace/Reactor_Timer_Interface.cpp similarity index 100% rename from dep/src/ace/Reactor_Timer_Interface.cpp rename to externals/ace/Reactor_Timer_Interface.cpp index 504f0107980..e2c644bd7d3 100644 --- a/dep/src/ace/Reactor_Timer_Interface.cpp +++ b/externals/ace/Reactor_Timer_Interface.cpp @@ -6,6 +6,7 @@ ACE_RCSID (ace, Reactor_Timer_Interface, "$Id: Reactor_Timer_Interface.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Reactor_Timer_Interface::~ACE_Reactor_Timer_Interface() @@ -13,4 +14,3 @@ ACE_Reactor_Timer_Interface::~ACE_Reactor_Timer_Interface() } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Reactor_Timer_Interface.h b/externals/ace/Reactor_Timer_Interface.h similarity index 99% rename from dep/include/ace/Reactor_Timer_Interface.h rename to externals/ace/Reactor_Timer_Interface.h index aaa2a663b0a..02e4e628186 100644 --- a/dep/include/ace/Reactor_Timer_Interface.h +++ b/externals/ace/Reactor_Timer_Interface.h @@ -58,4 +58,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REACTOR_TIMER_INTERFACE_H */ - diff --git a/dep/src/ace/Reactor_Token_T.cpp b/externals/ace/Reactor_Token_T.cpp similarity index 78% rename from dep/src/ace/Reactor_Token_T.cpp rename to externals/ace/Reactor_Token_T.cpp index 753c73b8a7f..2c8b64528bb 100644 --- a/dep/src/ace/Reactor_Token_T.cpp +++ b/externals/ace/Reactor_Token_T.cpp @@ -1,4 +1,4 @@ -// $Id: Reactor_Token_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Reactor_Token_T.cpp 82917 2008-10-03 19:10:56Z dai_y $ #include "ace/Log_Msg.h" #include "ace/Reactor_Token_T.h" @@ -61,11 +61,20 @@ template void ACE_Reactor_Token_T::sleep_hook (void) { ACE_TRACE ("ACE_Reactor_Token_T::sleep_hook"); - if (this->reactor_->notify () == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("sleep_hook failed"))); + ACE_Time_Value ping = ACE_Time_Value::zero; + if (this->reactor_->notify (0, ACE_Event_Handler::EXCEPT_MASK, &ping) == -1) + { + if (errno == ETIME) + { + errno = 0; + } + else + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("sleep_hook failed"))); + } + } } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Reactor_Token_T.h b/externals/ace/Reactor_Token_T.h similarity index 100% rename from dep/include/ace/Reactor_Token_T.h rename to externals/ace/Reactor_Token_T.h index 9eedb7b4d0b..7442040b95e 100644 --- a/dep/include/ace/Reactor_Token_T.h +++ b/externals/ace/Reactor_Token_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_REACTOR_TOKEN_T_H #define ACE_REACTOR_TOKEN_T_H #include /**/ "ace/pre.h" @@ -90,4 +91,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REACTOR_TOKEN_T_H */ - diff --git a/dep/src/ace/Read_Buffer.cpp b/externals/ace/Read_Buffer.cpp similarity index 100% rename from dep/src/ace/Read_Buffer.cpp rename to externals/ace/Read_Buffer.cpp index f7cb7944eb6..dc246a466b0 100644 --- a/dep/src/ace/Read_Buffer.cpp +++ b/externals/ace/Read_Buffer.cpp @@ -15,6 +15,7 @@ ACE_RCSID(ace, Read_Buffer, "$Id: Read_Buffer.cpp 80826 2008-03-04 14:51:23Z wotte $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL void @@ -173,4 +174,3 @@ ACE_Read_Buffer::rec_read (int term, int search, int replace) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Read_Buffer.h b/externals/ace/Read_Buffer.h similarity index 99% rename from dep/include/ace/Read_Buffer.h rename to externals/ace/Read_Buffer.h index 5dc1e9fa181..fafd42d6512 100644 --- a/dep/include/ace/Read_Buffer.h +++ b/externals/ace/Read_Buffer.h @@ -127,4 +127,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_READ_BUFFER_H */ - diff --git a/dep/include/ace/Read_Buffer.inl b/externals/ace/Read_Buffer.inl similarity index 100% rename from dep/include/ace/Read_Buffer.inl rename to externals/ace/Read_Buffer.inl diff --git a/dep/src/ace/Recursive_Thread_Mutex.cpp b/externals/ace/Recursive_Thread_Mutex.cpp similarity index 94% rename from dep/src/ace/Recursive_Thread_Mutex.cpp rename to externals/ace/Recursive_Thread_Mutex.cpp index a654fdd82f3..4f43ca7240b 100644 --- a/dep/src/ace/Recursive_Thread_Mutex.cpp +++ b/externals/ace/Recursive_Thread_Mutex.cpp @@ -1,7 +1,7 @@ /** * @file Recursive_Thread_Mutex.cpp * - * $Id: Recursive_Thread_Mutex.cpp 82253 2008-07-04 20:18:14Z shuston $ + * $Id: Recursive_Thread_Mutex.cpp 85363 2009-05-18 07:48:11Z johnnyw $ * * Originally in Synch.cpp * @@ -18,7 +18,7 @@ #include "ace/Log_Msg.h" -ACE_RCSID(ace, Recursive_Thread_Mutex, "$Id: Recursive_Thread_Mutex.cpp 82253 2008-07-04 20:18:14Z shuston $") +ACE_RCSID(ace, Recursive_Thread_Mutex, "$Id: Recursive_Thread_Mutex.cpp 85363 2009-05-18 07:48:11Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -82,7 +82,7 @@ int ACE_Recursive_Thread_Mutex::get_nesting_level (void) { // ACE_TRACE ("ACE_Recursive_Thread_Mutex::get_nesting_level"); -#if defined (ACE_HAS_WINCE) || defined (ACE_HAS_VXTHREADS) || defined (ACE_HAS_PHARLAP) +#if defined (ACE_HAS_VXTHREADS) || defined (ACE_HAS_PHARLAP) || defined (ACE_HAS_WINCE) ACE_NOTSUP_RETURN (-1); #elif defined (ACE_HAS_RECURSIVE_MUTEXES) # if defined (ACE_WIN32) @@ -123,4 +123,3 @@ ACE_Recursive_Thread_Mutex::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/Recursive_Thread_Mutex.h b/externals/ace/Recursive_Thread_Mutex.h similarity index 97% rename from dep/include/ace/Recursive_Thread_Mutex.h rename to externals/ace/Recursive_Thread_Mutex.h index 0f61a75e300..5b7809afe58 100644 --- a/dep/include/ace/Recursive_Thread_Mutex.h +++ b/externals/ace/Recursive_Thread_Mutex.h @@ -4,7 +4,7 @@ /** * @file Recursive_Thread_Mutex.h * - * $Id: Recursive_Thread_Mutex.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Recursive_Thread_Mutex.h 89121 2010-02-22 14:48:31Z schmidt $ * * Moved from Synch.h. * @@ -151,6 +151,9 @@ public: int get_nesting_level (void); /// Returns a reference to the recursive mutex; + ACE_recursive_thread_mutex_t &lock (void); + + /// @deprecated Returns a reference to the recursive mutex; ACE_recursive_thread_mutex_t &mutex (void); /// Returns a reference to the recursive mutex's internal mutex; @@ -192,4 +195,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_RECURSIVE_THREAD_MUTEX_H */ - diff --git a/dep/include/ace/Recursive_Thread_Mutex.inl b/externals/ace/Recursive_Thread_Mutex.inl similarity index 94% rename from dep/include/ace/Recursive_Thread_Mutex.inl rename to externals/ace/Recursive_Thread_Mutex.inl index fe282097eb2..57e8a8a6648 100644 --- a/dep/include/ace/Recursive_Thread_Mutex.inl +++ b/externals/ace/Recursive_Thread_Mutex.inl @@ -1,11 +1,11 @@ // -*- C++ -*- // -// $Id: Recursive_Thread_Mutex.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Recursive_Thread_Mutex.inl 89121 2010-02-22 14:48:31Z schmidt $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_recursive_thread_mutex_t & -ACE_Recursive_Thread_Mutex::mutex (void) +ACE_Recursive_Thread_Mutex::lock (void) { return lock_; } diff --git a/dep/src/ace/Recyclable.cpp b/externals/ace/Recyclable.cpp similarity index 100% rename from dep/src/ace/Recyclable.cpp rename to externals/ace/Recyclable.cpp index ec281377bac..d68ffd4d7b5 100644 --- a/dep/src/ace/Recyclable.cpp +++ b/externals/ace/Recyclable.cpp @@ -1,6 +1,7 @@ //$Id: Recyclable.cpp 80826 2008-03-04 14:51:23Z wotte $ #include "ace/Recyclable.h" + #if !defined (__ACE_INLINE__) #include "ace/Recyclable.inl" #endif /* __ACE_INLINE __ */ @@ -19,4 +20,3 @@ ACE_Recyclable::~ACE_Recyclable (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Recyclable.h b/externals/ace/Recyclable.h similarity index 95% rename from dep/include/ace/Recyclable.h rename to externals/ace/Recyclable.h index 6053963d6e0..36c75586d5a 100644 --- a/dep/include/ace/Recyclable.h +++ b/externals/ace/Recyclable.h @@ -4,7 +4,7 @@ /** * @file Recyclable.h * - * $Id: Recyclable.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Recyclable.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Doug Schmidt */ @@ -63,8 +63,6 @@ protected: /// Constructor. ACE_Recyclable (ACE_Recyclable_State initial_state); -protected: - /// Our state. ACE_Recyclable_State recycle_state_; }; @@ -77,4 +75,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_RECYCLABLE_STATE_H*/ - diff --git a/dep/include/ace/Recyclable.inl b/externals/ace/Recyclable.inl similarity index 100% rename from dep/include/ace/Recyclable.inl rename to externals/ace/Recyclable.inl diff --git a/dep/include/ace/Refcountable.h b/externals/ace/Refcountable.h similarity index 99% rename from dep/include/ace/Refcountable.h rename to externals/ace/Refcountable.h index 19fc26601bc..eba916cd661 100644 --- a/dep/include/ace/Refcountable.h +++ b/externals/ace/Refcountable.h @@ -30,4 +30,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_REFCOUNTABLE_H*/ - diff --git a/dep/src/ace/Refcountable_T.cpp b/externals/ace/Refcountable_T.cpp similarity index 99% rename from dep/src/ace/Refcountable_T.cpp rename to externals/ace/Refcountable_T.cpp index d3b76a3bf08..80c28ea501b 100644 --- a/dep/src/ace/Refcountable_T.cpp +++ b/externals/ace/Refcountable_T.cpp @@ -23,4 +23,3 @@ ACE_Refcountable_T::~ACE_Refcountable_T (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_REFCOUNTABLE_T_CPP */ - diff --git a/dep/include/ace/Refcountable_T.h b/externals/ace/Refcountable_T.h similarity index 99% rename from dep/include/ace/Refcountable_T.h rename to externals/ace/Refcountable_T.h index c18781f7954..36e4c508d6e 100644 --- a/dep/include/ace/Refcountable_T.h +++ b/externals/ace/Refcountable_T.h @@ -65,4 +65,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_REFCOUNTABLE_T_H*/ - diff --git a/dep/include/ace/Refcountable_T.inl b/externals/ace/Refcountable_T.inl similarity index 100% rename from dep/include/ace/Refcountable_T.inl rename to externals/ace/Refcountable_T.inl diff --git a/dep/src/ace/Refcounted_Auto_Ptr.cpp b/externals/ace/Refcounted_Auto_Ptr.cpp similarity index 99% rename from dep/src/ace/Refcounted_Auto_Ptr.cpp rename to externals/ace/Refcounted_Auto_Ptr.cpp index 483552b15d6..c43bcc7b933 100644 --- a/dep/src/ace/Refcounted_Auto_Ptr.cpp +++ b/externals/ace/Refcounted_Auto_Ptr.cpp @@ -16,4 +16,3 @@ ACE_Refcounted_Auto_Ptr::~ACE_Refcounted_Auto_Ptr (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_REFCOUNTED_AUTO_PTR_CPP */ - diff --git a/dep/include/ace/Refcounted_Auto_Ptr.h b/externals/ace/Refcounted_Auto_Ptr.h similarity index 99% rename from dep/include/ace/Refcounted_Auto_Ptr.h rename to externals/ace/Refcounted_Auto_Ptr.h index 43f639e8516..b766d73063e 100644 --- a/dep/include/ace/Refcounted_Auto_Ptr.h +++ b/externals/ace/Refcounted_Auto_Ptr.h @@ -197,4 +197,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REFCOUNTED_AUTO_PTR_H */ - diff --git a/dep/include/ace/Refcounted_Auto_Ptr.inl b/externals/ace/Refcounted_Auto_Ptr.inl similarity index 100% rename from dep/include/ace/Refcounted_Auto_Ptr.inl rename to externals/ace/Refcounted_Auto_Ptr.inl diff --git a/dep/src/ace/Registry.cpp b/externals/ace/Registry.cpp similarity index 98% rename from dep/src/ace/Registry.cpp rename to externals/ace/Registry.cpp index 5244f9feb16..3178095afef 100644 --- a/dep/src/ace/Registry.cpp +++ b/externals/ace/Registry.cpp @@ -1,10 +1,10 @@ -// $Id: Registry.cpp 82435 2008-07-28 11:53:42Z johnnyw $ +// $Id: Registry.cpp 88568 2010-01-15 10:23:25Z olli $ #include "ace/Registry.h" ACE_RCSID (ace, Registry, - "$Id: Registry.cpp 82435 2008-07-28 11:53:42Z johnnyw $") + "$Id: Registry.cpp 88568 2010-01-15 10:23:25Z olli $") #if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY) @@ -24,6 +24,7 @@ ACE_RCSID (ace, return 0; \ } while (0) + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_TCHAR const ACE_Registry::STRING_SEPARATOR[] = ACE_TEXT ("\\"); @@ -49,6 +50,7 @@ ACE_Registry::Binding::Binding () { } + // Binding constructor // (Name version) ACE_Registry::Binding::Binding (const Name &name, @@ -58,6 +60,7 @@ ACE_Registry::Binding::Binding (const Name &name, { } + // Binding constructor // (String version) ACE_Registry::Binding::Binding (const ACE_TString &name, @@ -67,6 +70,7 @@ ACE_Registry::Binding::Binding (const ACE_TString &name, { } + bool ACE_Registry::Binding::operator== (const Binding &rhs) const { @@ -89,6 +93,7 @@ ACE_Registry::Binding::name (Name &name) name = ACE_Registry::make_name (this->name_); } + // Name accessors // (String version) void @@ -97,6 +102,7 @@ ACE_Registry::Binding::name (ACE_TString &name) name = this->name_; } + // Name accessors // (String version) ACE_TString @@ -105,6 +111,7 @@ ACE_Registry::Binding::name (void) return this->name_; } + // Type accessor ACE_Registry::Binding_Type ACE_Registry::Binding::type (void) @@ -112,6 +119,7 @@ ACE_Registry::Binding::type (void) return this->type_; } + // Simple object constructor ACE_Registry::Object::Object (void *data, u_long size, @@ -129,36 +137,42 @@ ACE_Registry::Object::data (void *data) this->data_ = data; } + void * ACE_Registry::Object::data (void) const { return this->data_; } + void ACE_Registry::Object::size (u_long size) { this->size_ = size; } + u_long ACE_Registry::Object::size (void) const { return this->size_; } + void ACE_Registry::Object::type (u_long type) { this->type_ = type; } + u_long ACE_Registry::Object::type (void) const { return this->type_; } + // Simple context constructor ACE_Registry::Naming_Context::Naming_Context (void) : key_ ((HKEY) 0), @@ -167,6 +181,7 @@ ACE_Registry::Naming_Context::Naming_Context (void) { } + // Context constructor ACE_Registry::Naming_Context::Naming_Context (const HKEY &key) : key_ (key), @@ -175,6 +190,7 @@ ACE_Registry::Naming_Context::Naming_Context (const HKEY &key) { } + ACE_Registry::Naming_Context::Naming_Context (const Naming_Context &rhs) : key_ (rhs.key_), parent_key_ (rhs.parent_key_), @@ -185,6 +201,7 @@ ACE_Registry::Naming_Context::Naming_Context (const Naming_Context &rhs) // But since this is private (and not used), I don't care much } + const ACE_Registry::Naming_Context & ACE_Registry::Naming_Context::operator= (const Naming_Context &rhs) { @@ -194,12 +211,14 @@ ACE_Registry::Naming_Context::operator= (const Naming_Context &rhs) return *this; } + // Destructor ACE_Registry::Naming_Context::~Naming_Context () { this->close (); } + // Insert with into context // (Name version) int @@ -209,6 +228,7 @@ ACE_Registry::Naming_Context::bind_new (const Name &name, return this->bind_new (ACE_Registry::make_string (name), object); } + // Insert with into context // (String version) int @@ -227,6 +247,7 @@ ACE_Registry::Naming_Context::bind_new (const ACE_TString &name, return result; } + // Insert or update with into context // (Name version) int @@ -236,6 +257,7 @@ ACE_Registry::Naming_Context::bind (const Name &name, return this->bind (ACE_Registry::make_string (name), object); } + // Insert or update with into context // (String version) int @@ -251,6 +273,7 @@ ACE_Registry::Naming_Context::bind (const ACE_TString &name, ACE_REGISTRY_CALL_RETURN (result); } + // Update with in context // (Name version) int @@ -260,6 +283,7 @@ ACE_Registry::Naming_Context::rebind (const Name &name, return this->rebind (ACE_Registry::make_string (name), new_object); } + // Update with in context // (String version) int @@ -275,6 +299,7 @@ ACE_Registry::Naming_Context::rebind (const ACE_TString &name, return result; } + // Find with in context // (Name version) int @@ -284,6 +309,7 @@ ACE_Registry::Naming_Context::resolve (const Name &name, return this->resolve (ACE_Registry::make_string (name), object); } + // Find with in context // (String version) int @@ -312,6 +338,7 @@ ACE_Registry::Naming_Context::resolve (const ACE_TString &name, ACE_REGISTRY_CALL_RETURN (result); } + // Remove object with in context // (Name version) int @@ -320,6 +347,7 @@ ACE_Registry::Naming_Context::unbind (const Name &name) return this->unbind (ACE_Registry::make_string (name)); } + // Remove object with in context // (String version) int @@ -331,6 +359,7 @@ ACE_Registry::Naming_Context::unbind (const ACE_TString &name) ACE_REGISTRY_CALL_RETURN (result); } + // Create new relative to context // This method may not mean a lot in this implementation int @@ -340,6 +369,7 @@ ACE_Registry::Naming_Context::new_context (Naming_Context &naming_context) return naming_context.close (); } + // Insert with relative to context // (Name version) int @@ -356,6 +386,7 @@ ACE_Registry::Naming_Context::bind_new_context (const Name &name, security_attributes); } + // Insert with relative to context // (String version) int @@ -403,6 +434,7 @@ ACE_Registry::Naming_Context::bind_new_context (const ACE_TString &name, ACE_REGISTRY_CALL_RETURN (result); } + // Insert or update with relative to context // (Name version) int @@ -419,6 +451,7 @@ ACE_Registry::Naming_Context::bind_context (const Name &name, security_attributes); } + // Insert or update with relative to context // (String version) int @@ -450,6 +483,7 @@ ACE_Registry::Naming_Context::bind_context (const ACE_TString &name, ACE_REGISTRY_CALL_RETURN (result); } + // Rename to // (Name version) int @@ -460,6 +494,7 @@ ACE_Registry::Naming_Context::rebind_context (const Name &name, new_naming_context); } + // Rename to // (String version) int @@ -485,6 +520,7 @@ ACE_Registry::Naming_Context::rebind_context (const ACE_TString &name, return result; } + // Remove naming_context with from context // (Name version) int @@ -493,6 +529,7 @@ ACE_Registry::Naming_Context::unbind_context (const Name &name) return this->unbind_context (ACE_Registry::make_string (name)); } + // Remove naming_context with from context // (String version) int @@ -504,6 +541,7 @@ ACE_Registry::Naming_Context::unbind_context (const ACE_TString &name) ACE_REGISTRY_CALL_RETURN (result); } + // Find with in context // (Name version) int @@ -516,6 +554,7 @@ ACE_Registry::Naming_Context::resolve_context (const Name &name, security_access); } + // Find with in context // (String version) int @@ -539,6 +578,7 @@ ACE_Registry::Naming_Context::resolve_context (const ACE_TString &name, ACE_REGISTRY_CALL_RETURN (result); } + // Same as unbind_context() with as naming_context int ACE_Registry::Naming_Context::destroy (void) @@ -550,6 +590,7 @@ ACE_Registry::Naming_Context::destroy (void) ACE_REGISTRY_CALL_RETURN (result); } + // Sync content of context to disk int ACE_Registry::Naming_Context::flush (void) @@ -558,6 +599,7 @@ ACE_Registry::Naming_Context::flush (void) ACE_REGISTRY_CALL_RETURN (result); } + // Close the handle of the context int ACE_Registry::Naming_Context::close (void) @@ -566,6 +608,7 @@ ACE_Registry::Naming_Context::close (void) ACE_REGISTRY_CALL_RETURN (result); } + // Convert a to a ACE_TString ACE_Registry::make_string (const Name &const_name) @@ -589,6 +632,7 @@ ACE_Registry::make_string (const Name &const_name) return string; } + // Convert a to a ACE_Registry::Name ACE_Registry::make_name (const ACE_TString &string) @@ -627,6 +671,7 @@ ACE_Registry::make_name (const ACE_TString &string) return name; } + // Set key void ACE_Registry::Naming_Context::key (HKEY key) @@ -634,6 +679,7 @@ ACE_Registry::Naming_Context::key (HKEY key) this->key_ = key; } + // Get key HKEY ACE_Registry::Naming_Context::key (void) @@ -641,6 +687,7 @@ ACE_Registry::Naming_Context::key (void) return this->key_; } + // Set parent void ACE_Registry::Naming_Context::parent (HKEY parent) @@ -648,6 +695,7 @@ ACE_Registry::Naming_Context::parent (HKEY parent) this->parent_key_ = parent; } + // Get parent HKEY ACE_Registry::Naming_Context::parent (void) @@ -655,6 +703,7 @@ ACE_Registry::Naming_Context::parent (void) return this->parent_key_; } + // Set name // (Name version) void @@ -663,6 +712,7 @@ ACE_Registry::Naming_Context::name (const Name &name) this->name_ = ACE_Registry::make_string (name); } + // Get name // (Name version) void @@ -671,6 +721,7 @@ ACE_Registry::Naming_Context::name (Name &name) name = ACE_Registry::make_name (this->name_); } + // Set name // (String version) void @@ -679,6 +730,7 @@ ACE_Registry::Naming_Context::name (const ACE_TString &name) this->name_ = name; } + // Get name // (String version) ACE_TString @@ -687,6 +739,7 @@ ACE_Registry::Naming_Context::name (void) return this->name_; } + // Get name // (String version) void @@ -723,6 +776,7 @@ ACE_Registry::Naming_Context::list (u_long how_many, return iter.next_n (how_many, list); } + // listing function: iterator creator // This gives back a listing of all entries in context. int @@ -753,6 +807,7 @@ ACE_Registry::Naming_Context::list (Binding_List &list) return 0; } + // Default constructor ACE_Registry::Binding_Iterator::Binding_Iterator () { @@ -762,6 +817,7 @@ ACE_Registry::Binding_Iterator::Binding_Iterator () this->reset (); } + void ACE_Registry::Binding_Iterator::reset () { @@ -771,23 +827,30 @@ ACE_Registry::Binding_Iterator::reset () this->context_iteration_.reset (); } + void ACE_Registry::Binding_Iterator::Iteration_State::reset () { this->index_ = 0; } + void ACE_Registry::Binding_Iterator::Iteration_State::iterator (Binding_Iterator *iter) { this->parent_ = iter; } -ACE_Registry::Binding_Iterator::Iteration_State::Iteration_State () + +ACE_Registry::Binding_Iterator::Iteration_State::Iteration_State (void) : index_ (0) { } +ACE_Registry::Binding_Iterator::Iteration_State::~Iteration_State (void) +{ +} + // Next entry int ACE_Registry::Binding_Iterator::next_one (Binding &binding) @@ -805,6 +868,7 @@ ACE_Registry::Binding_Iterator::next_one (Binding &binding) return result; } + // Next entries int ACE_Registry::Binding_Iterator::next_n (u_long how_many, @@ -816,6 +880,7 @@ ACE_Registry::Binding_Iterator::next_n (u_long how_many, return this->current_enumeration_->next_n (how_many, list); } + // Destroy iterator int ACE_Registry::Binding_Iterator::destroy (void) @@ -824,6 +889,7 @@ ACE_Registry::Binding_Iterator::destroy (void) return 0; } + // Set/Get naming_context void ACE_Registry::Binding_Iterator::naming_context (Naming_Context &naming_context) @@ -831,12 +897,14 @@ ACE_Registry::Binding_Iterator::naming_context (Naming_Context &naming_context) this->naming_context_ = &naming_context; } + ACE_Registry::Naming_Context & ACE_Registry::Binding_Iterator::naming_context (void) { return *this->naming_context_; } + // Set/Get current enumeration void ACE_Registry::Binding_Iterator::current_enumeration (Iteration_State ¤t_enumeration) @@ -844,12 +912,14 @@ ACE_Registry::Binding_Iterator::current_enumeration (Iteration_State ¤t_en this->current_enumeration_ = ¤t_enumeration; } + ACE_Registry::Binding_Iterator::Iteration_State & ACE_Registry::Binding_Iterator::current_enumeration (void) { return *this->current_enumeration_; } + int ACE_Registry::Binding_Iterator::Object_Iteration::next_n (u_long how_many, Binding_List &list) @@ -919,6 +989,7 @@ ACE_Registry::Binding_Iterator::Object_Iteration::next_n (u_long how_many, return 0; } + int ACE_Registry::Binding_Iterator::Context_Iteration::next_n (u_long how_many, Binding_List &list) @@ -983,6 +1054,7 @@ ACE_Registry::Binding_Iterator::Context_Iteration::next_n (u_long how_many, return 0; } + int ACE_Registry::Binding_Iterator::Iteration_Complete::next_n (u_long how_many, Binding_List &list) @@ -994,6 +1066,7 @@ ACE_Registry::Binding_Iterator::Iteration_Complete::next_n (u_long how_many, return -1; } + // Factory method to connect to predefined registries // This method works for both remote and local machines // However, for remote machines CLASSES_ROOT and CURRENT_USER @@ -1005,6 +1078,9 @@ ACE_Predefined_Naming_Contexts::connect (ACE_Registry::Naming_Context &naming_co const ACE_TCHAR *machine_name) { #if defined (ACE_HAS_WINCE) + ACE_UNUSED_ARG(naming_context); + ACE_UNUSED_ARG(predefined); + ACE_UNUSED_ARG(machine_name); return -1; #else long result = -1; @@ -1018,6 +1094,7 @@ ACE_Predefined_Naming_Contexts::connect (ACE_Registry::Naming_Context &naming_co predefined, &naming_context.key_); if (predefined == HKEY_CURRENT_USER || predefined == HKEY_CLASSES_ROOT) + { // Make sure that for these types, the machine is local if (machine_name == 0 || ACE_Predefined_Naming_Contexts::is_local_host (machine_name)) @@ -1027,6 +1104,7 @@ ACE_Predefined_Naming_Contexts::connect (ACE_Registry::Naming_Context &naming_co } else result = -1; + } ACE_REGISTRY_CALL_RETURN (result); #endif // ACE_HAS_WINCE @@ -1049,4 +1127,3 @@ ACE_Predefined_Naming_Contexts::is_local_host (const ACE_TCHAR *machine_name) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_REGISTRY */ - diff --git a/dep/include/ace/Registry.h b/externals/ace/Registry.h similarity index 98% rename from dep/include/ace/Registry.h rename to externals/ace/Registry.h index f3521829c2a..8b7f6a1ed79 100644 --- a/dep/include/ace/Registry.h +++ b/externals/ace/Registry.h @@ -4,12 +4,13 @@ /** * @file Registry.h * - * $Id: Registry.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Registry.h 85110 2009-04-20 09:18:43Z msmit $ * * @author Irfan Pyarali (irfan@cs.wustl.edu) */ //============================================================================= + #ifndef ACE_REGISTRY_H #define ACE_REGISTRY_H #include /**/ "ace/pre.h" @@ -257,6 +258,7 @@ public: /// Delete object with @a name in @c this context int unbind (const ACE_TString &name); + // The following interfaces are for Naming Context /// Create new @c naming_context @@ -458,7 +460,10 @@ public: { public: /// Constructor - Iteration_State (); + Iteration_State (void); + + /// Destructor + virtual ~Iteration_State (void); /// Set the iterator reference. void iterator (Binding_Iterator *iterator); @@ -555,4 +560,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 && !ACE_LACKS_WIN32_REGISTRY */ #include /**/ "ace/post.h" #endif /* ACE_REGISTRY_H */ - diff --git a/dep/src/ace/Registry_Name_Space.cpp b/externals/ace/Registry_Name_Space.cpp similarity index 95% rename from dep/src/ace/Registry_Name_Space.cpp rename to externals/ace/Registry_Name_Space.cpp index bfb27ef7dc5..ce0099ba231 100644 --- a/dep/src/ace/Registry_Name_Space.cpp +++ b/externals/ace/Registry_Name_Space.cpp @@ -1,8 +1,8 @@ -// $Id: Registry_Name_Space.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Registry_Name_Space.cpp 84455 2009-02-13 13:31:02Z johnnyw $ #include "ace/Registry_Name_Space.h" -ACE_RCSID(ace, Registry_Name_Space, "$Id: Registry_Name_Space.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Registry_Name_Space, "$Id: Registry_Name_Space.cpp 84455 2009-02-13 13:31:02Z johnnyw $") #if (defined (ACE_WIN32) && defined (ACE_USES_WCHAR)) // This only works on Win32 platforms when ACE_USES_WCHAR is turned on @@ -20,10 +20,12 @@ ACE_Registry_Name_Space::ACE_Registry_Name_Space (ACE_Name_Options *name_options ACE_TEXT ("ACE_Registry_Name_Space::open"))); } + ACE_Registry_Name_Space::~ACE_Registry_Name_Space (void) { } + int ACE_Registry_Name_Space::open (ACE_Name_Options *name_options) { @@ -55,6 +57,7 @@ ACE_Registry_Name_Space::open (ACE_Name_Options *name_options) return 0; } + int ACE_Registry_Name_Space::bind (const ACE_NS_WString &name, const ACE_NS_WString &value, @@ -82,6 +85,7 @@ ACE_Registry_Name_Space::bind (const ACE_NS_WString &name, #endif /* ACE_HAS_WCHAR */ } + int ACE_Registry_Name_Space::rebind (const ACE_NS_WString &name, const ACE_NS_WString &value, @@ -109,6 +113,7 @@ ACE_Registry_Name_Space::rebind (const ACE_NS_WString &name, #endif /* ACE_USES_WCHAR */ } + int ACE_Registry_Name_Space::unbind (const ACE_NS_WString &name) { @@ -119,6 +124,7 @@ ACE_Registry_Name_Space::unbind (const ACE_NS_WString &name) #endif /* ACE_USES_WCHAR */ } + int ACE_Registry_Name_Space::resolve (const ACE_NS_WString &name, ACE_NS_WString &value, @@ -160,6 +166,7 @@ ACE_Registry_Name_Space::resolve (const ACE_NS_WString &name, return 0; } + int ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, const ACE_NS_WString &pattern) @@ -181,6 +188,7 @@ ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, return 0; } + int ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, const ACE_NS_WString &pattern) @@ -202,6 +210,7 @@ ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, return 0; } + int ACE_Registry_Name_Space::list_types (ACE_WSTRING_SET &set, const ACE_NS_WString &pattern) @@ -212,6 +221,7 @@ ACE_Registry_Name_Space::list_types (ACE_WSTRING_SET &set, return 0; } + int ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, const ACE_NS_WString &pattern) @@ -244,7 +254,10 @@ ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, value, type); if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Registry::Naming_Context::resolve")), result); + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("ACE_Registry::Naming_Context::resolve")), + result); // Complete binding ACE_Name_Binding binding (key, value, type); @@ -254,6 +267,7 @@ ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, return 0; } + int ACE_Registry_Name_Space::list_value_entries (ACE_BINDING_SET &set, const ACE_NS_WString &pattern) @@ -261,6 +275,7 @@ ACE_Registry_Name_Space::list_value_entries (ACE_BINDING_SET &set, return this->list_name_entries (set, pattern); } + int ACE_Registry_Name_Space::list_type_entries (ACE_BINDING_SET &set, const ACE_NS_WString &pattern) @@ -268,6 +283,7 @@ ACE_Registry_Name_Space::list_type_entries (ACE_BINDING_SET &set, return this->list_name_entries (set, pattern); } + void ACE_Registry_Name_Space::dump (void) const { @@ -278,4 +294,3 @@ ACE_Registry_Name_Space::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 && ACE_USES_WCHAR */ - diff --git a/dep/include/ace/Registry_Name_Space.h b/externals/ace/Registry_Name_Space.h similarity index 100% rename from dep/include/ace/Registry_Name_Space.h rename to externals/ace/Registry_Name_Space.h index 213856bd17d..6e37419e8d1 100644 --- a/dep/include/ace/Registry_Name_Space.h +++ b/externals/ace/Registry_Name_Space.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_REGISTRY_NAME_SPACE_H #define ACE_REGISTRY_NAME_SPACE_H #include /**/ "ace/pre.h" @@ -137,4 +138,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REGISTRY_NAME_SPACE_H */ - diff --git a/dep/src/ace/Remote_Name_Space.cpp b/externals/ace/Remote_Name_Space.cpp similarity index 99% rename from dep/src/ace/Remote_Name_Space.cpp rename to externals/ace/Remote_Name_Space.cpp index 5d609ec86ce..afbfd360f21 100644 --- a/dep/src/ace/Remote_Name_Space.cpp +++ b/externals/ace/Remote_Name_Space.cpp @@ -378,4 +378,3 @@ ACE_Remote_Name_Space::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Remote_Name_Space.h b/externals/ace/Remote_Name_Space.h similarity index 100% rename from dep/include/ace/Remote_Name_Space.h rename to externals/ace/Remote_Name_Space.h index ea9e43a90c0..683f36c7963 100644 --- a/dep/include/ace/Remote_Name_Space.h +++ b/externals/ace/Remote_Name_Space.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_REMOTE_NAME_SPACE_H #define ACE_REMOTE_NAME_SPACE_H @@ -144,4 +145,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REMOTE_NAME_SPACE_H */ - diff --git a/dep/src/ace/Remote_Tokens.cpp b/externals/ace/Remote_Tokens.cpp similarity index 97% rename from dep/src/ace/Remote_Tokens.cpp rename to externals/ace/Remote_Tokens.cpp index 560307b5550..56943ba30ea 100644 --- a/dep/src/ace/Remote_Tokens.cpp +++ b/externals/ace/Remote_Tokens.cpp @@ -1,4 +1,4 @@ -// $Id: Remote_Tokens.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Remote_Tokens.cpp 84455 2009-02-13 13:31:02Z johnnyw $ #include "ace/Remote_Tokens.h" @@ -10,9 +10,11 @@ #include "ace/Remote_Tokens.inl" #endif /* __ACE_INLINE__ */ + ACE_RCSID (ace, Remote_Tokens, - "$Id: Remote_Tokens.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Remote_Tokens.cpp 84455 2009-02-13 13:31:02Z johnnyw $") + #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) #define ACE_TSS_CONNECTION_MUTEX ACE_Thread_Mutex @@ -155,12 +157,16 @@ ACE_Remote_Token_Proxy::request_reply (ACE_Token_Request &request, ACE_SOCK_Stream *peer = ACE_Token_Connections::instance ()->get_connection (); if (peer == 0) - ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "BIG PROBLEMS with get_connection"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT("(%P|%t) %p\n"), + ACE_TEXT("BIG PROBLEMS with get_connection")), -1); // Transmit request via a blocking send. if (peer->send_n (buffer, length) != length) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("send_n failed")), -1); + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("send_n failed")), -1); else { ACE_Token_Reply reply; @@ -478,6 +484,7 @@ ACE_Remote_RLock::dump (void) const #endif /* ACE_HAS_DUMP */ } + ACE_Tokens * ACE_Remote_WLock::create_token (const ACE_TCHAR *name) { @@ -522,4 +529,3 @@ ACE_Remote_WLock::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/include/ace/Remote_Tokens.h b/externals/ace/Remote_Tokens.h similarity index 100% rename from dep/include/ace/Remote_Tokens.h rename to externals/ace/Remote_Tokens.h index 77d0acc69d6..0014a3f5552 100644 --- a/dep/include/ace/Remote_Tokens.h +++ b/externals/ace/Remote_Tokens.h @@ -63,6 +63,7 @@ public: int ignore_deadlock = 0, int debug = 0); + /** * Open a connection with the token server. This only need be used * when the user wishes to explicitly open a connection to check if @@ -319,4 +320,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REMOTE_TOKEN_H */ - diff --git a/dep/include/ace/Remote_Tokens.inl b/externals/ace/Remote_Tokens.inl similarity index 100% rename from dep/include/ace/Remote_Tokens.inl rename to externals/ace/Remote_Tokens.inl diff --git a/dep/src/ace/Reverse_Lock_T.cpp b/externals/ace/Reverse_Lock_T.cpp similarity index 99% rename from dep/src/ace/Reverse_Lock_T.cpp rename to externals/ace/Reverse_Lock_T.cpp index 6d2337727ee..b8f6255dbc0 100644 --- a/dep/src/ace/Reverse_Lock_T.cpp +++ b/externals/ace/Reverse_Lock_T.cpp @@ -91,4 +91,3 @@ ACE_Reverse_Lock::tryacquire_write_upgrade (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_REVERSE_LOCK_T_CPP */ - diff --git a/dep/include/ace/Reverse_Lock_T.h b/externals/ace/Reverse_Lock_T.h similarity index 96% rename from dep/include/ace/Reverse_Lock_T.h rename to externals/ace/Reverse_Lock_T.h index 979ee34ce63..48b6bbed000 100644 --- a/dep/include/ace/Reverse_Lock_T.h +++ b/externals/ace/Reverse_Lock_T.h @@ -4,7 +4,7 @@ /** * @file Reverse_Lock_T.h * - * $Id: Reverse_Lock_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Reverse_Lock_T.h 84481 2009-02-17 10:58:31Z johnnyw $ * * Moved from Synch.h. * @@ -77,7 +77,7 @@ public: // = Initialization/Finalization methods. - /// Constructor. All locking requests will be forwarded to . + /// Constructor. All locking requests will be forwarded to @a lock. ACE_Reverse_Lock (ACE_LOCKING_MECHANISM &lock, ACE_Acquire_Method::METHOD_TYPE acquire_method = ACE_Acquire_Method::ACE_REGULAR); @@ -137,4 +137,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_REVERSE_LOCK_T_H */ - diff --git a/dep/include/ace/Reverse_Lock_T.inl b/externals/ace/Reverse_Lock_T.inl similarity index 100% rename from dep/include/ace/Reverse_Lock_T.inl rename to externals/ace/Reverse_Lock_T.inl diff --git a/dep/src/ace/Rtems_init.c b/externals/ace/Rtems_init.c similarity index 100% rename from dep/src/ace/Rtems_init.c rename to externals/ace/Rtems_init.c diff --git a/dep/src/ace/SOCK.cpp b/externals/ace/SOCK.cpp similarity index 99% rename from dep/src/ace/SOCK.cpp rename to externals/ace/SOCK.cpp index 555e5876873..b5b38ced073 100644 --- a/dep/src/ace/SOCK.cpp +++ b/externals/ace/SOCK.cpp @@ -183,4 +183,3 @@ ACE_SOCK::ACE_SOCK (int type, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK.h b/externals/ace/SOCK.h similarity index 98% rename from dep/include/ace/SOCK.h rename to externals/ace/SOCK.h index 3d8b13cf24f..d37e68b2954 100644 --- a/dep/include/ace/SOCK.h +++ b/externals/ace/SOCK.h @@ -4,7 +4,7 @@ /** * @file SOCK.h * - * $Id: SOCK.h 81014 2008-03-19 11:41:31Z johnnyw $ + * $Id: SOCK.h 84834 2009-03-16 12:28:51Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -125,7 +125,6 @@ protected: * pointer/reference. */ ~ACE_SOCK (void); - }; ACE_END_VERSIONED_NAMESPACE_DECL @@ -136,4 +135,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_H */ - diff --git a/dep/include/ace/SOCK.inl b/externals/ace/SOCK.inl similarity index 100% rename from dep/include/ace/SOCK.inl rename to externals/ace/SOCK.inl diff --git a/dep/src/ace/SOCK_Acceptor.cpp b/externals/ace/SOCK_Acceptor.cpp similarity index 95% rename from dep/src/ace/SOCK_Acceptor.cpp rename to externals/ace/SOCK_Acceptor.cpp index 3dd98cbd335..9c6df6328f2 100644 --- a/dep/src/ace/SOCK_Acceptor.cpp +++ b/externals/ace/SOCK_Acceptor.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/SOCK_Acceptor.h" @@ -16,7 +16,7 @@ #include "ace/OS_QoS.h" #endif // ACE_HAS_WINCE -ACE_RCSID(ace, SOCK_Acceptor, "$Id: SOCK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, SOCK_Acceptor, "$Id: SOCK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -33,7 +33,7 @@ ACE_SOCK_Acceptor::ACE_SOCK_Acceptor (void) int ACE_SOCK_Acceptor::shared_accept_start (ACE_Time_Value *timeout, - int restart, + bool restart, int &in_blocking_mode) const { ACE_TRACE ("ACE_SOCK_Acceptor::shared_accept_start"); @@ -66,7 +66,7 @@ ACE_SOCK_Acceptor::shared_accept_start (ACE_Time_Value *timeout, int ACE_SOCK_Acceptor::shared_accept_finish (ACE_SOCK_Stream new_stream, int in_blocking_mode, - int reset_new_handle) const + bool reset_new_handle) const { ACE_TRACE ("ACE_SOCK_Acceptor::shared_accept_finish ()"); @@ -105,8 +105,8 @@ int ACE_SOCK_Acceptor::accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { ACE_TRACE ("ACE_SOCK_Acceptor::accept"); @@ -135,7 +135,7 @@ ACE_SOCK_Acceptor::accept (ACE_SOCK_Stream &new_stream, addr, len_ptr)); while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 + && restart && errno == EINTR && timeout == 0); @@ -161,8 +161,8 @@ ACE_SOCK_Acceptor::accept (ACE_SOCK_Stream &new_stream, ACE_Accept_QoS_Params qos_params, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { ACE_TRACE ("ACE_SOCK_Acceptor::accept"); @@ -192,7 +192,7 @@ ACE_SOCK_Acceptor::accept (ACE_SOCK_Stream &new_stream, len_ptr, qos_params)); while (new_stream.get_handle () == ACE_INVALID_HANDLE - && restart != 0 + && restart && errno == EINTR && timeout == 0); @@ -404,4 +404,3 @@ ACE_SOCK_Acceptor::close (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_Acceptor.h b/externals/ace/SOCK_Acceptor.h similarity index 91% rename from dep/include/ace/SOCK_Acceptor.h rename to externals/ace/SOCK_Acceptor.h index e854ec07737..79d3adefe42 100644 --- a/dep/include/ace/SOCK_Acceptor.h +++ b/externals/ace/SOCK_Acceptor.h @@ -4,7 +4,7 @@ /** * @file SOCK_Acceptor.h * - * $Id: SOCK_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SOCK_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -99,8 +99,8 @@ public: // = Passive connection methods. /** * Accept a new ACE_SOCK_Stream connection. A @a timeout of 0 - * means block forever, a @a timeout of {0, 0} means poll. - * == 1 means "restart if interrupted," i.e., if errno == EINTR. + * means block forever, a @a timeout of {0, 0} means poll. @a restart + * == true means "restart if interrupted," i.e., if errno == EINTR. * Note that @a new_stream inherits the "blocking mode" of @c this * ACE_SOCK_Acceptor, i.e., if @c this acceptor factory is in * non-blocking mode, the @a new_stream will be in non-blocking mode @@ -109,14 +109,14 @@ public: int accept (ACE_SOCK_Stream &new_stream, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; #if !defined (ACE_HAS_WINCE) /** * Accept a new ACE_SOCK_Stream connection using the QoS * information in @a qos_params. A @a timeout of 0 means block - * forever, a @a timeout of {0, 0} means poll. @a restart == 1 means + * forever, a @a timeout of {0, 0} means poll. @a restart == true means * "restart if interrupted," i.e., if errno == EINTR. Note that * @a new_stream inherits the "blocking mode" of @c this * ACE_SOCK_Acceptor, i.e., if @c this acceptor factory is in @@ -127,8 +127,8 @@ public: ACE_Accept_QoS_Params qos_params, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; #endif // ACE_HAS_WINCE // = Meta-type info @@ -145,14 +145,14 @@ protected: /// Perform operations that must occur before is /// called. int shared_accept_start (ACE_Time_Value *timeout, - int restart, + bool restart, int &in_blocking_mode) const; /// Perform operations that must occur after is /// called. int shared_accept_finish (ACE_SOCK_Stream new_stream, int in_blocking_mode, - int reset_new_handle) const; + bool reset_new_handle) const; /** * This method factors out the common code and is called by @@ -176,4 +176,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_ACCEPTOR_H */ - diff --git a/dep/include/ace/SOCK_Acceptor.inl b/externals/ace/SOCK_Acceptor.inl similarity index 100% rename from dep/include/ace/SOCK_Acceptor.inl rename to externals/ace/SOCK_Acceptor.inl diff --git a/dep/src/ace/SOCK_CODgram.cpp b/externals/ace/SOCK_CODgram.cpp similarity index 99% rename from dep/src/ace/SOCK_CODgram.cpp rename to externals/ace/SOCK_CODgram.cpp index 97fb7ec0391..7babdad8e9d 100644 --- a/dep/src/ace/SOCK_CODgram.cpp +++ b/externals/ace/SOCK_CODgram.cpp @@ -149,4 +149,3 @@ ACE_SOCK_CODgram::open (const ACE_Addr &remote, const ACE_Addr &local, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_CODgram.h b/externals/ace/SOCK_CODgram.h similarity index 100% rename from dep/include/ace/SOCK_CODgram.h rename to externals/ace/SOCK_CODgram.h index b7641fccb19..0788f871091 100644 --- a/dep/include/ace/SOCK_CODgram.h +++ b/externals/ace/SOCK_CODgram.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_SOCK_CODGRAM_H #define ACE_SOCK_CODGRAM_H #include /**/ "ace/pre.h" @@ -140,4 +141,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_CODGRAM_H */ - diff --git a/dep/include/ace/SOCK_CODgram.inl b/externals/ace/SOCK_CODgram.inl similarity index 100% rename from dep/include/ace/SOCK_CODgram.inl rename to externals/ace/SOCK_CODgram.inl diff --git a/dep/src/ace/SOCK_Connector.cpp b/externals/ace/SOCK_Connector.cpp similarity index 95% rename from dep/src/ace/SOCK_Connector.cpp rename to externals/ace/SOCK_Connector.cpp index df09a46b4d2..641caea7e48 100644 --- a/dep/src/ace/SOCK_Connector.cpp +++ b/externals/ace/SOCK_Connector.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_Connector.cpp 83891 2008-11-28 11:01:50Z johnnyw $ #include "ace/SOCK_Connector.h" #include "ace/INET_Addr.h" @@ -15,7 +15,7 @@ #include "ace/SOCK_Connector.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, SOCK_Connector, "$Id: SOCK_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, SOCK_Connector, "$Id: SOCK_Connector.cpp 83891 2008-11-28 11:01:50Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -97,8 +97,7 @@ ACE_SOCK_Connector::shared_connect_start (ACE_SOCK_Stream &new_stream, } // Enable non-blocking, if required. - if (timeout != 0 - && new_stream.enable (ACE_NONBLOCK) == -1) + if (timeout != 0 && new_stream.enable (ACE_NONBLOCK) == -1) return -1; else return 0; @@ -119,8 +118,7 @@ ACE_SOCK_Connector::shared_connect_finish (ACE_SOCK_Stream &new_stream, if (error == EINPROGRESS || error == EWOULDBLOCK) { // This expression checks if we were polling. - if (timeout->sec () == 0 - && timeout->usec () == 0) + if (*timeout == ACE_Time_Value::zero) { #if defined(ACE_WIN32) // In order to detect when the socket that has been @@ -164,10 +162,18 @@ ACE_SOCK_Connector::shared_connect_finish (ACE_SOCK_Stream &new_stream, // EISCONN is treated specially since this routine may be used to // check if we are already connected. if (result != -1 || error == EISCONN) - // Start out with non-blocking disabled on the . - new_stream.disable (ACE_NONBLOCK); + { + // Start out with non-blocking disabled on the new_stream. + result = new_stream.disable (ACE_NONBLOCK); + if (result == -1) + { + new_stream.close (); + } + } else if (!(error == EWOULDBLOCK || error == ETIMEDOUT)) - new_stream.close (); + { + new_stream.close (); + } return result; } @@ -357,4 +363,3 @@ ACE_SOCK_Connector::ACE_SOCK_Connector (ACE_SOCK_Stream &new_stream, #endif // ACE_HAS_WINCE ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_Connector.h b/externals/ace/SOCK_Connector.h similarity index 97% rename from dep/include/ace/SOCK_Connector.h rename to externals/ace/SOCK_Connector.h index 9b77e7d61dd..98ec8862f91 100644 --- a/dep/include/ace/SOCK_Connector.h +++ b/externals/ace/SOCK_Connector.h @@ -4,7 +4,7 @@ /** * @file SOCK_Connector.h * - * $Id: SOCK_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SOCK_Connector.h 84816 2009-03-13 08:16:32Z johnnyw $ * * @author Doug Schmidt */ @@ -71,7 +71,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -121,7 +121,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -168,7 +168,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -222,7 +222,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -270,7 +270,7 @@ public: const ACE_Time_Value *timeout = 0); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); // = Meta-type info typedef ACE_INET_Addr PEER_ADDR; @@ -319,4 +319,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_CONNECTOR_H */ - diff --git a/dep/include/ace/SOCK_Connector.inl b/externals/ace/SOCK_Connector.inl similarity index 89% rename from dep/include/ace/SOCK_Connector.inl rename to externals/ace/SOCK_Connector.inl index ec99a5f38db..a805ba0b153 100644 --- a/dep/include/ace/SOCK_Connector.inl +++ b/externals/ace/SOCK_Connector.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: SOCK_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_Connector.inl 82723 2008-09-16 09:35:44Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -21,7 +21,7 @@ ACE_SOCK_Connector::ACE_SOCK_Connector (void) ACE_TRACE ("ACE_SOCK_Connector::ACE_SOCK_Connector"); } -ACE_INLINE int +ACE_INLINE bool ACE_SOCK_Connector::reset_new_handle (ACE_HANDLE handle) { #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) @@ -31,7 +31,7 @@ ACE_SOCK_Connector::reset_new_handle (ACE_HANDLE handle) 0); #else /* !defined ACE_HAS_WINSOCK2 */ ACE_UNUSED_ARG (handle); - return 0; + return false; #endif /* ACE_WIN32 */ } diff --git a/dep/src/ace/SOCK_Dgram.cpp b/externals/ace/SOCK_Dgram.cpp similarity index 98% rename from dep/src/ace/SOCK_Dgram.cpp rename to externals/ace/SOCK_Dgram.cpp index 2a442e1c8b5..7ae3cf391b9 100644 --- a/dep/src/ace/SOCK_Dgram.cpp +++ b/externals/ace/SOCK_Dgram.cpp @@ -16,12 +16,12 @@ #endif /* __ACE_INLINE__ */ #if defined (ACE_HAS_IPV6) && defined (ACE_WIN32) -#include /**/ +#include /**/ #endif ACE_RCSID (ace, SOCK_Dgram, - "$Id: SOCK_Dgram.cpp 82559 2008-08-07 20:23:07Z parsons $") + "$Id: SOCK_Dgram.cpp 85421 2009-05-22 11:12:30Z johnnyw $") // This is a workaround for platforms with non-standard // definitions of the ip_mreq structure @@ -60,13 +60,12 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, // Check the status of the current socket to make sure there's data // to recv (or time out). - int select_width; # if defined (ACE_WIN32) // This arg is ignored on Windows and causes pointer truncation // warnings on 64-bit compiles. - select_width = 0; + int select_width = 0; # else - select_width = int (this->get_handle ()) + 1; + int select_width = int (this->get_handle ()) + 1; # endif /* ACE_WIN32 */ switch (ACE_OS::select (select_width, handle_set, @@ -459,13 +458,12 @@ ACE_SOCK_Dgram::recv (void *buf, handle_set.set_bit (this->get_handle ()); // Check the status of the current socket. - int select_width; #if defined (ACE_WIN32) // This arg is ignored on Windows and causes pointer truncation // warnings on 64-bit compiles. - select_width = 0; + int select_width = 0; #else - select_width = int (this->get_handle ()) + 1; + int select_width = int (this->get_handle ()) + 1; #endif /* ACE_WIN32 */ switch (ACE_OS::select (select_width, handle_set, @@ -498,13 +496,12 @@ ACE_SOCK_Dgram::send (const void *buf, handle_set.set_bit (this->get_handle ()); // Check the status of the current socket. - int select_width; #if defined (ACE_WIN32) // This arg is ignored on Windows and causes pointer truncation // warnings on 64-bit compiles. - select_width = 0; + int select_width = 0; #else - select_width = int (this->get_handle ()) + 1; + int select_width = int (this->get_handle ()) + 1; #endif /* ACE_WIN32 */ switch (ACE_OS::select (select_width, 0, @@ -748,4 +745,3 @@ ACE_SOCK_Dgram::make_multicast_ifaddr6 (ipv6_mreq *ret_mreq, #endif /* __linux__ && ACE_HAS_IPV6 */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_Dgram.h b/externals/ace/SOCK_Dgram.h similarity index 99% rename from dep/include/ace/SOCK_Dgram.h rename to externals/ace/SOCK_Dgram.h index 42696a51fdd..c26c5ff2c35 100644 --- a/dep/include/ace/SOCK_Dgram.h +++ b/externals/ace/SOCK_Dgram.h @@ -237,4 +237,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_DGRAM_H */ - diff --git a/dep/include/ace/SOCK_Dgram.inl b/externals/ace/SOCK_Dgram.inl similarity index 100% rename from dep/include/ace/SOCK_Dgram.inl rename to externals/ace/SOCK_Dgram.inl diff --git a/dep/src/ace/SOCK_Dgram_Bcast.cpp b/externals/ace/SOCK_Dgram_Bcast.cpp similarity index 88% rename from dep/src/ace/SOCK_Dgram_Bcast.cpp rename to externals/ace/SOCK_Dgram_Bcast.cpp index 2fdf4de8c73..43a5f5a16a6 100644 --- a/dep/src/ace/SOCK_Dgram_Bcast.cpp +++ b/externals/ace/SOCK_Dgram_Bcast.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_Dgram_Bcast.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_Dgram_Bcast.cpp 84455 2009-02-13 13:31:02Z johnnyw $ #include "ace/SOCK_Dgram_Bcast.h" @@ -13,7 +13,7 @@ #include "ace/SOCK_Dgram_Bcast.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, SOCK_Dgram_Bcast, "$Id: SOCK_Dgram_Bcast.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, SOCK_Dgram_Bcast, "$Id: SOCK_Dgram_Bcast.cpp 84455 2009-02-13 13:31:02Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -117,8 +117,8 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) SO_BROADCAST, (char *) &one, sizeof one) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: setsockopt failed"), + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: setsockopt failed")), -1); #if !defined (ACE_WIN32) && !defined(__INTERIX) @@ -135,8 +135,8 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) if (ACE_OS::ioctl (s, SIOCGIFCONF, (char *) &ifc) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get interface configuration)"), + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get interface configuration)")), ACE_INVALID_HANDLE); struct ifreq *ifr = ifc.ifc_req; @@ -165,6 +165,7 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) #endif /* ! _UNICOS */ } + #if !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) && !defined (ACE_VXWORKS) && !defined(__APPLE__) for (int n = ifc.ifc_len / sizeof (struct ifreq) ; n > 0; n--, ifr++) @@ -212,8 +213,8 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) if (ifr->ifr_addr.sa_family != 0 || ACE::debug ()) ACE_DEBUG ((LM_DEBUG, - "warning %p: sa_family: %d\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: Not AF_INET", + ACE_TEXT("warning %p: sa_family: %d\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: Not AF_INET"), ifr->ifr_addr.sa_family)); continue; } @@ -225,17 +226,17 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) SIOCGIFFLAGS, (char *) &flags) == -1) { - ACE_ERROR ((LM_ERROR, "%p [%s]\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get interface flags)", - flags.ifr_name)); + ACE_ERROR ((LM_ERROR, ACE_TEXT("%p [%s]\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get interface flags)"), + flags.ifr_name)); continue; } if (ACE_BIT_ENABLED (flags.ifr_flags, IFF_UP) == 0) { - ACE_ERROR ((LM_ERROR, "%p [%s]\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: Network interface is not up", + ACE_ERROR ((LM_ERROR, ACE_TEXT("%p [%s]\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: Network interface is not up"), flags.ifr_name)); continue; } @@ -250,8 +251,8 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) if (ACE_OS::ioctl (s, SIOCGIFBRDADDR, (char *) &if_req) == -1) - ACE_ERROR ((LM_ERROR, "%p [%s]\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get broadaddr)", + ACE_ERROR ((LM_ERROR, ACE_TEXT("%p [%s]\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: ioctl (get broadaddr)"), flags.ifr_name)); else { @@ -267,8 +268,8 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) else { if (host_name != 0) - ACE_ERROR ((LM_ERROR, "%p [%s]\n", - "ACE_SOCK_Dgram_Bcast::mk_broadcast: Broadcast is not enable for this interface.", + ACE_ERROR ((LM_ERROR, ACE_TEXT("%p [%s]\n"), + ACE_TEXT("ACE_SOCK_Dgram_Bcast::mk_broadcast: Broadcast is not enable for this interface."), flags.ifr_name)); } } @@ -377,4 +378,3 @@ ACE_SOCK_Dgram_Bcast::send (const iovec iov[], #endif /* ACE_HAS_MSG */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_Dgram_Bcast.h b/externals/ace/SOCK_Dgram_Bcast.h similarity index 100% rename from dep/include/ace/SOCK_Dgram_Bcast.h rename to externals/ace/SOCK_Dgram_Bcast.h index 0590b79d608..2156a669c89 100644 --- a/dep/include/ace/SOCK_Dgram_Bcast.h +++ b/externals/ace/SOCK_Dgram_Bcast.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_SOCK_DGRAM_BCAST_H #define ACE_SOCK_DGRAM_BCAST_H #include /**/ "ace/pre.h" @@ -137,4 +138,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_DGRAM_BCAST_H */ - diff --git a/dep/include/ace/SOCK_Dgram_Bcast.inl b/externals/ace/SOCK_Dgram_Bcast.inl similarity index 100% rename from dep/include/ace/SOCK_Dgram_Bcast.inl rename to externals/ace/SOCK_Dgram_Bcast.inl diff --git a/dep/src/ace/SOCK_Dgram_Mcast.cpp b/externals/ace/SOCK_Dgram_Mcast.cpp similarity index 99% rename from dep/src/ace/SOCK_Dgram_Mcast.cpp rename to externals/ace/SOCK_Dgram_Mcast.cpp index 2c327f08255..fc07a55295e 100644 --- a/dep/src/ace/SOCK_Dgram_Mcast.cpp +++ b/externals/ace/SOCK_Dgram_Mcast.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_Dgram_Mcast.cpp 82390 2008-07-23 08:13:52Z johnnyw $ +// $Id: SOCK_Dgram_Mcast.cpp 85421 2009-05-22 11:12:30Z johnnyw $ #include "ace/SOCK_Dgram_Mcast.h" @@ -13,7 +13,7 @@ #endif #if defined (ACE_HAS_IPV6) && defined (ACE_WIN32) -#include /**/ +#include /**/ #endif #if !defined (__ACE_INLINE__) @@ -22,7 +22,7 @@ ACE_RCSID (ace, SOCK_Dgram_Mcast, - "$Id: SOCK_Dgram_Mcast.cpp 82390 2008-07-23 08:13:52Z johnnyw $") + "$Id: SOCK_Dgram_Mcast.cpp 85421 2009-05-22 11:12:30Z johnnyw $") #include "ace/Log_Msg.h" @@ -96,7 +96,7 @@ ACE_SOCK_Dgram_Mcast::dump (void) const ACE_MT (ACE_GUARD (ACE_SDM_LOCK, guard, this->subscription_list_lock_)); subscription_list_iter_t iter (this->subscription_list_); - for (; !iter.done (); iter.advance ()) + for ( ; !iter.done (); iter.advance ()) { ACE_TCHAR iface_string[MAXNAMELEN + 1]; ip_mreq *pm = iter.next (); @@ -612,6 +612,7 @@ ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, { ACE_TRACE ("ACE_SOCK_Dgram_Mcast::unsubscribe_ifs"); + if (ACE_BIT_ENABLED (this->opts_, OPT_NULLIFACE_ALL) && net_if == 0) { @@ -689,6 +690,7 @@ ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, return 1; + } else { @@ -795,6 +797,7 @@ ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, return 0; } + int ACE_SOCK_Dgram_Mcast::leave (const ACE_INET_Addr &mcast_addr, const ACE_TCHAR *net_if) @@ -927,4 +930,3 @@ ACE_SOCK_Dgram_Mcast::clear_subs_list (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_Dgram_Mcast.h b/externals/ace/SOCK_Dgram_Mcast.h similarity index 99% rename from dep/include/ace/SOCK_Dgram_Mcast.h rename to externals/ace/SOCK_Dgram_Mcast.h index 093e9fc8558..a59b41bc45f 100644 --- a/dep/include/ace/SOCK_Dgram_Mcast.h +++ b/externals/ace/SOCK_Dgram_Mcast.h @@ -4,7 +4,7 @@ /** * @file SOCK_Dgram_Mcast.h * - * $Id: SOCK_Dgram_Mcast.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SOCK_Dgram_Mcast.h 83891 2008-11-28 11:01:50Z johnnyw $ * * @author Irfan Pyrali * @author Tim Harrison @@ -201,7 +201,7 @@ public: /** * This method is optional; if not explicitly invoked, it is invoked by * the first , using the subscribed address/port# and network - * interface paramters. + * interface parameters. * The parameter defines the default send address/port# and * also the port# and, if the OPT_BINDADDR_YES option is used, * the multicast address that is bound to this socket. @@ -257,6 +257,7 @@ public: int reuse_addr = 1, // (see above) const ACE_TCHAR *net_if = 0); + /// Leave a multicast group on a given interface (or all interfaces, if /// supported). /** @@ -381,4 +382,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_DGRAM_MCAST_H */ - diff --git a/dep/include/ace/SOCK_Dgram_Mcast.inl b/externals/ace/SOCK_Dgram_Mcast.inl similarity index 100% rename from dep/include/ace/SOCK_Dgram_Mcast.inl rename to externals/ace/SOCK_Dgram_Mcast.inl diff --git a/dep/src/ace/SOCK_IO.cpp b/externals/ace/SOCK_IO.cpp similarity index 95% rename from dep/src/ace/SOCK_IO.cpp rename to externals/ace/SOCK_IO.cpp index 7d5befad8fd..772cbff18a5 100644 --- a/dep/src/ace/SOCK_IO.cpp +++ b/externals/ace/SOCK_IO.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_IO.cpp 82294 2008-07-12 13:03:37Z johnnyw $ +// $Id: SOCK_IO.cpp 84213 2009-01-22 15:45:13Z johnnyw $ #include "ace/SOCK_IO.h" @@ -12,7 +12,7 @@ #include "ace/SOCK_IO.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, SOCK_IO, "$Id: SOCK_IO.cpp 82294 2008-07-12 13:03:37Z johnnyw $") +ACE_RCSID(ace, SOCK_IO, "$Id: SOCK_IO.cpp 84213 2009-01-22 15:45:13Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -44,13 +44,12 @@ ACE_SOCK_IO::recvv (iovec *io_vec, io_vec->iov_base = 0; // Check the status of the current socket. - int select_width; # if defined (ACE_WIN32) // This arg is ignored on Windows and causes pointer truncation // warnings on 64-bit compiles. - select_width = 0; + int select_width = 0; # else - select_width = int (this->get_handle ()) + 1; + int select_width = int (this->get_handle ()) + 1; # endif /* ACE_WIN32 */ switch (ACE_OS::select (select_width, handle_set, @@ -179,4 +178,3 @@ ACE_SOCK_IO::recv (size_t n, ...) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_IO.h b/externals/ace/SOCK_IO.h similarity index 99% rename from dep/include/ace/SOCK_IO.h rename to externals/ace/SOCK_IO.h index ce14f87544b..1541f5ed0f3 100644 --- a/dep/include/ace/SOCK_IO.h +++ b/externals/ace/SOCK_IO.h @@ -134,4 +134,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_IO_H */ - diff --git a/dep/include/ace/SOCK_IO.inl b/externals/ace/SOCK_IO.inl similarity index 100% rename from dep/include/ace/SOCK_IO.inl rename to externals/ace/SOCK_IO.inl diff --git a/dep/src/ace/SOCK_Netlink.cpp b/externals/ace/SOCK_Netlink.cpp similarity index 100% rename from dep/src/ace/SOCK_Netlink.cpp rename to externals/ace/SOCK_Netlink.cpp index 7ebb6220e88..aa1eca8b992 100644 --- a/dep/src/ace/SOCK_Netlink.cpp +++ b/externals/ace/SOCK_Netlink.cpp @@ -41,6 +41,7 @@ int ACE_SOCK_Netlink::open (ACE_Netlink_Addr &local, return 0; } + ACE_SOCK_Netlink::ACE_SOCK_Netlink (ACE_Netlink_Addr &local, int protocol_family, int protocol) @@ -110,4 +111,3 @@ ACE_SOCK_Netlink::recv (iovec iov[], ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_NETLINK */ - diff --git a/dep/include/ace/SOCK_Netlink.h b/externals/ace/SOCK_Netlink.h similarity index 99% rename from dep/include/ace/SOCK_Netlink.h rename to externals/ace/SOCK_Netlink.h index 99d1198fa66..c3be221552b 100644 --- a/dep/include/ace/SOCK_Netlink.h +++ b/externals/ace/SOCK_Netlink.h @@ -104,4 +104,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_SOCK_NETLINK_H */ - diff --git a/dep/include/ace/SOCK_Netlink.inl b/externals/ace/SOCK_Netlink.inl similarity index 100% rename from dep/include/ace/SOCK_Netlink.inl rename to externals/ace/SOCK_Netlink.inl diff --git a/dep/src/ace/SOCK_SEQPACK_Acceptor.cpp b/externals/ace/SOCK_SEQPACK_Acceptor.cpp similarity index 98% rename from dep/src/ace/SOCK_SEQPACK_Acceptor.cpp rename to externals/ace/SOCK_SEQPACK_Acceptor.cpp index 2fe58ab938c..9287c885c52 100644 --- a/dep/src/ace/SOCK_SEQPACK_Acceptor.cpp +++ b/externals/ace/SOCK_SEQPACK_Acceptor.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_SEQPACK_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_SEQPACK_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/SOCK_SEQPACK_Acceptor.h" @@ -30,7 +30,7 @@ ACE_SOCK_SEQPACK_Acceptor::ACE_SOCK_SEQPACK_Acceptor (void) int ACE_SOCK_SEQPACK_Acceptor::shared_accept_start (ACE_Time_Value *timeout, - int restart, + bool restart, int &in_blocking_mode) const { ACE_TRACE ("ACE_SOCK_SEQPACK_Acceptor::shared_accept_start"); @@ -63,7 +63,7 @@ ACE_SOCK_SEQPACK_Acceptor::shared_accept_start (ACE_Time_Value *timeout, int ACE_SOCK_SEQPACK_Acceptor::shared_accept_finish (ACE_SOCK_SEQPACK_Association new_association, int in_blocking_mode, - int reset_new_handle) const + bool reset_new_handle) const { ACE_TRACE ("ACE_SOCK_SEQPACK_Acceptor::shared_accept_finish ()"); @@ -102,8 +102,8 @@ int ACE_SOCK_SEQPACK_Acceptor::accept (ACE_SOCK_SEQPACK_Association &new_association, ACE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) const + bool restart, + bool reset_new_handle) const { ACE_TRACE ("ACE_SOCK_SEQPACK_Acceptor::accept"); @@ -594,4 +594,3 @@ ACE_SOCK_SEQPACK_Acceptor::close (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_SEQPACK_Acceptor.h b/externals/ace/SOCK_SEQPACK_Acceptor.h similarity index 83% rename from dep/include/ace/SOCK_SEQPACK_Acceptor.h rename to externals/ace/SOCK_SEQPACK_Acceptor.h index 526b374f3fd..d5c70108173 100644 --- a/dep/include/ace/SOCK_SEQPACK_Acceptor.h +++ b/externals/ace/SOCK_SEQPACK_Acceptor.h @@ -4,7 +4,7 @@ /** * @file SOCK_SEQPACK_Acceptor.h * - * $Id: SOCK_SEQPACK_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SOCK_SEQPACK_Acceptor.h 84325 2009-02-04 22:46:30Z shuston $ * @author Patrick J. Lardieri * @author Gaurav Naik, Lockheed Martin ATL * @author based on SOCK_STREAM_Acceptor @@ -56,29 +56,29 @@ public: * @c SO_REUSEADDR to reuse this address. */ ACE_SOCK_SEQPACK_Acceptor (const ACE_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_UNSPEC, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 132); + int reuse_addr = 0, + int protocol_family = PF_UNSPEC, + int backlog = ACE_DEFAULT_BACKLOG, + int protocol = 132); /// Multihomed version of same ACE_SOCK_SEQPACK_Acceptor (const ACE_Multihomed_INET_Addr &local_sap, - int reuse_addr = 0, - int protocol_family = PF_UNSPEC, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 132); + int reuse_addr = 0, + int protocol_family = PF_UNSPEC, + int backlog = ACE_DEFAULT_BACKLOG, + int protocol = 132); /// Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 /// on success and -1 on failure. ACE_SOCK_SEQPACK_Acceptor (const ACE_Addr &local_sap, - ACE_Protocol_Info *protocolinfo, - ACE_SOCK_GROUP g, - u_long flags, - int reuse_addr, - int protocol_family = PF_UNSPEC, - int backlog = ACE_DEFAULT_BACKLOG, - int protocol = 132); + ACE_Protocol_Info *protocolinfo, + ACE_SOCK_GROUP g, + u_long flags, + int reuse_addr, + int protocol_family = PF_UNSPEC, + int backlog = ACE_DEFAULT_BACKLOG, + int protocol = 132); /** * Initialize a passive-mode BSD-style acceptor socket (no QoS). @@ -101,6 +101,7 @@ public: int backlog = ACE_DEFAULT_BACKLOG, int protocol = 132); + /// Initialize a passive-mode QoS-enabled acceptor socket. Returns 0 /// on success and -1 on failure. int open (const ACE_Addr &local_sap, @@ -131,8 +132,8 @@ public: int accept (ACE_SOCK_SEQPACK_Association &new_association, ACE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0) const; + bool restart = true, + bool reset_new_handle = false) const; // = Meta-type info typedef ACE_Multihomed_INET_Addr PEER_ADDR; @@ -148,14 +149,14 @@ protected: /// Perform operations that must occur before is /// called. int shared_accept_start (ACE_Time_Value *timeout, - int restart, + bool restart, int &in_blocking_mode) const; /// Perform operations that must occur after is /// called. int shared_accept_finish (ACE_SOCK_SEQPACK_Association new_association, int in_blocking_mode, - int reset_new_handle) const; + bool reset_new_handle) const; /** * This method factors out the common code and is called by @@ -186,4 +187,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_SEQ_ACCEPTOR_H */ - diff --git a/dep/include/ace/SOCK_SEQPACK_Acceptor.inl b/externals/ace/SOCK_SEQPACK_Acceptor.inl similarity index 100% rename from dep/include/ace/SOCK_SEQPACK_Acceptor.inl rename to externals/ace/SOCK_SEQPACK_Acceptor.inl diff --git a/dep/src/ace/SOCK_SEQPACK_Association.cpp b/externals/ace/SOCK_SEQPACK_Association.cpp similarity index 95% rename from dep/src/ace/SOCK_SEQPACK_Association.cpp rename to externals/ace/SOCK_SEQPACK_Association.cpp index dcb1cb73ee6..02b7b25c0fd 100644 --- a/dep/src/ace/SOCK_SEQPACK_Association.cpp +++ b/externals/ace/SOCK_SEQPACK_Association.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_SEQPACK_Association.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_SEQPACK_Association.cpp 83832 2008-11-18 10:30:32Z johnnyw $ #include "ace/SOCK_SEQPACK_Association.h" @@ -11,7 +11,7 @@ #include "ace/SOCK_SEQPACK_Association.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, SOCK_SEQPACK_Association, "$Id: SOCK_SEQPACK_Association.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, SOCK_SEQPACK_Association, "$Id: SOCK_SEQPACK_Association.cpp 83832 2008-11-18 10:30:32Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -96,7 +96,11 @@ ACE_SOCK_SEQPACK_Association::get_local_addrs (ACE_INET_Addr *addrs, size_t &siz int err = 0; size_t len = 0; +#ifndef ACE_HAS_VOID_PTR_SCTP_GETLADDRS err = sctp_getladdrs(this->get_handle(), 0, &laddrs); +#else + err = sctp_getladdrs(this->get_handle(), 0, reinterpret_cast(&laddrs)); +#endif /* ACE_HAS_VOID_PTR_SCTP_GETPADDRS */ if (err > 0) { len = err; @@ -202,6 +206,7 @@ ACE_SOCK_SEQPACK_Association::get_local_addrs (ACE_INET_Addr *addrs, size_t &siz return 0; } + int ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &size) const { @@ -229,7 +234,12 @@ ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &si int err = 0; size_t len = 0; +#ifndef ACE_HAS_VOID_PTR_SCTP_GETPADDRS err = sctp_getpaddrs(this->get_handle(), 0, &paddrs); +#else + err = sctp_getpaddrs(this->get_handle(), 0, reinterpret_cast(&paddrs)); +#endif /* ACE_HAS_VOID_PTR_SCTP_GETPADDRS */ + if (err > 0) { len = err; @@ -336,4 +346,3 @@ ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &si } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_SEQPACK_Association.h b/externals/ace/SOCK_SEQPACK_Association.h similarity index 99% rename from dep/include/ace/SOCK_SEQPACK_Association.h rename to externals/ace/SOCK_SEQPACK_Association.h index 76cb3527a13..6189d1a9987 100644 --- a/dep/include/ace/SOCK_SEQPACK_Association.h +++ b/externals/ace/SOCK_SEQPACK_Association.h @@ -200,4 +200,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_SEQPACK_ASSOCIATION_H */ - diff --git a/dep/include/ace/SOCK_SEQPACK_Association.inl b/externals/ace/SOCK_SEQPACK_Association.inl similarity index 100% rename from dep/include/ace/SOCK_SEQPACK_Association.inl rename to externals/ace/SOCK_SEQPACK_Association.inl diff --git a/dep/src/ace/SOCK_SEQPACK_Connector.cpp b/externals/ace/SOCK_SEQPACK_Connector.cpp similarity index 99% rename from dep/src/ace/SOCK_SEQPACK_Connector.cpp rename to externals/ace/SOCK_SEQPACK_Connector.cpp index 63ba98d73f1..8405a6c7496 100644 --- a/dep/src/ace/SOCK_SEQPACK_Connector.cpp +++ b/externals/ace/SOCK_SEQPACK_Connector.cpp @@ -1,4 +1,4 @@ -// $Id: SOCK_SEQPACK_Connector.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_SEQPACK_Connector.cpp 83735 2008-11-14 09:41:52Z johnnyw $ #include "ace/SOCK_SEQPACK_Connector.h" @@ -40,6 +40,8 @@ ACE_SOCK_SEQPACK_Connector::shared_open (ACE_SOCK_SEQPACK_Association &new_assoc { ACE_TRACE ("ACE_SOCK_SEQPACK_Connector::shared_open"); + + // Only open a new socket if we don't already have a valid handle. if (new_association.get_handle () == ACE_INVALID_HANDLE && #if defined (ACE_HAS_LKSCTP) @@ -241,8 +243,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_finish (ACE_SOCK_SEQPACK_Association if (error == EINPROGRESS || error == EWOULDBLOCK) { // This expression checks if we were polling. - if (timeout->sec () == 0 - && timeout->usec () == 0) + if (*timeout == ACE_Time_Value::zero) error = EWOULDBLOCK; // Wait synchronously using timeout. else if (this->complete (new_association, @@ -267,6 +268,7 @@ ACE_SOCK_SEQPACK_Connector::shared_connect_finish (ACE_SOCK_SEQPACK_Association // Actively connect and produce a new ACE_SOCK_SEQPACK_Association if things go well... + int ACE_SOCK_SEQPACK_Connector::connect (ACE_SOCK_SEQPACK_Association &new_association, const ACE_Addr &remote_sap, @@ -438,4 +440,3 @@ ACE_SOCK_SEQPACK_Connector::ACE_SOCK_SEQPACK_Connector (ACE_SOCK_SEQPACK_Associa } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_SEQPACK_Connector.h b/externals/ace/SOCK_SEQPACK_Connector.h similarity index 97% rename from dep/include/ace/SOCK_SEQPACK_Connector.h rename to externals/ace/SOCK_SEQPACK_Connector.h index 400161660e0..67bc757762a 100644 --- a/dep/include/ace/SOCK_SEQPACK_Connector.h +++ b/externals/ace/SOCK_SEQPACK_Connector.h @@ -4,7 +4,7 @@ /** * @file SOCK_SEQPACK_Connector.h * - * $Id: SOCK_SEQPACK_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SOCK_SEQPACK_Connector.h 84816 2009-03-13 08:16:32Z johnnyw $ * * @author Patrick J. Lardieri * @author Gaurav Naik, Lockheed Martin ATL @@ -79,7 +79,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -129,7 +129,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The set of local addresses for SCTP to * bind to. @@ -178,7 +178,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The local address to bind to. If it's * the default value of @c ACE_Addr::sap_any then the @@ -228,7 +228,7 @@ public: * amount of time passes before the connection is made, * this method returns -1 and errno == ETIME. Note * the difference between this case and when a blocking - * connect is attmpted that TCP times out - in the latter + * connect is attempted that TCP times out - in the latter * case, errno will be ETIMEDOUT. * @param local_sap (optional) The set of local addresses for SCTP to * bind to. @@ -275,7 +275,7 @@ public: const ACE_Time_Value *timeout = 0); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); // = Meta-type info typedef ACE_Multihomed_INET_Addr PEER_ADDR; @@ -329,4 +329,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_SEQPACK_CONNECTOR_H */ - diff --git a/dep/include/ace/SOCK_SEQPACK_Connector.inl b/externals/ace/SOCK_SEQPACK_Connector.inl similarity index 89% rename from dep/include/ace/SOCK_SEQPACK_Connector.inl rename to externals/ace/SOCK_SEQPACK_Connector.inl index d11a69d31af..332b6ce305c 100644 --- a/dep/include/ace/SOCK_SEQPACK_Connector.inl +++ b/externals/ace/SOCK_SEQPACK_Connector.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: SOCK_SEQPACK_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SOCK_SEQPACK_Connector.inl 82723 2008-09-16 09:35:44Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -21,7 +21,7 @@ ACE_SOCK_SEQPACK_Connector::ACE_SOCK_SEQPACK_Connector (void) ACE_TRACE ("ACE_SOCK_SEQPACK_Connector::ACE_SOCK_SEQPACK_Connector"); } -ACE_INLINE int +ACE_INLINE bool ACE_SOCK_SEQPACK_Connector::reset_new_handle (ACE_HANDLE handle) { #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) @@ -31,7 +31,7 @@ ACE_SOCK_SEQPACK_Connector::reset_new_handle (ACE_HANDLE handle) 0); #else /* !defined ACE_HAS_WINSOCK2 */ ACE_UNUSED_ARG (handle); - return 0; + return false; #endif /* ACE_WIN32 */ } diff --git a/dep/src/ace/SOCK_Stream.cpp b/externals/ace/SOCK_Stream.cpp similarity index 99% rename from dep/src/ace/SOCK_Stream.cpp rename to externals/ace/SOCK_Stream.cpp index abff10c5811..36f0b8761c7 100644 --- a/dep/src/ace/SOCK_Stream.cpp +++ b/externals/ace/SOCK_Stream.cpp @@ -38,4 +38,3 @@ ACE_SOCK_Stream::close (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SOCK_Stream.h b/externals/ace/SOCK_Stream.h similarity index 99% rename from dep/include/ace/SOCK_Stream.h rename to externals/ace/SOCK_Stream.h index d717d4f3eab..a96d7e664ef 100644 --- a/dep/include/ace/SOCK_Stream.h +++ b/externals/ace/SOCK_Stream.h @@ -182,4 +182,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SOCK_STREAM_H */ - diff --git a/dep/include/ace/SOCK_Stream.inl b/externals/ace/SOCK_Stream.inl similarity index 100% rename from dep/include/ace/SOCK_Stream.inl rename to externals/ace/SOCK_Stream.inl diff --git a/dep/src/ace/SPIPE.cpp b/externals/ace/SPIPE.cpp similarity index 99% rename from dep/src/ace/SPIPE.cpp rename to externals/ace/SPIPE.cpp index e26e027cbff..cddd44e9004 100644 --- a/dep/src/ace/SPIPE.cpp +++ b/externals/ace/SPIPE.cpp @@ -80,4 +80,3 @@ ACE_SPIPE::set_duplex_handle (ACE_HANDLE handle) #endif /* ACE_HAS_STREAM_PIPES */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SPIPE.h b/externals/ace/SPIPE.h similarity index 100% rename from dep/include/ace/SPIPE.h rename to externals/ace/SPIPE.h index d561a1575a5..6654b82a6f3 100644 --- a/dep/include/ace/SPIPE.h +++ b/externals/ace/SPIPE.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_SPIPE_H #define ACE_SPIPE_H #include /**/ "ace/pre.h" @@ -113,4 +114,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SPIPE_H */ - diff --git a/dep/include/ace/SPIPE.inl b/externals/ace/SPIPE.inl similarity index 100% rename from dep/include/ace/SPIPE.inl rename to externals/ace/SPIPE.inl diff --git a/dep/src/ace/SPIPE_Acceptor.cpp b/externals/ace/SPIPE_Acceptor.cpp similarity index 97% rename from dep/src/ace/SPIPE_Acceptor.cpp rename to externals/ace/SPIPE_Acceptor.cpp index cc12c0c4b89..e532f9d4a84 100644 --- a/dep/src/ace/SPIPE_Acceptor.cpp +++ b/externals/ace/SPIPE_Acceptor.cpp @@ -1,4 +1,4 @@ -// $Id: SPIPE_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SPIPE_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/SPIPE_Acceptor.h" #include "ace/Log_Msg.h" @@ -9,7 +9,7 @@ # include "ace/OS_NS_unistd.h" #endif // ACE_HAS_STREAM_PIPES -ACE_RCSID(ace, SPIPE_Acceptor, "$Id: SPIPE_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, SPIPE_Acceptor, "$Id: SPIPE_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -248,8 +248,8 @@ int ACE_SPIPE_Acceptor::accept (ACE_SPIPE_Stream &new_io, ACE_SPIPE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) + bool restart, + bool reset_new_handle) { ACE_TRACE ("ACE_SPIPE_Acceptor::accept"); ACE_UNUSED_ARG (reset_new_handle); @@ -335,4 +335,3 @@ ACE_SPIPE_Acceptor::accept (ACE_SPIPE_Stream &new_io, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SPIPE_Acceptor.h b/externals/ace/SPIPE_Acceptor.h similarity index 97% rename from dep/include/ace/SPIPE_Acceptor.h rename to externals/ace/SPIPE_Acceptor.h index 44b049763d5..84529c76582 100644 --- a/dep/include/ace/SPIPE_Acceptor.h +++ b/externals/ace/SPIPE_Acceptor.h @@ -4,13 +4,14 @@ /** * @file SPIPE_Acceptor.h * - * $Id: SPIPE_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SPIPE_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Douglas C. Schmidt * @author Prashant Jain */ //============================================================================= + #ifndef ACE_SPIPE_ACCEPTOR_H #define ACE_SPIPE_ACCEPTOR_H #include /**/ "ace/pre.h" @@ -120,8 +121,8 @@ public: int accept (ACE_SPIPE_Stream &ipc_sap_spipe, ACE_SPIPE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0); + bool restart = true, + bool reset_new_handle = false); // = Meta-type info typedef ACE_SPIPE_Addr PEER_ADDR; @@ -165,4 +166,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SPIPE_ACCEPTOR_H */ - diff --git a/dep/src/ace/SPIPE_Addr.cpp b/externals/ace/SPIPE_Addr.cpp similarity index 100% rename from dep/src/ace/SPIPE_Addr.cpp rename to externals/ace/SPIPE_Addr.cpp index 390d2aa49bd..e81da6d960d 100644 --- a/dep/src/ace/SPIPE_Addr.cpp +++ b/externals/ace/SPIPE_Addr.cpp @@ -42,6 +42,7 @@ ACE_SPIPE_Addr::get_addr (void) const return (void *) &this->SPIPE_addr_; } + // Do nothing constructor. ACE_SPIPE_Addr::ACE_SPIPE_Addr (void) @@ -164,4 +165,3 @@ ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_TCHAR *addr, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SPIPE_Addr.h b/externals/ace/SPIPE_Addr.h similarity index 99% rename from dep/include/ace/SPIPE_Addr.h rename to externals/ace/SPIPE_Addr.h index 46834b74727..100d93b9658 100644 --- a/dep/include/ace/SPIPE_Addr.h +++ b/externals/ace/SPIPE_Addr.h @@ -120,4 +120,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SPIPE_ADDR_H */ - diff --git a/dep/include/ace/SPIPE_Addr.inl b/externals/ace/SPIPE_Addr.inl similarity index 99% rename from dep/include/ace/SPIPE_Addr.inl rename to externals/ace/SPIPE_Addr.inl index e84b2f0bb2e..a20e0e86f7c 100644 --- a/dep/include/ace/SPIPE_Addr.inl +++ b/externals/ace/SPIPE_Addr.inl @@ -2,6 +2,7 @@ // // $Id: SPIPE_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/SString.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/SPIPE_Connector.cpp b/externals/ace/SPIPE_Connector.cpp similarity index 99% rename from dep/src/ace/SPIPE_Connector.cpp rename to externals/ace/SPIPE_Connector.cpp index db49ca6c937..c11bb7d9b39 100644 --- a/dep/src/ace/SPIPE_Connector.cpp +++ b/externals/ace/SPIPE_Connector.cpp @@ -158,4 +158,3 @@ ACE_SPIPE_Connector::connect (ACE_SPIPE_Stream &new_io, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SPIPE_Connector.h b/externals/ace/SPIPE_Connector.h similarity index 97% rename from dep/include/ace/SPIPE_Connector.h rename to externals/ace/SPIPE_Connector.h index 576cabaa073..89b9199d5a5 100644 --- a/dep/include/ace/SPIPE_Connector.h +++ b/externals/ace/SPIPE_Connector.h @@ -4,7 +4,7 @@ /** * @file SPIPE_Connector.h * - * $Id: SPIPE_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SPIPE_Connector.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Doug Schmidt * @author Prashant Jain @@ -95,7 +95,7 @@ public: int pipe_mode = PIPE_READMODE_MESSAGE | PIPE_WAIT); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); // = Meta-type info typedef ACE_SPIPE_Addr PEER_ADDR; @@ -116,4 +116,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SPIPE_CONNECTOR_H */ - diff --git a/externals/ace/SPIPE_Connector.inl b/externals/ace/SPIPE_Connector.inl new file mode 100644 index 00000000000..46fdcbd4221 --- /dev/null +++ b/externals/ace/SPIPE_Connector.inl @@ -0,0 +1,14 @@ +// -*- C++ -*- +// +// $Id: SPIPE_Connector.inl 82723 2008-09-16 09:35:44Z johnnyw $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE bool +ACE_SPIPE_Connector::reset_new_handle (ACE_HANDLE) +{ + // Nothing to do here since the handle is not a socket + return false; +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/SPIPE_Stream.cpp b/externals/ace/SPIPE_Stream.cpp similarity index 99% rename from dep/src/ace/SPIPE_Stream.cpp rename to externals/ace/SPIPE_Stream.cpp index 008ce25ec3b..74a2ab350cb 100644 --- a/dep/src/ace/SPIPE_Stream.cpp +++ b/externals/ace/SPIPE_Stream.cpp @@ -102,4 +102,3 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SPIPE_Stream.h b/externals/ace/SPIPE_Stream.h similarity index 95% rename from dep/include/ace/SPIPE_Stream.h rename to externals/ace/SPIPE_Stream.h index 39a57a33126..57357316199 100644 --- a/dep/include/ace/SPIPE_Stream.h +++ b/externals/ace/SPIPE_Stream.h @@ -4,7 +4,7 @@ /** * @file SPIPE_Stream.h * - * $Id: SPIPE_Stream.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SPIPE_Stream.h 84480 2009-02-16 18:58:16Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -84,12 +84,12 @@ public: /// Recv bytes via STREAM pipes using "band" mode. ssize_t recv (void *buf, size_t len) const; - /// Send and via STREAM pipes. + /// Send @a cntl and @a data via STREAM pipes. ssize_t send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags = 0) const; - /// Recv and via STREAM pipes. + /// Recv @a cntl and @a data via STREAM pipes. ssize_t recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const; @@ -144,7 +144,7 @@ public: ssize_t sendv_n (const iovec iov[], int len) const; - /// Receive an of size @a len to the stream. + /// Receive an of size @a len from the stream. ssize_t recvv_n (iovec iov[], int len) const; @@ -169,4 +169,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SPIPE_STREAM_H */ - diff --git a/dep/include/ace/SPIPE_Stream.inl b/externals/ace/SPIPE_Stream.inl similarity index 94% rename from dep/include/ace/SPIPE_Stream.inl rename to externals/ace/SPIPE_Stream.inl index e52600d4888..d490f88f145 100644 --- a/dep/include/ace/SPIPE_Stream.inl +++ b/externals/ace/SPIPE_Stream.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: SPIPE_Stream.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SPIPE_Stream.inl 88707 2010-01-25 18:49:25Z johnnyw $ #include "ace/OS_NS_sys_uio.h" #include "ace/OS_NS_errno.h" @@ -111,7 +111,7 @@ ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const DWORD procID; WSAPROTOCOL_INFO protInfo; ssize_t res = this->recv(&procID, sizeof(procID)); - if (res != sizeof(procID)) + if (res != static_cast (sizeof(procID))) { if(res != -1) errno = ENXIO; @@ -123,7 +123,7 @@ ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const return -1; } res = this->send(&protInfo, sizeof(protInfo)); - if (res != sizeof(protInfo)) + if (res != static_cast (sizeof(protInfo))) { if(res != -1) errno = ENXIO; @@ -131,7 +131,7 @@ ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const } // This is just for synchronization, we will ignore the data res = this->recv(&procID, sizeof(procID)); - if (res != sizeof(procID)) + if (res != static_cast (sizeof(procID))) { if(res != -1) errno = ENXIO; @@ -165,14 +165,14 @@ ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const pid_t procID = ACE_OS::getpid(); WSAPROTOCOL_INFO protInfo; ssize_t res = this->send(&procID, sizeof(procID)); - if (res != sizeof(procID)) + if (res != static_cast (sizeof(procID))) { if(res != -1) errno = ENXIO; return -1; } res = this->recv(&protInfo, sizeof(protInfo)); - if (res != sizeof(protInfo)) + if (res != static_cast (sizeof(protInfo))) { if(res != -1) errno = ENXIO; @@ -187,7 +187,7 @@ ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const // Since it does not matter what the data is, just send something to // synchronize the end of the exchange res = this->send(&procID, sizeof(procID)); - if (res != sizeof(procID)) + if (res != static_cast (sizeof(procID))) { if(res != -1) errno = ENXIO; diff --git a/dep/src/ace/SSL/SSL_Asynch_BIO.cpp b/externals/ace/SSL/SSL_Asynch_BIO.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_Asynch_BIO.cpp rename to externals/ace/SSL/SSL_Asynch_BIO.cpp diff --git a/dep/include/ace/SSL/SSL_Asynch_BIO.h b/externals/ace/SSL/SSL_Asynch_BIO.h similarity index 100% rename from dep/include/ace/SSL/SSL_Asynch_BIO.h rename to externals/ace/SSL/SSL_Asynch_BIO.h diff --git a/dep/src/ace/SSL/SSL_Asynch_Stream.cpp b/externals/ace/SSL/SSL_Asynch_Stream.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_Asynch_Stream.cpp rename to externals/ace/SSL/SSL_Asynch_Stream.cpp diff --git a/dep/include/ace/SSL/SSL_Asynch_Stream.h b/externals/ace/SSL/SSL_Asynch_Stream.h similarity index 100% rename from dep/include/ace/SSL/SSL_Asynch_Stream.h rename to externals/ace/SSL/SSL_Asynch_Stream.h diff --git a/dep/src/ace/SSL/SSL_Context.cpp b/externals/ace/SSL/SSL_Context.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_Context.cpp rename to externals/ace/SSL/SSL_Context.cpp diff --git a/dep/include/ace/SSL/SSL_Context.h b/externals/ace/SSL/SSL_Context.h similarity index 100% rename from dep/include/ace/SSL/SSL_Context.h rename to externals/ace/SSL/SSL_Context.h diff --git a/dep/include/ace/SSL/SSL_Context.inl b/externals/ace/SSL/SSL_Context.inl similarity index 100% rename from dep/include/ace/SSL/SSL_Context.inl rename to externals/ace/SSL/SSL_Context.inl diff --git a/dep/include/ace/SSL/SSL_Export.h b/externals/ace/SSL/SSL_Export.h similarity index 100% rename from dep/include/ace/SSL/SSL_Export.h rename to externals/ace/SSL/SSL_Export.h diff --git a/dep/src/ace/SSL/SSL_SOCK.cpp b/externals/ace/SSL/SSL_SOCK.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_SOCK.cpp rename to externals/ace/SSL/SSL_SOCK.cpp diff --git a/dep/include/ace/SSL/SSL_SOCK.h b/externals/ace/SSL/SSL_SOCK.h similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK.h rename to externals/ace/SSL/SSL_SOCK.h diff --git a/dep/include/ace/SSL/SSL_SOCK.inl b/externals/ace/SSL/SSL_SOCK.inl similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK.inl rename to externals/ace/SSL/SSL_SOCK.inl diff --git a/dep/src/ace/SSL/SSL_SOCK_Acceptor.cpp b/externals/ace/SSL/SSL_SOCK_Acceptor.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_SOCK_Acceptor.cpp rename to externals/ace/SSL/SSL_SOCK_Acceptor.cpp diff --git a/dep/include/ace/SSL/SSL_SOCK_Acceptor.h b/externals/ace/SSL/SSL_SOCK_Acceptor.h similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK_Acceptor.h rename to externals/ace/SSL/SSL_SOCK_Acceptor.h diff --git a/dep/include/ace/SSL/SSL_SOCK_Acceptor.inl b/externals/ace/SSL/SSL_SOCK_Acceptor.inl similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK_Acceptor.inl rename to externals/ace/SSL/SSL_SOCK_Acceptor.inl diff --git a/dep/src/ace/SSL/SSL_SOCK_Connector.cpp b/externals/ace/SSL/SSL_SOCK_Connector.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_SOCK_Connector.cpp rename to externals/ace/SSL/SSL_SOCK_Connector.cpp diff --git a/dep/include/ace/SSL/SSL_SOCK_Connector.h b/externals/ace/SSL/SSL_SOCK_Connector.h similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK_Connector.h rename to externals/ace/SSL/SSL_SOCK_Connector.h diff --git a/dep/include/ace/SSL/SSL_SOCK_Connector.inl b/externals/ace/SSL/SSL_SOCK_Connector.inl similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK_Connector.inl rename to externals/ace/SSL/SSL_SOCK_Connector.inl diff --git a/dep/src/ace/SSL/SSL_SOCK_Stream.cpp b/externals/ace/SSL/SSL_SOCK_Stream.cpp similarity index 100% rename from dep/src/ace/SSL/SSL_SOCK_Stream.cpp rename to externals/ace/SSL/SSL_SOCK_Stream.cpp diff --git a/dep/include/ace/SSL/SSL_SOCK_Stream.h b/externals/ace/SSL/SSL_SOCK_Stream.h similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK_Stream.h rename to externals/ace/SSL/SSL_SOCK_Stream.h diff --git a/dep/include/ace/SSL/SSL_SOCK_Stream.inl b/externals/ace/SSL/SSL_SOCK_Stream.inl similarity index 100% rename from dep/include/ace/SSL/SSL_SOCK_Stream.inl rename to externals/ace/SSL/SSL_SOCK_Stream.inl diff --git a/dep/include/ace/SSL/sslconf.h b/externals/ace/SSL/sslconf.h similarity index 100% rename from dep/include/ace/SSL/sslconf.h rename to externals/ace/SSL/sslconf.h diff --git a/dep/src/ace/SString.cpp b/externals/ace/SString.cpp similarity index 61% rename from dep/src/ace/SString.cpp rename to externals/ace/SString.cpp index 6d68f673bb0..56fc568b659 100644 --- a/dep/src/ace/SString.cpp +++ b/externals/ace/SString.cpp @@ -1,10 +1,7 @@ -// $Id: SString.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SString.cpp 85547 2009-06-07 17:57:11Z johnnyw $ #include "ace/Malloc_T.h" #include "ace/OS_Memory.h" -#if !defined (ACE_HAS_WINCE) -//# include "ace/Service_Config.h" -#endif /* !ACE_HAS_WINCE */ #include "ace/SString.h" #include "ace/Auto_Ptr.h" #include "ace/OS_NS_string.h" @@ -19,10 +16,12 @@ #include "ace/SString.inl" #endif /* __ACE_INLINE__ */ + ACE_RCSID (ace, SString, "SString.cpp,v 4.61 2001/03/04 00:55:30 brunsch Exp") + // ************************************************************ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -334,216 +333,9 @@ ACE_SString::substring (size_type offset, // ************************************************************ -ACE_Tokenizer::ACE_Tokenizer (ACE_TCHAR *buffer) - : buffer_ (buffer), - index_ (0), - preserves_index_ (0), - delimiter_index_ (0) -{ -} - -int -ACE_Tokenizer::delimiter (ACE_TCHAR d) -{ - if (delimiter_index_ == MAX_DELIMITERS) - return -1; - - delimiters_[delimiter_index_].delimiter_ = d; - delimiters_[delimiter_index_].replace_ = 0; - delimiter_index_++; - return 0; -} - -int -ACE_Tokenizer::delimiter_replace (ACE_TCHAR d, - ACE_TCHAR replacement) -{ - // Make it possible to replace delimiters on-the-fly, e.g., parse - // string until certain token count and then copy rest of the - // original string. - for (int i = 0; i < delimiter_index_; i++) - if (delimiters_[i].delimiter_ == d) - { - delimiters_[i].replacement_ = replacement; - delimiters_[i].replace_ = 1; - return 0; - } - - if (delimiter_index_ >= MAX_DELIMITERS) - return -1; - - delimiters_[delimiter_index_].delimiter_ = d; - delimiters_[delimiter_index_].replacement_ = replacement; - delimiters_[delimiter_index_].replace_ = 1; - delimiter_index_++; - return 0; -} - -int -ACE_Tokenizer::preserve_designators (ACE_TCHAR start, - ACE_TCHAR stop, - int strip) -{ - if (preserves_index_ == MAX_PRESERVES) - return -1; - - preserves_[preserves_index_].start_ = start; - preserves_[preserves_index_].stop_ = stop; - preserves_[preserves_index_].strip_ = strip; - preserves_index_++; - return 0; -} - -int -ACE_Tokenizer::is_delimiter (ACE_TCHAR d, - int &replace, - ACE_TCHAR &r) -{ - replace = 0; - - for (int x = 0; x < delimiter_index_; x++) - if (delimiters_[x].delimiter_ == d) - { - if (delimiters_[x].replace_) - { - r = delimiters_[x].replacement_; - replace = 1; - } - return 1; - } - - return 0; -} - -int -ACE_Tokenizer::is_preserve_designator (ACE_TCHAR start, - ACE_TCHAR &stop, - int &strip) -{ - for (int x = 0; x < preserves_index_; x++) - if (preserves_[x].start_ == start) - { - stop = preserves_[x].stop_; - strip = preserves_[x].strip_; - return 1; - } - - return 0; -} - -ACE_TCHAR * -ACE_Tokenizer::next (void) -{ - // Check if the previous pass was the last one in the buffer. - if (index_ == -1) - { - index_ = 0; - return 0; - } - - ACE_TCHAR replacement = 0; - int replace; - ACE_TCHAR *next_token; - - // Skip all leading delimiters. - for (;;) - { - // Check for end of string. - if (buffer_[index_] == '\0') - { - // If we hit EOS at the start, return 0. - index_ = 0; - return 0; - } - - if (this->is_delimiter (buffer_[index_], - replace, - replacement)) - index_++; - else - break; - } - - // When we reach this point, buffer_[index_] is a non-delimiter and - // not EOS - the start of our next_token. - next_token = buffer_ + index_; - - // A preserved region is it's own token. - ACE_TCHAR stop; - int strip; - if (this->is_preserve_designator (buffer_[index_], - stop, - strip)) - { - while (++index_) - { - if (buffer_[index_] == '\0') - { - index_ = -1; - goto EXIT_LABEL; - } - - if (buffer_[index_] == stop) - break; - } - - if (strip) - { - // Skip start preserve designator. - next_token += 1; - // Zap the stop preserve designator. - buffer_[index_] = '\0'; - // Increment to the next token. - index_++; - } - - goto EXIT_LABEL; - } - - // Step through finding the next delimiter or EOS. - for (;;) - { - // Advance pointer. - index_++; - - // Check for delimiter. - if (this->is_delimiter (buffer_[index_], - replace, - replacement)) - { - // Replace the delimiter. - if (replace != 0) - buffer_[index_] = replacement; - - // Move the pointer up and return. - index_++; - goto EXIT_LABEL; - } - - // A preserve designator signifies the end of this token. - if (this->is_preserve_designator (buffer_[index_], - stop, - strip)) - goto EXIT_LABEL; - - // Check for end of string. - if (buffer_[index_] == '\0') - { - index_ = -1; - goto EXIT_LABEL; - } - } - -EXIT_LABEL: - return next_token; -} - -// ************************************************************* - #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) template char ACE_String_Base::NULL_String_; template ACE_WSTRING_TYPE ACE_String_Base::NULL_String_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SString.h b/externals/ace/SString.h similarity index 61% rename from dep/include/ace/SString.h rename to externals/ace/SString.h index dc37be1d871..3efe80af203 100644 --- a/dep/include/ace/SString.h +++ b/externals/ace/SString.h @@ -4,7 +4,7 @@ /** * @file SString.h * - * $Id: SString.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SString.h 86289 2009-07-30 03:40:46Z hillj $ * * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) */ @@ -39,6 +39,12 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT template class ACE_Export ACE_String_Base; template class ACE_Export ACE_String_Base; + +template class ACE_Export ACE_String_Base_Iterator; +template class ACE_Export ACE_String_Base_Iterator; + +template class ACE_Export ACE_String_Base_Const_Iterator; +template class ACE_Export ACE_String_Base_Const_Iterator; #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */ /** @@ -196,7 +202,7 @@ public: /// slot of the first location that matches, else @c npos. size_type strstr (const ACE_SString &s) const; - /// Find starting at pos. Returns the slot of the first + /// Find @a str starting at pos. Returns the slot of the first /// location that matches (will be >= pos), else npos. size_type find (const ACE_SString &str, size_type pos = 0) const; @@ -204,11 +210,11 @@ public: /// location that matches (will be >= pos), else npos. size_type find (const char *s, size_type pos = 0) const; - /// Find starting at pos. Returns the slot of the first + /// Find @a c starting at pos. Returns the slot of the first /// location that matches (will be >= pos), else npos. size_type find (char c, size_type pos = 0) const; - /// Find starting at pos (counting from the end). Returns the + /// Find @a c starting at pos (counting from the end). Returns the /// slot of the first location that matches, else npos. size_type rfind (char c, size_type pos = npos) const; @@ -256,207 +262,6 @@ typedef ACE_WString ACE_TString; typedef ACE_CString ACE_TString; #endif /* ACE_USES_WCHAR */ -// ************************************************************ - -/** - * @class ACE_Tokenizer - * - * @brief Tokenizer - * - * Tokenizes a buffer. Allows application to set delimiters and - * preserve designators. Does not allow special characters, yet - * (e.g., printf ("\"like a quoted string\"")). - */ -class ACE_Export ACE_Tokenizer -{ -public: - /** - * \a buffer will be parsed. Notice that ACE_Tokenizer will modify - * \a buffer if you use delimiter_replace or - * preserve_designators to do character substitution. - * @note You should NOT pass a constant string or string literal - * to this constructor, since ACE_Tokenizer will try to modify - * the string. - * \sa preserve_designators - * \sa preserve_designators - */ - ACE_Tokenizer (ACE_TCHAR *buffer); - - /** - * \a d is a delimiter. - * \return Returns 0 on success, -1 if there is no memory left. - * - * Example: - * \verbatim - char buf[30]; - ACE_OS::strcpy(buf, "William/Joseph/Hagins"); - - ACE_Tokenizer tok (buf); - tok.delimiter ('/'); - for (char *p = tok.next (); p; p = tok.next ()) - cout << p << endl; - \endverbatim - * - * This will print out: - * \verbatim - William/Joseph/Hagins - Joseph/Hagins - Hagins \endverbatim - */ - int delimiter (ACE_TCHAR d); - - /** - * \a d is a delimiter and, when found, will be replaced by - * \a replacement. - * \return 0 on success, -1 if there is no memory left. - * - * Example: - * \verbatim - char buf[30]; - ACE_OS::strcpy(buf, "William/Joseph/Hagins"); - - ACE_Tokenizer tok (buf); - tok.delimiter_replace ('/', 0); - for (char *p = tok.next (); p; p = tok.next ()) - cout << p << endl; - \endverbatim - * - * This will print out: - * \verbatim - William - Joseph - Hagins \endverbatim - */ - int delimiter_replace (ACE_TCHAR d, ACE_TCHAR replacement); - - /** - * Extract string between a pair of designator characters. - * For instance, quotes, or '(' and ')'. - * \a start specifies the begin designator. - * \a stop specifies the end designator. - * \a strip If \a strip == 1, then the preserve - * designators will be stripped from the tokens returned by next. - * \return 0 on success, -1 if there is no memory left. - * - * Example with strip = 0: - * \verbatim - char buf[30]; - ACE_OS::strcpy(buf, "William(Joseph)Hagins"); - - ACE_Tokenizer tok (buf); - tok.preserve_designators ('(', ')', 0); - for (char *p = tok.next (); p; p = tok.next ()) - cout << p << endl; - \endverbatim - * - * This will print out: - * \verbatim - William(Joseph)Hagins - (Joseph)Hagins - )Hagins \endverbatim - * - * Example with strip = 1: - * \verbatim - char buf[30]; - ACE_OS::strcpy(buf, "William(Joseph)Hagins"); - - ACE_Tokenizer tok (buf); - tok.preserve_designators ('(', ')', 1); - for (char *p = tok.next (); p; p = tok.next ()) - cout << p << endl; - \endverbatim - * - * This will print out: - * \verbatim - William - Joseph - Hagins \endverbatim - */ - int preserve_designators (ACE_TCHAR start, ACE_TCHAR stop, int strip=1); - - /// Returns the next token. - ACE_TCHAR *next (void); - - enum { - MAX_DELIMITERS=16, - MAX_PRESERVES=16 - }; - -protected: - /// Returns 1 if is a delimiter, 0 otherwise. If should be - /// replaced with @a r, is set to 1, otherwise 0. - int is_delimiter (ACE_TCHAR d, int &replace, ACE_TCHAR &r); - - /** - * If is a start preserve designator, returns 1 and sets - * to the stop designator. Returns 0 if is not a - * preserve designator. - */ - int is_preserve_designator (ACE_TCHAR start, ACE_TCHAR &stop, int &strip); - - ACE_TCHAR *buffer_; - int index_; - - /** - * @class Preserve_Entry - * - * @brief Preserve Entry - * - * Defines a set of characters that designate an area that - * should not be parsed, but should be treated as a complete - * token. For instance, in: (this is a preserve region), start - * would be a left paren -(- and stop would be a right paren - * -)-. The strip determines whether the designators should be - * removed from the token. - */ - class Preserve_Entry - { - public: - /** - * E.g., "(". - * E.g., ")". - * Whether the designators should be removed from the token. - */ - ACE_TCHAR start_; - ACE_TCHAR stop_; - int strip_; - }; - - /// The application can specify MAX_PRESERVES preserve designators. - Preserve_Entry preserves_[MAX_PRESERVES]; - - /// Pointer to the next free spot in preserves_. - int preserves_index_; - - /** - * @class Delimiter_Entry - * - * @brief Delimiter Entry - * - * Describes a delimiter for the tokenizer. - */ - class Delimiter_Entry - { - public: - /** - * Most commonly a space ' '. - * What occurrences of delimiter_ should be replaced with. - * Whether replacement_ should be used. This should be replaced - * with a technique that sets replacement_ = delimiter by - * default. I'll do that next iteration. - */ - ACE_TCHAR delimiter_; - ACE_TCHAR replacement_; - int replace_; - }; - - /// The tokenizer allows MAX_DELIMITERS number of delimiters. - Delimiter_Entry delimiters_[MAX_DELIMITERS]; - - /// Pointer to the next free space in delimiters_. - int delimiter_index_; -}; - // **************************************************************** /** @@ -496,4 +301,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SSTRING_H */ - diff --git a/dep/include/ace/SString.inl b/externals/ace/SString.inl similarity index 99% rename from dep/include/ace/SString.inl rename to externals/ace/SString.inl index 9bdc1bb96a6..2e4957e2397 100644 --- a/dep/include/ace/SString.inl +++ b/externals/ace/SString.inl @@ -213,7 +213,7 @@ ACE_SString::rfind (char c, size_type pos) const // Do not change to prefix operator! Proper operation of this loop // depends on postfix decrement behavior. - for (size_type i = pos; i-- != 0;) + for (size_type i = pos; i-- != 0; ) if (this->rep_[i] == c) return i; diff --git a/dep/include/ace/SStringfwd.h b/externals/ace/SStringfwd.h similarity index 91% rename from dep/include/ace/SStringfwd.h rename to externals/ace/SStringfwd.h index f73a39d023b..50f30f69c03 100644 --- a/dep/include/ace/SStringfwd.h +++ b/externals/ace/SStringfwd.h @@ -4,7 +4,7 @@ /** * @file SStringfwd.h * - * $Id: SStringfwd.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SStringfwd.h 88793 2010-02-01 17:50:34Z cleeland $ * * Forward declarations and typedefs of ACE string types. * @@ -33,7 +33,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template class ACE_String_Base; // Forward declaration. +template class ACE_String_Base; // Forward declaration. typedef ACE_WCHAR_T ACE_WSTRING_TYPE; @@ -53,4 +53,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SSTRINGFWD_H */ - diff --git a/dep/src/ace/SUN_Proactor.cpp b/externals/ace/SUN_Proactor.cpp similarity index 94% rename from dep/src/ace/SUN_Proactor.cpp rename to externals/ace/SUN_Proactor.cpp index 7ce76eb0472..9c27fbd43e7 100644 --- a/dep/src/ace/SUN_Proactor.cpp +++ b/externals/ace/SUN_Proactor.cpp @@ -1,4 +1,4 @@ -// $Id: SUN_Proactor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: SUN_Proactor.cpp 84455 2009-02-13 13:31:02Z johnnyw $ #include "ace/SUN_Proactor.h" @@ -8,9 +8,11 @@ #include "ace/Log_Msg.h" #include "ace/Object_Manager.h" + ACE_RCSID (ace, POSIX_CB_Proactor, - "$Id: SUN_Proactor.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: SUN_Proactor.cpp 84455 2009-02-13 13:31:02Z johnnyw $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -110,8 +112,8 @@ ACE_SUN_Proactor::handle_events_i (ACE_Time_Value *delta) default: // EFAULT ACE_ERROR_RETURN ((LM_ERROR, - "%N:%l:(%P | %t)::%p \nNumAIO=%d\n", - "ACE_SUN_Proactor::handle_events: aiowait failed", + ACE_TEXT("%N:%l:(%P | %t)::%p \nNumAIO=%d\n"), + ACE_TEXT("ACE_SUN_Proactor::handle_events: aiowait failed"), num_started_aio_), -1); } @@ -200,9 +202,9 @@ ACE_SUN_Proactor::find_completed_aio (aio_result_t *result, transfer_count) == 0) { // should never be ACE_ERROR ((LM_ERROR, - "%N:%l:(%P | %t)::%p\n", - "ACE_SUN_Proactor::find_completed_aio:" - "should never be !!!\n")); + ACE_TEXT("%N:%l:(%P | %t)::%p\n"), + ACE_TEXT("ACE_SUN_Proactor::find_completed_aio:") + ACE_TEXT("should never be !!!\n"))); return 0; } @@ -320,4 +322,3 @@ ACE_SUN_Proactor::get_impl_type (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS && sun */ - diff --git a/dep/include/ace/SUN_Proactor.h b/externals/ace/SUN_Proactor.h similarity index 99% rename from dep/include/ace/SUN_Proactor.h rename to externals/ace/SUN_Proactor.h index 135b0f0e8ff..496616279f0 100644 --- a/dep/include/ace/SUN_Proactor.h +++ b/externals/ace/SUN_Proactor.h @@ -124,4 +124,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_AIO_CALLS && sun */ #endif /* ACE_SUN_PROACTOR_H*/ - diff --git a/dep/src/ace/SV_Message.cpp b/externals/ace/SV_Message.cpp similarity index 99% rename from dep/src/ace/SV_Message.cpp rename to externals/ace/SV_Message.cpp index b060172e5ef..5334cca6f77 100644 --- a/dep/src/ace/SV_Message.cpp +++ b/externals/ace/SV_Message.cpp @@ -22,4 +22,3 @@ ACE_SV_Message::dump (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SV_Message.h b/externals/ace/SV_Message.h similarity index 99% rename from dep/include/ace/SV_Message.h rename to externals/ace/SV_Message.h index 26a0d45c975..395d35834a2 100644 --- a/dep/include/ace/SV_Message.h +++ b/externals/ace/SV_Message.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_SV_MESSAGE_H #define ACE_SV_MESSAGE_H @@ -56,6 +57,7 @@ protected: ACE_END_VERSIONED_NAMESPACE_DECL + #if defined (__ACE_INLINE__) #include "ace/SV_Message.inl" #endif /* __ACE_INLINE__ */ @@ -63,4 +65,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SV_MESSAGE_H */ - diff --git a/dep/include/ace/SV_Message.inl b/externals/ace/SV_Message.inl similarity index 100% rename from dep/include/ace/SV_Message.inl rename to externals/ace/SV_Message.inl diff --git a/dep/src/ace/SV_Message_Queue.cpp b/externals/ace/SV_Message_Queue.cpp similarity index 99% rename from dep/src/ace/SV_Message_Queue.cpp rename to externals/ace/SV_Message_Queue.cpp index 917b36829a0..a1c9d88791a 100644 --- a/dep/src/ace/SV_Message_Queue.cpp +++ b/externals/ace/SV_Message_Queue.cpp @@ -42,4 +42,3 @@ ACE_SV_Message_Queue::ACE_SV_Message_Queue (key_t external_id, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SV_Message_Queue.h b/externals/ace/SV_Message_Queue.h similarity index 99% rename from dep/include/ace/SV_Message_Queue.h rename to externals/ace/SV_Message_Queue.h index 660fc9efb7a..3698ca90da7 100644 --- a/dep/include/ace/SV_Message_Queue.h +++ b/externals/ace/SV_Message_Queue.h @@ -103,4 +103,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SV_MESSAGE_QUEUE_H */ - diff --git a/dep/include/ace/SV_Message_Queue.inl b/externals/ace/SV_Message_Queue.inl similarity index 100% rename from dep/include/ace/SV_Message_Queue.inl rename to externals/ace/SV_Message_Queue.inl diff --git a/dep/src/ace/SV_Semaphore_Complex.cpp b/externals/ace/SV_Semaphore_Complex.cpp similarity index 99% rename from dep/src/ace/SV_Semaphore_Complex.cpp rename to externals/ace/SV_Semaphore_Complex.cpp index 8ff99c052be..c88c9dde46a 100644 --- a/dep/src/ace/SV_Semaphore_Complex.cpp +++ b/externals/ace/SV_Semaphore_Complex.cpp @@ -257,4 +257,3 @@ ACE_SV_Semaphore_Complex::ACE_SV_Semaphore_Complex (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SV_Semaphore_Complex.h b/externals/ace/SV_Semaphore_Complex.h similarity index 99% rename from dep/include/ace/SV_Semaphore_Complex.h rename to externals/ace/SV_Semaphore_Complex.h index c4805a577e3..fc01ba46789 100644 --- a/dep/include/ace/SV_Semaphore_Complex.h +++ b/externals/ace/SV_Semaphore_Complex.h @@ -157,4 +157,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SV_SEMAPHORE_COMPLEX_H */ - diff --git a/dep/include/ace/SV_Semaphore_Complex.inl b/externals/ace/SV_Semaphore_Complex.inl similarity index 100% rename from dep/include/ace/SV_Semaphore_Complex.inl rename to externals/ace/SV_Semaphore_Complex.inl diff --git a/dep/src/ace/SV_Semaphore_Simple.cpp b/externals/ace/SV_Semaphore_Simple.cpp similarity index 95% rename from dep/src/ace/SV_Semaphore_Simple.cpp rename to externals/ace/SV_Semaphore_Simple.cpp index f7727fd163d..071ee4bb4d7 100644 --- a/dep/src/ace/SV_Semaphore_Simple.cpp +++ b/externals/ace/SV_Semaphore_Simple.cpp @@ -9,7 +9,7 @@ ACE_RCSID (ace, SV_Semaphore_Simple, - "$Id: SV_Semaphore_Simple.cpp 82559 2008-08-07 20:23:07Z parsons $") + "$Id: SV_Semaphore_Simple.cpp 85110 2009-04-20 09:18:43Z msmit $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -138,15 +138,15 @@ ACE_SV_Semaphore_Simple::name_2_key (const char *name) // Basically "hash" the values in the . This won't // necessarily guarantee uniqueness of all keys. // But (IMHO) CRC32 is good enough for most purposes (Carlos) -#if defined (ACE_WIN64) || defined (ACE_WIN32) +#if defined (ACE_WIN32) && defined (_MSC_VER) // The cast below is legit... # pragma warning(push) # pragma warning(disable : 4312) -#endif /* ACE_WIN64 */ +#endif /* defined (ACE_WIN32) && defined (_MSC_VER) */ return (key_t) ACE::crc32 (name); -#if defined (ACE_WIN64) || defined (ACE_WIN32) +#if defined (ACE_WIN32) && defined (_MSC_VER) # pragma warning(pop) -#endif /* ACE_WIN64 */ +#endif /* defined (ACE_WIN32) && defined (_MSC_VER) */ } // Open or create a ACE_SV_Semaphore. We return 1 if all is OK, else @@ -235,4 +235,3 @@ ACE_SV_Semaphore_Simple::remove (void) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SV_Semaphore_Simple.h b/externals/ace/SV_Semaphore_Simple.h similarity index 97% rename from dep/include/ace/SV_Semaphore_Simple.h rename to externals/ace/SV_Semaphore_Simple.h index d51034e59e4..4bf2121aa30 100644 --- a/dep/include/ace/SV_Semaphore_Simple.h +++ b/externals/ace/SV_Semaphore_Simple.h @@ -4,7 +4,7 @@ /** * @file SV_Semaphore_Simple.h * - * $Id: SV_Semaphore_Simple.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: SV_Semaphore_Simple.h 86494 2009-08-13 19:09:03Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -29,7 +29,7 @@ #if defined (ACE_WIN32) // Default semaphore key and mutex name # if !defined (ACE_DEFAULT_SEM_KEY) -# define ACE_DEFAULT_SEM_KEY "ACE_SEM_KEY" +# define ACE_DEFAULT_SEM_KEY const_cast ("ACE_SEM_KEY") # endif /* ACE_DEFAULT_SEM_KEY */ #else /* !defined (ACE_WIN32) */ // Default semaphore key @@ -195,4 +195,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* _SV_SEMAPHORE_SIMPLE_H */ - diff --git a/dep/include/ace/SV_Semaphore_Simple.inl b/externals/ace/SV_Semaphore_Simple.inl similarity index 100% rename from dep/include/ace/SV_Semaphore_Simple.inl rename to externals/ace/SV_Semaphore_Simple.inl diff --git a/dep/src/ace/SV_Shared_Memory.cpp b/externals/ace/SV_Shared_Memory.cpp similarity index 99% rename from dep/src/ace/SV_Shared_Memory.cpp rename to externals/ace/SV_Shared_Memory.cpp index 122753989c2..9db097ca2e8 100644 --- a/dep/src/ace/SV_Shared_Memory.cpp +++ b/externals/ace/SV_Shared_Memory.cpp @@ -86,4 +86,3 @@ ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (ACE_HANDLE int_id, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/SV_Shared_Memory.h b/externals/ace/SV_Shared_Memory.h similarity index 99% rename from dep/include/ace/SV_Shared_Memory.h rename to externals/ace/SV_Shared_Memory.h index f4bc944efa2..fb34f286b79 100644 --- a/dep/include/ace/SV_Shared_Memory.h +++ b/externals/ace/SV_Shared_Memory.h @@ -119,4 +119,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SV_SHARED_MEMORY_H */ - diff --git a/dep/include/ace/SV_Shared_Memory.inl b/externals/ace/SV_Shared_Memory.inl similarity index 100% rename from dep/include/ace/SV_Shared_Memory.inl rename to externals/ace/SV_Shared_Memory.inl diff --git a/dep/src/ace/Sample_History.cpp b/externals/ace/Sample_History.cpp similarity index 86% rename from dep/src/ace/Sample_History.cpp rename to externals/ace/Sample_History.cpp index b3bf7d36a92..03e5d7a8c57 100644 --- a/dep/src/ace/Sample_History.cpp +++ b/externals/ace/Sample_History.cpp @@ -1,4 +1,4 @@ -// $Id: Sample_History.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Sample_History.cpp 83891 2008-11-28 11:01:50Z johnnyw $ #include "ace/Sample_History.h" @@ -10,7 +10,8 @@ #include "ace/Log_Msg.h" #include "ace/OS_Memory.h" -ACE_RCSID(ace, Sample_History, "$Id: Sample_History.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Sample_History, "$Id: Sample_History.cpp 83891 2008-11-28 11:01:50Z johnnyw $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -45,7 +46,7 @@ ACE_Sample_History::dump_samples (const ACE_TCHAR *msg, #ifndef ACE_NLOGGING for (size_t i = 0; i != this->sample_count_; ++i) { - const ACE_UINT64 val = this->samples_[i] / scale_factor; + ACE_UINT64 const val = this->samples_[i] / scale_factor; ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s: ") ACE_SIZE_T_FORMAT_SPECIFIER @@ -70,4 +71,3 @@ ACE_Sample_History::collect_basic_stats (ACE_Basic_Stats &stats) const } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Sample_History.h b/externals/ace/Sample_History.h similarity index 100% rename from dep/include/ace/Sample_History.h rename to externals/ace/Sample_History.h index 9e4d39b6a27..730deea4fab 100644 --- a/dep/include/ace/Sample_History.h +++ b/externals/ace/Sample_History.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_SAMPLE_HISTORY_H #define ACE_SAMPLE_HISTORY_H #include /**/ "ace/pre.h" @@ -88,4 +89,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SAMPLE_HISTORY_H */ - diff --git a/dep/include/ace/Sample_History.inl b/externals/ace/Sample_History.inl similarity index 100% rename from dep/include/ace/Sample_History.inl rename to externals/ace/Sample_History.inl diff --git a/dep/src/ace/Sbrk_Memory_Pool.cpp b/externals/ace/Sbrk_Memory_Pool.cpp similarity index 99% rename from dep/src/ace/Sbrk_Memory_Pool.cpp rename to externals/ace/Sbrk_Memory_Pool.cpp index ec17dfcd291..c8c5d3f5a3b 100644 --- a/dep/src/ace/Sbrk_Memory_Pool.cpp +++ b/externals/ace/Sbrk_Memory_Pool.cpp @@ -122,4 +122,3 @@ ACE_Sbrk_Memory_Pool::round_up (size_t nbytes) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* !ACE_LACKS_SBRK */ - diff --git a/dep/include/ace/Sbrk_Memory_Pool.h b/externals/ace/Sbrk_Memory_Pool.h similarity index 100% rename from dep/include/ace/Sbrk_Memory_Pool.h rename to externals/ace/Sbrk_Memory_Pool.h index 0eace0f3fe3..501994860d9 100644 --- a/dep/include/ace/Sbrk_Memory_Pool.h +++ b/externals/ace/Sbrk_Memory_Pool.h @@ -27,6 +27,7 @@ #include "ace/ACE.h" #include "ace/os_include/sys/os_mman.h" + ACE_BEGIN_VERSIONED_NAMESPACE_DECL /** @@ -115,4 +116,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SBRK_MEMORY_POOL_H */ - diff --git a/dep/src/ace/Sched_Params.cpp b/externals/ace/Sched_Params.cpp similarity index 91% rename from dep/src/ace/Sched_Params.cpp rename to externals/ace/Sched_Params.cpp index b6e84f7ca67..61a044f81c7 100644 --- a/dep/src/ace/Sched_Params.cpp +++ b/externals/ace/Sched_Params.cpp @@ -3,12 +3,13 @@ /** * @file Sched_Params.cpp * - * $Id: Sched_Params.cpp 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Sched_Params.cpp 83624 2008-11-09 11:45:59Z johnnyw $ * * @author David Levine */ //============================================================================= + #include "ace/Sched_Params.h" #if !defined (__ACE_INLINE__) @@ -20,7 +21,7 @@ # include /**/ #endif /* ACE_HAS_PRIOCNTL && ACE_HAS_THREADS */ -ACE_RCSID(ace, Sched_Params, "$Id: Sched_Params.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Sched_Params, "$Id: Sched_Params.cpp 83624 2008-11-09 11:45:59Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -114,10 +115,14 @@ ACE_Sched_Params::priority_min (const Policy policy, } } -#elif defined (ACE_HAS_WTHREADS) +#elif defined (ACE_HAS_WTHREADS) && !defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); return THREAD_PRIORITY_IDLE; +#elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WINCE) + ACE_UNUSED_ARG (policy); + ACE_UNUSED_ARG (scope); + return 255; #elif defined (ACE_VXWORKS) ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); @@ -218,10 +223,14 @@ ACE_Sched_Params::priority_max (const Policy policy, } } -#elif defined (ACE_HAS_WTHREADS) +#elif defined (ACE_HAS_WTHREADS) && !defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); return THREAD_PRIORITY_TIME_CRITICAL; +#elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WINCE) + ACE_UNUSED_ARG (policy); + ACE_UNUSED_ARG (scope); + return 0; #elif defined (ACE_VXWORKS) ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); @@ -242,7 +251,7 @@ ACE_Sched_Params::next_priority (const Policy policy, const int priority, const int scope) { -#if defined (ACE_HAS_WTHREADS) +#if defined (ACE_HAS_WTHREADS) && !defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); switch (priority) @@ -270,10 +279,9 @@ ACE_Sched_Params::next_priority (const Policy policy, // including STHREADS, and PTHREADS int const max = priority_max (policy, scope); return priority < max ? priority + 1 : max; -#elif defined (ACE_VXWORKS) - return priority > priority_max (policy, scope) - ? priority - 1 - : priority_max (policy, scope); +#elif defined (ACE_VXWORKS) || defined (ACE_HAS_WINCE) + int const max = priority_max (policy, scope); + return priority > max ? priority - 1 : max; #else ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); @@ -287,7 +295,7 @@ ACE_Sched_Params::previous_priority (const Policy policy, const int priority, const int scope) { -#if defined (ACE_HAS_WTHREADS) +#if defined (ACE_HAS_WTHREADS) && !defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); switch (priority) @@ -314,12 +322,10 @@ ACE_Sched_Params::previous_priority (const Policy policy, defined (ACE_HAS_PTHREAD_SCHEDPARAM)) // including STHREADS and PTHREADS int const min = priority_min (policy, scope); - return priority > min ? priority - 1 : min; -#elif defined (ACE_VXWORKS) - return priority < priority_min (policy, scope) - ? priority + 1 - : priority_min (policy, scope); +#elif defined (ACE_VXWORKS) || defined (ACE_HAS_WINCE) + int const min = priority_min (policy, scope); + return priority < min ? priority + 1 : min; #else ACE_UNUSED_ARG (policy); ACE_UNUSED_ARG (scope); @@ -329,4 +335,3 @@ ACE_Sched_Params::previous_priority (const Policy policy, } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Sched_Params.h b/externals/ace/Sched_Params.h similarity index 99% rename from dep/include/ace/Sched_Params.h rename to externals/ace/Sched_Params.h index 29983a36a92..6bde2ddeb22 100644 --- a/dep/include/ace/Sched_Params.h +++ b/externals/ace/Sched_Params.h @@ -230,4 +230,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SCHED_PARAMS_H */ - diff --git a/dep/include/ace/Sched_Params.inl b/externals/ace/Sched_Params.inl similarity index 99% rename from dep/include/ace/Sched_Params.inl rename to externals/ace/Sched_Params.inl index ef4416e30ec..73803ac1785 100644 --- a/dep/include/ace/Sched_Params.inl +++ b/externals/ace/Sched_Params.inl @@ -10,6 +10,7 @@ */ //============================================================================= + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE diff --git a/dep/include/ace/Select_Reactor.h b/externals/ace/Select_Reactor.h similarity index 99% rename from dep/include/ace/Select_Reactor.h rename to externals/ace/Select_Reactor.h index f3595e0474f..fdfd78eb6e5 100644 --- a/dep/include/ace/Select_Reactor.h +++ b/externals/ace/Select_Reactor.h @@ -67,4 +67,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_SELECT_REACTOR_H */ - diff --git a/dep/src/ace/Select_Reactor_Base.cpp b/externals/ace/Select_Reactor_Base.cpp similarity index 95% rename from dep/src/ace/Select_Reactor_Base.cpp rename to externals/ace/Select_Reactor_Base.cpp index d4bc11b6ef8..225c9f7f9f1 100644 --- a/dep/src/ace/Select_Reactor_Base.cpp +++ b/externals/ace/Select_Reactor_Base.cpp @@ -1,4 +1,4 @@ -// $Id: Select_Reactor_Base.cpp 81153 2008-03-29 08:17:58Z johnnyw $ +// $Id: Select_Reactor_Base.cpp 88832 2010-02-04 09:57:42Z johnnyw $ #include "ace/Select_Reactor_Base.h" #include "ace/Reactor.h" @@ -20,7 +20,8 @@ ACE_RCSID (ace, Select_Reactor_Base, - "$Id: Select_Reactor_Base.cpp 81153 2008-03-29 08:17:58Z johnnyw $") + "$Id: Select_Reactor_Base.cpp 88832 2010-02-04 09:57:42Z johnnyw $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -690,7 +691,9 @@ ACE_Select_Reactor_Notify::notify (ACE_Event_Handler *event_handler, ACE_Event_Handler_var safe_handler (event_handler); if (event_handler) - event_handler->add_reference (); + { + event_handler->add_reference (); + } ACE_Notification_Buffer buffer (event_handler, mask); @@ -717,7 +720,9 @@ ACE_Select_Reactor_Notify::notify (ACE_Event_Handler *event_handler, sizeof buffer, timeout); if (n == -1) - return -1; + { + return -1; + } // No failures. safe_handler.release (); @@ -748,6 +753,7 @@ ACE_Select_Reactor_Notify::dispatch_notifications (int &number_of_active_handles return 0; } + ACE_HANDLE ACE_Select_Reactor_Notify::notify_handle (void) { @@ -756,6 +762,7 @@ ACE_Select_Reactor_Notify::notify_handle (void) return this->notification_pipe_.read_handle (); } + int ACE_Select_Reactor_Notify::is_dispatchable (ACE_Notification_Buffer &buffer) { @@ -797,14 +804,9 @@ ACE_Select_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) more_messages_queued, next); - if (result == 0) + if (result == 0 || result == -1) { - return 0; - } - - if (result == -1) - { - return -1; + return result; } if(more_messages_queued) @@ -871,6 +873,25 @@ ACE_Select_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, { ACE_TRACE ("ACE_Select_Reactor_Notify::read_notify_pipe"); + // This is kind of a weird, fragile beast. We first read with a + // regular read. The read side of this socket is non-blocking, so + // the read may end up being short. + // + // If the read is short, then we do a recv_n to insure that we block + // and read the rest of the buffer. + // + // Now, you might be tempted to say, "why don't we just replace the + // first recv with a recv_n?" I was, too. But that doesn't work + // because of how the calling code in handle_input() works. In + // handle_input, the event will only be dispatched if the return + // value from read_notify_pipe() is > 0. That means that we can't + // return zero from this func unless it's an EOF condition. + // + // Thus, the return value semantics for this are: + // -1: nothing read, fatal, unrecoverable error + // 0: nothing read at all + // 1: complete buffer read + ssize_t const n = ACE::recv (handle, (char *) &buffer, sizeof buffer); if (n > 0) @@ -884,12 +905,13 @@ ACE_Select_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, // doesn't work we're in big trouble since the input stream // won't be aligned correctly. I'm not sure quite what to // do at this point. It's probably best just to return -1. - if (ACE::recv (handle, - ((char *) &buffer) + n, - remainder) != remainder) + if (ACE::recv_n (handle, + ((char *) &buffer) + n, + remainder) != remainder) return -1; } + return 1; } @@ -900,6 +922,7 @@ ACE_Select_Reactor_Notify::read_notify_pipe (ACE_HANDLE handle, return 0; } + int ACE_Select_Reactor_Notify::handle_input (ACE_HANDLE handle) { @@ -911,6 +934,9 @@ ACE_Select_Reactor_Notify::handle_input (ACE_HANDLE handle) int result = 0; ACE_Notification_Buffer buffer; + // If there is only one buffer in the pipe, this will loop and call + // read_notify_pipe() twice. The first time will read the buffer, and + // the second will read the fact that the pipe is empty. while ((result = this->read_notify_pipe (handle, buffer)) > 0) { // Dispatch the buffer @@ -950,6 +976,7 @@ ACE_Select_Reactor_Impl::purge_pending_notifications (ACE_Event_Handler *eh, return this->notify_handler_->purge_pending_notifications (eh, mask); } + // Perform GET, CLR, SET, and ADD operations on the Handle_Sets. // // GET = 1, Retrieve current value @@ -1097,6 +1124,7 @@ ACE_Select_Reactor_Impl::clear_dispatch_mask (ACE_HANDLE handle, this->state_changed_ = true; } + int ACE_Select_Reactor_Impl::resumable_handler (void) { @@ -1107,4 +1135,3 @@ ACE_Select_Reactor_Impl::resumable_handler (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Select_Reactor_Base.h b/externals/ace/Select_Reactor_Base.h similarity index 98% rename from dep/include/ace/Select_Reactor_Base.h rename to externals/ace/Select_Reactor_Base.h index 65b24cd5f23..7902791624b 100644 --- a/dep/include/ace/Select_Reactor_Base.h +++ b/externals/ace/Select_Reactor_Base.h @@ -4,7 +4,7 @@ /** * @file Select_Reactor_Base.h * - * $Id: Select_Reactor_Base.h 82393 2008-07-23 10:52:34Z johnnyw $ + * $Id: Select_Reactor_Base.h 87252 2009-10-28 20:03:48Z cleeland $ * * @author Douglas C. Schmidt */ @@ -180,6 +180,11 @@ public: /// Read one of the notify call on the @a handle into the /// @a buffer. This could be because of a thread trying to unblock /// the Reactor_Impl + /// + /// Return value semantics for this are: + /// -1: nothing read, fatal, unrecoverable error + /// 0: nothing read at all + /// 1: complete buffer read virtual int read_notify_pipe (ACE_HANDLE handle, ACE_Notification_Buffer &buffer); @@ -502,7 +507,7 @@ protected: /// appropriate point specified by . virtual void renew (void) = 0; - /// Check to see if the associated with @a handle is + /// Check to see if the Event_Handler associated with @a handle is /// suspended. Returns 0 if not, 1 if so. virtual int is_suspended_i (ACE_HANDLE handle) = 0; @@ -554,7 +559,7 @@ protected: /// Restart the event-loop method automatically when /// /. Pass over both the *and* the + * , , or . */ -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL - class ACE_Export ACE_Time_Value { public: @@ -333,7 +327,7 @@ public: private: /// Put the timevalue into a canonical form. - void normalize (void); + void normalize (bool saturate = false); /// Store the values as a timeval. #if defined (ACE_HAS_TIME_T_LONG_MISMATCH) @@ -355,16 +349,16 @@ private: #endif /* ACE_HAS_TIME_T_LONG_MISMATCH */ }; +#ifdef ACE_HAS_CPP98_IOSTREAMS +extern ACE_Export ostream &operator<<( ostream &o, const ACE_Time_Value &v ); +#endif + ACE_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) #include "ace/Time_Value.inl" #endif /* __ACE_INLINE__ */ -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif - #if defined (__MINGW32__) ACE_BEGIN_VERSIONED_NAMESPACE_DECL // The MingW linker has problems with the exported statics @@ -378,4 +372,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIME_VALUE_H */ - diff --git a/dep/include/ace/Time_Value.inl b/externals/ace/Time_Value.inl similarity index 83% rename from dep/include/ace/Time_Value.inl rename to externals/ace/Time_Value.inl index 27433389323..23d6f2dca94 100644 --- a/dep/include/ace/Time_Value.inl +++ b/externals/ace/Time_Value.inl @@ -1,23 +1,12 @@ // -*- C++ -*- // -// $Id: Time_Value.inl 82610 2008-08-12 19:46:36Z parsons $ +// $Id: Time_Value.inl 88502 2010-01-12 19:53:17Z olli $ #include "ace/Truncate.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - -// Returns the value of the object as a timeval. - +/// Returns the value of the object as a timeval. ACE_INLINE ACE_Time_Value::operator timeval () const { @@ -69,7 +58,19 @@ ACE_INLINE void ACE_Time_Value::set (time_t sec, suseconds_t usec) { // ACE_OS_TRACE ("ACE_Time_Value::set"); +# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) && defined (_MSC_VER) + // The WinCE 6.0 SDK ships with a timeval tv_sec member that uses long as type + // not time_t. This resolves in compilation warnings because time_t + // can be 64bit. Disable at this momemt the warning for just this method + // else we get a compile warnings each time this inline file is included + // this file. +# pragma warning (push) +# pragma warning (disable: 4244) +# endif this->tv_.tv_sec = sec; +# if defined (_WIN32_WCE) && (_WIN32_WCE == 0x600) && !defined (_USE_32BIT_TIME_T) && defined (_MSC_VER) +# pragma warning (pop) +# endif this->tv_.tv_usec = usec; #if __GNUC__ if (__builtin_constant_p(sec) && @@ -90,10 +91,9 @@ ACE_Time_Value::set (double d) this->normalize (); } -// Initializes a timespec_t. Note that this approach loses precision -// since it converts the nano-seconds into micro-seconds. But then -// again, do any real systems have nano-second timer precision?! - +/// Initializes a timespec_t. Note that this approach loses precision +/// since it converts the nano-seconds into micro-seconds. But then +/// again, do any real systems have nano-second timer precision?! ACE_INLINE void ACE_Time_Value::set (const timespec_t &tv) { @@ -118,8 +118,7 @@ ACE_Time_Value::ACE_Time_Value (time_t sec, suseconds_t usec) this->set (sec, usec); } -// Returns number of seconds. - +/// Returns number of seconds. ACE_INLINE time_t ACE_Time_Value::sec (void) const { @@ -127,8 +126,7 @@ ACE_Time_Value::sec (void) const return this->tv_.tv_sec; } -// Sets the number of seconds. - +/// Sets the number of seconds. ACE_INLINE void ACE_Time_Value::sec (time_t sec) { @@ -136,8 +134,7 @@ ACE_Time_Value::sec (time_t sec) this->tv_.tv_sec = ACE_Utils::truncate_cast (sec); } -// Converts from Time_Value format into milli-seconds format. - +/// Converts from Time_Value format into milli-seconds format. ACE_INLINE unsigned long ACE_Time_Value::msec (void) const { @@ -167,8 +164,7 @@ ACE_Time_Value::msec (ACE_UINT64 &ms) /*const*/ tv->msec (ms); } -// Converts from milli-seconds format into Time_Value format. - +/// Converts from milli-seconds format into Time_Value format. ACE_INLINE void ACE_Time_Value::msec (long milliseconds) { @@ -180,16 +176,14 @@ ACE_Time_Value::msec (long milliseconds) this->tv_.tv_usec = (milliseconds - (secs * 1000)) * 1000; } -// Converts from milli-seconds format into Time_Value format. - +/// Converts from milli-seconds format into Time_Value format. ACE_INLINE void ACE_Time_Value::msec (int milliseconds) { ACE_Time_Value::msec (static_cast (milliseconds)); } -// Returns number of micro-seconds. - +/// Returns number of micro-seconds. ACE_INLINE suseconds_t ACE_Time_Value::usec (void) const { @@ -197,8 +191,7 @@ ACE_Time_Value::usec (void) const return this->tv_.tv_usec; } -// Sets the number of micro-seconds. - +/// Sets the number of micro-seconds. ACE_INLINE void ACE_Time_Value::usec (suseconds_t usec) { @@ -218,7 +211,7 @@ ACE_Time_Value::to_usec (ACE_UINT64 & usec) const usec = ACE_U_LongLong (this->tv_.tv_sec); #else usec = static_cast (this->tv_.tv_sec); -#endif /* ACE_LACKS_LONG_LONG_T */ +#endif /* ACE_LACKS_LONGLONG_T */ usec *= 1000000; usec += this->tv_.tv_usec; } @@ -235,8 +228,7 @@ operator * (const ACE_Time_Value &tv, double d) return ACE_Time_Value (tv) *= d; } -// True if tv1 > tv2. - +/// True if tv1 > tv2. ACE_INLINE bool operator > (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -251,8 +243,7 @@ operator > (const ACE_Time_Value &tv1, return 0; } -// True if tv1 >= tv2. - +/// True if tv1 >= tv2. ACE_INLINE bool operator >= (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -267,8 +258,7 @@ operator >= (const ACE_Time_Value &tv1, return 0; } -// Returns the value of the object as a timespec_t. - +/// Returns the value of the object as a timespec_t. ACE_INLINE ACE_Time_Value::operator timespec_t () const { @@ -280,8 +270,7 @@ ACE_Time_Value::operator timespec_t () const return tv; } -// Initializes the ACE_Time_Value object from a timespec_t. - +/// Initializes the ACE_Time_Value object from a timespec_t. ACE_INLINE ACE_Time_Value::ACE_Time_Value (const timespec_t &tv) // : tv_ () @@ -290,8 +279,7 @@ ACE_Time_Value::ACE_Time_Value (const timespec_t &tv) this->set (tv); } -// True if tv1 < tv2. - +/// True if tv1 < tv2. ACE_INLINE bool operator < (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -300,8 +288,7 @@ operator < (const ACE_Time_Value &tv1, return tv2 > tv1; } -// True if tv1 >= tv2. - +/// True if tv1 >= tv2. ACE_INLINE bool operator <= (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -310,8 +297,7 @@ operator <= (const ACE_Time_Value &tv1, return tv2 >= tv1; } -// True if tv1 == tv2. - +/// True if tv1 == tv2. ACE_INLINE bool operator == (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -321,8 +307,7 @@ operator == (const ACE_Time_Value &tv1, && tv1.usec () == tv2.usec (); } -// True if tv1 != tv2. - +/// True if tv1 != tv2. ACE_INLINE bool operator != (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -331,8 +316,7 @@ operator != (const ACE_Time_Value &tv1, return !(tv1 == tv2); } -// Add TV to this. - +/// Add TV to this. ACE_INLINE ACE_Time_Value & ACE_Time_Value::operator+= (const ACE_Time_Value &tv) { @@ -369,8 +353,7 @@ ACE_Time_Value::operator= (time_t tv) return *this; } -// Subtract TV to this. - +/// Subtract TV to this. ACE_INLINE ACE_Time_Value & ACE_Time_Value::operator-= (const ACE_Time_Value &tv) { @@ -389,8 +372,7 @@ ACE_Time_Value::operator-= (time_t tv) return *this; } -// Adds two ACE_Time_Value objects together, returns the sum. - +/// Adds two ACE_Time_Value objects together, returns the sum. ACE_INLINE ACE_Time_Value operator + (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -402,8 +384,7 @@ operator + (const ACE_Time_Value &tv1, return sum; } -// Subtracts two ACE_Time_Value objects, returns the difference. - +/// Subtracts two ACE_Time_Value objects, returns the difference. ACE_INLINE ACE_Time_Value operator - (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2) @@ -415,8 +396,4 @@ operator - (const ACE_Time_Value &tv1, return delta; } -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif - ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Timeprobe.cpp b/externals/ace/Timeprobe.cpp similarity index 99% rename from dep/src/ace/Timeprobe.cpp rename to externals/ace/Timeprobe.cpp index b92960415cf..1fe8459ed8d 100644 --- a/dep/src/ace/Timeprobe.cpp +++ b/externals/ace/Timeprobe.cpp @@ -13,4 +13,3 @@ ACE_RCSID(ace, Timeprobe, "$Id: Timeprobe.cpp 80826 2008-03-04 14:51:23Z wotte $ #endif /* __ACE_INLINE__ */ #endif /* ACE_COMPILE_TIMEPROBES */ - diff --git a/dep/include/ace/Timeprobe.h b/externals/ace/Timeprobe.h similarity index 99% rename from dep/include/ace/Timeprobe.h rename to externals/ace/Timeprobe.h index 4ec811e6317..ac2abe38d0e 100644 --- a/dep/include/ace/Timeprobe.h +++ b/externals/ace/Timeprobe.h @@ -199,4 +199,3 @@ static int ace_timeprobe_##descriptions##_return = \ #endif /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */ #include /**/ "ace/post.h" #endif /* ACE_TIMEPROBE_H */ - diff --git a/dep/include/ace/Timeprobe.inl b/externals/ace/Timeprobe.inl similarity index 100% rename from dep/include/ace/Timeprobe.inl rename to externals/ace/Timeprobe.inl diff --git a/dep/src/ace/Timeprobe_T.cpp b/externals/ace/Timeprobe_T.cpp similarity index 99% rename from dep/src/ace/Timeprobe_T.cpp rename to externals/ace/Timeprobe_T.cpp index 2c0c8cf92f0..d23b7b8b869 100644 --- a/dep/src/ace/Timeprobe_T.cpp +++ b/externals/ace/Timeprobe_T.cpp @@ -425,4 +425,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_COMPILE_TIMEPROBES */ #endif /* ACE_TIMEPROBE_T_CPP */ - diff --git a/dep/include/ace/Timeprobe_T.h b/externals/ace/Timeprobe_T.h similarity index 99% rename from dep/include/ace/Timeprobe_T.h rename to externals/ace/Timeprobe_T.h index db69cb1da2b..54e5ff4c185 100644 --- a/dep/include/ace/Timeprobe_T.h +++ b/externals/ace/Timeprobe_T.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_TIMEPROBE_T_H #define ACE_TIMEPROBE_T_H #include /**/ "ace/pre.h" @@ -70,6 +71,7 @@ public: */ typedef ACE_Timeprobe_Ex ACE_Timeprobe; + /// We can hold multiple event description tables. typedef ACE_Unbounded_Set EVENT_DESCRIPTIONS; @@ -216,4 +218,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_COMPILE_TIMEPROBES */ #include /**/ "ace/post.h" #endif /* ACE_TIMEPROBE_T_H */ - diff --git a/dep/include/ace/Timer_Hash.h b/externals/ace/Timer_Hash.h similarity index 99% rename from dep/include/ace/Timer_Hash.h rename to externals/ace/Timer_Hash.h index f7cc65c3bb7..b381419da44 100644 --- a/dep/include/ace/Timer_Hash.h +++ b/externals/ace/Timer_Hash.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_TIMER_HASH_H #define ACE_TIMER_HASH_H #include /**/ "ace/pre.h" @@ -42,6 +43,7 @@ typedef ACE_Timer_Heap_T ACE_Hash_Timer_Heap; + typedef ACE_Timer_Hash_T, ACE_SYNCH_RECURSIVE_MUTEX, @@ -71,4 +73,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_HASH_H */ - diff --git a/dep/src/ace/Timer_Hash_T.cpp b/externals/ace/Timer_Hash_T.cpp similarity index 98% rename from dep/src/ace/Timer_Hash_T.cpp rename to externals/ace/Timer_Hash_T.cpp index 5c8d3daa50d..d8153c1eee2 100644 --- a/dep/src/ace/Timer_Hash_T.cpp +++ b/externals/ace/Timer_Hash_T.cpp @@ -1,4 +1,4 @@ -// $Id: Timer_Hash_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Timer_Hash_T.cpp 89254 2010-02-25 22:10:39Z cleeland $ #ifndef ACE_TIMER_HASH_T_CPP #define ACE_TIMER_HASH_T_CPP @@ -15,7 +15,7 @@ ACE_RCSID(ace, Timer_Hash_T, - "$Id: Timer_Hash_T.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Timer_Hash_T.cpp 89254 2010-02-25 22:10:39Z cleeland $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -823,10 +823,7 @@ ACE_Timer_Hash_T::expire (const ACE_Time_Value { // Make sure that we skip past values that have already // "expired". - do - expired->set_timer_value (expired->get_timer_value () - + expired->get_interval ()); - while (expired->get_timer_value () <= cur_time); + this->recompute_next_abs_interval_time (expired, cur_time); // Since this is an interval timer, we need to // reschedule it. @@ -871,4 +868,3 @@ ACE_Timer_Hash_T::expire (const ACE_Time_Value ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TIMER_HASH_T_CPP */ - diff --git a/dep/include/ace/Timer_Hash_T.h b/externals/ace/Timer_Hash_T.h similarity index 99% rename from dep/include/ace/Timer_Hash_T.h rename to externals/ace/Timer_Hash_T.h index 882369cf5c9..b04e7cfbcf3 100644 --- a/dep/include/ace/Timer_Hash_T.h +++ b/externals/ace/Timer_Hash_T.h @@ -340,4 +340,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_HASH_T_H */ - diff --git a/dep/include/ace/Timer_Heap.h b/externals/ace/Timer_Heap.h similarity index 99% rename from dep/include/ace/Timer_Heap.h rename to externals/ace/Timer_Heap.h index 61673974068..7dec5ec22b4 100644 --- a/dep/include/ace/Timer_Heap.h +++ b/externals/ace/Timer_Heap.h @@ -39,4 +39,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_HEAP_H */ - diff --git a/dep/src/ace/Timer_Heap_T.cpp b/externals/ace/Timer_Heap_T.cpp similarity index 99% rename from dep/src/ace/Timer_Heap_T.cpp rename to externals/ace/Timer_Heap_T.cpp index f557473e449..75ec9ef70fc 100644 --- a/dep/src/ace/Timer_Heap_T.cpp +++ b/externals/ace/Timer_Heap_T.cpp @@ -1,4 +1,4 @@ -// $Id: Timer_Heap_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Timer_Heap_T.cpp 84962 2009-03-24 15:16:25Z johnnyw $ #ifndef ACE_TIMER_HEAP_T_CPP #define ACE_TIMER_HEAP_T_CPP @@ -349,7 +349,7 @@ ACE_Timer_Heap_T::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmin_free_ = %d"), this->timer_ids_min_free_)); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nheap_ = \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nheap_ =\n"))); for (size_t i = 0; i < this->cur_size_; ++i) { @@ -359,7 +359,7 @@ ACE_Timer_Heap_T::dump (void) const this->heap_[i]->dump (); } - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_ids_ = \n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_ids_ =\n"))); for (size_t j = 0; j < this->max_size_; ++j) ACE_DEBUG ((LM_DEBUG, @@ -688,7 +688,7 @@ ACE_Timer_Heap_T::schedule_i ( if ((this->cur_size_ + this->cur_limbo_) < this->max_size_) { // Obtain the next unique sequence number. - long timer_id = this->timer_id (); + long const timer_id = this->timer_id (); // Obtain the memory to the new node. ACE_Timer_Node_T *temp = 0; @@ -887,4 +887,3 @@ ACE_Timer_Heap_T::get_first (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TIMER_HEAP_T_CPP */ - diff --git a/dep/include/ace/Timer_Heap_T.h b/externals/ace/Timer_Heap_T.h similarity index 98% rename from dep/include/ace/Timer_Heap_T.h rename to externals/ace/Timer_Heap_T.h index 904e596e616..d6a6221aeed 100644 --- a/dep/include/ace/Timer_Heap_T.h +++ b/externals/ace/Timer_Heap_T.h @@ -4,7 +4,7 @@ /** * @file Timer_Heap_T.h * - * $Id: Timer_Heap_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Timer_Heap_T.h 84619 2009-02-26 12:26:16Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -143,7 +143,7 @@ public: /** * Cancel all timers associated with @a type. If @a dont_call_handle_close - * is 0then the will be invoked. Returns number of timers + * is 0 then the will be invoked. Returns number of timers * cancelled. */ virtual int cancel (const TYPE &type, @@ -336,4 +336,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_HEAP_T_H */ - diff --git a/dep/include/ace/Timer_List.h b/externals/ace/Timer_List.h similarity index 100% rename from dep/include/ace/Timer_List.h rename to externals/ace/Timer_List.h index 6265e348951..f2d9cc2a458 100644 --- a/dep/include/ace/Timer_List.h +++ b/externals/ace/Timer_List.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_TIMER_LIST_H #define ACE_TIMER_LIST_H #include /**/ "ace/pre.h" @@ -39,4 +40,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_LIST_H */ - diff --git a/dep/src/ace/Timer_List_T.cpp b/externals/ace/Timer_List_T.cpp similarity index 99% rename from dep/src/ace/Timer_List_T.cpp rename to externals/ace/Timer_List_T.cpp index aaf5542ef7e..c3b837bb289 100644 --- a/dep/src/ace/Timer_List_T.cpp +++ b/externals/ace/Timer_List_T.cpp @@ -416,4 +416,3 @@ ACE_Timer_List_T::remove_first (void) } #endif /* ACE_TIMER_LIST_T_C */ - diff --git a/dep/include/ace/Timer_List_T.h b/externals/ace/Timer_List_T.h similarity index 99% rename from dep/include/ace/Timer_List_T.h rename to externals/ace/Timer_List_T.h index 66d148f81eb..cabd47aeaf0 100644 --- a/dep/include/ace/Timer_List_T.h +++ b/externals/ace/Timer_List_T.h @@ -224,4 +224,3 @@ private: #include /**/ "ace/post.h" #endif /* ACE_TIMER_LIST_T_H */ - diff --git a/dep/include/ace/Timer_Queue.h b/externals/ace/Timer_Queue.h similarity index 99% rename from dep/include/ace/Timer_Queue.h rename to externals/ace/Timer_Queue.h index 0f5990ae546..4644aa1b43d 100644 --- a/dep/include/ace/Timer_Queue.h +++ b/externals/ace/Timer_Queue.h @@ -50,4 +50,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_QUEUE_H */ - diff --git a/dep/src/ace/Timer_Queue_Adapters.cpp b/externals/ace/Timer_Queue_Adapters.cpp similarity index 83% rename from dep/src/ace/Timer_Queue_Adapters.cpp rename to externals/ace/Timer_Queue_Adapters.cpp index bcfbcf05139..54e8f8ade5f 100644 --- a/dep/src/ace/Timer_Queue_Adapters.cpp +++ b/externals/ace/Timer_Queue_Adapters.cpp @@ -1,4 +1,4 @@ -// $Id: Timer_Queue_Adapters.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Timer_Queue_Adapters.cpp 89482 2010-03-15 07:58:50Z johnnyw $ #ifndef ACE_TIMER_QUEUE_ADAPTERS_CPP #define ACE_TIMER_QUEUE_ADAPTERS_CPP @@ -23,14 +23,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template TQ & -ACE_Async_Timer_Queue_Adapter::timer_queue (void) +template TQ & +ACE_Async_Timer_Queue_Adapter::timer_queue (void) { return this->timer_queue_; } -template int -ACE_Async_Timer_Queue_Adapter::cancel (long timer_id, +template int +ACE_Async_Timer_Queue_Adapter::cancel (long timer_id, const void **act) { // Block designated signals. @@ -40,8 +40,8 @@ ACE_Async_Timer_Queue_Adapter::cancel (long timer_id, return this->timer_queue_.cancel (timer_id, act); } -template int -ACE_Async_Timer_Queue_Adapter::expire (void) +template int +ACE_Async_Timer_Queue_Adapter::expire (void) { // Block designated signals. ACE_Sig_Guard sg (&this->mask_); @@ -50,8 +50,8 @@ ACE_Async_Timer_Queue_Adapter::expire (void) return this->timer_queue_.expire (); } -template int -ACE_Async_Timer_Queue_Adapter::schedule_ualarm (void) +template int +ACE_Async_Timer_Queue_Adapter::schedule_ualarm (void) { ACE_Time_Value tv = this->timer_queue_.earliest_time () - this->timer_queue_.gettimeofday (); @@ -68,8 +68,8 @@ ACE_Async_Timer_Queue_Adapter::schedule_ualarm (void) return 0; } -template long -ACE_Async_Timer_Queue_Adapter::schedule (ACE_Event_Handler *eh, +template long +ACE_Async_Timer_Queue_Adapter::schedule (TYPE eh, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval) @@ -96,8 +96,8 @@ ACE_Async_Timer_Queue_Adapter::schedule (ACE_Event_Handler *eh, return tid; } -template -ACE_Async_Timer_Queue_Adapter::ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask) +template +ACE_Async_Timer_Queue_Adapter::ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *mask) // If == 0, block *all* signals when the SIGARLM handler is // running, else just block those in the mask. : mask_ (mask) @@ -120,8 +120,8 @@ ACE_Async_Timer_Queue_Adapter::ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *m // list. It gets invoked asynchronously when the SIGALRM signal // occurs. -template int -ACE_Async_Timer_Queue_Adapter::handle_signal (int signum, +template int +ACE_Async_Timer_Queue_Adapter::handle_signal (int signum, siginfo_t *, ucontext_t *) { @@ -154,8 +154,8 @@ ACE_Async_Timer_Queue_Adapter::handle_signal (int signum, } } -template -ACE_Thread_Timer_Queue_Adapter::ACE_Thread_Timer_Queue_Adapter (ACE_Thread_Manager *tm, +template +ACE_Thread_Timer_Queue_Adapter::ACE_Thread_Timer_Queue_Adapter (ACE_Thread_Manager *tm, TQ* timer_queue) : ACE_Task_Base (tm), timer_queue_(timer_queue), @@ -172,8 +172,8 @@ ACE_Thread_Timer_Queue_Adapter::ACE_Thread_Timer_Queue_Adapter (ACE_Thread_M } } -template -ACE_Thread_Timer_Queue_Adapter::~ACE_Thread_Timer_Queue_Adapter (void) +template +ACE_Thread_Timer_Queue_Adapter::~ACE_Thread_Timer_Queue_Adapter (void) { if (this->delete_timer_queue_) { @@ -183,15 +183,15 @@ ACE_Thread_Timer_Queue_Adapter::~ACE_Thread_Timer_Queue_Adapter (void) } } -template ACE_SYNCH_RECURSIVE_MUTEX & -ACE_Thread_Timer_Queue_Adapter::mutex (void) +template ACE_SYNCH_RECURSIVE_MUTEX & +ACE_Thread_Timer_Queue_Adapter::mutex (void) { return this->mutex_; } -template long -ACE_Thread_Timer_Queue_Adapter::schedule - (ACE_Event_Handler* handler, +template long +ACE_Thread_Timer_Queue_Adapter::schedule + (TYPE handler, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval) @@ -203,8 +203,8 @@ ACE_Thread_Timer_Queue_Adapter::schedule return result; } -template int -ACE_Thread_Timer_Queue_Adapter::cancel (long timer_id, +template int +ACE_Thread_Timer_Queue_Adapter::cancel (long timer_id, const void **act) { ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, guard, this->mutex_, -1); @@ -214,8 +214,8 @@ ACE_Thread_Timer_Queue_Adapter::cancel (long timer_id, return result; } -template void -ACE_Thread_Timer_Queue_Adapter::deactivate (void) +template void +ACE_Thread_Timer_Queue_Adapter::deactivate (void) { ACE_GUARD (ACE_SYNCH_RECURSIVE_MUTEX, guard, this->mutex_); @@ -223,8 +223,8 @@ ACE_Thread_Timer_Queue_Adapter::deactivate (void) this->condition_.signal (); } -template int -ACE_Thread_Timer_Queue_Adapter::svc (void) +template int +ACE_Thread_Timer_Queue_Adapter::svc (void) { ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, guard, this->mutex_, -1); @@ -290,8 +290,8 @@ ACE_Thread_Timer_Queue_Adapter::svc (void) return 0; } -template int -ACE_Thread_Timer_Queue_Adapter::activate (long flags, +template int +ACE_Thread_Timer_Queue_Adapter::activate (long flags, int , int , long priority, @@ -320,14 +320,14 @@ ACE_Thread_Timer_Queue_Adapter::activate (long flags, // or cancelling timers on platforms where the timer queue mutex is not // recursive. -template int -ACE_Thread_Timer_Queue_Adapter::enqueue_command (ACE_Command_Base *cmd, +template int +ACE_Thread_Timer_Queue_Adapter::enqueue_command (ACE_Command_Base *cmd, COMMAND_ENQUEUE_POSITION pos) { // Serialize access to the command queue. ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->command_mutex_, -1); - if (pos == ACE_Thread_Timer_Queue_Adapter::TAIL) + if (pos == ACE_Thread_Timer_Queue_Adapter::TAIL) return command_queue_.enqueue_tail (cmd); else return command_queue_.enqueue_head (cmd); @@ -336,8 +336,8 @@ ACE_Thread_Timer_Queue_Adapter::enqueue_command (ACE_Command_Base *cmd, // Dispatches all command objects enqueued in the most recent event // handler context. -template int -ACE_Thread_Timer_Queue_Adapter::dispatch_commands (void) +template int +ACE_Thread_Timer_Queue_Adapter::dispatch_commands (void) { // Serialize access to the command queue. ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, this->command_mutex_, -1); @@ -359,4 +359,3 @@ ACE_Thread_Timer_Queue_Adapter::dispatch_commands (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TIMER_QUEUE_ADAPTERS_CPP */ - diff --git a/dep/include/ace/Timer_Queue_Adapters.h b/externals/ace/Timer_Queue_Adapters.h similarity index 97% rename from dep/include/ace/Timer_Queue_Adapters.h rename to externals/ace/Timer_Queue_Adapters.h index 390aed19da0..d5561717142 100644 --- a/dep/include/ace/Timer_Queue_Adapters.h +++ b/externals/ace/Timer_Queue_Adapters.h @@ -4,7 +4,7 @@ /** * @file Timer_Queue_Adapters.h * - * $Id: Timer_Queue_Adapters.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Timer_Queue_Adapters.h 89482 2010-03-15 07:58:50Z johnnyw $ * * @author Douglas C. Schmidt and * Carlos O'Ryan @@ -49,7 +49,7 @@ class ACE_Sig_Set; * * @todo This adapter does not automatically reschedule repeating timers. */ -template +template class ACE_Async_Timer_Queue_Adapter : public ACE_Event_Handler { public: @@ -70,7 +70,7 @@ public: * calling expire(). Note that interval timers are not implemented * yet. */ - long schedule (ACE_Event_Handler *type, + long schedule (TYPE type, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval = ACE_Time_Value::zero); @@ -119,7 +119,7 @@ private: * use. * */ -template +template class ACE_Thread_Timer_Queue_Adapter : public ACE_Task_Base { public: @@ -145,7 +145,7 @@ public: /// Schedule the timer according to the semantics of the ; wakes /// up the dispatching thread. - long schedule (ACE_Event_Handler *handler, + long schedule (TYPE handler, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval = ACE_Time_Value::zero); @@ -259,4 +259,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_QUEUE_ADAPTERS_H */ - diff --git a/externals/ace/Timer_Queue_Adapters.inl b/externals/ace/Timer_Queue_Adapters.inl new file mode 100644 index 00000000000..d73ef024246 --- /dev/null +++ b/externals/ace/Timer_Queue_Adapters.inl @@ -0,0 +1,29 @@ +// -*- C++ -*- +// +// $Id: Timer_Queue_Adapters.inl 89482 2010-03-15 07:58:50Z johnnyw $ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +template ACE_INLINE TQ * +ACE_Thread_Timer_Queue_Adapter::timer_queue (void) const +{ + return this->timer_queue_; +} + +template ACE_INLINE int +ACE_Thread_Timer_Queue_Adapter::timer_queue (TQ *tq) +{ + if (this->delete_timer_queue_) + delete this->timer_queue_; + this->timer_queue_ = tq; + this->delete_timer_queue_ = false; + return 0; +} + +template ACE_INLINE ACE_thread_t +ACE_Thread_Timer_Queue_Adapter::thr_id (void) const +{ + return this->thr_id_; +} + +ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Timer_Queue_T.cpp b/externals/ace/Timer_Queue_T.cpp similarity index 85% rename from dep/src/ace/Timer_Queue_T.cpp rename to externals/ace/Timer_Queue_T.cpp index 654b2f5aaf8..258e68edd55 100644 --- a/dep/src/ace/Timer_Queue_T.cpp +++ b/externals/ace/Timer_Queue_T.cpp @@ -1,4 +1,4 @@ -// $Id: Timer_Queue_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Timer_Queue_T.cpp 89254 2010-02-25 22:10:39Z cleeland $ #ifndef ACE_TIMER_QUEUE_T_CPP #define ACE_TIMER_QUEUE_T_CPP @@ -166,7 +166,7 @@ ACE_Timer_Queue_T::dump (void) const template ACE_Timer_Queue_T::ACE_Timer_Queue_T (FUNCTOR *upcall_functor, - ACE_Free_List > *freelist) + ACE_Free_List > *freelist) : gettimeofday_ (ACE_OS::gettimeofday), delete_upcall_functor_ (upcall_functor == 0), delete_free_list_ (freelist == 0), @@ -283,6 +283,66 @@ ACE_Timer_Queue_T::expire (const ACE_Time_Value &cur_ti return number_of_timers_expired; } +template void +ACE_Timer_Queue_T::recompute_next_abs_interval_time + (ACE_Timer_Node_T *expired, + const ACE_Time_Value &cur_time) +{ + if ( expired->get_timer_value () <= cur_time ) + { + /* + * Somehow the current time is past when this time was + * supposed to expire (e.g., timer took too long, + * somebody changed system time, etc.). There used to + * be a simple loop here that skipped ahead one timer + * interval at a time, but that was horribly inefficient + * (an O(n) algorithm) when the timer duration was small + * relative to the amount of time skipped. + * + * So, we replace the loop with a simple computation, + * which also happens to be O(1). All times get + * normalized in the computation to microseconds. + * + * For reference, the loop looked like this: + * + * do + * expired->set_timer_value (expired->get_timer_value () + + * expired->get_interval ()); + * while (expired->get_timer_value () <= cur_time); + * + */ + + // Compute the duration of the timer's interval + ACE_UINT64 interval_usec; + expired->get_interval ().to_usec (interval_usec); + + // Compute the span between the current time and when + // the timer would have expired in the past (and + // normalize to microseconds). + ACE_Time_Value old_diff = cur_time - expired->get_timer_value (); + ACE_UINT64 old_diff_usec; + old_diff.to_usec (old_diff_usec); + + // Compute the delta time in the future when the timer + // should fire as if it had advanced incrementally. The + // modulo arithmetic accomodates the likely case that + // the current time doesn't fall precisely on a timer + // firing interval. + ACE_UINT64 new_timer_usec = + interval_usec - (old_diff_usec % interval_usec); + + // Compute the absolute time in the future when this + // interval timer should expire. + ACE_Time_Value new_timer_value + (cur_time.sec () + + static_cast(new_timer_usec / ACE_ONE_SECOND_IN_USECS), + cur_time.usec () + + static_cast(new_timer_usec % ACE_ONE_SECOND_IN_USECS)); + + expired->set_timer_value (new_timer_value); + } +} + template int ACE_Timer_Queue_T::dispatch_info_i (const ACE_Time_Value &cur_time, ACE_Timer_Node_Dispatch_Info_T &info) @@ -306,10 +366,7 @@ ACE_Timer_Queue_T::dispatch_info_i (const ACE_Time_Valu { // Make sure that we skip past values that have already // "expired". - do - expired->set_timer_value (expired->get_timer_value () + - expired->get_interval ()); - while (expired->get_timer_value () <= cur_time); + this->recompute_next_abs_interval_time (expired, cur_time); // Since this is an interval timer, we need to reschedule // it. @@ -479,4 +536,3 @@ ACE_Event_Handler_Handle_Timeout_Upcall::deletion (TIMER_QUEUE &timer_ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TIMER_QUEUE_T_CPP */ - diff --git a/dep/include/ace/Timer_Queue_T.h b/externals/ace/Timer_Queue_T.h similarity index 98% rename from dep/include/ace/Timer_Queue_T.h rename to externals/ace/Timer_Queue_T.h index 8e5478b3245..5e316e1e04b 100644 --- a/dep/include/ace/Timer_Queue_T.h +++ b/externals/ace/Timer_Queue_T.h @@ -4,7 +4,7 @@ /** * @file Timer_Queue_T.h * - * $Id: Timer_Queue_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Timer_Queue_T.h 89254 2010-02-25 22:10:39Z cleeland $ * * @author Doug Schmidt * @author Irfan Pyarali and @@ -431,6 +431,10 @@ protected: virtual int dispatch_info_i (const ACE_Time_Value ¤t_time, ACE_Timer_Node_Dispatch_Info_T &info); + /// Recompute when the next time is that this interval timer should fire. + void recompute_next_abs_interval_time (ACE_Timer_Node_T* expired, + const ACE_Time_Value &cur_time); + /// Synchronization variable for ACE_Timer_Queue. /// @note The right name would be lock_, but HP/C++ will choke on that! ACE_LOCK mutex_; @@ -560,4 +564,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_QUEUE_T_H */ - diff --git a/dep/include/ace/Timer_Queue_T.inl b/externals/ace/Timer_Queue_T.inl similarity index 100% rename from dep/include/ace/Timer_Queue_T.inl rename to externals/ace/Timer_Queue_T.inl diff --git a/dep/include/ace/Timer_Queuefwd.h b/externals/ace/Timer_Queuefwd.h similarity index 99% rename from dep/include/ace/Timer_Queuefwd.h rename to externals/ace/Timer_Queuefwd.h index 5ee99ff1823..662f29c0411 100644 --- a/dep/include/ace/Timer_Queuefwd.h +++ b/externals/ace/Timer_Queuefwd.h @@ -36,4 +36,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_QUEUE_FWD_H */ - diff --git a/dep/include/ace/Timer_Wheel.h b/externals/ace/Timer_Wheel.h similarity index 100% rename from dep/include/ace/Timer_Wheel.h rename to externals/ace/Timer_Wheel.h index b8a7e9b03ac..21ba8776102 100644 --- a/dep/include/ace/Timer_Wheel.h +++ b/externals/ace/Timer_Wheel.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_TIMER_WHEEL_H #define ACE_TIMER_WHEEL_H #include /**/ "ace/pre.h" @@ -39,4 +40,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_WHEEL_H */ - diff --git a/dep/src/ace/Timer_Wheel_T.cpp b/externals/ace/Timer_Wheel_T.cpp similarity index 98% rename from dep/src/ace/Timer_Wheel_T.cpp rename to externals/ace/Timer_Wheel_T.cpp index 75cfc750318..529cc456d50 100644 --- a/dep/src/ace/Timer_Wheel_T.cpp +++ b/externals/ace/Timer_Wheel_T.cpp @@ -1,4 +1,4 @@ -// $Id: Timer_Wheel_T.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Timer_Wheel_T.cpp 89254 2010-02-25 22:10:39Z cleeland $ #ifndef ACE_TIMER_WHEEL_T_CPP #define ACE_TIMER_WHEEL_T_CPP @@ -148,7 +148,7 @@ ACE_Timer_Wheel_T::open_i this->free_list_->resize (prealloc + this->spoke_count_); - this->wheel_time_.msec (1 << (this->res_bits_ + this->spoke_bits_)); + this->wheel_time_.msec (1 << (this->res_bits_)); ACE_NEW (this->spokes_, ACE_Timer_Node_T* [this->spoke_count_]); @@ -699,7 +699,7 @@ ACE_Timer_Wheel_T::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nresolution_ = %d"), 1 << this->res_bits_)); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("\nwheel_ = \n"))); + ACE_TEXT ("\nwheel_ =\n"))); for (u_int i = 0; i < this->spoke_count_; ++i) { @@ -834,10 +834,7 @@ ACE_Timer_Wheel_T::expire (const ACE_Time_Value& cur_ti { // Make sure that we skip past values that have already // "expired". - do - n->set_timer_value (n->get_timer_value () + - n->get_interval ()); - while (n->get_timer_value () <= cur_time); + this->recompute_next_abs_interval_time (n, cur_time); this->reschedule (n); } @@ -965,4 +962,3 @@ ACE_Timer_Wheel_Iterator_T::item (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TIMER_WHEEL_T_CPP */ - diff --git a/dep/include/ace/Timer_Wheel_T.h b/externals/ace/Timer_Wheel_T.h similarity index 97% rename from dep/include/ace/Timer_Wheel_T.h rename to externals/ace/Timer_Wheel_T.h index 7222837011b..266099f2e6a 100644 --- a/dep/include/ace/Timer_Wheel_T.h +++ b/externals/ace/Timer_Wheel_T.h @@ -4,7 +4,7 @@ /** * @file Timer_Wheel_T.h * - * $Id: Timer_Wheel_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Timer_Wheel_T.h 84619 2009-02-26 12:26:16Z johnnyw $ * * @author Darrell Brunsch */ @@ -126,8 +126,8 @@ public: virtual int reset_interval (long timer_id, const ACE_Time_Value& interval); - /// Cancel all timer associated with @a type. If is 0 - /// then the will be invoked. Returns number of timers + /// Cancel all timer associated with @a type. If @a dont_call_handle_close is + /// 0 then the will be invoked. Returns number of timers /// cancelled. virtual int cancel (const TYPE& type, int dont_call_handle_close = 1); @@ -224,4 +224,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TIMER_WHEEL_T_H */ - diff --git a/dep/src/ace/Token.cpp b/externals/ace/Token.cpp similarity index 98% rename from dep/src/ace/Token.cpp rename to externals/ace/Token.cpp index 99686563f67..9993261be17 100644 --- a/dep/src/ace/Token.cpp +++ b/externals/ace/Token.cpp @@ -1,4 +1,4 @@ -// $Id: Token.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Token.cpp 83735 2008-11-14 09:41:52Z johnnyw $ #include "ace/Token.h" @@ -6,7 +6,7 @@ # include "ace/Token.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, Token, "$Id: Token.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, Token, "$Id: Token.cpp 83735 2008-11-14 09:41:52Z johnnyw $") #if defined (ACE_HAS_THREADS) @@ -216,7 +216,7 @@ ACE_Token::shared_acquire (void (*sleep_hook_func)(void *), } // Do a quick check for "polling" behavior. - if (timeout != 0 && timeout->sec () == 0 && timeout->usec () == 0) + if (timeout != 0 && *timeout == ACE_Time_Value::zero) { errno = ETIME; return -1; @@ -543,4 +543,3 @@ ACE_Token::wakeup_next_waiter (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/Token.h b/externals/ace/Token.h similarity index 98% rename from dep/include/ace/Token.h rename to externals/ace/Token.h index 405ad28362f..7857c44dfb5 100644 --- a/dep/include/ace/Token.h +++ b/externals/ace/Token.h @@ -4,7 +4,7 @@ /** * @file Token.h * - * $Id: Token.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Token.h 85367 2009-05-18 10:11:54Z johnnyw $ * * @author Original author * @author Karl-Heinz Dorn (kdorn@erlh.siemens.de) @@ -29,10 +29,10 @@ #include "ace/Thread_Mutex.h" -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || defined (ACE_HAS_VXTHREADS) +#if (defined (ACE_WIN32) && !defined (ACE_USES_WINCE_SEMA_SIMULATION)) || defined (ACE_HAS_VXTHREADS) // If platforms support semaphores with timed wait, then we use semaphores instead of c.v. # define ACE_TOKEN_USES_SEMAPHORE -#endif /* (ACE_WIN32 && !ACE_HAS_WINCE) || VXWORKS */ +#endif /* ACE_WIN32 || ACE_HAS_VXTHREADS */ #if defined (ACE_TOKEN_USES_SEMAPHORE) # include "ace/Semaphore.h" @@ -371,6 +371,6 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include "ace/Token.inl" #endif /* __ACE_INLINE__ */ + #include /**/ "ace/post.h" #endif /* ACE_TOKEN_H */ - diff --git a/dep/include/ace/Token.inl b/externals/ace/Token.inl similarity index 100% rename from dep/include/ace/Token.inl rename to externals/ace/Token.inl diff --git a/dep/src/ace/Token_Collection.cpp b/externals/ace/Token_Collection.cpp similarity index 99% rename from dep/src/ace/Token_Collection.cpp rename to externals/ace/Token_Collection.cpp index c10b9734e49..23a5813c958 100644 --- a/dep/src/ace/Token_Collection.cpp +++ b/externals/ace/Token_Collection.cpp @@ -6,6 +6,7 @@ #include "ace/Token_Collection.inl" #endif /* __ACE_INLINE__ */ + ACE_RCSID (ace, Token_Collection, "$Id: Token_Collection.cpp 80826 2008-03-04 14:51:23Z wotte $") @@ -121,6 +122,7 @@ ACE_Token_Collection::acquire (const ACE_TCHAR *token_name, return temp->acquire (notify, sleep_hook, options); } + int ACE_Token_Collection::tryacquire (const ACE_TCHAR *token_name, void (*sleep_hook)(void *)) @@ -254,6 +256,7 @@ ACE_Token_Collection::~ACE_Token_Collection (void) } } + // This method doesn't mean anything for a collection. ACE_Token_Proxy * ACE_Token_Collection::clone (void) const @@ -289,4 +292,3 @@ ACE_Token_Collection::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/include/ace/Token_Collection.h b/externals/ace/Token_Collection.h similarity index 99% rename from dep/include/ace/Token_Collection.h rename to externals/ace/Token_Collection.h index c238004756d..16a9bb412b0 100644 --- a/dep/include/ace/Token_Collection.h +++ b/externals/ace/Token_Collection.h @@ -162,6 +162,7 @@ public: ACE_Synch_Options &options = ACE_Synch_Options::defaults); + /// Renew the token corresponding to @a token_name. The other /// parameters are passed to ::renew. virtual int renew (const ACE_TCHAR *token_name, @@ -179,6 +180,7 @@ public: virtual int release (ACE_Synch_Options &options = ACE_Synch_Options::defaults); + /// Release the token corresponding to . The other /// parameters are passed to ::release. virtual int release (const ACE_TCHAR *token_name, @@ -239,4 +241,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TOKEN_COLLECTION_H */ - diff --git a/dep/include/ace/Token_Collection.inl b/externals/ace/Token_Collection.inl similarity index 100% rename from dep/include/ace/Token_Collection.inl rename to externals/ace/Token_Collection.inl diff --git a/dep/src/ace/Token_Invariants.cpp b/externals/ace/Token_Invariants.cpp similarity index 97% rename from dep/src/ace/Token_Invariants.cpp rename to externals/ace/Token_Invariants.cpp index aa7162c9bee..52b1f85eebe 100644 --- a/dep/src/ace/Token_Invariants.cpp +++ b/externals/ace/Token_Invariants.cpp @@ -3,10 +3,11 @@ #if defined (ACE_HAS_TOKENS_LIBRARY) #include "ace/Object_Manager.h" +#include "ace/os_include/os_typeinfo.h" ACE_RCSID (ace, Token_Invariants, - "$Id: Token_Invariants.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Token_Invariants.cpp 84179 2009-01-16 07:26:45Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -31,7 +32,7 @@ ACE_Token_Invariant_Manager::instance (void) ACE_Token_Invariant_Manager, 0); // Register for destruction with ACE_Object_Manager. - ACE_Object_Manager::at_exit (instance_); + ACE_Object_Manager::at_exit (instance_, 0, typeid (instance_).name ()); } } @@ -150,6 +151,7 @@ ACE_Token_Invariant_Manager::dump (void) const #endif /* ACE_HAS_DUMP */ } + int ACE_Token_Invariant_Manager::get_mutex (const ACE_TCHAR *token_name, ACE_Mutex_Invariants *&inv) @@ -203,6 +205,7 @@ ACE_Token_Invariant_Manager::get_rwlock (const ACE_TCHAR *token_name, return 0; } + ACE_Token_Invariant_Manager::~ACE_Token_Invariant_Manager (void) { ACE_TRACE ("ACE_Token_Invariant_Manager::~ACE_Token_Invariant_Manager"); @@ -351,4 +354,3 @@ ACE_RWLock_Invariants::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/include/ace/Token_Invariants.h b/externals/ace/Token_Invariants.h similarity index 99% rename from dep/include/ace/Token_Invariants.h rename to externals/ace/Token_Invariants.h index 1649e5937b3..5cec394763d 100644 --- a/dep/include/ace/Token_Invariants.h +++ b/externals/ace/Token_Invariants.h @@ -243,4 +243,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TOKEN_INVARIANTS_H */ - diff --git a/dep/src/ace/Token_Manager.cpp b/externals/ace/Token_Manager.cpp similarity index 97% rename from dep/src/ace/Token_Manager.cpp rename to externals/ace/Token_Manager.cpp index 64f1194f8b9..1127622d96e 100644 --- a/dep/src/ace/Token_Manager.cpp +++ b/externals/ace/Token_Manager.cpp @@ -3,6 +3,7 @@ #if defined (ACE_HAS_TOKENS_LIBRARY) #include "ace/Object_Manager.h" +#include "ace/os_include/os_typeinfo.h" #if !defined (__ACE_INLINE__) #include "ace/Token_Manager.inl" @@ -10,7 +11,7 @@ ACE_RCSID (ace, Token_Manager, - "$Id: Token_Manager.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Token_Manager.cpp 84179 2009-01-16 07:26:45Z johnnyw $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -61,7 +62,7 @@ ACE_Token_Manager::instance (void) ACE_Token_Manager, 0); // Register for destruction with ACE_Object_Manager. - ACE_Object_Manager::at_exit (token_manager_); + ACE_Object_Manager::at_exit (token_manager_, 0, typeid (token_manager_).name ()); } } @@ -192,6 +193,7 @@ ACE_Token_Manager::check_deadlock (ACE_Tokens *token, ACE_Token_Proxy *proxy) } } + ACE_Tokens * ACE_Token_Manager::token_waiting_for (const ACE_TCHAR *client_id) { @@ -270,4 +272,3 @@ ACE_Token_Manager::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/include/ace/Token_Manager.h b/externals/ace/Token_Manager.h similarity index 99% rename from dep/include/ace/Token_Manager.h rename to externals/ace/Token_Manager.h index 6a7c17d4167..9882e28ef67 100644 --- a/dep/include/ace/Token_Manager.h +++ b/externals/ace/Token_Manager.h @@ -148,4 +148,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TOKEN_MANAGER_H */ - diff --git a/dep/include/ace/Token_Manager.inl b/externals/ace/Token_Manager.inl similarity index 100% rename from dep/include/ace/Token_Manager.inl rename to externals/ace/Token_Manager.inl diff --git a/dep/src/ace/Token_Request_Reply.cpp b/externals/ace/Token_Request_Reply.cpp similarity index 99% rename from dep/src/ace/Token_Request_Reply.cpp rename to externals/ace/Token_Request_Reply.cpp index 8950a47b2b0..598afe01388 100644 --- a/dep/src/ace/Token_Request_Reply.cpp +++ b/externals/ace/Token_Request_Reply.cpp @@ -184,4 +184,3 @@ ACE_Token_Reply::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_TOKENS_LIBRARY */ - diff --git a/dep/include/ace/Token_Request_Reply.h b/externals/ace/Token_Request_Reply.h similarity index 100% rename from dep/include/ace/Token_Request_Reply.h rename to externals/ace/Token_Request_Reply.h index 18bb0d493cf..01a7cfd3e82 100644 --- a/dep/include/ace/Token_Request_Reply.h +++ b/externals/ace/Token_Request_Reply.h @@ -15,6 +15,7 @@ */ //============================================================================= + #ifndef ACE_TOKEN_REQUEST_REPLY_H #define ACE_TOKEN_REQUEST_REPLY_H #include /**/ "ace/pre.h" @@ -267,4 +268,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TOKEN_REQUEST_REPLY_H */ - diff --git a/dep/include/ace/Token_Request_Reply.inl b/externals/ace/Token_Request_Reply.inl similarity index 100% rename from dep/include/ace/Token_Request_Reply.inl rename to externals/ace/Token_Request_Reply.inl diff --git a/externals/ace/Tokenizer_T.cpp b/externals/ace/Tokenizer_T.cpp new file mode 100644 index 00000000000..00aa2abdc79 --- /dev/null +++ b/externals/ace/Tokenizer_T.cpp @@ -0,0 +1,242 @@ +// $Id: Tokenizer_T.cpp 88793 2010-02-01 17:50:34Z cleeland $ + +#ifndef ACE_TOKENIZER_T_CPP +#define ACE_TOKENIZER_T_CPP + +#include "ace/ACE.h" +#include "ace/Malloc_Base.h" +#include "ace/String_Base.h" +#include "ace/Auto_Ptr.h" +#include "ace/OS_NS_string.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +template +ACE_Tokenizer_T::ACE_Tokenizer_T (ACE_CHAR_T *buffer) + : buffer_ (buffer), + index_ (0), + preserves_index_ (0), + delimiter_index_ (0) +{ +} + +template +int +ACE_Tokenizer_T::delimiter (ACE_CHAR_T d) +{ + if (delimiter_index_ == MAX_DELIMITERS) + return -1; + + delimiters_[delimiter_index_].delimiter_ = d; + delimiters_[delimiter_index_].replace_ = 0; + ++delimiter_index_; + return 0; +} + +template +int +ACE_Tokenizer_T::delimiter_replace (ACE_CHAR_T d, + ACE_CHAR_T replacement) +{ + // Make it possible to replace delimiters on-the-fly, e.g., parse + // string until certain token count and then copy rest of the + // original string. + for (int i = 0; i < delimiter_index_; i++) + if (delimiters_[i].delimiter_ == d) + { + delimiters_[i].replacement_ = replacement; + delimiters_[i].replace_ = 1; + return 0; + } + + if (delimiter_index_ >= MAX_DELIMITERS) + return -1; + + delimiters_[delimiter_index_].delimiter_ = d; + delimiters_[delimiter_index_].replacement_ = replacement; + delimiters_[delimiter_index_].replace_ = 1; + ++delimiter_index_; + return 0; +} + +template +int +ACE_Tokenizer_T::preserve_designators (ACE_CHAR_T start, + ACE_CHAR_T stop, + int strip) +{ + if (preserves_index_ == MAX_PRESERVES) + return -1; + + preserves_[preserves_index_].start_ = start; + preserves_[preserves_index_].stop_ = stop; + preserves_[preserves_index_].strip_ = strip; + ++preserves_index_; + return 0; +} + +template +int +ACE_Tokenizer_T::is_delimiter (ACE_CHAR_T d, + int &replace, + ACE_CHAR_T &r) +{ + replace = 0; + + for (int x = 0; x < delimiter_index_; x++) + if (delimiters_[x].delimiter_ == d) + { + if (delimiters_[x].replace_) + { + r = delimiters_[x].replacement_; + replace = 1; + } + return 1; + } + + return 0; +} + +template +int +ACE_Tokenizer_T::is_preserve_designator (ACE_CHAR_T start, + ACE_CHAR_T &stop, + int &strip) +{ + for (int x = 0; x < preserves_index_; x++) + if (preserves_[x].start_ == start) + { + stop = preserves_[x].stop_; + strip = preserves_[x].strip_; + return 1; + } + + return 0; +} + +template +ACE_CHAR_T * +ACE_Tokenizer_T::next (void) +{ + // Check if the previous pass was the last one in the buffer. + if (index_ == -1) + { + index_ = 0; + return 0; + } + + // Check if a buffer has been passed + if (!buffer_) + { + return 0; + } + + ACE_CHAR_T replacement = 0; + int replace; + ACE_CHAR_T *next_token = 0; + + // Skip all leading delimiters. + for (;;) + { + // Check for end of string. + if (buffer_[index_] == '\0') + { + // If we hit EOS at the start, return 0. + index_ = 0; + return 0; + } + + if (this->is_delimiter (buffer_[index_], + replace, + replacement)) + ++index_; + else + break; + } + + // When we reach this point, buffer_[index_] is a non-delimiter and + // not EOS - the start of our next_token. + next_token = buffer_ + index_; + + // A preserved region is it's own token. + ACE_CHAR_T stop; + int strip; + if (this->is_preserve_designator (buffer_[index_], + stop, + strip)) + { + while (++index_) + { + if (buffer_[index_] == '\0') + { + index_ = -1; + goto EXIT_LABEL; + } + + if (buffer_[index_] == stop) + break; + } + + if (strip) + { + // Skip start preserve designator. + next_token += 1; + // Zap the stop preserve designator. + buffer_[index_] = '\0'; + // Increment to the next token. + ++index_; + } + + goto EXIT_LABEL; + } + + // Step through finding the next delimiter or EOS. + for (;;) + { + // Advance pointer. + ++index_; + + // Check for delimiter. + if (this->is_delimiter (buffer_[index_], + replace, + replacement)) + { + // Replace the delimiter. + if (replace != 0) + buffer_[index_] = replacement; + + // Move the pointer up and return. + ++index_; + goto EXIT_LABEL; + } + + // A preserve designator is NESTED inside this token + // We can't strip such preserve designators, just skip + // over them so that delimiters nested within arn't seen. + if (this->is_preserve_designator (buffer_[index_], + stop, + strip)) + { + ++index_; // Skip starting preserve_designator + while (('\0' != buffer_[index_]) && (stop != buffer_[index_])) + ++index_; // Skip enclosed character + } + + // Check for end of string. + if (buffer_[index_] == '\0') + { + index_ = -1; + goto EXIT_LABEL; + } + } + +EXIT_LABEL: + return next_token; +} + +// ************************************************************* + + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* ACE_TOKENIZER_T_CPP */ diff --git a/externals/ace/Tokenizer_T.h b/externals/ace/Tokenizer_T.h new file mode 100644 index 00000000000..b13f5bb5ab6 --- /dev/null +++ b/externals/ace/Tokenizer_T.h @@ -0,0 +1,241 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Tokenizer_T.h + * + * $Id: Tokenizer_T.h 88793 2010-02-01 17:50:34Z cleeland $ + * + * @author Douglas C. Schmidt (schmidt@cs.wustl.edu) + * @author Nanbor Wang + */ +//============================================================================= + +#ifndef ACE_TOKENIZER_T_H +#define ACE_TOKENIZER_T_H + +#include /**/ "ace/pre.h" + +#include "ace/Global_Macros.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_Tokenizer_T + * + * @brief Tokenizer + * + * Tokenizes a buffer. Allows application to set delimiters and + * preserve designators. Does not allow special characters, yet + * (e.g., printf ("\"like a quoted string\"")). + */ +template +class ACE_Tokenizer_T +{ +public: + /** + * \a buffer will be parsed. Notice that ACE_Tokenizer_T will modify + * \a buffer if you use delimiter_replace or + * preserve_designators to do character substitution. + * @note You should NOT pass a constant string or string literal + * to this constructor, since ACE_Tokenizer_T will try to modify + * the string. + * \sa preserve_designators + * \sa preserve_designators + */ + ACE_Tokenizer_T (ACE_CHAR_T *buffer); + + /** + * \a d is a delimiter. + * \return Returns 0 on success, -1 if there is no memory left. + * + * Example: + * \verbatim + char buf[30]; + ACE_OS::strcpy(buf, "William/Joseph/Hagins"); + + ACE_Tokenizer_T tok (buf); + tok.delimiter ('/'); + for (char *p = tok.next (); p; p = tok.next ()) + cout << p << endl; + \endverbatim + * + * This will print out: + * \verbatim + William/Joseph/Hagins + Joseph/Hagins + Hagins \endverbatim + */ + int delimiter (ACE_CHAR_T d); + + /** + * \a d is a delimiter and, when found, will be replaced by + * \a replacement. + * \return 0 on success, -1 if there is no memory left. + * + * Example: + * \verbatim + char buf[30]; + ACE_OS::strcpy(buf, "William/Joseph/Hagins"); + + ACE_Tokenizer tok (buf); + tok.delimiter_replace ('/', 0); + for (char *p = tok.next (); p; p = tok.next ()) + cout << p << endl; + \endverbatim + * + * This will print out: + * \verbatim + William + Joseph + Hagins \endverbatim + */ + int delimiter_replace (ACE_CHAR_T d, ACE_CHAR_T replacement); + + /** + * Extract string between a pair of designator characters. + * For instance, quotes, or '(' and ')'. + * \a start specifies the begin designator. + * \a stop specifies the end designator. + * \a strip If \a strip == 1, then the preserve + * designators will be stripped from the tokens returned by next. + * \return 0 on success, -1 if there is no memory left. + * + * Example with strip = 0: + * \verbatim + char buf[30]; + ACE_OS::strcpy(buf, "William(Joseph)Hagins"); + + ACE_Tokenizer tok (buf); + tok.preserve_designators ('(', ')', 0); + for (char *p = tok.next (); p; p = tok.next ()) + cout << p << endl; + \endverbatim + * + * This will print out: + * \verbatim + William(Joseph)Hagins + (Joseph)Hagins + )Hagins \endverbatim + * + * Example with strip = 1: + * \verbatim + char buf[30]; + ACE_OS::strcpy(buf, "William(Joseph)Hagins"); + + ACE_Tokenizer tok (buf); + tok.preserve_designators ('(', ')', 1); + for (char *p = tok.next (); p; p = tok.next ()) + cout << p << endl; + \endverbatim + * + * This will print out: + * \verbatim + William + Joseph + Hagins \endverbatim + */ + int preserve_designators (ACE_CHAR_T start, ACE_CHAR_T stop, int strip=1); + + /// Returns the next token. + ACE_CHAR_T *next (void); + + enum { + MAX_DELIMITERS=16, + MAX_PRESERVES=16 + }; + +protected: + /// Returns 1 if @a d is a delimiter, 0 otherwise. If @a d should be + /// replaced with @a r, @a replace is set to 1, otherwise 0. + int is_delimiter (ACE_CHAR_T d, int &replace, ACE_CHAR_T &r); + + /** + * If @a start is a start preserve designator, returns 1 and sets + * @a stop to the stop designator. Returns 0 if @a start is not a + * preserve designator. + */ + int is_preserve_designator (ACE_CHAR_T start, ACE_CHAR_T &stop, int &strip); + + ACE_CHAR_T *buffer_; + int index_; + + /** + * @class Preserve_Entry + * + * @brief Preserve Entry + * + * Defines a set of characters that designate an area that + * should not be parsed, but should be treated as a complete + * token. For instance, in: (this is a preserve region), start + * would be a left paren -(- and stop would be a right paren + * -)-. The strip determines whether the designators should be + * removed from the token. + */ + class Preserve_Entry + { + public: + /** + * E.g., "(". + * E.g., ")". + * Whether the designators should be removed from the token. + */ + ACE_CHAR_T start_; + ACE_CHAR_T stop_; + int strip_; + }; + + /// The application can specify MAX_PRESERVES preserve designators. + Preserve_Entry preserves_[MAX_PRESERVES]; + + /// Pointer to the next free spot in preserves_. + int preserves_index_; + + /** + * @class Delimiter_Entry + * + * @brief Delimiter Entry + * + * Describes a delimiter for the tokenizer. + */ + class Delimiter_Entry + { + public: + /** + * Most commonly a space ' '. + * What occurrences of delimiter_ should be replaced with. + * Whether replacement_ should be used. This should be replaced + * with a technique that sets replacement_ = delimiter by + * default. I'll do that next iteration. + */ + ACE_CHAR_T delimiter_; + ACE_CHAR_T replacement_; + int replace_; + }; + + /// The tokenizer allows MAX_DELIMITERS number of delimiters. + Delimiter_Entry delimiters_[MAX_DELIMITERS]; + + /// Pointer to the next free space in delimiters_. + int delimiter_index_; +}; + +typedef ACE_Tokenizer_T ACE_Tokenizer; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Tokenizer_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Tokenizer_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* ACE_TOKENIZER_T_H */ diff --git a/dep/src/ace/Trace.cpp b/externals/ace/Trace.cpp similarity index 91% rename from dep/src/ace/Trace.cpp rename to externals/ace/Trace.cpp index 728adf7f88b..06269ccac1f 100644 --- a/dep/src/ace/Trace.cpp +++ b/externals/ace/Trace.cpp @@ -1,10 +1,10 @@ -// $Id: Trace.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Trace.cpp 87823 2009-11-30 12:38:34Z johnnyw $ #include "ace/Trace.h" ACE_RCSID (ace, Trace, - "$Id: Trace.cpp 80826 2008-03-04 14:51:23Z wotte $") + "$Id: Trace.cpp 87823 2009-11-30 12:38:34Z johnnyw $") // Turn off tracing for the duration of this file. #if defined (ACE_NTRACE) @@ -23,7 +23,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL int ACE_Trace::nesting_indent_ = ACE_Trace::DEFAULT_INDENT; // Is tracing enabled? -int ACE_Trace::enable_tracing_ = ACE_Trace::DEFAULT_TRACING; +bool ACE_Trace::enable_tracing_ = ACE_Trace::DEFAULT_TRACING; ACE_ALLOC_HOOK_DEFINE(ACE_Trace) @@ -36,7 +36,7 @@ ACE_Trace::dump (void) const // Determine whether or not tracing is enabled -int +bool ACE_Trace::is_tracing (void) { return ACE_Trace::enable_tracing_; @@ -47,7 +47,7 @@ ACE_Trace::is_tracing (void) void ACE_Trace::start_tracing (void) { - ACE_Trace::enable_tracing_ = 1; + ACE_Trace::enable_tracing_ = true; } // Disable the tracing facility. @@ -55,7 +55,7 @@ ACE_Trace::start_tracing (void) void ACE_Trace::stop_tracing (void) { - ACE_Trace::enable_tracing_ = 0; + ACE_Trace::enable_tracing_ = false; } // Change the nesting indentation level. @@ -134,4 +134,3 @@ ACE_Trace::~ACE_Trace (void) } ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/Trace.h b/externals/ace/Trace.h similarity index 92% rename from dep/include/ace/Trace.h rename to externals/ace/Trace.h index f1c6aa86037..3fbc9ce0be5 100644 --- a/dep/include/ace/Trace.h +++ b/externals/ace/Trace.h @@ -4,7 +4,7 @@ /** * @file Trace.h * - * $Id: Trace.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Trace.h 87823 2009-11-30 12:38:34Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -49,8 +49,8 @@ public: ~ACE_Trace (void); // = Control the tracing level. - /// Determine if tracing is enabled (return == 1) or not (== 0) - static int is_tracing(void); + /// Determine if tracing is enabled or not + static bool is_tracing(void); /// Enable the tracing facility. static void start_tracing (void); @@ -79,7 +79,7 @@ private: static int nesting_indent_; /// Is tracing enabled? - static int enable_tracing_; + static bool enable_tracing_; /// Default values. enum @@ -94,4 +94,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TRACE_H */ - diff --git a/dep/include/ace/Truncate.h b/externals/ace/Truncate.h similarity index 54% rename from dep/include/ace/Truncate.h rename to externals/ace/Truncate.h index 0af5b022473..223513a56d9 100644 --- a/dep/include/ace/Truncate.h +++ b/externals/ace/Truncate.h @@ -4,7 +4,7 @@ /** * @file Truncate.h * - * $Id: Truncate.h 82623 2008-08-13 14:41:09Z johnnyw $ + * $Id: Truncate.h 83306 2008-10-17 12:19:53Z johnnyw $ * * @author Steve Huston * @author Ossama Othman @@ -27,18 +27,14 @@ #include "ace/If_Then_Else.h" #include "ace/Numeric_Limits.h" -#if defined (ACE_LACKS_LONGLONG_T) \ - || defined (__BORLANDC__) && __BORLANDC__ < 0x590 +#if defined (ACE_LACKS_LONGLONG_T) # include "ace/Basic_Types.h" -#endif /* ACE_LACKS_LONGLONG_T || __BORLANDC__ < 0x590 */ +#endif /* ACE_LACKS_LONGLONG_T */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_Utils { - -#if !defined (__BORLANDC__) || __BORLANDC__ >= 0x590 - template struct Sign_Check; // Specialize the unsigned signed cases. @@ -442,6 +438,7 @@ namespace ACE_Utils } }; + #if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T) // Partial specialization for the case where we're casting from // ACE_U_LongLong to a smaller integer. We assume that we're always @@ -511,539 +508,6 @@ namespace ACE_Utils return truncator() (val); } -#else - - // Borland can't handle the template meta-programming above so - // provide explicit specializations for a few types. More will be - // added if necessary. - - /** - * @deprecated Borland ACE_Utils::Truncator<> specializations should - * be removed. - */ - - template struct Truncator; - - //---------------------------------------------------------- - // sizeof(FROM) > sizeof(TO) - //---------------------------------------------------------- - - template<> - struct Truncator - { - ACE_INT8 operator() (ACE_INT32 val) - { - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT8 operator() (ACE_UINT32 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT8 operator() (ACE_INT32 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_INT8 operator() (ACE_UINT32 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG < 8 - template<> - struct Truncator - { - signed long operator() (ACE_INT64 val) - { - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned long operator() (ACE_INT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned long operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed long operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed long operator() (const ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#endif /* ACE_SIZEOF_LONG < 8 */ - -#if defined (ACE_SIZEOF_INT) && ACE_SIZEOF_INT < 8 - template<> - struct Truncator - { - ACE_INT32 operator() (ACE_INT64 val) - { - return - (val > ACE_Numeric_Limits::max () - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_INT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed int operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#endif /* ACE_SIZEOF_INT < 8 */ - - //---------------------------------------------------------- - // sizeof(FROM) == sizeof(TO) - //---------------------------------------------------------- - - template<> - struct Truncator - { - char operator() (unsigned int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - wchar_t operator() (unsigned int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - unsigned int operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed int operator() (unsigned int val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed int operator() (const unsigned int val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned long operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed long operator() (unsigned long val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#if defined (ACE_SIZEOF_INT) && defined (ACE_SIZEOF_LONG) \ - && ACE_SIZEOF_INT == ACE_SIZEOF_LONG - - template<> - struct Truncator - { - unsigned long operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed long operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed int operator() (unsigned long val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - signed int operator() (signed long val) - { - return static_cast (val); -// This code causes asserts and compiler crashes with BCB6 Static and -// BCB2007 Static -// return -// (val > static_cast (ACE_Numeric_Limits::max ()) -// ? ACE_Numeric_Limits::max () -// : static_cast (val)); - } - }; - - template<> - struct Truncator - { - unsigned int operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - unsigned int operator() (const signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - signed long operator() (unsigned int val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - -#endif /* ACE_SIZEOF_INT == ACE_SIZEOF_LONG */ - - template<> - struct Truncator - { - ACE_UINT64 operator() (ACE_INT64 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT64 operator() (ACE_UINT64 val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - //---------------------------------------------------------- - // sizeof(FROM) < sizeof(TO) - //---------------------------------------------------------- - - template<> - struct Truncator - { - ACE_INT32 operator() (ACE_INT8 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_UINT8 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT32 operator() (ACE_UINT8 val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT32 operator() (ACE_INT8 val) - { - return static_cast (val); - } - }; - -#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG < 8 - template<> - struct Truncator - { - ACE_INT64 operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (signed long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (const signed long val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (unsigned long val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT64 operator() (unsigned long val) - { - return static_cast (val); - } - }; -#endif /* ACE_SIZEOF_LONG < 8 */ - -#if defined (ACE_SIZEOF_INT) && ACE_SIZEOF_INT < 8 - template<> - struct Truncator - { - ACE_INT64 operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (signed int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_UINT64 operator() (unsigned int val) - { - return static_cast (val); - } - }; - - template<> - struct Truncator - { - ACE_INT64 operator() (unsigned int val) - { - return static_cast (val); - } - }; -#endif /* ACE_SIZEOF_INT < 8 */ - - template<> - struct Truncator - { - unsigned long operator() (size_t val) - { - return - (val > static_cast (ACE_Numeric_Limits::max ()) - ? ACE_Numeric_Limits::max () - : static_cast (val)); - } - }; - - // Partial specialization for the case where the types are the same. - // No truncation is necessary. - template - struct Truncator - { - T operator() (T val) - { - return val; - } - }; - - // Partial specialization for the case where the types are the same, - // but the from type is const. No truncation is necessary. - // - // This is only necessary to workaround a problem with the BCB6 - // compiler. - template - struct Truncator - { - T operator() (T val) - { - return val; - } - }; - - // ------------------------------------- - - template - inline TO truncate_cast (FROM val) - { - typedef Truncator truncator; - - return truncator() (val); - } - -#endif /* !__BORLANDC__ || __BORLANDC__ >= 0x590 */ - } // namespace ACE_Utils ACE_END_VERSIONED_NAMESPACE_DECL @@ -1051,4 +515,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TRUNCATE_H*/ - diff --git a/dep/src/ace/Typed_SV_Message.cpp b/externals/ace/Typed_SV_Message.cpp similarity index 99% rename from dep/src/ace/Typed_SV_Message.cpp rename to externals/ace/Typed_SV_Message.cpp index 16c72d3cae8..6be3d4c682a 100644 --- a/dep/src/ace/Typed_SV_Message.cpp +++ b/externals/ace/Typed_SV_Message.cpp @@ -28,4 +28,3 @@ ACE_Typed_SV_Message::dump (void) const ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TYPED_SV_MESSAGE_CPP */ - diff --git a/dep/include/ace/Typed_SV_Message.h b/externals/ace/Typed_SV_Message.h similarity index 100% rename from dep/include/ace/Typed_SV_Message.h rename to externals/ace/Typed_SV_Message.h index 714907bbb22..b43258e01a3 100644 --- a/dep/include/ace/Typed_SV_Message.h +++ b/externals/ace/Typed_SV_Message.h @@ -10,6 +10,7 @@ */ //========================================================================== + #ifndef ACE_TYPED_SV_MESSAGE_H #define ACE_TYPED_SV_MESSAGE_H @@ -104,4 +105,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TYPED_SV_MESSAGE_H */ - diff --git a/dep/include/ace/Typed_SV_Message.inl b/externals/ace/Typed_SV_Message.inl similarity index 100% rename from dep/include/ace/Typed_SV_Message.inl rename to externals/ace/Typed_SV_Message.inl diff --git a/dep/src/ace/Typed_SV_Message_Queue.cpp b/externals/ace/Typed_SV_Message_Queue.cpp similarity index 99% rename from dep/src/ace/Typed_SV_Message_Queue.cpp rename to externals/ace/Typed_SV_Message_Queue.cpp index 24459c79a4a..0adb589e62b 100644 --- a/dep/src/ace/Typed_SV_Message_Queue.cpp +++ b/externals/ace/Typed_SV_Message_Queue.cpp @@ -54,4 +54,3 @@ ACE_Typed_SV_Message_Queue::~ACE_Typed_SV_Message_Queue (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */ - diff --git a/dep/include/ace/Typed_SV_Message_Queue.h b/externals/ace/Typed_SV_Message_Queue.h similarity index 99% rename from dep/include/ace/Typed_SV_Message_Queue.h rename to externals/ace/Typed_SV_Message_Queue.h index f5f336b010d..12c0e50921b 100644 --- a/dep/include/ace/Typed_SV_Message_Queue.h +++ b/externals/ace/Typed_SV_Message_Queue.h @@ -90,4 +90,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_TYPED_MESSAGE_QUEUE_H */ - diff --git a/dep/include/ace/Typed_SV_Message_Queue.inl b/externals/ace/Typed_SV_Message_Queue.inl similarity index 100% rename from dep/include/ace/Typed_SV_Message_Queue.inl rename to externals/ace/Typed_SV_Message_Queue.inl diff --git a/dep/src/ace/UNIX_Addr.cpp b/externals/ace/UNIX_Addr.cpp similarity index 99% rename from dep/src/ace/UNIX_Addr.cpp rename to externals/ace/UNIX_Addr.cpp index 0f2a14d9c42..013af8a33ec 100644 --- a/dep/src/ace/UNIX_Addr.cpp +++ b/externals/ace/UNIX_Addr.cpp @@ -149,4 +149,3 @@ ACE_UNIX_Addr::ACE_UNIX_Addr (const char rendezvous_point[]) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ - diff --git a/dep/include/ace/UNIX_Addr.h b/externals/ace/UNIX_Addr.h similarity index 100% rename from dep/include/ace/UNIX_Addr.h rename to externals/ace/UNIX_Addr.h index 253748dfa02..887529fe152 100644 --- a/dep/include/ace/UNIX_Addr.h +++ b/externals/ace/UNIX_Addr.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_UNIX_ADDR_H #define ACE_UNIX_ADDR_H @@ -114,4 +115,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UNIX_ADDR_H */ - diff --git a/dep/include/ace/UNIX_Addr.inl b/externals/ace/UNIX_Addr.inl similarity index 99% rename from dep/include/ace/UNIX_Addr.inl rename to externals/ace/UNIX_Addr.inl index 7262f0f4250..5e801b56fea 100644 --- a/dep/include/ace/UNIX_Addr.inl +++ b/externals/ace/UNIX_Addr.inl @@ -2,8 +2,10 @@ // // $Id: UNIX_Addr.inl 80826 2008-03-04 14:51:23Z wotte $ + #include "ace/OS_NS_string.h" + #if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/UPIPE_Acceptor.cpp b/externals/ace/UPIPE_Acceptor.cpp similarity index 93% rename from dep/src/ace/UPIPE_Acceptor.cpp rename to externals/ace/UPIPE_Acceptor.cpp index 97d90dfa570..c2c10155c35 100644 --- a/dep/src/ace/UPIPE_Acceptor.cpp +++ b/externals/ace/UPIPE_Acceptor.cpp @@ -1,8 +1,8 @@ -// $Id: UPIPE_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: UPIPE_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #include "ace/UPIPE_Acceptor.h" -ACE_RCSID(ace, UPIPE_Acceptor, "$Id: UPIPE_Acceptor.cpp 80826 2008-03-04 14:51:23Z wotte $") +ACE_RCSID(ace, UPIPE_Acceptor, "$Id: UPIPE_Acceptor.cpp 82723 2008-09-16 09:35:44Z johnnyw $") #if defined (ACE_HAS_THREADS) @@ -72,8 +72,8 @@ int ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream, ACE_UPIPE_Addr *remote_addr, ACE_Time_Value *timeout, - int restart, - int reset_new_handle) + bool restart, + bool reset_new_handle) { ACE_TRACE ("ACE_UPIPE_Acceptor::accept"); ACE_UNUSED_ARG (reset_new_handle); @@ -127,4 +127,3 @@ ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/UPIPE_Acceptor.h b/externals/ace/UPIPE_Acceptor.h similarity index 94% rename from dep/include/ace/UPIPE_Acceptor.h rename to externals/ace/UPIPE_Acceptor.h index c180a16f2fb..e4925a045a2 100644 --- a/dep/include/ace/UPIPE_Acceptor.h +++ b/externals/ace/UPIPE_Acceptor.h @@ -4,13 +4,14 @@ /** * @file UPIPE_Acceptor.h * - * $Id: UPIPE_Acceptor.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: UPIPE_Acceptor.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Gerhard Lenzer * @author Douglas C. Schmidt */ //============================================================================= + #ifndef ACE_UPIPE_ACCEPTOR_H #define ACE_UPIPE_ACCEPTOR_H #include /**/ "ace/pre.h" @@ -68,8 +69,8 @@ public: int accept (ACE_UPIPE_Stream &server_stream, ACE_UPIPE_Addr *remote_addr = 0, ACE_Time_Value *timeout = 0, - int restart = 1, - int reset_new_handle = 0); + bool restart = true, + bool reset_new_handle = false); /// Dump the state of an object. void dump (void) const; @@ -96,4 +97,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UPIPE_ACCEPTOR_H */ - diff --git a/dep/include/ace/UPIPE_Acceptor.inl b/externals/ace/UPIPE_Acceptor.inl similarity index 100% rename from dep/include/ace/UPIPE_Acceptor.inl rename to externals/ace/UPIPE_Acceptor.inl diff --git a/dep/include/ace/UPIPE_Addr.h b/externals/ace/UPIPE_Addr.h similarity index 100% rename from dep/include/ace/UPIPE_Addr.h rename to externals/ace/UPIPE_Addr.h index ca1db7a67aa..aaf33b683fa 100644 --- a/dep/include/ace/UPIPE_Addr.h +++ b/externals/ace/UPIPE_Addr.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_UPIPE_ADDR_H #define ACE_UPIPE_ADDR_H @@ -30,4 +31,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UPIPE_ADDR_H */ - diff --git a/dep/src/ace/UPIPE_Connector.cpp b/externals/ace/UPIPE_Connector.cpp similarity index 99% rename from dep/src/ace/UPIPE_Connector.cpp rename to externals/ace/UPIPE_Connector.cpp index 863dde91fc1..9b9bfcd3878 100644 --- a/dep/src/ace/UPIPE_Connector.cpp +++ b/externals/ace/UPIPE_Connector.cpp @@ -99,4 +99,3 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/UPIPE_Connector.h b/externals/ace/UPIPE_Connector.h similarity index 97% rename from dep/include/ace/UPIPE_Connector.h rename to externals/ace/UPIPE_Connector.h index 69beb1a965b..b2ad1787aaf 100644 --- a/dep/include/ace/UPIPE_Connector.h +++ b/externals/ace/UPIPE_Connector.h @@ -4,12 +4,13 @@ /** * @file UPIPE_Connector.h * - * $Id: UPIPE_Connector.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: UPIPE_Connector.h 82723 2008-09-16 09:35:44Z johnnyw $ * * @author Gerhard Lenzer and Douglas C. Schmidt */ //============================================================================= + #ifndef ACE_UPIPE_CONNECTOR_H #define ACE_UPIPE_CONNECTOR_H #include /**/ "ace/pre.h" @@ -88,7 +89,7 @@ public: int perms = 0); /// Resets any event associations on this handle - int reset_new_handle (ACE_HANDLE handle); + bool reset_new_handle (ACE_HANDLE handle); // = Meta-type info typedef ACE_UPIPE_Addr PEER_ADDR; @@ -112,4 +113,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UPIPE_CONNECTOR_H */ - diff --git a/dep/include/ace/UPIPE_Connector.inl b/externals/ace/UPIPE_Connector.inl similarity index 91% rename from dep/include/ace/UPIPE_Connector.inl rename to externals/ace/UPIPE_Connector.inl index fa43dbea326..07b7502cce0 100644 --- a/dep/include/ace/UPIPE_Connector.inl +++ b/externals/ace/UPIPE_Connector.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: UPIPE_Connector.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: UPIPE_Connector.inl 82723 2008-09-16 09:35:44Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -24,11 +24,11 @@ ACE_UPIPE_Connector::ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream, ACE_TEXT ("ACE_UPIPE_Connector"))); } -ACE_INLINE int +ACE_INLINE bool ACE_UPIPE_Connector::reset_new_handle (ACE_HANDLE /* handle */) { // Nothing to do here since the handle is not a socket - return 0; + return false; } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/UPIPE_Stream.cpp b/externals/ace/UPIPE_Stream.cpp similarity index 99% rename from dep/src/ace/UPIPE_Stream.cpp rename to externals/ace/UPIPE_Stream.cpp index 66c537f9d5d..d07722a482e 100644 --- a/dep/src/ace/UPIPE_Stream.cpp +++ b/externals/ace/UPIPE_Stream.cpp @@ -215,7 +215,7 @@ ACE_UPIPE_Stream::recv_n (char *buf, len = this->recv (buf + bytes_read, n - bytes_read, timeout); - + if (len == -1) { return -1; @@ -232,4 +232,3 @@ ACE_UPIPE_Stream::recv_n (char *buf, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_THREADS */ - diff --git a/dep/include/ace/UPIPE_Stream.h b/externals/ace/UPIPE_Stream.h similarity index 100% rename from dep/include/ace/UPIPE_Stream.h rename to externals/ace/UPIPE_Stream.h index 89b8d793cf5..b10aef11591 100644 --- a/dep/include/ace/UPIPE_Stream.h +++ b/externals/ace/UPIPE_Stream.h @@ -11,6 +11,7 @@ */ //============================================================================= + #ifndef ACE_UPIPE_STREAM_H #define ACE_UPIPE_STREAM_H #include /**/ "ace/pre.h" @@ -137,4 +138,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /*ACE_UPIPE_STREAM_H */ - diff --git a/dep/include/ace/UPIPE_Stream.inl b/externals/ace/UPIPE_Stream.inl similarity index 100% rename from dep/include/ace/UPIPE_Stream.inl rename to externals/ace/UPIPE_Stream.inl diff --git a/dep/src/ace/UTF16_Encoding_Converter.cpp b/externals/ace/UTF16_Encoding_Converter.cpp similarity index 98% rename from dep/src/ace/UTF16_Encoding_Converter.cpp rename to externals/ace/UTF16_Encoding_Converter.cpp index e7013acfd3e..da883734c39 100644 --- a/dep/src/ace/UTF16_Encoding_Converter.cpp +++ b/externals/ace/UTF16_Encoding_Converter.cpp @@ -1,4 +1,4 @@ -// $Id: UTF16_Encoding_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: UTF16_Encoding_Converter.cpp 83735 2008-11-14 09:41:52Z johnnyw $ // ====================================================================== // @@ -75,6 +75,7 @@ static const ACE_UINT32 offsetsFromUTF8[6] = { 0x00000000, 0x00003080, 0x000E2080, 0x03C82080, 0xFA082080, 0x82082080 }; + ACE_UTF16_Encoding_Converter::ACE_UTF16_Encoding_Converter (bool swap) : swap_ (swap) { @@ -304,7 +305,7 @@ ACE_UTF16_Encoding_Converter::encoded (const ACE_Byte* source, static const size_t converted = begin * 4; ACE_Byte target[converted]; - ACE_UTF16_Encoding_Converter* converter; + ACE_UTF16_Encoding_Converter* converter = 0; ACE_NEW_RETURN (converter, ACE_UTF16_Encoding_Converter (false), 0); @@ -361,4 +362,3 @@ ACE_UTF16_Encoding_Converter::get_offsets_from_utf8 (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_WCHAR */ - diff --git a/dep/include/ace/UTF16_Encoding_Converter.h b/externals/ace/UTF16_Encoding_Converter.h similarity index 99% rename from dep/include/ace/UTF16_Encoding_Converter.h rename to externals/ace/UTF16_Encoding_Converter.h index 231ce158dfa..9bdcb21a07f 100644 --- a/dep/include/ace/UTF16_Encoding_Converter.h +++ b/externals/ace/UTF16_Encoding_Converter.h @@ -84,4 +84,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UTF16_ENCODING_CONVERTER_H */ - diff --git a/dep/include/ace/UTF16_Encoding_Converter.inl b/externals/ace/UTF16_Encoding_Converter.inl similarity index 100% rename from dep/include/ace/UTF16_Encoding_Converter.inl rename to externals/ace/UTF16_Encoding_Converter.inl diff --git a/dep/src/ace/UTF32_Encoding_Converter.cpp b/externals/ace/UTF32_Encoding_Converter.cpp similarity index 99% rename from dep/src/ace/UTF32_Encoding_Converter.cpp rename to externals/ace/UTF32_Encoding_Converter.cpp index 325eded7428..459bf2530b0 100644 --- a/dep/src/ace/UTF32_Encoding_Converter.cpp +++ b/externals/ace/UTF32_Encoding_Converter.cpp @@ -252,4 +252,3 @@ ACE_UTF32_Encoding_Converter::encoded (const ACE_Byte* source, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_WCHAR */ - diff --git a/dep/include/ace/UTF32_Encoding_Converter.h b/externals/ace/UTF32_Encoding_Converter.h similarity index 99% rename from dep/include/ace/UTF32_Encoding_Converter.h rename to externals/ace/UTF32_Encoding_Converter.h index dc811d7251d..214edeeeed8 100644 --- a/dep/include/ace/UTF32_Encoding_Converter.h +++ b/externals/ace/UTF32_Encoding_Converter.h @@ -65,4 +65,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UTF32_ENCODING_CONVERTER_H */ - diff --git a/dep/src/ace/UTF8_Encoding_Converter.cpp b/externals/ace/UTF8_Encoding_Converter.cpp similarity index 98% rename from dep/src/ace/UTF8_Encoding_Converter.cpp rename to externals/ace/UTF8_Encoding_Converter.cpp index 5756c7dac59..cd6c409d0f8 100644 --- a/dep/src/ace/UTF8_Encoding_Converter.cpp +++ b/externals/ace/UTF8_Encoding_Converter.cpp @@ -74,7 +74,7 @@ ACE_UTF8_Encoding_Converter* ACE_UTF8_Encoding_Converter::encoded (const ACE_Byte* source, size_t source_size) { - for (size_t i = 0; i < source_size; i++) + for(size_t i = 0; i < source_size; i++) { if (source[i] < 0x01 || source[i] > 0x7f) return 0; @@ -90,4 +90,3 @@ ACE_UTF8_Encoding_Converter::encoded (const ACE_Byte* source, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_WCHAR */ - diff --git a/dep/include/ace/UTF8_Encoding_Converter.h b/externals/ace/UTF8_Encoding_Converter.h similarity index 100% rename from dep/include/ace/UTF8_Encoding_Converter.h rename to externals/ace/UTF8_Encoding_Converter.h index a38cffbc0ff..2cb6ed4e452 100644 --- a/dep/include/ace/UTF8_Encoding_Converter.h +++ b/externals/ace/UTF8_Encoding_Converter.h @@ -53,6 +53,7 @@ public: size_t target_size, bool strict = true); + /// This factory helper method determines if the source stream is UTF-8 /// encoded. If it is, allocate an ACE_UTF8_Encoding_Converter and /// return it. The caller then owns the allocated object. @@ -69,4 +70,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UTF8_ENCODING_CONVERTER_H */ - diff --git a/dep/src/ace/UUID.cpp b/externals/ace/UUID.cpp similarity index 61% rename from dep/src/ace/UUID.cpp rename to externals/ace/UUID.cpp index 8b2427a82e3..800469481e7 100644 --- a/dep/src/ace/UUID.cpp +++ b/externals/ace/UUID.cpp @@ -1,4 +1,4 @@ -//$Id: UUID.cpp 81541 2008-04-30 13:56:12Z shuston $ +//$Id: UUID.cpp 88515 2010-01-13 08:47:38Z johnnyw $ #include "ace/UUID.h" #include "ace/Guard_T.h" @@ -17,159 +17,118 @@ ACE_RCSID (ace, UUID, - "$Id: UUID.cpp 81541 2008-04-30 13:56:12Z shuston $") + "$Id: UUID.cpp 88515 2010-01-13 08:47:38Z johnnyw $") + ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_Utils { - UUID_Node::UUID_Node (void) - { - for (int i = 0; i < UUID_Node::NODE_ID_SIZE; ++i) - node_ID_[i] = 0; - } + // NIL version of the UUID + const UUID UUID::NIL_UUID; - UUID_Node::Node_ID& - UUID_Node::node_ID (void) - { - return node_ID_; - } - - void - UUID_Node::node_ID (Node_ID& node_ID) - { - for (int i = 0; i < UUID_Node::NODE_ID_SIZE; ++i) - node_ID_[i] = node_ID[i]; - } - - UUID UUID::NIL_UUID; - - /// Construct a nil UUID. Such a UUID has every one of it's data - /// elements set to zero. - UUID::UUID (void) - : time_low_ (0), - time_mid_ (0), - time_hi_and_version_ (0), - clock_seq_hi_and_reserved_ (0), - clock_seq_low_ (0), - node_ (0), - node_release_ (true), - as_string_ (0) - { - ACE_NEW (node_, - UUID_Node); - } - - /// Construct a UUID from a string representation of an UUID. UUID::UUID (const ACE_CString& uuid_string) - : time_low_ (0), - time_mid_ (0), - time_hi_and_version_ (0), - clock_seq_hi_and_reserved_ (0), - clock_seq_low_ (0), - node_ (0), - node_release_ (true), - as_string_ (0) { - ACE_NEW (node_, - UUID_Node); - + this->init (); this->from_string_i (uuid_string); } - UUID::UUID (const UUID &right) - : time_low_ (right.time_low_), - time_mid_ (right.time_mid_), - time_hi_and_version_ (right.time_hi_and_version_), - clock_seq_hi_and_reserved_ (right.clock_seq_hi_and_reserved_), - clock_seq_low_ (right.clock_seq_low_), - as_string_ (0) + const UUID & + UUID::operator = (const UUID & rhs) { - ACE_NEW (node_, - UUID_Node (*right.node_)); - } - - UUID::~UUID (void) - { - if (node_release_) - delete node_; - - if (as_string_ != 0) - delete as_string_; - } - - const ACE_CString* - UUID::to_string (void) - { - /// Only compute the string representation once. - if (as_string_ == 0) + if (this != &rhs) { - // Get a buffer exactly the correct size. Use the nil UUID as a - // gauge. Don't forget the trailing nul. - size_t UUID_STRING_LENGTH = 36 + thr_id_.length () + pid_.length (); - char *buf = 0; - - if ((thr_id_.length () != 0) && (pid_.length () != 0)) + // Reset the string version of the UUID a string version + // exist, and the UUID is not equal to the old UUID. + if (0 != this->as_string_.get ()) { - UUID_STRING_LENGTH += 2; //for '-' - ACE_NEW_RETURN (buf, - char[UUID_STRING_LENGTH + 1], - 0); - - ACE_OS::sprintf (buf, - "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x-%s-%s", - this->time_low_, - this->time_mid_, - this->time_hi_and_version_, - this->clock_seq_hi_and_reserved_, - this->clock_seq_low_, - (this->node_->node_ID ()) [0], - (this->node_->node_ID ()) [1], - (this->node_->node_ID ()) [2], - (this->node_->node_ID ()) [3], - (this->node_->node_ID ()) [4], - (this->node_->node_ID ()) [5], - thr_id_.c_str (), - pid_.c_str () - ); - } - else - { - ACE_NEW_RETURN (buf, - char[UUID_STRING_LENGTH + 1], - 0); - - ACE_OS::sprintf (buf, - "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", - this->time_low_, - this->time_mid_, - this->time_hi_and_version_, - this->clock_seq_hi_and_reserved_, - this->clock_seq_low_, - (this->node_->node_ID ()) [0], - (this->node_->node_ID ()) [1], - (this->node_->node_ID ()) [2], - (this->node_->node_ID ()) [3], - (this->node_->node_ID ()) [4], - (this->node_->node_ID ()) [5] - ); + if (0 == rhs.as_string_.get () || *this != rhs) + this->as_string_.reset (); } - // We allocated 'buf' above dynamically, so we shouldn't use - // ACE_NEW_RETURN here to avoid a possible memory leak. - ACE_NEW_NORETURN (this->as_string_, - ACE_CString (buf, UUID_STRING_LENGTH)); + // Copy the contents of the UUID. + ACE_OS::memcpy (&this->uuid_, &rhs.uuid_, BINARY_SIZE); - // we first free the dynamically allocated 'buf'. - delete [] buf; - - // then we test that ACE_NEW succeded for 'as_string_' - // if not, we return 0 (NULL) to indicate failure. - if (this->as_string_ == 0 ) - return 0; + /// @todo We should create an UUID_Ex class for UUIDs that + /// contain the thread id and process id. + this->thr_id_ = rhs.thr_id_; + this->pid_ = rhs.pid_; } - return as_string_; + return *this; + } + + const ACE_CString * UUID::to_string (void) const + { + // Compute the string representation only once. + if (0 != this->as_string_.get ()) + return this->as_string_.get (); + + // Get a buffer exactly the correct size. Use the nil UUID as a + // gauge. Don't forget the trailing nul. + ACE_Auto_Array_Ptr auto_clean; + size_t UUID_STRING_LENGTH = 36 + thr_id_.length () + pid_.length (); + char *buf = 0; + + if (36 == UUID_STRING_LENGTH) + { + ACE_NEW_RETURN (buf, + char[UUID_STRING_LENGTH + 1], + 0); + + // Let the auto array pointer manage the buffer. + auto_clean.reset (buf); + + ACE_OS::sprintf (buf, + "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", + this->uuid_.time_low_, + this->uuid_.time_mid_, + this->uuid_.time_hi_and_version_, + this->uuid_.clock_seq_hi_and_reserved_, + this->uuid_.clock_seq_low_, + (this->uuid_.node_.node_ID ()) [0], + (this->uuid_.node_.node_ID ()) [1], + (this->uuid_.node_.node_ID ()) [2], + (this->uuid_.node_.node_ID ()) [3], + (this->uuid_.node_.node_ID ()) [4], + (this->uuid_.node_.node_ID ()) [5]); + } + else + { + UUID_STRING_LENGTH += 2; //for '-' + ACE_NEW_RETURN (buf, + char[UUID_STRING_LENGTH + 1], + 0); + + // Let the auto array pointer manage the buffer. + auto_clean.reset (buf); + + ACE_OS::sprintf (buf, + "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x-%s-%s", + this->uuid_.time_low_, + this->uuid_.time_mid_, + this->uuid_.time_hi_and_version_, + this->uuid_.clock_seq_hi_and_reserved_, + this->uuid_.clock_seq_low_, + (this->uuid_.node_.node_ID ()) [0], + (this->uuid_.node_.node_ID ()) [1], + (this->uuid_.node_.node_ID ()) [2], + (this->uuid_.node_.node_ID ()) [3], + (this->uuid_.node_.node_ID ()) [4], + (this->uuid_.node_.node_ID ()) [5], + thr_id_.c_str (), + pid_.c_str ()); + } + + // Save the string. + ACE_CString * as_string = 0; + + ACE_NEW_RETURN (as_string, + ACE_CString (buf, UUID_STRING_LENGTH), + 0); + + this->as_string_.reset (as_string); + return this->as_string_.get (); } void @@ -186,10 +145,7 @@ namespace ACE_Utils /// Special case for the nil UUID. if (uuid_string == *NIL_UUID.to_string ()) { - bool copy_constructor_not_supported = false; - ACE_ASSERT (copy_constructor_not_supported); - //*this = NIL_UUID; - ACE_UNUSED_ARG (copy_constructor_not_supported); + *this = NIL_UUID; return; } @@ -284,20 +240,18 @@ namespace ACE_Utils } } - this->time_low_ = static_cast (time_low); - this->time_mid_ = static_cast (time_mid); - this->time_hi_and_version_ = static_cast (time_hi_and_version); - this->clock_seq_hi_and_reserved_ = static_cast (clock_seq_hi_and_reserved); - this->clock_seq_low_ = static_cast (clock_seq_low); + this->uuid_.time_low_ = static_cast (time_low); + this->uuid_.time_mid_ = static_cast (time_mid); + this->uuid_.time_hi_and_version_ = static_cast (time_hi_and_version); + this->uuid_.clock_seq_hi_and_reserved_ = static_cast (clock_seq_hi_and_reserved); + this->uuid_.clock_seq_low_ = static_cast (clock_seq_low); - UUID_Node::Node_ID node_id; - for (int i = 0; i < UUID_Node::NODE_ID_SIZE; ++i) - node_id [i] = static_cast (node[i]); - - this->node_->node_ID (node_id); + for (size_t i = 0; i < UUID_Node::NODE_ID_SIZE; ++ i) + this->uuid_.node_.node_ID ()[i] = static_cast (node[i]); // Support varient 10- only - if ((this->clock_seq_hi_and_reserved_ & 0xc0) != 0x80 && (this->clock_seq_hi_and_reserved_ & 0xc0) != 0xc0) + if ((this->uuid_.clock_seq_hi_and_reserved_ & 0xc0) != 0x80 && + (this->uuid_.clock_seq_hi_and_reserved_ & 0xc0) != 0xc0) { ACE_DEBUG ((LM_DEBUG, "ACE_UUID::from_string_i - " @@ -306,7 +260,7 @@ namespace ACE_Utils } /// Support versions 1, 3, and 4 only - ACE_UINT16 V1 = this->time_hi_and_version_; + ACE_UINT16 V1 = this->uuid_.time_hi_and_version_; if ((V1 & 0xF000) != 0x1000 && (V1 & 0xF000) != 0x3000 && @@ -318,7 +272,7 @@ namespace ACE_Utils return; } - if ((this->clock_seq_hi_and_reserved_ & 0xc0) == 0xc0) + if ((this->uuid_.clock_seq_hi_and_reserved_ & 0xc0) == 0xc0) { if (uuid_string.length () == NIL_UUID.to_string ()->length ()) { @@ -335,19 +289,20 @@ namespace ACE_Utils "IllegalArgument (Thread and Process Id format incorrect)\n")); this->thr_id_ = thr_pid_str.substr (0, pos); - this->pid_ = thr_pid_str.substr (pos+1, thr_pid_str.length ()-pos-1); + this->pid_ = thr_pid_str.substr (pos+1, thr_pid_str.length ()-pos-1); } } - UUID_Generator::UUID_Generator () + UUID_Generator::UUID_Generator (void) : time_last_ (0), - destroy_lock_ (true) + destroy_lock_ (true), + is_init_ (false) { - ACE_NEW (lock_, - ACE_SYNCH_MUTEX); + ACE_NEW (lock_, ACE_SYNCH_MUTEX); + this->init (); } - UUID_Generator::~UUID_Generator () + UUID_Generator::~UUID_Generator (void) { if (destroy_lock_) delete lock_; @@ -356,24 +311,19 @@ namespace ACE_Utils void UUID_Generator::init (void) { + if (this->is_init_) + return; + ACE_OS::macaddr_node_t macaddress; - int result = ACE_OS::getmacaddress (&macaddress); + int const result = ACE_OS::getmacaddress (&macaddress); UUID_Node::Node_ID node_id; - if (result != -1) - { -// ACE_DEBUG ((LM_DEBUG, -// "%02X-%02X-%02X-%02X-%02X-%02X\n", -// macaddress.node [0], -// macaddress.node [1], -// macaddress.node [2], -// macaddress.node [3], -// macaddress.node [4], -// macaddress.node [5])); - ACE_OS::memcpy (&node_id, + if (-1 != result) + { + ACE_OS::memcpy (node_id, macaddress.node, - sizeof (node_id)); + UUID_Node::NODE_ID_SIZE); } else { @@ -390,13 +340,18 @@ namespace ACE_Utils { ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, *lock_); uuid_state_.timestamp = time_last_; - uuid_state_.node.node_ID (node_id); + + ACE_OS::memcpy (uuid_state_.node.node_ID (), + node_id, + UUID_Node::NODE_ID_SIZE); } + + this->is_init_ = true; } void - UUID_Generator::generate_UUID (UUID& uuid,ACE_UINT16 version, - u_char variant) + UUID_Generator:: + generate_UUID (UUID& uuid, ACE_UINT16 version, u_char variant) { UUID_Time timestamp; ACE_UINT16 clock_sequence; @@ -419,7 +374,7 @@ namespace ACE_Utils cseqHAV |= variant; uuid.clock_seq_hi_and_reserved (cseqHAV); - uuid.node (& (uuid_state_.node)); + uuid.node (uuid_state_.node); if (variant == 0xc0) { @@ -438,7 +393,7 @@ namespace ACE_Utils UUID* UUID_Generator::generate_UUID (ACE_UINT16 version, u_char variant) { - UUID* uuid; + UUID* uuid = 0; ACE_NEW_RETURN (uuid, UUID, 0); @@ -524,7 +479,7 @@ namespace ACE_Utils now.to_usec (time); time = time * 10; timestamp = time + timeOffset; -} + } ACE_SYNCH_MUTEX* UUID_Generator::lock (void) @@ -533,8 +488,7 @@ namespace ACE_Utils } void - UUID_Generator::lock (ACE_SYNCH_MUTEX* lock, - bool release_lock) + UUID_Generator::lock (ACE_SYNCH_MUTEX* lock, bool release_lock) { if (this->destroy_lock_) delete this->lock_; @@ -542,13 +496,11 @@ namespace ACE_Utils this->lock_ = lock; this->destroy_lock_ = release_lock; } - } #if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton * - ACE_Singleton::singleton_; + template ACE_Singleton * + ACE_Singleton ::singleton_; #endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/UUID.h b/externals/ace/UUID.h similarity index 68% rename from dep/include/ace/UUID.h rename to externals/ace/UUID.h index f2dceff3e51..ae43c145dbb 100644 --- a/dep/include/ace/UUID.h +++ b/externals/ace/UUID.h @@ -4,7 +4,7 @@ /** * @file UUID.h * - * $Id: UUID.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: UUID.h 88604 2010-01-18 18:01:19Z hillj $ * * @author Andrew T. Finnel * @author Yamuna Krishnmaurthy @@ -21,6 +21,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Auto_Ptr.h" #include "ace/SString.h" #include "ace/Singleton.h" #include "ace/Synch_Traits.h" @@ -29,33 +30,41 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_Utils { - /// Class to hold a MAC address + /** + * @class UUID_Node + * + * @brief Holds the MAC-address of the UUID. + */ class ACE_Export UUID_Node { public: - - /// Constructor - UUID_Node (void); - + /// Size of the node in bytes. enum {NODE_ID_SIZE = 6}; + + /// Type definition of the node. typedef u_char Node_ID[NODE_ID_SIZE]; - Node_ID &node_ID (void); - void node_ID (Node_ID&); + /// Get the node id + Node_ID & node_ID (void); - ///// Equality Operations - bool operator == (const UUID_Node& right) const; - bool operator != (const UUID_Node& right) const; + /** + * @overload + */ + const Node_ID & node_ID (void) const; - ///// Relational Operations - //bool operator < (const UUID_Node& right) const; + /// Test for equality. + bool operator == (const UUID_Node & right) const; + + /// Test for inequality. + bool operator != (const UUID_Node & right) const; private: + /// The value of the node id. Node_ID node_ID_; }; /** - * @class ACE_UUID + * @class ACE_UUID * * ACE_UUID represents a Universally Unique IDentifier (UUID) as * described in (the expired) INTERNET-DRAFT specification entitled @@ -75,6 +84,8 @@ namespace ACE_Utils class ACE_Export UUID { public: + /// The size of a binary UUID. + enum { BINARY_SIZE = 16 }; /// Constructor UUID (void); @@ -102,8 +113,10 @@ namespace ACE_Utils u_char clock_seq_low (void) const; void clock_seq_low (u_char); - UUID_Node* node (void) const; - void node (UUID_Node*); + UUID_Node & node (void); + const UUID_Node & node (void) const; + + void node (const UUID_Node & node); ACE_CString* thr_id (void); void thr_id (char*); @@ -112,42 +125,63 @@ namespace ACE_Utils void pid (char*); /// Returns a string representation of the UUID - const ACE_CString* to_string (void); + const ACE_CString* to_string (void) const; /// Set the value using a string void from_string (const ACE_CString& uuid_string); - static UUID NIL_UUID; + /// NIL UUID + static const UUID NIL_UUID; /// Equality Operations - bool operator== (const UUID &right) const; - bool operator!= (const UUID &right) const; + bool operator == (const UUID &right) const; + bool operator != (const UUID &right) const; - /// Relational Operations - //bool operator< (const UUID &right) const; - //bool operator> (const UUID &right) const; - //bool operator<= (const UUID &right) const; - //bool operator>= (const UUID &right) const; + /// Compute a hash value for the UUID. + unsigned long hash (void) const; + + /// Assign an existing UUID to this UUID. + const UUID & operator = (const UUID & rhs); private: + /// Initialize the UUID + void init (void); + + /** + * Helper method to convert from a string UUID. + * + * @param[in] uuid_string String version of UUID. + */ void from_string_i (const ACE_CString& uuid_string); - UUID& operator= (const UUID&); - /// Data Members for Class Attributes - ACE_UINT32 time_low_; - ACE_UINT16 time_mid_; - ACE_UINT16 time_hi_and_version_; - u_char clock_seq_hi_and_reserved_; - u_char clock_seq_low_; - UUID_Node* node_; - bool node_release_; + struct data + { + /// Time low. + ACE_UINT32 time_low_; + + /// Time mid. + ACE_UINT16 time_mid_; + + /// Time high and version. + ACE_UINT16 time_hi_and_version_; + + /// Clock sequence high and reserved space. + u_char clock_seq_hi_and_reserved_; + + /// Clock sequence low. + u_char clock_seq_low_; + + /// MAC-address within the UUID. + UUID_Node node_; + } uuid_; + ACE_CString thr_id_; ACE_CString pid_; /// The string representation of the UUID. This is created and /// updated only on demand. - ACE_CString *as_string_; + mutable ACE_Auto_Ptr as_string_; }; /** @@ -162,9 +196,14 @@ namespace ACE_Utils enum {ACE_UUID_CLOCK_SEQ_MASK = 0x3FFF}; - UUID_Generator(); + /// Default constructor. + UUID_Generator(void); + + /// Destructor. ~UUID_Generator(); + /// Initialize the UUID generator + /// @deprecated This method may go away in some future release. void init (void); /// Format timestamp, clockseq, and nodeID into an UUID of the @@ -185,11 +224,9 @@ namespace ACE_Utils ACE_SYNCH_MUTEX* lock (void); /// Set a new locking strategy and return the old one. - void lock (ACE_SYNCH_MUTEX* lock, - bool release_lock); + void lock (ACE_SYNCH_MUTEX* lock, bool release_lock); private: - /// The system time when that last uuid was generated. UUID_Time time_last_; @@ -214,20 +251,26 @@ namespace ACE_Utils /// Obtain the system time in UTC as a count of 100 nanosecond intervals /// since 00:00:00.00, 15 October 1582 (the date of Gregorian reform to - /// the Christian calendar). + /// the Christian calendar). void get_systemtime( UUID_Time& timeNow); /// The UUID generator persistent state. UUID_State uuid_state_; ACE_SYNCH_MUTEX* lock_; + bool destroy_lock_; + + /// Initalization state of the generator. + bool is_init_; }; - typedef ACE_Singleton UUID_GENERATOR; - + typedef ACE_Singleton + UUID_GENERATOR; } +ACE_SINGLETON_DECLARE (ACE_Singleton, ACE_Utils::UUID_Generator, ACE_SYNCH_MUTEX) + ACE_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) @@ -237,4 +280,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif // ACE_UUID_H - diff --git a/dep/include/ace/UUID.inl b/externals/ace/UUID.inl similarity index 53% rename from dep/include/ace/UUID.inl rename to externals/ace/UUID.inl index a60fb6ce17f..568adfa00d0 100644 --- a/dep/include/ace/UUID.inl +++ b/externals/ace/UUID.inl @@ -1,87 +1,134 @@ // -*- C++ -*- // -//$Id: UUID.inl 80826 2008-03-04 14:51:23Z wotte $ +//$Id: UUID.inl 85331 2009-05-14 00:04:12Z hillj $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_Utils { + ACE_INLINE + const UUID_Node::Node_ID & UUID_Node::node_ID (void) const + { + return this->node_ID_; + } + + ACE_INLINE + UUID_Node::Node_ID & UUID_Node::node_ID (void) + { + return this->node_ID_; + } + + ACE_INLINE + UUID::UUID (void) + { + this->init (); + } + + ACE_INLINE + UUID::UUID (const UUID &right) + : thr_id_ (right.thr_id_), + pid_ (right.pid_) + { + ACE_OS::memcpy (&this->uuid_, &right.uuid_, BINARY_SIZE); + } + + ACE_INLINE + UUID::~UUID (void) + { + + } + + ACE_INLINE void + UUID::init (void) + { + ACE_OS::memset (&this->uuid_, 0, BINARY_SIZE); + } + + ACE_INLINE unsigned long + UUID::hash (void) const + { + return ACE::hash_pjw (reinterpret_cast (&this->uuid_), + UUID::BINARY_SIZE); + } - /// Data Members for Class Attributes ACE_INLINE ACE_UINT32 UUID::time_low (void) const { - return this->time_low_; + return this->uuid_.time_low_; } ACE_INLINE void UUID::time_low (ACE_UINT32 timelow) { - this->time_low_ = timelow; + this->uuid_.time_low_ = timelow; } ACE_INLINE ACE_UINT16 UUID::time_mid (void) const { - return this->time_mid_; + return this->uuid_.time_mid_; } ACE_INLINE void UUID::time_mid (ACE_UINT16 time_mid) { - this->time_mid_ = time_mid; + this->uuid_.time_mid_ = time_mid; } ACE_INLINE ACE_UINT16 UUID::time_hi_and_version (void) const { - return this->time_hi_and_version_; + return this->uuid_.time_hi_and_version_; } ACE_INLINE void UUID::time_hi_and_version (ACE_UINT16 time_hi_and_version) { - this->time_hi_and_version_ = time_hi_and_version; + this->uuid_.time_hi_and_version_ = time_hi_and_version; } ACE_INLINE u_char UUID::clock_seq_hi_and_reserved (void) const { - return this->clock_seq_hi_and_reserved_; + return this->uuid_.clock_seq_hi_and_reserved_; } ACE_INLINE void UUID::clock_seq_hi_and_reserved (u_char clock_seq_hi_and_reserved) { - this->clock_seq_hi_and_reserved_ = clock_seq_hi_and_reserved; + this->uuid_.clock_seq_hi_and_reserved_ = clock_seq_hi_and_reserved; } ACE_INLINE u_char UUID::clock_seq_low (void) const { - return this->clock_seq_low_; + return this->uuid_.clock_seq_low_; } ACE_INLINE void UUID::clock_seq_low (u_char clock_seq_low) { - this->clock_seq_low_ = clock_seq_low; + this->uuid_.clock_seq_low_ = clock_seq_low; } - ACE_INLINE UUID_Node* + ACE_INLINE const UUID_Node & UUID::node (void) const { - return this->node_; + return this->uuid_.node_; + } + + ACE_INLINE UUID_Node & + UUID::node (void) + { + return this->uuid_.node_; } ACE_INLINE void - UUID::node (UUID_Node* node) + UUID::node (const UUID_Node & node) { - if (node_release_) - delete node_; - - this->node_ = node; - node_release_ = false; + ACE_OS::memcpy (&this->uuid_.node_, + node.node_ID (), + UUID_Node::NODE_ID_SIZE); } ACE_INLINE ACE_CString* @@ -117,58 +164,15 @@ namespace ACE_Utils ACE_INLINE bool UUID::operator == (const UUID &right) const { - if ((this->time_low_ != right.time_low ()) || - (this->time_mid_ != right.time_mid ()) || - (this->time_hi_and_version_ != right.time_hi_and_version ()) || - (this->clock_seq_hi_and_reserved_ != right.clock_seq_hi_and_reserved ()) || - (this->clock_seq_low_ != right.clock_seq_low ()) || - (*this->node_ != *right.node ())) - return false; - - return true; + return 0 == ACE_OS::memcmp (&this->uuid_, &right.uuid_, BINARY_SIZE); } ACE_INLINE bool UUID::operator != (const UUID &right) const { - return !(*this == right); + return 0 != ACE_OS::memcmp (&this->uuid_, &right.uuid_, BINARY_SIZE); } -// ACE_INLINE bool -//UUID::operator < (const UUID &rt) const -// { -// UUID right (rt); -// if ((timeLow_ < right.timeLow ()) || -// (timeMid_ < right.timeMid ()) || -// (timeHiAndVersion_ < right.timeHiAndVersion ()) || -// (clockSeqHiAndReserved_ < right.clockSeqHiAndReserved ()) || -// (clockSeqLow_ < right.clockSeqLow ()) || -// (node_ < right.node ())) -// { -// return true; -// } -// -// return false; -// } -// -// ACE_INLINE bool -// UUID::operator > (const UUID &right) const -// { -// return right < *this; -// } -// -// ACE_INLINE bool -// UUID::operator <= (const UUID &right) const -// { -// return !(*this > right); -// } -// -// ACE_INLINE bool -// UUID::operator >= (const UUID &right) const -// { -// return !(*this < right); -// } -// ACE_INLINE bool UUID_Node::operator == (const UUID_Node& rt) const { diff --git a/dep/src/ace/Unbounded_Queue.cpp b/externals/ace/Unbounded_Queue.cpp similarity index 99% rename from dep/src/ace/Unbounded_Queue.cpp rename to externals/ace/Unbounded_Queue.cpp index 11efca41c0d..2890650fbe1 100644 --- a/dep/src/ace/Unbounded_Queue.cpp +++ b/externals/ace/Unbounded_Queue.cpp @@ -1,4 +1,4 @@ -// $Id: Unbounded_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Unbounded_Queue.cpp 82723 2008-09-16 09:35:44Z johnnyw $ #ifndef ACE_UNBOUNDED_QUEUE_CPP #define ACE_UNBOUNDED_QUEUE_CPP @@ -154,7 +154,6 @@ ACE_Unbounded_Queue::~ACE_Unbounded_Queue (void) this->allocator_->free, ACE_Node, ); - this->head_ = 0; } template int @@ -432,4 +431,3 @@ ACE_Unbounded_Queue_Iterator::next (T *&item) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_UNBOUNDED_QUEUE_CPP */ - diff --git a/dep/include/ace/Unbounded_Queue.h b/externals/ace/Unbounded_Queue.h similarity index 97% rename from dep/include/ace/Unbounded_Queue.h rename to externals/ace/Unbounded_Queue.h index 0c16ac23388..65be7aaaec6 100644 --- a/dep/include/ace/Unbounded_Queue.h +++ b/externals/ace/Unbounded_Queue.h @@ -4,7 +4,7 @@ /** * @file Unbounded_Queue.h * - * $Id: Unbounded_Queue.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Unbounded_Queue.h 84316 2009-02-03 19:46:05Z johnnyw $ * * @author Douglas C. Schmidt */ @@ -185,17 +185,17 @@ public: // = Check boundary conditions. - /// Returns 1 if the container is empty, otherwise returns 0. + /// Returns true if the container is empty, otherwise returns false. /** * Constant time check to see if the queue is empty. */ - int is_empty (void) const; + bool is_empty (void) const; /// Returns 0. /** * The queue cannot be full, so it always returns 0. */ - int is_full (void) const; + bool is_full (void) const; // = Classic queue operations. @@ -295,4 +295,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UNBOUNDED_QUEUE_H */ - diff --git a/dep/include/ace/Unbounded_Queue.inl b/externals/ace/Unbounded_Queue.inl similarity index 68% rename from dep/include/ace/Unbounded_Queue.inl rename to externals/ace/Unbounded_Queue.inl index 0758412b984..81e3ded3e04 100644 --- a/dep/include/ace/Unbounded_Queue.inl +++ b/externals/ace/Unbounded_Queue.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: Unbounded_Queue.inl 80826 2008-03-04 14:51:23Z wotte $ +// $Id: Unbounded_Queue.inl 84316 2009-02-03 19:46:05Z johnnyw $ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -10,18 +10,18 @@ ACE_Unbounded_Queue::size (void) const return this->cur_size_; } -template ACE_INLINE int +template ACE_INLINE bool ACE_Unbounded_Queue::is_empty (void) const { // ACE_TRACE ("ACE_Unbounded_Queue::is_empty"); return this->head_ == this->head_->next_; } -template ACE_INLINE int +template ACE_INLINE bool ACE_Unbounded_Queue::is_full (void) const { // ACE_TRACE ("ACE_Unbounded_Queue::is_full"); - return 0; // We should implement a "node of last resort for this..." + return false; // We should implement a "node of last resort for this..." } ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Unbounded_Set.cpp b/externals/ace/Unbounded_Set.cpp similarity index 99% rename from dep/src/ace/Unbounded_Set.cpp rename to externals/ace/Unbounded_Set.cpp index a81561b3ab2..c54e3fcfa2f 100644 --- a/dep/src/ace/Unbounded_Set.cpp +++ b/externals/ace/Unbounded_Set.cpp @@ -16,4 +16,3 @@ #endif /* __ACE_INLINE__ */ #endif /* ACE_UNBOUNDED_SET_CPP */ - diff --git a/dep/include/ace/Unbounded_Set.h b/externals/ace/Unbounded_Set.h similarity index 99% rename from dep/include/ace/Unbounded_Set.h rename to externals/ace/Unbounded_Set.h index 44fb84068ee..a75eac18fc3 100644 --- a/dep/include/ace/Unbounded_Set.h +++ b/externals/ace/Unbounded_Set.h @@ -50,7 +50,7 @@ public: // = Initialization method. ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, bool end = false); - + ACE_Unbounded_Set_Iterator (const base_type &s); }; @@ -63,13 +63,13 @@ class ACE_Unbounded_Set_Const_Iterator : public ACE_Unbounded_Set_Ex_Const_Iterator > { public: - + typedef ACE_Unbounded_Set_Ex_Const_Iterator > base_type; - + // = Initialization method. ACE_Unbounded_Set_Const_Iterator (const ACE_Unbounded_Set &s, bool end = false); - + ACE_Unbounded_Set_Const_Iterator (const base_type &s); }; @@ -101,4 +101,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UNBOUNDED_SET_H */ - diff --git a/dep/include/ace/Unbounded_Set.inl b/externals/ace/Unbounded_Set.inl similarity index 98% rename from dep/include/ace/Unbounded_Set.inl rename to externals/ace/Unbounded_Set.inl index 36190c6638c..365b025c0be 100644 --- a/dep/include/ace/Unbounded_Set.inl +++ b/externals/ace/Unbounded_Set.inl @@ -13,7 +13,7 @@ ACE_Unbounded_Set_Default_Comparator::operator () (const T &lhs, const T &rh } template -ACE_Unbounded_Set_Iterator::ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, +ACE_Unbounded_Set_Iterator::ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set &s, bool end) : base_type (s, end) { @@ -45,4 +45,5 @@ ACE_Unbounded_Set::ACE_Unbounded_Set (ACE_Allocator *alloc) { } + ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/dep/src/ace/Unbounded_Set_Ex.cpp b/externals/ace/Unbounded_Set_Ex.cpp similarity index 99% rename from dep/src/ace/Unbounded_Set_Ex.cpp rename to externals/ace/Unbounded_Set_Ex.cpp index 03edae5da0c..c5cd9e27b21 100644 --- a/dep/src/ace/Unbounded_Set_Ex.cpp +++ b/externals/ace/Unbounded_Set_Ex.cpp @@ -497,4 +497,3 @@ ACE_Unbounded_Set_Ex_Const_Iterator::operator!= (const ACE_Unbounded_Set_E ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_UNBOUNDED_SET_EX_CPP */ - diff --git a/dep/include/ace/Unbounded_Set_Ex.h b/externals/ace/Unbounded_Set_Ex.h similarity index 86% rename from dep/include/ace/Unbounded_Set_Ex.h rename to externals/ace/Unbounded_Set_Ex.h index ab16a54be86..3d290a6acb3 100644 --- a/dep/include/ace/Unbounded_Set_Ex.h +++ b/externals/ace/Unbounded_Set_Ex.h @@ -4,7 +4,7 @@ /** * @file Unbounded_Set_Ex.h * - * $Id: Unbounded_Set_Ex.h 81624 2008-05-06 17:14:57Z wotte $ + * $Id: Unbounded_Set_Ex.h 88978 2010-02-13 16:03:31Z hillj $ * * @author Douglas C. Schmidt */ @@ -16,6 +16,7 @@ #include "ace/Node.h" #include "ace/os_include/os_stddef.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -43,12 +44,22 @@ template class ACE_Unbounded_Set_Ex_Iterator { public: + /// Type definition of the container type. + typedef ACE_Unbounded_Set_Ex container_type; + + // = std::iterator_traits typedefs/traits. + typedef std::forward_iterator_tag iterator_category; + typedef typename container_type::value_type value_type; + typedef typename container_type::reference reference; + typedef typename container_type::pointer pointer; + typedef typename container_type::difference_type difference_type; + // = Initialization method. ACE_Unbounded_Set_Ex_Iterator (ACE_Unbounded_Set_Ex &s, bool end = false); // = Iteration methods. - /// Pass back the that hasn't been seen in the Set. + /// Pass back the @a next_item that hasn't been seen in the Set. /// Returns 0 when all items have been seen, else 1. int next (T *&next_item); @@ -102,6 +113,15 @@ template class ACE_Unbounded_Set_Ex_Const_Iterator { public: + typedef ACE_Unbounded_Set_Ex container_type; + + // = std::iterator_traits typedefs/traits. + typedef std::forward_iterator_tag iterator_category; + typedef typename container_type::const_value_type value_type; + typedef typename container_type::const_reference reference; + typedef typename container_type::const_pointer pointer; + typedef typename container_type::difference_type difference_type; + // = Initialization method. ACE_Unbounded_Set_Ex_Const_Iterator (const ACE_Unbounded_Set_Ex &s, bool end = false); @@ -206,6 +226,15 @@ public: typedef C COMP; typedef ACE_Node NODE; + // = STL typedefs/traits. + typedef T value_type; + typedef T const const_value_type; + typedef value_type & reference; + typedef const_value_type & const_reference; + typedef value_type * pointer; + typedef const_value_type * const_pointer; + typedef ptrdiff_t difference_type; + // = Initialization and termination methods. /// Constructor. Use user specified allocation strategy /// if specified. @@ -345,4 +374,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_UNBOUNDED_SET_H */ - diff --git a/dep/include/ace/Unbounded_Set_Ex.inl b/externals/ace/Unbounded_Set_Ex.inl similarity index 100% rename from dep/include/ace/Unbounded_Set_Ex.inl rename to externals/ace/Unbounded_Set_Ex.inl diff --git a/dep/include/ace/Value_Ptr.h b/externals/ace/Value_Ptr.h similarity index 99% rename from dep/include/ace/Value_Ptr.h rename to externals/ace/Value_Ptr.h index f42beba0c99..c9272a90cff 100644 --- a/dep/include/ace/Value_Ptr.h +++ b/externals/ace/Value_Ptr.h @@ -165,4 +165,3 @@ namespace ACE ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_VALUE_PTR_H */ - diff --git a/dep/src/ace/Vector_T.cpp b/externals/ace/Vector_T.cpp similarity index 99% rename from dep/src/ace/Vector_T.cpp rename to externals/ace/Vector_T.cpp index e70ba09add5..006e6db1b4a 100644 --- a/dep/src/ace/Vector_T.cpp +++ b/externals/ace/Vector_T.cpp @@ -40,7 +40,7 @@ void ACE_Vector::push_back (const T& elem) } else ACE_Array::size (length_ + 1); - + ++length_; (*this)[length_-1] = elem; } @@ -152,4 +152,3 @@ ACE_Vector_Iterator::next (T *&item) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_VECTOR_T_CPP */ - diff --git a/dep/include/ace/Vector_T.h b/externals/ace/Vector_T.h similarity index 97% rename from dep/include/ace/Vector_T.h rename to externals/ace/Vector_T.h index c8c6a5112ac..3d49f4391bb 100644 --- a/dep/include/ace/Vector_T.h +++ b/externals/ace/Vector_T.h @@ -4,7 +4,7 @@ /** * @file Vector_T.h * - * $Id: Vector_T.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: Vector_T.h 84477 2009-02-16 13:30:38Z johnnyw $ * * @author Craig L. Ching * @author Gonzalo Diethelm @@ -75,6 +75,7 @@ public: */ typedef ACE_Vector_Iterator Iterator; + /** * General constructor. * @@ -169,14 +170,14 @@ public: // = Compare operators - ///Equality comparison operator. + /// Equality comparison operator. /** * Compare this vector with @arg s for equality. Two vectors are equal * if their sizes are equal and all the elements are equal. */ bool operator== (const ACE_Vector &s) const; - ///Inequality comparison operator. + /// Inequality comparison operator. /** * Compare this vector with @arg s for inequality such that @c *this != * @arg s is always the complement of the boolean return value of @@ -271,7 +272,7 @@ public: // = Iteration methods. - /// Pass back the that hasn't been seen in the vector. + /// Pass back the @a next_item that hasn't been seen in the vector. /// Returns 0 when all items have been seen, else 1. int next (T *&next_item); @@ -313,4 +314,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_VECTOR_T_H */ - diff --git a/dep/include/ace/Vector_T.inl b/externals/ace/Vector_T.inl similarity index 100% rename from dep/include/ace/Vector_T.inl rename to externals/ace/Vector_T.inl diff --git a/externals/ace/Version.h b/externals/ace/Version.h new file mode 100644 index 00000000000..cf8dc897ac6 --- /dev/null +++ b/externals/ace/Version.h @@ -0,0 +1,9 @@ + +// -*- C++ -*- +// $Id: Version.h 90351 2010-05-31 07:06:15Z johnnyw $ +// This is file was automatically generated by \$ACE_ROOT/bin/make_release. + +#define ACE_MAJOR_VERSION 5 +#define ACE_MINOR_VERSION 7 +#define ACE_BETA_VERSION 9 +#define ACE_VERSION "5.7.9" diff --git a/dep/include/ace/Versioned_Namespace.h b/externals/ace/Versioned_Namespace.h similarity index 100% rename from dep/include/ace/Versioned_Namespace.h rename to externals/ace/Versioned_Namespace.h index 8dc3f9ed3e1..542254876ff 100644 --- a/dep/include/ace/Versioned_Namespace.h +++ b/externals/ace/Versioned_Namespace.h @@ -21,6 +21,7 @@ # error This header is only meant to be included by or after "ace/config-lite.h". #endif /* !ACE_CONFIG_LITE_H */ + #if defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1 # ifndef ACE_VERSIONED_NAMESPACE_NAME @@ -48,4 +49,3 @@ #endif /* ACE_HAS_VERSIONED_NAMESPACE */ #endif /* !ACE_VERSIONED_NAMESPACE_H */ - diff --git a/dep/src/ace/WFMO_Reactor.cpp b/externals/ace/WFMO_Reactor.cpp similarity index 99% rename from dep/src/ace/WFMO_Reactor.cpp rename to externals/ace/WFMO_Reactor.cpp index b78d0a5111c..713b5689cdb 100644 --- a/dep/src/ace/WFMO_Reactor.cpp +++ b/externals/ace/WFMO_Reactor.cpp @@ -1,4 +1,4 @@ -// $Id: WFMO_Reactor.cpp 81138 2008-03-28 09:18:15Z johnnyw $ +// $Id: WFMO_Reactor.cpp 85125 2009-04-20 16:47:38Z johnnyw $ #include "ace/WFMO_Reactor.h" @@ -14,7 +14,7 @@ #include "ace/WFMO_Reactor.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(ace, WFMO_Reactor, "$Id: WFMO_Reactor.cpp 81138 2008-03-28 09:18:15Z johnnyw $") +ACE_RCSID(ace, WFMO_Reactor, "$Id: WFMO_Reactor.cpp 85125 2009-04-20 16:47:38Z johnnyw $") #include "ace/Auto_Ptr.h" @@ -1137,15 +1137,12 @@ ACE_WFMO_Reactor::current_info (ACE_HANDLE, size_t &) int ACE_WFMO_Reactor::open (size_t size, - int unused, + bool, ACE_Sig_Handler *sh, ACE_Timer_Queue *tq, - int disable_notify_pipe, + int, ACE_Reactor_Notify *notify) { - ACE_UNUSED_ARG (unused); - ACE_UNUSED_ARG (disable_notify_pipe); - // This GUARD is necessary since we are updating shared state. ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1); @@ -1478,6 +1475,8 @@ ACE_WFMO_Reactor::mask_ops_i (ACE_HANDLE io_handle, return -1; } + + int ACE_WFMO_Reactor_Handler_Repository::modify_network_events_i (ACE_HANDLE io_handle, ACE_Reactor_Mask new_masks, @@ -1757,9 +1756,13 @@ ACE_WFMO_Reactor::ok_to_wait (ACE_Time_Value *max_wait_time, // grab the lock and recheck the ok_to_wait_ event. When we can get them // both, or there's an error/timeout, return. #if defined (ACE_HAS_WINCE) - ACE_Time_Value timeout = ACE_OS::gettimeofday (); + ACE_UNUSED_ARG (alertable); + ACE_Time_Value timeout; if (max_wait_time != 0) - timeout += *max_wait_time; + { + timeout = ACE_OS::gettimeofday (); + timeout += *max_wait_time; + } while (1) { int status; @@ -1774,14 +1777,15 @@ ACE_WFMO_Reactor::ok_to_wait (ACE_Time_Value *max_wait_time, if (max_wait_time == 0) status = this->lock_.acquire (); else - status = this->lock_.acquire (timeout); + { + status = this->lock_.acquire (timeout); + } if (status == -1) return -1; // Have the lock_, now re-check the event. If it's not signaled, // another thread changed something so go back and wait again. - ACE_Time_Value poll_it = ACE_OS::gettimeofday (); - if (this->ok_to_wait_.wait (&poll_it) == 0) + if (this->ok_to_wait_.wait (&ACE_Time_Value::zero, 0) == 0) break; this->lock_.release (); } @@ -1883,6 +1887,7 @@ ACE_WFMO_Reactor::calculate_timeout (ACE_Time_Value *max_wait_time) return time->msec (); } + int ACE_WFMO_Reactor::expire_timers (void) { @@ -1899,10 +1904,8 @@ ACE_WFMO_Reactor::expire_timers (void) int ACE_WFMO_Reactor::dispatch (DWORD wait_status) { - int handlers_dispatched = 0; - // Expire timers - handlers_dispatched += this->expire_timers (); + int handlers_dispatched = this->expire_timers (); switch (wait_status) { @@ -1937,7 +1940,7 @@ ACE_WFMO_Reactor::dispatch_handles (DWORD wait_status) DWORD dispatch_slot = 0; // Cache this value, this is the absolute value. - DWORD max_handlep1 = this->handler_rep_.max_handlep1 (); + DWORD const max_handlep1 = this->handler_rep_.max_handlep1 (); // nCount starts off at , this is a transient count of // handles last waited on. @@ -1951,9 +1954,9 @@ ACE_WFMO_Reactor::dispatch_handles (DWORD wait_status) #if ! defined(__BORLANDC__) \ && !defined (ghs) \ && !defined (__MINGW32__) \ - && !(defined (_MSC_VER) && _MSC_VER >= 1300) + && !defined (_MSC_VER) // wait_status is unsigned in Borland, Green Hills, - // mingw32 and MSVC++ >= 7.1. + // mingw32 and MSVC++ // This >= is always true, with a warning. wait_status >= WAIT_OBJECT_0 && #endif @@ -2215,7 +2218,7 @@ ACE_WFMO_Reactor::upcall (ACE_Event_Handler *event_handler, } } - if (ACE_BIT_ENABLED (actual_events, FD_ACCEPT)) + if (ACE_BIT_ENABLED (actual_events, FD_ACCEPT)) { action = event_handler->handle_input (io_handle); if (action <= 0) @@ -2252,6 +2255,7 @@ ACE_WFMO_Reactor::upcall (ACE_Event_Handler *event_handler, return problems; } + int ACE_WFMO_Reactor::update_state (void) { @@ -2719,6 +2723,7 @@ ACE_WFMO_Reactor::resumable_handler (void) return 0; } + // No-op WinSOCK2 methods to help WFMO_Reactor compile #if !defined (ACE_HAS_WINSOCK2) || (ACE_HAS_WINSOCK2 == 0) int @@ -2741,4 +2746,3 @@ WSAEnumNetworkEvents (SOCKET /* s */, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 */ - diff --git a/dep/include/ace/WFMO_Reactor.h b/externals/ace/WFMO_Reactor.h similarity index 92% rename from dep/include/ace/WFMO_Reactor.h rename to externals/ace/WFMO_Reactor.h index 4bd5a514dd1..fb3a14d28cd 100644 --- a/dep/include/ace/WFMO_Reactor.h +++ b/externals/ace/WFMO_Reactor.h @@ -4,7 +4,7 @@ /** * @file WFMO_Reactor.h * - * $Id: WFMO_Reactor.h 81138 2008-03-28 09:18:15Z johnnyw $ + * $Id: WFMO_Reactor.h 84727 2009-03-05 19:22:29Z johnnyw $ * * @author Irfan Pyarali * @author Tim Harrison @@ -337,7 +337,7 @@ public: // = Sanity checking. - // Check the to make sure it's a valid ACE_HANDLE + // Check the @a handle to make sure it's a valid ACE_HANDLE int invalid_handle (ACE_HANDLE handle) const; // = Accessors. @@ -412,22 +412,22 @@ public: ACE_Reactor_Mask to_be_removed_masks); /** - * Return the Event_Handler associated with . Return 0 if - * is not registered. + * Return the Event_Handler associated with @a handle. Return 0 if + * @a handle is not registered. */ ACE_Event_Handler *find_handler (ACE_HANDLE handle); /** - * Check to see if is associated with a valid Event_Handler - * bound to @a mask. Return the associated with this - * @a handler if != 0. + * Check to see if @a handle is associated with a valid Event_Handler + * bound to @a mask. Return the @a event_handler associated with this + * @a handler if @a event_handler != 0. */ int handler (ACE_HANDLE handle, ACE_Reactor_Mask mask, ACE_Event_Handler **event_handler = 0); /** - * Check to see if is associated with a valid + * Check to see if @a handle is associated with a valid * Event_Handler. Return Event_Handler and associated masks. */ ACE_Event_Handler *handler (ACE_HANDLE handle, @@ -510,7 +510,7 @@ public: /** * Special trick to unblock when updates - * occur. All we do is enqueue and @a mask onto the + * occur. All we do is enqueue @a event_handler and @a mask onto the * ACE_Message_Queue and wakeup the by signaling * its handle. The ACE_Time_Value indicates how long * to blocking trying to notify the . If @a timeout == @@ -540,7 +540,7 @@ public: /// Verify whether the buffer has dispatchable info or not. virtual int is_dispatchable (ACE_Notification_Buffer &buffer); - /// Read one of the notify call on the into the + /// Read one of the notify call on the @a handle into the /// . This could be because of a thread trying to unblock /// the virtual int read_notify_pipe (ACE_HANDLE handle, @@ -549,7 +549,7 @@ public: /** * Set the maximum number of times that the * method will iterate and - * dispatch the that are passed in via the + * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its * loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this @@ -562,7 +562,7 @@ public: /** * Get the maximum number of times that the * method will iterate and - * dispatch the that are passed in via the + * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its * loop. */ @@ -570,7 +570,7 @@ public: /** * Purge any notifications pending in this reactor for the specified - * ACE_Event_Handler object. If == 0, all notifications for all + * ACE_Event_Handler object. If @a eh == 0, all notifications for all * handlers are removed (but not any notifications posted just to wake up * the reactor itself). Returns the number of notifications purged. * Returns -1 on error. @@ -588,7 +588,7 @@ private: /** * Called when the notification event waited on by * is signaled. This dequeues all pending - * and dispatches them. + * ACE_Event_Handlers and dispatches them. */ virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); @@ -596,7 +596,7 @@ private: /// thread up (e.g., when the method is called). ACE_Auto_Event wakeup_one_thread_; - /// Message queue that keeps track of pending . + /// Message queue that keeps track of pending ACE_Event_Handlers. /// This queue must be thread-safe because it can be called by /// multiple threads of control. ACE_Message_Queue message_queue_; @@ -604,7 +604,7 @@ private: /** * Keeps track of the maximum number of times that the * method will iterate and - * dispatch the that are passed in via the + * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its * loop. By default, this is set to * -1, which means "iterate until the queue is empty." @@ -697,7 +697,7 @@ public: * used for internal management purposes. */ virtual int open (size_t size = ACE_WFMO_Reactor::DEFAULT_SIZE, - int restart = 0, + bool restart = false, ACE_Sig_Handler * = 0, ACE_Timer_Queue * = 0, int disable_notify_pipe = 0, @@ -768,6 +768,7 @@ public: virtual int handle_events (ACE_Time_Value &max_wait_time); virtual int alertable_handle_events (ACE_Time_Value &max_wait_time); + // = Event handling control. /** @@ -787,13 +788,13 @@ public: // = Register and remove Handlers. /** - * Register an ACE_Event_Handler . Since no Event + * Register an ACE_Event_Handler @a event_handler. Since no Event * Mask is passed through this interface, it is assumed that the - * being passed in is an event handle and when the event + * @a handle being passed in is an event handle and when the event * becomes signaled, will call handle_signal on - * . If == the + * @a event_handler. If @a handle == the * will call the method of - * to extract the underlying event handle. + * @a event_handler to extract the underlying event handle. */ virtual int register_handler (ACE_Event_Handler *event_handler, ACE_HANDLE event_handle = ACE_INVALID_HANDLE); @@ -832,16 +833,16 @@ public: virtual int register_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask); - /// Register with all the in the + /// Register @a event_handler with all the @a handles in the /// . virtual int register_handler (const ACE_Handle_Set &handles, ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask); /** - * Register to handle the signal @a signum using the - * . Returns the that was previously registered - * (if any), along with the of the signal handler. + * Register @a new_sh to handle the signal @a signum using the + * @a new_disp. Returns the @a old_sh that was previously registered + * (if any), along with the @a old_disp of the signal handler. */ virtual int register_handler (int signum, ACE_Event_Handler *new_sh, @@ -849,31 +850,31 @@ public: ACE_Event_Handler **old_sh = 0, ACE_Sig_Action *old_disp = 0); - /// Registers to handle a set of signals using the - /// . + /// Registers @a new_sh to handle a set of signals @a sigset using the + /// @a new_disp. virtual int register_handler (const ACE_Sig_Set &sigset, ACE_Event_Handler *new_sh, ACE_Sig_Action *new_disp = 0); /** - * Removes from the . Note that + * Removes @a event_handler from the . Note that * the will call the method of - * to extract the underlying handle. If @a mask == + * @a event_handler to extract the underlying handle. If @a mask == * ACE_Event_Handler::DONT_CALL then the method of - * the is not invoked. Note that the can + * the @a event_handler is not invoked. Note that the @a handle can * either be the or the */ virtual int remove_handler (ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask); /** - * Removes from the . If @a mask == + * Removes @a handle from the . If @a mask == * ACE_Event_Handler::DONT_CALL then the method of - * the is not invoked. Note that the can + * the is not invoked. Note that the @a handle can * either be the or the * * For the case of I/O entries, this removes the @a mask binding of - * whose handle is from . If + * whose handle is @a handle from . If * there are no more bindings for this then it is * removed from the WFMO_Reactor. For simple event entries, mask is * mostly ignored and the is always removed from @@ -883,7 +884,7 @@ public: ACE_Reactor_Mask mask); /** - * Removes all the @a mask bindings for handles in the + * Removes all the @a mask bindings for handles in the @a handle_set * bind of . If there are no more bindings for any * of these handles then they are removed from WFMO_Reactor. */ @@ -892,7 +893,7 @@ public: /** * Remove the ACE_Event_Handler currently associated with @a signum. - * is ignored in this implementation since there is only + * @a sigkey is ignored in this implementation since there is only * one instance of a signal handler. Install the new disposition * (if given) and return the previous disposition (if desired by the * caller). Returns 0 on success and -1 if @a signum is invalid. @@ -902,32 +903,32 @@ public: ACE_Sig_Action *old_disp = 0, int sigkey = -1); - /// Calls for every signal in . + /// Calls for every signal in @a sigset. virtual int remove_handler (const ACE_Sig_Set &sigset); // = Suspend and resume Handlers. - /// Suspend temporarily. Use + /// Suspend @a event_handler temporarily. Use /// to get the handle. virtual int suspend_handler (ACE_Event_Handler *event_handler); - /// Suspend temporarily. + /// Suspend @a handle temporarily. virtual int suspend_handler (ACE_HANDLE handle); - /// Suspend all in handle set temporarily. + /// Suspend all @a handles in handle set temporarily. virtual int suspend_handler (const ACE_Handle_Set &handles); /// Suspend all temporarily. virtual int suspend_handlers (void); - /// Resume . Use to + /// Resume @a event_handler. Use to /// get the handle. virtual int resume_handler (ACE_Event_Handler *event_handler); - /// Resume . + /// Resume @a handle. virtual int resume_handler (ACE_HANDLE handle); - /// Resume all in handle set. + /// Resume all @a handles in handle set. virtual int resume_handler (const ACE_Handle_Set &handles); /// Resume all . @@ -940,12 +941,12 @@ public: virtual int resumable_handler (void); /** - * Return 1 if we any event associations were made by the reactor - * for the handles that it waits on, 0 otherwise. Since the + * Return true if we any event associations were made by the reactor + * for the handles that it waits on, false otherwise. Since the * WFMO_Reactor does use event associations, this function always - * return 1. + * return true. */ - virtual int uses_event_associations (void); + virtual bool uses_event_associations (void); // Timer management. @@ -982,7 +983,7 @@ public: const ACE_Time_Value &interval); /// Cancel all Event_Handlers that match the address of - /// . Returns number of handler's cancelled. + /// @a event_handler. Returns number of handler's cancelled. virtual int cancel_timer (ACE_Event_Handler *event_handler, int dont_call_handle_close = 1); @@ -1002,8 +1003,8 @@ public: // = High-level Event_Handler scheduling operations /** - * Add @a masks_to_be_added to the 's entry in - * WFMO_Reactor. must already have been registered + * Add @a masks_to_be_added to the @a event_handler's entry in + * WFMO_Reactor. @a event_handler must already have been registered * with WFMO_Reactor. */ virtual int schedule_wakeup (ACE_Event_Handler *event_handler, @@ -1011,7 +1012,7 @@ public: /** * Add @a masks_to_be_added to the @a handle's entry in WFMO_Reactor. - * The Event_Handler associated with must already have been + * The Event_Handler associated with @a handle must already have been * registered with WFMO_Reactor. */ virtual int schedule_wakeup (ACE_HANDLE handle, @@ -1050,7 +1051,7 @@ public: /** * Set the maximum number of times that the * method will iterate and - * dispatch the that are passed in via the + * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its * loop. By default, this is set to * -1, which means "iterate until the queue is empty." Setting this @@ -1063,7 +1064,7 @@ public: /** * Get the maximum number of times that the * method will iterate and - * dispatch the that are passed in via the + * dispatch the ACE_Event_Handlers that are passed in via the * notify queue before breaking out of its * loop. */ @@ -1087,8 +1088,8 @@ public: /** * Check to see if is associated with a valid Event_Handler - * bound to @a mask. Return the associated with this - * @a handler if != 0. + * bound to @a mask. Return the @a event_handler associated with this + * @a handler if @a event_handler != 0. */ virtual int handler (ACE_HANDLE handle, ACE_Reactor_Mask mask, @@ -1118,7 +1119,7 @@ public: virtual void wakeup_all_threads (void); /** - * Transfers ownership of the WFMO_Reactor to the . The + * Transfers ownership of the WFMO_Reactor to the @a new_owner. The * transfer will not complete until all threads are ready (just like * the handle set). */ @@ -1128,10 +1129,10 @@ public: virtual int owner (ACE_thread_t *owner); /// Get the existing restart value. - virtual int restart (void); + virtual bool restart (void); /// Set a new value for restart and return the original value. - virtual int restart (int r); + virtual bool restart (bool r); /// Not implemented virtual void requeue_position (int); @@ -1142,8 +1143,8 @@ public: // = Low-level wait_set mask manipulation methods. /** - * Modify @a masks of the 's entry in WFMO_Reactor - * depending upon . must already have + * Modify @a masks of the @a event_handler's entry in WFMO_Reactor + * depending upon . @a event_handler must already have * been registered with WFMO_Reactor. */ virtual int mask_ops (ACE_Event_Handler *event_handler, @@ -1307,7 +1308,7 @@ protected: /** * A manual event is used so that we can wake everyone up (e.g., - * when are bounded and unbound from the + * when ACE_Event_Handlers are bounded and unbound from the * handler repository). */ ACE_Manual_Event wakeup_all_threads_; @@ -1365,4 +1366,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 */ #include /**/ "ace/post.h" #endif /* ACE_WFMO_REACTOR_H */ - diff --git a/dep/include/ace/WFMO_Reactor.inl b/externals/ace/WFMO_Reactor.inl similarity index 98% rename from dep/include/ace/WFMO_Reactor.inl rename to externals/ace/WFMO_Reactor.inl index a155019d841..6d3e43db67e 100644 --- a/dep/include/ace/WFMO_Reactor.inl +++ b/externals/ace/WFMO_Reactor.inl @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: WFMO_Reactor.inl 81138 2008-03-28 09:18:15Z johnnyw $ +// $Id: WFMO_Reactor.inl 82949 2008-10-06 22:32:10Z shuston $ #include "ace/Handle_Set.h" #include "ace/Reactor.h" @@ -735,7 +735,9 @@ ACE_WFMO_Reactor::suspend_handlers (void) // First suspend all current handles bool changes_required = false; - for (size_t i = 0; + // Skip over the notify and wakeup_all_threads handles. These are registered + // by ACE_WFMO_Reactor::open(), not by users, and should not be suspended. + for (size_t i = 2; i < this->handler_rep_.max_handlep1_ && !error; i++) { @@ -865,12 +867,12 @@ ACE_WFMO_Reactor::resume_handlers (void) return error ? -1 : 0; } -ACE_INLINE int +ACE_INLINE bool ACE_WFMO_Reactor::uses_event_associations (void) { // Since the WFMO_Reactor does use event associations, this function // always return 1. - return 1; + return true; } ACE_INLINE int @@ -1104,16 +1106,16 @@ ACE_WFMO_Reactor::requeue_position (void) ACE_NOTSUP_RETURN (-1); } -ACE_INLINE int +ACE_INLINE bool ACE_WFMO_Reactor::restart (void) { - return 0; + return false; } -ACE_INLINE int -ACE_WFMO_Reactor::restart (int) +ACE_INLINE bool +ACE_WFMO_Reactor::restart (bool) { - return 0; + return false; } ACE_INLINE int diff --git a/dep/src/ace/WIN32_Asynch_IO.cpp b/externals/ace/WIN32_Asynch_IO.cpp similarity index 99% rename from dep/src/ace/WIN32_Asynch_IO.cpp rename to externals/ace/WIN32_Asynch_IO.cpp index f6d26b466d2..3dd6efcd1c5 100644 --- a/dep/src/ace/WIN32_Asynch_IO.cpp +++ b/externals/ace/WIN32_Asynch_IO.cpp @@ -1,10 +1,10 @@ -// $Id: WIN32_Asynch_IO.cpp 82444 2008-07-28 13:33:07Z johnnyw $ +// $Id: WIN32_Asynch_IO.cpp 89454 2010-03-11 09:35:25Z johnnyw $ #include "ace/WIN32_Asynch_IO.h" ACE_RCSID (ace, Win32_Asynch_IO, - "$Id: WIN32_Asynch_IO.cpp 82444 2008-07-28 13:33:07Z johnnyw $") + "$Id: WIN32_Asynch_IO.cpp 89454 2010-03-11 09:35:25Z johnnyw $") #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) && \ (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 == 1)) @@ -847,11 +847,13 @@ ACE_WIN32_Asynch_Write_Stream::write (ACE_Message_Block &message_block, -1); // Shared write - int return_val = this->shared_write (result); + int const return_val = this->shared_write (result); // Upon errors if (return_val == -1) - delete result; + { + delete result; + } return return_val; } @@ -914,7 +916,7 @@ ACE_WIN32_Asynch_Write_Stream::writev (ACE_Message_Block &message_block, // Re-calculate number bytes to write bytes_to_write = 0; - for (int i=0; i < iovcnt ; ++i ) + for ( int i=0; i < iovcnt ; ++i ) bytes_to_write += iov[i].iov_len; if ( bytes_to_write == 0 ) @@ -923,6 +925,7 @@ ACE_WIN32_Asynch_Write_Stream::writev (ACE_Message_Block &message_block, ACE_TEXT ("Attempt to write 0 bytes\n")), -1); + ACE_WIN32_Asynch_Write_Stream_Result *result = 0; ACE_NEW_RETURN (result, ACE_WIN32_Asynch_Write_Stream_Result (this->handler_proxy_, @@ -1023,8 +1026,10 @@ ACE_WIN32_Asynch_Write_Stream::shared_write (ACE_WIN32_Asynch_Write_Stream_Resul result, 0); if (initiate_result == 0) - // Immediate success: the OVERLAPPED will still get queued. - return 0; + { + // Immediate success: the OVERLAPPED will still get queued. + return 0; + } #else initiate_result = ::WriteFile (result->handle (), result->message_block ().rd_ptr (), @@ -1287,6 +1292,7 @@ ACE_WIN32_Asynch_Read_File::read (ACE_Message_Block &message_block, ACE_TEXT ("Attempt to read 0 bytes or no space in the message block\n")), -1); + ACE_WIN32_Asynch_Read_File_Result *result = 0; ACE_NEW_RETURN (result, ACE_WIN32_Asynch_Read_File_Result (this->handler_proxy_, @@ -1425,6 +1431,7 @@ ACE_WIN32_Asynch_Read_File::readv (ACE_Message_Block &message_block, #endif /* ACE_WIN32_OVERLAPPED_IO */ } + ACE_WIN32_Asynch_Read_File::~ACE_WIN32_Asynch_Read_File (void) { } @@ -1831,6 +1838,7 @@ ACE_WIN32_Asynch_Write_File::writev (ACE_Message_Block &message_block, #endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ } + ACE_WIN32_Asynch_Write_File::~ACE_WIN32_Asynch_Write_File (void) { } @@ -2221,6 +2229,7 @@ void ACE_WIN32_Asynch_Connect_Result::connect_handle ( ACE_HANDLE handle ) this->connect_handle_ = handle; } + ACE_WIN32_Asynch_Connect_Result::ACE_WIN32_Asynch_Connect_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE connect_handle, @@ -2380,7 +2389,7 @@ ACE_WIN32_Asynch_Connect::open (const ACE_Handler::Proxy_Ptr &handler_proxy, if (this->flg_open_) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%N:%l:ACE_WIN32_Asynch_Connect::open:") - ACE_TEXT ("connector already open \n")), + ACE_TEXT ("connector already open\n")), -1); //int result = @@ -2604,6 +2613,7 @@ ACE_WIN32_Asynch_Connect::connect_i (ACE_WIN32_Asynch_Connect_Result *result, } } + // cancel_uncompleted // It performs cancellation of all pending requests // @@ -2749,6 +2759,7 @@ ACE_WIN32_Asynch_Connect::handle_output (ACE_HANDLE fd) return 0; } + int ACE_WIN32_Asynch_Connect::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask) { @@ -3099,6 +3110,7 @@ ACE_WIN32_Asynch_Read_Dgram_Result::message_block (void) const return this->message_block_; } + int ACE_WIN32_Asynch_Read_Dgram_Result::remote_address (ACE_Addr& addr) const { @@ -3121,6 +3133,7 @@ ACE_WIN32_Asynch_Read_Dgram_Result::saddr () const return (sockaddr *) this->remote_address_->get_addr (); } + int ACE_WIN32_Asynch_Read_Dgram_Result::flags (void) const { @@ -3599,6 +3612,7 @@ ACE_WIN32_Asynch_Write_Dgram_Result::~ACE_WIN32_Asynch_Write_Dgram_Result (void) { } + //*********************************************** ACE_WIN32_Asynch_Write_Dgram::~ACE_WIN32_Asynch_Write_Dgram (void) @@ -3688,6 +3702,7 @@ ACE_WIN32_Asynch_Write_Dgram::send (ACE_Message_Block *message_block, result, 0); + if (initiate_result == SOCKET_ERROR) { // If initiate failed, check for a bad error. @@ -3765,4 +3780,3 @@ ACE_WIN32_Asynch_Write_Dgram::ACE_WIN32_Asynch_Write_Dgram (ACE_WIN32_Proactor * ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO && ACE_HAS_WINSOCK2 */ - diff --git a/dep/include/ace/WIN32_Asynch_IO.h b/externals/ace/WIN32_Asynch_IO.h similarity index 99% rename from dep/include/ace/WIN32_Asynch_IO.h rename to externals/ace/WIN32_Asynch_IO.h index f88ff3d45e6..34af77dabb2 100644 --- a/dep/include/ace/WIN32_Asynch_IO.h +++ b/externals/ace/WIN32_Asynch_IO.h @@ -704,6 +704,7 @@ public: int priority, int signal_number = 0); + /// Destructor. virtual ~ACE_WIN32_Asynch_Read_File (void); @@ -1227,6 +1228,7 @@ protected: ACE_HANDLE connect_handle_; }; + /** * @class ACE_WIN32_Asynch_Connect */ @@ -1933,4 +1935,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_WIN32_OVERLAPPED_IO && ACE_HAS_WINSOCK2 */ #include /**/ "ace/post.h" #endif /* ACE_WIN32_ASYNCH_IO_H */ - diff --git a/dep/src/ace/WIN32_Proactor.cpp b/externals/ace/WIN32_Proactor.cpp similarity index 99% rename from dep/src/ace/WIN32_Proactor.cpp rename to externals/ace/WIN32_Proactor.cpp index dceb8336277..a559838976f 100644 --- a/dep/src/ace/WIN32_Proactor.cpp +++ b/externals/ace/WIN32_Proactor.cpp @@ -802,4 +802,3 @@ ACE_WIN32_Wakeup_Completion::complete (size_t /* bytes_transferred */, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 */ - diff --git a/dep/include/ace/WIN32_Proactor.h b/externals/ace/WIN32_Proactor.h similarity index 100% rename from dep/include/ace/WIN32_Proactor.h rename to externals/ace/WIN32_Proactor.h index 49cec039b38..4fb686d7a7e 100644 --- a/dep/include/ace/WIN32_Proactor.h +++ b/externals/ace/WIN32_Proactor.h @@ -203,6 +203,7 @@ public: int priority, int signal_number = 0); + virtual ACE_Asynch_Transmit_File_Result_Impl *create_asynch_transmit_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE socket, ACE_HANDLE file, @@ -322,4 +323,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_WIN32 */ #include /**/ "ace/post.h" #endif /* ACE_PROACTOR_H */ - diff --git a/dep/src/ace/XML_Svc_Conf.cpp b/externals/ace/XML_Svc_Conf.cpp similarity index 99% rename from dep/src/ace/XML_Svc_Conf.cpp rename to externals/ace/XML_Svc_Conf.cpp index 59d5649e508..23dddad8469 100644 --- a/dep/src/ace/XML_Svc_Conf.cpp +++ b/externals/ace/XML_Svc_Conf.cpp @@ -13,4 +13,3 @@ ACE_XML_Svc_Conf::~ACE_XML_Svc_Conf (void) ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */ - diff --git a/dep/include/ace/XML_Svc_Conf.h b/externals/ace/XML_Svc_Conf.h similarity index 100% rename from dep/include/ace/XML_Svc_Conf.h rename to externals/ace/XML_Svc_Conf.h index c14e30035bc..883151e05d2 100644 --- a/dep/include/ace/XML_Svc_Conf.h +++ b/externals/ace/XML_Svc_Conf.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_XML_SVC_CONF_H #define ACE_XML_SVC_CONF_H @@ -62,4 +63,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_XML_SVC_CONF_H */ - diff --git a/dep/src/ace/XTI_ATM_Mcast.cpp b/externals/ace/XTI_ATM_Mcast.cpp similarity index 99% rename from dep/src/ace/XTI_ATM_Mcast.cpp rename to externals/ace/XTI_ATM_Mcast.cpp index ac3443ee8b5..503e3fea0e2 100644 --- a/dep/src/ace/XTI_ATM_Mcast.cpp +++ b/externals/ace/XTI_ATM_Mcast.cpp @@ -68,4 +68,3 @@ ACE_XTI_ATM_Mcast::add_leaf (ACE_TLI_Stream ¤t_stream, ACE_END_VERSIONED_NAMESPACE_DECL #endif /* ACE_HAS_XTI_ATM */ - diff --git a/dep/include/ace/XTI_ATM_Mcast.h b/externals/ace/XTI_ATM_Mcast.h similarity index 100% rename from dep/include/ace/XTI_ATM_Mcast.h rename to externals/ace/XTI_ATM_Mcast.h index b701d842b67..bfdfa92c957 100644 --- a/dep/include/ace/XTI_ATM_Mcast.h +++ b/externals/ace/XTI_ATM_Mcast.h @@ -10,6 +10,7 @@ */ //============================================================================= + #ifndef ACE_XTI_ATM_MCAST_H #define ACE_XTI_ATM_MCAST_H #include /**/ "ace/pre.h" @@ -134,4 +135,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_XTI_ATM_MCAST_H */ - diff --git a/dep/include/ace/XTI_ATM_Mcast.inl b/externals/ace/XTI_ATM_Mcast.inl similarity index 100% rename from dep/include/ace/XTI_ATM_Mcast.inl rename to externals/ace/XTI_ATM_Mcast.inl diff --git a/externals/ace/ace.rc b/externals/ace/ace.rc new file mode 100644 index 00000000000..54792491900 --- /dev/null +++ b/externals/ace/ace.rc @@ -0,0 +1,38 @@ +#include "Version.h" + +1 VERSIONINFO + FILEVERSION ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION,0 + PRODUCTVERSION ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION,0 + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "FileDescription", "ACE\0" + VALUE "FileVersion", ACE_VERSION "\0" + VALUE "InternalName", "ACEDLL\0" + VALUE "LegalCopyright", "\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "ACE.DLL\0" + VALUE "ProductName", "ACE\0" + VALUE "ProductVersion", ACE_VERSION "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +/* + * The following resource is used by the ACE logger to write messages + * to the NT event log. If you are statically linking to the ACE + * library, and you wish to use the NT event log, you should copy this + * message table to your application's resource script. + */ +1 MESSAGETABLE ace_message_table.bin diff --git a/externals/ace/ace_message_table.bin b/externals/ace/ace_message_table.bin new file mode 100644 index 00000000000..b46b32a0ba6 Binary files /dev/null and b/externals/ace/ace_message_table.bin differ diff --git a/dep/src/ace/ace_wchar.cpp b/externals/ace/ace_wchar.cpp similarity index 99% rename from dep/src/ace/ace_wchar.cpp rename to externals/ace/ace_wchar.cpp index 4f7ca485585..bec8255447d 100644 --- a/dep/src/ace/ace_wchar.cpp +++ b/externals/ace/ace_wchar.cpp @@ -15,4 +15,3 @@ iconv_t ACE_Ascii_To_Wide::ACE_Ascii_To_Wide_iconv_env = 0; #endif ACE_END_VERSIONED_NAMESPACE_DECL - diff --git a/dep/include/ace/ace_wchar.h b/externals/ace/ace_wchar.h similarity index 99% rename from dep/include/ace/ace_wchar.h rename to externals/ace/ace_wchar.h index 75afa83968b..f556e0f9cf8 100644 --- a/dep/include/ace/ace_wchar.h +++ b/externals/ace/ace_wchar.h @@ -383,4 +383,3 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include "ace/ace_wchar.inl" #endif /* ACE_WCHAR_H */ - diff --git a/dep/include/ace/ace_wchar.inl b/externals/ace/ace_wchar.inl similarity index 100% rename from dep/include/ace/ace_wchar.inl rename to externals/ace/ace_wchar.inl diff --git a/dep/include/ace/checked_iterator.h b/externals/ace/checked_iterator.h similarity index 82% rename from dep/include/ace/checked_iterator.h rename to externals/ace/checked_iterator.h index 3f4c6c14a08..08940e62bbb 100644 --- a/dep/include/ace/checked_iterator.h +++ b/externals/ace/checked_iterator.h @@ -23,7 +23,7 @@ * not supported, the pointer passed to the function is returned * instead. * - * $Id: checked_iterator.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: checked_iterator.h 88263 2009-12-20 07:58:09Z johnnyw $ * * @internal The functions and types in this header are meant for * internal use. They may change at any point between @@ -32,12 +32,12 @@ * @author Ossama Othman */ -# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000) +# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000) && (!defined (_STLPORT_VERSION)) // Checked iterators are currently only supported in MSVC++ 8 or better. # include -# endif /* _MSC_VER >= 1400 */ +# endif /* _MSC_VER >= 1400 && !_STLPORT_VERSION */ -# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000 && _MSC_FULL_VER < 160020506) +# if defined (_MSC_VER) && (_MSC_FULL_VER >= 140050000) && (!defined (_STLPORT_VERSION)) template stdext::checked_array_iterator ACE_make_checked_array_iterator (PTR buf, size_t len) @@ -53,7 +53,6 @@ ACE_make_checked_array_iterator (PTR buf, size_t /* len */) // the buffer itself. return buf; } -# endif /* _MSC_VER >= 1400 */ +# endif /* _MSC_VER >= 1400 && !_STLPORT_VERSION */ #endif /* ACE_CHECKED_ITERATOR_H */ - diff --git a/dep/include/ace/config-WinCE.h b/externals/ace/config-WinCE.h similarity index 70% rename from dep/include/ace/config-WinCE.h rename to externals/ace/config-WinCE.h index a7ba1a72a8a..93040583980 100644 --- a/dep/include/ace/config-WinCE.h +++ b/externals/ace/config-WinCE.h @@ -1,4 +1,4 @@ -// $Id: config-WinCE.h 81693 2008-05-14 12:35:01Z johnnyw $ +// $Id: config-WinCE.h 89494 2010-03-15 20:11:18Z olli $ // Note: For WinCE build, simply use: #include "ace/config-win32.h" // It is same as config.h for Windows NT/2k so that you can @@ -15,26 +15,13 @@ # error Use config-win32.h in config.h instead of this header #endif // ACE_CONFIG_WIN32_H -#if !defined (UNDER_CE) -# error Define UNDER_CE to version (i.e. 300 = 3.0) -#endif // UNDER_CE +#if !defined (_WIN32_WCE) +# error Define _WIN32_WCE to version (i.e. 500 = 5.0) +#endif // _WIN32_WCE -#if (UNDER_CE < 300) -# error ACE requires Windows CE 3.0 and later. -#endif // UNDER_CE - -#if (UNDER_CE < 400) -// CE 3 doesn't have Winsock 2, but CE 4 does. -# if !defined (ACE_HAS_WINSOCK2) -# define ACE_HAS_WINSOCK2 0 -# endif -# define ACE_LACKS_ASSERT_H -# define ACE_LACKS_SEARCH_H -# define ACE_LACKS_WCHAR_H -# define ACE_LACKS_WCTYPE_H -# define ACE_LACKS_STDDEF_H -# define ACE_LACKS_PTRDIFF_T -#endif /* UNDER_CE < 400 */ +#if (_WIN32_WCE < 500) +# error ACE requires Windows CE 5.0 and later. +#endif // _WIN32_WCE #if !defined (ACE_HAS_WINCE) # define ACE_HAS_WINCE 1 @@ -50,8 +37,10 @@ #endif // We need these libraries to build: -#pragma comment(lib,"corelibc.lib") -#pragma comment(linker, "/nodefaultlib:oldnames.lib") +#if defined (_MSC_VER) +# pragma comment(lib,"corelibc.lib") +# pragma comment(linker, "/nodefaultlib:oldnames.lib") +#endif // Only DLL version is supported on CE. //#if defined (ACE_HAS_DLL) @@ -80,21 +69,40 @@ #define ACE_LACKS_GETPROCESSTIMES #define ACE_LACKS_PDH_H #define ACE_LACKS_PDHMSG_H +#define ACE_LACKS_TIME +#define ACE_LACKS_TZSET +#define ACE_LACKS_RAISE +#define ACE_LACKS_BSEARCH #define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 #define ACE_LACKS_MSG_WFMO #define ACE_LACKS_UMASK +#define ACE_HAS_TYPES_H +#define ACE_LACKS_DEV_T + +#define ACE_ISCTYPE_EQUIVALENT ::_isctype // WinCE only supports the UNICODE API #if !defined (ACE_USES_WCHAR) # define ACE_USES_WCHAR #endif /* ACE_USES_WCHAR */ -#define ACE_USES_WINCE_SEMA_SIMULATION +#if (_WIN32_WCE < 0x600) +# define ACE_USES_WINCE_SEMA_SIMULATION +# define ACE_LACKS_ERRNO_H +# define ACE_LACKS_DUP +# define ACE_LACKS_GETSYSTEMTIMEASFILETIME +#endif /* (_WIN32_WCE < 0x600) */ + +#define ACE_LACKS_REGNOTIFYCHANGEKEYVALUE #define ACE_HAS_NONSTATIC_OBJECT_MANAGER 1 +#if ! defined(ACE_DEFAULT_THREAD_KEYS) +# define ACE_DEFAULT_THREAD_KEYS TLS_MINIMUM_AVAILABLE +#endif // ! defined(ACE_DEFAULT_THREAD_KEYS) + // FILE stuff isn't always defined in CE #if (_MSC_VER < 1400) && !defined (_FILE_DEFINED) typedef void FILE; @@ -134,22 +142,9 @@ #define _O_TEXT 0x4000 // file mode is text (translated) #define _O_BINARY 0x8000 // file mode is binary (untranslated) -// macro to translate the C 2.0 name used to force binary mode for files -//#define _O_RAW _O_BINARY - -// Open handle inherit bit -//#define _O_NOINHERIT 0x0080 // child process doesn't inherit file - // Temporary file bit - file is deleted when last handle is closed #define _O_TEMPORARY 0x0040 // temporary file bit -// temporary access hint -//#define _O_SHORT_LIVED 0x1000 // temporary storage file, try not to flush - -// sequential/random access hints -//#define _O_SEQUENTIAL 0x0020 // file access is primarily sequential -//#define _O_RANDOM 0x0010 // file access is primarily random - // Non-ANSI names #define O_RDONLY _O_RDONLY #define O_WRONLY _O_WRONLY @@ -161,43 +156,35 @@ #define O_TEXT _O_TEXT #define O_BINARY _O_BINARY #define O_TEMPORARY _O_TEMPORARY -//#define O_RAW _O_BINARY -//#define O_NOINHERIT _O_NOINHERIT -//#define O_SEQUENTIAL _O_SEQUENTIAL -//#define O_RANDOM _O_RANDOM // @@ NSIG value. This is definitely not correct. #define NSIG 23 -// @@ For some reason, WinCE forgot to define this. -// Need to find out what it is. (Used in MapViewOfFile ().) +#if !defined (FILE_MAP_COPY) #define FILE_MAP_COPY 0 +#endif -#define ACE_LACKS_STRCASECMP // WinCE doesn't support _stricmp -#define ACE_LACKS_GETSERVBYNAME +#define ACE_HAS_INTERLOCKED_EXCHANGEADD #define ACE_LACKS_ACCESS -#define ACE_LACKS_FILELOCKS +#define ACE_LACKS__WACCESS +#define ACE_HAS_ACCESS_EMULATION #define ACE_LACKS_EXEC #define ACE_LACKS_MKTEMP -#define ACE_LACKS_STRRCHR -#define ACE_LACKS_BSEARCH -#define ACE_LACKS_SOCKET_BUFSIZ #define ACE_LACKS_ISATTY #define ACE_LACKS_STRERROR #define ACE_LACKS_SYSTEM -#define ACE_LACKS_SIGACTION #define ACE_LACKS_PIPE -//#define ACE_LACKS_CUSERID -//#define ACE_LACKS_CHDIR -#define ACE_LACKS_ENV -#define ACE_LACKS_HOSTNAME +#define ACE_LACKS_CHDIR +#define ACE_LACKS_GETENV +#define ACE_LACKS_SETENV +#define ACE_LACKS_UNSETENV +#define ACE_LACKS_PUTENV +#define ACE_LACKS_GETENVSTRINGS +#define ACE_LACKS_STRENVDUP #define ACE_LACKS_REALPATH -#define ACE_LACKS_READLINK #define ACE_LACKS_SWAB #define ACE_LACKS_TEMPNAM -#define ACE_LACKS_GETPROTOBYNUMBER -#define ACE_LACKS_GETPROTOBYNAME #if defined (_WIN32_WCE_EMULATION) // @@ For some reason, qsort isn't defined correctly (_stdcall vs _cdecl) @@ -206,32 +193,37 @@ #endif // _WIN32_WCE_EMULATION #if !defined (BUFSIZ) -# define BUFSIZ 1024 +# define BUFSIZ 1024 #endif -typedef void (__cdecl * __sighandler_t)(int); // keep Signal compilation happy -typedef long off_t; - #define ACE_LACKS_MALLOC_H // We do have malloc.h, but don't use it. #define ACE_HAS_WINCE_BROKEN_ERRNO #define ACE_HAS_STRDUP_EMULATION +#if !defined (MAXSYMLINKS) +# define MAXSYMLINKS 0 +#endif + // WinCE can't do fixed addresses for memory-mapped files. #if defined (ACE_DEFAULT_BASE_ADDR) -# undef ACE_DEFAULT_BASE_ADDR +# undef ACE_DEFAULT_BASE_ADDR #endif #define ACE_DEFAULT_BASE_ADDR 0 -#define ACE_HAS_TSS_EMULATION +#if (_WIN32_WCE < 0x600) +# define ACE_HAS_TSS_EMULATION +#endif // WinCE version < 6.0 + +// CE doesn't support FILE_SHARE_DELETE like regular windows +#if !defined (ACE_DEFAULT_FILE_PERMS) +# define ACE_DEFAULT_FILE_PERMS (FILE_SHARE_READ | FILE_SHARE_WRITE) +#endif -// This is still true up thru VC8... -#define ACE_LACKS_ERRNO_H #define ACE_LACKS_SIGNAL_H #define ACE_LACKS_SYS_STAT_H #include /**/ "ace/post.h" #endif // ACE_CONFIG_WINCE_H - diff --git a/dep/include/ace/config-aix-5.x.h b/externals/ace/config-aix-5.x.h similarity index 79% rename from dep/include/ace/config-aix-5.x.h rename to externals/ace/config-aix-5.x.h index 5c1972b5675..d524e9530fc 100644 --- a/dep/include/ace/config-aix-5.x.h +++ b/externals/ace/config-aix-5.x.h @@ -1,4 +1,4 @@ -// $Id: config-aix-5.x.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-aix-5.x.h 87268 2009-10-29 21:06:06Z olli $ // // Config file for AIX 5.1 and higher. @@ -40,61 +40,52 @@ # endif /* _THREAD_SAFE */ #endif /* !ACE_MT_SAFE || (ACE_MT_SAFE != 0) */ -#if defined (__xlC__) || defined (__IBMCPP__) - // AIX xlC, IBM C/C++, and Visual Age C++ compilers +#if defined (__IBMCPP__) + // AIX xlC, IBM C/C++ compiler //******************************************************************** // -// Compiler does this with a builtin - it's not in libc. -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//# define ACE_HAS_ALLOCA + // Compiler does this with a builtin - it's not in libc. + // Although ACE does have alloca() on this compiler/platform combination, + // it is disabled by default since it can be dangerous. Uncomment the + // following line if you ACE to use it. + //# define ACE_HAS_ALLOCA -// Compiler supports the ssize_t typedef. + // Compiler supports the ssize_t typedef. # define ACE_HAS_SSIZE_T // Keep an eye on this as the compiler and standards converge... # define ACE_LACKS_LINEBUFFERED_STREAMBUF # define ACE_LACKS_PRAGMA_ONCE - // C Set++ 3.1, IBM C/C++ 3.6, and Visual Age C++ 5 batch (__xlC__) -# if defined (__xlC__) -# if (__xlC__ < 0x0500) -# define ACE_LACKS_PLACEMENT_OPERATOR_DELETE -# endif /* __xlC__ < 0x0500 */ -# endif +# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS + // When using -qtempinc, we don't need to see template implementation + // source (though we do need a pragma to find the correct source file). + // However, without -qtempinc (either -qnotempinc or -qtemplateregistry) + // we do need to see the source. +# if defined (__TEMPINC__) +# if !defined ACE_TEMPLATES_REQUIRE_PRAGMA +# define ACE_TEMPLATES_REQUIRE_PRAGMA +# endif +# else +# if !defined (ACE_TEMPLATES_REQUIRE_SOURCE) +# define ACE_TEMPLATES_REQUIRE_SOURCE +# endif +# endif /* __TEMPINC__ */ - // These are for Visual Age C++ only -# if defined (__IBMCPP__) && (__IBMCPP__ >= 600) -# define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS - // When using -qtempinc, we don't need to see template implementation - // source (though we do need a pragma to find the correct source file). - // However, without -qtempinc (either -qnotempinc or -qtemplateregistry) - // we do need to see the source. -# if defined (__TEMPINC__) -# if !defined ACE_TEMPLATES_REQUIRE_PRAGMA -# define ACE_TEMPLATES_REQUIRE_PRAGMA -# endif -# else -# if !defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# define ACE_TEMPLATES_REQUIRE_SOURCE -# endif -# endif /* __TEMPINC__ */ +# undef WIFEXITED +# undef WEXITSTATUS +# define ACE_HAS_STANDARD_CPP_LIBRARY 1 +# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -# undef WIFEXITED -# undef WEXITSTATUS -# define ACE_HAS_STANDARD_CPP_LIBRARY 1 -# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -# if (__IBMCPP__ >= 600) /* Visual Age 6 and XL C/C++ 7 and up */ -# define ACE_HAS_TEMPLATE_TYPEDEFS -# define ACE_HAS_CUSTOM_EXPORT_MACROS -# define ACE_Proper_Export_Flag -# define ACE_Proper_Import_Flag -# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE < CLASS, LOCK >; -# endif /* __IBMCPP__ >= 600 */ -# endif /* __IBMCPP__ */ +# define ACE_HAS_TEMPLATE_TYPEDEFS +# define ACE_HAS_CUSTOM_EXPORT_MACROS +# define ACE_Proper_Export_Flag +# define ACE_Proper_Import_Flag + // There's no explicit import/export per-se, but to be sure that declared + // template code is exported, explicitly instantiate the class. +# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class SINGLETON_TYPE < CLASS, LOCK >; +# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE < CLASS, LOCK >; #elif defined (__GNUG__) // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so @@ -102,8 +93,7 @@ # define ACE_HAS_STRING_CLASS # include "ace/config-g++-common.h" - // Denotes that GNU has cstring.h as standard, to redefine memchr(). -# define ACE_HAS_GNU_CSTRING_H + # define ACE_HAS_SSIZE_T # if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)) @@ -118,7 +108,7 @@ # endif /* _REENTRANT */ # endif /* !ACE_MT_SAFE */ -#else /* ! __xlC__ && ! __GNUG__ */ +#else /* ! __IBMCPP__ && ! __GNUG__ */ # ifdef __cplusplus /* Let it slide for C compilers. */ # error unsupported compiler in ace/config-aix-5.x.h # endif /* __cplusplus */ @@ -142,7 +132,7 @@ #if defined (ACE_DLL_SUFFIX) # undef ACE_DLL_SUFFIX #endif -#define ACE_DLL_SUFFIX ".so" +#define ACE_DLL_SUFFIX ACE_TEXT (".so") #define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) @@ -179,6 +169,7 @@ #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_NONCONST_SELECT_TIMEVAL +#define ACE_HAS_ICMP_SUPPORT 1 #define ACE_HAS_IP_MULTICAST // Lacks perfect filtering, must bind group address. @@ -217,9 +208,6 @@ #define ACE_HAS_STREAMS // #define ACE_HAS_STREAM_PIPES -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // AIX bzero() #define ACE_HAS_STRINGS @@ -246,6 +234,8 @@ #define ACE_HAS_UTIME +#define ACE_HAS_CTYPE_T + // Platform has XPG4 wide character type and functions. However, the size // of wchar_t changes for 32- vs. 64-bit builds (unsigned short vs. unsigned // int, respectively). @@ -259,7 +249,7 @@ #define ACE_LACKS_NETINET_TCP_H // AIX uses LIBPATH to search for libraries -#define ACE_LD_SEARCH_PATH "LIBPATH" +#define ACE_LD_SEARCH_PATH ACE_TEXT ("LIBPATH") // Defines the page size of the system. #define ACE_PAGE_SIZE 4096 @@ -329,6 +319,8 @@ #define ACE_SCANDIR_SEL_LACKS_CONST #define ACE_HAS_SIGSUSPEND #define ACE_HAS_TIMEZONE /* Call tzset() to set timezone */ +#define ACE_LACKS_ISCTYPE +#define ACE_HAS_STRSIGNAL +#define ACE_NEEDS_STRSIGNAL_RANGE_CHECK #endif /* ACE_CONFIG_AIX_5_X_H */ - diff --git a/dep/include/ace/config-all.h b/externals/ace/config-all.h similarity index 95% rename from dep/include/ace/config-all.h rename to externals/ace/config-all.h index 927bd14919b..e19caec8e45 100644 --- a/dep/include/ace/config-all.h +++ b/externals/ace/config-all.h @@ -4,7 +4,7 @@ /** * @file config-all.h * - * $Id: config-all.h 81661 2008-05-09 12:05:34Z johnnyw $ + * $Id: config-all.h 84216 2009-01-22 18:34:40Z johnnyw $ * * @author (Originally in OS.h)Doug Schmidt * @author Jesper S. M|ller @@ -76,6 +76,10 @@ # define ACE_HAS_MONITOR_FRAMEWORK 1 #endif +#if !defined (ACE_HAS_SENDFILE) +# define ACE_HAS_SENDFILE 0 +#endif + #if !defined (ACE_HAS_MONITOR_POINTS) # define ACE_HAS_MONITOR_POINTS 0 #endif @@ -87,4 +91,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_ALL_H */ - diff --git a/dep/include/ace/config-cray.h b/externals/ace/config-cray.h similarity index 96% rename from dep/include/ace/config-cray.h rename to externals/ace/config-cray.h index 87fe263503d..1b944876112 100644 --- a/dep/include/ace/config-cray.h +++ b/externals/ace/config-cray.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-cray.h 81935 2008-06-12 22:01:53Z jtc $ +// $Id: config-cray.h 87169 2009-10-19 20:26:55Z olli $ #ifndef ACE_CONFIG_CRAY_H #define ACE_CONFIG_CRAY_H @@ -81,12 +81,11 @@ #define ACE_HAS_CHARPTR_SOCKOPT #define ACE_HAS_NONCONST_GETBY +#define ACE_HAS_NONCONST_INET_ADDR // has man pages, but links with missing symbols and I can't find lib yet /* #define ACE_HAS_REGEX */ -#define ACE_HAS_SIG_MACROS - #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES #if _UNICOS > 9 @@ -99,8 +98,6 @@ #define ACE_HAS_MSG -#define ACE_HAS_STRERROR - #define ACE_HAS_GPERF // Special modifications that apply to UNICOS/mk @@ -190,8 +187,6 @@ // Ones to check out at some point -/* #define ACE_HAS_SYS_SIGLIST */ - // C++ Compiler stuff to verify /* #define ACE_NEW_THROWS_EXCEPTIONS */ /* #define ACE_HAS_TEMPLATE_TYPEDEFS */ @@ -203,12 +198,8 @@ /* #define ACE_HAS_TLI */ /* #define ACE_HAS_TIUSER_H */ /* #define ACE_HAS_TLI_PROTOTYPES */ -/* #define ACE_LACKS_T_ERRNO */ /* #define ACE_LACKS_NAMED_POSIX_SEM */ -/* #define ACE_HAS_SYS_ERRLIST */ - #include /**/ "ace/post.h" #endif /* ACE_CONFIG_CRAY_H */ - diff --git a/dep/include/ace/config-cxx-common.h b/externals/ace/config-cxx-common.h similarity index 99% rename from dep/include/ace/config-cxx-common.h rename to externals/ace/config-cxx-common.h index 6d467d64964..024c25fd27e 100644 --- a/dep/include/ace/config-cxx-common.h +++ b/externals/ace/config-cxx-common.h @@ -84,4 +84,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CXX_COMMON_H */ - diff --git a/dep/include/ace/config-cygwin32.h b/externals/ace/config-cygwin32.h similarity index 85% rename from dep/include/ace/config-cygwin32.h rename to externals/ace/config-cygwin32.h index e6683e29795..35c517c3ca6 100644 --- a/dep/include/ace/config-cygwin32.h +++ b/externals/ace/config-cygwin32.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-cygwin32.h 81809 2008-05-30 13:40:21Z vzykov $ +// $Id: config-cygwin32.h 87169 2009-10-19 20:26:55Z olli $ // The following configuration file is designed to work for CygWin // platforms using GNU C++. @@ -25,13 +25,15 @@ #endif /* ACE_IOV_MAX */ // Define custom export macros for export/import of symbols from/of dll's -#define ACE_HAS_CUSTOM_EXPORT_MACROS -#define ACE_Proper_Export_Flag __declspec (dllexport) -#define ACE_Proper_Import_Flag __declspec (dllimport) -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE ; +#if !defined (ACE_HAS_CUSTOM_EXPORT_MACROS) +# define ACE_HAS_CUSTOM_EXPORT_MACROS 1 +# define ACE_Proper_Export_Flag __declspec (dllexport) +# define ACE_Proper_Import_Flag __declspec (dllimport) +# define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T +# define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; +# define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T +# define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE ; +#endif #define ACE_HAS_SELECT_H @@ -61,7 +63,6 @@ #define ACE_HAS_VOIDPTR_SOCKOPT 1 #define ACE_HAS_UALARM 1 -#define ACE_HAS_SYS_ERRLIST 1 #define ACE_HAS_STRNLEN 1 #define ACE_HAS_POSIX_GETPWNAM_R 1 #define ACE_HAS_POSIX_NONBLOCK 1 @@ -110,8 +111,7 @@ #define ACE_HAS_VOIDPTR_GETTIMEOFDAY -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR +#define ACE_HAS_STRSIGNAL // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T @@ -145,6 +145,7 @@ #define ACE_LACKS_FPUTWS 1 #define ACE_LACKS_WCSTOULL 1 +#define ACE_LACKS_ISCTYPE #define ACE_HAS_AUTOMATIC_INIT_FINI @@ -195,13 +196,21 @@ # define ACE_LACKS_PTHREAD_YIELD 1 # define ACE_LACKS_PTHREAD_ATTR_SETSTACK +#if CYGWIN_VERSION_API_MINOR < 207 // In the 1.5.9 release of Cygwin the pthread_kill gives an access violation // so for the time being we say Cygwin doesn't support pthread_kill. # define ACE_LACKS_PTHREAD_KILL +#endif #endif /* ACE_MT_SAFE */ +#if CYGWIN_VERSION_API_MINOR >= 207 +// > Cygwin 1.7 +#define ACE_HAS_VWPRINTF +#define ACE_HAS_VFWPRINTF +#define ACE_HAS_VSWPRINTF +#endif + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_CYGWIN32_H */ - diff --git a/dep/include/ace/config-doxygen.h b/externals/ace/config-doxygen.h similarity index 91% rename from dep/include/ace/config-doxygen.h rename to externals/ace/config-doxygen.h index d4e8a068e43..830e69a3e55 100644 --- a/dep/include/ace/config-doxygen.h +++ b/externals/ace/config-doxygen.h @@ -6,7 +6,7 @@ * * @file config-doxygen.h * - * $Id: config-doxygen.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: config-doxygen.h 84610 2009-02-26 10:26:09Z johnnyw $ * * @author Carlos O'Ryan * @author Darrell Brunsch @@ -117,5 +117,10 @@ #define ACE_HAS_IP_MULTICAST -#endif /* ACE_CONFIG_DOXYGEN_H */ +#define ACE_INLINE +#define ACE_BEGIN_VERSIONED_NAMESPACE_DECL +#define ACE_END_VERSIONED_NAMESPACE_DECL +#define TAO_BEGIN_VERSIONED_NAMESPACE_DECL +#define TAO_END_VERSIONED_NAMESPACE_DECL +#endif /* ACE_CONFIG_DOXYGEN_H */ diff --git a/dep/include/ace/config-freebsd.h b/externals/ace/config-freebsd.h similarity index 51% rename from dep/include/ace/config-freebsd.h rename to externals/ace/config-freebsd.h index 6f4c5750f98..b83394ddece 100644 --- a/dep/include/ace/config-freebsd.h +++ b/externals/ace/config-freebsd.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-freebsd.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-freebsd.h 87483 2009-11-11 13:50:04Z olli $ // The following configuration file is designed to work for FreeBSD @@ -8,30 +8,30 @@ #include /**/ "ace/pre.h" #if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 +# define ACE_MT_SAFE 1 #endif #if ACE_MT_SAFE - // Yes, we do have threads. -# define ACE_HAS_THREADS 1 + // Yes, we do have threads. +# define ACE_HAS_THREADS 1 #else - // Set to 0 since that's what config-posix.h checks for. -# define ACE_HAS_THREADS 0 + // Set to 0 since that's what config-posix.h checks for. +# define ACE_HAS_THREADS 0 #endif /* ACE_MT_SAFE */ #include "ace/config-posix.h" -#include // Make sure we source in the OS version. +#include -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ +#if !defined (__ACE_INLINE__) +# define __ACE_INLINE__ #endif /* ! __ACE_INLINE__ */ #if (__FreeBSD_version < 220000) -#if defined (ACE_HAS_THREADS) -#error Threads are not supported. -#endif /* ACE_HAS_THREADS */ +# if defined (ACE_HAS_THREADS) +# error Threads are not supported. +# endif /* ACE_HAS_THREADS */ #endif /* __FreeBSD_version < 220000 */ #if defined (__GNUG__) @@ -45,203 +45,73 @@ // Platform specific directives // gcc defines __FreeBSD__ automatically for us. #ifdef ACE_HAS_THREADS -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ +# if !defined (_THREAD_SAFE) +# define _THREAD_SAFE +# endif /* _THREAD_SAFE */ #endif -#define ACE_HAS_GPERF - -#if (__FreeBSD_version < 420000) -#define ACE_LACKS_GETPGID -#define ACE_LACKS_SETPGID -#define ACE_LACKS_SETREGID -#define ACE_LACKS_SETREUID -#define ACE_LACKS_PTHREAD_CANCEL -#endif /* __FreeBSD_version < 420000 */ +#define ACE_HAS_3_PARAM_READDIR_R +#define ACE_HAS_3_PARAM_WCSTOK +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG +#define ACE_HAS_ALLOCA #define ACE_HAS_ALT_CUSERID -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS -#define ACE_HAS_SIG_MACROS -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_NONCONST_SELECT_TIMEVAL +#define ACE_HAS_AUTOMATIC_INIT_FINI #define ACE_HAS_CHARPTR_DL +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +#define ACE_HAS_DIRENT +#define ACE_HAS_GETRUSAGE +#define ACE_HAS_GPERF +#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT +#define ACE_HAS_IP_MULTICAST +#define ACE_HAS_MSG +#define ACE_HAS_NONCONST_SELECT_TIMEVAL +#define ACE_HAS_POSIX_NONBLOCK +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS +#define ACE_HAS_RTLD_LAZY_V +#define ACE_HAS_SEMUN +#define ACE_HAS_SIGISMEMBER_BUG +#define ACE_HAS_SIGSUSPEND +#define ACE_HAS_SIGWAIT +#define ACE_HAS_SIG_ATOMIC_T +#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN +#define ACE_HAS_SOCKADDR_IN_SIN_LEN +#define ACE_HAS_SSIZE_T +#define ACE_HAS_STRSIGNAL +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#define ACE_HAS_SVR4_SIGNAL_T +#define ACE_HAS_SYSCTL +#define ACE_HAS_SYSV_IPC +#define ACE_HAS_SYS_FILIO_H +#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_TERMIOS +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_HAS_TIMEZONE_GETTIMEOFDAY +#define ACE_HAS_UALARM -#if (__FreeBSD_version < 400000) -#define ACE_LACKS_SIGSET -#define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_READDIR_R -#define ACE_LACKS_SETSCHED -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#endif +#define ACE_LACKS_CONDATTR_PSHARED +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_ITOW +#define ACE_LACKS_LOG2 +#define ACE_LACKS_MALLOC_H +#define ACE_LACKS_MUTEXATTR_PSHARED +#define ACE_LACKS_SIGINFO_H +#define ACE_LACKS_SI_ADDR +#define ACE_LACKS_STROPTS_H +#define ACE_LACKS_STRRECVFD +#define ACE_LACKS_THREAD_PROCESS_SCOPING +#define ACE_LACKS_TIMESPEC_T +#define ACE_LACKS_WCSDUP +#define ACE_LACKS_WCSICMP +#define ACE_LACKS_WCSNICMP #define ACE_NEEDS_SCHED_H -#if (__FreeBSD_version < 400000) -enum schedparam_policy { - SCHED_RR, - SCHED_IO, - SCHED_FIFO, - SCHED_OTHER -}; -#endif - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -// This won't be necessary after it is fixed in the system include headers. -extern "C" { char * cuserid (char *s); } - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#if (__FreeBSD_version < 501000) -#define ACE_LACKS_STDINT_H -#endif - -#define ACE_HAS_SYSCTL -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -#if (__FreeBSD_version >= 220000) -#define ACE_HAS_VASPRINTF -#endif - -#if (__FreeBSD_version >= 300000) -#define ACE_HAS_SIGINFO_T -#endif /* __FreeBSD_version >= 300000 */ - -#if (__FreeBSD_version >= 320000) -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#endif /* __FreeBSD_version >= 320000 */ - -#if (__FreeBSD_version >= 440000) -#define ACE_HAS_GETPROGNAME -#define ACE_HAS_SETPROGNAME -#endif - -#if (__FreeBSD_version < 501000) -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS -#endif - -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES -#define ACE_LACKS_SIGINFO_H -#define ACE_LACKS_LOG2 -#define ACE_LACKS_SI_ADDR - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform supports SVR4 dynamic linking semantics.. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - -// Lacks perfect filtering, must bind group address. -#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ - -// Compiler/platform has -//#define ACE_HAS_ALLOCA_H - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform supports sys_siglist array. -// *** This refers to (_sys_siglist) instead of (sys_siglist) -// #define ACE_HAS_SYS_SIGLIST - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - // Defines the page size of the system. #define ACE_PAGE_SIZE 4096 -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG - -#if (__FreeBSD_version < 500100) -# define ACE_HAS_NONCONST_MSGSND -#endif - -// Thread specific settings -// Yes, we do have threads. -#ifdef ACE_HAS_THREADS -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif /* ! ACE_MT_SAFE */ -#endif /* ACE_HAS_THREADS */ - -#define ACE_LACKS_THREAD_PROCESS_SCOPING -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_DIRENT - -#define ACE_HAS_SIGWAIT - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -#if (__FreeBSD_version > 400000) -#define ACE_HAS_UCONTEXT_T -#define ACE_HAS_SOCKLEN_T -#define ACE_HAS_GETIFADDRS -#define ACE_HAS_PTHREADS_UNIX98_EXT -#endif - // Note, on FreeBSD 5, POSIX aio is now an optional kernel module which // must be loaded. // Read the aio(4) man page for what to do, otherwise any aio_* call @@ -249,23 +119,81 @@ extern "C" { char * cuserid (char *s); } // By default use Proactor which does not use POSIX Real-time Signals. #ifdef ACE_HAS_AIO_CALLS -# ifndef ACE_POSIX_AIOCB_PROACTOR -# define ACE_POSIX_AIOCB_PROACTOR -# endif /* ACE_POSIX_AIOCB_PROACTOR */ +# ifndef ACE_POSIX_AIOCB_PROACTOR +# define ACE_POSIX_AIOCB_PROACTOR +# endif /* ACE_POSIX_AIOCB_PROACTOR */ #endif /* ACE_HAS_AIO_CALLS */ -#define ACE_LACKS_STROPTS_H +#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING +# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 +#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ -// Needed when ACE_HAS_WCHAR is defined. -#define ACE_LACKS_WCSNICMP -#define ACE_LACKS_WCSICMP -#define ACE_LACKS_WCSDUP -#define ACE_LACKS_ITOW -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_HAS_3_PARAM_READDIR_R +// +// Version specific settings +// + +#if (__FreeBSD_version >= 220000) +# define ACE_HAS_VASPRINTF +#endif + +#if (__FreeBSD_version >= 300000) +# define ACE_HAS_SIGINFO_T +#endif /* __FreeBSD_version >= 300000 */ + +#if (__FreeBSD_version >= 320000) +# define ACE_HAS_REENTRANT_FUNCTIONS +# define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS +# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R +#endif /* __FreeBSD_version >= 320000 */ + +#if (__FreeBSD_version > 400000) +# define ACE_HAS_UCONTEXT_T +# define ACE_HAS_SOCKLEN_T +# define ACE_HAS_GETIFADDRS +# define ACE_HAS_PTHREADS_UNIX98_EXT +#endif + +#if (__FreeBSD_version < 400000) +# define ACE_LACKS_SIGSET +# define ACE_LACKS_RWLOCK_T +# define ACE_LACKS_READDIR_R +# define ACE_LACKS_SETSCHED +# define ACE_LACKS_PTHREAD_THR_SIGSETMASK +# define ACE_LACKS_UCONTEXT_H +# define ACE_LACKS_RAND_REENTRANT_FUNCTIONS + +enum schedparam_policy { + SCHED_RR, + SCHED_IO, + SCHED_FIFO, + SCHED_OTHER +}; +#endif + +#if (__FreeBSD_version < 420000) +# define ACE_LACKS_GETPGID +# define ACE_LACKS_SETPGID +# define ACE_LACKS_SETREGID +# define ACE_LACKS_SETREUID +# define ACE_LACKS_PTHREAD_CANCEL +#endif /* __FreeBSD_version < 420000 */ + +#if (__FreeBSD_version >= 440000) +# define ACE_HAS_GETPROGNAME +# define ACE_HAS_SETPROGNAME +#endif + +#if (__FreeBSD_version < 500100) +# define ACE_HAS_NONCONST_MSGSND +#endif + +#if (__FreeBSD_version < 501000) +# define ACE_LACKS_STDINT_H +# define ACE_LACKS_PWD_REENTRANT_FUNCTIONS +#endif #if (__FreeBSD_version >= 501000) -# define ACE_HAS_PTHREAD_SETSTACK +# define ACE_HAS_PTHREAD_SETSTACK #endif #if (__FreeBSD_version < 700007) @@ -278,7 +206,10 @@ extern "C" { char * cuserid (char *s); } # define ACE_HAS_LKSCTP #endif +#if (__FreeBSD_version < 700038) +# define ACE_HAS_VOID_UNSETENV +#endif + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-g++-common.h b/externals/ace/config-g++-common.h similarity index 77% rename from dep/include/ace/config-g++-common.h rename to externals/ace/config-g++-common.h index ff365a5890d..dc010182a70 100644 --- a/dep/include/ace/config-g++-common.h +++ b/externals/ace/config-g++-common.h @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: config-g++-common.h 82495 2008-08-04 07:23:01Z johnnyw $ +// $Id: config-g++-common.h 89454 2010-03-11 09:35:25Z johnnyw $ // This configuration file is designed to be included by another, // specific configuration file. It provides config information common @@ -29,6 +29,7 @@ #if (__GNUC__ < 3) # define ACE_LACKS_MEMBER_TEMPLATES +# define ACE_LACKS_NUMERIC_LIMITS #endif /* __GNUC__ < 3 */ // __EXCEPTIONS is defined with -fexceptions, the egcs default. It @@ -65,6 +66,30 @@ # define ACE_HAS_INTEL_ASSEMBLY #endif +#if !defined (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE) +#define ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE 1 +#endif + +#if !defined (ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE) +#define ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE 1 +#endif + +#if !defined (ACE_HAS_GCC_DEPRECATED_ATTRIBUTE) +#define ACE_HAS_GCC_DEPRECATED_ATTRIBUTE 1 +#endif + +#if (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE == 1) +# define ACE_GCC_CONSTRUCTOR_ATTRIBUTE __attribute__ ((constructor)) +#endif + +#if (ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE == 1) +# define ACE_GCC_DESTRUCTOR_ATTRIBUTE __attribute__ ((destructor)) +#endif + +#if (ACE_HAS_GCC_DEPRECATED_ATTRIBUTE == 1) +#define ACE_DEPRECATED __attribute__ ((deprecated)) +#endif + // GNU g++ >= 4.x implements "#pragma once". #if (__GNUC__ < 4) && !defined (ACE_LACKS_PRAGMA_ONCE) // We define it with a -D with make depend. @@ -73,7 +98,7 @@ // Take advantage of G++ (>= 4.x) visibility attributes to generate // improved shared library binaries. -#if (__GNUC__ >= 4) && !defined (__MINGW32__) +#if (__GNUC__ >= 4) && !defined (__MINGW32__) && !defined (ACE_HAS_CEGCC) # if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0 # undef ACE_HAS_CUSTOM_EXPORT_MACROS @@ -124,6 +149,28 @@ # endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */ #endif /* __GNU__ >= 4 */ +// GCC >= 4.1 provides __sync_XXXX builtins for use in atomic operations +// although the builtins are provided globally they are not supported on all platforms +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) +# if defined (__powerpc__) +// The builtins seem to be provided for all powerpc platforms +# define ACE_HAS_GCC_ATOMIC_BUILTINS 1 +# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 1) && (__GNUC_PATCHLEVEL__ == 1)) +// PPU GCC 4.1.1 doesn't have builtin atomic ops for size 1/2 +# define ACE_LACKS_GCC_ATOMIC_BUILTINS_2 +# define ACE_LACKS_GCC_ATOMIC_BUILTINS_1 +# endif +# endif +# if defined (__ia64) +// The builtins seem to be provided for the IA64 platforms +# define ACE_HAS_GCC_ATOMIC_BUILTINS 1 +# endif +# if defined (__amd64__) || defined (__x86_64__) +// The builtin's are provided also for 64bit linux +# define ACE_HAS_GCC_ATOMIC_BUILTINS 1 +# endif +#endif + #if defined (ACE_HAS_GNU_REPO) // -frepo causes unresolved symbols of basic_string left- and // right-shift operators with ACE_HAS_STRING_CLASS. @@ -134,4 +181,3 @@ #include /**/ "ace/post.h" #endif /* ACE_GNUG_COMMON_H */ - diff --git a/dep/include/ace/config-ghs-common.h b/externals/ace/config-ghs-common.h similarity index 99% rename from dep/include/ace/config-ghs-common.h rename to externals/ace/config-ghs-common.h index bb169ba06ba..ffa554c047e 100644 --- a/dep/include/ace/config-ghs-common.h +++ b/externals/ace/config-ghs-common.h @@ -41,4 +41,3 @@ #include /**/ "ace/post.h" #endif /* ACE_GHS_COMMON_H */ - diff --git a/dep/include/ace/config-hpux-11.00.h b/externals/ace/config-hpux-11.00.h similarity index 97% rename from dep/include/ace/config-hpux-11.00.h rename to externals/ace/config-hpux-11.00.h index 63f156dcfed..82420f210f3 100644 --- a/dep/include/ace/config-hpux-11.00.h +++ b/externals/ace/config-hpux-11.00.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-hpux-11.00.h 81992 2008-06-16 19:09:50Z wotte $ +// $Id: config-hpux-11.00.h 89494 2010-03-15 20:11:18Z olli $ // The following configuration file is designed to work for HP // platforms running HP-UX 11.00 using aC++ or gcc (2.95 and up). @@ -284,17 +284,11 @@ #define ACE_HAS_XPG4_MULTIBYTE_CHAR -/* Platform/compiler supports _sys_errlist symbol */ -#define ACE_HAS_SYS_ERRLIST 1 - #define ACE_HAS_UALARM // Platform supports ucontext_t (which is used in the extended signal API). #define ACE_HAS_UCONTEXT_T -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Platform/compiler supports void * as second parameter to gettimeofday(). #define ACE_HAS_VOIDPTR_GETTIMEOFDAY @@ -337,11 +331,18 @@ #define ACE_LACKS_SUSECONDS_T #define ACE_LACKS_SYS_SYSCTL_H -// @@ TODO: It looks like HP-UX provides strtoull and wcstoull -// but some more work is needed to plug them in correctly. +// @@ TODO: It looks like HP-UX provides strtoll, strtoull, wcstoll and +// wcstoull but some more work is needed to plug them in correctly. +#define ACE_LACKS_STRTOLL +#define ACE_LACKS_WCSTOLL #define ACE_LACKS_STRTOULL #define ACE_LACKS_WCSTOULL +#define ACE_LACKS_ISWASCII + +#define ACE_LACKS_SETENV +#define ACE_LACKS_UNSETENV + // Shared library name/path components #if defined (__ia64) # define ACE_DLL_SUFFIX ACE_TEXT (".so") @@ -360,6 +361,8 @@ #define ACE_HAS_3_PARAM_READDIR_R +#define ACE_LACKS_STRUCT_LIFNUM + ////////////////////////////////////////////////////////////////////////// // // STREAMS information @@ -446,4 +449,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-icc-common.h b/externals/ace/config-icc-common.h similarity index 99% rename from dep/include/ace/config-icc-common.h rename to externals/ace/config-icc-common.h index 290d2b60fc6..1ebd0c52ed7 100644 --- a/dep/include/ace/config-icc-common.h +++ b/externals/ace/config-icc-common.h @@ -111,4 +111,3 @@ #include /**/ "ace/post.h" #endif /* ACE_LINUX_ICC_COMMON_H */ - diff --git a/dep/include/ace/config-integritySCA.h b/externals/ace/config-integritySCA.h similarity index 97% rename from dep/include/ace/config-integritySCA.h rename to externals/ace/config-integritySCA.h index be6ccd7a3a8..41afec58758 100644 --- a/dep/include/ace/config-integritySCA.h +++ b/externals/ace/config-integritySCA.h @@ -8,7 +8,7 @@ * Integrity RTOS with SCA from Green Hills Software * http://www.ghs.com/products/rtos/integrity.html * - * $Id: config-integritySCA.h 81935 2008-06-12 22:01:53Z jtc $ + * $Id: config-integritySCA.h 88501 2010-01-12 19:41:53Z olli $ */ #define ghs @@ -47,12 +47,13 @@ /***** ANSI defines *****/ #define ACE_LACKS_TEMPNAM /* believe it or not, this is ANSI C */ -#define ACE_HAS_STRERROR +#define ACE_LACKS_PUTENV_PROTOTYPE #define ACE_LACKS_SENDMSG /***** End Stack Defines *****/ + /* SCA STUFF */ #if defined(INTEGRITY_VERSION) && (INTEGRITY_VERSION >= 40108) #define ACE_HAS_SIG_ATOMIC_T @@ -102,12 +103,9 @@ #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SEMBUF_T #define ACE_LACKS_UNIX_DOMAIN_SOCKETS -#define ACE_LACKS_USER -#define ACE_LACKS_FILE_FCNTL #define ACE_LACKS_FCNTL #define ACE_LACKS_UMASK #define ACE_LACKS_SEEK -#define ACE_LACKS_SHARED_MEMORY #define ACE_LACKS_MSYNC #define ACE_LACKS_PID_STUFF #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS @@ -221,6 +219,7 @@ int unlink(const char *); #define ACE_LACKS_SEEKDIR #define ACE_LACKS_GETHOSTENT + /* end MIKEC Addtions */ // Hack to avoid ensure that things defined in ind_io.h @@ -228,4 +227,3 @@ int unlink(const char *); #include #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-linux-common.h b/externals/ace/config-linux-common.h similarity index 91% rename from dep/include/ace/config-linux-common.h rename to externals/ace/config-linux-common.h index 6743c53adfc..b787a1447ad 100644 --- a/dep/include/ace/config-linux-common.h +++ b/externals/ace/config-linux-common.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-linux-common.h 82516 2008-08-05 19:22:59Z shuston $ +// $Id: config-linux-common.h 88663 2010-01-22 10:49:22Z mcorino $ // Do not use this configuration file directly since it's designed to // be included by another, specific configuration file, such as @@ -73,6 +73,7 @@ # if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 3) # define ACE_HAS_RUSAGE_WHO_ENUM enum __rusage_who # define ACE_HAS_RLIMIT_RESOURCE_ENUM enum __rlimit_resource +# define ACE_LACKS_ISCTYPE # endif # define ACE_HAS_SOCKLEN_T # define ACE_HAS_4_4BSD_SENDMSG_RECVMSG @@ -174,13 +175,7 @@ #elif defined (__DECCXX) # define ACE_CONFIG_INCLUDE_CXX_COMMON # include "ace/config-cxx-common.h" -#elif defined (__BORLANDC__) -# undef ACE_HAS_LLSEEK -# undef ACE_HAS_LSEEK64 -# undef ACE_LACKS_LLSEEK_PROTOTYPE -# undef ACE_LACKS_LSEEK64_PROTOTYPE -# include "ace/config-borland-common.h" -#elif defined (__SUNCC_PRO) +#elif defined (__SUNCC_PRO) || defined (__SUNPRO_CC) # include "ace/config-suncc-common.h" #elif defined (__PGI) // Portable group compiler @@ -199,7 +194,7 @@ * (TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.{h,c}) that may indirectly * include this */ -#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && !__BORLANDC__ && !__PGI */ +#else /* ! __GNUG__ && !__DECCXX && !__INTEL_COMPILER && && !__PGI */ # ifdef __cplusplus /* Let it slide for C compilers. */ # error unsupported compiler in ace/config-linux-common.h # endif /* __cplusplus */ @@ -208,11 +203,13 @@ // Completely common part :-) // Platform/compiler has the sigwait(2) prototype -# define ACE_HAS_SIGWAIT +#define ACE_HAS_SIGWAIT -# define ACE_HAS_SIGSUSPEND +#define ACE_HAS_SIGSUSPEND -# define ACE_HAS_UALARM +#define ACE_HAS_UALARM + +#define ACE_HAS_STRSIGNAL #if __GLIBC__ >= 2 #ifndef ACE_HAS_POSIX_REALTIME_SIGNALS @@ -239,6 +236,7 @@ #define ACE_LACKS_ITOW #define ACE_LACKS_WCSICMP #define ACE_LACKS_WCSNICMP +#define ACE_LACKS_ISWASCII #if __GLIBC__ >= 2 # define ACE_HAS_3_PARAM_WCSTOK @@ -323,8 +321,11 @@ // Platform supplies scandir() #define ACE_HAS_SCANDIR +#if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 10) // Although the scandir man page says otherwise, this setting is correct. +// The setting was fixed in 2.10, so do not use the hack after that. #define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR +#endif // A conflict appears when including both and // with recent glibc headers. @@ -341,9 +342,6 @@ #define ACE_HAS_TIMEZONE_GETTIMEOFDAY -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Don't define _XOPEN_SOURCE in ACE to make strptime() prototype // visible. ACE shouldn't depend on feature test macros to make // prototypes visible. @@ -378,13 +376,18 @@ #if defined (__ia64) || defined(__alpha) || defined (__x86_64__) // On 64 bit platforms, the "long" type is 64-bits. Override the // default 32-bit platform-specific format specifiers appropriately. -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%lu") -# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%ld") -# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") +# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%lu" +# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld" +# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #endif /* __ia64 */ #define ACE_SIZEOF_WCHAR 4 +#if defined (__powerpc__) && !defined (ACE_SIZEOF_LONG_DOUBLE) +// 32bit PowerPC Linux uses 128bit long double +# define ACE_SIZEOF_LONG_DOUBLE 16 +#endif + #define ACE_LACKS_GETIPNODEBYADDR #define ACE_LACKS_GETIPNODEBYNAME @@ -392,15 +395,28 @@ #define ACE_HAS_TERMIOS // Linux implements sendfile(). -#define ACE_HAS_SENDFILE +#define ACE_HAS_SENDFILE 1 #define ACE_HAS_VOIDPTR_MMAP +#define ACE_HAS_ICMP_SUPPORT 1 + +#define ACE_HAS_VASPRINTF + +// According to man pages Linux uses different (compared to UNIX systems) types +// for setting IP_MULTICAST_TTL and IPV6_MULTICAST_LOOP / IP_MULTICAST_LOOP +// in setsockopt/getsockopt. +#define ACE_HAS_IP_MULTICAST_TTL_AS_INT 1 +#define ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL 1 +#define ACE_HAS_IP_MULTICAST_LOOP_AS_INT 1 + #if defined (ACE_LACKS_NETWORKING) # include "ace/config-posix-nonetworking.h" #else # define ACE_HAS_NETLINK -# define ACE_HAS_GETIFADDRS +# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) +# define ACE_HAS_GETIFADDRS +# endif #endif #if !defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) @@ -446,4 +462,3 @@ #include /**/ "ace/post.h" #endif /* ACE_LINUX_COMMON_H */ - diff --git a/dep/include/ace/config-linux.h b/externals/ace/config-linux.h similarity index 99% rename from dep/include/ace/config-linux.h rename to externals/ace/config-linux.h index 4c5dc3c4bdb..8b79c13a415 100644 --- a/dep/include/ace/config-linux.h +++ b/externals/ace/config-linux.h @@ -73,4 +73,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_LINUX_H */ - diff --git a/dep/include/ace/config-lite.h b/externals/ace/config-lite.h similarity index 96% rename from dep/include/ace/config-lite.h rename to externals/ace/config-lite.h index a8157bef1ec..1a6937c851b 100644 --- a/dep/include/ace/config-lite.h +++ b/externals/ace/config-lite.h @@ -4,7 +4,7 @@ /** * @file config-lite.h * - * $Id: config-lite.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: config-lite.h 85832 2009-06-28 16:14:59Z johnnyw $ * * @author (Originally in OS.h)Doug Schmidt * @author Jesper S. M|ller @@ -122,13 +122,13 @@ ACE_END_VERSIONED_NAMESPACE_DECL // Once all C++ compilers support the standard reverse_iterator // adapters, we can drop this generator macro or at least drop the // MSVC++ or Sun Studio preprocessor conditional blocks. -#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x590 \ +#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5100 \ && !defined (_STLPORT_VERSION) // If we're not using the stlport4 C++ library (which has standard // iterators), we need to ensure this is included in order to test // the _RWSTD_NO_CLASS_PARTIAL_SPEC feature test macro below. # include -#endif /* __SUNPRO_CC <= 0x580 */ +#endif /* __SUNPRO_CC <= 0x5100 */ #if (defined (_MSC_VER) && (_MSC_VER <= 1310) && defined (_WIN64)) \ || defined (ACE_HAS_BROKEN_STD_REVERSE_ITERATOR) // VC 7.1 and the latest 64-bit platform SDK still don't define a standard @@ -137,7 +137,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL typedef std::reverse_iterator reverse_iterator; \ typedef std::reverse_iterator const_reverse_iterator; -#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x590 \ +#elif defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x5100 \ && defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) # define ACE_DECLARE_STL_REVERSE_ITERATORS \ typedef std::reverse_iterator const_reverse_iterator; #endif /* _MSC_VER && _WIN64 */ + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_LITE_H */ - diff --git a/dep/include/ace/config-lynxos.h b/externals/ace/config-lynxos.h similarity index 70% rename from dep/include/ace/config-lynxos.h rename to externals/ace/config-lynxos.h index baeafa88bb8..81176f615b9 100644 --- a/dep/include/ace/config-lynxos.h +++ b/externals/ace/config-lynxos.h @@ -1,4 +1,4 @@ -// $Id: config-lynxos.h 81780 2008-05-26 13:56:49Z olli $ +// $Id: config-lynxos.h 89494 2010-03-15 20:11:18Z olli $ // The following configuration file is designed to work for LynxOS, // version 4.0.0 and later, using the GNU g++ compiler. @@ -7,6 +7,13 @@ #define ACE_CONFIG_H #include /**/ "ace/pre.h" +// System include files are not in sys/, this gets rid of warning. +#define __NO_INCLUDE_WARN__ + +#define __FREEBSDCODE__ +#include +#undef __FREEBSDCODE__ + #if ! defined (__ACE_INLINE__) # define __ACE_INLINE__ #endif /* ! __ACE_INLINE__ */ @@ -32,7 +39,8 @@ // # define ACE_HAS_POWERPC_TIMER #endif /* __x86__ || __powerpc__ */ -#define ACE_DEFAULT_BASE_ADDR ((char *) 0) +#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R +#define ACE_HAS_3_PARAM_READDIR_R #define ACE_HAS_4_4BSD_SENDMSG_RECVMSG #define ACE_HAS_ALLOCA #define ACE_HAS_ALLOCA_H @@ -45,41 +53,55 @@ #define ACE_HAS_CLOCK_SETTIME #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT +#define ACE_HAS_GETIFADDRS #define ACE_HAS_GETPAGESIZE #define ACE_HAS_GETRUSAGE -#define ACE_HAS_GNU_CSTRING_H +#define ACE_HAS_GETRUSAGE_PROTOTYPE #define ACE_HAS_GPERF +#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_ICMP_SUPPORT 1 #define ACE_HAS_IP_MULTICAST -#define ACE_HAS_LYNXOS_SIGNALS +#define ACE_HAS_MEMCHR +#define ACE_HAS_MKDIR #define ACE_HAS_MSG +#define ACE_HAS_NANOSLEEP +#define ACE_HAS_NEW_NOTHROW #define ACE_HAS_NONCONST_CLOCK_SETTIME #define ACE_HAS_NONCONST_MSGSND #define ACE_HAS_NONCONST_READV #define ACE_HAS_NONCONST_SELECT_TIMEVAL #define ACE_HAS_NONCONST_SETRLIMIT #define ACE_HAS_NONCONST_WRITEV +#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 #define ACE_HAS_POSIX_NONBLOCK #define ACE_HAS_POSIX_TIME #define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_HAS_SCANDIR -#define ACE_HAS_SEMUN +#define ACE_HAS_SIGACTION_CONSTP2 #define ACE_HAS_SIGINFO_T +#define ACE_HAS_SIGSUSPEND #define ACE_HAS_SIGTIMEDWAIT #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T +#define ACE_HAS_SIG_C_FUNC +#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN +#define ACE_HAS_SOCKADDR_IN_SIN_LEN +#define ACE_HAS_SOCKADDR_MSG_NAME +#define ACE_HAS_SOCKLEN_T #define ACE_HAS_SSIZE_T -#define ACE_HAS_STRBUF_T #define ACE_HAS_STREAMS -#define ACE_HAS_STRERROR -#define ACE_HAS_SYSV_IPC -#define ACE_HAS_SYS_SIGLIST +#define ACE_HAS_STRINGS +#define ACE_HAS_STRING_CLASS +#define ACE_HAS_SYSCTL +#define ACE_HAS_SYS_FILIO_H #define ACE_HAS_SYS_SOCKIO_H #define ACE_HAS_TERMIOS #define ACE_HAS_TIMEZONE_GETTIMEOFDAY + #define ACE_LACKS_ALPHASORT_PROTOTYPE #define ACE_LACKS_CONST_TIMESPEC_PTR #define ACE_LACKS_GETPGID +#define ACE_LACKS_ISCTYPE #define ACE_LACKS_MADVISE #define ACE_LACKS_MKSTEMP_PROTOTYPE #define ACE_LACKS_MKTEMP_PROTOTYPE @@ -92,13 +114,13 @@ #define ACE_LACKS_SETEUID #define ACE_LACKS_SIGINFO_H #define ACE_LACKS_STRPTIME -#define ACE_LACKS_SUSECONDS_T #define ACE_LACKS_SWAB_PROTOTYPE #define ACE_LACKS_TIMESPEC_T #define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_USECONDS_T -#define ACE_LACKS_VSNPRINTF -#define ACE_LACKS_WCHAR_H +#define ACE_LACKS_SUSECONDS_T + +#define ACE_DEFAULT_BASE_ADDR ((char *) 0) +#define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS #define ACE_MALLOC_ALIGN 8 #define ACE_PAGE_SIZE 4096 #define ACE_POSIX_SIG_PROACTOR @@ -110,34 +132,25 @@ #if ACE_MT_SAFE == 1 // Platform supports threads. # define ACE_HAS_PTHREADS +# define ACE_HAS_PTHREADS_STD +# define ACE_HAS_PTHREADS_UNIX98_EXT +# define ACE_HAS_PTHREAD_GETCONCURRENCY +# define ACE_HAS_PTHREAD_SETCONCURRENCY +# define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE # define ACE_HAS_THREAD_SPECIFIC_STORAGE -# define ACE_LACKS_NULL_PTHREAD_STATUS -# define ACE_LACKS_THREAD_PROCESS_SCOPING # define ACE_LACKS_PTHREAD_ATTR_SETSTACK +# define ACE_LACKS_THREAD_PROCESS_SCOPING # if ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR == 0 # define ACE_LACKS_SETDETACH # define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR # endif #endif /* ACE_MT_SAFE */ -#if __GNUC__ < 3 -# define ACE_LACKS_NUMERIC_LIMITS -#endif /* __GNUC__ < 3 */ - // By default, don't include RCS Id strings in object code. #if !defined (ACE_USE_RCSID) # define ACE_USE_RCSID 0 #endif /* ! ACE_USE_RCSID */ -// System include files are not in sys/, this gets rid of warning. -#define __NO_INCLUDE_WARN__ - -// "changes signedness" error (OS.i and many other files) -#define ACE_HAS_SOCKLEN_T -// LSOCK.cpp uses a macro from param.h, not included -#define ALIGNBYTES (sizeof(int) - 1) -#define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES) - #if ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR == 0 # define ACE_LACKS_GETOPT_PROTOTYPE # define ACE_LACKS_INET_ATON_PROTOTYPE @@ -145,7 +158,6 @@ # define ACE_LACKS_STRCASECMP_PROTOTYPE # define ACE_LACKS_STRNCASECMP_PROTOTYPE # define ACE_LACKS_SYS_SELECT_H -# define ACE_HAS_NONCONST_GETBY #endif #if (ACE_LYNXOS_MAJOR > 4) || (ACE_LYNXOS_MAJOR == 4 && ACE_LYNXOS_MINOR >= 2) @@ -154,10 +166,34 @@ # define ACE_HAS_MUTEX_TIMEOUTS #endif +#if (ACE_LYNXOS_MAJOR >=5) +// LynxOS 5.0 Additons +# define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +# define ACE_HAS_NONCONST_INET_ADDR +# define ACE_LACKS_INET_ATON_PROTOTYPE +# define ACE_LACKS_SEMBUF_T +# define ACE_LACKS_STROPTS_H +# define ACE_LACKS_STRRECVFD +# define ACE_LACKS_SYS_SEM_H +# define ACE_SYS_SIGLIST __sys_siglist +#else +// LynxOS 5.0 Removals +# define ACE_HAS_LYNXOS4_SIGNALS +# define ACE_HAS_SEMUN +# define ACE_HAS_STRBUF_T +# define ACE_HAS_SYSV_IPC +# define ACE_LACKS_ISBLANK +# define ACE_LACKS_SETENV +# define ACE_LACKS_UNSETENV +# define ACE_LACKS_USECONDS_T +# define ACE_LACKS_VSNPRINTF +# define ACE_LACKS_WCHAR_H +# define ACE_SYS_SIGLIST sys_siglist +#endif + #if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) # define ACE_HAS_BROKEN_THREAD_KEYFREE #endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/externals/ace/config-macosx-iphone-hardware.h b/externals/ace/config-macosx-iphone-hardware.h new file mode 100644 index 00000000000..6201d8e824b --- /dev/null +++ b/externals/ace/config-macosx-iphone-hardware.h @@ -0,0 +1,15 @@ +// $Id: config-macosx-iphone-hardware.h 88739 2010-01-27 05:35:23Z sowayaa $ +#ifndef ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H +#define ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H + +#define ACE_HAS_IPHONE +#define ACE_SIZEOF_LONG_DOUBLE 8 + +#include "ace/config-macosx-snowleopard.h" + +#ifdef ACE_HAS_SYSV_IPC +#undef ACE_HAS_SYSV_IPC +#endif + +#endif ACE_CONFIG_MACOSX_IPHONE_HARDWARE_H + diff --git a/externals/ace/config-macosx-iphone-simulator.h b/externals/ace/config-macosx-iphone-simulator.h new file mode 100644 index 00000000000..024cf8480a3 --- /dev/null +++ b/externals/ace/config-macosx-iphone-simulator.h @@ -0,0 +1,9 @@ +// $Id: config-macosx-iphone-simulator.h 88653 2010-01-21 23:19:50Z sowayaa $ +#ifndef ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H +#define ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H + +#define ACE_HAS_IPHONE +#include "ace/config-macosx-snowleopard.h" + +#endif ACE_CONFIG_MACOSX_IPHONE_SIMULATOR_H + diff --git a/dep/include/ace/config-macosx-leopard.h b/externals/ace/config-macosx-leopard.h similarity index 94% rename from dep/include/ace/config-macosx-leopard.h rename to externals/ace/config-macosx-leopard.h index 7351f938409..dfaaf870947 100644 --- a/dep/include/ace/config-macosx-leopard.h +++ b/externals/ace/config-macosx-leopard.h @@ -1,11 +1,16 @@ /* -*- C++ -*- */ -// $Id: config-macosx-leopard.h 81858 2008-06-07 03:31:22Z dai_y $ +// $Id: config-macosx-leopard.h 90343 2010-05-29 02:18:47Z wotte $ // This configuration file is designed to work with the MacOS X operating system. #ifndef ACE_CONFIG_MACOSX_LEOPARD_H #define ACE_CONFIG_MACOSX_LEOPARD_H +#define ACE_HAS_MAC_OSX +#define ACE_HAS_NET_IF_DL_H + +#define ACE_HAS_VOID_UNSETENV + #if ! defined (__ACE_INLINE__) #define __ACE_INLINE__ #endif /* ! __ACE_INLINE__ */ @@ -24,13 +29,15 @@ # include "ace/config-g++-common.h" #endif /* __GNUG__ */ +#define ACE_ISCTYPE_EQUIVALENT __isctype + #ifndef ACE_HAS_NONCONST_FD_ISSET #define ACE_HAS_NONCONST_FD_ISSET #endif #define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") +#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #if !defined (__i386__) # if defined (ACE_HAS_PENTIUM) @@ -58,6 +65,7 @@ #define ACE_HAS_WCHAR #define ACE_SIZEOF_WCHAR 4 + #define ACE_HAS_3_PARAM_WCSTOK #define ACE_LACKS_ITOW #define ACE_LACKS_WCSICMP @@ -82,9 +90,6 @@ //Platform supports sigsuspend() #define ACE_HAS_SIGSUSPEND -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - #define ACE_LACKS_GETPGID #define ACE_LACKS_RWLOCK_T @@ -93,9 +98,6 @@ #define ACE_HAS_NONCONST_SELECT_TIMEVAL -//? -#define ACE_LACKS_SIGSET - #define ACE_NEEDS_SCHED_H // Use of is deprecated. @@ -112,6 +114,7 @@ #define ACE_LACKS_STRRECVFD +#define ACE_HAS_SOCKADDR_IN_SIN_LEN #define ACE_HAS_SOCKADDR_IN6_SIN6_LEN // Platform supports System V IPC (most versions of UNIX, but not Win32) @@ -144,9 +147,6 @@ // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Compiler/platform provides the sockio.h file. #define ACE_HAS_SYS_SOCKIO_H @@ -202,6 +202,11 @@ #define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES #define ACE_LACKS_UNNAMED_SEMAPHORE +#if !defined (__DARWIN_UNIX03) +#define ACE_HAS_VOID_UNSETENV +#endif + + // dlcompat package (not part of base Darwin) is needed for dlopen(). // You may download directly from sourceforge and install or use fink // Fink installer puts libraries in /sw/lib and headers in /sw/include @@ -224,4 +229,3 @@ #endif /* __APPLE_CC__ */ #endif /* ACE_CONFIG_MACOSX_TIGER_H */ - diff --git a/dep/include/ace/config-macosx-panther.h b/externals/ace/config-macosx-panther.h similarity index 93% rename from dep/include/ace/config-macosx-panther.h rename to externals/ace/config-macosx-panther.h index e2b3361752f..4b131f9867a 100644 --- a/dep/include/ace/config-macosx-panther.h +++ b/externals/ace/config-macosx-panther.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-macosx-panther.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-macosx-panther.h 87167 2009-10-19 19:33:53Z olli $ // This configuration file is designed to work with the MacOS X operating system. @@ -15,7 +15,7 @@ #endif /* __GNUG__ */ #define ACE_LACKS_SUSECONDS_T -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") +#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #if defined (ACE_HAS_PENTIUM) # undef ACE_HAS_PENTIUM @@ -46,9 +46,6 @@ //Platform supports sigsuspend() #define ACE_HAS_SIGSUSPEND -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - //#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_LACKS_GETPGID #define ACE_LACKS_RWLOCK_T @@ -58,9 +55,6 @@ #define ACE_HAS_NONCONST_SELECT_TIMEVAL -//? -#define ACE_LACKS_SIGSET - #define ACE_NEEDS_SCHED_H // Use of is deprecated. @@ -113,9 +107,6 @@ // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Compiler/platform provides the sockio.h file. #define ACE_HAS_SYS_SOCKIO_H @@ -189,4 +180,3 @@ #endif /* __APPLE_CC__ */ #endif /* ACE_CONFIG_MACOSX_H */ - diff --git a/externals/ace/config-macosx-snowleopard.h b/externals/ace/config-macosx-snowleopard.h new file mode 100644 index 00000000000..f9b3522a5aa --- /dev/null +++ b/externals/ace/config-macosx-snowleopard.h @@ -0,0 +1,10 @@ +// $Id: config-macosx-snowleopard.h 87236 2009-10-27 08:21:42Z wotte $ +#ifndef ACE_CONFIG_MACOSX_SNOWLEOPARD_H +#define ACE_CONFIG_MACOSX_SNOWLEOPARD_H + +#include "ace/config-macosx-leopard.h" + +// This header has been deprecated in Snow Leopard. +#define ACE_LACKS_UCONTEXT_H + +#endif ACE_CONFIG_MACOSX_SNOWLEOPARD_H diff --git a/dep/include/ace/config-macosx-tiger.h b/externals/ace/config-macosx-tiger.h similarity index 94% rename from dep/include/ace/config-macosx-tiger.h rename to externals/ace/config-macosx-tiger.h index 447c834ac0c..f3d1ddcf8ad 100644 --- a/dep/include/ace/config-macosx-tiger.h +++ b/externals/ace/config-macosx-tiger.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-macosx-tiger.h 82344 2008-07-19 20:04:18Z johnnyw $ +// $Id: config-macosx-tiger.h 87167 2009-10-19 19:33:53Z olli $ // This configuration file is designed to work with the MacOS X operating system. @@ -26,7 +26,7 @@ #define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") +#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #if !defined (__i386__) # if defined (ACE_HAS_PENTIUM) @@ -51,6 +51,7 @@ #define ACE_HAS_WCHAR #define ACE_SIZEOF_WCHAR 4 + #define ACE_HAS_3_PARAM_WCSTOK #define ACE_LACKS_ITOW #define ACE_LACKS_WCSICMP @@ -75,9 +76,6 @@ //Platform supports sigsuspend() #define ACE_HAS_SIGSUSPEND -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - #define ACE_LACKS_GETPGID #define ACE_LACKS_RWLOCK_T @@ -86,9 +84,6 @@ #define ACE_HAS_NONCONST_SELECT_TIMEVAL -//? -#define ACE_LACKS_SIGSET - #define ACE_NEEDS_SCHED_H // Use of is deprecated. @@ -137,9 +132,6 @@ // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Compiler/platform provides the sockio.h file. #define ACE_HAS_SYS_SOCKIO_H @@ -211,9 +203,11 @@ // gperf seems to need this //#define ACE_HAS_NONSTATIC_OBJECT_MANAGER +#define ACE_LACKS_UNSETENV +#define ACE_LACKS_ISCTYPE + #if defined(__APPLE_CC__) && (__APPLE_CC__ < 1173) #error "Compiler must be upgraded, see http://developer.apple.com" #endif /* __APPLE_CC__ */ #endif /* ACE_CONFIG_MACOSX_TIGER_H */ - diff --git a/dep/include/ace/config-macosx.h b/externals/ace/config-macosx.h similarity index 93% rename from dep/include/ace/config-macosx.h rename to externals/ace/config-macosx.h index e8ec1af6e96..ae2552f14a2 100644 --- a/dep/include/ace/config-macosx.h +++ b/externals/ace/config-macosx.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-macosx.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-macosx.h 87167 2009-10-19 19:33:53Z olli $ // This configuration file is designed to work with the MacOS X operating system, version 10.2 (Jaguar). @@ -14,7 +14,7 @@ # include "ace/config-g++-common.h" #endif /* __GNUG__ */ -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") +#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #if defined (ACE_HAS_PENTIUM) # undef ACE_HAS_PENTIUM @@ -47,9 +47,6 @@ //Platform supports sigsuspend() #define ACE_HAS_SIGSUSPEND -//Platform/compiler has macros for sig{empty,fill,add,del}set (e.g., SCO and FreeBSD) -#define ACE_HAS_SIG_MACROS - //#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_LACKS_GETPGID #define ACE_LACKS_RWLOCK_T @@ -61,9 +58,6 @@ #define ACE_HAS_SYSCTL -//? -#define ACE_LACKS_SIGSET - #define ACE_NEEDS_SCHED_H // Use of is deprecated. @@ -115,9 +109,6 @@ // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Compiler/platform provides the sockio.h file. #define ACE_HAS_SYS_SOCKIO_H @@ -189,4 +180,3 @@ #endif /* __APPLE_CC__ */ #endif /* ACE_CONFIG_MACOSX_H */ - diff --git a/dep/include/ace/config-macros.h b/externals/ace/config-macros.h similarity index 97% rename from dep/include/ace/config-macros.h rename to externals/ace/config-macros.h index 5d1067e6c13..96a385e31a1 100644 --- a/dep/include/ace/config-macros.h +++ b/externals/ace/config-macros.h @@ -4,7 +4,7 @@ /** * @file config-macros.h * - * $Id: config-macros.h 82495 2008-08-04 07:23:01Z johnnyw $ + * $Id: config-macros.h 88485 2010-01-12 13:36:59Z schmidt $ * * @author (Originally in OS.h)Doug Schmidt * @author Jesper S. M|ller @@ -21,11 +21,7 @@ #ifndef ACE_CONFIG_MACROS_H #define ACE_CONFIG_MACROS_H -#ifdef _WIN32 -#include "ace/config-win32.h" -#else #include "ace/config.h" -#endif //_WIN32 #include "ace/Version.h" #include "ace/Versioned_Namespace.h" @@ -399,7 +395,7 @@ # endif /* ghs || __GNUC__ || ..... */ #endif /* !ACE_UNUSED_ARG */ -#if defined (_MSC_VER) || defined(__sgi) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (ACE_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || (defined (__HP_aCC) && (__HP_aCC >= 60500)) +#if defined (_MSC_VER) || defined(__sgi) || defined (ghs) || defined (__DECCXX) || defined(__BORLANDC__) || defined (ACE_RM544) || defined (__USLC__) || defined (__DCC__) || defined (__PGI) || defined (__TANDEM) || (defined (__HP_aCC) && (__HP_aCC < 40000 || __HP_aCC >= 60500)) # define ACE_NOTREACHED(a) #else /* __sgi || ghs || ..... */ # define ACE_NOTREACHED(a) a @@ -459,7 +455,8 @@ #if defined (ACE_WIN32) # define ACE_WIN32CALL_RETURN(X,TYPE,FAILVALUE) \ do { \ - TYPE ace_result_ = (TYPE) X; \ + TYPE ace_result_; \ + ace_result_ = (TYPE) X; \ if (ace_result_ == FAILVALUE) \ ACE_OS::set_errno_to_last_error (); \ return ace_result_; \ @@ -633,5 +630,22 @@ extern "C" u_long CLS##_Export _get_dll_unload_policy (void) \ #define ACE_PREPROC_CONCATENATE(A,B) ACE_PREPROC_CONCATENATE_IMPL(A,B) // ------------------------------------------------------------------- -#endif /* ACE_CONFIG_MACROS_H */ +/// If MPC is using a lib modifier this define will be set and this then +/// is used by the service configurator framework +#if defined MPC_LIB_MODIFIER && !defined (ACE_LD_DECORATOR_STR) +#define ACE_LD_DECORATOR_STR ACE_TEXT( MPC_LIB_MODIFIER ) +#endif /* MPC_LIB_MODIFIER */ +#ifndef ACE_GCC_CONSTRUCTOR_ATTRIBUTE +# define ACE_GCC_CONSTRUCTOR_ATTRIBUTE +#endif + +#ifndef ACE_GCC_DESTRUCTOR_ATTRIBUTE +# define ACE_GCC_DESTRUCTOR_ATTRIBUTE +#endif + +#ifndef ACE_DEPRECATED +# define ACE_DEPRECATED +#endif + +#endif /* ACE_CONFIG_MACROS_H */ diff --git a/dep/include/ace/config-minimal.h b/externals/ace/config-minimal.h similarity index 99% rename from dep/include/ace/config-minimal.h rename to externals/ace/config-minimal.h index 5766987f07d..4cf2e8a487b 100644 --- a/dep/include/ace/config-minimal.h +++ b/externals/ace/config-minimal.h @@ -37,4 +37,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_MINIMAL_H */ - diff --git a/dep/include/ace/config-mvs.h b/externals/ace/config-mvs.h similarity index 95% rename from dep/include/ace/config-mvs.h rename to externals/ace/config-mvs.h index 22ddffee139..3f438a776ba 100644 --- a/dep/include/ace/config-mvs.h +++ b/externals/ace/config-mvs.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-mvs.h 81992 2008-06-16 19:09:50Z wotte $ +// $Id: config-mvs.h 88495 2010-01-12 19:23:11Z olli $ // Config file for MVS with OpenEdition @@ -13,7 +13,6 @@ #define NSIG 44 /* missing from Signal.h */ #define MAXHOSTNAMELEN 256 /* missing form netdb.h */ #define howmany __howmany /* MVS uses different names than most others */ -#define fd_mask __fd_mask #define MAXNAMLEN __DIR_NAME_MAX #if defined (log) /* log is a macro in math.h */ # undef log /* conflicts with log function in ACE */ @@ -43,7 +42,6 @@ #define ERRMAX __sys_nerr #define ACE_HAS_3_PARAM_WCSTOK -#define ACE_HAS_BROKEN_CTIME #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT @@ -67,7 +65,6 @@ #define ACE_HAS_SOCKADDR_IN_SIN_LEN #define ACE_HAS_SIZET_SOCKET_LEN #define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR #define ACE_HAS_STRBUF_T #define ACE_HAS_STRINGS #define ACE_HAS_SYSV_IPC @@ -85,7 +82,6 @@ #define ACE_LACKS_CONDATTR_PSHARED #define ACE_LACKS_INET_ATON -#define ACE_LACKS_MSGBUF_T #define ACE_LACKS_MUTEXATTR_PSHARED #define ACE_LACKS_IOSTREAM_FX #define ACE_LACKS_LINEBUFFERED_STREAMBUF @@ -102,7 +98,6 @@ #define ACE_LACKS_SEMAPHORE_H #define ACE_LACKS_SIGINFO_H #define ACE_LACKS_STDINT_H -#define ACE_LACKS_SYS_NERR #define ACE_LACKS_SYS_SELECT_H #define ACE_LACKS_SYS_SYSCTL_H #define ACE_LACKS_SYSTIME_H @@ -111,6 +106,7 @@ #define ACE_LACKS_THREAD_PROCESS_SCOPING #define ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR #define ACE_LACKS_TIMESPEC_T +#define ACE_LACKS_FD_MASK #if !defined (ACE_MT_SAFE) # define ACE_MT_SAFE 1 @@ -129,4 +125,3 @@ #define IN_MULTICAST(a) IN_CLASSD(a) #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-netbsd.h b/externals/ace/config-netbsd.h similarity index 94% rename from dep/include/ace/config-netbsd.h rename to externals/ace/config-netbsd.h index b05b26e3963..07b26c9cc1c 100644 --- a/dep/include/ace/config-netbsd.h +++ b/externals/ace/config-netbsd.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-netbsd.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-netbsd.h 89494 2010-03-15 20:11:18Z olli $ #ifndef ACE_CONFIG_H #define ACE_CONFIG_H @@ -41,7 +41,6 @@ #define ACE_HAS_GETPROGNAME 1 #define ACE_HAS_GETRUSAGE 1 #define ACE_HAS_GETRUSAGE_PROTOTYPE 1 -#define ACE_HAS_GNU_CSTRING_H 1 #define ACE_HAS_GPERF 1 #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1 #define ACE_HAS_IP_MULTICAST 1 @@ -72,14 +71,12 @@ #define ACE_HAS_SSIZE_T 1 #define ACE_HAS_STANDARD_CPP_LIBRARY 1 #define ACE_HAS_STDEXCEPT_NO_H 1 -#define ACE_HAS_STRERROR 1 #define ACE_HAS_STRINGS 1 #define ACE_HAS_STRING_CLASS 1 #define ACE_HAS_SVR4_DYNAMIC_LINKING 1 #define ACE_HAS_SYSV_IPC 1 -#define ACE_HAS_SYS_ERRLIST 1 #define ACE_HAS_SYS_FILIO_H 1 -#define ACE_HAS_SYS_SIGLIST 1 +#define ACE_HAS_STRSIGNAL #define ACE_HAS_SYS_SOCKIO_H 1 #define ACE_HAS_SYS_SYSCALL_H 1 #define ACE_HAS_SYSCTL @@ -123,6 +120,7 @@ #define ACE_LACKS_WCSICMP 1 #define ACE_LACKS_WCSNICMP 1 #define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR 1 +#define ACE_LACKS_ISCTYPE #if defined(__x86_64__) #define ACE_SIZEOF_DOUBLE 8 @@ -138,8 +136,8 @@ typedef unsigned long ACE_UINT64; typedef signed long ACE_INT64; -#define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%ld") -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%lu") +#define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%ld" +#define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%lu" #elif defined(__i386__) @@ -165,4 +163,3 @@ typedef signed long long ACE_INT64; // Local Variables: // mode:C++ // End: - diff --git a/dep/include/ace/config-openbsd.h b/externals/ace/config-openbsd.h similarity index 54% rename from dep/include/ace/config-openbsd.h rename to externals/ace/config-openbsd.h index 10b4f268bcb..aab03106aab 100644 --- a/dep/include/ace/config-openbsd.h +++ b/externals/ace/config-openbsd.h @@ -1,235 +1,208 @@ /* -*- C++ -*- */ -// $Id: config-openbsd.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-openbsd.h 89494 2010-03-15 20:11:18Z olli $ // The following configuration file is designed to work for OpenBSD // platforms using GNU g++. #ifndef ACE_CONFIG_H -#define ACE_CONFIG_H +# define ACE_CONFIG_H #include /**/ "ace/pre.h" -#if defined (ACE_HAS_THREADS) -#include /**/ -#endif /* ACE_HAS_THREADS */ - -#include "ace/config-posix.h" - -#if ! defined (__ACE_INLINE__) -#define __ACE_INLINE__ -#endif /* ! __ACE_INLINE__ */ - -#define ACE_SIZEOF_LONG_DOUBLE 12 - -#if defined (__GNUG__) -# include "ace/config-g++-common.h" -#endif /* __GNUG__ */ - // Platform specific directives // gcc defines __OpenBSD__ automatically for us. #include #if defined (ACE_HAS_THREADS) -#if !defined (_THREAD_SAFE) -#define _THREAD_SAFE -#endif /* _THREAD_SAFE */ +# include /**/ +#endif /* ACE_HAS_THREADS */ + +#include "ace/config-posix.h" + +#if !defined (__ACE_INLINE__) +# define __ACE_INLINE__ +#endif /* !__ACE_INLINE__ */ + +#if defined (__GNUG__) +# include "ace/config-g++-common.h" +#endif /* __GNUG__ */ + + +#if defined (ACE_HAS_THREADS) + +# if !defined (_THREAD_SAFE) +# define _THREAD_SAFE +# endif /* _THREAD_SAFE */ + +// And they're even POSIX pthreads +# if !defined (ACE_MT_SAFE) +# define ACE_MT_SAFE 1 +# endif /* ! ACE_MT_SAFE */ + // Check if pthreads and native exceptions are being used together. // This causes SEGVs to tbe thrown somewhat randomly for some // reason. According to newsgroup postings, it appears to be an // OpenBSD or gcc bug. -#if defined (ACE_USES_NATIVE_EXCEPTIONS) -#error "OpenBSD pthreads and native exceptions currently do not work. See OpenBSD bug #1750" -#endif /* ACE_USES_NATIVE_EXCEPTIONS */ +# if defined (ACE_USES_NATIVE_EXCEPTIONS) +# error "OpenBSD pthreads and native exceptions currently do not work. See OpenBSD bug #1750" +# endif /* ACE_USES_NATIVE_EXCEPTIONS */ + +#else +// OpenBSD really has readdir_r () in single threaded mode, +// but the #ifdefs in OS.i select one with the wrong parameter +// sets if the ACE_HAS_POSIX_STD isn't defined (which is defined +// when ACE_HAS_THREADS is defined.) +# define ACE_LACKS_READDIR_R #endif /* ACE_HAS_THREADS */ -#define ACE_HAS_GPERF -// Platform specific directives -/* Are the following true? */ +#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R +#define ACE_HAS_3_PARAM_READDIR_R +#define ACE_HAS_3_PARAM_WCSTOK +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG +#define ACE_HAS_ALLOCA +#define ACE_HAS_ALT_CUSERID +#define ACE_HAS_AUTOMATIC_INIT_FINI +#define ACE_HAS_CHARPTR_DL +#define ACE_HAS_CLOCK_GETTIME +#define ACE_HAS_CLOCK_SETTIME +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +#define ACE_HAS_DIRENT +#define ACE_HAS_GETIFADDRS +#define ACE_HAS_GETPAGESIZE +#define ACE_HAS_GETRUSAGE +#define ACE_HAS_GPERF +#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT +#define ACE_HAS_ICMP_SUPPORT 1 +#define ACE_HAS_IPV6 +#define ACE_HAS_IP_MULTICAST +#define ACE_HAS_MEMCHR +#define ACE_HAS_MKDIR +#define ACE_HAS_MSG +#define ACE_HAS_NANOSLEEP +#define ACE_HAS_NEW_NO_H +#define ACE_HAS_NONCONST_MSGSND +#define ACE_HAS_NONCONST_SELECT_TIMEVAL +#define ACE_HAS_NONCONST_SWAB +#define ACE_HAS_POLL +#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 +#define ACE_HAS_POSIX_GETPWNAM_R +#define ACE_HAS_POSIX_NONBLOCK +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_PTHREADS_STD +#define ACE_HAS_PTHREADS_UNIX98_EXT +#define ACE_HAS_PTHREAD_ATTR_SETCREATESUSPEND_NP +#define ACE_HAS_PTHREAD_GETCONCURRENCY +#define ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP +#define ACE_HAS_PTHREAD_NP_H +#define ACE_HAS_PTHREAD_RESUME_NP +#define ACE_HAS_PTHREAD_SETCONCURRENCY +#define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE +#define ACE_HAS_PTHREAD_SUSPEND_NP +#define ACE_HAS_P_READ_WRITE +#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS +#define ACE_HAS_REENTRANT_FUNCTIONS +#define ACE_HAS_RTLD_LAZY_V +#define ACE_HAS_SCANDIR +#define ACE_HAS_SEMUN +#define ACE_HAS_SIGACTION_CONSTP2 +#define ACE_HAS_SIGINFO_T +#define ACE_HAS_SIGSUSPEND +#define ACE_HAS_SIGWAIT +#define ACE_HAS_SIG_ATOMIC_T +#define ACE_HAS_SIG_C_FUNC +#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN +#define ACE_HAS_SOCKADDR_IN_SIN_LEN +#define ACE_HAS_SOCKADDR_MSG_NAME +#define ACE_HAS_SOCKLEN_T +#define ACE_HAS_SSIZE_T +#define ACE_HAS_STRINGS +#define ACE_HAS_STRING_CLASS +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#define ACE_HAS_SVR4_SIGNAL_T +#define ACE_HAS_SYSCTL +#define ACE_HAS_SYSV_IPC +#define ACE_HAS_SYS_FILIO_H +#define ACE_HAS_STRSIGNAL +#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_TERMIOS +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_HAS_TIMEZONE_GETTIMEOFDAY +#define ACE_HAS_UALARM +#define ACE_HAS_VASPRINTF +#define ACE_HAS_VOIDPTR_MMAP +#define ACE_HAS_VOIDPTR_SOCKOPT +#define ACE_HAS_VOID_UNSETENV +#define ACE_HAS_WCHAR +#define ACE_HAS_XPG4_MULTIBYTE_CHAR + +#define ACE_LACKS_CONDATTR_PSHARED +#define ACE_LACKS_GETIPNODEBYADDR +#define ACE_LACKS_GETIPNODEBYNAME #define ACE_LACKS_GETPGID +#define ACE_LACKS_IOSTREAM_FX +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_ITOW +#define ACE_LACKS_LINEBUFFERED_STREAMBUF +#define ACE_LACKS_LOG2 +#define ACE_LACKS_MALLOC_H +#define ACE_LACKS_MSG_ACCRIGHTS +#define ACE_LACKS_MUTEXATTR_PSHARED +#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS +#define ACE_LACKS_PERFECT_MULTICAST_FILTERING +#define ACE_LACKS_PRI_T +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK +#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS +#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS +#define ACE_LACKS_RLIMIT_PROTOTYPE +#define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SETPGID #define ACE_LACKS_SETREGID #define ACE_LACKS_SETREUID +#define ACE_LACKS_SETSCHED +#define ACE_LACKS_SIGINFO_H +#define ACE_LACKS_STDINT_H +#define ACE_LACKS_STROPTS_H +#define ACE_LACKS_STRRECVFD +#define ACE_LACKS_TERMIO_H +#define ACE_LACKS_THREAD_PROCESS_SCOPING +#define ACE_LACKS_TIMEDWAIT_PROTOTYPES +#define ACE_LACKS_TIMESPEC_T +#define ACE_LACKS_UCONTEXT_H +#define ACE_LACKS_UNBUFFERED_STREAMBUF +#define ACE_LACKS_U_LONGLONG_T +#define ACE_LACKS_WCHAR_H +#define ACE_LACKS_WCSCASECMP +#define ACE_LACKS_WCSDUP +#define ACE_LACKS_WCSNCASECMP +#define ACE_LACKS_WCSNICMP -#define ACE_HAS_ALT_CUSERID -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS - -#define ACE_LACKS_RWLOCK_T -#define ACE_HAS_SIG_MACROS -#define ACE_HAS_CHARPTR_DL -#define ACE_HAS_DIRENT +#define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS +#define ACE_PAGE_SIZE 4096 +#define ACE_SCANDIR_CMP_USES_CONST_VOIDPTR +#define ACE_SCANDIR_SEL_LACKS_CONST // OpenBSD 3.6 #if (OpenBSD < 200411) # define ACE_USES_ASM_SYMBOL_IN_DLSYM #endif -#define ACE_LACKS_UCONTEXT_H - // ucontext_t is in OpenBSD 3.5 and later. #if (OpenBSD >= 200405) # define ACE_HAS_UCONTEXT_T #endif /* OpenBSD >= 200405 */ -// OpenBSD has sigwait defined -#define ACE_HAS_SIGWAIT -#define ACE_HAS_SIGINFO_T - -#define ACE_HAS_REENTRANT_FUNCTIONS -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS -#define ACE_LACKS_RAND_REENTRANT_FUNCTIONS -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R - -#define ACE_HAS_SOCKLEN_T - -#define ACE_HAS_POLL - -// Use of is deprecated. -#define ACE_LACKS_MALLOC_H - -// NetBSD appears to have a sigset_t type. -// #define ACE_LACKS_SIGSET - -// Platform supports POSIX timers via struct timespec. -#define ACE_HAS_POSIX_TIME -#define ACE_HAS_UALARM - -// Platform defines struct timespec but not timespec_t -#define ACE_LACKS_TIMESPEC_T - -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_WCHAR_H - -#define ACE_LACKS_STRRECVFD - -#define ACE_HAS_SOCKADDR_IN_SIN_LEN -#define ACE_HAS_SOCKADDR_IN6_SIN6_LEN - -// Platform supports System V IPC (most versions of UNIX, but not Win32) -#define ACE_HAS_SYSV_IPC - -// Compiler/platform contains the file. -#define ACE_HAS_SYS_SYSCALL_H - -// OpenBSD supports the getifaddrs interface -#define ACE_HAS_GETIFADDRS - -// Compiler/platform supports SVR4 signal typedef -#define ACE_HAS_SVR4_SIGNAL_T -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES - -// Compiler/platform supports alloca(). -// Although ACE does have alloca() on this compiler/platform combination, it is -// disabled by default since it can be dangerous. Uncomment the following line -// if you ACE to use it. -//#define ACE_HAS_ALLOCA - -// Compiler/platform supports SVR4 dynamic linking semantics.. -#define ACE_HAS_SVR4_DYNAMIC_LINKING - -// Compiler/platform correctly calls init()/fini() for shared libraries. -#define ACE_HAS_AUTOMATIC_INIT_FINI - -// Explicit dynamic linking permits "lazy" symbol resolution -#define ACE_HAS_RTLD_LAZY_V - -// platform supports POSIX O_NONBLOCK semantics -#define ACE_HAS_POSIX_NONBLOCK - -// platform supports IP multicast -#define ACE_HAS_IP_MULTICAST - // Lacks perfect filtering, must bind group address. #if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING -# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 +# define ACE_LACKS_PERFECT_MULTICAST_FILTERING #endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ -// Compiler/platform has -//#define ACE_HAS_ALLOCA_H - -// Compiler/platform has the getrusage() system call. -#define ACE_HAS_GETRUSAGE - -// Compiler/platform defines the sig_atomic_t typedef. -#define ACE_HAS_SIG_ATOMIC_T - -// Compiler/platform defines a union semun for SysV shared memory. -#define ACE_HAS_SEMUN - -// Compiler supports the ssize_t typedef. -#define ACE_HAS_SSIZE_T - -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - -// Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H - -// Defines the page size of the system. -#define ACE_PAGE_SIZE 4096 - -// Platform provides header. -#define ACE_HAS_SYS_FILIO_H - -#define ACE_HAS_SYSCTL - -// Platform/compiler supports timezone * as second parameter to gettimeofday(). -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY - // OpenBSD's dlsym call segfaults when passed an invalid handle. -// It seems as if most other OSs detect this and just report an -// error. +// It seems as if most other OSs detect this and just report an error. #define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE -#define ACE_HAS_MSG -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG -#define ACE_HAS_NONCONST_MSGSND - -#ifdef ACE_HAS_THREADS -// Thread specific settings - -// And they're even POSIX pthreads -#if !defined (ACE_MT_SAFE) -# define ACE_MT_SAFE 1 -#endif /* ! ACE_MT_SAFE */ -#endif /* ACE_HAS_THREADS */ - -#define ACE_HAS_SIGWAIT - -// Optimize ACE_Handle_Set for select(). -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT -#define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_LACKS_THREAD_PROCESS_SCOPING -#define ACE_LACKS_CONDATTR_PSHARED -#define ACE_LACKS_MUTEXATTR_PSHARED -#define ACE_HAS_THREAD_SPECIFIC_STORAGE -#define ACE_HAS_DIRENT - -#if !defined (ACE_HAS_THREADS) -// OpenBSD really has readdir_r () in single threaded mode, -// but the #ifdefs in OS.i select one with the wrong parameter -// sets if the ACE_HAS_POSIX_STD isn't defined (which is defined -// when ACE_HAS_THREADS is defined.) - -#define ACE_LACKS_READDIR_R - -#endif /* ! ACE_HAD_THREADS */ - -// Platform has POSIX terminal interface. -#define ACE_HAS_TERMIOS - -// OpenBSD 3.2 lacks sched_setscheduler (see /usr/src/lib/libc_r/TODO) -#define ACE_LACKS_SETSCHED - -// OpenBSD supports IPv6 by default, but ACE IPv6 code -// has compile errors. -//#define ACE_HAS_IPV6 - -#define ACE_HAS_3_PARAM_READDIR_R - #include /**/ "ace/post.h" -#endif /* ACE_CONFIG_H */ +#endif /* ACE_CONFIG_H */ diff --git a/dep/include/ace/config-openvms.h b/externals/ace/config-openvms.h similarity index 96% rename from dep/include/ace/config-openvms.h rename to externals/ace/config-openvms.h index 90541513f35..ac57aad9707 100644 --- a/dep/include/ace/config-openvms.h +++ b/externals/ace/config-openvms.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-openvms.h 81935 2008-06-12 22:01:53Z jtc $ +// $Id: config-openvms.h 87167 2009-10-19 19:33:53Z olli $ // The following configuration file is designed to work for OpenVMS 7.3-2 @@ -35,7 +35,6 @@ #include #include #include -#undef clearerr #undef memset #undef memcpy #undef memmove @@ -107,7 +106,6 @@ #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1 #define ACE_HAS_3_PARAM_WCSTOK 1 #define ACE_HAS_SIGSUSPEND 1 -#define ACE_HAS_SIG_MACROS 1 #define ACE_HAS_SIGWAIT 1 #define ACE_HAS_SIGTIMEDWAIT 1 @@ -115,7 +113,6 @@ #define ACE_HAS_SIGISMEMBER_BUG #define ACE_HAS_STRNLEN 1 #define ACE_HAS_STREAMS 1 -#define ACE_HAS_STRERROR 1 #define ACE_HAS_UALARM 1 #define ACE_HAS_VOIDPTR_MMAP 1 #define ACE_HAS_VOIDPTR_SOCKOPT 1 @@ -129,6 +126,7 @@ #define ACE_LACKS_SETSCHED #define ACE_LACKS_SYSCALL 1 #define ACE_LACKS_WCSTOULL 1 +#define ACE_LACKS_WCSTOLL /* (missing) standard data types */ #define ACE_LACKS_CONST_TIMESPEC_PTR 1 @@ -191,6 +189,10 @@ #define ACE_LACKS_UNIX_DOMAIN_SOCKETS 1 #define ACE_LACKS_UNIX_SYSLOG 1 #define ACE_LACKS_ALPHASORT 1 +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_ISBLANK + +#define ACE_LACKS_SETENV +#define ACE_LACKS_UNSETENV #endif - diff --git a/dep/include/ace/config-pharlap.h b/externals/ace/config-pharlap.h similarity index 96% rename from dep/include/ace/config-pharlap.h rename to externals/ace/config-pharlap.h index e0751c32f1c..dad0e91a913 100644 --- a/dep/include/ace/config-pharlap.h +++ b/externals/ace/config-pharlap.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-pharlap.h 81837 2008-06-04 22:48:08Z shuston $ +// $Id: config-pharlap.h 84373 2009-02-10 18:21:50Z johnnyw $ // This configuration file is for use with the PharLap Realtime ETS Kernel. // It has been tested with PharLap TNT Embedded ToolSuite version 9.1. @@ -23,6 +23,7 @@ // Fortunately, PharLap ETS offers much of the Win32 API. But it's still on // Winsock 1.1 #define ACE_HAS_WINSOCK2 0 +#define ACE_HAS_WINSOCK1 1 // The TSS implementation doesn't pass muster on the TSS_Test, but it works // well with ACE's TSS emulation. @@ -88,4 +89,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_PHARLAP_H */ - diff --git a/dep/include/ace/config-posix-nonetworking.h b/externals/ace/config-posix-nonetworking.h similarity index 99% rename from dep/include/ace/config-posix-nonetworking.h rename to externals/ace/config-posix-nonetworking.h index 492692179d8..7edc31d0dab 100644 --- a/dep/include/ace/config-posix-nonetworking.h +++ b/externals/ace/config-posix-nonetworking.h @@ -84,4 +84,3 @@ # define ACE_DISABLE_NOTIFY_PIPE_DEFAULT 1 #endif /* ACE_CONFIG_POSIX_NONETWORKING_H */ - diff --git a/dep/include/ace/config-posix.h b/externals/ace/config-posix.h similarity index 99% rename from dep/include/ace/config-posix.h rename to externals/ace/config-posix.h index a9cb744435b..09b4e0671f3 100644 --- a/dep/include/ace/config-posix.h +++ b/externals/ace/config-posix.h @@ -71,4 +71,3 @@ #endif /* _POSIX_MESSAGE_PASSING */ #endif /* ACE_CONFIG_POSIX_H */ - diff --git a/dep/include/ace/config-qnx-neutrino.h b/externals/ace/config-qnx-neutrino.h similarity index 96% rename from dep/include/ace/config-qnx-neutrino.h rename to externals/ace/config-qnx-neutrino.h index ef37758352a..86525567c38 100644 --- a/dep/include/ace/config-qnx-neutrino.h +++ b/externals/ace/config-qnx-neutrino.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-qnx-neutrino.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-qnx-neutrino.h 87167 2009-10-19 19:33:53Z olli $ // The following configuration file is designed to work for Neutrino // 2.0 (Beta) with GNU C++ and the POSIX (pthread) threads package. @@ -75,10 +75,8 @@ #define ACE_HAS_SIGISMEMBER_BUG #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_MACROS #define ACE_HAS_SOCKADDR_IN_SIN_LEN #define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR #define ACE_HAS_STRINGS #define ACE_HAS_SVR4_GETTIMEOFDAY #define ACE_HAS_TERMIOS @@ -106,7 +104,8 @@ #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SBRK #define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SOCKET_BUFSIZ +#define ACE_LACKS_SO_SNDBUF +#define ACE_LACKS_SO_RCVBUF #define ACE_LACKS_SOCKETPAIR #define ACE_LACKS_STROPTS_H #define ACE_LACKS_STREAM_MODULES @@ -135,4 +134,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-qnx-rtp-62x.h b/externals/ace/config-qnx-rtp-62x.h similarity index 95% rename from dep/include/ace/config-qnx-rtp-62x.h rename to externals/ace/config-qnx-rtp-62x.h index 5ad3326b412..7fa7514a1c8 100644 --- a/dep/include/ace/config-qnx-rtp-62x.h +++ b/externals/ace/config-qnx-rtp-62x.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-qnx-rtp-62x.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-qnx-rtp-62x.h 87167 2009-10-19 19:33:53Z olli $ // The following configuration file is designed to work for QNX RTP 621 // GNU C++ and the POSIX (pthread) threads package. You can get QNX // RTP at http://get.qnx.com @@ -51,11 +51,9 @@ #define ACE_HAS_SIGISMEMBER_BUG #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_MACROS #define ACE_HAS_SOCKADDR_IN_SIN_LEN #define ACE_HAS_SOCKLEN_T #define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR #define ACE_HAS_STRINGS #define ACE_HAS_SVR4_DYNAMIC_LINKING #define ACE_HAS_SVR4_GETTIMEOFDAY @@ -86,7 +84,8 @@ #define ACE_LACKS_POLL_H #define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_LACKS_RWLOCK_T -#define ACE_LACKS_SOCKET_BUFSIZ +#define ACE_LACKS_SO_SNDBUF +#define ACE_LACKS_SO_RCVBUF #define ACE_LACKS_STREAM_MODULES #define ACE_LACKS_STROPTS_H #define ACE_LACKS_STRPTIME @@ -99,6 +98,9 @@ #define ACE_LACKS_T_ERRNO #define ACE_LACKS_U_LONGLONG_T #define ACE_LACKS_ALPHASORT +#define ACE_LACKS_FD_MASK +#define ACE_LACKS_NFDBITS +#define ACE_LACKS_ISCTYPE #define ACE_LACKS_RLIMIT // QNX rlimit syscalls don't work properly with ACE. @@ -127,4 +129,3 @@ #define FD_SETSIZE 1000 #include /**/ "ace/post.h" #endif /* ACE_CONFIG_QNX_RTP_62x_H*/ - diff --git a/dep/include/ace/config-qnx-rtp-common.h b/externals/ace/config-qnx-rtp-common.h similarity index 86% rename from dep/include/ace/config-qnx-rtp-common.h rename to externals/ace/config-qnx-rtp-common.h index ee832adf604..79eb2397b4f 100644 --- a/dep/include/ace/config-qnx-rtp-common.h +++ b/externals/ace/config-qnx-rtp-common.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-qnx-rtp-common.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-qnx-rtp-common.h 85074 2009-04-10 03:17:24Z mesnier_p $ // several macros common to various qnx neutrino version. #ifndef ACE_CONFIG_QNX_RTP_COMMON_H @@ -42,6 +42,9 @@ #define ACE_SIZEOF_DOUBLE 8 #define ACE_SIZEOF_FLOAT 4 +// At least qnx 6.3.2 uses a void return for unsetenv +// This assumes that older versions do too. +#define ACE_HAS_VOID_UNSETENV + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_QNX_RTP_COMMON_H */ - diff --git a/dep/include/ace/config-qnx-rtp-pre62x.h b/externals/ace/config-qnx-rtp-pre62x.h similarity index 96% rename from dep/include/ace/config-qnx-rtp-pre62x.h rename to externals/ace/config-qnx-rtp-pre62x.h index af55eeb6cae..504d3a3ac09 100644 --- a/dep/include/ace/config-qnx-rtp-pre62x.h +++ b/externals/ace/config-qnx-rtp-pre62x.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-qnx-rtp-pre62x.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-qnx-rtp-pre62x.h 87167 2009-10-19 19:33:53Z olli $ // The following configuration file is designed to work for QNX RTP // GNU C++ and the POSIX (pthread) threads package. You can get QNX // RTP at http://get.qnx.com @@ -48,12 +48,10 @@ #define ACE_HAS_SIGISMEMBER_BUG #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SIG_MACROS #define ACE_HAS_SOCKADDR_IN_SIN_LEN // #define ACE_HAS_SIZET_SOCKET_LEN #define ACE_HAS_SOCKLEN_T #define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR #define ACE_HAS_STRINGS #define ACE_HAS_SVR4_GETTIMEOFDAY #define ACE_HAS_TERMIOS @@ -84,7 +82,8 @@ #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SBRK #define ACE_LACKS_SEEKDIR -#define ACE_LACKS_SOCKET_BUFSIZ +#define ACE_LACKS_SO_SNDBUF +#define ACE_LACKS_SO_RCVBUF #define ACE_LACKS_SOCKETPAIR // Even if the QNX RTP docs says that socket pair are // available, there is actually no implementation of @@ -105,6 +104,8 @@ #define ACE_LACKS_UCONTEXT_H #define ACE_LACKS_UNIX_DOMAIN_SOCKETS #define ACE_LACKS_U_LONGLONG_T +#define ACE_LACKS_FD_MASK +#define ACE_LACKS_NFDBITS #define ACE_LACKS_RLIMIT // QNX rlimit syscalls don't work properly with ACE. @@ -149,4 +150,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_RTP_PRE62x_H */ - diff --git a/dep/include/ace/config-qnx-rtp.h b/externals/ace/config-qnx-rtp.h similarity index 87% rename from dep/include/ace/config-qnx-rtp.h rename to externals/ace/config-qnx-rtp.h index a176efd8f3e..c55a4abb988 100644 --- a/dep/include/ace/config-qnx-rtp.h +++ b/externals/ace/config-qnx-rtp.h @@ -2,8 +2,8 @@ // $Id: config-qnx-rtp.h 80826 2008-03-04 14:51:23Z wotte $ // The following configuration file is designed to work for QNX RTP // GNU C++ and the POSIX (pthread) threads package. You can get QNX -// RTP at http://get.qnx.com. -// This header is intended to switch between configuration for +// RTP at http://get.qnx.com. +// This header is intended to switch between configuration for // various NTO versions. #ifndef ACE_CONFIG_QNX_RTP_H #define ACE_CONFIG_QNX_RTP_H @@ -23,4 +23,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_QNX_RTP_H */ - diff --git a/dep/include/ace/config-rtems.h b/externals/ace/config-rtems.h similarity index 97% rename from dep/include/ace/config-rtems.h rename to externals/ace/config-rtems.h index 558a6e1007c..d113a1434a4 100644 --- a/dep/include/ace/config-rtems.h +++ b/externals/ace/config-rtems.h @@ -1,5 +1,5 @@ /* -*- C -*- */ -// $Id: config-rtems.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-rtems.h 87169 2009-10-19 20:26:55Z olli $ /* The following configuration file is designed to work for RTEMS platforms using GNU C. @@ -59,6 +59,7 @@ #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS #define ACE_LACKS_REALPATH #define ACE_LACKS_TEMPNAM +#define ACE_LACKS_TZSET // Temporarily, enabling this results in compile errors with // rtems 4.6.6. @@ -97,9 +98,7 @@ #define ACE_HAS_SIGINFO_T #define ACE_HAS_SIGSUSPEND #define ACE_HAS_SSIZE_T -#define ACE_HAS_STRERROR #define ACE_HAS_VOIDPTR_GETTIMEOFDAY -#define ACE_HAS_SYS_ERRLIST #define ACE_HAS_SYS_FILIO_H #define ACE_HAS_TIMEZONE_GETTIMEOFDAY #define ACE_LACKS_EXEC @@ -163,4 +162,3 @@ #endif #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sco-5.0.0.h b/externals/ace/config-sco-5.0.0.h similarity index 90% rename from dep/include/ace/config-sco-5.0.0.h rename to externals/ace/config-sco-5.0.0.h index 35c33a43fad..61b68213bc1 100644 --- a/dep/include/ace/config-sco-5.0.0.h +++ b/externals/ace/config-sco-5.0.0.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-sco-5.0.0.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-sco-5.0.0.h 87167 2009-10-19 19:33:53Z olli $ #ifndef ACE_CONFIG_SCO_5_0_0_H #define ACE_CONFIG_SCO_5_0_0_H @@ -15,7 +15,6 @@ #endif /* SCO */ #define ACE_HAS_NONCONST_SELECT_TIMEVAL -#define ACE_HAS_SIG_MACROS #define ACE_LACKS_CONST_TIMESPEC_PTR #define ACE_LACKS_SYSCALL #define ACE_LACKS_STRRECVFD @@ -48,9 +47,6 @@ // Compiler/platform has correctly prototyped header files. #define ACE_HAS_CPLUSPLUS_HEADERS -// Header files lack t_errno for ACE_TLI. -//#define ACE_LACKS_T_ERRNO - // Compiler/platform supports poll(). // #define ACE_HAS_POLL @@ -66,9 +62,6 @@ // Defines the page size of the system. #define ACE_PAGE_SIZE 4096 -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - #define ACE_HAS_TIMEZONE_GETTIMEOFDAY // Note, this only works if the flag is set above! @@ -95,4 +88,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_SCO_5_0_0_H */ - diff --git a/dep/include/ace/config-suncc-common.h b/externals/ace/config-suncc-common.h similarity index 99% rename from dep/include/ace/config-suncc-common.h rename to externals/ace/config-suncc-common.h index 31d424d76b5..3f0bae8a295 100644 --- a/dep/include/ace/config-suncc-common.h +++ b/externals/ace/config-suncc-common.h @@ -65,4 +65,3 @@ #include /**/ "ace/post.h" #endif /* ACE_SUNCC_COMMON_H */ - diff --git a/dep/include/ace/config-sunos5.10.h b/externals/ace/config-sunos5.10.h similarity index 55% rename from dep/include/ace/config-sunos5.10.h rename to externals/ace/config-sunos5.10.h index 7ba78c2b3bd..df6f095fec9 100644 --- a/dep/include/ace/config-sunos5.10.h +++ b/externals/ace/config-sunos5.10.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-sunos5.10.h 81805 2008-05-30 10:14:59Z vzykov $ +// $Id: config-sunos5.10.h 89905 2010-04-16 13:04:47Z johnnyw $ // The following configuration file is designed to work for SunOS 5.10 // (Solaris 10) platforms using the SunC++ 5.x (Sun Studio 8-10), or g++ @@ -27,26 +27,40 @@ # undef ACE_LACKS_LOG2 #endif +// Solaris 10 offers a useable isblank() unlike previous Solaris versions. +#if defined (ACE_LACKS_ISBLANK) +# undef ACE_LACKS_ISBLANK +#endif + // Solaris 10 delivers pthread_attr_setstack #if defined (ACE_LACKS_PTHREAD_ATTR_SETSTACK) # undef ACE_LACKS_PTHREAD_ATTR_SETSTACK #endif // Solaris 10 introduced printf() modifiers for [s]size_t types. -#if defined (ACE_SSIZE_T_FORMAT_SPECIFIER) -# undef ACE_SSIZE_T_FORMAT_SPECIFIER -# define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%zd") -#endif /* ACE_SSIZE_T_FORMAT_SPECIFIER */ +#if defined (ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII) +# undef ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII +# define ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII "%zd" +#endif /* ACE_SSIZE_T_FORMAT_SPECIFIER_ASCII */ -#if defined (ACE_SIZE_T_FORMAT_SPECIFIER) -# undef ACE_SIZE_T_FORMAT_SPECIFIER -# define ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("%zu") -#endif /* ACE_SIZE_T_FORMAT_SPECIFIER */ +#if defined (ACE_SIZE_T_FORMAT_SPECIFIER_ASCII) +# undef ACE_SIZE_T_FORMAT_SPECIFIER_ASCII +# define ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "%zu" +#endif /* ACE_SIZE_T_FORMAT_SPECIFIER_ASCII */ -// Solaris 10 offers wcstoull() +// Solaris 10 offers wcstoll() and wcstoull() +#if defined (ACE_LACKS_WCSTOLL) +# undef ACE_LACKS_WCSTOLL +#endif /* ACE_LACKS_WCSTOLL */ #if defined (ACE_LACKS_WCSTOULL) # undef ACE_LACKS_WCSTOULL #endif /* ACE_LACKS_WCSTOULL */ -#endif /* ACE_CONFIG_H */ +#if defined (ACE_HAS_SCTP) && defined (ACE_HAS_LKSCTP) +# define ACE_HAS_VOID_PTR_SCTP_GETLADDRS +# define ACE_HAS_VOID_PTR_SCTP_GETPADDRS +#endif +#define ACE_HAS_SOLARIS_ATOMIC_LIB + +#endif /* ACE_CONFIG_H */ diff --git a/dep/include/ace/config-sunos5.11.h b/externals/ace/config-sunos5.11.h similarity index 99% rename from dep/include/ace/config-sunos5.11.h rename to externals/ace/config-sunos5.11.h index 3f78c9f94e6..bbfd91c82fe 100644 --- a/dep/include/ace/config-sunos5.11.h +++ b/externals/ace/config-sunos5.11.h @@ -13,4 +13,3 @@ #include "ace/config-sunos5.10.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.5.h b/externals/ace/config-sunos5.5.h similarity index 93% rename from dep/include/ace/config-sunos5.5.h rename to externals/ace/config-sunos5.5.h index d1148c6b0c3..f16b50394bd 100644 --- a/dep/include/ace/config-sunos5.5.h +++ b/externals/ace/config-sunos5.5.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-sunos5.5.h 81971 2008-06-16 12:15:00Z parsons $ +// $Id: config-sunos5.5.h 89494 2010-03-15 20:11:18Z olli $ // This configuration file is designed to work for SunOS 5.5 platforms // using the following compilers: @@ -24,10 +24,24 @@ // SunOS 5.5 does not provide getloadavg() #define ACE_LACKS_GETLOADAVG +// Some SunOS releases define _POSIX_PTHREAD_SEMANTICS automatically. +// We need to be check if the user has manually defined the macro before +// including . +#if defined (_POSIX_PTHREAD_SEMANTICS) +# define ACE_HAS_POSIX_PTHREAD_SEMANTICS +#endif /* _POSIX_PTHREAD_SEMANTICS */ + // Before we do anything, we should include to // ensure that things are set up properly. #include +// Some SunOS releases define _POSIX_PTHREAD_SEMANTICS automatically. +// We need to undef if the macro is set and not defined by the user. +#if defined (_POSIX_PTHREAD_SEMANTICS) && \ + !defined (ACE_HAS_POSIX_PTHREAD_SEMANTICS) +# undef _POSIX_PTHREAD_SEMANTICS +#endif /* _POSIX_PTHREAD_SEMANTICS && !ACE_HAS_POSIX_PTHREAD_SEMANTICS */ + // Sun has the posix defines so let this file sort out what Sun delivers #include "ace/config-posix.h" @@ -89,6 +103,7 @@ /* If you want to disable threading with Sun CC, remove -mt from your CFLAGS, e.g., using make threads=0. */ + // Take advantage of Sun Studio 8 (Sun C++ 5.5) or better symbol // visibility to generate improved shared library binaries. # if (__SUNPRO_CC > 0x540) @@ -115,10 +130,10 @@ // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so // this must appear before its #include. # define ACE_HAS_STRING_CLASS + # include "ace/config-g++-common.h" + # define ACE_HAS_HI_RES_TIMER - // Denotes that GNU has cstring.h as standard, to redefine memchr(). -# define ACE_HAS_GNU_CSTRING_H # define ACE_HAS_XPG4_MULTIBYTE_CHAR # if !defined (ACE_MT_SAFE) || ACE_MT_SAFE != 0 @@ -190,7 +205,7 @@ // Platform supports system configuration information. #define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO +#define ACE_HAS_SYSV_SYSINFO // Platform supports recvmsg and sendmsg. #define ACE_HAS_MSG @@ -263,9 +278,6 @@ // Platform supports STREAM pipes. #define ACE_HAS_STREAM_PIPES -// Compiler/platform supports strerror (). -#define ACE_HAS_STRERROR - // Compiler/platform supports struct strbuf. #define ACE_HAS_STRBUF_T @@ -281,8 +293,7 @@ // Platform provides header. #define ACE_HAS_SYS_FILIO_H -// Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST +#define ACE_HAS_STRSIGNAL // SunOS 5.5.x does not support mkstemp #define ACE_LACKS_MKSTEMP @@ -360,13 +371,14 @@ #define ACE_HAS_GETPAGESIZE 1 -#define ACE_HAS_STL_MAP_CONFLICT - #define ACE_HAS_IDTYPE_T #define ACE_HAS_GPERF #define ACE_HAS_DIRENT +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_ISBLANK + #if defined (__SUNPRO_CC) # define ACE_CC_NAME ACE_TEXT ("SunPro C++") # define ACE_CC_MAJOR_VERSION (__SUNPRO_CC >> 8) @@ -398,6 +410,7 @@ #define ACE_LACKS_INET_ATON // Solaris doesn't have wcstoull +#define ACE_LACKS_WCSTOLL #define ACE_LACKS_WCSTOULL #if defined (_LARGEFILE_SOURCE) || (_FILE_OFFSET_BITS==64) @@ -412,6 +425,8 @@ // Sum of the iov_len values can't be larger then SSIZE_MAX #define ACE_HAS_SOCK_BUF_SIZE_MAX +#define ACE_LACKS_SETENV +#define ACE_LACKS_UNSETENV + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.6.h b/externals/ace/config-sunos5.6.h similarity index 100% rename from dep/include/ace/config-sunos5.6.h rename to externals/ace/config-sunos5.6.h index 01855ba37c8..d100627a212 100644 --- a/dep/include/ace/config-sunos5.6.h +++ b/externals/ace/config-sunos5.6.h @@ -84,6 +84,7 @@ // SunOS 5.6 and above support mkstemp #undef ACE_LACKS_MKSTEMP + // SunOS 5.6 has AIO calls. #if !defined (ACE_HAS_AIO_CALLS) #define ACE_HAS_AIO_CALLS @@ -123,4 +124,3 @@ #endif /* _XPG4_2 */ #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.7.h b/externals/ace/config-sunos5.7.h similarity index 99% rename from dep/include/ace/config-sunos5.7.h rename to externals/ace/config-sunos5.7.h index b2b62b7e7bb..60e1d993a13 100644 --- a/dep/include/ace/config-sunos5.7.h +++ b/externals/ace/config-sunos5.7.h @@ -76,4 +76,3 @@ #define ACE_HAS_DEV_POLL #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.8.h b/externals/ace/config-sunos5.8.h similarity index 99% rename from dep/include/ace/config-sunos5.8.h rename to externals/ace/config-sunos5.8.h index 36ce6d4a81a..eb83e91490b 100644 --- a/dep/include/ace/config-sunos5.8.h +++ b/externals/ace/config-sunos5.8.h @@ -37,4 +37,3 @@ #define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-sunos5.9.h b/externals/ace/config-sunos5.9.h similarity index 83% rename from dep/include/ace/config-sunos5.9.h rename to externals/ace/config-sunos5.9.h index 39b5721b527..b8d09447eb2 100644 --- a/dep/include/ace/config-sunos5.9.h +++ b/externals/ace/config-sunos5.9.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-sunos5.9.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-sunos5.9.h 84213 2009-01-22 15:45:13Z johnnyw $ // The following configuration file is designed to work for SunOS 5.9 // (Solaris 9) platforms using the SunC++ 5.x (Forte 6 and 7), or g++ @@ -12,8 +12,7 @@ // #include the SunOS 5.8 config, then add any SunOS 5.9 updates below. #include "ace/config-sunos5.8.h" -#define ACE_HAS_SENDFILE +#define ACE_HAS_SENDFILE 1 #define ACE_LACKS_THR_CONCURRENCY_FUNCS #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-tandem-nsk-mips-v2.h b/externals/ace/config-tandem-nsk-mips-v2.h similarity index 94% rename from dep/include/ace/config-tandem-nsk-mips-v2.h rename to externals/ace/config-tandem-nsk-mips-v2.h index cb853c659f0..61747272087 100644 --- a/dep/include/ace/config-tandem-nsk-mips-v2.h +++ b/externals/ace/config-tandem-nsk-mips-v2.h @@ -1,6 +1,6 @@ // -*- C++ -*- // -// $Id: config-tandem-nsk-mips-v2.h 81935 2008-06-12 22:01:53Z jtc $ +// $Id: config-tandem-nsk-mips-v2.h 87167 2009-10-19 19:33:53Z olli $ #ifndef ACE_CONFIG_NSK_H #define ACE_CONFIG_NSK_H @@ -10,10 +10,12 @@ // The following configuration file contains defines for Tandem NSK // platform, MIPS processor, version 2 C++ compiler. + //========================================================================= // Tandem NSK specific parts //========================================================================= + // Disable pthread renaming of symbols such as "open" and "close" #define _CMA_NOWRAPPERS_ 1 @@ -29,6 +31,7 @@ // [@note this causes a significant performance degradation] //#define ACE_TANDEM_T1248_PTHREADS_ALL_IO_WRAPPERS + // Need this include here because some symbols defined by pthreads // (e.g. timespec_t) are needed before spthread.h is normally included // by ACE @@ -45,9 +48,6 @@ // note: on nsk TNS/R there is room in // sigset_t for 128 signals but those // above 31 are not valid. -typedef long fd_mask; // should be in select.h but no such file -#define NBBY 8 // must be consistent with value in sys/types.h -#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ #define MAXNAMLEN 248 // missing from dirent.h #define ERRMAX 4218 // from errno.h @@ -185,9 +185,6 @@ typedef enum CMA_T_SCHED_POLICY { // to make some ACE modifications.] //#define ACE_HAS_REGEX -// Compiler/platform supports strerror () -#define ACE_HAS_STRERROR - // Platform doesn't have truncate() #define ACE_LACKS_TRUNCATE @@ -210,14 +207,13 @@ typedef enum CMA_T_SCHED_POLICY { // Compile using multi-thread libraries #define ACE_MT_SAFE 1 + + // Platform supports System V IPC #define ACE_HAS_SYSV_IPC -// Platform lacks the socketpair() call -// [Needed due to failure of Pipe_Test. even though nsk platform -// has socketpair(), Pipe.cpp tries to set socket buf size but this -// is not allowed for AF_UNIX protocol on nsk.] -#define ACE_LACKS_SOCKET_BUFSIZ +#define ACE_LACKS_SO_SNDBUF +#define ACE_LACKS_SO_RCVBUF // Platform lacks the socketpair() call #define ACE_LACKS_SOCKETPAIR @@ -229,8 +225,8 @@ typedef enum CMA_T_SCHED_POLICY { #define ACE_HRTIME_T_IS_BASIC_TYPE // printf format specifiers for 64 bit integers -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") +# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Ld" +# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld" //========================================================================= // Threads specific parts @@ -280,6 +276,8 @@ typedef enum CMA_T_SCHED_POLICY { #define ACE_HAS_UCONTEXT_T #endif +#define ACE_LACKS_FD_MASK + //========================================================================= // Include file characteristics //========================================================================= @@ -311,6 +309,7 @@ typedef enum CMA_T_SCHED_POLICY { // Platform has (which contains bzero() prototype) #define ACE_HAS_STRINGS 1 + // OS/compiler omits the const from the iovec parameter in the // writev() prototype. #define ACE_HAS_NONCONST_WRITEV @@ -393,4 +392,3 @@ typedef enum CMA_T_SCHED_POLICY { #include /**/ "ace/post.h" #endif /* ACE_CONFIG_NSK_H */ - diff --git a/dep/include/ace/config-tandem-nsk-mips-v3.h b/externals/ace/config-tandem-nsk-mips-v3.h similarity index 95% rename from dep/include/ace/config-tandem-nsk-mips-v3.h rename to externals/ace/config-tandem-nsk-mips-v3.h index 88773d37f92..e6c05a890b1 100644 --- a/dep/include/ace/config-tandem-nsk-mips-v3.h +++ b/externals/ace/config-tandem-nsk-mips-v3.h @@ -1,6 +1,7 @@ // -*- C++ -*- // -// $Id: config-tandem-nsk-mips-v3.h 81935 2008-06-12 22:01:53Z jtc $ +// $Id: config-tandem-nsk-mips-v3.h 87167 2009-10-19 19:33:53Z olli $ + #ifndef ACE_CONFIG_NSK_H #define ACE_CONFIG_NSK_H @@ -10,10 +11,12 @@ // The following configuration file contains defines for Tandem NSK // platform, MIPS processor, version 3 C++ compiler. + //========================================================================= // Tandem NSK specific parts //========================================================================= + // Disable pthread renaming of symbols such as "open" and "close" #define _CMA_NOWRAPPERS_ 1 @@ -29,6 +32,7 @@ // [Note: this causes a significant performance degradation] //#define ACE_TANDEM_T1248_PTHREADS_ALL_IO_WRAPPERS + // Need this include here because some symbols defined by pthreads // (e.g. timespec_t) are needed before spthread.h is normally included // by ACE @@ -45,9 +49,6 @@ // note: on nsk TNS/R there is room in // sigset_t for 128 signals but those // above 31 are not valid. -typedef long fd_mask; // should be in select.h but no such file -#define NBBY 8 // must be consistent with value in sys/types.h -#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ #define MAXNAMLEN 248 // missing from dirent.h #define ERRMAX 4218 // from errno.h @@ -185,9 +186,6 @@ typedef enum CMA_T_SCHED_POLICY { // to make some ACE modifications.] //#define ACE_HAS_REGEX -// Compiler/platform supports strerror () -#define ACE_HAS_STRERROR - // Platform doesn't have truncate() #define ACE_LACKS_TRUNCATE @@ -210,14 +208,13 @@ typedef enum CMA_T_SCHED_POLICY { // Compile using multi-thread libraries #define ACE_MT_SAFE 1 + + // Platform supports System V IPC #define ACE_HAS_SYSV_IPC -// Platform lacks the socketpair() call -// [Needed due to failure of Pipe_Test. even though nsk platform -// has socketpair(), Pipe.cpp tries to set socket buf size but this -// is not allowed for AF_UNIX protocol on nsk.] -#define ACE_LACKS_SOCKET_BUFSIZ +#define ACE_LACKS_SO_SNDBUF +#define ACE_LACKS_SO_RCVBUF // Platform lacks the socketpair() call #define ACE_LACKS_SOCKETPAIR @@ -229,8 +226,8 @@ typedef enum CMA_T_SCHED_POLICY { #define ACE_HRTIME_T_IS_BASIC_TYPE // printf format specifiers for 64 bit integers -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%Ld") +# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Ld" +# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld" // Use larger default buffer size for ease of interoperability #define ACE_DEFAULT_CDR_BUFSIZE 4096 @@ -255,6 +252,9 @@ typedef enum CMA_T_SCHED_POLICY { // Platform lacks alphasort() #define ACE_LACKS_ALPHASORT +#define ACE_LACKS_FD_MASK +#define ACE_LACKS_NFDBITS + //========================================================================= // Threads specific parts //========================================================================= @@ -341,6 +341,7 @@ typedef enum CMA_T_SCHED_POLICY { // Platform has (which contains bzero() prototype) #define ACE_HAS_STRINGS 1 + // OS/compiler omits the const from the iovec parameter in the // writev() prototype. #define ACE_HAS_NONCONST_WRITEV @@ -432,6 +433,7 @@ typedef enum CMA_T_SCHED_POLICY { #define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class import$ SINGLETON_TYPE ; #endif + //========================================================================= // Build options //========================================================================= @@ -460,4 +462,3 @@ typedef enum CMA_T_SCHED_POLICY { #include /**/ "ace/post.h" #endif /* ACE_CONFIG_NSK_H */ - diff --git a/dep/include/ace/config-tandem.h b/externals/ace/config-tandem.h similarity index 97% rename from dep/include/ace/config-tandem.h rename to externals/ace/config-tandem.h index 2e1be04bc10..145c20abdaf 100644 --- a/dep/include/ace/config-tandem.h +++ b/externals/ace/config-tandem.h @@ -1,6 +1,6 @@ /* -*- C++ -*- */ // Testing TANDEM -// $Id: config-tandem.h 81697 2008-05-14 18:33:11Z johnnyw $ +// $Id: config-tandem.h 87167 2009-10-19 19:33:53Z olli $ // The following configuration file is designed to work for Tandems NonStop-UX // 4.2MP platforms using the NCC 3.20 compiler. @@ -41,7 +41,7 @@ //Platform supports system configuration information #define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO +#define ACE_HAS_SYSV_SYSINFO //Platform supports the POSIX regular expression library #define ACE_HAS_REGEX @@ -111,9 +111,6 @@ #define ACE_HAS_STREAM_PIPES //Platform supports STREAM pipes -//Compiler/platform supports strerror () -#define ACE_HAS_STRERROR - //Compiler/platform supports struct strbuf #define ACE_HAS_STRBUF_T @@ -142,6 +139,7 @@ // Platform lacks "signed char" type (broken!) #define ACE_LACKS_SIGNED_CHAR + #define ACE_PAGE_SIZE 4096 // Defines the page size of the system (not used on Win32 or // with ACE_HAS_GETPAGESIZE). @@ -171,6 +169,7 @@ //Platform uses non-const char * in calls to gethostbyaddr, gethostbyname, // getservbyname #define ACE_HAS_NONCONST_GETBY +#define ACE_HAS_NONCONST_INET_ADDR // Platform's select() uses non-const timeval* (only found on Linux right now) #define ACE_HAS_NONCONST_SELECT_TIMEVAL // And on Tandem :-) @@ -190,4 +189,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-tru64.h b/externals/ace/config-tru64.h similarity index 96% rename from dep/include/ace/config-tru64.h rename to externals/ace/config-tru64.h index db16845b529..45a7aa6bd53 100644 --- a/dep/include/ace/config-tru64.h +++ b/externals/ace/config-tru64.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-tru64.h 81935 2008-06-12 22:01:53Z jtc $ +// $Id: config-tru64.h 87270 2009-10-29 21:47:47Z olli $ // The following configuration file is designed to work for the // Digital UNIX V4.0a and later platforms. It relies on @@ -37,7 +37,6 @@ # include "ace/config-g++-common.h" -# define ACE_HAS_GNU_CSTRING_H # define ACE_HAS_REENTRANT_FUNCTIONS #elif defined (__DECCXX) @@ -60,7 +59,6 @@ #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R #define ACE_HAS_BROKEN_IF_HEADER -#define ACE_HAS_BROKEN_R_ROUTINES #if (ACE_MT_SAFE != 0) # define ACE_HAS_PTHREADS # define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS @@ -102,7 +100,6 @@ #define ACE_HAS_SSIZE_T #define ACE_HAS_STRBUF_T #define ACE_HAS_STREAMS -#define ACE_HAS_STRERROR #define ACE_HAS_STRPTIME #define ACE_HAS_SVR4_DYNAMIC_LINKING #define ACE_HAS_SVR4_SIGNAL_T @@ -152,4 +149,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_TRU64_H */ - diff --git a/dep/include/ace/config-unixware-7.1.0.h b/externals/ace/config-unixware-7.1.0.h similarity index 97% rename from dep/include/ace/config-unixware-7.1.0.h rename to externals/ace/config-unixware-7.1.0.h index 44eef5d5973..820e7fb763a 100644 --- a/dep/include/ace/config-unixware-7.1.0.h +++ b/externals/ace/config-unixware-7.1.0.h @@ -1,5 +1,5 @@ /* -*- C++ -*- */ -// $Id: config-unixware-7.1.0.h 82267 2008-07-08 16:39:19Z jtc $ +// $Id: config-unixware-7.1.0.h 87268 2009-10-29 21:06:06Z olli $ #ifndef ACE_CONFIG_H #define ACE_CONFIG_H @@ -107,9 +107,6 @@ the one in ace/OS.i. */ #define ACE_HAS_GETRUSAGE_PROTOTYPE 1 -/* Denotes that GNU has cstring.h as standard which redefines memchr() */ -#define ACE_HAS_GNU_CSTRING_H - /* The GPERF utility is compiled for this platform */ #define ACE_HAS_GPERF 1 @@ -147,6 +144,7 @@ #undef ACE_HAS_PENTIUM #endif /* ACE_HAS_PENTIUM */ + /* Platform contains */ #define ACE_HAS_POLL 1 @@ -228,9 +226,6 @@ /* Platform supports STREAM pipes */ #define ACE_HAS_STREAM_PIPES 1 -/* Compiler/platform supports strerror () */ -#define ACE_HAS_STRERROR 1 - /* Platform/Compiler supports a String class (e.g., GNU or Win32). */ #define ACE_HAS_STRING_CLASS 1 @@ -251,7 +246,7 @@ /* Platform supports system configuration information */ #define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO 1 +#define ACE_HAS_SYSV_SYSINFO 1 /* Platform supports System V IPC (most versions of UNIX, but not Win32) */ #define ACE_HAS_SYSV_IPC 1 @@ -409,4 +404,3 @@ #define __IOCTL_VERSIONED__ // By Carlo! #endif /* ACE_CONFIG_H */ - diff --git a/dep/include/ace/config-unixware-7.1.0.udk.h b/externals/ace/config-unixware-7.1.0.udk.h similarity index 98% rename from dep/include/ace/config-unixware-7.1.0.udk.h rename to externals/ace/config-unixware-7.1.0.udk.h index fc6006889e9..ec668c19581 100644 --- a/dep/include/ace/config-unixware-7.1.0.udk.h +++ b/externals/ace/config-unixware-7.1.0.udk.h @@ -2,7 +2,7 @@ #ifndef ACE_CONFIG_UNIXWARE_UDK_H #define ACE_CONFIG_UNIXWARE_UDK_H -// $Id: config-unixware-7.1.0.udk.h 82267 2008-07-08 16:39:19Z jtc $ +// $Id: config-unixware-7.1.0.udk.h 87167 2009-10-19 19:33:53Z olli $ // Configuration for the unixware UDK compiler. derived from the unixware/g++ config // which was itself derived from an autoconfig run. @@ -54,6 +54,8 @@ # define PTHREAD_MAX_PRIORITY ACE_THREAD_MAX_PRIORITY #endif /* #if defined (ACE_THREAD_MAX_PRIORITY) */ + + /* UnixWare specific configuration parameters */ /* #undef UNIXWARE */ /* #undef UNIXWARE_2_0 */ @@ -101,6 +103,7 @@ /* Staller: oh yes, let's do this! */ #define ACE_HAS_BROKEN_MAP_FAILED + /* Prototypes for both signal() and struct sigaction are consistent. */ #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 @@ -168,6 +171,7 @@ /* Uses ctime_r & asctime_r with only two parameters vs. three. */ #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R + /* Platform is an Intel Pentium microprocessor. */ /* There is a problem with the gethrtime() because of (apparently) a problem with the inline assembly instruction. Hopefully there is a way to resolve @@ -177,6 +181,7 @@ //#undef ACE_HAS_PENTIUM #endif /* ACE_HAS_PENTIUM */ + /* Platform contains */ #define ACE_HAS_POLL @@ -264,9 +269,6 @@ /* Platform supports STREAM pipes */ #define ACE_HAS_STREAM_PIPES -/* Compiler/platform supports strerror () */ -#define ACE_HAS_STRERROR - /* Platform/Compiler supports a String class (e.g., GNU or Win32). */ #define ACE_HAS_STRING_CLASS @@ -287,7 +289,7 @@ /* Platform supports system configuration information */ #define ACE_HAS_SYS_SYSTEMINFO_H -#define ACE_HAS_SYSINFO 1 +#define ACE_HAS_SYSV_SYSINFO 1 /* Platform supports System V IPC (most versions of UNIX, but not Win32) */ #define ACE_HAS_SYSV_IPC 1 @@ -453,4 +455,3 @@ #define __IOCTL_VERSIONED__ // By Carlo! #endif /* ACE_UNIXWARE_UDK_H */ - diff --git a/dep/include/ace/config-visualage.h b/externals/ace/config-visualage.h similarity index 99% rename from dep/include/ace/config-visualage.h rename to externals/ace/config-visualage.h index 6d967b52217..4cef8108bc5 100644 --- a/dep/include/ace/config-visualage.h +++ b/externals/ace/config-visualage.h @@ -18,4 +18,3 @@ #include /**/ "ace/post.h" #endif //CONFIG_VISUALAGE_H - diff --git a/dep/include/ace/config-vxworks.h b/externals/ace/config-vxworks.h similarity index 76% rename from dep/include/ace/config-vxworks.h rename to externals/ace/config-vxworks.h index 52c2958654d..fd4e04193c0 100644 --- a/dep/include/ace/config-vxworks.h +++ b/externals/ace/config-vxworks.h @@ -1,5 +1,5 @@ //* -*- C++ -*- */ -// $Id: config-vxworks.h 81046 2008-03-21 10:11:12Z johnnyw $ +// $Id: config-vxworks.h 87036 2009-10-10 18:21:39Z johnnyw $ // The following configuration file is designed to work for VxWorks // Based on ACE_VXWORKS it will select the correct config file @@ -29,28 +29,29 @@ # define ACE_VXWORKS 0x650 # elif (_WRS_VXWORKS_MINOR == 6) # define ACE_VXWORKS 0x660 +# elif (_WRS_VXWORKS_MINOR == 7) +# define ACE_VXWORKS 0x670 +# elif (_WRS_VXWORKS_MINOR == 8) +# define ACE_VXWORKS 0x680 # endif # endif # endif #endif /* ! ACE_VXWORKS */ -#if (ACE_VXWORKS == 0x551) -# include "ace/config-vxworks5.x.h" -#elif (ACE_VXWORKS == 0x620) -# include "ace/config-vxworks6.2.h" -#elif (ACE_VXWORKS == 0x630) -# include "ace/config-vxworks6.3.h" -#elif (ACE_VXWORKS == 0x640) +#if (ACE_VXWORKS == 0x640) # include "ace/config-vxworks6.4.h" #elif (ACE_VXWORKS == 0x650) # include "ace/config-vxworks6.5.h" #elif (ACE_VXWORKS == 0x660) # include "ace/config-vxworks6.6.h" +#elif (ACE_VXWORKS == 0x670) +# include "ace/config-vxworks6.7.h" +#elif (ACE_VXWORKS == 0x680) +# include "ace/config-vxworks6.8.h" #else -#error Unknown VxWorks version +#error Unknown or unsupported VxWorks version #endif #include /**/ "ace/post.h" #endif /* ACE_CONFIG_VXWORKS_H */ - diff --git a/dep/include/ace/config-vxworks6.4.h b/externals/ace/config-vxworks6.4.h similarity index 95% rename from dep/include/ace/config-vxworks6.4.h rename to externals/ace/config-vxworks6.4.h index 80c28ab624c..d1fad781985 100644 --- a/dep/include/ace/config-vxworks6.4.h +++ b/externals/ace/config-vxworks6.4.h @@ -1,5 +1,5 @@ //* -*- C++ -*- */ -// $Id: config-vxworks6.4.h 81850 2008-06-06 08:39:54Z vzykov $ +// $Id: config-vxworks6.4.h 89494 2010-03-15 20:11:18Z olli $ // The following configuration file is designed to work for VxWorks // 6.4 platforms using one of these compilers: @@ -72,7 +72,7 @@ #if !defined __RTP__ # if defined (TOOL) && (TOOL == gnu) -# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603) +# if defined (CPU) && (CPU == PPC85XX || CPU == PPC604 || CPU == PPC603 || CPU == PPC32) // These PPC's do lack log2 in kernel mode # define ACE_LACKS_LOG2 # endif @@ -83,7 +83,10 @@ #define ACE_HAS_4_4BSD_SENDMSG_RECVMSG #define ACE_HAS_3_PARAM_READDIR_R #define ACE_HAS_NONCONST_GETBY +#define ACE_HAS_NONCONST_INET_ADDR #define ACE_HAS_NONCONST_SWAB +#define ACE_USES_INETLIB_H +#define ACE_USES_SELECTLIB_H #define ACE_LACKS_UNIX_SYSLOG #define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 #define ACE_DEFAULT_THREAD_KEYS 16 @@ -96,7 +99,6 @@ #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT -#define ACE_HAS_DLL 0 #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_MSG #define ACE_HAS_NONCONST_READV @@ -111,7 +113,6 @@ #define ACE_HAS_SIG_ATOMIC_T #define ACE_HAS_SOCKADDR_IN_SIN_LEN #define ACE_HAS_SOCKADDR_IN6_SIN6_LEN -#define ACE_HAS_STRERROR #define ACE_HAS_THREADS #define ACE_HAS_SYSCTL #define ACE_LACKS_ALPHASORT @@ -192,11 +193,14 @@ #define ACE_LACKS_WCSDUP #define ACE_LACKS_WCSICMP #define ACE_LACKS_WCSNICMP +#define ACE_LACKS_STRTOLL +#define ACE_LACKS_WCSTOLL #define ACE_LACKS_STRTOULL #define ACE_LACKS_WCSTOULL #define ACE_HAS_CHARPTR_SOCKOPT #define ACE_LACKS_SYMLINKS +#define ACE_LACKS_ISCTYPE #if defined __RTP__ // We are building for RTP mode @@ -223,8 +227,11 @@ #if !defined (IOV_MAX) || (IOV_MAX == 0) #define ACE_IOV_MAX 16 #endif + #define ACE_LACKS_ISASCII #else // We are building for kernel mode + #define ACE_LACKS_SETENV + #define ACE_LACKS_UNSETENV #define ACE_LACKS_SUSECONDS_T #define ACE_LACKS_INTPTR_T #define ACE_LACKS_INTTYPES_H @@ -273,6 +280,9 @@ #if !defined (ACE_MAIN) # define ACE_MAIN ace_main #endif /* ! ACE_MAIN */ + #define ACE_LACKS_TZSET + #define ACE_LACKS_ISWCTYPE + #define ACE_LACKS_ISBLANK #endif // It is possible to enable pthread support with VxWorks, when the user decides @@ -338,4 +348,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_VXWORKS_6_4_H */ - diff --git a/dep/include/ace/config-vxworks6.5.h b/externals/ace/config-vxworks6.5.h similarity index 99% rename from dep/include/ace/config-vxworks6.5.h rename to externals/ace/config-vxworks6.5.h index d40f695774c..19273e6cad4 100644 --- a/dep/include/ace/config-vxworks6.5.h +++ b/externals/ace/config-vxworks6.5.h @@ -23,4 +23,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_VXWORKS_6_5_H */ - diff --git a/dep/include/ace/config-vxworks6.6.h b/externals/ace/config-vxworks6.6.h similarity index 78% rename from dep/include/ace/config-vxworks6.6.h rename to externals/ace/config-vxworks6.6.h index a2058aa51c3..eebce4432b6 100644 --- a/dep/include/ace/config-vxworks6.6.h +++ b/externals/ace/config-vxworks6.6.h @@ -1,5 +1,5 @@ //* -*- C++ -*- */ -// $Id: config-vxworks6.6.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: config-vxworks6.6.h 85143 2009-04-22 09:15:08Z johnnyw $ // The following configuration file is designed to work for VxWorks // 6.6 platforms using one of these compilers: @@ -22,9 +22,13 @@ #if !defined (__RTP__) # undef ACE_HAS_IOCTL_INT_3_PARAM +# define ACE_HAS_TASKCPUAFFINITYSET #endif +#define ACE_HAS_VXATOMICLIB +#define ACE_HAS_CPUSET_T +#define ACE_HAS_VXCPULIB + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_VXWORKS_6_6_H */ - diff --git a/externals/ace/config-vxworks6.7.h b/externals/ace/config-vxworks6.7.h new file mode 100644 index 00000000000..eab429a2e94 --- /dev/null +++ b/externals/ace/config-vxworks6.7.h @@ -0,0 +1,23 @@ +//* -*- C++ -*- */ +// $Id: config-vxworks6.7.h 84971 2009-03-25 13:03:44Z johnnyw $ + +// The following configuration file is designed to work for VxWorks +// 6.7 platforms using one of these compilers: +// 1) The GNU g++ compiler that is shipped with VxWorks 6.7 +// 2) The Diab compiler that is shipped with VxWorks 6.7 + +#ifndef ACE_CONFIG_VXWORKS_6_7_H +#define ACE_CONFIG_VXWORKS_6_7_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_VXWORKS) +# define ACE_VXWORKS 0x670 +#endif /* ! ACE_VXWORKS */ + +#include "ace/config-vxworks6.6.h" + +#undef ACE_HAS_NONCONST_INET_ADDR + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_VXWORKS_6_7_H */ + diff --git a/externals/ace/config-vxworks6.8.h b/externals/ace/config-vxworks6.8.h new file mode 100644 index 00000000000..ecad4752d95 --- /dev/null +++ b/externals/ace/config-vxworks6.8.h @@ -0,0 +1,21 @@ +//* -*- C++ -*- */ +// $Id: config-vxworks6.8.h 87036 2009-10-10 18:21:39Z johnnyw $ + +// The following configuration file is designed to work for VxWorks +// 6.8 platforms using one of these compilers: +// 1) The GNU g++ compiler that is shipped with VxWorks 6.8 +// 2) The Diab compiler that is shipped with VxWorks 6.8 + +#ifndef ACE_CONFIG_VXWORKS_6_8_H +#define ACE_CONFIG_VXWORKS_6_8_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_VXWORKS) +# define ACE_VXWORKS 0x680 +#endif /* ! ACE_VXWORKS */ + +#include "ace/config-vxworks6.7.h" + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_VXWORKS_6_8_H */ + diff --git a/dep/include/ace/config-win32-borland.h b/externals/ace/config-win32-borland.h similarity index 53% rename from dep/include/ace/config-win32-borland.h rename to externals/ace/config-win32-borland.h index 371919cfdc4..c3ae460482b 100644 --- a/dep/include/ace/config-win32-borland.h +++ b/externals/ace/config-win32-borland.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//$Id: config-win32-borland.h 82643 2008-08-19 14:02:12Z johnnyw $ +//$Id: config-win32-borland.h 89292 2010-03-04 08:06:15Z johnnyw $ // The following configuration file contains defines for Borland compilers. @@ -11,7 +11,35 @@ #error Use config-win32.h in config.h instead of this header #endif /* ACE_CONFIG_WIN32_H */ -#include "config-borland-common.h" +#define ACE_HAS_CUSTOM_EXPORT_MACROS +#define ACE_Proper_Export_Flag __declspec (dllexport) +#define ACE_Proper_Import_Flag __declspec (dllimport) +#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T +#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; +#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class __declspec (dllimport) T +#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllimport) SINGLETON_TYPE ; + +// In later versions of C++Builder we will prefer inline functions by +// default. The debug configuration of ACE is built with functions +// out-of-line, so when linking your application against a debug ACE +// build, you can choose to use the out-of-line functions by adding +// ACE_NO_INLINE=1 to your project settings. +# if !defined (__ACE_INLINE__) +# define __ACE_INLINE__ 1 +# endif /* __ACE_INLINE__ */ + +# define ACE_CC_NAME ACE_TEXT ("Embarcadero C++ Builder") +# define ACE_CC_MAJOR_VERSION (__BORLANDC__ / 0x100) +# define ACE_CC_MINOR_VERSION (__BORLANDC__ % 0x100) +# define ACE_CC_BETA_VERSION (0) + +#ifndef ACE_USING_MCPP_PREPROCESSOR +# if (__BORLANDC__ >= 0x620) +# define ACE_CC_PREPROCESSOR_ARGS "-q -Sl -o%s" +# else +# define ACE_CC_PREPROCESSOR_ARGS "-q -P- -o%s" +# endif +#endif // Automatically define WIN32 macro if the compiler tells us it is our // target platform. @@ -30,16 +58,10 @@ # include "ace/config-win32-common.h" -// Borland on win32 has swab -# undef ACE_LACKS_SWAB - # define ACE_WSTRING_HAS_USHORT_SUPPORT 1 # define ACE_HAS_DIRENT -#ifdef ACE_USES_STD_NAMESPACE_FOR_STDC_LIB -#undef ACE_USES_STD_NAMESPACE_FOR_STDC_LIB #define ACE_USES_STD_NAMESPACE_FOR_STDC_LIB 1 -#endif #define ACE_NEEDS_DL_UNDERSCORE @@ -84,6 +106,29 @@ #define ACE_LACKS_STRRECVFD #define ACE_USES_EXPLICIT_STD_NAMESPACE +#define ACE_HAS_TIME_T_LONG_MISMATCH + +#define ACE_EXPORT_NESTED_CLASSES 1 +#define ACE_HAS_CPLUSPLUS_HEADERS 1 +#define ACE_HAS_EXCEPTIONS +#define ACE_HAS_NONCONST_SELECT_TIMEVAL +#define ACE_HAS_SIG_ATOMIC_T +#define ACE_HAS_STANDARD_CPP_LIBRARY 1 +#define ACE_HAS_STDCPP_STL_INCLUDES 1 +#define ACE_HAS_STRING_CLASS 1 +#define ACE_HAS_TEMPLATE_TYPEDEFS 1 +#define ACE_HAS_USER_MODE_MASKS 1 +#define ACE_LACKS_ACE_IOSTREAM 1 +#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 +#define ACE_HAS_NEW_NOTHROW +#define ACE_TEMPLATES_REQUIRE_SOURCE 1 +#define ACE_SIZEOF_LONG_DOUBLE 10 +#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Lu" +#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%Ld" +#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 +#define ACE_USES_STD_NAMESPACE_FOR_ABS 1 +#define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) + #if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) // must have _MT defined to include multithreading // features from win32 headers @@ -95,19 +140,16 @@ # endif /* !_MT && !ACE_HAS_WINCE */ #endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ -#if (__BORLANDC__ < 0x580) -# define ACE_LACKS_INTPTR_T -# define ACE_HAS_NONCONST_SWAB -# define ACE_HAS_NONCONST_FDOPEN +#if (__BORLANDC__ < 0x620) +# define ACE_LACKS_ISBLANK +# define ACE_LACKS_ISWBLANK +# define ACE_LACKS_PRAGMA_ONCE 1 #endif -#if (__BORLANDC__ < 0x610) -# define ACE_HAS_NONCONST_TEMPNAM -# define ACE_LACKS_STRTOULL -# define ACE_LACKS_WCSTOULL -#endif +#define ACE_LACKS_ISWCTYPE +#define ACE_LACKS_ISCTYPE -#if (__BORLANDC__ <= 0x610) +#if (__BORLANDC__ < 0x620) // Older Borland compilers can't handle assembly in inline methods or // templates (E2211). When we build for pentium optimized and we are inlining // then we disable inline assembly @@ -116,11 +158,17 @@ # endif #endif +#if (__BORLANDC__ == 0x621) +// C++ Builder 2010 wcsncat seems broken +# define ACE_LACKS_WCSNCAT +#endif + #define ACE_WCSDUP_EQUIVALENT ::_wcsdup #define ACE_STRCASECMP_EQUIVALENT ::stricmp #define ACE_STRNCASECMP_EQUIVALENT ::strnicmp +#define ACE_WTOF_EQUIVALENT ::_wtof +#define ACE_FILENO_EQUIVALENT(X) (_get_osfhandle (::_fileno (X))) #define ACE_HAS_ITOA 1 #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_BORLAND_H */ - diff --git a/externals/ace/config-win32-cegcc.h b/externals/ace/config-win32-cegcc.h new file mode 100644 index 00000000000..c29290d713f --- /dev/null +++ b/externals/ace/config-win32-cegcc.h @@ -0,0 +1,113 @@ +// -*- C++ -*- +// $Id: config-win32-cegcc.h 87167 2009-10-19 19:33:53Z olli $ + +// +// The following configuration file is designed to work for win32 +// platforms using gcc/g++ with mingw32 (http://www.mingw.org). +// + +#ifndef ACE_CONFIG_WIN32_CEGCC_H +#define ACE_CONFIG_WIN32_CEGCC_H +#include /**/ "ace/pre.h" + +#ifndef ACE_CONFIG_WIN32_H +# error Use config-win32.h in config.h instead of this header +#endif /* ACE_CONFIG_WIN32_H */ + +#define ACE_CC_NAME ACE_TEXT ("g++") +#define ACE_CC_PREPROCESSOR "cpp" +#define ACE_CC_PREPROCESOR_ARGS "" + +// Why all this is not in config-g++-common.h? +#define ACE_CC_MAJOR_VERSION __GNUC__ +#define ACE_CC_MINOR_VERSION __GNUC_MINOR__ +#define ACE_CC_BETA_VERSION (0) + +#if !defined (ACE_HAS_CEGCC) +# error You do not seem to be using cegcc +#endif + +// We trust the user: He must have used -mpentiumpro or -mpentium +// if that is what he wants. +#if defined(pentiumpro) || defined(pentium) +# define ACE_HAS_PENTIUM +#endif + +#include "ace/config-g++-common.h" + +#include /**/ +#include /**/ +#include /**/ <_mingw.h> + +#if (__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 15)) +# undef ACE_LACKS_USECONDS_T +#endif + +#define ACE_HAS_USER_MODE_MASKS + +#define ACE_HAS_SSIZE_T +#undef ACE_LACKS_STRUCT_DIR +#undef ACE_LACKS_OPENDIR +#undef ACE_LACKS_CLOSEDIR +#undef ACE_LACKS_READDIR +#undef ACE_LACKS_TELLDIR +#undef ACE_LACKS_SEEKDIR +#undef ACE_LACKS_REWINDDIR + +#undef ACE_HAS_WTOF + +#define ACE_LACKS_SYS_SHM_H +#define ACE_LACKS_TERMIOS_H +#define ACE_LACKS_NETINET_TCP_H +#define ACE_LACKS_STRRECVFD +#define ACE_LACKS_STRPTIME +#define ACE_LACKS_POLL_H +#define ACE_LACKS_REGEX_H +#define ACE_LACKS_SYS_MSG_H +#define ACE_LACKS_PWD_H +#define ACE_LACKS_SEMAPHORE_H +#define ACE_LACKS_UCONTEXT_H +#define ACE_LACKS_SYS_SELECT_H +#define ACE_LACKS_SYS_RESOURCE_H +#define ACE_LACKS_SYS_WAIT_H +#define ACE_LACKS_DLFCN_H +#define ACE_LACKS_SYS_MMAN_H +#define ACE_LACKS_SYS_UIO_H +#define ACE_LACKS_SYS_SOCKET_H +#define ACE_LACKS_NETINET_IN_H +#define ACE_LACKS_NETDB_H +#define ACE_LACKS_NET_IF_H +#define ACE_LACKS_SYS_IPC_H +#define ACE_LACKS_SYS_SEM_H +#define ACE_LACKS_STROPTS_H +#define ACE_LACKS_SYS_IOCTL_H +#define ACE_LACKS_PDH_H +#define ACE_LACKS_PDHMSG_H +#define ACE_HAS_NONCONST_WCSDUP +#define ACE_HAS_WINSOCK2_GQOS +#define ACE_LACKS_CORRECT_ISWPRINT_TAB + +//Changes to compile on CE gcc. +#undef ACE_HAS_TYPES_H +#define ACE_LACKS_ERRNO_H +#undef ACE_LACKS_DEV_T +#define ACE_LACKS_ISCTYPE +#define ACE_HAS_NONCONST_WFDOPEN +#undef ACE_HAS_WTOI +#undef ACE_HAS_WTOL + +#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" +#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" +#define ACE_ENDTHREADEX(STATUS) ExitThread ((DWORD) STATUS) + +#define ACE_Proper_Export_Flag __declspec (dllexport) +#define ACE_Proper_Import_Flag __declspec (dllimport) +#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class __declspec (dllexport) T +#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE; +#define ACE_IMPORT_SINGLETON_DECLARATION(T) extern template class T +#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) extern template class SINGLETON_TYPE ; + +#define ACE_DLL_PREFIX ACE_TEXT ("lib") + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_WIN32_CEGCC_H */ diff --git a/dep/include/ace/config-win32-common.h b/externals/ace/config-win32-common.h similarity index 93% rename from dep/include/ace/config-win32-common.h rename to externals/ace/config-win32-common.h index b7beb5ba228..0160a3742a1 100644 --- a/dep/include/ace/config-win32-common.h +++ b/externals/ace/config-win32-common.h @@ -1,5 +1,6 @@ /* -*- C++ -*- */ -// $Id: config-win32-common.h 82316 2008-07-15 01:28:39Z johnnyw $ +// $Id: config-win32-common.h 88567 2010-01-15 10:21:49Z olli $ + #ifndef ACE_CONFIG_WIN32_COMMON_H #define ACE_CONFIG_WIN32_COMMON_H @@ -9,6 +10,7 @@ #error Use config-win32.h in config.h instead of this header #endif /* ACE_CONFIG_WIN32_H */ + // Windows Mobile (CE) stuff is primarily further restrictions to what's // in the rest of this file. Also, it defined ACE_HAS_WINCE, which is used // in this file. @@ -90,6 +92,17 @@ # define ACE_MT_SAFE 1 #endif +// On winCE these classes do not exist. If they are +// introduced in the future, no changes need to be made +#if defined (ABOVE_NORMAL_PRIORITY_CLASS) && \ + defined (BELOW_NORMAL_PRIORITY_CLASS) && \ + defined (HIGH_PRIORITY_CLASS) && \ + defined (IDLE_PRIORITY_CLASS) && \ + defined (NORMAL_PRIORITY_CLASS) && \ + defined (REALTIME_PRIORITY_CLASS) +#define ACE_HAS_WIN32_PRIORITY_CLASS +#endif + // Build ACE services as DLLs. If you write a library and want it to // use ACE_Svc_Export, this will cause those macros to build dlls. If // you want your ACE service to be a static library, comment out this @@ -101,7 +114,7 @@ // #endif // Define the special export macros needed to export symbols outside a dll -#if !defined(__BORLANDC__) +#if !defined(__BORLANDC__) && !defined (ACE_HAS_CUSTOM_EXPORT_MACROS) #define ACE_HAS_CUSTOM_EXPORT_MACROS 1 #define ACE_Proper_Export_Flag __declspec (dllexport) #define ACE_Proper_Import_Flag __declspec (dllimport) @@ -146,8 +159,6 @@ // using static object managers. #if !defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) # define ACE_HAS_NONSTATIC_OBJECT_MANAGER -#elif (ACE_HAS_NONSTATIC_OBJECT_MANAGER == 0) -# undef ACE_HAS_NONSTATIC_OBJECT_MANAGER #endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */ #define ACE_HAS_GPERF @@ -169,6 +180,7 @@ #define FD_SETSIZE 1024 #endif /* FD_SETSIZE */ + // Windows doesn't like 65536 ;-) If 65536 is specified, it is // silently ignored by the OS, i.e., setsockopt does not fail, and you // get stuck with the default size of 8k. @@ -188,7 +200,15 @@ #if !defined (ACE_HAS_WINCE) // Platform supports pread() and pwrite() -# define ACE_HAS_P_READ_WRITE +# define ACE_HAS_WTOF +#endif /* ! ACE_HAS_WINCE */ + +#define ACE_HAS_P_READ_WRITE + +#if !defined (ACE_HAS_WINCE) +# define ACE_HAS_DIRECT_H +# define ACE_HAS_PROCESS_H +# define ACE_HAS_IO_H #endif /* ! ACE_HAS_WINCE */ #if !defined (__MINGW32__) @@ -262,6 +282,17 @@ #define ACE_LACKS_WAIT #define ACE_LACKS_IOVEC #define ACE_LACKS_LOG2 +#define ACE_LACKS_CADDR_T +#if !defined(__MINGW32__) && !defined (__BORLANDC__) +# define ACE_LACKS_MODE_T +#endif +#if !defined (__BORLANDC__) +# define ACE_LACKS_NLINK_T +# define ACE_LACKS_UID_T +# define ACE_LACKS_GID_T +#endif +#define ACE_LACKS_SETENV +#define ACE_LACKS_UNSETENV #define ACE_HAS_PDH_H #define ACE_HAS_PDHMSG_H @@ -289,6 +320,8 @@ // Win32 has wide-char support. Use of the compiler-defined wchar_t type // is controlled in compiler configs since it's a compiler switch. #define ACE_HAS_WCHAR +#define ACE_HAS_WTOI +#define ACE_HAS_WTOL // Compiler/platform correctly calls init()/fini() for shared // libraries. - applied for DLLs ? @@ -312,9 +345,6 @@ // Platform provides header. //define ACE_HAS_SYS_FILIO_H -// Compiler/platform supports sys_siglist array. -//define ACE_HAS_SYS_SIGLIST - // Platform supports ACE_TLI timod STREAMS module. //define ACE_HAS_TIMOD_H @@ -335,7 +365,10 @@ #define ACE_LACKS_WRITEV #define ACE_LACKS_READV -#define ACE_LACKS_COND_T +#if !defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE) +# define ACE_LACKS_COND_T +#endif + #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_KEY_T @@ -430,14 +463,20 @@ #if !defined(ACE_HAS_WINSOCK2) # define ACE_HAS_WINSOCK2 1 #endif /* !defined(ACE_HAS_WINSOCK2) */ +// Not use WS1 by default +#if !defined(ACE_HAS_WINSOCK1) +# define ACE_HAS_WINSOCK1 0 +#endif /* !defined(ACE_HAS_WINSOCK1) */ + #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) +# define ACE_HAS_ICMP_SUPPORT 1 # if !defined (_WINSOCK2API_) // will also include windows.h, if not present # include /**/ // WinCE 4 doesn't define the Exxx values without the WSA prefix, so do that // here. This is all lifted from the #if 0'd out part of winsock2.h. -# if defined (UNDER_CE) +# if defined (_WIN32_WCE) && (_WIN32_WCE < 0x600) # define EWOULDBLOCK WSAEWOULDBLOCK # define EINPROGRESS WSAEINPROGRESS # define EALREADY WSAEALREADY @@ -475,7 +514,7 @@ # define EDQUOT WSAEDQUOT # define ESTALE WSAESTALE # define EREMOTE WSAEREMOTE -# endif /* UNDER_CE */ +# endif /* (_WIN32_WCE) && (_WIN32_WCE < 0x600) */ # endif /* _WINSOCK2API */ # if defined (ACE_HAS_FORE_ATM_WS2) @@ -508,7 +547,7 @@ // PharLap ETS has its own winsock lib, so don't grab the one // supplied with the OS. -# if defined (_MSC_VER) && !defined (UNDER_CE) && !defined (ACE_HAS_PHARLAP) +# if defined (_MSC_VER) && !defined (_WIN32_WCE) && !defined (ACE_HAS_PHARLAP) # pragma comment(lib, "wsock32.lib") # endif /* _MSC_VER */ @@ -525,8 +564,8 @@ # define ACE_HAS_IP_MULTICAST #endif /* ACE_HAS_WINSOCK2 */ -#if !defined (ACE_HAS_WINCE) || defined (PPC) /* CE only on some CPUs */ -# define ACE_HAS_INTERLOCKED_EXCHANGEADD +#if !defined (ACE_HAS_WINCE) +# define ACE_HAS_INTERLOCKED_EXCHANGEADD #endif #define ACE_HAS_WIN32_TRYLOCK @@ -537,7 +576,7 @@ # define ACE_HAS_CANCEL_IO # define ACE_HAS_WIN32_OVERLAPPED_IO # define ACE_HAS_WIN32_NAMED_PIPES -#endif /* !defined (ACE_USES_WINCE_SEMA_SIMULATION) && !ACE_HAS_PHARLAP */ +#endif /* !defined (ACE_HAS_WINCE) && !ACE_HAS_PHARLAP */ #if !defined (ACE_SEH_DEFAULT_EXCEPTION_HANDLING_ACTION) # define ACE_SEH_DEFAULT_EXCEPTION_HANDLING_ACTION EXCEPTION_CONTINUE_SEARCH @@ -660,4 +699,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_COMMON_H */ - diff --git a/dep/include/ace/config-win32-dmc.h b/externals/ace/config-win32-dmc.h similarity index 96% rename from dep/include/ace/config-win32-dmc.h rename to externals/ace/config-win32-dmc.h index ca855f5bc97..db6c7e9c8dc 100644 --- a/dep/include/ace/config-win32-dmc.h +++ b/externals/ace/config-win32-dmc.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-win32-dmc.h 81992 2008-06-16 19:09:50Z wotte $ +// $Id: config-win32-dmc.h 87268 2009-10-29 21:06:06Z olli $ // The following configuration file contains defines for Digital Mars compilers. @@ -49,12 +49,10 @@ # define ACE_EXPORT_NESTED_CLASSES 1 # define ACE_HAS_CPLUSPLUS_HEADERS 1 //# define ACE_HAS_EXCEPTIONS 1 -# define ACE_HAS_GNU_CSTRING_H 1 # define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 # define ACE_HAS_SIG_ATOMIC_T 1 # define ACE_HAS_STANDARD_CPP_LIBRARY 0 # define ACE_HAS_STDCPP_STL_INCLUDES 1 -# define ACE_HAS_STRERROR 1 # define ACE_HAS_STRING_CLASS 1 # define ACE_HAS_TEMPLATE_TYPEDEFS 1 # define ACE_HAS_USER_MODE_MASKS 1 @@ -108,4 +106,3 @@ typedef long o_gid_t; #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_DMC_H */ - diff --git a/dep/include/ace/config-win32-ghs.h b/externals/ace/config-win32-ghs.h similarity index 90% rename from dep/include/ace/config-win32-ghs.h rename to externals/ace/config-win32-ghs.h index 775488f3f7f..0ac80bfbd11 100644 --- a/dep/include/ace/config-win32-ghs.h +++ b/externals/ace/config-win32-ghs.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-win32-ghs.h 81992 2008-06-16 19:09:50Z wotte $ +// $Id: config-win32-ghs.h 87268 2009-10-29 21:06:06Z olli $ // The following configuration file contains defines for Green Hills compilers. @@ -57,12 +57,10 @@ # define ACE_EXPORT_NESTED_CLASSES 1 # define ACE_HAS_CPLUSPLUS_HEADERS 1 //# define ACE_HAS_EXCEPTIONS 1 -# define ACE_HAS_GNU_CSTRING_H 1 # define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 # define ACE_HAS_SIG_ATOMIC_T 1 # define ACE_HAS_STANDARD_CPP_LIBRARY 1 # define ACE_HAS_STDCPP_STL_INCLUDES 1 -# define ACE_HAS_STRERROR 1 # define ACE_HAS_STRING_CLASS 1 # define ACE_HAS_TEMPLATE_TYPEDEFS 1 # define ACE_HAS_USER_MODE_MASKS 1 @@ -74,9 +72,8 @@ //# define ACE_NEW_THROWS_EXCEPTIONS 1 # define ACE_SIZEOF_LONG_DOUBLE 10 # define ACE_TEMPLATES_REQUIRE_SOURCE 1 -// Changed ACE_TEXT to ACE_TEXT in the following two lines -# define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%I64u") -# define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%I64d") +# define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" +# define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" # define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 // Set the following to zero to placate SString.h ACE_WString CTOR # undef ACE_WSTRING_HAS_USHORT_SUPPORT @@ -94,4 +91,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_GHS_H */ - diff --git a/externals/ace/config-win32-interix.h b/externals/ace/config-win32-interix.h new file mode 100644 index 00000000000..d0365ac0399 --- /dev/null +++ b/externals/ace/config-win32-interix.h @@ -0,0 +1,127 @@ +// -*- C++ -*- +// $Id: config-win32-interix.h 87578 2009-11-16 14:41:47Z olli $ + +// The following configuration file is designed to work for Interix +// platforms using GNU g++ (Interix == Microsoft's Services for Unix) + +#ifndef ACE_CONFIG_WIN32_INTERIX_H +#define ACE_CONFIG_WIN32_INTERIX_H + +#include /**/ "ace/pre.h" + +#include "ace/config-g++-common.h" + +#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R +#define ACE_HAS_3_PARAM_READDIR_R +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG +#define ACE_HAS_AUTOMATIC_INIT_FINI +#define ACE_HAS_BROKEN_T_ERROR +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +#define ACE_HAS_DIRENT +#define ACE_HAS_EXCEPTIONS +#define ACE_HAS_GETPAGESIZE +#define ACE_HAS_GETRUSAGE +#define ACE_HAS_GETRUSAGE_PROTOTYPE +#define ACE_HAS_GPERF +#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT +#define ACE_HAS_ICMP_SUPPORT 1 +#define ACE_HAS_IP_MULTICAST +#define ACE_HAS_MEMCHR +#define ACE_HAS_MKDIR +#define ACE_HAS_MSG +#define ACE_HAS_NEW_NOTHROW +#define ACE_HAS_NEW_NO_H +#define ACE_HAS_NONCONST_SELECT_TIMEVAL +#define ACE_HAS_POLL +#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 +#define ACE_HAS_POSIX_GETPWNAM_R +#define ACE_HAS_POSIX_NONBLOCK +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_PTHREADS_STD +#define ACE_HAS_PTHREADS_UNIX98_EXT +#define ACE_HAS_PTHREAD_GETCONCURRENCY +#define ACE_HAS_PTHREAD_SETCONCURRENCY +#define ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE +#define ACE_HAS_P_READ_WRITE +#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS +#define ACE_HAS_REENTRANT_FUNCTIONS +#define ACE_HAS_RTLD_LAZY_V +#define ACE_HAS_SEMUN +#define ACE_HAS_SIGINFO_T +#define ACE_HAS_SIGSUSPEND +#define ACE_HAS_SIGWAIT +#define ACE_HAS_SIG_ATOMIC_T +#define ACE_HAS_SIG_C_FUNC +#define ACE_HAS_SOCKADDR_MSG_NAME +#define ACE_HAS_SOCKLEN_T +#define ACE_HAS_SSIZE_T +#define ACE_HAS_STANDARD_CPP_LIBRARY 1 +#define ACE_HAS_STDCPP_STL_INCLUDES +#define ACE_HAS_STREAMS +#define ACE_HAS_STRING_CLASS +#define ACE_HAS_STRSIGNAL +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#define ACE_HAS_SVR4_GETTIMEOFDAY +#define ACE_HAS_SVR4_SIGNAL_T +#define ACE_HAS_SYSV_IPC +#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_TERMIOS +#define ACE_HAS_UALARM +#define ACE_HAS_UCONTEXT_T +#define ACE_HAS_VOIDPTR_GETTIMEOFDAY +#define ACE_HAS_NONSTATIC_OBJECT_MANAGER + +#define ACE_LACKS_GETPGID +#define ACE_LACKS_ISCTYPE +#define ACE_LACKS_LOG2 +#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS +#define ACE_LACKS_NET_IF_H +#define ACE_LACKS_PRAGMA_ONCE +#define ACE_LACKS_SETSCHED +#define ACE_LACKS_STRRECVFD +#define ACE_LACKS_SYS_SYSCTL_H +#define ACE_LACKS_TIMESPEC_T +#define ACE_LACKS_WCSTOK +#define ACE_LACKS_WCSTOLL +#define ACE_LACKS_WCSTOULL + +// These are probably not needed with gcc 4.x +#define ACE_LACKS_UNSETENV +#define ACE_LACKS_STRTOLL +#define ACE_LACKS_STRTOULL +#define ACE_LACKS_SETEGID +#define ACE_LACKS_SETEUID + + +#define ACE_PAGE_SIZE 4096 +#define ACE_SIZEOF_LONG_LONG 8 +#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 + +#if defined (ACE_HAS_THREADS) +# define ACE_HAS_MUTEX_TIMEOUTS +# define ACE_HAS_PTHREADS +# define ACE_MT_SAFE 1 +#else +# error "You need to enable threads for this Interix port." +#endif /* ACE_HAS_THREADS */ + +// Turns off the tracing feature. +#if !defined (ACE_NTRACE) +#define ACE_NTRACE 1 +#endif /* ACE_NTRACE */ + +// NOTE: In debugging some of the test apps they would all memory fault in using +// ACE_Errno_Guard. Upon inspection of that code it uses TSS to save ERRNO in +// a TSS pointer. Access to that pointer caused the fault. The work around here +// is to tell ACE we have TSS and use emulation. More investigation is needed to +// determine whether Interix TSS is broken or the correct semantics for usage under +// Interix simply need to be ported. +// To get around the issue ACE_HAS_TSS_EMULATION is defined to use TSS emulation +// however while many test programs that use TSS pass the TSS_Test program fails. +#define ACE_HAS_THREAD_SPECIFIC_STORAGE // We need thread specific storage even though... +#define ACE_HAS_TSS_EMULATION // It would appear to be broken in Interix! + + +#include /**/ "ace/post.h" + +#endif /* ACE_CONFIG_WIN32_INTERIX_H */ diff --git a/dep/include/ace/config-win32-mingw.h b/externals/ace/config-win32-mingw.h similarity index 85% rename from dep/include/ace/config-win32-mingw.h rename to externals/ace/config-win32-mingw.h index 259e5d927fd..0a0ff292f8c 100644 --- a/dep/include/ace/config-win32-mingw.h +++ b/externals/ace/config-win32-mingw.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: config-win32-mingw.h 81693 2008-05-14 12:35:01Z johnnyw $ +// $Id: config-win32-mingw.h 87167 2009-10-19 19:33:53Z olli $ // // The following configuration file is designed to work for win32 @@ -51,15 +51,17 @@ # define ACE_LACKS_DIRENT_H #endif -#undef ACE_LACKS_SIGSET +#if (__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 15)) +# undef ACE_LACKS_USECONDS_T +#endif + +#undef ACE_HAS_WTOF -#define ACE_LACKS_SIGSET_DEFINITIONS #define ACE_LACKS_SYS_SHM_H #define ACE_LACKS_TERMIOS_H #define ACE_LACKS_NETINET_TCP_H #define ACE_LACKS_STRRECVFD #define ACE_LACKS_STRPTIME -#define ACE_HAS_STRERROR #define ACE_LACKS_POLL_H #define ACE_LACKS_REGEX_H #define ACE_LACKS_SYS_MSG_H @@ -84,6 +86,7 @@ #define ACE_LACKS_PDHMSG_H #define ACE_HAS_NONCONST_WCSDUP #define ACE_HAS_WINSOCK2_GQOS +#define ACE_ISCTYPE_EQUIVALENT ::_isctype // We trust the user: He must have used -mpentiumpro or -mpentium // if that is what he wants. @@ -91,11 +94,12 @@ # define ACE_HAS_PENTIUM #endif -#define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%I64d") -#define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%I64u") +#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" +#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" #define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) (STATUS)) +#define ACE_DLL_PREFIX ACE_TEXT ("lib") + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MINGW_H */ - diff --git a/externals/ace/config-win32-msvc-10.h b/externals/ace/config-win32-msvc-10.h new file mode 100644 index 00000000000..1867aa010f2 --- /dev/null +++ b/externals/ace/config-win32-msvc-10.h @@ -0,0 +1,153 @@ +/* -*- C++ -*- */ +//============================================================================= +/** + * @file config-win32-msvc-10.h + * + * $Id: config-win32-msvc-10.h 87224 2009-10-26 07:49:31Z olli $ + * + * @brief Microsoft Visual C++ 10.0 configuration file. + * + * This file is the ACE configuration file for Microsoft Visual C++ version 10. + * + * @note Do not include this file directly, include config-win32.h instead. + */ +//============================================================================= + +#ifndef ACE_CONFIG_WIN32_MSVC_10_H +#define ACE_CONFIG_WIN32_MSVC_10_H +#include /**/ "ace/pre.h" + +#ifndef ACE_CONFIG_WIN32_H +#error Use config-win32.h in config.h instead of this header +#endif /* ACE_CONFIG_WIN32_H */ + +#ifndef ACE_WIN32_VC10 +# define ACE_WIN32_VC10 +#endif + +// Visual C++ 9.0 (.NET) deprecated the old iostreams +#if !defined (ACE_HAS_STANDARD_CPP_LIBRARY) +#define ACE_HAS_STANDARD_CPP_LIBRARY 1 +#endif + +#if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) +#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 +#endif + +// Windows' timeval is non-conformant (defined in terms of long instead of +// time_t) and VC9 (on desktop, not CE) changed time_t to a 64-bit value +// even when compiling a 32-bit application. Therefore, ace/Time_Value +// needs to rearrange a few things for this compiler. See Time_Value.h +// for complete details. +#if !defined (ACE_HAS_WINCE) +# define ACE_HAS_TIME_T_LONG_MISMATCH +#endif + +#define ACE_HAS_ITOA +#define ACE_HAS_HEADER_ALLOCATED_CLASS_STATIC_CONST_INT_STOREAGE +#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR + +#define ACE_ITOA_EQUIVALENT ::_itoa +#define ACE_STRCASECMP_EQUIVALENT ::_stricmp +#define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp +#define ACE_WCSDUP_EQUIVALENT ::_wcsdup +#if defined (ACE_HAS_WINCE) +# define ACE_FILENO_EQUIVALENT ::_fileno +#else +# define ACE_FILENO_EQUIVALENT(X) (_get_osfhandle (::_fileno (X))) +#endif + +#ifndef ACE_HAS_EXCEPTIONS +# define ACE_HAS_EXCEPTIONS +#endif + +// Windows Mobile 6 doesn't do sig_atomic_t, but maybe future versions will. +# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x601) +# define ACE_HAS_SIG_ATOMIC_T +# endif /* !Win CE 6.0 or less */ + +#define ACE_LACKS_STRPTIME + +// Evaluate this with a WinCE build; maybe things have improved since VC8. +//#if !defined (ACE_HAS_WINCE) +# define ACE_HAS_INTRIN_H +# define ACE_HAS_INTRINSIC_INTERLOCKED +//#endif + +#if !defined (_WIN32_WCE) || (_WIN32_WCE >= 0x501) +# define ACE_HAS_INTRINSIC_BYTESWAP +#endif + +#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES +#define ACE_LACKS_STRRECVFD +#define ACE_HAS_CPLUSPLUS_HEADERS + +#define ACE_HAS_TEMPLATE_TYPEDEFS +#define ACE_TEMPLATES_REQUIRE_SOURCE + +// Platform provides ACE_TLI function prototypes. +// For Win32, this is not really true, but saves a lot of hassle! +#define ACE_HAS_TLI_PROTOTYPES + +// Platform support linebuffered streaming is broken +#define ACE_LACKS_LINEBUFFERED_STREAMBUF + +#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY != 0) + +// Platform has its Standard C++ library in the namespace std +# if !defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) +# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 +# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ + +// ace/iostream.h does not work with the standard cpp library (yet). +# if !defined (ACE_USES_OLD_IOSTREAMS) +# define ACE_LACKS_ACE_IOSTREAM +# endif /* ! ACE_USES_OLD_IOSTREAMS */ + +// Starting with MSVC 7.1, std::new throws std::bad_alloc on out-of-memory. +#define ACE_NEW_THROWS_EXCEPTIONS +#define ACE_HAS_NEW_NOTHROW + +#else + +// iostream header lacks ipfx (), isfx (), etc., declarations +# define ACE_LACKS_IOSTREAM_FX + +#endif + +// There are too many instances of this warning to fix it right now. +// Maybe in the future. + +// Disable warning of using Microsoft Extension. +# pragma warning(disable:4231) + +// 'class1' : inherits 'class2::member' via dominance +#pragma warning(disable:4250) + +// CE (at least thru Windows Mobile 5) doesn't have the new, secure CRT. +#if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_TR24731_2005_CRT) +# define ACE_HAS_TR24731_2005_CRT +#endif + +// On CE w/o MFC config-WinCE.h needs to declare a placement new. This +// triggers a warning that there's no placement delete, which can be ignored. +#if defined (ACE_HAS_WINCE) && !defined (ACE_HAS_MFC) +# pragma warning(disable:4291) +#endif + +// A template can not be exported. Only an instantiation may be exported. +#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT + +// At least for ACE_UNIMPLEMENTED_FUNC in class templates, this is needed to +// explicitly instantiate a template that has ACE_UNIMPLEMENTED_FUNC. +# define ACE_NEEDS_FUNC_DEFINITIONS + +// Windows Vista and Windows Server 2008 and newer do have native condition +// variables +#if defined (WIN32_WINNT) && (WIN32_WINNT >= 0x0600) +# define ACE_HAS_WTHREADS_CONDITION_VARIABLE +# undef ACE_LACKS_COND_T +#endif + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_WIN32_MSVC_10_H */ diff --git a/dep/include/ace/config-win32-msvc-7.h b/externals/ace/config-win32-msvc-7.h similarity index 96% rename from dep/include/ace/config-win32-msvc-7.h rename to externals/ace/config-win32-msvc-7.h index b2b45c6894b..30965d6772f 100644 --- a/dep/include/ace/config-win32-msvc-7.h +++ b/externals/ace/config-win32-msvc-7.h @@ -3,7 +3,7 @@ /** * @file config-win32-msvc-7.h * - * $Id: config-win32-msvc-7.h 81935 2008-06-12 22:01:53Z jtc $ + * $Id: config-win32-msvc-7.h 87251 2009-10-28 12:00:12Z olli $ * * @brief Microsoft Visual C++ 7.0 configuration file. * @@ -50,7 +50,6 @@ #define ACE_HAS_EXCEPTIONS #endif /* ACE_HAS_WINCE */ -#define ACE_HAS_STRERROR #define ACE_LACKS_STRPTIME #define ACE_HAS_SIG_ATOMIC_T @@ -112,7 +111,7 @@ #pragma warning(disable:4231) // 'function' : unreferenced local function has been removed -# pragma warning(disable:4505) +#pragma warning(disable:4505) // A template can not be exported. Only an instantiation may be exported. #define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT @@ -123,4 +122,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_7_H */ - diff --git a/dep/include/ace/config-win32-msvc-8.h b/externals/ace/config-win32-msvc-8.h similarity index 83% rename from dep/include/ace/config-win32-msvc-8.h rename to externals/ace/config-win32-msvc-8.h index f35ba9f4f94..fafdd62d422 100644 --- a/dep/include/ace/config-win32-msvc-8.h +++ b/externals/ace/config-win32-msvc-8.h @@ -3,7 +3,7 @@ /** * @file config-win32-msvc-8.h * - * $Id: config-win32-msvc-8.h 81935 2008-06-12 22:01:53Z jtc $ + * $Id: config-win32-msvc-8.h 87224 2009-10-26 07:49:31Z olli $ * * @brief Microsoft Visual C++ 8.0 configuration file. * @@ -53,20 +53,29 @@ #define ACE_STRCASECMP_EQUIVALENT ::_stricmp #define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp #define ACE_WCSDUP_EQUIVALENT ::_wcsdup +#if defined (ACE_HAS_WINCE) +# define ACE_FILENO_EQUIVALENT ::_fileno +#else +# define ACE_FILENO_EQUIVALENT(X) (_get_osfhandle (::_fileno (X))) +#endif -#define ACE_HAS_EXCEPTIONS +#ifndef ACE_HAS_EXCEPTIONS +# define ACE_HAS_EXCEPTIONS +#endif -// Windows Mobile 5 doesn't do sig_atomic_t, but maybe future versions will. -# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x501) +// Windows Mobile 6 doesn't do sig_atomic_t, but maybe future versions will. +// This has been true up thrugh the versions. We don't have any indication +// that this might be supported in the future, but it is an easy enough fix +// to bump the wince revision number when a new version is released. +# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x601) # define ACE_HAS_SIG_ATOMIC_T -# endif /* !Win CE 5.0 or less */ +# endif /* !Win CE 6.0 or less */ -#define ACE_HAS_STRERROR #define ACE_LACKS_STRPTIME #if !defined (ACE_HAS_WINCE) -# define ACE_HAS_INTRIN_H -# define ACE_HAS_INTRINSIC_INTERLOCKED +# define ACE_HAS_INTRIN_H +# define ACE_HAS_INTRINSIC_INTERLOCKED #endif #if !defined (_WIN32_WCE) || (_WIN32_WCE >= 0x501) @@ -114,7 +123,13 @@ // Maybe in the future. // Disable warning of using Microsoft Extension. -# pragma warning(disable:4231) +#pragma warning(disable:4231) + +// 'class1' : inherits 'class2::member' via dominance +#pragma warning(disable:4250) + +// 'this' : used in base member initializer list +#pragma warning(disable:4355) // CE (at least thru Windows Mobile 5) doesn't have the new, secure CRT. #if !defined (ACE_HAS_WINCE) && !defined (ACE_HAS_TR24731_2005_CRT) @@ -146,4 +161,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_8_H */ - diff --git a/dep/include/ace/config-win32-msvc-9.h b/externals/ace/config-win32-msvc-9.h similarity index 86% rename from dep/include/ace/config-win32-msvc-9.h rename to externals/ace/config-win32-msvc-9.h index ee8feef52e1..bd6bcf60fc4 100644 --- a/dep/include/ace/config-win32-msvc-9.h +++ b/externals/ace/config-win32-msvc-9.h @@ -3,7 +3,7 @@ /** * @file config-win32-msvc-9.h * - * $Id: config-win32-msvc-9.h 81935 2008-06-12 22:01:53Z jtc $ + * $Id: config-win32-msvc-9.h 87224 2009-10-26 07:49:31Z olli $ * * @brief Microsoft Visual C++ 9.0 configuration file. * @@ -51,22 +51,28 @@ #define ACE_STRCASECMP_EQUIVALENT ::_stricmp #define ACE_STRNCASECMP_EQUIVALENT ::_strnicmp #define ACE_WCSDUP_EQUIVALENT ::_wcsdup +#if defined (ACE_HAS_WINCE) +# define ACE_FILENO_EQUIVALENT ::_fileno +#else +# define ACE_FILENO_EQUIVALENT(X) (_get_osfhandle (::_fileno (X))) +#endif -#define ACE_HAS_EXCEPTIONS +#ifndef ACE_HAS_EXCEPTIONS +# define ACE_HAS_EXCEPTIONS +#endif -// Windows Mobile 5 doesn't do sig_atomic_t, but maybe future versions will. -# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x501) +// Windows Mobile 6 doesn't do sig_atomic_t, but maybe future versions will. +# if !defined (_WIN32_WCE) || (_WIN32_WCE > 0x601) # define ACE_HAS_SIG_ATOMIC_T -# endif /* !Win CE 5.0 or less */ +# endif /* !Win CE 6.0 or less */ -#define ACE_HAS_STRERROR #define ACE_LACKS_STRPTIME // Evaluate this with a WinCE build; maybe things have improved since VC8. -//#if !defined (ACE_HAS_WINCE) +#if !defined (ACE_HAS_WINCE) # define ACE_HAS_INTRIN_H # define ACE_HAS_INTRINSIC_INTERLOCKED -//#endif +#endif #if !defined (_WIN32_WCE) || (_WIN32_WCE >= 0x501) # define ACE_HAS_INTRINSIC_BYTESWAP @@ -136,6 +142,12 @@ // explicitly instantiate a template that has ACE_UNIMPLEMENTED_FUNC. # define ACE_NEEDS_FUNC_DEFINITIONS +// Windows Vista and Windows Server 2008 and newer do have native condition +// variables +#if defined (WIN32_WINNT) && (WIN32_WINNT >= 0x0600) +# define ACE_HAS_WTHREADS_CONDITION_VARIABLE +# undef ACE_LACKS_COND_T +#endif + #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_9_H */ - diff --git a/dep/include/ace/config-win32-msvc.h b/externals/ace/config-win32-msvc.h similarity index 90% rename from dep/include/ace/config-win32-msvc.h rename to externals/ace/config-win32-msvc.h index 7abad321c7d..6f62477b9dd 100644 --- a/dep/include/ace/config-win32-msvc.h +++ b/externals/ace/config-win32-msvc.h @@ -2,7 +2,7 @@ /** * @file config-win32-msvc.h * - * $Id: config-win32-msvc.h 82643 2008-08-19 14:02:12Z johnnyw $ + * $Id: config-win32-msvc.h 85785 2009-06-24 18:20:42Z mitza $ * * @brief Microsoft Visual C++ configuration file. * @@ -31,12 +31,6 @@ #define ACE_CC_MINOR_VERSION (_MSC_VER % 100) #define ACE_CC_BETA_VERSION (0) -#if !defined (ACE_LD_DECORATOR_STR) -# if defined (_DEBUG) -# define ACE_LD_DECORATOR_STR ACE_TEXT ("d") -# endif /* _DEBUG */ -#endif /* ACE_LD_DECORATOR_STR */ - #if !defined(_NATIVE_WCHAR_T_DEFINED) #define ACE_LACKS_NATIVE_WCHAR_T #endif @@ -48,7 +42,10 @@ # define ACE_ENDTHREADEX(STATUS) ::_endthreadex ((DWORD) STATUS) #endif /* _WIN32_WCE */ -#if (_MSC_VER >= 1500) +//FUZZ: disable check_for_msc_ver +#if (_MSC_VER >= 1600) +# include "ace/config-win32-msvc-10.h" +#elif (_MSC_VER >= 1500) # include "ace/config-win32-msvc-9.h" #elif (_MSC_VER >= 1400) # include "ace/config-win32-msvc-8.h" @@ -57,6 +54,7 @@ #else # error This version of Microsoft Visual C++ is not supported. #endif +//FUZZ: enable check_for_msc_ver // MFC changes the behavior of operator new at all MSVC versions from 6 up // by throwing a static CMemoryException* instead of std::bad_alloc @@ -124,11 +122,19 @@ #define ACE_LACKS_TERMIOS_H #define ACE_LACKS_REGEX_H -#define ACE_INT64_FORMAT_SPECIFIER ACE_TEXT ("%I64d") -#define ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT ("%I64u") +#define ACE_INT64_FORMAT_SPECIFIER_ASCII "%I64d" +#define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%I64u" +#define ACE_STRTOLL_EQUIVALENT ::_strtoi64 +#define ACE_WCSTOLL_EQUIVALENT ::_wcstoi64 #define ACE_STRTOULL_EQUIVALENT ::_strtoui64 -#define ACE_WCSTOOULL_EQUIVALENT ::_wcstoui64 +#define ACE_WCSTOULL_EQUIVALENT ::_wcstoui64 +#define ACE_WTOF_EQUIVALENT ::_wtof + +#define ACE_LACKS_ISBLANK +#define ACE_LACKS_ISWBLANK +#define ACE_LACKS_CORRECT_ISWPRINT_TAB +#define ACE_ISCTYPE_EQUIVALENT ::_isctype // Turn off warnings for /W4 // To resume any of these warning: #pragma warning(default: 4xxx) @@ -167,4 +173,3 @@ #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_H */ - diff --git a/dep/include/ace/config-win32.h b/externals/ace/config-win32.h similarity index 63% rename from dep/include/ace/config-win32.h rename to externals/ace/config-win32.h index 2cf39c60491..af946518cae 100644 --- a/dep/include/ace/config-win32.h +++ b/externals/ace/config-win32.h @@ -3,7 +3,7 @@ /** * @file config-win32.h * - * $Id: config-win32.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: config-win32.h 85057 2009-04-08 10:59:58Z msmit $ * * @brief Microsoft Windows configuration file. * @@ -19,38 +19,6 @@ #define ACE_CONFIG_WIN32_H #include /**/ "ace/pre.h" -// by derex ,I include the win32 specific header here, -// this violates the idea of this file a bit ;) -#define ACE_HAS_REACTOR_NOTIFICATION_QUEUE - -// Max amount of connections for non-epoll platforms -#ifndef FD_SETSIZE - #define FD_SETSIZE 4096 -#endif - -//disable some deprecate warnings on windows -#ifndef _CRT_NONSTDC_NO_WARNINGS - #define _CRT_NONSTDC_NO_WARNINGS -#endif - -#ifndef _CRT_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_WARNINGS -#endif - -#ifndef _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE -#endif - -#ifndef _CRT_NONSTDC_NO_DEPRECATE - #define _CRT_NONSTDC_NO_DEPRECATE -#endif - -#ifndef _WINDOWS - #define _WINDOWS -#endif - -// end custom config stuff - // NOTE: Please do not add anything besides #include's here. Put other stuff // (definitions, etc.) in the included headers @@ -69,6 +37,8 @@ # include "ace/config-win32-msvc.h" #elif defined (ghs) # include "ace/config-win32-ghs.h" +#elif defined (ACE_HAS_CEGCC) //need to be prior to MINGW32 +# include "ace/config-win32-cegcc.h" #elif defined (__MINGW32__) # include "ace/config-win32-mingw.h" #elif defined (__DMC__) @@ -80,13 +50,6 @@ // gethostbyaddr does not handle IPv6-mapped-IPv4 addresses #define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED -// TODO remove this at some point when we add ACE::init and ACE::fini -// by derex -#ifdef ACE_HAS_NONSTATIC_OBJECT_MANAGER -#undef ACE_HAS_NONSTATIC_OBJECT_MANAGER -#endif //ACE_HAS_NONSTATIC_OBJECT_MANAGER - #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_H */ - diff --git a/externals/ace/config.h b/externals/ace/config.h new file mode 100644 index 00000000000..d3408e611cb --- /dev/null +++ b/externals/ace/config.h @@ -0,0 +1 @@ +#include "ace/config-win32.h" \ No newline at end of file diff --git a/externals/ace/config.h.in b/externals/ace/config.h.in new file mode 100644 index 00000000000..aa09aa48bf6 --- /dev/null +++ b/externals/ace/config.h.in @@ -0,0 +1,2204 @@ +/* ace/config.h.in. Generated from configure.ac by autoheader. */ + + +#ifndef ACE_CONFIG_H +#define ACE_CONFIG_H + +// ACE configuration header file + + + + +/* Compiler/platform standard C++ auto_ptr implementation lacks reset() method + */ +#undef ACE_AUTO_PTR_LACKS_RESET + +/* Enable ACE_Timeprobes */ +#undef ACE_COMPILE_TIMEPROBES + +/* */ +#undef ACE_DEFAULT_BASE_ADDR + +/* */ +#undef ACE_DEFAULT_BASE_ADDRL + +/* */ +#undef ACE_DEFAULT_CLOSE_ALL_HANDLES + +/* */ +#undef ACE_DEFAULT_MAX_SOCKET_BUFSIZ + +/* The default number of handles the select()-based reactor should handle */ +#undef ACE_DEFAULT_SELECT_REACTOR_SIZE + +/* Number of TSS keys, with ACE_HAS_TSS_EMULATION _only_. Defaults to 64. */ +#undef ACE_DEFAULT_THREAD_KEYS + +/* Define this if you don't want debug version ACE search for debug version + DLLs first before looking for the DLL names specified. */ +#undef ACE_DISABLE_DEBUG_DLL_CHECK + +/* Do not include emulation for timed semaphore acquisitions. */ +#undef ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION + +/* Define to 1 to disable swapping swapping CDR on read */ +#undef ACE_DISABLE_SWAP_ON_READ + +/* Define to DLL file suffix */ +#undef ACE_DLL_SUFFIX + +/* Define to 1 to enable swapping swapping CDR on write */ +#undef ACE_ENABLE_SWAP_ON_WRITE + +/* Compiler requires template args when explicitly calling template + destructor. */ +#undef ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS + +/* Define to 1 if the getsockname() and getpeername() return random values in + the sockaddr_in.sin_zero field. */ +#undef ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO + +/* Uses ctime_r & asctime_r with only two parameters vs. three. */ +#undef ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R + +/* Define to 1 if platform has 2 parameter sched_getaffinity() */ +#undef ACE_HAS_2_PARAM_SCHED_GETAFFINITY + +/* Define to 1 if platform has 2 parameter sched_setaffinity() */ +#undef ACE_HAS_2_PARAM_SCHED_SETAFFINITY + +/* Define to 1 if platform has 3 parameter readdir_r() */ +#undef ACE_HAS_3_PARAM_READDIR_R + +/* Define to 1 if platform has 3 parameter wcstok() */ +#undef ACE_HAS_3_PARAM_WCSTOK + +/* Platform has BSD 4.4 sendmsg()/recvmsg() APIs. */ +#undef ACE_HAS_4_4BSD_SENDMSG_RECVMSG + +/* Platform supports Asynchronous IO calls */ +#undef ACE_HAS_AIO_CALLS + +/* Platform has AIX4 ::read_real_time() */ +#undef ACE_HAS_AIX_HI_RES_TIMER + +/* Compiler/platform supports alloca(). */ +#undef ACE_HAS_ALLOCA + +/* Compiler/platform has */ +#undef ACE_HAS_ALLOCA_H + +/* Define to 1 if system should use Alpha's cycle counter */ +#undef ACE_HAS_ALPHA_TIMER + +/* Use ACE's alternate cuserid() implementation since a system cuserid() may + not exist, or it is not desirable to use it. The implementation requires + ACE_LACKS_PWD_FUNCTIONS to be undefined and that the geteuid() system call + exists. */ +#undef ACE_HAS_ALT_CUSERID + +/* Compiler/platform correctly calls init()/fini() for shared libraries. */ +#undef ACE_HAS_AUTOMATIC_INIT_FINI + +/* Compiler/platform has "big" fd_set, i.e. large number of bits set in fd_set + passed back from select(). */ +#undef ACE_HAS_BIG_FD_SET + +/* Platform sendv() does not work properly with datagrams, i.e. it fails when + the iovec size is IOV_MAX. */ +#undef ACE_HAS_BROKEN_DGRAM_SENDV + +/* Platform doesn't cast MAP_FAILED to a (void *). */ +#undef ACE_HAS_BROKEN_MAP_FAILED + +/* HP/UX does not wrap the mmap(2) header files with extern "C". */ +#undef ACE_HAS_BROKEN_MMAP_H + +/* Platform headers don't support prototypes */ +#undef ACE_HAS_BROKEN_MSG_H + +/* Platform defines struct timespec in */ +#undef ACE_HAS_BROKEN_POSIX_TIME + +/* OS/compiler's header files are inconsistent with libC definition of + rand_r(). */ +#undef ACE_HAS_BROKEN_RANDR + +/* Compiler/platform has the wrong prototype for t_error(), i.e., t_error(char + *) rather than t_error(const char *). */ +#undef ACE_HAS_BROKEN_T_ERROR + +/* Platform has (which contains bzero() prototype) */ +#undef ACE_HAS_BSTRING + +/* Define to 1 if platform has bswap16(). */ +#undef ACE_HAS_BSWAP16 + +/* Define to 1 if platform has bswap32(). */ +#undef ACE_HAS_BSWAP32 + +/* Define to 1 if platform has bswap64(). */ +#undef ACE_HAS_BSWAP64 + +/* Define to 1 if platform has bswap_16(). */ +#undef ACE_HAS_BSWAP_16 + +/* Define to 1 if platform has bswap_32(). */ +#undef ACE_HAS_BSWAP_32 + +/* Define to 1 if platform has bswap_64(). */ +#undef ACE_HAS_BSWAP_64 + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_BYTESEX_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_BYTESWAP_H + +/* Platform supports the Win32 CancelIO() function. (WinNT 4.0 and beyond) */ +#undef ACE_HAS_CANCEL_IO + +/* OS/platform uses char * for dlopen/dlsym args, rather than const char *. */ +#undef ACE_HAS_CHARPTR_DL + +/* Define to 1 if arg 2 of 'shmat' is char *' */ +#undef ACE_HAS_CHARPTR_SHMAT + +/* Define to 1 if arg 1 of 'shmdt' is char *' */ +#undef ACE_HAS_CHARPTR_SHMDT + +/* OS/platform uses char * for sockopt, rather than const char * */ +#undef ACE_HAS_CHARPTR_SOCKOPT + +/* Define to 1 if platform has clock_gettime(). */ +#undef ACE_HAS_CLOCK_GETTIME + +/* Define to 1 if platform has clock_settime(). */ +#undef ACE_HAS_CLOCK_SETTIME + +/* OS header files have some problems with XTI (HP/UX 11). */ +#undef ACE_HAS_CONFLICTING_XTI_MACROS + +/* Prototypes for both signal() and struct sigaction are consistent. */ +#undef ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +/* Platform has swab(const char*, char*, ssize_t) variant. */ +#undef ACE_HAS_CONST_CHAR_SWAB + +/* Compiler/platform has correctly prototyped header files. */ +#undef ACE_HAS_CPLUSPLUS_HEADERS + +/* Define to 1 if the system has the type `cpu_set_t'. */ +#undef ACE_HAS_CPU_SET_T + +/* Platform defines custom DSO/DLL symbol export macros. */ +#undef ACE_HAS_CUSTOM_EXPORT_MACROS + +/* Platform supports /dev/poll character device. */ +#undef ACE_HAS_DEV_POLL + +/* Platform supports operations on directories via struct dirent, readdir_r, + etc. */ +#undef ACE_HAS_DIRENT + +/* Build ACE using the frigging PC DLL nonsense... */ +#undef ACE_HAS_DLL + +/* Define to 1 if the dlsym() call segfaults when passed an invalid handle. */ +#undef ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE + +/* Platform (Linux) supports event poll interface. */ +#undef ACE_HAS_EVENT_POLL + +/* Compiler supports C++ exception handling. */ +#undef ACE_HAS_EXCEPTIONS + +/* Platform has Fast-Light (FL) toolkit installed. */ +#undef ACE_HAS_FL + +/* Define to 1 if compiler has builtin atomic support */ +#undef ACE_HAS_GCC_ATOMIC_BUILTINS + +/* Define to 1 if platform has getifaddrs(). */ +#undef ACE_HAS_GETIFADDRS + +/* Platform supports getpagesize() call (otherwise, ACE_PAGE_SIZE must be + defined, except on Win32). */ +#undef ACE_HAS_GETPAGESIZE + +/* Define to 1 if platform has getprogname(). */ +#undef ACE_HAS_GETPROGNAME + +/* Define to 1 if platform has getrusage(). */ +#undef ACE_HAS_GETRUSAGE + +/* Define to 1 if platform has the declaration of getrusage(). */ +#undef ACE_HAS_GETRUSAGE_PROTOTYPE + +/* Enable use of GNU template repositories. GNU C++ w/repo patch and EGCS only + */ +#undef ACE_HAS_GNU_REPO + +/* The GPERF utility is compiled for this platform */ +#undef ACE_HAS_GPERF + +/* Optimize ACE_Handle_Set::count_bits for select() operations (common case) + */ +#undef ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT + +/* Define to 1 if system has SunOS high resolution timer. */ +#undef ACE_HAS_HI_RES_TIMER + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_IA32INTRIN_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_IA64INTRIN_H + +/* Defined to 1 if platform supports ICMP over raw sockets */ +#undef ACE_HAS_ICMP_SUPPORT + +/* Define to 1 if the system has the type `idtype_t'. */ +#undef ACE_HAS_IDTYPE_T + +/* Inline all the static class OS methods to remove call overhead Note: This + gets defined by OS.h if __ACE_INLINE__ is defined */ +#undef ACE_HAS_INLINED_OSCALLS + +/* Define to 1 if the system has the type `int16_t'. */ +#undef ACE_HAS_INT16_T + +/* Define to 1 if the system has the type `int32_t'. */ +#undef ACE_HAS_INT32_T + +/* Define to 1 if the system has the type `int64_t'. */ +#undef ACE_HAS_INT64_T + +/* Define to 1 if the system has the type `int8_t'. */ +#undef ACE_HAS_INT8_T + +/* Define to 1 if the system supports x86/x86_64 inline assembly */ +#undef ACE_HAS_INTEL_ASSEMBLY + +/* Platform supports the intrinsic interlocked optimizations. */ +#undef ACE_HAS_INTRINSIC_INTERLOCKED + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_INTRIN_H + +/* Platform supports IPv6 */ +#undef ACE_HAS_IPV6 + +/* Platform supports IP multicast */ +#undef ACE_HAS_IP_MULTICAST + +/* Platform supports the very odd IRIX 6.2 threads... */ +#undef ACE_HAS_IRIX62_THREADS + +/* Define to 1 if platform has the declaration of isastream(). */ +#undef ACE_HAS_ISASTREAM_PROTOTYPE + +/* Define to 1 if platform has itoa(). */ +#undef ACE_HAS_ITOA + +/* The rusage_t structure has only two fields. */ +#undef ACE_HAS_LIMITED_RUSAGE_T + +/* Define to 1 if system has Linux version of sysinfo(). */ +#undef ACE_HAS_LINUX_SYSINFO + +/* Platform supports llseek(). This should not be defined if ACE_HAS_LSEEK64 + is defined. */ +#undef ACE_HAS_LLSEEK + +/* Platform defines MAP_FAILED as a long constant. */ +#undef ACE_HAS_LONG_MAP_FAILED + +/* Platform supports lseek64(). This should not be defined if ACE_HAS_LLSEEK + is defined. */ +#undef ACE_HAS_LSEEK64 + +/* */ +#undef ACE_HAS_LYNXOS4_SIGNALS + +/* Enabled malloc statistics collection. */ +#undef ACE_HAS_MALLOC_STATS + +/* Define to 1 if platform has memchr(). */ +#undef ACE_HAS_MEMCHR + +/* Define to 1 if unrolled ACE_OS::fast_memcpy() is faster than system + memcpy() */ +#undef ACE_HAS_MEMCPY_LOOP_UNROLL + +/* Platform supports Microsoft Foundation Classes */ +#undef ACE_HAS_MFC + +/* Define to 1 if platform has mkdir(). */ +#undef ACE_HAS_MKDIR + +/* Platform supports recvmsg and sendmsg */ +#undef ACE_HAS_MSG + +/* Platform supports MT safe mktime() call (do any of them?) */ +#undef ACE_HAS_MT_SAFE_MKTIME + +/* Sockets may be called in multi-threaded programs */ +#undef ACE_HAS_MT_SAFE_SOCKETS + +/* Compiler supports timed mutex acquisitions (e.g. + pthread_mutex_timedlock()). */ +#undef ACE_HAS_MUTEX_TIMEOUTS + +/* Define to 1 if platform has nanosleep(). */ +#undef ACE_HAS_NANOSLEEP + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_NEW_H + +/* Compiler supports new (std::nothrow) */ +#undef ACE_HAS_NEW_NOTHROW + +/* Platform provides new style C++ header */ +#undef ACE_HAS_NEW_NO_H + +/* Define to 1 if system has nonconst FD_ISSET() macro. */ +#undef ACE_HAS_NONCONST_FD_ISSET + +/* Platform uses non-const char * in calls to gethostbyaddr, gethostbyname, + getservbyname */ +#undef ACE_HAS_NONCONST_GETBY + +/* Platform has a non-const parameter to msgsnd() (e.g., SCO). */ +#undef ACE_HAS_NONCONST_MSGSND + +/* Platform omits const qualifier from iovec parameter in readv() prototype. + */ +#undef ACE_HAS_NONCONST_READV + +/* Platform's select() uses non-const timeval* (only found on Linux right now) + */ +#undef ACE_HAS_NONCONST_SELECT_TIMEVAL + +/* Platform omits const qualifier from msghdr parameter in sendmsg() + prototype. */ +#undef ACE_HAS_NONCONST_SENDMSG + +/* Platform omits const qualifier from rlimit parameter in setrlimit() + prototype. */ +#undef ACE_HAS_NONCONST_SETRLIMIT + +/* Platform has swab(char*, char*, ssize_t) variant. */ +#undef ACE_HAS_NONCONST_SWAB + +/* Platform omits const qualifier from iovec parameter in writev() prototype. + */ +#undef ACE_HAS_NONCONST_WRITEV + +/* Causes the ACE_Object_Manager instance to be created in main (int, char + *[]), instead of as a static (global) instance. */ +#undef ACE_HAS_NONSTATIC_OBJECT_MANAGER + +/* Compiler/platform uses old malloc()/free() prototypes (ugh) */ +#undef ACE_HAS_OLD_MALLOC + +/* Platform, e.g., Solaris 2.5, only supports SCHED_OTHER POSIX scheduling + policy. */ +#undef ACE_HAS_ONLY_SCHED_OTHER + +/* Use the semaphore implementation of ACE_Message_Queue rather than the + emulated condition variable (NT and VxWorks). */ +#undef ACE_HAS_OPTIMIZED_MESSAGE_QUEUE + +/* timezone* 2nd parameter & no prototype */ +#undef ACE_HAS_OSF1_GETTIMEOFDAY + +/* Platform supports the OSF TLI timod STREAMS module */ +#undef ACE_HAS_OSF_TIMOD_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_PDH_H + +/* Define to 1 if system is using Intel Pentium(tm) processor */ +#undef ACE_HAS_PENTIUM + +/* Platform contains */ +#undef ACE_HAS_POLL + +/* Platform supports "position-independent" features provided by + ACE_Based_Pointer<>. */ +#undef ACE_HAS_POSITION_INDEPENDENT_POINTERS + +/* Platform supports POSIX getpwnam_r() function */ +#undef ACE_HAS_POSIX_GETPWNAM_R + +/* Platform supports POSIX O_NONBLOCK semantics */ +#undef ACE_HAS_POSIX_NONBLOCK + +/* Platform supports POSIX realtime signals */ +#undef ACE_HAS_POSIX_REALTIME_SIGNALS + +/* Platform supports POSIX real-time semaphores (e.g., VxWorks and Solaris) */ +#undef ACE_HAS_POSIX_SEM + +/* Platform supports timed POSIX semaphore acquisitions (sem_timedwait()). */ +#undef ACE_HAS_POSIX_SEM_TIMEOUT + +/* Platform supports the POSIX struct timespec type */ +#undef ACE_HAS_POSIX_TIME + +/* Define to 1 if system should use PowerPC's cycle counter */ +#undef ACE_HAS_POWERPC_TIMER + +/* OS has priocntl (2) */ +#undef ACE_HAS_PRIOCNTL + +/* Platform supports the /proc file system and defines tid_t in + */ +#undef ACE_HAS_PROC_FS + +/* Define to 1 if the system has the type `prusage_t'. */ +#undef ACE_HAS_PRUSAGE_T + +/* Define to 1 if platform has POSIX threads */ +#undef ACE_HAS_PTHREADS + +/* Platform supports POSIX Threads .4a Draft 4 */ +#undef ACE_HAS_PTHREADS_DRAFT4 + +/* Platform supports POSIX Threads .4a Draft 6 */ +#undef ACE_HAS_PTHREADS_DRAFT6 + +/* Platform supports POSIX Threads .1c Draft 7 */ +#undef ACE_HAS_PTHREADS_DRAFT7 + +/* Platform supports POSIX.1c-1995 threads */ +#undef ACE_HAS_PTHREADS_STD + +/* Platform has the UNIX98 extensions to Pthreads (rwlocks) */ +#undef ACE_HAS_PTHREADS_UNIX98_EXT + +/* Define to 1 if platform has pthread_attr_setcreatesuspend_np(). */ +#undef ACE_HAS_PTHREAD_ATTR_SETCREATESUSPEND_NP + +/* Define to 1 if platform has pthread_condattr_setkind_np(). */ +#undef ACE_HAS_PTHREAD_CONDATTR_SETKIND_NP + +/* Define to 1 if platform has pthread_continue(). */ +#undef ACE_HAS_PTHREAD_CONTINUE + +/* Define to 1 if platform has pthread_continue_np(). */ +#undef ACE_HAS_PTHREAD_CONTINUE_NP + +/* Define to 1 if platform has pthread_getaffinity_np(). */ +#undef ACE_HAS_PTHREAD_GETAFFINITY_NP + +/* Define to 1 if platform has pthread_getconcurrency(). */ +#undef ACE_HAS_PTHREAD_GETCONCURRENCY + +/* Define to 1 if platform has pthread_mutexattr_setkind_np(). */ +#undef ACE_HAS_PTHREAD_MUTEXATTR_SETKIND_NP + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_PTHREAD_NP_H + +/* pthread.h declares an enum with PTHREAD_PROCESS_PRIVATE and + PTHREAD_PROCESS_SHARED values */ +#undef ACE_HAS_PTHREAD_PROCESS_ENUM + +/* Define to 1 if platform has pthread_resume_np(). */ +#undef ACE_HAS_PTHREAD_RESUME_NP + +/* Define to 1 if platform has pthread_setaffinity_np(). */ +#undef ACE_HAS_PTHREAD_SETAFFINITY_NP + +/* Define to 1 if platform has pthread_setconcurrency(). */ +#undef ACE_HAS_PTHREAD_SETCONCURRENCY + +/* Define to 1 if platform has the declaration of pthread_sigmask(). */ +#undef ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE + +/* Define to 1 if platform has pthread_suspend(). */ +#undef ACE_HAS_PTHREAD_SUSPEND + +/* Define to 1 if platform has pthread_suspend_np(). */ +#undef ACE_HAS_PTHREAD_SUSPEND_NP + +/* Purify'ing. Defined on command line. */ +#undef ACE_HAS_PURIFY + +/* Platform has pread() and pwrite() support. */ +#undef ACE_HAS_P_READ_WRITE + +/* Quantify'ing. Defined on command line. */ +#undef ACE_HAS_QUANTIFY + +/* Define to 1 to configure Reactor to use a user-space queue for + notifications */ +#undef ACE_HAS_REACTOR_NOTIFICATION_QUEUE + +/* Mutexes are inherently recursive (e.g., Win32) */ +#undef ACE_HAS_RECURSIVE_MUTEXES + +/* Platform will recurse infinitely on thread exits from TSS cleanup routines + (e.g., AIX) */ +#undef ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS + +/* Platform supports reentrant functions (i.e., all the POSIX *_r functions). + */ +#undef ACE_HAS_REENTRANT_FUNCTIONS + +/* Platform supports the POSIX regular expression library */ +#undef ACE_HAS_REGEX + +/* Platform has enum instead of int for first argument to ::{get,set}rlimit + (). The value of this macro is the enum definition, e.g., enum + __rlimit_resource, for Linux glibc 2.0. */ +#undef ACE_HAS_RLIMIT_RESOURCE_ENUM + +/* Platform has enum instead of int for first argument to ::getrusage (). The + value of this macro is the enum definition, e.g., enum __rusage_who, for + Linux glibc 2.0. */ +#undef ACE_HAS_RUSAGE_WHO_ENUM + +/* Define to 1 if platform has sched_getaffinity(). */ +#undef ACE_HAS_SCHED_GETAFFINITY + +/* Define to 1 if platform has sched_setaffinity(). */ +#undef ACE_HAS_SCHED_SETAFFINITY + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SELECT_H + +/* Compiler/platform defines a union semun for SysV shared memory */ +#undef ACE_HAS_SEMUN + +/* Define to 1 if platform has setprogname(). */ +#undef ACE_HAS_SETPROGNAME + +/* Define to 1 if platform has set_t_errno(). */ +#undef ACE_HAS_SET_T_ERRNO + +/* Platform has shm_open() */ +#undef ACE_HAS_SHM_OPEN + +/* Platform's sigaction() function takes const sigaction* as 2nd parameter */ +#undef ACE_HAS_SIGACTION_CONSTP2 + +/* Define to 1 if the system has the type `siginfo_t'. */ +#undef ACE_HAS_SIGINFO_T + +/* Platform has bug with sigismember() (HP/UX 11). */ +#undef ACE_HAS_SIGISMEMBER_BUG + +/* Platform supports the Win32 SignalObjectAndWait() function (WinNT 4.0 and + beyond). */ +#undef ACE_HAS_SIGNAL_OBJECT_AND_WAIT + +/* Define to 1 if platform has sigsuspend(). */ +#undef ACE_HAS_SIGSUSPEND + +/* Define to 1 if platform has sigtimedwait(). */ +#undef ACE_HAS_SIGTIMEDWAIT + +/* Define to 1 if `sigval_int' is a member of `union sigval'. */ +#undef ACE_HAS_SIGVAL_SIGVAL_INT + +/* Define to 1 if `sigval_ptr' is a member of `union sigval'. */ +#undef ACE_HAS_SIGVAL_SIGVAL_PTR + +/* Define to 1 if platform has sigwait(). */ +#undef ACE_HAS_SIGWAIT + +/* Define to 1 if the system has the type 'sig_atomic_t'. */ +#undef ACE_HAS_SIG_ATOMIC_T + +/* Compiler requires extern "C" functions for signals. */ +#undef ACE_HAS_SIG_C_FUNC + +/* OS/compiler uses size_t * rather than int * for socket lengths */ +#undef ACE_HAS_SIZET_SOCKET_LEN + +/* Define to 1 if `sin6_len' is a member of `sockaddr_in6'. */ +#undef ACE_HAS_SOCKADDR_IN6_SIN6_LEN + +/* Define to 1 if `sin_len' is a member of `sockaddr_in'. */ +#undef ACE_HAS_SOCKADDR_IN_SIN_LEN + +/* Platform requires (struct sockaddr *) for msg_name field of struct msghdr. + */ +#undef ACE_HAS_SOCKADDR_MSG_NAME + +/* Define to 1 if the system has the type `socklen_t'. */ +#undef ACE_HAS_SOCKLEN_T + +/* Define to 1 if the system has the type `ssize_t'. */ +#undef ACE_HAS_SSIZE_T + +/* Platform/compiler supports Standard C++ Library */ +#undef ACE_HAS_STANDARD_CPP_LIBRARY + +/* Platform has void (*)(...) prototype for pthread_key_create() destructor + (e.g., LynxOS). */ +#undef ACE_HAS_STDARG_THR_DEST + +/* */ +#undef ACE_HAS_STDCPP_STL_INCLUDES + +/* Platform provides C++ header */ +#undef ACE_HAS_STDEXCEPT_NO_H + +/* Define to 1 if platform has UNIX International Threads */ +#undef ACE_HAS_STHREADS + +/* Define to 1 if the system has the type `struct strbuf'. */ +#undef ACE_HAS_STRBUF_T + +/* Define to 1 use ACE's strdup() emulation */ +#undef ACE_HAS_STRDUP_EMULATION + +/* Platform supports STREAMS */ +#undef ACE_HAS_STREAMS + +/* Platform supports STREAM pipes */ +#undef ACE_HAS_STREAM_PIPES + +/* Use the STRICT compilation mode on Win32. */ +#undef ACE_HAS_STRICT + +/* Platform has (which contains bzero() prototype) */ +#undef ACE_HAS_STRINGS + +/* Platform/Compiler supports a String class (e.g., GNU or Win32). */ +#undef ACE_HAS_STRING_CLASS + +/* Define to 1 if platform has strnlen(). */ +#undef ACE_HAS_STRNLEN + +/* Define to 1 if platform has strsignal(). */ +#undef ACE_HAS_STRSIGNAL + +/* Compiler/platform has strange hostent API for socket *_r() calls */ +#undef ACE_HAS_STRUCT_NETDB_DATA + +/* Compiler/platform supports SVR4 dynamic linking semantics */ +#undef ACE_HAS_SVR4_DYNAMIC_LINKING + +/* Compiler/platform supports SVR4 gettimeofday() prototype but doesn't have a + prototype */ +#undef ACE_HAS_SVR4_GETTIMEOFDAY + +/* Compiler/platform supports SVR4 signal typedef. */ +#undef ACE_HAS_SVR4_SIGNAL_T + +/* Compiler/platform supports SVR4 TLI (in particular, T_GETNAME stuff). */ +#undef ACE_HAS_SVR4_TLI + +/* Define to 1 if platform has sysctl(). */ +#undef ACE_HAS_SYSCTL + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYSENT_H + +/* Platform supports System V IPC (most versions of UNIX, but not Win32) */ +#undef ACE_HAS_SYSV_IPC + +/* Define to 1 if system has SysV version of sysinfo(). */ +#undef ACE_HAS_SYSV_SYSINFO + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_FILIO_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_LOADAVG_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_PSTAT_H + +/* Compiler/platform supports _sys_siglist array */ +#undef ACE_HAS_SYS_SIGLIST + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_SOCKIO_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_SYSCALL_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_SYSINFO_H + +/* Define to 1 if platform has the header file. */ +#undef ACE_HAS_SYS_SYSTEMINFO_H + +/* Platform provides header */ +#undef ACE_HAS_SYS_XTI_H + +/* */ +#undef ACE_HAS_TANDEM_SIGNALS + +/* Compiler implements templates that support typedefs inside of classes used + as formal arguments to a template class. */ +#undef ACE_HAS_TEMPLATE_TYPEDEFS + +/* Define to 1 if system supports SysV tty API. */ +#undef ACE_HAS_TERMIO + +/* Define to 1 if system supports POSIX tty API. */ +#undef ACE_HAS_TERMIOS + +/* Platform supports threads. */ +#undef ACE_HAS_THREADS + +/* Platform allows multiple threads to call accept() on the same port (e.g., + WinNT). */ +#undef ACE_HAS_THREAD_SAFE_ACCEPT + +/* Platform has thread_self() rather than pthread_self() (e.g., DCETHREADS and + AIX) */ +#undef ACE_HAS_THREAD_SELF + +/* Compiler/platform has thread-specific storage */ +#undef ACE_HAS_THREAD_SPECIFIC_STORAGE + +/* The pthread_keycreate() routine *must* take extern C functions. */ +#undef ACE_HAS_THR_C_DEST + +/* The pthread_create() routine *must* take extern C functions. */ +#undef ACE_HAS_THR_C_FUNC + +/* Platform supports thr_keydelete (e.g,. UNIXWARE) */ +#undef ACE_HAS_THR_KEYDELETE + +/* Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem). + */ +#undef ACE_HAS_THR_MINSTACK + +/* Platform has thr_yield() */ +#undef ACE_HAS_THR_YIELD + +/* Define to 1 if platform has global timezone variable */ +#undef ACE_HAS_TIMEZONE + +/* Platform/compiler supports timezone * as second parameter to gettimeofday() + and has a prototype. */ +#undef ACE_HAS_TIMEZONE_GETTIMEOFDAY + +/* Platform supports TLI timod STREAMS module */ +#undef ACE_HAS_TIMOD_H + +/* Platform supports TLI tiuser header */ +#undef ACE_HAS_TIUSER_H + +/* Platform does not protect with extern "C" */ +#undef ACE_HAS_TIUSER_H_BROKEN_EXTERN_C + +/* Platform supports TLI. Also see ACE_TLI_TCP_DEVICE. */ +#undef ACE_HAS_TLI + +/* Platform provides TLI function prototypes */ +#undef ACE_HAS_TLI_PROTOTYPES + +/* ACE provides TSS emulation. See also ACE_DEFAULT_THREAD_KEYS. */ +#undef ACE_HAS_TSS_EMULATION + +/* Define to 1 if platform has ualarm(). */ +#undef ACE_HAS_UALARM + +/* Define to 1 if the system has the type `ucontext_t'. */ +#undef ACE_HAS_UCONTEXT_T + +/* Define to 1 if the system has the type `uint16_t'. */ +#undef ACE_HAS_UINT16_T + +/* Define to 1 if the system has the type `uint32_t'. */ +#undef ACE_HAS_UINT32_T + +/* Define to 1 if the system has the type `uint64_t'. */ +#undef ACE_HAS_UINT64_T + +/* Define to 1 if the system has the type `uint8_t'. */ +#undef ACE_HAS_UINT8_T + +/* Has inconsistent SVR4 signal stuff, but not the same as the other platforms + */ +#undef ACE_HAS_UNIXWARE_SVR4_SIGNAL_T + +/* Define to 1 if platform has vasprintf(). */ +#undef ACE_HAS_VASPRINTF + +/* Define to 1 if platform has vaswprintf(). */ +#undef ACE_HAS_VASWPRINTF + +/* Prints out console message in ACE_NOTSUP. Useful for tracking down origin + of ACE_NOTSUP. */ +#undef ACE_HAS_VERBOSE_NOTSUP + +/* Define to 1 if platform has vfwprintf(). */ +#undef ACE_HAS_VFWPRINTF + +/* Platform/compiler supports void * as second parameter to gettimeofday() and + has a prototype. */ +#undef ACE_HAS_VOIDPTR_GETTIMEOFDAY + +/* Platform requires void * for mmap(). */ +#undef ACE_HAS_VOIDPTR_MMAP + +/* OS/compiler uses void * arg 4 setsockopt() rather than const char * */ +#undef ACE_HAS_VOIDPTR_SOCKOPT + +/* Define to 1 if platform has vswprintf(). */ +#undef ACE_HAS_VSWPRINTF + +/* Platform/compiler supports wchar_t */ +#undef ACE_HAS_WCHAR + +/* Define to 1 use ACE's wcsdup() emulation */ +#undef ACE_HAS_WCSDUP_EMULATION + +/* Define to 1 if platform has wcsnlen(). */ +#undef ACE_HAS_WCSNLEN + +/* Platform/compiler supports Win32 structural exceptions. */ +#undef ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS + +/* The Win32 platform support TryEnterCriticalSection(). (WinNT 4.0 and + beyond) */ +#undef ACE_HAS_WIN32_TRYLOCK + +/* The Win32 platform supports WinSock 2.0. */ +#undef ACE_HAS_WINSOCK2 + +/* Compiler handles explicit calling of template destructor correctly. */ +#undef ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR + +/* Solaris for intel uses macros for fstat() and stat(), these are wrappers + for _fxstat() and _xstat() uses of the macros. Causes compile and runtime + problems. */ +#undef ACE_HAS_X86_STAT_MACROS + +/* Platform has the XLI version of TLI */ +#undef ACE_HAS_XLI + +/* Platform has support for multi-byte character support compliant with the + XPG4 Worldwide Portability Interface wide-character classification. */ +#undef ACE_HAS_XPG4_MULTIBYTE_CHAR + +/* Platform has Xt Intrinsics Toolkit */ +#undef ACE_HAS_XT + +/* Platform has XTI (X/Open-standardized superset of TLI). Implies ACE_HAS_TLI + but uses a different header file. */ +#undef ACE_HAS_XTI + +/* Define to 1 if platform has _InterlockedDecrement(). */ +#undef ACE_HAS__INTERLOCKEDDECREMENT + +/* Define to 1 if platform has _InterlockedExchangeAdd(). */ +#undef ACE_HAS__INTERLOCKEDEXCHANGEADD + +/* Define to 1 if platform has _InterlockedIncrement(). */ +#undef ACE_HAS__INTERLOCKEDINCREMENT + +/* Define to the *printf format specifier (e.g. "%lld") for ACE_INT64 */ +#undef ACE_INT64_FORMAT_SPECIFIER + +/* Define to signed 64 bit integer type */ +#undef ACE_INT64_TYPE + +/* Define to the type of arg 2 for `ioctl'. */ +#undef ACE_IOCTL_TYPE_ARG2 + +/* Define to 1 if platform lacks access(). */ +#undef ACE_LACKS_ACCESS + +/* Do not compile support for the "Codecs" ACE features. */ +#undef ACE_LACKS_ACE_CODECS + +/* Platform can not build ace/IOStream{,_T}.cpp. This does not necessarily + mean that the platform does not support iostreams. */ +#undef ACE_LACKS_ACE_IOSTREAM + +/* Do not compile support for the "other" ACE features, such as CORBA + handling, name services, and QoS. */ +#undef ACE_LACKS_ACE_OTHER + +/* Do not compile support for the ACE Service Configurator. */ +#undef ACE_LACKS_ACE_SVCCONF + +/* Do not compile support for the ACE Token feature. */ +#undef ACE_LACKS_ACE_TOKEN + +/* Do not compile support for the ACE UUID feature. */ +#undef ACE_LACKS_ACE_UUID + +/* Define to 1 if platform lacks alarm(). */ +#undef ACE_LACKS_ALARM + +/* Define to 1 if platform lacks alphasort(). */ +#undef ACE_LACKS_ALPHASORT + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_ARPA_INET_H + +/* Define to 1 if platform lacks asctime(). */ +#undef ACE_LACKS_ASCTIME + +/* Define to 1 if platform lacks asctime_r(). */ +#undef ACE_LACKS_ASCTIME_R + +/* No system support for replacing any previous mappings. */ +#undef ACE_LACKS_AUTO_MMAP_REPLACEMENT + +/* Platform lacks support for the standard C++ auto_ptr class */ +#undef ACE_LACKS_AUTO_PTR + +/* Define to 1 if platform lacks bsearch(). */ +#undef ACE_LACKS_BSEARCH + +/* Define to 1 to support unaligned CDR */ +#undef ACE_LACKS_CDR_ALIGNMENT + +/* Compiler does not have any istream operator>> for chars, u_chars, or signed + chars. */ +#undef ACE_LACKS_CHAR_RIGHT_SHIFTS + +/* Compiler does not have operator>> (istream &, u_char *) or operator>> + (istream &, signed char *) */ +#undef ACE_LACKS_CHAR_STAR_RIGHT_SHIFTS + +/* Define to 1 if platform lacks chdir(). */ +#undef ACE_LACKS_CHDIR + +/* Define to 1 if system lacks pthread_condattr_setpshared() */ +#undef ACE_LACKS_CONDATTR_PSHARED + +/* Platform lacks condition variables (e.g., Win32 and VxWorks) */ +#undef ACE_LACKS_COND_T + +/* pthread_cond_timedwait does *not* reset the time argument when the lock is + acquired. */ +#undef ACE_LACKS_COND_TIMEDWAIT_RESET + +/* Platform uses struct strbuf * rather than const struct strbuf * (e.g., + HP/UX 10.x) */ +#undef ACE_LACKS_CONST_STRBUF_PTR + +/* Platform forgot const in cond_timewait (e.g., HP/UX). */ +#undef ACE_LACKS_CONST_TIMESPEC_PTR + +/* Define to 1 if platform lacks difftime(). */ +#undef ACE_LACKS_DIFFTIME + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_DIRENT_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_DLFCN_H + +/* Define to 1 if platform lacks dup(). */ +#undef ACE_LACKS_DUP + +/* Define to 1 if platform lacks dup2(). */ +#undef ACE_LACKS_DUP2 + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_ERRNO_H + +/* Platform lacks the exec() family of system calls (e.g., Win32, VxWorks, + Chorus) */ +#undef ACE_LACKS_EXEC + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_EXECINFO_H + +/* Define to 1 if platform lacks fcntl(). */ +#undef ACE_LACKS_FCNTL + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_FCNTL_H + +/* Define to 1 if platform lacks fgetwc(). */ +#undef ACE_LACKS_FGETWC + +/* Define to 1 if platform lacks fgetws(). */ +#undef ACE_LACKS_FGETWS + +/* Define to 1 if the system lacks the type `struct flock'. */ +#undef ACE_LACKS_FILELOCKS + +/* Define to 1 if platform lacks fork(). */ +#undef ACE_LACKS_FORK + +/* Define to 1 if platform lacks fputws(). */ +#undef ACE_LACKS_FPUTWS + +/* Define to 1 if platform lacks fsync(). */ +#undef ACE_LACKS_FSYNC + +/* Define to 1 if platform lacks getcwd(). */ +#undef ACE_LACKS_GETCWD + +/* Define to 1 if platform lacks getegid(). */ +#undef ACE_LACKS_GETEGID + +/* Define to 1 if platform lacks geteuid(). */ +#undef ACE_LACKS_GETEUID + +/* Define to 1 if platform lacks getgid(). */ +#undef ACE_LACKS_GETGID + +/* Define to 1 if platform lacks gethostent(). */ +#undef ACE_LACKS_GETHOSTENT + +/* Define to 1 if platform lacks getipnodebyaddr(). */ +#undef ACE_LACKS_GETIPNODEBYADDR + +/* Define to 1 if platform lacks getipnodebyname(). */ +#undef ACE_LACKS_GETIPNODEBYNAME + +/* Define to 1 if platform lacks getopt(). */ +#undef ACE_LACKS_GETOPT + +/* Define to 1 if platform lacks the declaration of getopt(). */ +#undef ACE_LACKS_GETOPT_PROTOTYPE + +/* Define to 1 if platform lacks getpgid(). */ +#undef ACE_LACKS_GETPGID + +/* Define to 1 if platform lacks getpgid() declaration in . */ +#undef ACE_LACKS_GETPGID_PROTOTYPE + +/* Define to 1 if platform lacks getpid(). */ +#undef ACE_LACKS_GETPID + +/* Define to 1 if platform lacks getppid(). */ +#undef ACE_LACKS_GETPPID + +/* Platforms lacks getservbyname() (e.g., VxWorks and Chorus). */ +#undef ACE_LACKS_GETSERVBYNAME + +/* Define to 1 if platform lacks getuid(). */ +#undef ACE_LACKS_GETUID + +/* Define to 1 if platform lacks gmtime(). */ +#undef ACE_LACKS_GMTIME + +/* Define to 1 if platform lacks gmtime_r(). */ +#undef ACE_LACKS_GMTIME_R + +/* Define to 1 if platform lacks inet_aton(). */ +#undef ACE_LACKS_INET_ATON + +/* Platform can't handle "inline" keyword correctly. */ +#undef ACE_LACKS_INLINE_FUNCTIONS + +/* Define to 1 if the system lacks the type `intmax_t'. */ +#undef ACE_LACKS_INTMAX_T + +/* Define to 1 if the system lacks the type `intptr_t'. */ +#undef ACE_LACKS_INTPTR_T + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_INTTYPES_H + +/* iostream header does not declare ipfx (), opfx (), etc. */ +#undef ACE_LACKS_IOSTREAM_FX + +/* iostreams are not supported adequately on the given platform. */ +#undef ACE_LACKS_IOSTREAM_TOTALLY + +/* Define to 1 if platform lacks isatty(). */ +#undef ACE_LACKS_ISATTY + +/* Define to 1 if platform lacks isblank(). */ +#undef ACE_LACKS_ISBLANK + +/* Define to 1 if platform lacks isctype(). */ +#undef ACE_LACKS_ISCTYPE + +/* Define to 1 if platform lacks iswblank(). */ +#undef ACE_LACKS_ISWBLANK + +/* Define to 1 if platform lacks iswctype(). */ +#undef ACE_LACKS_ISWCTYPE + +/* Define to 1 if platform lacks itow(). */ +#undef ACE_LACKS_ITOW + +/* Define to 1 if the system lacks the type `key_t'. */ +#undef ACE_LACKS_KEY_T + +/* Define to 1 if platform lacks kill(). */ +#undef ACE_LACKS_KILL + +/* Platform lacks streambuf "linebuffered ()". */ +#undef ACE_LACKS_LINEBUFFERED_STREAMBUF + +/* Platform/compiler lacks the llseek() prototype. This should not be defined + if ACE_LACKS_LSEEK64_PROTOTYPE is defined. */ +#undef ACE_LACKS_LLSEEK_PROTOTYPE + +/* Define to 1 if platform lacks localtime(). */ +#undef ACE_LACKS_LOCALTIME + +/* Define to 1 if platform lacks log2(). */ +#undef ACE_LACKS_LOG2 + +/* Compiler/platform does not support the unsigned long long datatype. */ +#undef ACE_LACKS_LONGLONG_T + +/* Platform/compiler lacks the lseek64() prototype. This should not be defined + if ACE_LACKS_LLSEEK_PROTOTYPE is defined. */ +#undef ACE_LACKS_LSEEK64_PROTOTYPE + +/* Define to 1 if platform lacks lstat(). */ +#undef ACE_LACKS_LSTAT + +/* Define to 1 if platform lacks madvise(). */ +#undef ACE_LACKS_MADVISE + +/* Define to 1 if platform lacks the declaration of madvise(). */ +#undef ACE_LACKS_MADVISE_PROTOTYPE + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_MALLOC_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_MEMORY_H + +/* Define to 1 if platform lacks mkfifo(). */ +#undef ACE_LACKS_MKFIFO + +/* Define to 1 if platform lacks mkstemp(). */ +#undef ACE_LACKS_MKSTEMP + +/* Define to 1 if platform lacks the declaration of mkstemp(). */ +#undef ACE_LACKS_MKSTEMP_PROTOTYPE + +/* Define to 1 if platform lacks mktemp(). */ +#undef ACE_LACKS_MKTEMP + +/* Define to 1 if platform lacks the declaration of mktemp(). */ +#undef ACE_LACKS_MKTEMP_PROTOTYPE + +/* The platform doesn't have mmap(2) (e.g., SCO UNIX). */ +#undef ACE_LACKS_MMAP + +/* Platform/compiler doesn't have open() mode masks. */ +#undef ACE_LACKS_MODE_MASKS + +/* Platform does not have Motif X toolkit available */ +#undef ACE_LACKS_MOTIF + +/* Define to 1 if platform lacks mprotect(). */ +#undef ACE_LACKS_MPROTECT + +/* Platform defines ACE_HAS_MSG, but lacks msg_accrights{len}. */ +#undef ACE_LACKS_MSG_ACCRIGHTS + +/* Define to 1 if platform lacks msync(). */ +#undef ACE_LACKS_MSYNC + +/* Define to 1 if system lacks pthread_mutexattr_setpshared(). */ +#undef ACE_LACKS_MUTEXATTR_PSHARED + +/* Platform lacks named POSIX semaphores (e.g., Chorus) */ +#undef ACE_LACKS_NAMED_POSIX_SEM + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_NETDB_H + +/* Platform does not support reentrant netdb functions (getprotobyname_r, + getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r). */ +#undef ACE_LACKS_NETDB_REENTRANT_FUNCTIONS + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_NETINET_IN_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_NETINET_TCP_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_NET_IF_H + +/* OS requires non-null status pointer for pthread_join () */ +#undef ACE_LACKS_NULL_PTHREAD_STATUS + +/* Platform lacks std::numeric_limits<> */ +#undef ACE_LACKS_NUMERIC_LIMITS + +/* Define to 1 if platform lacks IGMPv3 "perfect" filtering of multicast + datagrams at the socket level. If defined, ACE_SOCK_Dgram_Mcast will bind + the first joined multicast group to the socket, and all future joins on + that socket will fail with an error. */ +#undef ACE_LACKS_PERFECT_MULTICAST_FILTERING + +/* Define to 1 if platform lacks pipe(). */ +#undef ACE_LACKS_PIPE + +/* Compiler doesn't support placement operator delete(void *, void *). */ +#undef ACE_LACKS_PLACEMENT_OPERATOR_DELETE + +/* Compiler complains about use of obsolete "pragma once" */ +#undef ACE_LACKS_PRAGMA_ONCE + +/* Platform/compiler lacks the pread() and pwrite() prototypes */ +#undef ACE_LACKS_PREAD_PROTOTYPE + +/* Define to 1 if the system lacks the type 'pri_t'. */ +#undef ACE_LACKS_PRI_T + +/* Define to 1 if platform lacks pthread_attr_setstack() */ +#undef ACE_LACKS_PTHREAD_ATTR_SETSTACK + +/* Define to 1 if platform lacks pthread_attr_setstackaddr(). */ +#undef ACE_LACKS_PTHREAD_ATTR_SETSTACKADDR + +/* Define to 1 if platform lacks pthread_attr_setstacksize(). */ +#undef ACE_LACKS_PTHREAD_ATTR_SETSTACKSIZE + +/* Platform lacks pthread_cancel() */ +#undef ACE_LACKS_PTHREAD_CANCEL + +/* Define to 1 if platform lacks pthread_sigmask(). */ +#undef ACE_LACKS_PTHREAD_SIGMASK + +/* Define to 1 if platform lacks pthread_thr_sigsetmask(). */ +#undef ACE_LACKS_PTHREAD_THR_SIGSETMASK + +/* Define to 1 if platform lacks pthread_yield(). */ +#undef ACE_LACKS_PTHREAD_YIELD + +/* Platform lacks, getpwnam(), etc. */ +#undef ACE_LACKS_PWD_FUNCTIONS + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_PWD_H + +/* Platform lacks getpwnam_r() methods (e.g., SGI 6.2). */ +#undef ACE_LACKS_PWD_REENTRANT_FUNCTIONS + +/* Define to 1 if platform lacks qsort(). */ +#undef ACE_LACKS_QSORT + +/* Define to 1 if platform lacks readdir_r(). */ +#undef ACE_LACKS_READDIR_R + +/* Define to 1 if platform lacks readlink(). */ +#undef ACE_LACKS_READLINK + +/* Define to 1 if platform lacks readv(). */ +#undef ACE_LACKS_READV + +/* Define to 1 if platform lacks realpath(). */ +#undef ACE_LACKS_REALPATH + +/* Define to 1 if platform lacks recvmsg(). */ +#undef ACE_LACKS_RECVMSG + +/* Define to 1 if platform lacks rename(). */ +#undef ACE_LACKS_RENAME + +/* Platform/compiler lacks {get,set}rlimit() function (e.g., VxWorks, Chorus, + and SCO UNIX) */ +#undef ACE_LACKS_RLIMIT + +/* Define to 1 if platform lacks the declaration of {get,set}rlimit(). */ +#undef ACE_LACKS_RLIMIT_PROTOTYPE + +/* Define to 1 if system lacks pthread_rwlockattr_setpshared(). */ +#undef ACE_LACKS_RWLOCKATTR_PSHARED + +/* Define to 1 if the system lacks the type `rwlock_t'. */ +#undef ACE_LACKS_RWLOCK_T + +/* Define to 1 if platform lacks sbrk(). */ +#undef ACE_LACKS_SBRK + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SCHED_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SEARCH_H + +/* Define to 1 if platform lacks seekdir(). */ +#undef ACE_LACKS_SEEKDIR + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SEMAPHORE_H + +/* Define to 1 if the system lacks the type `struct sembuf'. */ +#undef ACE_LACKS_SEMBUF_T + +/* Define to 1 if platform lacks sendmsg(). */ +#undef ACE_LACKS_SENDMSG + +/* Platform lacks pthread_attr_setdetachstate() (e.g., HP/UX 10.x) */ +#undef ACE_LACKS_SETDETACH + +/* Define to 1 if platform lacks setegid(). */ +#undef ACE_LACKS_SETEGID + +/* Define to 1 if platform lacks setenv(). */ +#undef ACE_LACKS_SETENV + +/* Define to 1 if platform lacks seteuid(). */ +#undef ACE_LACKS_SETEUID + +/* Define to 1 if platform lacks setgid(). */ +#undef ACE_LACKS_SETGID + +/* Define to 1 if platform lacks setpgid(). */ +#undef ACE_LACKS_SETPGID + +/* Define to 1 if platform lacks setpgid() declaration in . */ +#undef ACE_LACKS_SETPGID_PROTOTYPE + +/* Define to 1 if platform lacks setregid(). */ +#undef ACE_LACKS_SETREGID + +/* Define to 1 if platform lacks setregid() declaration in . */ +#undef ACE_LACKS_SETREGID_PROTOTYPE + +/* Define to 1 if platform lacks setreuid(). */ +#undef ACE_LACKS_SETREUID + +/* Define to 1 if platform lacks setreuid() declaration in . */ +#undef ACE_LACKS_SETREUID_PROTOTYPE + +/* Platform lacks pthread_attr_setsched() (e.g. MVS) */ +#undef ACE_LACKS_SETSCHED + +/* Define to 1 if platform lacks setsid(). */ +#undef ACE_LACKS_SETSID + +/* Define to 1 if platform lacks setuid(). */ +#undef ACE_LACKS_SETUID + +/* Define to 1 if platform lacks sigaction(). */ +#undef ACE_LACKS_SIGACTION + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SIGINFO_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SIGNAL_H + +/* Platform lacks "signed char" type (broken!) */ +#undef ACE_LACKS_SIGNED_CHAR + +/* Define to 1 if the system lacks the type `sigset_t'. */ +#undef ACE_LACKS_SIGSET + +/* Define to 1 if `si_addr' is not a member of `siginfo_t'. */ +#undef ACE_LACKS_SI_ADDR + +/* Define to 1 if platform lacks socketpair(). */ +#undef ACE_LACKS_SOCKETPAIR + +/* Platform doesn't support SO_SNDBUF/SO_RCVBUF (used in TAO) */ +#undef ACE_LACKS_SOCKET_BUFSIZ + +/* Compiler doesn't support static data member templates */ +#undef ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_STDINT_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_STDLIB_H + +/* Define to 1 if platform lacks strcasecmp(). */ +#undef ACE_LACKS_STRCASECMP + +/* Define to 1 if platform lacks a declaration for strcasecmp() */ +#undef ACE_LACKS_STRCASECMP_PROTOTYPE + +/* Define to 1 if platform lacks strchr(). */ +#undef ACE_LACKS_STRCHR + +/* Define to 1 if platform lacks strdup(). */ +#undef ACE_LACKS_STRDUP + +/* Define to 1 if platform lacks strerror(). */ +#undef ACE_LACKS_STRERROR + +/* Define to 1 if platform lacks strftime(). */ +#undef ACE_LACKS_STRFTIME + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_STRINGS_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_STRING_H + +/* Define to 1 if platform lacks strncasecmp(). */ +#undef ACE_LACKS_STRNCASECMP + +/* Define to 1 if platform lacks a declaration for strncasecmp() */ +#undef ACE_LACKS_STRNCASECMP_PROTOTYPE + +/* Define to 1 if platform lacks the declaration of strnlen(). */ +#undef ACE_LACKS_STRNLEN_PROTOTYPE + +/* Platform lacks stropts.h */ +#undef ACE_LACKS_STROPTS_H + +/* Define to 1 if platform lacks strpbrk(). */ +#undef ACE_LACKS_STRPBRK + +/* Define to 1 if platform lacks strptime(). */ +#undef ACE_LACKS_STRPTIME + +/* Define to 1 if platform lacks the declaration of strptime(). */ +#undef ACE_LACKS_STRPTIME_PROTOTYPE + +/* Define to 1 if platform lacks strrchr(). */ +#undef ACE_LACKS_STRRCHR + +/* Define to 1 if the system lacks the type `struct strrecvfd'. */ +#undef ACE_LACKS_STRRECVFD + +/* Define to 1 if platform lacks strspn(). */ +#undef ACE_LACKS_STRSPN + +/* Define to 1 if platform lacks strtod(). */ +#undef ACE_LACKS_STRTOD + +/* Platform/compiler lacks the strtok_r() prototype */ +#undef ACE_LACKS_STRTOK_R_PROTOTYPE + +/* Define to 1 if platform lacks strtol(). */ +#undef ACE_LACKS_STRTOL + +/* Define to 1 if platform lacks strtoll(). */ +#undef ACE_LACKS_STRTOLL + +/* Define to 1 if platform lacks a declaration for strtoll() */ +#undef ACE_LACKS_STRTOLL_PROTOTYPE + +/* Define to 1 if platform lacks strtoul(). */ +#undef ACE_LACKS_STRTOUL + +/* Define to 1 if platform lacks strtoull(). */ +#undef ACE_LACKS_STRTOULL + +/* Define to 1 if platform lacks a declaration for strtoull() */ +#undef ACE_LACKS_STRTOULL_PROTOTYPE + +/* Define to 1 if the system lacks the type `struct dirent'. */ +#undef ACE_LACKS_STRUCT_DIR + +/* Define to 1 if the system lacks the type 'suseconds_t'. */ +#undef ACE_LACKS_SUSECONDS_T + +/* Define to 1 if platform lacks swab(). */ +#undef ACE_LACKS_SWAB + +/* Define to 1 if platform lacks syscall(). */ +#undef ACE_LACKS_SYSCALL + +/* Define to 1 if platform lacks sysconf(). */ +#undef ACE_LACKS_SYSCONF + +/* Define to 1 if platform lacks system(). */ +#undef ACE_LACKS_SYSTEM + +/* Platform lacks SYSV message queue prototypes */ +#undef ACE_LACKS_SYSV_MSQ_PROTOS + +/* Platform lacks System V shared memory (e.g., Win32 and VxWorks) */ +#undef ACE_LACKS_SYSV_SHMEM + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_IOCTL_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_IPC_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_MMAN_H + +/* Platform lacks sys/msg.h (e.g., Chorus and VxWorks) */ +#undef ACE_LACKS_SYS_MSG_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_PARAM_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_RESOURCE_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_SELECT_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_SEM_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_SHM_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_SOCKET_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_STAT_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_SYSCTL_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_TIME_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_TYPES_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_UIO_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_UN_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_SYS_WAIT_H + +/* OS does not support TCP_NODELAY */ +#undef ACE_LACKS_TCP_NODELAY + +/* Define to 1 if platform lacks telldir(). */ +#undef ACE_LACKS_TELLDIR + +/* Define to 1 if platform lacks tempnam(). */ +#undef ACE_LACKS_TEMPNAM + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_TERMIOS_H + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_TERMIO_H + +/* Platform lacks pthread_attr_setscope() */ +#undef ACE_LACKS_THREAD_PROCESS_SCOPING + +/* Define to 1 if platform lacks the declarations of recv_timedwait, + send_timedwait, etc. */ +#undef ACE_LACKS_TIMEDWAIT_PROTOTYPES + +/* Platform does not define timepec_t as a typedef for struct timespec. */ +#undef ACE_LACKS_TIMESPEC_T + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_TIME_H + +/* Define to 1 if platform lacks towlower(). */ +#undef ACE_LACKS_TOWLOWER + +/* Define to 1 if platform lacks towupper(). */ +#undef ACE_LACKS_TOWUPPER + +/* Define to 1 if platform lacks truncate(). */ +#undef ACE_LACKS_TRUNCATE + +/* Header files lack t_errno for TLI */ +#undef ACE_LACKS_T_ERRNO + +/* Define to 1 if platform lacks the declaration of ualarm(). */ +#undef ACE_LACKS_UALARM_PROTOTYPE + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_UCONTEXT_H + +/* Define to 1 if the system lacks the type `uintmax_t'. */ +#undef ACE_LACKS_UINTMAX_T + +/* Define to 1 if the system lacks the type `uintptr_t'. */ +#undef ACE_LACKS_UINTPTR_T + +/* Define to 1 if platform lacks umask(). */ +#undef ACE_LACKS_UMASK + +/* Define to 1 if platform lacks uname(). */ +#undef ACE_LACKS_UNAME + +/* */ +#undef ACE_LACKS_UNBUFFERED_STREAMBUF + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_UNISTD_H + +/* ACE platform has no UNIX domain sockets */ +#undef ACE_LACKS_UNIX_DOMAIN_SOCKETS + +/* Platform lacks full signal support (e.g., Win32 and Chorus). */ +#undef ACE_LACKS_UNIX_SIGNALS + +/* Define to 1 if platform lacks unlink(). */ +#undef ACE_LACKS_UNLINK + +/* Define to 1 if platform lacks unsetenv(). */ +#undef ACE_LACKS_UNSETENV + +/* Define to 1 if the system lacks the type 'useconds_t'. */ +#undef ACE_LACKS_USECONDS_T + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_UTIME_H + +/* Define to 1 if the system lacks the type `struct utsname'. */ +#undef ACE_LACKS_UTSNAME_T + +/* Define to 1 if the system lacks the type `u_long_long_t'. */ +#undef ACE_LACKS_U_LONGLONG_T + +/* Define to 1 if platform lacks vsnprintf(). */ +#undef ACE_LACKS_VSNPRINTF + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_WCHAR_H + +/* Define to 1 if the system lacks the type `wchar_t'. */ +#undef ACE_LACKS_WCHAR_T + +/* Define to 1 if platform lacks wcscasecmp(). */ +#undef ACE_LACKS_WCSCASECMP + +/* Define to 1 if platform lacks wcscat(). */ +#undef ACE_LACKS_WCSCAT + +/* Define to 1 if platform lacks wcschr(). */ +#undef ACE_LACKS_WCSCHR + +/* Define to 1 if platform lacks wcscmp(). */ +#undef ACE_LACKS_WCSCMP + +/* Define to 1 if platform lacks wcscpy(). */ +#undef ACE_LACKS_WCSCPY + +/* Define to 1 if platform lacks wcscspn(). */ +#undef ACE_LACKS_WCSCSPN + +/* Define to 1 if platform lacks wcsdup(). */ +#undef ACE_LACKS_WCSDUP + +/* Define to 1 if platform lacks wcslen(). */ +#undef ACE_LACKS_WCSLEN + +/* Define to 1 if platform lacks wcsncasecmp(). */ +#undef ACE_LACKS_WCSNCASECMP + +/* Define to 1 if platform lacks wcsncat(). */ +#undef ACE_LACKS_WCSNCAT + +/* Define to 1 if platform lacks wcsncmp(). */ +#undef ACE_LACKS_WCSNCMP + +/* Define to 1 if platform lacks wcsncpy(). */ +#undef ACE_LACKS_WCSNCPY + +/* Define to 1 if platform lacks wcsnicmp(). */ +#undef ACE_LACKS_WCSNICMP + +/* Define to 1 if platform lacks wcspbrk(). */ +#undef ACE_LACKS_WCSPBRK + +/* Define to 1 if platform lacks wcsrchr(). */ +#undef ACE_LACKS_WCSRCHR + +/* Define to 1 if platform lacks wcsspn(). */ +#undef ACE_LACKS_WCSSPN + +/* Define to 1 if platform lacks wcsstr(). */ +#undef ACE_LACKS_WCSSTR + +/* Define to 1 if platform lacks wcstod(). */ +#undef ACE_LACKS_WCSTOD + +/* Define to 1 if platform lacks wcstok(). */ +#undef ACE_LACKS_WCSTOK + +/* Define to 1 if platform lacks wcstol(). */ +#undef ACE_LACKS_WCSTOL + +/* Define to 1 if platform lacks wcstoll(). */ +#undef ACE_LACKS_WCSTOLL + +/* Define to 1 if platform lacks a declaration for wcstoll() */ +#undef ACE_LACKS_WCSTOLL_PROTOTYPE + +/* Define to 1 if platform lacks wcstoul(). */ +#undef ACE_LACKS_WCSTOUL + +/* Define to 1 if platform lacks wcstoull(). */ +#undef ACE_LACKS_WCSTOULL + +/* Define to 1 if platform lacks a declaration for wcstoull() */ +#undef ACE_LACKS_WCSTOULL_PROTOTYPE + +/* Define to 1 if platform lacks the header file. */ +#undef ACE_LACKS_WCTYPE_H + +/* Define to 1 if platform lacks writev(). */ +#undef ACE_LACKS_WRITEV + +/* Define to environment variable used for DLL search path */ +#undef ACE_LD_SEARCH_PATH + +/* typedef for ACE_LOFF_T */ +#undef ACE_LOFF_T_TYPEDEF + +/* Renames "main (int, char *[])", for platforms such as g++/VxWorks that + don't allow main. Requires the use of ACE_HAS_NONSTATIC_OBJECT_MANAGER. */ +#undef ACE_MAIN + +/* */ +#undef ACE_MALLOC_ALIGN + +/* */ +#undef ACE_MAP_PRIVATE + +/* Define to 1 if platform has 1 parameter mkdir() */ +#undef ACE_MKDIR_LACKS_MODE + +/* Compile using multi-thread libraries */ +#undef ACE_MT_SAFE + +/* Turns off debugging features */ +#undef ACE_NDEBUG + +/* Necessary with some compilers to pass ACE_TTY_IO as parameter to + DEV_Connector. */ +#undef ACE_NEEDS_DEV_IO_CONVERSION + +/* Compiler requires a definition for a "hidden" function, e.g., a private, + unimplemented copy constructor or assignment operator. The SGI C++ compiler + needs this, in template classes, with + ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA. */ +#undef ACE_NEEDS_FUNC_DEFINITIONS + +/* Required by platforms with small default stacks. */ +#undef ACE_NEEDS_HUGE_THREAD_STACKSIZE + +/* OS has LWPs, and when the priority of a bound thread is set, then the LWP + priority must be set also. */ +#undef ACE_NEEDS_LWP_PRIO_SET + +/* Platform needs to #include to get thread scheduling defs. */ +#undef ACE_NEEDS_SCHED_H + +/* Compiler's 'new' throws exception on failure (ANSI C++ behavior). */ +#undef ACE_NEW_THROWS_EXCEPTIONS + +/* Turns off the LM_DEBUG and LM_ERROR logging macros... */ +#undef ACE_NLOGGING + +/* Explicitly disable ACE inlining */ +#undef ACE_NO_INLINE + +/* Turns off the tracing feature. */ +#undef ACE_NTRACE + +/* Defines the page size of the system (not used on Win32 or with + ACE_HAS_GETPAGESIZE). */ +#undef ACE_PAGE_SIZE + +/* Flag that denotes the symbol should be exported from the DSO/DLL. */ +#undef ACE_Proper_Export_Flag + +/* Flag that denotes the symbol should be imported from the DSO/DLL. */ +#undef ACE_Proper_Import_Flag + +/* Platform redefines the t_... names (UnixWare) */ +#undef ACE_REDEFINES_XTI_FUNCTIONS + +/* shm_open() requires a leading slash in name */ +#undef ACE_SHM_OPEN_REQUIRES_ONE_SLASH + +/* Size of the native "double" type */ +#undef ACE_SIZEOF_DOUBLE + +/* Size of the native "float" type */ +#undef ACE_SIZEOF_FLOAT + +/* Size of the native "int" type */ +#undef ACE_SIZEOF_INT + +/* Size of the native "long" type */ +#undef ACE_SIZEOF_LONG + +/* Size of the native "long double" type */ +#undef ACE_SIZEOF_LONG_DOUBLE + +/* Size of the native "long long" type */ +#undef ACE_SIZEOF_LONG_LONG + +/* Size of the native "short" type */ +#undef ACE_SIZEOF_SHORT + +/* Size of the native "pointer to void" type */ +#undef ACE_SIZEOF_VOID_P + +/* Size of the native "wchar_t" type */ +#undef ACE_SIZEOF_WCHAR + +/* Define to the *printf format specifier (e.g. "%u") for size_t */ +#undef ACE_SIZE_T_FORMAT_SPECIFIER + +/* Define to the *printf format specifier (e.g. "%d") for ssize_t */ +#undef ACE_SSIZE_T_FORMAT_SPECIFIER + +/* Define to function that is equivalent to strcasecmp() */ +#undef ACE_STRCASECMP_EQUIVALENT + +/* Define to function that is equivalent to strdup() */ +#undef ACE_STRDUP_EQUIVALENT + +/* Define to function that is equivalent to strncasecmp() */ +#undef ACE_STRNCASECMP_EQUIVALENT + +/* Define to function that is equivalent to strtoll() */ +#undef ACE_STRTOLL_EQUIVALENT + +/* Define to function that is equivalent to strtoull() */ +#undef ACE_STRTOULL_EQUIVALENT + +/* Compiler's template mechanism must use a pragma. This is used for AIX's C++ + compiler. */ +#undef ACE_TEMPLATES_REQUIRE_PRAGMA + +/* Compiler's template mechanim must see source code (i.e., .cpp files). This + is used for GNU G++. */ +#undef ACE_TEMPLATES_REQUIRE_SOURCE + +/* Specify this if you don't want threads to inherit parent thread's + ACE_Log_Msg properties. */ +#undef ACE_THREADS_DONT_INHERIT_LOG_MSG + +/* */ +#undef ACE_THR_PRI_FIFO_DEF + +/* */ +#undef ACE_TIMER_SKEW + +/* Device the platform uses for TCP on TLI. Only needed if not /dev/tcp. */ +#undef ACE_TLI_TCP_DEVICE + +/* Define to the *printf format specifier (e.g. "%llu") for ACE_UINT64 */ +#undef ACE_UINT64_FORMAT_SPECIFIER + +/* Define to unsigned 64 bit integer type */ +#undef ACE_UINT64_TYPE + +/* Platform uses assembly symbols instead of C symbols in dlsym() */ +#undef ACE_USES_ASM_SYMBOL_IN_DLSYM + +/* Enable IPv6 support on platforms that don't have IPv6 turned on by default + */ +#undef ACE_USES_IPV4_IPV6_MIGRATION + +/* Some files, such as ace/streams.h, want to include new style C++ stream + headers. These headers are iomanip, ios, iostream, istream, ostream, + fstream and streambuf. If _all_ of these headers aren't available, then + assume that only iostream.h and fstream.h are available. */ +#undef ACE_USES_OLD_IOSTREAMS + +/* When linking MFC as a static library is desired */ +#undef ACE_USES_STATIC_MFC + +/* Platform has its standard C++ library in the namespace std. */ +#undef ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB + +/* ACE is built to use wide characters internally */ +#undef ACE_USES_WCHAR + +/* The OS/platform supports the poll() event demultiplexor */ +#undef ACE_USE_POLL + +/* Define to 1 to embed RCS ID strings into compiled object files. */ +#undef ACE_USE_RCSID + +/* For Win32: Use Select_Reactor as default implementation of Reactor instead + of WFMO_Reactor. */ +#undef ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL + +/* Define to function that is equivalent to wcscasecmp() */ +#undef ACE_WCSCASECMP_EQUIVALENT + +/* Define to function that is equivalent to wcsdup() */ +#undef ACE_WCSDUP_EQUIVALENT + +/* Define to function that is equivalent to wcsncasecmp() */ +#undef ACE_WCSNCASECMP_EQUIVALENT + +/* Define to function that is equivalent to wcstoll() */ +#undef ACE_WCSTOLL_EQUIVALENT + +/* Define to function that is equivalent to wcstoull() */ +#undef ACE_WCSTOULL_EQUIVALENT + +/* Configure for use on Win32 */ +#undef ACE_WIN32 + +/* A parameter list indicating the version of WinSock (e.g., "1, 1" is version + 1.1). */ +#undef ACE_WSOCK_VERSION + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Configure for use on AIX */ +#undef AIX + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* GNU Win32 environement */ +#undef CYGWIN32 + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* */ +#undef DEC_CXX + +/* Configure for use on Digital Unix */ +#undef DIGITAL_UNIX + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_FSTREAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOMANIP + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOS + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_IOSTREAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ISTREAM + +/* Define to 1 if you have the `dld' library (-ldld). */ +#undef HAVE_LIBDLD + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OSTREAM + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STREAMBUF + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Configure for use on HP-UX */ +#undef HPUX + +/* Configure for use on HP-UX 10 */ +#undef HPUX_10 + +/* Configure for use on HP-UX 11 */ +#undef HPUX_11 + +/* */ +#undef IP_ADD_MEMBERSHIP + +/* */ +#undef IP_DROP_MEMBERSHIP + +/* Configure for use on Irix 5 */ +#undef IRIX5 + +/* Configure for use on Irix 6 */ +#undef IRIX6 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Maximum thread priority */ +#undef PTHREAD_MAX_PRIORITY + +/* Minimum thread priority */ +#undef PTHREAD_MIN_PRIORITY + +/* */ +#undef PTHREAD_STACK_MIN + +/* */ +#undef SCO + +/* The size of `double', as computed by sizeof. */ +#undef SIZEOF_DOUBLE + +/* The size of `float', as computed by sizeof. */ +#undef SIZEOF_FLOAT + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `long double', as computed by sizeof. */ +#undef SIZEOF_LONG_DOUBLE + +/* The size of `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `signed char', as computed by sizeof. */ +#undef SIZEOF_SIGNED_CHAR + +/* The size of `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P + +/* The size of `wchar_t', as computed by sizeof. */ +#undef SIZEOF_WCHAR_T + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Configure for use on UnixWare */ +#undef UNIXWARE + +/* */ +#undef UNIXWARE_2_0 + +/* */ +#undef UNIXWARE_2_1 + +/* */ +#undef UNIXWARE_7_1 + +/* Configure for use on VxWorks */ +#undef VXWORKS + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER + +/* Enable ACE inlining */ +#undef __ACE_INLINE__ + +/* */ +#undef __IOCTL_VERSIONED__ + +/* */ +#undef __NO_INCLUDE_WARN__ + + + + +#endif /* ACE_CONFIG_H */ + + +// Local Variables: +// mode:C++ +// End: + + diff --git a/externals/ace/delme b/externals/ace/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/dep/src/ace/gethrtime.cpp b/externals/ace/gethrtime.cpp similarity index 99% rename from dep/src/ace/gethrtime.cpp rename to externals/ace/gethrtime.cpp index 163645cd68b..69de03153a1 100644 --- a/dep/src/ace/gethrtime.cpp +++ b/externals/ace/gethrtime.cpp @@ -58,4 +58,3 @@ ACE_GETHRTIME_NAME (void) #endif /* ! ACE_HAS_PENTIUM */ } #endif /* ghs */ - diff --git a/dep/include/ace/iosfwd.h b/externals/ace/iosfwd.h similarity index 96% rename from dep/include/ace/iosfwd.h rename to externals/ace/iosfwd.h index 1dc1c581213..b9576ebae97 100644 --- a/dep/include/ace/iosfwd.h +++ b/externals/ace/iosfwd.h @@ -4,7 +4,7 @@ /** * @file iosfwd.h * - * $Id: iosfwd.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: iosfwd.h 89098 2010-02-21 21:51:41Z schmidt $ * * @author Irfan Pyarali * @@ -19,6 +19,7 @@ */ //============================================================================= + #ifndef ACE_IOSFWD_H #define ACE_IOSFWD_H @@ -43,6 +44,7 @@ # if !defined (ACE_USES_OLD_IOSTREAMS) # include /**/ +#define ACE_HAS_CPP98_IOSTREAMS 1 # else // @note If these forward declarations don't work (e.g. aren't // portable), we may have to include "ace/streams.h" as a last @@ -96,4 +98,3 @@ #endif /* ACE_LACKS_IOSTREAM_TOTALLY */ #endif /* ACE_IOSFWD_H */ - diff --git a/dep/include/ace/os_include/arpa/os_inet.h b/externals/ace/os_include/arpa/os_inet.h similarity index 94% rename from dep/include/ace/os_include/arpa/os_inet.h rename to externals/ace/os_include/arpa/os_inet.h index 37538c0824d..b97f7c6e419 100644 --- a/dep/include/ace/os_include/arpa/os_inet.h +++ b/externals/ace/os_include/arpa/os_inet.h @@ -6,7 +6,7 @@ * * definitions for internet operations * - * $Id: os_inet.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_inet.h 85015 2009-04-03 12:27:59Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -32,9 +32,9 @@ } #endif /* !ACE_LACKS_ARPA_INET_H */ -#if defined (ACE_VXWORKS) +#if defined (ACE_USES_INETLIB_H) # include /**/ -#endif /* ACE_VXWORKS */ +#endif /* ACE_USES_INETLIB_H */ /** * In some environments it is useful to swap the bytes on write, for @@ -72,4 +72,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_ARPA_OS_INET_H */ - diff --git a/dep/include/ace/os_include/net/os_if.h b/externals/ace/os_include/net/os_if.h similarity index 89% rename from dep/include/ace/os_include/net/os_if.h rename to externals/ace/os_include/net/os_if.h index da099f89dc2..3dcf5918f8c 100644 --- a/dep/include/ace/os_include/net/os_if.h +++ b/externals/ace/os_include/net/os_if.h @@ -6,7 +6,7 @@ * * sockets local interfaces * - * $Id: os_if.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_if.h 88719 2010-01-26 12:55:03Z sowayaa $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -25,17 +25,10 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #if !defined (ACE_LACKS_NET_IF_H) - // This part if to avoid STL name conflict with the map structure - // in net/if.h. -# if defined (ACE_HAS_STL_MAP_CONFLICT) -# define map _Resource_Allocation_Map_ -# endif /* ACE_HAS_STL_MAP_CONFLICT */ - extern "C" { # include /**/ - } -# if defined (ACE_HAS_STL_MAP_CONFLICT) -# undef map -# endif /* ACE_HAS_STL_MAP_CONFLICT */ +# if defined (ACE_HAS_NET_IF_DL_H) +# include /**/ +# endif /* ACE_HAS_NET_IF_DL_H */ # if defined (HPUX) && defined (IOR) /* HP-UX 11.11 defines IOR in /usr/include/pa/inline.h and we don't want that definition. See IOP_IORC.h. @@ -117,4 +110,3 @@ struct ifconf { #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_NET_OS_IF_H */ - diff --git a/dep/include/ace/os_include/netinet/os_in.h b/externals/ace/os_include/netinet/os_in.h similarity index 92% rename from dep/include/ace/os_include/netinet/os_in.h rename to externals/ace/os_include/netinet/os_in.h index c90fb8fa8d4..dff894aadce 100644 --- a/dep/include/ace/os_include/netinet/os_in.h +++ b/externals/ace/os_include/netinet/os_in.h @@ -1,3 +1,4 @@ + // -*- C++ -*- //============================================================================= @@ -6,7 +7,7 @@ * * Internet address family * - * $Id: os_in.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_in.h 85438 2009-05-26 06:56:46Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -31,31 +32,24 @@ # include /**/ #endif /* ACE_HAS_WINSOCK2 */ -#if !defined (ACE_LACKS_NETINET_IN_H) -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# define queue _Queue_ -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ - extern "C" { -# include /**/ - } -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# undef queue -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ -#endif /* !ACE_LACKS_NETINET_IN_H */ - // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +#if !defined (ACE_LACKS_NETINET_IN_H) +# include /**/ +#endif /* !ACE_LACKS_NETINET_IN_H */ + + # if defined (ACE_HAS_PHARLAP_RT) # define ACE_IPPROTO_TCP SOL_SOCKET # else # define ACE_IPPROTO_TCP IPPROTO_TCP # endif /* ACE_HAS_PHARLAP_RT */ -# if !defined (ACE_HAS_IP_MULTICAST) && defined (ACE_LACKS_IP_ADD_MEMBERSHIP) +# if !defined (ACE_HAS_IP_MULTICAST) && defined (ACE_LACKS_IP_ADD_MEMBERSHIP) // Even if ACE_HAS_IP_MULTICAST is not defined, if IP_ADD_MEMBERSHIP // is defined, assume that the ip_mreq struct is also defined // (presumably in netinet/in.h). @@ -183,4 +177,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_NETINET_OS_IN_H */ - diff --git a/dep/include/ace/os_include/netinet/os_tcp.h b/externals/ace/os_include/netinet/os_tcp.h similarity index 91% rename from dep/include/ace/os_include/netinet/os_tcp.h rename to externals/ace/os_include/netinet/os_tcp.h index 9f60cd91af8..aca6590bc94 100644 --- a/dep/include/ace/os_include/netinet/os_tcp.h +++ b/externals/ace/os_include/netinet/os_tcp.h @@ -6,7 +6,7 @@ * * definitions for the Internet Transmission Control Protocol (TCP) * - * $Id: os_tcp.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_tcp.h 88499 2010-01-12 19:34:34Z olli $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -26,7 +26,7 @@ #if !defined (ACE_LACKS_NETINET_TCP_H) # include /**/ -#endif /* !ACE_LACKS_NETIINET_TCP_H */ +#endif /* !ACE_LACKS_NETINET_TCP_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus @@ -44,4 +44,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_NETINET_OS_TCP_H */ - diff --git a/dep/include/ace/os_include/os_aio.h b/externals/ace/os_include/os_aio.h similarity index 99% rename from dep/include/ace/os_include/os_aio.h rename to externals/ace/os_include/os_aio.h index 2011403ff3c..4ec9fe9d127 100644 --- a/dep/include/ace/os_include/os_aio.h +++ b/externals/ace/os_include/os_aio.h @@ -45,4 +45,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_AIO_H */ - diff --git a/dep/include/ace/os_include/os_assert.h b/externals/ace/os_include/os_assert.h similarity index 99% rename from dep/include/ace/os_include/os_assert.h rename to externals/ace/os_include/os_assert.h index 1c1ed53d852..fdca573fe8e 100644 --- a/dep/include/ace/os_include/os_assert.h +++ b/externals/ace/os_include/os_assert.h @@ -44,4 +44,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_ASSERT_H */ - diff --git a/dep/include/ace/os_include/os_byteswap.h b/externals/ace/os_include/os_byteswap.h similarity index 99% rename from dep/include/ace/os_include/os_byteswap.h rename to externals/ace/os_include/os_byteswap.h index fd1ff253fce..b55754ee810 100644 --- a/dep/include/ace/os_include/os_byteswap.h +++ b/externals/ace/os_include/os_byteswap.h @@ -39,4 +39,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_BYTESWAP_H */ - diff --git a/dep/include/ace/os_include/os_complex.h b/externals/ace/os_include/os_complex.h similarity index 99% rename from dep/include/ace/os_include/os_complex.h rename to externals/ace/os_include/os_complex.h index 27ce474b6dc..5e6546f82df 100644 --- a/dep/include/ace/os_include/os_complex.h +++ b/externals/ace/os_include/os_complex.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_COMPLEX_H */ - diff --git a/dep/include/ace/os_include/os_cpio.h b/externals/ace/os_include/os_cpio.h similarity index 99% rename from dep/include/ace/os_include/os_cpio.h rename to externals/ace/os_include/os_cpio.h index 09e536d521a..2c06e8eb2f5 100644 --- a/dep/include/ace/os_include/os_cpio.h +++ b/externals/ace/os_include/os_cpio.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_CPIO_H */ - diff --git a/dep/include/ace/os_include/os_ctype.h b/externals/ace/os_include/os_ctype.h similarity index 89% rename from dep/include/ace/os_include/os_ctype.h rename to externals/ace/os_include/os_ctype.h index 61a3df06375..4b5b65120c5 100644 --- a/dep/include/ace/os_include/os_ctype.h +++ b/externals/ace/os_include/os_ctype.h @@ -6,7 +6,7 @@ * * character types * - * $Id: os_ctype.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_ctype.h 83520 2008-11-03 08:54:08Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -36,6 +36,9 @@ extern "C" // @todo move the is* and is* emulation methods in ACE_OS here // and let ACE_OS just call them. +#if !defined (ACE_HAS_CTYPE_T) +typedef int ctype_t; +#endif #ifdef __cplusplus } @@ -43,4 +46,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_CTYPE_H */ - diff --git a/dep/include/ace/os_include/os_dirent.h b/externals/ace/os_include/os_dirent.h similarity index 95% rename from dep/include/ace/os_include/os_dirent.h rename to externals/ace/os_include/os_dirent.h index 4e81e94d1bf..034bacd006d 100644 --- a/dep/include/ace/os_include/os_dirent.h +++ b/externals/ace/os_include/os_dirent.h @@ -6,7 +6,7 @@ * * format of directory entries * - * $Id: os_dirent.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_dirent.h 82985 2008-10-08 18:15:30Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -64,6 +64,7 @@ struct dirent { }; #define ACE_DIRENT dirent +#define ACE_HAS_TCHAR_DIRENT struct ACE_DIR { /// The name of the directory we are looking into @@ -82,6 +83,7 @@ struct ACE_DIR { int started_reading_; }; #elif defined (ACE_WIN32) && (__BORLANDC__) && defined (ACE_USES_WCHAR) +#define ACE_HAS_TCHAR_DIRENT #define ACE_DIRENT wdirent typedef wDIR ACE_DIR; #else @@ -106,4 +108,3 @@ int alphasort (const void *, const void *); #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_DIRENT_H */ - diff --git a/dep/include/ace/os_include/os_dlfcn.h b/externals/ace/os_include/os_dlfcn.h similarity index 99% rename from dep/include/ace/os_include/os_dlfcn.h rename to externals/ace/os_include/os_dlfcn.h index f7691ad8a58..0f74437fb80 100644 --- a/dep/include/ace/os_include/os_dlfcn.h +++ b/externals/ace/os_include/os_dlfcn.h @@ -99,4 +99,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_DLFCN_H */ - diff --git a/externals/ace/os_include/os_errno.h b/externals/ace/os_include/os_errno.h new file mode 100644 index 00000000000..53c907624bd --- /dev/null +++ b/externals/ace/os_include/os_errno.h @@ -0,0 +1,343 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_errno.h + * + * system error numbers + * + * $Id: os_errno.h 85122 2009-04-20 16:34:19Z johnnyw $ + * + * @author Don Hinton + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_ERRNO_H +#define ACE_OS_INCLUDE_OS_ERRNO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_ERRNO_H) +# include /**/ +#endif /* !ACE_LACKS_ERRNO_H */ + +#if defined (ACE_VXWORKS) +// Needed for VxWorks to pickup errnoSet() +#include /**/ +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_WIN32) + // error code mapping for windows + +# if !defined (ETIME) +# define ETIME ERROR_SEM_TIMEOUT +# endif /* !ETIME */ +# if !defined (EWOULDBLOCK) +# define EWOULDBLOCK WSAEWOULDBLOCK +# endif /* !EWOULDBLOCK */ +# if !defined (EINPROGRESS) +# define EINPROGRESS WSAEINPROGRESS +# endif /* !EINPROGRESS */ +# if !defined (EALREADY) +# define EALREADY WSAEALREADY +# endif /* !EALREADY */ +# if !defined (ENOTSOCK) +# define ENOTSOCK WSAENOTSOCK +# endif /* !ENOTSOCK */ +# if !defined (EDESTADDRREQ) +# define EDESTADDRREQ WSAEDESTADDRREQ +# endif /* !EDESTADDRREQ */ +# if !defined (EMSGSIZE) +# define EMSGSIZE WSAEMSGSIZE +# endif /* !EMSGSIZE */ +# if !defined (EPROTOTYPE) +# define EPROTOTYPE WSAEPROTOTYPE +# endif /* !EPROTOTYPE */ +# if !defined (ENOPROTOOPT) +# define ENOPROTOOPT WSAENOPROTOOPT +# endif /* !ENOPROTOOPT */ +# if !defined (EPROTONOSUPPORT) +# define EPROTONOSUPPORT WSAEPROTONOSUPPORT +# endif /* !EPROTONOSUPPORT */ +# if !defined (ESOCKTNOSUPPORT) +# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +# endif /* !ESOCKTNOSUPPORT */ +# if !defined (EOPNOTSUPP) +# define EOPNOTSUPP WSAEOPNOTSUPP +# endif /* !EOPNOTSUPP */ +# if !defined (EPFNOSUPPORT) +# define EPFNOSUPPORT WSAEPFNOSUPPORT +# endif /* !EPFNOSUPPORT */ +# if !defined (EAFNOSUPPORT) +# define EAFNOSUPPORT WSAEAFNOSUPPORT +# endif /* !EAFNOSUPPORT */ +# if !defined (EADDRINUSE) +# define EADDRINUSE WSAEADDRINUSE +# endif /* !EADDRINUSE */ +# if !defined (EADDRNOTAVAIL) +# define EADDRNOTAVAIL WSAEADDRNOTAVAIL +# endif /* !EADDRNOTAVAIL */ +# if !defined (ENETDOWN) +# define ENETDOWN WSAENETDOWN +# endif /* !ENETDOWN */ +# if !defined (ENETUNREACH) +# define ENETUNREACH WSAENETUNREACH +# endif /* !ENETUNREACH */ +# if !defined (ENETRESET) +# define ENETRESET WSAENETRESET +# endif /* !ENETRESET */ +# if !defined (ECONNABORTED) +# define ECONNABORTED WSAECONNABORTED +# endif /* !ECONNABORTED */ +# if !defined (ECONNRESET) +# define ECONNRESET WSAECONNRESET +# endif /* !ECONNRESET */ +# if !defined (ENOBUFS) +# define ENOBUFS WSAENOBUFS +# endif /* !ENOBUFS */ +# if !defined (EISCONN) +# define EISCONN WSAEISCONN +# endif /* !EISCONN */ +# if !defined (ENOTCONN) +# define ENOTCONN WSAENOTCONN +# endif /* !ENOTCONN */ +# if !defined (ESHUTDOWN) +# define ESHUTDOWN WSAESHUTDOWN +# endif /* !ESHUTDOWN */ +# if !defined (ETOOMANYREFS) +# define ETOOMANYREFS WSAETOOMANYREFS +# endif /* !ETOOMANYREFS */ +# if !defined (ETIMEDOUT) +# define ETIMEDOUT WSAETIMEDOUT +# endif /* !ETIMEDOUT */ +# if !defined (ECONNREFUSED) +# define ECONNREFUSED WSAECONNREFUSED +# endif /* !ECONNREFUSED */ +# if !defined (ELOOP) +# define ELOOP WSAELOOP +# endif /* !ELOOP */ +# if !defined (EHOSTDOWN) +# define EHOSTDOWN WSAEHOSTDOWN +# endif /* !EHOSTDOWN */ +# if !defined (EHOSTUNREACH) +# define EHOSTUNREACH WSAEHOSTUNREACH +# endif /* !EHOSTUNREACH */ +# if !defined (EPROCLIM) +# define EPROCLIM WSAEPROCLIM +# endif /* !EPROCLIM */ +# if !defined (EUSERS) +# define EUSERS WSAEUSERS +# endif /* !EUSERS */ +# if !defined (EDQUOT) +# define EDQUOT WSAEDQUOT +# endif /* !EDQUOT */ +# if !defined (ESTALE) +# define ESTALE WSAESTALE +# endif /* !ESTALE */ +# if !defined (EREMOTE) +# define EREMOTE WSAEREMOTE +# endif /* !EREMOTE */ + + // Grrr! ENAMETOOLONG and ENOTEMPTY are already defined by the horrible + // 'standard' library. + // #define ENAMETOOLONG WSAENAMETOOLONG +# if !defined (EADDRINUSE) +# define EADDRINUSE WSAEADDRINUSE +# endif /* EADDRINUSE*/ + + // CE needs this... +# if !defined (EPERM) +# define EPERM ERROR_ACCESS_DENIED +# endif +#endif /* ACE_WIN32 */ + +#if defined (ACE_HAS_H_ERRNO) +void herror (const char *str); +#endif /* ACE_HAS_H_ERRNO */ + +#if defined (ACE_LACKS_ERRNO_H) +# if !defined (EPERM) +# define EPERM 1 +# endif /* EPERM */ +# if !defined (ENOENT) +# define ENOENT 2 +# endif /* ENOENT */ +# if !defined (ESRCH) +# define ESRCH 3 +# endif /* ESRCH */ +# if !defined (EINTR) +# define EINTR 4 +# endif /* EINTR */ +# if !defined (EIO) +# define EIO 5 +# endif /* EIO */ +# if !defined (ENXIO) +# define ENXIO 6 +# endif /* ENXIO */ +# if !defined (E2BIG) +# define E2BIG 7 +# endif /* E2BIG */ +# if !defined (ENOEXEC) +# define ENOEXEC 8 +# endif /* ENOEXEC */ +# if !defined (EBADF) +# define EBADF 9 +# endif /* EBADF */ +# if !defined (ECHILD) +# define ECHILD 10 +# endif /* ECHILD */ +# if !defined (EAGAIN) +# define EAGAIN 11 +# endif /* EAGAIN */ +# if !defined (ENOMEM) +# define ENOMEM 12 +# endif /* ENOMEM */ +# if !defined (EACCES) +# define EACCES 13 +# endif /* EACCES */ +# if !defined (EFAULT) +# define EFAULT 14 +# endif /* EFAULT */ +# if !defined (EBUSY) +# define EBUSY 16 +# endif /* EBUSY */ +# if !defined (EEXIST) +# define EEXIST 17 +# endif /* EEXIST */ +# if !defined (EXDEV) +# define EXDEV 18 +# endif /* EXDEV */ +# if !defined (ENODEV) +# define ENODEV 19 +# endif /* ENODEV */ +# if !defined (ENOTDIR) +# define ENOTDIR 20 +# endif /* ENOTDIR */ +# if !defined (EISDIR) +# define EISDIR 21 +# endif /* EISDIR */ +# if !defined (EINVAL) +# define EINVAL 22 +# endif /* EINVAL */ +# if !defined (ENFILE) +# define ENFILE 23 +# endif /* ENFILE */ +# if !defined (EMFILE) +# define EMFILE 24 +# endif /* EMFILE */ +# if !defined (ENOTTY) +# define ENOTTY 25 +# endif /* ENOTTY */ +# if !defined (EFBIG) +# define EFBIG 27 +# endif /* EFBIG */ +# if !defined (ENOSPC) +# define ENOSPC 28 +# endif /* ENOSPC */ +# if !defined (ESPIPE) +# define ESPIPE 29 +# endif /* ESPIPE */ +# if !defined (EROFS) +# define EROFS 30 +# endif /* EROFS */ +# if !defined (EMLINK) +# define EMLINK 31 +# endif /* EMLINK */ +# if !defined (EPIPE) +# define EPIPE 32 +# endif /* EPIPE */ +# if !defined (EDOM) +# define EDOM 33 +# endif /* EDOM */ +# if !defined (ERANGE) +# define ERANGE 34 +# endif /* ERANGE */ +# if !defined (EDEADLK) +# define EDEADLK 36 +# endif /* EDEADLK */ +# if !defined (ENAMETOOLONG) +# define ENAMETOOLONG 38 +# endif /* ENAMETOOLONG */ +# if !defined (ENOLCK) +# define ENOLCK 39 +# endif /* ENOLCK */ +# if !defined (ENOSYS) +# define ENOSYS 40 +# endif /* ENOSYS */ +# if !defined (ENOTEMPTY) +# define ENOTEMPTY 41 +# endif /* ENOTEMPTY */ +#endif /* ACE_LACKS_ERRNO_H */ + +#if defined (ACE_LACKS_T_ERRNO) +extern int t_errno; +#endif /* ACE_LACKS_T_ERRNO */ + +#if !defined (ENOSYS) +# define ENOSYS EFAULT /* Operation not supported or unknown error. */ +#endif /* !ENOSYS */ + +#if !defined (ENOTSUP) +# define ENOTSUP ENOSYS /* Operation not supported. */ +#endif /* !ENOTSUP */ + +#if !defined (ESUCCESS) +# define ESUCCESS 0 +#endif /* !ESUCCESS */ + +#if !defined (EIDRM) +# define EIDRM 0 +#endif /* !EIDRM */ + +#if !defined (ENFILE) +# define ENFILE EMFILE /* No more socket descriptors are available. */ +#endif /* !ENFILE */ + +#if !defined (ECOMM) + // Not the same, but ECONNABORTED is provided on NT. +# define ECOMM ECONNABORTED +#endif /* ECOMM */ + +#if !defined (EDEADLK) +# define EDEADLK 1000 /* Some large number.... */ +#endif /* !EDEADLK */ + +#if !defined (ENXIO) /* Needed in SOCK_Dgram_Mcast */ +# define ENXIO 6 +#endif /* ENXIO */ + +#if !defined (ETIMEDOUT) && defined (ETIME) +# define ETIMEDOUT ETIME +#endif /* ETIMEDOUT */ + +#if !defined (ETIME) && defined (ETIMEDOUT) +# define ETIME ETIMEDOUT +#endif /* ETIMED */ + +#if !defined (EBUSY) +# define EBUSY ETIME +#endif /* EBUSY */ + +#if !defined (ECANCELED) +# define ECANCELED 125 +#endif /* ECANCELED */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_ERRNO_H */ diff --git a/dep/include/ace/os_include/os_fcntl.h b/externals/ace/os_include/os_fcntl.h similarity index 99% rename from dep/include/ace/os_include/os_fcntl.h rename to externals/ace/os_include/os_fcntl.h index ad5beeb9511..048ff62ae6e 100644 --- a/dep/include/ace/os_include/os_fcntl.h +++ b/externals/ace/os_include/os_fcntl.h @@ -104,4 +104,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_FCNTL_H */ - diff --git a/dep/include/ace/os_include/os_fenv.h b/externals/ace/os_include/os_fenv.h similarity index 99% rename from dep/include/ace/os_include/os_fenv.h rename to externals/ace/os_include/os_fenv.h index a178c04c91b..cbf5ab41100 100644 --- a/dep/include/ace/os_include/os_fenv.h +++ b/externals/ace/os_include/os_fenv.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_FENV_H */ - diff --git a/dep/include/ace/os_include/os_float.h b/externals/ace/os_include/os_float.h similarity index 99% rename from dep/include/ace/os_include/os_float.h rename to externals/ace/os_include/os_float.h index 6b114a5dc3e..ac4b2f8f961 100644 --- a/dep/include/ace/os_include/os_float.h +++ b/externals/ace/os_include/os_float.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_FLOAT_H */ - diff --git a/dep/include/ace/os_include/os_fmtmsg.h b/externals/ace/os_include/os_fmtmsg.h similarity index 99% rename from dep/include/ace/os_include/os_fmtmsg.h rename to externals/ace/os_include/os_fmtmsg.h index 391e8606e27..74251a950d6 100644 --- a/dep/include/ace/os_include/os_fmtmsg.h +++ b/externals/ace/os_include/os_fmtmsg.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_FMTMSG_H */ - diff --git a/dep/include/ace/os_include/os_fnmatch.h b/externals/ace/os_include/os_fnmatch.h similarity index 99% rename from dep/include/ace/os_include/os_fnmatch.h rename to externals/ace/os_include/os_fnmatch.h index 2f592ef46e1..36726e293ae 100644 --- a/dep/include/ace/os_include/os_fnmatch.h +++ b/externals/ace/os_include/os_fnmatch.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_FNMATCH_H */ - diff --git a/dep/include/ace/os_include/os_ftw.h b/externals/ace/os_include/os_ftw.h similarity index 99% rename from dep/include/ace/os_include/os_ftw.h rename to externals/ace/os_include/os_ftw.h index ab4655f241b..225d3251339 100644 --- a/dep/include/ace/os_include/os_ftw.h +++ b/externals/ace/os_include/os_ftw.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_FTW_H */ - diff --git a/dep/include/ace/os_include/os_glob.h b/externals/ace/os_include/os_glob.h similarity index 99% rename from dep/include/ace/os_include/os_glob.h rename to externals/ace/os_include/os_glob.h index 2ffdbab53e6..0ced3a36234 100644 --- a/dep/include/ace/os_include/os_glob.h +++ b/externals/ace/os_include/os_glob.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_GLOB_H */ - diff --git a/dep/include/ace/os_include/os_grp.h b/externals/ace/os_include/os_grp.h similarity index 99% rename from dep/include/ace/os_include/os_grp.h rename to externals/ace/os_include/os_grp.h index bc0741e9de2..74bb6e64737 100644 --- a/dep/include/ace/os_include/os_grp.h +++ b/externals/ace/os_include/os_grp.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_GRP_H */ - diff --git a/dep/include/ace/os_include/os_iconv.h b/externals/ace/os_include/os_iconv.h similarity index 99% rename from dep/include/ace/os_include/os_iconv.h rename to externals/ace/os_include/os_iconv.h index 14a69870112..33b061cd789 100644 --- a/dep/include/ace/os_include/os_iconv.h +++ b/externals/ace/os_include/os_iconv.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_ICONV_H */ - diff --git a/dep/include/ace/os_include/os_intrin.h b/externals/ace/os_include/os_intrin.h similarity index 99% rename from dep/include/ace/os_include/os_intrin.h rename to externals/ace/os_include/os_intrin.h index d56951b6b57..37b669500e2 100644 --- a/dep/include/ace/os_include/os_intrin.h +++ b/externals/ace/os_include/os_intrin.h @@ -55,4 +55,3 @@ LONG __cdecl _InterlockedExchangeAdd (LONG volatile *Addend, LONG Value); #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_INTRIN_H */ - diff --git a/dep/include/ace/os_include/os_inttypes.h b/externals/ace/os_include/os_inttypes.h similarity index 99% rename from dep/include/ace/os_include/os_inttypes.h rename to externals/ace/os_include/os_inttypes.h index 86105a723a6..2f0c188699e 100644 --- a/dep/include/ace/os_include/os_inttypes.h +++ b/externals/ace/os_include/os_inttypes.h @@ -44,4 +44,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_INTTYPES_H */ - diff --git a/dep/include/ace/os_include/os_iso646.h b/externals/ace/os_include/os_iso646.h similarity index 99% rename from dep/include/ace/os_include/os_iso646.h rename to externals/ace/os_include/os_iso646.h index bccc85f17ad..0c5ab2ae4aa 100644 --- a/dep/include/ace/os_include/os_iso646.h +++ b/externals/ace/os_include/os_iso646.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_ISO646_H */ - diff --git a/dep/include/ace/os_include/os_kstat.h b/externals/ace/os_include/os_kstat.h similarity index 99% rename from dep/include/ace/os_include/os_kstat.h rename to externals/ace/os_include/os_kstat.h index 5ca91673d8e..31836cd27d0 100644 --- a/dep/include/ace/os_include/os_kstat.h +++ b/externals/ace/os_include/os_kstat.h @@ -41,4 +41,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_KSTAT_H */ - diff --git a/dep/include/ace/os_include/os_langinfo.h b/externals/ace/os_include/os_langinfo.h similarity index 99% rename from dep/include/ace/os_include/os_langinfo.h rename to externals/ace/os_include/os_langinfo.h index 29648b459d8..bfcd67cc2dc 100644 --- a/dep/include/ace/os_include/os_langinfo.h +++ b/externals/ace/os_include/os_langinfo.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_LANGINFO_H */ - diff --git a/dep/include/ace/os_include/os_libgen.h b/externals/ace/os_include/os_libgen.h similarity index 99% rename from dep/include/ace/os_include/os_libgen.h rename to externals/ace/os_include/os_libgen.h index 5692f5effe1..ca24a4d7f9b 100644 --- a/dep/include/ace/os_include/os_libgen.h +++ b/externals/ace/os_include/os_libgen.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_LIBGEN_H */ - diff --git a/dep/include/ace/os_include/os_limits.h b/externals/ace/os_include/os_limits.h similarity index 97% rename from dep/include/ace/os_include/os_limits.h rename to externals/ace/os_include/os_limits.h index 87eb978d541..a128efcc060 100644 --- a/dep/include/ace/os_include/os_limits.h +++ b/externals/ace/os_include/os_limits.h @@ -6,7 +6,7 @@ * * implementation-defined constants * - * $Id: os_limits.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_limits.h 84972 2009-03-25 19:09:06Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -102,7 +102,7 @@ extern "C" # define ACE_IOV_MAX IOV_MAX #endif /* ACE_IOV_MAX */ -#if defined (ACE_VXWORKS) && ((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x660)) && !defined (__RTP__) +#if defined (ACE_VXWORKS) && ((ACE_VXWORKS >= 0x620) && (ACE_VXWORKS <= 0x670)) && !defined (__RTP__) # if defined (PIPE_BUF) && (PIPE_BUF == -1) # undef PIPE_BUF # endif @@ -141,4 +141,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_LIMITS_H */ - diff --git a/dep/include/ace/os_include/os_local.h b/externals/ace/os_include/os_local.h similarity index 99% rename from dep/include/ace/os_include/os_local.h rename to externals/ace/os_include/os_local.h index 64ff0d4d06f..b5752f9ab95 100644 --- a/dep/include/ace/os_include/os_local.h +++ b/externals/ace/os_include/os_local.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_LOCAL_H */ - diff --git a/dep/include/ace/os_include/os_math.h b/externals/ace/os_include/os_math.h similarity index 99% rename from dep/include/ace/os_include/os_math.h rename to externals/ace/os_include/os_math.h index 8a1fcd84790..6fb53cb1576 100644 --- a/dep/include/ace/os_include/os_math.h +++ b/externals/ace/os_include/os_math.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_MATH_H */ - diff --git a/dep/include/ace/os_include/os_monetary.h b/externals/ace/os_include/os_monetary.h similarity index 99% rename from dep/include/ace/os_include/os_monetary.h rename to externals/ace/os_include/os_monetary.h index 731dbc11210..6e956885ad6 100644 --- a/dep/include/ace/os_include/os_monetary.h +++ b/externals/ace/os_include/os_monetary.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_MONETARY_H */ - diff --git a/dep/include/ace/os_include/os_mqueue.h b/externals/ace/os_include/os_mqueue.h similarity index 99% rename from dep/include/ace/os_include/os_mqueue.h rename to externals/ace/os_include/os_mqueue.h index 186d10697e8..7b3cbb9209a 100644 --- a/dep/include/ace/os_include/os_mqueue.h +++ b/externals/ace/os_include/os_mqueue.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_MQUEUE_H */ - diff --git a/dep/include/ace/os_include/os_ndbm.h b/externals/ace/os_include/os_ndbm.h similarity index 99% rename from dep/include/ace/os_include/os_ndbm.h rename to externals/ace/os_include/os_ndbm.h index f3decb0064f..042dcebf2ff 100644 --- a/dep/include/ace/os_include/os_ndbm.h +++ b/externals/ace/os_include/os_ndbm.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_NDBM_H */ - diff --git a/dep/include/ace/os_include/os_netdb.h b/externals/ace/os_include/os_netdb.h similarity index 91% rename from dep/include/ace/os_include/os_netdb.h rename to externals/ace/os_include/os_netdb.h index 7c08f6df081..798bf9b7a2b 100644 --- a/dep/include/ace/os_include/os_netdb.h +++ b/externals/ace/os_include/os_netdb.h @@ -6,7 +6,7 @@ * * definitions for network database operations * - * $Id: os_netdb.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_netdb.h 84660 2009-03-01 20:22:37Z olli $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -27,18 +27,6 @@ #include "ace/os_include/netinet/os_in.h" #include "ace/os_include/os_limits.h" -#if !defined (ACE_LACKS_NETDB_H) -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# define queue _Queue_ -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ - extern "C" { -# include /**/ - } -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# undef queue -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ -#endif /* !ACE_LACKS_NETDB_H */ - #if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) # include /**/ #endif /* ACE_VXWORKS */ @@ -49,6 +37,10 @@ extern "C" { #endif /* __cplusplus */ +#if !defined (ACE_LACKS_NETDB_H) +# include /**/ +#endif /* !ACE_LACKS_NETDB_H */ + #if defined (ACE_LACKS_HOSTENT) struct hostent { char *h_name; /* official name of host */ @@ -106,4 +98,3 @@ struct servent { #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_NETDB_H */ - diff --git a/dep/include/ace/os_include/os_nl_types.h b/externals/ace/os_include/os_nl_types.h similarity index 99% rename from dep/include/ace/os_include/os_nl_types.h rename to externals/ace/os_include/os_nl_types.h index 2b14f55c7ec..e043f6ae6d3 100644 --- a/dep/include/ace/os_include/os_nl_types.h +++ b/externals/ace/os_include/os_nl_types.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_NL_TYPES_H */ - diff --git a/dep/include/ace/os_include/os_pdh.h b/externals/ace/os_include/os_pdh.h similarity index 99% rename from dep/include/ace/os_include/os_pdh.h rename to externals/ace/os_include/os_pdh.h index 4dd5b582f31..5c60c60d10e 100644 --- a/dep/include/ace/os_include/os_pdh.h +++ b/externals/ace/os_include/os_pdh.h @@ -43,4 +43,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_PDH_H */ - diff --git a/dep/include/ace/os_include/os_pdhmsg.h b/externals/ace/os_include/os_pdhmsg.h similarity index 99% rename from dep/include/ace/os_include/os_pdhmsg.h rename to externals/ace/os_include/os_pdhmsg.h index 4bd09ba9d54..2156236e07c 100644 --- a/dep/include/ace/os_include/os_pdhmsg.h +++ b/externals/ace/os_include/os_pdhmsg.h @@ -39,4 +39,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_PDHMSG_H */ - diff --git a/dep/include/ace/os_include/os_poll.h b/externals/ace/os_include/os_poll.h similarity index 99% rename from dep/include/ace/os_include/os_poll.h rename to externals/ace/os_include/os_poll.h index e9597e5d50e..646c1bb853c 100644 --- a/dep/include/ace/os_include/os_poll.h +++ b/externals/ace/os_include/os_poll.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_POLL_H */ - diff --git a/dep/include/ace/os_include/os_pthread.h b/externals/ace/os_include/os_pthread.h similarity index 100% rename from dep/include/ace/os_include/os_pthread.h rename to externals/ace/os_include/os_pthread.h index c45fc4cf802..368f4254a34 100644 --- a/dep/include/ace/os_include/os_pthread.h +++ b/externals/ace/os_include/os_pthread.h @@ -49,6 +49,7 @@ extern "C" pthread_t pthread_self (void); # endif /* DIGITAL_UNIX */ # endif /* ACE_HAS_PTHREADS */ + #if !defined (ACE_LACKS_PTHREAD_H) extern "C" { # if defined (ACE_TANDEM_T1248_PTHREADS) @@ -421,4 +422,3 @@ public: #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_PTHREAD_H */ - diff --git a/dep/include/ace/os_include/os_pwd.h b/externals/ace/os_include/os_pwd.h similarity index 99% rename from dep/include/ace/os_include/os_pwd.h rename to externals/ace/os_include/os_pwd.h index f3cba066af9..b1bc94af381 100644 --- a/dep/include/ace/os_include/os_pwd.h +++ b/externals/ace/os_include/os_pwd.h @@ -56,4 +56,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_PWD_H */ - diff --git a/dep/include/ace/os_include/os_regex.h b/externals/ace/os_include/os_regex.h similarity index 99% rename from dep/include/ace/os_include/os_regex.h rename to externals/ace/os_include/os_regex.h index 94606e45e58..1c856da26f0 100644 --- a/dep/include/ace/os_include/os_regex.h +++ b/externals/ace/os_include/os_regex.h @@ -46,4 +46,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_REGEX_H */ - diff --git a/dep/include/ace/os_include/os_sched.h b/externals/ace/os_include/os_sched.h similarity index 90% rename from dep/include/ace/os_include/os_sched.h rename to externals/ace/os_include/os_sched.h index 15279dbeef3..f06541b8ca8 100644 --- a/dep/include/ace/os_include/os_sched.h +++ b/externals/ace/os_include/os_sched.h @@ -6,7 +6,7 @@ * * execution scheduling (REALTIME) * - * $Id: os_sched.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_sched.h 85102 2009-04-17 14:04:36Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -37,11 +37,15 @@ extern "C" #endif /* __cplusplus */ #if !defined (__cpu_set_t_defined) || !defined (ACE_HAS_CPU_SET_T) +#if defined (ACE_HAS_CPUSET_T) + typedef cpuset_t cpu_set_t; +#else # define ACE_CPU_SETSIZE 1024 typedef struct { ACE_UINT32 bit_array_[ACE_CPU_SETSIZE / (8 * sizeof (ACE_UINT32))]; } cpu_set_t; +#endif #endif /* !ACE_HAS_CPU_SET_T || !__cpu_set_t_defined */ #ifdef __cplusplus @@ -50,4 +54,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SCHED_H */ - diff --git a/dep/include/ace/os_include/os_search.h b/externals/ace/os_include/os_search.h similarity index 99% rename from dep/include/ace/os_include/os_search.h rename to externals/ace/os_include/os_search.h index b67d902e9af..605fd365c09 100644 --- a/dep/include/ace/os_include/os_search.h +++ b/externals/ace/os_include/os_search.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SEARCH_H */ - diff --git a/dep/include/ace/os_include/os_semaphore.h b/externals/ace/os_include/os_semaphore.h similarity index 99% rename from dep/include/ace/os_include/os_semaphore.h rename to externals/ace/os_include/os_semaphore.h index e6ae6b19b40..7fad7dafb4e 100644 --- a/dep/include/ace/os_include/os_semaphore.h +++ b/externals/ace/os_include/os_semaphore.h @@ -75,4 +75,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SEMAPHORE_H */ - diff --git a/dep/include/ace/os_include/os_setjmp.h b/externals/ace/os_include/os_setjmp.h similarity index 99% rename from dep/include/ace/os_include/os_setjmp.h rename to externals/ace/os_include/os_setjmp.h index e5261965cd8..2ab4a18a9f9 100644 --- a/dep/include/ace/os_include/os_setjmp.h +++ b/externals/ace/os_include/os_setjmp.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SETJMP_H */ - diff --git a/dep/include/ace/os_include/os_signal.h b/externals/ace/os_include/os_signal.h similarity index 89% rename from dep/include/ace/os_include/os_signal.h rename to externals/ace/os_include/os_signal.h index 029e5553921..dbda2a67b4e 100644 --- a/dep/include/ace/os_include/os_signal.h +++ b/externals/ace/os_include/os_signal.h @@ -6,7 +6,7 @@ * * signals * - * $Id: os_signal.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_signal.h 87480 2009-11-11 11:38:15Z olli $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -58,25 +58,9 @@ extern "C" { #endif /* __cplusplus */ -#if defined (ACE_LACKS_SIGSET) +#if defined (ACE_LACKS_SIGSET) && !defined (__MINGW32__) typedef u_int sigset_t; -#endif /* ACE_LACKS_SIGSET */ - -#if defined (ACE_HAS_SIG_MACROS) -# undef sigemptyset -# undef sigfillset -# undef sigaddset -# undef sigdelset -# undef sigismember -#endif /* ACE_HAS_SIG_MACROS */ - -// This must come after signal.h is #included. It's to counteract -// the sigemptyset and sigfillset #defines, which only happen -// when __OPTIMIZE__ is #defined (really!) on Linux. -#if defined (linux) && defined (__OPTIMIZE__) -# undef sigemptyset -# undef sigfillset -#endif /* linux && __OPTIMIZE__ */ +#endif /* ACE_LACKS_SIGSET && !sigset_t */ #if !defined (ACE_HAS_SIG_ATOMIC_T) typedef int sig_atomic_t; @@ -134,6 +118,14 @@ extern "C" # define SIGALRM 0 #endif /* SIGALRM */ +#if !defined (SIGABRT) +# define SIGABRT 0 +#endif /* SIGABRT */ + +#if !defined (SIGTERM) +# define SIGTERM 0 +#endif /* SIGTERM */ + #if !defined (SIG_DFL) # define SIG_DFL ((__sighandler_t) 0) #endif /* SIG_DFL */ @@ -163,13 +155,17 @@ extern "C" // All other platforms set NSIG to one greater than the // highest-numbered signal. # define ACE_NSIG NSIG -#endif /* __Lynx__ */ +#endif /* ACE_VXWORKS */ + +#if defined (ACE_HAS_WINCE) + typedef void (__cdecl * __sighandler_t)(int); +#endif #if defined (ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES) - // Prototypes for both signal() and struct sigaction are consistent.. + // Prototypes for both signal() and struct sigaction are consistent.. typedef void (*ACE_SignalHandler)(int); typedef void (*ACE_SignalHandlerV)(int); -#elif defined (ACE_HAS_LYNXOS_SIGNALS) || defined (ACE_HAS_TANDEM_SIGNALS) +#elif defined (ACE_HAS_LYNXOS4_SIGNALS) || defined (ACE_HAS_TANDEM_SIGNALS) typedef void (*ACE_SignalHandler)(...); typedef void (*ACE_SignalHandlerV)(...); #elif defined (ACE_HAS_SVR4_SIGNAL_T) @@ -251,4 +247,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SIGNAL_H */ - diff --git a/dep/include/ace/os_include/os_spawn.h b/externals/ace/os_include/os_spawn.h similarity index 99% rename from dep/include/ace/os_include/os_spawn.h rename to externals/ace/os_include/os_spawn.h index ffa80163f50..0f825640ff9 100644 --- a/dep/include/ace/os_include/os_spawn.h +++ b/externals/ace/os_include/os_spawn.h @@ -44,4 +44,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SPAWN_H */ - diff --git a/dep/include/ace/os_include/os_stdarg.h b/externals/ace/os_include/os_stdarg.h similarity index 99% rename from dep/include/ace/os_include/os_stdarg.h rename to externals/ace/os_include/os_stdarg.h index 7a9fcf5a928..0e9d234b55e 100644 --- a/dep/include/ace/os_include/os_stdarg.h +++ b/externals/ace/os_include/os_stdarg.h @@ -48,4 +48,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STDARG_H */ - diff --git a/dep/include/ace/os_include/os_stdbool.h b/externals/ace/os_include/os_stdbool.h similarity index 99% rename from dep/include/ace/os_include/os_stdbool.h rename to externals/ace/os_include/os_stdbool.h index e739fddf26d..ddb3f8e0ddb 100644 --- a/dep/include/ace/os_include/os_stdbool.h +++ b/externals/ace/os_include/os_stdbool.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STDBOOL_H */ - diff --git a/dep/include/ace/os_include/os_stddef.h b/externals/ace/os_include/os_stddef.h similarity index 74% rename from dep/include/ace/os_include/os_stddef.h rename to externals/ace/os_include/os_stddef.h index 34e6001925f..55ec501921d 100644 --- a/dep/include/ace/os_include/os_stddef.h +++ b/externals/ace/os_include/os_stddef.h @@ -6,7 +6,7 @@ * * standard type definitions * - * $Id: os_stddef.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_stddef.h 89759 2010-04-06 06:07:24Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -36,28 +36,6 @@ extern "C" { #endif /* __cplusplus */ -//FUZZ: disable check_for_NULL -// NULL pointer constant -#if defined (ACE_LACKS_NULL) -# undef NULL -# if defined(__cplusplus) -# define NULL 0 -# else -# define NULL ((void *)0) -# endif -#endif /* ACE_LACKS_NULL */ -//FUZZ: enable check_for_NULL - -/* - Integer constant expression of type size_t, the value of which is the offset - in bytes to the structure member (member-designator), from the beginning of - its structure (type). -*/ -#if defined (ACE_LACKS_OFFSETOF) -# undef offsetof -# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif /* ACE_LACKS_OFFSETOF */ - // Signed integer type of the result of subtracting two pointers. #if defined (ACE_LACKS_PTRDIFF_T) # if !defined (ACE_PTRDIFF_T_TYPE) @@ -76,7 +54,7 @@ extern "C" */ #if defined (ACE_LACKS_WCHAR_T) # if !defined (ACE_WCHAR_T_TYPE) -# define ACE_WCHAR_T_TYPE long; +# define ACE_WCHAR_T_TYPE long # endif /* !ACE_WCHAR_T_TYPE */ typedef ACE_WCHAR_T_TYPE wchar_t; #endif /* ACE_LACKS_WCHAR_T */ @@ -84,7 +62,7 @@ extern "C" // Unsigned integer type of the result of the sizeof operator. #if defined (ACE_LACKS_SIZE_T) # if !defined (ACE_SIZE_T_TYPE) -# define ACE_SIZE_T_TYPE unsigned int; +# define ACE_SIZE_T_TYPE unsigned int # endif /* !ACE_SIZE_T_TYPE */ typedef ACE_SIZE_T_TYPE size_t; #endif /* ACE_LACKS_SIZE_T */ @@ -95,4 +73,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STDDEF_H */ - diff --git a/dep/include/ace/os_include/os_stdint.h b/externals/ace/os_include/os_stdint.h similarity index 100% rename from dep/include/ace/os_include/os_stdint.h rename to externals/ace/os_include/os_stdint.h index 3cd849de612..ac6fec664c5 100644 --- a/dep/include/ace/os_include/os_stdint.h +++ b/externals/ace/os_include/os_stdint.h @@ -130,6 +130,7 @@ _POSIX_V6_LPBIG_OFFBIG programming environment. // @todo move the ACE_INT## typedefs here so that ACE_INT64 will // always be available. + // @todo perhaps add macros #ifdef __cplusplus @@ -138,4 +139,3 @@ _POSIX_V6_LPBIG_OFFBIG programming environment. #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STDINT_H */ - diff --git a/dep/include/ace/os_include/os_stdio.h b/externals/ace/os_include/os_stdio.h similarity index 99% rename from dep/include/ace/os_include/os_stdio.h rename to externals/ace/os_include/os_stdio.h index 23cec4d8eba..e9f452024ff 100644 --- a/dep/include/ace/os_include/os_stdio.h +++ b/externals/ace/os_include/os_stdio.h @@ -85,4 +85,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STDIO_H */ - diff --git a/dep/include/ace/os_include/os_stdlib.h b/externals/ace/os_include/os_stdlib.h similarity index 83% rename from dep/include/ace/os_include/os_stdlib.h rename to externals/ace/os_include/os_stdlib.h index 4813f4e2bcc..6a675d54e29 100644 --- a/dep/include/ace/os_include/os_stdlib.h +++ b/externals/ace/os_include/os_stdlib.h @@ -6,7 +6,7 @@ * * standard library definitions * - * $Id: os_stdlib.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_stdlib.h 83948 2008-12-02 13:55:34Z jtc $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -66,13 +66,20 @@ extern "C" #endif /* ACE_LACKS_MKTEMP_PROTOTYPE */ #if defined (ACE_LACKS_MKSTEMP_PROTOTYPE) - int mkstemp(char *); + int mkstemp (char *); #endif /* ACE_LACKS_MKSTEMP_PROTOTYPE */ +#if defined (ACE_LACKS_STRTOLL_PROTOTYPE) + long long strtoll (const char *, char **, int); +#endif /* ACE_LACKS_STRTOLL_PROTOTYPE */ + +#if defined (ACE_LACKS_STRTOULL_PROTOTYPE) + unsigned long long strtoull (const char *, char **, int); +#endif /* ACE_LACKS_STRTOULL_PROTOTYPE */ + #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STDLIB_H */ - diff --git a/dep/include/ace/os_include/os_string.h b/externals/ace/os_include/os_string.h similarity index 56% rename from dep/include/ace/os_include/os_string.h rename to externals/ace/os_include/os_string.h index cfbc4fd2fcf..0aa2f7de7cc 100644 --- a/dep/include/ace/os_include/os_string.h +++ b/externals/ace/os_include/os_string.h @@ -6,7 +6,7 @@ * * string operations * - * $Id: os_string.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_string.h 87216 2009-10-23 20:26:16Z olli $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -26,18 +26,10 @@ #include "ace/os_include/os_stddef.h" -// Matthew Stevens 7-10-95 Fix GNU GCC 2.7 for memchr() problem. -#if defined (ACE_HAS_GNU_CSTRING_H) -// Define this file to keep /usr/include/memory.h from being included. -# include /**/ -#else -# if !defined (ACE_LACKS_MEMORY_H) -# include /**/ -# endif /* !ACE_LACKS_MEMORY_H */ -# if !defined (ACE_LACKS_STRING_H) -# include /**/ -# endif /* !ACE_LACKS_STRING_H */ -#endif /* ACE_HAS_GNU_CSTRING_H */ +#if !defined (ACE_LACKS_STRING_H) +# include /**/ +#endif /* !ACE_LACKS_STRING_H */ + // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus @@ -45,16 +37,6 @@ extern "C" { #endif /* __cplusplus */ - // this looks fishy... dhinton -#if !defined (ACE_HAS_STRERROR) -# if defined (ACE_HAS_SYS_ERRLIST) - extern char *sys_errlist[]; -# define strerror(err) sys_errlist[err] -# else -# define strerror(err) "strerror is unsupported" -# endif /* ACE_HAS_SYS_ERRLIST */ -#endif /* !ACE_HAS_STRERROR */ - #if defined (ACE_LACKS_STRTOK_R_PROTOTYPE) && !defined (_POSIX_SOURCE) char *strtok_r (char *s, const char *delim, char **save_ptr); #endif /* ACE_LACKS_STRTOK_R_PROTOTYPE */ @@ -63,15 +45,9 @@ extern "C" size_t strnlen(const char *s, size_t maxlen); #endif /* ACE_LACKS_STRNLEN_PROTOTYPE */ -#if defined (__BORLANDC__) && (__BORLANDC__ < 0x560) -# define _stricmp stricmp -# define _strnicmp strnicmp -#endif /* __BORLANDC__ */ - #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STRING_H */ - diff --git a/dep/include/ace/os_include/os_strings.h b/externals/ace/os_include/os_strings.h similarity index 99% rename from dep/include/ace/os_include/os_strings.h rename to externals/ace/os_include/os_strings.h index 8bfc768962f..ba258b08cb9 100644 --- a/dep/include/ace/os_include/os_strings.h +++ b/externals/ace/os_include/os_strings.h @@ -50,4 +50,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STRINGS_H */ - diff --git a/dep/include/ace/os_include/os_stropts.h b/externals/ace/os_include/os_stropts.h similarity index 91% rename from dep/include/ace/os_include/os_stropts.h rename to externals/ace/os_include/os_stropts.h index 961bd37feaa..e64717a9551 100644 --- a/dep/include/ace/os_include/os_stropts.h +++ b/externals/ace/os_include/os_stropts.h @@ -6,7 +6,7 @@ * * STREAMS interface (STREAMS) * - * $Id: os_stropts.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_stropts.h 84660 2009-03-01 20:22:37Z olli $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -27,13 +27,7 @@ #include "ace/os_include/os_unistd.h" #if defined (ACE_HAS_TIMOD_H) -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# define queue _Queue_ -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ # include /**/ -# if defined (ACE_HAS_STL_QUEUE_CONFLICT) -# undef queue -# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ #elif defined (ACE_HAS_OSF_TIMOD_H) # include /**/ #endif /* ACE_HAS_TIMOD_H */ @@ -118,4 +112,3 @@ struct strbuf #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_STROPTS_H */ - diff --git a/dep/include/ace/os_include/os_syslog.h b/externals/ace/os_include/os_syslog.h similarity index 99% rename from dep/include/ace/os_include/os_syslog.h rename to externals/ace/os_include/os_syslog.h index f1713b47780..d448b7491e5 100644 --- a/dep/include/ace/os_include/os_syslog.h +++ b/externals/ace/os_include/os_syslog.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_SYSLOG_H */ - diff --git a/dep/include/ace/os_include/os_tar.h b/externals/ace/os_include/os_tar.h similarity index 99% rename from dep/include/ace/os_include/os_tar.h rename to externals/ace/os_include/os_tar.h index a0dc6ce2a76..007925022e8 100644 --- a/dep/include/ace/os_include/os_tar.h +++ b/externals/ace/os_include/os_tar.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_TAR_H */ - diff --git a/dep/include/ace/os_include/os_termios.h b/externals/ace/os_include/os_termios.h similarity index 99% rename from dep/include/ace/os_include/os_termios.h rename to externals/ace/os_include/os_termios.h index d67aa4a1aa9..9dfd3862276 100644 --- a/dep/include/ace/os_include/os_termios.h +++ b/externals/ace/os_include/os_termios.h @@ -44,4 +44,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_TERMIOS_H */ - diff --git a/dep/include/ace/os_include/os_tgmath.h b/externals/ace/os_include/os_tgmath.h similarity index 99% rename from dep/include/ace/os_include/os_tgmath.h rename to externals/ace/os_include/os_tgmath.h index 2b112a12875..6d9f2c2db23 100644 --- a/dep/include/ace/os_include/os_tgmath.h +++ b/externals/ace/os_include/os_tgmath.h @@ -43,4 +43,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_TGMATH_H */ - diff --git a/dep/include/ace/os_include/os_time.h b/externals/ace/os_include/os_time.h similarity index 96% rename from dep/include/ace/os_include/os_time.h rename to externals/ace/os_include/os_time.h index 3670f3b492d..e10a3b3164b 100644 --- a/dep/include/ace/os_include/os_time.h +++ b/externals/ace/os_include/os_time.h @@ -6,7 +6,7 @@ * * time types * - * $Id: os_time.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_time.h 87270 2009-10-29 21:47:47Z olli $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -81,10 +81,6 @@ extern "C" { #endif /* __cplusplus */ -#if defined (ACE_HAS_BROKEN_CTIME) -# undef ctime -#endif /* ACE_HAS_BROKEN_CTIME */ - // There are a lot of threads-related macro definitions in the config files. // They came in at different times and from different places and platform // requirements as threads evolved. They are probably not all needed - some @@ -121,4 +117,3 @@ typedef const struct timespec * ACE_TIMESPEC_PTR; #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_TIME_H */ - diff --git a/dep/include/ace/os_include/os_trace.h b/externals/ace/os_include/os_trace.h similarity index 99% rename from dep/include/ace/os_include/os_trace.h rename to externals/ace/os_include/os_trace.h index 0eacf9dc4bb..fd89d54b23b 100644 --- a/dep/include/ace/os_include/os_trace.h +++ b/externals/ace/os_include/os_trace.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_TRACE_H */ - diff --git a/externals/ace/os_include/os_typeinfo.h b/externals/ace/os_include/os_typeinfo.h new file mode 100644 index 00000000000..3ad1b16ef77 --- /dev/null +++ b/externals/ace/os_include/os_typeinfo.h @@ -0,0 +1,39 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_typeinfo.h + * + * definitions for the typeinfo file + * + * $Id: os_typeinfo.h 84160 2009-01-14 14:13:58Z johnnyw $ + * + * @author Don Hinton Johnny Willemsen + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_TYPEINFO_H +#define ACE_OS_INCLUDE_OS_TYPEINFO_H + +#include /**/ "ace/pre.h" + +#include /**/ "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +# include /**/ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_TYPEINFO_H */ diff --git a/dep/include/ace/os_include/os_ucontext.h b/externals/ace/os_include/os_ucontext.h similarity index 99% rename from dep/include/ace/os_include/os_ucontext.h rename to externals/ace/os_include/os_ucontext.h index 556bbdbbe45..f62be80e5fc 100644 --- a/dep/include/ace/os_include/os_ucontext.h +++ b/externals/ace/os_include/os_ucontext.h @@ -46,4 +46,3 @@ typedef int ucontext_t; #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_UCONTEXT_H */ - diff --git a/dep/include/ace/os_include/os_ulimit.h b/externals/ace/os_include/os_ulimit.h similarity index 99% rename from dep/include/ace/os_include/os_ulimit.h rename to externals/ace/os_include/os_ulimit.h index ad18c8a18d2..8593c0d95a5 100644 --- a/dep/include/ace/os_include/os_ulimit.h +++ b/externals/ace/os_include/os_ulimit.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_ULIMIT_H */ - diff --git a/dep/include/ace/os_include/os_unistd.h b/externals/ace/os_include/os_unistd.h similarity index 93% rename from dep/include/ace/os_include/os_unistd.h rename to externals/ace/os_include/os_unistd.h index 6e2d4a5c537..ee685d26222 100644 --- a/dep/include/ace/os_include/os_unistd.h +++ b/externals/ace/os_include/os_unistd.h @@ -6,7 +6,7 @@ * * standard symbolic constants and types * - * $Id: os_unistd.h 81697 2008-05-14 18:33:11Z johnnyw $ + * $Id: os_unistd.h 87125 2009-10-15 17:34:25Z wotte $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -27,14 +27,13 @@ #include "ace/os_include/sys/os_types.h" #include "ace/os_include/os_inttypes.h" -#if defined (__BORLANDC__) -# include "ace/os_include/os_fcntl.h" -#endif /* __BORLANDC */ - -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_PROCESS_H) # include /**/ +#endif /* ACE_HAS_PROCESS_H */ + +#if defined (ACE_HAS_IO_H) # include /**/ -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ +#endif /* ACE_HAS_IO_H */ #if defined (ACE_HAS_SYS_SYSTEMINFO_H) # include /**/ @@ -64,7 +63,7 @@ extern "C" // The following are #defines and #includes that are specific to // WIN32. # if defined (ACE_HAS_WINCE) -# define ACE_STDIN _fileno (stdin) +# define ACE_STDIN _fileno (stdin) # define ACE_STDOUT _fileno (stdout) # define ACE_STDERR _fileno (stderr) # else @@ -164,12 +163,6 @@ extern "C" #endif /* _LARGEFILE64_SOURCE */ #if defined (__BORLANDC__) -# if (__BORLANDC__ <= 0x540) -# define _getcwd getcwd -# define _chdir chdir -# undef _access -# define _access access -# endif # define _isatty isatty #endif /* __BORLANDC__ */ @@ -201,4 +194,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_UNISTD_H */ - diff --git a/dep/include/ace/os_include/os_utime.h b/externals/ace/os_include/os_utime.h similarity index 99% rename from dep/include/ace/os_include/os_utime.h rename to externals/ace/os_include/os_utime.h index 4cf719e34f9..703da8b1424 100644 --- a/dep/include/ace/os_include/os_utime.h +++ b/externals/ace/os_include/os_utime.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_UTIME_H */ - diff --git a/dep/include/ace/os_include/os_utmpx.h b/externals/ace/os_include/os_utmpx.h similarity index 99% rename from dep/include/ace/os_include/os_utmpx.h rename to externals/ace/os_include/os_utmpx.h index 234351366fb..74ef305d4c1 100644 --- a/dep/include/ace/os_include/os_utmpx.h +++ b/externals/ace/os_include/os_utmpx.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_UTMPX_H */ - diff --git a/dep/include/ace/os_include/os_wchar.h b/externals/ace/os_include/os_wchar.h similarity index 77% rename from dep/include/ace/os_include/os_wchar.h rename to externals/ace/os_include/os_wchar.h index a020715876f..37eab2e4ee0 100644 --- a/dep/include/ace/os_include/os_wchar.h +++ b/externals/ace/os_include/os_wchar.h @@ -6,7 +6,7 @@ * * wide-character handling * - * $Id: os_wchar.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_wchar.h 83948 2008-12-02 13:55:34Z jtc $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -41,10 +41,17 @@ extern "C" { #endif /* __cplusplus */ +#if defined (ACE_LACKS_WCSTOLL_PROTOTYPE) + long long wcstoll (const wchar_t *, wchar_t **, int); +#endif /* ACE_LACKS_WCSTOLL_PROTOTYPE */ + +#if defined (ACE_LACKS_WCSTOULL_PROTOTYPE) + unsigned long long wcstoull (const wchar_t *, wchar_t **, int); +#endif /* ACE_LACKS_WCSTOULL_PROTOTYPE */ + #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_WCHAR_H */ - diff --git a/dep/include/ace/os_include/os_wctype.h b/externals/ace/os_include/os_wctype.h similarity index 99% rename from dep/include/ace/os_include/os_wctype.h rename to externals/ace/os_include/os_wctype.h index 5f385e0fc63..15aa295a677 100644 --- a/dep/include/ace/os_include/os_wctype.h +++ b/externals/ace/os_include/os_wctype.h @@ -43,4 +43,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_WCTYPE_H */ - diff --git a/dep/include/ace/os_include/os_wordexp.h b/externals/ace/os_include/os_wordexp.h similarity index 99% rename from dep/include/ace/os_include/os_wordexp.h rename to externals/ace/os_include/os_wordexp.h index 885893861a2..76960076df6 100644 --- a/dep/include/ace/os_include/os_wordexp.h +++ b/externals/ace/os_include/os_wordexp.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_WORDEXP_H */ - diff --git a/dep/include/ace/os_include/sys/os_ipc.h b/externals/ace/os_include/sys/os_ipc.h similarity index 99% rename from dep/include/ace/os_include/sys/os_ipc.h rename to externals/ace/os_include/sys/os_ipc.h index 99401b724cb..bea65e5e7d9 100644 --- a/dep/include/ace/os_include/sys/os_ipc.h +++ b/externals/ace/os_include/sys/os_ipc.h @@ -72,4 +72,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_IPC_H */ - diff --git a/dep/include/ace/os_include/sys/os_loadavg.h b/externals/ace/os_include/sys/os_loadavg.h similarity index 99% rename from dep/include/ace/os_include/sys/os_loadavg.h rename to externals/ace/os_include/sys/os_loadavg.h index 151f400e2c2..6eeeb69be0a 100644 --- a/dep/include/ace/os_include/sys/os_loadavg.h +++ b/externals/ace/os_include/sys/os_loadavg.h @@ -39,4 +39,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_LOADAVG_H */ - diff --git a/dep/include/ace/os_include/sys/os_mman.h b/externals/ace/os_include/sys/os_mman.h similarity index 99% rename from dep/include/ace/os_include/sys/os_mman.h rename to externals/ace/os_include/sys/os_mman.h index c100d52fafe..b39fc48cbc4 100644 --- a/dep/include/ace/os_include/sys/os_mman.h +++ b/externals/ace/os_include/sys/os_mman.h @@ -120,4 +120,3 @@ PAGE_NOCACHE */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_MMAN_H */ - diff --git a/dep/include/ace/os_include/sys/os_msg.h b/externals/ace/os_include/sys/os_msg.h similarity index 99% rename from dep/include/ace/os_include/sys/os_msg.h rename to externals/ace/os_include/sys/os_msg.h index 57341dba97d..fa7edad1eb1 100644 --- a/dep/include/ace/os_include/sys/os_msg.h +++ b/externals/ace/os_include/sys/os_msg.h @@ -53,4 +53,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_MSG_H */ - diff --git a/dep/include/ace/os_include/sys/os_pstat.h b/externals/ace/os_include/sys/os_pstat.h similarity index 99% rename from dep/include/ace/os_include/sys/os_pstat.h rename to externals/ace/os_include/sys/os_pstat.h index 253b8127979..dcb3467b623 100644 --- a/dep/include/ace/os_include/sys/os_pstat.h +++ b/externals/ace/os_include/sys/os_pstat.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_PSTAT_H */ - diff --git a/dep/include/ace/os_include/sys/os_resource.h b/externals/ace/os_include/sys/os_resource.h similarity index 99% rename from dep/include/ace/os_include/sys/os_resource.h rename to externals/ace/os_include/sys/os_resource.h index a724ed2e0eb..23486b616e2 100644 --- a/dep/include/ace/os_include/sys/os_resource.h +++ b/externals/ace/os_include/sys/os_resource.h @@ -102,4 +102,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_RESOURCE_H */ - diff --git a/dep/include/ace/os_include/sys/os_select.h b/externals/ace/os_include/sys/os_select.h similarity index 77% rename from dep/include/ace/os_include/sys/os_select.h rename to externals/ace/os_include/sys/os_select.h index f3e999831fd..59473aff398 100644 --- a/dep/include/ace/os_include/sys/os_select.h +++ b/externals/ace/os_include/sys/os_select.h @@ -6,7 +6,7 @@ * * select types * - * $Id: os_select.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_select.h 85015 2009-04-03 12:27:59Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -32,9 +32,9 @@ # include /**/ #endif /* !ACE_LACKS_SYS_SELECT_H */ -#if defined (ACE_VXWORKS) && defined (ACE_LACKS_SYS_SELECT_H) +#if defined (ACE_USES_SELECTLIB_H) && defined (ACE_LACKS_SYS_SELECT_H) # include /**/ -#endif /* ACE_VXWORKS */ +#endif /* ACE_USES_SELECTLIB_H && ACE_LACKS_SYS_SELECT_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus @@ -42,13 +42,15 @@ extern "C" { #endif /* __cplusplus */ +#if defined (ACE_LACKS_FD_MASK) + typedef long fd_mask; +#endif /* __QNX__ */ + #if defined (ACE_WIN32) // This will help until we figure out everything: # define NFDBITS 32 /* only used in unused functions... */ -#elif defined (__QNX__) -# if !defined (NFDBITS) -# define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -# endif /* ! NFDBITS */ +#elif defined (ACE_LACKS_NFDBITS) +# define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #endif /* ACE_WIN32 */ #ifdef __cplusplus @@ -57,4 +59,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SELECT_H */ - diff --git a/dep/include/ace/os_include/sys/os_sem.h b/externals/ace/os_include/sys/os_sem.h similarity index 99% rename from dep/include/ace/os_include/sys/os_sem.h rename to externals/ace/os_include/sys/os_sem.h index 92153e2fcea..926092b7d06 100644 --- a/dep/include/ace/os_include/sys/os_sem.h +++ b/externals/ace/os_include/sys/os_sem.h @@ -88,4 +88,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SEM_H */ - diff --git a/dep/include/ace/os_include/sys/os_shm.h b/externals/ace/os_include/sys/os_shm.h similarity index 99% rename from dep/include/ace/os_include/sys/os_shm.h rename to externals/ace/os_include/sys/os_shm.h index 83e32486cb6..79d502fec0d 100644 --- a/dep/include/ace/os_include/sys/os_shm.h +++ b/externals/ace/os_include/sys/os_shm.h @@ -46,4 +46,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SHM_H */ - diff --git a/dep/include/ace/os_include/sys/os_socket.h b/externals/ace/os_include/sys/os_socket.h similarity index 98% rename from dep/include/ace/os_include/sys/os_socket.h rename to externals/ace/os_include/sys/os_socket.h index cefc28c2134..676041747ba 100644 --- a/dep/include/ace/os_include/sys/os_socket.h +++ b/externals/ace/os_include/sys/os_socket.h @@ -6,7 +6,7 @@ * * main sockets header * - * $Id: os_socket.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_socket.h 85015 2009-04-03 12:27:59Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -30,9 +30,9 @@ # include /**/ #endif /* !ACE_LACKS_SYS_SOCKET_H */ -#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) +#if defined (ACE_USES_SOCKLIB_H) # include /**/ -#endif /* ACE_VXWORKS */ +#endif /* ACE_USES_SOCKLIB_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus @@ -305,4 +305,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SOCKET_H */ - diff --git a/dep/include/ace/os_include/sys/os_stat.h b/externals/ace/os_include/sys/os_stat.h similarity index 62% rename from dep/include/ace/os_include/sys/os_stat.h rename to externals/ace/os_include/sys/os_stat.h index edd43d3932a..19b126500c1 100644 --- a/dep/include/ace/os_include/sys/os_stat.h +++ b/externals/ace/os_include/sys/os_stat.h @@ -6,7 +6,7 @@ * * data returned by the stat() function * - * $Id: os_stat.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_stat.h 85057 2009-04-08 10:59:58Z msmit $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -26,9 +26,9 @@ #include "ace/os_include/sys/os_types.h" -#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_DIRECT_H) # include /**/ -#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ +#endif /* ACE_HAS_DIRECT_H */ #if !defined (ACE_LACKS_SYS_STAT_H) # include /**/ @@ -46,19 +46,44 @@ extern "C" // the following macros are for POSIX conformance. # if !defined (ACE_HAS_USER_MODE_MASKS) -# define S_IRWXU 00700 /* read, write, execute: owner. */ -# define S_IRUSR 00400 /* read permission: owner. */ -# define S_IWUSR 00200 /* write permission: owner. */ -# define S_IXUSR 00100 /* execute permission: owner. */ +# if !defined (S_IRWXU) +# define S_IRWXU 00700 /* read, write, execute: owner. */ +# endif /* !S_IRWXU */ +# if !defined (S_IRUSR) +# define S_IRUSR 00400 /* read permission: owner. */ +# endif /* !S_IRUSR */ +# if !defined (S_IWUSR) +# define S_IWUSR 00200 /* write permission: owner. */ +# endif /* !S_IWUSR */ +# if !defined (S_IXUSR) +# define S_IXUSR 00100 /* execute permission: owner. */ +# endif /* !S_IXUSR */ # endif /* ACE_HAS_USER_MODE_MASKS */ -# define S_IRWXG 00070 /* read, write, execute: group. */ -# define S_IRGRP 00040 /* read permission: group. */ -# define S_IWGRP 00020 /* write permission: group. */ -# define S_IXGRP 00010 /* execute permission: group. */ -# define S_IRWXO 00007 /* read, write, execute: other. */ -# define S_IROTH 00004 /* read permission: other. */ -# define S_IWOTH 00002 /* write permission: other. */ -# define S_IXOTH 00001 /* execute permission: other. */ + +# if !defined (S_IRWXG) +# define S_IRWXG 00070 +# endif /* S_IRWXG */ +# if !defined (S_IRGRP) +# define S_IRGRP 00040 +# endif /* S_IRGRP */ +# if !defined (S_IWGRP) +# define S_IWGRP 00020 +# endif /* S_IWGRP */ +# if !defined (S_IXGRP) +# define S_IXGRP 00010 +# endif /* S_IXGRP */ +# if !defined (S_IRWXO) +# define S_IRWXO 00007 +# endif /* S_IRWXO */ +# if !defined (S_IROTH) +# define S_IROTH 00004 +# endif /* S_IROTH */ +# if !defined (S_IWOTH) +# define S_IWOTH 00002 +# endif /* S_IWOTH */ +# if !defined (S_IXOTH) +# define S_IXOTH 00001 +# endif /* S_IXOTH */ // WinCE's S_IFLNK is defined with the other bits, below. #if !defined (S_IFLNK) && !defined (ACE_HAS_WINCE) @@ -77,7 +102,6 @@ extern "C" #endif /* S_ISLNK */ #if defined (ACE_HAS_WINCE) -# include "ace/Time_Value.h" // Translate the WinCE bits into names expected by our callers. // The dwFileAttributes parameter doesn't have protection info, so @@ -87,6 +111,11 @@ extern "C" # define S_IFREG FILE_ATTRIBUTE_NORMAL # define S_IFLNK 0 +# if !defined (__MINGW32__) + // Since CE does not have _stat by default as NT/2000 does, the 'stat' + // struct defined here will be used. Also note that CE file system + // struct is only for the CE 3.0 or later. + // Refer to the WCHAR.H from Visual C++ and WIBASE.H from eVC 3.0. struct stat { /// always 0 on Windows platforms @@ -96,19 +125,19 @@ extern "C" dev_t st_rdev; /// file attribute - unsigned short st_mode; + mode_t st_mode; /// number of hard links - short st_nlink; + nlink_t st_nlink; /// time of last access - ACE_Time_Value st_atime; + time_t st_atime; /// time of last data modification - ACE_Time_Value st_mtime; + time_t st_mtime; /// time of creation - ACE_Time_Value st_ctime; + time_t st_ctime; /// file size, in bytes ACE_OFF_T st_size; @@ -117,6 +146,7 @@ extern "C" //u_long st_blksize; // optimal blocksize for I/O //u_long st_flags; // user defined flags for file }; + #endif #endif /* ACE_HAS_WINCE */ #ifdef __cplusplus @@ -125,4 +155,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_STAT_H */ - diff --git a/dep/include/ace/os_include/sys/os_statvfs.h b/externals/ace/os_include/sys/os_statvfs.h similarity index 99% rename from dep/include/ace/os_include/sys/os_statvfs.h rename to externals/ace/os_include/sys/os_statvfs.h index 6661aa437d9..7988c4f5060 100644 --- a/dep/include/ace/os_include/sys/os_statvfs.h +++ b/externals/ace/os_include/sys/os_statvfs.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_STATVFS_H */ - diff --git a/dep/include/ace/os_include/sys/os_sysctl.h b/externals/ace/os_include/sys/os_sysctl.h similarity index 99% rename from dep/include/ace/os_include/sys/os_sysctl.h rename to externals/ace/os_include/sys/os_sysctl.h index 630c9de345b..ee51cd7db65 100644 --- a/dep/include/ace/os_include/sys/os_sysctl.h +++ b/externals/ace/os_include/sys/os_sysctl.h @@ -39,4 +39,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SYSCTL_H */ - diff --git a/dep/include/ace/os_include/sys/os_sysinfo.h b/externals/ace/os_include/sys/os_sysinfo.h similarity index 99% rename from dep/include/ace/os_include/sys/os_sysinfo.h rename to externals/ace/os_include/sys/os_sysinfo.h index 19d57e984f9..7aca1f44d1f 100644 --- a/dep/include/ace/os_include/sys/os_sysinfo.h +++ b/externals/ace/os_include/sys/os_sysinfo.h @@ -37,4 +37,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_SYSINFO_H */ - diff --git a/dep/include/ace/os_include/sys/os_time.h b/externals/ace/os_include/sys/os_time.h similarity index 90% rename from dep/include/ace/os_include/sys/os_time.h rename to externals/ace/os_include/sys/os_time.h index 130a8265ac2..937ceebaa13 100644 --- a/dep/include/ace/os_include/sys/os_time.h +++ b/externals/ace/os_include/sys/os_time.h @@ -6,7 +6,7 @@ * * time types * - * $Id: os_time.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_time.h 85365 2009-05-18 08:27:42Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -41,11 +41,7 @@ extern "C" #endif /* __cplusplus */ #if defined (ACE_HAS_SVR4_GETTIMEOFDAY) -# if !defined (SCO) int gettimeofday (struct timeval *tp, void * = 0); -# else - int gettimeofday (struct timeval *tp); -# endif /* !SCO */ #elif defined (ACE_HAS_OSF1_GETTIMEOFDAY) int gettimeofday (struct timeval *tp, struct timezone * = 0); #elif defined (ACE_HAS_VOIDPTR_GETTIMEOFDAY) @@ -58,4 +54,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_TIME_H */ - diff --git a/dep/include/ace/os_include/sys/os_timeb.h b/externals/ace/os_include/sys/os_timeb.h similarity index 84% rename from dep/include/ace/os_include/sys/os_timeb.h rename to externals/ace/os_include/sys/os_timeb.h index c8c0d74043c..cf10566ed99 100644 --- a/dep/include/ace/os_include/sys/os_timeb.h +++ b/externals/ace/os_include/sys/os_timeb.h @@ -6,7 +6,7 @@ * * additional definitions for date and time * - * $Id: os_timeb.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_timeb.h 83306 2008-10-17 12:19:53Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -36,15 +36,9 @@ extern "C" { #endif /* __cplusplus */ -#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x560) -# define _ftime ftime -# define _timeb timeb -#endif /* __BORLANDC__ */ - #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_TIMEB_H */ - diff --git a/dep/include/ace/os_include/sys/os_times.h b/externals/ace/os_include/sys/os_times.h similarity index 99% rename from dep/include/ace/os_include/sys/os_times.h rename to externals/ace/os_include/sys/os_times.h index d6769f7eb8d..617b416ec56 100644 --- a/dep/include/ace/os_include/sys/os_times.h +++ b/externals/ace/os_include/sys/os_times.h @@ -42,4 +42,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_TIMES_H */ - diff --git a/dep/include/ace/os_include/sys/os_types.h b/externals/ace/os_include/sys/os_types.h similarity index 73% rename from dep/include/ace/os_include/sys/os_types.h rename to externals/ace/os_include/sys/os_types.h index 0377e024b69..9638265378d 100644 --- a/dep/include/ace/os_include/sys/os_types.h +++ b/externals/ace/os_include/sys/os_types.h @@ -6,7 +6,7 @@ * * data types * - * $Id: os_types.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_types.h 88515 2010-01-13 08:47:38Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -30,9 +30,9 @@ # include /**/ #endif /* !ACE_LACKS_SYS_TYPES_H */ -#if defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_TYPES_H) # include /**/ -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_HAS_TYPES_H */ # if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \ (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0) @@ -55,22 +55,13 @@ typedef double ACE_timer_t; # endif /* CLOCK_REALTIME */ #endif /* ! ACE_HAS_CLOCK_GETTIME && ! _CLOCKID_T_ */ -#if defined (ACE_HAS_WINCE) - -// CE's add-on for c-style fstat/stat functionalities. This struct is -// by no mean complete compared to what you usually find in UNIX -// platforms. Only members that have direct conversion using Win32's -// BY_HANDLE_FILE_INFORMATION are defined so that users can discover -// non-supported members at compile time. Time values are of type -// ACE_Time_Value for easy comparison. - -// Since CE does not have _stat by default as NT/2000 does, the 'stat' -// struct defined here will be used. Also note that CE file system -// struct is only for the CE 3.0 or later. -// Refer to the WCHAR.H from Visual C++ and WIBASE.H from eVC 3.0. - +#if defined (ACE_LACKS_DEV_T) typedef unsigned int dev_t; -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_LACKS_DEV_T */ + +#if defined (ACE_HAS_WINCE) + typedef long off_t; +#endif #if defined(ACE_WIN32) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64) typedef __int64 ACE_OFF_T; @@ -80,8 +71,8 @@ typedef double ACE_timer_t; #if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG == 8 typedef off_t ACE_LOFF_T; -#elif defined (ACE_HAS_RTEMS) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || \ - (defined (ACE_OPENVMS) && defined (_LARGEFILE)) || defined(ACE_MVS) +#elif defined (ACE_HAS_RTEMS) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || defined(ACE_MVS) || defined(__INTERIX) || \ + (defined (ACE_OPENVMS) && defined (_LARGEFILE)) typedef off_t ACE_LOFF_T; #elif defined (__sgi) || defined (AIX) || defined (HPUX) || defined (__QNX__) typedef off64_t ACE_LOFF_T; @@ -89,7 +80,7 @@ typedef double ACE_timer_t; typedef offset_t ACE_LOFF_T; #elif defined (WIN32) typedef __int64 ACE_LOFF_T; -#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x660)) || \ +#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x680)) || \ defined (ACE_LYNXOS_MAJOR) || \ (defined (ACE_OPENVMS) && !defined (_LARGEFILE)) || \ defined (__TANDEM) @@ -98,17 +89,25 @@ typedef double ACE_timer_t; typedef loff_t ACE_LOFF_T; #endif -#if defined (ACE_WIN32) -# if !defined (__BORLANDC__) - typedef DWORD nlink_t; -# if !defined(__MINGW32__) - typedef int mode_t; -# endif /* !__MINGW32__ */ - typedef long uid_t; - typedef long gid_t; -# endif /* __BORLANDC__ */ - typedef char *caddr_t; -#endif /* ACE_WIN32 */ +#if defined (ACE_LACKS_UID_T) +typedef long uid_t; +#endif /* ACE_LACKS_UID_T */ + +#if defined (ACE_LACKS_GID_T) +typedef long gid_t; +#endif /* ACE_LACKS_GID_T */ + +#if defined (ACE_LACKS_CADDR_T) +typedef char *caddr_t; +#endif /* ACE_LACKS_CADDR_T */ + +#if defined (ACE_LACKS_MODE_T) +typedef u_short mode_t; +#endif /* ACE_LACKS_MODE_T */ + +#if defined (ACE_LACKS_NLINK_T) +typedef DWORD nlink_t; +#endif /* ACE_LACKS_NLINK_T */ #if defined (ACE_LACKS_KEY_T) # if defined (ACE_WIN32) @@ -156,4 +155,3 @@ typedef double ACE_timer_t; #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_TYPES_H */ - diff --git a/dep/include/ace/os_include/sys/os_uio.h b/externals/ace/os_include/sys/os_uio.h similarity index 100% rename from dep/include/ace/os_include/sys/os_uio.h rename to externals/ace/os_include/sys/os_uio.h index 72a2819e524..7baaec57e75 100644 --- a/dep/include/ace/os_include/sys/os_uio.h +++ b/externals/ace/os_include/sys/os_uio.h @@ -54,6 +54,7 @@ extern "C" }; #endif /* ACE_LACKS_IOVEC */ + # if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) ssize_t readv_timedwait (ACE_HANDLE handle, @@ -74,4 +75,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_UIO_H */ - diff --git a/dep/include/ace/os_include/sys/os_un.h b/externals/ace/os_include/sys/os_un.h similarity index 89% rename from dep/include/ace/os_include/sys/os_un.h rename to externals/ace/os_include/sys/os_un.h index 88d86a232a6..04a4da0bda9 100644 --- a/dep/include/ace/os_include/sys/os_un.h +++ b/externals/ace/os_include/sys/os_un.h @@ -6,7 +6,7 @@ * * definitions for UNIX domain sockets * - * $Id: os_un.h 80826 2008-03-04 14:51:23Z wotte $ + * $Id: os_un.h 85015 2009-04-03 12:27:59Z johnnyw $ * * @author Don Hinton * @author This code was originally in various places including ace/OS.h. @@ -36,12 +36,13 @@ extern "C" { #endif /* __cplusplus */ -#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x600) +#if defined (ACE_LACKS_SOCKADDR_UN) struct sockaddr_un { short sun_family; // AF_UNIX. char sun_path[108]; // path name. }; -#endif /* ACE_VXWORKS */ +#endif /* ACE_LACKS_SOCKADDR_UN */ + #ifdef __cplusplus } @@ -49,4 +50,3 @@ struct sockaddr_un { #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_UN_H */ - diff --git a/dep/include/ace/os_include/sys/os_utsname.h b/externals/ace/os_include/sys/os_utsname.h similarity index 99% rename from dep/include/ace/os_include/sys/os_utsname.h rename to externals/ace/os_include/sys/os_utsname.h index 23748bb7160..d78d1e3463a 100644 --- a/dep/include/ace/os_include/sys/os_utsname.h +++ b/externals/ace/os_include/sys/os_utsname.h @@ -40,4 +40,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_UTSNAME_H */ - diff --git a/dep/include/ace/os_include/sys/os_wait.h b/externals/ace/os_include/sys/os_wait.h similarity index 99% rename from dep/include/ace/os_include/sys/os_wait.h rename to externals/ace/os_include/sys/os_wait.h index fd42e2cdf90..b7a219ac82e 100644 --- a/dep/include/ace/os_include/sys/os_wait.h +++ b/externals/ace/os_include/sys/os_wait.h @@ -95,4 +95,3 @@ extern "C" #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_SYS_OS_WAIT_H */ - diff --git a/dep/include/ace/post.h b/externals/ace/post.h similarity index 99% rename from dep/include/ace/post.h rename to externals/ace/post.h index 7c77af216ad..c393dfe50aa 100644 --- a/dep/include/ace/post.h +++ b/externals/ace/post.h @@ -20,4 +20,3 @@ # pragma nopushoptwarn # pragma nopackwarning #endif - diff --git a/dep/include/ace/pre.h b/externals/ace/pre.h similarity index 95% rename from dep/include/ace/pre.h rename to externals/ace/pre.h index 6984b22804e..7cc32d8ff30 100644 --- a/dep/include/ace/pre.h +++ b/externals/ace/pre.h @@ -16,11 +16,9 @@ // No header guard #if defined (_MSC_VER) # pragma warning (disable:4103) -# pragma warning (disable:4005) # pragma pack (push, 8) #elif defined (__BORLANDC__) # pragma option push -a8 -b -Ve- -Vx- -w-rvl -w-rch -w-ccc -w-obs -w-aus -w-pia -w-inl -w-sig # pragma nopushoptwarn # pragma nopackwarning #endif - diff --git a/dep/include/ace/streams.h b/externals/ace/streams.h similarity index 99% rename from dep/include/ace/streams.h rename to externals/ace/streams.h index 3401435b4b1..396a67c712e 100644 --- a/dep/include/ace/streams.h +++ b/externals/ace/streams.h @@ -18,6 +18,7 @@ */ //============================================================================= + #ifndef ACE_STREAMS_H #define ACE_STREAMS_H #include /**/ "ace/pre.h" @@ -34,6 +35,7 @@ #pragma warning(push) #endif /* _MSC_VER*/ + #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) # if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ @@ -134,4 +136,3 @@ #include /**/ "ace/post.h" #endif /* ACE_STREAMS_H */ - diff --git a/dep/include/ace/svc_export.h b/externals/ace/svc_export.h similarity index 95% rename from dep/include/ace/svc_export.h rename to externals/ace/svc_export.h index 33fa67cd80b..18cf3a24c35 100644 --- a/dep/include/ace/svc_export.h +++ b/externals/ace/svc_export.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: svc_export.h 80826 2008-03-04 14:51:23Z wotte $ +// $Id: svc_export.h 84495 2009-02-17 17:44:31Z johnnyw $ // Definition for Win32 Export directives. // This file was generated by generate_export_file.pl @@ -42,4 +42,3 @@ #endif /* ACE_SVC_EXPORT_H */ // End of auto generated file. - diff --git a/externals/ace/win/VC90/ace.vcproj b/externals/ace/win/VC90/ace.vcproj new file mode 100644 index 00000000000..39b0872d0a4 --- /dev/null +++ b/externals/ace/win/VC90/ace.vcproj @@ -0,0 +1,5308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/externals/ace/win/ace.sln b/externals/ace/win/ace.sln new file mode 100644 index 00000000000..6b09a5f85bb --- /dev/null +++ b/externals/ace/win/ace.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACE_Wrappers", "VC90\ace.vcproj", "{BD537C9A-FECA-1BAD-6757-8A6348EA12C8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|Win32.ActiveCfg = Debug|Win32 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|Win32.Build.0 = Debug|Win32 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|x64.ActiveCfg = Debug|x64 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|x64.Build.0 = Debug|x64 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|Win32.ActiveCfg = Release|Win32 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|Win32.Build.0 = Release|Win32 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|x64.ActiveCfg = Release|x64 + {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/externals/ace/win/delme b/externals/ace/win/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/externals/bzip2/CHANGES b/externals/bzip2/CHANGES deleted file mode 100644 index 6e4f65e2e0a..00000000000 --- a/externals/bzip2/CHANGES +++ /dev/null @@ -1,319 +0,0 @@ - ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ - - -0.9.0 -~~~~~ -First version. - - -0.9.0a -~~~~~~ -Removed 'ranlib' from Makefile, since most modern Unix-es -don't need it, or even know about it. - - -0.9.0b -~~~~~~ -Fixed a problem with error reporting in bzip2.c. This does not effect -the library in any way. Problem is: versions 0.9.0 and 0.9.0a (of the -program proper) compress and decompress correctly, but give misleading -error messages (internal panics) when an I/O error occurs, instead of -reporting the problem correctly. This shouldn't give any data loss -(as far as I can see), but is confusing. - -Made the inline declarations disappear for non-GCC compilers. - - -0.9.0c -~~~~~~ -Fixed some problems in the library pertaining to some boundary cases. -This makes the library behave more correctly in those situations. The -fixes apply only to features (calls and parameters) not used by -bzip2.c, so the non-fixedness of them in previous versions has no -effect on reliability of bzip2.c. - -In bzlib.c: - * made zero-length BZ_FLUSH work correctly in bzCompress(). - * fixed bzWrite/bzRead to ignore zero-length requests. - * fixed bzread to correctly handle read requests after EOF. - * wrong parameter order in call to bzDecompressInit in - bzBuffToBuffDecompress. Fixed. - -In compress.c: - * changed setting of nGroups in sendMTFValues() so as to - do a bit better on small files. This _does_ effect - bzip2.c. - - -0.9.5a -~~~~~~ -Major change: add a fallback sorting algorithm (blocksort.c) -to give reasonable behaviour even for very repetitive inputs. -Nuked --repetitive-best and --repetitive-fast since they are -no longer useful. - -Minor changes: mostly a whole bunch of small changes/ -bugfixes in the driver (bzip2.c). Changes pertaining to the -user interface are: - - allow decompression of symlink'd files to stdout - decompress/test files even without .bz2 extension - give more accurate error messages for I/O errors - when compressing/decompressing to stdout, don't catch control-C - read flags from BZIP2 and BZIP environment variables - decline to break hard links to a file unless forced with -f - allow -c flag even with no filenames - preserve file ownerships as far as possible - make -s -1 give the expected block size (100k) - add a flag -q --quiet to suppress nonessential warnings - stop decoding flags after --, so files beginning in - can be handled - resolved inconsistent naming: bzcat or bz2cat ? - bzip2 --help now returns 0 - -Programming-level changes are: - - fixed syntax error in GET_LL4 for Borland C++ 5.02 - let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC} - fix overshoot of mode-string end in bzopen_or_bzdopen - wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... } - close file handles under all error conditions - added minor mods so it compiles with DJGPP out of the box - fixed Makefile so it doesn't give problems with BSD make - fix uninitialised memory reads in dlltest.c - -0.9.5b -~~~~~~ -Open stdin/stdout in binary mode for DJGPP. - -0.9.5c -~~~~~~ -Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1. The + 1 -version could cause the sorted order to be wrong in some extremely -obscure cases. Also changed setting of quadrant in blocksort.c. - -0.9.5d -~~~~~~ -The only functional change is to make bzlibVersion() in the library -return the correct string. This has no effect whatsoever on the -functioning of the bzip2 program or library. Added a couple of casts -so the library compiles without warnings at level 3 in MS Visual -Studio 6.0. Included a Y2K statement in the file Y2K_INFO. All other -changes are minor documentation changes. - -1.0 -~~~ -Several minor bugfixes and enhancements: - -* Large file support. The library uses 64-bit counters to - count the volume of data passing through it. bzip2.c - is now compiled with -D_FILE_OFFSET_BITS=64 to get large - file support from the C library. -v correctly prints out - file sizes greater than 4 gigabytes. All these changes have - been made without assuming a 64-bit platform or a C compiler - which supports 64-bit ints, so, except for the C library - aspect, they are fully portable. - -* Decompression robustness. The library/program should be - robust to any corruption of compressed data, detecting and - handling _all_ corruption, instead of merely relying on - the CRCs. What this means is that the program should - never crash, given corrupted data, and the library should - always return BZ_DATA_ERROR. - -* Fixed an obscure race-condition bug only ever observed on - Solaris, in which, if you were very unlucky and issued - control-C at exactly the wrong time, both input and output - files would be deleted. - -* Don't run out of file handles on test/decompression when - large numbers of files have invalid magic numbers. - -* Avoid library namespace pollution. Prefix all exported - symbols with BZ2_. - -* Minor sorting enhancements from my DCC2000 paper. - -* Advance the version number to 1.0, so as to counteract the - (false-in-this-case) impression some people have that programs - with version numbers less than 1.0 are in some way, experimental, - pre-release versions. - -* Create an initial Makefile-libbz2_so to build a shared library. - Yes, I know I should really use libtool et al ... - -* Make the program exit with 2 instead of 0 when decompression - fails due to a bad magic number (ie, an invalid bzip2 header). - Also exit with 1 (as the manual claims :-) whenever a diagnostic - message would have been printed AND the corresponding operation - is aborted, for example - bzip2: Output file xx already exists. - When a diagnostic message is printed but the operation is not - aborted, for example - bzip2: Can't guess original name for wurble -- using wurble.out - then the exit value 0 is returned, unless some other problem is - also detected. - - I think it corresponds more closely to what the manual claims now. - - -1.0.1 -~~~~~ -* Modified dlltest.c so it uses the new BZ2_ naming scheme. -* Modified makefile-msc to fix minor build probs on Win2k. -* Updated README.COMPILATION.PROBLEMS. - -There are no functionality changes or bug fixes relative to version -1.0.0. This is just a documentation update + a fix for minor Win32 -build problems. For almost everyone, upgrading from 1.0.0 to 1.0.1 is -utterly pointless. Don't bother. - - -1.0.2 -~~~~~ -A bug fix release, addressing various minor issues which have appeared -in the 18 or so months since 1.0.1 was released. Most of the fixes -are to do with file-handling or documentation bugs. To the best of my -knowledge, there have been no data-loss-causing bugs reported in the -compression/decompression engine of 1.0.0 or 1.0.1. - -Note that this release does not improve the rather crude build system -for Unix platforms. The general plan here is to autoconfiscate/ -libtoolise 1.0.2 soon after release, and release the result as 1.1.0 -or perhaps 1.2.0. That, however, is still just a plan at this point. - -Here are the changes in 1.0.2. Bug-reporters and/or patch-senders in -parentheses. - -* Fix an infinite segfault loop in 1.0.1 when a directory is - encountered in -f (force) mode. - (Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt) - -* Avoid double fclose() of output file on certain I/O error paths. - (Solar Designer) - -* Don't fail with internal error 1007 when fed a long stream (> 48MB) - of byte 251. Also print useful message suggesting that 1007s may be - caused by bad memory. - (noticed by Juan Pedro Vallejo, fixed by me) - -* Fix uninitialised variable silly bug in demo prog dlltest.c. - (Jorj Bauer) - -* Remove 512-MB limitation on recovered file size for bzip2recover - on selected platforms which support 64-bit ints. At the moment - all GCC supported platforms, and Win32. - (me, Alson van der Meulen) - -* Hard-code header byte values, to give correct operation on platforms - using EBCDIC as their native character set (IBM's OS/390). - (Leland Lucius) - -* Copy file access times correctly. - (Marty Leisner) - -* Add distclean and check targets to Makefile. - (Michael Carmack) - -* Parameterise use of ar and ranlib in Makefile. Also add $(LDFLAGS). - (Rich Ireland, Bo Thorsen) - -* Pass -p (create parent dirs as needed) to mkdir during make install. - (Jeremy Fusco) - -* Dereference symlinks when copying file permissions in -f mode. - (Volker Schmidt) - -* Majorly simplify implementation of uInt64_qrm10. - (Bo Lindbergh) - -* Check the input file still exists before deleting the output one, - when aborting in cleanUpAndFail(). - (Joerg Prante, Robert Linden, Matthias Krings) - -Also a bunch of patches courtesy of Philippe Troin, the Debian maintainer -of bzip2: - -* Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore. - -* Spelling changes and minor enhancements in bzip2.1. - -* Avoid race condition between creating the output file and setting its - interim permissions safely, by using fopen_output_safely(). - No changes to bzip2recover since there is no issue with file - permissions there. - -* do not print senseless report with -v when compressing an empty - file. - -* bzcat -f works on non-bzip2 files. - -* do not try to escape shell meta-characters on unix (the shell takes - care of these). - -* added --fast and --best aliases for -1 -9 for gzip compatibility. - - -1.0.3 (15 Feb 05) -~~~~~~~~~~~~~~~~~ -Fixes some minor bugs since the last version, 1.0.2. - -* Further robustification against corrupted compressed data. - There are currently no known bitstreams which can cause the - decompressor to crash, loop or access memory which does not - belong to it. If you are using bzip2 or the library to - decompress bitstreams from untrusted sources, an upgrade - to 1.0.3 is recommended. This fixes CAN-2005-1260. - -* The documentation has been converted to XML, from which html - and pdf can be derived. - -* Various minor bugs in the documentation have been fixed. - -* Fixes for various compilation warnings with newer versions of - gcc, and on 64-bit platforms. - -* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2. - This has been fixed. - - -1.0.4 (20 Dec 06) -~~~~~~~~~~~~~~~~~ -Fixes some minor bugs since the last version, 1.0.3. - -* Fix file permissions race problem (CAN-2005-0953). - -* Avoid possible segfault in BZ2_bzclose. From Coverity's NetBSD - scan. - -* 'const'/prototype cleanups in the C code. - -* Change default install location to /usr/local, and handle multiple - 'make install's without error. - -* Sanitise file names more carefully in bzgrep. Fixes CAN-2005-0758 - to the extent that applies to bzgrep. - -* Use 'mktemp' rather than 'tempfile' in bzdiff. - -* Tighten up a couple of assertions in blocksort.c following automated - analysis. - -* Fix minor doc/comment bugs. - - -1.0.5 (10 Dec 07) -~~~~~~~~~~~~~~~~~ -Security fix only. Fixes CERT-FI 20469 as it applies to bzip2. - diff --git a/src/tools/map_extractor/loadlib/CMakeLists.txt b/externals/bzip2/CMakeLists.txt similarity index 61% rename from src/tools/map_extractor/loadlib/CMakeLists.txt rename to externals/bzip2/CMakeLists.txt index 5680c61d424..3de5475610a 100644 --- a/src/tools/map_extractor/loadlib/CMakeLists.txt +++ b/externals/bzip2/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2009 MaNGOS project +# Copyright (C) 2008-2010 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -8,6 +8,15 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -add_library (loadlib loadlib.cpp adt.cpp wdt.cpp) -# link loadlib with zlib -target_link_libraries (loadlib z) +file(GLOB sources *.c) + +set(bzip2_STAT_SRCS + ${sources} +) + +include_directories( + ${CMAKE_SOURCE_DIR}/externals/zlib + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_library(bzip2 STATIC ${bzip2_STAT_SRCS}) diff --git a/externals/bzip2/LICENSE b/externals/bzip2/LICENSE deleted file mode 100644 index f420cffb67d..00000000000 --- a/externals/bzip2/LICENSE +++ /dev/null @@ -1,42 +0,0 @@ - --------------------------------------------------------------------------- - -This program, "bzip2", the associated library "libbzip2", and all -documentation, are copyright (C) 1996-2007 Julian R Seward. 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. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product - documentation would be appreciated but is not required. - -3. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - -4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. - -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.5 of 10 December 2007 - --------------------------------------------------------------------------- diff --git a/externals/bzip2/bzip2.c b/externals/bzip2/bzip2.c deleted file mode 100644 index 390410735b5..00000000000 --- a/externals/bzip2/bzip2.c +++ /dev/null @@ -1,2034 +0,0 @@ - -/*-----------------------------------------------------------*/ -/*--- A block-sorting, lossless compressor bzip2.c ---*/ -/*-----------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -/* Place a 1 beside your platform, and 0 elsewhere. - Generic 32-bit Unix. - Also works on 64-bit Unix boxes. - This is the default. -*/ -#define BZ_UNIX 1 - -/*-- - Win32, as seen by Jacob Navia's excellent - port of (Chris Fraser & David Hanson)'s excellent - lcc compiler. Or with MS Visual C. - This is selected automatically if compiled by a compiler which - defines _WIN32, not including the Cygwin GCC. ---*/ -#define BZ_LCCWIN32 0 - -#if defined(_WIN32) && !defined(__CYGWIN__) -#undef BZ_LCCWIN32 -#define BZ_LCCWIN32 1 -#undef BZ_UNIX -#define BZ_UNIX 0 -#endif - - -/*---------------------------------------------*/ -/*-- - Some stuff for all platforms. ---*/ - -#include -#include -#include -#include -#include -#include -#include -#include "bzlib.h" - -#define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); } -#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); } -#define ERROR_IF_MINUS_ONE(i) { if ((i) == (-1)) ioError(); } - - -/*---------------------------------------------*/ -/*-- - Platform-specific stuff. ---*/ - -#if BZ_UNIX -# include -# include -# include -# include -# include -# include - -# define PATH_SEP '/' -# define MY_LSTAT lstat -# define MY_STAT stat -# define MY_S_ISREG S_ISREG -# define MY_S_ISDIR S_ISDIR - -# define APPEND_FILESPEC(root, name) \ - root=snocString((root), (name)) - -# define APPEND_FLAG(root, name) \ - root=snocString((root), (name)) - -# define SET_BINARY_MODE(fd) /**/ - -# ifdef __GNUC__ -# define NORETURN __attribute__ ((noreturn)) -# else -# define NORETURN /**/ -# endif - -# ifdef __DJGPP__ -# include -# include -# undef MY_LSTAT -# undef MY_STAT -# define MY_LSTAT stat -# define MY_STAT stat -# undef SET_BINARY_MODE -# define SET_BINARY_MODE(fd) \ - do { \ - int retVal = setmode ( fileno ( fd ), \ - O_BINARY ); \ - ERROR_IF_MINUS_ONE ( retVal ); \ - } while ( 0 ) -# endif - -# ifdef __CYGWIN__ -# include -# include -# undef SET_BINARY_MODE -# define SET_BINARY_MODE(fd) \ - do { \ - int retVal = setmode ( fileno ( fd ), \ - O_BINARY ); \ - ERROR_IF_MINUS_ONE ( retVal ); \ - } while ( 0 ) -# endif -#endif /* BZ_UNIX */ - - - -#if BZ_LCCWIN32 -# include -# include -# include - -# define NORETURN /**/ -# define PATH_SEP '\\' -# define MY_LSTAT _stat -# define MY_STAT _stat -# define MY_S_ISREG(x) ((x) & _S_IFREG) -# define MY_S_ISDIR(x) ((x) & _S_IFDIR) - -# define APPEND_FLAG(root, name) \ - root=snocString((root), (name)) - -# define APPEND_FILESPEC(root, name) \ - root = snocString ((root), (name)) - -# define SET_BINARY_MODE(fd) \ - do { \ - int retVal = setmode ( fileno ( fd ), \ - O_BINARY ); \ - ERROR_IF_MINUS_ONE ( retVal ); \ - } while ( 0 ) - -#endif /* BZ_LCCWIN32 */ - - -/*---------------------------------------------*/ -/*-- - Some more stuff for all platforms :-) ---*/ - -typedef char Char; -typedef unsigned char Bool; -typedef unsigned char UChar; -typedef int Int32; -typedef unsigned int UInt32; -typedef short Int16; -typedef unsigned short UInt16; - -#define True ((Bool)1) -#define False ((Bool)0) - -/*-- - IntNative is your platform's `native' int size. - Only here to avoid probs with 64-bit platforms. ---*/ -typedef int IntNative; - - -/*---------------------------------------------------*/ -/*--- Misc (file handling) data decls ---*/ -/*---------------------------------------------------*/ - -Int32 verbosity; -Bool keepInputFiles, smallMode, deleteOutputOnInterrupt; -Bool forceOverwrite, testFailsExist, unzFailsExist, noisy; -Int32 numFileNames, numFilesProcessed, blockSize100k; -Int32 exitValue; - -/*-- source modes; F==file, I==stdin, O==stdout --*/ -#define SM_I2O 1 -#define SM_F2O 2 -#define SM_F2F 3 - -/*-- operation modes --*/ -#define OM_Z 1 -#define OM_UNZ 2 -#define OM_TEST 3 - -Int32 opMode; -Int32 srcMode; - -#define FILE_NAME_LEN 1034 - -Int32 longestFileName; -Char inName [FILE_NAME_LEN]; -Char outName[FILE_NAME_LEN]; -Char tmpName[FILE_NAME_LEN]; -Char *progName; -Char progNameReally[FILE_NAME_LEN]; -FILE *outputHandleJustInCase; -Int32 workFactor; - -static void panic ( const Char* ) NORETURN; -static void ioError ( void ) NORETURN; -static void outOfMemory ( void ) NORETURN; -static void configError ( void ) NORETURN; -static void crcError ( void ) NORETURN; -static void cleanUpAndFail ( Int32 ) NORETURN; -static void compressedStreamEOF ( void ) NORETURN; - -static void copyFileName ( Char*, Char* ); -static void* myMalloc ( Int32 ); -static void applySavedFileAttrToOutputFile ( IntNative fd ); - - - -/*---------------------------------------------------*/ -/*--- An implementation of 64-bit ints. Sigh. ---*/ -/*--- Roll on widespread deployment of ANSI C9X ! ---*/ -/*---------------------------------------------------*/ - -typedef - struct { UChar b[8]; } - UInt64; - - -static -void uInt64_from_UInt32s ( UInt64* n, UInt32 lo32, UInt32 hi32 ) -{ - n->b[7] = (UChar)((hi32 >> 24) & 0xFF); - n->b[6] = (UChar)((hi32 >> 16) & 0xFF); - n->b[5] = (UChar)((hi32 >> 8) & 0xFF); - n->b[4] = (UChar) (hi32 & 0xFF); - n->b[3] = (UChar)((lo32 >> 24) & 0xFF); - n->b[2] = (UChar)((lo32 >> 16) & 0xFF); - n->b[1] = (UChar)((lo32 >> 8) & 0xFF); - n->b[0] = (UChar) (lo32 & 0xFF); -} - - -static -double uInt64_to_double ( UInt64* n ) -{ - Int32 i; - double base = 1.0; - double sum = 0.0; - for (i = 0; i < 8; i++) { - sum += base * (double)(n->b[i]); - base *= 256.0; - } - return sum; -} - - -static -Bool uInt64_isZero ( UInt64* n ) -{ - Int32 i; - for (i = 0; i < 8; i++) - if (n->b[i] != 0) return 0; - return 1; -} - - -/* Divide *n by 10, and return the remainder. */ -static -Int32 uInt64_qrm10 ( UInt64* n ) -{ - UInt32 rem, tmp; - Int32 i; - rem = 0; - for (i = 7; i >= 0; i--) { - tmp = rem * 256 + n->b[i]; - n->b[i] = tmp / 10; - rem = tmp % 10; - } - return rem; -} - - -/* ... and the Whole Entire Point of all this UInt64 stuff is - so that we can supply the following function. -*/ -static -void uInt64_toAscii ( char* outbuf, UInt64* n ) -{ - Int32 i, q; - UChar buf[32]; - Int32 nBuf = 0; - UInt64 n_copy = *n; - do { - q = uInt64_qrm10 ( &n_copy ); - buf[nBuf] = q + '0'; - nBuf++; - } while (!uInt64_isZero(&n_copy)); - outbuf[nBuf] = 0; - for (i = 0; i < nBuf; i++) - outbuf[i] = buf[nBuf-i-1]; -} - - -/*---------------------------------------------------*/ -/*--- Processing of complete files and streams ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------*/ -static -Bool myfeof ( FILE* f ) -{ - Int32 c = fgetc ( f ); - if (c == EOF) return True; - ungetc ( c, f ); - return False; -} - - -/*---------------------------------------------*/ -static -void compressStream ( FILE *stream, FILE *zStream ) -{ - BZFILE* bzf = NULL; - UChar ibuf[5000]; - Int32 nIbuf; - UInt32 nbytes_in_lo32, nbytes_in_hi32; - UInt32 nbytes_out_lo32, nbytes_out_hi32; - Int32 bzerr, bzerr_dummy, ret; - - SET_BINARY_MODE(stream); - SET_BINARY_MODE(zStream); - - if (ferror(stream)) goto errhandler_io; - if (ferror(zStream)) goto errhandler_io; - - bzf = BZ2_bzWriteOpen ( &bzerr, zStream, - blockSize100k, verbosity, workFactor ); - if (bzerr != BZ_OK) goto errhandler; - - if (verbosity >= 2) fprintf ( stderr, "\n" ); - - while (True) { - - if (myfeof(stream)) break; - nIbuf = fread ( ibuf, sizeof(UChar), 5000, stream ); - if (ferror(stream)) goto errhandler_io; - if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf ); - if (bzerr != BZ_OK) goto errhandler; - - } - - BZ2_bzWriteClose64 ( &bzerr, bzf, 0, - &nbytes_in_lo32, &nbytes_in_hi32, - &nbytes_out_lo32, &nbytes_out_hi32 ); - if (bzerr != BZ_OK) goto errhandler; - - if (ferror(zStream)) goto errhandler_io; - ret = fflush ( zStream ); - if (ret == EOF) goto errhandler_io; - if (zStream != stdout) { - Int32 fd = fileno ( zStream ); - if (fd < 0) goto errhandler_io; - applySavedFileAttrToOutputFile ( fd ); - ret = fclose ( zStream ); - outputHandleJustInCase = NULL; - if (ret == EOF) goto errhandler_io; - } - outputHandleJustInCase = NULL; - if (ferror(stream)) goto errhandler_io; - ret = fclose ( stream ); - if (ret == EOF) goto errhandler_io; - - if (verbosity >= 1) { - if (nbytes_in_lo32 == 0 && nbytes_in_hi32 == 0) { - fprintf ( stderr, " no data compressed.\n"); - } else { - Char buf_nin[32], buf_nout[32]; - UInt64 nbytes_in, nbytes_out; - double nbytes_in_d, nbytes_out_d; - uInt64_from_UInt32s ( &nbytes_in, - nbytes_in_lo32, nbytes_in_hi32 ); - uInt64_from_UInt32s ( &nbytes_out, - nbytes_out_lo32, nbytes_out_hi32 ); - nbytes_in_d = uInt64_to_double ( &nbytes_in ); - nbytes_out_d = uInt64_to_double ( &nbytes_out ); - uInt64_toAscii ( buf_nin, &nbytes_in ); - uInt64_toAscii ( buf_nout, &nbytes_out ); - fprintf ( stderr, "%6.3f:1, %6.3f bits/byte, " - "%5.2f%% saved, %s in, %s out.\n", - nbytes_in_d / nbytes_out_d, - (8.0 * nbytes_out_d) / nbytes_in_d, - 100.0 * (1.0 - nbytes_out_d / nbytes_in_d), - buf_nin, - buf_nout - ); - } - } - - return; - - errhandler: - BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1, - &nbytes_in_lo32, &nbytes_in_hi32, - &nbytes_out_lo32, &nbytes_out_hi32 ); - switch (bzerr) { - case BZ_CONFIG_ERROR: - configError(); break; - case BZ_MEM_ERROR: - outOfMemory (); break; - case BZ_IO_ERROR: - errhandler_io: - ioError(); break; - default: - panic ( "compress:unexpected error" ); - } - - panic ( "compress:end" ); - /*notreached*/ -} - - - -/*---------------------------------------------*/ -static -Bool uncompressStream ( FILE *zStream, FILE *stream ) -{ - BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; - UChar obuf[5000]; - UChar unused[BZ_MAX_UNUSED]; - Int32 nUnused; - void* unusedTmpV; - UChar* unusedTmp; - - nUnused = 0; - streamNo = 0; - - SET_BINARY_MODE(stream); - SET_BINARY_MODE(zStream); - - if (ferror(stream)) goto errhandler_io; - if (ferror(zStream)) goto errhandler_io; - - while (True) { - - bzf = BZ2_bzReadOpen ( - &bzerr, zStream, verbosity, - (int)smallMode, unused, nUnused - ); - if (bzf == NULL || bzerr != BZ_OK) goto errhandler; - streamNo++; - - while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); - if (bzerr == BZ_DATA_ERROR_MAGIC) goto trycat; - if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0) - fwrite ( obuf, sizeof(UChar), nread, stream ); - if (ferror(stream)) goto errhandler_io; - } - if (bzerr != BZ_STREAM_END) goto errhandler; - - BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused ); - if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" ); - - unusedTmp = (UChar*)unusedTmpV; - for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; - - BZ2_bzReadClose ( &bzerr, bzf ); - if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" ); - - if (nUnused == 0 && myfeof(zStream)) break; - } - - closeok: - if (ferror(zStream)) goto errhandler_io; - if (stream != stdout) { - Int32 fd = fileno ( stream ); - if (fd < 0) goto errhandler_io; - applySavedFileAttrToOutputFile ( fd ); - } - ret = fclose ( zStream ); - if (ret == EOF) goto errhandler_io; - - if (ferror(stream)) goto errhandler_io; - ret = fflush ( stream ); - if (ret != 0) goto errhandler_io; - if (stream != stdout) { - ret = fclose ( stream ); - outputHandleJustInCase = NULL; - if (ret == EOF) goto errhandler_io; - } - outputHandleJustInCase = NULL; - if (verbosity >= 2) fprintf ( stderr, "\n " ); - return True; - - trycat: - if (forceOverwrite) { - rewind(zStream); - while (True) { - if (myfeof(zStream)) break; - nread = fread ( obuf, sizeof(UChar), 5000, zStream ); - if (ferror(zStream)) goto errhandler_io; - if (nread > 0) fwrite ( obuf, sizeof(UChar), nread, stream ); - if (ferror(stream)) goto errhandler_io; - } - goto closeok; - } - - errhandler: - BZ2_bzReadClose ( &bzerr_dummy, bzf ); - switch (bzerr) { - case BZ_CONFIG_ERROR: - configError(); break; - case BZ_IO_ERROR: - errhandler_io: - ioError(); break; - case BZ_DATA_ERROR: - crcError(); - case BZ_MEM_ERROR: - outOfMemory(); - case BZ_UNEXPECTED_EOF: - compressedStreamEOF(); - case BZ_DATA_ERROR_MAGIC: - if (zStream != stdin) fclose(zStream); - if (stream != stdout) fclose(stream); - if (streamNo == 1) { - return False; - } else { - if (noisy) - fprintf ( stderr, - "\n%s: %s: trailing garbage after EOF ignored\n", - progName, inName ); - return True; - } - default: - panic ( "decompress:unexpected error" ); - } - - panic ( "decompress:end" ); - return True; /*notreached*/ -} - - -/*---------------------------------------------*/ -static -Bool testStream ( FILE *zStream ) -{ - BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; - UChar obuf[5000]; - UChar unused[BZ_MAX_UNUSED]; - Int32 nUnused; - void* unusedTmpV; - UChar* unusedTmp; - - nUnused = 0; - streamNo = 0; - - SET_BINARY_MODE(zStream); - if (ferror(zStream)) goto errhandler_io; - - while (True) { - - bzf = BZ2_bzReadOpen ( - &bzerr, zStream, verbosity, - (int)smallMode, unused, nUnused - ); - if (bzf == NULL || bzerr != BZ_OK) goto errhandler; - streamNo++; - - while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); - if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; - } - if (bzerr != BZ_STREAM_END) goto errhandler; - - BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused ); - if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" ); - - unusedTmp = (UChar*)unusedTmpV; - for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; - - BZ2_bzReadClose ( &bzerr, bzf ); - if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" ); - if (nUnused == 0 && myfeof(zStream)) break; - - } - - if (ferror(zStream)) goto errhandler_io; - ret = fclose ( zStream ); - if (ret == EOF) goto errhandler_io; - - if (verbosity >= 2) fprintf ( stderr, "\n " ); - return True; - - errhandler: - BZ2_bzReadClose ( &bzerr_dummy, bzf ); - if (verbosity == 0) - fprintf ( stderr, "%s: %s: ", progName, inName ); - switch (bzerr) { - case BZ_CONFIG_ERROR: - configError(); break; - case BZ_IO_ERROR: - errhandler_io: - ioError(); break; - case BZ_DATA_ERROR: - fprintf ( stderr, - "data integrity (CRC) error in data\n" ); - return False; - case BZ_MEM_ERROR: - outOfMemory(); - case BZ_UNEXPECTED_EOF: - fprintf ( stderr, - "file ends unexpectedly\n" ); - return False; - case BZ_DATA_ERROR_MAGIC: - if (zStream != stdin) fclose(zStream); - if (streamNo == 1) { - fprintf ( stderr, - "bad magic number (file not created by bzip2)\n" ); - return False; - } else { - if (noisy) - fprintf ( stderr, - "trailing garbage after EOF ignored\n" ); - return True; - } - default: - panic ( "test:unexpected error" ); - } - - panic ( "test:end" ); - return True; /*notreached*/ -} - - -/*---------------------------------------------------*/ -/*--- Error [non-] handling grunge ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------*/ -static -void setExit ( Int32 v ) -{ - if (v > exitValue) exitValue = v; -} - - -/*---------------------------------------------*/ -static -void cadvise ( void ) -{ - if (noisy) - fprintf ( - stderr, - "\nIt is possible that the compressed file(s) have become corrupted.\n" - "You can use the -tvv option to test integrity of such files.\n\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); -} - - -/*---------------------------------------------*/ -static -void showFileNames ( void ) -{ - if (noisy) - fprintf ( - stderr, - "\tInput file = %s, output file = %s\n", - inName, outName - ); -} - - -/*---------------------------------------------*/ -static -void cleanUpAndFail ( Int32 ec ) -{ - IntNative retVal; - struct MY_STAT statBuf; - - if ( srcMode == SM_F2F - && opMode != OM_TEST - && deleteOutputOnInterrupt ) { - - /* Check whether input file still exists. Delete output file - only if input exists to avoid loss of data. Joerg Prante, 5 - January 2002. (JRS 06-Jan-2002: other changes in 1.0.2 mean - this is less likely to happen. But to be ultra-paranoid, we - do the check anyway.) */ - retVal = MY_STAT ( inName, &statBuf ); - if (retVal == 0) { - if (noisy) - fprintf ( stderr, - "%s: Deleting output file %s, if it exists.\n", - progName, outName ); - if (outputHandleJustInCase != NULL) - fclose ( outputHandleJustInCase ); - retVal = remove ( outName ); - if (retVal != 0) - fprintf ( stderr, - "%s: WARNING: deletion of output file " - "(apparently) failed.\n", - progName ); - } else { - fprintf ( stderr, - "%s: WARNING: deletion of output file suppressed\n", - progName ); - fprintf ( stderr, - "%s: since input file no longer exists. Output file\n", - progName ); - fprintf ( stderr, - "%s: `%s' may be incomplete.\n", - progName, outName ); - fprintf ( stderr, - "%s: I suggest doing an integrity test (bzip2 -tv)" - " of it.\n", - progName ); - } - } - - if (noisy && numFileNames > 0 && numFilesProcessed < numFileNames) { - fprintf ( stderr, - "%s: WARNING: some files have not been processed:\n" - "%s: %d specified on command line, %d not processed yet.\n\n", - progName, progName, - numFileNames, numFileNames - numFilesProcessed ); - } - setExit(ec); - exit(exitValue); -} - - -/*---------------------------------------------*/ -static -void panic ( const Char* s ) -{ - fprintf ( stderr, - "\n%s: PANIC -- internal consistency error:\n" - "\t%s\n" - "\tThis is a BUG. Please report it to me at:\n" - "\tjseward@bzip.org\n", - progName, s ); - showFileNames(); - cleanUpAndFail( 3 ); -} - - -/*---------------------------------------------*/ -static -void crcError ( void ) -{ - fprintf ( stderr, - "\n%s: Data integrity error when decompressing.\n", - progName ); - showFileNames(); - cadvise(); - cleanUpAndFail( 2 ); -} - - -/*---------------------------------------------*/ -static -void compressedStreamEOF ( void ) -{ - if (noisy) { - fprintf ( stderr, - "\n%s: Compressed file ends unexpectedly;\n\t" - "perhaps it is corrupted? *Possible* reason follows.\n", - progName ); - perror ( progName ); - showFileNames(); - cadvise(); - } - cleanUpAndFail( 2 ); -} - - -/*---------------------------------------------*/ -static -void ioError ( void ) -{ - fprintf ( stderr, - "\n%s: I/O or other error, bailing out. " - "Possible reason follows.\n", - progName ); - perror ( progName ); - showFileNames(); - cleanUpAndFail( 1 ); -} - - -/*---------------------------------------------*/ -static -void mySignalCatcher ( IntNative n ) -{ - fprintf ( stderr, - "\n%s: Control-C or similar caught, quitting.\n", - progName ); - cleanUpAndFail(1); -} - - -/*---------------------------------------------*/ -static -void mySIGSEGVorSIGBUScatcher ( IntNative n ) -{ - if (opMode == OM_Z) - fprintf ( - stderr, - "\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n" - "\n" - " Possible causes are (most likely first):\n" - " (1) This computer has unreliable memory or cache hardware\n" - " (a surprisingly common problem; try a different machine.)\n" - " (2) A bug in the compiler used to create this executable\n" - " (unlikely, if you didn't compile bzip2 yourself.)\n" - " (3) A real bug in bzip2 -- I hope this should never be the case.\n" - " The user's manual, Section 4.3, has more info on (1) and (2).\n" - " \n" - " If you suspect this is a bug in bzip2, or are unsure about (1)\n" - " or (2), feel free to report it to me at: jseward@bzip.org.\n" - " Section 4.3 of the user's manual describes the info a useful\n" - " bug report should have. If the manual is available on your\n" - " system, please try and read it before mailing me. If you don't\n" - " have the manual or can't be bothered to read it, mail me anyway.\n" - "\n", - progName ); - else - fprintf ( - stderr, - "\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n" - "\n" - " Possible causes are (most likely first):\n" - " (1) The compressed data is corrupted, and bzip2's usual checks\n" - " failed to detect this. Try bzip2 -tvv my_file.bz2.\n" - " (2) This computer has unreliable memory or cache hardware\n" - " (a surprisingly common problem; try a different machine.)\n" - " (3) A bug in the compiler used to create this executable\n" - " (unlikely, if you didn't compile bzip2 yourself.)\n" - " (4) A real bug in bzip2 -- I hope this should never be the case.\n" - " The user's manual, Section 4.3, has more info on (2) and (3).\n" - " \n" - " If you suspect this is a bug in bzip2, or are unsure about (2)\n" - " or (3), feel free to report it to me at: jseward@bzip.org.\n" - " Section 4.3 of the user's manual describes the info a useful\n" - " bug report should have. If the manual is available on your\n" - " system, please try and read it before mailing me. If you don't\n" - " have the manual or can't be bothered to read it, mail me anyway.\n" - "\n", - progName ); - - showFileNames(); - if (opMode == OM_Z) - cleanUpAndFail( 3 ); else - { cadvise(); cleanUpAndFail( 2 ); } -} - - -/*---------------------------------------------*/ -static -void outOfMemory ( void ) -{ - fprintf ( stderr, - "\n%s: couldn't allocate enough memory\n", - progName ); - showFileNames(); - cleanUpAndFail(1); -} - - -/*---------------------------------------------*/ -static -void configError ( void ) -{ - fprintf ( stderr, - "bzip2: I'm not configured correctly for this platform!\n" - "\tI require Int32, Int16 and Char to have sizes\n" - "\tof 4, 2 and 1 bytes to run properly, and they don't.\n" - "\tProbably you can fix this by defining them correctly,\n" - "\tand recompiling. Bye!\n" ); - setExit(3); - exit(exitValue); -} - - -/*---------------------------------------------------*/ -/*--- The main driver machinery ---*/ -/*---------------------------------------------------*/ - -/* All rather crufty. The main problem is that input files - are stat()d multiple times before use. This should be - cleaned up. -*/ - -/*---------------------------------------------*/ -static -void pad ( Char *s ) -{ - Int32 i; - if ( (Int32)strlen(s) >= longestFileName ) return; - for (i = 1; i <= longestFileName - (Int32)strlen(s); i++) - fprintf ( stderr, " " ); -} - - -/*---------------------------------------------*/ -static -void copyFileName ( Char* to, Char* from ) -{ - if ( strlen(from) > FILE_NAME_LEN-10 ) { - fprintf ( - stderr, - "bzip2: file name\n`%s'\n" - "is suspiciously (more than %d chars) long.\n" - "Try using a reasonable file name instead. Sorry! :-)\n", - from, FILE_NAME_LEN-10 - ); - setExit(1); - exit(exitValue); - } - - strncpy(to,from,FILE_NAME_LEN-10); - to[FILE_NAME_LEN-10]='\0'; -} - - -/*---------------------------------------------*/ -static -Bool fileExists ( Char* name ) -{ - FILE *tmp = fopen ( name, "rb" ); - Bool exists = (tmp != NULL); - if (tmp != NULL) fclose ( tmp ); - return exists; -} - - -/*---------------------------------------------*/ -/* Open an output file safely with O_EXCL and good permissions. - This avoids a race condition in versions < 1.0.2, in which - the file was first opened and then had its interim permissions - set safely. We instead use open() to create the file with - the interim permissions required. (--- --- rw-). - - For non-Unix platforms, if we are not worrying about - security issues, simple this simply behaves like fopen. -*/ -static -FILE* fopen_output_safely ( Char* name, const char* mode ) -{ -# if BZ_UNIX - FILE* fp; - IntNative fh; - fh = open(name, O_WRONLY|O_CREAT|O_EXCL, S_IWUSR|S_IRUSR); - if (fh == -1) return NULL; - fp = fdopen(fh, mode); - if (fp == NULL) close(fh); - return fp; -# else - return fopen(name, mode); -# endif -} - - -/*---------------------------------------------*/ -/*-- - if in doubt, return True ---*/ -static -Bool notAStandardFile ( Char* name ) -{ - IntNative i; - struct MY_STAT statBuf; - - i = MY_LSTAT ( name, &statBuf ); - if (i != 0) return True; - if (MY_S_ISREG(statBuf.st_mode)) return False; - return True; -} - - -/*---------------------------------------------*/ -/*-- - rac 11/21/98 see if file has hard links to it ---*/ -static -Int32 countHardLinks ( Char* name ) -{ - IntNative i; - struct MY_STAT statBuf; - - i = MY_LSTAT ( name, &statBuf ); - if (i != 0) return 0; - return (statBuf.st_nlink - 1); -} - - -/*---------------------------------------------*/ -/* Copy modification date, access date, permissions and owner from the - source to destination file. We have to copy this meta-info off - into fileMetaInfo before starting to compress / decompress it, - because doing it afterwards means we get the wrong access time. - - To complicate matters, in compress() and decompress() below, the - sequence of tests preceding the call to saveInputFileMetaInfo() - involves calling fileExists(), which in turn establishes its result - by attempting to fopen() the file, and if successful, immediately - fclose()ing it again. So we have to assume that the fopen() call - does not cause the access time field to be updated. - - Reading of the man page for stat() (man 2 stat) on RedHat 7.2 seems - to imply that merely doing open() will not affect the access time. - Therefore we merely need to hope that the C library only does - open() as a result of fopen(), and not any kind of read()-ahead - cleverness. - - It sounds pretty fragile to me. Whether this carries across - robustly to arbitrary Unix-like platforms (or even works robustly - on this one, RedHat 7.2) is unknown to me. Nevertheless ... -*/ -#if BZ_UNIX -static -struct MY_STAT fileMetaInfo; -#endif - -static -void saveInputFileMetaInfo ( Char *srcName ) -{ -# if BZ_UNIX - IntNative retVal; - /* Note use of stat here, not lstat. */ - retVal = MY_STAT( srcName, &fileMetaInfo ); - ERROR_IF_NOT_ZERO ( retVal ); -# endif -} - - -static -void applySavedTimeInfoToOutputFile ( Char *dstName ) -{ -# if BZ_UNIX - IntNative retVal; - struct utimbuf uTimBuf; - - uTimBuf.actime = fileMetaInfo.st_atime; - uTimBuf.modtime = fileMetaInfo.st_mtime; - - retVal = utime ( dstName, &uTimBuf ); - ERROR_IF_NOT_ZERO ( retVal ); -# endif -} - -static -void applySavedFileAttrToOutputFile ( IntNative fd ) -{ -# if BZ_UNIX - IntNative retVal; - - retVal = fchmod ( fd, fileMetaInfo.st_mode ); - ERROR_IF_NOT_ZERO ( retVal ); - - (void) fchown ( fd, fileMetaInfo.st_uid, fileMetaInfo.st_gid ); - /* chown() will in many cases return with EPERM, which can - be safely ignored. - */ -# endif -} - - -/*---------------------------------------------*/ -static -Bool containsDubiousChars ( Char* name ) -{ -# if BZ_UNIX - /* On unix, files can contain any characters and the file expansion - * is performed by the shell. - */ - return False; -# else /* ! BZ_UNIX */ - /* On non-unix (Win* platforms), wildcard characters are not allowed in - * filenames. - */ - for (; *name != '\0'; name++) - if (*name == '?' || *name == '*') return True; - return False; -# endif /* BZ_UNIX */ -} - - -/*---------------------------------------------*/ -#define BZ_N_SUFFIX_PAIRS 4 - -const Char* zSuffix[BZ_N_SUFFIX_PAIRS] - = { ".bz2", ".bz", ".tbz2", ".tbz" }; -const Char* unzSuffix[BZ_N_SUFFIX_PAIRS] - = { "", "", ".tar", ".tar" }; - -static -Bool hasSuffix ( Char* s, const Char* suffix ) -{ - Int32 ns = strlen(s); - Int32 nx = strlen(suffix); - if (ns < nx) return False; - if (strcmp(s + ns - nx, suffix) == 0) return True; - return False; -} - -static -Bool mapSuffix ( Char* name, - const Char* oldSuffix, - const Char* newSuffix ) -{ - if (!hasSuffix(name,oldSuffix)) return False; - name[strlen(name)-strlen(oldSuffix)] = 0; - strcat ( name, newSuffix ); - return True; -} - - -/*---------------------------------------------*/ -static -void compress ( Char *name ) -{ - FILE *inStr; - FILE *outStr; - Int32 n, i; - struct MY_STAT statBuf; - - deleteOutputOnInterrupt = False; - - if (name == NULL && srcMode != SM_I2O) - panic ( "compress: bad modes\n" ); - - switch (srcMode) { - case SM_I2O: - copyFileName ( inName, (Char*)"(stdin)" ); - copyFileName ( outName, (Char*)"(stdout)" ); - break; - case SM_F2F: - copyFileName ( inName, name ); - copyFileName ( outName, name ); - strcat ( outName, ".bz2" ); - break; - case SM_F2O: - copyFileName ( inName, name ); - copyFileName ( outName, (Char*)"(stdout)" ); - break; - } - - if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) { - if (noisy) - fprintf ( stderr, "%s: There are no files matching `%s'.\n", - progName, inName ); - setExit(1); - return; - } - if ( srcMode != SM_I2O && !fileExists ( inName ) ) { - fprintf ( stderr, "%s: Can't open input file %s: %s.\n", - progName, inName, strerror(errno) ); - setExit(1); - return; - } - for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) { - if (hasSuffix(inName, zSuffix[i])) { - if (noisy) - fprintf ( stderr, - "%s: Input file %s already has %s suffix.\n", - progName, inName, zSuffix[i] ); - setExit(1); - return; - } - } - if ( srcMode == SM_F2F || srcMode == SM_F2O ) { - MY_STAT(inName, &statBuf); - if ( MY_S_ISDIR(statBuf.st_mode) ) { - fprintf( stderr, - "%s: Input file %s is a directory.\n", - progName,inName); - setExit(1); - return; - } - } - if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) { - if (noisy) - fprintf ( stderr, "%s: Input file %s is not a normal file.\n", - progName, inName ); - setExit(1); - return; - } - if ( srcMode == SM_F2F && fileExists ( outName ) ) { - if (forceOverwrite) { - remove(outName); - } else { - fprintf ( stderr, "%s: Output file %s already exists.\n", - progName, outName ); - setExit(1); - return; - } - } - if ( srcMode == SM_F2F && !forceOverwrite && - (n=countHardLinks ( inName )) > 0) { - fprintf ( stderr, "%s: Input file %s has %d other link%s.\n", - progName, inName, n, n > 1 ? "s" : "" ); - setExit(1); - return; - } - - if ( srcMode == SM_F2F ) { - /* Save the file's meta-info before we open it. Doing it later - means we mess up the access times. */ - saveInputFileMetaInfo ( inName ); - } - - switch ( srcMode ) { - - case SM_I2O: - inStr = stdin; - outStr = stdout; - if ( isatty ( fileno ( stdout ) ) ) { - fprintf ( stderr, - "%s: I won't write compressed data to a terminal.\n", - progName ); - fprintf ( stderr, "%s: For help, type: `%s --help'.\n", - progName, progName ); - setExit(1); - return; - }; - break; - - case SM_F2O: - inStr = fopen ( inName, "rb" ); - outStr = stdout; - if ( isatty ( fileno ( stdout ) ) ) { - fprintf ( stderr, - "%s: I won't write compressed data to a terminal.\n", - progName ); - fprintf ( stderr, "%s: For help, type: `%s --help'.\n", - progName, progName ); - if ( inStr != NULL ) fclose ( inStr ); - setExit(1); - return; - }; - if ( inStr == NULL ) { - fprintf ( stderr, "%s: Can't open input file %s: %s.\n", - progName, inName, strerror(errno) ); - setExit(1); - return; - }; - break; - - case SM_F2F: - inStr = fopen ( inName, "rb" ); - outStr = fopen_output_safely ( outName, "wb" ); - if ( outStr == NULL) { - fprintf ( stderr, "%s: Can't create output file %s: %s.\n", - progName, outName, strerror(errno) ); - if ( inStr != NULL ) fclose ( inStr ); - setExit(1); - return; - } - if ( inStr == NULL ) { - fprintf ( stderr, "%s: Can't open input file %s: %s.\n", - progName, inName, strerror(errno) ); - if ( outStr != NULL ) fclose ( outStr ); - setExit(1); - return; - }; - break; - - default: - panic ( "compress: bad srcMode" ); - break; - } - - if (verbosity >= 1) { - fprintf ( stderr, " %s: ", inName ); - pad ( inName ); - fflush ( stderr ); - } - - /*--- Now the input and output handles are sane. Do the Biz. ---*/ - outputHandleJustInCase = outStr; - deleteOutputOnInterrupt = True; - compressStream ( inStr, outStr ); - outputHandleJustInCase = NULL; - - /*--- If there was an I/O error, we won't get here. ---*/ - if ( srcMode == SM_F2F ) { - applySavedTimeInfoToOutputFile ( outName ); - deleteOutputOnInterrupt = False; - if ( !keepInputFiles ) { - IntNative retVal = remove ( inName ); - ERROR_IF_NOT_ZERO ( retVal ); - } - } - - deleteOutputOnInterrupt = False; -} - - -/*---------------------------------------------*/ -static -void uncompress ( Char *name ) -{ - FILE *inStr; - FILE *outStr; - Int32 n, i; - Bool magicNumberOK; - Bool cantGuess; - struct MY_STAT statBuf; - - deleteOutputOnInterrupt = False; - - if (name == NULL && srcMode != SM_I2O) - panic ( "uncompress: bad modes\n" ); - - cantGuess = False; - switch (srcMode) { - case SM_I2O: - copyFileName ( inName, (Char*)"(stdin)" ); - copyFileName ( outName, (Char*)"(stdout)" ); - break; - case SM_F2F: - copyFileName ( inName, name ); - copyFileName ( outName, name ); - for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) - if (mapSuffix(outName,zSuffix[i],unzSuffix[i])) - goto zzz; - cantGuess = True; - strcat ( outName, ".out" ); - break; - case SM_F2O: - copyFileName ( inName, name ); - copyFileName ( outName, (Char*)"(stdout)" ); - break; - } - - zzz: - if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) { - if (noisy) - fprintf ( stderr, "%s: There are no files matching `%s'.\n", - progName, inName ); - setExit(1); - return; - } - if ( srcMode != SM_I2O && !fileExists ( inName ) ) { - fprintf ( stderr, "%s: Can't open input file %s: %s.\n", - progName, inName, strerror(errno) ); - setExit(1); - return; - } - if ( srcMode == SM_F2F || srcMode == SM_F2O ) { - MY_STAT(inName, &statBuf); - if ( MY_S_ISDIR(statBuf.st_mode) ) { - fprintf( stderr, - "%s: Input file %s is a directory.\n", - progName,inName); - setExit(1); - return; - } - } - if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) { - if (noisy) - fprintf ( stderr, "%s: Input file %s is not a normal file.\n", - progName, inName ); - setExit(1); - return; - } - if ( /* srcMode == SM_F2F implied && */ cantGuess ) { - if (noisy) - fprintf ( stderr, - "%s: Can't guess original name for %s -- using %s\n", - progName, inName, outName ); - /* just a warning, no return */ - } - if ( srcMode == SM_F2F && fileExists ( outName ) ) { - if (forceOverwrite) { - remove(outName); - } else { - fprintf ( stderr, "%s: Output file %s already exists.\n", - progName, outName ); - setExit(1); - return; - } - } - if ( srcMode == SM_F2F && !forceOverwrite && - (n=countHardLinks ( inName ) ) > 0) { - fprintf ( stderr, "%s: Input file %s has %d other link%s.\n", - progName, inName, n, n > 1 ? "s" : "" ); - setExit(1); - return; - } - - if ( srcMode == SM_F2F ) { - /* Save the file's meta-info before we open it. Doing it later - means we mess up the access times. */ - saveInputFileMetaInfo ( inName ); - } - - switch ( srcMode ) { - - case SM_I2O: - inStr = stdin; - outStr = stdout; - if ( isatty ( fileno ( stdin ) ) ) { - fprintf ( stderr, - "%s: I won't read compressed data from a terminal.\n", - progName ); - fprintf ( stderr, "%s: For help, type: `%s --help'.\n", - progName, progName ); - setExit(1); - return; - }; - break; - - case SM_F2O: - inStr = fopen ( inName, "rb" ); - outStr = stdout; - if ( inStr == NULL ) { - fprintf ( stderr, "%s: Can't open input file %s:%s.\n", - progName, inName, strerror(errno) ); - if ( inStr != NULL ) fclose ( inStr ); - setExit(1); - return; - }; - break; - - case SM_F2F: - inStr = fopen ( inName, "rb" ); - outStr = fopen_output_safely ( outName, "wb" ); - if ( outStr == NULL) { - fprintf ( stderr, "%s: Can't create output file %s: %s.\n", - progName, outName, strerror(errno) ); - if ( inStr != NULL ) fclose ( inStr ); - setExit(1); - return; - } - if ( inStr == NULL ) { - fprintf ( stderr, "%s: Can't open input file %s: %s.\n", - progName, inName, strerror(errno) ); - if ( outStr != NULL ) fclose ( outStr ); - setExit(1); - return; - }; - break; - - default: - panic ( "uncompress: bad srcMode" ); - break; - } - - if (verbosity >= 1) { - fprintf ( stderr, " %s: ", inName ); - pad ( inName ); - fflush ( stderr ); - } - - /*--- Now the input and output handles are sane. Do the Biz. ---*/ - outputHandleJustInCase = outStr; - deleteOutputOnInterrupt = True; - magicNumberOK = uncompressStream ( inStr, outStr ); - outputHandleJustInCase = NULL; - - /*--- If there was an I/O error, we won't get here. ---*/ - if ( magicNumberOK ) { - if ( srcMode == SM_F2F ) { - applySavedTimeInfoToOutputFile ( outName ); - deleteOutputOnInterrupt = False; - if ( !keepInputFiles ) { - IntNative retVal = remove ( inName ); - ERROR_IF_NOT_ZERO ( retVal ); - } - } - } else { - unzFailsExist = True; - deleteOutputOnInterrupt = False; - if ( srcMode == SM_F2F ) { - IntNative retVal = remove ( outName ); - ERROR_IF_NOT_ZERO ( retVal ); - } - } - deleteOutputOnInterrupt = False; - - if ( magicNumberOK ) { - if (verbosity >= 1) - fprintf ( stderr, "done\n" ); - } else { - setExit(2); - if (verbosity >= 1) - fprintf ( stderr, "not a bzip2 file.\n" ); else - fprintf ( stderr, - "%s: %s is not a bzip2 file.\n", - progName, inName ); - } - -} - - -/*---------------------------------------------*/ -static -void testf ( Char *name ) -{ - FILE *inStr; - Bool allOK; - struct MY_STAT statBuf; - - deleteOutputOnInterrupt = False; - - if (name == NULL && srcMode != SM_I2O) - panic ( "testf: bad modes\n" ); - - copyFileName ( outName, (Char*)"(none)" ); - switch (srcMode) { - case SM_I2O: copyFileName ( inName, (Char*)"(stdin)" ); break; - case SM_F2F: copyFileName ( inName, name ); break; - case SM_F2O: copyFileName ( inName, name ); break; - } - - if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) { - if (noisy) - fprintf ( stderr, "%s: There are no files matching `%s'.\n", - progName, inName ); - setExit(1); - return; - } - if ( srcMode != SM_I2O && !fileExists ( inName ) ) { - fprintf ( stderr, "%s: Can't open input %s: %s.\n", - progName, inName, strerror(errno) ); - setExit(1); - return; - } - if ( srcMode != SM_I2O ) { - MY_STAT(inName, &statBuf); - if ( MY_S_ISDIR(statBuf.st_mode) ) { - fprintf( stderr, - "%s: Input file %s is a directory.\n", - progName,inName); - setExit(1); - return; - } - } - - switch ( srcMode ) { - - case SM_I2O: - if ( isatty ( fileno ( stdin ) ) ) { - fprintf ( stderr, - "%s: I won't read compressed data from a terminal.\n", - progName ); - fprintf ( stderr, "%s: For help, type: `%s --help'.\n", - progName, progName ); - setExit(1); - return; - }; - inStr = stdin; - break; - - case SM_F2O: case SM_F2F: - inStr = fopen ( inName, "rb" ); - if ( inStr == NULL ) { - fprintf ( stderr, "%s: Can't open input file %s:%s.\n", - progName, inName, strerror(errno) ); - setExit(1); - return; - }; - break; - - default: - panic ( "testf: bad srcMode" ); - break; - } - - if (verbosity >= 1) { - fprintf ( stderr, " %s: ", inName ); - pad ( inName ); - fflush ( stderr ); - } - - /*--- Now the input handle is sane. Do the Biz. ---*/ - outputHandleJustInCase = NULL; - allOK = testStream ( inStr ); - - if (allOK && verbosity >= 1) fprintf ( stderr, "ok\n" ); - if (!allOK) testFailsExist = True; -} - - -/*---------------------------------------------*/ -static -void license ( void ) -{ - fprintf ( stderr, - - "bzip2, a block-sorting file compressor. " - "Version %s.\n" - " \n" - " Copyright (C) 1996-2007 by Julian Seward.\n" - " \n" - " This program is free software; you can redistribute it and/or modify\n" - " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.5 source distribution.\n" - " \n" - " This program is distributed in the hope that it will be useful,\n" - " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - " LICENSE file for more details.\n" - " \n", - BZ2_bzlibVersion() - ); -} - - -/*---------------------------------------------*/ -static -void usage ( Char *fullProgName ) -{ - fprintf ( - stderr, - "bzip2, a block-sorting file compressor. " - "Version %s.\n" - "\n usage: %s [flags and input files in any order]\n" - "\n" - " -h --help print this message\n" - " -d --decompress force decompression\n" - " -z --compress force compression\n" - " -k --keep keep (don't delete) input files\n" - " -f --force overwrite existing output files\n" - " -t --test test compressed file integrity\n" - " -c --stdout output to standard out\n" - " -q --quiet suppress noncritical error messages\n" - " -v --verbose be verbose (a 2nd -v gives more)\n" - " -L --license display software version & license\n" - " -V --version display software version & license\n" - " -s --small use less memory (at most 2500k)\n" - " -1 .. -9 set block size to 100k .. 900k\n" - " --fast alias for -1\n" - " --best alias for -9\n" - "\n" - " If invoked as `bzip2', default action is to compress.\n" - " as `bunzip2', default action is to decompress.\n" - " as `bzcat', default action is to decompress to stdout.\n" - "\n" - " If no file names are given, bzip2 compresses or decompresses\n" - " from standard input to standard output. You can combine\n" - " short flags, so `-v -4' means the same as -v4 or -4v, &c.\n" -# if BZ_UNIX - "\n" -# endif - , - - BZ2_bzlibVersion(), - fullProgName - ); -} - - -/*---------------------------------------------*/ -static -void redundant ( Char* flag ) -{ - fprintf ( - stderr, - "%s: %s is redundant in versions 0.9.5 and above\n", - progName, flag ); -} - - -/*---------------------------------------------*/ -/*-- - All the garbage from here to main() is purely to - implement a linked list of command-line arguments, - into which main() copies argv[1 .. argc-1]. - - The purpose of this exercise is to facilitate - the expansion of wildcard characters * and ? in - filenames for OSs which don't know how to do it - themselves, like MSDOS, Windows 95 and NT. - - The actual Dirty Work is done by the platform- - specific macro APPEND_FILESPEC. ---*/ - -typedef - struct zzzz { - Char *name; - struct zzzz *link; - } - Cell; - - -/*---------------------------------------------*/ -static -void *myMalloc ( Int32 n ) -{ - void* p; - - p = malloc ( (size_t)n ); - if (p == NULL) outOfMemory (); - return p; -} - - -/*---------------------------------------------*/ -static -Cell *mkCell ( void ) -{ - Cell *c; - - c = (Cell*) myMalloc ( sizeof ( Cell ) ); - c->name = NULL; - c->link = NULL; - return c; -} - - -/*---------------------------------------------*/ -static -Cell *snocString ( Cell *root, Char *name ) -{ - if (root == NULL) { - Cell *tmp = mkCell(); - tmp->name = (Char*) myMalloc ( 5 + strlen(name) ); - strcpy ( tmp->name, name ); - return tmp; - } else { - Cell *tmp = root; - while (tmp->link != NULL) tmp = tmp->link; - tmp->link = snocString ( tmp->link, name ); - return root; - } -} - - -/*---------------------------------------------*/ -static -void addFlagsFromEnvVar ( Cell** argList, Char* varName ) -{ - Int32 i, j, k; - Char *envbase, *p; - - envbase = getenv(varName); - if (envbase != NULL) { - p = envbase; - i = 0; - while (True) { - if (p[i] == 0) break; - p += i; - i = 0; - while (isspace((Int32)(p[0]))) p++; - while (p[i] != 0 && !isspace((Int32)(p[i]))) i++; - if (i > 0) { - k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10; - for (j = 0; j < k; j++) tmpName[j] = p[j]; - tmpName[k] = 0; - APPEND_FLAG(*argList, tmpName); - } - } - } -} - - -/*---------------------------------------------*/ -#define ISFLAG(s) (strcmp(aa->name, (s))==0) - -IntNative main ( IntNative argc, Char *argv[] ) -{ - Int32 i, j; - Char *tmp; - Cell *argList; - Cell *aa; - Bool decode; - - /*-- Be really really really paranoid :-) --*/ - if (sizeof(Int32) != 4 || sizeof(UInt32) != 4 || - sizeof(Int16) != 2 || sizeof(UInt16) != 2 || - sizeof(Char) != 1 || sizeof(UChar) != 1) - configError(); - - /*-- Initialise --*/ - outputHandleJustInCase = NULL; - smallMode = False; - keepInputFiles = False; - forceOverwrite = False; - noisy = True; - verbosity = 0; - blockSize100k = 9; - testFailsExist = False; - unzFailsExist = False; - numFileNames = 0; - numFilesProcessed = 0; - workFactor = 30; - deleteOutputOnInterrupt = False; - exitValue = 0; - i = j = 0; /* avoid bogus warning from egcs-1.1.X */ - - /*-- Set up signal handlers for mem access errors --*/ - signal (SIGSEGV, mySIGSEGVorSIGBUScatcher); -# if BZ_UNIX -# ifndef __DJGPP__ - signal (SIGBUS, mySIGSEGVorSIGBUScatcher); -# endif -# endif - - copyFileName ( inName, (Char*)"(none)" ); - copyFileName ( outName, (Char*)"(none)" ); - - copyFileName ( progNameReally, argv[0] ); - progName = &progNameReally[0]; - for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++) - if (*tmp == PATH_SEP) progName = tmp + 1; - - - /*-- Copy flags from env var BZIP2, and - expand filename wildcards in arg list. - --*/ - argList = NULL; - addFlagsFromEnvVar ( &argList, (Char*)"BZIP2" ); - addFlagsFromEnvVar ( &argList, (Char*)"BZIP" ); - for (i = 1; i <= argc-1; i++) - APPEND_FILESPEC(argList, argv[i]); - - - /*-- Find the length of the longest filename --*/ - longestFileName = 7; - numFileNames = 0; - decode = True; - for (aa = argList; aa != NULL; aa = aa->link) { - if (ISFLAG("--")) { decode = False; continue; } - if (aa->name[0] == '-' && decode) continue; - numFileNames++; - if (longestFileName < (Int32)strlen(aa->name) ) - longestFileName = (Int32)strlen(aa->name); - } - - - /*-- Determine source modes; flag handling may change this too. --*/ - if (numFileNames == 0) - srcMode = SM_I2O; else srcMode = SM_F2F; - - - /*-- Determine what to do (compress/uncompress/test/cat). --*/ - /*-- Note that subsequent flag handling may change this. --*/ - opMode = OM_Z; - - if ( (strstr ( progName, "unzip" ) != 0) || - (strstr ( progName, "UNZIP" ) != 0) ) - opMode = OM_UNZ; - - if ( (strstr ( progName, "z2cat" ) != 0) || - (strstr ( progName, "Z2CAT" ) != 0) || - (strstr ( progName, "zcat" ) != 0) || - (strstr ( progName, "ZCAT" ) != 0) ) { - opMode = OM_UNZ; - srcMode = (numFileNames == 0) ? SM_I2O : SM_F2O; - } - - - /*-- Look at the flags. --*/ - for (aa = argList; aa != NULL; aa = aa->link) { - if (ISFLAG("--")) break; - if (aa->name[0] == '-' && aa->name[1] != '-') { - for (j = 1; aa->name[j] != '\0'; j++) { - switch (aa->name[j]) { - case 'c': srcMode = SM_F2O; break; - case 'd': opMode = OM_UNZ; break; - case 'z': opMode = OM_Z; break; - case 'f': forceOverwrite = True; break; - case 't': opMode = OM_TEST; break; - case 'k': keepInputFiles = True; break; - case 's': smallMode = True; break; - case 'q': noisy = False; break; - case '1': blockSize100k = 1; break; - case '2': blockSize100k = 2; break; - case '3': blockSize100k = 3; break; - case '4': blockSize100k = 4; break; - case '5': blockSize100k = 5; break; - case '6': blockSize100k = 6; break; - case '7': blockSize100k = 7; break; - case '8': blockSize100k = 8; break; - case '9': blockSize100k = 9; break; - case 'V': - case 'L': license(); break; - case 'v': verbosity++; break; - case 'h': usage ( progName ); - exit ( 0 ); - break; - default: fprintf ( stderr, "%s: Bad flag `%s'\n", - progName, aa->name ); - usage ( progName ); - exit ( 1 ); - break; - } - } - } - } - - /*-- And again ... --*/ - for (aa = argList; aa != NULL; aa = aa->link) { - if (ISFLAG("--")) break; - if (ISFLAG("--stdout")) srcMode = SM_F2O; else - if (ISFLAG("--decompress")) opMode = OM_UNZ; else - if (ISFLAG("--compress")) opMode = OM_Z; else - if (ISFLAG("--force")) forceOverwrite = True; else - if (ISFLAG("--test")) opMode = OM_TEST; else - if (ISFLAG("--keep")) keepInputFiles = True; else - if (ISFLAG("--small")) smallMode = True; else - if (ISFLAG("--quiet")) noisy = False; else - if (ISFLAG("--version")) license(); else - if (ISFLAG("--license")) license(); else - if (ISFLAG("--exponential")) workFactor = 1; else - if (ISFLAG("--repetitive-best")) redundant(aa->name); else - if (ISFLAG("--repetitive-fast")) redundant(aa->name); else - if (ISFLAG("--fast")) blockSize100k = 1; else - if (ISFLAG("--best")) blockSize100k = 9; else - if (ISFLAG("--verbose")) verbosity++; else - if (ISFLAG("--help")) { usage ( progName ); exit ( 0 ); } - else - if (strncmp ( aa->name, "--", 2) == 0) { - fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name ); - usage ( progName ); - exit ( 1 ); - } - } - - if (verbosity > 4) verbosity = 4; - if (opMode == OM_Z && smallMode && blockSize100k > 2) - blockSize100k = 2; - - if (opMode == OM_TEST && srcMode == SM_F2O) { - fprintf ( stderr, "%s: -c and -t cannot be used together.\n", - progName ); - exit ( 1 ); - } - - if (srcMode == SM_F2O && numFileNames == 0) - srcMode = SM_I2O; - - if (opMode != OM_Z) blockSize100k = 0; - - if (srcMode == SM_F2F) { - signal (SIGINT, mySignalCatcher); - signal (SIGTERM, mySignalCatcher); -# if BZ_UNIX - signal (SIGHUP, mySignalCatcher); -# endif - } - - if (opMode == OM_Z) { - if (srcMode == SM_I2O) { - compress ( NULL ); - } else { - decode = True; - for (aa = argList; aa != NULL; aa = aa->link) { - if (ISFLAG("--")) { decode = False; continue; } - if (aa->name[0] == '-' && decode) continue; - numFilesProcessed++; - compress ( aa->name ); - } - } - } - else - - if (opMode == OM_UNZ) { - unzFailsExist = False; - if (srcMode == SM_I2O) { - uncompress ( NULL ); - } else { - decode = True; - for (aa = argList; aa != NULL; aa = aa->link) { - if (ISFLAG("--")) { decode = False; continue; } - if (aa->name[0] == '-' && decode) continue; - numFilesProcessed++; - uncompress ( aa->name ); - } - } - if (unzFailsExist) { - setExit(2); - exit(exitValue); - } - } - - else { - testFailsExist = False; - if (srcMode == SM_I2O) { - testf ( NULL ); - } else { - decode = True; - for (aa = argList; aa != NULL; aa = aa->link) { - if (ISFLAG("--")) { decode = False; continue; } - if (aa->name[0] == '-' && decode) continue; - numFilesProcessed++; - testf ( aa->name ); - } - } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); - setExit(2); - exit(exitValue); - } - } - - /* Free the argument list memory to mollify leak detectors - (eg) Purify, Checker. Serves no other useful purpose. - */ - aa = argList; - while (aa != NULL) { - Cell* aa2 = aa->link; - if (aa->name != NULL) free(aa->name); - free(aa); - aa = aa2; - } - - return exitValue; -} - - -/*-----------------------------------------------------------*/ -/*--- end bzip2.c ---*/ -/*-----------------------------------------------------------*/ diff --git a/externals/bzip2/bzip2recover.c b/externals/bzip2/bzip2recover.c deleted file mode 100644 index 5f6d6218095..00000000000 --- a/externals/bzip2/bzip2recover.c +++ /dev/null @@ -1,514 +0,0 @@ -/*-----------------------------------------------------------*/ -/*--- Block recoverer program for bzip2 ---*/ -/*--- bzip2recover.c ---*/ -/*-----------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - -/* This program is a complete hack and should be rewritten properly. - It isn't very complicated. */ - -#include -#include -#include -#include - - -/* This program records bit locations in the file to be recovered. - That means that if 64-bit ints are not supported, we will not - be able to recover .bz2 files over 512MB (2^32 bits) long. - On GNU supported platforms, we take advantage of the 64-bit - int support to circumvent this problem. Ditto MSVC. - - This change occurred in version 1.0.2; all prior versions have - the 512MB limitation. -*/ -#ifdef __GNUC__ - typedef unsigned long long int MaybeUInt64; -# define MaybeUInt64_FMT "%Lu" -#else -#ifdef _MSC_VER - typedef unsigned __int64 MaybeUInt64; -# define MaybeUInt64_FMT "%I64u" -#else - typedef unsigned int MaybeUInt64; -# define MaybeUInt64_FMT "%u" -#endif -#endif - -typedef unsigned int UInt32; -typedef int Int32; -typedef unsigned char UChar; -typedef char Char; -typedef unsigned char Bool; -#define True ((Bool)1) -#define False ((Bool)0) - - -#define BZ_MAX_FILENAME 2000 - -Char inFileName[BZ_MAX_FILENAME]; -Char outFileName[BZ_MAX_FILENAME]; -Char progName[BZ_MAX_FILENAME]; - -MaybeUInt64 bytesOut = 0; -MaybeUInt64 bytesIn = 0; - - -/*---------------------------------------------------*/ -/*--- Header bytes ---*/ -/*---------------------------------------------------*/ - -#define BZ_HDR_B 0x42 /* 'B' */ -#define BZ_HDR_Z 0x5a /* 'Z' */ -#define BZ_HDR_h 0x68 /* 'h' */ -#define BZ_HDR_0 0x30 /* '0' */ - - -/*---------------------------------------------------*/ -/*--- I/O errors ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------*/ -static void readError ( void ) -{ - fprintf ( stderr, - "%s: I/O error reading `%s', possible reason follows.\n", - progName, inFileName ); - perror ( progName ); - fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n", - progName ); - exit ( 1 ); -} - - -/*---------------------------------------------*/ -static void writeError ( void ) -{ - fprintf ( stderr, - "%s: I/O error reading `%s', possible reason follows.\n", - progName, inFileName ); - perror ( progName ); - fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n", - progName ); - exit ( 1 ); -} - - -/*---------------------------------------------*/ -static void mallocFail ( Int32 n ) -{ - fprintf ( stderr, - "%s: malloc failed on request for %d bytes.\n", - progName, n ); - fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n", - progName ); - exit ( 1 ); -} - - -/*---------------------------------------------*/ -static void tooManyBlocks ( Int32 max_handled_blocks ) -{ - fprintf ( stderr, - "%s: `%s' appears to contain more than %d blocks\n", - progName, inFileName, max_handled_blocks ); - fprintf ( stderr, - "%s: and cannot be handled. To fix, increase\n", - progName ); - fprintf ( stderr, - "%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n", - progName ); - exit ( 1 ); -} - - - -/*---------------------------------------------------*/ -/*--- Bit stream I/O ---*/ -/*---------------------------------------------------*/ - -typedef - struct { - FILE* handle; - Int32 buffer; - Int32 buffLive; - Char mode; - } - BitStream; - - -/*---------------------------------------------*/ -static BitStream* bsOpenReadStream ( FILE* stream ) -{ - BitStream *bs = malloc ( sizeof(BitStream) ); - if (bs == NULL) mallocFail ( sizeof(BitStream) ); - bs->handle = stream; - bs->buffer = 0; - bs->buffLive = 0; - bs->mode = 'r'; - return bs; -} - - -/*---------------------------------------------*/ -static BitStream* bsOpenWriteStream ( FILE* stream ) -{ - BitStream *bs = malloc ( sizeof(BitStream) ); - if (bs == NULL) mallocFail ( sizeof(BitStream) ); - bs->handle = stream; - bs->buffer = 0; - bs->buffLive = 0; - bs->mode = 'w'; - return bs; -} - - -/*---------------------------------------------*/ -static void bsPutBit ( BitStream* bs, Int32 bit ) -{ - if (bs->buffLive == 8) { - Int32 retVal = putc ( (UChar) bs->buffer, bs->handle ); - if (retVal == EOF) writeError(); - bytesOut++; - bs->buffLive = 1; - bs->buffer = bit & 0x1; - } else { - bs->buffer = ( (bs->buffer << 1) | (bit & 0x1) ); - bs->buffLive++; - }; -} - - -/*---------------------------------------------*/ -/*-- - Returns 0 or 1, or 2 to indicate EOF. ---*/ -static Int32 bsGetBit ( BitStream* bs ) -{ - if (bs->buffLive > 0) { - bs->buffLive --; - return ( ((bs->buffer) >> (bs->buffLive)) & 0x1 ); - } else { - Int32 retVal = getc ( bs->handle ); - if ( retVal == EOF ) { - if (errno != 0) readError(); - return 2; - } - bs->buffLive = 7; - bs->buffer = retVal; - return ( ((bs->buffer) >> 7) & 0x1 ); - } -} - - -/*---------------------------------------------*/ -static void bsClose ( BitStream* bs ) -{ - Int32 retVal; - - if ( bs->mode == 'w' ) { - while ( bs->buffLive < 8 ) { - bs->buffLive++; - bs->buffer <<= 1; - }; - retVal = putc ( (UChar) (bs->buffer), bs->handle ); - if (retVal == EOF) writeError(); - bytesOut++; - retVal = fflush ( bs->handle ); - if (retVal == EOF) writeError(); - } - retVal = fclose ( bs->handle ); - if (retVal == EOF) { - if (bs->mode == 'w') writeError(); else readError(); - } - free ( bs ); -} - - -/*---------------------------------------------*/ -static void bsPutUChar ( BitStream* bs, UChar c ) -{ - Int32 i; - for (i = 7; i >= 0; i--) - bsPutBit ( bs, (((UInt32) c) >> i) & 0x1 ); -} - - -/*---------------------------------------------*/ -static void bsPutUInt32 ( BitStream* bs, UInt32 c ) -{ - Int32 i; - - for (i = 31; i >= 0; i--) - bsPutBit ( bs, (c >> i) & 0x1 ); -} - - -/*---------------------------------------------*/ -static Bool endsInBz2 ( Char* name ) -{ - Int32 n = strlen ( name ); - if (n <= 4) return False; - return - (name[n-4] == '.' && - name[n-3] == 'b' && - name[n-2] == 'z' && - name[n-1] == '2'); -} - - -/*---------------------------------------------------*/ -/*--- ---*/ -/*---------------------------------------------------*/ - -/* This logic isn't really right when it comes to Cygwin. */ -#ifdef _WIN32 -# define BZ_SPLIT_SYM '\\' /* path splitter on Windows platform */ -#else -# define BZ_SPLIT_SYM '/' /* path splitter on Unix platform */ -#endif - -#define BLOCK_HEADER_HI 0x00003141UL -#define BLOCK_HEADER_LO 0x59265359UL - -#define BLOCK_ENDMARK_HI 0x00001772UL -#define BLOCK_ENDMARK_LO 0x45385090UL - -/* Increase if necessary. However, a .bz2 file with > 50000 blocks - would have an uncompressed size of at least 40GB, so the chances - are low you'll need to up this. -*/ -#define BZ_MAX_HANDLED_BLOCKS 50000 - -MaybeUInt64 bStart [BZ_MAX_HANDLED_BLOCKS]; -MaybeUInt64 bEnd [BZ_MAX_HANDLED_BLOCKS]; -MaybeUInt64 rbStart[BZ_MAX_HANDLED_BLOCKS]; -MaybeUInt64 rbEnd [BZ_MAX_HANDLED_BLOCKS]; - -Int32 main ( Int32 argc, Char** argv ) -{ - FILE* inFile; - FILE* outFile; - BitStream* bsIn, *bsWr; - Int32 b, wrBlock, currBlock, rbCtr; - MaybeUInt64 bitsRead; - - UInt32 buffHi, buffLo, blockCRC; - Char* p; - - strcpy ( progName, argv[0] ); - inFileName[0] = outFileName[0] = 0; - - fprintf ( stderr, - "bzip2recover 1.0.5: extracts blocks from damaged .bz2 files.\n" ); - - if (argc != 2) { - fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", - progName, progName ); - switch (sizeof(MaybeUInt64)) { - case 8: - fprintf(stderr, - "\trestrictions on size of recovered file: None\n"); - break; - case 4: - fprintf(stderr, - "\trestrictions on size of recovered file: 512 MB\n"); - fprintf(stderr, - "\tto circumvent, recompile with MaybeUInt64 as an\n" - "\tunsigned 64-bit int.\n"); - break; - default: - fprintf(stderr, - "\tsizeof(MaybeUInt64) is not 4 or 8 -- " - "configuration error.\n"); - break; - } - exit(1); - } - - if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) { - fprintf ( stderr, - "%s: supplied filename is suspiciously (>= %d chars) long. Bye!\n", - progName, (int)strlen(argv[1]) ); - exit(1); - } - - strcpy ( inFileName, argv[1] ); - - inFile = fopen ( inFileName, "rb" ); - if (inFile == NULL) { - fprintf ( stderr, "%s: can't read `%s'\n", progName, inFileName ); - exit(1); - } - - bsIn = bsOpenReadStream ( inFile ); - fprintf ( stderr, "%s: searching for block boundaries ...\n", progName ); - - bitsRead = 0; - buffHi = buffLo = 0; - currBlock = 0; - bStart[currBlock] = 0; - - rbCtr = 0; - - while (True) { - b = bsGetBit ( bsIn ); - bitsRead++; - if (b == 2) { - if (bitsRead >= bStart[currBlock] && - (bitsRead - bStart[currBlock]) >= 40) { - bEnd[currBlock] = bitsRead-1; - if (currBlock > 0) - fprintf ( stderr, " block %d runs from " MaybeUInt64_FMT - " to " MaybeUInt64_FMT " (incomplete)\n", - currBlock, bStart[currBlock], bEnd[currBlock] ); - } else - currBlock--; - break; - } - buffHi = (buffHi << 1) | (buffLo >> 31); - buffLo = (buffLo << 1) | (b & 1); - if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI - && buffLo == BLOCK_HEADER_LO) - || - ( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI - && buffLo == BLOCK_ENDMARK_LO) - ) { - if (bitsRead > 49) { - bEnd[currBlock] = bitsRead-49; - } else { - bEnd[currBlock] = 0; - } - if (currBlock > 0 && - (bEnd[currBlock] - bStart[currBlock]) >= 130) { - fprintf ( stderr, " block %d runs from " MaybeUInt64_FMT - " to " MaybeUInt64_FMT "\n", - rbCtr+1, bStart[currBlock], bEnd[currBlock] ); - rbStart[rbCtr] = bStart[currBlock]; - rbEnd[rbCtr] = bEnd[currBlock]; - rbCtr++; - } - if (currBlock >= BZ_MAX_HANDLED_BLOCKS) - tooManyBlocks(BZ_MAX_HANDLED_BLOCKS); - currBlock++; - - bStart[currBlock] = bitsRead; - } - } - - bsClose ( bsIn ); - - /*-- identified blocks run from 1 to rbCtr inclusive. --*/ - - if (rbCtr < 1) { - fprintf ( stderr, - "%s: sorry, I couldn't find any block boundaries.\n", - progName ); - exit(1); - }; - - fprintf ( stderr, "%s: splitting into blocks\n", progName ); - - inFile = fopen ( inFileName, "rb" ); - if (inFile == NULL) { - fprintf ( stderr, "%s: can't open `%s'\n", progName, inFileName ); - exit(1); - } - bsIn = bsOpenReadStream ( inFile ); - - /*-- placate gcc's dataflow analyser --*/ - blockCRC = 0; bsWr = 0; - - bitsRead = 0; - outFile = NULL; - wrBlock = 0; - while (True) { - b = bsGetBit(bsIn); - if (b == 2) break; - buffHi = (buffHi << 1) | (buffLo >> 31); - buffLo = (buffLo << 1) | (b & 1); - if (bitsRead == 47+rbStart[wrBlock]) - blockCRC = (buffHi << 16) | (buffLo >> 16); - - if (outFile != NULL && bitsRead >= rbStart[wrBlock] - && bitsRead <= rbEnd[wrBlock]) { - bsPutBit ( bsWr, b ); - } - - bitsRead++; - - if (bitsRead == rbEnd[wrBlock]+1) { - if (outFile != NULL) { - bsPutUChar ( bsWr, 0x17 ); bsPutUChar ( bsWr, 0x72 ); - bsPutUChar ( bsWr, 0x45 ); bsPutUChar ( bsWr, 0x38 ); - bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); - bsPutUInt32 ( bsWr, blockCRC ); - bsClose ( bsWr ); - } - if (wrBlock >= rbCtr) break; - wrBlock++; - } else - if (bitsRead == rbStart[wrBlock]) { - /* Create the output file name, correctly handling leading paths. - (31.10.2001 by Sergey E. Kusikov) */ - Char* split; - Int32 ofs, k; - for (k = 0; k < BZ_MAX_FILENAME; k++) - outFileName[k] = 0; - strcpy (outFileName, inFileName); - split = strrchr (outFileName, BZ_SPLIT_SYM); - if (split == NULL) { - split = outFileName; - } else { - ++split; - } - /* Now split points to the start of the basename. */ - ofs = split - outFileName; - sprintf (split, "rec%5d", wrBlock+1); - for (p = split; *p != 0; p++) if (*p == ' ') *p = '0'; - strcat (outFileName, inFileName + ofs); - - if ( !endsInBz2(outFileName)) strcat ( outFileName, ".bz2" ); - - fprintf ( stderr, " writing block %d to `%s' ...\n", - wrBlock+1, outFileName ); - - outFile = fopen ( outFileName, "wb" ); - if (outFile == NULL) { - fprintf ( stderr, "%s: can't write `%s'\n", - progName, outFileName ); - exit(1); - } - bsWr = bsOpenWriteStream ( outFile ); - bsPutUChar ( bsWr, BZ_HDR_B ); - bsPutUChar ( bsWr, BZ_HDR_Z ); - bsPutUChar ( bsWr, BZ_HDR_h ); - bsPutUChar ( bsWr, BZ_HDR_0 + 9 ); - bsPutUChar ( bsWr, 0x31 ); bsPutUChar ( bsWr, 0x41 ); - bsPutUChar ( bsWr, 0x59 ); bsPutUChar ( bsWr, 0x26 ); - bsPutUChar ( bsWr, 0x53 ); bsPutUChar ( bsWr, 0x59 ); - } - } - - fprintf ( stderr, "%s: finished\n", progName ); - return 0; -} - - - -/*-----------------------------------------------------------*/ -/*--- end bzip2recover.c ---*/ -/*-----------------------------------------------------------*/ diff --git a/externals/bzip2/dlltest.c b/externals/bzip2/dlltest.c deleted file mode 100644 index 4e27da2800d..00000000000 --- a/externals/bzip2/dlltest.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - minibz2 - libbz2.dll test program. - by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) - This file is Public Domain. Welcome any email to me. - - usage: minibz2 [-d] [-{1,2,..9}] [[srcfilename] destfilename] -*/ - -#define BZ_IMPORT -#include -#include -#include "bzlib.h" -#ifdef _WIN32 -#include -#endif - - -#ifdef _WIN32 - -#define BZ2_LIBNAME "libbz2-1.0.2.DLL" - -#include -static int BZ2DLLLoaded = 0; -static HINSTANCE BZ2DLLhLib; -int BZ2DLLLoadLibrary(void) -{ - HINSTANCE hLib; - - if(BZ2DLLLoaded==1){return 0;} - hLib=LoadLibrary(BZ2_LIBNAME); - if(hLib == NULL){ - fprintf(stderr,"Can't load %s\n",BZ2_LIBNAME); - return -1; - } - BZ2_bzlibVersion=GetProcAddress(hLib,"BZ2_bzlibVersion"); - BZ2_bzopen=GetProcAddress(hLib,"BZ2_bzopen"); - BZ2_bzdopen=GetProcAddress(hLib,"BZ2_bzdopen"); - BZ2_bzread=GetProcAddress(hLib,"BZ2_bzread"); - BZ2_bzwrite=GetProcAddress(hLib,"BZ2_bzwrite"); - BZ2_bzflush=GetProcAddress(hLib,"BZ2_bzflush"); - BZ2_bzclose=GetProcAddress(hLib,"BZ2_bzclose"); - BZ2_bzerror=GetProcAddress(hLib,"BZ2_bzerror"); - - if (!BZ2_bzlibVersion || !BZ2_bzopen || !BZ2_bzdopen - || !BZ2_bzread || !BZ2_bzwrite || !BZ2_bzflush - || !BZ2_bzclose || !BZ2_bzerror) { - fprintf(stderr,"GetProcAddress failed.\n"); - return -1; - } - BZ2DLLLoaded=1; - BZ2DLLhLib=hLib; - return 0; - -} -int BZ2DLLFreeLibrary(void) -{ - if(BZ2DLLLoaded==0){return 0;} - FreeLibrary(BZ2DLLhLib); - BZ2DLLLoaded=0; -} -#endif /* WIN32 */ - -void usage(void) -{ - puts("usage: minibz2 [-d] [-{1,2,..9}] [[srcfilename] destfilename]"); -} - -int main(int argc,char *argv[]) -{ - int decompress = 0; - int level = 9; - char *fn_r = NULL; - char *fn_w = NULL; - -#ifdef _WIN32 - if(BZ2DLLLoadLibrary()<0){ - fprintf(stderr,"Loading of %s failed. Giving up.\n", BZ2_LIBNAME); - exit(1); - } - printf("Loading of %s succeeded. Library version is %s.\n", - BZ2_LIBNAME, BZ2_bzlibVersion() ); -#endif - while(++argv,--argc){ - if(**argv =='-' || **argv=='/'){ - char *p; - - for(p=*argv+1;*p;p++){ - if(*p=='d'){ - decompress = 1; - }else if('1'<=*p && *p<='9'){ - level = *p - '0'; - }else{ - usage(); - exit(1); - } - } - }else{ - break; - } - } - if(argc>=1){ - fn_r = *argv; - argc--;argv++; - }else{ - fn_r = NULL; - } - if(argc>=1){ - fn_w = *argv; - argc--;argv++; - }else{ - fn_w = NULL; - } - { - int len; - char buff[0x1000]; - char mode[10]; - - if(decompress){ - BZFILE *BZ2fp_r = NULL; - FILE *fp_w = NULL; - - if(fn_w){ - if((fp_w = fopen(fn_w,"wb"))==NULL){ - printf("can't open [%s]\n",fn_w); - perror("reason:"); - exit(1); - } - }else{ - fp_w = stdout; - } - if((fn_r == NULL && (BZ2fp_r = BZ2_bzdopen(fileno(stdin),"rb"))==NULL) - || (fn_r != NULL && (BZ2fp_r = BZ2_bzopen(fn_r,"rb"))==NULL)){ - printf("can't bz2openstream\n"); - exit(1); - } - while((len=BZ2_bzread(BZ2fp_r,buff,0x1000))>0){ - fwrite(buff,1,len,fp_w); - } - BZ2_bzclose(BZ2fp_r); - if(fp_w != stdout) fclose(fp_w); - }else{ - BZFILE *BZ2fp_w = NULL; - FILE *fp_r = NULL; - - if(fn_r){ - if((fp_r = fopen(fn_r,"rb"))==NULL){ - printf("can't open [%s]\n",fn_r); - perror("reason:"); - exit(1); - } - }else{ - fp_r = stdin; - } - mode[0]='w'; - mode[1] = '0' + level; - mode[2] = '\0'; - - if((fn_w == NULL && (BZ2fp_w = BZ2_bzdopen(fileno(stdout),mode))==NULL) - || (fn_w !=NULL && (BZ2fp_w = BZ2_bzopen(fn_w,mode))==NULL)){ - printf("can't bz2openstream\n"); - exit(1); - } - while((len=fread(buff,1,0x1000,fp_r))>0){ - BZ2_bzwrite(BZ2fp_w,buff,len); - } - BZ2_bzclose(BZ2fp_w); - if(fp_r!=stdin)fclose(fp_r); - } - } -#ifdef _WIN32 - BZ2DLLFreeLibrary(); -#endif - return 0; -} diff --git a/externals/bzip2/mk251.c b/externals/bzip2/mk251.c deleted file mode 100644 index 39e94c05735..00000000000 --- a/externals/bzip2/mk251.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* Spew out a long sequence of the byte 251. When fed to bzip2 - versions 1.0.0 or 1.0.1, causes it to die with internal error - 1007 in blocksort.c. This assertion misses an extremely rare - case, which is fixed in this version (1.0.2) and above. -*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include - -int main () -{ - int i; - for (i = 0; i < 48500000 ; i++) - putchar(251); - return 0; -} diff --git a/externals/bzip2/spewG.c b/externals/bzip2/spewG.c deleted file mode 100644 index 5892b92c364..00000000000 --- a/externals/bzip2/spewG.c +++ /dev/null @@ -1,54 +0,0 @@ - -/* spew out a thoroughly gigantic file designed so that bzip2 - can compress it reasonably rapidly. This is to help test - support for large files (> 2GB) in a reasonable amount of time. - I suggest you use the undocumented --exponential option to - bzip2 when compressing the resulting file; this saves a bit of - time. Note: *don't* bother with --exponential when compressing - Real Files; it'll just waste a lot of CPU time :-) - (but is otherwise harmless). -*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#define _FILE_OFFSET_BITS 64 - -#include -#include - -/* The number of megabytes of junk to spew out (roughly) */ -#define MEGABYTES 5000 - -#define N_BUF 1000000 -char buf[N_BUF]; - -int main ( int argc, char** argv ) -{ - int ii, kk, p; - srandom(1); - setbuffer ( stdout, buf, N_BUF ); - for (kk = 0; kk < MEGABYTES * 515; kk+=3) { - p = 25+random()%50; - for (ii = 0; ii < p; ii++) - printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ); - for (ii = 0; ii < p-1; ii++) - printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" ); - for (ii = 0; ii < p+1; ii++) - printf ( "ccccccccccccccccccccccccccccccccccccc" ); - } - fflush(stdout); - return 0; -} diff --git a/externals/bzip2/unzcrash.c b/externals/bzip2/unzcrash.c deleted file mode 100644 index a1b75463adc..00000000000 --- a/externals/bzip2/unzcrash.c +++ /dev/null @@ -1,141 +0,0 @@ - -/* A test program written to test robustness to decompression of - corrupted data. Usage is - unzcrash filename - and the program will read the specified file, compress it (in memory), - and then repeatedly decompress it, each time with a different bit of - the compressed data inverted, so as to test all possible one-bit errors. - This should not cause any invalid memory accesses. If it does, - I want to know about it! - - PS. As you can see from the above description, the process is - incredibly slow. A file of size eg 5KB will cause it to run for - many hours. -*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#include -#include -#include "bzlib.h" - -#define M_BLOCK 1000000 - -typedef unsigned char uchar; - -#define M_BLOCK_OUT (M_BLOCK + 1000000) -uchar inbuf[M_BLOCK]; -uchar outbuf[M_BLOCK_OUT]; -uchar zbuf[M_BLOCK + 600 + (M_BLOCK / 100)]; - -int nIn, nOut, nZ; - -static char *bzerrorstrings[] = { - "OK" - ,"SEQUENCE_ERROR" - ,"PARAM_ERROR" - ,"MEM_ERROR" - ,"DATA_ERROR" - ,"DATA_ERROR_MAGIC" - ,"IO_ERROR" - ,"UNEXPECTED_EOF" - ,"OUTBUFF_FULL" - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ -}; - -void flip_bit ( int bit ) -{ - int byteno = bit / 8; - int bitno = bit % 8; - uchar mask = 1 << bitno; - //fprintf ( stderr, "(byte %d bit %d mask %d)", - // byteno, bitno, (int)mask ); - zbuf[byteno] ^= mask; -} - -int main ( int argc, char** argv ) -{ - FILE* f; - int r; - int bit; - int i; - - if (argc != 2) { - fprintf ( stderr, "usage: unzcrash filename\n" ); - return 1; - } - - f = fopen ( argv[1], "r" ); - if (!f) { - fprintf ( stderr, "unzcrash: can't open %s\n", argv[1] ); - return 1; - } - - nIn = fread ( inbuf, 1, M_BLOCK, f ); - fprintf ( stderr, "%d bytes read\n", nIn ); - - nZ = M_BLOCK; - r = BZ2_bzBuffToBuffCompress ( - zbuf, &nZ, inbuf, nIn, 9, 0, 30 ); - - assert (r == BZ_OK); - fprintf ( stderr, "%d after compression\n", nZ ); - - for (bit = 0; bit < nZ*8; bit++) { - fprintf ( stderr, "bit %d ", bit ); - flip_bit ( bit ); - nOut = M_BLOCK_OUT; - r = BZ2_bzBuffToBuffDecompress ( - outbuf, &nOut, zbuf, nZ, 0, 0 ); - fprintf ( stderr, " %d %s ", r, bzerrorstrings[-r] ); - - if (r != BZ_OK) { - fprintf ( stderr, "\n" ); - } else { - if (nOut != nIn) { - fprintf(stderr, "nIn/nOut mismatch %d %d\n", nIn, nOut ); - return 1; - } else { - for (i = 0; i < nOut; i++) - if (inbuf[i] != outbuf[i]) { - fprintf(stderr, "mismatch at %d\n", i ); - return 1; - } - if (i == nOut) fprintf(stderr, "really ok!\n" ); - } - } - - flip_bit ( bit ); - } - -#if 0 - assert (nOut == nIn); - for (i = 0; i < nOut; i++) { - if (inbuf[i] != outbuf[i]) { - fprintf ( stderr, "difference at %d !\n", i ); - return 1; - } - } -#endif - - fprintf ( stderr, "all ok\n" ); - return 0; -} diff --git a/externals/bzip2/win/VC90/bzip2.vcproj b/externals/bzip2/win/VC90/bzip2.vcproj index 08483f2f4e1..98b3a33d9b1 100644 --- a/externals/bzip2/win/VC90/bzip2.vcproj +++ b/externals/bzip2/win/VC90/bzip2.vcproj @@ -21,8 +21,8 @@ @@ -45,132 +45,10 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - MinimalRebuild="true" + PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE" + MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - DebugInformationFormat="4" - /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -311,11 +319,11 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > diff --git a/dep/src/g3dlite/AABox.cpp b/externals/g3dlite/AABox.cpp similarity index 100% rename from dep/src/g3dlite/AABox.cpp rename to externals/g3dlite/AABox.cpp diff --git a/dep/src/g3dlite/Any.cpp b/externals/g3dlite/Any.cpp similarity index 100% rename from dep/src/g3dlite/Any.cpp rename to externals/g3dlite/Any.cpp diff --git a/dep/src/g3dlite/BinaryFormat.cpp b/externals/g3dlite/BinaryFormat.cpp similarity index 100% rename from dep/src/g3dlite/BinaryFormat.cpp rename to externals/g3dlite/BinaryFormat.cpp diff --git a/dep/src/g3dlite/BinaryInput.cpp b/externals/g3dlite/BinaryInput.cpp similarity index 100% rename from dep/src/g3dlite/BinaryInput.cpp rename to externals/g3dlite/BinaryInput.cpp diff --git a/dep/src/g3dlite/BinaryOutput.cpp b/externals/g3dlite/BinaryOutput.cpp similarity index 100% rename from dep/src/g3dlite/BinaryOutput.cpp rename to externals/g3dlite/BinaryOutput.cpp diff --git a/dep/src/g3dlite/Box.cpp b/externals/g3dlite/Box.cpp similarity index 100% rename from dep/src/g3dlite/Box.cpp rename to externals/g3dlite/Box.cpp diff --git a/externals/g3dlite/CMakeLists.txt b/externals/g3dlite/CMakeLists.txt new file mode 100644 index 00000000000..da5c89ec143 --- /dev/null +++ b/externals/g3dlite/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +file(GLOB sources *.cpp) + +set(g3dlib_STAT_SRCS + ${sources} +) +if(WIN32) + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/externals/zlib + ) +else() + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ) +endif() + +add_library(g3dlib STATIC ${g3dlib_STAT_SRCS}) + +if(WIN32) + target_link_libraries(g3dlib + zlib + ) +else() + target_link_libraries(g3dlib + ${ZLIB_LIBRARIES} + ) +endif() diff --git a/dep/src/g3dlite/Capsule.cpp b/externals/g3dlite/Capsule.cpp similarity index 100% rename from dep/src/g3dlite/Capsule.cpp rename to externals/g3dlite/Capsule.cpp diff --git a/dep/src/g3dlite/CollisionDetection.cpp b/externals/g3dlite/CollisionDetection.cpp similarity index 100% rename from dep/src/g3dlite/CollisionDetection.cpp rename to externals/g3dlite/CollisionDetection.cpp diff --git a/dep/src/g3dlite/CoordinateFrame.cpp b/externals/g3dlite/CoordinateFrame.cpp similarity index 100% rename from dep/src/g3dlite/CoordinateFrame.cpp rename to externals/g3dlite/CoordinateFrame.cpp diff --git a/dep/src/g3dlite/Crypto.cpp b/externals/g3dlite/Crypto.cpp similarity index 100% rename from dep/src/g3dlite/Crypto.cpp rename to externals/g3dlite/Crypto.cpp diff --git a/dep/src/g3dlite/Cylinder.cpp b/externals/g3dlite/Cylinder.cpp similarity index 100% rename from dep/src/g3dlite/Cylinder.cpp rename to externals/g3dlite/Cylinder.cpp diff --git a/externals/g3dlite/G3D.lib/include/G3D/AABSPTree.h b/externals/g3dlite/G3D.lib/include/G3D/AABSPTree.h deleted file mode 100644 index 1178fad93c3..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/AABSPTree.h +++ /dev/null @@ -1,1609 +0,0 @@ -/** - @file AABSPTree.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2004-01-11 - @edited 2008-11-19 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - - */ - -#ifndef G3D_KDTREE_H -#define G3D_KDTREE_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Table.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/Triangle.h" -#include "G3D/Ray.h" -#include "G3D/GCamera.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/CollisionDetection.h" -#include "G3D/GCamera.h" -#include "G3D/BoundsTrait.h" -#include - -// If defined, in debug mode the tree is checked for consistency -// as a way of detecting corruption due to implementation bugs -// #define VERIFY_TREE - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector2& v, G3D::AABox& out) { out = G3D::AABox(G3D::Vector3(v, 0)); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector3& v, G3D::AABox& out) { out = G3D::AABox(v); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector4& v, G3D::AABox& out) { out = G3D::AABox(v.xyz()); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::AABox& v, G3D::AABox& out) { out = v; } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Sphere& s, G3D::AABox& out) { s.getBounds(out); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Box& b, G3D::AABox& out) { b.getBounds(out); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector2*& v, G3D::AABox& out) { out = G3D::AABox(G3D::Vector3(*v, 0)); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector3*& v, G3D::AABox& out) { out = G3D::AABox(*v); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Vector4*& v, G3D::AABox& out) { out = G3D::AABox(v->xyz()); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::AABox*& v, G3D::AABox& out) { out = *v; } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Sphere*& s, G3D::AABox& out) { s->getBounds(out); } -}; - -template<> struct BoundsTrait { - static void getBounds(const G3D::Box*& b, G3D::AABox& out) { b->getBounds(out); } -}; - - -template<> struct BoundsTrait { - static void getBounds(const G3D::Triangle*& t, G3D::AABox& out) { t->getBounds(out); } -}; - -namespace G3D { - namespace _internal { - - /** - Wraps a pointer value so that it can be treated as the instance itself; - convenient for inserting pointers into a Table but using the - object equality instead of pointer equality. - */ - template - class Indirector { - public: - Type* handle; - - inline Indirector(Type* h) : handle(h) {} - - inline Indirector() : handle(NULL) {} - - /** Returns true iff the values referenced by the handles are equivalent. */ - inline bool operator==(const Indirector& m) const { - return *handle == *(m.handle); - } - - inline bool operator==(const Type& m) const { - return *handle == m; - } - - inline size_t hashCode() const { - return handle->hashCode(); - } - }; - } // namespace internal -} // namespace G3D - -template struct HashTrait > { - static size_t hashCode(const G3D::_internal::Indirector& key) { return key.hashCode(); } -}; - -namespace G3D { - -/** - A set that supports spatial queries using a KD tree (axis-aligned - BSP tree) for speed. - - KDTree allows you to quickly find objects in 3D that lie within - a box or along a ray. For large sets of objects it is much faster - than testing each object for a collision. - - KDTree is as powerful as but more general than a Quad Tree, Oct - Tree, or regular KD tree that cycles through axes, but less general than an unconstrained BSP tree - (which is much slower to create). - - Internally, objects - are arranged into a tree according to their - axis-aligned bounds. This increases the cost of insertion to - O(log n) but allows fast overlap queries. - - Template Parameters -
The template parameter T must be one for which - the following functions are all overloaded: - -
-  T::T(); (public constructor of no arguments)
-  template <> struct HashTrait { static size_t hashCode(int key); };
-  template<> struct BoundsTrait { static void getBounds(const T& obj, G3D::AABox& out); };
- 
- - G3D provides these for common classes like G3D::Vector3 and G3D::Sphere. - If you use a custom class, or a pointer to a custom class, you will need - to define those functions. - - Moving %Set Members -
It is important that objects do not move without updating the - KDTree. If the axis-aligned bounds of an object are about - to change, KDTree::remove it before they change and - KDTree::insert it again afterward. For objects - where the hashCode and == operator are invariant with respect - to the 3D position, - you can use the KDTree::update method as a shortcut to - insert/remove an object in one step after it has moved. - - - Note: Do not mutate any value once it has been inserted into KDTree. Values - are copied interally. All KDTree iterators convert to pointers to constant - values to reinforce this. - - If you want to mutate the objects you intend to store in a KDTree - simply insert pointers to your objects instead of the objects - themselves, and ensure that the above operations are defined. (And - actually, because values are copied, if your values are large you may - want to insert pointers anyway, to save space and make the balance - operation faster.) - - Dimensions - Although designed as a 3D-data structure, you can use the KDTree - for data distributed along 2 or 1 axes by simply returning bounds - that are always zero along one or more dimensions. - -*/ -template< class T, - class BoundsFunc = BoundsTrait, - class HashFunc = HashTrait, - class EqualsFunc = EqualsTrait > -class KDTree { -protected: -#define TreeType KDTree - - /** Wrapper for a value that includes a cache of its bounds. - Except for the test value used in a set-query operation, there - is only ever one instance of the handle associated with any - value and the memberTable and Nodes maintain pointers to that - heap-allocated value. - */ - class Handle { - public: - /** The bounds of each object are constrained to AABox::large */ - AABox bounds; - - /** Center of bounds. We cache this value to avoid recomputing it - during the median sort, and because MSVC 6 std::sort goes into - an infinite loop if we compute the midpoint on the fly (possibly - a floating point roundoff issue, where B& point, - int beginIndex, - int endIndex) { - - Vector3 lo = Vector3::inf(); - Vector3 hi = -lo; - - debugAssertM(beginIndex <= endIndex, "No points"); - for (int p = beginIndex; p <= endIndex; ++p) { - // This code is written with the vector min and max expanded - // because otherwise it compiles incorrectly with -O3 on - // gcc 3.4 - - const Vector3& pLo = point[p]->bounds.low(); - const Vector3& pHi = point[p]->bounds.high(); - for (int a = 0; a < 3; ++a) { - lo[a] = G3D::min(lo[a], pLo[a]); - hi[a] = G3D::max(hi[a], pHi[a]); - } - } - - return AABox(lo, hi); - } - - /** Compares centers */ - class CenterComparator { - public: - Vector3::Axis sortAxis; - - CenterComparator(Vector3::Axis a) : sortAxis(a) {} - - inline int operator()(Handle* A, const Handle* B) const { - float a = A->center[sortAxis]; - float b = B->center[sortAxis]; - - if (a < b) { - return 1; - } else if (a > b) { - return -1; - } else { - return 0; - } - } - }; - - - /** Compares bounds for strict >, <, or overlap*/ - class BoundsComparator { - public: - Vector3::Axis sortAxis; - - BoundsComparator(Vector3::Axis a) : sortAxis(a) {} - - inline int operator()(Handle* A, const Handle* B) const { - const AABox& a = A->bounds; - const AABox& b = B->bounds; - - if (a.high()[sortAxis] < b.low()[sortAxis]) { - return 1; - } else if (a.low()[sortAxis] > b.high()[sortAxis]) { - return -1; - } else { - return 0; - } - } - }; - - - /** Compares bounds to the sort location */ - class Comparator { - public: - Vector3::Axis sortAxis; - float sortLocation; - - Comparator(Vector3::Axis a, float l) : sortAxis(a), sortLocation(l) {} - - inline int operator()(Handle* ignore, const Handle* handle) const { - const AABox& box = handle->bounds; - debugAssert(ignore == NULL); - - if (box.high()[sortAxis] < sortLocation) { - // Box is strictly below the sort location - return -1; - } else if (box.low()[sortAxis] > sortLocation) { - // Box is strictly above the sort location - return 1; - } else { - // Box overlaps the sort location - return 0; - } - } - }; - - // Using System::malloc with this class provided no speed improvement. - class Node { - public: - - /** Spatial bounds on all values at this node and its children, based purely on - the parent's splitting planes. May be infinite. */ - AABox splitBounds; - - Vector3::Axis splitAxis; - - /** Location along the specified axis */ - float splitLocation; - - /** child[0] contains all values strictly - smaller than splitLocation along splitAxis. - - child[1] contains all values strictly - larger. - - Both may be NULL if there are not enough - values to bother recursing. - */ - Node* child[2]; - - /** Array of values at this node (i.e., values - straddling the split plane + all values if - this is a leaf node). - - This is an array of pointers because that minimizes - data movement during tree building, which accounts - for about 15% of the time cost of tree building. - */ - Array valueArray; - - /** For each object in the value array, a copy of its bounds. - Packing these into an array at the node level - instead putting them in the valueArray improves - cache coherence, which is about a 3x performance - increase when performing intersection computations. - */ - Array boundsArray; - - /** Creates node with NULL children */ - Node() { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - splitBounds = AABox(-Vector3::inf(), Vector3::inf()); - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** - Doesn't clone children. - */ - Node(const Node& other) : valueArray(other.valueArray), boundsArray(other.boundsArray) { - splitAxis = other.splitAxis; - splitLocation = other.splitLocation; - splitBounds = other.splitBounds; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** Copies the specified subarray of pt into point, NULLs the children. - Assumes a second pass will set splitBounds. */ - Node(const Array& pt) : valueArray(pt) { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - - boundsArray.resize(valueArray.size()); - for (int i = 0; i < valueArray.size(); ++i) { - boundsArray[i] = valueArray[i]->bounds; - } - } - - /** Deletes the children (but not the values) */ - ~Node() { - for (int i = 0; i < 2; ++i) { - delete child[i]; - } - } - - /** Returns true if this node is a leaf (no children) */ - inline bool isLeaf() const { - return (child[0] == NULL) && (child[1] == NULL); - } - - - /** - Recursively appends all handles and children's handles - to the array. - */ - void getHandles(Array& handleArray) const { - handleArray.append(valueArray); - for (int i = 0; i < 2; ++i) { - if (child[i] != NULL) { - child[i]->getHandles(handleArray); - } - } - } - - void verifyNode(const Vector3& lo, const Vector3& hi) { - // debugPrintf("Verifying: split %d @ %f [%f, %f, %f], [%f, %f, %f]\n", - // splitAxis, splitLocation, lo.x, lo.y, lo.z, hi.x, hi.y, hi.z); - - debugAssertM(lo == splitBounds.low(), - format("lo = %s, splitBounds.lo = %s", - lo.toString().c_str(), splitBounds.low().toString().c_str())); - debugAssert(hi == splitBounds.high()); - - for (int i = 0; i < valueArray.length(); ++i) { - const AABox& b = valueArray[i]->bounds; - debugAssert(b == boundsArray[i]); - - for(int axis = 0; axis < 3; ++axis) { - debugAssert(b.low()[axis] <= b.high()[axis]); - debugAssert(b.low()[axis] >= lo[axis]); - debugAssert(b.high()[axis] <= hi[axis]); - } - } - - if (child[0] || child[1]) { - debugAssert(lo[splitAxis] < splitLocation); - debugAssert(hi[splitAxis] > splitLocation); - } - - Vector3 newLo = lo; - newLo[splitAxis] = splitLocation; - Vector3 newHi = hi; - newHi[splitAxis] = splitLocation; - - if (child[0] != NULL) { - child[0]->verifyNode(lo, newHi); - } - - if (child[1] != NULL) { - child[1]->verifyNode(newLo, hi); - } - } - - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - static void serializeStructure(const Node* n, BinaryOutput& bo) { - if (n == NULL) { - bo.writeUInt8(0); - } else { - bo.writeUInt8(1); - n->splitBounds.serialize(bo); - serialize(n->splitAxis, bo); - bo.writeFloat32(n->splitLocation); - for (int c = 0; c < 2; ++c) { - serializeStructure(n->child[c], bo); - } - } - } - - /** Clears the member table */ - static Node* deserializeStructure(BinaryInput& bi) { - if (bi.readUInt8() == 0) { - return NULL; - } else { - Node* n = new Node(); - n->splitBounds.deserialize(bi); - deserialize(n->splitAxis, bi); - n->splitLocation = bi.readFloat32(); - for (int c = 0; c < 2; ++c) { - n->child[c] = deserializeStructure(bi); - } - return n; - } - } - - /** Returns the deepest node that completely contains bounds. */ - Node* findDeepestContainingNode(const AABox& bounds) { - - // See which side of the splitting plane the bounds are on - if (bounds.high()[splitAxis] < splitLocation) { - // Bounds are on the low side. Recurse into the child - // if it exists. - if (child[0] != NULL) { - return child[0]->findDeepestContainingNode(bounds); - } - } else if (bounds.low()[splitAxis] > splitLocation) { - // Bounds are on the high side, recurse into the child - // if it exists. - if (child[1] != NULL) { - return child[1]->findDeepestContainingNode(bounds); - } - } - - // There was no containing child, so this node is the - // deepest containing node. - return this; - } - - - /** Appends all members that intersect the box. - If useSphere is true, members that pass the box test - face a second test against the sphere. */ - void getIntersectingMembers( - const AABox& box, - const Sphere& sphere, - Array& members, - bool useSphere) const { - - // Test all values at this node - for (int v = 0; v < boundsArray.size(); ++v) { - const AABox& bounds = boundsArray[v]; - if (bounds.intersects(box) && - (! useSphere || bounds.intersects(sphere))) { - members.append(valueArray[v]->value); - } - } - - // If the left child overlaps the box, recurse into it - if ((child[0] != NULL) && (box.low()[splitAxis] < splitLocation)) { - child[0]->getIntersectingMembers(box, sphere, members, useSphere); - } - - // If the right child overlaps the box, recurse into it - if ((child[1] != NULL) && (box.high()[splitAxis] > splitLocation)) { - child[1]->getIntersectingMembers(box, sphere, members, useSphere); - } - } - - /** - Recurse through the tree, assigning splitBounds fields. - */ - void assignSplitBounds(const AABox& myBounds) { - splitBounds = myBounds; - - AABox childBounds[2]; - myBounds.split(splitAxis, splitLocation, childBounds[0], childBounds[1]); - -# if defined(G3D_DEBUG) && defined(VERIFY_TREE) - // Verify the split - for (int v = 0; v < boundsArray.size(); ++v) { - const AABox& bounds = boundsArray[v]; - debugAssert(myBounds.contains(bounds)); - } -# endif - - for (int c = 0; c < 2; ++c) { - if (child[c]) { - child[c]->assignSplitBounds(childBounds[c]); - } - } - } - - /** Returns true if the ray intersects this node */ - bool intersects(const Ray& ray, float distance) const { - // See if the ray will ever hit this node or its children - Vector3 location; - bool alreadyInsideBounds = false; - bool rayWillHitBounds = - CollisionDetection::collisionLocationForMovingPointFixedAABox( - ray.origin, ray.direction, splitBounds, location, alreadyInsideBounds); - - bool canHitThisNode = (alreadyInsideBounds || - (rayWillHitBounds && ((location - ray.origin).squaredLength() < square(distance)))); - - return canHitThisNode; - } - - template - void intersectRay( - const Ray& ray, - RayCallback& intersectCallback, - float& distance, - bool intersectCallbackIsFast) const { - - if (! intersects(ray, distance)) { - // The ray doesn't hit this node, so it can't hit the children of the node. - return; - } - - // Test for intersection against every object at this node. - for (int v = 0; v < valueArray.size(); ++v) { - bool canHitThisObject = true; - - if (! intersectCallbackIsFast) { - // See if - Vector3 location; - const AABox& bounds = boundsArray[v]; - bool alreadyInsideBounds = false; - bool rayWillHitBounds = - CollisionDetection::collisionLocationForMovingPointFixedAABox( - ray.origin, ray.direction, bounds, location, alreadyInsideBounds); - - canHitThisObject = (alreadyInsideBounds || - (rayWillHitBounds && ((location - ray.origin).squaredLength() < square(distance)))); - } - - if (canHitThisObject) { - // It is possible that this ray hits this object. Look for the intersection using the - // callback. - const T& value = valueArray[v]->value; - intersectCallback(ray, value, distance); - } - } - - // There are three cases to consider next: - // - // 1. the ray can start on one side of the splitting plane and never enter the other, - // 2. the ray can start on one side and enter the other, and - // 3. the ray can travel exactly down the splitting plane - - enum {NONE = -1}; - int firstChild = NONE; - int secondChild = NONE; - - if (ray.origin[splitAxis] < splitLocation) { - - // The ray starts on the small side - firstChild = 0; - - if (ray.direction[splitAxis] > 0) { - // The ray will eventually reach the other side - secondChild = 1; - } - - } else if (ray.origin[splitAxis] > splitLocation) { - - // The ray starts on the large side - firstChild = 1; - - if (ray.direction[splitAxis] < 0) { - secondChild = 0; - } - } else { - // The ray starts on the splitting plane - if (ray.direction[splitAxis] < 0) { - // ...and goes to the small side - firstChild = 0; - } else if (ray.direction[splitAxis] > 0) { - // ...and goes to the large side - firstChild = 1; - } - } - - // Test on the side closer to the ray origin. - if ((firstChild != NONE) && child[firstChild]) { - child[firstChild]->intersectRay(ray, intersectCallback, distance, intersectCallbackIsFast); - } - - if (ray.direction[splitAxis] != 0) { - // See if there was an intersection before hitting the splitting plane. - // If so, there is no need to look on the far side and recursion terminates. - float distanceToSplittingPlane = (splitLocation - ray.origin[splitAxis]) / ray.direction[splitAxis]; - if (distanceToSplittingPlane > distance) { - // We aren't going to hit anything else before hitting the splitting plane, - // so don't bother looking on the far side of the splitting plane at the other - // child. - return; - } - } - - // Test on the side farther from the ray origin. - if ((secondChild != NONE) && child[secondChild]) { - child[secondChild]->intersectRay(ray, intersectCallback, distance, intersectCallbackIsFast); - } - - } - }; - - - /** - Recursively subdivides the subarray. - - Clears the source array as soon as it is no longer needed. - - Call assignSplitBounds() on the root node after making a tree. - */ - Node* makeNode( - Array& source, - int valuesPerNode, - int numMeanSplits, - Array& temp) { - - Node* node = NULL; - - if (source.size() <= valuesPerNode) { - // Make a new leaf node - node = new Node(source); - - // Set the pointers in the memberTable - for (int i = 0; i < source.size(); ++i) { - memberTable.set(Member(source[i]), node); - } - source.clear(); - - } else { - // Make a new internal node - node = new Node(); - - const AABox& bounds = computeBounds(source, 0, source.size() - 1); - const Vector3& extent = bounds.high() - bounds.low(); - - Vector3::Axis splitAxis = extent.primaryAxis(); - - float splitLocation; - - // Arrays for holding the children - Array lt, gt; - - if (numMeanSplits <= 0) { - - source.medianPartition(lt, node->valueArray, gt, temp, CenterComparator(splitAxis)); - - // Choose the split location to be the center of whatever fell in the center - splitLocation = node->valueArray[0]->center[splitAxis]; - - // Some of the elements in the lt or gt array might really overlap the split location. - // Move them as needed. - for (int i = 0; i < lt.size(); ++i) { - const AABox& bounds = lt[i]->bounds; - if ((bounds.low()[splitAxis] <= splitLocation) && (bounds.high()[splitAxis] >= splitLocation)) { - node->valueArray.append(lt[i]); - // Remove this element and process the new one that - // is swapped in in its place. - lt.fastRemove(i); --i; - } - } - - for (int i = 0; i < gt.size(); ++i) { - const AABox& bounds = gt[i]->bounds; - if ((bounds.low()[splitAxis] <= splitLocation) && (bounds.high()[splitAxis] >= splitLocation)) { - node->valueArray.append(gt[i]); - // Remove this element and process the new one that - // is swapped in in its place. - gt.fastRemove(i); --i; - } - } - - if ((node->valueArray.size() > (source.size() / 2)) && - (source.size() > 6)) { - // This was a bad partition; we ended up putting the splitting plane right in the middle of most of the - // objects. We could try to split on a different axis, or use a different partition (e.g., the extents mean, - // or geometric mean). This implementation falls back on the extents mean, since that case is already handled - // below. - numMeanSplits = 1; - } - } - - // Note: numMeanSplits may have been increased by the code in the previous case above in order to - // force a re-partition. - - if (numMeanSplits > 0) { - // Split along the mean - splitLocation = - bounds.high()[splitAxis] * 0.5f + - bounds.low()[splitAxis] * 0.5f; - - debugAssertM(isFinite(splitLocation), - "Internal error: split location must be finite."); - - source.partition(NULL, lt, node->valueArray, gt, Comparator(splitAxis, splitLocation)); - - // The Comparator ensures that elements are strictly on the correct side of the split - } - - -# if defined(G3D_DEBUG) && defined(VERIFY_TREE) - debugAssert(lt.size() + node->valueArray.size() + gt.size() == source.size()); - // Verify that all objects ended up on the correct side of the split. - // (i.e., make sure that the Array partition was correct) - for (int i = 0; i < lt.size(); ++i) { - const AABox& bounds = lt[i]->bounds; - debugAssert(bounds.high()[splitAxis] < splitLocation); - } - - for (int i = 0; i < gt.size(); ++i) { - const AABox& bounds = gt[i]->bounds; - debugAssert(bounds.low()[splitAxis] > splitLocation); - } - - for (int i = 0; i < node->valueArray.size(); ++i) { - const AABox& bounds = node->valueArray[i]->bounds; - debugAssert(bounds.high()[splitAxis] >= splitLocation); - debugAssert(bounds.low()[splitAxis] <= splitLocation); - } -# endif - - // The source array is no longer needed - source.clear(); - - node->splitAxis = splitAxis; - node->splitLocation = splitLocation; - - // Update the bounds array and member table - node->boundsArray.resize(node->valueArray.size()); - for (int i = 0; i < node->valueArray.size(); ++i) { - Handle* v = node->valueArray[i]; - node->boundsArray[i] = v->bounds; - memberTable.set(Member(v), node); - } - - if (lt.size() > 0) { - node->child[0] = makeNode(lt, valuesPerNode, numMeanSplits - 1, temp); - } - - if (gt.size() > 0) { - node->child[1] = makeNode(gt, valuesPerNode, numMeanSplits - 1, temp); - } - - } - - return node; - } - - /** - Recursively clone the passed in node tree, setting - pointers for members in the memberTable as appropriate. - called by the assignment operator. - */ - Node* cloneTree(Node* src) { - Node* dst = new Node(*src); - - // Make back pointers - for (int i = 0; i < dst->valueArray.size(); ++i) { - memberTable.set(Member(dst->valueArray[i]), dst); - } - - // Clone children - for (int i = 0; i < 2; ++i) { - if (src->child[i] != NULL) { - dst->child[i] = cloneTree(src->child[i]); - } - } - - return dst; - } - - /** - Wrapper for a Handle; used to create a memberTable that acts like Table but - stores only Handle* internally to avoid memory copies. - */ - typedef _internal::Indirector Member; - - typedef Table MemberTable; - - /** Maps members to the node containing them */ - MemberTable memberTable; - - Node* root; - -public: - - /** To construct a balanced tree, insert the elements and then call - KDTree::balance(). */ - KDTree() : root(NULL) {} - - - KDTree(const KDTree& src) : root(NULL) { - *this = src; - } - - - KDTree& operator=(const KDTree& src) { - delete root; - // Clone tree takes care of filling out the memberTable. - root = cloneTree(src.root); - return *this; - } - - - ~KDTree() { - clear(); - } - - /** - Throws out all elements of the set. - */ - void clear() { - typedef typename Table<_internal::Indirector, Node*>::Iterator It; - - // Delete all handles stored in the member table - It cur = memberTable.begin(); - It end = memberTable.end(); - while (cur != end) { - delete cur->key.handle; - cur->key.handle = NULL; - ++cur; - } - memberTable.clear(); - - // Delete the tree structure itself - delete root; - root = NULL; - } - - int size() const { - return memberTable.size(); - } - - /** - Inserts an object into the set if it is not - already present. O(log n) time. Does not - cause the tree to be balanced. - */ - void insert(const T& value) { - if (contains(value)) { - // Already in the set - return; - } - - Handle* h = new Handle(value); - - if (root == NULL) { - // This is the first node; create a root node - root = new Node(); - } - - Node* node = root->findDeepestContainingNode(h->bounds); - - // Insert into the node - node->valueArray.append(h); - node->boundsArray.append(h->bounds); - - // Insert into the node table - Member m(h); - memberTable.set(m, node); - } - - /** Inserts each elements in the array in turn. If the tree - begins empty (no structure and no elements), this is faster - than inserting each element in turn. You still need to balance - the tree at the end.*/ - void insert(const Array& valueArray) { - if (root == NULL) { - // Optimized case for an empty tree; don't bother - // searching or reallocating the root node's valueArray - // as we incrementally insert. - root = new Node(); - root->valueArray.resize(valueArray.size()); - root->boundsArray.resize(root->valueArray.size()); - for (int i = 0; i < valueArray.size(); ++i) { - // Insert in opposite order so that we have the exact same - // data structure as if we inserted each (i.e., order is reversed - // from array). - Handle* h = new Handle(valueArray[i]); - int j = valueArray.size() - i - 1; - root->valueArray[j] = h; - root->boundsArray[j] = h->bounds; - memberTable.set(Member(h), root); - } - - } else { - // Insert at appropriate tree depth. - for (int i = 0; i < valueArray.size(); ++i) { - insert(valueArray[i]); - } - } - } - - - /** - Returns true if this object is in the set, otherwise - returns false. O(1) time. - */ - bool contains(const T& value) { - // Temporarily create a handle and member - Handle h(value); - return memberTable.containsKey(Member(&h)); - } - - - /** - Removes an object from the set in O(1) time. - It is an error to remove members that are not already - present. May unbalance the tree. - - Removing an element never causes a node (split plane) to be removed... - nodes are only changed when the tree is rebalanced. This behavior - is desirable because it allows the split planes to be serialized, - and then deserialized into an empty tree which can be repopulated. - */ - void remove(const T& value) { - debugAssertM(contains(value), - "Tried to remove an element from a " - "KDTree that was not present"); - - // Get the list of elements at the node - Handle h(value); - Member m(&h); - - Array& list = memberTable[m]->valueArray; - - Handle* ptr = NULL; - - // Find the element and remove it - for (int i = list.length() - 1; i >= 0; --i) { - if (list[i]->value == value) { - // This was the element. Grab the pointer so that - // we can delete it below - ptr = list[i]; - - // Remove the handle from the node - list.fastRemove(i); - - // Remove the corresponding bounds - memberTable[m]->boundsArray.fastRemove(i); - break; - } - } - - // Remove the member - memberTable.remove(m); - - // Delete the handle data structure - delete ptr; - ptr = NULL; - } - - - /** - If the element is in the set, it is removed. - The element is then inserted. - - This is useful when the == and hashCode methods - on T are independent of the bounds. In - that case, you may call update(v) to insert an - element for the first time and call update(v) - again every time it moves to keep the tree - up to date. - */ - void update(const T& value) { - if (contains(value)) { - remove(value); - } - insert(value); - } - - - /** - Rebalances the tree (slow). Call when objects - have moved substantially from their original positions - (which unbalances the tree and causes the spatial - queries to be slow). - - @param valuesPerNode Maximum number of elements to put at - a node. - - @param numMeanSplits numMeanSplits = 0 gives a - fully axis aligned BSP-tree, where the balance operation attempts to balance - the tree so that every splitting plane has an equal number of left - and right children (i.e. it is a median split along that axis). - This tends to maximize average performance. - - You can override this behavior by - setting a number of mean (average) splits. numMeanSplits = MAX_INT - creates a full oct-tree, which tends to optimize peak performance at the expense of - average performance. It tends to have better clustering behavior when - members are not uniformly distributed. - */ - void balance(int valuesPerNode = 5, int numMeanSplits = 3) { - if (root == NULL) { - // Tree is empty - return; - } - - // Get all handles and delete the old tree structure - Node* oldRoot = root; - for (int c = 0; c < 2; ++c) { - if (root->child[c] != NULL) { - root->child[c]->getHandles(root->valueArray); - - // Delete the child; this will delete all structure below it - delete root->child[c]; - root->child[c] = NULL; - } - } - - Array temp; - // Make a new root. Work with a copy of the value array because - // makeNode clears the source array as it progresses - Array copy(oldRoot->valueArray); - root = makeNode(copy, valuesPerNode, numMeanSplits, temp); - - // Throw away the old root node - delete oldRoot; - oldRoot = NULL; - - // Walk the tree, assigning splitBounds. We start with unbounded - // space. This will override the current member table. - const AABox& LARGE = AABox::large(); - root->assignSplitBounds(LARGE); - -# ifdef _DEBUG - { - // Ensure that the balanced tree is still correct - root->verifyNode(LARGE.low(), LARGE.high()); - } -# endif - } - -protected: - - /** - @param parentMask The mask that this node returned from culledBy. - */ - static void getIntersectingMembers( - const Array& plane, - Array& members, - Node* node, - uint32 parentMask) { - - int dummy; - - if (parentMask == 0) { - // None of these planes can cull anything - for (int v = node->valueArray.size() - 1; v >= 0; --v) { - members.append(node->valueArray[v]->value); - } - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c]) { - getIntersectingMembers(plane, members, node->child[c], 0); - } - } - } else { - - // Test values at this node against remaining planes - for (int v = node->boundsArray.size() - 1; v >= 0; --v) { - if (! node->boundsArray[v].culledBy(plane, dummy, parentMask)) { - members.append(node->valueArray[v]->value); - } - } - - uint32 childMask = 0xFFFFFF; - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c] && - ! node->child[c]->splitBounds.culledBy(plane, dummy, parentMask, childMask)) { - // This node was not culled - getIntersectingMembers(plane, members, node->child[c], childMask); - } - } - } - } - -public: - - /** - Returns all members inside the set of planes. - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Array& plane, Array& members) const { - if (root == NULL) { - return; - } - - getIntersectingMembers(plane, members, root, 0xFFFFFF); - } - - /** - Typically used to find all visible - objects inside the view frustum (see also GCamera::getClipPlanes)... i.e. all objects - not culled by frustum. - - Example: -
-        Array  visible;
-        tree.getIntersectingMembers(camera.frustum(), visible);
-        // ... Draw all objects in the visible array.
-      
- @param members The results are appended to this array. - */ - void getIntersectingMembers(const GCamera::Frustum& frustum, Array& members) const { - Array plane; - - for (int i = 0; i < frustum.faceArray.size(); ++i) { - plane.append(frustum.faceArray[i].plane); - } - - getIntersectingMembers(plane, members); - } - - /** - C++ STL style iterator variable. See beginBoxIntersection(). - The iterator overloads the -> (dereference) operator, so this - acts like a pointer to the current member. - */ - // This iterator turns Node::getIntersectingMembers into a - // coroutine. It first translates that method from recursive to - // stack based, then captures the system state (analogous to a Scheme - // continuation) after each element is appended to the member array, - // and allowing the computation to be restarted. - class BoxIntersectionIterator { - private: - friend class TreeType; - - /** True if this is the "end" iterator instance */ - bool isEnd; - - /** The box that we're testing against. */ - AABox box; - - /** Node that we're currently looking at. Undefined if isEnd - is true. */ - Node* node; - - /** Nodes waiting to be processed */ - // We could use backpointers within the tree and careful - // state management to avoid ever storing the stack-- but - // it is much easier this way and only inefficient if the - // caller uses post increment (which they shouldn't!). - Array stack; - - /** The next index of current->valueArray to return. - Undefined when isEnd is true.*/ - int nextValueArrayIndex; - - BoxIntersectionIterator() : isEnd(true) {} - - BoxIntersectionIterator(const AABox& b, const Node* root) : - isEnd(root == NULL), box(b), - node(const_cast(root)), nextValueArrayIndex(-1) { - - // We intentionally start at the "-1" index of the current - // node so we can use the preincrement operator to move - // ourselves to element 0 instead of repeating all of the - // code from the preincrement method. Note that this might - // cause us to become the "end" instance. - ++(*this); - } - - public: - - inline bool operator!=(const BoxIntersectionIterator& other) const { - return ! (*this == other); - } - - bool operator==(const BoxIntersectionIterator& other) const { - if (isEnd) { - return other.isEnd; - } else if (other.isEnd) { - return false; - } else { - // Two non-end iterators; see if they match. This is kind of - // silly; users shouldn't call == on iterators in general unless - // one of them is the end iterator. - if ((box != other.box) || (node != other.node) || - (nextValueArrayIndex != other.nextValueArrayIndex) || - (stack.length() != other.stack.length())) { - return false; - } - - // See if the stacks are the same - for (int i = 0; i < stack.length(); ++i) { - if (stack[i] != other.stack[i]) { - return false; - } - } - - // We failed to find a difference; they must be the same - return true; - } - } - - /** - Pre increment. - */ - BoxIntersectionIterator& operator++() { - ++nextValueArrayIndex; - - bool foundIntersection = false; - while (! isEnd && ! foundIntersection) { - - // Search for the next node if we've exhausted this one - while ((! isEnd) && (nextValueArrayIndex >= node->valueArray.length())) { - // If we entered this loop, then the iterator has exhausted the elements at - // node (possibly because it just switched to a child node with no members). - // This loop continues until it finds a node with members or reaches - // the end of the whole intersection search. - - // If the right child overlaps the box, push it onto the stack for - // processing. - if ((node->child[1] != NULL) && - (box.high()[node->splitAxis] > node->splitLocation)) { - stack.push(node->child[1]); - } - - // If the left child overlaps the box, push it onto the stack for - // processing. - if ((node->child[0] != NULL) && - (box.low()[node->splitAxis] < node->splitLocation)) { - stack.push(node->child[0]); - } - - if (stack.length() > 0) { - // Go on to the next node (which may be either one of the ones we - // just pushed, or one from farther back the tree). - node = stack.pop(); - nextValueArrayIndex = 0; - } else { - // That was the last node; we're done iterating - isEnd = true; - } - } - - // Search for the next intersection at this node until we run out of children - while (! isEnd && ! foundIntersection && (nextValueArrayIndex < node->valueArray.length())) { - if (box.intersects(node->boundsArray[nextValueArrayIndex])) { - foundIntersection = true; - } else { - ++nextValueArrayIndex; - // If we exhaust this node, we'll loop around the master loop - // to find a new node. - } - } - } - - return *this; - } - - private: - /** - Post increment (much slower than preincrement!). Intentionally overloaded to preclude accidentally slow code. - */ - BoxIntersectionIterator operator++(int); - /*{ - BoxIntersectionIterator old = *this; - ++this; - return old; - }*/ - - public: - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - const T& operator*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return node->valueArray[nextValueArrayIndex]->value; - } - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - T const * operator->() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex]->value); - } - - /** Overloaded cast operator so the iterator can masquerade as a pointer - to a member */ - operator T*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex]->value); - } - }; - - - /** - Iterates through the members that intersect the box - */ - BoxIntersectionIterator beginBoxIntersection(const AABox& box) const { - return BoxIntersectionIterator(box, root); - } - - BoxIntersectionIterator endBoxIntersection() const { - // The "end" iterator instance - return BoxIntersectionIterator(); - } - - /** - Appends all members whose bounds intersect the box. - See also KDTree::beginBoxIntersection. - */ - void getIntersectingMembers(const AABox& box, Array& members) const { - if (root == NULL) { - return; - } - root->getIntersectingMembers(box, Sphere(Vector3::zero(), 0), members, false); - } - - - /** - Invoke a callback for every member along a ray until the closest intersection is found. - - @param callback either a function or an instance of a class with an overloaded operator() of the form: - - void callback(const Ray& ray, const T& object, float& distance). If the ray hits the object - before travelling distance distance, updates distance with the new distance to - the intersection, otherwise leaves it unmodified. A common example is: - -
-            class Entity {
-            public:
-
-                void intersect(const Ray& ray, float& maxDist, Vector3& outLocation, Vector3& outNormal) {
-                    float d = maxDist;
-
-                    // ... search for intersection distance d
-
-                    if ((d > 0) && (d < maxDist)) {
-                        // Intersection occured
-                        maxDist = d;
-                        outLocation = ...;
-                        outNormal = ...;
-                    }
-                }
-            };
-
-            // Finds the surface normal and location of the first intersection with the scene
-            class Intersection {
-            public:
-                Entity*     closestEntity;
-                Vector3     hitLocation;
-                Vector3     hitNormal;
-
-                void operator()(const Ray& ray, const Entity* entity, float& distance) {
-                    entity->intersect(ray, distance, hitLocation, hitNormal);
-                }
-            };
-
-            KDTree scene;
-
-            Intersection intersection;
-            float distance = inf();
-            scene.intersectRay(camera.worldRay(x, y), intersection, distance);
-          
- - - @param distance When the method is invoked, this is the maximum distance that the tree should search for an intersection. - On return, this is set to the distance to the first intersection encountered. - - @param intersectCallbackIsFast If false, each object's bounds are tested before the intersectCallback is invoked. - If the intersect callback runs at the same speed or faster than AABox-ray intersection, set this to true. - */ - template - void intersectRay( - const Ray& ray, - RayCallback& intersectCallback, - float& distance, - bool intersectCallbackIsFast = false) const { - - root->intersectRay(ray, intersectCallback, distance, intersectCallbackIsFast); - - } - - - /** - @brief Finds all members whose bounding boxes intersect the sphere. The actual - elements may not intersect the sphere. - - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Sphere& sphere, Array& members) const { - if (root == NULL) { - return; - } - - AABox box; - sphere.getBounds(box); - root->getIntersectingMembers(box, sphere, members, true); - - } - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - void serializeStructure(BinaryOutput& bo) const { - Node::serializeStructure(root, bo); - } - - /** Clears the member table */ - void deserializeStructure(BinaryInput& bi) { - clear(); - root = Node::deserializeStructure(bi); - } - - /** - Returns an array of all members of the set. See also KDTree::begin. - */ - void getMembers(Array& members) const { - Array temp; - memberTable.getKeys(temp); - for (int i = 0; i < temp.size(); ++i) { - members.append(*(temp.handle)); - } - } - - - /** - C++ STL style iterator variable. See begin(). - Overloads the -> (dereference) operator, so this acts like a pointer - to the current member. - */ - class Iterator { - private: - friend class TreeType; - - // Note: this is a Table iterator, we are currently defining - // Set iterator - typename Table::Iterator it; - - Iterator(const typename Table::Iterator& it) : it(it) {} - - public: - - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - return it == other.it; - } - - /** - Pre increment. - */ - Iterator& operator++() { - ++it; - return *this; - } - - private: - /** - Post increment (slower than preincrement). Intentionally unimplemented to prevent slow code. - */ - Iterator operator++(int);/* { - Iterator old = *this; - ++(*this); - return old; - }*/ - public: - - const T& operator*() const { - return it->key.handle->value; - } - - T* operator->() const { - return &(it->key.handle->value); - } - - operator T*() const { - return &(it->key.handle->value); - } - }; - - - /** - C++ STL style iterator method. Returns the first member. - Use preincrement (++entry) to get to the next element (iteration - order is arbitrary). - Do not modify the set while iterating. - */ - Iterator begin() const { - return Iterator(memberTable.begin()); - } - - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - Iterator end() const { - return Iterator(memberTable.end()); - } -#undef TreeType -}; - -/** @deprecated For backwards compatibility */ -#define AABSPTree KDTree - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/AABox.h b/externals/g3dlite/G3D.lib/include/G3D/AABox.h deleted file mode 100644 index 76c5d6d5195..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/AABox.h +++ /dev/null @@ -1,281 +0,0 @@ -/** - @file AABox.h - - Axis-aligned box class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2004-01-10 - @edited 2006-02-10 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_AABOX_H -#define G3D_AABOX_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/debug.h" -#include "G3D/Array.h" -#include "G3D/Plane.h" - -namespace G3D { - -/** - An axis-aligned box. - */ -class AABox { -private: - - /** Optional argument placeholder */ - static int dummy; - - Vector3 lo; - Vector3 hi; - -public: - - /** Does not initialize the fields */ - inline AABox() {} - - /** - Constructs a zero-area AABox at v. - */ - inline explicit AABox(const Vector3& v) { - lo = hi = v; - } - - /** Assumes that low is less than or equal to high along each dimension. - To have this automatically enforced, use - AABox(low.min(high), low.max(high)); - */ - inline AABox(const Vector3& low, const Vector3& high) { - set(low, high); - } - - /** Assumes that low is less than or equal to high along each dimension. - */ - inline void set(const Vector3& low, const Vector3& high) { - debugAssert( - (low.x <= high.x) && - (low.y <= high.y) && - (low.z <= high.z)); - lo = low; - hi = high; - } - - /** - Grows to include the bounds of a - */ - inline void merge(const AABox& a) { - lo = lo.min(a.lo); - hi = hi.max(a.hi); - } - - inline void merge(const Vector3& a) { - lo = lo.min(a); - hi = hi.max(a); - } - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - inline const Vector3& low() const { - return lo; - } - - inline const Vector3& high() const { - return hi; - } - - /** - The largest possible finite box. - */ - static inline const AABox& maxFinite() { - static const AABox b = AABox(Vector3::minFinite(), - Vector3::maxFinite()); - return b; - } - - /** A large finite box. This is smaller than FLT_MAX - because it leaves room to add boxes together. */ - static inline const AABox& large() { - static const AABox b = AABox(Vector3::minFinite() * 0.5f, - Vector3::maxFinite() * 0.5f); - return b; - } - - static inline const AABox& inf() { - static const AABox b = AABox(-Vector3::inf(), Vector3::inf()); - return b; - } - - static inline const AABox& zero() { - static const AABox b = AABox(Vector3::zero(), Vector3::zero()); - return b; - } - - /** - Returns the centroid of the box. - */ - inline Vector3 center() const { - return (lo + hi) * 0.5; - } - - Vector3 corner(int index) const; - - /** - Distance from corner(0) to the next corner along axis a. - */ - inline float extent(int a) const { - debugAssert(a < 3); - return hi[a] - lo[a]; - } - - - inline Vector3 extent() const { - return hi - lo; - } - - - /** - Splits the box into two AABoxes along the specified axis. low contains - the part that was closer to negative infinity along axis, high contains - the other part. Either may have zero volume. - */ - void split(const Vector3::Axis& axis, float location, AABox& low, AABox& high) const; - - /** - Conservative culling test for up to 32 planes. - Returns true if there exists a plane[p] for - which the entire object is in the negative half space - (opposite the plane normal). - - testMask and childMask - are used for optimizing bounding volume hierarchies. - The version of this method that produces childMask - is slower than the version without; it should only - be used for parent nodes. - - @param cullingPlaneIndex The index of the first plane for which - the entire object is in the negative half-space. The function - exits early when one plane is found. -1 when the function - returns false (i.e. when no plane culls the whole object). - - @param testMask If bit p is 0, the - bounding volume automatically passes the culling test for - plane[p] (i.e. it is known that the volume - is entirely within the positive half space). The function - must return false if testMask is 0 and test all planes - when testMask is -1 (0xFFFFFFFF). - - @param childMask Test mask for the children of this volume. - - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - Conservative culling test that does not produce a mask for children. - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = 0xFFFFFFFF) const; - - /** less than or equal to containment */ - inline bool contains(const AABox& other) const { - return - (other.hi.x <= hi.x) && - (other.hi.y <= hi.y) && - (other.hi.z <= hi.z) && - (other.lo.x >= lo.x) && - (other.lo.y >= lo.y) && - (other.lo.z >= lo.z); - } - - inline bool contains( - const Vector3& point) const { - return - (point.x >= lo.x) && - (point.y >= lo.y) && - (point.z >= lo.z) && - (point.x <= hi.x) && - (point.y <= hi.y) && - (point.z <= hi.z); - } - - inline float area() const { - Vector3 diag = hi - lo; - return 2.0f * (diag.x * diag.y + diag.y * diag.z + diag.x * diag.z); - } - - inline float volume() const { - Vector3 diag = hi - lo; - return diag.x * diag.y * diag.z; - } - - Vector3 randomInteriorPoint() const; - - Vector3 randomSurfacePoint() const; - - /** Returns true if there is any overlap */ - bool intersects(const AABox& other) const; - - /** Returns true if there is any overlap. - @cite Jim Arvo's algorithm from Graphics Gems II*/ - bool intersects(const class Sphere& other) const; - - /** Return the intersection of the two boxes */ - AABox intersect(const AABox& other) const { - Vector3 H = hi.min(other.hi); - Vector3 L = lo.max(other.lo).min(H); - return AABox(L, H); - } - - inline size_t hashCode() const { - return lo.hashCode() + hi.hashCode(); - } - - inline bool operator==(const AABox& b) const { - return (lo == b.lo) && (hi == b.hi); - } - - inline bool operator!=(const AABox& b) const { - return !((lo == b.lo) && (hi == b.hi)); - } - - inline AABox operator+(const Vector3& v) const { - AABox out; - out.lo = lo + v; - out.hi = hi + v; - return out; - } - - inline AABox operator-(const Vector3& v) const { - AABox out; - out.lo = lo - v; - out.hi = hi - v; - return out; - } - - void getBounds(AABox& out) const { - out = *this; - } -}; - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::AABox& key) { return key.hashCode(); } -}; - - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/AnyVal.h b/externals/g3dlite/G3D.lib/include/G3D/AnyVal.h deleted file mode 100644 index 8254dd73c93..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/AnyVal.h +++ /dev/null @@ -1,506 +0,0 @@ -/** - @file AnyVal.h - @author Morgan McGuire - @created 2006-06-11 - @edited 2008-07-14 - */ - -#ifndef G3D_ANYVAL_H -#define G3D_ANYVAL_H - -#include "G3D/platform.h" -#include -#include "G3D/Array.h" -#include "G3D/TextInput.h" - -namespace G3D { -// Forward declarations for G3D types -class Vector2; -class Vector3; -class Vector4; -class Color1; -class Color3; -class Color4; -class Quat; -class Matrix2; -class Matrix3; -class Matrix4; -class CoordinateFrame; -class TextInput; -class TextOutput; -class BinaryInput; -class BinaryOutput; -class Rect2D; -class AABox; - -/** - A generic value, useful for defining property trees that can - be loaded from and saved to disk. The values are intentionally - restricted to a small set. - - When written to files, the syntax is as follows. Note that you can - nest arrays and tables in order to create full tree (i.e., XML-like) - structures as configuration files: - - - - - - - - - - - - - - - - - - - - - - - -
NULLNil
doubleThe number in printf double format
booltrue or false
std::stringThe string in double-quotes (")
Rect2DR(x0,y0,x1,y1)
Color1C1(value)
Color3C3(r,g,b)
Color4C4(r,g,b,a)
Vector2V2(x,y)
Vector3V3(x,y,z)
Vector4V4(x,y,z,w)
QuatV(x,y,z,w)
AABoxAAB(low Vector3, high Vector3)
Matrix2M2(r0c0, r0c1, -
   
r1c0, r1c1)
Matrix3M3(r0c0, r0c1, r0c2, -
   
r1c0, r1c1, r1c2, -
   
r2c0, r2c1, r2c2)
Matrix4M4(r0c0, r0c1, r0c2, r0c3, -
   
r1c0, r1c1, r1c2, r1c3, -
   
r2c0, r2c1, r2c2, r2c3, -
   
r3c0, r3c1, r3c2, r3c3)
CoordinateFrameCF(r0c0, r0c1, r0c2, r0c3, -
   
r1c0, r1c1, r1c2, r1c3, -
   
r2c0, r2c1, r2c2, r2c3)
CoordinateFrameCF(V3(x, y, z), yaw deg, pitch deg, optional roll deg)
Array[element0, element1, ... , elementn-1]
Table{symbol0 = value0 -
 symbol1 = value1 -
 ... -
 symboln-1 = valuen-1}
- - See also boost::any for a more general purpose but slightly harder to use - "any" for C++. - - The semantics of operator[] and the get() methods are slightly different; - operator[] acts more like a scripting language that automatically extends - arrays and tables instead of generating errors. get() has more strict semantics, - like a C++ class. - - AnyVal uses copy-on-mutate, so that AnyVal a = b semantically copies b (like int a = b would), although in practice - it delays the copy until one is mutated so that it is still fast to "copy" large arrays and tables. - - Reading example: -
-    AnyVal property = AnyVal::fromFile("c:/tmp/test.txt"));
-
-    Vector3 vel = property["angular velocity"]
-
-    Using defaults to handle errors:
-       If there was no "enabled" value, this will return the default instead of failing
-    bool enabled = property["enabled"].boolean(true);
-
- 
- - Writing to a file: -
-    AnyVal dict(AnyVal::TABLE);
-
-    dict["enabled"] = AnyVal(true);
-    dict["weight"] = 100;
-    dict["angular velocity"] = Vector3(1, -3, 4.5);
-
-    TextOutput t("c:/tmp/test.txt");
-    dict.serialize(t);
-    t.commit();
-  
- - Example of a data file: -
-   {
-      heights = [1, 17, 32]
-      model = 
-        {
-           color = C3(1, 1, 1)
-           filename = "foo.md2"
-        }
-      position = V3(23, 14, 0)
-      name = "Elmer"
-   }
-  
- -

- What's the difference from boost::any? -
I think that AnyVal will be easier for novice C++ users. It addresses the problem that - even though G3D::TextInput makes reading configuration files extremely simple, many people - still don't use it. So AnyVal makes it ridiculously simple to read and write a tree of G3D - types to a file. - - AnyVal: -

-{
-AnyVal tree(TextInput("config.txt"));
-
-bool enabled = tree.get("enabled", false);
-Vector3 direction = tree.get("direction", Vector3::zero());
-...
-}
-
- -boost: -
-{
-bool enabled = false;
-Vector3 direction;
-Table tree;
-
- ...write lots of file parsing code...
-
-   if (tree.containsKey("enabled")) {
-      const boost::any& val = tree["enabled"];
-      try {
-        enabled = any_cast(val);
-      } catch(const boost::bad_any_cast &) {
-      }
-    }
-
-   if (tree.containsKey("direction")) {
-      const boost::any& val = tree["direction"];
-      try {
-        direction = any_cast(val);
-      } catch(const boost::bad_any_cast &) {
-      }
-    }
-   ...
-}
-
- */ -class AnyVal { -public: - - /** Array and table values are all Any.*/ - enum Type { - NIL, - NUMBER, - BOOLEAN, - STRING, - VECTOR2, - VECTOR3, - VECTOR4, - MATRIX2, - MATRIX3, - MATRIX4, - QUAT, - COORDINATEFRAME, - COORDINATEFRAME2D, - CFRAME = COORDINATEFRAME, - CFRAME2D = COORDINATEFRAME2D, - COLOR1, - COLOR3, - COLOR4, - RECT2D, - AABOX2D = RECT2D, - AABOX, - ARRAY, - TABLE}; - - /** Base class for all AnyVal exceptions.*/ - class Exception { - public: - virtual ~Exception() {} - }; - - /** Thrown when an inappropriate operation is performed (e.g., operator[] on a number) */ - class WrongType : public Exception { - public: - Type expected; - Type actual; - WrongType() : expected(NIL), actual(NIL) {} - WrongType(Type e, Type a) : expected(e), actual(a) {} - }; - - /** Thrown by operator[] when a key is not present. */ - class KeyNotFound : public Exception { - public: - std::string key; - KeyNotFound() {} - KeyNotFound(const std::string& k) : key(k) {} - }; - - class IndexOutOfBounds : public Exception { - public: - int index; - int size; - IndexOutOfBounds() : index(0), size(0) {} - IndexOutOfBounds(int i, int s) : index(i), size(s) {} - }; - - /** Thrown when deserialize() when the input is incorrectly formatted. */ - class CorruptText : public Exception { - public: - std::string message; - - /** Token where the problem occurred.*/ - G3D::Token token; - - CorruptText() {} - CorruptText(const std::string& s, const G3D::Token& t) : message(s), token(t) {} - }; - -private: - - Type m_type; - void* m_value; - - /** For table and array types, *m_value is shared between multiple - instances. Mutation is allowed only if the reference count is - exactly 1, otherwise the mutating instance must copy the - value. This is not used for other types. - */ - int* m_referenceCount; - - /** Decrements the reference count (if there is one). If the - reference count is zero or does not exist. Calls delete on @a - m_value and sets it to NULL. - */ - void deleteValue(); - - /** Returns a copy of the value. */ - void* copyValue() const; - - /** Assumes isSharedType. Ensures that this has a unique reference */ - void makeMutable(); - - /** True if this is a shared value between multiple instances. */ - inline bool isShared() const { - return m_referenceCount && (*m_referenceCount > 1); - } - - /** True when m_value is a double pointer */ - inline bool isSharedType() const { - return (m_type == TABLE) || (m_type == ARRAY); - } - -public: - - AnyVal(); - - /** Deserialize */ - explicit AnyVal(G3D::TextInput& t); - - static AnyVal fromFile(const std::string& filename); - - void load(const std::string& filename); - - void save(const std::string& filename) const; - - ///** Deserialize */ - //explicit AnyVal(G3D::BinaryInput& t); - - /** Construct a number */ - AnyVal(double); - AnyVal(int); - - // Explicit to avoid ambiguity with the 'double' constructor - // when an integer type is constructed - AnyVal(bool); - AnyVal(const G3D::Vector2&); - AnyVal(const G3D::Vector3&); - AnyVal(const G3D::Vector4&); - - AnyVal(const G3D::Color1&); - AnyVal(const G3D::Color3&); - AnyVal(const G3D::Color4&); - - AnyVal(const std::string&); - AnyVal(const char*); - - AnyVal(const G3D::Quat&); - - AnyVal(const G3D::Rect2D&); - AnyVal(const G3D::AABox&); - - AnyVal(const G3D::CoordinateFrame&); - AnyVal(const G3D::Matrix2&); - AnyVal(const G3D::Matrix3&); - AnyVal(const G3D::Matrix4&); - - AnyVal(const AnyVal&); - - AnyVal(Type arrayOrTable); - - AnyVal& operator=(const AnyVal&); - - /** Frees the underlying storage */ - ~AnyVal(); - - Type type() const; - - bool isNil() const { - return type() == NIL; - } - - void serialize(G3D::TextOutput& t) const; - //void serialize(G3D::BinaryOutput& t) const; - void deserialize(G3D::TextInput& t); - //void deserialize(G3D::BinaryInput& t); - - /** Array dereference. If the index is out of bounds, IndexOutOfBounds is thrown */ - const AnyVal& operator[](int) const; - - /** Extend this array by one element. */ - void append(const AnyVal&); - - /** If the index is out of bounds, the array is resized. If the index is negative, - IndexOutOfBounds is thrown.*/ - AnyVal& operator[](int); - - /** If @a i is out of bounds or this is not an ARRAY, defaultVal is returned.*/ - const AnyVal& get(int i, const AnyVal& defaultVal) const; - - /** If out of bounds, IndexOutOfBounds is thrown. */ - const AnyVal& get(int i) const; - - /** Returns defaultVal if this is not a TABLE or the key is not found. */ - const AnyVal& get(const std::string& key, const AnyVal& defaultVal) const; - - /** Throws KeyNotFound exception if the key is not present.*/ - const AnyVal& get(const std::string& key) const; - - /** Table reference */ - const AnyVal& operator[](const std::string&) const; - - /** Table reference. If the element does not exist, it is created. */ - AnyVal& operator[](const std::string&); - - /** Table reference */ - const AnyVal& operator[](const char*) const; - - /** Table reference. If the element does not exist, it is created. */ - AnyVal& operator[](const char*); - - /** If this value is not a number throws a WrongType exception. */ - double number() const; - - /** If this value is not a number, returns defaultVal. */ - double number(double defaultVal) const; - - operator double () const { - return number(); - } - - operator float () const { - return (float)number(); - } - - bool boolean() const; - bool boolean(bool b) const; - - operator bool() const { - return boolean(); - } - - const std::string& string() const; - const std::string& string(const std::string& defaultVal) const; - - operator const std::string& () const { - return string(); - } - - const G3D::Rect2D& rect2D() const; - const G3D::Rect2D& rect2D(const G3D::Rect2D& defaultVal) const; - - operator const Rect2D& () const { - return rect2D(); - } - - const G3D::AABox& aabox() const; - const G3D::AABox& aabox(const G3D::AABox& defaultVal) const; - - operator const AABox& () const { - return aabox(); - } - - const G3D::Vector2& vector2() const; - const G3D::Vector2& vector2(const G3D::Vector2& defaultVal) const; - - operator const Vector2& () const { - return vector2(); - } - - const G3D::Vector3& vector3() const; - const G3D::Vector3& vector3(const G3D::Vector3& defaultVal) const; - - operator const Vector3& () { - return vector3(); - } - - const G3D::Vector4& vector4() const; - const G3D::Vector4& vector4(const G3D::Vector4& defaultVal) const; - - operator const Vector4& () const { - return vector4(); - } - - const G3D::Color1& color1() const; - const G3D::Color1& color1(const G3D::Color1& defaultVal) const; - - const G3D::Color3& color3() const; - const G3D::Color3& color3(const G3D::Color3& defaultVal) const; - - operator const Color3& () const { - return color3(); - } - - const G3D::Color4& color4() const; - const G3D::Color4& color4(const G3D::Color4& defaultVal) const; - - operator const Color4& () const { - return color4(); - } - - const G3D::CoordinateFrame& coordinateFrame() const; - const G3D::CoordinateFrame& coordinateFrame(const G3D::CoordinateFrame& defaultVal) const; - - operator const CoordinateFrame& () const { - return coordinateFrame(); - } - - const G3D::Matrix2& matrix2() const; - const G3D::Matrix2& matrix2(const G3D::Matrix2& defaultVal) const; - - operator const Matrix2& () const { - return matrix2(); - } - - const G3D::Matrix3& matrix3() const; - const G3D::Matrix3& matrix3(const G3D::Matrix3& defaultVal) const; - - operator const Matrix3& () const { - return matrix3(); - } - - const G3D::Matrix4& matrix4() const; - const G3D::Matrix4& matrix4(const G3D::Matrix4& defaultVal) const; - - operator const Matrix4& () const { - return matrix4(); - } - - const G3D::Quat& quat() const; - const G3D::Quat& quat(const G3D::Quat& defaultVal) const; - - operator const Quat& () const { - return quat(); - } - - std::string toString() const; - - /** Number of elements for an array or table.*/ - int size() const; - - /** For a table, returns the keys. */ - void getKeys(G3D::Array&) const; -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Array.h b/externals/g3dlite/G3D.lib/include/G3D/Array.h deleted file mode 100644 index ae4eea8ab40..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Array.h +++ /dev/null @@ -1,1180 +0,0 @@ -/** - @file Array.h - - @maintainer Morgan McGuire, graphics3d.com - @cite Portions written by Aaron Orenstein, a@orenstein.name - - @created 2001-03-11 - @edited 2008-07-09 - - Copyright 2000-2008, Morgan McGuire, morgan@cs.williams.edu - All rights reserved. - */ - -#ifndef G3D_ARRAY_H -#define G3D_ARRAY_H - -#include "G3D/platform.h" -#include "G3D/debug.h" -#include "G3D/System.h" -#ifdef G3D_DEBUG -// For formatting error messages -# include "G3D/format.h" -#endif -#include -#include - -#ifdef _MSC_VER -# include - -# pragma warning (push) - // debug information too long -# pragma warning( disable : 4312) -# pragma warning( disable : 4786) -#endif - - -namespace G3D { - -/** - Constant for passing to Array::resize - */ -const bool DONT_SHRINK_UNDERLYING_ARRAY = false; - -/** Constant for Array::sort */ -const int SORT_INCREASING = 1; -/** Constant for Array::sort */ -const int SORT_DECREASING = -1; - -/** - Dynamic 1D array. - - Objects must have a default constructor (constructor that - takes no arguments) in order to be used with this template. - You will get the error "no appropriate default constructor found" - if they do not. - - Do not use with objects that overload placement operator new, - since the speed of Array is partly due to pooled allocation. - - If SSE is defined Arrays allocate the first element aligned to - 16 bytes. - - - Array is highly optimized compared to std::vector. - Array operations are less expensive than on std::vector and for large - amounts of data, Array consumes only 1.5x the total size of the - data, while std::vector consumes 2.0x. The default - array takes up zero heap space. The first resize (or append) - operation grows it to a reasonable internal size so it is efficient - to append to small arrays. Memory is allocated using - System::alignedMalloc, which produces pointers aligned to 16-byte - boundaries for use with SSE instructions and uses pooled storage for - fast allocation. When Array needs to copy - data internally on a resize operation it correctly invokes copy - constructors of the elements (the MSVC6 implementation of - std::vector uses realloc, which can create memory leaks for classes - containing references and pointers). Array provides a guaranteed - safe way to access the underlying data as a flat C array -- - Array::getCArray. Although (T*)std::vector::begin() can be used for - this purpose, it is not guaranteed to succeed on all platforms. - - To serialize an array, see G3D::serialize. - - The template parameter MIN_ELEMENTS indicates the smallest number of - elements that will be allocated. The default of 10 is designed to avoid - the overhead of repeatedly allocating the array as it grows from 1, to 2, and so on. - If you are creating a lot of small Arrays, however, you may want to set this smaller - to reduce the memory cost. Once the array has been allocated, it will never - deallocate the underlying array unless MIN_ELEMENTS is set to 0, MIN_BYTES is 0, and the array - is empty. - - Do not subclass an Array. - */ -template -class Array { -private: - /** 0...num-1 are initialized elements, num...numAllocated-1 are not */ - T* data; - - int num; - int numAllocated; - - void init(int n, int a) { - debugAssert(n <= a); - debugAssert(n >= 0); - this->num = 0; - this->numAllocated = 0; - data = NULL; - if (a > 0) { - resize(n); - } else { - data = NULL; - } - } - - void _copy(const Array &other) { - init(other.num, other.num); - for (int i = 0; i < num; i++) { - data[i] = other.data[i]; - } - } - - /** - Returns true iff address points to an element of this array. - Used by append. - */ - inline bool inArray(const T* address) { - return (address >= data) && (address < data + num); - } - - - /** Only compiled if you use the sort procedure. */ - static bool __cdecl compareGT(const T& a, const T& b) { - return a > b; - } - - - /** - Allocates a new array of size numAllocated (not a parameter to the method) - and then copies at most oldNum elements from the old array to it. Destructors are - called for oldNum elements of the old array. - */ - void realloc(int oldNum) { - T* oldData = data; - - // The allocation is separate from the constructor invocation because we don't want - // to pay for the cost of constructors until the newly allocated - // elements are actually revealed to the application. They - // will be constructed in the resize() method. - - data = (T*)System::alignedMalloc(sizeof(T) * numAllocated, 16); - - // Call the copy constructors - {const int N = G3D::min(oldNum, numAllocated); - const T* end = data + N; - T* oldPtr = oldData; - for (T* ptr = data; ptr < end; ++ptr, ++oldPtr) { - - // Use placement new to invoke the constructor at the location - // that we determined. Use the copy constructor to make the assignment. - const T* constructed = new (ptr) T(*oldPtr); - - (void)constructed; - debugAssertM(constructed == ptr, - "new returned a different address than the one provided by Array."); - }} - - // Call destructors on the old array (if there is no destructor, this will compile away) - {const T* end = oldData + oldNum; - for (T* ptr = oldData; ptr < end; ++ptr) { - ptr->~T(); - }} - - - System::alignedFree(oldData); - } - -public: - - /** - G3D C++ STL style iterator variable. Call begin() to get - the first iterator, pre-increment (++i) the iterator to get to - the next value. Use dereference (*i) to access the element. - */ - typedef T* Iterator; - /** G3D C++ STL style const iterator in same style as Iterator. */ - typedef const T* ConstIterator; - - /** stl porting compatibility helper */ - typedef Iterator iterator; - /** stl porting compatibility helper */ - typedef ConstIterator const_iterator; - /** stl porting compatibility helper */ - typedef T value_type; - /** stl porting compatibility helper */ - typedef int size_type; - /** stl porting compatibility helper */ - typedef int difference_type; - - /** - C++ STL style iterator method. Returns the first iterator element. - Do not change the size of the array while iterating. - */ - Iterator begin() { - return data; - } - - ConstIterator begin() const { - return data; - } - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - ConstIterator end() const { - return data + num; - } - - Iterator end() { - return data + num; - } - - /** - The array returned is only valid until the next append() or resize call, or - the Array is deallocated. - */ - T* getCArray() { - return data; - } - - /** - The array returned is only valid until the next append() or resize call, or - the Array is deallocated. - */ - const T* getCArray() const { - return data; - } - - /** Creates a zero length array (no heap allocation occurs until resize). */ - Array() { - init(0, 0); - } - - /** - Creates an array of size. - */ - Array(int size) { - init(size, size); - } - - /** - Copy constructor - */ - Array(const Array& other) { - _copy(other); - } - - /** - Destructor does not delete() the objects if T is a pointer type - (e.g. T = int*) instead, it deletes the pointers themselves and - leaves the objects. Call deleteAll if you want to dealocate - the objects referenced. Do not call deleteAll if T is not a pointer - type (e.g. do call Array::deleteAll, do not call Array::deleteAll). - */ - ~Array() { - // Invoke the destructors on the elements - for (int i = 0; i < num; i++) { - (data + i)->~T(); - } - - System::alignedFree(data); - // Set to 0 in case this Array is global and gets referenced during app exit - data = NULL; - num = 0; - numAllocated = 0; - } - - - /** - Removes all elements. Use resize(0, false) or fastClear if you want to - remove all elements without deallocating the underlying array - so that future append() calls will be faster. - */ - void clear(bool shrink = true) { - resize(0, shrink); - } - - /** resize(0, false) - @deprecated*/ - void fastClear() { - clear(false); - } - - /** - Assignment operator. - */ - Array& operator=(const Array& other) { - resize(other.num); - for (int i = 0; i < num; ++i) { - data[i] = other[i]; - } - return *this; - } - - Array& operator=(const std::vector& other) { - resize((int)other.size()); - for (int i = 0; i < num; ++i) { - data[i] = other[i]; - } - return *this; - } - - /** - Number of elements in the array. - */ - inline int size() const { - return num; - } - - /** - Number of elements in the array. (Same as size; this is just - here for convenience). - */ - inline int length() const { - return size(); - } - - /** - Swaps element index with the last element in the array then - shrinks the array by one. - */ - void fastRemove(int index, bool shrinkIfNecessary = false) { - debugAssert(index >= 0); - debugAssert(index < num); - data[index] = data[num - 1]; - resize(size() - 1, shrinkIfNecessary); - } - - /** Resizes without shrinking the underlying array. Same as resize(n, false). - @deprecated*/ - void fastResize(int n) { - resize(n, false); - } - - - /** - Inserts at the specified index and shifts all other elements up by one. - */ - void insert(int n, const T& value) { - // Add space for the extra element - resize(num + 1, false); - - for (int i = num - 1; i > n; --i) { - data[i] = data[i - 1]; - } - data[n] = value; - } - - /** @param shrinkIfNecessary if false, memory will never be - reallocated when the array shrinks. This makes resizing much - faster but can waste memory. */ - void resize(int n, bool shrinkIfNecessary = true) { - int oldNum = num; - num = n; - - // Call the destructors on newly hidden elements if there are any - for (int i = num; i < oldNum; ++i) { - (data + i)->~T(); - } - - // Once allocated, always maintain MIN_ELEMENTS elements or 32 bytes, whichever is higher. - static const int minSize = G3D::max(MIN_ELEMENTS, (int)(MIN_BYTES / sizeof(T))); - - if ((MIN_ELEMENTS == 0) && (MIN_BYTES == 0) && (n == 0) && shrinkIfNecessary) { - // Deallocate the array completely - numAllocated = 0; - System::alignedFree(data); - data = NULL; - return; - } - - if (num > numAllocated) { - // Grow the underlying array - - if (numAllocated == 0) { - // First allocation; grow to exactly the size requested to avoid wasting space. - numAllocated = n; - debugAssert(oldNum == 0); - realloc(oldNum); - } else { - - if (num < minSize) { - // Grow to at least the minimum size - numAllocated = minSize; - - } else { - - // Increase the underlying size of the array. Grow aggressively - // up to 64k, less aggressively up to 400k, and then grow relatively - // slowly (1.5x per resize) to avoid excessive space consumption. - // - // These numbers are tweaked according to performance tests. - - float growFactor = 3.0; - - size_t oldSizeBytes = numAllocated * sizeof(T); - if (oldSizeBytes > 400000) { - // Avoid bloat - growFactor = 1.5; - } else if (oldSizeBytes > 64000) { - // This is what std:: uses at all times - growFactor = 2.0; - } - - numAllocated = (num - numAllocated) + (int)(numAllocated * growFactor); - - if (numAllocated < minSize) { - numAllocated = minSize; - } - } - - realloc(oldNum); - } - - } else if ((num <= numAllocated / 3) && shrinkIfNecessary && (num > minSize)) { - // Shrink the underlying array - - // Only copy over old elements that still remain after resizing - // (destructors were called for others if we're shrinking) - realloc(iMin(num, oldNum)); - - } - - // Call the constructors on newly revealed elements. - // Do not use parens because we don't want the intializer - // invoked for POD types. - for (int i = oldNum; i < num; ++i) { - new (data + i) T; - } - } - - /** - Add an element to the end of the array. Will not shrink the underlying array - under any circumstances. It is safe to append an element that is already - in the array. - */ - inline void append(const T& value) { - - if (num < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(value); - ++num; - } else if (inArray(&value)) { - // The value was in the original array; resizing - // is dangerous because it may move the value - // we have a reference to. - T tmp = value; - append(tmp); - } else { - // Here we run the empty initializer where we don't have to, but - // this simplifies the computation. - resize(num + 1, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 1] = value; - } - } - - - inline void append(const T& v1, const T& v2) { - if (inArray(&v1) || inArray(&v2)) { - // Copy into temporaries so that the references won't break when - // the array resizes. - T t1 = v1; - T t2 = v2; - append(t1, t2); - } else if (num + 1 < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(v1); - new (data + num + 1) T(v2); - num += 2; - } else { - // Resize the array. Note that neither value is already in the array. - resize(num + 2, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 2] = v1; - data[num - 1] = v2; - } - } - - - inline void append(const T& v1, const T& v2, const T& v3) { - if (inArray(&v1) || inArray(&v2) || inArray(&v3)) { - T t1 = v1; - T t2 = v2; - T t3 = v3; - append(t1, t2, t3); - } else if (num + 2 < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(v1); - new (data + num + 1) T(v2); - new (data + num + 2) T(v3); - num += 3; - } else { - resize(num + 3, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 3] = v1; - data[num - 2] = v2; - data[num - 1] = v3; - } - } - - - inline void append(const T& v1, const T& v2, const T& v3, const T& v4) { - if (inArray(&v1) || inArray(&v2) || inArray(&v3) || inArray(&v4)) { - T t1 = v1; - T t2 = v2; - T t3 = v3; - T t4 = v4; - append(t1, t2, t3, t4); - } else if (num + 3 < numAllocated) { - // This is a simple situation; just stick it in the next free slot using - // the copy constructor. - new (data + num) T(v1); - new (data + num + 1) T(v2); - new (data + num + 2) T(v3); - new (data + num + 3) T(v4); - num += 4; - } else { - resize(num + 4, DONT_SHRINK_UNDERLYING_ARRAY); - data[num - 4] = v1; - data[num - 3] = v2; - data[num - 2] = v3; - data[num - 1] = v4; - } - } - - /** - Returns true if the given element is in the array. - */ - bool contains(const T& e) const { - for (int i = 0; i < size(); ++i) { - if ((*this)[i] == e) { - return true; - } - } - - return false; - } - - /** - Append the elements of array. Cannot be called with this array - as an argument. - */ - void append(const Array& array) { - debugAssert(this != &array); - int oldNum = num; - int arrayLength = array.length(); - - resize(num + arrayLength, false); - - for (int i = 0; i < arrayLength; i++) { - data[oldNum + i] = array.data[i]; - } - } - - /** - Pushes a new element onto the end and returns its address. - This is the same as A.resize(A.size() + 1, false); A.last() - */ - inline T& next() { - resize(num + 1, false); - return last(); - } - - /** - Pushes an element onto the end (appends) - */ - inline void push(const T& value) { - append(value); - } - - inline void push(const Array& array) { - append(array); - } - - /** Alias to provide std::vector compatibility */ - inline void push_back(const T& v) { - push(v); - } - - /** "The member function removes the last element of the controlled sequence, which must be non-empty." - For compatibility with std::vector. */ - inline void pop_back() { - pop(); - } - - /** - "The member function returns the storage currently allocated to hold the controlled - sequence, a value at least as large as size()" - For compatibility with std::vector. - */ - int capacity() const { - return numAllocated; - } - - /** - "The member function returns a reference to the first element of the controlled sequence, - which must be non-empty." - For compatibility with std::vector. - */ - T& front() { - return (*this)[0]; - } - - /** - "The member function returns a reference to the first element of the controlled sequence, - which must be non-empty." - For compatibility with std::vector. - */ - const T& front() const { - return (*this)[0]; - } - - /** - Removes the last element and returns it. By default, shrinks the underlying array. - */ - inline T pop(bool shrinkUnderlyingArrayIfNecessary = true) { - debugAssert(num > 0); - T temp = data[num - 1]; - resize(num - 1, shrinkUnderlyingArrayIfNecessary); - return temp; - } - - /** Pops the last element and discards it without returning anything. Faster than pop. - By default, does not shrink the underlying array.*/ - inline void popDiscard(bool shrinkUnderlyingArrayIfNecessary = false) { - debugAssert(num > 0); - resize(num - 1, shrinkUnderlyingArrayIfNecessary); - } - - - /** - "The member function swaps the controlled sequences between *this and str." - Note that this is slower than the optimal std implementation. - - For compatibility with std::vector. - */ - void swap(Array& str) { - Array temp = str; - str = *this; - *this = temp; - } - - - /** - Performs bounds checks in debug mode - */ - inline T& operator[](int n) { - debugAssertM((n >= 0) && (n < num), format("Array index out of bounds. n = %d, size() = %d", n, num)); - debugAssert(data!=NULL); - return data[n]; - } - - inline T& operator[](unsigned int n) { - debugAssertM(n < (unsigned int)num, format("Array index out of bounds. n = %d, size() = %d", n, num)); - return data[n]; - } - - /** - Performs bounds checks in debug mode - */ - inline const T& operator[](int n) const { - debugAssert((n >= 0) && (n < num)); - debugAssert(data!=NULL); - return data[n]; - } - - inline const T& operator[](unsigned int n) const { - debugAssert((n < (unsigned int)num)); - debugAssert(data!=NULL); - return data[n]; - } - - inline T& randomElement() { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[iRandom(0, num - 1)]; - } - - inline const T& randomElement() const { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[iRandom(0, num - 1)]; - } - - /** - Returns the last element, performing a check in - debug mode that there is at least one element. - */ - inline const T& last() const { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[num - 1]; - } - - /** Returns element lastIndex() */ - inline T& last() { - debugAssert(num > 0); - debugAssert(data!=NULL); - return data[num - 1]; - } - - /** Returns size() - 1 */ - inline int lastIndex() const { - debugAssertM(num > 0, "Array is empty"); - return num - 1; - } - - inline int firstIndex() const { - debugAssertM(num > 0, "Array is empty"); - return 0; - } - - /** Returns element firstIndex(), performing a check in debug mode to ensure that there is at least one */ - inline T& first() { - debugAssertM(num > 0, "Array is empty"); - return data[0]; - } - - inline const T& first() const { - debugAssertM(num > 0, "Array is empty"); - return data[0]; - } - - /** Returns iFloor(size() / 2), throws an assertion in debug mode if the array is empty */ - inline int middleIndex() const { - debugAssertM(num > 0, "Array is empty"); - return num >> 1; - } - - /** Returns element middleIndex() */ - inline const T& middle() const { - debugAssertM(num > 0, "Array is empty"); - return data[num >> 1]; - } - - /** Returns element middleIndex() */ - inline T& middle() { - debugAssertM(num > 0, "Array is empty"); - return data[num >> 1]; - } - - /** - Calls delete on all objects[0...size-1] - and sets the size to zero. - */ - void deleteAll() { - for (int i = 0; i < num; i++) { - delete data[i]; - } - resize(0); - } - - /** - Returns the index of (the first occurance of) an index or -1 if - not found. - */ - int findIndex(const T& value) const { - for (int i = 0; i < num; ++i) { - if (data[i] == value) { - return i; - } - } - return -1; - } - - /** - Finds an element and returns the iterator to it. If the element - isn't found then returns end(). - */ - Iterator find(const T& value) { - for (int i = 0; i < num; ++i) { - if (data[i] == value) { - return data + i; - } - } - return end(); - } - - ConstIterator find(const T& value) const { - for (int i = 0; i < num; ++i) { - if (data[i] == value) { - return data + i; - } - } - return end(); - } - - /** - Removes count elements from the array - referenced either by index or Iterator. - */ - void remove(Iterator element, int count = 1) { - debugAssert((element >= begin()) && (element < end())); - debugAssert((count > 0) && (element + count) <= end()); - Iterator last = end() - count; - - while(element < last) { - element[0] = element[count]; - ++element; - } - - resize(num - count); - } - - void remove(int index, int count = 1) { - debugAssert((index >= 0) && (index < num)); - debugAssert((count > 0) && (index + count <= num)); - - remove(begin() + index, count); - } - - /** - Reverse the elements of the array in place. - */ - void reverse() { - T temp; - - int n2 = num / 2; - for (int i = 0; i < n2; ++i) { - temp = data[num - 1 - i]; - data[num - 1 - i] = data[i]; - data[i] = temp; - } - } - - /** - Sort using a specific less-than function, e.g.: - -
-    bool __cdecl myLT(const MyClass& elem1, const MyClass& elem2) {
-        return elem1.x < elem2.x;
-    }
-    
- - Note that for pointer arrays, the const must come - after the class name, e.g., Array uses: - -
-    bool __cdecl myLT(MyClass*const& elem1, MyClass*const& elem2) {
-        return elem1->x < elem2->x;
-    }
-    
- */ - void sort(bool (__cdecl *lessThan)(const T& elem1, const T& elem2)) { - std::sort(data, data + num, lessThan); - } - - - /** - Sorts the array in increasing order using the > or < operator. To - invoke this method on Array, T must override those operator. - You can overide these operators as follows: - - bool T::operator>(const T& other) const { - return ...; - } - bool T::operator<(const T& other) const { - return ...; - } - - */ - void sort(int direction = SORT_INCREASING) { - if (direction == SORT_INCREASING) { - std::sort(data, data + num); - } else { - std::sort(data, data + num, compareGT); - } - } - - /** - Sorts elements beginIndex through and including endIndex. - */ - void sortSubArray(int beginIndex, int endIndex, int direction = SORT_INCREASING) { - if (direction == SORT_INCREASING) { - std::sort(data + beginIndex, data + endIndex + 1); - } else { - std::sort(data + beginIndex, data + endIndex + 1, compareGT); - } - } - - void sortSubArray(int beginIndex, int endIndex, bool (__cdecl *lessThan)(const T& elem1, const T& elem2)) { - std::sort(data + beginIndex, data + endIndex + 1, lessThan); - } - - /** - The StrictWeakOrdering can be either a class that overloads the function call operator() or - a function pointer of the form bool (__cdecl *lessThan)(const T& elem1, const T& elem2) - */ - template - void sortSubArray(int beginIndex, int endIndex, StrictWeakOrdering& lessThan) { - std::sort(data + beginIndex, data + endIndex + 1, lessThan); - } - - /** Uses < and == to evaluate operator(); this is the default comparator for Array::partition. */ - class DefaultComparator { - public: - inline int operator()(const T& A, const T& B) const { - if (A < B) { - return 1; - } else if (A == B) { - return 0; - } else { - return -1; - } - } - }; - - /** The output arrays are resized with fastClear() so that if they are already of the same size - as this array no memory is allocated during partitioning. - - @param comparator A function, or class instance with an overloaded operator() that compares - two elements of type T and returns 0 if they are equal, -1 if the second is smaller, - and 1 if the first is smaller (i.e., following the conventions of std::string::compare). For example: - -
-        int compare(int A, int B) {
-            if (A < B) {
-                return 1;
-            } else if (A == B) {
-                return 0;
-            } else {
-                return -1;
-            }
-        }
-        
- */ - template - void partition( - const T& partitionElement, - Array& ltArray, - Array& eqArray, - Array& gtArray, - const Comparator& comparator) const { - - // Make sure all arrays are independent - debugAssert(<Array != this); - debugAssert(&eqArray != this); - debugAssert(>Array != this); - debugAssert(<Array != &eqArray); - debugAssert(<Array != >Array); - debugAssert(&eqArray != >Array); - - // Clear the arrays - ltArray.fastClear(); - eqArray.fastClear(); - gtArray.fastClear(); - - // Form a table of buckets for lt, eq, and gt - Array* bucket[3] = {<Array, &eqArray, >Array}; - - for (int i = 0; i < num; ++i) { - int c = comparator(partitionElement, data[i]); - debugAssertM(c >= -1 && c <= 1, "Comparator returned an illegal value."); - - // Insert into the correct bucket, 0, 1, or 2 - bucket[c + 1]->append(data[i]); - } - } - - /** - Uses < and == on elements to perform a partition. See partition(). - */ - void partition( - const T& partitionElement, - Array& ltArray, - Array& eqArray, - Array& gtArray) const { - - partition(partitionElement, ltArray, eqArray, gtArray, typename Array::DefaultComparator()); - } - - /** - Paritions the array into those below the median, those above the median, and those elements - equal to the median in expected O(n) time using quickselect. If the array has an even - number of different elements, the median for partition purposes is the largest value - less than the median. - - @param tempArray used for working scratch space - @param comparator see parition() for a discussion.*/ - template - void medianPartition( - Array& ltMedian, - Array& eqMedian, - Array& gtMedian, - Array& tempArray, - const Comparator& comparator) const { - - ltMedian.fastClear(); - eqMedian.fastClear(); - gtMedian.fastClear(); - - // Handle trivial cases first - switch (size()) { - case 0: - // Array is empty; no parition is possible - return; - - case 1: - // One element - eqMedian.append(first()); - return; - - case 2: - { - // Two element array; median is the smaller - int c = comparator(first(), last()); - - switch (c) { - case -1: - // first was bigger - eqMedian.append(last()); - gtMedian.append(first()); - break; - - case 0: - // Both equal to the median - eqMedian.append(first(), last()); - break; - - case 1: - // Last was bigger - eqMedian.append(first()); - gtMedian.append(last()); - break; - } - } - return; - } - - // All other cases use a recursive randomized median - - // Number of values less than all in the current arrays - int ltBoost = 0; - - // Number of values greater than all in the current arrays - int gtBoost = 0; - - // For even length arrays, force the gt array to be one larger than the - // lt array: - // [1 2 3] size = 3, choose half = (s + 1) /2 - // - int lowerHalfSize, upperHalfSize; - if (isEven(size())) { - lowerHalfSize = size() / 2; - upperHalfSize = lowerHalfSize + 1; - } else { - lowerHalfSize = upperHalfSize = (size() + 1) / 2; - } - const T* xPtr = NULL; - - // Maintain pointers to the arrays; we'll switch these around during sorting - // to avoid copies. - const Array* source = this; - Array* lt = <Median; - Array* eq = &eqMedian; - Array* gt = >Median; - Array* extra = &tempArray; - - while (true) { - // Choose a random element -- choose the middle element; this is theoretically - // suboptimal, but for loosly sorted array is actually the best strategy - - xPtr = &(source->middle()); - if (source->size() == 1) { - // Done; there's only one element left - break; - } - const T& x = *xPtr; - - // Note: partition (fast) clears the arrays for us - source->partition(x, *lt, *eq, *gt, comparator); - - int L = lt->size() + ltBoost + eq->size(); - int U = gt->size() + gtBoost + eq->size(); - if ((L >= lowerHalfSize) && - (U >= upperHalfSize)) { - - // x must be the partition median - break; - - } else if (L < lowerHalfSize) { - - // x must be smaller than the median. Recurse into the 'gt' array. - ltBoost += lt->size() + eq->size(); - - // The new gt array will be the old source array, unless - // that was the this pointer (i.e., unless we are on the - // first iteration) - Array* newGt = (source == this) ? extra : const_cast*>(source); - - // Now set up the gt array as the new source - source = gt; - gt = newGt; - - } else { - - // x must be bigger than the median. Recurse into the 'lt' array. - gtBoost += gt->size() + eq->size(); - - // The new lt array will be the old source array, unless - // that was the this pointer (i.e., unless we are on the - // first iteration) - Array* newLt = (source == this) ? extra : const_cast*>(source); - - // Now set up the lt array as the new source - source = lt; - lt = newLt; - } - } - - // Now that we know the median, make a copy of it (since we're about to destroy the array that it - // points into). - T median = *xPtr; - xPtr = NULL; - - // Partition the original array (note that this fast clears for us) - partition(median, ltMedian, eqMedian, gtMedian, comparator); - } - - /** - Computes a median partition using the default comparator and a dynamically allocated temporary - working array. If the median is not in the array, it is chosen to be the largest value smaller - than the true median. - */ - void medianPartition( - Array& ltMedian, - Array& eqMedian, - Array& gtMedian) const { - - Array temp; - medianPartition(ltMedian, eqMedian, gtMedian, temp, DefaultComparator()); - } - - - /** Redistributes the elements so that the new order is statistically independent - of the original order. O(n) time.*/ - void randomize() { - T temp; - - for (int i = size() - 1; i >= 0; --i) { - int x = iRandom(0, i); - - temp = data[i]; - data[i] = data[x]; - data[x] = temp; - } - } - - -}; - - -/** Array::contains for C-arrays */ -template bool contains(const T* array, int len, const T& e) { - for (int i = len - 1; i >= 0; --i) { - if (array[i] == e) { - return true; - } - } - return false; -} - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/AtomicInt32.h b/externals/g3dlite/G3D.lib/include/G3D/AtomicInt32.h deleted file mode 100644 index 9d58e02efe5..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/AtomicInt32.h +++ /dev/null @@ -1,166 +0,0 @@ -/** - @file AtomicInt32.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2005-09-01 - @edited 2006-06-21 - */ -#ifndef G3D_ATOMICINT32_H -#define G3D_ATOMICINT32_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -#if defined(G3D_OSX) - #include -#endif - -namespace G3D { - -/** - An integer that may safely be used on different threads without - external locking. - - On Win32, Linux, FreeBSD, and Mac OS X this is implemented without locks. - - BETA API This is unsupported and may change - */ -class AtomicInt32 { -private: -# if defined(G3D_WIN32) - volatile long m_value; -# elif defined(G3D_OSX) - int32_t m_value; -# else - volatile int32 m_value; -# endif - - -public: - - /** Initial value is undefined. */ - AtomicInt32() {} - - /** Atomic set */ - explicit AtomicInt32(const int32 x) { - m_value = x; - } - - /** Atomic set */ - AtomicInt32(const AtomicInt32& x) { - m_value = x.m_value; - } - - /** Atomic set */ - const AtomicInt32& operator=(const int32 x) { - m_value = x; - return *this; - } - - /** Atomic set */ - void operator=(const AtomicInt32& x) { - m_value = x.m_value; - } - - /** Returns the current value */ - int32 value() const { - return m_value; - } - - /** Returns the old value, before the add. */ - int32 add(const int32 x) { -# if defined(G3D_WIN32) - - return InterlockedExchangeAdd(&m_value, x); - -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - - int32 old; - asm volatile ("lock; xaddl %0,%1" - : "=r"(old), "=m"(m_value) /* outputs */ - : "0"(x), "m"(m_value) /* inputs */ - : "memory", "cc"); - return old; - -# elif defined(G3D_OSX) - - int32 old = m_value; - OSAtomicAdd32(x, &m_value); - return old; - -# endif - } - - /** Returns old value. */ - int32 sub(const int32 x) { - return add(-x); - } - - void increment() { -# if defined(G3D_WIN32) - // Note: returns the newly incremented value - InterlockedIncrement(&m_value); -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - add(1); -# elif defined(G3D_OSX) - // Note: returns the newly incremented value - OSAtomicIncrement32(&m_value); -# endif - } - - /** Returns zero if the result is zero after decrement, non-zero otherwise.*/ - int32 decrement() { -# if defined(G3D_WIN32) - // Note: returns the newly decremented value - return InterlockedDecrement(&m_value); -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - unsigned char nz; - - asm volatile ("lock; decl %1;\n\t" - "setnz %%al" - : "=a" (nz) - : "m" (m_value) - : "memory", "cc"); - return nz; -# elif defined(G3D_OSX) - // Note: returns the newly decremented value - return OSAtomicDecrement32(&m_value); -# endif - } - - - /** Atomic test-and-set: if *this == comperand then *this := exchange else do nothing. - In both cases, returns the old value of *this. - - Performs an atomic comparison of this with the Comperand value. - If this is equal to the Comperand value, the Exchange value is stored in this. - Otherwise, no operation is performed. - - Under VC6 the sign bit may be lost. - - */ - int32 compareAndSet(const int32 comperand, const int32 exchange) { -# if defined(G3D_WIN32) - return InterlockedCompareExchange(&m_value, exchange, comperand); -# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) - int32 ret; - asm volatile ("lock; cmpxchgl %1, %2" - : "=a" (ret) - : "r" (exchange), "m" (m_value), "0"(comperand) - : "memory", "cc"); - return ret; -# elif defined(G3D_OSX) - int32 old = m_value; - - OSAtomicCompareAndSwap32(comperand, exchange, &m_value); - - return old; -# endif - } - -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/BinaryFormat.h b/externals/g3dlite/G3D.lib/include/G3D/BinaryFormat.h deleted file mode 100644 index 53f0c144bf6..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/BinaryFormat.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - @file BinaryFormat.h - @maintainer Morgan McGuire, matrix@graphics3d.com - - @author 2005-06-03 - @edited 2005-06-03 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BINARYFORMAT_H -#define G3D_BINARYFORMAT_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -class Vector2; -class Vector2int16; -class Vector3; -class Vector3int16; -class Vector4; -class Vector4int16; -class Color3; -class Color3uint8; -class Color4; -class Color4uint8; - -/** - Some values like float16 and int128 have no current CPU data structure that implements them but are useful - for file formats and for GPUs. - - CHUNK_BINFMT data follows the protocol. - */ -// Must be packed int 16 bits for the chunk reader -// We can't name these just "INT8" etc. because some libraries #define names like that -enum BinaryFormat { - FIRST_BINFMT = 1000, - - BOOL8_BINFMT, - UINT8_BINFMT, INT8_BINFMT, UINT16_BINFMT, INT16_BINFMT, UINT32_BINFMT, INT32_BINFMT, UINT64_BINFMT, INT64_BINFMT, UINT128_BINFMT, INT128_BINFMT, - FLOAT16_BINFMT, FLOAT32_BINFMT, FLOAT64_BINFMT, - VECTOR2_BINFMT, VECTOR2INT16_BINFMT, - VECTOR3_BINFMT, VECTOR3INT16_BINFMT, - VECTOR4_BINFMT, VECTOR4INT16_BINFMT, - COLOR3_BINFMT, COLOR3UINT8_BINFMT, COLOR3INT16_BINFMT, - COLOR4_BINFMT, COLOR4UINT8_BINFMT, COLOR4INT16_BINFMT, - STRING_BINFMT, STRINGEVEN_BINFMT, STRING8_BINFMT, STRING16_BINFMT, STRING32_BINFMT, - - CHUNK_BINFMT, - - CUSTOM_BINFMT, - - LAST_BINFMT -}; - -} - -/** A macro that maps G3D types to format constants. - (e.g. binaryFormatOf(Vector3) == VECTOR3_BINFMT). -*/ -// This implementation is designed to meet the following constraints: -// 1. Work around the many MSVC++ partial template bugs -// 2. Work for primitive types (e.g. int) -#define binaryFormatOf(T) (G3D::_internal::_BinaryFormat::x()) - -namespace G3D { -namespace _internal { - - -template class _BinaryFormat { -public: - static BinaryFormat x() { - return CUSTOM_BINFMT; - } -}; -}} - - -/** - Macro to declare the underlying format (as will be returned by glFormatOf) - of a type. For example, - -
-    DECLARE_BINARYFORMATOF(Vector4, VECTOR4_BINFMT)
-  
- - Use this so you can make vertex arrays of your own classes and not just - the standard ones. - */ -#define DECLARE_BINARYFORMATOF(CType, EnumType) \ -namespace G3D { \ - namespace _internal { \ - template<> class _BinaryFormat { \ - public: \ - static BinaryFormat x() { \ - return EnumType; \ - } \ - }; \ - } \ -} - -DECLARE_BINARYFORMATOF( bool, BOOL8_BINFMT ) - -DECLARE_BINARYFORMATOF( uint8, UINT8_BINFMT ) -DECLARE_BINARYFORMATOF( int8, INT8_BINFMT ) -DECLARE_BINARYFORMATOF( uint16, UINT16_BINFMT ) -DECLARE_BINARYFORMATOF( int16, INT16_BINFMT ) -DECLARE_BINARYFORMATOF( uint32, UINT32_BINFMT ) -DECLARE_BINARYFORMATOF( int32, INT32_BINFMT ) -DECLARE_BINARYFORMATOF( uint64, UINT64_BINFMT ) -DECLARE_BINARYFORMATOF( int64, INT64_BINFMT ) - -DECLARE_BINARYFORMATOF( float32, FLOAT32_BINFMT ) -DECLARE_BINARYFORMATOF( float64, FLOAT64_BINFMT ) - -DECLARE_BINARYFORMATOF( Vector2, VECTOR2_BINFMT ) -DECLARE_BINARYFORMATOF( Vector2int16, VECTOR2INT16_BINFMT ) -DECLARE_BINARYFORMATOF( Vector3, VECTOR3_BINFMT ) -DECLARE_BINARYFORMATOF( Vector3int16, VECTOR3INT16_BINFMT ) -DECLARE_BINARYFORMATOF( Vector4, VECTOR4_BINFMT ) -DECLARE_BINARYFORMATOF( Vector4int16, VECTOR4INT16_BINFMT ) - -DECLARE_BINARYFORMATOF( Color3, COLOR3_BINFMT ) -DECLARE_BINARYFORMATOF( Color3uint8, COLOR3UINT8_BINFMT ) -DECLARE_BINARYFORMATOF( Color4, COLOR4_BINFMT ) -DECLARE_BINARYFORMATOF( Color4uint8, COLOR4UINT8_BINFMT ) - -namespace G3D { - -/** Returns -1 if the format is custom, otherwise the byte size - of a single element in this format.*/ -int32 byteSize(BinaryFormat f); - - -} //G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/BinaryInput.h b/externals/g3dlite/G3D.lib/include/G3D/BinaryInput.h deleted file mode 100644 index c0ab9052402..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/BinaryInput.h +++ /dev/null @@ -1,441 +0,0 @@ -/** - @file BinaryInput.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-08-09 - @edited 2006-07-19 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BINARYINPUT_H -#define G3D_BINARYINPUT_H - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning(push) -# pragma warning( disable : 4127 ) -#endif - -#include -#include -#include -#include -#include -#include -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Color4.h" -#include "G3D/Color3.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/g3dmath.h" -#include "G3D/debug.h" -#include "G3D/System.h" - - -namespace G3D { - -#if defined(G3D_WIN32) || defined(G3D_LINUX) - // Allow writing of integers to non-word aligned locations. - // This is legal on x86, but not on other platforms. - #define G3D_ALLOW_UNALIGNED_WRITES -#endif - -/** - Sequential or random access byte-order independent binary file access. - Files compressed with zlib and beginning with an unsigned 32-bit int - size are transparently decompressed when the compressed = true flag is - specified to the constructor. - - For every readX method there are also versions that operate on a whole - Array, std::vector, or C-array. e.g. readFloat32(Array& array, n) - These methods resize the array or std::vector to the appropriate size - before reading. For a C-array, they require the pointer to reference - a memory block at least large enough to hold n elements. - - Most classes define serialize/deserialize methods that use BinaryInput, - BinaryOutput, TextInput, and TextOutput. There are text serializer - functions for primitive types (e.g. int, std::string, float, double) but not - binary serializers-- you must call the BinaryInput::readInt32 or - other appropriate function. This is because it would be very hard to - debug the error sequence: serialize(1.0, bo); ... float f; deserialize(f, bi); - in which a double is serialized and then deserialized as a float. - */ -class BinaryInput { -private: - - // The initial buffer will be no larger than this, but - // may grow if a large memory read occurs. 50 MB - enum {INITIAL_BUFFER_LENGTH = 50000000}; - - /** - is the file big or little endian - */ - G3DEndian m_fileEndian; - std::string m_filename; - - bool m_swapBytes; - - /** Next position to read from in bitString during readBits. */ - int m_bitPos; - - /** Bits currently being read by readBits. - Contains at most 8 (low) bits. Note that - beginBits/readBits actually consumes one extra byte, which - will be restored by writeBits.*/ - uint32 m_bitString; - - /** 1 when between beginBits and endBits, 0 otherwise. */ - int m_beginEndBits; - - /** When operating on huge files, we cannot load the whole file into memory. - This is the file position to which buffer[0] corresponds. - */ - int64 m_alreadyRead; - - /** - Length of the entire file, in bytes. - For the length of the buffer, see bufferLength - */ - int64 m_length; - - /** Length of the array referenced by buffer. May go past the end of the file!*/ - int64 m_bufferLength; - uint8* m_buffer; - - /** - Next byte in file, relative to buffer. - */ - int64 m_pos; - - /** - When true, the buffer is freed in the destructor. - */ - bool m_freeBuffer; - - /** Ensures that we are able to read at least minLength from startPosition (relative - to start of file). */ - void loadIntoMemory(int64 startPosition, int64 minLength = 0); - - /** Verifies that at least this number of bytes can be read.*/ - inline void prepareToRead(int64 nbytes) { - debugAssertM(m_length > 0, m_filename + " not found or corrupt."); - debugAssertM(m_pos + nbytes + m_alreadyRead <= m_length, "Read past end of file."); - - if (m_pos + nbytes > m_bufferLength) { - loadIntoMemory(m_pos + m_alreadyRead, nbytes); - } - } - - // Not implemented on purpose, don't use - BinaryInput(const BinaryInput&); - BinaryInput& operator=(const BinaryInput&); - bool operator==(const BinaryInput&); - - /** Buffer is compressed; replace it with a decompressed version */ - void decompress(); -public: - - /** false, constant to use with the copyMemory option */ - static const bool NO_COPY; - - /** - If the file cannot be opened, a zero length buffer is presented. - Automatically opens files that are inside zipfiles. - - @param compressed Set to true if and only if the file was - compressed using BinaryOutput's zlib compression. This has - nothing to do with whether the input is in a zipfile. - */ - BinaryInput( - const std::string& filename, - G3DEndian fileEndian, - bool compressed = false); - - /** - Creates input stream from an in memory source. - Unless you specify copyMemory = false, the data is copied - from the pointer, so you may deallocate it as soon as the - object is constructed. It is an error to specify copyMemory = false - and compressed = true. - - To decompress part of a file, you can follow the following paradigm: - -
-        BinaryInput master(...);
-
-        // read from master to point where compressed data exists.
-
-        BinaryInput subset(master.getCArray() + master.getPosition(), 
-                           master.length() - master.getPosition(),
-                           master.endian(), true, true);
-
-        // Now read from subset (it is ok for master to go out of scope)
-     
- */ - BinaryInput( - const uint8* data, - int64 dataLen, - G3DEndian dataEndian, - bool compressed = false, - bool copyMemory = true); - - virtual ~BinaryInput(); - - /** Change the endian-ness of the file. This only changes the - interpretation of the file for future read calls; the - underlying data is unmodified.*/ - void setEndian(G3DEndian endian); - - G3DEndian endian() const { - return m_fileEndian; - } - - std::string getFilename() const { - return m_filename; - } - - /** - Returns a pointer to the internal memory buffer. - May throw an exception for huge files. - */ - const uint8* getCArray() const { - if (m_alreadyRead > 0) { - throw "Cannot getCArray for a huge file"; - } - return m_buffer; - } - - /** - Performs bounds checks in debug mode. [] are relative to - the start of the file, not the current position. - Seeks to the new position before reading (and leaves - that as the current position) - */ - inline uint8 operator[](int64 n) { - setPosition(n); - return readUInt8(); - } - - /** - Returns the length of the file in bytes. - */ - inline int64 getLength() const { - return m_length; - } - - inline int64 size() const { - return getLength(); - } - - /** - Returns the current byte position in the file, - where 0 is the beginning and getLength() - 1 is the end. - */ - inline int64 getPosition() const { - return m_pos + m_alreadyRead; - } - - /** - Sets the position. Cannot set past length. - May throw a char* when seeking backwards more than 10 MB on a huge file. - */ - inline void setPosition(int64 p) { - debugAssertM(p <= m_length, "Read past end of file"); - m_pos = p - m_alreadyRead; - if ((m_pos < 0) || (m_pos > m_bufferLength)) { - loadIntoMemory(m_pos + m_alreadyRead); - } - } - - /** - Goes back to the beginning of the file. - */ - inline void reset() { - setPosition(0); - } - - inline int8 readInt8() { - prepareToRead(1); - return m_buffer[m_pos++]; - } - - inline bool readBool8() { - return (readInt8() != 0); - } - - inline uint8 readUInt8() { - prepareToRead(1); - return ((uint8*)m_buffer)[m_pos++]; - } - - uint16 inline readUInt16() { - prepareToRead(2); - - m_pos += 2; - if (m_swapBytes) { - uint8 out[2]; - out[0] = m_buffer[m_pos - 1]; - out[1] = m_buffer[m_pos - 2]; - return *(uint16*)out; - } else { - #ifdef G3D_ALLOW_UNALIGNED_WRITES - return *(uint16*)(&m_buffer[m_pos - 2]); - #else - uint8 out[2]; - out[0] = m_buffer[m_pos - 2]; - out[1] = m_buffer[m_pos - 1]; - return *(uint16*)out; - #endif - } - - } - - inline int16 readInt16() { - uint16 a = readUInt16(); - return *(int16*)&a; - } - - inline uint32 readUInt32() { - prepareToRead(4); - - m_pos += 4; - if (m_swapBytes) { - uint8 out[4]; - out[0] = m_buffer[m_pos - 1]; - out[1] = m_buffer[m_pos - 2]; - out[2] = m_buffer[m_pos - 3]; - out[3] = m_buffer[m_pos - 4]; - return *(uint32*)out; - } else { - #ifdef G3D_ALLOW_UNALIGNED_WRITES - return *(uint32*)(&m_buffer[m_pos - 4]); - #else - uint8 out[4]; - out[0] = m_buffer[m_pos - 4]; - out[1] = m_buffer[m_pos - 3]; - out[2] = m_buffer[m_pos - 2]; - out[3] = m_buffer[m_pos - 1]; - return *(uint32*)out; - #endif - } - } - - - inline int32 readInt32() { - uint32 a = readUInt32(); - return *(int32*)&a; - } - - uint64 readUInt64(); - - inline int64 readInt64() { - uint64 a = readUInt64(); - return *(int64*)&a; - } - - inline float32 readFloat32() { - union { - uint32 a; - float32 b; - }; - a = readUInt32(); - return b; - } - - inline float64 readFloat64() { - union { - uint64 a; - float64 b; - }; - a = readUInt64(); - return b; - } - - void readBytes(void* bytes, int64 n); - - /** - Reads an n character string. The string is not - required to end in NULL in the file but will - always be a proper std::string when returned. - */ - std::string readString(int64 n); - - /** - Reads until NULL or the end of the file is encountered. - */ - std::string readString(); - - /** - Reads until NULL or the end of the file is encountered. - If the string has odd length (including NULL), reads - another byte. - */ - std::string readStringEven(); - - - std::string readString32(); - - Vector4 readVector4(); - Vector3 readVector3(); - Vector2 readVector2(); - - Color4 readColor4(); - Color3 readColor3(); - - /** - Skips ahead n bytes. - */ - inline void skip(int64 n) { - setPosition(m_pos + m_alreadyRead + n); - } - - /** - Returns true if the position is not at the end of the file - */ - inline bool hasMore() const { - return m_pos + m_alreadyRead < m_length; - } - - /** Prepares for bit reading via readBits. Only readBits can be - called between beginBits and endBits without corrupting the - data stream. */ - void beginBits(); - - /** Can only be called between beginBits and endBits */ - uint32 readBits(int numBits); - - /** Ends bit-reading. */ - void endBits(); - -# define DECLARE_READER(ucase, lcase)\ - void read##ucase(lcase* out, int64 n);\ - void read##ucase(std::vector& out, int64 n);\ - void read##ucase(Array& out, int64 n); - - DECLARE_READER(Bool8, bool) - DECLARE_READER(UInt8, uint8) - DECLARE_READER(Int8, int8) - DECLARE_READER(UInt16, uint16) - DECLARE_READER(Int16, int16) - DECLARE_READER(UInt32, uint32) - DECLARE_READER(Int32, int32) - DECLARE_READER(UInt64, uint64) - DECLARE_READER(Int64, int64) - DECLARE_READER(Float32, float32) - DECLARE_READER(Float64, float64) -# undef DECLARE_READER -}; - - -} - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/BinaryOutput.h b/externals/g3dlite/G3D.lib/include/G3D/BinaryOutput.h deleted file mode 100644 index d81ec56a67b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/BinaryOutput.h +++ /dev/null @@ -1,421 +0,0 @@ -/** - @file BinaryOutput.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-08-09 - @edited 2008-01-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BINARYOUTPUT_H -#define G3D_BINARYOUTPUT_H - -#include "G3D/platform.h" -#include -#include -#include -#include -#include -#include "G3D/Color4.h" -#include "G3D/Color3.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/g3dmath.h" -#include "G3D/debug.h" -#include "G3D/BinaryInput.h" -#include "G3D/System.h" - -#ifdef _MSC_VER -# pragma warning (push) -// Conditional is constant (wrong in inline) -# pragma warning (disable : 4127) -#endif -namespace G3D { - -/** - Sequential or random access byte-order independent binary file access. - - The compress() call can be used to compress with zlib. - - Any method call can trigger an out of memory error (thrown as char*) - when writing to "" instead of a file. - - Compressed writing and seeking backwards is not supported for huge files - (i.e., BinaryOutput may have to dump the contents to disk if they - exceed available RAM). - */ -class BinaryOutput { -private: - std::string m_filename; - - bool m_committed; - - /** 0 outside of beginBits...endBits, 1 inside */ - int m_beginEndBits; - - /** The current string of bits being built up by beginBits...endBits. - This string is treated semantically, as if the lowest bit was - on the left and the highest was on the right.*/ - int8 m_bitString; - - /** Position (from the lowest bit) currently used in bitString.*/ - int m_bitPos; - - // True if the file endianess does not match the machine endian - bool m_swapBytes; - - G3DEndian m_fileEndian; - - uint8* m_buffer; - - /** Size of the elements used */ - int m_bufferLen; - - /** Underlying size of memory allocaded */ - int m_maxBufferLen; - - /** Next byte in file */ - int m_pos; - - /** is this initialized? */ - bool m_init; - - /** Number of bytes already written to the file.*/ - size_t m_alreadyWritten; - - bool m_ok; - - void reserveBytesWhenOutOfMemory(size_t bytes); - - void reallocBuffer(size_t bytes, size_t oldBufferLen); - - /** - Make sure at least bytes can be written, resizing if - necessary. - */ - inline void reserveBytes(int bytes) { - debugAssert(bytes > 0); - size_t oldBufferLen = (size_t)m_bufferLen; - - m_bufferLen = iMax(m_bufferLen, (m_pos + bytes)); - if (m_bufferLen > m_maxBufferLen) { - reallocBuffer(bytes, oldBufferLen); - } - } - - // Not implemented on purpose, don't use - BinaryOutput(const BinaryOutput&); - BinaryOutput& operator=(const BinaryOutput&); - bool operator==(const BinaryOutput&); - -public: - - /** - You must call setEndian() if you use this (memory) constructor. - */ - BinaryOutput(); - - /** - Doesn't actually open the file; commit() does that. - Use "" as the filename if you're going to commit - to memory. - */ - BinaryOutput( - const std::string& filename, - G3DEndian fileEndian); - - ~BinaryOutput(); - - /** Compresses the data in the buffer in place, - preceeding it with a little-endian uint32 indicating - the uncompressed size. - - Call immediately before commit(). - - Cannot be used for huge files (ones where the data - was already written to disk)-- will throw char*. - */ - void compress(); - - /** True if no errors have been encountered.*/ - bool ok() const; - - /** - Returns a pointer to the internal memory buffer. - */ - inline const uint8* getCArray() const { - return m_buffer; - } - - void setEndian(G3DEndian fileEndian); - - G3DEndian endian() const { - return m_fileEndian; - } - - std::string getFilename() const { - return m_filename; - } - - /** - Write the bytes to disk. It is ok to call this - multiple times; it will just overwrite the previous file. - - Parent directories are created as needed if they do - not exist. - - Not called from the destructor; you must call - it yourself. - - @param flush If true (default) the file is ready for reading when the method returns, otherwise - the method returns immediately and writes the file in the background. - */ - void commit(bool flush = true); - - /** - Write the bytes to memory (which must be of - at least size() bytes). - */ - void commit(uint8*); - - /** - A memory BinaryOutput may be reset so that it can be written to again - without allocating new memory. The underlying array will not be deallocated, - but the reset structure will act like a newly intialized one. - */ - void reset(); - - - inline int length() const { - return (int)m_bufferLen + (int)m_alreadyWritten; - } - - inline int size() const { - return length(); - } - - /** - Sets the length of the file to n, padding - with 0's past the current end. Does not - change the position of the next byte to be - written unless n < size(). - - Throws char* when resetting a huge file to be shorter - than its current length. - */ - inline void setLength(int n) { - n = n - (int)m_alreadyWritten; - - if (n < 0) { - throw "Cannot resize huge files to be shorter."; - } - - if (n < m_bufferLen) { - m_pos = n; - } - if (n > m_bufferLen) { - reserveBytes(n - m_bufferLen); - } - } - - /** - Returns the current byte position in the file, - where 0 is the beginning and getLength() - 1 is the end. - */ - inline int64 position() const { - return (int64)m_pos + (int64)m_alreadyWritten; - } - - - /** - Sets the position. Can set past length, in which case - the file is padded with zeros up to one byte before the - next to be written. - - May throw a char* exception when seeking backwards on a huge file. - */ - inline void setPosition(int64 p) { - p = p - (int64)m_alreadyWritten; - - if (p > m_bufferLen) { - setLength((int)(p + (int64)m_alreadyWritten)); - } - - if (p < 0) { - throw "Cannot seek more than 10 MB backwards on huge files."; - } - - m_pos = (int)p; - } - - - void writeBytes( - const void* b, - int count) { - - reserveBytes(count); - debugAssert(m_pos >= 0); - debugAssert(m_bufferLen >= count); - System::memcpy(m_buffer + m_pos, b, count); - m_pos += count; - } - - /** - Writes a signed 8-bit integer to the current position. - */ - inline void writeInt8(int8 i) { - reserveBytes(1); - m_buffer[m_pos] = *(uint8*)&i; - m_pos++; - } - - inline void writeBool8(bool b) { - writeInt8(b ? 1 : 0); - } - - inline void writeUInt8(uint8 i) { - reserveBytes(1); - m_buffer[m_pos] = i; - m_pos++; - } - - void writeUInt16(uint16 u); - - inline void writeInt16(int16 i) { - writeUInt16(*(uint16*)&i); - } - - void writeUInt32(uint32 u); - - inline void writeInt32(int32 i) { - debugAssert(m_beginEndBits == 0); - writeUInt32(*(uint32*)&i); - } - - void writeUInt64(uint64 u); - - inline void writeInt64(int64 i) { - writeUInt64(*(uint64*)&i); - } - - inline void writeFloat32(float32 f) { - debugAssert(m_beginEndBits == 0); - union { - float32 a; - uint32 b; - }; - a = f; - writeUInt32(b); - } - - inline void writeFloat64(float64 f) { - union { - float64 a; - uint64 b; - }; - a = f; - writeUInt64(b); - } - - /** - Write a string with NULL termination. - */ - inline void writeString(const std::string& s) { - writeString(s.c_str()); - } - - void writeString(const char* s); - - /** - Write a string, ensuring that the total length - including NULL is even. - */ - void writeStringEven(const std::string& s) { - writeStringEven(s.c_str()); - } - - void writeStringEven(const char* s); - - - void writeString32(const char* s); - - /** - Write a string with a 32-bit length field in front - of it. - */ - void writeString32(const std::string& s) { - writeString32(s.c_str()); - } - - void writeVector4(const Vector4& v); - - void writeVector3(const Vector3& v); - - void writeVector2(const Vector2& v); - - void writeColor4(const Color4& v); - - void writeColor3(const Color3& v); - - /** - Skips ahead n bytes. - */ - inline void skip(int n) { - if (m_pos + n > m_bufferLen) { - setLength((int)m_pos + (int)m_alreadyWritten + n); - } - m_pos += n; - } - - /** Call before a series of BinaryOutput::writeBits calls. Only writeBits - can be called between beginBits and endBits without corrupting the stream.*/ - void beginBits(); - - /** Write numBits from bitString to the output stream. Bits are numbered from - low to high. - - Can only be - called between beginBits and endBits. Bits written are semantically - little-endian, regardless of the actual endian-ness of the system. That is, - writeBits(0xABCD, 16) writes 0xCD to the first byte and - 0xAB to the second byte. However, if used with BinaryInput::readBits, the ordering - is transparent to the caller. - */ - void writeBits(uint32 bitString, int numBits); - - /** Call after a series of BinaryOutput::writeBits calls. This will - finish out with zeros the last byte into which bits were written.*/ - void endBits(); - - -# define DECLARE_WRITER(ucase, lcase)\ - void write##ucase(const lcase* out, int n);\ - void write##ucase(const std::vector& out, int n);\ - void write##ucase(const Array& out, int n); - - DECLARE_WRITER(Bool8, bool) - DECLARE_WRITER(UInt8, uint8) - DECLARE_WRITER(Int8, int8) - DECLARE_WRITER(UInt16, uint16) - DECLARE_WRITER(Int16, int16) - DECLARE_WRITER(UInt32, uint32) - DECLARE_WRITER(Int32, int32) - DECLARE_WRITER(UInt64, uint64) - DECLARE_WRITER(Int64, int64) - DECLARE_WRITER(Float32, float32) - DECLARE_WRITER(Float64, float64) -# undef DECLARE_WRITER - -}; - -} - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/BoundsTrait.h b/externals/g3dlite/G3D.lib/include/G3D/BoundsTrait.h deleted file mode 100644 index 31525dab73b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/BoundsTrait.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - @file BoundsTrait.h - - @maintainer Morgan McGuire, morgan@cs.williams.edu - @created 2008-10-01 - @edited 2008-10-01 - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BOUNDSTRAIT_H -#define G3D_BOUNDSTRAIT_H - -#include "G3D/platform.h" - -template -struct BoundsTrait{}; - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/Box.h b/externals/g3dlite/G3D.lib/include/G3D/Box.h deleted file mode 100644 index 83e06a2f069..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Box.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - @file Box.h - - Box class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Portions based on Dave Eberly's Magic Software Library at
http://www.magic-software.com - @created 2001-06-02 - @edited 2007-06-05 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_BOX_H -#define G3D_BOX_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Array.h" -#include "G3D/Plane.h" - -namespace G3D { - -class CoordinateFrame; - -/** - An arbitrary 3D box, useful as a bounding box. - - - To construct a box from a coordinate frame, center and extent, use the idiom: - - Box box = cframe.toObjectSpace(Box(center - extent/2, center + extent/2)); - */ -class Box { -private: - - static int32 dummy; - - friend class CoordinateFrame; - - /** -
-       3    2       7    6
-    
-       0    1       4    5
-
-       front    back (seen through front)
-      
- */ - Vector3 _corner[8]; - - /** - Unit axes. - */ - Vector3 _axis[3]; - - Vector3 _center; - - /** - Extent along each axis. - */ - Vector3 _extent; - - float _area; - float _volume; - - void init( - const Vector3& min, - const Vector3& max); - -public: - - /** - Does not initialize the fields. - */ - Box(); - - /** - Constructs a box from two opposite corners. - */ - Box( - const Vector3& min, - const Vector3& max); - - static Box inf(); - - Box(class BinaryInput& b); - - Box(const class AABox& b); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** - Returns the object to world transformation for - this box. localFrame().worldToObject(...) takes - objects into the space where the box axes are - (1,0,0), (0,1,0), (0,0,1). Note that there - is no scaling in this transformation. - */ - CoordinateFrame localFrame() const; - - void getLocalFrame(CoordinateFrame& frame) const; - - /** - Returns the centroid of the box. - */ - inline Vector3 center() const { - return _center; - } - - - inline Vector3 corner(int i) const { - debugAssert(i < 8); - return _corner[i]; - } - - /** - Unit length. - */ - inline Vector3 axis(int a) const { - debugAssert(a < 3); - return _axis[a]; - } - - /** - Distance from corner(0) to the next corner - along the box's local axis a. - */ - inline float extent(int a) const { - debugAssert(a < 3); - return (float)_extent[a]; - } - - inline Vector3 extent() const { - return _extent; - } - - /** - Returns the four corners of a face (0 <= f < 6). - The corners are returned to form a counter clockwise quad facing outwards. - */ - void getFaceCorners( - int f, - Vector3& v0, - Vector3& v1, - Vector3& v2, - Vector3& v3) const; - - - /** - See AABox::culledBy - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - Conservative culling test that does not produce a mask for children. - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = -1) const; - - bool contains( - const Vector3& point) const; - - float area() const; - - float volume() const; - - void getRandomSurfacePoint(Vector3& P, Vector3& N = Vector3::dummy) const; - - /** - Uniformly distributed on the interior (includes surface) - */ - Vector3 randomInteriorPoint() const; - - void getBounds(class AABox&) const; - - bool isFinite() const { - return G3D::isFinite(_volume); - } -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Capsule.h b/externals/g3dlite/G3D.lib/include/G3D/Capsule.h deleted file mode 100644 index 237dcdab69d..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Capsule.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - @file Capsule.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-07 - @edited 2005-08-20 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_CAPSULE_H -#define G3D_CAPSULE_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Line; -class AABox; -/** - A shape formed by extruding a sphere along a line segment. - */ -class Capsule { -private: - Vector3 p1; - Vector3 p2; - - float _radius; -public: - - - /** Uninitialized */ - Capsule(); - Capsule(class BinaryInput& b); - Capsule(const Vector3& _p1, const Vector3& _p2, float _r); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** The line down the center of the capsule */ - Line axis() const; - - inline float radius() const { - return _radius; - } - - /** Argument may be 0 or 1 */ - inline Vector3 point(int i) const { - debugAssert(i == 0 || i == 1); - return (i == 0) ? p1 : p2; - } - - /** Distance between the sphere centers. The total extent of the cylinder is - 2r + h. */ - inline float height() const { - return (p1 - p2).magnitude(); - } - - inline Vector3 center() const { - return (p1 + p2) / 2.0; - } - - /** Get a reference frame in which the center of mass is the origin and Y is the axis of the capsule.*/ - void getReferenceFrame(class CoordinateFrame& cframe) const; - - /** - Returns true if the point is inside the capsule or on its surface. - */ - bool contains(const Vector3& p) const; - - float volume() const; - - float area() const; - - /** Get axis aligned bounding box */ - void getBounds(AABox& out) const; - - /** Random world space point with outward facing normal. */ - void getRandomSurfacePoint(Vector3& P, Vector3& N) const; - - /** Point selected uniformly at random over the volume. */ - Vector3 randomInteriorPoint() const; -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/CollisionDetection.h b/externals/g3dlite/G3D.lib/include/G3D/CollisionDetection.h deleted file mode 100644 index 62f92c18d33..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/CollisionDetection.h +++ /dev/null @@ -1,1178 +0,0 @@ -/** - @file CollisionDetection.h - - - Moving collision detection for simple primitives. - - @author Morgan McGuire, matrix@graphics3d.com - @cite Spherical collision based on Paul Nettle's - ftp://ftp.3dmaileffects.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf - and comments by Max McGuire. Ray-sphere intersection by Eric Haines. - Box-Box intersection written by Kevin Egan. - Thanks to Max McGuire of Iron Lore for various bug fixes. - - @created 2001-11-19 - @edited 2006-01-10 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLLISIONDETECTION_H -#define G3D_COLLISIONDETECTION_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Plane.h" -#include "G3D/Box.h" -#include "G3D/Triangle.h" -#include "G3D/Array.h" -#include "G3D/Ray.h" -#include "G3D/Line.h" - -namespace G3D { - - -/** - Collision detection primitives and tools for building - higher order collision detection schemes. - - These routines provide moving and static collision detection. - Moving collision detection allows the calculation of collisions that - occur during a period of time -- as opposed to the intersection of - two static bodies. - - Moving collision detection routines detect collisions between - only static primitives and moving spheres or points. Since the - reference frame can be user defined, these functions can be used to - detect the collision between two moving bodies by subtracting - the velocity vector of one object from the velocity vector of the - sphere or point the detection is to occur with. This unified - velocity vector will act as if both objects are moving simultaneously. - - Collisions are detected for single-sided objects only. That is, - no collision is detected when leaving a primitive or passing - through a plane or triangle opposite the normal... except for the - point-sphere calculation or when otherwise noted. - - For a sphere, the collision location returned is the point in world - space where the surface of the sphere and the fixed object meet. - It is not the position of the center of the sphere at - the time of the collision. - - The collision normal returned is the surface normal to the fixed - object at the collision location. - -

- Static Collision Detection: (Neither object is moving) - - - - - - - - - - - - - - -
Vector3LineSegmentRay *LinePlaneTriangleSphereCylinderCapsuleAABoxBox
Vector3Vector3::operator== Vector3::fuzzyEq G3D::distance
LineSegmentLineSegment::closestPoint LineSegment::distance CollisionDetection::closestPointOnLineSegment
Ray *Ray::closestPoint Ray::distance
LineLine::closestPoint Line::distanceCollisionDetection::closestPointsBetweenLineAndLine
Plane
Triangle
SphereSphere::contains
CylinderCylinder::contains
CapsuleCapsule::contains
AABoxAABox::contains
BoxBox::contains(treat as Ray)CollisionDetection::collisionTimeForMovingPointFixedBox(treat as Ray)CollisionDetection::penetrationDepthForFixedBoxFixedPlaneCollisionDetection::penetrationDepthForFixedBoxFixedPlaneCollisionDetection::penetrationDepthForFixedSphereFixedBoxNone (use OPCODE)CollisionDetection::movingSpherePassesThroughFixedBoxCollisionDetection::penetrationDepthForFixedBoxFixedBoxCollisionDetection::penetrationDepthForFixedBoxFixedBox
- -

- Moving Collision Detection: - - * Note: Moving collision detection against certain primitives is equivalent to static collision - detection against a bigger primitive. Ray, Line Segment == ``moving Point''; Capsule ==``moving Sphere''; Plane == ``moving Line'' - */ -class CollisionDetection { -private: - - /** - Default parameter if value passed to a function as reference is - not to be calculated. Must be explicitly supported by function. - */ - static Vector3 ignore; - - /** - Default parameter if value passed to a function as reference is - not to be calculated. Must be explicitly supported by function. - */ - static bool ignoreBool; - - /** - Default parameter if value passed to a function as reference is - not to be calculated. Must be explicitly supported by function. - */ - static Array ignoreArray; - - - // Static class! - CollisionDetection() {} - virtual ~CollisionDetection() {} - -public: - - /** - Converts an index [0, 15] to the corresponding separating axis. - Does not return normalized vector in the edge-edge case - (indices 6 through 15). - - @param separatingAxisIndex Separating axis. - @param box1 Box 1. - @param box2 Box 2. - - @return Axis that separates the two boxes. - */ - static Vector3 separatingAxisForSolidBoxSolidBox( - const int separatingAxisIndex, - const Box & box1, - const Box & box2); - - /** - Tests whether two boxes have axes that are parallel to - each other. If they are, axis1 and axis2 are set to be - the parallel axes for both box1 and box2 respectively. - - @param ca Dot products of each of the boxes axes - @param epsilon Fudge factor (small unit by which the dot - products may vary and still be considered - zero). - @param axis1 Parallel Axis 1. [Post Condition] - @param axis2 Parallel Axis 2. [Post Condition] - - @return true - If boxes have a parallel axis - @return false - otherwise. - */ - static bool parallelAxisForSolidBoxSolidBox( - const double* ca, - const double epsilon, - int & axis1, - int & axis2); - - /** - Calculates the projected distance between the two boxes along - the specified separating axis, negative distances correspond - to an overlap along that separating axis. The distance is not - divided by denominator dot(L, L), see - penetrationDepthForFixedSphereFixedBox() for more details - - @param separatingAxisIndex - @param a Box 1's bounding sphere vector - @param b Box 2's bounding sphere vector - @param D Vector between Box 1 and Box 2's center points - @param c Pointer to array of dot products of the axes of Box 1 - and Box 2. - @param ca Pointer to array of unsigned dot products of the axes - of Box 1 and Box 2. - @param ad Pointer to array of dot products of Box 1 axes and D. - @param bd Pointer to array of dot products of Box 2 axes and D. - - @return Projected distance between the two boxes along the - specified separating axis. - */ - static float projectedDistanceForSolidBoxSolidBox( - const int separatingAxisIndex, - const Vector3 & a, - const Vector3 & b, - const Vector3 & D, - const double* c, - const double* ca, - const double* ad, - const double* bd); - - - /** - Creates a set of standard information about two boxes in order to - solve for their collision. This information includes a vector to - the radius of the bounding sphere for each box, the vector between - each boxes' center and a series of dot products between differing - important vectors. These dot products include those between the axes - of both boxes (signed and unsigned values), and the dot products - between all the axes of box1 and the boxes' center vector and box2 - and the boxes' center vector. - - @pre The following space requirements must be met: - - c[] 9 elements - - ca[] 9 elements - - ad[] 3 elements - - bd[] 3 elements - - @cite dobted from David Eberly's papers, variables used in this function - correspond to variables used in pages 6 and 7 in the pdf - http://www.magic-software.com/Intersection.html - http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf - - @note Links are out-dated. (Kept to preserve origin and authorship) - - @param box1 Box 1 - @param box2 Box 2 - @param a Box 1's bounding sphere vector - @param b Box 2's bounding sphere vector - @param D Vector between Box 1 and Box 2's center points - @param c Pointer to array of dot products of the axes of Box 1 - and Box 2. - @param ca Pointer to array of unsigned dot products of the axes - of Box 1 and Box 2. - @param ad Pointer to array of dot products of Box 1 axes and D. - @param bd Pointer to array of dot products of Box 2 axes and D. - */ - static void fillSolidBoxSolidBoxInfo( - const Box & box1, - const Box & box2, - Vector3 & a, - Vector3 & b, - Vector3 & D, - double* c, - double* ca, - double* ad, - double* bd); - - /** - Performs a simple bounding sphere check between two boxes to determine - whether these boxes could possibly intersect. This is a very - cheap operation (three dot products, two sqrts and a few others). If - it returns true, an intersection is possible, but not necessarily - guaranteed. - - @param a Vector from box A's center to an outer vertex - @param b Vector from box B's center to an outer vertex - @param D Distance between the centers of the two boxes - - @return true - if possible intersection - @return false - otherwise (This does not guarantee an intersection) - */ - static bool conservativeBoxBoxTest( - const Vector3 & a, - const Vector3 & b, - const Vector3 & D); - - /** - Determines whether two fixed solid boxes intersect. - - @note To speed up collision detection, the lastSeparatingAxis from - the previous time step can be passed in and that plane can be - checked first. If the separating axis was not saved, or if the - two boxes intersected then lastSeparatingAxis should equal -1. - - @cite Adobted from David Eberly's papers, variables used in this function - correspond to variables used in pages 6 and 7 in the pdf - http://www.magic-software.com/Intersection.html - http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf - - @param box1 Box 1. - @param box2 Box 2. - @param lastSeparatingAxis Last separating axis. - (optimization - see note) - - @return true - Intersection. - @return false - otherwise. - */ - static bool fixedSolidBoxIntersectsFixedSolidBox( - const Box& box1, - const Box& box2, - const int lastSeparatingAxis = -1); - - /** - Calculates the closest points on two lines with each other. If the - lines are parallel then using the starting point, else calculate the - closest point on each line to the other. - - @note This is very similiar to calculating the intersection of two lines. - Logically then, the two points calculated would be identical if calculated - with inifinite precision, but with the finite precision of floating point - calculations, these values could (will) differ as the line slope approaches - zero or inifinity. - - @cite variables and algorithm based on derivation at the following website: - http://softsurfer.com/Archive/algorithm_0106/algorithm_0106.htm - - @param line1 Line 1. - @param line2 Line 2. - @param closest1 Closest point on line 1. - @param closest2 Closest point on line 2. - */ - static void closestPointsBetweenLineAndLine( - const Line & line1, - const Line & line2, - Vector3 & closest1, - Vector3 & closest2); - - /** - Calculates the depth of penetration between two fixed boxes. - Contact normal faces away from box1 and into box2. If there is - contact, only one contact point is returned. The minimally - violated separating plane is computed - - if the separating axis corresponds to a face - the contact point is half way between the deepest vertex - and the face - - if the separating axis corresponds to two edges - the contact point is the midpoint of the smallest line - segment between the two edge lines - - @note This is very similiar to calculating the intersection of two lines. - Logically then, the two points calculated would be identical if calculated - with inifinite precision, but with the finite precision of floating point - calculations, these values could (will) differ as the line slope approaches - zero or inifinity. - - @cite adobted from David Eberly's papers, variables used in this function - correspond to variables used in pages 6 and 7 in the pdf - http://www.magic-software.com/Intersection.html - http://www.magic-software.com/Documentation/DynamicCollisionDetection.pdf - - @param box1 Box 1 - @param box2 Box 2 - @param contactPoints Contact point between boxes. [Post Condition] - @param contactNormals Surface normal at contact point. [Post Condition] - @param lastSeparatingAxis Last separating axis. (Used for optimization) - - @return Depth of penetration between the two boxes. If there is no - intersection between the boxes, then a negative value is returned. - */ - static float penetrationDepthForFixedBoxFixedBox( - const Box& box1, - const Box& box2, - Array& contactPoints, - Array& contactNormals, - const int lastSeparatingAxis = -1); - - /** - Calculates the depth of penetration between two fixed spheres as well - as the deepest point of Sphere A that penetrates Sphere B. The normal - returned points away from the object A, although it may - represent a perpendicular to either the faces of object B or object A - depending on their relative orientations. - - @param sphereA Fixed Sphere A. - @param sphereB Fixed Sphere B. - @param contactPoints Sphere A's deepest point that penetrates Sphere B. - [Post Condition] - @param contactNormals Normal at penetration point. [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedSphereFixedSphere( - const class Sphere& sphereA, - const Sphere& sphereB, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates the depth of penetration between a fixed sphere and a fixed - box as well as the deepest point of the sphere that penetrates the box - and the normal at that intersection. - - @note There are three possible intersections between a sphere and box. - - Sphere completely contained in the box - - Sphere intersects one edge - - Sphere intersects one vertex - - The contact point and contact normal vary for each of these situations. - - Sphere contained in Box: - - Normal is based on side of least penetration (as is the depth calculation). - - Point is based on center of sphere - - Sphere intersects one edge - - Normal is based on vector from the box center to the point of depth. - - Point is closest point to the sphere on the line - - Sphere intersects one vertex - - Normal is based on vector from the box center to the vertex of penetration. - - Point is vertex of penetration. - - @cite Adapted from Jim Arvo's method in Graphics Gems - See also http://www.win.tue.nl/~gino/solid/gdc2001depth.pdf - - @param sphere Fixed Sphere. - @param box Fixed Box. - @param contactPoints Sphere point that penetrates the box. [Post Condition] - @param contactNormals Normal at the penetration point. [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedSphereFixedBox( - const Sphere& sphere, - const Box& box, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates the depth of penetration between a Fixed Sphere and a Fixed - Plane as well as the deepest point of the sphere that penetrates the plane - and the plane normal at that intersection. - - @param sphere Fixed Sphere. - @param plane Fixed Plane. - @param contactPoints Sphere point that penetrates the plane. - [Post Condition] - @param contactNormals Normal at penetration point. [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedSphereFixedPlane( - const Sphere& sphereA, - const class Plane& planeB, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates the depth of penetration between a fixed box and a fixed - plane as well as the vertexes of the box that penetrate the plane - and the plane normals at those intersections. - - @param box Fixed Box. - @param plane Fixed Plane. - @param contactPoints Box points that penetrate the plane. - [Post Condition] - @param contactNormals Normals at penetration points [Post Condition] - - @return Depth of penetration. If there is no intersection between the - objects then the depth will be a negative value. - */ - static float penetrationDepthForFixedBoxFixedPlane( - const Box& box, - const Plane& plane, - Array& contactPoints, - Array& contactNormals = ignoreArray); - - /** - Calculates time between the intersection of a moving point and a fixed - plane. - - @note This is only a one sided collision test. The side defined by - the plane's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param point Moving point. - @param velocity Point's velocity. - @param plane Fixed plane. - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - @param outNormal Plane's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedPlane( - const Vector3& point, - const Vector3& velocity, - const class Plane& plane, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param v0 Triangle vertex 1. - @param v1 Triangle vertex 2. - @param v2 Triangle vertex 3 - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2) { - return Ray::fromOriginAndDirection(orig, dir).intersectionTime(v0, v1, v2); - } - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param v0 Triangle vertex 1. - @param v1 Triangle vertex 2. - @param v2 Triangle vertex 3 - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - Vector3& location) { - float t = collisionTimeForMovingPointFixedTriangle(orig, dir, v0, v1, v2); - if (t < inf()) { - location = orig + dir * t; - } - return t; - } - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param tri Fixed triangle. - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - @param normal Triangle's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Triangle& tri, - Vector3& location = ignore, - Vector3& normal = ignore) { - - float t = collisionTimeForMovingPointFixedTriangle( - orig, dir, tri.vertex(0), tri.vertex(1), tri.vertex(2)); - - if ((t < inf()) && (&location != &ignore)) { - location = orig + dir * t; - normal = tri.normal(); - } - return t; - } - - /** - Calculates time between the intersection of a moving point and a fixed - triangle. - - @note This is only a one sided collision test. The side defined by - the triangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param orig Moving point. - @param dir Point's velocity. - @param v0 Triangle vertex 1. - @param v1 Triangle vertex 2. - @param v2 Triangle vertex 3 - @param location Location of collision. [Post Condition] - (Infinite vector on no collision) - @param normal Triangle's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - inline static float collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - Vector3& location, - Vector3& normal) { - float t = collisionTimeForMovingPointFixedTriangle(orig, dir, v0, v1, v2); - if (t < inf()) { - location = orig + dir * t; - normal = (v2 - v0).cross(v1 - v0).direction(); - } - return t; - } - - /** - Unlike other methods, does not support an output normal. - If the ray origin is inside the box, returns inf() but inside - is set to true. - Beta API - - @cite Andrew Woo, from "Graphics Gems", Academic Press, 1990 - @cite Optimized code by Pierre Terdiman, 2000 (~20-30% faster on my Celeron 500) - @cite Epsilon value added by Klaus Hartmann - @cite http://www.codercorner.com/RayAABB.cpp - */ - static float collisionTimeForMovingPointFixedAABox( - const Vector3& point, - const Vector3& velocity, - const class AABox& box, - Vector3& outLocation, - bool& inside = ignoreBool, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - Axis-Aligned Box (AABox). - - @note Avoids the sqrt from collisionTimeForMovingPointFixedAABox. - - @param point Moving point. - @param velocity Sphere's velocity. - @param box Fixed AAbox. - @param location Location of collision. [Post Condition] - @param Inside Does the ray originate inside the box? [Post Condition] - @param normal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static bool collisionLocationForMovingPointFixedAABox( - const Vector3& point, - const Vector3& velocity, - const class AABox& box, - Vector3& outLocation, - bool& inside = ignoreBool, - Vector3& normal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - sphere. - - @note When ray is starts inside the rectangle, the exiting intersection - is detected. - - @param point Moving point. - @param velocity Point's velocity. - @param Sphere Fixed Sphere. - @param location Location of collision. [Post Condition] - @param outNormal Sphere's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedSphere( - const Vector3& point, - const Vector3& velocity, - const class Sphere& sphere, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - box. - - @note If the point is already inside the box, no collision: inf is returned. - - @param point Moving point. - @param velocity Sphere's velocity. - @param box Fixed box. - @param location Position of collision. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedBox( - const Vector3& point, - const Vector3& velocity, - const class Box& box, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - rectangle defined by the points v0, v1, v2, & v3. - - @note This is only a one sided collision test. The side defined by - the rectangle's surface normal is the only one tested. For a two sided - collision, call the function once for each side's surface normal. - - @param point Moving point. - @param velocity Sphere's velocity. - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3 - @param v3 Rectangle vertex 4. - @param location Location of collision [Post Condition] - @param outNormal Rectangle's surface normal. [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedRectangle( - const Vector3& point, - const Vector3& velocity, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving point and a fixed - capsule. - - @param point Moving point. - @param velocity Point's velocity. - @param capsule Fixed capsule. - @param location Location of collision. [Post Condition] - @param outNormal Capsule's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingPointFixedCapsule( - const Vector3& point, - const Vector3& velocity, - const class Capsule& capsule, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - triangle. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param plane Fixed Plane. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedPlane( - const class Sphere& sphere, - const Vector3& velocity, - const class Plane& plane, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - triangle. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param triangle Fixed Triangle. (collisions can happen on the back side of the triangle) - @param outLocation Location of collision, if collision occurs -- not center position of sphere - at the collision time. If there is interpenetration at the start, this point may be inside - the sphere. - @param b Barycentric coordinates. These are not valid unless collision occurs. - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedTriangle( - const class Sphere& sphere, - const Vector3& velocity, - const Triangle& triangle, - Vector3& outLocation, - float b[3] = (float*)&ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - rectangle defined by the points v0, v1, v2, & v3. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3 - @param v3 Rectangle vertex 4. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedRectangle( - const class Sphere& sphere, - const Vector3& velocity, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - box. - - @note This function will not detect an intersection between a moving object - that is already interpenetrating the fixed object. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param box Fixed box. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Box's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedBox( - const class Sphere& sphere, - const Vector3& velocity, - const class Box& box, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - sphere. - - @note This won't detect a collision if the sphere is already interpenetrating - the fixed sphere. - - @param movingSphere Moving sphere. - @param velocity Sphere's velocity. - @param fixedSphere Fixed Sphere. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Sphere's surface normal to collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedSphere( - const class Sphere& sphere, - const Vector3& velocity, - const class Sphere& fixedSphere, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Calculates time between the intersection of a moving sphere and a fixed - capsule. - - @note This won't detect a collision if the sphere is already - interpenetrating the capsule. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param capsule Fixed capsule. - @param location Location of collision -- not center position of sphere - at the collision time. [Post Condition] - @param outNormal Capsule's surface normal to the collision [Post Condition] - - @return Time til collision. If there is no collision then the return - value will be inf(). - */ - static float collisionTimeForMovingSphereFixedCapsule( - const class Sphere& sphere, - const Vector3& velocity, - const class Capsule& capsule, - Vector3& outLocation, - Vector3& outNormal = ignore); - - /** - Finds the direction of bounce that a sphere would have when it - intersects an object with the given time of collision, the - collision location and the collision normal. - - @note This function works like a pong style ball bounce. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param collisionTime Time of collision. - @param collisionLocation Collision location. - @param collisionNormal Surface collision normal. - - @return Direction of bounce. - */ - static Vector3 bounceDirection( - const class Sphere& sphere, - const Vector3& velocity, - const float collisionTime, - const Vector3& collisionLocation, - const Vector3& collisionNormal); - - /** - Finds the direction of slide given a moving sphere, its velocity, the - time of collision and the collision location. This function works as - if the sphere intersects the surface and continues to hug it. - - @note The result will work well for calculating the movement of a player - who collides with an object and continues moving along the object instead - of just bouncing off it. - - @param sphere Moving sphere. - @param velocity Sphere's velocity. - @param collisionTime Time of collision - @param collisionLocation Collision location. - - @return Direction of slide. - */ - static Vector3 slideDirection( - const class Sphere& sphere, - const Vector3& velocity, - const float collisionTime, - const Vector3& collisionLocation); - - /** - Finds the closest point on a line segment to a given point. - - @param v0 line vertex 1. - @param v1 line vertex 2. - @param point External point. - - @return Closests point to point on the line segment. - */ - static Vector3 closestPointOnLineSegment( - const Vector3& v0, - const Vector3& v1, - const Vector3& point); - - /** - Finds the closest point on a line segment to a given point. - - @note This is an optimization to closestPointOnLineSegment. Edge length - and direction can be used in this function if already pre-calculated. This - prevents doing the same work twice. - - @param v0 line vertex 0. - @param v1 line vertex 1. - @param edgeDirection The direction of the segment (unit length). - @param edgeLength The length of the segment. - @param point External point. - - @return Closests point to point on the line segment. - */ - static Vector3 closestPointOnLineSegment( - const Vector3& v0, - const Vector3& v1, - const Vector3& edgeDirection, - float edgeLength, - const Vector3& point); - - /** - Finds the closest point on the perimeter of the triangle to an external point; - given a triangle defined by three points v0, v1, & v2, and the external point. - - @param v0 Triangle vertex 0. - @param v1 Triangle vertex 1. - @param v2 Triangle vertex 2. - @param point External point. - - @return Closests point to point on the perimeter of the - triangle. - */ - static Vector3 closestPointOnTrianglePerimeter( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& point); - - /** - Finds the closest point on the perimeter of the triangle to an external point; - given a triangle defined by the array of points v, its edge directions and - their lengths, as well as the external point. - - @note This is an optimization to closestPointToTrianglePerimeter. Edge length - and direction can be used in this function if already pre-calculated. This - prevents doing the same work twice. - - @param v0 Triangle vertex 0. - @param v1 Triangle vertex 1. - @param v2 Triangle vertex 2. - @param point External point. - @param edgeIndex The point lies on the edge between v[edgeIndex] and v[(edgeIndex + 1) % 3] - - @return Closests point to point on the perimeter of the - triangle. - */ - static Vector3 closestPointOnTrianglePerimeter( - const Vector3 v[3], - const Vector3 edgeDirection[3], - const float edgeLength[3], - const Vector3& point, - int& edgeIndex); - - /** - Tests whether a point is contained within the triangle defined by - v0, v1, and v2 and its plane's normal. - - @param v0 Triangle vertex 0. - @param v1 Triangle vertex 1. - @param v2 Triangle vertex 2. - @param normal Normal to triangle's plane. - @param point The point in question. - @param primaryAxis Primary axis of triangle. This will be detected - if not given. This parameter is provided as an optimization. - @param b Barycentric coordinates; b[i] is the weight on v[i] - - @return true - if point is inside the triangle. - @return false - otherwise - */ - static bool isPointInsideTriangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& normal, - const Vector3& point, - float b[3], - Vector3::Axis primaryAxis = Vector3::DETECT_AXIS); - - inline static bool isPointInsideTriangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& normal, - const Vector3& point, - Vector3::Axis primaryAxis = Vector3::DETECT_AXIS) { - - float b[3]; - return isPointInsideTriangle(v0, v1, v2, normal, point, b, primaryAxis); - } - - /** - Tests for the intersection of a moving sphere and a fixed box in a - given time limit. - - @note Returns true if any part of the sphere is inside the box - during the time period (inf means "ever"). Useful for - performing bounding-box collision detection. - - @param sphere Moving sphere. - @param velocity Velocity of moving sphere. - @param box Fixed box. - @param timeLimit Time limit for intersection test. - - @return true - if the two objects will touch. - @return false - if there is no intersection. - */ - static bool movingSpherePassesThroughFixedBox( - const Sphere& sphere, - const Vector3& velocity, - const Box& box, - double timeLimit = inf()); - - /** - Tests for the intersection of a moving sphere and a fixed sphere in a - given time limit. - - @note This function will not detect an intersection between a moving object - that is already interpenetrating the fixed object. - - @param sphere Moving sphere. - @param velocity Velocity of moving sphere. - @param fixedSphere Fixed sphere. - @param timeLimit Time limit for intersection test. - - @return true - if the two spheres will touch. - @return false - if there is no intersection. - */ - static bool movingSpherePassesThroughFixedSphere( - const Sphere& sphere, - const Vector3& velocity, - const Sphere& fixedSphere, - double timeLimit = inf()); - - /** - Tests for the intersection of two fixed spheres. - - @param sphere1 Fixed sphere 1. - @param sphere2 Fixed sphere 2. - - @return true - if the two spheres touch. - @return false - if there is no intersection. - */ - static bool fixedSolidSphereIntersectsFixedSolidSphere( - const Sphere& sphere1, - const Sphere& sphere2); - - /** - Tests for the intersection of a fixed sphere and a fixed box. - - @param sphere Fixed sphere. - @param box Fixed box. - - @return true - if the two objects touch. - @return false - if there is no intersection. - */ - static bool fixedSolidSphereIntersectsFixedSolidBox( - const Sphere& sphere, - const Box& box); - - static bool fixedSolidSphereIntersectsFixedTriangle( - const Sphere& sphere, - const Triangle& triangle); - - /** - Tests whether a point is inside a rectangle defined by the vertexes - v0, v1, v2, & v3, and the rectangle's plane normal. - - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3. - @param v3 Rectangle vertex 4. - @param normal Normal to rectangle's plane. - @param point The point in question. - - @return true - if point is inside the rectangle. - @return false - otherwise - */ - static bool isPointInsideRectangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& normal, - const Vector3& point); - - /** - Finds the closest point on the perimeter of the rectangle to an - external point; given a rectangle defined by four points v0, v1, - v2, & v3, and the external point. - - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3. - @param v3 Rectangle vertex 4. - @param point External point. - - @return Closests point to point on the perimeter of the - rectangle. - */ - static Vector3 closestPointToRectanglePerimeter( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& point); - - /** - Finds the closest point in the rectangle to an external point; Given - a rectangle defined by four points v0, v1, v2, & v3, and the external - point. - - @param v0 Rectangle vertex 1. - @param v1 Rectangle vertex 2. - @param v2 Rectangle vertex 3 - @param v3 Rectangle vertex 4. - @param point External point. - - @return Closet point in the rectangle to the external point. - */ - static Vector3 closestPointToRectangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& point); -}; - -} // namespace - -#endif // G3D_COLLISIONDETECTION_H diff --git a/externals/g3dlite/G3D.lib/include/G3D/Color1.h b/externals/g3dlite/G3D.lib/include/G3D/Color1.h deleted file mode 100644 index 1958da2b6cd..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Color1.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - @file Color1.h - - Monochrome Color class - - @maintainer Morgan McGuire, morgan@cs.williams.edu - @created 2007-01-31 - @edited 2008-10-02 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR1_H -#define G3D_COLOR1_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" -#include - -namespace G3D { - -/** - Monochrome color. This is just a float, but it has nice semantics - because a scaling by 255 automatically occurs when switching between - fixed point (Color1uint8) and floating point (Color1) formats. - */ -class Color1 { -private: - // Hidden operators - bool operator<(const Color1&) const; - bool operator>(const Color1&) const; - bool operator<=(const Color1&) const; - bool operator>=(const Color1&) const; - -public: - float value; - - /** - Initializes to 0 - */ - inline Color1() : value(0) {} - - Color1(class BinaryInput& bi); - - inline explicit Color1(float v) : value(v) { - } - - Color1 (const class Color1uint8& other); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - Color1 operator+ (const Color1& other) const { - return Color1(value + other.value); - } - - Color1 operator+ (const float other) const { - return Color1(value + other); - } - - Color1& operator+= (const Color1 other) { - value += other.value; - return *this; - } - - Color1& operator-= (const Color1 other) { - value -= other.value; - return *this; - } - - Color1 operator- (const Color1& other) const { - return Color1(value - other.value); - } - - Color1 operator- (const float other) const { - return Color1(value - other); - } - - Color1 operator- () const { - return Color1(-value); - } - - Color1 operator* (const Color1& other) const { - return Color1(value * other.value); - } - - Color1 operator* (const float other) const { - return Color1(value * other); - } - - Color1 operator/ (const Color1& other) const { - return Color1(value / other.value); - } - - Color1 operator/ (const float other) const { - return Color1(value / other); - } - - inline Color1 max(const Color1& other) const { - return Color1(G3D::max(value, other.value)); - } - - inline Color1 min(const Color1& other) const { - return Color1(G3D::min(value, other.value)); - } - - inline Color1 lerp(const Color1& other, float a) const { - return Color1(value + (other.value - value) * a); - - } - - inline size_t hashCode() const { - return (size_t)(value * 0xFFFFFF); - } -}; - -} - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Color1& key) { - return key.hashCode(); - } -}; - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Color1uint8.h b/externals/g3dlite/G3D.lib/include/G3D/Color1uint8.h deleted file mode 100644 index ffaa2d43ac4..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Color1uint8.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - @file Color1uint8.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2007-01-30 - @edited 2007-01-30 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR1UINT8_H -#define G3D_COLOR1UINT8_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -#if defined(G3D_WIN32) - // Switch to tight alignment - #pragma pack(push, 1) -#endif - - -/** - Represents a Color1 as a packed integer. Convenient - for creating unsigned int vertex arrays. - - WARNING: Integer color formats are different than - integer vertex formats. The color channels are automatically - scaled by 255 (because OpenGL automatically scales integer - colors back by this factor). So Color3(1,1,1) == Color3uint8(255,255,255) - but Vector3(1,1,1) == Vector3int16(1,1,1). - - Note: - Conversion of a float32 to uint8 is accomplished by min(iFloor(f * 256)) and - back to float32 by u / 255.0f. This gives equal size intervals. -Consider a number line from 0 to 1 and a corresponding one from 0 to 255. If we use iRound(x * 255), then the mapping for three critical intervals are: - -

-let s = 0.5/255
-  float             int       size
-[0, s)           -> 0          s
-[s, s * 3)       -> 1         2*s
-(1 - s, 1]       -> 255        s
-
- -If we use max(floor(x * 256), 255), then we get: - -
-let s = 1/256
-  float             int           size
-[0, s)           -> 0               s
-[s, 2 * s)       -> 1               s
-(1 - s, 1]       -> 255             s
-
-and the intervals are all the same size, thus giving equal precision to all values. - */ -class Color1uint8 { -private: - // Hidden operators - bool operator<(const Color1uint8&) const; - bool operator>(const Color1uint8&) const; - bool operator<=(const Color1uint8&) const; - bool operator>=(const Color1uint8&) const; - -public: - - uint8 value; - - Color1uint8() : value(0) {} - - explicit Color1uint8(const uint8 _v) : value(_v) {} - - Color1uint8(const class Color1& c); - - Color1uint8(class BinaryInput& bi); - - void serialize(class BinaryOutput& bo) const; - - void deserialize(class BinaryInput& bi); - - inline bool operator==(const Color1uint8& other) const { - return value == other.value; - } - - inline bool operator!=(const Color1uint8& other) const { - return value != other.value; - } - -} - -#if defined(G3D_LINUX) || defined(G3D_OSX) - __attribute((aligned(1))) -#endif - -; - -#ifdef G3D_WIN32 - #pragma pack(pop) -#endif - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Color3.h b/externals/g3dlite/G3D.lib/include/G3D/Color3.h deleted file mode 100644 index b8d0f94829a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Color3.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - @file Color3.h - - Color class - - @maintainer Morgan McGuire, matrix@graphics3d.com - @cite Portions based on Dave Eberly's Magic Software Library - at http://www.magic-software.com - - @created 2001-06-02 - @edited 2008-07-17 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR3_H -#define G3D_COLOR3_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" -#include "G3D/Color1.h" -#include - -namespace G3D { - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Color3 { -private: - // Hidden operators - bool operator<(const Color3&) const; - bool operator>(const Color3&) const; - bool operator<=(const Color3&) const; - bool operator>=(const Color3&) const; - -public: - /** - Does not initialize fields. - */ - Color3(); - - explicit Color3(class BinaryInput& bi); - - Color3(float r, float g, float b); - Color3(float v) : r(v), g(v), b(v) {} - - explicit Color3(const class Vector3& v); - - explicit Color3(const float value[3]); - - /** - Initialize from another color. - */ - Color3 (const Color3& other); - - Color3 (const class Color3uint8& other); - - /** - Initialize from an HTML-style color (e.g. 0xFF0000 == RED) - */ - static Color3 fromARGB(uint32); - - /** Returns one of the color wheel colors (e.g. RED, GREEN, CYAN). - Does not include white, black, or gray. */ - static const Color3& wheelRandom(); - - /** - * Channel value. - */ - float r, g, b; - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b - // - // WARNING. These member functions rely on - // (1) Color3 not having virtual functions - // (2) the data packed in a 3*sizeof(float) memory block - const float& operator[] (int i) const; - float& operator[] (int i); - - // assignment and comparison - Color3& operator= (const Color3& rkVector); - bool operator== (const Color3& rkVector) const; - bool operator!= (const Color3& rkVector) const; - size_t hashCode() const; - - // arithmetic operations - Color3 operator+ (const Color3& rkVector) const; - Color3 operator- (const Color3& rkVector) const; - Color3 operator* (float fScalar) const; - Color3 operator* (const Color3& rkVector) const; - Color3 operator/ (float fScalar) const; - Color3 operator- () const; - - // arithmetic updates - Color3& operator+= (const Color3& rkVector); - Color3& operator-= (const Color3& rkVector); - Color3& operator*= (const Color3& rkVector); - Color3& operator*= (float fScalar); - Color3& operator/= (float fScalar); - - bool fuzzyEq(const Color3& other) const; - bool fuzzyNe(const Color3& other) const; - - inline operator float* () { - return (float*)this; - } - - operator const float* () const { - return (float*)this; - } - - // vector operations - float length () const; - Color3 direction() const; - float squaredLength () const; - float dot (const Color3& rkVector) const; - float unitize (float fTolerance = 1e-06); - Color3 cross (const Color3& rkVector) const; - Color3 unitCross (const Color3& rkVector) const; - - inline Color3 pow(const Color3& other) const { - return Color3(::pow(r, other.r), ::pow(g, other.g), ::pow(b, other.b)); - } - - inline Color3 pow(float other) const { - return Color3(::pow(r, other), ::pow(g, other), ::pow(b, other)); - } - - /**@return the largest component */ - inline float max() const { - return G3D::max(G3D::max(r, g), b); - } - - inline Color3 max(const Color3& other) const { - return Color3(G3D::max(r, other.r), G3D::max(g, other.g), G3D::max(b, other.b)); - } - - inline Color3 min(const Color3& other) const { - return Color3(G3D::min(r, other.r), G3D::min(g, other.g), G3D::min(b, other.b)); - } - - inline Color3 lerp(const Color3& other, float a) const { - return (*this) + (other - *this) * a; - - } - - inline float sum() const { - return r + g + b; - } - - inline float average() const { - return sum() / 3.0f; - } - - - /** - * Converts from HSV to RGB , note: toHSV(fromHSV(_hsv)) may not be _hsv, if it is at a grey point or black point. - * The components of _hsv should lie in the unit interval. - * @cite Alvy Ray Smith SIGGRAPH 1978 "Color Gamut Transform Pairs" - **/ - static Color3 fromHSV(const Vector3& _hsv); - static Vector3 toHSV(const Color3& _rgb); - - /** Duplicates the matlab jet colormap maps [0,1] --> (r,g,b) where blue is close to 0 and red is close to 1. */ - static Color3 jetColorMap(const float& val); - - /** Returns colors with maximum saturation and value @param hue [0, 1]*/ - static Color3 rainbowColorMap(float hue); - - std::string toString() const; - - /** Random unit vector */ - static Color3 random(); - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Color3& red(); - static const Color3& green(); - static const Color3& blue(); - static const Color3& purple(); - static const Color3& cyan(); - static const Color3& yellow(); - static const Color3& brown(); - static const Color3& orange(); - static const Color3& black(); - static const Color3& gray(); - static const Color3& white(); - - static const Color3& zero(); - static const Color3& one(); - - inline Color3 bgr() const { - return Color3(b, g, r); - } -}; - -inline G3D::Color3 operator* (float s, const G3D::Color3& c) { - return c * s; -} - -inline G3D::Color3 operator* (G3D::Color1& s, const G3D::Color3& c) { - return c * s.value; -} - -inline G3D::Color3 operator* (const G3D::Color3& c, G3D::Color1& s) { - return c * s.value; -} - - -//---------------------------------------------------------------------------- -inline Color3::Color3 () { -} - -//---------------------------------------------------------------------------- - -inline Color3::Color3(float fX, float fY, float fZ) { - r = fX; - g = fY; - b = fZ; -} - -//---------------------------------------------------------------------------- -inline Color3::Color3(const float afCoordinate[3]) { - r = afCoordinate[0]; - g = afCoordinate[1]; - b = afCoordinate[2]; -} - -//---------------------------------------------------------------------------- -inline Color3::Color3 (const Color3& rkVector) { - r = rkVector.r; - g = rkVector.g; - b = rkVector.b; -} - -//---------------------------------------------------------------------------- -inline float& Color3::operator[] (int i) { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- - -inline const float& Color3::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- - -inline bool Color3::fuzzyEq(const Color3& other) const { - return G3D::fuzzyEq((*this - other).squaredLength(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Color3::fuzzyNe(const Color3& other) const { - return G3D::fuzzyNe((*this - other).squaredLength(), 0); -} - - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator= (const Color3& rkVector) { - r = rkVector.r; - g = rkVector.g; - b = rkVector.b; - return *this; -} - -//---------------------------------------------------------------------------- -inline bool Color3::operator== (const Color3& rkVector) const { - return ( r == rkVector.r && g == rkVector.g && b == rkVector.b ); -} - -//---------------------------------------------------------------------------- -inline bool Color3::operator!= (const Color3& rkVector) const { - return ( r != rkVector.r || g != rkVector.g || b != rkVector.b ); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator+ (const Color3& rkVector) const { - return Color3(r + rkVector.r, g + rkVector.g, b + rkVector.b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator- (const Color3& rkVector) const { - return Color3(r -rkVector.r, g - rkVector.g, b - rkVector.b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator* (float fScalar) const { - return Color3(fScalar*r, fScalar*g, fScalar*b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator* (const Color3& rkVector) const { - return Color3(r * rkVector.r, g * rkVector.g, b * rkVector.b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::operator- () const { - return Color3( -r, -g, -b); -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator+= (const Color3& rkVector) { - r += rkVector.r; - g += rkVector.g; - b += rkVector.b; - return *this; -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator-= (const Color3& rkVector) { - r -= rkVector.r; - g -= rkVector.g; - b -= rkVector.b; - return *this; -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator*= (float fScalar) { - r *= fScalar; - g *= fScalar; - b *= fScalar; - return *this; -} - -//---------------------------------------------------------------------------- -inline Color3& Color3::operator*= (const Color3& rkVector) { - r *= rkVector.r; - g *= rkVector.g; - b *= rkVector.b; - return *this; -} -//---------------------------------------------------------------------------- -inline float Color3::squaredLength () const { - return r*r + g*g + b*b; -} - -//---------------------------------------------------------------------------- -inline float Color3::length () const { - return sqrtf(r*r + g*g + b*b); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::direction () const { - float lenSquared = r * r + g * g + b * b; - - if (lenSquared != 1.0f) { - return *this / sqrtf(lenSquared); - } else { - return *this; - } -} - -//---------------------------------------------------------------------------- -inline float Color3::dot (const Color3& rkVector) const { - return r*rkVector.r + g*rkVector.g + b*rkVector.b; -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::cross (const Color3& rkVector) const { - return Color3(g*rkVector.b - b*rkVector.g, b*rkVector.r - r*rkVector.b, - r*rkVector.g - g*rkVector.r); -} - -//---------------------------------------------------------------------------- -inline Color3 Color3::unitCross (const Color3& rkVector) const { - Color3 kCross(g*rkVector.b - b*rkVector.g, b*rkVector.r - r*rkVector.b, - r*rkVector.g - g*rkVector.r); - kCross.unitize(); - return kCross; -} -} // namespace - - -template <> struct HashTrait { - static size_t hashCode(const G3D::Color3& key) { - return key.hashCode(); - } -}; - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Color3uint8.h b/externals/g3dlite/G3D.lib/include/G3D/Color3uint8.h deleted file mode 100644 index 20e225a0734..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Color3uint8.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - @file Color3uint8.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2003-04-07 - @edited 2006-06-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR3UINT8_H -#define G3D_COLOR3UINT8_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -/** - Represents a Color3 as a packed integer. Convenient - for creating unsigned int vertex arrays. Used by - G3D::GImage as the underlying format. - - WARNING: Integer color formats are different than - integer vertex formats. The color channels are automatically - scaled by 255 (because OpenGL automatically scales integer - colors back by this factor). So Color3(1,1,1) == Color3uint8(255,255,255) - but Vector3(1,1,1) == Vector3int16(1,1,1). - */ - -#if defined(G3D_WIN32) - // Switch to tight alignment - #pragma pack(push, 1) -#endif - -class Color3uint8 { -private: - // Hidden operators - bool operator<(const Color3uint8&) const; - bool operator>(const Color3uint8&) const; - bool operator<=(const Color3uint8&) const; - bool operator>=(const Color3uint8&) const; - -public: - uint8 r; - uint8 g; - uint8 b; - - Color3uint8() : r(0), g(0), b(0) {} - - Color3uint8(const uint8 _r, const uint8 _g, const uint8 _b) : r(_r), g(_g), b(_b) {} - - Color3uint8(const class Color3& c); - - Color3uint8(class BinaryInput& bi); - - inline static Color3uint8 fromARGB(uint32 i) { - Color3uint8 c; - c.r = (i >> 16) & 0xFF; - c.g = (i >> 8) & 0xFF; - c.b = i & 0xFF; - return c; - } - - inline Color3uint8 bgr() const { - return Color3uint8(b, g, r); - } - - /** - Returns the color packed into a uint32 - (the upper byte is 0xFF) - */ - inline uint32 asUInt32() const { - return (0xFF << 24) + ((uint32)r << 16) + ((uint32)g << 8) + b; - } - - void serialize(class BinaryOutput& bo) const; - - void deserialize(class BinaryInput& bi); - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b - // - // WARNING. These member functions rely on - // (1) Color3 not having virtual functions - // (2) the data packed in a 3*sizeof(uint8) memory block - G3D::uint8& operator[] (int i) const; - operator G3D::uint8* (); - operator const G3D::uint8* () const; - - bool operator==(const Color3uint8& other) const { - return (other.r == r) && (other.g == g) && (other.b == b); - } - - bool operator!=(const Color3uint8& other) const { - return (other.r != r) && (other.g != g) && (other.b != b); - } -} - -#if defined(G3D_LINUX) || defined(G3D_OSX) - __attribute((aligned(1))) -#endif - -; - -#ifdef G3D_WIN32 - #pragma pack(pop) -#endif - - -inline G3D::uint8& Color3uint8::operator[] (int i) const { - debugAssert((unsigned int)i < 3); - return ((G3D::uint8*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Color3uint8::operator G3D::uint8* () { - return (G3D::uint8*)this; -} - -inline Color3uint8::operator const G3D::uint8* () const { - return (G3D::uint8*)this; -} -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Color4.h b/externals/g3dlite/G3D.lib/include/G3D/Color4.h deleted file mode 100644 index 6b1b3b4c4bb..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Color4.h +++ /dev/null @@ -1,324 +0,0 @@ -/** - @file Color4.h - - Color class - - @maintainer Morgan McGuire, matrix@graphics3d.com - @cite Portions based on Dave Eberly's Magic Software Library - at http://www.magic-software.com - - @created 2002-06-25 - @edited 2008-07-16 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_COLOR4_H -#define G3D_COLOR4_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color3.h" -#include - -namespace G3D { - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Color4 { -private: - // Hidden operators - bool operator<(const Color4&) const; - bool operator>(const Color4&) const; - bool operator<=(const Color4&) const; - bool operator>=(const Color4&) const; - -public: - - /** - * Does not initialize fields. - */ - Color4 (); - - Color4(const Color3& c3, float a = 1.0); - - Color4(const class Color4uint8& c); - - Color4(class BinaryInput& bi); - - Color4(const class Vector4& v); - - /** - * Initialize from G3D::Reals. - */ - Color4(float r, float g, float b, float a = 1.0); - - /** - * Initialize from array of G3D::Reals. - */ - Color4(float value[4]); - - /** - * Initialize from another color. - */ - Color4(const Color4& other); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - /** - Initialize from an HTML-style color (e.g. 0xFFFF0000 == RED) - */ - static Color4 fromARGB(uint32); - - /** - * Channel values. - */ - float r, g, b, a; - - inline Color3 rgb() const { - return Color3(r, g, b); - } - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b, v[3] = V.a - // - // WARNING. These member functions rely on - // (1) Color4 not having virtual functions - // (2) the data packed in a 3*sizeof(float) memory block - float& operator[] (int i) const; - operator float* (); - operator const float* () const; - - // assignment and comparison - Color4& operator= (const Color4& rkVector); - bool operator== (const Color4& rkVector) const; - bool operator!= (const Color4& rkVector) const; - size_t hashCode() const; - - // arithmetic operations - Color4 operator+ (const Color4& rkVector) const; - Color4 operator- (const Color4& rkVector) const; - Color4 operator* (float fScalar) const; - Color4 operator/ (float fScalar) const; - Color4 operator- () const; - friend Color4 operator* (double fScalar, const Color4& rkVector); - - // arithmetic updates - Color4& operator+= (const Color4& rkVector); - Color4& operator-= (const Color4& rkVector); - Color4& operator*= (float fScalar); - Color4& operator/= (float fScalar); - - bool fuzzyEq(const Color4& other) const; - bool fuzzyNe(const Color4& other) const; - - std::string toString() const; - - inline Color4 max(const Color4& other) const { - return Color4(G3D::max(r, other.r), G3D::max(g, other.g), G3D::max(b, other.b), G3D::max(a, other.a)); - } - - inline Color4 min(const Color4& other) const { - return Color4(G3D::min(r, other.r), G3D::min(g, other.g), G3D::min(b, other.b), G3D::min(a, other.a)); - } - - /** r + g + b + a */ - inline float sum() const { - return r + g + b + a; - } - - inline Color4 lerp(const Color4& other, float a) const { - return (*this) + (other - *this) * a; - - } - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Color4& zero(); - static const Color4& clear(); - - static const Color4& inf(); - - inline Color3 bgr() const { - return Color3(b, g, r); - } -}; - -/** - Extends the c3 with alpha = 1.0 - */ -Color4 operator*(const Color3& c3, const Color4& c4); - - -inline Color4 operator*(const Color3& c3, const Color4& c4) { - return Color4(c3.r * c4.r, c3.g * c4.g, c3.b * c4.b, c4.a); -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4 () { - // For efficiency in construction of large arrays of vectors, the - // default constructor does not initialize the vector. -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4(const Color3& c3, float a) { - r = c3.r; - g = c3.g; - b = c3.b; - this->a = a; -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4( - float r, - float g, - float b, - float a) : - r(r), g(g), b(b), a(a) { -} - -//---------------------------------------------------------------------------- -inline Color4::Color4 (float afCoordinate[4]) { - r = afCoordinate[0]; - g = afCoordinate[1]; - b = afCoordinate[2]; - a = afCoordinate[3]; -} - -//---------------------------------------------------------------------------- - -inline Color4::Color4( - const Color4& other) { - - r = other.r; - g = other.g; - b = other.b; - a = other.a; -} - -//---------------------------------------------------------------------------- - -inline float& Color4::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Color4::operator float* () { - return (float*)this; -} - -inline Color4::operator const float* () const { - return (float*)this; -} - -//---------------------------------------------------------------------------- - -inline bool Color4::fuzzyEq(const Color4& other) const { - Color4 dif = (*this - other); - return G3D::fuzzyEq(dif.r * dif.r + dif.g * dif.g + dif.b * dif.b + dif.a * dif.a, 0); -} - -//---------------------------------------------------------------------------- - -inline bool Color4::fuzzyNe(const Color4& other) const { - Color4 dif = (*this - other); - return G3D::fuzzyNe(dif.r * dif.r + dif.g * dif.g + dif.b * dif.b + dif.a * dif.a, 0); -} - - -//---------------------------------------------------------------------------- -inline Color4& Color4::operator= (const Color4& other) { - r = other.r; - g = other.g; - b = other.b; - a = other.a; - return *this; -} - -//---------------------------------------------------------------------------- - -inline bool Color4::operator== (const Color4& other) const { - return ( r == other.r && g == other.g && b == other.b && a == other.a); -} - -//---------------------------------------------------------------------------- - -inline bool Color4::operator!= (const Color4& other) const { - return ( r != other.r || g != other.g || b != other.b || a != other.a); -} - -//---------------------------------------------------------------------------- -inline Color4 Color4::operator+ (const Color4& other) const { - return Color4(r + other.r, g + other.g, b + other.b, a + other.a); -} - -//---------------------------------------------------------------------------- -inline Color4 Color4::operator- (const Color4& other) const { - return Color4(r - other.r, g - other.g, b - other.b, a - other.a); -} - -//---------------------------------------------------------------------------- - -inline Color4 Color4::operator* (float fScalar) const { - return Color4(fScalar * r, fScalar * g, fScalar * b, fScalar * a); -} - -//---------------------------------------------------------------------------- - -inline Color4 Color4::operator- () const { - return Color4(-r, -g, -b, -a); -} - -//---------------------------------------------------------------------------- - -inline Color4 operator* (float fScalar, const Color4& other) { - return Color4(fScalar * other.r, fScalar * other.g, - fScalar * other.b, fScalar * other.a); -} - -//---------------------------------------------------------------------------- - -inline Color4& Color4::operator+= (const Color4& other) { - r += other.r; - g += other.g; - b += other.b; - a += other.a; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Color4& Color4::operator-= (const Color4& other) { - r -= other.r; - g -= other.g; - b -= other.b; - a -= other.a; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Color4& Color4::operator*= (float fScalar) { - r *= fScalar; - g *= fScalar; - b *= fScalar; - a *= fScalar; - return *this; -} - -} // namespace - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Color4& key) { - return key.hashCode(); - } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Color4uint8.h b/externals/g3dlite/G3D.lib/include/G3D/Color4uint8.h deleted file mode 100644 index 7804a6e1e51..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Color4uint8.h +++ /dev/null @@ -1,133 +0,0 @@ -/** - @file Color4uint8.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2003-04-07 - @edited 2006-03-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef COLOR4UINT8_H -#define COLOR4UINT8_H - -#include "G3D/g3dmath.h" -#include "G3D/platform.h" -#include "G3D/Color3uint8.h" - -namespace G3D { - -/** - Represents a Color4 as a packed integer. Convenient - for creating unsigned int vertex arrays. Used by - G3D::GImage as the underlying format. - - WARNING: Integer color formats are different than - integer vertex formats. The color channels are automatically - scaled by 255 (because OpenGL automatically scales integer - colors back by this factor). So Color4(1,1,1) == Color4uint8(255,255,255) - but Vector3(1,1,1) == Vector3int16(1,1,1). - - */ - -#ifdef G3D_WIN32 - // Switch to tight alignment - #pragma pack(push, 1) -#endif - -class Color4uint8 { -private: - // Hidden operators - bool operator<(const Color4uint8&) const; - bool operator>(const Color4uint8&) const; - bool operator<=(const Color4uint8&) const; - bool operator>=(const Color4uint8&) const; - -public: - uint8 r; - uint8 g; - uint8 b; - uint8 a; - - Color4uint8() : r(0), g(0), b(0), a(0) {} - - Color4uint8(const class Color4& c); - - Color4uint8(const uint8 _r, const uint8 _g, const uint8 _b, const uint8 _a) : r(_r), g(_g), b(_b), a(_a) {} - - Color4uint8(const Color3uint8& c, const uint8 _a) : r(c.r), g(c.g), b(c.b), a(_a) {} - - Color4uint8(class BinaryInput& bi); - - inline static Color4uint8 fromARGB(uint32 i) { - Color4uint8 c; - c.a = (i >> 24) & 0xFF; - c.r = (i >> 16) & 0xFF; - c.g = (i >> 8) & 0xFF; - c.b = i & 0xFF; - return c; - } - - inline uint32 asUInt32() const { - return ((uint32)a << 24) + ((uint32)r << 16) + ((uint32)g << 8) + b; - } - - // access vector V as V[0] = V.r, V[1] = V.g, V[2] = V.b - // - // WARNING. These member functions rely on - // (1) Color4uint8 not having virtual functions - // (2) the data packed in a 3*sizeof(uint8) memory block - G3D::uint8& operator[] (int i) const; - operator G3D::uint8* (); - operator const G3D::uint8* () const; - - - inline Color3uint8 bgr() const { - return Color3uint8(b, g, r); - } - - void serialize(class BinaryOutput& bo) const; - - void deserialize(class BinaryInput& bi); - - inline Color3uint8 rgb() const { - return Color3uint8(r, g, b); - } - - bool operator==(const Color4uint8& other) const { - return *reinterpret_cast(this) == *reinterpret_cast(&other); - } - - bool operator!=(const Color4uint8& other) const { - return *reinterpret_cast(this) != *reinterpret_cast(&other); - } - -} -#if defined(G3D_LINUX) || defined(G3D_OSX) - __attribute((aligned(1))) -#endif -; - -#ifdef G3D_WIN32 - #pragma pack(pop) -#endif - - -inline G3D::uint8& Color4uint8::operator[] (int i) const { - return ((G3D::uint8*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Color4uint8::operator G3D::uint8* () { - return (G3D::uint8*)this; -} - -inline Color4uint8::operator const G3D::uint8* () const { - return (G3D::uint8*)this; -} - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Cone.h b/externals/g3dlite/G3D.lib/include/G3D/Cone.h deleted file mode 100644 index c09b9b6846c..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Cone.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - @file Cone.h - - Cone class - - @maintainer Morgan McGuire, matrix@graphics3d.com - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-02-23 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_CONE_H -#define G3D_CONE_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" - -namespace G3D { - -/** - An infinite cone. - */ -class Cone { - -private: - Vector3 tip; - Vector3 direction; - - /** Angle from the center line to the edge. */ - float angle; - -public: - - /** - @param angle Angle from the center line to the edge, in radians - */ - Cone(const Vector3& tip, const Vector3& direction, float angle); - - /** - Forms the smallest cone that contains the box. Undefined if - the tip is inside or on the box. - */ - Cone(const Vector3& tip, const class Box& box); - - virtual ~Cone() {} - - /** - Returns true if the cone touches, intersects, or contains b. - - If c.intersects(s) and c.intersects(Sphere(s.center, s.radius * 2) - then the sphere s is entirely within cone c. - */ - bool intersects(const class Sphere& s) const; - - /** - True if v is a point inside the cone. - */ - bool contains(const class Vector3& v) const; -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/ConvexPolyhedron.h b/externals/g3dlite/G3D.lib/include/G3D/ConvexPolyhedron.h deleted file mode 100644 index 6ae9ba136ff..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/ConvexPolyhedron.h +++ /dev/null @@ -1,179 +0,0 @@ -/** - @file ConvexPolyhedron.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-11-11 - @edited 2006-04-10 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_CONVEXPOLYHEDRON_H -#define G3D_CONVEXPOLYHEDRON_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Plane.h" -#include "G3D/Line.h" -#include "G3D/Array.h" - -namespace G3D { - -class DirectedEdge { -public: - Vector3 start; - Vector3 stop; -}; - -class ConvexPolygon { -private: - - friend class ConvexPolyhedron; - - Array _vertex; - -public: - - ConvexPolygon() {} - ConvexPolygon(const Array& __vertex); - virtual ~ConvexPolygon() {} - - /** - Counter clockwise winding order. - */ - inline const Vector3& vertex(int i) const { - return _vertex[i]; - } - - inline void setVertex(int i, const Vector3& v) { - _vertex[i] = v; - } - - /** - Zero vertices indicates an empty polygon (zero area). - */ - inline int numVertices() const { - return _vertex.size(); - } - - inline void setNumVertices(int n) { - _vertex.resize(n); - } - - /** - O(n) in the number of edges - */ - bool isEmpty() const; - - /** - Cuts the polygon at the plane. If the polygon is entirely above or below - the plane, one of the returned polygons will be empty. - - @param above The part of the polygon above (on the side the - normal points to or in the plane) the plane - @param below The part of the polygon below the plane. - @param newEdge If a new edge was introduced, this is that edge (on the above portion; the below portion is the opposite winding. - */ - void cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below, DirectedEdge& newEdge); - void cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below); - - /** - When a cut plane grazes a vertex in the polygon, two near-identical vertices may be created. - The closeness of these two points can cause a number of problems, such as ConvexPolygon::normal() - returning an infinite vector. It should be noted, however, that not all applications are - sensitive to near-identical vertices. - - removeDuplicateVertices() detects and eliminates redundant vertices. - */ - void removeDuplicateVertices(); - - /** - O(n) in the number of edges - */ - float getArea() const; - - inline Vector3 normal() const { - debugAssert(_vertex.length() >= 3); - return (_vertex[1] - _vertex[0]).cross(_vertex[2] - _vertex[0]).direction(); - } - - /** - Returns the same polygon with inverse winding. - */ - ConvexPolygon inverse() const; -}; - - - -class ConvexPolyhedron { -public: - /** - Zero faces indicates an empty polyhedron - */ - Array face; - - ConvexPolyhedron() {} - ConvexPolyhedron(const Array& _face); - - /** - O(n) in the number of edges - */ - bool isEmpty() const; - - /** - O(n) in the number of edges - */ - float getVolume() const; - - /** - Cuts the polyhedron at the plane. If the polyhedron is entirely above or below - the plane, one of the returned polyhedra will be empty. - - @param above The part of the polyhedron above (on the side the - normal points to or in the plane) the plane - @param below The part of the polyhedron below the plane. - */ - void cut(const Plane& plane, ConvexPolyhedron &above, ConvexPolyhedron &below); -}; - -/** - - */ -class ConvexPolygon2D { -private: - - Array m_vertex; - -public: - - ConvexPolygon2D() {} - - /** - Points are counter-clockwise in a Y = down, X = right coordinate - system. - - @param reverse If true, the points are reversed (i.e. winding direction is changed) - before the polygon is created. - */ - ConvexPolygon2D(const Array& pts, bool reverse = false); - - inline int numVertices() const { - return m_vertex.size(); - } - - inline const Vector2& vertex(int index) const { - debugAssert((index >= 0) && (index <= m_vertex.size())); - return m_vertex[index]; - } - - /** @param reverseWinding If true, the winding direction of the polygon is reversed for this test.*/ - bool contains(const Vector2& p, bool reverseWinding = false) const; -}; - - -} // namespace -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/CoordinateFrame.h b/externals/g3dlite/G3D.lib/include/G3D/CoordinateFrame.h deleted file mode 100644 index 705c6c93ae2..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/CoordinateFrame.h +++ /dev/null @@ -1,315 +0,0 @@ -/** - @file CoordinateFrame.h - - @maintainer Morgan McGuire, morgan@cs.williams.edu - - @created 2001-03-04 - @edited 2008-07-14 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_COORDINATEFRAME_H -#define G3D_COORDINATEFRAME_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Matrix3.h" -#include "G3D/Array.h" -#include -#include -#include -#include -#include - -namespace G3D { - -/** - A rigid body RT (rotation-translation) transformation. - -CoordinateFrame abstracts a 4x4 matrix that maps object space to world space: - - v_world = C * v_object - -CoordinateFrame::rotation is the upper 3x3 submatrix, CoordinateFrame::translation -is the right 3x1 column. The 4th row is always [0 0 0 1], so it isn't stored. -So you don't have to remember which way the multiplication and transformation work, -it provides explicit toWorldSpace and toObjectSpace methods. Also, points, vectors -(directions), and surface normals transform differently, so they have separate methods. - -Some helper functions transform whole primitives like boxes in and out of object space. - -Convert to Matrix4 using CoordinateFrame::toMatrix4. You can construct a CoordinateFrame -from a Matrix4 using Matrix4::approxCoordinateFrame, however, because a Matrix4 is more -general than a CoordinateFrame, some information may be lost. - -@sa G3D::UprightFrame, G3D::PhysicsFrame, G3D::Matrix4, G3D::Quat -*/ -class CoordinateFrame { -public: - - /** Takes object space points to world space. */ - Matrix3 rotation; - - /** Takes object space points to world space. */ - Vector3 translation; - - inline bool operator==(const CoordinateFrame& other) const { - return (translation == other.translation) && (rotation == other.rotation); - } - - inline bool operator!=(const CoordinateFrame& other) const { - return !(*this == other); - } - - bool fuzzyEq(const CoordinateFrame& other) const; - - bool fuzzyIsIdentity() const; - - bool isIdentity() const; - - /** - Initializes to the identity coordinate frame. - */ - inline CoordinateFrame() : - rotation(Matrix3::identity()), translation(Vector3::zero()) { - } - - CoordinateFrame(const Vector3& _translation) : - rotation(Matrix3::identity()), translation(_translation) { - } - - CoordinateFrame(const Matrix3 &rotation, const Vector3 &translation) : - rotation(rotation), translation(translation) { - } - - CoordinateFrame(const Matrix3 &rotation) : - rotation(rotation), translation(Vector3::zero()) { - } - - CoordinateFrame(const class UprightFrame& f); - - static CoordinateFrame fromXYZYPRRadians(float x, float y, float z, float yaw = 0.0f, float pitch = 0.0f, float roll = 0.0f); - - /** Construct a coordinate frame from translation = (x,y,z) and - rotations (in that order) about Y, object space X, object space - Z. Note that because object-space axes are used, these are not - equivalent to Euler angles; they are known as Tait-Bryan - rotations and are more convenient for intuitive positioning.*/ - static CoordinateFrame fromXYZYPRDegrees(float x, float y, float z, float yaw = 0.0f, float pitch = 0.0f, float roll = 0.0f); - - CoordinateFrame(class BinaryInput& b); - - void deserialize(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - - CoordinateFrame(const CoordinateFrame &other) : - rotation(other.rotation), translation(other.translation) {} - - /** - Computes the inverse of this coordinate frame. - */ - inline CoordinateFrame inverse() const { - CoordinateFrame out; - out.rotation = rotation.transpose(); - out.translation = -out.rotation * translation; - return out; - } - - inline ~CoordinateFrame() {} - - /** See also Matrix4::approxCoordinateFrame */ - class Matrix4 toMatrix4() const; - - void getXYZYPRRadians(float& x, float& y, float& z, float& yaw, float& pitch, float& roll) const; - void getXYZYPRDegrees(float& x, float& y, float& z, float& yaw, float& pitch, float& roll) const; - - - /** - Produces an XML serialization of this coordinate frame. - @deprecated - */ - std::string toXML() const; - - /** - Returns the heading of the lookVector as an angle in radians relative to - the world -z axis. That is, a counter-clockwise heading where north (-z) - is 0 and west (-x) is PI/2. - - Note that the heading ignores the Y axis, so an inverted - object has an inverted heading. - */ - inline float getHeading() const { - Vector3 look = rotation.getColumn(2); - float angle = -(float) atan2(-look.x, look.z); - return angle; - } - - /** - Takes the coordinate frame into object space. - this->inverse() * c - */ - inline CoordinateFrame toObjectSpace(const CoordinateFrame& c) const { - return this->inverse() * c; - } - - inline Vector4 toObjectSpace(const Vector4& v) const { - return this->inverse().toWorldSpace(v); - } - - inline Vector4 toWorldSpace(const Vector4& v) const { - return Vector4(rotation * Vector3(v.x, v.y, v.z) + translation * v.w, v.w); - } - - /** - Transforms the point into world space. - */ - inline Vector3 pointToWorldSpace(const Vector3& v) const { - return Vector3( - rotation[0][0] * v[0] + rotation[0][1] * v[1] + rotation[0][2] * v[2] + translation[0], - rotation[1][0] * v[0] + rotation[1][1] * v[1] + rotation[1][2] * v[2] + translation[1], - rotation[2][0] * v[0] + rotation[2][1] * v[1] + rotation[2][2] * v[2] + translation[2]); - } - - /** - Transforms the point into object space. Assumes that the rotation matrix is orthonormal. - */ - inline Vector3 pointToObjectSpace(const Vector3& v) const { - float p[3]; - p[0] = v[0] - translation[0]; - p[1] = v[1] - translation[1]; - p[2] = v[2] - translation[2]; - debugAssert(G3D::fuzzyEq(rotation.determinant(), 1.0f)); - return Vector3( - rotation[0][0] * p[0] + rotation[1][0] * p[1] + rotation[2][0] * p[2], - rotation[0][1] * p[0] + rotation[1][1] * p[1] + rotation[2][1] * p[2], - rotation[0][2] * p[0] + rotation[1][2] * p[1] + rotation[2][2] * p[2]); - } - - /** - Transforms the vector into world space (no translation). - */ - inline Vector3 vectorToWorldSpace(const Vector3& v) const { - return rotation * v; - } - - inline Vector3 normalToWorldSpace(const Vector3& v) const { - return rotation * v; - } - - class Ray toObjectSpace(const Ray& r) const; - - Ray toWorldSpace(const Ray& r) const; - - /** - Transforms the vector into object space (no translation). - */ - inline Vector3 vectorToObjectSpace(const Vector3 &v) const { - // Multiply on the left (same as rotation.transpose() * v) - return v * rotation; - } - - inline Vector3 normalToObjectSpace(const Vector3 &v) const { - // Multiply on the left (same as rotation.transpose() * v) - return v * rotation; - } - - void pointToWorldSpace(const Array& v, Array& vout) const; - - void normalToWorldSpace(const Array& v, Array& vout) const; - - void vectorToWorldSpace(const Array& v, Array& vout) const; - - void pointToObjectSpace(const Array& v, Array& vout) const; - - void normalToObjectSpace(const Array& v, Array& vout) const; - - void vectorToObjectSpace(const Array& v, Array& vout) const; - - class Box toWorldSpace(const class AABox& b) const; - - class Box toWorldSpace(const class Box& b) const; - - class Cylinder toWorldSpace(const class Cylinder& b) const; - - class Capsule toWorldSpace(const class Capsule& b) const; - - class Plane toWorldSpace(const class Plane& p) const; - - class Sphere toWorldSpace(const class Sphere& b) const; - - class Triangle toWorldSpace(const class Triangle& t) const; - - class Box toObjectSpace(const AABox& b) const; - - class Box toObjectSpace(const Box& b) const; - - class Plane toObjectSpace(const Plane& p) const; - - class Sphere toObjectSpace(const Sphere& b) const; - - Triangle toObjectSpace(const Triangle& t) const; - - /** Compose: create the transformation that is other followed by this.*/ - CoordinateFrame operator*(const CoordinateFrame &other) const { - return CoordinateFrame(rotation * other.rotation, - pointToWorldSpace(other.translation)); - } - - CoordinateFrame operator+(const Vector3& v) const { - return CoordinateFrame(rotation, translation + v); - } - - CoordinateFrame operator-(const Vector3& v) const { - return CoordinateFrame(rotation, translation - v); - } - - void lookAt(const Vector3& target); - - void lookAt( - const Vector3& target, - Vector3 up); - - /** The direction this camera is looking (its negative z axis)*/ - inline Vector3 lookVector() const { - return -rotation.getColumn(2); - } - - /** Returns the ray starting at the camera origin travelling in direction CoordinateFrame::lookVector. */ - class Ray lookRay() const; - - /** Up direction for this camera (its y axis). */ - inline Vector3 upVector() const { - return rotation.getColumn(1); - } - - inline Vector3 rightVector() const { - return rotation.getColumn(0); - } - - /** - If a viewer looks along the look vector, this is the viewer's "left". - Useful for strafing motions and building alternative coordinate frames. - */ - inline Vector3 leftVector() const { - return -rotation.getColumn(0); - } - - /** - Linearly interpolates between two coordinate frames, using - Quat::slerp for the rotations. - */ - CoordinateFrame lerp( - const CoordinateFrame& other, - float alpha) const; - -}; - -typedef CoordinateFrame CFrame; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Crypto.h b/externals/g3dlite/G3D.lib/include/G3D/Crypto.h deleted file mode 100644 index f8266b8721b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Crypto.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - @file Crypto.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - - @created 2006-03-29 - @edited 2006-04-06 - */ - -#ifndef G3D_CRYPTO_H -#define G3D_CRYPTO_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include - -namespace G3D { - -/** See G3D::Crypto::md5 */ -class MD5Hash { -private: - - uint8 value[16]; - -public: - - MD5Hash() { - for (int i = 0; i < 16; ++i) { - value[i] = 0; - } - } - - explicit MD5Hash(class BinaryInput& b); - - uint8& operator[](int i) { - return value[i]; - } - - const uint8& operator[](int i) const { - return value[i]; - } - - bool operator==(const MD5Hash& other) const { - bool match = true; - for (int i = 0; i < 16; ++i) { - match = match && (other.value[i] == value[i]); - } - return match; - } - - inline bool operator!=(const MD5Hash& other) const { - return !(*this == other); - } - - void deserialize(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; -}; - - -/** Cryptography and hashing helper functions */ -class Crypto { -public: - - /** - Computes the CRC32 value of a byte array. CRC32 is designed to be a hash - function that produces different values for similar strings. - - This implementation is compatible with PKZIP and GZIP. - - Based on http://www.gamedev.net/reference/programming/features/crc32/ - */ - static uint32 crc32(const void* bytes, size_t numBytes); - - /** - Computes the MD5 hash (message digest) of a byte stream, as defined by - http://www.ietf.org/rfc/rfc1321.txt. - - @cite Based on implementation by L. Peter Deutsch, ghost@aladdin.com - */ - MD5Hash md5(const void* bytes, size_t numBytes); - - /** - Returns the nth prime less than 2000 in constant time. The first prime has index - 0 and is the number 2. - */ - static int smallPrime(int n); - - /** Returns 1 + the largest value that can be passed to smallPrime. */ - static int numSmallPrimes(); -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Cylinder.h b/externals/g3dlite/G3D.lib/include/G3D/Cylinder.h deleted file mode 100644 index c341d29a2b9..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Cylinder.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - @file Cylinder.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-07 - @edited 2005-09-26 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_Cylinder_H -#define G3D_Cylinder_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Line; -class AABox; -/** - Right cylinder - */ -class Cylinder { -private: - Vector3 p1; - Vector3 p2; - - float mRadius; - -public: - - /** Uninitialized */ - Cylinder(); - Cylinder(class BinaryInput& b); - Cylinder(const Vector3& _p1, const Vector3& _p2, float _r); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** The line down the center of the Cylinder */ - Line axis() const; - - /** - A reference frame in which the center of mass is at the origin and - the Y-axis is the cylinder's axis. If the cylinder is transformed, this reference frame - may freely rotate around its axis.*/ - void getReferenceFrame(class CoordinateFrame& cframe) const; - - /** Returns point 0 or 1 */ - inline const Vector3& point(int i) const { - debugAssert(i >= 0 && i <= 1); - return (i == 0) ? p1 : p2; - } - - /** - Returns true if the point is inside the Cylinder or on its surface. - */ - bool contains(const Vector3& p) const; - - float area() const; - - float volume() const; - - float radius() const; - - /** Center of mass */ - inline Vector3 center() const { - return (p1 + p2) / 2.0f; - } - - inline float height() const { - return (p1 - p2).magnitude(); - } - - /** - Get close axis aligned bounding box. - With vertical world orientation, the top and bottom might not be very tight. */ - void getBounds(AABox& out) const; - - /** Random world space point with outward facing normal. */ - void getRandomSurfacePoint(Vector3& P, Vector3& N) const; - - /** Point selected uniformly at random over the volume. */ - Vector3 randomInteriorPoint() const; -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Discovery.h b/externals/g3dlite/G3D.lib/include/G3D/Discovery.h deleted file mode 100644 index acd1c2c01d0..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Discovery.h +++ /dev/null @@ -1,589 +0,0 @@ -/** - @file Discovery.h - -

Discovery

- Discovery is the process by which computers on a Local Area Network (LAN) find - one another. The Discovery API allows clients to make a list of servers running - the same application. The application typically presents this list to the user - so he can choose which server to connect to. -

- Features of the Discovery API: -

- Low network traffic -
- Broadcasts mainly occur only when a new machine enters/leaves the network -
Responsive -
- Servers appear immediately after launching -
- Servers disappear immedatiately after they shut down -
Extensible -
- Add your own game information (e.g. score, num players, map name) -
Versioned -
- Tracks incompatible servers so end-users know to upgrade their client/server - -

Using the Discovery API

- - Subclass DiscoveryAdvertisement to add fields describing a server running your - application. For a game, these might be the current map name and the number - of players. -

- On the client, create an instance of DiscoveryClient. - On the server, create an instance of DiscoveryServer and initialize it with an - instance of your advertisement subclass. From your main loop, call doNetwork() - on the client and server instances. When your server shuts down, invoke cleanup() - on it. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-06-26 - @edited 2008-11-24 - */ - -#ifndef G3D_DISCOVERY_H -#define G3D_DISCOVERY_H - -#include "G3D/platform.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/NetworkDevice.h" -#include "G3D/Log.h" -#include - -/** - Different versions of G3D discovery protocols can't communicate with each other. - */ -#define G3D_DISCOVERY_PROTOCOL_NAME "G3D DISC" -#define G3D_DISCOVERY_PROTOCOL_VERSION 1 - -namespace G3D { - -/** - If a machine is running two different programs using discovery they - must have different ports. However different programs can share the - same ports if they run on the same LAN with different servers. - - @deprecated See Discovery2::Settings - */ -class DiscoverySettings { -public: - - /** - Name of the program using discovery; used so that mutliple - programs can use the same discovery ports on the same network. - */ - const char* appProtocolName; - - /** - Version of the network protocol of the program using discovery. - Used so that discovery can identify incompatible versions of - the server. - */ - int appProtocolVersion; - - /** - Port on which the server broadcasts its identity. The client - and server must agree on this value. - */ - uint16 serverBroadcastPort; - - /** - Port on which the client broadcasts a server request. The client - and server must agree on this value. - */ - uint16 clientBroadcastPort; - - /** - Clients connect into this port using a reliable conduit - to receive the advertisement from a server. The client - doesn't look at this value; it uses whatever the server - sends it. - */ - uint16 serverAdvertisementPort; - - /** - You can use the default G3D discovery ports as long as no other - program with the same protocol name is using this port. You - can run two different G3D discovery programs on the same - two ports as long as they have different application protocol - strings. - */ - DiscoverySettings( - const char* _appProtocolName, - int _appProtocolVersion, - uint16 _serverBroadcast = 6173, - uint16 _clientBroadcast = 6174, - uint16 _serverAdvertisementPort = 6175) : - appProtocolName(_appProtocolName), - appProtocolVersion(_appProtocolVersion), - serverBroadcastPort(_serverBroadcast), - clientBroadcastPort(_clientBroadcast), - serverAdvertisementPort(_serverAdvertisementPort) {} -}; - -/** - Make your own subclass of this advertisement. Add fields - (e.g. numPlayers, currentScore) to increase the amount - of information advertised. - - Overrides must provide a default constructor. - @deprecated See Discovery2::Settings - */ -class DiscoveryAdvertisement { -public: - - /** - Address to connect to on the server for the actual game. - The IP portion is ignored (the client figures out the IP - address from the packet itself) but the port is essential. - Note that this port must not be the discovery port. - */ - NetAddress address; - - /** - (Only used on the client) - Time since this advertisement was updated. - */ - RealTime lastUpdateTime; - - /** - Overrides must call DiscoveryAdvertisement::serialize(b) first. - */ - virtual void serialize(BinaryOutput& b) const; - - /** - Overrides must call DiscoveryAdvertisement::deserialize(b) first. - */ - virtual void deserialize(BinaryInput& b); - - /** - An empty virtual destructor for virtual methods. - */ - virtual ~DiscoveryAdvertisement() {} -}; - - -/** - Sent by servers to describe their location. - */ -class DiscoveryServerAddressMessage { -public: - - /** - Not part of the message; these settings are used to determine - if the correct protocol is being used. - */ - const DiscoverySettings* settings; - - - /** - Set to true if this server is running the correct protocol. - */ - bool correctProtocol; - - /** - This is set during the serialize process from the server's settings. - If different from the client's settings the discovery system will - classify this server as incompatible. - */ - int serverProtocolVersion[2]; - - Array address; - - DiscoveryServerAddressMessage() {} - DiscoveryServerAddressMessage(const DiscoverySettings* s) : settings(s) {} - - void serialize(BinaryOutput& b) const; - - void deserialize(BinaryInput& b); -}; - - -/** - Base class for DiscoveryClient and DiscoveryServer. - */ -class Discovery { -public: - - const DiscoverySettings* settings; - - enum { - SERVER_SHUTDOWN_MESSAGE = 2, - SERVER_BROADCAST_MESSAGE = 3, - CLIENT_BROADCAST_MESSAGE = 4}; - - /** - Only called from subclasses. - */ - virtual void init( - const DiscoverySettings* _settings) { - settings = _settings; - } - - /** - An empty virtual destructor for virtual methods. - */ - virtual ~Discovery() {} -}; - -/** @deprecated See Discovery2::Server*/ -class DiscoveryServer : private Discovery { -private: - - class ShutdownMessage { - public: - void serialize(BinaryOutput& b) const { (void)b; } - - void deserialize(BinaryInput& b) { (void)b; } - }; - - /** - For broadcast. - */ - LightweightConduitRef net; - - /** - Listen for clients wanting to hear the advertisement over - a reliable connection. - */ - NetListenerRef listener; - - DiscoveryAdvertisement* advertisement; - - /** - Broadcast across the lightweight conduit. - */ - DiscoveryServerAddressMessage addressMessage; - - /** - Servers periodically broadcast (unsolicited) in case - anyone missed the previous message. - */ - RealTime lastBroadcast; - - void sendAnnouncement() const; - - void sendShutDown() const; - -public: - - /** - You may update the advertisement (synchronously with calling doNetwork) - after it has been passed in. This allows a server to change the advertised - number of players or score for a game, for example. - - You must set the port of the @a _advertisement G3D::DiscoveryAdvertisement::address - to the port which the G3D::NetListener for the actual program protocol (not discovery) - is running. That field how the client knows what address to connect to using - G3D::ReliableConduit or G3D::LightweightConduit to actually initiate communication. - */ - virtual void init( - const DiscoverySettings* _settings, - DiscoveryAdvertisement* _advertisement); - - /** Returns the broadcast address in use.*/ - NetAddress broadcastAddress() const; - - /** - Returns true if this discovery server has been initialized - and is functioning properly. - */ - bool ok() const; - - /** - Call periodically to let the server do its job. - */ - void doNetwork(); - - /** - Broadcast a shutdown message. - */ - void cleanup(); -}; - - -/** - Used by DiscoveryClient to report servers running a different version - of this application's protocol. - */ -class IncompatibleServerDescription { -public: - NetAddress address; - int protocolVersion[2]; - RealTime lastUpdateTime; - - std::string toString() const; -}; - - -/** - Only one DiscoveryClient can be active on a given port at a time on - a single computer. - - AdType must be a subclass of DiscoveryAdvertisement. - - @deprecated See Discovery2::Client - */ -template -class DiscoveryClient : private Discovery { -public: - - /** - List of servers. Do not access on a second thread while in - doNetwork. - */ - Array serverList; - - /** - List of servers running the same application but a different protocol. - It is useful to show these to users to help them recognize version - conflicts between client and server. - Do not access on a second thread while in doNetwork. - */ - Array incompatibleServerList; - -private: - - class BroadcastMessage { - public: - void serialize(BinaryOutput& b) const {} - - void deserialize(BinaryInput& b) {} - }; - - /** - The client periodically checks servers to make sure they are still up - and to update its information about them. - */ - RealTime lastServerCheck; - - LightweightConduitRef net; - - /** - Returns an index in serverList of the server with the given address. - Returns -1 if there is none. Only checks IP addresses. - */ - int findServerListIndex(const NetAddress& addr) const { - for (int i = 0; i < serverList.size(); ++i) { - if (addr.ip() == serverList[i].address.ip()) { - return i; - } - } - - return -1; - } - - /** - Returns true if this discovery client has been initialized - and is functioning properly. - */ - bool ok() const { - return net->ok(); - } - - /** - Adds a server to the incompatible list if it is not already there. - */ - void addToIncompatibleList(const NetAddress& addr, uint32 p0, uint32 p1) { - const RealTime now = System::time(); - - bool alreadyHere = false; - - // Incorrect protocol; add to the incompatible list - for (int i = 0; i < incompatibleServerList.size(); ++i) { - IncompatibleServerDescription& server = incompatibleServerList[i]; - - if (server.address == addr) { - server.lastUpdateTime = now; - alreadyHere = true; - break; - } - } - - if (! alreadyHere) { - IncompatibleServerDescription server; - - server.lastUpdateTime = now; - server.address = addr; - server.protocolVersion[0] = p0; - server.protocolVersion[1] = p1; - - incompatibleServerList.append(server); - } - } - - /** - Connects to the specified server, reads its advertisement, - and adds it to the active server list. Returns true if the server - can be reached. - */ - bool readAdvertisement(const NetAddress& address) { - std::string hostname = address.toString(); - - RealTime TIMEOUT = 2.0; - - ReliableConduitRef server = ReliableConduit::create(address); - - if (! server->ok()) { - return false; - } - - AdType advertisement; - - // Read the advertisement - RealTime stopWaiting = System::time() + TIMEOUT; - bool timedOut = false; - - while (! server->messageWaiting() && ! timedOut && server->ok()) { - System::sleep(0.1); - timedOut = (System::time() > stopWaiting); - } - - if (timedOut) { - Log::common()->printf("Discovery: Timed out while reading advertisment from %s\n", - hostname.c_str()); - return false; - } - - - if (! server->ok()) { - Log::common()->printf("Discovery: Server %s dropped connection\n", hostname.c_str()); - return false; - } - - // Read the advertisement - debugAssert(server->messageWaiting()); - if (! server->receive(advertisement)) { - Log::common()->printf("Discovery: Server %s failed to send advertisement\n", hostname.c_str()); - return false; - } - - // Update existing server info or create a new entry - int index = findServerListIndex(address); - if (index == -1) { - index = serverList.size(); - serverList.resize(index + 1); - } - - // Update element index - advertisement.address = address; - serverList[index] = advertisement; - - return true; - } - - /** - Remove this address from our list if we previously - had a server there. - */ - void removeServer(const NetAddress& address) { - int index = findServerListIndex(address); - if (index > -1) { - serverList.fastRemove(index); - } - } - - /** - Tries to connect to the server through the addresses in the array. - */ - void addToServerList(const Array& addressArray) { - // Try to connect to each address listed - for (int a = addressArray.size() - 1; a >= 0; --a) { - const NetAddress& address = addressArray[a]; - - if (readAdvertisement(address)) { - // We've connected to the server - break; - } else { - removeServer(address); - } - } - } - - void checkRandomServer() { - if (serverList.size() >= 1) { - int index = iRandom(0, serverList.size() - 1); - - Array address; - address.append(serverList[index].address); - - // Remove this server - serverList.fastRemove(index); - - // Add it back with new info (or leave it removed if no response) - addToServerList(address); - } - } - -public: - - void init( - const DiscoverySettings* _settings) { - - Discovery::init(_settings); - - lastServerCheck = System::time(); - - net = LightweightConduit::create(settings->serverBroadcastPort, true, true); - - // Send announcement - NetAddress broadcast(NetworkDevice::instance()->broadcastAddressArray()[0], - settings->clientBroadcastPort); - BroadcastMessage tmp; - net->send(broadcast, CLIENT_BROADCAST_MESSAGE, tmp); - } - - /** Shut down the discovery client. */ - void cleanup() { - net = NULL; - } - - /** - Call this regularly (several times per second) to - update the server list. Not threadsafe-- you must not touch - the server list while this is running. This will not block. - */ - void doNetwork() { - if (net->messageWaiting()) { - NetAddress sender; - - switch (net->waitingMessageType()) { - case SERVER_SHUTDOWN_MESSAGE: - // Remove the server - net->receive(sender); - removeServer(sender); - break; - - case SERVER_BROADCAST_MESSAGE: - // Check the G3D protocol and the network protocol, then read the ad - DiscoveryServerAddressMessage msg(settings); - net->receive(sender, msg); - - if (msg.correctProtocol && (msg.address.size() > 0)) { - // Add the actual return address as the first one to be tried. - msg.address.append(NetAddress(sender.ip(), msg.address[0].port())); - - addToServerList(msg.address); - - } else { - - addToIncompatibleList( - sender, - msg.serverProtocolVersion[0], - msg.serverProtocolVersion[1]); - } - break; - } - } - - // Periodically re-check servers in the list to see if they crashed - // (if they shut down, they should have broadcast a shut down message). - RealTime now = System::time(); - const RealTime UPDATE_TIME_INTERVAL = 30; - - if (now > lastServerCheck + UPDATE_TIME_INTERVAL) { - lastServerCheck = now; - checkRandomServer(); - } - } -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/EqualsTrait.h b/externals/g3dlite/G3D.lib/include/G3D/EqualsTrait.h deleted file mode 100644 index acf17615b45..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/EqualsTrait.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - @file EqualsTrait.h - - @maintainer Morgan McGuire, morgan@cs.williams.edu - @created 2008-10-01 - @edited 2008-10-01 - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_EQUALSTRAIT_H -#define G3D_EQUALSTRAIT_H - -#include "G3D/platform.h" - -/** Default implementation of EqualsTrait. - @see G3D::Table for specialization requirements. -*/ -template struct EqualsTrait { - static bool equals(const Key& a, const Key& b) { - return a == b; - } -}; - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/G3D.h b/externals/g3dlite/G3D.lib/include/G3D/G3D.h deleted file mode 100644 index 42ab18e2c24..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/G3D.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - @file graphics3D.h - - This header includes all of the graphics3D libraries in - appropriate namespaces. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-08-25 - @edited 2008-11-01 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_GRAPHICS3D_H -#define G3D_GRAPHICS3D_H - -#define NOMINMAX 1 -#ifdef min - #undef min -#endif -#ifdef max - #undef max -#endif - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Queue.h" -#include "G3D/Crypto.h" -#include "G3D/format.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" -#include "G3D/Matrix2.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/PhysicsFrame.h" -#include "G3D/Plane.h" -#include "G3D/Line.h" -#include "G3D/Ray.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/AABox.h" -#include "G3D/WrapMode.h" -#include "G3D/Cone.h" -#include "G3D/Quat.h" -#include "G3D/stringutils.h" -#include "G3D/prompt.h" -#include "G3D/Table.h" -#include "G3D/Set.h" -#include "G3D/GUniqueID.h" -#include "G3D/BinaryFormat.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/debug.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/g3dmath.h" -#include "G3D/uint128.h" -#include "G3D/fileutils.h" -#include "G3D/ReferenceCount.h" - -template struct HashTrait< G3D::ReferenceCountedPointer > { - static size_t hashCode(G3D::ReferenceCountedPointer key) { return reinterpret_cast( key.pointer() ); } -}; - -#include "G3D/GImage.h" -#include "G3D/CollisionDetection.h" -#include "G3D/Log.h" -#include "G3D/serialize.h" -#include "G3D/TextInput.h" -#include "G3D/NetAddress.h" -#include "G3D/NetworkDevice.h" -#include "G3D/System.h" -#include "G3D/splinefunc.h" -#include "G3D/Spline.h" -#include "G3D/UprightFrame.h" -#include "G3D/LineSegment.h" -#include "G3D/Capsule.h" -#include "G3D/Cylinder.h" -#include "G3D/Triangle.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color4uint8.h" -#include "G3D/Vector2int16.h" -#include "G3D/Vector3int16.h" -#include "G3D/Vector3int32.h" -#include "G3D/Vector4int8.h" -#include "G3D/ConvexPolyhedron.h" -#include "G3D/Discovery.h" -#include "G3D/MeshAlg.h" -#include "G3D/vectorMath.h" -#include "G3D/Rect2D.h" -#include "G3D/GCamera.h" -#include "G3D/GLight.h" -#include "G3D/AABSPTree.h" -#include "G3D/PointAABSPTree.h" -#include "G3D/TextOutput.h" -#include "G3D/MeshBuilder.h" -#include "G3D/Stopwatch.h" -#include "G3D/AtomicInt32.h" -#include "G3D/GThread.h" -#include "G3D/ThreadSet.h" -#include "G3D/RegistryUtil.h" -#include "G3D/AnyVal.h" -#include "G3D/PointHashGrid.h" -#include "G3D/Map2D.h" -#include "G3D/Image1.h" -#include "G3D/Image1uint8.h" -#include "G3D/Image3.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image4.h" -#include "G3D/Image4uint8.h" -#include "G3D/filter.h" -#include "G3D/WeakCache.h" -#include "G3D/Pointer.h" -#include "G3D/Matrix.h" -#include "G3D/ImageFormat.h" - -#ifdef _MSC_VER -# pragma comment(lib, "zlib") -# pragma comment(lib, "ws2_32") -# pragma comment(lib, "winmm") -# pragma comment(lib, "imagehlp") -# pragma comment(lib, "gdi32") -# pragma comment(lib, "user32") -# pragma comment(lib, "kernel32") -# pragma comment(lib, "version") -# pragma comment(lib, "advapi32") -# pragma comment(lib, "png") -# pragma comment(lib, "jpeg") -# pragma comment(lib, "zip") -# ifdef _DEBUG - // Don't link against G3D when building G3D itself. -# ifndef G3D_BUILDING_LIBRARY_DLL -# pragma comment(lib, "G3Dd.lib") -# endif -# else - // Don't link against G3D when building G3D itself. -# ifndef G3D_BUILDING_LIBRARY_DLL -# pragma comment(lib, "G3D.lib") -# endif -# endif -#endif - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/G3DAll.h b/externals/g3dlite/G3D.lib/include/G3D/G3DAll.h deleted file mode 100644 index feba3d6d390..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/G3DAll.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - @file G3DAll.h - - Includes all G3D and GLG3D files and uses the G3D namespace. - - This requires OpenGL and SDL headers. If you don't want all of this, - #include separately. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-01-01 - @edited 2006-08-13 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_G3DALL_H -#define G3D_G3DALL_H - -#include "G3D/G3D.h" -#include "GLG3D/GLG3D.h" - -using namespace G3D; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/G3DGameUnits.h b/externals/g3dlite/G3D.lib/include/G3D/G3DGameUnits.h deleted file mode 100644 index bc4c873f290..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/G3DGameUnits.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - @file G3DGameUnits.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - @created 2002-10-05 - @edited 2006-11-10 - */ - -#ifndef G3D_GAMEUNITS_H -#define G3D_GAMEUNITS_H - -#include "G3D/platform.h" - -namespace G3D { -/** - Time, in seconds. - */ -typedef double GameTime; -typedef double SimTime; - -/** - Actual wall clock time in seconds. - */ -typedef double RealTime; - -enum AMPM {AM, PM}; - -enum {SECOND=1, MINUTE=60, HOUR = 60*60, DAY=24*60*60, SUNRISE=24*60*60/4, SUNSET=24*60*60*3/4, MIDNIGHT=0, METER=1, KILOMETER=1000}; - -#define CENTIMETER (0.01) -#define DECIMETER (0.1) - -/** - Converts a 12 hour clock time into the number of seconds since - midnight. Note that 12:00 PM is noon and 12:00 AM is midnight. - - Example: toSeconds(10, 00, AM) - */ -SimTime toSeconds(int hour, int minute, double seconds, AMPM ap); -SimTime toSeconds(int hour, int minute, AMPM ap); - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/GCamera.h b/externals/g3dlite/G3D.lib/include/G3D/GCamera.h deleted file mode 100644 index 4dfa500883b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/GCamera.h +++ /dev/null @@ -1,294 +0,0 @@ -/** - @file GCamera.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2005-07-20 - @edited 2007-07-24 -*/ - -#ifndef G3D_GCamera_H -#define G3D_GCamera_H - -#include "G3D/platform.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Vector3.h" -#include "G3D/Plane.h" -#include "G3D/debugAssert.h" - -namespace G3D { - -class Matrix4; -class Rect2D; - -/** - Abstraction of a pinhole camera. - - The area a camera sees is called a frustum. It is bounded by the near plane, the far plane, and the sides - of the view frame projected into the scene. It has the shape of a pyramid with the top cut off. - - Cameras can project points from 3D to 2D. The "unit" projection matches OpenGL. It maps the entire view frustum - to a cube of unit radius (i.e., edges of length 2) centered at the origin. The non-unit projection then maps - that cube to the specified pixel viewport in X and Y and the range [0, 1] in Z. The projection is reversable - as long as the projected Z value is known. - - All viewport arguments are the pixel bounds of the viewport-- e.g., - RenderDevice::viewport(). - */ -class GCamera { - -public: - /** - Stores the direction of the field of view - */ - enum FOVDirection {HORIZONTAL, VERTICAL}; - -private: - - - /** field of view (in radians) */ - float m_fieldOfView; - - /** Clipping plane, *not* imaging plane. Negative numbers. */ - float m_nearPlaneZ; - - /** Negative */ - float m_farPlaneZ; - - /** Stores the camera's location and orientation */ - CoordinateFrame m_cframe; - - /** Horizontal or Vertical */ - FOVDirection m_direction; - -public: - - class Frustum { - public: - class Face { - public: - /** Counter clockwise indices into vertexPos */ - int vertexIndex[4]; - - /** The plane containing the face. */ - Plane plane; - }; - - /** The vertices, in homogeneous space. If w == 0, - a vertex is at infinity. */ - Array vertexPos; - - /** The faces in the frustum. When the - far plane is at infinity, there are 5 faces, - otherwise there are 6. The faces are in the order - N,R,L,B,T,[F]. - */ - Array faceArray; - }; - - GCamera(); - - virtual ~GCamera(); - - /** Returns the current coordinate frame */ - const CoordinateFrame& coordinateFrame() const { - return m_cframe; - } - - /** Sets c to the camera's coordinate frame */ - void getCoordinateFrame(CoordinateFrame& c) const; - - /** Sets a new coordinate frame for the camera */ - void setCoordinateFrame(const CoordinateFrame& c); - - /** Sets P equal to the camera's projection matrix */ - void getProjectUnitMatrix(const Rect2D& viewport, Matrix4& P) const; - - /** Converts projected points from OpenGL standards - (-1, 1) to normal 3D coordinate standards (0, 1) */ - Vector3 convertFromUnitToNormal(const Vector3& in, const Rect2D& viewport) const; - - /** - Sets the vertical field of view, in radians. The - initial angle is toRadians(55). Must specify the direction of the angle - */ - void setFieldOfView(float angle, FOVDirection direction); - - /** Returns the current field of view angle and direction */ - inline void getFieldOfView(float& angle, FOVDirection& direction) const { - angle = m_fieldOfView; - direction = m_direction; - } - - /** - Projects a world space point onto a width x height screen. The - returned coordinate uses pixmap addressing: x = right and y = - down. The resulting z value is 0 at the near plane, 1 at the far plane, - and is a linear compression of unit cube projection. - - If the point is behind the camera, Vector3::inf() is returned. - */ - Vector3 project(const G3D::Vector3& point, - const class Rect2D& viewport) const; - - /** - Projects a world space point onto a unit cube. The resulting - x,y,z values range between -1 and 1, where z is -1 - at the near plane and 1 at the far plane and varies hyperbolically in between. - - If the point is behind the camera, Vector3::inf() is returned. - */ - Vector3 projectUnit(const G3D::Vector3& point, - const class Rect2D& viewport) const; - - /** - Gives the world-space coordinates of screen space point v, where - v.x is in pixels from the left, v.y is in pixels from - the top, and v.z is on the range 0 (near plane) to 1 (far plane). - */ - Vector3 unproject(const Vector3& v, const Rect2D& viewport) const; - - /** - Gives the world-space coordinates of unit cube point v, where - v varies from -1 to 1 on all axes. The unproject first - transforms the point into a pixel location for the viewport, then calls unproject - */ - Vector3 unprojectUnit(const Vector3& v, const Rect2D& viewport) const; - - /** - Returns the pixel area covered by a shape of the given - world space area at the given z value (z must be negative). - */ - float worldToScreenSpaceArea(float area, float z, const class Rect2D& viewport) const; - - /** - Returns the world space 3D viewport corners. These - are at the near clipping plane. The corners are constructed - from the nearPlaneZ, viewportWidth, and viewportHeight. - "left" and "right" are from the GCamera's perspective. - */ - void getNearViewportCorners(const class Rect2D& viewport, - Vector3& outUR, Vector3& outUL, - Vector3& outLL, Vector3& outLR) const; - - /** - Returns the world space 3D viewport corners. These - are at the Far clipping plane. The corners are constructed - from the nearPlaneZ, farPlaneZ, viewportWidth, and viewportHeight. - "left" and "right" are from the GCamera's perspective. - */ - void getFarViewportCorners(const class Rect2D& viewport, - Vector3& outUR, Vector3& outUL, - Vector3& outLL, Vector3& outLR) const; - - /** - Returns the image plane depth, assumes imagePlane - is the same as the near clipping plane. - returns a positive number. - */ - float imagePlaneDepth() const; - - /** - Returns the world space ray passing through the center of pixel - (x, y) on the image plane. The pixel x and y axes are opposite - the 3D object space axes: (0,0) is the upper left corner of the screen. - They are in viewport coordinates, not screen coordinates. - - The ray origin is at the origin. To start it at the image plane, - move it forward by imagePlaneDepth/ray.direction.z - - Integer (x, y) values correspond to - the upper left corners of pixels. If you want to cast rays - through pixel centers, add 0.5 to x and y. - */ - Ray worldRay( - float x, - float y, - const class Rect2D& viewport) const; - - /** - Returns a negative z-value. - */ - inline float nearPlaneZ() const { - return m_nearPlaneZ; - } - - /** - Returns a negative z-value. - */ - inline float farPlaneZ() const { - return m_farPlaneZ; - } - - /** - Sets a new value for the far clipping plane - Expects a negative value - */ - inline void setFarPlaneZ(float z) { - debugAssert(z < 0); - m_farPlaneZ = z; - } - - /** - Sets a new value for the near clipping plane - Expects a negative value - */ - inline void setNearPlaneZ(float z) { - debugAssert(z < 0); - m_nearPlaneZ = z; - } - - /** - Returns the camera space width of the viewport at the near plane. - */ - float viewportWidth(const class Rect2D& viewport) const; - - /** - Returns the camera space height of the viewport at the near plane. - */ - float viewportHeight(const class Rect2D& viewport) const; - - void setPosition(const Vector3& t); - - /** Rotate the camera in place to look at the target. Does not - persistently look at that location when the camera moves; - i.e., if you move the camera and still want it to look at the - old target, you must call lookAt again after moving the - camera.)*/ - void lookAt(const Vector3& position, const Vector3& up = Vector3::unitY()); - - /** - Returns the clipping planes of the frustum, in world space. - The planes have normals facing into the view frustum. - - The plane order is guaranteed to be: - Near, Right, Left, Top, Bottom, [Far] - - If the far plane is at infinity, the resulting array will have - 5 planes, otherwise there will be 6. - - The viewport is used only to determine the aspect ratio of the screen; the - absolute dimensions and xy values don't matter. - */ - void getClipPlanes - ( - const Rect2D& viewport, - Array& outClip) const; - - /** - Returns the world space view frustum, which is a truncated pyramid describing - the volume of space seen by this camera. - */ - void frustum(const Rect2D& viewport, GCamera::Frustum& f) const; - - GCamera::Frustum frustum(const Rect2D& viewport) const; - - /** Read and Write camera parameters */ - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - -}; - -} // namespace G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/GImage.h b/externals/g3dlite/G3D.lib/include/G3D/GImage.h deleted file mode 100644 index 12003514d6a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/GImage.h +++ /dev/null @@ -1,550 +0,0 @@ -/** - @file GImage.h - - See G3D::GImage for details. - - @cite JPEG compress/decompressor is the IJG library, used in accordance with their license. - @cite JPG code by John Chisholm, using the IJG Library - @cite TGA code by Morgan McGuire - @cite BMP code by John Chisholm, based on code by Edward "CGameProgrammer" Resnick mailto:cgp@gdnmail.net at ftp://ftp.flipcode.com/cotd/LoadPicture.txt - @cite PCX format described in the ZSOFT PCX manual http://www.nist.fss.ru/hr/doc/spec/pcx.htm#2 - @cite PNG compress/decompressor is the libpng library, used in accordance with their license. - @cite PPM code by Morgan McGuire based on http://netpbm.sourceforge.net/doc/ppm.html - - @maintainer Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2007-01-31 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - - */ - -#ifndef G3D_GIMAGE_H -#define G3D_GIMAGE_H - -#include "G3D/platform.h" -#include -#include "G3D/Array.h" -#include "G3D/g3dmath.h" -#include "G3D/stringutils.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color4uint8.h" - -namespace G3D { -class BinaryInput; -class BinaryOutput; -/** - Interface to image compression & file formats. - - Supported formats (decode and encode): Color JPEG, PNG, (Uncompressed)TGA 24, (Uncompressed)TGA 32, BMP 1, BMP 4, BMP 8, BMP 24, PPM (P6), and PPM ASCII (P1, P2, P3). - 8-bit paletted PCX, 24-bit PCX, and ICO are supported for decoding only. - - Sample usage: - -

-    #include "graphics3D.h"
-
-    // Loading from disk:
-    G3D::GImage im1 = G3D::GImage("test.jpg");
-    
-    // Loading from memory:
-    G3D::GImage im2 = G3D::GImage(data, length);
-
-    // im.pixel is a pointer to RGB color data.  If you want
-    // an alpha channel, call RGBtoRGBA or RGBtoARGB for
-    // conversion.
-
-    // Saving to memory:
-    G3D::GImage im3 = G3D::GImage(width, height);
-    // (Set the pixels of im3...) 
-    uint8* data2;
-    int    len2;
-    im3.encode(G3D::GImage::JPEG, data2, len2);
-
-    // Saving to disk
-    im3.save("out.jpg");
-  
- - The free Image Magick Magick Wand API - (http://www.imagemagick.org/www/api/magick_wand.html) provides a more powerful - API for image manipulation and wider set of image load/save formats. It is - recommended over GImage (we don't include it directly in G3D because their license - is more restrictive than the BSD one). - - */ -class GImage { -private: - uint8* _byte; - -public: - - class Error { - public: - Error( - const std::string& reason, - const std::string& filename = "") : - reason(reason), filename(filename) {} - - std::string reason; - std::string filename; - }; - - enum Format {JPEG, BMP, TGA, PCX, ICO, PNG, PPM_ASCII, PPM, AUTODETECT, UNKNOWN}; - - int width; - int height; - - /** - The number of channels; either 3 (RGB) or 4 (RGBA) - */ - int channels; - - inline const uint8* byte() const { - return _byte; - } - - /** Returns a pointer to the upper left pixel - as Color3uint8. - */ - inline const Color3uint8* pixel3() const { - debugAssertM(channels == 3, format("Tried to call GImage::pixel3 on an image with %d channels", channels)); - return (Color3uint8*)_byte; - } - - /** Returns a pointer to the upper left pixel - as Color4uint8. - */ - inline const Color4uint8* pixel4() const { - debugAssertM(channels == 4, format("Tried to call GImage::pixel4 on an image with %d channels", channels)); - return (Color4uint8*)_byte; - } - - inline const Color1uint8* pixel1() const { - debugAssertM(channels == 1, format("Tried to call GImage::pixel1 on an image with %d channels", channels)); - return (Color1uint8*)_byte; - } - - inline Color1uint8* pixel1() { - debugAssertM(channels == 1, format("Tried to call GImage::pixel1 on an image with %d channels", channels)); - return (Color1uint8*)_byte; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline const Color1uint8& pixel1(int x, int y) const { - debugAssert(x >= 0 && x < width); - debugAssert(y >= 0 && y < height); - return pixel1()[x + y * width]; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline Color1uint8& pixel1(int x, int y) { - debugAssert(x >= 0 && x < width); - debugAssert(y >= 0 && y < height); - return pixel1()[x + y * width]; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline const Color3uint8& pixel3(int x, int y) const { - debugAssert(x >= 0 && x < width); - debugAssert(y >= 0 && y < height); - return pixel3()[x + y * width]; - } - - inline Color3uint8& pixel3(int x, int y) { - debugAssert(x >= 0 && x < width); - debugAssert(y >= 0 && y < height); - return pixel3()[x + y * width]; - } - - /** Returns the pixel at (x, y), where (0,0) is the upper left. */ - inline const Color4uint8& pixel4(int x, int y) const { - debugAssert(x >= 0 && x < width); - debugAssert(y >= 0 && y < height); - return pixel4()[x + y * width]; - } - - inline Color4uint8& pixel4(int x, int y) { - debugAssert(x >= 0 && x < width); - debugAssert(y >= 0 && y < height); - return pixel4()[x + y * width]; - } - - inline uint8* byte() { - return _byte; - } - - inline Color3uint8* pixel3() { - debugAssert(channels == 3); - return (Color3uint8*)_byte; - } - - inline Color4uint8* pixel4() { - debugAssert(channels == 4); - return (Color4uint8*)_byte; - } - -private: - - void encodeBMP( - BinaryOutput& out) const; - - /** - The TGA file will be either 24- or 32-bit depending - on the number of channels. - */ - void encodeTGA( - BinaryOutput& out) const; - - /** - Converts this image into a JPEG - */ - void encodeJPEG( - BinaryOutput& out) const; - - /** - Converts this image into a JPEG - */ - void encodePNG( - BinaryOutput& out) const; - - void encodePPM( - BinaryOutput& out) const; - - void encodePPMASCII( - BinaryOutput& out) const; - - void decodeTGA( - BinaryInput& input); - - void decodeBMP( - BinaryInput& input); - - void decodeJPEG( - BinaryInput& input); - - void decodePCX( - BinaryInput& input); - - void decodeICO( - BinaryInput& input); - - void decodePNG( - BinaryInput& input); - - void decodePPM( - BinaryInput& input); - - void decodePPMASCII( - BinaryInput& input); - - /** - Given [maybe] a filename, memory buffer, and [maybe] a format, - returns the most likely format of this file. - */ - static Format resolveFormat( - const std::string& filename, - const uint8* data, - int dataLen, - Format maybeFormat); - - void _copy( - const GImage& other); - -public: - static Format resolveFormat(const std::string& filename); - - GImage() { - width = height = channels = 0; - _byte = NULL; - } - - /** - Load an encoded image from disk and decode it. - Throws GImage::Error if something goes wrong. - */ - GImage( - const std::string& filename, - Format format = AUTODETECT); - - /** - Decodes an image stored in a buffer. - */ - GImage( - const unsigned char*data, - int length, - Format format = AUTODETECT); - - /** - Create an empty image of the given size. - */ - GImage( - int width, - int height, - int channels = 3); - - GImage( - const GImage& other); - - GImage& operator=(const GImage& other); - - /** - Returns a new GImage that has 4 channels. RGB is - taken from this GImage and the alpha from the red - channel of the supplied image. The new GImage is passed - as a reference parameter for speed. - */ - void insertRedAsAlpha(const GImage& alpha, GImage& output) const; - - GImage G3D_DEPRECATED insertRedAsAlpha(const GImage& alpha) const; - - /** - Returns a new GImage with 3 channels, removing - the alpha channel if there is one. The new GImage - is passed as a reference parameter for speed. - */ - void stripAlpha(GImage& output) const; - - GImage G3D_DEPRECATED stripAlpha() const; - - /** - Loads an image from disk (clearing the old one first). - */ - void load( - const std::string& filename, - Format format = AUTODETECT); - - /** - Frees memory and resets to a 0x0 image. - */ - void clear(); - - /** - Deallocates the pixels. - */ - virtual ~GImage(); - - /** - Resizes the internal buffer to (width x height) with the - number of channels specified. All data is set to 0 (black). - */ - void resize(int width, int height, int channels); - - - /** - Copies src sub-image data into dest at a certain offset. - The dest variable must already contain an image that is large - enough to contain the src sub-image at the specified offset. - Returns true on success and false if the src sub-image cannot - completely fit within dest at the specified offset. Both - src and dest must have the same number of channels. - */ - static bool pasteSubImage(GImage & dest, const GImage & src, - int destX, int destY, int srcX, int srcY, int srcWidth, int srcHeight); - - /** - creates dest from src sub-image data. - Returns true on success and false if the src sub-image - is not within src. - */ - static bool copySubImage(GImage & dest, const GImage & src, - int srcX, int srcY, int srcWidth, int srcHeight); - - void convertToRGBA(); - - void convertToRGB(); - - /** Averages color channels if they exist */ - void convertToL8(); - - /** - Returns true if format is supported. Format - should be an extension string (e.g. "BMP"). - */ - static bool supportedFormat( - const std::string& format); - - /** - Converts a string to an enum, returns UNKNOWN if not recognized. - */ - static Format stringToFormat( - const std::string& format); - - /** - Encode and save to disk. - */ - void save( - const std::string& filename, - Format format = AUTODETECT) const; - - /** - The caller must delete the returned buffer. - */ - void encode( - Format format, - uint8*& outData, - int& outLength) const; - - /** - Does not commit the BinaryOutput when done. - */ - void encode( - Format format, - BinaryOutput& out) const; - - /** - Decodes the buffer into this image. - @format Must be the correct format. - */ - void decode( - BinaryInput& input, - Format format); - - /** Returns the size of this object in bytes */ - int sizeInMemory() const; - - - /** Ok for in == out */ - static void R8G8B8_to_Y8U8V8(int width, int height, const uint8* in, uint8* out); - - /** Ok for in == out */ - static void Y8U8V8_to_R8G8B8(int width, int height, const uint8* in, uint8* out); - - /** - @param in RGB buffer of numPixels * 3 bytes - @param out Buffer of numPixels * 4 bytes - @param numPixels Number of RGB pixels to convert - */ - static void RGBtoRGBA( - const uint8* in, - uint8* out, - int numPixels); - - static void RGBtoARGB( - const uint8* in, - uint8* out, - int numPixels); - - /** Safe for in == out */ - static void RGBtoBGR( - const uint8* in, - uint8* out, - int numPixels); - - /** - Win32 32-bit HDC format. - */ - static void RGBtoBGRA( - const uint8* in, - uint8* out, - int numPixels); - - static void RGBAtoRGB( - const uint8* in, - uint8* out, - int numPixels); - /** - Uses the red channel of the second image as an alpha channel. - */ - static void RGBxRGBtoRGBA( - const uint8* colorRGB, - const uint8* alphaRGB, - uint8* out, - int numPixels); - - /** - Flips the image along the vertical axis. - Safe for in == out. - */ - static void flipRGBVertical( - const uint8* in, - uint8* out, - int width, - int height); - - static void flipRGBAVertical( - const uint8* in, - uint8* out, - int width, - int height); - - /** - Given a tangent space bump map, computes a new image where the - RGB channels are a tangent space normal map and the alpha channel - is the original bump map. Assumes the input image is tileable. - - In the resulting image, x = red = tangent, y = green = binormal, and z = blue = normal. - - Particularly useful as part of the idiom: -
- 	    GImage normal;
-	    computeNormalMap(GImage(filename), normal);
-	    return Texture::fromGImage(filename, normal);
-    
- - @param lowPassBump If true, a 9x9 filter of 1's is used to low-pass filter the elevations, - which produces better results for parallax mapping. - - @param scaleHeightByNz After computing normals, scale the height by |N.z|, a trick that - reduces texture swim in steep areas for parallax mapping. - - @param whiteHeightInPixels How high should the brightest input value be considered for purposes - of normal computation, compared to the horizontal and vertical size of a pixel. - A value of 255 means that a 255 x 255 bump image with a full black-to-white gradient will - produce a 45-degree ramp (this also results in "cubic" voxels). - A special (default) value of -1 means scale the effective white height so that it is equal - to the larger spatial dimension. - */ - static void computeNormalMap( - const class GImage& bump, - class GImage& normal, - float whiteHeightInPixels = -1.0f, - bool lowPassBump = false, - bool scaleHeightByNz = false); - - static void computeNormalMap( - int width, - int height, - int channels, - const uint8* src, - GImage& normal, - float whiteHeightInPixels, - bool lowPassBump, - bool scaleHeightByNz); - - /** - Bayer demosaicing using the filter proposed in - - HIGH-QUALITY LINEAR INTERPOLATION FOR DEMOSAICING OF BAYER-PATTERNED COLOR IMAGES - Henrique S. Malvar, Li-wei He, and Ross Cutler - - The filter wraps at the image boundaries. - - Assumes in != out. - */ - static void BAYER_G8B8_R8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - static void BAYER_G8R8_B8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - static void BAYER_R8G8_G8B8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - static void BAYER_B8G8_G8R8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out); - - /** Fast conversion; the output has 1/2 the size of the input in each direction. Assumes in != out. - See G3D::BAYER_G8B8_R8G8_to_R8G8B8_MHC for a much better result. */ - static void BAYER_G8B8_R8G8_to_Quarter_R8G8B8(int inWidth, int inHeight, const uint8* in, uint8* out); - - /** Attempt to undo fast conversion of G3D::BAYER_G8B8_R8G8_to_Quarter_R8G8B8; - the green channel will lose data. Assumes in != out - The input should have size 3 * inWidth * inHeight. The output should have size - 2 * inWidth * 2 * inHeight. - */ - static void Quarter_R8G8B8_to_BAYER_G8B8_R8G8(int inWidth, int inHeight, const uint8* in, uint8* out); - - /** Overwrites every pixel with one of the two colors in a checkerboard pattern. - The fields used from the two colors depend on the current number of channels in @a im. - */ - static void makeCheckerboard(GImage& im, int checkerSize = 1, const Color4uint8& color1 = Color4uint8(255,255,255,255), const Color4uint8& color2 = Color4uint8(0,0,0,255)); -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/GLight.h b/externals/g3dlite/G3D.lib/include/G3D/GLight.h deleted file mode 100644 index b8fa7b54261..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/GLight.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - @file GLight.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-11-12 - @edited 2006-02-08 -*/ - -#ifndef G3D_GLIGHT_H -#define G3D_GLIGHT_H - -#include "G3D/platform.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/Color4.h" - -namespace G3D { - -/** - A light representation that closely follows the OpenGL light format. - */ -class GLight { -public: - /** World space position (for a directional light, w = 0 */ - Vector4 position; - - /** Direction in which the light faces, if a spot light. This is the "look vector" of the light source. */ - Vector3 spotDirection; - - /** In degrees. 180 = no cutoff (point/dir) >90 = spot light */ - float spotCutoff; - - /** Constant, linear, quadratic */ - float attenuation[3]; - - /** May be outside the range [0, 1] */ - Color3 color; - - /** If false, this light is ignored */ - bool enabled; - - /** If false, this light does not create specular highlights (useful when using negative lights). */ - bool specular; - - /** If false, this light does not create diffuse illumination (useful when rendering a specular-only pass). */ - bool diffuse; - - GLight(); - - /** @param toLight will be normalized */ - static GLight directional(const Vector3& toLight, const Color3& color, bool specular = true, bool diffuse = true); - - static GLight point(const Vector3& pos, const Color3& color, float constAtt = 1, float linAtt = 0, float quadAtt = 0.5f, bool specular = true, bool diffuse = true); - - /** @param pointDirection Will be normalized. Points in the direction that light propagates. - @param cutOffAngleDegrees Must be on the range [0, 90]. This is the angle from the point direction - to the edge of the light cone. - */ - static GLight spot(const Vector3& pos, const Vector3& pointDirection, float cutOffAngleDegrees, const Color3& color, float constAtt = 1, float linAtt = 0, float quadAtt = 0, bool specular = true, bool diffuse = true); - - /** Returns the sphere within which this light has some noticable effect. May be infinite. - @param cutoff The value at which the light intensity is considered negligible. */ - class Sphere effectSphere(float cutoff = 30.0f / 255) const; - - bool operator==(const GLight& other) const; - bool operator!=(const GLight& other) const; -}; - -} // namespace -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/GThread.h b/externals/g3dlite/G3D.lib/include/G3D/GThread.h deleted file mode 100644 index 63f1c235bda..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/GThread.h +++ /dev/null @@ -1,169 +0,0 @@ -/** - @file GThread.h - - @created 2005-09-22 - @edited 2007-01-31 - - */ - -#ifndef G3D_GTHREAD_H -#define G3D_GTHREAD_H - -#include "G3D/platform.h" -#include "G3D/ReferenceCount.h" -#include - -#ifndef G3D_WIN32 -# include -# include -#endif - - -namespace G3D { - -typedef ReferenceCountedPointer GThreadRef; - -/** - Platform independent thread implementation. You can either subclass and - override GThread::threadMain or call the create method with a method. - - Beware of reference counting and threads. If circular references exist between - GThread subclasses then neither class will ever be deallocated. Also, - dropping all pointers (and causing deallocation) of a GThread does NOT - stop the underlying process. - - @sa G3D::GMutex, G3D::AtomicInt32 -*/ -class GThread : public ReferenceCountedObject { -private: - // "Status" is a reserved work on FreeBSD - enum GStatus {STATUS_CREATED, STATUS_STARTED, STATUS_RUNNING, STATUS_COMPLETED}; - - // Not implemented on purpose, don't use - GThread(const GThread &); - GThread& operator=(const GThread&); - bool operator==(const GThread&); - -#ifdef G3D_WIN32 - static DWORD WINAPI internalThreadProc(LPVOID param); -#else - static void* internalThreadProc(void* param); -#endif //G3D_WIN32 - - volatile GStatus m_status; - - // Thread handle to hold HANDLE and pthread_t -#ifdef G3D_WIN32 - HANDLE m_handle; - HANDLE m_event; -#else - pthread_t m_handle; -#endif //G3D_WIN32 - - std::string m_name; - -public: - - GThread(const std::string& name); - - virtual ~GThread(); - - /** Constructs a basic GThread without requiring a subclass. - - @param proc The global or static function for the threadMain() */ - static GThreadRef create(const std::string& name, void (*proc)(void*), void* param); - - /** @deprecated use overload that accepts void* param */ - static GThreadRef create(const std::string& name, void (*proc)()); - - /** Starts the thread and executes threadMain(). Returns false if - the thread failed to start (either because it was already started - or because the OS refused).*/ - bool start(); - - /** Terminates the thread without notifying or - waiting for a cancelation point. */ - void terminate(); - - /** - Returns true if threadMain is currently executing. This will - only be set when the thread is actually running and might not - be set when start() returns. */ - bool running() const; - - /** True after start() has been called, even through the thread - may have already completed(), or be currently running().*/ - bool started() const; - - /** Returns true if the thread has exited. */ - bool completed() const; - - /** Waits for the thread to finish executing. */ - void waitForCompletion(); - - /** Returns thread name */ - inline const std::string& name() { - return m_name; - } - - /** Overriden by the thread implementor */ - virtual void threadMain() = 0; -}; - - -/** - Mutual exclusion lock used for synchronization. - @sa G3D::GThread, G3D::AtomicInt32 -*/ -class GMutex { -private: -# ifdef G3D_WIN32 - CRITICAL_SECTION m_handle; -# else - pthread_mutex_t m_handle; -# endif - - // Not implemented on purpose, don't use - GMutex(const GMutex &mlock); - GMutex &operator=(const GMutex &); - bool operator==(const GMutex&); - -public: - GMutex(); - ~GMutex(); - - /** Locks the mutex or blocks until available. */ - void lock(); - - /** Unlocks the mutex. */ - void unlock(); -}; - - -/** - Automatically locks while in scope. -*/ -class GMutexLock { -private: - GMutex* m; - - // Not implemented on purpose, don't use - GMutexLock(const GMutexLock &mlock); - GMutexLock &operator=(const GMutexLock &); - bool operator==(const GMutexLock&); - -public: - GMutexLock(GMutex* mutex) { - m = mutex; - m->lock(); - } - - ~GMutexLock() { - m->unlock(); - } -}; - - -} // namespace G3D - -#endif //G3D_GTHREAD_H diff --git a/externals/g3dlite/G3D.lib/include/G3D/GUniqueID.h b/externals/g3dlite/G3D.lib/include/G3D/GUniqueID.h deleted file mode 100644 index 44ec6e03405..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/GUniqueID.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - @file GUniqueID.h - @author Morgan McGuire, morgan@cs.williams.edu - */ -#ifndef G3D_GUNIQUEID_H -#define G3D_GUNIQUEID_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Table.h" - -namespace G3D { - -/** Globally unique identifiers. The probability of two different - programs generating the same value from UniqueID::create is - vanishingly small. - - UniqueIDs optionally contain a 10-bit application specific tag - that distinguishes their type. -*/ -class GUniqueID { -private: - - uint64 id; - -public: - - GUniqueID() : id(0) {} - - bool uninitialized() const { - return id == 0; - } - - uint16 tag() const { - return id >> 54; - } - - operator uint64() const { - return id; - } - - bool operator==(const GUniqueID& other) const { - return id == other.id; - } - - bool operator!=(const GUniqueID& other) const { - return id != other.id; - } - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - void serialize(class TextOutput& t) const; - - void deserialize(class TextInput& t); - - /** Create a new ID */ - static GUniqueID create(uint16 tag = 0); -}; - -} // G3D - -/** For Table and Set */ -template<> struct HashTrait { - static size_t hashCode(G3D::GUniqueID id) { return (size_t)(G3D::uint64)id; } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/HashTrait.h b/externals/g3dlite/G3D.lib/include/G3D/HashTrait.h deleted file mode 100644 index 702903ff09b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/HashTrait.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - @file HashTrait.h - - @maintainer Morgan McGuire, morgan@cs.williams.edu - @created 2008-10-01 - @edited 2008-10-01 - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_HASHTRAIT_H -#define G3D_HASHTRAIT_H - -#include "G3D/platform.h" -#include "G3D/Crypto.h" -#include "G3D/g3dmath.h" -#include "G3D/uint128.h" - -/** Must be specialized for custom types. - @see G3D::Table for specialization requirements. -*/ -template struct HashTrait{}; - -template struct HashTrait { - static size_t hashCode(const void* k) { return reinterpret_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(int k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(G3D::uint32 k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(G3D::uint64 k) { return static_cast(k); } -}; - -template <> struct HashTrait { - static size_t hashCode(const std::string& k) { return static_cast(G3D::Crypto::crc32(k.c_str(), k.size())); } -}; - -template <> struct HashTrait { - // Use the FNV-1 hash (http://isthe.com/chongo/tech/comp/fnv/#FNV-1). - static size_t hashCode(G3D::uint128 key) { - static const G3D::uint128 FNV_PRIME_128(1 << 24, 0x159); - static const G3D::uint128 FNV_OFFSET_128(0xCF470AAC6CB293D2LL, 0xF52F88BF32307F8FLL); - - G3D::uint128 hash = FNV_OFFSET_128; - G3D::uint128 mask(0, 0xFF); - for (int i = 0; i < 16; ++i) { - hash *= FNV_PRIME_128; - hash ^= (mask & key); - key >>= 8; - } - - G3D::uint64 foldedHash = hash.hi ^ hash.lo; - return static_cast((foldedHash >> 32) ^ (foldedHash & 0xFFFFFFFF)); - } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Image1.h b/externals/g3dlite/G3D.lib/include/G3D/Image1.h deleted file mode 100644 index f0850710d2c..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Image1.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - @file Image1.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#ifndef G3D_IMAGE1_H -#define G3D_IMAGE1_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color1.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image1Ref; - -/** - Luminance image with 32-bit floating point storage. - - See also G3D::Image1uint8, G3D::GImage. - */ -class Image1 : public Map2D { -public: - - typedef Image1 Type; - typedef Image1Ref Ref; - -protected: - - Image1(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage1uint8(const ReferenceCountedPointer& im); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Image1uint8.h b/externals/g3dlite/G3D.lib/include/G3D/Image1uint8.h deleted file mode 100644 index 7225ca35db8..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Image1uint8.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - @file Image1uint8.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - -#ifndef G3D_IMAGE1UINT8_H -#define G3D_IMAGE1UINT8_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color1.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image1uint8Ref; - -/** - Compact storage for luminance 8-bit images. - - See also G3D::Image3, G3D::GImage - */ -class Image1uint8 : public Map2D { -public: - - typedef Image1uint8 Type; - typedef Image1uint8Ref Ref; - -protected: - - Image1uint8(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage1(const ReferenceCountedPointer& im); - static Ref fromImage3uint8(const ReferenceCountedPointer& im); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Image3.h b/externals/g3dlite/G3D.lib/include/G3D/Image3.h deleted file mode 100644 index c67669c1c5e..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Image3.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - @file Image3.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#ifndef G3D_IMAGE3_H -#define G3D_IMAGE3_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color3.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image3Ref; - -/** - RGB image with 32-bit floating point storage for each channel. - - See also G3D::Image3uint8, G3D::GImage. - */ -class Image3 : public Map2D { -public: - - typedef Image3 Type; - typedef Image3Ref Ref; - -protected: - - Image3(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage3uint8(const ReferenceCountedPointer& im); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Image3uint8.h b/externals/g3dlite/G3D.lib/include/G3D/Image3uint8.h deleted file mode 100644 index 9ee1ef6678b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Image3uint8.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - @file Image3uint8.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - -#ifndef G3D_IMAGE3UINT8_H -#define G3D_IMAGE3UINT8_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color3.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image3uint8Ref; - -/** - Compact storage for RGB 8-bit per channel images. - - See also G3D::Image3, G3D::GImage - */ -class Image3uint8 : public Map2D { -public: - - typedef Image3uint8 Type; - typedef Image3uint8Ref Ref; - -protected: - - Image3uint8(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage3(const ReferenceCountedPointer& im); - static Ref fromImage1uint8(const ReferenceCountedPointer& im); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Extracts color channel 0 <= c <= 2 and returns it as a new monochrome image. */ - ReferenceCountedPointer getChannel(int c) const; -}; - -} // G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Image4.h b/externals/g3dlite/G3D.lib/include/G3D/Image4.h deleted file mode 100644 index 04df43f9527..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Image4.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - @file Image4.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#ifndef G3D_IMAGE4_H -#define G3D_IMAGE4_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color4.h" -#include "G3D/GImage.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image4Ref; - -/** - RGBA image with 32-bit floating point storage for each channel. - - Whenever a method needs to convert from RGB to ARGB, A=1 is assumed. - - See also G3D::Image4uint8, G3D::GImage. - */ -class Image4 : public Map2D { -public: - - typedef Image4 Type; - typedef Image4Ref Ref; - -protected: - - Image4(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage4uint8(const ReferenceCountedPointer& im); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - /** Loads from any of the file formats supported by G3D::GImage. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); -}; - -} // G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Image4uint8.h b/externals/g3dlite/G3D.lib/include/G3D/Image4uint8.h deleted file mode 100644 index 11daf97c83c..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Image4uint8.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - @file Image4uint8.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - -#ifndef G3D_IMAGE4UINT8_H -#define G3D_IMAGE4UINT8_H - -#include "G3D/platform.h" -#include "G3D/Map2D.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color4.h" -#include "G3D/GImage.h" -#include "G3D/Image1uint8.h" - -namespace G3D { - -typedef ReferenceCountedPointer Image4uint8Ref; - -/** - Compact storage for RGBA 8-bit per channel images. - - See also G3D::Image4, G3D::GImage - */ -class Image4uint8 : public Map2D { -public: - - typedef Image4uint8 Type; - typedef Image4uint8Ref Ref; - -protected: - - Image4uint8(int w, int h, WrapMode wrap); - - void copyGImage(const class GImage& im); - void copyArray(const Color1* src, int w, int h); - void copyArray(const Color3* src, int w, int h); - void copyArray(const Color4* src, int w, int h); - void copyArray(const Color1uint8* src, int w, int h); - void copyArray(const Color3uint8* src, int w, int h); - void copyArray(const Color4uint8* src, int w, int h); - -public: - - const class ImageFormat* format() const; - - /** Creates an all-zero width x height image. */ - static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); - - - /** Creates a 0 x 0 image. */ - static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); - - - static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); - - static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); - - static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); - - static Ref fromImage4(const ReferenceCountedPointer& im); - - /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, - it is stripped. */ - void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Saves in any of the formats supported by G3D::GImage. */ - void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); - - /** Extracts color channel 0 <= c <= 3 and returns it as a new monochrome image. */ - ReferenceCountedPointer getChannel(int c) const; -}; - -} // G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/ImageFormat.h b/externals/g3dlite/G3D.lib/include/G3D/ImageFormat.h deleted file mode 100644 index a1334fb1a5a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/ImageFormat.h +++ /dev/null @@ -1,362 +0,0 @@ -/** - @file ImageFormat.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-05-23 - @edited 2008-07-17 -*/ - -#ifndef GLG3D_ImageFormat_H -#define GLG3D_ImageFormat_H - -#include "G3D/platform.h" -#include "G3D/Table.h" -#include "G3D/enumclass.h" - -namespace G3D { - -/** Information about common image formats. - Don't construct these; use the methods provided. - - For most formats, the number indicates the number of bits per channel and a suffix of "F" indicates - floating point. This does not hold for the YUV and DXT formats.*/ -class ImageFormat { -public: - - // Must update ImageFormat::name() when this enum changes. - enum Code { - CODE_NONE = -1, - CODE_L8, - CODE_L16, - CODE_L16F, - CODE_L32F, - - CODE_A8, - CODE_A16, - CODE_A16F, - CODE_A32F, - - CODE_LA4, - CODE_LA8, - CODE_LA16, - CODE_LA16F, - CODE_LA32F, - - CODE_RGB5, - CODE_RGB5A1, - CODE_RGB8, - CODE_RGB10, - CODE_RGB10A2, - CODE_RGB16, - CODE_RGB16F, - CODE_RGB32F, - - CODE_ARGB8, - CODE_BGR8, - - CODE_RGBA8, - CODE_RGBA16, - CODE_RGBA16F, - CODE_RGBA32F, - - CODE_BAYER_RGGB8, - CODE_BAYER_GRBG8, - CODE_BAYER_GBRG8, - CODE_BAYER_BGGR8, - CODE_BAYER_RGGB32F, - CODE_BAYER_GRBG32F, - CODE_BAYER_GBRG32F, - CODE_BAYER_BGGR32F, - - CODE_HSV8, - CODE_HSV32F, - - CODE_YUV420_PLANAR, - CODE_YUV422, - CODE_YUV444, - - CODE_RGB_DXT1, - CODE_RGBA_DXT1, - CODE_RGBA_DXT3, - CODE_RGBA_DXT5, - - CODE_DEPTH16, - CODE_DEPTH24, - CODE_DEPTH32, - CODE_DEPTH32F, - - CODE_STENCIL1, - CODE_STENCIL4, - CODE_STENCIL8, - CODE_STENCIL16, - - CODE_DEPTH24_STENCIL8, - - CODE_NUM - }; - - enum ColorSpace { - COLOR_SPACE_NONE, - COLOR_SPACE_RGB, - COLOR_SPACE_HSV, - COLOR_SPACE_YUV - }; - - enum BayerPattern { - BAYER_PATTERN_NONE, - BAYER_PATTERN_RGGB, - BAYER_PATTERN_GRBG, - BAYER_PATTERN_GBRG, - BAYER_PATTERN_BGGR - }; - - /** Number of channels (1 for a depth texture). */ - int numComponents; - bool compressed; - - /** Useful for serializing. */ - Code code; - - ColorSpace colorSpace; - - /** If this is a Bayer format, what is the pattern. */ - BayerPattern bayerPattern; - - /** The OpenGL format equivalent to this one, e.g, GL_RGB8 Zero if there is no equivalent. This is actually a GLenum */ - int openGLFormat; - - /** The OpenGL base format equivalent to this one (e.g., GL_RGB, GL_ALPHA). Zero if there is no equivalent. */ - int openGLBaseFormat; - - int luminanceBits; - - /** Number of bits per pixel storage for alpha values; Zero for compressed textures and non-RGB. */ - int alphaBits; - - /** Number of bits per pixel storage for red values; Zero for compressed textures and non-RGB. */ - int redBits; - - /** Number of bits per pixel storage for green values; Zero for compressed textures and non-RGB. */ - int greenBits; - - /** Number of bits per pixel storage for blue values; Zero for compressed textures and non-RGB. */ - int blueBits; - - /** Number of bits per pixel */ - int stencilBits; - - /** Number of depth bits (for depth textures; e.g. shadow maps) */ - int depthBits; - - /** Amount of CPU memory per pixel when packed into an array, discounting any end-of-row padding. */ - int cpuBitsPerPixel; - - /** Amount of CPU memory per pixel when packed into an array, discounting any end-of-row padding. @deprecated Use cpuBitsPerPixel*/ - int packedBitsPerTexel; - - /** - Amount of GPU memory per pixel on most graphics cards, for formats supported by OpenGL. This is - only an estimate--the actual amount of memory may be different on your actual card. - - This may be greater than the sum of the per-channel bits - because graphics cards need to pad to the nearest 1, 2, or - 4 bytes. - */ - int openGLBitsPerPixel; - - /** @deprecated Use openGLBitsPerPixel */ - int hardwareBitsPerTexel; - - /** The OpenGL bytes format of the data buffer used with this texture format, e.g., GL_UNSIGNED_BYTE */ - int openGLDataFormat; - - /** True if there is no alpha channel for this texture. */ - bool opaque; - - /** True if the bit depths specified are for float formats. */ - bool floatingPoint; - - /** Human readable name of this texture.*/ - std::string name() const; - -private: - - ImageFormat( - int numComponents, - bool compressed, - int glFormat, - int glBaseFormat, - int luminanceBits, - int alphaBits, - int redBits, - int greenBits, - int blueBits, - int depthBits, - int stencilBits, - int hardwareBitsPerTexel, - int packedBitsPerTexel, - int glDataFormat, - bool opaque, - bool floatingPoint, - Code code, - ColorSpace colorSpace, - BayerPattern bayerPattern = BAYER_PATTERN_NONE); - -public: - - static const ImageFormat* L8(); - - static const ImageFormat* L16(); - - static const ImageFormat* L16F(); - - static const ImageFormat* L32F(); - - static const ImageFormat* A8(); - - static const ImageFormat* A16(); - - static const ImageFormat* A16F(); - - static const ImageFormat* A32F(); - - static const ImageFormat* LA4(); - - static const ImageFormat* LA8(); - - static const ImageFormat* LA16(); - - static const ImageFormat* LA16F(); - - static const ImageFormat* LA32F(); - - static const ImageFormat* BGR8(); - - static const ImageFormat* RGB5(); - - static const ImageFormat* RGB5A1(); - - static const ImageFormat* RGB8(); - - static const ImageFormat* RGB10(); - - static const ImageFormat* RGB10A2(); - - static const ImageFormat* RGB16(); - - static const ImageFormat* RGB16F(); - - static const ImageFormat* RGB32F(); - - static const ImageFormat* RGBA8(); - - static const ImageFormat* RGBA16(); - - static const ImageFormat* RGBA16F(); - - static const ImageFormat* RGBA32F(); - - static const ImageFormat* RGB_DXT1(); - - static const ImageFormat* RGBA_DXT1(); - - static const ImageFormat* RGBA_DXT3(); - - static const ImageFormat* RGBA_DXT5(); - - static const ImageFormat* DEPTH16(); - - static const ImageFormat* DEPTH24(); - - static const ImageFormat* DEPTH32(); - - static const ImageFormat* DEPTH32F(); - - static const ImageFormat* STENCIL1(); - - static const ImageFormat* STENCIL4(); - - static const ImageFormat* STENCIL8(); - - static const ImageFormat* STENCIL16(); - - static const ImageFormat* DEPTH24_STENCIL8(); - - static const ImageFormat* YUV420_PLANAR(); - - static const ImageFormat* YUV422(); - - static const ImageFormat* YUV444(); - - /** - NULL pointer; indicates that the G3D::Texture class should choose - either RGBA8 or RGB8 depending on the presence of an alpha channel - in the input. - */ - static const ImageFormat* AUTO() { return NULL; } - - /** Returns DEPTH16, DEPTH24, or DEPTH32 according to the bits - specified. You can use "glGetInteger(GL_DEPTH_BITS)" to match - the screen's format.*/ - static const ImageFormat* depth(int depthBits = 24); - - /** Returns STENCIL1, STENCIL4, STENCIL8 or STENCIL16 according to the bits - specified. You can use "glGetInteger(GL_STENCIL_BITS)" to match - the screen's format.*/ - static const ImageFormat* stencil(int bits = 8); - - /** Returns the matching ImageFormat* identified by the Code. May return NULL - if this format's code is reserved but not yet implemented by G3D. */ - static const ImageFormat* fromCode(ImageFormat::Code code); - - - - /** For use with ImageFormat::convert. */ - class BayerAlgorithm { - public: - enum Value { - NEAREST, - BILINEAR, - mhc, - HIGH_QUALITY = mhc - }; - private: - - Value value; - - public: - - G3D_DECLARE_ENUM_CLASS_METHODS(BayerAlgorithm); - }; - - /** Converts between arbitrary formats on the CPU. Not all format conversions are supported or directly supported. - Formats without direct conversions will attempt to convert through RGBA first. - - A conversion routine might only support source or destination padding or y inversion or none. - If support is needed and not available in any of the direct conversion routines, then no conversion is done. - - YUV422 expects data in YUY2 format (Y, U, Y2, v). Most YUV formats require width and heights that are multiples of 2. - - Returns true if a conversion was available, false if none occurred. - */ - static bool convert(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, - const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, - bool invertY = false, BayerAlgorithm bayerAlg = BayerAlgorithm::HIGH_QUALITY); - - /* Checks if a conversion between two formats is available. */ - static bool conversionAvailable(const ImageFormat* srcFormat, int srcRowPadBits, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY = false); -}; - -typedef ImageFormat TextureFormat; - -} - -template <> -struct HashTrait { - static size_t hashCode(const G3D::ImageFormat* key) { return reinterpret_cast(key); } -}; - - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Line.h b/externals/g3dlite/G3D.lib/include/G3D/Line.h deleted file mode 100644 index ff6dc8d08e7..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Line.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - @file Line.h - - Line class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-06-02 - @edited 2006-02-28 - */ - -#ifndef G3D_LINE_H -#define G3D_LINE_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" - -namespace G3D { - -class Plane; - -/** - An infinite 3D line. - */ -class Line { -protected: - - Vector3 _point; - Vector3 _direction; - - Line(const Vector3& point, const Vector3& direction) { - _point = point; - _direction = direction.direction(); - } - -public: - - /** Undefined (provided for creating Array only) */ - inline Line() {} - - Line(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - virtual ~Line() {} - - /** - Constructs a line from two (not equal) points. - */ - static Line fromTwoPoints(const Vector3 &point1, const Vector3 &point2) { - return Line(point1, point2 - point1); - } - - /** - Creates a line from a point and a (nonzero) direction. - */ - static Line fromPointAndDirection(const Vector3& point, const Vector3& direction) { - return Line(point, direction); - } - - /** - Returns the closest point on the line to point. - */ - Vector3 closestPoint(const Vector3& pt) const; - - /** - Returns the distance between point and the line - */ - double distance(const Vector3& point) const { - return (closestPoint(point) - point).magnitude(); - } - - /** Returns a point on the line */ - Vector3 point() const; - - /** Returns the direction (or negative direction) of the line */ - Vector3 direction() const; - - /** - Returns the point where the line and plane intersect. If there - is no intersection, returns a point at infinity. - */ - Vector3 intersection(const Plane &plane) const; - - - /** Finds the closest point to the two lines. - - @param minDist Returns the minimum distance between the lines. - - @cite http://objectmix.com/graphics/133793-coordinates-closest-points-pair-skew-lines.html - */ - Vector3 closestPoint(const Line& B, float& minDist) const; - - inline Vector3 closestPoint(const Line& B) const { - float m; - return closestPoint(B, m); - } -}; - -};// namespace - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/LineSegment.h b/externals/g3dlite/G3D.lib/include/G3D/LineSegment.h deleted file mode 100644 index 092b0c9ca6d..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/LineSegment.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - @file LineSegment.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-08 - @edited 2008-02-02 - */ - -#ifndef G3D_LINESEGMENT_H -#define G3D_LINESEGMENT_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" - -namespace G3D { - -/** - An finite segment of an infinite 3D line. - */ -class LineSegment { -protected: - - Vector3 _point; - - /** Not normalized */ - Vector3 direction; - - LineSegment(const Vector3& __point, const Vector3& _direction) : _point(__point), direction(_direction) { - } - -public: - - inline LineSegment() : _point(Vector3::zero()), direction(Vector3::zero()) {} - - LineSegment(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - - void deserialize(class BinaryInput& b); - - virtual ~LineSegment() {} - - /** - * Constructs a line from two (not equal) points. - */ - static LineSegment fromTwoPoints(const Vector3 &point1, const Vector3 &point2) { - return LineSegment(point1, point2 - point1); - } - - /** Call with 0 or 1 */ - Vector3 point(int i) const; - - inline float length() const { - return direction.magnitude(); - } - - /** - * Returns the closest point on the line segment to point. - */ - Vector3 closestPoint(const Vector3 &point) const; - - /** - Returns the distance between point and the line - */ - double distance(const Vector3& p) const { - return (closestPoint(p) - p).magnitude(); - } - - double distanceSquared(const Vector3& p) const { - return (closestPoint(p) - p).squaredMagnitude(); - } - - /** Returns true if some part of this segment is inside the sphere */ - bool intersectsSolidSphere(const class Sphere& s) const; - - Vector3 randomPoint() const; - -}; - - -class LineSegment2D { -private: - - Vector2 m_origin; - - /** Not normalized */ - Vector2 m_direction; - - /** Length of m_direction */ - float m_length; - -public: - - LineSegment2D() {} - - static LineSegment2D fromTwoPoints(const Vector2& p0, const Vector2& p1); - - /** Returns the intersection of these segements (including - testing endpoints), or Vector2::inf() if they do not intersect. */ - Vector2 intersection(const LineSegment2D& other) const; - - Vector2 point(int i) const; - - Vector2 closestPoint(const Vector2& Q) const; - - float distance(const Vector2& p) const; - - float length() const; -}; - -} // namespace - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Log.h b/externals/g3dlite/G3D.lib/include/G3D/Log.h deleted file mode 100644 index 19b4b65c82d..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Log.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - @file Log.h - - @maintainer Morgan McGuire, morgan@graphics3d.com - @cite Backtrace by Aaron Orenstein - @created 2001-08-04 - @edited 2005-11-04 - */ - -#ifndef G3D_LOG_H -#define G3D_LOG_H - -#include -#include -#include "G3D/platform.h" - -#ifndef G3D_WIN32 - #include -#endif - -namespace G3D { - -/** Prints to the common system log, log.txt, which is usually - in the working directory of the program. If your disk is - not writable or is slow, it will attempt to write to "c:/tmp/log.txt" or - "c:/temp/log.txt" on Windows systems instead. - - Unlike printf or debugPrintf, - this function guarantees that all output is committed before it returns. - This is very useful for debugging a crash, which might hide the last few - buffered print statements otherwise. - - Many G3D routines write useful warnings and debugging information to the - system log, which makes it a good first place to go when tracking down - a problem. - */ -void logPrintf(const char* fmt, ...); - -/** - System log for debugging purposes. The first log opened - is the "common log" and can be accessed with the static - method common(). If you access common() and a common log - does not yet exist, one is created for you. - */ -class Log { -private: - - /** - Log messages go here. - */ - FILE* logFile; - - std::string filename; - - static Log* commonLog; - - int stripFromStackBottom; - - /** - Prints the time & stack trace. - */ - void printHeader(); - -public: - - /** - @param stripFromStackBottom Number of call stacks to strip from the - bottom of the stack when printing a trace. Useful for hiding - routines like "main" and "WinMain". If the specified file cannot - be opened for some reason, tries to open "c:/tmp/log.txt" or - "c:/temp/log.txt" instead. - */ - Log(const std::string& filename = "log.txt", - int stripFromStackBottom = 0); - - virtual ~Log(); - - /** - Returns the handle to the file log. - */ - FILE* getFile() const; - - /** - Marks the beginning of a logfile section. - */ - void section(const std::string& s); - - /** - Given arguments like printf, writes characters to the debug text overlay. - */ - // We want G3D_CHECK_PRINTF_ARGS here, but that conflicts with the - // overload. - void __cdecl printf(const char* fmt, ...) G3D_CHECK_PRINTF_METHOD_ARGS; - - void __cdecl vprintf(const char*, va_list argPtr) G3D_CHECK_VPRINTF_METHOD_ARGS; - - static Log* common(); - - static std::string getCommonLogFilename(); - - void print(const std::string& s); - - - void println(const std::string& s); -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Map2D.h b/externals/g3dlite/G3D.lib/include/G3D/Map2D.h deleted file mode 100644 index 48e2e957a5f..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Map2D.h +++ /dev/null @@ -1,665 +0,0 @@ -/** - @file Map2D.h - - More flexible support than provided by G3D::GImage. - - @maintainer Morgan McGuire, morgan@cs.brown.edu - @created 2004-10-10 - @edited 2007-07-18 - */ -#ifndef G3D_MAP2D_H -#define G3D_MAP2D_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Array.h" -#include "G3D/Vector2int16.h" -#include "G3D/ReferenceCount.h" -#include "G3D/AtomicInt32.h" -#include "G3D/GThread.h" -#include "G3D/Rect2D.h" -#include "G3D/WrapMode.h" - -#include - -namespace G3D { -namespace _internal { - -/** The default compute type for a type is the type itself. */ -template class _GetComputeType { -public: - typedef Storage Type; -}; - -} // _internal -} // G3D - -// This weird syntax is needed to support VC6, which doesn't -// properly implement template overloading. -#define DECLARE_COMPUTE_TYPE(StorageType, ComputeType) \ -namespace G3D { \ - namespace _internal { \ - template<> class _GetComputeType < StorageType > { \ - public: \ - typedef ComputeType Type; \ - }; \ - } \ -} - -DECLARE_COMPUTE_TYPE( float32, float64) -DECLARE_COMPUTE_TYPE( float64, float64) - -DECLARE_COMPUTE_TYPE( int8, float32) -DECLARE_COMPUTE_TYPE( int16, float32) -DECLARE_COMPUTE_TYPE( int32, float64) -DECLARE_COMPUTE_TYPE( int64, float64) - -DECLARE_COMPUTE_TYPE( uint8, float32) -DECLARE_COMPUTE_TYPE( uint16, float32) -DECLARE_COMPUTE_TYPE( uint32, float64) -DECLARE_COMPUTE_TYPE( uint64, float64) - -DECLARE_COMPUTE_TYPE( Vector2, Vector2) -DECLARE_COMPUTE_TYPE( Vector2int16, Vector2) - -DECLARE_COMPUTE_TYPE( Vector3, Vector3) -DECLARE_COMPUTE_TYPE( Vector3int16, Vector3) - -DECLARE_COMPUTE_TYPE( Vector4, Vector4) - -DECLARE_COMPUTE_TYPE( Color3, Color3) -DECLARE_COMPUTE_TYPE( Color3uint8, Color3) - -DECLARE_COMPUTE_TYPE( Color4, Color4) -DECLARE_COMPUTE_TYPE( Color4uint8, Color4) -#undef DECLARE_COMPUTE_TYPE - -namespace G3D { - -/** - Map of values across a discrete 2D plane. Can be thought of as a generic class for 2D images, - allowing flexibility as to pixel format and convenient methods. - In fact, the "pixels" can be any values - on a grid that can be sensibly interpolated--RGB colors, scalars, 4D vectors, and so on. - - Other "image" classes in G3D: - - G3D::GImage - Supports file formats, fast, Color3uint8 and Color4uint8 formats. No interpolation. - - G3D::Texture::Ref - Represents image on the graphics card (not directly readable on the CPU). Supports 2D, 3D, and a variety of interpolation methods, loads file formats. - - G3D::Image3 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - G3D::Image4 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - G3D::Image3uint8 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - G3D::Image4uint8 - A subclass of Map2D that supports image loading and saving and conversion to Texture. - - There are two type parameters-- the first (@ Storage) is the type - used to store the "pixel" values efficiently and - the second (@a Compute) is - the type operated on by computation. The Compute::Compute(Storage&) constructor - is used to convert between storage and computation types. - @a Storage is often an integer version of @a Compute, for example - Map2D. By default, the computation type is: - -
-     Storage       Computation
-
-     uint8          float32
-     uint16         float32
-     uint32         float64
-     uint64         float64
-
-     int8           float32
-     int16          float32
-     int32          float64
-     int64          float64
-
-     float32        float64
-     float64        float64
-
-     Vector2        Vector2
-     Vector2int16   Vector2
-
-     Vector3        Vector3
-     Vector3int16   Vector3
-
-     Vector4        Vector4
-
-     Color3         Color3
-     Color3uint8    Color3
-
-     Color4         Color4
-     Color4uint8    Color4
-    
- Any other storage type defaults to itself as the computation type. - - The computation type can be any that - supports lerp, +, -, *, /, and an empty constructor. - - Assign value: - - im->set(x, y, 7); or - im->get(x, y) = 7; - - Read value: - - int c = im(x, y); - - Can also sample with nearest neighbor, bilinear, and bicubic - interpolation. - - Sampling follows OpenGL conventions, where - pixel values represent grid points and (0.5, 0.5) is half-way - between two vertical and two horizontal grid points. - To draw an image of dimensions w x h with nearest neighbor - sampling, render pixels from [0, 0] to [w - 1, h - 1]. - - Under the WrapMode::CLAMP wrap mode, the value of bilinear interpolation - becomes constant outside [1, w - 2] horizontally. Nearest neighbor - interpolation is constant outside [0, w - 1] and bicubic outside - [3, w - 4]. The class does not offer quadratic interpolation because - the interpolation filter could not center over a pixel. - - @author Morgan McGuire, morgan@cs.williams.edu - */ -template< typename Storage, -typename Compute = typename G3D::_internal::_GetComputeType::Type> -class Map2D : public ReferenceCountedObject { - -// -// It doesn't make sense to automatically convert from Compute back to Storage -// because the rounding rule (and scaling) is application dependent. -// Thus the interpolation methods all return type Compute. -// - -public: - - typedef Storage StorageType; - typedef Compute ComputeType; - typedef Map2D Type; - typedef ReferenceCountedPointer Ref; - -protected: - - Storage ZERO; - - /** Width, in pixels. */ - uint32 w; - - /** Height, in pixels. */ - uint32 h; - - WrapMode _wrapMode; - - /** 0 if no mutating method has been invoked - since the last call to setChanged(); */ - AtomicInt32 m_changed; - - Array data; - - /** Handles the exceptional cases from get */ - const Storage& slowGet(int x, int y, WrapMode wrap) { - switch (wrap) { - case WrapMode::CLAMP: - return fastGet(iClamp(x, 0, w - 1), iClamp(y, 0, h - 1)); - - case WrapMode::TILE: - return fastGet(iWrap(x, w), iWrap(y, h)); - - case WrapMode::ZERO: - return ZERO; - - case WrapMode::ERROR: - alwaysAssertM(((uint32)x < w) && ((uint32)y < h), - format("Index out of bounds: (%d, %d), w = %d, h = %d", - x, y, w, h)); - - // intentionally fall through - case WrapMode::IGNORE: - // intentionally fall through - default: - { - static Storage temp; - return temp; - } - } - } - -public: - - /** Unsafe access to the underlying data structure with no wrapping support; requires that (x, y) is in bounds. */ - inline const Storage& fastGet(int x, int y) const { - debugAssert(((uint32)x < w) && ((uint32)y < h)); - return data[x + y * w]; - } - - /** Unsafe access to the underlying data structure with no wrapping support; requires that (x, y) is in bounds. */ - inline void fastSet(int x, int y, const Storage& v) { - debugAssert(((uint32)x < w) && ((uint32)y < h)); - data[x + y * w] = v; - } - -protected: - - /** Given four control points and a value on the range [0, 1) - evaluates the Catmull-rom spline between the times of the - middle two control points */ - Compute bicubic(const Compute* ctrl, double s) const { - - // f = B * S * ctrl' - - // B matrix: Catmull-Rom spline basis - static const double B[4][4] = { - { 0.0, -0.5, 1.0, -0.5}, - { 1.0, 0.0, -2.5, 1.5}, - { 0.0, 0.5, 2.0, -1.5}, - { 0.0, 0.0, -0.5, 0.5}}; - - // S: Powers of the fraction - double S[4]; - double s2 = s * s; - S[0] = 1.0; - S[1] = s; - S[2] = s2; - S[3] = s2 * s; - - Compute sum(ZERO); - - for (int c = 0; c < 4; ++c) { - double coeff = 0.0; - for (int power = 0; power < 4; ++power) { - coeff += B[c][power] * S[power]; - } - sum += ctrl[c] * coeff; - } - - return sum; - } - - - Map2D(int w, int h, WrapMode wrap) : w(0), h(0), _wrapMode(wrap), m_changed(1) { - ZERO = Storage(Compute(Storage()) * 0); - resize(w, h); - } - -public: - - /** - Although Map2D is not threadsafe (except for the setChanged() method), - you can use this mutex to create your own threadsafe access to a Map2D. - Not used by the default implementation. - */ - GMutex mutex; - - static Ref create(int w = 0, int h = 0, WrapMode wrap = WrapMode::ERROR) { - return new Map2D(w, h, wrap); - } - - /** Resizes without clearing, leaving garbage. - */ - void resize(uint32 newW, uint32 newH) { - if ((newW != w) || (newH != h)) { - w = newW; - h = newH; - data.resize(w * h); - setChanged(true); - } - } - - /** - Returns true if this map has been written to since the last call to setChanged(false). - This is useful if you are caching a texture map other value that must be recomputed - whenever this changes. - */ - bool changed() { - return m_changed.value() != 0; - } - - /** Set/unset the changed flag. */ - void setChanged(bool c) { - m_changed = c ? 1 : 0; - } - - /** Returns a pointer to the underlying row-major data. There is no padding at the end of the row. - Be careful--this will be reallocated during a resize. You should call setChanged(true) if you mutate the array.*/ - Storage* getCArray() { - return data.getCArray(); - } - - - const Storage* getCArray() const { - return data.getCArray(); - } - - - /** Row-major array. You should call setChanged(true) if you mutate the array. */ - Array& getArray() { - return data; - } - - - const Array& getArray() const { - return data; - } - - /** is (x, y) strictly within the image bounds, or will it trigger some kind of wrap mode */ - inline bool inBounds(int x, int y) const { - return (((uint32)x < w) && ((uint32)y < h)); - } - - /** is (x, y) strictly within the image bounds, or will it trigger some kind of wrap mode */ - inline bool inBounds(const Vector2int16& v) const { - return inBounds(v.x, v.y); - } - - /** Get the value at (x, y). - - Note that the type of image->get(x, y) is - the storage type, not the computation - type. If the constructor promoting Storage to Compute rescales values - (as, for example Color3(Color3uint8&) does), this will not match the value - returned by Map2D::nearest. - */ - inline const Storage& get(int x, int y, WrapMode wrap) const { - if (((uint32)x < w) && ((uint32)y < h)) { - return data[x + y * w]; - } else { - // Remove the const to allow a slowGet on this object - // (we're returning a const reference so this is ok) - return const_cast(this)->slowGet(x, y, wrap); - } -# ifndef G3D_WIN32 - // gcc gives a useless warning that the above code might reach the end of the function; - // we use this line to supress the warning. - return ZERO; -# endif - } - - inline const Storage& get(int x, int y) const { - return get(x, y, _wrapMode); - } - - inline const Storage& get(const Vector2int16& p) const { - return get(p.x, p.y, _wrapMode); - } - - inline const Storage& get(const Vector2int16& p, WrapMode wrap) const { - return get(p.x, p.y, wrap); - } - - inline Storage& get(int x, int y, WrapMode wrap) { - return const_cast(const_cast(this)->get(x, y, wrap)); -# ifndef G3D_WIN32 - // gcc gives a useless warning that the above code might reach the end of the function; - // we use this line to supress the warning. - return ZERO; -# endif - } - - inline Storage& get(int x, int y) { - return const_cast(const_cast(this)->get(x, y)); -# ifndef G3D_WIN32 - // gcc gives a useless warning that the above code might reach the end of the function; - // we use this line to supress the warning. - return ZERO; -# endif - } - - inline Storage& get(const Vector2int16& p) { - return get(p.x, p.y); - } - - /** Sets the changed flag to true */ - inline void set(const Vector2int16& p, const Storage& v) { - set(p.x, p.y, v); - } - - /** Sets the changed flag to true */ - void set(int x, int y, const Storage& v, WrapMode wrap) { - setChanged(true); - if (((uint32)x < w) && ((uint32)y < h)) { - // In bounds, wrapping isn't an issue. - data[x + y * w] = v; - } else { - const_cast(slowGet(x, y, wrap)) = v; - } - } - - void set(int x, int y, const Storage& v) { - set(x, y, v, _wrapMode); - } - - - void setAll(const Storage& v) { - for(int i = 0; i < data.size(); ++i) { - data[i] = v; - } - setChanged(true); - } - - /** flips if @a flip is true*/ - void maybeFlipVertical(bool flip) { - if (flip) { - flipVertical(); - } - } - - virtual void flipVertical() { - int halfHeight = h/2; - Storage* d = data.getCArray(); - for (int y = 0; y < halfHeight; ++y) { - int o1 = y * w; - int o2 = (h - y - 1) * w; - for (int x = 0; x < (int)w; ++x) { - int i1 = o1 + x; - int i2 = o2 + x; - Storage temp = d[i1]; - d[i1] = d[i2]; - d[i2] = temp; - } - } - setChanged(true); - } - - virtual void flipHorizontal() { - int halfWidth = w / 2; - Storage* d = data.getCArray(); - for (int x = 0; x < halfWidth; ++x) { - for (int y = 0; y < (int)h; ++y) { - int i1 = y * w + x; - int i2 = y * w + (w - x - 1); - Storage temp = d[i1]; - d[i1] = d[i2]; - d[i2] = temp; - } - } - setChanged(true); - } - - /** - Crops this map so that it only contains pixels between (x, y) and (x + w - 1, y + h - 1) inclusive. - */ - virtual void crop(int newX, int newY, int newW, int newH) { - alwaysAssertM(newX + newW <= (int)w, "Cannot grow when cropping"); - alwaysAssertM(newY + newH <= (int)h, "Cannot grow when cropping"); - alwaysAssertM(newX >= 0 && newY >= 0, "Origin out of bounds."); - - // Always safe to copy towards the upper left, provided - // that we're iterating towards the lower right. This lets us avoid - // reallocating the underlying array. - for (int y = 0; y < newH; ++y) { - for (int x = 0; x < newW; ++x) { - data[x + y * newW] = data[(x + newX) + (y + newY) * w]; - } - } - - resize(newW, newH); - } - - /** iRounds to the nearest x0 and y0. */ - virtual void crop(const Rect2D& rect) { - crop(iRound(rect.x0()), iRound(rect.y0()), iRound(rect.x1()) - iRound(rect.x0()), iRound(rect.y1()) - iRound(rect.y0())); - } - - /** Returns the nearest neighbor. Pixel values are considered - to be at the upper left corner, so image->nearest(x, y) == image(x, y) - */ - inline Compute nearest(float x, float y, WrapMode wrap) const { - return Compute(get(iRound(x), iRound(y), wrap)); - } - - inline Compute nearest(float x, float y) const { - return nearest(x, y, _wrapMode); - } - - inline Compute nearest(const Vector2& p) const { - return nearest(p.x, p.y); - } - - /** Returns the average value of all elements of the map */ - Compute average() const { - if ((w == 0) || (h == 0)) { - return ZERO; - } - - // To avoid overflows, compute the average of row averages - - Compute rowSum = ZERO; - for (unsigned int y = 0; y < h; ++y) { - Compute sum = ZERO; - int offset = y * w; - for (unsigned int x = 0; x < w; ++x) { - sum += Compute(data[offset + x]); - } - rowSum += sum * (1.0f / w); - } - - return rowSum * (1.0f / h); - } - - /** - Needs to access elements from (floor(x), floor(y)) - to (floor(x) + 1, floor(y) + 1) and will use - the wrap mode appropriately (possibly generating - out of bounds errors). - - Guaranteed to match nearest(x, y) at integers. */ - Compute bilinear(float x, float y, WrapMode wrap) const { - int i = iFloor(x); - int j = iFloor(y); - - float fX = x - i; - float fY = y - j; - - // Horizontal interpolation, first row - Compute t0(get(i, j, wrap)); - Compute t1(get(i + 1, j, wrap)); - Compute A = lerp(t0, t1, fX); - - // Horizontal interpolation, second row - Compute t2(get(i, j + 1, wrap)); - Compute t3(get(i + 1, j + 1, wrap)); - Compute B = lerp(t2, t3, fX); - - // Vertical interpolation - return lerp(A, B, fY); - } - - Compute bilinear(float x, float y) const { - return bilinear(x, y, _wrapMode); - } - - inline Compute bilinear(const Vector2& p) const { - return bilinear(p.x, p.y, _wrapMode); - } - - inline Compute bilinear(const Vector2& p, WrapMode wrap) const { - return bilinear(p.x, p.y, wrap); - } - - /** - Uses Catmull-Rom splines to interpolate between grid - values. Guaranteed to match nearest(x, y) at integers. - */ - Compute bicubic(float x, float y, WrapMode wrap) const { - int i = iFloor(x); - int j = iFloor(y); - float fX = x - i; - float fY = y - j; - - // 'static' prevents constructors from being called - // every time through this loop. - static Compute vsample[4]; - for (int v = 0; v < 4; ++v) { - - // Horizontal interpolation - static Compute hsample[4]; - for (int u = 0; u < 4; ++u) { - hsample[u] = Compute(get(i + u - 1, j + v - 1, wrap)); - } - - vsample[v] = bicubic(hsample, fX); - } - - // Vertical interpolation - return bicubic(vsample, fY); - } - - Compute bicubic(float x, float y) const { - return bicubic(x, y, _wrapMode); - } - - inline Compute bicubic(const Vector2& p, WrapMode wrap) const { - return bicubic(p.x, p.y, wrap); - } - - inline Compute bicubic(const Vector2& p) const { - return bicubic(p.x, p.y, _wrapMode); - } - - /** Pixel width */ - inline int32 width() const { - return (int32)w; - } - - - /** Pixel height */ - inline int32 height() const { - return (int32)h; - } - - - /** Dimensions in pixels */ - Vector2int16 size() const { - return Vector2int16(w, h); - } - - /** Rectangle from (0, 0) to (w, h) */ - Rect2D rect2DBounds() const { - return Rect2D::xywh(0, 0, w, h); - } - - /** Number of bytes occupied by the image data and this structure */ - size_t sizeInMemory() const { - return data.size() * sizeof(Storage) + sizeof(*this); - } - - - WrapMode wrapMode() const { - return _wrapMode; - } - - - void setWrapMode(WrapMode m) { - _wrapMode = m; - } -}; - - - -} - -#endif // G3D_IMAGE_H diff --git a/externals/g3dlite/G3D.lib/include/G3D/Matrix.h b/externals/g3dlite/G3D.lib/include/G3D/Matrix.h deleted file mode 100644 index 481af940324..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Matrix.h +++ /dev/null @@ -1,634 +0,0 @@ -/** - @file Matrix.h - @author Morgan McGuire, morgan@cs.williams.edu - - @created 2005-10-23 - @edited 2007-07-18 - */ - -#ifndef G3D_MATRIX_H -#define G3D_MATRIX_H - -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/ReferenceCount.h" - -namespace G3D { - -/** - N x M matrix. - - The actual data is tracked internally by a reference counted pointer; - it is efficient to pass and assign Matrix objects because no data is actually copied. - This avoids the headache of pointers and allows natural math notation: - -
-    Matrix A, B, C;
-    // ...
-
-    C = A * f(B);
-    C = C.inverse();
-
-    A = Matrix::identity(4);
-    C = A;
-    C.set(0, 0, 2.0); // Triggers a copy of the data so that A remains unchanged.
-
-    // etc.
-
-  
- - The Matrix::debugNumCopyOps and Matrix::debugNumAllocOps counters - increment every time an operation forces the copy and allocation of matrices. You - can use these to detect slow operations when efficiency is a major concern. - - Some methods accept an output argument instead of returning a value. For example, - A = B.transpose() can also be invoked as B.transpose(A). - The latter may be more efficient, since Matrix may be able to re-use the storage of - A (if it has approximatly the right size and isn't currently shared with another matrix). - - @sa G3D::Matrix3, G3D::Matrix4, G3D::Vector2, G3D::Vector3, G3D::Vector4, G3D::CoordinateFrame - - @beta - */ -class Matrix { -public: - /** - Internal precision. Currently float, but this may become a templated class in the future - to allow operations like Matrix and Matrix. - - Not necessarily a plain-old-data type (e.g., could ComplexFloat), but must be something - with no constructor, that can be safely memcpyd, and that has a bit pattern of all zeros - when zero.*/ - typedef float T; - - /** Incremented every time the elements of a matrix are copied. Useful for profiling your - own code that uses Matrix to determine when it is slow due to copying.*/ - static int debugNumCopyOps; - - /** Incremented every time a new matrix object is allocated. Useful for profiling your - own code that uses Matrix to determine when it is slow due to allocation.*/ - static int debugNumAllocOps; - -private: -public: - - /** Used internally by Matrix. - - Does not throw exceptions-- assumes the caller has taken care of - argument checking. */ - class Impl : public ReferenceCountedObject { - public: - - static void* operator new(size_t size) { - return System::malloc(size); - } - - static void operator delete(void* p) { - System::free(p); - } - - ~Impl(); - - private: - friend class Matrix; - - /** elt[r][c] = the element. Pointers into data.*/ - T** elt; - - /** Row major data for the entire matrix. */ - T* data; - - /** The number of rows */ - int R; - - /** The number of columns */ - int C; - - int dataSize; - - /** If R*C is much larger or smaller than the current, deletes all previous data - and resets to random data. Otherwise re-uses existing memory and just resets - R, C, and the row pointers. */ - void setSize(int newRows, int newCols); - - inline Impl() : elt(NULL), data(NULL), R(0), C(0), dataSize(0) {} - - Impl(const Matrix3& M); - - Impl(const Matrix4& M); - - inline Impl(int r, int c) : elt(NULL), data(NULL), R(0), C(0), dataSize(0) { - setSize(r, c); - } - - Impl& operator=(const Impl& m); - - inline Impl(const Impl& B) : elt(NULL), data(NULL), R(0), C(0), dataSize(0) { - // Use the assignment operator - *this = B; - } - - void setZero(); - - inline void set(int r, int c, T v) { - debugAssert(r < R); - debugAssert(c < C); - elt[r][c] = v; - } - - inline const T& get(int r, int c) const { - debugAssert(r < R); - debugAssert(c < C); - return elt[r][c]; - } - - /** Multiplies this by B and puts the result in out. */ - void mul(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void add(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void add(T B, Impl& out) const; - - /** Ok if out == this or out == B */ - void sub(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void sub(T B, Impl& out) const; - - /** B - this */ - void lsub(T B, Impl& out) const; - - /** Ok if out == this or out == B */ - void arrayMul(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void mul(T B, Impl& out) const; - - /** Ok if out == this or out == B */ - void arrayDiv(const Impl& B, Impl& out) const; - - /** Ok if out == this or out == B */ - void div(T B, Impl& out) const; - - void negate(Impl& out) const; - - /** Slow way of computing an inverse; for reference */ - void inverseViaAdjoint(Impl& out) const; - - /** Use Gaussian elimination with pivots to solve for the inverse destructively in place. */ - void inverseInPlaceGaussJordan(); - - void adjoint(Impl& out) const; - - /** Matrix of all cofactors */ - void cofactor(Impl& out) const; - - /** - Cofactor [r][c] is defined as C[r][c] = -1 ^(r+c) * det(A[r][c]), - where A[r][c] is the (R-1)x(C-1) matrix formed by removing row r and - column c from the original matrix. - */ - T cofactor(int r, int c) const; - - /** Ok if out == this or out == B */ - void transpose(Impl& out) const; - - T determinant() const; - - /** Determinant computed without the given row and column */ - T determinant(int r, int c) const; - - void arrayLog(Impl& out) const; - - void arrayExp(Impl& out) const; - - void arraySqrt(Impl& out) const; - - void arrayCos(Impl& out) const; - - void arraySin(Impl& out) const; - - void swapRows(int r0, int r1); - - void swapAndNegateCols(int c0, int c1); - - void mulRow(int r, const T& v); - - void abs(Impl& out) const; - - /** Makes a (R-1)x(C-1) copy of this matrix */ - void withoutRowAndCol(int excludeRow, int excludeCol, Impl& out) const; - - bool anyNonZero() const; - - bool allNonZero() const; - - void setRow(int r, const T* vals); - - void setCol(int c, const T* vals); - }; -private: - - typedef ReferenceCountedPointer ImplRef; - - ImplRef impl; - - inline Matrix(ImplRef i) : impl(i) {} - inline Matrix(Impl* i) : impl(ImplRef(i)) {} - - /** Used by SVD */ - class SortRank { - public: - T value; - int col; - - inline bool operator>(const SortRank& x) const { - return x.value > value; - } - - inline bool operator<(const SortRank& x) const { - return x.value < value; - } - - inline bool operator>=(const SortRank& x) const { - return x.value >= value; - } - - inline bool operator<=(const SortRank& x) const { - return x.value <= value; - } - - inline bool operator==(const SortRank& x) const { - return x.value == value; - } - - inline bool operator!=(const SortRank& x) const { - return x.value != value; - } - }; - - Matrix vectorPseudoInverse() const; - Matrix partitionPseudoInverse() const; - Matrix colPartPseudoInverse() const; - Matrix rowPartPseudoInverse() const; - - Matrix col2PseudoInverse(const Matrix& B) const; - Matrix col3PseudoInverse(const Matrix& B) const; - Matrix col4PseudoInverse(const Matrix& B) const; - Matrix row2PseudoInverse(const Matrix& B) const; - Matrix row3PseudoInverse(const Matrix& B) const; - Matrix row4PseudoInverse(const Matrix& B) const; - -public: - - Matrix() : impl(new Impl(0, 0)) {} - - Matrix(const Matrix3& M) : impl(new Impl(M)) {} - - Matrix(const Matrix4& M) : impl(new Impl(M)) {} - - template - static Matrix fromDiagonal(const Array& d) { - Matrix D = zero(d.length(), d.length()); - for (int i = 0; i < d.length(); ++i) { - D.set(i, i, d[i]); - } - return D; - } - - static Matrix fromDiagonal(const Matrix& d); - - /** Returns a new matrix that is all zero. */ - Matrix(int R, int C) : impl(new Impl(R, C)) { - impl->setZero(); - } - - /** Returns a new matrix that is all zero. */ - static Matrix zero(int R, int C); - - /** Returns a new matrix that is all one. */ - static Matrix one(int R, int C); - - /** Returns a new identity matrix */ - static Matrix identity(int N); - - /** Uniformly distributed values between zero and one. */ - static Matrix random(int R, int C); - - /** The number of rows */ - inline int rows() const { - return impl->R; - } - - /** Number of columns */ - inline int cols() const { - return impl->C; - } - - /** Generally more efficient than A * B */ - Matrix& operator*=(const T& B); - - /** Generally more efficient than A / B */ - Matrix& operator/=(const T& B); - - /** Generally more efficient than A + B */ - Matrix& operator+=(const T& B); - - /** Generally more efficient than A - B */ - Matrix& operator-=(const T& B); - - /** No performance advantage over A * B because - matrix multiplication requires intermediate - storage. */ - Matrix& operator*=(const Matrix& B); - - /** Generally more efficient than A + B */ - Matrix& operator+=(const Matrix& B); - - /** Generally more efficient than A - B */ - Matrix& operator-=(const Matrix& B); - - /** Returns a new matrix that is a subset of this one, - from r1:r2 to c1:c2, inclusive.*/ - Matrix subMatrix(int r1, int r2, int c1, int c2) const; - - /** Matrix multiplication. To perform element-by-element multiplication, - see arrayMul. */ - inline Matrix operator*(const Matrix& B) const { - Matrix C(impl->R, B.impl->C); - impl->mul(*B.impl, *C.impl); - return C; - } - - /** See also A *= B, which is more efficient in many cases */ - inline Matrix operator*(const T& B) const { - Matrix C(impl->R, impl->C); - impl->mul(B, *C.impl); - return C; - } - - /** See also A += B, which is more efficient in many cases */ - inline Matrix operator+(const Matrix& B) const { - Matrix C(impl->R, impl->C); - impl->add(*B.impl, *C.impl); - return C; - } - - /** See also A -= B, which is more efficient in many cases */ - inline Matrix operator-(const Matrix& B) const { - Matrix C(impl->R, impl->C); - impl->sub(*B.impl, *C.impl); - return C; - } - - /** See also A += B, which is more efficient in many cases */ - inline Matrix operator+(const T& v) const { - Matrix C(impl->R, impl->C); - impl->add(v, *C.impl); - return C; - } - - /** See also A -= B, which is more efficient in many cases */ - inline Matrix operator-(const T& v) const { - Matrix C(impl->R, impl->C); - impl->sub(v, *C.impl); - return C; - } - - - Matrix operator>(const T& scalar) const; - - Matrix operator<(const T& scalar) const; - - Matrix operator>=(const T& scalar) const; - - Matrix operator<=(const T& scalar) const; - - Matrix operator==(const T& scalar) const; - - Matrix operator!=(const T& scalar) const; - - /** scalar B - this */ - inline Matrix lsub(const T& B) const { - Matrix C(impl->R, impl->C); - impl->lsub(B, *C.impl); - return C; - } - - inline Matrix arrayMul(const Matrix& B) const { - Matrix C(impl->R, impl->C); - impl->arrayMul(*B.impl, *C.impl); - return C; - } - - Matrix3 toMatrix3() const; - - Matrix4 toMatrix4() const; - - Vector2 toVector2() const; - - Vector3 toVector3() const; - - Vector4 toVector4() const; - - /** Mutates this */ - void arrayMulInPlace(const Matrix& B); - - /** Mutates this */ - void arrayDivInPlace(const Matrix& B); - - // Declares an array unary method and its explicit-argument counterpart -# define DECLARE_METHODS_1(method)\ - inline Matrix method() const {\ - Matrix C(impl->R, impl->C);\ - impl->method(*C.impl);\ - return C;\ - }\ - void method(Matrix& out) const; - - - DECLARE_METHODS_1(abs) - DECLARE_METHODS_1(arrayLog) - DECLARE_METHODS_1(arrayExp) - DECLARE_METHODS_1(arraySqrt) - DECLARE_METHODS_1(arrayCos) - DECLARE_METHODS_1(arraySin) - DECLARE_METHODS_1(negate) - -# undef DECLARE_METHODS_1 - - inline Matrix operator-() const { - return negate(); - } - - /** - A-1 computed using the Gauss-Jordan algorithm, - for square matrices. - Run time is O(R3), where R is the - number of rows. - */ - inline Matrix inverse() const { - Impl* A = new Impl(*impl); - A->inverseInPlaceGaussJordan(); - return Matrix(A); - } - - inline T determinant() const { - return impl->determinant(); - } - - /** - AT - */ - inline Matrix transpose() const { - Impl* A = new Impl(cols(), rows()); - impl->transpose(*A); - return Matrix(A); - } - - /** Transpose in place; more efficient than transpose */ - void transpose(Matrix& out) const; - - inline Matrix adjoint() const { - Impl* A = new Impl(cols(), rows()); - impl->adjoint(*A); - return Matrix(A); - } - - /** - (ATA)-1AT) computed - using SVD. - - @param tolerance Use -1 for automatic tolerance. - */ - Matrix pseudoInverse(float tolerance = -1) const; - - /** Called from pseudoInverse when the matrix has size > 4 along some dimension.*/ - Matrix svdPseudoInverse(float tolerance = -1) const; - - /** - (ATA)-1AT) computed - using Gauss-Jordan elimination. - */ - inline Matrix gaussJordanPseudoInverse() const { - Matrix trans = transpose(); - return (trans * (*this)).inverse() * trans; - } - - /** Singular value decomposition. Factors into three matrices - such that @a this = @a U * fromDiagonal(@a d) * @a V.transpose(). - - The matrix must have at least as many rows as columns. - - Run time is O(C2*R). - - @param sort If true (default), the singular values - are arranged so that D is sorted from largest to smallest. - */ - void svd(Matrix& U, Array& d, Matrix& V, bool sort = true) const; - - void set(int r, int c, T v); - - void setCol(int c, const Matrix& vec); - - void setRow(int r, const Matrix& vec); - - Matrix col(int c) const; - - Matrix row(int r) const; - - T get(int r, int c) const; - - Vector2int16 size() const { - return Vector2int16(rows(), cols()); - } - - int numElements() const { - return rows() * cols(); - } - - void swapRows(int r0, int r1); - - /** Swaps columns c0 and c1 and negates both */ - void swapAndNegateCols(int c0, int c1); - - void mulRow(int r, const T& v); - - /** Returns true if any element is non-zero */ - bool anyNonZero() const; - - /** Returns true if all elements are non-zero */ - bool allNonZero() const; - - inline bool allZero() const { - return !anyNonZero(); - } - - inline bool anyZero() const { - return !allNonZero(); - } - - /** Serializes in Matlab source format */ - void serialize(TextOutput& t) const; - - std::string toString(const std::string& name) const; - - std::string toString() const { - static const std::string name = ""; - return toString(name); - } - - /** 2-norm squared: sum(squares). (i.e., dot product with itself) */ - double normSquared() const; - - /** 2-norm (sqrt(sum(squares)) */ - double norm() const; - - /** - Low-level SVD functionality. Useful for applications that do not want - to construct a Matrix but need to perform the SVD operation. - - this = U * D * V' - - Assumes that rows >= cols - - @return NULL on success, a string describing the error on failure. - @param U rows x cols matrix to be decomposed, gets overwritten with U, a rows x cols matrix with orthogonal columns. - @param D vector of singular values of a (diagonal of the D matrix). Length cols. - @param V returns the right orthonormal transformation matrix, size cols x cols - - @cite Based on Dianne Cook's implementation, which is adapted from - svdecomp.c in XLISP-STAT 2.1, which is code from Numerical Recipes - adapted by Luke Tierney and David Betz. The Numerical Recipes code - is adapted from Forsythe et al, who based their code on Golub and - Reinsch's original implementation. - */ - static const char* svdCore(float** U, int rows, int cols, float* D, float** V); - -}; - -} - -inline G3D::Matrix operator-(const G3D::Matrix::T& v, const G3D::Matrix& M) { - return M.lsub(v); -} - -inline G3D::Matrix operator*(const G3D::Matrix::T& v, const G3D::Matrix& M) { - return M * v; -} - -inline G3D::Matrix operator+(const G3D::Matrix::T& v, const G3D::Matrix& M) { - return M + v; -} - -inline G3D::Matrix abs(const G3D::Matrix& M) { - return M.abs(); -} - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/Matrix2.h b/externals/g3dlite/G3D.lib/include/G3D/Matrix2.h deleted file mode 100644 index eaf4aefa220..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Matrix2.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef G3D_MATRIX2_H -#define G3D_MATRIX2_H - -#include "G3D/platform.h" -#include "G3D/Vector2.h" - -namespace G3D { - -/** @beta */ -class Matrix2 { -private: - - float data[2][2]; - -public: - - inline Matrix2() { - data[0][0] = 1.0f; data[0][1] = 0.0f; - data[1][0] = 0.0f; data[1][1] = 1.0f; - } - - inline Matrix2(float v00, float v01, float v10, float v11) { - data[0][0] = v00; data[0][1] = v01; - data[1][0] = v10; data[1][1] = v11; - } - - inline Vector2 operator*(const Vector2& v) const { - return Vector2(data[0][0] * v[0] + data[0][1] * v[1], - data[1][0] * v[0] + data[1][1] * v[1]); - } - - inline Matrix2 inverse() const { - return Matrix2(data[0][0], data[1][0], - data[0][1], data[1][1]) * (1.0f / determinant()); - } - - inline Matrix2 transpose() const { - return Matrix2(data[0][0], data[1][0], - data[0][1], data[1][1]); - } - - inline float determinant() const { - return data[0][0] * data[1][1] - data[0][1] * data[1][0]; - } - - inline Matrix2 operator*(float f) const { - return Matrix2(data[0][0] * f, data[0][1] * f, - data[1][0] * f, data[1][1] * f); - } - - inline Matrix2 operator/(float f) const { - return Matrix2(data[0][0] / f, data[0][1] / f, - data[1][0] / f, data[1][1] / f); - } - - inline float* operator[](int i) { - debugAssert(i >= 0 && i <= 2); - return data[i]; - } - - inline const float* operator[](int i) const { - debugAssert(i >= 0 && i <= 1); - return data[i]; - } -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Matrix3.h b/externals/g3dlite/G3D.lib/include/G3D/Matrix3.h deleted file mode 100644 index ad09cd3860f..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Matrix3.h +++ /dev/null @@ -1,323 +0,0 @@ -/** - @file Matrix3.h - - 3x3 matrix class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-04-05 - */ - -#ifndef G3D_MATRIX3_H -#define G3D_MATRIX3_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/debugAssert.h" - -#include - -namespace G3D { - -/** - 3x3 matrix. Do not subclass. - */ -class Matrix3 { -private: - - float elt[3][3]; - - // Hidden operators - bool operator<(const Matrix3&) const; - bool operator>(const Matrix3&) const; - bool operator<=(const Matrix3&) const; - bool operator>=(const Matrix3&) const; - -public: - - /** Initial values are undefined for performance. See also - Matrix3::zero(), Matrix3::identity(), Matrix3::fromAxisAngle, etc.*/ - inline Matrix3() {} - - Matrix3 (class BinaryInput& b); - Matrix3 (const float aafEntry[3][3]); - Matrix3 (const Matrix3& rkMatrix); - Matrix3 (float fEntry00, float fEntry01, float fEntry02, - float fEntry10, float fEntry11, float fEntry12, - float fEntry20, float fEntry21, float fEntry22); - - bool fuzzyEq(const Matrix3& b) const; - - /** Constructs a matrix from a quaternion. - @cite Graphics Gems II, p. 351--354 - @cite Implementation from Watt and Watt, pg 362*/ - Matrix3(const class Quat& q); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** - Sets all elements. - */ - void set(float fEntry00, float fEntry01, float fEntry02, - float fEntry10, float fEntry11, float fEntry12, - float fEntry20, float fEntry21, float fEntry22); - - /** - * member access, allows use of construct mat[r][c] - */ - inline float* operator[] (int iRow) { - debugAssert(iRow >= 0); - debugAssert(iRow < 3); - return (float*)&elt[iRow][0]; - } - - inline const float* operator[] (int iRow) const { - debugAssert(iRow >= 0); - debugAssert(iRow < 3); - return (const float*)&elt[iRow][0]; - } - - inline operator float* () { - return (float*)&elt[0][0]; - } - - inline operator const float* () const{ - return (const float*)&elt[0][0]; - } - - /** @deprecated */ - Vector3 getColumn (int iCol) const; - /** @deprecated */ - Vector3 getRow (int iRow) const; - - Vector3 column(int c) const; - const Vector3& row(int r) const; - - void setColumn(int iCol, const Vector3 &vector); - void setRow(int iRow, const Vector3 &vector); - - // assignment and comparison - inline Matrix3& operator= (const Matrix3& rkMatrix) { - memcpy(elt, rkMatrix.elt, 9 * sizeof(float)); - return *this; - } - - bool operator== (const Matrix3& rkMatrix) const; - bool operator!= (const Matrix3& rkMatrix) const; - - // arithmetic operations - Matrix3 operator+ (const Matrix3& rkMatrix) const; - Matrix3 operator- (const Matrix3& rkMatrix) const; - /** Matrix-matrix multiply */ - Matrix3 operator* (const Matrix3& rkMatrix) const; - Matrix3 operator- () const; - - Matrix3& operator+= (const Matrix3& rkMatrix); - Matrix3& operator-= (const Matrix3& rkMatrix); - Matrix3& operator*= (const Matrix3& rkMatrix); - - /** - * matrix * vector [3x3 * 3x1 = 3x1] - */ - inline Vector3 operator* (const Vector3& v) const { - Vector3 kProd; - - for (int r = 0; r < 3; ++r) { - kProd[r] = - elt[r][0] * v[0] + - elt[r][1] * v[1] + - elt[r][2] * v[2]; - } - - return kProd; - } - - - /** - * vector * matrix [1x3 * 3x3 = 1x3] - */ - friend Vector3 operator* (const Vector3& rkVector, - const Matrix3& rkMatrix); - - /** - * matrix * scalar - */ - Matrix3 operator* (float fScalar) const; - - /** scalar * matrix */ - friend Matrix3 operator* (double fScalar, const Matrix3& rkMatrix); - friend Matrix3 operator* (float fScalar, const Matrix3& rkMatrix); - friend Matrix3 operator* (int fScalar, const Matrix3& rkMatrix); - -private: - /** Multiplication where out != A and out != B */ - static void _mul(const Matrix3& A, const Matrix3& B, Matrix3& out); -public: - - /** Optimized implementation of out = A * B. It is safe (but slow) to call - with A, B, and out possibly pointer equal to one another.*/ - // This is a static method so that it is not ambiguous whether "this" - // is an input or output argument. - inline static void mul(const Matrix3& A, const Matrix3& B, Matrix3& out) { - if ((&out == &A) || (&out == &B)) { - // We need a temporary anyway, so revert to the stack method. - out = A * B; - } else { - // Optimized in-place multiplication. - _mul(A, B, out); - } - } - -private: - static void _transpose(const Matrix3& A, Matrix3& out); -public: - - /** Optimized implementation of out = A.transpose(). It is safe (but slow) to call - with A and out possibly pointer equal to one another. - - Note that A.transpose() * v can be computed - more efficiently as v * A. - */ - inline static void transpose(const Matrix3& A, Matrix3& out) { - if (&A == &out) { - out = A.transpose(); - } else { - _transpose(A, out); - } - } - - /** Returns true if the rows and column L2 norms are 1.0 and the rows are orthogonal. */ - bool isOrthonormal() const; - - Matrix3 transpose () const; - bool inverse (Matrix3& rkInverse, float fTolerance = 1e-06) const; - Matrix3 inverse (float fTolerance = 1e-06) const; - float determinant () const; - - /** singular value decomposition */ - void singularValueDecomposition (Matrix3& rkL, Vector3& rkS, - Matrix3& rkR) const; - /** singular value decomposition */ - void singularValueComposition (const Matrix3& rkL, - const Vector3& rkS, const Matrix3& rkR); - - /** Gram-Schmidt orthonormalization (applied to columns of rotation matrix) */ - void orthonormalize(); - - /** orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12) */ - void qDUDecomposition (Matrix3& rkQ, Vector3& rkD, - Vector3& rkU) const; - - float spectralNorm () const; - - /** matrix must be orthonormal */ - void toAxisAngle(Vector3& rkAxis, float& rfRadians) const; - - static Matrix3 fromDiagonal(const Vector3& d) { - return Matrix3(d.x, 0, 0, - 0, d.y, 0, - 0, 0, d.z); - } - - static Matrix3 fromAxisAngle(const Vector3& rkAxis, float fRadians); - - /** - * The matrix must be orthonormal. The decomposition is yaw*pitch*roll - * where yaw is rotation about the Up vector, pitch is rotation about the - * right axis, and roll is rotation about the Direction axis. - */ - bool toEulerAnglesXYZ (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesXZY (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesYXZ (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesYZX (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesZXY (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - bool toEulerAnglesZYX (float& rfYAngle, float& rfPAngle, - float& rfRAngle) const; - static Matrix3 fromEulerAnglesXYZ (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesXZY (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesYXZ (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesYZX (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesZXY (float fYAngle, float fPAngle, float fRAngle); - static Matrix3 fromEulerAnglesZYX (float fYAngle, float fPAngle, float fRAngle); - - /** eigensolver, matrix must be symmetric */ - void eigenSolveSymmetric (float afEigenvalue[3], - Vector3 akEigenvector[3]) const; - - static void tensorProduct (const Vector3& rkU, const Vector3& rkV, - Matrix3& rkProduct); - std::string toString() const; - - static const float EPSILON; - - // Special values. - // The unguaranteed order of initialization of static variables across - // translation units can be a source of annoying bugs, so now the static - // special values (like Vector3::ZERO, Color3::WHITE, ...) are wrapped - // inside static functions that return references to them. - // These functions are intentionally not inlined, because: - // "You might be tempted to write [...] them as inline functions - // inside their respective header files, but this is something you - // must definitely not do. An inline function can be duplicated - // in every file in which it appears śóő˝ and this duplication - // includes the static object definition. Because inline functions - // automatically default to internal linkage, this would result in - // having multiple static objects across the various translation - // units, which would certainly cause problems. So you must - // ensure that there is only one definition of each wrapping - // function, and this means not making the wrapping functions inline", - // according to Chapter 10 of "Thinking in C++, 2nd ed. Volume 1" by Bruce Eckel, - // http://www.mindview.net/ - static const Matrix3& zero(); - static const Matrix3& identity(); - -protected: - - // support for eigensolver - void tridiagonal (float afDiag[3], float afSubDiag[3]); - bool qLAlgorithm (float afDiag[3], float afSubDiag[3]); - - // support for singular value decomposition - static const float ms_fSvdEpsilon; - static const int ms_iSvdMaxIterations; - static void bidiagonalize (Matrix3& kA, Matrix3& kL, - Matrix3& kR); - static void golubKahanStep (Matrix3& kA, Matrix3& kL, - Matrix3& kR); - - // support for spectral norm - static float maxCubicRoot (float afCoeff[3]); - -}; - - -//---------------------------------------------------------------------------- -/** v * M == M.transpose() * v */ -inline Vector3 operator* (const Vector3& rkPoint, const Matrix3& rkMatrix) { - Vector3 kProd; - - for (int r = 0; r < 3; ++r) { - kProd[r] = - rkPoint[0] * rkMatrix.elt[0][r] + - rkPoint[1] * rkMatrix.elt[1][r] + - rkPoint[2] * rkMatrix.elt[2][r]; - } - - return kProd; -} - - -} // namespace - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/Matrix4.h b/externals/g3dlite/G3D.lib/include/G3D/Matrix4.h deleted file mode 100644 index 5bb6cecfdf9..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Matrix4.h +++ /dev/null @@ -1,206 +0,0 @@ -/** - @file Matrix4.h - - 4x4 matrix class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-10-02 - @edited 2007-04-05 - */ - -#ifndef G3D_MATRIX4_H -#define G3D_MATRIX4_H - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning (push) -# pragma warning( disable : 4127 ) -#endif - -#include "G3D/platform.h" -#include "G3D/debugAssert.h" -#include "G3D/Matrix3.h" -#include "G3D/Vector3.h" - -namespace G3D { - -/** - A 4x4 matrix. - - See also G3D::CoordinateFrame, G3D::Matrix3, G3D::Quat - */ -class Matrix4 { -private: - - float elt[4][4]; - - /** - Computes the determinant of the 3x3 matrix that lacks excludeRow - and excludeCol. - */ - float subDeterminant(int excludeRow, int excludeCol) const; - - // Hidden operators - bool operator<(const Matrix4&) const; - bool operator>(const Matrix4&) const; - bool operator<=(const Matrix4&) const; - bool operator>=(const Matrix4&) const; - -public: - Matrix4( - float r1c1, float r1c2, float r1c3, float r1c4, - float r2c1, float r2c2, float r2c3, float r2c4, - float r3c1, float r3c2, float r3c3, float r3c4, - float r4c1, float r4c2, float r4c3, float r4c4); - - /** - init should be row major. - */ - Matrix4(const float* init); - - /** - a is the upper left 3x3 submatrix and b is the upper right 3x1 submatrix. The last row of the created matrix is (0,0,0,1). - */ - Matrix4(const class Matrix3& upper3x3, const class Vector3& lastCol = Vector3::zero()); - - Matrix4(const class CoordinateFrame& c); - - Matrix4(const double* init); - - Matrix4(); - - /** Produces an RT transformation that nearly matches this Matrix4. - Because a Matrix4 may not be precisely a rotation and translation, - this may introduce error. */ - class CoordinateFrame approxCoordinateFrame() const; - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Matrix4& identity(); - static const Matrix4& zero(); - - inline float* operator[](int r) { - debugAssert(r >= 0); - debugAssert(r < 4); - return (float*)&elt[r]; - } - - inline const float* operator[](int r) const { - debugAssert(r >= 0); - debugAssert(r < 4); - return (const float*)&elt[r]; - } - - inline operator float* () { - return (float*)&elt[0][0]; - } - - inline operator const float* () const { - return (const float*)&elt[0][0]; - } - - Matrix4 operator*(const Matrix4& other) const; - - class Matrix3 upper3x3() const; - - /** Homogeneous multiplication. Let k = M * [v w]^T. result = k.xyz() / k.w */ - class Vector3 homoMul(const class Vector3& v, float w) const; - - /** - Constructs an orthogonal projection matrix from the given parameters. - Near and far are the NEGATIVE of the near and far plane Z values - (to follow OpenGL conventions). - */ - static Matrix4 orthogonalProjection( - float left, - float right, - float bottom, - float top, - float nearval, - float farval); - - static Matrix4 orthogonalProjection( - const class Rect2D& rect, - float nearval, - float farval); - - static Matrix4 perspectiveProjection( - float left, - float right, - float bottom, - float top, - float nearval, - float farval); - - void setRow(int r, const class Vector4& v); - void setColumn(int c, const Vector4& v); - - /** @deprecated */ - Vector4 getRow(int r) const; - /** @deprecated */ - Vector4 getColumn(int c) const; - - const Vector4& row(int r) const; - Vector4 column(int c) const; - - Matrix4 operator*(const float s) const; - Vector4 operator*(const Vector4& vector) const; - - Matrix4 transpose() const; - - bool operator!=(const Matrix4& other) const; - bool operator==(const Matrix4& other) const; - - float determinant() const; - Matrix4 inverse() const; - - /** - Transpose of the cofactor matrix (used in computing the inverse). - Note: This is in fact only one type of adjoint. More generally, - an adjoint of a matrix is any mapping of a matrix which possesses - certain properties. This returns the so-called adjugate - or classical adjoint. - */ - Matrix4 adjoint() const; - Matrix4 cofactor() const; - - /** Serializes row-major */ - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - std::string toString() const; - - /** 3D scale matrix */ - inline static Matrix4 scale(const Vector3& v) { - return Matrix4(v.x, 0, 0, 0, - 0, v.y, 0, 0, - 0, 0, v.z, 0, - 0, 0, 0, 1); - } - - /** 3D scale matrix */ - inline static Matrix4 scale(float x, float y, float z) { - return scale(Vector3(x, y, z)); - } - - /** 3D scale matrix */ - inline static Matrix4 scale(float s) { - return scale(s,s,s); - } - - /** 3D translation matrix */ - inline static Matrix4 translation(const Vector3& v) { - return Matrix4(Matrix3::identity(), v); - } -}; - - - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/MeshAlg.h b/externals/g3dlite/G3D.lib/include/G3D/MeshAlg.h deleted file mode 100644 index be381eff117..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/MeshAlg.h +++ /dev/null @@ -1,718 +0,0 @@ -/** - @file MeshAlg.h - - Indexed Mesh algorithms. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-09-14 - @edited 2008-07-30 -*/ - -#ifndef G3D_MESHALG_H -#define G3D_MESHALG_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector3.h" -#include "G3D/CoordinateFrame.h" - -namespace G3D { - -/** - Indexed mesh algorithms. You have to build your own mesh class. -

- No mesh class is provided with G3D because there isn't an "ideal" - mesh format-- one application needs keyframed animation, another - skeletal animation, a third texture coordinates, a fourth - cannot precompute information, etc. Instead of compromising, this - class implements the hard parts of mesh computation and you can write - your own ideal mesh class on top of it. - */ -class MeshAlg { -public: - - enum Primitive {LINES, LINE_STRIP, TRIANGLES, TRIANGLE_STRIP, - TRIANGLE_FAN, QUADS, QUAD_STRIP, POINTS}; - - - /** Adjacency information for a vertex. - Does not contain the vertex position or normal, - which are stored in the MeshAlg::Geometry object. - Vertexs must be stored in an array - parallel to (indexed in the same way as) - MeshAlg::Geometry::vertexArray. - */ - class Vertex { - public: - Vertex() {} - - /** - Array of edges adjacent to this vertex. - Let e = edgeIndex[i]. - edge[(e >= 0) ? e : ~e].vertexIndex[0] == this - vertex index. - - Edges may be listed multiple times if they are - degenerate. - */ - Array edgeIndex; - - /** - Returns true if e or ~e is in the edgeIndex list. - */ - inline bool inEdge(int e) const { - return edgeIndex.contains(~e) || edgeIndex.contains(e); - } - - /** - Array of faces containing this vertex. Faces - may be listed multiple times if they are degenerate. - */ - Array faceIndex; - - inline bool inFace(int f) const { - debugAssert(f >= 0); - return faceIndex.contains(f); - } - }; - - - /** - Oriented, indexed triangle. - */ - class Face { - public: - Face(); - - /** - Used by Edge::faceIndex to indicate a missing face. - This is a large negative value. - */ - static const int NONE; - - - /** - Vertices in the face in counter-clockwise order. - Degenerate faces may include the same vertex multiple times. - */ - int vertexIndex[3]; - - inline bool containsVertex(int v) const { - return contains(vertexIndex, 3, v); - } - - /** - Edge indices in counter-clockwise order. Edges are - undirected, so it is important to know which way - each edge is pointing in a face. This is encoded - using negative indices. - - If edgeIndex[i] >= 0 then this face - contains the directed edge - between vertex indices - edgeArray[face.edgeIndex[i]].vertexIndex[0] - and - edgeArray[face.edgeIndex[i]].vertexIndex[1]. - - If edgeIndex[i] < 0 then - ~edgeIndex[i] (i.e. the two's - complement of) is used and this face contains the directed - edge between vertex indices - edgeArray[~face.edgeIndex[i]].vertexIndex[0] - and - edgeArray[~face.edgeIndex[i]].vertexIndex[1]. - - Degenerate faces may include the same edge multiple times. - */ - // Temporarily takes on the value Face::NONE during adjacency - // computation to indicate an edge that has not yet been assigned. - int edgeIndex[3]; - - inline bool containsEdge(int e) const { - if (e < 0) { - e = ~e; - } - return contains(edgeIndex, 3, e) || contains(edgeIndex, 3, ~e); - } - - /** Contains the forward edge e if e >= 0 and the backward edge - ~e otherwise. */ - inline bool containsDirectedEdge(int e) const { - return contains(edgeIndex, 3, e); - } - }; - - - /** Oriented, indexed edge */ - class Edge { - public: - Edge(); - - /** Degenerate edges may include the same vertex times. */ - int vertexIndex[2]; - - inline bool containsVertex(int v) const { - return contains(vertexIndex, 2, v); - } - - /** - The edge is directed forward in face 0 - backward in face 1. Face index of MeshAlg::Face::NONE - indicates a boundary (a.k.a. crack, broken) edge. - */ - int faceIndex[2]; - - /** Returns true if f is contained in the faceIndex array in either slot. - To see if it is forward in that face, just check edge.faceIndex[0] == f.*/ - inline bool inFace(int f) const { - return contains(faceIndex, 2, f); - } - - /** - Returns true if either faceIndex is NONE. - */ - inline bool boundary() const { - return (faceIndex[0] == Face::NONE) || - (faceIndex[1] == Face::NONE); - } - - /** - Returns the reversed edge. - */ - inline Edge reverse() const { - Edge e; - e.vertexIndex[0] = vertexIndex[1]; - e.vertexIndex[1] = vertexIndex[0]; - e.faceIndex[0] = faceIndex[1]; - e.faceIndex[1] = faceIndex[0]; - return e; - } - }; - - - /** - Convenient for passing around the per-vertex data that changes under - animation. The faces and edges are needed to interpret - these values. - */ - class Geometry { - public: - /** Vertex positions */ - Array vertexArray; - - /** Vertex normals */ - Array normalArray; - - /** - Assignment is optimized using SSE. - */ - Geometry& operator=(const Geometry& src); - - void clear() { - vertexArray.clear(); - normalArray.clear(); - } - }; - - /** - Given a set of vertices and a set of indices for traversing them - to create triangles, computes other mesh properties. - - Colocated vertices are treated as separate. To have - colocated vertices collapsed (necessary for many algorithms, - like shadowing), weld the mesh before computing adjacency. - - Recent change: In version 6.00, colocated vertices were automatically - welded by this routine and degenerate faces and edges were removed. That - is no longer the case. - - Where two faces meet, there are two opposite directed edges. These - are collapsed into a single bidirectional edge in the edgeArray. - If four faces meet exactly at the same edge, that edge will appear - twice in the array, and so on. If an edge is a boundary of the mesh - (i.e. if the edge has only one adjacent face) it will appear in the - array with one face index set to MeshAlg::Face::NONE. - - @param vertexGeometry %Vertex positions to use when deciding colocation. - @param indexArray Order to traverse vertices to make triangles - @param faceArray Output - @param edgeArray Output. Sorted so that boundary edges are at the end of the array. - @param vertexArray Output - */ - static void computeAdjacency( - const Array& vertexGeometry, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array& vertexArray); - - /** - @deprecated Use the other version of computeAdjacency, which takes Array. - @param facesAdjacentToVertex Output adjacentFaceArray[v] is an array of - indices for faces touching vertex index v - */ - static void computeAdjacency( - const Array& vertexArray, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array< Array >& facesAdjacentToVertex); - - /** - Computes some basic mesh statistics including: min, max mean and median, - edge lengths; and min, mean, median, and max face area. - - @param vertexGeometry %Vertex positions to use when deciding colocation. - @param indexArray Order to traverse vertices to make triangles - @param minEdgeLength Minimum edge length - @param meanEdgeLength Mean edge length - @param medianEdgeLength Median edge length - @param maxEdgeLength Max edge length - @param minFaceArea Minimum face area - @param meanFaceArea Mean face area - @param medianFaceArea Median face area - @param maxFaceArea Max face area - */ - static void computeAreaStatistics( - const Array& vertexArray, - const Array& indexArray, - double& minEdgeLength, - double& meanEdgeLength, - double& medianEdgeLength, - double& maxEdgeLength, - double& minFaceArea, - double& meanFaceArea, - double& medianFaceArea, - double& maxFaceArea); - -private: - /** - Computes the tangent space basis vectors for - a counter-clockwise oriented face. - - @cite Max McGuire - */ - static void computeTangentVectors( - const Vector3& normal, - const Vector3 position[3], - const Vector2 texCoord[3], - Vector3& tangent, - Vector3& binormal); - - /** Helper for weldAdjacency */ - static void weldBoundaryEdges( - Array& faceArray, - Array& edgeArray, - Array& vertexArray); - -public: - - /** - Computes tangent and binormal vectors, - which provide a (mostly) consistent - parameterization over the surface for - effects like bump mapping. In the resulting coordinate frame, - T = x (varies with texture s coordinate), B = y (varies with negative texture t coordinate), - and N = z for a right-handed coordinate frame. If a billboard is vertical on the screen - in view of the camera, the tangent space matches the camera's coordinate frame. - - The vertex, texCoord, tangent, and binormal - arrays are parallel arrays. - - The resulting tangent and binormal might not be exactly - perpendicular to each other. They are guaranteed to - be perpendicular to the normal. - - @cite Max McGuire - */ - static void computeTangentSpaceBasis( - const Array& vertexArray, - const Array& texCoordArray, - const Array& vertexNormalArray, - const Array& faceArray, - Array& tangent, - Array& binormal); - - /** @deprecated */ - static void computeNormals( - const Array& vertexArray, - const Array& faceArray, - const Array< Array >& adjacentFaceArray, - Array& vertexNormalArray, - Array& faceNormalArray); - - /** - Vertex normals are weighted by the area of adjacent faces. - Nelson Max showed this is superior to uniform weighting for - general meshes in jgt. - - @param vertexNormalArray Output. Unit length - @param faceNormalArray Output. Degenerate faces produce zero magnitude normals. Unit length - @see weld - */ - static void computeNormals( - const Array& vertexGeometry, - const Array& faceArray, - const Array& vertexArray, - Array& vertexNormalArray, - Array& faceNormalArray); - - /** Computes unit length normals in place using the other computeNormals methods. - If you already have a face array use another method; it will be faster. - @see weld*/ - static void computeNormals( - Geometry& geometry, - const Array& indexArray); - - /** - Computes face normals only. Significantly faster (especially if - normalize is false) than computeNormals. - @see weld - */ - static void computeFaceNormals( - const Array& vertexArray, - const Array& faceArray, - Array& faceNormals, - bool normalize = true); - - /** - Classifies each face as a backface or a front face relative - to the observer point P (which is at infinity when P.w = 0). - A face with normal exactly perpendicular to the observer vector - may be classified as either a front or a back face arbitrarily. - */ - static void identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& P, - Array& backface); - - /** A faster version of identifyBackfaces for the case where - face normals have already been computed */ - static void identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& P, - Array& backface, - const Array& faceNormals); - - /** - Welds nearby and colocated elements of the oldVertexArray together so that - newVertexArray contains no vertices within radius of one another. - Every vertex in newVertexPositions also appears in oldVertexPositions. - This is useful for downsampling meshes and welding cracks created by artist errors - or numerical imprecision. - - The two integer arrays map indices back and forth between the arrays according to: -

-     oldVertexArray[toOld[ni]] == newVertexArray[ni]
-     oldVertexArray[oi] == newVertexArray[toNew[ni]]
-     
- - Note that newVertexPositions is never longer than oldVertexPositions - and is shorter when vertices are welded. - - Welding with a large radius will effectively compute a lower level of detail for - the mesh. - - The welding method runs in roughly linear time in the length of oldVertexArray-- - a uniform spatial grid is used to achieve nearly constant time vertex collapses - for uniformly distributed vertices. - - It is sometimes desirable to keep the original vertex ordering but - identify the unique vertices. The following code computes - array canonical s.t. canonical[v] = first occurance of - a vertex near oldVertexPositions[v] in oldVertexPositions. - -
-        Array canonical(oldVertexPositions.size()), toNew, toOld;
-        computeWeld(oldVertexPositions, Array(), toNew, toOld, radius);
-        for (int v = 0; v < canonical.size(); ++v) {
-            canonical[v] = toOld[toNew[v]];
-        }
-     
- - See also G3D::MeshAlg::weldAdjacency. - - @cite The method is that described as the 'Grouper' in Baum, Mann, Smith, and Winget, - Making Radiosity Usable: Automatic Preprocessing and Meshing Techniques for - the Generation of Accurate Radiosity Solutions, Computer Graphics vol 25, no 4, July 1991. - - @deprecated Use weld. - */ - static void computeWeld( - const Array& oldVertexPositions, - Array& newVertexPositions, - Array& toNew, - Array& toOld, - double radius = G3D::fuzzyEpsilon); - - /** - Modifies the face, edge, and vertex arrays in place so that - colocated (within radius) vertices are treated as identical. - Note that the vertexArray and corresponding geometry will - contain elements that are no longer used. In the vertexArray, - these elements are initialized to MeshAlg::Vertex() but not - removed (because removal would change the indexing). - - This is a good preprocessing step for algorithms that are only - concerned with the shape of a mesh (e.g. cartoon rendering, fur, shadows) - and not the indexing of the vertices. - - Use this method when you have already computed adjacency information - and want to collapse colocated vertices within that data without - disturbing the actual mesh vertices or indexing scheme. - - If you have not computed adjacency already, use MeshAlg::computeWeld - instead and compute adjacency information after welding. - - @deprecated Use weld. - - @param faceArray Mutated in place. Size is maintained (degenerate - faces are not removed). - @param edgeArray Mutated in place. May shrink if boundary edges - are welded together. - @param vertexArray Mutated in place. Size is maintained (duplicate - vertices contain no adjacency info). - */ - static void weldAdjacency( - const Array& originalGeometry, - Array& faceArray, - Array& edgeArray, - Array& vertexArray, - double radius = G3D::fuzzyEpsilon); - - - /** - Counts the number of edges (in an edge array returned from - MeshAlg::computeAdjacency) that have only one adjacent face. - */ - static int countBoundaryEdges(const Array& edgeArray); - - - /** - Generates an array of integers from start to start + n - 1 that have run numbers - in series then omit the next skip before the next run. Useful for turning - a triangle list into an indexed face set. - - Example: -
-       createIndexArray(10, x);
-       // x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 
-
-       createIndexArray(5, x, 2);
-       // x = [2, 3, 4, 5, 6, 7] 
-
-       createIndexArray(6, x, 0, 2, 1);
-       // x = [0, 1, 3, 4, 6, 7]
-     
- */ - static void createIndexArray( - int n, - Array& array, - int start = 0, - int run = 1, - int skip = 0); - - /** - Computes a conservative, near-optimal axis aligned bounding box and sphere. - - @cite The bounding sphere uses the method from J. Ritter. An effcient bounding sphere. In Andrew S. Glassner, editor, Graphics Gems. Academic Press, Boston, MA, 1990. - - */ - static void computeBounds(const Array& vertex, class Box& box, class Sphere& sphere); - - /** Computes bounds for a subset of the vertices. It is ok if vertices appear more than once in the index array. */ - static void computeBounds(const Array& vertex, const Array& index, class Box& box, class Sphere& sphere); - - /** - Mutates geometry, texCoord, and indexArray so that the output has collocated vertices collapsed (welded). - - @param vertices Input and output - @param textureCoords Input and output - @param normals Output only - @param indices Input and output. This is an array of trilist indices. - @param oldToNewIndex Output argument - @param normalSmoothingAngle Varies from 0 (flat shading) to toRadians(180) for extremely smooth shading. Default is toRadians(70) - */ - static void weld( - Array& vertices, - Array& textureCoords, - Array& normals, - Array*>& indices, - float normalSmoothingAngle = toRadians(70.0f), - float vertexWeldRadius = 0.0001f, - float textureWeldRadius = 0.0001f, - float normalWeldRadius = 0.01f); - - inline static void weld( - Array& vertices, - Array& textureCoords, - Array& normals, - Array& indices, - float normalSmoothingAngle = toRadians(70.0f), - float vertexWeldRadius = 0.0002f, - float textureWeldRadius = 0.00001f, - float normalWeldRadius = 0.00001f) { - - Array*> meta; - meta.append(&indices); - weld(vertices, textureCoords, normals, meta, normalSmoothingAngle, vertexWeldRadius, textureWeldRadius, normalWeldRadius); - } - - /** - In debug mode, asserts that the adjacency references between the - face, edge, and vertex array are consistent. - */ - static void debugCheckConsistency( - const Array& faceArray, - const Array& edgeArray, - const Array& vertexArray); - - /** - Generates a unit square in the X-Z plane composed of a grid of wCells x hCells - squares and then transforms it by xform. - - @param vertex Output vertices - @param texCoord Output texture coordinates - @param index Output triangle list indices - @param textureScale Lower-right texture coordinate - @param spaceCentered If true, the coordinates generated are centered at the origin before the transformation. - @param twoSided If true, matching top and bottom planes are generated. - */ - static void generateGrid( - Array& vertex, - Array& texCoord, - Array& index, - int wCells = 10, - int hCells = 10, - const Vector2& textureScale = Vector2(1,1), - bool spaceCentered = true, - bool twoSided = true, - const CoordinateFrame& xform = CoordinateFrame()); - - /** Converts quadlist (QUADS), - triangle fan (TRIANGLE_FAN), - tristrip(TRIANGLE_STRIP), and quadstrip (QUAD_STRIP) indices into - triangle list (TRIANGLES) indices and appends them to outIndices. */ - template - static void toIndexedTriList( - const Array& inIndices, - MeshAlg::Primitive inType, - Array& outIndices) { - - debugAssert( - inType == MeshAlg::TRIANGLE_STRIP || - inType == MeshAlg::TRIANGLE_FAN || - inType == MeshAlg::QUADS || - inType == MeshAlg::QUAD_STRIP); - - const int inSize = inIndices.size(); - - switch(inType) { - case MeshAlg::TRIANGLE_FAN: - { - debugAssert(inSize >= 3); - - int N = outIndices.size(); - outIndices.resize(N + (inSize - 2) * 3); - - for (IndexType i = 1, outIndex = N; i <= (inSize - 2); ++i, outIndex += 3) { - outIndices[outIndex] = inIndices[0]; - outIndices[outIndex + 1] = inIndices[i]; - outIndices[outIndex + 2] = inIndices[i + 1]; - } - - break; - } - - case MeshAlg::TRIANGLE_STRIP: - { - debugAssert(inSize >= 3); - - int N = outIndices.size(); - outIndices.resize(N + (inSize - 2) * 3); - - bool atEven = false; - for (IndexType i = 0, outIndex = N; i <= (inSize - 2); ++i, outIndex += 3) { - if (atEven) { - outIndices[outIndex] = inIndices[i + 1]; - outIndices[outIndex + 1] = inIndices[i]; - outIndices[outIndex + 2] = inIndices[i + 2]; - atEven = false; - } else { - outIndices[outIndex] = inIndices[i]; - outIndices[outIndex + 1] = inIndices[i + 1]; - outIndices[outIndex + 2] = inIndices[i + 2]; - atEven = true; - } - } - - break; - } - - case MeshAlg::QUADS: - { - debugAssert(inIndices.size() >= 4); - - int N = outIndices.size(); - outIndices.resize(N + (inSize / 4) * 3); - - for (IndexType i = 0, outIndex = N; i <= (inSize - 4); i += 4, outIndex += 6) { - outIndices[outIndex] = inIndices[i]; - outIndices[outIndex + 1] = inIndices[i + 1]; - outIndices[outIndex + 2] = inIndices[i + 3]; - outIndices[outIndex + 3] = inIndices[i + 1]; - outIndices[outIndex + 4] = inIndices[i + 2]; - outIndices[outIndex + 5] = inIndices[i + 3]; - } - - break; - } - - case MeshAlg::QUAD_STRIP: - { - debugAssert(inIndices.size() >= 4); - - int N = outIndices.size(); - outIndices.resize(N + (inSize - 2) * 3); - - for (IndexType i = 0, outIndex = N; i <= (inSize - 2); i += 2, outIndex += 6) { - outIndices[outIndex] = inIndices[i]; - outIndices[outIndex + 1] = inIndices[i + 1]; - outIndices[outIndex + 2] = inIndices[i + 2]; - outIndices[outIndex + 3] = inIndices[i + 2]; - outIndices[outIndex + 4] = inIndices[i + 1]; - outIndices[outIndex + 5] = inIndices[i + 3]; - } - break; - } - default: - alwaysAssertM(false, "Illegal argument"); - } - } - -protected: - - /** - Helper for computeAdjacency. If a directed edge with index e already - exists from i0 to i1 then e is returned. If a directed edge with index e - already exists from i1 to i0, ~e is returned (the complement) and - edgeArray[e] is set to f. Otherwise, a new edge is created from i0 to i1 - with first face index f and its index is returned. - - @param vertexArray Vertex positions to use when deciding colocation. - - @param area Area of face f. When multiple edges of the same direction - are found between the same vertices (usually because of degenerate edges) - the face with larger area is kept in the edge table. - */ - static int findEdgeIndex( - const Array& vertexArray, - Array& geometricEdgeArray, - int i0, int i1, int f, double area); -}; -} -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/MeshBuilder.h b/externals/g3dlite/G3D.lib/include/G3D/MeshBuilder.h deleted file mode 100644 index 3256c0de823..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/MeshBuilder.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - @file MeshBuilder.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-02-27 - @edited 2004-10-04 - */ -#ifndef G3D_MESHBUILDER_H -#define G3D_MESHBUILDER_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector3.h" -#include "G3D/Triangle.h" - -namespace G3D { - -/** - Allows creation of optimized watertight meshes from unoptimized polygon soups. - See also G3D::MeshAlg for algorithms that operate on the output. - */ -class MeshBuilder { -public: - - /** - Set setWeldRadius to AUTO_WELD to weld vertices closer than 1/2 - the smallest edge length in a model. - */ - enum {AUTO_WELD = -100}; - -private: - /** Indices of vertices in or near a grid cell. */ - typedef Array List; - - std::string name; - - /** - All of the triangles, as a long triangle list. - */ - Array triList; - - void centerTriList(); - void computeBounds(Vector3& min, Vector3& max); - - bool _twoSided; - - /** Collapse radius */ - double close; - -public: - - inline MeshBuilder(bool twoSided = false) : _twoSided(twoSided), close(AUTO_WELD) {} - - /** Writes the model to the arrays, which can then be used with - G3D::IFSModel::save and G3D::MeshAlg */ - void commit(std::string& name, Array& indexArray, Array& vertexArray); - - /** - Adds a new triangle to the model. (Counter clockwise) - */ - void addTriangle(const Vector3& a, const Vector3& b, const Vector3& c); - - /** - Adds two new triangles to the model. (Counter clockwise) - */ - void addQuad(const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d); - - void addTriangle(const Triangle& t); - - void setName(const std::string& n); - - /** Vertices within this distance are considered identical. - Use AUTO_WELD (the default) to have the distance be a function of the model size.*/ - void setWeldRadius(double r) { - close = r; - } -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/NetAddress.h b/externals/g3dlite/G3D.lib/include/G3D/NetAddress.h deleted file mode 100644 index 8ed20a06690..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/NetAddress.h +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef G3D_NETADDRESS_H -#define G3D_NETADDRESS_H - -#include "G3D/platform.h" -#include "G3D/Table.h" - -/** These control the version of Winsock used by G3D. - Version 2.0 is standard for G3D 6.09 and later. - Version 1.1 is standard for G3D 6.08 and earlier. - */ -#define G3D_WINSOCK_MAJOR_VERSION 2 -#define G3D_WINSOCK_MINOR_VERSION 0 - -#ifdef G3D_WIN32 -# if (G3D_WINSOCK_MAJOR_VERSION == 2) -# include -# elif (G3D_WINSOCK_MAJOR_VERSION == 1) -# include -# endif -#else -# include -# include -# include -# ifndef SOCKADDR_IN -# define SOCKADDR_IN struct sockaddr_in -# endif -# ifndef SOCKET -# define SOCKET int -# endif -#endif - -#include "G3D/g3dmath.h" - -namespace G3D { - -class NetAddress { -private: - friend class NetworkDevice; - friend class LightweightConduit; - friend class ReliableConduit; - - /** Host byte order */ - void init(uint32 host, uint16 port); - void init(const std::string& hostname, uint16 port); - NetAddress(const SOCKADDR_IN& a); - NetAddress(const struct in_addr& addr, uint16 port = 0); - - SOCKADDR_IN addr; - -public: - /** - In host byte order - */ - NetAddress(uint32 host, uint16 port = 0); - - /** - @param port Specified in host byte order (i.e., don't worry about endian issues) - */ - NetAddress(const std::string& hostname, uint16 port); - - /** - @param hostnameAndPort in the form "hostname:port" or "ip:port" - */ - NetAddress(const std::string& hostnameAndPort); - - /** - @deprecated Use G3D::NetworkDevice::broadcastAddressArray() - - @brief Creates a UDP broadcast address for use with a - G3D::LightweightConduit. - - UDP broadcast allows one machine to send a packet to all machines - on the same local network. The IP portion of the address is - 0xFFFFFFFF, which indicates "broadcast" to the underlying socket - API. This feature is not available with the connection-based TCP - protocol abstracted by G3D::ReliableConduit; use multisend - instead. - */ - static NetAddress broadcastAddress(uint16 port); - - NetAddress(); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** @brief Returns true if this is not an illegal address. */ - bool ok() const; - - /** @brief Returns a value in host format (i.e., don't worry about - endian issues) */ - inline uint32 ip() const { - return ntohl(addr.sin_addr.s_addr); - //return ntohl(addr.sin_addr.S_un.S_addr); - } - - inline uint16 port() const { - return ntohs(addr.sin_port); - } - - std::string ipString() const; - std::string toString() const; - -}; - -std::ostream& operator<<(std::ostream& os, const NetAddress&); - -} // namespace G3D - -template <> struct HashTrait { - static size_t hashCode(const G3D::NetAddress& key) { - return static_cast(key.ip() + (static_cast(key.port()) << 16)); - } -}; - -namespace G3D { - -/** - Two addresses may point to the same computer but be != because - they have different IP's. - */ -inline bool operator==(const NetAddress& a, const NetAddress& b) { - return (a.ip() == b.ip()) && (a.port() == b.port()); -} - - -inline bool operator!=(const NetAddress& a, const NetAddress& b) { - return !(a == b); -} - -} // namespace G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/NetworkDevice.h b/externals/g3dlite/G3D.lib/include/G3D/NetworkDevice.h deleted file mode 100644 index faffa56d690..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/NetworkDevice.h +++ /dev/null @@ -1,738 +0,0 @@ -/** - @file NetworkDevice.h - - These classes abstract networking from the socket level to a - serialized messaging style that is more appropriate for games. The - performance has been tuned for sending many small messages. The - message protocol contains a header that prevents them from being used - with raw UDP/TCP (e.g. connecting to an HTTP server). - - LightweightConduit and ReliableConduits have different interfaces - because they have different semantics. You would never want to - interchange them without rewriting the surrounding code. - - NetworkDevice creates conduits because they need access to a global - log pointer and because I don't want non-reference counted conduits - being created. - - Be careful with threads and reference counting. The reference - counters are not threadsafe, and are also not updated correctly if a - thread is explicitly killed. Since the conduits will be passed by - const XConduitRef& most of the time this doesn't appear as a major - problem. With non-blocking conduits, you should need few threads - anyway. - - LightweightConduits preceed each message with a 4-byte host order - unsigned integer that is the message type. This does not appear in - the message serialization/deserialization. - - ReliableConduits preceed each message with two 4-byte host order - unsigned integers. The first is the message type and the second - indicates the length of the rest of the data. The size does not - include the size of the header itself. The minimum message is 9 - bytes:a 4-byte type, a 4-byte header equal to "1", and one byte of data. - - @maintainer Morgan McGuire, morgan@graphics3d.com - @created 2002-11-22 - @edited 2006-11-25 - */ - -#ifndef G3D_NETWORKDEVICE_H -#define G3D_NETWORKDEVICE_H - -#include "G3D/platform.h" -#include "G3D/NetAddress.h" - -#include -#include -#include "G3D/g3dmath.h" - -#include "G3D/ReferenceCount.h" -#include "G3D/Array.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -class TextOutput; - -class Conduit : public ReferenceCountedObject { -protected: - friend class NetworkDevice; - friend class NetListener; - - uint64 mSent; - uint64 mReceived; - uint64 bSent; - uint64 bReceived; - - SOCKET sock; - - /** - Used for serialization. One per socket - to make this threadsafe. - */ - BinaryOutput binaryOutput; - - Conduit(); - -public: - - virtual ~Conduit(); - uint64 bytesSent() const; - uint64 messagesSent() const; - uint64 bytesReceived() const; - uint64 messagesReceived() const; - - /** - If true, receive will return true. - */ - virtual bool messageWaiting(); - - /** - Returns the type of the waiting message (i.e. the type supplied - with send). The return value is zero when there is no message - waiting. - - One way to use this is to have a Table mapping message types to - pre-allocated subclasses so receiving looks like: - -
-         // My base class for messages.
-         class Message {
-             virtual void serialize(BinaryOutput&) const;
-             virtual void deserialize(BinaryInput&);
-             virtual void process() = 0;
-         };
-
-         Message* m = table[conduit->waitingMessageType()];
-         conduit->receive(m);
-         m->process();
-     
- - Another is to simply switch on the message type: - -
-         switch (conduit->waitingMessageType()) {
-         case 0:
-            // No message
-            break;
-
-         case ENTITY_SPAWN_MSG:
-            {
-               EntitySpawnMsg m;
-               condiut->receive(m);
-               spawnEntity(m.id, m.position, m.modelID);
-            }
-            break;
-            ...
-         }
-      
- */ - virtual uint32 waitingMessageType() = 0; - - /** Returns true if the connection is ok. */ - bool ok() const; -}; - -typedef ReferenceCountedPointer ReliableConduitRef; - -#ifdef __GNUC__ -// Workaround for a known bug in gcc 4.x where htonl produces -// a spurrious warning. -// http://gcc.gnu.org/ml/gcc-bugs/2005-10/msg03270.html -uint32 gcchtonl(uint32); -#endif - -// Messaging and stream APIs must be supported on a single class because -// sometimes an application will switch modes on a single socket. For -// example, when transferring 3D level geometry during handshaking with -// a game server. -/** - A conduit that guarantees messages will arrive, intact and in order. - Create on the client using NetworkDevice::createReliableConduit and - on the server using NetListener::waitForConnection. Set the reference - counted pointer to NULL to disconnect. - - To construct a ReliableConduit: -
    -
  1. Create a G3D::NetworkDevice (if you are using G3D::GApp, it creates - one for you) on the client and on the server. -
  2. On the server, create a G3D::NetListener using - G3D::NetworkDevice::createListener -
  3. On the server, invoke G3D::NetListener::waitForConnection. -
  4. On the client, call G3D::NetworkDevice::createReliableConduit. - You will need the server's G3D::NetAddress. Consider using - G3D::DiscoveryClient to find it via broadcasting. -
- - */ -class ReliableConduit : public Conduit { -private: - friend class NetworkDevice; - friend class NetListener; - - enum State {RECEIVING, HOLDING, NO_MESSAGE} state; - - NetAddress addr; - - /** - Type of the incoming message. - */ - uint32 messageType; - - /** - Total size of the incoming message (read from the header). - */ - uint32 messageSize; - - /** Shared buffer for receiving messages. */ - void* receiveBuffer; - - /** Total size of the receiveBuffer. */ - size_t receiveBufferTotalSize; - - /** Size occupied by the current message... so far. This will be - equal to messageSize when the whole message has arrived. - */ - size_t receiveBufferUsedSize; - - ReliableConduit(const NetAddress& addr); - - ReliableConduit(const SOCKET& sock, - const NetAddress& addr); - - template static void serializeMessage - (uint32 t, const T& m, BinaryOutput& b) { - - b.writeUInt32(t); - - // Reserve space for the 4 byte size header - b.writeUInt32(0); - - size_t L = b.length(); - m.serialize(b); - if ((size_t)b.length() == L) { - // No data was created by serialization. - // We need to send at least one byte because receive assumes that - // a zero length message is an error. - b.writeUInt8(0xFF); - } - - uint32 len = b.size() - 8; - - // We send the length first to tell recv how much data to read. - // Here we abuse BinaryOutput a bit and write directly into - // its buffer, violating the abstraction. - // Note that we write to the second set of 4 bytes, which is - // the size field. - uint32* lenPtr = ((uint32*)b.getCArray()) + 1; - #if defined(__GNUC__) - *lenPtr = gcchtonl(len); - #else - *lenPtr = htonl(len); - #endif - } - - - void sendBuffer(const BinaryOutput& b); - - /** Accumulates whatever part of the message (not the header) is - still waiting on the socket into the receiveBuffer during - state = RECEIVING mode. Closes the socket if anything goes - wrong. When receiveBufferUsedSize == messageSize, the entire - message has arrived. */ - void receiveIntoBuffer(); - - /** Receives the messageType and messageSize from the socket. */ - void receiveHeader(); - -public: - - /** - Client invokes this to connect to a server. The call blocks until the - conduit is opened. The conduit will not be ok() if it fails. - */ - static ReliableConduitRef create(const NetAddress& address); - - /** Closes the socket. */ - ~ReliableConduit(); - - - // The message is actually copied from the socket to an internal buffer during - // this call. Receive only deserializes. - virtual bool messageWaiting(); - - /** - Serializes the message and schedules it to be sent as soon as possible, - and then returns immediately. The message can be any class with - a serialize and deserialize method. On the receiving side, - use G3D::ReliableConduit::waitingMessageType() to detect the incoming - message and then invoke G3D::ReliableConduit::receive(msg) where msg - is of the same class as the message that was sent. - - The actual data sent across the network is preceeded by the - message type and the size of the serialized message as a 32-bit - integer. The size is sent because TCP is a stream protocol and - doesn't have a concept of discrete messages. - */ - template inline void send(uint32 type, const T& message) { - binaryOutput.reset(); - serializeMessage(type, message, binaryOutput); - sendBuffer(binaryOutput); - } - - /** Sends an empty message with the given type. Useful for sending - commands that have no parameters. */ - void send(uint32 type); - - /** Send the same message to a number of conduits. Useful for sending - data from a server to many clients (only serializes once). */ - template - inline static void multisend( - const Array& array, - uint32 type, - const T& m) { - - if (array.size() > 0) { - array[0]->binaryOutput.reset(); - serializeMessage(type, m, array[0]->binaryOutput); - - for (int i = 0; i < array.size(); ++i) { - array[i]->sendBuffer(array[0]->binaryOutput); - } - } - } - - virtual uint32 waitingMessageType(); - - /** - If a message is waiting, deserializes the waiting message into - message and returns true, otherwise returns false. You can - determine the type of the message (and therefore, the class - of message) using G3D::ReliableConduit::waitingMessageType(). - */ - template inline bool receive(T& message) { - if (! messageWaiting()) { - return false; - } - - debugAssert(state == HOLDING); - // Deserialize - BinaryInput b((uint8*)receiveBuffer, receiveBufferUsedSize, G3D_LITTLE_ENDIAN, BinaryInput::NO_COPY); - message.deserialize(b); - - // Don't let anyone read this message again. We leave the buffer - // allocated for the next caller, however. - receiveBufferUsedSize = 0; - state = NO_MESSAGE; - messageType = 0; - messageSize = 0; - - // Potentially read the next message. - messageWaiting(); - - return true; - } - - /** Removes the current message from the queue. */ - inline void receive() { - if (! messageWaiting()) { - return; - } - receiveBufferUsedSize = 0; - state = NO_MESSAGE; - messageType = 0; - messageSize = 0; - - // Potentially read the next message. - messageWaiting(); - } - - NetAddress address() const; -}; - - -typedef ReferenceCountedPointer LightweightConduitRef; - -/** - Provides fast but unreliable transfer of messages. On a LAN, - LightweightConduit will probably never drop messages but you - might get your messages out of order. On an internet - connection it might drop messages altogether. Messages are never - corrupted, however. LightweightConduit requires a little less setup - and overhead than ReliableConduit. ReliableConduit guarantees - message delivery and order but requires a persistent connection. - - To set up a LightweightConduit (assuming you have already made - subclasses of G3D::NetMessage based on your application's - pcommunication protocol): - -[Server Side] -
    -
  1. Call LightweightConduit::create(port, true, false), -where port is the port on which you will receive messages. - -
  2. Poll LightweightConduit::messageWaiting from your main loop. When -it is true (or, equivalently, when LightweightConduit::waitingMessageType -is non-zero) there is an incoming message. - -
  3. To read the incoming message, call LightweightConduit::receive with -the appropriate class type, which mist have a deserialize method. -LightweightConduit::waitingMessageType tells you what class is -needed (you make up your own message constants for your program; numbers -under 1000 are reserved for G3D's internal use). - -
  4. When done, simply set the G3D::LightweightConduitRef to NULL or let -it go out of scope and the conduit cleans itself up automatically. -
- -[Client Side] -
    -
  1. Call G3D::LightweightConduit::create(). If you will -broadcast to all servers on a LAN, set the third optional argument to -true (the default is false for no broadcast). You can also set up the -receive port as if it was a server to send and receive from a single -LightweightConduit. - -
  2. To send, call G3D::LightweightConduit::send with the target address -and a pointer to an instance of the message you want to send. - -
  3. When done, simply set the G3D::LightweightConduitRef to NULL or let -it go out of scope and the conduit cleans itself up automatically. - -
- */ -class LightweightConduit : public Conduit { -private: - friend class NetworkDevice; - - /** - True when waitingForMessageType has read the message - from the network into messageType/messageStream. - */ - bool alreadyReadMessage; - - /** - Origin of the received message. - */ - NetAddress messageSender; - - /** - The type of the last message received. - */ - uint32 messageType; - - /** - The message received (the type has already been read off). - */ - Array messageBuffer; - - LightweightConduit(uint16 receivePort, bool enableReceive, bool enableBroadcast); - - void sendBuffer(const NetAddress& a, BinaryOutput& b); - - /** Maximum transmission unit (packet size in bytes) for this socket. - May vary between sockets. */ - int MTU; - - - template - void serializeMessage( - uint32 type, - const T& m, - BinaryOutput& b) const { - - debugAssert(type != 0); - b.writeUInt32(type); - m.serialize(b); - b.writeUInt32(1); - - debugAssertM(b.size() < MTU, - format("This LightweightConduit is limited to messages of " - "%d bytes (Ethernet hardware limit; this is the " - "'UDP MTU')", maxMessageSize())); - - if (b.size() >= MTU) { - throw LightweightConduit::PacketSizeException( - format("This LightweightConduit is limited to messages of " - "%d bytes (Ethernet hardware limit; this is the " - "'UDP MTU')", maxMessageSize()), - b.size() - 4, // Don't count the type header - maxMessageSize()); - } - } - -public: - - static LightweightConduitRef create(uint16 receivePort, bool enableReceive, bool enableBroadcast); - - class PacketSizeException { - public: - std::string message; - int serializedPacketSize; - int maxMessageSize; - - inline PacketSizeException(const std::string& m, int s, int b) : - message(m), - serializedPacketSize(s), - maxMessageSize(b) {} - }; - - /** Closes the socket. */ - ~LightweightConduit(); - - /** The maximum length of a message that can be sent - (G3D places a small header at the front of each UDP packet; - this is already taken into account by the value returned). - */ - inline int maxMessageSize() const { - return MTU - 4; - } - - - template inline void send(const NetAddress& a, uint32 type, const T& msg) { - binaryOutput.reset(); - serializeMessage(type, msg, binaryOutput); - sendBuffer(a, binaryOutput); - } - - /** Send the same message to multiple addresses (only serializes once). - Useful when server needs to send to a known list of addresses - (unlike direct UDP broadcast to all addresses on the subnet) */ - template inline void send(const Array& a, uint32 type, const T& m) { - binaryOutput.reset(); - serializeMessage(type, m, binaryOutput); - - for (int i = 0; i < a.size(); ++i) { - sendBuffer(a[i], binaryOutput); - } - } - - bool receive(NetAddress& sender); - - template inline bool receive(NetAddress& sender, T& message) { - bool r = receive(sender); - if (r) { - BinaryInput b((messageBuffer.getCArray() + 4), - messageBuffer.size() - 4, - G3D_LITTLE_ENDIAN, BinaryInput::NO_COPY); - message.deserialize(b); - } - - return r; - } - - inline bool receive() { - static NetAddress ignore; - return receive(ignore); - } - - virtual uint32 waitingMessageType(); - - - virtual bool messageWaiting(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -typedef ReferenceCountedPointer NetListenerRef; - -/** - Runs on the server listening for clients trying to make reliable connections. - */ -class NetListener : public ReferenceCountedObject { -private: - - friend class NetworkDevice; - - SOCKET sock; - - /** Port is in host byte order. */ - NetListener(uint16 port); - -public: - - static NetListenerRef create(const uint16 port); - - ~NetListener(); - - /** Block until a connection is received. Returns NULL if - something went wrong. */ - ReliableConduitRef waitForConnection(); - - /** True if a client is waiting (i.e. waitForConnection will - return immediately). */ - bool clientWaiting() const; - - bool ok() const; -}; - - -/////////////////////////////////////////////////////////////////////////////// - -/** - @brief Abstraction of network (socket) functionality. - - An abstraction over sockets that provides a message-based network - infrastructure optimized for sending many small (~500 bytes) messages. - All functions always return immediately. - - Create only one NetworkDevice per process (a WinSock restriction). - - NetworkDevice is technically not thread safe. However, as long as - you use different conduits on different threads (or lock conduits - before sending), you will encounter no problems sharing the single - NetworkDevice across multiple threads. That is, do not invoke the same - Conduit's send or receive method on two threads at once. - - This assumes that the underlying WinSock/BSD sockets implementation - is thread safe. That is not guaranteed, but in practice seems - to always be true (see - http://tangentsoft.net/wskfaq/intermediate.html#threadsafety) - -
- - IP networks use "network byte order" (big-endian) for - communicating integers. "Host byte order" is the endian-ness of - the local machine (typically little-endian; see - System::endian). The C functions htonl() and ntohl() convert 32-bit - values between these formats. G3D only ever exposes host byte order, - so programmers rarely need to be aware of the distinction. - - */ -class NetworkDevice { -public: - - /** @brief Description of an ethernet or wireless ethernet adapter.*/ - class EthernetAdapter { - public: - /** Reverse-DNS of the ip address.*/ - std::string hostname; - - /** Name of the adapter */ - std::string name; - - /** IP address in host byte order.*/ - uint32 ip; - - /** Subnet mask in host byte order.*/ - uint32 subnet; - - /** UDP broadcast address in host byte order.*/ - uint32 broadcast; - - /** MAC (hardware) address, if known */ - uint8 mac[6]; - - EthernetAdapter(); - - /** Produces a text description of this adapter */ - void describe(TextOutput& t) const; - }; - -private: - - friend class Conduit; - friend class LightweightConduit; - friend class ReliableConduit; - friend class NetListener; - - bool initialized; - - Array m_adapterArray; - - /** Broadcast addresses available on this machine, - extracted from m_adapterArray.*/ - Array m_broadcastAddresses; - - /** Utility method. */ - void closesocket(SOCKET& sock) const; - - /** Utility method. Returns true on success.*/ - bool bind(SOCKET sock, const NetAddress& addr) const; - - /** The global instance */ - static NetworkDevice* s_instance; - - NetworkDevice(); - - bool init(); - - void _cleanup(); - - /** Called from init to update m_adapterArray and - m_broadcastAddresses. */ - void addAdapter(const EthernetAdapter& a); - -public: - - /** Prints an IP address to a string. - @param ip In host byte order.*/ - static std::string formatIP(uint32 ip); - - /** Prints a MAC address to a string. */ - static std::string formatMAC(const uint8 mac[6]); - - ~NetworkDevice(); - - /** Returns the available ethernet adapters for the current - machine that are online. Does not include the loopback adapter - for localhost.*/ - inline const Array& adapterArray() const { - return m_adapterArray; - } - - /** Returns the (unique) IP addresses for UDP broadcasting - extracted from adapterArray(). All are in host byte order. */ - inline const Array& broadcastAddressArray() const { - return m_broadcastAddresses; - } - - /** - Returns NULL if there was a problem initializing the network. - */ - static NetworkDevice* instance(); - - /** - Shuts down the network device (destroying the global instance). - */ - static void cleanup(); - - /** - Prints a human-readable description of this machine - to the text output stream. - */ - void describeSystem( - TextOutput& t); - - void describeSystem( - std::string& s); - - /** Returns the name (or one of the names) of this computer */ - std::string localHostName() const; - - /** There is often more than one address for the local host. This - returns all of them. - @deprecated Use adapterArray() - */ - void localHostAddresses(Array& array) const; -}; - - -#ifdef __GNUC__ -inline uint32 gcchtonl(uint32 x) { - // This pragma fools gcc into surpressing all error messages, - // including the bogus one that it creates for htonl -# pragma GCC system_header - return htonl(x); -} -#endif - -} // G3D namespace - -#ifndef _WIN32 -#undef SOCKADDR_IN -#undef SOCKET -#endif - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/PhysicsFrame.h b/externals/g3dlite/G3D.lib/include/G3D/PhysicsFrame.h deleted file mode 100644 index 44eedb6846e..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/PhysicsFrame.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - @file PhysicsFrame.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-07-08 - @edited 2006-01-10 -*/ - -#ifndef G3D_PHYSICSFRAME_H -#define G3D_PHYSICSFRAME_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Matrix3.h" -#include "G3D/Quat.h" -#include "G3D/CoordinateFrame.h" -#include -#include - - -namespace G3D { - -/** - An RT transformation using a quaternion; suitable for - physics integration. - - This interface is in "Beta" and will change in the next release. - */ -class PhysicsFrame { -public: - - Quat rotation; - - /** - Takes object space points to world space. - */ - Vector3 translation; - - /** - Initializes to the identity frame. - */ - PhysicsFrame(); - - /** - Purely translational force - */ - PhysicsFrame(const Vector3& translation) : translation(translation) {} - - PhysicsFrame(const CoordinateFrame& coordinateFrame); - - /** Compose: create the transformation that is other followed by this.*/ - PhysicsFrame operator*(const PhysicsFrame& other) const; - - virtual ~PhysicsFrame() {} - - CoordinateFrame toCoordinateFrame() const; - - /** - Linear interpolation (spherical linear for the rotations). - */ - PhysicsFrame lerp( - const PhysicsFrame& other, - float alpha) const; - - void deserialize(class BinaryInput& b); - - void serialize(class BinaryOutput& b) const; - -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Plane.h b/externals/g3dlite/G3D.lib/include/G3D/Plane.h deleted file mode 100644 index 1f0b15e0fe4..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Plane.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - @file Plane.h - - Plane class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-06-02 - @edited 2004-07-18 -*/ - -#ifndef G3D_PLANE_H -#define G3D_PLANE_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/debugAssert.h" - -namespace G3D { - -/** - An infinite 2D plane in 3D space. - */ -class Plane { -private: - - /** normal.Dot(x,y,z) = distance */ - Vector3 _normal; - float _distance; - - /** - Assumes the normal has unit length. - */ - Plane(const Vector3& n, float d) : _normal(n), _distance(d) { - } - -public: - - Plane() : _normal(Vector3::unitY()), _distance(0) { - } - - /** - Constructs a plane from three points. - */ - Plane( - const Vector3& point0, - const Vector3& point1, - const Vector3& point2); - - /** - Constructs a plane from three points, where at most two are - at infinity (w = 0, not xyz = inf). - */ - Plane( - Vector4 point0, - Vector4 point1, - Vector4 point2); - - /** - The normal will be unitized. - */ - Plane( - const Vector3& __normal, - const Vector3& point); - - static Plane fromEquation(float a, float b, float c, float d); - - Plane(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - virtual ~Plane() {} - - /** - Returns true if point is on the side the normal points to or - is in the plane. - */ - inline bool halfSpaceContains(Vector3 point) const { - // Clamp to a finite range for testing - point = point.clamp(Vector3::minFinite(), Vector3::maxFinite()); - - // We can get away with putting values *at* the limits of the float32 range into - // a dot product, since the dot product is carried out on float64. - return _normal.dot(point) >= _distance; - } - - /** - Returns true if point is on the side the normal points to or - is in the plane. - */ - inline bool halfSpaceContains(const Vector4& point) const { - if (point.w == 0) { - return _normal.dot(point.xyz()) > 0; - } else { - return halfSpaceContains(point.xyz() / point.w); - } - } - - /** - Returns true if point is on the side the normal points to or - is in the plane. Only call on finite points. Faster than halfSpaceContains. - */ - inline bool halfSpaceContainsFinite(const Vector3& point) const { - debugAssert(point.isFinite()); - return _normal.dot(point) >= _distance; - } - - /** - Returns true if the point is nearly in the plane. - */ - inline bool fuzzyContains(const Vector3 &point) const { - return fuzzyEq(point.dot(_normal), _distance); - } - - inline const Vector3& normal() const { - return _normal; - } - - /** - Returns distance from point to plane. Distance is negative if point is behind (not in plane in direction opposite normal) the plane. - */ - inline float distance(const Vector3& x) const { - return (_normal.dot(x) - _distance); - } - - inline Vector3 closestPoint(const Vector3& x) const { - return x + (_normal * (-distance(x))); - } - - /** Returns normal * distance from origin */ - Vector3 center() const { - return _normal * _distance; - } - - /** - Inverts the facing direction of the plane so the new normal - is the inverse of the old normal. - */ - void flip(); - - /** - Returns the equation in the form: - - normal.Dot(Vector3(x, y, z)) + d = 0 - */ - void getEquation(Vector3 &normal, double& d) const; - void getEquation(Vector3 &normal, float& d) const; - - /** - ax + by + cz + d = 0 - */ - void getEquation(double& a, double& b, double& c, double& d) const; - void getEquation(float& a, float& b, float& c, float& d) const; - - std::string toString() const; -}; - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/PointAABSPTree.h b/externals/g3dlite/G3D.lib/include/G3D/PointAABSPTree.h deleted file mode 100644 index c8d527a45c2..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/PointAABSPTree.h +++ /dev/null @@ -1,1207 +0,0 @@ -/** - @file PointAABSPTree.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2004-01-11 - @edited 2008-11-02 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - - */ - -#ifndef X_PointKDTree_H -#define X_PointKDTree_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Table.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/CollisionDetection.h" -#include "G3D/GCamera.h" -#include "G3D/PositionTrait.h" -#include - - -/////////////////////////////////////////////////////// - -/** @deprecated */ -inline void getPosition(const G3D::Vector3& v, G3D::Vector3& p) { - p = v; -} - -/** @deprecated */ -inline void getPosition(const G3D::Vector4& v, G3D::Vector3& p) { - p = v.xyz(); -} - -/** @deprecated */ -inline void getPosition(const G3D::Vector2& v, G3D::Vector3& p) { - p.x = v.x; - p.y = v.y; - p.z = 0; -} - -namespace G3D { - -/** - A set data structure that supports spatial queries using an axis-aligned - BSP tree for speed. - - PointKDTree allows you to quickly find points in 3D that lie within - a box or sphere. For large sets of objects it is much faster - than testing each object for a collision. See also G3D::KDTree; this class - is optimized for point sets, e.g.,for use in photon mapping and mesh processing. - - Template Parameters - -
- -
The template parameter T must be one for which - the following functions are overloaded: - -
-      T::T(); (public constructor of no arguments)
-
-       template<> struct PositionTrait {
-         static void getPosition(const T& v, G3D::Vector3& p);};
-
-       template <> struct HashTrait {
-         static size_t hashCode(const T& key);};
-
-       template<> struct EqualsTrait {
-           static bool equals(const T& a, const T& b); };
-    
- -

- - G3D provides these for the Vector2, Vector3, and Vector4 classes. - If you use a custom class, or a pointer to a custom class, you will need - to define those functions. - - Moving %Set Members -

It is important that objects do not move without updating the - PointKDTree. If the position of an object is about - to change, PointKDTree::remove it before they change and - PointKDTree::insert it again afterward. For objects - where the hashCode and == operator are invariant with respect - to the 3D position, - you can use the PointKDTree::update method as a shortcut to - insert/remove an object in one step after it has moved. - - - Note: Do not mutate any value once it has been inserted into PointKDTree. Values - are copied interally. All PointKDTree iterators convert to pointers to constant - values to reinforce this. - - If you want to mutate the objects you intend to store in a PointKDTree - simply insert pointers to your objects instead of the objects - themselves, and ensure that the above operations are defined. (And - actually, because values are copied, if your values are large you may - want to insert pointers anyway, to save space and make the balance - operation faster.) - - Dimensions - Although designed as a 3D-data structure, you can use the PointKDTree - for data distributed along 2 or 1 axes by simply returning bounds - that are always zero along one or more dimensions. - -*/ -template, - class HashFunc = HashTrait, - class EqualsFunc = EqualsTrait > -class PointKDTree { -protected: -#define TreeType PointKDTree - - // Unlike the KDTree, the PointKDTree assumes that T elements are - // small and keeps the handle and cached position together instead of - // placing them in separate bounds arrays. Also note that a copy of T - // is kept in the member table and that there is no indirection. - class Handle { - private: - Vector3 m_position; - - public: - T value; - - inline Handle() {} - inline Handle(const T& v) : value(v) { - PositionFunc::getPosition(v, m_position); - } - - /** Used by makeNode to create fake handles for partitioning. */ - void setPosition(const Vector3& v) { - m_position = v; - } - - inline const Vector3& position() const { - return m_position; - } - }; - - /** Returns the bounds of the sub array. Used by makeNode. */ - static AABox computeBounds( - const Array& point) { - - if (point.size() == 0) { - return AABox(Vector3::inf(), Vector3::inf()); - } - - AABox bounds(point[0].position()); - - for (int p = 0; p < point.size(); ++p) { - bounds.merge(point[p].position()); - } - - return bounds; - } - - class Node { - public: - - /** Spatial bounds on all values at this node and its children, based purely on - the parent's splitting planes. May be infinite */ - AABox splitBounds; - - Vector3::Axis splitAxis; - - /** Location along the specified axis */ - float splitLocation; - - /** child[0] contains all values strictly - smaller than splitLocation along splitAxis. - - child[1] contains all values strictly - larger. - - Both may be NULL if there are not enough - values to bother recursing. - */ - Node* child[2]; - - /** Values if this is a leaf node). */ - Array valueArray; - - /** Creates node with NULL children */ - Node() { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - splitBounds = AABox(-Vector3::inf(), Vector3::inf()); - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** - Doesn't clone children. - */ - Node(const Node& other) : valueArray(other.valueArray) { - splitAxis = other.splitAxis; - splitLocation = other.splitLocation; - splitBounds = other.splitBounds; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - } - - /** Copies the specified subarray of pt into point, NULLs the children. - Assumes a second pass will set splitBounds. */ - Node(const Array& pt) { - splitAxis = Vector3::X_AXIS; - splitLocation = 0; - for (int i = 0; i < 2; ++i) { - child[i] = NULL; - } - valueArray = pt; - } - - - /** Deletes the children (but not the values) */ - ~Node() { - for (int i = 0; i < 2; ++i) { - delete child[i]; - } - } - - - /** Returns true if this node is a leaf (no children) */ - inline bool isLeaf() const { - return (child[0] == NULL) && (child[1] == NULL); - } - - - /** - Recursively appends all handles and children's handles - to the array. - */ - void getHandles(Array& handleArray) const { - handleArray.append(valueArray); - for (int i = 0; i < 2; ++i) { - if (child[i] != NULL) { - child[i]->getHandles(handleArray); - } - } - } - - - void verifyNode(const Vector3& lo, const Vector3& hi) { - // debugPrintf("Verifying: split %d @ %f [%f, %f, %f], [%f, %f, %f]\n", - // splitAxis, splitLocation, lo.x, lo.y, lo.z, hi.x, hi.y, hi.z); - - debugAssert(lo == splitBounds.low()); - debugAssert(hi == splitBounds.high()); - - for (int i = 0; i < valueArray.length(); ++i) { - const Vector3& b = valueArray[i].position(); - debugAssert(splitBounds.contains(b)); - } - - if (child[0] || child[1]) { - debugAssert(lo[splitAxis] < splitLocation); - debugAssert(hi[splitAxis] > splitLocation); - } - - Vector3 newLo = lo; - newLo[splitAxis] = splitLocation; - Vector3 newHi = hi; - newHi[splitAxis] = splitLocation; - - if (child[0] != NULL) { - child[0]->verifyNode(lo, newHi); - } - - if (child[1] != NULL) { - child[1]->verifyNode(newLo, hi); - } - } - - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - static void serializeStructure(const Node* n, BinaryOutput& bo) { - if (n == NULL) { - bo.writeUInt8(0); - } else { - bo.writeUInt8(1); - n->splitBounds.serialize(bo); - serialize(n->splitAxis, bo); - bo.writeFloat32(n->splitLocation); - for (int c = 0; c < 2; ++c) { - serializeStructure(n->child[c], bo); - } - } - } - - /** Clears the member table */ - static Node* deserializeStructure(BinaryInput& bi) { - if (bi.readUInt8() == 0) { - return NULL; - } else { - Node* n = new Node(); - n->splitBounds.deserialize(bi); - deserialize(n->splitAxis, bi); - n->splitLocation = bi.readFloat32(); - for (int c = 0; c < 2; ++c) { - n->child[c] = deserializeStructure(bi); - } - } - } - - /** Returns the deepest node that completely contains bounds. */ - Node* findDeepestContainingNode(const Vector3& point) { - - // See which side of the splitting plane the bounds are on - if (point[splitAxis] < splitLocation) { - // Point is on the low side. Recurse into the child - // if it exists. - if (child[0] != NULL) { - return child[0]->findDeepestContainingNode(point); - } - } else if (point[splitAxis] > splitLocation) { - // Point is on the high side, recurse into the child - // if it exists. - if (child[1] != NULL) { - return child[1]->findDeepestContainingNode(point); - } - } - - // There was no containing child, so this node is the - // deepest containing node. - return this; - } - - /** Appends all members that intersect the box. - If useSphere is true, members are tested against the sphere instead. */ - void getIntersectingMembers( - const AABox& sphereBounds, - const Sphere& sphere, - Array& members) const { - - // Test all values at this node. Extract the - // underlying C array for speed - const int N = valueArray.size(); - const Handle* handleArray = valueArray.getCArray(); - - const float r2 = square(sphere.radius); - - // Copy the sphere center so that it is on the stack near the radius - const Vector3 center = sphere.center; - for (int v = 0; v < N; ++v) { - if ((center - handleArray[v].position()).squaredLength() <= r2) { - members.append(handleArray[v].value); - } - } - - // If the left child overlaps the box, recurse into it - if (child[0] && (sphereBounds.low()[splitAxis] < splitLocation)) { - child[0]->getIntersectingMembers(sphereBounds, sphere, members); - } - - // If the right child overlaps the box, recurse into it - if (child[1] && (sphereBounds.high()[splitAxis] > splitLocation)) { - child[1]->getIntersectingMembers(sphereBounds, sphere, members); - } - } - - /** Appends all members that intersect the box. - If useSphere is true, members are tested against the sphere instead. - - Implemented using both box and sphere tests to simplify the implementation - of a future beginSphereInteresection iterator using the same underlying - BoxIterator class. - */ - void getIntersectingMembers( - const AABox& box, - const Sphere& sphere, - Array& members, - bool useSphere) const { - - // Test all values at this node - for (int v = 0; v < valueArray.size(); ++v) { - if ((useSphere && sphere.contains(valueArray[v].position())) || - (! useSphere && box.contains(valueArray[v].position()))) { - members.append(valueArray[v].value); - } - } - - // If the left child overlaps the box, recurse into it - if ((child[0] != NULL) && (box.low()[splitAxis] < splitLocation)) { - child[0]->getIntersectingMembers(box, sphere, members, useSphere); - } - - // If the right child overlaps the box, recurse into it - if ((child[1] != NULL) && (box.high()[splitAxis] > splitLocation)) { - child[1]->getIntersectingMembers(box, sphere, members, useSphere); - } - } - - /** - Recurse through the tree, assigning splitBounds fields. - */ - void assignSplitBounds(const AABox& myBounds) { - splitBounds = myBounds; - -# ifdef G3D_DEBUG - if (child[0] || child[1]) { - debugAssert(splitBounds.high()[splitAxis] > splitLocation); - debugAssert(splitBounds.low()[splitAxis] < splitLocation); - } -# endif - - AABox childBounds[2]; - myBounds.split(splitAxis, splitLocation, childBounds[0], childBounds[1]); - - for (int c = 0; c < 2; ++c) { - if (child[c]) { - child[c]->assignSplitBounds(childBounds[c]); - } - } - } - }; - - class AxisComparator { - private: - Vector3::Axis sortAxis; - - public: - - AxisComparator(Vector3::Axis s) : sortAxis(s) {} - - inline int operator()(const Handle& A, const Handle& B) const { - if (A.position()[sortAxis] > B.position()[sortAxis]) { - return -1; - } else if (A.position()[sortAxis] < B.position()[sortAxis]) { - return 1; - } else { - return 0; - } - } - }; - - /** - Recursively subdivides the subarray. - - The source array will be cleared after it is used - - Call assignSplitBounds() on the root node after making a tree. - */ - Node* makeNode( - Array& source, - Array& temp, - int valuesPerNode, - int numMeanSplits) { - - Node* node = NULL; - - if (source.size() <= valuesPerNode) { - // Make a new leaf node - node = new Node(source); - - // Set the pointers in the memberTable - for (int i = 0; i < source.size(); ++i) { - memberTable.set(source[i].value, node); - } - - } else { - // Make a new internal node - node = new Node(); - - const AABox bounds = computeBounds(source); - const Vector3 extent = bounds.high() - bounds.low(); - - Vector3::Axis splitAxis = extent.primaryAxis(); - - float splitLocation; - - Array lt, gt; - - if (numMeanSplits <= 0) { - source.medianPartition(lt, node->valueArray, gt, temp, AxisComparator(splitAxis)); - splitLocation = node->valueArray[0].position()[splitAxis]; - - if ((node->valueArray.size() > source.size() / 2) && - (source.size() > 10)) { - // Our median split put an awful lot of points on the splitting plane. Try a mean - // split instead - numMeanSplits = 1; - } - } - - if (numMeanSplits > 0) { - // Compute the mean along the axis - - splitLocation = (bounds.high()[splitAxis] + - bounds.low()[splitAxis]) / 2.0; - - Handle splitHandle; - Vector3 v; - v[splitAxis] = splitLocation; - splitHandle.setPosition(v); - - source.partition(splitHandle, lt, node->valueArray, gt, AxisComparator(splitAxis)); - } - -# if defined(G3D_DEBUG) && defined(VERIFY_TREE) - for (int i = 0; i < lt.size(); ++i) { - const Vector3& v = lt[i].position(); - debugAssert(v[splitAxis] < splitLocation); - } - for (int i = 0; i < gt.size(); ++i) { - debugAssert(gt[i].position()[splitAxis] > splitLocation); - } - for (int i = 0; i < node->valueArray.size(); ++i) { - debugAssert(node->valueArray[i].position()[splitAxis] == splitLocation); - } -# endif - - node->splitAxis = splitAxis; - node->splitLocation = splitLocation; - - // Throw away the source array to save memory - source.fastClear(); - - if (lt.size() > 0) { - node->child[0] = makeNode(lt, temp, valuesPerNode, numMeanSplits - 1); - } - - if (gt.size() > 0) { - node->child[1] = makeNode(gt, temp, valuesPerNode, numMeanSplits - 1); - } - - // Add the values stored at this interior node to the member table - for(int i = 0; i < node->valueArray.size(); ++i) { - memberTable.set(node->valueArray[i].value, node); - } - - } - - return node; - } - - /** - Recursively clone the passed in node tree, setting - pointers for members in the memberTable as appropriate. - called by the assignment operator. - */ - Node* cloneTree(Node* src) { - Node* dst = new Node(*src); - - // Make back pointers - for (int i = 0; i < dst->valueArray.size(); ++i) { - memberTable.set(dst->valueArray[i].value, dst); - } - - // Clone children - for (int i = 0; i < 2; ++i) { - if (src->child[i] != NULL) { - dst->child[i] = cloneTree(src->child[i]); - } - } - - return dst; - } - - /** Maps members to the node containing them */ - typedef Table MemberTable; - MemberTable memberTable; - - Node* root; - -public: - - /** To construct a balanced tree, insert the elements and then call - PointKDTree::balance(). */ - PointKDTree() : root(NULL) {} - - - PointKDTree(const PointKDTree& src) : root(NULL) { - *this = src; - } - - - PointKDTree& operator=(const PointKDTree& src) { - delete root; - // Clone tree takes care of filling out the memberTable. - root = cloneTree(src.root); - return *this; - } - - - ~PointKDTree() { - clear(); - } - - /** - Throws out all elements of the set and erases the structure of the tree. - */ - void clear() { - memberTable.clear(); - delete root; - root = NULL; - } - - /** Removes all elements of the set while maintaining the structure of the tree */ - void clearData() { - memberTable.clear(); - Array stack; - stack.push(root); - while (stack.size() > 0) { - Node* node = stack.pop(); - node->valueArray.fastClear(); - - for (int i = 0; i < 2; ++i) { - if (node->child[i] != NULL) { - stack.push(node->child[i]); - } - } - } - } - - - int size() const { - return memberTable.size(); - } - - /** - Inserts an object into the set if it is not - already present. O(log n) time. Does not - cause the tree to be balanced. - */ - void insert(const T& value) { - if (contains(value)) { - // Already in the set - return; - } - - Handle h(value); - - if (root == NULL) { - // This is the first node; create a root node - root = new Node(); - } - - Node* node = root->findDeepestContainingNode(h.position()); - - // Insert into the node - node->valueArray.append(h); - - // Insert into the node table - memberTable.set(value, node); - } - - /** Inserts each elements in the array in turn. If the tree - begins empty (no structure and no elements), this is faster - than inserting each element in turn. You still need to balance - the tree at the end.*/ - void insert(const Array& valueArray) { - // Pre-size the member table to avoid multiple allocations - memberTable.setSizeHint(valueArray.size() + size()); - - if (root == NULL) { - // Optimized case for an empty tree; don't bother - // searching or reallocating the root node's valueArray - // as we incrementally insert. - root = new Node(); - root->valueArray.resize(valueArray.size()); - for (int i = 0; i < valueArray.size(); ++i) { - // Insert in opposite order so that we have the exact same - // data structure as if we inserted each (i.e., order is reversed - // from array). - root->valueArray[valueArray.size() - i - 1] = Handle(valueArray[i]); - memberTable.set(valueArray[i], root); - } - } else { - // Insert at appropriate tree depth. - for (int i = 0; i < valueArray.size(); ++i) { - insert(valueArray[i]); - } - } - } - - - /** - Returns true if this object is in the set, otherwise - returns false. O(1) time. - */ - bool contains(const T& value) { - return memberTable.containsKey(value); - } - - - /** - Removes an object from the set in O(1) time. - It is an error to remove members that are not already - present. May unbalance the tree. - - Removing an element never causes a node (split plane) to be removed... - nodes are only changed when the tree is rebalanced. This behavior - is desirable because it allows the split planes to be serialized, - and then deserialized into an empty tree which can be repopulated. - */ - void remove(const T& value) { - debugAssertM(contains(value), - "Tried to remove an element from a " - "PointKDTree that was not present"); - - Array& list = memberTable[value]->valueArray; - - // Find the element and remove it - for (int i = list.length() - 1; i >= 0; --i) { - if (list[i].value == value) { - list.fastRemove(i); - break; - } - } - memberTable.remove(value); - } - - - /** - If the element is in the set, it is removed. - The element is then inserted. - - This is useful when the == and hashCode methods - on T are independent of the bounds. In - that case, you may call update(v) to insert an - element for the first time and call update(v) - again every time it moves to keep the tree - up to date. - */ - void update(const T& value) { - if (contains(value)) { - remove(value); - } - insert(value); - } - - - /** - Rebalances the tree (slow). Call when objects - have moved substantially from their original positions - (which unbalances the tree and causes the spatial - queries to be slow). - - @param valuesPerNode Maximum number of elements to put at - a node. - - @param numMeanSplits numMeanSplits = 0 gives a - fully axis aligned BSP-tree, where the balance operation attempts to balance - the tree so that every splitting plane has an equal number of left - and right children (i.e. it is a median split along that axis). - This tends to maximize average performance; all querries will return in the same amount of time. - - You can override this behavior by - setting a number of mean (average) splits. numMeanSplits = MAX_INT - creates a full oct-tree, which tends to optimize peak performance (some areas of the scene will terminate after few recursive splits) at the expense of - peak performance. - */ - void balance(int valuesPerNode = 40, int numMeanSplits = 3) { - if (root == NULL) { - // Tree is empty - return; - } - - Array handleArray; - root->getHandles(handleArray); - - // Delete the old tree - clear(); - - Array temp; - root = makeNode(handleArray, temp, valuesPerNode, numMeanSplits); - temp.fastClear(); - - // Walk the tree, assigning splitBounds. We start with unbounded - // space. - root->assignSplitBounds(AABox::maxFinite()); - -# ifdef _DEBUG - root->verifyNode(Vector3::minFinite(), Vector3::maxFinite()); -# endif - } - -private: - - /** - Returns the elements - - @param parentMask The mask that this node returned from culledBy. - */ - static void getIntersectingMembers( - const Array& plane, - Array& members, - Node* node, - uint32 parentMask) { - - int dummy; - - if (parentMask == 0) { - // None of these planes can cull anything - for (int v = node->valueArray.size() - 1; v >= 0; --v) { - members.append(node->valueArray[v].value); - } - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c]) { - getIntersectingMembers(plane, members, node->child[c], 0); - } - } - } else { - - if (node->valueArray.size() > 0) { - // This is a leaf; check the points - debugAssertM(node->child[0] == NULL, "Malformed Point tree"); - debugAssertM(node->child[1] == NULL, "Malformed Point tree"); - - // Test values at this node against remaining planes - for (int p = 0; p < plane.size(); ++p) { - if ((parentMask >> p) & 1 != 0) { - // Test against this plane - const Plane& curPlane = plane[p]; - for (int v = node->valueArray.size() - 1; v >= 0; --v) { - if (curPlane.halfSpaceContains(node->valueArray[v].position())) { - members.append(node->valueArray[v].value); - } - } - } - } - } else { - - uint32 childMask = 0xFFFFFF; - - // Iterate through child nodes - for (int c = 0; c < 2; ++c) { - if (node->child[c] && - ! node->child[c]->splitBounds.culledBy(plane, dummy, parentMask, childMask)) { - // This node was not culled - getIntersectingMembers(plane, members, node->child[c], childMask); - } - } - } - } - } - -public: - - /** - Returns all members inside the set of planes. - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Array& plane, Array& members) const { - if (root == NULL) { - return; - } - - getIntersectingMembers(plane, members, root, 0xFFFFFF); - } - - /** - Typically used to find all visible - objects inside the view frustum (see also GCamera::getClipPlanes)... i.e. all objects - not culled by frustum. - - Example: -
-        Array  visible;
-        tree.getIntersectingMembers(camera.frustum(), visible);
-        // ... Draw all objects in the visible array.
-      
- @param members The results are appended to this array. - */ - void getIntersectingMembers(const GCamera::Frustum& frustum, Array& members) const { - Array plane; - - for (int i = 0; i < frustum.faceArray.size(); ++i) { - plane.append(frustum.faceArray[i].plane); - } - - getIntersectingMembers(plane, members); - } - - /** - C++ STL style iterator variable. See beginBoxIntersection(). - The iterator overloads the -> (dereference) operator, so this - acts like a pointer to the current member. - */ - // This iterator turns Node::getIntersectingMembers into a - // coroutine. It first translates that method from recursive to - // stack based, then captures the system state (analogous to a Scheme - // continuation) after each element is appended to the member array, - // and allowing the computation to be restarted. - class BoxIntersectionIterator { - private: - friend class TreeType; - - /** True if this is the "end" iterator instance */ - bool isEnd; - - /** The box that we're testing against. */ - AABox box; - - /** Node that we're currently looking at. Undefined if isEnd - is true. */ - Node* node; - - /** Nodes waiting to be processed */ - // We could use backpointers within the tree and careful - // state management to avoid ever storing the stack-- but - // it is much easier this way and only inefficient if the - // caller uses post increment (which they shouldn't!). - Array stack; - - /** The next index of current->valueArray to return. - Undefined when isEnd is true.*/ - int nextValueArrayIndex; - - BoxIntersectionIterator() : isEnd(true) {} - - BoxIntersectionIterator(const AABox& b, const Node* root) : - isEnd(root == NULL), box(b), - node(const_cast(root)), nextValueArrayIndex(-1) { - - // We intentionally start at the "-1" index of the current - // node so we can use the preincrement operator to move - // ourselves to element 0 instead of repeating all of the - // code from the preincrement method. Note that this might - // cause us to become the "end" instance. - ++(*this); - } - - public: - - inline bool operator!=(const BoxIntersectionIterator& other) const { - return ! (*this == other); - } - - bool operator==(const BoxIntersectionIterator& other) const { - if (isEnd) { - return other.isEnd; - } else if (other.isEnd) { - return false; - } else { - // Two non-end iterators; see if they match. This is kind of - // silly; users shouldn't call == on iterators in general unless - // one of them is the end iterator. - if ((box != other.box) || (node != other.node) || - (nextValueArrayIndex != other.nextValueArrayIndex) || - (stack.length() != other.stack.length())) { - return false; - } - - // See if the stacks are the same - for (int i = 0; i < stack.length(); ++i) { - if (stack[i] != other.stack[i]) { - return false; - } - } - - // We failed to find a difference; they must be the same - return true; - } - } - - /** - Pre increment. - */ - BoxIntersectionIterator& operator++() { - ++nextValueArrayIndex; - - bool foundIntersection = false; - while (! isEnd && ! foundIntersection) { - - // Search for the next node if we've exhausted this one - while ((! isEnd) && (nextValueArrayIndex >= node->valueArray.length())) { - // If we entered this loop, then the iterator has exhausted the elements at - // node (possibly because it just switched to a child node with no members). - // This loop continues until it finds a node with members or reaches - // the end of the whole intersection search. - - // If the right child overlaps the box, push it onto the stack for - // processing. - if ((node->child[1] != NULL) && - (box.high()[node->splitAxis] > node->splitLocation)) { - stack.push(node->child[1]); - } - - // If the left child overlaps the box, push it onto the stack for - // processing. - if ((node->child[0] != NULL) && - (box.low()[node->splitAxis] < node->splitLocation)) { - stack.push(node->child[0]); - } - - if (stack.length() > 0) { - // Go on to the next node (which may be either one of the ones we - // just pushed, or one from farther back the tree). - node = stack.pop(); - nextValueArrayIndex = 0; - } else { - // That was the last node; we're done iterating - isEnd = true; - } - } - - // Search for the next intersection at this node until we run out of children - while (! isEnd && ! foundIntersection && (nextValueArrayIndex < node->valueArray.length())) { - if (box.intersects(node->valueArray[nextValueArrayIndex].bounds)) { - foundIntersection = true; - } else { - ++nextValueArrayIndex; - // If we exhaust this node, we'll loop around the master loop - // to find a new node. - } - } - } - - return *this; - } - - /** - Post increment (much slower than preincrement!). - */ - BoxIntersectionIterator operator++(int) { - BoxIntersectionIterator old = *this; - ++this; - return old; - } - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - const T& operator*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return node->valueArray[nextValueArrayIndex].value; - } - - /** Overloaded dereference operator so the iterator can masquerade as a pointer - to a member */ - T const * operator->() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex].value); - } - - /** Overloaded cast operator so the iterator can masquerade as a pointer - to a member */ - operator T*() const { - alwaysAssertM(! isEnd, "Can't dereference the end element of an iterator"); - return &(stack.last()->valueArray[nextValueArrayIndex].value); - } - }; - - - /** - Iterates through the members that intersect the box - */ - BoxIntersectionIterator beginBoxIntersection(const AABox& box) const { - return BoxIntersectionIterator(box, root); - } - - BoxIntersectionIterator endBoxIntersection() const { - // The "end" iterator instance - return BoxIntersectionIterator(); - } - - /** - Appends all members whose bounds intersect the box. - See also PointKDTree::beginBoxIntersection. - */ - void getIntersectingMembers(const AABox& box, Array& members) const { - if (root == NULL) { - return; - } - root->getIntersectingMembers(box, Sphere(Vector3::zero(), 0), members, false); - } - - - /** - @param members The results are appended to this array. - */ - void getIntersectingMembers(const Sphere& sphere, Array& members) const { - if (root == NULL) { - return; - } - - AABox box; - sphere.getBounds(box); - root->getIntersectingMembers(box, sphere, members); - - } - - - /** - Stores the locations of the splitting planes (the structure but not the content) - so that the tree can be quickly rebuilt from a previous configuration without - calling balance. - */ - void serializeStructure(BinaryOutput& bo) const { - Node::serializeStructure(root, bo); - } - - /** Clears the member table */ - void deserializeStructure(BinaryInput& bi) { - clear(); - root = Node::deserializeStructure(bi); - } - - /** - Returns an array of all members of the set. See also PointKDTree::begin. - */ - void getMembers(Array& members) const { - memberTable.getKeys(members); - } - - - /** - C++ STL style iterator variable. See begin(). - Overloads the -> (dereference) operator, so this acts like a pointer - to the current member. - */ - class Iterator { - private: - friend class TreeType; - - // Note: this is a Table iterator, we are currently defining - // Set iterator - typename MemberTable::Iterator it; - - Iterator(const typename MemberTable::Iterator& it) : it(it) {} - - public: - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - return it == other.it; - } - - /** - Pre increment. - */ - Iterator& operator++() { - ++it; - return *this; - } - - /** - Post increment (slower than preincrement). - */ - Iterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const T& operator*() const { - return it->key; - } - - T* operator->() const { - return &(it->key); - } - - operator T*() const { - return &(it->key); - } - }; - - - /** - C++ STL style iterator method. Returns the first member. - Use preincrement (++entry) to get to the next element (iteration - order is arbitrary). - Do not modify the set while iterating. - */ - Iterator begin() const { - return Iterator(memberTable.begin()); - } - - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - Iterator end() const { - return Iterator(memberTable.end()); - } -#undef TreeType -}; - -#define PointAABSPTree PointKDTree - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/PointHashGrid.h b/externals/g3dlite/G3D.lib/include/G3D/PointHashGrid.h deleted file mode 100644 index 8e9726e82da..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/PointHashGrid.h +++ /dev/null @@ -1,894 +0,0 @@ -/** - @file PointHashGrid.h - - @maintainer Morgan McGuire, morgan@cs.williams.edu - @created 2008-07-01 - @edited 2008-11-02 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. -*/ -#ifndef G3D_POINTHASHGRID_H -#define G3D_POINTHASHGRID_H - -#include "G3D/platform.h" -#include "G3D/EqualsTrait.h" -#include "G3D/HashTrait.h" -#include "G3D/Vector3.h" -#include "G3D/Vector3int32.h" -#include "G3D/Array.h" -#include "G3D/Table.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" - -namespace G3D { - -/** - Storage of data in a sparse 3D grid of point-based data. The - space cost for n elements is O(n). For data with - approximately uniform density (with respect to the radius hint), - the time cost of searching for neighbors is O(1). - - Value must be supported by a G3D::PositionTrait, - G3D::EqualsTrait, and G3D::HashFunc. overrides are provided for - common G3D classes like G3D::Vector3. -*/ -template, - class EqualsFunc = EqualsTrait, - class HashFunc = HashTrait > -class PointHashGrid { -private: - -#define ThisType PointHashGrid - - /** A value annotated with precomputed position and hash code.*/ - class Entry { - public: - Vector3 position; - Value value; - }; - - /** One cell of the grid. */ - typedef Array Cell; - typedef Table CellTable; - - /** The cube of +/-1 along each dimension. Initialized by initOffsetArray.*/ - Vector3int32 m_offsetArray[3*3*3]; - - /** Incremented every time the data structure is mutated. - Used by the iterators to determine if the data structure - has changed since iteration began. */ - int m_epoch; - - /** Extent of a cell along one dimension. */ - float m_cellWidth; - - /** Conservative bounds; the actual data may be smaller. */ - AABox m_bounds; - - /** Number of elements. */ - int m_size; - - /** Non-empty cells indexed by grid position. Actual 3D position is - position * m_cellWidth*/ - CellTable m_data; - - - /** Intentionally unimplemented: prevent copy construction. */ - PointHashGrid(const ThisType&); - - - /** Intentionally unimplemented: prevent assignment. */ - PointHashGrid& operator=(const ThisType&); - - - /** Locate the cell and index within that cell containing v. Called by - remove() and contains(). */ - bool find( - const Value& v, - Vector3int32& foundCellCoord, - Cell*& foundCell, - int& index) { - - Vector3 pos; - PosFunc::getPosition(v, pos); - - Vector3int32 cellCoord; - getCellCoord(pos, cellCoord); - for (int i = 0; i < 27; ++i) { - Vector3int32 c = cellCoord + m_offsetArray[i]; - Cell* cell = m_data.getPointer(c); - if (cell != NULL) { - // The cell exists - for (int j = 0; j < cell->size(); ++j) { - if (EqualsFunc::equals((*cell)[j].value, v)) { - foundCell = cell; - index = j; - foundCellCoord = c; - return true; - } - } - } - } - - // Not found - return false; - } - - /** Given a real-space position, returns the cell coord - containing it.*/ - void getCellCoord(const Vector3& pos, Vector3int32& cellCoord) const { - for (int a = 0; a < 3; ++a) { - cellCoord[a] = iFloor(pos[a] / m_cellWidth); - } - } - - /** Initializes m_offsetArray. */ - void initOffsetArray() { - int i = 0; - Vector3int32 d; - for (d.x = -1; d.x <= +1; ++d.x) { - for (d.y = -1; d.y <= +1; ++d.y) { - for (d.z = -1; d.z <= +1; ++d.z) { - m_offsetArray[i] = d; - ++i; - } - } - } - - // Put (0, 0, 0) first, so that contains() is most likely to find - // the value quickly. - i = (1 * 3 + 1) * 3 + 1; - debugAssert(m_offsetArray[i] == Vector3int32(0,0,0)); - Vector3int32 temp = m_offsetArray[0]; - m_offsetArray[0] = m_offsetArray[i]; - m_offsetArray[i] = temp; - } - -public: - - /** - @param radiusHint the radius that will typically be used with - beginSphereIntersection and beginBoxIntersection. If two Values are equal, - their positions must be within this radius as well. - */ - PointHashGrid(float radiusHint) : m_size(0) { - initOffsetArray(); - - debugAssertM(radiusHint > 0, "Cell radius must be positive"); - m_cellWidth = radiusHint; - } - - /** - If radiusHint is negative, it is automatically chosen to put - about 5 values in each grid cell (which means about 27 * 5 - values for each beginIntersection call). - */ - PointHashGrid(const Array& init, float radiusHint = -1.0f) : m_size(0) { - initOffsetArray(); - - Vector3 lo(Vector3::inf()); - Vector3 hi(-lo); - - // Compute bounds - Array entry(init.size()); - for (int i = 0; i < entry.size(); ++i) { - const Value& value = init[i]; - Vector3 pos = m_posFunc(value); - - entry[i].value = value; - entry[i].hashCode = m_hashFunc(value); - entry[i].position = pos; - - lo = lo.min(pos); - hi = hi.max(pos); - } - - m_bounds = AABox(lo, hi); - - if (radiusHint <= 0) { - // Compute a good cell width based on the bounds. - // - // N numPerCell - // ----- = --------- - // volume r^3 - - float numPerCell = 5; - radiusHint = - (float)pow(numPerCell * m_bounds.volume() / init.size(), 1.0 / 3.0); - - if (radiusHint == 0) { - // Volume must have been zero because all points were colocated. - radiusHint = 0.1f; - } - } - - insert(init); - } - - /** Returns the number of elements. */ - inline int size() const { - return m_size; - } - - /** Returns a conservative bounding box around the contents. This is - conservative because it is not updated when elements are removed. */ - const AABox& conservativeBoxBounds() const { - return m_bounds; - } - - /** Insert @a v at position @a p given by getPosition(v, p). - Multiple elements that are equal may be inserted; all copies will be - in the data structure. */ - void insert(const Value& v) { - Vector3 pos; - PosFunc::getPosition(v, pos); - Vector3int32 cellCoord; - getCellCoord(pos, cellCoord); - - // See if the cell already exists - Cell* cell = m_data.getPointer(cellCoord); - - if (cell == NULL) { - // The cell did not exist; create it - m_data.set(cellCoord, Cell()); - cell = m_data.getPointer(cellCoord); - } - debugAssert(cell != NULL); - - Entry& entry = cell->next(); - entry.value = v; - entry.position = pos; - - // Update the bounds - if (size() == 0) { - m_bounds = AABox(pos); - } else { - m_bounds.merge(pos); - } - - ++m_size; - ++m_epoch; - } - - - /** Inserts all elements of the array. */ - void insert(const Array& v) { - for (int i = 0; i < v.size(); ++i) { - insert(v[i]); - } - } - - - /** If there are multiple copies of an element, you must - delete them multiple times. - - @param shrinkAsNeeded If true, deallocate underlying data - structures as they are emptied. False increases performace at - the cost of memory overhead for dynamic structures. - - @return true if the element was found. - */ - bool remove(const Value& v, bool shrinkIfNecessary = true) { - Cell* cell = NULL; - int index = 0; - Vector3int32 cellCoord; - - if (find(v, cellCoord, cell, index)) { - cell->fastRemove(index, shrinkIfNecessary); - --m_size; - ++m_epoch; - - if ((cell->size() == 0) && shrinkIfNecessary) { - // Remove the cell itself - - // Drop our pointer, which is about to dangle - cell = NULL; - bool success = m_data.remove(cellCoord); - debugAssertM(success, "Data structure corrupt: " - "tried to remove a cell that doesn't exist."); - } - - return true; - - } else { - return false; - } - } - - /** Removes all elements of @v. */ - void remove(const Array& v, bool shrink = true) { - for (int i = 0; i < v.size(); ++i) { - remove(v[i], shrink); - } - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - class Iterator { - private: - friend class ThisType; - - bool m_isEnd; - - const ThisType* m_grid; - - typename CellTable::Iterator m_tableIterator; - - /** Index within m_tableIterator->value of the current value. */ - int m_arrayIndex; - - const int m_epoch; - - /** End iterator. Note that the m_tableIterator is initialized to the end iterator - of a temporary value! This is ok because we'll never look at the value of the - m_tableIterator, since we're initializing the "end" Iterator.*/ - Iterator() : m_isEnd(true), m_grid(NULL), m_tableIterator(CellTable().end()), - m_arrayIndex(0), m_epoch(0) {} - - Iterator(const ThisType* grid) : - m_isEnd(false), - m_grid(grid), - m_tableIterator( grid->m_data.begin() ), - m_arrayIndex(0), - m_epoch(grid->m_epoch) { } - - private: - - const Value& value() const { - debugAssert(! m_isEnd); - debugAssertM(m_tableIterator->value.size() > m_arrayIndex, - "No more elements"); - return m_tableIterator->value[m_arrayIndex].value; - } - - public: - - inline bool operator!=(const Iterator& other) const { - if (other.m_isEnd && m_isEnd) { - return false; - } else { - return (m_isEnd != other.m_isEnd) || - (m_tableIterator != other.m_tableIterator) || - (m_arrayIndex != other.m_arrayIndex); - } - } - - bool operator==(const Iterator& other) const { - return !(*this != other); - } - - /** Preincrement */ - Iterator& operator++() { - debugAssert(! m_isEnd); - debugAssertM(m_epoch == m_grid->m_epoch, - "It is illegal to mutate the HashGrid " - "while iterating through it."); - - ++m_arrayIndex; - - if (m_arrayIndex >= m_tableIterator->value.size()) { - // Move on to the next cell - ++m_tableIterator; - m_arrayIndex = 0; - - // Check to see if we're at the end - m_isEnd = (m_tableIterator == m_grid->m_data.end()); - } - - return *this; - } - - /** Post increment (slower) */ - Iterator operator++(int) { - debugAssert(! m_isEnd); - Iterator old = *this; - ++(*this); - return old; - } - - const Value& operator*() const { return value(); } - const Value* operator->() const { return &value(); } - operator Value*() const { return &value(); } - }; // Iterator - - - /** Iterate through all members. It is an error to mutate the HashGrid - while iterating through it. Each member can be accessed by "dereferencing" - the iterator: - -
-        for (Grid::Iterator i = grid.begin(); i != grid.end(), ++i) {
-        const Value& = *i;
-        ...
-        }
-        
- */ - Iterator begin() const { - return Iterator(this); - } - - const Iterator& end() const { - static const Iterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - // Forward declaration required by older gcc versions for friend declaration in BoxIterator - class SphereIterator; - class BoxIterator { - private: - friend class ThisType; - friend class SphereIterator; - - bool m_isEnd; - - const ThisType* m_grid; - - /** Lower bound on the boxes covered, inclusive. */ - Vector3int32 m_lo; - - /** Upper bound on the boxes covered, inclusive.*/ - Vector3int32 m_hi; - - /** If true, test values against m_box before returning them.*/ - bool m_exact; - - /** The underlying box in 3D space */ - AABox m_box; - - /** The iterator winds through the 3D grid between m_lo and (m_lo + m_extent) in - Z,Y,X-major order. This is the index keeping track of how - far it has come */ - Vector3int32 m_current; - - /** The current cell. */ - Cell* m_cell; - - /** Index within m_cell of the current value */ - int m_arrayIndex; - - const int m_epoch; - - - /** Called from advance() */ - void advanceCell() { - do { - ++m_current.x; - if (m_current.x > m_hi.x) { - m_current.x = m_lo.x; - ++m_current.y; - if (m_current.y > m_hi.y) { - m_current.y = m_lo.y; - ++m_current.z; - if (m_current.z > m_hi.z) { - m_isEnd = true; - return; - } - } - } - - // Pick up the new cell - m_cell = m_grid->m_data.getPointer(m_current); - // Keep advancing if the cell does not exist - } while ((m_cell == NULL) || (m_cell->size() == 0)); - } - - /** Advance to the next value */ - void advance() { - debugAssert(! m_isEnd); - - do { - ++m_arrayIndex; - bool inConstructor = (m_cell == NULL); - if (inConstructor || m_arrayIndex >= m_cell->size()) { - advanceCell(); - m_arrayIndex = 0; - - if (m_isEnd) { - // Ran out of values - return; - } - debugAssert(m_cell != NULL); - } - - // Advance until we have a value that can be returned, either - // because we don't care about exactness or because it is - // guaranteed to be within the box. - } while (m_exact && ! m_box.contains(position())); - } - - - /** End iterator */ - BoxIterator() : m_isEnd(true), m_grid(NULL), m_exact(true), m_current(0,0,0), m_cell(NULL), m_arrayIndex(0), m_epoch(0) {} - - /** Begin iterator */ - BoxIterator(const ThisType* grid, bool exact, const AABox& box) : - m_isEnd(false), - m_grid(grid), - m_exact(exact), - m_box(box), - m_current(-1, 0 ,0), - m_cell(NULL), - m_arrayIndex(0), - m_epoch(grid->m_epoch) { - - m_grid->getCellCoord(box.low(), m_lo); - m_grid->getCellCoord(box.high(), m_hi); - - // Get to the first value - m_current = m_lo; - // Back up one so that advancing takes us to the first - --m_current.x; - advance(); - } - - const Value& value() const { - debugAssert(! m_isEnd); - return (*m_cell)[m_arrayIndex].value; - } - - /** Used by SphereIterator::advance() */ - const Vector3& position() const { - debugAssert(! m_isEnd); - return (*m_cell)[m_arrayIndex].position; - } - - public: - - inline bool operator!=(const BoxIterator& other) const { - if (other.m_isEnd && m_isEnd) { - return false; - } else { - return (m_isEnd != other.m_isEnd) || - (m_cell != other.m_cell) || - (m_arrayIndex != other.m_arrayIndex); - } - } - - bool operator==(const BoxIterator& other) const { - return !(*this != other); - } - - /** Preincrement */ - BoxIterator& operator++() { - debugAssert(! m_isEnd); - debugAssertM(m_epoch == m_grid->m_epoch, - "It is illegal to mutate the HashGrid " - "while iterating through it."); - - advance(); - - return *this; - } - - /** Post increment (slower) */ - BoxIterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const Value& operator*() const { return value(); } - const Value* operator->() const { return &value(); } - operator Value*() const { return &value(); } - - bool hasMore() const { - return ! m_isEnd; - } - }; // BoxIterator - - /** - Finds all values whose positions are within @a box. It is an error to - mutate the PointHashGrid while iterating through it. - - @param exact If false, the iterator will execute more quickly but will likely return some - values that lie outside the box. Set exact = false if you are going to test the - results against the yourself box anyway. - */ - BoxIterator beginBoxIntersection(const AABox& box, bool exact = true) const { - return BoxIterator(this, exact, box); - } - - const BoxIterator& endBoxIntersection() const { - static const BoxIterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - class SphereIterator { - private: - - friend class ThisType; - - bool m_isEnd; - Sphere m_sphere; - BoxIterator m_boxIterator; - - SphereIterator() : m_isEnd(true) {} - - void advance() { - if (! m_boxIterator.hasMore()) { - m_isEnd = true; - return; - } - - while (! m_sphere.contains(m_boxIterator.position())) { - ++m_boxIterator; - - if (! m_boxIterator.hasMore()) { - m_isEnd = true; - return; - } - } - } - - static AABox getBoundingBox(const Sphere& s) { - AABox box; - s.getBounds(box); - return box; - } - - SphereIterator(const ThisType* grid, const Sphere& sphere) : - m_isEnd(false), - m_sphere(sphere), - m_boxIterator(grid, false, getBoundingBox(sphere)) { - - // Find the first element that is actually in the sphere, - // not just the box. - advance(); - } - - const Value& value() const { - return *m_boxIterator; - } - - // TODO: if the sphere is very big compared to radius, check each - // cell's box to see if the cell itself is actually inside the sphere - // before iterating through it, since there may be many boxes outside the sphere. - - public: - - inline bool operator!=(const SphereIterator& other) const { - if (other.m_isEnd && m_isEnd) { - return false; - } else { - return - (m_isEnd != other.m_isEnd) || - (m_sphere != other.m_sphere) || - (m_boxIterator != other.m_boxIterator); - } - } - - bool operator==(const SphereIterator& other) const { - return !(*this != other); - } - - - - /** Preincrement */ - SphereIterator& operator++() { - debugAssert(! m_isEnd); - - ++m_boxIterator; - advance(); - - return *this; - } - - /** Post increment (slower) */ - SphereIterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const Value& operator*() const { return value(); } - const Value* operator->() const { return &value(); } - operator Value*() const { return &value(); } - - bool hasMore() const { - return ! m_isEnd; - } - }; // SphereIterator - - /** - Finds all values whose positions are within @a sphere. It is an error - to mutate the HashGrid while iterating through it. - */ - SphereIterator beginSphereIntersection(const Sphere& sphere) const { - return SphereIterator(this, sphere); - } - - const SphereIterator& endSphereIntersection() const { - static const SphereIterator it; - return it; - } - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - - /** - Dereference to access the bounds() and size() [element count] of the underlying - cell objet. - - Example: -
-       for(PointHashGrid::CellIterator iter = grid.beginCells(); iter != grid.endCells(); ++iter) {	
-       entriesFound += iter->size();
-       }
-    */
-    class CellIterator {
-    private:
-        friend class ThisType;
-
-        bool                                    m_isEnd;
-        const ThisType*                         m_grid;
-        typename CellTable::Iterator            m_tableIterator;
-        const int                               m_epoch;
-
-
-        Cell& cell() {
-            return m_tableIterator->value;
-        }
-
-    public:
-        
-        class CellObject {
-            friend class CellIterator;
-        private:
-            const CellIterator* m_parent;
-
-            CellObject() : m_parent(NULL) {}
-
-        public:
-
-            /** Returns the bounds on this cell */
-            AABox bounds() const {
-                const Vector3int32& k = m_parent->m_tableIterator->key;
-                return AABox(Vector3(k) * m_parent->m_cellWidth, 
-                             Vector3(k + Vector3int32(1, 1, 1)) * m_parent->m_cellWidth);
-            }
-
-            /** Number of elements inside this cell */
-            int size() const {
-                debugAssert(! m_parent->m_isEnd);
-                return m_parent->m_tableIterator->value.size();
-            }
-        };
-
-    private:
-        /** Used to make the indirection work.*/
-        CellObject m_indirection;
-
-        /** End iterator. Note that the m_tableIterator is initialized to the end iterator
-            of a temporary value!  This is ok because we'll never look at the value of the 
-            m_tableIterator, since we're initializing the "end" Iterator.*/
-        CellIterator() : 
-            m_isEnd(true),
-            m_grid(NULL),
-            m_tableIterator( CellTable().end() ),
-            m_epoch(0) {}
-        
-        CellIterator(const ThisType* grid) : 
-            m_isEnd(false),
-            m_grid(grid),
-            m_tableIterator( grid->m_data.begin()),
-            m_epoch(grid->m_epoch) {
-            m_indirection.m_parent = this;
-            m_isEnd = ! m_tableIterator.hasMore();
-        }
-        
-    public:
-
-        const CellObject& operator*()  const { return  m_indirection; }
-        const CellObject* operator->() const { return &m_indirection; }
-        operator CellObject*()         const { return &m_indirection; }
-
-        inline bool operator!=(const CellIterator& other) const {
-            // != is called more often than == during iteration
-            return !(
-                     (m_isEnd && other.m_isEnd) ||
-                     ((m_isEnd == other.m_isEnd) && 
-                      (m_tableIterator != other.m_tableIterator)));
-        }
-
-        bool operator==(const CellIterator& other) const {
-            return !(*this != other);
-        }
-
-        /** Preincrement */
-        CellIterator& operator++() {
-            debugAssertM(m_epoch == m_grid->m_epoch, 
-                         "It is illegal to mutate the HashGrid while "
-                         "iterating through it.");
-            ++m_tableIterator;
-            m_isEnd = ! m_tableIterator.hasMore();
-            return *this;
-        }
-
-        /** Post increment (slower) */
-        CellIterator operator++(int) {
-            Iterator old = *this;
-            ++(*this);
-            return old;
-        }
-
-        bool hasMore() const {
-            return ! m_isEnd;
-        }
-    }; // CellIterator
-
-    /** Iterates through the non-empty cells.  This is intended primarily for
-        debugging and visualizing the data structure.*/
-    CellIterator beginCells() const {
-        return CellIterator(this);
-    }
-
-    const CellIterator& endCells() const {
-        static const CellIterator it;
-        return it;
-    }
-
-    ///////////////////////////////////////////////////////////////////////////
-    ///////////////////////////////////////////////////////////////////////////
-
-    /** Returns true if there is a value that is exactly equal to @a. This will 
-        check all neighboring cells to avoid roundoff error at cell boundaries. 
-    */
-    bool contains(const Value& v) const {
-        Cell* cell = NULL;
-        int   index = 0;
-        Vector3int32 cellCoord;
-        return const_cast(this)->find(v, cellCoord, cell, index);
-    }
-
-    /** Calls delete on all of the values, which are assumed to be pointers. 
-        This is a helper to avoid requiring you to iterate through the data 
-        structure, removing and deleting each one. Clears the PointHashGrid at the
-        end.
-		
-        Using objects (instead of pointers) or reference counted pointers is 
-        recommended over using pointers and this deleteAll method.*/
-    void deleteAll() {
-        for (Iterator it = begin(); it.hasMore(); ++it) {
-            delete *it;
-        }
-        clear();
-    }
-
-    /** Removes all data. 
-        @param shrink If true, underlying structures are deallocated as
-        they are freed.*/
-    void clear(bool shrink = true) {
-        m_size = 0;
-        m_bounds = AABox();
-        if (! shrink) {
-            // Remove all data
-            for (CellIterator it = beginCells(); it.hasMore(); ++it) {
-                it.cell().clear(true);
-            }
-        } else {
-            m_data.clear();
-        }
-        ++m_epoch;
-    }
-
-    int debugGetDeepestBucketSize() const {
-        return m_data.debugGetDeepestBucketSize();
-    }
-
-    float debugGetAverageBucketSize() const {
-        return m_data.debugGetAverageBucketSize();
-    }
-#undef ThisType 
-};
-
-} // G3D
-#endif
diff --git a/externals/g3dlite/G3D.lib/include/G3D/Pointer.h b/externals/g3dlite/G3D.lib/include/G3D/Pointer.h
deleted file mode 100644
index 2b80187bae5..00000000000
--- a/externals/g3dlite/G3D.lib/include/G3D/Pointer.h
+++ /dev/null
@@ -1,275 +0,0 @@
-/** 
-  @file Pointer.h
- 
-  @maintainer Morgan McGuire, graphics3d.com
- 
-  @created 2007-05-16
-  @edited  2007-06-22
-
-  Copyright 2000-2007, Morgan McGuire.
-  All rights reserved.
- */
-#ifndef G3D_POINTER_H
-#define G3D_POINTER_H
-
-#include "G3D/debugAssert.h"
-#include "G3D/ReferenceCount.h"
-
-namespace G3D {
-
-/**
-   Acts like a pointer to a value of type ValueType (i.e.,
-   ValueType*), but can operate through accessor methods as well as on
-   a value in memory.  This is useful for implementing scripting
-   languages and other applications that need to connect existing APIs
-   by reference.
-
-   Because the accessors require values to be passed by value (instead of by reference)
-   this is primarily useful for objects whose memory size is small.
-
-   
-   class Foo {
-   public:
-      void setEnabled(bool b);
-      bool getEnabled() const;
-   };
-
-   Foo  f;
-   bool b;
-   
-   Pointer p1(&b);
-   Pointer p2(&f, &Foo::getEnabled, &Foo::setEnabled);
-
-   *p1 = true;
-   *p2 = false;
-   *p2 = *p1; \/\/ Value assignment
-   p2 = p1; \/\/ Pointer aliasing
-
-   \/\/ Or, equivalently:
-   p1.setValue(true);
-   p2.setValue(false);
-
-   p2.setValue(p1.getValue());
-   p2 = p1;
-   
- - Note: Because of the way that dereference is implemented, you cannot pass *p through a function - that takes varargs (...), e.g., printf("%d", *p) will produce a compile-time error. Instead use - printf("%d",(bool)*p) or printf("%d", p.getValue()). - - */ -template -class Pointer { -private: - - class Interface { - public: - virtual ~Interface() {}; - virtual void set(ValueType b) = 0; - virtual ValueType get() const = 0; - virtual Interface* clone() const = 0; - }; - - class Memory : public Interface { - private: - - ValueType* value; - - public: - - Memory(ValueType* value) : value(value) { - debugAssert(value != NULL); - } - - virtual void set(ValueType v) { - *value = v; - } - - virtual ValueType get() const { - return *value; - } - - virtual Interface* clone() const { - return new Memory(value); - } - }; - - template - class Accessor : public Interface { - private: - - T* object; - GetMethod getMethod; - SetMethod setMethod; - - public: - - Accessor(T* object, - GetMethod getMethod, - SetMethod setMethod) : object(object), getMethod(getMethod), setMethod(setMethod) { - debugAssert(object != NULL); - } - - virtual void set(ValueType v) { - (object->*setMethod)(v); - } - - virtual ValueType get() const { - return (object->*getMethod)(); - } - - virtual Interface* clone() const { - return new Accessor(object, getMethod, setMethod); - } - }; - - - template - class RefAccessor : public Interface { - private: - - ReferenceCountedPointer object; - GetMethod getMethod; - SetMethod setMethod; - - public: - - RefAccessor( - const ReferenceCountedPointer& object, - GetMethod getMethod, - SetMethod setMethod) : object(object), getMethod(getMethod), setMethod(setMethod) { - - debugAssert(object != NULL); - } - - virtual void set(ValueType v) { - (object.pointer()->*setMethod)(v); - } - - virtual ValueType get() const { - return (object.pointer()->*getMethod)(); - } - - virtual Interface* clone() const { - return new RefAccessor(object, getMethod, setMethod); - } - }; - - - Interface* interface; - -public: - - Pointer() : interface(NULL) {}; - - /** Allows implicit cast from real pointer */ - Pointer(ValueType* v) : interface(new Memory(v)) {} - - // Assignment - inline Pointer& operator=(const Pointer& r) { - delete interface; - if (r.interface != NULL) { - interface = r.interface->clone(); - } else { - interface = NULL; - } - return this[0]; - } - - Pointer(const Pointer& p) : interface(NULL) { - this[0] = p; - } - - template - Pointer(const ReferenceCountedPointer& object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(const ReferenceCountedPointer& object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(const ReferenceCountedPointer& object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(const ReferenceCountedPointer& object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - interface(new RefAccessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - interface(new Accessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(const ValueType&)) : - interface(new Accessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - const ValueType& (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - interface(new Accessor(object, getMethod, setMethod)) {} - - template - Pointer(Class* object, - ValueType (Class::*getMethod)() const, - void (Class::*setMethod)(ValueType)) : - interface(new Accessor(object, getMethod, setMethod)) {} - - ~Pointer() { - delete interface; - } - - inline const ValueType getValue() const { - debugAssert(interface != NULL); - return interface->get(); - } - - inline void setValue(const ValueType& v) { - debugAssert(interface != NULL); - interface->set(v); - } - - class IndirectValue { - private: - - friend class Pointer; - Pointer* pointer; - IndirectValue(Pointer* p) : pointer(p) {} - - public: - - void operator=(const ValueType& v) { - pointer->setValue(v); - } - - operator ValueType() const { - return pointer->getValue(); - } - - }; - - inline IndirectValue operator*() { - return IndirectValue(this); - } - - inline const ValueType operator*() const { - return getValue(); - } -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/PositionTrait.h b/externals/g3dlite/G3D.lib/include/G3D/PositionTrait.h deleted file mode 100644 index 67a4f64138a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/PositionTrait.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef G3D_POSITIONTRAIT_H -#define G3D_POSITIONTRAIT_H - -template -struct PositionTrait{}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Quat.h b/externals/g3dlite/G3D.lib/include/G3D/Quat.h deleted file mode 100644 index d4b892623d8..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Quat.h +++ /dev/null @@ -1,725 +0,0 @@ -/** - @file Quat.h - - Quaternion - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-01-23 - @edited 2006-05-10 - */ - -#ifndef G3D_QUAT_H -#define G3D_QUAT_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Matrix3.h" -#include - -namespace G3D { - -/** - Unit quaternions are used in computer graphics to represent - rotation about an axis. Any 3x3 rotation matrix can - be stored as a quaternion. - - A quaternion represents the sum of a real scalar and - an imaginary vector: ix + jy + kz + w. A unit quaternion - representing a rotation by A about axis v has the form - [sin(A/2)*v, cos(A/2)]. For a unit quaternion, q.conj() == q.inverse() - is a rotation by -A about v. -q is the same rotation as q - (negate both the axis and angle). - - A non-unit quaterion q represents the same rotation as - q.unitize() (Dam98 pg 28). - - Although quaternion-vector operations (eg. Quat + Vector3) are - well defined, they are not supported by this class because - they typically are bugs when they appear in code. - - Do not subclass. - - BETA API -- subject to change - @cite Erik B. Dam, Martin Koch, Martin Lillholm, Quaternions, Interpolation and Animation. Technical Report DIKU-TR-98/5, Department of Computer Science, University of Copenhagen, Denmark. 1998. - */ -class Quat { -private: - // Hidden operators - bool operator<(const Quat&) const; - bool operator>(const Quat&) const; - bool operator<=(const Quat&) const; - bool operator>=(const Quat&) const; - -public: - - /** - q = [sin(angle / 2) * axis, cos(angle / 2)] - - In Watt & Watt's notation, s = w, v = (x, y, z) - In the Real-Time Rendering notation, u = (x, y, z), w = w - */ - float x, y, z, w; - - /** - Initializes to a zero degree rotation. - */ - inline Quat() : x(0), y(0), z(0), w(1) {} - - Quat( - const Matrix3& rot); - - inline Quat(float _x, float _y, float _z, float _w) : - x(_x), y(_y), z(_z), w(_w) {} - - /** Defaults to a pure vector quaternion */ - inline Quat(const Vector3& v, float _w = 0) : x(v.x), y(v.y), z(v.z), w(_w) { - } - - /** - The real part of the quaternion. - */ - inline const float& real() const { - return w; - } - - inline float& real() { - return w; - } - - /** Note: two quats can represent the Quat::sameRotation and not be equal. */ - bool fuzzyEq(const Quat& q) { - return G3D::fuzzyEq(x, q.x) && G3D::fuzzyEq(y, q.y) && G3D::fuzzyEq(z, q.z) && G3D::fuzzyEq(w, q.w); - } - - /** True if these quaternions represent the same rotation (note that every rotation is - represented by two values; q and -q). - */ - bool sameRotation(const Quat& q) { - return fuzzyEq(q) || fuzzyEq(-q); - } - - inline Quat operator-() const { - return Quat(-x, -y, -z, -w); - } - - /** - Returns the imaginary part (x, y, z) - */ - inline const Vector3& imag() const { - return *(reinterpret_cast(this)); - } - - inline Vector3& imag() { - return *(reinterpret_cast(this)); - } - - /** q = [sin(angle/2)*axis, cos(angle/2)] */ - static Quat fromAxisAngleRotation( - const Vector3& axis, - float angle); - - /** Returns the axis and angle of rotation represented - by this quaternion (i.e. q = [sin(angle/2)*axis, cos(angle/2)]) */ - void toAxisAngleRotation( - Vector3& axis, - double& angle) const; - - void toAxisAngleRotation( - Vector3& axis, - float& angle) const { - double d; - toAxisAngleRotation(axis, d); - angle = (float)d; - } - - Matrix3 toRotationMatrix() const; - - void toRotationMatrix( - Matrix3& rot) const; - - /** - Spherical linear interpolation: linear interpolation along the - shortest (3D) great-circle route between two quaternions. - - Note: Correct rotations are expected between 0 and PI in the right order. - - @cite Based on Game Physics -- David Eberly pg 538-540 - @param threshold Critical angle between between rotations at which - the algorithm switches to normalized lerp, which is more - numerically stable in those situations. 0.0 will always slerp. - */ - Quat slerp( - const Quat& other, - float alpha, - float threshold = 0.05f) const; - - /** Normalized linear interpolation of quaternion components. */ - Quat nlerp(const Quat& other, float alpha) const; - - /** - Negates the imaginary part. - */ - inline Quat conj() const { - return Quat(-x, -y, -z, w); - } - - inline float sum() const { - return x + y + z + w; - } - - inline float average() const { - return sum() / 4.0f; - } - - inline Quat operator*(float s) const { - return Quat(x * s, y * s, z * s, w * s); - } - - inline Quat& operator*=(float s) { - x *= s; - y *= s; - z *= s; - w *= s; - return *this; - } - - /** @cite Based on Watt & Watt, page 360 */ - friend Quat operator* (float s, const Quat& q); - - inline Quat operator/(float s) const { - return Quat(x / s, y / s, z / s, w / s); - } - - inline float dot(const Quat& other) const { - return (x * other.x) + (y * other.y) + (z * other.z) + (w * other.w); - } - - /** Note that q-1 = q.conj() for a unit quaternion. - @cite Dam99 page 13 */ - inline Quat inverse() const { - return conj() / dot(*this); - } - - Quat operator-(const Quat& other) const; - - Quat operator+(const Quat& other) const; - - /** - Quaternion multiplication (composition of rotations). - Note that this does not commute. - */ - Quat operator*(const Quat& other) const; - - /* (*this) * other.inverse() */ - Quat operator/(const Quat& other) const { - return (*this) * other.inverse(); - } - - - /** Is the magnitude nearly 1.0? */ - inline bool isUnit(float tolerance = 1e-5) const { - return abs(dot(*this) - 1.0f) < tolerance; - } - - - inline float magnitude() const { - return sqrtf(dot(*this)); - } - - inline Quat log() const { - if ((x == 0) && (y == 0) && (z == 0)) { - if (w > 0) { - return Quat(0, 0, 0, ::logf(w)); - } else if (w < 0) { - // Log of a negative number. Multivalued, any number of the form - // (PI * v, ln(-q.w)) - return Quat((float)pi(), 0, 0, ::logf(-w)); - } else { - // log of zero! - return Quat((float)nan(), (float)nan(), (float)nan(), (float)nan()); - } - } else { - // Partly imaginary. - float imagLen = sqrtf(x * x + y * y + z * z); - float len = sqrtf(imagLen * imagLen + w * w); - float theta = atan2f(imagLen, (float)w); - float t = theta / imagLen; - return Quat(t * x, t * y, t * z, ::logf(len)); - } - } - /** log q = [Av, 0] where q = [sin(A) * v, cos(A)]. - Only for unit quaternions - debugAssertM(isUnit(), "Log only defined for unit quaternions"); - // Solve for A in q = [sin(A)*v, cos(A)] - Vector3 u(x, y, z); - double len = u.magnitude(); - - if (len == 0.0) { - return - } - double A = atan2((double)w, len); - Vector3 v = u / len; - - return Quat(v * A, 0); - } - */ - - /** exp q = [sin(A) * v, cos(A)] where q = [Av, 0]. - Only defined for pure-vector quaternions */ - inline Quat exp() const { - debugAssertM(w == 0, "exp only defined for vector quaternions"); - Vector3 u(x, y, z); - float A = u.magnitude(); - Vector3 v = u / A; - return Quat(sinf(A) * v, cosf(A)); - } - - - /** - Raise this quaternion to a power. For a rotation, this is - the effect of rotating x times as much as the original - quaterion. - - Note that q.pow(a).pow(b) == q.pow(a + b) - @cite Dam98 pg 21 - */ - inline Quat pow(float x) const { - return (log() * x).exp(); - } - - inline void unitize() { - float mag2 = dot(*this); - if (! G3D::fuzzyEq(mag2, 1.0f)) { - *this *= rsq(mag2); - } - } - - /** - Returns a unit quaterion obtained by dividing through by - the magnitude. - */ - inline Quat toUnit() const { - Quat x = *this; - x.unitize(); - return x; - } - - /** - The linear algebra 2-norm, sqrt(q dot q). This matches - the value used in Dam's 1998 tech report but differs from the - n(q) value used in Eberly's 1999 paper, which is the square of the - norm. - */ - inline float norm() const { - return magnitude(); - } - - // access quaternion as q[0] = q.x, q[1] = q.y, q[2] = q.z, q[3] = q.w - // - // WARNING. These member functions rely on - // (1) Quat not having virtual functions - // (2) the data packed in a 4*sizeof(float) memory block - const float& operator[] (int i) const; - float& operator[] (int i); - - /** Generate uniform random unit quaternion (i.e. random "direction") - @cite From "Uniform Random Rotations", Ken Shoemake, Graphics Gems III. - */ - static Quat unitRandom(); - - void deserialize(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 zx() const; - Vector2 wx() const; - Vector2 xy() const; - Vector2 yy() const; - Vector2 zy() const; - Vector2 wy() const; - Vector2 xz() const; - Vector2 yz() const; - Vector2 zz() const; - Vector2 wz() const; - Vector2 xw() const; - Vector2 yw() const; - Vector2 zw() const; - Vector2 ww() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 zxx() const; - Vector3 wxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 zyx() const; - Vector3 wyx() const; - Vector3 xzx() const; - Vector3 yzx() const; - Vector3 zzx() const; - Vector3 wzx() const; - Vector3 xwx() const; - Vector3 ywx() const; - Vector3 zwx() const; - Vector3 wwx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 zxy() const; - Vector3 wxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - Vector3 zyy() const; - Vector3 wyy() const; - Vector3 xzy() const; - Vector3 yzy() const; - Vector3 zzy() const; - Vector3 wzy() const; - Vector3 xwy() const; - Vector3 ywy() const; - Vector3 zwy() const; - Vector3 wwy() const; - Vector3 xxz() const; - Vector3 yxz() const; - Vector3 zxz() const; - Vector3 wxz() const; - Vector3 xyz() const; - Vector3 yyz() const; - Vector3 zyz() const; - Vector3 wyz() const; - Vector3 xzz() const; - Vector3 yzz() const; - Vector3 zzz() const; - Vector3 wzz() const; - Vector3 xwz() const; - Vector3 ywz() const; - Vector3 zwz() const; - Vector3 wwz() const; - Vector3 xxw() const; - Vector3 yxw() const; - Vector3 zxw() const; - Vector3 wxw() const; - Vector3 xyw() const; - Vector3 yyw() const; - Vector3 zyw() const; - Vector3 wyw() const; - Vector3 xzw() const; - Vector3 yzw() const; - Vector3 zzw() const; - Vector3 wzw() const; - Vector3 xww() const; - Vector3 yww() const; - Vector3 zww() const; - Vector3 www() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 zxxx() const; - Vector4 wxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 zyxx() const; - Vector4 wyxx() const; - Vector4 xzxx() const; - Vector4 yzxx() const; - Vector4 zzxx() const; - Vector4 wzxx() const; - Vector4 xwxx() const; - Vector4 ywxx() const; - Vector4 zwxx() const; - Vector4 wwxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 zxyx() const; - Vector4 wxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 zyyx() const; - Vector4 wyyx() const; - Vector4 xzyx() const; - Vector4 yzyx() const; - Vector4 zzyx() const; - Vector4 wzyx() const; - Vector4 xwyx() const; - Vector4 ywyx() const; - Vector4 zwyx() const; - Vector4 wwyx() const; - Vector4 xxzx() const; - Vector4 yxzx() const; - Vector4 zxzx() const; - Vector4 wxzx() const; - Vector4 xyzx() const; - Vector4 yyzx() const; - Vector4 zyzx() const; - Vector4 wyzx() const; - Vector4 xzzx() const; - Vector4 yzzx() const; - Vector4 zzzx() const; - Vector4 wzzx() const; - Vector4 xwzx() const; - Vector4 ywzx() const; - Vector4 zwzx() const; - Vector4 wwzx() const; - Vector4 xxwx() const; - Vector4 yxwx() const; - Vector4 zxwx() const; - Vector4 wxwx() const; - Vector4 xywx() const; - Vector4 yywx() const; - Vector4 zywx() const; - Vector4 wywx() const; - Vector4 xzwx() const; - Vector4 yzwx() const; - Vector4 zzwx() const; - Vector4 wzwx() const; - Vector4 xwwx() const; - Vector4 ywwx() const; - Vector4 zwwx() const; - Vector4 wwwx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 zxxy() const; - Vector4 wxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 zyxy() const; - Vector4 wyxy() const; - Vector4 xzxy() const; - Vector4 yzxy() const; - Vector4 zzxy() const; - Vector4 wzxy() const; - Vector4 xwxy() const; - Vector4 ywxy() const; - Vector4 zwxy() const; - Vector4 wwxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 zxyy() const; - Vector4 wxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - Vector4 zyyy() const; - Vector4 wyyy() const; - Vector4 xzyy() const; - Vector4 yzyy() const; - Vector4 zzyy() const; - Vector4 wzyy() const; - Vector4 xwyy() const; - Vector4 ywyy() const; - Vector4 zwyy() const; - Vector4 wwyy() const; - Vector4 xxzy() const; - Vector4 yxzy() const; - Vector4 zxzy() const; - Vector4 wxzy() const; - Vector4 xyzy() const; - Vector4 yyzy() const; - Vector4 zyzy() const; - Vector4 wyzy() const; - Vector4 xzzy() const; - Vector4 yzzy() const; - Vector4 zzzy() const; - Vector4 wzzy() const; - Vector4 xwzy() const; - Vector4 ywzy() const; - Vector4 zwzy() const; - Vector4 wwzy() const; - Vector4 xxwy() const; - Vector4 yxwy() const; - Vector4 zxwy() const; - Vector4 wxwy() const; - Vector4 xywy() const; - Vector4 yywy() const; - Vector4 zywy() const; - Vector4 wywy() const; - Vector4 xzwy() const; - Vector4 yzwy() const; - Vector4 zzwy() const; - Vector4 wzwy() const; - Vector4 xwwy() const; - Vector4 ywwy() const; - Vector4 zwwy() const; - Vector4 wwwy() const; - Vector4 xxxz() const; - Vector4 yxxz() const; - Vector4 zxxz() const; - Vector4 wxxz() const; - Vector4 xyxz() const; - Vector4 yyxz() const; - Vector4 zyxz() const; - Vector4 wyxz() const; - Vector4 xzxz() const; - Vector4 yzxz() const; - Vector4 zzxz() const; - Vector4 wzxz() const; - Vector4 xwxz() const; - Vector4 ywxz() const; - Vector4 zwxz() const; - Vector4 wwxz() const; - Vector4 xxyz() const; - Vector4 yxyz() const; - Vector4 zxyz() const; - Vector4 wxyz() const; - Vector4 xyyz() const; - Vector4 yyyz() const; - Vector4 zyyz() const; - Vector4 wyyz() const; - Vector4 xzyz() const; - Vector4 yzyz() const; - Vector4 zzyz() const; - Vector4 wzyz() const; - Vector4 xwyz() const; - Vector4 ywyz() const; - Vector4 zwyz() const; - Vector4 wwyz() const; - Vector4 xxzz() const; - Vector4 yxzz() const; - Vector4 zxzz() const; - Vector4 wxzz() const; - Vector4 xyzz() const; - Vector4 yyzz() const; - Vector4 zyzz() const; - Vector4 wyzz() const; - Vector4 xzzz() const; - Vector4 yzzz() const; - Vector4 zzzz() const; - Vector4 wzzz() const; - Vector4 xwzz() const; - Vector4 ywzz() const; - Vector4 zwzz() const; - Vector4 wwzz() const; - Vector4 xxwz() const; - Vector4 yxwz() const; - Vector4 zxwz() const; - Vector4 wxwz() const; - Vector4 xywz() const; - Vector4 yywz() const; - Vector4 zywz() const; - Vector4 wywz() const; - Vector4 xzwz() const; - Vector4 yzwz() const; - Vector4 zzwz() const; - Vector4 wzwz() const; - Vector4 xwwz() const; - Vector4 ywwz() const; - Vector4 zwwz() const; - Vector4 wwwz() const; - Vector4 xxxw() const; - Vector4 yxxw() const; - Vector4 zxxw() const; - Vector4 wxxw() const; - Vector4 xyxw() const; - Vector4 yyxw() const; - Vector4 zyxw() const; - Vector4 wyxw() const; - Vector4 xzxw() const; - Vector4 yzxw() const; - Vector4 zzxw() const; - Vector4 wzxw() const; - Vector4 xwxw() const; - Vector4 ywxw() const; - Vector4 zwxw() const; - Vector4 wwxw() const; - Vector4 xxyw() const; - Vector4 yxyw() const; - Vector4 zxyw() const; - Vector4 wxyw() const; - Vector4 xyyw() const; - Vector4 yyyw() const; - Vector4 zyyw() const; - Vector4 wyyw() const; - Vector4 xzyw() const; - Vector4 yzyw() const; - Vector4 zzyw() const; - Vector4 wzyw() const; - Vector4 xwyw() const; - Vector4 ywyw() const; - Vector4 zwyw() const; - Vector4 wwyw() const; - Vector4 xxzw() const; - Vector4 yxzw() const; - Vector4 zxzw() const; - Vector4 wxzw() const; - Vector4 xyzw() const; - Vector4 yyzw() const; - Vector4 zyzw() const; - Vector4 wyzw() const; - Vector4 xzzw() const; - Vector4 yzzw() const; - Vector4 zzzw() const; - Vector4 wzzw() const; - Vector4 xwzw() const; - Vector4 ywzw() const; - Vector4 zwzw() const; - Vector4 wwzw() const; - Vector4 xxww() const; - Vector4 yxww() const; - Vector4 zxww() const; - Vector4 wxww() const; - Vector4 xyww() const; - Vector4 yyww() const; - Vector4 zyww() const; - Vector4 wyww() const; - Vector4 xzww() const; - Vector4 yzww() const; - Vector4 zzww() const; - Vector4 wzww() const; - Vector4 xwww() const; - Vector4 ywww() const; - Vector4 zwww() const; - Vector4 wwww() const; -}; - -inline Quat exp(const Quat& q) { - return q.exp(); -} - -inline Quat log(const Quat& q) { - return q.log(); -} - -inline G3D::Quat operator*(double s, const G3D::Quat& q) { - return q * (float)s; -} - -inline G3D::Quat operator*(float s, const G3D::Quat& q) { - return q * s; -} - -inline float& Quat::operator[] (int i) { - debugAssert(i >= 0); - debugAssert(i < 4); - return ((float*)this)[i]; -} - -inline const float& Quat::operator[] (int i) const { - debugAssert(i >= 0); - debugAssert(i < 4); - return ((float*)this)[i]; -} - -inline Quat Quat::operator-(const Quat& other) const { - return Quat(x - other.x, y - other.y, z - other.z, w - other.w); -} - -inline Quat Quat::operator+(const Quat& other) const { - return Quat(x + other.x, y + other.y, z + other.z, w + other.w); -} - -} // Namespace G3D - -// Outside the namespace to avoid overloading confusion for C++ -inline G3D::Quat pow(const G3D::Quat& q, double x) { - return q.pow((float)x); -} - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Queue.h b/externals/g3dlite/G3D.lib/include/G3D/Queue.h deleted file mode 100644 index b64eced820a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Queue.h +++ /dev/null @@ -1,355 +0,0 @@ -/** - @file Queue.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2002-07-09 - @edited 2005-08-20 - */ - -#ifndef G3D_QUEUE_H -#define G3D_QUEUE_H - -#include "G3D/platform.h" -#include "G3D/System.h" -#include "G3D/debug.h" - -namespace G3D { - -/** - Locate the indices of the break between of the two - sections of the circular queue. These are used to - construct two for loops that iterate over the whole - sequence without using the modulo operator. - - [0 ... secondEnd) [head .... firstEnd) - */ -#define FIND_ENDS \ - int firstEnd = head + num;\ - int secondEnd = 0;\ - if (firstEnd > numAllocated) {\ - secondEnd = firstEnd - numAllocated;\ - firstEnd = numAllocated;\ - } - - -/** - Dynamic queue that uses a circular buffer for performance. - - Faster than std::deque for objects with constructors. - */ -template -class Queue { -private: - // - // |<---- num ---->| - // [ | | | | | | | | | | | | | ] - // ^ - // | - // head - // - // - - /** - Only num elements are initialized. - */ - T* data; - - /** - Index of the next element to be dequeue-d in data. - */ - int head; - - /** - Number of elements (including head) that are visible and initialized. - */ - int num; - - /** - Size of data array in elements. - */ - int numAllocated; - - /** If a clear was needed, assumes it already occured */ - void _copy(const Queue& other) { - debugAssert(data == NULL); - data = (T*)System::malloc(sizeof(T) * other.numAllocated); - debugAssert(data); - head = other.head; - num = other.num; - numAllocated = other.numAllocated; - - FIND_ENDS; - - for (int i = head; i < firstEnd; ++i) { - new (data + i)T(other.data[i]); - } - - for (int i = 0; i < secondEnd; ++i) { - new (data + i)T(other.data[i]); - } - } - - - /** - Computes a data array index from a queue position. The queue position - may be negative. - */ - inline int index(int i) const { - return (head + i + numAllocated) % numAllocated; - } - - /** - Allocates newSize elements and repacks the array. - */ - void repackAndRealloc(int newSize) { - // TODO: shrink queue - T* old = data; - data = (T*)System::malloc(newSize * sizeof(T)); - debugAssert(data != NULL); - - FIND_ENDS; - - int j = 0; - for (int i = head; i < firstEnd; ++i, ++j) { - new (data + j)T(old[i]); - (old + i)->~T(); - } - - for (int i = 0; i < secondEnd; ++i, ++j) { - new (data + j)T(old[i]); - (old + i)->~T(); - } - - head = 0; - System::free(old); - numAllocated = newSize; - } - - /** - Ensure that there is at least one element between - the tail and head, wrapping around in the circular - buffer. - */ - inline void reserveSpace() { - if (num == numAllocated) { - repackAndRealloc(numAllocated * 3 + 20); - } - } - -public: - - Queue() : - data(NULL), - head(0), - num(0), - numAllocated(0) { - } - - - /** - Copy constructor - */ - Queue(const Queue& other) : data(NULL) { - _copy(other); - } - - - /** - Destructor does not delete() the objects if T is a pointer type - (e.g. T = int*) instead, it deletes the pointers themselves and - leaves the objects. Call deleteAll if you want to dealocate - the objects referenced. - */ - virtual ~Queue() { - clear(); - } - - /** - Insert a new element into the front of the queue - (a traditional queue only uses pushBack). - */ - inline void pushFront(const T& e) { - reserveSpace(); - - // Get the index of head-1 - int i = index(-1); - - // Call the constructor on the newly exposed element. - new (data + i)T(e); - - // Reassign the head to point to this index - head = i; - ++num; - } - - /** - Insert a new element at the end of the queue. - */ - inline void pushBack(const T& e) { - reserveSpace(); - - // Get the index of 1+tail - int i = index(num); - - // Initialize that element - new (data + i)T(e); - ++num; - } - - /** - pushBack - */ - inline void enqueue(const T& e) { - pushBack(e); - } - - - /** - Remove the last element from the queue. The queue will never - shrink in size. (A typical queue only uses popFront). - */ - inline T popBack() { - int tail = index(num - 1); - T result(data[tail]); - - // Call the destructor - (data + tail)->~T(); - --num; - - return result; - } - - /** - Remove the next element from the head of the queue. The queue will never - shrink in size. */ - inline T popFront() { - T result(data[head]); - // Call the destructor - (data + head)->~T(); - head = (head + 1) % numAllocated; - --num; - return result; - } - - - /** - popFront - */ - inline T dequeue() { - return popFront(); - } - - /** - Removes all elements (invoking their destructors). - - @param freeStorage If false, the underlying array is not deallocated - (allowing fast push in the future), however, the size of the Queue - is reported as zero. - - */ - void clear(bool freeStorage = true) { - - FIND_ENDS; - - // Invoke the destructors on the elements - int i; - for (i = head; i < firstEnd; ++i) { - (data + i)->~T(); - } - - for (i = 0; i < secondEnd; ++i) { - (data + i)->~T(); - } - - num = 0; - head = 0; - if (freeStorage) { - numAllocated = 0; - System::free(data); - data = NULL; - } - } - - /** Clear without freeing the underlying array. */ - void fastClear() { - clear(false); - } - - /** - Assignment operator. - */ - Queue& operator=(const Queue& other) { - clear(); - _copy(other); - return *this; - } - - /** - Number of elements in the queue. - */ - inline int size() const { - return num; - } - - /** - Number of elements in the queue. - */ - inline int length() const { - return size(); - } - - /** - Performs bounds checks in debug mode - */ - inline T& operator[](int n) { - debugAssert((n >= 0) && (n < num)); - return data[index(n)]; - } - - /** - Performs bounds checks in debug mode - */ - inline const T& operator[](int n) const { - debugAssert((n >= 0) && (n < num)); - return data[index(n)]; - } - - - /** - Returns true if the given element is in the queue. - */ - bool contains(const T& e) const { - for (int i = 0; i < size(); ++i) { - if ((*this)[i] == e) { - return true; - } - } - - return false; - } - - /** - Calls delete on all objects[0...size-1] - and sets the queue size to zero. - */ - void deleteAll() { - FIND_ENDS; - - int i; - for (i = 0; i < secondEnd; ++i) { - delete data[i]; - } - - for (i = head; i < firstEnd; ++i) { - delete data[i]; - } - clear(); - } -}; - -#undef FIND_ENDS - -}; // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Ray.h b/externals/g3dlite/G3D.lib/include/G3D/Ray.h deleted file mode 100644 index ab43c82933a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Ray.h +++ /dev/null @@ -1,329 +0,0 @@ -/** - @file Ray.h - - Ray class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-07-12 - @edited 2006-02-21 - */ - -#ifndef G3D_RAY_H -#define G3D_RAY_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Triangle.h" - -namespace G3D { - -/** - A 3D Ray. - */ -class Ray { -private: - Ray(const Vector3& origin, const Vector3& direction) { - this->origin = origin; - this->direction = direction; - } - -public: - Vector3 origin; - - /** - Not unit length - */ - Vector3 direction; - - Ray() : origin(Vector3::zero()), direction(Vector3::zero()) {} - - Ray(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** - Creates a Ray from a origin and a (nonzero) direction. - */ - static Ray fromOriginAndDirection(const Vector3& point, const Vector3& direction) { - return Ray(point, direction); - } - - Ray unit() const { - return Ray(origin, direction.unit()); - } - - /** - Returns the closest point on the Ray to point. - */ - Vector3 closestPoint(const Vector3& point) const { - float t = direction.dot(point - this->origin); - if (t < 0) { - return this->origin; - } else { - return this->origin + direction * t; - } - } - - /** - Returns the closest distance between point and the Ray - */ - float distance(const Vector3& point) const { - return (closestPoint(point) - point).magnitude(); - } - - /** - Returns the point where the Ray and plane intersect. If there - is no intersection, returns a point at infinity. - - Planes are considered one-sided, so the ray will not intersect - a plane where the normal faces in the traveling direction. - */ - Vector3 intersection(const class Plane& plane) const; - - /** - Returns the distance until intersection with the (solid) sphere. - Will be 0 if inside the sphere, inf if there is no intersection. - - The ray direction is not normalized. If the ray direction - has unit length, the distance from the origin to intersection - is equal to the time. If the direction does not have unit length, - the distance = time * direction.length(). - - See also the G3D::CollisionDetection "movingPoint" methods, - which give more information about the intersection. - */ - float intersectionTime(const class Sphere& sphere) const; - - float intersectionTime(const class Plane& plane) const; - - float intersectionTime(const class Box& box) const; - - float intersectionTime(const class AABox& box) const; - - /** - The three extra arguments are the weights of vertices 0, 1, and 2 - at the intersection point; they are useful for texture mapping - and interpolated normals. - */ - float intersectionTime( - const Vector3& v0, const Vector3& v1, const Vector3& v2, - const Vector3& edge01, const Vector3& edge02, - double& w0, double& w1, double& w2) const; - - /** - Ray-triangle intersection for a 1-sided triangle. Fastest version. - @cite http://www.acm.org/jgt/papers/MollerTrumbore97/ - http://www.graphics.cornell.edu/pubs/1997/MT97.html - */ - inline float intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - const Vector3& edge01, - const Vector3& edge02) const; - - - inline float intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2) const { - - return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0); - } - - - inline float intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - double& w0, - double& w1, - double& w2) const { - - return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0, w0, w1, w2); - } - - /* One-sided triangle - */ - inline float intersectionTime(const Triangle& triangle) const { - return intersectionTime( - triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), - triangle.edge01(), triangle.edge02()); - } - - inline float intersectionTime( - const Triangle& triangle, - double& w0, - double& w1, - double& w2) const { - return intersectionTime(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), - triangle.edge01(), triangle.edge02(), w0, w1, w2); - } - - /** Refracts about the normal - using G3D::Vector3::refractionDirection - and bumps the ray slightly from the newOrigin. */ - Ray refract( - const Vector3& newOrigin, - const Vector3& normal, - float iInside, - float iOutside) const; - - /** Reflects about the normal - using G3D::Vector3::reflectionDirection - and bumps the ray slightly from - the newOrigin. */ - Ray reflect( - const Vector3& newOrigin, - const Vector3& normal) const; -}; - - -#define EPSILON 0.000001 -#define CROSS(dest,v1,v2) \ - dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \ - dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \ - dest[2]=v1[0]*v2[1]-v1[1]*v2[0]; - -#define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]) - -#define SUB(dest,v1,v2) \ - dest[0]=v1[0]-v2[0]; \ - dest[1]=v1[1]-v2[1]; \ - dest[2]=v1[2]-v2[2]; - -inline float Ray::intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - const Vector3& edge1, - const Vector3& edge2) const { - - (void)vert1; - (void)vert2; - - // Barycenteric coords - float u, v; - - float tvec[3], pvec[3], qvec[3]; - - // begin calculating determinant - also used to calculate U parameter - CROSS(pvec, direction, edge2); - - // if determinant is near zero, ray lies in plane of triangle - const float det = DOT(edge1, pvec); - - if (det < EPSILON) { - return (float)inf(); - } - - // calculate distance from vert0 to ray origin - SUB(tvec, origin, vert0); - - // calculate U parameter and test bounds - u = DOT(tvec, pvec); - if ((u < 0.0f) || (u > det)) { - // Hit the plane outside the triangle - return (float)inf(); - } - - // prepare to test V parameter - CROSS(qvec, tvec, edge1); - - // calculate V parameter and test bounds - v = DOT(direction, qvec); - if ((v < 0.0f) || (u + v > det)) { - // Hit the plane outside the triangle - return (float)inf(); - } - - - // Case where we don't need correct (u, v): - const float t = DOT(edge2, qvec); - - if (t >= 0.0f) { - // Note that det must be positive - return t / det; - } else { - // We had to travel backwards in time to intersect - return (float)inf(); - } -} - - -inline float Ray::intersectionTime( - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2, - const Vector3& edge1, - const Vector3& edge2, - double& w0, - double& w1, - double& w2) const { - - (void)vert1; - (void)vert2; - - // Barycenteric coords - float u, v; - - float tvec[3], pvec[3], qvec[3]; - - // begin calculating determinant - also used to calculate U parameter - CROSS(pvec, direction, edge2); - - // if determinant is near zero, ray lies in plane of triangle - const float det = DOT(edge1, pvec); - - if (det < EPSILON) { - return (float)inf(); - } - - // calculate distance from vert0 to ray origin - SUB(tvec, origin, vert0); - - // calculate U parameter and test bounds - u = DOT(tvec, pvec); - if ((u < 0.0f) || (u > det)) { - // Hit the plane outside the triangle - return (float)inf(); - } - - // prepare to test V parameter - CROSS(qvec, tvec, edge1); - - // calculate V parameter and test bounds - v = DOT(direction, qvec); - if ((v < 0.0f) || (u + v > det)) { - // Hit the plane outside the triangle - return (float)inf(); - } - - float t = DOT(edge2, qvec); - - if (t >= 0) { - const float inv_det = 1.0f / det; - t *= inv_det; - u *= inv_det; - v *= inv_det; - - w0 = (1.0f - u - v); - w1 = u; - w2 = v; - - return t; - } else { - // We had to travel backwards in time to intersect - return (float)inf(); - } -} - -#undef EPSILON -#undef CROSS -#undef DOT -#undef SUB - -}// namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Rect2D.h b/externals/g3dlite/G3D.lib/include/G3D/Rect2D.h deleted file mode 100644 index a6c0b7cd0cb..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Rect2D.h +++ /dev/null @@ -1,391 +0,0 @@ -/** - @file Rect2D.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-11-13 - @created 2008-11-16 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_RECT2D_H -#define G3D_RECT2D_H - -// Linux defines this as a macro -#ifdef border -#undef border -#endif - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector2.h" - -namespace G3D { - -/** - If you are using this class for pixel rectangles, keep in mind that the last - pixel you can draw to is at x0() + width() - 1. - */ -class Rect2D { -private: - Vector2 min, max; - - /** - Returns true if the whole polygon is clipped. - @param p Value of the point - @param axis Index [0 or 1] of the axis to clip along? - @param clipGreater Are we clipping greater than or less than the line? - @param inPoly Polygon being clipped - @param outPoly The clipped polygon - */ - template - static bool clipSide2D( - const float p, bool clipGreater, int axis, - const Array& inPoly, Array& outPoly) { - - outPoly.clear(); - int i0 = -1; - - Vector2 pt1; - bool c1 = true; - - float negate = clipGreater ? -1 : 1; - - // Find a point that is not clipped - for (i0 = 0; (i0 < inPoly.length()) && c1; ++i0) { - pt1 = inPoly[i0]; - c1 = (negate * pt1[axis]) < (negate * p); - } - - // We incremented i0 one time to many - --i0; - - if (c1) { - // We could not find an unclipped point - return true; - } - - outPoly.append(pt1); - - // for each point in inPoly, - // if the point is outside the side and the previous one was also outside, continue - // if the point is outside the side and the previous one was inside, cut the line - // if the point is inside the side and the previous one was also inside, append the points - // if the point is inside the side and the previous one was outside, cut the line - for (int i = 1; i <= inPoly.length(); ++i) { - T pt2 = inPoly[(i + i0) % inPoly.length()]; - bool c2 = (negate * pt2[axis]) < (negate * p); - - if (c1 ^ c2) { - - if (!c1 && c2 && (i > 1)) { - // Unclipped to clipped trasition and not the first iteration - outPoly.append(pt1); - } - - // only one point is clipped, find where the line crosses the clipping plane - - - float alpha; - if (pt2[axis] == pt1[axis]) { - alpha = 0; - } else { - alpha = (p - pt1[axis]) / (pt2[axis] - pt1[axis]); - } - outPoly.append(pt1.lerp(pt2, alpha)); - } else if (! (c1 || c2) && (i != 1)) { - // neither point is clipped (don't do this the first time - // because we appended the first pt before the loop) - outPoly.append(pt1); - } - - pt1 = pt2; - c1 = c2; - } - - return false; - } - -public: - - inline Rect2D() : min(0, 0), max(0, 0) {} - - /** Creates a rectangle at 0,0 with the given width and height*/ - inline Rect2D(const Vector2& wh) : min(0, 0), max(wh.x, wh.y) {} - - /** Computes a rectangle that contains both @a a and @a b. - Note that even if @a or @b has zero area, its origin will be included.*/ - inline Rect2D(const Rect2D& a, const Rect2D& b) { - min = a.min.min(b.min); - max = a.max.max(b.max); - } - - /** @brief Uniformly random point on the interior */ - inline Vector2 randomPoint() const { - return Vector2(uniformRandom(0, max.x - min.x) + min.x, - uniformRandom(0, max.y - min.y) + min.y); - } - - inline float width() const { - return max.x - min.x; - } - - inline float height() const { - return max.y - min.y; - } - - inline float x0() const { - return min.x; - } - - inline float x1() const { - return max.x; - } - - inline float y0() const { - return min.y; - } - - inline float y1() const { - return max.y; - } - - /** Min, min corner */ - inline Vector2 x0y0() const { - return min; - } - - inline Vector2 x1y0() const { - return Vector2(max.x, min.y); - } - - inline Vector2 x0y1() const { - return Vector2(min.x, max.y); - } - - /** Max,max corner */ - inline Vector2 x1y1() const { - return max; - } - - /** Width and height */ - inline Vector2 wh() const { - return max - min; - } - - inline Vector2 center() const { - return (max + min) * 0.5; - } - - inline static Rect2D xyxy(float x0, float y0, float x1, float y1) { - Rect2D r; - - r.min.x = G3D::min(x0, x1); - r.min.y = G3D::min(y0, y1); - r.max.x = G3D::max(x0, x1); - r.max.y = G3D::max(y0, y1); - - return r; - } - - Rect2D lerp(const Rect2D& other, float alpha) const { - Rect2D out; - - out.min = min.lerp(other.min, alpha); - out.max = max.lerp(other.max, alpha); - - return out; - } - - inline static Rect2D xyxy(const Vector2& v0, const Vector2& v1) { - Rect2D r; - - r.min = v0.min(v1); - r.max = v0.max(v1); - - return r; - } - - inline static Rect2D xywh(float x, float y, float w, float h) { - return xyxy(x, y, x + w, y + h); - } - - inline static Rect2D xywh(const Vector2& v, const Vector2& w) { - return xyxy(v.x, v.y, v.x + w.x, v.y + w.y); - } - - inline bool contains(const Vector2& v) const { - return (v.x >= min.x) && (v.y >= min.y) && (v.x <= max.x) && (v.y <= max.y); - } - - inline bool contains(const Rect2D& r) const { - return (min.x <= r.min.x) && (min.y <= r.min.y) && - (max.x >= r.max.x) && (max.y >= r.max.y); - } - - /** True if there is non-zero area to the intersection between @a this and @a r. - Note that two rectangles that are adjacent do not intersect because there is - zero area to the overlap, even though one of them "contains" the corners of the other.*/ - inline bool intersects(const Rect2D& r) const { - return (min.x < r.max.x) && (min.y < r.max.y) && - (max.x > r.min.x) && (max.y > r.min.y); - } - - /** Like intersection, but counts the adjacent case as touching. */ - inline bool intersectsOrTouches(const Rect2D& r) const { - return (min.x <= r.max.x) && (min.y <= r.max.y) && - (max.x >= r.min.x) && (max.y >= r.min.y); - } - - inline Rect2D operator*(float s) const { - return xyxy(min.x * s, min.y * s, max.x * s, max.y * s); - } - - inline Rect2D operator/(float s) const { - return xyxy(min / s, max / s); - } - - inline Rect2D operator/(const Vector2& s) const { - return xyxy(min / s, max / s); - } - - inline Rect2D operator+(const Vector2& v) const { - return xyxy(min + v, max + v); - } - - inline Rect2D operator-(const Vector2& v) const { - return xyxy(min - v, max - v); - } - - inline bool operator==(const Rect2D& other) const { - return (min == other.min) && (max == other.max); - } - - inline bool operator!=(const Rect2D& other) const { - return (min != other.min) || (max != other.max); - } - - /** Returns the corners in the order: (min,min), (max,min), (max,max), (min,max). */ - inline Vector2 corner(int i) const { - debugAssert(i >= 0 && i < 4); - switch (i & 3) { - case 0: - return Vector2(min.x, min.y); - case 1: - return Vector2(max.x, min.y); - case 2: - return Vector2(max.x, max.y); - case 3: - return Vector2(min.x, max.y); - default: - // Should never get here - return Vector2(0, 0); - } - } - - - /** @deprecated - @sa expand() */ - inline Rect2D border(float delta) const { - return Rect2D::xywh(x0() + delta, - y0() + delta, - width() - 2.0f * delta, - height() - 2.0f * delta); - } - - /** Returns a new Rect2D that is bigger/smaller by the specified amount - (negative is shrink.) */ - inline Rect2D expand(float delta) const { - float newX = x0() - delta; - float newY = y0() - delta; - float newW = width() + 2.0f * delta; - float newH = height() + 2.0f * delta; - - if (newW < 0.0f) { - newX = (x0() + width()) / 2.0f; - newW = 0.0f; - } - - if (newH < 0.0f) { - newY = (y0() + height()) / 2.0f; - newH = 0.0f; - } - return Rect2D::xywh(newX, newY, newW, newH); - } - - /** - Clips so that the rightmost point of the outPoly is at rect.x1 (e.g. a 800x600 window produces - rightmost point 799, not 800). The results are suitable for pixel rendering if iRounded. - Templated so that it will work for Vector2,3,4 (the z and w components are interpolated linearly). - The template parameter must define T.lerp and contain x and y components. - - If the entire polygon is clipped by a single side, the result will be empty. - The result might also have zero area but not be empty. - */ - template - void clip(const Array& inPoly, Array& outPoly) const { - - const bool greaterThan = true; - const bool lessThan = false; - const int X = 0; - const int Y = 1; - - Array temp; - - bool entirelyClipped = - clipSide2D(x0(), lessThan, X, inPoly, temp) || - clipSide2D(x1(), greaterThan, X, temp, outPoly) || - clipSide2D(y0(), lessThan, Y, outPoly, temp) || - clipSide2D(y1(), greaterThan, Y, temp, outPoly); - - if (entirelyClipped) { - outPoly.clear(); - } - } - - - /** Returns the largest, centered Rect2D that can fit inside this - while maintaining the aspect ratio of x:y. Convenient for - displaying images in odd-shaped windows. - */ - Rect2D largestCenteredSubRect(float ww, float hh) const { - float textureAspect = hh / ww; - float viewAspect = height() / width(); - - if (viewAspect > textureAspect) { - // The view is too tall - float h = width() * textureAspect; - float y = (height() - h) / 2; - return Rect2D::xywh(0, y, width(), h) + corner(0); - } else { - // The view is too wide - float w = height() / textureAspect; - float x = (width() - w) / 2; - return Rect2D::xywh(x, 0, w, height()) + corner(0); - } - } - - /** - Returns the overlap region between the two rectangles. This may have zero area - if they do not intersect. See the two-Rect2D constructor for a way to compute - a union-like rectangle. - */ - Rect2D intersect(const Rect2D& other) const { - if (intersects(other)) { - return Rect2D::xyxy(min.max(other.min), max.min(other.max)); - }else{ - return Rect2D::xywh(0, 0, 0, 0); - } - } - - float area() const { - return width() * height(); - } -}; - -typedef Rect2D AABox2D; -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/ReferenceCount.h b/externals/g3dlite/G3D.lib/include/G3D/ReferenceCount.h deleted file mode 100644 index f55a22be0e1..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/ReferenceCount.h +++ /dev/null @@ -1,597 +0,0 @@ -/** - @file ReferenceCount.h - - Reference Counting Garbage Collector for C++ - - @maintainer Morgan McGuire, matrix@graphics3d.com - @cite Adapted and extended from Justin Miller's "RGC" class that appeared in BYTE magazine. - @cite See also http://www.jelovic.com/articles/cpp_without_memory_errors_slides.htm - - @created 2001-10-23 - @edited 2008-09-25 -*/ - -#ifndef G3D_RGC_H -#define G3D_RGC_H - -#include "G3D/platform.h" -#include "G3D/debug.h" -#include "G3D/AtomicInt32.h" - -namespace G3D { - -/** Base class for WeakReferenceCountedPointer */ -class _WeakPtr { -public: - inline virtual ~_WeakPtr() {} - -protected: - friend class ReferenceCountedObject; - - /** Called by ReferenceCountedObject to tell a weak pointer that its underlying object was collected. */ - virtual void objectCollected() = 0; -}; - -/** Used internally by ReferenceCountedObject */ -class _WeakPtrLinkedList { -public: - _WeakPtr* weakPtr; - _WeakPtrLinkedList* next; - - inline _WeakPtrLinkedList() : weakPtr(NULL), next(NULL) {} - - /** Inserts this node into the head of the list that previously had n as its head. */ - inline _WeakPtrLinkedList(_WeakPtr* p, _WeakPtrLinkedList* n) : weakPtr(p), next(n) {} -}; - -/** - Objects that are reference counted inherit from this. Subclasses - must have a public destructor (the default destructor is fine) - and publicly inherit ReferenceCountedObject. - - Multiple inheritance from a reference counted object is dangerous-- use - at your own risk. - - ReferenceCountedPointer and ReferenceCountedObject are threadsafe. - You can create and drop references on multiple threads without - violating integrity. WeakReferenceCountedPointer is not - threadsafe. Introducing a weak pointer destroys all thread safety, - even for strong pointers to the same object (this is inherent in the - design of the class; we cannot fix it without slowing down the - performance of reference counted objects.) - - Usage Example - -
-
-class Foo : public G3D::ReferenceCountedObject {
-public:
-    int x;
-};
-
-class Bar : public Foo {};
-
-typedef G3D::ReferenceCountedPointer FooRef;
-typedef G3D::WeakReferenceCountedPointer WeakFooRef;
-typedef G3D::ReferenceCountedPointer BarRef;
-
-
-int main(int argc, char *argv[]) {
-
-    WeakFooRef x;
-
-    {
-        FooRef a = new Foo();
-
-        // Reference count == 1
-
-        x = a;
-        // Weak references do not increase count
-
-        {
-            FooRef b = a;
-            // Reference count == 2
-        }
-
-        // Reference count == 1
-    }
-    // No more strong references; object automatically deleted.
-    // x is set to NULL automatically.
-
-    // Example of using dynamic cast on reference counted objects
-    BarRef b = new Bar();
-
-    // No cast needed to go down the heirarchy.
-    FooRef f = b;
-
-    // We can't cast the reference object because it is a class.
-    // Instead we must extract the pointer and cast that:
-    b = dynamic_cast(&*f);
-
-    return 0;
-}
-
- -@deprecated To be replaced by boost::shared_ptr in 7.0 - */ -class ReferenceCountedObject { -public: - - /** - The long name is to keep this from accidentally conflicting with - a subclass's variable name. Do not use or explicitly manipulate - this value--its type may change in the future and is not part - of the supported API. - */ - AtomicInt32 ReferenceCountedObject_refCount; - - /** - Linked list of all weak pointers that reference this (some may be - on the stack!). Do not use or explicitly manipulate this value. - */ - _WeakPtrLinkedList* ReferenceCountedObject_weakPointer; - -protected: - - ReferenceCountedObject() : - ReferenceCountedObject_refCount(0), - ReferenceCountedObject_weakPointer(0) { - - debugAssertM(isValidHeapPointer(this), - "Reference counted objects must be allocated on the heap."); - } - -public: - - /** Automatically called immediately before the object is deleted. - This is not called from the destructor because it needs to be invoked - before the subclass destructor. - */ - void ReferenceCountedObject_zeroWeakPointers() { - // Tell all of my weak pointers that I'm gone. - - _WeakPtrLinkedList* node = ReferenceCountedObject_weakPointer; - - while (node != 0) { - - // Notify the weak pointer that it is going away - node->weakPtr->objectCollected(); - - // Free the node and advance - _WeakPtrLinkedList* tmp = node; - node = node->next; - delete tmp; - } - } - - virtual ~ReferenceCountedObject() {} - - - /** - Note: copies will initially start out with 0 - references and 0 weak references like any other object. - */ - ReferenceCountedObject(const ReferenceCountedObject& notUsed) : - ReferenceCountedObject_refCount(0), - ReferenceCountedObject_weakPointer(0) { - (void)notUsed; - debugAssertM(G3D::isValidHeapPointer(this), - "Reference counted objects must be allocated on the heap."); - } - - ReferenceCountedObject& operator=(const ReferenceCountedObject& other) { - (void)other; - // Nothing changes when I am assigned; the reference count on - // both objects is the same (although my super-class probably - // changes). - return *this; - } -}; - - - -/** - Use ReferenceCountedPointer in place of T* in your program. - T must subclass ReferenceCountedObject. -@deprecated To be replaced by boost::shared_ptr in 7.0 - */ -template -class ReferenceCountedPointer { -private: - - T* m_pointer; - -public: - typedef T element_type; - - inline T* pointer() const { - return m_pointer; - } - -private: - - /** Nulls out the pointer and drops a reference. If the reference - count hits zero. */ - void zeroPointer() { - if (m_pointer != NULL) { - - debugAssert(G3D::isValidHeapPointer(m_pointer)); - debugAssertM(m_pointer->ReferenceCountedObject_refCount.value() > 0, - "Dangling reference detected."); - - // Only delete if this instance caused the count to hit - // exactly zero. If there is a race condition, the value - // may be zero after decrement returns, but only one of - // the instances will get a zero return value. - if (m_pointer->ReferenceCountedObject_refCount.decrement() == 0) { - // We held the last reference, so delete the object. - // This test is threadsafe because there is no way for - // the reference count to increase after the last - // reference was dropped (assuming the application does - // not voilate the class abstraction). - //debugPrintf(" delete 0x%x\n", m_pointer); - - // We must zero the weak pointers *before* deletion in case there - // are cycles of weak references. - // Note that since there are no strong references at this point, - // it is perfectly fair to zero the weak pointers anyway. - m_pointer->ReferenceCountedObject_zeroWeakPointers(); - delete m_pointer; - } - - m_pointer = NULL; - } - } - - /** Non-atomic (except for the referencec increment). Can only be - called in contexts like the copy constructor or initial - constructor where it is known that the reference count will - not hit zero on some other thread. */ - void setPointer(T* x) { - if (x != m_pointer) { - zeroPointer(); - - if (x != NULL) { - debugAssert(G3D::isValidHeapPointer(x)); - - m_pointer = x; - - // Note that the ref count can be zero if this is the - // first pointer to it - debugAssertM(m_pointer->ReferenceCountedObject_refCount.value() >= 0, - "Negative reference count detected."); - m_pointer->ReferenceCountedObject_refCount.increment(); - } - } - } - -public: - - inline ReferenceCountedPointer() : m_pointer(NULL) {} - - /** - Allow silent cast to the base class. - -
-        SubRef  s = new Sub();
-        BaseRef b = s;
-      
- - i.e., compile-time subtyping rule - RCP<T> <: RCP<S> if T <: S - */ - template - inline ReferenceCountedPointer(const ReferenceCountedPointer& p) : - m_pointer(NULL) { - setPointer(p.pointer()); - } - -# if (! defined(MSC_VER) || (MSC_VER >= 1300)) - /** - Explicit cast to a subclass. Acts like dynamic cast; the result will be NULL if - the cast cannot succeed. Not supported on VC6. -
-        SubRef  s = new Sub();
-        BaseRef b = s;
-        s = b.downcast();   // Note that the template argument is the object type, not the pointer type.
-      
- */ - template - ReferenceCountedPointer downcast() { - return ReferenceCountedPointer(dynamic_cast(m_pointer)); - } - - template - const ReferenceCountedPointer downcast() const { - return ReferenceCountedPointer(dynamic_cast(m_pointer)); - } -# endif - - // We need an explicit version of the copy constructor as well or - // the default copy constructor will be used. - inline ReferenceCountedPointer(const ReferenceCountedPointer& p) : m_pointer(NULL) { - setPointer(p.m_pointer); - } - - /** Allows construction from a raw pointer. That object will thereafter be - reference counted -- do not call delete on it. */ - inline ReferenceCountedPointer(T* p) : m_pointer(NULL) { - setPointer(p); - } - - inline ~ReferenceCountedPointer() { - zeroPointer(); - } - - inline size_t hashCode() const { - return reinterpret_cast(m_pointer);; - } - - inline const ReferenceCountedPointer& operator=(const ReferenceCountedPointer& p) { - setPointer(p.m_pointer); - return *this; - } - - inline ReferenceCountedPointer& operator=(T* p) { - setPointer(p); - return *this; - } - - inline bool operator==(const ReferenceCountedPointer& y) const { - return (m_pointer == y.m_pointer); - } - - inline bool operator!=(const ReferenceCountedPointer& y) const { - return (m_pointer != y.m_pointer); - } - - bool operator < (const ReferenceCountedPointer& y) const { - return (m_pointer < y.m_pointer); - } - - bool operator > (const ReferenceCountedPointer& y) const { - return (m_pointer > y.m_pointer); - } - - bool operator <= (const ReferenceCountedPointer& y) const { - return (m_pointer <= y.m_pointer); - } - - bool operator >= (const ReferenceCountedPointer& y) const { - return (m_pointer >= y.m_pointer); - } - - inline T& operator*() const { - debugAssertM(m_pointer != NULL, "Dereferenced a NULL ReferenceCountedPointer"); - return (*m_pointer); - } - - inline T* operator->() const { - debugAssertM(m_pointer != NULL, "Dereferenced a NULL ReferenceCountedPointer"); - return m_pointer; - } - - inline bool isNull() const { - return (m_pointer == NULL); - } - - inline bool notNull() const { - return (m_pointer != NULL); - } - - // TODO: distinguish between last strong and last any pointer - /** - Returns true if this is the last reference to an object. - Useful for flushing memoization caches-- a cache that holds the last - reference is unnecessarily keeping an object alive. - - Not threadsafe. - - @deprecated Use WeakReferenceCountedPointer for caches - */ - inline int isLastReference() const { - return (m_pointer->ReferenceCountedObject_refCount.value() == 1); - } -}; - - -/** - A weak pointer allows the object it references to be garbage collected. - Weak pointers are commonly used in caches, where it is important to hold - a pointer to an object without keeping that object alive solely for the - cache's benefit (i.e., the object can be collected as soon as all - pointers to it outside the cache are gone). They are also convenient - for adding back-pointers in tree and list structures. - - Weak pointers may become NULL at any point (when their target is collected). - Therefore the only way to reference the target is to convert to a strong - pointer and then check that it is not NULL. - -@deprecated To be replaced by boost::weak_ptr in 7.0 - */ -template -class WeakReferenceCountedPointer : public _WeakPtr { -private: - - /** NULL if the object has been collected. */ - T* pointer; - -public: - /** - Creates a strong pointer, which prevents the object from being - garbage collected. The strong pointer may be NULL, which means - that the underlying. - */ - // There is intentionally no way to check if the - // WeakReferenceCountedPointer has a null reference without - // creating a strong pointer since there is no safe way to use - // that information-- the pointer could be collected by a - // subsequent statement. - ReferenceCountedPointer createStrongPtr() const { - // TODO: What if the object's destructor is called while we - // are in this method? - return ReferenceCountedPointer(pointer); - } - - -private: - - /** - Thread issues: safe because this is only called when another - object is guaranteed to keep p alive for the duration of this - call. - */ - void setPointer(T* p) { - // TODO: must prevent the object from being collected while in - // this method - - zeroPointer(); - pointer = p; - - if (pointer != 0) { - // TODO: threadsafe: must update the list atomically - - // Add myself to the head of my target's list of weak pointers - _WeakPtrLinkedList* head = - new _WeakPtrLinkedList - (this, - pointer->ReferenceCountedObject_weakPointer); - - pointer->ReferenceCountedObject_weakPointer = head; - } else { - - } - } - - - /** - Removes this from its target's list of weak pointers. Called - when the weak pointer goes out of scope. - - Thread issues: depends on the thread safety of createStrongPtr. - */ - void zeroPointer() { - // Grab a strong reference to prevent the object from being collected while we - // are traversing its list. - ReferenceCountedPointer strong = createStrongPtr(); - - // If the following test fails then the object was collected before we - // reached it. - if (strong.notNull()) { - debugAssertM(pointer->ReferenceCountedObject_weakPointer != NULL, - "Weak pointer exists without a backpointer from the object."); - - // Remove myself from my target's list of weak pointers - _WeakPtrLinkedList** node = &pointer->ReferenceCountedObject_weakPointer; - while ((*node)->weakPtr != this) { - node = &((*node)->next); - debugAssertM(*node != NULL, - "Weak pointer exists without a backpointer from the object (2)."); - } - - // Node must now point at the node for me. Remove node and - // close the linked list behind it. - _WeakPtrLinkedList* temp = *node; - *node = temp->next; - - // Now delete the node corresponding to me - delete temp; - } - - pointer = NULL; - } - -public: - - WeakReferenceCountedPointer() : pointer(0) {} - - /** - Allow compile time subtyping rule - RCP<T> <: RCP<S> if T <: S - */ - template - inline WeakReferenceCountedPointer(const WeakReferenceCountedPointer& p) : pointer(0) { - // Threadsafe: the object cannot be collected while the other pointer exists. - setPointer(p.pointer); - } - - template - inline WeakReferenceCountedPointer(const ReferenceCountedPointer& p) : pointer(0) { - // Threadsafe: the object cannot be collected while the other - // pointer exists. - setPointer(p.pointer()); - } - - // Gets called a *lot* when weak pointers are on the stack - WeakReferenceCountedPointer( - const WeakReferenceCountedPointer& weakPtr) : pointer(0) { - setPointer(weakPtr.pointer); - } - - WeakReferenceCountedPointer( - const ReferenceCountedPointer& strongPtr) : pointer(0) { - setPointer(strongPtr.pointer()); - } - - ~WeakReferenceCountedPointer() { - zeroPointer(); - } - - WeakReferenceCountedPointer& operator=(const WeakReferenceCountedPointer& other) { - // Threadsafe: the object cannot be collected while the other pointer exists. - - // I now point at other's target - setPointer(other.pointer); - - return *this; - } - - WeakReferenceCountedPointer& operator=(const ReferenceCountedPointer& other) { - - // Threadsafe: the object cannot be collected while the other pointer exists. - - // I now point at other's target - setPointer(other.pointer()); - - return *this; - } - - bool operator==(const WeakReferenceCountedPointer& other) const { - return pointer == other.pointer; - } - - bool operator!=(const WeakReferenceCountedPointer& other) const { - return pointer != other.pointer; - } - - bool operator < (const WeakReferenceCountedPointer& y) const { - return (pointer < y.pointer); - } - - bool operator > (const WeakReferenceCountedPointer& y) const { - return (pointer > y.pointer); - } - - bool operator <= (const WeakReferenceCountedPointer& y) const { - return (pointer <= y.pointer); - } - - bool operator >= (const ReferenceCountedPointer& y) const { - return (pointer >= y.pointer); - } - -protected: - - /** Invoked by the destructor on ReferenceCountedPointer. */ - virtual void objectCollected() { - debugAssertM(pointer != NULL, - "Removed a weak pointer twice."); - pointer = NULL; - } - -}; - -} // namespace - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/RegistryUtil.h b/externals/g3dlite/G3D.lib/include/G3D/RegistryUtil.h deleted file mode 100644 index 4b47be5f4bd..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/RegistryUtil.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - @file RegistryUtil.h - - @created 2006-04-06 - @edited 2006-04-06 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_REGISTRYUTIL_H -#define G3D_REGISTRYUTIL_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -// This file is only used on Windows -#ifdef G3D_WIN32 - -#include - -namespace G3D { - -/** - Provides generalized Windows registry querying. - - All key names are one string in the format: - "[base key]\[sub-keys]" - - A value must now be provided for every query. - An empty value string will use the (Default) value. - - [base key] can be any of the following: - HKEY_CLASSES_ROOT - HKEY_CURRENT_CONFIG - HKEY_CURRENT_USER - HKEY_LOCAL_MACHINE - HKEY_PERFORMANCE_DATA - HKEY_PERFORMANCE_NLSTEXT - HKEY_PERFORMANCE_TEXT - HKEY_USERS - - valueExists() should be used to validate a key+value before reading or writing - to ensure that a debug assert or false return is for a different error during - reads and writes. - - All read and write calls will assert when a key will not open for reasons other - that it does not exist. All read and write calls will assert when the value cannot - be read or written for any reason. -*/ -class RegistryUtil { - -public: - /** returns true if the key exists and the current user has permission to read */ - static bool keyExists(const std::string& key); - - /** returns true if the key exists and the current user has permission to read */ - static bool valueExists(const std::string& key, const std::string& value); - - /** returns false if the key could not be read for any reason. */ - static bool readInt32(const std::string& key, const std::string& value, int32& data); - - /** - Reads an arbitrary amount of data from a binary registry key. - returns false if the key could not be read for any reason. - - @beta - @param data pointer to the output buffer of sufficient size. Pass NULL as data in order to have available data size returned in dataSize. - @param dataSize size of the output buffer. When NULL is passed for data, contains the size of available data on successful return. - */ - static bool readBytes(const std::string& key, const std::string& value, uint8* data, uint32& dataSize); - - /** returns false if the key could not be read for any reason. */ - static bool readString(const std::string& key, const std::string& value, std::string& data); - - /** returns false if the key could not be written for any reason. */ - static bool writeInt32(const std::string& key, const std::string& value, int32 data); - - /** - Writes an arbitrary amount of data to a binary registry key. - returns false if the key could not be written for any reason. - - @param data pointer to the input buffer - @param dataSize size of the input buffer that should be written - */ - static bool writeBytes(const std::string& key, const std::string& value, const uint8* data, uint32 dataSize); - - /** returns false if the key could not be written for any reason. */ - static bool writeString(const std::string& key, const std::string& value, const std::string& data); - -}; - -} // namespace G3D - -#endif // G3D_WIN32 - -#endif // G3D_REGISTRYTUIL_H diff --git a/externals/g3dlite/G3D.lib/include/G3D/Set.h b/externals/g3dlite/G3D.lib/include/G3D/Set.h deleted file mode 100644 index 629d802cdd4..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Set.h +++ /dev/null @@ -1,160 +0,0 @@ -/** - @file Set.h - - Hash set - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-12-09 - @edited 2006-02-20 - */ - -#ifndef G3D_SET_H -#define G3D_SET_H - -#include "G3D/platform.h" -#include "G3D/Table.h" -#include -#include - -namespace G3D { - -/** - An unordered data structure that has at most one of each element. - Provides O(1) time insert, remove, and member test (contains). - - Set uses G3D::Table internally, which means that the template type T - must define a hashCode and operator== function. See G3D::Table for - a discussion of these functions. - */ -// There is not copy constructor or assignment operator defined because -// the default ones are correct for Set. -template -class Set { - - /** - If an object is a member, it is contained in - this table. - */ - Table memberTable; - -public: - - virtual ~Set() {} - - int size() const { - return (int)memberTable.size(); - } - - bool contains(const T& member) const { - return memberTable.containsKey(member); - } - - /** - Inserts into the table if not already present. - */ - void insert(const T& member) { - memberTable.set(member, true); - } - - /** - It is an error to remove members that are not already - present. - */ - void remove(const T& member) { - memberTable.remove(member); - } - - Array getMembers() const { - return memberTable.getKeys(); - } - - void getMembers(Array& keyArray) const { - memberTable.getKeys(keyArray); - } - - void clear() { - memberTable.clear(); - } - - void deleteAll() { - getMembers().deleteAll(); - clear(); - } - - /** - C++ STL style iterator variable. See begin(). - */ - class Iterator { - private: - friend class Set; - - // Note: this is a Table iterator, we are currently defining - // Set iterator - typename Table::Iterator it; - - Iterator(const typename Table::Iterator& it) : it(it) {} - - public: - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - return it == other.it; - } - - /** - Pre increment. - */ - Iterator& operator++() { - ++it; - return *this; - } - - /** - Post increment (slower than preincrement). - */ - Iterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const T& operator*() const { - return it->key; - } - - T* operator->() const { - return &(it->key); - } - - operator T*() const { - return &(it->key); - } - }; - - - /** - C++ STL style iterator method. Returns the first member. - Use preincrement (++entry) to get to the next element. - Do not modify the set while iterating. - */ - Iterator begin() const { - return Iterator(memberTable.begin()); - } - - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - const Iterator end() const { - return Iterator(memberTable.end()); - } -}; - -} - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/Sphere.h b/externals/g3dlite/G3D.lib/include/G3D/Sphere.h deleted file mode 100644 index 7d4c412185d..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Sphere.h +++ /dev/null @@ -1,143 +0,0 @@ -/** - @file Sphere.h - - Sphere class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-06-02 - @edited 2008-10-07 - */ - -#ifndef G3D_SPHERE_H -#define G3D_SPHERE_H - -#include "G3D/platform.h" -#include "G3D/Vector3.h" -#include "G3D/Array.h" -#include "G3D/Sphere.h" - -namespace G3D { - -/** - Sphere. - */ -class Sphere { -private: - - static int32 dummy; - -public: - Vector3 center; - float radius; - - Sphere() { - center = Vector3::zero(); - radius = 0; - } - - Sphere(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - Sphere( - const Vector3& center, - float radius) { - - this->center = center; - this->radius = radius; - } - - virtual ~Sphere() {} - - bool operator==(const Sphere& other) const { - return (center == other.center) && (radius == other.radius); - } - - bool operator!=(const Sphere& other) const { - return !((center == other.center) && (radius == other.radius)); - } - - /** - Returns true if point is less than or equal to radius away from - the center. - */ - bool contains(const Vector3& point) const; - - /** - @deprecated Use culledBy(Array&) - */ - bool culledBy( - const class Plane* plane, - int numPlanes, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - @deprecated Use culledBy(Array&) - */ - bool culledBy( - const class Plane* plane, - int numPlanes, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = 0xFFFFFFFF) const; - - /** - See AABox::culledBy - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex, - const uint32 testMask, - uint32& childMask) const; - - /** - Conservative culling test that does not produce a mask for children. - */ - bool culledBy( - const Array& plane, - int32& cullingPlaneIndex = dummy, - const uint32 testMask = 0xFFFFFFFF) const; - - virtual std::string toString() const; - - float volume() const; - - float area() const; - - /** - Uniformly distributed on the surface. - */ - Vector3 randomSurfacePoint() const; - - /** - Uniformly distributed on the interior (includes surface) - */ - Vector3 randomInteriorPoint() const; - - void getBounds(class AABox& out) const; - - bool intersects(const Sphere& other) const; - - /** Translates the sphere */ - Sphere operator+(const Vector3& v) const { - return Sphere(center + v, radius); - } - - /** Translates the sphere */ - Sphere operator-(const Vector3& v) const { - return Sphere(center - v, radius); - } -}; - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Sphere& key) { - return static_cast(key.center.hashCode() + (key.radius * 13)); - } -}; - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Spline.h b/externals/g3dlite/G3D.lib/include/G3D/Spline.h deleted file mode 100644 index af9b08230b8..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Spline.h +++ /dev/null @@ -1,367 +0,0 @@ -/** - @file Spline.h - - @author Morgan McGuire, morgan@cs.williams.edu - */ - -#ifndef G3D_SPLINE_H -#define G3D_SPLINE_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/g3dmath.h" -#include "G3D/Matrix4.h" -#include "G3D/Vector4.h" - -namespace G3D { - -/** Common implementation code for all G3D::Spline template parameters */ -class SplineBase { -public: - - /** Times at which control points occur. Must have the same - number of elements as Spline::control. */ - Array time; - - /** If cyclic, then the control points will be assumed to wrap around. - If not cyclic, then the tangents at the ends of the spline - point to the final control points.*/ - bool cyclic; - - /** For a cyclic spline, this is the time elapsed between the last - control point and the first. If less than or equal to zero this is - assumed to be: - - (time[0] - time[1] + . - time[time.size() - 1] - time[time.size() - 2]) / 2. - */ - float finalInterval; - - SplineBase() : cyclic(true), finalInterval(-1) {} - - virtual ~SplineBase() {} - - /** See specification for Spline::finalInterval; this handles the - non-positive case. Returns 0 if not cyclic. */ - float getFinalInterval() const; - - /** Returns the amount of time covered by this spline in one - period. For a cyclic spline, this contains the final - interval.*/ - float duration() const; - - /** Computes the derivative spline basis from the control point version. */ - static Matrix4 computeBasis(); - -protected: - - /** Assumes that t0 <= s < tn. called by computeIndex. */ - void computeIndexInBounds(float s, int& i, float& u) const; - -public: - - /** - Given a time @a s, finds @a i and 0 <= @a u < 1 such that - @s = time[@a i] * @a u + time[@a i + 1] * (1 - @a u). Note that - @i may be outside the bounds of the time and control arrays; - use getControl to handle wraparound and extrapolation issues. - - This function takes expected O(1) time for control points with - uniform time sampled control points or for uniformly - distributed random time samples, but may take O( log time.size() ) time - in the worst case. - - Called from evaluate(). - */ - void computeIndex(float s, int& i, float& u) const; -}; - - -/** - Smooth parameteric curve implemented using a piecewise 3rd-order - Catmull-Rom spline curve. The spline is considered infinite and may - either continue linearly from the specified control points or cycle - through them. Control points are spaced uniformly in time at unit - intervals by default, but irregular spacing may be explicitly - specified. - - The dimension of the spline can be set by varying the Control - template parameter. For a 1D function, use Spline. For a - curve in the plane, Spline. Note that any template - parameter that supports operator+(Control) and operator*(float) can - be used; you can make splines out of G3D::Vector4, G3D::Matrix3, or - your own classes. - - To provide shortest-path interpolation, subclass G3D::Spline and - override ensureShortestPath(). To provide normalization of - interpolated points (e.g., projecting Quats onto the unit - hypersphere) override correct(). - - See Real Time Rendering, 2nd edition, ch 12 for a general discussion - of splines and their properties. - - @sa G3D::UprightSpline, G3D::QuatSpline - */ -template -class Spline : public SplineBase { -protected: - /** The additive identity control point. */ - Control zero; - -public: - - /** Control points. Must have the same number of elements as - Spline::time.*/ - Array control; - - Spline() { - static Control x; - // Hide the fact from C++ that we are using an - // uninitialized variable here by pointer arithmetic. - // This is ok because any type that is a legal control - // point also supports multiplication by float. - zero = *(&x) * 0.0f; - } - - /** Appends a control point at a specific time that must be - greater than that of the previous point. */ - void append(float t, const Control& c) { - debugAssertM((time.size() == 0) || (t > time.last()), - "Control points must have monotonically increasing times."); - time.append(t); - control.append(c); - debugAssert(control.size() == time.size()); - } - - - /** Appends control point spaced in time based on the previous - control point, or spaced at unit intervals if this is the - first control point. */ - void append(const Control& c) { - switch (time.size()) { - case 0: - append(0, c); - break; - - case 1: - if (time[0] == 0) { - append(1, c); - } else { - append(time[0], c); - } - break; - - default: - append(2 * time[time.size() - 1] - time[time.size() - 2], c); - } - debugAssert(control.size() == time.size()); - } - - /** Erases all control points and times, but retains the state of - cyclic and finalInterval. - */ - void clear() { - control.clear(); - time.clear(); - } - - - /** Number of control points */ - int size() const { - debugAssert(time.size() == control.size()); - return control.size(); - } - - - /** Returns the requested control point and time sample based on - array index. If the array index is out of bounds, wraps (for - a cyclic spline) or linearly extrapolates (for a non-cyclic - spline), assuming time intervals follow the first or last - sample recorded. - - Calls correct() on the control point if it was extrapolated. - - Returns 0 if there are no control points. - - @sa Spline::control and Spline::time for the underlying - control point array; Spline::computeIndex to find the index - given a time. - */ - void getControl(int i, float& t, Control& c) const { - int N = control.size(); - if (N == 0) { - c = zero; - t = 0; - } else if (cyclic) { - c = control[iWrap(i, N)]; - - if (i < 0) { - // Wrapped around bottom - - // Number of times we wrapped around the cyclic array - int wraps = (N + 1 - i) / N; - int j = (i + wraps * N) % N; - t = time[j] - wraps * duration(); - - } else if (i < N) { - - t = time[i]; - - } else { - // Wrapped around top - - // Number of times we wrapped around the cyclic array - int wraps = i / N; - int j = i % N; - t = time[j] + wraps * duration(); - } - - } else if (i < 0) { - // Are there enough points to extrapolate? - if (N >= 2) { - // Step away from control point 0 - float dt = time[1] - time[0]; - - // Extrapolate (note; i is negative) - c = control[1] * float(i) + control[0] * float(1 - i); - correct(c); - t = dt * i + time[0]; - - } else { - // Just clamp - c = control[0]; - - // Only 1 time; assume 1s intervals - t = time[0] + i; - } - - } else if (i >= N) { - if (N >= 2) { - float dt = time[N - 1] - time[N - 2]; - - // Extrapolate - c = control[N - 1] * float(i - N + 2) + control[N - 2] * -float(i - N + 1); - correct(c); - t = time[N - 1] + dt * (i - N + 1); - - } else { - // Return the last, clamping - c = control.last(); - // Only 1 time; assume 1s intervals - t = time[0] + i; - } - } else { - // In bounds - c = control[i]; - t = time[i]; - } - } - -protected: - - /** Returns a series of N control points and times, fixing - boundary issues. The indices may be assumed to be treated - cyclically. */ - void getControls(int i, float* T, Control* A, int N) const { - for (int j = 0; j < N; ++j) { - getControl(i + j, T[j], A[j]); - } - ensureShortestPath(A, N); - } - - /** - Mutates the array of N control points. It is useful to override this - method by one that wraps the values if they are angles or quaternions - for which "shortest path" interpolation is significant. - */ - virtual void ensureShortestPath(Control* A, int N) const {} - - /** Normalize or otherwise adjust this interpolated Control. */ - virtual void correct(Control& A) const {} - -public: - - - /** - Return the position at time s. The spline is defined outside - of the time samples by extrapolation or cycling. - */ - Control evaluate(float s) const { - debugAssertM(control.size() == time.size(), "Corrupt spline: wrong number of control points."); - - /* - @cite http://www.gamedev.net/reference/articles/article1497.asp - Derivation of basis matrix follows. - - Given control points with positions p[i] at times t[i], 0 <= i <= 3, find the position - at time t[1] <= s <= t[2]. - - Let u = s - t[0] - Let U = [u^0 u^1 u^2 u^3] = [1 u u^2 u^3] - Let dt0 = t[0] - t[-1] - Let dt1 = t[1] - t[0] - Let dt2 = t[2] - t[1] - */ - - // Index of the first control point (i.e., the u = 0 point) - int i = 0; - // Fractional part of the time - float u = 0; - - computeIndex(s, i, u); - - Control p[4]; - float t[4]; - getControls(i - 1, t, p, 4); - float dt0 = t[1] - t[0]; - float dt1 = t[2] - t[1]; - float dt2 = t[3] - t[2]; - - static const Matrix4 basis = computeBasis(); - - // Powers of u - Vector4 uvec((float)(u*u*u), (float)(u*u), (float)u, 1.0f); - - // Compute the weights on each of the control points. - const Vector4& weights = uvec * basis; - - // Compute the weighted sum of the neighboring control points. - Control sum; - - const Control& p0 = p[0]; - const Control& p1 = p[1]; - const Control& p2 = p[2]; - const Control& p3 = p[3]; - - const Control& dp0 = p1 + (p0*-1.0f); - const Control& dp1 = p2 + (p1*-1.0f); - const Control& dp2 = p3 + (p2*-1.0f); - - // The factor of 1/2 from averaging two time intervals is - // already factored into the basis - - // tan1 = (dp0 / dt0 + dp1 / dt1) * ((dt0 + dt1) * 0.5); - // The last term normalizes for unequal time intervals - float x = (dt0 + dt1) * 0.5f; - float n0 = x / dt0; - float n1 = x / dt1; - float n2 = x / dt2; - const Control& dp1n1 = dp1 * n1; - const Control& tan1 = dp0 * n0 + dp1n1; - const Control& tan2 = dp1n1 + dp2 * n2; - - sum = - tan1 * weights[0]+ - p1 * weights[1] + - p2 * weights[2] + - tan2 * weights[3]; - - - correct(sum); - return sum; - } -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Stopwatch.h b/externals/g3dlite/G3D.lib/include/G3D/Stopwatch.h deleted file mode 100644 index aee3b0f69c9..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Stopwatch.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - @file Stopwatch.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2005-10-05 - @edited 2005-10-05 - - Copyright 2000-2003, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_STOPWATCH_H -#define G3D_STOPWATCH_H - -#include "G3D/platform.h" -#include "G3D/Queue.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -/** - Utility class for profiling duration and frame rates. - */ -class Stopwatch { -private: - /** True between tick and tock */ - bool inBetween; - - /** The initial cycle count. */ - uint64 cycleStart; - - /** The time at which tick was called. */ - RealTime timeStart; - - /** The time at which the previous tock was called, -1 if never. */ - RealTime lastTockTime; - - RealTime lastDuration; - int64 lastCycleCount; - - /** Frames per second. */ - double m_fps; - - /** Weighted fps */ - double emwaFPS; - double m_smoothFPS; - - /** Weighted duration */ - RealTime emwaDuration; - - /** The overhead for calling into the class. */ - int64 cycleOverhead; - - /** Called from the constructor. */ - void computeOverhead(); - -public: - - Stopwatch(); - - /** Returns the number of times that tick was called per wall-clock second; - e.g. frames-per-second. */ - double FPS() const { - return m_fps; - } - - /** Amount of time between the most recent tick and tock calls. 0 if tick has - never been called. */ - RealTime elapsedTime() const { - return lastDuration; - } - - /** Time-smoothed value that is stable to the nearest 1%. - This is useful if you are displaying elapsed time in real-time - and want a stable number.*/ - RealTime smoothElapsedTime() const { - return emwaDuration; - } - - /** Time-smoothed value of fps that is stable to the nearest integer for fps > 10 and - to the first decimal place for fps <= 10. - This is useful if you - are displaying the frame rate in real-time and want a stable (readable) number.*/ - double smoothFPS() const { - return m_smoothFPS; - } - - /** The elapsed cycle time between tick and tock. An attempt is made to factor out all - tick/tock overhead, so that back-to-back calls should return zero. - Unreliable on non-x86 platforms.*/ - uint64 elapsedCycles() const { - return lastCycleCount; - } - - /** Call at the beginning of the period that you want timed. */ - void tick(); - - /** Call at the end of the period that you want timed. */ - void tock(); -}; - - -} - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/System.h b/externals/g3dlite/G3D.lib/include/G3D/System.h deleted file mode 100644 index 3755dc5e36f..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/System.h +++ /dev/null @@ -1,390 +0,0 @@ -/** - @file System.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Rob Wyatt http://www.gamasutra.com/features/wyatts_world/19990709/processor_detection_01.htm - @cite Benjamin Jurke http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-ProcessorDetectionClass&forum=cotd&id=-1 - @cite Michael Herf http://www.stereopsis.com/memcpy.html - - @created 2003-01-25 - @edited 2008-10-14 - */ - -#ifndef G3D_SYSTEM_H -#define G3D_SYSTEM_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/BinaryFormat.h" -#include - -#ifdef G3D_OSX -# include -#endif - -namespace G3D { - -/** - Routine used by the demos to find the data. Searches in - ../data, ../../data, etc. up to 5 levels back. Checks - common locations like c:\libraries\g3d-\data - and some hard-coded paths on the Brown University file - system. - */ -std::string demoFindData(bool errorIfNotFound = true); - -/** G3D, SDL, and IJG libraries require license documentation - to be distributed with your program. This generates the - string that must appear in your documentation. - Your program can be commercial, closed-source under - any license you want.*/ -std::string license(); - -/** -The order in which the bytes of an integer are stored on a machine. Intel/AMD chips tend to be G3D_LITTLE_ENDIAN, Mac PPC's and Suns are G3D_BIG_ENDIAN. However, this is primarily used to specify the byte order of file formats, which are fixed. -*/ -enum G3DEndian { - G3D_BIG_ENDIAN, G3D_LITTLE_ENDIAN -}; - -/** - OS and processor abstraction. The first time any method is called the processor - will be analyzed. Future calls are then fast. - - Timing function overview: - System::getCycleCount - - actual cycle count - - System::getTick - - High-resolution time in seconds since program started - - System::getLocalTime - - High-resolution time in seconds since Jan 1, 1970 - (because it is stored in a double, this may be less - accurate than getTick) - - */ -class System { -public: - - /** Called automatically by the other System routines.*/ - static void init(); - - /** */ - static bool hasMMX(); - - /** */ - static bool hasCPUID(); - - /** */ - static bool hasSSE(); - - /** */ - static bool hasSSE2(); - - /** */ - static bool hasSSE3(); - - /** */ - static bool has3DNow(); - - - /** */ - static bool hasRDTSC(); - - static const std::string& cpuVendor(); - - /** e.g. "Windows", "GNU/Linux" */ - static const std::string& operatingSystem(); - - /** */ - static const std::string& cpuArchitecture(); - - /** - Returns the endianness of this machine. - */ - static G3DEndian machineEndian(); - - /** - Returns the current date as a string in the form YYYY-MM-DD - */ - static std::string currentDateString(); - - /** - Guarantees that the start of the array is aligned to the - specified number of bytes. - */ - static void* alignedMalloc(size_t bytes, size_t alignment); - - /** - Uses pooled storage to optimize small allocations (1 byte to 5 kilobytes). - Can be 10x to 100x faster than calling ::malloc or new. - - The result must be freed with free. - - Threadsafe on Win32. - - @sa calloc realloc OutOfMemoryCallback free - */ - static void* malloc(size_t bytes); - - static void* calloc(size_t n, size_t x); - - /** - @param size Size of memory that the system was trying to allocate - @param recoverable If true, the system will attempt to allocate again - if the callback returns true. If false, malloc is going to return - NULL and this invocation is just to notify the application. - @return Return true to force malloc to attempt allocation again if the - error was recoverable. - */ - typedef bool (*OutOfMemoryCallback)(size_t size, bool recoverable); - - /** - When System::malloc fails to allocate memory because the system is - out of memory, it invokes this handler (if it is not NULL). - The argument to the callback is the amount of memory that malloc - was trying to allocate when it ran out. If the callback returns - true, System::malloc will attempt to allocate the memory again. - If the callback returns false, then System::malloc will return NULL. - - You can use outOfMemoryCallback to free data structures or to - register the failure. - */ - static OutOfMemoryCallback outOfMemoryCallback; - - /** - Version of realloc that works with System::malloc. - */ - static void* realloc(void* block, size_t bytes); - - /** Returns a string describing how well System::malloc is using its internal pooled storage. - "heap" memory was slow to allocate; the other data sizes are comparatively fast.*/ - static std::string mallocPerformance(); - static void resetMallocPerformanceCounters(); - - /** - Returns a string describing the current usage of the buffer pools used for - optimizing System::malloc. - */ - static std::string mallocStatus(); - - /** - Free data allocated with System::malloc. - - Threadsafe on Win32. - */ - static void free(void* p); - - /** - Frees memory allocated with alignedMalloc. - */ - static void alignedFree(void* ptr); - - /** An implementation of memcpy that may be up to 2x as fast as the C library - one on some processors. Guaranteed to have the same behavior as memcpy - in all cases. */ - static void memcpy(void* dst, const void* src, size_t numBytes); - - /** An implementation of memset that may be up to 2x as fast as the C library - one on some processors. Guaranteed to have the same behavior as memset - in all cases. */ - static void memset(void* dst, uint8 value, size_t numBytes); - - /** - Returns the fully qualified filename for the currently running executable. - - This is more reliable than arg[0], which may be intentionally set - to an incorrect value by a calling program, relative to a now - non-current directory, or obfuscated by sym-links. - - @cite Linux version written by Nicolai Haehnle , http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-getexename&forum=cotd&id=-1 - */ - static std::string currentProgramFilename(); - - /** Name of this program. Note that you can mutate this string to set your app name explicitly.*/ - static std::string& appName(); - - /** G3D Version string */ - static const std::string& version(); - - /** - Either Debug or Release, depending on whether _DEBUG was defined at compile-time for the library. - */ - static const std::string& build(); - - /** - Causes the current thread to yield for the specified duration - and consume almost no CPU. - The sleep will be extremely precise; it uses System::time() - to calibrate the exact yeild time. - */ - static void sleep(RealTime t); - - /** - Clears the console. - Console programs only. - */ - static void consoleClearScreen(); - - /** - Returns true if a key is waiting. - Console programs only. - */ - static bool consoleKeyPressed(); - - /** - Blocks until a key is read (use consoleKeyPressed to determine if - a key is waiting to be read) then returns the character code for - that key. - */ - static int consoleReadKey(); - - /** - The actual time (measured in seconds since - Jan 1 1970 midnight). - - Adjusted for local timezone and daylight savings - time. This is as accurate and fast as getCycleCount(). - */ - static RealTime time(); - - /** - To count the number of cycles a given operation takes: - -
-     unsigned long count;
-     System::beginCycleCount(count);
-     ...
-     System::endCycleCount(count);
-     // count now contains the cycle count for the intervening operation.
-
-     */
-    static void beginCycleCount(uint64& cycleCount);
-    static void endCycleCount(uint64& cycleCount);
-
-    static uint64 getCycleCount();
-
-    /** Set an environment variable for the current process */
-    static void setEnv(const std::string& name, const std::string& value);
-	
-    /** Get an environment variable for the current process.  Returns NULL if the variable doesn't exist. */
-    static const char* getEnv(const std::string& name);
-
-    /**
-     Prints a human-readable description of this machine
-     to the text output stream.  Either argument may be NULL.
-     */
-    static void describeSystem(
-        class TextOutput& t);
-
-    static void describeSystem(
-        std::string&        s);
-
-    /** Returns the speed of processor 0 in MHz. 
-        Always returns 0 on linux.*/
-    static int cpuSpeedMHz();
-
-
-    /** On Win32, returns the clipboard text contents.  Does nothing on other
-       platforms (yet) */
-    static std::string getClipboardText();
-
-    /** Copies the text to the clipboard on Win32. */
-    static void setClipboardText(const std::string& s);
-
-    /**
-     Tries to locate the resource by looking in related directories.
-     If found, returns the full path to the resource, otherwise
-     returns the empty string.
-     */    
-    static std::string findDataFile(const std::string& full, bool errorIfNotFound = true);
-
-    /**
-        Sets the path that the application is using as its data directory.
-        Used by findDataDir as an initial search location.  GApp sets this
-        upon constrution.
-    */
-    static void setAppDataDir(const std::string& path);
-
-private:
-    /**
-	 (CKO) Note: Not sure why these are specifically needed
-	 for OS X. I made them private though.
-	*/
-#   ifdef G3D_OSX
-    static long m_OSXCPUSpeed; //In Cycles/Second
-    static double m_secondsPerNS;
-#   endif
-};
-
-
-#ifdef _MSC_VER
-    inline uint64 System::getCycleCount() {
-        uint32 timehi, timelo;
-
-        // Use the assembly instruction rdtsc, which gets the current
-        // cycle count (since the process started) and puts it in edx:eax.
-        __asm
-            {
-                rdtsc;
-                mov timehi, edx;
-                mov timelo, eax;
-            }
-
-        return ((uint64)timehi << 32) + (uint64)timelo;
-    }
-
-#elif defined(G3D_LINUX)
-
-    inline uint64 System::getCycleCount() {
-        uint32 timehi, timelo;
-
-        __asm__ __volatile__ (
-            "rdtsc            "
-            : "=a" (timelo),
-              "=d" (timehi)
-            : );
-
-        return ((uint64)timehi << 32) + (uint64)timelo;
-    }
-
-#elif defined(G3D_OSX)
-
-    inline uint64 System::getCycleCount() {
-		//Note:  To put off extra processing until the end, this does not 
-		//return the actual clock cycle count.  It is a bus cycle count.
-		//When endCycleCount() is called, it converts the two into a difference
-		//of clock cycles
-		
-        return (uint64) UnsignedWideToUInt64(UpTime());
-		//return (uint64) mach_absolute_time();
-    }
-
-#endif
-
-inline void System::beginCycleCount(uint64& cycleCount) {
-    cycleCount = getCycleCount();
-}
-
-
-inline void System::endCycleCount(uint64& cycleCount) {
-	#ifndef G3D_OSX
-		cycleCount = getCycleCount() - cycleCount;
-	#else
-		AbsoluteTime end = UpTime();
-		init();
-		Nanoseconds diffNS = 
-            AbsoluteDeltaToNanoseconds(end, UInt64ToUnsignedWide(cycleCount));
-		cycleCount = 
-            (uint64) ((double) (System::m_OSXCPUSpeed) * 
-                      (double) UnsignedWideToUInt64(diffNS) * m_secondsPerNS);
-	#endif
-}
-
-
-} // namespace
-
-#endif
diff --git a/externals/g3dlite/G3D.lib/include/G3D/Table.h b/externals/g3dlite/G3D.lib/include/G3D/Table.h
deleted file mode 100644
index 9ccd4f5c101..00000000000
--- a/externals/g3dlite/G3D.lib/include/G3D/Table.h
+++ /dev/null
@@ -1,770 +0,0 @@
-/**
-  @file Table.h
-
-  Templated hash table class.
-
-  @maintainer Morgan McGuire, morgan@cs.williams.edu
-  @created 2001-04-22
-  @edited  2008-07-01
-  Copyright 2000-2008, Morgan McGuire.
-  All rights reserved.
- */
-
-#ifndef G3D_TABLE_H
-#define G3D_TABLE_H
-
-#include 
-#include 
-
-#include "G3D/platform.h"
-#include "G3D/Array.h"
-#include "G3D/debug.h"
-#include "G3D/System.h"
-#include "G3D/g3dmath.h"
-#include "G3D/EqualsTrait.h"
-#include "G3D/HashTrait.h"
-
-#ifdef _MSC_VER
-#   pragma warning (push)
-    // Debug name too long warning
-#   pragma warning (disable : 4786)
-#endif
-
-namespace G3D {
-
-/**
- An unordered data structure mapping keys to values.
-
- Key must be a pointer, an int, a std::string or provide overloads for: 
-
-  
-    template<> struct HashTrait {
-        static size_t hashCode(const Key& key) { return reinterpret_cast( ... ); }
-    }; 
-  
- - and one of - -
-    template<> struct EqualsTrait{
-         static bool equals(const Key& a, const Key& b) { return ... ; }
-    };
-
-
-    bool operator==(const Key&, const Key&);
-  
- - G3D pre-defines HashTrait specializations for common types (like int and std::string). - If you use a Table with a different type you must write those functions yourself. For example, - an enum would use: - -
-    template<> struct HashTrait {
-        static size_t equals(const MyEnum& key) const { return reinterpret_cast( key ); }
-    };
-  
- - And rely on the default enum operator==. - - - Periodically check that debugGetLoad() is low (> 0.1). When it gets near - 1.0 your hash function is badly designed and maps too many inputs to - the same output. - */ -template, class EqualsFunc = EqualsTrait > -class Table { -public: - - /** - The pairs returned by iterator. - */ - class Entry { - public: - Key key; - Value value; - Entry() {} - Entry(const Key& k, const Value& v) : key(k), value(v) {} - }; - -private: - - typedef Table ThisType; - - /** - Linked list nodes used internally by HashTable. - */ - class Node { - public: - Entry entry; - size_t hashCode; - Node* next; - - /** Provide pooled allocation for speed. */ - inline void* operator new (size_t size) { - return System::malloc(size); - } - - inline void operator delete (void* p) { - System::free(p); - } - - Node(const Key& k, const Value& v, size_t h, Node* n) - : entry(k, v), hashCode(h), next(n) { - } - - /** - Clones a whole chain; - */ - Node* clone() { - return new Node(this->entry.key, this->entry.value, hashCode, (next == NULL) ? NULL : next->clone()); - } - }; - - void checkIntegrity() const { -# ifdef G3D_DEBUG - debugAssert(bucket == NULL || isValidHeapPointer(bucket)); - for (size_t b = 0; b < numBuckets; ++b) { - Node* node = bucket[b]; - debugAssert(node == NULL || isValidHeapPointer(node)); - while (node != NULL) { - debugAssert(node == NULL || isValidHeapPointer(node)); - node = node->next; - } - } -# endif - } - - /** - Number of elements in the table. - */ - size_t _size; - - /** - Array of Node*. - We don't use Array because Table is lower level. - Some elements may be NULL. - */ - Node** bucket; - - /** - Length of the bucket array. - */ - size_t numBuckets; - - /** - Re-hashes for a larger bucket size. - */ - void resize(size_t newSize) { - - // Hang onto the old bucket array - Node** oldBucket = bucket; - - // Allocate a new bucket array with the new size - bucket = (Node**)System::calloc(sizeof(Node*), newSize); - debugAssertM(bucket != NULL, "System::calloc returned NULL. Out of memory."); - // Move each node to its new hash location - for (size_t b = 0; b < numBuckets; ++b) { - Node* node = oldBucket[b]; - - // There is a linked list of nodes at this bucket - while (node != NULL) { - // Hang onto the old next pointer - Node* nextNode = node->next; - - // Insert at the head of the list for bucket[i] - size_t i = node->hashCode % newSize; - node->next = bucket[i]; - bucket[i] = node; - - // Move on to the next node - node = nextNode; - } - - // Drop the old pointer for cleanliness when debugging - oldBucket[b] = NULL; - } - - // Delete the old storage - System::free(oldBucket); - this->numBuckets = newSize; - - checkIntegrity(); - } - - - void copyFrom(const ThisType& h) { - if (&h == this) { - return; - } - - debugAssert(bucket == NULL); - _size = h._size; - numBuckets = h.numBuckets; - bucket = (Node**)System::calloc(sizeof(Node*), numBuckets); - - for (size_t b = 0; b < numBuckets; b++) { - if (h.bucket[b] != NULL) { - bucket[b] = h.bucket[b]->clone(); - } - } - - checkIntegrity(); - } - - /** - Frees the heap structures for the nodes. - */ - void freeMemory() { - checkIntegrity(); - - for (size_t b = 0; b < numBuckets; b++) { - Node* node = bucket[b]; - while (node != NULL) { - Node* next = node->next; - delete node; - node = next; - } - bucket[b] = NULL; - } - System::free(bucket); - bucket = NULL; - numBuckets = 0; - _size = 0; - } - - -public: - - /** - Creates an empty hash table. This causes some heap allocation to occur. - */ - Table() : bucket(NULL) { - numBuckets = 10; - _size = 0; - bucket = (Node**)System::calloc(sizeof(Node*), numBuckets); - checkIntegrity(); - } - - /** - Recommends that the table resize to anticipate at least this number of elements. - */ - void setSizeHint(size_t n) { - size_t s = n * 3; - if (s > numBuckets) { - resize(s); - } - } - - /** - Destroys all of the memory allocated by the table, but does not - call delete on keys or values if they are pointers. If you want to - deallocate things that the table points at, use getKeys() and Array::deleteAll() - to delete them. - */ - virtual ~Table() { - freeMemory(); - } - - Table(const ThisType& h) { - numBuckets = 0; - _size = 0; - bucket = NULL; - this->copyFrom(h); - checkIntegrity(); - } - - - Table& operator=(const ThisType& h) { - // No need to copy if the argument is this - if (this != &h) { - // Free the existing nodes - freeMemory(); - this->copyFrom(h); - checkIntegrity(); - } - return *this; - } - - /** - Returns the length of the deepest bucket. - */ - size_t debugGetDeepestBucketSize() const { - size_t deepest = 0; - - for (size_t b = 0; b < numBuckets; b++) { - size_t count = 0; - Node* node = bucket[b]; - while (node != NULL) { - node = node->next; - ++count; - } - - if (count > deepest) { - deepest = count; - } - } - - return deepest; - } - - /** - Returns the average size of non-empty buckets. - */ - float debugGetAverageBucketSize() const { - size_t num = 0; - size_t count = 0; - - for (size_t b = 0; b < numBuckets; b++) { - Node* node = bucket[b]; - if (node != NULL) { - ++num; - while (node != NULL) { - node = node->next; - ++count; - } - } - } - - return (float)((double)count / num); - } - - /** - A small load (close to zero) means the hash table is acting very - efficiently most of the time. A large load (close to 1) means - the hash table is acting poorly-- all operations will be very slow. - A large load will result from a bad hash function that maps too - many keys to the same code. - */ - double debugGetLoad() const { - return debugGetDeepestBucketSize() / (double)size(); - } - - /** - Returns the number of buckets. - */ - size_t debugGetNumBuckets() const { - return numBuckets; - } - - /** - C++ STL style iterator variable. See begin(). - */ - class Iterator { - private: - friend class Table; - - /** - Bucket index. - */ - size_t index; - - /** - Linked list node. - */ - Node* node; - ThisType* table; - size_t numBuckets; - Node** bucket; - bool isDone; - - /** - Creates the end iterator. - */ - Iterator(const ThisType* table) : table(const_cast(table)) { - isDone = true; - } - - Iterator(const ThisType* table, size_t numBuckets, Node** bucket) : - table(const_cast(table)), - numBuckets(numBuckets), - bucket(bucket) { - - if (numBuckets == 0) { - // Empty table - isDone = true; - return; - } - - index = 0; - node = bucket[index]; - isDone = false; - findNext(); - } - - /** - Finds the next element, setting isDone if one can't be found. - Looks at the current element first. - */ - void findNext() { - while (node == NULL) { - index++; - if (index >= numBuckets) { - isDone = true; - break; - } else { - node = bucket[index]; - } - } - } - - public: - inline bool operator!=(const Iterator& other) const { - return !(*this == other); - } - - bool operator==(const Iterator& other) const { - if (other.isDone || isDone) { - // Common case; check against isDone. - return (isDone == other.isDone) && (other.table == table); - } else { - return - (table == other.table) && - (node == other.node) && - (index == other.index); - } - } - - /** - Pre increment. - */ - Iterator& operator++() { - node = node->next; - findNext(); - return *this; - } - - /** - Post increment (slower than preincrement). - */ - Iterator operator++(int) { - Iterator old = *this; - ++(*this); - return old; - } - - const Entry& operator*() const { - return node->entry; - } - - Entry* operator->() const { - return &(node->entry); - } - - operator Entry*() const { - return &(node->entry); - } - - bool hasMore() const { - return ! isDone; - } - }; - - - /** - C++ STL style iterator method. Returns the first Entry, which - contains a key and value. Use preincrement (++entry) to get to - the next element. Do not modify the table while iterating. - */ - Iterator begin() const { - return Iterator(this, numBuckets, bucket); - } - - /** - C++ STL style iterator method. Returns one after the last iterator - element. - */ - const Iterator end() const { - return Iterator(this); - } - - /** - Removes all elements - */ - void clear() { - freeMemory(); - numBuckets = 10; - _size = 0; - bucket = (Node**)System::calloc(sizeof(Node*), numBuckets); - } - - - /** - Returns the number of keys. - */ - size_t size() const { - return _size; - } - - - /** - If you insert a pointer into the key or value of a table, you are - responsible for deallocating the object eventually. Inserting - key into a table is O(1), but may cause a potentially slow rehashing. - */ - void set(const Key& key, const Value& value) { - size_t code = HashFunc::hashCode(key); - size_t b = code % numBuckets; - - // Go to the bucket - Node* n = bucket[b]; - - // No bucket, so this must be the first - if (n == NULL) { - bucket[b] = new Node(key, value, code, NULL); - ++_size; - return; - } - - size_t bucketLength = 1; - - // Sometimes a bad hash code will cause all elements - // to collide. Detect this case and don't rehash when - // it occurs; nothing good will come from the rehashing. - bool allSameCode = true; - - // Try to find the node - do { - allSameCode = allSameCode && (code == n->hashCode); - - if ((code == n->hashCode) && EqualsFunc::equals(n->entry.key, key)) { - // Replace the existing node. - n->entry.value = value; - return; - } - - n = n->next; - ++bucketLength; - } while (n != NULL); - - const size_t maxBucketLength = 3; - // (Don't bother changing the size of the table if all entries - // have the same hashcode--they'll still collide) - if ((bucketLength > maxBucketLength) && - ! allSameCode && - (numBuckets < _size * 15)) { - - // This bucket was really large; rehash if all elements - // don't have the same hashcode the number of buckets is - // reasonable. - - // Back off the scale factor as the number of buckets gets - // large - float f = 3.0f; - if (numBuckets > 1000000) { - f = 1.5f; - } else if (numBuckets > 100000) { - f = 2.0f; - } - int newSize = iMax((int)(numBuckets * f) + 1, (int)(_size * f)); - resize(newSize); - } - - // Not found; insert at the head. - b = code % numBuckets; - bucket[b] = new Node(key, value, code, bucket[b]); - ++_size; - } - - /** - Removes an element from the table if it is present. - @return true if the element was found and removed, otherwise false - */ - bool remove(const Key& key) { - - size_t code = HashFunc::hashCode(key); - size_t b = code % numBuckets; - - // Go to the bucket - Node* n = bucket[b]; - - if (n == NULL) { - return false; - } - - Node* previous = NULL; - - // Try to find the node - do { - if ((code == n->hashCode) && EqualsFunc::equals(n->entry.key, key)) { - // This is the node; remove it - - // Replace the previous's next pointer - if (previous == NULL) { - bucket[b] = n->next; - } else { - previous->next = n->next; - } - - // Delete the node - delete n; - --_size; - return true; - } - - previous = n; - n = n->next; - } while (n != NULL); - - - return false; - //alwaysAssertM(false, "Tried to remove a key that was not in the table."); - } - - /** - Returns the value associated with key. - @deprecated Use get(key, val) or getPointer(key) - */ - Value& get(const Key& key) const { - - size_t code = HashFunc::hashCode(key); - size_t b = code % numBuckets; - - Node* node = bucket[b]; - - while (node != NULL) { - if ((node->hashCode == code) && EqualsFunc::equals(node->entry.key, key)) { - return node->entry.value; - } - node = node->next; - } - - debugAssertM(false, "Key not found"); - // The next line is here just to make - // a compiler warning go away. - return node->entry.value; - } - - - /** Returns a pointer to the element if it exists, or NULL if it does not. - Note that if your value type is a pointer, the return value is - a pointer to a pointer. Do not remove the element while holding this - pointer. - - It is easy to accidentally mis-use this method. Consider making - a Table and using get(key, val) instead, which makes you manage - the memory for the values yourself and is less likely to result in - pointer errors. - */ - Value* getPointer(const Key& key) const { - size_t code = HashFunc::hashCode(key); - size_t b = code % numBuckets; - - Node* node = bucket[b]; - - while (node != NULL) { - if ((node->hashCode == code) && EqualsFunc::equals(node->entry.key, key)) { - // found key - return &(node->entry.value); - } - node = node->next; - } - - // Failed to find key - return NULL; - } - - /** - If the key is present in the table, val is set to the associated value and returns true. - If the key is not present, returns false. - */ - bool get(const Key& key, Value& val) const { - Value* v = getPointer(key); - if (v != NULL) { - val = *v; - return true; - } else { - return false; - } - } - - /** - Returns true if key is in the table. - */ - bool containsKey(const Key& key) const { - size_t code = HashFunc::hashCode(key); - size_t b = code % numBuckets; - - Node* node = bucket[b]; - - while (node != NULL) { - if ((node->hashCode == code) && EqualsFunc::equals(node->entry.key, key)) { - return true; - } - node = node->next; - } while (node != NULL); - - return false; - } - - - /** - Short syntax for get. - */ - inline Value& operator[](const Key &key) const { - return get(key); - } - - - /** - Returns an array of all of the keys in the table. - You can iterate over the keys to get the values. - @deprecated - */ - Array getKeys() const { - Array keyArray; - getKeys(keyArray); - return keyArray; - } - - void getKeys(Array& keyArray) const { - keyArray.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - for (size_t i = 0; i < numBuckets; i++) { - Node* node = bucket[i]; - while (node != NULL) { - keyArray.append(node->entry.key); - node = node->next; - } - } - } - - /** - Calls delete on all of the keys and then clears the table. - */ - void deleteKeys() { - for (size_t i = 0; i < numBuckets; i++) { - Node* node = bucket[i]; - while (node != NULL) { - delete node->entry.key; - node = node->next; - } - } - clear(); - } - - /** - Calls delete on all of the values. This is unsafe-- - do not call unless you know that each value appears - at most once. - - Does not clear the table, so you are left with a table - of NULL pointers. - */ - void deleteValues() { - for (size_t i = 0; i < numBuckets; ++i) { - Node* node = bucket[i]; - while (node != NULL) { - delete node->entry.value; - node->entry.value = NULL; - node = node->next; - } - } - } -}; - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/TextInput.h b/externals/g3dlite/G3D.lib/include/G3D/TextInput.h deleted file mode 100644 index b6dcad39b8b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/TextInput.h +++ /dev/null @@ -1,693 +0,0 @@ -/** - @file TextInput.h - - Simple text lexer/tokenizer. - - @maintainer Morgan McGuire, morgan@graphics3d.com - - @cite Based on a lexer written by Aaron Orenstein. - - @created 2002-11-27 - @edited 2006-10-24 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_TEXTINPUT_H -#define G3D_TEXTINPUT_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Set.h" -#include -#include -#include -#include - -namespace G3D { - -/** - For use with TextInput. - */ -class Token { -public: - - /** - More detailed type information than Type. - */ - enum ExtendedType { - DOUBLE_QUOTED_TYPE, - SINGLE_QUOTED_TYPE, - SYMBOL_TYPE, - FLOATING_POINT_TYPE, - INTEGER_TYPE, - BOOLEAN_TYPE, - END_TYPE - }; - - /** - Strings are enclosed in quotes, symbols are not. - */ - enum Type { - STRING = DOUBLE_QUOTED_TYPE, - SYMBOL = SYMBOL_TYPE, - NUMBER = FLOATING_POINT_TYPE, - BOOLEAN = BOOLEAN_TYPE, - END = END_TYPE - }; - -private: - - friend class TextInput; - - /** - Holds the actual value, which might be any type. If a number, it will be - parsed at runtime. - */ - std::string _string; - - bool _bool; - int _line; - int _character; - Type _type; - ExtendedType _extendedType; - -public: - - Token() : - _string(""), - _bool(false), - _line(0), - _character(0), - _type(END), - _extendedType(END_TYPE) {} - - Token(Type t, ExtendedType e, const std::string& s, int L, int c) - : _string(s), _bool(false), _line(L), _character(c), _type(t), _extendedType(e) {} - - Token(Type t, ExtendedType e, const std::string& s, bool b, int L, int c) - : _string(s), _bool(b), _line(L), _character(c), _type(t), _extendedType(e) {} - - Type type() const { - return _type; - } - - ExtendedType extendedType() const { - return _extendedType; - } - - /** - The value of a single or double quote string (not including the quotes), - the name of a symbol, or the exact textual representation of a number as - parsed from the input. - */ - const std::string& string() const { - return _string; - } - - bool boolean() const { - return _bool; - } - - /** - Starting line of the input from which this token was parsed. Starts - at 1. - */ - int line() const { - return _line; - } - - /** - Starting character position in the input line from which this token was - parsed. Starts at 1. - */ - int character() const { - return _character; - } - - /** Return the numeric value for a number type, or zero if this is - not a number type. - */ - double number() const; -}; - - -/** - A simple style tokenizer for reading text files. TextInput handles a - superset of C++,Java, Matlab, and Bash code text including single - line comments, block comments, quoted strings with escape sequences, - and operators. TextInput recognizes several categories of tokens, - which are separated by white space, quotation marks, or the end of a - recognized operator: - -
    -
  • Token::SINGLE_QUOTED_TYPE string of characters surrounded by single quotes, e.g., 'x', '\0', 'foo'. -
  • Token::DOUBLE_QUOTED_TYPE string of characters surrounded by double quotes, e.g., "x", "abc\txyz", "b o b". -
  • Token::SYMBOL_TYPE legal C++ operators, keywords, and identifiers. e.g., >=, Foo, _X, class, { -
  • Token::INTEGER_TYPE numbers without decimal places or exponential notation. e.g., 10, 0x17F, 32, 0, -155 -
  • Token::FLOATING_POINT_TYPE numbers with decimal places or exponential notation. e.g., 1e3, -1.2, .4, 0.5 -
  • Token::BOOLEAN_TYPE special symbols like "true" and "false"; the exact details can be configured in TextInput::Settings -
- -

The special ".." and "..." tokens are always recognized in - addition to normal C++ operators. Additional tokens can be made - available by changing the Settings. - - Negative numbers are handled specially because of the ambiguity between unary minus and negative numbers-- - see the note on TextInput::read. - - TextInput does not have helper functions for types with non-obvious - formatting, or helpers that would be redundant. Use the serialize - methods instead for parsing specific types like int, Vector3, and - Color3. - - Inside quoted strings escape sequences are converted. Thus the - string token for ["a\nb"] is 'a', followed by a newline, followed by - 'b'. Outside of quoted strings, escape sequences are not converted, - so the token sequence for [a\nb] is symbol 'a', symbol '\', symbol - 'nb' (this matches what a C++ parser would do). The exception is - that a specified TextInput::Settings::otherCommentCharacter preceeded - by a backslash is assumed to be an escaped comment character and is - returned as a symbol token instead of being parsed as a comment - (this is what a LaTex or VRML parser would do). - - Examples - -

-  TextInput ti(TextInput::FROM_STRING, "name = \"Max\", height = 6");
-
-  Token t;
-
-  t = ti.read(); 
-  debugAssert(t.type == Token::SYMBOL);
-  debugAssert(t.sval == "name");
-
-  ti.read();
-  debugAssert(t.type == Token::SYMBOL);
-  debugAssert(t.sval == "=");
-
-  std::string name = ti.read().sval;
-  ti.read();
-  
- -
-  TextInput ti(TextInput::FROM_STRING, "name = \"Max\", height = 6");
-  ti.readSymbols("name", "=");
-  std::string name = ti.readString();
-  ti.readSymbols(",", "height", "=");
-  double height = ti. readNumber();
-  
- - Assumes that the file is not modified once opened. - */ -class TextInput { -public: - - /** Tokenizer configuration options. */ - class Settings { - public: - /** If true, slash-star marks a multi-line comment. Default - is true. */ - bool cComments; - - /** If true, // begins a single line comment. Default is true. */ - bool cppComments; - - /** If true, \r, \n, \t, \0, \\ and other escape sequences inside - strings are converted to the equivalent C++ escaped character. - If false, backslashes are treated literally. It is convenient to - set to false if reading Windows paths, for example, like - c:\foo\bar. - - Default is true. - */ - bool escapeSequencesInStrings; - - /** If non-NUL, specifies a character that begins single line - comments ('#' and '%' are popular choices). This is independent - of the cppComments flag. If the character appears in text with a - backslash in front of it, it is considered escaped and is not - treated as a comment character. - - Default is '\0'. - */ - char otherCommentCharacter; - - /** Another (optional) 1-comment character. Useful for files that - support multiple comment syntaxes. Default is '\0'. - */ - char otherCommentCharacter2; - - /** If true, "-1" parses as the number -1 instead of the - symbol "-" followed by the number 1. Default is true.*/ - bool signedNumbers; - - /** If true, strings can be marked with single quotes (e.g., - 'aaa'). If false, the quote character is parsed as a - symbol. Default is true. Backquote (`) is always parsed - as a symbol. */ - bool singleQuotedStrings; - - /** If set to a non-empty string, that string will be used in - place of the real file name (or in place of a pseudonym - constructed from the buffer if given FROM_STRING) in - tokens and exceptions. - - Default is empty. - */ - std::string sourceFileName; - - - /** Added to the line number reported by peekLineNumber and in - exceptions. Useful for concatenating files that are - parsed separately. Default is zero. */ - int startingLineNumberOffset; - - /** - Parse -1.#IND00 as the floating point number returned by - nan(), -1.#INF00 as -inf(), and 1.#INF00 as inf(). Note - that the C99 standard specifies that a variety of formats - like "NaN" and "nan" are to be used; these are easier to - parse yourself and not currently supported by readNumber. - - An alternative to specifying msvcSpecials is to read numbers as: -
-            Token x = t.read();
-            Token y = t.peek();
-            if ((x.string() == "-1.") && 
-                (y.string() == "#INF00") && 
-                (y.character() == x.character() + 3) &&
-                (y.line() == x.line()) {
-                t.read();
-                return nan();
-            }
-            // ... similar cases for inf
-          
- - If the single-comment character was #, the floating point - special format overrides the comment and will be parsed - instead. - - If signedNumbers is false msvcSpecials will not be parsed. - - Default is true. */ - bool msvcSpecials; - - /** - Parse the following set of useful proof symbols: - - => - ::> - <:: - :> - <: - |- - ::= - := - <- - - Default is false. - */ - bool proofSymbols; - - /** - When parsing booleans and msvcSpecials, is case significant? - Default is {true} - */ - bool caseSensitive; - - /** All symbols that will become the 'true' boolean token. See also caseSensitive. - Clear this value to disable parsing of true booleans. - - Default is {true}. - */ - Set trueSymbols; - - /** See trueSymbols. Default is {false}*/ - Set falseSymbols; - - Settings (); - }; - -private: - - std::deque stack; - - /** - Characters to be tokenized. - */ - Array buffer; - - /** - Offset of current character (the next character to consumed) in - input buffer. - */ - unsigned int currentCharOffset; - - /** - Line number of next character to be consumed from the input buffer. (1 - indicates first line of input.) - - Note that this is the line number of the @e next character to be - consumed from the input, not the line number of the @e last character - consumed! - */ - unsigned int lineNumber; - - /** - Character number (within the line) of the next character to be consumed - from the input buffer. (1 indicates first character of the line). - - Note that this is the character number of the @e next character to be - consumed from the input, not the character number of the @e last - character consumed! - */ - unsigned int charNumber; - - /** Configuration options. This includes the file name that will be - reported in tokens and exceptions. */ - Settings options; - - void init(); - - /** - Consumes the next character from the input buffer, and returns that - character. Updates lineNumber and charNumber to reflect the location of - the next character in the input buffer. - - Note: you shouldn't be using the return value of this function in most - cases. In general, you should peekInputChar() to get the next - character, determine what to do with it, then consume it with this - function (or with eatAndPeekInputChar()). Given that usage, in most - instances you already know what this function would return! - */ - int eatInputChar(); - - /** - Returns the next character from the input buffer, without consuming any - characters. Can also be used to look deeper into the input buffer. - Does not modify lineNumber or charNumber. - - @param distance Index of the character in the input buffer to peek at, - relative to the next character. Default is 0, for the next character in - the input buffer. - */ - int peekInputChar(unsigned int distance = 0); - - /** - Helper function to consume the next character in the input buffer and - peek at the one following (without consuming it). - */ - inline int eatAndPeekInputChar() { - eatInputChar(); - return peekInputChar(0); - } - - /** - Read the next token, returning an END token if no more input is - available. - */ - Token nextToken(); - - /** - Helper for nextToken. Appends characters to t._string until the end - delimiter is reached. - - When called, the next character in the input buffer should be first the - first character after the opening delimiter character. - */ - void parseQuotedString(unsigned char delimiter, Token& t); - -public: - - class TokenException { - public: - /** Name of file being parsed when exception occurred. */ - std::string sourceFile; - - /** Line number of start of token which caused the exception. 1 is - the first line of the file. Note that you can use - TextInput::Settings::startingLineNumberOffset to shift the effective line - number that is reported. - */ - int line; - - /** Character number in the line of start of token which caused the - exception. 1 is the character in the line. - */ - int character; - - /** Pre-formatted error message */ - std::string message; - - virtual ~TokenException() {} - - protected: - - TokenException( - const std::string& src, - int ln, - int ch); - - }; - - /** While parsing a number of the form 1.#IN?00, ? was - not 'D' or 'F'. */ - class BadMSVCSpecial : public TokenException { - public: - - BadMSVCSpecial( - const std::string& src, - int ln, - int ch); - }; - - /** Thrown by the read methods. */ - class WrongTokenType : public TokenException { - public: - Token::Type expected; - Token::Type actual; - - WrongTokenType( - const std::string& src, - int ln, - int ch, - Token::Type e, - Token::Type a); - }; - - class WrongSymbol : public TokenException { - public: - std::string expected; - std::string actual; - - WrongSymbol( - const std::string& src, - int ln, - int ch, - const std::string& e, - const std::string& a); - }; - - - /** String read from input did not match expected string. */ - class WrongString : public TokenException { - public: - std::string expected; - std::string actual; - - WrongString( - const std::string& src, - int ln, - int ch, - const std::string& e, - const std::string& a); - }; - - TextInput(const std::string& filename, const Settings& settings = Settings()); - - enum FS {FROM_STRING}; - /** Creates input directly from a string. The first argument must be - TextInput::FROM_STRING. - */ - TextInput(FS fs, const std::string& str, const Settings& settings = Settings()); - - /** Returns true while there are tokens remaining. */ - bool hasMore(); - - /** Read the next token (which will be the END token if ! hasMore()). - - Signed numbers can be handled in one of two modes. If the option - TextInput::Settings::signedNumbers is true, - A '+' or '-' immediately before a number is prepended onto that number and - if there is intervening whitespace, it is read as a separate symbol. - - If TextInput::Settings::signedNumbers is false, - read() does not distinguish between a plus or minus symbol next - to a number and a positive/negative number itself. For example, "x - 1" and "x -1" - will be parsed the same way by read(). - - In both cases, readNumber() will contract a leading "-" or "+" onto - a number. - */ - Token read(); - - - /** Read one token (or possibly two) as a number or throws - WrongTokenType, and returns the number. - - If the first token in the input is a number, it is returned directly. - - If TextInput::Settings::signedNumbers is false and the input stream - contains a '+' or '-' symbol token immediately followed by a number - token, both tokens will be consumed and a single token will be - returned by this method. - - WrongTokenType will be thrown if one of the input conditions - described above is not satisfied. When an exception is thrown, no - tokens are consumed. - */ - double readNumber(); - - bool readBoolean(); - - /** Reads a string token or throws WrongTokenType, and returns the token. - - Use this method (rather than readString) if you want the token's - location as well as its value. - - WrongTokenType will be thrown if the next token in the input stream - is not a string. When an exception is thrown, no tokens are - consumed. - */ - Token readStringToken(); - - /** Like readStringToken, but returns the token's string. - - Use this method (rather than readStringToken) if you want the token's - value but don't really care about its location in the input. Use of - readStringToken is encouraged for better error reporting. - */ - std::string readString(); - - /** Reads a specific string token or throws either WrongTokenType or - WrongString. If the next token in the input is a string matching @p - s, it will be consumed. - - Use this method if you want to match a specific string from the - input. In that case, typically error reporting related to the token - is only going to occur because of a mismatch, so no location - information is needed by the caller. - - WrongTokenType will be thrown if the next token in the input stream - is not a string. WrongString will be thrown if the next token in the - input stream is a string but does not match the @p s parameter. When - an exception is thrown, no tokens are consumed. - */ - void readString(const std::string& s); - - - /** Reads a symbol token or throws WrongTokenType, and returns the token. - - Use this method (rather than readSymbol) if you want the token's - location as well as its value. - - WrongTokenType will be thrown if the next token in the input stream - is not a symbol. When an exception is thrown, no tokens are - consumed. - */ - Token readSymbolToken(); - - /** Like readSymbolToken, but returns the token's string. - - Use this method (rather than readSymbolToken) if you want the token's - value but don't really care about its location in the input. Use of - readSymbolToken is encouraged for better error reporting. - */ - std::string readSymbol(); - - /** Reads a specific symbol token or throws either WrongTokenType or - WrongSymbol. If the next token in the input is a symbol matching @p - symbol, it will be consumed. - - Use this method if you want to match a specific symbol from the - input. In that case, typically error reporting related to the token - is only going to occur because of a mismatch, so no location - information is needed by the caller. - - WrongTokenType will be thrown if the next token in the input stream - is not a symbol. WrongSymbol will be thrown if the next token in the - input stream is a symbol but does not match the @p symbol parameter. - When an exception is thrown, no tokens are consumed. - */ - void readSymbol(const std::string& symbol); - - - /** Read a series of two specific symbols. See readSymbol. */ - inline void readSymbols(const std::string& s1, const std::string& s2) { - readSymbol(s1); - readSymbol(s2); - } - - /** Read a series of three specific symbols. See readSymbol. */ - inline void readSymbols( - const std::string& s1, - const std::string& s2, - const std::string& s3) { - readSymbol(s1); - readSymbol(s2); - readSymbol(s3); - } - - /** Read a series of four specific symbols. See readSymbol. */ - inline void readSymbols( - const std::string& s1, - const std::string& s2, - const std::string& s3, - const std::string& s4) { - readSymbol(s1); - readSymbol(s2); - readSymbol(s3); - readSymbol(s4); - } - - /** Return a copy of the next token in the input stream, but don't remove - it from the input stream. - */ - Token peek(); - - /** Returns the line number for the @e next token. See also peek. */ - int peekLineNumber(); - - /** Returns the character number (relative to the line) for the @e next - token in the input stream. See also peek. - */ - int peekCharacterNumber(); - - /** Take a previously read token and push it back at the front of the - input stream. - - Can be used in the case where more than one token of read-ahead is - needed (i.e., when peek doesn't suffice). - */ - void push(const Token& t); - - /** Returns the filename from which this input is drawn, or the first few - characters of the string if created from a string. - If options::filename is non-empty that will replace the - true filename.*/ - const std::string& filename() const; -}; - -void deserialize(bool& b, TextInput& ti); -void deserialize(int& b, TextInput& ti); -void deserialize(uint8& b, TextInput& ti); -void deserialize(double& b, TextInput& ti); -void deserialize(float& b, TextInput& ti); -void deserialize(std::string& b, TextInput& ti); - -} // namespace - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/TextOutput.h b/externals/g3dlite/G3D.lib/include/G3D/TextOutput.h deleted file mode 100644 index 6ae7d14fe00..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/TextOutput.h +++ /dev/null @@ -1,249 +0,0 @@ -/** - @file TextOutput.h - - @maintainer Morgan McGuire, morgan@graphics3d.com - @created 2004-06-21 - @edited 2006-10-24 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_TEXTOUTPUT_H -#define G3D_TEXTOUTPUT_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include - -namespace G3D { - -/** - Convenient formatting of ASCII text written to a file. -

- - The core writeString, writeNumber, and writeSymbol methods map to TextInput's - methods. Number and Symbol each print an additional space that is used to - separate adjacent tokens. - - TextOutput::printf allows arbitrary text to be conveniently dumped - en-masse. Use [de]serialize(bool, TextOutput) and other overloads to read/write - primitive types in a standardized manner and - -

- When a word-wrap line break occurs, all whitespace between words is replaced - with a single newline (the newline may be two characters-- see - G3D::TextOutput::Options::NewlineStyle). Word wrapping occurs against - the number of columns specified by Options::numColumns, minus the current - indent level. - - Indenting adds the specified number of spaces immediately after a newline. - If a newline was followed by spaces in the original string, these are added - to the indent spaces. Indenting will indent blank lines and will leave - indents after the last newline of a file (if the indent level is non-zero at the end). - -

Serialization/Marshalling -

Text serialization is accomplished using TextOutput by defining the pair of - methods: - -
-  void serialize(TextOutput& to) const;
-  void deserialize(TextInput& ti);
-  
- - See also G3D::TextInput. - -

- BETA API -

This API is subject to change in future versions. - */ -class TextOutput { -public: - - class Settings { - public: - /** - WRAP_NONE Word wrapping is disabled - WRAP_WITHOUT_BREAKING Word-wrap, but don't break continuous lines that - are longer than numColumns (default) - WRAP_ALWAYS Wrap even if it means breaking a continuous line or - a quoted string. - - Word wrapping is only allowed at whitespaces ('\n', '\r', '\t', ' '); it - will not occur after commas, punctuation, minus signs, or any other characters - */ - enum WordWrapMode {WRAP_NONE, WRAP_WITHOUT_BREAKING, WRAP_ALWAYS}; - - /** Defaults to WRAP_WITHOUT_BREAKING */ - WordWrapMode wordWrap; - - /** Is word-wrapping allowed to insert newlines inside double quotes? - Default: false */ - bool allowWordWrapInsideDoubleQuotes; - - /** Number of columns for word wrapping. Default: 8 */ - int numColumns; - - /** Number of spaces in each indent. Default: 4 */ - int spacesPerIndent; - - /** Style of newline used by word wrapping and by (optional) conversion. - default: Windows: NEWLINE_WINDOWS, Linux, OS X: NEWLINE_UNIX. - */ - enum NewlineStyle {NEWLINE_WINDOWS, NEWLINE_UNIX}; - - NewlineStyle newlineStyle; - - /** If true, all newlines are converted to NewlineStyle regardless of - how they start out. Default: true. */ - bool convertNewlines; - - /** Used by writeBoolean */ - std::string trueSymbol; - - /** Used by writeBoolean */ - std::string falseSymbol; - - Settings() : - wordWrap(WRAP_WITHOUT_BREAKING), - allowWordWrapInsideDoubleQuotes(false), - numColumns(80), - spacesPerIndent(4), - convertNewlines(true), - trueSymbol("true"), - falseSymbol("false") { - #ifdef G3D_WIN32 - newlineStyle = NEWLINE_WINDOWS; - #else - newlineStyle = NEWLINE_UNIX; - #endif - } - }; - -private: - - /** Used by indentAndAppend to tell when we are writing the - first character of a new line. - - So that push/popIndent work correctly, we cannot indent - immediately after writing a newline. Instead we must - indent on writing the first character after that - newline. - */ - bool startingNewLine; - - /** Number of characters at the end of the buffer since the last newline */ - int currentColumn; - - /** True if we have seen an open " and no close ".*/ - bool inDQuote; - - /** Empty if there is none */ - std::string filename; - - Array data; - - Settings option; - - /** Number of indents to prepend before each line. Always set using setIndentLevel.*/ - int indentLevel; - - void setIndentLevel(int i); - - /** Actual number of spaces to indent. */ - int indentSpaces; - - /** the newline character(s) */ - std::string newline; - - void setOptions(const Settings& _opt); - - /** Converts to the desired newlines. Called from vprintf */ - void convertNewlines(const std::string& in, std::string& out); - - /** Called from vprintf */ - void wordWrapIndentAppend(const std::string& str); - - /** Appends the character to data, indenting whenever a newline is encountered. - Called from wordWrapIndentAppend */ - void indentAppend(char c); - -public: - - explicit TextOutput(const std::string& filename, const Settings& options = Settings()); - - /** Constructs a text output that can later be commited to a string instead of a file.*/ - explicit TextOutput(const Settings& options = Settings()); - - /** Commit to the filename specified on the constructor. - Not called from the destructor; you must call - it yourself. - @param flush If true (default) the file is ready for reading when the method returns, otherwise - the method returns immediately and writes the file in the background.*/ - void commit(bool flush = true); - - /** Commits to this string */ - void commitString(std::string& string); - - /** Increase indent level by 1 */ - void pushIndent(); - - void popIndent(); - - /** Produces a new string that contains the output */ - std::string commitString(); - - /** Writes a quoted string. Special characters in the string (e.g., \, \t, \n) are escaped so that - TextInput will produce the identical string on reading.*/ - void writeString(const std::string& string); - - void writeBoolean(bool b); - - void writeNumber(double n); - - void writeNumber(int n); - - void writeNewline(); - void writeNewlines(int numLines); - - /** The symbol is written without quotes. Symbols are required to begin with a - letter or underscore and contain only letters, underscores, and numbers - or be a C++ symbol (e.g. "{", "(", "++", etc.) - so that they may be properly parsed by TextInput::readSymbol. Symbols are - printed with a trailing space.*/ - void writeSymbol(const std::string& string); - - /** Convenient idiom for writing multiple symbols in a row, e.g. - writeSymbols("name", "="); The empty symbols are not written. - */ - void writeSymbols( - const std::string& a, - const std::string& b = "", - const std::string& c = "", - const std::string& d = "", - const std::string& e = "", - const std::string& f = ""); - - /** Normal printf conventions. Note that the output will be reformatted - for word-wrapping and newlines */ - void __cdecl printf(const char* fmt, ...) - G3D_CHECK_PRINTF_METHOD_ARGS; - - // Can't pass by reference because that confuses va_start - void __cdecl printf(const std::string fmt, ...); - void __cdecl vprintf(const char* fmt, va_list argPtr) - G3D_CHECK_VPRINTF_METHOD_ARGS; -}; - -// Primitive serializers -void serialize(const bool& b, TextOutput& to); -void serialize(const int& b, TextOutput& to); -void serialize(const uint8& b, TextOutput& to); -void serialize(const double& b, TextOutput& to); -void serialize(const float& b, TextOutput& to); -void serialize(const std::string& b, TextOutput& to); -void serialize(const char* b, TextOutput& to); - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/ThreadSet.h b/externals/g3dlite/G3D.lib/include/G3D/ThreadSet.h deleted file mode 100644 index 59c57b062ae..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/ThreadSet.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef G3D_THREADSET_H -#define G3D_THREADSET_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/ReferenceCount.h" -#include "G3D/GThread.h" - -namespace G3D { - -/** Manages a set of threads. All methods are threadsafe except for - the iterator begin/end. - - @beta*/ -class ThreadSet : public ReferenceCountedObject { -public: - /** Intended to allow future use with a template parameter.*/ - typedef GThread Thread; - - typedef ReferenceCountedPointer ThreadRef; - typedef ReferenceCountedPointer Ref; - typedef Array::Iterator Iterator; - typedef Array::ConstIterator ConstIterator; - -private: - - /** Protects m_thread */ - GMutex m_lock; - - /** Threads in the set */ - Array m_thread; - -public: - - /** Total number of threads (some of which may be completed). */ - int size() const; - - /** Number of threads that have been started */ - int numStarted() const; - - /** Start all threads that are not currently started */ - void start() const; - - /** Terminate all threads that are currently started */ - void terminate() const; - - /** Waits until all started threads have completed. */ - void waitForCompletion() const; - - /** Remove all (not stopping them) */ - void clear(); - - /** Removes completed threads and returns the new size.*/ - int removeCompleted(); - - /** Inserts a new thread, if it is not already present, and - returns the new number of threads.*/ - int insert(const ThreadRef& t); - - /** Removes a thread. Returns true if the thread was present and - removed. */ - bool remove(const ThreadRef& t); - - bool contains(const ThreadRef& t) const; - - /** It is an error to mutate the ThreadSet while iterating through it. */ - Iterator begin(); - - Iterator end(); - - ConstIterator begin() const; - - ConstIterator end() const; -}; - - -} // namespace G3D - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Triangle.h b/externals/g3dlite/G3D.lib/include/G3D/Triangle.h deleted file mode 100644 index 8b67acf4624..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Triangle.h +++ /dev/null @@ -1,143 +0,0 @@ -/** - @file Triangle.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-04-05 - @edited 2008-10-06 - - @cite Random point method by Greg Turk, Generating random points in triangles. In A. S. Glassner, ed., Graphics Gems, pp. 24-28. Academic Press, 1990 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_TRIANGLE_H -#define G3D_TRIANGLE_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Plane.h" -#include "G3D/BoundsTrait.h" -#include "G3D/debugAssert.h" -#include - -namespace G3D { - -/** - A generic triangle representation. This should not be used - as the underlying triangle for creating models; it is intended - for providing fast property queries but requires a lot of - storage and is mostly immutable. - */ -class Triangle { -private: - friend class CollisionDetection; - friend class Ray; - - Vector3 _vertex[3]; - - /** edgeDirection[i] is the normalized vector v[i+1] - v[i] */ - Vector3 edgeDirection[3]; - float edgeMagnitude[3]; - Plane _plane; - Vector3::Axis _primaryAxis; - - /** vertex[1] - vertex[0] */ - Vector3 _edge01; - - /** vertex[2] - vertex[0] */ - Vector3 _edge02; - - float _area; - - void init(const Vector3& v0, const Vector3& v1, const Vector3& v2); - -public: - - Triangle(class BinaryInput& b); - void serialize(class BinaryOutput& b); - void deserialize(class BinaryInput& b); - - Triangle(); - - Triangle(const Vector3& v0, const Vector3& v1, const Vector3& v2); - - ~Triangle(); - - /** 0, 1, or 2 */ - inline const Vector3& vertex(int n) const { - debugAssert((n >= 0) && (n < 3)); - return _vertex[n]; - } - - /** vertex[1] - vertex[0] */ - inline const Vector3& edge01() const { - return _edge01; - } - - /** vertex[2] - vertex[0] */ - inline const Vector3& edge02() const { - return _edge02; - } - - float area() const; - - Vector3::Axis primaryAxis() const { - return _primaryAxis; - } - - const Vector3& normal() const; - - /** Barycenter */ - Vector3 center() const; - - const Plane& plane() const; - - /** Returns a random point in the triangle. */ - Vector3 randomPoint() const; - - inline void getRandomSurfacePoint(Vector3& P, - Vector3& N = Vector3::dummy) const { - P = randomPoint(); - N = normal(); - } - /** - For two triangles to be equal they must have - the same vertices in the same order. - That is, vertex[0] == vertex[0], etc. - */ - inline bool operator==(const Triangle& other) const { - for (int i = 0; i < 3; ++i) { - if (_vertex[i] != other._vertex[i]) { - return false; - } - } - - return true; - } - - inline size_t hashCode() const { - return - _vertex[0].hashCode() + - (_vertex[1].hashCode() >> 2) + - (_vertex[2].hashCode() >> 3); - } - - void getBounds(class AABox&) const; - -}; - -} // namespace G3D - -template <> struct HashTrait { - static size_t hashCode(const G3D::Triangle& key) { return key.hashCode(); } -}; - - -template<> struct BoundsTrait { - static void getBounds(const G3D::Triangle& t, G3D::AABox& out) { t.getBounds(out); } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/UprightFrame.h b/externals/g3dlite/G3D.lib/include/G3D/UprightFrame.h deleted file mode 100644 index 52db3080b80..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/UprightFrame.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - @file UprightFrame.h - - @author Morgan McGuire, morgan@cs.williams.edu - */ - -#ifndef G3D_UPRIGHTFRAME_H -#define G3D_UPRIGHTFRAME_H - -#include "G3D/platform.h" -#include "G3D/Spline.h" -#include "G3D/Vector3.h" -#include "G3D/CoordinateFrame.h" - -namespace G3D { - -/** - Coordinate frame expressed in Euler angles. - Unlike a G3D::Quat, UprightFrame always keeps the reference frame from rolling about its own z axis. - Particularly useful for cameras. - - @sa G3D::CoordinateFrame, G3D::Matrix4, G3D::PhysicsFrame, G3D::UprightSpline, G3D::UprightSplineManipulator - */ -class UprightFrame { -public: - - Vector3 translation; - - /** -pi/2 < pitch < pi/2 in radians about the X-axis */ - float pitch; - - /** In radians about the Y-axis */ - float yaw; - - inline UprightFrame(const Vector3& t = Vector3::zero(), float p = 0, float y = 0) - : translation(t), pitch(p), yaw(y) {} - - UprightFrame(const CoordinateFrame& cframe); - - CoordinateFrame toCoordinateFrame() const; - - /** Supports implicit cast to CoordinateFrame */ - inline operator CoordinateFrame() const { - return toCoordinateFrame(); - } - - /** Required for use with spline */ - UprightFrame operator+(const UprightFrame& other) const; - - /** Required for use with spline */ - UprightFrame operator*(const float k) const; - - /** - Unwraps the yaw values in the elements of the array such that - they still represent the same angles but strictly increase/decrease - without wrapping about zero. For use with Spline - */ - static void unwrapYaw(UprightFrame* a, int N); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); -}; - -/** Shortest-path linear velocity spline for camera positions. Always keeps the camera from rolling. -@sa G3D::UprightSplineManipulator, G3D::UprightFrame -*/ -class UprightSpline : public Spline { -protected: - - virtual void ensureShortestPath(UprightFrame* A, int N) const { - UprightFrame::unwrapYaw(A, N); - } - -public: - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - -}; - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector2.h b/externals/g3dlite/G3D.lib/include/G3D/Vector2.h deleted file mode 100644 index b610a1a3500..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector2.h +++ /dev/null @@ -1,457 +0,0 @@ -/** - @file Vector2.h - - 2D vector class - - @maintainer Morgan McGuire, morgan@cs.williams.edu - - @created 2001-06-02 - @edited 2008-11-30 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_VECTOR2_H -#define G3D_VECTOR2_H - -#include - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Table.h" -#include "G3D/HashTrait.h" -#include "G3D/Vector2int16.h" - -namespace G3D { - -class Vector2; -class Vector3; -class Vector4; - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Vector2 { -private: - // Hidden operators - bool operator<(const Vector2&) const; - bool operator>(const Vector2&) const; - bool operator<=(const Vector2&) const; - bool operator>=(const Vector2&) const; - -public: - float x; - float y; - - /** Creates the zero vector */ - Vector2(); - Vector2(class TextInput& t); - Vector2(class BinaryInput& b); - Vector2(float x, float y); - Vector2(float coordinate[2]); - Vector2(double coordinate[2]); - Vector2(const Vector2& other); - Vector2(const class Vector2int16& other); - - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - void serialize(class TextOutput& t) const; - void deserialize(class TextInput& t); - - float& operator[](int i); - const float& operator[](int i) const; - operator float*(); - operator const float*() const; - - // assignment and comparison - Vector2& operator=(const Vector2& other); - bool operator==(const Vector2& other) const; - bool operator!=(const Vector2& other) const; - size_t hashCode() const; - bool fuzzyEq(const Vector2& other) const; - bool fuzzyNe(const Vector2& other) const; - - /** Returns true if this vector has finite length */ - bool isFinite() const; - - /** Returns true if this vector has length == 0 */ - bool isZero() const; - - /** Returns true if this vector has length == 1 */ - bool isUnit() const; - - // arithmetic operations - Vector2 operator+(const Vector2& v) const; - Vector2 operator-(const Vector2& v) const; - Vector2 operator*(float s) const; - - /** Array (pointwise) multiplication */ - Vector2 operator*(const Vector2& v) const; - - /** Array division */ - Vector2 operator/(const Vector2& v) const; - Vector2 operator/(float s) const; - - /** Unary minus */ - Vector2 operator-() const; - - /** x + y */ - inline float sum() const { - return x + y; - } - - /** - Linear interpolation - */ - inline Vector2 lerp(const Vector2& v, float alpha) const { - return (*this) + (v - *this) * alpha; - } - - inline Vector2 clamp(const Vector2& low, const Vector2& high) const { - return Vector2( - G3D::clamp(x, low.x, high.x), - G3D::clamp(y, low.y, high.y)); - } - - inline Vector2 clamp(float low, float high) const { - return Vector2( - (float)G3D::clamp(x, low, high), - (float)G3D::clamp(y, low, high)); - } - - // arithmetic updates - Vector2& operator+=(const Vector2&); - Vector2& operator-=(const Vector2&); - Vector2& operator*=(float); - Vector2& operator/=(float); - Vector2& operator*=(const Vector2&); - Vector2& operator/=(const Vector2&); - - // vector operations - - /** */ - float length() const; - - /** Returns a unit-length vector */ - Vector2 direction() const; - - /** - Potentially less accurate but faster than direction(). - Only works if System::hasSSE is true. - */ - Vector2 fastDirection() const { - return direction(); - } - - float squaredLength() const; - float dot(const Vector2& s) const; - - /** - Make this vector have unit length and return the old length. - If the vector length was less than tolerance, do not normalize. - */ - float unitize(float fTolerance = 1e-06); - - Vector2 min(const Vector2& v) const; - Vector2 max(const Vector2& v) const; - - /** Uniformly distributed random vector on the unit sphere */ - static Vector2 random(); - - // Special values. - // Intentionally not inlined: see Matrix3::identity() for details. - static const Vector2& zero(); - inline static const Vector2& one() { static const Vector2 v(1, 1); return v; } - static const Vector2& unitX(); - static const Vector2& unitY(); - static const Vector2& inf(); - static const Vector2& nan(); - /** smallest (most negative) representable vector */ - static const Vector2& minFinite(); - /** Largest representable vector */ - static const Vector2& maxFinite(); - - std::string toString() const; - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 xy() const; - Vector2 yy() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - -}; - -inline Vector2 operator*(double s, const Vector2& v) { - return v * (float)s; -} - -inline Vector2 operator*(float s, const Vector2& v) { - return v * s; -} - -inline Vector2 operator*(int s, const Vector2& v) { - return v * (float)s; -} - - -inline Vector2::Vector2 () : x(0.0f), y(0.0f) { -} - - -inline Vector2::Vector2(float _x, float _y) : x(_x), y(_y) { -} - - -inline Vector2::Vector2 (float afCoordinate[2]) { - x = afCoordinate[0]; - y = afCoordinate[1]; -} - - - -inline Vector2::Vector2 (double afCoordinate[2]) { - x = (float)afCoordinate[0]; - y = (float)afCoordinate[1]; -} - - -inline Vector2::Vector2 (const Vector2& rkVector) { - x = rkVector.x; - y = rkVector.y; -} - - -inline Vector2::Vector2 (const Vector2int16& v) : x(v.x), y(v.y) { -} - - -inline float& Vector2::operator[] (int i) { - return ((float*)this)[i]; -} - - -inline const float& Vector2::operator[] (int i) const { - return ((float*)this)[i]; -} - - -inline Vector2::operator float* () { - return (float*)this; -} - -inline Vector2::operator const float* () const { - return (float*)this; -} - - -inline Vector2& Vector2::operator= (const Vector2& rkVector) { - x = rkVector.x; - y = rkVector.y; - return *this; -} - - -inline bool Vector2::operator== (const Vector2& rkVector) const { - return ( x == rkVector.x && y == rkVector.y); -} - - -inline bool Vector2::operator!= (const Vector2& rkVector) const { - return ( x != rkVector.x || y != rkVector.y); -} - - -inline Vector2 Vector2::operator+ (const Vector2& rkVector) const { - return Vector2(x + rkVector.x, y + rkVector.y); -} - - -inline Vector2 Vector2::operator- (const Vector2& rkVector) const { - return Vector2(x - rkVector.x, y - rkVector.y); -} - - -inline Vector2 Vector2::operator* (float fScalar) const { - return Vector2(fScalar*x, fScalar*y); -} - - - -inline Vector2 Vector2::operator- () const { - return Vector2( -x, -y); -} - - - -inline Vector2& Vector2::operator+= (const Vector2& rkVector) { - x += rkVector.x; - y += rkVector.y; - return *this; -} - - - -inline Vector2& Vector2::operator-= (const Vector2& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - return *this; -} - - - -inline Vector2& Vector2::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - return *this; -} - - - - -inline Vector2& Vector2::operator*= (const Vector2& rkVector) { - x *= rkVector.x; - y *= rkVector.y; - return *this; -} - - - -inline Vector2& Vector2::operator/= (const Vector2& rkVector) { - x /= rkVector.x; - y /= rkVector.y; - return *this; -} - - -inline Vector2 Vector2::operator* (const Vector2& rkVector) const { - return Vector2(x * rkVector.x, y * rkVector.y); -} - - - -inline Vector2 Vector2::operator/ (const Vector2& rkVector) const { - return Vector2(x / rkVector.x, y / rkVector.y); -} - - -inline float Vector2::squaredLength () const { - return x*x + y*y; -} - - -inline float Vector2::length () const { - return sqrtf(x*x + y*y); -} - - -inline Vector2 Vector2::direction () const { - float lenSquared = x * x + y * y; - - if (lenSquared != 1.0f) { - return *this / sqrtf(lenSquared); - } else { - return *this; - } -} - - - -inline float Vector2::dot (const Vector2& rkVector) const { - return x*rkVector.x + y*rkVector.y; -} - - - -inline Vector2 Vector2::min(const Vector2 &v) const { - return Vector2(G3D::min(v.x, x), G3D::min(v.y, y)); -} - - - -inline Vector2 Vector2::max(const Vector2 &v) const { - return Vector2(G3D::max(v.x, x), G3D::max(v.y, y)); -} - - - -inline bool Vector2::fuzzyEq(const Vector2& other) const { - return G3D::fuzzyEq((*this - other).squaredLength(), 0); -} - - - -inline bool Vector2::fuzzyNe(const Vector2& other) const { - return G3D::fuzzyNe((*this - other).squaredLength(), 0); -} - - - -inline bool Vector2::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y); -} - - - -inline bool Vector2::isZero() const { - return (x == 0.0f) && (y == 0.0f); -} - - - -inline bool Vector2::isUnit() const { - return squaredLength() == 1.0f; -} - -} // namespace G3D - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Vector2& key) { - return key.hashCode(); - } -}; - - -// Intentionally outside namespace to avoid operator overloading confusion -inline G3D::Vector2 operator*(double s, const G3D::Vector2& v) { - return v * (float)s; -} -inline G3D::Vector2 operator*(int s, const G3D::Vector2& v) { - return v * (float)s; -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector2int16.h b/externals/g3dlite/G3D.lib/include/G3D/Vector2int16.h deleted file mode 100644 index b7149ad6c90..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector2int16.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - @file Vector2int16.h - - @maintainer Morgan McGuire, matrix@brown.edu - - @created 2003-08-09 - @edited 2004-01-03 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef VECTOR2INT16_H -#define VECTOR2INT16_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" - -namespace G3D { - -/** - A Vector2 that packs its fields into uint16s. - */ -#ifdef G3D_WIN32 - // Switch to tight alignment - #pragma pack(push, 2) -#endif - -class Vector2int16 { -private: - // Hidden operators - bool operator<(const Vector2int16&) const; - bool operator>(const Vector2int16&) const; - bool operator<=(const Vector2int16&) const; - bool operator>=(const Vector2int16&) const; - -public: - G3D::int16 x; - G3D::int16 y; - - Vector2int16() : x(0), y(0) {} - Vector2int16(G3D::int16 _x, G3D::int16 _y) : x(_x), y(_y){} - Vector2int16(const class Vector2& v); - Vector2int16(class BinaryInput& bi); - - inline G3D::int16& operator[] (int i) { - debugAssert(((unsigned int)i) <= 1); - return ((G3D::int16*)this)[i]; - } - - inline const G3D::int16& operator[] (int i) const { - debugAssert(((unsigned int)i) <= 1); - return ((G3D::int16*)this)[i]; - } - - inline Vector2int16 operator+(const Vector2int16& other) const { - return Vector2int16(x + other.x, y + other.y); - } - - inline Vector2int16 operator-(const Vector2int16& other) const { - return Vector2int16(x - other.x, y - other.y); - } - - inline Vector2int16 operator*(const Vector2int16& other) const { - return Vector2int16(x * other.x, y * other.y); - } - - inline Vector2int16 operator*(const int s) const { - return Vector2int16(x * s, y * s); - } - - inline Vector2int16& operator+=(const Vector2int16& other) { - x += other.x; - y += other.y; - return *this; - } - - /** Shifts both x and y */ - inline Vector2int16 operator>>(const int s) const { - return Vector2int16(x >> s, y >> s); - } - - /** Shifts both x and y */ - inline Vector2int16 operator<<(const int s) const { - return Vector2int16(x << s, y << s); - } - - inline Vector2int16& operator-=(const Vector2int16& other) { - x -= other.x; - y -= other.y; - return *this; - } - - inline Vector2int16& operator*=(const Vector2int16& other) { - x *= other.x; - y *= other.y; - return *this; - } - - Vector2int16 clamp(const Vector2int16& lo, const Vector2int16& hi); - - inline bool operator== (const Vector2int16& rkVector) const { - return ((int32*)this)[0] == ((int32*)&rkVector)[0]; - } - - inline bool operator!= (const Vector2int16& rkVector) const { - return ((int32*)this)[0] != ((int32*)&rkVector)[0]; - } - - Vector2int16 max(const Vector2int16& v) const { - return Vector2int16(iMax(x, v.x), iMax(y, v.y)); - } - - Vector2int16 min(const Vector2int16& v) const { - return Vector2int16(iMin(x, v.x), iMin(y, v.y)); - } - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); -} -#if defined(G3D_LINUX) || defined(G3D_OSX) - __attribute((aligned(1))) -#endif -; - -#ifdef G3D_WIN32 - #pragma pack(pop) -#endif - -} - -template<> struct HashTrait { - static size_t hashCode(const G3D::Vector2int16& key) { return static_cast(key.x + ((int)key.y << 16)); } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector3.h b/externals/g3dlite/G3D.lib/include/G3D/Vector3.h deleted file mode 100644 index d37638a229d..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector3.h +++ /dev/null @@ -1,761 +0,0 @@ -/** - @file Vector3.h - - 3D vector class - - @maintainer Morgan McGuire, morgan@cs.williams.edu - - @created 2001-06-02 - @edited 2008-11-01 - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_VECTOR3_H -#define G3D_VECTOR3_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector2.h" -#include "G3D/Table.h" -#include "G3D/HashTrait.h" -#include "G3D/PositionTrait.h" -#include "G3D/Vector2.h" -#include -#include - -//---------------------------------------------------------------------------- -#ifdef SSE - // If you receive an error on this line, it is because you do not have the file - // xmmintrin.h needed for MMX & SSE extensions. Download and install - // - // http://download.microsoft.com/download/vstudio60ent/SP5/Wideband-Full/WIN98Me/EN-US/vs6sp5.exe - // and - // http://download.microsoft.com/download/vb60ent/Update/6/W9X2KXP/EN-US/vcpp5.exe - // - // to get this file. -# include -#endif - -namespace G3D { - -class Vector2; -class Vector3; -class Vector4; -class Vector4int8; - -/** - Swizzles - Vector classes have swizzle operators, e.g. v.xy(), that - allow selection of arbitrary sub-fields. These cannot be used as write - masks. Examples - -
-Vector3 v(1, 2, 3);
-Vector3 j;
-Vector2 b;
-
-b = v.xz();
-j = b.xx();
-
- - - Warning - - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Vector3 { -private: - /** - Reflect this vector about the (not necessarily unit) normal. - Note that if used for a collision or ray reflection you - must negate the resulting vector to get a direction pointing - away from the collision. - -
-       V'    N      V
-                 
-         r   ^   -,
-          \  |  /
-            \|/
-     
- - See also Vector3::reflectionDirection - */ - Vector3 reflectAbout(const Vector3& normal) const; - - // Hidden operators - bool operator<(const Vector3&) const; - bool operator>(const Vector3&) const; - bool operator<=(const Vector3&) const; - bool operator>=(const Vector3&) const; - -public: - // construction - Vector3(); - - /** Divides by 127 */ - Vector3(const Vector4int8&); - explicit Vector3(class BinaryInput& b); - Vector3(float _x, float _y, float _z); - explicit Vector3(const class Vector2& v, float _z); - explicit Vector3(float coordinate[3]); - explicit Vector3(double coordinate[3]); - Vector3(const Vector3& rkVector); - Vector3(const class Vector3int16& v); - explicit Vector3(class TextInput& t); - - /** Format is three float32's */ - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - /** Format is "(%f, %f, %f)" */ - void serialize(class TextOutput& t) const; - void deserialize(class TextInput& t); - - // coordinates - float x, y, z; - - // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z - // - // WARNING. These member functions rely on - // (1) Vector3 not having virtual functions - // (2) the data packed in a 3*sizeof(float) memory block - const float& operator[] (int i) const; - float& operator[] (int i); - - inline operator float* () { - return (float*)this; - } - - operator const float* () const { - return (float*)this; - } - - enum Axis {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, DETECT_AXIS=-1}; - - /** - Returns the largest dimension. Particularly convenient for determining - which plane to project a triangle onto for point-in-polygon tests. - */ - Axis primaryAxis() const; - - // assignment and comparison - Vector3& operator= (const Vector3& rkVector); - bool operator== (const Vector3& rkVector) const; - bool operator!= (const Vector3& rkVector) const; - size_t hashCode() const; - bool fuzzyEq(const Vector3& other) const; - bool fuzzyNe(const Vector3& other) const; - - /** Returns true if this vector has finite length. */ - bool isFinite() const; - - /** Returns true if this vector has length ~= 0 */ - bool isZero() const; - - /** Returns true if this vector has length ~= 1 */ - bool isUnit() const; - - // arithmetic operations - Vector3 operator+ (const Vector3& v) const; - Vector3 operator- (const Vector3& v) const; - Vector3 operator* (float s) const; - Vector3 operator/ (float s) const; - Vector3 operator* (const Vector3& v) const; - Vector3 operator/ (const Vector3& v) const; - Vector3 operator- () const; - - // arithmetic updates - Vector3& operator+= (const Vector3& v); - Vector3& operator-= (const Vector3& v); - Vector3& operator*= (float s); - Vector3& operator/= (float s); - Vector3& operator*= (const Vector3& v); - Vector3& operator/= (const Vector3& v); - - /** Same as magnitude */ - float length() const; - - float magnitude() const; - - /** - The result is a nan vector if the length is almost zero. - */ - Vector3 direction() const; - - /** - Potentially less accurate but faster than direction(). - Only works if System::hasSSE is true. - */ - Vector3 fastDirection() const; - - - /** - See also G3D::Ray::reflect. - The length is 1. -
-       V'    N       V
-                 
-         r   ^    /
-          \  |  /
-            \|'-
-     
- */ - Vector3 reflectionDirection(const Vector3& normal) const; - - - /** - Returns Vector3::zero() if the length is nearly zero, otherwise - returns a unit vector. - */ - inline Vector3 directionOrZero() const { - float mag = magnitude(); - if (G3D::fuzzyEq(mag, 0.0f)) { - return Vector3::zero(); - } else if (G3D::fuzzyEq(mag, 1.0f)) { - return *this; - } else { - return *this * (1.0f / mag); - } - } - - /** - Returns the direction of a refracted ray, - where iExit is the index of refraction for the - previous material and iEnter is the index of refraction - for the new material. Like Vector3::reflectionDirection, - the result has length 1 and is - pointed away from the intersection. - - Returns Vector3::zero() in the case of total internal refraction. - - @param iOutside The index of refraction (eta) outside - (on the positive normal side) of the surface. - - @param iInside The index of refraction (eta) inside - (on the negative normal side) of the surface. - - See also G3D::Ray::refract. -
-              N      V
-                  
-              ^    /
-              |  /
-              |'-
-          __--
-     V'<--
-     
- */ - Vector3 refractionDirection( - const Vector3& normal, - float iInside, - float iOutside) const; - - /** Synonym for direction */ - inline Vector3 unit() const { - return direction(); - } - - /** Returns a normalized vector. May be computed with lower - precision than unit */ - inline Vector3 fastUnit() const { - return fastDirection(); - } - - /** Same as squaredMagnitude */ - float squaredLength() const; - - float squaredMagnitude () const; - - float dot(const Vector3& rkVector) const; - - float unitize(float tolerance = 1e-06); - - /** Cross product. Note that two cross products in a row - can be computed more cheaply: v1 x (v2 x v3) = (v1 dot v3) v2 - (v1 dot v2) v3. - */ - Vector3 cross(const Vector3& rkVector) const; - Vector3 unitCross (const Vector3& rkVector) const; - - /** - Returns a matrix such that v.cross() * w = v.cross(w). -
-     [ 0  -v.z  v.y ]
-     [ v.z  0  -v.x ]
-     [ -v.y v.x  0  ]
-     
- */ - class Matrix3 cross() const; - - Vector3 min(const Vector3 &v) const; - Vector3 max(const Vector3 &v) const; - - /** Smallest element */ - inline float min() const { - return G3D::min(G3D::min(x, y), z); - } - - /** Largest element */ - inline float max() const { - return G3D::max(G3D::max(x, y), z); - } - - std::string toString() const; - - inline Vector3 clamp(const Vector3& low, const Vector3& high) const { - return Vector3( - G3D::clamp(x, low.x, high.x), - G3D::clamp(y, low.y, high.y), - G3D::clamp(z, low.z, high.z)); - } - - inline Vector3 clamp(float low, float high) const { - return Vector3( - G3D::clamp(x, low, high), - G3D::clamp(y, low, high), - G3D::clamp(z, low, high)); - } - - /** - Linear interpolation - */ - inline Vector3 lerp(const Vector3& v, float alpha) const { - return (*this) + (v - *this) * alpha; - } - - /** Gram-Schmidt orthonormalization. */ - static void orthonormalize (Vector3 akVector[3]); - - /** Random unit vector, uniformly distributed */ - static Vector3 random(); - - /** Random unit vector, distributed - so that the probability of V is proportional - to max(V dot Normal, 0). - - @cite Henrik Wann Jensen, Realistic Image Synthesis using Photon Mapping eqn 2.24 - */ - static Vector3 cosRandom(const Vector3& normal); - - - /** - Random vector distributed over the hemisphere about normal. - */ - static Vector3 hemiRandom(const Vector3& normal); - - // Input W must be initialize to a nonzero vector, output is {U,V,W} - // an orthonormal basis. A hint is provided about whether or not W - // is already unit length. - static void generateOrthonormalBasis (Vector3& rkU, Vector3& rkV, - Vector3& rkW, bool bUnitLengthW = true); - - inline float sum() const { - return x + y + z; - } - - inline float average() const { - return sum() / 3.0f; - } - - // Special values. - inline static const Vector3& zero() { static Vector3 v(0, 0, 0); return v; } - inline static const Vector3& one() { static Vector3 v(1, 1, 1); return v; } - inline static const Vector3& unitX() { static Vector3 v(1, 0, 0); return v; } - inline static const Vector3& unitY() { static Vector3 v(0, 1, 0); return v; } - inline static const Vector3& unitZ() { static Vector3 v(0, 0, 1); return v; } - inline static const Vector3& inf() { static Vector3 v((float)G3D::inf(), (float)G3D::inf(), (float)G3D::inf()); return v; } - inline static const Vector3& nan() { static Vector3 v((float)G3D::nan(), (float)G3D::nan(), (float)G3D::nan()); return v; } - /** Smallest (most negative) representable vector */ - inline static const Vector3& minFinite(){ static Vector3 v(-FLT_MAX, -FLT_MAX, -FLT_MAX); return v; } - /** Largest representable vector */ - inline static const Vector3& maxFinite(){ static Vector3 v(FLT_MAX, FLT_MAX, FLT_MAX); return v; } - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 zx() const; - Vector2 xy() const; - Vector2 yy() const; - Vector2 zy() const; - Vector2 xz() const; - Vector2 yz() const; - Vector2 zz() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 zxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 zyx() const; - Vector3 xzx() const; - Vector3 yzx() const; - Vector3 zzx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 zxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - Vector3 zyy() const; - Vector3 xzy() const; - Vector3 yzy() const; - Vector3 zzy() const; - Vector3 xxz() const; - Vector3 yxz() const; - Vector3 zxz() const; - Vector3 xyz() const; - Vector3 yyz() const; - Vector3 zyz() const; - Vector3 xzz() const; - Vector3 yzz() const; - Vector3 zzz() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 zxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 zyxx() const; - Vector4 xzxx() const; - Vector4 yzxx() const; - Vector4 zzxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 zxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 zyyx() const; - Vector4 xzyx() const; - Vector4 yzyx() const; - Vector4 zzyx() const; - Vector4 xxzx() const; - Vector4 yxzx() const; - Vector4 zxzx() const; - Vector4 xyzx() const; - Vector4 yyzx() const; - Vector4 zyzx() const; - Vector4 xzzx() const; - Vector4 yzzx() const; - Vector4 zzzx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 zxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 zyxy() const; - Vector4 xzxy() const; - Vector4 yzxy() const; - Vector4 zzxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 zxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - Vector4 zyyy() const; - Vector4 xzyy() const; - Vector4 yzyy() const; - Vector4 zzyy() const; - Vector4 xxzy() const; - Vector4 yxzy() const; - Vector4 zxzy() const; - Vector4 xyzy() const; - Vector4 yyzy() const; - Vector4 zyzy() const; - Vector4 xzzy() const; - Vector4 yzzy() const; - Vector4 zzzy() const; - Vector4 xxxz() const; - Vector4 yxxz() const; - Vector4 zxxz() const; - Vector4 xyxz() const; - Vector4 yyxz() const; - Vector4 zyxz() const; - Vector4 xzxz() const; - Vector4 yzxz() const; - Vector4 zzxz() const; - Vector4 xxyz() const; - Vector4 yxyz() const; - Vector4 zxyz() const; - Vector4 xyyz() const; - Vector4 yyyz() const; - Vector4 zyyz() const; - Vector4 xzyz() const; - Vector4 yzyz() const; - Vector4 zzyz() const; - Vector4 xxzz() const; - Vector4 yxzz() const; - Vector4 zxzz() const; - Vector4 xyzz() const; - Vector4 yyzz() const; - Vector4 zyzz() const; - Vector4 xzzz() const; - Vector4 yzzz() const; - Vector4 zzzz() const; - - /** A value that can be passed to ignore a parameter. Never look at the result of dummy. */ - static Vector3 dummy; -}; - -inline G3D::Vector3 operator*(float s, const G3D::Vector3& v) { - return v * s; -} - -inline G3D::Vector3 operator*(double s, const G3D::Vector3& v) { - return v * (float)s; -} - -inline G3D::Vector3 operator*(int s, const G3D::Vector3& v) { - return v * (float)s; -} - -std::ostream& operator<<(std::ostream& os, const Vector3&); - - -void serialize(const Vector3::Axis& a, class BinaryOutput& bo); -void deserialize(Vector3::Axis& a, class BinaryInput& bo); - - -//---------------------------------------------------------------------------- -inline Vector3::Vector3() : x(0.0f), y(0.0f), z(0.0f) { -} - -//---------------------------------------------------------------------------- - -inline Vector3::Vector3 (float fX, float fY, float fZ) : x(fX), y(fY), z(fZ) { -} - -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (float V[3]) : x(V[0]), y(V[1]), z(V[2]){ -} -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (double V[3]) : x((float)V[0]), y((float)V[1]), z((float)V[2]){ -} - -//---------------------------------------------------------------------------- -inline Vector3::Vector3 (const Vector3& V) : x(V.x), y(V.y), z(V.z) { -} - -//---------------------------------------------------------------------------- - -//inline Vector3::Vector3 (const __m128& m) { - // Cast from SSE packed floats -// *this = *(Vector3*)&m; -//} - -//---------------------------------------------------------------------------- -inline const float& Vector3::operator[] (int i) const { - return ((float*)this)[i]; -} - -inline float& Vector3::operator[] (int i) { - return ((float*)this)[i]; -} - - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator= (const Vector3& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::fuzzyEq(const Vector3& other) const { - return G3D::fuzzyEq((*this - other).squaredMagnitude(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::fuzzyNe(const Vector3& other) const { - return G3D::fuzzyNe((*this - other).squaredMagnitude(), 0); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::operator== (const Vector3& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::operator!= (const Vector3& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator+ (const Vector3& rkVector) const { - return Vector3(x + rkVector.x, y + rkVector.y, z + rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator- (const Vector3& rkVector) const { - return Vector3(x - rkVector.x, y - rkVector.y, z - rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator* (const Vector3& rkVector) const { - return Vector3(x * rkVector.x, y * rkVector.y, z * rkVector.z); -} - -inline Vector3 Vector3::operator*(float f) const { - return Vector3(x * f, y * f, z * f); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator/ (const Vector3& rkVector) const { - return Vector3(x / rkVector.x, y / rkVector.y, z / rkVector.z); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::operator- () const { - return Vector3(-x, -y, -z); -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator+= (const Vector3& rkVector) { - x += rkVector.x; - y += rkVector.y; - z += rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator-= (const Vector3& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - z -= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - z *= fScalar; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator*= (const Vector3& rkVector) { - x *= rkVector.x; - y *= rkVector.y; - z *= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector3& Vector3::operator/= (const Vector3& rkVector) { - x /= rkVector.x; - y /= rkVector.y; - z /= rkVector.z; - return *this; -} - -//---------------------------------------------------------------------------- -inline float Vector3::squaredMagnitude () const { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline float Vector3::squaredLength () const { - return squaredMagnitude(); -} - -//---------------------------------------------------------------------------- -inline float Vector3::magnitude() const { - return sqrtf(x*x + y*y + z*z); -} - -//---------------------------------------------------------------------------- -inline float Vector3::length() const { - return magnitude(); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::direction () const { - float lenSquared = squaredMagnitude(); - float invSqrt = 1.0f / sqrtf(lenSquared); - return Vector3(x * invSqrt, y * invSqrt, z * invSqrt); -} - -//---------------------------------------------------------------------------- - -inline Vector3 Vector3::fastDirection () const { - float lenSquared = x * x + y * y + z * z; - float invSqrt = rsq(lenSquared); - return Vector3(x * invSqrt, y * invSqrt, z * invSqrt); -} - -//---------------------------------------------------------------------------- -inline float Vector3::dot (const Vector3& rkVector) const { - return x*rkVector.x + y*rkVector.y + z*rkVector.z; -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::cross (const Vector3& rkVector) const { - return Vector3(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z, - x*rkVector.y - y*rkVector.x); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::unitCross (const Vector3& rkVector) const { - Vector3 kCross(y*rkVector.z - z*rkVector.y, z*rkVector.x - x*rkVector.z, - x*rkVector.y - y*rkVector.x); - kCross.unitize(); - return kCross; -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::min(const Vector3 &v) const { - return Vector3(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z)); -} - -//---------------------------------------------------------------------------- -inline Vector3 Vector3::max(const Vector3 &v) const { - return Vector3(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z)); -} - -//---------------------------------------------------------------------------- -inline bool Vector3::isZero() const { - return G3D::fuzzyEq(squaredMagnitude(), 0.0f); -} - -//---------------------------------------------------------------------------- - -inline bool Vector3::isUnit() const { - return G3D::fuzzyEq(squaredMagnitude(), 1.0f); -} - -} // namespace G3D - - -template <> -struct HashTrait { - static size_t hashCode(const G3D::Vector3& key) { - return key.hashCode(); - } -}; - - -template<> struct PositionTrait { - static void getPosition(const G3D::Vector2& v, G3D::Vector3& p) { p = G3D::Vector3(v, 0); } -}; - -template<> struct PositionTrait { - static void getPosition(const G3D::Vector3& v, G3D::Vector3& p) { p = v; } -}; - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector3int16.h b/externals/g3dlite/G3D.lib/include/G3D/Vector3int16.h deleted file mode 100644 index f3f30a5bab4..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector3int16.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - @file Vector3int16.h - - @maintainer Morgan McGuire, matrix@brown.edu - - @created 2003-04-07 - @edited 2003-06-24 - Copyright 2000-2004, Morgan McGuire. - All rights reserved. - */ - -#ifndef VECTOR3INT16_H -#define VECTOR3INT16_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" - -namespace G3D { - -/** - A Vector3 that packs its fields into uint16s. - */ -#ifdef G3D_WIN32 - // Switch to tight alignment - #pragma pack(push, 2) -#endif - -class Vector3int16 { -private: - // Hidden operators - bool operator<(const Vector3int16&) const; - bool operator>(const Vector3int16&) const; - bool operator<=(const Vector3int16&) const; - bool operator>=(const Vector3int16&) const; - -public: - G3D::int16 x; - G3D::int16 y; - G3D::int16 z; - - Vector3int16() : x(0), y(0), z(0) {} - Vector3int16(G3D::int16 _x, G3D::int16 _y, G3D::int16 _z) : x(_x), y(_y), z(_z) {} - Vector3int16(const class Vector3& v); - Vector3int16(class BinaryInput& bi); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - inline G3D::int16& operator[] (int i) { - debugAssert(i <= 2); - return ((G3D::int16*)this)[i]; - } - - inline const G3D::int16& operator[] (int i) const { - debugAssert(i <= 2); - return ((G3D::int16*)this)[i]; - } - - inline Vector3int16 operator+(const Vector3int16& other) const { - return Vector3int16(x + other.x, y + other.y, z + other.z); - } - - inline Vector3int16 operator-(const Vector3int16& other) const { - return Vector3int16(x - other.x, y - other.y, z - other.z); - } - - inline Vector3int16 operator*(const Vector3int16& other) const { - return Vector3int16(x * other.x, y * other.y, z * other.z); - } - - inline Vector3int16 operator*(const int s) const { - return Vector3int16(x * s, y * s, z * s); - } - - inline Vector3int16& operator+=(const Vector3int16& other) { - x += other.x; - y += other.y; - z += other.y; - return *this; - } - - inline Vector3int16& operator-=(const Vector3int16& other) { - x -= other.x; - y -= other.y; - z -= other.z; - return *this; - } - - inline Vector3int16& operator*=(const Vector3int16& other) { - x *= other.x; - y *= other.y; - z *= other.z; - return *this; - } - - inline bool operator== (const Vector3int16& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); - } - - inline bool operator!= (const Vector3int16& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); - } - - Vector3int16 max(const Vector3int16& v) const { - return Vector3int16(iMax(x, v.x), iMax(y, v.y), iMax(z, v.z)); - } - - Vector3int16 min(const Vector3int16& v) const { - return Vector3int16(iMin(x, v.x), iMin(y, v.y), iMin(z, v.z)); - } - - std::string toString() const; -} -#if defined(G3D_LINUX) || defined(G3D_OSX) - __attribute((aligned(1))) -#endif -; - -#ifdef G3D_WIN32 - #pragma pack(pop) -#endif - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Vector3int16& key) { return static_cast(key.x + ((int)key.y << 5) + ((int)key.z << 10)); } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector3int32.h b/externals/g3dlite/G3D.lib/include/G3D/Vector3int32.h deleted file mode 100644 index 01c8581b47a..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector3int32.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - @file Vector3int32.h - - @maintainer Morgan McGuire, matrix@brown.edu - - @created 2008-07-01 - @edited 2008-07-01 - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef VECTOR3INT32_H -#define VECTOR3INT32_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/HashTrait.h" - -namespace G3D { - -/** - A Vector3 that packs its fields into uint32s. - */ -#ifdef G3D_WIN32 - // Switch to tight alignment - #pragma pack(push, 4) -#endif - -class Vector3int32 { -private: - // Hidden operators - bool operator<(const Vector3int32&) const; - bool operator>(const Vector3int32&) const; - bool operator<=(const Vector3int32&) const; - bool operator>=(const Vector3int32&) const; - -public: - G3D::int32 x; - G3D::int32 y; - G3D::int32 z; - - Vector3int32() : x(0), y(0), z(0) {} - Vector3int32(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {} - Vector3int32(const class Vector3int16& v); - Vector3int32(const class Vector3& v); - Vector3int32(class BinaryInput& bi); - - void serialize(class BinaryOutput& bo) const; - void deserialize(class BinaryInput& bi); - - inline G3D::int32& operator[] (int i) { - debugAssert(i <= 2); - return ((G3D::int32*)this)[i]; - } - - inline const G3D::int32& operator[] (int i) const { - debugAssert(i <= 2); - return ((G3D::int32*)this)[i]; - } - - inline Vector3int32 operator+(const Vector3int32& other) const { - return Vector3int32(x + other.x, y + other.y, z + other.z); - } - - inline Vector3int32 operator-(const Vector3int32& other) const { - return Vector3int32(x - other.x, y - other.y, z - other.z); - } - - inline Vector3int32 operator*(const Vector3int32& other) const { - return Vector3int32(x * other.x, y * other.y, z * other.z); - } - - inline Vector3int32 operator*(const int s) const { - return Vector3int32(x * s, y * s, z * s); - } - - inline Vector3int32& operator+=(const Vector3int32& other) { - x += other.x; - y += other.y; - z += other.y; - return *this; - } - - inline Vector3int32& operator-=(const Vector3int32& other) { - x -= other.x; - y -= other.y; - z -= other.z; - return *this; - } - - inline Vector3int32& operator*=(const Vector3int32& other) { - x *= other.x; - y *= other.y; - z *= other.z; - return *this; - } - - inline bool operator== (const Vector3int32& rkVector) const { - return ( x == rkVector.x && y == rkVector.y && z == rkVector.z ); - } - - inline bool operator!= (const Vector3int32& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z ); - } - - Vector3int32 max(const Vector3int32& v) const { - return Vector3int32(iMax(x, v.x), iMax(y, v.y), iMax(z, v.z)); - } - - Vector3int32 min(const Vector3int32& v) const { - return Vector3int32(iMin(x, v.x), iMin(y, v.y), iMin(z, v.z)); - } - - std::string toString() const; -} -#if defined(G3D_LINUX) || defined(G3D_OSX) - __attribute((aligned(1))) -#endif -; - -#ifdef G3D_WIN32 - #pragma pack(pop) -#endif - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Vector3int32& key) { - // Mask for the top bit of a uint32 - const G3D::uint32 top = (1 << 31); - // Mask for the bottom 10 bits of a uint32 - const G3D::uint32 bot = 0x000003FF; - return static_cast(((key.x & top) | ((key.y & top) >> 1) | ((key.z & top) >> 2)) | - (((key.x & bot) << 19) ^ ((key.y & bot) << 10) ^ (key.z & bot))); - } -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector4.h b/externals/g3dlite/G3D.lib/include/G3D/Vector4.h deleted file mode 100644 index d60ff76ea8b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector4.h +++ /dev/null @@ -1,717 +0,0 @@ -/** - @file Vector4.h - - Homogeneous vector class. - - @maintainer Morgan McGuire, morgan@cs.williams.edu - - @created 2002-07-09 - @edited 2008-11-01 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_VECTOR4_H -#define G3D_VECTOR4_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3.h" -#include "G3D/Vector2.h" -#include "G3D/Table.h" -#include "G3D/HashTrait.h" -#include "G3D/PositionTrait.h" -#include - -namespace G3D { - -class Vector2; -class Vector3; -class Vector4; -class Vector4int8; - -/** - Do not subclass-- this implementation makes assumptions about the - memory layout. - */ -class Vector4 { -private: - // Hidden operators - bool operator<(const Vector4&) const; - bool operator>(const Vector4&) const; - bool operator<=(const Vector4&) const; - bool operator>=(const Vector4&) const; - -public: - // construction - Vector4(); - Vector4(float fX, float fY, float fZ, float fW); - Vector4(float afCoordinate[4]); - Vector4(const Vector4& rkVector); - Vector4(const class Color4& c); - Vector4(const Vector3& rkVector, float fW); - Vector4(const Vector2& v1, const Vector2& v2); - Vector4(const Vector2& v1, float fz, float fw); - - /** Divides by 127 when converting */ - Vector4(const Vector4int8&); - - Vector4(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - // coordinates - float x, y, z, w; - - // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z, etc. - // - // WARNING. These member functions rely on - // (1) Vector4 not having virtual functions - // (2) the data packed in a 4*sizeof(float) memory block - float& operator[] (int i); - const float& operator[] (int i) const; - operator float* (); - operator const float* () const; - - // assignment and comparison - Vector4& operator= (const Vector4& rkVector); - bool operator== (const Vector4& rkVector) const; - bool operator!= (const Vector4& rkVector) const; - - inline void set(float _x, float _y, float _z, float _w) { - x = _x; - y = _y; - z = _z; - w = _w; - } - - inline void set(const Vector3& v, float _w) { - x = v.x; - y = v.y; - z = v.z; - w = _w; - } - - inline void set(const Vector2& v, float _z, float _w) { - x = v.x; - y = v.y; - z = _z; - w = _w; - } - - size_t hashCode() const; - bool fuzzyEq(const Vector4& other) const; - bool fuzzyNe(const Vector4& other) const; - - inline static const Vector4& inf() { static Vector4 v((float)G3D::inf(), (float)G3D::inf(), (float)G3D::inf(), (float)G3D::inf()); return v; } - inline static const Vector4& nan() { static Vector4 v((float)G3D::nan(), (float)G3D::nan(), (float)G3D::nan(), (float)G3D::nan()); return v; } - - /** sqrt(this->dot(*this)) */ - float length() const; - float squaredLength() const; - - inline float sum() const { - return x + y + z + w; - } - - /** Returns true if this vector has finite length */ - bool isFinite() const; - - /** Returns true if this vector has length == 0 */ - bool isZero() const; - - /** Returns true if this vector has length == 1 */ - bool isUnit() const; - - // arithmetic operations - Vector4 operator+ (const Vector4& rkVector) const; - Vector4 operator- (const Vector4& rkVector) const; - - inline Vector4 operator*(const Vector4& rkVector) const { - return Vector4(x * rkVector.x, y * rkVector.y, z * rkVector.z, w * rkVector.w); - } - - inline Vector4 operator/(const Vector4& rkVector) const { - return Vector4(x / rkVector.x, y / rkVector.y, z / rkVector.z, w / rkVector.w); - } - - Vector4 operator*(const class Matrix4& M) const; - - Vector4 operator* (float fScalar) const; - Vector4 operator/ (float fScalar) const; - Vector4 operator- () const; - friend Vector4 operator* (float, const Vector4& rkVector); - - // arithmetic updates - Vector4& operator+= (const Vector4& rkVector); - Vector4& operator-= (const Vector4& rkVector); - Vector4& operator*= (float fScalar); - Vector4& operator/= (float fScalar); - - inline Vector4 clamp(const Vector4& low, const Vector4& high) const { - return Vector4( - G3D::clamp(x, low.x, high.x), - G3D::clamp(y, low.y, high.y), - G3D::clamp(z, low.z, high.z), - G3D::clamp(w, low.w, high.w)); - } - - inline Vector4 clamp(float low, float high) const { - return Vector4( - G3D::clamp(x, low, high), - G3D::clamp(y, low, high), - G3D::clamp(z, low, high), - G3D::clamp(w, low, high)); - } - - float dot (const Vector4& rkVector) const; - - Vector4 min(const Vector4& v) const; - Vector4 max(const Vector4& v) const; - - std::string toString() const; - - /** - Linear interpolation - */ - Vector4 lerp(const Vector4& v, float alpha) const; - - // 2-char swizzles - - Vector2 xx() const; - Vector2 yx() const; - Vector2 zx() const; - Vector2 wx() const; - Vector2 xy() const; - Vector2 yy() const; - Vector2 zy() const; - Vector2 wy() const; - Vector2 xz() const; - Vector2 yz() const; - Vector2 zz() const; - Vector2 wz() const; - Vector2 xw() const; - Vector2 yw() const; - Vector2 zw() const; - Vector2 ww() const; - - // 3-char swizzles - - Vector3 xxx() const; - Vector3 yxx() const; - Vector3 zxx() const; - Vector3 wxx() const; - Vector3 xyx() const; - Vector3 yyx() const; - Vector3 zyx() const; - Vector3 wyx() const; - Vector3 xzx() const; - Vector3 yzx() const; - Vector3 zzx() const; - Vector3 wzx() const; - Vector3 xwx() const; - Vector3 ywx() const; - Vector3 zwx() const; - Vector3 wwx() const; - Vector3 xxy() const; - Vector3 yxy() const; - Vector3 zxy() const; - Vector3 wxy() const; - Vector3 xyy() const; - Vector3 yyy() const; - Vector3 zyy() const; - Vector3 wyy() const; - Vector3 xzy() const; - Vector3 yzy() const; - Vector3 zzy() const; - Vector3 wzy() const; - Vector3 xwy() const; - Vector3 ywy() const; - Vector3 zwy() const; - Vector3 wwy() const; - Vector3 xxz() const; - Vector3 yxz() const; - Vector3 zxz() const; - Vector3 wxz() const; - Vector3 xyz() const; - Vector3 yyz() const; - Vector3 zyz() const; - Vector3 wyz() const; - Vector3 xzz() const; - Vector3 yzz() const; - Vector3 zzz() const; - Vector3 wzz() const; - Vector3 xwz() const; - Vector3 ywz() const; - Vector3 zwz() const; - Vector3 wwz() const; - Vector3 xxw() const; - Vector3 yxw() const; - Vector3 zxw() const; - Vector3 wxw() const; - Vector3 xyw() const; - Vector3 yyw() const; - Vector3 zyw() const; - Vector3 wyw() const; - Vector3 xzw() const; - Vector3 yzw() const; - Vector3 zzw() const; - Vector3 wzw() const; - Vector3 xww() const; - Vector3 yww() const; - Vector3 zww() const; - Vector3 www() const; - - // 4-char swizzles - - Vector4 xxxx() const; - Vector4 yxxx() const; - Vector4 zxxx() const; - Vector4 wxxx() const; - Vector4 xyxx() const; - Vector4 yyxx() const; - Vector4 zyxx() const; - Vector4 wyxx() const; - Vector4 xzxx() const; - Vector4 yzxx() const; - Vector4 zzxx() const; - Vector4 wzxx() const; - Vector4 xwxx() const; - Vector4 ywxx() const; - Vector4 zwxx() const; - Vector4 wwxx() const; - Vector4 xxyx() const; - Vector4 yxyx() const; - Vector4 zxyx() const; - Vector4 wxyx() const; - Vector4 xyyx() const; - Vector4 yyyx() const; - Vector4 zyyx() const; - Vector4 wyyx() const; - Vector4 xzyx() const; - Vector4 yzyx() const; - Vector4 zzyx() const; - Vector4 wzyx() const; - Vector4 xwyx() const; - Vector4 ywyx() const; - Vector4 zwyx() const; - Vector4 wwyx() const; - Vector4 xxzx() const; - Vector4 yxzx() const; - Vector4 zxzx() const; - Vector4 wxzx() const; - Vector4 xyzx() const; - Vector4 yyzx() const; - Vector4 zyzx() const; - Vector4 wyzx() const; - Vector4 xzzx() const; - Vector4 yzzx() const; - Vector4 zzzx() const; - Vector4 wzzx() const; - Vector4 xwzx() const; - Vector4 ywzx() const; - Vector4 zwzx() const; - Vector4 wwzx() const; - Vector4 xxwx() const; - Vector4 yxwx() const; - Vector4 zxwx() const; - Vector4 wxwx() const; - Vector4 xywx() const; - Vector4 yywx() const; - Vector4 zywx() const; - Vector4 wywx() const; - Vector4 xzwx() const; - Vector4 yzwx() const; - Vector4 zzwx() const; - Vector4 wzwx() const; - Vector4 xwwx() const; - Vector4 ywwx() const; - Vector4 zwwx() const; - Vector4 wwwx() const; - Vector4 xxxy() const; - Vector4 yxxy() const; - Vector4 zxxy() const; - Vector4 wxxy() const; - Vector4 xyxy() const; - Vector4 yyxy() const; - Vector4 zyxy() const; - Vector4 wyxy() const; - Vector4 xzxy() const; - Vector4 yzxy() const; - Vector4 zzxy() const; - Vector4 wzxy() const; - Vector4 xwxy() const; - Vector4 ywxy() const; - Vector4 zwxy() const; - Vector4 wwxy() const; - Vector4 xxyy() const; - Vector4 yxyy() const; - Vector4 zxyy() const; - Vector4 wxyy() const; - Vector4 xyyy() const; - Vector4 yyyy() const; - Vector4 zyyy() const; - Vector4 wyyy() const; - Vector4 xzyy() const; - Vector4 yzyy() const; - Vector4 zzyy() const; - Vector4 wzyy() const; - Vector4 xwyy() const; - Vector4 ywyy() const; - Vector4 zwyy() const; - Vector4 wwyy() const; - Vector4 xxzy() const; - Vector4 yxzy() const; - Vector4 zxzy() const; - Vector4 wxzy() const; - Vector4 xyzy() const; - Vector4 yyzy() const; - Vector4 zyzy() const; - Vector4 wyzy() const; - Vector4 xzzy() const; - Vector4 yzzy() const; - Vector4 zzzy() const; - Vector4 wzzy() const; - Vector4 xwzy() const; - Vector4 ywzy() const; - Vector4 zwzy() const; - Vector4 wwzy() const; - Vector4 xxwy() const; - Vector4 yxwy() const; - Vector4 zxwy() const; - Vector4 wxwy() const; - Vector4 xywy() const; - Vector4 yywy() const; - Vector4 zywy() const; - Vector4 wywy() const; - Vector4 xzwy() const; - Vector4 yzwy() const; - Vector4 zzwy() const; - Vector4 wzwy() const; - Vector4 xwwy() const; - Vector4 ywwy() const; - Vector4 zwwy() const; - Vector4 wwwy() const; - Vector4 xxxz() const; - Vector4 yxxz() const; - Vector4 zxxz() const; - Vector4 wxxz() const; - Vector4 xyxz() const; - Vector4 yyxz() const; - Vector4 zyxz() const; - Vector4 wyxz() const; - Vector4 xzxz() const; - Vector4 yzxz() const; - Vector4 zzxz() const; - Vector4 wzxz() const; - Vector4 xwxz() const; - Vector4 ywxz() const; - Vector4 zwxz() const; - Vector4 wwxz() const; - Vector4 xxyz() const; - Vector4 yxyz() const; - Vector4 zxyz() const; - Vector4 wxyz() const; - Vector4 xyyz() const; - Vector4 yyyz() const; - Vector4 zyyz() const; - Vector4 wyyz() const; - Vector4 xzyz() const; - Vector4 yzyz() const; - Vector4 zzyz() const; - Vector4 wzyz() const; - Vector4 xwyz() const; - Vector4 ywyz() const; - Vector4 zwyz() const; - Vector4 wwyz() const; - Vector4 xxzz() const; - Vector4 yxzz() const; - Vector4 zxzz() const; - Vector4 wxzz() const; - Vector4 xyzz() const; - Vector4 yyzz() const; - Vector4 zyzz() const; - Vector4 wyzz() const; - Vector4 xzzz() const; - Vector4 yzzz() const; - Vector4 zzzz() const; - Vector4 wzzz() const; - Vector4 xwzz() const; - Vector4 ywzz() const; - Vector4 zwzz() const; - Vector4 wwzz() const; - Vector4 xxwz() const; - Vector4 yxwz() const; - Vector4 zxwz() const; - Vector4 wxwz() const; - Vector4 xywz() const; - Vector4 yywz() const; - Vector4 zywz() const; - Vector4 wywz() const; - Vector4 xzwz() const; - Vector4 yzwz() const; - Vector4 zzwz() const; - Vector4 wzwz() const; - Vector4 xwwz() const; - Vector4 ywwz() const; - Vector4 zwwz() const; - Vector4 wwwz() const; - Vector4 xxxw() const; - Vector4 yxxw() const; - Vector4 zxxw() const; - Vector4 wxxw() const; - Vector4 xyxw() const; - Vector4 yyxw() const; - Vector4 zyxw() const; - Vector4 wyxw() const; - Vector4 xzxw() const; - Vector4 yzxw() const; - Vector4 zzxw() const; - Vector4 wzxw() const; - Vector4 xwxw() const; - Vector4 ywxw() const; - Vector4 zwxw() const; - Vector4 wwxw() const; - Vector4 xxyw() const; - Vector4 yxyw() const; - Vector4 zxyw() const; - Vector4 wxyw() const; - Vector4 xyyw() const; - Vector4 yyyw() const; - Vector4 zyyw() const; - Vector4 wyyw() const; - Vector4 xzyw() const; - Vector4 yzyw() const; - Vector4 zzyw() const; - Vector4 wzyw() const; - Vector4 xwyw() const; - Vector4 ywyw() const; - Vector4 zwyw() const; - Vector4 wwyw() const; - Vector4 xxzw() const; - Vector4 yxzw() const; - Vector4 zxzw() const; - Vector4 wxzw() const; - Vector4 xyzw() const; - Vector4 yyzw() const; - Vector4 zyzw() const; - Vector4 wyzw() const; - Vector4 xzzw() const; - Vector4 yzzw() const; - Vector4 zzzw() const; - Vector4 wzzw() const; - Vector4 xwzw() const; - Vector4 ywzw() const; - Vector4 zwzw() const; - Vector4 wwzw() const; - Vector4 xxww() const; - Vector4 yxww() const; - Vector4 zxww() const; - Vector4 wxww() const; - Vector4 xyww() const; - Vector4 yyww() const; - Vector4 zyww() const; - Vector4 wyww() const; - Vector4 xzww() const; - Vector4 yzww() const; - Vector4 zzww() const; - Vector4 wzww() const; - Vector4 xwww() const; - Vector4 ywww() const; - Vector4 zwww() const; - Vector4 wwww() const; - -}; - - -//---------------------------------------------------------------------------- -inline Vector4::Vector4() { - x = y = z = w = 0; -} - -//---------------------------------------------------------------------------- - -inline Vector4::Vector4 (float fX, float fY, float fZ, float fW) { - x = fX; - y = fY; - z = fZ; - w = fW; -} - -//---------------------------------------------------------------------------- -inline Vector4::Vector4 (float afCoordinate[4]) { - x = afCoordinate[0]; - y = afCoordinate[1]; - z = afCoordinate[2]; - w = afCoordinate[3]; -} - -//---------------------------------------------------------------------------- -inline Vector4::Vector4(const Vector4& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = rkVector.w; -} -//---------------------------------------------------------------------------- -inline Vector4::Vector4(const Vector3& rkVector, float fW) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = fW; -} - -//---------------------------------------------------------------------------- -inline float& Vector4::operator[] (int i) { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline const float& Vector4::operator[] (int i) const { - return ((float*)this)[i]; -} - -//---------------------------------------------------------------------------- -inline Vector4::operator float* () { - return (float*)this; -} - -inline Vector4::operator const float* () const { - return (float*)this; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator= (const Vector4& rkVector) { - x = rkVector.x; - y = rkVector.y; - z = rkVector.z; - w = rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- -inline bool Vector4::operator== (const Vector4& rkVector) const { - return ( (x == rkVector.x) && (y == rkVector.y) && (z == rkVector.z) && (w == rkVector.w)); -} - -//---------------------------------------------------------------------------- -inline bool Vector4::operator!= (const Vector4& rkVector) const { - return ( x != rkVector.x || y != rkVector.y || z != rkVector.z || w != rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator+ (const Vector4& rkVector) const { - return Vector4(x + rkVector.x, y + rkVector.y, z + rkVector.z, w + rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator- (const Vector4& rkVector) const { - return Vector4(x - rkVector.x, y - rkVector.y, z - rkVector.z, w - rkVector.w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator* (float fScalar) const { - return Vector4(fScalar*x, fScalar*y, fScalar*z, fScalar*w); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::operator- () const { - return Vector4( -x, -y, -z, -w); -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator+= (const Vector4& rkVector) { - x += rkVector.x; - y += rkVector.y; - z += rkVector.z; - w += rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator-= (const Vector4& rkVector) { - x -= rkVector.x; - y -= rkVector.y; - z -= rkVector.z; - w -= rkVector.w; - return *this; -} - -//---------------------------------------------------------------------------- - -inline Vector4 Vector4::lerp(const Vector4& v, float alpha) const { - return (*this) + (v - *this) * alpha; -} - - -//---------------------------------------------------------------------------- -inline Vector4& Vector4::operator*= (float fScalar) { - x *= fScalar; - y *= fScalar; - z *= fScalar; - w *= fScalar; - return *this; -} - - -//---------------------------------------------------------------------------- -inline float Vector4::dot(const Vector4& rkVector) const { - return x*rkVector.x + y*rkVector.y + z*rkVector.z + w*rkVector.w; -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::min(const Vector4 &v) const { - return Vector4(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z), G3D::min(v.w, w)); -} - -//---------------------------------------------------------------------------- -inline Vector4 Vector4::max(const Vector4 &v) const { - return Vector4(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z), G3D::max(v.w, w)); -} - -//---------------------------------------------------------------------------- -inline bool Vector4::isZero() const { - return (x == 0.0f) && (y == 0.0f) && (z == 0.0f) && (w == 0.0f); -} - -//---------------------------------------------------------------------------- - -inline bool Vector4::isFinite() const { - return G3D::isFinite(x) && G3D::isFinite(y) && G3D::isFinite(z) && G3D::isFinite(w); -} - -//---------------------------------------------------------------------------- - -inline bool Vector4::isUnit() const { - return squaredLength() == 1.0; -} - -//---------------------------------------------------------------------------- - -inline float Vector4::length() const { - return sqrtf(squaredLength()); -} - -//---------------------------------------------------------------------------- - -inline float Vector4::squaredLength() const { - return x * x + y * y + z * z + w * w; -} - -} - -template <> struct HashTrait { - static size_t hashCode(const G3D::Vector4& key) { return key.hashCode(); } -}; - - -template<> struct PositionTrait { - static void getPosition(const G3D::Vector4& v, G3D::Vector3& p) { p = v.xyz(); } -}; - -inline G3D::Vector4 operator* (float s, const G3D::Vector4& v) { - return v * s; -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/Vector4int8.h b/externals/g3dlite/G3D.lib/include/G3D/Vector4int8.h deleted file mode 100644 index 8476a2d008b..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/Vector4int8.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - @file Vector4int8.h - - Homogeneous vector class. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-02-09 - @edited 2007-02-09 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_VECTOR4INT8_H -#define G3D_VECTOR4INT8_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" - -namespace G3D { - -class Vector3; -class Vector4; - -/** - Homogeneous vector stored efficiently in four signed int8s. - - */ -class Vector4int8 { -private: - // Hidden operators - bool operator<(const Vector4int8&) const; - bool operator>(const Vector4int8&) const; - bool operator<=(const Vector4int8&) const; - bool operator>=(const Vector4int8&) const; - - - /** For fast operations, treat this packed data structure as - an int32 */ - inline uint32& asInt32() { - return *reinterpret_cast(this); - } - - inline const uint32& asInt32() const { - return *reinterpret_cast(this); - } - -public: - // construction - inline Vector4int8() : x(0), y(0), z(0), w(0) {} - - /** Multiplies the source by 127 and clamps to (-128, 127) when converting */ - Vector4int8(const Vector4& source); - - /** Multiplies the source by 127 and clamps to (-128, 127) when converting */ - Vector4int8(const Vector3& source, int8 w); - - inline Vector4int8(int8 x, int8 y, int8 z, int8 w) : x(x), y(y), z(z), w(w) {} - - Vector4int8(class BinaryInput& b); - void serialize(class BinaryOutput& b) const; - void deserialize(class BinaryInput& b); - - // coordinates - int8 x, y, z, w; - - inline operator int8* () { - return reinterpret_cast(this); - } - - inline operator const int8* () const { - return reinterpret_cast(this); - } - - // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z, etc. - // - // WARNING. These member functions rely on - // (1) Vector4int8 not having virtual functions - // (2) the data packed in a 4*sizeof(int8) memory block - inline int8& operator[] (int i) { - debugAssert(i >= 0 && i <= 4); - return ((int8*)this)[i]; - } - - const int8& operator[] (int i) const { - debugAssert(i >= 0 && i <= 4); - return ((const int8*)this)[i]; - } - - // assignment and comparison - Vector4int8& operator= (const Vector4int8& other) { - asInt32() = other.asInt32(); - return *this; - } - - inline bool operator== (const Vector4int8& other) const { - return asInt32() == other.asInt32(); - } - - inline bool operator!= (const Vector4int8& other) const { - return ! (*this == other); - } - - inline unsigned int hashCode() const { - return asInt32(); - } -}; - -} // namespace G3D - - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/WeakCache.h b/externals/g3dlite/G3D.lib/include/G3D/WeakCache.h deleted file mode 100644 index 87988aaf5cb..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/WeakCache.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - @file WeakCache.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2007-05-16 - @edited 2007-05-16 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_WEAKCACHE_H -#define G3D_WEAKCACHE_H - -#include "G3D/ReferenceCount.h" -#include "G3D/Table.h" - -namespace G3D { - -/** - A cache that does not prevent its members from being garbage collected. - Useful to avoid loading or computing an expression twice. Useful - for memoization and dynamic programming. - - Maintains a table of weak pointers. Weak pointers do not prevent - an object from being garbage collected. If the object is garbage - collected, the cache removes its reference. - - There are no "contains" or "iterate" methods because elements can be - flushed from the cache at any time if they are garbage collected. - - Example: -
-      WeakCache textureCache;
-
-      TextureRef loadTexture(std::string s) {
-          TextureRef t = textureCache[s];
-
-          if (t.isNull()) {
-              t = Texture::fromFile(s);
-              textureCache.set(s, t);
-          }
-
-          return t;
-      }
-      
-      
-    
- */ -template -class WeakCache { - typedef WeakReferenceCountedPointer ValueWeakRef; - -private: - - Table table; - -public: - /** - Returns NULL if the object is not in the cache - */ - ValueRef operator[](const Key& k) { - if (table.containsKey(k)) { - ValueWeakRef w = table[k]; - ValueRef s = w.createStrongPtr(); - if (s.isNull()) { - // This object has been collected; clean out its key - table.remove(k); - } - return s; - } else { - return NULL; - } - } - - void set(const Key& k, ValueRef v) { - table.set(k, v); - } - - /** Removes k from the cache or does nothing if it is not currently in the cache.*/ - void remove(const Key& k) { - if (table.containsKey(k)) { - table.remove(k); - } - } -}; - -} -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/WrapMode.h b/externals/g3dlite/G3D.lib/include/G3D/WrapMode.h deleted file mode 100644 index f97e68d6910..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/WrapMode.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - @file WrapMode.h - - @maintainer Morgan McGuire, graphics3d.com - - @created 2007-04-17 - @edited 2007-04-17 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_WRAPMODE_H -#define G3D_WRAPMODE_H - -#include "G3D/platform.h" -#include "G3D/enumclass.h" - -#ifdef IGNORE -# undef IGNORE -#endif -#ifdef ZERO -# undef ZERO -#endif -#ifdef ERROR -# undef ERROR -#endif - -namespace G3D { - -/** - Describes the behavior of G3D::Texture, G3D::Map2D, G3D::Image3, etc. when accessing an out-of-bounds - pixel. Not all classes support all modes. - - Refer to these as scoped enums, e.g., WrapMode m = WrapMode::CLAMP;. - - WrapMode::IGNORE silently discards attempts to write to out - of bounds locations and returns an undefined value for reading - from out of bounds locations. - - WrapMode::ERROR generates an error when the - pixel indices are out of bounds - - WrapMode::CLAMP makes out of bounds pixels equal to the last in-range pixel along that dimension. - - WrapMode::TILE computes out of bounds pixels modulo the dimension - - WrapMode::ZERO treats out of bounds values as the zero value, which varies in definition - according to the class used. For example, with a G3D::Texture, ZERO = Color4(0,0,0,0). - - Uses the "Intelligent Enum" design pattern - http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4001/ - */ -class WrapMode { -public: - /** Don't use this enum; use WrapMode instances instead. */ - enum Value { - CLAMP, - TILE, - ZERO, - IGNORE, - ERROR - }; - -private: - - Value value; - -public: - - G3D_DECLARE_ENUM_CLASS_METHODS(WrapMode); - -}; - -} // namespace G3D - -G3D_DECLARE_ENUM_CLASS_HASHCODE(G3D::WrapMode); - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/debug.h b/externals/g3dlite/G3D.lib/include/G3D/debug.h deleted file mode 100644 index a96babc6fa0..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/debug.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - @file debug.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-08-26 - @edited 2006-02-16 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. -*/ - -#ifndef G3D_DEBUG_H -#define G3D_DEBUG_H - -#include "G3D/platform.h" -#ifdef _MSC_VER - #include -#endif - -#include "G3D/debugPrintf.h" -#include "G3D/debugAssert.h" - -namespace G3D { - -#ifdef _MSC_VER - // Turn off 64-bit warnings -# pragma warning(push) -# pragma warning( disable : 4312) -# pragma warning( disable : 4267) -# pragma warning( disable : 4311) -#endif - - -/** - Useful for debugging purposes. - */ -inline bool isValidHeapPointer(const void* x) { - #ifdef _MSC_VER - return - (x != (void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee); - #else - return x != NULL; - #endif -} - -/** - Returns true if the pointer is likely to be - a valid pointer (instead of an arbitrary number). - Useful for debugging purposes. - */ -inline bool isValidPointer(const void* x) { - #ifdef _MSC_VER - return x != ((void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee); - #else - return x != NULL; - #endif -} - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/debugAssert.h b/externals/g3dlite/G3D.lib/include/G3D/debugAssert.h deleted file mode 100644 index f9b5bea4e9f..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/debugAssert.h +++ /dev/null @@ -1,236 +0,0 @@ -/** - @file debugAssert.h - - debugAssert(expression); - debugAssertM(expression, message); - - @cite - John Robbins, Microsoft Systems Journal Bugslayer Column, Feb 1999. - - http://msdn.microsoft.com/library/periodic/period99/feb99_BUGSLAYE_BUGSLAYE.htm - - @cite - Douglas Cox, An assert() Replacement, Code of The Day, flipcode, Sept 19, 2000 - - http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-AssertReplace&forum=cotd&id=-1 - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-08-26 - @edited 2006-01-12 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_DEBUGASSERT_H -#define G3D_DEBUGASSERT_H - -#include -#include "G3D/platform.h" - -#include - -#ifdef _MSC_VER -// conditional expression is constant -# pragma warning (disable : 4127) -#endif - -#ifdef G3D_LINUX - // Needed so we can define a global display - // pointer for debugAssert. - #include - #include - #include -#endif - -#ifdef G3D_OSX - // Need this for DebugStr() - #import -#endif - - -/** - @def debugBreak() - - Break at the current location (i.e. don't push a procedure stack frame - before breaking). - */ - -/** - @def debugAssert(exp) - Breaks if the expression is false. If G3D_DEBUG_NOGUI is defined, prompts at - the console, otherwise pops up a dialog. The user may then break (debug), - ignore, ignore always, or halt the program. - - The assertion is also posted to the clipboard under Win32. - */ - -/** - @def debugAssertM(exp, msg) - Breaks if the expression is false and displays a message. If G3D_DEBUG_NOGUI - is defined, prompts at the console, otherwise pops up a dialog. The user may - then break (debug), ignore, ignore always, or halt the program. - - The assertion is also posted to the clipboard under Win32. - */ - -namespace G3D { -typedef bool (*AssertionHook)( - const char* _expression, - const std::string& message, - const char* filename, - int lineNumber, - bool& ignoreAlways, - bool useGuiPrompt); - -/** - Allows customization of the global function invoked when a debugAssert fails. - The initial value is G3D::_internal::_handleDebugAssert_. G3D will invoke - rawBreak if the hook returns true. If NULL, assertions are not handled. -*/ -void setAssertionHook(AssertionHook hook); - -AssertionHook assertionHook(); - -/** - Called by alwaysAssertM in case of failure in release mode. If returns - true then the program exits with -1 (you can replace this with your own - version that throws an exception or has other failure modes). - */ -void setFailureHook(AssertionHook hook); -AssertionHook failureHook(); - -namespace _internal { - extern AssertionHook _debugHook; - extern AssertionHook _failureHook; -} // internal -} // G3D - -/** - @def __debugPromptShowDialog__ - @internal - */ - -#ifdef G3D_DEBUG - -# if defined(_MSC_VER) -# define rawBreak() ::DebugBreak(); -# elif defined(__i386__) - // gcc on intel -# define rawBreak() __asm__ __volatile__ ( "int $3" ); -# else - // some other gcc -# define rawBreak() ::abort() -# endif -// old mac code: -//# define rawBreak() DebugStr((const unsigned char*)("\nG3D: Invoking breakpoint in debugger.")); /* XCode must be set to break on Debugger()/DebugStr() */ - - -# define debugBreak() G3D::_internal::_releaseInputGrab_(); rawBreak(); G3D::_internal::_restoreInputGrab_(); -# define debugAssert(exp) debugAssertM(exp, "Debug assertion failure") - - #ifdef G3D_DEBUG_NOGUI - #define __debugPromptShowDialog__ false - #else - #define __debugPromptShowDialog__ true - #endif - - #define debugAssertM(exp, message) do { \ - static bool __debugAssertIgnoreAlways__ = false; \ - if (!__debugAssertIgnoreAlways__ && !(exp)) { \ - G3D::_internal::_releaseInputGrab_(); \ - if ((G3D::_internal::_debugHook != NULL) && \ - G3D::_internal::_debugHook((const char*)(#exp), message, __FILE__, __LINE__, __debugAssertIgnoreAlways__, __debugPromptShowDialog__)) { \ - rawBreak(); \ - } \ - G3D::_internal::_restoreInputGrab_(); \ - } \ - } while (0) - - #define alwaysAssertM debugAssertM - -#else // Release - #ifdef G3D_DEBUG_NOGUI - #define __debugPromptShowDialog__ false - #else - #define __debugPromptShowDialog__ true - #endif - - // In the release build, just define away assertions. - #define rawBreak() do {} while (0) - #define debugAssert(exp) do {} while (0) - #define debugAssertM(exp, message) do {} while (0) - #define debugBreak() do {} while (0) - - // But keep the 'always' assertions - #define alwaysAssertM(exp, message) { \ - static bool __alwaysAssertIgnoreAlways__ = false; \ - if (!__alwaysAssertIgnoreAlways__ && !(exp)) { \ - G3D::_internal::_releaseInputGrab_(); \ - if ((G3D::_internal::_failureHook != NULL) && \ - G3D::_internal::_failureHook(#exp, message, __FILE__, __LINE__, __alwaysAssertIgnoreAlways__, __debugPromptShowDialog__)) { \ - ::exit(-1); \ - } \ - G3D::_internal::_restoreInputGrab_(); \ - } \ - } - -#endif // if debug - - - -namespace G3D { namespace _internal { - -#ifdef G3D_LINUX - /** - A pointer to the X11 display. Initially NULL. If set to a - non-null value (e.g. by SDLWindow), debugAssert attempts to use - this display to release the mouse/input grab when an assertion - fails. - */ - extern Display* x11Display; - - /** - A pointer to the X11 window. Initially NULL. If set to a - non-null value (e.g. by SDLWindow), debugAssert attempts to use - this window to release the mouse/input grab when an assertion - fails. - */ - extern Window x11Window; -#endif - -/** - Pops up an assertion dialog or prints an assertion - - ignoreAlways - return result of pressing the ignore button. - useGuiPrompt - if true, shows a dialog - */ -bool _handleDebugAssert_( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - bool& ignoreAlways, - bool useGuiPrompt); - -bool _handleErrorCheck_( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - bool& ignoreAlways, - bool useGuiPrompt); - -/** Attempts to give the user back their mouse and keyboard if they - were locked to the current window. - @internal*/ -void _releaseInputGrab_(); - -/** Attempts to restore the state before _releaseInputGrab_. - @internal*/ -void _restoreInputGrab_(); - -}; }; // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/debugPrintf.h b/externals/g3dlite/G3D.lib/include/G3D/debugPrintf.h deleted file mode 100644 index bc3315c8a6d..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/debugPrintf.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - @file debugPrintf.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-08-26 - @edited 2007-07-20 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_DEBUGPRINTF_H -#define G3D_DEBUGPRINTF_H - -#include "G3D/platform.h" -#include -#include -#include "G3D/format.h" -#include - -namespace G3D { - -typedef void (*ConsolePrintHook)(const std::string&); - -namespace _internal { - extern ConsolePrintHook _consolePrintHook; -} - -/** Called by consolePrintf after the log and terminal have been written to. - Used by GConsole to intercept printing routines.*/ -void setConsolePrintHook(ConsolePrintHook h); - -ConsolePrintHook consolePrintHook(); - -/** - Sends output to the log and to the last GConsole instantiated. - - Guarantees that the output has been flushed by the time the routine - returns. - @sa G3D::logPrintf, G3D::screenPrintf - @return The string that was printed - */ -std::string __cdecl consolePrintf(const char* fmt ...) G3D_CHECK_PRINTF_ARGS; -std::string consolePrint(const std::string&); - -/** - Under visual studio, appears in the VS debug pane. - On unix-based operating systems the output is sent to stderr. - - Also sends output to the console (G3D::consolePrintf) if there is a consolePrintHook, - and log (G3D::logPrintf), and flushes before returning. - - @return The string that was printed -*/ -std::string __cdecl debugPrintf(const char* fmt ...) G3D_CHECK_PRINTF_ARGS; -std::string debugPrint(const std::string&); - -} // namespace G3D - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/enumclass.h b/externals/g3dlite/G3D.lib/include/G3D/enumclass.h deleted file mode 100644 index 7e7bc3f6ac3..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/enumclass.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - @file G3D/enumclass.h - - @maintainer Morgan McGuire, morgan@graphics3d.com - @created 2007-01-27 - @edited 2007-07-20 -*/ -#ifndef G3D_ENUMCLASS_H -#define G3D_ENUMCLASS_H - -#include "G3D/Table.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -/** - Creates a series of methods that turn a class into a scoped enumeration. - Uses the "Intelligent Enum" design pattern - http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4001/ - - Enum classes are initialized to their zero value by default. - - See GLG3D/GKey.h for an example. - */ -#define G3D_DECLARE_ENUM_CLASS_METHODS(Classname)\ - inline Classname(char v) : value((Value)v) {}\ -\ - inline Classname() : value((Value)0) {}\ -\ - inline Classname(const Value v) : value(v) {}\ -\ - explicit inline Classname(int v) : value((Value)v) {}\ -\ - /** Support cast back to the Value type, which is needed to allow implicit assignment inside unions. */\ - /*inline operator Value() const { - return value; - }*/\ -\ - inline operator int() const {\ - return (int)value;\ - }\ -\ - inline bool operator== (const Classname other) const {\ - return value == other.value;\ - }\ -\ - inline bool operator== (const Classname::Value other) const {\ - return value == other;\ - }\ -\ - inline bool operator!= (const Classname other) const {\ - return value != other.value;\ - }\ -\ - inline bool operator!= (const Classname::Value other) const {\ - return value != other;\ - }\ -\ - inline bool operator< (const Classname other) const {\ - return value < other.value;\ - }\ -\ - inline bool operator> (const Classname other) const {\ - return value > other.value;\ - }\ -\ - inline bool operator>= (const Classname other) const {\ - return value >= other.value;\ - }\ -\ - inline bool operator<= (const Classname other) const {\ - return value <= other.value;\ - }\ -\ - inline bool operator< (const Value other) const {\ - return value < other;\ - }\ -\ - inline bool operator> (const Value other) const {\ - return value > other;\ - }\ -\ - inline bool operator<= (const Value other) const {\ - return value <= other;\ - }\ -\ - inline bool operator>= (const Value other) const {\ - return value >= other;\ - }\ -\ - inline Classname& operator-- () {\ - value = (Value)((int)value - 1);\ - return *this;\ - }\ -\ - inline Classname& operator++ () {\ - value = (Value)((int)value + 1);\ - return *this;\ - }\ -\ - inline Classname& operator+= (const int x) {\ - value = (Value)((int)value + x);\ - return *this;\ - }\ -\ - inline Classname& operator-= (const int x) {\ - value = (Value)((int)value - x);\ - return *this;\ - }\ -\ - inline Classname operator+ (const int x) const {\ - return Classname((int)value + x);\ - }\ -\ - inline Classname operator- (const int x) const {\ - return Classname((int)value - x);\ - }\ -\ - inline unsigned int hashCode() const {\ - return (unsigned int)value;\ - }\ -\ - void serialize(BinaryOutput& b) const {\ - b.writeInt32(value);\ - }\ -\ - void deserialize(BinaryInput& b) {\ - value = (Value)b.readInt32();\ - } - -#define G3D_DECLARE_ENUM_CLASS_HASHCODE(Classname)\ -template <> struct HashTrait \ -{ \ - static size_t hashCode(Classname::Value key) { return static_cast(key); } \ -}; \ - \ -template <> struct HashTrait \ -{ \ - static size_t hashCode(Classname key) { return static_cast(key.hashCode()); } \ -}; - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/fileutils.h b/externals/g3dlite/G3D.lib/include/G3D/fileutils.h deleted file mode 100644 index ead20720870..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/fileutils.h +++ /dev/null @@ -1,246 +0,0 @@ -/** - @file fileutils.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @author 2002-06-06 - @edited 2007-01-18 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_FILEUTILS_H -#define G3D_FILEUTILS_H - -#include "G3D/platform.h" -#include -#include -#include "G3D/Array.h" -#include "G3D/Set.h" -#include "G3D/g3dmath.h" - -#ifdef G3D_WIN32 -// For chdir, mkdir, etc. -# include -#endif - -namespace G3D { - - namespace _internal { - extern Set currentFilesUsed; - } - -/** Returns all the files used by G3D and GLG3D during the current execution. */ -Array filesUsed(); - -std::string readWholeFile( - const std::string& filename); - - -/** Reads from a zip file and decompresses the desired contents - into memory. Does not support recursive zip calls (i.e. a .zip - stored within another .zip) - - @param file the path, of the format C:\...\something.zip\...\desiredfile.ext - @param data a pointer to the memory where the file will be stored - @param length the size of the file decompressed to memory */ -void zipRead(const std::string& file, - void*& data, - size_t& length); - - -/** Closes the contents of a zip file that had been decompressed to - memory. Must be called in tandem with zipRead() to avoid memory - leaks. - - @param data the pointer to the decompressed file in memory */ -void zipClose(void* data); - - -/** - @param flush If true (default), the file is ready for reading as soon - as the function returns. If false, the function returns immediately and - writes the file in the background. - */ -void writeWholeFile( - const std::string& filename, - const std::string& str, - bool flush = true); - -/** - Creates the directory (which may optionally end in a /) - and any parents needed to reach it. - */ -void createDirectory( - const std::string& dir); - -/** - Fully qualifies a filename. The filename may contain wildcards, - in which case the wildcards will be preserved in the returned value. - */ -std::string resolveFilename(const std::string& filename); - -/** - Appends all files matching filespec to the files array. The names - will not contain paths unless includePath == true. These may be - relative to the current directory unless the filespec is fully qualified - (can be done with resolveFilename). - Wildcards can only appear to the right of the last slash in filespec. - Works with .zip files used as paths, if filespec is passed in the form - C:\...\something.zip\* Does not work recursively with zipfiles (a - .zip within a .zip will not work) - */ -void getFiles( - const std::string& filespec, - Array& files, - bool includePath = false); - -/** - Appends all directories matching filespec to the files array. The names - will not contain paths unless includePath == true. These may be - relative to the current directory unless the filespec is fully qualified - (can be done with resolveFilename). - Does not append special directories "." or "..". - Works with .zip files used as paths, if filespec is passed in the form - C:\...\something.zip\* Does not work recursively with zipfiles (a - .zip within a .zip will not work) - */ -void getDirs( - const std::string& filespec, - Array& files, - bool includePath = false); - - -/** Returns true if the specified path exists and is a directory */ -bool isDirectory(const std::string& filespec); - - -/** Returns true if the specified filename exists and is a zipfile */ -bool isZipfile(const std::string& filename); - - -/** Returns the length of the file. If - filename specifies a path that contains a zipfile, but the - contents within are specified correctly, returns the - uncompressed size of the requested file. Returns -1 if - the file does not exist. - - @param filename the path to test, may contain .zip -*/ -int64 fileLength(const std::string& filename); - -/** - Copies the file - */ -void copyFile( - const std::string& source, - const std::string& dest); - -/** Returns a temporary file that is open for read/write access. This - tries harder than the ANSI tmpfile, so it may succeed when that fails. */ -FILE* createTempFile(); - -/** - Returns true if the given file (or directory) exists. - - @param filename the path to test. must not end in a trailing slash. - @param lookInZipfiles if the path does not exist, calls zipfileExists() - */ -bool fileExists( - const std::string& filename, - const bool lookInZipfiles = true); - -/** - Returns true if the given file (or directory) exists - within a zipfile. Called if fileExists initially - returns false and the lookInZipfiles flag has been set. - Must not end in a trailing slash. Does not work for recursive - zipfiles (.zips within another .zip) - - @param filename the path to test - @param outZipfile the path to the .zip file - @param outInternalFile the path (within the .zip) where the desired file is located, if valid - - */ -bool zipfileExists( - const std::string& filename, - std::string& outZipfile, - std::string& outInternalFile - ); - -bool zipfileExists(const std::string& filename); - -/** - Parses a filename into four useful pieces. - - Examples: - - c:\a\b\d.e - root = "c:\" - path = "a" "b" - base = "d" - ext = "e" - - /a/b/d.e - root = "/" - path = "a" "b" - base = "d" - ext = "e" - - /a/b - root = "/" - path = "a" - base = "b" - ext = "e" - - */ -void parseFilename( - const std::string& filename, - std::string& drive, - Array& path, - std::string& base, - std::string& ext); - - -/** - Returns the part of the filename that includes the base and ext from - parseFilename (i.e. everything to the right of the path). - */ -std::string filenameBaseExt(const std::string& filename); - -/** - Returns the extension on a filename. - */ -std::string filenameExt(const std::string& filename); - - -/** Returns the portion of a filename to the left of the last period - and to the right of the last slash or colon. - */ -std::string filenameBase(const std::string& filename); - -/** Creates a unique filename base in the current directory using the - specified prefix.*/ -std::string generateFilenameBase(const std::string& prefix = ""); - -/** - Returns the drive (if Win32) and path from a filename, including - a slash if there was one. - filenamePath(f) + filenameBaseExt(f) == f - */ -std::string filenamePath(const std::string& filename); - -/** Returns true if '*' or '?' appears in the string */ -bool filenameContainsWildcards(const std::string& filename); - -/** Returns true if dst does not exist or src is newer than dst. Works on both files and directories. */ -bool fileIsNewer(const std::string& src, const std::string& dst); - -/** Appends file onto dirname, ensuring a / if needed. */ -std::string pathConcat(const std::string& dirname, const std::string& file); - -} // namespace - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/filter.h b/externals/g3dlite/G3D.lib/include/G3D/filter.h deleted file mode 100644 index 74a32ad01ea..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/filter.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - @file G3D/filter.h - - @author Morgan McGuire, matrix@graphics3d.com - @created 2007-03-01 - @edited 2007-03-01 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ -#ifndef G3D_FILTER_H -#define G3D_FILTER_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/g3dmath.h" - -namespace G3D { -/** - Generates a set of 1D gaussian filter coefficients of size N. The coefficients - are centered on element (N-1)/2 and have standard deviation given by std. The coefficients - are normalized such that the sum across coeff is 1.0. - - Matches the results returned by Matlab fspecial('gaussian', [1, N], std) - */ -void gaussian1D(Array& coeff, int N = 5, float std = 0.5f); -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/format.h b/externals/g3dlite/G3D.lib/include/G3D/format.h deleted file mode 100644 index f993a74038f..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/format.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - @file format.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @author 2000-09-09 - @edited 2005-11-03 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_FORMAT_H -#define G3D_FORMAT_H - -#include "G3D/platform.h" -#include -#include -#include - -namespace G3D { - -/** - Produces a string from arguments of the style of printf. This avoids - problems with buffer overflows when using sprintf and makes it easy - to use the result functionally. This function is fast when the resulting - string is under 160 characters (not including terminator) and slower - when the string is longer. - */ -std::string __cdecl format( - const char* fmt - ...) G3D_CHECK_PRINTF_ARGS; - -/** - Like format, but can be called with the argument list from a ... function. - */ -std::string vformat( - const char* fmt, - va_list argPtr) G3D_CHECK_VPRINTF_ARGS; - - -} // namespace - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/g3dmath.h b/externals/g3dlite/G3D.lib/include/G3D/g3dmath.h deleted file mode 100644 index 0a4f01f11c6..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/g3dmath.h +++ /dev/null @@ -1,810 +0,0 @@ -/** - @file g3dmath.h - - Math util class. - - @maintainer Morgan McGuire, matrix@graphics3d.com - @cite highestBit by Jukka Liimatta - - @created 2001-06-02 - @edited 2006-01-16 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3DMATH_H -#define G3DMATH_H - -#ifdef _MSC_VER -// Disable conditional expression is constant, which occurs incorrectly on inlined functions -# pragma warning (push) -# pragma warning (disable : 4127) -// disable: "C++ exception handler used" -# pragma warning (disable : 4530) -#endif - -#include "G3D/platform.h" -#include -#include -#include -#include - -#ifdef _MSC_VER - // Visual Studio is missing inttypes.h -# ifndef PRId64 -# define PRId64 "I64d" -# endif -#else -#include -#endif - -/*These defines enable functionality introduced with the 1999 ISO C -**standard. They must be defined before the inclusion of math.h to -**engage them. If optimisation is enabled, these functions will be -**inlined. With optimisation switched off, you have to link in the -**maths library using -lm. -*/ - -#define _ISOC9X_SOURCE1 -#define _ISOC99_SOURCE1 -#define __USE_ISOC9X1 -#define __USE_ISOC991 - -#include - -#include "G3D/debug.h" - -#undef min -#undef max - -namespace G3D { - -#ifdef _MSC_VER - -/** - Win32 implementation of the C99 fast rounding routines. - - @cite routines are - Copyright (C) 2001 Erik de Castro Lopo - - Permission to use, copy, modify, distribute, and sell this file for any - purpose is hereby granted without fee, provided that the above copyright - and this permission notice appear in all copies. No representations are - made about the suitability of this software for any purpose. It is - provided "as is" without express or implied warranty. -*/ - -__inline long int lrint (double flt) { - int intgr; - - _asm { - fld flt - fistp intgr - }; - - return intgr; -} - -__inline long int lrintf(float flt) { - int intgr; - - _asm { - fld flt - fistp intgr - }; - - return intgr; -} -#endif - - - -const double fuzzyEpsilon = 0.00001; - -/** Returns a reference to a static double. - This value should not be tested against directly, instead - G3D::isNan() and G3D::isFinite() will return reliable results. */ -inline const double& inf() { - - // double is a standard type and should have infinity - static const double i = std::numeric_limits::infinity(); - return i; -} - -/** Returns a reference to a static double. - This value should not be tested against directly, instead - G3D::isNan() and G3D::isFinite() will return reliable results. */ -inline const double& nan() { - - // double is a standard type and should have quiet NaN - static const double n = std::numeric_limits::quiet_NaN(); - return n; -} - -/** Returns a reference to a static double. Use instead of G3D_PI. */ -inline const double& pi() { - static const double p = 3.1415926535898; - return p; -} - -/** Returns a reference to a static double. */ -inline const double& halfPi() { - static const double p = pi() / 2.0; - return p; -} - -/** Returns a reference to a static double. */ -inline const double& twoPi() { - static const double p = pi() * 2.0;; - return p; -} - -typedef signed char int8; -typedef unsigned char uint8; -typedef short int16; -typedef unsigned short uint16; -typedef int int32; -typedef unsigned int uint32; - -#ifdef _MSC_EXTENSIONS - typedef __int64 int64; - typedef unsigned __int64 uint64; -#elif ! defined(_MSC_VER) - typedef int64_t int64; - typedef uint64_t uint64; -#else - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef float float32; -typedef double float64; - -int iAbs(int iValue); -int iCeil(double fValue); - -/** - Clamps the value to the range [low, hi] (inclusive) - */ -int iClamp(int val, int low, int hi); -int16 iClamp(int16 val, int16 low, int16 hi); -double clamp(double val, double low, double hi); -float clamp(float val, float low, float hi); - -/** - Returns a + (b - a) * f; - */ -inline double lerp(double a, double b, double f) { - return a + (b - a) * f; -} - -inline float lerp(float a, float b, float f) { - return a + (b - a) * f; -} - -/** - Wraps the value to the range [0, hi) (exclusive - on the high end). This is like the clock arithmetic - produced by % (modulo) except the result is guaranteed - to be positive. - */ -int iWrap(int val, int hi); - -int iFloor(double fValue); - -int iSign(int iValue); -int iSign(double fValue); - -inline int iSign(float f) { - return iSign((double)f); -} - - -/** - Fast round to integer using the lrint routine. - Typically 6x faster than casting to integer. - */ -inline int iRound(double fValue) { - return lrint(fValue); -} - -/** - Fast round to integer using the lrint routine. - Typically 6x faster than casting to integer. - */ -inline int iRound(float f) { - return lrintf(f); -} - -/** - Returns a random number uniformly at random between low and hi - (inclusive). - */ -int iRandom(int low, int hi); - -double abs (double fValue); -double aCos (double fValue); -double aSin (double fValue); -double aTan (double fValue); -double aTan2 (double fY, double fX); -double sign (double fValue); -double square (double fValue); - -/** - Returns true if the argument is a finite real number. - */ -bool isFinite(double x); - -/** - Returns true if the argument is NaN (not a number). - You can't use x == nan to test this because all - comparisons against nan return false. - */ -bool isNaN(double x); - -/** - Computes x % 3. - */ -int iMod3(int x); - -/** - Uniform random number between low and hi, inclusive. [low, hi] - */ -float uniformRandom(float low = 0.0f, float hi = 1.0f); - -/** - Normally distributed random number. - */ -float gaussRandom(float mean = 0.0f, float stdev = 1.0f); - -template -inline T min(const T& x, const T& y) { - return std::min(x, y); -} - -template -inline T min(const T& x, const T& y, const T& z) { - return std::min(std::min(x, y), z); -} - -template -inline T min(const T& x, const T& y, const T& z, const T& w) { - return std::min(std::min(x, y), std::min(z, w)); -} - -template -inline T max(const T& x, const T& y) { - return std::max(x, y); -} - -template -inline T max(const T& x, const T& y, const T& z) { - return std::max(std::max(x, y), z); -} - -template -inline T max(const T& x, const T& y, const T& z, const T& w) { - return std::max(std::max(x, y), std::max(z, w)); -} - -int iMin(int x, int y); -int iMax(int x, int y); - -double square(double x); -double sumSquares(double x, double y); -double sumSquares(double x, double y, double z); -double distance(double x, double y); -double distance(double x, double y, double z); - -/** - Returnes the 0-based index of the highest 1 bit from - the left. -1 means the number was 0. - - @cite Based on code by jukka@liimatta.org - */ -int highestBit(uint32 x); - -/** - Note that fuzzyEq(a, b) && fuzzyEq(b, c) does not imply - fuzzyEq(a, c), although that will be the case on some - occasions. - */ -bool fuzzyEq(double a, double b); - -/** True if a is definitely not equal to b. - Guaranteed false if a == b. - Possibly false when a != b.*/ -bool fuzzyNe(double a, double b); - -/** Is a strictly greater than b? (Guaranteed false if a <= b). - (Possibly false if a > b) */ -bool fuzzyGt(double a, double b); - -/** Is a near or greater than b? */ -bool fuzzyGe(double a, double b); - -/** Is a strictly less than b? (Guaranteed false if a >= b)*/ -bool fuzzyLt(double a, double b); - -/** Is a near or less than b? */ -bool fuzzyLe(double a, double b); - -/** - Computes 1 / sqrt(x). - */ -inline float rsq(float x) { - return 1.0f / sqrtf(x); -} - -/** - Uses SSE to implement rsq. - @cite Nick nicolas@capens.net - */ -inline float SSErsq(float x) { - - #if defined(SSE) && defined(G3D_WIN32) - __asm { - movss xmm0, x - rsqrtss xmm0, xmm0 - movss x, xmm0 - } - return x; - #else - return 1.0f / sqrt(x); - #endif -} - -/** - Return the next power of 2 higher than the input - If the input is already a power of 2, the output will be the same - as the input. - */ -int ceilPow2(unsigned int in); - -/** Returns 2^x */ -inline int pow2(unsigned int x) { - return 1 << x; -} - - -/** Log base 2 */ -inline float log2(float x) { - return ::logf(x) / ::logf(2.0f); -} - -/** Log base 2 */ -inline double log2(double x) { - return ::log(x) / ::log(2.0); -} - -/** Log base 2 */ -inline double log2(int x) { - return log2((double)x); -} - - -/** - * True if num is a power of two. - */ -bool isPow2(int num); - -bool isOdd(int num); -bool isEven(int num); - -double toRadians(double deg); -double toDegrees(double rad); - -/** - Returns true if x is not exactly equal to 0.0f. - */ -inline bool any(float x) { - return x != 0; -} - -/** - Returns true if x is not exactly equal to 0.0f. - */ -inline bool all(float x) { - return x != 0; -} - -/** - v / v (for DirectX/Cg support) - */ -inline float normalize(float v) { - return v / v; -} - -/** - a * b (for DirectX/Cg support) - */ -inline float dot(float a, float b) { - return a * b; -} - - -/** - a * b (for DirectX/Cg support) - */ -inline float mul(float a, float b) { - return a * b; -} - -/** - 2^x - */ -inline double exp2(double x) { - return pow(2.0, x); -} - -inline double rsqrt(double x) { - return 1.0 / sqrt(x); -} - - -/** - sin(x)/x - */ -inline double sinc(double x) { - double r = sin(x) / x; - - if (isNaN(r)) { - return 1.0; - } else { - return r; - } -} - -/** - Computes a floating point modulo; the result is t wrapped to the range [lo, hi). - */ -inline float wrap(float t, float lo, float hi) { - if ((t >= lo) && (t < hi)) { - return t; - } - - debugAssert(hi > lo); - - float interval = hi - lo; - - return t - interval * iFloor((t - lo) / interval); -} - - -inline double wrap(double t, double lo, double hi) { - if ((t >= lo) && (t < hi)) { - return t; - } - - debugAssert(hi > lo); - - double interval = hi - lo; - - return t - interval * iFloor((t - lo) / interval); -} - -inline double wrap(double t, double hi) { - return wrap(t, 0.0, hi); -} - - -inline bool isNaN(double x) { - bool b1 = (x < 0.0); - bool b2 = (x >= 0.0); - bool b3 = !(b1 || b2); - return b3; -} - -inline bool isFinite(double x) { - return ! isNaN(x) && (x < G3D::inf()) && (x > -G3D::inf()); -} - -//---------------------------------------------------------------------------- -inline int iAbs (int iValue) { - return ( iValue >= 0 ? iValue : -iValue ); -} - -//---------------------------------------------------------------------------- -inline int iCeil (double fValue) { - return int(::ceil(fValue)); -} - -//---------------------------------------------------------------------------- - -inline int iClamp(int val, int low, int hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -//---------------------------------------------------------------------------- - -inline int16 iClamp(int16 val, int16 low, int16 hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -//---------------------------------------------------------------------------- - -inline double clamp(double val, double low, double hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} - -inline float clamp(float val, float low, float hi) { - debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } -} -//---------------------------------------------------------------------------- - -inline int iWrap(int val, int hi) { - if (val < 0) { - return ((val % hi) + hi) % hi; - } else { - return val % hi; - } -} - -//---------------------------------------------------------------------------- -inline int iFloor (double fValue) { - return int(::floor(fValue)); -} - -//---------------------------------------------------------------------------- -inline int iSign (int iValue) { - return ( iValue > 0 ? + 1 : ( iValue < 0 ? -1 : 0 ) ); -} - -inline int iSign (double fValue) { - return ( fValue > 0.0 ? + 1 : ( fValue < 0.0 ? -1 : 0 ) ); -} - -//---------------------------------------------------------------------------- -inline double abs (double fValue) { - return double(::fabs(fValue)); -} - -//---------------------------------------------------------------------------- -inline double aCos (double fValue) { - if ( -1.0 < fValue ) { - if ( fValue < 1.0 ) - return double(::acos(fValue)); - else - return 0.0; - } else { - return pi(); - } -} - -//---------------------------------------------------------------------------- -inline double aSin (double fValue) { - if ( -1.0 < fValue ) { - if ( fValue < 1.0 ) { - return double(::asin(fValue)); - } else { - return -halfPi(); - } - } else { - return halfPi(); - } -} - -//---------------------------------------------------------------------------- -inline double aTan (double fValue) { - return double(::atan(fValue)); -} - -//---------------------------------------------------------------------------- -inline double aTan2 (double fY, double fX) { - return double(::atan2(fY, fX)); -} - -//---------------------------------------------------------------------------- -inline double sign (double fValue) { - if (fValue > 0.0) { - return 1.0; - } - - if (fValue < 0.0) { - return -1.0; - } - - return 0.0; -} - -inline float sign (float fValue) { - if (fValue > 0.0f) { - return 1.0f; - } - - if (fValue < 0.0f) { - return -1.0f; - } - - return 0.0f; -} - - -inline float uniformRandom(float low, float hi) { - return (hi - low) * float(::rand()) / float(RAND_MAX) + low; -} - -//---------------------------------------------------------------------------- -inline double square(double x) { - return x * x; -} - -//---------------------------------------------------------------------------- -inline double sumSquares(double x, double y) { - return x*x + y*y; -} - -//---------------------------------------------------------------------------- -inline double sumSquares(double x, double y, double z) { - return x*x + y*y + z*z; -} - -//---------------------------------------------------------------------------- -inline double distance(double x, double y) { - return sqrt(sumSquares(x, y)); -} - -//---------------------------------------------------------------------------- -inline double distance(double x, double y, double z) { - return sqrt(sumSquares(x, y, z)); -} - -//---------------------------------------------------------------------------- - -/** @deprecated use G3D::min */ -inline int iMin(int x, int y) { - return (x >= y) ? y : x; -} - -//---------------------------------------------------------------------------- -/** @deprecated use G3D::min */ -inline int iMax(int x, int y) { - return (x >= y) ? x : y; -} - -//---------------------------------------------------------------------------- -inline int ceilPow2(unsigned int in) { - in -= 1; - - in |= in >> 16; - in |= in >> 8; - in |= in >> 4; - in |= in >> 2; - in |= in >> 1; - - return in + 1; -} - -inline bool isPow2(int num) { - return ((num & -num) == num); -} - -inline bool isOdd(int num) { - return (num & 1) == 1; -} - -inline bool isEven(int num) { - return (num & 1) == 0; -} - -inline double toRadians(double deg) { - return deg * pi() / 180.0; -} - -inline double toDegrees(double rad) { - return rad * 180.0 / pi(); -} - -inline float toRadians(float deg) { - return deg * (float)pi() / 180.0f; -} - -inline float toDegrees(float rad) { - return rad * 180.0f / (float)pi(); -} - -inline float toRadians(int deg) { - return deg * (float)pi() / 180.0f; -} - -inline float toDegrees(int rad) { - return rad * 180.0f / (float)pi(); -} -/** - Computes an appropriate epsilon for comparing a and b. - */ -inline double eps(double a, double b) { - // For a and b to be nearly equal, they must have nearly - // the same magnitude. This means that we can ignore b - // since it either has the same magnitude or the comparison - // will fail anyway. - (void)b; - const double aa = abs(a) + 1; - if (aa == inf()) { - return fuzzyEpsilon; - } else { - return fuzzyEpsilon * aa; - } -} - -inline bool fuzzyEq(double a, double b) { - return (a == b) || (abs(a - b) <= eps(a, b)); -} - -inline bool fuzzyNe(double a, double b) { - return ! fuzzyEq(a, b); -} - -inline bool fuzzyGt(double a, double b) { - return a > b + eps(a, b); -} - -inline bool fuzzyGe(double a, double b) { - return a > b - eps(a, b); -} - -inline bool fuzzyLt(double a, double b) { - return a < b - eps(a, b); -} - -inline bool fuzzyLe(double a, double b) { - return a < b + eps(a, b); -} - -inline int iMod3(int x) { - return x % 3; -} - -/** - Given a 32-bit integer, returns the integer with the bytes in the opposite order. - */ -inline uint32 flipEndian32(const uint32 x) { - return (x << 24) | ((x & 0xFF00) << 8) | - ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24); -} - -/** - Given a 16-bit integer, returns the integer with the bytes in the opposite order. - */ -inline uint16 flipEndian16(const uint16 x) { - return (x << 8) | ((x & 0xFF00) >> 8); -} - - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/platform.h b/externals/g3dlite/G3D.lib/include/G3D/platform.h deleted file mode 100644 index be9ec4d5123..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/platform.h +++ /dev/null @@ -1,256 +0,0 @@ -/** - @file platform.h - - #defines for platform specific issues. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-06-09 - @edited 2007-07-30 - */ - -#ifndef G3D_PLATFORM_H -#define G3D_PLATFORM_H - -/** - The version number of G3D in the form: MmmBB -> - version M.mm [beta BB] - */ -#define G3D_VER 70100 - -#if defined(G3D_RELEASEDEBUG) -# define G3D_DEBUGRELEASE -#endif - -#if defined(G3D_DEBUGRELEASE) && defined(_DEBUG) -# undef _DEBUG -#endif - -#if !defined(G3D_DEBUG) && (defined(_DEBUG) || defined(G3D_DEBUGRELEASE)) -# define G3D_DEBUG -#endif - -#ifdef _MSC_VER - #define G3D_WIN32 -#elif defined(__FreeBSD__) || defined(__OpenBSD__) - #define G3D_FREEBSD - #define G3D_LINUX -#elif defined(__linux__) - #define G3D_LINUX -#elif defined(__APPLE__) - #define G3D_OSX - - // Prevent OS X fp.h header from being included; it defines - // pi as a constant, which creates a conflict with G3D -#define __FP__ -#else - #error Unknown platform -#endif - - -// Default to compiling with SSE, but if you want to compile -// without installing SP5.0 and the Processor Pack on Windows, compile with NO_SSE -// defined (can be passed to the compiler command line with /D "NO_SSE") -#if !defined(NO_SSE) - #define SSE -#endif - -// On g++, recognize cases where the -msse2 flag was not specified -#if defined(SSE) && defined(__GNUC__) && ! defined (__SSE__) -# undef SSE -#endif - - -// Verify that the supported compilers are being used and that this is a known -// processor. - -#ifdef G3D_LINUX -# ifndef __GNUC__ -# error G3D only supports the gcc compiler on Linux. -# endif -#endif - -#ifdef G3D_OSX -# ifndef __GNUC__ -# error G3D only supports the gcc compiler on OS X. -# endif - -# if defined(__i386__) -# define G3D_OSX_INTEL -# elif defined(__PPC__) -# define G3D_OSX_PPC -# else -# define G3D_OSX_UNKNOWN -# endif - -#endif - - -#ifdef _MSC_VER -// Microsoft Visual C++ 8.0 ("Express") = 1400 -// Microsoft Visual C++ 7.1 ("2003") _MSC_VER = 1310 -// Microsoft Visual C++ 7.0 ("2002") _MSC_VER = 1300 -// Microsoft Visual C++ 6.0 _MSC_VER = 1200 -// Microsoft Visual C++ 5.0 _MSC_VER = 1100 - -// Turn off warnings about deprecated C routines (TODO: revisit) -# pragma warning (disable : 4996) - -// Turn off "conditional expression is constant" warning; MSVC generates this -// for debug assertions in inlined methods. -# pragma warning (disable : 4127) - -# define G3D_DEPRECATED __declspec(deprecated) - -// Prevent Winsock conflicts by hiding the winsock API -# ifndef _WINSOCKAPI_ -# define _G3D_INTERNAL_HIDE_WINSOCK_ -# define _WINSOCKAPI_ -# endif - -// Disable 'name too long for browse information' warning -# pragma warning (disable : 4786) -// TODO: remove -# pragma warning (disable : 4244) - -# define ZLIB_WINAPI - -# define restrict - -# define G3D_CHECK_PRINTF_ARGS -# define G3D_CHECK_VPRINTF_ARGS -# define G3D_CHECK_PRINTF_METHOD_ARGS -# define G3D_CHECK_VPRINTF_METHOD_ARGS - - // On MSVC, we need to link against the multithreaded DLL version of - // the C++ runtime because that is what SDL and ZLIB are compiled - // against. This is not the default for MSVC, so we set the following - // defines to force correct linking. - // - // For documentation on compiler options, see: - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.md.2c_2f.ml.2c_2f.mt.2c_2f.ld.asp - // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_Compiler_Reference.asp - // - - // DLL runtime - #ifndef _DLL - #define _DLL - #endif - - // Multithreaded runtime - #ifndef _MT - #define _MT 1 - #endif - - // Ensure that we aren't forced into the static lib - #ifdef _STATIC_CPPLIB - #undef _STATIC_CPPLIB - #endif - - #ifdef _DEBUG - #pragma comment (linker, "/NODEFAULTLIB:LIBCMTD.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCPMTD.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCPD.LIB") - #pragma comment (linker, "/DEFAULTLIB:MSVCPRTD.LIB") - #pragma comment(linker, "/NODEFAULTLIB:LIBCD.LIB") - #pragma comment(linker, "/DEFAULTLIB:MSVCRTD.LIB") - #else - #pragma comment(linker, "/NODEFAULTLIB:LIBC.LIB") - #pragma comment(linker, "/DEFAULTLIB:MSVCRT.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCMT.LIB") - #pragma comment (linker, "/NODEFAULTLIB:LIBCPMT.LIB") - #pragma comment(linker, "/NODEFAULTLIB:LIBCP.LIB") - #pragma comment (linker, "/DEFAULTLIB:MSVCPRT.LIB") - #endif - - // Now set up external linking - -# ifdef _DEBUG - // zlib was linked against the release MSVCRT; force - // the debug version. -# pragma comment(linker, "/NODEFAULTLIB:MSVCRT.LIB") -# endif - - -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN 1 -# endif - - -# define NOMINMAX 1 -# ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0500 -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# undef NOMINMAX - -# ifdef _G3D_INTERNAL_HIDE_WINSOCK_ -# undef _G3D_INTERNAL_HIDE_WINSOCK_ -# undef _WINSOCKAPI_ -# endif - - -# define G3D_START_AT_MAIN()\ -int WINAPI G3D_WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw);\ -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) {\ - return G3D_WinMain(hInst, hPrev, szCmdLine, sw);\ -} - -#else - -# define G3D_START_AT_MAIN() - -#endif // win32 - -#ifdef __GNUC__ - -# include - -# if __STDC_VERSION__ < 199901 -# define restrict __restrict__ -# endif - -# define G3D_DEPRECATED __attribute__((__deprecated__)) - -// setup function calling conventions -# if defined(__i386__) && ! defined(__x86_64__) - -# ifndef __cdecl -# define __cdecl __attribute__((cdecl)) -# endif - -# ifndef __stdcall -# define __stdcall __attribute__((stdcall)) -# endif - -# elif defined(__x86_64__) || defined(__powerpc__) - -# ifndef __cdecl -# define __cdecl -# endif - -# ifndef __stdcall -# define __stdcall -# endif -# endif // calling conventions - -# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3))) -# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0))) -# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2))) -# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0))) -#endif - - -/** - @def STR(expression) - - Creates a string from the expression. Frequently used with G3D::Shader - to express shading programs inline. - - STR(this becomes a string)
 evaluates the same as "this becomes a string"
- */
-#define STR(x) #x
-
-// Header guard
-#endif
diff --git a/externals/g3dlite/G3D.lib/include/G3D/prompt.h b/externals/g3dlite/G3D.lib/include/G3D/prompt.h
deleted file mode 100644
index e25b955ab28..00000000000
--- a/externals/g3dlite/G3D.lib/include/G3D/prompt.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/** 
- @file prompt.h
- 
- @maintainer Morgan McGuire, matrix@graphics3d.com
- @cite   Windows GUI code by Max McGuire
-
- @created 2001-08-26
- @edited  2006-08-13
- */
-
-#ifndef G3D_PROMPT_H
-#define G3D_PROMPT_H
-
-#include "platform.h"
-#include 
-
-namespace G3D {
-
-/**
-  Prints a prompt to stdout and waits for user input.  The return value is
-  the number of the user's choice (the first is 0, if there are no
-  choices, returns 0). 
- 
-  @param useGui Under Win32, use a GUI, not stdout prompt.
-  @param windowTitle The title for the prompt window
-  @param promptx The text string to prompt the user with
-  @param choice  An array of strings that are the choices the user may make
-  @param numChoices The length of choice.
-
-  @cite Windows dialog interface by Max McGuire, mmcguire@ironlore.com
-  @cite Font setting code by Kurt Miller, kurt@flipcode.com
- */
-int prompt(
-    const char*     windowTitle,
-    const char*     promptx,
-    const char**    choice,
-    int             numChoices,
-    bool            useGui);
-
-/**
-  Prints a prompt and waits for user input.  The return value is
-  the number of the user's choice (the first is 0, if there are no
-  choices, returns 0).
-  

Uses GUI under Win32, stdout prompt otherwise. - */ -inline int prompt( - const char* windowTitle, - const char* promptx, - const char** choice, - int numChoices) { - - return prompt(windowTitle, promptx, choice, numChoices, true); -} - - -/** - Displays a GUI prompt with "Ok" as the only choice. - */ -void msgBox( - const std::string& message, - const std::string& title = "Message"); - - -}; // namespace - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/serialize.h b/externals/g3dlite/G3D.lib/include/G3D/serialize.h deleted file mode 100644 index 2382c0ee0fd..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/serialize.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef G3D_SERIALIZE_H -#define G3D_SERIALIZE_H - -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Array.h" - -namespace G3D { - - -template -void serialize(const Array& array, BinaryOutput& b) { - b.writeInt32(array.size()); - for (int i = 0; i < array.size(); ++i) { - serialize(array[i], b); - } -} - -template -void deserialize(Array& array, BinaryInput& b) { - int N = b.readInt32(); - array.resize(N); - for (int i = 0; i < array.size(); ++i) { - deserialize(array[i], b); - } -} - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/splinefunc.h b/externals/g3dlite/G3D.lib/include/G3D/splinefunc.h deleted file mode 100644 index a9daad9b578..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/splinefunc.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - @file spline.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2004-07-25 - @edited 2007-05-05 - */ - -#ifndef G3D_SPLINEFUNC_H -#define G3D_SPLINEFUNC_H - -namespace G3D { - -#include "G3D/platform.h" -#include "G3D/debug.h" -#include "G3D/Array.h" -#include "G3D/g3dmath.h" - -/** - Interpolates a property according to a piecewise linear spline. This provides - C0 continuity but the derivatives are not smooth. -

- Example: - - const double times[] = {MIDNIGHT, SUNRISE - HOUR, SUNRISE, SUNRISE + sunRiseAndSetTime / 4, SUNRISE + sunRiseAndSetTime, SUNSET - sunRiseAndSetTime, SUNSET - sunRiseAndSetTime / 2, SUNSET, SUNSET + HOUR/2, DAY}; - const Color3 color[] = {Color3(0, .0, .1), Color3(0, .0, .1), Color3::black(), Color3::black(), Color3::white() * .25, Color3::white() * .25, Color3(.5, .2, .2), Color3(.05, .05, .1), Color3(0, .0, .1), Color3(0, .0, .1)}; - ambient = linearSpline(time, times, color, 10); - - - See also G3D::Spline - - @param x The spline is a function of x; this is the sample to choose. - @param controlX controlX[i], controlY[i] is a control points. It is assumed - that controlX are strictly increasing. XType must support - the "<" operator and a subtraction operator that returns - a number. - @param controlY YType must support multiplication and addition. - @param numControl The number of control points. - */ -template -YType linearSpline(double x, const XType* controlX, const YType* controlY, int numControl) { - debugAssert(numControl >= 1); - - // Off the beginning - if ((numControl == 1) || (x < controlX[0])) { - return controlY[0]; - } - - for (int i = 1; i < numControl; ++i) { - if (x < controlX[i]) { - const double alpha = (double)(controlX[i] - x) / (controlX[i] - controlX[i - 1]); - return controlY[i] * (1 - alpha) + controlY[i - 1] * alpha; - } - } - - // Off the end - return controlY[numControl - 1]; -} - - - /** See also G3D::Spline*/ -template YType cyclicCatmullRomSpline( - double t, - const YType* controlY, - int numPoints) { - - debugAssert(numPoints >= 3); - - t = wrap(t, numPoints); - - // Find the indices of adjacent control points - int i = iFloor(t); - - // Compute the distance from the control point - t = t - i; - - // Shift back one point for correct indexing - i += numPoints - 1; - - // Pick up four control points - const YType& P0 = controlY[(i + 0) % numPoints]; - const YType& P1 = controlY[(i + 1) % numPoints]; - const YType& P2 = controlY[(i + 2) % numPoints]; - const YType& P3 = controlY[(i + 3) % numPoints]; - - return 0.5 * ((2 * P1) + - (-P0 + P2) * t + - (2*P0 - 5*P1 + 4*P2 - P3) * t*t + - (-P0 + 3*P1- 3*P2 + P3) * t*t*t); -} - -/** - A cubic spline with regularly spaced - control points. The spline interpolates - the control points. The spline - will wrap from the last point back to the first. - - The t parameter is on the range [0, controlY.size()], - where integers correspond to control points exactly. - - See also G3D::Spline - - @cite http://www.mvps.org/directx/articles/catmull/ -*/ -template YType cyclicCatmullRomSpline( - double t, - const Array& controlY) { - - int numPoints = controlY.size(); - return cyclicCatmullRomSpline(t, controlY.getCArray(), numPoints); -} - -} - -#endif - - diff --git a/externals/g3dlite/G3D.lib/include/G3D/stringutils.h b/externals/g3dlite/G3D.lib/include/G3D/stringutils.h deleted file mode 100644 index 20a2ff6e795..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/stringutils.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - @file stringutils.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @author 2000-09-09 - @edited 2008-08-05 - */ - -#ifndef G3D_STRINGUTILS_H -#define G3D_STRINGUTILS_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include - -namespace G3D { - -extern const char* NEWLINE; - -/** - Returns true if the test string begins with the pattern string. - */ -bool beginsWith( - const std::string& test, - const std::string& pattern); - -/** - Returns true if the test string ends with the pattern string. - */ -bool endsWith( - const std::string& test, - const std::string& pattern); - -/** - Produces a new string that is the input string - wrapped at a certain number of columns (where - the line is broken at the latest space before the - column limit.) Platform specific NEWLINEs - are inserted to wrap. - */ -std::string wordWrap( - const std::string& input, - int numCols); - -/** - A comparison function for passing to Array::sort. - */ -int stringCompare( - const std::string& s1, - const std::string& s2); - -int stringPtrCompare( - const std::string* s1, - const std::string* s2); - -/** - Returns a new string that is an uppercase version of x. - */ -std::string toUpper( - const std::string& x); - -std::string toLower( - const std::string& x); - -/** - Splits x at each occurance of splitChar. - */ -G3D::Array stringSplit( - const std::string& x, - char splitChar); - -/** - joinChar is not inserted at the beginning or end, just in between - elements. - */ -std::string stringJoin( - const G3D::Array& a, - char joinChar); - -std::string stringJoin( - const G3D::Array& a, - const std::string& joinStr); - -/** - Strips whitespace from both ends of the string. - */ -std::string trimWhitespace( - const std::string& s); - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isWhiteSpace(const unsigned char c) { - return isspace(c) != 0; -} - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isNewline(const unsigned char c) { - return (c == '\n') || (c == '\r'); -} - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isDigit(const unsigned char c) { - return isdigit(c) != 0; -} - -/** These standard C functions are renamed for clarity/naming - conventions and to return bool, not int. - */ -inline bool isLetter(const unsigned char c) { - return isalpha(c) != 0; -} - -inline bool isSlash(const unsigned char c) { - return (c == '\\') || (c == '/'); -} - -inline bool isQuote(const unsigned char c) { - return (c == '\'') || (c == '\"'); -} - -}; // namespace - -#endif - diff --git a/externals/g3dlite/G3D.lib/include/G3D/uint128.h b/externals/g3dlite/G3D.lib/include/G3D/uint128.h deleted file mode 100644 index 3e970cb2a7e..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/uint128.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - @file uint128.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - @author Kyle Whitson - - @created 2008-07-17 - @edited 2008-07-17 - */ - -#ifndef G3D_UINT128_H -#define G3D_UINT128_H - -#include "G3D/g3dmath.h" - -namespace G3D { - -/** Limited functionality 128-bit unsigned integer. This is primarily to support FNV hashing and other - cryptography applications. See the GMP library for high-precision C++ math support. */ -class uint128 { -public: - - G3D::uint64 hi; - G3D::uint64 lo; - - uint128(const uint64& lo); - - uint128(const uint64& hi, const uint64& lo); - - uint128& operator+=(const uint128& x); - - uint128& operator*=(const uint128& x); - - uint128& operator^=(const uint128& x); - - uint128& operator&=(const uint128& x); - - uint128& operator|=(const uint128& x); - - bool operator==(const uint128& x); - - uint128& operator>>=(const int x); - - uint128& operator<<=(const int x); - - uint128 operator&(const uint128& x); - -}; -} - -#endif diff --git a/externals/g3dlite/G3D.lib/include/G3D/vectorMath.h b/externals/g3dlite/G3D.lib/include/G3D/vectorMath.h deleted file mode 100644 index aedc731e7f8..00000000000 --- a/externals/g3dlite/G3D.lib/include/G3D/vectorMath.h +++ /dev/null @@ -1,235 +0,0 @@ -/** - @file vectorMath.h - - Function aliases for popular vector methods. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created: 2001-06-02 - @edited: 2004-02-02 - Copyright 2000-2004, Morgan McGuire. - All rights reserved. - */ - -#ifndef G3D_VECTORMATH_H -#define G3D_VECTORMATH_H - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" - - -namespace G3D { - - -inline Matrix4 mul(const Matrix4& a, const Matrix4& b) { - return a * b; -} - -inline Vector4 mul(const Matrix4& m, const Vector4& v) { - return m * v; -} - -inline Vector3 mul(const Matrix3& m, const Vector3& v) { - return m * v; -} - -inline Matrix3 mul(const Matrix3& a, const Matrix3& b) { - return a * b; -} - -inline float dot(const Vector2& a, const Vector2& b) { - return a.dot(b); -} - -inline float dot(const Vector3& a, const Vector3& b) { - return a.dot(b); -} - -inline float dot(const Vector4& a, const Vector4& b) { - return a.dot(b); -} - -inline Vector2 normalize(const Vector2& v) { - return v / v.length(); -} - -inline Vector3 normalize(const Vector3& v) { - return v / v.magnitude(); -} - -inline Vector4 normalize(const Vector4& v) { - return v / v.length(); -} - -inline Vector2 abs(const Vector2& v) { - return Vector2(::fabsf(v.x), ::fabsf(v.y)); -} - -inline Vector3 abs(const Vector3& v) { - return Vector3(::fabsf(v.x), ::fabsf(v.y), ::fabsf(v.z)); -} - -inline Vector4 abs(const Vector4& v) { - return Vector4(::fabsf(v.x), ::fabsf(v.y), ::fabsf(v.z), ::fabsf(v.w)); -} - -inline bool all(const Vector2& v) { - return (v.x != 0) && (v.y != 0); -} - -inline bool all(const Vector3& v) { - return (v.x != 0) && (v.y != 0) && (v.z != 0); -} - -inline bool all(const Vector4& v) { - return (v.x != 0) && (v.y != 0) && (v.z != 0) && (v.w != 0); -} - -inline bool any(const Vector2& v) { - return (v.x != 0) || (v.y != 0); -} - -inline bool any(const Vector3& v) { - return (v.x != 0) || (v.y != 0) || (v.z != 0); -} - -inline bool any(const Vector4& v) { - return (v.x != 0) || (v.y != 0) || (v.z != 0) || (v.w != 0); -} - -inline Vector2 clamp(const Vector2& v, const Vector2& a, const Vector2& b) { - return v.clamp(a, b); -} - -inline Vector3 clamp(const Vector3& v, const Vector3& a, const Vector3& b) { - return v.clamp(a, b); -} - -inline Vector4 clamp(const Vector4& v, const Vector4& a, const Vector4& b) { - return v.clamp(a, b); -} - -inline Vector2 lerp(const Vector2& v1, const Vector2& v2, float f) { - return v1.lerp(v2, f); -} - -inline Vector3 lerp(const Vector3& v1, const Vector3& v2, float f) { - return v1.lerp(v2, f); -} - -inline Vector4 lerp(const Vector4& v1, const Vector4& v2, float f) { - return v1.lerp(v2, f); -} - -inline Color1 lerp(const Color1& v1, const Color1& v2, float f) { - return v1.lerp(v2, f); -} - -inline Color3 lerp(const Color3& v1, const Color3& v2, float f) { - return v1.lerp(v2, f); -} - -inline Color4 lerp(const Color4& v1, const Color4& v2, float f) { - return v1.lerp(v2, f); -} - -inline Vector3 cross(const Vector3& v1, const Vector3& v2) { - return v1.cross(v2); -} - -inline double determinant(const Matrix3& m) { - return m.determinant(); -} - -inline double determinant(const Matrix4& m) { - return m.determinant(); -} - -inline Vector2 min(const Vector2& v1, const Vector2& v2) { - return v1.min(v2); -} - -inline Vector3 min(const Vector3& v1, const Vector3& v2) { - return v1.min(v2); -} - -inline Vector4 min(const Vector4& v1, const Vector4& v2) { - return v1.min(v2); -} - -inline Color3 min(const Color3& v1, const Color3& v2) { - return v1.min(v2); -} - -inline Color4 min(const Color4& v1, const Color4& v2) { - return v1.min(v2); -} - -inline Vector2 max(const Vector2& v1, const Vector2& v2) { - return v1.max(v2); -} - -inline Vector3 max(const Vector3& v1, const Vector3& v2) { - return v1.max(v2); -} - -inline Vector4 max(const Vector4& v1, const Vector4& v2) { - return v1.max(v2); -} - -inline Color3 max(const Color3& v1, const Color3& v2) { - return v1.max(v2); -} - -inline Color4 max(const Color4& v1, const Color4& v2) { - return v1.max(v2); -} - -inline Vector2 sign(const Vector2& v) { - return Vector2((float)sign(v.x), (float)sign(v.y)); -} - -inline Vector3 sign(const Vector3& v) { - return Vector3((float)sign(v.x), (float)sign(v.y), (float)sign(v.z)); -} - -inline Vector4 sign(const Vector4& v) { - return Vector4((float)sign(v.x), (float)sign(v.y), (float)sign(v.z), (float)sign(v.w)); -} - -inline float length(float v) { - return ::fabsf(v); -} - -inline float length(const Vector2& v) { - return v.length(); -} - -inline float length(const Vector3& v) { - return v.magnitude(); -} - -inline float length(const Vector4& v) { - return v.length(); -} - -/** - Computes the log of each component. Useful for - inverting the monitor gamma function or simulating - perceptual response. - */ -inline Color3 log(const Color3& c) { - return Color3(::logf(c.r), ::logf(c.g), ::logf(c.b)); -} - -} - -#endif diff --git a/externals/g3dlite/G3D.lib/source/AABox.cpp b/externals/g3dlite/G3D.lib/source/AABox.cpp deleted file mode 100644 index 9e871aa8af7..00000000000 --- a/externals/g3dlite/G3D.lib/source/AABox.cpp +++ /dev/null @@ -1,342 +0,0 @@ -/** - @file AABox.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2004-01-10 - @edited 2006-01-11 -*/ - -#include "G3D/platform.h" -#include "G3D/AABox.h" -#include "G3D/Box.h" -#include "G3D/Plane.h" -#include "G3D/Sphere.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - - -namespace G3D { - - -void AABox::serialize(class BinaryOutput& b) const { - b.writeVector3(lo); - b.writeVector3(hi); -} - - -void AABox::deserialize(class BinaryInput& b) { - lo = b.readVector3(); - hi = b.readVector3(); -} - - -void AABox::split(const Vector3::Axis& axis, float location, AABox& low, AABox& high) const { - // Low, medium, and high along the chosen axis - float L = G3D::min(location, lo[axis]); - float M = G3D::min(G3D::max(location, lo[axis]), hi[axis]); - float H = G3D::max(location, hi[axis]); - - // Copy over this box. - high = low = *this; - - // Now move the split points along the special axis - low.lo[axis] = L; - low.hi[axis] = M; - high.lo[axis] = M; - high.hi[axis] = H; -} - - -Vector3 AABox::randomSurfacePoint() const { - Vector3 extent = hi - lo; - float aXY = extent.x * extent.y; - float aYZ = extent.y * extent.z; - float aZX = extent.z * extent.x; - - float r = (float)uniformRandom(0.0f, aXY + aYZ + aZX); - - // Choose evenly between positive and negative face planes - float d = ((float)uniformRandom(0, 1) < 0.5f) ? 0.0f : 1.0f; - - // The probability of choosing a given face is proportional to - // its area. - if (r < aXY) { - return - lo + - Vector3( - (float)uniformRandom(0.0f, extent.x), - (float)uniformRandom(0.0f, extent.y), - d * extent.z); - } else if (r < aYZ) { - return - lo + - Vector3( - d * extent.x, - (float)uniformRandom(0, extent.y), - (float)uniformRandom(0, extent.z)); - } else { - return - lo + - Vector3( - (float)uniformRandom(0, extent.x), - d * extent.y, - (float)uniformRandom(0, extent.z)); - } -} - - -Vector3 AABox::randomInteriorPoint() const { - return Vector3( - (float)uniformRandom(lo.x, hi.x), - (float)uniformRandom(lo.y, hi.y), - (float)uniformRandom(lo.z, hi.z)); -} - - -bool AABox::intersects(const AABox& other) const { - // Must be overlap along all three axes. - // Try to find a separating axis. - - for (int a = 0; a < 3; ++a) { - - // |--------| - // |------| - - if ((lo[a] > other.hi[a]) || - (hi[a] < other.lo[a])) { - return false; - } - } - - return true; -} - -int AABox::dummy = 0; - - -bool AABox::culledBy( - const Array& plane, - int& cullingPlane, - const uint32 _inMask, - uint32& childMask) const { - - uint32 inMask = _inMask; - assert(plane.size() < 31); - - childMask = 0; - - const bool finite = - (abs(lo.x) < G3D::inf()) && - (abs(hi.x) < G3D::inf()) && - (abs(lo.y) < G3D::inf()) && - (abs(hi.y) < G3D::inf()) && - (abs(lo.z) < G3D::inf()) && - (abs(hi.z) < G3D::inf()); - - // See if there is one plane for which all of the - // vertices are in the negative half space. - for (int p = 0; p < plane.size(); ++p) { - - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - Vector3 corner; - - int numContained = 0; - int v = 0; - - // We can early-out only if we have found one point on each - // side of the plane (i.e. if we are straddling). That - // occurs when (numContained < v) && (numContained > 0) - for (v = 0; (v < 8) && ((numContained == v) || (numContained == 0)); ++v) { - // Unrolling these 3 if's into a switch decreases performance - // by about 2x - corner.x = (v & 1) ? hi.x : lo.x; - corner.y = (v & 2) ? hi.y : lo.y; - corner.z = (v & 4) ? hi.z : lo.z; - - if (finite) { // this branch is highly predictable - if (plane[p].halfSpaceContainsFinite(corner)) { - ++numContained; - } - } else { - if (plane[p].halfSpaceContains(corner)) { - ++numContained; - } - } - } - - if (numContained == 0) { - // Plane p culled the box - cullingPlane = p; - - // The caller should not recurse into the children, - // since the parent is culled. If they do recurse, - // make them only test against this one plane, which - // will immediately cull the volume. - childMask = 1 << p; - return true; - - } else if (numContained < v) { - // The bounding volume straddled the plane; we have - // to keep testing against this plane - childMask |= (1 << p); - } - } - - // Move on to the next bit. - inMask = inMask >> 1; - } - - // None of the planes could cull this box - cullingPlane = -1; - return false; -} - - -bool AABox::culledBy( - const Array& plane, - int& cullingPlane, - const uint32 _inMask) const { - - uint32 inMask = _inMask; - assert(plane.size() < 31); - - const bool finite = - (abs(lo.x) < G3D::inf()) && - (abs(hi.x) < G3D::inf()) && - (abs(lo.y) < G3D::inf()) && - (abs(hi.y) < G3D::inf()) && - (abs(lo.z) < G3D::inf()) && - (abs(hi.z) < G3D::inf()); - - // See if there is one plane for which all of the - // vertices are in the negative half space. - for (int p = 0; p < plane.size(); ++p) { - - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - bool culled = true; - Vector3 corner; - - int v; - - // Assume this plane culls all points. See if there is a point - // not culled by the plane... early out when at least one point - // is in the positive half space. - for (v = 0; (v < 8) && culled; ++v) { - - // Unrolling these 3 if's into a switch decreases performance - // by about 2x - corner.x = (v & 1) ? hi.x : lo.x; - corner.y = (v & 2) ? hi.y : lo.y; - corner.z = (v & 4) ? hi.z : lo.z; - - if (finite) { // this branch is highly predictable - culled = ! plane[p].halfSpaceContainsFinite(corner); - } else { - culled = ! plane[p].halfSpaceContains(corner); - } - } - - if (culled) { - // Plane p culled the box - cullingPlane = p; - - return true; - } - } - - // Move on to the next bit. - inMask = inMask >> 1; - } - - // None of the planes could cull this box - cullingPlane = -1; - return false; -} - - -bool AABox::intersects(const class Sphere& sphere) const { - double d = 0; - - //find the square of the distance - //from the sphere to the box - for (int i = 0; i < 3; ++i) { - if (sphere.center[i] < lo[i]) { - d += square(sphere.center[i] - lo[i]); - } else if (sphere.center[i] > hi[i]) { - d += square(sphere.center[i] - hi[i]); - } - } - - return d <= square(sphere.radius); -} - -Vector3 AABox::corner(int index) const { - - // default constructor inits all components to 0 - Vector3 v; - - switch (index) - { - case 0: - v.x = lo.x; - v.y = lo.y; - v.z = hi.z; - break; - - case 1: - v.x = hi.x; - v.y = lo.y; - v.z = hi.z; - break; - - case 2: - v.x = hi.x; - v.y = hi.y; - v.z = hi.z; - break; - - case 3: - v.x = lo.x; - v.y = hi.y; - v.z = hi.z; - break; - - case 4: - v.x = lo.x; - v.y = lo.y; - v.z = lo.z; - break; - - case 5: - v.x = hi.x; - v.y = lo.y; - v.z = lo.z; - break; - - case 6: - v.x = hi.x; - v.y = hi.y; - v.z = lo.z; - break; - - case 7: - v.x = lo.x; - v.y = hi.y; - v.z = lo.z; - break; - - default: - debugAssertM(false, "Invalid corner index"); - break; - } - - return v; -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/AnyVal.cpp b/externals/g3dlite/G3D.lib/source/AnyVal.cpp deleted file mode 100644 index 45fb41df534..00000000000 --- a/externals/g3dlite/G3D.lib/source/AnyVal.cpp +++ /dev/null @@ -1,1381 +0,0 @@ -/** - @file AnyVal.cpp - @author Morgan McGuire - @maintainer Morgan McGuire - @created 2006-06-11 - @edited 2008-07-14 - */ - -#include "G3D/AnyVal.h" -#include "G3D/Array.h" -#include "G3D/stringutils.h" -#include "G3D/Table.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" -#include "G3D/Matrix2.h" -#include "G3D/Matrix3.h" -#include "G3D/Matrix4.h" -#include "G3D/Rect2D.h" -#include "G3D/AABox.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Quat.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -AnyVal AnyVal::fromFile(const std::string& filename) { - TextInput t(filename); - return AnyVal(t); -} - - -void AnyVal::load(const std::string& filename) { - *this = fromFile(filename); -} - - -void AnyVal::save(const std::string& filename) const { - TextOutput t(filename); - serialize(t); - t.commit(); -} - - -AnyVal::AnyVal() : m_type(NIL), m_value(NULL), m_referenceCount(NULL) { -} - - -AnyVal::AnyVal(bool b) : m_type(BOOLEAN), m_value(new bool(b)), m_referenceCount(NULL) { -} - - -AnyVal::AnyVal(G3D::TextInput& t) : m_type(NIL), m_value(NULL), m_referenceCount(NULL) { - deserialize(t); -} - - -/*AnyVal::AnyVal(G3D::BinaryInput& b) { - deserialize(b); -} -*/ - -AnyVal::AnyVal(double v) : m_type(NUMBER), m_referenceCount(NULL) { - m_value = new double(v); -} - - -AnyVal::AnyVal(int v) : m_type(NUMBER), m_referenceCount(NULL) { - m_value = new double(v); -} - - -AnyVal::AnyVal(const Rect2D& v) : m_type(RECT2D), m_referenceCount(NULL) { - m_value = new Rect2D(v); -} - - -AnyVal::AnyVal(const AABox& v) : m_type(AABOX), m_referenceCount(NULL) { - m_value = new AABox(v); -} - - -AnyVal::AnyVal(const Vector2& v) : m_type(VECTOR2), m_referenceCount(NULL) { - m_value = new Vector2(v); -} - - -AnyVal::AnyVal(const Vector3& v) : m_type(VECTOR3), m_referenceCount(NULL) { - m_value = new Vector3(v); -} - - -AnyVal::AnyVal(const Vector4& v) : m_type(VECTOR4), m_referenceCount(NULL) { - m_value = new Vector4(v); -} - - -AnyVal::AnyVal(const Color1& v) : m_type(COLOR1), m_referenceCount(NULL) { - m_value = new Color1(v); -} - - -AnyVal::AnyVal(const Color3& v) : m_type(COLOR3), m_referenceCount(NULL) { - m_value = new Color3(v); -} - - -AnyVal::AnyVal(const Color4& v) : m_type(COLOR4), m_referenceCount(NULL) { - m_value = new Color4(v); -} - - -AnyVal::AnyVal(const std::string& v) : m_type(STRING), m_referenceCount(NULL) { - m_value = new std::string(v); -} - - -AnyVal::AnyVal(const char* v) : m_type(STRING), m_referenceCount(NULL) { - m_value = new std::string(v); -} - - -AnyVal::AnyVal(const Quat& v) : m_type(QUAT), m_referenceCount(NULL) { - m_value = new Quat(v); -} - - -AnyVal::AnyVal(const CoordinateFrame& v) : m_type(COORDINATEFRAME), m_referenceCount(NULL) { - m_value = new CoordinateFrame(v); -} - - -AnyVal::AnyVal(const Matrix2& v) : m_type(MATRIX2), m_referenceCount(NULL) { - m_value = new Matrix2(v); -} - -AnyVal::AnyVal(const Matrix3& v) : m_type(MATRIX3), m_referenceCount(NULL) { - m_value = new Matrix3(v); -} - - -AnyVal::AnyVal(const Matrix4& v) : m_type(MATRIX4), m_referenceCount(NULL) { - m_value = new Matrix4(v); -} - - -AnyVal::AnyVal(const AnyVal& c) : m_type(NIL), m_value(NULL), m_referenceCount(NULL) { - *this = c; -} - - -AnyVal::AnyVal(Type arrayOrTable) : m_type(NIL), m_value(NULL), m_referenceCount(new int(1)) { - // TODO: make AnyVal::createArray() - switch (arrayOrTable) { - case ARRAY: - m_type = ARRAY; - m_value = new Array(); - break; - - case TABLE: - m_type = TABLE; - m_value = new Table(); - break; - - default: - debugAssertM(false, "Cannot construct AnyVal from constants except ARRAY or TABLE."); - } -} - - -AnyVal::~AnyVal() { - deleteValue(); -} - - -void AnyVal::deleteValue() { - if (m_referenceCount) { - --(*m_referenceCount); - if (*m_referenceCount <= 0) { - delete m_referenceCount; - m_referenceCount = NULL; - // Pass through and delete the real object now - } else { - // Someone else is holding a reference, so we can't delete - // the object. - m_referenceCount = NULL; - return; - } - } - - switch (m_type) { - case NIL: - // Nothing to do - break; - - case NUMBER: - delete (double*)m_value; - break; - - case BOOLEAN: - delete (bool*)m_value; - break; - - case STRING: - delete (std::string*)m_value; - break; - - case RECT2D: - delete (Rect2D*)m_value; - break; - - case AABOX: - delete (AABox*)m_value; - break; - - case VECTOR2: - delete (Vector2*)m_value; - break; - - case VECTOR3: - delete (Vector3*)m_value; - break; - - case VECTOR4: - delete (Vector4*)m_value; - break; - - case MATRIX2: - delete (Matrix2*)m_value; - break; - - case MATRIX3: - delete (Matrix3*)m_value; - break; - - case MATRIX4: - delete (Matrix4*)m_value; - break; - - case QUAT: - delete (Quat*)m_value; - break; - - case COORDINATEFRAME: - delete (CoordinateFrame*)m_value; - break; - - case COLOR1: - delete (Color1*)m_value; - break; - - case COLOR3: - delete (Color3*)m_value; - break; - - case COLOR4: - delete (Color4*)m_value; - break; - - case ARRAY: - delete (Array*)m_value; - break; - - case TABLE: - delete (Table*)m_value; - break; - - default: - debugAssertM(false, "Internal error: no destructor for this type."); - } - - m_value = NULL; -} - - -AnyVal& AnyVal::operator=(const AnyVal& v) { - deleteValue(); - - m_type = v.m_type; - - m_referenceCount = v.m_referenceCount; - - if (isSharedType()) { - ++(*m_referenceCount); - m_value = v.m_value; - } else { - m_value = v.copyValue(); - } - - return *this; -} - - -void* AnyVal::copyValue() const { - switch (m_type) { - case NIL: - return NULL; - - case NUMBER: - return new double(*(double*)m_value); - - case BOOLEAN: - return new bool(*(bool*)m_value); - - case STRING: - return new std::string(*(std::string*)m_value); - - case RECT2D: - return new Rect2D(*(Rect2D*)m_value); - - case AABOX: - return new AABox(*(AABox*)m_value); - - case VECTOR2: - return new Vector2(*(Vector2*)m_value); - - case VECTOR3: - return new Vector3(*(Vector3*)m_value); - - case VECTOR4: - return new Vector4(*(Vector4*)m_value); - - case MATRIX2: - return new Matrix2(*(Matrix2*)m_value); - - case MATRIX3: - return new Matrix3(*(Matrix3*)m_value); - - case MATRIX4: - return new Matrix4(*(Matrix4*)m_value); - - case QUAT: - return new Quat(*(Quat*)m_value); - - case COORDINATEFRAME: - return new CoordinateFrame(*(CoordinateFrame*)m_value); - - case COLOR1: - return new Color1(*(Color1*)m_value); - - case COLOR3: - return new Color3(*(Color3*)m_value); - - case COLOR4: - return new Color4(*(Color4*)m_value); - - case ARRAY: - return new Array(*(Array*)m_value); - - case TABLE: - return new Table(*(Table*)m_value); - - default: - debugAssertM(false, "Internal error: no assignment operator for this type."); - return NULL; - } -} - -AnyVal::Type AnyVal::type() const { - return m_type; -} - - -static bool legalIdentifier(const std::string& s) { - if (s.size() == 0) { - return false; - } - - if (! isLetter(s[0]) || (s[0] == '_')) { - return false; - } - - bool ok = true; - - for (unsigned int i = 1; i < s.size(); ++i) { - ok &= isDigit(s[i]) || isLetter(s[i]) || (s[i] == '_'); - } - - return ok; -} - - -void AnyVal::serialize(G3D::TextOutput& t) const { - switch (m_type) { - case NIL: - t.writeSymbol("Nil"); - break; - - case NUMBER: - t.printf("%g", *(double*)m_value); - break; - - case BOOLEAN: - t.writeBoolean(*(bool*)m_value); - break; - - case STRING: - t.writeString(*(std::string*)m_value); - break; - - case RECT2D: - t.printf("R(%g, %g, %g, %g)", ((Rect2D*)m_value)->x0(), ((Rect2D*)m_value)->y0(), - ((Rect2D*)m_value)->width(), ((Rect2D*)m_value)->height()); - break; - - case AABOX: - t.printf("AAB(V3(%g, %g, %g), V3(%g, %g, %g))", - aabox().low().x, - aabox().low().y, - aabox().low().z, - aabox().high().x, - aabox().high().y, - aabox().high().z); - break; - - case VECTOR2: - t.printf("V2(%g, %g)", ((Vector2*)m_value)->x, ((Vector2*)m_value)->y); - break; - - case VECTOR3: - t.printf("V3(%g, %g, %g)", ((Vector3*)m_value)->x, ((Vector3*)m_value)->y, ((Vector3*)m_value)->z); - break; - - case VECTOR4: - t.printf("V4(%g, %g, %g, %g)", ((Vector4*)m_value)->x, ((Vector4*)m_value)->y, ((Vector4*)m_value)->z, ((Vector4*)m_value)->w); - break; - - case MATRIX2: - { - const Matrix2& m = *(Matrix2*)m_value; - t.printf("M2(\n"); - t.pushIndent(); - t.printf("%10.5f, %10.5f,\n%10.5f, %10.5f)", - m[0][0], m[0][1], - m[1][0], m[1][1]); - t.popIndent(); - } - break; - - case MATRIX3: - { - const Matrix3& m = *(Matrix3*)m_value; - t.printf("M3(\n"); - t.pushIndent(); - t.printf("%10.5f, %10.5f, %10.5f,\n%10.5f, %10.5f, %10.5f,\n%10.5f, %10.5f, %10.5f)", - m[0][0], m[0][1], m[0][2], - m[1][0], m[1][1], m[1][2], - m[2][0], m[2][1], m[2][2]); - t.popIndent(); - } - break; - - case MATRIX4: - { - const Matrix4& m = *(Matrix4*)m_value; - t.printf("M4(\n"); - t.pushIndent(); - t.printf( - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f)", - m[0][0], m[0][1], m[0][2], m[0][3], - m[1][0], m[1][1], m[1][2], m[1][3], - m[2][0], m[2][1], m[2][2], m[2][3], - m[3][0], m[3][1], m[3][2], m[3][3]); - t.popIndent(); - } - break; - - case QUAT: - t.printf("Q(%g, %g, %g, %g)", ((Quat*)m_value)->x, ((Quat*)m_value)->y, ((Quat*)m_value)->z, ((Quat*)m_value)->w); - break; - - case COORDINATEFRAME: - { - const CoordinateFrame& c = *(CoordinateFrame*)m_value; - float x,y,z,yaw,pitch,roll; - c.getXYZYPRDegrees(x,y,z,yaw,pitch,roll); - t.printf("CF(V3(%g,%g,%g), %g, %g, %g)", x, y, z, yaw, pitch, roll); - /* - t.pushIndent(); - t.printf( - "CF(\n%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f,\n" - "%10.5f, %10.5f, %10.5f, %10.5f)", - c.rotation[0][0], c.rotation[0][1], c.rotation[0][2], c.translation.x, - c.rotation[1][0], c.rotation[1][1], c.rotation[1][2], c.translation.y, - c.rotation[2][0], c.rotation[2][1], c.rotation[2][2], c.translation.z); - t.popIndent(); - */ - } - break; - - case COLOR1: - t.printf("C1(%g)", ((Color1*)m_value)->value); - break; - - case COLOR3: - t.printf("C3(%g, %g, %g)", ((Color3*)m_value)->r, ((Color3*)m_value)->g, ((Color3*)m_value)->b); - break; - - case COLOR4: - t.printf("C4(%g, %g, %g, %g)", ((Color4*)m_value)->r, ((Color4*)m_value)->g, ((Color4*)m_value)->b, ((Color4*)m_value)->a); - break; - - case ARRAY: - { - const Array& a = *(Array*)m_value; - t.printf("[\n"); - t.pushIndent(); - for (int i = 0; i < a.size(); ++i) { - a[i].serialize(t); - if (i != a.size() - 1) { - t.printf(", \n"); - } - } - t.printf("]"); - t.popIndent(); - } - break; - - case TABLE: - { - const Table& a = *(Table*)m_value; - t.printf("{\n"); - t.pushIndent(); - Table::Iterator i = a.begin(); - const Table::Iterator end = a.end(); - while (i != end) { - // Quote names that are not legal C++ identifiers - if (! legalIdentifier(i->key)) { - t.printf("'%s' ", i->key.c_str()); - } else { - t.writeSymbol(i->key); - } - t.printf("= "); - - i->value.serialize(t); - - if (i != end) { - t.printf("\n"); - } - ++i; - } - t.popIndent(); - t.printf("}"); - } - break; - - default: - debugAssertM(false, "Internal error: no serialize method for this type."); - } -} - - -std::string AnyVal::toString() const { - TextOutput t; - serialize(t); - std::string s; - t.commitString(s); - return s; -} - -/* -void AnyVal::serialize(G3D::BinaryOutput& t) const { - alwaysAssertM(false, "TODO"); -} -*/ - -void AnyVal::deserialize(G3D::TextInput& t) { - deleteValue(); - m_type = NIL; - m_value = NULL; - - if (! t.hasMore()) { - return; - } - - switch (t.peek().type()) { - case Token::END: - // should never get here because of the hasMore check above - return; - break; - - case Token::NUMBER: - m_type = NUMBER; - m_value = new double(t.readNumber()); - break; - - case Token::STRING: - m_type = STRING; - m_value = new std::string(t.readString()); - break; - - case Token::BOOLEAN: - m_type = BOOLEAN; - m_value = new bool(t.readBoolean()); - break; - - case Token::SYMBOL: - { - std::string s = t.readSymbol(); - if (s == "NIL") { - break; - - } else if (s == "true") { - - m_type = BOOLEAN; - m_value = new bool(true); - - } else if (s == "false") { - - m_type = BOOLEAN; - m_value = new bool(false); - - } else if (s == "R") { - - m_type = RECT2D; - t.readSymbol("("); - float x,y,w,h; - x = (float)t.readNumber(); - t.readSymbol(","); - y = (float)t.readNumber(); - t.readSymbol(","); - w = (float)t.readNumber(); - t.readSymbol(","); - h = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Rect2D(Rect2D::xywh(x, y, w, h)); - - } else if (s == "AAB") { - - m_type = AABOX; - Vector3 v[2]; - t.readSymbol("("); - for (int i = 0; i < 2; ++i) { - t.readSymbols("V3", "("); - v[i].x = (float)t.readNumber(); - t.readSymbol(","); - v[i].y = (float)t.readNumber(); - t.readSymbol(","); - v[i].z = (float)t.readNumber(); - t.readSymbol(","); - if (i == 0) { - t.readSymbol(","); - } - } - t.readSymbol(")"); - m_value = new AABox(v[0], v[1]); - - } else if (s == "V2") { - - t.readSymbol("("); - Vector2 v; - v.x = (float)t.readNumber(); - t.readSymbol(","); - v.y = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Vector2(v); - m_type = VECTOR2; - - } else if (s == "V3") { - - t.readSymbol("("); - Vector3 v; - v.x = (float)t.readNumber(); - t.readSymbol(","); - v.y = (float)t.readNumber(); - t.readSymbol(","); - v.z = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Vector3(v); - m_type = VECTOR3; - - } else if (s == "V4") { - - t.readSymbol("("); - Vector4 v; - v.x = (float)t.readNumber(); - t.readSymbol(","); - v.y = (float)t.readNumber(); - t.readSymbol(","); - v.z = (float)t.readNumber(); - t.readSymbol(","); - v.w = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Vector4(v); - m_type = VECTOR4; - - } else if (s == "M2") { - - t.readSymbol("("); - Matrix2 m; - for (int r = 0; r < 2; ++r) { - for (int c = 0; c < 2; ++c) { - m[r][c] = (float)t.readNumber(); - if ((c != 1) || (r != 1)) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new Matrix2(m); - m_type = MATRIX2; - - } else if (s == "M3") { - - t.readSymbol("("); - Matrix3 m; - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - m[r][c] = (float)t.readNumber(); - if ((c != 2) || (r != 2)) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new Matrix3(m); - m_type = MATRIX3; - - } else if (s == "M4") { - - t.readSymbol("("); - Matrix4 m; - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - m[r][c] = (float)t.readNumber(); - if ((c != 3) || (r != 3)) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new Matrix4(m); - m_type = MATRIX4; - - } else if (s == "Q") { - - t.readSymbol("("); - Quat q; - q.x = (float)t.readNumber(); - t.readSymbol(","); - q.y = (float)t.readNumber(); - t.readSymbol(","); - q.z = (float)t.readNumber(); - t.readSymbol(","); - q.w = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Quat(q); - m_type = QUAT; - - } else if (s == "CF") { - - t.readSymbol("("); - CoordinateFrame m; - if (t.peek().type() == Token::SYMBOL) { - // Angle format - float x, y, z, yaw, roll, pitch; - t.readSymbols("V3", "("); - x = (float)t.readNumber(); - t.readSymbol(","); - y = (float)t.readNumber(); - t.readSymbol(","); - z = (float)t.readNumber(); - t.readSymbols(")", ","); - yaw = (float)t.readNumber(); - t.readSymbol(","); - pitch = (float)t.readNumber(); - roll = 0; - if (t.peek().string() == ",") { - t.readSymbol(","); - roll = (float)t.readNumber(); - } - m = CoordinateFrame::fromXYZYPRDegrees(x, y, z, yaw, pitch, roll); - } else { - // Matrix format - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - m.rotation[r][c] = (float)t.readNumber(); - } - m.translation[r] = (float)t.readNumber(); - if (r != 2) { - t.readSymbol(","); - } - } - } - t.readSymbol(")"); - m_value = new CoordinateFrame(m); - m_type = COORDINATEFRAME; - - } else if (s == "C1") { - - t.readSymbol("("); - float v = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Color1(v); - m_type = COLOR1; - - } else if (s == "C3") { - - t.readSymbol("("); - Color3 c; - c.r = (float)t.readNumber(); - t.readSymbol(","); - c.g = (float)t.readNumber(); - t.readSymbol(","); - c.b = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Color3(c); - m_type = COLOR3; - - } else if (s == "C4") { - - t.readSymbol("("); - Color4 c; - c.r = (float)t.readNumber(); - t.readSymbol(","); - c.g = (float)t.readNumber(); - t.readSymbol(","); - c.b = (float)t.readNumber(); - t.readSymbol(","); - c.a = (float)t.readNumber(); - t.readSymbol(")"); - m_value = new Color4(c); - m_type = COLOR4; - - } else if (s == "[") { - - // Array - m_type = ARRAY; - m_value = new Array(); - m_referenceCount = new int(1); - Array& a = *(Array*)m_value; - - Token peek = t.peek(); - while ((peek.type() != Token::SYMBOL) || (peek.string() != "]")) { - // Avoid copying large objects - a.next().deserialize(t); - - peek = t.peek(); - if (peek.type() != Token::SYMBOL) { - throw CorruptText("Expected ',' or ']'", peek); - } else if (peek.string() == ",") { - t.readSymbol(","); - } else if (peek.string() != "]") { - throw CorruptText("Missing ']'", peek); - } - } - t.readSymbol("]"); - - } else if (s == "{") { - - // Table - m_type = TABLE; - m_value = new Table(); - m_referenceCount = new int(1); - Table& a = *(Table*)m_value; - - Token peek = t.peek(); - while ((peek.type() != Token::SYMBOL) || (peek.string() != "}")) { - - std::string key; - // Get the name - if (peek.type() == Token::SYMBOL) { - key = t.readSymbol(); - } else if (peek.extendedType() == Token::SINGLE_QUOTED_TYPE) { - key = t.readString(); - } else { - throw CorruptText("Expected name inside table", peek); - } - - t.readSymbol("="); - - // Avoid copying large values - a.set(key, AnyVal()); - a[key].deserialize(t); - - peek = t.peek(); - if ((peek.type() != Token::SYMBOL) && (peek.extendedType() == Token::SINGLE_QUOTED_TYPE)) { - throw CorruptText("Missing expected name or '}'", peek); - } - } - t.readSymbol("}"); - - } else { - throw CorruptText("Invalid value type.", t.peek()); - } // dispatch on symbol type - } // scope - break; - } -} - -/* -void AnyVal::deserialize(G3D::BinaryInput& t) { - alwaysAssertM(false, "TODO"); -} -*/ - - -AnyVal& AnyVal::operator[](const char* key) { - return this->operator[]((std::string)key); -} - - -const AnyVal& AnyVal::operator[](const char* key) const { - return this->operator[]((std::string)key); -} - - -AnyVal& AnyVal::operator[](const std::string& key) { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - makeMutable(); - - Table& t = *(Table*)m_value; - - if (! t.containsKey(key)) { - t.set(key, AnyVal()); - } - - return t[key]; -} - - -const AnyVal& AnyVal::operator[](const std::string& key) const { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - const Table& t = *(const Table*)m_value; - - if (! t.containsKey(key)) { - throw KeyNotFound(key); - } - - return t[key]; -} - - -void AnyVal::append(const AnyVal& v) { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - makeMutable(); - - Array& a = *(Array*)m_value; - a.append(v); -} - - -void AnyVal::getKeys(Array& keys) const { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - const Table& t = *(const Table*)m_value; - t.getKeys(keys); -} - - -int AnyVal::size() const { - switch (m_type) { - case TABLE: - { - const Table& t = *(const Table*)m_value; - return t.size(); - } - - case ARRAY: - { - const Array& a = *(Array*)m_value; - return a.size(); - } - - default: - throw WrongType(ARRAY, m_type); - } -} - - -AnyVal& AnyVal::operator[](int i) { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - makeMutable(); - - Array& a = *(Array*)m_value; - - if (i < 0) { - throw IndexOutOfBounds(i, a.size()); - } - - if (a.size() <= i) { - a.resize(i + 1); - } - - return a[i]; -} - - -const AnyVal& AnyVal::operator[](int i) const { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - - const Array& a = *(Array*)m_value; - - if (a.size() <= i || i < 0) { - throw IndexOutOfBounds(i, a.size()); - } - - return a[i]; -} - - -void AnyVal::makeMutable() { - if (*m_referenceCount > 1) { - // This is a shared instance - --(*m_referenceCount); - m_referenceCount = new int(1); - m_value = copyValue(); - } -} - -bool AnyVal::boolean() const { - if (m_type != BOOLEAN) { - throw WrongType(BOOLEAN, m_type); - } - - return *(bool*)m_value; -} - - -bool AnyVal::boolean(bool defaultVal) const { - if (m_type != BOOLEAN) { - return defaultVal; - } - - return *(bool*)m_value; -} - - -const std::string& AnyVal::string() const { - if (m_type != STRING) { - throw WrongType(STRING, m_type); - } - - return *(std::string*)m_value; -} - - -const std::string& AnyVal::string(const std::string& defaultVal) const { - if (m_type != STRING) { - return defaultVal; - } else { - return *(std::string*)m_value; - } -} - - -double AnyVal::number() const { - if (m_type != NUMBER) { - throw WrongType(NUMBER, m_type); - } - - return *(double*)m_value; -} - - -double AnyVal::number(double defaultVal) const { - if (m_type != NUMBER) { - return defaultVal; - } else { - return *(double*)m_value; - } -} - - -const Rect2D& AnyVal::rect2D() const { - if (m_type != RECT2D) { - throw WrongType(RECT2D, m_type); - } - - return *(Rect2D*)m_value; -} - - -const Rect2D& AnyVal::rect2D(const Rect2D& defaultVal) const { - if (m_type != RECT2D) { - return defaultVal; - } else { - return *(Rect2D*)m_value; - } -} - - -const AABox& AnyVal::aabox() const { - if (m_type != AABOX) { - throw WrongType(AABOX, m_type); - } - - return *(AABox*)m_value; -} - - -const AABox& AnyVal::aabox(const AABox& defaultVal) const { - if (m_type != AABOX) { - return defaultVal; - } else { - return *(AABox*)m_value; - } -} - - -const Color1& AnyVal::color1() const { - if (m_type != COLOR1) { - throw WrongType(COLOR1, m_type); - } - - return *(Color1*)m_value; -} - - -const Color1& AnyVal::color1(const Color1& defaultVal) const { - if (m_type != COLOR1) { - return defaultVal; - } else { - return *(Color1*)m_value; - } -} - - -const Color3& AnyVal::color3() const { - if (m_type != COLOR3) { - throw WrongType(COLOR3, m_type); - } - - return *(Color3*)m_value; -} - - -const Color3& AnyVal::color3(const Color3& defaultVal) const { - if (m_type != COLOR3) { - return defaultVal; - } else { - return *(Color3*)m_value; - } -} - - -const Color4& AnyVal::color4() const { - if (m_type != COLOR4) { - throw WrongType(COLOR4, m_type); - } - - return *(Color4*)m_value; -} - - -const Color4& AnyVal::color4(const Color4& defaultVal) const { - if (m_type != COLOR4) { - return defaultVal; - } else { - return *(Color4*)m_value; - } -} - - -const Vector2& AnyVal::vector2() const { - if (m_type != VECTOR2) { - throw WrongType(VECTOR2, m_type); - } - - return *(Vector2*)m_value; -} - - -const Vector2& AnyVal::vector2(const Vector2& defaultVal) const { - if (m_type != VECTOR2) { - return defaultVal; - } else { - return *(Vector2*)m_value; - } -} - - -const Vector3& AnyVal::vector3() const { - if (m_type != VECTOR3) { - throw WrongType(VECTOR3, m_type); - } - - return *(Vector3*)m_value; -} - - -const Vector3& AnyVal::vector3(const Vector3& defaultVal) const { - if (m_type != VECTOR3) { - return defaultVal; - } else { - return *(Vector3*)m_value; - } -} - - -const Vector4& AnyVal::vector4() const { - if (m_type != VECTOR4) { - throw WrongType(VECTOR4, m_type); - } - - return *(Vector4*)m_value; -} - - -const Vector4& AnyVal::vector4(const Vector4& defaultVal) const { - if (m_type != VECTOR4) { - return defaultVal; - } else { - return *(Vector4*)m_value; - } -} - - -const CoordinateFrame& AnyVal::coordinateFrame() const { - if (m_type != COORDINATEFRAME) { - throw WrongType(COORDINATEFRAME, m_type); - } - - return *(CoordinateFrame*)m_value; -} - - -const CoordinateFrame& AnyVal::coordinateFrame(const CoordinateFrame& defaultVal) const { - if (m_type != COORDINATEFRAME) { - return defaultVal; - } else { - return *(CoordinateFrame*)m_value; - } -} - -const Matrix2& AnyVal::matrix2(const Matrix2& defaultVal) const { - if (m_type != MATRIX2) { - return defaultVal; - } else { - return *(Matrix2*)m_value; - } -} - - -const Matrix2& AnyVal::matrix2() const { - if (m_type != MATRIX2) { - throw WrongType(MATRIX2, m_type); - } - - return *(Matrix2*)m_value; -} - - -const Matrix3& AnyVal::matrix3(const Matrix3& defaultVal) const { - if (m_type != MATRIX3) { - return defaultVal; - } else { - return *(Matrix3*)m_value; - } -} - - -const Matrix3& AnyVal::matrix3() const { - if (m_type != MATRIX3) { - throw WrongType(MATRIX3, m_type); - } - - return *(Matrix3*)m_value; -} - - -const Matrix4& AnyVal::matrix4(const Matrix4& defaultVal) const { - if (m_type != MATRIX4) { - return defaultVal; - } else { - return *(Matrix4*)m_value; - } -} - - -const Matrix4& AnyVal::matrix4() const { - if (m_type != MATRIX4) { - throw WrongType(MATRIX4, m_type); - } - - return *(Matrix4*)m_value; -} - - -const Quat& AnyVal::quat(const Quat& defaultVal) const { - if (m_type != QUAT) { - return defaultVal; - } else { - return *(Quat*)m_value; - } -} - - -const Quat& AnyVal::quat() const { - if (m_type != QUAT) { - throw WrongType(QUAT, m_type); - } - - return *(Quat*)m_value; -} - - -const AnyVal& AnyVal::get(const std::string& key, const AnyVal& defaultVal) const { - if (m_type != TABLE) { - return defaultVal; - } - - const Table& t = *(const Table*)m_value; - - if (t.containsKey(key)) { - return t[key]; - } else { - return defaultVal; - } -} - - -const AnyVal& AnyVal::get(const std::string& key) const { - if (m_type != TABLE) { - throw WrongType(TABLE, m_type); - } - - const Table& t = *(const Table*)m_value; - - if (t.containsKey(key)) { - return t[key]; - } else { - throw KeyNotFound(key); - } -} - - -const AnyVal& AnyVal::get(int i, const AnyVal& defaultVal) const { - if (m_type != ARRAY) { - return defaultVal; - } - - const Array& a = *(const Array*)m_value; - - if ((i >= 0) && (i < a.size())) { - return a[i]; - } else { - return defaultVal; - } -} - - -const AnyVal& AnyVal::get(int i) const { - if (m_type != ARRAY) { - throw WrongType(ARRAY, m_type); - } - - const Array& a = *(const Array*)m_value; - - if ((i >= 0) && (i < a.size())) { - return a[i]; - } else { - throw IndexOutOfBounds(i, a.size()); - } -} - -} diff --git a/externals/g3dlite/G3D.lib/source/BinaryFormat.cpp b/externals/g3dlite/G3D.lib/source/BinaryFormat.cpp deleted file mode 100644 index a30ec0644ea..00000000000 --- a/externals/g3dlite/G3D.lib/source/BinaryFormat.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/** - @file BinaryFormat.cpp - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2005-06-10 - @edited 2005-06-10 - */ - -#include "G3D/BinaryFormat.h" - -namespace G3D { - -int32 byteSize(BinaryFormat f) { - switch (f) { - case BOOL8_BINFMT: - case UINT8_BINFMT: - case INT8_BINFMT: - return 1; - - case UINT16_BINFMT: - case INT16_BINFMT: - return 2; - - case FLOAT16_BINFMT: - return 2; - - case UINT32_BINFMT: - case INT32_BINFMT: - case FLOAT32_BINFMT: - return 4; - - case FLOAT64_BINFMT: - case UINT64_BINFMT: - case INT64_BINFMT: - return 8; - - case INT128_BINFMT: - case UINT128_BINFMT: - return 16; - - case VECTOR2_BINFMT: - return 2 * 4; - - case VECTOR2INT16_BINFMT: - return 2 * 2; - - case VECTOR3_BINFMT: - return 3 * 4; - - case VECTOR3INT16_BINFMT: - return 3 * 2; - - case VECTOR4_BINFMT: - return 4 * 4; - - case VECTOR4INT16_BINFMT: - return 4 * 4; - - case COLOR3_BINFMT: - return 3 * 4; - - case COLOR3UINT8_BINFMT: - return 3 * 1; - - case COLOR3INT16_BINFMT: - return 3 * 2; - - case COLOR4_BINFMT: - return 4 * 4; - - case COLOR4UINT8_BINFMT: - return 4 * 1; - - case COLOR4INT16_BINFMT: - return 4 * 2; - - default: - return -1; - } -} -} diff --git a/externals/g3dlite/G3D.lib/source/BinaryInput.cpp b/externals/g3dlite/G3D.lib/source/BinaryInput.cpp deleted file mode 100644 index 65a9976fe04..00000000000 --- a/externals/g3dlite/G3D.lib/source/BinaryInput.cpp +++ /dev/null @@ -1,568 +0,0 @@ -/** - @file BinaryInput.cpp - - @author Morgan McGuire, graphics3d.com - Copyright 2001-2007, Morgan McGuire. All rights reserved. - - @created 2001-08-09 - @edited 2005-02-24 - - -

-    {    
-    BinaryOutput b("c:/tmp/test.b", BinaryOutput::LITTLE_ENDIAN);
-
-    float f = 3.1415926;
-    int i = 1027221;
-    std::string s = "Hello World!";
-
-    b.writeFloat32(f);
-    b.writeInt32(i);
-    b.writeString(s);
-    b.commit();
-    
-
-    BinaryInput in("c:/tmp/test.b", BinaryInput::LITTLE_ENDIAN);
-
-    debugAssert(f == in.readFloat32());
-    int ii = in.readInt32();
-    debugAssert(i == ii);
-    debugAssert(s == in.readString());
-    }
-  
- */ - -#include "G3D/platform.h" -#include "G3D/BinaryInput.h" -#include "G3D/Array.h" -#include "G3D/fileutils.h" -#include "G3D/Log.h" -#include - -#include - -namespace G3D { - -void BinaryInput::readBool8(std::vector& out, int64 n) { - out.resize((int)n); - // std::vector optimizes bool in a way that prevents fast reading - for (int64 i = 0; i < n ; ++i) { - out[i] = readBool8(); - } -} - - -void BinaryInput::readBool8(Array& out, int64 n) { - out.resize(n); - readBool8(out.begin(), n); -} - - -#define IMPLEMENT_READER(ucase, lcase)\ -void BinaryInput::read##ucase(std::vector& out, int64 n) {\ - out.resize(n);\ - read##ucase(&out[0], n);\ -}\ -\ -\ -void BinaryInput::read##ucase(Array& out, int64 n) {\ - out.resize(n);\ - read##ucase(out.begin(), n);\ -} - - -IMPLEMENT_READER(UInt8, uint8) -IMPLEMENT_READER(Int8, int8) -IMPLEMENT_READER(UInt16, uint16) -IMPLEMENT_READER(Int16, int16) -IMPLEMENT_READER(UInt32, uint32) -IMPLEMENT_READER(Int32, int32) -IMPLEMENT_READER(UInt64, uint64) -IMPLEMENT_READER(Int64, int64) -IMPLEMENT_READER(Float32, float32) -IMPLEMENT_READER(Float64, float64) - -#undef IMPLEMENT_READER - -// Data structures that are one byte per element can be -// directly copied, regardles of endian-ness. -#define IMPLEMENT_READER(ucase, lcase)\ -void BinaryInput::read##ucase(lcase* out, int64 n) {\ - if (sizeof(lcase) == 1) {\ - readBytes(out, n);\ - } else {\ - for (int64 i = 0; i < n ; ++i) {\ - out[i] = read##ucase();\ - }\ - }\ -} - -IMPLEMENT_READER(Bool8, bool) -IMPLEMENT_READER(UInt8, uint8) -IMPLEMENT_READER(Int8, int8) - -#undef IMPLEMENT_READER - - -#define IMPLEMENT_READER(ucase, lcase)\ -void BinaryInput::read##ucase(lcase* out, int64 n) {\ - if (m_swapBytes) {\ - for (int64 i = 0; i < n; ++i) {\ - out[i] = read##ucase();\ - }\ - } else {\ - readBytes(out, sizeof(lcase) * n);\ - }\ -} - - -IMPLEMENT_READER(UInt16, uint16) -IMPLEMENT_READER(Int16, int16) -IMPLEMENT_READER(UInt32, uint32) -IMPLEMENT_READER(Int32, int32) -IMPLEMENT_READER(UInt64, uint64) -IMPLEMENT_READER(Int64, int64) -IMPLEMENT_READER(Float32, float32) -IMPLEMENT_READER(Float64, float64) - -#undef IMPLEMENT_READER - -void BinaryInput::loadIntoMemory(int64 startPosition, int64 minLength) { - // Load the next section of the file - debugAssertM(m_filename != "", "Read past end of file."); - - int64 absPos = m_alreadyRead + m_pos; - - if (m_bufferLength < minLength) { - // The current buffer isn't big enough to hold the chunk we want to read. - // This happens if there was little memory available during the initial constructor - // read but more memory has since been freed. - m_bufferLength = minLength; - debugAssert(m_freeBuffer); - m_buffer = (uint8*)System::realloc(m_buffer, m_bufferLength); - if (m_buffer == NULL) { - throw "Tried to read a larger memory chunk than could fit in memory. (2)"; - } - } - - m_alreadyRead = startPosition; - -# ifdef G3D_WIN32 - FILE* file = fopen(m_filename.c_str(), "rb"); - debugAssert(file); - int ret = fseek(file, (off_t)m_alreadyRead, SEEK_SET); - debugAssert(ret == 0); - size_t toRead = (size_t)G3D::min(m_bufferLength, m_length - m_alreadyRead); - ret = fread(m_buffer, 1, toRead, file); - debugAssert(ret == toRead); - fclose(file); - file = NULL; - -# else - FILE* file = fopen(m_filename.c_str(), "rb"); - debugAssert(file); - int ret = fseeko(file, (off_t)m_alreadyRead, SEEK_SET); - debugAssert(ret == 0); - size_t toRead = (size_t)G3D::min(m_bufferLength, m_length - m_alreadyRead); - ret = fread(m_buffer, 1, toRead, file); - debugAssert((size_t)ret == (size_t)toRead); - fclose(file); - file = NULL; -# endif - - m_pos = absPos - m_alreadyRead; - debugAssert(m_pos >= 0); -} - - - -const bool BinaryInput::NO_COPY = false; - -static bool needSwapBytes(G3DEndian fileEndian) { - return (fileEndian != System::machineEndian()); -} - - -/** Helper used by the constructors for decompression */ -static uint32 readUInt32(const uint8* data, bool swapBytes) { - if (swapBytes) { - uint8 out[4]; - out[0] = data[3]; - out[1] = data[2]; - out[2] = data[1]; - out[3] = data[0]; - return *((uint32*)out); - } else { - return *((uint32*)data); - } -} - - -void BinaryInput::setEndian(G3DEndian e) { - m_fileEndian = e; - m_swapBytes = needSwapBytes(m_fileEndian); -} - - -BinaryInput::BinaryInput( - const uint8* data, - int64 dataLen, - G3DEndian dataEndian, - bool compressed, - bool copyMemory) : - m_filename(""), - m_bitPos(0), - m_bitString(0), - m_beginEndBits(0), - m_alreadyRead(0), - m_bufferLength(0), - m_pos(0) { - - m_freeBuffer = copyMemory || compressed; - - setEndian(dataEndian); - - if (compressed) { - // Read the decompressed size from the first 4 bytes - m_length = G3D::readUInt32(data, m_swapBytes); - - debugAssert(m_freeBuffer); - m_buffer = (uint8*)System::alignedMalloc(m_length, 16); - - unsigned long L = m_length; - // Decompress with zlib - int64 result = uncompress(m_buffer, (unsigned long*)&L, data + 4, dataLen - 4); - m_length = L; - m_bufferLength = L; - debugAssert(result == Z_OK); (void)result; - - } else { - m_length = dataLen; - m_bufferLength = m_length; - if (! copyMemory) { - debugAssert(!m_freeBuffer); - m_buffer = const_cast(data); - } else { - debugAssert(m_freeBuffer); - m_buffer = (uint8*)System::alignedMalloc(m_length, 16); - System::memcpy(m_buffer, data, dataLen); - } - } -} - - -BinaryInput::BinaryInput( - const std::string& filename, - G3DEndian fileEndian, - bool compressed) : - m_filename(filename), - m_bitPos(0), - m_bitString(0), - m_beginEndBits(0), - m_alreadyRead(0), - m_length(0), - m_bufferLength(0), - m_buffer(NULL), - m_pos(0), - m_freeBuffer(true) { - - setEndian(fileEndian); - - // Update global file tracker - _internal::currentFilesUsed.insert(m_filename); - - - if (! fileExists(m_filename, false)) { - std::string zipfile; - std::string internalfile; - if (zipfileExists(m_filename, zipfile, internalfile)) { - // Load from zipfile - void* v; - size_t s; - zipRead(filename, v, s); - m_buffer = reinterpret_cast(v); - m_bufferLength = m_length = s; - if (compressed) { - decompress(); - } - m_freeBuffer = true; - } else { - Log::common()->printf("Warning: File not found: %s\n", m_filename.c_str()); - } - return; - } - - // Figure out how big the file is and verify that it exists. - m_length = fileLength(m_filename); - - // Read the file into memory - FILE* file = fopen(m_filename.c_str(), "rb"); - - if (! file || (m_length == -1)) { - throw format("File not found: \"%s\"", m_filename.c_str()); - return; - } - - if (! compressed && (m_length > INITIAL_BUFFER_LENGTH)) { - // Read only a subset of the file so we don't consume - // all available memory. - m_bufferLength = INITIAL_BUFFER_LENGTH; - } else { - // Either the length is fine or the file is compressed - // and requires us to read the whole thing for zlib. - m_bufferLength = m_length; - } - - debugAssert(m_freeBuffer); - m_buffer = (uint8*)System::alignedMalloc(m_bufferLength, 16); - if (m_buffer == NULL) { - if (compressed) { - throw "Not enough memory to load compressed file. (1)"; - } - - // Try to allocate a small array; not much memory is available. - // Give up if we can't allocate even 1k. - while ((m_buffer == NULL) && (m_bufferLength > 1024)) { - m_bufferLength /= 2; - m_buffer = (uint8*)System::alignedMalloc(m_bufferLength, 16); - } - } - debugAssert(m_buffer); - - fread(m_buffer, m_bufferLength, sizeof(int8), file); - fclose(file); - file = NULL; - - if (compressed) { - if (m_bufferLength != m_length) { - throw "Not enough memory to load compressed file. (2)"; - } - - decompress(); - } -} - -void BinaryInput::decompress() { - // Decompress - // Use the existing buffer as the source, allocate - // a new buffer to use as the destination. - - int64 tempLength = m_length; - m_length = G3D::readUInt32(m_buffer, m_swapBytes); - - // The file couldn't have better than 500:1 compression - alwaysAssertM(m_length < m_bufferLength * 500, "Compressed file header is corrupted"); - - uint8* tempBuffer = m_buffer; - m_buffer = (uint8*)System::alignedMalloc(m_length, 16); - - debugAssert(m_buffer); - debugAssert(isValidHeapPointer(tempBuffer)); - debugAssert(isValidHeapPointer(m_buffer)); - - unsigned long L = m_length; - int64 result = uncompress(m_buffer, &L, tempBuffer + 4, tempLength - 4); - m_length = L; - m_bufferLength = m_length; - - debugAssertM(result == Z_OK, "BinaryInput/zlib detected corruption in " + m_filename); - (void)result; - - System::alignedFree(tempBuffer); -} - - -void BinaryInput::readBytes(void* bytes, int64 n) { - prepareToRead(n); - debugAssert(isValidPointer(bytes)); - - memcpy(bytes, m_buffer + m_pos, n); - m_pos += n; -} - - -BinaryInput::~BinaryInput() { - - if (m_freeBuffer) { - System::alignedFree(m_buffer); - } - m_buffer = NULL; -} - - -uint64 BinaryInput::readUInt64() { - prepareToRead(8); - uint8 out[8]; - - if (m_swapBytes) { - out[0] = m_buffer[m_pos + 7]; - out[1] = m_buffer[m_pos + 6]; - out[2] = m_buffer[m_pos + 5]; - out[3] = m_buffer[m_pos + 4]; - out[4] = m_buffer[m_pos + 3]; - out[5] = m_buffer[m_pos + 2]; - out[6] = m_buffer[m_pos + 1]; - out[7] = m_buffer[m_pos + 0]; - } else { - *(uint64*)out = *(uint64*)(m_buffer + m_pos); - } - - m_pos += 8; - return *(uint64*)out; -} - - -std::string BinaryInput::readString(int64 n) { - prepareToRead(n); - debugAssertM((m_pos + n) <= m_length, "Read past end of file"); - - char *s = (char*)System::alignedMalloc(n + 1, 16); - assert(s != NULL); - - memcpy(s, m_buffer + m_pos, n); - // There may not be a null, so make sure - // we add one. - s[n] = '\0'; - - std::string out = s; - System::alignedFree(s); - s = NULL; - - m_pos += n; - - return out; - -} - - -std::string BinaryInput::readString() { - int64 n = 0; - - if ((m_pos + m_alreadyRead + n) < (m_length - 1)) { - prepareToRead(1); - } - - if ( ((m_pos + m_alreadyRead + n) < (m_length - 1)) && - (m_buffer[m_pos + n] != '\0')) { - - ++n; - while ( ((m_pos + m_alreadyRead + n) < (m_length - 1)) && - (m_buffer[m_pos + n] != '\0')) { - - prepareToRead(1); - ++n; - } - } - - // Consume NULL - ++n; - - return readString(n); -} - - -std::string BinaryInput::readStringEven() { - std::string x = readString(); - if (hasMore() && (G3D::isOdd(x.length() + 1))) { - skip(1); - } - return x; -} - - -std::string BinaryInput::readString32() { - int len = readUInt32(); - return readString(len); -} - - -Vector4 BinaryInput::readVector4() { - float x = readFloat32(); - float y = readFloat32(); - float z = readFloat32(); - float w = readFloat32(); - return Vector4(x, y, z, w); -} - - -Vector3 BinaryInput::readVector3() { - float x = readFloat32(); - float y = readFloat32(); - float z = readFloat32(); - return Vector3(x, y, z); -} - - -Vector2 BinaryInput::readVector2() { - float x = readFloat32(); - float y = readFloat32(); - return Vector2(x, y); -} - - -Color4 BinaryInput::readColor4() { - float r = readFloat32(); - float g = readFloat32(); - float b = readFloat32(); - float a = readFloat32(); - return Color4(r, g, b, a); -} - - -Color3 BinaryInput::readColor3() { - float r = readFloat32(); - float g = readFloat32(); - float b = readFloat32(); - return Color3(r, g, b); -} - - -void BinaryInput::beginBits() { - debugAssert(m_beginEndBits == 0); - m_beginEndBits = 1; - m_bitPos = 0; - - debugAssertM(hasMore(), "Can't call beginBits when at the end of a file"); - m_bitString = readUInt8(); -} - - -uint32 BinaryInput::readBits(int numBits) { - debugAssert(m_beginEndBits == 1); - - uint32 out = 0; - - const int total = numBits; - while (numBits > 0) { - if (m_bitPos > 7) { - // Consume a new byte for reading. We do this at the beginning - // of the loop so that we don't try to read past the end of the file. - m_bitPos = 0; - m_bitString = readUInt8(); - } - - // Slide the lowest bit of the bitString into - // the correct position. - out |= (m_bitString & 1) << (total - numBits); - - // Shift over to the next bit - m_bitString = m_bitString >> 1; - ++m_bitPos; - --numBits; - } - - return out; -} - - -void BinaryInput::endBits() { - debugAssert(m_beginEndBits == 1); - if (m_bitPos == 0) { - // Put back the last byte we read - --m_pos; - } - m_beginEndBits = 0; - m_bitPos = 0; -} - -} diff --git a/externals/g3dlite/G3D.lib/source/BinaryOutput.cpp b/externals/g3dlite/G3D.lib/source/BinaryOutput.cpp deleted file mode 100644 index 8fcc30e548f..00000000000 --- a/externals/g3dlite/G3D.lib/source/BinaryOutput.cpp +++ /dev/null @@ -1,518 +0,0 @@ -/** - @file BinaryOutput.cpp - - @author Morgan McGuire, graphics3d.com - Copyright 2002-2007, Morgan McGuire, All rights reserved. - - @created 2002-02-20 - @edited 2008-01-07 - */ - -#include "G3D/platform.h" -#include "G3D/BinaryOutput.h" -#include "G3D/fileutils.h" -#include "G3D/stringutils.h" -#include "G3D/Array.h" -#include - -#include - -// Largest memory buffer that the system will use for writing to -// disk. After this (or if the system runs out of memory) -// chunks of the file will be dumped to disk. -// -// Currently 400 MB -#define MAX_BINARYOUTPUT_BUFFER_SIZE 400000000 - -namespace G3D { - -void BinaryOutput::writeBool8(const std::vector& out, int n) { - for (int i = 0; i < n; ++i) { - writeBool8(out[i]); - } -} - - -void BinaryOutput::writeBool8(const Array& out, int n) { - writeBool8(out.getCArray(), n); -} - -#define IMPLEMENT_WRITER(ucase, lcase)\ -void BinaryOutput::write##ucase(const std::vector& out, int n) {\ - write##ucase(&out[0], n);\ -}\ -\ -\ -void BinaryOutput::write##ucase(const Array& out, int n) {\ - write##ucase(out.getCArray(), n);\ -} - - -IMPLEMENT_WRITER(UInt8, uint8) -IMPLEMENT_WRITER(Int8, int8) -IMPLEMENT_WRITER(UInt16, uint16) -IMPLEMENT_WRITER(Int16, int16) -IMPLEMENT_WRITER(UInt32, uint32) -IMPLEMENT_WRITER(Int32, int32) -IMPLEMENT_WRITER(UInt64, uint64) -IMPLEMENT_WRITER(Int64, int64) -IMPLEMENT_WRITER(Float32, float32) -IMPLEMENT_WRITER(Float64, float64) - -#undef IMPLEMENT_WRITER - -// Data structures that are one byte per element can be -// directly copied, regardles of endian-ness. -#define IMPLEMENT_WRITER(ucase, lcase)\ -void BinaryOutput::write##ucase(const lcase* out, int n) {\ - if (sizeof(lcase) == 1) {\ - writeBytes((void*)out, n);\ - } else {\ - for (int i = 0; i < n ; ++i) {\ - write##ucase(out[i]);\ - }\ - }\ -} - -IMPLEMENT_WRITER(Bool8, bool) -IMPLEMENT_WRITER(UInt8, uint8) -IMPLEMENT_WRITER(Int8, int8) - -#undef IMPLEMENT_WRITER - - -#define IMPLEMENT_WRITER(ucase, lcase)\ -void BinaryOutput::write##ucase(const lcase* out, int n) {\ - if (m_swapBytes) {\ - for (int i = 0; i < n; ++i) {\ - write##ucase(out[i]);\ - }\ - } else {\ - writeBytes((const void*)out, sizeof(lcase) * n);\ - }\ -} - - -IMPLEMENT_WRITER(UInt16, uint16) -IMPLEMENT_WRITER(Int16, int16) -IMPLEMENT_WRITER(UInt32, uint32) -IMPLEMENT_WRITER(Int32, int32) -IMPLEMENT_WRITER(UInt64, uint64) -IMPLEMENT_WRITER(Int64, int64) -IMPLEMENT_WRITER(Float32, float32) -IMPLEMENT_WRITER(Float64, float64) - -#undef IMPLEMENT_WRITER - - -void BinaryOutput::reallocBuffer(size_t bytes, size_t oldBufferLen) { - //debugPrintf("reallocBuffer(%d, %d)\n", bytes, oldBufferLen); - - size_t newBufferLen = (int)(m_bufferLen * 1.5) + 100; - uint8* newBuffer = NULL; - - if ((m_filename == "") || (newBufferLen < MAX_BINARYOUTPUT_BUFFER_SIZE)) { - // We're either writing to memory (in which case we *have* to try and allocate) - // or we've been asked to allocate a reasonable size buffer. - - //debugPrintf(" realloc(%d)\n", newBufferLen); - newBuffer = (uint8*)System::realloc(m_buffer, newBufferLen); - if (newBuffer != NULL) { - m_maxBufferLen = newBufferLen; - } - } - - if ((newBuffer == NULL) && (bytes > 0)) { - // Realloc failed; we're probably out of memory. Back out - // the entire call and try to dump some data to disk. - m_bufferLen = oldBufferLen; - reserveBytesWhenOutOfMemory(bytes); - } else { - m_buffer = newBuffer; - debugAssert(isValidHeapPointer(m_buffer)); - } -} - - -void BinaryOutput::reserveBytesWhenOutOfMemory(size_t bytes) { - if (m_filename == "") { - throw "Out of memory while writing to memory in BinaryOutput (no RAM left)."; - } else if ((int)bytes > (int)m_maxBufferLen) { - throw "Out of memory while writing to disk in BinaryOutput (could not create a large enough buffer)."; - } else { - - // Dump the contents to disk. In order to enable seeking backwards, - // we keep the last 10 MB in memory. - int writeBytes = m_bufferLen - 10 * 1024 * 1024; - - if (writeBytes < m_bufferLen / 3) { - // We're going to write less than 1/3 of the file; - // give up and just write the whole thing. - writeBytes = m_bufferLen; - } - debugAssert(writeBytes > 0); - - //debugPrintf("Writing %d bytes to disk\n", writeBytes); - - const char* mode = (m_alreadyWritten > 0) ? "ab" : "wb"; - FILE* file = fopen(m_filename.c_str(), mode); - debugAssert(file); - - size_t count = fwrite(m_buffer, 1, writeBytes, file); - debugAssert((int)count == writeBytes); (void)count; - - fclose(file); - file = NULL; - - // Record that we saved this data. - m_alreadyWritten += writeBytes; - m_bufferLen -= writeBytes; - m_pos -= writeBytes; - - debugAssert(m_bufferLen < m_maxBufferLen); - debugAssert(m_bufferLen >= 0); - debugAssert(m_pos >= 0); - debugAssert(m_pos <= m_bufferLen); - - // Shift the unwritten data back appropriately in the buffer. - debugAssert(isValidHeapPointer(m_buffer)); - System::memcpy(m_buffer, m_buffer + writeBytes, m_bufferLen); - debugAssert(isValidHeapPointer(m_buffer)); - - // *now* we allocate bytes (there should presumably be enough - // space in the buffer; if not, we'll come back through this - // code and dump the last 10MB to disk as well. Note that the - // bytes > maxBufferLen case above would already have triggered - // if this call couldn't succeed. - reserveBytes(bytes); - } -} - - -BinaryOutput::BinaryOutput() { - m_alreadyWritten = 0; - m_swapBytes = false; - m_pos = 0; - m_filename = ""; - m_buffer = NULL; - m_bufferLen = 0; - m_maxBufferLen = 0; - m_beginEndBits = 0; - m_bitString = 0; - m_bitPos = 0; - m_ok = true; - m_committed = false; -} - - -BinaryOutput::BinaryOutput( - const std::string& filename, - G3DEndian fileEndian) { - - m_pos = 0; - m_alreadyWritten = 0; - setEndian(fileEndian); - m_filename = filename; - m_buffer = NULL; - m_bufferLen = 0; - m_maxBufferLen = 0; - m_beginEndBits = 0; - m_bitString = 0; - m_bitPos = 0; - m_committed = false; - - m_ok = true; - /** Verify ability to write to disk */ - commit(false); - m_committed = false; -} - - -void BinaryOutput::reset() { - debugAssert(m_beginEndBits == 0); - alwaysAssertM(m_filename == "", - "Can only reset a BinaryOutput that writes to memory."); - - // Do not reallocate, just clear the size of the buffer. - m_pos = 0; - m_alreadyWritten = 0; - m_bufferLen = 0; - m_beginEndBits = 0; - m_bitString = 0; - m_bitPos = 0; - m_committed = false; -} - - -BinaryOutput::~BinaryOutput() { - debugAssert((m_buffer == NULL) || isValidHeapPointer(m_buffer)); - System::free(m_buffer); - m_buffer = NULL; - m_bufferLen = 0; - m_maxBufferLen = 0; -} - - -void BinaryOutput::setEndian(G3DEndian fileEndian) { - m_fileEndian = fileEndian; - m_swapBytes = (fileEndian != System::machineEndian()); -} - - -bool BinaryOutput::ok() const { - return m_ok; -} - - -void BinaryOutput::compress() { - if (m_alreadyWritten > 0) { - throw "Cannot compress huge files (part of this file has already been written to disk)."; - } - - // Old buffer size - int L = m_bufferLen; - uint8* convert = (uint8*)&L; - - // Zlib requires the output buffer to be this big - unsigned long newSize = iCeil(m_bufferLen * 1.01) + 12; - uint8* temp = (uint8*)System::malloc(newSize); - int result = compress2(temp, &newSize, m_buffer, m_bufferLen, 9); - - debugAssert(result == Z_OK); (void)result; - - // Write the header - if (m_swapBytes) { - m_buffer[0] = convert[3]; - m_buffer[1] = convert[2]; - m_buffer[2] = convert[1]; - m_buffer[3] = convert[0]; - } else { - m_buffer[0] = convert[0]; - m_buffer[1] = convert[1]; - m_buffer[2] = convert[2]; - m_buffer[3] = convert[3]; - } - - // Write the data - if ((int64)newSize + 4 > (int64)m_maxBufferLen) { - m_maxBufferLen = newSize + 4; - m_buffer = (uint8*)System::realloc(m_buffer, m_maxBufferLen); - } - m_bufferLen = newSize + 4; - System::memcpy(m_buffer + 4, temp, newSize); - m_pos = m_bufferLen; - - System::free(temp); -} - - -void BinaryOutput::commit(bool flush) { - debugAssertM(! m_committed, "Cannot commit twice"); - m_committed = true; - debugAssertM(m_beginEndBits == 0, "Missing endBits before commit"); - - // Make sure the directory exists. - std::string root, base, ext, path; - Array pathArray; - parseFilename(m_filename, root, pathArray, base, ext); - - path = root + stringJoin(pathArray, '/'); - if (! fileExists(path, false)) { - createDirectory(path); - } - - const char* mode = (m_alreadyWritten > 0) ? "ab" : "wb"; - - FILE* file = fopen(m_filename.c_str(), mode); - - m_ok = (file != NULL) && m_ok; - - if (m_ok) { - debugAssertM(file, std::string("Could not open '") + m_filename + "'"); - - m_alreadyWritten += m_bufferLen; - - fwrite(m_buffer, m_bufferLen, 1, file); - if (flush) { - fflush(file); - } - fclose(file); - file = NULL; - } -} - - -void BinaryOutput::commit( - uint8* out) { - debugAssertM(! m_committed, "Cannot commit twice"); - m_committed = true; - - System::memcpy(out, m_buffer, m_bufferLen); -} - - -void BinaryOutput::writeUInt16(uint16 u) { - reserveBytes(2); - - uint8* convert = (uint8*)&u; - - if (m_swapBytes) { - m_buffer[m_pos] = convert[1]; - m_buffer[m_pos + 1] = convert[0]; - } else { - *(uint16*)(m_buffer + m_pos) = u; - } - - m_pos += 2; -} - - -void BinaryOutput::writeUInt32(uint32 u) { - reserveBytes(4); - - uint8* convert = (uint8*)&u; - - debugAssert(m_beginEndBits == 0); - - if (m_swapBytes) { - m_buffer[m_pos] = convert[3]; - m_buffer[m_pos + 1] = convert[2]; - m_buffer[m_pos + 2] = convert[1]; - m_buffer[m_pos + 3] = convert[0]; - } else { - *(uint32*)(m_buffer + m_pos) = u; - } - - m_pos += 4; -} - - -void BinaryOutput::writeUInt64(uint64 u) { - reserveBytes(8); - - uint8* convert = (uint8*)&u; - - if (m_swapBytes) { - m_buffer[m_pos] = convert[7]; - m_buffer[m_pos + 1] = convert[6]; - m_buffer[m_pos + 2] = convert[5]; - m_buffer[m_pos + 3] = convert[4]; - m_buffer[m_pos + 4] = convert[3]; - m_buffer[m_pos + 5] = convert[2]; - m_buffer[m_pos + 6] = convert[1]; - m_buffer[m_pos + 7] = convert[0]; - } else { - *(uint64*)(m_buffer + m_pos) = u; - } - - m_pos += 8; -} - - -void BinaryOutput::writeString(const char* s) { - // +1 is because strlen doesn't count the null - int len = strlen(s) + 1; - - debugAssert(m_beginEndBits == 0); - reserveBytes(len); - System::memcpy(m_buffer + m_pos, s, len); - m_pos += len; -} - - -void BinaryOutput::writeStringEven(const char* s) { - // +1 is because strlen doesn't count the null - int len = strlen(s) + 1; - - reserveBytes(len); - System::memcpy(m_buffer + m_pos, s, len); - m_pos += len; - - // Pad with another NULL - if ((len % 2) == 1) { - writeUInt8(0); - } -} - - -void BinaryOutput::writeString32(const char* s) { - writeUInt32(strlen(s) + 1); - writeString(s); -} - - -void BinaryOutput::writeVector4(const Vector4& v) { - writeFloat32(v.x); - writeFloat32(v.y); - writeFloat32(v.z); - writeFloat32(v.w); -} - - -void BinaryOutput::writeVector3(const Vector3& v) { - writeFloat32(v.x); - writeFloat32(v.y); - writeFloat32(v.z); -} - - -void BinaryOutput::writeVector2(const Vector2& v) { - writeFloat32(v.x); - writeFloat32(v.y); -} - - -void BinaryOutput::writeColor4(const Color4& v) { - writeFloat32(v.r); - writeFloat32(v.g); - writeFloat32(v.b); - writeFloat32(v.a); -} - - -void BinaryOutput::writeColor3(const Color3& v) { - writeFloat32(v.r); - writeFloat32(v.g); - writeFloat32(v.b); -} - - -void BinaryOutput::beginBits() { - debugAssertM(m_beginEndBits == 0, "Already in beginBits...endBits"); - m_bitString = 0x00; - m_bitPos = 0; - m_beginEndBits = 1; -} - - -void BinaryOutput::writeBits(uint32 value, int numBits) { - - while (numBits > 0) { - // Extract the current bit of value and - // insert it into the current byte - m_bitString |= (value & 1) << m_bitPos; - ++m_bitPos; - value = value >> 1; - --numBits; - - if (m_bitPos > 7) { - // We've reached the end of this byte - writeUInt8(m_bitString); - m_bitString = 0x00; - m_bitPos = 0; - } - } -} - - -void BinaryOutput::endBits() { - debugAssertM(m_beginEndBits == 1, "Not in beginBits...endBits"); - if (m_bitPos > 0) { - writeUInt8(m_bitString); - } - m_bitString = 0; - m_bitPos = 0; - m_beginEndBits = 0; -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Box.cpp b/externals/g3dlite/G3D.lib/source/Box.cpp deleted file mode 100644 index 4b6c56388ec..00000000000 --- a/externals/g3dlite/G3D.lib/source/Box.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/** - @file Box.cpp - Box class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-06-02 - @edited 2006-02-05 -*/ - -#include "G3D/Box.h" -#include "G3D/debug.h" -#include "G3D/Plane.h" -#include "G3D/AABox.h" -#include "G3D/CoordinateFrame.h" - -namespace G3D { - -/** - Sets a field on four vertices. Used by the constructor. - */ -#define setMany(i0, i1, i2, i3, field, extreme) \ - _corner[i0].field = _corner[i1].field = \ - _corner[i2].field = _corner[i3].field = \ - (extreme).field - -Box::Box() { -} - - -Box::Box(const AABox& b) { - init(b.low(), b.high()); -} - -Box::Box(class BinaryInput& b) { - deserialize(b); -} - - -void Box::serialize(class BinaryOutput& b) const { - int i; - for (i = 0; i < 8; ++i) { - _corner[i].serialize(b); - } - - // Other state can be reconstructed -} - - -void Box::deserialize(class BinaryInput& b) { - int i; - - _center = Vector3::zero(); - for (i = 0; i < 8; ++i) { - _corner[i].deserialize(b); - _center += _corner[i]; - } - - _center = _center / 8; - - // Reconstruct other state from the corners - _axis[0] = _corner[5] - _corner[4]; - _axis[1] = _corner[7] - _corner[4]; - _axis[2] = _corner[0] - _corner[4]; - - for (i = 0; i < 3; ++i) { - _extent[i] = _axis[i].magnitude(); - _axis[i] /= _extent[i]; - } - - _volume = _extent.x * _extent.y * _extent.z; - - _area = 2 * - (_extent.x * _extent.y + - _extent.y * _extent.z + - _extent.z * _extent.x); -} - - -Box::Box( - const Vector3& min, - const Vector3& max) { - - init(min.min(max), min.max(max)); - -} - -void Box::init( - const Vector3& min, - const Vector3& max) { - - debugAssert( - (min.x <= max.x) && - (min.y <= max.y) && - (min.z <= max.z)); - - setMany(0, 1, 2, 3, z, max); - setMany(4, 5, 6, 7, z, min); - - setMany(1, 2, 5, 6, x, max); - setMany(0, 3, 4, 7, x, min); - - setMany(3, 2, 6, 7, y, max); - setMany(0, 1, 5, 4, y, min); - - _extent = max - min; - - _axis[0] = Vector3::unitX(); - _axis[1] = Vector3::unitY(); - _axis[2] = Vector3::unitZ(); - - if (_extent.isFinite()) { - _volume = _extent.x * _extent.y * _extent.z; - } else { - _volume = G3D::inf(); - } - - debugAssert(! isNaN(_extent.x)); - - _area = 2 * - (_extent.x * _extent.y + - _extent.y * _extent.z + - _extent.z * _extent.x); - - _center = (max + min) / 2; - - // If the extent is infinite along an axis, make the center zero to avoid NaNs - for (int i = 0; i < 3; ++i) { - if (! G3D::isFinite(_extent[i])) { - _center[i] = 0.0f; - } - } -} - - -float Box::volume() const { - return _volume; -} - - -float Box::area() const { - return _area; -} - - -void Box::getLocalFrame(CoordinateFrame& frame) const { - - frame.rotation = Matrix3( - _axis[0][0], _axis[1][0], _axis[2][0], - _axis[0][1], _axis[1][1], _axis[2][1], - _axis[0][2], _axis[1][2], _axis[2][2]); - - frame.translation = _center; -} - - -CoordinateFrame Box::localFrame() const { - CoordinateFrame out; - getLocalFrame(out); - return out; -} - - -void Box::getFaceCorners(int f, Vector3& v0, Vector3& v1, Vector3& v2, Vector3& v3) const { - switch (f) { - case 0: - v0 = _corner[0]; v1 = _corner[1]; v2 = _corner[2]; v3 = _corner[3]; - break; - - case 1: - v0 = _corner[1]; v1 = _corner[5]; v2 = _corner[6]; v3 = _corner[2]; - break; - - case 2: - v0 = _corner[7]; v1 = _corner[6]; v2 = _corner[5]; v3 = _corner[4]; - break; - - case 3: - v0 = _corner[2]; v1 = _corner[6]; v2 = _corner[7]; v3 = _corner[3]; - break; - - case 4: - v0 = _corner[3]; v1 = _corner[7]; v2 = _corner[4]; v3 = _corner[0]; - break; - - case 5: - v0 = _corner[1]; v1 = _corner[0]; v2 = _corner[4]; v3 = _corner[5]; - break; - - default: - debugAssert((f >= 0) && (f < 6)); - } -} - - - -int Box::dummy = 0; - -bool Box::culledBy( - const Array& plane, - int& cullingPlane, - const uint32 _inMask, - uint32& childMask) const { - - uint32 inMask = _inMask; - assert(plane.size() < 31); - - childMask = 0; - - // See if there is one plane for which all of the - // vertices are in the negative half space. - for (int p = 0; p < plane.size(); ++p) { - - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - Vector3 corner; - - int numContained = 0; - int v = 0; - - // We can early-out only if we have found one point on each - // side of the plane (i.e. if we are straddling). That - // occurs when (numContained < v) && (numContained > 0) - for (v = 0; (v < 8) && ((numContained == v) || (numContained == 0)); ++v) { - if (plane[p].halfSpaceContains(_corner[v])) { - ++numContained; - } - } - - if (numContained == 0) { - // Plane p culled the box - cullingPlane = p; - - // The caller should not recurse into the children, - // since the parent is culled. If they do recurse, - // make them only test against this one plane, which - // will immediately cull the volume. - childMask = 1 << p; - return true; - - } else if (numContained < v) { - // The bounding volume straddled the plane; we have - // to keep testing against this plane - childMask |= (1 << p); - } - } - - // Move on to the next bit. - inMask = inMask >> 1; - } - - // None of the planes could cull this box - cullingPlane = -1; - return false; -} - - -bool Box::culledBy( - const Array& plane, - int& cullingPlane, - const uint32 _inMask) const { - - uint32 inMask = _inMask; - assert(plane.size() < 31); - - // See if there is one plane for which all of the - // vertices are in the negative half space. - for (int p = 0; p < plane.size(); ++p) { - - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - bool culled = true; - - int v; - - // Assume this plane culls all points. See if there is a point - // not culled by the plane... early out when at least one point - // is in the positive half space. - for (v = 0; (v < 8) && culled; ++v) { - culled = ! plane[p].halfSpaceContains(corner(v)); - } - - if (culled) { - // Plane p culled the box - cullingPlane = p; - - return true; - } - } - - // Move on to the next bit. - inMask = inMask >> 1; - } - - // None of the planes could cull this box - cullingPlane = -1; - return false; -} - - -bool Box::contains( - const Vector3& point) const { - - // Form axes from three edges, transform the point into that - // space, and perform 3 interval tests - - Vector3 u = _corner[4] - _corner[0]; - Vector3 v = _corner[3] - _corner[0]; - Vector3 w = _corner[1] - _corner[0]; - - Matrix3 M = Matrix3(u.x, v.x, w.x, - u.y, v.y, w.y, - u.z, v.z, w.z); - - // M^-1 * (point - _corner[0]) = point in unit cube's object space - // compute the inverse of M - Vector3 osPoint = M.inverse() * (point - _corner[0]); - - return - (osPoint.x >= 0) && - (osPoint.y >= 0) && - (osPoint.z >= 0) && - (osPoint.x <= 1) && - (osPoint.y <= 1) && - (osPoint.z <= 1); -} - -#undef setMany - - -void Box::getRandomSurfacePoint(Vector3& P, Vector3& N) const { - float aXY = _extent.x * _extent.y; - float aYZ = _extent.y * _extent.z; - float aZX = _extent.z * _extent.x; - - float r = (float)uniformRandom(0, aXY + aYZ + aZX); - - // Choose evenly between positive and negative face planes - float d = (uniformRandom(0, 1) < 0.5f) ? -1.0f : 1.0f; - - // The probability of choosing a given face is proportional to - // its area. - if (r < aXY) { - P = _axis[0] * (float)uniformRandom(-0.5, 0.5) * _extent.x + - _axis[1] * (float)uniformRandom(-0.5, 0.5) * _extent.y + - _center + _axis[2] * d * _extent.z * 0.5f; - N = _axis[2] * d; - } else if (r < aYZ) { - P = _axis[1] * (float)uniformRandom(-0.5, 0.5) * _extent.y + - _axis[2] * (float)uniformRandom(-0.5, 0.5) * _extent.z + - _center + _axis[0] * d * _extent.x * 0.5f; - N = _axis[0] * d; - } else { - P = _axis[2] * (float)uniformRandom(-0.5, 0.5) * _extent.z + - _axis[0] *(float) uniformRandom(-0.5, 0.5) * _extent.x + - _center + _axis[1] * d * _extent.y * 0.5f; - N = _axis[1] * d; - } -} - - -Vector3 Box::randomInteriorPoint() const { - Vector3 sum = _center; - - for (int a = 0; a < 3; ++a) { - sum += _axis[a] * (float)uniformRandom(-0.5, 0.5) * _extent[a]; - } - - return sum; -} - -Box Box::inf() { - return Box(-Vector3::inf(), Vector3::inf()); -} - -void Box::getBounds(class AABox& aabb) const { - - Vector3 lo = _corner[0]; - Vector3 hi = lo; - - for (int v = 1; v < 8; ++v) { - const Vector3& C = _corner[v]; - lo = lo.min(C); - hi = hi.max(C); - } - - aabb = AABox(lo, hi); -} - - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/Capsule.cpp b/externals/g3dlite/G3D.lib/source/Capsule.cpp deleted file mode 100644 index fbcb56fe97b..00000000000 --- a/externals/g3dlite/G3D.lib/source/Capsule.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/** - @file Capsule.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-07 - @edited 2005-08-18 - - Copyright 2000-2005, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/Capsule.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/LineSegment.h" -#include "G3D/Sphere.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Line.h" -#include "G3D/AABox.h" - -namespace G3D { - -Capsule::Capsule(class BinaryInput& b) { - deserialize(b); -} - - -Capsule::Capsule() { -} - - -Capsule::Capsule(const Vector3& _p1, const Vector3& _p2, float _r) - : p1(_p1), p2(_p2), _radius(_r) { -} - - -void Capsule::serialize(class BinaryOutput& b) const { - p1.serialize(b); - p2.serialize(b); - b.writeFloat64(_radius); -} - - -void Capsule::deserialize(class BinaryInput& b) { - p1.deserialize(b); - p2.deserialize(b); - _radius = b.readFloat64(); -} - - -Line Capsule::axis() const { - return Line::fromTwoPoints(p1, p2); -} - - -float Capsule::volume() const { - return - // Sphere volume - pow(_radius, 3) * pi() * 4 / 3 + - - // Cylinder volume - pow(_radius, 2) * (p1 - p2).magnitude(); -} - - -float Capsule::area() const { - - return - // Sphere area - pow(_radius, 2) * 4 * pi() + - - // Cylinder area - twoPi() * _radius * (p1 - p2).magnitude(); -} - - -void Capsule::getBounds(AABox& out) const { - Vector3 min = p1.min(p2) - (Vector3(1, 1, 1) * _radius); - Vector3 max = p1.max(p2) + (Vector3(1, 1, 1) * _radius); - - out = AABox(min, max); -} - - -bool Capsule::contains(const Vector3& p) const { - return LineSegment::fromTwoPoints(p1, p2).distanceSquared(p) <= square(radius()); -} - - -void Capsule::getRandomSurfacePoint(Vector3& p, Vector3& N) const { - float h = height(); - float r = radius(); - - // Create a random point on a standard capsule and then rotate to the global frame. - - // Relative areas - float capRelArea = sqrt(r) / 2.0f; - float sideRelArea = r * h; - - float r1 = uniformRandom(0, capRelArea * 2 + sideRelArea); - - if (r1 < capRelArea * 2) { - - // Select a point uniformly at random on a sphere - N = Sphere(Vector3::zero(), 1).randomSurfacePoint(); - p = N * r; - p.y += sign(p.y) * h / 2.0f; - } else { - // Side - float a = uniformRandom(0, (float)twoPi()); - N.x = cos(a); - N.y = 0; - N.z = sin(a); - p.x = N.x * r; - p.z = N.y * r; - p.y = uniformRandom(-h / 2.0f, h / 2.0f); - } - - // Transform to world space - CoordinateFrame cframe; - getReferenceFrame(cframe); - - p = cframe.pointToWorldSpace(p); - N = cframe.normalToWorldSpace(N); -} - - -void Capsule::getReferenceFrame(CoordinateFrame& cframe) const { - cframe.translation = center(); - - Vector3 Y = (p1 - p2).direction(); - Vector3 X = (abs(Y.dot(Vector3::unitX())) > 0.9) ? Vector3::unitY() : Vector3::unitX(); - Vector3 Z = X.cross(Y).direction(); - X = Y.cross(Z); - cframe.rotation.setColumn(0, X); - cframe.rotation.setColumn(1, Y); - cframe.rotation.setColumn(2, Z); -} - - -Vector3 Capsule::randomInteriorPoint() const { - float h = height(); - float r = radius(); - - // Create a random point in a standard capsule and then rotate to the global frame. - - Vector3 p; - - float hemiVolume = pi() * (r*r*r) * 4 / 6.0; - float cylVolume = pi() * square(r) * h; - - float r1 = uniformRandom(0, 2.0 * hemiVolume + cylVolume); - - if (r1 < 2.0 * hemiVolume) { - - p = Sphere(Vector3::zero(), r).randomInteriorPoint(); - - p.y += sign(p.y) * h / 2.0f; - - } else { - - // Select a point uniformly at random on a disk - float a = uniformRandom(0, (float)twoPi()); - float r2 = sqrt(uniformRandom(0, 1)) * r; - - p = Vector3(cos(a) * r2, - uniformRandom(-h / 2.0f, h / 2.0f), - sin(a) * r2); - } - - // Transform to world space - CoordinateFrame cframe; - getReferenceFrame(cframe); - - return cframe.pointToWorldSpace(p); -} - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/CollisionDetection.cpp b/externals/g3dlite/G3D.lib/source/CollisionDetection.cpp deleted file mode 100644 index 16650bc1a96..00000000000 --- a/externals/g3dlite/G3D.lib/source/CollisionDetection.cpp +++ /dev/null @@ -1,2152 +0,0 @@ -/** - @file CollisionDetection.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Bounce direction based on Paul Nettle's ftp://ftp.3dmaileffects.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf and comments by Max McGuire. Ray-sphere code by Eric Haines. - - @created 2001-11-24 - @edited 2008-10-10 - */ - -#include "G3D/CoordinateFrame.h" -#include "G3D/platform.h" -#include "G3D/CollisionDetection.h" -#include "G3D/debugAssert.h" -#include "G3D/vectorMath.h" -#include "G3D/Capsule.h" -#include "G3D/Plane.h" -#include "G3D/Line.h" -#include "G3D/LineSegment.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" -#include "G3D/Triangle.h" -#include "G3D/Vector3.h" -#include "G3D/AABox.h" - -namespace G3D { - -bool CollisionDetection::ignoreBool; -Vector3 CollisionDetection::ignore; -Array CollisionDetection::ignoreArray; - - - -Vector3 CollisionDetection::separatingAxisForSolidBoxSolidBox( - const int separatingAxisIndex, - const Box & box1, - const Box & box2) { - debugAssert(separatingAxisIndex >= 0); - debugAssert(separatingAxisIndex < 15); - Vector3 axis; - if (separatingAxisIndex < 3) { - axis = box1.axis(separatingAxisIndex); - } else if (separatingAxisIndex < 6) { - axis = box2.axis(separatingAxisIndex - 3); - } else { - int box1Index = (separatingAxisIndex - 6) / 3; - int box2Index = (separatingAxisIndex - 6) % 3; - axis = cross(box1.axis(box1Index), box2.axis(box2Index)); - } - return axis; -} - -#ifdef _MSC_VER -# pragma warning (push) -# pragma warning (disable : 4244) -#endif - -float CollisionDetection::projectedDistanceForSolidBoxSolidBox( - const int separatingAxisIndex, - const Vector3 & a, - const Vector3 & b, - const Vector3 & D, - const double* c, - const double* ca, - const double* ad, - const double* bd) -{ - (void)D; - - float R0 = 0.0f; - float R1 = 0.0f; - float R = 0.0f; - switch (separatingAxisIndex) { - case 0: - // A0 - R0 = a[0]; - R1 = b[0] * ca[0] + b[1] * ca[1] + b[2] * ca[2]; - R = fabs(ad[0]); - break; - case 1: - // A1 - R0 = a[1]; - R1 = b[0] * ca[3] + b[1] * ca[4] + b[2] * ca[5]; - R = fabs(ad[1]); - break; - case 2: - // A2 - R0 = a[2]; - R1 = b[0] * ca[6] + b[1] * ca[7] + b[2] * ca[8]; - R = fabs(ad[2]); - break; - case 3: - // B0 - R0 = a[0] * ca[0] + a[1] * ca[3] + a[2] * ca[6]; - R1 = b[0]; - R = fabs(bd[0]); - break; - case 4: - // B1 - R0 = a[0] * ca[1] + a[1] * ca[4] + a[2] * ca[7]; - R1 = b[1]; - R = fabs(bd[1]); - break; - case 5: - // B2 - R0 = a[0] * ca[2] + a[1] * ca[5] + a[2] * ca[8]; - R1 = b[2]; - R = fabs(bd[2]); - break; - case 6: - // A0 x B0 - R0 = a[1] * ca[6] + a[2] * ca[3]; - R1 = b[1] * ca[2] + b[2] * ca[1]; - R = fabs(c[3] * ad[2] - c[6] * ad[1]); - break; - case 7: - // A0 x B1 - R0 = a[1] * ca[7] + a[2] * ca[4]; - R1 = b[0] * ca[2] + b[2] * ca[0]; - R = fabs(c[4] * ad[2] - c[7] * ad[1]); - break; - case 8: - // A0 x B2 - R0 = a[1] * ca[8] + a[2] * ca[5]; - R1 = b[0] * ca[1] + b[1] * ca[0]; - R = fabs(c[5] * ad[2] - c[8] * ad[1]); - break; - case 9: - // A1 x B0 - R0 = a[0] * ca[6] + a[2] * ca[0]; - R1 = b[1] * ca[5] + b[2] * ca[4]; - R = fabs(c[6] * ad[0] - c[0] * ad[2]); - break; - case 10: - // A1 x B1 - R0 = a[0] * ca[7] + a[2] * ca[1]; - R1 = b[0] * ca[5] + b[2] * ca[3]; - R = fabs(c[7] * ad[0] - c[1] * ad[2]); - break; - case 11: - // A1 x B2 - R0 = a[0] * ca[8] + a[2] * ca[2]; - R1 = b[0] * ca[4] + b[1] * ca[3]; - R = fabs(c[8] * ad[0] - c[2] * ad[2]); - break; - case 12: - // A2 x B0 - R0 = a[0] * ca[3] + a[1] * ca[0]; - R1 = b[1] * ca[8] + b[2] * ca[7]; - R = fabs(c[0] * ad[1] - c[3] * ad[0]); - break; - case 13: - // A2 x B1 - R0 = a[0] * ca[4] + a[1] * ca[1]; - R1 = b[0] * ca[8] + b[2] * ca[6]; - R = fabs(c[1] * ad[1] - c[4] * ad[0]); - break; - case 14: - // A2 x B2 - R0 = a[0] * ca[5] + a[1] * ca[2]; - R1 = b[0] * ca[7] + b[1] * ca[6]; - R = fabs(c[2] * ad[1] - c[5] * ad[0]); - break; - default: - debugAssertM(false, "fell through switch statement"); - } - - return (R - (R0 + R1)); -} - - -bool CollisionDetection::parallelAxisForSolidBoxSolidBox( - const double* ca, - const double epsilon, - int & axis1, - int & axis2) { - const double parallelDot = 1.0 - epsilon; - for (int i = 0; i < 9; i++) { - if (ca[i] >= parallelDot) { - axis1 = i / 3; - axis2 = i % 3; - return true; - } - } - return false; -} - - - - -void CollisionDetection::fillSolidBoxSolidBoxInfo( - const Box & box1, - const Box & box2, - Vector3 & a, - Vector3 & b, - Vector3 & D, - double* c, - double* ca, - double* ad, - double* bd) { - // length between center and each side of box1 and box2 - a = box1.extent() * 0.5; - b = box2.extent() * 0.5; - - // difference between centers of box1 and box2 - D = box2.center() - box1.center(); - - // store the value of all possible dot products between the - // axes of box1 and box2, c_{row, col} in the Eberly paper - // corresponds to c[row * 3 + col] for this 9 element array. - // - // c[] holds signed values, ca[] hold absolute values - for (int i = 0; i < 9; i++) { - c[i] = dot(box1.axis(i / 3), box2.axis(i % 3)); - ca[i] = fabs(c[i]); - } - - // store all possible dot products between the axes of box1 and D, - // as well as the axes of box2 and D - for (int i = 0; i < 3; i++) { - ad[i] = dot(box1.axis(i), D); - bd[i] = dot(box2.axis(i), D); - } -} - - - -bool CollisionDetection::conservativeBoxBoxTest( - const Vector3 & a, const Vector3 & b, const Vector3 & D) { - // do a quick bounding sphere test because it is relatively - // cheap, (three dot products, two sqrts, and a few others) - double boxRadius1 = a.magnitude(); - double boxRadius2 = b.magnitude(); - return (D.squaredMagnitude() < square(boxRadius1 + boxRadius2)); -} - - - - -bool CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox( - const Box& box1, - const Box& box2, - const int lastSeparatingAxis) { - // for explanations of the variable please refer to the - // paper and fillSolidBoxSolidBoxInfo() - Vector3 a; - Vector3 b; - Vector3 D; - double c[9]; - double ca[9]; - double ad[3]; - double bd[3]; - - fillSolidBoxSolidBoxInfo(box1, box2, a, b, D, c, ca, ad, bd); - - int dummy1, dummy2; - bool parallelAxes = parallelAxisForSolidBoxSolidBox(ca, 0.00001, - dummy1, dummy2); - - // check the separating axis from the last time step - if (lastSeparatingAxis != -1 && - (lastSeparatingAxis < 6 || !parallelAxes)) { - double projectedDistance = projectedDistanceForSolidBoxSolidBox( - lastSeparatingAxis, a, b, D, c, ca, ad, bd); - - // the separating axis from the last time step is still - // valid, the boxes do not intersect - if (projectedDistance > 0.0) { - return false; - } - } - - // test if the boxes can be separated by a plane normal to - // any of the three axes of box1, any of the three axes of box2, - // or any of the 9 possible cross products of axes from box1 - // and box2 - for (int i = 0; i < 15; i++) { - // do not need to check edge-edge cases if any two of - // the axes are parallel - if (parallelAxes && i == 6) { - return true; - } - - double projectedDistance = - projectedDistanceForSolidBoxSolidBox(i, a, b, D, c, ca, ad, bd); - - // found a separating axis, the boxes do not intersect - if (projectedDistance > 0.0) { - return false; - } - } - - return true; -} - - - -void CollisionDetection::closestPointsBetweenLineAndLine( - const Line & line1, - const Line & line2, - Vector3 & closest1, - Vector3 & closest2) { - // TODO make accessors for Line that don't make a copy of data - Vector3 P0 = line1.point(); - Vector3 u = line1.direction(); - Vector3 Q0 = line2.point(); - Vector3 v = line2.direction(); - Vector3 w0 = P0 - Q0; - - // a = 1.0, c = 1.0 - double b = dot(u, v); - double d = dot(u, w0); - double e = dot(v, w0); - double D = 1.0 - b * b; - double sc, tc; - - static const double epsilon = 0.00001; - - if (D < epsilon) { - // lines are parallel, choose P0 as one point, find the point - // on line2 that is closest to P0 - sc = 0.0; - tc = (b > 1.0) ? (d / b) : (e / 1.0); - } else { - // lines are not parallel - sc = (b * e - 1.0 * d) / D; - tc = (1.0 * e - b * d) / D; - } - - closest1 = P0 + (sc * u); - closest2 = Q0 + (tc * v); -} - - - -float CollisionDetection::penetrationDepthForFixedBoxFixedBox( - const Box& box1, - const Box& box2, - Array& contactPoints, - Array& contactNormals, - const int lastSeparatingAxis) { - - contactPoints.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - contactNormals.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - - Vector3 a; - Vector3 b; - Vector3 D; - double c[9]; - double ca[9]; - double ad[3]; - double bd[3]; - - debugAssert(lastSeparatingAxis >= -1); - debugAssert(lastSeparatingAxis < 15); - - fillSolidBoxSolidBoxInfo(box1, box2, a, b, D, c, ca, ad, bd); - - int axis1, axis2; - bool parallelAxes = parallelAxisForSolidBoxSolidBox(ca, 0.00001, - axis1, axis2); - - - // check the separating axis from the last time step - if (lastSeparatingAxis != -1 && - (lastSeparatingAxis < 6 || !parallelAxes)) { - float projectedDistance = projectedDistanceForSolidBoxSolidBox( - lastSeparatingAxis, a, b, D, c, ca, ad, bd); - - // the separating axis from the last time step is still - // valid, the boxes do not intersect - if (projectedDistance > 0.0) { - return -projectedDistance; - } - } - - // test if the boxes can be separated by a plane normal to - // any of the three axes of box1, any of the three axes of box2, - // (test 9 possible cross products later) - float penetration = -(float)G3D::inf(); - int penetrationAxisIndex = -1; - - for (int i = 0; i < 6; i++) { - float projectedDistance = - projectedDistanceForSolidBoxSolidBox(i, a, b, D, c, ca, ad, bd); - - // found a separating axis, the boxes do not intersect - if (projectedDistance > 0.0) { - return -projectedDistance; - } - - // keep track of the axis that is least violated - if (projectedDistance > penetration) { - penetration = projectedDistance; - penetrationAxisIndex = i; - } - } - - - // for each edge-edge case we have to adjust the magnitude of - // penetration since we did not include the dot(L, L) denominator - // that can be smaller than 1.0 for the edge-edge cases. - if (!parallelAxes) { - double edgeDistances[9]; - - // run through edge-edge cases to see if we can find a separating axis - for (int i = 6; i < 15; i++) { - float projectedDistance = - projectedDistanceForSolidBoxSolidBox(i, a, b, D, c, ca, ad, bd); - - // found a separating axis, the boxes do not intersect, - // correct magnitude and return projected distance - if (projectedDistance > 0.0) { - Vector3 L = separatingAxisForSolidBoxSolidBox(i, box1, box2); - projectedDistance /= dot(L, L); - return -projectedDistance; - } - - edgeDistances[i - 6] = projectedDistance; - } - - // no separating axis found, the boxes do intersect, - // correct the magnitudes of the projectedDistance values - for (int i = 6; i < 15; i++) { - // find the negative penetration value with the smallest magnitude, - // the adjustment done for the edge-edge cases only increases - // magnitude by dividing by a number smaller than 1 and greater than 0 - float projectedDistance = (float)edgeDistances[i - 6]; - if (projectedDistance > penetration) { - Vector3 L = separatingAxisForSolidBoxSolidBox(i, box1, box2); - projectedDistance /= dot(L, L); - if (projectedDistance > penetration) { - penetration = projectedDistance; - penetrationAxisIndex = i; - } - } - } - } - - // get final separating axis vector - Vector3 L = separatingAxisForSolidBoxSolidBox(penetrationAxisIndex, - box1, box2); - - // set L to be the normal that faces away from box1 - if (dot(L, D) < 0) { - L = -L; - } - - Vector3 contactPoint; - - if (penetrationAxisIndex < 6) { - // vertex to face collision, find deepest colliding vertex - const Box* vertexBox; - const Box* faceBox; - Vector3 faceNormal = L; - - // L will be the outward facing normal for the faceBox - if (penetrationAxisIndex < 3) { - faceBox = & box1; - vertexBox = & box2; - if (dot(L, D) < 0) { - faceNormal = -L; - } - } else { - faceBox = & box2; - vertexBox = & box1; - if (dot(L, D) > 0) { - faceNormal = -L; - } - } - - // find the vertex that is farthest away in the direction - // face normal direction - int deepestPointIndex = 0; - float deepestPointDot = dot(faceNormal, vertexBox->corner(0)); - for (int i = 1; i < 8; i++) { - float dotProduct = dot(faceNormal, vertexBox->corner(i)); - if (dotProduct < deepestPointDot) { - deepestPointDot = dotProduct; - deepestPointIndex = i; - } - } - - // return the point half way between the deepest point and the - // contacting face - contactPoint = vertexBox->corner(deepestPointIndex) + - (-penetration * 0.5 * faceNormal); - } else { - // edge-edge case, find the two ege lines - int edge1 = (penetrationAxisIndex - 6) / 3; - int edge2 = (penetrationAxisIndex - 6) % 3; - Vector3 linePoint1 = box1.center(); - Vector3 linePoint2 = box2.center(); - Vector3 lineDir1; - Vector3 lineDir2; - - // find edge line by finding the edge axis, and the - // other two axes that are closest to the other box - for (int i = 0; i < 3; i++ ) { - if (i == edge1) { - lineDir1 = box1.axis(i); - } else { - Vector3 axis = box1.axis(i); - if (dot(axis, L) < 0) { - axis = -axis; - } - linePoint1 += axis * a[i]; - } - - if (i == edge2) { - lineDir2 = box2.axis(i); - } else { - Vector3 axis = box2.axis(i); - if (dot(axis, L) > 0) { - axis = -axis; - } - linePoint2 += axis * b[i]; - } - } - - // make lines from the two closest edges, and find - // the points that on each line that are closest to the other - Line line1 = Line::fromPointAndDirection(linePoint1, lineDir1); - Line line2 = Line::fromPointAndDirection(linePoint2, lineDir2); - Vector3 closest1; - Vector3 closest2; - - closestPointsBetweenLineAndLine(line1, line2, closest1, closest2); - - // take the average of the two closest edge points for the final - // contact point - contactPoint = (closest1 + closest2) * 0.5; - } - - contactPoints.push(contactPoint); - contactNormals.push(L); - - return -penetration; - -} - - - - -float CollisionDetection::penetrationDepthForFixedSphereFixedBox( - const Sphere& sphere, - const Box& box, - Array& contactPoints, - Array& contactNormals) { - - contactPoints.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - contactNormals.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - - // In its local coordinate frame, the box measures - // 2 * halfExtent[a] along dimesion a. - Vector3 halfExtent(box.extent(0), box.extent(1), box.extent(2)); - halfExtent *= 0.5f; - - CoordinateFrame boxFrame; - box.getLocalFrame(boxFrame); - - // Transform the sphere to the box's coordinate frame. - Vector3 center = boxFrame.pointToObjectSpace(sphere.center); - - // Find the square of the distance from the sphere to the box - - - // Distance along each axis from the closest side of the box - // to the sphere center. Negative values are *inside* the box. - Vector3 distOutsideBox; - - // Divide space up into the 27 regions corresponding - // to {+|-|0}X, {+|-|0}Y, {+|-|0}Z and classify the - // sphere center into one of them. - Vector3 centerRegion; - - // In the edge collision case, the edge is between vertices - // (constant + variable) and (constant - variable). - Vector3 constant, variable; - - int numNonZero = 0; - - // Iterate over axes - for (int a = 0; a < 3; ++a) { - // For each (box side), see which direction the sphere - // is outside the box (positive or negative). Add the - // square of that distance to the total distance from - // the box. - - float distanceFromLow = -halfExtent[a] - center[a]; - float distanceFromHigh = center[a] - halfExtent[a]; - - if (fabsf(distanceFromLow) < fabsf(distanceFromHigh)) { - distOutsideBox[a] = distanceFromLow; - } else { - distOutsideBox[a] = distanceFromHigh; - } - - if (distanceFromLow < 0.0) { - if (distanceFromHigh < 0.0) { - // Inside the box - centerRegion[a] = 0.0; - variable[a] = 1.0; - } else { - // Off the high side - centerRegion[a] = 1.0; - constant[a] = halfExtent[a]; - ++numNonZero; - } - } else if (distanceFromHigh < 0.0) { - // Off the low side - centerRegion[a] = -1.0; - constant[a] = -halfExtent[a]; - ++numNonZero; - } else { - debugAssertM(false, - "distanceFromLow and distanceFromHigh cannot both be positive"); - } - } - - // Squared distance between the outside of the box and the - // sphere center. - float d2 = Vector3::zero().max(distOutsideBox).squaredMagnitude(); - - if (d2 > square(sphere.radius)) { - // There is no penetration because the distance is greater - // than the radius of the sphere. This is the common case - // and we quickly exit. - return -1; - } - - // We know there is some penetration but need to classify it. - // - // Examine the region that contains the center of the sphere. If - // there is exactly one non-zero axis, the collision is with a - // plane. If there are exactly two non-zero axes, the collision - // is with an edge. If all three axes are non-zero, the collision is - // with a vertex. If there are no non-zero axes, the center is inside - // the box. - - double depth = -1; - switch (numNonZero) { - case 3: // Vertex collision - // The collision point is the vertex at constant, the normal - // is the vector from there to the sphere center. - contactNormals.append(boxFrame.normalToWorldSpace(constant - center)); - contactPoints.append(boxFrame.pointToWorldSpace(constant)); - depth = sphere.radius - sqrt(d2); - break; - - case 2: // Edge collision - { - // TODO: unwrapping the edge constructor and closest point - // code will probably make it faster. - - // Determine the edge - Line line = Line::fromPointAndDirection(constant, variable); - - // Penetration depth: - depth = sphere.radius - sqrt(d2); - - // The contact point is the closes point to the sphere on the line - Vector3 X = line.closestPoint(center); - contactNormals.append(boxFrame.normalToWorldSpace(X - center).direction()); - contactPoints.append(boxFrame.pointToWorldSpace(X)); - } - break; - - case 1: // Plane collision - { - // The plane normal is the centerRegion vector, - // so the sphere normal is the negative. Take - // it to world space from box-space. - - // Center region doesn't need to be normalized because - // it is known to contain only one non-zero value - // and that value is +/- 1. - Vector3 N = boxFrame.normalToWorldSpace(-centerRegion); - contactNormals.append(N); - - // Penetration depth: - depth = sphere.radius - sqrtf(d2); - - // Compute the contact point from the penetration depth - contactPoints.append(sphere.center + N * (sphere.radius - depth)); - } - break; - - case 0: // Volume collision - - // The sphere center is inside the box. This is an easy case - // to handle. Note that all axes of distOutsideBox must - // be negative. - - // Arbitratily choose the sphere center as a contact point - contactPoints.append(sphere.center); - - // Find the least-negative penetration axis. - // - // We could have computed this during the loop over the axes, - // but since volume collisions are rare (they only occur with - // large time steps), this case will seldom be executed and - // should not be optimized at the expense of the others. - if (distOutsideBox.x > distOutsideBox.y) { - if (distOutsideBox.x > distOutsideBox.z) { - // Smallest penetration on x-axis - // Chose normal based on which side we're closest to. - // Keep in mind that this is a normal to the sphere, - // so it is the inverse of the box normal. - if (center.x > 0) { - contactNormals.append(boxFrame.normalToWorldSpace(-Vector3::unitX())); - } else { - contactNormals.append(boxFrame.normalToWorldSpace(Vector3::unitX())); - } - depth = -distOutsideBox.x; - } else { - // Smallest penetration on z-axis - goto ZAXIS; - } - } else if (distOutsideBox.y > distOutsideBox.z) { - // Smallest penetration on y-axis - // Chose normal based on which side we're closest to. - // Keep in mind that this is a normal to the sphere, - // so it is the inverse of the box normal. - if (center.y > 0) { - contactNormals.append(boxFrame.normalToWorldSpace(-Vector3::unitY())); - } else { - contactNormals.append(boxFrame.normalToWorldSpace(Vector3::unitY())); - } - depth = -distOutsideBox.y; - } else { - // Smallest on z-axis -ZAXIS: - // Chose normal based on which side we're closest to. - // Keep in mind that this is a normal to the sphere, - // so it is the inverse of the box normal. - if (center.z > 0) { - contactNormals.append(boxFrame.normalToWorldSpace(-Vector3::unitZ())); - } else { - contactNormals.append(boxFrame.normalToWorldSpace(Vector3::unitZ())); - } - depth = -distOutsideBox.z; - } - break; - - default: - debugAssertM(false, "Fell through switch"); - break; - } - - return depth; -} - - -float CollisionDetection::penetrationDepthForFixedSphereFixedSphere( - const Sphere& sphereA, - const Sphere& sphereB, - Array& contactPoints, - Array& contactNormals) { - - Vector3 axis = sphereB.center - sphereA.center; - double radius = sphereA.radius + sphereB.radius; - double mag = axis.magnitude(); - axis /= mag; - double depth = -(mag - radius); - - contactPoints.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - contactNormals.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - - if (depth >= 0) { - contactPoints.append(sphereA.center + axis * (sphereA.radius - depth / 2)); - contactNormals.append(axis); - } - - return depth; -} - - -float CollisionDetection::penetrationDepthForFixedSphereFixedPlane( - const Sphere& sphereA, - const Plane& planeB, - Array& contactPoints, - Array& contactNormals) { - - Vector3 N; - double d; - - planeB.getEquation(N, d); - - double depth = -(sphereA.center.dot(N) + d - sphereA.radius); - - contactPoints.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - contactNormals.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - - if (depth >= 0) { - contactPoints.append(N * (depth - sphereA.radius) + sphereA.center); - contactNormals.append(N); - } - - return depth; -} - - -float CollisionDetection::penetrationDepthForFixedBoxFixedPlane( - const Box& box, - const Plane& plane, - Array& contactPoints, - Array& contactNormals) { - - Vector3 N; - double d; - - plane.getEquation(N, d); - - contactPoints.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - contactNormals.resize(0, DONT_SHRINK_UNDERLYING_ARRAY); - - float lowest = (float)inf(); - for (int i = 0; i < 8; ++i) { - const Vector3 vertex = box.corner(i); - - float x = vertex.dot(N) + (float)d; - - if (x <= 0) { - // All vertices below the plane should be contact points. - contactPoints.append(vertex); - contactNormals.append(-N); - } - - lowest = min(lowest, x); - } - - // Depth should be a positive number - return -lowest; -} - - -float CollisionDetection::collisionTimeForMovingPointFixedPlane( - const Vector3& point, - const Vector3& velocity, - const Plane& plane, - Vector3& location, - Vector3& outNormal) { - - // Solve for the time at which normal.dot(point + velocity) + d == 0. - double d; - Vector3 normal; - plane.getEquation(normal, d); - - float vdotN = velocity.dot(normal); - float pdotN = point.dot(normal); - - if (fuzzyEq(pdotN + d, 0)) { - // The point is *in* the plane. - location = point; - outNormal = normal; - return 0; - } - - if (vdotN >= 0) { - // no collision will occur - location = Vector3::inf(); - return (float)inf(); - } - - float t = -(pdotN + d) / vdotN; - if (t < 0) { - location = Vector3::inf(); - return (float)inf(); - } else { - location = point + velocity * t; - outNormal = normal; - return t; - } -} - - -float CollisionDetection::collisionTimeForMovingPointFixedSphere( - const Vector3& point, - const Vector3& velocity, - const Sphere& sphere, - Vector3& location, - Vector3& outNormal) { - - double speed = velocity.magnitude(); - Vector3 direction = velocity / speed; - - Vector3 L = sphere.center - point; - double d = L.dot(direction); - - double L2 = L.dot(L); - double R2 = sphere.radius * sphere.radius; - double D2 = d * d; - - if ((d < 0) && (L2 > R2)) { - location = Vector3::inf(); - return inf(); - } - - double M2 = L2 - D2; - - if (M2 > R2) { - location = Vector3::inf(); - return inf(); - } - - double q = sqrt(R2 - M2); - double time; - - if (L2 > R2) { - time = d - q; - } else { - time = d + q; - } - - time /= speed; - - location = point + velocity * time; - outNormal = (location - sphere.center).direction(); - - return time; -} - - -float CollisionDetection::collisionTimeForMovingSphereFixedSphere( - const Sphere& movingSphere, - const Vector3& velocity, - const Sphere& fixedSphere, - Vector3& location, - Vector3& outNormal) { - - double time = collisionTimeForMovingPointFixedSphere(movingSphere.center, velocity, Sphere(fixedSphere.center, fixedSphere.radius + movingSphere.radius), location, outNormal); - - if (time < inf()) { - // Location is now the center of the moving sphere at the collision time. - // Adjust for the size of the moving sphere. Two spheres always collide - // along a line between their centers. - location += (location - fixedSphere.center) * movingSphere.radius / fixedSphere.radius; - } - - return time; -} - - -/* -float CollisionDetection::collisionTimeForMovingPointFixedTriangle( - const Vector3& point, - const Vector3& velocity, - const Triangle& triangle, - Vector3& outLocation, - Vector3& outNormal) { - - double time = collisionTimeForMovingPointFixedPlane(point, velocity, triangle.plane(), outLocation, outNormal); - - if (time == inf()) { - // No collision with the plane of the triangle. - return inf(); - } - - if (isPointInsideTriangle(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), triangle.normal(), outLocation, triangle.primaryAxis())) { - // Collision occured inside the triangle - return time; - } else { - // Missed the triangle - outLocation = Vector3::inf(); - return inf(); - } -}*/ - -/* -float CollisionDetection::collisionTimeForMovingPointFixedTriangle( - const Vector3& orig, - const Vector3& dir, - const Vector3& vert0, - const Vector3& vert1, - const Vector3& vert2) { - - // Barycenteric coords - double u, v; - #define EPSILON 0.000001 - #define CROSS(dest,v1,v2) \ - dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \ - dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \ - dest[2]=v1[0]*v2[1]-v1[1]*v2[0]; - - #define DOT(v1,v2) (v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]) - - #define SUB(dest,v1,v2) \ - dest[0]=v1[0]-v2[0]; \ - dest[1]=v1[1]-v2[1]; \ - dest[2]=v1[2]-v2[2]; - - double edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; - - // find vectors for two edges sharing vert0 - SUB(edge1, vert1, vert0); - SUB(edge2, vert2, vert0); - - // begin calculating determinant - also used to calculate U parameter - CROSS(pvec, dir, edge2); - - // if determinant is near zero, ray lies in plane of triangle - const double det = DOT(edge1, pvec); - - if (det < EPSILON) { - return inf(); - } - - // calculate distance from vert0 to ray origin - SUB(tvec, orig, vert0); - - // calculate U parameter and test bounds - u = DOT(tvec, pvec); - if ((u < 0.0) || (u > det)) { - // Hit the plane outside the triangle - return inf(); - } - - // prepare to test V parameter - CROSS(qvec, tvec, edge1); - - // calculate V parameter and test bounds - v = DOT(dir, qvec); - if ((v < 0.0) || (u + v > det)) { - // Hit the plane outside the triangle - return inf(); - } - - // calculate t, scale parameters, ray intersects triangle - // If we want u,v, we can compute this - // double t = DOT(edge2, qvec); - //const double inv_det = 1.0 / det; - //t *= inv_det; - //u *= inv_det; - //v *= inv_det; - // return t; - - // Case where we don't need correct (u, v): - - const double t = DOT(edge2, qvec); - - if (t >= 0) { - // Note that det must be positive - return t / det; - } else { - // We had to travel backwards in time to intersect - return inf(); - } - - #undef EPSILON - #undef CROSS - #undef DOT - #undef SUB -} -*/ - -float CollisionDetection::collisionTimeForMovingPointFixedBox( - const Vector3& point, - const Vector3& velocity, - const Box& box, - Vector3& location, - Vector3& outNormal) { - - double bestTime; - - Vector3 normal; - Vector3 v[4]; - - // Prime the loop - int f = 0; - box.getFaceCorners(f, v[0], v[1], v[2], v[3]); - bestTime = collisionTimeForMovingPointFixedRectangle(point, velocity, v[0], v[1], v[2], v[3], location, normal); - outNormal = normal; - - // Check other faces - for (f = 1; f < 6; ++f) { - Vector3 pos; - box.getFaceCorners(f, v[0], v[1], v[2], v[3]); - float time = collisionTimeForMovingPointFixedRectangle(point, velocity, v[0], v[1], v[2], v[3], pos, normal); - if (time < bestTime) { - bestTime = time; - outNormal = normal; - location = pos; - } - } - - return bestTime; -} - - -float CollisionDetection::collisionTimeForMovingPointFixedAABox( - const Vector3& origin, - const Vector3& dir, - const AABox& box, - Vector3& location, - bool& Inside, - Vector3& normal) { - - if (collisionLocationForMovingPointFixedAABox(origin, dir, box, location, Inside, normal)) { - return (location - origin).magnitude(); - } else { - return (float)inf(); - } -} - - -bool CollisionDetection::collisionLocationForMovingPointFixedAABox( - const Vector3& origin, - const Vector3& dir, - const AABox& box, - Vector3& location, - bool& Inside, - Vector3& normal) { - - // Integer representation of a floating-point value. - #define IR(x) ((uint32&)x) - - Inside = true; - const Vector3& MinB = box.low(); - const Vector3& MaxB = box.high(); - Vector3 MaxT(-1.0f, -1.0f, -1.0f); - - // Find candidate planes. - for (int i = 0; i < 3; ++i) { - if (origin[i] < MinB[i]) { - location[i] = MinB[i]; - Inside = false; - - // Calculate T distances to candidate planes - if (IR(dir[i])) { - MaxT[i] = (MinB[i] - origin[i]) / dir[i]; - } - } else if (origin[i] > MaxB[i]) { - location[i] = MaxB[i]; - Inside = false; - - // Calculate T distances to candidate planes - if (IR(dir[i])) { - MaxT[i] = (MaxB[i] - origin[i]) / dir[i]; - } - } - } - - if (Inside) { - // Ray origin inside bounding box - location = origin; - return false; - } - - // Get largest of the maxT's for final choice of intersection - int WhichPlane = 0; - if (MaxT[1] > MaxT[WhichPlane]) { - WhichPlane = 1; - } - - if (MaxT[2] > MaxT[WhichPlane]) { - WhichPlane = 2; - } - - // Check final candidate actually inside box - if (IR(MaxT[WhichPlane]) & 0x80000000) { - // Miss the box - return false; - } - - for (int i = 0; i < 3; ++i) { - if (i != WhichPlane) { - location[i] = origin[i] + MaxT[WhichPlane] * dir[i]; - if ((location[i] < MinB[i]) || - (location[i] > MaxB[i])) { - // On this plane we're outside the box extents, so - // we miss the box - return false; - } - } - } - - // Choose the normal to be the plane normal facing into the ray - normal = Vector3::zero(); - normal[WhichPlane] = (dir[WhichPlane] > 0) ? -1.0 : 1.0; - - return true; - - #undef IR -} - - - -float CollisionDetection::collisionTimeForMovingPointFixedRectangle( - const Vector3& point, - const Vector3& velocity, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - Vector3& location, - Vector3& outNormal) { - - Plane plane = Plane(v0, v1, v2); - - float time = collisionTimeForMovingPointFixedPlane(point, velocity, plane, location, outNormal); - - if (time == inf()) { - // No collision is ever going to happen - return time; - } - - if (isPointInsideRectangle(v0, v1, v2, v3, plane.normal(), location)) { - // The intersection point is inside the rectangle; that is the location where - // the point hits the rectangle. - return time; - } else { - return inf(); - } -} - -/** Used by findRayCapsuleIntersection. - @cite From magic software http://www.magic-software.com/Source/Intersection3D/MgcIntr3DLinCap.cpp */ -static int findRayCapsuleIntersectionAux( - const Vector3& rkOrigin, - const Vector3& rkDirection, - const Capsule& rkCapsule, - double afT[2]) { - - Vector3 capsuleDirection = rkCapsule.point(1) - rkCapsule.point(0); - - // set up quadratic Q(t) = a*t^2 + 2*b*t + c - Vector3 kU, kV, kW = capsuleDirection; - float fWLength = kW.unitize(); - Vector3::generateOrthonormalBasis(kU, kV, kW); - Vector3 kD(kU.dot(rkDirection), kV.dot(rkDirection), kW.dot(rkDirection)); - float fDLength = kD.unitize(); - - float fEpsilon = 1e-6f; - - float fInvDLength = 1.0f/fDLength; - Vector3 kDiff = rkOrigin - rkCapsule.point(0); - Vector3 kP(kU.dot(kDiff),kV.dot(kDiff),kW.dot(kDiff)); - float fRadiusSqr = square(rkCapsule.radius()); - - float fInv, fA, fB, fC, fDiscr, fRoot, fT, fTmp; - - // Is the velocity parallel to the capsule direction? (or zero) - if ((abs(kD.z) >= 1.0f - fEpsilon) || (fDLength < fEpsilon)) { - - float fAxisDir = rkDirection.dot(capsuleDirection); - - fDiscr = fRadiusSqr - kP.x*kP.x - kP.y*kP.y; - if ((fAxisDir < 0) && (fDiscr >= 0.0f)) { - // Velocity anti-parallel to the capsule direction - fRoot = sqrt(fDiscr); - afT[0] = (kP.z + fRoot)*fInvDLength; - afT[1] = -(fWLength - kP.z + fRoot)*fInvDLength; - return 2; - } else if ((fAxisDir > 0) && (fDiscr >= 0.0f)) { - // Velocity parallel to the capsule direction - fRoot = sqrt(fDiscr); - afT[0] = -(kP.z + fRoot)*fInvDLength; - afT[1] = (fWLength - kP.z + fRoot)*fInvDLength; - return 2; - } else { - // sphere heading wrong direction, or no velocity at all - return 0; - } - } - - // test intersection with infinite cylinder - fA = kD.x*kD.x + kD.y*kD.y; - fB = kP.x*kD.x + kP.y*kD.y; - fC = kP.x*kP.x + kP.y*kP.y - fRadiusSqr; - fDiscr = fB*fB - fA*fC; - if (fDiscr < 0.0f) { - // line does not intersect infinite cylinder - return 0; - } - - int iQuantity = 0; - - if (fDiscr > 0.0f) { - // line intersects infinite cylinder in two places - fRoot = sqrt(fDiscr); - fInv = 1.0f/fA; - fT = (-fB - fRoot)*fInv; - fTmp = kP.z + fT*kD.z; - if ((0.0f <= fTmp) && (fTmp <= fWLength)) { - afT[iQuantity] = fT * fInvDLength; - iQuantity++; - } - - fT = (-fB + fRoot)*fInv; - fTmp = kP.z + fT*kD.z; - - if ((0.0f <= fTmp) && (fTmp <= fWLength)) { - afT[iQuantity++] = fT*fInvDLength; - } - - if (iQuantity == 2) { - // line intersects capsule wall in two places - return 2; - } - } else { - // line is tangent to infinite cylinder - fT = -fB/fA; - fTmp = kP.z + fT*kD.z; - if ((0.0f <= fTmp) && (fTmp <= fWLength)) { - afT[0] = fT*fInvDLength; - return 1; - } - } - - // test intersection with bottom hemisphere - // fA = 1 - fB += kP.z*kD.z; - fC += kP.z*kP.z; - fDiscr = fB*fB - fC; - if (fDiscr > 0.0f) { - fRoot = sqrt(fDiscr); - fT = -fB - fRoot; - fTmp = kP.z + fT*kD.z; - if (fTmp <= 0.0f) { - afT[iQuantity++] = fT*fInvDLength; - if (iQuantity == 2) { - return 2; - } - } - - fT = -fB + fRoot; - fTmp = kP.z + fT*kD.z; - if (fTmp <= 0.0f) { - afT[iQuantity++] = fT*fInvDLength; - if (iQuantity == 2) { - return 2; - } - } - } else if (fDiscr == 0.0f) { - fT = -fB; - fTmp = kP.z + fT*kD.z; - if (fTmp <= 0.0f) { - afT[iQuantity++] = fT*fInvDLength; - if (iQuantity == 2) { - return 2; - } - } - } - - // test intersection with top hemisphere - // fA = 1 - fB -= kD.z*fWLength; - fC += fWLength*(fWLength - 2.0f*kP.z); - - fDiscr = fB*fB - fC; - if (fDiscr > 0.0f) { - fRoot = sqrt(fDiscr); - fT = -fB - fRoot; - fTmp = kP.z + fT*kD.z; - if (fTmp >= fWLength) { - afT[iQuantity++] = fT*fInvDLength; - if (iQuantity == 2) { - return 2; - } - } - - fT = -fB + fRoot; - fTmp = kP.z + fT*kD.z; - if (fTmp >= fWLength) { - afT[iQuantity++] = fT*fInvDLength; - if (iQuantity == 2) { - return 2; - } - } - } else if (fDiscr == 0.0f) { - fT = -fB; - fTmp = kP.z + fT*kD.z; - if (fTmp >= fWLength) { - afT[iQuantity++] = fT*fInvDLength; - if (iQuantity == 2) { - return 2; - } - } - } - - return iQuantity; -} - - -/** Used by collisionTimeForMovingPointFixedCapsule. - @cite From magic software http://www.magic-software.com/Source/Intersection3D/MgcIntr3DLinCap.cpp - - @param rkRay The ray - @param rkCapsule The capsule - @param riQuantity The number of intersections found - @param akPoint The intersections found - @return True if there is at least one intersection - */ -static bool findRayCapsuleIntersection( - const Ray& rkRay, - const Capsule& rkCapsule, - int& riQuantity, - Vector3 akPoint[2]) { - - double afT[2]; - riQuantity = findRayCapsuleIntersectionAux(rkRay.origin, rkRay.direction, rkCapsule, afT); - - // Only return intersections that occur in the future - int iClipQuantity = 0; - int i; - for (i = 0; i < riQuantity; i++) { - if (afT[i] >= 0.0f) { - akPoint[iClipQuantity] = rkRay.origin + afT[i] * rkRay.direction; - iClipQuantity++; - } - } - - riQuantity = iClipQuantity; - return (riQuantity > 0); -} - -float CollisionDetection::collisionTimeForMovingPointFixedCapsule( - const Vector3& _point, - const Vector3& velocity, - const Capsule& capsule, - Vector3& location, - Vector3& outNormal) { - - float timeScale = velocity.magnitude(); - - if (timeScale == 0.0f) { - timeScale = 1; - } - - Vector3 direction = velocity / timeScale; - int numIntersections; - Vector3 intersection[2]; - findRayCapsuleIntersection(Ray::fromOriginAndDirection(_point, direction), capsule, numIntersections, intersection); - - if (numIntersections == 2) { - // A collision can only occur if there are two intersections. If there is one - // intersection, that one is exiting the capsule. - - // Find the entering intersection (the first one that occurs). - float d0 = (intersection[0] - _point).squaredMagnitude(); - float d1 = (intersection[1] - _point).squaredMagnitude(); - - // Compute the surface normal (if we aren't ignoring the result) - if (&outNormal != &ignore) { - Vector3 p2 = LineSegment::fromTwoPoints(capsule.point(0), capsule.point(1)).closestPoint(_point); - outNormal = (_point - p2).direction(); - } - - if (d0 > d1) { - location = intersection[1]; - return sqrt(d1) / timeScale; - } else { - location = intersection[0]; - return sqrt(d0) / timeScale; - } - } else { - // No entering intersection discovered; return no intersection. - location = Vector3::inf(); - return inf(); - } -} - - -float CollisionDetection::collisionTimeForMovingSphereFixedPlane( - const Sphere& sphere, - const Vector3& velocity, - const Plane& plane, - Vector3& location, - Vector3& outNormal) { - - if (sphere.radius == 0) { - // Optimization for zero radius sphere - return collisionTimeForMovingPointFixedPlane(sphere.center, velocity, plane, location, outNormal); - } - - // The collision point on the sphere will be the point at - // center - (radius * normal). Collisions only occur when - // the sphere is travelling into the plane. - - double d; - plane.getEquation(outNormal, d); - - double vdotN = velocity.dot(outNormal); - - if (fuzzyGt(vdotN, 0)) { - // No collision when the sphere is moving towards a backface. - location = Vector3::inf(); - return (float)inf(); - } - - float cdotN = sphere.center.dot(outNormal); - - // Distance from the center to the plane - float distance = cdotN + (float)d; - - // Where is the collision on the sphere? - Vector3 point = sphere.center - (sphere.radius * outNormal); - - if (fuzzyLe(G3D::abs(distance), sphere.radius)) { - // Already interpenetrating - location = sphere.center - distance * outNormal; - return 0; - } else { - return collisionTimeForMovingPointFixedPlane(point, velocity, plane, location, outNormal); - } - -} - - -float CollisionDetection::collisionTimeForMovingSphereFixedTriangle( - const class Sphere& sphere, - const Vector3& velocity, - const Triangle& triangle, - Vector3& outLocation, - float b[3]) { - - Vector3 dummy; - float time = collisionTimeForMovingSphereFixedPlane(sphere, velocity, triangle.plane(), - outLocation, dummy); - - if (time == inf()) { - // No collision is ever going to happen - return time; - } - - // We will hit the plane of the triangle at *time*. See if - // the intersection point actually is within the triangle. - - if (isPointInsideTriangle(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), triangle.normal(), - outLocation, b, triangle.primaryAxis())) { - - // The intersection point is inside the triangle; that is the location where - // the sphere hits the triangle. - -# ifdef G3D_DEBUG - { - // Internal consistency checks - debugAssertM(b[0] >= 0.0 && b[0] <= 1.0f, "Intersection is outside triangle."); - debugAssertM(b[1] >= 0.0 && b[1] <= 1.0f, "Intersection is outside triangle."); - debugAssertM(b[2] >= 0.0 && b[2] <= 1.0f, "Intersection is outside triangle."); - Vector3 blend = - b[0] * triangle.vertex(0) + - b[1] * triangle.vertex(1) + - b[2] * triangle.vertex(2); - debugAssertM(blend.fuzzyEq(outLocation), "Barycentric coords don't match intersection."); - // Call again so that we can debug the problem - // isPointInsideTriangle(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), triangle.normal(), - // outLocation, b, triangle.primaryAxis()); - } -# endif - - return time; - } - - // The collision (if it exists) is with a point on the triangle perimeter. - // Switch over to moving the triangle towards a fixed sphere and see at what time - // they will hit. - - // Closest point on the triangle to the sphere intersection with the plane. - int edgeIndex; - const Vector3& point = closestPointOnTrianglePerimeter(triangle._vertex, triangle.edgeDirection, - triangle.edgeMagnitude, outLocation, edgeIndex); - - float t = 0; - if (! sphere.contains(point)) { - // The point is outside the sphere--see when it will hit - t = collisionTimeForMovingPointFixedSphere(point, -velocity, sphere, dummy, dummy); - } - - if (t < inf()) { - outLocation = point; - // Compute Barycentric coords - - // Index of the next vertex - static const int next[] = {1, 2, 0}; - - // Project along the edge in question. - // Avoid sqrt by taking advantage of the existing edgeDirection unit vector. - b[next[edgeIndex]] = (outLocation - triangle._vertex[edgeIndex]).dot - (triangle.edgeDirection[edgeIndex]) / triangle.edgeMagnitude[edgeIndex]; - - b[edgeIndex] = 1.0f - b[next[edgeIndex]]; - - b[next[next[edgeIndex]]] = 0.0f; - -# ifdef G3D_DEBUG - { - // Internal consistency checks - for (int i = 0; i < 3; ++i) { - debugAssertM(fuzzyGe(b[i], 0.0f) && fuzzyLe(b[i], 1.0f), "Intersection is outside triangle."); - } - Vector3 blend = - b[0] * triangle.vertex(0) + - b[1] * triangle.vertex(1) + - b[2] * triangle.vertex(2); - debugAssertM(blend.fuzzyEq(outLocation), - format("Barycentric coords don't match intersection. %s != %s", - blend.toString().c_str(), - outLocation.toString().c_str())); - - // Call again so that we can debug the problem - collisionTimeForMovingPointFixedSphere(point, -velocity, sphere, dummy, dummy); - } -# endif - - // Due to tiny roundoffs, these values might be slightly out of bounds. - // Ensure that they are legal. Note that the above debugging code - // verifies that we are not clamping truly illegal values. - for (int i = 0; i < 3; ++i) { - b[i] = clamp(b[i], 0.0f, 1.0f); - } - } - - // The collision occured at the point, if it occured. The normal - // was the plane normal, computed above. - - return t; -} - - -float CollisionDetection::collisionTimeForMovingSphereFixedRectangle( - const Sphere& sphere, - const Vector3& velocity, - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - Vector3& location, - Vector3& outNormal) { - - Plane plane(v0, v1, v2); - - float time = collisionTimeForMovingSphereFixedPlane(sphere, velocity, plane, location, outNormal); - - if (time == inf()) { - // No collision is ever going to happen - return time; - } - - if (isPointInsideRectangle(v0, v1, v2, v3, plane.normal(), location)) { - // The intersection point is inside the rectangle; that is the location where - // the sphere hits the rectangle. - return time; - } - - // Switch over to moving the rectangle towards a fixed sphere and see at what time - // they will hit. - - Vector3 point = closestPointToRectanglePerimeter(v0, v1, v2, v3, sphere.center); - - Vector3 dummy; - double t = collisionTimeForMovingPointFixedSphere(point, -velocity, sphere, location, dummy); - - // Normal is the plane normal, location is the original location of the point. - location = point; - - return t; -} - - -float CollisionDetection::collisionTimeForMovingSphereFixedBox( - const Sphere& sphere, - const Vector3& velocity, - const Box& box, - Vector3& location, - Vector3& outNormal) { - - if (fixedSolidSphereIntersectsFixedSolidBox(sphere, box)) { - // TODO: Compute more useful location and normal? - location = sphere.center; - outNormal = Vector3::zero(); - return 0; - } - - float bestTime; - - Vector3 v[4]; - int f = 0; - box.getFaceCorners(f, v[0], v[1], v[2], v[3]); - bestTime = collisionTimeForMovingSphereFixedRectangle(sphere, velocity, v[0], v[1], v[2], v[3], location, outNormal); - - for (f = 1; f < 6; ++f) { - Vector3 pos, normal; - box.getFaceCorners(f, v[0], v[1], v[2], v[3]); - float time = collisionTimeForMovingSphereFixedRectangle(sphere, velocity, v[0], v[1], v[2], v[3], pos, normal); - if (time < bestTime) { - bestTime = time; - location = pos; - outNormal = normal; - } - } - - return bestTime; -} - - -float CollisionDetection::collisionTimeForMovingSphereFixedCapsule( - const Sphere& sphere, - const Vector3& velocity, - const Capsule& capsule, - Vector3& location, - Vector3& outNormal) { - - (void)outNormal; - - Capsule _capsule(capsule.point(0), capsule.point(1), capsule.radius() + sphere.radius); - - Vector3 normal; - double time = collisionTimeForMovingPointFixedCapsule(sphere.center, velocity, _capsule, location, normal); - - if (time < inf()) { - // Location is now the position of the center of the sphere at the time of collision. - // We have to adjust the collision location for the size of the sphere. - location -= sphere.radius * normal; - } - - return time; -} - - -Vector3 CollisionDetection::bounceDirection( - const Sphere& sphere, - const Vector3& velocity, - const float collisionTime, - const Vector3& collisionLocation, - const Vector3& collisionNormal) { - - // Location when the collision occurs - Vector3 sphereLocation = sphere.center + velocity * collisionTime; - - Vector3 normal = (sphereLocation - collisionLocation); - if (fuzzyEq(normal.squaredMagnitude(), 0)) { - normal = collisionNormal; - } else { - normal.unitize(); - } - - Vector3 direction = velocity.direction(); - - // Reflect direction about the normal - return direction - 2.0 * normal * normal.dot(direction); -} - - -Vector3 CollisionDetection::slideDirection( - const Sphere& sphere, - const Vector3& velocity, - const float collisionTime, - const Vector3& collisionLocation) { - - Vector3 sphereLocation = sphere.center + velocity * collisionTime; - Vector3 normal = (sphereLocation - collisionLocation).direction(); - Vector3 direction = velocity.direction(); - - // subtract off the part in the direction away from the normal. - return direction - normal * normal.dot(direction); -} - - -Vector3 CollisionDetection::closestPointOnLineSegment( - const Vector3& v0, - const Vector3& v1, - const Vector3& point) { - - const Vector3& edge = (v1 - v0); - float edgeLength = edge.magnitude(); - - if (edgeLength == 0) { - // The line segment is a point - return v0; - } - - return closestPointOnLineSegment(v0, v1, edge / edgeLength, edgeLength, point); -} - - -Vector3 CollisionDetection::closestPointOnLineSegment( - const Vector3& v0, - const Vector3& v1, - const Vector3& edgeDirection, - const float edgeLength, - const Vector3& point) { - - debugAssert((v1 - v0).direction().fuzzyEq(edgeDirection)); - debugAssert(fuzzyEq((v1 - v0).magnitude(), edgeLength)); - - // Vector towards the point - const Vector3& c = point - v0; - - // Projected onto the edge itself - float t = edgeDirection.dot(c); - - if (t <= 0) { - // Before the start - return v0; - } else if (t >= edgeLength) { - // After the end - return v1; - } else { - // At distance t along the edge - return v0 + edgeDirection * t; - } -} - - -Vector3 CollisionDetection::closestPointOnTrianglePerimeter( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& point) { - - Vector3 v[3] = {v0, v1, v2}; - Vector3 edgeDirection[3] = {(v1 - v0), (v2 - v1), (v0 - v2)}; - float edgeLength[3]; - - for (int i = 0; i < 3; ++i) { - edgeLength[i] = edgeDirection[i].magnitude(); - edgeDirection[i] /= edgeLength[i]; - } - - int edgeIndex; - return closestPointOnTrianglePerimeter(v, edgeDirection, edgeLength, point, edgeIndex); -} - - -Vector3 CollisionDetection::closestPointOnTrianglePerimeter( - const Vector3 v[3], - const Vector3 edgeDirection[3], - const float edgeLength[3], - const Vector3& point, - int& edgeIndex) { - - // Closest point on segment from v[i] to v[i + 1] - Vector3 r[3]; - - // Distance squared from r[i] to point - float d[3]; - - // Index of the next point - static const int next[] = {1, 2, 0}; - - for (int i = 0; i < 3; ++i) { - r[i] = closestPointOnLineSegment(v[i], v[next[i]], edgeDirection[i], edgeLength[i], point); - d[i] = (r[i] - point).squaredMagnitude(); - } - - if (d[0] < d[1]) { - if (d[0] < d[2]) { - // Between v0 and v1 - edgeIndex = 0; - } else { - // Between v2 and v0 - edgeIndex = 2; - } - } else { - if (d[1] < d[2]) { - // Between v1 and v2 - edgeIndex = 1; - } else { - // Between v2 and v0 - edgeIndex = 2; - } - } - -# ifdef G3D_DEBUG - { - Vector3 diff = r[edgeIndex] - v[edgeIndex]; - debugAssertM(fuzzyEq(diff.direction().dot(edgeDirection[edgeIndex]), 1.0f) || - diff.fuzzyEq(Vector3::zero()), "Point not on correct triangle edge"); - float frac = diff.dot(edgeDirection[edgeIndex])/edgeLength[edgeIndex]; - debugAssertM(frac >= -0.000001, "Point off low side of edge."); - debugAssertM(frac <= 1.000001, "Point off high side of edge."); - } -# endif - - return r[edgeIndex]; -} - - -bool CollisionDetection::isPointInsideTriangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& normal, - const Vector3& point, - float b[3], - Vector3::Axis primaryAxis) { - - if (primaryAxis == Vector3::DETECT_AXIS) { - primaryAxis = normal.primaryAxis(); - } - - // Check that the point is within the triangle using a Barycentric - // coordinate test on a two dimensional plane. - int i, j; - - switch (primaryAxis) { - case Vector3::X_AXIS: - i = Vector3::Y_AXIS; - j = Vector3::Z_AXIS; - break; - - case Vector3::Y_AXIS: - i = Vector3::Z_AXIS; - j = Vector3::X_AXIS; - break; - - case Vector3::Z_AXIS: - i = Vector3::X_AXIS; - j = Vector3::Y_AXIS; - break; - - default: - // This case is here to supress a warning on Linux - i = j = 0; - debugAssertM(false, "Should not get here."); - break; - } - - // See if all barycentric coordinates are non-negative - - // 2D area via cross product -# define AREA2(d, e, f) (((e)[i] - (d)[i]) * ((f)[j] - (d)[j]) - ((f)[i] - (d)[i]) * ((e)[j] - (d)[j])) - - // Area of the polygon - float area = AREA2(v0, v1, v2); - if (area == 0) { - // This triangle has zero area, so the point must not - // be in it unless the triangle point is the test point. - return (v0 == point); - } - - debugAssert(area != 0); - - float invArea = 1.0f / area; - - // (avoid normalization until absolutely necessary) - b[0] = AREA2(point, v1, v2) * invArea; - - if ((b[0] < 0.0f) || (b[0] > 1.0f)) { - return false; - } - - b[1] = AREA2(v0, point, v2) * invArea; - if ((b[1] < 0.0f) || (b[1] > 1.0f)) { - return false; - } - - b[2] = 1.0f - b[0] - b[1]; - -# undef AREA2 - - return (b[2] >= 0.0f) && (b[2] <= 1.0f); -} - - -bool CollisionDetection::isPointInsideRectangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& normal, - const Vector3& point) { - - return isPointInsideTriangle(v0, v1, v2, normal, point) || - isPointInsideTriangle(v2, v3, v0, normal, point); -} - - -Vector3 CollisionDetection::closestPointToRectanglePerimeter( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& point) { - - Vector3 r0 = closestPointOnLineSegment(v0, v1, point); - Vector3 r1 = closestPointOnLineSegment(v1, v2, point); - Vector3 r2 = closestPointOnLineSegment(v2, v3, point); - Vector3 r3 = closestPointOnLineSegment(v3, v0, point); - - double d0 = (r0 - point).squaredMagnitude(); - double d1 = (r1 - point).squaredMagnitude(); - double d2 = (r2 - point).squaredMagnitude(); - double d3 = (r3 - point).squaredMagnitude(); - - if (d0 < d1) { - if (d0 < d2) { - if (d0 < d3) { - return r0; - } else { - return r3; - } - } else { - if (d2 < d3) { - return r2; - } else { - return r3; - } - } - } else { - if (d1 < d2) { - if (d1 < d3) { - return r1; - } else { - return r3; - } - } else { - if (d2 < d3) { - return r2; - } else { - return r3; - } - } - } -} - - -Vector3 CollisionDetection::closestPointToRectangle( - const Vector3& v0, - const Vector3& v1, - const Vector3& v2, - const Vector3& v3, - const Vector3& point) { - - Plane plane(v0, v1, v2); - - // Project the point into the plane - double a, b, c, d; - plane.getEquation(a, b, c, d); - - double distance = a*point.x + b*point.y + c*point.z + d; - Vector3 planePoint = point - distance * plane.normal(); - - if (isPointInsideRectangle(v0, v1, v2, v3, plane.normal(), planePoint)) { - return planePoint; - } else { - return closestPointToRectanglePerimeter(v0, v1, v2, v3, planePoint); - } -} - - -bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidSphere( - const Sphere& sphere1, - const Sphere& sphere2) { - - return (sphere1.center - sphere2.center).squaredMagnitude() < square(sphere1.radius + sphere2.radius); -} - - -bool CollisionDetection::fixedSolidSphereIntersectsFixedSolidBox( - const Sphere& sphere, - const Box& box) { - - // If the center of the sphere is within the box, the whole - // sphere is within the box. - if (box.contains(sphere.center)) { - return true; - } - - float r2 = square(sphere.radius); - - // Find the closest point on the surface of the box to the sphere. If - // this point is within the sphere's radius, they intersect. - int f; - for (f = 0; f < 6; ++f) { - Vector3 v0, v1, v2, v3; - box.getFaceCorners(f, v0, v1, v2, v3); - if ((closestPointToRectangle(v0, v1, v2, v3, sphere.center) - sphere.center).squaredMagnitude() <= r2) { - return true; - } - } - - return false; -} - - -bool CollisionDetection::movingSpherePassesThroughFixedBox( - const Sphere& sphere, - const Vector3& velocity, - const Box& box, - double timeLimit) { - - // If they intersect originally, they definitely pass through each other. - if (fixedSolidSphereIntersectsFixedSolidBox(sphere, box)) { - return true; - } - - // See if the sphere hits the box during the time period. - Vector3 dummy1, dummy2; - - return (collisionTimeForMovingSphereFixedBox(sphere, velocity, box, dummy1, dummy2) < timeLimit); -} - - -bool CollisionDetection::movingSpherePassesThroughFixedSphere( - const Sphere& sphere, - const Vector3& velocity, - const Sphere& fixedSphere, - double timeLimit) { - - if (fixedSolidSphereIntersectsFixedSolidSphere(sphere, fixedSphere)) { - return true; - } - - // Extend the fixed sphere by the radius of the moving sphere - Sphere bigFixed(fixedSphere.center, fixedSphere.radius + sphere.radius); - Vector3 dummy1, dummy2; - - // If the sphere collides with the other sphere during the time limit, it passes through - return (collisionTimeForMovingPointFixedSphere(sphere.center, velocity, bigFixed, dummy1, dummy2) < timeLimit); -} - - - -bool CollisionDetection::fixedSolidSphereIntersectsFixedTriangle( - const Sphere& sphere, - const Triangle& triangle) { - - // How far is the sphere from the plane of the triangle - const Plane& plane = triangle.plane(); - - // Does the closest point to the sphere center lie within the triangle? - Vector3 v = plane.closestPoint(sphere.center); - - // Is the closest point to the plane within the sphere? - if ((v - sphere.center).squaredLength() <= square(sphere.radius)) { - // Is it also within the triangle? - float b[3]; - if (isPointInsideTriangle(triangle.vertex(0), triangle.vertex(1), triangle.vertex(2), triangle.normal(), - v, b, triangle.primaryAxis())){ - // The closest point is inside the triangle - return true; - } - } - - // ignored - int edgeIndex; - - v = closestPointOnTrianglePerimeter(triangle._vertex, triangle.edgeDirection, triangle.edgeMagnitude, sphere.center, edgeIndex); - - // Is the closest point within the sphere? - return ((v - sphere.center).squaredLength() <= square(sphere.radius)); -} - - -} // namespace -#ifdef _MSC_VER -#pragma warning (pop) -#endif diff --git a/externals/g3dlite/G3D.lib/source/Color1.cpp b/externals/g3dlite/G3D.lib/source/Color1.cpp deleted file mode 100644 index 7e058a27d1a..00000000000 --- a/externals/g3dlite/G3D.lib/source/Color1.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/** - @file Color1.cpp - - Color class. - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-30 - @edited 2007-01-30 - */ - -#include "G3D/platform.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color1::Color1(BinaryInput& bi) { - deserialize(bi); -} - - -void Color1::deserialize(BinaryInput& bi) { - value = bi.readFloat32(); -} - - -void Color1::serialize(BinaryOutput& bo) const { - bo.writeFloat32(value); -} - - -Color1::Color1(const class Color1uint8& other) { - value = other.value / 255.0f; -} - -} // namespace G3D - diff --git a/externals/g3dlite/G3D.lib/source/Color1uint8.cpp b/externals/g3dlite/G3D.lib/source/Color1uint8.cpp deleted file mode 100644 index 0fd00693d4c..00000000000 --- a/externals/g3dlite/G3D.lib/source/Color1uint8.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - @file Color1uint8.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-30 - @edited 2007-01-30 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color1.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color1uint8::Color1uint8(const class Color1& c) : value(iClamp(iFloor(c.value * 256), 0, 255)) { -} - - -Color1uint8::Color1uint8(class BinaryInput& bi) { - deserialize(bi); -} - - -void Color1uint8::serialize(class BinaryOutput& bo) const { - bo.writeUInt8(value); -} - - -void Color1uint8::deserialize(class BinaryInput& bi) { - value = bi.readUInt8(); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/Color3.cpp b/externals/g3dlite/G3D.lib/source/Color3.cpp deleted file mode 100644 index 8183d8a0f62..00000000000 --- a/externals/g3dlite/G3D.lib/source/Color3.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/** - @file Color3.cpp - - Color class. - - @author Morgan McGuire, matrix@graphics3d.com - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - - @created 2001-06-02 - @edited 2006-01-13 - */ - -#include "G3D/platform.h" -#include -#include "G3D/Color3.h" -#include "G3D/Vector3.h" -#include "G3D/format.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Color3uint8.h" - -namespace G3D { - -const Color3& Color3::red() { - static Color3 c(1.0f, 0.0f, 0.0f); - return c; -} - - -const Color3& Color3::green() { - static Color3 c(0.0f, 1.0f, 0.0f); - return c; -} - - -const Color3& Color3::blue() { - static Color3 c(0.0f, 0.0f, 1.0f); - return c; -} - - -const Color3& Color3::purple() { - static Color3 c(0.7f, 0.0f, 1.0f); - return c; -} - - -const Color3& Color3::cyan() { - static Color3 c(0.0f, 0.7f, 1.0f); - return c; -} - - -const Color3& Color3::yellow() { - static Color3 c(1.0f, 1.0f, 0.0f); - return c; -} - - -const Color3& Color3::brown() { - static Color3 c(0.5f, 0.5f, 0.0f); - return c; -} - - -const Color3& Color3::orange() { - static Color3 c(1.0f, 0.5f, 0.0f); - return c; -} - - -const Color3& Color3::black() { - static Color3 c(0.0f, 0.0f, 0.0f); - return c; -} - -const Color3& Color3::zero() { - static Color3 c(0.0f, 0.0f, 0.0f); - return c; -} - - -const Color3& Color3::one() { - static Color3 c(1.0f, 1.0f, 1.0f); - return c; -} - - -const Color3& Color3::gray() { - static Color3 c(0.7f, 0.7f, 0.7f); - return c; -} - - -const Color3& Color3::white() { - static Color3 c(1, 1, 1); - return c; -} - - -Color3::Color3(BinaryInput& bi) { - deserialize(bi); -} - - -void Color3::deserialize(BinaryInput& bi) { - r = bi.readFloat32(); - g = bi.readFloat32(); - b = bi.readFloat32(); -} - - -void Color3::serialize(BinaryOutput& bo) const { - bo.writeFloat32(r); - bo.writeFloat32(g); - bo.writeFloat32(b); -} - - -const Color3& Color3::wheelRandom() { - static const Color3 colorArray[8] = - {Color3::blue(), Color3::red(), Color3::green(), - Color3::orange(), Color3::yellow(), - Color3::cyan(), Color3::purple(), Color3::brown()}; - - return colorArray[iRandom(0, 7)]; -} - - -size_t Color3::hashCode() const { - unsigned int rhash = (*(int*)(void*)(&r)); - unsigned int ghash = (*(int*)(void*)(&g)); - unsigned int bhash = (*(int*)(void*)(&b)); - - return rhash + (ghash * 37) + (bhash * 101); -} - - -Color3::Color3(const Vector3& v) { - r = v.x; - g = v.y; - b = v.z; -} - - -Color3::Color3(const class Color3uint8& other) { - r = other.r / 255.0f; - g = other.g / 255.0f; - b = other.b / 255.0f; -} - - -Color3 Color3::fromARGB(uint32 x) { - return Color3((float)((x >> 16) & 0xFF), (float)((x >> 8) & 0xFF), (float)(x & 0xFF)) / 255.0f; -} - -//---------------------------------------------------------------------------- - - -Color3 Color3::random() { - return Color3(uniformRandom(), - uniformRandom(), - uniformRandom()).direction(); -} - -//---------------------------------------------------------------------------- -Color3 Color3::operator/ (float fScalar) const { - Color3 kQuot; - - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - kQuot.r = fInvScalar * r; - kQuot.g = fInvScalar * g; - kQuot.b = fInvScalar * b; - return kQuot; - - } else { - - return Color3((float)G3D::inf(), (float)G3D::inf(), (float)G3D::inf()); - } -} - -//---------------------------------------------------------------------------- -Color3& Color3::operator/= (float fScalar) { - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - r *= fInvScalar; - g *= fInvScalar; - b *= fInvScalar; - } else { - r = (float)G3D::inf(); - g = (float)G3D::inf(); - b = (float)G3D::inf(); - } - - return *this; -} - -//---------------------------------------------------------------------------- -float Color3::unitize (float fTolerance) { - float fLength = length(); - - if ( fLength > fTolerance ) { - float fInvLength = 1.0f / fLength; - r *= fInvLength; - g *= fInvLength; - b *= fInvLength; - } else { - fLength = 0.0f; - } - - return fLength; -} - -//---------------------------------------------------------------------------- -Color3 Color3::fromHSV(const Vector3& _hsv) { - debugAssertM((_hsv.x <= 1.0f && _hsv.x >= 0.0f) - && (_hsv.y <= 1.0f && _hsv.y >= 0.0f) - && ( _hsv.z <= 1.0f && _hsv.z >= 0.0f), "H,S,V must be between [0,1]"); - const int i = G3D::iFloor(6.0*_hsv.x); - const float f = 6.0f * _hsv.x - i; - const float m = _hsv.z * (1.0f - (_hsv.y)); - const float n = _hsv.z * (1.0f - (_hsv.y * f)); - const float k = _hsv.z * (1.0f - (_hsv.y * (1 - f))); - switch(i) { - case 0: - return Color3(_hsv.z, k, m); - - case 1: - return Color3(n, _hsv.z, m); - - case 2: - return Color3(m, _hsv.z, k); - - case 3: - return Color3(m, n, _hsv.z); - - case 4: - return Color3(k, m, _hsv.z); - - case 5: - return Color3(_hsv.z, m, n); - - default: - debugAssertM(false, "fell through switch.."); - } - return Color3::black(); -} - - -Vector3 Color3::toHSV(const Color3& _rgb) { - debugAssertM((_rgb.r <= 1.0f && _rgb.r >= 0.0f) - && (_rgb.g <= 1.0f && _rgb.g >= 0.0f) - && (_rgb.b <= 1.0f && _rgb.b >= 0.0f), "R,G,B must be between [0,1]"); - Vector3 hsv = Vector3::zero(); - hsv.z = G3D::max(G3D::max(_rgb.r, _rgb.g), _rgb.b); - if (G3D::fuzzyEq(hsv.z, 0.0f)) { - return hsv; - } - - const float x = G3D::min(G3D::min(_rgb.r, _rgb.g), _rgb.b); - hsv.y = (hsv.z - x) / hsv.z; - - if (G3D::fuzzyEq(hsv.y, 0.0f)) { - return hsv; - } - - Vector3 rgbN; - rgbN.x = (hsv.z - _rgb.r) / (hsv.z - x); - rgbN.y = (hsv.z - _rgb.g) / (hsv.z - x); - rgbN.z = (hsv.z - _rgb.b) / (hsv.z - x); - - if (_rgb.r == hsv.z) { // note from the max we know that it exactly equals one of the three. - hsv.x = (_rgb.g == x)? 5.0f + rgbN.z : 1.0f - rgbN.y; - } else if (_rgb.g == hsv.z) { - hsv.x = (_rgb.b == x)? 1.0f + rgbN.x : 3.0f - rgbN.z; - } else { - hsv.x = (_rgb.r == x)? 3.0f + rgbN.y : 5.0f - rgbN.x; - } - - hsv.x /= 6.0f; - - return hsv; -} - -Color3 Color3::jetColorMap(const float& val) { - debugAssertM(val <= 1.0f && val >= 0.0f , "value should be in [0,1]"); - - //truncated triangles where sides have slope 4 - Color3 jet; - - jet.r = G3D::min(4.0f * val - 1.5f,-4.0f * val + 4.5f) ; - jet.g = G3D::min(4.0f * val - 0.5f,-4.0f * val + 3.5f) ; - jet.b = G3D::min(4.0f * val + 0.5f,-4.0f * val + 2.5f) ; - - - jet.r = G3D::clamp(jet.r, 0.0f, 1.0f); - jet.g = G3D::clamp(jet.g, 0.0f, 1.0f); - jet.b = G3D::clamp(jet.b, 0.0f, 1.0f); - - return jet; -} - - - - - -std::string Color3::toString() const { - return G3D::format("(%g, %g, %g)", r, g, b); -} - -//---------------------------------------------------------------------------- - -Color3 Color3::rainbowColorMap(float hue) { - return fromHSV(Vector3(hue, 1.0f, 1.0f)); -} - - -}; // namespace - diff --git a/externals/g3dlite/G3D.lib/source/Color3uint8.cpp b/externals/g3dlite/G3D.lib/source/Color3uint8.cpp deleted file mode 100644 index 837bf1b2c8b..00000000000 --- a/externals/g3dlite/G3D.lib/source/Color3uint8.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - @file Color3uint8.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2003-04-07 - @edited 2006-01-07 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color3uint8::Color3uint8(const class Color3& c) { - r = iMin(255, iFloor(c.r * 256)); - g = iMin(255, iFloor(c.g * 256)); - b = iMin(255, iFloor(c.b * 256)); -} - - -Color3uint8::Color3uint8(class BinaryInput& bi) { - deserialize(bi); -} - - -void Color3uint8::serialize(class BinaryOutput& bo) const { - bo.writeUInt8(r); - bo.writeUInt8(g); - bo.writeUInt8(b); -} - - -void Color3uint8::deserialize(class BinaryInput& bi) { - r = bi.readUInt8(); - g = bi.readUInt8(); - b = bi.readUInt8(); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/Color4.cpp b/externals/g3dlite/G3D.lib/source/Color4.cpp deleted file mode 100644 index ed2e91291a1..00000000000 --- a/externals/g3dlite/G3D.lib/source/Color4.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/** - @file Color4.cpp - - Color class. - - @author Morgan McGuire, matrix@graphics3d.com - @cite Portions by Laura Wollstadt, graphics3d.com - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - - @created 2002-06-25 - @edited 2006-01-10 - */ - -#include -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/Vector4.h" -#include "G3D/format.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -const Color4& Color4::zero() { - static Color4 c(0.0f, 0.0f, 0.0f, 0.0f); - return c; -} - - -const Color4& Color4::inf() { - static Color4 c((float)G3D::inf(), (float)G3D::inf(), (float)G3D::inf(), (float)G3D::inf()); - return c; -} - - -const Color4& Color4::clear() { - return Color4::zero(); -} - - -Color4::Color4(const Vector4& v) { - r = v.x; - g = v.y; - b = v.z; - a = v.w; -} - - -Color4::Color4(const Color4uint8& c) : r(c.r), g(c.g), b(c.b), a(c.a) { - *this /= 255.0f; -} - -size_t Color4::hashCode() const { - unsigned int rhash = (*(int*)(void*)(&r)); - unsigned int ghash = (*(int*)(void*)(&g)); - unsigned int bhash = (*(int*)(void*)(&b)); - unsigned int ahash = (*(int*)(void*)(&a)); - - return rhash + (ghash * 37) + (bhash * 101) + (ahash * 241); -} - -Color4 Color4::fromARGB(uint32 x) { - return Color4( - (float)((x >> 16) & 0xFF), - (float)((x >> 8) & 0xFF), - (float)(x & 0xFF), - (float)((x >> 24) & 0xFF)) / 255.0; -} - - -Color4::Color4(BinaryInput& bi) { - deserialize(bi); -} - - -void Color4::deserialize(BinaryInput& bi) { - r = bi.readFloat32(); - g = bi.readFloat32(); - b = bi.readFloat32(); - a = bi.readFloat32(); -} - - -void Color4::serialize(BinaryOutput& bo) const { - bo.writeFloat32(r); - bo.writeFloat32(g); - bo.writeFloat32(b); - bo.writeFloat32(a); -} - - -//---------------------------------------------------------------------------- - -Color4 Color4::operator/ (float fScalar) const { - Color4 kQuot; - - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - kQuot.r = fInvScalar * r; - kQuot.g = fInvScalar * g; - kQuot.b = fInvScalar * b; - kQuot.a = fInvScalar * a; - return kQuot; - - } else { - - return Color4::inf(); - } -} - -//---------------------------------------------------------------------------- - -Color4& Color4::operator/= (float fScalar) { - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - r *= fInvScalar; - g *= fInvScalar; - b *= fInvScalar; - a *= fInvScalar; - } else { - r = (float)G3D::inf(); - g = (float)G3D::inf(); - b = (float)G3D::inf(); - a = (float)G3D::inf(); - } - - return *this; -} - -//---------------------------------------------------------------------------- - -std::string Color4::toString() const { - return G3D::format("(%g, %g, %g, %g)", r, g, b, a); -} - -//---------------------------------------------------------------------------- - -}; // namespace - diff --git a/externals/g3dlite/G3D.lib/source/Color4uint8.cpp b/externals/g3dlite/G3D.lib/source/Color4uint8.cpp deleted file mode 100644 index 8c8636a742e..00000000000 --- a/externals/g3dlite/G3D.lib/source/Color4uint8.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - @file Color4uint8.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2003-04-07 - @edited 2006-01-07 - */ -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color4.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Color4uint8::Color4uint8(const class Color4& c) { - r = iMin(255, iFloor(c.r * 256)); - g = iMin(255, iFloor(c.g * 256)); - b = iMin(255, iFloor(c.b * 256)); - a = iMin(255, iFloor(c.a * 256)); -} - - -Color4uint8::Color4uint8(class BinaryInput& bi) { - deserialize(bi); -} - - -void Color4uint8::serialize(class BinaryOutput& bo) const { - bo.writeUInt8(r); - bo.writeUInt8(g); - bo.writeUInt8(b); - bo.writeUInt8(a); -} - - -void Color4uint8::deserialize(class BinaryInput& bi) { - r = bi.readUInt8(); - g = bi.readUInt8(); - b = bi.readUInt8(); - a = bi.readUInt8(); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/Cone.cpp b/externals/g3dlite/G3D.lib/source/Cone.cpp deleted file mode 100644 index 99b29b5b0af..00000000000 --- a/externals/g3dlite/G3D.lib/source/Cone.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/** - @file Cone.cpp - - Cone class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-07-09 - @edited 2006-01-29 -*/ - -#include "G3D/platform.h" -#include "G3D/Cone.h" -#include "G3D/Line.h" -#include "G3D/Sphere.h" -#include "G3D/Box.h" - -namespace G3D { - -Cone::Cone(const Vector3 &tip, const Vector3 &direction, float angle) { - this->tip = tip; - this->direction = direction.direction(); - this->angle = angle; - - debugAssert(angle >= 0); - debugAssert(angle <= pi()); -} - -/** - Forms the smallest cone that contains the box. Undefined if - the tip is inside or on the box. - */ -Cone::Cone(const Vector3& tip, const Box& box) { - this->tip = tip; - this->direction = (box.center() - tip).direction(); - - // Find the biggest angle - float smallestDotProduct = direction.dot((box.corner(0) - tip).direction()); - - for (int i = 1; i < 8; ++i) { - float dp = direction.dot((box.corner(i) - tip).direction()); - - debugAssert(dp > 0); - - if (dp < smallestDotProduct) { - smallestDotProduct = dp; - } - } - - angle = acosf(smallestDotProduct); -} - - -bool Cone::intersects(const Sphere& b) const { - // If the bounding sphere contains the tip, then - // they definitely touch. - if (b.contains(this->tip)) { - return true; - } - - // Move the tip backwards, effectively making the cone bigger - // to account for the radius of the sphere. - - Vector3 tip = this->tip - direction * b.radius / sinf(angle); - - return Cone(tip, direction, angle).contains(b.center); -} - - -bool Cone::contains(const Vector3& v) const { - - Vector3 d = (v - tip).direction(); - - float x = d.dot(direction); - - return (x > 0) && (x >= cosf(angle)); -} - -}; // namespace diff --git a/externals/g3dlite/G3D.lib/source/ConvexPolyhedron.cpp b/externals/g3dlite/G3D.lib/source/ConvexPolyhedron.cpp deleted file mode 100644 index 76dbe21a7c4..00000000000 --- a/externals/g3dlite/G3D.lib/source/ConvexPolyhedron.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/** - @file ConvexPolyhedron.cpp - - @author Morgan McGuire, morgan@graphics3d.com - - @created 2001-11-11 - @edited 2006-01-10 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/ConvexPolyhedron.h" -#include "G3D/debug.h" - -namespace G3D { - -ConvexPolygon::ConvexPolygon(const Array& __vertex) : _vertex(__vertex) { - // Intentionally empty -} - - -bool ConvexPolygon::isEmpty() const { - return (_vertex.length() == 0) || (getArea() <= fuzzyEpsilon); -} - - -float ConvexPolygon::getArea() const { - - if (_vertex.length() < 3) { - return 0; - } - - float sum = 0; - - int length = _vertex.length(); - // Split into triangle fan, compute individual area - for (int v = 2; v < length; v++) { - int i0 = 0; - int i1 = v - 1; - int i2 = v; - - sum += (_vertex[i1] - _vertex[i0]).cross(_vertex[i2] - _vertex[i0]).magnitude() / 2; - } - - return sum; -} - -void ConvexPolygon::cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below) { - DirectedEdge edge; - cut(plane, above, below, edge); -} - -void ConvexPolygon::cut(const Plane& plane, ConvexPolygon &above, ConvexPolygon &below, DirectedEdge &newEdge) { - above._vertex.resize(0); - below._vertex.resize(0); - - if (isEmpty()) { - //debugPrintf("Empty\n"); - return; - } - - int v = 0; - int length = _vertex.length(); - - - Vector3 polyNormal = normal(); - Vector3 planeNormal= plane.normal(); - - // See if the polygon is *in* the plane. - if (planeNormal.fuzzyEq(polyNormal) || planeNormal.fuzzyEq(-polyNormal)) { - // Polygon is parallel to the plane. It must be either above, - // below, or in the plane. - - double a, b, c, d; - Vector3 pt = _vertex[0]; - - plane.getEquation(a,b,c,d); - float r = (float)(a * pt.x + b * pt.y + c * pt.z + d); - - if (fuzzyGe(r, 0)) { - // The polygon is entirely in the plane. - //debugPrintf("Entirely above\n"); - above = *this; - return; - } else { - //debugPrintf("Entirely below (1)\n"); - below = *this; - return; - } - } - - - // Number of edges crossing the plane. Used for - // debug assertions. - int count = 0; - - // True when the last _vertex we looked at was above the plane - bool lastAbove = plane.halfSpaceContains(_vertex[v]); - - if (lastAbove) { - above._vertex.append(_vertex[v]); - } else { - below._vertex.append(_vertex[v]); - } - - for (v = 1; v < length; v++) { - bool isAbove = plane.halfSpaceContains(_vertex[v]); - - if (lastAbove ^ isAbove) { - // Switched sides. - // Create an interpolated point that lies - // in the plane, between the two points. - Line line = Line::fromTwoPoints(_vertex[v - 1], _vertex[v]); - Vector3 interp = line.intersection(plane); - - if (! interp.isFinite()) { - - // Since the polygon is not in the plane (we checked above), - // it must be the case that this edge (and only this edge) - // is in the plane. This only happens when the polygon is - // entirely below the plane except for one edge. This edge - // forms a degenerate polygon, so just treat the whole polygon - // as below the plane. - below = *this; - above._vertex.resize(0); - //debugPrintf("Entirely below\n"); - return; - } - - above._vertex.append(interp); - below._vertex.append(interp); - if (lastAbove) { - newEdge.stop = interp; - } else { - newEdge.start = interp; - } - count++; - } - - lastAbove = isAbove; - if (lastAbove) { - above._vertex.append(_vertex[v]); - } else { - below._vertex.append(_vertex[v]); - } - } - - // Loop back to the first point, seeing if an interpolated point is - // needed. - bool isAbove = plane.halfSpaceContains(_vertex[0]); - if (lastAbove ^ isAbove) { - Line line = Line::fromTwoPoints(_vertex[length - 1], _vertex[0]); - Vector3 interp = line.intersection(plane); - if (! interp.isFinite()) { - // Since the polygon is not in the plane (we checked above), - // it must be the case that this edge (and only this edge) - // is in the plane. This only happens when the polygon is - // entirely below the plane except for one edge. This edge - // forms a degenerate polygon, so just treat the whole polygon - // as below the plane. - below = *this; - above._vertex.resize(0); - //debugPrintf("Entirely below\n"); - return; - } - - above._vertex.append(interp); - below._vertex.append(interp); - debugAssertM(count < 2, "Convex polygons may only intersect planes at two edges."); - if (lastAbove) { - newEdge.stop = interp; - } else { - newEdge.start = interp; - } - count++; - } - - debugAssertM((count == 2) || (count == 0), "Convex polygons may only intersect planes at two edges."); -} - -ConvexPolygon ConvexPolygon::inverse() const { - ConvexPolygon result; - int length = _vertex.length(); - result._vertex.resize(length); - - for (int v = 0; v < length; v++) { - result._vertex[v] = _vertex[length - v - 1]; - } - - return result; -} - -void ConvexPolygon::removeDuplicateVertices(){ - // Any valid polygon should have 3 or more vertices, but why take chances? - if(_vertex.size() >= 2){ - - // Remove duplicate vertices. - for(int i=0;i<_vertex.size()-1;++i){ - if(_vertex[i].fuzzyEq(_vertex[i+1])){ - _vertex.remove(i+1); - --i; // Don't move forward. - } - } - - // Check the last vertex against the first. - if(_vertex[_vertex.size()-1].fuzzyEq(_vertex[0])){ - _vertex.pop(); - } - } -} - -////////////////////////////////////////////////////////////////////////////// - -ConvexPolyhedron::ConvexPolyhedron(const Array& _face) : face(_face) { - // Intentionally empty -} - -float ConvexPolyhedron::getVolume() const { - - if (face.length() < 4) { - return 0; - } - - // The volume of any pyramid is 1/3 * h * base area. - // Discussion at: http://nrich.maths.org/mathsf/journalf/oct01/art1/ - - float sum = 0; - - // Choose the first _vertex of the first face as the origin. - // This lets us skip one face, too, and avoids negative heights. - Vector3 v0 = face[0]._vertex[0]; - for (int f = 1; f < face.length(); f++) { - const ConvexPolygon& poly = face[f]; - - float height = (poly._vertex[0] - v0).dot(poly.normal()); - float base = poly.getArea(); - - sum += height * base; - } - - return sum / 3; -} - -bool ConvexPolyhedron::isEmpty() const { - return (face.length() == 0) || (getVolume() <= fuzzyEpsilon); -} - -void ConvexPolyhedron::cut(const Plane& plane, ConvexPolyhedron &above, ConvexPolyhedron &below) { - above.face.resize(0); - below.face.resize(0); - - Array edge; - - int f; - - // See if the plane cuts this polyhedron at all. Detect when - // the polyhedron is entirely to one side or the other. - //{ - int numAbove = 0, numIn = 0, numBelow = 0; - bool ruledOut = false; - double d; - Vector3 abc; - plane.getEquation(abc, d); - - // This number has to be fairly large to prevent precision problems down - // the road. - const float eps = 0.005f; - for (f = face.length() - 1; (f >= 0) && (!ruledOut); f--) { - const ConvexPolygon& poly = face[f]; - for (int v = poly._vertex.length() - 1; (v >= 0) && (!ruledOut); v--) { - double r = abc.dot(poly._vertex[v]) + d; - if (r > eps) { - numAbove++; - } else if (r < -eps) { - numBelow++; - } else { - numIn++; - } - - ruledOut = (numAbove != 0) && (numBelow !=0); - } - } - - if (numBelow == 0) { - above = *this; - return; - } else if (numAbove == 0) { - below = *this; - return; - } - //} - - // Clip each polygon, collecting split edges. - for (f = face.length() - 1; f >= 0; f--) { - ConvexPolygon a, b; - DirectedEdge e; - face[f].cut(plane, a, b, e); - - bool aEmpty = a.isEmpty(); - bool bEmpty = b.isEmpty(); - - //debugPrintf("\n"); - if (! aEmpty) { - //debugPrintf(" Above %f\n", a.getArea()); - above.face.append(a); - } - - if (! bEmpty) { - //debugPrintf(" Below %f\n", b.getArea()); - below.face.append(b); - } - - if (! aEmpty && ! bEmpty) { - //debugPrintf(" == Split\n"); - edge.append(e); - } else { - // Might be the case that the polygon is entirely on - // one side of the plane yet there is an edge we need - // because it touches the plane. - // - // Extract the non-empty _vertex list and examine it. - // If we find exactly one edge in the plane, add that edge. - const Array& _vertex = (aEmpty ? b._vertex : a._vertex); - int L = _vertex.length(); - int count = 0; - for (int v = 0; v < L; v++) { - if (plane.fuzzyContains(_vertex[v]) && plane.fuzzyContains(_vertex[(v + 1) % L])) { - e.start = _vertex[v]; - e.stop = _vertex[(v + 1) % L]; - count++; - } - } - - if (count == 1) { - edge.append(e); - } - } - } - - if (above.face.length() == 1) { - // Only one face above means that this entire - // polyhedron is below the plane. Move that face over. - below.face.append(above.face[0]); - above.face.resize(0); - } else if (below.face.length() == 1) { - // This shouldn't happen, but it arises in practice - // from numerical imprecision. - above.face.append(below.face[0]); - below.face.resize(0); - } - - if ((above.face.length() > 0) && (below.face.length() > 0)) { - // The polyhedron was actually cut; create a cap polygon - ConvexPolygon cap; - - // Collect the final polgyon by sorting the edges - int numVertices = edge.length(); -/*debugPrintf("\n"); -for (int xx=0; xx < numVertices; xx++) { - std::string s1 = edge[xx].start.toString(); - std::string s2 = edge[xx].stop.toString(); - debugPrintf("%s -> %s\n", s1.c_str(), s2.c_str()); -} -*/ - - // Need at least three points to make a polygon - debugAssert(numVertices >= 3); - - Vector3 last_vertex = edge.last().stop; - cap._vertex.append(last_vertex); - - // Search for the next _vertex. Because of accumulating - // numerical error, we have to find the closest match, not - // just the one we expect. - for (int v = numVertices - 1; v >= 0; v--) { - // matching edge index - int index = 0; - int num = edge.length(); - double distance = (edge[index].start - last_vertex).squaredMagnitude(); - for (int e = 1; e < num; e++) { - double d = (edge[e].start - last_vertex).squaredMagnitude(); - - if (d < distance) { - // This is the new closest one - index = e; - distance = d; - } - } - - // Don't tolerate ridiculous error. - debugAssertM(distance < 0.02, "Edge missing while closing polygon."); - - last_vertex = edge[index].stop; - cap._vertex.append(last_vertex); - } - - //debugPrintf("\n"); - //debugPrintf("Cap (both) %f\n", cap.getArea()); - above.face.append(cap); - below.face.append(cap.inverse()); - } - - // Make sure we put enough faces on each polyhedra - debugAssert((above.face.length() == 0) || (above.face.length() >= 4)); - debugAssert((below.face.length() == 0) || (below.face.length() >= 4)); -} - -/////////////////////////////////////////////// - -ConvexPolygon2D::ConvexPolygon2D(const Array& pts, bool reverse) : m_vertex(pts) { - if (reverse) { - m_vertex.reverse(); - } -} - - -bool ConvexPolygon2D::contains(const Vector2& p, bool reverse) const { - // Compute the signed area of each polygon from p to an edge. - // If the area is non-negative for all polygons then p is inside - // the polygon. (To adapt this algorithm for a concave polygon, - // the *sum* of the areas must be non-negative). - - float r = reverse ? -1 : 1; - - for (int i0 = 0; i0 < m_vertex.size(); ++i0) { - int i1 = (i0 + 1) % m_vertex.size(); - const Vector2& v0 = m_vertex[i0]; - const Vector2& v1 = m_vertex[i1]; - - Vector2 e0 = v0 - p; - Vector2 e1 = v1 - p; - - // Area = (1/2) cross product, negated to be ccw in - // a 2D space; we neglect the 1/2 - float area = -(e0.x * e1.y - e0.y * e1.x); - - if (area * r < 0) { - return false; - } - } - - return true; -} - - -} - diff --git a/externals/g3dlite/G3D.lib/source/CoordinateFrame.cpp b/externals/g3dlite/G3D.lib/source/CoordinateFrame.cpp deleted file mode 100644 index b6e94fe5857..00000000000 --- a/externals/g3dlite/G3D.lib/source/CoordinateFrame.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/** - @file CoordinateFrame.cpp - - Coordinate frame class - - @maintainer Morgan McGuire, morgan@cs.williams.edu - - @created 2001-06-02 - @edited 2008-07-13 -*/ - -#include "G3D/platform.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Quat.h" -#include "G3D/Matrix4.h" -#include "G3D/Box.h" -#include "G3D/AABox.h" -#include "G3D/Sphere.h" -#include "G3D/Triangle.h" -#include "G3D/Ray.h" -#include "G3D/Capsule.h" -#include "G3D/Cylinder.h" -#include "G3D/UprightFrame.h" - -namespace G3D { - -CoordinateFrame::CoordinateFrame(const class UprightFrame& f) { - *this = f.toCoordinateFrame(); -} - - -CoordinateFrame CoordinateFrame::fromXYZYPRRadians(float x, float y, float z, float yaw, - float pitch, float roll) { - Matrix3 rotation = Matrix3::fromAxisAngle(Vector3::unitY(), yaw); - - rotation = Matrix3::fromAxisAngle(rotation.column(0), pitch) * rotation; - rotation = Matrix3::fromAxisAngle(rotation.column(2), roll) * rotation; - - const Vector3 translation(x, y, z); - - return CoordinateFrame(rotation, translation); -} - - -void CoordinateFrame::getXYZYPRRadians(float& x, float& y, float& z, - float& yaw, float& pitch, float& roll) const { - x = translation.x; - y = translation.y; - z = translation.z; - - const Vector3& look = lookVector(); - - if (abs(look.y) > 0.99f) { - // Looking nearly straight up or down - - yaw = G3D::pi() + atan2(look.x, look.z); - pitch = asin(look.y); - roll = 0.0f; - - } else { - - // Yaw cannot be affected by others, so pull it first - yaw = G3D::pi() + atan2(look.x, look.z); - - // Pitch is the elevation of the yaw vector - pitch = asin(look.y); - - Vector3 actualRight = rightVector(); - Vector3 expectedRight = look.cross(Vector3::unitY()); - - roll = 0;//acos(actualRight.dot(expectedRight)); TODO - } -} - - -void CoordinateFrame::getXYZYPRDegrees(float& x, float& y, float& z, - float& yaw, float& pitch, float& roll) const { - getXYZYPRRadians(x, y, z, yaw, pitch, roll); - yaw = toDegrees(yaw); - pitch = toDegrees(pitch); - roll = toDegrees(roll); -} - - -CoordinateFrame CoordinateFrame::fromXYZYPRDegrees(float x, float y, float z, - float yaw, float pitch, float roll) { - return fromXYZYPRRadians(x, y, z, toRadians(yaw), toRadians(pitch), toRadians(roll)); -} - - -Ray CoordinateFrame::lookRay() const { - return Ray::fromOriginAndDirection(translation, lookVector()); -} - - -bool CoordinateFrame::fuzzyEq(const CoordinateFrame& other) const { - - for (int c = 0; c < 3; ++c) { - for (int r = 0; r < 3; ++r) { - if (! G3D::fuzzyEq(other.rotation[r][c], rotation[r][c])) { - return false; - } - } - if (! G3D::fuzzyEq(translation[c], other.translation[c])) { - return false; - } - } - - return true; -} - - -bool CoordinateFrame::fuzzyIsIdentity() const { - const Matrix3& I = Matrix3::identity(); - - for (int c = 0; c < 3; ++c) { - for (int r = 0; r < 3; ++r) { - if (fuzzyNe(I[r][c], rotation[r][c])) { - return false; - } - } - if (fuzzyNe(translation[c], 0)) { - return false; - } - } - - return true; -} - - -bool CoordinateFrame::isIdentity() const { - return - (translation == Vector3::zero()) && - (rotation == Matrix3::identity()); -} - - -Matrix4 CoordinateFrame::toMatrix4() const { - return Matrix4(*this); -} - - -std::string CoordinateFrame::toXML() const { - return G3D::format( - "\n %lf,%lf,%lf,%lf,\n %lf,%lf,%lf,%lf,\n %lf,%lf,%lf,%lf,\n %lf,%lf,%lf,%lf\n\n", - rotation[0][0], rotation[0][1], rotation[0][2], translation.x, - rotation[1][0], rotation[1][1], rotation[1][2], translation.y, - rotation[2][0], rotation[2][1], rotation[2][2], translation.z, - 0.0, 0.0, 0.0, 1.0); -} - - -Plane CoordinateFrame::toObjectSpace(const Plane& p) const { - Vector3 N, P; - double d; - p.getEquation(N, d); - P = N * (float)d; - P = pointToObjectSpace(P); - N = normalToObjectSpace(N); - return Plane(N, P); -} - - -Plane CoordinateFrame::toWorldSpace(const Plane& p) const { - Vector3 N, P; - double d; - p.getEquation(N, d); - P = N * (float)d; - P = pointToWorldSpace(P); - N = normalToWorldSpace(N); - return Plane(N, P); -} - - -Triangle CoordinateFrame::toObjectSpace(const Triangle& t) const { - return Triangle(pointToObjectSpace(t.vertex(0)), - pointToObjectSpace(t.vertex(1)), - pointToObjectSpace(t.vertex(2))); -} - - -Triangle CoordinateFrame::toWorldSpace(const Triangle& t) const { - return Triangle(pointToWorldSpace(t.vertex(0)), - pointToWorldSpace(t.vertex(1)), - pointToWorldSpace(t.vertex(2))); -} - - -Cylinder CoordinateFrame::toWorldSpace(const Cylinder& c) const { - return Cylinder( - pointToWorldSpace(c.point(0)), - pointToWorldSpace(c.point(1)), - c.radius()); -} - - -Capsule CoordinateFrame::toWorldSpace(const Capsule& c) const { - return Capsule( - pointToWorldSpace(c.point(0)), - pointToWorldSpace(c.point(1)), - c.radius()); -} - - -Box CoordinateFrame::toWorldSpace(const AABox& b) const { - return toWorldSpace(Box(b)); -} - - -Box CoordinateFrame::toWorldSpace(const Box& b) const { - Box out(b); - - for (int i = 0; i < 8; ++i) { - out._corner[i] = pointToWorldSpace(out._corner[i]); - debugAssert(! isNaN(out._corner[i].x)); - } - - for (int i = 0; i < 3; ++i) { - out._axis[i] = vectorToWorldSpace(out._axis[i]); - } - - out._center = pointToWorldSpace(out._center); - - return out; -} - - -Box CoordinateFrame::toObjectSpace(const Box &b) const { - return inverse().toWorldSpace(b); -} - - -Box CoordinateFrame::toObjectSpace(const AABox& b) const { - return toObjectSpace(Box(b)); -} - - -CoordinateFrame::CoordinateFrame(class BinaryInput& b) : rotation(Matrix3::zero()) { - deserialize(b); -} - - -void CoordinateFrame::deserialize(class BinaryInput& b) { - rotation.deserialize(b); - translation.deserialize(b); -} - - -void CoordinateFrame::serialize(class BinaryOutput& b) const { - rotation.serialize(b); - translation.serialize(b); -} - - -Sphere CoordinateFrame::toWorldSpace(const Sphere &b) const { - return Sphere(pointToWorldSpace(b.center), b.radius); -} - - -Sphere CoordinateFrame::toObjectSpace(const Sphere &b) const { - return Sphere(pointToObjectSpace(b.center), b.radius); -} - - -Ray CoordinateFrame::toWorldSpace(const Ray& r) const { - return Ray::fromOriginAndDirection(pointToWorldSpace(r.origin), vectorToWorldSpace(r.direction)); -} - - -Ray CoordinateFrame::toObjectSpace(const Ray& r) const { - return Ray::fromOriginAndDirection(pointToObjectSpace(r.origin), vectorToObjectSpace(r.direction)); -} - - -void CoordinateFrame::lookAt(const Vector3 &target) { - lookAt(target, Vector3::unitY()); -} - - -void CoordinateFrame::lookAt( - const Vector3& target, - Vector3 up) { - - up = up.direction(); - - Vector3 look = (target - translation).direction(); - if (fabs(look.dot(up)) > .99f) { - up = Vector3::unitX(); - if (fabs(look.dot(up)) > .99f) { - up = Vector3::unitY(); - } - } - - up -= look * look.dot(up); - up.unitize(); - - Vector3 z = -look; - Vector3 x = -z.cross(up); - x.unitize(); - - Vector3 y = z.cross(x); - - rotation.setColumn(0, x); - rotation.setColumn(1, y); - rotation.setColumn(2, z); -} - - -CoordinateFrame CoordinateFrame::lerp( - const CoordinateFrame& other, - float alpha) const { - - if (alpha == 1.0f) { - return other; - } else if (alpha == 0.0f) { - return *this; - } else { - Quat q1 = Quat(this->rotation); - Quat q2 = Quat(other.rotation); - - return CoordinateFrame( - q1.slerp(q2, alpha).toRotationMatrix(), - this->translation * (1 - alpha) + other.translation * alpha); - } -} - - -void CoordinateFrame::pointToWorldSpace(const Array& v, Array& vout) const { - vout.resize(v.size()); - - for (int i = v.size() - 1; i >= 0; --i) { - vout[i] = pointToWorldSpace(v[i]); - } -} - - -void CoordinateFrame::normalToWorldSpace(const Array& v, Array& vout) const { - vout.resize(v.size()); - - for (int i = v.size() - 1; i >= 0; --i) { - vout[i] = normalToWorldSpace(v[i]); - } -} - - -void CoordinateFrame::vectorToWorldSpace(const Array& v, Array& vout) const { - vout.resize(v.size()); - - for (int i = v.size() - 1; i >= 0; --i) { - vout[i] = vectorToWorldSpace(v[i]); - } -} - - -void CoordinateFrame::pointToObjectSpace(const Array& v, Array& vout) const { - vout.resize(v.size()); - - for (int i = v.size() - 1; i >= 0; --i) { - vout[i] = pointToObjectSpace(v[i]); - } -} - - -void CoordinateFrame::normalToObjectSpace(const Array& v, Array& vout) const { - vout.resize(v.size()); - - for (int i = v.size() - 1; i >= 0; --i) { - vout[i] = normalToObjectSpace(v[i]); - } -} - - -void CoordinateFrame::vectorToObjectSpace(const Array& v, Array& vout) const { - vout.resize(v.size()); - - for (int i = v.size() - 1; i >= 0; --i) { - vout[i] = vectorToObjectSpace(v[i]); - } -} - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/Crypto.cpp b/externals/g3dlite/G3D.lib/source/Crypto.cpp deleted file mode 100644 index 09aee2c265d..00000000000 --- a/externals/g3dlite/G3D.lib/source/Crypto.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - @file Crypto.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - - @created 2006-03-28 - @edited 2006-04-06 - */ - -#include "G3D/platform.h" -#include "G3D/Crypto.h" -#include "G3D/g3dmath.h" -#include - -namespace G3D { - - -int Crypto::smallPrime(int n) { - debugAssert(n < numSmallPrimes() && n >= 0); - - // From: - // http://primes.utm.edu/lists/small/1000.txt - - static const int table[] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, - 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, - 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, - 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, - 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, - 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, - 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, - 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, - 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, - 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, - 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, - 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, - 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, - 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, - 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, - 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, - 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, - 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, - 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, - 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, - 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, - 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, - 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, - 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, - 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, - 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, - 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, - 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, - 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, - 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, - 1993, 1997, 1999}; - - return table[n]; -} - - -int Crypto::numSmallPrimes() { - return 303; -} - -uint32 Crypto::crc32(const void* byte, size_t numBytes) { - return ::crc32(::crc32(0, Z_NULL, 0), static_cast(byte), numBytes); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Crypto_md5.cpp b/externals/g3dlite/G3D.lib/source/Crypto_md5.cpp deleted file mode 100644 index 4aa24c39f9c..00000000000 --- a/externals/g3dlite/G3D.lib/source/Crypto_md5.cpp +++ /dev/null @@ -1,471 +0,0 @@ -/** - @file Crypto_md5.cpp - - @author Morgan McGuire, matrix@graphics3d.com - Copyright 2006-2007, Morgan McGuire. All rights reserved. - - @created 2006-03-28 - @edited 2006-04-06 - */ - -#include "G3D/platform.h" -#include "G3D/Crypto.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -#include - -namespace G3D { - - -MD5Hash::MD5Hash(class BinaryInput& b) { - deserialize(b); -} - - -void MD5Hash::deserialize(class BinaryInput& b) { - b.readBytes(value, 16); -} - - -void MD5Hash::serialize(class BinaryOutput& b) const { - b.writeBytes(value, 16); -} - - -typedef unsigned char md5_byte_t; /* 8-bit byte */ -typedef unsigned int md5_word_t; /* 32-bit word */ - -/* Define the state of the MD5 Algorithm. */ -typedef struct md5_state_s { - md5_word_t count[2]; /* message length in bits, lsw first */ - md5_word_t abcd[4]; /* digest buffer */ - md5_byte_t buf[64]; /* accumulate block */ -} md5_state_t; - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Initialize the algorithm. */ -static void md5_init(md5_state_t *pms); - -/* Append a string to the message. */ -static void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); - -/* Finish the message and return the digest. */ -void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); -#ifdef __cplusplus -} -#endif - - - -MD5Hash Crypto::md5(const void* data, size_t n) { - md5_state_t state; - md5_init(&state); - md5_append(&state, (const uint8*)data, (int)n); - - MD5Hash h; - md5_finish(&state, &(h[0])); - return h; -} - -/* - Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - L. Peter Deutsch - ghost@aladdin.com - - */ -/* - Independent implementation of MD5 (RFC 1321). - - This code implements the MD5 Algorithm defined in RFC 1321, whose - text is available at - http://www.ietf.org/rfc/rfc1321.txt - The code is derived from the text of the RFC, including the test suite - (section A.5) but excluding the rest of Appendix A. It does not include - any code or documentation that is identified in the RFC as being - copyrighted. - - The original and principal author of md5.c is L. Peter Deutsch - . Other authors are noted in the change history - that follows (in reverse chronological order): - - 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order - either statically or dynamically; added missing #include - in library. - 2002-03-11 lpd Corrected argument list for main(), and added int return - type, in test program and T value program. - 2002-02-21 lpd Added missing #include in test program. - 2000-07-03 lpd Patched to eliminate warnings about "constant is - unsigned in ANSI C, signed in traditional"; made test program - self-checking. - 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. - 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). - 1999-05-03 lpd Original version. - */ - -/* - * This package supports both compile-time and run-time determination of CPU - * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be - * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is - * defined as non-zero, the code will be compiled to run only on big-endian - * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to - * run on either big- or little-endian CPUs, but will run slightly less - * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. - */ - - -#if defined(G3D_LINUX) || defined(G3D_OSX) -# if defined(G3D_OSX_PPC) -# include -# elif defined(G3D_OSX_INTEL) -# include -# elif defined(__linux__) -# include -# elif defined(__FreeBSD__) -# include -# endif -#else -# define BYTE_ORDER 0 -#endif - -#define T_MASK ((md5_word_t)~0) -#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) -#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) -#define T3 0x242070db -#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) -#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) -#define T6 0x4787c62a -#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) -#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) -#define T9 0x698098d8 -#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) -#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) -#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) -#define T13 0x6b901122 -#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) -#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) -#define T16 0x49b40821 -#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) -#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) -#define T19 0x265e5a51 -#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) -#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) -#define T22 0x02441453 -#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) -#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) -#define T25 0x21e1cde6 -#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) -#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) -#define T28 0x455a14ed -#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) -#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) -#define T31 0x676f02d9 -#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) -#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) -#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) -#define T35 0x6d9d6122 -#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) -#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) -#define T38 0x4bdecfa9 -#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) -#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) -#define T41 0x289b7ec6 -#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) -#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) -#define T44 0x04881d05 -#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) -#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) -#define T47 0x1fa27cf8 -#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) -#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) -#define T50 0x432aff97 -#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) -#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) -#define T53 0x655b59c3 -#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) -#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) -#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) -#define T57 0x6fa87e4f -#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) -#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) -#define T60 0x4e0811a1 -#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) -#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) -#define T63 0x2ad7d2bb -#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) - - -static void -md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) -{ - md5_word_t - a = pms->abcd[0], b = pms->abcd[1], - c = pms->abcd[2], d = pms->abcd[3]; - md5_word_t t; -#if BYTE_ORDER > 0 - /* Define storage only for big-endian CPUs. */ - md5_word_t X[16]; -#else - /* Define storage for little-endian or both types of CPUs. */ - md5_word_t xbuf[16]; - const md5_word_t *X; -#endif - - { -#if BYTE_ORDER == 0 - /* - * Determine dynamically whether this is a big-endian or - * little-endian machine, since we can use a more efficient - * algorithm on the latter. - */ - static const int w = 1; - - if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ -#endif -#if BYTE_ORDER <= 0 /* little-endian */ - { - /* - * On little-endian machines, we can process properly aligned - * data without copying it. - */ - if (!((data - (const md5_byte_t *)0) & 3)) { - /* data are properly aligned */ - X = (const md5_word_t *)data; - } else { - /* not aligned */ - memcpy(xbuf, data, 64); - X = xbuf; - } - } -#endif -#if BYTE_ORDER == 0 - else /* dynamic big-endian */ -#endif -#if BYTE_ORDER >= 0 /* big-endian */ - { - /* - * On big-endian machines, we must arrange the bytes in the - * right order. - */ - const md5_byte_t *xp = data; - int i; - -# if BYTE_ORDER == 0 - X = xbuf; /* (dynamic only) */ -# else -# define xbuf X /* (static only) */ -# endif - for (i = 0; i < 16; ++i, xp += 4) - xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); - } -#endif - } - -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) - - /* Round 1. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ -#define F(x, y, z) (((x) & (y)) | (~(x) & (z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + F(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 7, T1); - SET(d, a, b, c, 1, 12, T2); - SET(c, d, a, b, 2, 17, T3); - SET(b, c, d, a, 3, 22, T4); - SET(a, b, c, d, 4, 7, T5); - SET(d, a, b, c, 5, 12, T6); - SET(c, d, a, b, 6, 17, T7); - SET(b, c, d, a, 7, 22, T8); - SET(a, b, c, d, 8, 7, T9); - SET(d, a, b, c, 9, 12, T10); - SET(c, d, a, b, 10, 17, T11); - SET(b, c, d, a, 11, 22, T12); - SET(a, b, c, d, 12, 7, T13); - SET(d, a, b, c, 13, 12, T14); - SET(c, d, a, b, 14, 17, T15); - SET(b, c, d, a, 15, 22, T16); -#undef SET - - /* Round 2. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ -#define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + G(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 1, 5, T17); - SET(d, a, b, c, 6, 9, T18); - SET(c, d, a, b, 11, 14, T19); - SET(b, c, d, a, 0, 20, T20); - SET(a, b, c, d, 5, 5, T21); - SET(d, a, b, c, 10, 9, T22); - SET(c, d, a, b, 15, 14, T23); - SET(b, c, d, a, 4, 20, T24); - SET(a, b, c, d, 9, 5, T25); - SET(d, a, b, c, 14, 9, T26); - SET(c, d, a, b, 3, 14, T27); - SET(b, c, d, a, 8, 20, T28); - SET(a, b, c, d, 13, 5, T29); - SET(d, a, b, c, 2, 9, T30); - SET(c, d, a, b, 7, 14, T31); - SET(b, c, d, a, 12, 20, T32); -#undef SET - - /* Round 3. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + H(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 5, 4, T33); - SET(d, a, b, c, 8, 11, T34); - SET(c, d, a, b, 11, 16, T35); - SET(b, c, d, a, 14, 23, T36); - SET(a, b, c, d, 1, 4, T37); - SET(d, a, b, c, 4, 11, T38); - SET(c, d, a, b, 7, 16, T39); - SET(b, c, d, a, 10, 23, T40); - SET(a, b, c, d, 13, 4, T41); - SET(d, a, b, c, 0, 11, T42); - SET(c, d, a, b, 3, 16, T43); - SET(b, c, d, a, 6, 23, T44); - SET(a, b, c, d, 9, 4, T45); - SET(d, a, b, c, 12, 11, T46); - SET(c, d, a, b, 15, 16, T47); - SET(b, c, d, a, 2, 23, T48); -#undef SET - - /* Round 4. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ -#define I(x, y, z) ((y) ^ ((x) | ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + I(b,c,d) + X[k] + Ti;\ - a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 6, T49); - SET(d, a, b, c, 7, 10, T50); - SET(c, d, a, b, 14, 15, T51); - SET(b, c, d, a, 5, 21, T52); - SET(a, b, c, d, 12, 6, T53); - SET(d, a, b, c, 3, 10, T54); - SET(c, d, a, b, 10, 15, T55); - SET(b, c, d, a, 1, 21, T56); - SET(a, b, c, d, 8, 6, T57); - SET(d, a, b, c, 15, 10, T58); - SET(c, d, a, b, 6, 15, T59); - SET(b, c, d, a, 13, 21, T60); - SET(a, b, c, d, 4, 6, T61); - SET(d, a, b, c, 11, 10, T62); - SET(c, d, a, b, 2, 15, T63); - SET(b, c, d, a, 9, 21, T64); -#undef SET - - /* Then perform the following additions. (That is increment each - of the four registers by the value it had before this block - was started.) */ - pms->abcd[0] += a; - pms->abcd[1] += b; - pms->abcd[2] += c; - pms->abcd[3] += d; -} - -void -md5_init(md5_state_t *pms) -{ - pms->count[0] = pms->count[1] = 0; - pms->abcd[0] = 0x67452301; - pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; - pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; - pms->abcd[3] = 0x10325476; -} - -void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) -{ - const md5_byte_t *p = data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; - md5_word_t nbits = (md5_word_t)(nbytes << 3); - - if (nbytes <= 0) - return; - - /* Update the message length. */ - pms->count[1] += nbytes >> 29; - pms->count[0] += nbits; - if (pms->count[0] < nbits) - pms->count[1]++; - - /* Process an initial partial block. */ - if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); - - memcpy(pms->buf + offset, p, copy); - if (offset + copy < 64) - return; - p += copy; - left -= copy; - md5_process(pms, pms->buf); - } - - /* Process full blocks. */ - for (; left >= 64; p += 64, left -= 64) - md5_process(pms, p); - - /* Process a final partial block. */ - if (left) - memcpy(pms->buf, p, left); -} - -void -md5_finish(md5_state_t *pms, md5_byte_t digest[16]) -{ - static const md5_byte_t pad[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - md5_byte_t data[8]; - int i; - - /* Save the length before padding. */ - for (i = 0; i < 8; ++i) - data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); - /* Pad to 56 bytes mod 64. */ - md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); - /* Append the length. */ - md5_append(pms, data, 8); - for (i = 0; i < 16; ++i) - digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Cylinder.cpp b/externals/g3dlite/G3D.lib/source/Cylinder.cpp deleted file mode 100644 index bdc7d56be23..00000000000 --- a/externals/g3dlite/G3D.lib/source/Cylinder.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/** - @file Cylinder.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-07 - @edited 2006-02-18 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/Cylinder.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/LineSegment.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Line.h" -#include "G3D/AABox.h" - -namespace G3D { - -Cylinder::Cylinder(class BinaryInput& b) { - deserialize(b); -} - - -Cylinder::Cylinder() { -} - - -Cylinder::Cylinder(const Vector3& _p1, const Vector3& _p2, float _r) - : p1(_p1), p2(_p2), mRadius(_r) { -} - - -void Cylinder::serialize(class BinaryOutput& b) const { - p1.serialize(b); - p2.serialize(b); - b.writeFloat64(mRadius); -} - - -void Cylinder::deserialize(class BinaryInput& b) { - p1.deserialize(b); - p2.deserialize(b); - mRadius = b.readFloat64(); -} - - -Line Cylinder::axis() const { - return Line::fromTwoPoints(p1, p2); -} - - - -float Cylinder::radius() const { - return mRadius; -} - - -float Cylinder::volume() const { - return - (float)pi() * square(mRadius) * (p1 - p2).magnitude(); -} - - -float Cylinder::area() const { - return - // Sides - (twoPi() * mRadius) * height() + - - // Caps - twoPi() * square(mRadius); -} - -void Cylinder::getBounds(AABox& out) const { - Vector3 min = p1.min(p2) - (Vector3(1, 1, 1) * mRadius); - Vector3 max = p1.max(p2) + (Vector3(1, 1, 1) * mRadius); - out = AABox(min, max); -} - -bool Cylinder::contains(const Vector3& p) const { - return LineSegment::fromTwoPoints(p1, p2).distanceSquared(p) <= square(mRadius); -} - - -void Cylinder::getReferenceFrame(CoordinateFrame& cframe) const { - cframe.translation = center(); - - Vector3 Y = (p1 - p2).direction(); - Vector3 X = (abs(Y.dot(Vector3::unitX())) > 0.9) ? Vector3::unitY() : Vector3::unitX(); - Vector3 Z = X.cross(Y).direction(); - X = Y.cross(Z); - cframe.rotation.setColumn(0, X); - cframe.rotation.setColumn(1, Y); - cframe.rotation.setColumn(2, Z); -} - - -void Cylinder::getRandomSurfacePoint(Vector3& p, Vector3& N) const { - float h = height(); - float r = radius(); - - // Create a random point on a standard cylinder and then rotate to the global frame. - - // Relative areas (factor of 2PI already taken out) - float capRelArea = square(r) / 2.0f; - float sideRelArea = r * h; - - float r1 = uniformRandom(0, capRelArea * 2 + sideRelArea); - - if (r1 < capRelArea * 2) { - - // Select a point uniformly at random on a disk - // @cite http://mathworld.wolfram.com/DiskPointPicking.html - float a = uniformRandom(0, (float)twoPi()); - float r2 = sqrt(uniformRandom(0, 1)) * r; - p.x = cos(a) * r2; - p.z = sin(a) * r2; - - N.x = 0; - N.z = 0; - if (r1 < capRelArea) { - // Top - p.y = h / 2.0f; - N.y = 1; - } else { - // Bottom - p.y = -h / 2.0f; - N.y = -1; - } - } else { - // Side - float a = uniformRandom(0, (float)twoPi()); - N.x = cos(a); - N.y = 0; - N.z = sin(a); - p.x = N.x * r; - p.z = N.y * r; - p.y = uniformRandom(-h / 2.0f, h / 2.0f); - } - - // Transform to world space - CoordinateFrame cframe; - getReferenceFrame(cframe); - - p = cframe.pointToWorldSpace(p); - N = cframe.normalToWorldSpace(N); -} - - -Vector3 Cylinder::randomInteriorPoint() const { - float h = height(); - float r = radius(); - - // Create a random point in a standard cylinder and then rotate to the global frame. - - // Select a point uniformly at random on a disk - // @cite http://mathworld.wolfram.com/DiskPointPicking.html - float a = uniformRandom(0, (float)twoPi()); - float r2 = sqrt(uniformRandom(0, 1)) * r; - - Vector3 p( cos(a) * r2, - uniformRandom(-h / 2.0f, h / 2.0f), - sin(a) * r2); - - // Transform to world space - CoordinateFrame cframe; - getReferenceFrame(cframe); - - return cframe.pointToWorldSpace(p); -} - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/Discovery.cpp b/externals/g3dlite/G3D.lib/source/Discovery.cpp deleted file mode 100644 index 2c27c5bf2b9..00000000000 --- a/externals/g3dlite/G3D.lib/source/Discovery.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/** - @file Discovery.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-06-26 - @edited 2005-02-24 - */ - -#include "G3D/Discovery.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -#include - -namespace G3D { - -/////////////////////////////////////////////////////////////////////////////////////////// - -void DiscoveryAdvertisement::serialize(BinaryOutput& b) const { - address.serialize(b); -} - -void DiscoveryAdvertisement::deserialize(BinaryInput& b) { - address.deserialize(b); - lastUpdateTime = System::time(); -} - - -/////////////////////////////////////////////////////////////////////////////////////////// - -void DiscoveryServerAddressMessage::serialize(BinaryOutput& b) const { - b.writeString(G3D_DISCOVERY_PROTOCOL_NAME); - b.writeInt32(G3D_DISCOVERY_PROTOCOL_VERSION); - b.writeString(settings->appProtocolName); - b.writeInt32(settings->appProtocolVersion); - - // Send addresses - b.writeInt32(address.size()); - for (int i = 0; i < address.size(); ++i) { - address[i].serialize(b); - } -} - - -void DiscoveryServerAddressMessage::deserialize(BinaryInput& b) { - address.clear(); - correctProtocol = false; - serverProtocolVersion[0] = 0; - serverProtocolVersion[1] = 0; - - // Verify that we are on the same protocol - if (b.readString(strlen(G3D_DISCOVERY_PROTOCOL_NAME) + 1) != G3D_DISCOVERY_PROTOCOL_NAME) { - return; - } - - serverProtocolVersion[0] = b.readInt32(); - if (serverProtocolVersion[0] != G3D_DISCOVERY_PROTOCOL_VERSION) { - return; - } - - if (b.readString() != settings->appProtocolName) { - return; - } - - serverProtocolVersion[1] = b.readInt32(); - if (serverProtocolVersion[1] != settings->appProtocolVersion) { - return; - } - - correctProtocol = true; - - address.resize(b.readInt32()); - for (int i = 0; i < address.size(); ++i) { - address[i].deserialize(b); - } -} - -/////////////////////////////////////////////////////////////////////////////////////////// - -void DiscoveryServer::sendAnnouncement() const { - NetAddress broadcast(NetworkDevice::instance()->broadcastAddressArray()[0], settings->serverBroadcastPort); - - net->send(broadcast, SERVER_BROADCAST_MESSAGE, addressMessage); - - const_cast(this)->lastBroadcast = System::time(); -} - - -void DiscoveryServer::sendShutDown() const { - NetAddress broadcast(NetworkDevice::instance()->broadcastAddressArray()[0], settings->serverBroadcastPort); - ShutdownMessage s; - net->send(broadcast, SERVER_SHUTDOWN_MESSAGE, s); -} - - -bool DiscoveryServer::ok() const { - return listener->ok() && net->ok(); -} - - -void DiscoveryServer::init( - const DiscoverySettings* _settings, - DiscoveryAdvertisement* _advertisement) { - - Discovery::init(_settings); - - advertisement = _advertisement; - addressMessage.settings = settings; - NetworkDevice::instance()->localHostAddresses(addressMessage.address); - - // Set the port number - for (int i = 0; i < addressMessage.address.size(); ++i) { - addressMessage.address[i] = - NetAddress(addressMessage.address[i].ip(), - settings->serverAdvertisementPort); - } - - net = LightweightConduit::create(settings->clientBroadcastPort, true, true); - - listener = NetListener::create(settings->serverAdvertisementPort); - - // Send initial announcement - sendAnnouncement(); -} - - -void DiscoveryServer::doNetwork() { - const RealTime UNSOLICITED_BROADCAST_PERIOD = 60; - - // Check for client broadcast requests - - if (net->messageWaiting()) { - // Some client broadcast that it is looking for servers. - // Respond by sending out our announcement to everyone - // (avoids having to figure out if the message return address - // is correct). - NetAddress dummy; - net->receive(dummy); - sendAnnouncement(); - } else if (System::time() > lastBroadcast + UNSOLICITED_BROADCAST_PERIOD) { - sendAnnouncement(); - } - - // Handle incoming connections - - if (listener->clientWaiting()) { - // Respond to this client - ReliableConduitRef client = listener->waitForConnection(); - client->send(SERVER_BROADCAST_MESSAGE, *advertisement); - } -} - - -void DiscoveryServer::cleanup() { - sendShutDown(); -} - -////////////////////////////////////////////////////////////////////////////////// - -std::string IncompatibleServerDescription::toString() const { - return std::string("Incompatible server at ") + address.toString() + - format(", version %d.%d", protocolVersion[0], protocolVersion[1]); -} - -////////////////////////////////////////////////////////////////////////////////// - - -} - diff --git a/externals/g3dlite/G3D.lib/source/GCamera.cpp b/externals/g3dlite/G3D.lib/source/GCamera.cpp deleted file mode 100644 index e70188377e6..00000000000 --- a/externals/g3dlite/G3D.lib/source/GCamera.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/** - @file GCamera.cpp - - @author Morgan McGuire, matrix@graphics3d.com - @author Jeff Marsceill, 08jcm@williams.edu - - @created 2005-07-20 - @edited 2007-07-24 -*/ -#include "G3D/GCamera.h" -#include "G3D/platform.h" -#include "G3D/Rect2D.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Ray.h" -#include "G3D/Matrix4.h" - -namespace G3D { - -GCamera::GCamera() { - setNearPlaneZ(-0.1f); - setFarPlaneZ(-(float)inf()); - setFieldOfView((float)toRadians(55.0f), VERTICAL); -} - - -GCamera::~GCamera() { -} - -void GCamera::getCoordinateFrame(CoordinateFrame& c) const { - c = m_cframe; -} - -void GCamera::setCoordinateFrame(const CoordinateFrame& c) { - m_cframe = c; -} - -void GCamera::setFieldOfView(float angle, FOVDirection dir) { - debugAssert((angle < pi()) && (angle > 0)); - - m_fieldOfView = angle; - m_direction = dir; -} - -float GCamera::imagePlaneDepth() const{ - return -m_nearPlaneZ; -} - -float GCamera::viewportWidth(const Rect2D& viewport) const { - // Compute the side of a square at the near plane based on our field of view - float s = 2.0f * -m_nearPlaneZ * tan(m_fieldOfView * 0.5f); - - if (m_direction == VERTICAL) { - s *= viewport.width() / viewport.height(); - } - - return s; -} - -float GCamera::viewportHeight(const Rect2D& viewport) const { - // Compute the side of a square at the near plane based on our field of view - float s = 2.0f * -m_nearPlaneZ * tan(m_fieldOfView * 0.5f); - - if (m_direction == HORIZONTAL) { - s *= viewport.height() / viewport.width(); - } - - return s; -} - -Ray GCamera::worldRay(float x, float y, const Rect2D& viewport) const { - - int screenWidth = iFloor(viewport.width()); - int screenHeight = iFloor(viewport.height()); - - Ray out; - out.origin = m_cframe.translation; - - float cx = screenWidth / 2.0f; - float cy = screenHeight / 2.0f; - - out.direction = Vector3( (x - cx) * viewportWidth(viewport) / screenWidth, - -(y - cy) * viewportHeight(viewport) / screenHeight, - (m_nearPlaneZ) ); - - out.direction = m_cframe.vectorToWorldSpace(out.direction); - - // Normalize the direction (we didn't do it before) - out.direction = out.direction.direction(); - - return out; -} - -/** -This is the matrix that a RenderDevice (or OpenGL) uses as the projection matrix. -@sa RenderDevice::setProjectionAndCameraMatrix, RenderDevice::setProjectionMatrix, Matrix4::perspectiveProjection -*/ -void GCamera::getProjectUnitMatrix(const Rect2D& viewport, Matrix4& P) const{ - - float screenWidth = viewport.width(); - float screenHeight = viewport.height(); - - float r, l, t, b, n, f, x, y; - - if(m_direction == VERTICAL){ - y = -m_nearPlaneZ * tan(m_fieldOfView / 2); - x = y * (screenWidth / screenHeight); - } - else{ //m_direction == HORIZONTAL - x = -m_nearPlaneZ * tan(m_fieldOfView / 2); - y = x * (screenHeight / screenWidth); - } - - n = -m_nearPlaneZ; - f = -m_farPlaneZ; - r = x; - l = -x; - t = y; - b = -y; - - P = Matrix4::perspectiveProjection(l, r, b, t, n, f); -} - -Vector3 GCamera::projectUnit(const Vector3& point, const Rect2D& viewport) const { - Matrix4 M; - getProjectUnitMatrix(viewport, M); - - Vector4 cameraSpacePoint(coordinateFrame().pointToObjectSpace(point), 1.0f); - const Vector4& screenSpacePoint = M * cameraSpacePoint; - - return Vector3(screenSpacePoint.xyz() / screenSpacePoint.w); -} - -Vector3 GCamera::project(const Vector3& point, - const Rect2D& viewport) const { - - // Find the point in the homogeneous cube - const Vector3& cube = projectUnit(point, viewport); - - return convertFromUnitToNormal(cube, viewport); -} - -Vector3 GCamera::unprojectUnit(const Vector3& v, const Rect2D& viewport) const { - - const Vector3& projectedPoint = convertFromUnitToNormal(v, viewport); - - return unproject(projectedPoint, viewport); -} - - -Vector3 GCamera::unproject(const Vector3& v, const Rect2D& viewport) const { - - const float n = m_nearPlaneZ; - const float f = m_farPlaneZ; - - float z; - - if (-f >= inf()) { - // Infinite far plane - z = 1.0f / (((-1.0f / n) * v.z) + 1.0f / n); - } else { - z = 1.0f / ((((1.0f / f) - (1.0f / n)) * v.z) + 1.0f / n); - } - - const Ray& ray = worldRay(v.x, v.y, viewport); - - // Find out where the ray reaches the specified depth. - const Vector3& out = ray.origin + ray.direction * -z / (ray.direction.dot(m_cframe.lookVector())); - - return out; -} - -float GCamera::worldToScreenSpaceArea(float area, float z, const Rect2D& viewport) const { - if (z >= 0) { - return (float)inf(); - } - return area * (float)square(imagePlaneDepth() / z); -} - - -void GCamera::getClipPlanes( - const Rect2D& viewport, - Array& clip) const { - - Frustum fr; - frustum(viewport, fr); - clip.resize(fr.faceArray.size(), DONT_SHRINK_UNDERLYING_ARRAY); - for (int f = 0; f < clip.size(); ++f) { - clip[f] = fr.faceArray[f].plane; - } -} - -GCamera::Frustum GCamera::frustum(const Rect2D& viewport) const { - Frustum f; - frustum(viewport, f); - return f; -} - -void GCamera::frustum(const Rect2D& viewport, Frustum& fr) const { - - // The volume is the convex hull of the vertices definining the view - // frustum and the light source point at infinity. - - const float x = viewportWidth(viewport) / 2; - const float y = viewportHeight(viewport) / 2; - const float z = m_nearPlaneZ; - const float w = z / -m_farPlaneZ; - float fovx; - - fovx = m_fieldOfView; - if (m_direction == VERTICAL) { - fovx *= x / y; - } - - // Near face (ccw from UR) - fr.vertexPos.append( - Vector4( x, y, z, 1), - Vector4(-x, y, z, 1), - Vector4(-x, -y, z, 1), - Vector4( x, -y, z, 1)); - - // Far face (ccw from UR, from origin) - fr.vertexPos.append( - Vector4( x, y, z, w), - Vector4(-x, y, z, w), - Vector4(-x, -y, z, w), - Vector4( x, -y, z, w)); - - Frustum::Face face; - - // Near plane (wind backwards so normal faces into frustum) - // Recall that nearPlane, farPlane are positive numbers, so - // we need to negate them to produce actual z values. - face.plane = Plane(Vector3(0,0,-1), Vector3(0,0,m_nearPlaneZ)); - face.vertexIndex[0] = 3; - face.vertexIndex[1] = 2; - face.vertexIndex[2] = 1; - face.vertexIndex[3] = 0; - fr.faceArray.append(face); - - // Right plane - face.plane = Plane(Vector3(-cosf(fovx/2), 0, -sinf(fovx/2)), Vector3::zero()); - face.vertexIndex[0] = 0; - face.vertexIndex[1] = 4; - face.vertexIndex[2] = 7; - face.vertexIndex[3] = 3; - fr.faceArray.append(face); - - // Left plane - face.plane = Plane(Vector3(-fr.faceArray.last().plane.normal().x, 0, fr.faceArray.last().plane.normal().z), Vector3::zero()); - face.vertexIndex[0] = 5; - face.vertexIndex[1] = 1; - face.vertexIndex[2] = 2; - face.vertexIndex[3] = 6; - fr.faceArray.append(face); - - // Top plane - face.plane = Plane(Vector3(0, -cosf(m_fieldOfView/2.0f), -sinf(m_fieldOfView/2.0f)), Vector3::zero()); - face.vertexIndex[0] = 1; - face.vertexIndex[1] = 5; - face.vertexIndex[2] = 4; - face.vertexIndex[3] = 0; - fr.faceArray.append(face); - - // Bottom plane - face.plane = Plane(Vector3(0, -fr.faceArray.last().plane.normal().y, fr.faceArray.last().plane.normal().z), Vector3::zero()); - face.vertexIndex[0] = 2; - face.vertexIndex[1] = 3; - face.vertexIndex[2] = 7; - face.vertexIndex[3] = 6; - fr.faceArray.append(face); - - // Far plane - if (-m_farPlaneZ < inf()) { - face.plane = Plane(Vector3(0, 0, 1), Vector3(0, 0, m_farPlaneZ)); - face.vertexIndex[0] = 4; - face.vertexIndex[1] = 5; - face.vertexIndex[2] = 6; - face.vertexIndex[3] = 7; - fr.faceArray.append(face); - } - - // Transform vertices to world space - for (int v = 0; v < fr.vertexPos.size(); ++v) { - fr.vertexPos[v] = m_cframe.toWorldSpace(fr.vertexPos[v]); - } - - // Transform planes to world space - for (int p = 0; p < fr.faceArray.size(); ++p) { - // Since there is no scale factor, we don't have to - // worry about the inverse transpose of the normal. - Vector3 normal; - float d; - - fr.faceArray[p].plane.getEquation(normal, d); - - Vector3 newNormal = m_cframe.rotation * normal; - - if (isFinite(d)) { - d = (newNormal * -d + m_cframe.translation).dot(newNormal); - fr.faceArray[p].plane = Plane(newNormal, newNormal * d); - } else { - // When d is infinite, we can't multiply 0's by it without - // generating NaNs. - fr.faceArray[p].plane = Plane::fromEquation(newNormal.x, newNormal.y, newNormal.z, d); - } - } -} - -void GCamera::getNearViewportCorners( - const Rect2D& viewport, - Vector3& outUR, - Vector3& outUL, - Vector3& outLL, - Vector3& outLR) const { - - // Must be kept in sync with getFrustum() - const float w = viewportWidth(viewport) / 2.0f; - const float h = viewportHeight(viewport) / 2.0f; - const float z = nearPlaneZ(); - - // Compute the points - outUR = Vector3( w, h, z); - outUL = Vector3(-w, h, z); - outLL = Vector3(-w, -h, z); - outLR = Vector3( w, -h, z); - - // Take to world space - outUR = m_cframe.pointToWorldSpace(outUR); - outUL = m_cframe.pointToWorldSpace(outUL); - outLR = m_cframe.pointToWorldSpace(outLR); - outLL = m_cframe.pointToWorldSpace(outLL); -} - -void GCamera::getFarViewportCorners( - const Rect2D& viewport, - Vector3& outUR, - Vector3& outUL, - Vector3& outLL, - Vector3& outLR) const { - - // Must be kept in sync with getFrustum() - const float w = viewportWidth(viewport) * m_farPlaneZ / m_nearPlaneZ; - const float h = viewportHeight(viewport) * m_farPlaneZ / m_nearPlaneZ; - const float z = m_farPlaneZ; - - // Compute the points - outUR = Vector3( w, h, z); - outUL = Vector3(-w, h, z); - outLL = Vector3(-w, -h, z); - outLR = Vector3( w, -h, z); - - // Take to world space - outUR = m_cframe.pointToWorldSpace(outUR); - outUL = m_cframe.pointToWorldSpace(outUL); - outLR = m_cframe.pointToWorldSpace(outLR); - outLL = m_cframe.pointToWorldSpace(outLL); -} - - - -void GCamera::setPosition(const Vector3& t) { - m_cframe.translation = t; -} - - -void GCamera::lookAt(const Vector3& position, const Vector3& up) { - m_cframe.lookAt(position, up); -} - - -void GCamera::serialize(BinaryOutput& bo) const { - bo.writeFloat32(m_fieldOfView); - bo.writeFloat32(imagePlaneDepth()); - debugAssert(nearPlaneZ() < 0.0f); - bo.writeFloat32(nearPlaneZ()); - debugAssert(farPlaneZ() < 0.0f); - bo.writeFloat32(farPlaneZ()); - m_cframe.serialize(bo); - bo.writeInt8(m_direction); -} - - -void GCamera::deserialize(BinaryInput& bi) { - m_fieldOfView = bi.readFloat32(); - m_nearPlaneZ = bi.readFloat32(); - debugAssert(m_nearPlaneZ < 0.0f); - m_farPlaneZ = bi.readFloat32(); - debugAssert(m_farPlaneZ < 0.0f); - m_cframe.deserialize(bi); - m_direction = (FOVDirection)bi.readInt8(); -} - - -Vector3 GCamera::convertFromUnitToNormal(const Vector3& in, const Rect2D& viewport) const{ - return (in + Vector3(1,1,1)) * 0.5 * Vector3(viewport.width(), -viewport.height(), 1) + - Vector3(viewport.x0(), viewport.y1(), 0); -} -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/GImage.cpp b/externals/g3dlite/G3D.lib/source/GImage.cpp deleted file mode 100644 index c7abf982553..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage.cpp +++ /dev/null @@ -1,1065 +0,0 @@ -/** - @file GImage.cpp - @author Morgan McGuire, morgan@graphics3d.com - Copyright 2002-2007, Morgan McGuire - - @created 2002-05-27 - @edited 2006-10-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/debug.h" -#include "G3D/stringutils.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" -#include -#include -#include -#include - -////////////////////////////////////////////////////////////////////////////////////////////// - -namespace G3D { - -void GImage::RGBtoRGBA( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 0] = in[i3 + 0]; - out[i4 + 1] = in[i3 + 1]; - out[i4 + 2] = in[i3 + 2]; - out[i4 + 3] = 255; - } -} - - -void GImage::RGBAtoRGB( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i3 + 0] = in[i4 + 0]; - out[i3 + 1] = in[i4 + 1]; - out[i3 + 2] = in[i4 + 2]; - } -} - - -void GImage::RGBtoBGRA( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 2] = in[i3 + 0]; - out[i4 + 1] = in[i3 + 1]; - out[i4 + 0] = in[i3 + 2]; - out[i4 + 3] = 255; - } -} - - - -void GImage::RGBtoBGR( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - - int r = in[i3 + 0]; - int g = in[i3 + 1]; - int b = in[i3 + 2]; - - out[i3 + 2] = r; - out[i3 + 1] = g; - out[i3 + 0] = b; - } -} - - -void GImage::RGBxRGBtoRGBA( - const uint8* colorRGB, - const uint8* alphaRGB, - uint8* out, - int numPixels) { - - for (int i = numPixels - 1; i >= 0; --i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 0] = colorRGB[i3 + 0]; - out[i4 + 1] = colorRGB[i3 + 1]; - out[i4 + 2] = colorRGB[i3 + 2]; - out[i4 + 3] = alphaRGB[i3 + 0]; - } -} - - -void GImage::RGBtoARGB( - const uint8* in, - uint8* out, - int numPixels) { - - for (int i = 0; i < numPixels; ++i) { - int i3 = i * 3; - int i4 = i3 + i; - - out[i4 + 0] = 255; - out[i4 + 1] = in[i3 + 0]; - out[i4 + 2] = in[i3 + 1]; - out[i4 + 3] = in[i3 + 2]; - } -} - - -void GImage::flipRGBVertical( - const uint8* in, - uint8* out, - int width, - int height) { - - - // Allocate a temp row so the operation - // is still safe if in == out - uint8* temp = (uint8*)System::malloc(width * 3); - alwaysAssertM(temp != NULL, "Out of memory"); - - int oneRow = width * 3; - int N = height / 2; - - // if height is an odd value, don't swap odd middle row - for (int i = 0; i < N; ++i) { - int topOff = i * oneRow; - int botOff = (height - i - 1) * oneRow; - System::memcpy(temp, in + topOff, oneRow); - System::memcpy(out + topOff, in + botOff, oneRow); - System::memcpy(out + botOff, temp, oneRow); - } - - System::free(temp); -} - - -void GImage::flipRGBAVertical( - const uint8* in, - uint8* out, - int width, - int height) { - - - // Allocate a temp row so the operation - // is still safe if in == out - uint8* temp = (uint8*)System::malloc(width * 4); - alwaysAssertM(temp != NULL, "Out of memory"); - - int oneRow = width * 4; - - // if height is an odd value, don't swap odd middle row - for (int i = 0; i < height / 2; ++i) { - int topOff = i * oneRow; - int botOff = (height - i - 1) * oneRow; - System::memcpy(temp, in + topOff, oneRow); - System::memcpy(out + topOff, in + botOff, oneRow); - System::memcpy(out + botOff, temp, oneRow); - } - - System::free(temp); -} - -//////////////////////////////////////////////////////////////////////////////////////// - -void GImage::decode( - BinaryInput& input, - Format format) { - - switch (format) { - case PPM_ASCII: - decodePPMASCII(input); - break; - - case PPM: - decodePPM(input); - break; - - case PNG: - decodePNG(input); - break; - - case JPEG: - decodeJPEG(input); - break; - - case TGA: - decodeTGA(input); - break; - - case BMP: - decodeBMP(input); - break; - - case ICO: - decodeICO(input); - break; - - case PCX: - decodePCX(input); - break; - - default: - debugAssert(false); - } - - debugAssert(width >= 0); - debugAssert(height >= 0); - debugAssert(channels == 1 || channels == 3 || channels == 4); - debugAssert(_byte != NULL); -} - - -void GImage::decodePCX( - BinaryInput& input) { - - uint8 manufacturer = input.readUInt8(); - uint8 version = input.readUInt8(); - uint8 encoding = input.readUInt8(); - uint8 bitsPerPixel = input.readUInt8(); - - uint16 xmin = input.readUInt16(); - uint16 ymin = input.readUInt16(); - uint16 xmax = input.readUInt16(); - uint16 ymax = input.readUInt16(); - - uint16 horizDPI = input.readUInt16(); - uint16 vertDPI = input.readUInt16(); - - Color3uint8 colorMap[16]; - input.readBytes(colorMap, 48); - - input.skip(1); - - uint8 planes = input.readUInt8(); - uint16 bytesPerLine = input.readUInt16(); - uint16 paletteType = input.readUInt16(); - input.skip(4 + 54); - - (void)bytesPerLine; - - width = xmax - xmin + 1; - height = ymax - ymin + 1; - channels = 3; - - if ((manufacturer != 0x0A) || (encoding != 0x01)) { - throw GImage::Error("PCX file is corrupted", input.getFilename()); - } - - (void)version; - (void)vertDPI; - (void)horizDPI; - - if ((bitsPerPixel != 8) || ((planes != 1) && (planes != 3))) { - throw GImage::Error("Only 8-bit paletted and 24-bit PCX files supported.", input.getFilename()); - } - - // Prepare the pointer object for the pixel data - _byte = (uint8*)System::malloc(width * height * 3); - - if ((paletteType == 1) && (planes == 3)) { - - Color3uint8* pixel = pixel3(); - - // Iterate over each scan line - for (int row = 0; row < height; ++row) { - // Read each scan line once per plane - for (int plane = 0; plane < planes; ++plane) { - int p = row * width; - int p1 = p + width; - while (p < p1) { - uint8 value = input.readUInt8(); - int length = 1; - - if (value >= 192) { - // This is the length, not the value. Mask off - // the two high bits and read the true index. - length = value & 0x3F; - value = input.readUInt8(); - } - - // Set the whole run - for (int i = length - 1; i >= 0; --i, ++p) { - debugAssert(p < width * height); - pixel[p][plane] = value; - } - } - } - } - - } else if (planes == 1) { - - Color3uint8 palette[256]; - - int imageBeginning = input.getPosition(); - int paletteBeginning = input.getLength() - 769; - - input.setPosition(paletteBeginning); - - uint8 dummy = input.readUInt8(); - - if (dummy != 12) { - Log::common()->println("\n*********************"); - Log::common()->printf("Warning: Corrupted PCX file (palette marker byte was missing) \"%s\"\nLoading anyway\n\n", input.getFilename().c_str()); - } - - input.readBytes(palette, sizeof(palette)); - input.setPosition(imageBeginning); - - Color3uint8* pixel = pixel3(); - - // The palette indices are run length encoded. - int p = 0; - while (p < width * height) { - uint8 index = input.readUInt8(); - uint8 length = 1; - - if (index >= 192) { - // This is the length, not the index. Mask off - // the two high bits and read the true index. - length = index & 0x3F; - index = input.readUInt8(); - } - - Color3uint8 color = palette[index]; - - // Set the whole run - for (int i = length - 1; i >= 0; --i, ++p) { - if (p > width * height) { - break; - } - pixel[p] = color; - } - - } - - } else { - throw GImage::Error("Unsupported PCX file type.", input.getFilename()); - } -} - - -GImage::Format GImage::resolveFormat(const std::string& filename) { - BinaryInput b(filename, G3D_LITTLE_ENDIAN); - if (b.size() <= 0) { - throw Error("File not found.", filename); - } - - return resolveFormat(filename, b.getCArray(), b.size(), AUTODETECT); -} - - -GImage::Format GImage::resolveFormat( - const std::string& filename, - const uint8* data, - int dataLen, - Format maybeFormat) { - - // Return the provided format if it is specified. - if (maybeFormat != AUTODETECT) { - return maybeFormat; - } - - std::string extension; - - // Try to detect from the filename's extension - if (filename.size() >= 5) { - int n = iMax(filename.size() - 1, 5); - // Search backwards for the "." - for (int i = 1; i <= n; ++i) { - if (filename[filename.size() - i] == '.') { - // Upper case - extension = toUpper(filename.substr(filename.size() - i + 1)); - break; - } - } - } - - if (extension == "PPM") { - // There are two PPM formats; we handle them differently - if (dataLen > 3) { - if (!memcmp(data, "P6", 2)) { - return PPM; - } else { - return PPM_ASCII; - } - } - } - - Format tmp = stringToFormat(extension); - if ((tmp != AUTODETECT) && (tmp != UNKNOWN)) { - return tmp; - } - - // Try and autodetect from the file itself by looking at the first - // character. - - // We can't look at the character if it is null. - debugAssert(data != NULL); - - if ((dataLen > 3) && (!memcmp(data, "P3", 2) || !memcmp(data, "P2", 2) || !memcmp(data, "P1", 2))) { - return PPM_ASCII; - } - - if ((dataLen > 3) && !memcmp(data, "P6", 2)) { - return PPM; - } - - if (dataLen > 8) { - if (!png_sig_cmp((png_bytep)data, 0, 8)) - return PNG; - } - - if ((dataLen > 0) && (data[0] == 'B')) { - return BMP; - } - - if (dataLen > 10) { - if ((dataLen > 11) && (data[0] == 0xFF) && - (memcmp(&data[6], "JFIF", 4) == 0)) { - return JPEG; - } - } - - if (dataLen > 40) { - if (memcmp(&data[dataLen - 18], "TRUEVISION-XFILE", 16) == 0) { - return TGA; - } - } - - if ((dataLen > 4) && (data[0] == 0) && (data[1] == 0) && (data[2] == 0) && (data[3] == 1)) { - return ICO; - } - - if ((dataLen > 0) && (data[0] == 10)) { - return PCX; - } - - return UNKNOWN; -} - - -GImage::GImage( - const std::string& filename, - Format format) : - _byte(NULL), - width(0), - height(0), - channels(0){ - - load(filename, format); -} - - -void GImage::load( - const std::string& filename, - Format format) { - - clear(); - - try { - BinaryInput b(filename, G3D_LITTLE_ENDIAN); - if (b.size() <= 0) { - throw Error("File not found.", filename); - } - - alwaysAssertM(this != NULL, "Corrupt GImage"); - decode(b, resolveFormat(filename, b.getCArray(), b.size(), format)); - } catch (const std::string& error) { - throw Error(error, filename); - } -} - - -GImage::GImage( - const uint8* data, - int length, - Format format) { - - BinaryInput b(data, length, G3D_LITTLE_ENDIAN); - // It is safe to cast away the const because we - // know we don't corrupt the data. - - decode(b, resolveFormat("", data, length, format)); -} - - -GImage::GImage( - int width, - int height, - int channels) { - - _byte = NULL; - resize(width, height, channels); -} - - -void GImage::resize( - int width, - int height, - int channels) { - debugAssert(width >= 0); - debugAssert(height >= 0); - debugAssert(channels >= 1); - - clear(); - - this->width = width; - this->height = height; - this->channels = channels; - size_t sz = width * height * channels; - - _byte = (uint8*)System::calloc(sz, sizeof(uint8)); - debugAssert(isValidHeapPointer(_byte)); -} - - -void GImage::_copy( - const GImage& other) { - - clear(); - - width = other.width; - height = other.height; - channels = other.channels; - int s = width * height * channels * sizeof(uint8); - _byte = (uint8*)System::malloc(s); - debugAssert(isValidHeapPointer(_byte)); - memcpy(_byte, other._byte, s); -} - - -GImage::GImage( - const GImage& other) : _byte(NULL) { - - _copy(other); -} - - -GImage::~GImage() { - clear(); -} - - -void GImage::clear() { - width = 0; - height = 0; - System::free(_byte); - _byte = NULL; -} - - -GImage& GImage::operator=(const GImage& other) { - _copy(other); - return *this; -} - - -bool GImage::copySubImage( - GImage & dest, const GImage & src, - int srcX, int srcY, int srcWidth, int srcHeight) { - if ((src.width < srcX + srcWidth) || - (src.height < srcY + srcHeight) || - (srcY < 0) || - (srcX < 0)) { - - return false; - } - - dest.resize(srcWidth, srcHeight, src.channels); - - bool ret; - ret = pasteSubImage(dest, src, 0, 0, srcX, srcY, srcWidth, srcHeight); - debugAssert(ret); - - return true; -} - - -bool GImage::pasteSubImage( - GImage & dest, const GImage & src, - int destX, int destY, - int srcX, int srcY, int srcWidth, int srcHeight) { - if ((src.width < srcX + srcWidth) || - (src.height < srcY + srcHeight) || - (dest.width < destX + srcWidth) || - (dest.height < destY + srcHeight) || - (srcY < 0) || - (srcX < 0) || - (destY < 0) || - (destX < 0) || - (src.channels != dest.channels)) { - - return false; - } - - for (int i = 0; i < srcHeight; i++) { - const uint8* srcRow = src.byte() + - ((i + srcY) * src.width + srcX) * src.channels; - uint8* destRow = dest.byte() + - ((i + destY) * dest.width + destX) * dest.channels; - memcpy(destRow, srcRow, srcWidth * src.channels); - } - - return true; -} - - -bool GImage::supportedFormat( - const std::string& format) { - - return (stringToFormat(format) != UNKNOWN); -} - - -GImage::Format GImage::stringToFormat( - const std::string& format) { - - std::string extension = toUpper(format); - - if ((extension == "JPG") || (extension == "JPEG")) { - return JPEG; - } else if (extension == "TGA") { - return TGA; - } else if (extension == "BMP") { - return BMP; - } else if (extension == "PCX") { - return PCX; - } else if (extension == "ICO") { - return ICO; - } else if (extension == "PNG") { - return PNG; - } else if (extension == "PPM") { - return PPM; - } else { - return UNKNOWN; - } -} - - -void GImage::save( - const std::string& filename, - Format format) const { - - BinaryOutput b(filename, G3D_LITTLE_ENDIAN); - encode(resolveFormat(filename, NULL, 0, format), b); - b.commit(false); -} - - -void GImage::encode( - Format format, - uint8*& outData, - int& outLength) const { - - BinaryOutput out; - - encode(format, out); - - outData = (uint8*)System::malloc(out.size()); - debugAssert(outData); - outLength = out.size(); - - out.commit(outData); -} - - -void GImage::encode( - Format format, - BinaryOutput& out) const { - - switch (format) { - case PPM_ASCII: - encodePPMASCII(out); - break; - - case PPM: - encodePPM(out); - break; - - case PNG: - encodePNG(out); - break; - - case JPEG: - encodeJPEG(out); - break; - - case BMP: - encodeBMP(out); - break; - - case TGA: - encodeTGA(out); - break; - - default: - debugAssert(false); - } -} - -void GImage::insertRedAsAlpha(const GImage& alpha, GImage& output) const { - debugAssert(alpha.width == width); - debugAssert(alpha.height == height); - - // make sure output GImage is valid - if (output.width != width || output.height != height || output.channels != 4) { - output.resize(width, height, 4); - } - - for (int i = 0; i < width * height; ++i) { - output.byte()[i * 4 + 0] = byte()[i * channels + 0]; - output.byte()[i * 4 + 1] = byte()[i * channels + 1]; - output.byte()[i * 4 + 2] = byte()[i * channels + 2]; - output.byte()[i * 4 + 3] = alpha.byte()[i * alpha.channels]; - } -} - -GImage GImage::insertRedAsAlpha(const GImage& alpha) const { - debugAssert(alpha.width == width); - debugAssert(alpha.height == height); - - GImage out(width, height, 4); - - insertRedAsAlpha(alpha, out); - - return out; -} - - -void GImage::stripAlpha(GImage& output) const { - - if (output.width != width || output.height != height || output.channels != 3) - { - output.resize(width, height, 3); - } - - for (int i = 0; i < width * height; ++i) { - output.byte()[i * 3 + 0] = byte()[i * channels + 0]; - output.byte()[i * 3 + 1] = byte()[i * channels + 1]; - output.byte()[i * 3 + 2] = byte()[i * channels + 2]; - } -} - -GImage GImage::stripAlpha() const { - GImage out(width, height, 3); - - stripAlpha(out); - - return out; -} - - -int GImage::sizeInMemory() const { - return sizeof(GImage) + width * height * channels; -} - - -void GImage::computeNormalMap( - const GImage& bump, - GImage& normal, - float whiteHeightInPixels, - bool lowPassBump, - bool scaleHeightByNz) { - computeNormalMap(bump.width, bump.height, bump.channels, bump.byte(), normal, whiteHeightInPixels, lowPassBump, scaleHeightByNz); -} - -void GImage::computeNormalMap( - int width, - int height, - int channels, - const uint8* src, - GImage& normal, - float whiteHeightInPixels, - bool lowPassBump, - bool scaleHeightByNz) { - - if (whiteHeightInPixels == -1.0f) { - // Default setting scales so that a gradient ramp - // over the whole image becomes a 45-degree angle - - // Account for potentially non-square aspect ratios - whiteHeightInPixels = max(width, height); - } - - debugAssert(whiteHeightInPixels >= 0); - - const int w = width; - const int h = height; - const int stride = channels; - - normal.resize(w, h, 4); - - const uint8* const B = src; - Color4uint8* const N = normal.pixel4(); - - for (int y = 0; y < h; ++y) { - for (int x = 0; x < w; ++x) { - // Index into normal map pixel - int i = x + y * w; - - // Index into bump map *byte* - int j = stride * i; - - Vector3 delta; - - // Get a value from B (with wrapping lookup) relative to (x, y) - // and divide by 255 - #define height(DX, DY) ((int)B[(((DX + x + w) % w) + \ - ((DY + y + h) % h) * w) * stride]) - - - // Sobel filter to compute the normal. - // - // Y Filter (X filter is the transpose) - // [ -1 -2 -1 ] - // [ 0 0 0 ] - // [ 1 2 1 ] - - // Write the Y value directly into the x-component so we don't have - // to explicitly compute a cross product at the end. - delta.y = -(height(-1, -1) * 1 + height( 0, -1) * 2 + height( 1, -1) * 1 + - height(-1, 1) * -1 + height( 0, 1) * -2 + height( 1, 1) * -1); - - delta.x = -(height(-1, -1) * -1 + height( 1, -1) * 1 + - height(-1, 0) * -2 + height( 1, 0) * 2 + - height(-1, 1) * -1 + height( 1, 1) * 1); - - // The scale of each filter row is 4, the filter width is two pixels, - // and the "normal" range is 0-255. - delta.z = 4 * 2 * (whiteHeightInPixels / 255.0f); - - // Delta is now scaled in pixels; normalize - delta = delta.direction(); - - // Copy over the bump value into the alpha channel. - float H = B[j] / 255.0; - - if (lowPassBump) { - H = (height(-1, -1) + height( 0, -1) + height(1, -1) + - height(-1, 0) + height( 0, 0) + height(1, 0) + - height(-1, 1) + height( 0, 1) + height(1, 1)) / (255.0f * 9.0f); - } - #undef height - - if (scaleHeightByNz) { - // delta.z can't possibly be negative, so we avoid actually - // computing the absolute value. - H *= delta.z; - } - - N[i].a = iRound(H * 255.0); - - // Pack into byte range - delta = delta * 127.5 + Vector3(127.5, 127.5, 127.5); - N[i].r = iClamp(iRound(delta.x), 0, 255); - N[i].g = iClamp(iRound(delta.y), 0, 255); - N[i].b = iClamp(iRound(delta.z), 0, 255); - } - } -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void GImage::convertToL8() { - switch(channels) { - case 1: - return; - - case 3: - { - // Average - Color3uint8* src = (Color3uint8*)_byte; - _byte = NULL; - resize(width, height, 1); - for (int i = width * height - 1; i >= 0; --i) { - const Color3uint8 s = src[i]; - uint8& d = _byte[i]; - d = ((int)s.r + (int)s.g + (int)s.b) / 3; - } - System::free(src); - } - break; - - case 4: - { - // Average - Color4uint8* src = (Color4uint8*)_byte; - _byte = NULL; - resize(width, height, 1); - for (int i = width * height - 1; i >= 0; --i) { - const Color4uint8 s = src[i]; - uint8& d = _byte[i]; - d = ((int)s.r + (int)s.g + (int)s.b) / 3; - } - System::free(src); - } - return; - - default: - alwaysAssertM(false, "Bad number of channels in input image"); - } -} - - -void GImage::convertToRGBA() { - switch(channels) { - case 1: - { - // Spread - uint8* old = _byte; - _byte = NULL; - resize(width, height, 4); - for (int i = width * height - 1; i >= 0; --i) { - const uint8 s = old[i]; - Color4uint8& d = ((Color4uint8*)_byte)[i]; - d.r = d.g = d.b = s; - d.a = 255; - } - System::free(_byte); - } - break; - - case 3: - { - // Add alpha - Color3uint8* old = (Color3uint8*)_byte; - _byte = NULL; - resize(width, height, 4); - for (int i = width * height - 1; i >= 0; --i) { - const Color3uint8 s = old[i]; - Color4uint8& d = ((Color4uint8*)_byte)[i]; - d.r = s.r; - d.g = s.g; - d.b = s.b; - d.a = 255; - } - System::free(old); - } - break; - - case 4: - // Already RGBA - return; - - default: - alwaysAssertM(false, "Bad number of channels in input image"); - } -} - - -void GImage::convertToRGB() { - switch(channels) { - case 1: - { - // Spread - uint8* old = _byte; - _byte = NULL; - resize(width, height, 3); - for (int i = width * height - 1; i >= 0; --i) { - const uint8 s = old[i]; - Color3uint8& d = ((Color3uint8*)_byte)[i]; - d.r = d.g = d.b = s; - } - System::free(old); - } - break; - - case 3: - return; - - case 4: - // Strip alpha - { - Color4uint8* old = (Color4uint8*)_byte; - _byte = NULL; - resize(width, height, 3); - for (int i = width * height - 1; i >= 0; --i) { - const Color4uint8 s = old[i]; - Color3uint8& d = ((Color3uint8*)_byte)[i]; - d.r = s.r; - d.g = s.g; - d.b = s.b; - } - System::free(old); - } - break; - - default: - alwaysAssertM(false, "Bad number of channels in input image"); - } -} - - -void GImage::R8G8B8_to_Y8U8V8(int width, int height, const uint8* _in, uint8* _out) { - const Color3uint8* in = reinterpret_cast(_in); - Color3uint8* out = reinterpret_cast(_out); - - Color3uint8 p; - for (int i = width * height - 1; i >= 0; --i) { - p.r = iClamp(iRound(in->r * 0.229 + in->g * 0.587 + in->b * 0.114), 0, 255); - p.g = iClamp(iRound(in->r * -0.147 + in->g * -0.289 + in->b * 0.436) + 127, 0, 255); - p.b = iClamp(iRound(in->r * 0.615 + in->g * -0.515 + in->b * -0.100) + 127, 0, 255); - *out = p; - ++in; - ++out; - } -} - - - -void GImage::Y8U8V8_to_R8G8B8(int width, int height, const uint8* _in, uint8* _out) { - const Color3uint8* in = reinterpret_cast(_in); - Color3uint8* out = reinterpret_cast(_out); - - Color3uint8 p; - for (int i = width * height - 1; i >= 0; --i) { - p.r = iClamp(iRound(in->r * 1.0753 + (in->b - 127) * 1.2256), 0, 255); - p.g = iClamp(iRound(in->r * 1.0753 + (in->g - 127) * -0.3946 + (in->b - 127) * -0.4947), 0, 255); - p.b = iClamp(iRound(in->r * 1.0753 + (in->g - 127) * 2.0320 + (in->b - 127) * 0.0853), 0, 255); - *out = p; - ++in; - ++out; - } -} - - -void GImage::makeCheckerboard(GImage& im, int checkerSize, const Color4uint8& A, const Color4uint8& B) { - for (int y = 0; y < im.height; ++y) { - for (int x = 0; x < im.width; ++x) { - bool checker = isOdd((x / checkerSize) + (y / checkerSize)); - const Color4uint8& color = checker ? A : B; - for (int c = 0; c < im.channels; ++c) { - uint8* v = im.byte() + (x + y * im.width) * im.channels + c; - *v = color[c]; - } - } - } -} - -} - diff --git a/externals/g3dlite/G3D.lib/source/GImage_bayer.cpp b/externals/g3dlite/G3D.lib/source/GImage_bayer.cpp deleted file mode 100644 index 16499af15f6..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage_bayer.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/** - @file GImage_bayer.cpp - @author Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" - -namespace G3D { - -void GImage::BAYER_G8B8_R8G8_to_Quarter_R8G8B8(int width, int height, const uint8* in, uint8* out) { - debugAssert(in != out); - - int halfHeight = height / 2; - int halfWidth = width / 2; - - int dst_off = 0; - for (int y = 0; y < halfHeight; ++y) { - for (int x = 0; x < halfWidth; ++x) { - // GBRG - int src_off = x*2 + y*2*width; - out[dst_off] = in[src_off+width]; // red - out[dst_off+1] = ((int)in[src_off] + (int)in[src_off+width+1])/2; // green - out[dst_off+2] = in[src_off+1]; // blue - - dst_off = dst_off + 3; - } - } -} - - -void GImage::Quarter_R8G8B8_to_BAYER_G8B8_R8G8(int inWidth, int inHeight, const uint8* in, uint8* out) { - // Undo quarter-size Bayer as best we can. This code isn't very efficient, but it - // also isn't used very frequently. - - debugAssert(out != in); - - int outWidth = 2 * inWidth; - int outHeight = 2 * inHeight; - - for (int y = 0; y < outHeight; ++y) { - for (int x = 0; x < outWidth; ++x) { - const Color3uint8* inp = ((const Color3uint8*)in) + ((x/2) + (y/2)* inWidth); - uint8* outp = out + x + y * outWidth; - - if (isEven(y)) { - // GB row - if (isEven(x)) { - // Green - *outp = inp->g; - } else { - // Blue - *outp = inp->b; - } - } else { - // RG row - if (isEven(x)) { - // Red - *outp = inp->r; - } else { - // Green - *outp = inp->g; - } - } - } - } -} - - -/** Applies a 5x5 filter to monochrome image I (wrapping at the boundaries) */ -static uint8 applyFilter( - const uint8* I, - int x, - int y, - int w, - int h, - const float filter[5][5]) { - - debugAssert(isEven(w)); - debugAssert(isEven(h)); - - float sum = 0.0f; - float denom = 0.0f; - - for (int dy = 0; dy < 5; ++dy) { - int offset = ((y + dy + h - 2) % h) * w; - - for (int dx = 0; dx < 5; ++dx) { - float f = filter[dy][dx]; - sum += f * I[((x + dx + w - 2) % w) + offset]; - denom += f; - } - } - - return (uint8)iClamp(iRound(sum / denom), 0, 255); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -// Bayer conversions -// - -// There are two kinds of rows (GR and BG). -// In each row, there are two kinds of pixels (G/R, B/G). -// We express the four kinds of INPUT pixels as: -// GRG, GRG, BGB, BGG -// -// There are three kinds of OUTPUT pixels: R, G, B. -// Thus there are nominally 12 different I/O combinations, -// but several are impulses because needed output at that -// location *is* the input (e.g., G_GRG and G_BGG). -// -// The following 5x5 row-major filters are named as output_input. - -// Green -static const float G_GRR[5][5] = -{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float G_BGB[5][5] = -{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, -{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, -{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -// Red -//(the caption in the paper is wrong for this case: -// "R row B column really means R row G column" -static const float R_GRG[5][5] = -{{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}, -{ 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, -{ -1.0f, 4.0f, 5.0f, 4.0f, -1.0f}, -{ 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, -{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}}; - -static const float R_BGG[5][5] = -{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, -{ 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, -{ 0.5f, 0.0f, 5.0f, 0.0f, 0.5f}, -{ 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, -{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float R_BGB[5][5] = -{{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}, -{ 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, -{-3.0f/2.0f, 0.0f, 6.0f, 0.0f, -3.0f/2.0f}, -{ 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, -{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}}; - - -// Blue -//(the caption in the paper is wrong for this case: -// "B row R column really means B row G column") -#define B_BGG R_GRG -#define B_GRG R_BGG -#define B_GRR R_BGB - - -void GImage::BAYER_R8G8_G8B8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // RG row - for (int x = 0; x < w; ++x, ++out) { - // R pixel - { - out->r = in[x + offset]; - out->g = applyFilter(in, x, y, w, h, G_GRR); - out->b = applyFilter(in, x, y, w, h, B_GRR); - } - ++x; ++out; - - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_GRG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_GRG); - } - } - - ++y; - offset += w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - } -} - -static void swapRedAndBlue(int N, Color3uint8* out) { - for (int i = N - 1; i >= 0; --i) { - uint8 tmp = out[i].r; - out[i].r = out[i].b; - out[i].b = tmp; - } -} - -void GImage::BAYER_G8R8_B8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - // Run the equivalent function for red - BAYER_G8B8_R8G8_to_R8G8B8_MHC(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - - -void GImage::BAYER_B8G8_G8R8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - // Run the equivalent function for red - BAYER_R8G8_G8B8_to_R8G8B8_MHC(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - - -void GImage::BAYER_G8B8_R8G8_to_R8G8B8_MHC(int w, int h, const uint8* in, uint8* _out) { - - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - - ++y; - offset += w; - - // RG row - for (int x = 0; x < w; ++x, ++out) { - // R pixel - { - out->r = in[x + offset]; - out->g = applyFilter(in, x, y, w, h, G_GRR); - out->b = applyFilter(in, x, y, w, h, B_GRR); - } - ++x; ++out; - - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_GRG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_GRG); - } - } - } - -} - -#undef B_BGG -#undef B_GRG -#undef B_GRR - -} diff --git a/externals/g3dlite/G3D.lib/source/GImage_bmp.cpp b/externals/g3dlite/G3D.lib/source/GImage_bmp.cpp deleted file mode 100644 index 598ba730d0b..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage_bmp.cpp +++ /dev/null @@ -1,716 +0,0 @@ -/** - @file GImage_bmp.cpp - @author Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" - -namespace G3D { - -#ifndef G3D_WIN32 -/** - This is used by the Windows bitmap I/O. - */ -static const int BI_RGB = 0; -#endif - -void GImage::encodeBMP( - BinaryOutput& out) const { - - debugAssert(channels == 1 || channels == 3); - out.setEndian(G3D_LITTLE_ENDIAN); - - uint8 red; - uint8 green; - uint8 blue; - int pixelBufferSize = width * height * 3; - int fileHeaderSize = 14; - int infoHeaderSize = 40; - int BMScanWidth; - int BMPadding; - - // First write the BITMAPFILEHEADER - // - // WORD bfType; - // DWORD bfSize; - // WORD bfReserved1; - // WORD bfReserved2; - // DWORD bfOffBits; - - // Type - out.writeUInt8('B'); - out.writeUInt8('M'); - - // File size - out.writeUInt32(fileHeaderSize + infoHeaderSize + pixelBufferSize); - - // Two reserved fields set to zero - out.writeUInt16(0); - out.writeUInt16(0); - - // The offset, in bytes, from the BITMAPFILEHEADER structure - // to the bitmap bits. - out.writeUInt32(infoHeaderSize + fileHeaderSize); - - // Now the BITMAPINFOHEADER - // - // DWORD biSize; - // LONG biWidth; - // LONG biHeight; - // WORD biPlanes; - // WORD biBitCount - // DWORD biCompression; - // DWORD biSizeImage; - // LONG biXPelsPerMeter; - // LONG biYPelsPerMeter; - // DWORD biClrUsed; - // DWORD biClrImportant; - - // Size of the info header - out.writeUInt32(infoHeaderSize); - - // Width and height of the image - out.writeUInt32(width); - out.writeUInt32(height); - - // Planes ("must be set to 1") - out.writeUInt16(1); - - // BitCount and CompressionType - out.writeUInt16(24); - out.writeUInt32(BI_RGB); - - // Image size ("may be zero for BI_RGB bitmaps") - out.writeUInt32(0); - - // biXPelsPerMeter - out.writeUInt32(0); - // biYPelsPerMeter - out.writeUInt32(0); - - // biClrUsed - out.writeUInt32(0); - - // biClrImportant - out.writeUInt32(0); - - BMScanWidth = width * 3; - - if (BMScanWidth & 3) { - BMPadding = 4 - (BMScanWidth & 3); - } else { - BMPadding = 0; - } - - int hStart = height - 1; - int hEnd = -1; - int hDir = -1; - int dest; - - // Write the pixel data - for (int h = hStart; h != hEnd; h += hDir) { - dest = channels * h * width; - for (int w = 0; w < width; ++w) { - - if (channels == 3) { - red = _byte[dest]; - green = _byte[dest + 1]; - blue = _byte[dest + 2]; - } else { - red = _byte[dest]; - green = _byte[dest]; - blue = _byte[dest]; - } - - out.writeUInt8(blue); - out.writeUInt8(green); - out.writeUInt8(red); - - dest += channels; - } - - if (BMPadding > 0) { - out.skip(BMPadding); - } - } -} - - -void GImage::decodeBMP( - BinaryInput& input) { - - // The BMP decoding uses these flags. - static const uint16 PICTURE_NONE = 0x0000; - static const uint16 PICTURE_BITMAP = 0x1000; - - // Compression Flags - static const uint16 PICTURE_UNCOMPRESSED = 0x0100; - static const uint16 PICTURE_MONOCHROME = 0x0001; - static const uint16 PICTURE_4BIT = 0x0002; - static const uint16 PICTURE_8BIT = 0x0004; - static const uint16 PICTURE_16BIT = 0x0008; - static const uint16 PICTURE_24BIT = 0x0010; - static const uint16 PICTURE_32BIT = 0x0020; - - (void)PICTURE_16BIT; - (void)PICTURE_32BIT; - - // This is a simple BMP loader that can handle uncompressed BMP files. - // Verify this is a BMP file by looking for the BM tag. - input.reset(); - std::string tag = input.readString(2); - if (tag != "BM") { - throw Error("Not a BMP file", input.getFilename()); - } - - channels = 3; - // Skip to the BITMAPINFOHEADER's width and height - input.skip(16); - - width = input.readUInt32(); - height = input.readUInt32(); - - // Skip to the bit count and compression type - input.skip(2); - - uint16 bitCount = input.readUInt16(); - uint32 compressionType = input.readUInt32(); - - uint8 red; - uint8 green; - uint8 blue; - uint8 blank; - - // Only uncompressed bitmaps are supported by this code - if ((int32)compressionType != BI_RGB) { - throw Error("BMP images must be uncompressed", input.getFilename()); - } - - uint8* palette = NULL; - - // Create the palette if needed - if (bitCount <= 8) { - - // Skip to the palette color count in the header - input.skip(12); - - int numColors = input.readUInt32(); - - palette = (uint8*)System::malloc(numColors * 3); - debugAssert(palette); - - // Skip past the end of the header to the palette info - input.skip(4); - - int c; - for(c = 0; c < numColors * 3; c += 3) { - // Palette information in bitmaps is stored in BGR_ format. - // That means it's blue-green-red-blank, for each entry. - blue = input.readUInt8(); - green = input.readUInt8(); - red = input.readUInt8(); - blank = input.readUInt8(); - - palette[c] = red; - palette[c + 1] = green; - palette[c + 2] = blue; - } - } - - int hStart = 0; - int hEnd = 0; - int hDir = 0; - - if (height < 0) { - height = -height; - hStart = 0; - hEnd = height; - hDir = 1; - } else { - //height = height; - hStart = height - 1; - hEnd = -1; - hDir = -1; - } - - _byte = (uint8*)System::malloc(width * height * 3); - debugAssert(_byte); - - int BMScanWidth; - int BMPadding; - uint8 BMGroup; - uint8 BMPixel8; - int currPixel; - int dest; - int flags = PICTURE_NONE; - - if (bitCount == 1) { - // Note that this file is not necessarily grayscale, since it's possible - // the palette is blue-and-white, or whatever. But of course most image - // programs only write 1-bit images if they're black-and-white. - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_MONOCHROME; - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = (width + 7) >> 3; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - // Powers of 2 - int pow2[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 3 * h * width; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMGroup = input.readUInt8(); - - // Now we read the pixels. Usually there are eight pixels per byte, - // since each pixel is represented by one bit, but if the width - // is not a multiple of eight, the last byte will have some bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "width" number of pixels. - for (int i = 7; i >= 0; --i) { - if (currPixel < width) { - int src = 3 * ((BMGroup & pow2[i]) >> i); - - _byte[dest] = palette[src]; - _byte[dest + 1] = palette[src + 1]; - _byte[dest + 2] = palette[src + 2]; - - ++currPixel; - dest += 3; - } - } - } - } - - } else if (bitCount == 4) { - - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_4BIT; - - // For bitmaps, each scanline is dword-aligned. - int BMScanWidth = (width+1) >> 1; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 3 * h * width; - - for (int w = 0; w < BMScanWidth; w++) { - - BMGroup = input.readUInt8(); - int src[2]; - src[0] = 3 * ((BMGroup & 0xF0) >> 4); - src[1] = 3 * (BMGroup & 0x0F); - - // Now we read the pixels. Usually there are two pixels per byte, - // since each pixel is represented by four bits, but if the width - // is not a multiple of two, the last byte will have only four bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "Width" number of pixels. - - for (int i = 0; i < 2; ++i) { - if (currPixel < width) { - int tsrc = src[i]; - - _byte[dest] = palette[tsrc]; - _byte[dest + 1] = palette[tsrc + 1]; - _byte[dest + 2] = palette[tsrc + 2]; - - ++currPixel; - dest += 3; - } - } - } - } - - } else if (bitCount == 8) { - - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_8BIT; - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = width; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMPixel8 = input.readUInt8(); - - if (currPixel < width) { - dest = 3 * ((h * width) + currPixel); - int src = 3 * BMPixel8; - - _byte[dest] = palette[src]; - _byte[dest + 1] = palette[src + 1]; - _byte[dest + 2] = palette[src + 2]; - - ++currPixel; - } - } - } - - } else if (bitCount == 16) { - - System::free(_byte); - _byte = NULL; - System::free(palette); - palette = NULL; - throw Error("16-bit bitmaps not supported", input.getFilename()); - - } else if (bitCount == 24) { - input.skip(20); - - flags = PICTURE_BITMAP | PICTURE_UNCOMPRESSED | PICTURE_24BIT; - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = width * 3; - - if (BMScanWidth & 3) { - BMPadding = 4 - (BMScanWidth & 3); - } else { - BMPadding = 0; - } - - for (int h = hStart; h != hEnd; h += hDir) { - dest = 3 * h * width; - for (int w = 0; w < width; ++w) { - - blue = input.readUInt8(); - green = input.readUInt8(); - red = input.readUInt8(); - - _byte[dest] = red; - _byte[dest + 1] = green; - _byte[dest + 2] = blue; - - dest += 3; - } - - if (BMPadding) { - input.skip(2); - } - } - - } else if (bitCount == 32) { - - System::free(_byte); - _byte = NULL; - System::free(palette); - palette = NULL; - throw Error("32 bit bitmaps not supported", input.getFilename()); - - } else { - // We support all possible bit depths, so if the - // code gets here, it's not even a real bitmap. - System::free(_byte); - _byte = NULL; - throw Error("Not a bitmap!", input.getFilename()); - } - - System::free(palette); - palette = NULL; -} - - -void GImage::decodeICO( - BinaryInput& input) { - - // Header - uint16 r = input.readUInt16(); - debugAssert(r == 0); - r = input.readUInt16(); - debugAssert(r == 1); - - // Read the number of icons, although we'll only load the - // first one. - int count = input.readUInt16(); - - channels = 4; - - debugAssert(count > 0); - - const uint8* headerBuffer = input.getCArray() + input.getPosition(); - int maxWidth = 0, maxHeight = 0; - int maxHeaderNum = 0; - for (int currentHeader = 0; currentHeader < count; ++currentHeader) { - - const uint8* curHeaderBuffer = headerBuffer + (currentHeader * 16); - int tmpWidth = curHeaderBuffer[0]; - int tmpHeight = curHeaderBuffer[1]; - // Just in case there is a non-square icon, checking area - if ((tmpWidth * tmpHeight) > (maxWidth * maxHeight)) { - maxWidth = tmpWidth; - maxHeight = tmpHeight; - maxHeaderNum = currentHeader; - } - } - - input.skip(maxHeaderNum * 16); - - width = input.readUInt8(); - height = input.readUInt8(); - int numColors = input.readUInt8(); - - _byte = (uint8*)System::malloc(width * height * channels); - debugAssert(_byte); - - // Bit mask for packed bits - int mask = 0; - - int bitsPerPixel = 8; - - switch (numColors) { - case 2: - mask = 0x01; - bitsPerPixel = 1; - break; - - case 16: - mask = 0x0F; - bitsPerPixel = 4; - break; - - case 0: - numColors = 256; - mask = 0xFF; - bitsPerPixel = 8; - break; - default: - throw Error("Unsupported ICO color count.", input.getFilename()); - } - - input.skip(5); - // Skip 'size' unused - input.skip(4); - - int offset = input.readUInt32(); - - // Skip over any other icon descriptions - input.setPosition(offset); - - // Skip over bitmap header; it is redundant - input.skip(40); - - Array palette; - palette.resize(numColors, true); - for (int c = 0; c < numColors; ++c) { - palette[c].b = input.readUInt8(); - palette[c].g = input.readUInt8(); - palette[c].r = input.readUInt8(); - palette[c].a = input.readUInt8(); - } - - // The actual image and mask follow - - // The XOR Bitmap is stored as 1-bit, 4-bit or 8-bit uncompressed Bitmap - // using the same encoding as BMP files. The AND Bitmap is stored in as - // 1-bit uncompressed Bitmap. - // - // Pixels are stored bottom-up, left-to-right. Pixel lines are padded - // with zeros to end on a 32bit (4byte) boundary. Every line will have the - // same number of bytes. Color indices are zero based, meaning a pixel color - // of 0 represents the first color table entry, a pixel color of 255 (if there - // are that many) represents the 256th entry. -/* - int bitsPerRow = width * bitsPerPixel; - int bytesPerRow = iCeil((double)bitsPerRow / 8); - // Rows are padded to 32-bit boundaries - bytesPerRow += bytesPerRow % 4; - - // Read the XOR values into the color channel - for (int y = height - 1; y >= 0; --y) { - int x = 0; - // Read the row - for (int i = 0; i < bytesPerRow; ++i) { - uint8 byte = input.readUInt8(); - for (int j = 0; (j < 8) && (x < width); ++x, j += bitsPerPixel) { - int bit = ((byte << j) >> (8 - bitsPerPixel)) & mask; - pixel4(x, y) = colorTable[bit]; - } - } - } -*/ - int hStart = 0; - int hEnd = 0; - int hDir = 0; - - if (height < 0) { - height = -height; - hStart = 0; - hEnd = height; - hDir = 1; - } else { - //height = height; - hStart = height - 1; - hEnd = -1; - hDir = -1; - } - - int BMScanWidth; - uint8 BMGroup; - uint8 BMPixel8; - int currPixel; - int dest; - - if (bitsPerPixel == 1) { - // Note that this file is not necessarily grayscale, since it's possible - // the palette is blue-and-white, or whatever. But of course most image - // programs only write 1-bit images if they're black-and-white. - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = (width + 7) >> 3; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - // Powers of 2 - int pow2[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 3 * h * width; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMGroup = input.readUInt8(); - - // Now we read the pixels. Usually there are eight pixels per byte, - // since each pixel is represented by one bit, but if the width - // is not a multiple of eight, the last byte will have some bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "width" number of pixels. - for (int i = 7; i >= 0; --i) { - if (currPixel < width) { - int src = ((BMGroup & pow2[i]) >> i); - - _byte[dest] = palette[src].r; - _byte[dest + 1] = palette[src].g; - _byte[dest + 2] = palette[src].b; - - ++currPixel; - dest += 4; - } - } - } - } - - } else if (bitsPerPixel == 4) { - - // For bitmaps, each scanline is dword-aligned. - int BMScanWidth = (width+1) >> 1; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - dest = 4 * h * width; - - for (int w = 0; w < BMScanWidth; w++) { - - BMGroup = input.readUInt8(); - int src[2]; - src[0] = ((BMGroup & 0xF0) >> 4); - src[1] = (BMGroup & 0x0F); - - // Now we read the pixels. Usually there are two pixels per byte, - // since each pixel is represented by four bits, but if the width - // is not a multiple of two, the last byte will have only four bits - // set, with the others just being extra. Plus there's the - // dword-alignment padding. So we keep checking to see if we've - // already read "Width" number of pixels. - - for (int i = 0; i < 2; ++i) { - if (currPixel < width) { - int tsrc = src[i]; - - _byte[dest] = palette[tsrc].r; - _byte[dest + 1] = palette[tsrc].g; - _byte[dest + 2] = palette[tsrc].b; - - ++currPixel; - dest += 4; - } - } - } - } - - } else if (bitsPerPixel == 8) { - - // For bitmaps, each scanline is dword-aligned. - BMScanWidth = width; - if (BMScanWidth & 3) { - BMScanWidth += 4 - (BMScanWidth & 3); - } - - for (int h = hStart; h != hEnd; h += hDir) { - - currPixel = 0; - - for (int w = 0; w < BMScanWidth; ++w) { - - BMPixel8 = input.readUInt8(); - - if (currPixel < width) { - dest = 4 * ((h * width) + currPixel); - int src = BMPixel8; - - _byte[dest] = palette[src].r; - _byte[dest + 1] = palette[src].g; - _byte[dest + 2] = palette[src].b; - - ++currPixel; - } - } - } - } - - // Read the mask into the alpha channel - int bitsPerRow = width; - int bytesPerRow = iCeil((double)bitsPerRow / 8); - - // For bitmaps, each scanline is dword-aligned. - //BMScanWidth = (width + 1) >> 1; - if (bytesPerRow & 3) { - bytesPerRow += 4 - (bytesPerRow & 3); - } - - for (int y = height - 1; y >= 0; --y) { - int x = 0; - // Read the row - for (int i = 0; i < bytesPerRow; ++i) { - uint8 byte = input.readUInt8(); - for (int j = 0; (j < 8) && (x < width); ++x, ++j) { - int bit = (byte >> (7 - j)) & 0x01; - pixel4(x, y).a = (1 - bit) * 0xFF; - } - } - } - -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/GImage_jpeg.cpp b/externals/g3dlite/G3D.lib/source/GImage_jpeg.cpp deleted file mode 100644 index fe2812cf3b2..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage_jpeg.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/** - @file GImage_jpeg.cpp - @author Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2006-10-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -#include - -/** - Pick up libjpeg headers locally on Windows, but from the system on all other platforms. -*/ -extern "C" { -#include -#include -} - -namespace G3D { - - -const int jpegQuality = 96; - -/** - The IJG library needs special setup for compress/decompressing - from memory. These classes provide them. - - The format of this class is defined by the IJG library; do not - change it. - */ -class memory_destination_mgr { -public: - struct jpeg_destination_mgr pub; - JOCTET* buffer; - int size; - int count; -}; - -typedef memory_destination_mgr* mem_dest_ptr; - -/** - Signature dictated by IJG. - */ -static void init_destination ( - j_compress_ptr cinfo) { - - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = dest->size; - dest->count=0; -} - -/** - Signature dictated by IJG. - */ -static boolean empty_output_buffer ( - j_compress_ptr cinfo) { - - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = dest->size; - - return TRUE; -} - -/** - Signature dictated by IJG. - */ -static void term_destination ( - j_compress_ptr cinfo) { - - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - dest->count = dest->size - dest->pub.free_in_buffer; -} - -/** - Signature dictated by IJG. - */ -static void jpeg_memory_dest ( - j_compress_ptr cinfo, - JOCTET* buffer, - int size) { - - mem_dest_ptr dest; - - if (cinfo->dest == NULL) { - // First time for this JPEG object; call the - // IJG allocator to get space. - cinfo->dest = (struct jpeg_destination_mgr*) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, - JPOOL_PERMANENT, - sizeof(memory_destination_mgr)); - } - - dest = (mem_dest_ptr) cinfo->dest; - dest->size = size; - dest->buffer = buffer; - dest->pub.init_destination = init_destination; - dest->pub.empty_output_buffer = empty_output_buffer; - dest->pub.term_destination = term_destination; -} - -//////////////////////////////////////////////////////////////////////////////////////// - -#define INPUT_BUF_SIZE 4096 - -/** - Structure dictated by IJG. - */ -class memory_source_mgr { -public: - struct jpeg_source_mgr pub; - int source_size; - unsigned char* source_data; - boolean start_of_data; - JOCTET* buffer; -}; - - -typedef memory_source_mgr* mem_src_ptr; - - -/** - Signature dictated by IJG. - */ -static void init_source( - j_decompress_ptr cinfo) { - - mem_src_ptr src = (mem_src_ptr) cinfo->src; - - src->start_of_data = TRUE; -} - - -/** - Signature dictated by IJG. - */ -static boolean fill_input_buffer( - j_decompress_ptr cinfo) { - - mem_src_ptr src = (mem_src_ptr) cinfo->src; - - size_t bytes_read = 0; - - if (src->source_size > INPUT_BUF_SIZE) - bytes_read = INPUT_BUF_SIZE; - else - bytes_read = src->source_size; - - memcpy (src->buffer, src->source_data, bytes_read); - - src->source_data += bytes_read; - src->source_size -= bytes_read; - - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = bytes_read; - src->start_of_data = FALSE; - - - return TRUE; -} - - -/** - Signature dictated by IJG. - */ -static void skip_input_data( - j_decompress_ptr cinfo, - long num_bytes) { - - mem_src_ptr src = (mem_src_ptr)cinfo->src; - - if (num_bytes > 0) { - while (num_bytes > (long) src->pub.bytes_in_buffer) { - num_bytes -= (long) src->pub.bytes_in_buffer; - boolean s = fill_input_buffer(cinfo); - debugAssert(s); (void)s; - } - - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - - -/** - Signature dictated by IJG. - */ -static void term_source ( - j_decompress_ptr cinfo) { - (void)cinfo; - // Intentionally empty -} - - -/** - Signature dictated by IJG. - */ -static void jpeg_memory_src ( - j_decompress_ptr cinfo, - JOCTET* buffer, - int size) { - - mem_src_ptr src; - - if (cinfo->src == NULL) { - // First time for this JPEG object - cinfo->src = (struct jpeg_source_mgr*) - (*cinfo->mem->alloc_small)( - (j_common_ptr) cinfo, - JPOOL_PERMANENT, - sizeof(memory_source_mgr)); - - src = (mem_src_ptr)cinfo->src; - - src->buffer = (JOCTET*) - (*cinfo->mem->alloc_small)( - (j_common_ptr) cinfo, - JPOOL_PERMANENT, - INPUT_BUF_SIZE * sizeof(JOCTET)); - } - - src = (mem_src_ptr)cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - - // use default method - src->pub.resync_to_restart = jpeg_resync_to_restart; - src->pub.term_source = term_source; - src->source_data = buffer; - src->source_size = size; - - // forces fill_input_buffer on first read - src->pub.bytes_in_buffer = 0; - - // until buffer loaded - src->pub.next_input_byte = NULL; -} - - -void GImage::encodeJPEG( - BinaryOutput& out) const { - - if (channels != 3) { - // Convert to three channel - GImage tmp = *this; - tmp.convertToRGB(); - tmp.encodeJPEG(out); - return; - } - - debugAssert(channels == 3); - out.setEndian(G3D_LITTLE_ENDIAN); - - // Allocate and initialize a compression object - jpeg_compress_struct cinfo; - jpeg_error_mgr jerr; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - - // Specify the destination for the compressed data. - // (Overestimate the size) - int buffer_size = width * height * 3 + 200; - JOCTET* compressed_data = (JOCTET*)System::malloc(buffer_size); - jpeg_memory_dest(&cinfo, compressed_data, buffer_size); - - - cinfo.image_width = width; - cinfo.image_height = height; - - // # of color components per pixel - cinfo.input_components = 3; - - // colorspace of input image - cinfo.in_color_space = JCS_RGB; - cinfo.input_gamma = 1.0; - - // Set parameters for compression, including image size & colorspace - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, jpegQuality, false); - cinfo.smoothing_factor = 0; - cinfo.optimize_coding = TRUE; -// cinfo.dct_method = JDCT_FLOAT; - cinfo.dct_method = JDCT_ISLOW; - cinfo.jpeg_color_space = JCS_YCbCr; - - // Initialize the compressor - jpeg_start_compress(&cinfo, TRUE); - - // Iterate over all scanlines from top to bottom - // pointer to a single row - JSAMPROW row_pointer[1]; - - // JSAMPLEs per row in image_buffer - int row_stride = cinfo.image_width * 3; - while (cinfo.next_scanline < cinfo.image_height) { - row_pointer[0] = &(_byte[cinfo.next_scanline * row_stride]); - jpeg_write_scanlines(&cinfo, row_pointer, 1); - } - - // Shut down the compressor - jpeg_finish_compress(&cinfo); - - // Figure out how big the result was. - int outLength = ((mem_dest_ptr)cinfo.dest)->count; - - // Release the JPEG compression object - jpeg_destroy_compress(&cinfo); - - // Copy into an appropriately sized output buffer. - out.writeBytes(compressed_data, outLength); - - // Free the conservative buffer. - System::free(compressed_data); - compressed_data = NULL; -} - - - -void GImage::decodeJPEG( - BinaryInput& input) { - - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - int loc = 0; - - channels = 3; - // We have to set up the error handler, in case initialization fails. - cinfo.err = jpeg_std_error(&jerr); - - // Initialize the JPEG decompression object. - jpeg_create_decompress(&cinfo); - - // Specify data source (eg, a file, for us, memory) - jpeg_memory_src(&cinfo, const_cast(input.getCArray()), input.size()); - - // Read the parameters with jpeg_read_header() - jpeg_read_header(&cinfo, TRUE); - - // Set parameters for decompression - // (We do nothing here since the defaults are fine) - - // Start decompressor - jpeg_start_decompress(&cinfo); - - // Get and set the values of interest to this object - this->width = cinfo.output_width; - this->height = cinfo.output_height; - - // Prepare the pointer object for the pixel data - _byte = (uint8*)System::malloc(width * height * 3); - - // JSAMPLEs per row in output buffer - int bpp = cinfo.output_components; - int row_stride = cinfo.output_width * bpp; - - // Make a one-row-high sample array that will go away when done with image - JSAMPARRAY temp = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - - // Read data on a scanline by scanline basis - while (cinfo.output_scanline < cinfo.output_height) { - - // We may need to adjust the output based on the - // number of channels it has. - switch (bpp) { - case 1: - // Grayscale; decompress to temp. - jpeg_read_scanlines(&cinfo, temp, 1); - - // Expand to three channels - { - uint8* scan = &(_byte[loc * 3]); - uint8* endScan = scan + (width * 3); - uint8* t = *temp; - - while (scan < endScan) { - uint8 value = t[0]; - - // Spread the value 3x. - scan[0] = value; - scan[1] = value; - scan[2] = value; - - scan += 3; - t += 1; - } - } - break; - - case 3: - // Read directly into the array - { - // Need one extra level of indirection. - uint8* scan = _byte + loc; - JSAMPARRAY ptr = &scan; - jpeg_read_scanlines(&cinfo, ptr, 1); - } - break; - - case 4: - // RGBA; decompress to temp. - jpeg_read_scanlines(&cinfo, temp, 1); - - // Drop the 3rd channel - { - uint8* scan = &(_byte[loc * 3]); - uint8* endScan = scan + width * 3; - uint8* t = *temp; - - while (scan < endScan) { - scan[0] = t[0]; - scan[1] = t[1]; - scan[2] = t[2]; - - scan += 3; - t += 4; - } - } - break; - - default: - throw Error("Unexpected number of channels.", input.getFilename()); - } - - loc += row_stride; - } - - // Finish decompression - jpeg_finish_decompress(&cinfo); - - alwaysAssertM(this, "Corrupt GImage"); - // Release JPEG decompression object - jpeg_destroy_decompress(&cinfo); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/GImage_png.cpp b/externals/g3dlite/G3D.lib/source/GImage_png.cpp deleted file mode 100644 index 9fd6a743e8e..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage_png.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/** - @file GImage_png.cpp - @author Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" -#include - -namespace G3D { - - -//libpng required function signature -static void png_read_data( - png_structp png_ptr, - png_bytep data, - png_size_t length) { - - - debugAssert( png_ptr->io_ptr != NULL ); - debugAssert( length >= 0 ); - debugAssert( data != NULL ); - - ((BinaryInput*)png_ptr->io_ptr)->readBytes(data, length); -} - -//libpng required function signature -static void png_write_data(png_structp png_ptr, - png_bytep data, - png_size_t length) { - - debugAssert( png_ptr->io_ptr != NULL ); - debugAssert( data != NULL ); - - ((BinaryOutput*)png_ptr->io_ptr)->writeBytes(data, length); -} - -//libpng required function signature -static void png_flush_data( - png_structp png_ptr) { - (void)png_ptr; - //Do nothing. -} - -//libpng required function signature -static void png_error( - png_structp png_ptr, - png_const_charp error_msg) { - - (void)png_ptr; - debugAssert( error_msg != NULL ); - throw GImage::Error(error_msg, "PNG"); -} - -//libpng required function signature -void png_warning( - png_structp png_ptr, - png_const_charp warning_msg) { - - (void)png_ptr; - debugAssert( warning_msg != NULL ); - Log::common()->println(warning_msg); -} - -void GImage::encodePNG( - BinaryOutput& out) const { - - debugAssert( channels == 1 || channels == 3 || channels == 4 ); - - if (this->height > (int)(PNG_UINT_32_MAX/png_sizeof(png_bytep))) - throw GImage::Error("Unsupported PNG height.", out.getFilename()); - - out.setEndian(G3D_LITTLE_ENDIAN); - - png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, png_error, png_warning); - if (!png_ptr) - throw GImage::Error("Unable to initialize PNG encoder.", out.getFilename()); - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - png_destroy_write_struct(&png_ptr, &info_ptr); - throw GImage::Error("Unable to initialize PNG encoder.", out.getFilename()); - } - - //setup libpng write handler so can use BinaryOutput - png_set_write_fn(png_ptr, (void*)&out, png_write_data, png_flush_data); - - if (channels == 3) { - png_set_IHDR(png_ptr, info_ptr, this->width, this->height, 8, PNG_COLOR_TYPE_RGB, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - } - else if (channels == 4) { - png_set_IHDR(png_ptr, info_ptr, this->width, this->height, 8, PNG_COLOR_TYPE_RGBA, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - } - else if (channels == 1) { - png_set_IHDR(png_ptr, info_ptr, this->width, this->height, 8, PNG_COLOR_TYPE_GRAY, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - } - else { - png_destroy_write_struct(&png_ptr, &info_ptr); - throw GImage::Error("Unsupported number of channels for PNG.", out.getFilename()); - } - - png_color_8_struct sig_bit; - sig_bit.red = 8; - sig_bit.green = 8; - sig_bit.blue = 8; - if (channels == 4) - sig_bit.alpha = 8; - else - sig_bit.alpha = 0; - png_set_sBIT(png_ptr, info_ptr, &sig_bit); - - //write the png header - png_write_info(png_ptr, info_ptr); - - png_bytepp row_pointers = new png_bytep[this->height]; - - for (int i=0; i < this->height; ++i) { - row_pointers[i] = (png_bytep)&this->_byte[(this->width * this->channels * i)]; - } - - png_write_image(png_ptr, row_pointers); - - png_write_end(png_ptr, info_ptr); - - delete[] row_pointers; - - png_destroy_write_struct(&png_ptr, &info_ptr); -} - - -void GImage::decodePNG( - BinaryInput& input) { - - png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, png_error, png_warning); - if (!png_ptr) - throw GImage::Error("Unable to initialize PNG decoder.", input.getFilename()); - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - throw GImage::Error("Unable to initialize PNG decoder.", input.getFilename()); - } - - png_infop end_info = png_create_info_struct(png_ptr); - if (!end_info) { - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - throw GImage::Error("Unable to initialize PNG decoder.", input.getFilename()); - } - - //now that the libpng structures are setup, change the error handlers and read routines - //to use G3D functions so that BinaryInput can be used. - - png_set_read_fn(png_ptr, (png_voidp)&input, png_read_data); - - //read in sequentially so that three copies of the file are not in memory at once - png_read_info(png_ptr, info_ptr); - - png_uint_32 png_width, png_height; - int bit_depth, color_type, interlace_type; - //this will validate the data it extracts from info_ptr - png_get_IHDR(png_ptr, info_ptr, &png_width, &png_height, &bit_depth, &color_type, - &interlace_type, int_p_NULL, int_p_NULL); - - if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - throw GImage::Error("Unsupported PNG color type - PNG_COLOR_TYPE_GRAY_ALPHA.", input.getFilename()); - } - - this->width = static_cast(png_width); - this->height = static_cast(png_height); - - //swap bytes of 16 bit files to least significant byte first - png_set_swap(png_ptr); - - png_set_strip_16(png_ptr); - - //Expand paletted colors into true RGB triplets - if (color_type == PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png_ptr); - } - - //Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel - if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { - png_set_gray_1_2_4_to_8(png_ptr); - } - - //Expand paletted or RGB images with transparency to full alpha channels - //so the data will be available as RGBA quartets. - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - png_set_tRNS_to_alpha(png_ptr); - } - - // Fix sub-8 bit_depth to 8bit - if (bit_depth < 8) { - png_set_packing(png_ptr); - } - - if ((color_type == PNG_COLOR_TYPE_RGBA) || - ((color_type == PNG_COLOR_TYPE_PALETTE) && (png_ptr->num_trans > 0)) ) { - - this->channels = 4; - this->_byte = (uint8*)System::malloc(width * height * 4); - - } else if ((color_type == PNG_COLOR_TYPE_RGB) || - (color_type == PNG_COLOR_TYPE_PALETTE)) { - - this->channels = 3; - this->_byte = (uint8*)System::malloc(width * height * 3); - - } else if (color_type == PNG_COLOR_TYPE_GRAY) { - - this->channels = 1; - this->_byte = (uint8*)System::malloc(width * height); - - } else { - throw GImage::Error("Unsupported PNG bit-depth or type.", input.getFilename()); - } - - //since we are reading row by row, required to handle interlacing - uint32 number_passes = png_set_interlace_handling(png_ptr); - - png_read_update_info(png_ptr, info_ptr); - - for (uint32 pass = 0; pass < number_passes; ++pass) { - for (uint32 y = 0; y < (uint32)height; ++y) { - png_bytep rowPointer = &this->_byte[width * this->channels * y]; - png_read_rows(png_ptr, &rowPointer, png_bytepp_NULL, 1); - } - } - -// png_read_image(png_ptr, &_byte); - png_read_end(png_ptr, info_ptr); - - png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/GImage_ppm.cpp b/externals/g3dlite/G3D.lib/source/GImage_ppm.cpp deleted file mode 100644 index bfe5c8305e8..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage_ppm.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/** - @file GImage_ppm.cpp - @author Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/Log.h" - -namespace G3D { - -void GImage::encodePPMASCII( - BinaryOutput& out) const { - - debugAssert(channels == 3); - - TextOutput::Settings ppmOptions; - ppmOptions.convertNewlines = false; - ppmOptions.numColumns = 70; - ppmOptions.wordWrap = TextOutput::Settings::WRAP_WITHOUT_BREAKING; - TextOutput ppm(ppmOptions); - // Always write out a full-color ppm - ppm.printf("P3\n%d %d\n255\n", width, height); - - const Color3uint8* c = this->pixel3(); - for (uint32 i = 0; i < (uint32)(width * height); ++i) { - ppm.printf("%d %d %d%c", c[i].r, c[i].g, c[i].b, - ((i % ((width * 3) - 1)) == 0) ? - '\n' : ' '); - } - - out.writeString(ppm.commitString()); -} - - -void GImage::encodePPM( - BinaryOutput& out) const { - - // http://netpbm.sourceforge.net/doc/ppm.html - debugAssert(channels == 3); - - std::string header = format("P6 %d %d 255 ", width, height); - - out.writeBytes(header.c_str(), header.size()); - - out.writeBytes(this->pixel3(), width * height * 3); -} - -void GImage::decodePPMASCII( - BinaryInput& input) { - - int ppmWidth; - int ppmHeight; - - double maxColor; - - // Create a TextInput object to parse ascii format - // Mixed binary/ascii formats will require more - - const std::string inputStr = input.readString(); - - TextInput::Settings ppmOptions; - ppmOptions.cppComments = false; - ppmOptions.otherCommentCharacter = '#'; - ppmOptions.signedNumbers = true; - ppmOptions.singleQuotedStrings = false; - - TextInput ppmInput(TextInput::FROM_STRING, inputStr, ppmOptions); - - //Skip first line in header P# - std::string ppmType = ppmInput.readSymbol(); - - ppmWidth = (int)ppmInput.readNumber(); - ppmHeight = (int)ppmInput.readNumber(); - - // Everything but a PBM will have a max color value - if (ppmType != "P2") { - maxColor = ppmInput.readNumber(); - } else { - maxColor = 255; - } - - if ((ppmWidth < 0) || - (ppmHeight < 0) || - (maxColor <= 0)) { - throw GImage::Error("Invalid PPM Header.", input.getFilename()); - } - - // I don't think it's proper to scale values less than 255 - if (maxColor <= 255.0) { - maxColor = 255.0; - } - - this->width = ppmWidth; - this->height = ppmHeight; - this->channels = 3; - // always scale down to 1 byte per channel - this->_byte = (uint8*)System::malloc(width * height * 3); - - // Read in the image data. I am not validating if the values match the maxColor - // requirements. I only scale if needed to fit within the byte available. - for (uint32 i = 0; i < (uint32)(width * height); ++i) { - // read in color and scale to max pixel defined in header - // A max color less than 255 might need to be left alone and not scaled. - Color3uint8& curPixel = *(this->pixel3() + i); - - if (ppmType == "P3") { - curPixel.r = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - curPixel.g = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - curPixel.b = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - } else if (ppmType == "P2") { - uint8 pixel = (uint8)(ppmInput.readNumber() * (255.0 / maxColor)); - curPixel.r = pixel; - curPixel.g = pixel; - curPixel.b = pixel; - } else if (ppmType == "P1") { - int pixel = (uint8)(ppmInput.readNumber() * maxColor); - curPixel.r = pixel; - curPixel.g = pixel; - curPixel.b = pixel; - } - } -} - -/** Consumes whitespace up to and including a number, but not the following character */ -static int scanUInt(BinaryInput& input) { - char c = input.readUInt8(); - while (isWhiteSpace(c)) { - c = input.readUInt8(); - } - - std::string s; - s += c; - c = input.readUInt8(); - while (!isWhiteSpace(c)) { - s += c; - c = input.readUInt8(); - } - - // Back up one to avoid consuming the last character - input.setPosition(input.getPosition() - 1); - - int x; - sscanf(s.c_str(), "%d", &x); - return x; -} - -void GImage::decodePPM( - BinaryInput& input) { - - char head[2]; - int w, h; - - input.readBytes(head, 2); - if (head[0] != 'P' || head[1] != '6') { - throw GImage::Error("Invalid PPM Header.", input.getFilename()); - } - - w = scanUInt(input); - h = scanUInt(input); - - // Skip the max color specifier - scanUInt(input); - - if ((w < 0) || - (h < 0) || - (w > 100000) || - (h > 100000)) { - throw GImage::Error("Invalid PPM size in header.", input.getFilename()); - } - - // Trailing whitespace - input.readUInt8(); - - resize(w, h, 3); - - input.readBytes(_byte, width * height * 3); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/GImage_tga.cpp b/externals/g3dlite/G3D.lib/source/GImage_tga.cpp deleted file mode 100644 index d84feedecc9..00000000000 --- a/externals/g3dlite/G3D.lib/source/GImage_tga.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/** - @file GImage_tga.cpp - @author Morgan McGuire, morgan@graphics3d.com - @created 2002-05-27 - @edited 2006-05-10 - */ -#include "G3D/platform.h" -#include "G3D/GImage.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" - -namespace G3D { - -void GImage::encodeTGA( - BinaryOutput& out) const { - - out.setEndian(G3D_LITTLE_ENDIAN); - - // ID length - out.writeUInt8(0); - - // Color map Type - out.writeUInt8(0); - - // Type - out.writeUInt8(2); - - // Color map - out.skip(5); - - // x, y offsets - out.writeUInt16(0); - out.writeUInt16(0); - - // Width & height - out.writeUInt16(width); - out.writeUInt16(height); - - // Color depth - out.writeUInt8(8 * channels); - - // Image descriptor - if (channels == 3) { - // 0 alpha bits - out.writeUInt8(0); - } - else { - // 8 alpha bits - out.writeUInt8(8); - } - - // Image ID (zero length) - - if (channels == 3) { - // Pixels are upside down in BGR format. - for (int y = height - 1; y >= 0; y--) { - for (int x = 0; x < width; x++) { - uint8* p = &(_byte[3 * (y * width + x)]); - out.writeUInt8(p[2]); - out.writeUInt8(p[1]); - out.writeUInt8(p[0]); - } - } - } else { - // Pixels are upside down in BGRA format. - for (int y = height - 1; y >= 0; y--) { - for (int x = 0; x < width; x++) { - uint8* p = &(_byte[4 * (y * width + x)]); - out.writeUInt8(p[2]); - out.writeUInt8(p[1]); - out.writeUInt8(p[0]); - out.writeUInt8(p[3]); - } - } - } - - // Write "TRUEVISION-XFILE " 18 bytes from the end - // (with null termination) - out.writeString("TRUEVISION-XFILE "); -} - - -void GImage::decodeTGA( - BinaryInput& input) { - - // This is a simple TGA loader that can handle uncompressed - // truecolor TGA files (TGA type 2). - // Verify this is a TGA file by looking for the TRUEVISION tag. - int pos = input.getPosition(); - input.setPosition(input.size() - 18); - std::string tag = input.readString(16); - if (tag != "TRUEVISION-XFILE") { - throw Error("Not a TGA file", input.getFilename()); - } - - input.setPosition(pos); - - int IDLength = input.readUInt8(); - int colorMapType = input.readUInt8(); - int imageType = input.readUInt8(); - - (void)colorMapType; - - // 2 is the type supported by this routine. - if (imageType != 2) { - throw Error("TGA images must be type 2 (Uncompressed truecolor)", input.getFilename()); - } - - // Color map specification - input.skip(5); - - // Image specification - - // Skip x and y offsets - input.skip(4); - - width = input.readInt16(); - height = input.readInt16(); - - int colorDepth = input.readUInt8(); - - if ((colorDepth != 24) && (colorDepth != 32)) { - throw Error("TGA files must be 24 or 32 bit.", input.getFilename()); - } - - if (colorDepth == 32) { - channels = 4; - } else { - channels = 3; - } - - // Image descriptor contains overlay data as well - // as data indicating where the origin is - int imageDescriptor = input.readUInt8(); - (void)imageDescriptor; - - // Image ID - input.skip(IDLength); - - _byte = (uint8*)System::malloc(width * height * channels); - debugAssert(_byte); - - // Pixel data - int x; - int y; - - if (channels == 3) { - for (y = height - 1; y >= 0; y--) { - for (x = 0; x < width; x++) { - int b = input.readUInt8(); - int g = input.readUInt8(); - int r = input.readUInt8(); - - int i = (x + y * width) * 3; - _byte[i + 0] = r; - _byte[i + 1] = g; - _byte[i + 2] = b; - } - } - } else { - for (y = height - 1; y >= 0; y--) { - for (x = 0; x < width; x++) { - int b = input.readUInt8(); - int g = input.readUInt8(); - int r = input.readUInt8(); - int a = input.readUInt8(); - - int i = (x + y * width) * 4; - _byte[i + 0] = r; - _byte[i + 1] = g; - _byte[i + 2] = b; - _byte[i + 3] = a; - } - } - } -} - -} diff --git a/externals/g3dlite/G3D.lib/source/GLight.cpp b/externals/g3dlite/G3D.lib/source/GLight.cpp deleted file mode 100644 index 8acb066ef54..00000000000 --- a/externals/g3dlite/G3D.lib/source/GLight.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/** - @file GLight.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-11-12 - @edited 2007-10-22 -*/ - -#include "G3D/GLight.h" -#include "G3D/Sphere.h" - -namespace G3D { - -GLight::GLight() { - position = Vector4(0, 0, 0, 0); - color = Color3::white(); - spotDirection = Vector3(0, 0, -1); - spotCutoff = 180; - enabled = false; - attenuation[0] = 1.0; - attenuation[1] = 0.0; - attenuation[2] = 0.0; - specular = true; - diffuse = true; -} - - -GLight GLight::directional(const Vector3& toLight, const Color3& color, bool s, bool d) { - GLight L; - L.position = Vector4(toLight.direction(), 0); - L.color = color; - L.specular = s; - L.diffuse = d; - return L; -} - - -GLight GLight::point(const Vector3& pos, const Color3& color, float constAtt, float linAtt, float quadAtt, bool s, bool d) { - GLight L; - L.position = Vector4(pos, 1); - L.color = color; - L.attenuation[0] = constAtt; - L.attenuation[1] = linAtt; - L.attenuation[2] = quadAtt; - L.specular = s; - L.diffuse = d; - return L; -} - - -GLight GLight::spot(const Vector3& pos, const Vector3& pointDirection, float cutOffAngleDegrees, const Color3& color, float constAtt, float linAtt, float quadAtt, bool s, bool d) { - GLight L; - L.position = Vector4(pos, 1.0f); - L.spotDirection = pointDirection.direction(); - debugAssert(cutOffAngleDegrees <= 90); - L.spotCutoff = cutOffAngleDegrees; - L.color = color; - L.attenuation[0] = constAtt; - L.attenuation[1] = linAtt; - L.attenuation[2] = quadAtt; - L.specular = s; - L.diffuse = d; - return L; -} - - -bool GLight::operator==(const GLight& other) const { - return (position == other.position) && - (spotDirection == other.spotDirection) && - (spotCutoff == other.spotCutoff) && - (attenuation[0] == other.attenuation[0]) && - (attenuation[1] == other.attenuation[1]) && - (attenuation[2] == other.attenuation[2]) && - (color == other.color) && - (enabled == other.enabled) && - (specular == other.specular) && - (diffuse == other.diffuse); -} - -bool GLight::operator!=(const GLight& other) const { - return !(*this == other); -} - - -Sphere GLight::effectSphere(float cutoff) const { - if (position.w == 0) { - // Directional light - return Sphere(Vector3::zero(), (float)inf()); - } else { - // Avoid divide by zero - cutoff = max(cutoff, 0.0001f); - float maxIntensity = max(color.r, max(color.g, color.b)); - - float radius = (float)inf(); - - if (attenuation[2] != 0) { - - // Solve I / attenuation.dot(1, r, r^2) < cutoff for r - // - // a[0] + a[1] r + a[2] r^2 > I/cutoff - // - - float a = attenuation[2]; - float b = attenuation[1]; - float c = attenuation[0] - maxIntensity / cutoff; - - float discrim = square(b) - 4 * a * c; - - if (discrim >= 0) { - discrim = sqrt(discrim); - - float r1 = (-b + discrim) / (2 * a); - float r2 = (-b - discrim) / (2 * a); - - if (r1 < 0) { - if (r2 > 0) { - radius = r2; - } - } else if (r2 > 0) { - radius = min(r1, r2); - } else { - radius = r1; - } - } - - } else if (attenuation[1] != 0) { - - // Solve I / attenuation.dot(1, r) < cutoff for r - // - // r * a[1] + a[0] = I / cutoff - // r = (I / cutoff - a[0]) / a[1] - - float radius = (maxIntensity / cutoff - attenuation[0]) / attenuation[1]; - radius = max(radius, 0.0f); - } - - return Sphere(position.xyz(), radius); - - } -} - -} diff --git a/externals/g3dlite/G3D.lib/source/GThread.cpp b/externals/g3dlite/G3D.lib/source/GThread.cpp deleted file mode 100644 index 090370436c4..00000000000 --- a/externals/g3dlite/G3D.lib/source/GThread.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/** - @file GThread.cpp - - GThread class. - - @created 2005-09-24 - @edited 2005-10-22 - */ - -#include "G3D/GThread.h" -#include "G3D/System.h" -#include "G3D/debugAssert.h" - - -namespace G3D { - -namespace _internal { - -class BasicThread: public GThread { -public: - BasicThread(const std::string& name, void (*proc)(void*), void* param): - GThread(name), m_wrapperProc(proc), m_param(param) { } -protected: - virtual void threadMain() { - m_wrapperProc(m_param); - } - -private: - void (*m_wrapperProc)(void*); - - void* m_param; -}; - -} // namespace _internal - - -GThread::GThread(const std::string& name): - m_status(STATUS_CREATED), - m_name(name) { - -#ifdef G3D_WIN32 - m_event = NULL; -#endif - - // system-independent clear of handle - System::memset(&m_handle, 0, sizeof(m_handle)); -} - -GThread::~GThread() { -#ifdef _MSC_VER -# pragma warning( push ) -# pragma warning( disable : 4127 ) -#endif - alwaysAssertM(m_status != STATUS_RUNNING, "Deleting thread while running."); -#ifdef _MSC_VER -# pragma warning( pop ) -#endif - -#ifdef G3D_WIN32 - if (m_event) { - ::CloseHandle(m_event); - } -#endif -} - -GThreadRef GThread::create(const std::string& name, void (*proc)(void*), void* param) { - return new _internal::BasicThread(name, proc, param); -} - - -bool GThread::started() const { - return m_status != STATUS_CREATED; -} - -bool GThread::start() { - - debugAssertM(! started(), "Thread has already executed."); - if (started()) { - return false; - } - - m_status = STATUS_STARTED; - -# ifdef G3D_WIN32 - DWORD threadId; - - m_event = ::CreateEvent(NULL, TRUE, FALSE, NULL); - debugAssert(m_event); - - m_handle = ::CreateThread(NULL, 0, &internalThreadProc, this, 0, &threadId); - - if (m_handle == NULL) { - ::CloseHandle(m_event); - m_event = NULL; - } - - return (m_handle != NULL); -# else - if (!pthread_create(&m_handle, NULL, &internalThreadProc, this)) { - return true; - } else { - // system-independent clear of handle - System::memset(&m_handle, 0, sizeof(m_handle)); - - return false; - } -# endif -} - -void GThread::terminate() { - if (m_handle) { -# ifdef G3D_WIN32 - ::TerminateThread(m_handle, 0); -# else - pthread_kill(m_handle, SIGSTOP); -# endif - // system-independent clear of handle - System::memset(&m_handle, 0, sizeof(m_handle)); - } -} - -bool GThread::running() const{ - return (m_status == STATUS_RUNNING); -} - -bool GThread::completed() const { - return (m_status == STATUS_COMPLETED); -} - -void GThread::waitForCompletion() { -# ifdef G3D_WIN32 - debugAssert(m_event); - ::WaitForSingleObject(m_event, INFINITE); -# else - debugAssert(m_handle); - pthread_join(m_handle, NULL); -# endif -} - -#ifdef G3D_WIN32 -DWORD WINAPI GThread::internalThreadProc(LPVOID param) { - GThread* current = reinterpret_cast(param); - debugAssert(current->m_event); - current->m_status = STATUS_RUNNING; - current->threadMain(); - current->m_status = STATUS_COMPLETED; - ::SetEvent(current->m_event); - return 0; -} -#else -void* GThread::internalThreadProc(void* param) { - GThread* current = reinterpret_cast(param); - current->m_status = STATUS_RUNNING; - current->threadMain(); - current->m_status = STATUS_COMPLETED; - return (void*)NULL; -} -#endif - - - -GMutex::GMutex() { -# ifdef G3D_WIN32 - ::InitializeCriticalSection(&m_handle); -# else - pthread_mutex_init(&m_handle, NULL); -# endif -} - -GMutex::~GMutex() { - //TODO: Debug check for locked -# ifdef G3D_WIN32 - ::DeleteCriticalSection(&m_handle); -# else - pthread_mutex_destroy(&m_handle); -# endif -} - -//bool GMutex::tryLock() { -//# ifdef G3D_WIN32 -// return ::TryEnterCriticalSection(&m_handle); -//# else -// return pthread_mutex_trylock(&m_handle); -//# endif -//} - -void GMutex::lock() { -# ifdef G3D_WIN32 - ::EnterCriticalSection(&m_handle); -# else - pthread_mutex_lock(&m_handle); -# endif -} - -void GMutex::unlock() { -# ifdef G3D_WIN32 - ::LeaveCriticalSection(&m_handle); -# else - pthread_mutex_unlock(&m_handle); -# endif -} - -} // namespace G3D diff --git a/externals/g3dlite/G3D.lib/source/GUniqueID.cpp b/externals/g3dlite/G3D.lib/source/GUniqueID.cpp deleted file mode 100644 index 25c757b70e4..00000000000 --- a/externals/g3dlite/G3D.lib/source/GUniqueID.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/** - @file GUniqueID.cpp - @author Morgan McGuire, morgan@cs.williams.edu - */ -#include "G3D/GUniqueID.h" -#include "G3D/BinaryInput.h" -#include "G3D/TextInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/TextOutput.h" -#include "G3D/NetworkDevice.h" - -namespace G3D { - -void GUniqueID::serialize(BinaryOutput& b) const { - b.writeUInt64(id); -} - - -void GUniqueID::deserialize(BinaryInput& b) { - id = b.readUInt64(); -} - -void GUniqueID::serialize(TextOutput& t) const { - t.writeSymbol("("); - t.writeNumber((double)(id >> 32)); - t.writeNumber((double)(id & 0xFFFFFFFF)); - t.writeSymbol(")"); -} - -void GUniqueID::deserialize(TextInput& t) { - t.readSymbol("("); - id = (((uint64)t.readNumber()) << 32) + (uint64)t.readNumber(); - t.readSymbol(")"); -} - - -GUniqueID GUniqueID::create(uint16 tag) { - static uint64 counter = 0; - static uint64 systemID = 0; - - if (systemID == 0) { - // Create a unique ID for this machine/program instance - - // TODO: see ioctl(skfd, SIOCGIFHWADDR, &if_hwaddr) - Array addr; - NetworkDevice::instance()->localHostAddresses(addr); - if (addr.size() > 0) { - systemID |= addr[0].ip(); - } - - union { - float64 ft; - uint64 ut; - }; - ft = System::time(); - systemID = ut << 22; - systemID ^= ((uint64)iRandom(0, 32768)) << 8; - - systemID &= ~((uint64)1023 << 54); - - // Ensure that the systemID is non-zero (vanishingly small probability) - if (systemID == 0) { - systemID = 1; - } - } - - // No need for modulo; we'll all be dead before this counter - // overflows 54 bits - ++counter; - - GUniqueID i; - - i.id = (((uint64)(tag & 1023)) << 54) | (counter ^ systemID); - - return i; -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Image1.cpp b/externals/g3dlite/G3D.lib/source/Image1.cpp deleted file mode 100644 index 30841d01c6b..00000000000 --- a/externals/g3dlite/G3D.lib/source/Image1.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/** - @file Image1.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#include "G3D/Image1.h" -#include "G3D/Image1uint8.h" -#include "G3D/GImage.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image1::Image1(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color1(0.0f)); -} - - -Image1::Ref Image1::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels) { - case 1: - return fromArray(im.pixel1(), im.width, im.height, wrap); - - case 3: - return fromArray(im.pixel3(), im.width, im.height, wrap); - - case 4: - return fromArray(im.pixel4(), im.width, im.height, wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image1::Ref Image1::fromImage1uint8(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->resize(im->width(), im->height()); - - int N = im->width() * im->height(); - const Color1uint8* src = reinterpret_cast(im->getCArray()); - for (int i = 0; i < N; ++i) { - out->data[i] = Color1(src[i]); - } - - return out; -} - - -Image1::Ref Image1::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image1::Ref Image1::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image1::Ref Image1::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -void Image1::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -Image1::Ref Image1::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1::Ref Image1::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - -void Image1::copyGImage(const GImage& im) { - switch (im.channels) { - case 1: - copyArray(im.pixel1(), im.width, im.height); - break; - - case 3: - copyArray(im.pixel3(), im.width, im.height); - break; - - case 4: - copyArray(im.pixel4(), im.width, im.height); - break; - } -} - - -void Image1::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color1* dst = data.getCArray(); - // Convert int8 -> float - for (int i = 0; i < N; ++i) { - dst[i] = Color1(Color3(src[i]).average()); - } -} - - -void Image1::copyArray(const Color4uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color1* dst = data.getCArray(); - - // Strip alpha and convert - for (int i = 0; i < N; ++i) { - dst[i] = Color1(Color3(src[i].rgb()).average()); - } -} - - -void Image1::copyArray(const Color1* src, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), src, w * h * sizeof(Color1)); -} - - -void Image1::copyArray(const Color4* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color1* dst = data.getCArray(); - - // Strip alpha - for (int i = 0; i < N; ++i) { - dst[i] = Color1(src[i].rgb().average()); - } -} - - -void Image1::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i]= Color1(src[i]); - } -} - - -void Image1::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1(src[i].average()); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image1::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 1); - - int N = im.width * im.height; - Color1uint8* dst = im.pixel1(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(data[i]); - } - - im.save(filename, fmt); -} - - -const ImageFormat* Image1::format() const { - return ImageFormat::L32F(); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Image1uint8.cpp b/externals/g3dlite/G3D.lib/source/Image1uint8.cpp deleted file mode 100644 index c43e7194d7d..00000000000 --- a/externals/g3dlite/G3D.lib/source/Image1uint8.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/** - @file Image1uint8.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2008-01-13 -*/ - -#include "G3D/Image1uint8.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image1.h" -#include "G3D/GImage.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image1uint8::Image1uint8(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color1uint8(0)); -} - - -Image1uint8::Ref Image1uint8::fromImage3uint8(const ReferenceCountedPointer& im) { - return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); -} - - -Image1uint8::Ref Image1uint8::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels) { - case 1: - return fromArray(im.pixel1(), im.width, im.height, wrap); - - case 3: - return fromArray(im.pixel3(), im.width, im.height, wrap); - - case 4: - return fromArray(im.pixel4(), im.width, im.height, wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image1uint8::Ref Image1uint8::fromImage1(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->copyArray(im->getCArray(), im->width(), im->height()); - - return out; -} - - -Image1uint8::Ref Image1uint8::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image1uint8::Ref Image1uint8::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image1uint8::Ref Image1uint8::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image1uint8::Ref Image1uint8::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image1uint8::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -void Image1uint8::copyGImage(const GImage& im) { - switch (im.channels) { - case 1: - copyArray(im.pixel1(), im.width, im.height); - break; - - case 3: - copyArray(im.pixel3(), im.width, im.height); - break; - - case 4: - copyArray(im.pixel4(), im.width, im.height); - break; - } -} - - -void Image1uint8::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].value = (src[i].r + src[i].g + src[i].b) / 3; - } -} - -void Image1uint8::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(Color1(src[i].average())); - } -} - - -void Image1uint8::copyArray(const Color1uint8* ptr, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), ptr, w * h); -} - - -void Image1uint8::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(src[i]); - } -} - - -void Image1uint8::copyArray(const Color4uint8* ptr, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].value = (ptr[i].r + ptr[i].g + ptr[i].b) / 3; - } -} - - -void Image1uint8::copyArray(const Color4* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color1uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color1uint8(Color1(src[i].rgb().average())); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image1uint8::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 1); - System::memcpy(im.byte(), getCArray(), width() * height()); - im.save(filename, fmt); -} - - -const ImageFormat* Image1uint8::format() const { - return ImageFormat::L8(); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Image3.cpp b/externals/g3dlite/G3D.lib/source/Image3.cpp deleted file mode 100644 index aa2ac6098dc..00000000000 --- a/externals/g3dlite/G3D.lib/source/Image3.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/** - @file Image3.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2007-01-31 -*/ - - -#include "G3D/Image3.h" -#include "G3D/Image3uint8.h" -#include "G3D/GImage.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image3::Image3(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color3::black()); -} - - -Image3::Ref Image3::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels) { - case 1: - return fromArray(im.pixel1(), im.width, im.height, wrap); - - case 3: - return fromArray(im.pixel3(), im.width, im.height, wrap); - - case 4: - return fromArray(im.pixel4(), im.width, im.height, wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image3::Ref Image3::fromImage3uint8(const ReferenceCountedPointer& im) { - Ref out = createEmpty(im->wrapMode()); - out->resize(im->width(), im->height()); - - int N = im->width() * im->height(); - const Color3uint8* src = reinterpret_cast(im->getCArray()); - for (int i = 0; i < N; ++i) { - out->data[i] = Color3(src[i]); - } - - return out; -} - - -Image3::Ref Image3::createEmpty(int width, int height, WrapMode wrap) { - return new Image3(width, height, wrap); -} - - -Image3::Ref Image3::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image3::Ref Image3::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -void Image3::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -Image3::Ref Image3::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3::Ref Image3::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - -void Image3::copyGImage(const GImage& im) { - switch (im.channels) { - case 1: - copyArray(im.pixel1(), im.width, im.height); - break; - - case 3: - copyArray(im.pixel3(), im.width, im.height); - break; - - case 4: - copyArray(im.pixel4(), im.width, im.height); - break; - } -} - - -void Image3::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color3* dst = data.getCArray(); - // Convert int8 -> float - for (int i = 0; i < N; ++i) { - dst[i] = Color3(src[i]); - } -} - - -void Image3::copyArray(const Color4uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color3* dst = data.getCArray(); - - // Strip alpha and convert - for (int i = 0; i < N; ++i) { - dst[i] = Color3(src[i].rgb()); - } -} - - -void Image3::copyArray(const Color3* src, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), src, w * h * sizeof(Color3)); -} - - -void Image3::copyArray(const Color4* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color3* dst = data.getCArray(); - - // Strip alpha - for (int i = 0; i < N; ++i) { - dst[i] = src[i].rgb(); - } -} - - -void Image3::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1(src[i]).value; - } -} - - -void Image3::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image3::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 3); - - int N = im.width * im.height; - Color3uint8* dst = im.pixel3(); - for (int i = 0; i < N; ++i) { - dst[i] = Color3uint8(data[i]); - } - - im.save(filename, fmt); -} - - -const ImageFormat* Image3::format() const { - return ImageFormat::RGB32F(); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Image3uint8.cpp b/externals/g3dlite/G3D.lib/source/Image3uint8.cpp deleted file mode 100644 index 2de32b6009e..00000000000 --- a/externals/g3dlite/G3D.lib/source/Image3uint8.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/** - @file Image3uint8.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2008-01-08 -*/ - -#include "G3D/Image1uint8.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image3.h" -#include "G3D/GImage.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image3uint8::Ref Image3uint8::fromImage1uint8(const ReferenceCountedPointer& im) { - return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); -} - - -Image3uint8::Image3uint8(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color3::black()); -} - - -Image3uint8::Ref Image3uint8::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels) { - case 1: - return fromArray(im.pixel1(), im.width, im.height, wrap); - - case 3: - return fromArray(im.pixel3(), im.width, im.height, wrap); - - case 4: - return fromArray(im.pixel4(), im.width, im.height, wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image3uint8::Ref Image3uint8::fromImage3(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->copyArray(im->getCArray(), im->width(), im->height()); - - return out; -} - - -Image3uint8::Ref Image3uint8::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image3uint8::Ref Image3uint8::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image3uint8::Ref Image3uint8::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image3uint8::Ref Image3uint8::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image3uint8::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -void Image3uint8::copyGImage(const GImage& im) { - switch (im.channels) { - case 1: - copyArray(im.pixel1(), im.width, im.height); - break; - - case 3: - copyArray(im.pixel3(), im.width, im.height); - break; - - case 4: - copyArray(im.pixel4(), im.width, im.height); - break; - } -} - - -void Image3uint8::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - } -} - -void Image3uint8::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1uint8(src[i]).value; - } -} - - -void Image3uint8::copyArray(const Color3uint8* ptr, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), ptr, w * h * 3); -} - - -void Image3uint8::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color3uint8(src[i]); - } -} - - -void Image3uint8::copyArray(const Color4uint8* ptr, int w, int h) { - resize(w, h); - - // Copy 3/4 bytes - GImage::RGBAtoRGB((const uint8*)ptr, (uint8*)getCArray(), w * h); -} - - -void Image3uint8::copyArray(const Color4* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color3uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color3uint8(src[i].rgb()); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image3uint8::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 3); - System::memcpy(im.byte(), getCArray(), width() * height() * 3); - im.save(filename, fmt); -} - - -ReferenceCountedPointer Image3uint8::getChannel(int c) const { - debugAssert(c >= 0 && c <= 2); - - Image1uint8Ref dst = Image1uint8::createEmpty(width(), height(), wrapMode()); - const Color3uint8* srcArray = getCArray(); - Color1uint8* dstArray = dst->getCArray(); - - const int N = width() * height(); - for (int i = 0; i < N; ++i) { - dstArray[i] = Color1uint8(srcArray[i][c]); - } - - return dst; -} - - -const ImageFormat* Image3uint8::format() const { - return ImageFormat::RGB8(); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Image4.cpp b/externals/g3dlite/G3D.lib/source/Image4.cpp deleted file mode 100644 index 84a1cd650b6..00000000000 --- a/externals/g3dlite/G3D.lib/source/Image4.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/** - @file Image4.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2008-07-27 -*/ - - -#include "G3D/Image4.h" -#include "G3D/Image4uint8.h" -#include "G3D/GImage.h" -#include "G3D/Color3.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image4::Image4(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color4::zero()); -} - - -Image4::Ref Image4::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels) { - case 1: - return fromArray(im.pixel1(), im.width, im.height, wrap); - - case 3: - return fromArray(im.pixel3(), im.width, im.height, wrap); - - case 4: - return fromArray(im.pixel4(), im.width, im.height, wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image4::Ref Image4::fromImage4uint8(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->resize(im->width(), im->height()); - - int N = im->width() * im->height(); - const Color4uint8* src = reinterpret_cast(im->getCArray()); - for (int i = 0; i < N; ++i) { - out->data[i] = Color4(src[i]); - } - - return out; -} - - -Image4::Ref Image4::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, WrapMode::ERROR); -} - - -Image4::Ref Image4::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image4::Ref Image4::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -void Image4::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -Image4::Ref Image4::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4::Ref Image4::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image4::copyGImage(const GImage& im) { - switch (im.channels) { - case 1: - copyArray(im.pixel1(), im.width, im.height); - break; - - case 3: - copyArray(im.pixel3(), im.width, im.height); - break; - - case 4: - copyArray(im.pixel4(), im.width, im.height); - break; - } -} - - -void Image4::copyArray(const Color4uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color4* dst = data.getCArray(); - // Convert int8 -> float - for (int i = 0; i < N; ++i) { - dst[i] = Color4(src[i]); - } -} - - -void Image4::copyArray(const Color3uint8* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color4* dst = data.getCArray(); - - // Add alpha and convert - for (int i = 0; i < N; ++i) { - dst[i] = Color4(Color3(src[i]), 1.0f); - } -} - - -void Image4::copyArray(const Color4* src, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), src, w * h * sizeof(Color4)); -} - - -void Image4::copyArray(const Color3* src, int w, int h) { - resize(w, h); - - int N = w * h; - Color4* dst = data.getCArray(); - - // Add alpha - for (int i = 0; i < N; ++i) { - dst[i] = Color4(src[i], 1.0f); - } -} - - -void Image4::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1(src[i]).value; - dst[i].a = 1.0f; - } -} - - -void Image4::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - dst[i].a = 1.0f; - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image4::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 4); - - int N = im.width * im.height; - Color4uint8* dst = im.pixel4(); - for (int i = 0; i < N; ++i) { - dst[i] = Color4uint8(data[i]); - } - - im.save(filename, fmt); -} - -const ImageFormat* Image4::format() const { - return ImageFormat::RGBA32F(); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/Image4uint8.cpp b/externals/g3dlite/G3D.lib/source/Image4uint8.cpp deleted file mode 100644 index dee1cba14ba..00000000000 --- a/externals/g3dlite/G3D.lib/source/Image4uint8.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/** - @file Image4uint8.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-01-31 - @edited 2008-07-31 -*/ - -#include "G3D/Image4uint8.h" -#include "G3D/Image4.h" -#include "G3D/Image3uint8.h" -#include "G3D/Image3.h" -#include "G3D/GImage.h" -#include "G3D/Color1.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color4.h" -#include "G3D/Color4uint8.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -Image4uint8::Image4uint8(int w, int h, WrapMode wrap) : Map2D(w, h, wrap) { - setAll(Color4::zero()); -} - - -Image4uint8::Ref Image4uint8::fromGImage(const GImage& im, WrapMode wrap) { - switch (im.channels) { - case 1: - return fromArray(im.pixel1(), im.width, im.height, wrap); - - case 3: - return fromArray(im.pixel3(), im.width, im.height, wrap); - - case 4: - return fromArray(im.pixel4(), im.width, im.height, wrap); - - default: - debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); - return NULL; - } -} - - -Image4uint8::Ref Image4uint8::fromImage4(const ReferenceCountedPointer& im) { - Ref out = createEmpty(static_cast(im->wrapMode())); - out->copyArray(im->getCArray(), im->width(), im->height()); - - return out; -} - - -Image4uint8::Ref Image4uint8::createEmpty(int width, int height, WrapMode wrap) { - return new Type(width, height, wrap); -} - - -Image4uint8::Ref Image4uint8::createEmpty(WrapMode wrap) { - return createEmpty(0, 0, wrap); -} - - -Image4uint8::Ref Image4uint8::fromFile(const std::string& filename, WrapMode wrap, GImage::Format fmt) { - Ref out = createEmpty(wrap); - out->load(filename); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color3uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color1* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color1uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color3* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color4uint8* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -Image4uint8::Ref Image4uint8::fromArray(const class Color4* ptr, int w, int h, WrapMode wrap) { - Ref out = createEmpty(wrap); - out->copyArray(ptr, w, h); - return out; -} - - -void Image4uint8::load(const std::string& filename, GImage::Format fmt) { - copyGImage(GImage(filename, fmt)); - setChanged(true); -} - - -void Image4uint8::copyGImage(const GImage& im) { - switch (im.channels) { - case 1: - copyArray(im.pixel1(), im.width, im.height); - break; - - case 3: - copyArray(im.pixel3(), im.width, im.height); - break; - - case 4: - copyArray(im.pixel4(), im.width, im.height); - break; - } -} - - -void Image4uint8::copyArray(const Color1uint8* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = src[i].value; - dst[i].a = 255; - } -} - -void Image4uint8::copyArray(const Color1* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i].r = dst[i].g = dst[i].b = Color1uint8(src[i]).value; - dst[i].a = 255; - } -} - - -void Image4uint8::copyArray(const Color4uint8* ptr, int w, int h) { - resize(w, h); - System::memcpy(getCArray(), ptr, w * h * 4); -} - - -void Image4uint8::copyArray(const Color4* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color4uint8(src[i]); - } -} - - -void Image4uint8::copyArray(const Color3uint8* ptr, int w, int h) { - resize(w, h); - - GImage::RGBtoRGBA((const uint8*)ptr, (uint8*)getCArray(), w * h); -} - - -void Image4uint8::copyArray(const Color3* src, int w, int h) { - resize(w, h); - int N = w * h; - - Color4uint8* dst = getCArray(); - for (int i = 0; i < N; ++i) { - dst[i] = Color4uint8(Color4(src[i], 1.0f)); - } -} - - -/** Saves in any of the formats supported by G3D::GImage. */ -void Image4uint8::save(const std::string& filename, GImage::Format fmt) { - GImage im(width(), height(), 4); - System::memcpy(im.byte(), getCArray(), width() * height() * 4); - im.save(filename, fmt); -} - - -ReferenceCountedPointer Image4uint8::getChannel(int c) const { - debugAssert(c >= 0 && c <= 3); - - Image1uint8Ref dst = Image1uint8::createEmpty(width(), height(), wrapMode()); - const Color4uint8* srcArray = getCArray(); - Color1uint8* dstArray = dst->getCArray(); - - const int N = width() * height(); - for (int i = 0; i < N; ++i) { - dstArray[i] = Color1uint8(srcArray[i][c]); - } - - return dst; -} - - -const ImageFormat* Image4uint8::format() const { - return ImageFormat::RGBA8(); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/ImageFormat.cpp b/externals/g3dlite/G3D.lib/source/ImageFormat.cpp deleted file mode 100644 index 3cbf6ad711e..00000000000 --- a/externals/g3dlite/G3D.lib/source/ImageFormat.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/** - @file ImageFormat.cpp - - @maintainer Morgan McGuire, morgan@graphics3d.com - - @created 2003-05-23 - @edited 2006-01-11 - */ - -#include "../../GLG3D.lib/include/GLG3D/glheaders.h" -#include "../../GLG3D.lib/include/GLG3D/glcalls.h" -#include "G3D/ImageFormat.h" - -namespace G3D { - -ImageFormat::ImageFormat( - int _numComponents, - bool _compressed, - int _glFormat, - int _glBaseFormat, - int _luminanceBits, - int _alphaBits, - int _redBits, - int _greenBits, - int _blueBits, - int _depthBits, - int _stencilBits, - int _hardwareBitsPerTexel, - int _packedBitsPerTexel, - int glDataFormat, - bool _opaque, - bool _floatingPoint, - Code _code, - ColorSpace _colorSpace, - BayerPattern _bayerPattern) : - - numComponents(_numComponents), - compressed(_compressed), - code(_code), - colorSpace(_colorSpace), - bayerPattern(_bayerPattern), - openGLFormat(_glFormat), - openGLBaseFormat(_glBaseFormat), - luminanceBits(_luminanceBits), - alphaBits(_alphaBits), - redBits(_redBits), - greenBits(_greenBits), - blueBits(_blueBits), - stencilBits(_stencilBits), - depthBits(_depthBits), - cpuBitsPerPixel(_packedBitsPerTexel), - packedBitsPerTexel(_packedBitsPerTexel), - openGLBitsPerPixel(_hardwareBitsPerTexel), - hardwareBitsPerTexel(_hardwareBitsPerTexel), - openGLDataFormat(glDataFormat), - opaque(_opaque), - floatingPoint(_floatingPoint) { - - debugAssert(_packedBitsPerTexel <= _hardwareBitsPerTexel); -} - -const ImageFormat* ImageFormat::depth(int depthBits) { - - switch (depthBits) { - case 16: - return DEPTH16(); - - case 24: - return DEPTH24(); - - case 32: - return DEPTH32(); - - default: - debugAssertM(false, "Depth must be 16, 24, or 32."); - return DEPTH32(); - } -} - - -const ImageFormat* ImageFormat::stencil(int bits) { - switch (bits) { - case 1: - return STENCIL1(); - - case 4: - return STENCIL4(); - - case 8: - return STENCIL8(); - - case 16: - return STENCIL16(); - - default: - debugAssertM(false, "Stencil must be 1, 4, 8 or 16."); - return STENCIL16(); - } -} - - -std::string ImageFormat::name() const { - - static const std::string nameArray[] = - { - "L8", - "L16", - "L16F", - "L32F", - - "A8", - "A16", - "A16F", - "A32F", - - "LA4", - "LA8", - "LA16", - "LA16F", - "LA32F", - - "RGB5", - "RGB5A1", - "RGB8", - "RGB10", - "RGB10A2", - "RGB16", - "RGB16F", - "RGB32F", - - "ARGB8", - "BGR8", - - "RGBA8", - "RGBA16", - "RGBA16F", - "RGBA32F", - - "BAYER_RGGB8", - "BAYER_GRBG8", - "BAYER_GBRG8", - "BAYER_BGGR8", - "BAYER_RGGB32F", - "BAYER_GRBG32F", - "BAYER_GBRG32F", - "BAYER_BGGR32F", - - "HSV8", - "HSV32F", - - "YUV420_PLANAR", - "YUV422", - "YUV444", - - "RGB_DXT1", - "RGBA_DXT1", - "RGBA_DXT3", - "RGBA_DXT5", - - "DEPTH16", - "DEPTH24", - "DEPTH32", - "DEPTH32F", - - "STENCIL1", - "STENCIL4", - "STENCIL8", - "STENCIL16", - - "DEPTH24_STENCIL8" - }; - - debugAssert(code < CODE_NUM); - return nameArray[code]; -} - - -const ImageFormat* ImageFormat::fromCode(ImageFormat::Code code) { - switch (code) { - case ImageFormat::CODE_L8: - return ImageFormat::L8(); - break; - case ImageFormat::CODE_L16: - return ImageFormat::L16(); - break; - case ImageFormat::CODE_L16F: - return ImageFormat::L16F(); - break; - case ImageFormat::CODE_L32F: - return ImageFormat::L32F(); - break; - - case ImageFormat::CODE_A8: - return ImageFormat::A8(); - break; - case ImageFormat::CODE_A16: - return ImageFormat::A16(); - break; - case ImageFormat::CODE_A16F: - return ImageFormat::A16F(); - break; - case ImageFormat::CODE_A32F: - return ImageFormat::A32F(); - break; - - case ImageFormat::CODE_LA4: - return ImageFormat::LA4(); - break; - case ImageFormat::CODE_LA8: - return ImageFormat::LA8(); - break; - case ImageFormat::CODE_LA16: - return ImageFormat::LA16(); - break; - case ImageFormat::CODE_LA16F: - return ImageFormat::LA16F(); - break; - case ImageFormat::CODE_LA32F: - return ImageFormat::LA32F(); - break; - - case ImageFormat::CODE_RGB5: - return ImageFormat::RGB5(); - break; - case ImageFormat::CODE_RGB5A1: - return ImageFormat::RGB5A1(); - break; - case ImageFormat::CODE_RGB8: - return ImageFormat::RGB8(); - break; - case ImageFormat::CODE_RGB10: - return ImageFormat::RGB10(); - break; - case ImageFormat::CODE_RGB10A2: - return ImageFormat::RGB10A2(); - break; - case ImageFormat::CODE_RGB16: - return ImageFormat::RGB16(); - break; - case ImageFormat::CODE_RGB16F: - return ImageFormat::RGB16F(); - break; - case ImageFormat::CODE_RGB32F: - return ImageFormat::RGB32F(); - break; - - case ImageFormat::CODE_ARGB8: - return NULL; - - case ImageFormat::CODE_BGR8: - return NULL; - - case ImageFormat::CODE_RGBA8: - return ImageFormat::RGBA8(); - break; - case ImageFormat::CODE_RGBA16: - return ImageFormat::RGBA16(); - break; - case ImageFormat::CODE_RGBA16F: - return ImageFormat::RGBA16F(); - break; - case ImageFormat::CODE_RGBA32F: - return ImageFormat::RGBA32F(); - break; - - case ImageFormat::CODE_BAYER_RGGB8: - case ImageFormat::CODE_BAYER_GRBG8: - case ImageFormat::CODE_BAYER_GBRG8: - case ImageFormat::CODE_BAYER_BGGR8: - case ImageFormat::CODE_BAYER_RGGB32F: - case ImageFormat::CODE_BAYER_GRBG32F: - case ImageFormat::CODE_BAYER_GBRG32F: - case ImageFormat::CODE_BAYER_BGGR32F: - - case ImageFormat::CODE_HSV8: - case ImageFormat::CODE_HSV32F: - - case ImageFormat::CODE_RGB_DXT1: - return ImageFormat::RGB_DXT1(); - break; - case ImageFormat::CODE_RGBA_DXT1: - return ImageFormat::RGBA_DXT1(); - break; - case ImageFormat::CODE_RGBA_DXT3: - return ImageFormat::RGBA_DXT3(); - break; - case ImageFormat::CODE_RGBA_DXT5: - return ImageFormat::RGBA_DXT5(); - break; - - case ImageFormat::CODE_DEPTH16: - return ImageFormat::DEPTH16(); - break; - case ImageFormat::CODE_DEPTH24: - return ImageFormat::DEPTH24(); - break; - case ImageFormat::CODE_DEPTH32: - return ImageFormat::DEPTH32(); - break; - case ImageFormat::CODE_DEPTH32F: - return ImageFormat::DEPTH32F(); - break; - - case ImageFormat::CODE_STENCIL1: - return ImageFormat::STENCIL1(); - break; - case ImageFormat::CODE_STENCIL4: - return ImageFormat::STENCIL4(); - break; - case ImageFormat::CODE_STENCIL8: - return ImageFormat::STENCIL8(); - break; - case ImageFormat::CODE_STENCIL16: - return ImageFormat::STENCIL16(); - break; - - case ImageFormat::CODE_DEPTH24_STENCIL8: - return ImageFormat::DEPTH24_STENCIL8(); - break; - - case ImageFormat::CODE_YUV420_PLANAR: - return ImageFormat::YUV420_PLANAR(); - break; - - case ImageFormat::CODE_YUV422: - return ImageFormat::YUV422(); - break; - - case ImageFormat::CODE_YUV444: - return ImageFormat::YUV444(); - break; - - default: - return NULL; - } -} - -// Helper variables for defining texture formats - -// Is floating point format -static const bool FLOAT_FORMAT = true; -static const bool INT_FORMAT = false; - -// Is opaque format (no alpha) -static const bool OPAQUE_FORMAT = true; -static const bool CLEAR_FORMAT = false; - -// Is compressed format (not raw component data) -static const bool COMP_FORMAT = true; -static const bool UNCOMP_FORMAT = false; - -#define DEFINE_TEXTUREFORMAT_METHOD(name, cmpnts, cmprssd, glf, glbf, lb, rb, gb, bb, db, sb, hbpt, pbpt, gldf, opq, fp, code, cs, bp) \ - const ImageFormat* ImageFormat::name() { \ - static const ImageFormat format(cmpnts, cmprssd, glf, glbf, lb, rb, gb, bb, db, sb, hbpt, pbpt, gldf, opq, fp, code, cs, bp); \ - return &format; } - -DEFINE_TEXTUREFORMAT_METHOD(L8, 1, UNCOMP_FORMAT, GL_LUMINANCE8, GL_LUMINANCE, 8, 0, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, CODE_L8, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(L16, 1, UNCOMP_FORMAT, GL_LUMINANCE16, GL_LUMINANCE, 16, 0, 0, 0, 0, 0, 0, 16, 16,GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INT_FORMAT, CODE_L16, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(L16F, 1, UNCOMP_FORMAT, GL_LUMINANCE16F_ARB,GL_LUMINANCE, 16, 0, 0, 0, 0, 0, 0, 16, 16, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, CODE_L16F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(L32F, 1, UNCOMP_FORMAT, GL_LUMINANCE32F_ARB,GL_LUMINANCE, 32, 0, 0, 0, 0, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, CODE_L32F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A8, 1, UNCOMP_FORMAT, GL_ALPHA8, GL_ALPHA, 0, 8, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, CODE_A8, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A16, 1, UNCOMP_FORMAT, GL_ALPHA16, GL_ALPHA, 0, 16, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, CODE_A16, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A16F, 1, UNCOMP_FORMAT, GL_ALPHA16F_ARB, GL_ALPHA, 0, 16, 0, 0, 0, 0, 0, 16, 16, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, CODE_A16F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(A32F, 1, UNCOMP_FORMAT, GL_ALPHA32F_ARB, GL_ALPHA, 0, 32, 0, 0, 0, 0, 0, 32, 32, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, CODE_A32F, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA4, 2, UNCOMP_FORMAT, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE_ALPHA, 4, 4, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, CODE_LA4, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA8, 2, UNCOMP_FORMAT, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, 8, 8, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, CODE_LA8, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA16, 2, UNCOMP_FORMAT, GL_LUMINANCE16_ALPHA16, GL_LUMINANCE_ALPHA, 16, 16, 0, 0, 0, 0, 0, 16*2, 16*2, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, CODE_LA16, COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA16F, 2, UNCOMP_FORMAT, GL_LUMINANCE_ALPHA16F_ARB, GL_LUMINANCE_ALPHA, 16, 16, 0, 0, 0, 0, 0, 16*2, 16*2, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_LA16F, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(LA32F, 2, UNCOMP_FORMAT, GL_LUMINANCE_ALPHA32F_ARB, GL_LUMINANCE_ALPHA, 32, 32, 0, 0, 0, 0, 0, 32*2, 32*2, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_LA32F, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(BGR8, 3, UNCOMP_FORMAT, GL_RGB8, GL_BGR, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_BGR8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB5, 3, UNCOMP_FORMAT, GL_RGB5, GL_RGBA, 0, 0, 5, 5, 5, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB5, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB5A1, 4, UNCOMP_FORMAT, GL_RGB5_A1, GL_RGBA, 0, 1, 5, 5, 5, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB5A1, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB8, 3, UNCOMP_FORMAT, GL_RGB8, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB10, 3, UNCOMP_FORMAT, GL_RGB10, GL_RGB, 0, 0, 10, 10, 10, 0, 0, 32, 10*3, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB10, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB10A2, 4, UNCOMP_FORMAT, GL_RGB10_A2, GL_RGBA, 0, 2, 10, 10, 10, 0, 0, 32, 32, GL_UNSIGNED_INT_10_10_10_2, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB10A2, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB16, 3, UNCOMP_FORMAT, GL_RGB16, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 16*3, 16*3, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB16, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB16F, 3, UNCOMP_FORMAT, GL_RGB16F_ARB, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 16*3, 16*3, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGB16F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB32F, 3, UNCOMP_FORMAT, GL_RGB32F_ARB, GL_RGB, 0, 0, 32, 32, 32, 0, 0, 32*3, 32*3, GL_FLOAT, OPAQUE_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGB32F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA8, 4, UNCOMP_FORMAT, GL_RGBA8, GL_RGBA, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA8, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA16, 4, UNCOMP_FORMAT, GL_RGBA16, GL_RGBA, 0, 16, 16, 16, 16, 0, 0, 16*4, 16*4, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA16, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA16F, 4, UNCOMP_FORMAT, GL_RGBA16F_ARB, GL_RGBA, 0, 16, 16, 16, 16, 0, 0, 16*4, 16*4, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGB16F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA32F, 4, UNCOMP_FORMAT, GL_RGBA32F_ARB, GL_RGBA, 0, 32, 32, 32, 32, 0, 0, 32*4, 32*4, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_RGBA32F, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGB_DXT1, 3, COMP_FORMAT, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_RGB_DXT1, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA_DXT1, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA_DXT1, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA_DXT3, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA_DXT3, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(RGBA_DXT5, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_RGBA_DXT5, ImageFormat::COLOR_SPACE_RGB); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH16, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT16_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 0, 16, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH16, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH24, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 0, 24, 32, 24, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH24, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH32, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 0, 32, 32, 32, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH32, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH32F, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 0, 32, 32, 32, GL_FLOAT, CLEAR_FORMAT, FLOAT_FORMAT, ImageFormat::CODE_DEPTH32F, ImageFormat::COLOR_SPACE_NONE); - -// These formats are for use with Renderbuffers only! -DEFINE_TEXTUREFORMAT_METHOD(STENCIL1, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX1_EXT, GL_STENCIL_INDEX_EXT, 0, 0, 0, 0, 0, 0, 1, 1, 1, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL1, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(STENCIL4, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX4_EXT, GL_STENCIL_INDEX_EXT, 0, 0, 0, 0, 0, 0, 4, 4, 4, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL4, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(STENCIL8, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX8_EXT, GL_STENCIL_INDEX_EXT, 0, 0, 0, 0, 0, 0, 8, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL8, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(STENCIL16, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX16_EXT, GL_STENCIL_INDEX_EXT, 0, 0, 0, 0, 0, 0, 16, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_STENCIL16, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(DEPTH24_STENCIL8, 2, UNCOMP_FORMAT, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL_EXT,0, 0, 0, 0, 0, 24, 8, 32, 32, GL_UNSIGNED_INT, CLEAR_FORMAT, INT_FORMAT, ImageFormat::CODE_DEPTH24_STENCIL8, ImageFormat::COLOR_SPACE_NONE); - -DEFINE_TEXTUREFORMAT_METHOD(YUV420_PLANAR, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 12, 12, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_YUV420_PLANAR, ImageFormat::COLOR_SPACE_YUV); -DEFINE_TEXTUREFORMAT_METHOD(YUV422, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_YUV422, ImageFormat::COLOR_SPACE_YUV); -DEFINE_TEXTUREFORMAT_METHOD(YUV444, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 24, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INT_FORMAT, ImageFormat::CODE_YUV444, ImageFormat::COLOR_SPACE_YUV); - -} diff --git a/externals/g3dlite/G3D.lib/source/ImageFormat_convert.cpp b/externals/g3dlite/G3D.lib/source/ImageFormat_convert.cpp deleted file mode 100644 index 9cbc4edcb39..00000000000 --- a/externals/g3dlite/G3D.lib/source/ImageFormat_convert.cpp +++ /dev/null @@ -1,1305 +0,0 @@ -#include "G3D/ImageFormat.h" -#include "G3D/Color1uint8.h" -#include "G3D/Color3uint8.h" -#include "G3D/Color4uint8.h" -#include "G3D/Color1.h" -#include "G3D/Color3.h" -#include "G3D/Color4.h" - - -namespace G3D { - -// this is the signature for all conversion routines (same parameters as ImageFormat::convert) -typedef void (*ConvertFunc)(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg); - -// this defines the conversion routines for converting between compatible formats -static const int NUM_CONVERT_IMAGE_FORMATS = 5; -struct ConvertAttributes { - ConvertFunc m_converter; - ImageFormat::Code m_sourceFormats[NUM_CONVERT_IMAGE_FORMATS]; - ImageFormat::Code m_destFormats[NUM_CONVERT_IMAGE_FORMATS]; - bool m_handlesSourcePadding; - bool m_handlesDestPadding; - bool m_handleInvertY; -}; - -// forward declare the converters we can use them below -#define DECLARE_CONVERT_FUNC(name) static void name(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg); - -DECLARE_CONVERT_FUNC(l8_to_rgb8); -DECLARE_CONVERT_FUNC(l32f_to_rgb8); -DECLARE_CONVERT_FUNC(rgb8_to_rgba8); -DECLARE_CONVERT_FUNC(rgb8_to_bgr8); -DECLARE_CONVERT_FUNC(rgb8_to_rgba32f); -DECLARE_CONVERT_FUNC(bgr8_to_rgb8); -DECLARE_CONVERT_FUNC(bgr8_to_rgba8); -DECLARE_CONVERT_FUNC(bgr8_to_rgba32f); -DECLARE_CONVERT_FUNC(rgba8_to_rgb8); -DECLARE_CONVERT_FUNC(rgba8_to_bgr8); -DECLARE_CONVERT_FUNC(rgba8_to_rgba32f); -DECLARE_CONVERT_FUNC(rgb32f_to_rgba32f); -DECLARE_CONVERT_FUNC(rgba32f_to_rgb8); -DECLARE_CONVERT_FUNC(rgba32f_to_rgba8); -DECLARE_CONVERT_FUNC(rgba32f_to_bgr8); -DECLARE_CONVERT_FUNC(rgba32f_to_rgb32f); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_rggb8); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_gbrg8); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_grbg8); -DECLARE_CONVERT_FUNC(rgba32f_to_bayer_bggr8); -DECLARE_CONVERT_FUNC(bayer_rggb8_to_rgba32f); -DECLARE_CONVERT_FUNC(bayer_gbrg8_to_rgba32f); -DECLARE_CONVERT_FUNC(bayer_grbg8_to_rgba32f); -DECLARE_CONVERT_FUNC(bayer_bggr8_to_rgba32f); -DECLARE_CONVERT_FUNC(rgb8_to_yuv420p); -DECLARE_CONVERT_FUNC(rgb8_to_yuv422); -DECLARE_CONVERT_FUNC(rgb8_to_yuv444); -DECLARE_CONVERT_FUNC(yuv420p_to_rgb8); -DECLARE_CONVERT_FUNC(yuv422_to_rgb8); -DECLARE_CONVERT_FUNC(yuv444_to_rgb8); - -// this is the list of mappings between formats and the routines to perform them -static const ConvertAttributes sConvertMappings[] = { - - // RGB -> RGB color space - // L8 -> - {l8_to_rgb8, {ImageFormat::CODE_L8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - - // L32F -> - {l32f_to_rgb8, {ImageFormat::CODE_L32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - - // RGB8 -> - {rgb8_to_rgba8, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, false, false, true}, - {rgb8_to_bgr8, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, false, false, true}, - {rgb8_to_rgba32f, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // BGR8 -> - {bgr8_to_rgb8, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - {bgr8_to_rgba8, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, false, false, true}, - {bgr8_to_rgba32f, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // RGBA8 -> - {rgba8_to_rgb8, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, true}, - {rgba8_to_bgr8, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, false, false, true}, - {rgba8_to_rgba32f, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // RGB32F -> - {rgb32f_to_rgba32f, {ImageFormat::CODE_RGB32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, true, false, true}, - - // RGBA32F -> - {rgba32f_to_rgb8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_rgba8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bgr8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BGR8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_rgb32f, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB32F, ImageFormat::CODE_NONE}, false, true, true}, - - // RGB -> BAYER color space - {rgba32f_to_bayer_rggb8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_RGGB8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bayer_gbrg8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_GBRG8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bayer_grbg8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_GRBG8, ImageFormat::CODE_NONE}, false, true, true}, - {rgba32f_to_bayer_bggr8, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, {ImageFormat::CODE_BAYER_BGGR8, ImageFormat::CODE_NONE}, false, true, true}, - - // BAYER -> RGB color space - {bayer_rggb8_to_rgba32f, {ImageFormat::CODE_BAYER_RGGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - {bayer_gbrg8_to_rgba32f, {ImageFormat::CODE_BAYER_GBRG8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - {bayer_grbg8_to_rgba32f, {ImageFormat::CODE_BAYER_GRBG8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - {bayer_bggr8_to_rgba32f, {ImageFormat::CODE_BAYER_BGGR8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGBA32F, ImageFormat::CODE_NONE}, false, false, true}, - - // RGB <-> YUV color space - {rgb8_to_yuv420p, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_YUV420_PLANAR, ImageFormat::CODE_NONE}, false, false, false}, - {rgb8_to_yuv422, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_YUV422, ImageFormat::CODE_NONE}, false, false, false}, - {rgb8_to_yuv444, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, {ImageFormat::CODE_YUV444, ImageFormat::CODE_NONE}, false, false, false}, - {yuv420p_to_rgb8, {ImageFormat::CODE_YUV420_PLANAR, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, false}, - {yuv422_to_rgb8, {ImageFormat::CODE_YUV422, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, false}, - {yuv444_to_rgb8, {ImageFormat::CODE_YUV444, ImageFormat::CODE_NONE}, {ImageFormat::CODE_RGB8, ImageFormat::CODE_NONE}, false, false, false}, -}; - -static ConvertFunc findConverter(TextureFormat::Code sourceCode, TextureFormat::Code destCode, bool needsSourcePadding, bool needsDestPadding, bool needsInvertY) { - int numRoutines = sizeof(sConvertMappings) / sizeof(ConvertAttributes); - for (int routineIndex = 0; routineIndex < numRoutines; ++routineIndex) { - int sourceIndex = 0; - ConvertAttributes routine = sConvertMappings[routineIndex]; - - while (routine.m_sourceFormats[sourceIndex] != ImageFormat::CODE_NONE) { - // check for matching source - if (routine.m_sourceFormats[sourceIndex] == sourceCode) { - int destIndex = 0; - - // now check for matching dest to see if the routine fits - while (routine.m_destFormats[destIndex] != ImageFormat::CODE_NONE) { - - // check if dest format matches and padding + invert rules match - if ((routine.m_destFormats[destIndex] == destCode) && - (!needsSourcePadding || (routine.m_handlesSourcePadding == needsSourcePadding)) && - (!needsDestPadding || (routine.m_handlesDestPadding == needsDestPadding)) && - (!needsInvertY || (routine.m_handleInvertY == needsInvertY))) { - - // found compatible converter - return routine.m_converter; - } - ++destIndex; - } - } - ++sourceIndex; - } - } - - return NULL; -} - -bool conversionAvailable(const ImageFormat* srcFormat, int srcRowPadBits, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY = false) { - bool conversionAvailable = false; - - // check if a conversion is available - if ( (srcFormat->code == dstFormat->code) && (srcRowPadBits == dstRowPadBits) && !invertY) { - conversionAvailable = true; - } else { - ConvertFunc directConverter = findConverter(srcFormat->code, dstFormat->code, srcRowPadBits > 0, dstRowPadBits > 0, invertY); - - conversionAvailable = (directConverter != NULL); - } - - return conversionAvailable; -} - -bool ImageFormat::convert(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, - const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, - bool invertY, BayerAlgorithm bayerAlg) { - - bool conversionAvailable = false; - - // Handle direct copy of image to same format - if ( (srcFormat->code == dstFormat->code) && (srcRowPadBits == dstRowPadBits) && !invertY) { - - System::memcpy(dstBytes[0], srcBytes[0], iCeil(((srcWidth * srcFormat->cpuBitsPerPixel + srcRowPadBits) * srcHeight) / 8.0f)); - conversionAvailable = true; - } else { - // if no direct conversion routine exists, - // then look for conversion to intermediate - // and then from intermediate to dest. - // intermediate format is RGBA32F - ConvertFunc directConverter = findConverter(srcFormat->code, dstFormat->code, srcRowPadBits > 0, dstRowPadBits > 0, invertY); - - // if we have a direct converter, use it, otherwise find intermdiate path - if (directConverter) { - directConverter(srcBytes, srcWidth, srcHeight, srcFormat, srcRowPadBits, dstBytes, dstFormat, dstRowPadBits, invertY, bayerAlg); - conversionAvailable = true; - } else { - ConvertFunc toInterConverter = findConverter(srcFormat->code, ImageFormat::CODE_RGBA32F, srcRowPadBits > 0, false, false);; - ConvertFunc fromInterConverter = findConverter(ImageFormat::CODE_RGBA32F, dstFormat->code, false, dstRowPadBits > 0, invertY);; - - if (toInterConverter && fromInterConverter) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * ImageFormat::RGBA32F()->cpuBitsPerPixel * 8)); - - toInterConverter(srcBytes, srcWidth, srcHeight, srcFormat, srcRowPadBits, tmp, ImageFormat::RGBA32F(), 0, false, bayerAlg); - fromInterConverter(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, dstBytes, dstFormat, dstRowPadBits, invertY, bayerAlg); - - System::free(tmp[0]); - - conversionAvailable = true; - } - } - } - - return conversionAvailable; -} - - -// ******************* -// RGB -> RGB color space conversions -// ******************* - -// L8 -> -static void l8_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - - dst[i3 + 0] = src[i]; - dst[i3 + 1] = src[i]; - dst[i3 + 2] = src[i]; - } - } -} - -// L32F -> -static void l32f_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - int srcIndex = 0; - int dstByteOffset = 0; - uint8* dst = static_cast(dstBytes[0]); - const float* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - y - 1); - } - - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) { - Color3uint8& d = *reinterpret_cast(dst + dstByteOffset); - float s = src[srcIndex]; - - uint8 c = iMin(255, iFloor(s * 256)); - d = Color3uint8(c, c, c); - } - } -} - -// RGB8 -> -static void rgb8_to_rgba8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i4 + 0] = src[i3 + 0]; - dst[i4 + 1] = src[i3 + 1]; - dst[i4 + 2] = src[i3 + 2]; - dst[i4 + 3] = 255; - } - } -} - -static void rgb8_to_bgr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - dst[i3 + 0] = src[i3 + 2]; - dst[i3 + 1] = src[i3 + 1]; - dst[i3 + 2] = src[i3 + 0]; - } - } -} - -static void rgb8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3) { - const Color3uint8& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(Color3(s), 1.0f); - } - srcByteOffset += srcRowPadBytes; - } -} - -// BGR8 -> -static void bgr8_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - dst[i3 + 0] = src[i3 + 2]; - dst[i3 + 1] = src[i3 + 1]; - dst[i3 + 2] = src[i3 + 0]; - } - } -} - -static void bgr8_to_rgba8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i4 + 0] = src[i3 + 2]; - dst[i4 + 1] = src[i3 + 1]; - dst[i4 + 2] = src[i3 + 0]; - dst[i4 + 3] = 255; - } - } -} - -static void bgr8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3) { - const Color3uint8& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(Color3(s).bgr(), 1.0f); - } - srcByteOffset += srcRowPadBytes; - } -} - -// RGBA8 -> -static void rgba8_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i3 + 0] = src[i4 + 0]; - dst[i3 + 1] = src[i4 + 1]; - dst[i3 + 2] = src[i4 + 2]; - } - } -} - -static void rgba8_to_bgr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - uint8* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x); - int i3 = i * 3; - int i4 = i3 + i; - - dst[i3 + 0] = src[i4 + 2]; - dst[i3 + 1] = src[i4 + 1]; - dst[i3 + 2] = src[i4 + 0]; - } - } -} - -static void rgba8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 4) { - const Color4uint8& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(s); - } - srcByteOffset += srcRowPadBytes; - } -} - -// RGB32F -> -static void rgb32f_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format"); - - int dstIndex = 0; - int srcByteOffset = 0; - int srcRowPadBytes = srcRowPadBits / 8; - Color4* dst = static_cast(dstBytes[0]); - const uint8* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - dstIndex = srcWidth * (srcHeight - 1 - y); - } - - for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3 * sizeof(float)) { - const Color3& s = *reinterpret_cast(src + srcByteOffset); - dst[dstIndex] = Color4(Color3(s), 1.0f); - } - srcByteOffset += srcRowPadBytes; - } -} - -// RGBA32F -> -static void rgba32f_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - y - 1); - } - - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) { - Color3uint8& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - - d = Color3uint8(s.rgb()); - } - dstByteOffset += dstRowPadBytes; - } -} - -static void rgba32f_to_rgba8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - 1 - y); - } - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 4) { - Color4uint8& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - - d = Color4uint8(s); - } - dstByteOffset += dstRowPadBytes; - } -} - -static void rgba32f_to_bgr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - y - 1); - } - - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) { - Color3uint8& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - - d = Color3uint8(s.rgb()).bgr(); - } - dstByteOffset += dstRowPadBytes; - } -} - -static void rgba32f_to_rgb32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format"); - - int srcIndex = 0; - int dstByteOffset = 0; - int dstRowPadBytes = dstRowPadBits / 8; - uint8* dst = static_cast(dstBytes[0]); - const Color4* src = static_cast(srcBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - if (invertY) { - srcIndex = srcWidth * (srcHeight - 1 - y); - } - for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3 * sizeof(float)) { - Color3& d = *reinterpret_cast(dst + dstByteOffset); - const Color4& s = src[srcIndex]; - d = Color3(s); - } - dstByteOffset += dstRowPadBytes; - } -} - -// ******************* -// RGB <-> YUV color space conversions -// ******************* - -static uint32 blendPixels(uint32 pixel1, uint32 pixel2) { - static const uint32 rbMask = 0x00FF00FF; - static const uint32 agMask = 0xFF00FF00; - - // Compute two color channels at a time. Use >> 1 for fast division by two - // Using alternating color channels prevents overflow - const uint32 rb = ((pixel1 & rbMask) + (pixel2 & rbMask)) >> 1; - - // Shift first to avoid overflow in alpha channel - const uint32 ag = (((pixel1 & agMask) >> 1) + ((pixel2 & agMask) >> 1)); - - return ((rb & rbMask) | (ag & agMask)); -} - -#define PIXEL_RGB8_TO_YUV_Y(r, g, b) static_cast(iClamp(((66 * r + 129 * g + 25 * b + 128) >> 8) + 16, 0, 255)) -#define PIXEL_RGB8_TO_YUV_U(r, g, b) static_cast(iClamp(((-38 * r - 74 * g + 112 * b + 128) >> 8) + 128, 0, 255)) -#define PIXEL_RGB8_TO_YUV_V(r, g, b) static_cast(iClamp(((112 * r - 94 * g - 18 * b + 128) >> 8) + 128, 0, 255)) - -static void rgb8_to_yuv420p(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0) && (srcHeight % 2 == 0), "Source width and height must be a multiple of two"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - uint8* dstY = static_cast(dstBytes[0]); - uint8* dstU = static_cast(dstBytes[1]); - uint8* dstV = static_cast(dstBytes[2]); - - for (int y = 0; y < srcHeight; y += 2) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert 4-pixel block at a time - int srcPixelOffset0 = y * srcWidth + x; - int srcPixelOffset1 = srcPixelOffset0 + 1; - int srcPixelOffset2 = srcPixelOffset0 + srcWidth; - int srcPixelOffset3 = srcPixelOffset2 + 1; - - int yIndex = y * srcWidth + x; - - dstY[yIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset0].r, src[srcPixelOffset0].g, src[srcPixelOffset0].b); - dstY[yIndex + 1] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset1].r, src[srcPixelOffset1].g, src[srcPixelOffset1].b); - - yIndex += srcWidth; - dstY[yIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset2].r, src[srcPixelOffset2].g, src[srcPixelOffset2].b); - dstY[yIndex + 1] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset3].r, src[srcPixelOffset3].g, src[srcPixelOffset3].b); - - uint32 blendedPixel = blendPixels(src[srcPixelOffset0].asUInt32(), src[srcPixelOffset2].asUInt32()); - Color3uint8 uvSrcColor = Color3uint8::fromARGB(blendedPixel); - - int uvIndex = y / 2 * srcWidth / 2 + x / 2; - dstU[uvIndex] = PIXEL_RGB8_TO_YUV_U(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - dstV[uvIndex] = PIXEL_RGB8_TO_YUV_V(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - } - } -} - -static void rgb8_to_yuv422(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0), "Source width must be a multiple of two"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert 2-pixel horizontal block at a time - int srcIndex = y * srcWidth + x; - int dstIndex = srcIndex * 2; - - uint32 blendedPixel = blendPixels(src[srcIndex].asUInt32(), src[srcIndex + 1].asUInt32()); - Color3uint8 uvSrcColor = Color3uint8::fromARGB(blendedPixel); - - dst[dstIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcIndex].r, src[srcIndex].g, src[srcIndex].b); - - dst[dstIndex + 1] = PIXEL_RGB8_TO_YUV_U(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - - dst[dstIndex + 2] = PIXEL_RGB8_TO_YUV_Y(src[srcIndex + 1].r, src[srcIndex + 1].g, src[srcIndex + 1].b); - - dst[dstIndex + 3] = PIXEL_RGB8_TO_YUV_V(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b); - - } - } -} - -static void rgb8_to_yuv444(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - - // convert 1-pixels at a time - int index = y * srcWidth + x; - uint8 y = PIXEL_RGB8_TO_YUV_Y(src[index].r, src[index].g, src[index].b); - uint8 u = PIXEL_RGB8_TO_YUV_U(src[index].r, src[index].g, src[index].b); - uint8 v = PIXEL_RGB8_TO_YUV_V(src[index].r, src[index].g, src[index].b); - - dst[index].r = y; - dst[index].g = u; - dst[index].b = v; - } - } -} - - -#define PIXEL_YUV_TO_RGB8_R(y, u, v) static_cast(iClamp((298 * (y - 16) + 409 * (v - 128) + 128) >> 8, 0, 255)) -#define PIXEL_YUV_TO_RGB8_G(y, u, v) static_cast(iClamp((298 * (y - 16) - 100 * (u - 128) - 208 * (v - 128) + 128) >> 8, 0, 255)) -#define PIXEL_YUV_TO_RGB8_B(y, u, v) static_cast(iClamp((298 * (y - 16) + 516 * (u - 128) + 128) >> 8, 0, 255)) - -static void yuv420p_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0) && (srcHeight % 2 == 0), "Source width and height must be a multiple of two"); - - const uint8* srcY = static_cast(srcBytes[0]); - const uint8* srcU = static_cast(srcBytes[1]); - const uint8* srcV = static_cast(srcBytes[2]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert to two rgb pixels in a row - Color3uint8* rgb = &dst[y * srcWidth + x]; - - int yOffset = y * srcWidth + x; - int uvOffset = y / 2 * srcWidth / 2 + x / 2; - - rgb->r = PIXEL_YUV_TO_RGB8_R(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]); - rgb->g = PIXEL_YUV_TO_RGB8_G(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]); - rgb->b = PIXEL_YUV_TO_RGB8_B(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]); - - rgb += 1; - rgb->r = PIXEL_YUV_TO_RGB8_R(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]); - rgb->g = PIXEL_YUV_TO_RGB8_G(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]); - rgb->b = PIXEL_YUV_TO_RGB8_B(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]); - } - } -} - -static void yuv422_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - debugAssertM((srcWidth % 2 == 0), "Source width must be a multiple of two"); - - const uint8* src = static_cast(srcBytes[0]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; x += 2) { - - // convert to two rgb pixels in a row - Color3uint8* rgb = &dst[y * srcWidth + x]; - - int srcIndex = (y * srcWidth + x) * 2; - uint8 y = src[srcIndex]; - uint8 u = src[srcIndex + 1]; - uint8 y2 = src[srcIndex + 2]; - uint8 v = src[srcIndex + 3]; - - rgb->r = PIXEL_YUV_TO_RGB8_R(y, u, v); - rgb->g = PIXEL_YUV_TO_RGB8_G(y, u, v); - rgb->b = PIXEL_YUV_TO_RGB8_B(y, u, v); - - rgb += 1; - rgb->r = PIXEL_YUV_TO_RGB8_R(y2, u, v); - rgb->g = PIXEL_YUV_TO_RGB8_G(y2, u, v); - rgb->b = PIXEL_YUV_TO_RGB8_B(y2, u, v); - } - } -} - -static void yuv444_to_rgb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format"); - - const Color3uint8* src = static_cast(srcBytes[0]); - - Color3uint8* dst = static_cast(dstBytes[0]); - - for (int y = 0; y < srcHeight; ++y) { - for (int x = 0; x < srcWidth; ++x) { - - // convert to one rgb pixels at a time - int index = y * srcWidth + x; - Color3uint8* rgb = &dst[index]; - - rgb->r = PIXEL_YUV_TO_RGB8_R(src[index].r, src[index].g, src[index].b); - rgb->g = PIXEL_YUV_TO_RGB8_G(src[index].r, src[index].g, src[index].b); - rgb->b = PIXEL_YUV_TO_RGB8_B(src[index].r, src[index].g, src[index].b); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -// Bayer conversions -// - -// There are two kinds of rows (GR and BG). -// In each row, there are two kinds of pixels (G/R, B/G). -// We express the four kinds of INPUT pixels as: -// GRG, GRG, BGB, BGG -// -// There are three kinds of OUTPUT pixels: R, G, B. -// Thus there are nominally 12 different I/O combinations, -// but several are impulses because needed output at that -// location *is* the input (e.g., G_GRG and G_BGG). -// -// The following 5x5 row-major filters are named as output_input. - -// Green -static const float G_GRR[5][5] = - {{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float G_BGB[5][5] = - {{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { -1.0f, 2.0f, 4.0f, 2.0f, -1.0f}, - { 0.0f, 0.0f, 2.0f, 0.0f, 0.0f}, - { 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -// Red -//(the caption in the paper is wrong for this case: -// "R row B column really means R row G column" -static const float R_GRG[5][5] = - {{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}, - { 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, - { -1.0f, 4.0f, 5.0f, 4.0f, -1.0f}, - { 0.0f, -1.0f, 0.0f, -1.0f, 0.0f}, - { 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}}; - -static const float R_BGG[5][5] = - {{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}, - { 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, - { 0.5f, 0.0f, 5.0f, 0.0f, 0.5f}, - { 0.0f, -1.0f, 4.0f, -1.0f, 0.0f}, - { 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}; - -static const float R_BGB[5][5] = - {{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}, - { 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, - {-3.0f/2.0f, 0.0f, 6.0f, 0.0f, -3.0f/2.0f}, - { 0.0f, 2.0f, 0.0f, 2.0f, 0.0f}, - { 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}}; - - -// Blue -//(the caption in the paper is wrong for this case: -// "B row R column really means B row G column") -#define B_BGG R_GRG -#define B_GRG R_BGG -#define B_GRR R_BGB - -// ===================================================================== -// Helper methods -// ===================================================================== - - -/** Applies a 5x5 filter to monochrome image I (wrapping at the boundaries) */ -static uint8 applyFilter(const uint8* I, - int x, - int y, - int w, - int h, - const float filter[5][5]) { - - debugAssert(isEven(w)); - debugAssert(isEven(h)); - - float sum = 0.0f; - float denom = 0.0f; - - for (int dy = 0; dy < 5; ++dy) { - int offset = ((y + dy + h - 2) % h) * w; - - for (int dx = 0; dx < 5; ++dx) { - float f = filter[dy][dx]; - sum += f * I[((x + dx + w - 2) % w) + offset]; - denom += f; - } - } - - return (uint8)iClamp(iRound(sum / denom), 0, 255); -} - -/** Helper method for Bayer grbg and bggr --> rgb8 */ -static void swapRedAndBlue(int N, Color3uint8* out) { - for (int i = N - 1; i >= 0; --i) { - uint8 tmp = out[i].r; - out[i].r = out[i].b; - out[i].b = tmp; - } -} - -// RGB -> BAYER color space - -// ===================================================================== -// rgb8 --> bayer helpers -// ===================================================================== -static void rgb8_to_bayer_rggb8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for (int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - - // Top right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } - - // Bottom row pixels - for (int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Bottom right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - } -} - - -static void rgb8_to_bayer_grbg8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for (int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Top right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - } - - // Bottom row pixels - for (int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - - // Bottom right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } -} - - -static void rgb8_to_bayer_bggr8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for (int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for (int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - - // Top right pixels - for (int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } - - // Bottom row pixels - for (int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Bottom right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - } -} - - -static void rgb8_to_bayer_gbrg8(const int w, const int h, - const uint8* src, uint8* dst) { - Color3uint8* srcColor = (Color3uint8*)src; - Color1uint8* dstColor = (Color1uint8*)dst; - - // Top row pixels - for(int y = 0; y < h - 1; y += 2) { - int offset = y * w; - - // Top left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - - // Top right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].b); - } - } - - // Bottom row pixels - for(int y = 1; y < h - 1; y += 2) { - int offset = y * w; - - // Bottom left pixels - for(int x = 0; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].r); - } - - // Bottom right pixels - for(int x = 1; x < w - 1; x += 2) { - dstColor[x + offset] = Color1(srcColor[x + offset].g); - } - } -} - -// ===================================================================== -// rgba32f (-->rgb8) --> bayer converter implementations -// ===================================================================== -static void rgba32f_to_bayer_rggb8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_rggb8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -static void rgba32f_to_bayer_gbrg8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_grbg8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -static void rgba32f_to_bayer_grbg8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_gbrg8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -static void rgba32f_to_bayer_bggr8(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg); - rgb8_to_bayer_bggr8(srcWidth, srcHeight, static_cast(tmp[0]), static_cast(dstBytes[0])); - - System::free(tmp[0]); -} - -// BAYER -> RGB color space - -// ===================================================================== -// bayer --> rgb8 helpers -// ===================================================================== -static void bayer_rggb8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // RG row - for (int x = 0; x < w; ++x, ++out) { - // R pixel - { - out->r = in[x + offset]; - out->g = applyFilter(in, x, y, w, h, G_GRR); - out->b = applyFilter(in, x, y, w, h, B_GRR); - } - ++x; ++out; - - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_GRG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_GRG); - } - } - - ++y; - offset += w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - } -} - - - -static void bayer_gbrg8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - - debugAssert(in != _out); - - Color3uint8* out = (Color3uint8*)_out; - - for (int y = 0; y < h; ++y) { - - // Row beginning in the input array. - int offset = y * w; - - // GB row - for (int x = 0; x < w; ++x, ++out) { - // G pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGG); - out->g = in[x + offset]; - out->b = applyFilter(in, x, y, w, h, B_BGG); - } - ++x; ++out; - - // B pixel - { - out->r = applyFilter(in, x, y, w, h, R_BGB); - out->g = applyFilter(in, x, y, w, h, G_BGB); - out->b = in[x + offset]; - } - } - } -} - - -static void bayer_grbg8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - // Run the equivalent function for red - bayer_gbrg8_to_rgb8_mhc(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - - -static void bayer_bggr8_to_rgb8_mhc(int w, int h, - const uint8* in, uint8* _out) { - // Run the equivalent function for red - bayer_rggb8_to_rgb8_mhc(w, h, in, _out); - - // Now swap red and blue - swapRedAndBlue(w * h, (Color3uint8*)_out); -} - -// ===================================================================== -// bayer (--> rgb8) --> rgba32f converter implementations -// ===================================================================== -static void bayer_rggb8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_rggb8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - -static void bayer_gbrg8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_grbg8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - -static void bayer_grbg8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_gbrg8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - -static void bayer_bggr8_to_rgba32f(const Array& srcBytes, int srcWidth, int srcHeight, const ImageFormat* srcFormat, int srcRowPadBits, const Array& dstBytes, const ImageFormat* dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg) { - Array tmp; - tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3uint8))); - - bayer_bggr8_to_rgb8_mhc(srcWidth, srcHeight, static_cast(srcBytes[0]), static_cast(tmp[0])); - rgb8_to_rgba32f(reinterpret_cast&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg); - - System::free(tmp[0]); -} - - - - - - // TODO: The following region is commented out because so far - // those conversions are not used anywhere else. Until it is - // decided that such conversions are not needed, this region - // remains commented out. - - -// // ===================================================================== -// // bayer --> bgr8 -// // ===================================================================== - -// static void bayer_rggb8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { -// debugAssert(in != _out); - -// Color3uint8* out = (Color3uint8*)_out; - -// for (int y = 0; y < h; ++y) { - -// // Row beginning in the input array. -// int offset = y * w; - -// // RG row -// for (int x = 0; x < w; ++x, ++out) { -// // R pixel -// { -// out->b = in[x + offset]; -// out->g = applyFilter(in, x, y, w, h, G_GRR); -// out->r = applyFilter(in, x, y, w, h, B_GRR); -// } -// ++x; ++out; - -// // G pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_GRG); -// out->g = in[x + offset]; -// out->r = applyFilter(in, x, y, w, h, B_GRG); -// } -// } - -// ++y; -// offset += w; - -// // GB row -// for (int x = 0; x < w; ++x, ++out) { -// // G pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGG); -// out->g = in[x + offset]; -// out->r = applyFilter(in, x, y, w, h, B_BGG); -// } -// ++x; ++out; - -// // B pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGB); -// out->g = applyFilter(in, x, y, w, h, G_BGB); -// out->r = in[x + offset]; -// } -// } -// } -// } - - -// static void bayer_gbrg8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { - -// debugAssert(in != _out); - -// Color3uint8* out = (Color3uint8*)_out; - -// for (int y = 0; y < h; ++y) { - -// // Row beginning in the input array. -// int offset = y * w; - -// // GB row -// for (int x = 0; x < srcWidth; ++x, ++out) { -// // G pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGG); -// out->g = in[x + offset]; -// out->r = applyFilter(in, x, y, w, h, B_BGG); -// } -// ++x; ++out; - -// // B pixel -// { -// out->b = applyFilter(in, x, y, w, h, R_BGB); -// out->g = applyFilter(in, x, y, w, h, G_BGB); -// out->r = in[x + offset]; -// } -// } -// } -// } - -// static void bayer_grbg8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { -// // Run the equivalent function for red -// bayer_gbrg8_to_bgr8_mhc(w, h, in, _out); - -// // Now swap red and blue -// swapRedAndBlue(srcWidth * h, (Color3uint8*)_out); -// } - -// static void bayer_bggr8_to_bgr8_mhc(int w, int h, -// const uint8* in, uint8* _out) { -// // Run the equivalent function for red -// bayer_rggb8_to_bgr8_mhc(w, h, in, _out); - -// // Now swap red and blue -// swapRedAndBlue(srcWidth * h, (Color3uint8*)_out); -// } - - - -/////////////////////////////////////////////////// - -} // namespace G3D diff --git a/externals/g3dlite/G3D.lib/source/Line.cpp b/externals/g3dlite/G3D.lib/source/Line.cpp deleted file mode 100644 index 195ae7197f2..00000000000 --- a/externals/g3dlite/G3D.lib/source/Line.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/** - @file Line.cpp - - Line class - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-06-02 - @edited 2006-01-28 - */ - -#include "G3D/Line.h" -#include "G3D/Plane.h" - -namespace G3D { - -Vector3 Line::intersection(const Plane& plane) const { - float d; - Vector3 normal = plane.normal(); - plane.getEquation(normal, d); - float rate = _direction.dot(normal); - - if (rate == 0) { - - return Vector3::inf(); - - } else { - float t = -(d + _point.dot(normal)) / rate; - - return _point + _direction * t; - } -} - - -Line::Line(class BinaryInput& b) { - deserialize(b); -} - - -void Line::serialize(class BinaryOutput& b) const { - _point.serialize(b); - _direction.serialize(b); -} - - -void Line::deserialize(class BinaryInput& b) { - _point.deserialize(b); - _direction.deserialize(b); -} - - -Vector3 Line::closestPoint(const Vector3& pt) const { - float t = _direction.dot(pt - _point); - return _point + _direction * t; -} - - -Vector3 Line::point() const { - return _point; -} - - -Vector3 Line::direction() const { - return _direction; -} - - -Vector3 Line::closestPoint(const Line& B, float& minDist) const { - const Vector3& P1 = _point; - const Vector3& U1 = _direction; - - Vector3 P2 = B.point(); - Vector3 U2 = B.direction(); - - const Vector3& P21 = P2 - P1; - const Vector3& M = U2.cross(U1); - float m2 = M.length(); - - Vector3 R = P21.cross(M) / m2; - - float t1 = R.dot(U2); - - minDist = abs(P21.dot(M)) / sqrt(m2); - - return P1 + t1 * U1; -} - -} - diff --git a/externals/g3dlite/G3D.lib/source/LineSegment.cpp b/externals/g3dlite/G3D.lib/source/LineSegment.cpp deleted file mode 100644 index 44dfcb48bc1..00000000000 --- a/externals/g3dlite/G3D.lib/source/LineSegment.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/** - @file LineSegment.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-08 - @edited 2008-02-02 - */ - -#include "G3D/platform.h" -#include "G3D/LineSegment.h" -#include "G3D/Sphere.h" -#include "G3D/debug.h" - -namespace G3D { - - -Vector3 LineSegment::closestPoint(const Vector3& p) const { - - // The vector from the end of the capsule to the point in question. - Vector3 v(p - _point); - - // Projection of v onto the line segment scaled by - // the length of direction. - float t = direction.dot(v); - - // Avoid some square roots. Derivation: - // t/direction.length() <= direction.length() - // t <= direction.squaredLength() - - if ((t >= 0) && (t <= direction.squaredMagnitude())) { - - // The point falls within the segment. Normalize direction, - // divide t by the length of direction. - return _point + direction * t / direction.squaredMagnitude(); - - } else { - - // The point does not fall within the segment; see which end is closer. - - // Distance from 0, squared - float d0Squared = v.squaredMagnitude(); - - // Distance from 1, squared - float d1Squared = (v - direction).squaredMagnitude(); - - if (d0Squared < d1Squared) { - - // Point 0 is closer - return _point; - - } else { - - // Point 1 is closer - return _point + direction; - - } - } - -} - -Vector3 LineSegment::point(int i) const { - switch (i) { - case 0: - return _point; - - case 1: - return _point + direction; - - default: - debugAssertM(i == 0 || i == 1, "Argument to point must be 0 or 1"); - return _point; - } -} - - -bool LineSegment::intersectsSolidSphere(const class Sphere& s) const { - return distanceSquared(s.center) <= square(s.radius); -} - - -LineSegment::LineSegment(class BinaryInput& b) { - deserialize(b); -} - - -void LineSegment::serialize(class BinaryOutput& b) const { - _point.serialize(b); - direction.serialize(b); -} - - -void LineSegment::deserialize(class BinaryInput& b) { - _point.deserialize(b); - direction.deserialize(b); -} - - -Vector3 LineSegment::randomPoint() const { - return _point + uniformRandom(0, 1) * direction; -} - - -///////////////////////////////////////////////////////////////////////////////////// - -LineSegment2D LineSegment2D::fromTwoPoints(const Vector2& p0, const Vector2& p1) { - LineSegment2D s; - s.m_origin = p0; - s.m_direction = p1 - p0; - s.m_length = s.m_direction.length(); - return s; -} - - -Vector2 LineSegment2D::point(int i) const { - debugAssert(i == 0 || i == 1); - if (i == 0) { - return m_origin; - } else { - return m_direction + m_origin; - } -} - - -Vector2 LineSegment2D::closestPoint(const Vector2& Q) const { - // Two constants that appear in the result - const Vector2 k1(m_origin - Q); - const Vector2& k2 = m_direction; - - if (fuzzyEq(m_length, 0)) { - // This line segment has no length - return m_origin; - } - - // Time [0, 1] at which we hit the closest point travelling from p0 to p1. - // Derivation can be obtained by minimizing the expression - // ||P0 + (P1 - P0)t - Q||. - const float t = -k1.dot(k2) / (m_length * m_length); - - if (t < 0) { - // Clipped to low end point - return m_origin; - } else if (t > 1) { - // Clipped to high end point - return m_origin + m_direction; - } else { - // Subsitute into the line equation to find - // the point on the segment. - return m_origin + k2 * t; - } -} - - -float LineSegment2D::distance(const Vector2& p) const { - Vector2 closest = closestPoint(p); - return (closest - p).length(); -} - - -float LineSegment2D::length() const { - return m_length; -} - - -Vector2 LineSegment2D::intersection(const LineSegment2D& other) const { - - if ((m_origin == other.m_origin) || - (m_origin == other.m_origin + other.m_direction)) { - return m_origin; - } - - if (m_origin + m_direction == other.m_origin) { - return other.m_origin; - } - - // Note: Now that we've checked the endpoints, all other parallel lines can now be assumed - // to not intersect (within numerical precision) - - Vector2 dir1 = m_direction; - Vector2 dir2 = other.m_direction; - Vector2 origin1 = m_origin; - Vector2 origin2 = other.m_origin; - - if (dir1.x == 0) { - // Avoid an upcoming divide by zero - dir1 = dir1.yx(); - dir2 = dir2.yx(); - origin1 = origin1.yx(); - origin2 = origin2.yx(); - } - - // t1 = ((other.m_origin.x - m_origin.x) + other.m_direction.x * t2) / m_direction.x - // - // ((other.m_origin.x - m_origin.x) + other.m_direction.x * t2) * m_direction.y / m_direction.x = - // (other.m_origin.y - m_origin.y) + other.m_direction.y * t2 - // - // m = m_direction.y / m_direction.x - // d = other.m_origin - m_origin - // - // (d.x + other.m_direction.x * t2) * m = d.y + other.m_direction.y * t2 - // - // d.x * m + other.m_direction.x * m * t2 = d.y + other.m_direction.y * t2 - // - // d.x * m - d.y = (other.m_direction.y - other.m_direction.x * m) * t2 - // - // (d.x * m - d.y) / (other.m_direction.y - other.m_direction.x * m) = t2 - // - - Vector2 d = origin2 - origin1; - float m = dir1.y / dir1.x; - - float t2 = (d.x * m - d.y) / (dir2.y - dir2.x * m); - if (! isFinite(t2)) { - // Parallel lines: no intersection - return Vector2::inf(); - } - - if ((t2 < 0.0f) || (t2 > 1.0f)) { - // Intersection occurs past the end of the line segments - return Vector2::inf(); - } - - float t1 = (d.x + dir2.x * t2) / dir1.x; - if ((t1 < 0.0f) || (t1 > 1.0f)) { - // Intersection occurs past the end of the line segments - return Vector2::inf(); - } - - // Return the intersection point (computed from non-transposed - // variables even if we flipped above) - return m_origin + m_direction * t1; - -} - -} - diff --git a/externals/g3dlite/G3D.lib/source/Log.cpp b/externals/g3dlite/G3D.lib/source/Log.cpp deleted file mode 100644 index 13cea7a31f0..00000000000 --- a/externals/g3dlite/G3D.lib/source/Log.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/** - @file Log.cpp - - @maintainer Morgan McGuire, morgan@graphics3d.com - @created 2001-08-04 - @edited 2005-07-01 - */ - -#include "G3D/platform.h" -#include "G3D/Log.h" -#include "G3D/format.h" -#include "G3D/Array.h" -#include "G3D/fileutils.h" -#include - -#ifdef G3D_WIN32 - #include -#else - #include -#endif - -namespace G3D { - -void logPrintf(const char* fmt, ...) { - va_list arg_list; - va_start(arg_list, fmt); - Log::common()->vprintf(fmt, arg_list); - va_end(arg_list); -} - - -Log* Log::commonLog = NULL; - -Log::Log(const std::string& filename, int stripFromStackBottom) : - stripFromStackBottom(stripFromStackBottom) { - - this->filename = filename; - - logFile = fopen(filename.c_str(), "w"); - - if (logFile == NULL) { - std::string drive, base, ext; - Array path; - parseFilename(filename, drive, path, base, ext); - std::string logName = base + ((ext != "") ? ("." + ext) : ""); - - // Write time is greater than 1ms. This may be a network drive.... try another file. - #ifdef G3D_WIN32 - logName = std::string(std::getenv("TEMP")) + logName; - #else - logName = std::string("/tmp/") + logName; - #endif - - logFile = fopen(logName.c_str(), "w"); - } - - // Turn off buffering. - setvbuf(logFile, NULL, _IONBF, 0); - - fprintf(logFile, "Application Log\n"); - time_t t; - time(&t); - fprintf(logFile, "Start: %s\n", ctime(&t)); - fflush(logFile); - - if (commonLog == NULL) { - commonLog = this; - } -} - - -Log::~Log() { - section("Shutdown"); - println("Closing log file"); - - // Make sure we don't leave a dangling pointer - if (Log::commonLog == this) { - Log::commonLog = NULL; - } - - fclose(logFile); -} - - -FILE* Log::getFile() const { - return logFile; -} - -Log* Log::common() { - if (commonLog == NULL) { - commonLog = new Log(); - } - return commonLog; -} - - -std::string Log::getCommonLogFilename() { - return common()->filename; -} - - -void Log::section(const std::string& s) { - fprintf(logFile, "_____________________________________________________\n"); - fprintf(logFile, "\n ### %s ###\n\n", s.c_str()); -} - - -void __cdecl Log::printf(const char* fmt, ...) { - printHeader(); - - va_list arg_list; - va_start(arg_list, fmt); - print(vformat(fmt, arg_list)); - va_end(arg_list); -} - - -void __cdecl Log::vprintf(const char* fmt, va_list argPtr) { - vfprintf(logFile, fmt, argPtr); -} - - -void Log::print(const std::string& s) { - printHeader(); - fprintf(logFile, "%s", s.c_str()); -} - - -void Log::println(const std::string& s) { - printHeader(); - fprintf(logFile, "%s\n", s.c_str()); -} - - -void Log::printHeader() { - time_t t; - if (time(&t) != ((time_t)-1)) { - /* - char buf[32]; - strftime(buf, 32, "[%H:%M:%S]", localtime(&t)); - - Removed because this doesn't work on SDL threads. - - #ifdef _DEBUG - std::string bt = getBacktrace(15, 2, stripFromStackBottom); - fprintf(logFile, "\n %s %s\n\n", buf, bt.c_str()); - #endif - - fprintf(logFile, "\n %s \n", buf); - */ - - } else { - println("[Error getting time]"); - } -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Matrix.cpp b/externals/g3dlite/G3D.lib/source/Matrix.cpp deleted file mode 100644 index 0c6db214543..00000000000 --- a/externals/g3dlite/G3D.lib/source/Matrix.cpp +++ /dev/null @@ -1,1801 +0,0 @@ -/** - @file Matrix.cpp - @author Morgan McGuire, matrix@graphics3d.com - */ -#include "G3D/Matrix.h" -#include "G3D/TextOutput.h" - -static inline G3D::Matrix::T negate(G3D::Matrix::T x) { - return -x; -} - -namespace G3D { - -int Matrix::debugNumCopyOps = 0; -int Matrix::debugNumAllocOps = 0; - -void Matrix::serialize(TextOutput& t) const { - t.writeSymbol("%"); - t.writeNumber(rows()); - t.writeSymbol("x"); - t.writeNumber(cols()); - t.pushIndent(); - t.writeNewline(); - - t.writeSymbol("["); - for (int r = 0; r < rows(); ++r) { - for (int c = 0; c < cols(); ++c) { - t.writeNumber(impl->get(r, c)); - if (c < cols() - 1) { - t.writeSymbol(","); - } else { - if (r < rows() - 1) { - t.writeSymbol(";"); - t.writeNewline(); - } - } - } - } - t.writeSymbol("]"); - t.popIndent(); - t.writeNewline(); -} - - -std::string Matrix::toString(const std::string& name) const { - std::string s; - - if (name != "") { - s += format("%s = \n", name.c_str()); - } - - s += "["; - for (int r = 0; r < rows(); ++r) { - for (int c = 0; c < cols(); ++c) { - double v = impl->get(r, c); - - if (::fabs(v) < 0.00001) { - // Don't print "negative zero" - s += format("% 10.04g", 0.0); - } else if (v == iRound(v)) { - // Print integers nicely - s += format("% 10.04g", v); - } else { - s += format("% 10.04f", v); - } - - if (c < cols() - 1) { - s += ","; - } else if (r < rows() - 1) { - s += ";\n "; - } else { - s += "]\n"; - } - } - } - return s; -} - - -#define INPLACE(OP)\ - ImplRef A = impl;\ -\ - if (! A.isLastReference()) {\ - impl = new Impl(A->R, A->C);\ - }\ -\ - A->OP(B, *impl); - -Matrix& Matrix::operator*=(const T& B) { - INPLACE(mul) - return *this; -} - - -Matrix& Matrix::operator-=(const T& B) { - INPLACE(sub) - return *this; -} - - -Matrix& Matrix::operator+=(const T& B) { - INPLACE(add) - return *this; -} - - -Matrix& Matrix::operator/=(const T& B) { - INPLACE(div) - return *this; -} - - -Matrix& Matrix::operator*=(const Matrix& B) { - // We can't optimize this one - *this = *this * B; - return *this; -} - - -Matrix& Matrix::operator-=(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(sub) - return *this; -} - - -Matrix& Matrix::operator+=(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(add) - return *this; -} - - -void Matrix::arrayMulInPlace(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(arrayMul) -} - - -void Matrix::arrayDivInPlace(const Matrix& _B) { - const Impl& B = *_B.impl; - INPLACE(arrayDiv) -} - -#undef INPLACE - -Matrix Matrix::fromDiagonal(const Matrix& d) { - debugAssert((d.rows() == 1) || (d.cols() == 1)); - - int n = d.numElements(); - Matrix D = zero(n, n); - for (int i = 0; i < n; ++i) { - D.set(i, i, d.impl->data[i]); - } - - return D; -} - -void Matrix::set(int r, int c, T v) { - if (! impl.isLastReference()) { - // Copy the data before mutating; this object is shared - impl = new Impl(*impl); - } - impl->set(r, c, v); -} - - -void Matrix::setRow(int r, const Matrix& vec) { - debugAssertM(vec.cols() == cols(), - "A row must be set to a vector of the same size."); - debugAssertM(vec.rows() == 1, - "A row must be set to a row vector."); - - debugAssert(r >= 0); - debugAssert(r < rows()); - - if (! impl.isLastReference()) { - // Copy the data before mutating; this object is shared - impl = new Impl(*impl); - } - impl->setRow(r, vec.impl->data); -} - - -void Matrix::setCol(int c, const Matrix& vec) { - debugAssertM(vec.rows() == rows(), - "A column must be set to a vector of the same size."); - debugAssertM(vec.cols() == 1, - "A column must be set to a column vector."); - - debugAssert(c >= 0); - - debugAssert(c < cols()); - - if (! impl.isLastReference()) { - // Copy the data before mutating; this object is shared - impl = new Impl(*impl); - } - impl->setCol(c, vec.impl->data); -} - - -Matrix::T Matrix::get(int r, int c) const { - return impl->get(r, c); -} - - -Matrix Matrix::row(int r) const { - debugAssert(r >= 0); - debugAssert(r < rows()); - Matrix out(1, cols()); - out.impl->setRow(1, impl->elt[r]); - return out; -} - - -Matrix Matrix::col(int c) const { - debugAssert(c >= 0); - debugAssert(c < cols()); - Matrix out(rows(), 1); - - T* outData = out.impl->data; - // Get a pointer to the first element in the column - const T* inElt = &(impl->elt[0][c]); - int R = rows(); - int C = cols(); - for (int r = 0; r < R; ++r) { - outData[r] = *inElt; - // Skip around to the next row - inElt += C; - } - - return out; -} - - -Matrix Matrix::zero(int R, int C) { - Impl* A = new Impl(R, C); - A->setZero(); - return Matrix(A); -} - - -Matrix Matrix::one(int R, int C) { - Impl* A = new Impl(R, C); - for (int i = R * C - 1; i >= 0; --i) { - A->data[i] = 1.0; - } - return Matrix(A); -} - - -Matrix Matrix::random(int R, int C) { - Impl* A = new Impl(R, C); - for (int i = R * C - 1; i >= 0; --i) { - A->data[i] = G3D::uniformRandom(0.0, 1.0); - } - return Matrix(A); -} - - -Matrix Matrix::identity(int N) { - Impl* m = new Impl(N, N); - m->setZero(); - for (int i = 0; i < N; ++i) { - m->elt[i][i] = 1.0; - } - return Matrix(m); -} - - -// Implement an explicit-output unary method by trampolining to the impl -#define TRAMPOLINE_EXPLICIT_1(method)\ -void Matrix::method(Matrix& out) const {\ - if ((out.impl == impl) && impl.isLastReference()) {\ - impl->method(*out.impl);\ - } else {\ - out = this->method();\ - }\ -} - -TRAMPOLINE_EXPLICIT_1(abs) -TRAMPOLINE_EXPLICIT_1(negate) -TRAMPOLINE_EXPLICIT_1(arrayLog) -TRAMPOLINE_EXPLICIT_1(arrayExp) -TRAMPOLINE_EXPLICIT_1(arrayCos) -TRAMPOLINE_EXPLICIT_1(arraySin) - -void Matrix::mulRow(int r, const T& v) { - debugAssert(r >= 0 && r < rows()); - - if (! impl.isLastReference()) { - impl = new Impl(*impl); - } - - impl->mulRow(r, v); -} - - -void Matrix::transpose(Matrix& out) const { - if ((out.impl == impl) && impl.isLastReference() && (impl->R == impl->C)) { - // In place - impl->transpose(*out.impl); - } else { - out = this->transpose(); - } -} - - -Matrix3 Matrix::toMatrix3() const { - debugAssert(impl->R == 3); - debugAssert(impl->C == 3); - return Matrix3( - impl->get(0,0), impl->get(0,1), impl->get(0,2), - impl->get(1,0), impl->get(1,1), impl->get(1,2), - impl->get(2,0), impl->get(2,1), impl->get(2,2)); -} - - -Matrix4 Matrix::toMatrix4() const { - debugAssert(impl->R == 4); - debugAssert(impl->C == 4); - return Matrix4( - impl->get(0,0), impl->get(0,1), impl->get(0,2), impl->get(0,3), - impl->get(1,0), impl->get(1,1), impl->get(1,2), impl->get(1,3), - impl->get(2,0), impl->get(2,1), impl->get(2,2), impl->get(2,3), - impl->get(3,0), impl->get(3,1), impl->get(3,2), impl->get(3,3)); -} - - -Vector2 Matrix::toVector2() const { - debugAssert(impl->R * impl->C == 2); - if (impl->R > impl->C) { - return Vector2(impl->get(0,0), impl->get(1,0)); - } else { - return Vector2(impl->get(0,0), impl->get(0,1)); - } -} - - -Vector3 Matrix::toVector3() const { - debugAssert(impl->R * impl->C == 3); - if (impl->R > impl->C) { - return Vector3(impl->get(0,0), impl->get(1,0), impl->get(2, 0)); - } else { - return Vector3(impl->get(0,0), impl->get(0,1), impl->get(0, 2)); - } -} - - -Vector4 Matrix::toVector4() const { - debugAssert( - ((impl->R == 4) && (impl->C == 1)) || - ((impl->R == 1) && (impl->C == 4))); - - if (impl->R > impl->C) { - return Vector4(impl->get(0,0), impl->get(1,0), impl->get(2, 0), impl->get(3,0)); - } else { - return Vector4(impl->get(0,0), impl->get(0,1), impl->get(0, 2), impl->get(0,3)); - } -} - - -void Matrix::swapRows(int r0, int r1) { - debugAssert(r0 >= 0 && r0 < rows()); - debugAssert(r1 >= 0 && r1 < rows()); - - if (r0 == r1) { - return; - } - - if (! impl.isLastReference()) { - impl = new Impl(*impl); - } - - impl->swapRows(r0, r1); -} - - -void Matrix::swapAndNegateCols(int c0, int c1) { - debugAssert(c0 >= 0 && c0 < cols()); - debugAssert(c1 >= 0 && c1 < cols()); - - if (c0 == c1) { - return; - } - - if (! impl.isLastReference()) { - impl = new Impl(*impl); - } - - impl->swapAndNegateCols(c0, c1); -} - -Matrix Matrix::subMatrix(int r1, int r2, int c1, int c2) const { - debugAssert(r2>=r1); - debugAssert(c2>=c1); - debugAssert(c2=0); - debugAssert(c1>=0); - - Matrix X(r2 - r1 + 1, c2 - c1 + 1); - - for (int r = 0; r < X.rows(); ++r) { - for (int c = 0; c < X.cols(); ++c) { - X.set(r, c, get(r + r1, c + c1)); - } - } - - return X; -} - - -bool Matrix::anyNonZero() const { - return impl->anyNonZero(); -} - - -bool Matrix::allNonZero() const { - return impl->allNonZero(); -} - - -void Matrix::svd(Matrix& U, Array& d, Matrix& V, bool sort) const { - debugAssert(rows() >= cols()); - debugAssertM(&U != &V, "Arguments to SVD must be different matrices"); - debugAssertM(&U != this, "Arguments to SVD must be different matrices"); - debugAssertM(&V != this, "Arguments to SVD must be different matrices"); - - int R = rows(); - int C = cols(); - - // Make sure we don't overwrite a shared matrix - if (! V.impl.isLastReference()) { - V = Matrix::zero(C, C); - } else { - V.impl->setSize(C, C); - } - - if (&U != this || ! impl.isLastReference()) { - // Make a copy of this for in-place SVD - U.impl = new Impl(*impl); - } - - d.resize(C); - const char* ret = svdCore(U.impl->elt, R, C, d.getCArray(), V.impl->elt); - - debugAssertM(ret == NULL, ret); - (void)ret; - - if (sort) { - // Sort the singular values from greatest to least - - Array rank(C); - for (int c = 0; c < C; ++c) { - rank[c].col = c; - rank[c].value = d[c]; - } - - rank.sort(SORT_INCREASING); - - Matrix Uold = U; - Matrix Vold = V; - - U = Matrix(U.rows(), U.cols()); - V = Matrix(V.rows(), V.cols()); - - // Now permute U, d, and V appropriately - for (int c0 = 0; c0 < C; ++c0) { - const int c1 = rank[c0].col; - - d[c0] = rank[c0].value; - U.setCol(c0, Uold.col(c1)); - V.setCol(c0, Vold.col(c1)); - } - - } -} - - -#define COMPARE_SCALAR(OP)\ -Matrix Matrix::operator OP (const T& scalar) const {\ - int R = rows();\ - int C = cols();\ - int N = R * C;\ - Matrix out = Matrix::zero(R, C);\ -\ - const T* raw = impl->data;\ - T* outRaw = out.impl->data;\ - for (int i = 0; i < N; ++i) {\ - outRaw[i] = raw[i] OP scalar;\ - }\ -\ - return out;\ -} - -COMPARE_SCALAR(<) -COMPARE_SCALAR(<=) -COMPARE_SCALAR(>) -COMPARE_SCALAR(>=) -COMPARE_SCALAR(==) -COMPARE_SCALAR(!=) - -#undef COMPARE_SCALAR - -double Matrix::normSquared() const { - int R = rows(); - int C = cols(); - int N = R * C; - - double sum = 0.0; - - const T* raw = impl->data; - for (int i = 0; i < N; ++i) { - sum += square(raw[i]); - } - - return sum; -} - -double Matrix::norm() const { - return sqrt(normSquared()); -} - -/////////////////////////////////////////////////////////// - -Matrix::Impl::Impl(const Matrix3& M) : elt(NULL), data(NULL), R(0), C(0), dataSize(0){ - setSize(3, 3); - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - set(r, c, M[r][c]); - } - } - -} - - -Matrix::Impl::Impl(const Matrix4& M): elt(NULL), data(NULL), R(0), C(0), dataSize(0) { - setSize(4, 4); - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - set(r, c, M[r][c]); - } - } -} - - -void Matrix::Impl::setSize(int newRows, int newCols) { - if ((R == newRows) && (C == newCols)) { - // Nothing to do - return; - } - - int newSize = newRows * newCols; - - R = newRows; C = newCols; - - // Only allocate if we need more space - // or the size difference is ridiculous - if ((newSize > dataSize) || (newSize < dataSize / 4)) { - System::alignedFree(data); - data = (float*)System::alignedMalloc(R * C * sizeof(T), 16); - ++Matrix::debugNumAllocOps; - dataSize = newSize; - } - - // Construct the row pointers - //delete[] elt; - System::free(elt); - elt = (T**)System::malloc(R * sizeof(T*));// new T*[R]; - - for (int r = 0; r < R; ++ r) { - elt[r] = data + r * C; - } -} - - -Matrix::Impl::~Impl() { - //delete[] elt; - System::free(elt); - System::alignedFree(data); -} - - -Matrix::Impl& Matrix::Impl::operator=(const Impl& m) { - setSize(m.R, m.C); - System::memcpy(data, m.data, R * C * sizeof(T)); - ++Matrix::debugNumCopyOps; - return *this; -} - - -void Matrix::Impl::setZero() { - System::memset(data, 0, R * C * sizeof(T)); -} - - -void Matrix::Impl::swapRows(int r0, int r1) { - T* R0 = elt[r0]; - T* R1 = elt[r1]; - - for (int c = 0; c < C; ++c) { - T temp = R0[c]; - R0[c] = R1[c]; - R1[c] = temp; - } -} - - -void Matrix::Impl::swapAndNegateCols(int c0, int c1) { - for (int r = 0; r < R; ++r) { - T* row = elt[r]; - - const T temp = -row[c0]; - row[c0] = -row[c1]; - row[c1] = temp; - } -} - - -void Matrix::Impl::mulRow(int r, const T& v) { - T* row = elt[r]; - - for (int c = 0; c < C; ++c) { - row[c] *= v; - } -} - - -void Matrix::Impl::mul(const Impl& B, Impl& out) const { - const Impl& A = *this; - - debugAssertM( - (this != &out) && (&B != &out), - "Output argument to mul cannot be the same as an input argument."); - - debugAssert(A.C == B.R); - debugAssert(A.R == out.R); - debugAssert(B.C == out.C); - - for (int r = 0; r < out.R; ++r) { - for (int c = 0; c < out.C; ++c) { - T sum = 0.0; - for (int i = 0; i < A.C; ++i) { - sum += A.get(r, i) * B.get(i, c); - } - out.set(r, c, sum); - } - } -} - - -// We're about to define several similar methods, -// so use a macro to share implementations. This -// must be a macro because the difference between -// the macros is the operation in the inner loop. -#define IMPLEMENT_ARRAY_2(method, OP)\ -void Matrix::Impl::method(const Impl& B, Impl& out) const {\ - const Impl& A = *this;\ - \ - debugAssert(A.C == B.C);\ - debugAssert(A.R == B.R);\ - debugAssert(A.C == out.C);\ - debugAssert(A.R == out.R);\ - \ - for (int i = R * C - 1; i >= 0; --i) {\ - out.data[i] = A.data[i] OP B.data[i];\ - }\ -} - - -#define IMPLEMENT_ARRAY_1(method, f)\ -void Matrix::Impl::method(Impl& out) const {\ - const Impl& A = *this;\ - \ - debugAssert(A.C == out.C);\ - debugAssert(A.R == out.R);\ - \ - for (int i = R * C - 1; i >= 0; --i) {\ - out.data[i] = f(A.data[i]);\ - }\ -} - - -#define IMPLEMENT_ARRAY_SCALAR(method, OP)\ -void Matrix::Impl::method(Matrix::T B, Impl& out) const {\ - const Impl& A = *this;\ - \ - debugAssert(A.C == out.C);\ - debugAssert(A.R == out.R);\ - \ - for (int i = R * C - 1; i >= 0; --i) {\ - out.data[i] = A.data[i] OP B;\ - }\ -} - -IMPLEMENT_ARRAY_2(add, +) -IMPLEMENT_ARRAY_2(sub, -) -IMPLEMENT_ARRAY_2(arrayMul, *) -IMPLEMENT_ARRAY_2(arrayDiv, /) - -IMPLEMENT_ARRAY_SCALAR(add, +) -IMPLEMENT_ARRAY_SCALAR(sub, -) -IMPLEMENT_ARRAY_SCALAR(mul, *) -IMPLEMENT_ARRAY_SCALAR(div, /) - -IMPLEMENT_ARRAY_1(abs, ::fabs) -IMPLEMENT_ARRAY_1(negate, ::negate) -IMPLEMENT_ARRAY_1(arrayLog, ::log) -IMPLEMENT_ARRAY_1(arraySqrt, ::sqrt) -IMPLEMENT_ARRAY_1(arrayExp, ::exp) -IMPLEMENT_ARRAY_1(arrayCos, ::cos) -IMPLEMENT_ARRAY_1(arraySin, ::sin) - -#undef IMPLEMENT_ARRAY_SCALAR -#undef IMPLEMENT_ARRAY_1 -#undef IMPLEMENT_ARRAY_2 - -// lsub is special because the argument order is reversed -void Matrix::Impl::lsub(Matrix::T B, Impl& out) const { - const Impl& A = *this; - - debugAssert(A.C == out.C); - debugAssert(A.R == out.R); - - for (int i = R * C - 1; i >= 0; --i) { - out.data[i] = B - A.data[i]; - } -} - - -void Matrix::Impl::inverseViaAdjoint(Impl& out) const { - debugAssert(&out != this); - - // Inverse = adjoint / determinant - - adjoint(out); - - // Don't call the determinant method when we already have an - // adjoint matrix; there's a faster way of computing it: the dot - // product of the first row and the adjoint's first col. - double det = 0.0; - for (int r = R - 1; r >= 0; --r) { - det += elt[0][r] * out.elt[r][0]; - } - - out.div(Matrix::T(det), out); -} - - -void Matrix::Impl::transpose(Impl& out) const { - debugAssert(out.R == C); - debugAssert(out.C == R); - - if (&out == this) { - // Square matrix in place - for (int r = 0; r < R; ++r) { - for (int c = r + 1; c < C; ++c) { - T temp = get(r, c); - out.set(r, c, get(c, r)); - out.set(c, r, temp); - } - } - } else { - for (int r = 0; r < R; ++r) { - for (int c = 0; c < C; ++c) { - out.set(c, r, get(r, c)); - } - } - } -} - - -void Matrix::Impl::adjoint(Impl& out) const { - cofactor(out); - // Transpose is safe to perform in place - out.transpose(out); -} - - -void Matrix::Impl::cofactor(Impl& out) const { - debugAssert(&out != this); - for(int r = 0; r < R; ++r) { - for(int c = 0; c < C; ++c) { - out.set(r, c, cofactor(r, c)); - } - } -} - - -Matrix::T Matrix::Impl::cofactor(int r, int c) const { - // Strang p. 217 - float s = isEven(r + c) ? 1.0f : -1.0f; - - return s * determinant(r, c); -} - - -Matrix::T Matrix::Impl::determinant(int nr, int nc) const { - debugAssert(R > 0); - debugAssert(C > 0); - Impl A(R - 1, C - 1); - withoutRowAndCol(nr, nc, A); - return A.determinant(); -} - - -void Matrix::Impl::setRow(int r, const T* vals) { - debugAssert(r >= 0); - System::memcpy(elt[r], vals, sizeof(T) * C); -} - - -void Matrix::Impl::setCol(int c, const T* vals) { - for (int r = 0; r < R; ++r) { - elt[r][c] = vals[r]; - } -} - - -Matrix::T Matrix::Impl::determinant() const { - - debugAssert(R == C); - - // Compute using cofactors - switch(R) { - case 0: - return 0; - - case 1: - // Determinant of a 1x1 is the element - return elt[0][0]; - - case 2: - // Determinant of a 2x2 is ad-bc - return elt[0][0] * elt[1][1] - elt[0][1] * elt[1][0]; - - case 3: - { - // Determinant of an nxn matrix is the dot product of the first - // row with the first row of cofactors. The base cases of this - // method get called a lot, so we spell out the implementation - // for the 3x3 case. - - double cofactor00 = elt[1][1] * elt[2][2] - elt[1][2] * elt[2][1]; - double cofactor10 = elt[1][2] * elt[2][0] - elt[1][0] * elt[2][2]; - double cofactor20 = elt[1][0] * elt[2][1] - elt[1][1] * elt[2][0]; - - return Matrix::T( - elt[0][0] * cofactor00 + - elt[0][1] * cofactor10 + - elt[0][2] * cofactor20); - } - - default: - { - // Determinant of an n x n matrix is the dot product of the first - // row with the first row of cofactors - T det = 0.0; - - for (int c = 0; c < C; ++c) { - det += elt[0][c] * cofactor(0, c); - } - - return det; - } - } -} - - -void Matrix::Impl::withoutRowAndCol(int excludeRow, int excludeCol, Impl& out) const { - debugAssert(out.R == R - 1); - debugAssert(out.C == C - 1); - - for (int r = 0; r < out.R; ++r) { - for (int c = 0; c < out.C; ++c) { - out.elt[r][c] = elt[r + ((r >= excludeRow) ? 1 : 0)][c + ((c >= excludeCol) ? 1 : 0)]; - } - } -} - - -Matrix Matrix::pseudoInverse(float tolerance) const { - if ((cols() == 1) || (rows() == 1)) { - return vectorPseudoInverse(); - } else if ((cols() <= 4) || (rows() <= 4)) { - return partitionPseudoInverse(); - } else { - return svdPseudoInverse(tolerance); - } -} - -/* - Public function for testing purposes only. Use pseudoInverse(), as it contains optimizations for - nonsingular matrices with at least one small (<5) dimension. -*/ -Matrix Matrix::svdPseudoInverse(float tolerance) const { - if (cols() > rows()) { - return transpose().svdPseudoInverse(tolerance).transpose(); - } - - // Matrices from SVD - Matrix U, V; - - // Diagonal elements - Array d; - - svd(U, d, V); - - if (rows() == 1) { - d.resize(1, false); - } - - if (tolerance < 0) { - // TODO: Should be eps(d[0]), which is the largest diagonal - tolerance = G3D::max(rows(), cols()) * 0.0001f; - } - - Matrix X; - - int r = 0; - for (int i = 0; i < d.size(); ++i) { - if (d[i] > tolerance) { - d[i] = Matrix::T(1) / d[i]; - ++r; - } - } - - if (r == 0) { - // There were no non-zero elements - X = zero(cols(), rows()); - } else { - // Use the first r columns - - // Test code (the rest is below) - /* - d.resize(r); - Matrix testU = U.subMatrix(0, U.rows() - 1, 0, r - 1); - Matrix testV = V.subMatrix(0, V.rows() - 1, 0, r - 1); - Matrix testX = testV * Matrix::fromDiagonal(d) * testU.transpose(); - X = testX; - */ - - - // We want to do this: - // - // d.resize(r); - // U = U.subMatrix(0, U.rows() - 1, 0, r - 1); - // X = V * Matrix::fromDiagonal(d) * U.transpose(); - // - // but creating a large diagonal matrix and then - // multiplying by it is wasteful. So we instead - // explicitly perform A = (D * U')' = U * D, and - // then multiply X = V * A'. - - Matrix A = Matrix(U.rows(), r); - - const T* dPtr = d.getCArray(); - for (int i = 0; i < A.rows(); ++i) { - const T* Urow = U.impl->elt[i]; - T* Arow = A.impl->elt[i]; - const int Acols = A.cols(); - for (int j = 0; j < Acols; ++j) { - // A(i,j) = U(i,:) * D(:,j) - // This is non-zero only at j = i because D is diagonal - // A(i,j) = U(i,j) * D(j,j) - Arow[j] = Urow[j] * dPtr[j]; - } - } - - // - // Compute X = V.subMatrix(0, V.rows() - 1, 0, r - 1) * A.transpose() - // - // Avoid the explicit subMatrix call, and by storing A' instead of A, avoid - // both the transpose and the memory incoherence of striding across memory - // in big steps. - - alwaysAssertM(A.cols() == r, - "Internal dimension mismatch during pseudoInverse()"); - alwaysAssertM(V.cols() >= r, - "Internal dimension mismatch during pseudoInverse()"); - - X = Matrix(V.rows(), A.rows()); - T** Xelt = X.impl->elt; - for (int i = 0; i < X.rows(); ++i) { - const T* Vrow = V.impl->elt[i]; - for (int j = 0; j < X.cols(); ++j) { - const T* Arow = A.impl->elt[j]; - T sum = 0; - for (int k = 0; k < r; ++k) { - sum += Vrow[k] * Arow[k]; - } - Xelt[i][j] = sum; - } - } - - /* - // Test that results are the same after optimizations: - Matrix diff = X - testX; - T n = diff.norm(); - debugAssert(n < 0.0001); - */ - } - return X; -} - -// Computes pseudoinverse for a vector -Matrix Matrix::vectorPseudoInverse() const { - // If vector A has nonzero elements: transpose A, then divide each elt. by the squared norm - // If A is zero vector: transpose A - double x = 0.0; - - if (anyNonZero()) { - x = 1.0 / normSquared(); - } - - Matrix A(cols(), rows()); - T** Aelt = A.impl->elt; - for (int r = 0; r < rows(); ++r) { - const T* MyRow = impl->elt[r]; - for (int c = 0; c < cols(); ++c) { - Aelt[c][r] = T(MyRow[c] * x); - } - } - return Matrix(A); -} - - -Matrix Matrix::rowPartPseudoInverse() const{ - int m = rows(); - int n = cols(); - alwaysAssertM((m<=n),"Row-partitioned block matrix pseudoinverse requires Relt; - T** Belt = B.impl->elt; - for (int i = 0; i < m; ++i) { - const T* Arow = Aelt[i]; - for (int j = 0; j < m; ++j) { - const T* Brow = Aelt[j]; - T sum = 0; - for (int k = 0; k < n; ++k) { - sum += Arow[k] * Brow[k]; - } - Belt[i][j] = sum; - } - } - - // B has size m x m - switch (m) { - case 2: - return row2PseudoInverse(B); - - case 3: - return row3PseudoInverse(B); - - case 4: - return row4PseudoInverse(B); - - default: - alwaysAssertM(false, "G3D internal error: Should have used the vector or general case!"); - return Matrix(); - } -} - -Matrix Matrix::colPartPseudoInverse() const{ - int m = rows(); - int n = cols(); - alwaysAssertM((m>=n),"Column-partitioned block matrix pseudoinverse requires R>C"); - // TODO: Put each of the individual cases in its own helper function - // TODO: Push the B computation down into the individual cases - // B = A' * A - Matrix A = *this; - Matrix B = Matrix(n, n); - T** Aelt = A.impl->elt; - T** Belt = B.impl->elt; - for (int i = 0; i < n; ++i) { - for (int j = 0; j < n; ++j) { - T sum = 0; - for (int k = 0; k < m; ++k) { - sum += Aelt[k][i] * Aelt[k][j]; - } - Belt[i][j] = sum; - } - } - - // B has size n x n - switch (n) { - case 2: - return col2PseudoInverse(B); - - case 3: - return col3PseudoInverse(B); - - case 4: - return col4PseudoInverse(B); - - default: - alwaysAssertM(false, "G3D internal error: Should have used the vector or general case!"); - return Matrix(); - } -} - -Matrix Matrix::col2PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - (void)n; - - // Row-major 2x2 matrix - const float B2[2][2] = - {{B.get(0,0), B.get(0,1)}, - {B.get(1,0), B.get(1,1)}}; - - float det = (B2[0][0]*B2[1][1]) - (B2[0][1]*B2[1][0]); - - if (fuzzyEq(det, T(0))) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - // invert using formula at http://www.netsoc.tcd.ie/~jgilbert/maths_site/applets/algebra/matrix_inversion.html - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - float binv00 = B2[1][1]/det, binv01 = -B2[1][0]/det; - float binv10 = -B2[0][1]/det, binv11 = B2[0][0]/det; - for (int j = 0; j < m; ++j) { - const T* Arow = Aelt[j]; - float a0 = Arow[0]; - float a1 = Arow[1]; - Xelt[0][j] = binv00 * a0 + binv01 * a1; - Xelt[1][j] = binv10 * a0 + binv11 * a1; - } - return X; - } -} - -Matrix Matrix::col3PseudoInverse(const Matrix& B) const { - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix3 B3 = B.toMatrix3(); - if (fuzzyEq(B3.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix3 B3inv = B3.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - const T* Arow = Aelt[j]; - T sum = 0; - const float* Binvrow = B3inv[i]; - for (int k = 0; k < n; ++k) { - sum += Binvrow[k] * Arow[k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -Matrix Matrix::col4PseudoInverse(const Matrix& B) const { - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix4 B4 = B.toMatrix4(); - if (fuzzyEq(B4.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix4 B4inv = B4.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - const T* Arow = Aelt[j]; - T sum = 0; - const float* Binvrow = B4inv[i]; - for (int k = 0; k < n; ++k) { - sum += Binvrow[k] * Arow[k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -Matrix Matrix::row2PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - (void)m; - - // Row-major 2x2 matrix - const float B2[2][2] = - {{B.get(0,0), B.get(0,1)}, - {B.get(1,0), B.get(1,1)}}; - - float det = (B2[0][0]*B2[1][1]) - (B2[0][1]*B2[1][0]); - - if (fuzzyEq(det, T(0))) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - // invert using formula at http://www.netsoc.tcd.ie/~jgilbert/maths_site/applets/algebra/matrix_inversion.html - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - float binv00 = B2[1][1]/det, binv01 = -B2[1][0]/det; - float binv10 = -B2[0][1]/det, binv11 = B2[0][0]/det; - for (int j = 0; j < n; ++j) { - Xelt[j][0] = Aelt[0][j] * binv00 + Aelt[1][j] * binv10; - Xelt[j][1] = Aelt[0][j] * binv01 + Aelt[1][j] * binv11; - } - return X; - } -} - -Matrix Matrix::row3PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix3 B3 = B.toMatrix3(); - if (fuzzyEq(B3.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix3 B3inv = B3.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - T sum = 0; - for (int k = 0; k < m; ++k) { - sum += Aelt[k][i] * B3inv[j][k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -Matrix Matrix::row4PseudoInverse(const Matrix& B) const { - - Matrix A = *this; - int m = rows(); - int n = cols(); - - Matrix4 B4 = B.toMatrix4(); - if (fuzzyEq(B4.determinant(), (T)0.0)) { - - // Matrix was singular; the block matrix pseudo-inverse can't - // handle that, so fall back to the old case - return svdPseudoInverse(); - - } else { - Matrix4 B4inv = B4.inverse(); - - // Multiply by Binv * A' - Matrix X(cols(), rows()); - - T** Xelt = X.impl->elt; - T** Aelt = A.impl->elt; - for (int i = 0; i < n; ++i) { - T* Xrow = Xelt[i]; - for (int j = 0; j < m; ++j) { - T sum = 0; - for (int k = 0; k < m; ++k) { - sum += Aelt[k][i] * B4inv[j][k]; - } - Xrow[j] = sum; - } - } - return X; - } -} - -// Uses the block matrix pseudoinverse to compute the pseudoinverse of a full-rank mxn matrix with m >= n -// http://en.wikipedia.org/wiki/Block_matrix_pseudoinverse -Matrix Matrix::partitionPseudoInverse() const { - - // Logic: - // A^-1 = (A'A)^-1 A' - // A has few (n) columns, so A'A is small (n x n) and fast to invert - - int m = rows(); - int n = cols(); - - if (m < n) { - // TODO: optimize by pushing through the transpose - //return transpose().partitionPseudoInverse().transpose(); - return rowPartPseudoInverse(); - - } else { - return colPartPseudoInverse(); - } -} - -void Matrix::Impl::inverseInPlaceGaussJordan() { - debugAssertM(R == C, - format( - "Cannot perform Gauss-Jordan inverse on a non-square matrix." - " (Argument was %dx%d)", - R, C)); - - // Exchange to float elements -# define SWAP(x, y) {float temp = x; x = y; y = temp;} - - // The integer arrays pivot, rowIndex, and colIndex are - // used for bookkeeping on the pivoting - static Array colIndex, rowIndex, pivot; - - int col = 0, row = 0; - - colIndex.resize(R); - rowIndex.resize(R); - pivot.resize(R); - - static const int NO_PIVOT = -1; - - // Initialize the pivot array to default values. - for (int i = 0; i < R; ++i) { - pivot[i] = NO_PIVOT; - } - - // This is the main loop over the columns to be reduced - // Loop over the columns. - for (int c = 0; c < R; ++c) { - - // Find the largest element and use that as a pivot - float largestMagnitude = 0.0; - - // This is the outer loop of the search for a pivot element - for (int r = 0; r < R; ++r) { - - // Unless we've already found the pivot, keep going - if (pivot[r] != 0) { - - // Find the largest pivot - for (int k = 0; k < R; ++k) { - if (pivot[k] == NO_PIVOT) { - const float mag = fabs(elt[r][k]); - - if (mag >= largestMagnitude) { - largestMagnitude = mag; - row = r; col = k; - } - } - } - } - } - - pivot[col] += 1; - - // Interchange columns so that the pivot element is on the diagonal (we'll have to undo this - // at the end) - if (row != col) { - for (int k = 0; k < R; ++k) { - SWAP(elt[row][k], elt[col][k]) - } - } - - // The pivot is now at [row, col] - rowIndex[c] = row; - colIndex[c] = col; - - double piv = elt[col][col]; - - debugAssertM(piv != 0.0, "Matrix is singular"); - - // Divide everything by the pivot (avoid computing the division - // multiple times). - const double pivotInverse = 1.0 / piv; - elt[col][col] = 1.0; - - for (int k = 0; k < R; ++k) { - elt[col][k] *= Matrix::T(pivotInverse); - } - - // Reduce all rows - for (int r = 0; r < R; ++r) { - // Skip over the pivot row - if (r != col) { - - double oldValue = elt[r][col]; - elt[r][col] = 0.0; - - for (int k = 0; k < R; ++k) { - elt[r][k] -= Matrix::T(elt[col][k] * oldValue); - } - } - } - } - - - // Put the columns back in the correct locations - for (int i = R - 1; i >= 0; --i) { - if (rowIndex[i] != colIndex[i]) { - for (int k = 0; k < R; ++k) { - SWAP(elt[k][rowIndex[i]], elt[k][colIndex[i]]); - } - } - } - -# undef SWAP -} - - -bool Matrix::Impl::anyNonZero() const { - int N = R * C; - for (int i = 0; i < N; ++i) { - if (data[i] != 0.0) { - return true; - } - } - return false; -} - - -bool Matrix::Impl::allNonZero() const { - int N = R * C; - for (int i = 0; i < N; ++i) { - if (data[i] == 0.0) { - return false; - } - } - return true; -} - - -/** Helper for svdCore */ -static double pythag(double a, double b) { - - double at = fabs(a), bt = fabs(b), ct, result; - - if (at > bt) { - ct = bt / at; - result = at * sqrt(1.0 + square(ct)); - } else if (bt > 0.0) { - ct = at / bt; - result = bt * sqrt(1.0 + square(ct)); - } else { - result = 0.0; - } - - return result; -} - -#define SIGN(a, b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) - -const char* Matrix::svdCore(float** U, int rows, int cols, float* D, float** V) { - const int MAX_ITERATIONS = 30; - - int flag, i, its, j, jj, k, l = 0, nm = 0; - double c, f, h, s, x, y, z; - double anorm = 0.0, g = 0.0, scale = 0.0; - - // Temp row vector - double* rv1; - - debugAssertM(rows >= cols, "Must have more rows than columns"); - - rv1 = (double*)System::alignedMalloc(cols * sizeof(double), 16); - debugAssert(rv1); - - // Householder reduction to bidiagonal form - for (i = 0; i < cols; ++i) { - - // Left-hand reduction - l = i + 1; - rv1[i] = scale * g; - g = s = scale = 0.0; - - if (i < rows) { - - for (k = i; k < rows; ++k) { - scale += fabs((double)U[k][i]); - } - - if (scale) { - for (k = i; k < rows; ++k) { - U[k][i] = (float)((double)U[k][i]/scale); - s += ((double)U[k][i] * (double)U[k][i]); - } - - f = (double)U[i][i]; - - // TODO: what is this 2-arg sign function? - g = -SIGN(sqrt(s), f); - h = f * g - s; - U[i][i] = (float)(f - g); - - if (i != cols - 1) { - for (j = l; j < cols; j++) { - - for (s = 0.0, k = i; k < rows; ++k) { - s += ((double)U[k][i] * (double)U[k][j]); - } - - f = s / h; - for (k = i; k < rows; ++k) { - U[k][j] += (float)(f * (double)U[k][i]); - } - } - } - for (k = i; k < rows; ++k) { - U[k][i] = (float)((double)U[k][i]*scale); - } - } - } - D[i] = (float)(scale * g); - - // right-hand reduction - g = s = scale = 0.0; - if (i < rows && i != cols - 1) { - for (k = l; k < cols; ++k) { - scale += fabs((double)U[i][k]); - } - - if (scale) { - for (k = l; k < cols; ++k) { - U[i][k] = (float)((double)U[i][k]/scale); - s += ((double)U[i][k] * (double)U[i][k]); - } - - f = (double)U[i][l]; - g = -SIGN(sqrt(s), f); - h = f * g - s; - U[i][l] = (float)(f - g); - - for (k = l; k < cols; ++k) { - rv1[k] = (double)U[i][k] / h; - } - - if (i != rows - 1) { - - for (j = l; j < rows; ++j) { - for (s = 0.0, k = l; k < cols; ++k) { - s += ((double)U[j][k] * (double)U[i][k]); - } - - for (k = l; k < cols; ++k) { - U[j][k] += (float)(s * rv1[k]); - } - } - } - - for (k = l; k < cols; ++k) { - U[i][k] = (float)((double)U[i][k]*scale); - } - } - } - - anorm = max(anorm, fabs((double)D[i]) + fabs(rv1[i])); - } - - // accumulate the right-hand transformation - for (i = cols - 1; i >= 0; --i) { - if (i < cols - 1) { - if (g) { - for (j = l; j < cols; j++) { - V[j][i] = (float)(((double)U[i][j] / (double)U[i][l]) / g); - } - - // double division to avoid underflow - for (j = l; j < cols; ++j) { - for (s = 0.0, k = l; k < cols; k++) { - s += ((double)U[i][k] * (double)V[k][j]); - } - - for (k = l; k < cols; ++k) { - V[k][j] += (float)(s * (double)V[k][i]); - } - } - } - - for (j = l; j < cols; ++j) { - V[i][j] = V[j][i] = 0.0; - } - } - - V[i][i] = 1.0; - g = rv1[i]; - l = i; - } - - // accumulate the left-hand transformation - for (i = cols - 1; i >= 0; --i) { - l = i + 1; - g = (double)D[i]; - if (i < cols - 1) { - for (j = l; j < cols; ++j) { - U[i][j] = 0.0; - } - } - - if (g) { - g = 1.0 / g; - if (i != cols - 1) { - for (j = l; j < cols; ++j) { - for (s = 0.0, k = l; k < rows; ++k) { - s += ((double)U[k][i] * (double)U[k][j]); - } - - f = (s / (double)U[i][i]) * g; - - for (k = i; k < rows; ++k) { - U[k][j] += (float)(f * (double)U[k][i]); - } - } - } - - for (j = i; j < rows; ++j) { - U[j][i] = (float)((double)U[j][i]*g); - } - - } else { - for (j = i; j < rows; ++j) { - U[j][i] = 0.0; - } - } - ++U[i][i]; - } - - // diagonalize the bidiagonal form - for (k = cols - 1; k >= 0; --k) { - // loop over singular values - for (its = 0; its < MAX_ITERATIONS; ++its) { - // loop over allowed iterations - flag = 1; - - for (l = k; l >= 0; --l) { - // test for splitting - nm = l - 1; - if (fabs(rv1[l]) + anorm == anorm) { - flag = 0; - break; - } - - if (fabs((double)D[nm]) + anorm == anorm) { - break; - } - } - - if (flag) { - c = 0.0; - s = 1.0; - for (i = l; i <= k; ++i) { - f = s * rv1[i]; - if (fabs(f) + anorm != anorm) { - g = (double)D[i]; - h = pythag(f, g); - D[i] = (float)h; - h = 1.0 / h; - c = g * h; - s = (- f * h); - for (j = 0; j < rows; ++j) { - y = (double)U[j][nm]; - z = (double)U[j][i]; - U[j][nm] = (float)(y * c + z * s); - U[j][i] = (float)(z * c - y * s); - } - } - } - } - - z = (double)D[k]; - if (l == k) { - // convergence - if (z < 0.0) { - // make singular value nonnegative - D[k] = (float)(-z); - - for (j = 0; j < cols; ++j) { - V[j][k] = (-V[j][k]); - } - } - break; - } - - if (its >= MAX_ITERATIONS) { - free(rv1); - rv1 = NULL; - return "Failed to converge."; - } - - // shift from bottom 2 x 2 minor - x = (double)D[l]; - nm = k - 1; - y = (double)D[nm]; - g = rv1[nm]; - h = rv1[k]; - f = ((y - z) * (y + z) + (g - h) * (g + h)) / (2.0 * h * y); - g = pythag(f, 1.0); - f = ((x - z) * (x + z) + h * ((y / (f + SIGN(g, f))) - h)) / x; - - // next QR transformation - c = s = 1.0; - for (j = l; j <= nm; ++j) { - i = j + 1; - g = rv1[i]; - y = (double)D[i]; - h = s * g; - g = c * g; - z = pythag(f, h); - rv1[j] = z; - c = f / z; - s = h / z; - f = x * c + g * s; - g = g * c - x * s; - h = y * s; - y = y * c; - - for (jj = 0; jj < cols; ++jj) { - x = (double)V[jj][j]; - z = (double)V[jj][i]; - V[jj][j] = (float)(x * c + z * s); - V[jj][i] = (float)(z * c - x * s); - } - z = pythag(f, h); - D[j] = (float)z; - if (z) { - z = 1.0 / z; - c = f * z; - s = h * z; - } - f = (c * g) + (s * y); - x = (c * y) - (s * g); - for (jj = 0; jj < rows; jj++) { - y = (double)U[jj][j]; - z = (double)U[jj][i]; - U[jj][j] = (float)(y * c + z * s); - U[jj][i] = (float)(z * c - y * s); - } - } - rv1[l] = 0.0; - rv1[k] = f; - D[k] = (float)x; - } - } - - System::alignedFree(rv1); - rv1 = NULL; - - return NULL; -} - -#undef SIGN - -} diff --git a/externals/g3dlite/G3D.lib/source/Matrix3.cpp b/externals/g3dlite/G3D.lib/source/Matrix3.cpp deleted file mode 100644 index 7fb6648d3f7..00000000000 --- a/externals/g3dlite/G3D.lib/source/Matrix3.cpp +++ /dev/null @@ -1,1725 +0,0 @@ -/** - @file Matrix3.cpp - - 3x3 matrix class - - @author Morgan McGuire, graphics3d.com - - @created 2001-06-02 - @edited 2006-04-06 -*/ - -#include "G3D/platform.h" -#include -#include -#include "G3D/Matrix3.h" -#include "G3D/g3dmath.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Quat.h" - -namespace G3D { - -const float Matrix3::EPSILON = 1e-06f; - -const Matrix3& Matrix3::zero() { - static Matrix3 m(0, 0, 0, 0, 0, 0, 0, 0, 0); - return m; -} - -const Matrix3& Matrix3::identity() { - static Matrix3 m(1, 0, 0, 0, 1, 0, 0, 0, 1); - return m; -} - - -const float Matrix3::ms_fSvdEpsilon = 1e-04f; -const int Matrix3::ms_iSvdMaxIterations = 32; - -Matrix3::Matrix3(BinaryInput& b) { - deserialize(b); -} - -bool Matrix3::fuzzyEq(const Matrix3& b) const { - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - if (! G3D::fuzzyEq(elt[r][c], b[r][c])) { - return false; - } - } - } - return true; -} - - -bool Matrix3::isOrthonormal() const { - Vector3 X = column(0); - Vector3 Y = column(1); - Vector3 Z = column(2); - - return - (G3D::fuzzyEq(X.dot(Y), 0.0f) && - G3D::fuzzyEq(Y.dot(Z), 0.0f) && - G3D::fuzzyEq(X.dot(Z), 0.0f) && - G3D::fuzzyEq(X.squaredMagnitude(), 1.0f) && - G3D::fuzzyEq(Y.squaredMagnitude(), 1.0f) && - G3D::fuzzyEq(Z.squaredMagnitude(), 1.0f)); -} - -//---------------------------------------------------------------------------- -Matrix3::Matrix3(const Quat& _q) { - // Implementation from Watt and Watt, pg 362 - // See also http://www.flipcode.com/documents/matrfaq.html#Q54 - Quat q = _q; - q.unitize(); - float xx = 2.0f * q.x * q.x; - float xy = 2.0f * q.x * q.y; - float xz = 2.0f * q.x * q.z; - float xw = 2.0f * q.x * q.w; - - float yy = 2.0f * q.y * q.y; - float yz = 2.0f * q.y * q.z; - float yw = 2.0f * q.y * q.w; - - float zz = 2.0f * q.z * q.z; - float zw = 2.0f * q.z * q.w; - - set(1.0f - yy - zz, xy - zw, xz + yw, - xy + zw, 1.0f - xx - zz, yz - xw, - xz - yw, yz + xw, 1.0f - xx - yy); -} - -//---------------------------------------------------------------------------- - -Matrix3::Matrix3 (const float aafEntry[3][3]) { - memcpy(elt, aafEntry, 9*sizeof(float)); -} - -//---------------------------------------------------------------------------- -Matrix3::Matrix3 (const Matrix3& rkMatrix) { - memcpy(elt, rkMatrix.elt, 9*sizeof(float)); -} - -//---------------------------------------------------------------------------- -Matrix3::Matrix3( - float fEntry00, float fEntry01, float fEntry02, - float fEntry10, float fEntry11, float fEntry12, - float fEntry20, float fEntry21, float fEntry22) { - set(fEntry00, fEntry01, fEntry02, - fEntry10, fEntry11, fEntry12, - fEntry20, fEntry21, fEntry22); -} - -void Matrix3::set( - float fEntry00, float fEntry01, float fEntry02, - float fEntry10, float fEntry11, float fEntry12, - float fEntry20, float fEntry21, float fEntry22) { - - elt[0][0] = fEntry00; - elt[0][1] = fEntry01; - elt[0][2] = fEntry02; - elt[1][0] = fEntry10; - elt[1][1] = fEntry11; - elt[1][2] = fEntry12; - elt[2][0] = fEntry20; - elt[2][1] = fEntry21; - elt[2][2] = fEntry22; -} - - -void Matrix3::deserialize(BinaryInput& b) { - int r,c; - for (c = 0; c < 3; ++c) { - for (r = 0; r < 3; ++r) { - elt[r][c] = b.readFloat32(); - } - } -} - - -void Matrix3::serialize(BinaryOutput& b) const { - int r,c; - for (c = 0; c < 3; ++c) { - for (r = 0; r < 3; ++r) { - b.writeFloat32(elt[r][c]); - } - } -} - - -//---------------------------------------------------------------------------- -Vector3 Matrix3::column (int iCol) const { - assert((0 <= iCol) && (iCol < 3)); - return Vector3(elt[0][iCol], elt[1][iCol], - elt[2][iCol]); -} - -const Vector3& Matrix3::row (int iRow) const { - assert((0 <= iRow) && (iRow < 3)); - return *reinterpret_cast(elt[iRow]); -} - - -Vector3 Matrix3::getColumn (int iCol) const { - assert((0 <= iCol) && (iCol < 3)); - return Vector3(elt[0][iCol], elt[1][iCol], - elt[2][iCol]); -} - -Vector3 Matrix3::getRow (int iRow) const { - return Vector3(elt[iRow][0], elt[iRow][1], elt[iRow][2]); -} - -void Matrix3::setColumn(int iCol, const Vector3 &vector) { - debugAssert((iCol >= 0) && (iCol < 3)); - elt[0][iCol] = vector.x; - elt[1][iCol] = vector.y; - elt[2][iCol] = vector.z; -} - - -void Matrix3::setRow(int iRow, const Vector3 &vector) { - debugAssert((iRow >= 0) && (iRow < 3)); - elt[iRow][0] = vector.x; - elt[iRow][1] = vector.y; - elt[iRow][2] = vector.z; -} - - -//---------------------------------------------------------------------------- -bool Matrix3::operator== (const Matrix3& rkMatrix) const { - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - if ( elt[iRow][iCol] != rkMatrix.elt[iRow][iCol] ) - return false; - } - } - - return true; -} - -//---------------------------------------------------------------------------- -bool Matrix3::operator!= (const Matrix3& rkMatrix) const { - return !operator==(rkMatrix); -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::operator+ (const Matrix3& rkMatrix) const { - Matrix3 kSum; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kSum.elt[iRow][iCol] = elt[iRow][iCol] + - rkMatrix.elt[iRow][iCol]; - } - } - - return kSum; -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::operator- (const Matrix3& rkMatrix) const { - Matrix3 kDiff; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kDiff.elt[iRow][iCol] = elt[iRow][iCol] - - rkMatrix.elt[iRow][iCol]; - } - } - - return kDiff; -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::operator* (const Matrix3& rkMatrix) const { - Matrix3 kProd; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kProd.elt[iRow][iCol] = - elt[iRow][0] * rkMatrix.elt[0][iCol] + - elt[iRow][1] * rkMatrix.elt[1][iCol] + - elt[iRow][2] * rkMatrix.elt[2][iCol]; - } - } - - return kProd; -} - -Matrix3& Matrix3::operator+= (const Matrix3& rkMatrix) { - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - elt[iRow][iCol] = elt[iRow][iCol] + rkMatrix.elt[iRow][iCol]; - } - } - - return *this; -} - -Matrix3& Matrix3::operator-= (const Matrix3& rkMatrix) { - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - elt[iRow][iCol] = elt[iRow][iCol] - rkMatrix.elt[iRow][iCol]; - } - } - - return *this; -} - -Matrix3& Matrix3::operator*= (const Matrix3& rkMatrix) { - Matrix3 mulMat; - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - mulMat.elt[iRow][iCol] = - elt[iRow][0] * rkMatrix.elt[0][iCol] + - elt[iRow][1] * rkMatrix.elt[1][iCol] + - elt[iRow][2] * rkMatrix.elt[2][iCol]; - } - } - - *this = mulMat; - return *this; -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::operator- () const { - Matrix3 kNeg; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kNeg[iRow][iCol] = -elt[iRow][iCol]; - } - } - - return kNeg; -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::operator* (float fScalar) const { - Matrix3 kProd; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kProd[iRow][iCol] = fScalar * elt[iRow][iCol]; - } - } - - return kProd; -} - -//---------------------------------------------------------------------------- -Matrix3 operator* (double fScalar, const Matrix3& rkMatrix) { - Matrix3 kProd; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kProd[iRow][iCol] = fScalar * rkMatrix.elt[iRow][iCol]; - } - } - - return kProd; -} - -Matrix3 operator* (float fScalar, const Matrix3& rkMatrix) { - return (double)fScalar * rkMatrix; -} - - -Matrix3 operator* (int fScalar, const Matrix3& rkMatrix) { - return (double)fScalar * rkMatrix; -} -//---------------------------------------------------------------------------- -Matrix3 Matrix3::transpose () const { - Matrix3 kTranspose; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - kTranspose[iRow][iCol] = elt[iCol][iRow]; - } - } - - return kTranspose; -} - -//---------------------------------------------------------------------------- -bool Matrix3::inverse (Matrix3& rkInverse, float fTolerance) const { - // Invert a 3x3 using cofactors. This is about 8 times faster than - // the Numerical Recipes code which uses Gaussian elimination. - - rkInverse[0][0] = elt[1][1] * elt[2][2] - - elt[1][2] * elt[2][1]; - rkInverse[0][1] = elt[0][2] * elt[2][1] - - elt[0][1] * elt[2][2]; - rkInverse[0][2] = elt[0][1] * elt[1][2] - - elt[0][2] * elt[1][1]; - rkInverse[1][0] = elt[1][2] * elt[2][0] - - elt[1][0] * elt[2][2]; - rkInverse[1][1] = elt[0][0] * elt[2][2] - - elt[0][2] * elt[2][0]; - rkInverse[1][2] = elt[0][2] * elt[1][0] - - elt[0][0] * elt[1][2]; - rkInverse[2][0] = elt[1][0] * elt[2][1] - - elt[1][1] * elt[2][0]; - rkInverse[2][1] = elt[0][1] * elt[2][0] - - elt[0][0] * elt[2][1]; - rkInverse[2][2] = elt[0][0] * elt[1][1] - - elt[0][1] * elt[1][0]; - - float fDet = - elt[0][0] * rkInverse[0][0] + - elt[0][1] * rkInverse[1][0] + - elt[0][2] * rkInverse[2][0]; - - if ( G3D::abs(fDet) <= fTolerance ) - return false; - - float fInvDet = 1.0 / fDet; - - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) - rkInverse[iRow][iCol] *= fInvDet; - } - - return true; -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::inverse (float fTolerance) const { - Matrix3 kInverse = Matrix3::zero(); - inverse(kInverse, fTolerance); - return kInverse; -} - -//---------------------------------------------------------------------------- -float Matrix3::determinant () const { - float fCofactor00 = elt[1][1] * elt[2][2] - - elt[1][2] * elt[2][1]; - float fCofactor10 = elt[1][2] * elt[2][0] - - elt[1][0] * elt[2][2]; - float fCofactor20 = elt[1][0] * elt[2][1] - - elt[1][1] * elt[2][0]; - - float fDet = - elt[0][0] * fCofactor00 + - elt[0][1] * fCofactor10 + - elt[0][2] * fCofactor20; - - return fDet; -} - -//---------------------------------------------------------------------------- -void Matrix3::bidiagonalize (Matrix3& kA, Matrix3& kL, - Matrix3& kR) { - float afV[3], afW[3]; - float fLength, fSign, fT1, fInvT1, fT2; - bool bIdentity; - - // map first column to (*,0,0) - fLength = sqrt(kA[0][0] * kA[0][0] + kA[1][0] * kA[1][0] + - kA[2][0] * kA[2][0]); - - if ( fLength > 0.0 ) { - fSign = (kA[0][0] > 0.0 ? 1.0 : -1.0); - fT1 = kA[0][0] + fSign * fLength; - fInvT1 = 1.0 / fT1; - afV[1] = kA[1][0] * fInvT1; - afV[2] = kA[2][0] * fInvT1; - - fT2 = -2.0 / (1.0 + afV[1] * afV[1] + afV[2] * afV[2]); - afW[0] = fT2 * (kA[0][0] + kA[1][0] * afV[1] + kA[2][0] * afV[2]); - afW[1] = fT2 * (kA[0][1] + kA[1][1] * afV[1] + kA[2][1] * afV[2]); - afW[2] = fT2 * (kA[0][2] + kA[1][2] * afV[1] + kA[2][2] * afV[2]); - kA[0][0] += afW[0]; - kA[0][1] += afW[1]; - kA[0][2] += afW[2]; - kA[1][1] += afV[1] * afW[1]; - kA[1][2] += afV[1] * afW[2]; - kA[2][1] += afV[2] * afW[1]; - kA[2][2] += afV[2] * afW[2]; - - kL[0][0] = 1.0 + fT2; - kL[0][1] = kL[1][0] = fT2 * afV[1]; - kL[0][2] = kL[2][0] = fT2 * afV[2]; - kL[1][1] = 1.0 + fT2 * afV[1] * afV[1]; - kL[1][2] = kL[2][1] = fT2 * afV[1] * afV[2]; - kL[2][2] = 1.0 + fT2 * afV[2] * afV[2]; - bIdentity = false; - } else { - kL = Matrix3::identity(); - bIdentity = true; - } - - // map first row to (*,*,0) - fLength = sqrt(kA[0][1] * kA[0][1] + kA[0][2] * kA[0][2]); - - if ( fLength > 0.0 ) { - fSign = (kA[0][1] > 0.0 ? 1.0 : -1.0); - fT1 = kA[0][1] + fSign * fLength; - afV[2] = kA[0][2] / fT1; - - fT2 = -2.0 / (1.0 + afV[2] * afV[2]); - afW[0] = fT2 * (kA[0][1] + kA[0][2] * afV[2]); - afW[1] = fT2 * (kA[1][1] + kA[1][2] * afV[2]); - afW[2] = fT2 * (kA[2][1] + kA[2][2] * afV[2]); - kA[0][1] += afW[0]; - kA[1][1] += afW[1]; - kA[1][2] += afW[1] * afV[2]; - kA[2][1] += afW[2]; - kA[2][2] += afW[2] * afV[2]; - - kR[0][0] = 1.0; - kR[0][1] = kR[1][0] = 0.0; - kR[0][2] = kR[2][0] = 0.0; - kR[1][1] = 1.0 + fT2; - kR[1][2] = kR[2][1] = fT2 * afV[2]; - kR[2][2] = 1.0 + fT2 * afV[2] * afV[2]; - } else { - kR = Matrix3::identity(); - } - - // map second column to (*,*,0) - fLength = sqrt(kA[1][1] * kA[1][1] + kA[2][1] * kA[2][1]); - - if ( fLength > 0.0 ) { - fSign = (kA[1][1] > 0.0 ? 1.0 : -1.0); - fT1 = kA[1][1] + fSign * fLength; - afV[2] = kA[2][1] / fT1; - - fT2 = -2.0 / (1.0 + afV[2] * afV[2]); - afW[1] = fT2 * (kA[1][1] + kA[2][1] * afV[2]); - afW[2] = fT2 * (kA[1][2] + kA[2][2] * afV[2]); - kA[1][1] += afW[1]; - kA[1][2] += afW[2]; - kA[2][2] += afV[2] * afW[2]; - - float fA = 1.0 + fT2; - float fB = fT2 * afV[2]; - float fC = 1.0 + fB * afV[2]; - - if ( bIdentity ) { - kL[0][0] = 1.0; - kL[0][1] = kL[1][0] = 0.0; - kL[0][2] = kL[2][0] = 0.0; - kL[1][1] = fA; - kL[1][2] = kL[2][1] = fB; - kL[2][2] = fC; - } else { - for (int iRow = 0; iRow < 3; iRow++) { - float fTmp0 = kL[iRow][1]; - float fTmp1 = kL[iRow][2]; - kL[iRow][1] = fA * fTmp0 + fB * fTmp1; - kL[iRow][2] = fB * fTmp0 + fC * fTmp1; - } - } - } -} - -//---------------------------------------------------------------------------- -void Matrix3::golubKahanStep (Matrix3& kA, Matrix3& kL, - Matrix3& kR) { - float fT11 = kA[0][1] * kA[0][1] + kA[1][1] * kA[1][1]; - float fT22 = kA[1][2] * kA[1][2] + kA[2][2] * kA[2][2]; - float fT12 = kA[1][1] * kA[1][2]; - float fTrace = fT11 + fT22; - float fDiff = fT11 - fT22; - float fDiscr = sqrt(fDiff * fDiff + 4.0 * fT12 * fT12); - float fRoot1 = 0.5 * (fTrace + fDiscr); - float fRoot2 = 0.5 * (fTrace - fDiscr); - - // adjust right - float fY = kA[0][0] - (G3D::abs(fRoot1 - fT22) <= - G3D::abs(fRoot2 - fT22) ? fRoot1 : fRoot2); - float fZ = kA[0][1]; - float fInvLength = 1.0 / sqrt(fY * fY + fZ * fZ); - float fSin = fZ * fInvLength; - float fCos = -fY * fInvLength; - - float fTmp0 = kA[0][0]; - float fTmp1 = kA[0][1]; - kA[0][0] = fCos * fTmp0 - fSin * fTmp1; - kA[0][1] = fSin * fTmp0 + fCos * fTmp1; - kA[1][0] = -fSin * kA[1][1]; - kA[1][1] *= fCos; - - int iRow; - - for (iRow = 0; iRow < 3; iRow++) { - fTmp0 = kR[0][iRow]; - fTmp1 = kR[1][iRow]; - kR[0][iRow] = fCos * fTmp0 - fSin * fTmp1; - kR[1][iRow] = fSin * fTmp0 + fCos * fTmp1; - } - - // adjust left - fY = kA[0][0]; - - fZ = kA[1][0]; - - fInvLength = 1.0 / sqrt(fY * fY + fZ * fZ); - - fSin = fZ * fInvLength; - - fCos = -fY * fInvLength; - - kA[0][0] = fCos * kA[0][0] - fSin * kA[1][0]; - - fTmp0 = kA[0][1]; - - fTmp1 = kA[1][1]; - - kA[0][1] = fCos * fTmp0 - fSin * fTmp1; - - kA[1][1] = fSin * fTmp0 + fCos * fTmp1; - - kA[0][2] = -fSin * kA[1][2]; - - kA[1][2] *= fCos; - - int iCol; - - for (iCol = 0; iCol < 3; iCol++) { - fTmp0 = kL[iCol][0]; - fTmp1 = kL[iCol][1]; - kL[iCol][0] = fCos * fTmp0 - fSin * fTmp1; - kL[iCol][1] = fSin * fTmp0 + fCos * fTmp1; - } - - // adjust right - fY = kA[0][1]; - - fZ = kA[0][2]; - - fInvLength = 1.0 / sqrt(fY * fY + fZ * fZ); - - fSin = fZ * fInvLength; - - fCos = -fY * fInvLength; - - kA[0][1] = fCos * kA[0][1] - fSin * kA[0][2]; - - fTmp0 = kA[1][1]; - - fTmp1 = kA[1][2]; - - kA[1][1] = fCos * fTmp0 - fSin * fTmp1; - - kA[1][2] = fSin * fTmp0 + fCos * fTmp1; - - kA[2][1] = -fSin * kA[2][2]; - - kA[2][2] *= fCos; - - for (iRow = 0; iRow < 3; iRow++) { - fTmp0 = kR[1][iRow]; - fTmp1 = kR[2][iRow]; - kR[1][iRow] = fCos * fTmp0 - fSin * fTmp1; - kR[2][iRow] = fSin * fTmp0 + fCos * fTmp1; - } - - // adjust left - fY = kA[1][1]; - - fZ = kA[2][1]; - - fInvLength = 1.0 / sqrt(fY * fY + fZ * fZ); - - fSin = fZ * fInvLength; - - fCos = -fY * fInvLength; - - kA[1][1] = fCos * kA[1][1] - fSin * kA[2][1]; - - fTmp0 = kA[1][2]; - - fTmp1 = kA[2][2]; - - kA[1][2] = fCos * fTmp0 - fSin * fTmp1; - - kA[2][2] = fSin * fTmp0 + fCos * fTmp1; - - for (iCol = 0; iCol < 3; iCol++) { - fTmp0 = kL[iCol][1]; - fTmp1 = kL[iCol][2]; - kL[iCol][1] = fCos * fTmp0 - fSin * fTmp1; - kL[iCol][2] = fSin * fTmp0 + fCos * fTmp1; - } -} - -//---------------------------------------------------------------------------- -void Matrix3::singularValueDecomposition (Matrix3& kL, Vector3& kS, - Matrix3& kR) const { - int iRow, iCol; - - Matrix3 kA = *this; - bidiagonalize(kA, kL, kR); - - for (int i = 0; i < ms_iSvdMaxIterations; i++) { - float fTmp, fTmp0, fTmp1; - float fSin0, fCos0, fTan0; - float fSin1, fCos1, fTan1; - - bool bTest1 = (G3D::abs(kA[0][1]) <= - ms_fSvdEpsilon * (G3D::abs(kA[0][0]) + G3D::abs(kA[1][1]))); - bool bTest2 = (G3D::abs(kA[1][2]) <= - ms_fSvdEpsilon * (G3D::abs(kA[1][1]) + G3D::abs(kA[2][2]))); - - if ( bTest1 ) { - if ( bTest2 ) { - kS[0] = kA[0][0]; - kS[1] = kA[1][1]; - kS[2] = kA[2][2]; - break; - } else { - // 2x2 closed form factorization - fTmp = (kA[1][1] * kA[1][1] - kA[2][2] * kA[2][2] + - kA[1][2] * kA[1][2]) / (kA[1][2] * kA[2][2]); - fTan0 = 0.5 * (fTmp + sqrt(fTmp * fTmp + 4.0)); - fCos0 = 1.0 / sqrt(1.0 + fTan0 * fTan0); - fSin0 = fTan0 * fCos0; - - for (iCol = 0; iCol < 3; iCol++) { - fTmp0 = kL[iCol][1]; - fTmp1 = kL[iCol][2]; - kL[iCol][1] = fCos0 * fTmp0 - fSin0 * fTmp1; - kL[iCol][2] = fSin0 * fTmp0 + fCos0 * fTmp1; - } - - fTan1 = (kA[1][2] - kA[2][2] * fTan0) / kA[1][1]; - fCos1 = 1.0 / sqrt(1.0 + fTan1 * fTan1); - fSin1 = -fTan1 * fCos1; - - for (iRow = 0; iRow < 3; iRow++) { - fTmp0 = kR[1][iRow]; - fTmp1 = kR[2][iRow]; - kR[1][iRow] = fCos1 * fTmp0 - fSin1 * fTmp1; - kR[2][iRow] = fSin1 * fTmp0 + fCos1 * fTmp1; - } - - kS[0] = kA[0][0]; - kS[1] = fCos0 * fCos1 * kA[1][1] - - fSin1 * (fCos0 * kA[1][2] - fSin0 * kA[2][2]); - kS[2] = fSin0 * fSin1 * kA[1][1] + - fCos1 * (fSin0 * kA[1][2] + fCos0 * kA[2][2]); - break; - } - } else { - if ( bTest2 ) { - // 2x2 closed form factorization - fTmp = (kA[0][0] * kA[0][0] + kA[1][1] * kA[1][1] - - kA[0][1] * kA[0][1]) / (kA[0][1] * kA[1][1]); - fTan0 = 0.5 * ( -fTmp + sqrt(fTmp * fTmp + 4.0)); - fCos0 = 1.0 / sqrt(1.0 + fTan0 * fTan0); - fSin0 = fTan0 * fCos0; - - for (iCol = 0; iCol < 3; iCol++) { - fTmp0 = kL[iCol][0]; - fTmp1 = kL[iCol][1]; - kL[iCol][0] = fCos0 * fTmp0 - fSin0 * fTmp1; - kL[iCol][1] = fSin0 * fTmp0 + fCos0 * fTmp1; - } - - fTan1 = (kA[0][1] - kA[1][1] * fTan0) / kA[0][0]; - fCos1 = 1.0 / sqrt(1.0 + fTan1 * fTan1); - fSin1 = -fTan1 * fCos1; - - for (iRow = 0; iRow < 3; iRow++) { - fTmp0 = kR[0][iRow]; - fTmp1 = kR[1][iRow]; - kR[0][iRow] = fCos1 * fTmp0 - fSin1 * fTmp1; - kR[1][iRow] = fSin1 * fTmp0 + fCos1 * fTmp1; - } - - kS[0] = fCos0 * fCos1 * kA[0][0] - - fSin1 * (fCos0 * kA[0][1] - fSin0 * kA[1][1]); - kS[1] = fSin0 * fSin1 * kA[0][0] + - fCos1 * (fSin0 * kA[0][1] + fCos0 * kA[1][1]); - kS[2] = kA[2][2]; - break; - } else { - golubKahanStep(kA, kL, kR); - } - } - } - - // positize diagonal - for (iRow = 0; iRow < 3; iRow++) { - if ( kS[iRow] < 0.0 ) { - kS[iRow] = -kS[iRow]; - - for (iCol = 0; iCol < 3; iCol++) - kR[iRow][iCol] = -kR[iRow][iCol]; - } - } -} - -//---------------------------------------------------------------------------- -void Matrix3::singularValueComposition (const Matrix3& kL, - const Vector3& kS, const Matrix3& kR) { - int iRow, iCol; - Matrix3 kTmp; - - // product S*R - for (iRow = 0; iRow < 3; iRow++) { - for (iCol = 0; iCol < 3; iCol++) - kTmp[iRow][iCol] = kS[iRow] * kR[iRow][iCol]; - } - - // product L*S*R - for (iRow = 0; iRow < 3; iRow++) { - for (iCol = 0; iCol < 3; iCol++) { - elt[iRow][iCol] = 0.0; - - for (int iMid = 0; iMid < 3; iMid++) - elt[iRow][iCol] += kL[iRow][iMid] * kTmp[iMid][iCol]; - } - } -} - -//---------------------------------------------------------------------------- -void Matrix3::orthonormalize () { - // Algorithm uses Gram-Schmidt orthogonalization. If 'this' matrix is - // M = [m0|m1|m2], then orthonormal output matrix is Q = [q0|q1|q2], - // - // q0 = m0/|m0| - // q1 = (m1-(q0*m1)q0)/|m1-(q0*m1)q0| - // q2 = (m2-(q0*m2)q0-(q1*m2)q1)/|m2-(q0*m2)q0-(q1*m2)q1| - // - // where |V| indicates length of vector V and A*B indicates dot - // product of vectors A and B. - - // compute q0 - float fInvLength = 1.0 / sqrt(elt[0][0] * elt[0][0] - + elt[1][0] * elt[1][0] + - elt[2][0] * elt[2][0]); - - elt[0][0] *= fInvLength; - elt[1][0] *= fInvLength; - elt[2][0] *= fInvLength; - - // compute q1 - float fDot0 = - elt[0][0] * elt[0][1] + - elt[1][0] * elt[1][1] + - elt[2][0] * elt[2][1]; - - elt[0][1] -= fDot0 * elt[0][0]; - elt[1][1] -= fDot0 * elt[1][0]; - elt[2][1] -= fDot0 * elt[2][0]; - - fInvLength = 1.0 / sqrt(elt[0][1] * elt[0][1] + - elt[1][1] * elt[1][1] + - elt[2][1] * elt[2][1]); - - elt[0][1] *= fInvLength; - elt[1][1] *= fInvLength; - elt[2][1] *= fInvLength; - - // compute q2 - float fDot1 = - elt[0][1] * elt[0][2] + - elt[1][1] * elt[1][2] + - elt[2][1] * elt[2][2]; - - fDot0 = - elt[0][0] * elt[0][2] + - elt[1][0] * elt[1][2] + - elt[2][0] * elt[2][2]; - - elt[0][2] -= fDot0 * elt[0][0] + fDot1 * elt[0][1]; - elt[1][2] -= fDot0 * elt[1][0] + fDot1 * elt[1][1]; - elt[2][2] -= fDot0 * elt[2][0] + fDot1 * elt[2][1]; - - fInvLength = 1.0 / sqrt(elt[0][2] * elt[0][2] + - elt[1][2] * elt[1][2] + - elt[2][2] * elt[2][2]); - - elt[0][2] *= fInvLength; - elt[1][2] *= fInvLength; - elt[2][2] *= fInvLength; -} - -//---------------------------------------------------------------------------- -void Matrix3::qDUDecomposition (Matrix3& kQ, - Vector3& kD, Vector3& kU) const { - // Factor M = QR = QDU where Q is orthogonal, D is diagonal, - // and U is upper triangular with ones on its diagonal. Algorithm uses - // Gram-Schmidt orthogonalization (the QR algorithm). - // - // If M = [ m0 | m1 | m2 ] and Q = [ q0 | q1 | q2 ], then - // - // q0 = m0/|m0| - // q1 = (m1-(q0*m1)q0)/|m1-(q0*m1)q0| - // q2 = (m2-(q0*m2)q0-(q1*m2)q1)/|m2-(q0*m2)q0-(q1*m2)q1| - // - // where |V| indicates length of vector V and A*B indicates dot - // product of vectors A and B. The matrix R has entries - // - // r00 = q0*m0 r01 = q0*m1 r02 = q0*m2 - // r10 = 0 r11 = q1*m1 r12 = q1*m2 - // r20 = 0 r21 = 0 r22 = q2*m2 - // - // so D = diag(r00,r11,r22) and U has entries u01 = r01/r00, - // u02 = r02/r00, and u12 = r12/r11. - - // Q = rotation - // D = scaling - // U = shear - - // D stores the three diagonal entries r00, r11, r22 - // U stores the entries U[0] = u01, U[1] = u02, U[2] = u12 - - // build orthogonal matrix Q - float fInvLength = 1.0 / sqrt(elt[0][0] * elt[0][0] - + elt[1][0] * elt[1][0] + - elt[2][0] * elt[2][0]); - kQ[0][0] = elt[0][0] * fInvLength; - kQ[1][0] = elt[1][0] * fInvLength; - kQ[2][0] = elt[2][0] * fInvLength; - - float fDot = kQ[0][0] * elt[0][1] + kQ[1][0] * elt[1][1] + - kQ[2][0] * elt[2][1]; - kQ[0][1] = elt[0][1] - fDot * kQ[0][0]; - kQ[1][1] = elt[1][1] - fDot * kQ[1][0]; - kQ[2][1] = elt[2][1] - fDot * kQ[2][0]; - fInvLength = 1.0 / sqrt(kQ[0][1] * kQ[0][1] + kQ[1][1] * kQ[1][1] + - kQ[2][1] * kQ[2][1]); - kQ[0][1] *= fInvLength; - kQ[1][1] *= fInvLength; - kQ[2][1] *= fInvLength; - - fDot = kQ[0][0] * elt[0][2] + kQ[1][0] * elt[1][2] + - kQ[2][0] * elt[2][2]; - kQ[0][2] = elt[0][2] - fDot * kQ[0][0]; - kQ[1][2] = elt[1][2] - fDot * kQ[1][0]; - kQ[2][2] = elt[2][2] - fDot * kQ[2][0]; - fDot = kQ[0][1] * elt[0][2] + kQ[1][1] * elt[1][2] + - kQ[2][1] * elt[2][2]; - kQ[0][2] -= fDot * kQ[0][1]; - kQ[1][2] -= fDot * kQ[1][1]; - kQ[2][2] -= fDot * kQ[2][1]; - fInvLength = 1.0 / sqrt(kQ[0][2] * kQ[0][2] + kQ[1][2] * kQ[1][2] + - kQ[2][2] * kQ[2][2]); - kQ[0][2] *= fInvLength; - kQ[1][2] *= fInvLength; - kQ[2][2] *= fInvLength; - - // guarantee that orthogonal matrix has determinant 1 (no reflections) - float fDet = kQ[0][0] * kQ[1][1] * kQ[2][2] + kQ[0][1] * kQ[1][2] * kQ[2][0] + - kQ[0][2] * kQ[1][0] * kQ[2][1] - kQ[0][2] * kQ[1][1] * kQ[2][0] - - kQ[0][1] * kQ[1][0] * kQ[2][2] - kQ[0][0] * kQ[1][2] * kQ[2][1]; - - if ( fDet < 0.0 ) { - for (int iRow = 0; iRow < 3; iRow++) - for (int iCol = 0; iCol < 3; iCol++) - kQ[iRow][iCol] = -kQ[iRow][iCol]; - } - - // build "right" matrix R - Matrix3 kR; - - kR[0][0] = kQ[0][0] * elt[0][0] + kQ[1][0] * elt[1][0] + - kQ[2][0] * elt[2][0]; - - kR[0][1] = kQ[0][0] * elt[0][1] + kQ[1][0] * elt[1][1] + - kQ[2][0] * elt[2][1]; - - kR[1][1] = kQ[0][1] * elt[0][1] + kQ[1][1] * elt[1][1] + - kQ[2][1] * elt[2][1]; - - kR[0][2] = kQ[0][0] * elt[0][2] + kQ[1][0] * elt[1][2] + - kQ[2][0] * elt[2][2]; - - kR[1][2] = kQ[0][1] * elt[0][2] + kQ[1][1] * elt[1][2] + - kQ[2][1] * elt[2][2]; - - kR[2][2] = kQ[0][2] * elt[0][2] + kQ[1][2] * elt[1][2] + - kQ[2][2] * elt[2][2]; - - // the scaling component - kD[0] = kR[0][0]; - - kD[1] = kR[1][1]; - - kD[2] = kR[2][2]; - - // the shear component - float fInvD0 = 1.0 / kD[0]; - - kU[0] = kR[0][1] * fInvD0; - - kU[1] = kR[0][2] * fInvD0; - - kU[2] = kR[1][2] / kD[1]; -} - -//---------------------------------------------------------------------------- -float Matrix3::maxCubicRoot (float afCoeff[3]) { - // Spectral norm is for A^T*A, so characteristic polynomial - // P(x) = c[0]+c[1]*x+c[2]*x^2+x^3 has three positive float roots. - // This yields the assertions c[0] < 0 and c[2]*c[2] >= 3*c[1]. - - // quick out for uniform scale (triple root) - const float fOneThird = 1.0f / 3.0f; - const float fEpsilon = 1e-06f; - float fDiscr = afCoeff[2] * afCoeff[2] - 3.0f * afCoeff[1]; - - if ( fDiscr <= fEpsilon ) - return -fOneThird*afCoeff[2]; - - // Compute an upper bound on roots of P(x). This assumes that A^T*A - // has been scaled by its largest entry. - float fX = 1.0f; - - float fPoly = afCoeff[0] + fX * (afCoeff[1] + fX * (afCoeff[2] + fX)); - - if ( fPoly < 0.0f ) { - // uses a matrix norm to find an upper bound on maximum root - fX = G3D::abs(afCoeff[0]); - float fTmp = 1.0 + G3D::abs(afCoeff[1]); - - if ( fTmp > fX ) - fX = fTmp; - - fTmp = 1.0 + G3D::abs(afCoeff[2]); - - if ( fTmp > fX ) - fX = fTmp; - } - - // Newton's method to find root - float fTwoC2 = 2.0f * afCoeff[2]; - - for (int i = 0; i < 16; i++) { - fPoly = afCoeff[0] + fX * (afCoeff[1] + fX * (afCoeff[2] + fX)); - - if ( G3D::abs(fPoly) <= fEpsilon ) - return fX; - - float fDeriv = afCoeff[1] + fX * (fTwoC2 + 3.0f * fX); - - fX -= fPoly / fDeriv; - } - - return fX; -} - -//---------------------------------------------------------------------------- -float Matrix3::spectralNorm () const { - Matrix3 kP; - int iRow, iCol; - float fPmax = 0.0; - - for (iRow = 0; iRow < 3; iRow++) { - for (iCol = 0; iCol < 3; iCol++) { - kP[iRow][iCol] = 0.0; - - for (int iMid = 0; iMid < 3; iMid++) { - kP[iRow][iCol] += - elt[iMid][iRow] * elt[iMid][iCol]; - } - - if ( kP[iRow][iCol] > fPmax ) - fPmax = kP[iRow][iCol]; - } - } - - float fInvPmax = 1.0 / fPmax; - - for (iRow = 0; iRow < 3; iRow++) { - for (iCol = 0; iCol < 3; iCol++) - kP[iRow][iCol] *= fInvPmax; - } - - float afCoeff[3]; - afCoeff[0] = -(kP[0][0] * (kP[1][1] * kP[2][2] - kP[1][2] * kP[2][1]) + - kP[0][1] * (kP[2][0] * kP[1][2] - kP[1][0] * kP[2][2]) + - kP[0][2] * (kP[1][0] * kP[2][1] - kP[2][0] * kP[1][1])); - afCoeff[1] = kP[0][0] * kP[1][1] - kP[0][1] * kP[1][0] + - kP[0][0] * kP[2][2] - kP[0][2] * kP[2][0] + - kP[1][1] * kP[2][2] - kP[1][2] * kP[2][1]; - afCoeff[2] = -(kP[0][0] + kP[1][1] + kP[2][2]); - - float fRoot = maxCubicRoot(afCoeff); - float fNorm = sqrt(fPmax * fRoot); - return fNorm; -} - -//---------------------------------------------------------------------------- -void Matrix3::toAxisAngle (Vector3& rkAxis, float& rfRadians) const { - // - // Let (x,y,z) be the unit-length axis and let A be an angle of rotation. - // The rotation matrix is R = I + sin(A)*P + (1-cos(A))*P^2 (Rodrigues' formula) where - // I is the identity and - // - // +- -+ - // P = | 0 -z +y | - // | +z 0 -x | - // | -y +x 0 | - // +- -+ - // - // If A > 0, R represents a counterclockwise rotation about the axis in - // the sense of looking from the tip of the axis vector towards the - // origin. Some algebra will show that - // - // cos(A) = (trace(R)-1)/2 and R - R^t = 2*sin(A)*P - // - // In the event that A = pi, R-R^t = 0 which prevents us from extracting - // the axis through P. Instead note that R = I+2*P^2 when A = pi, so - // P^2 = (R-I)/2. The diagonal entries of P^2 are x^2-1, y^2-1, and - // z^2-1. We can solve these for axis (x,y,z). Because the angle is pi, - // it does not matter which sign you choose on the square roots. - - float fTrace = elt[0][0] + elt[1][1] + elt[2][2]; - float fCos = 0.5f * (fTrace - 1.0f); - rfRadians = G3D::aCos(fCos); // in [0,PI] - - if ( rfRadians > 0.0 ) { - if ( rfRadians < pi() ) { - rkAxis.x = elt[2][1] - elt[1][2]; - rkAxis.y = elt[0][2] - elt[2][0]; - rkAxis.z = elt[1][0] - elt[0][1]; - rkAxis.unitize(); - } else { - // angle is PI - float fHalfInverse; - - if ( elt[0][0] >= elt[1][1] ) { - // r00 >= r11 - if ( elt[0][0] >= elt[2][2] ) { - // r00 is maximum diagonal term - rkAxis.x = 0.5 * sqrt(elt[0][0] - - elt[1][1] - elt[2][2] + 1.0); - fHalfInverse = 0.5 / rkAxis.x; - rkAxis.y = fHalfInverse * elt[0][1]; - rkAxis.z = fHalfInverse * elt[0][2]; - } else { - // r22 is maximum diagonal term - rkAxis.z = 0.5 * sqrt(elt[2][2] - - elt[0][0] - elt[1][1] + 1.0); - fHalfInverse = 0.5 / rkAxis.z; - rkAxis.x = fHalfInverse * elt[0][2]; - rkAxis.y = fHalfInverse * elt[1][2]; - } - } else { - // r11 > r00 - if ( elt[1][1] >= elt[2][2] ) { - // r11 is maximum diagonal term - rkAxis.y = 0.5 * sqrt(elt[1][1] - - elt[0][0] - elt[2][2] + 1.0); - fHalfInverse = 0.5 / rkAxis.y; - rkAxis.x = fHalfInverse * elt[0][1]; - rkAxis.z = fHalfInverse * elt[1][2]; - } else { - // r22 is maximum diagonal term - rkAxis.z = 0.5 * sqrt(elt[2][2] - - elt[0][0] - elt[1][1] + 1.0); - fHalfInverse = 0.5 / rkAxis.z; - rkAxis.x = fHalfInverse * elt[0][2]; - rkAxis.y = fHalfInverse * elt[1][2]; - } - } - } - } else { - // The angle is 0 and the matrix is the identity. Any axis will - // work, so just use the x-axis. - rkAxis.x = 1.0; - rkAxis.y = 0.0; - rkAxis.z = 0.0; - } -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromAxisAngle (const Vector3& _axis, float fRadians) { - Vector3 axis = _axis.direction(); - - Matrix3 m; - float fCos = cos(fRadians); - float fSin = sin(fRadians); - float fOneMinusCos = 1.0 - fCos; - float fX2 = square(axis.x); - float fY2 = square(axis.y); - float fZ2 = square(axis.z); - float fXYM = axis.x * axis.y * fOneMinusCos; - float fXZM = axis.x * axis.z * fOneMinusCos; - float fYZM = axis.y * axis.z * fOneMinusCos; - float fXSin = axis.x * fSin; - float fYSin = axis.y * fSin; - float fZSin = axis.z * fSin; - - m.elt[0][0] = fX2 * fOneMinusCos + fCos; - m.elt[0][1] = fXYM - fZSin; - m.elt[0][2] = fXZM + fYSin; - - m.elt[1][0] = fXYM + fZSin; - m.elt[1][1] = fY2 * fOneMinusCos + fCos; - m.elt[1][2] = fYZM - fXSin; - - m.elt[2][0] = fXZM - fYSin; - m.elt[2][1] = fYZM + fXSin; - m.elt[2][2] = fZ2 * fOneMinusCos + fCos; - - return m; -} - -//---------------------------------------------------------------------------- -bool Matrix3::toEulerAnglesXYZ (float& rfXAngle, float& rfYAngle, - float& rfZAngle) const { - // rot = cy*cz -cy*sz sy - // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx - // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy - - if ( elt[0][2] < 1.0f ) { - if ( elt[0][2] > -1.0f ) { - rfXAngle = G3D::aTan2( -elt[1][2], elt[2][2]); - rfYAngle = (float) G3D::aSin(elt[0][2]); - rfZAngle = G3D::aTan2( -elt[0][1], elt[0][0]); - return true; - } else { - // WARNING. Not unique. XA - ZA = -atan2(r10,r11) - rfXAngle = -G3D::aTan2(elt[1][0], elt[1][1]); - rfYAngle = -(float)halfPi(); - rfZAngle = 0.0f; - return false; - } - } else { - // WARNING. Not unique. XAngle + ZAngle = atan2(r10,r11) - rfXAngle = G3D::aTan2(elt[1][0], elt[1][1]); - rfYAngle = (float)halfPi(); - rfZAngle = 0.0f; - return false; - } -} - -//---------------------------------------------------------------------------- -bool Matrix3::toEulerAnglesXZY (float& rfXAngle, float& rfZAngle, - float& rfYAngle) const { - // rot = cy*cz -sz cz*sy - // sx*sy+cx*cy*sz cx*cz -cy*sx+cx*sy*sz - // -cx*sy+cy*sx*sz cz*sx cx*cy+sx*sy*sz - - if ( elt[0][1] < 1.0f ) { - if ( elt[0][1] > -1.0f ) { - rfXAngle = G3D::aTan2(elt[2][1], elt[1][1]); - rfZAngle = (float) asin( -elt[0][1]); - rfYAngle = G3D::aTan2(elt[0][2], elt[0][0]); - return true; - } else { - // WARNING. Not unique. XA - YA = atan2(r20,r22) - rfXAngle = G3D::aTan2(elt[2][0], elt[2][2]); - rfZAngle = (float)halfPi(); - rfYAngle = 0.0; - return false; - } - } else { - // WARNING. Not unique. XA + YA = atan2(-r20,r22) - rfXAngle = G3D::aTan2( -elt[2][0], elt[2][2]); - rfZAngle = -(float)halfPi(); - rfYAngle = 0.0f; - return false; - } -} - -//---------------------------------------------------------------------------- -bool Matrix3::toEulerAnglesYXZ (float& rfYAngle, float& rfXAngle, - float& rfZAngle) const { - // rot = cy*cz+sx*sy*sz cz*sx*sy-cy*sz cx*sy - // cx*sz cx*cz -sx - // -cz*sy+cy*sx*sz cy*cz*sx+sy*sz cx*cy - - if ( elt[1][2] < 1.0 ) { - if ( elt[1][2] > -1.0 ) { - rfYAngle = G3D::aTan2(elt[0][2], elt[2][2]); - rfXAngle = (float) asin( -elt[1][2]); - rfZAngle = G3D::aTan2(elt[1][0], elt[1][1]); - return true; - } else { - // WARNING. Not unique. YA - ZA = atan2(r01,r00) - rfYAngle = G3D::aTan2(elt[0][1], elt[0][0]); - rfXAngle = (float)halfPi(); - rfZAngle = 0.0; - return false; - } - } else { - // WARNING. Not unique. YA + ZA = atan2(-r01,r00) - rfYAngle = G3D::aTan2( -elt[0][1], elt[0][0]); - rfXAngle = -(float)halfPi(); - rfZAngle = 0.0f; - return false; - } -} - -//---------------------------------------------------------------------------- -bool Matrix3::toEulerAnglesYZX (float& rfYAngle, float& rfZAngle, - float& rfXAngle) const { - // rot = cy*cz sx*sy-cx*cy*sz cx*sy+cy*sx*sz - // sz cx*cz -cz*sx - // -cz*sy cy*sx+cx*sy*sz cx*cy-sx*sy*sz - - if ( elt[1][0] < 1.0 ) { - if ( elt[1][0] > -1.0 ) { - rfYAngle = G3D::aTan2( -elt[2][0], elt[0][0]); - rfZAngle = (float) asin(elt[1][0]); - rfXAngle = G3D::aTan2( -elt[1][2], elt[1][1]); - return true; - } else { - // WARNING. Not unique. YA - XA = -atan2(r21,r22); - rfYAngle = -G3D::aTan2(elt[2][1], elt[2][2]); - rfZAngle = -(float)halfPi(); - rfXAngle = 0.0; - return false; - } - } else { - // WARNING. Not unique. YA + XA = atan2(r21,r22) - rfYAngle = G3D::aTan2(elt[2][1], elt[2][2]); - rfZAngle = (float)halfPi(); - rfXAngle = 0.0f; - return false; - } -} - -//---------------------------------------------------------------------------- -bool Matrix3::toEulerAnglesZXY (float& rfZAngle, float& rfXAngle, - float& rfYAngle) const { - // rot = cy*cz-sx*sy*sz -cx*sz cz*sy+cy*sx*sz - // cz*sx*sy+cy*sz cx*cz -cy*cz*sx+sy*sz - // -cx*sy sx cx*cy - - if ( elt[2][1] < 1.0 ) { - if ( elt[2][1] > -1.0 ) { - rfZAngle = G3D::aTan2( -elt[0][1], elt[1][1]); - rfXAngle = (float) asin(elt[2][1]); - rfYAngle = G3D::aTan2( -elt[2][0], elt[2][2]); - return true; - } else { - // WARNING. Not unique. ZA - YA = -atan(r02,r00) - rfZAngle = -G3D::aTan2(elt[0][2], elt[0][0]); - rfXAngle = -(float)halfPi(); - rfYAngle = 0.0f; - return false; - } - } else { - // WARNING. Not unique. ZA + YA = atan2(r02,r00) - rfZAngle = G3D::aTan2(elt[0][2], elt[0][0]); - rfXAngle = (float)halfPi(); - rfYAngle = 0.0f; - return false; - } -} - -//---------------------------------------------------------------------------- -bool Matrix3::toEulerAnglesZYX (float& rfZAngle, float& rfYAngle, - float& rfXAngle) const { - // rot = cy*cz cz*sx*sy-cx*sz cx*cz*sy+sx*sz - // cy*sz cx*cz+sx*sy*sz -cz*sx+cx*sy*sz - // -sy cy*sx cx*cy - - if ( elt[2][0] < 1.0 ) { - if ( elt[2][0] > -1.0 ) { - rfZAngle = atan2f(elt[1][0], elt[0][0]); - rfYAngle = asinf(-(double)elt[2][1]); - rfXAngle = atan2f(elt[2][1], elt[2][2]); - return true; - } else { - // WARNING. Not unique. ZA - XA = -atan2(r01,r02) - rfZAngle = -G3D::aTan2(elt[0][1], elt[0][2]); - rfYAngle = (float)halfPi(); - rfXAngle = 0.0f; - return false; - } - } else { - // WARNING. Not unique. ZA + XA = atan2(-r01,-r02) - rfZAngle = G3D::aTan2( -elt[0][1], -elt[0][2]); - rfYAngle = -(float)halfPi(); - rfXAngle = 0.0f; - return false; - } -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromEulerAnglesXYZ (float fYAngle, float fPAngle, - float fRAngle) { - float fCos, fSin; - - fCos = cosf(fYAngle); - fSin = sinf(fYAngle); - Matrix3 kXMat(1.0f, 0.0f, 0.0f, 0.0f, fCos, -fSin, 0.0, fSin, fCos); - - fCos = cosf(fPAngle); - fSin = sinf(fPAngle); - Matrix3 kYMat(fCos, 0.0f, fSin, 0.0f, 1.0f, 0.0f, -fSin, 0.0f, fCos); - - fCos = cosf(fRAngle); - fSin = sinf(fRAngle); - Matrix3 kZMat(fCos, -fSin, 0.0f, fSin, fCos, 0.0f, 0.0f, 0.0f, 1.0f); - - return kXMat * (kYMat * kZMat); -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromEulerAnglesXZY (float fYAngle, float fPAngle, - float fRAngle) { - - float fCos, fSin; - - fCos = cosf(fYAngle); - fSin = sinf(fYAngle); - Matrix3 kXMat(1.0, 0.0, 0.0, 0.0, fCos, -fSin, 0.0, fSin, fCos); - - fCos = cosf(fPAngle); - fSin = sinf(fPAngle); - Matrix3 kZMat(fCos, -fSin, 0.0, fSin, fCos, 0.0, 0.0, 0.0, 1.0); - - fCos = cosf(fRAngle); - fSin = sinf(fRAngle); - Matrix3 kYMat(fCos, 0.0, fSin, 0.0, 1.0, 0.0, -fSin, 0.0, fCos); - - return kXMat * (kZMat * kYMat); -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromEulerAnglesYXZ( - float fYAngle, - float fPAngle, - float fRAngle) { - - float fCos, fSin; - - fCos = cos(fYAngle); - fSin = sin(fYAngle); - Matrix3 kYMat(fCos, 0.0f, fSin, 0.0f, 1.0f, 0.0f, -fSin, 0.0f, fCos); - - fCos = cos(fPAngle); - fSin = sin(fPAngle); - Matrix3 kXMat(1.0f, 0.0f, 0.0f, 0.0f, fCos, -fSin, 0.0f, fSin, fCos); - - fCos = cos(fRAngle); - fSin = sin(fRAngle); - Matrix3 kZMat(fCos, -fSin, 0.0f, fSin, fCos, 0.0f, 0.0f, 0.0f, 1.0f); - - return kYMat * (kXMat * kZMat); -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromEulerAnglesYZX( - float fYAngle, - float fPAngle, - float fRAngle) { - - float fCos, fSin; - - fCos = cos(fYAngle); - fSin = sin(fYAngle); - Matrix3 kYMat(fCos, 0.0f, fSin, 0.0f, 1.0f, 0.0f, -fSin, 0.0f, fCos); - - fCos = cos(fPAngle); - fSin = sin(fPAngle); - Matrix3 kZMat(fCos, -fSin, 0.0f, fSin, fCos, 0.0f, 0.0f, 0.0f, 1.0f); - - fCos = cos(fRAngle); - fSin = sin(fRAngle); - Matrix3 kXMat(1.0f, 0.0f, 0.0f, 0.0f, fCos, -fSin, 0.0f, fSin, fCos); - - return kYMat * (kZMat * kXMat); -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromEulerAnglesZXY (float fYAngle, float fPAngle, - float fRAngle) { - float fCos, fSin; - - fCos = cos(fYAngle); - fSin = sin(fYAngle); - Matrix3 kZMat(fCos, -fSin, 0.0, fSin, fCos, 0.0, 0.0, 0.0, 1.0); - - fCos = cos(fPAngle); - fSin = sin(fPAngle); - Matrix3 kXMat(1.0, 0.0, 0.0, 0.0, fCos, -fSin, 0.0, fSin, fCos); - - fCos = cos(fRAngle); - fSin = sin(fRAngle); - Matrix3 kYMat(fCos, 0.0, fSin, 0.0, 1.0, 0.0, -fSin, 0.0, fCos); - - return kZMat * (kXMat * kYMat); -} - -//---------------------------------------------------------------------------- -Matrix3 Matrix3::fromEulerAnglesZYX (float fYAngle, float fPAngle, - float fRAngle) { - float fCos, fSin; - - fCos = cos(fYAngle); - fSin = sin(fYAngle); - Matrix3 kZMat(fCos, -fSin, 0.0, fSin, fCos, 0.0, 0.0, 0.0, 1.0); - - fCos = cos(fPAngle); - fSin = sin(fPAngle); - Matrix3 kYMat(fCos, 0.0, fSin, 0.0, 1.0, 0.0, -fSin, 0.0, fCos); - - fCos = cos(fRAngle); - fSin = sin(fRAngle); - Matrix3 kXMat(1.0, 0.0, 0.0, 0.0, fCos, -fSin, 0.0, fSin, fCos); - - return kZMat * (kYMat * kXMat); -} - -//---------------------------------------------------------------------------- -void Matrix3::tridiagonal (float afDiag[3], float afSubDiag[3]) { - // Householder reduction T = Q^t M Q - // Input: - // mat, symmetric 3x3 matrix M - // Output: - // mat, orthogonal matrix Q - // diag, diagonal entries of T - // subd, subdiagonal entries of T (T is symmetric) - - float fA = elt[0][0]; - float fB = elt[0][1]; - float fC = elt[0][2]; - float fD = elt[1][1]; - float fE = elt[1][2]; - float fF = elt[2][2]; - - afDiag[0] = fA; - afSubDiag[2] = 0.0; - - if ( G3D::abs(fC) >= EPSILON ) { - float fLength = sqrt(fB * fB + fC * fC); - float fInvLength = 1.0 / fLength; - fB *= fInvLength; - fC *= fInvLength; - float fQ = 2.0 * fB * fE + fC * (fF - fD); - afDiag[1] = fD + fC * fQ; - afDiag[2] = fF - fC * fQ; - afSubDiag[0] = fLength; - afSubDiag[1] = fE - fB * fQ; - elt[0][0] = 1.0; - elt[0][1] = 0.0; - elt[0][2] = 0.0; - elt[1][0] = 0.0; - elt[1][1] = fB; - elt[1][2] = fC; - elt[2][0] = 0.0; - elt[2][1] = fC; - elt[2][2] = -fB; - } else { - afDiag[1] = fD; - afDiag[2] = fF; - afSubDiag[0] = fB; - afSubDiag[1] = fE; - elt[0][0] = 1.0; - elt[0][1] = 0.0; - elt[0][2] = 0.0; - elt[1][0] = 0.0; - elt[1][1] = 1.0; - elt[1][2] = 0.0; - elt[2][0] = 0.0; - elt[2][1] = 0.0; - elt[2][2] = 1.0; - } -} - -//---------------------------------------------------------------------------- -bool Matrix3::qLAlgorithm (float afDiag[3], float afSubDiag[3]) { - // QL iteration with implicit shifting to reduce matrix from tridiagonal - // to diagonal - - for (int i0 = 0; i0 < 3; i0++) { - const int iMaxIter = 32; - int iIter; - - for (iIter = 0; iIter < iMaxIter; iIter++) { - int i1; - - for (i1 = i0; i1 <= 1; i1++) { - float fSum = G3D::abs(afDiag[i1]) + - G3D::abs(afDiag[i1 + 1]); - - if ( G3D::abs(afSubDiag[i1]) + fSum == fSum ) - break; - } - - if ( i1 == i0 ) - break; - - float fTmp0 = (afDiag[i0 + 1] - afDiag[i0]) / (2.0 * afSubDiag[i0]); - - float fTmp1 = sqrt(fTmp0 * fTmp0 + 1.0); - - if ( fTmp0 < 0.0 ) - fTmp0 = afDiag[i1] - afDiag[i0] + afSubDiag[i0] / (fTmp0 - fTmp1); - else - fTmp0 = afDiag[i1] - afDiag[i0] + afSubDiag[i0] / (fTmp0 + fTmp1); - - float fSin = 1.0; - - float fCos = 1.0; - - float fTmp2 = 0.0; - - for (int i2 = i1 - 1; i2 >= i0; i2--) { - float fTmp3 = fSin * afSubDiag[i2]; - float fTmp4 = fCos * afSubDiag[i2]; - - if (G3D::abs(fTmp3) >= G3D::abs(fTmp0)) { - fCos = fTmp0 / fTmp3; - fTmp1 = sqrt(fCos * fCos + 1.0); - afSubDiag[i2 + 1] = fTmp3 * fTmp1; - fSin = 1.0 / fTmp1; - fCos *= fSin; - } else { - fSin = fTmp3 / fTmp0; - fTmp1 = sqrt(fSin * fSin + 1.0); - afSubDiag[i2 + 1] = fTmp0 * fTmp1; - fCos = 1.0 / fTmp1; - fSin *= fCos; - } - - fTmp0 = afDiag[i2 + 1] - fTmp2; - fTmp1 = (afDiag[i2] - fTmp0) * fSin + 2.0 * fTmp4 * fCos; - fTmp2 = fSin * fTmp1; - afDiag[i2 + 1] = fTmp0 + fTmp2; - fTmp0 = fCos * fTmp1 - fTmp4; - - for (int iRow = 0; iRow < 3; iRow++) { - fTmp3 = elt[iRow][i2 + 1]; - elt[iRow][i2 + 1] = fSin * elt[iRow][i2] + - fCos * fTmp3; - elt[iRow][i2] = fCos * elt[iRow][i2] - - fSin * fTmp3; - } - } - - afDiag[i0] -= fTmp2; - afSubDiag[i0] = fTmp0; - afSubDiag[i1] = 0.0; - } - - if ( iIter == iMaxIter ) { - // should not get here under normal circumstances - return false; - } - } - - return true; -} - -//---------------------------------------------------------------------------- -void Matrix3::eigenSolveSymmetric (float afEigenvalue[3], - Vector3 akEigenvector[3]) const { - Matrix3 kMatrix = *this; - float afSubDiag[3]; - kMatrix.tridiagonal(afEigenvalue, afSubDiag); - kMatrix.qLAlgorithm(afEigenvalue, afSubDiag); - - for (int i = 0; i < 3; i++) { - akEigenvector[i][0] = kMatrix[0][i]; - akEigenvector[i][1] = kMatrix[1][i]; - akEigenvector[i][2] = kMatrix[2][i]; - } - - // make eigenvectors form a right--handed system - Vector3 kCross = akEigenvector[1].cross(akEigenvector[2]); - - float fDet = akEigenvector[0].dot(kCross); - - if ( fDet < 0.0 ) { - akEigenvector[2][0] = - akEigenvector[2][0]; - akEigenvector[2][1] = - akEigenvector[2][1]; - akEigenvector[2][2] = - akEigenvector[2][2]; - } -} - -//---------------------------------------------------------------------------- -void Matrix3::tensorProduct (const Vector3& rkU, const Vector3& rkV, - Matrix3& rkProduct) { - for (int iRow = 0; iRow < 3; iRow++) { - for (int iCol = 0; iCol < 3; iCol++) { - rkProduct[iRow][iCol] = rkU[iRow] * rkV[iCol]; - } - } -} - -//---------------------------------------------------------------------------- - -// Runs in 52 cycles on AMD, 76 cycles on Intel Centrino -// -// The loop unrolling is necessary for performance. -// I was unable to improve performance further by flattening the matrices -// into float*'s instead of 2D arrays. -// -// -morgan -void Matrix3::_mul(const Matrix3& A, const Matrix3& B, Matrix3& out) { - const float* ARowPtr = A.elt[0]; - float* outRowPtr = out.elt[0]; - outRowPtr[0] = - ARowPtr[0] * B.elt[0][0] + - ARowPtr[1] * B.elt[1][0] + - ARowPtr[2] * B.elt[2][0]; - outRowPtr[1] = - ARowPtr[0] * B.elt[0][1] + - ARowPtr[1] * B.elt[1][1] + - ARowPtr[2] * B.elt[2][1]; - outRowPtr[2] = - ARowPtr[0] * B.elt[0][2] + - ARowPtr[1] * B.elt[1][2] + - ARowPtr[2] * B.elt[2][2]; - - ARowPtr = A.elt[1]; - outRowPtr = out.elt[1]; - - outRowPtr[0] = - ARowPtr[0] * B.elt[0][0] + - ARowPtr[1] * B.elt[1][0] + - ARowPtr[2] * B.elt[2][0]; - outRowPtr[1] = - ARowPtr[0] * B.elt[0][1] + - ARowPtr[1] * B.elt[1][1] + - ARowPtr[2] * B.elt[2][1]; - outRowPtr[2] = - ARowPtr[0] * B.elt[0][2] + - ARowPtr[1] * B.elt[1][2] + - ARowPtr[2] * B.elt[2][2]; - - ARowPtr = A.elt[2]; - outRowPtr = out.elt[2]; - - outRowPtr[0] = - ARowPtr[0] * B.elt[0][0] + - ARowPtr[1] * B.elt[1][0] + - ARowPtr[2] * B.elt[2][0]; - outRowPtr[1] = - ARowPtr[0] * B.elt[0][1] + - ARowPtr[1] * B.elt[1][1] + - ARowPtr[2] * B.elt[2][1]; - outRowPtr[2] = - ARowPtr[0] * B.elt[0][2] + - ARowPtr[1] * B.elt[1][2] + - ARowPtr[2] * B.elt[2][2]; -} - -//---------------------------------------------------------------------------- -void Matrix3::_transpose(const Matrix3& A, Matrix3& out) { - out[0][0] = A.elt[0][0]; - out[0][1] = A.elt[1][0]; - out[0][2] = A.elt[2][0]; - out[1][0] = A.elt[0][1]; - out[1][1] = A.elt[1][1]; - out[1][2] = A.elt[2][1]; - out[2][0] = A.elt[0][2]; - out[2][1] = A.elt[1][2]; - out[2][2] = A.elt[2][2]; -} - -//----------------------------------------------------------------------------- -std::string Matrix3::toString() const { - return G3D::format("[%g, %g, %g; %g, %g, %g; %g, %g, %g]", - elt[0][0], elt[0][1], elt[0][2], - elt[1][0], elt[1][1], elt[1][2], - elt[2][0], elt[2][1], elt[2][2]); -} - - - -} // namespace - diff --git a/externals/g3dlite/G3D.lib/source/Matrix4.cpp b/externals/g3dlite/G3D.lib/source/Matrix4.cpp deleted file mode 100644 index 091af4a9bd5..00000000000 --- a/externals/g3dlite/G3D.lib/source/Matrix4.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/** - @file Matrix4.cpp - - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-10-02 - @edited 2008-07-17 - */ - -#include "G3D/platform.h" -#include "G3D/Matrix4.h" -#include "G3D/Matrix3.h" -#include "G3D/Vector4.h" -#include "G3D/Vector3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/CoordinateFrame.h" -#include "G3D/Rect2D.h" - -namespace G3D { - -const Matrix4& Matrix4::identity() { - static Matrix4 m( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1); - return m; -} - - -const Matrix4& Matrix4::zero() { - static Matrix4 m( - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0); - return m; -} - - -Matrix4::Matrix4(const class CoordinateFrame& cframe) { - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - elt[r][c] = cframe.rotation[r][c]; - } - elt[r][3] = cframe.translation[r]; - } - elt[3][0] = 0.0f; - elt[3][1] = 0.0f; - elt[3][2] = 0.0f; - elt[3][3] = 1.0f; -} - -Matrix4::Matrix4(const Matrix3& upper3x3, const Vector3& lastCol) { - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - elt[r][c] = upper3x3[r][c]; - } - elt[r][3] = lastCol[r]; - } - elt[3][0] = 0.0f; - elt[3][1] = 0.0f; - elt[3][2] = 0.0f; - elt[3][3] = 1.0f; -} - - -Matrix3 Matrix4::upper3x3() const { - return Matrix3(elt[0][0], elt[0][1], elt[0][2], - elt[1][0], elt[1][1], elt[1][2], - elt[2][0], elt[2][1], elt[2][2]); -} - - -Matrix4 Matrix4::orthogonalProjection( - const class Rect2D& rect, - float nearval, - float farval) { - return Matrix4::orthogonalProjection(rect.x0(), rect.x1(), rect.y1(), rect.y0(), nearval, farval); -} - - -Matrix4 Matrix4::orthogonalProjection( - float left, - float right, - float bottom, - float top, - float nearval, - float farval) { - - // Adapted from Mesa. Note that Microsoft (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_8qnj.asp) - // and Linux (http://www.xfree86.org/current/glOrtho.3.html) have different matrices shown in their documentation. - - float x, y, z; - float tx, ty, tz; - - x = 2.0f / (right-left); - y = 2.0f / (top-bottom); - z = -2.0f / (farval-nearval); - tx = -(right+left) / (right-left); - ty = -(top+bottom) / (top-bottom); - tz = -(farval+nearval) / (farval-nearval); - - return - Matrix4( x , 0.0f, 0.0f, tx, - 0.0f, y , 0.0f, ty, - 0.0f, 0.0f, z , tz, - 0.0f, 0.0f, 0.0f, 1.0f); -} - - -Matrix4 Matrix4::perspectiveProjection( - float left, - float right, - float bottom, - float top, - float nearval, - float farval) { - - float x, y, a, b, c, d; - - x = (2.0f*nearval) / (right-left); - y = (2.0f*nearval) / (top-bottom); - a = (right+left) / (right-left); - b = (top+bottom) / (top-bottom); - - if ((float)farval >= (float)inf()) { - // Infinite view frustum - c = -1.0f; - d = -2.0f * nearval; - } else { - c = -(farval+nearval) / (farval-nearval); - d = -(2.0f*farval*nearval) / (farval-nearval); - } - - return Matrix4( - x, 0, a, 0, - 0, y, b, 0, - 0, 0, c, d, - 0, 0, -1, 0); -} - - -Matrix4::Matrix4( - float r1c1, float r1c2, float r1c3, float r1c4, - float r2c1, float r2c2, float r2c3, float r2c4, - float r3c1, float r3c2, float r3c3, float r3c4, - float r4c1, float r4c2, float r4c3, float r4c4) { - elt[0][0] = r1c1; elt[0][1] = r1c2; elt[0][2] = r1c3; elt[0][3] = r1c4; - elt[1][0] = r2c1; elt[1][1] = r2c2; elt[1][2] = r2c3; elt[1][3] = r2c4; - elt[2][0] = r3c1; elt[2][1] = r3c2; elt[2][2] = r3c3; elt[2][3] = r3c4; - elt[3][0] = r4c1; elt[3][1] = r4c2; elt[3][2] = r4c3; elt[3][3] = r4c4; -} - -/** - init should be row major. - */ -Matrix4::Matrix4(const float* init) { - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - elt[r][c] = init[r * 4 + c]; - } - } -} - - -Matrix4::Matrix4(const double* init) { - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - elt[r][c] = (float)init[r * 4 + c]; - } - } -} - - -Matrix4::Matrix4() { - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - elt[r][c] = 0; - } - } -} - - -void Matrix4::setRow(int r, const Vector4& v) { - for (int c = 0; c < 4; ++c) { - elt[r][c] = v[c]; - } -} - - -void Matrix4::setColumn(int c, const Vector4& v) { - for (int r = 0; r < 4; ++r) { - elt[r][c] = v[r]; - } -} - - -Vector4 Matrix4::getRow(int r) const { - return row(r); -} - - -const Vector4& Matrix4::row(int r) const { - return reinterpret_cast(elt[r])[0]; -} - - -Vector4 Matrix4::getColumn(int c) const { - return column(c); -} - -Vector4 Matrix4::column(int c) const { - Vector4 v; - for (int r = 0; r < 4; ++r) { - v[r] = elt[r][c]; - } - return v; -} - - -Matrix4 Matrix4::operator*(const Matrix4& other) const { - Matrix4 result; - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - for (int i = 0; i < 4; ++i) { - result.elt[r][c] += elt[r][i] * other.elt[i][c]; - } - } - } - - return result; -} - - -Matrix4 Matrix4::operator*(const float s) const { - Matrix4 result; - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - result.elt[r][c] = elt[r][c] * s; - } - } - - return result; -} - - -Vector3 Matrix4::homoMul(const class Vector3& v, float w) const { - Vector4 r = (*this) * Vector4(v, w); - return r.xyz() * (1.0f / r.w); -} - - -Vector4 Matrix4::operator*(const Vector4& vector) const { - Vector4 result(0,0,0,0); - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - result[r] += elt[r][c] * vector[c]; - } - } - - return result; -} - - -Matrix4 Matrix4::transpose() const { - Matrix4 result; - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - result.elt[c][r] = elt[r][c]; - } - } - - return result; -} - - -bool Matrix4::operator!=(const Matrix4& other) const { - return ! (*this == other); -} - - -bool Matrix4::operator==(const Matrix4& other) const { - - // If the bit patterns are identical, they must be - // the same matrix. If not, they *might* still have - // equal elements due to floating point weirdness. - if (memcmp(this, &other, sizeof(Matrix4) == 0)) { - return true; - } - - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - if (elt[r][c] != other.elt[r][c]) { - return false; - } - } - } - - return true; -} - - -float Matrix4::determinant() const { - // Determinant is the dot product of the first row and the first row - // of cofactors (i.e. the first col of the adjoint matrix) - return cofactor().getRow(0).dot(getRow(0)); -} - - -Matrix4 Matrix4::adjoint() const { - return cofactor().transpose(); -} - - -Matrix4 Matrix4::inverse() const { - // Inverse = adjoint / determinant - - Matrix4 A = adjoint(); - - // Determinant is the dot product of the first row and the first row - // of cofactors (i.e. the first col of the adjoint matrix) - float det = A.getColumn(0).dot(getRow(0)); - - return A * (1.0f / det); -} - - -Matrix4 Matrix4::cofactor() const { - Matrix4 out; - - // We'll use i to incrementally compute -1 ^ (r+c) - int i = 1; - - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - // Compute the determinant of the 3x3 submatrix - float det = subDeterminant(r, c); - out.elt[r][c] = i * det; - i = -i; - } - i = -i; - } - - return out; -} - - -float Matrix4::subDeterminant(int excludeRow, int excludeCol) const { - // Compute non-excluded row and column indices - int row[3]; - int col[3]; - - for (int i = 0; i < 3; ++i) { - row[i] = i; - col[i] = i; - - if (i >= excludeRow) { - ++row[i]; - } - if (i >= excludeCol) { - ++col[i]; - } - } - - // Compute the first row of cofactors - float cofactor00 = - elt[row[1]][col[1]] * elt[row[2]][col[2]] - - elt[row[1]][col[2]] * elt[row[2]][col[1]]; - - float cofactor10 = - elt[row[1]][col[2]] * elt[row[2]][col[0]] - - elt[row[1]][col[0]] * elt[row[2]][col[2]]; - - float cofactor20 = - elt[row[1]][col[0]] * elt[row[2]][col[1]] - - elt[row[1]][col[1]] * elt[row[2]][col[0]]; - - // Product of the first row and the cofactors along the first row - return - elt[row[0]][col[0]] * cofactor00 + - elt[row[0]][col[1]] * cofactor10 + - elt[row[0]][col[2]] * cofactor20; -} - - -CoordinateFrame Matrix4::approxCoordinateFrame() const { - CoordinateFrame cframe; - - for (int r = 0; r < 3; ++r) { - for (int c = 0; c < 3; ++c) { - cframe.rotation[r][c] = elt[r][c]; - } - cframe.translation[r] = elt[r][3]; - } - - // Ensure that the rotation matrix is orthonormal - cframe.rotation.orthonormalize(); - - return cframe; -} - - -void Matrix4::serialize(class BinaryOutput& b) const { - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - b.writeFloat32(elt[r][c]); - } - } -} - - -void Matrix4::deserialize(class BinaryInput& b) { - for (int r = 0; r < 4; ++r) { - for (int c = 0; c < 4; ++c) { - elt[r][c] = b.readFloat32(); - } - } -} - -std::string Matrix4::toString() const { - return G3D::format("[%g, %g, %g, %g; %g, %g, %g, %g; %g, %g, %g, %g; %g, %g, %g, %g]", - elt[0][0], elt[0][1], elt[0][2], elt[0][3], - elt[1][0], elt[1][1], elt[1][2], elt[1][3], - elt[2][0], elt[2][1], elt[2][2], elt[2][3], - elt[3][0], elt[3][1], elt[3][2], elt[3][3]); -} - -} // namespace - - diff --git a/externals/g3dlite/G3D.lib/source/MeshAlg.cpp b/externals/g3dlite/G3D.lib/source/MeshAlg.cpp deleted file mode 100644 index 24b90ab5a92..00000000000 --- a/externals/g3dlite/G3D.lib/source/MeshAlg.cpp +++ /dev/null @@ -1,733 +0,0 @@ -/** - @file MeshAlg.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - @created 2003-09-14 - @edited 2008-09-03 - - Copyright 2000-2008, Morgan McGuire. - All rights reserved. - - */ - -#include "G3D/MeshAlg.h" -#include "G3D/Table.h" -#include "G3D/Set.h" -#include "G3D/Box.h" -#include "G3D/Sphere.h" -#include "G3D/vectorMath.h" -#include "G3D/AABox.h" - -#include - -namespace G3D { - -const int MeshAlg::Face::NONE = INT_MIN; - -void MeshAlg::generateGrid( - Array& vertex, - Array& texCoord, - Array& index, - int wCells, - int hCells, - const Vector2& textureScale, - bool spaceCentered, - bool twoSided, - const CoordinateFrame& xform) { - - vertex.fastClear(); - texCoord.fastClear(); - index.fastClear(); - - // Generate vertices - for (int z = 0; z <= hCells; ++z) { - for (int x = 0; x <= wCells; ++x) { - Vector3 v(x / (float)wCells, 0, z / (float)hCells); - - Vector2 t = v.xz() * textureScale; - - texCoord.append(t); - - if (spaceCentered) { - v -= Vector3(0.5f, 0, 0.5f); - } - v = xform.pointToWorldSpace(v); - vertex.append(v); - } - } - - // Generate indices - for (int z = 0; z < hCells; ++z) { - for (int x = 0; x < wCells; ++x) { - int A = x + z * (wCells + 1); - int B = A + 1; - int C = A + (wCells + 1); - int D = C + 1; - - // A B - // *-----* - // | \ | - // | \ | - // *-----* - // C D - - index.append(A, D, B); - index.append(A, C, D); - } - } - - if (twoSided) { - // The index array needs to have reversed winding for the bottom - // and offset by the original number of vertices - Array ti = index; - ti.reverse(); - for (int i = 0; i < ti.size(); ++i) { - ti[i] += vertex.size(); - } - index.append(ti); - - // Duplicate the arrays - vertex.append(Array(vertex)); - texCoord.append(Array(texCoord)); - } -} - -MeshAlg::Face::Face() { - for (int i = 0; i < 3; ++i) { - edgeIndex[i] = 0; - vertexIndex[i] = 0; - } -} - - -MeshAlg::Edge::Edge() { - for (int i = 0; i < 2; ++i) { - vertexIndex[i] = 0; - // Negative face indices are faces that don't exist - faceIndex[i] = -1; - } -} - - -MeshAlg::Geometry& MeshAlg::Geometry::operator=(const MeshAlg::Geometry& src) { - vertexArray.resize(src.vertexArray.size()); - normalArray.resize(src.vertexArray.size()); - - System::memcpy(vertexArray.getCArray(), src.vertexArray.getCArray(), sizeof(Vector3)*vertexArray.size()); - System::memcpy(normalArray.getCArray(), src.normalArray.getCArray(), sizeof(Vector3)*normalArray.size()); - - return *this; -} - - -void MeshAlg::computeNormals( - Geometry& geometry, - const Array& indexArray) { - - Array faceArray; - Array vertexArray; - Array edgeArray; - Array faceNormalArray; - - computeAdjacency(geometry.vertexArray, indexArray, faceArray, edgeArray, vertexArray); - - computeNormals(geometry.vertexArray, faceArray, vertexArray, - geometry.normalArray, faceNormalArray); -} - - -void MeshAlg::computeNormals( - const Array& vertexGeometry, - const Array& faceArray, - const Array< Array >& adjacentFaceArray, - Array& vertexNormalArray, - Array& faceNormalArray) { - - // Construct a fake vertex array for backwards compatibility - Array fakeVertexArray(adjacentFaceArray.size()); - - for (int v = 0; v < adjacentFaceArray.size(); ++v) { - fakeVertexArray[v].faceIndex = adjacentFaceArray[v]; - // We leave out the edges because they aren't used to compute normals - } - - computeNormals(vertexGeometry, faceArray, fakeVertexArray, - vertexNormalArray, faceNormalArray); -} - - -void MeshAlg::computeNormals( - const Array& vertexGeometry, - const Array& faceArray, - const Array& vertexArray, - Array& vertexNormalArray, - Array& faceNormalArray) { - - // Face normals (not unit length) - faceNormalArray.resize(faceArray.size()); - for (int f = 0; f < faceArray.size(); ++f) { - const Face& face = faceArray[f]; - - Vector3 vertex[3]; - for (int j = 0; j < 3; ++j) { - vertex[j] = vertexGeometry[face.vertexIndex[j]]; - debugAssert(vertex[j].isFinite()); - } - - faceNormalArray[f] = (vertex[1] - vertex[0]).cross(vertex[2] - vertex[0]); -# ifdef G3D_DEBUG - const Vector3& N = faceNormalArray[f]; - debugAssert(N.isFinite()); -# endif - } - - // Per-vertex normals, computed by averaging - vertexNormalArray.resize(vertexGeometry.size()); - for (int v = 0; v < vertexNormalArray.size(); ++v) { - Vector3 sum = Vector3::zero(); - for (int k = 0; k < vertexArray[v].faceIndex.size(); ++k) { - const int f = vertexArray[v].faceIndex[k]; - sum += faceNormalArray[f]; - } - vertexNormalArray[v] = sum.directionOrZero(); -# ifdef G3D_DEBUG - const Vector3& N = vertexNormalArray[v]; - debugAssert(N.isUnit() || N.isZero()); -# endif - } - - - for (int f = 0; f < faceArray.size(); ++f) { - faceNormalArray[f] = faceNormalArray[f].directionOrZero(); -# ifdef G3D_DEBUG - const Vector3& N = faceNormalArray[f]; - debugAssert(N.isUnit() || N.isZero()); -# endif - } - -} - - -void MeshAlg::computeFaceNormals( - const Array& vertexArray, - const Array& faceArray, - Array& faceNormals, - bool normalize) { - - faceNormals.resize(faceArray.size()); - - for (int f = 0; f < faceArray.size(); ++f) { - const MeshAlg::Face& face = faceArray[f]; - - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& v1 = vertexArray[face.vertexIndex[1]]; - const Vector3& v2 = vertexArray[face.vertexIndex[2]]; - - faceNormals[f] = (v1 - v0).cross(v2 - v0); - } - - if (normalize) { - for (int f = 0; f < faceArray.size(); ++f) { - faceNormals[f] = faceNormals[f].direction(); - } - } -} - - -void MeshAlg::identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& HP, - Array& backface) { - - Vector3 P = HP.xyz(); - - backface.resize(faceArray.size()); - - if (fuzzyEq(HP.w, 0.0)) { - // Infinite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const MeshAlg::Face& face = faceArray[f]; - - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& v1 = vertexArray[face.vertexIndex[1]]; - const Vector3& v2 = vertexArray[face.vertexIndex[2]]; - - const Vector3 N = (v1 - v0).cross(v2 - v0); - - backface[f] = N.dot(P) < 0; - } - } else { - // Finite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const MeshAlg::Face& face = faceArray[f]; - - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& v1 = vertexArray[face.vertexIndex[1]]; - const Vector3& v2 = vertexArray[face.vertexIndex[2]]; - - const Vector3 N = (v1 - v0).cross(v2 - v0); - - backface[f] = N.dot(P - v0) < 0; - } - } -} - - -void MeshAlg::identifyBackfaces( - const Array& vertexArray, - const Array& faceArray, - const Vector4& HP, - Array& backface, - const Array& faceNormals) { - - Vector3 P = HP.xyz(); - - backface.resize(faceArray.size()); - - if (fuzzyEq(HP.w, 0.0)) { - // Infinite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const Vector3& N = faceNormals[f]; - backface[f] = N.dot(P) < 0; - } - } else { - // Finite case - for (int f = faceArray.size() - 1; f >= 0; --f) { - const MeshAlg::Face& face = faceArray[f]; - const Vector3& v0 = vertexArray[face.vertexIndex[0]]; - const Vector3& N = faceNormals[f]; - - backface[f] = N.dot(P - v0) < 0; - } - } -} - - -void MeshAlg::createIndexArray(int n, Array& array, int start, int run, int skip) { - debugAssert(skip >= 0); - debugAssert(run >= 0); - - array.resize(n); - if (skip == 0) { - for (int i = 0; i < n; ++i) { - array[i] = start + i; - } - } else { - int rcount = 0; - int j = start; - for (int i = 0; i < n; ++i) { - array[i] = j; - - ++j; - ++rcount; - - if (rcount == run) { - rcount = 0; - j += skip; - } - } - } -} - - -void MeshAlg::computeAreaStatistics( - const Array& vertexArray, - const Array& indexArray, - double& minEdgeLength, - double& meanEdgeLength, - double& medianEdgeLength, - double& maxEdgeLength, - double& minFaceArea, - double& meanFaceArea, - double& medianFaceArea, - double& maxFaceArea) { - - debugAssert(indexArray.size() % 3 == 0); - - Array area(indexArray.size() / 3); - Array magnitude(indexArray.size()); - - for (int i = 0; i < indexArray.size(); i += 3) { - const Vector3& v0 = vertexArray[indexArray[i]]; - const Vector3& v1 = vertexArray[indexArray[i + 1]]; - const Vector3& v2 = vertexArray[indexArray[i + 2]]; - - area[i / 3] = (v1 - v0).cross(v2 - v0).magnitude() / 2.0; - magnitude[i] = (v1 - v0).magnitude(); - magnitude[i + 1] = (v2 - v1).magnitude(); - magnitude[i + 2] = (v0 - v2).magnitude(); - } - - area.sort(); - magnitude.sort(); - - minEdgeLength = max(0.0, magnitude[0]); - maxEdgeLength = max(0.0, magnitude.last()); - medianEdgeLength = max(0.0, magnitude[magnitude.size() / 2]); - meanEdgeLength = 0; - for (int i = 0; i < magnitude.size(); ++i) { - meanEdgeLength += magnitude[i]; - } - meanEdgeLength /= magnitude.size(); - - minFaceArea = max(0.0, area[0]); - maxFaceArea = max(0.0, area.last()); - medianFaceArea = max(0.0, area[area.size() / 2]); - meanFaceArea = 0; - for (int i = 0; i < area.size(); ++i) { - meanFaceArea += area[i]; - } - meanFaceArea /= area.size(); - - - // Make sure round-off hasn't pushed values less than zero - meanFaceArea = max(0.0, meanFaceArea); - meanEdgeLength = max(0.0, meanEdgeLength); -} - - -int MeshAlg::countBoundaryEdges(const Array& edgeArray) { - int b = 0; - - for (int i = 0; i < edgeArray.size(); ++i) { - if ((edgeArray[i].faceIndex[0] == MeshAlg::Face::NONE) != - (edgeArray[i].faceIndex[1] == MeshAlg::Face::NONE)) { - ++b; - } - } - - return b; -} - -void MeshAlg::computeBounds( - const Array& vertexArray, - const Array& indexArray, - Box& box, - Sphere& sphere) { - - Array newArray(indexArray.size()); - for (int i = 0; i < indexArray.size(); ++i) { - newArray[i] = vertexArray[indexArray[i]]; - } - computeBounds(newArray, box, sphere); -} - - -void MeshAlg::computeBounds( - const Array& vertexArray, - Box& box, - Sphere& sphere) { - - Vector3 xmin, xmax, ymin, ymax, zmin, zmax; - - // FIRST PASS: find 6 minima/maxima points - xmin.x = ymin.y = zmin.z = inf(); - xmax.x = ymax.y = zmax.z = -inf(); - - for (int v = 0; v < vertexArray.size(); ++v) { - const Vector3& vertex = vertexArray[v]; - - if (vertex.x < xmin.x) { - xmin = vertex; - } - - if (vertex.x > xmax.x) { - xmax = vertex; - } - - if (vertex.y < ymin.y) { - ymin = vertex; - } - - if (vertex.y > ymax.y) { - ymax = vertex; - } - - if (vertex.z < zmin.z) { - zmin = vertex; - } - - if (vertex.z > zmax.z) { - zmax = vertex; - } - } - - // Set points dia1 & dia2 to the maximally separated pair - Vector3 dia1 = xmin; - Vector3 dia2 = xmax; - { - // Set xspan = distance between the 2 points xmin & xmax (squared) - double xspan = (xmax - xmin).squaredMagnitude(); - - // Same for y & z spans - double yspan = (ymax - ymin).squaredMagnitude(); - double zspan = (zmax - zmin).squaredMagnitude(); - - double maxspan = xspan; - - if (yspan > maxspan) { - maxspan = yspan; - dia1 = ymin; - dia2 = ymax; - } - - if (zspan > maxspan) { - maxspan = zspan; - dia1 = zmin; - dia2 = zmax; - } - } - - - // dia1, dia2 is a diameter of initial sphere - - // calc initial center - Vector3 center = (dia1 + dia2) / 2.0; - - // calculate initial radius^2 and radius - Vector3 d = dia2 - sphere.center; - - double radSq = d.squaredMagnitude(); - double rad = sqrt(radSq); - - // SECOND PASS: increment current sphere - double old_to_p, old_to_new; - - for (int v = 0; v < vertexArray.size(); ++v) { - const Vector3& vertex = vertexArray[v]; - - d = vertex - center; - - double old_to_p_sq = d.squaredMagnitude(); - - // do r^2 test first - if (old_to_p_sq > radSq) { - // this point is outside of current sphere - old_to_p = sqrt(old_to_p_sq); - - // calc radius of new sphere - rad = (rad + old_to_p) / 2.0; - - // for next r^2 compare - radSq = rad * rad; - old_to_new = old_to_p - rad; - - // calc center of new sphere - center = (rad * center + old_to_new * vertex) / old_to_p; - } - } - - const Vector3 min(xmin.x, ymin.y, zmin.z); - const Vector3 max(xmax.x, ymax.y, zmax.z); - - box = Box(min, max); - - const double boxRadSq = (max - min).squaredMagnitude() * 0.25; - - if (boxRadSq >= radSq){ - if (isNaN(center.x) || ! isFinite(rad)) { - sphere = Sphere(Vector3::zero(), inf()); - } else { - sphere = Sphere(center, rad); - } - }else{ - sphere = Sphere((max + min) * 0.5, sqrt(boxRadSq)); - } -} - - -void MeshAlg::computeTangentVectors( - const Vector3& normal, - const Vector3 position[3], - const Vector2 texCoord[3], - Vector3& tangent, - Vector3& binormal) { - - Vector3 v[3]; - Vector2 t[3]; - - // TODO: don't need the copy - // Make a copy so that we can sort - for (int i = 0; i < 3; ++i) { - v[i] = position[i]; - t[i] = texCoord[i]; - } - - ///////////////////////////////////////////////// - // Begin by computing the tangent - - // Bubble sort the vertices by decreasing texture coordinate y. - if (t[0].y < t[1].y) { - std::swap(v[0], v[1]); - std::swap(t[0], t[1]); - } - - // t0 >= t1 - - if (t[0].y < t[2].y) { - std::swap(v[0], v[2]); - std::swap(t[0], t[2]); - } - - // t0 >= t2, t0 >= t1 - - if (t[1].y < t[2].y) { - std::swap(v[1], v[2]); - std::swap(t[1], t[2]); - } - - // t0 >= t1 >= t2 - - float amount; - - // Compute the direction of constant y. - if (fuzzyEq(t[2].y, t[0].y)) { - // Degenerate case-- the texture coordinates do not vary across this - // triangle. - amount = 1.0; - } else { - // Solve lerp(t[0].y, t[2].y, amount) = t[1].y for amount: - // - // t0 + (t2 - t0) * a = t1 - // a = (t1 - t0) / (t2 - t0) - - amount = (t[1].y - t[0].y) / (t[2].y - t[0].y); - } - - tangent = lerp(v[0], v[2], amount) - v[1]; - - // Make sure the tangent points in the right direction and is - // perpendicular to the normal. - if (lerp(t[0].x, t[2].x, amount) < t[1].x) { - tangent = -tangent; - } - - // TODO: do we need this? We take this component off - // at the end anyway - tangent -= tangent.dot(normal) * normal; - - // Normalize the tangent so it contributes - // equally at the vertex (TODO: do we need this?) - if (fuzzyEq(tangent.magnitude(), 0.0)) { - tangent = Vector3::unitX(); - } else { - tangent = tangent.direction(); - } - - ////////////////////////////////////////////////// - // Now compute the binormal (same code, but in x) - - // Sort the vertices by texture coordinate x. - if (t[0].x < t[1].x) { - std::swap(v[0], v[1]); - std::swap(t[0], t[1]); - } - - if (t[0].x < t[2].x) { - std::swap(v[0], v[2]); - std::swap(t[0], t[2]); - } - - if (t[1].x < t[2].x) { - std::swap(v[1], v[2]); - std::swap(t[1], t[2]); - } - - // Compute the direction of constant x. - if (fuzzyEq(t[2].x, t[0].x)) { - amount = 1.0; - } else { - amount = (t[1].x - t[0].x) / (t[2].x - t[0].x); - } - - binormal = lerp(v[0], v[2], amount) - v[1]; - - // Make sure the binormal points in the right direction and is - // perpendicular to the normal. - if (lerp(t[0].y, t[2].y, amount) < t[1].y) { - binormal = -binormal; - } - - binormal -= binormal.dot(normal) * normal; - - // Normalize the binormal so that it contributes - // an equal amount to the per-vertex value (TODO: do we need this? - // Nelson Max showed that we don't for computing per-vertex normals) - if (fuzzyEq(binormal.magnitude(), 0.0)) { - binormal = Vector3::unitZ(); - } else { - binormal = binormal.direction(); - } - - // This computation gives the opposite convention of what we want. - binormal = -binormal; - -} - - -void MeshAlg::computeTangentSpaceBasis( - const Array& vertexArray, - const Array& texCoordArray, - const Array& vertexNormalArray, - const Array& faceArray, - Array& tangent, - Array& binormal) { - - debugAssertM(faceArray.size() != 0, "Unable to calculate valid tangent space without faces."); - - // The three vertices and texCoords of each face - Vector3 position[3]; - Vector2 texCoord[3]; - Vector3 t, b; - - tangent.resize(vertexArray.size()); - binormal.resize(vertexArray.size()); - - // Zero the output arrays. - System::memset(tangent.getCArray(), 0, sizeof(Vector3) * tangent.size()); - System::memset(binormal.getCArray(), 0, sizeof(Vector3) * binormal.size()); - - // Iterate over faces, computing the tangent vectors for each - // vertex. Accumulate those into the tangent and binormal arrays - // and then orthonormalize at the end. - - for (int f = 0; f < faceArray.size(); ++f) { - const Face& face = faceArray[f]; - - for (int v = 0; v < 3; ++v) { - int i = face.vertexIndex[v]; - position[v] = vertexArray[i]; - texCoord[v] = texCoordArray[i]; - } - - const Vector3 faceNormal((position[1] - position[0]).cross(position[2] - position[0]).direction()); - computeTangentVectors(faceNormal, position, texCoord, t, b); - - for (int v = 0; v < 3; ++v) { - int i = face.vertexIndex[v]; - tangent[i] += t; - binormal[i] += b; - } - } - - // Normalize the basis vectors - for (int v = 0; v < vertexArray.size(); ++v) { - // Remove the component parallel to the normal - const Vector3& N = vertexNormalArray[v]; - debugAssertM(N.isUnit() || N.isZero(), "Input normals must have unit length"); - - tangent[v] -= tangent[v].dot(N) * N; - binormal[v] -= binormal[v].dot(N) * N; - - // Normalize - tangent[v] = tangent[v].directionOrZero(); - binormal[v] = binormal[v].directionOrZero(); - - // Note that the tangent and binormal might not be perpendicular anymore - } -} - - - -} // G3D namespace diff --git a/externals/g3dlite/G3D.lib/source/MeshAlgAdjacency.cpp b/externals/g3dlite/G3D.lib/source/MeshAlgAdjacency.cpp deleted file mode 100644 index a8b35f32c86..00000000000 --- a/externals/g3dlite/G3D.lib/source/MeshAlgAdjacency.cpp +++ /dev/null @@ -1,729 +0,0 @@ -/** - @file MeshAlgAdjacency.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - @created 2003-09-14 - @edited 2005-02-24 - - Copyright 2000-2003, Morgan McGuire. - All rights reserved. - - */ - -#include "G3D/Table.h" -#include "G3D/MeshAlg.h" -#include "G3D/Set.h" - - -namespace G3D { - -/** - A half [i.e. directed] edge. - */ -class MeshDirectedEdgeKey { -public: - - /** vertexIndex[0] <= vertexIndex[1] */ - int vertexIndex[2]; - - MeshDirectedEdgeKey() {} - - MeshDirectedEdgeKey( - const int i0, - const int i1) { - - if (i0 <= i1) { - vertexIndex[0] = i0; - vertexIndex[1] = i1; - } else { - vertexIndex[0] = i1; - vertexIndex[1] = i0; - } - } - - - bool operator==(const MeshDirectedEdgeKey& e2) const { - for (int i = 0; i < 2; ++i) { - if (vertexIndex[i] != e2.vertexIndex[i]) { - return false; - } - } - return true; - } -}; - -} - -template<> struct HashTrait { - static size_t hashCode(const G3D::MeshDirectedEdgeKey& key) { - return key.vertexIndex[0] + (key.vertexIndex[1] << 16); - } -}; - -namespace G3D { - -/** - A hashtable mapping edges to lists of indices for - faces. This is used instead of Table because of the - special logic in insert. - - Used only for MeshAlg::computeAdjacency. - - In the face lists, index f >= 0 indicates that - f contains the edge as a forward edge. Index f < 0 - indicates that ~f contains the edge as a backward edge. - */ -class MeshEdgeTable { -public: - typedef Table > ET; - -private: - - ET table; - -public: - - /** - Clears the table. - */ - void clear() { - table.clear(); - } - - /** - Inserts the faceIndex into the edge's face list. - The index may be a negative number indicating a backface. - */ - void insert(const MeshDirectedEdgeKey& edge, int faceIndex) { - - // debugAssertM((table.size() > 20) && (table.debugGetLoad() < 0.5 || table.debugGetNumBuckets() < 20), - // "MeshEdgeTable is using a poor hash function."); - - if (! table.containsKey(edge)) { - // First time - Array x(1); - x[0] = faceIndex; - table.set(edge, x); - } else { - table[edge].append(faceIndex); - } - } - - /** - Returns the face list for a given edge - */ - const Array& get(const MeshDirectedEdgeKey& edge) { - return table[edge]; - } - - ET::Iterator begin() { - return table.begin(); - } - - const ET::Iterator end() const { - return table.end(); - } - -}; - - -/** - edgeTable[edgeKey] is a list of faces containing - - Used and cleared by MeshModel::computeAdjacency() - */ -static MeshEdgeTable edgeTable; - -/** - Assigns the edge index into the next unassigned edge - index. The edge index may be negative, indicating - a reverse edge. - */ -static void assignEdgeIndex(MeshAlg::Face& face, int e) { - for (int i = 0; i < 3; ++i) { - if (face.edgeIndex[i] == MeshAlg::Face::NONE) { - face.edgeIndex[i] = e; - return; - } - } - - debugAssertM(false, "Face has already been assigned 3 edges"); -} - - -void MeshAlg::computeAdjacency( - const Array& vertexGeometry, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array< Array >& adjacentFaceArray) { - - Array vertexArray; - - computeAdjacency(vertexGeometry, indexArray, faceArray, edgeArray, vertexArray); - - // Convert the vertexArray into adjacentFaceArray - adjacentFaceArray.clear(); - adjacentFaceArray.resize(vertexArray.size()); - for (int v = 0; v < adjacentFaceArray.size(); ++v) { - adjacentFaceArray[v] = vertexArray[v].faceIndex; - } -} - - -void MeshAlg::computeAdjacency( - const Array& vertexGeometry, - const Array& indexArray, - Array& faceArray, - Array& edgeArray, - Array& vertexArray) { - - edgeArray.clear(); - vertexArray.clear(); - faceArray.clear(); - edgeTable.clear(); - - // Face normals - Array faceNormal; - - // This array has the same size as the vertex array - vertexArray.resize(vertexGeometry.size()); - - // Iterate through the triangle list - for (int q = 0; q < indexArray.size(); q += 3) { - - Vector3 vertex[3]; - int f = faceArray.size(); - MeshAlg::Face& face = faceArray.next(); - - // Construct the face - for (int j = 0; j < 3; ++j) { - int v = indexArray[q + j]; - face.vertexIndex[j] = v; - face.edgeIndex[j] = Face::NONE; - - // Store back pointers in the vertices - vertexArray[v].faceIndex.append(f); - - // We'll need these vertices to find the face normal - vertex[j] = vertexGeometry[v]; - } - - // Compute the face normal - Vector3 N = (vertex[1] - vertex[0]).cross(vertex[2] - vertex[0]); - faceNormal.append(N.directionOrZero()); - - static const int nextIndex[] = {1, 2, 0}; - - // Add each edge to the edge table. - for (int j = 0; j < 3; ++j) { - const int i0 = indexArray[q + j]; - const int i1 = indexArray[q + nextIndex[j]]; - - const MeshDirectedEdgeKey edge(i0, i1); - - if (i0 == edge.vertexIndex[0]) { - // The edge was directed in the same manner as in the face - edgeTable.insert(edge, f); - } else { - // The edge was directed in the opposite manner as in the face - edgeTable.insert(edge, ~f); - } - } - } - - // For each edge in the edge table, create an edge in the edge array. - // Collapse every 2 edges from adjacent faces. - - MeshEdgeTable::ET::Iterator cur = edgeTable.begin(); - MeshEdgeTable::ET::Iterator end = edgeTable.end(); - - Array tempEdgeArray; - while (cur != end) { - MeshDirectedEdgeKey& edgeKey = cur->key; - Array& faceIndexArray = cur->value; - - // Process this edge - while (faceIndexArray.size() > 0) { - - // Remove the last index - int f0 = faceIndexArray.pop(); - - // Find the normal to that face - const Vector3& n0 = faceNormal[(f0 >= 0) ? f0 : ~f0]; - - bool found = false; - - // We try to find the matching face with the closest - // normal. This ensures that we don't introduce a lot - // of artificial ridges into flat parts of a mesh. - double ndotn = -2; - int f1 = -1, i1 = -1; - - // Try to Find the face with the matching edge - for (int i = faceIndexArray.size() - 1; i >= 0; --i) { - int f = faceIndexArray[i]; - - if ((f >= 0) != (f0 >= 0)) { - // This face contains the oppositely oriented edge - // and has not been assigned too many edges - - const Vector3& n1 = faceNormal[(f >= 0) ? f : ~f]; - double d = n1.dot(n0); - - if (found) { - // We previously found a good face; see if this - // one is better. - if (d > ndotn) { - // This face is better. - ndotn = d; - f1 = f; - i1 = i; - } - } else { - // This is the first face we've found - found = true; - ndotn = d; - f1 = f; - i1 = i; - } - } - } - - // Create the new edge - int e = tempEdgeArray.size(); - Edge& edge = tempEdgeArray.next(); - - edge.vertexIndex[0] = edgeKey.vertexIndex[0]; - edge.vertexIndex[1] = edgeKey.vertexIndex[1]; - - if (f0 >= 0) { - edge.faceIndex[0] = f0; - edge.faceIndex[1] = Face::NONE; - assignEdgeIndex(faceArray[f0], e); - } else { - // The face indices above are two's complemented. - // this code restores them to regular indices. - debugAssert((~f0) >= 0); - edge.faceIndex[1] = ~f0; - edge.faceIndex[0] = Face::NONE; - - // The edge index *does* need to be inverted, however. - assignEdgeIndex(faceArray[~f0], ~e); - } - - if (found) { - // We found a matching face; remove both - // faces from the active list. - faceIndexArray.fastRemove(i1); - - if (f1 >= 0) { - edge.faceIndex[0] = f1; - assignEdgeIndex(faceArray[f1], e); - } else { - edge.faceIndex[1] = ~f1; - assignEdgeIndex(faceArray[~f1], ~e); - } - } - } - - ++cur; - } - - edgeTable.clear(); - - // Move boundary edges to the end of the list and then - // clean up the face references into them - { - // Map old edge indices to new edge indices - Array newIndex(tempEdgeArray.size()); - - - // Index of the start and end of the edge array - int i = 0; - int j = tempEdgeArray.size() - 1; - - edgeArray.resize(tempEdgeArray.size()); - for (int e = 0; e < tempEdgeArray.size(); ++e) { - if (tempEdgeArray[e].boundary()) { - newIndex[e] = j; - --j; - } else { - newIndex[e] = i; - ++i; - } - edgeArray[newIndex[e]] = tempEdgeArray[e]; - } - - debugAssertM(i == j + 1, "Counting from front and back of array did not match"); - - // Fix the faces - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - for (int q = 0; q < 3; ++q) { - int e = face.edgeIndex[q]; - if (e < 0) { - // Backwards edge; twiddle before and after conversion - face.edgeIndex[q] = ~newIndex[~e]; - } else { - // Regular edge; remap the index - face.edgeIndex[q] = newIndex[e]; - } - } - } - } - - // Now order the edge indices inside the faces correctly. - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - int e0 = face.edgeIndex[0]; - int e1 = face.edgeIndex[1]; - int e2 = face.edgeIndex[2]; - - // e0 will always remain first. The only - // question is whether e1 and e2 should be swapped. - - // See if e1 begins at the vertex where e1 ends. - const int e0End = (e0 < 0) ? - edgeArray[~e0].vertexIndex[0] : - edgeArray[e0].vertexIndex[1]; - - const int e1Begin = (e1 < 0) ? - edgeArray[~e1].vertexIndex[1] : - edgeArray[e1].vertexIndex[0]; - - if (e0End != e1Begin) { - // We must swap e1 and e2 - face.edgeIndex[1] = e2; - face.edgeIndex[2] = e1; - } - } - - // Fill out the edge adjacency information in the vertex array - for (int e = 0; e < edgeArray.size(); ++e) { - const Edge& edge = edgeArray[e]; - vertexArray[edge.vertexIndex[0]].edgeIndex.append(e); - vertexArray[edge.vertexIndex[1]].edgeIndex.append(~e); - } -} - - -void MeshAlg::weldBoundaryEdges( - Array& faceArray, - Array& edgeArray, - Array& vertexArray) { - - // Copy over the original edge array - Array oldEdgeArray = edgeArray; - - // newEdgeIndex[e] is the new index of the old edge with index e - // Note that newEdgeIndex[e] might be negative, indicating that - // the edge switched direction between the arrays. - Array newEdgeIndex(edgeArray.size()); - edgeArray.resize(0); - - // boundaryEdgeIndices[v_low] is an array of the indices of - // all boundary edges whose lower vertex is v_low. - Table > boundaryEdgeIndices; - - // Copy over non-boundary edges to the new array - for (int e = 0; e < oldEdgeArray.size(); ++e) { - if (oldEdgeArray[e].boundary()) { - - // Add to the boundary table - const int v_low = iMin(oldEdgeArray[e].vertexIndex[0], oldEdgeArray[e].vertexIndex[1]); - if (! boundaryEdgeIndices.containsKey(v_low)) { - boundaryEdgeIndices.set(v_low, Array()); - } - boundaryEdgeIndices[v_low].append(e); - - // We'll fill out newEdgeIndex[e] later, when we find pairs - - } else { - - // Copy the edge to the new array - newEdgeIndex[e] = edgeArray.size(); - edgeArray.append(oldEdgeArray[e]); - - } - } - - - // Remove all edges from the table that have pairs. - Table >::Iterator cur = boundaryEdgeIndices.begin(); - Table >::Iterator end = boundaryEdgeIndices.end(); - while (cur != end) { - Array& boundaryEdge = cur->value; - - for (int i = 0; i < boundaryEdge.size(); ++i) { - int ei = boundaryEdge[i]; - const Edge& edgei = oldEdgeArray[ei]; - - for (int j = i + 1; j < boundaryEdge.size(); ++j) { - int ej = boundaryEdge[j]; - const Edge& edgej = oldEdgeArray[ej]; - - // See if edge ei is the reverse (match) of edge ej. - - // True if the edges match - bool match = false; - - // True if edgej's vertex indices are reversed from - // edgei's (usually true). - bool reversej = false; - - int u = edgei.vertexIndex[0]; - int v = edgei.vertexIndex[1]; - - if (edgei.faceIndex[0] != Face::NONE) { - // verts|faces - // edgei = [u v A /] - - if (edgej.faceIndex[0] != Face::NONE) { - if ((edgej.vertexIndex[0] == v) && (edgej.vertexIndex[1] == u)) { - // This is the most common of the four cases - - // edgej = [v u B /] - match = true; - reversej = true; - } - } else { - if ((edgej.vertexIndex[0] == u) && (edgej.vertexIndex[1] == v)) { - // edgej = [u v / B] - match = true; - } - } - } else { - // edgei = [u v / A] - if (edgej.faceIndex[0] != Face::NONE) { - if ((edgej.vertexIndex[0] == u) && (edgej.vertexIndex[1] == v)) { - // edgej = [u v B /] - match = true; - } - } else { - if ((edgej.vertexIndex[0] == v) && (edgej.vertexIndex[1] == u)) { - // edgej = [v u / B] - match = true; - reversej = true; - } - } - } - - if (match) { - // ei and ej can be paired as a single edge - int e = edgeArray.size(); - Edge& edge = edgeArray.next(); - - // Follow the direction of edgei. - edge = edgei; - newEdgeIndex[ei] = e; - - // Insert the face index for edgej. - int fj = edgej.faceIndex[0]; - if (fj == Face::NONE) { - fj = edgej.faceIndex[1]; - } - - if (edge.faceIndex[0] == Face::NONE) { - edge.faceIndex[0] = fj; - } else { - edge.faceIndex[1] = fj; - } - - if (reversej) { - // The new edge is backwards of the old edge for ej - newEdgeIndex[ej] = ~e; - } else { - newEdgeIndex[ej] = e; - } - - // Remove both ei and ej from being candidates for future pairing. - // Remove ej first since it comes later in the list (removing - // ei would decrease the index of ej to j - 1). - boundaryEdge.fastRemove(j); - boundaryEdge.fastRemove(i); - - // Re-process element i, which is now a new edge index - --i; - - // Jump out of the j for-loop - break; - } - } - } - ++cur; - } - - // Anything remaining in the table is a real boundary edge; just copy it to - // the end of the array. - cur = boundaryEdgeIndices.begin(); - end = boundaryEdgeIndices.end(); - while (cur != end) { - Array& boundaryEdge = cur->value; - - for (int b = 0; b < boundaryEdge.size(); ++b) { - const int e = boundaryEdge[b]; - - newEdgeIndex[e] = edgeArray.size(); - edgeArray.append(oldEdgeArray[e]); - } - - ++cur; - } - - // Finally, fix up edge indices in the face and vertex arrays - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - for (int i = 0; i < 3; ++i) { - int e = face.edgeIndex[i]; - - if (e < 0) { - face.edgeIndex[i] = ~newEdgeIndex[~e]; - } else { - face.edgeIndex[i] = newEdgeIndex[e]; - } - } - } - - for (int v = 0; v < vertexArray.size(); ++v) { - Vertex& vertex = vertexArray[v]; - for (int i = 0; i < vertex.edgeIndex.size(); ++i) { - int e = vertex.edgeIndex[i]; - - if (e < 0) { - vertex.edgeIndex[i] = ~newEdgeIndex[~e]; - } else { - vertex.edgeIndex[i] = newEdgeIndex[e]; - } - } - } -} - - -void MeshAlg::weldAdjacency( - const Array& originalGeometry, - Array& faceArray, - Array& edgeArray, - Array& vertexArray, - double radius) { - - // Num vertices - const int n = originalGeometry.size(); - - // canonical[v] = first occurance of any vertex near oldVertexArray[v] - Array canonical(n); - - Array toNew, toOld; - // Throw away the new vertex array - Array dummy; - computeWeld(originalGeometry, dummy, toNew, toOld, radius); - - for (int v = 0; v < canonical.size(); ++v) { - // Round-trip through the toNew/toOld process. This will give - // us the original vertex. - canonical[v] = toOld[toNew[v]]; - } - - // Destroy vertexArray (we reconstruct it below) - vertexArray.clear(); - vertexArray.resize(n); - - bool hasBoundaryEdges = false; - - // Fix edge vertex indices - for (int e = 0; e < edgeArray.size(); ++e) { - Edge& edge = edgeArray[e]; - - const int v0 = canonical[edge.vertexIndex[0]]; - const int v1 = canonical[edge.vertexIndex[1]]; - - edge.vertexIndex[0] = v0; - edge.vertexIndex[1] = v1; - - vertexArray[v0].edgeIndex.append(e); - vertexArray[v1].edgeIndex.append(~e); - - hasBoundaryEdges = hasBoundaryEdges || edge.boundary(); - } - - // Fix face vertex indices - for (int f = 0; f < faceArray.size(); ++f) { - Face& face = faceArray[f]; - for (int i = 0; i < 3; ++i) { - const int v = canonical[face.vertexIndex[i]]; - - face.vertexIndex[i] = v; - - // Add the back pointer - vertexArray[v].faceIndex.append(f); - } - } - - if (hasBoundaryEdges) { - // As a result of the welding, some of the boundary edges at - // the end of the array may now have mates and no longer be - // boundaries. Try to pair these up. - - weldBoundaryEdges(faceArray, edgeArray, vertexArray); - } -} - - -void MeshAlg::debugCheckConsistency( - const Array& faceArray, - const Array& edgeArray, - const Array& vertexArray) { - -#ifdef _DEBUG - for (int v = 0; v < vertexArray.size(); ++v) { - const MeshAlg::Vertex& vertex = vertexArray[v]; - - for (int i = 0; i < vertex.edgeIndex.size(); ++i) { - const int e = vertex.edgeIndex[i]; - debugAssert(edgeArray[(e >= 0) ? e : ~e].containsVertex(v)); - } - - for (int i = 0; i < vertex.faceIndex.size(); ++i) { - const int f = vertex.faceIndex[i]; - debugAssert(faceArray[f].containsVertex(v)); - } - - } - - for (int e = 0; e < edgeArray.size(); ++e) { - const MeshAlg::Edge& edge = edgeArray[e]; - - for (int i = 0; i < 2; ++i) { - debugAssert((edge.faceIndex[i] == MeshAlg::Face::NONE) || - faceArray[edge.faceIndex[i]].containsEdge(e)); - - debugAssert(vertexArray[edge.vertexIndex[i]].inEdge(e)); - } - } - - // Every face's edge must be on that face - for (int f = 0; f < faceArray.size(); ++f) { - const MeshAlg::Face& face = faceArray[f]; - for (int i = 0; i < 3; ++i) { - int e = face.edgeIndex[i]; - int ei = (e >= 0) ? e : ~e; - debugAssert(edgeArray[ei].inFace(f)); - - // Make sure the edge is oriented appropriately - if (e >= 0) { - debugAssert(edgeArray[ei].faceIndex[0] == (int)f); - } else { - debugAssert(edgeArray[ei].faceIndex[1] == (int)f); - } - - debugAssert(vertexArray[face.vertexIndex[i]].inFace(f)); - } - } -#else - (void)faceArray; - (void)edgeArray; - (void)vertexArray; -#endif // _DEBUG -} - -} // G3D namespace diff --git a/externals/g3dlite/G3D.lib/source/MeshAlgWeld.cpp b/externals/g3dlite/G3D.lib/source/MeshAlgWeld.cpp deleted file mode 100644 index cd4d1f9c7d5..00000000000 --- a/externals/g3dlite/G3D.lib/source/MeshAlgWeld.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/** - @file MeshAlgWeld.cpp - - The MeshAlg::computeWeld method. - - @maintainer Morgan McGuire, matrix@graphics3d.com - @created 2003-10-22 - @edited 2005-02-24 - - Copyright 2000-2003, Morgan McGuire. - All rights reserved. - - */ - -#include "G3D/MeshAlg.h" -#include "G3D/Table.h" -#include "G3D/Set.h" - -namespace G3D { - -namespace _internal { - -class Welder { -private: - - // Intentionally illegal - Welder& operator=(const Welder& w); - -public: - /** Indices of newVertexArray elements in or near a grid cell. */ - typedef Array List; - - enum {GRID_RES = 32}; - - List grid[GRID_RES][GRID_RES][GRID_RES]; - - const Array& oldVertexArray; - Array& newVertexArray; - Array& toNew; - Array& toOld; - - /** Must be less than one grid cell, not checked */ - const double radius; - - /** (oldVertexArray[i] - offset) * scale is on the range [0, 1] */ - Vector3 offset; - Vector3 scale; - - Welder( - const Array& _oldVertexArray, - Array& _newVertexArray, - Array& _toNew, - Array& _toOld, - double _radius); - - /** - Computes the grid index from an ordinate. - */ - void toGridCoords(Vector3 v, int& x, int& y, int& z) const; - - /** Gets the index of a vertex, adding it to - newVertexArray if necessary. */ - int getIndex(const Vector3& vertex); - - void weld(); -}; - -} // namespace _internal - -} // namespace G3D - -template<> struct HashTrait { - static size_t hashCode(const G3D::_internal::Welder::List* key) { return reinterpret_cast(key); } -}; - -namespace G3D { -namespace _internal { - -Welder::Welder( - const Array& _oldVertexArray, - Array& _newVertexArray, - Array& _toNew, - Array& _toOld, - double _radius) : - oldVertexArray(_oldVertexArray), - newVertexArray(_newVertexArray), - toNew(_toNew), - toOld(_toOld), - radius(_radius) { - - // Compute a scale factor that moves the range - // of all ordinates to [0, 1] - Vector3 minBound = Vector3::inf(); - Vector3 maxBound = -minBound; - - for (int i = 0; i < oldVertexArray.size(); ++i) { - minBound = minBound.min(oldVertexArray[i]); - maxBound = maxBound.max(oldVertexArray[i]); - } - - offset = minBound; - scale = maxBound - minBound; - for (int i = 0; i < 3; ++i) { - // The model might have zero extent along some axis - if (fuzzyEq(scale[i], 0.0)) { - scale[i] = 1.0; - } else { - scale[i] = 1.0 / scale[i]; - } - } -} - - -void Welder::toGridCoords(Vector3 v, int& x, int& y, int& z) const { - v = (v - offset) * scale; - x = iClamp(iFloor(v.x * GRID_RES), 0, GRID_RES - 1); - y = iClamp(iFloor(v.y * GRID_RES), 0, GRID_RES - 1); - z = iClamp(iFloor(v.z * GRID_RES), 0, GRID_RES - 1); -} - - -int Welder::getIndex(const Vector3& vertex) { - - int closestIndex = -1; - double distanceSquared = inf(); - - int ix, iy, iz; - toGridCoords(vertex, ix, iy, iz); - - // Check against all vertices within radius of this grid cube - const List& list = grid[ix][iy][iz]; - - for (int i = 0; i < list.size(); ++i) { - double d = (newVertexArray[list[i]] - vertex).squaredMagnitude(); - - if (d < distanceSquared) { - distanceSquared = d; - closestIndex = list[i]; - } - } - - if (distanceSquared <= radius * radius) { - - return closestIndex; - - } else { - - // This is a new vertex - int newIndex = newVertexArray.size(); - newVertexArray.append(vertex); - - // Create a new vertex and store its index in the - // neighboring grid cells (usually, only 1 neighbor) - - Set neighbors; - - for (float dx = -1; dx <= +1; ++dx) { - for (float dy = -1; dy <= +1; ++dy) { - for (float dz = -1; dz <= +1; ++dz) { - int ix, iy, iz; - toGridCoords(vertex + Vector3(dx, dy, dz) * radius, ix, iy, iz); - neighbors.insert(&(grid[ix][iy][iz])); - } - } - } - - Set::Iterator neighbor(neighbors.begin()); - Set::Iterator none(neighbors.end()); - - while (neighbor != none) { - (*neighbor)->append(newIndex); - ++neighbor; - } - - return newIndex; - } -} - - -void Welder::weld() { - newVertexArray.resize(0); - - // Prime the vertex positions - for (int i = 0; i < oldVertexArray.size(); ++i) { - getIndex(oldVertexArray[i]); - } - - // Now create the official remapping by snapping to - // nearby vertices. - toNew.resize(oldVertexArray.size()); - toOld.resize(newVertexArray.size()); - - for (int oi = 0; oi < oldVertexArray.size(); ++oi) { - toNew[oi] = getIndex(oldVertexArray[oi]); - toOld[toNew[oi]] = oi; - } -} - -} // internal namespace - - -void MeshAlg::computeWeld( - const Array& oldVertexArray, - Array& newVertexArray, - Array& toNew, - Array& toOld, - double radius) { - - _internal::Welder welder(oldVertexArray, newVertexArray, toNew, toOld, radius); - welder.weld(); -} - -} // G3D namespace diff --git a/externals/g3dlite/G3D.lib/source/MeshAlgWeld2.cpp b/externals/g3dlite/G3D.lib/source/MeshAlgWeld2.cpp deleted file mode 100644 index 13f731353a6..00000000000 --- a/externals/g3dlite/G3D.lib/source/MeshAlgWeld2.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/** - @file MeshAlgWeld2.cpp - - @author Morgan McGuire, Kyle Whitson, Corey Taylor - - @created 2008-07-30 - @edited 2008-11-10 - */ - -#include "G3D/platform.h" -#include "G3D/Vector2.h" -#include "G3D/Vector3.h" -#include "G3D/Sphere.h" -#include "G3D/PointHashGrid.h" -#include "G3D/MeshAlg.h" - -namespace G3D { namespace _internal{ - -/** Used by WeldHelper2::smoothNormals. */ -class VN { -public: - Vector3 vertex; - Vector3 normal; - - VN() {} - VN(const Vector3& v, const Vector3& n) : vertex(v), normal(n) {} -}; - -/** Used by WeldHelper::getIndex to maintain a list of vertices by location. */ -class VNTi { -public: - Vector3 vertex; - Vector3 normal; - Vector2 texCoord; - int index; - - VNTi() : index(0) {} - - VNTi(const Vector3& v, const Vector3& n, const Vector2& t, int i) : - vertex(v), normal(n), texCoord(t), index(i) {} -}; - - -}} // G3D - -template <> struct HashTrait { - static size_t hashCode(const G3D::_internal::VN& k) { return static_cast(k.vertex.hashCode()); } -}; -template <> struct HashTrait { - static size_t hashCode(const G3D::_internal::VNTi& k) { return static_cast(k.vertex.hashCode()); } -}; - - -template<> struct EqualsTrait { - static bool equals(const G3D::_internal::VN& a, const G3D::_internal::VN& b) { return a.vertex == b.vertex; } -}; -template<> struct EqualsTrait { - static bool equals(const G3D::_internal::VNTi& a, const G3D::_internal::VNTi& b) { return a.vertex == b.vertex; } -}; - -template<> struct PositionTrait { - static void getPosition(const G3D::_internal::VN& v, G3D::Vector3& p) { p = v.vertex; } -}; -template<> struct PositionTrait { - static void getPosition(const G3D::_internal::VNTi& v, G3D::Vector3& p) { p = v.vertex; } -}; - -namespace G3D { namespace _internal { - -class WeldHelper { -private: - /** Used by getIndex and updateTriLists */ - PointHashGrid weldGrid; - - Array* outputVertexArray; - Array* outputNormalArray; - Array* outputTexCoordArray; - - float vertexWeldRadius; - /** Squared radius allowed for welding similar normals. */ - float normalWeldRadius2; - float texCoordWeldRadius2; - - float normalSmoothingAngle; - - /** - Returns the index of the vertex in - outputVertexArray/outputNormalArray/outputTexCoordArray - that is within the global tolerances of v,n,t. If there - is no such vertex, adds it to the arrays and returns that index. - - Called from updateTriLists(). - */ - int getIndex(const Vector3& v, const Vector3& n, const Vector2& t) { - PointHashGrid::SphereIterator it = - weldGrid.beginSphereIntersection(Sphere(v, vertexWeldRadius)); - - if (n.isZero()) { - // Don't bother trying to match the surface normal, since this vertex has no surface normal. - while (it.hasMore()) { - if ((t - it->texCoord).squaredLength() <= texCoordWeldRadius2) { - // This is the vertex - return it->index; - } - ++it; - } - } else { - while (it.hasMore()) { - if (((n - it->normal).squaredLength() <= normalWeldRadius2) && - ((t - it->texCoord).squaredLength() <= texCoordWeldRadius2)) { - // This is the vertex - return it->index; - } - ++it; - } - } - - // Note that a sliver triangle processed before its neighbors may reach here - // with a zero length normal. - - // The vertex does not exist. Create it. - const int i = outputVertexArray->size(); - outputVertexArray->append(v); - outputNormalArray->append(n); - outputTexCoordArray->append(t); - - // Store in the grid so that it will be remembered. - weldGrid.insert(VNTi(v, n, t, i)); - - return i; - } - - - /** - Updates each indexArray to refer to vertices in the - outputVertexArray. - - Called from process() - */ - void updateTriLists( - Array*>& indexArrayArray, - const Array& vertexArray, - const Array& normalArray, - const Array& texCoordArray) { - - // Compute a hash grid so that we can find neighbors quickly. - // It begins empty and is extended as the tri lists are iterated - // through. - weldGrid.clear(); - - // Process all triLists - int numTriLists = indexArrayArray.size(); - int u = 0; - for (int t = 0; t < numTriLists; ++t) { - Array& triList = *(indexArrayArray[t]); - - // For all vertices in this list - for (int v = 0; v < triList.size(); ++v) { - // This vertex mapped to u in the flatVertexArray - triList[v] = getIndex(vertexArray[u], normalArray[u], texCoordArray[u]); - - /* -# ifdef G3D_DEBUG - { - int i = triList[v]; - Vector3 N = normalArray[i]; - debugAssertM(N.length() > 0.9f, "Produced non-unit normal"); - } -# endif - */ - ++u; - } - } - } - - /** Expands the indexed triangle lists into a triangle list. - - Called from process() */ - void unroll( - const Array*>& indexArrayArray, - const Array& vertexArray, - const Array& texCoordArray, - Array& unrolledVertexArray, - Array& unrolledTexCoordArray) { - - int numTriLists = indexArrayArray.size(); - for (int t = 0; t < numTriLists; ++t) { - const Array& triList = *(indexArrayArray[t]); - for (int v = 0; v < triList.size(); ++v) { - int i = triList[v]; - unrolledVertexArray.append(vertexArray[i]); - unrolledTexCoordArray.append(texCoordArray[i]); - } - } - } - - /** For every three vertices, compute the face normal and store it three times. - Sliver triangles have a zero surface normal, which we will later take to - match *any* surface normal. */ - void computeFaceNormals( - const Array& vertexArray, - Array& faceNormalArray) { - - debugAssertM(vertexArray.size() % 3 == 0, "Input is not a triangle soup"); - debugAssertM(faceNormalArray.size() == 0, "Output must start empty."); - - for (int v = 0; v < vertexArray.size(); v += 3) { - const Vector3& e0 = vertexArray[v + 1] - vertexArray[v]; - const Vector3& e1 = vertexArray[v + 2] - vertexArray[v]; - - // Note that the length may be zero in the case of sliver polygons, e.g., - // those correcting a T-junction. - const Vector3& n = e0.cross(e1).directionOrZero(); - - // Append the normal once per vertex. - faceNormalArray.append(n, n, n); - } - } - - - /** - Computes @a smoothNormalArray, whose elements are those of normalArray averaged - with neighbors within the angular cutoff. - */ - void smoothNormals( - const Array& vertexArray, - const Array& normalArray, - Array& smoothNormalArray) { - - const float cosThresholdAngle = (float)cos(normalSmoothingAngle); - - debugAssert(vertexArray.size() == normalArray.size()); - smoothNormalArray.resize(normalArray.size()); - - // Compute a hash grid so that we can find neighbors quickly. - PointHashGrid grid(vertexWeldRadius); - for (int v = 0; v < normalArray.size(); ++v) { - grid.insert(VN(vertexArray[v], normalArray[v])); - } - - for (int v = 0; v < normalArray.size(); ++v) { - // Compute the sum of all nearby normals within the cutoff angle. - // Search within the vertexWeldRadius, since those are the vertices - // that will collapse to the same point. - PointHashGrid::SphereIterator it = - grid.beginSphereIntersection(Sphere(vertexArray[v], vertexWeldRadius)); - - Vector3 sum; - - const Vector3& original = normalArray[v]; - while (it.hasMore()) { - const Vector3& N = it->normal; - const float cosAngle = N.dot(original); - - if (cosAngle > cosThresholdAngle) { - // This normal is close enough to consider - sum += N; - } - ++it; - } - - const Vector3& average = sum.directionOrZero(); - - const bool indeterminate = average.isZero(); - // Never "smooth" a normal so far that it points backwards - const bool backFacing = original.dot(average) < 0; - - if (indeterminate || backFacing) { - // Revert to the face normal - smoothNormalArray[v] = original; - } else { - // Average available normals - smoothNormalArray[v] = average; - } - } - } - -public: - - - /** - Algorithm: - - 1. Unroll the indexed triangle list into a triangle list, where - there are duplicated vertices. - - 2. Compute face normals for all triangles, and expand those into - the triangle vertices. - - 3. At each vertex, average all normals that are within normalSmoothingAngle. - - 4. Generate output indexArrayArray. While doing so, merge all vertices where - the distance between position, texCoord, and normal is within the thresholds. - */ - void process( - Array& vertexArray, - Array& texCoordArray, - Array& normalArray, - Array*>& indexArrayArray, - float normAngle, - float texRadius, - float normRadius) { - - normalSmoothingAngle = normAngle; - normalWeldRadius2 = square(normRadius); - texCoordWeldRadius2 = square(texRadius); - - const bool hasTexCoords = (texCoordArray.size() > 0); - - if (hasTexCoords) { - debugAssertM(vertexArray.size() == texCoordArray.size(), - "Input arrays are not parallel."); - } - - Array unrolledVertexArray; - Array unrolledFaceNormalArray; - Array unrolledSmoothNormalArray; - Array unrolledTexCoordArray; - - if (! hasTexCoords) { - // Generate all zero texture coordinates - texCoordArray.resize(vertexArray.size()); - } - - // Generate a flat (unrolled) triangle list with texture coordinates. - unroll(indexArrayArray, vertexArray, texCoordArray, - unrolledVertexArray, unrolledTexCoordArray); - - // Put the output back into the input slots. Clear immediately to reduce peak - // memory. - outputVertexArray = &vertexArray; - outputNormalArray = &normalArray; - outputTexCoordArray = &texCoordArray; - outputVertexArray->fastClear(); - outputNormalArray->fastClear(); - outputTexCoordArray->fastClear(); - - // For every three vertices, generate their face normal and store it at - // each vertex. The output array has the same length as the input. - computeFaceNormals(unrolledVertexArray, unrolledFaceNormalArray); - - // Compute smooth normals at vertices. - smoothNormals(unrolledVertexArray, unrolledFaceNormalArray, unrolledSmoothNormalArray); - unrolledFaceNormalArray.clear(); - - // Regenerate the triangle lists - updateTriLists(indexArrayArray, unrolledVertexArray, unrolledSmoothNormalArray, unrolledTexCoordArray); - - if (! hasTexCoords) { - // Throw away the generated texCoords - texCoordArray.resize(0); - } - } - - WeldHelper(float vertRadius) : - weldGrid(vertRadius), - vertexWeldRadius(vertRadius) {} - -}; -} // Internal - -void MeshAlg::weld( - Array& vertexArray, - Array& texCoordArray, - Array& normalArray, - Array*>& indexArrayArray, - float normalSmoothingAngle, - float vertexWeldRadius, - float textureWeldRadius, - float normalWeldRadius) { - - _internal::WeldHelper(vertexWeldRadius).process( - vertexArray, texCoordArray, normalArray, indexArrayArray, - normalSmoothingAngle, textureWeldRadius, normalWeldRadius); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/MeshBuilder.cpp b/externals/g3dlite/G3D.lib/source/MeshBuilder.cpp deleted file mode 100644 index 43ee6e50ac8..00000000000 --- a/externals/g3dlite/G3D.lib/source/MeshBuilder.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/** - @file MeshBuilder.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-02-27 - @edited 2005-02-24 - */ - -#include "G3D/MeshBuilder.h" -#include "G3D/MeshAlg.h" - -namespace G3D { - -void MeshBuilder::setName(const std::string& n) { - name = n; -} - - -void MeshBuilder::commit(std::string& n, Array& indexArray, Array& outvertexArray) { - n = name; - - // Make the data fit in a unit cube - centerTriList(); - - Array toNew, toOld; - - if (close == MeshBuilder::AUTO_WELD) { - Array index; - MeshAlg::createIndexArray(triList.size(), index); - double minEdgeLen, maxEdgeLen, meanEdgeLen, medianEdgeLen; - double minFaceArea, maxFaceArea, meanFaceArea, medianFaceArea; - MeshAlg::computeAreaStatistics(triList, index, - minEdgeLen, meanEdgeLen, medianEdgeLen, maxEdgeLen, - minFaceArea, meanFaceArea, medianFaceArea, maxFaceArea); - close = minEdgeLen * 0.1; - } - - MeshAlg::computeWeld(triList, outvertexArray, toNew, toOld, close); - - // Construct triangles - for (int t = 0; t < triList.size(); t += 3) { - int index[3]; - - for (int i = 0; i < 3; ++i) { - index[i] = toNew[t + i]; - } - - // Throw out zero size triangles - if ((index[0] != index[1]) && - (index[1] != index[2]) && - (index[2] != index[0])) { - indexArray.append(index[0], index[1], index[2]); - } - } -} - - -void MeshBuilder::centerTriList() { - // Compute the range of the vertices - Vector3 vmin, vmax; - - computeBounds(vmin, vmax); - - Vector3 diagonal = vmax - vmin; - double scale = max(max(diagonal.x, diagonal.y), diagonal.z) / 2; - debugAssert(scale > 0); - - Vector3 translation = vmin + diagonal / 2; - - // Center and scale all vertices in the input list - int v; - - //Matrix3 rot90 = Matrix3::fromAxisAngle(Vector3::UNIT_Y, toRadians(180)) * Matrix3::fromAxisAngle(Vector3::UNIT_X, toRadians(90)); - for (v = 0; v < triList.size(); ++v) { - triList[v] = (triList[v] - translation) / scale; - //triList[v] = rot90 * triList[v]; - } -} - - -void MeshBuilder::computeBounds(Vector3& min, Vector3& max) { - min = Vector3::inf(); - max = -min; - - int v; - for (v = 0; v < triList.size(); ++v) { - min = min.min(triList[v]); - max = max.max(triList[v]); - } -} - - -void MeshBuilder::addTriangle(const Vector3& a, const Vector3& b, const Vector3& c) { - triList.append(a, b, c); - - if (_twoSided) { - triList.append(c, b, a); - } -} - - -void MeshBuilder::addQuad(const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d) { - addTriangle(a, b, c); - addTriangle(a, c, d); -} - - -void MeshBuilder::addTriangle(const Triangle& t) { - addTriangle(t.vertex(0), t.vertex(1), t.vertex(2)); -} - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/NetAddress.cpp b/externals/g3dlite/G3D.lib/source/NetAddress.cpp deleted file mode 100644 index 64d692d4763..00000000000 --- a/externals/g3dlite/G3D.lib/source/NetAddress.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/** - @file NetMessage.cpp - - @maintainer Morgan McGuire, morgan@cs.brown.edu - @created 2005-02-06 - @edited 2005-02-06 - */ -#include "G3D/platform.h" -#include "G3D/NetAddress.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Array.h" -#include "G3D/stringutils.h" -#include "G3D/System.h" -#include "G3D/NetworkDevice.h" - -#if defined(G3D_LINUX) || defined(G3D_OSX) - #include - #include - #include - #include - #include - #include - #include - #define _alloca alloca - -# ifndef SOCKADDR_IN -# define SOCKADDR_IN struct sockaddr_in -# endif -# ifndef SOCKET -# define SOCKET int -# endif - -// SOCKADDR_IN is supposed to be defined in NetAddress.h -#ifndef SOCKADDR_IN -# error Network headers included in wrong order -#endif -#endif - - -namespace G3D { - -NetAddress::NetAddress() { - System::memset(&addr, 0, sizeof(addr)); -} - -void NetAddress::init(uint32 host, uint16 port) { - if ((host != 0) || (port != 0)) { - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (host == 0) { - host = INADDR_ANY; - } - addr.sin_addr.s_addr = htonl(host); - } else { - System::memset(&addr, 0, sizeof(addr)); - } -} - - -NetAddress::NetAddress( - const std::string& hostname, - uint16 port) { - init(hostname, port); -} - - -void NetAddress::init( - const std::string& hostname, - uint16 port) { - - uint32 addr; - - if (hostname == "") { - addr = INADDR_NONE; - } else { - addr = inet_addr(hostname.c_str()); - } - - // The address wasn't in numeric form, resolve it - if (addr == INADDR_NONE) { - // Get the IP address of the server and store it in host - struct hostent* host = gethostbyname(hostname.c_str()); - - if (host == NULL) { - init(0, 0); - return; - } - - System::memcpy(&addr, host->h_addr_list[0], host->h_length); - } - - if (addr != INADDR_NONE) { - addr = ntohl(addr); - } - init(addr, port); -} - - -NetAddress::NetAddress(uint32 hostip, uint16 port) { - init(hostip, port); -} - - -NetAddress NetAddress::broadcastAddress(uint16 port) { - return NetAddress(NetworkDevice::instance()->broadcastAddressArray()[0], port); -} - - -NetAddress::NetAddress(const std::string& hostnameAndPort) { - - Array part = stringSplit(hostnameAndPort, ':'); - - debugAssert(part.length() == 2); - init(part[0], atoi(part[1].c_str())); -} - - -NetAddress::NetAddress(const SOCKADDR_IN& a) { - addr = a; -} - - -NetAddress::NetAddress(const struct in_addr& addr, uint16 port) { - #ifdef G3D_WIN32 - init(ntohl(addr.S_un.S_addr), port); - #else - init(htonl(addr.s_addr), port); - #endif -} - - -void NetAddress::serialize(class BinaryOutput& b) const { - b.writeUInt32(ip()); - b.writeUInt16(port()); -} - - -void NetAddress::deserialize(class BinaryInput& b) { - uint32 i; - uint16 p; - - i = b.readUInt32(); - p = b.readUInt16(); - - init(i, p); -} - - -bool NetAddress::ok() const { - return addr.sin_family != 0; -} - - -std::string NetAddress::ipString() const { - return format("%s", inet_ntoa(*(in_addr*)&(addr.sin_addr))); -} - - -std::string NetAddress::toString() const { - return ipString() + format(":%d", ntohs(addr.sin_port)); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/NetworkDevice.cpp b/externals/g3dlite/G3D.lib/source/NetworkDevice.cpp deleted file mode 100644 index 246c97d4dbf..00000000000 --- a/externals/g3dlite/G3D.lib/source/NetworkDevice.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -/** - @file NetworkDevice.cpp - - @maintainer Morgan McGuire, morgan@cs.brown.edu - @created 2002-11-22 - @edited 2006-02-24 - */ - -#include -#include -#include "G3D/platform.h" -#include "G3D/TextOutput.h" -#include "G3D/NetworkDevice.h" -#include "G3D/NetAddress.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Log.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/stringutils.h" -#include "G3D/debug.h" - -#include - -#if defined(G3D_LINUX) || defined(G3D_OSX) || defined(G3D_FREEBSD) -# include -# include -# include -# include -# include -# ifdef __linux__ -# include -# include -# include -# include -// Match Linux to FreeBSD -# define AF_LINK AF_PACKET -# else -# include -# include -# endif - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #include - - #define _alloca alloca - - /** Define an error code for non-windows platforms. */ - int WSAGetLastError() { - return -1; - } - - #define SOCKET_ERROR -1 - - static std::string socketErrorCode(int code) { - return G3D::format("CODE %d: %s\n", code, strerror(code)); - } - - static std::string socketErrorCode() { - return socketErrorCode(errno); - } - - static const int WSAEWOULDBLOCK = -100; - - typedef int SOCKET; - typedef struct sockaddr_in SOCKADDR_IN; - -#else - - // Windows - static std::string socketErrorCode(int code) { - LPTSTR formatMsg = NULL; - - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - code, - 0, - (LPTSTR)&formatMsg, - 0, - NULL); - - return G3D::format("CODE %d: %s\n", code, formatMsg); - } - - static std::string socketErrorCode() { - return socketErrorCode(GetLastError()); - } - -#endif - - -#ifndef _SOCKLEN_T -# if defined(G3D_WIN32) || defined(G3D_OSX) - typedef int socklen_t; -# endif -#endif - -namespace G3D { - -NetworkDevice* NetworkDevice::s_instance = NULL; - -std::ostream& operator<<(std::ostream& os, const NetAddress& a) { - return os << a.toString(); -} - - -static void logSocketInfo(const SOCKET& sock) { - uint32 val; - socklen_t sz = 4; - int ret; - - ret = getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_RCVBUF = %d\n", val); - - ret = getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_SNDBUF = %d\n", val); - - // Note: timeout = 0 means no timeout - ret = getsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_RCVTIMEO = %d\n", val); - - ret = getsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char*)&val, (socklen_t*)&sz); - logPrintf("SOL_SOCKET/SO_SNDTIMEO = %d\n", val); -} - - -///////////////////////////////////////////////////////////////////////////// - -/** Invokes select on one socket. Returns SOCKET_ERROR on error, 0 if - there is no read pending, sock if there a read pending. */ -static int selectOneReadSocket(const SOCKET& sock) { - // 0 time timeout is specified to poll and return immediately - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - // Create a set that contains just this one socket - fd_set socketSet; - FD_ZERO(&socketSet); - FD_SET(sock, &socketSet); - - int ret = select(sock + 1, &socketSet, NULL, NULL, &timeout); - - return ret; -} - - -/** Returns true if the socket has a read pending */ -static bool readWaiting(const SOCKET& sock) { - int ret = selectOneReadSocket(sock); - - switch (ret) { - case SOCKET_ERROR: - logPrintf("ERROR: selectOneReadSocket returned " - "SOCKET_ERROR in readWaiting(). %s", socketErrorCode().c_str()); - // Return true so that we'll force an error on read and close - // the socket. - return true; - - case 0: - return false; - - default: - return true; - } -} - - -/** Invokes select on one socket. */ -static int selectOneWriteSocket(const SOCKET& sock) { - // 0 time timeout is specified to poll and return immediately - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - // Create a set that contains just this one socket - fd_set socketSet; - FD_ZERO(&socketSet); - FD_SET(sock, &socketSet); - - return select(sock + 1, NULL, &socketSet, NULL, &timeout); -} - -/////////////////////////////////////////////////////////////////////////////// - -NetworkDevice* NetworkDevice::instance() { - if (s_instance == NULL) { - s_instance = new NetworkDevice(); - if (! s_instance->init()) { - delete s_instance; - s_instance = NULL; - } - } - return s_instance; -} - - -void NetworkDevice::cleanup() { - if (s_instance) { - s_instance->_cleanup(); - delete s_instance; - s_instance = NULL; - } -} - - -NetworkDevice::NetworkDevice() { - initialized = false; -} - - -NetworkDevice::~NetworkDevice() { -} - - -std::string NetworkDevice::localHostName() const { - char ac[128]; - if (gethostname(ac, sizeof(ac)) == -1) { - Log::common()->printf("Error while getting local host name\n"); - return "localhost"; - } - return gethostbyname(ac)->h_name; -} - -#ifndef G3D_WIN32 -const char* errnoToString() { - switch (errno) { - case EBADF: - return "file descriptor is invalid."; - - case EINVAL: - return "Request or argp is not valid."; - - case ENOTTY: - return - "file descriptor is not associated with a character special device OR " - "The specified request does not apply to the " - "kind of object that the descriptor fildes references."; - - case EADDRNOTAVAIL: - return "Address not available."; - - default: - { - static char buffer[20]; - sprintf(buffer, "Error %d", errno); - return buffer; - } - } -} -#endif - - -NetworkDevice::EthernetAdapter::EthernetAdapter() { - name = ""; - ip = 0; - hostname = ""; - subnet = 0; - broadcast = 0; - for (int i = 0; i < 6; ++i) { - mac[i] = 0; - } -} - -void NetworkDevice::EthernetAdapter::describe(TextOutput& t) const { - t.writeSymbol("{"); - t.pushIndent(); - t.writeNewline(); - - t.writeSymbols("hostname", "="); - t.writeString(hostname); - t.writeNewline(); - - t.writeSymbols("name", "="); - t.writeString(name); - t.writeNewline(); - - t.writeSymbols("ip", "="); - t.writeSymbol(formatIP(ip)); - t.writeNewline(); - - t.writeSymbols("subnet", "="); - t.writeSymbol(formatIP(subnet)); - t.writeNewline(); - - t.writeSymbols("broadcast", "="); - t.writeSymbol(formatIP(broadcast)); - t.writeNewline(); - - t.writeSymbols("mac", "="); - t.writeSymbol(formatMAC(mac)); - t.writeNewline(); - - t.popIndent(); - t.writeSymbol("}"); - t.writeNewline(); -} - - -void NetworkDevice::addAdapter(const EthernetAdapter& a) { - m_adapterArray.append(a); - if (a.broadcast != 0) { - int i = m_broadcastAddresses.findIndex(a.broadcast); - if (i == -1) { - m_broadcastAddresses.append(a.broadcast); - } - } -} - - -std::string NetworkDevice::formatIP(uint32 addr) { - return format("%3d.%3d.%3d.%3d", (addr >> 24) & 0xFF, (addr >> 16) & 0xFF, - (addr >> 8) & 0xFF, addr & 0xFF); -} - - -std::string NetworkDevice::formatMAC(const uint8 MAC[6]) { - return format("%02x:%02x:%02x:%02x:%02x:%02x", MAC[0], MAC[1], MAC[2], MAC[3], MAC[4], MAC[5]); -} - - -#ifdef G3D_WIN32 - -bool NetworkDevice::init() { - debugAssert(! initialized); - - logPrintf("Network Startup"); - logPrintf("Starting WinSock networking.\n"); - WSADATA wsda; - WSAStartup(MAKEWORD(G3D_WINSOCK_MAJOR_VERSION, G3D_WINSOCK_MINOR_VERSION), &wsda); - - std::string hostname = "localhost"; - { - char ac[128]; - if (gethostname(ac, sizeof(ac)) == -1) { - logPrintf("Warning: Error while getting local host name\n"); - } else { - hostname = gethostbyname(ac)->h_name; - } - } - - EthernetAdapter a; - a.hostname = hostname; - a.name = ""; - a.ip = NetAddress(hostname, 0).ip(); - - // TODO: Find subnet on Win32 - a.subnet = 0x0000FFFF; - - // TODO: Find broadcast on Win32 - a.broadcast = 0xFFFFFFFF; - - // TODO: find MAC on Win32 - - addAdapter(a); - - std::string machine = localHostName(); - std::string addr = NetAddress(machine, 0).ipString(); - logPrintf( - "Network:\n" - " Status: %s\n" - " Loaded winsock specification version %d (%d is " - "the highest available)\n" - " %d sockets available\n" - " Largest UDP datagram packet size is %d bytes\n\n", - wsda.szDescription, - wsda.szSystemStatus, - wsda.wVersion, - wsda.wHighVersion, - wsda.iMaxSockets, - wsda.iMaxUdpDg); - - // TODO: WSAIoctl for subnet and broadcast addresses - // http://msdn.microsoft.com/en-us/library/ms741621(VS.85).aspx - // - // TODO: SIO_GET_INTERFACE_LIST - - initialized = true; - - return true; -} -#endif - - -#if defined(G3D_LINUX) || defined(G3D_OSX) || defined(G3D_FREEBSD) - -const sockaddr_in* castToIP4(const sockaddr* addr) { - if (addr == NULL) { - return NULL; - } else if (addr->sa_family == AF_INET) { - // An IPv4 address - return reinterpret_cast(addr); - } else { - // Not an IPv4 address - return NULL; - } -} - -uint32 getIP(const sockaddr_in* addr) { - if (addr != NULL) { - return ntohl(addr->sin_addr.s_addr); - } else { - return 0; - } -} - - -bool NetworkDevice::init() { - debugAssert(! initialized); - - // Used for combining the MAC and ip information - typedef Table AdapterTable; - - AdapterTable table; - - // Head of a linked list of network interfaces on this machine - ifaddrs* ifap = NULL; - - int r = getifaddrs(&ifap); - - if (r != 0) { - logPrintf("ERROR: getifaddrs returned %d\n", r); - return false; - } - - ifaddrs* current = ifap; - - if (current == NULL) { - logPrintf("WARNING: No network interfaces found\n"); - EthernetAdapter a; - a.name = "fallback"; - a.hostname = "localhost"; - a.ip = (127 << 24) | 1; - a.broadcast = 0xFFFFFFFF; - a.subnet = 0x000000FF; - addAdapter(a); - - } else { - - while (current != NULL) { - - bool up = (current->ifa_flags & IFF_UP); - bool loopback = (current->ifa_flags & IFF_LOOPBACK); - - if (! up || loopback) { - // Skip this adapter; it is offline or is a loopback - current = current->ifa_next; - continue; - } - - if (! table.containsKey(current->ifa_name)) { - EthernetAdapter a; - a.name = current->ifa_name; - table.set(a.name, a); - } - - // This adapter must exist because it was created above - EthernetAdapter& adapter = table[current->ifa_name]; - - const sockaddr_in* interfaceAddress = castToIP4(current->ifa_addr); - const sockaddr_in* broadcastAddress = castToIP4(current->ifa_dstaddr); - const sockaddr_in* subnetMask = castToIP4(current->ifa_netmask); - - uint32 ip = getIP(interfaceAddress); - uint32 ba = getIP(broadcastAddress); - uint32 sn = getIP(subnetMask); - - if (ip != 0) { - adapter.ip = ip; - } - - if (ba != 0) { - adapter.broadcast = ba; - } - - if (sn != 0) { - adapter.subnet = sn; - } - - uint8_t* MAC = NULL; - // Extract MAC address - if ((current->ifa_addr != NULL) && (current->ifa_addr->sa_family == AF_LINK)) { -# ifdef __linux__ - { - // Linux - struct ifreq ifr; - - int fd = socket(AF_INET, SOCK_DGRAM, 0); - - ifr.ifr_addr.sa_family = AF_INET; - strcpy(ifr.ifr_name, current->ifa_name); - ioctl(fd, SIOCGIFHWADDR, &ifr); - close(fd); - - MAC = reinterpret_cast(ifr.ifr_hwaddr.sa_data); - } -# else - { - // The MAC address and the interfaceAddress come in as - // different interfaces with the same name. - - // Posix/FreeBSD/Mac OS - sockaddr_dl* sdl = (struct sockaddr_dl *)current->ifa_addr; - MAC = reinterpret_cast(LLADDR(sdl)); - } -# endif - - // See if there was a MAC address - if (MAC != NULL) { - bool anyNonZero = false; - for (int i = 0; i < 6; ++i) { - anyNonZero = anyNonZero || (MAC[i] != 0); - } - if (anyNonZero) { - System::memcpy(adapter.mac, MAC, 6); - } - } - } - - current = current->ifa_next; - } - - freeifaddrs(ifap); - ifap = NULL; - } - - // Extract all interesting adapters from the table - for (AdapterTable::Iterator it = table.begin(); it.hasMore(); ++it) { - const EthernetAdapter& adapter = it->value; - - // Only add adapters that have IP addresses - if (adapter.ip != 0) { - addAdapter(adapter); - } else { - logPrintf("NetworkDevice: Ignored adapter %s because ip = 0\n", adapter.name.c_str()); - } - } - - initialized = true; - - return true; -} - -#endif - - -void NetworkDevice::_cleanup() { - debugAssert(initialized); - - logPrintf("Network Cleanup"); -# ifdef G3D_WIN32 - WSACleanup(); -# endif - logPrintf("Network cleaned up."); -} - -bool NetworkDevice::bind(SOCKET sock, const NetAddress& addr) const { - Log::common()->printf("Binding socket %d on port %d ", - sock, htons(addr.addr.sin_port)); - if (::bind(sock, (struct sockaddr*)&(addr.addr), sizeof(addr.addr)) == - SOCKET_ERROR) { - - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - closesocket(sock); - return false; - } - - Log::common()->println("Ok"); - return true; -} - - -void NetworkDevice::closesocket(SOCKET& sock) const { - if (sock != 0) { - #ifdef G3D_WIN32 - ::closesocket(sock); - #else - close(sock); - #endif - - Log::common()->printf("Closed socket %d\n", sock); - sock = 0; - } -} - - -void NetworkDevice::localHostAddresses(Array& array) const { - array.resize(0); - - char ac[128]; - - if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) { - Log::common()->printf("Error while getting local host name\n"); - return; - } - - struct hostent* phe = gethostbyname(ac); - if (phe == 0) { - Log::common()->printf("Error while getting local host address\n"); - return; - } - - for (int i = 0; (phe->h_addr_list[i] != 0); ++i) { - struct in_addr addr; - memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr)); - array.append(NetAddress(addr)); - } -} - -/////////////////////////////////////////////////////////////////////////////// - -Conduit::Conduit() : binaryOutput("", G3D_LITTLE_ENDIAN) { - sock = 0; - mSent = 0; - mReceived = 0; - bSent = 0; - bReceived = 0; -} - - -Conduit::~Conduit() { - NetworkDevice::instance()->closesocket(sock); -} - - -uint64 Conduit::bytesSent() const { - return bSent; -} - - -uint64 Conduit::bytesReceived() const { - return bReceived; -} - - -uint64 Conduit::messagesSent() const { - return mSent; -} - - -uint64 Conduit::messagesReceived() const { - return mReceived; -} - - -bool Conduit::ok() const { - return (sock != 0) && (sock != SOCKET_ERROR); -} - - -bool Conduit::messageWaiting() { - return readWaiting(sock); -} - - -/** - Increases the send and receive sizes of a socket to 2 MB from 8k - */ -static void increaseBufferSize(SOCKET sock) { - - // Increase the buffer size; the default (8192) is too easy to - // overflow when the network latency is high. - { - uint32 val = 1024 * 1024 * 2; - if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, - (char*)&val, sizeof(val)) == SOCKET_ERROR) { - Log::common()->printf("WARNING: Increasing socket " - "receive buffer to %d failed.\n", val); - Log::common()->println(socketErrorCode()); - } - - if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, - (char*)&val, sizeof(val)) == SOCKET_ERROR) { - Log::common()->printf("WARNING: Increasing socket " - "send buffer to %d failed.\n", val); - Log::common()->println(socketErrorCode()); - } - } -} - -////////////////////////////////////////////////////////////////////////////// - -ReliableConduitRef ReliableConduit::create(const NetAddress& address) { - return new ReliableConduit(address); -} - - -ReliableConduit::ReliableConduit( - const NetAddress& _addr) : state(NO_MESSAGE), receiveBuffer(NULL), - receiveBufferTotalSize(0), receiveBufferUsedSize(0) { - - NetworkDevice* nd = NetworkDevice::instance(); - - messageType = 0; - - addr = _addr; - Log::common()->print("Creating a TCP socket "); - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - - if (sock == SOCKET_ERROR) { - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - return; - } - - Log::common()->println("Ok"); - - // Setup socket options (both constructors should set the same options) - - // Disable Nagle's algorithm (we send lots of small packets) - const int T = true; - if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Disabling Nagel's " - "algorithm failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Disabled Nagel's algorithm."); - } - - // Set the NO LINGER option so the socket doesn't hang around if - // there is unsent data in the queue when it closes. - struct linger ling; - ling.l_onoff = 0; - ling.l_linger = 0; - if (setsockopt(sock, SOL_SOCKET, SO_LINGER, - (const char*)&ling, sizeof(ling)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket no linger failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option no_linger."); - } - - // Set reuse address so that a new server can start up soon after - // an old one has closed. - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket reuseaddr failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option reuseaddr."); - } - - // Ideally, we'd like to specify IPTOS_LOWDELAY as well. - - logSocketInfo(sock); - - increaseBufferSize(sock); - - Log::common()->printf("Created TCP socket %d\n", sock); - - std::string x = addr.toString(); - Log::common()->printf("Connecting to %s on TCP socket %d ", x.c_str(), sock); - - int ret = connect(sock, (struct sockaddr *) &(addr.addr), sizeof(addr.addr)); - - if (ret == WSAEWOULDBLOCK) { - RealTime t = System::time() + 5.0; - // Non-blocking; we must wait until select returns non-zero - while ((selectOneWriteSocket(sock) == 0) && (System::time() < t)) { - System::sleep(0.02); - } - - // TODO: check for failure on the select call - - } else if (ret != 0) { - sock = (SOCKET)SOCKET_ERROR; - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - return; - } - - Log::common()->println("Ok"); -} - - -ReliableConduit::ReliableConduit( - const SOCKET& _sock, - const NetAddress& _addr) : - state(NO_MESSAGE), - receiveBuffer(NULL), - receiveBufferTotalSize(0), - receiveBufferUsedSize(0) { - sock = _sock; - addr = _addr; - - messageType = 0; - - // Setup socket options (both constructors should set the same options) - - // Disable Nagle's algorithm (we send lots of small packets) - const int T = true; - if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Disabling Nagel's algorithm failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Disabled Nagel's algorithm."); - } - - // Set the NO LINGER option so the socket doesn't hang around if - // there is unsent data in the queue when it closes. - struct linger ling; - ling.l_onoff = 0; - ling.l_linger = 0; - if (setsockopt(sock, SOL_SOCKET, SO_LINGER, - (const char*)&ling, sizeof(ling)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket no linger failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option no_linger."); - } - - // Set reuse address so that a new server can start up soon after - // an old one has closed. - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket reuseaddr failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option reuseaddr."); - } - - // Ideally, we'd like to specify IPTOS_LOWDELAY as well. - - logSocketInfo(sock); -} - - -ReliableConduit::~ReliableConduit() { - free(receiveBuffer); - receiveBuffer = NULL; - receiveBufferTotalSize = 0; - receiveBufferUsedSize = 0; -} - - -bool ReliableConduit::messageWaiting() { - switch (state) { - case HOLDING: - // We've already read the message and are waiting - // for a receive call. - return true; - - case RECEIVING: - - if (! ok()) { - return false; - } - // We're currently receiving the message. Read a little more. - receiveIntoBuffer(); - - if (messageSize == receiveBufferUsedSize) { - // We've read the whole mesage. Switch to holding state - // and return true. - state = HOLDING; - return true; - } else { - // There are more bytes left to read. We'll read them on - // the next call. Because the *entire* message is not ready, - // return false. - return false; - } - break; - - case NO_MESSAGE: - if (Conduit::messageWaiting()) { - // Message incoming. Read the header. - - state = RECEIVING; - receiveHeader(); - - // Loop back around now that we're in the receive state; we - // may be able to read the whole message before returning - // to the caller. - return messageWaiting(); - } else { - // No message incoming. - return false; - } - } - - debugAssertM(false, "Should not reach this point"); - return false; -} - - -uint32 ReliableConduit::waitingMessageType() { - // The messageWaiting call is what actually receives the message. - if (messageWaiting()) { - return messageType; - } else { - return 0; - } -} - - -void ReliableConduit::sendBuffer(const BinaryOutput& b) { - NetworkDevice* nd = NetworkDevice::instance(); - int ret = ::send(sock, (const char*)b.getCArray(), b.size(), 0); - - if (ret == SOCKET_ERROR) { - Log::common()->println("Error occured while sending message."); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - return; - } - - ++mSent; - bSent += b.size(); - - // Verify the packet was actually sent - // Conversion to unsigned is safe because -1 is caught earlier - debugAssert(ret == b.size()); -} - - -/** Null serializer. Used by reliable conduit::send(type) */ -class Dummy { -public: - void serialize(BinaryOutput& b) const { (void)b; } -}; - - -void ReliableConduit::send(uint32 type) { - static Dummy dummy; - send(type, dummy); -} - - - -NetAddress ReliableConduit::address() const { - return addr; -} - - -void ReliableConduit::receiveHeader() { - NetworkDevice* nd = NetworkDevice::instance(); - debugAssert(state == RECEIVING); - - // Read the type - uint32 tmp; - int ret = recv(sock, (char*)&tmp, sizeof(tmp), 0); - - // The type is the first four bytes. It is little endian. - if (System::machineEndian() == G3D_LITTLE_ENDIAN) { - messageType = tmp; - } else { - // Swap the byte order - for (int i = 0; i < 4; ++i) { - ((char*)&messageType)[i] = ((char*)&tmp)[3 - i]; - } - } - - if ((ret == SOCKET_ERROR) || (ret != sizeof(messageType))) { - Log::common()->printf("Call to recv failed. ret = %d," - " sizeof(messageType) = %d\n", - (int)ret, (int)sizeof(messageType)); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - messageType = 0; - return; - } - - // Read the size - ret = recv(sock, (char*)&messageSize, sizeof(messageSize), 0); - - if ((ret == SOCKET_ERROR) || (ret != sizeof(messageSize))) { - Log::common()->printf("Call to recv failed. ret = %d," - " sizeof(len) = %d\n", (int)ret, - (int)sizeof(messageSize)); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - messageType = 0; - return; - } - - messageSize = ntohl(messageSize); - debugAssert(messageSize < 6e7); - - debugAssert(receiveBufferUsedSize == 0); - - // Extend the size of the buffer. - if (messageSize > receiveBufferTotalSize) { - receiveBuffer = realloc(receiveBuffer, messageSize); - receiveBufferTotalSize = messageSize; - } - - if (receiveBuffer == NULL) { - Log::common()->println("Could not allocate a memory buffer " - "during receivePacket."); - nd->closesocket(sock); - } - - bReceived += 4; -} - - -void ReliableConduit::receiveIntoBuffer() { - NetworkDevice* nd = NetworkDevice::instance(); - - debugAssert(state == RECEIVING); - debugAssert(messageType != 0); - debugAssertM(receiveBufferUsedSize < messageSize, "Message already received."); - debugAssertM(messageSize >= receiveBufferUsedSize, "Message size overflow."); - - // Read the data itself - int ret = 0; - uint32 left = messageSize - receiveBufferUsedSize; - int count = 0; - while ((ret != SOCKET_ERROR) && (left > 0) && (count < 100)) { - - ret = recv(sock, ((char*)receiveBuffer) + receiveBufferUsedSize, left, 0); - - if (ret > 0) { - left -= ret; - receiveBufferUsedSize += ret; - bReceived += ret; - - if (left > 0) { - // There's still more. Give the machine a chance to read - // more data, but don't wait forever. - - ++count; - System::sleep(0.001); - } - } else { - // Something went wrong; our blocking read returned nothing. - break; - } - } - - if ((ret == 0) || (ret == SOCKET_ERROR)) { - - if (ret == SOCKET_ERROR) { - Log::common()->printf("Call to recv failed. ret = %d," - " sizeof(messageSize) = %d\n", ret, messageSize); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->printf("recv returned 0\n"); - } - nd->closesocket(sock); - return; - } - - ++mReceived; -} - - -/////////////////////////////////////////////////////////////////////////////// -LightweightConduitRef LightweightConduit::create( - uint16 receivePort, - bool enableReceive, - bool enableBroadcast) { - - return new LightweightConduit(receivePort, enableReceive, enableBroadcast); -} - -LightweightConduit::LightweightConduit( - uint16 port, - bool enableReceive, - bool enableBroadcast) { - NetworkDevice* nd = NetworkDevice::instance(); - - Log::common()->print("Creating a UDP socket "); - sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - - if (sock == SOCKET_ERROR) { - sock = 0; - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - return; - } - Log::common()->println("Ok"); - - if (enableReceive) { - debugAssert(port != 0); - if (! nd->bind(sock, NetAddress(0, port))) { - nd->closesocket(sock); - sock = (SOCKET)SOCKET_ERROR; - } - } - - // Figuring out the MTU seems very complicated, so we just set it to 1000, - // which is likely to be safe. See IP_MTU for more information. - MTU = 1000; - - increaseBufferSize(sock); - - if (enableBroadcast) { - int TR = true; - if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, - (const char*)&TR, sizeof(TR)) != 0) { - Log::common()->println("Call to setsockopt failed"); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - sock = 0; - return; - } - } - - Log::common()->printf("Done creating UDP socket %d\n", sock); - - alreadyReadMessage = false; -} - - -LightweightConduit::~LightweightConduit() { -} - - -bool LightweightConduit::receive(NetAddress& sender) { - // This both checks to ensure that a message was waiting and - // actively consumes the message from the network stream if - // it has not been read yet. - uint32 t = waitingMessageType(); - if (t == 0) { - return false; - } - - sender = messageSender; - alreadyReadMessage = false; - - if (messageBuffer.size() < 4) { - // Something went wrong - return false; - } - - return true; -} - - -void LightweightConduit::sendBuffer(const NetAddress& a, BinaryOutput& b) { - NetworkDevice* nd = NetworkDevice::instance(); - if (sendto(sock, (const char*)b.getCArray(), b.size(), 0, - (struct sockaddr *) &(a.addr), sizeof(a.addr)) == SOCKET_ERROR) { - Log::common()->printf("Error occured while sending packet " - "to %s\n", inet_ntoa(a.addr.sin_addr)); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - } else { - ++mSent; - bSent += b.size(); - } -} - - -bool LightweightConduit::messageWaiting() { - // We may have already pulled the message off the network stream - return alreadyReadMessage || Conduit::messageWaiting(); -} - - -uint32 LightweightConduit::waitingMessageType() { - NetworkDevice* nd = NetworkDevice::instance(); - if (! messageWaiting()) { - return 0; - } - - if (! alreadyReadMessage) { - messageBuffer.resize(8192); - - SOCKADDR_IN remote_addr; - int iRemoteAddrLen = sizeof(sockaddr); - - int ret = recvfrom(sock, (char*)messageBuffer.getCArray(), - messageBuffer.size(), 0, (struct sockaddr *) &remote_addr, - (socklen_t*)&iRemoteAddrLen); - - if (ret == SOCKET_ERROR) { - Log::common()->println("Error: recvfrom failed in " - "LightweightConduit::waitingMessageType()."); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - messageBuffer.resize(0); - messageSender = NetAddress(); - messageType = 0; - return 0; - } - - messageSender = NetAddress(remote_addr); - - ++mReceived; - bReceived += ret; - - messageBuffer.resize(ret, DONT_SHRINK_UNDERLYING_ARRAY); - - // The type is the first four bytes. It is little endian. - if (System::machineEndian() == G3D_LITTLE_ENDIAN) { - messageType = *((uint32*)messageBuffer.getCArray()); - } else { - // Swap the byte order - for (int i = 0; i < 4; ++i) { - ((char*)&messageType)[i] = messageBuffer[3 - i]; - } - } - - alreadyReadMessage = true; - } - - return messageType; -} - - -/////////////////////////////////////////////////////////////////////////////// - -NetListenerRef NetListener::create(const uint16 port) { - return new NetListener(port); -} - - -NetListener::NetListener(uint16 port) { - NetworkDevice* nd = NetworkDevice::instance(); - - // Start the listener socket - Log::common()->print("Creating a listener "); - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - - if (sock == SOCKET_ERROR) { - Log::common()->printf("FAIL"); - Log::common()->println(socketErrorCode()); - return; - } - Log::common()->println("Ok"); - - const int T = true; - - // Set reuse address so that a new server can start up soon after - // an old one has closed. - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (const char*)&T, sizeof(T)) == SOCKET_ERROR) { - - Log::common()->println("WARNING: Setting socket reuseaddr failed."); - Log::common()->println(socketErrorCode()); - } else { - Log::common()->println("Set socket option reuseaddr."); - } - - - if (! nd->bind(sock, NetAddress(0, port))) { - Log::common()->printf("Unable to bind!\n"); - nd->closesocket(sock); - sock = (SOCKET)SOCKET_ERROR; - return; - } - - Log::common()->printf("Listening on port %5d ", port); - - // listen is supposed to return 0 when there is no error. - // The 2nd argument is the number of connections to allow pending - // at any time. - int L = listen(sock, 100); - if (L == SOCKET_ERROR) { - Log::common()->println("FAIL"); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - sock = (SOCKET)SOCKET_ERROR; - return; - } - Log::common()->println("Ok"); - Log::common()->printf("Now listening on socket %d.\n\n", sock); -} - - -NetListener::~NetListener() { - NetworkDevice* nd = NetworkDevice::instance(); - nd->closesocket(sock); -} - - -ReliableConduitRef NetListener::waitForConnection() { - NetworkDevice* nd = NetworkDevice::instance(); - // The address of the connecting host - SOCKADDR_IN remote_addr; - int iAddrLen = sizeof(remote_addr); - - Log::common()->println("Blocking in NetListener::waitForConnection()."); - - SOCKET sClient = accept(sock, (struct sockaddr*) &remote_addr, - (socklen_t*)&iAddrLen); - - if (sClient == SOCKET_ERROR) { - Log::common()->println("Error in NetListener::acceptConnection."); - Log::common()->println(socketErrorCode()); - nd->closesocket(sock); - return NULL; - } - - Log::common()->printf("%s connected, transferred to socket %d.\n", - inet_ntoa(remote_addr.sin_addr), sClient); - - #ifndef G3D_WIN32 - return new ReliableConduit(sClient, - NetAddress(htonl(remote_addr.sin_addr.s_addr), - ntohs(remote_addr.sin_port))); - #else - return new ReliableConduit(sClient, - NetAddress(ntohl(remote_addr.sin_addr.S_un.S_addr), - ntohs(remote_addr.sin_port))); - #endif -} - - -bool NetListener::ok() const { - return (sock != 0) && (sock != SOCKET_ERROR); -} - - -bool NetListener::clientWaiting() const { - return readWaiting(sock); -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -void NetworkDevice::describeSystem( - TextOutput& t) { - - t.writeSymbols("Network", "{"); - t.writeNewline(); - t.pushIndent(); - - for (int i = 0; i < m_adapterArray.size(); ++i) { - m_adapterArray[i].describe(t); - } - - - t.popIndent(); - t.writeSymbols("}"); - t.writeNewline(); - t.writeNewline(); -} - - -void NetworkDevice::describeSystem( - std::string& s) { - - TextOutput t; - describeSystem(t); - t.commitString(s); -} - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/PhysicsFrame.cpp b/externals/g3dlite/G3D.lib/source/PhysicsFrame.cpp deleted file mode 100644 index 034e585d01f..00000000000 --- a/externals/g3dlite/G3D.lib/source/PhysicsFrame.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/** - @file PhysicsFrame.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-07-09 - @edited 2006-01-25 -*/ - -#include "G3D/platform.h" -#include "G3D/PhysicsFrame.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -PhysicsFrame::PhysicsFrame() { - translation = Vector3::zero(); - rotation = Quat(); -} - - -PhysicsFrame::PhysicsFrame( - const CoordinateFrame& coordinateFrame) { - - translation = coordinateFrame.translation; - rotation = Quat(coordinateFrame.rotation); -} - - -PhysicsFrame PhysicsFrame::operator*(const PhysicsFrame& other) const { - PhysicsFrame result; - - result.rotation = rotation * other.rotation; - result.translation = translation + rotation.toRotationMatrix() * other.translation; - - return result; -} - - -CoordinateFrame PhysicsFrame::toCoordinateFrame() const { - CoordinateFrame f; - - f.translation = translation; - f.rotation = rotation.toRotationMatrix(); - - return f; -} - - -PhysicsFrame PhysicsFrame::lerp( - const PhysicsFrame& other, - float alpha) const { - - PhysicsFrame result; - - result.translation = translation.lerp(other.translation, alpha); - result.rotation = rotation.slerp(other.rotation, alpha); - - return result; -} - - -void PhysicsFrame::deserialize(class BinaryInput& b) { - translation.deserialize(b); - rotation.deserialize(b); -} - - -void PhysicsFrame::serialize(class BinaryOutput& b) const { - translation.serialize(b); - rotation.serialize(b); -} - - -}; // namespace - diff --git a/externals/g3dlite/G3D.lib/source/Plane.cpp b/externals/g3dlite/G3D.lib/source/Plane.cpp deleted file mode 100644 index bb8ed5c6033..00000000000 --- a/externals/g3dlite/G3D.lib/source/Plane.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/** - @file Plane.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2003-02-06 - @edited 2006-01-29 - */ - -#include "G3D/platform.h" -#include "G3D/Plane.h" -#include "G3D/BinaryOutput.h" -#include "G3D/BinaryInput.h" -#include "G3D/stringutils.h" - -namespace G3D { - -Plane::Plane(class BinaryInput& b) { - deserialize(b); -} - - -void Plane::serialize(class BinaryOutput& b) const { - _normal.serialize(b); - b.writeFloat64(_distance); -} - - -void Plane::deserialize(class BinaryInput& b) { - _normal.deserialize(b); - _distance = (float)b.readFloat64(); -} - - -Plane::Plane( - Vector4 point0, - Vector4 point1, - Vector4 point2) { - - debugAssertM( - point0.w != 0 || - point1.w != 0 || - point2.w != 0, - "At least one point must be finite."); - - // Rotate the points around so that the finite points come first. - - while ((point0.w == 0) && - ((point1.w == 0) || (point2.w != 0))) { - Vector4 temp = point0; - point0 = point1; - point1 = point2; - point2 = temp; - } - - Vector3 dir1; - Vector3 dir2; - - if (point1.w == 0) { - // 1 finite, 2 infinite points; the plane must contain - // the direction of the two direcitons - dir1 = point1.xyz(); - dir2 = point2.xyz(); - } else if (point2.w != 0) { - // 3 finite points, the plane must contain the directions - // betwseen the points. - dir1 = point1.xyz() - point0.xyz(); - dir2 = point2.xyz() - point0.xyz(); - } else { - // 2 finite, 1 infinite point; the plane must contain - // the direction between the first two points and the - // direction of the third point. - dir1 = point1.xyz() - point0.xyz(); - dir2 = point2.xyz(); - } - - _normal = dir1.cross(dir2).direction(); - _distance = _normal.dot(point0.xyz()); -} - - -Plane::Plane( - const Vector3& point0, - const Vector3& point1, - const Vector3& point2) { - - _normal = (point1 - point0).cross(point2 - point0).direction(); - _distance = _normal.dot(point0); -} - - -Plane::Plane( - const Vector3& __normal, - const Vector3& point) { - - _normal = __normal.direction(); - _distance = _normal.dot(point); -} - - -Plane Plane::fromEquation(float a, float b, float c, float d) { - Vector3 n(a, b, c); - float magnitude = n.magnitude(); - d /= magnitude; - n /= magnitude; - return Plane(n, -d); -} - - -void Plane::flip() { - _normal = -_normal; - _distance = -_distance; -} - - -void Plane::getEquation(Vector3& n, float& d) const { - double _d; - getEquation(n, _d); - d = (float)_d; -} - -void Plane::getEquation(Vector3& n, double& d) const { - n = _normal; - d = -_distance; -} - - -void Plane::getEquation(float& a, float& b, float& c, float& d) const { - double _a, _b, _c, _d; - getEquation(_a, _b, _c, _d); - a = (float)_a; - b = (float)_b; - c = (float)_c; - d = (float)_d; -} - -void Plane::getEquation(double& a, double& b, double& c, double& d) const { - a = _normal.x; - b = _normal.y; - c = _normal.z; - d = -_distance; -} - - -std::string Plane::toString() const { - return format("Plane(%g, %g, %g, %g)", _normal.x, _normal.y, _normal.z, _distance); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Quat.cpp b/externals/g3dlite/G3D.lib/source/Quat.cpp deleted file mode 100644 index 225c5b51acc..00000000000 --- a/externals/g3dlite/G3D.lib/source/Quat.cpp +++ /dev/null @@ -1,583 +0,0 @@ -/** - @file Quat.cpp - - Quaternion implementation based on Watt & Watt page 363 - - @author Morgan McGuire, graphics3d.com - - @created 2002-01-23 - @edited 2006-01-31 - */ - -#include "G3D/Quat.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Quat Quat::fromAxisAngleRotation( - const Vector3& axis, - float angle) { - - Quat q; - - q.w = cos(angle / 2.0f); - q.imag() = axis.direction() * sin(angle / 2.0f); - - return q; -} - - -Quat::Quat( - const Matrix3& rot) { - - static const int plus1mod3[] = {1, 2, 0}; - - // Find the index of the largest diagonal component - // These ? operations hopefully compile to conditional - // move instructions instead of branches. - int i = (rot[1][1] > rot[0][0]) ? 1 : 0; - i = (rot[2][2] > rot[i][i]) ? 2 : i; - - // Find the indices of the other elements - int j = plus1mod3[i]; - int k = plus1mod3[j]; - - // Index the elements of the vector part of the quaternion as a float* - float* v = (float*)(this); - - // If we attempted to pre-normalize and trusted the matrix to be - // perfectly orthonormal, the result would be: - // - // double c = sqrt((rot[i][i] - (rot[j][j] + rot[k][k])) + 1.0) - // v[i] = -c * 0.5 - // v[j] = -(rot[i][j] + rot[j][i]) * 0.5 / c - // v[k] = -(rot[i][k] + rot[k][i]) * 0.5 / c - // w = (rot[j][k] - rot[k][j]) * 0.5 / c - // - // Since we're going to pay the sqrt anyway, we perform a post normalization, which also - // fixes any poorly normalized input. Multiply all elements by 2*c in the above, giving: - - // nc2 = -c^2 - double nc2 = ((rot[j][j] + rot[k][k]) - rot[i][i]) - 1.0; - v[i] = nc2; - w = (rot[j][k] - rot[k][j]); - v[j] = -(rot[i][j] + rot[j][i]); - v[k] = -(rot[i][k] + rot[k][i]); - - // We now have the correct result with the wrong magnitude, so normalize it: - float s = sqrt(x*x + y*y + z*z + w*w); - if (s > 0.00001f) { - s = 1.0f / s; - x *= s; - y *= s; - z *= s; - w *= s; - } else { - // The quaternion is nearly zero. Make it 0 0 0 1 - x = 0.0f; - y = 0.0f; - z = 0.0f; - w = 1.0f; - } -} - - -void Quat::toAxisAngleRotation( - Vector3& axis, - double& angle) const { - - // Decompose the quaternion into an angle and an axis. - - axis = Vector3(x, y, z); - angle = 2 * acos(w); - - float len = sqrt(1.0f - w * w); - - if (fuzzyGt(abs(len), 0.0f)) { - axis /= len; - } - - // Reduce the range of the angle. - - if (angle < 0) { - angle = -angle; - axis = -axis; - } - - while (angle > twoPi()) { - angle -= twoPi(); - } - - if (abs(angle) > pi()) { - angle -= twoPi(); - } - - // Make the angle positive. - - if (angle < 0.0f) { - angle = -angle; - axis = -axis; - } -} - - -Matrix3 Quat::toRotationMatrix() const { - Matrix3 out = Matrix3::zero(); - - toRotationMatrix(out); - - return out; -} - - -void Quat::toRotationMatrix( - Matrix3& rot) const { - - rot = Matrix3(*this); -} - - -Quat Quat::slerp( - const Quat& _quat1, - float alpha, - float threshold) const { - - // From: Game Physics -- David Eberly pg 538-540 - // Modified to include lerp for small angles, which - // is a common practice. - - // See also: - // http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/index.html - - const Quat& quat0 = *this; - Quat quat1 = _quat1; - - // angle between quaternion rotations - float phi; - float cosphi = quat0.dot(quat1); - - - if (cosphi < 0) { - // Change the sign and fix the dot product; we need to - // loop the other way to get the shortest path - quat1 = -quat1; - cosphi = -cosphi; - } - - // Using G3D::aCos will clamp the angle to 0 and pi - phi = static_cast(G3D::aCos(cosphi)); - - if (phi >= threshold) { - // For large angles, slerp - float scale0, scale1; - - scale0 = sin((1.0f - alpha) * phi); - scale1 = sin(alpha * phi); - - return ( (quat0 * scale0) + (quat1 * scale1) ) / sin(phi); - } else { - // For small angles, linear interpolate - return quat0.nlerp(quat1, alpha); - } -} - - -Quat Quat::nlerp( - const Quat& quat1, - float alpha) const { - - Quat result = (*this) * (1.0f - alpha) + quat1 * alpha; - return result / result.magnitude(); -} - - -Quat Quat::operator*(const Quat& other) const { - - // Following Watt & Watt, page 360 - const Vector3& v1 = imag(); - const Vector3& v2 = other.imag(); - float s1 = w; - float s2 = other.w; - - return Quat(s1*v2 + s2*v1 + v1.cross(v2), s1*s2 - v1.dot(v2)); -} - - -// From "Uniform Random Rotations", Ken Shoemake, Graphics Gems III. -Quat Quat::unitRandom() { - float x0 = uniformRandom(); - float r1 = sqrtf(1 - x0), - r2 = sqrtf(x0); - float t1 = (float)G3D::twoPi() * uniformRandom(); - float t2 = (float)G3D::twoPi() * uniformRandom(); - float c1 = cosf(t1), - s1 = sinf(t1); - float c2 = cosf(t2), - s2 = sinf(t2); - return Quat(s1 * r1, c1 * r1, s2 * r2, c2 * r2); -} - - -void Quat::deserialize(class BinaryInput& b) { - x = b.readFloat32(); - y = b.readFloat32(); - z = b.readFloat32(); - w = b.readFloat32(); -} - - -void Quat::serialize(class BinaryOutput& b) const { - b.writeFloat32(x); - b.writeFloat32(y); - b.writeFloat32(z); - b.writeFloat32(w); -} - - -// 2-char swizzles - -Vector2 Quat::xx() const { return Vector2 (x, x); } -Vector2 Quat::yx() const { return Vector2 (y, x); } -Vector2 Quat::zx() const { return Vector2 (z, x); } -Vector2 Quat::wx() const { return Vector2 (w, x); } -Vector2 Quat::xy() const { return Vector2 (x, y); } -Vector2 Quat::yy() const { return Vector2 (y, y); } -Vector2 Quat::zy() const { return Vector2 (z, y); } -Vector2 Quat::wy() const { return Vector2 (w, y); } -Vector2 Quat::xz() const { return Vector2 (x, z); } -Vector2 Quat::yz() const { return Vector2 (y, z); } -Vector2 Quat::zz() const { return Vector2 (z, z); } -Vector2 Quat::wz() const { return Vector2 (w, z); } -Vector2 Quat::xw() const { return Vector2 (x, w); } -Vector2 Quat::yw() const { return Vector2 (y, w); } -Vector2 Quat::zw() const { return Vector2 (z, w); } -Vector2 Quat::ww() const { return Vector2 (w, w); } - -// 3-char swizzles - -Vector3 Quat::xxx() const { return Vector3 (x, x, x); } -Vector3 Quat::yxx() const { return Vector3 (y, x, x); } -Vector3 Quat::zxx() const { return Vector3 (z, x, x); } -Vector3 Quat::wxx() const { return Vector3 (w, x, x); } -Vector3 Quat::xyx() const { return Vector3 (x, y, x); } -Vector3 Quat::yyx() const { return Vector3 (y, y, x); } -Vector3 Quat::zyx() const { return Vector3 (z, y, x); } -Vector3 Quat::wyx() const { return Vector3 (w, y, x); } -Vector3 Quat::xzx() const { return Vector3 (x, z, x); } -Vector3 Quat::yzx() const { return Vector3 (y, z, x); } -Vector3 Quat::zzx() const { return Vector3 (z, z, x); } -Vector3 Quat::wzx() const { return Vector3 (w, z, x); } -Vector3 Quat::xwx() const { return Vector3 (x, w, x); } -Vector3 Quat::ywx() const { return Vector3 (y, w, x); } -Vector3 Quat::zwx() const { return Vector3 (z, w, x); } -Vector3 Quat::wwx() const { return Vector3 (w, w, x); } -Vector3 Quat::xxy() const { return Vector3 (x, x, y); } -Vector3 Quat::yxy() const { return Vector3 (y, x, y); } -Vector3 Quat::zxy() const { return Vector3 (z, x, y); } -Vector3 Quat::wxy() const { return Vector3 (w, x, y); } -Vector3 Quat::xyy() const { return Vector3 (x, y, y); } -Vector3 Quat::yyy() const { return Vector3 (y, y, y); } -Vector3 Quat::zyy() const { return Vector3 (z, y, y); } -Vector3 Quat::wyy() const { return Vector3 (w, y, y); } -Vector3 Quat::xzy() const { return Vector3 (x, z, y); } -Vector3 Quat::yzy() const { return Vector3 (y, z, y); } -Vector3 Quat::zzy() const { return Vector3 (z, z, y); } -Vector3 Quat::wzy() const { return Vector3 (w, z, y); } -Vector3 Quat::xwy() const { return Vector3 (x, w, y); } -Vector3 Quat::ywy() const { return Vector3 (y, w, y); } -Vector3 Quat::zwy() const { return Vector3 (z, w, y); } -Vector3 Quat::wwy() const { return Vector3 (w, w, y); } -Vector3 Quat::xxz() const { return Vector3 (x, x, z); } -Vector3 Quat::yxz() const { return Vector3 (y, x, z); } -Vector3 Quat::zxz() const { return Vector3 (z, x, z); } -Vector3 Quat::wxz() const { return Vector3 (w, x, z); } -Vector3 Quat::xyz() const { return Vector3 (x, y, z); } -Vector3 Quat::yyz() const { return Vector3 (y, y, z); } -Vector3 Quat::zyz() const { return Vector3 (z, y, z); } -Vector3 Quat::wyz() const { return Vector3 (w, y, z); } -Vector3 Quat::xzz() const { return Vector3 (x, z, z); } -Vector3 Quat::yzz() const { return Vector3 (y, z, z); } -Vector3 Quat::zzz() const { return Vector3 (z, z, z); } -Vector3 Quat::wzz() const { return Vector3 (w, z, z); } -Vector3 Quat::xwz() const { return Vector3 (x, w, z); } -Vector3 Quat::ywz() const { return Vector3 (y, w, z); } -Vector3 Quat::zwz() const { return Vector3 (z, w, z); } -Vector3 Quat::wwz() const { return Vector3 (w, w, z); } -Vector3 Quat::xxw() const { return Vector3 (x, x, w); } -Vector3 Quat::yxw() const { return Vector3 (y, x, w); } -Vector3 Quat::zxw() const { return Vector3 (z, x, w); } -Vector3 Quat::wxw() const { return Vector3 (w, x, w); } -Vector3 Quat::xyw() const { return Vector3 (x, y, w); } -Vector3 Quat::yyw() const { return Vector3 (y, y, w); } -Vector3 Quat::zyw() const { return Vector3 (z, y, w); } -Vector3 Quat::wyw() const { return Vector3 (w, y, w); } -Vector3 Quat::xzw() const { return Vector3 (x, z, w); } -Vector3 Quat::yzw() const { return Vector3 (y, z, w); } -Vector3 Quat::zzw() const { return Vector3 (z, z, w); } -Vector3 Quat::wzw() const { return Vector3 (w, z, w); } -Vector3 Quat::xww() const { return Vector3 (x, w, w); } -Vector3 Quat::yww() const { return Vector3 (y, w, w); } -Vector3 Quat::zww() const { return Vector3 (z, w, w); } -Vector3 Quat::www() const { return Vector3 (w, w, w); } - -// 4-char swizzles - -Vector4 Quat::xxxx() const { return Vector4 (x, x, x, x); } -Vector4 Quat::yxxx() const { return Vector4 (y, x, x, x); } -Vector4 Quat::zxxx() const { return Vector4 (z, x, x, x); } -Vector4 Quat::wxxx() const { return Vector4 (w, x, x, x); } -Vector4 Quat::xyxx() const { return Vector4 (x, y, x, x); } -Vector4 Quat::yyxx() const { return Vector4 (y, y, x, x); } -Vector4 Quat::zyxx() const { return Vector4 (z, y, x, x); } -Vector4 Quat::wyxx() const { return Vector4 (w, y, x, x); } -Vector4 Quat::xzxx() const { return Vector4 (x, z, x, x); } -Vector4 Quat::yzxx() const { return Vector4 (y, z, x, x); } -Vector4 Quat::zzxx() const { return Vector4 (z, z, x, x); } -Vector4 Quat::wzxx() const { return Vector4 (w, z, x, x); } -Vector4 Quat::xwxx() const { return Vector4 (x, w, x, x); } -Vector4 Quat::ywxx() const { return Vector4 (y, w, x, x); } -Vector4 Quat::zwxx() const { return Vector4 (z, w, x, x); } -Vector4 Quat::wwxx() const { return Vector4 (w, w, x, x); } -Vector4 Quat::xxyx() const { return Vector4 (x, x, y, x); } -Vector4 Quat::yxyx() const { return Vector4 (y, x, y, x); } -Vector4 Quat::zxyx() const { return Vector4 (z, x, y, x); } -Vector4 Quat::wxyx() const { return Vector4 (w, x, y, x); } -Vector4 Quat::xyyx() const { return Vector4 (x, y, y, x); } -Vector4 Quat::yyyx() const { return Vector4 (y, y, y, x); } -Vector4 Quat::zyyx() const { return Vector4 (z, y, y, x); } -Vector4 Quat::wyyx() const { return Vector4 (w, y, y, x); } -Vector4 Quat::xzyx() const { return Vector4 (x, z, y, x); } -Vector4 Quat::yzyx() const { return Vector4 (y, z, y, x); } -Vector4 Quat::zzyx() const { return Vector4 (z, z, y, x); } -Vector4 Quat::wzyx() const { return Vector4 (w, z, y, x); } -Vector4 Quat::xwyx() const { return Vector4 (x, w, y, x); } -Vector4 Quat::ywyx() const { return Vector4 (y, w, y, x); } -Vector4 Quat::zwyx() const { return Vector4 (z, w, y, x); } -Vector4 Quat::wwyx() const { return Vector4 (w, w, y, x); } -Vector4 Quat::xxzx() const { return Vector4 (x, x, z, x); } -Vector4 Quat::yxzx() const { return Vector4 (y, x, z, x); } -Vector4 Quat::zxzx() const { return Vector4 (z, x, z, x); } -Vector4 Quat::wxzx() const { return Vector4 (w, x, z, x); } -Vector4 Quat::xyzx() const { return Vector4 (x, y, z, x); } -Vector4 Quat::yyzx() const { return Vector4 (y, y, z, x); } -Vector4 Quat::zyzx() const { return Vector4 (z, y, z, x); } -Vector4 Quat::wyzx() const { return Vector4 (w, y, z, x); } -Vector4 Quat::xzzx() const { return Vector4 (x, z, z, x); } -Vector4 Quat::yzzx() const { return Vector4 (y, z, z, x); } -Vector4 Quat::zzzx() const { return Vector4 (z, z, z, x); } -Vector4 Quat::wzzx() const { return Vector4 (w, z, z, x); } -Vector4 Quat::xwzx() const { return Vector4 (x, w, z, x); } -Vector4 Quat::ywzx() const { return Vector4 (y, w, z, x); } -Vector4 Quat::zwzx() const { return Vector4 (z, w, z, x); } -Vector4 Quat::wwzx() const { return Vector4 (w, w, z, x); } -Vector4 Quat::xxwx() const { return Vector4 (x, x, w, x); } -Vector4 Quat::yxwx() const { return Vector4 (y, x, w, x); } -Vector4 Quat::zxwx() const { return Vector4 (z, x, w, x); } -Vector4 Quat::wxwx() const { return Vector4 (w, x, w, x); } -Vector4 Quat::xywx() const { return Vector4 (x, y, w, x); } -Vector4 Quat::yywx() const { return Vector4 (y, y, w, x); } -Vector4 Quat::zywx() const { return Vector4 (z, y, w, x); } -Vector4 Quat::wywx() const { return Vector4 (w, y, w, x); } -Vector4 Quat::xzwx() const { return Vector4 (x, z, w, x); } -Vector4 Quat::yzwx() const { return Vector4 (y, z, w, x); } -Vector4 Quat::zzwx() const { return Vector4 (z, z, w, x); } -Vector4 Quat::wzwx() const { return Vector4 (w, z, w, x); } -Vector4 Quat::xwwx() const { return Vector4 (x, w, w, x); } -Vector4 Quat::ywwx() const { return Vector4 (y, w, w, x); } -Vector4 Quat::zwwx() const { return Vector4 (z, w, w, x); } -Vector4 Quat::wwwx() const { return Vector4 (w, w, w, x); } -Vector4 Quat::xxxy() const { return Vector4 (x, x, x, y); } -Vector4 Quat::yxxy() const { return Vector4 (y, x, x, y); } -Vector4 Quat::zxxy() const { return Vector4 (z, x, x, y); } -Vector4 Quat::wxxy() const { return Vector4 (w, x, x, y); } -Vector4 Quat::xyxy() const { return Vector4 (x, y, x, y); } -Vector4 Quat::yyxy() const { return Vector4 (y, y, x, y); } -Vector4 Quat::zyxy() const { return Vector4 (z, y, x, y); } -Vector4 Quat::wyxy() const { return Vector4 (w, y, x, y); } -Vector4 Quat::xzxy() const { return Vector4 (x, z, x, y); } -Vector4 Quat::yzxy() const { return Vector4 (y, z, x, y); } -Vector4 Quat::zzxy() const { return Vector4 (z, z, x, y); } -Vector4 Quat::wzxy() const { return Vector4 (w, z, x, y); } -Vector4 Quat::xwxy() const { return Vector4 (x, w, x, y); } -Vector4 Quat::ywxy() const { return Vector4 (y, w, x, y); } -Vector4 Quat::zwxy() const { return Vector4 (z, w, x, y); } -Vector4 Quat::wwxy() const { return Vector4 (w, w, x, y); } -Vector4 Quat::xxyy() const { return Vector4 (x, x, y, y); } -Vector4 Quat::yxyy() const { return Vector4 (y, x, y, y); } -Vector4 Quat::zxyy() const { return Vector4 (z, x, y, y); } -Vector4 Quat::wxyy() const { return Vector4 (w, x, y, y); } -Vector4 Quat::xyyy() const { return Vector4 (x, y, y, y); } -Vector4 Quat::yyyy() const { return Vector4 (y, y, y, y); } -Vector4 Quat::zyyy() const { return Vector4 (z, y, y, y); } -Vector4 Quat::wyyy() const { return Vector4 (w, y, y, y); } -Vector4 Quat::xzyy() const { return Vector4 (x, z, y, y); } -Vector4 Quat::yzyy() const { return Vector4 (y, z, y, y); } -Vector4 Quat::zzyy() const { return Vector4 (z, z, y, y); } -Vector4 Quat::wzyy() const { return Vector4 (w, z, y, y); } -Vector4 Quat::xwyy() const { return Vector4 (x, w, y, y); } -Vector4 Quat::ywyy() const { return Vector4 (y, w, y, y); } -Vector4 Quat::zwyy() const { return Vector4 (z, w, y, y); } -Vector4 Quat::wwyy() const { return Vector4 (w, w, y, y); } -Vector4 Quat::xxzy() const { return Vector4 (x, x, z, y); } -Vector4 Quat::yxzy() const { return Vector4 (y, x, z, y); } -Vector4 Quat::zxzy() const { return Vector4 (z, x, z, y); } -Vector4 Quat::wxzy() const { return Vector4 (w, x, z, y); } -Vector4 Quat::xyzy() const { return Vector4 (x, y, z, y); } -Vector4 Quat::yyzy() const { return Vector4 (y, y, z, y); } -Vector4 Quat::zyzy() const { return Vector4 (z, y, z, y); } -Vector4 Quat::wyzy() const { return Vector4 (w, y, z, y); } -Vector4 Quat::xzzy() const { return Vector4 (x, z, z, y); } -Vector4 Quat::yzzy() const { return Vector4 (y, z, z, y); } -Vector4 Quat::zzzy() const { return Vector4 (z, z, z, y); } -Vector4 Quat::wzzy() const { return Vector4 (w, z, z, y); } -Vector4 Quat::xwzy() const { return Vector4 (x, w, z, y); } -Vector4 Quat::ywzy() const { return Vector4 (y, w, z, y); } -Vector4 Quat::zwzy() const { return Vector4 (z, w, z, y); } -Vector4 Quat::wwzy() const { return Vector4 (w, w, z, y); } -Vector4 Quat::xxwy() const { return Vector4 (x, x, w, y); } -Vector4 Quat::yxwy() const { return Vector4 (y, x, w, y); } -Vector4 Quat::zxwy() const { return Vector4 (z, x, w, y); } -Vector4 Quat::wxwy() const { return Vector4 (w, x, w, y); } -Vector4 Quat::xywy() const { return Vector4 (x, y, w, y); } -Vector4 Quat::yywy() const { return Vector4 (y, y, w, y); } -Vector4 Quat::zywy() const { return Vector4 (z, y, w, y); } -Vector4 Quat::wywy() const { return Vector4 (w, y, w, y); } -Vector4 Quat::xzwy() const { return Vector4 (x, z, w, y); } -Vector4 Quat::yzwy() const { return Vector4 (y, z, w, y); } -Vector4 Quat::zzwy() const { return Vector4 (z, z, w, y); } -Vector4 Quat::wzwy() const { return Vector4 (w, z, w, y); } -Vector4 Quat::xwwy() const { return Vector4 (x, w, w, y); } -Vector4 Quat::ywwy() const { return Vector4 (y, w, w, y); } -Vector4 Quat::zwwy() const { return Vector4 (z, w, w, y); } -Vector4 Quat::wwwy() const { return Vector4 (w, w, w, y); } -Vector4 Quat::xxxz() const { return Vector4 (x, x, x, z); } -Vector4 Quat::yxxz() const { return Vector4 (y, x, x, z); } -Vector4 Quat::zxxz() const { return Vector4 (z, x, x, z); } -Vector4 Quat::wxxz() const { return Vector4 (w, x, x, z); } -Vector4 Quat::xyxz() const { return Vector4 (x, y, x, z); } -Vector4 Quat::yyxz() const { return Vector4 (y, y, x, z); } -Vector4 Quat::zyxz() const { return Vector4 (z, y, x, z); } -Vector4 Quat::wyxz() const { return Vector4 (w, y, x, z); } -Vector4 Quat::xzxz() const { return Vector4 (x, z, x, z); } -Vector4 Quat::yzxz() const { return Vector4 (y, z, x, z); } -Vector4 Quat::zzxz() const { return Vector4 (z, z, x, z); } -Vector4 Quat::wzxz() const { return Vector4 (w, z, x, z); } -Vector4 Quat::xwxz() const { return Vector4 (x, w, x, z); } -Vector4 Quat::ywxz() const { return Vector4 (y, w, x, z); } -Vector4 Quat::zwxz() const { return Vector4 (z, w, x, z); } -Vector4 Quat::wwxz() const { return Vector4 (w, w, x, z); } -Vector4 Quat::xxyz() const { return Vector4 (x, x, y, z); } -Vector4 Quat::yxyz() const { return Vector4 (y, x, y, z); } -Vector4 Quat::zxyz() const { return Vector4 (z, x, y, z); } -Vector4 Quat::wxyz() const { return Vector4 (w, x, y, z); } -Vector4 Quat::xyyz() const { return Vector4 (x, y, y, z); } -Vector4 Quat::yyyz() const { return Vector4 (y, y, y, z); } -Vector4 Quat::zyyz() const { return Vector4 (z, y, y, z); } -Vector4 Quat::wyyz() const { return Vector4 (w, y, y, z); } -Vector4 Quat::xzyz() const { return Vector4 (x, z, y, z); } -Vector4 Quat::yzyz() const { return Vector4 (y, z, y, z); } -Vector4 Quat::zzyz() const { return Vector4 (z, z, y, z); } -Vector4 Quat::wzyz() const { return Vector4 (w, z, y, z); } -Vector4 Quat::xwyz() const { return Vector4 (x, w, y, z); } -Vector4 Quat::ywyz() const { return Vector4 (y, w, y, z); } -Vector4 Quat::zwyz() const { return Vector4 (z, w, y, z); } -Vector4 Quat::wwyz() const { return Vector4 (w, w, y, z); } -Vector4 Quat::xxzz() const { return Vector4 (x, x, z, z); } -Vector4 Quat::yxzz() const { return Vector4 (y, x, z, z); } -Vector4 Quat::zxzz() const { return Vector4 (z, x, z, z); } -Vector4 Quat::wxzz() const { return Vector4 (w, x, z, z); } -Vector4 Quat::xyzz() const { return Vector4 (x, y, z, z); } -Vector4 Quat::yyzz() const { return Vector4 (y, y, z, z); } -Vector4 Quat::zyzz() const { return Vector4 (z, y, z, z); } -Vector4 Quat::wyzz() const { return Vector4 (w, y, z, z); } -Vector4 Quat::xzzz() const { return Vector4 (x, z, z, z); } -Vector4 Quat::yzzz() const { return Vector4 (y, z, z, z); } -Vector4 Quat::zzzz() const { return Vector4 (z, z, z, z); } -Vector4 Quat::wzzz() const { return Vector4 (w, z, z, z); } -Vector4 Quat::xwzz() const { return Vector4 (x, w, z, z); } -Vector4 Quat::ywzz() const { return Vector4 (y, w, z, z); } -Vector4 Quat::zwzz() const { return Vector4 (z, w, z, z); } -Vector4 Quat::wwzz() const { return Vector4 (w, w, z, z); } -Vector4 Quat::xxwz() const { return Vector4 (x, x, w, z); } -Vector4 Quat::yxwz() const { return Vector4 (y, x, w, z); } -Vector4 Quat::zxwz() const { return Vector4 (z, x, w, z); } -Vector4 Quat::wxwz() const { return Vector4 (w, x, w, z); } -Vector4 Quat::xywz() const { return Vector4 (x, y, w, z); } -Vector4 Quat::yywz() const { return Vector4 (y, y, w, z); } -Vector4 Quat::zywz() const { return Vector4 (z, y, w, z); } -Vector4 Quat::wywz() const { return Vector4 (w, y, w, z); } -Vector4 Quat::xzwz() const { return Vector4 (x, z, w, z); } -Vector4 Quat::yzwz() const { return Vector4 (y, z, w, z); } -Vector4 Quat::zzwz() const { return Vector4 (z, z, w, z); } -Vector4 Quat::wzwz() const { return Vector4 (w, z, w, z); } -Vector4 Quat::xwwz() const { return Vector4 (x, w, w, z); } -Vector4 Quat::ywwz() const { return Vector4 (y, w, w, z); } -Vector4 Quat::zwwz() const { return Vector4 (z, w, w, z); } -Vector4 Quat::wwwz() const { return Vector4 (w, w, w, z); } -Vector4 Quat::xxxw() const { return Vector4 (x, x, x, w); } -Vector4 Quat::yxxw() const { return Vector4 (y, x, x, w); } -Vector4 Quat::zxxw() const { return Vector4 (z, x, x, w); } -Vector4 Quat::wxxw() const { return Vector4 (w, x, x, w); } -Vector4 Quat::xyxw() const { return Vector4 (x, y, x, w); } -Vector4 Quat::yyxw() const { return Vector4 (y, y, x, w); } -Vector4 Quat::zyxw() const { return Vector4 (z, y, x, w); } -Vector4 Quat::wyxw() const { return Vector4 (w, y, x, w); } -Vector4 Quat::xzxw() const { return Vector4 (x, z, x, w); } -Vector4 Quat::yzxw() const { return Vector4 (y, z, x, w); } -Vector4 Quat::zzxw() const { return Vector4 (z, z, x, w); } -Vector4 Quat::wzxw() const { return Vector4 (w, z, x, w); } -Vector4 Quat::xwxw() const { return Vector4 (x, w, x, w); } -Vector4 Quat::ywxw() const { return Vector4 (y, w, x, w); } -Vector4 Quat::zwxw() const { return Vector4 (z, w, x, w); } -Vector4 Quat::wwxw() const { return Vector4 (w, w, x, w); } -Vector4 Quat::xxyw() const { return Vector4 (x, x, y, w); } -Vector4 Quat::yxyw() const { return Vector4 (y, x, y, w); } -Vector4 Quat::zxyw() const { return Vector4 (z, x, y, w); } -Vector4 Quat::wxyw() const { return Vector4 (w, x, y, w); } -Vector4 Quat::xyyw() const { return Vector4 (x, y, y, w); } -Vector4 Quat::yyyw() const { return Vector4 (y, y, y, w); } -Vector4 Quat::zyyw() const { return Vector4 (z, y, y, w); } -Vector4 Quat::wyyw() const { return Vector4 (w, y, y, w); } -Vector4 Quat::xzyw() const { return Vector4 (x, z, y, w); } -Vector4 Quat::yzyw() const { return Vector4 (y, z, y, w); } -Vector4 Quat::zzyw() const { return Vector4 (z, z, y, w); } -Vector4 Quat::wzyw() const { return Vector4 (w, z, y, w); } -Vector4 Quat::xwyw() const { return Vector4 (x, w, y, w); } -Vector4 Quat::ywyw() const { return Vector4 (y, w, y, w); } -Vector4 Quat::zwyw() const { return Vector4 (z, w, y, w); } -Vector4 Quat::wwyw() const { return Vector4 (w, w, y, w); } -Vector4 Quat::xxzw() const { return Vector4 (x, x, z, w); } -Vector4 Quat::yxzw() const { return Vector4 (y, x, z, w); } -Vector4 Quat::zxzw() const { return Vector4 (z, x, z, w); } -Vector4 Quat::wxzw() const { return Vector4 (w, x, z, w); } -Vector4 Quat::xyzw() const { return Vector4 (x, y, z, w); } -Vector4 Quat::yyzw() const { return Vector4 (y, y, z, w); } -Vector4 Quat::zyzw() const { return Vector4 (z, y, z, w); } -Vector4 Quat::wyzw() const { return Vector4 (w, y, z, w); } -Vector4 Quat::xzzw() const { return Vector4 (x, z, z, w); } -Vector4 Quat::yzzw() const { return Vector4 (y, z, z, w); } -Vector4 Quat::zzzw() const { return Vector4 (z, z, z, w); } -Vector4 Quat::wzzw() const { return Vector4 (w, z, z, w); } -Vector4 Quat::xwzw() const { return Vector4 (x, w, z, w); } -Vector4 Quat::ywzw() const { return Vector4 (y, w, z, w); } -Vector4 Quat::zwzw() const { return Vector4 (z, w, z, w); } -Vector4 Quat::wwzw() const { return Vector4 (w, w, z, w); } -Vector4 Quat::xxww() const { return Vector4 (x, x, w, w); } -Vector4 Quat::yxww() const { return Vector4 (y, x, w, w); } -Vector4 Quat::zxww() const { return Vector4 (z, x, w, w); } -Vector4 Quat::wxww() const { return Vector4 (w, x, w, w); } -Vector4 Quat::xyww() const { return Vector4 (x, y, w, w); } -Vector4 Quat::yyww() const { return Vector4 (y, y, w, w); } -Vector4 Quat::zyww() const { return Vector4 (z, y, w, w); } -Vector4 Quat::wyww() const { return Vector4 (w, y, w, w); } -Vector4 Quat::xzww() const { return Vector4 (x, z, w, w); } -Vector4 Quat::yzww() const { return Vector4 (y, z, w, w); } -Vector4 Quat::zzww() const { return Vector4 (z, z, w, w); } -Vector4 Quat::wzww() const { return Vector4 (w, z, w, w); } -Vector4 Quat::xwww() const { return Vector4 (x, w, w, w); } -Vector4 Quat::ywww() const { return Vector4 (y, w, w, w); } -Vector4 Quat::zwww() const { return Vector4 (z, w, w, w); } -Vector4 Quat::wwww() const { return Vector4 (w, w, w, w); } -} - diff --git a/externals/g3dlite/G3D.lib/source/Ray.cpp b/externals/g3dlite/G3D.lib/source/Ray.cpp deleted file mode 100644 index bf6aadc08d1..00000000000 --- a/externals/g3dlite/G3D.lib/source/Ray.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/** - @file Ray.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2002-07-12 - @edited 2004-03-19 - */ - -#include "G3D/platform.h" -#include "G3D/Ray.h" -#include "G3D/Plane.h" -#include "G3D/Sphere.h" -#include "G3D/CollisionDetection.h" - -namespace G3D { - -Ray::Ray(class BinaryInput& b) { - deserialize(b); -} - - -void Ray::serialize(class BinaryOutput& b) const { - origin.serialize(b); - direction.serialize(b); -} - - -void Ray::deserialize(class BinaryInput& b) { - origin.deserialize(b); - direction.deserialize(b); -} - - -Ray Ray::refract( - const Vector3& newOrigin, - const Vector3& normal, - float iInside, - float iOutside) const { - - Vector3 D = direction.refractionDirection(normal, iInside, iOutside); - return Ray::fromOriginAndDirection( - newOrigin + (direction + normal * (float)sign(direction.dot(normal))) * 0.001f, D); -} - - -Ray Ray::reflect( - const Vector3& newOrigin, - const Vector3& normal) const { - - Vector3 D = direction.reflectionDirection(normal); - return Ray::fromOriginAndDirection(newOrigin + (D + normal) * 0.001f, D); -} - - -Vector3 Ray::intersection(const Plane& plane) const { - float d; - Vector3 normal = plane.normal(); - plane.getEquation(normal, d); - float rate = direction.dot(normal); - - if (rate >= 0.0f) { - return Vector3::inf(); - } else { - float t = -(d + origin.dot(normal)) / rate; - - return origin + direction * t; - } -} - - -float Ray::intersectionTime(const class Sphere& sphere) const { - Vector3 dummy; - return CollisionDetection::collisionTimeForMovingPointFixedSphere( - origin, direction, sphere, dummy); -} - - -float Ray::intersectionTime(const class Plane& plane) const { - Vector3 dummy; - return CollisionDetection::collisionTimeForMovingPointFixedPlane( - origin, direction, plane, dummy); -} - - -float Ray::intersectionTime(const class Box& box) const { - Vector3 dummy; - float time = CollisionDetection::collisionTimeForMovingPointFixedBox( - origin, direction, box, dummy); - - if ((time == inf()) && (box.contains(origin))) { - return 0.0f; - } else { - return time; - } -} - - -float Ray::intersectionTime(const class AABox& box) const { - Vector3 dummy; - bool inside; - float time = CollisionDetection::collisionTimeForMovingPointFixedAABox( - origin, direction, box, dummy, inside); - - if ((time == inf()) && inside) { - return 0.0f; - } else { - return time; - } -} - -} diff --git a/externals/g3dlite/G3D.lib/source/RegistryUtil.cpp b/externals/g3dlite/G3D.lib/source/RegistryUtil.cpp deleted file mode 100644 index 28ff6955d9b..00000000000 --- a/externals/g3dlite/G3D.lib/source/RegistryUtil.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/** - @file RegistryUtil.cpp - - @created 2006-04-06 - @edited 2006-04-24 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. -*/ - -#include "G3D/platform.h" - -// This file is only used on Windows -#ifdef G3D_WIN32 - -#include "G3D/RegistryUtil.h" -#include "G3D/System.h" - -namespace G3D { - -// static helpers -static HKEY getRootKeyFromString(const char* str, size_t length); - - -bool RegistryUtil::keyExists(const std::string& key) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if (hkey == NULL) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_READ, &openKey); - - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - RegCloseKey(openKey); - return true; - } else { - return false; - } -} - -bool RegistryUtil::valueExists(const std::string& key, const std::string& value) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if ( hkey == NULL ) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_READ, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - uint32 dataSize = 0; - result = RegQueryValueExA(openKey, value.c_str(), NULL, NULL, NULL, reinterpret_cast(&dataSize)); - - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - RegCloseKey(openKey); - } - return (result == ERROR_SUCCESS); -} - - -bool RegistryUtil::readInt32(const std::string& key, const std::string& value, int32& data) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if ( hkey == NULL ) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_READ, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - uint32 dataSize = sizeof(int32); - result = RegQueryValueExA(openKey, value.c_str(), NULL, NULL, reinterpret_cast(&data), reinterpret_cast(&dataSize)); - - debugAssertM(result == ERROR_SUCCESS, "Could not read registry key value."); - - RegCloseKey(openKey); - } - return (result == ERROR_SUCCESS); -} - -bool RegistryUtil::readBytes(const std::string& key, const std::string& value, uint8* data, uint32& dataSize) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if (hkey == NULL) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_READ, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - if (data == NULL) { - result = RegQueryValueExA(openKey, value.c_str(), NULL, NULL, NULL, reinterpret_cast(&dataSize)); - } else { - result = RegQueryValueExA(openKey, value.c_str(), NULL, NULL, reinterpret_cast(&data), reinterpret_cast(&dataSize)); - } - - debugAssertM(result == ERROR_SUCCESS, "Could not read registry key value."); - - RegCloseKey(openKey); - } - return (result == ERROR_SUCCESS); -} - -bool RegistryUtil::readString(const std::string& key, const std::string& value, std::string& data) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if (hkey == NULL) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_READ, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - uint32 dataSize = 0; - - result = RegQueryValueExA(openKey, value.c_str(), NULL, NULL, NULL, reinterpret_cast(&dataSize)); - debugAssertM(result == ERROR_SUCCESS, "Could not read registry key value."); - - // increment datasize to allow for non null-terminated strings in registry - dataSize += 1; - - if (result == ERROR_SUCCESS) { - char* tmpStr = static_cast(System::malloc(dataSize)); - System::memset(tmpStr, 0, dataSize); - - result = RegQueryValueExA(openKey, value.c_str(), NULL, NULL, reinterpret_cast(tmpStr), reinterpret_cast(&dataSize)); - debugAssertM(result == ERROR_SUCCESS, "Could not read registry key value."); - - if (result == ERROR_SUCCESS) { - data = tmpStr; - } - - RegCloseKey(openKey); - System::free(tmpStr); - } - } - return (result == ERROR_SUCCESS); -} - -bool RegistryUtil::writeInt32(const std::string& key, const std::string& value, int32 data) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if (hkey == NULL) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_WRITE, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - result = RegSetValueExA(openKey, value.c_str(), 0, REG_DWORD, reinterpret_cast(&data), sizeof(int32)); - - debugAssertM(result == ERROR_SUCCESS, "Could not write registry key value."); - - RegCloseKey(openKey); - } - return (result == ERROR_SUCCESS); -} - -bool RegistryUtil::writeBytes(const std::string& key, const std::string& value, const uint8* data, uint32 dataSize) { - debugAssert(data); - - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if (hkey == NULL) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_WRITE, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - if (data) { - result = RegSetValueExA(openKey, value.c_str(), 0, REG_BINARY, reinterpret_cast(data), dataSize); - } - - debugAssertM(result == ERROR_SUCCESS, "Could not write registry key value."); - - RegCloseKey(openKey); - } - return (result == ERROR_SUCCESS); -} - -bool RegistryUtil::writeString(const std::string& key, const std::string& value, const std::string& data) { - size_t pos = key.find('\\', 0); - if (pos == std::string::npos) { - return false; - } - - HKEY hkey = getRootKeyFromString(key.c_str(), pos); - - if (hkey == NULL) { - return false; - } - - HKEY openKey; - int32 result = RegOpenKeyExA(hkey, (key.c_str() + pos + 1), 0, KEY_WRITE, &openKey); - debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND); - - if (result == ERROR_SUCCESS) { - result = RegSetValueExA(openKey, value.c_str(), 0, REG_SZ, reinterpret_cast(data.c_str()), (data.size() + 1)); - debugAssertM(result == ERROR_SUCCESS, "Could not write registry key value."); - - RegCloseKey(openKey); - } - return (result == ERROR_SUCCESS); -} - - -// static helpers -static HKEY getRootKeyFromString(const char* str, uint32 length) { - debugAssert(str); - - if (str) { - if ( strncmp(str, "HKEY_CLASSES_ROOT", length) == 0 ) { - return HKEY_CLASSES_ROOT; - } else if ( strncmp(str, "HKEY_CURRENT_CONFIG", length) == 0 ) { - return HKEY_CURRENT_CONFIG; - } else if ( strncmp(str, "HKEY_CURRENT_USER", length) == 0 ) { - return HKEY_CURRENT_USER; - } else if ( strncmp(str, "HKEY_LOCAL_MACHINE", length) == 0 ) { - return HKEY_LOCAL_MACHINE; - } else if ( strncmp(str, "HKEY_PERFORMANCE_DATA", length) == 0 ) { - return HKEY_PERFORMANCE_DATA; - } else if ( strncmp(str, "HKEY_PERFORMANCE_NLSTEXT", length) == 0 ) { - return HKEY_PERFORMANCE_NLSTEXT; - } else if ( strncmp(str, "HKEY_PERFORMANCE_TEXT", length) == 0 ) { - return HKEY_PERFORMANCE_TEXT; - } else if ( strncmp(str, "HKEY_CLASSES_ROOT", length) == 0 ) { - return HKEY_CLASSES_ROOT; - } else { - return NULL; - } - } else { - return NULL; - } -} - -} // namespace G3D - -#endif // G3D_WIN32 diff --git a/externals/g3dlite/G3D.lib/source/Sphere.cpp b/externals/g3dlite/G3D.lib/source/Sphere.cpp deleted file mode 100644 index 935598d52dd..00000000000 --- a/externals/g3dlite/G3D.lib/source/Sphere.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/** - @file Sphere.cpp - - Sphere class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-04-17 - @edited 2006-02-05 - */ - -#include "G3D/platform.h" -#include "G3D/Sphere.h" -#include "G3D/stringutils.h" -#include "G3D/BinaryOutput.h" -#include "G3D/BinaryInput.h" -#include "G3D/AABox.h" -#include "G3D/Plane.h" - -namespace G3D { - -int32 Sphere::dummy; - -Sphere::Sphere(class BinaryInput& b) { - deserialize(b); -} - - -void Sphere::serialize(class BinaryOutput& b) const { - center.serialize(b); - b.writeFloat64(radius); -} - - -void Sphere::deserialize(class BinaryInput& b) { - center.deserialize(b); - radius = (float)b.readFloat64(); -} - - -std::string Sphere::toString() const { - return format("Sphere(<%g, %g, %g>, %g)", - center.x, center.y, center.z, radius); -} - - -bool Sphere::contains(const Vector3& point) const { - double distance = (center - point).squaredMagnitude(); - return distance <= (radius * radius); -} - - -bool Sphere::intersects(const Sphere& other) const { - return (other.center - center).length() <= (radius + other.radius); -} - -bool Sphere::culledBy( - const Array& plane, - int& cullingPlaneIndex, - const uint32 inMask, - uint32& outMask) const { - - return culledBy(plane.getCArray(), plane.size(), cullingPlaneIndex, inMask, outMask); -} - - -bool Sphere::culledBy( - const Array& plane, - int& cullingPlaneIndex, - const uint32 inMask) const { - - return culledBy(plane.getCArray(), plane.size(), cullingPlaneIndex, inMask); -} - - -bool Sphere::culledBy( - const class Plane* plane, - int numPlanes, - int& cullingPlane, - const uint32 _inMask, - uint32& childMask) const { - - if (radius == inf()) { - // No plane can cull the infinite box - return false; - } - - uint32 inMask = _inMask; - assert(numPlanes < 31); - - childMask = 0; - - // See if there is one plane for which all of the - // vertices are in the negative half space. - for (int p = 0; p < numPlanes; p++) { - - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - bool culledLow = ! plane[p].halfSpaceContainsFinite(center + plane[p].normal() * radius); - bool culledHigh = ! plane[p].halfSpaceContainsFinite(center - plane[p].normal() * radius); - - if (culledLow) { - // Plane p culled the sphere - cullingPlane = p; - - // The caller should not recurse into the children, - // since the parent is culled. If they do recurse, - // make them only test against this one plane, which - // will immediately cull the volume. - childMask = 1 << p; - return true; - - } else if (culledHigh) { - // The bounding volume straddled the plane; we have - // to keep testing against this plane - childMask |= (1 << p); - } - } - - // Move on to the next bit. - inMask = inMask >> 1; - } - - // None of the planes could cull this box - cullingPlane = -1; - return false; -} - - -bool Sphere::culledBy( - const class Plane* plane, - int numPlanes, - int& cullingPlane, - const uint32 _inMask) const { - - uint32 inMask = _inMask; - assert(numPlanes < 31); - - // See if there is one plane for which all of the - // vertices are in the negative half space. - for (int p = 0; p < numPlanes; p++) { - - // Only test planes that are not masked - if ((inMask & 1) != 0) { - bool culled = ! plane[p].halfSpaceContains(center + plane[p].normal() * radius); - if (culled) { - // Plane p culled the sphere - cullingPlane = p; - return true; - } - } - - // Move on to the next bit. - inMask = inMask >> 1; - } - - // None of the planes could cull this box - cullingPlane = -1; - return false; -} - - -Vector3 Sphere::randomSurfacePoint() const { - return Vector3::random() * radius + center; -} - - -Vector3 Sphere::randomInteriorPoint() const { - Vector3 result; - do { - result = Vector3(uniformRandom(-1, 1), - uniformRandom(-1, 1), - uniformRandom(-1, 1)); - } while (result.squaredMagnitude() >= 1.0f); - - return result * radius + center; -} - - -float Sphere::volume() const { - return (float)pi() * (4.0f / 3.0f) * powf((float)radius, 3.0f); -} - - -float Sphere::area() const { - return (float)pi() * 4.0f * powf((float)radius, 2.0f); -} - - -void Sphere::getBounds(AABox& out) const { - Vector3 extent(radius, radius, radius); - out = AABox(center - extent, center + extent); -} - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/SplineBase.cpp b/externals/g3dlite/G3D.lib/source/SplineBase.cpp deleted file mode 100644 index 41221624b06..00000000000 --- a/externals/g3dlite/G3D.lib/source/SplineBase.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include "G3D/platform.h" -#include "G3D/Spline.h" - -namespace G3D { - -float SplineBase::getFinalInterval() const { - if (! cyclic) { - return 0; - } else if (finalInterval <= 0) { - int N = time.size(); - if (N >= 2) { - return (time[1] - time[0] + time[N - 1] - time[N - 2]) * 0.5f; - } else { - return 1.0f; - } - } else { - return finalInterval; - } -} - - -Matrix4 SplineBase::computeBasis() { - // The standard Catmull-Rom spline basis (e.g., Watt & Watt p108) - // is for [u^3 u^2 u^1 u^0] * B * [p[0] p[1] p[2] p[3]]^T. - // We need a basis formed for: - // - // U * C * [2*p'[1] p[1] p[2] 2*p'[2]]^T - // - // U * C * [p2-p0 p1 p2 p3-p1]^T - // - // To make this transformation, compute the differences of columns in C: - // For [p0 p1 p2 p3] - Matrix4 basis = - Matrix4( -1, 3, -3, 1, - 2, -5, 4, -1, - -1, 0, 1, 0, - 0, 2, 0, 0) * 0.5f; - - // For [-p0 p1 p2 p3]^T - basis.setColumn(0, -basis.column(0)); - - // For [-p0 p1 p2 p3-p1]^T - basis.setColumn(1, basis.column(1) + basis.column(3)); - - // For [p2-p0 p1 p2 p3-p1]^T - basis.setColumn(2, basis.column(2) - basis.column(0)); - - return basis; -} - - -float SplineBase::duration() const { - if (time.size() == 0) { - return 0; - } else { - return time.last() - time[0] + getFinalInterval(); - } -} - - -void SplineBase::computeIndexInBounds(float s, int& i, float& u) const { - int N = time.size(); - float t0 = time[0]; - float tn = time[N - 1]; - - i = iFloor((N - 1) * (s - t0) / (tn - t0)); - - // Inclusive bounds for binary search - int hi = N - 1; - int lo = 0; - - while ((time[i] > s) || (time[i + 1] <= s)) { - - if (time[i] > s) { - // too big - hi = i - 1; - } else if (time[i + 1] <= s) { - // too small - lo = i + 1; - } - - i = (hi + lo) / 2; - } - - // Having exited the above loop, i must be correct, so compute u. - u = (s - time[i]) / (time[i + 1] - time[i]); -} - - -void SplineBase::computeIndex(float s, int& i, float& u) const { - int N = time.size(); - debugAssertM(N > 0, "No control points"); - float t0 = time[0]; - float tn = time[N - 1]; - - if (N < 2) { - // No control points to work with - i = 0; - u = 0.0; - } else if (cyclic) { - float fi = getFinalInterval(); - - // Cyclic spline - if ((s < t0) || (s >= tn + fi)) { - // Cyclic, off the bottom or top - - // Compute offset and reduce to the in-bounds case - - float d = duration(); - // Number of times we wrapped around the cyclic array - int wraps = iFloor((s - t0) / d); - - debugAssert(s - d * wraps >= t0); - debugAssert(s - d * wraps < tn + getFinalInterval()); - - computeIndex(s - d * wraps, i, u); - i += wraps * N; - - } else if (s >= tn) { - debugAssert(s < tn + fi); - // Cyclic, off the top but before the end of the last interval - i = N - 1; - u = (s - tn) / fi; - - } else { - // Cyclic, in bounds - computeIndexInBounds(s, i, u); - } - - } else { - // Non-cyclic - - if (s < t0) { - // Non-cyclic, off the bottom. Assume points are spaced - // following the first time interval. - - float dt = time[1] - t0; - float x = (s - t0) / dt; - i = iFloor(x); - u = x - i; - - } else if (s >= tn) { - // Non-cyclic, off the top. Assume points are spaced following - // the last time interval. - - float dt = tn - time[N - 2]; - float x = N - 1 + (s - tn) / dt; - i = iFloor(x); - u = x - i; - - } else { - // In bounds, non-cyclic. Assume a regular - // distribution (which gives O(1) for uniform spacing) - // and then binary search to handle the general case - // efficiently. - computeIndexInBounds(s, i, u); - - } // if in bounds - } // if cyclic -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Stopwatch.cpp b/externals/g3dlite/G3D.lib/source/Stopwatch.cpp deleted file mode 100644 index e55f689a9e2..00000000000 --- a/externals/g3dlite/G3D.lib/source/Stopwatch.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/** - @file Stopwatch.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2005-10-05 - @edited 2005-10-05 - - Copyright 2000-2003, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/Stopwatch.h" -#include "G3D/System.h" - -namespace G3D { - -Stopwatch::Stopwatch() : inBetween(false), lastTockTime(-1), - lastDuration(0), lastCycleCount(0), m_fps(0), emwaFPS(0), - m_smoothFPS(0), emwaDuration(0) { - computeOverhead(); -} - - -void Stopwatch::computeOverhead() { - cycleOverhead = 0; - tick(); - tock(); - cycleOverhead = elapsedCycles(); -} - - -void Stopwatch::tick() { - // This is 'alwaysAssert' instead of 'debugAssert' - // since people rarely profile in debug mode. - alwaysAssertM(! inBetween, "Stopwatch::tick() called twice in a row."); - inBetween = true; - - // We read RDTSC twice here, but it is more abstract to implement this - // way and at least we're reading the cycle count last. - timeStart = System::time(); - System::beginCycleCount(cycleStart); -} - - -void Stopwatch::tock() { - System::endCycleCount(cycleStart); - RealTime now = System::time(); - lastDuration = now - timeStart; - if (abs(emwaDuration - lastDuration) > max(emwaDuration, lastDuration) * 0.50) { - // Off by more than 50% - emwaDuration = lastDuration; - } else { - emwaDuration = lastDuration * 0.05 + emwaDuration * 0.95; - } - - lastCycleCount = cycleStart - cycleOverhead; - if (lastCycleCount < 0) { - lastCycleCount = 0; - } - - if (lastTockTime != -1.0) { - m_fps = 1.0 / (now - lastTockTime); - - // Time smooth the average - emwaFPS = m_fps * 0.01 + emwaFPS * 0.99; - - if (abs(emwaFPS - m_fps) > max(emwaFPS, m_fps) * 0.08) { - // The difference between emwa and m_fps is way off - // update emwa directly. - emwaFPS = m_fps; - } - - // Update m_smoothFPS only when the value varies significantly - // We round so as to not mislead the user as to the accuracy of - // the number. - if (m_smoothFPS == 0) { - m_smoothFPS = m_fps; - } else if (emwaFPS <= 10) { - if (::fabs(m_smoothFPS - emwaFPS) > .75) { - m_smoothFPS = floor(emwaFPS * 10.0 + 0.5) / 10.0; - } - } else { - if (::fabs(m_smoothFPS - emwaFPS) > 1.25) { - m_smoothFPS = floor(emwaFPS + 0.5); - } - } - } - lastTockTime = now; - - alwaysAssertM(inBetween, "Stopwatch::tock() called without matching tick."); - inBetween = false; -} - -} - diff --git a/externals/g3dlite/G3D.lib/source/System.cpp b/externals/g3dlite/G3D.lib/source/System.cpp deleted file mode 100644 index 748e13257f1..00000000000 --- a/externals/g3dlite/G3D.lib/source/System.cpp +++ /dev/null @@ -1,1864 +0,0 @@ -/** - @file System.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - Note: every routine must call init() first. - - There are two kinds of detection used in this file. At compile - time, the _MSC_VER #define is used to determine whether x86 assembly - can be used at all. At runtime, processor detection is used to - determine if we can safely call the routines that use that assembly. - - @cite Rob Wyatt http://www.gamasutra.com/features/wyatts_world/19990709/processor_detection_01.htm - @cite Benjamin Jurke http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-ProcessorDetectionClass&forum=cotd&id=-1 - @cite Michael Herf http://www.stereopsis.com/memcpy.html - - @created 2003-01-25 - @edited 2008-09-02 - */ - -#include "G3D/platform.h" -#include "G3D/System.h" -#include "G3D/debug.h" -#include "G3D/fileutils.h" -#include "G3D/TextOutput.h" -#include "G3D/G3DGameUnits.h" -#include "G3D/Crypto.h" -#include "G3D/prompt.h" -#include "G3D/Log.h" -#include - -#include -#include - -// Uncomment the following line to turn off G3D::System memory -// allocation and use the operating system's malloc. -//#define NO_BUFFERPOOL - -#if defined(__i386__) || defined(__x86_64__) || defined(G3D_WIN32) -# define G3D_NOT_OSX_PPC -#endif - -#ifdef G3D_WIN32 - -# include -# include -# include "G3D/RegistryUtil.h" - -#elif defined(G3D_LINUX) - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - -#elif defined(G3D_OSX) - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #include - #include -#endif - -#if defined(SSE) - #include -#endif - -namespace G3D { - -struct CpuInfo -{ -public: - int m_cpuSpeed; - bool m_hasCPUID; - bool m_hasRDTSC; - bool m_hasMMX; - bool m_hasSSE; - bool m_hasSSE2; - bool m_hasSSE3; - bool m_has3DNOW; - char m_cpuVendorStr[1024]; -}; - -// helper macro to call cpuid functions and return all values -#ifdef _MSC_VER - - // VC on Intel -# define CALL_CPUID(func, areg, breg, creg, dreg) \ - __asm mov eax, func \ - __asm cpuid \ - __asm mov areg, eax \ - __asm mov breg, ebx \ - __asm mov creg, ecx \ - __asm mov dreg, edx - -#elif defined(__GNUC__) && defined(G3D_OSX_INTEL) - // GCC on OS X intel -# define CALL_CPUID(func, areg, breg, creg, dreg) \ - areg = 0; \ - breg = 0; \ - creg = 0; \ - dreg = 0; -#else - // Any other compiler/platform, likely GCC -# define CALL_CPUID(func, areg, breg, creg, dreg) \ - __asm__ ( \ - "cpuid \n": \ - "=a" (areg), \ - "=b" (breg), \ - "=c" (creg), \ - "=d" (dreg): \ - "a" (func) \ - ); -#endif - -// this holds the data directory set by the application (currently GApp) for use by findDataFile -static char g_appDataDir[FILENAME_MAX] = ""; - -static CpuInfo g_cpuInfo = { - 0, false, false, false, false, false, false, false, {'U', 'n', 'k', 'n', 'o', 'w', 'n', '\0'}}; - -static G3DEndian _machineEndian = G3D_LITTLE_ENDIAN; -static char _cpuArchCstr[1024]; -static char _operatingSystemCstr[1024]; - -#ifdef G3D_WIN32 -/** Used by getTick() for timing */ -static LARGE_INTEGER _start; -static LARGE_INTEGER _counterFrequency; -#else -static struct timeval _start; -#endif - -static char versionCstr[1024]; -System::OutOfMemoryCallback System::outOfMemoryCallback = NULL; - -#ifdef G3D_OSX -long System::m_OSXCPUSpeed; -double System::m_secondsPerNS; -#endif - -/** The Real-World time of System::getTick() time 0. Set by initTime */ -static RealTime realWorldGetTickTime0; - - -static unsigned int maxSupportedCPUIDLevel = 0; -static unsigned int maxSupportedExtendedLevel = 0; - -/** Checks if the CPUID command is available on the processor (called from init) */ -static void checkForCPUID(); - -/** ReadRead the standard processor extensions. Called from init(). */ -static void getStandardProcessorExtensions(); - -/** Called from init */ -static void initTime(); - - -std::string System::findDataFile -(const std::string& full, - bool errorIfNotFound) { - - if (fileExists(full)) { - return full; - } - - std::string initialAppDataDir(g_appDataDir); - - std::string name = filenameBaseExt(full); - std::string originalPath = filenamePath(full); - - // Search several paths - Array pathBase; - - int backlen = 4; - - // add what should be the current working directory - pathBase.append(""); - - // add application specified data directory to be searched first - pathBase.append(initialAppDataDir); - - // try walking back along the directory tree - std::string prev = ""; - for (int i = 0; i < backlen; ++i) { - pathBase.append(originalPath + prev); - prev = prev + "../"; - } - - prev = "../"; - for (int i = 0; i < backlen; ++i) { - pathBase.append(prev); - prev = prev + "../"; - } - - // Hard-code in likely install directories - int ver = G3D_VER; - std::string lname = format("G3D-%d.%02d", ver / 10000, (ver / 100) % 100); - - if (G3D_VER % 100 != 0) { - lname = lname + format("-b%02d/", ver % 100); - } else { - lname = lname + "/"; - } - - // Look in some other likely places -# ifdef G3D_WIN32 - std::string lpath = "libraries/G3D/"; - pathBase.append(std::string("c:/") + lpath); - pathBase.append(std::string("d:/") + lpath); - pathBase.append(std::string("e:/") + lpath); - pathBase.append(std::string("f:/") + lpath); - pathBase.append(std::string("g:/") + lpath); - pathBase.append(std::string("x:/") + lpath); -# endif -# if defined(G3D_LINUX) - pathBase.append("/usr/local/"); - pathBase.append("/course/cs224/"); - pathBase.append("/map/gfx0/common/games/"); -# endif -# if defined(G3D_FREEBSD) - pathBase.append("/usr/local/"); - pathBase.append("/usr/local/371/"); - pathBase.append("/usr/cs-local/371/"); -# endif -# if defined(G3D_OSX) - pathBase.append("/usr/local/" + lname); - pathBase.append("/Volumes/McGuire/Projects/"); -# endif - - // Add the library name to all variations - int N = pathBase.size(); - for (int i = 0; i < N; ++i) { - pathBase.append(pathBase[i] + lname); - pathBase.append(pathBase[i] + "G3D/"); - } - - Array subDir; - subDir.append("", "font/", "sky/", "gui/"); - subDir.append("image/", "quake2/", "quake2/players/"); - subDir.append("quake3/", "SuperShader/", "ifs/", "3ds/"); - subDir.append("quake2/speedway/"); - - Array path; - for (int p = 0; p < pathBase.size(); ++p) { - for (int s = 0; s < subDir.size(); ++s) { - path.append(pathBase[p] + subDir[s]); - path.append(pathBase[p] + "data/" + subDir[s]); - path.append(pathBase[p] + "data-files/" + subDir[s]); - } - } - - for (int i = 0; i < path.length(); ++i) { - std::string filename = path[i] + name; - if (fileExists(filename)) { - logPrintf("\nWARNING: Could not find '%s' so '%s' " - "was substituted.\n", full.c_str(), - filename.c_str()); - return filename; - } - } - - if (errorIfNotFound) { - // Generate an error message - std::string locations; - for (int i = 0; i < path.size(); ++i) { - locations += path[i] + name + "\n"; - } - alwaysAssertM(false, "Could not find '" + full + "' in:\n" + locations); - } - // Not found - return ""; -} - - -void System::setAppDataDir(const std::string& path) { - // just copy the path, it needs to be valid - strncpy(g_appDataDir, path.c_str(), sizeof(g_appDataDir)); -} - - -std::string demoFindData(bool errorIfNotFound) { - // Directories that might contain the data - Array potential; - - // Look back up the directory tree - std::string x = "../"; - std::string f = ""; - for (int i = 0; i < 6; ++i) { - potential.append(f); - f = f + x; - } - - // Hard-code in likely install directories - int ver = G3D_VER; - std::string lname = format("G3D-%d.%02d", ver / 10000, (ver / 100) % 100); - - if (G3D_VER % 100 != 0) { - lname = lname + format("-b%02d/", ver % 100); - } else { - lname = lname + "/"; - } - - std::string lpath = "libraries/" + lname; - #ifdef G3D_WIN32 - potential.append(std::string("c:/") + lpath); - potential.append(std::string("d:/") + lpath); - potential.append(std::string("e:/") + lpath); - potential.append(std::string("f:/") + lpath); - potential.append(std::string("g:/") + lpath); - potential.append(std::string("x:/") + lpath); - #elif defined(G3D_LINUX) - potential.append("/usr/local/" + lname); - potential.append("/course/cs224/"); - potential.append("/map/gfx0/common/games/"); - #elif defined(G3D_FREEBSD) - potential.append("/usr/local/" + lname); - potential.append("/usr/local/371/") - potential.append("/usr/cs-local/371/") - #elif defined(G3D_OSX) - potential.append("/usr/local/" + lname); - potential.append("/Volumes/McGuire/Projects/"); - potential.append("/Volumes/McGuire/Projects/G3D/"); - #endif - - // Scan all potentials for the font directory - for (int p = 0; p < potential.size(); ++p) { - std::string path = potential[p]; - //debugPrintf("Looking at: %sdata\n", path.c_str()); - if (fileExists(path + "data") && fileExists(path + "data/font")) { - return path + "data/"; - } - if (fileExists(path + "data-files") && fileExists(path + "data-files/font")) { - return path + "data-files/"; - } - } - - if (errorIfNotFound) { - const char* choice[] = {"Exit"}; - - prompt("Demo Error", "The demo could not locate the data directory. " - "The data is required to run this demo. If you have not downloaded " - "the data zipfile, get it from http://g3d-cpp.sf.net. If you have " - "downloaded it, it needs to be no more than 4 directories above the " - "demo directory.", choice, 1, true); - } - - return ""; -} - -bool System::hasCPUID() { - init(); - return g_cpuInfo.m_hasCPUID; -} - -bool System::hasRDTSC() { - init(); - return g_cpuInfo.m_hasRDTSC; -} - - -bool System::hasSSE() { - init(); - return g_cpuInfo.m_hasSSE; -} - - -bool System::hasSSE2() { - init(); - return g_cpuInfo.m_hasSSE2; -} - -bool System::hasSSE3() { - init(); - return g_cpuInfo.m_hasSSE3; -} - -bool System::hasMMX() { - init(); - return g_cpuInfo.m_hasMMX; -} - - -bool System::has3DNow() { - init(); - return g_cpuInfo.m_has3DNOW; -} - - -const std::string& System::cpuVendor() { - init(); - static const std::string _cpuVendor = g_cpuInfo.m_cpuVendorStr; - return _cpuVendor; -} - - -G3DEndian System::machineEndian() { - init(); - return _machineEndian; -} - -const std::string& System::operatingSystem() { - init(); - static const std::string _operatingSystem =_operatingSystemCstr; - return _operatingSystem; -} - - -const std::string& System::cpuArchitecture() { - init(); - static const std::string _cpuArch = _cpuArchCstr; - return _cpuArch; -} - -const std::string& System::build() { - const static std::string b = -# ifdef _DEBUG - "Debug"; -# else - "Release"; -# endif - - return b; -} - -const std::string& System::version() { - init(); - - static const std::string _version = versionCstr; - return _version; -} - - -void System::init() { - // Cannot use most G3D data structures or utility functions in here because - // they are not initialized. - - static bool initialized = false; - - if (initialized) { - return; - } - - initialized = true; - - if ((G3D_VER % 100) != 0) { - sprintf(versionCstr, "G3D %d.%02d beta %d", - G3D_VER / 10000, - (G3D_VER / 100) % 100, - G3D_VER % 100); - } else { - sprintf(versionCstr, "G3D %d.%02d", - G3D_VER / 10000, - (G3D_VER / 100) % 100); - } - - // First of all we check if the CPUID command is available - checkForCPUID(); - - // Figure out if this machine is little or big endian. - { - int32 a = 1; - if (*(uint8*)&a == 1) { - _machineEndian = G3D_LITTLE_ENDIAN; - } else { - _machineEndian = G3D_BIG_ENDIAN; - } - } - -# ifdef G3D_NOT_OSX_PPC - // Process the CPUID information - if (g_cpuInfo.m_hasCPUID) { - // We read the standard CPUID level 0x00000000 which should - // be available on every x86 processor. This fills out - // a string with the processor vendor tag. - unsigned int eaxreg = 0, ebxreg = 0, ecxreg = 0, edxreg = 0; - - CALL_CPUID(0x00, eaxreg, ebxreg, ecxreg, edxreg); - - // Then we connect the single register values to the vendor string - *((unsigned int*) g_cpuInfo.m_cpuVendorStr) = ebxreg; - *((unsigned int*) (g_cpuInfo.m_cpuVendorStr + 4)) = edxreg; - *((unsigned int*) (g_cpuInfo.m_cpuVendorStr + 8)) = ecxreg; - g_cpuInfo.m_cpuVendorStr[12] = '\0'; - - // We can also read the max. supported standard CPUID level - maxSupportedCPUIDLevel = eaxreg & 0xFFFF; - - // Then we read the ext. CPUID level 0x80000000 - CALL_CPUID(0x80000000, eaxreg, ebxreg, ecxreg, edxreg); - - // ...to check the max. supported extended CPUID level - maxSupportedExtendedLevel = eaxreg; - - // Then we switch to the specific processor vendors. - // Fill out _cpuArch based on this information. It will - // be overwritten by the next block of code on Windows, - // but on Linux will stand. - switch (ebxreg) { - case 0x756E6547: // GenuineIntel - strcpy(_cpuArchCstr, "Intel Processor"); - break; - - case 0x68747541: // AuthenticAMD - strcpy(_cpuArchCstr, "AMD Processor"); - break; - - case 0x69727943: // CyrixInstead - strcpy(_cpuArchCstr, "Cyrix Processor"); - break; - - default: - strcpy(_cpuArchCstr, "Unknown Processor Vendor"); - break; - } - } - #endif // G3D_NOT_OSX_PPC - - #ifdef G3D_WIN32 - bool success = RegistryUtil::readInt32 - ("HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "~MHz", g_cpuInfo.m_cpuSpeed); - - SYSTEM_INFO systemInfo; - GetSystemInfo(&systemInfo); - char* arch; - switch (systemInfo.wProcessorArchitecture) { - case PROCESSOR_ARCHITECTURE_INTEL: - arch = "Intel"; - break; - - case PROCESSOR_ARCHITECTURE_MIPS: - arch = "MIPS"; - break; - - case PROCESSOR_ARCHITECTURE_ALPHA: - arch = "Alpha"; - break; - - case PROCESSOR_ARCHITECTURE_PPC: - arch = "Power PC"; - break; - - default: - arch = "Unknown"; - } - - uint32 maxAddr = (uint32)systemInfo.lpMaximumApplicationAddress; - sprintf(_cpuArchCstr, "%d x %d-bit %s processor", - systemInfo.dwNumberOfProcessors, - (int)(::log((double)maxAddr) / ::log(2.0) + 2.0), - arch); - // _CPUSpeed / (1024.0 * 1024)); - - OSVERSIONINFO osVersionInfo; - osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - success = GetVersionEx(&osVersionInfo) != 0; - - if (success) { - sprintf(_operatingSystemCstr, "Windows %d.%d build %d Platform %d %s", - osVersionInfo.dwMajorVersion, - osVersionInfo.dwMinorVersion, - osVersionInfo.dwBuildNumber, - osVersionInfo.dwPlatformId, - osVersionInfo.szCSDVersion); - } else { - strcpy(_operatingSystemCstr, "Windows"); - } - - #elif defined(G3D_LINUX) - - { - // Shell out to the 'uname' command - FILE* f = popen("uname -a", "r"); - - int len = 100; - char* r = (char*)::malloc(len * sizeof(char)); - fgets(r, len, f); - // Remove trailing newline - if (r[strlen(r) - 1] == '\n') { - r[strlen(r) - 1] = '\0'; - } - fclose(f); - - strcpy(_operatingSystemCstr, r); - ::free(r); - } - - #elif defined(G3D_OSX) - - // Operating System: - SInt32 macVersion; - Gestalt(gestaltSystemVersion, &macVersion); - - int major = (macVersion >> 8) & 0xFF; - int minor = (macVersion >> 4) & 0xF; - int revision = macVersion & 0xF; - - sprintf(_operatingSystemCstr, "OS X %x.%x.%x", major, minor, revision); - - // Clock Cycle Timing Information: - Gestalt('pclk', &System::m_OSXCPUSpeed); - g_cpuInfo.m_cpuSpeed = iRound((double)m_OSXCPUSpeed / (1024 * 1024)); - m_secondsPerNS = 1.0 / 1.0e9; - - // System Architecture: - const NXArchInfo* pInfo = NXGetLocalArchInfo(); - - if (pInfo) { - strcpy(_cpuArchCstr, pInfo->description); - - switch (pInfo->cputype) { - case CPU_TYPE_POWERPC: - switch(pInfo->cpusubtype){ - case CPU_SUBTYPE_POWERPC_750: - case CPU_SUBTYPE_POWERPC_7400: - case CPU_SUBTYPE_POWERPC_7450: - strcpy(g_cpuInfo.m_cpuVendorStr, "Motorola"); - break; - case CPU_SUBTYPE_POWERPC_970: - strcpy(g_cpuInfo.m_cpuVendorStr, "IBM"); - break; - } - break; - - case CPU_TYPE_I386: - strcpy(g_cpuInfo.m_cpuVendorStr, "Intel"); - break; - } - } - #endif - - initTime(); - - getStandardProcessorExtensions(); -} - -static void checkForCPUID() { - unsigned int bitChanged = 0; - - // We've to check if we can toggle the flag register bit 21. - // If we can't the processor does not support the CPUID command. - -#if defined(_MSC_VER) - __asm { - push eax - push ebx - pushfd - pushfd - pop eax - mov ebx, eax - xor eax, 0x00200000 - push eax - popfd - pushfd - pop eax - popfd - xor eax, ebx - mov bitChanged, eax - pop ebx - pop eax - } -#elif defined(__GNUC__) && defined(i386) && !defined(G3D_OSX_INTEL) - // 32-bit g++ - __asm__ ( - "pushfl # Get original EFLAGS \n" - "pushfl \n" - "popl %%eax \n" - "movl %%eax, %%ecx \n" - "xorl $0x200000, %%eax # Flip ID bit in EFLAGS \n" - "pushl %%eax # Save new EFLAGS value on stack \n" - "popfl # Replace current EFLAGS value \n" - "pushfl # Get new EFLAGS \n" - "popl %%eax # Store new EFLAGS in EAX \n" - "popfl \n" - "xorl %%ecx, %%eax # Can not toggle ID bit, \n" - "movl %%eax, %0 # We have CPUID support \n" - : "=m" (bitChanged) - : // No inputs - : "%eax", "%ecx" - ); -#elif defined(__GNUC__) && defined(__x86_64__) && !defined(G3D_OSX_INTEL) - // x86_64 has SSE and CPUID - - bitChanged = 1; -#else - // Unknown architecture - bitChanged = 0; -#endif - - g_cpuInfo.m_hasCPUID = ((bitChanged == 0) ? false : true); -} - -void getStandardProcessorExtensions() { -#if !defined(G3D_OSX) || defined(G3D_OSX_INTEL) - if (! g_cpuInfo.m_hasCPUID) { - return; - } - - unsigned int eaxreg = 0, ebxreg = 0, ecxreg = 0; - unsigned int features = 0; - - // http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf - // call cpuid with function 0x01 in EAX - - // Invoking CPUID with '1' in EAX fills out edx with a bit string. - // The bits of this value indicate the presence or absence of - // useful processor features. - CALL_CPUID(0x01, eaxreg, ebxreg, ecxreg, features); - - #define checkBit(var, bit) ((var & (1 << bit)) ? true : false) - - g_cpuInfo.m_hasRDTSC = checkBit(features, 16); - g_cpuInfo.m_hasMMX = checkBit(features, 23); - g_cpuInfo.m_hasSSE = checkBit(features, 25); - g_cpuInfo.m_hasSSE2 = checkBit(features, 26); - g_cpuInfo.m_hasSSE3 = checkBit(ecxreg, 0); - - if (maxSupportedExtendedLevel >= 0x80000001) { - // function 0x80000001 changes bit 31 of edx to 3dnow support flag - CALL_CPUID(0x80000001, eaxreg, ebxreg, ecxreg, features); - g_cpuInfo.m_has3DNOW = checkBit(features, 31); - } else { - g_cpuInfo.m_has3DNOW = false; - } - - #undef checkBit -#endif -} - -#if defined(SSE) - -// Copy in 128 bytes chunks, where each chunk contains 8*float32x4 = 8 * 4 * 4 bytes = 128 bytes -// -// -void memcpySSE2(void* dst, const void* src, int nbytes) { - int remainingBytes = nbytes; - - if (nbytes > 128) { - - // Number of chunks - int N = nbytes / 128; - - float* restrict d = (float*)dst; - const float* restrict s = (const float*)src; - - // Finish when the destination pointer has moved 8N elements - float* stop = d + (N * 8 * 4); - - while (d < stop) { - // Inner loop unrolled 8 times - const __m128 r0 = _mm_loadu_ps(s); - const __m128 r1 = _mm_loadu_ps(s + 4); - const __m128 r2 = _mm_loadu_ps(s + 8); - const __m128 r3 = _mm_loadu_ps(s + 12); - const __m128 r4 = _mm_loadu_ps(s + 16); - const __m128 r5 = _mm_loadu_ps(s + 20); - const __m128 r6 = _mm_loadu_ps(s + 24); - const __m128 r7 = _mm_loadu_ps(s + 28); - - _mm_storeu_ps(d, r0); - _mm_storeu_ps(d + 4, r1); - _mm_storeu_ps(d + 8, r2); - _mm_storeu_ps(d + 12, r3); - _mm_storeu_ps(d + 16, r4); - _mm_storeu_ps(d + 20, r5); - _mm_storeu_ps(d + 24, r6); - _mm_storeu_ps(d + 28, r7); - - s += 32; - d += 32; - } - - remainingBytes -= N * 8 * 4 * 4; - } - - if (remainingBytes > 0) { - // Memcpy the rest - memcpy((uint8*)dst + (nbytes - remainingBytes), (const uint8*)src + (nbytes - remainingBytes), remainingBytes); - } -} -#else - - // Fall back to memcpy - void memcpySSE2(void *dst, const void *src, int nbytes) { - memcpy(dst, src, nbytes); - } - -#endif - -#if defined(G3D_WIN32) && defined(SSE) -/** Michael Herf's fast memcpy */ -void memcpyMMX(void* dst, const void* src, int nbytes) { - int remainingBytes = nbytes; - - if (nbytes > 64) { - _asm { - mov esi, src - mov edi, dst - mov ecx, nbytes - shr ecx, 6 // 64 bytes per iteration - - loop1: - movq mm1, 0[ESI] // Read in source data - movq mm2, 8[ESI] - movq mm3, 16[ESI] - movq mm4, 24[ESI] - movq mm5, 32[ESI] - movq mm6, 40[ESI] - movq mm7, 48[ESI] - movq mm0, 56[ESI] - - movntq 0[EDI], mm1 // Non-temporal stores - movntq 8[EDI], mm2 - movntq 16[EDI], mm3 - movntq 24[EDI], mm4 - movntq 32[EDI], mm5 - movntq 40[EDI], mm6 - movntq 48[EDI], mm7 - movntq 56[EDI], mm0 - - add esi, 64 - add edi, 64 - dec ecx - jnz loop1 - - emms - } - remainingBytes -= ((nbytes >> 6) << 6); - } - - if (remainingBytes > 0) { - // Memcpy the rest - memcpy((uint8*)dst + (nbytes - remainingBytes), (const uint8*)src + (nbytes - remainingBytes), remainingBytes); - } -} - -#else - // Fall back to memcpy - void memcpyMMX(void *dst, const void *src, int nbytes) { - memcpy(dst, src, nbytes); - } - -#endif - - -void System::memcpy(void* dst, const void* src, size_t numBytes) { - if (System::hasSSE2() && System::hasMMX()) { - G3D::memcpyMMX(dst, src, numBytes); - } else if (System::hasSSE() && System::hasMMX()) { - G3D::memcpyMMX(dst, src, numBytes); - } else { - ::memcpy(dst, src, numBytes); - } -} - - -/** Michael Herf's fastest memset. n32 must be filled with the same - character repeated. */ -#if defined(G3D_WIN32) && defined(SSE) - -// On x86 processors, use MMX -void memfill(void *dst, int n32, unsigned long i) { - - int originalSize = i; - int bytesRemaining = i; - - if (i > 16) { - - bytesRemaining = i % 16; - i -= bytesRemaining; - __asm { - movq mm0, n32 - punpckldq mm0, mm0 - mov edi, dst - - loopwrite: - - movntq 0[edi], mm0 - movntq 8[edi], mm0 - - add edi, 16 - sub i, 16 - jg loopwrite - - emms - } - } - - if (bytesRemaining > 0) { - ::memset((uint8*)dst + (originalSize - bytesRemaining), n32, bytesRemaining); - } -} - -#else - -// For non x86 processors, we fall back to the standard memset -void memfill(void *dst, int n32, unsigned long i) { - ::memset(dst, n32, i); -} - -#endif - - -void System::memset(void* dst, uint8 value, size_t numBytes) { - if (System::hasSSE() && System::hasMMX()) { - uint32 v = value; - v = v + (v << 8) + (v << 16) + (v << 24); - G3D::memfill(dst, v, numBytes); - } else { - ::memset(dst, value, numBytes); - } -} - - -std::string& System::appName() { - static std::string n = filenameBase(currentProgramFilename()); - return n; -} - - -std::string System::currentProgramFilename() { - char filename[2048]; - - #ifdef G3D_WIN32 - { - GetModuleFileNameA(NULL, filename, sizeof(filename)); - } - #else - { - int ret = readlink("/proc/self/exe", filename, sizeof(filename)); - - // In case of an error, leave the handling up to the caller - if (ret == -1) { - return ""; - } - - debugAssert((int)sizeof(filename) > ret); - - // Ensure proper NULL termination - filename[ret] = 0; - } - #endif - - return filename; -} - - -void System::sleep(RealTime t) { - - // Overhead of calling this function. - static const RealTime OVERHEAD = .000006; - - RealTime now = time(); - RealTime wakeupTime = now + t - OVERHEAD; - - RealTime remainingTime = wakeupTime - now; - RealTime sleepTime = 0; - - while (remainingTime > 0) { - - - if (remainingTime > 0.001) { - // Safe to use Sleep with a time... sleep for half the remaining time - sleepTime = max(remainingTime * .5, 0.0005); - } else if (remainingTime > 0.0001) { - // Safe to use Sleep with a zero time; - // causes the program to yield only - // the current time slice, and then return. - sleepTime = 0; - } else { - // Not safe to use Sleep; busy wait - sleepTime = -1; - } - - if (sleepTime >= 0) { - #ifdef G3D_WIN32 - // Translate to milliseconds - Sleep((int)(sleepTime * 1e3)); - #else - // Translate to microseconds - usleep((int)(sleepTime * 1e6)); - #endif - } - - now = time(); - remainingTime = wakeupTime - now; - } -} - - -void System::consoleClearScreen() { - #ifdef G3D_WIN32 - system("cls"); - #else - system("clear"); - #endif -} - - -bool System::consoleKeyPressed() { - #ifdef G3D_WIN32 - - return _kbhit() != 0; - - #else - - static const int STDIN = 0; - static bool initialized = false; - - if (! initialized) { - // Use termios to turn off line buffering - termios term; - tcgetattr(STDIN, &term); - term.c_lflag &= ~ICANON; - tcsetattr(STDIN, TCSANOW, &term); - setbuf(stdin, NULL); - initialized = true; - } - - #ifdef G3D_LINUX - - int bytesWaiting; - ioctl(STDIN, FIONREAD, &bytesWaiting); - return bytesWaiting; - - #else - - timeval timeout; - fd_set rdset; - - FD_ZERO(&rdset); - FD_SET(STDIN, &rdset); - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - return select(STDIN + 1, &rdset, NULL, NULL, &timeout); - #endif - #endif -} - - -int System::consoleReadKey() { - #ifdef G3D_WIN32 - return _getch(); - #else - char c; - read(0, &c, 1); - return c; - #endif -} - - -void initTime() { - #ifdef G3D_WIN32 - if (QueryPerformanceFrequency(&_counterFrequency)) { - QueryPerformanceCounter(&_start); - } - - struct _timeb t; - _ftime(&t); - - realWorldGetTickTime0 = (RealTime)t.time - t.timezone * G3D::MINUTE + (t.dstflag ? G3D::HOUR : 0); - - #else - gettimeofday(&_start, NULL); - // "sse" = "seconds since epoch". The time - // function returns the seconds since the epoch - // GMT (perhaps more correctly called UTC). - time_t gmt = time(NULL); - - // No call to free or delete is needed, but subsequent - // calls to asctime, ctime, mktime, etc. might overwrite - // local_time_vals. - tm* localTimeVals = localtime(&gmt); - - time_t local = gmt; - - if (localTimeVals) { - // tm_gmtoff is already corrected for daylight savings. - local = local + localTimeVals->tm_gmtoff; - } - - realWorldGetTickTime0 = local; - #endif -} - - -RealTime System::time() { - init(); - #ifdef G3D_WIN32 - LARGE_INTEGER now; - QueryPerformanceCounter(&now); - - return ((RealTime)(now.QuadPart - _start.QuadPart) / - _counterFrequency.QuadPart) + realWorldGetTickTime0; - #else - // Linux resolution defaults to 100Hz. - // There is no need to do a separate RDTSC call as gettimeofday - // actually uses RDTSC when on systems that support it, otherwise - // it uses the system clock. - struct timeval now; - gettimeofday(&now, NULL); - - return (now.tv_sec - _start.tv_sec) + - (now.tv_usec - _start.tv_usec) / 1e6 - + realWorldGetTickTime0; - #endif -} - - -//////////////////////////////////////////////////////////////// - -#define REALPTR_TO_USERPTR(x) ((uint8*)(x) + sizeof (void *)) -#define USERPTR_TO_REALPTR(x) ((uint8*)(x) - sizeof (void *)) -#define REALBLOCK_SIZE(x) ((x) + sizeof (void *)) - -class BufferPool { -public: - - /** Only store buffers up to these sizes (in bytes) in each pool-> - Different pools have different management strategies. - - A large block is preallocated for tiny buffers; they are used with - tremendous frequency. Other buffers are allocated as demanded. - Tiny buffers are 128 bytes long because that seems to align well with - cache sizes on many machines. - */ - enum {tinyBufferSize = 128, smallBufferSize = 1024, medBufferSize = 4096}; - - /** - Most buffers we're allowed to store. - 128000 * 128 = 16 MB (preallocated) - 2048 * 1024 = 2 MB (allocated on demand) - 1024 * 4096 = 4 MB (allocated on demand) - */ - enum {maxTinyBuffers = 128000, maxSmallBuffers = 2048, maxMedBuffers = 1024}; - -private: - - class MemBlock { - public: - void* ptr; - size_t bytes; - - inline MemBlock() : ptr(NULL), bytes(0) {} - inline MemBlock(void* p, size_t b) : ptr(p), bytes(b) {} - }; - - MemBlock smallPool[maxSmallBuffers]; - int smallPoolSize; - - MemBlock medPool[maxMedBuffers]; - int medPoolSize; - - /** The tiny pool is a single block of storage into which all tiny - objects are allocated. This provides better locality for - small objects and avoids the search time, since all tiny - blocks are exactly the same size. */ - void* tinyPool[maxTinyBuffers]; - int tinyPoolSize; - - /** Pointer to the data in the tiny pool */ - void* tinyHeap; - -# ifdef G3D_WIN32 - CRITICAL_SECTION mutex; -# else - pthread_mutex_t mutex; -# endif - - /** Provide synchronization between threads */ - void lock() { -# ifdef G3D_WIN32 - EnterCriticalSection(&mutex); -# else - pthread_mutex_lock(&mutex); -# endif - } - - void unlock() { -# ifdef G3D_WIN32 - LeaveCriticalSection(&mutex); -# else - pthread_mutex_unlock(&mutex); -# endif - } - - /** - Malloc out of the tiny heap. Returns NULL if allocation failed. - */ - inline void* tinyMalloc(size_t bytes) { - // Note that we ignore the actual byte size - // and create a constant size block. - (void)bytes; - assert(tinyBufferSize >= bytes); - - void* ptr = NULL; - - if (tinyPoolSize > 0) { - --tinyPoolSize; - - // Return the old last pointer from the freelist - ptr = tinyPool[tinyPoolSize]; - -# ifdef G3D_DEBUG - if (tinyPoolSize > 0) { - assert(tinyPool[tinyPoolSize - 1] != ptr); - // "System::malloc heap corruption detected: " - // "the last two pointers on the freelist are identical (during tinyMalloc)."); - } -# endif - - // NULL out the entry to help detect corruption - tinyPool[tinyPoolSize] = NULL; - } - - return ptr; - } - - /** Returns true if this is a pointer into the tiny heap. */ - bool inTinyHeap(void* ptr) { - return - (ptr >= tinyHeap) && - (ptr < (uint8*)tinyHeap + maxTinyBuffers * tinyBufferSize); - } - - void tinyFree(void* ptr) { - assert(ptr); - assert(tinyPoolSize < maxTinyBuffers); - // "Tried to free a tiny pool buffer when the tiny pool freelist is full."); - -# ifdef G3D_DEBUG - if (tinyPoolSize > 0) { - void* prevOnHeap = tinyPool[tinyPoolSize - 1]; - assert(prevOnHeap != ptr); -// "System::malloc heap corruption detected: " -// "the last two pointers on the freelist are identical (during tinyFree)."); - } -# endif - - assert(tinyPool[tinyPoolSize] == NULL); - - // Put the pointer back into the free list - tinyPool[tinyPoolSize] = ptr; - ++tinyPoolSize; - - } - - void flushPool(MemBlock* pool, int& poolSize) { - for (int i = 0; i < poolSize; ++i) { - ::free(pool[i].ptr); - pool[i].ptr = NULL; - pool[i].bytes = 0; - } - poolSize = 0; - } - - - /** Allocate out of a specific pool-> Return NULL if no suitable - memory was found. - - */ - void* malloc(MemBlock* pool, int& poolSize, size_t bytes) { - - // OPT: find the smallest block that satisfies the request. - - // See if there's something we can use in the buffer pool-> - // Search backwards since usually we'll re-use the last one. - for (int i = (int)poolSize - 1; i >= 0; --i) { - if (pool[i].bytes >= bytes) { - // We found a suitable entry in the pool-> - - // No need to offset the pointer; it is already offset - void* ptr = pool[i].ptr; - - // Remove this element from the pool - --poolSize; - pool[i] = pool[poolSize]; - - return ptr; - } - } - - return NULL; - } - -public: - - /** Count of memory allocations that have occurred. */ - int totalMallocs; - int mallocsFromTinyPool; - int mallocsFromSmallPool; - int mallocsFromMedPool; - - /** Amount of memory currently allocated (according to the application). - This does not count the memory still remaining in the buffer pool, - but does count extra memory required for rounding off to the size - of a buffer. - Primarily useful for detecting leaks.*/ - // TODO: make me an atomic int! - volatile int bytesAllocated; - - BufferPool() { - totalMallocs = 0; - - mallocsFromTinyPool = 0; - mallocsFromSmallPool = 0; - mallocsFromMedPool = 0; - - bytesAllocated = true; - - tinyPoolSize = 0; - tinyHeap = NULL; - - smallPoolSize = 0; - - medPoolSize = 0; - - - // Initialize the tiny heap as a bunch of pointers into one - // pre-allocated buffer. - tinyHeap = ::malloc(maxTinyBuffers * tinyBufferSize); - for (int i = 0; i < maxTinyBuffers; ++i) { - tinyPool[i] = (uint8*)tinyHeap + (tinyBufferSize * i); - } - tinyPoolSize = maxTinyBuffers; - -# ifdef G3D_WIN32 - InitializeCriticalSection(&mutex); -# else - pthread_mutex_init(&mutex, NULL); -# endif - } - - - ~BufferPool() { - ::free(tinyHeap); -# ifdef G3D_WIN32 - DeleteCriticalSection(&mutex); -# else - // No destruction on pthreads -# endif - } - - - void* realloc(void* ptr, size_t bytes) { - if (ptr == NULL) { - return malloc(bytes); - } - - if (inTinyHeap(ptr)) { - if (bytes <= tinyBufferSize) { - // The old pointer actually had enough space. - return ptr; - } else { - // Free the old pointer and malloc - - void* newPtr = malloc(bytes); - System::memcpy(newPtr, ptr, tinyBufferSize); - tinyFree(ptr); - return newPtr; - - } - } else { - // In one of our heaps. - - // See how big the block really was - size_t realSize = *(uint32*)USERPTR_TO_REALPTR(ptr); - if (bytes <= realSize) { - // The old block was big enough. - return ptr; - } - - // Need to reallocate - void* newPtr = malloc(bytes); - System::memcpy(newPtr, ptr, realSize); - free(ptr); - return newPtr; - } - } - - - void* malloc(size_t bytes) { - lock(); - ++totalMallocs; - - if (bytes <= tinyBufferSize) { - - void* ptr = tinyMalloc(bytes); - - if (ptr) { - ++mallocsFromTinyPool; - unlock(); - return ptr; - } - - } - - // Failure to allocate a tiny buffer is allowed to flow - // through to a small buffer - if (bytes <= smallBufferSize) { - - void* ptr = malloc(smallPool, smallPoolSize, bytes); - - if (ptr) { - ++mallocsFromSmallPool; - unlock(); - return ptr; - } - - } else if (bytes <= medBufferSize) { - // Note that a small allocation failure does *not* fall - // through into a medium allocation because that would - // waste the medium buffer's resources. - - void* ptr = malloc(medPool, medPoolSize, bytes); - - if (ptr) { - ++mallocsFromMedPool; - unlock(); - debugAssertM(ptr != NULL, "BufferPool::malloc returned NULL"); - return ptr; - } - } - - bytesAllocated += REALBLOCK_SIZE(bytes); - unlock(); - - // Heap allocate - - // Allocate 4 extra bytes for our size header (unfortunate, - // since malloc already added its own header). - void* ptr = ::malloc(REALBLOCK_SIZE(bytes)); - - if (ptr == NULL) { - // Flush memory pools to try and recover space - flushPool(smallPool, smallPoolSize); - flushPool(medPool, medPoolSize); - ptr = ::malloc(REALBLOCK_SIZE(bytes)); - } - - if (ptr == NULL) { - if ((System::outOfMemoryCallback != NULL) && - (System::outOfMemoryCallback(REALBLOCK_SIZE(bytes), true) == true)) { - // Re-attempt the malloc - ptr = ::malloc(REALBLOCK_SIZE(bytes)); - } - } - - if (ptr == NULL) { - if (System::outOfMemoryCallback != NULL) { - // Notify the application - System::outOfMemoryCallback(REALBLOCK_SIZE(bytes), false); - } -# ifdef G3D_DEBUG - debugPrintf("::malloc(%d) returned NULL\n", REALBLOCK_SIZE(bytes)); -# endif - debugAssertM(ptr != NULL, - "::malloc returned NULL. Either the " - "operating system is out of memory or the " - "heap is corrupt."); - return NULL; - } - - *(uint32*)ptr = bytes; - - return REALPTR_TO_USERPTR(ptr); - } - - - void free(void* ptr) { - if (ptr == NULL) { - // Free does nothing on null pointers - return; - } - - assert(isValidPointer(ptr)); - - if (inTinyHeap(ptr)) { - lock(); - tinyFree(ptr); - unlock(); - return; - } - - uint32 bytes = *(uint32*)USERPTR_TO_REALPTR(ptr); - - lock(); - if (bytes <= smallBufferSize) { - if (smallPoolSize < maxSmallBuffers) { - smallPool[smallPoolSize] = MemBlock(ptr, bytes); - ++smallPoolSize; - unlock(); - return; - } - } else if (bytes <= medBufferSize) { - if (medPoolSize < maxMedBuffers) { - medPool[medPoolSize] = MemBlock(ptr, bytes); - ++medPoolSize; - unlock(); - return; - } - } - bytesAllocated -= REALBLOCK_SIZE(bytes); - unlock(); - - // Free; the buffer pools are full or this is too big to store. - ::free(USERPTR_TO_REALPTR(ptr)); - } - - std::string performance() const { - if (totalMallocs > 0) { - int pooled = mallocsFromTinyPool + - mallocsFromSmallPool + - mallocsFromMedPool; - - int total = totalMallocs; - - return format("malloc performance: %5.1f%% <= %db, %5.1f%% <= %db, " - "%5.1f%% <= %db, %5.1f%% > %db", - 100.0 * mallocsFromTinyPool / total, - BufferPool::tinyBufferSize, - 100.0 * mallocsFromSmallPool / total, - BufferPool::smallBufferSize, - 100.0 * mallocsFromMedPool / total, - BufferPool::medBufferSize, - 100.0 * (1.0 - (double)pooled / total), - BufferPool::medBufferSize); - } else { - return "No System::malloc calls made yet."; - } - } - - std::string status() const { - return format("preallocated shared buffers: %5d/%d x %db", - maxTinyBuffers - tinyPoolSize, maxTinyBuffers, tinyBufferSize); - } -}; - -// Dynamically allocated because we need to ensure that -// the buffer pool is still around when the last global variable -// is deallocated. -static BufferPool* bufferpool = NULL; - -std::string System::mallocPerformance() { -#ifndef NO_BUFFERPOOL - return bufferpool->performance(); -#else - return "NO_BUFFERPOOL"; -#endif -} - -std::string System::mallocStatus() { -#ifndef NO_BUFFERPOOL - return bufferpool->status(); -#else - return "NO_BUFFERPOOL"; -#endif -} - - -void System::resetMallocPerformanceCounters() { -#ifndef NO_BUFFERPOOL - bufferpool->totalMallocs = 0; - bufferpool->mallocsFromMedPool = 0; - bufferpool->mallocsFromSmallPool = 0; - bufferpool->mallocsFromTinyPool = 0; -#endif -} - - -#ifndef NO_BUFFERPOOL -inline void initMem() { - // Putting the test here ensures that the system is always - // initialized, even when globals are being allocated. - static bool initialized = false; - if (! initialized) { - bufferpool = new BufferPool(); - initialized = true; - } -} -#endif - - -void* System::malloc(size_t bytes) { -#ifndef NO_BUFFERPOOL - initMem(); - return bufferpool->malloc(bytes); -#else - return ::malloc(bytes); -#endif -} - -void* System::calloc(size_t n, size_t x) { -#ifndef NO_BUFFERPOOL - void* b = System::malloc(n * x); - debugAssertM(b != NULL, "System::malloc returned NULL"); - debugAssertM(isValidHeapPointer(b), "System::malloc returned an invalid pointer"); - System::memset(b, 0, n * x); - return b; -#else - return ::calloc(n, x); -#endif -} - - -void* System::realloc(void* block, size_t bytes) { -#ifndef NO_BUFFERPOOL - initMem(); - return bufferpool->realloc(block, bytes); -#else - return ::realloc(block, bytes); -#endif -} - - -void System::free(void* p) { -#ifndef NO_BUFFERPOOL - bufferpool->free(p); -#else - return ::free(p); -#endif -} - - -void* System::alignedMalloc(size_t bytes, size_t alignment) { - - alwaysAssertM(isPow2(alignment), "alignment must be a power of 2"); - - // We must align to at least a word boundary. - alignment = iMax(alignment, sizeof(void *)); - - // Pad the allocation size with the alignment size and the - // size of the redirect pointer. - size_t totalBytes = bytes + alignment + sizeof(void*); - - size_t truePtr = (size_t)System::malloc(totalBytes); - - if (truePtr == 0) { - // malloc returned NULL - return NULL; - } - - debugAssert(isValidHeapPointer((void*)truePtr)); - #ifdef G3D_WIN32 - // The blocks we return will not be valid Win32 debug heap - // pointers because they are offset - // debugAssert(_CrtIsValidPointer((void*)truePtr, totalBytes, TRUE) ); - #endif - - // The return pointer will be the next aligned location (we must at least - // leave space for the redirect pointer, however). - size_t alignedPtr = truePtr + sizeof(void*); - - // 2^n - 1 has the form 1111... in binary. - uint32 bitMask = (alignment - 1); - - // Advance forward until we reach an aligned location. - while ((alignedPtr & bitMask) != 0) { - alignedPtr += sizeof(void*); - } - - debugAssert(alignedPtr - truePtr + bytes <= totalBytes); - - // Immediately before the aligned location, write the true array location - // so that we can free it correctly. - size_t* redirectPtr = (size_t *)(alignedPtr - sizeof(void *)); - redirectPtr[0] = truePtr; - - debugAssert(isValidHeapPointer((void*)truePtr)); - - #ifdef G3D_WIN32 - debugAssert( _CrtIsValidPointer((void*)alignedPtr, bytes, TRUE) ); - #endif - return (void *)alignedPtr; -} - - -void System::alignedFree(void* _ptr) { - if (_ptr == NULL) { - return; - } - - size_t alignedPtr = (size_t)_ptr; - - // Back up one word from the pointer the user passed in. - // We now have a pointer to a pointer to the true start - // of the memory block. - size_t* redirectPtr = (size_t*)(alignedPtr - sizeof(void *)); - - // Dereference that pointer so that ptr = true start - void* truePtr = (void*)redirectPtr[0]; - - debugAssert(isValidHeapPointer((void*)truePtr)); - System::free(truePtr); -} - - -void System::setEnv(const std::string& name, const std::string& value) { - std::string cmd = name + "=" + value; -# ifdef G3D_WIN32 - _putenv(cmd.c_str()); -# else - // Many linux implementations of putenv expect char* - putenv(const_cast(cmd.c_str())); -# endif -} - -const char* System::getEnv(const std::string& name) { - return getenv(name.c_str()); -} - -static void var(TextOutput& t, const std::string& name, const std::string& val) { - t.writeSymbols(name,"="); - t.writeString(val); - t.writeNewline(); -} - - -static void var(TextOutput& t, const std::string& name, const bool val) { - t.writeSymbols(name, "=", val ? "Yes" : "No"); - t.writeNewline(); -} - - -static void var(TextOutput& t, const std::string& name, const int val) { - t.writeSymbols(name,"="); - t.writeNumber(val); - t.writeNewline(); -} - -void System::describeSystem( - std::string& s) { - - TextOutput t; - describeSystem(t); - t.commitString(s); -} - -void System::describeSystem( - TextOutput& t) { - - t.writeSymbols("App", "{"); - t.writeNewline(); - t.pushIndent(); - var(t, "Name", System::currentProgramFilename()); - char cwd[1024]; - getcwd(cwd, 1024); - var(t, "cwd", std::string(cwd)); - t.popIndent(); - t.writeSymbols("}"); - t.writeNewline(); - t.writeNewline(); - - t.writeSymbols("OS", "{"); - t.writeNewline(); - t.pushIndent(); - var(t, "Name", System::operatingSystem()); - t.popIndent(); - t.writeSymbols("}"); - t.writeNewline(); - t.writeNewline(); - - t.writeSymbols("CPU", "{"); - t.writeNewline(); - t.pushIndent(); - var(t, "Vendor", System::cpuVendor()); - var(t, "Architecture", System::cpuArchitecture()); - var(t, "hasCPUID", System::hasCPUID()); - var(t, "hasMMX", System::hasMMX()); - var(t, "hasSSE", System::hasSSE()); - var(t, "hasSSE2", System::hasSSE2()); - var(t, "hasSSE3", System::hasSSE3()); - var(t, "has3DNow", System::has3DNow()); - var(t, "hasRDTSC", System::hasRDTSC()); - t.popIndent(); - t.writeSymbols("}"); - t.writeNewline(); - t.writeNewline(); - - t.writeSymbols("G3D", "{"); - t.writeNewline(); - t.pushIndent(); - var(t, "Link version", G3D_VER); - var(t, "Compile version", System::version()); - t.popIndent(); - t.writeSymbols("}"); - t.writeNewline(); - t.writeNewline(); -} - - -int System::cpuSpeedMHz() { - return g_cpuInfo.m_cpuSpeed; -} - - -void System::setClipboardText(const std::string& s) { -# ifdef G3D_WIN32 - if (OpenClipboard(NULL)) { - HGLOBAL hMem = GlobalAlloc(GHND | GMEM_DDESHARE, s.size() + 1); - if (hMem) { - char *pMem = (char*)GlobalLock(hMem); - strcpy(pMem, s.c_str()); - GlobalUnlock(hMem); - - EmptyClipboard(); - SetClipboardData(CF_TEXT, hMem); - } - - CloseClipboard(); - GlobalFree(hMem); - } -# endif -} - - -std::string System::getClipboardText() { - std::string s; - -# ifdef G3D_WIN32 - if (OpenClipboard(NULL)) { - HANDLE h = GetClipboardData(CF_TEXT); - - if (h) { - char* temp = (char*)GlobalLock(h); - if (temp) { - s = temp; - } - temp = NULL; - GlobalUnlock(h); - } - CloseClipboard(); - } -# endif - return s; -} - - -std::string System::currentDateString() { - time_t t1; - ::time(&t1); - tm* t = localtime(&t1); - return format("%d-%02d-%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday); -} - - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/TextInput.cpp b/externals/g3dlite/G3D.lib/source/TextInput.cpp deleted file mode 100644 index d5dc14fb6a0..00000000000 --- a/externals/g3dlite/G3D.lib/source/TextInput.cpp +++ /dev/null @@ -1,988 +0,0 @@ -/** - @file TextInput.cpp - - @author Morgan McGuire, graphics3d.com - - @cite Based on a lexer written by Aaron Orenstein. - - @created 2001-11-27 - @edited 2008-07-14 - */ - -#include "G3D/fileutils.h" -#include "G3D/TextInput.h" -#include "G3D/BinaryInput.h" -#include "G3D/stringutils.h" - -#ifdef _MSC_VER -# pragma warning (push) -// conversion from 'int' to 'char', possible loss of data (TODO: fix underlying problems) -# pragma warning (disable: 4244) -#endif - -namespace G3D { - -double Token::number() const { - if (_type == NUMBER) { - std::string s = toLower(_string); - if (s == "-1.#ind00") { - return nan(); - } - - if (s == "1.#inf00") { - return inf(); - } - - if (s == "-1.#inf00") { - return -inf(); - } - - double n; - if ((_string.length() > 2) && - (_string[0] == '0') && - (_string[1] == 'x')) { - // Hex - uint32 i; - sscanf(_string.c_str(), "%x", &i); - n = i; - } else { - sscanf(_string.c_str(), "%lg", &n); - } - return n; - } else { - return 0.0; - } -} - - -TextInput::Settings::Settings () - : cComments(true), cppComments(true), escapeSequencesInStrings(true), - otherCommentCharacter('\0'), otherCommentCharacter2('\0'), - signedNumbers(true), singleQuotedStrings(true), sourceFileName(), - startingLineNumberOffset(0), msvcSpecials(true), proofSymbols(false), - caseSensitive(true) -{ - trueSymbols.insert("true"); - falseSymbols.insert("false"); -} - - -Token TextInput::peek() { - if (stack.size() == 0) { - Token t = nextToken(); - push(t); - } - - return stack.front(); -} - - -int TextInput::peekLineNumber() { - return peek().line(); -} - - -int TextInput::peekCharacterNumber() { - return peek().character(); -} - - -Token TextInput::read() { - if (stack.size() > 0) { - Token t = stack.front(); - stack.pop_front(); - return t; - } else { - return nextToken(); - } -} - -static void toUpper(Set& set) { - Array symbols; - set.getMembers(symbols); - set.clear(); - for (int i = 0; i < symbols.size(); ++i) { - set.insert(toUpper(symbols[i])); - } -} - -void TextInput::init() { - currentCharOffset = 0; - charNumber = 1; - lineNumber = 1 + options.startingLineNumberOffset; - - if (! options.caseSensitive) { - // Convert true and false symbols to all uppercase for fast comparisons - toUpper(options.trueSymbols); - toUpper(options.falseSymbols); - } -} - - -void TextInput::push(const Token& t) { - stack.push_front(t); -} - - -bool TextInput::hasMore() { - return (peek()._type != Token::END); -} - - -int TextInput::eatInputChar() { - // Don't go off the end - if (currentCharOffset >= (unsigned int)buffer.length()) { - return EOF; - } - - unsigned char c = buffer[currentCharOffset]; - ++currentCharOffset; - - // update lineNumber and charNumber to reflect the location of the *next* - // character which will be read. - // - // We update even for CR because the user is allowed to do arbitrarily - // stupid things, like put a bunch of literal CRs inside a quoted string. - // - // We eat all whitespace between tokens, so they should never see a - // lineNumber that points to a CR. However, if they have some kind of - // syntax error in a token that appears *after* a quoted string - // containing CRs, they should get a correct character number. - - // TODO: http://sourceforge.net/tracker/index.php?func=detail&aid=1341266&group_id=76879&atid=548565 - - if (c == '\n') { - ++lineNumber; - charNumber = 1; - } else { - ++charNumber; - } - - return c; -} - -int TextInput::peekInputChar(unsigned int distance) { - // Don't go off the end - if ((currentCharOffset + distance) >= (unsigned int)buffer.length()) { - return EOF; - } - - unsigned char c = buffer[currentCharOffset + distance]; - return c; -} - - -Token TextInput::nextToken() { - Token t; - - t._line = lineNumber; - t._character = charNumber; - t._type = Token::END; - t._extendedType = Token::END_TYPE; - - int c = peekInputChar(); - if (c == EOF) { - return t; - } - - bool whitespaceDone = false; - while (! whitespaceDone) { - whitespaceDone = true; - - // Consume whitespace - while (isWhiteSpace(c)) { - c = eatAndPeekInputChar(); - } - - int c2 = peekInputChar(1); - if ((options.cppComments && c == '/' && c2 == '/') - || (options.otherCommentCharacter != '\0' - && c == options.otherCommentCharacter) - || (options.otherCommentCharacter2 != '\0' - && c == options.otherCommentCharacter2)) { - - // Single line comment, consume to newline or EOF. - - do { - c = eatAndPeekInputChar(); - } while (! isNewline(c) && c != EOF); - - // There is whitespace after the comment (in particular, the - // newline that terminates the comment). There might also be - // whitespace at the start of the next line. - whitespaceDone = false; - - } else if (options.cComments && (c == '/') && (c2 == '*')) { - - // consume both start-comment chars, can't let the trailing one - // help close the comment. - eatInputChar(); - eatInputChar(); - - // Multi-line comment, consume to end-marker or EOF. - c = peekInputChar(); - c2 = peekInputChar(1); - while (! ((c == '*') && (c2 == '/')) && (c != EOF)) { - eatInputChar(); - c = c2; - c2 = peekInputChar(1); - } - eatInputChar(); // eat closing '*' - eatInputChar(); // eat closing '/' - - c = peekInputChar(); - - // May be whitespace after comment. - whitespaceDone = false; - } - - } // while (! whitespaceDone) - - t._line = lineNumber; - t._character = charNumber; - - // handle EOF - if (c == EOF) { - return t; - } - - // Extended ASCII parses as itself, except for EOF - if (c > 127 && c < 255) { - t._type = Token::SYMBOL; - t._extendedType = Token::SYMBOL_TYPE; - t._string = c; - c = eatAndPeekInputChar(); - } - - - // Perform appropriate setup for a symbol (including setting up the token - // string to start with c), eat the input character, and overwrite - // 'c' with the peeked next input character. -#define SETUP_SYMBOL(c) \ - { \ - t._type = Token::SYMBOL; \ - t._extendedType = Token::SYMBOL_TYPE; \ - t._string = c; \ - c = eatAndPeekInputChar(); \ - } - - switch (c) { - - case '@': // Simple symbols -> just themselves. - case '(': - case ')': - case ',': - case ';': - case '{': - case '}': - case '[': - case ']': - case '#': - case '$': - case '?': - case '%': - SETUP_SYMBOL(c); - return t; - - case '-': // negative number, -, --, -=, or -> - SETUP_SYMBOL(c); - - switch (c) { - case '>': // -> - case '-': // -- - case '=': // -= - t._string += c; - eatInputChar(); - return t; - } - - if (options.signedNumbers - && (isDigit(c) || (c == '.' && isDigit(peekInputChar(1))))) { - - // Negative number. 'c' is still the first digit, and is - // the next input char. - - goto numLabel; - } - - // plain - - return t; - - case '+': // positive number, +, ++, or += - SETUP_SYMBOL(c); - - switch (c) { - case '+': // ++ - case '=': // += - t._string += c; - eatInputChar(); - return t; - } - - if (options.signedNumbers - && (isDigit(c) || (c == '.' && isDigit(peekInputChar(1))))) { - - // Positive number. 'c' is still the first digit, and is - // the next input char. - - goto numLabel; - } - - return t; - - case ':': // : or :: or ::> or ::= or := or :> - SETUP_SYMBOL(c); - - if (c == ':') { - t._string += c; - eatInputChar(); - - if (options.proofSymbols) { - c = peekInputChar(0); - - if ((c == '>') || (c == '=')) { - t._string += c; - eatInputChar(); - } - } - } - else if (options.proofSymbols && (c == '=' || c == '>')) { - t._string += c; - eatInputChar(); - } - return t; - - case '=': // = or == or => - SETUP_SYMBOL(c); - - if (c == '=') { - t._string += c; - eatInputChar(); - return t; - } else if (options.proofSymbols && (c == '>')) { - t._string += c; - eatInputChar(); - return t; - } - return t; - - case '*': // * or *= - case '/': // / or /= - case '!': // ! or != - case '~': // ~ or ~= - case '^': // ^ or ^= - SETUP_SYMBOL(c); - - if (c == '=') { - t._string += c; - eatInputChar(); - return t; - } - return t; - - case '>': // >, >>,or >= - case '<': // <<, <<, or <= or <- or <: - case '|': // ||, ||, or |= or |- - case '&': // &, &&, or &= - { - int orig_c = c; - SETUP_SYMBOL(c); - - if ((c == '=') || (orig_c == c)) { - t._string += c; - eatInputChar(); - return t; - } else if (options.proofSymbols) { - if ((orig_c == '<') && (c == '-')) { - t._string += c; - eatInputChar(); - } else if ((orig_c == '|') && (c == '-')) { - t._string += c; - eatInputChar(); - } else if ((orig_c == '<') && (c == ':')) { - t._string += c; - - c = eatAndPeekInputChar(); - - if (c == ':') { - t._string += c; - eatInputChar(); - } - } - } - } - return t; - - case '\\': // backslash or escaped comment char. - SETUP_SYMBOL(c); - - if ((options.otherCommentCharacter != '\0' - && c == options.otherCommentCharacter) - || (options.otherCommentCharacter2 != '\0' - && c == options.otherCommentCharacter2)) { - - // escaped comment character. Return the raw comment - // char (no backslash). - - t._string = c; - eatInputChar(); - return t; - } - return t; - - case '.': // number, ., .., or ... - if (isDigit(peekInputChar(1))) { - // We're parsing a float that began without a leading zero - goto numLabel; - } - - SETUP_SYMBOL(c); - - if (c == '.') { // .. or ... - t._string += c; - c = eatAndPeekInputChar(); - - if (c == '.') { // ... - t._string += c; - eatInputChar(); - } - return t; - } - - return t; - - } // switch (c) - -#undef SETUP_SYMBOL - -numLabel: - if (isDigit(c) || (c == '.')) { - - // A number. Note-- single dots have been - // parsed already, so a . indicates a number - // less than 1 in floating point form. - - // [0-9]*(\.[0-9]) or [0-9]+ or 0x[0-9,A-F]+ - - if (t._string != "-") { - // If we picked up a leading "-" sign above, keep it, - // otherwise drop the string parsed thus far - t._string = ""; - } - t._type = Token::NUMBER; - if (c == '.') { - t._extendedType = Token::FLOATING_POINT_TYPE; - } else { - t._extendedType = Token::INTEGER_TYPE; - } - - if ((c == '0') && (peekInputChar(1) == 'x')) { - // Hex number - t._string += "0x"; - - // skip the 0x - eatInputChar(); - eatInputChar(); - - c = peekInputChar(); - while (isDigit(c) || ((c >= 'A') && (c <= 'F')) || ((c >= 'a') && (c <= 'f'))) { - t._string += c; - c = eatAndPeekInputChar(); - } - - } else { - // Non-hex number - - // Read the part before the decimal. - while (isDigit(c)) { - t._string += c; - c = eatAndPeekInputChar(); - } - - // True if we are reading a floating-point special type - bool isSpecial = false; - - // Read the decimal, if one exists - if (c == '.') { - t._extendedType = Token::FLOATING_POINT_TYPE; - - // The '.' character was a decimal point, not the start of a - // method or range operator - t._string += c; - c = eatAndPeekInputChar(); - - // Floating point specials (msvc format only) - if (options.msvcSpecials && (c == '#')) { - isSpecial = true; - // We are reading a floating point special value - // of the form -1.#IND00, -1.#INF00, or 1.#INF00 - c = eatAndPeekInputChar(); - char test = c; - if (! options.caseSensitive) { - test = toupper(c); - } - if (test != 'I') { - throw BadMSVCSpecial - ( - "Incorrect floating-point special (inf or nan) " - "format.", - t.line(), charNumber); - } - c = eatAndPeekInputChar(); - test = c; - if (! options.caseSensitive) { - test = toupper(c); - } - if (test != 'N') { - throw BadMSVCSpecial - ( - "Incorrect floating-point special (inf or nan) " - "format.", - t.line(), charNumber); - } - t._string += "#IN"; - c = eatAndPeekInputChar(); - test = c; - if (! options.caseSensitive) { - test = toupper(c); - } - if ((test != 'F') && (test != 'D')) { - throw BadMSVCSpecial - ( - "Incorrect floating-point special (inf or nan) " - "format.", - t.line(), charNumber); - } - t._string += c; - for (int j = 0; j < 2; ++j) { - c = eatAndPeekInputChar(); - if (c != '0') { - throw BadMSVCSpecial - ( - "Incorrect floating-point special (inf or" - "nan) format.", - t.line(), charNumber); - } - t._string += (char)c; - } - - } else { - - // Read the part after the decimal - while (isDigit((char)c)) { - t._string += (char)c; - c = eatAndPeekInputChar(); - } - } - } - - if (! isSpecial && ((c == 'e') || (c == 'E'))) { - // Read exponent - t._extendedType = Token::FLOATING_POINT_TYPE; - t._string += c; - - c = eatAndPeekInputChar(); - if ((c == '-') || (c == '+')) { - t._string += c; - c = eatAndPeekInputChar(); - } - - while (isDigit(c)) { - t._string += c; - c = eatAndPeekInputChar(); - } - } - } - return t; - - } else if (isLetter(c) || (c == '_')) { - // Identifier or keyword - // [A-Za-z_][A-Za-z_0-9]* - - t._type = Token::SYMBOL; - t._extendedType = Token::SYMBOL_TYPE; - t._string = ""; - do { - t._string += c; - c = eatAndPeekInputChar(); - } while (isLetter(c) || isDigit(c) || (c == '_')); - - // See if this symbol is actually a boolean - if ((options.trueSymbols.size() > 0) || (options.falseSymbols.size() > 0)) { - std::string str = t._string; - if (! options.caseSensitive) { - str = toUpper(str); - } - if (options.trueSymbols.contains(str)) { - t._type = Token::BOOLEAN; - t._extendedType = Token::BOOLEAN_TYPE; - t._bool = true; - } else if (options.falseSymbols.contains(str)) { - t._type = Token::BOOLEAN; - t._extendedType = Token::BOOLEAN_TYPE; - t._bool = false; - } - } - - return t; - - } else if (c == '\"') { - - // Discard the double-quote. - eatInputChar(); - - // Double quoted string - parseQuotedString('\"', t); - return t; - - } else if (c == '\'') { - - // Discard the single-quote. - eatInputChar(); - - if (options.singleQuotedStrings) { - // Single quoted string - parseQuotedString('\'', t); - } else { - t._string = c; - t._type = Token::SYMBOL; - t._extendedType = Token::SYMBOL_TYPE; - } - return t; - - } // end of special case tokens - - if (c == EOF) { - t._type = Token::END; - t._extendedType = Token::END_TYPE; - t._string = ""; - return t; - } - - // Some unknown token - debugAssertM(false, - format("Unrecognized token type beginning with character '%c' (ASCII %d)", - c, c)); - return t; -} - - -void TextInput::parseQuotedString(unsigned char delimiter, Token& t) { - - t._type = Token::STRING; - - if (delimiter == '\'') { - t._extendedType = Token::SINGLE_QUOTED_TYPE; - } else { - t._extendedType = Token::DOUBLE_QUOTED_TYPE; - } - - while (true) { - // We're definitely going to consume the next input char, so we get - // it right now. This makes the condition handling below a bit easier. - int c = eatInputChar(); - - if (c == EOF) { - // END inside a quoted string. (We finish the string.) - break; - } - - if (options.escapeSequencesInStrings && (c == '\\')) { - // An escaped character. We're definitely going to consume it, - // so we get it (and consume it) now. - - c = eatInputChar(); - - switch (c) { - case 'r': - t._string += '\r'; - break; - case 'n': - t._string += '\n'; - break; - case 't': - t._string += '\t'; - break; - case '0': - t._string += '\0'; - break; - - case '\\': - case '\"': - case '\'': - t._string += (char)c; - break; - - default: - if (((c == options.otherCommentCharacter) && - (options.otherCommentCharacter != '\0')) || - ((c == options.otherCommentCharacter2) && - (options.otherCommentCharacter2 != '\0'))) { - t._string += c; - } - // otherwise, some illegal escape sequence; skip it. - break; - - } // switch - - } else if (c == delimiter) { - // End of the string. Already consumed the character. - break; - } else { - // All other chars, go on to the string. Already consumed the - // character. - t._string += (char)c; - } - - } -} - -bool TextInput::readBoolean() { - Token t(read()); - - if (t._type == Token::BOOLEAN) { - return t.boolean(); - } - - // Push initial token back, and throw an error. We intentionally - // indicate that the wrong type is the type of the initial token. - // Logically, the number started there. - push(t); - throw WrongTokenType(options.sourceFileName, t.line(), t.character(), - Token::BOOLEAN, t._type); -} - -double TextInput::readNumber() { - Token t(read()); - - if (t._type == Token::NUMBER) { - return t.number(); - } - - // Even if signedNumbers is disabled, readNumber attempts to - // read a signed number, so we handle that case here. - if (! options.signedNumbers - && (t._type == Token::SYMBOL) - && ((t._string == "-") - || (t._string == "+"))) { - - Token t2(read()); - - if ((t2._type == Token::NUMBER) - && (t2._character == t._character + 1)) { - - if (t._string == "-") { - return -t2.number(); - } else { - return t2.number(); - } - } - - // push back the second token. - push(t2); - } - - // Push initial token back, and throw an error. We intentionally - // indicate that the wrong type is the type of the initial token. - // Logically, the number started there. - push(t); - throw WrongTokenType(options.sourceFileName, t.line(), t.character(), - Token::NUMBER, t._type); -} - - -Token TextInput::readStringToken() { - Token t(read()); - - if (t._type == Token::STRING) { // fast path - return t; - } - - push(t); - throw WrongTokenType(options.sourceFileName, t.line(), t.character(), - Token::STRING, t._type); -} - -std::string TextInput::readString() { - return readStringToken()._string; -} - -void TextInput::readString(const std::string& s) { - Token t(readStringToken()); - - if (t._string == s) { // fast path - return; - } - - push(t); - throw WrongString(options.sourceFileName, t.line(), t.character(), - s, t._string); -} - - -Token TextInput::readSymbolToken() { - Token t(read()); - - if (t._type == Token::SYMBOL) { // fast path - return t; - } - - push(t); - throw WrongTokenType(options.sourceFileName, t.line(), t.character(), - Token::SYMBOL, t._type); -} - - -std::string TextInput::readSymbol() { - return readSymbolToken()._string; -} - -void TextInput::readSymbol(const std::string& symbol) { - Token t(readSymbolToken()); - - if (t._string == symbol) { // fast path - return; - } - - push(t); - throw WrongSymbol(options.sourceFileName, t.line(), t.character(), - symbol, t._string); -} - - -TextInput::TextInput(const std::string& filename, const Settings& opt) : options(opt) { - init(); - std::string input = readWholeFile(filename); - - if (options.sourceFileName.empty()) { - options.sourceFileName = filename; - } - int n = input.size(); - buffer.resize(n); - System::memcpy(buffer.getCArray(), input.c_str(), n); -} - - -TextInput::TextInput(FS fs, const std::string& str, const Settings& opt) : options(opt) { - (void)fs; - init(); - if (options.sourceFileName.empty()) { - if (str.length() < 14) { - options.sourceFileName = std::string("\"") + str + "\""; - } else { - options.sourceFileName = std::string("\"") + str.substr(0, 10) + "...\""; - } - } - buffer.resize(str.length()); // we don't bother copying trailing NUL. - System::memcpy(buffer.getCArray(), str.c_str(), buffer.size()); -} - - -const std::string& TextInput::filename() const { - return options.sourceFileName; -} - -/////////////////////////////////////////////////////////////////////////////////// - -TextInput::TokenException::TokenException( - const std::string& src, - int ln, - int ch) : sourceFile(src), line(ln), character(ch) { - - message = format("%s(%d) : ", sourceFile.c_str(), line); -} - -/////////////////////////////////////////////////////////////////////////////////// - -static const char* tokenTypeToString(Token::Type t) { - switch (t) { - case Token::SYMBOL: - return "Token::SYMBOL"; - case Token::STRING: - return "Token::STRING"; - case Token::NUMBER: - return "Token::NUMBER"; - case Token::END: - return "Token::END"; - default: - debugAssertM(false, "Fell through switch"); - return "?"; - } -} - -TextInput::WrongTokenType::WrongTokenType( - const std::string& src, - int ln, - int ch, - Token::Type e, - Token::Type a) : - TokenException(src, ln, ch), expected(e), actual(a) { - - message += format("Expected token of type %s, found type %s.", - tokenTypeToString(e), tokenTypeToString(a)); -} - - -TextInput::BadMSVCSpecial::BadMSVCSpecial( - const std::string& src, - int ln, - int ch) : - TokenException(src, ln, ch) { -} - - -TextInput::WrongSymbol::WrongSymbol( - const std::string& src, - int ln, - int ch, - const std::string& e, - const std::string& a) : - TokenException(src, ln, ch), expected(e), actual(a) { - - message += format("Expected symbol '%s', found symbol '%s'.", - e.c_str(), a.c_str()); -} - - -TextInput::WrongString::WrongString( - const std::string& src, - int ln, - int ch, - const std::string& e, - const std::string& a) : - TokenException(src, ln, ch), expected(e), actual(a) { - - message += format("Expected string '%s', found string '%s'.", - e.c_str(), a.c_str()); -} - - -void deserialize(bool& b, TextInput& ti) { - b = ti.readSymbol() == "true"; -} - - -void deserialize(int& b, TextInput& ti) { - b = iRound(ti.readNumber()); -} - - -void deserialize(uint8& b, TextInput& ti) { - b = (uint8)iRound(ti.readNumber()); -} - - -void deserialize(double& b, TextInput& ti) { - b = ti.readNumber(); -} - - -void deserialize(float& b, TextInput& ti) { - b = (float)ti.readNumber(); -} - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif diff --git a/externals/g3dlite/G3D.lib/source/TextOutput.cpp b/externals/g3dlite/G3D.lib/source/TextOutput.cpp deleted file mode 100644 index f7a40d9798b..00000000000 --- a/externals/g3dlite/G3D.lib/source/TextOutput.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/** - @file TextOutput.cpp - - @maintainer Morgan McGuire, morgan@graphics3d.com - @created 2004-06-21 - @edited 2006-08-14 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/TextOutput.h" -#include "G3D/Log.h" -#include "G3D/fileutils.h" - -namespace G3D { - -TextOutput::TextOutput(const TextOutput::Settings& opt) : - startingNewLine(true), - currentColumn(0), - inDQuote(false), - filename(""), - indentLevel(0) -{ - setOptions(opt); -} - - -TextOutput::TextOutput(const std::string& fil, const TextOutput::Settings& opt) : - startingNewLine(true), - currentColumn(0), - inDQuote(false), - filename(fil), - indentLevel(0) -{ - - setOptions(opt); -} - - -void TextOutput::setIndentLevel(int i) { - indentLevel = i; - - // If there were more pops than pushes, don't let that take us below 0 indent. - // Don't ever indent more than the number of columns. - indentSpaces = - iClamp(option.spacesPerIndent * indentLevel, - 0, - option.numColumns - 1); -} - - -void TextOutput::setOptions(const Settings& _opt) { - option = _opt; - - debugAssert(option.numColumns > 1); - - setIndentLevel(indentLevel); - - newline = (option.newlineStyle == Settings::NEWLINE_WINDOWS) ? "\r\n" : "\n"; -} - - -void TextOutput::pushIndent() { - setIndentLevel(indentLevel + 1); -} - - -void TextOutput::popIndent() { - setIndentLevel(indentLevel - 1); -} - - -static std::string escape(const std::string& string) { - std::string result = ""; - - for (std::string::size_type i = 0; i < string.length(); ++i) { - char c = string.at(i); - switch (c) { - case '\0': - result += "\\0"; - break; - - case '\r': - result += "\\r"; - break; - - case '\n': - result += "\\n"; - break; - - case '\t': - result += "\\t"; - break; - - case '\\': - result += "\\\\"; - break; - - default: - result += c; - } - } - - return result; -} - -void TextOutput::writeString(const std::string& string) { - // Convert special characters to escape sequences - this->printf("\"%s\"", escape(string).c_str()); -} - - -void TextOutput::writeBoolean(bool b) { - this->printf("%s ", b ? option.trueSymbol.c_str() : option.falseSymbol.c_str()); -} - -void TextOutput::writeNumber(double n) { - this->printf("%f ", n); -} - - -void TextOutput::writeNumber(int n) { - this->printf("%d ", n); -} - - -void TextOutput::writeSymbol(const std::string& string) { - if (string.size() > 0) { - // TODO: check for legal symbols? - this->printf("%s ", string.c_str()); - } -} - -void TextOutput::writeSymbols( - const std::string& a, - const std::string& b, - const std::string& c, - const std::string& d, - const std::string& e, - const std::string& f) { - - writeSymbol(a); - writeSymbol(b); - writeSymbol(c); - writeSymbol(d); - writeSymbol(e); - writeSymbol(f); -} - - -void TextOutput::printf(const std::string formatString, ...) { - va_list argList; - va_start(argList, formatString); - this->vprintf(formatString.c_str(), argList); - va_end(argList); -} - - -void TextOutput::printf(const char* formatString, ...) { - va_list argList; - va_start(argList, formatString); - this->vprintf(formatString, argList); - va_end(argList); -} - - -void TextOutput::convertNewlines(const std::string& in, std::string& out) { - // TODO: can be significantly optimized in cases where - // single characters are copied in order by walking through - // the array and copying substrings as needed. - - if (option.convertNewlines) { - out = ""; - for (uint32 i = 0; i < in.size(); ++i) { - if (in[i] == '\n') { - // Unix newline - out += newline; - } else if ((in[i] == '\r') && (i + 1 < in.size()) && (in[i + 1] == '\n')) { - // Windows newline - out += newline; - ++i; - } else { - out += in[i]; - } - } - } else { - out = in; - } -} - - -void TextOutput::writeNewline() { - for (uint32 i = 0; i < newline.size(); ++i) { - indentAppend(newline[i]); - } -} - - -void TextOutput::writeNewlines(int numLines) { - for (int i = 0; i < numLines; ++i) { - writeNewline(); - } -} - - -void TextOutput::wordWrapIndentAppend(const std::string& str) { - // TODO: keep track of the last space character we saw so we don't - // have to always search. - - if ((option.wordWrap == Settings::WRAP_NONE) || - (currentColumn + (int)str.size() <= option.numColumns)) { - // No word-wrapping is needed - - // Add one character at a time. - // TODO: optimize for strings without newlines to add multiple - // characters. - for (uint32 i = 0; i < str.size(); ++i) { - indentAppend(str[i]); - } - return; - } - - // Number of columns to wrap against - int cols = option.numColumns - indentSpaces; - - // Copy forward until we exceed the column size, - // and then back up and try to insert newlines as needed. - for (uint32 i = 0; i < str.size(); ++i) { - - indentAppend(str[i]); - if ((str[i] == '\r') && (i + 1 < str.size()) && (str[i + 1] == '\n')) { - // \r\n, we need to hit the \n to enter word wrapping. - ++i; - indentAppend(str[i]); - } - - if (currentColumn >= cols) { - debugAssertM(str[i] != '\n' && str[i] != '\r', - "Should never enter word-wrapping on a newline character"); - - // True when we're allowed to treat a space as a space. - bool unquotedSpace = option.allowWordWrapInsideDoubleQuotes || ! inDQuote; - - // Cases: - // - // 1. Currently in a series of spaces that ends with a newline - // strip all spaces and let the newline - // flow through. - // - // 2. Currently in a series of spaces that does not end with a newline - // strip all spaces and replace them with single newline - // - // 3. Not in a series of spaces - // search backwards for a space, then execute case 2. - - // Index of most recent space - uint32 lastSpace = data.size() - 1; - - // How far back we had to look for a space - uint32 k = 0; - uint32 maxLookBackward = currentColumn - indentSpaces; - - // Search backwards (from current character), looking for a space. - while ((k < maxLookBackward) && - (lastSpace > 0) && - (! ((data[lastSpace] == ' ') && unquotedSpace))) { - --lastSpace; - ++k; - - if ((data[lastSpace] == '\"') && !option.allowWordWrapInsideDoubleQuotes) { - unquotedSpace = ! unquotedSpace; - } - } - - if (k == maxLookBackward) { - // We couldn't find a series of spaces - - if (option.wordWrap == Settings::WRAP_ALWAYS) { - // Strip the last character we wrote, force a newline, - // and replace the last character; - data.pop(); - writeNewline(); - indentAppend(str[i]); - } else { - // Must be Settings::WRAP_WITHOUT_BREAKING - // - // Don't write the newline; we'll come back to - // the word wrap code after writing another character - } - } else { - // We found a series of spaces. If they continue - // to the new string, strip spaces off both. Otherwise - // strip spaces from data only and insert a newline. - - // Find the start of the spaces. firstSpace is the index of the - // first non-space, looking backwards from lastSpace. - uint32 firstSpace = lastSpace; - while ((k < maxLookBackward) && - (firstSpace > 0) && - (data[firstSpace] == ' ')) { - --firstSpace; - ++k; - } - - if (k == maxLookBackward) { - ++firstSpace; - } - - if (lastSpace == (uint32)data.size() - 1) { - // Spaces continued up to the new string - data.resize(firstSpace + 1); - writeNewline(); - - // Delete the spaces from the new string - while ((i < str.size() - 1) && (str[i + 1] == ' ')) { - ++i; - } - } else { - // Spaces were somewhere in the middle of the old string. - // replace them with a newline. - - // Copy over the characters that should be saved - Array temp; - for (uint32 j = lastSpace + 1; j < (uint32)data.size(); ++j) { - char c = data[j]; - - if (c == '\"') { - // Undo changes to quoting (they will be re-done - // when we paste these characters back on). - inDQuote = !inDQuote; - } - temp.append(c); - } - - // Remove those characters and replace with a newline. - data.resize(firstSpace + 1); - writeNewline(); - - // Write them back - for (uint32 j = 0; j < (uint32)temp.size(); ++j) { - indentAppend(temp[j]); - } - - // We are now free to continue adding from the - // new string, which may or may not begin with spaces. - - } // if spaces included new string - } // if hit indent - } // if line exceeded - } // iterate over str -} - - -void TextOutput::indentAppend(char c) { - - if (startingNewLine) { - for (int j = 0; j < indentSpaces; ++j) { - data.push(' '); - } - startingNewLine = false; - currentColumn = indentSpaces; - } - - data.push(c); - - // Don't increment the column count on return character - // newline is taken care of below. - if (c != '\r') { - ++currentColumn; - } - - if (c == '\"') { - inDQuote = ! inDQuote; - } - - startingNewLine = (c == '\n'); - if (startingNewLine) { - currentColumn = 0; - } -} - - -void TextOutput::vprintf(const char* formatString, va_list argPtr) { - std::string str = vformat(formatString, argPtr); - - std::string clean; - convertNewlines(str, clean); - wordWrapIndentAppend(clean); -} - - -void TextOutput::commit(bool flush) { - std::string p = filenamePath(filename); - if (! fileExists(p, false)) { - createDirectory(p); - } - - FILE* f = fopen(filename.c_str(), "wb"); - debugAssert(f); - fwrite(data.getCArray(), 1, data.size(), f); - if (flush) { - fflush(f); - } - fclose(f); -} - - -void TextOutput::commitString(std::string& out) { - // Null terminate - data.push('\0'); - out = data.getCArray(); - data.pop(); -} - - -std::string TextOutput::commitString() { - std::string str; - commitString(str); - return str; -} - - - -///////////////////////////////////////////////////////////////////// - -void serialize(const float& b, TextOutput& to) { - to.writeNumber(b); -} - - -void serialize(const bool& b, TextOutput& to) { - to.writeSymbol(b ? "true" : "false"); -} - - -void serialize(const int& b, TextOutput& to) { - to.writeNumber(b); -} - - -void serialize(const uint8& b, TextOutput& to) { - to.writeNumber(b); -} - - -void serialize(const double& b, TextOutput& to) { - to.writeNumber(b); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/ThreadSet.cpp b/externals/g3dlite/G3D.lib/source/ThreadSet.cpp deleted file mode 100644 index 59060892247..00000000000 --- a/externals/g3dlite/G3D.lib/source/ThreadSet.cpp +++ /dev/null @@ -1,147 +0,0 @@ -#include "G3D/ThreadSet.h" - -namespace G3D { - -int ThreadSet::size() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - int s = m_thread.size(); - me->m_lock.unlock(); - return s; -} - - -int ThreadSet::numStarted() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - int count = 0; - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->started()) { - ++count; - } - } - me->m_lock.unlock(); - return count; -} - - -void ThreadSet::start() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (! m_thread[i]->started()) { - m_thread[i]->start(); - } - } - me->m_lock.unlock(); -} - - -void ThreadSet::terminate() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->started()) { - m_thread[i]->terminate(); - } - } - me->m_lock.unlock(); -} - - -void ThreadSet::waitForCompletion() const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->started()) { - m_thread[i]->waitForCompletion(); - } - } - me->m_lock.unlock(); -} - - -int ThreadSet::removeCompleted() { - m_lock.lock(); - for (int i = 0; i < m_thread.size(); ++i) { - if (m_thread[i]->completed()) { - m_thread.fastRemove(i); - --i; - } - } - - int s = m_thread.size(); - m_lock.unlock(); - return s; -} - - -void ThreadSet::clear() { - m_lock.lock(); - m_thread.clear(); - m_lock.unlock(); -} - - -int ThreadSet::insert(const ThreadRef& t) { - m_lock.lock(); - bool found = false; - for (int i = 0; i < m_thread.size() && ! found; ++i) { - found = (m_thread[i] == t); - } - if (! found) { - m_thread.append(t); - } - int s = m_thread.size(); - m_lock.unlock(); - return s; -} - - -bool ThreadSet::remove(const ThreadRef& t) { - m_lock.lock(); - bool found = false; - for (int i = 0; i < m_thread.size() && ! found; ++i) { - found = (m_thread[i] == t); - if (found) { - m_thread.fastRemove(i); - } - } - m_lock.unlock(); - return found; -} - - -bool ThreadSet::contains(const ThreadRef& t) const { - ThreadSet* me = const_cast(this); - me->m_lock.lock(); - bool found = false; - for (int i = 0; i < m_thread.size() && ! found; ++i) { - found = (m_thread[i] == t); - } - me->m_lock.unlock(); - return found; -} - - -ThreadSet::Iterator ThreadSet::begin() { - return m_thread.begin(); -} - - -ThreadSet::Iterator ThreadSet::end() { - return m_thread.end(); -} - - -ThreadSet::ConstIterator ThreadSet::begin() const { - return m_thread.begin(); -} - - -ThreadSet::ConstIterator ThreadSet::end() const { - return m_thread.end(); -} - - -} // namespace G3D diff --git a/externals/g3dlite/G3D.lib/source/Triangle.cpp b/externals/g3dlite/G3D.lib/source/Triangle.cpp deleted file mode 100644 index ad264b1f72a..00000000000 --- a/externals/g3dlite/G3D.lib/source/Triangle.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/** - @file Triangle.cpp - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-04-06 - @edited 2006-01-20 - - Copyright 2000-2006, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/Triangle.h" -#include "G3D/Plane.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/debugAssert.h" -#include "G3D/AABox.h" - -namespace G3D { - - -void Triangle::init(const Vector3& v0, const Vector3& v1, const Vector3& v2) { - - _plane = Plane(v0, v1, v2); - _vertex[0] = v0; - _vertex[1] = v1; - _vertex[2] = v2; - - static int next[] = {1,2,0}; - - for (int i = 0; i < 3; ++i) { - const Vector3& e = _vertex[next[i]] - _vertex[i]; - edgeMagnitude[i] = e.magnitude(); - - if (edgeMagnitude[i] == 0) { - edgeDirection[i] = Vector3::zero(); - } else { - edgeDirection[i] = e / (float)edgeMagnitude[i]; - } - } - - _edge01 = _vertex[1] - _vertex[0]; - _edge02 = _vertex[2] - _vertex[0]; - - _primaryAxis = _plane.normal().primaryAxis(); - _area = 0.5f * edgeDirection[0].cross(edgeDirection[2]).magnitude() * (edgeMagnitude[0] * edgeMagnitude[2]); - //0.5f * (_vertex[1] - _vertex[0]).cross(_vertex[2] - _vertex[0]).dot(_plane.normal()); -} - - -Triangle::Triangle() { - init(Vector3::zero(), Vector3::zero(), Vector3::zero()); -} - - -Triangle::Triangle(const Vector3& v0, const Vector3& v1, const Vector3& v2) { - init(v0, v1, v2); -} - - -Triangle::~Triangle() { -} - - -Triangle::Triangle(class BinaryInput& b) { - deserialize(b); -} - - -void Triangle::serialize(class BinaryOutput& b) { - _vertex[0].serialize(b); - _vertex[1].serialize(b); - _vertex[2].serialize(b); -} - - -void Triangle::deserialize(class BinaryInput& b) { - _vertex[0].deserialize(b); - _vertex[1].deserialize(b); - _vertex[2].deserialize(b); - init(_vertex[0], _vertex[1], _vertex[2]); -} - - -float Triangle::area() const { - return _area; -} - - -const Vector3& Triangle::normal() const { - return _plane.normal(); -} - - -const Plane& Triangle::plane() const { - return _plane; -} - - -Vector3 Triangle::center() const { - return (_vertex[0] + _vertex[1] + _vertex[2]) / 3.0; -} - -Vector3 Triangle::randomPoint() const { - // Choose a random point in the parallelogram - - float s = uniformRandom(); - float t = uniformRandom(); - - if (t > 1.0f - s) { - // Outside the triangle; reflect about the - // diagonal of the parallelogram - t = 1.0f - t; - s = 1.0f - s; - } - - return _edge01 * s + _edge02 * t + _vertex[0]; -} - - -void Triangle::getBounds(AABox& out) const { - Vector3 lo = _vertex[0]; - Vector3 hi = lo; - - for (int i = 1; i < 3; ++i) { - lo = lo.min(_vertex[i]); - hi = hi.max(_vertex[i]); - } - - out = AABox(lo, hi); -} - -} // G3D diff --git a/externals/g3dlite/G3D.lib/source/UprightFrame.cpp b/externals/g3dlite/G3D.lib/source/UprightFrame.cpp deleted file mode 100644 index 78b2c0bb0bb..00000000000 --- a/externals/g3dlite/G3D.lib/source/UprightFrame.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/** - @file UprightFrame.cpp - Box class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-05-02 - @edited 2007-05-05 -*/ - -#include "G3D/UprightFrame.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -UprightFrame::UprightFrame(const CoordinateFrame& cframe) { - Vector3 look = cframe.lookVector(); - - yaw = G3D::pi() + atan2(look.x, look.z); - pitch = asin(look.y); - - translation = cframe.translation; -} - - -CoordinateFrame UprightFrame::toCoordinateFrame() const { - CoordinateFrame cframe; - - Matrix3 P(Matrix3::fromAxisAngle(Vector3::unitX(), pitch)); - Matrix3 Y(Matrix3::fromAxisAngle(Vector3::unitY(), yaw)); - - cframe.rotation = Y * P; - cframe.translation = translation; - - return cframe; -} - - -UprightFrame UprightFrame::operator+(const UprightFrame& other) const { - return UprightFrame(translation + other.translation, pitch + other.pitch, yaw + other.yaw); -} - - -UprightFrame UprightFrame::operator*(const float k) const { - return UprightFrame(translation * k, pitch * k, yaw * k); -} - - -void UprightFrame::unwrapYaw(UprightFrame* a, int N) { - // Use the first point to establish the wrapping convention - for (int i = 1; i < N; ++i) { - const float prev = a[i - 1].yaw; - float& cur = a[i].yaw; - - // No two angles should be more than pi (i.e., 180-degrees) apart. - if (abs(cur - prev) > G3D::pi()) { - // These angles must have wrapped at zero, causing them - // to be interpolated the long way. - - // Find canonical [0, 2pi] versions of these numbers - float p = wrap(prev, twoPi()); - float c = wrap(cur, twoPi()); - - // Find the difference -pi < diff < pi between the current and previous values - float diff = c - p; - if (diff < -G3D::pi()) { - diff += twoPi(); - } else if (diff > G3D::pi()) { - diff -= twoPi(); - } - - // Offset the current from the previous by the difference - // between them. - cur = prev + diff; - } - } -} - - -void UprightFrame::serialize(class BinaryOutput& b) const { - translation.serialize(b); - b.writeFloat32(pitch); - b.writeFloat32(yaw); -} - - -void UprightFrame::deserialize(class BinaryInput& b) { - translation.deserialize(b); - pitch = b.readFloat32(); - yaw = b.readFloat32(); -} - - -void UprightSpline::serialize(class BinaryOutput& b) const { - b.writeBool8(cyclic); - - b.writeInt32(control.size()); - for (int i = 0; i < control.size(); ++i) { - control[i].serialize(b); - } - b.writeInt32(time.size()); - for (int i = 0; i < time.size(); ++i) { - b.writeFloat32(time[i]); - } -} - - -void UprightSpline::deserialize(class BinaryInput& b) { - cyclic = b.readBool8(); - - control.resize(b.readInt32()); - for (int i = 0; i < control.size(); ++i) { - control[i].deserialize(b); - } - - if (b.hasMore()) { - time.resize(b.readInt32()); - for (int i = 0; i < time.size(); ++i) { - time[i] = b.readFloat32(); - } - debugAssert(time.size() == control.size()); - } else { - // Import legacy path - time.resize(control.size()); - for (int i = 0; i < time.size(); ++i) { - time[i] = i; - } - } -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Vector2.cpp b/externals/g3dlite/G3D.lib/source/Vector2.cpp deleted file mode 100644 index 6b7f96a764e..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector2.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/** - @file Vector2.cpp - - 2D vector class, used for texture coordinates primarily. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Portions based on Dave Eberly'x Magic Software Library - at http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-01-16 - */ - -#include "G3D/platform.h" -#include -#include "G3D/Vector2.h" -#include "G3D/g3dmath.h" -#include "G3D/format.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" - -namespace G3D { - -const Vector2& Vector2::zero() { - static Vector2 v(0, 0); - return v; -} - -const Vector2& Vector2::unitX() { - static Vector2 v(1, 0); - return v; -} - -const Vector2& Vector2::unitY() { - static Vector2 v(0, 1); - return v; -} - -const Vector2& Vector2::inf() { - static Vector2 v((float)G3D::inf(), (float)G3D::inf()); - return v; -} - - -const Vector2& Vector2::nan() { - static Vector2 v((float)G3D::nan(), (float)G3D::nan()); - return v; -} - - -const Vector2& Vector2::minFinite() { - static Vector2 v(-FLT_MAX, -FLT_MAX); - return v; -} - - -const Vector2& Vector2::maxFinite() { - static Vector2 v(FLT_MAX, FLT_MAX); - return v; -} - - -size_t Vector2::hashCode() const { - unsigned int xhash = (*(int*)(void*)(&x)); - unsigned int yhash = (*(int*)(void*)(&y)); - - return xhash + (yhash * 37); -} - - -Vector2::Vector2(BinaryInput& b) { - deserialize(b); -} - - -void Vector2::deserialize(BinaryInput& b) { - x = b.readFloat32(); - y = b.readFloat32(); -} - - -void Vector2::serialize(BinaryOutput& b) const { - b.writeFloat32(x); - b.writeFloat32(y); -} - - -void Vector2::deserialize(TextInput& t) { - t.readSymbol("("); - x = (float)t.readNumber(); - t.readSymbol(","); - y = (float)t.readNumber(); - t.readSymbol(")"); -} - - -void Vector2::serialize(TextOutput& t) const { - t.writeSymbol("("); - t.writeNumber(x); - t.writeSymbol(","); - t.writeNumber(y); - t.writeSymbol(")"); -} - -//---------------------------------------------------------------------------- - -Vector2 Vector2::random() { - Vector2 result; - - do { - result = Vector2(uniformRandom(-1, 1), uniformRandom(-1, 1)); - - } while (result.squaredLength() >= 1.0f); - - result.unitize(); - - return result; -} - -//---------------------------------------------------------------------------- -Vector2 Vector2::operator/ (float fScalar) const { - Vector2 kQuot; - - if ( fScalar != 0.0f ) { - float fInvScalar = 1.0f / fScalar; - kQuot.x = fInvScalar * x; - kQuot.y = fInvScalar * y; - return kQuot; - } else { - return Vector2::inf(); - } -} - -//---------------------------------------------------------------------------- -Vector2& Vector2::operator/= (float fScalar) { - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - x *= fInvScalar; - y *= fInvScalar; - } else { - x = (float)G3D::inf(); - y = (float)G3D::inf(); - } - - return *this; -} - -//---------------------------------------------------------------------------- -float Vector2::unitize (float fTolerance) { - float fLength = length(); - - if (fLength > fTolerance) { - float fInvLength = 1.0f / fLength; - x *= fInvLength; - y *= fInvLength; - } else { - fLength = 0.0; - } - - return fLength; -} - -//---------------------------------------------------------------------------- - -std::string Vector2::toString() const { - return G3D::format("(%g, %g)", x, y); -} - -// 2-char swizzles - -Vector2 Vector2::xx() const { return Vector2 (x, x); } -Vector2 Vector2::yx() const { return Vector2 (y, x); } -Vector2 Vector2::xy() const { return Vector2 (x, y); } -Vector2 Vector2::yy() const { return Vector2 (y, y); } - -// 3-char swizzles - -Vector3 Vector2::xxx() const { return Vector3 (x, x, x); } -Vector3 Vector2::yxx() const { return Vector3 (y, x, x); } -Vector3 Vector2::xyx() const { return Vector3 (x, y, x); } -Vector3 Vector2::yyx() const { return Vector3 (y, y, x); } -Vector3 Vector2::xxy() const { return Vector3 (x, x, y); } -Vector3 Vector2::yxy() const { return Vector3 (y, x, y); } -Vector3 Vector2::xyy() const { return Vector3 (x, y, y); } -Vector3 Vector2::yyy() const { return Vector3 (y, y, y); } - -// 4-char swizzles - -Vector4 Vector2::xxxx() const { return Vector4 (x, x, x, x); } -Vector4 Vector2::yxxx() const { return Vector4 (y, x, x, x); } -Vector4 Vector2::xyxx() const { return Vector4 (x, y, x, x); } -Vector4 Vector2::yyxx() const { return Vector4 (y, y, x, x); } -Vector4 Vector2::xxyx() const { return Vector4 (x, x, y, x); } -Vector4 Vector2::yxyx() const { return Vector4 (y, x, y, x); } -Vector4 Vector2::xyyx() const { return Vector4 (x, y, y, x); } -Vector4 Vector2::yyyx() const { return Vector4 (y, y, y, x); } -Vector4 Vector2::xxxy() const { return Vector4 (x, x, x, y); } -Vector4 Vector2::yxxy() const { return Vector4 (y, x, x, y); } -Vector4 Vector2::xyxy() const { return Vector4 (x, y, x, y); } -Vector4 Vector2::yyxy() const { return Vector4 (y, y, x, y); } -Vector4 Vector2::xxyy() const { return Vector4 (x, x, y, y); } -Vector4 Vector2::yxyy() const { return Vector4 (y, x, y, y); } -Vector4 Vector2::xyyy() const { return Vector4 (x, y, y, y); } -Vector4 Vector2::yyyy() const { return Vector4 (y, y, y, y); } - - - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/Vector2int16.cpp b/externals/g3dlite/G3D.lib/source/Vector2int16.cpp deleted file mode 100644 index 04efee2b4b7..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector2int16.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/** - @file Vector2int16.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2003-08-09 - @edited 2006-01-29 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector2int16.h" -#include "G3D/Vector2.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" - -namespace G3D { - -Vector2int16::Vector2int16(const class Vector2& v) { - x = (int16)iFloor(v.x + 0.5); - y = (int16)iFloor(v.y + 0.5); -} - - -Vector2int16::Vector2int16(class BinaryInput& bi) { - deserialize(bi); -} - - -void Vector2int16::serialize(class BinaryOutput& bo) const { - bo.writeInt16(x); - bo.writeInt16(y); -} - - -void Vector2int16::deserialize(class BinaryInput& bi) { - x = bi.readInt16(); - y = bi.readInt16(); -} - - -Vector2int16 Vector2int16::clamp(const Vector2int16& lo, const Vector2int16& hi) { - return Vector2int16(iClamp(x, lo.x, hi.x), iClamp(y, lo.y, hi.y)); -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/Vector3.cpp b/externals/g3dlite/G3D.lib/source/Vector3.cpp deleted file mode 100644 index bc52640d297..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector3.cpp +++ /dev/null @@ -1,493 +0,0 @@ -/** - @file Vector3.cpp - - 3D vector class - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @cite Portions based on Dave Eberly's Magic Software Library at http://www.magic-software.com - - @created 2001-06-02 - @edited 2006-01-30 - */ - -#include -#include -#include "G3D/Vector3.h" -#include "G3D/g3dmath.h" -#include "G3D/stringutils.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/TextInput.h" -#include "G3D/TextOutput.h" -#include "G3D/Vector3int16.h" -#include "G3D/Matrix3.h" -#include "G3D/Vector2.h" -#include "G3D/Vector4int8.h" - -namespace G3D { - -Vector3 Vector3::dummy; - - -Vector3::Vector3(const Vector4int8& v) : x(v.x / 127.0f), y(v.y / 127.0f), z(v.z / 127.0f) {} - -Vector3::Vector3(const class Vector2& v, float _z) : x(v.x), y(v.y), z(_z) { -} - - -Vector3::Axis Vector3::primaryAxis() const { - - Axis a = X_AXIS; - - double nx = abs(x); - double ny = abs(y); - double nz = abs(z); - - if (nx > ny) { - if (nx > nz) { - a = X_AXIS; - } else { - a = Z_AXIS; - } - } else { - if (ny > nz) { - a = Y_AXIS; - } else { - a = Z_AXIS; - } - } - - return a; -} - - -size_t Vector3::hashCode() const { - unsigned int xhash = (*(int*)(void*)(&x)); - unsigned int yhash = (*(int*)(void*)(&y)); - unsigned int zhash = (*(int*)(void*)(&z)); - - return xhash + (yhash * 37) + (zhash * 101); -} - -std::ostream& operator<<(std::ostream& os, const Vector3& v) { - return os << v.toString(); -} - - -//---------------------------------------------------------------------------- - -double frand() { - return rand() / (double) RAND_MAX; -} - -Vector3::Vector3(TextInput& t) { - deserialize(t); -} - -Vector3::Vector3(BinaryInput& b) { - deserialize(b); -} - - -Vector3::Vector3(const class Vector3int16& v) { - x = v.x; - y = v.y; - z = v.z; -} - - -void Vector3::deserialize(BinaryInput& b) { - x = b.readFloat32(); - y = b.readFloat32(); - z = b.readFloat32(); -} - - -void Vector3::deserialize(TextInput& t) { - t.readSymbol("("); - x = (float)t.readNumber(); - t.readSymbol(","); - y = (float)t.readNumber(); - t.readSymbol(","); - z = (float)t.readNumber(); - t.readSymbol(")"); -} - - -void Vector3::serialize(TextOutput& t) const { - t.writeSymbol("("); - t.writeNumber(x); - t.writeSymbol(","); - t.writeNumber(y); - t.writeSymbol(","); - t.writeNumber(z); - t.writeSymbol(")"); -} - - -void Vector3::serialize(BinaryOutput& b) const { - b.writeFloat32(x); - b.writeFloat32(y); - b.writeFloat32(z); -} - - -Vector3 Vector3::random() { - Vector3 result; - - do { - result = Vector3(uniformRandom(-1.0, 1.0), - uniformRandom(-1.0, 1.0), - uniformRandom(-1.0, 1.0)); - } while (result.squaredMagnitude() >= 1.0f); - - result.unitize(); - - return result; -} - -//---------------------------------------------------------------------------- -Vector3 Vector3::operator/ (float fScalar) const { - Vector3 kQuot; - - if ( fScalar != 0.0 ) { - float fInvScalar = 1.0f / fScalar; - kQuot.x = fInvScalar * x; - kQuot.y = fInvScalar * y; - kQuot.z = fInvScalar * z; - return kQuot; - } else { - return Vector3::inf(); - } -} - -//---------------------------------------------------------------------------- -Vector3& Vector3::operator/= (float fScalar) { - if (fScalar != 0.0) { - float fInvScalar = 1.0f / fScalar; - x *= fInvScalar; - y *= fInvScalar; - z *= fInvScalar; - } else { - x = (float)G3D::inf(); - y = (float)G3D::inf(); - z = (float)G3D::inf(); - } - - return *this; -} - -//---------------------------------------------------------------------------- -float Vector3::unitize (float fTolerance) { - float fMagnitude = magnitude(); - - if (fMagnitude > fTolerance) { - float fInvMagnitude = 1.0f / fMagnitude; - x *= fInvMagnitude; - y *= fInvMagnitude; - z *= fInvMagnitude; - } else { - fMagnitude = 0.0f; - } - - return fMagnitude; -} - -//---------------------------------------------------------------------------- - -Vector3 Vector3::reflectAbout(const Vector3& normal) const { - - Vector3 out; - - Vector3 N = normal.direction(); - - // 2 * normal.dot(this) * normal - this - return N * 2 * this->dot(N) - *this; -} - -//---------------------------------------------------------------------------- -Vector3 Vector3::cosRandom(const Vector3& normal) { - double e1 = G3D::uniformRandom(0, 1); - double e2 = G3D::uniformRandom(0, 1); - - // Angle from normal - double theta = acos(sqrt(e1)); - - // Angle about normal - double phi = 2 * pi() * e2; - - // Make a coordinate system - Vector3 U = normal.direction(); - Vector3 V = Vector3::unitX(); - - if (abs(U.dot(V)) > .9) { - V = Vector3::unitY(); - } - - Vector3 W = U.cross(V).direction(); - V = W.cross(U); - - // Convert to rectangular form - return cos(theta) * U + sin(theta) * (cos(phi) * V + sin(phi) * W); -} -//---------------------------------------------------------------------------- - -Vector3 Vector3::hemiRandom(const Vector3& normal) { - Vector3 V = Vector3::random(); - - if (V.dot(normal) < 0) { - return -V; - } else { - return V; - } -} - -//---------------------------------------------------------------------------- - -Vector3 Vector3::reflectionDirection(const Vector3& normal) const { - return -reflectAbout(normal).direction(); -} - -//---------------------------------------------------------------------------- - -Vector3 Vector3::refractionDirection( - const Vector3& normal, - float iInside, - float iOutside) const { - - // From pg. 24 of Henrik Wann Jensen. Realistic Image Synthesis - // Using Photon Mapping. AK Peters. ISBN: 1568811470. July 2001. - - // Invert the directions from Wann Jensen's formulation - // and normalize the vectors. - const Vector3 W = -direction(); - Vector3 N = normal.direction(); - - float h1 = iOutside; - float h2 = iInside; - - if (normal.dot(*this) > 0.0f) { - h1 = iInside; - h2 = iOutside; - N = -N; - } - - const float hRatio = h1 / h2; - const float WdotN = W.dot(N); - - float det = 1.0f - (float)square(hRatio) * (1.0f - (float)square(WdotN)); - - if (det < 0) { - // Total internal reflection - return Vector3::zero(); - } else { - return -hRatio * (W - WdotN * N) - N * sqrt(det); - } -} - -//---------------------------------------------------------------------------- -void Vector3::orthonormalize (Vector3 akVector[3]) { - // If the input vectors are v0, v1, and v2, then the Gram-Schmidt - // orthonormalization produces vectors u0, u1, and u2 as follows, - // - // u0 = v0/|v0| - // u1 = (v1-(u0*v1)u0)/|v1-(u0*v1)u0| - // u2 = (v2-(u0*v2)u0-(u1*v2)u1)/|v2-(u0*v2)u0-(u1*v2)u1| - // - // where |A| indicates length of vector A and A*B indicates dot - // product of vectors A and B. - - // compute u0 - akVector[0].unitize(); - - // compute u1 - float fDot0 = akVector[0].dot(akVector[1]); - akVector[1] -= akVector[0] * fDot0; - akVector[1].unitize(); - - // compute u2 - float fDot1 = akVector[1].dot(akVector[2]); - fDot0 = akVector[0].dot(akVector[2]); - akVector[2] -= akVector[0] * fDot0 + akVector[1] * fDot1; - akVector[2].unitize(); -} - -//---------------------------------------------------------------------------- -void Vector3::generateOrthonormalBasis (Vector3& rkU, Vector3& rkV, - Vector3& rkW, bool bUnitLengthW) { - if ( !bUnitLengthW ) - rkW.unitize(); - - if ( G3D::abs(rkW.x) >= G3D::abs(rkW.y) - && G3D::abs(rkW.x) >= G3D::abs(rkW.z) ) { - rkU.x = -rkW.y; - rkU.y = + rkW.x; - rkU.z = 0.0; - } else { - rkU.x = 0.0; - rkU.y = + rkW.z; - rkU.z = -rkW.y; - } - - rkU.unitize(); - rkV = rkW.cross(rkU); -} - -//---------------------------------------------------------------------------- - -std::string Vector3::toString() const { - return G3D::format("(%g, %g, %g)", x, y, z); -} - - -//---------------------------------------------------------------------------- - -Matrix3 Vector3::cross() const { - return Matrix3( 0, -z, y, - z, 0, -x, - -y, x, 0); -} - - -void serialize(const Vector3::Axis& a, class BinaryOutput& bo) { - bo.writeUInt8((uint8)a); -} - -void deserialize(Vector3::Axis& a, class BinaryInput& bi) { - a = (Vector3::Axis)bi.readUInt8(); -} - -//---------------------------------------------------------------------------- -// 2-char swizzles - -Vector2 Vector3::xx() const { return Vector2 (x, x); } -Vector2 Vector3::yx() const { return Vector2 (y, x); } -Vector2 Vector3::zx() const { return Vector2 (z, x); } -Vector2 Vector3::xy() const { return Vector2 (x, y); } -Vector2 Vector3::yy() const { return Vector2 (y, y); } -Vector2 Vector3::zy() const { return Vector2 (z, y); } -Vector2 Vector3::xz() const { return Vector2 (x, z); } -Vector2 Vector3::yz() const { return Vector2 (y, z); } -Vector2 Vector3::zz() const { return Vector2 (z, z); } - -// 3-char swizzles - -Vector3 Vector3::xxx() const { return Vector3 (x, x, x); } -Vector3 Vector3::yxx() const { return Vector3 (y, x, x); } -Vector3 Vector3::zxx() const { return Vector3 (z, x, x); } -Vector3 Vector3::xyx() const { return Vector3 (x, y, x); } -Vector3 Vector3::yyx() const { return Vector3 (y, y, x); } -Vector3 Vector3::zyx() const { return Vector3 (z, y, x); } -Vector3 Vector3::xzx() const { return Vector3 (x, z, x); } -Vector3 Vector3::yzx() const { return Vector3 (y, z, x); } -Vector3 Vector3::zzx() const { return Vector3 (z, z, x); } -Vector3 Vector3::xxy() const { return Vector3 (x, x, y); } -Vector3 Vector3::yxy() const { return Vector3 (y, x, y); } -Vector3 Vector3::zxy() const { return Vector3 (z, x, y); } -Vector3 Vector3::xyy() const { return Vector3 (x, y, y); } -Vector3 Vector3::yyy() const { return Vector3 (y, y, y); } -Vector3 Vector3::zyy() const { return Vector3 (z, y, y); } -Vector3 Vector3::xzy() const { return Vector3 (x, z, y); } -Vector3 Vector3::yzy() const { return Vector3 (y, z, y); } -Vector3 Vector3::zzy() const { return Vector3 (z, z, y); } -Vector3 Vector3::xxz() const { return Vector3 (x, x, z); } -Vector3 Vector3::yxz() const { return Vector3 (y, x, z); } -Vector3 Vector3::zxz() const { return Vector3 (z, x, z); } -Vector3 Vector3::xyz() const { return Vector3 (x, y, z); } -Vector3 Vector3::yyz() const { return Vector3 (y, y, z); } -Vector3 Vector3::zyz() const { return Vector3 (z, y, z); } -Vector3 Vector3::xzz() const { return Vector3 (x, z, z); } -Vector3 Vector3::yzz() const { return Vector3 (y, z, z); } -Vector3 Vector3::zzz() const { return Vector3 (z, z, z); } - -// 4-char swizzles - -Vector4 Vector3::xxxx() const { return Vector4 (x, x, x, x); } -Vector4 Vector3::yxxx() const { return Vector4 (y, x, x, x); } -Vector4 Vector3::zxxx() const { return Vector4 (z, x, x, x); } -Vector4 Vector3::xyxx() const { return Vector4 (x, y, x, x); } -Vector4 Vector3::yyxx() const { return Vector4 (y, y, x, x); } -Vector4 Vector3::zyxx() const { return Vector4 (z, y, x, x); } -Vector4 Vector3::xzxx() const { return Vector4 (x, z, x, x); } -Vector4 Vector3::yzxx() const { return Vector4 (y, z, x, x); } -Vector4 Vector3::zzxx() const { return Vector4 (z, z, x, x); } -Vector4 Vector3::xxyx() const { return Vector4 (x, x, y, x); } -Vector4 Vector3::yxyx() const { return Vector4 (y, x, y, x); } -Vector4 Vector3::zxyx() const { return Vector4 (z, x, y, x); } -Vector4 Vector3::xyyx() const { return Vector4 (x, y, y, x); } -Vector4 Vector3::yyyx() const { return Vector4 (y, y, y, x); } -Vector4 Vector3::zyyx() const { return Vector4 (z, y, y, x); } -Vector4 Vector3::xzyx() const { return Vector4 (x, z, y, x); } -Vector4 Vector3::yzyx() const { return Vector4 (y, z, y, x); } -Vector4 Vector3::zzyx() const { return Vector4 (z, z, y, x); } -Vector4 Vector3::xxzx() const { return Vector4 (x, x, z, x); } -Vector4 Vector3::yxzx() const { return Vector4 (y, x, z, x); } -Vector4 Vector3::zxzx() const { return Vector4 (z, x, z, x); } -Vector4 Vector3::xyzx() const { return Vector4 (x, y, z, x); } -Vector4 Vector3::yyzx() const { return Vector4 (y, y, z, x); } -Vector4 Vector3::zyzx() const { return Vector4 (z, y, z, x); } -Vector4 Vector3::xzzx() const { return Vector4 (x, z, z, x); } -Vector4 Vector3::yzzx() const { return Vector4 (y, z, z, x); } -Vector4 Vector3::zzzx() const { return Vector4 (z, z, z, x); } -Vector4 Vector3::xxxy() const { return Vector4 (x, x, x, y); } -Vector4 Vector3::yxxy() const { return Vector4 (y, x, x, y); } -Vector4 Vector3::zxxy() const { return Vector4 (z, x, x, y); } -Vector4 Vector3::xyxy() const { return Vector4 (x, y, x, y); } -Vector4 Vector3::yyxy() const { return Vector4 (y, y, x, y); } -Vector4 Vector3::zyxy() const { return Vector4 (z, y, x, y); } -Vector4 Vector3::xzxy() const { return Vector4 (x, z, x, y); } -Vector4 Vector3::yzxy() const { return Vector4 (y, z, x, y); } -Vector4 Vector3::zzxy() const { return Vector4 (z, z, x, y); } -Vector4 Vector3::xxyy() const { return Vector4 (x, x, y, y); } -Vector4 Vector3::yxyy() const { return Vector4 (y, x, y, y); } -Vector4 Vector3::zxyy() const { return Vector4 (z, x, y, y); } -Vector4 Vector3::xyyy() const { return Vector4 (x, y, y, y); } -Vector4 Vector3::yyyy() const { return Vector4 (y, y, y, y); } -Vector4 Vector3::zyyy() const { return Vector4 (z, y, y, y); } -Vector4 Vector3::xzyy() const { return Vector4 (x, z, y, y); } -Vector4 Vector3::yzyy() const { return Vector4 (y, z, y, y); } -Vector4 Vector3::zzyy() const { return Vector4 (z, z, y, y); } -Vector4 Vector3::xxzy() const { return Vector4 (x, x, z, y); } -Vector4 Vector3::yxzy() const { return Vector4 (y, x, z, y); } -Vector4 Vector3::zxzy() const { return Vector4 (z, x, z, y); } -Vector4 Vector3::xyzy() const { return Vector4 (x, y, z, y); } -Vector4 Vector3::yyzy() const { return Vector4 (y, y, z, y); } -Vector4 Vector3::zyzy() const { return Vector4 (z, y, z, y); } -Vector4 Vector3::xzzy() const { return Vector4 (x, z, z, y); } -Vector4 Vector3::yzzy() const { return Vector4 (y, z, z, y); } -Vector4 Vector3::zzzy() const { return Vector4 (z, z, z, y); } -Vector4 Vector3::xxxz() const { return Vector4 (x, x, x, z); } -Vector4 Vector3::yxxz() const { return Vector4 (y, x, x, z); } -Vector4 Vector3::zxxz() const { return Vector4 (z, x, x, z); } -Vector4 Vector3::xyxz() const { return Vector4 (x, y, x, z); } -Vector4 Vector3::yyxz() const { return Vector4 (y, y, x, z); } -Vector4 Vector3::zyxz() const { return Vector4 (z, y, x, z); } -Vector4 Vector3::xzxz() const { return Vector4 (x, z, x, z); } -Vector4 Vector3::yzxz() const { return Vector4 (y, z, x, z); } -Vector4 Vector3::zzxz() const { return Vector4 (z, z, x, z); } -Vector4 Vector3::xxyz() const { return Vector4 (x, x, y, z); } -Vector4 Vector3::yxyz() const { return Vector4 (y, x, y, z); } -Vector4 Vector3::zxyz() const { return Vector4 (z, x, y, z); } -Vector4 Vector3::xyyz() const { return Vector4 (x, y, y, z); } -Vector4 Vector3::yyyz() const { return Vector4 (y, y, y, z); } -Vector4 Vector3::zyyz() const { return Vector4 (z, y, y, z); } -Vector4 Vector3::xzyz() const { return Vector4 (x, z, y, z); } -Vector4 Vector3::yzyz() const { return Vector4 (y, z, y, z); } -Vector4 Vector3::zzyz() const { return Vector4 (z, z, y, z); } -Vector4 Vector3::xxzz() const { return Vector4 (x, x, z, z); } -Vector4 Vector3::yxzz() const { return Vector4 (y, x, z, z); } -Vector4 Vector3::zxzz() const { return Vector4 (z, x, z, z); } -Vector4 Vector3::xyzz() const { return Vector4 (x, y, z, z); } -Vector4 Vector3::yyzz() const { return Vector4 (y, y, z, z); } -Vector4 Vector3::zyzz() const { return Vector4 (z, y, z, z); } -Vector4 Vector3::xzzz() const { return Vector4 (x, z, z, z); } -Vector4 Vector3::yzzz() const { return Vector4 (y, z, z, z); } -Vector4 Vector3::zzzz() const { return Vector4 (z, z, z, z); } - - - - - - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/Vector3int16.cpp b/externals/g3dlite/G3D.lib/source/Vector3int16.cpp deleted file mode 100644 index 8d8bb00bbef..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector3int16.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/** - @file Vector3int16.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2003-04-07 - @edited 2006-01-17 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3int16.h" -#include "G3D/Vector3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/format.h" - -namespace G3D { - -Vector3int16::Vector3int16(const class Vector3& v) { - x = (int16)iFloor(v.x + 0.5); - y = (int16)iFloor(v.y + 0.5); - z = (int16)iFloor(v.z + 0.5); -} - - -Vector3int16::Vector3int16(class BinaryInput& bi) { - deserialize(bi); -} - - -void Vector3int16::serialize(class BinaryOutput& bo) const { - bo.writeInt16(x); - bo.writeInt16(y); - bo.writeInt16(z); -} - - -void Vector3int16::deserialize(class BinaryInput& bi) { - x = bi.readInt16(); - y = bi.readInt16(); - z = bi.readInt16(); -} - -std::string Vector3int16::toString() const { - return G3D::format("(%d, %d, %d)", x, y, z); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Vector3int32.cpp b/externals/g3dlite/G3D.lib/source/Vector3int32.cpp deleted file mode 100644 index 1328ba1aba5..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector3int32.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** - @file Vector3int32.cpp - - @author Morgan McGuire, matrix@graphics3d.com - - @created 2008-07-01 - @edited 2008-07-01 - */ - -#include "G3D/platform.h" -#include "G3D/g3dmath.h" -#include "G3D/Vector3int32.h" -#include "G3D/Vector3int16.h" -#include "G3D/Vector3.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/format.h" - -namespace G3D { - -Vector3int32::Vector3int32(const class Vector3& v) { - x = (int32)iFloor(v.x + 0.5); - y = (int32)iFloor(v.y + 0.5); - z = (int32)iFloor(v.z + 0.5); -} - - -Vector3int32::Vector3int32(const class Vector3int16& v) { - x = v.x; - y = v.y; - z = v.z; -} - - -Vector3int32::Vector3int32(class BinaryInput& bi) { - deserialize(bi); -} - - -void Vector3int32::serialize(class BinaryOutput& bo) const { - bo.writeInt32(x); - bo.writeInt32(y); - bo.writeInt32(z); -} - - -void Vector3int32::deserialize(class BinaryInput& bi) { - x = bi.readInt32(); - y = bi.readInt32(); - z = bi.readInt32(); -} - -std::string Vector3int32::toString() const { - return G3D::format("(%d, %d, %d)", x, y, z); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/Vector4.cpp b/externals/g3dlite/G3D.lib/source/Vector4.cpp deleted file mode 100644 index f562f2d6877..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector4.cpp +++ /dev/null @@ -1,475 +0,0 @@ -/** - @file Vector4.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2001-07-09 - @edited 2007-02-29 - */ - -#include -#include -#include "G3D/Vector4.h" -#include "G3D/Color4.h" -#include "G3D/g3dmath.h" -#include "G3D/stringutils.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include "G3D/Vector4int8.h" -#include "G3D/Matrix4.h" - -namespace G3D { - -Vector4::Vector4(const Vector4int8& v) : x(v.x / 127.0f), y(v.y / 127.0f), z(v.z / 127.0f), w(v.w / 127.0f) { -} - -size_t Vector4::hashCode() const { - unsigned int xhash = (*(int*)(void*)(&x)); - unsigned int yhash = (*(int*)(void*)(&y)); - unsigned int zhash = (*(int*)(void*)(&z)); - unsigned int whash = (*(int*)(void*)(&w)); - - return xhash + (yhash * 37) + (zhash * 101) + (whash * 241); -} - - -Vector4::Vector4(const class Color4& c) { - x = c.r; - y = c.g; - z = c.b; - w = c.a; -} - - -Vector4::Vector4(const Vector2& v1, const Vector2& v2) { - x = v1.x; - y = v1.y; - z = v2.x; - w = v2.y; -} - - -Vector4::Vector4(const Vector2& v1, float fz, float fw) { - x = v1.x; - y = v1.y; - z = fz; - w = fw; -} - -Vector4::Vector4(BinaryInput& b) { - deserialize(b); -} - - -void Vector4::deserialize(BinaryInput& b) { - x = b.readFloat32(); - y = b.readFloat32(); - z = b.readFloat32(); - w = b.readFloat32(); -} - - -void Vector4::serialize(BinaryOutput& b) const { - b.writeFloat32(x); - b.writeFloat32(y); - b.writeFloat32(z); - b.writeFloat32(w); -} - -//---------------------------------------------------------------------------- - -Vector4 Vector4::operator*(const Matrix4& M) const { - Vector4 result; - for (int i = 0; i < 4; ++i) { - result[i] = 0.0f; - for (int j = 0; j < 4; ++j) { - result[i] += (*this)[j] * M[j][i]; - } - } - return result; -} - - -Vector4 Vector4::operator/ (float fScalar) const { - Vector4 kQuot; - - if ( fScalar != 0.0 ) { - float fInvScalar = 1.0f / fScalar; - kQuot.x = fInvScalar * x; - kQuot.y = fInvScalar * y; - kQuot.z = fInvScalar * z; - kQuot.w = fInvScalar * w; - return kQuot; - } else { - return Vector4::inf(); - } -} - -//---------------------------------------------------------------------------- -Vector4& Vector4::operator/= (float fScalar) { - if (fScalar != 0.0f) { - float fInvScalar = 1.0f / fScalar; - x *= fInvScalar; - y *= fInvScalar; - z *= fInvScalar; - w *= fInvScalar; - } else { - *this = Vector4::inf(); - } - - return *this; -} - - -//---------------------------------------------------------------------------- - -std::string Vector4::toString() const { - return G3D::format("(%g, %g, %g, %g)", x, y, z, w); -} -// 2-char swizzles - -Vector2 Vector4::xx() const { return Vector2 (x, x); } -Vector2 Vector4::yx() const { return Vector2 (y, x); } -Vector2 Vector4::zx() const { return Vector2 (z, x); } -Vector2 Vector4::wx() const { return Vector2 (w, x); } -Vector2 Vector4::xy() const { return Vector2 (x, y); } -Vector2 Vector4::yy() const { return Vector2 (y, y); } -Vector2 Vector4::zy() const { return Vector2 (z, y); } -Vector2 Vector4::wy() const { return Vector2 (w, y); } -Vector2 Vector4::xz() const { return Vector2 (x, z); } -Vector2 Vector4::yz() const { return Vector2 (y, z); } -Vector2 Vector4::zz() const { return Vector2 (z, z); } -Vector2 Vector4::wz() const { return Vector2 (w, z); } -Vector2 Vector4::xw() const { return Vector2 (x, w); } -Vector2 Vector4::yw() const { return Vector2 (y, w); } -Vector2 Vector4::zw() const { return Vector2 (z, w); } -Vector2 Vector4::ww() const { return Vector2 (w, w); } - -// 3-char swizzles - -Vector3 Vector4::xxx() const { return Vector3 (x, x, x); } -Vector3 Vector4::yxx() const { return Vector3 (y, x, x); } -Vector3 Vector4::zxx() const { return Vector3 (z, x, x); } -Vector3 Vector4::wxx() const { return Vector3 (w, x, x); } -Vector3 Vector4::xyx() const { return Vector3 (x, y, x); } -Vector3 Vector4::yyx() const { return Vector3 (y, y, x); } -Vector3 Vector4::zyx() const { return Vector3 (z, y, x); } -Vector3 Vector4::wyx() const { return Vector3 (w, y, x); } -Vector3 Vector4::xzx() const { return Vector3 (x, z, x); } -Vector3 Vector4::yzx() const { return Vector3 (y, z, x); } -Vector3 Vector4::zzx() const { return Vector3 (z, z, x); } -Vector3 Vector4::wzx() const { return Vector3 (w, z, x); } -Vector3 Vector4::xwx() const { return Vector3 (x, w, x); } -Vector3 Vector4::ywx() const { return Vector3 (y, w, x); } -Vector3 Vector4::zwx() const { return Vector3 (z, w, x); } -Vector3 Vector4::wwx() const { return Vector3 (w, w, x); } -Vector3 Vector4::xxy() const { return Vector3 (x, x, y); } -Vector3 Vector4::yxy() const { return Vector3 (y, x, y); } -Vector3 Vector4::zxy() const { return Vector3 (z, x, y); } -Vector3 Vector4::wxy() const { return Vector3 (w, x, y); } -Vector3 Vector4::xyy() const { return Vector3 (x, y, y); } -Vector3 Vector4::yyy() const { return Vector3 (y, y, y); } -Vector3 Vector4::zyy() const { return Vector3 (z, y, y); } -Vector3 Vector4::wyy() const { return Vector3 (w, y, y); } -Vector3 Vector4::xzy() const { return Vector3 (x, z, y); } -Vector3 Vector4::yzy() const { return Vector3 (y, z, y); } -Vector3 Vector4::zzy() const { return Vector3 (z, z, y); } -Vector3 Vector4::wzy() const { return Vector3 (w, z, y); } -Vector3 Vector4::xwy() const { return Vector3 (x, w, y); } -Vector3 Vector4::ywy() const { return Vector3 (y, w, y); } -Vector3 Vector4::zwy() const { return Vector3 (z, w, y); } -Vector3 Vector4::wwy() const { return Vector3 (w, w, y); } -Vector3 Vector4::xxz() const { return Vector3 (x, x, z); } -Vector3 Vector4::yxz() const { return Vector3 (y, x, z); } -Vector3 Vector4::zxz() const { return Vector3 (z, x, z); } -Vector3 Vector4::wxz() const { return Vector3 (w, x, z); } -Vector3 Vector4::xyz() const { return Vector3 (x, y, z); } -Vector3 Vector4::yyz() const { return Vector3 (y, y, z); } -Vector3 Vector4::zyz() const { return Vector3 (z, y, z); } -Vector3 Vector4::wyz() const { return Vector3 (w, y, z); } -Vector3 Vector4::xzz() const { return Vector3 (x, z, z); } -Vector3 Vector4::yzz() const { return Vector3 (y, z, z); } -Vector3 Vector4::zzz() const { return Vector3 (z, z, z); } -Vector3 Vector4::wzz() const { return Vector3 (w, z, z); } -Vector3 Vector4::xwz() const { return Vector3 (x, w, z); } -Vector3 Vector4::ywz() const { return Vector3 (y, w, z); } -Vector3 Vector4::zwz() const { return Vector3 (z, w, z); } -Vector3 Vector4::wwz() const { return Vector3 (w, w, z); } -Vector3 Vector4::xxw() const { return Vector3 (x, x, w); } -Vector3 Vector4::yxw() const { return Vector3 (y, x, w); } -Vector3 Vector4::zxw() const { return Vector3 (z, x, w); } -Vector3 Vector4::wxw() const { return Vector3 (w, x, w); } -Vector3 Vector4::xyw() const { return Vector3 (x, y, w); } -Vector3 Vector4::yyw() const { return Vector3 (y, y, w); } -Vector3 Vector4::zyw() const { return Vector3 (z, y, w); } -Vector3 Vector4::wyw() const { return Vector3 (w, y, w); } -Vector3 Vector4::xzw() const { return Vector3 (x, z, w); } -Vector3 Vector4::yzw() const { return Vector3 (y, z, w); } -Vector3 Vector4::zzw() const { return Vector3 (z, z, w); } -Vector3 Vector4::wzw() const { return Vector3 (w, z, w); } -Vector3 Vector4::xww() const { return Vector3 (x, w, w); } -Vector3 Vector4::yww() const { return Vector3 (y, w, w); } -Vector3 Vector4::zww() const { return Vector3 (z, w, w); } -Vector3 Vector4::www() const { return Vector3 (w, w, w); } - -// 4-char swizzles - -Vector4 Vector4::xxxx() const { return Vector4 (x, x, x, x); } -Vector4 Vector4::yxxx() const { return Vector4 (y, x, x, x); } -Vector4 Vector4::zxxx() const { return Vector4 (z, x, x, x); } -Vector4 Vector4::wxxx() const { return Vector4 (w, x, x, x); } -Vector4 Vector4::xyxx() const { return Vector4 (x, y, x, x); } -Vector4 Vector4::yyxx() const { return Vector4 (y, y, x, x); } -Vector4 Vector4::zyxx() const { return Vector4 (z, y, x, x); } -Vector4 Vector4::wyxx() const { return Vector4 (w, y, x, x); } -Vector4 Vector4::xzxx() const { return Vector4 (x, z, x, x); } -Vector4 Vector4::yzxx() const { return Vector4 (y, z, x, x); } -Vector4 Vector4::zzxx() const { return Vector4 (z, z, x, x); } -Vector4 Vector4::wzxx() const { return Vector4 (w, z, x, x); } -Vector4 Vector4::xwxx() const { return Vector4 (x, w, x, x); } -Vector4 Vector4::ywxx() const { return Vector4 (y, w, x, x); } -Vector4 Vector4::zwxx() const { return Vector4 (z, w, x, x); } -Vector4 Vector4::wwxx() const { return Vector4 (w, w, x, x); } -Vector4 Vector4::xxyx() const { return Vector4 (x, x, y, x); } -Vector4 Vector4::yxyx() const { return Vector4 (y, x, y, x); } -Vector4 Vector4::zxyx() const { return Vector4 (z, x, y, x); } -Vector4 Vector4::wxyx() const { return Vector4 (w, x, y, x); } -Vector4 Vector4::xyyx() const { return Vector4 (x, y, y, x); } -Vector4 Vector4::yyyx() const { return Vector4 (y, y, y, x); } -Vector4 Vector4::zyyx() const { return Vector4 (z, y, y, x); } -Vector4 Vector4::wyyx() const { return Vector4 (w, y, y, x); } -Vector4 Vector4::xzyx() const { return Vector4 (x, z, y, x); } -Vector4 Vector4::yzyx() const { return Vector4 (y, z, y, x); } -Vector4 Vector4::zzyx() const { return Vector4 (z, z, y, x); } -Vector4 Vector4::wzyx() const { return Vector4 (w, z, y, x); } -Vector4 Vector4::xwyx() const { return Vector4 (x, w, y, x); } -Vector4 Vector4::ywyx() const { return Vector4 (y, w, y, x); } -Vector4 Vector4::zwyx() const { return Vector4 (z, w, y, x); } -Vector4 Vector4::wwyx() const { return Vector4 (w, w, y, x); } -Vector4 Vector4::xxzx() const { return Vector4 (x, x, z, x); } -Vector4 Vector4::yxzx() const { return Vector4 (y, x, z, x); } -Vector4 Vector4::zxzx() const { return Vector4 (z, x, z, x); } -Vector4 Vector4::wxzx() const { return Vector4 (w, x, z, x); } -Vector4 Vector4::xyzx() const { return Vector4 (x, y, z, x); } -Vector4 Vector4::yyzx() const { return Vector4 (y, y, z, x); } -Vector4 Vector4::zyzx() const { return Vector4 (z, y, z, x); } -Vector4 Vector4::wyzx() const { return Vector4 (w, y, z, x); } -Vector4 Vector4::xzzx() const { return Vector4 (x, z, z, x); } -Vector4 Vector4::yzzx() const { return Vector4 (y, z, z, x); } -Vector4 Vector4::zzzx() const { return Vector4 (z, z, z, x); } -Vector4 Vector4::wzzx() const { return Vector4 (w, z, z, x); } -Vector4 Vector4::xwzx() const { return Vector4 (x, w, z, x); } -Vector4 Vector4::ywzx() const { return Vector4 (y, w, z, x); } -Vector4 Vector4::zwzx() const { return Vector4 (z, w, z, x); } -Vector4 Vector4::wwzx() const { return Vector4 (w, w, z, x); } -Vector4 Vector4::xxwx() const { return Vector4 (x, x, w, x); } -Vector4 Vector4::yxwx() const { return Vector4 (y, x, w, x); } -Vector4 Vector4::zxwx() const { return Vector4 (z, x, w, x); } -Vector4 Vector4::wxwx() const { return Vector4 (w, x, w, x); } -Vector4 Vector4::xywx() const { return Vector4 (x, y, w, x); } -Vector4 Vector4::yywx() const { return Vector4 (y, y, w, x); } -Vector4 Vector4::zywx() const { return Vector4 (z, y, w, x); } -Vector4 Vector4::wywx() const { return Vector4 (w, y, w, x); } -Vector4 Vector4::xzwx() const { return Vector4 (x, z, w, x); } -Vector4 Vector4::yzwx() const { return Vector4 (y, z, w, x); } -Vector4 Vector4::zzwx() const { return Vector4 (z, z, w, x); } -Vector4 Vector4::wzwx() const { return Vector4 (w, z, w, x); } -Vector4 Vector4::xwwx() const { return Vector4 (x, w, w, x); } -Vector4 Vector4::ywwx() const { return Vector4 (y, w, w, x); } -Vector4 Vector4::zwwx() const { return Vector4 (z, w, w, x); } -Vector4 Vector4::wwwx() const { return Vector4 (w, w, w, x); } -Vector4 Vector4::xxxy() const { return Vector4 (x, x, x, y); } -Vector4 Vector4::yxxy() const { return Vector4 (y, x, x, y); } -Vector4 Vector4::zxxy() const { return Vector4 (z, x, x, y); } -Vector4 Vector4::wxxy() const { return Vector4 (w, x, x, y); } -Vector4 Vector4::xyxy() const { return Vector4 (x, y, x, y); } -Vector4 Vector4::yyxy() const { return Vector4 (y, y, x, y); } -Vector4 Vector4::zyxy() const { return Vector4 (z, y, x, y); } -Vector4 Vector4::wyxy() const { return Vector4 (w, y, x, y); } -Vector4 Vector4::xzxy() const { return Vector4 (x, z, x, y); } -Vector4 Vector4::yzxy() const { return Vector4 (y, z, x, y); } -Vector4 Vector4::zzxy() const { return Vector4 (z, z, x, y); } -Vector4 Vector4::wzxy() const { return Vector4 (w, z, x, y); } -Vector4 Vector4::xwxy() const { return Vector4 (x, w, x, y); } -Vector4 Vector4::ywxy() const { return Vector4 (y, w, x, y); } -Vector4 Vector4::zwxy() const { return Vector4 (z, w, x, y); } -Vector4 Vector4::wwxy() const { return Vector4 (w, w, x, y); } -Vector4 Vector4::xxyy() const { return Vector4 (x, x, y, y); } -Vector4 Vector4::yxyy() const { return Vector4 (y, x, y, y); } -Vector4 Vector4::zxyy() const { return Vector4 (z, x, y, y); } -Vector4 Vector4::wxyy() const { return Vector4 (w, x, y, y); } -Vector4 Vector4::xyyy() const { return Vector4 (x, y, y, y); } -Vector4 Vector4::yyyy() const { return Vector4 (y, y, y, y); } -Vector4 Vector4::zyyy() const { return Vector4 (z, y, y, y); } -Vector4 Vector4::wyyy() const { return Vector4 (w, y, y, y); } -Vector4 Vector4::xzyy() const { return Vector4 (x, z, y, y); } -Vector4 Vector4::yzyy() const { return Vector4 (y, z, y, y); } -Vector4 Vector4::zzyy() const { return Vector4 (z, z, y, y); } -Vector4 Vector4::wzyy() const { return Vector4 (w, z, y, y); } -Vector4 Vector4::xwyy() const { return Vector4 (x, w, y, y); } -Vector4 Vector4::ywyy() const { return Vector4 (y, w, y, y); } -Vector4 Vector4::zwyy() const { return Vector4 (z, w, y, y); } -Vector4 Vector4::wwyy() const { return Vector4 (w, w, y, y); } -Vector4 Vector4::xxzy() const { return Vector4 (x, x, z, y); } -Vector4 Vector4::yxzy() const { return Vector4 (y, x, z, y); } -Vector4 Vector4::zxzy() const { return Vector4 (z, x, z, y); } -Vector4 Vector4::wxzy() const { return Vector4 (w, x, z, y); } -Vector4 Vector4::xyzy() const { return Vector4 (x, y, z, y); } -Vector4 Vector4::yyzy() const { return Vector4 (y, y, z, y); } -Vector4 Vector4::zyzy() const { return Vector4 (z, y, z, y); } -Vector4 Vector4::wyzy() const { return Vector4 (w, y, z, y); } -Vector4 Vector4::xzzy() const { return Vector4 (x, z, z, y); } -Vector4 Vector4::yzzy() const { return Vector4 (y, z, z, y); } -Vector4 Vector4::zzzy() const { return Vector4 (z, z, z, y); } -Vector4 Vector4::wzzy() const { return Vector4 (w, z, z, y); } -Vector4 Vector4::xwzy() const { return Vector4 (x, w, z, y); } -Vector4 Vector4::ywzy() const { return Vector4 (y, w, z, y); } -Vector4 Vector4::zwzy() const { return Vector4 (z, w, z, y); } -Vector4 Vector4::wwzy() const { return Vector4 (w, w, z, y); } -Vector4 Vector4::xxwy() const { return Vector4 (x, x, w, y); } -Vector4 Vector4::yxwy() const { return Vector4 (y, x, w, y); } -Vector4 Vector4::zxwy() const { return Vector4 (z, x, w, y); } -Vector4 Vector4::wxwy() const { return Vector4 (w, x, w, y); } -Vector4 Vector4::xywy() const { return Vector4 (x, y, w, y); } -Vector4 Vector4::yywy() const { return Vector4 (y, y, w, y); } -Vector4 Vector4::zywy() const { return Vector4 (z, y, w, y); } -Vector4 Vector4::wywy() const { return Vector4 (w, y, w, y); } -Vector4 Vector4::xzwy() const { return Vector4 (x, z, w, y); } -Vector4 Vector4::yzwy() const { return Vector4 (y, z, w, y); } -Vector4 Vector4::zzwy() const { return Vector4 (z, z, w, y); } -Vector4 Vector4::wzwy() const { return Vector4 (w, z, w, y); } -Vector4 Vector4::xwwy() const { return Vector4 (x, w, w, y); } -Vector4 Vector4::ywwy() const { return Vector4 (y, w, w, y); } -Vector4 Vector4::zwwy() const { return Vector4 (z, w, w, y); } -Vector4 Vector4::wwwy() const { return Vector4 (w, w, w, y); } -Vector4 Vector4::xxxz() const { return Vector4 (x, x, x, z); } -Vector4 Vector4::yxxz() const { return Vector4 (y, x, x, z); } -Vector4 Vector4::zxxz() const { return Vector4 (z, x, x, z); } -Vector4 Vector4::wxxz() const { return Vector4 (w, x, x, z); } -Vector4 Vector4::xyxz() const { return Vector4 (x, y, x, z); } -Vector4 Vector4::yyxz() const { return Vector4 (y, y, x, z); } -Vector4 Vector4::zyxz() const { return Vector4 (z, y, x, z); } -Vector4 Vector4::wyxz() const { return Vector4 (w, y, x, z); } -Vector4 Vector4::xzxz() const { return Vector4 (x, z, x, z); } -Vector4 Vector4::yzxz() const { return Vector4 (y, z, x, z); } -Vector4 Vector4::zzxz() const { return Vector4 (z, z, x, z); } -Vector4 Vector4::wzxz() const { return Vector4 (w, z, x, z); } -Vector4 Vector4::xwxz() const { return Vector4 (x, w, x, z); } -Vector4 Vector4::ywxz() const { return Vector4 (y, w, x, z); } -Vector4 Vector4::zwxz() const { return Vector4 (z, w, x, z); } -Vector4 Vector4::wwxz() const { return Vector4 (w, w, x, z); } -Vector4 Vector4::xxyz() const { return Vector4 (x, x, y, z); } -Vector4 Vector4::yxyz() const { return Vector4 (y, x, y, z); } -Vector4 Vector4::zxyz() const { return Vector4 (z, x, y, z); } -Vector4 Vector4::wxyz() const { return Vector4 (w, x, y, z); } -Vector4 Vector4::xyyz() const { return Vector4 (x, y, y, z); } -Vector4 Vector4::yyyz() const { return Vector4 (y, y, y, z); } -Vector4 Vector4::zyyz() const { return Vector4 (z, y, y, z); } -Vector4 Vector4::wyyz() const { return Vector4 (w, y, y, z); } -Vector4 Vector4::xzyz() const { return Vector4 (x, z, y, z); } -Vector4 Vector4::yzyz() const { return Vector4 (y, z, y, z); } -Vector4 Vector4::zzyz() const { return Vector4 (z, z, y, z); } -Vector4 Vector4::wzyz() const { return Vector4 (w, z, y, z); } -Vector4 Vector4::xwyz() const { return Vector4 (x, w, y, z); } -Vector4 Vector4::ywyz() const { return Vector4 (y, w, y, z); } -Vector4 Vector4::zwyz() const { return Vector4 (z, w, y, z); } -Vector4 Vector4::wwyz() const { return Vector4 (w, w, y, z); } -Vector4 Vector4::xxzz() const { return Vector4 (x, x, z, z); } -Vector4 Vector4::yxzz() const { return Vector4 (y, x, z, z); } -Vector4 Vector4::zxzz() const { return Vector4 (z, x, z, z); } -Vector4 Vector4::wxzz() const { return Vector4 (w, x, z, z); } -Vector4 Vector4::xyzz() const { return Vector4 (x, y, z, z); } -Vector4 Vector4::yyzz() const { return Vector4 (y, y, z, z); } -Vector4 Vector4::zyzz() const { return Vector4 (z, y, z, z); } -Vector4 Vector4::wyzz() const { return Vector4 (w, y, z, z); } -Vector4 Vector4::xzzz() const { return Vector4 (x, z, z, z); } -Vector4 Vector4::yzzz() const { return Vector4 (y, z, z, z); } -Vector4 Vector4::zzzz() const { return Vector4 (z, z, z, z); } -Vector4 Vector4::wzzz() const { return Vector4 (w, z, z, z); } -Vector4 Vector4::xwzz() const { return Vector4 (x, w, z, z); } -Vector4 Vector4::ywzz() const { return Vector4 (y, w, z, z); } -Vector4 Vector4::zwzz() const { return Vector4 (z, w, z, z); } -Vector4 Vector4::wwzz() const { return Vector4 (w, w, z, z); } -Vector4 Vector4::xxwz() const { return Vector4 (x, x, w, z); } -Vector4 Vector4::yxwz() const { return Vector4 (y, x, w, z); } -Vector4 Vector4::zxwz() const { return Vector4 (z, x, w, z); } -Vector4 Vector4::wxwz() const { return Vector4 (w, x, w, z); } -Vector4 Vector4::xywz() const { return Vector4 (x, y, w, z); } -Vector4 Vector4::yywz() const { return Vector4 (y, y, w, z); } -Vector4 Vector4::zywz() const { return Vector4 (z, y, w, z); } -Vector4 Vector4::wywz() const { return Vector4 (w, y, w, z); } -Vector4 Vector4::xzwz() const { return Vector4 (x, z, w, z); } -Vector4 Vector4::yzwz() const { return Vector4 (y, z, w, z); } -Vector4 Vector4::zzwz() const { return Vector4 (z, z, w, z); } -Vector4 Vector4::wzwz() const { return Vector4 (w, z, w, z); } -Vector4 Vector4::xwwz() const { return Vector4 (x, w, w, z); } -Vector4 Vector4::ywwz() const { return Vector4 (y, w, w, z); } -Vector4 Vector4::zwwz() const { return Vector4 (z, w, w, z); } -Vector4 Vector4::wwwz() const { return Vector4 (w, w, w, z); } -Vector4 Vector4::xxxw() const { return Vector4 (x, x, x, w); } -Vector4 Vector4::yxxw() const { return Vector4 (y, x, x, w); } -Vector4 Vector4::zxxw() const { return Vector4 (z, x, x, w); } -Vector4 Vector4::wxxw() const { return Vector4 (w, x, x, w); } -Vector4 Vector4::xyxw() const { return Vector4 (x, y, x, w); } -Vector4 Vector4::yyxw() const { return Vector4 (y, y, x, w); } -Vector4 Vector4::zyxw() const { return Vector4 (z, y, x, w); } -Vector4 Vector4::wyxw() const { return Vector4 (w, y, x, w); } -Vector4 Vector4::xzxw() const { return Vector4 (x, z, x, w); } -Vector4 Vector4::yzxw() const { return Vector4 (y, z, x, w); } -Vector4 Vector4::zzxw() const { return Vector4 (z, z, x, w); } -Vector4 Vector4::wzxw() const { return Vector4 (w, z, x, w); } -Vector4 Vector4::xwxw() const { return Vector4 (x, w, x, w); } -Vector4 Vector4::ywxw() const { return Vector4 (y, w, x, w); } -Vector4 Vector4::zwxw() const { return Vector4 (z, w, x, w); } -Vector4 Vector4::wwxw() const { return Vector4 (w, w, x, w); } -Vector4 Vector4::xxyw() const { return Vector4 (x, x, y, w); } -Vector4 Vector4::yxyw() const { return Vector4 (y, x, y, w); } -Vector4 Vector4::zxyw() const { return Vector4 (z, x, y, w); } -Vector4 Vector4::wxyw() const { return Vector4 (w, x, y, w); } -Vector4 Vector4::xyyw() const { return Vector4 (x, y, y, w); } -Vector4 Vector4::yyyw() const { return Vector4 (y, y, y, w); } -Vector4 Vector4::zyyw() const { return Vector4 (z, y, y, w); } -Vector4 Vector4::wyyw() const { return Vector4 (w, y, y, w); } -Vector4 Vector4::xzyw() const { return Vector4 (x, z, y, w); } -Vector4 Vector4::yzyw() const { return Vector4 (y, z, y, w); } -Vector4 Vector4::zzyw() const { return Vector4 (z, z, y, w); } -Vector4 Vector4::wzyw() const { return Vector4 (w, z, y, w); } -Vector4 Vector4::xwyw() const { return Vector4 (x, w, y, w); } -Vector4 Vector4::ywyw() const { return Vector4 (y, w, y, w); } -Vector4 Vector4::zwyw() const { return Vector4 (z, w, y, w); } -Vector4 Vector4::wwyw() const { return Vector4 (w, w, y, w); } -Vector4 Vector4::xxzw() const { return Vector4 (x, x, z, w); } -Vector4 Vector4::yxzw() const { return Vector4 (y, x, z, w); } -Vector4 Vector4::zxzw() const { return Vector4 (z, x, z, w); } -Vector4 Vector4::wxzw() const { return Vector4 (w, x, z, w); } -Vector4 Vector4::xyzw() const { return Vector4 (x, y, z, w); } -Vector4 Vector4::yyzw() const { return Vector4 (y, y, z, w); } -Vector4 Vector4::zyzw() const { return Vector4 (z, y, z, w); } -Vector4 Vector4::wyzw() const { return Vector4 (w, y, z, w); } -Vector4 Vector4::xzzw() const { return Vector4 (x, z, z, w); } -Vector4 Vector4::yzzw() const { return Vector4 (y, z, z, w); } -Vector4 Vector4::zzzw() const { return Vector4 (z, z, z, w); } -Vector4 Vector4::wzzw() const { return Vector4 (w, z, z, w); } -Vector4 Vector4::xwzw() const { return Vector4 (x, w, z, w); } -Vector4 Vector4::ywzw() const { return Vector4 (y, w, z, w); } -Vector4 Vector4::zwzw() const { return Vector4 (z, w, z, w); } -Vector4 Vector4::wwzw() const { return Vector4 (w, w, z, w); } -Vector4 Vector4::xxww() const { return Vector4 (x, x, w, w); } -Vector4 Vector4::yxww() const { return Vector4 (y, x, w, w); } -Vector4 Vector4::zxww() const { return Vector4 (z, x, w, w); } -Vector4 Vector4::wxww() const { return Vector4 (w, x, w, w); } -Vector4 Vector4::xyww() const { return Vector4 (x, y, w, w); } -Vector4 Vector4::yyww() const { return Vector4 (y, y, w, w); } -Vector4 Vector4::zyww() const { return Vector4 (z, y, w, w); } -Vector4 Vector4::wyww() const { return Vector4 (w, y, w, w); } -Vector4 Vector4::xzww() const { return Vector4 (x, z, w, w); } -Vector4 Vector4::yzww() const { return Vector4 (y, z, w, w); } -Vector4 Vector4::zzww() const { return Vector4 (z, z, w, w); } -Vector4 Vector4::wzww() const { return Vector4 (w, z, w, w); } -Vector4 Vector4::xwww() const { return Vector4 (x, w, w, w); } -Vector4 Vector4::ywww() const { return Vector4 (y, w, w, w); } -Vector4 Vector4::zwww() const { return Vector4 (z, w, w, w); } -Vector4 Vector4::wwww() const { return Vector4 (w, w, w, w); } - - -}; // namespace diff --git a/externals/g3dlite/G3D.lib/source/Vector4int8.cpp b/externals/g3dlite/G3D.lib/source/Vector4int8.cpp deleted file mode 100644 index 29ca0d678fc..00000000000 --- a/externals/g3dlite/G3D.lib/source/Vector4int8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - @file Vector4int8.cpp - - Homogeneous vector class. - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2007-02-09 - @edited 2007-02-09 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ - -#include "G3D/platform.h" -#include "G3D/Vector4int8.h" -#include "G3D/Vector3.h" -#include "G3D/Vector4.h" -#include "G3D/BinaryInput.h" -#include "G3D/BinaryOutput.h" -#include - -namespace G3D { - -Vector4int8::Vector4int8(const Vector4& source) { - x = iClamp(iRound(source.x), -128, 127); - y = iClamp(iRound(source.y), -128, 127); - z = iClamp(iRound(source.z), -128, 127); - w = iClamp(iRound(source.w), -128, 127); -} - -Vector4int8::Vector4int8(const Vector3& source, int8 w) : w(w) { - x = iClamp(iRound(source.x), -128, 127); - y = iClamp(iRound(source.y), -128, 127); - z = iClamp(iRound(source.z), -128, 127); -} - -Vector4int8::Vector4int8(class BinaryInput& b) { - deserialize(b); -} - -void Vector4int8::serialize(class BinaryOutput& b) const { - // Intentionally write individual bytes to avoid endian issues - b.writeInt8(x); - b.writeInt8(y); - b.writeInt8(z); - b.writeInt8(w); -} - -void Vector4int8::deserialize(class BinaryInput& b) { - x = b.readInt8(); - y = b.readInt8(); - z = b.readInt8(); - w = b.readInt8(); -} - -} // namespace G3D - diff --git a/externals/g3dlite/G3D.lib/source/WinMain.cpp b/externals/g3dlite/G3D.lib/source/WinMain.cpp deleted file mode 100644 index 94653de4d43..00000000000 --- a/externals/g3dlite/G3D.lib/source/WinMain.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - Dervied from SDL_main.c, which was placed in the public domain by Sam Lantinga 4/13/98 - - The WinMain function -- calls your program's main() function -*/ - -#include "G3D/platform.h" - -#ifdef G3D_WIN32 - -#include -#include -#include - -#ifdef main -# ifndef _WIN32_WCE_EMULATION -# undef main -# endif /* _WIN32_WCE_EMULATION */ -#endif /* main */ - -#if defined(_WIN32_WCE) && _WIN32_WCE < 300 -/* seems to be undefined in Win CE although in online help */ -#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) -#endif /* _WIN32_WCE < 300 */ - -// Turn off the G3D for loop scoping for C++ -#ifdef for -# undef for -#endif - -extern int main(int argc, const char** argv); - -/* Parse a command line buffer into arguments */ -static int ParseCommandLine(char *cmdline, char **argv) { - char *bufp; - int argc; - - argc = 0; - for (bufp = cmdline; *bufp;) { - /* Skip leading whitespace */ - while (isspace(*bufp)) { - ++bufp; - } - /* Skip over argument */ - if (*bufp == '"') { - ++bufp; - if (*bufp) { - if (argv) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while (*bufp && (*bufp != '"')) { - ++bufp; - } - } else { - if (*bufp) { - if (argv) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while (*bufp && !isspace(*bufp)) { - ++bufp; - } - } - if (*bufp) { - if (argv) { - *bufp = '\0'; - } - ++bufp; - } - } - if (argv) { - argv[argc] = NULL; - } - return (argc); -} - -/* Show an error message */ -static void ShowError(const char *title, const char *message) { -/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ -#ifdef USE_MESSAGEBOX - MessageBox(NULL, message, title, MB_ICONEXCLAMATION | MB_OK); -#else - fprintf(stderr, "%s: %s\n", title, message); -#endif -} - -/* Pop up an out of memory message, returns to Windows */ -static BOOL OutOfMemory(void) { - ShowError("Fatal Error", "Out of memory - aborting"); - return FALSE; -} - - -int WINAPI G3D_WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) { - char **argv; - int argc; - int status; - char *cmdline; -# ifdef _WIN32_WCE - wchar_t *bufp; - int nLen; -# else - char *bufp; - size_t nLen; -# endif - -#ifdef _WIN32_WCE -#error WinCE not supported - /* - nLen = wcslen(szCmdLine) + 128 + 1; - bufp = SDL_stack_alloc(wchar_t, nLen * 2); - wcscpy(bufp, TEXT("\"")); - GetModuleFileName(NULL, bufp + 1, 128 - 3); - wcscpy(bufp + wcslen(bufp), TEXT("\" ")); - wcsncpy(bufp + wcslen(bufp), szCmdLine, nLen - wcslen(bufp)); - nLen = wcslen(bufp) + 1; - cmdline = SDL_stack_alloc(char, nLen); - if (cmdline == NULL) { - return OutOfMemory(); - } - WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); - */ -#else - /* Grab the command line */ - bufp = GetCommandLineA(); - nLen = strlen(bufp) + 1; - cmdline = (char*)malloc(sizeof(char) * nLen); - if (cmdline == NULL) { - return OutOfMemory(); - } - strncpy(cmdline, bufp, nLen); -#endif - - /* Parse it into argv and argc */ - argc = ParseCommandLine(cmdline, NULL); - argv = (char**)malloc(sizeof(char*) * (argc + 1)); - if (argv == NULL) { - return OutOfMemory(); - } - ParseCommandLine(cmdline, argv); - - /* Run the main program */ - status = main(argc, (const char**)argv); - free(argv); - free(cmdline); - - return status; -} - -#endif // if Win32 diff --git a/externals/g3dlite/G3D.lib/source/debugAssert.cpp b/externals/g3dlite/G3D.lib/source/debugAssert.cpp deleted file mode 100644 index 4b24546a661..00000000000 --- a/externals/g3dlite/G3D.lib/source/debugAssert.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/** - @file debugAssert.cpp - - Windows implementation of assertion routines. - - @maintainer Morgan McGuire, graphics3d.com - - @created 2001-08-26 - @edited 2006-02-02 - */ - -#include "G3D/debugAssert.h" -#include "G3D/platform.h" -#ifdef G3D_WIN32 - #include -#endif -#include "G3D/format.h" -#include "G3D/prompt.h" -#include -#include "G3D/debugPrintf.h" -#include "G3D/Log.h" - -#include - -#ifdef _MSC_VER - // disable: "C++ exception handler used" -# pragma warning (push) -# pragma warning (disable : 4530) -#endif - -using namespace std; - -namespace G3D { namespace _internal { - -ConsolePrintHook _consolePrintHook; -AssertionHook _debugHook = _handleDebugAssert_; -AssertionHook _failureHook = _handleErrorCheck_; - -#ifdef G3D_LINUX - Display* x11Display = NULL; - Window x11Window = 0; -#endif - - -#ifdef G3D_WIN32 -static void postToClipboard(const char *text) { - if (OpenClipboard(NULL)) { - HGLOBAL hMem = GlobalAlloc(GHND | GMEM_DDESHARE, strlen(text) + 1); - if (hMem) { - char *pMem = (char*)GlobalLock(hMem); - strcpy(pMem, text); - GlobalUnlock(hMem); - - EmptyClipboard(); - SetClipboardData(CF_TEXT, hMem); - } - - CloseClipboard(); - GlobalFree(hMem); - } -} -#endif - -/** - outTitle should be set before the call - */ -static void createErrorMessage( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - std::string& outTitle, - std::string& outMessage) { - - std::string le = ""; - const char* newline = "\n"; - - #ifdef G3D_WIN32 - newline = "\r\n"; - - // The last error value. (Which is preserved across the call). - DWORD lastErr = GetLastError(); - - // The decoded message from FormatMessage - LPTSTR formatMsg = NULL; - - if (NULL == formatMsg) { - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - lastErr, - 0, - (LPTSTR)&formatMsg, - 0, - NULL); - } - - // Make sure the message got translated into something. - LPTSTR realLastErr; - if (NULL != formatMsg) { - realLastErr = formatMsg; - } else { - realLastErr = _T("Last error code does not exist."); - } - - if (lastErr != 0) { - le = G3D::format("Last Error (0x%08X): %s\r\n\r\n", lastErr, (LPCSTR)realLastErr); - } - - // Get rid of the allocated memory from FormatMessage. - if (NULL != formatMsg) { - LocalFree((LPVOID)formatMsg); - } - - char modulePath[MAX_PATH]; - GetModuleFileNameA(NULL, modulePath, MAX_PATH); - - const char* moduleName = strrchr(modulePath, '\\'); - outTitle = outTitle + string(" - ") + string(moduleName ? (moduleName + 1) : modulePath); - - #endif - - // Build the message. - outMessage = - G3D::format("%s%s%sExpression: %s%s%s:%d%s%s%s", - message.c_str(), newline, newline, expression, newline, - filename, lineNumber, newline, newline, le.c_str()); -} - - -bool _handleDebugAssert_( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - bool& ignoreAlways, - bool useGuiPrompt) { - - std::string dialogTitle = "Assertion Failure"; - std::string dialogText = ""; - createErrorMessage(expression, message, filename, lineNumber, dialogTitle, dialogText); - - #ifdef G3D_WIN32 - DWORD lastErr = GetLastError(); - postToClipboard(dialogText.c_str()); - debugPrintf("\n%s\n", dialogText.c_str()); - #endif - - const int cBreak = 0; - const int cIgnore = 1; - const int cIgnoreAlways = 2; - const int cAbort = 3; - - static const char* choices[] = {"Debug", "Ignore", "Ignore Always", "Exit"}; - - // Log the error - Log::common()->print(std::string("\n**************************\n\n") + dialogTitle + "\n" + dialogText); - - int result = G3D::prompt(dialogTitle.c_str(), dialogText.c_str(), (const char**)choices, 4, useGuiPrompt); - -# ifdef G3D_WIN32 - // Put the incoming last error back. - SetLastError(lastErr); -# endif - - switch (result) { - // -1 shouldn't actually occur because it means - // that we're in release mode. - case -1: - case cBreak: - return true; - break; - - case cIgnore: - return false; - break; - - case cIgnoreAlways: - ignoreAlways = true; - return false; - break; - - case cAbort: - exit(-1); - break; - } - - // Should never get here - return false; -} - - -bool _handleErrorCheck_( - const char* expression, - const std::string& message, - const char* filename, - int lineNumber, - bool& ignoreAlways, - bool useGuiPrompt) { - - (void)ignoreAlways; - - std::string dialogTitle = "Critical Error"; - std::string dialogText = ""; - - createErrorMessage(expression, message, filename, lineNumber, dialogTitle, dialogText); - - // Log the error - Log::common()->print(std::string("\n**************************\n\n") + dialogTitle + "\n" + dialogText); - #ifdef G3D_WIN32 - DWORD lastErr = GetLastError(); - postToClipboard(dialogText.c_str()); - debugPrintf("\n%s\n", dialogText.c_str()); - #endif - - static const char* choices[] = {"Ok"}; - - std::string m = - std::string("An internal error has occured in your program and it will now close. Details about the error have been reported in \"") + - Log::getCommonLogFilename() + "\"."; - - int result = G3D::prompt("Error", m.c_str(), (const char**)choices, 1, useGuiPrompt); - (void)result; - - return true; -} - - -#ifdef G3D_WIN32 -static HCURSOR oldCursor; -static RECT oldCursorRect; -static POINT oldCursorPos; -static int oldShowCursorCount; -#endif - -void _releaseInputGrab_() { - #ifdef G3D_WIN32 - - GetCursorPos(&oldCursorPos); - - // Stop hiding the cursor if the application hid it. - oldShowCursorCount = ShowCursor(true) - 1; - - if (oldShowCursorCount < -1) { - for (int c = oldShowCursorCount; c < -1; ++c) { - ShowCursor(true); - } - } - - // Set the default cursor in case the application - // set the cursor to NULL. - oldCursor = GetCursor(); - SetCursor(LoadCursor(NULL, IDC_ARROW)); - - // Allow the cursor full access to the screen - GetClipCursor(&oldCursorRect); - ClipCursor(NULL); - - #elif defined(G3D_LINUX) - if (x11Display != NULL) { - XUngrabPointer(x11Display, CurrentTime); - XUngrabKeyboard(x11Display, CurrentTime); - if (x11Window != 0) { - //XUndefineCursor(x11Display, x11Window); - // TODO: Note that we leak this cursor; it should be - // freed in the restore code. - Cursor c = XCreateFontCursor(x11Display, 68); - XDefineCursor(x11Display, x11Window, c); - } - XSync(x11Display, false); - XAllowEvents(x11Display, AsyncPointer, CurrentTime); - XFlush(x11Display); - } - #elif defined(G3D_OSX) - // TODO: OS X - #endif -} - - -void _restoreInputGrab_() { - #ifdef G3D_WIN32 - - // Restore the old clipping region - ClipCursor(&oldCursorRect); - - SetCursorPos(oldCursorPos.x, oldCursorPos.y); - - // Restore the old cursor - SetCursor(oldCursor); - - // Restore old visibility count - if (oldShowCursorCount < 0) { - for (int c = 0; c > oldShowCursorCount; --c) { - ShowCursor(false); - } - } - - #elif defined(G3D_LINUX) - // TODO: Linux - #elif defined(G3D_OSX) - // TODO: OS X - #endif -} - - -}; // internal namespace - -void setAssertionHook(AssertionHook hook) { - G3D::_internal::_debugHook = hook; -} - -AssertionHook assertionHook() { - return G3D::_internal::_debugHook; -} - -void setFailureHook(AssertionHook hook) { - G3D::_internal::_failureHook = hook; -} - -AssertionHook failureHook() { - return G3D::_internal::_failureHook; -} - - -void setConsolePrintHook(ConsolePrintHook h) { - G3D::_internal::_consolePrintHook = h; -} - -ConsolePrintHook consolePrintHook() { - return G3D::_internal::_consolePrintHook; -} - - -std::string __cdecl debugPrint(const std::string& s) { -# ifdef G3D_WIN32 - const int MAX_STRING_LEN = 1024; - - // Windows can't handle really long strings sent to - // the console, so we break the string. - if (s.size() < MAX_STRING_LEN) { - OutputDebugStringA(s.c_str()); - } else { - for (unsigned int i = 0; i < s.size(); i += MAX_STRING_LEN) { - std::string sub = s.substr(i, MAX_STRING_LEN); - OutputDebugStringA(sub.c_str()); - } - } -# else - fprintf(stderr, "%s", s.c_str()); - fflush(stderr); -# endif - - return s; -} - -std::string __cdecl debugPrintf(const char* fmt ...) { - va_list argList; - va_start(argList, fmt); - std::string s = G3D::vformat(fmt, argList); - va_end(argList); - - return debugPrint(consolePrint(s)); -} - -std::string consolePrint(const std::string& s) { - FILE* L = Log::common()->getFile(); - fprintf(L, "%s", s.c_str()); - - if (consolePrintHook()) { - consolePrintHook()(s); - } - - fflush(L); - return s; -} - - -std::string __cdecl consolePrintf(const char* fmt ...) { - va_list argList; - va_start(argList, fmt); - std::string s = G3D::vformat(fmt, argList); - va_end(argList); - - return consolePrint(s); -} - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif diff --git a/externals/g3dlite/G3D.lib/source/fileutils.cpp b/externals/g3dlite/G3D.lib/source/fileutils.cpp deleted file mode 100644 index 3a5e8c715c8..00000000000 --- a/externals/g3dlite/G3D.lib/source/fileutils.cpp +++ /dev/null @@ -1,1092 +0,0 @@ -/** - @file fileutils.cpp - - @author Morgan McGuire, graphics3d.com - - @author 2002-06-06 - @edited 2008-01-20 - */ - -#include "G3D/platform.h" -#include "G3D/fileutils.h" -#include "G3D/BinaryInput.h" -#include "G3D/g3dmath.h" -#include -#include -#include -#include -#include "G3D/stringutils.h" -#include "G3D/Set.h" - -#include - -#ifdef G3D_WIN32 - // Needed for _getcwd - #include - #include -#else - #include - #include - #include - #define _getcwd getcwd -#endif -#include -#include "G3D/BinaryOutput.h" - -#ifdef G3D_WIN32 - //for _mkdir and _stat -# include -#else -# define _stat stat -#endif - - -namespace G3D { - -namespace _internal { - Set currentFilesUsed; -} - -std::string pathConcat(const std::string& dirname, const std::string& file) { - // Ensure that the directory ends in a slash - if ((dirname.size() != 0) && - (dirname[dirname.size() - 1] != '/') && - (dirname[dirname.size() - 1] != '\\') && - (dirname[dirname.size() - 1] != ':')) { - return dirname + '/' + file; - } else { - return dirname + file; - } -} - -std::string resolveFilename(const std::string& filename) { - if (filename.size() >= 1) { - if ((filename[0] == '/') || (filename[0] == '\\')) { - // Already resolved - return filename; - } else { - - #ifdef G3D_WIN32 - if ((filename.size() >= 2) && (filename[1] == ':')) { - // There is a drive spec on the front. - if ((filename.size() >= 3) && ((filename[2] == '\\') || - (filename[2] == '/'))) { - // Already fully qualified - return filename; - } else { - // The drive spec is relative to the - // working directory on that drive. - debugAssertM(false, "Files of the form d:path are" - " not supported (use a fully qualified" - " name)."); - return filename; - } - } - #endif - } - } - - char buffer[1024]; - - // Prepend the working directory. - _getcwd(buffer, 1024); - - return format("%s/%s", buffer, filename.c_str()); -} - -bool zipfileExists(const std::string& filename) { - std::string outZipfile; - std::string outInternalFile; - return zipfileExists(filename, outZipfile, outInternalFile); -} - -std::string readWholeFile( - const std::string& filename) { - - _internal::currentFilesUsed.insert(filename); - - std::string s; - - debugAssert(filename != ""); - if (fileExists(filename, false)) { - - int64 length = fileLength(filename); - - char* buffer = (char*)System::alignedMalloc(length + 1, 16); - debugAssert(buffer); - FILE* f = fopen(filename.c_str(), "rb"); - debugAssert(f); - int ret = fread(buffer, 1, length, f); - debugAssert(ret == length);(void)ret; - fclose(f); - - buffer[length] = '\0'; - s = std::string(buffer); - - System::alignedFree(buffer); - - } else if (zipfileExists(filename)) { - - void* zipBuffer; - size_t length; - zipRead(filename, zipBuffer, length); - - char* buffer = (char*)System::alignedMalloc(length + 1, 16); - System::memcpy(buffer,zipBuffer, length + 1); - zipClose(zipBuffer); - - buffer[length] = '\0'; - s = std::string(buffer); - System::alignedFree(buffer); - } else { - debugAssertM(false, filename + " not found"); - } - - return s; -} - - -void zipRead(const std::string& file, - void*& data, - size_t& length) { - std::string zip, desiredFile; - - if (zipfileExists(file, zip, desiredFile)) { - unzFile f = unzOpen(zip.c_str()); - { - unzLocateFile(f, desiredFile.c_str(), 2); - unz_file_info info; - unzGetCurrentFileInfo(f, &info, NULL, 0, NULL, 0, NULL, 0); - length = info.uncompressed_size; - // sets machines up to use MMX, if they want - data = System::alignedMalloc(length, 16); - unzOpenCurrentFile(f); - { - int test = unzReadCurrentFile(f, data, length); - debugAssertM((size_t)test == length, - desiredFile + " was corrupt because it unzipped to the wrong size."); - (void)test; - } - unzCloseCurrentFile(f); - } - unzClose(f); - } else { - data = NULL; - } -} - - -void zipClose(void* data) { - System::alignedFree(data); -} - - -int64 fileLength(const std::string& filename) { - struct _stat st; - int result = _stat(filename.c_str(), &st); - - if (result == -1) { - std::string zip, contents; - if(zipfileExists(filename, zip, contents)){ - int64 requiredMem; - - unzFile f = unzOpen(zip.c_str()); - { - unzLocateFile(f, contents.c_str(), 2); - unz_file_info info; - unzGetCurrentFileInfo(f, &info, NULL, 0, NULL, 0, NULL, 0); - requiredMem = info.uncompressed_size; - } - unzClose(f); - return requiredMem; - } else { - return -1; - } - } - - return st.st_size; -} - -/** Used by robustTmpfile. Returns nonzero if fread, fwrite, and fseek all -succeed on the file. - @author Morgan McGuire, morgan@graphics3d.com */ -static int isFileGood(FILE* f) { - - int x, n, result; - - /* Must be a valid file handle */ - if (f == NULL) { - return 0; - } - - /* Try to write */ - x = 1234; - n = fwrite(&x, sizeof(int), 1, f); - - if (n != 1) { - return 0; - } - - /* Seek back to the beginning */ - result = fseek(f, 0, SEEK_SET); - if (result != 0) { - return 0; - } - - /* Read */ - n = fread(&x, sizeof(int), 1, f); - if (n != 1) { - return 0; - } - - /* Seek back to the beginning again */ - fseek(f, 0, SEEK_SET); - - return 1; -} - -FILE* createTempFile() { - FILE* t = NULL; - -//# ifdef G3D_WIN32 - t = tmpfile(); -//# else -// // On Unix, tmpfile generates a warning for any code that links against it. -// const char* tempfilename = "/tmp/g3dtemp.XXXXXXXX"; -// mktemp(tempfilename); -// t = fopen(tempfilename, "w"); -//# endif - -# ifdef _WIN32 - char* n = NULL; -# endif - char name[256]; - - if (isFileGood(t)) { - return t; - } - -# ifdef G3D_WIN32 - /* tmpfile failed; try the tmpnam routine */ - t = fopen(tmpnam(NULL), "w+"); - if (isFileGood(t)) { - return t; - } - - n = _tempnam("c:/tmp/", "t"); - /* Try to create something in C:\tmp */ - t = fopen(n, "w+"); - if (isFileGood(t)) { - return t; - } - - /* Try c:\temp */ - n = _tempnam("c:/temp/", "t"); - t = fopen(n, "w+"); - if (isFileGood(t)) { - return t; - } - - /* try the current directory */ - n = _tempnam("./", "t"); - t = fopen(n, "w+"); - if (isFileGood(t)) { - return t; - } - - sprintf(name, "%s/tmp%d", "c:/temp", rand()); - t = fopen(name, "w+"); - if (isFileGood(t)) { - return t; - } - - /* Try some hardcoded paths */ - sprintf(name, "%s/tmp%d", "c:/tmp", rand()); - t = fopen(name, "w+"); - if (isFileGood(t)) { - return t; - } -# else - sprintf(name, "%s/tmp%d", "/tmp", rand()); - t = fopen(name, "w+"); - if (isFileGood(t)) { - return t; - } -#endif - - sprintf(name, "tmp%d", rand()); - t = fopen(name, "w+"); - if (isFileGood(t)) { - return t; - } - - fprintf(stderr, "Unable to create a temporary file; robustTmpfile returning NULL\n"); - - return NULL; -} - -/////////////////////////////////////////////////////////////////////////////// -void writeWholeFile( - const std::string& filename, - const std::string& str, - bool flush) { - - // Make sure the directory exists. - std::string root, base, ext, path; - Array pathArray; - parseFilename(filename, root, pathArray, base, ext); - - path = root + stringJoin(pathArray, '/'); - if (! fileExists(path, false)) { - createDirectory(path); - } - - FILE* file = fopen(filename.c_str(), "wb"); - - debugAssert(file); - - fwrite(str.c_str(), str.size(), 1, file); - - if (flush) { - fflush(file); - } - fclose(file); -} - -/////////////////////////////////////////////////////////////////////////////// - -/** - Creates the directory (which may optionally end in a /) - and any parents needed to reach it. - */ -void createDirectory( - const std::string& dir) { - - if (dir == "") { - return; - } - - std::string d; - - // Add a trailing / if there isn't one. - switch (dir[dir.size() - 1]) { - case '/': - case '\\': - d = dir; - break; - - default: - d = dir + "/"; - } - - // If it already exists, do nothing - if (fileExists(d.substr(0, d.size() - 1)), false) { - return; - } - - // Parse the name apart - std::string root, base, ext; - Array path; - - std::string lead; - parseFilename(d, root, path, base, ext); - debugAssert(base == ""); - debugAssert(ext == ""); - - // Begin with an extra period so "c:\" becomes "c:\.\" after - // appending a path and "c:" becomes "c:.\", not root: "c:\" - std::string p = root + "."; - - // Create any intermediate that doesn't exist - for (int i = 0; i < path.size(); ++i) { - p += "/" + path[i]; - if (! fileExists(p, false)) { - // Windows only requires one argument to mkdir, - // where as unix also requires the permissions. -# ifndef G3D_WIN32 - mkdir(p.c_str(), 0777); -# else - _mkdir(p.c_str()); -# endif - } - } -} - -/////////////////////////////////////////////////////////////////////////////// - -bool fileExists( - const std::string& filename, - const bool lookInZipfiles) { - - if (filename == "") { - return true; - } - - - // Useful for debugging - //char curdir[1024]; _getcwd(curdir, 1024); - - struct _stat st; - int ret = _stat(filename.c_str(), &st); - - // _stat returns zero on success - bool exists = (ret == 0); - - if (exists) { - // Exists - return true; - } else if (lookInZipfiles) { - // Does not exist standalone, but might exist in a zipfile - - // These output arguments will be ignored - std::string zipDir, internalPath; - return zipfileExists(filename, zipDir, internalPath); - } else { - // Does not exist - return false; - } -} - -/////////////////////////////////////////////////////////////////////////////// - -/* Helper methods for zipfileExists()*/ -// Given a string (the drive) and an array (the path), computes the directory -static void _zip_resolveDirectory(std::string& completeDir, const std::string& drive, const Array& path, const int length){ - completeDir = drive; - int tempLength; - // if the given length is longer than the array, we correct it - if(length > path.length()){ - tempLength = path.length(); - } else{ - tempLength = length; - } - - for(int t = 0; t < tempLength; ++t){ - if(t > 0){ - completeDir += "/"; - } - completeDir += path[t]; - } -} - - -// assumes that zipDir references a .zip file -static bool _zip_zipContains(const std::string& zipDir, const std::string& desiredFile){ - unzFile f = unzOpen(zipDir.c_str()); - //the last parameter, an int, determines case sensitivity: - //1 is sensitive, 2 is not, 0 is default - int test = unzLocateFile(f, desiredFile.c_str(), 2); - unzClose(f); - if(test == UNZ_END_OF_LIST_OF_FILE){ - return false; - } - return true; -} - - -// If no zipfile exists, outZipfile and outInternalFile are unchanged -bool zipfileExists(const std::string& filename, std::string& outZipfile, - std::string& outInternalFile){ - if (fileExists(filename, false)) { - // Not inside a zipfile if the file itself exists - return false; - } else { - Array path; - std::string drive, base, ext, zipfile, infile; - parseFilename(filename, drive, path, base, ext); - - // Put the filename back together - if ((base != "") && (ext != "")) { - infile = base + "." + ext; - } else { - infile = base + ext; - } - - // Remove "." from path - for (int i = 0; i < path.length(); ++i) { - if (path[i] == ".") { - path.remove(i); - --i; - } - } - - // Remove ".." from path - for (int i = 1; i < path.length(); ++i) { - if ((path[i] == "..") && (i > 0) && (path[i - 1] != "..")) { - // Remove both i and i - 1 - path.remove(i - 1, 2); - i -= 2; - } - } - - // Walk the path backwards, accumulating pieces onto the infile until - // we find a zipfile that contains it - for (int t = 0; t < path.length(); ++t){ - _zip_resolveDirectory(zipfile, drive, path, path.length() - t); - if (t > 0) { - infile = path[path.length() - t] + "/" + infile; - } - - if (fileExists(zipfile, false)) { - // test if it actually is a zipfile - // if not, return false, a bad - // directory structure has been given, - // not a .zip - if (isZipfile(zipfile)){ - - if (_zip_zipContains(zipfile, infile)){ - outZipfile = zipfile; - outInternalFile = infile; - return true; - } else { - return false; - } - } else { - // the directory structure was valid but did not point to a .zip - return false; - } - } - - } - } - - // not a valid directory structure ever, - // obviously no .zip was found within the path - return false; -} - -/////////////////////////////////////////////////////////////////////////////// - -std::string generateFilenameBase(const std::string& prefix) { - Array exist; - - // Note "template" is a reserved word in C++ - std::string templat = prefix + System::currentDateString(); - getFiles(templat + "*", exist); - - // Remove extensions - for (int i = 0; i < exist.size(); ++i) { - exist[i] = filenameBase(exist[i]); - } - - int num = 0; - std::string result; - templat += "_%03d"; - do { - result = format(templat.c_str(), num); - ++num; - } while (exist.contains(result)); - - return result; -} - -/////////////////////////////////////////////////////////////////////////////// - -void copyFile( - const std::string& source, - const std::string& dest) { - - #ifdef G3D_WIN32 - CopyFileA(source.c_str(), dest.c_str(), FALSE); - #else - // TODO: don't use BinaryInput and BinaryOutput - // Read it all in, then dump it out - BinaryInput in(source, G3D_LITTLE_ENDIAN); - BinaryOutput out(dest, G3D_LITTLE_ENDIAN); - out.writeBytes(in.getCArray(), in.size()); - out.commit(false); - #endif -} - -////////////////////////////////////////////////////////////////////////////// - -void parseFilename( - const std::string& filename, - std::string& root, - Array& path, - std::string& base, - std::string& ext) { - - std::string f = filename; - - root = ""; - path.clear(); - base = ""; - ext = ""; - - if (f == "") { - // Empty filename - return; - } - - // See if there is a root/drive spec. - if ((f.size() >= 2) && (f[1] == ':')) { - - if ((f.size() > 2) && isSlash(f[2])) { - - // e.g. c:\foo - root = f.substr(0, 3); - f = f.substr(3, f.size() - 3); - - } else { - - // e.g. c:foo - root = f.substr(2); - f = f.substr(2, f.size() - 2); - - } - - } else if ((f.size() >= 2) & isSlash(f[0]) && isSlash(f[1])) { - - // e.g. //foo - root = f.substr(0, 2); - f = f.substr(2, f.size() - 2); - - } else if (isSlash(f[0])) { - - root = f.substr(0, 1); - f = f.substr(1, f.size() - 1); - - } - - // Pull the extension off - { - // Find the period - size_t i = f.rfind('.'); - - if (i != std::string::npos) { - // Make sure it is after the last slash! - size_t j = iMax(f.rfind('/'), f.rfind('\\')); - if ((j == std::string::npos) || (i > j)) { - ext = f.substr(i + 1, f.size() - i - 1); - f = f.substr(0, i); - } - } - } - - // Pull the basename off - { - // Find the last slash - size_t i = iMax(f.rfind('/'), f.rfind('\\')); - - if (i == std::string::npos) { - - // There is no slash; the basename is the whole thing - base = f; - f = ""; - - } else if ((i != std::string::npos) && (i < f.size() - 1)) { - - base = f.substr(i + 1, f.size() - i - 1); - f = f.substr(0, i); - - } - } - - // Parse what remains into path. - size_t prev, cur = 0; - - while (cur < f.size()) { - prev = cur; - - // Allow either slash - size_t i = f.find('/', prev + 1); - size_t j = f.find('\\', prev + 1); - if (i == std::string::npos) { - i = f.size(); - } - - if (j == std::string::npos) { - j = f.size(); - } - - cur = iMin(i, j); - - if (cur == std::string::npos) { - cur = f.size(); - } - - path.append(f.substr(prev, cur - prev)); - ++cur; - } -} - - -/** - Helper for getFileList and getDirectoryList. - - @param wantFiles If false, returns the directories, otherwise - returns the files. - @param includePath If true, the names include paths - */ -static void getFileOrDirListNormal -( - const std::string& filespec, - Array& files, - bool wantFiles, - bool includePath) { - - bool test = wantFiles ? true : false; - - std::string path = ""; - - // Find the place where the path ends and the file-spec begins - size_t i = filespec.rfind('/'); - size_t j = filespec.rfind('\\'); - - // Drive letters on Windows can separate a path - size_t k = filespec.rfind(':'); - - if (((j != std::string::npos) && (j > i)) || - (i == std::string::npos)) { - i = j; - } - - if (((k != std::string::npos) && (k > i)) || - (i == std::string::npos)) { - i = k; - } - - // If there is a path, pull it off - if (i != std::string::npos) { - path = filespec.substr(0, i + 1); - } - - std::string prefix = path; - - if (path.size() > 0) { - // Strip the trailing character - path = path.substr(0, path.size() - 1); - } - -# ifdef G3D_WIN32 - { - struct _finddata_t fileinfo; - - long handle = _findfirst(filespec.c_str(), &fileinfo); - int result = handle; - - while (result != -1) { - if ((((fileinfo.attrib & _A_SUBDIR) == 0) == test) && - strcmp(fileinfo.name, ".") && - strcmp(fileinfo.name, "..")) { - - if (includePath) { - files.append(prefix + fileinfo.name); - } else { - files.append(fileinfo.name); - } - } - - result = _findnext(handle, &fileinfo); - } - } -# else - { - if (path == "") { - // Empty paths don't work on Unix - path = "."; - } - - // Unix implementation - DIR* dir = opendir(path.c_str()); - - if (dir != NULL) { - struct dirent* entry = readdir(dir); - - while (entry != NULL) { - - // Exclude '.' and '..' - if ((strcmp(entry->d_name, ".") != 0) && - (strcmp(entry->d_name, "..") != 0)) { - - // Form a name with a path - std::string filename = prefix + entry->d_name; - // See if this is a file or a directory - struct _stat st; - bool exists = _stat(filename.c_str(), &st) != -1; - - if (exists && - - // Make sure it has the correct type - (((st.st_mode & S_IFDIR) == 0) == test) && - - // Make sure it matches the wildcard - (fnmatch(filespec.c_str(), - filename.c_str(), - FNM_PATHNAME) == 0)) { - - if (includePath) { - files.append(filename); - } else { - files.append(entry->d_name); - } - } - } - - entry = readdir(dir); - } - closedir(dir); - } - } -# endif -} - -/** - - c:/temp/foo.zip/plainsky\\* -" path " - "prefix " - - @param path The zipfile name (no trailing slash) - @param prefix Directory inside the zipfile. No leading slash, must have trailing slash if non-empty. - @param file Name inside the zipfile that we are testing to see if it matches prefix + "*" - */ -static void _zip_addEntry(const std::string& path, - const std::string& prefix, - const std::string& file, - Set& files, - bool wantFiles, - bool includePath) { - - // Make certain we are within the desired parent folder (prefix) - if (beginsWith(file, prefix)) { - // validityTest was prefix/file - - // Extract everything to the right of the prefix - std::string s = file.substr(prefix.length()); - - if (s == "") { - // This was the name of the prefix - return; - } - - // See if there are any slashes - size_t slashPos = s.find('/'); - - bool add = false; - - if (slashPos == std::string::npos) { - // No slashes, so s must be a file - add = wantFiles; - } else if (! wantFiles) { - // Not all zipfiles list directories as explicit entries. - // Because of this, if we're looking for directories and see - // any path longer than prefix, we must add the subdirectory. - // The Set will fix duplicates for us. - s = s.substr(0, slashPos); - add = true; - } - - if (add) { - if (includePath) { - files.insert(path + "/" + prefix + s); - } else { - files.insert(s); - } - } - } -} - - -static void getFileOrDirListZip(const std::string& path, - const std::string& prefix, - Array& files, - bool wantFiles, - bool includePath){ - unzFile f = unzOpen(path.c_str()); - - enum {MAX_STRING_LENGTH=1024}; - char filename[MAX_STRING_LENGTH]; - Set fileSet; - - do { - - // prefix is valid, either "" or a subfolder - unzGetCurrentFileInfo(f, NULL, filename, MAX_STRING_LENGTH, NULL, 0, NULL, 0); - _zip_addEntry(path, prefix, filename, fileSet, wantFiles, includePath); - - } while (unzGoToNextFile(f) != UNZ_END_OF_LIST_OF_FILE); - - unzClose(f); - - fileSet.getMembers(files); -} - - -static void determineFileOrDirList( - const std::string& filespec, - Array& files, - bool wantFiles, - bool includePath) { - - // if it is a .zip, prefix will specify the folder within - // whose contents we want to see - std::string prefix = ""; - std::string path = filenamePath(filespec); - - if ((path.size() > 0) && isSlash(path[path.size() - 1])) { - // Strip the trailing slash - path = path.substr(0, path.length() -1); - } - - if (fileExists(path, false)) { - if (isZipfile(path)) { - // .zip should only work if * is specified as the Base + Ext - // Here, we have been asked for the root's contents - debugAssertM(filenameBaseExt(filespec) == "*", "Can only call getFiles/getDirs on zipfiles using '*' wildcard"); - getFileOrDirListZip(path, prefix, files, wantFiles, includePath); - } else { - // It is a normal directory - getFileOrDirListNormal(filespec, files, wantFiles, includePath); - } - } else if (zipfileExists(filenamePath(filespec), path, prefix)) { - // .zip should only work if * is specified as the Base + Ext - // Here, we have been asked for the contents of a folder within the .zip - debugAssertM(filenameBaseExt(filespec) == "*", "Can only call getFiles/getDirs on zipfiles using '*' wildcard"); - getFileOrDirListZip(path, prefix, files, wantFiles, includePath); - } -} - - -void getFiles( - const std::string& filespec, - Array& files, - bool includePath) { - - determineFileOrDirList(filespec, files, true, includePath); -} - - -void getDirs( - const std::string& filespec, - Array& files, - bool includePath) { - - determineFileOrDirList(filespec, files, false, includePath); -} - - -std::string filenameBaseExt(const std::string& filename) { - int i = filename.rfind("/"); - int j = filename.rfind("\\"); - - if ((j > i) && (j >= 0)) { - i = j; - } - -# ifdef G3D_WIN32 - j = filename.rfind(":"); - if ((i == -1) && (j >= 0)) { - i = j; - } -# endif - - if (i == -1) { - return filename; - } else { - return filename.substr(i + 1, filename.length() - i); - } -} - - -std::string filenameBase(const std::string& s) { - std::string drive; - std::string base; - std::string ext; - Array path; - - parseFilename(s, drive, path, base, ext); - return base; -} - - -std::string filenameExt(const std::string& filename) { - int i = filename.rfind("."); - if (i >= 0) { - return filename.substr(i + 1, filename.length() - i); - } else { - return ""; - } -} - - -std::string filenamePath(const std::string& filename) { - int i = filename.rfind("/"); - int j = filename.rfind("\\"); - - if ((j > i) && (j >= 0)) { - i = j; - } - -# ifdef G3D_WIN32 - j = filename.rfind(":"); - if ((i == -1) && (j >= 0)) { - i = j; - } -# endif - - if (i == -1) { - return ""; - } else { - return filename.substr(0, i+1); - } -} - - -bool isZipfile(const std::string& filename) { - - FILE* f = fopen(filename.c_str(), "r"); - if (f == NULL) { - return false; - } - uint8 header[4]; - fread(header, 4, 1, f); - - const uint8 zipHeader[4] = {0x50, 0x4b, 0x03, 0x04}; - for (int i = 0; i < 4; ++i) { - if (header[i] != zipHeader[i]) { - fclose(f); - return false; - } - } - - fclose(f); - return true; -} - - -bool isDirectory(const std::string& filename) { - struct _stat st; - bool exists = _stat(filename.c_str(), &st) != -1; - return exists && ((st.st_mode & S_IFDIR) != 0); -} - - -bool filenameContainsWildcards(const std::string& filename) { - return (filename.find('*') != std::string::npos) || (filename.find('?') != std::string::npos); -} - - -bool fileIsNewer(const std::string& src, const std::string& dst) { - struct _stat sts; - bool sexists = _stat(src.c_str(), &sts) != -1; - - struct _stat dts; - bool dexists = _stat(dst.c_str(), &dts) != -1; - - return sexists && ((! dexists) || (sts.st_mtime > dts.st_mtime)); -} - - -Array filesUsed() { - Array f; - _internal::currentFilesUsed.getMembers(f); - return f; -} - -} - -#ifndef G3D_WIN32 - #undef _stat -#endif diff --git a/externals/g3dlite/G3D.lib/source/filter.cpp b/externals/g3dlite/G3D.lib/source/filter.cpp deleted file mode 100644 index f6c0467820f..00000000000 --- a/externals/g3dlite/G3D.lib/source/filter.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - @file filter.cpp - - @author Morgan McGuire, matrix@graphics3d.com - @created 2007-03-01 - @edited 2007-03-01 - - Copyright 2000-2007, Morgan McGuire. - All rights reserved. - */ -#include "G3D/filter.h" - -namespace G3D { - -void gaussian1D(Array& coeff, int N, float std) { - coeff.resize(N); - float sum = 0.0f; - for (int i = 0; i < N; ++i) { - float x = i - (N - 1) / 2.0f; - float p = -square(x / std) / 2.0f; - float y = exp(p); - coeff[i] = y; - sum += y; - } - - for (int i = 0; i < N; ++i) { - coeff[i] /= sum; - } -} - - -} // namespace diff --git a/externals/g3dlite/G3D.lib/source/format.cpp b/externals/g3dlite/G3D.lib/source/format.cpp deleted file mode 100644 index d9d1b516393..00000000000 --- a/externals/g3dlite/G3D.lib/source/format.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/** - @file format.cpp - - @author Morgan McGuire, graphics3d.com - - @created 2000-09-09 - @edited 2006-08-14 -*/ - -#include "G3D/format.h" -#include "G3D/platform.h" -#include "G3D/System.h" - -#ifdef _MSC_VER - // disable: "C++ exception handler used" -# pragma warning (push) -# pragma warning (disable : 4530) -#endif // _MSC_VER - -// If your platform does not have vsnprintf, you can find a -// implementation at http://www.ijs.si/software/snprintf/ - -namespace G3D { - -std::string __cdecl format(const char* fmt,...) { - va_list argList; - va_start(argList,fmt); - std::string result = vformat(fmt, argList); - va_end(argList); - - return result; -} - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) -// Both MSVC seems to use the non-standard vsnprintf -// so we are using vscprintf to determine buffer size, however -// only MSVC7 and up headers include vscprintf for some reason. -std::string vformat(const char *fmt, va_list argPtr) { - // We draw the line at a 1MB string. - const int maxSize = 1000000; - - // If the string is less than 161 characters, - // allocate it on the stack because this saves - // the malloc/free time. - const int bufSize = 161; - char stackBuffer[bufSize]; - - // MSVC does not support va_copy - int actualSize = _vscprintf(fmt, argPtr) + 1; - - if (actualSize > bufSize) { - - // Now use the heap. - char* heapBuffer = NULL; - - if (actualSize < maxSize) { - - heapBuffer = (char*)System::malloc(maxSize + 1); - _vsnprintf(heapBuffer, maxSize, fmt, argPtr); - heapBuffer[maxSize] = '\0'; - } else { - heapBuffer = (char*)System::malloc(actualSize); - vsprintf(heapBuffer, fmt, argPtr); - } - - std::string formattedString(heapBuffer); - System::free(heapBuffer); - return formattedString; - } else { - - vsprintf(stackBuffer, fmt, argPtr); - return std::string(stackBuffer); - } -} - -#elif defined(_MSC_VER) && (_MSC_VER < 1300) - -std::string vformat(const char *fmt, va_list argPtr) { - // We draw the line at a 1MB string. - const int maxSize = 1000000; - - // If the string is less than 161 characters, - // allocate it on the stack because this saves - // the malloc/free time. - const int bufSize = 161; - char stackBuffer[bufSize]; - - // MSVC6 doesn't support va_copy, however it also seems to compile - // correctly if we just pass our argument list along. Note that - // this whole code block is only compiled if we're on MSVC6 anyway - int actualWritten = _vsnprintf(stackBuffer, bufSize, fmt, argPtr); - - // Not a big enough buffer, bufSize characters written - if (actualWritten == -1) { - - int heapSize = 512; - double powSize = 1.0; - char* heapBuffer = (char*)System::malloc(heapSize); - - while ((_vsnprintf(heapBuffer, heapSize, fmt, argPtr) == -1) && - (heapSize < maxSize)) { - - heapSize = iCeil(heapSize * ::pow((double)2.0, powSize++)); - heapBuffer = (char*)System::realloc(heapBuffer, heapSize); - } - - heapBuffer[heapSize-1] = '\0'; - - std::string heapString(heapBuffer); - System::free(heapBuffer); - - return heapString; - } else { - - return std::string(stackBuffer); - } -} - -#else - -// glibc 2.1 has been updated to the C99 standard -std::string vformat(const char* fmt, va_list argPtr) { - // If the string is less than 161 characters, - // allocate it on the stack because this saves - // the malloc/free time. The number 161 is chosen - // to support two lines of text on an 80 character - // console (plus the null terminator). - const int bufSize = 161; - char stackBuffer[bufSize]; - - va_list argPtrCopy; - va_copy(argPtrCopy, argPtr); - int numChars = vsnprintf(stackBuffer, bufSize, fmt, argPtrCopy); - va_end(argPtrCopy); - - if (numChars >= bufSize) { - // We didn't allocate a big enough string. - char* heapBuffer = (char*)System::malloc((numChars + 1) * sizeof(char)); - - debugAssert(heapBuffer); - int numChars2 = vsnprintf(heapBuffer, numChars + 1, fmt, argPtr); - debugAssert(numChars2 == numChars); - (void)numChars2; - - std::string result(heapBuffer); - - System::free(heapBuffer); - - return result; - - } else { - - return std::string(stackBuffer); - - } -} - -#endif - -} // namespace - -#ifdef _MSC_VER -# pragma warning (pop) -#endif diff --git a/externals/g3dlite/G3D.lib/source/g3dmath.cpp b/externals/g3dlite/G3D.lib/source/g3dmath.cpp deleted file mode 100644 index 95c9e16cc24..00000000000 --- a/externals/g3dlite/G3D.lib/source/g3dmath.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - @file g3dmath.cpp - - @author Morgan McGuire, graphics3d.com - - @created 2001-06-02 - @edited 2004-02-24 - */ - -#include "G3D/g3dmath.h" -#include - -namespace G3D { - -float gaussRandom(float mean, float stdev) { - - // Using Box-Mueller method from http://www.taygeta.com/random/gaussian.html - // Modified to specify standard deviation and mean of distribution - float w, x1, x2; - - // Loop until w is less than 1 so that log(w) is negative - do { - x1 = uniformRandom(-1.0, 1.0); - x2 = uniformRandom(-1.0, 1.0); - - w = float(square(x1) + square(x2)); - } while (w > 1.0f); - - // Transform to gassian distribution - // Multiply by sigma (stdev ^ 2) and add mean. - return x2 * (float)square(stdev) * sqrtf((-2.0f * logf(w) ) / w) + mean; -} - - -int highestBit(uint32 x) { - // Binary search. - int base = 0; - - if (x & 0xffff0000) { - base = 16; - x >>= 16; - } - if (x & 0x0000ff00) { - base += 8; - x >>= 8; - } - if (x & 0x000000f0) { - base += 4; - x >>= 4; - } - - static const int lut[] = {-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3}; - return base + lut[x]; -} - - -int iRandom(int low, int high) { - int r = iFloor(low + (high - low + 1) * (double)rand() / RAND_MAX); - - // There is a *very small* chance of generating - // a number larger than high. - if (r > high) { - return high; - } else { - return r; - } -} - - -} diff --git a/externals/g3dlite/G3D.lib/source/license.cpp b/externals/g3dlite/G3D.lib/source/license.cpp deleted file mode 100644 index b362ad3f45f..00000000000 --- a/externals/g3dlite/G3D.lib/source/license.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - @file license.cpp - - @author Morgan McGuire, graphics3d.com - - @created 2004-04-15 - @edited 2004-04-15 -*/ - -#include "G3D/format.h" -#include - -namespace G3D { - -std::string license() { - return format( - -"This software is based in part on the PNG Reference Library which is\n" -"Copyright (c) 2004 Glenn Randers-Pehrson\n\n" -"This software is based in part on the work of the Independent JPEG Group.\n\n" -"This software is based on part on the FFmpeg libavformat and libavcodec libraries\n" -"(\"FFmpeg\", http://ffmpeg.mplayerhq.hu), which are included under the terms of the\n" -"GNU Lesser General Public License (LGPL), (http://www.gnu.org/copyleft/lesser.html).\n\n" -"%s" -"This program uses the G3D Library (http://g3d-cpp.sf.net), which\n" -"is licensed under the \"BSD\" Open Source license. The Graphics3D library\n" -"source code is Copyright © 2000-2008, Morgan McGuire, All rights reserved.\n" -"The BSD license requires the following statement regarding G3D:\n" -"\n" -"Redistribution and use in source and binary forms, with or without\n" -"modification, are permitted provided that the following conditions\n" -"are met:\n" -"\n" -"Redistributions of source code must retain the above copyright\n" -"notice, this list of conditions and the following disclaimer.\n" -"\n" -"Redistributions in binary form must reproduce the above copyright\n" -"notice, this list of conditions and the following disclaimer in the\n" -"documentation and/or other materials provided with the distribution.\n" -"\n" -"Neither the name of Morgan McGuire, Brown University, Williams College, nor the names\n" -"of the G3D contributors may be used to endorse or promote products derived\n" -"from this software without specific prior written permission.\n" -"\n" -"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n" -"\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n" -"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n" -"A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n" -"OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n" -"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n" -"LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n" -"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n" -"THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n" -"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" -"OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" -"\n\n" -"G3D VERSION %d\n", - -#ifdef G3D_WIN32 - "" // Win32 doesn't use SDL -#else - "This software uses the Simple DirectMedia Layer library (\"SDL\",\n" - "http://www.libsdl.org), which is included under the terms of the\n" - "GNU Lesser General Public License, (http://www.gnu.org/copyleft/lesser.html).\n\n" -#endif -, -G3D_VER); -} - -} diff --git a/externals/g3dlite/G3D.lib/source/prompt.cpp b/externals/g3dlite/G3D.lib/source/prompt.cpp deleted file mode 100644 index 1fb3bd4cfee..00000000000 --- a/externals/g3dlite/G3D.lib/source/prompt.cpp +++ /dev/null @@ -1,716 +0,0 @@ -/** - @file prompt.cpp - - @author Morgan McGuire, morgan@graphics3d.com - @cite Windows dialog interface by Max McGuire, mmcguire@ironlore.com - @cite Font setting code by Kurt Miller, kurt@flipcode.com - - @created 2000-08-26 - @edited 2005-01-14 - */ - -#include "G3D/prompt.h" -#include "G3D/platform.h" - -#include - -#ifdef G3D_WIN32 -# include -# include -#else -# define _getch getchar -#endif - -#ifdef G3D_OSX -# include -#endif - -namespace G3D { - -#ifdef G3D_WIN32 - -namespace _internal { -/** - Generic Win32 dialog facility. - @author Max McGuire - */ -class DialogTemplate { -public: - - DialogTemplate(LPCSTR caption, DWORD style, - int x, int y, int w, int h, - LPCSTR font = NULL, WORD fontSize = 8) { - - usedBufferLength = sizeof(DLGTEMPLATE); - totalBufferLength = usedBufferLength; - - dialogTemplate = (DLGTEMPLATE*)malloc(totalBufferLength); - - dialogTemplate->style = style; - - if (font != NULL) { - dialogTemplate->style |= DS_SETFONT; - } - - dialogTemplate->x = (short)x; - dialogTemplate->y = (short)y; - dialogTemplate->cx = (short)w; - dialogTemplate->cy = (short)h; - dialogTemplate->cdit = 0; - - dialogTemplate->dwExtendedStyle = 0; - - // The dialog box doesn't have a menu or a special class - AppendData("\0", 2); - AppendData("\0", 2); - - // Add the dialog's caption to the template - - AppendString(caption); - - if (font != NULL) { - AppendData(&fontSize, sizeof(WORD)); - AppendString(font); - } - } - - void AddComponent(LPCSTR type, LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - DLGITEMTEMPLATE item; - - item.style = style; - item.x = (short)x; - item.y = (short)y; - item.cx = (short)w; - item.cy = (short)h; - item.id = id; - - item.dwExtendedStyle = exStyle; - - AppendData(&item, sizeof(DLGITEMTEMPLATE)); - - AppendString(type); - AppendString(caption); - - WORD creationDataLength = 0; - AppendData(&creationDataLength, sizeof(WORD)); - - // Increment the component count - dialogTemplate->cdit++; - - } - - - void AddButton(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - AddStandardComponent(0x0080, caption, style, exStyle, x, y, w, h, id); - - WORD creationDataLength = 0; - AppendData(&creationDataLength, sizeof(WORD)); - - } - - - void AddEditBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - AddStandardComponent(0x0081, caption, style, exStyle, x, y, w, h, id); - - WORD creationDataLength = 0; - AppendData(&creationDataLength, sizeof(WORD)); - - } - - - void AddStatic(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - AddStandardComponent(0x0082, caption, style, exStyle, x, y, w, h, id); - - WORD creationDataLength = 0; - AppendData(&creationDataLength, sizeof(WORD)); - - } - - - void AddListBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - AddStandardComponent(0x0083, caption, style, exStyle, x, y, w, h, id); - - WORD creationDataLength = sizeof(WORD) + 5 * sizeof(WCHAR); - AppendData(&creationDataLength, sizeof(WORD)); - - AppendString("TEST"); - - } - - - void AddScrollBar(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - AddStandardComponent(0x0084, caption, style, exStyle, x, y, w, h, id); - - WORD creationDataLength = 0; - AppendData(&creationDataLength, sizeof(WORD)); - - } - - - void AddComboBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id) { - - AddStandardComponent(0x0085, caption, style, exStyle, x, y, w, h, id); - - WORD creationDataLength = 0; - AppendData(&creationDataLength, sizeof(WORD)); - - } - - - /** - * - * Returns a pointer to the Win32 dialog template which the object - * represents. This pointer may become invalid if additional components - * are added to the template. - * - */ - operator const DLGTEMPLATE*() const { - return dialogTemplate; - } - - virtual ~DialogTemplate() { - free(dialogTemplate); - } - -protected: - - void AddStandardComponent(WORD type, LPCSTR caption, DWORD style, DWORD exStyle, - int x, int y, int w, int h, WORD id, LPSTR font = NULL, WORD fontSize = 8) { - - DLGITEMTEMPLATE item; - - // DWORD align the beginning of the component data - - AlignData(sizeof(DWORD)); - - item.style = style; - if (font != NULL) { - item.style |= DS_SETFONT; - } - item.x = (short)x; - item.y = (short)y; - item.cx = (short)w; - item.cy = (short)h; - item.id = id; - - item.dwExtendedStyle = exStyle; - - AppendData(&item, sizeof(DLGITEMTEMPLATE)); - - WORD preType = 0xFFFF; - - AppendData(&preType, sizeof(WORD)); - AppendData(&type, sizeof(WORD)); - - AppendString(caption); - - if (font != NULL) { - AppendData(&fontSize, sizeof(WORD)); - AppendString(font); - } - - // Increment the component count - dialogTemplate->cdit++; - } - - - void AlignData(int size) { - - int paddingSize = usedBufferLength % size; - - if (paddingSize != 0) { - EnsureSpace(paddingSize); - usedBufferLength += paddingSize; - } - - } - - void AppendString(LPCSTR string) { - - int length = MultiByteToWideChar(CP_ACP, 0, string, -1, NULL, 0); - - WCHAR* wideString = (WCHAR*)malloc(sizeof(WCHAR) * length); - MultiByteToWideChar(CP_ACP, 0, string, -1, wideString, length); - - AppendData(wideString, length * sizeof(WCHAR)); - free(wideString); - - } - - void AppendData(const void* data, int dataLength) { - - EnsureSpace(dataLength); - - memcpy((char*)dialogTemplate + usedBufferLength, data, dataLength); - usedBufferLength += dataLength; - - } - - void EnsureSpace(int length) { - if (length + usedBufferLength > totalBufferLength) { - totalBufferLength += length * 2; - - void* newBuffer = malloc(totalBufferLength); - memcpy(newBuffer, dialogTemplate, usedBufferLength); - - free(dialogTemplate); - dialogTemplate = (DLGTEMPLATE*)newBuffer; - } - } - -private: - - DLGTEMPLATE* dialogTemplate; - - int totalBufferLength; - int usedBufferLength; - -}; - - -struct PromptParams { - const char* message; - const char* title; -}; - -/** - * Constants for controls. - */ -#define IDC_MESSAGE 1000 -#define IDC_BUTTON0 2000 - -INT_PTR CALLBACK PromptDlgProc(HWND hDlg, UINT msg, - WPARAM wParam, LPARAM lParam) { - switch(msg) { - case WM_INITDIALOG: - { - PromptParams *params = (PromptParams*)lParam; - ::SetWindowTextA(::GetDlgItem(hDlg, IDC_MESSAGE), params->message); - - ::SetFocus(::GetDlgItem(hDlg, IDC_BUTTON0)); - - SetWindowTextA(hDlg, params->title); - - HFONT hfont = - CreateFontA(16, 0, 0, 0, FW_NORMAL, - FALSE, FALSE, FALSE, - ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS, - PROOF_QUALITY, FIXED_PITCH | FF_MODERN, "Courier New"); - - SendDlgItemMessage(hDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE,0)); - - - break; - } - case WM_COMMAND: - { - int choiceNumber = LOWORD(wParam) - IDC_BUTTON0; - if ((choiceNumber >= 0) && (choiceNumber < 10)) { - EndDialog(hDlg, choiceNumber); - return TRUE; - } - } - - break; - - case WM_NCDESTROY: - // Under SDL 1.2.6 we get a NCDESTROY message for no reason and the - // window is immediately closed. This is here to debug the problem. - (void)0; - break; - - } - - return FALSE; -} - -}; // namespace _internal - - -using namespace _internal; - -/** - * Show a dialog prompt. - */ -static int guiPrompt( - const char* windowTitle, - const char* prompt, - const char** choice, - int numChoices) { - - int width = 280; - int height = 128; - - const int buttonSpacing = 2; - const int buttonWidth = - (width - buttonSpacing * 2 - - buttonSpacing * (numChoices - 1)) / numChoices; - const int buttonHeight = 13; - - - DialogTemplate dialogTemplate( - windowTitle, - WS_CAPTION | DS_CENTER | WS_SYSMENU, - 10, 10, width, height, - "Tahoma"); - - dialogTemplate.AddEditBox( - "Edit", WS_VISIBLE | ES_READONLY | ES_OEMCONVERT | ES_MULTILINE | WS_TABSTOP, WS_EX_STATICEDGE, - 2, 2, width - 4, height - buttonHeight - 7, IDC_MESSAGE); - - int i; - for (i = 0; i < numChoices; i++) { - - int x = buttonSpacing + i * (buttonWidth + buttonSpacing); - int y = height - buttonHeight - buttonSpacing; - - dialogTemplate.AddButton(choice[i], WS_VISIBLE | WS_TABSTOP, 0, - x, y, buttonWidth, buttonHeight, IDC_BUTTON0 + (WORD)i); - - } - - // Convert all single \n characters to \r\n for proper printing - int strLen = 0; - const char* pStr = prompt; - - while (*pStr != '\0') { - if ((*pStr == '\n') && (pStr != prompt)) { - if (*(pStr - 1) != '\r') { - ++strLen; - } - } - ++strLen; - ++pStr; - } - - char* newStr = (char*)malloc(strLen + 1); - - const char* pStr2 = prompt; - char* pNew = newStr; - - while (*pStr2 != '\0') { - if ((*pStr2 == '\n') && (pStr2 != prompt)) { - if (*(pStr2 - 1) != '\r') { - *pNew = '\r'; - ++pNew; - } - } - *pNew = *pStr2; - ++pNew; - ++pStr2; - } - - *pNew = '\0'; - - PromptParams params; - params.message = newStr;; - params.title = windowTitle; - - HMODULE module = GetModuleHandle(0); - int ret = DialogBoxIndirectParam(module, dialogTemplate, NULL, (DLGPROC) PromptDlgProc, (DWORD)¶ms); - - free(newStr); - - /* - For debugging when DialogBoxIndirectParam fails: - - // The last error value. (Which is preserved across the call). - DWORD lastErr = GetLastError(); - - // The decoded message from FormatMessage - LPTSTR formatMsg = NULL; - - if (NULL == formatMsg) { - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - lastErr, - 0, - (LPTSTR)&formatMsg, - 0, - NULL); - } - - // Make sure the message got translated into something. - LPTSTR realLastErr; - if (NULL != formatMsg) { - realLastErr = formatMsg; - } else { - realLastErr = "Last error code does not exist."; - } - - // Get rid of the allocated memory from FormatMessage. - if (NULL != formatMsg) { - LocalFree((LPVOID)formatMsg); - } - */ - - return ret; -} - -#endif - - -/** - * Show a prompt on stdout - */ -static int textPrompt( - const char* windowTitle, - const char* prompt, - const char** choice, - int numChoices) { - - printf("\n___________________________________________________\n"); - printf("%s\n", windowTitle); - printf("%s", prompt); - - if (numChoices > 10) { - numChoices = 10; - } - - int c = -1; - if (numChoices > 1) { - printf("\n"); - printf("Choose an option by number:"); - - while ((c < 0) || (c >= numChoices)) { - printf("\n"); - - for (int i = 0; i < numChoices; i++) { - if (numChoices <= 3) { - printf(" (%d) %s ", i, choice[i]); - } else { - printf(" (%d) %s\n", i, choice[i]); - } - } - - printf("\n> "); - c = _getch() - '0'; - - if ((c < 0) || (c >= numChoices)) { - printf("'%d' is not a valid choice.", c); - } else { - printf("%d", c); - } - } - - } else if (numChoices == 1) { - - printf("\nPress any key for '%s'...", choice[0]); - _getch(); - c = 0; - - } else { - - printf("\nPress any key..."); - _getch(); - c = 0; - } - - printf("\n___________________________________________________\n"); - return c; -} - -#ifdef G3D_OSX - -// See http://developer.apple.com/documentation/Carbon/Reference/Carbon_Event_Manager_Ref/index.html - -#define CARBON_COMMANDID_START 128 -#define CARBON_BUTTON_SPACING 12 -#define CARBON_BUTTON_HEIGHT 20 -#define CARBON_BUTTON_MINWIDTH 69 -#define CARBON_WINDOW_PADDING 20 - -struct CallbackData { - WindowRef refWindow; - - /** Index of this particular button */ - int myIndex; - - /** Buttons store their index into here when pressed. */ - int* whichButton; -}; - -/** - Assumes that userData is a pointer to a carbon_evt_data_t. - - */ -static pascal OSStatus DoCommandEvent(EventHandlerCallRef handlerRef, EventRef event, void* userData) { - // See http://developer.apple.com/documentation/Carbon/Conceptual/HandlingWindowsControls/index.html - - CallbackData& callbackData = *(CallbackData*)userData; - -# pragma unused(handlerRef) - - callbackData.whichButton[0] = callbackData.myIndex; - - // If we get here we can close the window - QuitAppModalLoopForWindow(callbackData.refWindow); - - // Return noErr to indicate that we handled the event - return noErr; -} - -static int guiPrompt -(const char* windowTitle, - const char* prompt, - const char** choice, - int numChoices) { - - WindowRef window; - - int iNumButtonRows = 0; - int iButtonWidth = -1; - OSStatus err = noErr; - - // Determine number of rows of buttons - while (iButtonWidth < CARBON_BUTTON_MINWIDTH) { - ++iNumButtonRows; - iButtonWidth = - (550 - (CARBON_WINDOW_PADDING*2 + - (CARBON_BUTTON_SPACING*numChoices))) / - (numChoices/iNumButtonRows); - } - - // Window Variables - Rect rectWin = {0, 0, 200 + ((iNumButtonRows-1) * (CARBON_BUTTON_HEIGHT+CARBON_BUTTON_SPACING)), 550}; // top, left, bottom, right - CFStringRef szWindowTitle = CFStringCreateWithCString(kCFAllocatorDefault, windowTitle, kCFStringEncodingUTF8); - - window = NULL; - - err = CreateNewWindow(kMovableAlertWindowClass, kWindowStandardHandlerAttribute|kWindowCompositingAttribute, &rectWin, &window); - err = SetWindowTitleWithCFString(window, szWindowTitle); - err = SetThemeWindowBackground(window, kThemeBrushAlertBackgroundActive, false); - assert(err == noErr); - - // Event Handler Variables - EventTypeSpec buttonSpec[] = {{ kEventClassControl, kEventControlHit }, { kEventClassCommand, kEventCommandProcess }}; - EventHandlerUPP buttonHandler = NewEventHandlerUPP(DoCommandEvent); - - // Static Text Variables - Rect rectStatic = {20, 20, 152, 530}; - CFStringRef szStaticText = CFStringCreateWithCString(kCFAllocatorDefault, prompt, kCFStringEncodingUTF8); - ControlRef refStaticText = NULL; - err = CreateStaticTextControl(window, &rectStatic, szStaticText, NULL, &refStaticText); - - // Button Variables - Rect bounds[numChoices]; - CFStringRef caption[numChoices]; - ControlRef button[numChoices]; - - int whichButton=-1; - CallbackData callbackData[numChoices]; - - // Create the Buttons and assign event handlers - for (int i = 0; i < numChoices; ++i) { - bounds[i].top = 160 + ((CARBON_BUTTON_HEIGHT+CARBON_BUTTON_SPACING)*(i%iNumButtonRows)); - bounds[i].right = 530 - ((iButtonWidth+CARBON_BUTTON_SPACING)*(i/iNumButtonRows)); - bounds[i].left = bounds[i].right - iButtonWidth; - bounds[i].bottom = bounds[i].top + CARBON_BUTTON_HEIGHT; - - // Convert the button captions to Apple strings - caption[i] = CFStringCreateWithCString(kCFAllocatorDefault, choice[i], kCFStringEncodingUTF8); - - err = CreatePushButtonControl(window, &bounds[i], caption[i], &button[i]); - assert(err == noErr); - - err = SetControlCommandID(button[i], CARBON_COMMANDID_START + i); - assert(err == noErr); - - callbackData[i].refWindow = window; - callbackData[i].myIndex = i; - callbackData[i].whichButton = &whichButton; - - err = InstallControlEventHandler(button[i], buttonHandler, - GetEventTypeCount(buttonSpec), buttonSpec, - &callbackData[i], NULL); - assert(err == noErr); - } - - // Show Dialog - err = RepositionWindow(window, NULL, kWindowCenterOnMainScreen); - ShowWindow(window); - BringToFront(window); - err = ActivateWindow(window, true); - - // Hack to get our window/process to the front... - ProcessSerialNumber psn = { 0, kCurrentProcess}; - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - SetFrontProcess (&psn); - - // Run in Modal State - err = RunAppModalLoopForWindow(window); - - // Dispose of Button Related Data - for (int i = 0; i < numChoices; ++i) { - // Dispose of controls - DisposeControl(button[i]); - - // Release CFStrings - CFRelease(caption[i]); - } - - // Dispose of Other Controls - DisposeControl(refStaticText); - - // Dispose of Event Handlers - DisposeEventHandlerUPP(buttonHandler); - - // Dispose of Window - DisposeWindow(window); - - // Release CFStrings - CFRelease(szWindowTitle); - CFRelease(szStaticText); - - // Return Selection - return whichButton; -} - -#endif - -int prompt( - const char* windowTitle, - const char* prompt, - const char** choice, - int numChoices, - bool useGui) { - - #ifdef G3D_WIN32 - if (useGui) { - // Build the message box - return guiPrompt(windowTitle, prompt, choice, numChoices); - } - #endif - - #ifdef G3D_OSX - if (useGui){ - //Will default to text prompt if numChoices > 4 - return guiPrompt(windowTitle, prompt, choice, numChoices); - } - #endif - return textPrompt(windowTitle, prompt, choice, numChoices); -} - - -void msgBox( - const std::string& message, - const std::string& title) { - - const char *choice[] = {"Ok"}; - prompt(title.c_str(), message.c_str(), choice, 1, true); -} - -#ifndef G3D_WIN32 - #undef _getch -#endif - -};// namespace - diff --git a/externals/g3dlite/G3D.lib/source/stringutils.cpp b/externals/g3dlite/G3D.lib/source/stringutils.cpp deleted file mode 100644 index a21fc1f377c..00000000000 --- a/externals/g3dlite/G3D.lib/source/stringutils.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/** - @file stringutils.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - - @created 2000-09-09 - @edited 2008-01-10 -*/ - -#include "G3D/platform.h" -#include "G3D/stringutils.h" -#include "G3D/BinaryInput.h" -#include - -namespace G3D { - -#ifdef _MSC_VER - // disable: "C++ exception handler used" -# pragma warning (push) -# pragma warning (disable : 4530) -#endif -#ifdef G3D_WIN32 - const char* NEWLINE = "\r\n"; -#else - const char* NEWLINE = "\n"; - static bool iswspace(int ch) { return (ch==' ' || ch=='\t' || ch=='\n'); } -#endif - -bool beginsWith( - const std::string& test, - const std::string& pattern) { - - if (test.size() >= pattern.size()) { - for (int i = 0; i < (int)pattern.size(); ++i) { - if (pattern[i] != test[i]) { - return false; - } - } - return true; - } else { - return false; - } -} - - -bool endsWith( - const std::string& test, - const std::string& pattern) { - - if (test.size() >= pattern.size()) { - int te = test.size() - 1; - int pe = pattern.size() - 1; - for (int i = pattern.size() - 1; i >= 0; --i) { - if (pattern[pe - i] != test[te - i]) { - return false; - } - } - return true; - } else { - return false; - } -} - - -std::string wordWrap( - const std::string& input, - int numCols) { - - std::string output; - size_t c = 0; - int len; - - // Don't make lines less than this length - int minLength = numCols / 4; - size_t inLen = input.size(); - - bool first = true; - while (c < inLen) { - if (first) { - first = false; - } else { - output += NEWLINE; - } - - if ((int)inLen - (int)c - 1 < numCols) { - // The end - output += input.substr(c, inLen - c); - break; - } - - len = numCols; - - // Look at character c + numCols, see if it is a space. - while ((len > minLength) && - (input[c + len] != ' ')) { - len--; - } - - if (len == minLength) { - // Just crop - len = numCols; - - } - - output += input.substr(c, len); - c += len; - if (c < input.size()) { - // Collapse multiple spaces. - while ((input[c] == ' ') && (c < input.size())) { - c++; - } - } - } - - return output; -} - - -int stringCompare( - const std::string& s1, - const std::string& s2) { - - return stringPtrCompare(&s1, &s2); -} - - -int stringPtrCompare( - const std::string* s1, - const std::string* s2) { - - return s1->compare(*s2); -} - - -std::string toUpper(const std::string& x) { - std::string result = x; - std::transform(result.begin(), result.end(), result.begin(), toupper); - return result; -} - - -std::string toLower(const std::string& x) { - std::string result = x; - std::transform(result.begin(), result.end(), result.begin(), tolower); - return result; -} - - -Array stringSplit( - const std::string& x, - char splitChar) { - - Array out; - - // Pointers to the beginning and end of the substring - const char* start = x.c_str(); - const char* stop = start; - - while ((stop = strchr(start, splitChar))) { - out.append(std::string(start, stop - start)); - start = stop + 1; - } - - // Append the last one - out.append(std::string(start)); - - return out; -} - - -std::string stringJoin( - const Array& a, - char joinChar) { - - std::string out; - - for (int i = 0; i < (int)a.size() - 1; ++i) { - out += a[i] + joinChar; - } - - if (a.size() > 0) { - return out + a.last(); - } else { - return out; - } -} - - -std::string stringJoin( - const Array& a, - const std::string& joinStr) { - - std::string out; - - for (int i = 0; i < (int)a.size() - 1; ++i) { - out += a[i] + joinStr; - } - - if (a.size() > 0) { - return out + a.last(); - } else { - return out; - } -} - - -std::string trimWhitespace( - const std::string& s) { - - size_t left = 0; - - // Trim from left - while ((left < s.length()) && iswspace(s[left])) { - ++left; - } - - int right = s.length() - 1; - // Trim from right - while ((right > (int)left) && iswspace(s[right])) { - --right; - } - - return s.substr(left, right - left + 1); -} - -}; // namespace - -#undef NEWLINE -#ifdef _MSC_VER -# pragma warning (pop) -#endif diff --git a/externals/g3dlite/G3D.lib/source/uint128.cpp b/externals/g3dlite/G3D.lib/source/uint128.cpp deleted file mode 100644 index 450009a5cff..00000000000 --- a/externals/g3dlite/G3D.lib/source/uint128.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/** - @file uint128.cpp - - @maintainer Morgan McGuire, matrix@graphics3d.com - @author Kyle Whitson - - @created 2008-07-17 - @edited 2008-07-17 - */ - -#include "G3D/uint128.h" - -namespace G3D { - -/** Adds two 64-bit integers, placing the result and the overflow into 64-bit integers.*/ -static void addAndCarry(const uint64& _a, const uint64& _b, uint64& carry, uint64& result) { - - // Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros. - // This eliminates the need to and with 0xFFFFFFFF. - uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32}; - uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32}; - - uint64 tmp = uint64(a[0]) + b[0]; - - result = tmp & 0xFFFFFFFF; - uint32 c = tmp >> 32; - - tmp = uint64(c) + a[1] + b[1]; - result += tmp << 32; - carry = (tmp >> 32); -} - -/** Multiplies two unsigned 64-bit integers, placing the result into one 64-bit int and the overflow into another.*/ -void multiplyAndCarry(const uint64& _a, const uint64& _b, uint64& carry, uint64& result) { - - // Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros. - // This eliminates the need to and with 0xFFFFFFFF. - uint32 a [2] = {_a & 0xFFFFFFFF, _a >> 32}; - uint32 b [2] = {_b & 0xFFFFFFFF, _b >> 32}; - - uint64 prod [2][2]; - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 2; ++j) { - prod[i][j] = uint64(a[i]) * b[j]; - } - } - - // The product of the low bits of a and b will always fit into the result - result = prod[0][0]; - - // The product of the high bits of a and b will never fit into the result - carry = prod[1][1]; - - // The high 32 bits of prod[0][1] and prod[1][0] will never fit into the result - carry += prod[0][1] >> 32; - carry += prod[1][0] >> 32; - - uint64 tmp; - addAndCarry(result, (prod[0][1] << 32), tmp, result); - carry += tmp; - addAndCarry(result, (prod[1][0] << 32), tmp, result); - carry += tmp; -} - - -uint128::uint128(const uint64& hi, const uint64& lo) : hi(hi), lo(lo) { -} - -uint128::uint128(const uint64& lo) : hi(0), lo(lo) { -} - -uint128& uint128::operator+=(const uint128& x) { - - G3D::uint64 carry; - addAndCarry(lo, x.lo, carry, lo); - - // Adding the carry will change hi. Save the old hi bits in case this == x. - const uint64 xHi = x.hi; - hi += carry; - hi += xHi; - return *this; -} - -uint128& uint128::operator*=(const uint128& x) { - - // The low bits will get overwritten when doing the multiply, so back up both (in case &x == this) - const uint64 oldLo = lo; - const uint64 oldXLo = x.lo; - - G3D::uint64 carry; - multiplyAndCarry(oldLo, oldXLo, carry, lo); - - // Overflow doesn't matter here because the result is going into hi - any overflow will exceed the capacity of a 128-bit number - // Note: hi * x.hi will always overflow, since (x * 2^64) * (y * 2^64) = x*y*(2^128). The largest number expressable in 128 bits is - // 2^128 - 1. - hi = carry + (oldLo * x.hi) + (hi * oldXLo); - - return *this; -} - -uint128& uint128::operator^=(const uint128& x) { - hi ^= x.hi; - lo ^= x.lo; - return *this; -} - -uint128& uint128::operator&=(const uint128& x) { - hi &= x.hi; - lo &= x.lo; - return *this; -} - -uint128& uint128::operator|=(const uint128& x) { - hi |= x.hi; - lo |= x.lo; - return *this; -} - -bool uint128::operator==(const uint128& x) { - return (hi == x.hi) && (lo == x.lo); -} - -uint128& uint128::operator>>=(const int x) { - - //Before shifting, mask out the bits that will be shifted out of hi. - //Put a 1 in the first bit that will not be lost in the shift, then subtract 1 to get the mask. - uint64 mask = ((uint64)1L << x) - 1; - uint64 tmp = hi & mask; - hi >>= x; - - //Shift lo and add the bits shifted down from hi - lo = (lo >> x) + (tmp << (64 - x)); - - return *this; -} - -uint128& uint128::operator<<=(const int x) { - - //Before shifting, mask out the bits that will be shifted out of lo. - //Put a 1 in the last bit that will be lost in the shift, then subtract 1 to get the logical inverse of the mask. - //A bitwise NOT will then produce the correct mask. - uint64 mask = ~((((uint64)1L) << (64 - x)) - 1); - uint64 tmp = lo & mask; - lo <<= x; - - //Shift hi and add the bits shifted up from lo - hi = (hi << x) + (tmp >> (64 - x)); - - return *this; -} - -uint128 uint128::operator&(const uint128& x) { - return uint128(hi & x.hi, lo & x.lo); -} -} diff --git a/dep/include/g3dlite/G3D/AABox.h b/externals/g3dlite/G3D/AABox.h similarity index 100% rename from dep/include/g3dlite/G3D/AABox.h rename to externals/g3dlite/G3D/AABox.h diff --git a/dep/include/g3dlite/G3D/Any.h b/externals/g3dlite/G3D/Any.h similarity index 100% rename from dep/include/g3dlite/G3D/Any.h rename to externals/g3dlite/G3D/Any.h diff --git a/dep/include/g3dlite/G3D/AnyVal.h b/externals/g3dlite/G3D/AnyVal.h similarity index 100% rename from dep/include/g3dlite/G3D/AnyVal.h rename to externals/g3dlite/G3D/AnyVal.h diff --git a/dep/include/g3dlite/G3D/AreaMemoryManager.h b/externals/g3dlite/G3D/AreaMemoryManager.h similarity index 100% rename from dep/include/g3dlite/G3D/AreaMemoryManager.h rename to externals/g3dlite/G3D/AreaMemoryManager.h diff --git a/dep/include/g3dlite/G3D/Array.h b/externals/g3dlite/G3D/Array.h similarity index 100% rename from dep/include/g3dlite/G3D/Array.h rename to externals/g3dlite/G3D/Array.h diff --git a/dep/include/g3dlite/G3D/AtomicInt32.h b/externals/g3dlite/G3D/AtomicInt32.h similarity index 100% rename from dep/include/g3dlite/G3D/AtomicInt32.h rename to externals/g3dlite/G3D/AtomicInt32.h diff --git a/dep/include/g3dlite/G3D/BinaryFormat.h b/externals/g3dlite/G3D/BinaryFormat.h similarity index 100% rename from dep/include/g3dlite/G3D/BinaryFormat.h rename to externals/g3dlite/G3D/BinaryFormat.h diff --git a/dep/include/g3dlite/G3D/BinaryInput.h b/externals/g3dlite/G3D/BinaryInput.h similarity index 100% rename from dep/include/g3dlite/G3D/BinaryInput.h rename to externals/g3dlite/G3D/BinaryInput.h diff --git a/dep/include/g3dlite/G3D/BinaryOutput.h b/externals/g3dlite/G3D/BinaryOutput.h similarity index 100% rename from dep/include/g3dlite/G3D/BinaryOutput.h rename to externals/g3dlite/G3D/BinaryOutput.h diff --git a/dep/include/g3dlite/G3D/BoundsTrait.h b/externals/g3dlite/G3D/BoundsTrait.h similarity index 100% rename from dep/include/g3dlite/G3D/BoundsTrait.h rename to externals/g3dlite/G3D/BoundsTrait.h diff --git a/dep/include/g3dlite/G3D/Box.h b/externals/g3dlite/G3D/Box.h similarity index 100% rename from dep/include/g3dlite/G3D/Box.h rename to externals/g3dlite/G3D/Box.h diff --git a/dep/include/g3dlite/G3D/Box2D.h b/externals/g3dlite/G3D/Box2D.h similarity index 100% rename from dep/include/g3dlite/G3D/Box2D.h rename to externals/g3dlite/G3D/Box2D.h diff --git a/dep/include/g3dlite/G3D/BumpMapPreprocess.h b/externals/g3dlite/G3D/BumpMapPreprocess.h similarity index 100% rename from dep/include/g3dlite/G3D/BumpMapPreprocess.h rename to externals/g3dlite/G3D/BumpMapPreprocess.h diff --git a/dep/include/g3dlite/G3D/Capsule.h b/externals/g3dlite/G3D/Capsule.h similarity index 100% rename from dep/include/g3dlite/G3D/Capsule.h rename to externals/g3dlite/G3D/Capsule.h diff --git a/dep/include/g3dlite/G3D/CollisionDetection.h b/externals/g3dlite/G3D/CollisionDetection.h similarity index 100% rename from dep/include/g3dlite/G3D/CollisionDetection.h rename to externals/g3dlite/G3D/CollisionDetection.h diff --git a/dep/include/g3dlite/G3D/Color1.h b/externals/g3dlite/G3D/Color1.h similarity index 100% rename from dep/include/g3dlite/G3D/Color1.h rename to externals/g3dlite/G3D/Color1.h diff --git a/dep/include/g3dlite/G3D/Color1uint8.h b/externals/g3dlite/G3D/Color1uint8.h similarity index 100% rename from dep/include/g3dlite/G3D/Color1uint8.h rename to externals/g3dlite/G3D/Color1uint8.h diff --git a/dep/include/g3dlite/G3D/Color3.h b/externals/g3dlite/G3D/Color3.h similarity index 100% rename from dep/include/g3dlite/G3D/Color3.h rename to externals/g3dlite/G3D/Color3.h diff --git a/dep/include/g3dlite/G3D/Color3uint8.h b/externals/g3dlite/G3D/Color3uint8.h similarity index 100% rename from dep/include/g3dlite/G3D/Color3uint8.h rename to externals/g3dlite/G3D/Color3uint8.h diff --git a/dep/include/g3dlite/G3D/Color4.h b/externals/g3dlite/G3D/Color4.h similarity index 100% rename from dep/include/g3dlite/G3D/Color4.h rename to externals/g3dlite/G3D/Color4.h diff --git a/dep/include/g3dlite/G3D/Color4uint8.h b/externals/g3dlite/G3D/Color4uint8.h similarity index 100% rename from dep/include/g3dlite/G3D/Color4uint8.h rename to externals/g3dlite/G3D/Color4uint8.h diff --git a/dep/include/g3dlite/G3D/Cone.h b/externals/g3dlite/G3D/Cone.h similarity index 100% rename from dep/include/g3dlite/G3D/Cone.h rename to externals/g3dlite/G3D/Cone.h diff --git a/dep/include/g3dlite/G3D/ConvexPolyhedron.h b/externals/g3dlite/G3D/ConvexPolyhedron.h similarity index 100% rename from dep/include/g3dlite/G3D/ConvexPolyhedron.h rename to externals/g3dlite/G3D/ConvexPolyhedron.h diff --git a/dep/include/g3dlite/G3D/CoordinateFrame.h b/externals/g3dlite/G3D/CoordinateFrame.h similarity index 100% rename from dep/include/g3dlite/G3D/CoordinateFrame.h rename to externals/g3dlite/G3D/CoordinateFrame.h diff --git a/dep/include/g3dlite/G3D/Crypto.h b/externals/g3dlite/G3D/Crypto.h similarity index 100% rename from dep/include/g3dlite/G3D/Crypto.h rename to externals/g3dlite/G3D/Crypto.h diff --git a/dep/include/g3dlite/G3D/Cylinder.h b/externals/g3dlite/G3D/Cylinder.h similarity index 100% rename from dep/include/g3dlite/G3D/Cylinder.h rename to externals/g3dlite/G3D/Cylinder.h diff --git a/dep/include/g3dlite/G3D/EqualsTrait.h b/externals/g3dlite/G3D/EqualsTrait.h similarity index 100% rename from dep/include/g3dlite/G3D/EqualsTrait.h rename to externals/g3dlite/G3D/EqualsTrait.h diff --git a/dep/include/g3dlite/G3D/G3D.h b/externals/g3dlite/G3D/G3D.h similarity index 100% rename from dep/include/g3dlite/G3D/G3D.h rename to externals/g3dlite/G3D/G3D.h diff --git a/dep/include/g3dlite/G3D/G3DAll.h b/externals/g3dlite/G3D/G3DAll.h similarity index 100% rename from dep/include/g3dlite/G3D/G3DAll.h rename to externals/g3dlite/G3D/G3DAll.h diff --git a/dep/include/g3dlite/G3D/G3DGameUnits.h b/externals/g3dlite/G3D/G3DGameUnits.h similarity index 100% rename from dep/include/g3dlite/G3D/G3DGameUnits.h rename to externals/g3dlite/G3D/G3DGameUnits.h diff --git a/dep/include/g3dlite/G3D/GCamera.h b/externals/g3dlite/G3D/GCamera.h similarity index 100% rename from dep/include/g3dlite/G3D/GCamera.h rename to externals/g3dlite/G3D/GCamera.h diff --git a/dep/include/g3dlite/G3D/GImage.h b/externals/g3dlite/G3D/GImage.h similarity index 100% rename from dep/include/g3dlite/G3D/GImage.h rename to externals/g3dlite/G3D/GImage.h diff --git a/dep/include/g3dlite/G3D/GLight.h b/externals/g3dlite/G3D/GLight.h similarity index 100% rename from dep/include/g3dlite/G3D/GLight.h rename to externals/g3dlite/G3D/GLight.h diff --git a/dep/include/g3dlite/G3D/GMutex.h b/externals/g3dlite/G3D/GMutex.h similarity index 100% rename from dep/include/g3dlite/G3D/GMutex.h rename to externals/g3dlite/G3D/GMutex.h diff --git a/dep/include/g3dlite/G3D/GThread.h b/externals/g3dlite/G3D/GThread.h similarity index 100% rename from dep/include/g3dlite/G3D/GThread.h rename to externals/g3dlite/G3D/GThread.h diff --git a/dep/include/g3dlite/G3D/GUniqueID.h b/externals/g3dlite/G3D/GUniqueID.h similarity index 100% rename from dep/include/g3dlite/G3D/GUniqueID.h rename to externals/g3dlite/G3D/GUniqueID.h diff --git a/dep/include/g3dlite/G3D/HashTrait.h b/externals/g3dlite/G3D/HashTrait.h similarity index 100% rename from dep/include/g3dlite/G3D/HashTrait.h rename to externals/g3dlite/G3D/HashTrait.h diff --git a/dep/include/g3dlite/G3D/Image1.h b/externals/g3dlite/G3D/Image1.h similarity index 100% rename from dep/include/g3dlite/G3D/Image1.h rename to externals/g3dlite/G3D/Image1.h diff --git a/dep/include/g3dlite/G3D/Image1uint8.h b/externals/g3dlite/G3D/Image1uint8.h similarity index 100% rename from dep/include/g3dlite/G3D/Image1uint8.h rename to externals/g3dlite/G3D/Image1uint8.h diff --git a/dep/include/g3dlite/G3D/Image3.h b/externals/g3dlite/G3D/Image3.h similarity index 100% rename from dep/include/g3dlite/G3D/Image3.h rename to externals/g3dlite/G3D/Image3.h diff --git a/dep/include/g3dlite/G3D/Image3uint8.h b/externals/g3dlite/G3D/Image3uint8.h similarity index 100% rename from dep/include/g3dlite/G3D/Image3uint8.h rename to externals/g3dlite/G3D/Image3uint8.h diff --git a/dep/include/g3dlite/G3D/Image4.h b/externals/g3dlite/G3D/Image4.h similarity index 100% rename from dep/include/g3dlite/G3D/Image4.h rename to externals/g3dlite/G3D/Image4.h diff --git a/dep/include/g3dlite/G3D/Image4uint8.h b/externals/g3dlite/G3D/Image4uint8.h similarity index 100% rename from dep/include/g3dlite/G3D/Image4uint8.h rename to externals/g3dlite/G3D/Image4uint8.h diff --git a/dep/include/g3dlite/G3D/ImageFormat.h b/externals/g3dlite/G3D/ImageFormat.h similarity index 100% rename from dep/include/g3dlite/G3D/ImageFormat.h rename to externals/g3dlite/G3D/ImageFormat.h diff --git a/dep/include/g3dlite/G3D/Intersect.h b/externals/g3dlite/G3D/Intersect.h similarity index 100% rename from dep/include/g3dlite/G3D/Intersect.h rename to externals/g3dlite/G3D/Intersect.h diff --git a/dep/include/g3dlite/G3D/KDTree.h b/externals/g3dlite/G3D/KDTree.h similarity index 100% rename from dep/include/g3dlite/G3D/KDTree.h rename to externals/g3dlite/G3D/KDTree.h diff --git a/dep/include/g3dlite/G3D/Line.h b/externals/g3dlite/G3D/Line.h similarity index 100% rename from dep/include/g3dlite/G3D/Line.h rename to externals/g3dlite/G3D/Line.h diff --git a/dep/include/g3dlite/G3D/LineSegment.h b/externals/g3dlite/G3D/LineSegment.h similarity index 100% rename from dep/include/g3dlite/G3D/LineSegment.h rename to externals/g3dlite/G3D/LineSegment.h diff --git a/dep/include/g3dlite/G3D/Log.h b/externals/g3dlite/G3D/Log.h similarity index 100% rename from dep/include/g3dlite/G3D/Log.h rename to externals/g3dlite/G3D/Log.h diff --git a/dep/include/g3dlite/G3D/Map2D.h b/externals/g3dlite/G3D/Map2D.h similarity index 100% rename from dep/include/g3dlite/G3D/Map2D.h rename to externals/g3dlite/G3D/Map2D.h diff --git a/dep/include/g3dlite/G3D/Matrix.h b/externals/g3dlite/G3D/Matrix.h similarity index 100% rename from dep/include/g3dlite/G3D/Matrix.h rename to externals/g3dlite/G3D/Matrix.h diff --git a/dep/include/g3dlite/G3D/Matrix2.h b/externals/g3dlite/G3D/Matrix2.h similarity index 100% rename from dep/include/g3dlite/G3D/Matrix2.h rename to externals/g3dlite/G3D/Matrix2.h diff --git a/dep/include/g3dlite/G3D/Matrix3.h b/externals/g3dlite/G3D/Matrix3.h similarity index 100% rename from dep/include/g3dlite/G3D/Matrix3.h rename to externals/g3dlite/G3D/Matrix3.h diff --git a/dep/include/g3dlite/G3D/Matrix4.h b/externals/g3dlite/G3D/Matrix4.h similarity index 100% rename from dep/include/g3dlite/G3D/Matrix4.h rename to externals/g3dlite/G3D/Matrix4.h diff --git a/dep/include/g3dlite/G3D/MemoryManager.h b/externals/g3dlite/G3D/MemoryManager.h similarity index 100% rename from dep/include/g3dlite/G3D/MemoryManager.h rename to externals/g3dlite/G3D/MemoryManager.h diff --git a/dep/include/g3dlite/G3D/MeshAlg.h b/externals/g3dlite/G3D/MeshAlg.h similarity index 100% rename from dep/include/g3dlite/G3D/MeshAlg.h rename to externals/g3dlite/G3D/MeshAlg.h diff --git a/dep/include/g3dlite/G3D/MeshBuilder.h b/externals/g3dlite/G3D/MeshBuilder.h similarity index 100% rename from dep/include/g3dlite/G3D/MeshBuilder.h rename to externals/g3dlite/G3D/MeshBuilder.h diff --git a/dep/include/g3dlite/G3D/NetAddress.h b/externals/g3dlite/G3D/NetAddress.h similarity index 100% rename from dep/include/g3dlite/G3D/NetAddress.h rename to externals/g3dlite/G3D/NetAddress.h diff --git a/dep/include/g3dlite/G3D/NetworkDevice.h b/externals/g3dlite/G3D/NetworkDevice.h similarity index 100% rename from dep/include/g3dlite/G3D/NetworkDevice.h rename to externals/g3dlite/G3D/NetworkDevice.h diff --git a/dep/include/g3dlite/G3D/ParseError.h b/externals/g3dlite/G3D/ParseError.h similarity index 100% rename from dep/include/g3dlite/G3D/ParseError.h rename to externals/g3dlite/G3D/ParseError.h diff --git a/dep/include/g3dlite/G3D/PhysicsFrame.h b/externals/g3dlite/G3D/PhysicsFrame.h similarity index 100% rename from dep/include/g3dlite/G3D/PhysicsFrame.h rename to externals/g3dlite/G3D/PhysicsFrame.h diff --git a/dep/include/g3dlite/G3D/Plane.h b/externals/g3dlite/G3D/Plane.h similarity index 100% rename from dep/include/g3dlite/G3D/Plane.h rename to externals/g3dlite/G3D/Plane.h diff --git a/dep/include/g3dlite/G3D/PointHashGrid.h b/externals/g3dlite/G3D/PointHashGrid.h similarity index 100% rename from dep/include/g3dlite/G3D/PointHashGrid.h rename to externals/g3dlite/G3D/PointHashGrid.h diff --git a/dep/include/g3dlite/G3D/PointKDTree.h b/externals/g3dlite/G3D/PointKDTree.h similarity index 100% rename from dep/include/g3dlite/G3D/PointKDTree.h rename to externals/g3dlite/G3D/PointKDTree.h diff --git a/dep/include/g3dlite/G3D/Pointer.h b/externals/g3dlite/G3D/Pointer.h similarity index 100% rename from dep/include/g3dlite/G3D/Pointer.h rename to externals/g3dlite/G3D/Pointer.h diff --git a/dep/include/g3dlite/G3D/PositionTrait.h b/externals/g3dlite/G3D/PositionTrait.h similarity index 100% rename from dep/include/g3dlite/G3D/PositionTrait.h rename to externals/g3dlite/G3D/PositionTrait.h diff --git a/dep/include/g3dlite/G3D/PrecomputedRandom.h b/externals/g3dlite/G3D/PrecomputedRandom.h similarity index 100% rename from dep/include/g3dlite/G3D/PrecomputedRandom.h rename to externals/g3dlite/G3D/PrecomputedRandom.h diff --git a/dep/include/g3dlite/G3D/Quat.h b/externals/g3dlite/G3D/Quat.h similarity index 100% rename from dep/include/g3dlite/G3D/Quat.h rename to externals/g3dlite/G3D/Quat.h diff --git a/dep/include/g3dlite/G3D/Quat.inl b/externals/g3dlite/G3D/Quat.inl similarity index 100% rename from dep/include/g3dlite/G3D/Quat.inl rename to externals/g3dlite/G3D/Quat.inl diff --git a/dep/include/g3dlite/G3D/Queue.h b/externals/g3dlite/G3D/Queue.h similarity index 100% rename from dep/include/g3dlite/G3D/Queue.h rename to externals/g3dlite/G3D/Queue.h diff --git a/dep/include/g3dlite/G3D/Random.h b/externals/g3dlite/G3D/Random.h similarity index 100% rename from dep/include/g3dlite/G3D/Random.h rename to externals/g3dlite/G3D/Random.h diff --git a/dep/include/g3dlite/G3D/Ray.h b/externals/g3dlite/G3D/Ray.h similarity index 100% rename from dep/include/g3dlite/G3D/Ray.h rename to externals/g3dlite/G3D/Ray.h diff --git a/dep/include/g3dlite/G3D/Rect2D.h b/externals/g3dlite/G3D/Rect2D.h similarity index 100% rename from dep/include/g3dlite/G3D/Rect2D.h rename to externals/g3dlite/G3D/Rect2D.h diff --git a/dep/include/g3dlite/G3D/ReferenceCount.h b/externals/g3dlite/G3D/ReferenceCount.h similarity index 100% rename from dep/include/g3dlite/G3D/ReferenceCount.h rename to externals/g3dlite/G3D/ReferenceCount.h diff --git a/dep/include/g3dlite/G3D/RegistryUtil.h b/externals/g3dlite/G3D/RegistryUtil.h similarity index 100% rename from dep/include/g3dlite/G3D/RegistryUtil.h rename to externals/g3dlite/G3D/RegistryUtil.h diff --git a/dep/include/g3dlite/G3D/Set.h b/externals/g3dlite/G3D/Set.h similarity index 100% rename from dep/include/g3dlite/G3D/Set.h rename to externals/g3dlite/G3D/Set.h diff --git a/dep/include/g3dlite/G3D/SmallArray.h b/externals/g3dlite/G3D/SmallArray.h similarity index 100% rename from dep/include/g3dlite/G3D/SmallArray.h rename to externals/g3dlite/G3D/SmallArray.h diff --git a/dep/include/g3dlite/G3D/Sphere.h b/externals/g3dlite/G3D/Sphere.h similarity index 100% rename from dep/include/g3dlite/G3D/Sphere.h rename to externals/g3dlite/G3D/Sphere.h diff --git a/dep/include/g3dlite/G3D/Spline.h b/externals/g3dlite/G3D/Spline.h similarity index 100% rename from dep/include/g3dlite/G3D/Spline.h rename to externals/g3dlite/G3D/Spline.h diff --git a/dep/include/g3dlite/G3D/Stopwatch.h b/externals/g3dlite/G3D/Stopwatch.h similarity index 100% rename from dep/include/g3dlite/G3D/Stopwatch.h rename to externals/g3dlite/G3D/Stopwatch.h diff --git a/dep/include/g3dlite/G3D/System.h b/externals/g3dlite/G3D/System.h similarity index 100% rename from dep/include/g3dlite/G3D/System.h rename to externals/g3dlite/G3D/System.h diff --git a/dep/include/g3dlite/G3D/Table.h b/externals/g3dlite/G3D/Table.h similarity index 100% rename from dep/include/g3dlite/G3D/Table.h rename to externals/g3dlite/G3D/Table.h diff --git a/dep/include/g3dlite/G3D/TextInput.h b/externals/g3dlite/G3D/TextInput.h similarity index 100% rename from dep/include/g3dlite/G3D/TextInput.h rename to externals/g3dlite/G3D/TextInput.h diff --git a/dep/include/g3dlite/G3D/TextOutput.h b/externals/g3dlite/G3D/TextOutput.h similarity index 100% rename from dep/include/g3dlite/G3D/TextOutput.h rename to externals/g3dlite/G3D/TextOutput.h diff --git a/dep/include/g3dlite/G3D/ThreadSet.h b/externals/g3dlite/G3D/ThreadSet.h similarity index 100% rename from dep/include/g3dlite/G3D/ThreadSet.h rename to externals/g3dlite/G3D/ThreadSet.h diff --git a/dep/include/g3dlite/G3D/Triangle.h b/externals/g3dlite/G3D/Triangle.h similarity index 100% rename from dep/include/g3dlite/G3D/Triangle.h rename to externals/g3dlite/G3D/Triangle.h diff --git a/dep/include/g3dlite/G3D/UprightFrame.h b/externals/g3dlite/G3D/UprightFrame.h similarity index 100% rename from dep/include/g3dlite/G3D/UprightFrame.h rename to externals/g3dlite/G3D/UprightFrame.h diff --git a/dep/include/g3dlite/G3D/Vector2.h b/externals/g3dlite/G3D/Vector2.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector2.h rename to externals/g3dlite/G3D/Vector2.h diff --git a/dep/include/g3dlite/G3D/Vector2.inl b/externals/g3dlite/G3D/Vector2.inl similarity index 100% rename from dep/include/g3dlite/G3D/Vector2.inl rename to externals/g3dlite/G3D/Vector2.inl diff --git a/dep/include/g3dlite/G3D/Vector2int16.h b/externals/g3dlite/G3D/Vector2int16.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector2int16.h rename to externals/g3dlite/G3D/Vector2int16.h diff --git a/dep/include/g3dlite/G3D/Vector3.h b/externals/g3dlite/G3D/Vector3.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector3.h rename to externals/g3dlite/G3D/Vector3.h diff --git a/dep/include/g3dlite/G3D/Vector3.inl b/externals/g3dlite/G3D/Vector3.inl similarity index 100% rename from dep/include/g3dlite/G3D/Vector3.inl rename to externals/g3dlite/G3D/Vector3.inl diff --git a/dep/include/g3dlite/G3D/Vector3int16.h b/externals/g3dlite/G3D/Vector3int16.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector3int16.h rename to externals/g3dlite/G3D/Vector3int16.h diff --git a/dep/include/g3dlite/G3D/Vector3int32.h b/externals/g3dlite/G3D/Vector3int32.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector3int32.h rename to externals/g3dlite/G3D/Vector3int32.h diff --git a/dep/include/g3dlite/G3D/Vector4.h b/externals/g3dlite/G3D/Vector4.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector4.h rename to externals/g3dlite/G3D/Vector4.h diff --git a/dep/include/g3dlite/G3D/Vector4.inl b/externals/g3dlite/G3D/Vector4.inl similarity index 100% rename from dep/include/g3dlite/G3D/Vector4.inl rename to externals/g3dlite/G3D/Vector4.inl diff --git a/dep/include/g3dlite/G3D/Vector4int8.h b/externals/g3dlite/G3D/Vector4int8.h similarity index 100% rename from dep/include/g3dlite/G3D/Vector4int8.h rename to externals/g3dlite/G3D/Vector4int8.h diff --git a/dep/include/g3dlite/G3D/WeakCache.h b/externals/g3dlite/G3D/WeakCache.h similarity index 100% rename from dep/include/g3dlite/G3D/WeakCache.h rename to externals/g3dlite/G3D/WeakCache.h diff --git a/dep/include/g3dlite/G3D/Welder.h b/externals/g3dlite/G3D/Welder.h similarity index 100% rename from dep/include/g3dlite/G3D/Welder.h rename to externals/g3dlite/G3D/Welder.h diff --git a/dep/include/g3dlite/G3D/WrapMode.h b/externals/g3dlite/G3D/WrapMode.h similarity index 100% rename from dep/include/g3dlite/G3D/WrapMode.h rename to externals/g3dlite/G3D/WrapMode.h diff --git a/dep/include/g3dlite/G3D/constants.h b/externals/g3dlite/G3D/constants.h similarity index 100% rename from dep/include/g3dlite/G3D/constants.h rename to externals/g3dlite/G3D/constants.h diff --git a/dep/include/g3dlite/G3D/debug.h b/externals/g3dlite/G3D/debug.h similarity index 100% rename from dep/include/g3dlite/G3D/debug.h rename to externals/g3dlite/G3D/debug.h diff --git a/dep/include/g3dlite/G3D/debugAssert.h b/externals/g3dlite/G3D/debugAssert.h similarity index 100% rename from dep/include/g3dlite/G3D/debugAssert.h rename to externals/g3dlite/G3D/debugAssert.h diff --git a/dep/include/g3dlite/G3D/debugPrintf.h b/externals/g3dlite/G3D/debugPrintf.h similarity index 100% rename from dep/include/g3dlite/G3D/debugPrintf.h rename to externals/g3dlite/G3D/debugPrintf.h diff --git a/dep/include/g3dlite/G3D/enumclass.h b/externals/g3dlite/G3D/enumclass.h similarity index 100% rename from dep/include/g3dlite/G3D/enumclass.h rename to externals/g3dlite/G3D/enumclass.h diff --git a/dep/include/g3dlite/G3D/fileutils.h b/externals/g3dlite/G3D/fileutils.h similarity index 100% rename from dep/include/g3dlite/G3D/fileutils.h rename to externals/g3dlite/G3D/fileutils.h diff --git a/dep/include/g3dlite/G3D/filter.h b/externals/g3dlite/G3D/filter.h similarity index 100% rename from dep/include/g3dlite/G3D/filter.h rename to externals/g3dlite/G3D/filter.h diff --git a/dep/include/g3dlite/G3D/format.h b/externals/g3dlite/G3D/format.h similarity index 100% rename from dep/include/g3dlite/G3D/format.h rename to externals/g3dlite/G3D/format.h diff --git a/dep/include/g3dlite/G3D/g3dfnmatch.h b/externals/g3dlite/G3D/g3dfnmatch.h similarity index 100% rename from dep/include/g3dlite/G3D/g3dfnmatch.h rename to externals/g3dlite/G3D/g3dfnmatch.h diff --git a/dep/include/g3dlite/G3D/g3dmath.h b/externals/g3dlite/G3D/g3dmath.h similarity index 100% rename from dep/include/g3dlite/G3D/g3dmath.h rename to externals/g3dlite/G3D/g3dmath.h diff --git a/dep/include/g3dlite/G3D/g3dmath.inl b/externals/g3dlite/G3D/g3dmath.inl similarity index 100% rename from dep/include/g3dlite/G3D/g3dmath.inl rename to externals/g3dlite/G3D/g3dmath.inl diff --git a/dep/include/g3dlite/G3D/platform.h b/externals/g3dlite/G3D/platform.h similarity index 100% rename from dep/include/g3dlite/G3D/platform.h rename to externals/g3dlite/G3D/platform.h diff --git a/dep/include/g3dlite/G3D/prompt.h b/externals/g3dlite/G3D/prompt.h similarity index 100% rename from dep/include/g3dlite/G3D/prompt.h rename to externals/g3dlite/G3D/prompt.h diff --git a/dep/include/g3dlite/G3D/serialize.h b/externals/g3dlite/G3D/serialize.h similarity index 100% rename from dep/include/g3dlite/G3D/serialize.h rename to externals/g3dlite/G3D/serialize.h diff --git a/dep/include/g3dlite/G3D/splinefunc.h b/externals/g3dlite/G3D/splinefunc.h similarity index 100% rename from dep/include/g3dlite/G3D/splinefunc.h rename to externals/g3dlite/G3D/splinefunc.h diff --git a/dep/include/g3dlite/G3D/stringutils.h b/externals/g3dlite/G3D/stringutils.h similarity index 100% rename from dep/include/g3dlite/G3D/stringutils.h rename to externals/g3dlite/G3D/stringutils.h diff --git a/dep/include/g3dlite/G3D/uint128.h b/externals/g3dlite/G3D/uint128.h similarity index 100% rename from dep/include/g3dlite/G3D/uint128.h rename to externals/g3dlite/G3D/uint128.h diff --git a/dep/include/g3dlite/G3D/units.h b/externals/g3dlite/G3D/units.h similarity index 100% rename from dep/include/g3dlite/G3D/units.h rename to externals/g3dlite/G3D/units.h diff --git a/dep/include/g3dlite/G3D/vectorMath.h b/externals/g3dlite/G3D/vectorMath.h similarity index 100% rename from dep/include/g3dlite/G3D/vectorMath.h rename to externals/g3dlite/G3D/vectorMath.h diff --git a/dep/src/g3dlite/Line.cpp b/externals/g3dlite/Line.cpp similarity index 100% rename from dep/src/g3dlite/Line.cpp rename to externals/g3dlite/Line.cpp diff --git a/dep/src/g3dlite/LineSegment.cpp b/externals/g3dlite/LineSegment.cpp similarity index 100% rename from dep/src/g3dlite/LineSegment.cpp rename to externals/g3dlite/LineSegment.cpp diff --git a/dep/src/g3dlite/Log.cpp b/externals/g3dlite/Log.cpp similarity index 100% rename from dep/src/g3dlite/Log.cpp rename to externals/g3dlite/Log.cpp diff --git a/dep/src/g3dlite/Matrix3.cpp b/externals/g3dlite/Matrix3.cpp similarity index 100% rename from dep/src/g3dlite/Matrix3.cpp rename to externals/g3dlite/Matrix3.cpp diff --git a/dep/src/g3dlite/Matrix4.cpp b/externals/g3dlite/Matrix4.cpp similarity index 100% rename from dep/src/g3dlite/Matrix4.cpp rename to externals/g3dlite/Matrix4.cpp diff --git a/dep/src/g3dlite/MemoryManager.cpp b/externals/g3dlite/MemoryManager.cpp similarity index 100% rename from dep/src/g3dlite/MemoryManager.cpp rename to externals/g3dlite/MemoryManager.cpp diff --git a/dep/src/g3dlite/Plane.cpp b/externals/g3dlite/Plane.cpp similarity index 100% rename from dep/src/g3dlite/Plane.cpp rename to externals/g3dlite/Plane.cpp diff --git a/dep/src/g3dlite/Quat.cpp b/externals/g3dlite/Quat.cpp similarity index 100% rename from dep/src/g3dlite/Quat.cpp rename to externals/g3dlite/Quat.cpp diff --git a/dep/src/g3dlite/Random.cpp b/externals/g3dlite/Random.cpp similarity index 100% rename from dep/src/g3dlite/Random.cpp rename to externals/g3dlite/Random.cpp diff --git a/dep/src/g3dlite/Ray.cpp b/externals/g3dlite/Ray.cpp similarity index 100% rename from dep/src/g3dlite/Ray.cpp rename to externals/g3dlite/Ray.cpp diff --git a/dep/src/g3dlite/ReferenceCount.cpp b/externals/g3dlite/ReferenceCount.cpp similarity index 100% rename from dep/src/g3dlite/ReferenceCount.cpp rename to externals/g3dlite/ReferenceCount.cpp diff --git a/dep/src/g3dlite/RegistryUtil.cpp b/externals/g3dlite/RegistryUtil.cpp similarity index 100% rename from dep/src/g3dlite/RegistryUtil.cpp rename to externals/g3dlite/RegistryUtil.cpp diff --git a/dep/src/g3dlite/Sphere.cpp b/externals/g3dlite/Sphere.cpp similarity index 100% rename from dep/src/g3dlite/Sphere.cpp rename to externals/g3dlite/Sphere.cpp diff --git a/dep/src/g3dlite/System.cpp b/externals/g3dlite/System.cpp similarity index 100% rename from dep/src/g3dlite/System.cpp rename to externals/g3dlite/System.cpp diff --git a/dep/src/g3dlite/TextInput.cpp b/externals/g3dlite/TextInput.cpp similarity index 100% rename from dep/src/g3dlite/TextInput.cpp rename to externals/g3dlite/TextInput.cpp diff --git a/dep/src/g3dlite/TextOutput.cpp b/externals/g3dlite/TextOutput.cpp similarity index 100% rename from dep/src/g3dlite/TextOutput.cpp rename to externals/g3dlite/TextOutput.cpp diff --git a/dep/src/g3dlite/Triangle.cpp b/externals/g3dlite/Triangle.cpp similarity index 100% rename from dep/src/g3dlite/Triangle.cpp rename to externals/g3dlite/Triangle.cpp diff --git a/dep/src/g3dlite/UprightFrame.cpp b/externals/g3dlite/UprightFrame.cpp similarity index 100% rename from dep/src/g3dlite/UprightFrame.cpp rename to externals/g3dlite/UprightFrame.cpp diff --git a/dep/src/g3dlite/Vector2.cpp b/externals/g3dlite/Vector2.cpp similarity index 100% rename from dep/src/g3dlite/Vector2.cpp rename to externals/g3dlite/Vector2.cpp diff --git a/dep/src/g3dlite/Vector3.cpp b/externals/g3dlite/Vector3.cpp similarity index 100% rename from dep/src/g3dlite/Vector3.cpp rename to externals/g3dlite/Vector3.cpp diff --git a/dep/src/g3dlite/Vector4.cpp b/externals/g3dlite/Vector4.cpp similarity index 100% rename from dep/src/g3dlite/Vector4.cpp rename to externals/g3dlite/Vector4.cpp diff --git a/dep/src/g3dlite/debugAssert.cpp b/externals/g3dlite/debugAssert.cpp similarity index 100% rename from dep/src/g3dlite/debugAssert.cpp rename to externals/g3dlite/debugAssert.cpp diff --git a/externals/g3dlite/doc-files/changelog.dox b/externals/g3dlite/doc-files/changelog.dox deleted file mode 100644 index fd52b99f271..00000000000 --- a/externals/g3dlite/doc-files/changelog.dox +++ /dev/null @@ -1,1872 +0,0 @@ -/** - @page changelog Change Log - -

- - Major version numbers introduce API changes that are not backwards - compatible. Minor versions are backwards compatible to the - previous major release, except for critical bug fixes. Deprecated functionality - will be supported until (at least) the next major release. - - -


- -

- Changes in 7.01: -

    -
  • Video file reading and writing via FFmpeg added -
  • Added computeBounds method to ArticulatedModel::Part that calls computeBounds on each TriList. Changed updateAll to automatically call computeBounds [Kyle] -
  • Added constructor to Matrix4 to construct a matrix from an upper-left 3x3 submatrix and an upper-right 3x1 submatrix [Kyle] -
  • Incompatible change: RegistryUtil functions now require an explicit value parameter instead of extracting the value from the key string. -
  • Incompatible change:GApp now calls the onLogic handler before the simulation handlers but after the user input and network handlers -
  • Incompatible change: Changed GHashCode and other functors to traits. See \link guidenewuser \endlink. Added typedefs and adapters to make this mostly backwards compatible. -
  • Added parallax occlusion mapping to G3D::SuperShader (specify Material::parallaxSteps > 1) -
  • Added normal mapping to G3D::SuperShader (specify Material::parallaxSteps == 0) -
  • G3D::Texture resizes textures that exceed the device maximum size -
  • G3D::Array now allows control over MIN_ELEMENTS and MIN_BYTES using template parameters -
  • Clarified G3D::Any file format in documentation -
  • G3D::Texture::PreProcess::gammaAdjust -
  • G3D::ShadowMap::lightProjection(), G3D::ShadowMap::lightFrame() -
  • Added Barycentric coordinates to CollisionDetection::isPointInTriangle -
  • G3D::RenderDevice::beginOpenGL, G3D::RenderDevice::endOpenGL -
  • PointAABSPTree::clearData -
  • AABSPTree -> KDTree -
  • GApp now allows the MidgetManager to process events in onEvent before the GApp::onEvent executes -
  • Added spotlight support to SuperShader -
  • Switched SuperShader to use ph -
  • Adjusted standard deviation used in G3D::GaussianBlur to provide smoother filtering -
  • Put HashTrait and EqualsTrait in their own headers separate from Table.h -
  • ArticulatedModel::facet -
  • Renamed GWindow to G3D::OSWindow -
  • ReferenceCountedPointer now asserts that the pointer is not NULL on method invocation -
  • G3D::ShadowMap now computes appropriate matrices for spot lights -
  • Added ImageFormat::convert [Danny and Kyle] -
  • 3- and 4- argument min and max -
  • G3D::GaussianBlur now correctly sets the output viewport -
  • G3D::Framebuffer::clear -
  • IFSModel and ArticulatedModel now load Princeton Shape Benchmark OFF files. -
  • G3D::Any CoordinateFrame now serialized using angles -
  • CameraControlWindow now prints angles in degrees -
  • ImageXXX classes now have a format() method -
  • OSWindow::create -
  • MeshAlg::toIndexedTriList now supports TRIANGLE_FAN input. -
  • Tuned Table and hash functions for performance [Kyle & Morgan] -
  • GEvent::toString -
  • G3D::TextInput now treats characters with ASCII code greater than 127 as symbols -
  • G3D::ThreadSet -
  • G3D::Texture::white -
  • G3D::Matrix4::upper3x3 -
  • G3D::Matrix4::homoMul -
  • ArticulateModel::fromFile now takes a Matrix4 instead of a CoordinateFrame to allow arbitrary linear transformations. -
  • ArticulatedModel::createCornellBox -
  • Material::createDiffuse -
  • ImageFormat::convert -
  • G3D::filenameBase -
  • Removed SDL_SysWMEvent, which was never supported by GEvent anyway -
  • Removed TextureFormat::SAME_AS_SCREEN to break dependence on OpenGL -
  • TextureFormat has been renamed to G3D::ImageFormat and moved into G3D.lib -
  • Added variable time control points to G3D::Spline -
  • Gui controls now have configureable GuiControl::setCaptionSize -
  • Gui controls now default to no indent if the caption is "" (use " " for indent with no caption) -
  • G3D::GuiContainer -
  • G3D::GThread::started -
  • buildg3d installation arguments changed--see -
  • G3D::Vector3int32 -
  • GuiButton now accepts an optional callback function/method -
  • FileDialog now accepts an extra "note" argument -
  • FileDialog::getFilename non-static to support subclassing -
  • System::currentDateString -
  • Expanded G3D::ArticulatedModel documentation -
  • Build system now executes on multiple processors (about 1.8x speedup for dual-core) -
  • Build system now caches dependencies (about 5x speedup for small incremental builds) -
  • Patched LOAD_EXTENSION to work around gcc pointer-to-function cast issues -
  • Tool buttons added to a G3D::GuiPane automatically align to the previous one. -
  • Added invisible GuiPane style -
  • G3D::uint128 [Kyle] -
  • Increased BSPMap rendering by 10% by reducing state changes -
  • Added prompt argument to FileDialog::getFilename -
  • G3D::PosedModel::getBoxBounds on an array -
  • G3D::PosedModel::getSphereBounds on an array -
  • Changed RenderDevice::screenshot to save .png instead of .jpg files -
  • G3D::SuperShader now supports a customMap and customConstant for experimenting with shaders. -
  • G3D::SuperShader now does not ever light the "back" of a bump-mapped poly, even if the bumps should create a light-facing surface -
  • G3D::Material promoted to its own class (was G3D::SuperShader::Material) -
  • G3D::Matrix2 -
  • G3D::VertexAndPixelShader::ArgList::size -
  • G3D::pathConcat -
  • G3D::WidgetManager::moveWidgetToBack -
  • SuperShader / NonShadowed.pix now uses arrays of lights instead of separate variables -
  • Reduced cost of release-mode Shader argument validation -
  • G3D::PosedModel::sortAndRender now performs view-frustum culling of objects -
  • G3D::Draw::lighting for visualizing light sources -
  • G3D::SuperShader::Pass::purgeCache -
  • G3D::GuiSlider::setRange -
  • G3D::GuiPane::addPane no longer takes a -
  • G3D::VertexAndPixelShader::ArgList::remove -
  • Optimized G3D::Matrix::pseudoInverse; now about 2x faster -
  • G3D::GLight::effectSphere -
  • G3D::GuiWindow::moveTo -
  • G3D::GuiWindow::setEnabled, enabled -
  • G3D::GuiButton now sizes to its caption -
  • G3D::GuiSlider now fires events on change and drag -
  • G3D::Shader arguments (in G3D::VertexAndPixelShader::ArgList) may now be "optional" -
  • G3D::GLight::point now has quadratic attenuation by default. -
  • G3D::ImageFormat::name -
  • g3dmath.h now includes inttypes.h on gcc and simulates it on visual studio -
  • G3D::RenderDevice::cullFace -
  • G3D::LineSegment2D::intersection -
  • G3D::BinaryInput::setEndian -
  • G3D::GEvent::MOUSE_BUTTON_CLICK -
  • Generalized ShadowMap to work with spotlights as well as directional lights -
  • G3D::GLCaps::supportsTexture, G3D::GLCaps::supportsRenderBuffer -
  • Opaque G3D::ArticulatedModels now support more than 2 non-shadow casting light sources -
  • Added proof symbol parsing to TextInput [Corey Taylor] -
  • Added G3D::AABox::corner() to match G3D::Box::corner() [Corey Taylor] -
  • OS X: G3D::CarbonWindow [Casey] -
  • OS X: iCompile now generates OS X application bundles and dmg files -
  • OS X build no longer depends on X11 -
  • G3D::FileDialog -
  • G3D::Table now allows overriding the default equality operator for keys -
  • Incompatible change: GApp::onBeforeSimulation now allows mutation of the timesteps -
  • Incompatible change: Merged GApp::simTime and idealSimTime (the sim time is now idealized) -
  • cmake now generates project files for Xcode, MinGW, and all Visual Studio versions [Corey Taylor] -
  • OS X: icompile and buildg3d now generate universal binaries on Intel machines -
  • G3D::PosedModel::objectSpaceTangents -
  • G3D::IFSModel::fromData -
  • G3D::MeshAlg::generateGrid -
  • G3D::BinaryOutput::ok() -
  • G3D::generateFilenameBase -
  • G3D::IFSModel::fromFile now defaults to not welding for improved performance -
  • G3D::IFSModel members are now protected to allow subclassing -
  • Removed G3D::uint in favor of G3D::uint32 [Corey Taylor] -
  • Added G3D::GMaterial(TextureRef) constructor -
  • Made G3D::GMaterial fields floats -
  • G3D::GuiControl::setCaption, G3D::GuiWindow::setCaption -
  • G3D::GuiControl can now be subclassed for custom user-defined controls -
  • G3D::GuiTheme::renderCanvas -
  • G3D::GuiTheme::pauseRendering, G3D::GuiTheme::resumeRendering -
  • G3D::PosedModel::sortAndRender -
  • G3D::Framebuffer can now attach cube map faces -
  • System::describeSystem now prints current working directory and application name -
  • Added /usr/local/-G3D dir- to system data file path [Kai Schroeder] -
  • Various patches for detecting new CPUs in System.cpp [Corey Taylor] -
  • g3d_Index macro now available in G3D::Shader GLSL code -
  • G3D::BackgroundWidget -
  • G3D::TriangleShape -
  • Fix: incompatible change OSWindow::Settings::asynchronous is now spelled correclty, with two "n"s -
  • Fix: Fixes for point-in-triangle and moving-sphere-fixed-tri; previous code projected onto the wrong axes, so barycentric coords were wrong for nearly vertical triangles. -
  • Fix: Changed some doubles to floats in G3D::Triangle -
  • Fix: Changed all of the isXXX(char) methods to take unsigned char arguments so that they can parse extended symbols -
  • Fix: AABSPTree::deserializeStructure was missing a return statement [Derex] -
  • Fix: Draw::plane was drawing the plane reflected through the origin [Macklin Chaffee] -
  • Fix: Added template parameters to friends in AABSPTree and PointAABSPTree [expiring_frog] -
  • Fix: System::findDataFile uses data directory set by GApp -
  • Fix: AtomicInt32 decrement returns int32 instead of uint32 -
  • Fix: OS X function keys now work correctly under CarbonWindow -
  • Fix: OS X modifier keys now work correctly under CarbonWindow -
  • Fix: OS X arrow keys now work correctly under CarbonWindow -
  • Fix: Rewrote buildg3d to fix many longstanding bugs, including mismatched 'bin' directories and confusion about the 'install' target -
  • Fix: gfxmeter reports now format correctly regardless of monitor width -
  • Fix: patch to initialize correctly on the Mesa library, which crashes when requesting DEPTH24_STENCIL8 -
  • Fix: stringSplit now works correctly for adjacent split characters [Akita Noek] -
  • Fix: Draw::axes labels now obey current viewport -
  • Fix: GuiWindow now loses focus when hidden -
  • Fix: GFont::draw2D now computes correct horizontal bounds on text -
  • Fix: GuiPane no longer renders when invisible -
  • Fix: Clicking off of all GuiWindows makes none of them have focus -
  • Fix: Win32Window now allows windows programmatically positioned anywhere on a multiple monitor screen -
  • Fix: Win32Window now does not fail when dragging a GL context between multiple monitors -
  • Fix: SuperShader now correctly lights bump-mapped surfaces in tangent space [Kyle Whitson] -
  • Fix: GuiPane now renders its caption -
  • Fix: Rect2D::border now grows the correct way (positive = grow) -
  • Fix: Added % operator to TextInput -
  • Fix: Added multi-line printing to GConsole -
  • Fix: G3D::Texture can now create empty cube maps -
  • Fix: G3D::Table iterator now correctly parameterized on hashfunction and equality function as well as key and value -
  • Fix: G3D::Table now passes Values by reference when setting them, avoiding one copy -
  • Fix: various Framebuffer/empty texture initialization bugs on ATI cards -
  • Fix: uniform arrays for GLSL -
  • Fix: All aliasing warnings have been fixed no longer needs -fno-strict-aliasing [Corey Taylor] -
  • Fix: [ 1829704 ] debugAssert in Array::operator[](unsigned int n) wrong -
  • Fix: GuiWindow::pack now recursively packs all child panes -
  • Fix: patch to continue build when javac isn't found on both windows and linux [Corey Taylor] -
  • Fix: [ 1599139 ] Fixes to make buildg3d work on non C:\ windows systems [Patrick Burke] -
  • Fix: Added faster overloads of GImage::stripAlpha() and GImage::insertRedAsAlpha() [Corey Taylor] -
  • Fix: GImage::save() with odd-widths bmp files [Corey Taylor] -
  • Fix: Draw::capule renders properly (capule was not visible) [Corey Taylor] -
  • Fix: Patched ShadowMap to work around ATI and OS X driver shadow map bugs. - Incompatible change:Required changing several interfaces to take ShadowMapRef arguments. -
  • Fix: GCamera::Frustum was facing backwards -
  • Fix: [ 1774479 ] texture glformats wrong (caused incorrect font rendering on Intel) -
  • Fix: ArticulatedModel static methods do not force loading of shaders unless an ArticulatedModel has actually been loaded. -
  • Fix: RenderDevice::setAlphaWrite/setColorWrite implemented correctly -
  • Fix: Implemented ImageFormat::fromCode -
  • Fix: [ 1766509 ] Texture doesn't handle 3D textures correctly -
  • Fix: Separate bool, float, and int back ends for GLSL shaders -
- -
-

- Changes in 7.00: -

    -
  • Upgraded to iCompile 0.5.3. Requires users to delete their old ice.txt and ~/.icompile files -
  • Key to toggle the user camera is now F2 (was Tab) -
  • Support for g++ 4.1 [Corey] -
  • Patches for 64-bit compilation [Corey] -
  • WinMain is now compiled as C++ code (fixed some "manifest" errors on certain VC8 installations) -
  • G3D::ShadowMap -
  • Cleaned up and documented G3D::GCamera project/unproject API [Jeff Marsceill] -
  • Made G3D::MD2Model::Pose easier to use -
  • G3D::Matrix -
  • Added G3D::Texture methods for reading back color and depth textures -
  • G3D::RenderDevice::getFixedFunctionLighting -
  • G3D::debugPrintf -> G3D::consolePrintf -
  • G3D::GApp::debugPrintf -> G3D::screenPrintf -
  • Reduced ArticulatedModel and MD2Model push/popState calls -
  • G3D::Shader now defines platform and graphics vendor macros -
  • User camera control requires right mouse click to move -
  • G3D::AnyVal::fromFile, G3D::AnyVal::load, G3D::AnyVal::save -
  • G3D::AnyVal now uses copy-on-mutate for fast Array/Table copies -
  • G3D::AnyVal no longer separates table entries with ";" -
  • G3D::AnyVal now provides casts to basic data types -
  • G3D::AnyVal G3D::Rect2D and G3D::AABox types -
  • G3D::NetListener, G3D::ReliableConduit, and G3D::LightweightConduit can now be created without an explicit NetworkDevice pointer -
  • GApp::onGraphics now takes posed model arguments -
  • G3D::RenderDevice::beginFrame no longer executes a pushState-- state will carry over between frames -
  • G3D::GUniqueID -
  • GApp::onPose -
  • All classes that read from files can now read data inside zipfiles. -
  • Changed G3D::hashCode(T) to ::GHashCode(T) [Corey] -
  • Removed "G3D::" from the printed portion of the documentation index to make it easier to read. -
  • OSWindow::fireEvent for inserting user events into the queue -
  • G3D::logPrintf -
  • System::findDataFile -
  • On OS X, G3D::FirstPersonManipulator now treats ctrl-click as right click -
  • Increased mouse sensitivity of G3D::FirstPersonManipulator on OS X -
  • System::getClipboardText, System::setClipboardText -
  • Widget::window() accessor -
  • Replaced SDLEvent with G3D::GEvent -
  • Increased GFont rendering performance, added GFont::send2DQuads for fast rendering of large amounts of text -
  • G3D::GFont now supports fonts with 256 characters (.fnt file format version 2) -
  • Upgraded to the OpenGL 2.0 glext/glxext/wglext headers -
  • G3D::GuiTheme, G3D::GuiText -
  • G3D::UprightFrame, G3D::UprightSpline -
  • G3D::Spline -
  • G3D::RenderDevice::clip2D -
  • G3D::Win32Window now returns events for up to 5 mouse buttons -
  • Significantly changed GEvent delivery and Widget mechanisms to incorporate notions of focus--see upgrade.html -
  • Motion events (joystick/mouse) can no longer be cancelled by Widget::onEvent -
  • Mouse motion events for all platforms -
  • G3D::PosedModel::Ref::sendGeometry -
  • G3D::RenderDevice::pushState(FramebufferRef) -
  • G3D::Texture::PreProcess::computeNormalMap -
  • direct.h is now included by fileutils.h on Win32 to ensure that chdir, mkdir, etc. are available -
  • Changed distribution directories to place include, lib, and bin under a directory named after the platform - and all other files one directory up. -
  • G3D::GCamera::unproject -
  • Made G3D::Ray non-virtual for efficiency -
  • RenderDevice::alphaWrite now defaults to true -
  • Changed G3D install directory from g3d-7_00 to g3d-7.00 -
  • On a GL 2.0 or greater driver, G3D::GLCaps now assumes the presence of all GL2 extensions even if they are not explicitly listed by the card [Corey Taylor] -
  • debugPrintf now flushes stderr on Unix systems -
  • G3D::Lighting::fromSky -
  • G3D::Texture::newGLTexture2D [Corey Taylor] -
  • Added 10-bit cinema texture formats [Corey Taylor] -
  • Added G3D::ArticulatedModel to the core (includes 3DS loading) -
  • Added G3D::SuperShader to the core -
  • Merged GApp and GApplet into GApp to make the common case easier to implement -
  • Removed GApp::debugMode options, removed "debug" prefix from most fields. -
  • G3D::zipfileExists for testing if a filename path contains a .zip to be opened [Eric] -
  • G3D::isZipfile tests the header of a file to see if it is a .zip [Eric] -
  • G3D::zipRead and G3D::zipClose to open and close .zip files [Eric] -
  • G3D::fileExists supports filename paths that contain .zip [Eric] -
  • G3D::fileLength supports filename paths that contain .zip [Eric] -
  • G3D::getFiles and G3D::getDirs support filename paths that contain .zip [Eric] -
  • Texture::isSupportedImage - static method, returns true if a filename exists and is compatible with Texture [Eric] -
  • Viewer (tool) - Allows drag and drop viewing of many supported file formats [Eric] -
  • GFXMeter (tool) - Updated for 7.00 compatibility: GApplet structure removed [Eric] -
  • OSWindow::Settings has an allowMaximize field. Win32Window will have an activated 'Maximize' button if true [Eric] -
  • GApp2::debugCamera -> GApp2::defaultCamera -
  • GApp2::debugController -> GApp2::defaultController -
  • Made GApp2::debugText private -
  • Added g3d_WorldLight0 to the G3D shader extensions -
  • Added Shader support for GL_FLOAT_MAT3_ARB uniforms -
  • Tab (command completion) no longer auto-repeats in GConsole -
  • GConsole now limits the key repeat rate to the framerate -
  • Removed GApp::Settings::useNetwork because it was no longer needed--Win32 does not trigger firewall checks anymore -
  • Optimized AABSPTree balance and queries; now about 20% faster than 6.10, but requires 30 bytes more memory per member -
  • G3D::Array::pop now shrinks the underlying array by default (Array::popRemove does not shrink the array and is faster) -
  • Fast O(n), non-destructive G3D::Array::partition and G3D::Array::medianPartition -
  • Increased ReliableConduit read attempts before timeout from 10 to 100 -
  • G3D::GImage::pixel1 now returns G3D::Color1uint8* -
  • G3D::Color1, G3D::Color1uint8 -
  • G3D::Image1, G3D::Image1uint8 -
  • G3D::Image3, G3D::Image3uint8 -
  • G3D::Image4, G3D::Image4uint8 -
  • BinaryInput::flipEndian32, BinaryInput::flipEndian16 -
  • Texture::createEmpty now intializes invertY = true, which is usually desirable for Framebuffer rendering. -
  • G3D::Map2D -
  • G3D::Vector4int8 -
  • G3D::PointShape -
  • G3D::GImage::RGBAtoRGB -
  • Added GLEW compatibility [nico] -
  • Added data-files directory to the locations searched for G3D demo data -
  • On Win32, assertions now print ot the Output window as well as the dialog box. -
  • On Win32, $TEMP is now used for the logfile location instead of c:\tmp -
  • G3D::GKey replaces old SDL key enumeration -
  • Decreased memory requirements and increased balance speed of G3D::AABSPTree by adding a level of indirection - between tree nodes and the data stored in them. -
  • Added OSWindow::Settings::caption -
  • Win32 programs must call the macro G3D_START_AT_MAIN(); at top-level if they do not define WinMain themselves. -
  • Win32 switched from MBCS to UNICODE for the binaries (G3D sources compile under either, but UNICODE is the VC8 default) -
  • Replaced SDL event types with G3D event types -
  • Added support for GL_ARB_point_sprite -
  • Win32 programs must call the macro G3D_START_AT_MAIN(); at top-level if they do not define WinMain themselves. -
  • Win32 switched from MBCS to UNICODE for the binaries (G3D sources compile under either) -
  • Changed G3D::GApp::main to return an int -
  • Added header support for GL_EXT_geometry_shader4 ("Geometry shaders") -
  • Changed IFSModel::create to IFSModel::fromFile -
  • G3D::BSPMap for loading Quake3 .bsp files -
  • G3D::TextInput::Settings::caseSensitive -
  • G3D::TextInput::readBoolean, G3D::TextInput::Settings::trueSymbols, G3D::TextInput::Settings::falseSymbols, G3D::TextOutput::Settings::trueSymbol, G3D::TextOutput::Settings::falseSymbol, G3D::TextOutput::writeBoolean, G3D::Token::BOOLEAN_TYPE -
  • G3D::TextInput::Settings::msvcSpecials now defaults to true -
  • Made the input to G3D::tessellateComplexPolygon a constant array reference -
  • Removed SDL from Win32 build -
  • Increased maximum ReliableConduit message size to 60 MB -
  • Removed error macro -
  • G3D::GConsole -
  • Rect2D::lerp -
  • Added GL_EXT_packed_depth_stencil -
  • Added G3D::ImageFormat::DEPTH24_STENCIL8 packed stencil mode -
  • getOpenGLState now includes GL_LIGHT_MODEL_TWO_SIDE value -
  • Made ThirdPersonManipulator constructor protected (use ThirdPersonManipulator::create now) -
  • G3D::ToneMap -
  • Changed Renderbuffer::createEmpty argument order to match Texture::createEmpty -
  • G3D::IFSModel can now remove degenerate faces on load -
  • G3D::MD2Model::textureFromFile -
  • Replaced AABSPTree::beginRayIntersection with simpler AABSPTree::intersectRay interface. -
  • G3D::MD2Model now uses floating point texture coordinates, which makes it easier to - write pixel shaders for MD2Models -
  • G3D::GImage::computeNormalMap now accepts a scale factor indicating how steep the input bump map is -
  • Added G3D::Shader support for the GLSL #version directive -
  • Optimized G3D::GImage::computeNormalMap to use primarily integer math -
  • G3D::AABox::contains(AABox) -
  • Added large file (>2GB) support to BinaryInput [Peter] -
  • Renamed graphics3d.h to G3D/G3D.h -
  • Renamed GLG3D.h to GLG3D/GLG3D.h -
  • Renamed G3DAll.h to G3D/G3DAll.h -
  • G3D::Quat::unitize now normalizes in place -
  • Added G3D::Quat::operator*= -
  • Removed G3D::FirstPersonManipulator's constructor--use the static G3D::FirstPersonManipulator::create method now. -
  • Changed BSPMap leaf bounds from Box to AABox--50% improvement in frustum culling speed -
  • Optimized BSPMap rendering performance -
  • Removed all deprecated APIs -
  • All accessors of the form "getXXX" that take no arguments are now named just "xxx" -
  • G3D::Sky::create is now named G3D::Sky::fromFile and no longer accepts a G3D::RenderDevice. G3D::Sky::render now requires a RenderDevice. -
  • G3D::GFont::fromFile no longer accepts a G3D::RenderDevice and G3D::GFont::draw2D now requires a RenderDevice. -
  • Removed an assertion in BinaryInput requiring that compressed buffers be copied on construction [Nick Bray] -
  • Removed CoordinateFrame::zLookDirection (use -1) -
  • Removed Capsule::endPoint (use point) -
  • Removed CoordinateFrame::getStrafeVector (use rightVector) -
  • Removed static constants (use equivalent lower-case methods) -
  • Removed Cylinder::getPoint1 (use point) -
  • Fix: BSPMap::getStartingPosition now works correctly on all maps [Jeff] -
  • Fix: Workaround for ATI drivers that do not support zero-area scissor region -
  • Fix: GL_EXT_texture_3D -> GL_EXT_texture3D -
  • Fix: ARB_texture_cube_map and EXT_texture_cube_map are now aliases on all cards -
  • Fix: EXT_texture_edge_clamp and SGIS_texture_edge_clamp are now aliases on all cards -
  • Fix: G3D::Sky now turns off lighting -
  • Fix: Win32Window now returns mousebutton and motion events according to the GEvent spec -
  • Fix: Win32Window now operates correctly in fullscreen mode -
  • Fix: Fixed TGA decode to load from the middle of a binaryinput -
  • Fix: Added texture coordinates to posed MD2Models -
  • Fix: prompt/debugAssert now correctly responds to button presses on OS X -
  • Fix: GConsole now filename completes after the first word -
  • Fix: RenderDevice::getDepthBufferValue now checks for the presence of a depth buffer. -
  • Fix: G3D::AABSPTree now correctly handles members with infinite bounds on ray intersection tests -
  • Fix: Removed use of tmpfile on Unix -
  • Fix: Java ReliableConduit now properly waits if the buffer is full when sending -
  • Fix: [ 1607693 ] Triangles/Second display is now correct (rates were too low in 6.10) -
  • Fix: NetworkDevice now does not perform a test broadcast during initialization -
  • Fix: G3D::LightweightConduit::ok is now false if any error occurs during initialization -
  • Fix: BSPMAP for cards without glMultiDrawElementsEXT -
  • Fix: [ 1584335 ] ReliableConduit incorrectly assumes it's ok -
  • Fix: RenderDevide::push2D no longer resets the frameBuffer. -
  • Fix: Framebuffer logic for counting number of attachments was broken -
  • Fix: [ 1581986 ] Matrix3::fromAxisAngle now normalizes the input vector -
  • Fix: [1490643] Linux/FreeBSD/OS X binaries are now compiled with -fno-strict-aliasing, which fixes some - memory corruption problems that occurred with full optimizations. -
  • Fix: Fixed all warnings on gcc-4.1 and VC8. -
  • Fix: Matrix and CoordinateFrame serializers inside G3D::AnyVal dropped data -
  • Fix: [ 1535759 ] valgrind finds initialization/deletion errors in TextOutput, Matrix [Chris Demetriou] -
  • Fix: Patched MD2Model to automatically reduce animation times to less than 100000; large time were overflowing double->int conversion and causing animations to appear scrambled. -
  • Fix: [ 1535292 ] global Table hashCode overloads broken [Chris Demetriou] -
  • Fix: [ 1535736 ] Fixed System.cpp memory allocator to compile on 64-bit machines correctly [Chris Demetriou] -
- -
-

- Changes in 6.10: -

    -
  • Optimized G3D::CoordinateFrame::pointToObjectSpace to be fully inlined via left-multiplication -
  • G3D::Matrix4::orthogonalProjection from a G3D::Rect2D -
  • G3D::RenderDevice::swapBuffers -
  • G3D::AnyVal -
  • G3D::ThirdPersonManipulator -
  • Added support for GL_SGIS_texture_lod in Texture. -
  • Fix: [ 1490655 ] MeshAlg::Edge::containVertex goes off the end of the array -
  • Fix: [ 1511729 ] NVIDIA rectangle generates errors in mipmap code -
  • Fix: [ 1507296 ] RenderDevice must swapBuffer on resize -
-
-

- Changes in 6.09: -

    -
  • glDepthBoundsEXT -
  • G3D::Quat::sameRotation -
  • Full loading of the GL_ATI_separate_stencil extension, support within RenderDevice -
  • platform.h undefines WIN32_LEAN_AND_MEAN, NOMINMAX after it has defined them -
  • G3D::Texture::Settings::maxMipMap -
  • Renamed Texture::Parameters to Texture::Settings (backwards compatible typedef added) -
  • Optimized IFSModel rendering by increasing internal VAR cache size and reducing the number of state changes. - Can now render more than 1000 IFSModels at 30 fps on GeForce 7800. -
  • G3D::System::mallocStatus -
  • Range checking on Vector2int16::operator[] -
  • GImage::BAYER_G8R8_B8G8_to_R8G8B8_MHC, GImage::BAYER_B8G8_G8R8_to_R8G8B8_MHC -
  • IFSModel and MD2Model now allocated their posed models using System::malloc -
  • Increased the memory maintained by G3D::System for buffer pools up to a total of 13 MB: - 8 MB tiny (preallocated), 1 MB small (on demand), 4 MB medium (on demand). This was observed to - dramatically increase performance (15x) in real programs that were - performance limited by memory allocation time. -
  • NetworkDevice now uses Winsock2.0 on Windows (controlled by the G3D_WINSOCK_MAJOR_VERSION/G3D_WINSOCK_MINOR_VERSION settings in NetAddress.h) -
  • G3D::Manipulator -
  • G3D::GApplet now runs installed G3D::GModules (except for graphics, which is left to the progrmamer) -
  • G3D::GApp::addWidget, G3D::GApplet::addWidget, G3D::GApp::removeWidget, G3D::GApplet::removeWidget -
  • G3D::Widget, G3D::WidgetManager -
  • G3D::System::getEnv() -
  • G3D::PosedModel2D -
  • G3D::DXCaps -
  • Increased precision of several Quat operations -
  • G3D::Quat::fuzzyEq -
  • G3D::Quat::operator- -
  • G3D::LineSegment::length, G3D::LineSegment::point -
  • Increased fuzzyEpsilon by a factor of 10 to take into account the new float32 focus of the APIs -
  • G3D::RegistryUtil -
  • G3D::LineSegment2D -
  • G3D::ConvexPolygon2D -
  • G3D::AxesShape -
  • contrib/shaders/showDepth -
  • G3D::Crypto with MD5 and CRC32 hashes -
  • TextureManager::findTexture, TextureManager::cacheTexture [Erik] -
  • Win32Window::_directInput created on-demand [Erik] -
  • WeakReferenceCountedPointer has more comparison operators [Erik] -
  • GImage::resolveFormat utility function [Erik] -
  • GLCaps supports MESA -
  • G3D::Win32Window and G3D::SDLWindow now release input capture and make the mouse visible on destruction -
  • G3D::OSWindow::setInputCaptureCount, G3D::OSWindow::inputCaptureCount, G3D::OSWindow::incInputCaptureCount, G3D::OSWindow::decInputCaptureCount -
  • GImage::makeCheckerboard -
  • G3D::Vector3::one() -
  • G3D::Shader now supports g3d_size(sampler2D) and g3d_invSize(sampler2D) extensions in GLSL shaders. -
  • Renamed GAppSettings to G3D::GApp::Settings (old name is supported but deprecated) -
  • Renamed GWindowSettings to G3D::OSWindow::Settings (old name is supported but deprecated) -
  • Renamed TextInput::Options to G3D::TextInput::Options (old name is supported but deprecated) -
  • G3D::FPManualController::setAutoActive for World of Warcraft style controller -
  • G3D::isSlash, G3D::isQuote -
  • G3D::GApplet::onEvent can now consume (i.e., prevent G3D::GApp from seeing) the event -
  • G3D::CoordinateFrame::fuzzyIsIdentity, G3D::CoordinateFrame::isIdentity, G3D::CoordinateFrame::fuzzyEq -
  • Matrix3::isOrthonormal -
  • [1421201] Removed excess gl (NVIDIA) headers -
  • Win32Window destructor now releases the mouse if it was captured and the current GL context is that window and the window was not created from an existing HDC/HWND -
  • Fix: com.graphics3d.g3d.ReliableConduit now correctly selects on the waiting socket -
  • Fix: [ 1166057 ] AABSPTree::beginBoxIntersection -
  • Fix: GLCaps::supports(ImageFormat) now returns correct results on all cards -
  • Fix: Shadow map rendering of default PosedModels now enables lighting -
  • Fix: G3D::UserInput now restores the mouse position after pureDeltaMouse is turned off -
  • Fix: G3D::Win32Window now clips precisely to the client area during an input grab. -
  • Fix: [ 1383042 ] free static variables on shutdown -
  • Fix: [1449115 ] Texture loading for odd-byte rows -
  • Fix: G3D::Win32Window now produces correct character and scan codes for key events -
  • Fix: G3D::GApplet::onEvent calls GApplet::processEvent by default -
  • Fix: [ 1444320 ] TextInput parsed ".1" as "1" instead of "0.1" -
  • Fix: G3D::Shape::type is now const -
  • Fix: 0 --> 0.0f FrameBuffer.h [Erik] -
  • Fix: Fixed Texture read-back dimensions for cube-map -
  • Fix: Missing #include in SkyParameters.h [Erik] -
  • Fix: Quad triangle counts are now accurate (were off by factor of 4 in 6.08) -
  • Fix: contrib/ArticulatedModel now correctly masks all components using the diffuse alpha in fixed function mode -
  • Fix: G3D::CoordinateFrame::getHeading was flipped front-to-back -
  • Fix: [ 1404487 ] Missing Alt key up/down events on Win32 -
  • Fix: [ 1484924 ] collisionTimeForMovingPointFixedBox normals -
-

-


- Changes in 6.08: -
    -
  • Moved Win32 linker statements out of platform.h for IncrediBuild compatibility. -
  • G3D::Texture and G3D::Sky now accept a rescaling factor -
  • Added GFont::fromMemory() [Corey] -
  • Added optional argument to Quat::slerp() for slerp/lerp angle threshold. [Corey] -
  • Across-the-board performance optimizations. Most apps should render 10% faster. - Includes removal of Milestones when using VBO VAR [Nick Bray], GFont::draw2D and - Draw::rect2D stripped down to raw OpenGL, consistent internal use of float, - increased RenderDevice state change optimization. -
  • Minimized header interdependencies (GLG3D headers no longer include all of G3D) -
  • Added GThread and GMutex classes. [Corey] -
  • Added ImageFormat::fromCode(). [Corey] -
  • Added Plane::distance() and Plane::closestPoint() helper methods. [Corey] -
  • G3D::ImageFormat::code, G3D::ImageFormat::colorSpace -
  • incompatible change G3D::MeshAlg::computeTangentSpace basis now computes a right-handed coordinate frame, - where the binormal direction is the negative of the direction it faced in G3D 6.07. -
  • Exposed G3D::RenderDevice::beforePrimitive and G3D::RenderDevice::afterPrimitive to end-user code for - integrating raw OpenGL calls. -
  • G3D::Framebuffer and G3D::Renderbuffer to implement the Framebuffer_object extension [Dan Hilferty] -
  • G3D::Shader::hasArgument -
  • G3D::Texture::getImage -
  • Changed SECOND, MINUTE, DAY, HOUR, SUNRISE, SUNSET, MIDNIGHT, METER, KILOMETER to enum values instead of #defines -
  • G3D::Texture::Parameters; deprecated most Texture constructors in favor of ones that use this class -
  • Moved most image manipulation routines into GImage. -
  • G3D::GImage now allocates the underlying buffer in multiples of bytes to allow slight overflor for MMX algorithms -
  • G3D::GImage::BAYER_R8G8_G8R8_to_R8G8B8_MHC -
  • G3D::GImage::R8G8B8_to_Y8U8V8 -
  • G3D::GImage::Y8U8V8_to_R8G8B8 -
  • G3D::GImage now supports PPM binary -
  • Various Rect2D helpers [Nick Bray] -
  • ConvexPolyhedron improved clipping [Nick Bray] -
  • G3D::System::build -
  • G3D::System::calloc -
  • G3D::GImage::convertToRGBA -
  • contrib/AVI can read most AVI files on Windows. -
  • contrib/wxGWindow now uses wxWidgets 2.6.2 -
  • G3D_DEBUG now controls whether debug code is enabled; it defaults to the value of _DEBUG -
  • zlib upgraded to 1.2.3 [Corey] -
  • zlib now statically linked on Win32 (no longer requires zlib1.dll at runtime) [Corey] -
  • G3D::MeshShape -
  • Changed std::string hashCode to use CRC32 to reduce collisions -
  • G3D::crc32 -
  • Added occlusion query #defines [Nick Bray] -
  • G3D::Win32Window now shares textures and vertex buffers across all GL contexts -
  • G3D::Win32Window now enforces single-threading among GL contexts -
  • G3D::GLCaps::slowVBO -
  • G3D::VARArea now uses main memory vertex buffers on cards with slow VBO implementations. -
  • G3D::Matrix3::toString [Peter] -
  • G3D::Matrix4::toString [Peter] -
  • G3D::Color3::fromHSV [Peter] -
  • G3D::Color3::toHSV [Peter] -
  • G3D::Color3::jetColorMap [Peter] -
  • Optimized G3D::iRound (now faster than casting!) -
  • G3D::MD2Model::create now accepts a scale factor -
  • #G3D_DEPRECATED macro -
  • #G3D_CHECK_PRINTF_ARGS, #G3D_CHECK_VPRINTF_ARGS macros to allow - checking of printf argument strings under gcc at compile time with - -Wformat. -
  • G3D::TextInput::filename -
  • G3D::TextInput::Options::msvcSpecials -
  • G3D::TextInput::Options::startingLineNumberOffset -
  • G3D::TextInput::readSymbolToken [cgd] -
  • G3D::TextInput::readStringToken [cgd] -
  • G3D_DEPRECATED macro -
  • Threadsafe G3D::ReferenceCountedPointer -
  • G3D::AtomicInt32 -
  • G3D::GThread [Corey] -
  • G3D::Array::popDiscard -
  • Optimized multi-argument Array::append -
  • G3D::GFont 2x faster than in G3D 6.07 -
  • G3D::RenderDevice::pushState 2x faster than in G3D 6.07 -
  • G3D::RenderDevice::pushState no longer stores GL texgen and fog information -
  • G3D::Draw::fastRect2D -
  • G3D::System::outOfMemoryCallback -
  • G3D::Queue::fastClear [Chris Demetriou] -
  • G3D::Rect2D::x0y1 and x1y0 -
  • G3D::GLCaps bug tests now run in a separate GL context [Erik Cassel] -
  • G3D::GApplet tracks real and simulation time. -
  • contrib/Q3Map updated to correctly render instanced objects [Alex Rice] -
  • G3D::OSWindow subclasses now required to invoke OSWindow::loadExtensions -
  • G3D::Quat::log for non-unit quats and for real-only quats. -
  • G3D::GApplet::doUserInput -
  • G3D::GApp prints time for each component -
  • G3D::Stopwatch -
  • G3D::OSWindow::renderDevice() -
  • G3D::OSWindow::current() -
  • G3D::GLCaps::hasBug_redBlueMipmapSwap and workaround for G3D::Texture on Radeon 7500 -
  • Fix: CollisionDetection::penetrationDepthForFixedSphereFixedPlane() contact point and normal values. [Corey] -
  • Fix: Quat::slerp has invalid shortest path [Corey] -
  • Fix: G3D::drawFeatureEdges now uses correctly normalized face edges (and offers a crease angle) -
  • Fix: G3D::SDLWindow now releases the mouse on Linux during an assertion. -
  • Fix: All keys are reset to up when Win32Window loses focus. [Corey] -
  • Fix: gaussRandom is unit gaussian [Corey] -
  • Fix: [ 1418276 ] 6.08: Unsupported format for depth texture -
  • Fix: Ignoring extra/unused set Shader arguments. [Corey] -
  • Fix: [ 1229205 ] uniform texture array (Could not set indexed array uniforms). [Corey] -
  • Fix: incompatible change BinaryInput/BinaryOutput copy constructors and assignments were accessible. [Corey] -
  • Fix: RenderDevice::screenshotPic would corrupt GImage's heap. [Corey] -
  • Fix: Alt-Tab window switching caused an invalid Alt key state. [Corey] -
  • Fix: Incorrect window size event in Win32Window sent to OpenGL. [Corey] -
  • Fix: [ 1227915 ] Textures don't bind on ATI under GLSL. -
  • Fix: [ 1358477 ] ray-plane intersection bug [Dan Keefe] -
  • Fix: [ 1370665 ] hash_map moved to stdext in VC8 (2005) -
  • Fix: ToneMap extended to use DIM_2D_NPOT instead of DIM_2D_RECT -
  • Fix: Texture::copyFromScreen now works with DIM_2D_NPOT textures -
  • Fix: Wrapped debugAssertM in do {} while (0) to ensure correct compilation in single-line statements [ERik Cassel] -
  • Fix: G3D::Draw::cylinder now renders the bottom correctly -
  • Fix: Array::front now compiles under gcc -
  • Fix: G3D::Ray::distance used to measure against the origin [David] -
  • Fix: [ 1293151 ] ArticulatedModel clipping on Radeon -- disabled auto-mipmap generation on mobile radeon 9xxx -
  • Fix: G3D::TextInput now parses ^=, character 255 correctly [cgd] -
  • Fix: G3D::TextInput now reports line numbers correctly with raw newlines [cgd] -
  • Fix: .ICO files with transparency loaded incorrectly [Corey] -
  • Fix: G3D::Draw::rect2DBorder inner border was 1 pixel too thick. -
  • Fix: [ 1326173 ] Win32Window::init should call makeCurrent.[Erik Cassel] -
  • Fix: [ 1326423 ] G3D::Queue::_copy broken [Chris Demetriou] -
  • Fix: [ 1313293 ] 6.08: TextInput gets symbol extendedType() wrong [Chris Demetriou] -
  • Fix: IFSModel::save, for PLY2 forgot newlines [Peter] -
  • Fix: Quat(Matrix3) now computes trace correctly (gave negative quats in some cases) -
  • Fix: Setting RenderDevice::polygonOffset now always produces a depth shift, - even for faces perpendicular to the view axis. -
  • Fix: GImage now auto-resolves formats for files with 1 character base names -
  • Fix: WeakReferenceCountedPointer cycle bug -
  • Fix: Corrected lag encountered when using some ReliableConduit constructors [Dan Keefe] -
- -

-


- Changes in 6.07: -
    -
  • G3D::OSWindow::makeCurrent -
  • Win32 release binaries now built with no debug information (used to have line numbers) -
  • AABox::AABox enforces the constraint low <= high -
  • Optimized G3D::Array, Table, Queue, and Set for performance. Now significantly (up to 10x) faster - than their std::counterparts. -
  • G3D::Vector3(Vector2, float) constructor -
  • G3D::Vector2::fastDirection -
  • G3D::TextInput::Options::cComments -
  • G3D::TextInput::Options::escapeSequencesInStrings -
  • G3D::TextInput::Options::otherCommentCharacter2 -
  • G3D::TextInput::WrongString -
  • GLCaps::supports_GL_ATI_separate_stencil -
  • GLCaps can now test a card/driver and detect specific bugs: -
    • G3D::GLCaps::hasBug_glMultiTexCoord3fvARB -
    • G3D::GLCaps::hasBug_normalMapTexGen -
    -
  • G3D::ReferenceCountedPointer::downcast for non VC6 compilers -
  • Improved G3D::ReferenceCountedPointer documentation to make subclassing features clearer -
  • Moved typedef for uint into G3D namespace and into g3d (was in glg3d) -
  • G3D::Shape -
  • G3D::Cylinder -
  • G3D::System::malloc, G3D::System::realloc, G3D::System::free for fast allocation of small objects -
  • G3D::Draw::plane -
  • G3D::Draw::cylinder -
  • G3D::gaussRandom -
  • GCamera deserialize(BinaryInput) & serialize(BinaryOutput) functions [Peter] -
  • G3D::GApp now writes a description of the whole system to the log to aid debugging. -
  • [ 1217928 ] OpenGL occlusion query entry points are loaded on initialization -
  • New texture interpolation modes: BILINEAR_MIPMAP, NEAREST_MIPMAP, NEAREST_NO_MIPMAP -
  • New texture formats: -
      -
    • G3D::ImageFormat::L16; -
    • G3D::ImageFormat::L16F; -
    • G3D::ImageFormat::L32F; -
    • G3D::ImageFormat::A16; -
    • G3D::ImageFormat::A16F; -
    • G3D::ImageFormat::A32F; -
    • G3D::ImageFormat::LA4; -
    • G3D::ImageFormat::LA16; -
    • G3D::ImageFormat::LA16F; -
    • G3D::ImageFormat::LA32F; -
    • G3D::ImageFormat::RGB16; -
    • G3D::ImageFormat::RGB16F; -
    • G3D::ImageFormat::RGB32F; -
    • G3D::ImageFormat::RGBA16; -
    • G3D::ImageFormat::RGBA16F; -
    • G3D::ImageFormat::RGBA32F; -
    -
  • isValidPointer and isValidHeapPointer no longer check the Win32 debug heap in order to support offset and padded memory blocks. -
  • Restructured unit tests -
  • G3D::CoordinateFrame::lookRay [David Baszucki] -
  • G3D::System::describeSystem, G3D::NetworkDevice::describeSystem, G3D::RenderDevice::describeSystem -
  • G3D::Array performance tuning for short arrays and arrays of small objects -
  • Added glext.h entries for GL_ARB_draw_buffers, GL_ARB_texture_rectangle, - GL_ARB_color_buffer_float, GL_ARB_half_float_pixel, GL_ARB_texture_float, - and GL_ARB_pixel_buffer_object extensions -
  • IFSModel::create added weld option, defaults to true (to keep compatibility). [Peter] -
  • G3D::RenderDevice::alphaTestReference, RenderDevice::alphaTest -
  • G3D::VAR::set -
  • G3D::Log::vprintf -
  • G3D::WeakReferenceCountedPointer -
  • GCC 4.0 build support added [Corey] -
  • G3D::CoordinateFrame::lookAt now gives a valid output even when look == up -
  • contrib/GChunk -
  • GLCaps now loads GL_EXT_framebuffer_object functions -
  • Added MSVC 6 support for C99 restrict keyword -
  • G3D::Win32Window properly resizes viewport on window resize [Corey] -
  • G3D::BinaryFormat, G3D::byteSize, G3D::binaryFormatOf -
  • Removed dead ManualCameraControllerHelper code -
  • Added consistent area and volume methods to geometric primitives, deprecated old methods. -
  • Fast G3D::BinaryInput::read / G3D::BinaryOutput::write methods for arrays -
  • Enabled cube mapping on Radeon mobility cards and added a workaround to the known problems with texcoords on those cards. -
  • Can now create G3D::Win32Window with existing HWND and HDC [Corey] -
  • G3D::VertexAndPixelShader::ArgList::set(std::string, Array)-- [ 1192401 ] Shader support arrays -
  • Fix: SDLWindow used std::string's instead of C strings in printf and format inside some exception handling code. [Peter] -
  • G3D::X11Window (same as SDLWindow in this release) -
  • Fix: [ 1277854 ] Win32Window fails on 24-bit modes -
  • RFE: [ 1242466 ] Inline Matrix3 methods -
  • Fix: [ 1226272 ] end caps of capsules in wrong position -
  • Fix: G3D::ImageFormat::LA8 now has 8-bits per channel -
  • Fix: [ 1124491 ] Remove GL_SAMPLER_2DRECT_ARB -
  • Fix: [ 1257113 ] G3D::Queue problems comining pushFront and pushBack -
  • Fix: MeshAlg::Weld now linear time (was O(n^2) due to a bug) -
  • Fix: [ 1298873 ] fast & correct CoordinateFrame::lerp -
- -

-


- Changes in 6.06: -
    -
  • G3D::Lighting::emissiveScale -
  • G3D::RenderDevice::drawBuffer -
  • G3D::RenderDevice::debugNumMinorStateChanges, debugNumMinorOpenGLStateChanges, debugNumMajorStateChanges, debugNumMajorOpenGLStateChanges. -
  • In stereo mode, Texture::copyFromScreen automatically chooses the left/right buffer to read based on the current glDrawBuffer -
  • contrib/ArticulatedModel/ToneMap -
  • Lazy state changes for shaders -
  • 50% performance improvement for G3D::BinaryInput, G3D::BinaryOutput when machine endian matches file endian -
  • Textures load with default of maxAnisotroy = 2.0 -
  • maxAnisotropy argument to G3D::Texture constructors. -
  • GLCaps now loads GL_ATI_fragment_shader extension -
  • contrib/ArticulatedModel now supports rigid body hierarchies -
  • Added TEX_SUBTRACT, TEX_ADD_SIGNED, TEX_DOT3, TEX_DOT3_RGBA modes for G3D::RenderDevice::setTextureCombineMode -
  • G3D::RenderDevice now cleans up all static G3D::VARArea s when it shuts down -
  • FIX: [ 1208157 ] GLSL slow on ATI -
  • FIX: Off-by-one on viewport scale for 2D rendering -
  • FIX: MeshAlg::computeTangentSpaceBasis now works correctly -
  • FIX: 6.05 enabled all fixed function lights by default. This caused major performance problems on some cards. -
  • FIX: Extended cube map workaround to all Radeon Mobility cards -
  • FIX: Added check for glBlendEq before calling in RenderDevice -
  • FIX: Added a test for GL_EXT_texture_env_add in RenderDevice -
  • FIX: [ 1191817 ] unsigned warnings in BinaryInput -
- -
-

- Changes in 6.05: -

    -
  • G3D::BAYER_G8B8_R8G8_to_R8G8B8_MHC -
  • G3D::Quarter_R8G8B8_to_BAYER_G8B8_R8G8 -
  • G3D::BAYER_G8B8_R8G8_to_Quarter_R8G8B8 -
  • contrib/Matrix -
  • contrib/Java -
  • Texture::alphaOnlyVersion -
  • Draw::sphere speed improved over 25% with single quad strip (improves Draw::capsule) [Corey] -
  • Allow 1-channel GImage saving - BMP (expanded to RGB), PNG [Corey] -
  • Allow 1-channel GImage loading - PNG [Corey] -
  • Added shader and framebuffer extensions to glext.h -
  • All files used during current execution are available via G3D::getFiles() [Corey] -
  • Implemented OSX version of glGetCurrentContext with CGL. [Corey + Derek] -
  • ReferenceCountedObject is-in-heap checks were removed to allow better multiple and virtual inheritance for reference counted objects. ReferenceCountedPointer still appropriately checks does an is-in-heap check on assignment. [Corey] -
  • Added Dev C++ compatability -
  • glGetAttribLocationARB -
  • Changed GLight == operator to not use memcpy (was causing issues due to byte padding on some compilers) -
  • Made CoordinateFrame destructor non-virtual (eliminates vtable) -
  • Added new FAQ documentation -
  • Added support to G3D::BinaryInput and G3D::BinaryOutput - reading and writing huge (larger than available memory) files. - Files are still restricted to about 2 GB total, and compressed - files must fit entirely in memory. -
  • Tweaked allocation strategy for small G3D::Array -
  • G3D::Texture::rect2DBounds, G3D::Texture::vector2Bounds -
  • G3D::Vector4 * G3D::Vector4, Vector4 / Vector4 -
  • G3D::Array::operator=(std::vector) -
  • G3D::Sky::getEnvironmentMap now returns the top texture on machines - that don't support cube maps. -
  • glDisableAllTextures() -
  • G3D::setFailureHook -
  • G3D::Shader::fromStrings now accepts optional names for the vertex and pixel shader -
  • G3D::Shader no longer requires values for declared but unused uniform variables -
  • G3D::RenderDevice now stores texture matrix at 32-bit precision (for faster push/popState) -
  • G3D::RenderDevice::setTextureLODBias -
  • G3D::Shader now supports shadow map arguments -
  • G3D::Shader::ArgList checks to see if Texture arguments are null -
  • G3D::RenderDevice::setAlphaWrite now defaults to true if the OSWindow has an alpha channel. -
  • G3D::RenderDevice::screenshotPic now supports alpha -
  • contrib/VideoSerializer -
  • G3D::BinaryOutput::writeBits, G3d::BinaryInput::readBits -
  • G3D::Sky can now be initialized with a NULL renderDevice, provided a non-null one - is used with the G3D::Sky::render method. -
  • G3D::pi(), G3D::halfPi(), G3D::twoPi() added to replace defines [Corey] -
  • contrib/Q3Map -
  • Increased G3D::Draw::sphere performance using vertex arrays. -
  • G3D::Array::fastClear -
  • G3D::AABSPTree::insert(Array) -
  • G3D::Texture::sizeOfAllTexturesInMemory -
  • G3D::VARArea::sizeOfAllVARAreasInMemory -
  • G3D::RenderDevice stores cameraToWorldMatrixInverse for faster coordinate system changes. -
  • inlined G3D::Matrix3::operator= for performance -
  • Created installer for Windows install [Corey] -
  • Reorganized the documentation topic index based on abstraction level, added hyperlinks to demo/contrib code -
  • G3D::ReliableConduit and G3D::LightweightConduit now send and receive - objects directly; no need to make a G3D::NetMessage. G3D::NetMessage - and associated methods are now deprecated. -
  • Win32 GUI G3D::prompt now auto-expands \\n to \\r\\n in prompt string [Corey] -
  • G3D::Draw::frustum -
  • Increased timeout and attempts for G3D::ReliableConduit to handle huge (1 MB) packets -
  • G3D::BinaryOutput::reset (memory writing only; not supported for disk) -
  • Reduced overhead for G3D::ReliableConduit and - G3D::LightWeightConduit send routines -
  • Added PPM/PGM/PBM ASCII encode/decode support to G3D::GImage [Corey] -
  • New G3D::PosedModel rendering methods appropriate for shadow casting - (with efficient default implementations). -
  • G3D::Lighting -
  • Changed RenderDevice::TEX_INTERPOLATE to mean GL_DECAL and added TEX_BLEND for GL_BLEND -
  • G3D::CoordinateFrame::upVector -
  • G3D::GLight::diffuse -
  • G3D::Rect2D::contains is now const -
  • Rewrote G3D::BinaryOutput to not use G3D::Array -
  • G3D::MD2Model::textureMatrix -
  • G3D::MeshAlg::computeBounds(vertex, index, ...) -
  • G3D::RenderDevice::colorWriteEnabled(), depthWriteEnabled, alphaWriteEnabled -
  • G3D::RenderDevice::setSpecularCoefficient(Color3) -
  • G3D::VAR::maxSize -
  • G3D::RenderDevice::enableTwoSidedLighting -
  • G3D::PosedModel::hasTransparency -
  • G3D::PosedModel::sort -
  • G3D::RenderDevice::renderMode -
  • G3D::MeshAlg::computeNormals(geometry, indexArray); -
  • contrib/ArticulatedModel (beta 3DS support) -
  • G3D::RenderDevice::swapBuffersAutomatically allows caller to suppress page flip. -
  • Added coordinate system documentation. -
  • RenderDevice::enableClip2D, RenderDevice::disableClip2D (scissor region) -
  • contrib/wxGWindow is stable and full featured-- use wxWidgets 2.5.3 with G3D! -
  • G3D::fileIsNewer -
  • G3D::isDirectory -
  • G3D::filenameContainsWildcards -
  • G3D::filenamePath -
  • G3D::Draw::lineSegment now accepts a scale (allowing arrows and axes to thicken appropriately) -
  • G3D::Rect2D::largestCenteredSubRect -
  • G3D::Matrix4::serialize, G3D::Matrix4::deserialize -
  • glTexImage3DEXT -
  • Removed glut.lib and glut.dll from the win32-lib directory. -
  • G3D::writeStringToFile, G3D::TextOutput, and G3D::BinaryOutput now flush by default (safe, not fast). -
  • Shifted push2D by 0.375 pixels as recommended in the OpenGL guide to bias integer coords towards pixel centers -
  • G3D::Draw::rect2DBorder -
  • G3D::Rect2D::border -
  • G3D::RenderDevice now creates a G3D::Win32Window on Windows instead of a G3D::SDLWindow. SDLWindow is now - deprecated on Windows. -
  • G3D::VARArea now updates allocation sizes instead of G3D::VAR internally. Added - more accessor methods to VARArea to futher remove VAR from VARArea internals. [Corey] -
  • VARSystem.cpp moved to VARArea.cpp - filename change only! [Corey] -
  • Linux build system updated: - Builds only static libraries, Does not require libtool/libtoolize anymore, - Does not check for or require libraries that normally linked with the .so files, - Automatically builds Test project with iCompile during install. [Corey] -
  • G3D::Quat::deserialize, G3D::Quat::serialize -
  • G3D::PhysicsFrame::deserialize, G3D::PhysicsFrame::serialize -
  • G3D::TextInput::Options::singleQuotedStrings (defaults to true, changing the behavior - from previous versions). -
  • G3D::Token::extendedType returns information disambiguating characters and strings - and floats and ints. -
  • Added data/ah64-body and ah64-rotor -
  • demos/Network_Demo now uses a helicopter model instead of a plane -
  • G3D::VARArea::gl_vertexBufferObject and G3D::VARArea::gl_basePointer for breaking - the VARArea abstraction. -
  • GLG3D.h no longer links against SDLMain.lib on Windows if _CONSOLE is defined - (since console programs have no WinMain). -
  • SDL's redefinition of main is cleared when not linking sdlmain.lib [Corey] -
  • Moved contrib/Win32Window to G3D::Win32Window -
  • G3D::TextInput::readSymbols -
  • contrib/Image [Morgan] -
  • contrib/wxGWindow [Morgan] -
  • Added support for full-screen antialiasing to contrib/Win32Window -
  • Added joystick support to contrib/Win32Window [Corey] -
  • Win32Window fully-implements OSWindow [Corey] -
  • Texture now supports DDS(2D/CubeMap) and PNG files [Corey] -
  • Added Win32 pbuffer routines (no G3D wrapper, though-- we're waiting for the new ARB API). -
  • G3D::PosedModel::texCoords -
  • G3D::IFSModel now loads IFS 1.1 [Peter] -
  • G3D::IFSModel now loads and saves PLY2 files (plain text IFS format) [Peter] -
  • Automatically switch to glCompressedTexImage2D in G3D::Texture::fromMemory [Corey] -
  • Added G3D::Sky::fromCubeMap for preloaded CubeMap Texture::Ref's [Corey] -
  • Added G3D::Sky::fromFile and deprecated Sky::create [Corey] -
  • Demo and Test projects now build with iCompile, which is included [Corey] -
  • Fix: TextOutput::writeString now escapes special characters -
  • Fix: AABSPTree::serializeStructure -
  • Fix: Properly handle gl_ uniforms on Radeon for Shader -
  • Fix: [ 875467 ] OS X debugBreak (requires default XCode debug menu item 'Break on DebugStr()') [Corey + Derek] -
  • Fix: Can make a G3D::Texture::fromGImage with one channel (defaults to L8 format) -
  • Fix: [ 1149972 ] 6.05: Make Sky render correctly on low-end cards (no Cube mapping) [Corey] -
  • Fix: [ 1032742 ] OS X _DEBUG not defined [Derek] -
  • Fix: 16-bit integer reads in BinaryInput that always reversed endianness. (OSX file reading) [Corey + Derek] -
  • Fix: Matrix4 operator[] was returning a matrix value cast to a pointer [Corey] -
  • Fix: Matrix3 and Matrix4 had missing float* / const float* operators [Corey] -
  • Fix: Rect2D::clip broken for types other than Vector2 -
  • Fix: RenderDevice::configureShadowMap result depends on objectToWorldMatrix -
  • Fix: [ 1150650 ] DebugBreak() undefined -
  • Fix: [ 1111534 ] Network Demo crashes starting 2nd server on same machine -
  • Fix: [ 1102091 ] ReliableConduit::receive times out -
  • Fix: Implemented MD2Model::objectSpaceBoundingX methods. -
  • Fix: G3D::Triangle::area is now zero for zero-area triangles (was inf) -
  • Fix: AABSPTree with extent on MSVC 6 no longer enters infinite loop in std::sort -
  • Fix: [ 1105641 ] Does not build with g++ 3.4.x [Corey] -
  • Fix: [ 1103619 ] RenderDevice::countPrimitive is wrong (changed to RenderDevice::countTriangles) [Corey] -
  • Fix: AABSPTree::BoxIntersectionIterator doesn't compile -
  • Fix: [ 1101680 ] copyfile won't overwrite (on Windows now overwrites) [Corey] -
  • Fix: [ 1101646 ] GCamera::frustum incorrect for non-square viewport -
  • Fix: Ultra bright lens flare at sunset [Nicholas Bray] -
  • Fix: IP address strings were reversed by NetAddress(std::string) -
  • Fix: TextInput now returns end of file token for files without trailing whitespace -
  • Fix: [ 1094166 ] 6.05: Release mouse stuck on x-axis [Corey + Morgan] -
  • Fix: Recognize buggy ATI Radeon Mobility cube maps and work around -
  • Fix: Textures now initialize without setting error bit on cards without GL_ARB_shadow -
  • Fix: filenameBaseExt now operates correctly on strings with both \ and / slashes. -
  • Fix: [ 1062659 ] BinaryInput::BinaryInput() memory leak -
  • Fix: Removed RenderDevice::polygonCount, which was never used. -
  • Fix: TextInput::readNumber no longer accepts double preceeding +/- on numbers when Options::signedNumbers is true -
  • Fix: [ 1038733 ] OSWindow cannot set icon properly [Corey] -
  • Fix: [ 939400 ] Linux mouse set position (Wild camera swinging on startup) [Corey] -
  • Fix: [ 1042591 ] Software GL Causes Assertion [Corey] -
  • Fix: [ 1036634 ] debugAssert doesn't work on MSVC 7 [Corey] -
  • Fix: [ 1049024 ] Fix compile warnings from gcc/Linux build [Corey] -
  • Fix: [ 1051272 ] Win32Window doesn't use GWindowSettings properly. [Corey] -
  • Fix: Win32Window clips the proper cursor region during input capture. [Corey] -
  • Fix: GWindows now center and maximize on the primary monitor for Windows. -
  • Fix: [ 1052945 ] TextOutput wordWrap starts on newlines -
  • Fix: [ 1050957 ] TextInput readNumber support for capital 'E' numbers. -
  • Fix: [ 1049674 ] TextInput failes on X. numbers. -
  • Fix: [ 1044028 ] Linux TextOutput Warning -
  • Fix: [ 1032750 ] Grayscale JPG errors [Corey] -
  • Fix: [ 1036225 ] Encode TGA support strips alpha channel [Corey] -
  • Fix: [ 1038631 ] CoordinateFrame::slerp (Quat::slerp has fix) [Corey] -
  • Fix: [ 1033686 ] GImage::GImage(filename) dies on certain (BMP) images [Corey] -
  • Fix: Texture mapping modes for pre-OpenGL 1.3 cards [Dan & Morgan] -
- -
-

- Changes in 6.04: -

    -
  • G3D Manual! [ Morgan and Sascha ] -
  • Initial MSVC7 build script. MSVC7 is not an officially supported platform - however the release contains MSVC7 precompiled binaries and the build script - will automatically build on both 6 and 7. -
  • Improved performance of G3D::writeStringToFile -
  • G3D::ReferenceCountedPointer assignment now allows compile time subtyping -
  • G3D::ReferenceCountedPointer != operator -
  • G3D::ReferenceCountedPointer::notNull -
  • G3D::GLight::directional now normalizes the light vector -
  • G3D::setAssertionHook -
  • [ 1029256 ] G3D::Shader / G3D::VertexAndPixelShader define g3d_ uniforms inside shaders -
  • static G3D::IFSModel::save/load for writing/reading IFS files -
  • G3D::TextInput allows ' inside quoted strings -
  • G3D::TextInput allows \ as a symbol token -
  • G3D::TextInput supports an arbitrary comment character (e.g. '#') -
  • Precompiled binaries for VisualC++ 7 (.NET 2002/2003) -
  • VisualC++ 7 (.NET 2002/2003) supported by build script -
  • Build now MOVEs binaries instead of COPYing them on Windows (allows - two compilers to output to the same location) -
  • G3D Guide overview documentation -
  • Changelog and Error FAQ moved under Doxygen -
  • Build scripts and documentation now under the 'doc' .dsp on Windows -
  • Textures now support a DepthReadMode that can be used to perform hardware - shadow map comparisions. RenderDevice::configureShadowMap now requires - an appropriately configured texture-- in previous releases it would - reconfigure the texture for you. -
  • G3D::UserInput::keyReleased, G3D::UserInput::ReleasedKeys -
  • G3D::Array::randomElement -
  • G3D::Array::insert -
  • G3D::RenderDevice::getObjectToWorldMatrix and getCameraToWorldMatrix now return - const CoordinateFrame& -
  • Optimized G3D::Array::randomize -
  • G3D::cyclicCatmullRomSpline -
  • G3D::wrap -
  • contrib/AudioDevice -
  • G3D::System::time(); -
  • More precise System::sleep -
  • G3D::IFSModel::pose with no arguments -
  • G3D::AABSPTree::serializeStructure, deserializeStructure, -
  • serialize(Vector3::Axis, BinaryOutput), deserialize(Vector3::Axis, BinaryInput), -
  • "glslc" GLSL compiler in the tools directory for getting compile-time errors from shaders -
  • GLCaps::init now takes optional debug log -
  • G3D::VertexAndPixelShader static constructors take optional 'debug' argument -
  • GWindowSettings::visible; Win32Window can now start invisible -
  • [ 991147 ] glBlendEquationEXT, RenderDevice::BlendEq, min, max, subtract, reverse subtract alpha blending -
  • [ 989785 ] Draw::rect2D -
  • GLCaps::numTextureCoords, GLCaps::numTextureUnits, GLCaps::numTextures -
  • GLCaps::G3D_MAX_TEXTURE_UNITS -
  • Rect2D::corner -
  • GCamera::getFrustum, GCamera::frustum, GCamera::Frustum, GCamera::Frustum::Face -
  • Plane constructor that accepts Vector4s (possibly at infinity) -
  • AABox::inf, AABox::zero, AABox::maxFinite -
  • AABox::intersects(Sphere) -
  • Vector3::minFinite, Vector3::maxFinite -
  • Plane::halfSpaceContainsFinite -
  • Plane::halfSpaceContains(Vector4) -
  • AABSPTree::getIntersectingMembers(Array) -
  • AABSPTree::getIntersectingMembers(GCamera::Frustum) for view-frustum culling -
  • AABSPTree::getIntersectingMembers(Sphere) -
  • AABox::split -
  • Extended AABox::culledBy, Box::culledBy, and Sphere::culledBy with extra - information for bounding volume hierarchies -
  • G3D::computeNormalMap -
  • Matrix3::fuzzyEq(Matrix3) -
  • Removed System::sleep(0.02) from GLG3D demo to give more accurate performance measure -
  • [ 965824 ] changed link library defaults -
  • serialize/deserialize for int, bool, double, float, std::string -
  • G3D::TextOutput -
  • [ 976924 ] Texture::texelWidth -
  • [ 973413 ] VertexAndPixelShader::ArgList::set can be called more than once per variable -
  • OSWindow::setIcon(std::string filename) -
  • Texture::fromMemory that takes a single image (instead of an array of images) -
  • [972604] RenderDevice::setTextureMatrix(uint, Matrix4) -
  • [972747] Rect2D::center -
  • GImage and Texture now load ICO files -
  • GL_SAMPLER_1D_ARB, 2D, 3D, CUBE -
  • Win32Window mouse events -
  • Added normals to AABox collision results -
  • Fix: [ 1026534 ]various cast bugs using Ref types. - Removed G3D::ReferenceCountedPointer implicit cast to underlying pointer type - This is technically an incompatible change, however we found no occurance - in the library or demos using this that was not a bug! -
  • Fix: VAR constructor takes VARAreaRef instead of VARArea* Incompatible change -
  • Fix: ManualCameraController is prevented from looking precisely along the Y-axis, which would cause - a singularity. -
  • Fix: Added '?' as a valid symbol Token -
  • Fix: [ 946235 ] GFont::align right w/ fixed_spacing -
  • Fix: [ 1001033 ] RenderDevice with 0 texture units -
  • Fix: GLCaps:: ARB stencil two side -> EXT stencil two side (stencilled shadows were broken) -
  • Fix: [ 993449 ] vsnprintf crashes MSVC 7 -
  • Fix: [ 991320 ] Pointer truncation Warnings -
  • Fix: [ 981440 ] AUTO with Texture::fromMemory -
  • Fix: Plane::halfSpaceContains now works for infinite and semi-infinite points -
  • Fix: [ 979032 ] Quat <-> Matrix3 roundtrip inverts -
  • Fix: [ 976743 ] document GLCaps functions -
  • Fix: [ 976746 ] #include GLCaps in g3dall -
  • Fix: [ 973550 ] sampler2DRect now supported in GLSL shaders (NVIDIA only; ATI drivers are broken) -
  • Fix: [ 973490 ] Win32Window width/height off by non-client amount -
  • Fix: [ 961827 ] In debug mode, RenderDevice tries to access - GL_MAX_TEXTURE_IMAGE_UNITS_ARB and an assertion fails on cards that - don't support it. -
  • Fix: Texture binding for VertexAndPixelShader -
-
-

- Changes in 6.03: -

    -
  • Matrix4::approxCoordinateFrame -
  • Vector2(const Vector2int16&) [Giulio] -
  • RenderDevice::setObjectShader -
  • RenderDevice::setVertexAndPixelShader -
  • G3D::RenderDevice supports "..._CURRENT" as an option for most settings -
  • inf -> inf(), nan -> nan(), NAN -> NAN() - This is an incompatible change-- it was needed to fix a bug with the order - of initialization of globals -
  • GImage::sizeInMemory -
  • Defined std::ostream << NetAddress, std::ostream << Vector3 -
  • 'build doc' copies the contrib directory to the install directory -
  • LightweightConduit::PacketSizeException -
  • Quat::unitRandom() [Giulio] -
  • Color3::wheelRandom -
  • GImage::save and encode now const [Thanks Arni Mar Jonsson] -
  • LightweightConduit::send that accepts multiple destinations -
  • ReliableConduit::multisend -
  • Moved IFSBuilder from demos to contrib -
  • LightweightConduit and ReliableConduit send/receive can now take references as well as pointers -
  • RenderDevice::clear() that takes no arguments -
  • RenderDevice::setShader -
  • G3D::GApp now catches ShaderGroup::ArgumentError exceptions -
  • System::operatingSystem() now includes a version number on Linux -
  • SDLWindow no longer initializes the audio system; use SDL_InitSubsytem if you need audio. -
  • Extended GLenumToString with GL_SHADER_OBJECTS_ARB types. -
  • NVIDIA p-buffer: GLX_SAMPLE_BUFFERS_ARB, GLX_SAMPLES_ARB, GLX_FLOAT_COMPONENTS_NV, - glXDestroyGLXPbufferSGIX, glXChooseFBConfigSGIX, glXCreateGLXPbufferSGIX, - glXCreateContextWithConfigSGIX, glXQueryGLXPbufferSGIX -
  • NVIDIA swap lock: glXJoinSwapGroupNV, glXBindSwapBarrierNV, glXQuerySwapGroupNV, - glXQueryMaxSwapGroupsNV, glXQueryFrameCountNV, glXResetFrameCountNV -
  • OSWindow::requiresMainLoop, OSWindow::runMainLoop (Beta) -
  • OSWindow::pollEvent, SDLWindow::pollEvent -
  • G3D::GApp accepts an optional OSWindow on construction -
  • G3D::VertexAndPixelShader, G3D::ObjectShader (Beta) -
  • Deprecated GPUProgram, VertexProgram, and PixelProgram (the OpenGL 1.5 shaders - follow a different paradigm than the OpenGL 1.3 ones, so the G3D API must change - to match it). -
  • Support for GL_ARB_vertex_shader, GL_ARB_fragment_shader, and GL_ARB_shader_objects -
  • G3D::drawFeatureEdges -
  • const Array& G3D::MD2Model::PosedModel::objectSpaceFaceNormals(); -
  • G3D::RenderDevice::sendSequentialIndices -
  • Network_Demo -
  • contrib/Win32Window -
  • contrib/pingtest -
  • contrib/GlutWindow [Morgan and Dan Keefe] -
  • contrib/ObjModel [Corey Taylor] -
  • G3D::GLCaps -
  • GAppSettings::logFilename -
  • Deprecated RenderDevice::suportsOpenGLExtension, RenderDevice::supportsImageFormat, - other supports shortcuts (use GLCaps instead). -
  • DiscoveryClient::cleanup -
  • Optimized BinaryInput::readUInt32, readUInt16 -
  • Extended network documentation -
  • 'fastlib' build target for G3D library developers -
  • glGetVector2, glGetVector3, glGetVector4 -
  • float * Quat (double * Quat already existed) -
  • GApp automatically generates g3d-license.txt at runtime ([RFE#856338] CREDIT.TXT) -
  • G3D::license -
  • Removed several large files (tag, ppt, exe) from the source zipfile, bringing it down to 3 MB -
  • Improved CoordinateFrame:pointToObjectSpace() (RFE#715996) [Giulio] -
  • [RFE#945935] Make static constants into functions [Giulio] -
  • Fix: LightweightConduit::send verifies that the packet size is smaller than the UDP limit -
  • Fix: Multitexture on ATI and Wildcat cards -
  • Fix: Incorrect occlusion in GLG3D_Demo (was caused by global constant problem) -
  • Fix: [BUG#949377] Checks for stencil extensions [Giulio] -
  • Fix: [BUG#922725] Non-multitexture implementation for getTextureState() [Giulio] -
  • Fix: Restore ambient light color after RenderDevice::popState -
  • Fix: RenderDevice now initializes OpenGL extensions before testing for multitexture [Erik Cassel, Dan Keefe] -
  • Fix: Bottom clipping plane of GCamera frustum now correct (was slanted incorrectly, making frustum too big) -
  • Fix: GFont::draw2D now returns correct y value (used to be too small) -
  • Fix: NetworkDevice now returns useful hostname on Linux (used to be "localhost") -
  • Fix: The conduit returned from NetworkDevice::createReliableConduit now has ok() == false when connect fails -
  • Fix: Tangent space computation of constant u, v now correct (was missing a factor of 2, leading to slight errors) [Max McGuire] -
  • Fix: [ 925456 ] select broken on Linux (Networking was broken on Linux) -
  • Fix: getDepthBufferValue off by 1 [Andi Fein] -
- -
-

- Changes in 6.02: -

    -
  • Default constructor for Line. -
  • Various patches to make G3D work with the CAVE [Dan Keefe] -
  • AABox::set -
  • Made OSWindow::setPosition non-const -
  • VARArea now tests for the presence of all VBO extensions, on the freak chance that - a driver has only partial support (due to a bug) -
  • Linux build statically links OpenGL 1.2.1 and loads extensions through OpenGL 1.5 - to work around Wildcat Linux driver bug (Windows and Mac statically link OpenGL 1.1 - and load extensions through OpenGL 1.5) -
  • Triangle stores precomputed edge lengths -
  • Ray-triangle with vertex weights -
  • Highly optimized ray-triangle intersection test [Tomas Moller & Ben Trumbore] -
  • Create a texture from 6 different cube-map filenames -
  • Added contrib directory built as part of the 'doc' target -
  • contrib/CoreyGWindow: OSWindow implementations for various platforms -
  • AABSPSet::beginRayIntersection [Pete Hopkins] -
  • AABSPTree::beginBoxIntersection -
  • CollisionDetection::intersectionTimeForMovingPointFixedAABox, Ray::intersectionTime(AABox) - [Pierre Terdiman and Andrew Woo] -
  • Triangle::center -
  • Renamed KDTreeSet to AABSPTree, old name is #defined -
  • RenderDevice now works on cards without multitexture -
  • void glTexCoord(const G3D::Vector4& t); [Dan Keefe] -
  • Overloaded float, double, and int * Matrix3 -
  • Fix: [ 923944 ] Matrix/Quat ambiguity -
  • Fix: fuzzyEq(inf, inf) is true -
  • Fix: Triangle::randomPoint returns values outside the triangle -
  • Fix: [ 913763 ] tokenTypeToString(Token::END) -
  • Fix: Compute number of texture coordinates before RenderDevice::setVideoMode [Dan Keefe] -
  • Changed the default depth bits to '0' for wider compatibility - (Fix: Unable to create OpenGL screen: Couldn't find matching GLX visual) -
  • Fix: [912305] Table, Queue, and Set assignment operators do not free old values -
  • Fix: Separate specular and Multisample on Tablet PC w/ Trident [Dan Keefe] -
  • Fix: Linux debug build now has line numbers -
  • Upgraded to SDL 1.2.7 - Fix: [ 838030 ] SDL 1.2.6 blocks prompt - Fix: FSAA does not work under SDL - Fix: Default Win32 refresh rate -
  • Draw::vertexVectors -
  • New meshes from Brown University: hemisphere.ifs, curvy.ifs, head.ifs, - closed-low-poly-teapot.ifs, bump.ifs -
  • GLight::specular -
  • SDLWindow::setWindowDimensions and setWindowPosition now work on Win32 -
  • GWindowSettings::x, GWindowSettings::y, GWindowSettings::center -
  • System::setEnv -
  • [ 909999 ] OSWindow Joystick interface -
  • double * Quat ([ 909305 ] scalar * {quat, vector, matrix}) -
  • Increased the precision of several Vector2 and Vector3 methods -
  • MeshAlg::computeNormals now returns 0 instead of NaN for degenerate normals -
  • Updated main-no-GApp.cpp for 6.02 -
  • RenderDevice::screenshotPic can copy from the back buffer -
  • Improved VAR documentation. -
  • If NO_SDL_MAIN is defined, G3D does not attempt to link against sdlmain.lib -
  • UserInput::setPureDeltaMouse -
  • UserInput::mouseXY, mouseX, mouseY -
  • UserInput::mouseDXY -
  • Deprecated UserInput keyMapping constructor argument -
  • RenderDevice::setDrawBuffer [Dan Keefe] -
  • GFont::draw3D [Dan Keefe] -
  • GImage::pixel3(x, y) and GImage::pixel4(x, y) -
  • debugAssert, debugBreak, debugAssertM, etc. all release input grab - when an assertion fails (Win32 and Linux) and restore it when the - program continues (Win32). This also fixes the DirectInput laggy - cursor that occurs after a break. -
- -
-

- Changes in 6.01: -

    -
  • Default constructor for G3D::LineSegment -
  • Rect2D::clipPoly (Pete & Morgan) -
  • Draw::poly2D, Draw::poly2DOutline (Pete & Morgan) -
  • Added instructions for rotated text to G3D::GFont::draw2D -
  • Fix: iRandom now compiles correctly under gcc. -
  • Fix: [ 852076 ] Compute better/faster vertex normals in MeshAlg - MeshAlg::computeNormals now weighs adjacent faces by their area -
  • Fix: [ 896028 ] Textures broken on Trident TabletPC (Dan Keefe) -
  • Fix: [ 860800 ] ManualCameraController cursor jumps -
  • Fix: G3D::UserInput no longer offsets the mouse position by 1/2 pixel -
  • Fix: Alt-Tab no longer toggles the GApp camera before switching windows -
  • Fix: [ 901248 ] Font bounds y-value incorrect -
  • Fix: G3D::PhysicsFrame::toCoordinateFrame() was rotated by 90 degrees -
  • Fix: [ 895493 ] Radeon 7500 Cube Map -
  • Fix: G3D::MeshAlg::computeWeld produces linker errors on Linux -
  • G3D::TextInput::peekLineNumber(), G3D::TextInput::peekCharacterNumber() -
  • G3D::GAppSettings::dataDir -
  • html/gettingstarted.html -
  • G3D::MeshAlg::debugCheckConsistency -
  • G3D::MD2Model and G3D::IFSModel now weld their adjacency information -
  • Renamed/retyped G3D::PosedModel::adjacentFaces to G3D::PosedModel::vertices - (most programs can be fixed by changing the type from Array< Array > to - Array and adjacentVertexArray[v] to vertexArray[v].faceIndex) -
  • Shadow volumes now use the welded adjacency information -
  • G3D::PosedModel now offers both welded and non-welded adjacency information -
  • G3D::contains for C-Arrays -
  • Generate .tag files in the build -
  • G3D::MeshAlg::computeAdjacency does not merge colocated vertices -
  • G3D::MeshAlg::computeAdjacency does not remove degenerate faces and edges -
  • G3D::MeshAlg::Vertex -
  • G3D::Vector3::directionOrZero -
  • G3D::GMaterial -
  • ManualCameraController renamed to G3D::FPCameraController -
  • glGetCurrentContext (beta) -
  • G3D::RenderDevice::supportsImageFormat -
  • G3D::Vector3::magnitude -
  • G3D::Vector3::cross() [returns Matrix3] -
  • G3D::Quat changes (API is still in beta) -
  • G3D::Quat::norm now returns the 2-norm, not the function Dave Eberly uses. -
  • Matrix3 default constructor -
  • Switched UserInput to use SDLWindow internally -
  • Switched RenderDevice to use SDLWindow internally -
  • G3D::Window -
  • G3D::SDLWindow -
  • Renamed G3D::RenderDeviceSettings to G3D::WindowSettings (with a typedef for the old name) -
  • IFSModel now loads models with up to 10 million polygons (like the buddha). -
  • Internal G3D::KDTreeSet state now private. -
- -
-

- Changes in 6.00: -

    -
  • FIX: warning: passing `double' for argument 1 of `void G3D::Queue::repackAndRealloc(int)' -
  • Optimized static Matrix3::transpose (36 cycle) and - Matrix3::mul (52 cycle) variations. -
  • Changed some lerp arguments from float to double -
  • MeshAlg::computeTangentSpaceBasis -
  • Draw::axes now uses scale to compute axis length -
  • New ParallaxBump demo -
  • Changed several Vector3 return values from float to double -
  • Real-world stars, sun, and moon path (Nick Musurca) -
  • Now compiles under MSVC++ 7.0 (David Baszucki) -
  • Now compiles under g++ OS/X (Ben Landon) -
  • Changed the default RenderDeviceSettings::alphaBits to 0 in the hope that it - will work with more graphics cards. -
  • Matrix3::fromX methods became factory methods -
  • G3D::sinc -
  • Multi-platform lib directories -
  • Vector3::average(), Color3::average(), Vector3::sum(), Color3::sum() -
  • Ray::reflect, Ray::refract -
  • Physically correct sky model -
  • FIX: Older graphics cards can now initialize properly -
  • Increased fuzzyEpsilon to 0.000001 -
  • Color3::max, Color3::min, Color4::max, Color4::min -
  • Array::sortSubArray -
  • GCamera::getClipPlanes now takes a G3D::Array -
  • G3D::AABox -
  • Box::randomInteriorPoint, Box::randomSurfacePoint -
  • Vector3::cosRandom, Vector3::hemiRandom, Vector3::reflectAbout, Vector3::reflectionDirection, Vector3::refractionDirection -
  • log(Color3) -
  • Upgraded to zlib 1.2.1 -
  • VAR::valid (Peter) -
  • System::getLocalTime, System::getTicks -
  • High-performance cycle count and time queries on Linux -
  • UserInput::anyKeyPressed -
  • G3D::Box now provides axes, center, and extent information - (serialization is backwards compatible to 5.xx) -
  • TextInput's exceptions now provide file, line, and character numbers - as well as preformatted error messages in the style of MSVC++. -
  • G3D::Texture::fromGImage -
  • G3D::TextInput now parses hex numbers of the form 0x##### -
  • G3D::CollisionDetection::penetrationDepthForFixedSphereFixedPlane -
  • G3D::CollisionDetection::penetrationDepthForFixedSphereFixedBox -
  • G3D::beginMarkShadows, G3D::endMarkShadows, G3D::markShadows -
  • GFont::draw2D now returns the string bounds -
  • Sphere::surfaceArea, Sphere::volume, Box::surfaceArea, Box::volume -
  • Two-sided stencil operations -
  • Removed G3D::Real -
  • FIX: [ 855947 ] Fonts are broken on Radeon -
  • Switched vertex arrays to use the new ARB_vertex_buffer_object extension. - Compared to 5.xx rendering speed: NVIDIA/Win32 is the same (fast), - ATI and Linux rendering are about 10x faster. The API has changed - slightly-- most significant, the vertex, normal, color, etc. arrays - must all come from the same VARArea now. -
  • Disabled the "conditional is constant" level 4 warning on Windows - that is triggered by the for-loop scoping fix. -
  • G3D::SkyParameters::directionalLight -
  • G3D::TextureManager (Peter S. & Morgan) -
  • Flipped skybox X-axis to match OpenGL cube map coordinates -
  • Texture now uses hardware MIP-map generation -
  • Texture::copyFromScreen for cube map faces -
  • RenderDevice::configureReflectionMap -
  • RenderDevice::configureShadowMap -
  • Renamed CFont to GFont -
  • Renamed CImage to GImage -
  • G3D::Matrix3::getRow -
  • Added optional argument drawCelestialBodies to Sky::create. -
  • RenderDevice::getTextureMatrix -
  • Depth Textures -
  • Texture::createEmpty -
  • RenderDevice::setViewport has flipped the y-axis since version 5.00 -
  • ReferenceCountedPointer::isLastReference -
  • Support for textures beyond the number of texture units (which occurs on NVIDIA cards) -
  • G3D::PosedModel -
  • G3D::IFSModel -
  • G3D::CoordinateFrame::normalToObjectSpace, G3D::CoordinateFrame::normalToWorldSpace -
  • Simplified arguments on Texture::copyFromScreen -
  • Moved Camera in GLG3D to GCamera in G3D -
  • Moved setProjectionAndCameraMatrix from Camera to RenderDevice -
  • Moved G3D::Rect2D to G3D from GLG3D, changed interface -
  • G3D::setRenderMode -
  • G3D::RenderDevice::setSpecularCoefficient, G3D::RenderDevice::setShininess -
  • G3D::GLight -
  • Renamed G3D::RenderDevice::configureDirectionalLight, configurePointLight to G3D::RenderDevice::setLight -
  • Changed G3D::Rect2D to use doubles -
  • G3D::Camera::setPosition() -
  • G3D::Camera::lookAt() -
  • G3D::ManualCameraController::setPosition() -
  • G3D::System::getTick, G3D::System::getLocalTime -
  • Fixed [ 839618 ] peak var only updated on reset() -
  • G3D::Array::findIndex (thanks to David Baszucki for the suggestion) -
  • Removed RenderDevice::setProjectionMatrix3D and RenderDevice::setProjectionMatrix2D -
  • RenderDevice::project -
  • RenderDevice::push2D() now uses the current viewport instead of full screen by default -
  • RenderDevice::getViewport -
  • G3D::SimTime -
  • Sky::render no longer needs a camera matrix (it gets it from the render device) -
  • SkyRef, Sky::create() -
  • Removed Sky::getName -
  • Removed RenderDevice::setAmbientLightLevel (duplicated RenderDevice::setAmbientLightColor) -
  • G3D::GApp, G3D::GApplet, G3D::GAppSettings -
  • RenderDevice::getCardDescription -
  • GPUProgram interface for setting program constants [Peter, Morgan & Dan] -
  • RenderDevice::getModelViewMatrix -
  • RenderDevice::getModelViewProjectionMatrix -
  • RenderDevice::getProjectionMatrix -
  • Documented some more common compiler errors. -
  • Moved RenderDevice::debugDraw methods to the Draw class, changed rendering from - cylinders to lines for wireframe (for performance) -
  • Ray::direction no longer has unit length -
  • Line::point, Line::direction -
  • LineSegment::endPoint -
  • IFSBuilder loads Brown University Sketch Model (sm) format -
  • New IFS models: angel, distributor-cap, dragon2, duck, elephant, hippo, hub, mech-part, rotor, sandal, trumpet, venus-torso, woman -
  • RenderDevices are now optionally resizable -
  • MeshAlg::computeWeld -
  • Array::randomize -
  • Table now refuses to push the load factor above 19/20 and stops rehashing -
  • Table always keeps an odd number of buckets -
  • Sphere::randomInteriorPoint, Sphere::randomSurfacePoint -
  • LineSegment::randomPoint -
  • Hardcoded some common paths into demoFindData -
  • Deprecated old RenderDevice::init method. -
  • Full screen anti-aliasing (FSAA) -
  • G3D::RenderDeviceSettings -
  • All 2, 3, and 4 character swizzles for Vector2, Vector3, Vector4 are defined. -
  • G3D::rsqrt -
  • Most vector methods are also defined as functions now -
  • sign(Vector2), sign(Vector3), sign(Vector4) -
  • G3D::Matrix4 -
  • Changed G3D_VER from double to integer -
  • G3D::lerp -
  • Changed G3D::PI, G3D::HALF_PI, and G3D::TWO_PI to #defines -
  • Vector2::clamp, Vector3::clamp, Vector4::clamp -
  • Changed order of arguments to all lerp methods to match DirectX/Cg -
  • Changed order of arguments to G3D::clamp and G3D::iClamp to match DirectX/Cg -
  • G3D::ManualCameraController::ManualCameraController now requires a G3D::UserInput -
  • G3D::UserInput::appHasFocus -
  • G3D::ManualCameraController now stops tracking the mouse when the app loses focus -
  • G3D::ManualCameraController::setActive -
  • G3D::ManualCameraController now manages the mouse cursor instead of G3D::RenderDevice -
  • G3D::UserInput::getMouseXY, G3D::UserInput::getXY -
  • RenderDevice::debugDrawVertexNormals -
  • GPUProgram, VertexProgram, and PixelProgram now recognize the output of the - Cg compiler and automatically bind constants. -
  • RenderDevice now loads glActiveStencilFaceEXT -
  • RenderDevice::numTextureCoords -
  • Moved changelog to a separate page -
  • Reformatted overview to be smaller -
  • Added model debugging info to the IFSBuilder display -
  • Welded some broken vertices in the teapot.ifs file -
  • Renamed Font.* to CFont.* -
  • CFont::draw2DString renamed to CFont::draw2D (use a #define to port old code) -
  • MeshAlg -
  • RenderDevice now enables GL_COLOR_MATERIAL by default -
  • msgBox -
  • MD2 model gallery in documentation (Kevin) -
  • MD2Documentor (Kevin) -
  • debugAssertGLOk macro -
  • VertexProgram now supports NVIDIA Vertex Program 2.0 -
  • RenderDevice now loads glGenProgramsNV, glDeleteProgramsNV, glBindProgramNV, glLoadProgramNV, glTrackMatrixNV, glProgramParameter4fvNV, glGetProgramParameterfvNV, glGetProgramParameterdvNV extensions -
  • VertexProgram and PixelProgram static factory methods now return reference counted values. -
  • Split the reference value from RenderDevice::setStencilTest into setStencilConstant -
  • RenderDevice::STENCIL_INVERT, RenderDevice::STENCIL_REPLACE, RenderDevice::STENCIL_ZERO -
  • Added brighten argument to Texture::fromFile -
  • Increased CImage JPEG save quality -
  • RenderDevice::screenshot now returns the name of the file that was written -
  • nextPowerOf2 renamed to ceilPow2 -
  • System::alignedMalloc, System::alignedFree -
  • Carbon, Crackman, Edenmill, Futurist, Interplanetary, - Iomanoid, Starlight, Lesser, and Wild fonts by Ray Larabie. - Like all of our fonts, they are free, but please consider a - donation to him if you like them. http://www.larabiefonts.com/ -
  • MD2Model_Demo -
  • G3D::MD2Model -
  • FIX: Fixed a bug in Array shrinking that could cause memory corruption -
  • FIX: RenderDevice windows with an aspect ratio of less than 1 now allowed. -
  • FIX: TextInput now parses '#', '~', '~=', '&', '&&', '|', '||' correctly -
  • VARArea::reset() now waits for rendering calls using its vertex - arrays to complete before wiping the memory. -
  • G3D::filenameBaseExt, G3D::filenameExt -
  • VARArea::finish() -
  • Milestone -
  • TextInput::Options::signedNumbers -
  • RenderDevice now loads glFlushVertexArrayRangeNV -
  • Vector2int16 -
  • RenderDevice::freeVARSize() -
  • Array now allocates 16-byte aligned pointers. -
  • Decreased the default camera movement rate by 50% for better resolution. -
  • RenderDevice enables GL_NORMALIZE by default -
  • Improved the performance of Array::append/Array::push/Array::next -
  • Fix: [ 875219 ] Array::sort must use std::sort -
  • Array::next -
  • Array::reverse -
  • PCX file loading -
  • Test images -
  • Color3uint8 as uint8[] addressing -
  • Color4uint8 as uint8[] addressing -
  • Removed const from VAR::pointer -
  • ReferenceCountedPointer::isNull -
  • alwaysAssertM -
  • Log::common, Log::getCommonLogFilename -
  • Switched from static to dynamic linking of zlib -
  • Upgraded to zlib 1.1.3 -
  • On Win32 the lib list is automatically updated through pragmas - (5.xx programs should revert to linking against default libraries) -
  • Increased default sky quality to 1.00 -
  • G3D::CFontRef -
  • RenderDevice now loads all register combiner extensions (NVIDIA only) -
  • Sky::getEnvironmentMap -
  • Sky implementation now uses a cube map (when one is available) -
  • G3D::Sky constructor now takes a render device -
  • Rotated Sky box 90 degrees to match environment maps -
  • G3D::Sky now takes the environment filenames as "sky_*.jpg" instead of "sky_ft.jpg" -
  • Added default filename for Sky constructor -
  • Added caustics textures created with Kjell Andersson's generator http://www.lysator.liu.se/~kand/caustics/ -
  • #defined "for" under MSVC so that it obeys C99 scoping rules -
  • System::consoleKeyPressed -
  • System::consoleClearScreen -
  • System::consoleReadKey -
  • NetMessage::type() -
  • Changed the Conduit message protocol to include a message type. - The API is backwards compatible to 5.01 even though the protocol is not. -
  • Removed optional argument maxSize from LightweightConduit::receive. -
  • NetAddress::serialize -
  • NetAddress::deserialize -
  • NetAddress == NetAddress -
  • hashCode(NetAddress) -
  • RenderDevice::init now prints ATI or NVIDIA driver version to the log under Windows -
  • readme.html library build instructions now have downloads for required libraries -
  • Library list has changed for Win32 (added version.lib) -
  • System::cpuArchitecture -
  • System::operatingSystem -
  • double-precision Plane::getEquation -
  • Vector2::lerp -
  • Platform specific #defines G3D_WIN32, G3D_LINUX, G3D_OSX -
  • G3D::Array::contains -
  • G3D::Queue::contains -
  • G3D::ImageFormat -
  • G3D::Texture::DIM_CUBE_MAP -
  • G3D::Texture resizes non-power of two textures -
  • G3D::Texture constructors are completely changed from 5.01 (and hopefully easier to use) -
  • G3D::CImage now supports images with alpha -
  • Removed most of the width/height arguments from G3D::Camera methods -
  • BinaryInput::readBytes and BinaryOutput::writeBytes now take void* as an argument to avoid casting -
  • Plane::fromEquation -
  • Removed Plane::getNormal (use Plane::normal instead) -
  • Removed CDTriangle (use G3D::Triangle instead) -
  • Removed Font (use G3D::CFont instead) -
  • FIX: Camera::getClipPlanes now transforms infinite planes correctly. -
  • FIX: The last reference of an RGC pointer assigned to itself no - longer tries to collect before re-assigning -
- -
-

- Changes in 5.01 -

    -
  • G3D::tesselateComplexPolygon -
  • G3D::ConvexPolygon -
  • G3D::ConvexPolyhedron -
  • G3D::iClamp, G3D::clamp -
  • G3D::iWrap -
  • G3D::iRandom, G3D::random -
  • G3D::getFiles -
  • G3D::getDirs -
  • G3D::VAR::pointer -
  • G3D::realWorldLocalTime -
  • G3D::Texture::TRANSPARENT_BORDER -
  • DECLARE_GLFORMATOF -
  • G3D::System::machineEndian -
  • G3D::VertexProgram, G3D::VertexProgramRef, G3D::RenderDevice::setVertexProgram -
  • G3D::PixelProgram, G3D::PixelProgramRef, G3D::RenderDevice::setPixelProgram -
  • G3D::GPUProgram, G3D::GPUProgramRef -
  • G3D::sizeOfGLFormat -
  • G3D::RenderDevice::setVertexAttrib -
  • G3D::Vector2*=Vector2, /= Vector2, * Vector2, / Vector2 -
  • glFormatOf -
  • G3D::Color4uint8 -
  • G3D::Color3uint8 -
  • G3D::Vector3int16 -
  • G3D::System::currentProgramFilename -
  • CImage::insertRedAsAlpha -
  • CImage::stripAlpha -
  • Texture::hasAlpha -
  • Added support for TGA with alpha channel -
  • Re-implemented Texture to support a broader range of formats and cleaner implementation. -
  • Fix: Improved Texture::LUMINANCE support -
  • Added == and != overloads for Texture::Ref so that "a != NULL" is now legal and does not require a cast to Texture::Ref. -
  • G3D::CFont is a typedef for G3D::Font to avoid name conflicts with X11 Font under Linux. In future releases, the name Font will be deprecated. -
  • RenderDevice::setPointSize -
  • Added a new teapot (teapot.ifs) that is closed, with a properly fitting top. The classic teapot is now called "utah-teapot.ifs" (Sebastian Schuberth and Simon Winkelbach) -
  • RenderDevice::init now loads glPointParameterfvARB, glPointParameterfARB, - glMultiDrawArraysEXT, and glMultiDrawElementsEXT functions. -
  • GLenumToString(4) now returns "GL_TRIANGLES" instead of "GL_LINE_BIT" (both are correct) -
  • Added TextInput::Options to optionally allow C++ comments to - be treated as two slashes instead of a comment -
  • Added data/image/meter.jpg, a meter stick texture convenient for testing -
  • Added sansserif, news, and terminal fonts based on Bitstream's free fonts -
  • RenderDevice::numTextureUnits -
  • Added stars to night Sky -
  • Added classic GL dinosaur model as data/ifs/dinosaur.ifs -
  • Documented G3D::glGetProcAddress -
  • Fix: Texture now restored GL_ENABLE bits properly after creation -
  • Fix: Texture::sizeInMemory now accounts for MIP-map levels -
  • Fix: Fonts and skies now adjust their brightness for the screen gamma level -
  • Fix: Strange compilation bug was causing Sky to be black for some programs -
  • resolveFilename -
  • GLProgram_Demo to show how to use vertex programs in G3D -
  • Support for GL_ARB_vertex_program -
  • Modified ManualCameraController so that diagonal movement does not exceed - maximum rate. -
  • Added support for non-GL_FLOAT vertex arrays to RenderDevice -
  • Added support for Wavefront OBJ files to IFSBuilder -
  • Removed duplicate copies of SDL.dll from the source tree -
  • Renamed G3D::CDTriangle to G3D::Triangle -
  • Added several G3D::Triangle methods -
  • Moved CollisionDetection::primaryAxis to Vector3::primaryAxis -
  • Fix: Texture::sizeInMemory now returns correct results for RGB8 textures. -
  • Changed texture constructors in ways that slightly break backwards compatibility -
  • Deprecated several arguments to the texture constructors. -
- -
- Changes in 5.00 -
    -
  • Color3::operator*=(const Color3&) -
  • Color3::operator*(const Color3&) -
  • Eliminated duplicate GL headers [James O'Sullivan] -
  • Linux Makefiles [James O'Sullivan, Jordan Parker] -
  • RenderDevice::getProjectionMatrixParams -
  • RenderDevice::debugDrawCylinder -
  • Added an option to not copy input memory for BinaryInput -
  • Added data/ifs/sphere.ifs -
  • Added data/ifs/spikeball.ifs -
  • Added a new (imperfect) demo/tool that converts 3DS and MD2 to IFS. -
  • Added RenderDevice to the Font constructor -
  • Removed RenderDevice from Font::drawString -
  • Included glut32.lib, .dll, and .h (Version 3.7.6) in the distribution. - The windows glut port is by Nate Robbins and is from - http://www.xmission.com/~nate/glut.html. - glut was originally written by Mark Kilgard. -
  • Modified OpenGL headers to work cross platform, with the latest NVIDIA extensions -
  • Changed library name from graphics3D.lib to G3D.lib, same for - debug version. -
  • Changed directory structure and added readme.html to explain - the new setup. -
  • Changed BinaryInput::readBytes to allow reading onto the stack -
  • Added Vector4::isFinite -
  • G3D::CDTriangle (for 35% faster collision detection) -
  • CollisionDetection::closestPointToRectangle -
  • CollisionDetection::movingSpherePassesThroughFixedBox -
  • CollisionDetection::movingSpherePassesThroughFixedSphere -
  • Changed CollisionDetection::movingXFixedTriangle arguments -
  • CollisionDetection::collisionTimeForMovingSphereFixedSphere -
  • Changed CollisionDetection::distanceToX methods to closestPointToX -
  • Vector3::NAN3 -
  • Made Vector3::isUnit fuzzy -
  • Made Vector3::isZero fuzzy -
  • Fix: Texture(std::string, std::string) constructor now works for alpha-only textures. -
  • FIX: Array now calls copy constructor when resizing -
  • FIX: Triangle-sphere and rectangle-sphere collision detection - returned an incorrect collision location; now fixed. -
  • FIX: changed VectorX::isFinite to call isFinite (used to give bad result for NaNs) -
  • FIX: Used the normalized edge to compute intersection in - CollisionDetection::distanceToTrianglePerimeter -
  • FIX: Changed the order of corners returned from Box::getFaceCorners so the - face is ccw, facing out -
  • FIX: ManualCameraController::lookAt now faces along the -z axis. -
  • FIX: data/ifs/icosa.ifs model is now an icosahedron -
  • Made Set::begin() and Set::end() const -
  • Added ifdef _WIN32 all over for typedefing types from Windows to Linux and vice versa. -
  • G3D::isNaN, G3D::isFinite -
  • Added a single triangle triangle.ifs file -
  • G3D::LineSegment -
  • RenderDevice::debugDrawRay -
  • CoordinateFrame::toObjectSpace(Ray&) -
  • CoordinateFrame::toObjectSpace(Box&) -
  • CoordinateFrame::toObjectSpace(Sphere&) -
  • Changed CollisionDetection routines to return the surface normal of the - surface at the collision location. -
  • CollisionDetection::collisionTimeForMovingPointFixedCapsule -
  • CollisionDetection::collisionTimeForMovingSphereFixedCapsule -
  • G3D::Capsule class -
  • Removed e-mail addresses from contributor list to protect them from spammers -
  • Linux port [Hari Khalsa & Chris Kern] -
  • Added serialize and deserialize methods, deserializing constructor to - Vector2, Vector3, Vector4, Color3, Color4, Matrix3, CoordinateFrame, Box, - Sphere, Plane, Ray, Line, Capsule, LineSegment -
  • Moved parts of Plane.h into Plane.cpp -
  • BinaryInput::readBool8 and BinaryOutput::writeBool8 -
  • G3D::System [based on Michael Herf, Rob Wyatt, and Benjamin - Jurke's work] -
  • Networking infrastructure: G3D::NetworkDevice, G3D::NetAddress, - G3D::ReliableConduit, G3D::LightweightConduit, G3D::NetListener -
  • G3D::Camera -
  • Vector2::toString -
  • G3D::createTempFile -
  • G3D::fileLength -
  • UserInput::setKeyMapping -
  • UserInput::keyCodeToString, UserInput::stringToKeyCode -
  • JPEG library uses createTempFile -
  • JPEG library will allocate up to 6MB before resorting to temp - files-- faster and more reliable -
  • Moved SDL initialization to RenderDevice constructor from the init - method so extension can be used earlier -
  • Support for up to 8 texture units, no longer crashes on machines - that have more than 4 units -
  • Made Arrays allocate at least 32 bytes when resized to improve - performance of small char stacks -
  • Added UserInput key codes for mouse wheel buttons -
  • UserInput::keyPressed, UserInput::pressedKeys() -
  • UserInput::GKey -
  • Renamed UserInput::poll() to UserInput::endEvents(), added - UserInput::beginEvents() -
  • Moved custom UserInput key codes into an enum so they are - compile-time constants -
  • Changed all to for cross-platform [Rob & Chris] -
  • Moved LITTLE_ENDIAN and BIG_ENDIAN constants to an enum and renamed - them to G3D_LITTLE_ENDIAN and G3D_BIG_ENDIAN for cross-platform - [Rob & Chris] -
  • Permanently fixed the precision of Real to be 32-bit float. -
  • RenderDevice now loads the NVIDIA VAR fence extensions. -
  • Renamed RenderDevice::begin to RenderDevice::beginPrimitive, same - for end. -
  • Redesigned the vertex array system; see VAR and VARArea. -
  • Changed GLG3D demo to demonstrate the use of the new VAR and - VARArea classes -
  • CoordinateFrame(Vector3) constructor. -
  • Improved the performance of zero-radius sphere [aka point] - collision detection -
- -
-

- Changes in 4.01 -

    -
  • trimWhitespace() -
  • Pointwise multiplication and division for Vector3 -
  • Array::sort now uses > operator by default; two alternative sort methods allow qsort style sorting -
  • Texture::copyFromScreen -
  • Texture::invertY -
  • BinaryInput/BinaryOutput compression (via zlib) -
  • Alpha-only G3D::Texture mode -
  • G3D::Font and fonts in data/font -
  • Array::fastRemove -
  • TextInput [Morgan & Aaron] -
  • Color4::CLEAR -
  • Table [] operator now returns a non-const reference -
  • RenderDevice::getFrameRate, RenderDevice::getTriangleRate, RenderDevice::getTriangleCount -
  • ManualCameraController::setMoveRate, ManualCameraController::setTurnRate -
  • SkyParameters default constructor -
  • Vector2, Vector3, Vector4 isZero(), isUnit(), isFinite() -
  • Vector4::length(), Vector4::squaredLength() -
  • isValidPointer now returns false for 0xFEEEFEEE -
  • RenderDevice checks for texture compression extensions -
  • Restructured the directories for the CPP sources (only affects people who build G3D) -
  • Included NVIDIA and SGI OpenGL headers in the distribution, changed install notes -
  • Fixed a bug that previously prevented textures from being garbage collected -
  • Fixed Line::distance returning values too small -
  • Fixed Plane(normal, point) constructor to compute point from normalized direction [Kevin] -
  • LED font by Matthew Welch daffy-duck@worldnet.att.net -
  • VenusRising font by Ray Larabie drowsy@cheerful.com -
  • VideoFreak font by Jakob Fischer pizzadude@pizzadude.dk -
- -
-

- Changes in 4.00 -

    -
  • Moved texture combine modes from Textures onto RenderDevice texture units -
  • Documented RenderDevice::getHDC() (Windows only) -
  • Renamed RenderDevice::swapBuffers() to RenderDevice::endFrame(), added corresponding RenderDevice::beginFrame() -
  • Moved getNumJoySticks from RenderDevice to UserInput -
  • Added TEX_ADD combine mode -
  • Table::getKeys and Set::getMembers now have overloads that take an Array as input. -
  • BinaryOutput::getCArray -
  • RenderDevice::getObjectToWorldMatrix(), RenderDevice::getCameraToWorldMatrix() -
  • RenderDevice::debugDrawAxes(), RenderDevice::debugDrawBox(), RenderDevice::debugDrawSphere() -
  • Color3::Color3(const Vector3&) and Color4::Color4(const Vector4&) -
  • Moved hashCode(const Vector3&) and hashCode(const Vector4&) to the global namespace [Kevin] -
  • isValidPointer now returns false for 0xCCCCCCCC and 0xDEADBEEF -
  • Fix: RenderDevice::setPolygonOffset now affects polygons rendered in line and point mode -
  • Fix: Sun is now invisible after it goes below the horizon -
  • Fix: BinaryInput now supports endian-ness correctly in memory read mode -
  • Fix: Table.copyFrom and copy constructor now work -
- -
-

- Changes in 3.02 -

    -
  • Built libraries using "Multithreaded DLL" [Kevin & Darius] -
  • Added depth, color, and stencil bit depth preferences to G3D::RenderDevice -
  • G3D::Sky (plus sky directory in the data distribution) -
  • Sky cube data [Jauhn Dabz, jauhn@yahoo.com, http://nullpoint.fragland.net] -
  • G3D::UserInput -
  • G3D::ManualCameraController -
  • G3D::SkyParameters -
  • G3D::toSeconds, G3D::AMPM, G3D::GameTime, G3D::RealTime -
  • G3D::RenderDevice::project -
  • G3D::linearSpline -
  • G3D::Color3::fromARGB and G3D::Color4::fromARGB -
  • Added non-const G3D::Array::last() [Kevin] -
  • Modified G3D::RenderDevice::configureDirectionalLight to operate in world space -
  • Fix: Flipped the y-axis of G3D::RenderDevice::getDepthBufferValue so it matches the documentation. -
  • Removed brief descriptions from documentation -
  • Removed sqrt, sin, cos, etc. that conflict with standard library names -
  • Removed TWO_PI constant -
  • Removed G3D::Matrix3 virtual destructor -
  • Removed G3D::Quat virtual destructor [Kevin] -
- -
- Changes in 3.01 -
    -
  • Changed an assert() to debugAssert() in Queue.h -
  • G3D::Table doesn't grow the number of buckets under bad hash codes [Morgan & Darius] -
  • G3D::Table allocates only 10 initial buckets -
  • G3D::Table::debugGetLoad() -
  • G3D::CollisionDetection::collisionTimeForMovingPointFixedRectangle -
  • G3D::CollisionDetection::collisionTimeForMovingPointFixedBox -
  • G3D::Ray::intersectionTime, G3D::Ray::unit() -
  • G3D::Log [Morgan & Aaron] -
  • G3D::RenderDevice (OpenGL state abstraction. VertexBuffer support is beta only) -
  • G3D::Texture (includes texture compression, image loading, and texture rectangle) -
  • Added a comment to the vector classes noting that they can't be sublcassed [Kevin Egan] -
-
- Changes in 3.00 -
    -
  • G3D::NEWLINE -
  • writeStringToFile -
  • Fixed empty stringJoin bug -
  • Fixed parseFilename with no path bug -
  • Vector3::INF3, Vector3::ZERO3 -
  • G3D::PhysicsFrame (beta-- this interface is going to change in 4.00) -
  • G3D::Vector4 -
  • G3D::Queue -
  • Default constructor for G3D::CImage -
  • G3D::isValidHeapPointer, G3D::isValidPointer -
  • G3D::Ray -
  • CImage copy constructor, CImage::load -
  • Removed \#pragma once for gcc compatibility -
  • Renamed several hashcode methods to hashCode -
  • Fixed fuzzy math to work with infinite numbers -
  • Fixed Table::remove(), Set::remove() bug [Darius Jazayeri] -
  • G3D::CoordinateFrame.toObjectSpace(Vector4), G3D::CoordinateFrame.toWorldSpace(Vector4) -
  • Added the data directory -
  • G3D::CollisionDetection -
  • G3D::Sphere::culledBy() -
  • Added the GLG3D library [Morgan McGuire & Seth Block] -
  • Changed SDL_GL_Demo to use GLG3D, rotate triangle, and use color blending -
  • Fixed debugPrintf to handle long strings on Win32 -
  • Wrapped the MMX headers with \#ifdefs [Nate Miller] -
  • Moved OpenGL code out of CoordinateFrame.h/cpp -
  • Fixed BinaryInput readVector*, readColor* to read in correct order [Nate Miller] -
  • BinaryInput::readVector4, BinaryInput::readColor4, BinaryOutput::writeVector4, BinaryOutput::writeColor4 -
  • IFS_Demo for loading IFS files, dealing with models in OpenGL [Nate Miller] -
- -
-

- Changes in 2.00 -

    -
  • Vector2 members renamed to x,y from s,t -
  • Added SDL_GL_Demo and Win32_Demo -
  • Removed Group -
- -
-

- Changes in 1.10 -

    -
  • CImage, color conversion routines [Morgan McGuire, John Chisholm, and Edward Resnick] -
  • Array dereference for BinaryInput -
  • BinaryInput from memory -
  • BinaryOutput to memory -
  • toUpper(std::string), toLower(std::string) -
  • Group::clear() -
  • inf, nan as global constants (double precision) -
  • Can iterate over const Tables -
  • Table::deleteValues() -
  • Fixed an off-by-one bug in BinaryInput::readString() -
  • beginsWith() and wordWrap() string utilities -
  • prompt dialogs have fixed width font [Kurt Miller] -
  • iMax(), iMin() -
  • Array::sort() -
  • stringCompare(), stringPtrCompare() -
  • readFileAsString() -
  • Fixed textPrompt() to wait for input -
  • BinaryInput.getFilename(), BinaryOutput.getFilename() -
  • ReferenceCount [Justin Miller] -
  • endsWith() -
  • stringSplit(), stringJoin() -
  • Renamed format.* to stringutils.* -
  • fileExists(), parseFilename(), createDirectory(), copyFile() -
  • highestBit() [Jukka Liimatta] -
  • flipRGBVertical() -
  • Changed all header guards to use G3D_ prefix -
  • ConvexPolyhedron -
  • Virtual destructors on almost all objects. -
  • RGBtoBGR() -
  • Color4 -
  • Array::pop(bool shrinkArray=true) -
  • Vector2::isFinite, Vector2::fuzzyEq, Vector::fuzzyNe -
-

- -


- Changes in 1.09 -
    -
  • Removed pointer hash [Aaron Orenstein] -
  • Changed some includes from quotes to pointy brackets [Aaron Orenstein] -
  • Sphere::toString() -
  • Plane::toString() -
  • Added a change log -
- - */ diff --git a/externals/g3dlite/doc-files/contributors.dox b/externals/g3dlite/doc-files/contributors.dox deleted file mode 100644 index 3cd946a0bf1..00000000000 --- a/externals/g3dlite/doc-files/contributors.dox +++ /dev/null @@ -1,85 +0,0 @@ -/** -@page contributors G3D Developer Credits - - Team Members -
7.01 Release Team -
Morgan McGuire [Williams College] - Project Manager -
Corey Taylor [EA] - Assistant Project Manager and Linux Lead -
Casey O'Donnell [RPI] - OS X Lead -
Dan Keefe [Brown University] - Developer -
Kyle Whitson [Williams College] - Developer -
Danny Yuxing Huang [Williams College] - Developer - - Previous Contributors and Cited Sources
This library - contains code and resources contributed by the following people, or - based open code and articles by them. Starred (*) developers are - previous members of the %G3D team. - -

David Baszucki -
Seth Block -
Nicholas Bray -
Nick Capens -
Erik Cassel -
John Chisholm* -
Jauhn Dabz -
Erik de Castro Lopo -
Rich Deeson* -
Chris Demetriou -
L. Peter Deutsch -
Dmitri* -
Dave Eberly -
Kevin Egan* -
Cass Everitt -
Dan Fast* -
Andi Fein -
Jakob Fischer -
Dan Keefe* -
Harishabd Khalsa -
Nicolai Haehnle -
Michael Herf -
Daniel Hilferty* -
Pete Hopkins -
Danny Yuxing Huang -
Peter Hunt -
Robert Hunter -
Ed Johnson -
Benjamin Jurke -
Chris Kern -
Independent JPEG Group -
Darius Jazayeri -
Ben Landon* -
Thomas G. Lane -
Ray Larabie -
Jukka Liimatta -
Giulio Mainardi -
Jeff Marsceill -
Max McGuire -
Morgan McGuire -
Justin Miller -
Kurt Miller -
Nate Miller -
Tomas Moller -
Eric Muller* -
Nick Musurca -
Akita Noek -
James O'Sullivan* -
Aaron Orenstein -
Jordan Parker -
Edward Resnick -
Alex Rice -
Jack Ritter -
Nate Robbins -
Joshua Schpok* -
Sebastian Schubert -
SGI -
Ben Shine* -
Peter Sibley* -
Gabe Taubman* -
Corey Taylor* -
Pierre Terdiman -
Ben Trumbore -
Matthew Welch -
Simon Winkelbach -
Laura Wollstadt -
Andrew Woo -*/ diff --git a/externals/g3dlite/doc-files/license.dox b/externals/g3dlite/doc-files/license.dox deleted file mode 100644 index b4302651fbf..00000000000 --- a/externals/g3dlite/doc-files/license.dox +++ /dev/null @@ -1,120 +0,0 @@ -/** @page license License - -\htmlonly -
- -Introduction - -Installation
-\endhtmlonly - -@section intent Intent of License - (This section is informal and not legally binding.) - -
This library is free code-- you can use it without charge and - it is minimally legally encumbered. Unlike some other free libraries, - we do not require you to release - your source code or make your own program open source. - -

I intend the license (below) to protect me and the other - contributors from liability and allow you to use the source however - you want. You can make your own closed or open-source programs, - sell them, give them away, whatever. - -

- You have an obligation to say "this software is based in part on - the work of the Independent JPEG Group" in your documentation or - application help if you use the G3D::GImage class because it is based on - the IJG library. The OpenGL headers and ZLib headers included may - be freely distributed provided their copyright notices remain - intact. - -

- For convenience, G3D::license is a function that returns the license - string you must put in your documentation. G3D::GApp will automatically - write a file (g3d-license.txt) to disk with the contents of this - license unless you tell it not to. - -

- Most of the data resources have either entered the public domain and have - been in several published papers or are data that I have explicitly - received permission to distribute with G3D. The G3D fonts are actually font - images, not TrueType font descriptions and may be freely - distributed. As a rule of thumb, you can freely use and distribute - anything you find in the data directory but may need permission to use - it in a commercial product. Check the various copyright.txt files - in the data directories for specific information. - -

- - You are required by the BSD license to acknowledge G3D in your - documentation. This can be as minimal as a note buried in the - fine print at the end of a manual or a text file accompanying - your program. I appreciate it if you acknowledged the library - more publicly but you aren't required to. - -

- - Likewise, you are encouraged but not required to submit patches to - improve the library for the benefit of all. E-mail me with bugs, - patches, and questions.

- - -Morgan McGuire - <matrix@graphics3d.com> - -


- - @section reallicense License - - G3D is licensed under the BSD license, - with portions controlled by the IJG license, - PNG Reference Library license and - GNU Lesser General Public License (LGPL). - - - -
This product uses software from the G3D project (http://g3d-cpp.sf.net) -
Copyright © 2000-2008, Morgan McGuire -
All rights reserved. -

- Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: -

- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -

- 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. -

- Neither the name of Morgan McGuire, Williams College, Brown University, nor the names of - its contributors may be used to endorse or promote products derived from - this software without specific prior written permission. -

- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. - - -

- You must also agree to be bound by the terms of the Independent JPEG - Group license for the portions of this library that are based - on the work of the Independent JPEG Group, if you use those - portions. Note: if you do not use the G3D::GImage class, - this clause does not apply to you because the linker will - strip that code from your project. The IJG-README.TXT file contains the - Independent JPEG Group license. - - - - */ \ No newline at end of file diff --git a/dep/src/g3dlite/fileutils.cpp b/externals/g3dlite/fileutils.cpp similarity index 100% rename from dep/src/g3dlite/fileutils.cpp rename to externals/g3dlite/fileutils.cpp diff --git a/dep/src/g3dlite/format.cpp b/externals/g3dlite/format.cpp similarity index 100% rename from dep/src/g3dlite/format.cpp rename to externals/g3dlite/format.cpp diff --git a/dep/src/g3dlite/g3dfnmatch.cpp b/externals/g3dlite/g3dfnmatch.cpp similarity index 100% rename from dep/src/g3dlite/g3dfnmatch.cpp rename to externals/g3dlite/g3dfnmatch.cpp diff --git a/dep/src/g3dlite/g3dmath.cpp b/externals/g3dlite/g3dmath.cpp similarity index 100% rename from dep/src/g3dlite/g3dmath.cpp rename to externals/g3dlite/g3dmath.cpp diff --git a/dep/src/g3dlite/prompt.cpp b/externals/g3dlite/prompt.cpp similarity index 100% rename from dep/src/g3dlite/prompt.cpp rename to externals/g3dlite/prompt.cpp diff --git a/dep/src/g3dlite/stringutils.cpp b/externals/g3dlite/stringutils.cpp similarity index 100% rename from dep/src/g3dlite/stringutils.cpp rename to externals/g3dlite/stringutils.cpp diff --git a/externals/g3dlite/win/VC90/g3dlite.vcproj b/externals/g3dlite/win/VC90/g3dlite.vcproj index e76d610ab69..6d6c4c07fc5 100644 --- a/externals/g3dlite/win/VC90/g3dlite.vcproj +++ b/externals/g3dlite/win/VC90/g3dlite.vcproj @@ -21,8 +21,8 @@ @@ -45,18 +45,19 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" Optimization="0" - AdditionalIncludeDirectories="..\..\zip.lib\include;..\..\G3D.lib\include;..\..\..\zlib;" + AdditionalIncludeDirectories="..\..\..\zlib\;" AdditionalUsingDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32" MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" BufferSecurityCheck="true" EnableFunctionLevelLinking="true" + EnableEnhancedInstructionSet="0" UsePrecompiledHeader="0" - AssemblerListingLocation=".\g3dlite__$(PlatformName)_$(ConfigurationName)\" - ObjectFile=".\g3dlite__$(PlatformName)_$(ConfigurationName)\" - ProgramDataBaseFileName=".\g3dlite__$(PlatformName)_$(ConfigurationName)\" + AssemblerListingLocation="" + ObjectFile=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\" + ProgramDataBaseFileName=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" @@ -73,8 +74,9 @@ /> @@ -119,18 +121,19 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" Optimization="0" - AdditionalIncludeDirectories="..\..\zip.lib\include;..\..\G3D.lib\include;..\..\..\zlib;" + AdditionalIncludeDirectories="..\..\..\zlib\;" AdditionalUsingDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32" MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" BufferSecurityCheck="true" EnableFunctionLevelLinking="true" + EnableEnhancedInstructionSet="0" UsePrecompiledHeader="0" - AssemblerListingLocation=".\g3dlite__$(PlatformName)_$(ConfigurationName)\" - ObjectFile=".\g3dlite__$(PlatformName)_$(ConfigurationName)\" - ProgramDataBaseFileName=".\g3dlite__$(PlatformName)_$(ConfigurationName)\" + AssemblerListingLocation="" + ObjectFile=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\" + ProgramDataBaseFileName=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" @@ -147,8 +150,9 @@ /> @@ -191,15 +195,17 @@ @@ -261,15 +268,17 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/externals/g3dlite/zip.lib/include/zip/ioapi.h b/externals/g3dlite/zip.lib/include/zip/ioapi.h deleted file mode 100644 index 7d457baab34..00000000000 --- a/externals/g3dlite/zip.lib/include/zip/ioapi.h +++ /dev/null @@ -1,75 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#ifndef _ZLIBIOAPI_H -#define _ZLIBIOAPI_H - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - -#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) -#define ZCALLBACK CALLBACK -#else -#define ZCALLBACK -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - - - -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) -#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) -#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) -#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) -#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/externals/g3dlite/zip.lib/include/zip/unzip.h b/externals/g3dlite/zip.lib/include/zip/unzip.h deleted file mode 100644 index b247937c807..00000000000 --- a/externals/g3dlite/zip.lib/include/zip/unzip.h +++ /dev/null @@ -1,354 +0,0 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _unz_H -#define _unz_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -extern unzFile ZEXPORT unzOpen OF((const char *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ - -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern int ZEXPORT unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -/* ****************************************** */ - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about - the current file - if szFileName!=NULL, the filemane string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -extern z_off_t ZEXPORT unztell OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -extern int ZEXPORT unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -extern uLong ZEXPORT unzGetOffset (unzFile file); - -/* Set the current file offset */ -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - - -#ifdef __cplusplus -} -#endif - -#endif /* _unz_H */ diff --git a/externals/g3dlite/zip.lib/include/zip/zip.h b/externals/g3dlite/zip.lib/include/zip/zip.h deleted file mode 100644 index acacce83b9b..00000000000 --- a/externals/g3dlite/zip.lib/include/zip/zip.h +++ /dev/null @@ -1,235 +0,0 @@ -/* zip.h -- IO for compress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow creates .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - For uncompress .zip file, look at unzip.h - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.html for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _zip_H -#define _zip_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagzipFile__ { int unused; } zipFile__; -typedef zipFile__ *zipFile; -#else -typedef voidp zipFile; -#endif - -#define ZIP_OK (0) -#define ZIP_EOF (0) -#define ZIP_ERRNO (Z_ERRNO) -#define ZIP_PARAMERROR (-102) -#define ZIP_BADZIPFILE (-103) -#define ZIP_INTERNALERROR (-104) - -#ifndef DEF_MEM_LEVEL -# if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -# else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -# endif -#endif -/* default memLevel */ - -/* tm_zip contain date/time info */ -typedef struct tm_zip_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_zip; - -typedef struct -{ - tm_zip tmz_date; /* date in understandable format */ - uLong dosDate; /* if dos_date == 0, tmu_date is used */ -/* uLong flag; */ /* general purpose bit flag 2 bytes */ - - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ -} zip_fileinfo; - -typedef const char* zipcharpc; - - -#define APPEND_STATUS_CREATE (0) -#define APPEND_STATUS_CREATEAFTER (1) -#define APPEND_STATUS_ADDINZIP (2) - -extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); -/* - Create a zipfile. - pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on - an Unix computer "zlib/zlib113.zip". - if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip - will be created at the end of the file. - (useful if the file contain a self extractor code) - if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will - add files in existing zip (be sure you don't add file that doesn't exist) - If the zipfile cannot be opened, the return value is NULL. - Else, the return value is a zipFile Handle, usable with other function - of this zip package. -*/ - -/* Note : there is no delete function into a zipfile. - If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte -*/ - -extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); - -extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level)); -/* - Open a file in the ZIP for writing. - filename : the filename in zip (if NULL, '-' without quote will be used - *zipfi contain supplemental information - if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local - contains the extrafield data the the local header - if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global - contains the extrafield data the the local header - if comment != NULL, comment contain the comment string - method contain the compression method (0 for store, Z_DEFLATED for deflate) - level contain the level of compression (can be Z_DEFAULT_COMPRESSION) -*/ - - -extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw)); - -/* - Same than zipOpenNewFileInZip, except if raw=1, we write raw file - */ - -extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCtypting)); - -/* - Same than zipOpenNewFileInZip2, except - windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 - password : crypting password (NULL for no crypting) - crcForCtypting : crc of file to compress (needed for crypting) - */ - - -extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); -/* - Write data in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); -/* - Close the current file in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); -/* - Close the current file in the zipfile, for fiel opened with - parameter raw=1 in zipOpenNewFileInZip2 - uncompressed_size and crc32 are value for the uncompressed size -*/ - -extern int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); -/* - Close the zipfile -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* _zip_H */ diff --git a/externals/g3dlite/zip.lib/source/crypt.h b/externals/g3dlite/zip.lib/source/crypt.h deleted file mode 100644 index 622f4bc2ec4..00000000000 --- a/externals/g3dlite/zip.lib/source/crypt.h +++ /dev/null @@ -1,132 +0,0 @@ -/* crypt.h -- base code for crypt/uncrypt ZIPfile - - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This code is a modified version of crypting code in Infozip distribution - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - If you don't need crypting in your application, just define symbols - NOCRYPT and NOUNCRYPT. - - This code support the "Traditional PKWARE Encryption". - - The new AES encryption added on Zip format by Winzip (see the page - http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong - Encryption is not supported. -*/ - -#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) - -/*********************************************************************** - * Return the next byte in the pseudo-random sequence - */ -static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) -{ - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ - - temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; - return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -} - -/*********************************************************************** - * Update the encryption keys with the next byte of plain text - */ -static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) -{ - (*(pkeys+0)) = CRC32((*(pkeys+0)), c); - (*(pkeys+1)) += (*(pkeys+0)) & 0xff; - (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; - { - register int keyshift = (int)((*(pkeys+1)) >> 24); - (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); - } - return c; -} - - -/*********************************************************************** - * Initialize the encryption keys and the random header according to - * the given password. - */ -static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) -{ - *(pkeys+0) = 305419896L; - *(pkeys+1) = 591751049L; - *(pkeys+2) = 878082192L; - while (*passwd != '\0') { - update_keys(pkeys,pcrc_32_tab,(int)*passwd); - passwd++; - } -} - -#define zdecode(pkeys,pcrc_32_tab,c) \ - (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) - -#define zencode(pkeys,pcrc_32_tab,c,t) \ - (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) - -#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED - -#define RAND_HEAD_LEN 12 - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ -# endif - -static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) - const char *passwd; /* password string */ - unsigned char *buf; /* where to write header */ - int bufSize; - unsigned long* pkeys; - const unsigned long* pcrc_32_tab; - unsigned long crcForCrypting; -{ - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - unsigned char header[RAND_HEAD_LEN-2]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ - - if (bufSize> 7) & 0xff; - header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); - } - /* Encrypt random header (last two bytes is high word of crc) */ - init_keys(passwd, pkeys, pcrc_32_tab); - for (n = 0; n < RAND_HEAD_LEN-2; n++) - { - buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); - } - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); - return n; -} - -#endif diff --git a/externals/g3dlite/zip.lib/source/ioapi.c b/externals/g3dlite/zip.lib/source/ioapi.c deleted file mode 100644 index f1bee23e64b..00000000000 --- a/externals/g3dlite/zip.lib/source/ioapi.c +++ /dev/null @@ -1,177 +0,0 @@ -/* ioapi.c -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include -#include -#include - -#include "zlib.h" -#include "ioapi.h" - - - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -voidpf ZCALLBACK fopen_file_func OF(( - voidpf opaque, - const char* filename, - int mode)); - -uLong ZCALLBACK fread_file_func OF(( - voidpf opaque, - voidpf stream, - void* buf, - uLong size)); - -uLong ZCALLBACK fwrite_file_func OF(( - voidpf opaque, - voidpf stream, - const void* buf, - uLong size)); - -long ZCALLBACK ftell_file_func OF(( - voidpf opaque, - voidpf stream)); - -long ZCALLBACK fseek_file_func OF(( - voidpf opaque, - voidpf stream, - uLong offset, - int origin)); - -int ZCALLBACK fclose_file_func OF(( - voidpf opaque, - voidpf stream)); - -int ZCALLBACK ferror_file_func OF(( - voidpf opaque, - voidpf stream)); - - -voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); - return file; -} - - -uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; -{ - uLong ret; - ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - - -uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; -{ - uLong ret; - ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -long ZCALLBACK ftell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - long ret; - ret = ftell((FILE *)stream); - return ret; -} - -long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - fseek((FILE *)stream, offset, fseek_origin); - return ret; -} - -int ZCALLBACK fclose_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret; - ret = fclose((FILE *)stream); - return ret; -} - -int ZCALLBACK ferror_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret; - ret = ferror((FILE *)stream); - return ret; -} - -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} diff --git a/externals/g3dlite/zip.lib/source/iowin32.c b/externals/g3dlite/zip.lib/source/iowin32.c deleted file mode 100644 index ce911e3636e..00000000000 --- a/externals/g3dlite/zip.lib/source/iowin32.c +++ /dev/null @@ -1,272 +0,0 @@ -#ifdef _MSC_VER -/* iowin32.c -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - This IO API version uses the Win32 API (for Microsoft Windows) - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include - -#include "zlib.h" -#include "ioapi.h" -#include "iowin32.h" - -#ifndef INVALID_HANDLE_VALUE -#define INVALID_HANDLE_VALUE (0xFFFFFFFF) -#endif - -#ifndef INVALID_SET_FILE_POINTER -#define INVALID_SET_FILE_POINTER ((DWORD)-1) -#endif - -voidpf ZCALLBACK win32_open_file_func OF(( - voidpf opaque, - const char* filename, - int mode)); - -uLong ZCALLBACK win32_read_file_func OF(( - voidpf opaque, - voidpf stream, - void* buf, - uLong size)); - -uLong ZCALLBACK win32_write_file_func OF(( - voidpf opaque, - voidpf stream, - const void* buf, - uLong size)); - -long ZCALLBACK win32_tell_file_func OF(( - voidpf opaque, - voidpf stream)); - -long ZCALLBACK win32_seek_file_func OF(( - voidpf opaque, - voidpf stream, - uLong offset, - int origin)); - -int ZCALLBACK win32_close_file_func OF(( - voidpf opaque, - voidpf stream)); - -int ZCALLBACK win32_error_file_func OF(( - voidpf opaque, - voidpf stream)); - -typedef struct -{ - HANDLE hf; - int error; -} WIN32FILE_IOWIN; - -voidpf ZCALLBACK win32_open_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; -{ - const char* mode_fopen = NULL; - DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; - HANDLE hFile = 0; - voidpf ret=NULL; - - dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0; - - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - { - dwDesiredAccess = GENERIC_READ; - dwCreationDisposition = OPEN_EXISTING; - dwShareMode = FILE_SHARE_READ; - } - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - { - dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; - dwCreationDisposition = OPEN_EXISTING; - } - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - { - dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; - dwCreationDisposition = CREATE_ALWAYS; - } - - if ((filename!=NULL) && (dwDesiredAccess != 0)) - hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, - dwCreationDisposition, dwFlagsAndAttributes, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - hFile = NULL; - - if (hFile != NULL) - { - WIN32FILE_IOWIN w32fiow; - w32fiow.hf = hFile; - w32fiow.error = 0; - ret = malloc(sizeof(WIN32FILE_IOWIN)); - if (ret==NULL) - CloseHandle(hFile); - else *((WIN32FILE_IOWIN*)ret) = w32fiow; - } - return ret; -} - - -uLong ZCALLBACK win32_read_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; -{ - uLong ret=0; - HANDLE hFile = NULL; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - if (hFile != NULL) - if (!ReadFile(hFile, buf, size, &ret, NULL)) - { - DWORD dwErr = GetLastError(); - if (dwErr == ERROR_HANDLE_EOF) - dwErr = 0; - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - } - - return ret; -} - - -uLong ZCALLBACK win32_write_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; -{ - uLong ret=0; - HANDLE hFile = NULL; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - - if (hFile !=NULL) - if (!WriteFile(hFile, buf, size, &ret, NULL)) - { - DWORD dwErr = GetLastError(); - if (dwErr == ERROR_HANDLE_EOF) - dwErr = 0; - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - } - - return ret; -} - -long ZCALLBACK win32_tell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - long ret=-1; - HANDLE hFile = NULL; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - if (hFile != NULL) - { - DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); - if (dwSet == INVALID_SET_FILE_POINTER) - { - DWORD dwErr = GetLastError(); - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - ret = -1; - } - else - ret=(long)dwSet; - } - return ret; -} - -long ZCALLBACK win32_seek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; -{ - DWORD dwMoveMethod=0xFFFFFFFF; - HANDLE hFile = NULL; - - long ret=-1; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - dwMoveMethod = FILE_CURRENT; - break; - case ZLIB_FILEFUNC_SEEK_END : - dwMoveMethod = FILE_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - dwMoveMethod = FILE_BEGIN; - break; - default: return -1; - } - - if (hFile != NULL) - { - DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); - if (dwSet == INVALID_SET_FILE_POINTER) - { - DWORD dwErr = GetLastError(); - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - ret = -1; - } - else - ret=0; - } - return ret; -} - -int ZCALLBACK win32_close_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret=-1; - - if (stream!=NULL) - { - HANDLE hFile; - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - if (hFile != NULL) - { - CloseHandle(hFile); - ret=0; - } - free(stream); - } - return ret; -} - -int ZCALLBACK win32_error_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret=-1; - if (stream!=NULL) - { - ret = ((WIN32FILE_IOWIN*)stream) -> error; - } - return ret; -} - -void fill_win32_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ - pzlib_filefunc_def->zopen_file = win32_open_file_func; - pzlib_filefunc_def->zread_file = win32_read_file_func; - pzlib_filefunc_def->zwrite_file = win32_write_file_func; - pzlib_filefunc_def->ztell_file = win32_tell_file_func; - pzlib_filefunc_def->zseek_file = win32_seek_file_func; - pzlib_filefunc_def->zclose_file = win32_close_file_func; - pzlib_filefunc_def->zerror_file = win32_error_file_func; - pzlib_filefunc_def->opaque=NULL; -} -#endif diff --git a/externals/g3dlite/zip.lib/source/iowin32.h b/externals/g3dlite/zip.lib/source/iowin32.h deleted file mode 100644 index 1978f6152dd..00000000000 --- a/externals/g3dlite/zip.lib/source/iowin32.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifdef _MSC_VER -/* iowin32.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - This IO API version uses the Win32 API (for Microsoft Windows) - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/externals/g3dlite/zip.lib/source/unzip.c b/externals/g3dlite/zip.lib/source/unzip.c deleted file mode 100644 index e80bc5bde7c..00000000000 --- a/externals/g3dlite/zip.lib/source/unzip.c +++ /dev/null @@ -1,1604 +0,0 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - Read unzip.h for more info -*/ - -/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of -compatibility with older software. The following is from the original crypt.c. Code -woven in by Terry Thorsen 1/2003. -*/ -/* - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - */ - -/* - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - */ - - -#include -#include -#include -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - -#ifndef CASESENSITIVITYDEFAULT_NO -# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) -# define CASESENSITIVITYDEFAULT_NO -# endif -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - - - -const char unz_copyright[] = - " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info_internal_s -{ - uLong offset_curfile;/* relative offset of local header 4 bytes */ -} unz_file_info_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - - uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialised*/ - - uLong offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - uLong pos_local_extrafield; /* position in the local extra field in read*/ - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - uLong rest_read_compressed; /* number of byte to be decompressed */ - uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip_read_info_s; - - -/* unz_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - unz_global_info gi; /* public global information */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - uLong num_file; /* number of the current file in the zipfile*/ - uLong pos_in_central_dir; /* pos of the current file in the central dir*/ - uLong current_file_ok; /* flag about the usability of the current file*/ - uLong central_pos; /* position of the beginning of the central dir*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info cur_file_info; /* public info about the current file in zip*/ - unz_file_info_internal cur_file_info_internal; /* private info about it*/ - file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ - int encrypted; -# ifndef NOUNCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; -# endif -} unz_s; - - -#ifndef NOUNCRYPT -#include "crypt.h" -#endif - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ - - -local int unzlocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unzlocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x = 0; - int i = 0; - int err = 0; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unzlocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x = 0; - int i = 0; - int err = 0; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (fileName1,fileName2) - const char* fileName1; - const char* fileName2; -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) - const char* fileName1; - const char* fileName2; - int iCaseSensitivity; -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong unzlocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer - "zlib/zlib114.zip". - If the zipfile cannot be opened (file doesn't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def) - const char *path; - zlib_filefunc_def* pzlib_filefunc_def; -{ - unz_s us; - unz_s *s; - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - if (pzlib_filefunc_def==NULL) - fill_fopen_filefunc(&us.z_filefunc); - else - us.z_filefunc = *pzlib_filefunc_def; - - us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, - path, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - if (ZSEEK(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* zipfile comment length */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) - unzFile file; - unz_global_info *pglobal_info; -{ - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - - -/* - Translate date/time from Dos format to tm_unz (readable more easilty) -*/ -local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) - uLong ulDosDate; - tm_unz* ptm; -{ - uLong uDate; - uDate = (uLong)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info *pfile_info, - unz_file_info_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unzlocal_GetCurrentFileInfoInternal (file, - pfile_info, - pfile_info_internal, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - unz_file_info_internal *pfile_info_internal; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - unz_s* s; - unz_file_info file_info; - unz_file_info_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - long lSeek=0; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (ZSEEK(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) - { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - } - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - - lSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek -= uSizeRead; - } - - - if ((err==UNZ_OK) && (extraField!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek += file_info.size_file_extra - uSizeRead; - } - else - lSeek+=file_info.size_file_extra; - - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek+=file_info.size_file_comment - uSizeRead; - } - else - lSeek+=file_info.size_file_comment; - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -extern int ZEXPORT unzGetCurrentFileInfo (file, - pfile_info, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -extern int ZEXPORT unzGoToFirstFile (file) - unzFile file; -{ - int err=UNZ_OK; - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -extern int ZEXPORT unzGoToNextFile (file) - unzFile file; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) - unzFile file; - const char *szFileName; - int iCaseSensitivity; -{ - unz_s* s; - int err; - - /* We remember the 'current' position in the file so that we can jump - * back there if we fail. - */ - unz_file_info cur_file_infoSaved; - unz_file_info_internal cur_file_info_internalSaved; - uLong num_fileSaved; - uLong pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - /* Save the current state */ - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - cur_file_infoSaved = s->cur_file_info; - cur_file_info_internalSaved = s->cur_file_info_internal; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - err = unzGetCurrentFileInfo(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (err == UNZ_OK) - { - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - } - - /* We failed, so restore the state of the 'current file' to where we - * were. - */ - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - s->cur_file_info = cur_file_infoSaved; - s->cur_file_info_internal = cur_file_info_internalSaved; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; // offset in file - uLong num_of_file; // # of file -} unz_file_pos; -*/ - -extern int ZEXPORT unzGetFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -extern int ZEXPORT unzGoToFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, - poffset_local_extrafield, - psize_local_extrafield) - unz_s* s; - uInt* piSizeVar; - uLong *poffset_local_extrafield; - uInt *psize_local_extrafield; -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) - { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - } - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) - unzFile file; - int* method; - int* level; - int raw; - const char* password; -{ - int err=UNZ_OK; - uInt iSizeVar; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uLong offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ -# ifndef NOUNCRYPT - char source[12]; -# else - if (password != NULL) - return UNZ_PARAMERROR; -# endif - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, - &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip_read_info_s*) - ALLOC(sizeof(file_in_zip_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = (int)s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->compression_method = - s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_DEFLATED) && - (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = (voidpf)0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=1; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - s->pfile_in_zip_read = pfile_in_zip_read_info; - -# ifndef NOUNCRYPT - if (password != NULL) - { - int i; - s->pcrc_32_tab = get_crc_table(); - init_keys(password,s->keys,s->pcrc_32_tab); - if (ZSEEK(s->z_filefunc, s->filestream, - s->pfile_in_zip_read->pos_in_zipfile + - s->pfile_in_zip_read->byte_before_the_zipfile, - SEEK_SET)!=0) - return UNZ_INTERNALERROR; - if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12) - return UNZ_INTERNALERROR; - - for (i = 0; i<12; i++) - zdecode(s->keys,s->pcrc_32_tab,source[i]); - - s->pfile_in_zip_read->pos_in_zipfile+=12; - s->encrypted=1; - } -# endif - - - return UNZ_OK; -} - -extern int ZEXPORT unzOpenCurrentFile (file) - unzFile file; -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); -} - -extern int ZEXPORT unzOpenCurrentFilePassword (file, password) - unzFile file; - const char* password; -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); -} - -extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw) - unzFile file; - int* method; - int* level; - int raw; -{ - return unzOpenCurrentFile3(file, method, level, raw, NULL); -} - -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -extern int ZEXPORT unzReadCurrentFile (file, buf, len) - unzFile file; - voidp buf; - unsigned len; -{ - int err=UNZ_OK; - uInt iRead = 0; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->read_buffer == NULL)) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && - (!(pfile_in_zip_read_info->raw))) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - if ((len>pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in) && - (pfile_in_zip_read_info->raw)) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - - -# ifndef NOUNCRYPT - if(s->encrypted) - { - uInt i; - for(i=0;iread_buffer[i] = - zdecode(s->keys,s->pcrc_32_tab, - pfile_in_zip_read_info->read_buffer[i]); - } -# endif - - - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else - { - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) - err = Z_DATA_ERROR; - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -extern z_off_t ZEXPORT unztell (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -extern int ZEXPORT unzeof (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) - unzFile file; - voidp buf; - unsigned len; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uInt read_now; - uLong size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,read_now)!=read_now) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -extern int ZEXPORT unzCloseCurrentFile (file) - unzFile file; -{ - int err=UNZ_OK; - - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised) - inflateEnd(&pfile_in_zip_read_info->stream); - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) - unzFile file; - char *szComment; - uLong uSizeBuf; -{ - unz_s* s; - uLong uReadThis ; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} - -/* Additions by RX '2004 */ -extern uLong ZEXPORT unzGetOffset (file) - unzFile file; -{ - unz_s* s; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return 0; - if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) - if (s->num_file==s->gi.number_entry) - return 0; - return s->pos_in_central_dir; -} - -extern int ZEXPORT unzSetOffset (file, pos) - unzFile file; - uLong pos; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - s->pos_in_central_dir = pos; - s->num_file = s->gi.number_entry; /* hack */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} diff --git a/externals/g3dlite/zip.lib/source/zip.c b/externals/g3dlite/zip.lib/source/zip.c deleted file mode 100644 index d5f9fe53d26..00000000000 --- a/externals/g3dlite/zip.lib/source/zip.c +++ /dev/null @@ -1,1221 +0,0 @@ -/* zip.c -- IO on .zip files using zlib - Version 1.01e, February 12th, 2005 - - 27 Dec 2004 Rolf Kalbermatter - Modification to zipOpen2 to support globalComment retrieval. - - Copyright (C) 1998-2005 Gilles Vollant - - Read zip.h for more info -*/ - - -#include -#include -#include -#include -#include "zlib.h" -#include "zip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -#ifndef VERSIONMADEBY -# define VERSIONMADEBY (0x0) /* platform depedent */ -#endif - -#ifndef Z_BUFSIZE -#define Z_BUFSIZE (16384) -#endif - -#ifndef Z_MAXFILENAMEINZIP -#define Z_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -/* -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) -*/ - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -#ifndef DEF_MEM_LEVEL -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -#endif -const char zip_copyright[] = - " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - - -#define SIZEDATA_INDATABLOCK (4096-(4*4)) - -#define LOCALHEADERMAGIC (0x04034b50) -#define CENTRALHEADERMAGIC (0x02014b50) -#define ENDHEADERMAGIC (0x06054b50) - -#define FLAG_LOCALHEADER_OFFSET (0x06) -#define CRC_LOCALHEADER_OFFSET (0x0e) - -#define SIZECENTRALHEADER (0x2e) /* 46 */ - -typedef struct linkedlist_datablock_internal_s -{ - struct linkedlist_datablock_internal_s* next_datablock; - uLong avail_in_this_block; - uLong filled_in_this_block; - uLong unused; /* for future use and alignement */ - unsigned char data[SIZEDATA_INDATABLOCK]; -} linkedlist_datablock_internal; - -typedef struct linkedlist_data_s -{ - linkedlist_datablock_internal* first_block; - linkedlist_datablock_internal* last_block; -} linkedlist_data; - - -typedef struct -{ - z_stream stream; /* zLib stream structure for inflate */ - int stream_initialised; /* 1 is stream is initialised */ - uInt pos_in_buffered_data; /* last written byte in buffered_data */ - - uLong pos_local_header; /* offset of the local header of the file - currenty writing */ - char* central_header; /* central header data for the current file */ - uLong size_centralheader; /* size of the central header for cur file */ - uLong flag; /* flag of the file currently writing */ - - int method; /* compression method of file currenty wr.*/ - int raw; /* 1 for directly writing raw data */ - Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ - uLong dosDate; - uLong crc32; - int encrypt; -#ifndef NOCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; - int crypt_header_size; -#endif -} curfile_info; - -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - linkedlist_data central_dir;/* datablock with central dir in construction*/ - int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ - curfile_info ci; /* info on the file curretly writing */ - - uLong begin_pos; /* position of the beginning of the zipfile */ - uLong add_position_when_writting_offset; - uLong number_entry; -#ifndef NO_ADDFILEINEXISTINGZIP - char *globalcomment; -#endif -} zip_internal; - - - -#ifndef NOCRYPT -#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED -#include "crypt.h" -#endif - -local linkedlist_datablock_internal* allocate_new_datablock() -{ - linkedlist_datablock_internal* ldi; - ldi = (linkedlist_datablock_internal*) - ALLOC(sizeof(linkedlist_datablock_internal)); - if (ldi!=NULL) - { - ldi->next_datablock = NULL ; - ldi->filled_in_this_block = 0 ; - ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; - } - return ldi; -} - -local void free_datablock(ldi) - linkedlist_datablock_internal* ldi; -{ - while (ldi!=NULL) - { - linkedlist_datablock_internal* ldinext = ldi->next_datablock; - TRYFREE(ldi); - ldi = ldinext; - } -} - -local void init_linkedlist(ll) - linkedlist_data* ll; -{ - ll->first_block = ll->last_block = NULL; -} - -/* -// Never used! -local void free_linkedlist(ll) - linkedlist_data* ll; -{ - free_datablock(ll->first_block); - ll->first_block = ll->last_block = NULL; -} -*/ - -local int add_data_in_datablock(ll,buf,len) - linkedlist_data* ll; - const void* buf; - uLong len; -{ - linkedlist_datablock_internal* ldi; - const unsigned char* from_copy; - - if (ll==NULL) - return ZIP_INTERNALERROR; - - if (ll->last_block == NULL) - { - ll->first_block = ll->last_block = allocate_new_datablock(); - if (ll->first_block == NULL) - return ZIP_INTERNALERROR; - } - - ldi = ll->last_block; - from_copy = (unsigned char*)buf; - - while (len>0) - { - uInt copy_this; - uInt i; - unsigned char* to_copy; - - if (ldi->avail_in_this_block==0) - { - ldi->next_datablock = allocate_new_datablock(); - if (ldi->next_datablock == NULL) - return ZIP_INTERNALERROR; - ldi = ldi->next_datablock ; - ll->last_block = ldi; - } - - if (ldi->avail_in_this_block < len) - copy_this = (uInt)ldi->avail_in_this_block; - else - copy_this = (uInt)len; - - to_copy = &(ldi->data[ldi->filled_in_this_block]); - - for (i=0;ifilled_in_this_block += copy_this; - ldi->avail_in_this_block -= copy_this; - from_copy += copy_this ; - len -= copy_this; - } - return ZIP_OK; -} - - - -/****************************************************************************/ - -#ifndef NO_ADDFILEINEXISTINGZIP -/* =========================================================================== - Inputs a long in LSB order to the given file - nbByte == 1, 2 or 4 (byte, short or long) -*/ - -local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, uLong x, int nbByte)); -local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong x; - int nbByte; -{ - unsigned char buf[4]; - int n; - for (n = 0; n < nbByte; n++) - { - buf[n] = (unsigned char)(x & 0xff); - x >>= 8; - } - if (x != 0) - { /* data overflow - hack for ZIP64 (X Roche) */ - for (n = 0; n < nbByte; n++) - { - buf[n] = 0xff; - } - } - - if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) - return ZIP_ERRNO; - else - return ZIP_OK; -} - -local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte)); -local void ziplocal_putValue_inmemory (dest, x, nbByte) - void* dest; - uLong x; - int nbByte; -{ - unsigned char* buf=(unsigned char*)dest; - int n; - for (n = 0; n < nbByte; n++) { - buf[n] = (unsigned char)(x & 0xff); - x >>= 8; - } - - if (x != 0) - { /* data overflow - hack for ZIP64 */ - for (n = 0; n < nbByte; n++) - { - buf[n] = 0xff; - } - } -} - -/****************************************************************************/ - - -local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) - const tm_zip* ptm; - uLong dosDate; -{ - uLong year = (uLong)ptm->tm_year; - if (year>1980) - year-=1980; - else if (year>80) - year-=80; - return - (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | - ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); -} - - -/****************************************************************************/ - -local int ziplocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return ZIP_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return ZIP_ERRNO; - else - return ZIP_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int ziplocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x = 0; - int i = 0; - int err = 0; - - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==ZIP_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int ziplocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x = 0; - int i = 0; - int err = 0; - - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==ZIP_OK) - *pX = x; - else - *pX = 0; - return err; -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong ziplocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} -#endif /* !NO_ADDFILEINEXISTINGZIP*/ - -/************************************************************/ -extern zipFile ZEXPORT zipOpen2 (pathname, append, globalcomment, pzlib_filefunc_def) - const char *pathname; - int append; - zipcharpc* globalcomment; - zlib_filefunc_def* pzlib_filefunc_def; -{ - zip_internal ziinit; - zip_internal* zi; - int err=ZIP_OK; - - - if (pzlib_filefunc_def==NULL) - fill_fopen_filefunc(&ziinit.z_filefunc); - else - ziinit.z_filefunc = *pzlib_filefunc_def; - - ziinit.filestream = (*(ziinit.z_filefunc.zopen_file)) - (ziinit.z_filefunc.opaque, - pathname, - (append == APPEND_STATUS_CREATE) ? - (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : - (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); - - if (ziinit.filestream == NULL) - return NULL; - ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream); - ziinit.in_opened_file_inzip = 0; - ziinit.ci.stream_initialised = 0; - ziinit.number_entry = 0; - ziinit.add_position_when_writting_offset = 0; - init_linkedlist(&(ziinit.central_dir)); - - - zi = (zip_internal*)ALLOC(sizeof(zip_internal)); - if (zi==NULL) - { - ZCLOSE(ziinit.z_filefunc,ziinit.filestream); - return NULL; - } - - /* now we add file in a zipfile */ -# ifndef NO_ADDFILEINEXISTINGZIP - ziinit.globalcomment = NULL; - if (append == APPEND_STATUS_ADDINZIP) - { - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory */ - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry; - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - uLong size_comment; - - central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream); - if (central_pos==0) - err=ZIP_ERRNO; - - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=ZIP_ERRNO; - - /* the signature, already checked */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK) - err=ZIP_ERRNO; - - /* number of this disk */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK) - err=ZIP_ERRNO; - - /* number of the disk with the start of the central directory */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK) - err=ZIP_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK) - err=ZIP_ERRNO; - - /* total number of entries in the central dir */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK) - err=ZIP_ERRNO; - - if ((number_entry_CD!=number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=ZIP_BADZIPFILE; - - /* size of the central directory */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&size_central_dir)!=ZIP_OK) - err=ZIP_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&offset_central_dir)!=ZIP_OK) - err=ZIP_ERRNO; - - /* zipfile global comment length */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&size_comment)!=ZIP_OK) - err=ZIP_ERRNO; - - if ((central_pos0) - { - ziinit.globalcomment = ALLOC(size_comment+1); - if (ziinit.globalcomment) - { - size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment); - ziinit.globalcomment[size_comment]=0; - } - } - - byte_before_the_zipfile = central_pos - - (offset_central_dir+size_central_dir); - ziinit.add_position_when_writting_offset = byte_before_the_zipfile; - - { - uLong size_central_dir_to_read = size_central_dir; - size_t buf_size = SIZEDATA_INDATABLOCK; - void* buf_read = (void*)ALLOC(buf_size); - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - offset_central_dir + byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET) != 0) - err=ZIP_ERRNO; - - while ((size_central_dir_to_read>0) && (err==ZIP_OK)) - { - uLong read_this = SIZEDATA_INDATABLOCK; - if (read_this > size_central_dir_to_read) - read_this = size_central_dir_to_read; - if (ZREAD(ziinit.z_filefunc, ziinit.filestream,buf_read,read_this) != read_this) - err=ZIP_ERRNO; - - if (err==ZIP_OK) - err = add_data_in_datablock(&ziinit.central_dir,buf_read, - (uLong)read_this); - size_central_dir_to_read-=read_this; - } - TRYFREE(buf_read); - } - ziinit.begin_pos = byte_before_the_zipfile; - ziinit.number_entry = number_entry_CD; - - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=ZIP_ERRNO; - } - - if (globalcomment) - { - *globalcomment = ziinit.globalcomment; - } -# endif /* !NO_ADDFILEINEXISTINGZIP*/ - - if (err != ZIP_OK) - { -# ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(ziinit.globalcomment); -# endif /* !NO_ADDFILEINEXISTINGZIP*/ - TRYFREE(zi); - return NULL; - } - else - { - *zi = ziinit; - return (zipFile)zi; - } -} - -extern zipFile ZEXPORT zipOpen (pathname, append) - const char *pathname; - int append; -{ - return zipOpen2(pathname,append,NULL,NULL); -} - -extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - windowBits, memLevel, strategy, - password, crcForCrypting) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; - int raw; - int windowBits; - int memLevel; - int strategy; - const char* password; - uLong crcForCrypting; -{ - zip_internal* zi; - uInt size_filename; - uInt size_comment; - uInt i; - int err = ZIP_OK; - -# ifdef NOCRYPT - if (password != NULL) - return ZIP_PARAMERROR; -# endif - - if (file == NULL) - return ZIP_PARAMERROR; - if ((method!=0) && (method!=Z_DEFLATED)) - return ZIP_PARAMERROR; - - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 1) - { - err = zipCloseFileInZip (file); - if (err != ZIP_OK) - return err; - } - - - if (filename==NULL) - filename="-"; - - if (comment==NULL) - size_comment = 0; - else - size_comment = (uInt)strlen(comment); - - size_filename = (uInt)strlen(filename); - - if (zipfi == NULL) - zi->ci.dosDate = 0; - else - { - if (zipfi->dosDate != 0) - zi->ci.dosDate = zipfi->dosDate; - else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); - } - - zi->ci.flag = 0; - if ((level==8) || (level==9)) - zi->ci.flag |= 2; - if ((level==2)) - zi->ci.flag |= 4; - if ((level==1)) - zi->ci.flag |= 6; - if (password != NULL) - zi->ci.flag |= 1; - - zi->ci.crc32 = 0; - zi->ci.method = method; - zi->ci.encrypt = 0; - zi->ci.stream_initialised = 0; - zi->ci.pos_in_buffered_data = 0; - zi->ci.raw = raw; - zi->ci.pos_local_header = ZTELL(zi->z_filefunc,zi->filestream) ; - zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + - size_extrafield_global + size_comment; - zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader); - - ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); - /* version info */ - ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2); - ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); - ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); - ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); - ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); - ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ - ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ - ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ - ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); - ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); - ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); - ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ - - if (zipfi==NULL) - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); - else - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); - - if (zipfi==NULL) - ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); - else - ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); - - ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header- zi->add_position_when_writting_offset,4); - - for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); - - for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = - *(((const char*)extrafield_global)+i); - - for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ - size_extrafield_global+i) = *(comment+i); - if (zi->ci.central_header == NULL) - return ZIP_INTERNALERROR; - - /* write the local header */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield_local,2); - - if ((err==ZIP_OK) && (size_filename>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) - err = ZIP_ERRNO; - - if ((err==ZIP_OK) && (size_extrafield_local>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream,extrafield_local,size_extrafield_local) - !=size_extrafield_local) - err = ZIP_ERRNO; - - zi->ci.stream.avail_in = (uInt)0; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - zi->ci.stream.total_in = 0; - zi->ci.stream.total_out = 0; - - if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - zi->ci.stream.zalloc = (alloc_func)0; - zi->ci.stream.zfree = (free_func)0; - zi->ci.stream.opaque = (voidpf)0; - - if (windowBits>0) - windowBits = -windowBits; - - err = deflateInit2(&zi->ci.stream, level, - Z_DEFLATED, windowBits, memLevel, strategy); - - if (err==Z_OK) - zi->ci.stream_initialised = 1; - } -# ifndef NOCRYPT - zi->ci.crypt_header_size = 0; - if ((err==Z_OK) && (password != NULL)) - { - unsigned char bufHead[RAND_HEAD_LEN]; - unsigned int sizeHead; - zi->ci.encrypt = 1; - zi->ci.pcrc_32_tab = get_crc_table(); - /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ - - sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); - zi->ci.crypt_header_size = sizeHead; - - if (ZWRITE(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) - err = ZIP_ERRNO; - } -# endif - - if (err==Z_OK) - zi->in_opened_file_inzip = 1; - return err; -} - -extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; - int raw; -{ - return zipOpenNewFileInZip3 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0); -} - -extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; -{ - return zipOpenNewFileInZip2 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, 0); -} - -local int zipFlushWriteBuffer(zi) - zip_internal* zi; -{ - int err=ZIP_OK; - - if (zi->ci.encrypt != 0) - { -#ifndef NOCRYPT - uInt i; - int t; - for (i=0;ici.pos_in_buffered_data;i++) - zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, - zi->ci.buffered_data[i],t); -#endif - } - if (ZWRITE(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) - !=zi->ci.pos_in_buffered_data) - err = ZIP_ERRNO; - zi->ci.pos_in_buffered_data = 0; - return err; -} - -extern int ZEXPORT zipWriteInFileInZip (file, buf, len) - zipFile file; - const void* buf; - unsigned len; -{ - zip_internal* zi; - int err=ZIP_OK; - - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 0) - return ZIP_PARAMERROR; - - zi->ci.stream.next_in = (void*)buf; - zi->ci.stream.avail_in = len; - zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); - - while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) - { - if (zi->ci.stream.avail_out == 0) - { - if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) - err = ZIP_ERRNO; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - } - - - if(err != ZIP_OK) - break; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - uLong uTotalOutBefore = zi->ci.stream.total_out; - err=deflate(&zi->ci.stream, Z_NO_FLUSH); - zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; - - } - else - { - uInt copy_this,i; - if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) - copy_this = zi->ci.stream.avail_in; - else - copy_this = zi->ci.stream.avail_out; - for (i=0;ici.stream.next_out)+i) = - *(((const char*)zi->ci.stream.next_in)+i); - { - zi->ci.stream.avail_in -= copy_this; - zi->ci.stream.avail_out-= copy_this; - zi->ci.stream.next_in+= copy_this; - zi->ci.stream.next_out+= copy_this; - zi->ci.stream.total_in+= copy_this; - zi->ci.stream.total_out+= copy_this; - zi->ci.pos_in_buffered_data += copy_this; - } - } - } - - return err; -} - -extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32) - zipFile file; - uLong uncompressed_size; - uLong crc32; -{ - zip_internal* zi; - uLong compressed_size; - int err=ZIP_OK; - - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 0) - return ZIP_PARAMERROR; - zi->ci.stream.avail_in = 0; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - while (err==ZIP_OK) - { - uLong uTotalOutBefore; - if (zi->ci.stream.avail_out == 0) - { - if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) - err = ZIP_ERRNO; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - } - uTotalOutBefore = zi->ci.stream.total_out; - err=deflate(&zi->ci.stream, Z_FINISH); - zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; - } - - if (err==Z_STREAM_END) - err=ZIP_OK; /* this is normal */ - - if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) - if (zipFlushWriteBuffer(zi)==ZIP_ERRNO) - err = ZIP_ERRNO; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - err=deflateEnd(&zi->ci.stream); - zi->ci.stream_initialised = 0; - } - - if (!zi->ci.raw) - { - crc32 = (uLong)zi->ci.crc32; - uncompressed_size = (uLong)zi->ci.stream.total_in; - } - compressed_size = (uLong)zi->ci.stream.total_out; -# ifndef NOCRYPT - compressed_size += zi->ci.crypt_header_size; -# endif - - ziplocal_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ - ziplocal_putValue_inmemory(zi->ci.central_header+20, - compressed_size,4); /*compr size*/ - if (zi->ci.stream.data_type == Z_ASCII) - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); - ziplocal_putValue_inmemory(zi->ci.central_header+24, - uncompressed_size,4); /*uncompr size*/ - - if (err==ZIP_OK) - err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, - (uLong)zi->ci.size_centralheader); - free(zi->ci.central_header); - - if (err==ZIP_OK) - { - long cur_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); - if (ZSEEK(zi->z_filefunc,zi->filestream, - zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) - err = ZIP_ERRNO; - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ - - if (err==ZIP_OK) /* compressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); - - if (err==ZIP_OK) /* uncompressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); - - if (ZSEEK(zi->z_filefunc,zi->filestream, - cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) - err = ZIP_ERRNO; - } - - zi->number_entry ++; - zi->in_opened_file_inzip = 0; - - return err; -} - -extern int ZEXPORT zipCloseFileInZip (file) - zipFile file; -{ - return zipCloseFileInZipRaw (file,0,0); -} - -extern int ZEXPORT zipClose (file, global_comment) - zipFile file; - const char* global_comment; -{ - zip_internal* zi; - int err = 0; - uLong size_centraldir = 0; - uLong centraldir_pos_inzip; - uInt size_global_comment; - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 1) - { - err = zipCloseFileInZip (file); - } - -#ifndef NO_ADDFILEINEXISTINGZIP - if (global_comment==NULL) - global_comment = zi->globalcomment; -#endif - if (global_comment==NULL) - size_global_comment = 0; - else - size_global_comment = (uInt)strlen(global_comment); - - centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); - if (err==ZIP_OK) - { - linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; - while (ldi!=NULL) - { - if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream, - ldi->data,ldi->filled_in_this_block) - !=ldi->filled_in_this_block ) - err = ZIP_ERRNO; - - size_centraldir += ldi->filled_in_this_block; - ldi = ldi->next_datablock; - } - } - free_datablock(zi->central_dir.first_block); - - if (err==ZIP_OK) /* Magic End */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); - - if (err==ZIP_OK) /* number of this disk */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); - - if (err==ZIP_OK) /* number of the disk with the start of the central directory */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); - - if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); - - if (err==ZIP_OK) /* total number of entries in the central dir */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); - - if (err==ZIP_OK) /* size of the central directory */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); - - if (err==ZIP_OK) /* offset of start of central directory with respect to the - starting disk number */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream, - (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); - - if (err==ZIP_OK) /* zipfile comment length */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); - - if ((err==ZIP_OK) && (size_global_comment>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream, - global_comment,size_global_comment) != size_global_comment) - err = ZIP_ERRNO; - - if (ZCLOSE(zi->z_filefunc,zi->filestream) != 0) - if (err == ZIP_OK) - err = ZIP_ERRNO; - -#ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(zi->globalcomment); -#endif - TRYFREE(zi); - - return err; -} diff --git a/externals/jemalloc/CMakeLists.txt b/externals/jemalloc/CMakeLists.txt index c3e4e81782c..d560c6ba675 100644 --- a/externals/jemalloc/CMakeLists.txt +++ b/externals/jemalloc/CMakeLists.txt @@ -1,27 +1,25 @@ -SET(jmalloc_STAT_SRC - arena.c - chunk.c - chunk_mmap.c - ckh.c - extent.c - huge.c - mb.c - prof.c - tcache.c - base.c - chunk_dss.c - chunk_swap.c - ctl.c - hash.c - jemalloc.c - mutex.c - stats.c - ) +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +file(GLOB sources *.c) + +set(jemalloc_STAT_SRC + ${sources} +) include_directories( - ${CMAKE_SOURCE_DIR}/dep/include - ) + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/internal +) add_definitions(-D_GNU_SOURCE -D_REENTRANT) -add_library(jmalloc STATIC ${jmalloc_STAT_SRC}) \ No newline at end of file +add_library(jemalloc STATIC ${sources}) diff --git a/externals/jemalloc/include/internal/arena.h b/externals/jemalloc/include/internal/arena.h deleted file mode 100644 index bb4ce2a54f7..00000000000 --- a/externals/jemalloc/include/internal/arena.h +++ /dev/null @@ -1,537 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* - * Subpages are an artificially designated partitioning of pages. Their only - * purpose is to support subpage-spaced size classes. - * - * There must be at least 4 subpages per page, due to the way size classes are - * handled. - */ -#define LG_SUBPAGE 8 -#define SUBPAGE ((size_t)(1U << LG_SUBPAGE)) -#define SUBPAGE_MASK (SUBPAGE - 1) - -/* Return the smallest subpage multiple that is >= s. */ -#define SUBPAGE_CEILING(s) \ - (((s) + SUBPAGE_MASK) & ~SUBPAGE_MASK) - -#ifdef JEMALLOC_TINY - /* Smallest size class to support. */ -# define LG_TINY_MIN LG_SIZEOF_PTR -#endif - -/* - * Maximum size class that is a multiple of the quantum, but not (necessarily) - * a power of 2. Above this size, allocations are rounded up to the nearest - * power of 2. - */ -#define LG_QSPACE_MAX_DEFAULT 7 - -/* - * Maximum size class that is a multiple of the cacheline, but not (necessarily) - * a power of 2. Above this size, allocations are rounded up to the nearest - * power of 2. - */ -#define LG_CSPACE_MAX_DEFAULT 9 - -/* - * RUN_MAX_OVRHD indicates maximum desired run header overhead. Runs are sized - * as small as possible such that this setting is still honored, without - * violating other constraints. The goal is to make runs as small as possible - * without exceeding a per run external fragmentation threshold. - * - * We use binary fixed point math for overhead computations, where the binary - * point is implicitly RUN_BFP bits to the left. - * - * Note that it is possible to set RUN_MAX_OVRHD low enough that it cannot be - * honored for some/all object sizes, since there is one bit of header overhead - * per object (plus a constant). This constraint is relaxed (ignored) for runs - * that are so small that the per-region overhead is greater than: - * - * (RUN_MAX_OVRHD / (reg_size << (3+RUN_BFP)) - */ -#define RUN_BFP 12 -/* \/ Implicit binary fixed point. */ -#define RUN_MAX_OVRHD 0x0000003dU -#define RUN_MAX_OVRHD_RELAX 0x00001800U - -/* - * The minimum ratio of active:dirty pages per arena is computed as: - * - * (nactive >> opt_lg_dirty_mult) >= ndirty - * - * So, supposing that opt_lg_dirty_mult is 5, there can be no less than 32 - * times as many active pages as dirty pages. - */ -#define LG_DIRTY_MULT_DEFAULT 5 - -typedef struct arena_chunk_map_s arena_chunk_map_t; -typedef struct arena_chunk_s arena_chunk_t; -typedef struct arena_run_s arena_run_t; -typedef struct arena_bin_s arena_bin_t; -typedef struct arena_s arena_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -/* Each element of the chunk map corresponds to one page within the chunk. */ -struct arena_chunk_map_s { - union { - /* - * Linkage for run trees. There are two disjoint uses: - * - * 1) arena_t's runs_avail_{clean,dirty} trees. - * 2) arena_run_t conceptually uses this linkage for in-use - * non-full runs, rather than directly embedding linkage. - */ - rb_node(arena_chunk_map_t) rb_link; - /* - * List of runs currently in purgatory. arena_chunk_purge() - * temporarily allocates runs that contain dirty pages while - * purging, so that other threads cannot use the runs while the - * purging thread is operating without the arena lock held. - */ - ql_elm(arena_chunk_map_t) ql_link; - } u; - -#ifdef JEMALLOC_PROF - /* Profile counters, used for large object runs. */ - prof_thr_cnt_t *prof_cnt; -#endif - - /* - * Run address (or size) and various flags are stored together. The bit - * layout looks like (assuming 32-bit system): - * - * ???????? ???????? ????---- ----dzla - * - * ? : Unallocated: Run address for first/last pages, unset for internal - * pages. - * Small: Run page offset. - * Large: Run size for first page, unset for trailing pages. - * - : Unused. - * d : dirty? - * z : zeroed? - * l : large? - * a : allocated? - * - * Following are example bit patterns for the three types of runs. - * - * p : run page offset - * s : run size - * c : size class (used only if prof_promote is true) - * x : don't care - * - : 0 - * + : 1 - * [DZLA] : bit set - * [dzla] : bit unset - * - * Unallocated (clean): - * ssssssss ssssssss ssss---- ----dz-- - * xxxxxxxx xxxxxxxx xxxx---- -----Zxx - * ssssssss ssssssss ssss---- ----dZ-- - * - * Unallocated (dirty): - * ssssssss ssssssss ssss---- ----D--- - * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * ssssssss ssssssss ssss---- ----D--- - * - * Small: - * pppppppp pppppppp pppp---- ----d--a - * pppppppp pppppppp pppp---- -------a - * pppppppp pppppppp pppp---- ----d--a - * - * Large: - * ssssssss ssssssss ssss++++ ++++D-la - * xxxxxxxx xxxxxxxx xxxx---- ----xxxx - * -------- -------- -------- ----D-la - * - * Large (sampled, size <= PAGE_SIZE): - * ssssssss ssssssss sssscccc ccccD-la - * - * Large (not sampled, size == PAGE_SIZE): - * ssssssss ssssssss ssss++++ ++++D-la - */ - size_t bits; -#ifdef JEMALLOC_PROF -#define CHUNK_MAP_CLASS_SHIFT 4 -#define CHUNK_MAP_CLASS_MASK ((size_t)0xff0U) -#endif -#define CHUNK_MAP_FLAGS_MASK ((size_t)0xfU) -#define CHUNK_MAP_DIRTY ((size_t)0x8U) -#define CHUNK_MAP_ZEROED ((size_t)0x4U) -#define CHUNK_MAP_LARGE ((size_t)0x2U) -#define CHUNK_MAP_ALLOCATED ((size_t)0x1U) -#define CHUNK_MAP_KEY CHUNK_MAP_ALLOCATED -}; -typedef rb_tree(arena_chunk_map_t) arena_avail_tree_t; -typedef rb_tree(arena_chunk_map_t) arena_run_tree_t; - -/* Arena chunk header. */ -struct arena_chunk_s { - /* Arena that owns the chunk. */ - arena_t *arena; - - /* Linkage for the arena's chunks_dirty list. */ - ql_elm(arena_chunk_t) link_dirty; - - /* - * True if the chunk is currently in the chunks_dirty list, due to - * having at some point contained one or more dirty pages. Removal - * from chunks_dirty is lazy, so (dirtied && ndirty == 0) is possible. - */ - bool dirtied; - - /* Number of dirty pages. */ - size_t ndirty; - - /* Map of pages within chunk that keeps track of free/large/small. */ - arena_chunk_map_t map[1]; /* Dynamically sized. */ -}; -typedef rb_tree(arena_chunk_t) arena_chunk_tree_t; - -struct arena_run_s { -#ifdef JEMALLOC_DEBUG - uint32_t magic; -# define ARENA_RUN_MAGIC 0x384adf93 -#endif - - /* Bin this run is associated with. */ - arena_bin_t *bin; - - /* Stack of available freed regions, or NULL. */ - void *avail; - - /* Next region that has never been allocated, or run boundary. */ - void *next; - - /* Number of free regions in run. */ - unsigned nfree; -}; - -struct arena_bin_s { - /* - * All operations on runcur, runs, and stats require that lock be - * locked. Run allocation/deallocation are protected by the arena lock, - * which may be acquired while holding one or more bin locks, but not - * vise versa. - */ - malloc_mutex_t lock; - - /* - * Current run being used to service allocations of this bin's size - * class. - */ - arena_run_t *runcur; - - /* - * Tree of non-full runs. This tree is used when looking for an - * existing run when runcur is no longer usable. We choose the - * non-full run that is lowest in memory; this policy tends to keep - * objects packed well, and it can also help reduce the number of - * almost-empty chunks. - */ - arena_run_tree_t runs; - - /* Size of regions in a run for this bin's size class. */ - size_t reg_size; - - /* Total size of a run for this bin's size class. */ - size_t run_size; - - /* Total number of regions in a run for this bin's size class. */ - uint32_t nregs; - -#ifdef JEMALLOC_PROF - /* - * Offset of first (prof_cnt_t *) in a run header for this bin's size - * class, or 0 if (opt_prof == false). - */ - uint32_t cnt0_offset; -#endif - - /* Offset of first region in a run for this bin's size class. */ - uint32_t reg0_offset; - -#ifdef JEMALLOC_STATS - /* Bin statistics. */ - malloc_bin_stats_t stats; -#endif -}; - -struct arena_s { -#ifdef JEMALLOC_DEBUG - uint32_t magic; -# define ARENA_MAGIC 0x947d3d24 -#endif - - /* This arena's index within the arenas array. */ - unsigned ind; - - /* - * All non-bin-related operations on this arena require that lock be - * locked. - */ - malloc_mutex_t lock; - -#ifdef JEMALLOC_STATS - arena_stats_t stats; -# ifdef JEMALLOC_TCACHE - /* - * List of tcaches for extant threads associated with this arena. - * Stats from these are merged incrementally, and at exit. - */ - ql_head(tcache_t) tcache_ql; -# endif -#endif - -#ifdef JEMALLOC_PROF - uint64_t prof_accumbytes; -#endif - - /* List of dirty-page-containing chunks this arena manages. */ - ql_head(arena_chunk_t) chunks_dirty; - - /* - * In order to avoid rapid chunk allocation/deallocation when an arena - * oscillates right on the cusp of needing a new chunk, cache the most - * recently freed chunk. The spare is left in the arena's chunk trees - * until it is deleted. - * - * There is one spare chunk per arena, rather than one spare total, in - * order to avoid interactions between multiple threads that could make - * a single spare inadequate. - */ - arena_chunk_t *spare; - - /* Number of pages in active runs. */ - size_t nactive; - - /* - * Current count of pages within unused runs that are potentially - * dirty, and for which madvise(... MADV_DONTNEED) has not been called. - * By tracking this, we can institute a limit on how much dirty unused - * memory is mapped for each arena. - */ - size_t ndirty; - - /* - * Approximate number of pages being purged. It is possible for - * multiple threads to purge dirty pages concurrently, and they use - * npurgatory to indicate the total number of pages all threads are - * attempting to purge. - */ - size_t npurgatory; - - /* - * Size/address-ordered trees of this arena's available runs. The trees - * are used for first-best-fit run allocation. The dirty tree contains - * runs with dirty pages (i.e. very likely to have been touched and - * therefore have associated physical pages), whereas the clean tree - * contains runs with pages that either have no associated physical - * pages, or have pages that the kernel may recycle at any time due to - * previous madvise(2) calls. The dirty tree is used in preference to - * the clean tree for allocations, because using dirty pages reduces - * the amount of dirty purging necessary to keep the active:dirty page - * ratio below the purge threshold. - */ - arena_avail_tree_t runs_avail_clean; - arena_avail_tree_t runs_avail_dirty; - - /* - * bins is used to store trees of free regions of the following sizes, - * assuming a 16-byte quantum, 4 KiB page size, and default - * JEMALLOC_OPTIONS. - * - * bins[i] | size | - * --------+--------+ - * 0 | 2 | - * 1 | 4 | - * 2 | 8 | - * --------+--------+ - * 3 | 16 | - * 4 | 32 | - * 5 | 48 | - * : : - * 8 | 96 | - * 9 | 112 | - * 10 | 128 | - * --------+--------+ - * 11 | 192 | - * 12 | 256 | - * 13 | 320 | - * 14 | 384 | - * 15 | 448 | - * 16 | 512 | - * --------+--------+ - * 17 | 768 | - * 18 | 1024 | - * 19 | 1280 | - * : : - * 27 | 3328 | - * 28 | 3584 | - * 29 | 3840 | - * --------+--------+ - * 30 | 4 KiB | - * 31 | 6 KiB | - * 33 | 8 KiB | - * : : - * 43 | 28 KiB | - * 44 | 30 KiB | - * 45 | 32 KiB | - * --------+--------+ - */ - arena_bin_t bins[1]; /* Dynamically sized. */ -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern size_t opt_lg_qspace_max; -extern size_t opt_lg_cspace_max; -extern ssize_t opt_lg_dirty_mult; -extern uint8_t const *small_size2bin; - -/* Various bin-related settings. */ -#ifdef JEMALLOC_TINY /* Number of (2^n)-spaced tiny bins. */ -# define ntbins ((unsigned)(LG_QUANTUM - LG_TINY_MIN)) -#else -# define ntbins 0 -#endif -extern unsigned nqbins; /* Number of quantum-spaced bins. */ -extern unsigned ncbins; /* Number of cacheline-spaced bins. */ -extern unsigned nsbins; /* Number of subpage-spaced bins. */ -extern unsigned nbins; -#ifdef JEMALLOC_TINY -# define tspace_max ((size_t)(QUANTUM >> 1)) -#endif -#define qspace_min QUANTUM -extern size_t qspace_max; -extern size_t cspace_min; -extern size_t cspace_max; -extern size_t sspace_min; -extern size_t sspace_max; -#define small_maxclass sspace_max - -#define nlclasses (chunk_npages - arena_chunk_header_npages) - -#ifdef JEMALLOC_TCACHE -void arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, - size_t binind -# ifdef JEMALLOC_PROF - , uint64_t prof_accumbytes -# endif - ); -#endif -#ifdef JEMALLOC_PROF -void arena_prof_accum(arena_t *arena, uint64_t accumbytes); -#endif -void *arena_malloc_small(arena_t *arena, size_t size, bool zero); -void *arena_malloc_large(arena_t *arena, size_t size, bool zero); -void *arena_malloc(size_t size, bool zero); -void *arena_palloc(arena_t *arena, size_t alignment, size_t size, - size_t alloc_size); -size_t arena_salloc(const void *ptr); -#ifdef JEMALLOC_PROF -void arena_prof_promoted(const void *ptr, size_t size); -size_t arena_salloc_demote(const void *ptr); -prof_thr_cnt_t *arena_prof_cnt_get(const void *ptr); -void arena_prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt); -#endif -void arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, - arena_chunk_map_t *mapelm); -void arena_dalloc_large(arena_t *arena, arena_chunk_t *chunk, void *ptr); -#ifdef JEMALLOC_STATS -void arena_stats_merge(arena_t *arena, size_t *nactive, size_t *ndirty, - arena_stats_t *astats, malloc_bin_stats_t *bstats, - malloc_large_stats_t *lstats); -#endif -void *arena_ralloc(void *ptr, size_t size, size_t oldsize); -bool arena_new(arena_t *arena, unsigned ind); -bool arena_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ARENA_C_)) -JEMALLOC_INLINE void -arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) -{ - size_t pageind; - arena_chunk_map_t *mapelm; - - assert(arena != NULL); - assert(arena->magic == ARENA_MAGIC); - assert(chunk->arena == arena); - assert(ptr != NULL); - assert(CHUNK_ADDR2BASE(ptr) != ptr); - - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapelm = &chunk->map[pageind]; - assert((mapelm->bits & CHUNK_MAP_ALLOCATED) != 0); - if ((mapelm->bits & CHUNK_MAP_LARGE) == 0) { - /* Small allocation. */ -#ifdef JEMALLOC_TCACHE - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - tcache_dalloc_small(tcache, ptr); - else { -#endif - arena_run_t *run; - arena_bin_t *bin; - - run = (arena_run_t *)((uintptr_t)chunk + - (uintptr_t)((pageind - (mapelm->bits >> - PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - assert(((uintptr_t)ptr - ((uintptr_t)run + - (uintptr_t)run->bin->reg0_offset)) % - run->bin->reg_size == 0); - bin = run->bin; - malloc_mutex_lock(&bin->lock); - arena_dalloc_bin(arena, chunk, ptr, mapelm); - malloc_mutex_unlock(&bin->lock); -#ifdef JEMALLOC_TCACHE - } -#endif - } else { -#ifdef JEMALLOC_TCACHE - size_t size = mapelm->bits & ~PAGE_MASK; - - assert(((uintptr_t)ptr & PAGE_MASK) == 0); - if (size <= tcache_maxclass) { - tcache_t *tcache; - - if ((tcache = tcache_get()) != NULL) - tcache_dalloc_large(tcache, ptr, size); - else { - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, ptr); - malloc_mutex_unlock(&arena->lock); - } - } else { - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, ptr); - malloc_mutex_unlock(&arena->lock); - } -#else - assert(((uintptr_t)ptr & PAGE_MASK) == 0); - malloc_mutex_lock(&arena->lock); - arena_dalloc_large(arena, chunk, ptr); - malloc_mutex_unlock(&arena->lock); -#endif - } -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/base.h b/externals/jemalloc/include/internal/base.h deleted file mode 100644 index e353f309bd2..00000000000 --- a/externals/jemalloc/include/internal/base.h +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern malloc_mutex_t base_mtx; - -void *base_alloc(size_t size); -extent_node_t *base_node_alloc(void); -void base_node_dealloc(extent_node_t *node); -bool base_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/chunk.h b/externals/jemalloc/include/internal/chunk.h deleted file mode 100644 index 1f6abf782f1..00000000000 --- a/externals/jemalloc/include/internal/chunk.h +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* - * Size and alignment of memory chunks that are allocated by the OS's virtual - * memory system. - */ -#define LG_CHUNK_DEFAULT 22 - -/* Return the chunk address for allocation address a. */ -#define CHUNK_ADDR2BASE(a) \ - ((void *)((uintptr_t)(a) & ~chunksize_mask)) - -/* Return the chunk offset of address a. */ -#define CHUNK_ADDR2OFFSET(a) \ - ((size_t)((uintptr_t)(a) & chunksize_mask)) - -/* Return the smallest chunk multiple that is >= s. */ -#define CHUNK_CEILING(s) \ - (((s) + chunksize_mask) & ~chunksize_mask) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern size_t opt_lg_chunk; -#ifdef JEMALLOC_SWAP -extern bool opt_overcommit; -#endif - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -/* Protects stats_chunks; currently not used for any other purpose. */ -extern malloc_mutex_t chunks_mtx; -/* Chunk statistics. */ -extern chunk_stats_t stats_chunks; -#endif - -extern size_t chunksize; -extern size_t chunksize_mask; /* (chunksize - 1). */ -extern size_t chunk_npages; -extern size_t arena_chunk_header_npages; -extern size_t arena_maxclass; /* Max size class for arenas. */ - -void *chunk_alloc(size_t size, bool *zero); -void chunk_dealloc(void *chunk, size_t size); -bool chunk_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ - -#include "jemalloc/internal/chunk_swap.h" -#include "jemalloc/internal/chunk_dss.h" -#include "jemalloc/internal/chunk_mmap.h" diff --git a/externals/jemalloc/include/internal/chunk_dss.h b/externals/jemalloc/include/internal/chunk_dss.h deleted file mode 100644 index 6be4ad1f212..00000000000 --- a/externals/jemalloc/include/internal/chunk_dss.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifdef JEMALLOC_DSS -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -/* - * Protects sbrk() calls. This avoids malloc races among threads, though it - * does not protect against races with threads that call sbrk() directly. - */ -extern malloc_mutex_t dss_mtx; - -void *chunk_alloc_dss(size_t size, bool *zero); -bool chunk_dealloc_dss(void *chunk, size_t size); -bool chunk_dss_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_DSS */ diff --git a/externals/jemalloc/include/internal/chunk_mmap.h b/externals/jemalloc/include/internal/chunk_mmap.h deleted file mode 100644 index 8fb90b77c9b..00000000000 --- a/externals/jemalloc/include/internal/chunk_mmap.h +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -void *chunk_alloc_mmap(size_t size); -void chunk_dealloc_mmap(void *chunk, size_t size); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/chunk_swap.h b/externals/jemalloc/include/internal/chunk_swap.h deleted file mode 100644 index d50cb197449..00000000000 --- a/externals/jemalloc/include/internal/chunk_swap.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifdef JEMALLOC_SWAP -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern malloc_mutex_t swap_mtx; -extern bool swap_enabled; -extern bool swap_prezeroed; -extern size_t swap_nfds; -extern int *swap_fds; -#ifdef JEMALLOC_STATS -extern size_t swap_avail; -#endif - -void *chunk_alloc_swap(size_t size, bool *zero); -bool chunk_dealloc_swap(void *chunk, size_t size); -bool chunk_swap_enable(const int *fds, unsigned nfds, bool prezeroed); -bool chunk_swap_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_SWAP */ diff --git a/externals/jemalloc/include/internal/ckh.h b/externals/jemalloc/include/internal/ckh.h deleted file mode 100644 index c39ea5c75ef..00000000000 --- a/externals/jemalloc/include/internal/ckh.h +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct ckh_s ckh_t; -typedef struct ckhc_s ckhc_t; - -/* Typedefs to allow easy function pointer passing. */ -typedef void ckh_hash_t (const void *, unsigned, size_t *, size_t *); -typedef bool ckh_keycomp_t (const void *, const void *); - -/* Maintain counters used to get an idea of performance. */ -/* #define CKH_COUNT */ -/* Print counter values in ckh_delete() (requires CKH_COUNT). */ -/* #define CKH_VERBOSE */ - -/* - * There are 2^LG_CKH_BUCKET_CELLS cells in each hash table bucket. Try to fit - * one bucket per L1 cache line. - */ -#define LG_CKH_BUCKET_CELLS (LG_CACHELINE - LG_SIZEOF_PTR - 1) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -/* Hash table cell. */ -struct ckhc_s { - const void *key; - const void *data; -}; - -struct ckh_s { -#ifdef JEMALLOC_DEBUG -#define CKH_MAGIG 0x3af2489d - uint32_t magic; -#endif - -#ifdef CKH_COUNT - /* Counters used to get an idea of performance. */ - uint64_t ngrows; - uint64_t nshrinks; - uint64_t nshrinkfails; - uint64_t ninserts; - uint64_t nrelocs; -#endif - - /* Used for pseudo-random number generation. */ -#define CKH_A 12345 -#define CKH_C 12347 - uint32_t prn_state; - - /* Total number of items. */ - size_t count; - - /* - * Minimum and current number of hash table buckets. There are - * 2^LG_CKH_BUCKET_CELLS cells per bucket. - */ - unsigned lg_minbuckets; - unsigned lg_curbuckets; - - /* Hash and comparison functions. */ - ckh_hash_t *hash; - ckh_keycomp_t *keycomp; - - /* Hash table with 2^lg_curbuckets buckets. */ - ckhc_t *tab; -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -bool ckh_new(ckh_t *ckh, size_t minitems, ckh_hash_t *hash, - ckh_keycomp_t *keycomp); -void ckh_delete(ckh_t *ckh); -size_t ckh_count(ckh_t *ckh); -bool ckh_iter(ckh_t *ckh, size_t *tabind, void **key, void **data); -bool ckh_insert(ckh_t *ckh, const void *key, const void *data); -bool ckh_remove(ckh_t *ckh, const void *searchkey, void **key, - void **data); -bool ckh_search(ckh_t *ckh, const void *seachkey, void **key, void **data); -void ckh_string_hash(const void *key, unsigned minbits, size_t *hash1, - size_t *hash2); -bool ckh_string_keycomp(const void *k1, const void *k2); -void ckh_pointer_hash(const void *key, unsigned minbits, size_t *hash1, - size_t *hash2); -bool ckh_pointer_keycomp(const void *k1, const void *k2); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/ctl.h b/externals/jemalloc/include/internal/ctl.h deleted file mode 100644 index 7bbf21e0e85..00000000000 --- a/externals/jemalloc/include/internal/ctl.h +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct ctl_node_s ctl_node_t; -typedef struct ctl_arena_stats_s ctl_arena_stats_t; -typedef struct ctl_stats_s ctl_stats_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct ctl_node_s { - bool named; - union { - struct { - const char *name; - /* If (nchildren == 0), this is a terminal node. */ - unsigned nchildren; - const ctl_node_t *children; - } named; - struct { - const ctl_node_t *(*index)(const size_t *, size_t, - size_t); - } indexed; - } u; - int (*ctl)(const size_t *, size_t, void *, size_t *, void *, - size_t); -}; - -struct ctl_arena_stats_s { - bool initialized; - size_t pactive; - size_t pdirty; -#ifdef JEMALLOC_STATS - arena_stats_t astats; - - /* Aggregate stats for small size classes, based on bin stats. */ - size_t allocated_small; - uint64_t nmalloc_small; - uint64_t ndalloc_small; - uint64_t nrequests_small; - - malloc_bin_stats_t *bstats; /* nbins elements. */ - malloc_large_stats_t *lstats; /* nlclasses elements. */ -#endif -}; - -struct ctl_stats_s { -#ifdef JEMALLOC_STATS - size_t allocated; - size_t active; - size_t mapped; - struct { - size_t current; /* stats_chunks.curchunks */ - uint64_t total; /* stats_chunks.nchunks */ - size_t high; /* stats_chunks.highchunks */ - } chunks; - struct { - size_t allocated; /* huge_allocated */ - uint64_t nmalloc; /* huge_nmalloc */ - uint64_t ndalloc; /* huge_ndalloc */ - } huge; -#endif - ctl_arena_stats_t *arenas; /* (narenas + 1) elements. */ -#ifdef JEMALLOC_SWAP - size_t swap_avail; -#endif -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -int ctl_byname(const char *name, void *oldp, size_t *oldlenp, void *newp, - size_t newlen); -int ctl_nametomib(const char *name, size_t *mibp, size_t *miblenp); - -int ctl_bymib(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); -bool ctl_boot(void); - -#define xmallctl(name, oldp, oldlenp, newp, newlen) do { \ - if (JEMALLOC_P(mallctl)(name, oldp, oldlenp, newp, newlen) \ - != 0) { \ - malloc_write(": Invalid xmallctl(\""); \ - malloc_write(name); \ - malloc_write("\", ...) call\n"); \ - abort(); \ - } \ -} while (0) - -#define xmallctlnametomib(name, mibp, miblenp) do { \ - if (JEMALLOC_P(mallctlnametomib)(name, mibp, miblenp) != 0) { \ - malloc_write( \ - ": Invalid xmallctlnametomib(\""); \ - malloc_write(name); \ - malloc_write("\", ...) call\n"); \ - abort(); \ - } \ -} while (0) - -#define xmallctlbymib(mib, miblen, oldp, oldlenp, newp, newlen) do { \ - if (JEMALLOC_P(mallctlbymib)(mib, miblen, oldp, oldlenp, newp, \ - newlen) != 0) { \ - malloc_write( \ - ": Invalid xmallctlbymib() call\n"); \ - abort(); \ - } \ -} while (0) - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ - diff --git a/externals/jemalloc/include/internal/extent.h b/externals/jemalloc/include/internal/extent.h deleted file mode 100644 index 33a4e9a3852..00000000000 --- a/externals/jemalloc/include/internal/extent.h +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct extent_node_s extent_node_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -/* Tree of extents. */ -struct extent_node_s { -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) - /* Linkage for the size/address-ordered tree. */ - rb_node(extent_node_t) link_szad; -#endif - - /* Linkage for the address-ordered tree. */ - rb_node(extent_node_t) link_ad; - -#ifdef JEMALLOC_PROF - /* Profile counters, used for huge objects. */ - prof_thr_cnt_t *prof_cnt; -#endif - - /* Pointer to the extent that this tree node is responsible for. */ - void *addr; - - /* Total region size. */ - size_t size; -}; -typedef rb_tree(extent_node_t) extent_tree_t; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#if (defined(JEMALLOC_SWAP) || defined(JEMALLOC_DSS)) -rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t) -#endif - -rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t) - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ - diff --git a/externals/jemalloc/include/internal/hash.h b/externals/jemalloc/include/internal/hash.h deleted file mode 100644 index d12cdb8359f..00000000000 --- a/externals/jemalloc/include/internal/hash.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -uint64_t hash(const void *key, size_t len, uint64_t seed); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(HASH_C_)) -/* - * The following hash function is based on MurmurHash64A(), placed into the - * public domain by Austin Appleby. See http://murmurhash.googlepages.com/ for - * details. - */ -JEMALLOC_INLINE uint64_t -hash(const void *key, size_t len, uint64_t seed) -{ - const uint64_t m = 0xc6a4a7935bd1e995; - const int r = 47; - uint64_t h = seed ^ (len * m); - const uint64_t *data = (const uint64_t *)key; - const uint64_t *end = data + (len/8); - const unsigned char *data2; - - assert(((uintptr_t)key & 0x7) == 0); - - while(data != end) { - uint64_t k = *data++; - - k *= m; - k ^= k >> r; - k *= m; - - h ^= k; - h *= m; - } - - data2 = (const unsigned char *)data; - switch(len & 7) { - case 7: h ^= ((uint64_t)(data2[6])) << 48; - case 6: h ^= ((uint64_t)(data2[5])) << 40; - case 5: h ^= ((uint64_t)(data2[4])) << 32; - case 4: h ^= ((uint64_t)(data2[3])) << 24; - case 3: h ^= ((uint64_t)(data2[2])) << 16; - case 2: h ^= ((uint64_t)(data2[1])) << 8; - case 1: h ^= ((uint64_t)(data2[0])); - h *= m; - } - - h ^= h >> r; - h *= m; - h ^= h >> r; - - return h; -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/huge.h b/externals/jemalloc/include/internal/huge.h deleted file mode 100644 index 3cf32f7506d..00000000000 --- a/externals/jemalloc/include/internal/huge.h +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#ifdef JEMALLOC_STATS -/* Huge allocation statistics. */ -extern uint64_t huge_nmalloc; -extern uint64_t huge_ndalloc; -extern size_t huge_allocated; -#endif - -/* Protects chunk-related data structures. */ -extern malloc_mutex_t huge_mtx; - -void *huge_malloc(size_t size, bool zero); -void *huge_palloc(size_t alignment, size_t size); -void *huge_ralloc(void *ptr, size_t size, size_t oldsize); -void huge_dalloc(void *ptr); -size_t huge_salloc(const void *ptr); -#ifdef JEMALLOC_PROF -prof_thr_cnt_t *huge_prof_cnt_get(const void *ptr); -void huge_prof_cnt_set(const void *ptr, prof_thr_cnt_t *cnt); -#endif -bool huge_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/jemalloc_internal.h b/externals/jemalloc/include/internal/jemalloc_internal.h deleted file mode 100644 index 03782dd6690..00000000000 --- a/externals/jemalloc/include/internal/jemalloc_internal.h +++ /dev/null @@ -1,561 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include -#ifndef SIZE_T_MAX -# define SIZE_T_MAX SIZE_MAX -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define JEMALLOC_MANGLE -#include "../jemalloc.h" - -#ifdef JEMALLOC_LAZY_LOCK -#include -#endif - -#define RB_COMPACT -#include "jemalloc/internal/rb.h" -#include "jemalloc/internal/qr.h" -#include "jemalloc/internal/ql.h" - -extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); - -/* - * Define a custom assert() in order to reduce the chances of deadlock during - * assertion failure. - */ -#ifdef JEMALLOC_DEBUG -# define assert(e) do { \ - if (!(e)) { \ - char line_buf[UMAX2S_BUFSIZE]; \ - malloc_write(": "); \ - malloc_write(__FILE__); \ - malloc_write(":"); \ - malloc_write(umax2s(__LINE__, 10, line_buf)); \ - malloc_write(": Failed assertion: "); \ - malloc_write("\""); \ - malloc_write(#e); \ - malloc_write("\"\n"); \ - abort(); \ - } \ -} while (0) -#else -#define assert(e) -#endif - -/* - * jemalloc can conceptually be broken into components (arena, tcache, etc.), - * but there are circular dependencies that cannot be broken without - * substantial performance degradation. In order to reduce the effect on - * visual code flow, read the header files in multiple passes, with one of the - * following cpp variables defined during each pass: - * - * JEMALLOC_H_TYPES : Preprocessor-defined constants and psuedo-opaque data - * types. - * JEMALLOC_H_STRUCTS : Data structures. - * JEMALLOC_H_EXTERNS : Extern data declarations and function prototypes. - * JEMALLOC_H_INLINES : Inline functions. - */ -/******************************************************************************/ -#define JEMALLOC_H_TYPES - -#define ZU(z) ((size_t)z) - -#ifndef __DECONST -# define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - -#ifdef JEMALLOC_DEBUG - /* Disable inlining to make debugging easier. */ -# define JEMALLOC_INLINE -# define inline -#else -# define JEMALLOC_ENABLE_INLINE -# define JEMALLOC_INLINE static inline -#endif - -/* Size of stack-allocated buffer passed to strerror_r(). */ -#define STRERROR_BUF 64 - -/* Minimum alignment of allocations is 2^LG_QUANTUM bytes. */ -#ifdef __i386__ -# define LG_QUANTUM 4 -#endif -#ifdef __ia64__ -# define LG_QUANTUM 4 -#endif -#ifdef __alpha__ -# define LG_QUANTUM 4 -#endif -#ifdef __sparc64__ -# define LG_QUANTUM 4 -#endif -#if (defined(__amd64__) || defined(__x86_64__)) -# define LG_QUANTUM 4 -#endif -#ifdef __arm__ -# define LG_QUANTUM 3 -#endif -#ifdef __mips__ -# define LG_QUANTUM 3 -#endif -#ifdef __powerpc__ -# define LG_QUANTUM 4 -#endif -#ifdef __s390x__ -# define LG_QUANTUM 4 -#endif - -#define QUANTUM ((size_t)(1U << LG_QUANTUM)) -#define QUANTUM_MASK (QUANTUM - 1) - -/* Return the smallest quantum multiple that is >= a. */ -#define QUANTUM_CEILING(a) \ - (((a) + QUANTUM_MASK) & ~QUANTUM_MASK) - -#define SIZEOF_PTR (1U << LG_SIZEOF_PTR) - -/* We can't use TLS in non-PIC programs, since TLS relies on loader magic. */ -#if (!defined(PIC) && !defined(NO_TLS)) -# define NO_TLS -#endif - -/* - * Maximum size of L1 cache line. This is used to avoid cache line aliasing. - * In addition, this controls the spacing of cacheline-spaced size classes. - */ -#define LG_CACHELINE 6 -#define CACHELINE ((size_t)(1U << LG_CACHELINE)) -#define CACHELINE_MASK (CACHELINE - 1) - -/* Return the smallest cacheline multiple that is >= s. */ -#define CACHELINE_CEILING(s) \ - (((s) + CACHELINE_MASK) & ~CACHELINE_MASK) - -/* - * Page size. STATIC_PAGE_SHIFT is determined by the configure script. If - * DYNAMIC_PAGE_SHIFT is enabled, only use the STATIC_PAGE_* macros where - * compile-time values are required for the purposes of defining data - * structures. - */ -#define STATIC_PAGE_SIZE ((size_t)(1U << STATIC_PAGE_SHIFT)) -#define STATIC_PAGE_MASK ((size_t)(STATIC_PAGE_SIZE - 1)) - -#ifdef DYNAMIC_PAGE_SHIFT -# define PAGE_SHIFT lg_pagesize -# define PAGE_SIZE pagesize -# define PAGE_MASK pagesize_mask -#else -# define PAGE_SHIFT STATIC_PAGE_SHIFT -# define PAGE_SIZE STATIC_PAGE_SIZE -# define PAGE_MASK STATIC_PAGE_MASK -#endif - -/* Return the smallest pagesize multiple that is >= s. */ -#define PAGE_CEILING(s) \ - (((s) + PAGE_MASK) & ~PAGE_MASK) - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_TYPES -/******************************************************************************/ -#define JEMALLOC_H_STRUCTS - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_STRUCTS -/******************************************************************************/ -#define JEMALLOC_H_EXTERNS - -extern bool opt_abort; -#ifdef JEMALLOC_FILL -extern bool opt_junk; -#endif -#ifdef JEMALLOC_SYSV -extern bool opt_sysv; -#endif -#ifdef JEMALLOC_XMALLOC -extern bool opt_xmalloc; -#endif -#ifdef JEMALLOC_FILL -extern bool opt_zero; -#endif - -#ifdef DYNAMIC_PAGE_SHIFT -extern size_t pagesize; -extern size_t pagesize_mask; -extern size_t lg_pagesize; -#endif - -/* Number of CPUs. */ -extern unsigned ncpus; - -extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ -#ifndef NO_TLS -/* - * Map of pthread_self() --> arenas[???], used for selecting an arena to use - * for allocations. - */ -extern __thread arena_t *arenas_map JEMALLOC_ATTR(tls_model("initial-exec")); -#endif -/* - * Arenas that are used to service external requests. Not all elements of the - * arenas array are necessarily used; arenas are created lazily as needed. - */ -extern arena_t **arenas; -extern unsigned narenas; - -arena_t *arenas_extend(unsigned ind); -#ifndef NO_TLS -arena_t *choose_arena_hard(void); -#endif - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_EXTERNS -/******************************************************************************/ -#define JEMALLOC_H_INLINES - -#include "jemalloc/internal/totally_not_p_r_n.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void malloc_write(const char *s); -arena_t *choose_arena(void); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -/* - * Wrapper around malloc_message() that avoids the need for - * JEMALLOC_P(malloc_message)(...) throughout the code. - */ -JEMALLOC_INLINE void -malloc_write(const char *s) -{ - - JEMALLOC_P(malloc_message)(NULL, s); -} - -/* - * Choose an arena based on a per-thread value (fast-path code, calls slow-path - * code if necessary). - */ -JEMALLOC_INLINE arena_t * -choose_arena(void) -{ - arena_t *ret; - - /* - * We can only use TLS if this is a PIC library, since for the static - * library version, libc's malloc is used by TLS allocation, which - * introduces a bootstrapping issue. - */ -#ifndef NO_TLS - ret = arenas_map; - if (ret == NULL) { - ret = choose_arena_hard(); - assert(ret != NULL); - } -#else - if (isthreaded && narenas > 1) { - unsigned long ind; - - /* - * Hash pthread_self() to one of the arenas. There is a prime - * number of arenas, so this has a reasonable chance of - * working. Even so, the hashing can be easily thwarted by - * inconvenient pthread_self() values. Without specific - * knowledge of how pthread_self() calculates values, we can't - * easily do much better than this. - */ - ind = (unsigned long) pthread_self() % narenas; - - /* - * Optimistially assume that arenas[ind] has been initialized. - * At worst, we find out that some other thread has already - * done so, after acquiring the lock in preparation. Note that - * this lazy locking also has the effect of lazily forcing - * cache coherency; without the lock acquisition, there's no - * guarantee that modification of arenas[ind] by another thread - * would be seen on this CPU for an arbitrary amount of time. - * - * In general, this approach to modifying a synchronized value - * isn't a good idea, but in this case we only ever modify the - * value once, so things work out well. - */ - ret = arenas[ind]; - if (ret == NULL) { - /* - * Avoid races with another thread that may have already - * initialized arenas[ind]. - */ - malloc_mutex_lock(&arenas_lock); - if (arenas[ind] == NULL) - ret = arenas_extend((unsigned)ind); - else - ret = arenas[ind]; - malloc_mutex_unlock(&arenas_lock); - } - } else - ret = arenas[0]; -#endif - - assert(ret != NULL); - return (ret); -} -#endif - -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void *imalloc(size_t size); -void *icalloc(size_t size); -void *ipalloc(size_t alignment, size_t size); -size_t isalloc(const void *ptr); -void *iralloc(void *ptr, size_t size); -void idalloc(void *ptr); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -JEMALLOC_INLINE void * -imalloc(size_t size) -{ - - assert(size != 0); - - if (size <= arena_maxclass) - return (arena_malloc(size, false)); - else - return (huge_malloc(size, false)); -} - -JEMALLOC_INLINE void * -icalloc(size_t size) -{ - - if (size <= arena_maxclass) - return (arena_malloc(size, true)); - else - return (huge_malloc(size, true)); -} - -JEMALLOC_INLINE void * -ipalloc(size_t alignment, size_t size) -{ - void *ret; - size_t ceil_size; - - /* - * Round size up to the nearest multiple of alignment. - * - * This done, we can take advantage of the fact that for each small - * size class, every object is aligned at the smallest power of two - * that is non-zero in the base two representation of the size. For - * example: - * - * Size | Base 2 | Minimum alignment - * -----+----------+------------------ - * 96 | 1100000 | 32 - * 144 | 10100000 | 32 - * 192 | 11000000 | 64 - * - * Depending on runtime settings, it is possible that arena_malloc() - * will further round up to a power of two, but that never causes - * correctness issues. - */ - ceil_size = (size + (alignment - 1)) & (-alignment); - /* - * (ceil_size < size) protects against the combination of maximal - * alignment and size greater than maximal alignment. - */ - if (ceil_size < size) { - /* size_t overflow. */ - return (NULL); - } - - if (ceil_size <= PAGE_SIZE || (alignment <= PAGE_SIZE - && ceil_size <= arena_maxclass)) - ret = arena_malloc(ceil_size, false); - else { - size_t run_size; - - /* - * We can't achieve subpage alignment, so round up alignment - * permanently; it makes later calculations simpler. - */ - alignment = PAGE_CEILING(alignment); - ceil_size = PAGE_CEILING(size); - /* - * (ceil_size < size) protects against very large sizes within - * PAGE_SIZE of SIZE_T_MAX. - * - * (ceil_size + alignment < ceil_size) protects against the - * combination of maximal alignment and ceil_size large enough - * to cause overflow. This is similar to the first overflow - * check above, but it needs to be repeated due to the new - * ceil_size value, which may now be *equal* to maximal - * alignment, whereas before we only detected overflow if the - * original size was *greater* than maximal alignment. - */ - if (ceil_size < size || ceil_size + alignment < ceil_size) { - /* size_t overflow. */ - return (NULL); - } - - /* - * Calculate the size of the over-size run that arena_palloc() - * would need to allocate in order to guarantee the alignment. - */ - if (ceil_size >= alignment) - run_size = ceil_size + alignment - PAGE_SIZE; - else { - /* - * It is possible that (alignment << 1) will cause - * overflow, but it doesn't matter because we also - * subtract PAGE_SIZE, which in the case of overflow - * leaves us with a very large run_size. That causes - * the first conditional below to fail, which means - * that the bogus run_size value never gets used for - * anything important. - */ - run_size = (alignment << 1) - PAGE_SIZE; - } - - if (run_size <= arena_maxclass) { - ret = arena_palloc(choose_arena(), alignment, ceil_size, - run_size); - } else if (alignment <= chunksize) - ret = huge_malloc(ceil_size, false); - else - ret = huge_palloc(alignment, ceil_size); - } - - assert(((uintptr_t)ret & (alignment - 1)) == 0); - return (ret); -} - -JEMALLOC_INLINE size_t -isalloc(const void *ptr) -{ - size_t ret; - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { - /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - -#ifdef JEMALLOC_PROF - ret = arena_salloc_demote(ptr); -#else - ret = arena_salloc(ptr); -#endif - } else - ret = huge_salloc(ptr); - - return (ret); -} - -JEMALLOC_INLINE void * -iralloc(void *ptr, size_t size) -{ - size_t oldsize; - - assert(ptr != NULL); - assert(size != 0); - - oldsize = isalloc(ptr); - - if (size <= arena_maxclass) - return (arena_ralloc(ptr, size, oldsize)); - else - return (huge_ralloc(ptr, size, oldsize)); -} - -JEMALLOC_INLINE void -idalloc(void *ptr) -{ - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) - arena_dalloc(chunk->arena, chunk, ptr); - else - huge_dalloc(ptr); -} -#endif - -#undef JEMALLOC_H_INLINES -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/jemalloc_internal.h.in b/externals/jemalloc/include/internal/jemalloc_internal.h.in deleted file mode 100644 index 2c3f32f126d..00000000000 --- a/externals/jemalloc/include/internal/jemalloc_internal.h.in +++ /dev/null @@ -1,561 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include -#ifndef SIZE_T_MAX -# define SIZE_T_MAX SIZE_MAX -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define JEMALLOC_MANGLE -#include "../jemalloc@install_suffix@.h" - -#ifdef JEMALLOC_LAZY_LOCK -#include -#endif - -#define RB_COMPACT -#include "jemalloc/internal/rb.h" -#include "jemalloc/internal/qr.h" -#include "jemalloc/internal/ql.h" - -extern void (*JEMALLOC_P(malloc_message))(void *wcbopaque, const char *s); - -/* - * Define a custom assert() in order to reduce the chances of deadlock during - * assertion failure. - */ -#ifdef JEMALLOC_DEBUG -# define assert(e) do { \ - if (!(e)) { \ - char line_buf[UMAX2S_BUFSIZE]; \ - malloc_write(": "); \ - malloc_write(__FILE__); \ - malloc_write(":"); \ - malloc_write(umax2s(__LINE__, 10, line_buf)); \ - malloc_write(": Failed assertion: "); \ - malloc_write("\""); \ - malloc_write(#e); \ - malloc_write("\"\n"); \ - abort(); \ - } \ -} while (0) -#else -#define assert(e) -#endif - -/* - * jemalloc can conceptually be broken into components (arena, tcache, etc.), - * but there are circular dependencies that cannot be broken without - * substantial performance degradation. In order to reduce the effect on - * visual code flow, read the header files in multiple passes, with one of the - * following cpp variables defined during each pass: - * - * JEMALLOC_H_TYPES : Preprocessor-defined constants and psuedo-opaque data - * types. - * JEMALLOC_H_STRUCTS : Data structures. - * JEMALLOC_H_EXTERNS : Extern data declarations and function prototypes. - * JEMALLOC_H_INLINES : Inline functions. - */ -/******************************************************************************/ -#define JEMALLOC_H_TYPES - -#define ZU(z) ((size_t)z) - -#ifndef __DECONST -# define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - -#ifdef JEMALLOC_DEBUG - /* Disable inlining to make debugging easier. */ -# define JEMALLOC_INLINE -# define inline -#else -# define JEMALLOC_ENABLE_INLINE -# define JEMALLOC_INLINE static inline -#endif - -/* Size of stack-allocated buffer passed to strerror_r(). */ -#define STRERROR_BUF 64 - -/* Minimum alignment of allocations is 2^LG_QUANTUM bytes. */ -#ifdef __i386__ -# define LG_QUANTUM 4 -#endif -#ifdef __ia64__ -# define LG_QUANTUM 4 -#endif -#ifdef __alpha__ -# define LG_QUANTUM 4 -#endif -#ifdef __sparc64__ -# define LG_QUANTUM 4 -#endif -#if (defined(__amd64__) || defined(__x86_64__)) -# define LG_QUANTUM 4 -#endif -#ifdef __arm__ -# define LG_QUANTUM 3 -#endif -#ifdef __mips__ -# define LG_QUANTUM 3 -#endif -#ifdef __powerpc__ -# define LG_QUANTUM 4 -#endif -#ifdef __s390x__ -# define LG_QUANTUM 4 -#endif - -#define QUANTUM ((size_t)(1U << LG_QUANTUM)) -#define QUANTUM_MASK (QUANTUM - 1) - -/* Return the smallest quantum multiple that is >= a. */ -#define QUANTUM_CEILING(a) \ - (((a) + QUANTUM_MASK) & ~QUANTUM_MASK) - -#define SIZEOF_PTR (1U << LG_SIZEOF_PTR) - -/* We can't use TLS in non-PIC programs, since TLS relies on loader magic. */ -#if (!defined(PIC) && !defined(NO_TLS)) -# define NO_TLS -#endif - -/* - * Maximum size of L1 cache line. This is used to avoid cache line aliasing. - * In addition, this controls the spacing of cacheline-spaced size classes. - */ -#define LG_CACHELINE 6 -#define CACHELINE ((size_t)(1U << LG_CACHELINE)) -#define CACHELINE_MASK (CACHELINE - 1) - -/* Return the smallest cacheline multiple that is >= s. */ -#define CACHELINE_CEILING(s) \ - (((s) + CACHELINE_MASK) & ~CACHELINE_MASK) - -/* - * Page size. STATIC_PAGE_SHIFT is determined by the configure script. If - * DYNAMIC_PAGE_SHIFT is enabled, only use the STATIC_PAGE_* macros where - * compile-time values are required for the purposes of defining data - * structures. - */ -#define STATIC_PAGE_SIZE ((size_t)(1U << STATIC_PAGE_SHIFT)) -#define STATIC_PAGE_MASK ((size_t)(STATIC_PAGE_SIZE - 1)) - -#ifdef DYNAMIC_PAGE_SHIFT -# define PAGE_SHIFT lg_pagesize -# define PAGE_SIZE pagesize -# define PAGE_MASK pagesize_mask -#else -# define PAGE_SHIFT STATIC_PAGE_SHIFT -# define PAGE_SIZE STATIC_PAGE_SIZE -# define PAGE_MASK STATIC_PAGE_MASK -#endif - -/* Return the smallest pagesize multiple that is >= s. */ -#define PAGE_CEILING(s) \ - (((s) + PAGE_MASK) & ~PAGE_MASK) - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_TYPES -/******************************************************************************/ -#define JEMALLOC_H_STRUCTS - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_STRUCTS -/******************************************************************************/ -#define JEMALLOC_H_EXTERNS - -extern bool opt_abort; -#ifdef JEMALLOC_FILL -extern bool opt_junk; -#endif -#ifdef JEMALLOC_SYSV -extern bool opt_sysv; -#endif -#ifdef JEMALLOC_XMALLOC -extern bool opt_xmalloc; -#endif -#ifdef JEMALLOC_FILL -extern bool opt_zero; -#endif - -#ifdef DYNAMIC_PAGE_SHIFT -extern size_t pagesize; -extern size_t pagesize_mask; -extern size_t lg_pagesize; -#endif - -/* Number of CPUs. */ -extern unsigned ncpus; - -extern malloc_mutex_t arenas_lock; /* Protects arenas initialization. */ -#ifndef NO_TLS -/* - * Map of pthread_self() --> arenas[???], used for selecting an arena to use - * for allocations. - */ -extern __thread arena_t *arenas_map JEMALLOC_ATTR(tls_model("initial-exec")); -#endif -/* - * Arenas that are used to service external requests. Not all elements of the - * arenas array are necessarily used; arenas are created lazily as needed. - */ -extern arena_t **arenas; -extern unsigned narenas; - -arena_t *arenas_extend(unsigned ind); -#ifndef NO_TLS -arena_t *choose_arena_hard(void); -#endif - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#undef JEMALLOC_H_EXTERNS -/******************************************************************************/ -#define JEMALLOC_H_INLINES - -#include "jemalloc/internal/prn.h" -#include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/stats.h" -#include "jemalloc/internal/ctl.h" -#include "jemalloc/internal/mutex.h" -#include "jemalloc/internal/mb.h" -#include "jemalloc/internal/extent.h" -#include "jemalloc/internal/base.h" -#include "jemalloc/internal/chunk.h" -#include "jemalloc/internal/huge.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void malloc_write(const char *s); -arena_t *choose_arena(void); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -/* - * Wrapper around malloc_message() that avoids the need for - * JEMALLOC_P(malloc_message)(...) throughout the code. - */ -JEMALLOC_INLINE void -malloc_write(const char *s) -{ - - JEMALLOC_P(malloc_message)(NULL, s); -} - -/* - * Choose an arena based on a per-thread value (fast-path code, calls slow-path - * code if necessary). - */ -JEMALLOC_INLINE arena_t * -choose_arena(void) -{ - arena_t *ret; - - /* - * We can only use TLS if this is a PIC library, since for the static - * library version, libc's malloc is used by TLS allocation, which - * introduces a bootstrapping issue. - */ -#ifndef NO_TLS - ret = arenas_map; - if (ret == NULL) { - ret = choose_arena_hard(); - assert(ret != NULL); - } -#else - if (isthreaded && narenas > 1) { - unsigned long ind; - - /* - * Hash pthread_self() to one of the arenas. There is a prime - * number of arenas, so this has a reasonable chance of - * working. Even so, the hashing can be easily thwarted by - * inconvenient pthread_self() values. Without specific - * knowledge of how pthread_self() calculates values, we can't - * easily do much better than this. - */ - ind = (unsigned long) pthread_self() % narenas; - - /* - * Optimistially assume that arenas[ind] has been initialized. - * At worst, we find out that some other thread has already - * done so, after acquiring the lock in preparation. Note that - * this lazy locking also has the effect of lazily forcing - * cache coherency; without the lock acquisition, there's no - * guarantee that modification of arenas[ind] by another thread - * would be seen on this CPU for an arbitrary amount of time. - * - * In general, this approach to modifying a synchronized value - * isn't a good idea, but in this case we only ever modify the - * value once, so things work out well. - */ - ret = arenas[ind]; - if (ret == NULL) { - /* - * Avoid races with another thread that may have already - * initialized arenas[ind]. - */ - malloc_mutex_lock(&arenas_lock); - if (arenas[ind] == NULL) - ret = arenas_extend((unsigned)ind); - else - ret = arenas[ind]; - malloc_mutex_unlock(&arenas_lock); - } - } else - ret = arenas[0]; -#endif - - assert(ret != NULL); - return (ret); -} -#endif - -#include "jemalloc/internal/tcache.h" -#include "jemalloc/internal/arena.h" -#include "jemalloc/internal/hash.h" -#include "jemalloc/internal/prof.h" - -#ifndef JEMALLOC_ENABLE_INLINE -void *imalloc(size_t size); -void *icalloc(size_t size); -void *ipalloc(size_t alignment, size_t size); -size_t isalloc(const void *ptr); -void *iralloc(void *ptr, size_t size); -void idalloc(void *ptr); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_)) -JEMALLOC_INLINE void * -imalloc(size_t size) -{ - - assert(size != 0); - - if (size <= arena_maxclass) - return (arena_malloc(size, false)); - else - return (huge_malloc(size, false)); -} - -JEMALLOC_INLINE void * -icalloc(size_t size) -{ - - if (size <= arena_maxclass) - return (arena_malloc(size, true)); - else - return (huge_malloc(size, true)); -} - -JEMALLOC_INLINE void * -ipalloc(size_t alignment, size_t size) -{ - void *ret; - size_t ceil_size; - - /* - * Round size up to the nearest multiple of alignment. - * - * This done, we can take advantage of the fact that for each small - * size class, every object is aligned at the smallest power of two - * that is non-zero in the base two representation of the size. For - * example: - * - * Size | Base 2 | Minimum alignment - * -----+----------+------------------ - * 96 | 1100000 | 32 - * 144 | 10100000 | 32 - * 192 | 11000000 | 64 - * - * Depending on runtime settings, it is possible that arena_malloc() - * will further round up to a power of two, but that never causes - * correctness issues. - */ - ceil_size = (size + (alignment - 1)) & (-alignment); - /* - * (ceil_size < size) protects against the combination of maximal - * alignment and size greater than maximal alignment. - */ - if (ceil_size < size) { - /* size_t overflow. */ - return (NULL); - } - - if (ceil_size <= PAGE_SIZE || (alignment <= PAGE_SIZE - && ceil_size <= arena_maxclass)) - ret = arena_malloc(ceil_size, false); - else { - size_t run_size; - - /* - * We can't achieve subpage alignment, so round up alignment - * permanently; it makes later calculations simpler. - */ - alignment = PAGE_CEILING(alignment); - ceil_size = PAGE_CEILING(size); - /* - * (ceil_size < size) protects against very large sizes within - * PAGE_SIZE of SIZE_T_MAX. - * - * (ceil_size + alignment < ceil_size) protects against the - * combination of maximal alignment and ceil_size large enough - * to cause overflow. This is similar to the first overflow - * check above, but it needs to be repeated due to the new - * ceil_size value, which may now be *equal* to maximal - * alignment, whereas before we only detected overflow if the - * original size was *greater* than maximal alignment. - */ - if (ceil_size < size || ceil_size + alignment < ceil_size) { - /* size_t overflow. */ - return (NULL); - } - - /* - * Calculate the size of the over-size run that arena_palloc() - * would need to allocate in order to guarantee the alignment. - */ - if (ceil_size >= alignment) - run_size = ceil_size + alignment - PAGE_SIZE; - else { - /* - * It is possible that (alignment << 1) will cause - * overflow, but it doesn't matter because we also - * subtract PAGE_SIZE, which in the case of overflow - * leaves us with a very large run_size. That causes - * the first conditional below to fail, which means - * that the bogus run_size value never gets used for - * anything important. - */ - run_size = (alignment << 1) - PAGE_SIZE; - } - - if (run_size <= arena_maxclass) { - ret = arena_palloc(choose_arena(), alignment, ceil_size, - run_size); - } else if (alignment <= chunksize) - ret = huge_malloc(ceil_size, false); - else - ret = huge_palloc(alignment, ceil_size); - } - - assert(((uintptr_t)ret & (alignment - 1)) == 0); - return (ret); -} - -JEMALLOC_INLINE size_t -isalloc(const void *ptr) -{ - size_t ret; - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) { - /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - -#ifdef JEMALLOC_PROF - ret = arena_salloc_demote(ptr); -#else - ret = arena_salloc(ptr); -#endif - } else - ret = huge_salloc(ptr); - - return (ret); -} - -JEMALLOC_INLINE void * -iralloc(void *ptr, size_t size) -{ - size_t oldsize; - - assert(ptr != NULL); - assert(size != 0); - - oldsize = isalloc(ptr); - - if (size <= arena_maxclass) - return (arena_ralloc(ptr, size, oldsize)); - else - return (huge_ralloc(ptr, size, oldsize)); -} - -JEMALLOC_INLINE void -idalloc(void *ptr) -{ - arena_chunk_t *chunk; - - assert(ptr != NULL); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - if (chunk != ptr) - arena_dalloc(chunk->arena, chunk, ptr); - else - huge_dalloc(ptr); -} -#endif - -#undef JEMALLOC_H_INLINES -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/mb.h b/externals/jemalloc/include/internal/mb.h deleted file mode 100644 index 1707aa91d68..00000000000 --- a/externals/jemalloc/include/internal/mb.h +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void mb_write(void); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(MB_C_)) -#ifdef __i386__ -/* - * According to the Intel Architecture Software Developer's Manual, current - * processors execute instructions in order from the perspective of other - * processors in a multiprocessor system, but 1) Intel reserves the right to - * change that, and 2) the compiler's optimizer could re-order instructions if - * there weren't some form of barrier. Therefore, even if running on an - * architecture that does not need memory barriers (everything through at least - * i686), an "optimizer barrier" is necessary. - */ -JEMALLOC_INLINE void -mb_write(void) -{ - -# if 0 - /* This is a true memory barrier. */ - asm volatile ("pusha;" - "xor %%eax,%%eax;" - "cpuid;" - "popa;" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -#else - /* - * This is hopefully enough to keep the compiler from reordering - * instructions around this one. - */ - asm volatile ("nop;" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -#endif -} -#elif (defined(__amd64_) || defined(__x86_64__)) -JEMALLOC_INLINE void -mb_write(void) -{ - - asm volatile ("sfence" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -} -#elif defined(__powerpc__) -JEMALLOC_INLINE void -mb_write(void) -{ - - asm volatile ("eieio" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -} -#elif defined(__sparc64__) -JEMALLOC_INLINE void -mb_write(void) -{ - - asm volatile ("membar #StoreStore" - : /* Outputs. */ - : /* Inputs. */ - : "memory" /* Clobbers. */ - ); -} -#else -/* - * This is much slower than a simple memory barrier, but the semantics of mutex - * unlock make this work. - */ -JEMALLOC_INLINE void -mb_write(void) -{ - malloc_mutex_t mtx; - - malloc_mutex_init(&mtx); - malloc_mutex_lock(&mtx); - malloc_mutex_unlock(&mtx); -} -#endif -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/mutex.h b/externals/jemalloc/include/internal/mutex.h deleted file mode 100644 index 108bfa8abfd..00000000000 --- a/externals/jemalloc/include/internal/mutex.h +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef pthread_mutex_t malloc_mutex_t; - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#ifdef JEMALLOC_LAZY_LOCK -extern bool isthreaded; -#else -# define isthreaded true -#endif - -bool malloc_mutex_init(malloc_mutex_t *mutex); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void malloc_mutex_lock(malloc_mutex_t *mutex); -bool malloc_mutex_trylock(malloc_mutex_t *mutex); -void malloc_mutex_unlock(malloc_mutex_t *mutex); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_MUTEX_C_)) -JEMALLOC_INLINE void -malloc_mutex_lock(malloc_mutex_t *mutex) -{ - - if (isthreaded) - pthread_mutex_lock(mutex); -} - -JEMALLOC_INLINE bool -malloc_mutex_trylock(malloc_mutex_t *mutex) -{ - - if (isthreaded) - return (pthread_mutex_trylock(mutex) != 0); - else - return (false); -} - -JEMALLOC_INLINE void -malloc_mutex_unlock(malloc_mutex_t *mutex) -{ - - if (isthreaded) - pthread_mutex_unlock(mutex); -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/prof.h b/externals/jemalloc/include/internal/prof.h deleted file mode 100644 index 6e71552d85e..00000000000 --- a/externals/jemalloc/include/internal/prof.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifdef JEMALLOC_PROF -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct prof_bt_s prof_bt_t; -typedef struct prof_cnt_s prof_cnt_t; -typedef struct prof_thr_cnt_s prof_thr_cnt_t; -typedef struct prof_ctx_s prof_ctx_t; -typedef struct prof_s prof_t; - -/* Option defaults. */ -#define LG_PROF_BT_MAX_DEFAULT 2 -#define LG_PROF_SAMPLE_DEFAULT 0 -#define LG_PROF_INTERVAL_DEFAULT 30 - -/* - * Hard limit on stack backtrace depth. Note that the version of - * prof_backtrace() that is based on __builtin_return_address() necessarily has - * a hard-coded number of backtrace frame handlers, so increasing - * LG_PROF_BT_MAX requires changing prof_backtrace(). - */ -#define LG_PROF_BT_MAX 7 /* >= LG_PROF_BT_MAX_DEFAULT */ -#define PROF_BT_MAX (1U << LG_PROF_BT_MAX) - -/* Initial hash table size. */ -#define PROF_CKH_MINITEMS 64 - -/* Size of memory buffer to use when writing dump files. */ -#define PROF_DUMP_BUF_SIZE 65536 - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct prof_bt_s { - /* Backtrace, stored as len program counters. */ - void **vec; - unsigned len; -}; - -#ifdef JEMALLOC_PROF_LIBGCC -/* Data structure passed to libgcc _Unwind_Backtrace() callback functions. */ -typedef struct { - prof_bt_t *bt; - unsigned nignore; - unsigned max; -} prof_unwind_data_t; -#endif - -struct prof_cnt_s { - /* - * Profiling counters. An allocation/deallocation pair can operate on - * different prof_thr_cnt_t objects that are linked into the same - * prof_ctx_t sets_ql, so it is possible for the cur* counters to go - * negative. In principle it is possible for the *bytes counters to - * overflow/underflow, but a general solution would require some form - * of 128-bit counter solution; this implementation doesn't bother to - * solve that problem. - */ - int64_t curobjs; - int64_t curbytes; - uint64_t accumobjs; - uint64_t accumbytes; -}; - -struct prof_thr_cnt_s { - /* Linkage into prof_ctx_t's sets_ql. */ - ql_elm(prof_thr_cnt_t) link; - - /* - * Associated context. If a thread frees an object that it did not - * allocate, it is possible that the context is not cached in the - * thread's hash table, in which case it must be able to look up the - * context, insert a new prof_thr_cnt_t into the thread's hash table, - * and link it into the prof_ctx_t's sets_ql. - */ - prof_ctx_t *ctx; - - /* - * Threads use memory barriers to update the counters. Since there is - * only ever one writer, the only challenge is for the reader to get a - * consistent read of the counters. - * - * The writer uses this series of operations: - * - * 1) Increment epoch to an odd number. - * 2) Update counters. - * 3) Increment epoch to an even number. - * - * The reader must assure 1) that the epoch is even while it reads the - * counters, and 2) that the epoch doesn't change between the time it - * starts and finishes reading the counters. - */ - unsigned epoch; - - /* Profiling counters. */ - prof_cnt_t cnts; -}; - -struct prof_ctx_s { - /* Protects cnt_merged and sets_ql. */ - malloc_mutex_t lock; - - /* Temporary storage for aggregation during dump. */ - prof_cnt_t cnt_dump; - - /* When threads exit, they merge their stats into cnt_merged. */ - prof_cnt_t cnt_merged; - - /* - * List of profile counters, one for each thread that has allocated in - * this context. - */ - ql_head(prof_thr_cnt_t) cnts_ql; -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern bool opt_prof; -/* - * Even if opt_prof is true, sampling can be temporarily disabled by setting - * opt_prof_active to false. No locking is used when updating opt_prof_active, - * so there are no guarantees regarding how long it will take for all threads - * to notice state changes. - */ -extern bool opt_prof_active; -extern size_t opt_lg_prof_bt_max; /* Maximum backtrace depth. */ -extern size_t opt_lg_prof_sample; /* Mean bytes between samples. */ -extern ssize_t opt_lg_prof_interval; /* lg(prof_interval). */ -extern bool opt_prof_udump; /* High-water memory dumping. */ -extern bool opt_prof_leak; /* Dump leak summary at exit. */ - -/* - * Profile dump interval, measured in bytes allocated. Each arena triggers a - * profile dump when it reaches this threshold. The effect is that the - * interval between profile dumps averages prof_interval, though the actual - * interval between dumps will tend to be sporadic, and the interval will be a - * maximum of approximately (prof_interval * narenas). - */ -extern uint64_t prof_interval; - -/* - * If true, promote small sampled objects to large objects, since small run - * headers do not have embedded profile context pointers. - */ -extern bool prof_promote; - -bool prof_init(prof_t *prof, bool master); -void prof_destroy(prof_t *prof); - -prof_thr_cnt_t *prof_alloc_prep(size_t size); -prof_thr_cnt_t *prof_cnt_get(const void *ptr); -void prof_malloc(const void *ptr, prof_thr_cnt_t *cnt); -void prof_realloc(const void *ptr, prof_thr_cnt_t *cnt, const void *old_ptr, - size_t old_size, prof_thr_cnt_t *old_cnt); -void prof_free(const void *ptr); -void prof_idump(void); -bool prof_mdump(const char *filename); -void prof_udump(void); -void prof_boot0(void); -bool prof_boot1(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_PROF */ diff --git a/externals/jemalloc/include/internal/ql.h b/externals/jemalloc/include/internal/ql.h deleted file mode 100644 index a9ed2393f0c..00000000000 --- a/externals/jemalloc/include/internal/ql.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * List definitions. - */ -#define ql_head(a_type) \ -struct { \ - a_type *qlh_first; \ -} - -#define ql_head_initializer(a_head) {NULL} - -#define ql_elm(a_type) qr(a_type) - -/* List functions. */ -#define ql_new(a_head) do { \ - (a_head)->qlh_first = NULL; \ -} while (0) - -#define ql_elm_new(a_elm, a_field) qr_new((a_elm), a_field) - -#define ql_first(a_head) ((a_head)->qlh_first) - -#define ql_last(a_head, a_field) \ - ((ql_first(a_head) != NULL) \ - ? qr_prev(ql_first(a_head), a_field) : NULL) - -#define ql_next(a_head, a_elm, a_field) \ - ((ql_last(a_head, a_field) != (a_elm)) \ - ? qr_next((a_elm), a_field) : NULL) - -#define ql_prev(a_head, a_elm, a_field) \ - ((ql_first(a_head) != (a_elm)) ? qr_prev((a_elm), a_field) \ - : NULL) - -#define ql_before_insert(a_head, a_qlelm, a_elm, a_field) do { \ - qr_before_insert((a_qlelm), (a_elm), a_field); \ - if (ql_first(a_head) == (a_qlelm)) { \ - ql_first(a_head) = (a_elm); \ - } \ -} while (0) - -#define ql_after_insert(a_qlelm, a_elm, a_field) \ - qr_after_insert((a_qlelm), (a_elm), a_field) - -#define ql_head_insert(a_head, a_elm, a_field) do { \ - if (ql_first(a_head) != NULL) { \ - qr_before_insert(ql_first(a_head), (a_elm), a_field); \ - } \ - ql_first(a_head) = (a_elm); \ -} while (0) - -#define ql_tail_insert(a_head, a_elm, a_field) do { \ - if (ql_first(a_head) != NULL) { \ - qr_before_insert(ql_first(a_head), (a_elm), a_field); \ - } \ - ql_first(a_head) = qr_next((a_elm), a_field); \ -} while (0) - -#define ql_remove(a_head, a_elm, a_field) do { \ - if (ql_first(a_head) == (a_elm)) { \ - ql_first(a_head) = qr_next(ql_first(a_head), a_field); \ - } \ - if (ql_first(a_head) != (a_elm)) { \ - qr_remove((a_elm), a_field); \ - } else { \ - ql_first(a_head) = NULL; \ - } \ -} while (0) - -#define ql_head_remove(a_head, a_type, a_field) do { \ - a_type *t = ql_first(a_head); \ - ql_remove((a_head), t, a_field); \ -} while (0) - -#define ql_tail_remove(a_head, a_type, a_field) do { \ - a_type *t = ql_last(a_head, a_field); \ - ql_remove((a_head), t, a_field); \ -} while (0) - -#define ql_foreach(a_var, a_head, a_field) \ - qr_foreach((a_var), ql_first(a_head), a_field) - -#define ql_reverse_foreach(a_var, a_head, a_field) \ - qr_reverse_foreach((a_var), ql_first(a_head), a_field) diff --git a/externals/jemalloc/include/internal/qr.h b/externals/jemalloc/include/internal/qr.h deleted file mode 100644 index fe22352fedd..00000000000 --- a/externals/jemalloc/include/internal/qr.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Ring definitions. */ -#define qr(a_type) \ -struct { \ - a_type *qre_next; \ - a_type *qre_prev; \ -} - -/* Ring functions. */ -#define qr_new(a_qr, a_field) do { \ - (a_qr)->a_field.qre_next = (a_qr); \ - (a_qr)->a_field.qre_prev = (a_qr); \ -} while (0) - -#define qr_next(a_qr, a_field) ((a_qr)->a_field.qre_next) - -#define qr_prev(a_qr, a_field) ((a_qr)->a_field.qre_prev) - -#define qr_before_insert(a_qrelm, a_qr, a_field) do { \ - (a_qr)->a_field.qre_prev = (a_qrelm)->a_field.qre_prev; \ - (a_qr)->a_field.qre_next = (a_qrelm); \ - (a_qr)->a_field.qre_prev->a_field.qre_next = (a_qr); \ - (a_qrelm)->a_field.qre_prev = (a_qr); \ -} while (0) - -#define qr_after_insert(a_qrelm, a_qr, a_field) \ - do \ - { \ - (a_qr)->a_field.qre_next = (a_qrelm)->a_field.qre_next; \ - (a_qr)->a_field.qre_prev = (a_qrelm); \ - (a_qr)->a_field.qre_next->a_field.qre_prev = (a_qr); \ - (a_qrelm)->a_field.qre_next = (a_qr); \ - } while (0) - -#define qr_meld(a_qr_a, a_qr_b, a_field) do { \ - void *t; \ - (a_qr_a)->a_field.qre_prev->a_field.qre_next = (a_qr_b); \ - (a_qr_b)->a_field.qre_prev->a_field.qre_next = (a_qr_a); \ - t = (a_qr_a)->a_field.qre_prev; \ - (a_qr_a)->a_field.qre_prev = (a_qr_b)->a_field.qre_prev; \ - (a_qr_b)->a_field.qre_prev = t; \ -} while (0) - -/* qr_meld() and qr_split() are functionally equivalent, so there's no need to - * have two copies of the code. */ -#define qr_split(a_qr_a, a_qr_b, a_field) \ - qr_meld((a_qr_a), (a_qr_b), a_field) - -#define qr_remove(a_qr, a_field) do { \ - (a_qr)->a_field.qre_prev->a_field.qre_next \ - = (a_qr)->a_field.qre_next; \ - (a_qr)->a_field.qre_next->a_field.qre_prev \ - = (a_qr)->a_field.qre_prev; \ - (a_qr)->a_field.qre_next = (a_qr); \ - (a_qr)->a_field.qre_prev = (a_qr); \ -} while (0) - -#define qr_foreach(var, a_qr, a_field) \ - for ((var) = (a_qr); \ - (var) != NULL; \ - (var) = (((var)->a_field.qre_next != (a_qr)) \ - ? (var)->a_field.qre_next : NULL)) - -#define qr_reverse_foreach(var, a_qr, a_field) \ - for ((var) = ((a_qr) != NULL) ? qr_prev(a_qr, a_field) : NULL; \ - (var) != NULL; \ - (var) = (((var) != (a_qr)) \ - ? (var)->a_field.qre_prev : NULL)) diff --git a/externals/jemalloc/include/internal/rb.h b/externals/jemalloc/include/internal/rb.h deleted file mode 100644 index ee9b009d235..00000000000 --- a/externals/jemalloc/include/internal/rb.h +++ /dev/null @@ -1,973 +0,0 @@ -/*- - ******************************************************************************* - * - * cpp macro implementation of left-leaning 2-3 red-black trees. Parent - * pointers are not used, and color bits are stored in the least significant - * bit of right-child pointers (if RB_COMPACT is defined), thus making node - * linkage as compact as is possible for red-black trees. - * - * Usage: - * - * #include - * #include - * #define NDEBUG // (Optional, see assert(3).) - * #include - * #define RB_COMPACT // (Optional, embed color bits in right-child pointers.) - * #include - * ... - * - ******************************************************************************* - */ - -#ifndef RB_H_ -#define RB_H_ - -#if 0 -__FBSDID("$FreeBSD: head/lib/libc/stdlib/rb.h 204493 2010-02-28 22:57:13Z jasone $"); -#endif - -#ifdef RB_COMPACT -/* Node structure. */ -#define rb_node(a_type) \ -struct { \ - a_type *rbn_left; \ - a_type *rbn_right_red; \ -} -#else -#define rb_node(a_type) \ -struct { \ - a_type *rbn_left; \ - a_type *rbn_right; \ - bool rbn_red; \ -} -#endif - -/* Root structure. */ -#define rb_tree(a_type) \ -struct { \ - a_type *rbt_root; \ - a_type rbt_nil; \ -} - -/* Left accessors. */ -#define rbtn_left_get(a_type, a_field, a_node) \ - ((a_node)->a_field.rbn_left) -#define rbtn_left_set(a_type, a_field, a_node, a_left) do { \ - (a_node)->a_field.rbn_left = a_left; \ -} while (0) - -#ifdef RB_COMPACT -/* Right accessors. */ -#define rbtn_right_get(a_type, a_field, a_node) \ - ((a_type *) (((intptr_t) (a_node)->a_field.rbn_right_red) \ - & ((ssize_t)-2))) -#define rbtn_right_set(a_type, a_field, a_node, a_right) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) (((uintptr_t) a_right) \ - | (((uintptr_t) (a_node)->a_field.rbn_right_red) & ((size_t)1))); \ -} while (0) - -/* Color accessors. */ -#define rbtn_red_get(a_type, a_field, a_node) \ - ((bool) (((uintptr_t) (a_node)->a_field.rbn_right_red) \ - & ((size_t)1))) -#define rbtn_color_set(a_type, a_field, a_node, a_red) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) ((((intptr_t) \ - (a_node)->a_field.rbn_right_red) & ((ssize_t)-2)) \ - | ((ssize_t)a_red)); \ -} while (0) -#define rbtn_red_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) (((uintptr_t) \ - (a_node)->a_field.rbn_right_red) | ((size_t)1)); \ -} while (0) -#define rbtn_black_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_right_red = (a_type *) (((intptr_t) \ - (a_node)->a_field.rbn_right_red) & ((ssize_t)-2)); \ -} while (0) -#else -/* Right accessors. */ -#define rbtn_right_get(a_type, a_field, a_node) \ - ((a_node)->a_field.rbn_right) -#define rbtn_right_set(a_type, a_field, a_node, a_right) do { \ - (a_node)->a_field.rbn_right = a_right; \ -} while (0) - -/* Color accessors. */ -#define rbtn_red_get(a_type, a_field, a_node) \ - ((a_node)->a_field.rbn_red) -#define rbtn_color_set(a_type, a_field, a_node, a_red) do { \ - (a_node)->a_field.rbn_red = (a_red); \ -} while (0) -#define rbtn_red_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_red = true; \ -} while (0) -#define rbtn_black_set(a_type, a_field, a_node) do { \ - (a_node)->a_field.rbn_red = false; \ -} while (0) -#endif - -/* Node initializer. */ -#define rbt_node_new(a_type, a_field, a_rbt, a_node) do { \ - rbtn_left_set(a_type, a_field, (a_node), &(a_rbt)->rbt_nil); \ - rbtn_right_set(a_type, a_field, (a_node), &(a_rbt)->rbt_nil); \ - rbtn_red_set(a_type, a_field, (a_node)); \ -} while (0) - -/* Tree initializer. */ -#define rb_new(a_type, a_field, a_rbt) do { \ - (a_rbt)->rbt_root = &(a_rbt)->rbt_nil; \ - rbt_node_new(a_type, a_field, a_rbt, &(a_rbt)->rbt_nil); \ - rbtn_black_set(a_type, a_field, &(a_rbt)->rbt_nil); \ -} while (0) - -/* Internal utility macros. */ -#define rbtn_first(a_type, a_field, a_rbt, a_root, r_node) do { \ - (r_node) = (a_root); \ - if ((r_node) != &(a_rbt)->rbt_nil) { \ - for (; \ - rbtn_left_get(a_type, a_field, (r_node)) != &(a_rbt)->rbt_nil;\ - (r_node) = rbtn_left_get(a_type, a_field, (r_node))) { \ - } \ - } \ -} while (0) - -#define rbtn_last(a_type, a_field, a_rbt, a_root, r_node) do { \ - (r_node) = (a_root); \ - if ((r_node) != &(a_rbt)->rbt_nil) { \ - for (; rbtn_right_get(a_type, a_field, (r_node)) != \ - &(a_rbt)->rbt_nil; (r_node) = rbtn_right_get(a_type, a_field, \ - (r_node))) { \ - } \ - } \ -} while (0) - -#define rbtn_rotate_left(a_type, a_field, a_node, r_node) do { \ - (r_node) = rbtn_right_get(a_type, a_field, (a_node)); \ - rbtn_right_set(a_type, a_field, (a_node), \ - rbtn_left_get(a_type, a_field, (r_node))); \ - rbtn_left_set(a_type, a_field, (r_node), (a_node)); \ -} while (0) - -#define rbtn_rotate_right(a_type, a_field, a_node, r_node) do { \ - (r_node) = rbtn_left_get(a_type, a_field, (a_node)); \ - rbtn_left_set(a_type, a_field, (a_node), \ - rbtn_right_get(a_type, a_field, (r_node))); \ - rbtn_right_set(a_type, a_field, (r_node), (a_node)); \ -} while (0) - -/* - * The rb_proto() macro generates function prototypes that correspond to the - * functions generated by an equivalently parameterized call to rb_gen(). - */ - -#define rb_proto(a_attr, a_prefix, a_rbt_type, a_type) \ -a_attr void \ -a_prefix##new(a_rbt_type *rbtree); \ -a_attr a_type * \ -a_prefix##first(a_rbt_type *rbtree); \ -a_attr a_type * \ -a_prefix##last(a_rbt_type *rbtree); \ -a_attr a_type * \ -a_prefix##next(a_rbt_type *rbtree, a_type *node); \ -a_attr a_type * \ -a_prefix##prev(a_rbt_type *rbtree, a_type *node); \ -a_attr a_type * \ -a_prefix##search(a_rbt_type *rbtree, a_type *key); \ -a_attr a_type * \ -a_prefix##nsearch(a_rbt_type *rbtree, a_type *key); \ -a_attr a_type * \ -a_prefix##psearch(a_rbt_type *rbtree, a_type *key); \ -a_attr void \ -a_prefix##insert(a_rbt_type *rbtree, a_type *node); \ -a_attr void \ -a_prefix##remove(a_rbt_type *rbtree, a_type *node); \ -a_attr a_type * \ -a_prefix##iter(a_rbt_type *rbtree, a_type *start, a_type *(*cb)( \ - a_rbt_type *, a_type *, void *), void *arg); \ -a_attr a_type * \ -a_prefix##reverse_iter(a_rbt_type *rbtree, a_type *start, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg); - -/* - * The rb_gen() macro generates a type-specific red-black tree implementation, - * based on the above cpp macros. - * - * Arguments: - * - * a_attr : Function attribute for generated functions (ex: static). - * a_prefix : Prefix for generated functions (ex: ex_). - * a_rb_type : Type for red-black tree data structure (ex: ex_t). - * a_type : Type for red-black tree node data structure (ex: ex_node_t). - * a_field : Name of red-black tree node linkage (ex: ex_link). - * a_cmp : Node comparison function name, with the following prototype: - * int (a_cmp *)(a_type *a_node, a_type *a_other); - * ^^^^^^ - * or a_key - * Interpretation of comparision function return values: - * -1 : a_node < a_other - * 0 : a_node == a_other - * 1 : a_node > a_other - * In all cases, the a_node or a_key macro argument is the first - * argument to the comparison function, which makes it possible - * to write comparison functions that treat the first argument - * specially. - * - * Assuming the following setup: - * - * typedef struct ex_node_s ex_node_t; - * struct ex_node_s { - * rb_node(ex_node_t) ex_link; - * }; - * typedef rb_tree(ex_node_t) ex_t; - * rb_gen(static, ex_, ex_t, ex_node_t, ex_link, ex_cmp) - * - * The following API is generated: - * - * static void - * ex_new(ex_t *extree); - * Description: Initialize a red-black tree structure. - * Args: - * extree: Pointer to an uninitialized red-black tree object. - * - * static ex_node_t * - * ex_first(ex_t *extree); - * static ex_node_t * - * ex_last(ex_t *extree); - * Description: Get the first/last node in extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * Ret: First/last node in extree, or NULL if extree is empty. - * - * static ex_node_t * - * ex_next(ex_t *extree, ex_node_t *node); - * static ex_node_t * - * ex_prev(ex_t *extree, ex_node_t *node); - * Description: Get node's successor/predecessor. - * Args: - * extree: Pointer to an initialized red-black tree object. - * node : A node in extree. - * Ret: node's successor/predecessor in extree, or NULL if node is - * last/first. - * - * static ex_node_t * - * ex_search(ex_t *extree, ex_node_t *key); - * Description: Search for node that matches key. - * Args: - * extree: Pointer to an initialized red-black tree object. - * key : Search key. - * Ret: Node in extree that matches key, or NULL if no match. - * - * static ex_node_t * - * ex_nsearch(ex_t *extree, ex_node_t *key); - * static ex_node_t * - * ex_psearch(ex_t *extree, ex_node_t *key); - * Description: Search for node that matches key. If no match is found, - * return what would be key's successor/predecessor, were - * key in extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * key : Search key. - * Ret: Node in extree that matches key, or if no match, hypothetical - * node's successor/predecessor (NULL if no successor/predecessor). - * - * static void - * ex_insert(ex_t *extree, ex_node_t *node); - * Description: Insert node into extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * node : Node to be inserted into extree. - * - * static void - * ex_remove(ex_t *extree, ex_node_t *node); - * Description: Remove node from extree. - * Args: - * extree: Pointer to an initialized red-black tree object. - * node : Node in extree to be removed. - * - * static ex_node_t * - * ex_iter(ex_t *extree, ex_node_t *start, ex_node_t *(*cb)(ex_t *, - * ex_node_t *, void *), void *arg); - * static ex_node_t * - * ex_reverse_iter(ex_t *extree, ex_node_t *start, ex_node *(*cb)(ex_t *, - * ex_node_t *, void *), void *arg); - * Description: Iterate forward/backward over extree, starting at node. - * If extree is modified, iteration must be immediately - * terminated by the callback function that causes the - * modification. - * Args: - * extree: Pointer to an initialized red-black tree object. - * start : Node at which to start iteration, or NULL to start at - * first/last node. - * cb : Callback function, which is called for each node during - * iteration. Under normal circumstances the callback function - * should return NULL, which causes iteration to continue. If a - * callback function returns non-NULL, iteration is immediately - * terminated and the non-NULL return value is returned by the - * iterator. This is useful for re-starting iteration after - * modifying extree. - * arg : Opaque pointer passed to cb(). - * Ret: NULL if iteration completed, or the non-NULL callback return value - * that caused termination of the iteration. - */ -#define rb_gen(a_attr, a_prefix, a_rbt_type, a_type, a_field, a_cmp) \ -a_attr void \ -a_prefix##new(a_rbt_type *rbtree) { \ - rb_new(a_type, a_field, rbtree); \ -} \ -a_attr a_type * \ -a_prefix##first(a_rbt_type *rbtree) { \ - a_type *ret; \ - rbtn_first(a_type, a_field, rbtree, rbtree->rbt_root, ret); \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##last(a_rbt_type *rbtree) { \ - a_type *ret; \ - rbtn_last(a_type, a_field, rbtree, rbtree->rbt_root, ret); \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##next(a_rbt_type *rbtree, a_type *node) { \ - a_type *ret; \ - if (rbtn_right_get(a_type, a_field, node) != &rbtree->rbt_nil) { \ - rbtn_first(a_type, a_field, rbtree, rbtn_right_get(a_type, \ - a_field, node), ret); \ - } else { \ - a_type *tnode = rbtree->rbt_root; \ - assert(tnode != &rbtree->rbt_nil); \ - ret = &rbtree->rbt_nil; \ - while (true) { \ - int cmp = (a_cmp)(node, tnode); \ - if (cmp < 0) { \ - ret = tnode; \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - break; \ - } \ - assert(tnode != &rbtree->rbt_nil); \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##prev(a_rbt_type *rbtree, a_type *node) { \ - a_type *ret; \ - if (rbtn_left_get(a_type, a_field, node) != &rbtree->rbt_nil) { \ - rbtn_last(a_type, a_field, rbtree, rbtn_left_get(a_type, \ - a_field, node), ret); \ - } else { \ - a_type *tnode = rbtree->rbt_root; \ - assert(tnode != &rbtree->rbt_nil); \ - ret = &rbtree->rbt_nil; \ - while (true) { \ - int cmp = (a_cmp)(node, tnode); \ - if (cmp < 0) { \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - ret = tnode; \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - break; \ - } \ - assert(tnode != &rbtree->rbt_nil); \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##search(a_rbt_type *rbtree, a_type *key) { \ - a_type *ret; \ - int cmp; \ - ret = rbtree->rbt_root; \ - while (ret != &rbtree->rbt_nil \ - && (cmp = (a_cmp)(key, ret)) != 0) { \ - if (cmp < 0) { \ - ret = rbtn_left_get(a_type, a_field, ret); \ - } else { \ - ret = rbtn_right_get(a_type, a_field, ret); \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##nsearch(a_rbt_type *rbtree, a_type *key) { \ - a_type *ret; \ - a_type *tnode = rbtree->rbt_root; \ - ret = &rbtree->rbt_nil; \ - while (tnode != &rbtree->rbt_nil) { \ - int cmp = (a_cmp)(key, tnode); \ - if (cmp < 0) { \ - ret = tnode; \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - ret = tnode; \ - break; \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##psearch(a_rbt_type *rbtree, a_type *key) { \ - a_type *ret; \ - a_type *tnode = rbtree->rbt_root; \ - ret = &rbtree->rbt_nil; \ - while (tnode != &rbtree->rbt_nil) { \ - int cmp = (a_cmp)(key, tnode); \ - if (cmp < 0) { \ - tnode = rbtn_left_get(a_type, a_field, tnode); \ - } else if (cmp > 0) { \ - ret = tnode; \ - tnode = rbtn_right_get(a_type, a_field, tnode); \ - } else { \ - ret = tnode; \ - break; \ - } \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = (NULL); \ - } \ - return (ret); \ -} \ -a_attr void \ -a_prefix##insert(a_rbt_type *rbtree, a_type *node) { \ - struct { \ - a_type *node; \ - int cmp; \ - } path[sizeof(void *) << 4], *pathp; \ - rbt_node_new(a_type, a_field, rbtree, node); \ - /* Wind. */ \ - path->node = rbtree->rbt_root; \ - for (pathp = path; pathp->node != &rbtree->rbt_nil; pathp++) { \ - int cmp = pathp->cmp = a_cmp(node, pathp->node); \ - assert(cmp != 0); \ - if (cmp < 0) { \ - pathp[1].node = rbtn_left_get(a_type, a_field, \ - pathp->node); \ - } else { \ - pathp[1].node = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - } \ - } \ - pathp->node = node; \ - /* Unwind. */ \ - for (pathp--; (uintptr_t)pathp >= (uintptr_t)path; pathp--) { \ - a_type *cnode = pathp->node; \ - if (pathp->cmp < 0) { \ - a_type *left = pathp[1].node; \ - rbtn_left_set(a_type, a_field, cnode, left); \ - if (rbtn_red_get(a_type, a_field, left)) { \ - a_type *leftleft = rbtn_left_get(a_type, a_field, left);\ - if (rbtn_red_get(a_type, a_field, leftleft)) { \ - /* Fix up 4-node. */ \ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, leftleft); \ - rbtn_rotate_right(a_type, a_field, cnode, tnode); \ - cnode = tnode; \ - } \ - } else { \ - return; \ - } \ - } else { \ - a_type *right = pathp[1].node; \ - rbtn_right_set(a_type, a_field, cnode, right); \ - if (rbtn_red_get(a_type, a_field, right)) { \ - a_type *left = rbtn_left_get(a_type, a_field, cnode); \ - if (rbtn_red_get(a_type, a_field, left)) { \ - /* Split 4-node. */ \ - rbtn_black_set(a_type, a_field, left); \ - rbtn_black_set(a_type, a_field, right); \ - rbtn_red_set(a_type, a_field, cnode); \ - } else { \ - /* Lean left. */ \ - a_type *tnode; \ - bool tred = rbtn_red_get(a_type, a_field, cnode); \ - rbtn_rotate_left(a_type, a_field, cnode, tnode); \ - rbtn_color_set(a_type, a_field, tnode, tred); \ - rbtn_red_set(a_type, a_field, cnode); \ - cnode = tnode; \ - } \ - } else { \ - return; \ - } \ - } \ - pathp->node = cnode; \ - } \ - /* Set root, and make it black. */ \ - rbtree->rbt_root = path->node; \ - rbtn_black_set(a_type, a_field, rbtree->rbt_root); \ -} \ -a_attr void \ -a_prefix##remove(a_rbt_type *rbtree, a_type *node) { \ - struct { \ - a_type *node; \ - int cmp; \ - } *pathp, *nodep, path[sizeof(void *) << 4]; \ - /* Wind. */ \ - nodep = NULL; /* Silence compiler warning. */ \ - path->node = rbtree->rbt_root; \ - for (pathp = path; pathp->node != &rbtree->rbt_nil; pathp++) { \ - int cmp = pathp->cmp = a_cmp(node, pathp->node); \ - if (cmp < 0) { \ - pathp[1].node = rbtn_left_get(a_type, a_field, \ - pathp->node); \ - } else { \ - pathp[1].node = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - if (cmp == 0) { \ - /* Find node's successor, in preparation for swap. */ \ - pathp->cmp = 1; \ - nodep = pathp; \ - for (pathp++; pathp->node != &rbtree->rbt_nil; \ - pathp++) { \ - pathp->cmp = -1; \ - pathp[1].node = rbtn_left_get(a_type, a_field, \ - pathp->node); \ - } \ - break; \ - } \ - } \ - } \ - assert(nodep->node == node); \ - pathp--; \ - if (pathp->node != node) { \ - /* Swap node with its successor. */ \ - bool tred = rbtn_red_get(a_type, a_field, pathp->node); \ - rbtn_color_set(a_type, a_field, pathp->node, \ - rbtn_red_get(a_type, a_field, node)); \ - rbtn_left_set(a_type, a_field, pathp->node, \ - rbtn_left_get(a_type, a_field, node)); \ - /* If node's successor is its right child, the following code */\ - /* will do the wrong thing for the right child pointer. */\ - /* However, it doesn't matter, because the pointer will be */\ - /* properly set when the successor is pruned. */\ - rbtn_right_set(a_type, a_field, pathp->node, \ - rbtn_right_get(a_type, a_field, node)); \ - rbtn_color_set(a_type, a_field, node, tred); \ - /* The pruned leaf node's child pointers are never accessed */\ - /* again, so don't bother setting them to nil. */\ - nodep->node = pathp->node; \ - pathp->node = node; \ - if (nodep == path) { \ - rbtree->rbt_root = nodep->node; \ - } else { \ - if (nodep[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, nodep[-1].node, \ - nodep->node); \ - } else { \ - rbtn_right_set(a_type, a_field, nodep[-1].node, \ - nodep->node); \ - } \ - } \ - } else { \ - a_type *left = rbtn_left_get(a_type, a_field, node); \ - if (left != &rbtree->rbt_nil) { \ - /* node has no successor, but it has a left child. */\ - /* Splice node out, without losing the left child. */\ - assert(rbtn_red_get(a_type, a_field, node) == false); \ - assert(rbtn_red_get(a_type, a_field, left)); \ - rbtn_black_set(a_type, a_field, left); \ - if (pathp == path) { \ - rbtree->rbt_root = left; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - left); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - left); \ - } \ - } \ - return; \ - } else if (pathp == path) { \ - /* The tree only contained one node. */ \ - rbtree->rbt_root = &rbtree->rbt_nil; \ - return; \ - } \ - } \ - if (rbtn_red_get(a_type, a_field, pathp->node)) { \ - /* Prune red node, which requires no fixup. */ \ - assert(pathp[-1].cmp < 0); \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - &rbtree->rbt_nil); \ - return; \ - } \ - /* The node to be pruned is black, so unwind until balance is */\ - /* restored. */\ - pathp->node = &rbtree->rbt_nil; \ - for (pathp--; (uintptr_t)pathp >= (uintptr_t)path; pathp--) { \ - assert(pathp->cmp != 0); \ - if (pathp->cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp->node, \ - pathp[1].node); \ - assert(rbtn_red_get(a_type, a_field, pathp[1].node) \ - == false); \ - if (rbtn_red_get(a_type, a_field, pathp->node)) { \ - a_type *right = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - a_type *rightleft = rbtn_left_get(a_type, a_field, \ - right); \ - a_type *tnode; \ - if (rbtn_red_get(a_type, a_field, rightleft)) { \ - /* In the following diagrams, ||, //, and \\ */\ - /* indicate the path to the removed node. */\ - /* */\ - /* || */\ - /* pathp(r) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - /* */\ - rbtn_black_set(a_type, a_field, pathp->node); \ - rbtn_rotate_right(a_type, a_field, right, tnode); \ - rbtn_right_set(a_type, a_field, pathp->node, tnode);\ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - } else { \ - /* || */\ - /* pathp(r) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - /* */\ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - } \ - /* Balance restored, but rotation modified subtree */\ - /* root. */\ - assert((uintptr_t)pathp > (uintptr_t)path); \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } \ - return; \ - } else { \ - a_type *right = rbtn_right_get(a_type, a_field, \ - pathp->node); \ - a_type *rightleft = rbtn_left_get(a_type, a_field, \ - right); \ - if (rbtn_red_get(a_type, a_field, rightleft)) { \ - /* || */\ - /* pathp(b) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, rightleft); \ - rbtn_rotate_right(a_type, a_field, right, tnode); \ - rbtn_right_set(a_type, a_field, pathp->node, tnode);\ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - /* Balance restored, but rotation modified */\ - /* subree root, which may actually be the tree */\ - /* root. */\ - if (pathp == path) { \ - /* Set root. */ \ - rbtree->rbt_root = tnode; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } \ - } \ - return; \ - } else { \ - /* || */\ - /* pathp(b) */\ - /* // \ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - a_type *tnode; \ - rbtn_red_set(a_type, a_field, pathp->node); \ - rbtn_rotate_left(a_type, a_field, pathp->node, \ - tnode); \ - pathp->node = tnode; \ - } \ - } \ - } else { \ - a_type *left; \ - rbtn_right_set(a_type, a_field, pathp->node, \ - pathp[1].node); \ - left = rbtn_left_get(a_type, a_field, pathp->node); \ - if (rbtn_red_get(a_type, a_field, left)) { \ - a_type *tnode; \ - a_type *leftright = rbtn_right_get(a_type, a_field, \ - left); \ - a_type *leftrightleft = rbtn_left_get(a_type, a_field, \ - leftright); \ - if (rbtn_red_get(a_type, a_field, leftrightleft)) { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (r) (b) */\ - /* \ */\ - /* (b) */\ - /* / */\ - /* (r) */\ - a_type *unode; \ - rbtn_black_set(a_type, a_field, leftrightleft); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - unode); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - rbtn_right_set(a_type, a_field, unode, tnode); \ - rbtn_rotate_left(a_type, a_field, unode, tnode); \ - } else { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (r) (b) */\ - /* \ */\ - /* (b) */\ - /* / */\ - /* (b) */\ - assert(leftright != &rbtree->rbt_nil); \ - rbtn_red_set(a_type, a_field, leftright); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - rbtn_black_set(a_type, a_field, tnode); \ - } \ - /* Balance restored, but rotation modified subtree */\ - /* root, which may actually be the tree root. */\ - if (pathp == path) { \ - /* Set root. */ \ - rbtree->rbt_root = tnode; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } \ - } \ - return; \ - } else if (rbtn_red_get(a_type, a_field, pathp->node)) { \ - a_type *leftleft = rbtn_left_get(a_type, a_field, left);\ - if (rbtn_red_get(a_type, a_field, leftleft)) { \ - /* || */\ - /* pathp(r) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, pathp->node); \ - rbtn_red_set(a_type, a_field, left); \ - rbtn_black_set(a_type, a_field, leftleft); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - /* Balance restored, but rotation modified */\ - /* subtree root. */\ - assert((uintptr_t)pathp > (uintptr_t)path); \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, pathp[-1].node, \ - tnode); \ - } \ - return; \ - } else { \ - /* || */\ - /* pathp(r) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - rbtn_red_set(a_type, a_field, left); \ - rbtn_black_set(a_type, a_field, pathp->node); \ - /* Balance restored. */ \ - return; \ - } \ - } else { \ - a_type *leftleft = rbtn_left_get(a_type, a_field, left);\ - if (rbtn_red_get(a_type, a_field, leftleft)) { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (r) */\ - a_type *tnode; \ - rbtn_black_set(a_type, a_field, leftleft); \ - rbtn_rotate_right(a_type, a_field, pathp->node, \ - tnode); \ - /* Balance restored, but rotation modified */\ - /* subtree root, which may actually be the tree */\ - /* root. */\ - if (pathp == path) { \ - /* Set root. */ \ - rbtree->rbt_root = tnode; \ - } else { \ - if (pathp[-1].cmp < 0) { \ - rbtn_left_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } else { \ - rbtn_right_set(a_type, a_field, \ - pathp[-1].node, tnode); \ - } \ - } \ - return; \ - } else { \ - /* || */\ - /* pathp(b) */\ - /* / \\ */\ - /* (b) (b) */\ - /* / */\ - /* (b) */\ - rbtn_red_set(a_type, a_field, left); \ - } \ - } \ - } \ - } \ - /* Set root. */ \ - rbtree->rbt_root = path->node; \ - assert(rbtn_red_get(a_type, a_field, rbtree->rbt_root) == false); \ -} \ -a_attr a_type * \ -a_prefix##iter_recurse(a_rbt_type *rbtree, a_type *node, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - if (node == &rbtree->rbt_nil) { \ - return (&rbtree->rbt_nil); \ - } else { \ - a_type *ret; \ - if ((ret = a_prefix##iter_recurse(rbtree, rbtn_left_get(a_type, \ - a_field, node), cb, arg)) != &rbtree->rbt_nil \ - || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##iter_recurse(rbtree, rbtn_right_get(a_type, \ - a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##iter_start(a_rbt_type *rbtree, a_type *start, a_type *node, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - int cmp = a_cmp(start, node); \ - if (cmp < 0) { \ - a_type *ret; \ - if ((ret = a_prefix##iter_start(rbtree, start, \ - rbtn_left_get(a_type, a_field, node), cb, arg)) != \ - &rbtree->rbt_nil || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##iter_recurse(rbtree, rbtn_right_get(a_type, \ - a_field, node), cb, arg)); \ - } else if (cmp > 0) { \ - return (a_prefix##iter_start(rbtree, start, \ - rbtn_right_get(a_type, a_field, node), cb, arg)); \ - } else { \ - a_type *ret; \ - if ((ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##iter_recurse(rbtree, rbtn_right_get(a_type, \ - a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##iter(a_rbt_type *rbtree, a_type *start, a_type *(*cb)( \ - a_rbt_type *, a_type *, void *), void *arg) { \ - a_type *ret; \ - if (start != NULL) { \ - ret = a_prefix##iter_start(rbtree, start, rbtree->rbt_root, \ - cb, arg); \ - } else { \ - ret = a_prefix##iter_recurse(rbtree, rbtree->rbt_root, cb, arg);\ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} \ -a_attr a_type * \ -a_prefix##reverse_iter_recurse(a_rbt_type *rbtree, a_type *node, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - if (node == &rbtree->rbt_nil) { \ - return (&rbtree->rbt_nil); \ - } else { \ - a_type *ret; \ - if ((ret = a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_right_get(a_type, a_field, node), cb, arg)) != \ - &rbtree->rbt_nil || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##reverse_iter_start(a_rbt_type *rbtree, a_type *start, \ - a_type *node, a_type *(*cb)(a_rbt_type *, a_type *, void *), \ - void *arg) { \ - int cmp = a_cmp(start, node); \ - if (cmp > 0) { \ - a_type *ret; \ - if ((ret = a_prefix##reverse_iter_start(rbtree, start, \ - rbtn_right_get(a_type, a_field, node), cb, arg)) != \ - &rbtree->rbt_nil || (ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } else if (cmp < 0) { \ - return (a_prefix##reverse_iter_start(rbtree, start, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } else { \ - a_type *ret; \ - if ((ret = cb(rbtree, node, arg)) != NULL) { \ - return (ret); \ - } \ - return (a_prefix##reverse_iter_recurse(rbtree, \ - rbtn_left_get(a_type, a_field, node), cb, arg)); \ - } \ -} \ -a_attr a_type * \ -a_prefix##reverse_iter(a_rbt_type *rbtree, a_type *start, \ - a_type *(*cb)(a_rbt_type *, a_type *, void *), void *arg) { \ - a_type *ret; \ - if (start != NULL) { \ - ret = a_prefix##reverse_iter_start(rbtree, start, \ - rbtree->rbt_root, cb, arg); \ - } else { \ - ret = a_prefix##reverse_iter_recurse(rbtree, rbtree->rbt_root, \ - cb, arg); \ - } \ - if (ret == &rbtree->rbt_nil) { \ - ret = NULL; \ - } \ - return (ret); \ -} - -#endif /* RB_H_ */ diff --git a/externals/jemalloc/include/internal/stats.h b/externals/jemalloc/include/internal/stats.h deleted file mode 100644 index cbf035ff2b9..00000000000 --- a/externals/jemalloc/include/internal/stats.h +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -#define UMAX2S_BUFSIZE 65 - -#ifdef JEMALLOC_STATS -typedef struct tcache_bin_stats_s tcache_bin_stats_t; -typedef struct malloc_bin_stats_s malloc_bin_stats_t; -typedef struct malloc_large_stats_s malloc_large_stats_t; -typedef struct arena_stats_s arena_stats_t; -#endif -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -typedef struct chunk_stats_s chunk_stats_t; -#endif - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#ifdef JEMALLOC_STATS - -#ifdef JEMALLOC_TCACHE -struct tcache_bin_stats_s { - /* - * Number of allocation requests that corresponded to the size of this - * bin. - */ - uint64_t nrequests; -}; -#endif - -struct malloc_bin_stats_s { - /* - * Current number of bytes allocated, including objects currently - * cached by tcache. - */ - size_t allocated; - - /* - * Total number of allocation/deallocation requests served directly by - * the bin. Note that tcache may allocate an object, then recycle it - * many times, resulting many increments to nrequests, but only one - * each to nmalloc and ndalloc. - */ - uint64_t nmalloc; - uint64_t ndalloc; - - /* - * Number of allocation requests that correspond to the size of this - * bin. This includes requests served by tcache, though tcache only - * periodically merges into this counter. - */ - uint64_t nrequests; - -#ifdef JEMALLOC_TCACHE - /* Number of tcache fills from this bin. */ - uint64_t nfills; - - /* Number of tcache flushes to this bin. */ - uint64_t nflushes; -#endif - - /* Total number of runs created for this bin's size class. */ - uint64_t nruns; - - /* - * Total number of runs reused by extracting them from the runs tree for - * this bin's size class. - */ - uint64_t reruns; - - /* High-water mark for this bin. */ - size_t highruns; - - /* Current number of runs in this bin. */ - size_t curruns; -}; - -struct malloc_large_stats_s { - /* - * Total number of allocation/deallocation requests served directly by - * the arena. Note that tcache may allocate an object, then recycle it - * many times, resulting many increments to nrequests, but only one - * each to nmalloc and ndalloc. - */ - uint64_t nmalloc; - uint64_t ndalloc; - - /* - * Number of allocation requests that correspond to this size class. - * This includes requests served by tcache, though tcache only - * periodically merges into this counter. - */ - uint64_t nrequests; - - /* High-water mark for this size class. */ - size_t highruns; - - /* Current number of runs of this size class. */ - size_t curruns; -}; - -struct arena_stats_s { - /* Number of bytes currently mapped. */ - size_t mapped; - - /* - * Total number of purge sweeps, total number of madvise calls made, - * and total pages purged in order to keep dirty unused memory under - * control. - */ - uint64_t npurge; - uint64_t nmadvise; - uint64_t purged; - - /* Per-size-category statistics. */ - size_t allocated_large; - uint64_t nmalloc_large; - uint64_t ndalloc_large; - uint64_t nrequests_large; - - /* - * One element for each possible size class, including sizes that - * overlap with bin size classes. This is necessary because ipalloc() - * sometimes has to use such large objects in order to assure proper - * alignment. - */ - malloc_large_stats_t *lstats; -}; -#endif /* JEMALLOC_STATS */ - -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) -struct chunk_stats_s { -# ifdef JEMALLOC_STATS - /* Number of chunks that were allocated. */ - uint64_t nchunks; -# endif - - /* High-water mark for number of chunks allocated. */ - size_t highchunks; - - /* - * Current number of chunks allocated. This value isn't maintained for - * any other purpose, so keep track of it in order to be able to set - * highchunks. - */ - size_t curchunks; -}; -#endif /* JEMALLOC_STATS */ - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern bool opt_stats_print; - -char *umax2s(uintmax_t x, unsigned base, char *s); -#ifdef JEMALLOC_STATS -void malloc_cprintf(void (*write)(void *, const char *), void *cbopaque, - const char *format, ...) JEMALLOC_ATTR(format(printf, 3, 4)); -void malloc_printf(const char *format, ...) - JEMALLOC_ATTR(format(printf, 1, 2)); -#endif -void stats_print(void (*write)(void *, const char *), void *cbopaque, - const char *opts); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_STATS -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -#endif /* JEMALLOC_STATS */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/internal/tcache.h b/externals/jemalloc/include/internal/tcache.h deleted file mode 100644 index c76597fafab..00000000000 --- a/externals/jemalloc/include/internal/tcache.h +++ /dev/null @@ -1,380 +0,0 @@ -#ifdef JEMALLOC_TCACHE -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -typedef struct tcache_bin_s tcache_bin_t; -typedef struct tcache_s tcache_t; - -/* - * Absolute maximum number of cache slots for each small bin in the thread - * cache. This is an additional constraint beyond that imposed as: twice the - * number of regions per run for this size class. - * - * This constant must be an even number. - */ -#define TCACHE_NSLOTS_SMALL_MAX 200 - -/* Number of cache slots for large size classes. */ -#define TCACHE_NSLOTS_LARGE 20 - -/* (1U << opt_lg_tcache_maxclass) is used to compute tcache_maxclass. */ -#define LG_TCACHE_MAXCLASS_DEFAULT 15 - -/* - * (1U << opt_lg_tcache_gc_sweep) is the approximate number of allocation - * events between full GC sweeps (-1: disabled). Integer rounding may cause - * the actual number to be slightly higher, since GC is performed - * incrementally. - */ -#define LG_TCACHE_GC_SWEEP_DEFAULT 13 - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -struct tcache_bin_s { -# ifdef JEMALLOC_STATS - tcache_bin_stats_t tstats; -# endif - unsigned low_water; /* Min # cached since last GC. */ - unsigned high_water; /* Max # cached since last GC. */ - unsigned ncached; /* # of cached objects. */ - unsigned ncached_max; /* Upper limit on ncached. */ - void *avail; /* Chain of available objects. */ -}; - -struct tcache_s { -# ifdef JEMALLOC_STATS - ql_elm(tcache_t) link; /* Used for aggregating stats. */ -# endif -# ifdef JEMALLOC_PROF - uint64_t prof_accumbytes;/* Cleared after arena_prof_accum() */ -# endif - arena_t *arena; /* This thread's arena. */ - unsigned ev_cnt; /* Event count since incremental GC. */ - unsigned next_gc_bin; /* Next bin to GC. */ - tcache_bin_t tbins[1]; /* Dynamically sized. */ -}; - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -extern bool opt_tcache; -extern ssize_t opt_lg_tcache_maxclass; -extern ssize_t opt_lg_tcache_gc_sweep; - -/* Map of thread-specific caches. */ -extern __thread tcache_t *tcache_tls - JEMALLOC_ATTR(tls_model("initial-exec")); - -/* - * Number of tcache bins. There are nbins small-object bins, plus 0 or more - * large-object bins. - */ -extern size_t nhbins; - -/* Maximum cached size class. */ -extern size_t tcache_maxclass; - -/* Number of tcache allocation/deallocation events between incremental GCs. */ -extern unsigned tcache_gc_incr; - -void tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache_t *tcache -#endif - ); -void tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache_t *tcache -#endif - ); -tcache_t *tcache_create(arena_t *arena); -void *tcache_alloc_small_hard(tcache_t *tcache, tcache_bin_t *tbin, - size_t binind); -void tcache_destroy(tcache_t *tcache); -#ifdef JEMALLOC_STATS -void tcache_stats_merge(tcache_t *tcache, arena_t *arena); -#endif -void tcache_boot(void); - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#ifndef JEMALLOC_ENABLE_INLINE -void tcache_event(tcache_t *tcache); -tcache_t *tcache_get(void); -void *tcache_alloc_easy(tcache_bin_t *tbin); -void *tcache_alloc_small(tcache_t *tcache, size_t size, bool zero); -void *tcache_alloc_large(tcache_t *tcache, size_t size, bool zero); -void tcache_dalloc_small(tcache_t *tcache, void *ptr); -void tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size); -#endif - -#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_TCACHE_C_)) -JEMALLOC_INLINE tcache_t * -tcache_get(void) -{ - tcache_t *tcache; - - if ((isthreaded & opt_tcache) == false) - return (NULL); - - tcache = tcache_tls; - if ((uintptr_t)tcache <= (uintptr_t)1) { - if (tcache == NULL) { - tcache = tcache_create(choose_arena()); - if (tcache == NULL) - return (NULL); - } else - return (NULL); - } - - return (tcache); -} - -JEMALLOC_INLINE void -tcache_event(tcache_t *tcache) -{ - - if (tcache_gc_incr == 0) - return; - - tcache->ev_cnt++; - assert(tcache->ev_cnt <= tcache_gc_incr); - if (tcache->ev_cnt == tcache_gc_incr) { - size_t binind = tcache->next_gc_bin; - tcache_bin_t *tbin = &tcache->tbins[binind]; - - if (tbin->low_water > 0) { - /* - * Flush (ceiling) 3/4 of the objects below the low - * water mark. - */ - if (binind < nbins) { - tcache_bin_flush_small(tbin, binind, - tbin->ncached - tbin->low_water + - (tbin->low_water >> 2) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } else { - tcache_bin_flush_large(tbin, binind, - tbin->ncached - tbin->low_water + - (tbin->low_water >> 2) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } - } - tbin->low_water = tbin->ncached; - tbin->high_water = tbin->ncached; - - tcache->next_gc_bin++; - if (tcache->next_gc_bin == nhbins) - tcache->next_gc_bin = 0; - tcache->ev_cnt = 0; - } -} - -JEMALLOC_INLINE void * -tcache_alloc_easy(tcache_bin_t *tbin) -{ - void *ret; - - if (tbin->ncached == 0) - return (NULL); - tbin->ncached--; - if (tbin->ncached < tbin->low_water) - tbin->low_water = tbin->ncached; - ret = tbin->avail; - tbin->avail = *(void **)ret; - return (ret); -} - -JEMALLOC_INLINE void * -tcache_alloc_small(tcache_t *tcache, size_t size, bool zero) -{ - void *ret; - size_t binind; - tcache_bin_t *tbin; - - binind = small_size2bin[size]; - assert(binind < nbins); - tbin = &tcache->tbins[binind]; - ret = tcache_alloc_easy(tbin); - if (ret == NULL) { - ret = tcache_alloc_small_hard(tcache, tbin, binind); - if (ret == NULL) - return (NULL); - } - assert(arena_salloc(ret) == tcache->arena->bins[binind].reg_size); - - if (zero == false) { -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - } else - memset(ret, 0, size); - -#ifdef JEMALLOC_STATS - tbin->tstats.nrequests++; -#endif -#ifdef JEMALLOC_PROF - tcache->prof_accumbytes += tcache->arena->bins[binind].reg_size; -#endif - tcache_event(tcache); - return (ret); -} - -JEMALLOC_INLINE void * -tcache_alloc_large(tcache_t *tcache, size_t size, bool zero) -{ - void *ret; - size_t binind; - tcache_bin_t *tbin; - - size = PAGE_CEILING(size); - assert(size <= tcache_maxclass); - binind = nbins + (size >> PAGE_SHIFT) - 1; - assert(binind < nhbins); - tbin = &tcache->tbins[binind]; - ret = tcache_alloc_easy(tbin); - if (ret == NULL) { - /* - * Only allocate one large object at a time, because it's quite - * expensive to create one and not use it. - */ - ret = arena_malloc_large(tcache->arena, size, zero); - if (ret == NULL) - return (NULL); - } else { -#ifdef JEMALLOC_PROF - arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ret); - size_t pageind = (unsigned)(((uintptr_t)ret - (uintptr_t)chunk) - >> PAGE_SHIFT); - chunk->map[pageind].bits |= CHUNK_MAP_CLASS_MASK; -#endif - if (zero == false) { -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ret, 0xa5, size); - else if (opt_zero) - memset(ret, 0, size); -#endif - } else - memset(ret, 0, size); - -#ifdef JEMALLOC_STATS - tbin->tstats.nrequests++; -#endif -#ifdef JEMALLOC_PROF - tcache->prof_accumbytes += size; -#endif - } - - tcache_event(tcache); - return (ret); -} - -JEMALLOC_INLINE void -tcache_dalloc_small(tcache_t *tcache, void *ptr) -{ - arena_t *arena; - arena_chunk_t *chunk; - arena_run_t *run; - arena_bin_t *bin; - tcache_bin_t *tbin; - size_t pageind, binind; - arena_chunk_map_t *mapelm; - - assert(arena_salloc(ptr) <= small_maxclass); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - arena = chunk->arena; - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapelm = &chunk->map[pageind]; - run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); - bin = run->bin; - binind = ((uintptr_t)bin - (uintptr_t)&arena->bins) / - sizeof(arena_bin_t); - assert(binind < nbins); - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ptr, 0x5a, bin->reg_size); -#endif - - tbin = &tcache->tbins[binind]; - if (tbin->ncached == tbin->ncached_max) { - tcache_bin_flush_small(tbin, binind, (tbin->ncached_max >> 1) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } - assert(tbin->ncached < tbin->ncached_max); - *(void **)ptr = tbin->avail; - tbin->avail = ptr; - tbin->ncached++; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; - - tcache_event(tcache); -} - -JEMALLOC_INLINE void -tcache_dalloc_large(tcache_t *tcache, void *ptr, size_t size) -{ - arena_t *arena; - arena_chunk_t *chunk; - size_t pageind, binind; - tcache_bin_t *tbin; - arena_chunk_map_t *mapelm; - - assert((size & PAGE_MASK) == 0); - assert(arena_salloc(ptr) > small_maxclass); - assert(arena_salloc(ptr) <= tcache_maxclass); - - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - arena = chunk->arena; - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> PAGE_SHIFT); - mapelm = &chunk->map[pageind]; - binind = nbins + (size >> PAGE_SHIFT) - 1; - -#ifdef JEMALLOC_FILL - if (opt_junk) - memset(ptr, 0x5a, bin->reg_size); -#endif - - tbin = &tcache->tbins[binind]; - if (tbin->ncached == tbin->ncached_max) { - tcache_bin_flush_large(tbin, binind, (tbin->ncached_max >> 1) -#if (defined(JEMALLOC_STATS) || defined(JEMALLOC_PROF)) - , tcache -#endif - ); - } - assert(tbin->ncached < tbin->ncached_max); - *(void **)ptr = tbin->avail; - tbin->avail = ptr; - tbin->ncached++; - if (tbin->ncached > tbin->high_water) - tbin->high_water = tbin->ncached; - - tcache_event(tcache); -} -#endif - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ -#endif /* JEMALLOC_TCACHE */ diff --git a/externals/jemalloc/include/internal/totally_not_p_r_n.h b/externals/jemalloc/include/internal/totally_not_p_r_n.h deleted file mode 100644 index 0709d708012..00000000000 --- a/externals/jemalloc/include/internal/totally_not_p_r_n.h +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************/ -#ifdef JEMALLOC_H_TYPES - -/* - * Simple linear congruential pseudo-random number generator: - * - * prn(y) = (a*x + c) % m - * - * where the following constants ensure maximal period: - * - * a == Odd number (relatively prime to 2^n), and (a-1) is a multiple of 4. - * c == Odd number (relatively prime to 2^n). - * m == 2^32 - * - * See Knuth's TAOCP 3rd Ed., Vol. 2, pg. 17 for details on these constraints. - * - * This choice of m has the disadvantage that the quality of the bits is - * proportional to bit position. For example. the lowest bit has a cycle of 2, - * the next has a cycle of 4, etc. For this reason, we prefer to use the upper - * bits. - * - * Macro parameters: - * uint32_t r : Result. - * unsigned lg_range : (0..32], number of least significant bits to return. - * uint32_t state : Seed value. - * const uint32_t a, c : See above discussion. - */ -#define prn32(r, lg_range, state, a, c) do { \ - assert(lg_range > 0); \ - assert(lg_range <= 32); \ - \ - r = (state * (a)) + (c); \ - state = r; \ - r >>= (32 - lg_range); \ -} while (false) - -/* Same as prn32(), but 64 bits of pseudo-randomness, using uint64_t. */ -#define prn64(r, lg_range, state, a, c) do { \ - assert(lg_range > 0); \ - assert(lg_range <= 64); \ - \ - r = (state * (a)) + (c); \ - state = r; \ - r >>= (64 - lg_range); \ -} while (false) - -#endif /* JEMALLOC_H_TYPES */ -/******************************************************************************/ -#ifdef JEMALLOC_H_STRUCTS - -#endif /* JEMALLOC_H_STRUCTS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_EXTERNS - -#endif /* JEMALLOC_H_EXTERNS */ -/******************************************************************************/ -#ifdef JEMALLOC_H_INLINES - -#endif /* JEMALLOC_H_INLINES */ -/******************************************************************************/ diff --git a/externals/jemalloc/include/jemalloc.h b/externals/jemalloc/include/jemalloc.h deleted file mode 100644 index d9bafbfff55..00000000000 --- a/externals/jemalloc/include/jemalloc.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef JEMALLOC_H_ -#define JEMALLOC_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#define JEMALLOC_VERSION "1.0.0-0-g5523399" -#define JEMALLOC_VERSION_MAJOR 1 -#define JEMALLOC_VERSION_MINOR 0 -#define JEMALLOC_VERSION_BUGFIX 0 -#define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "5523399" - -#include "jemalloc_defs.h" -#ifndef JEMALLOC_P -# define JEMALLOC_P(s) s -#endif - -extern const char *JEMALLOC_P(malloc_options); -extern void (*JEMALLOC_P(malloc_message))(void *, const char *); - -void *JEMALLOC_P(malloc)(size_t size) JEMALLOC_ATTR(malloc); -void *JEMALLOC_P(calloc)(size_t num, size_t size) JEMALLOC_ATTR(malloc); -int JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) - JEMALLOC_ATTR(nonnull(1)); -void *JEMALLOC_P(realloc)(void *ptr, size_t size); -void JEMALLOC_P(free)(void *ptr); - -size_t JEMALLOC_P(malloc_usable_size)(const void *ptr); -void JEMALLOC_P(malloc_stats_print)(void (*write_cb)(void *, const char *), - void *cbopaque, const char *opts); -int JEMALLOC_P(mallctl)(const char *name, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); -int JEMALLOC_P(mallctlnametomib)(const char *name, size_t *mibp, - size_t *miblenp); -int JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen); - -#ifdef __cplusplus -}; -#endif -#endif /* JEMALLOC_H_ */ diff --git a/externals/jemalloc/include/jemalloc.h.in b/externals/jemalloc/include/jemalloc.h.in deleted file mode 100644 index 8ef8183686e..00000000000 --- a/externals/jemalloc/include/jemalloc.h.in +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef JEMALLOC_H_ -#define JEMALLOC_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#define JEMALLOC_VERSION "@jemalloc_version@" -#define JEMALLOC_VERSION_MAJOR @jemalloc_version_major@ -#define JEMALLOC_VERSION_MINOR @jemalloc_version_minor@ -#define JEMALLOC_VERSION_BUGFIX @jemalloc_version_bugfix@ -#define JEMALLOC_VERSION_NREV @jemalloc_version_nrev@ -#define JEMALLOC_VERSION_GID "@jemalloc_version_gid@" - -#include "jemalloc_defs@install_suffix@.h" -#ifndef JEMALLOC_P -# define JEMALLOC_P(s) s -#endif - -extern const char *JEMALLOC_P(malloc_options); -extern void (*JEMALLOC_P(malloc_message))(void *, const char *); - -void *JEMALLOC_P(malloc)(size_t size) JEMALLOC_ATTR(malloc); -void *JEMALLOC_P(calloc)(size_t num, size_t size) JEMALLOC_ATTR(malloc); -int JEMALLOC_P(posix_memalign)(void **memptr, size_t alignment, size_t size) - JEMALLOC_ATTR(nonnull(1)); -void *JEMALLOC_P(realloc)(void *ptr, size_t size); -void JEMALLOC_P(free)(void *ptr); - -size_t JEMALLOC_P(malloc_usable_size)(const void *ptr); -void JEMALLOC_P(malloc_stats_print)(void (*write_cb)(void *, const char *), - void *cbopaque, const char *opts); -int JEMALLOC_P(mallctl)(const char *name, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); -int JEMALLOC_P(mallctlnametomib)(const char *name, size_t *mibp, - size_t *miblenp); -int JEMALLOC_P(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, - size_t *oldlenp, void *newp, size_t newlen); - -#ifdef __cplusplus -}; -#endif -#endif /* JEMALLOC_H_ */ diff --git a/externals/jemalloc/include/jemalloc_defs.h b/externals/jemalloc/include/jemalloc_defs.h deleted file mode 100644 index e8acaed3abd..00000000000 --- a/externals/jemalloc/include/jemalloc_defs.h +++ /dev/null @@ -1,102 +0,0 @@ -/* include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */ -#ifndef JEMALLOC_DEFS_H_ -#define JEMALLOC_DEFS_H_ - -/* - * If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed. - * This makes it possible, with some care, to use multiple allocators - * simultaneously. - * - * In many cases it is more convenient to manually prefix allocator function - * calls than to let macros do it automatically, particularly when using - * multiple allocators simultaneously. Define JEMALLOC_MANGLE before - * #include'ing jemalloc.h in order to cause name mangling that corresponds to - * the API prefixing. - */ -/* #undef JEMALLOC_PREFIX */ -#if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE)) -/* #undef JEMALLOC_P */ -#endif - -/* - * Hyper-threaded CPUs may need a special instruction inside spin loops in - * order to yield to another virtual CPU. - */ -#define CPU_SPINWAIT __asm__ volatile("pause") - -/* Defined if __attribute__((...)) syntax is supported. */ -#define JEMALLOC_HAVE_ATTR -#ifdef JEMALLOC_HAVE_ATTR -# define JEMALLOC_ATTR(s) __attribute__((s)) -#else -# define JEMALLOC_ATTR(s) -#endif - -/* - * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables - * inline functions. - */ -/* #undef JEMALLOC_DEBUG */ - -/* JEMALLOC_STATS enables statistics calculation. */ -/* #undef JEMALLOC_STATS */ - -/* JEMALLOC_PROF enables allocation profiling. */ -/* #undef JEMALLOC_PROF */ - -/* Use libunwind for profile backtracing if defined. */ -/* #undef JEMALLOC_PROF_LIBUNWIND */ - -/* Use libgcc for profile backtracing if defined. */ -/* #undef JEMALLOC_PROF_LIBGCC */ - -/* - * JEMALLOC_TINY enables support for tiny objects, which are smaller than one - * quantum. - */ -#define JEMALLOC_TINY - -/* - * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. - * This makes it possible to allocate/deallocate objects without any locking - * when the cache is in the steady state. - */ -#define JEMALLOC_TCACHE - -/* - * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage - * segment (DSS). - */ -/* #undef JEMALLOC_DSS */ - -/* JEMALLOC_SWAP enables mmap()ed swap file support. */ -/* #undef JEMALLOC_SWAP */ - -/* Support memory filling (junk/zero). */ -/* #undef JEMALLOC_FILL */ - -/* Support optional abort() on OOM. */ -/* #undef JEMALLOC_XMALLOC */ - -/* Support SYSV semantics. */ -/* #undef JEMALLOC_SYSV */ - -/* Support lazy locking (avoid locking unless a second thread is launched). */ -#define JEMALLOC_LAZY_LOCK - -/* Determine page size at run time if defined. */ -/* #undef DYNAMIC_PAGE_SHIFT */ - -/* One page is 2^STATIC_PAGE_SHIFT bytes. */ -#define STATIC_PAGE_SHIFT 12 - -/* TLS is used to map arenas and magazine caches to threads. */ -/* #undef NO_TLS */ - -/* sizeof(void *) == 2^LG_SIZEOF_PTR. */ -#define LG_SIZEOF_PTR 3 - -/* sizeof(int) == 2^LG_SIZEOF_INT. */ -#define LG_SIZEOF_INT 2 - -#endif /* JEMALLOC_DEFS_H_ */ diff --git a/externals/jemalloc/include/jemalloc_defs.h.in b/externals/jemalloc/include/jemalloc_defs.h.in deleted file mode 100644 index 8b98d670acc..00000000000 --- a/externals/jemalloc/include/jemalloc_defs.h.in +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef JEMALLOC_DEFS_H_ -#define JEMALLOC_DEFS_H_ - -/* - * If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed. - * This makes it possible, with some care, to use multiple allocators - * simultaneously. - * - * In many cases it is more convenient to manually prefix allocator function - * calls than to let macros do it automatically, particularly when using - * multiple allocators simultaneously. Define JEMALLOC_MANGLE before - * #include'ing jemalloc.h in order to cause name mangling that corresponds to - * the API prefixing. - */ -#undef JEMALLOC_PREFIX -#if (defined(JEMALLOC_PREFIX) && defined(JEMALLOC_MANGLE)) -#undef JEMALLOC_P -#endif - -/* - * Hyper-threaded CPUs may need a special instruction inside spin loops in - * order to yield to another virtual CPU. - */ -#undef CPU_SPINWAIT - -/* Defined if __attribute__((...)) syntax is supported. */ -#undef JEMALLOC_HAVE_ATTR -#ifdef JEMALLOC_HAVE_ATTR -# define JEMALLOC_ATTR(s) __attribute__((s)) -#else -# define JEMALLOC_ATTR(s) -#endif - -/* - * JEMALLOC_DEBUG enables assertions and other sanity checks, and disables - * inline functions. - */ -#undef JEMALLOC_DEBUG - -/* JEMALLOC_STATS enables statistics calculation. */ -#undef JEMALLOC_STATS - -/* JEMALLOC_PROF enables allocation profiling. */ -#undef JEMALLOC_PROF - -/* Use libunwind for profile backtracing if defined. */ -#undef JEMALLOC_PROF_LIBUNWIND - -/* Use libgcc for profile backtracing if defined. */ -#undef JEMALLOC_PROF_LIBGCC - -/* - * JEMALLOC_TINY enables support for tiny objects, which are smaller than one - * quantum. - */ -#undef JEMALLOC_TINY - -/* - * JEMALLOC_TCACHE enables a thread-specific caching layer for small objects. - * This makes it possible to allocate/deallocate objects without any locking - * when the cache is in the steady state. - */ -#undef JEMALLOC_TCACHE - -/* - * JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage - * segment (DSS). - */ -#undef JEMALLOC_DSS - -/* JEMALLOC_SWAP enables mmap()ed swap file support. */ -#undef JEMALLOC_SWAP - -/* Support memory filling (junk/zero). */ -#undef JEMALLOC_FILL - -/* Support optional abort() on OOM. */ -#undef JEMALLOC_XMALLOC - -/* Support SYSV semantics. */ -#undef JEMALLOC_SYSV - -/* Support lazy locking (avoid locking unless a second thread is launched). */ -#undef JEMALLOC_LAZY_LOCK - -/* Determine page size at run time if defined. */ -#undef DYNAMIC_PAGE_SHIFT - -/* One page is 2^STATIC_PAGE_SHIFT bytes. */ -#undef STATIC_PAGE_SHIFT - -/* TLS is used to map arenas and magazine caches to threads. */ -#undef NO_TLS - -/* sizeof(void *) == 2^LG_SIZEOF_PTR. */ -#undef LG_SIZEOF_PTR - -/* sizeof(int) == 2^LG_SIZEOF_INT. */ -#undef LG_SIZEOF_INT - -#endif /* JEMALLOC_DEFS_H_ */ diff --git a/dep/include/jemalloc/internal/arena.h b/externals/jemalloc/jemalloc/internal/arena.h similarity index 100% rename from dep/include/jemalloc/internal/arena.h rename to externals/jemalloc/jemalloc/internal/arena.h diff --git a/dep/include/jemalloc/internal/base.h b/externals/jemalloc/jemalloc/internal/base.h similarity index 100% rename from dep/include/jemalloc/internal/base.h rename to externals/jemalloc/jemalloc/internal/base.h diff --git a/dep/include/jemalloc/internal/chunk.h b/externals/jemalloc/jemalloc/internal/chunk.h similarity index 100% rename from dep/include/jemalloc/internal/chunk.h rename to externals/jemalloc/jemalloc/internal/chunk.h diff --git a/dep/include/jemalloc/internal/chunk_dss.h b/externals/jemalloc/jemalloc/internal/chunk_dss.h similarity index 100% rename from dep/include/jemalloc/internal/chunk_dss.h rename to externals/jemalloc/jemalloc/internal/chunk_dss.h diff --git a/dep/include/jemalloc/internal/chunk_mmap.h b/externals/jemalloc/jemalloc/internal/chunk_mmap.h similarity index 100% rename from dep/include/jemalloc/internal/chunk_mmap.h rename to externals/jemalloc/jemalloc/internal/chunk_mmap.h diff --git a/dep/include/jemalloc/internal/chunk_swap.h b/externals/jemalloc/jemalloc/internal/chunk_swap.h similarity index 100% rename from dep/include/jemalloc/internal/chunk_swap.h rename to externals/jemalloc/jemalloc/internal/chunk_swap.h diff --git a/dep/include/jemalloc/internal/ckh.h b/externals/jemalloc/jemalloc/internal/ckh.h similarity index 100% rename from dep/include/jemalloc/internal/ckh.h rename to externals/jemalloc/jemalloc/internal/ckh.h diff --git a/dep/include/jemalloc/internal/ctl.h b/externals/jemalloc/jemalloc/internal/ctl.h similarity index 100% rename from dep/include/jemalloc/internal/ctl.h rename to externals/jemalloc/jemalloc/internal/ctl.h diff --git a/dep/include/jemalloc/internal/extent.h b/externals/jemalloc/jemalloc/internal/extent.h similarity index 100% rename from dep/include/jemalloc/internal/extent.h rename to externals/jemalloc/jemalloc/internal/extent.h diff --git a/dep/include/jemalloc/internal/hash.h b/externals/jemalloc/jemalloc/internal/hash.h similarity index 100% rename from dep/include/jemalloc/internal/hash.h rename to externals/jemalloc/jemalloc/internal/hash.h diff --git a/dep/include/jemalloc/internal/huge.h b/externals/jemalloc/jemalloc/internal/huge.h similarity index 100% rename from dep/include/jemalloc/internal/huge.h rename to externals/jemalloc/jemalloc/internal/huge.h diff --git a/dep/include/jemalloc/internal/jemalloc_internal.h b/externals/jemalloc/jemalloc/internal/jemalloc_internal.h similarity index 100% rename from dep/include/jemalloc/internal/jemalloc_internal.h rename to externals/jemalloc/jemalloc/internal/jemalloc_internal.h diff --git a/dep/include/jemalloc/internal/jemalloc_internal.h.in b/externals/jemalloc/jemalloc/internal/jemalloc_internal.h.in similarity index 100% rename from dep/include/jemalloc/internal/jemalloc_internal.h.in rename to externals/jemalloc/jemalloc/internal/jemalloc_internal.h.in diff --git a/dep/include/jemalloc/internal/mb.h b/externals/jemalloc/jemalloc/internal/mb.h similarity index 100% rename from dep/include/jemalloc/internal/mb.h rename to externals/jemalloc/jemalloc/internal/mb.h diff --git a/dep/include/jemalloc/internal/mutex.h b/externals/jemalloc/jemalloc/internal/mutex.h similarity index 100% rename from dep/include/jemalloc/internal/mutex.h rename to externals/jemalloc/jemalloc/internal/mutex.h diff --git a/dep/include/jemalloc/internal/prof.h b/externals/jemalloc/jemalloc/internal/prof.h similarity index 100% rename from dep/include/jemalloc/internal/prof.h rename to externals/jemalloc/jemalloc/internal/prof.h diff --git a/dep/include/jemalloc/internal/ql.h b/externals/jemalloc/jemalloc/internal/ql.h similarity index 100% rename from dep/include/jemalloc/internal/ql.h rename to externals/jemalloc/jemalloc/internal/ql.h diff --git a/dep/include/jemalloc/internal/qr.h b/externals/jemalloc/jemalloc/internal/qr.h similarity index 100% rename from dep/include/jemalloc/internal/qr.h rename to externals/jemalloc/jemalloc/internal/qr.h diff --git a/dep/include/jemalloc/internal/rb.h b/externals/jemalloc/jemalloc/internal/rb.h similarity index 100% rename from dep/include/jemalloc/internal/rb.h rename to externals/jemalloc/jemalloc/internal/rb.h diff --git a/dep/include/jemalloc/internal/stats.h b/externals/jemalloc/jemalloc/internal/stats.h similarity index 100% rename from dep/include/jemalloc/internal/stats.h rename to externals/jemalloc/jemalloc/internal/stats.h diff --git a/dep/include/jemalloc/internal/tcache.h b/externals/jemalloc/jemalloc/internal/tcache.h similarity index 100% rename from dep/include/jemalloc/internal/tcache.h rename to externals/jemalloc/jemalloc/internal/tcache.h diff --git a/dep/include/jemalloc/internal/totally_not_p_r_n.h b/externals/jemalloc/jemalloc/internal/totally_not_p_r_n.h similarity index 100% rename from dep/include/jemalloc/internal/totally_not_p_r_n.h rename to externals/jemalloc/jemalloc/internal/totally_not_p_r_n.h diff --git a/dep/include/jemalloc/jemalloc.h b/externals/jemalloc/jemalloc/jemalloc.h similarity index 100% rename from dep/include/jemalloc/jemalloc.h rename to externals/jemalloc/jemalloc/jemalloc.h diff --git a/dep/include/jemalloc/jemalloc.h.in b/externals/jemalloc/jemalloc/jemalloc.h.in similarity index 100% rename from dep/include/jemalloc/jemalloc.h.in rename to externals/jemalloc/jemalloc/jemalloc.h.in diff --git a/dep/include/jemalloc/jemalloc_defs.h b/externals/jemalloc/jemalloc/jemalloc_defs.h similarity index 100% rename from dep/include/jemalloc/jemalloc_defs.h rename to externals/jemalloc/jemalloc/jemalloc_defs.h diff --git a/dep/include/jemalloc/jemalloc_defs.h.in b/externals/jemalloc/jemalloc/jemalloc_defs.h.in similarity index 100% rename from dep/include/jemalloc/jemalloc_defs.h.in rename to externals/jemalloc/jemalloc/jemalloc_defs.h.in diff --git a/externals/libmpq/AUTHORS b/externals/libmpq/AUTHORS new file mode 100644 index 00000000000..3d7da7bec9a --- /dev/null +++ b/externals/libmpq/AUTHORS @@ -0,0 +1,10 @@ +Project Initiator: + + * Maik Broemme + +Developers: + + * Maik Broemme + * Tilman Sauerbeck + * Forrest Voight + * Georg Lukas diff --git a/externals/libmpq/COPYING b/externals/libmpq/COPYING new file mode 100644 index 00000000000..4189933be9f --- /dev/null +++ b/externals/libmpq/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/externals/libmpq/FAQ b/externals/libmpq/FAQ new file mode 100644 index 00000000000..52ca9f3c705 --- /dev/null +++ b/externals/libmpq/FAQ @@ -0,0 +1,68 @@ +FAQ - Frequently Asked Questions +================================ + +Q: What is libmpq? +A: libmpq is a library for manipulating MoPaQ mpq archives mostly used + used by Blizzard in their games. + +Q: What can i do with libmpq? +A: With libmpq you can write applications which can extract, create + and manipulate mpq archives. + +Q: Is it legal? +A: Yes, i think so. I have no idea why it should not, all informations + about the fileformat are available. + +Q: Is there a description of the functions? +A: Since version 0.4.0 libmpq comes with a API documentation for + developers. The documentation is written as manual pages. + +Q: Can i help? +A: Yes, help is needed, not only with developing, also with testing. + A good point to start is using a recent SVN version of libmpq and + trying to use it with every mpq archive you could get :) + +Q: Can you give a small example to demonstrate the usage? +A: Of course :) The example below takes first parameter as mpq archive + and extracts the first file to a buffer. + + /* + * Compile with: + * + * x86_32: + * + * gcc \ + * -D_FILE_OFFSET_BITS=64 \ + * -D_LARGE_FILES=1 \ + * -D_LARGEFILE_SOURCE=1 \ + * mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq + * + * x86_64: + * + * gcc \ + * -D_LARGE_FILES=1 \ + * mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq + */ + + #include + #include + #include + + int main(int argc, char **argv) { + mpq_archive_s *mpq_archive; + off_t out_size; + char *out_buf; + + /* open the mpq archive given as first parameter. */ + libmpq__archive_open(&mpq_archive, argv[1], -1); + + /* get size of first file (0) and malloc output buffer. */ + libmpq__file_unpacked_size(mpq_archive, 0, &out_size); + out_buf = malloc(out_size); + + /* read, decrypt and unpack file to output buffer. */ + libmpq__file_read(mpq_archive, 0, out_buf, out_size, NULL); + + /* close the mpq archive. */ + libmpq__archive_close(mpq_archive); + } diff --git a/externals/libmpq/INSTALL b/externals/libmpq/INSTALL new file mode 100644 index 00000000000..b42a17ac464 --- /dev/null +++ b/externals/libmpq/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/externals/libmpq/Makefile.am b/externals/libmpq/Makefile.am new file mode 100644 index 00000000000..0a9b54c2526 --- /dev/null +++ b/externals/libmpq/Makefile.am @@ -0,0 +1,26 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# any directories which should be built and installed. +SUBDIRS = libmpq bindings doc + +# the directories which are part of the distribution. +DIST_SUBDIRS = $(SUBDIRS) + +# libmpq runtime configuration script. +bin_SCRIPTS = libmpq-config + +# pkg-config installation directory. +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libmpq.pc + +# extra stuff. +EXTRA_DIST = \ + AUTHORS \ + COPYING \ + FAQ \ + INSTALL \ + NEWS \ + README \ + THANKS \ + TODO diff --git a/externals/libmpq/NEWS b/externals/libmpq/NEWS new file mode 100644 index 00000000000..74850a8a5bb --- /dev/null +++ b/externals/libmpq/NEWS @@ -0,0 +1,76 @@ +Changes version 0.4.2 (2008-05-16) +================================== + + * added full extraction support for protected maps used in + warcraft 3. + + * added full extraction support for all blizzard titles until + world of warcraft - the burning crusade. + + * added support for archives version 2 with extended header and + extended block table. + + * added support for the bzip2 compression algorithm. + + * added support for archives and files inside archive > 2gb. + + * added generic read functions, which will do decryption, + decompression or exploding. + + * the info functions are no longer exported by the library and + were replaced by separate api functions. + + * the file number and block number are count from 0 instead + of 1. + + * added python bindings. + + * linking against libmpq requires from now on the usual largefile + macros -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE=1 + +Changes version 0.4.1 (2008-04-02) +================================== + + * memory, speed and stability improvements. + + * split sourcecode into library and utility package. + +Changes version 0.4.0 (2008-03-31) +================================== + + * added robust error handling to make the library and extracting + utility more stable. + + * added c++ bindings to public include and moved internal defines + and functions to private include. + + * added support for 64-bit architectures and removed any stupid + pointer to int arithmetics. + + * added much better member names to the structures to make + developers able to understand the code on reading. + + * added full api documentation using manual pages. + + * added full extraction support for all blizzard titles until + warcraft 3 - the frozen throne. + + * added support for single sector and stored files (neither + compressed nor imploded). + + * added support for files which have compressed size greater than + uncompressed size. + + * removed the external listfile database support from 0.3.0 it + was a weird implementation. + +Changes version 0.3.0 (2004-02-12) +================================== + + * added listfile database support from external files. + +Initial version 0.2.1 (2004-01-17) +================================== + + * first version which was able to extract some of the older mopaq + archives. diff --git a/externals/libmpq/README b/externals/libmpq/README new file mode 100644 index 00000000000..3f1bd3a1e9f --- /dev/null +++ b/externals/libmpq/README @@ -0,0 +1,34 @@ +Introduction +============ + +'libmpq' is a library which can be easily used in own applications +to extract, create or manipulate MoPaQ mpq archives. + +MPQ, or MoPaQ, is a proprietary archive format created by +Mike O'Brien, the man hailed as Blizzard's multiplayer engine +genius, back in 1996 as a general purpose archive for use with +Diablo, and named narcissistically for its creator +"Mike O'brien PaCK". The copyrights to it, however, are held by +Havas Interactive, Blizzard's parent company. The archive format +is used by many Blizzard titles like Diablo, Diablo 2, Starcraft, +Warcraft 2: BNE, a newer version in Warcraft 3 and World of +Warcraft (WoW). + +Manual +====== + +Since version 0.4.0 the 'libmpq' package comes with a manpage for +every library function. If you use 'libmpq' first time it is a good +idea to read the `FAQ' file. + +Reporting Bugs +============== + +Bug reports for 'libmpq' can be send to me directly. + + * Maik Broemme + +Enjoy! + +Maik Broemme +http://www.babelize.org/ diff --git a/externals/libmpq/THANKS b/externals/libmpq/THANKS new file mode 100644 index 00000000000..42da1235476 --- /dev/null +++ b/externals/libmpq/THANKS @@ -0,0 +1,21 @@ +'libmpq' was originaly created by Maik Broemme +and i want to thank some people which helped by supplying knowledge, code or +something else. + + * Romy Trompke + - my lovely girlfriend for her patience + + * Ladislav Zezula + - stormlib creator + + * Marko Friedemann + - initial port of stormlib to linux + + * Tom Amigo + - first people who decrypts the MoPaQ archive format + + * ShadowFlare + - creator of the ShadowFlare MPQ API + + * Justin Olbrantz (Quantam) + - creator of the client using ShadowFlare MPQ API diff --git a/externals/libmpq/TODO b/externals/libmpq/TODO new file mode 100644 index 00000000000..0c1951f0b46 --- /dev/null +++ b/externals/libmpq/TODO @@ -0,0 +1,10 @@ +Features and functionality which should be added in the future. + + * Porting for big endian systems. + * Porting for Windows? :) + * Creating mpq archives. + * Brute all unknown filenames, Blizzard uses in their + archives. + +Look at the AUTHORS file if you want help me with 'libmpq', or +if you have other interesting features which should be added. diff --git a/externals/libmpq/autogen.sh b/externals/libmpq/autogen.sh new file mode 100644 index 00000000000..16871edd70d --- /dev/null +++ b/externals/libmpq/autogen.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +echo "Generating build information using aclocal, autoheader, automake and autoconf" +echo "This may take a while ..." + +# Touch the timestamps on all the files since CVS messes them up +directory=`dirname $0` +touch $directory/configure.ac + +# Regenerate configuration files +libtoolize --copy +aclocal +autoheader +automake --foreign --add-missing --copy +autoconf + +# Run configure for this platform +#./configure $* +echo "Now you are ready to run ./configure" diff --git a/externals/libmpq/bindings/Makefile.am b/externals/libmpq/bindings/Makefile.am new file mode 100644 index 00000000000..b9fefe306ef --- /dev/null +++ b/externals/libmpq/bindings/Makefile.am @@ -0,0 +1,6 @@ +# any directories which should be built and installed. +SUBDIRS = d + +if HAVE_PYTHON +SUBDIRS += python +endif diff --git a/externals/libmpq/bindings/d/Makefile.am b/externals/libmpq/bindings/d/Makefile.am new file mode 100644 index 00000000000..4de7285ae51 --- /dev/null +++ b/externals/libmpq/bindings/d/Makefile.am @@ -0,0 +1,6 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# install D binding to /usr/include/d by default +libmpq_includedir = $(includedir)/d +libmpq_include_HEADERS = mpq.d diff --git a/externals/libmpq/bindings/d/dsss.conf b/externals/libmpq/bindings/d/dsss.conf new file mode 100644 index 00000000000..252482c4933 --- /dev/null +++ b/externals/libmpq/bindings/d/dsss.conf @@ -0,0 +1,2 @@ +[mpq.d] +type=sourcelibrary diff --git a/externals/libmpq/bindings/d/mpq.d b/externals/libmpq/bindings/d/mpq.d new file mode 100644 index 00000000000..d72c2d2a986 --- /dev/null +++ b/externals/libmpq/bindings/d/mpq.d @@ -0,0 +1,318 @@ +/* + * mpq.d -- D programming language module for libmpq + * + * Copyright (c) 2008 Georg Lukas + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * This module is written to support Phobos. Patches to allow binding to + * Tango are welcome. + */ + +module mpq; + +/* the following pragma does not work on DMD/Linux, generates a warning on + * GDC/Linux and has not been tested on Windows. Commented out for now. */ +// pragma(lib, "libmpq"); + +import std.string; // for format() and toStringz() +import std.traits; // for ParameterTypeTuple!() + +/* XXX: this assumes that libmpq is compiled with Large File Support on */ +alias long off_t; + +/* libmpq error return values */ +const LIBMPQ_ERROR_OPEN = -1; /* open error on file. */ +const LIBMPQ_ERROR_CLOSE = -2; /* close error on file. */ +const LIBMPQ_ERROR_SEEK = -3; /* lseek error on file. */ +const LIBMPQ_ERROR_READ = -4; /* read error on file. */ +const LIBMPQ_ERROR_WRITE = -5; /* write error on file. */ +const LIBMPQ_ERROR_MALLOC = -6; /* memory allocation error. */ +const LIBMPQ_ERROR_FORMAT = -7; /* format errror. */ +const LIBMPQ_ERROR_NOT_INITIALIZED = -8; /* init() wasn't called. */ +const LIBMPQ_ERROR_SIZE = -9; /* buffer size is to small. */ +const LIBMPQ_ERROR_EXIST = -10; /* file or block does not exist in archive. */ +const LIBMPQ_ERROR_DECRYPT = -11; /* we don't know the decryption seed. */ +const LIBMPQ_ERROR_UNPACK = -12; /* error on unpacking file. */ + +/** libmpq internal meta-data for an archive */ +extern struct mpq_archive_s; + +extern(C) { + +/* libmpq__generic information about library. */ +char *libmpq__version(); + +/* libmpq__generic mpq archive information. */ +int libmpq__archive_open(mpq_archive_s **mpq_archive, char *mpq_filename, off_t archive_offset); +int libmpq__archive_close(mpq_archive_s *mpq_archive); +int libmpq__archive_packed_size(mpq_archive_s *mpq_archive, off_t *packed_size); +int libmpq__archive_unpacked_size(mpq_archive_s *mpq_archive, off_t *unpacked_size); +int libmpq__archive_offset(mpq_archive_s *mpq_archive, off_t *offset); +int libmpq__archive_version(mpq_archive_s *mpq_archive, uint *version_); +int libmpq__archive_files(mpq_archive_s *mpq_archive, uint *files); + +/* libmpq__generic file processing functions. */ +int libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint file_number, off_t *packed_size); +int libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint file_number, off_t *unpacked_size); +int libmpq__file_offset(mpq_archive_s *mpq_archive, uint file_number, off_t *offset); +int libmpq__file_blocks(mpq_archive_s *mpq_archive, uint file_number, uint *blocks); +int libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint file_number, uint *encrypted); +int libmpq__file_compressed(mpq_archive_s *mpq_archive, uint file_number, uint *compressed); +int libmpq__file_imploded(mpq_archive_s *mpq_archive, uint file_number, uint *imploded); +int libmpq__file_number(mpq_archive_s *mpq_archive, char *filename, uint *number); +int libmpq__file_read(mpq_archive_s *mpq_archive, uint file_number, ubyte *out_buf, off_t out_size, off_t *transferred); + +/* libmpq__generic block processing functions. */ +int libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint file_number); +int libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint file_number); +int libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint file_number, uint block_number, off_t *unpacked_size); +int libmpq__block_read(mpq_archive_s *mpq_archive, uint file_number, uint block_number, ubyte *out_buf, off_t out_size, off_t *transferred); + +} + + +/** exception class for failed libmpq calls */ +class MPQException : Exception { + const string[] Errors = [ + "unknown error", + "open error on file", + "close error on file", + "lseek error on file", + "read error on file", + "write error on file", + "memory allocation error", + "format errror", + "init() wasn't called", + "buffer size is to small", + "file or block does not exist in archive", + "we don't know the decryption seed", + "error on unpacking file"]; + + public int errno; + this(char[] fnname = "unknown_function", int errno = 0) { + + this.errno = errno; + if (-errno >= Errors.length) + errno = 0; + super(std.string.format("Error in %s(): %s (%d)", + fnname, Errors[-errno], errno)); + } +} + + +/** template to wrap function calls and throw exceptions in case of error + * + * thanks for the idea to while(nan) blog, + * http://while-nan.blogspot.com/2007/06/wrapping-functions-for-fun-and-profit.html + * + * use: MPQ_CHECKERR(libmpq__archive_open)(&m, "foo.mpq", -1); + * returns the retval of archive_open on success; + * throws an MPQException on failure. + * + * @param Fn libmpq__function reference + * @param args libmpq__function parameters + * @return return value of libmpq__function on success + * @throw MPQException on error + */ +int MPQ_CHECKERR(alias Fn)(ParameterTypeTuple!(Fn) args) +{ + int result = Fn(args); + if (result < 0) { + /* XXX: relying on non-specified stringof() behaviour */ + throw new MPQException((&Fn).stringof[2..$], result); + } + return result; +} + + +/** mixin alias to wrap library functions into MPQ_CHECKERR. + * + * alias mpq.func_name(...) to MPQ_CHECKERR(libmpq__func_name)(...) + * @param func_name name of the function to be wrapped + */ +template MPQ_FUNC(char[] func_name) { + const char[] MPQ_FUNC = "alias MPQ_CHECKERR!(libmpq__" ~ func_name ~ ") " ~ func_name ~ ";"; +} + +alias libmpq__version libversion; /* must be direct alias because it returns char*, not error int */ +mixin(MPQ_FUNC!("archive_open")); +mixin(MPQ_FUNC!("archive_close")); +mixin(MPQ_FUNC!("archive_packed_size")); +mixin(MPQ_FUNC!("archive_unpacked_size")); +mixin(MPQ_FUNC!("archive_offset")); +mixin(MPQ_FUNC!("archive_version")); +mixin(MPQ_FUNC!("archive_files")); +mixin(MPQ_FUNC!("file_packed_size")); +mixin(MPQ_FUNC!("file_unpacked_size")); +mixin(MPQ_FUNC!("file_offset")); +mixin(MPQ_FUNC!("file_blocks")); +mixin(MPQ_FUNC!("file_encrypted")); +mixin(MPQ_FUNC!("file_compressed")); +mixin(MPQ_FUNC!("file_imploded")); +mixin(MPQ_FUNC!("file_number")); +mixin(MPQ_FUNC!("file_read")); +mixin(MPQ_FUNC!("block_open_offset")); +mixin(MPQ_FUNC!("block_close_offset")); +mixin(MPQ_FUNC!("block_unpacked_size")); +mixin(MPQ_FUNC!("block_read")); + +/** getter function named name for returning archive_* single values: + * + * Archive.() { return libmpq__archive_() } + * + * @param type return type for the original function reference + * @param name name of the original function + * @param name2 name for the prototype (defaults to name, used for "version") + * @return getter function mixin + */ +template MPQ_A_GET(char[] type, char[] name, char[] name2 = name) { + const char[] MPQ_A_GET = type ~ " " ~ name2 ~ "() { " ~ + type ~ " ret; " ~ + "archive_" ~ name ~ "(m, &ret); return ret;" ~ + "}"; +} + +/** wrapper class for an MPQ Archive + * + * syntax: auto a = new mpq.Archive("somefile.mpq"); + */ +class Archive { + mpq_archive_s *m; + File listfile; + char[][] listfiledata; + + this(char[] archivename, off_t offset = -1) { + archive_open(&m, toStringz(archivename), offset); + } + + mixin(MPQ_A_GET!("off_t", "packed_size")); + mixin(MPQ_A_GET!("off_t", "unpacked_size")); + mixin(MPQ_A_GET!("off_t", "offset")); + mixin(MPQ_A_GET!("uint", "version", "version_")); + mixin(MPQ_A_GET!("uint", "files")); + + ~this() { + archive_close(m); + } + + mpq_archive_s* archive() { + return m; + } + + File opIndex(char[] fname) { + return new File(this, fname); + } + File opIndex(int fno) { + return new File(this, fno); + } + + char[][] filelist() { + try { + if (!listfile) { + listfile = this["(listfile)"]; + listfiledata = (cast(char[])listfile.read()).splitlines(); + } + return listfiledata; + } catch (MPQException e) { + return []; + } + } + + /+uint filenumber(char[] filename) { + try { + if (!listfile) { + listfile = this["(listfile)"]; + listfiledata = (cast(char[])listfile.read()).splitlines(); + } + return listfiledata; + } catch (MPQException e) { + return []; + } + }+/ + +} + + +/** getter function named name for returning file_* single values: + * + * File.() { return libmpq__file_() } + * + * @param type return type for the original function reference + * @param name name of the original function + * @param name2 name for the prototype (defaults to name, used for "version") + * @return getter function mixin + */ +template MPQ_F_GET(char[] type, char[] name, char[] name2 = name) { + const char[] MPQ_F_GET = type ~ " " ~ name2 ~ "() { " ~ + type ~ " ret; " ~ + "file_" ~ name ~ "(am, fileno, &ret); " ~ + "return ret;" ~ + "}"; +} + +/** wrapper class for a single file in an MPQ Archive + * + * syntax: + * auto a = new mpq.Archive("somefile.mpq"); + * auto f = a["(listfile)"]; + * auto f2 = a[0]; + * auto f3 = new File(a, "(listfile)"); + */ +class File { + Archive a; + mpq_archive_s* am; + char[] filename; + uint fileno; + + this(Archive a, int fileno) { + this.a = a; + this.am = a.archive(); + if (fileno >= a.files) { + throw new MPQException(format("File(%d)", fileno), + LIBMPQ_ERROR_EXIST); + } + this.filename = format("file%04d.xxx", fileno); + this.fileno = fileno; + } + + this(Archive a, char[] filename) { + this.a = a; + this.am = a.archive(); + this.filename = filename; + /* this line will throw an exception when the file is not there */ + mpq.file_number(am, toStringz(filename), &this.fileno); + } + + mixin(MPQ_F_GET!("off_t", "packed_size")); + mixin(MPQ_F_GET!("off_t", "unpacked_size")); + mixin(MPQ_F_GET!("off_t", "offset")); + mixin(MPQ_F_GET!("uint", "blocks")); + mixin(MPQ_F_GET!("uint", "encrypted")); + mixin(MPQ_F_GET!("uint", "compressed")); + mixin(MPQ_F_GET!("uint", "imploded")); + + uint no() { return fileno; } + char[] name() { return filename; } + + ubyte[] read() { + ubyte[] content; + content.length = this.unpacked_size(); + off_t trans; + mpq.file_read(am, fileno, content.ptr, content.length, &trans); + content.length = trans; + return content; + } +} diff --git a/externals/libmpq/bindings/python/Makefile.am b/externals/libmpq/bindings/python/Makefile.am new file mode 100644 index 00000000000..6971a9b2f6d --- /dev/null +++ b/externals/libmpq/bindings/python/Makefile.am @@ -0,0 +1,5 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# library information and headers which should not be installed. +python_PYTHON = mpq.py diff --git a/externals/libmpq/bindings/python/mpq-info b/externals/libmpq/bindings/python/mpq-info new file mode 100644 index 00000000000..2c67aa1d0cc --- /dev/null +++ b/externals/libmpq/bindings/python/mpq-info @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +from __future__ import division + +import sys + +import mpq + +archive = mpq.Archive(sys.argv[1]) + +print "Name: %s" % sys.argv[1] +print "Version: %s" % archive.filename +print "Offset: %s" % archive.offset +print "Packed size: %s" % archive.packed_size +print "Unpacked size: %s" % archive.unpacked_size +print "Compression ratio: %s" % (archive.packed_size/archive.unpacked_size) diff --git a/externals/libmpq/bindings/python/mpq.py b/externals/libmpq/bindings/python/mpq.py new file mode 100644 index 00000000000..cf6ecaae800 --- /dev/null +++ b/externals/libmpq/bindings/python/mpq.py @@ -0,0 +1,322 @@ +"""wrapper for libmpq""" + +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +import ctypes +import ctypes.util +import os + +libmpq = ctypes.CDLL(ctypes.util.find_library("mpq")) + +class Error(Exception): + pass + +errors = { + -1: (IOError, "open"), + -2: (IOError, "close"), + -3: (IOError, "seek"), + -4: (IOError, "read"), + -5: (IOError, "write"), + -6: (MemoryError,), + -7: (Error, "file is not an mpq or is corrupted"), + -8: (AssertionError, "not initialized"), + -9: (AssertionError, "buffer size too small"), + -10: (IndexError, "file not in archive"), + -11: (AssertionError, "decrypt"), + -12: (AssertionError, "unpack"), +} + +def check_error(result, func, arguments, errors=errors): + try: + error = errors[result] + except KeyError: + return result + else: + raise error[0](*error[1:]) + +libmpq.libmpq__version.restype = ctypes.c_char_p + +libmpq.libmpq__archive_open.errcheck = check_error +libmpq.libmpq__archive_close.errcheck = check_error +libmpq.libmpq__archive_packed_size.errcheck = check_error +libmpq.libmpq__archive_unpacked_size.errcheck = check_error +libmpq.libmpq__archive_offset.errcheck = check_error +libmpq.libmpq__archive_version.errcheck = check_error +libmpq.libmpq__archive_files.errcheck = check_error + +libmpq.libmpq__file_packed_size.errcheck = check_error +libmpq.libmpq__file_unpacked_size.errcheck = check_error +libmpq.libmpq__file_offset.errcheck = check_error +libmpq.libmpq__file_blocks.errcheck = check_error +libmpq.libmpq__file_encrypted.errcheck = check_error +libmpq.libmpq__file_compressed.errcheck = check_error +libmpq.libmpq__file_imploded.errcheck = check_error +libmpq.libmpq__file_number.errcheck = check_error +libmpq.libmpq__file_read.errcheck = check_error + +libmpq.libmpq__block_open_offset.errcheck = check_error +libmpq.libmpq__block_close_offset.errcheck = check_error +libmpq.libmpq__block_unpacked_size.errcheck = check_error +libmpq.libmpq__block_read.errcheck = check_error + +__version__ = libmpq.libmpq__version() + + +class Reader(object): + def __init__(self, file, libmpq=libmpq): + self._file = file + self._pos = 0 + self._buf = [] + self._cur_block = 0 + libmpq.libmpq__block_open_offset(self._file._archive._mpq, + self._file.number) + + def __iter__(self): + return self + + def __repr__(self): + return "iter(%r)" % self._file + + def seek(self, offset, whence=os.SEEK_SET, os=os): + if whence == os.SEEK_SET: + pass + elif whence == os.SEEK_CUR: + offset += self._pos + elif whence == os.SEEK_END: + offset += self._file.unpacked_size + else: + raise ValueError, "invalid whence" + + if offset >= self._pos: + self.read(offset - self._pos) + else: + self._pos = 0 + self._buf = [] + self._cur_block = 0 + self.read(offset) + + def tell(self): + return self._pos + + def _read_block(self, ctypes=ctypes, libmpq=libmpq): + block_size = ctypes.c_uint64() + libmpq.libmpq__block_unpacked_size(self._file._archive._mpq, + self._file.number, self._cur_block, ctypes.byref(block_size)) + block_data = ctypes.create_string_buffer(block_size.value) + libmpq.libmpq__block_read(self._file._archive._mpq, + self._file.number, self._cur_block, + block_data, ctypes.c_uint64(len(block_data)), None) + self._buf.append(block_data.raw) + self._cur_block += 1 + + def read(self, size=-1): + while size < 0 or sum(map(len, self._buf)) < size: + if self._cur_block == self._file.blocks: + break + self._read_block() + buf = "".join(self._buf) + if size < 0: + ret = buf + self._buf = [] + else: + ret = buf[:size] + self._buf = [buf[size:]] + self._pos += len(ret) + return ret + + def readline(self, os=os): + line = [] + while True: + char = self.read(1) + if char == "": + break + if char not in '\r\n' and line and line[-1] in '\r\n': + self.seek(-1, os.SEEK_CUR) + break + line.append(char) + return ''.join(line) + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + + def readlines(self, sizehint=-1): + res = [] + while sizehint < 0 or sum(map(len, res)) < sizehint: + line = self.readline() + if not line: + break + res.append(line) + return res + + xreadlines = __iter__ + + def __del__(self, libmpq=libmpq): + libmpq.libmpq__block_close_offset(self._file._archive._mpq, + self._file.number) + + +class File(object): + def __init__(self, archive, number, ctypes=ctypes, libmpq=libmpq): + self._archive = archive + self.number = number + + for name, atype in [ + ("packed_size", ctypes.c_uint64), + ("unpacked_size", ctypes.c_uint64), + ("offset", ctypes.c_uint64), + ("blocks", ctypes.c_uint32), + ("encrypted", ctypes.c_uint32), + ("compressed", ctypes.c_uint32), + ("imploded", ctypes.c_uint32), + ]: + data = atype() + func = getattr(libmpq, "libmpq__file_"+name) + func(self._archive._mpq, self.number, ctypes.byref(data)) + setattr(self, name, data.value) + + def __str__(self, ctypes=ctypes, libmpq=libmpq): + data = ctypes.create_string_buffer(self.unpacked_size) + libmpq.libmpq__file_read(self._archive._mpq, self.number, + data, ctypes.c_uint64(len(data)), None) + return data.raw + + def __repr__(self): + return "%r[%i]" % (self._archive, self.number) + + def __iter__(self, Reader=Reader): + return Reader(self) + + +class Archive(object): + def __init__(self, source, ctypes=ctypes, File=File, libmpq=libmpq): + self._source = source + if isinstance(source, File): + assert not source.encrypted + assert not source.compressed + assert not source.imploded + self.filename = source._archive.filename + offset = source._archive.offset + source.offset + else: + self.filename = source + offset = -1 + + self._mpq = ctypes.c_void_p() + libmpq.libmpq__archive_open(ctypes.byref(self._mpq), self.filename, + ctypes.c_uint64(offset)) + self._opened = True + + for field_name, field_type in [ + ("packed_size", ctypes.c_uint64), + ("unpacked_size", ctypes.c_uint64), + ("offset", ctypes.c_uint64), + ("version", ctypes.c_uint32), + ("files", ctypes.c_uint32), + ]: + func = getattr(libmpq, "libmpq__archive_" + field_name) + data = field_type() + func(self._mpq, ctypes.byref(data)) + setattr(self, field_name, data.value) + + def __del__(self, libmpq=libmpq): + if getattr(self, "_opened", False): + libmpq.libmpq__archive_close(self._mpq) + + def __len__(self): + return self.files + + def __contains__(self, item, ctypes=ctypes, libmpq=libmpq): + if isinstance(item, str): + data = ctypes.c_uint32() + try: + libmpq.libmpq__file_number(self._mpq, ctypes.c_char_p(item), + ctypes.byref(data)) + except IndexError: + return False + return True + return 0 <= item < self.files + + def __getitem__(self, item, ctypes=ctypes, File=File, libmpq=libmpq): + if isinstance(item, str): + data = ctypes.c_int() + libmpq.libmpq__file_number(self._mpq, ctypes.c_char_p(item), + ctypes.byref(data)) + item = data.value + else: + if not 0 <= item < self.files: + raise IndexError, "file not in archive" + return File(self, item) + + def __repr__(self): + return "mpq.Archive(%r)" % self._source + +# Remove clutter - everything except Error and Archive. +del os, check_error, ctypes, errors, File, libmpq, Reader + +if __name__ == "__main__": + import sys, random + archive = Archive(sys.argv[1]) + print repr(archive) + for k, v in archive.__dict__.iteritems(): + #if k[0] == '_': continue + print " " * (4 - 1), k, v + assert '(listfile)' in archive + assert 0 in archive + assert len(archive) == archive.files + files = [x.strip() for x in archive['(listfile)']] + files.extend(xrange(archive.files)) + for key in files: #sys.argv[2:] if sys.argv[2:] else xrange(archive.files): + file = archive[key] + print + print " " * (4 - 1), repr(file) + for k, v in file.__dict__.iteritems(): + #if k[0] == '_': continue + print " " * (8 - 1), k, v + + a = str(file) + + b = iter(file).read() + + reader = iter(file) + c = [] + while True: + l = random.randrange(1, 10) + d = reader.read(l) + if not d: break + assert len(d) <= l + c.append(d) + c = "".join(c) + + d = [] + reader.seek(0) + for line in reader: + d.append(line) + d = "".join(d) + + assert a == b == c == d, map(hash, [a,b,c,d]) + assert len(a) == file.unpacked_size + + repr(iter(file)) + + + reader.seek(0) + a = reader.readlines() + + reader.seek(0) + b = list(reader) + + assert a == b diff --git a/externals/libmpq/config.h b/externals/libmpq/config.h new file mode 100644 index 00000000000..c69fb13211b --- /dev/null +++ b/externals/libmpq/config.h @@ -0,0 +1,74 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `bz2' library (-lbz2). */ +#define HAVE_LIBBZ2 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Name of package */ +#define PACKAGE "libmpq" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mbroemme@plusserver.de" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libmpq" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libmpq 0.4.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libmpq" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.4.2" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.4.2" + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ diff --git a/externals/libmpq/configure.ac b/externals/libmpq/configure.ac new file mode 100644 index 00000000000..d274eab07c6 --- /dev/null +++ b/externals/libmpq/configure.ac @@ -0,0 +1,84 @@ +# the autoconf initilization. +AC_INIT(libmpq, 0.4.2, [mbroemme@plusserver.de], [libmpq]) + +# detect the canonical host and target build environment. +AC_CANONICAL_SYSTEM + +# initialize autoconf and automake system. +AM_INIT_AUTOMAKE([no-dependencies]) +AC_CONFIG_HEADERS([config.h:config.h.in]) + +# notices. +AC_PREREQ(2.53) +AC_REVISION($Revision: 1.6 $) + +# checking for programs. +AC_PROG_LIBTOOL +AC_PROG_MAKE_SET +AC_PROG_CC +AC_SYS_LARGEFILE +AC_FUNC_FSEEKO + +# check if we need to export some largefile flags. +if test "$enable_largefile" != no; then + if test "$ac_cv_sys_file_offset_bits" != 'no'; then + if test -z "$LFS_CFLAGS" ; then + LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" + else + LFS_CFLAGS="$LFS_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" + fi + fi + if test "$ac_cv_sys_large_files" != 'no'; then + if test -z "$LFS_CFLAGS" ; then + LFS_CFLAGS="-D_LARGE_FILES=1" + else + LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES=1" + fi + fi + if test "$ac_cv_sys_largefile_source" != 'no'; then + if test -z "$LFS_CFLAGS" ; then + LFS_CFLAGS="-D_LARGEFILE_SOURCE=1" + else + LFS_CFLAGS="$LFS_CFLAGS -D_LARGEFILE_SOURCE=1" + fi + fi +fi + +# export largefile flags. +AC_SUBST(LFS_CFLAGS) + +# check for zlib library. +AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([*** zlib.h is required, install zlib header files])]) +AC_CHECK_LIB([z], [inflateEnd], [], [AC_MSG_ERROR([*** inflateEnd is required, install zlib library files])]) + +# check for bzlib2 library. +AC_CHECK_HEADER([bzlib.h], [], [AC_MSG_ERROR([*** bzlib.h is required, install bzip2 header files])]) +AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [], [AC_MSG_ERROR([*** BZ2_bzDecompressInit is required, install bzip2 library files])]) + +# When we're running gcc 4 or greater, compile with -fvisibility=hidden. +AC_TRY_COMPILE([ +#if !defined(__GNUC__) || (__GNUC__ < 4) +#error not gcc4 +#endif +], [], [CFLAGS="$CFLAGS -fvisibility=hidden"]) + +# find python for binding +AM_PATH_PYTHON([2.4],,[:]) +AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) + +# configuration files. +AC_CONFIG_FILES([libmpq.pc]) +AC_CONFIG_FILES([libmpq-config],[chmod +x libmpq-config]) + +# creating files. +AC_OUTPUT([ +Makefile +libmpq/Makefile +bindings/Makefile +bindings/d/Makefile +bindings/python/Makefile +doc/Makefile +doc/man1/Makefile +doc/man3/Makefile +tools/Makefile +]) diff --git a/externals/libmpq/debian/changelog b/externals/libmpq/debian/changelog new file mode 100644 index 00000000000..55d2d918755 --- /dev/null +++ b/externals/libmpq/debian/changelog @@ -0,0 +1,35 @@ +libmpq (0.4.2-svn288-1) unstable; urgency=low + + [ babyface ] + * Due to the nature of MPQ archives which can have valid block entries + * removed function libmpq__init() and libmpq__shutdown(), because they + are no longer required and libmpq__file_name(), because it is up to + the application to provide listfile support + * updated documentation to latest API changes + * removed API documentation for removed function prototypes + * removed no longer required files from target + + [ forrestv ] + * mpq.py fix + * spelling - huffmann to huffman + * changed pkware/pkzip to pkzip and used constants instead of numbers + in extract.c + * sanified huffman decoder a bit + * cleanup + update of mpq.py + * Added support for library finding on platforms besides Linux. + * python bindings - sequence methods on Archive, example code + + [ georg ] + * libmpq: file number search now continued over hashtable end + * debian debug package + + -- Georg Lukas Fri, 22 May 2009 22:38:26 +0200 + +libmpq (0.4.2-svn270-1) unstable; urgency=low + + * First debian package + * compatible to new libmpq API (post 0.4.2) + * contains preliminary python-mpq package + + -- Georg Lukas Tue, 07 Oct 2008 14:38:58 +0200 + diff --git a/externals/libmpq/debian/compat b/externals/libmpq/debian/compat new file mode 100644 index 00000000000..7f8f011eb73 --- /dev/null +++ b/externals/libmpq/debian/compat @@ -0,0 +1 @@ +7 diff --git a/externals/libmpq/debian/control b/externals/libmpq/debian/control new file mode 100644 index 00000000000..f35bb060015 --- /dev/null +++ b/externals/libmpq/debian/control @@ -0,0 +1,50 @@ +Source: libmpq +Priority: extra +Maintainer: Georg Lukas +Build-Depends: debhelper (>= 7), autotools-dev, libbz2-dev +Standards-Version: 3.7.3 +Section: libs +Homepage: https://libmpq.org/ + +Package: libmpq-dev +Section: libdevel +Architecture: any +Depends: libmpq0 (= ${binary:Version}) +Description: Headers for libmpq, a library for MoPaQ mpq archives + libmpq is a library for extracting and manipulating MoPaQ mpq archives. + This package provides header files and bindings for applications using + the libmpq library for the following languages: + * C + * Python + * D + +Package: libmpq0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: A library for extracting and manipulating MoPaQ mpq archives + MPQ, or MoPaQ, is a proprietary archive format created by + Mike O'Brien, the man hailed as Blizzard's multiplayer engine + genius, back in 1996 as a general purpose archive for use with + Diablo, and named narcissistically for its creator + "Mike O'brien PaCK". The copyrights to it, however, are held by + Havas Interactive, Blizzard's parent company. The archive format + is used by many Blizzard titles like Diablo, Diablo 2, Starcraft, + Warcraft 2: BNE, a newer version in Warcraft 3 and World of + Warcraft (WoW). + +Package: libmpq0-dbg +Section: libdevel +Architecture: any +Depends: libmpq0 (= ${binary:Version}) +Description: Debug symbols for libmpq0 library package + +Package: python-mpq +Architecture: all +Depends: ${python:Depends} +XB-Python-Version: ${python:Versions} +XS-Python-Version: current +Description: Python bindings for libmpq, a library for MoPaQ mpq archives + libmpq is a library for extracting and manipulating MoPaQ mpq archives. + This package provides the python bindings for libmpq. + diff --git a/externals/libmpq/debian/copyright b/externals/libmpq/debian/copyright new file mode 100644 index 00000000000..f014cf14de7 --- /dev/null +++ b/externals/libmpq/debian/copyright @@ -0,0 +1,23 @@ +This package was debianized by Georg Lukas on +Fri, 04 Jul 2008 18:17:08 +0200. + +It was downloaded from + +Upstream Author: + + Maik Broemme + +Copyright: + + Copyright (C) 2008 Maik Broemme + +License: + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + +The Debian packaging is (C) 2008, Georg Lukas and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. diff --git a/externals/libmpq/debian/libmpq-dev.dirs b/externals/libmpq/debian/libmpq-dev.dirs new file mode 100644 index 00000000000..7b6c7ee6ec1 --- /dev/null +++ b/externals/libmpq/debian/libmpq-dev.dirs @@ -0,0 +1,6 @@ +usr/bin +usr/lib +usr/lib/pkgconfig +usr/include +usr/share/man/man1 +usr/share/man/man3 diff --git a/externals/libmpq/debian/libmpq-dev.install b/externals/libmpq/debian/libmpq-dev.install new file mode 100644 index 00000000000..4e6ab3278e3 --- /dev/null +++ b/externals/libmpq/debian/libmpq-dev.install @@ -0,0 +1,6 @@ +usr/bin/* +usr/include/* +usr/lib/lib*.a +usr/lib/pkgconfig/* +usr/lib/*.la +usr/share/man/man?/* diff --git a/externals/libmpq/debian/libmpq0.dirs b/externals/libmpq/debian/libmpq0.dirs new file mode 100644 index 00000000000..68457717bd8 --- /dev/null +++ b/externals/libmpq/debian/libmpq0.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/externals/libmpq/debian/libmpq0.docs b/externals/libmpq/debian/libmpq0.docs new file mode 100644 index 00000000000..5ac7060850c --- /dev/null +++ b/externals/libmpq/debian/libmpq0.docs @@ -0,0 +1,6 @@ +FAQ +NEWS +README +TODO +THANKS +AUTHORS diff --git a/externals/libmpq/debian/libmpq0.install b/externals/libmpq/debian/libmpq0.install new file mode 100644 index 00000000000..8aa4466a68e --- /dev/null +++ b/externals/libmpq/debian/libmpq0.install @@ -0,0 +1 @@ +usr/lib/lib*.so* diff --git a/externals/libmpq/debian/python-mpq.install b/externals/libmpq/debian/python-mpq.install new file mode 100644 index 00000000000..a7aba2013b0 --- /dev/null +++ b/externals/libmpq/debian/python-mpq.install @@ -0,0 +1 @@ +usr/lib/python?.? diff --git a/externals/libmpq/debian/rules b/externals/libmpq/debian/rules new file mode 100644 index 00000000000..5d11fe010db --- /dev/null +++ b/externals/libmpq/debian/rules @@ -0,0 +1,112 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +else +CROSS= --build $(DEB_BUILD_GNU_TYPE) +endif + + + + +# shared library versions, option 1 +version=2.0.5 +major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +#version=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +#major=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +config.status: configure + dh_testdir + # Add here commands to configure the package. +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" + + +build: build-stamp +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + rm -f config.sub config.guess + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + + +# Build architecture-independent files here. +binary-indep: build install + dh_pysupport usr/lib/python?.?/site-packages + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip --dbg-package=libmpq0-dbg + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/externals/libmpq/delme b/externals/libmpq/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/externals/libmpq/doc/Makefile.am b/externals/libmpq/doc/Makefile.am new file mode 100644 index 00000000000..e7ccd5f4518 --- /dev/null +++ b/externals/libmpq/doc/Makefile.am @@ -0,0 +1,5 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# any directories which should be built and installed. +SUBDIRS = man1 man3 diff --git a/externals/libmpq/doc/man1/Makefile.am b/externals/libmpq/doc/man1/Makefile.am new file mode 100644 index 00000000000..055f1aab533 --- /dev/null +++ b/externals/libmpq/doc/man1/Makefile.am @@ -0,0 +1,9 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# manual page directory. +EXTRA_DIST = $(man_MANS) + +# manual pages for the installed binaries. +man_MANS = \ + libmpq-config.1 diff --git a/externals/libmpq/doc/man1/libmpq-config.1 b/externals/libmpq/doc/man1/libmpq-config.1 new file mode 100644 index 00000000000..c025f5ce4f4 --- /dev/null +++ b/externals/libmpq/doc/man1/libmpq-config.1 @@ -0,0 +1,69 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 1 2008-02-10 "The MoPaQ archive library" +.SH NAME +libmpq-config \- script to get information about the installed version of libmpq. +.SH SYNOPSIS +.B libmpq-config +[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] +.br +[\-\-cflags] [\-\-libs] [\-\-static\-libs] +.SH DESCRIPTION +.PP +\fIlibmpq-config\fP is a tool that is used to determine the compiler and linker flags that should be used to compile and link programs that use \fIlibmpq\fP. Finally, it's also used internally by the .m4 macros for GNU autoconf that are included with \fIlibmpq\fP. +.SH OPTIONS +\fIlibmpq-config\fP accepts the following options: +.TP 8 +.B \-\-version +.ti 15 +Print the currently installed version of \fIlibmpq\fP on the standard output. +.TP 8 +.B \-\-libs +.ti 15 +Print the linker flags that are necessary to link \fIlibmpq\fP to a program. +.TP 8 +.B \-\-static\-libs +.ti 15 +Print the linker flags that are necessary to statically link \fIlibmpq\fP to a program. +.TP 8 +.B \-\-cflags +.ti 15 +Print the compiler flags that are necessary to compile a program that use \fIlibmpq\fP. +.TP 8 +.B \-\-prefix=PREFIX +.ti 15 +If specified, use PREFIX instead of the installation prefix that \fIlibmpq\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option is also used for the exec prefix if \-\-exec\-prefix was not specified. This option must be specified before any \-\-libs or \-\-cflags options. +.TP 8 +.B \-\-exec\-prefix=PREFIX +.ti 15 +If specified, use PREFIX instead of the installation exec prefix that \fIlibmpq\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. +.SH NOTE +Instead of using this configuration script you should better use the pkg-config version because this would be more platform independent and makes the usage within GNU autoconf much easier. +.SH SEE ALSO +\fBlibmpq\fR(3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/Makefile.am b/externals/libmpq/doc/man3/Makefile.am new file mode 100644 index 00000000000..80bff4e7461 --- /dev/null +++ b/externals/libmpq/doc/man3/Makefile.am @@ -0,0 +1,30 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# manual page directory. +EXTRA_DIST = $(man_MANS) + +# manual pages for the installed binaries. +man_MANS = \ + libmpq.3 \ + libmpq__archive_close.3 \ + libmpq__archive_files.3 \ + libmpq__archive_offset.3 \ + libmpq__archive_open.3 \ + libmpq__archive_packed_size.3 \ + libmpq__archive_unpacked_size.3 \ + libmpq__archive_version.3 \ + libmpq__block_close_offset.3 \ + libmpq__block_open_offset.3 \ + libmpq__block_read.3 \ + libmpq__block_unpacked_size.3 \ + libmpq__file_blocks.3 \ + libmpq__file_compressed.3 \ + libmpq__file_encrypted.3 \ + libmpq__file_imploded.3 \ + libmpq__file_number.3 \ + libmpq__file_offset.3 \ + libmpq__file_packed_size.3 \ + libmpq__file_read.3 \ + libmpq__file_unpacked_size.3 \ + libmpq__version.3 diff --git a/externals/libmpq/doc/man3/libmpq.3 b/externals/libmpq/doc/man3/libmpq.3 new file mode 100644 index 00000000000..349451f87b1 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq.3 @@ -0,0 +1,204 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-04-29 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "const char *libmpq__version();" +.sp +.BI "int32_t libmpq__archive_open(" +.BI " mpq_archive_s **" "mpq_archive", +.BI " const char *" "mpq_filename", +.BI " off_t " "archive_offset" +.BI ");" +.sp +.BI "int32_t libmpq__archive_close(" +.BI " mpq_archive_s *" "mpq_archive" +.BI ");" +.sp +.BI "int32_t libmpq__archive_packed_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " off_t *" "packed_size" +.BI ");" +.sp +.BI "int32_t libmpq__archive_unpacked_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " off_t *" "unpacked_size" +.BI ");" +.sp +.BI "int32_t libmpq__archive_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " off_t *" "offset" +.BI ");" +.sp +.BI "int32_t libmpq__archive_version(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t *" "version" +.BI ");" +.sp +.BI "int32_t libmpq__archive_files(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t *" "files" +.BI ");" +.sp +.BI "int32_t libmpq__file_packed_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "packed_size" +.BI ");" +.sp +.BI "int32_t libmpq__file_unpacked_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "unpacked_size" +.BI ");" +.sp +.BI "int32_t libmpq__file_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "offset" +.BI ");" +.sp +.BI "int32_t libmpq__file_blocks(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "blocks" +.BI ");" +.sp +.BI "int32_t libmpq__file_encrypted(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "encrypted" +.BI ");" +.sp +.BI "int32_t libmpq__file_compressed(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "compressed" +.BI ");" +.sp +.BI "int32_t libmpq__file_imploded(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "imploded" +.BI ");" +.sp +.BI "int32_t libmpq__file_number(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " const char *" "filename", +.BI " uint32_t *" "number" +.BI ");" +.sp +.BI "int32_t libmpq__file_read(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint8_t *" "out_buf", +.BI " off_t " "out_size", +.BI " off_t *" "transferred" +.BI ");" +.sp +.BI "int32_t libmpq__block_open_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number" +.BI ");" +.sp +.BI "int32_t libmpq__block_close_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number" +.BI ");" +.sp +.BI "int32_t libmpq__block_packed_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number", +.BI " off_t *" "packed_size" +.BI ");" +.sp +.BI "int32_t libmpq__block_unpacked_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number", +.BI " off_t *" "unpacked_size" +.BI ");" +.sp +.BI "int32_t libmpq__block_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number", +.BI " off_t *" "offset" +.BI ");" +.sp +.BI "int32_t libmpq__block_seed(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number", +.BI " uint32_t *" "seed" +.BI ");" +.sp +.BI "int32_t libmpq__block_read(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number", +.BI " uint8_t *" "out_buf", +.BI " off_t " "out_size", +.BI " off_t *" "transferred" +.BI ");" +.fi +.SH DESCRIPTION +.PP +The \fIlibmpq\fP library supports decrypting, decompressing, exploding and various manipulations of the MoPaQ archive files. It uses \fIzlib(3)\fP and \fIbzip2(1)\fP compression library. At this moment \fIlibmpq\fP is not able to create MoPaQ archives, this limitation will be removed in a future version. +.SH SEE ALSO +.BR libmpq__version (3), +.BR libmpq__archive_open (3), +.BR libmpq__archive_close (3), +.BR libmpq__archive_packed_size (3), +.BR libmpq__archive_unpacked_size (3), +.BR libmpq__archive_offset (3), +.BR libmpq__archive_version (3), +.BR libmpq__archive_files (3), +.BR libmpq__file_packed_size (3), +.BR libmpq__file_unpacked_size (3), +.BR libmpq__file_offset (3), +.BR libmpq__file_blocks (3), +.BR libmpq__file_encrypted (3), +.BR libmpq__file_compressed (3), +.BR libmpq__file_imploded (3), +.BR libmpq__file_number (3), +.BR libmpq__file_read (3), +.BR libmpq__block_open_offset (3), +.BR libmpq__block_close_offset (3), +.BR libmpq__block_packed_size (3), +.BR libmpq__block_unpacked_size (3), +.BR libmpq__block_offset (3), +.BR libmpq__block_seed (3), +.BR libmpq__block_read (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_close.3 b/externals/libmpq/doc/man3/libmpq__archive_close.3 new file mode 100644 index 00000000000..dfc652a6721 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_close.3 @@ -0,0 +1,57 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-04-29 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_close(" +.BI " mpq_archive_s *" "mpq_archive" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_close\fP() to close a mpq archive which was opened by \fBlibmpq__archive_open\fP(). The function frees the archive structure itself and the contents of it. +.LP +The \fBlibmpq__archive_close\fP() function one takes one argument of the archive structure \fImpq_archive\fP which has to be set by \fBlibmpq__archive_open\fP. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_CLOSE +The given file could not be closed. +.SH SEE ALSO +.BR libmpq__archive_open (3), +.BR libmpq__archive_packed_size (3), +.BR libmpq__archive_unpacked_size (3), +.BR libmpq__archive_offset (3), +.BR libmpq__archive_version (3), +.BR libmpq__archive_files (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_files.3 b/externals/libmpq/doc/man3/libmpq__archive_files.3 new file mode 100644 index 00000000000..6663b99161a --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_files.3 @@ -0,0 +1,50 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-14 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_files(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t *" "files" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_files\fP() to get the number of files inside the archive. It will count only valid files and skip files which have deleted or freed hash entries. +.LP +The \fBlibmpq__archive_files\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the number of \fIfiles\fP in the archive. +.SH RETURN VALUE +On success, a zero is returned. +.SH SEE ALSO +.BR libmpq__file_blocks (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_offset.3 b/externals/libmpq/doc/man3/libmpq__archive_offset.3 new file mode 100644 index 00000000000..696ac5e809f --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_offset.3 @@ -0,0 +1,51 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-14 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " off_t *" "offset" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_offset\fP() to get the offset of the archive, which is the absolute position in the file. It also supports archives within archives. +.LP +The \fBlibmpq__archive_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the archive starting position \fIoffset\fP in file. +.SH RETURN VALUE +On success, a zero is returned. +.SH SEE ALSO +.BR libmpq__file_offset (3), +.BR libmpq__block_offset (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_open.3 b/externals/libmpq/doc/man3/libmpq__archive_open.3 new file mode 100644 index 00000000000..02c021f8948 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_open.3 @@ -0,0 +1,71 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-04-29 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_open(" +.BI " mpq_archive_s **" "mpq_archive", +.BI " const char *" "mpq_filename", +.BI " off_t " "archive_offset" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_open\fP() to open a given mpq archive for later use to extract or manipulate files inside the archive. It will create all required file structures and you have to call \fBlibmpq__archive_close\fP() on success to clean the opened structures. On failure there is no need to call \fBlibmpq__archive_close\fP() because everything will be cleaned up. +.LP +The \fBlibmpq__archive_open\fP() function takes as first argument a reference to the archive structure \fImpq_archive\fP and will open the file \fImpq_filename\fP to the structure pointed to by \fImpq_archive\fP. The last argument, \fIarchive_offset\fP is normally -1, but can be specified when the archive offset is known, or not 512-byte aligned. +.SH RETURN VALUE +On success, *\fImpq_archive\fP is set to a new \fBmpq_archive_s\fP* and zero is returned, and on error one of the following constants is returned. +.TP +.B LIBMPQ_ERROR_OPEN +The given file could not be opened. +.TP +.B LIBMPQ_ERROR_MALLOC +Not enough memory for creating required structures. +.TP +.B LIBMPQ_ERROR_SEEK +Seeking in file failed. +.TP +.B LIBMPQ_ERROR_FORMAT +The given file is no valid mpq archive. +.TP +.B LIBMPQ_ERROR_READ +Reading in archive failed. +.SH SEE ALSO +.BR libmpq__archive_close (3), +.BR libmpq__archive_packed_size (3), +.BR libmpq__archive_unpacked_size (3), +.BR libmpq__archive_offset (3), +.BR libmpq__archive_version (3), +.BR libmpq__archive_files (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_packed_size.3 b/externals/libmpq/doc/man3/libmpq__archive_packed_size.3 new file mode 100644 index 00000000000..6c3061f2031 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_packed_size.3 @@ -0,0 +1,51 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-04-29 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_packed_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " off_t *" "packed_size" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_packed_size\fP() to get the packed size of all files in the archive. It will count compressed and imploded files as well as stored only. +.LP +The \fBlibmpq__archive_packed_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the compressed, imploded or stored size \fIpacked_size\fP of file. +.SH RETURN VALUE +On success, a zero is returned. +.SH SEE ALSO +.BR libmpq__file_packed_size (3), +.BR libmpq__block_packed_size (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_unpacked_size.3 b/externals/libmpq/doc/man3/libmpq__archive_unpacked_size.3 new file mode 100644 index 00000000000..d2ba923c8f0 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_unpacked_size.3 @@ -0,0 +1,51 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-04-29 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_unpacked_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " off_t *" "unpacked_size" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_unpacked_size\fP() to get the unpacked size of all files in the archive. It will count uncompressed and exploded files as well as stored only. +.LP +The \fBlibmpq__archive_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of file. +.SH RETURN VALUE +On success, a zero is returned. +.SH SEE ALSO +.BR libmpq__file_unpacked_size (3), +.BR libmpq__block_unpacked_size (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__archive_version.3 b/externals/libmpq/doc/man3/libmpq__archive_version.3 new file mode 100644 index 00000000000..1764046895a --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__archive_version.3 @@ -0,0 +1,48 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-14 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__archive_version(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t *" "version" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__archive_version\fP() to get the archive version. Currently there exist two known versions, version 1 which supports archives until 2GB total size and version 2 which supports archives above 2GB total size and both are supported. +.LP +The \fBlibmpq__archive_version\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the \fIversion\fP of archive. +.SH RETURN VALUE +On success, a zero is returned. +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__block_close_offset.3 b/externals/libmpq/doc/man3/libmpq__block_close_offset.3 new file mode 100644 index 00000000000..1ec0c06f70d --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__block_close_offset.3 @@ -0,0 +1,53 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__block_close_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__block_close_offset\fP() to close the block offset table for the given file. It will close the block offset table regardless of compression (compressed, imploded or stored) type of file. +.LP +The \fBlibmpq__block_close_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file to close. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File or block does not exist in archive. +.SH SEE ALSO +.BR libmpq__block_open_offset (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__block_open_offset.3 b/externals/libmpq/doc/man3/libmpq__block_open_offset.3 new file mode 100644 index 00000000000..a60b133f406 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__block_open_offset.3 @@ -0,0 +1,65 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__block_open_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__block_open_offset\fP() to open the block offset table for the given file. It will open the block offset table regardless of compression (compressed, imploded or stored) type of file. +.LP +The \fBlibmpq__block_open_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file to open. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File or block does not exist in archive. +.TP +.B LIBMPQ_ERROR_SEEK +Seeking in file failed. +.TP +.B LIBMPQ_ERROR_MALLOC +Not enough memory for creating required structures. +.TP +.B LIBMPQ_ERROR_READ +Reading in archive failed. +.TP +.B LIBMPQ_ERROR_DECRYPT +Decrypting block failed. +.SH SEE ALSO +.BR libmpq__block_close_offset (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__block_read.3 b/externals/libmpq/doc/man3/libmpq__block_read.3 new file mode 100644 index 00000000000..3272c64c7ed --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__block_read.3 @@ -0,0 +1,78 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__block_read(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number, +.BI " uint8_t *" "out_buf", +.BI " off_t " "out_size", +.BI " off_t " "transferred" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__block_read\fP() to read a given block into memory. If the block is encrypted it will be first decrypted and then if it is packed (compressed or imploded) it will be unpacked. +.LP +The \fBlibmpq__block_read\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file, the third argument \fIblock_number\fP is the number of block. The fourth argument \fIout_buf\fP is the output data buffer which contains the extracted data and the fifth argument \fIout_size\fP is the size of \fIout_buf\fP. The sixth argument is a reference to the \fItransferred\fP bytes of the file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +Block does not exist in archive. +.TP +.B LIBMPQ_ERROR_OPEN +Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call. +.TP +.B LIBMPQ_ERROR_SIZE +The output buffer is to small. +.TP +.B LIBMPQ_ERROR_SEEK +Seeking in file failed. +.TP +.B LIBMPQ_ERROR_MALLOC +Not enough memory for creating required structures. +.TP +.B LIBMPQ_ERROR_READ +Reading in archive failed. +.TP +.B LIBMPQ_ERROR_DECRYPT +Decrypting block failed. +.TP +.B LIBMPQ_ERROR_UNPACK +Unpacking block failed. +.SH SEE ALSO +.BR libmpq__file_read (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__block_unpacked_size.3 b/externals/libmpq/doc/man3/libmpq__block_unpacked_size.3 new file mode 100644 index 00000000000..a21ca48159a --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__block_unpacked_size.3 @@ -0,0 +1,59 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__block_unpacked_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t " "block_number", +.BI " off_t *" "unpacked_size" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__block_unpacked_size\fP() to get the unpacked size of a given block in the file. It will return a valid size for compressed and imploded blocks as well as stored only. +.LP +The \fBlibmpq__block_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file, the third argument \fIblock_number\fP is the number of block and the fourth argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of block. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File or block does not exist in archive. +.TP +.B LIBMPQ_ERROR_OPEN +Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call. +.SH SEE ALSO +.BR libmpq__archive_unpacked_size (3), +.BR libmpq__file_unpacked_size (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_blocks.3 b/externals/libmpq/doc/man3/libmpq__file_blocks.3 new file mode 100644 index 00000000000..85baeffc603 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_blocks.3 @@ -0,0 +1,54 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_blocks(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t *" "blocks" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_blocks\fP() to get the number of blocks for a given file. It will count all blocks for files stored in multiple sectors or count one for files stored in single sector. +.LP +The \fBlibmpq__file_blocks\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the number of \fIblocks\fP of the file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_files (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_compressed.3 b/externals/libmpq/doc/man3/libmpq__file_compressed.3 new file mode 100644 index 00000000000..24b44f0b666 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_compressed.3 @@ -0,0 +1,54 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_compressed(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t *" "compressed" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_compressed\fP() to get the compression status of the given file. It will return true for compressed files and false otherwise. +.LP +The \fBlibmpq__file_compressed\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the compression status \fIcompressed\fP of the file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_files (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_encrypted.3 b/externals/libmpq/doc/man3/libmpq__file_encrypted.3 new file mode 100644 index 00000000000..798f4019c7a --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_encrypted.3 @@ -0,0 +1,54 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_encrypted(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t *" "encrypted" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_encrypted\fP() to get the encryption status of the given file. It will return true for encrypted files and false otherwise. +.LP +The \fBlibmpq__file_encrypted\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the encryption status \fIencrypted\fP of the file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_files (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_imploded.3 b/externals/libmpq/doc/man3/libmpq__file_imploded.3 new file mode 100644 index 00000000000..9adce38cb5f --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_imploded.3 @@ -0,0 +1,54 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_imploded(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint32_t *" "imploded" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_imploded\fP() to get the implosion status of the given file. It will return true for imploded files and false otherwise. +.LP +The \fBlibmpq__file_imploded\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the implosion status \fIimploded\fP of the file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_files (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_number.3 b/externals/libmpq/doc/man3/libmpq__file_number.3 new file mode 100644 index 00000000000..8d7a47769ee --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_number.3 @@ -0,0 +1,52 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_number(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " const char *" "filename", +.BI " uint32_t *" "number" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_number\fP() to get the number of a given file in the archive. This function will return a file number regardless of a known or opened listfile. +.LP +The \fBlibmpq__file_number\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfilename\fP is the name of the file and the third argument is a reference to the \fInumber\fP of the file. +.SH RETURN VALUE +On success, the number of the file is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_offset.3 b/externals/libmpq/doc/man3/libmpq__file_offset.3 new file mode 100644 index 00000000000..392a66d0b04 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_offset.3 @@ -0,0 +1,55 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-15 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_offset(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "offset" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_offset\fP() to get the offset of the file, which is the absolute position in the archive. It also supports archives within archives. +.LP +The \fBlibmpq__file_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the file starting position \fIoffset\fP in archive. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_offset (3), +.BR libmpq__block_offset (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_packed_size.3 b/externals/libmpq/doc/man3/libmpq__file_packed_size.3 new file mode 100644 index 00000000000..b584ddf77dd --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_packed_size.3 @@ -0,0 +1,55 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-15 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_packed_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "packed_size" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_packed_size\fP() to get the packed size of a given file in the archive. It will return a valid size for compressed and imploded files as well as stored only. +.LP +The \fBlibmpq__file_packed_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the compressed, imploded or stored size \fIpacked_size\fP of file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_packed_size (3), +.BR libmpq__block_packed_size (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_read.3 b/externals/libmpq/doc/man3/libmpq__file_read.3 new file mode 100644 index 00000000000..cbfafbd0f4f --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_read.3 @@ -0,0 +1,77 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-16 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_read(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " uint8_t *" "out_buf", +.BI " off_t " "out_size", +.BI " off_t *" "transferred" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_read\fP() to read a given file into memory. If the file is encrypted it will be first decrypted and then if it is packed (compressed or imploded) it will be unpacked. +.LP +The \fBlibmpq__file_read\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the file to extract, the third argument \fIout_buf\fP is the output data buffer which contains the extracted data. The fourth argument \fIout_size\fP is the size of \fIout_buf\fP and the fifth argument is a reference to the \fItransferred\fP bytes of the file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.TP +.B LIBMPQ_ERROR_OPEN +Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call. +.TP +.B LIBMPQ_ERROR_SIZE +The output buffer is to small. +.TP +.B LIBMPQ_ERROR_SEEK +Seeking in file failed. +.TP +.B LIBMPQ_ERROR_MALLOC +Not enough memory for creating required structures. +.TP +.B LIBMPQ_ERROR_READ +Reading in archive failed. +.TP +.B LIBMPQ_ERROR_DECRYPT +Decrypting file failed. +.TP +.B LIBMPQ_ERROR_UNPACK +Unpacking file failed. +.SH SEE ALSO +.BR libmpq__block_read (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__file_unpacked_size.3 b/externals/libmpq/doc/man3/libmpq__file_unpacked_size.3 new file mode 100644 index 00000000000..a81cf7a4e76 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__file_unpacked_size.3 @@ -0,0 +1,55 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-05-15 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "int32_t libmpq__file_unpacked_size(" +.BI " mpq_archive_s *" "mpq_archive", +.BI " uint32_t " "file_number", +.BI " off_t *" "unpacked_size" +.BI ");" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__file_unpacked_size\fP() to get the unpacked size of a given file in the archive. It will return a valid size for compressed and imploded files as well as stored only. +.LP +The \fBlibmpq__file_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of file. +.SH RETURN VALUE +On success, a zero is returned and on error one of the following constants. +.TP +.B LIBMPQ_ERROR_EXIST +File does not exist in archive. +.SH SEE ALSO +.BR libmpq__archive_unpacked_size (3), +.BR libmpq__block_unpacked_size (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/doc/man3/libmpq__version.3 b/externals/libmpq/doc/man3/libmpq__version.3 new file mode 100644 index 00000000000..5500d7314f5 --- /dev/null +++ b/externals/libmpq/doc/man3/libmpq__version.3 @@ -0,0 +1,45 @@ +.\" Copyright (c) 2003-2008 Maik Broemme +.\" +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.TH libmpq 3 2008-03-31 "The MoPaQ archive library" +.SH NAME +libmpq \- cross-platform C library for manipulating mpq archives. +.SH SYNOPSIS +.nf +.B +#include +.sp +.BI "const char *libmpq__version();" +.fi +.SH DESCRIPTION +.PP +Call \fBlibmpq__version\fP() to get information about the version of the library, it is useful to create minimum required version verifications. +.SH RETURN VALUE +The function returns the library version. +.SH SEE ALSO +.BR libmpq (3) +.SH AUTHOR +Check documentation. +.TP +libmpq is (c) 2003-2008 +.B Maik Broemme +.PP +The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/externals/libmpq/libmpq-config.in b/externals/libmpq/libmpq-config.in new file mode 100644 index 00000000000..d345efdbe09 --- /dev/null +++ b/externals/libmpq/libmpq-config.in @@ -0,0 +1,57 @@ +#!/bin/sh + +prefix="@prefix@" +exec_prefix="@exec_prefix@" +exec_prefix_set=no + +usage="\ +Usage: libmpq-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" + +if test "$#" -eq "0"; then + echo "${usage}" 1>&2 + exit 1 +fi + +while test "$#" -gt "0"; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + --prefix=*) + prefix="$optarg" + if test "$exec_prefix_set" = "no" ; then + exec_prefix="$optarg" + fi + ;; + --prefix) + echo "$prefix" + ;; + --exec-prefix=*) + exec_prefix="$optarg" + exec_prefix_set=yes + ;; + --exec-prefix) + echo "$exec_prefix" + ;; + --version) + echo "@VERSION@" + ;; + --cflags) + largefile="@LFS_CFLAGS@" + includes=-I@includedir@/libmpq + echo "$includes $largefile" + ;; + --libs) + libdirs="-L@libdir@" + echo "$libdirs -lmpq" + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done + diff --git a/externals/libmpq/libmpq.pc.in b/externals/libmpq/libmpq.pc.in new file mode 100644 index 00000000000..8c53bea35a0 --- /dev/null +++ b/externals/libmpq/libmpq.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmpq +Description: GPL version of the libmpq library +Version: @VERSION@ +Libs: -L${libdir} -lmpq +Cflags: -I${includedir}/libmpq @LFS_CFLAGS@ diff --git a/externals/libmpq/libmpq/Makefile.am b/externals/libmpq/libmpq/Makefile.am new file mode 100644 index 00000000000..409e3dfe02f --- /dev/null +++ b/externals/libmpq/libmpq/Makefile.am @@ -0,0 +1,23 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# library information and headers which should not be installed. +lib_LTLIBRARIES = libmpq.la +noinst_HEADERS = common.h explode.h extract.h huffman.h mpq-internal.h wave.h + +# directory where the include files will be installed. +libmpq_includedir = $(includedir)/libmpq + +# header files to install. +libmpq_include_HEADERS = mpq.h + +libmpq_la_SOURCES = $(GENERAL_SRCS) +libmpq_la_LDFLAGS = -release $(PACKAGE_VERSION) + +GENERAL_SRCS = \ + common.c \ + huffman.c \ + extract.c \ + explode.c \ + mpq.c \ + wave.c diff --git a/dep/src/libmpq/common.c b/externals/libmpq/libmpq/common.c similarity index 99% rename from dep/src/libmpq/common.c rename to externals/libmpq/libmpq/common.c index 91b259f5515..c17e4035dcc 100644 --- a/dep/src/libmpq/common.c +++ b/externals/libmpq/libmpq/common.c @@ -23,9 +23,6 @@ #include #include #include -#if HAVE_UNISTD_H - #include -#endif /* libmpq main includes. */ #include "mpq.h" diff --git a/dep/include/libmpq/common.h b/externals/libmpq/libmpq/common.h similarity index 100% rename from dep/include/libmpq/common.h rename to externals/libmpq/libmpq/common.h diff --git a/dep/include/libmpq/crypt_buf.h b/externals/libmpq/libmpq/crypt_buf.h similarity index 100% rename from dep/include/libmpq/crypt_buf.h rename to externals/libmpq/libmpq/crypt_buf.h diff --git a/dep/src/libmpq/explode.c b/externals/libmpq/libmpq/explode.c similarity index 100% rename from dep/src/libmpq/explode.c rename to externals/libmpq/libmpq/explode.c diff --git a/dep/include/libmpq/explode.h b/externals/libmpq/libmpq/explode.h similarity index 96% rename from dep/include/libmpq/explode.h rename to externals/libmpq/libmpq/explode.h index 84bbde77bee..1d14dfc0e0a 100644 --- a/dep/include/libmpq/explode.h +++ b/externals/libmpq/libmpq/explode.h @@ -36,10 +36,7 @@ #define LIBMPQ_PKZIP_CMP_BAD_DATA 3 #define LIBMPQ_PKZIP_CMP_ABORT 4 -#ifdef _MSC_VER -#pragma pack(push,1) -#endif - +#include "pack_begin.h" /* compression structure. */ typedef struct { uint32_t offs0000; /* 0000 - start. */ @@ -68,12 +65,8 @@ typedef struct { uint8_t slen_bits[0x10]; /* 30F4 - numbers of bits for skip copied block length. */ uint8_t clen_bits[0x10]; /* 3104 - number of valid bits for copied block. */ uint16_t len_base[0x10]; /* 3114 - buffer. */ -#ifdef _MSC_VER -} pkzip_cmp_s; -#pragma pack(pop) -#else -} __attribute__ ((packed)) pkzip_cmp_s; -#endif +} PACK_STRUCT pkzip_cmp_s; +#include "pack_end.h" /* data structure. */ typedef struct { diff --git a/dep/src/libmpq/extract.c b/externals/libmpq/libmpq/extract.c similarity index 100% rename from dep/src/libmpq/extract.c rename to externals/libmpq/libmpq/extract.c diff --git a/dep/include/libmpq/extract.h b/externals/libmpq/libmpq/extract.h similarity index 100% rename from dep/include/libmpq/extract.h rename to externals/libmpq/libmpq/extract.h diff --git a/dep/src/libmpq/huffman.c b/externals/libmpq/libmpq/huffman.c similarity index 100% rename from dep/src/libmpq/huffman.c rename to externals/libmpq/libmpq/huffman.c diff --git a/dep/include/libmpq/huffman.h b/externals/libmpq/libmpq/huffman.h similarity index 100% rename from dep/include/libmpq/huffman.h rename to externals/libmpq/libmpq/huffman.h diff --git a/dep/include/libmpq/mpq-internal.h b/externals/libmpq/libmpq/mpq-internal.h similarity index 95% rename from dep/include/libmpq/mpq-internal.h rename to externals/libmpq/libmpq/mpq-internal.h index eddcb7e89ae..76eabe4190a 100644 --- a/dep/include/libmpq/mpq-internal.h +++ b/externals/libmpq/libmpq/mpq-internal.h @@ -44,7 +44,7 @@ #define LIBMPQ_FLAG_COMPRESS_MULTI 0x00000200 /* multiple compressions. */ #define LIBMPQ_FLAG_COMPRESS_NONE 0x00000300 /* no compression (no blizzard flag used by myself). */ #define LIBMPQ_FLAG_SINGLE 0x01000000 /* file is stored in one single sector, first seen in world of warcraft. */ -#define LIBMPQ_FLAG_EXTRA 0x04000000 /* compressed block offset table has one extra entry. */ +#define LIBMPQ_FLAG_CRC 0x04000000 /* compressed block offset table has CRC checksum. */ /* define generic hash values. */ #define LIBMPQ_HASH_FREE 0xFFFFFFFF /* hash table entry is empty and has always been empty. */ @@ -62,13 +62,7 @@ #define TRUE 1 #endif -#ifdef _MSC_VER - #pragma pack(push,1) - #define PACK_STRUCT -#else - #define PACK_STRUCT __attribute__((packed)) -#endif - +#include "pack_begin.h" /* mpq archive header. */ typedef struct { uint32_t mpq_magic; /* the 0x1A51504D ('MPQ\x1A') signature. */ @@ -123,11 +117,7 @@ typedef struct { uint32_t block_table_indices; /* real mapping for file number to block entry. */ uint32_t block_table_diff; /* block table difference between valid blocks and invalid blocks before. */ } PACK_STRUCT mpq_map_s; - -#ifdef _MSC_VER - #pragma pack(pop) -#endif -#undef PACK_STRUCT +#include "pack_end.h" /* archive structure used since diablo 1.00 by blizzard. */ struct mpq_archive { diff --git a/dep/src/libmpq/mpq.c b/externals/libmpq/libmpq/mpq.c similarity index 91% rename from dep/src/libmpq/mpq.c rename to externals/libmpq/libmpq/mpq.c index 4e3d7db0b4d..83d5533109f 100644 --- a/dep/src/libmpq/mpq.c +++ b/externals/libmpq/libmpq/mpq.c @@ -33,13 +33,9 @@ #include #include #include -#if HAVE_UNISTD_H - #include -#endif -#ifdef _MSC_VER - #define fseeko _fseeki64 -#endif +/* support for platform specific things */ +#include "platform.h" /* this function returns the library version information. */ const char *libmpq__version(void) { @@ -364,15 +360,21 @@ int32_t libmpq__archive_files(mpq_archive_s *mpq_archive, uint32_t *files) { return LIBMPQ_SUCCESS; } +#define CHECK_FILE_NUM(file_number, mpq_archive) \ + if (file_number < 0 || file_number > mpq_archive->files - 1) { \ + return LIBMPQ_ERROR_EXIST; \ + } + +#define CHECK_BLOCK_NUM(block_number, mpq_archive) \ + if (block_number < 0 || block_number >= ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size)) { \ + return LIBMPQ_ERROR_EXIST; \ + } + /* this function return the packed size of the given files in the archive. */ int32_t libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *packed_size) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* get the packed size of file. */ *packed_size = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].packed_size; @@ -385,11 +387,7 @@ int32_t libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint32_t file_numbe int32_t libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *unpacked_size) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* get the unpacked size of file. */ *unpacked_size = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size; @@ -402,11 +400,7 @@ int32_t libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_num int32_t libmpq__file_offset(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *offset) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* return file offset relative to archive start. */ *offset = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].offset + (((long long)mpq_archive->mpq_block_ex[mpq_archive->mpq_map[file_number].block_table_indices].offset_high) << 32); @@ -419,11 +413,7 @@ int32_t libmpq__file_offset(mpq_archive_s *mpq_archive, uint32_t file_number, li int32_t libmpq__file_blocks(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *blocks) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* return the number of blocks for the given file. */ *blocks = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size; @@ -436,11 +426,7 @@ int32_t libmpq__file_blocks(mpq_archive_s *mpq_archive, uint32_t file_number, ui int32_t libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *encrypted) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* return the encryption status of file. */ *encrypted = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_ENCRYPTED) != 0 ? TRUE : FALSE; @@ -453,11 +439,7 @@ int32_t libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint32_t file_number, int32_t libmpq__file_compressed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *compressed) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* return the compression status of file. */ *compressed = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_COMPRESS_MULTI) != 0 ? TRUE : FALSE; @@ -470,11 +452,7 @@ int32_t libmpq__file_compressed(mpq_archive_s *mpq_archive, uint32_t file_number int32_t libmpq__file_imploded(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *imploded) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* return the implosion status of file. */ *imploded = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_COMPRESS_PKZIP) != 0 ? TRUE : FALSE; @@ -538,11 +516,7 @@ int32_t libmpq__file_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint libmpq__off_t transferred_total = 0; /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* get target size of block. */ libmpq__file_unpacked_size(mpq_archive, file_number, &unpacked_size); @@ -614,11 +588,7 @@ int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_numb int32_t result = 0; /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) if (mpq_archive->mpq_file[file_number]) { @@ -639,7 +609,7 @@ int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_numb } /* check if data has one extra entry. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_EXTRA) != 0) { + if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_CRC) != 0) { /* add one uint32_t. */ packed_size += sizeof(uint32_t); @@ -684,8 +654,11 @@ int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_numb goto error; } - /* check if the archive is protected some way, sometimes the file appears not to be encrypted, but it is. */ - if (mpq_archive->mpq_file[file_number]->packed_offset[0] != rb) { + /* check if the archive is protected some way, sometimes the file appears not to be encrypted, but it is. + * a special case are files with an additional sector but LIBMPQ_FLAG_CRC not set. we don't want to handle + * them as encrypted. */ + if (mpq_archive->mpq_file[file_number]->packed_offset[0] != rb && + mpq_archive->mpq_file[file_number]->packed_offset[0] != rb + 4) { /* file is encrypted. */ mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags |= LIBMPQ_FLAG_ENCRYPTED; @@ -762,11 +735,7 @@ error: int32_t libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint32_t file_number) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) if (mpq_archive->mpq_file[file_number] == NULL) { @@ -797,18 +766,10 @@ int32_t libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint32_t file_num int32_t libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, libmpq__off_t *unpacked_size) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* check if given block number is not out of range. */ - if (block_number < 0 || block_number >= ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size)) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_BLOCK_NUM(block_number, mpq_archive) /* check if packed block offset table is opened. */ if (mpq_archive->mpq_file[file_number] == NULL || @@ -848,18 +809,10 @@ int32_t libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_nu int32_t libmpq__block_seed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, uint32_t *seed) { /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* check if given block number is not out of range. */ - if (block_number < 0 || block_number >= ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size)) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_BLOCK_NUM(block_number, mpq_archive) /* check if packed block offset table is opened. */ if (mpq_archive->mpq_file[file_number] == NULL || @@ -891,18 +844,10 @@ int32_t libmpq__block_read(mpq_archive_s *mpq_archive, uint32_t file_number, uin libmpq__off_t unpacked_size = 0; /* check if given file number is not out of range. */ - if (file_number < 0 || file_number > mpq_archive->files - 1) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_FILE_NUM(file_number, mpq_archive) /* check if given block number is not out of range. */ - if (block_number < 0 || block_number >= ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size)) { - - /* file number is out of range. */ - return LIBMPQ_ERROR_EXIST; - } + CHECK_BLOCK_NUM(block_number, mpq_archive) /* check if packed block offset table is opened. */ if (mpq_archive->mpq_file[file_number] == NULL || diff --git a/dep/include/libmpq/mpq.h b/externals/libmpq/libmpq/mpq.h similarity index 100% rename from dep/include/libmpq/mpq.h rename to externals/libmpq/libmpq/mpq.h diff --git a/externals/libmpq/libmpq/pack_begin.h b/externals/libmpq/libmpq/pack_begin.h new file mode 100644 index 00000000000..eb4a6ddebbb --- /dev/null +++ b/externals/libmpq/libmpq/pack_begin.h @@ -0,0 +1,34 @@ +/* + * pack_begin.h -- header file for struct packing used by libmpq. + * + * Copyright (c) 2010 Georg Lukas + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _PACK_BEGIN +#define _PACK_BEGIN +#else +#error "pack_begin.h may not be included twice!" +#endif + +#ifdef _MSC_VER + #pragma pack(push,1) + #define PACK_STRUCT +#else + /* we assume GNU here */ + #define PACK_STRUCT __attribute__((packed)) +#endif + diff --git a/externals/libmpq/libmpq/pack_end.h b/externals/libmpq/libmpq/pack_end.h new file mode 100644 index 00000000000..a8a35113bfb --- /dev/null +++ b/externals/libmpq/libmpq/pack_end.h @@ -0,0 +1,31 @@ +/* + * pack_end.h -- header file for struct packing used by libmpq. + * + * Copyright (c) 2010 Georg Lukas + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef _PACK_BEGIN +#undef _PACK_BEGIN +#else +#error "pack_begin.h must be includede before pack_end.h" +#endif + +#ifdef _MSC_VER + #pragma pack(pop) +#endif + +#undef PACK_STRUCT diff --git a/externals/libmpq/libmpq/platform.h b/externals/libmpq/libmpq/platform.h new file mode 100644 index 00000000000..68fdfdc5ded --- /dev/null +++ b/externals/libmpq/libmpq/platform.h @@ -0,0 +1,28 @@ +/* + * platform.h -- header file for platform specific parts. + * + * Copyright (c) 2010 Georg Lukas + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _PLATFORM_H +#define _PLATFORM_H + +#ifdef _MSC_VER + #define fseeko _fseeki64 +#endif + +#endif /* _PLATFORM_H */ diff --git a/dep/src/libmpq/wave.c b/externals/libmpq/libmpq/wave.c similarity index 100% rename from dep/src/libmpq/wave.c rename to externals/libmpq/libmpq/wave.c diff --git a/dep/include/libmpq/wave.h b/externals/libmpq/libmpq/wave.h similarity index 100% rename from dep/include/libmpq/wave.h rename to externals/libmpq/libmpq/wave.h diff --git a/externals/libmpq/tools/Makefile.am b/externals/libmpq/tools/Makefile.am new file mode 100644 index 00000000000..607205379a4 --- /dev/null +++ b/externals/libmpq/tools/Makefile.am @@ -0,0 +1,8 @@ +# minimum required automake 1.6 +AUTOMAKE_OPTIONS = 1.6 + +# the main programs. +bin_PROGRAMS = crypt_buf_gen + +# sources for crypt_buf_gen program. +crypt_buf_gen_SOURCES = crypt_buf_gen.c diff --git a/externals/libmpq/tools/crypt_buf_gen.c b/externals/libmpq/tools/crypt_buf_gen.c new file mode 100644 index 00000000000..3d150fc661f --- /dev/null +++ b/externals/libmpq/tools/crypt_buf_gen.c @@ -0,0 +1,85 @@ +/* + * crypt_buf_gen.c -- tool to re-create the static decryption buffer. + * + * Copyright (c) 2003-2008 Maik Broemme + * Copyright (c) 2008 Georg Lukas + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * + * Usage: + * $ make crypt_buf_gen + * $ ./crypt_buf_gen > crypt_buf.h + * + */ +#include +#include +#include + +static uint32_t *buffer; + +int32_t libmpq__buffer_init() { + buffer = malloc(sizeof(uint32_t) * 0x500); + + if (!buffer) + return -1; + + /* some common variables. */ + uint32_t seed = 0x00100001; + uint32_t index1 = 0; + uint32_t index2 = 0; + uint32_t i; + + /* initialize the decryption buffer. */ + for (index1 = 0; index1 < 0x100; index1++) { + for(index2 = index1, i = 0; i < 5; i++, index2 += 0x100) { + + /* some common variables. */ + uint32_t temp1, temp2; + + /* temporary copy. */ + seed = (seed * 125 + 3) % 0x2AAAAB; + temp1 = (seed & 0xFFFF) << 0x10; + + /* temporary copy. */ + seed = (seed * 125 + 3) % 0x2AAAAB; + temp2 = (seed & 0xFFFF); + + /* assign buffer. */ + buffer[index2] = (temp1 | temp2); + } + } + + /* if no error was found, return zero. */ + return 0; +} + +int main() { + if (libmpq__buffer_init() != 0) + perror("libmpq__buffer_init()"); + int x; + printf("/* DO NOT CHANGE! this file is auto-generated by crypt_buf_gen.c */\n"); + printf("static const uint32_t crypt_buf[0x500] = {\n\t"); + for (x = 0; x < 0x500; x++) { + printf("0x%08x", buffer[x]); + if (x < 0x500 - 1) { + if (x % 6 == 5) + printf(",\n\t"); + else + printf(", "); + } + } + printf("\n};\n"); +} diff --git a/externals/libmpq/win/VC90/libmpq.vcproj b/externals/libmpq/win/VC90/libmpq.vcproj new file mode 100644 index 00000000000..83947857137 --- /dev/null +++ b/externals/libmpq/win/VC90/libmpq.vcproj @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/externals/libmpq/win/VS100/libmpq.vcxproj b/externals/libmpq/win/VS100/libmpq.vcxproj new file mode 100644 index 00000000000..e68a67ccd57 --- /dev/null +++ b/externals/libmpq/win/VS100/libmpq.vcxproj @@ -0,0 +1,115 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + libmpq + {03AB0F44-628E-4855-99A0-C98A1EB52C50} + libmpq + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\$(Platform)_$(Configuration)\ + ..\bin\$(ProjectName)__$(Platform)_$(Configuration)\ + ..\..\bin\$(Platform)_$(Configuration)\ + ..\bin\$(ProjectName)__$(Platform)_$(Configuration)\ + + + + Disabled + ..\; ..\..\..\..\dep\include\zlib; ..\..\..\..\dep\include\bzip2;%(AdditionalIncludeDirectories) + WIN32;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + EditAndContinue + CompileAsC + + + true + + + ..\dep\lib\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories) + + + + + MaxSpeed + true + ..\; ..\..\..\..\dep\include\zlib; ..\..\..\..\dep\include\bzip2;%(AdditionalIncludeDirectories) + WIN32;%(PreprocessorDefinitions) + MultiThreadedDLL + true + StreamingSIMDExtensions + Level3 + ProgramDatabase + CompileAsC + + + true + + + ..\dep\lib\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + {b96f612a-c91d-43b3-a4c3-d4294817ec6c} + false + + + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} + false + + + + + + \ No newline at end of file diff --git a/externals/libmpq/win/config.h b/externals/libmpq/win/config.h new file mode 100644 index 00000000000..6833494624d --- /dev/null +++ b/externals/libmpq/win/config.h @@ -0,0 +1,81 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `bz2' library (-lbz2). */ +#define HAVE_LIBBZ2 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 0 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libmpq" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mbroemme@plusserver.de" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libmpq" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libmpq 0.4.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libmpq" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.4.2" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.4.2" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ diff --git a/externals/libmpq/win/delme b/externals/libmpq/win/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/externals/libmpq/win/dirent.h b/externals/libmpq/win/dirent.h new file mode 100644 index 00000000000..6425174092d --- /dev/null +++ b/externals/libmpq/win/dirent.h @@ -0,0 +1,230 @@ +/***************************************************************************** + * dirent.h - dirent API for Microsoft Visual Studio + * + * Copyright (C) 2006 Toni Ronkko + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * ``Software''), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Dec 15, 2009, John Cunningham + * Added rewinddir member function + * + * Jan 18, 2008, Toni Ronkko + * Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string + * between multi-byte and unicode representations. This makes the + * code simpler and also allows the code to be compiled under MingW. Thanks + * to Azriel Fasten for the suggestion. + * + * Mar 4, 2007, Toni Ronkko + * Bug fix: due to the strncpy_s() function this file only compiled in + * Visual Studio 2005. Using the new string functions only when the + * compiler version allows. + * + * Nov 2, 2006, Toni Ronkko + * Major update: removed support for Watcom C, MS-DOS and Turbo C to + * simplify the file, updated the code to compile cleanly on Visual + * Studio 2005 with both unicode and multi-byte character strings, + * removed rewinddir() as it had a bug. + * + * Aug 20, 2006, Toni Ronkko + * Removed all remarks about MSVC 1.0, which is antiqued now. Simplified + * comments by removing SGML tags. + * + * May 14 2002, Toni Ronkko + * Embedded the function definitions directly to the header so that no + * source modules need to be included in the Visual Studio project. Removed + * all the dependencies to other projects so that this very header can be + * used independently. + * + * May 28 1998, Toni Ronkko + * First version. + *****************************************************************************/ +#ifndef DIRENT_H +#define DIRENT_H + +#include +#include +#include + + +typedef struct dirent +{ + char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */ + WIN32_FIND_DATAA data; /* file attributes */ +} dirent; + + +typedef struct DIR +{ + dirent current; /* Current directory entry */ + int cached; /* Indicates un-processed entry in memory */ + HANDLE search_handle; /* File search handle */ + char patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */ +} DIR; + + +/* Forward declarations */ +static DIR *opendir (const char *dirname); +static struct dirent *readdir (DIR *dirp); +static int closedir (DIR *dirp); +static void rewinddir(DIR* dirp); + + +/* Use the new safe string functions introduced in Visual Studio 2005 */ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE) +#else +# define STRNCPY(dest,src,size) strncpy((dest),(src),(size)) +#endif + + +/***************************************************************************** + * Open directory stream DIRNAME for read and return a pointer to the + * internal working area that is used to retrieve individual directory + * entries. + */ +static DIR *opendir(const char *dirname) +{ + DIR *dirp; + assert (dirname != NULL); + assert (strlen (dirname) < MAX_PATH); + + /* construct new DIR structure */ + dirp = (DIR*) malloc (sizeof (struct DIR)); + if (dirp != NULL) { + char *p; + + /* take directory name... */ + STRNCPY (dirp->patt, dirname, sizeof(dirp->patt)); + dirp->patt[MAX_PATH] = '\0'; + + /* ... and append search pattern to it */ + p = strchr (dirp->patt, '\0'); + if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') { + *p++ = '\\'; + } + *p++ = '*'; + *p = '\0'; + + /* open stream and retrieve first file */ + dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data); + if (dirp->search_handle == INVALID_HANDLE_VALUE) { + /* invalid search pattern? */ + free (dirp); + return NULL; + } + + /* there is an un-processed directory entry in memory now */ + dirp->cached = 1; + } + + return dirp; +} + + +/***************************************************************************** + * Read a directory entry, and return a pointer to a dirent structure + * containing the name of the entry in d_name field. Individual directory + * entries returned by this very function include regular files, + * sub-directories, pseudo-directories "." and "..", but also volume labels, + * hidden files and system files may be returned. + */ +static struct dirent *readdir(DIR *dirp) +{ + assert (dirp != NULL); + + if (dirp->search_handle == INVALID_HANDLE_VALUE) { + /* directory stream was opened/rewound incorrectly or ended normally */ + return NULL; + } + + /* get next directory entry */ + if (dirp->cached != 0) { + /* a valid directory entry already in memory */ + dirp->cached = 0; + } else { + /* read next directory entry from disk */ + if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) { + /* the very last file has been processed or an error occured */ + FindClose (dirp->search_handle); + dirp->search_handle = INVALID_HANDLE_VALUE; + return NULL; + } + } + + /* copy as a multibyte character string */ + STRNCPY ( dirp->current.d_name, + dirp->current.data.cFileName, + sizeof(dirp->current.d_name) ); + dirp->current.d_name[MAX_PATH] = '\0'; + + return &dirp->current; +} + + +/***************************************************************************** + * Close directory stream opened by opendir() function. Close of the + * directory stream invalidates the DIR structure as well as any previously + * read directory entry. + */ +static int closedir(DIR *dirp) +{ + assert (dirp != NULL); + + /* release search handle */ + if (dirp->search_handle != INVALID_HANDLE_VALUE) { + FindClose (dirp->search_handle); + dirp->search_handle = INVALID_HANDLE_VALUE; + } + + /* release directory handle */ + free (dirp); + return 0; +} + + +/***************************************************************************** + * Resets the position of the directory stream to which dirp refers to the + * beginning of the directory. It also causes the directory stream to refer + * to the current state of the corresponding directory, as a call to opendir() + * would have done. If dirp does not refer to a directory stream, the effect + * is undefined. + */ +static void rewinddir(DIR* dirp) +{ + /* release search handle */ + if (dirp->search_handle != INVALID_HANDLE_VALUE) { + FindClose (dirp->search_handle); + dirp->search_handle = INVALID_HANDLE_VALUE; + } + + /* open new search handle and retrieve first file */ + dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data); + if (dirp->search_handle == INVALID_HANDLE_VALUE) { + /* invalid search pattern? */ + free (dirp); + return; + } + + /* there is an un-processed directory entry in memory now */ + dirp->cached = 1; +} + + +#endif /*DIRENT_H*/ diff --git a/externals/libmpq/win/libmpq_VC100.sln b/externals/libmpq/win/libmpq_VC100.sln new file mode 100644 index 00000000000..5c88e2e4957 --- /dev/null +++ b/externals/libmpq/win/libmpq_VC100.sln @@ -0,0 +1,31 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpq", "VS100\libmpq.vcxproj", "{03AB0F44-628E-4855-99A0-C98A1EB52C50}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\..\..\win\VC100\zlib.vcxproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\..\..\win\VC100\bzip2.vcxproj", "{B96F612A-C91D-43B3-A4C3-D4294817EC6C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.ActiveCfg = Debug|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.Build.0 = Debug|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.ActiveCfg = Release|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.Build.0 = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32 + {B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|Win32.ActiveCfg = Debug|Win32 + {B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|Win32.Build.0 = Debug|Win32 + {B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|Win32.ActiveCfg = Release|Win32 + {B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/tools/map_extractor/VC90_AD.sln b/externals/libmpq/win/libmpq_VC90.sln similarity index 55% rename from src/tools/map_extractor/VC90_AD.sln rename to externals/libmpq/win/libmpq_VC90.sln index 68dd66e1f7f..c55968a73a7 100644 --- a/src/tools/map_extractor/VC90_AD.sln +++ b/externals/libmpq/win/libmpq_VC90.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ad", "VC90_ad.vcproj", "{D7552D4F-408F-4F8E-859B-366659150CF4}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpq", "VC90\libmpq.vcproj", "{03AB0F44-628E-4855-99A0-C98A1EB52C50}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -8,10 +8,10 @@ Global Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D7552D4F-408F-4F8E-859B-366659150CF4}.Debug|Win32.ActiveCfg = Debug|Win32 - {D7552D4F-408F-4F8E-859B-366659150CF4}.Debug|Win32.Build.0 = Debug|Win32 - {D7552D4F-408F-4F8E-859B-366659150CF4}.Release|Win32.ActiveCfg = Release|Win32 - {D7552D4F-408F-4F8E-859B-366659150CF4}.Release|Win32.Build.0 = Release|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.ActiveCfg = Debug|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.Build.0 = Debug|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.ActiveCfg = Release|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/externals/libmpq/win/stdint.h b/externals/libmpq/win/stdint.h new file mode 100644 index 00000000000..d02608a5972 --- /dev/null +++ b/externals/libmpq/win/stdint.h @@ -0,0 +1,247 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2008 Alexander Chemeris +// +// 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. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we should wrap include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#ifdef __cplusplus +extern "C" { +#endif +# include +#ifdef __cplusplus +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // _MSC_STDINT_H_ ] diff --git a/dep/include/mersennetwister/MersenneTwister.h b/externals/mersennetwister/MersenneTwister.h similarity index 99% rename from dep/include/mersennetwister/MersenneTwister.h rename to externals/mersennetwister/MersenneTwister.h index a4a3bbdd415..1cff879643f 100644 --- a/dep/include/mersennetwister/MersenneTwister.h +++ b/externals/mersennetwister/MersenneTwister.h @@ -60,7 +60,7 @@ // Not thread safe (unless auto-initialization is avoided and each thread has // its own MTRand object) -#include"Platform/Define.h" +#include"Define.h" #include #include diff --git a/externals/mersennetwister/delme b/externals/mersennetwister/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/externals/mysql/atomic/gcc_builtins.h b/externals/mysql/atomic/gcc_builtins.h new file mode 100644 index 00000000000..4600a0ef4b1 --- /dev/null +++ b/externals/mysql/atomic/gcc_builtins.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2008 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#define MY_ATOMIC_MODE "atomic_builtins" + +#define make_atomic_add_body(S) \ + v= __sync_fetch_and_add(a, v); +#define make_atomic_swap_body(S) \ + v= __sync_lock_test_and_set(a, v); +#define make_atomic_cas_body(S) \ + int ## S sav; \ + sav= __sync_val_compare_and_swap(a, *cmp, set); \ + if (!(ret= (sav == *cmp))) *cmp= sav; + +#ifdef MY_ATOMIC_MODE_DUMMY +#define make_atomic_load_body(S) ret= *a +#define make_atomic_store_body(S) *a= v +#define MY_ATOMIC_MODE "gcc-builtins-up" + +#else +#define MY_ATOMIC_MODE "gcc-builtins-smp" +#define make_atomic_load_body(S) \ + ret= __sync_fetch_and_or(a, 0); +#define make_atomic_store_body(S) \ + (void) __sync_lock_test_and_set(a, v); +#endif diff --git a/externals/mysql/atomic/generic-msvc.h b/externals/mysql/atomic/generic-msvc.h new file mode 100644 index 00000000000..a8601e993ba --- /dev/null +++ b/externals/mysql/atomic/generic-msvc.h @@ -0,0 +1,115 @@ +/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _atomic_h_cleanup_ +#define _atomic_h_cleanup_ "atomic/generic-msvc.h" + +/* + We don't implement anything specific for MY_ATOMIC_MODE_DUMMY, always use + intrinsics. + 8 and 16-bit atomics are not implemented, but it can be done if necessary. +*/ + +/* + x86 compilers (both VS2003 or VS2005) never use instrinsics, but generate + function calls to kernel32 instead, even in the optimized build. + We force intrinsics as described in MSDN documentation for + _InterlockedCompareExchange. +*/ +#ifdef _M_IX86 + +#if (_MSC_VER >= 1500) +#include +#else +C_MODE_START +/*Visual Studio 2003 and earlier do not have prototypes for atomic intrinsics*/ +LONG _InterlockedExchange (LONG volatile *Target,LONG Value); +LONG _InterlockedCompareExchange (LONG volatile *Target, LONG Value, LONG Comp); +LONG _InterlockedExchangeAdd (LONG volatile *Addend, LONG Value); +C_MODE_END + +#pragma intrinsic(_InterlockedExchangeAdd) +#pragma intrinsic(_InterlockedCompareExchange) +#pragma intrinsic(_InterlockedExchange) +#endif + +#define InterlockedExchange _InterlockedExchange +#define InterlockedExchangeAdd _InterlockedExchangeAdd +#define InterlockedCompareExchange _InterlockedCompareExchange +/* + No need to do something special for InterlockedCompareExchangePointer + as it is a #define to InterlockedCompareExchange. The same applies to + InterlockedExchangePointer. +*/ +#endif /*_M_IX86*/ + +#define MY_ATOMIC_MODE "msvc-intrinsics" +#define IL_EXCHG_ADD32(X,Y) InterlockedExchangeAdd((volatile LONG *)(X),(Y)) +#define IL_COMP_EXCHG32(X,Y,Z) InterlockedCompareExchange((volatile LONG *)(X),(Y),(Z)) +#define IL_COMP_EXCHGptr InterlockedCompareExchangePointer +#define IL_EXCHG32(X,Y) InterlockedExchange((volatile LONG *)(X),(Y)) +#define IL_EXCHGptr InterlockedExchangePointer +#define make_atomic_add_body(S) \ + v= IL_EXCHG_ADD ## S (a, v) +#define make_atomic_cas_body(S) \ + int ## S initial_cmp= *cmp; \ + int ## S initial_a= IL_COMP_EXCHG ## S (a, set, initial_cmp); \ + if (!(ret= (initial_a == initial_cmp))) *cmp= initial_a; +#define make_atomic_swap_body(S) \ + v= IL_EXCHG ## S (a, v) +#define make_atomic_load_body(S) \ + ret= 0; /* avoid compiler warning */ \ + ret= IL_COMP_EXCHG ## S (a, ret, ret); + +/* + my_yield_processor (equivalent of x86 PAUSE instruction) should be used + to improve performance on hyperthreaded CPUs. Intel recommends to use it in + spin loops also on non-HT machines to reduce power consumption (see e.g + http://softwarecommunity.intel.com/articles/eng/2004.htm) + + Running benchmarks for spinlocks implemented with InterlockedCompareExchange + and YieldProcessor shows that much better performance is achieved by calling + YieldProcessor in a loop - that is, yielding longer. On Intel boxes setting + loop count in the range 200-300 brought best results. + */ +#ifndef YIELD_LOOPS +#define YIELD_LOOPS 200 +#endif + +static __inline int my_yield_processor() +{ + int i; + for(i=0; irw) +#define my_atomic_rwlock_init(name) pthread_mutex_init(& (name)->rw, 0) +#define my_atomic_rwlock_rdlock(name) pthread_mutex_lock(& (name)->rw) +#define my_atomic_rwlock_wrlock(name) pthread_mutex_lock(& (name)->rw) +#define my_atomic_rwlock_rdunlock(name) pthread_mutex_unlock(& (name)->rw) +#define my_atomic_rwlock_wrunlock(name) pthread_mutex_unlock(& (name)->rw) +#define MY_ATOMIC_MODE "mutex" +#ifndef MY_ATOMIC_MODE_RWLOCKS +#define MY_ATOMIC_MODE_RWLOCKS 1 +#endif +#endif + +#define make_atomic_add_body(S) int ## S sav; sav= *a; *a+= v; v=sav; +#define make_atomic_fas_body(S) int ## S sav; sav= *a; *a= v; v=sav; +#define make_atomic_cas_body(S) if ((ret= (*a == *cmp))) *a= set; else *cmp=*a; +#define make_atomic_load_body(S) ret= *a; +#define make_atomic_store_body(S) *a= v; + diff --git a/externals/mysql/atomic/x86-gcc.h b/externals/mysql/atomic/x86-gcc.h new file mode 100644 index 00000000000..5a34bc22f9e --- /dev/null +++ b/externals/mysql/atomic/x86-gcc.h @@ -0,0 +1,69 @@ +/* Copyright (C) 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + XXX 64-bit atomic operations can be implemented using + cmpxchg8b, if necessary. Though I've heard that not all 64-bit + architectures support double-word (128-bit) cas. +*/ + +#ifdef __x86_64__ +# ifdef MY_ATOMIC_NO_XADD +# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix "-no-xadd" +# else +# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix +# endif +#else +# ifdef MY_ATOMIC_NO_XADD +# define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix "-no-xadd" +# else +# define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix +# endif +#endif + +/* fix -ansi errors while maintaining readability */ +#ifndef asm +#define asm __asm__ +#endif + +#ifndef MY_ATOMIC_NO_XADD +#define make_atomic_add_body(S) \ + asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a)) +#endif +#define make_atomic_fas_body(S) \ + asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a)) +#define make_atomic_cas_body(S) \ + asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \ + : "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set)) + +#ifdef MY_ATOMIC_MODE_DUMMY +#define make_atomic_load_body(S) ret=*a +#define make_atomic_store_body(S) *a=v +#else +/* + Actually 32-bit reads/writes are always atomic on x86 + But we add LOCK_prefix here anyway to force memory barriers +*/ +#define make_atomic_load_body(S) \ + ret=0; \ + asm volatile (LOCK_prefix "; cmpxchg %2, %0" \ + : "+m" (*a), "+a" (ret): "r" (ret)) +#define make_atomic_store_body(S) \ + asm volatile ("; xchg %0, %1;" : "+m" (*a), "+r" (v)) +#endif + +/* TODO test on intel whether the below helps. on AMD it makes no difference */ +//#define LF_BACKOFF ({asm volatile ("rep; nop"); 1; }) + diff --git a/externals/mysql/base64.h b/externals/mysql/base64.h new file mode 100644 index 00000000000..155d6691b93 --- /dev/null +++ b/externals/mysql/base64.h @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __BASE64_H_INCLUDED__ +#define __BASE64_H_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + Calculate how much memory needed for dst of base64_encode() +*/ +int my_base64_needed_encoded_length(int length_of_data); + +/* + Calculate how much memory needed for dst of base64_decode() +*/ +int my_base64_needed_decoded_length(int length_of_encoded_data); + + +/* + Encode data as a base64 string +*/ +int my_base64_encode(const void *src, size_t src_len, char *dst); + +/* + Decode a base64 string into data +*/ +int my_base64_decode(const char *src, size_t src_len, + void *dst, const char **end_ptr); + + +#ifdef __cplusplus +} +#endif +#endif /* !__BASE64_H_INCLUDED__ */ diff --git a/externals/mysql/config-win.h b/externals/mysql/config-win.h new file mode 100644 index 00000000000..94577211eb1 --- /dev/null +++ b/externals/mysql/config-win.h @@ -0,0 +1,392 @@ +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Defines for Win32 to make it compatible for MySQL */ + +#define BIG_TABLES + +/* + Minimal version of Windows we should be able to run on. + Currently Windows 2000 +*/ +#define _WIN32_WINNT 0x0500 + + +#if defined(_MSC_VER) && _MSC_VER >= 1400 +/* Avoid endless warnings about sprintf() etc. being unsafe. */ +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include /* chmod() constants*/ +#include +#include +#include +#include +#include +#include +#include /* getpid()*/ + +#define HAVE_SMEM 1 + +#if defined(_WIN64) || defined(WIN64) +#define SYSTEM_TYPE "Win64" +#elif defined(_WIN32) || defined(WIN32) +#define SYSTEM_TYPE "Win32" +#else +#define SYSTEM_TYPE "Windows" +#endif + +#if defined(_M_IA64) +#define MACHINE_TYPE "ia64" +#elif defined(_M_IX86) +#define MACHINE_TYPE "ia32" +#elif defined(_M_ALPHA) +#define MACHINE_TYPE "axp" +#else +#define MACHINE_TYPE "unknown" /* Define to machine type name */ +#endif + +#if !(defined(_WIN64) || defined(WIN64)) +#ifndef _WIN32 +#define _WIN32 /* Compatible with old source */ +#endif +#ifndef __WIN32__ +#define __WIN32__ +#endif +#endif /* _WIN64 */ +#ifndef __WIN__ +#define __WIN__ /* To make it easier in VC++ */ +#endif + +#ifndef MAX_INDEXES +#define MAX_INDEXES 64 +#endif + +/* File and lock constants */ +#ifdef __BORLANDC__ +#define F_RDLCK LK_NBLCK /* read lock */ +#define F_WRLCK LK_NBRLCK /* write lock */ +#define F_UNLCK LK_UNLCK /* remove lock(s) */ +#else +#define F_RDLCK _LK_NBLCK /* read lock */ +#define F_WRLCK _LK_NBRLCK /* write lock */ +#define F_UNLCK _LK_UNLCK /* remove lock(s) */ +#endif + +#define F_EXCLUSIVE 1 /* We have only exclusive locking */ +#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */ +#define F_OK 0 /* parameter to access() */ +#define W_OK 2 + +#define S_IROTH S_IREAD /* for my_lib */ + +/* for MY_S_ISFIFO() macro from my_lib */ +#if defined (_S_IFIFO) && !defined (S_IFIFO) +#define S_IFIFO _S_IFIFO +#endif + +/* Winsock2 constant (Vista SDK and later)*/ +#define IPPROTO_IPV6 41 +#ifndef IPV6_V6ONLY +#define IPV6_V6ONLY 27 +#endif + +/* + Constants used by chmod. Note, that group/others is ignored + - because unsupported by Windows due to different access control model. +*/ +#define S_IRWXU S_IREAD|S_IWRITE +#define S_IRWXG 0 +#define S_IRWXO 0 +typedef int mode_t; + +#ifdef __BORLANDC__ +#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ +#define O_TEMPORARY 0 +#define O_SHORT_LIVED 0 +#define SH_DENYNO _SH_DENYNO +#else +#define O_BINARY _O_BINARY /* compability with older style names */ +#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */ +#define O_TEMPORARY _O_TEMPORARY +#define O_SHORT_LIVED _O_SHORT_LIVED +#define SH_DENYNO _SH_DENYNO +#endif +#define NO_OPEN_3 /* For my_create() */ + +#define SIGQUIT SIGTERM /* No SIGQUIT */ + +#undef _REENTRANT /* Crashes something for win32 */ +#undef SAFE_MUTEX /* Can't be used on windows */ + +#define LONGLONG_MIN 0x8000000000000000LL +#define LONGLONG_MAX 0x7FFFFFFFFFFFFFFFLL +#define ULONGLONG_MAX 0xFFFFFFFFFFFFFFFFULL + +/* Type information */ + +#if !defined(HAVE_UINT) +#undef HAVE_UINT +#define HAVE_UINT +typedef unsigned short ushort; +typedef unsigned int uint; +#endif /* !defined(HAVE_UINT) */ + +typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ +typedef __int64 longlong; +#ifndef HAVE_SIGSET_T +typedef int sigset_t; +#endif +#define longlong_defined +/* + off_t should not be __int64 because of conflicts in header files; + Use my_off_t or os_off_t instead +*/ +#ifndef HAVE_OFF_T +typedef long off_t; +#endif +typedef __int64 os_off_t; +#ifdef _WIN64 +typedef UINT_PTR rf_SetTimer; +#else +typedef uint rf_SetTimer; +#endif + +#ifndef HAVE_SIZE_T +#ifndef _SIZE_T_DEFINED +typedef SIZE_T size_t; +#define _SIZE_T_DEFINED +#endif +#endif + +#ifndef HAVE_SSIZE_T +#ifndef _SSIZE_T_DEFINED +typedef SSIZE_T ssize_t; +#define _SSIZE_T_DEFINED +#endif +#endif + +#define Socket_defined +#define my_socket SOCKET +#define SIGPIPE SIGINT +#define RETQSORTTYPE void +#define QSORT_TYPE_IS_VOID +#define SOCKET_SIZE_TYPE int +#define my_socket_defined +#define byte_defined +#define HUGE_PTR +#define STDCALL __stdcall /* Used by libmysql.dll */ +#define isnan(X) _isnan(X) +#define finite(X) _finite(X) + +#ifndef UNDEF_THREAD_HACK +#define THREAD +#endif +#define VOID_SIGHANDLER +#define SIZEOF_CHAR 1 +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF_OFF_T 8 +#ifdef _WIN64 +#define SIZEOF_CHARP 8 +#else +#define SIZEOF_CHARP 4 +#endif +#define HAVE_BROKEN_NETINET_INCLUDES +#ifdef _WIN32 +#define HAVE_NAMED_PIPE /* We can only create pipes on NT */ +#endif + +/* ERROR is defined in wingdi.h */ +#undef ERROR + +/* We need to close files to break connections on shutdown */ +#ifndef SIGNAL_WITH_VIO_CLOSE +#define SIGNAL_WITH_VIO_CLOSE +#endif + +/* All windows servers should support .sym files */ +#undef USE_SYMDIR +#define USE_SYMDIR + +/* If LOAD DATA LOCAL INFILE should be enabled by default */ +#define ENABLED_LOCAL_INFILE 1 + +/* If query profiling should be enabled by default */ +#define ENABLED_PROFILING 1 + +/* Convert some simple functions to Posix */ + +#define my_sigset(A,B) signal((A),(B)) +#define finite(A) _finite(A) +#define sleep(A) Sleep((A)*1000) +#define popen(A,B) _popen((A),(B)) +#define pclose(A) _pclose(A) + +#ifndef __BORLANDC__ +#define access(A,B) _access(A,B) +#endif + +#if !defined(__cplusplus) +#define inline __inline +#endif /* __cplusplus */ + +#ifdef _WIN64 +#define ulonglong2double(A) ((double) (ulonglong) (A)) +#define my_off_t2double(A) ((double) (my_off_t) (A)) + +#else +inline double ulonglong2double(ulonglong value) +{ + longlong nr=(longlong) value; + if (nr >= 0) + return (double) nr; + return (18446744073709551616.0 + (double) nr); +} +#define my_off_t2double(A) ulonglong2double(A) +#endif /* _WIN64 */ + +inline ulonglong double2ulonglong(double d) +{ + double t= d - (double) 0x8000000000000000ULL; + + if (t >= 0) + return ((ulonglong) t) + 0x8000000000000000ULL; + return (ulonglong) d; +} + +#if SIZEOF_OFF_T > 4 +#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C)) +#define tell(A) _telli64(A) +#endif + +#define STACK_DIRECTION -1 + +/* Difference between GetSystemTimeAsFileTime() and now() */ +#define OFFSET_TO_EPOCH 116444736000000000ULL + +#define HAVE_PERROR +#define HAVE_VFPRINT +#define HAVE_RENAME /* Have rename() as function */ +#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */ +#define HAVE_LONG_JMP /* Have long jump function */ +#define HAVE_LOCKING /* have locking() call */ +#define HAVE_ERRNO_AS_DEFINE /* errno is a define */ +#define HAVE_STDLIB /* everything is include in this file */ +#define HAVE_MEMCPY +#define HAVE_MEMMOVE +#define HAVE_GETCWD +#define HAVE_TELL +#define HAVE_TZNAME +#define HAVE_PUTENV +#define HAVE_SELECT +#define HAVE_SETLOCALE +#define HAVE_SOCKET /* Giangi */ +#define HAVE_FLOAT_H +#define HAVE_LIMITS_H +#define HAVE_STDDEF_H +#define NO_FCNTL_NONBLOCK /* No FCNTL */ +#define HAVE_ALLOCA +#define HAVE_STRPBRK +#define HAVE_STRSTR +#define HAVE_COMPRESS +#define HAVE_CREATESEMAPHORE +#define HAVE_ISNAN +#define HAVE_FINITE +#define HAVE_QUERY_CACHE +#define SPRINTF_RETURNS_INT +#define HAVE_SETFILEPOINTER +#define HAVE_VIO_READ_BUFF +#if defined(_MSC_VER) && _MSC_VER >= 1400 +/* strnlen() appeared in Studio 2005 */ +#define HAVE_STRNLEN +#endif +#define HAVE_WINSOCK2 + +#define strcasecmp stricmp +#define strncasecmp strnicmp + +#ifndef _WIN32 +#undef FILE_SHARE_DELETE +#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */ +#endif + +#ifdef NOT_USED +#define HAVE_SNPRINTF /* Gave link error */ +#define _snprintf snprintf +#endif + +#ifdef _MSC_VER +#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ +#define HAVE_ANSI_INCLUDE +#define HAVE_SYS_UTIME_H +#define HAVE_STRTOUL +#endif +#define my_reinterpret_cast(A) reinterpret_cast +#define my_const_cast(A) const_cast + + +/* MYSQL OPTIONS */ + +#ifdef _CUSTOMCONFIG_ +#include +#else +#define DEFAULT_MYSQL_HOME "c:\\mysql" +#define DATADIR "c:\\mysql\\data" +#define PACKAGE "mysql" +#define DEFAULT_BASEDIR "C:\\" +#define SHAREDIR "share" +#define DEFAULT_CHARSET_HOME "C:/mysql/" +#endif +#ifndef DEFAULT_HOME_ENV +#define DEFAULT_HOME_ENV MYSQL_HOME +#endif +#ifndef DEFAULT_GROUP_SUFFIX_ENV +#define DEFAULT_GROUP_SUFFIX_ENV MYSQL_GROUP_SUFFIX +#endif + +/* File name handling */ + +#define FN_LIBCHAR '\\' +#define FN_ROOTDIR "\\" +#define FN_DEVCHAR ':' +#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ +#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ +#define OS_FILE_LIMIT UINT_MAX /* No limit*/ + +#define DO_NOT_REMOVE_THREAD_WRAPPERS +#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) +#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) +/* The following is only used for statistics, so it should be good enough */ +#ifdef _WIN32 /* This should also work on Win98 but .. */ +#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) +#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) +#endif + +#define shared_memory_buffer_length 16000 +#define default_shared_memory_base_name "MYSQL" + +#define HAVE_SPATIAL 1 +#define HAVE_RTREE_KEYS 1 + +#define HAVE_OPENSSL 1 +#define HAVE_YASSL 1 + +#define COMMUNITY_SERVER 1 +#define ENABLED_PROFILING 1 + +#define HAVE_BOOL 1 diff --git a/externals/mysql/decimal.h b/externals/mysql/decimal.h new file mode 100644 index 00000000000..530ed9e1757 --- /dev/null +++ b/externals/mysql/decimal.h @@ -0,0 +1,107 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _decimal_h +#define _decimal_h + +typedef enum +{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} + decimal_round_mode; +typedef int32 decimal_digit_t; + +typedef struct st_decimal_t { + int intg, frac, len; + my_bool sign; + decimal_digit_t *buf; +} decimal_t; + +int internal_str2dec(const char *from, decimal_t *to, char **end, + my_bool fixed); +int decimal2string(decimal_t *from, char *to, int *to_len, + int fixed_precision, int fixed_decimals, + char filler); +int decimal2ulonglong(decimal_t *from, ulonglong *to); +int ulonglong2decimal(ulonglong from, decimal_t *to); +int decimal2longlong(decimal_t *from, longlong *to); +int longlong2decimal(longlong from, decimal_t *to); +int decimal2double(decimal_t *from, double *to); +int double2decimal(double from, decimal_t *to); +int decimal_actual_fraction(decimal_t *from); +int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); +int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale); + +int decimal_size(int precision, int scale); +int decimal_bin_size(int precision, int scale); +int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, + int param); + +int decimal_intg(decimal_t *from); +int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_cmp(decimal_t *from1, decimal_t *from2); +int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, + int scale_incr); +int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_round(decimal_t *from, decimal_t *to, int new_scale, + decimal_round_mode mode); +int decimal_is_zero(decimal_t *from); +void max_decimal(int precision, int frac, decimal_t *to); + +#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) +#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1) + +/* set a decimal_t to zero */ + +#define decimal_make_zero(dec) do { \ + (dec)->buf[0]=0; \ + (dec)->intg=1; \ + (dec)->frac=0; \ + (dec)->sign=0; \ + } while(0) + +/* + returns the length of the buffer to hold string representation + of the decimal (including decimal dot, possible sign and \0) +*/ + +#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \ + (dec)->frac + ((dec)->frac > 0) + 2) + +/* negate a decimal */ +#define decimal_neg(dec) do { (dec)->sign^=1; } while(0) + +/* + conventions: + + decimal_smth() == 0 -- everything's ok + decimal_smth() <= 1 -- result is usable, but precision loss is possible + decimal_smth() <= 2 -- result can be unusable, most significant digits + could've been lost + decimal_smth() > 2 -- no result was generated +*/ + +#define E_DEC_OK 0 +#define E_DEC_TRUNCATED 1 +#define E_DEC_OVERFLOW 2 +#define E_DEC_DIV_ZERO 4 +#define E_DEC_BAD_NUM 8 +#define E_DEC_OOM 16 + +#define E_DEC_ERROR 31 +#define E_DEC_FATAL_ERROR 30 + +#endif + diff --git a/externals/mysql/delme b/externals/mysql/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/dep/include/mysql/errmsg.h b/externals/mysql/errmsg.h similarity index 62% rename from dep/include/mysql/errmsg.h rename to externals/mysql/errmsg.h index 720ff7a25ae..92d70abb9f5 100644 --- a/dep/include/mysql/errmsg.h +++ b/externals/mysql/errmsg.h @@ -14,68 +14,66 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Error messages for MySQL clients */ -/* (Error messages for the daemon are in share/language/errmsg.sys) */ +/* (Error messages for the daemon are in sql/share/errmsg.txt) */ -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -void init_client_errs(void); -void finish_client_errs(void); -extern const char *client_errors[]; /* Error messages */ -#ifdef __cplusplus +void init_client_errs(void); +void finish_client_errs(void); +extern const char *client_errors[]; /* Error messages */ +#ifdef __cplusplus } #endif -#define CR_MIN_ERROR 2000 /* For easier client code */ -#define CR_MAX_ERROR 2999 -#if defined(OS2) && defined(MYSQL_SERVER) -#define CER(X) client_errors[(X)-CR_MIN_ERROR] -#elif !defined(ER) +#define CR_MIN_ERROR 2000 /* For easier client code */ +#define CR_MAX_ERROR 2999 +#if !defined(ER) #define ER(X) client_errors[(X)-CR_MIN_ERROR] #endif -#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ +#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ /* Do not add error numbers before CR_ERROR_FIRST. */ /* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ -#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ -#define CR_UNKNOWN_ERROR 2000 -#define CR_SOCKET_CREATE_ERROR 2001 -#define CR_CONNECTION_ERROR 2002 -#define CR_CONN_HOST_ERROR 2003 -#define CR_IPSOCK_ERROR 2004 -#define CR_UNKNOWN_HOST 2005 -#define CR_SERVER_GONE_ERROR 2006 -#define CR_VERSION_ERROR 2007 -#define CR_OUT_OF_MEMORY 2008 -#define CR_WRONG_HOST_INFO 2009 +#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ +#define CR_UNKNOWN_ERROR 2000 +#define CR_SOCKET_CREATE_ERROR 2001 +#define CR_CONNECTION_ERROR 2002 +#define CR_CONN_HOST_ERROR 2003 +#define CR_IPSOCK_ERROR 2004 +#define CR_UNKNOWN_HOST 2005 +#define CR_SERVER_GONE_ERROR 2006 +#define CR_VERSION_ERROR 2007 +#define CR_OUT_OF_MEMORY 2008 +#define CR_WRONG_HOST_INFO 2009 #define CR_LOCALHOST_CONNECTION 2010 -#define CR_TCP_CONNECTION 2011 +#define CR_TCP_CONNECTION 2011 #define CR_SERVER_HANDSHAKE_ERR 2012 -#define CR_SERVER_LOST 2013 +#define CR_SERVER_LOST 2013 #define CR_COMMANDS_OUT_OF_SYNC 2014 #define CR_NAMEDPIPE_CONNECTION 2015 #define CR_NAMEDPIPEWAIT_ERROR 2016 #define CR_NAMEDPIPEOPEN_ERROR 2017 #define CR_NAMEDPIPESETSTATE_ERROR 2018 -#define CR_CANT_READ_CHARSET 2019 +#define CR_CANT_READ_CHARSET 2019 #define CR_NET_PACKET_TOO_LARGE 2020 -#define CR_EMBEDDED_CONNECTION 2021 +#define CR_EMBEDDED_CONNECTION 2021 #define CR_PROBE_SLAVE_STATUS 2022 #define CR_PROBE_SLAVE_HOSTS 2023 #define CR_PROBE_SLAVE_CONNECT 2024 #define CR_PROBE_MASTER_CONNECT 2025 #define CR_SSL_CONNECTION_ERROR 2026 #define CR_MALFORMED_PACKET 2027 -#define CR_WRONG_LICENSE 2028 +#define CR_WRONG_LICENSE 2028 /* new 4.1 error codes */ -#define CR_NULL_POINTER 2029 -#define CR_NO_PREPARE_STMT 2030 -#define CR_PARAMS_NOT_BOUND 2031 -#define CR_DATA_TRUNCATED 2032 +#define CR_NULL_POINTER 2029 +#define CR_NO_PREPARE_STMT 2030 +#define CR_PARAMS_NOT_BOUND 2031 +#define CR_DATA_TRUNCATED 2032 #define CR_NO_PARAMETERS_EXISTS 2033 #define CR_INVALID_PARAMETER_NO 2034 -#define CR_INVALID_BUFFER_USE 2035 +#define CR_INVALID_BUFFER_USE 2035 #define CR_UNSUPPORTED_PARAM_TYPE 2036 #define CR_SHARED_MEMORY_CONNECTION 2037 @@ -85,19 +83,21 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 #define CR_SHARED_MEMORY_MAP_ERROR 2043 -#define CR_SHARED_MEMORY_EVENT_ERROR 2044 +#define CR_SHARED_MEMORY_EVENT_ERROR 2044 #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 -#define CR_CONN_UNKNOW_PROTOCOL 2047 -#define CR_INVALID_CONN_HANDLE 2048 +#define CR_CONN_UNKNOW_PROTOCOL 2047 +#define CR_INVALID_CONN_HANDLE 2048 #define CR_SECURE_AUTH 2049 #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 #define CR_NO_STMT_METADATA 2052 #define CR_NO_RESULT_SET 2053 #define CR_NOT_IMPLEMENTED 2054 -#define CR_SERVER_LOST_EXTENDED 2055 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2055 +#define CR_SERVER_LOST_EXTENDED 2055 +#define CR_STMT_CLOSED 2056 +#define CR_NEW_STMT_METADATA 2057 +#define CR_ALREADY_CONNECTED 2058 +#define CR_ERROR_LAST /*Copy last error nr:*/ 2058 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ - diff --git a/externals/mysql/extlib/dbug/dbug.c b/externals/mysql/extlib/dbug/dbug.c new file mode 100644 index 00000000000..68932adf1e1 --- /dev/null +++ b/externals/mysql/extlib/dbug/dbug.c @@ -0,0 +1,2583 @@ +/****************************************************************************** + * * + * N O T I C E * + * * + * Copyright Abandoned, 1987, Fred Fish * + * * + * * + * This previously copyrighted work has been placed into the public * + * domain by the author and may be freely used for any purpose, * + * private or commercial. * + * * + * Because of the number of inquiries I was receiving about the use * + * of this product in commercially developed works I have decided to * + * simply make it public domain to further its unrestricted use. I * + * specifically would be most happy to see this material become a * + * part of the standard Unix distributions by AT&T and the Berkeley * + * Computer Science Research Group, and a standard part of the GNU * + * system from the Free Software Foundation. * + * * + * I would appreciate it, as a courtesy, if this notice is left in * + * all copies and derivative works. Thank you. * + * * + * The author makes no warranty of any kind with respect to this * + * product and explicitly disclaims any implied warranties of mer- * + * chantability or fitness for any particular purpose. * + * * + ****************************************************************************** + */ + +/* + * FILE + * + * dbug.c runtime support routines for dbug package + * + * SCCS + * + * @(#)dbug.c 1.25 7/25/89 + * + * DESCRIPTION + * + * These are the runtime support routines for the dbug package. + * The dbug package has two main components; the user include + * file containing various macro definitions, and the runtime + * support routines which are called from the macro expansions. + * + * Externally visible functions in the runtime support module + * use the naming convention pattern "_db_xx...xx_", thus + * they are unlikely to collide with user defined function names. + * + * AUTHOR(S) + * + * Fred Fish (base code) + * Enhanced Software Technologies, Tempe, AZ + * asuvax!mcdphx!estinc!fnf + * + * Binayak Banerjee (profiling enhancements) + * seismo!bpa!sjuvax!bbanerje + * + * Michael Widenius: + * DBUG_DUMP - To dump a block of memory. + * PUSH_FLAG "O" - To be used insted of "o" if we + * want flushing after each write + * PUSH_FLAG "A" - as 'O', but we will append to the out file instead + * of creating a new one. + * Check of malloc on entry/exit (option "S") + * + * Sergei Golubchik: + * DBUG_EXECUTE_IF + * incremental mode (-#+t:-d,info ...) + * DBUG_SET, _db_explain_ + * thread-local settings + * negative lists (-#-d,info => everything but "info") + * + * function/ syntax + * (the logic is - think of a call stack as of a path. + * "function" means only this function, "function/" means the hierarchy. + * in the future, filters like function1/function2 could be supported. + * following this logic glob(7) wildcards are supported.) + * + */ + +/* + We can't have SAFE_MUTEX defined here as this will cause recursion + in pthread_mutex_lock +*/ + +#undef SAFE_MUTEX +#include +#include +#include + +#ifdef HAVE_FNMATCH_H +#include +#else +#define fnmatch(A,B,C) strcmp(A,B) +#endif + +#if defined(MSDOS) || defined(__WIN__) +#include +#endif + +#ifndef DBUG_OFF + + +/* + * Manifest constants which may be "tuned" if desired. + */ + +#define PRINTBUF 1024 /* Print buffer size */ +#define INDENT 2 /* Indentation per trace level */ +#define MAXDEPTH 200 /* Maximum trace depth default */ + +/* + * The following flags are used to determine which + * capabilities the user has enabled with the settings + * push macro. + * + * TRACE_ON is also used in _db_stack_frame_->level + * (until we add flags to _db_stack_frame_, increasing it by 4 bytes) + */ + +#define DEBUG_ON (1 << 1) /* Debug enabled */ +#define FILE_ON (1 << 2) /* File name print enabled */ +#define LINE_ON (1 << 3) /* Line number print enabled */ +#define DEPTH_ON (1 << 4) /* Function nest level print enabled */ +#define PROCESS_ON (1 << 5) /* Process name print enabled */ +#define NUMBER_ON (1 << 6) /* Number each line of output */ +#define PROFILE_ON (1 << 7) /* Print out profiling code */ +#define PID_ON (1 << 8) /* Identify each line with process id */ +#define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */ +#define SANITY_CHECK_ON (1 << 10) /* Check safemalloc on DBUG_ENTER */ +#define FLUSH_ON_WRITE (1 << 11) /* Flush on every write */ +#define OPEN_APPEND (1 << 12) /* Open for append */ +#define TRACE_ON ((uint)1 << 31) /* Trace enabled. MUST be the highest bit!*/ + +#define TRACING (cs->stack->flags & TRACE_ON) +#define DEBUGGING (cs->stack->flags & DEBUG_ON) +#define PROFILING (cs->stack->flags & PROFILE_ON) + +/* + * Typedefs to make things more obvious. + */ + +#define BOOLEAN my_bool + +/* + * Make it easy to change storage classes if necessary. + */ + +#define IMPORT extern /* Names defined externally */ +#define EXPORT /* Allocated here, available globally */ +#define AUTO auto /* Names to be allocated on stack */ +#define REGISTER register /* Names to be placed in registers */ + +/* + * The default file for profiling. Could also add another flag + * (G?) which allowed the user to specify this. + * + * If the automatic variables get allocated on the stack in + * reverse order from their declarations, then define AUTOS_REVERSE to 1. + * This is used by the code that keeps track of stack usage. For + * forward allocation, the difference in the dbug frame pointers + * represents stack used by the callee function. For reverse allocation, + * the difference represents stack used by the caller function. + * + */ + +#define PROF_FILE "dbugmon.out" +#define PROF_EFMT "E\t%ld\t%s\n" +#define PROF_SFMT "S\t%lx\t%lx\t%s\n" +#define PROF_XFMT "X\t%ld\t%s\n" + +#ifdef M_I386 /* predefined by xenix 386 compiler */ +#define AUTOS_REVERSE 1 +#else +#define AUTOS_REVERSE 0 +#endif + +/* + * Externally supplied functions. + */ + +#ifndef HAVE_PERROR +static void perror(); /* Fake system/library error print routine */ +#endif + +#ifdef SAFEMALLOC +IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */ +#else +#define _sanity(X,Y) (1) +#endif + +/* + * The user may specify a list of functions to trace or + * debug. These lists are kept in a linear linked list, + * a very simple implementation. + */ + +struct link { + struct link *next_link; /* Pointer to the next link */ + char flags; + char str[1]; /* Pointer to link's contents */ +}; + +/* flags for struct link and return flags of InList */ +#define SUBDIR 1 /* this MUST be 1 */ +#define INCLUDE 2 +#define EXCLUDE 4 +/* this is not a struct link flag, but only a return flags of InList */ +#define MATCHED 65536 +#define NOT_MATCHED 0 + +/* + * Debugging settings can be pushed or popped off of a + * stack which is implemented as a linked list. Note + * that the head of the list is the current settings and the + * stack is pushed by adding a new settings to the head of the + * list or popped by removing the first link. + * + * Note: if out_file is NULL, the other fields are not initialized at all! + */ + +struct settings { + uint flags; /* Current settings flags */ + uint maxdepth; /* Current maximum trace depth */ + uint delay; /* Delay after each output line */ + uint sub_level; /* Sub this from code_state->level */ + FILE *out_file; /* Current output stream */ + FILE *prof_file; /* Current profiling stream */ + char name[FN_REFLEN]; /* Name of output file */ + struct link *functions; /* List of functions */ + struct link *p_functions; /* List of profiled functions */ + struct link *keywords; /* List of debug keywords */ + struct link *processes; /* List of process names */ + struct settings *next; /* Next settings in the list */ +}; + +#define is_shared(S, V) ((S)->next && (S)->next->V == (S)->V) + +/* + * Local variables not seen by user. + */ + + +static BOOLEAN init_done= FALSE; /* Set to TRUE when initialization done */ +static struct settings init_settings; +static const char *db_process= 0;/* Pointer to process name; argv[0] */ +my_bool _dbug_on_= TRUE; /* FALSE if no debugging at all */ + +typedef struct _db_code_state_ { + const char *process; /* Pointer to process name; usually argv[0] */ + const char *func; /* Name of current user function */ + const char *file; /* Name of current user file */ + struct _db_stack_frame_ *framep; /* Pointer to current frame */ + struct settings *stack; /* debugging settings */ + const char *jmpfunc; /* Remember current function for setjmp */ + const char *jmpfile; /* Remember current file for setjmp */ + int lineno; /* Current debugger output line number */ + uint level; /* Current function nesting level */ + int jmplevel; /* Remember nesting level at setjmp() */ + +/* + * The following variables are used to hold the state information + * between the call to _db_pargs_() and _db_doprnt_(), during + * expansion of the DBUG_PRINT macro. This is the only macro + * that currently uses these variables. + * + * These variables are currently used only by _db_pargs_() and + * _db_doprnt_(). + */ + + uint u_line; /* User source code line number */ + int locked; /* If locked with _db_lock_file_ */ + const char *u_keyword; /* Keyword for current macro */ +} CODE_STATE; + +/* + The test below is so we could call functions with DBUG_ENTER before + my_thread_init(). +*/ +#define get_code_state_if_not_set_or_return if (!cs && !((cs=code_state()))) return +#define get_code_state_or_return if (!((cs=code_state()))) return + + /* Handling lists */ +#define ListAdd(A,B,C) ListAddDel(A,B,C,INCLUDE) +#define ListDel(A,B,C) ListAddDel(A,B,C,EXCLUDE) +static struct link *ListAddDel(struct link *, const char *, const char *, int); +static struct link *ListCopy(struct link *); +static int InList(struct link *linkp,const char *cp); +static uint ListFlags(struct link *linkp); +static void FreeList(struct link *linkp); + + /* OpenClose debug output stream */ +static void DBUGOpenFile(CODE_STATE *,const char *, const char *, int); +static void DBUGCloseFile(CODE_STATE *cs, FILE *fp); + /* Push current debug settings */ +static void PushState(CODE_STATE *cs); + /* Free memory associated with debug state. */ +static void FreeState (CODE_STATE *cs, struct settings *state, int free_state); + /* Test for tracing enabled */ +static int DoTrace(CODE_STATE *cs); +/* + return values of DoTrace. + Can also be used as bitmask: ret & DO_TRACE +*/ +#define DO_TRACE 1 +#define DONT_TRACE 2 +#define ENABLE_TRACE 3 +#define DISABLE_TRACE 4 + + /* Test to see if file is writable */ +#if defined(HAVE_ACCESS) && !defined(MSDOS) +static BOOLEAN Writable(const char *pathname); + /* Change file owner and group */ +static void ChangeOwner(CODE_STATE *cs, char *pathname); + /* Allocate memory for runtime support */ +#endif + +static void DoPrefix(CODE_STATE *cs, uint line); + +static char *DbugMalloc(size_t size); +static const char *BaseName(const char *pathname); +static void Indent(CODE_STATE *cs, int indent); +static void DbugFlush(CODE_STATE *); +static void DbugExit(const char *why); +static const char *DbugStrTok(const char *s); +static void DbugFprintf(FILE *stream, const char* format, va_list args); + +#ifndef THREAD + /* Open profile output stream */ +static FILE *OpenProfile(CODE_STATE *cs, const char *name); + /* Profile if asked for it */ +static BOOLEAN DoProfile(CODE_STATE *); + /* Return current user time (ms) */ +static unsigned long Clock(void); +#endif + +/* + * Miscellaneous printf format strings. + */ + +#define ERR_MISSING_RETURN "%s: missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"%s\"\n" +#define ERR_OPEN "%s: can't open debug output stream \"%s\": " +#define ERR_CLOSE "%s: can't close debug file: " +#define ERR_ABORT "%s: debugger aborting because %s\n" +#define ERR_CHOWN "%s: can't change owner/group of \"%s\": " + +/* + * Macros and defines for testing file accessibility under UNIX and MSDOS. + */ + +#undef EXISTS +#if !defined(HAVE_ACCESS) || defined(MSDOS) +#define EXISTS(pathname) (FALSE) /* Assume no existance */ +#define Writable(name) (TRUE) +#else +#define EXISTS(pathname) (access(pathname, F_OK) == 0) +#define WRITABLE(pathname) (access(pathname, W_OK) == 0) +#endif +#ifndef MSDOS +#define ChangeOwner(cs,name) +#endif + + +/* +** Macros to allow dbugging with threads +*/ + +#ifdef THREAD +#include +static pthread_mutex_t THR_LOCK_dbug; + +static CODE_STATE *code_state(void) +{ + CODE_STATE *cs, **cs_ptr; + + /* + _dbug_on_ is reset if we don't plan to use any debug commands at all and + we want to run on maximum speed + */ + if (!_dbug_on_) + return 0; + + if (!init_done) + { + init_done=TRUE; + pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST); + bzero(&init_settings, sizeof(init_settings)); + init_settings.out_file=stderr; + init_settings.flags=OPEN_APPEND; + } + + if (!(cs_ptr= (CODE_STATE**) my_thread_var_dbug())) + return 0; /* Thread not initialised */ + if (!(cs= *cs_ptr)) + { + cs=(CODE_STATE*) DbugMalloc(sizeof(*cs)); + bzero((uchar*) cs,sizeof(*cs)); + cs->process= db_process ? db_process : "dbug"; + cs->func="?func"; + cs->file="?file"; + cs->stack=&init_settings; + *cs_ptr= cs; + } + return cs; +} + +#else /* !THREAD */ + +static CODE_STATE static_code_state= +{ + "dbug", "?func", "?file", NULL, &init_settings, + NullS, NullS, 0,0,0,0,0,NullS +}; + +static CODE_STATE *code_state(void) +{ + if (!init_done) + { + bzero(&init_settings, sizeof(init_settings)); + init_settings.out_file=stderr; + init_settings.flags=OPEN_APPEND; + init_done=TRUE; + } + return &static_code_state; +} + +#define pthread_mutex_lock(A) {} +#define pthread_mutex_unlock(A) {} +#endif + +/* + * Translate some calls among different systems. + */ + +#ifdef HAVE_SLEEP +/* sleep() wants seconds */ +#define Delay(A) sleep(((uint) A)/10) +#else +#define Delay(A) (0) +#endif + +/* + * FUNCTION + * + * _db_process_ give the name to the current process/thread + * + * SYNOPSIS + * + * VOID _process_(name) + * char *name; + * + */ + +void _db_process_(const char *name) +{ + CODE_STATE *cs; + + if (!db_process) + db_process= name; + + get_code_state_or_return; + cs->process= name; +} + +/* + * FUNCTION + * + * DbugParse parse control string and set current debugger settings + * + * DESCRIPTION + * + * Given pointer to a debug control string in "control", + * parses the control string, and sets + * up a current debug settings. + * + * The debug control string is a sequence of colon separated fields + * as follows: + * + * [+]::...: + * + * Each field consists of a mandatory flag character followed by + * an optional "," and comma separated list of modifiers: + * + * [sign]flag[,modifier,modifier,...,modifier] + * + * See the manual for the list of supported signs, flags, and modifiers + * + * For convenience, any leading "-#" is stripped off. + * + * RETURN + * 1 - a list of functions ("f" flag) was possibly changed + * 0 - a list of functions was not changed + */ + +int DbugParse(CODE_STATE *cs, const char *control) +{ + const char *end; + int rel, f_used=0; + struct settings *stack; + + stack= cs->stack; + + if (control[0] == '-' && control[1] == '#') + control+=2; + + rel= control[0] == '+' || control[0] == '-'; + if ((!rel || (!stack->out_file && !stack->next))) + { + FreeState(cs, stack, 0); + stack->flags= 0; + stack->delay= 0; + stack->maxdepth= 0; + stack->sub_level= 0; + stack->out_file= stderr; + stack->prof_file= NULL; + stack->functions= NULL; + stack->p_functions= NULL; + stack->keywords= NULL; + stack->processes= NULL; + } + else if (!stack->out_file) + { + stack->flags= stack->next->flags; + stack->delay= stack->next->delay; + stack->maxdepth= stack->next->maxdepth; + stack->sub_level= stack->next->sub_level; + strcpy(stack->name, stack->next->name); + stack->out_file= stack->next->out_file; + stack->prof_file= stack->next->prof_file; + if (stack->next == &init_settings) + { + /* never share with the global parent - it can change under your feet */ + stack->functions= ListCopy(init_settings.functions); + stack->p_functions= ListCopy(init_settings.p_functions); + stack->keywords= ListCopy(init_settings.keywords); + stack->processes= ListCopy(init_settings.processes); + } + else + { + stack->functions= stack->next->functions; + stack->p_functions= stack->next->p_functions; + stack->keywords= stack->next->keywords; + stack->processes= stack->next->processes; + } + } + + end= DbugStrTok(control); + while (control < end) + { + int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0; + if (sign) control++; + c= *control++; + if (*control == ',') control++; + /* XXX when adding new cases here, don't forget _db_explain_ ! */ + switch (c) { + case 'd': + if (sign < 0 && control == end) + { + if (!is_shared(stack, keywords)) + FreeList(stack->keywords); + stack->keywords=NULL; + stack->flags &= ~DEBUG_ON; + break; + } + if (rel && is_shared(stack, keywords)) + stack->keywords= ListCopy(stack->keywords); + if (sign < 0) + { + if (DEBUGGING) + stack->keywords= ListDel(stack->keywords, control, end); + break; + } + stack->keywords= ListAdd(stack->keywords, control, end); + stack->flags |= DEBUG_ON; + break; + case 'D': + stack->delay= atoi(control); + break; + case 'f': + f_used= 1; + if (sign < 0 && control == end) + { + if (!is_shared(stack,functions)) + FreeList(stack->functions); + stack->functions=NULL; + break; + } + if (rel && is_shared(stack,functions)) + stack->functions= ListCopy(stack->functions); + if (sign < 0) + stack->functions= ListDel(stack->functions, control, end); + else + stack->functions= ListAdd(stack->functions, control, end); + break; + case 'F': + if (sign < 0) + stack->flags &= ~FILE_ON; + else + stack->flags |= FILE_ON; + break; + case 'i': + if (sign < 0) + stack->flags &= ~PID_ON; + else + stack->flags |= PID_ON; + break; +#ifndef THREAD + case 'g': + if (OpenProfile(cs, PROF_FILE)) + { + stack->flags |= PROFILE_ON; + stack->p_functions= ListAdd(stack->p_functions, control, end); + } + break; +#endif + case 'L': + if (sign < 0) + stack->flags &= ~LINE_ON; + else + stack->flags |= LINE_ON; + break; + case 'n': + if (sign < 0) + stack->flags &= ~DEPTH_ON; + else + stack->flags |= DEPTH_ON; + break; + case 'N': + if (sign < 0) + stack->flags &= ~NUMBER_ON; + else + stack->flags |= NUMBER_ON; + break; + case 'A': + case 'O': + stack->flags |= FLUSH_ON_WRITE; + /* fall through */ + case 'a': + case 'o': + if (sign < 0) + { + if (!is_shared(stack, out_file)) + DBUGCloseFile(cs, stack->out_file); + stack->flags &= ~FLUSH_ON_WRITE; + stack->out_file= stderr; + break; + } + if (c == 'a' || c == 'A') + stack->flags |= OPEN_APPEND; + else + stack->flags &= ~OPEN_APPEND; + if (control != end) + DBUGOpenFile(cs, control, end, stack->flags & OPEN_APPEND); + else + DBUGOpenFile(cs, "-",0,0); + break; + case 'p': + if (sign < 0 && control == end) + { + if (!is_shared(stack,processes)) + FreeList(stack->processes); + stack->processes=NULL; + break; + } + if (rel && is_shared(stack, processes)) + stack->processes= ListCopy(stack->processes); + if (sign < 0) + stack->processes= ListDel(stack->processes, control, end); + else + stack->processes= ListAdd(stack->processes, control, end); + break; + case 'P': + if (sign < 0) + stack->flags &= ~PROCESS_ON; + else + stack->flags |= PROCESS_ON; + break; + case 'r': + stack->sub_level= cs->level; + break; + case 't': + if (sign < 0) + { + if (control != end) + stack->maxdepth-= atoi(control); + else + stack->maxdepth= 0; + } + else + { + if (control != end) + stack->maxdepth+= atoi(control); + else + stack->maxdepth= MAXDEPTH; + } + if (stack->maxdepth > 0) + stack->flags |= TRACE_ON; + else + stack->flags &= ~TRACE_ON; + break; + case 'T': + if (sign < 0) + stack->flags &= ~TIMESTAMP_ON; + else + stack->flags |= TIMESTAMP_ON; + break; + case 'S': + if (sign < 0) + stack->flags &= ~SANITY_CHECK_ON; + else + stack->flags |= SANITY_CHECK_ON; + break; + } + if (!*end) + break; + control=end+1; + end= DbugStrTok(control); + } + return !rel || f_used; +} + +#define framep_trace_flag(cs, frp) (frp ? \ + frp->level & TRACE_ON : \ + (ListFlags(cs->stack->functions) & INCLUDE) ? \ + 0 : (uint)TRACE_ON) + +void FixTraceFlags_helper(CODE_STATE *cs, const char *func, + struct _db_stack_frame_ *framep) +{ + if (framep->prev) + FixTraceFlags_helper(cs, framep->func, framep->prev); + + cs->func= func; + cs->level= framep->level & ~TRACE_ON; + framep->level= cs->level | framep_trace_flag(cs, framep->prev); + /* + we don't set cs->framep correctly, even though DoTrace uses it. + It's ok, because cs->framep may only affect DO_TRACE/DONT_TRACE return + values, but we ignore them here anyway + */ + switch(DoTrace(cs)) { + case ENABLE_TRACE: + framep->level|= TRACE_ON; + break; + case DISABLE_TRACE: + framep->level&= ~TRACE_ON; + break; + } +} + +#define fflags(cs) cs->stack->out_file ? ListFlags(cs->stack->functions) : TRACE_ON; + +void FixTraceFlags(uint old_fflags, CODE_STATE *cs) +{ + const char *func; + uint new_fflags, traceon, level; + struct _db_stack_frame_ *framep; + + /* + first (a.k.a. safety) check: + if we haven't started tracing yet, no call stack at all - we're safe. + */ + framep=cs->framep; + if (framep == 0) + return; + + /* + Ok, the tracing has started, call stack isn't empty. + + second check: does the new list have a SUBDIR rule ? + */ + new_fflags=fflags(cs); + if (new_fflags & SUBDIR) + goto yuck; + + /* + Ok, new list doesn't use SUBDIR. + + third check: we do NOT need to re-scan if + neither old nor new lists used SUBDIR flag and if a default behavior + (whether an unlisted function is traced) hasn't changed. + Default behavior depends on whether there're INCLUDE elements in the list. + */ + if (!(old_fflags & SUBDIR) && !((new_fflags^old_fflags) & INCLUDE)) + return; + + /* + Ok, old list may've used SUBDIR, or defaults could've changed. + + fourth check: are we inside a currently active SUBDIR rule ? + go up the call stack, if TRACE_ON flag ever changes its value - we are. + */ + for (traceon=framep->level; framep; framep=framep->prev) + if ((traceon ^ framep->level) & TRACE_ON) + goto yuck; + + /* + Ok, TRACE_ON flag doesn't change in the call stack. + + fifth check: but is the top-most value equal to a default one ? + */ + if (((traceon & TRACE_ON) != 0) == ((new_fflags & INCLUDE) == 0)) + return; + +yuck: + /* + Yuck! function list was changed, and one of the currently active rules + was possibly affected. For example, a tracing could've been enabled or + disabled for a function somewhere up the call stack. + To react correctly, we must go up the call stack all the way to + the top and re-match rules to set TRACE_ON bit correctly. + + We must traverse the stack forwards, not backwards. + That's what a recursive helper is doing. + It'll destroy two CODE_STATE fields, save them now. + */ + func= cs->func; + level= cs->level; + FixTraceFlags_helper(cs, func, cs->framep); + /* now we only need to restore CODE_STATE fields, and we're done */ + cs->func= func; + cs->level= level; +} + +/* + * FUNCTION + * + * _db_set_ set current debugger settings + * + * SYNOPSIS + * + * VOID _db_set_(control) + * char *control; + * + * DESCRIPTION + * + * Given pointer to a debug control string in "control", + * parses the control string, and sets up a current debug + * settings. Pushes a new debug settings if the current is + * set to the initial debugger settings. + * + */ + +void _db_set_(const char *control) +{ + CODE_STATE *cs; + uint old_fflags; + get_code_state_or_return; + old_fflags=fflags(cs); + if (cs->stack == &init_settings) + PushState(cs); + if (DbugParse(cs, control)) + FixTraceFlags(old_fflags, cs); +} + +/* + * FUNCTION + * + * _db_push_ push current debugger settings and set up new one + * + * SYNOPSIS + * + * VOID _db_push_(control) + * char *control; + * + * DESCRIPTION + * + * Given pointer to a debug control string in "control", pushes + * the current debug settings, parses the control string, and sets + * up a new debug settings with DbugParse() + * + */ + +void _db_push_(const char *control) +{ + CODE_STATE *cs; + uint old_fflags; + get_code_state_or_return; + old_fflags=fflags(cs); + PushState(cs); + if (DbugParse(cs, control)) + FixTraceFlags(old_fflags, cs); +} + + +/** + Returns TRUE if session-local settings have been set. +*/ + +int _db_is_pushed_() +{ + CODE_STATE *cs= NULL; + get_code_state_or_return FALSE; + return (cs->stack != &init_settings); +} + +/* + * FUNCTION + * + * _db_set_init_ set initial debugger settings + * + * SYNOPSIS + * + * VOID _db_set_init_(control) + * char *control; + * + * DESCRIPTION + * see _db_set_ + * + */ + +void _db_set_init_(const char *control) +{ + CODE_STATE tmp_cs; + bzero((uchar*) &tmp_cs, sizeof(tmp_cs)); + tmp_cs.stack= &init_settings; + DbugParse(&tmp_cs, control); +} + +/* + * FUNCTION + * + * _db_pop_ pop the debug stack + * + * DESCRIPTION + * + * Pops the debug stack, returning the debug settings to its + * condition prior to the most recent _db_push_ invocation. + * Note that the pop will fail if it would remove the last + * valid settings from the stack. This prevents user errors + * in the push/pop sequence from screwing up the debugger. + * Maybe there should be some kind of warning printed if the + * user tries to pop too many states. + * + */ + +void _db_pop_() +{ + struct settings *discard; + uint old_fflags; + CODE_STATE *cs; + + get_code_state_or_return; + + discard= cs->stack; + if (discard != &init_settings) + { + old_fflags=fflags(cs); + cs->stack= discard->next; + FreeState(cs, discard, 1); + FixTraceFlags(old_fflags, cs); + } +} + +/* + * FUNCTION + * + * _db_explain_ generates 'control' string for the current settings + * + * RETURN + * 0 - ok + * 1 - buffer too short, output truncated + * + */ + +/* helper macros */ +#define char_to_buf(C) do { \ + *buf++=(C); \ + if (buf >= end) goto overflow; \ + } while (0) +#define str_to_buf(S) do { \ + char_to_buf(','); \ + buf=strnmov(buf, (S), len+1); \ + if (buf >= end) goto overflow; \ + } while (0) +#define list_to_buf(l, f) do { \ + struct link *listp=(l); \ + while (listp) \ + { \ + if (listp->flags & (f)) \ + { \ + str_to_buf(listp->str); \ + if (listp->flags & SUBDIR) \ + char_to_buf('/'); \ + } \ + listp=listp->next_link; \ + } \ + } while (0) +#define int_to_buf(i) do { \ + char b[50]; \ + int10_to_str((i), b, 10); \ + str_to_buf(b); \ + } while (0) +#define colon_to_buf do { \ + if (buf != start) char_to_buf(':'); \ + } while(0) +#define op_int_to_buf(C, val, def) do { \ + if ((val) != (def)) \ + { \ + colon_to_buf; \ + char_to_buf((C)); \ + int_to_buf(val); \ + } \ + } while (0) +#define op_intf_to_buf(C, val, def, cond) do { \ + if ((cond)) \ + { \ + colon_to_buf; \ + char_to_buf((C)); \ + if ((val) != (def)) int_to_buf(val); \ + } \ + } while (0) +#define op_str_to_buf(C, val, cond) do { \ + if ((cond)) \ + { \ + char *s=(val); \ + colon_to_buf; \ + char_to_buf((C)); \ + if (*s) str_to_buf(s); \ + } \ + } while (0) +#define op_list_to_buf(C, val, cond) do { \ + if ((cond)) \ + { \ + int f=ListFlags(val); \ + colon_to_buf; \ + char_to_buf((C)); \ + if (f & INCLUDE) \ + list_to_buf(val, INCLUDE); \ + if (f & EXCLUDE) \ + { \ + colon_to_buf; \ + char_to_buf('-'); \ + char_to_buf((C)); \ + list_to_buf(val, EXCLUDE); \ + } \ + } \ + } while (0) +#define op_bool_to_buf(C, cond) do { \ + if ((cond)) \ + { \ + colon_to_buf; \ + char_to_buf((C)); \ + } \ + } while (0) + +int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) +{ + char *start=buf, *end=buf+len-4; + + get_code_state_if_not_set_or_return *buf=0; + + op_list_to_buf('d', cs->stack->keywords, DEBUGGING); + op_int_to_buf ('D', cs->stack->delay, 0); + op_list_to_buf('f', cs->stack->functions, cs->stack->functions); + op_bool_to_buf('F', cs->stack->flags & FILE_ON); + op_bool_to_buf('i', cs->stack->flags & PID_ON); + op_list_to_buf('g', cs->stack->p_functions, PROFILING); + op_bool_to_buf('L', cs->stack->flags & LINE_ON); + op_bool_to_buf('n', cs->stack->flags & DEPTH_ON); + op_bool_to_buf('N', cs->stack->flags & NUMBER_ON); + op_str_to_buf( + ((cs->stack->flags & FLUSH_ON_WRITE ? 0 : 32) | + (cs->stack->flags & OPEN_APPEND ? 'A' : 'O')), + cs->stack->name, cs->stack->out_file != stderr); + op_list_to_buf('p', cs->stack->processes, cs->stack->processes); + op_bool_to_buf('P', cs->stack->flags & PROCESS_ON); + op_bool_to_buf('r', cs->stack->sub_level != 0); + op_intf_to_buf('t', cs->stack->maxdepth, MAXDEPTH, TRACING); + op_bool_to_buf('T', cs->stack->flags & TIMESTAMP_ON); + op_bool_to_buf('S', cs->stack->flags & SANITY_CHECK_ON); + + *buf= '\0'; + return 0; + +overflow: + *end++= '.'; + *end++= '.'; + *end++= '.'; + *end= '\0'; + return 1; +} + +#undef char_to_buf +#undef str_to_buf +#undef list_to_buf +#undef int_to_buf +#undef colon_to_buf +#undef op_int_to_buf +#undef op_intf_to_buf +#undef op_str_to_buf +#undef op_list_to_buf +#undef op_bool_to_buf + +/* + * FUNCTION + * + * _db_explain_init_ explain initial debugger settings + * + * DESCRIPTION + * see _db_explain_ + */ + +int _db_explain_init_(char *buf, size_t len) +{ + CODE_STATE cs; + bzero((uchar*) &cs,sizeof(cs)); + cs.stack=&init_settings; + return _db_explain_(&cs, buf, len); +} + +/* + * FUNCTION + * + * _db_enter_ process entry point to user function + * + * SYNOPSIS + * + * VOID _db_enter_(_func_, _file_, _line_, _stack_frame_) + * char *_func_; points to current function name + * char *_file_; points to current file name + * int _line_; called from source line number + * struct _db_stack_frame_ allocated on the caller's stack + * + * DESCRIPTION + * + * Called at the beginning of each user function to tell + * the debugger that a new function has been entered. + * Note that the pointers to the previous user function + * name and previous user file name are stored on the + * caller's stack (this is why the ENTER macro must be + * the first "executable" code in a function, since it + * allocates these storage locations). The previous nesting + * level is also stored on the callers stack for internal + * self consistency checks. + * + * Also prints a trace line if tracing is enabled and + * increments the current function nesting depth. + * + * Note that this mechanism allows the debugger to know + * what the current user function is at all times, without + * maintaining an internal stack for the function names. + * + */ + +void _db_enter_(const char *_func_, const char *_file_, + uint _line_, struct _db_stack_frame_ *_stack_frame_) +{ + int save_errno; + CODE_STATE *cs; + if (!((cs=code_state()))) + { + _stack_frame_->level= 0; /* Set to avoid valgrind warnings if dbug is enabled later */ + _stack_frame_->prev= 0; + return; + } + save_errno= errno; + + _stack_frame_->func= cs->func; + _stack_frame_->file= cs->file; + cs->func= _func_; + cs->file= _file_; + _stack_frame_->prev= cs->framep; + _stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep); + cs->framep= _stack_frame_; +#ifndef THREAD + if (DoProfile(cs)) + { + long stackused; + if (cs->framep->prev == NULL) + stackused= 0; + else + { + stackused= (char*)(cs->framep->prev) - (char*)(cs->framep); + stackused= stackused > 0 ? stackused : -stackused; + } + (void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func); + (void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused, + AUTOS_REVERSE ? _stack_frame_->func : cs->func); + (void) fflush(cs->stack->prof_file); + } +#endif + switch (DoTrace(cs)) { + case ENABLE_TRACE: + cs->framep->level|= TRACE_ON; + if (!TRACING) break; + /* fall through */ + case DO_TRACE: + if ((cs->stack->flags & SANITY_CHECK_ON) && _sanity(_file_,_line_)) + cs->stack->flags &= ~SANITY_CHECK_ON; + if (TRACING) + { + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + DoPrefix(cs, _line_); + Indent(cs, cs->level); + (void) fprintf(cs->stack->out_file, ">%s\n", cs->func); + DbugFlush(cs); /* This does a unlock */ + } + break; + case DISABLE_TRACE: + cs->framep->level&= ~TRACE_ON; + /* fall through */ + case DONT_TRACE: + break; + } + errno=save_errno; +} + +/* + * FUNCTION + * + * _db_return_ process exit from user function + * + * SYNOPSIS + * + * VOID _db_return_(_line_, _stack_frame_) + * int _line_; current source line number + * struct _db_stack_frame_ allocated on the caller's stack + * + * DESCRIPTION + * + * Called just before user function executes an explicit or implicit + * return. Prints a trace line if trace is enabled, decrements + * the current nesting level, and restores the current function and + * file names from the defunct function's stack. + * + */ + +/* helper macro */ +void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) +{ + int save_errno=errno; + uint _slevel_= _stack_frame_->level & ~TRACE_ON; + CODE_STATE *cs; + get_code_state_or_return; + + if (cs->level != _slevel_) + { + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + (void) fprintf(cs->stack->out_file, ERR_MISSING_RETURN, cs->process, + cs->func); + DbugFlush(cs); + } + else + { +#ifndef THREAD + if (DoProfile(cs)) + (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func); +#endif + if (DoTrace(cs) & DO_TRACE) + { + if ((cs->stack->flags & SANITY_CHECK_ON) && + _sanity(_stack_frame_->file,_line_)) + cs->stack->flags &= ~SANITY_CHECK_ON; + if (TRACING) + { + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + DoPrefix(cs, _line_); + Indent(cs, cs->level); + (void) fprintf(cs->stack->out_file, "<%s\n", cs->func); + DbugFlush(cs); + } + } + } + /* + Check to not set level < 0. This can happen if DBUG was disabled when + function was entered and enabled in function. + */ + cs->level= _slevel_ != 0 ? _slevel_ - 1 : 0; + cs->func= _stack_frame_->func; + cs->file= _stack_frame_->file; + if (cs->framep != NULL) + cs->framep= cs->framep->prev; + errno=save_errno; +} + + +/* + * FUNCTION + * + * _db_pargs_ log arguments for subsequent use by _db_doprnt_() + * + * SYNOPSIS + * + * VOID _db_pargs_(_line_, keyword) + * int _line_; + * char *keyword; + * + * DESCRIPTION + * + * The new universal printing macro DBUG_PRINT, which replaces + * all forms of the DBUG_N macros, needs two calls to runtime + * support routines. The first, this function, remembers arguments + * that are used by the subsequent call to _db_doprnt_(). + * + */ + +void _db_pargs_(uint _line_, const char *keyword) +{ + CODE_STATE *cs; + get_code_state_or_return; + cs->u_line= _line_; + cs->u_keyword= keyword; +} + + +/* + * FUNCTION + * + * _db_doprnt_ handle print of debug lines + * + * SYNOPSIS + * + * VOID _db_doprnt_(format, va_alist) + * char *format; + * va_dcl; + * + * DESCRIPTION + * + * When invoked via one of the DBUG macros, tests the current keyword + * set by calling _db_pargs_() to see if that macro has been selected + * for processing via the debugger control string, and if so, handles + * printing of the arguments via the format string. The line number + * of the DBUG macro in the source is found in u_line. + * + * Note that the format string SHOULD NOT include a terminating + * newline, this is supplied automatically. + * + */ + +#include + +void _db_doprnt_(const char *format,...) +{ + va_list args; + CODE_STATE *cs; + get_code_state_or_return; + + va_start(args,format); + + if (_db_keyword_(cs, cs->u_keyword, 0)) + { + int save_errno=errno; + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + DoPrefix(cs, cs->u_line); + if (TRACING) + Indent(cs, cs->level + 1); + else + (void) fprintf(cs->stack->out_file, "%s: ", cs->func); + (void) fprintf(cs->stack->out_file, "%s: ", cs->u_keyword); + DbugFprintf(cs->stack->out_file, format, args); + DbugFlush(cs); + errno=save_errno; + } + va_end(args); +} + +/* + * fprintf clone with consistent, platform independent output for + * problematic formats like %p, %zd and %lld. + */ +static void DbugFprintf(FILE *stream, const char* format, va_list args) +{ + char cvtbuf[1024]; + size_t len; + len = my_vsnprintf(cvtbuf, sizeof(cvtbuf), format, args); + (void) fprintf(stream, "%s\n", cvtbuf); +} + + +/* + * FUNCTION + * + * _db_dump_ dump a string in hex + * + * SYNOPSIS + * + * void _db_dump_(_line_,keyword,memory,length) + * int _line_; current source line number + * char *keyword; + * char *memory; Memory to print + * int length; Bytes to print + * + * DESCRIPTION + * Dump N characters in a binary array. + * Is used to examine corrputed memory or arrays. + */ + +void _db_dump_(uint _line_, const char *keyword, + const unsigned char *memory, size_t length) +{ + int pos; + char dbuff[90]; + CODE_STATE *cs; + get_code_state_or_return; + + if (_db_keyword_(cs, keyword, 0)) + { + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + DoPrefix(cs, _line_); + if (TRACING) + { + Indent(cs, cs->level + 1); + pos= min(max(cs->level-cs->stack->sub_level,0)*INDENT,80); + } + else + { + fprintf(cs->stack->out_file, "%s: ", cs->func); + } + sprintf(dbuff,"%s: Memory: 0x%lx Bytes: (%ld)\n", + keyword, (ulong) memory, (long) length); + (void) fputs(dbuff,cs->stack->out_file); + + pos=0; + while (length-- > 0) + { + uint tmp= *((unsigned char*) memory++); + if ((pos+=3) >= 80) + { + fputc('\n',cs->stack->out_file); + pos=3; + } + fputc(_dig_vec_upper[((tmp >> 4) & 15)], cs->stack->out_file); + fputc(_dig_vec_upper[tmp & 15], cs->stack->out_file); + fputc(' ',cs->stack->out_file); + } + (void) fputc('\n',cs->stack->out_file); + DbugFlush(cs); + } +} + + +/* + * FUNCTION + * + * ListAddDel modify the list according to debug control string + * + * DESCRIPTION + * + * Given pointer to a comma separated list of strings in "cltp", + * parses the list, and modifies "listp", returning a pointer + * to the new list. + * + * The mode of operation is defined by "todo" parameter. + * + * If it is INCLUDE, elements (strings from "cltp") are added to the + * list, they will have INCLUDE flag set. If the list already contains + * the string in question, new element is not added, but a flag of + * the existing element is adjusted (INCLUDE bit is set, EXCLUDE bit + * is removed). + * + * If it is EXCLUDE, elements are added to the list with the EXCLUDE + * flag set. If the list already contains the string in question, + * it is removed, new element is not added. + */ + +static struct link *ListAddDel(struct link *head, const char *ctlp, + const char *end, int todo) +{ + const char *start; + struct link **cur; + size_t len; + int subdir; + + ctlp--; +next: + while (++ctlp < end) + { + start= ctlp; + subdir=0; + while (ctlp < end && *ctlp != ',') + ctlp++; + len=ctlp-start; + if (start[len-1] == '/') + { + len--; + subdir=SUBDIR; + } + if (len == 0) continue; + for (cur=&head; *cur; cur=&((*cur)->next_link)) + { + if (!strncmp((*cur)->str, start, len)) + { + if ((*cur)->flags & todo) /* same action ? */ + (*cur)->flags|= subdir; /* just merge the SUBDIR flag */ + else if (todo == EXCLUDE) + { + struct link *delme=*cur; + *cur=(*cur)->next_link; + free((void*) delme); + } + else + { + (*cur)->flags&=~(EXCLUDE & SUBDIR); + (*cur)->flags|=INCLUDE | subdir; + } + goto next; + } + } + *cur= (struct link *) DbugMalloc(sizeof(struct link)+len); + memcpy((*cur)->str, start, len); + (*cur)->str[len]=0; + (*cur)->flags=todo | subdir; + (*cur)->next_link=0; + } + return head; +} + +/* + * FUNCTION + * + * ListCopy make a copy of the list + * + * SYNOPSIS + * + * static struct link *ListCopy(orig) + * struct link *orig; + * + * DESCRIPTION + * + * Given pointer to list, which contains a copy of every element from + * the original list. + * + * the orig pointer can be NULL + * + * Note that since each link is added at the head of the list, + * the final list will be in "reverse order", which is not + * significant for our usage here. + * + */ + +static struct link *ListCopy(struct link *orig) +{ + struct link *new_malloc; + struct link *head; + size_t len; + + head= NULL; + while (orig != NULL) + { + len= strlen(orig->str); + new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len); + memcpy(new_malloc->str, orig->str, len); + new_malloc->str[len]= 0; + new_malloc->flags=orig->flags; + new_malloc->next_link= head; + head= new_malloc; + orig= orig->next_link; + } + return head; +} + +/* + * FUNCTION + * + * InList test a given string for member of a given list + * + * DESCRIPTION + * + * Tests the string pointed to by "cp" to determine if it is in + * the list pointed to by "linkp". Linkp points to the first + * link in the list. If linkp is NULL or contains only EXCLUDE + * elements then the string is treated as if it is in the list. + * This may seem rather strange at first but leads to the desired + * operation if no list is given. The net effect is that all + * strings will be accepted when there is no list, and when there + * is a list, only those strings in the list will be accepted. + * + * RETURN + * combination of SUBDIR, INCLUDE, EXCLUDE, MATCHED flags + * + */ + +static int InList(struct link *linkp, const char *cp) +{ + int result; + + for (result=MATCHED; linkp != NULL; linkp= linkp->next_link) + { + if (!fnmatch(linkp->str, cp, 0)) + return linkp->flags; + if (!(linkp->flags & EXCLUDE)) + result=NOT_MATCHED; + if (linkp->flags & SUBDIR) + result|=SUBDIR; + } + return result; +} + +/* + * FUNCTION + * + * ListFlags returns aggregated list flags (ORed over all elements) + * + */ + +static uint ListFlags(struct link *linkp) +{ + uint f; + for (f=0; linkp != NULL; linkp= linkp->next_link) + f|= linkp->flags; + return f; +} + +/* + * FUNCTION + * + * PushState push current settings onto stack and set up new one + * + * SYNOPSIS + * + * static VOID PushState() + * + * DESCRIPTION + * + * Pushes the current settings on the settings stack, and creates + * a new settings. The new settings is NOT initialized + * + * The settings stack is a linked list of settings, with the new + * settings added at the head. This allows the stack to grow + * to the limits of memory if necessary. + * + */ + +static void PushState(CODE_STATE *cs) +{ + struct settings *new_malloc; + + new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings)); + bzero(new_malloc, sizeof(*new_malloc)); + new_malloc->next= cs->stack; + cs->stack= new_malloc; +} + +/* + * FUNCTION + * + * FreeState Free memory associated with a struct state. + * + * SYNOPSIS + * + * static void FreeState (state) + * struct state *state; + * int free_state; + * + * DESCRIPTION + * + * Deallocates the memory allocated for various information in a + * state. If free_state is set, also free 'state' + * + */ +static void FreeState(CODE_STATE *cs, struct settings *state, int free_state) +{ + if (!is_shared(state, keywords)) + FreeList(state->keywords); + if (!is_shared(state, functions)) + FreeList(state->functions); + if (!is_shared(state, processes)) + FreeList(state->processes); + if (!is_shared(state, p_functions)) + FreeList(state->p_functions); + + if (!is_shared(state, out_file)) + DBUGCloseFile(cs, state->out_file); + else + (void) fflush(state->out_file); + + if (!is_shared(state, prof_file)) + DBUGCloseFile(cs, state->prof_file); + else + (void) fflush(state->prof_file); + + if (free_state) + free((void*) state); +} + + +/* + * FUNCTION + * + * _db_end_ End debugging, freeing state stack memory. + * + * SYNOPSIS + * + * static VOID _db_end_ () + * + * DESCRIPTION + * + * Ends debugging, de-allocating the memory allocated to the + * state stack. + * + * To be called at the very end of the program. + * + */ +void _db_end_() +{ + struct settings *discard; + static struct settings tmp; + CODE_STATE *cs; + /* + Set _dbug_on_ to be able to do full reset even when DEBUGGER_OFF was + called after dbug was initialized + */ + _dbug_on_= 1; + get_code_state_or_return; + + while ((discard= cs->stack)) + { + if (discard == &init_settings) + break; + cs->stack= discard->next; + FreeState(cs, discard, 1); + } + tmp= init_settings; + + /* Use mutex lock to make it less likely anyone access out_file */ + pthread_mutex_lock(&THR_LOCK_dbug); + init_settings.flags= OPEN_APPEND; + init_settings.out_file= stderr; + init_settings.prof_file= stderr; + init_settings.maxdepth= 0; + init_settings.delay= 0; + init_settings.sub_level= 0; + init_settings.functions= 0; + init_settings.p_functions= 0; + init_settings.keywords= 0; + init_settings.processes= 0; + pthread_mutex_unlock(&THR_LOCK_dbug); + FreeState(cs, &tmp, 0); +} + + +/* + * FUNCTION + * + * DoTrace check to see if tracing is current enabled + * + * DESCRIPTION + * + * Checks to see if dbug in this function is enabled based on + * whether the maximum trace depth has been reached, the current + * function is selected, and the current process is selected. + * + */ + +static int DoTrace(CODE_STATE *cs) +{ + if ((cs->stack->maxdepth == 0 || cs->level <= cs->stack->maxdepth) && + InList(cs->stack->processes, cs->process) & (MATCHED|INCLUDE)) + switch(InList(cs->stack->functions, cs->func)) { + case INCLUDE|SUBDIR: return ENABLE_TRACE; + case INCLUDE: return DO_TRACE; + case MATCHED|SUBDIR: + case NOT_MATCHED|SUBDIR: + case MATCHED: return framep_trace_flag(cs, cs->framep) ? + DO_TRACE : DONT_TRACE; + case EXCLUDE: + case NOT_MATCHED: return DONT_TRACE; + case EXCLUDE|SUBDIR: return DISABLE_TRACE; + } + return DONT_TRACE; +} + + +/* + * FUNCTION + * + * DoProfile check to see if profiling is current enabled + * + * SYNOPSIS + * + * static BOOLEAN DoProfile() + * + * DESCRIPTION + * + * Checks to see if profiling is enabled based on whether the + * user has specified profiling, the maximum trace depth has + * not yet been reached, the current function is selected, + * and the current process is selected. Returns TRUE if + * profiling is enabled, FALSE otherwise. + * + */ + +#ifndef THREAD +static BOOLEAN DoProfile(CODE_STATE *cs) +{ + return PROFILING && + cs->level <= cs->stack->maxdepth && + InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) && + InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED); +} +#endif + +FILE *_db_fp_(void) +{ + CODE_STATE *cs; + get_code_state_or_return NULL; + return cs->stack->out_file; +} + +/* + * FUNCTION + * + * _db_keyword_ test keyword for member of keyword list + * + * DESCRIPTION + * + * Test a keyword to determine if it is in the currently active + * keyword list. If strict=0, a keyword is accepted + * if the list is null, otherwise it must match one of the list + * members. When debugging is not on, no keywords are accepted. + * After the maximum trace level is exceeded, no keywords are + * accepted (this behavior subject to change). Additionally, + * the current function and process must be accepted based on + * their respective lists. + * + * Returns TRUE if keyword accepted, FALSE otherwise. + * + */ + +BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict) +{ + get_code_state_if_not_set_or_return FALSE; + strict=strict ? INCLUDE : INCLUDE|MATCHED; + + return DEBUGGING && DoTrace(cs) & DO_TRACE && + InList(cs->stack->keywords, keyword) & strict; +} + +/* + * FUNCTION + * + * Indent indent a line to the given indentation level + * + * SYNOPSIS + * + * static VOID Indent(indent) + * int indent; + * + * DESCRIPTION + * + * Indent a line to the given level. Note that this is + * a simple minded but portable implementation. + * There are better ways. + * + * Also, the indent must be scaled by the compile time option + * of character positions per nesting level. + * + */ + +static void Indent(CODE_STATE *cs, int indent) +{ + REGISTER int count; + + indent= max(indent-1-cs->stack->sub_level,0)*INDENT; + for (count= 0; count < indent ; count++) + { + if ((count % INDENT) == 0) + fputc('|',cs->stack->out_file); + else + fputc(' ',cs->stack->out_file); + } +} + + +/* + * FUNCTION + * + * FreeList free all memory associated with a linked list + * + * SYNOPSIS + * + * static VOID FreeList(linkp) + * struct link *linkp; + * + * DESCRIPTION + * + * Given pointer to the head of a linked list, frees all + * memory held by the list and the members of the list. + * + */ + +static void FreeList(struct link *linkp) +{ + REGISTER struct link *old; + + while (linkp != NULL) + { + old= linkp; + linkp= linkp->next_link; + free((void*) old); + } +} + + +/* + * FUNCTION + * + * DoPrefix print debugger line prefix prior to indentation + * + * SYNOPSIS + * + * static VOID DoPrefix(_line_) + * int _line_; + * + * DESCRIPTION + * + * Print prefix common to all debugger output lines, prior to + * doing indentation if necessary. Print such information as + * current process name, current source file name and line number, + * and current function nesting depth. + * + */ + +static void DoPrefix(CODE_STATE *cs, uint _line_) +{ + cs->lineno++; + if (cs->stack->flags & PID_ON) + { +#ifdef THREAD + (void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name()); +#else + (void) fprintf(cs->stack->out_file, "%5d: ", (int) getpid()); +#endif + } + if (cs->stack->flags & NUMBER_ON) + (void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno); + if (cs->stack->flags & TIMESTAMP_ON) + { +#ifdef __WIN__ + /* FIXME This doesn't give microseconds as in Unix case, and the resolution is + in system ticks, 10 ms intervals. See my_getsystime.c for high res */ + SYSTEMTIME loc_t; + GetLocalTime(&loc_t); + (void) fprintf (cs->stack->out_file, + /* "%04d-%02d-%02d " */ + "%02d:%02d:%02d.%06d ", + /*tm_p->tm_year + 1900, tm_p->tm_mon + 1, tm_p->tm_mday,*/ + loc_t.wHour, loc_t.wMinute, loc_t.wSecond, loc_t.wMilliseconds); +#else + struct timeval tv; + struct tm *tm_p; + if (gettimeofday(&tv, NULL) != -1) + { + if ((tm_p= localtime((const time_t *)&tv.tv_sec))) + { + (void) fprintf (cs->stack->out_file, + /* "%04d-%02d-%02d " */ + "%02d:%02d:%02d.%06d ", + /*tm_p->tm_year + 1900, tm_p->tm_mon + 1, tm_p->tm_mday,*/ + tm_p->tm_hour, tm_p->tm_min, tm_p->tm_sec, + (int) (tv.tv_usec)); + } + } +#endif + } + if (cs->stack->flags & PROCESS_ON) + (void) fprintf(cs->stack->out_file, "%s: ", cs->process); + if (cs->stack->flags & FILE_ON) + (void) fprintf(cs->stack->out_file, "%14s: ", BaseName(cs->file)); + if (cs->stack->flags & LINE_ON) + (void) fprintf(cs->stack->out_file, "%5d: ", _line_); + if (cs->stack->flags & DEPTH_ON) + (void) fprintf(cs->stack->out_file, "%4d: ", cs->level); +} + + +/* + * FUNCTION + * + * DBUGOpenFile open new output stream for debugger output + * + * SYNOPSIS + * + * static VOID DBUGOpenFile(name) + * char *name; + * + * DESCRIPTION + * + * Given name of a new file (or "-" for stdout) opens the file + * and sets the output stream to the new file. + * + */ + +static void DBUGOpenFile(CODE_STATE *cs, + const char *name,const char *end,int append) +{ + REGISTER FILE *fp; + REGISTER BOOLEAN newfile; + + if (name != NULL) + { + if (end) + { + size_t len=end-name; + memcpy(cs->stack->name, name, len); + cs->stack->name[len]=0; + } + else + strmov(cs->stack->name,name); + name=cs->stack->name; + if (strcmp(name, "-") == 0) + { + cs->stack->out_file= stdout; + cs->stack->flags |= FLUSH_ON_WRITE; + cs->stack->name[0]=0; + } + else + { + if (!Writable(name)) + { + (void) fprintf(stderr, ERR_OPEN, cs->process, name); + perror(""); + fflush(stderr); + } + else + { + newfile= !EXISTS(name); + if (!(fp= fopen(name, append ? "a+" : "w"))) + { + (void) fprintf(stderr, ERR_OPEN, cs->process, name); + perror(""); + fflush(stderr); + } + else + { + cs->stack->out_file= fp; + if (newfile) + { + ChangeOwner(cs, name); + } + } + } + } + } +} + + +/* + * FUNCTION + * + * OpenProfile open new output stream for profiler output + * + * SYNOPSIS + * + * static FILE *OpenProfile(name) + * char *name; + * + * DESCRIPTION + * + * Given name of a new file, opens the file + * and sets the profiler output stream to the new file. + * + * It is currently unclear whether the prefered behavior is + * to truncate any existing file, or simply append to it. + * The latter behavior would be desirable for collecting + * accumulated runtime history over a number of separate + * runs. It might take some changes to the analyzer program + * though, and the notes that Binayak sent with the profiling + * diffs indicated that append was the normal mode, but this + * does not appear to agree with the actual code. I haven't + * investigated at this time [fnf; 24-Jul-87]. + */ + +#ifndef THREAD +static FILE *OpenProfile(CODE_STATE *cs, const char *name) +{ + REGISTER FILE *fp; + REGISTER BOOLEAN newfile; + + fp=0; + if (!Writable(name)) + { + (void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name); + perror(""); + (void) Delay(cs->stack->delay); + } + else + { + newfile= !EXISTS(name); + if (!(fp= fopen(name, "w"))) + { + (void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name); + perror(""); + } + else + { + cs->stack->prof_file= fp; + if (newfile) + { + ChangeOwner(cs, name); + } + } + } + return fp; +} +#endif + +/* + * FUNCTION + * + * DBUGCloseFile close the debug output stream + * + * SYNOPSIS + * + * static VOID DBUGCloseFile(fp) + * FILE *fp; + * + * DESCRIPTION + * + * Closes the debug output stream unless it is standard output + * or standard error. + * + */ + +static void DBUGCloseFile(CODE_STATE *cs, FILE *fp) +{ + if (fp && fp != stderr && fp != stdout && fclose(fp) == EOF) + { + pthread_mutex_lock(&THR_LOCK_dbug); + (void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process); + perror(""); + DbugFlush(cs); + } +} + + +/* + * FUNCTION + * + * DbugExit print error message and exit + * + * SYNOPSIS + * + * static VOID DbugExit(why) + * char *why; + * + * DESCRIPTION + * + * Prints error message using current process name, the reason for + * aborting (typically out of memory), and exits with status 1. + * This should probably be changed to use a status code + * defined in the user's debugger include file. + * + */ + +static void DbugExit(const char *why) +{ + CODE_STATE *cs=code_state(); + (void) fprintf(stderr, ERR_ABORT, cs ? cs->process : "(null)", why); + (void) fflush(stderr); + exit(1); +} + + +/* + * FUNCTION + * + * DbugMalloc allocate memory for debugger runtime support + * + * SYNOPSIS + * + * static long *DbugMalloc(size) + * int size; + * + * DESCRIPTION + * + * Allocate more memory for debugger runtime support functions. + * Failure to to allocate the requested number of bytes is + * immediately fatal to the current process. This may be + * rather unfriendly behavior. It might be better to simply + * print a warning message, freeze the current debugger cs, + * and continue execution. + * + */ + +static char *DbugMalloc(size_t size) +{ + register char *new_malloc; + + if (!(new_malloc= (char*) malloc(size))) + DbugExit("out of memory"); + return new_malloc; +} + + +/* + * strtok lookalike - splits on ':', magically handles ::, :\ and :/ + */ + +static const char *DbugStrTok(const char *s) +{ + while (s[0] && (s[0] != ':' || + (s[1] == '\\' || s[1] == '/' || (s[1] == ':' && s++)))) + s++; + return s; +} + + +/* + * FUNCTION + * + * BaseName strip leading pathname components from name + * + * SYNOPSIS + * + * static char *BaseName(pathname) + * char *pathname; + * + * DESCRIPTION + * + * Given pointer to a complete pathname, locates the base file + * name at the end of the pathname and returns a pointer to + * it. + * + */ + +static const char *BaseName(const char *pathname) +{ + register const char *base; + + base= strrchr(pathname, FN_LIBCHAR); + if (base++ == NullS) + base= pathname; + return base; +} + + +/* + * FUNCTION + * + * Writable test to see if a pathname is writable/creatable + * + * SYNOPSIS + * + * static BOOLEAN Writable(pathname) + * char *pathname; + * + * DESCRIPTION + * + * Because the debugger might be linked in with a program that + * runs with the set-uid-bit (suid) set, we have to be careful + * about opening a user named file for debug output. This consists + * of checking the file for write access with the real user id, + * or checking the directory where the file will be created. + * + * Returns TRUE if the user would normally be allowed write or + * create access to the named file. Returns FALSE otherwise. + * + */ + + +#ifndef Writable + +static BOOLEAN Writable(const char *pathname) +{ + REGISTER BOOLEAN granted; + REGISTER char *lastslash; + + granted= FALSE; + if (EXISTS(pathname)) + { + if (WRITABLE(pathname)) + granted= TRUE; + } + else + { + lastslash= strrchr(pathname, '/'); + if (lastslash != NULL) + *lastslash= '\0'; + else + pathname= "."; + if (WRITABLE(pathname)) + granted= TRUE; + if (lastslash != NULL) + *lastslash= '/'; + } + return granted; +} +#endif + + +/* + * FUNCTION + * + * ChangeOwner change owner to real user for suid programs + * + * SYNOPSIS + * + * static VOID ChangeOwner(pathname) + * + * DESCRIPTION + * + * For unix systems, change the owner of the newly created debug + * file to the real owner. This is strictly for the benefit of + * programs that are running with the set-user-id bit set. + * + * Note that at this point, the fact that pathname represents + * a newly created file has already been established. If the + * program that the debugger is linked to is not running with + * the suid bit set, then this operation is redundant (but + * harmless). + * + */ + +#ifndef ChangeOwner +static void ChangeOwner(CODE_STATE *cs, char *pathname) +{ + if (chown(pathname, getuid(), getgid()) == -1) + { + (void) fprintf(stderr, ERR_CHOWN, cs->process, pathname); + perror(""); + (void) fflush(stderr); + } +} +#endif + + +/* + * FUNCTION + * + * _db_setjmp_ save debugger environment + * + * SYNOPSIS + * + * VOID _db_setjmp_() + * + * DESCRIPTION + * + * Invoked as part of the user's DBUG_SETJMP macro to save + * the debugger environment in parallel with saving the user's + * environment. + * + */ + +#ifdef HAVE_LONGJMP + +EXPORT void _db_setjmp_() +{ + CODE_STATE *cs; + get_code_state_or_return; + + cs->jmplevel= cs->level; + cs->jmpfunc= cs->func; + cs->jmpfile= cs->file; +} + +/* + * FUNCTION + * + * _db_longjmp_ restore previously saved debugger environment + * + * SYNOPSIS + * + * VOID _db_longjmp_() + * + * DESCRIPTION + * + * Invoked as part of the user's DBUG_LONGJMP macro to restore + * the debugger environment in parallel with restoring the user's + * previously saved environment. + * + */ + +EXPORT void _db_longjmp_() +{ + CODE_STATE *cs; + get_code_state_or_return; + + cs->level= cs->jmplevel; + if (cs->jmpfunc) + cs->func= cs->jmpfunc; + if (cs->jmpfile) + cs->file= cs->jmpfile; +} +#endif + +/* + * FUNCTION + * + * perror perror simulation for systems that don't have it + * + * SYNOPSIS + * + * static VOID perror(s) + * char *s; + * + * DESCRIPTION + * + * Perror produces a message on the standard error stream which + * provides more information about the library or system error + * just encountered. The argument string s is printed, followed + * by a ':', a blank, and then a message and a newline. + * + * An undocumented feature of the unix perror is that if the string + * 's' is a null string (NOT a NULL pointer!), then the ':' and + * blank are not printed. + * + * This version just complains about an "unknown system error". + * + */ + +#ifndef HAVE_PERROR +static void perror(s) +char *s; +{ + if (s && *s != '\0') + (void) fprintf(stderr, "%s: ", s); + (void) fprintf(stderr, "\n"); +} +#endif /* HAVE_PERROR */ + + + /* flush dbug-stream, free mutex lock & wait delay */ + /* This is because some systems (MSDOS!!) dosn't flush fileheader */ + /* and dbug-file isn't readable after a system crash !! */ + +static void DbugFlush(CODE_STATE *cs) +{ + if (cs->stack->flags & FLUSH_ON_WRITE) + { + (void) fflush(cs->stack->out_file); + if (cs->stack->delay) + (void) Delay(cs->stack->delay); + } + if (!cs->locked) + pthread_mutex_unlock(&THR_LOCK_dbug); +} /* DbugFlush */ + + +/* For debugging */ + +void _db_flush_() +{ + CODE_STATE *cs; + get_code_state_or_return; + (void) fflush(cs->stack->out_file); +} + + +void _db_lock_file_() +{ + CODE_STATE *cs; + get_code_state_or_return; + pthread_mutex_lock(&THR_LOCK_dbug); + cs->locked=1; +} + +void _db_unlock_file_() +{ + CODE_STATE *cs; + get_code_state_or_return; + cs->locked=0; + pthread_mutex_unlock(&THR_LOCK_dbug); +} + +/* + * Here we need the definitions of the clock routine. Add your + * own for whatever system that you have. + */ + +#ifndef THREAD +#if defined(HAVE_GETRUSAGE) + +#include +#include + +/* extern int getrusage(int, struct rusage *); */ + +/* + * Returns the user time in milliseconds used by this process so + * far. + */ + +static unsigned long Clock() +{ + struct rusage ru; + + (void) getrusage(RUSAGE_SELF, &ru); + return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000; +} + +#elif defined(MSDOS) || defined(__WIN__) + +static ulong Clock() +{ + return clock()*(1000/CLOCKS_PER_SEC); +} +#elif defined(amiga) + +struct DateStamp { /* Yes, this is a hack, but doing it right */ + long ds_Days; /* is incredibly ugly without splitting this */ + long ds_Minute; /* off into a separate file */ + long ds_Tick; +}; + +static int first_clock= TRUE; +static struct DateStamp begin; +static struct DateStamp elapsed; + +static unsigned long Clock() +{ + register struct DateStamp *now; + register unsigned long millisec= 0; + extern VOID *AllocMem(); + + now= (struct DateStamp *) AllocMem((long) sizeof(struct DateStamp), 0L); + if (now != NULL) + { + if (first_clock == TRUE) + { + first_clock= FALSE; + (void) DateStamp(now); + begin= *now; + } + (void) DateStamp(now); + millisec= 24 * 3600 * (1000 / HZ) * (now->ds_Days - begin.ds_Days); + millisec += 60 * (1000 / HZ) * (now->ds_Minute - begin.ds_Minute); + millisec += (1000 / HZ) * (now->ds_Tick - begin.ds_Tick); + (void) FreeMem(now, (long) sizeof(struct DateStamp)); + } + return millisec; +} +#else +static unsigned long Clock() +{ + return 0; +} +#endif /* RUSAGE */ +#endif /* THREADS */ + +#ifdef NO_VARARGS + +/* + * Fake vfprintf for systems that don't support it. If this + * doesn't work, you are probably SOL... + */ + +static int vfprintf(stream, format, ap) +FILE *stream; +char *format; +va_list ap; +{ + int rtnval; + ARGS_DCL; + + ARG0= va_arg(ap, ARGS_TYPE); + ARG1= va_arg(ap, ARGS_TYPE); + ARG2= va_arg(ap, ARGS_TYPE); + ARG3= va_arg(ap, ARGS_TYPE); + ARG4= va_arg(ap, ARGS_TYPE); + ARG5= va_arg(ap, ARGS_TYPE); + ARG6= va_arg(ap, ARGS_TYPE); + ARG7= va_arg(ap, ARGS_TYPE); + ARG8= va_arg(ap, ARGS_TYPE); + ARG9= va_arg(ap, ARGS_TYPE); + rtnval= fprintf(stream, format, ARGS_LIST); + return rtnval; +} + +#endif /* NO_VARARGS */ + +#else + +/* + * Dummy function, workaround for MySQL bug#14420 related + * build failure on a platform where linking with an empty + * archive fails. + * + * This block can be removed as soon as a fix for bug#14420 + * is implemented. + */ +int i_am_a_dummy_function() { + return 0; +} + +#endif diff --git a/externals/mysql/extlib/dbug/dbug_analyze.c b/externals/mysql/extlib/dbug/dbug_analyze.c new file mode 100644 index 00000000000..3263b2ccc59 --- /dev/null +++ b/externals/mysql/extlib/dbug/dbug_analyze.c @@ -0,0 +1,726 @@ +/* + * Analyze the profile file (cmon.out) written out by the dbug + * routines with profiling enabled. + * + * Copyright June 1987, Binayak Banerjee + * All rights reserved. + * + * This program may be freely distributed under the same terms and + * conditions as Fred Fish's Dbug package. + * + * Compile with -- cc -O -s -o %s analyze.c + * + * Analyze will read an trace file created by the dbug package + * (when run with traceing enabled). It will then produce a + * summary on standard output listing the name of each traced + * function, the number of times it was called, the percentage + * of total calls, the time spent executing the function, the + * proportion of the total time and the 'importance'. The last + * is a metric which is obtained by multiplying the proportions + * of calls and the proportions of time for each function. The + * greater the importance, the more likely it is that a speedup + * could be obtained by reducing the time taken by that function. + * + * Note that the timing values that you obtain are only rough + * measures. The overhead of the dbug package is included + * within. However, there is no need to link in special profiled + * libraries and the like. + * + * CHANGES: + * + * 2-Mar-89: fnf + * Changes to support tracking of stack usage. This required + * reordering the fields in the profile log file to make + * parsing of different record types easier. Corresponding + * changes made in dbug runtime library. Also used this + * opportunity to reformat the code more to my liking (my + * apologies to Binayak Banerjee for "uglifying" his code). + * + * 24-Jul-87: fnf + * Because I tend to use functions names like + * "ExternalFunctionDoingSomething", I've rearranged the + * printout to put the function name last in each line, so + * long names don't screw up the formatting unless they are + * *very* long and wrap around the screen width... + * + * 24-Jul-87: fnf + * Modified to put out table very similar to Unix profiler + * by default, but also puts out original verbose table + * if invoked with -v flag. + */ + +#include +#include +#include + +static char *my_name; +static int verbose; + +/* + * Structure of the stack. + */ + +#define PRO_FILE "dbugmon.out" /* Default output file name */ +#define STACKSIZ 100 /* Maximum function nesting */ +#define MAXPROCS 10000 /* Maximum number of function calls */ + +# ifdef BSD +# include +# else +# define EX_SOFTWARE 1 +# define EX_DATAERR 1 +# define EX_USAGE 1 +# define EX_OSERR 1 +# define EX_IOERR 1 +#ifndef EX_OK +# define EX_OK 0 +#endif +# endif + +#define __MERF_OO_ "%s: Malloc Failed in %s: %d\n" + +#define MALLOC(Ptr,Num,Typ) do /* Malloc w/error checking & exit */ \ + if (!(Ptr = (Typ *)malloc((Num)*(sizeof(Typ))))) \ + {fprintf(stderr,__MERF_OO_,my_name,__FILE__,__LINE__);\ + exit(EX_OSERR);} while(0) + +#define Malloc(Ptr,Num,Typ) do /* Weaker version of above */\ + if (!(Ptr = (Typ *)malloc((Num)*(sizeof(Typ))))) \ + fprintf(stderr,__MERF_OO_,my_name,__FILE__,__LINE__);\ + while(0) + +#define FILEOPEN(Fp,Fn,Mod) do /* File open with error exit */ \ + if (!(Fp = fopen(Fn,Mod)))\ + {fprintf(stderr,"%s: Couldn't open %s\n",my_name,Fn);\ + exit(EX_IOERR);} while(0) + +#define Fileopen(Fp,Fn,Mod) do /* Weaker version of above */ \ + if(!(Fp = fopen(Fn,Mod))) \ + fprintf(stderr,"%s: Couldn't open %s\n",my_name,Fn);\ + while(0) + + +struct stack_t { + unsigned int pos; /* which function? */ + unsigned long time; /* Time that this was entered */ + unsigned long children; /* Time spent in called funcs */ +}; + +static struct stack_t fn_stack[STACKSIZ+1]; + +static unsigned int stacktop = 0; /* Lowest stack position is a dummy */ + +static unsigned long tot_time = 0; +static unsigned long tot_calls = 0; +static unsigned long highstack = 0; +static unsigned long lowstack = (ulong) ~0; + +/* + * top() returns a pointer to the top item on the stack. + * (was a function, now a macro) + */ + +#define top() &fn_stack[stacktop] + +/* + * Push - Push the given record on the stack. + */ + +void push (name_pos, time_entered) +register unsigned int name_pos; +register unsigned long time_entered; +{ + register struct stack_t *t; + + DBUG_ENTER("push"); + if (++stacktop > STACKSIZ) { + fprintf (DBUG_FILE,"%s: stack overflow (%s:%d)\n", + my_name, __FILE__, __LINE__); + exit (EX_SOFTWARE); + } + DBUG_PRINT ("push", ("%d %ld",name_pos,time_entered)); + t = &fn_stack[stacktop]; + t -> pos = name_pos; + t -> time = time_entered; + t -> children = 0; + DBUG_VOID_RETURN; +} + +/* + * Pop - pop the top item off the stack, assigning the field values + * to the arguments. Returns 0 on stack underflow, or on popping first + * item off stack. + */ + +unsigned int pop (name_pos, time_entered, child_time) +register unsigned int *name_pos; +register unsigned long *time_entered; +register unsigned long *child_time; +{ + register struct stack_t *temp; + register unsigned int rtnval; + + DBUG_ENTER ("pop"); + + if (stacktop < 1) { + rtnval = 0; + } else { + temp = &fn_stack[stacktop]; + *name_pos = temp->pos; + *time_entered = temp->time; + *child_time = temp->children; + DBUG_PRINT ("pop", ("%d %lu %lu",*name_pos,*time_entered,*child_time)); + rtnval = stacktop--; + } + DBUG_RETURN (rtnval); +} + +/* + * We keep the function info in another array (serves as a simple + * symbol table) + */ + +struct module_t { + char *name; + unsigned long m_time; + unsigned long m_calls; + unsigned long m_stkuse; +}; + +static struct module_t modules[MAXPROCS]; + +/* + * We keep a binary search tree in order to look up function names + * quickly (and sort them at the end. + */ + +struct bnode { + unsigned int lchild; /* Index of left subtree */ + unsigned int rchild; /* Index of right subtree */ + unsigned int pos; /* Index of module_name entry */ +}; + +static struct bnode s_table[MAXPROCS]; + +static unsigned int n_items = 0; /* No. of items in the array so far */ + +/* + * Need a function to allocate space for a string and squirrel it away. + */ + +char *strsave (s) +char *s; +{ + register char *retval; + register unsigned int len; + + DBUG_ENTER ("strsave"); + DBUG_PRINT ("strsave", ("%s",s)); + if (!s || (len = strlen (s)) == 0) { + DBUG_RETURN (0); + } + MALLOC (retval, ++len, char); + strcpy (retval, s); + DBUG_RETURN (retval); +} + +/* + * add() - adds m_name to the table (if not already there), and returns + * the index of its location in the table. Checks s_table (which is a + * binary search tree) to see whether or not it should be added. + */ + +unsigned int add (m_name) +char *m_name; +{ + register unsigned int ind = 0; + register int cmp; + + DBUG_ENTER ("add"); + if (n_items == 0) { /* First item to be added */ + s_table[0].pos = ind; + s_table[0].lchild = s_table[0].rchild = MAXPROCS; + addit: + modules[n_items].name = strsave (m_name); + modules[n_items].m_time = 0; + modules[n_items].m_calls = 0; + modules[n_items].m_stkuse = 0; + DBUG_RETURN (n_items++); + } + while ((cmp = strcmp (m_name,modules[ind].name))) { + if (cmp < 0) { /* In left subtree */ + if (s_table[ind].lchild == MAXPROCS) { + /* Add as left child */ + if (n_items >= MAXPROCS) { + fprintf (DBUG_FILE, + "%s: Too many functions being profiled\n", + my_name); + exit (EX_SOFTWARE); + } + s_table[n_items].pos = s_table[ind].lchild = n_items; + s_table[n_items].lchild = s_table[n_items].rchild = MAXPROCS; +#ifdef notdef + modules[n_items].name = strsave (m_name); + modules[n_items].m_time = modules[n_items].m_calls = 0; + DBUG_RETURN (n_items++); +#else + goto addit; +#endif + + } + ind = s_table[ind].lchild; /* else traverse l-tree */ + } else { + if (s_table[ind].rchild == MAXPROCS) { + /* Add as right child */ + if (n_items >= MAXPROCS) { + fprintf (DBUG_FILE, + "%s: Too many functions being profiled\n", + my_name); + exit (EX_SOFTWARE); + } + s_table[n_items].pos = s_table[ind].rchild = n_items; + s_table[n_items].lchild = s_table[n_items].rchild = MAXPROCS; +#ifdef notdef + modules[n_items].name = strsave (m_name); + modules[n_items].m_time = modules[n_items].m_calls = 0; + DBUG_RETURN (n_items++); +#else + goto addit; +#endif + + } + ind = s_table[ind].rchild; /* else traverse r-tree */ + } + } + DBUG_RETURN (ind); +} + +/* + * process() - process the input file, filling in the modules table. + */ + +void process (inf) +FILE *inf; +{ + char buf[BUFSIZ]; + char fn_name[64]; /* Max length of fn_name */ + unsigned long fn_time; + unsigned long fn_sbot; + unsigned long fn_ssz; + unsigned long lastuse; + unsigned int pos; + unsigned long local_time; + unsigned int oldpos; + unsigned long oldtime; + unsigned long oldchild; + struct stack_t *t; + + DBUG_ENTER ("process"); + while (fgets (buf,BUFSIZ,inf) != NULL) { + switch (buf[0]) { + case 'E': + sscanf (buf+2, "%ld %64s", &fn_time, fn_name); + DBUG_PRINT ("erec", ("%ld %s", fn_time, fn_name)); + pos = add (fn_name); + push (pos, fn_time); + break; + case 'X': + sscanf (buf+2, "%ld %64s", &fn_time, fn_name); + DBUG_PRINT ("xrec", ("%ld %s", fn_time, fn_name)); + pos = add (fn_name); + /* + * An exited function implies that all stacked + * functions are also exited, until the matching + * function is found on the stack. + */ + while (pop (&oldpos, &oldtime, &oldchild)) { + DBUG_PRINT ("popped", ("%lu %lu", oldtime, oldchild)); + local_time = fn_time - oldtime; + t = top (); + t -> children += local_time; + DBUG_PRINT ("update", ("%s", modules[t -> pos].name)); + DBUG_PRINT ("update", ("%lu", t -> children)); + local_time -= oldchild; + modules[oldpos].m_time += local_time; + modules[oldpos].m_calls++; + tot_time += local_time; + tot_calls++; + if (pos == oldpos) { + goto next_line; /* Should be a break2 */ + } + } + /* + * Assume that item seen started at time 0. + * (True for function main). But initialize + * it so that it works the next time too. + */ + t = top (); + local_time = fn_time - t -> time - t -> children; + t -> time = fn_time; t -> children = 0; + modules[pos].m_time += local_time; + modules[pos].m_calls++; + tot_time += local_time; + tot_calls++; + break; + case 'S': + sscanf (buf+2, "%lx %lx %64s", &fn_sbot, &fn_ssz, fn_name); + DBUG_PRINT ("srec", ("%lx %lx %s", fn_sbot, fn_ssz, fn_name)); + pos = add (fn_name); + lastuse = modules[pos].m_stkuse; +#if 0 + /* + * Needs further thought. Stack use is determined by + * difference in stack between two functions with DBUG_ENTER + * macros. If A calls B calls C, where A and C have the + * macros, and B doesn't, then B's stack use will be lumped + * in with either A's or C's. If somewhere else A calls + * C directly, the stack use will seem to change. Just + * take the biggest for now... + */ + if (lastuse > 0 && lastuse != fn_ssz) { + fprintf (stderr, + "warning - %s stack use changed (%lx to %lx)\n", + fn_name, lastuse, fn_ssz); + } +#endif + if (fn_ssz > lastuse) { + modules[pos].m_stkuse = fn_ssz; + } + if (fn_sbot > highstack) { + highstack = fn_sbot; + } else if (fn_sbot < lowstack) { + lowstack = fn_sbot; + } + break; + default: + fprintf (stderr, "unknown record type '%c'\n", buf[0]); + break; + } + next_line:; + } + + /* + * Now, we've hit eof. If we still have stuff stacked, then we + * assume that the user called exit, so give everything the exited + * time of fn_time. + */ + while (pop (&oldpos,&oldtime,&oldchild)) { + local_time = fn_time - oldtime; + t = top (); + t -> children += local_time; + local_time -= oldchild; + modules[oldpos].m_time += local_time; + modules[oldpos].m_calls++; + tot_time += local_time; + tot_calls++; + } + DBUG_VOID_RETURN; +} + +/* + * out_header () -- print out the header of the report. + */ + +void out_header (outf) +FILE *outf; +{ + DBUG_ENTER ("out_header"); + if (verbose) { + fprintf (outf, "Profile of Execution\n"); + fprintf (outf, "Execution times are in milliseconds\n\n"); + fprintf (outf, " Calls\t\t\t Time\n"); + fprintf (outf, " -----\t\t\t ----\n"); + fprintf (outf, "Times\tPercentage\tTime Spent\tPercentage\n"); + fprintf (outf, "Called\tof total\tin Function\tof total Importance\tFunction\n"); + fprintf (outf, "======\t==========\t===========\t========== ==========\t========\t\n"); + } else { + fprintf (outf, "%ld bytes of stack used, from %lx down to %lx\n\n", + highstack - lowstack, highstack, lowstack); + fprintf (outf, + " %%time sec #call ms/call %%calls weight stack name\n"); + } + DBUG_VOID_RETURN; +} + +/* + * out_trailer () - writes out the summary line of the report. + */ + +void out_trailer (outf,sum_calls,sum_time) +FILE *outf; +unsigned long int sum_calls, sum_time; +{ + DBUG_ENTER ("out_trailer"); + if (verbose) + { + fprintf(outf, "======\t==========\t===========\t==========\t========\n"); + fprintf(outf, "%6ld\t%10.2f\t%11ld\t%10.2f\t\t%-15s\n", + sum_calls, 100.0, sum_time, 100.0, "Totals"); + } + DBUG_VOID_RETURN; +} + +/* + * out_item () - prints out the output line for a single entry, + * and sets the calls and time fields appropriately. + */ + +void out_item (outf, m,called,timed) +FILE *outf; +register struct module_t *m; +unsigned long int *called, *timed; +{ + char *name = m -> name; + register unsigned int calls = m -> m_calls; + register unsigned long local_time = m -> m_time; + register unsigned long stkuse = m -> m_stkuse; + unsigned int import; + double per_time = 0.0; + double per_calls = 0.0; + double ms_per_call, local_ftime; + + DBUG_ENTER ("out_item"); + + if (tot_time > 0) { + per_time = (double) (local_time * 100) / (double) tot_time; + } + if (tot_calls > 0) { + per_calls = (double) (calls * 100) / (double) tot_calls; + } + import = (unsigned int) (per_time * per_calls); + + if (verbose) { + fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n", + calls, per_calls, local_time, per_time, import, name); + } else { + ms_per_call = local_time; + ms_per_call /= calls; + local_ftime = local_time; + local_ftime /= 1000; + fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n", + per_time, local_ftime, calls, ms_per_call, per_calls, import, + stkuse, name); + } + *called = calls; + *timed = local_time; + DBUG_VOID_RETURN; +} + +/* + * out_body (outf, root,s_calls,s_time) -- Performs an inorder traversal + * on the binary search tree (root). Calls out_item to actually print + * the item out. + */ + +void out_body (outf, root,s_calls,s_time) +FILE *outf; +register unsigned int root; +register unsigned long int *s_calls, *s_time; +{ + unsigned long int calls, local_time; + + DBUG_ENTER ("out_body"); + DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time)); + if (root == MAXPROCS) { + DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time)); + } else { + while (root != MAXPROCS) { + out_body (outf, s_table[root].lchild,s_calls,s_time); + out_item (outf, &modules[s_table[root].pos],&calls,&local_time); + DBUG_PRINT ("out_body", ("-- %lu -- %lu --", calls, local_time)); + *s_calls += calls; + *s_time += local_time; + root = s_table[root].rchild; + } + DBUG_PRINT ("out_body", ("%lu,%lu", *s_calls, *s_time)); + } + DBUG_VOID_RETURN; +} + +/* + * output () - print out a nice sorted output report on outf. + */ + +void output (outf) +FILE *outf; +{ + unsigned long int sum_calls = 0; + unsigned long int sum_time = 0; + + DBUG_ENTER ("output"); + if (n_items == 0) { + fprintf (outf, "%s: No functions to trace\n", my_name); + exit (EX_DATAERR); + } + out_header (outf); + out_body (outf, 0,&sum_calls,&sum_time); + out_trailer (outf, sum_calls,sum_time); + DBUG_VOID_RETURN; +} + + +#define usage() fprintf (DBUG_FILE,"Usage: %s [-v] [prof-file]\n",my_name) + +#ifdef MSDOS +extern int getopt(int argc, char **argv, char *opts); +#endif +extern int optind; +extern char *optarg; + +int main (int argc, char **argv) +{ + register int c; + int badflg = 0; + FILE *infile; + FILE *outfile = {stdout}; + +#ifdef THREAD +#if defined(HAVE_PTHREAD_INIT) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif + my_thread_global_init(); +#endif /* THREAD */ + { + DBUG_ENTER ("main"); + DBUG_PROCESS (argv[0]); + my_name = argv[0]; + while ((c = getopt (argc,argv,"#:v")) != EOF) { + switch (c) { + case '#': /* Debugging Macro enable */ + DBUG_PUSH (optarg); + break; + case 'v': /* Verbose mode */ + verbose++; + break; + default: + badflg++; + break; + } + } + if (badflg) { + usage (); + DBUG_RETURN (EX_USAGE); + } + if (optind < argc) { + FILEOPEN (infile, argv[optind], "r"); + } else { + FILEOPEN (infile, PRO_FILE, "r"); + } + process (infile); + output (outfile); + DBUG_RETURN (EX_OK); +} +} + +#ifdef MSDOS + +/* + * From std-unix@ut-sally.UUCP (Moderator, John Quarterman) Sun Nov 3 14:34:15 1985 + * Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gatech.CSNET + * Posting-Version: version B 2.10.2 9/18/84; site ut-sally.UUCP + * Path: gatech!akgua!mhuxv!mhuxt!mhuxr!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!ut-sally!std-unix + * From: std-unix@ut-sally.UUCP (Moderator, John Quarterman) + * Newsgroups: mod.std.unix + * Subject: public domain AT&T getopt source + * Message-ID: <3352@ut-sally.UUCP> + * Date: 3 Nov 85 19:34:15 GMT + * Date-Received: 4 Nov 85 12:25:09 GMT + * Organization: IEEE/P1003 Portable Operating System Environment Committee + * Lines: 91 + * Approved: jsq@ut-sally.UUCP + * + * Here's something you've all been waiting for: the AT&T public domain + * source for getopt(3). It is the code which was given out at the 1985 + * UNIFORUM conference in Dallas. I obtained it by electronic mail + * directly from AT&T. The people there assure me that it is indeed + * in the public domain. + * + * There is no manual page. That is because the one they gave out at + * UNIFORUM was slightly different from the current System V Release 2 + * manual page. The difference apparently involved a note about the + * famous rules 5 and 6, recommending using white space between an option + * and its first argument, and not grouping options that have arguments. + * Getopt itself is currently lenient about both of these things White + * space is allowed, but not mandatory, and the last option in a group can + * have an argument. That particular version of the man page evidently + * has no official existence, and my source at AT&T did not send a copy. + * The current SVR2 man page reflects the actual behavor of this getopt. + * However, I am not about to post a copy of anything licensed by AT&T. + * + * I will submit this source to Berkeley as a bug fix. + * + * I, personally, make no claims or guarantees of any kind about the + * following source. I did compile it to get some confidence that + * it arrived whole, but beyond that you're on your own. + * + */ + +/*LINTLIBRARY*/ + +int opterr = 1; +int optind = 1; +int optopt; +char *optarg; + +static void _ERR(s,c,argv) +char *s; +int c; +char *argv[]; +{ + char errbuf[3]; + + if (opterr) { + errbuf[0] = c; + errbuf[1] = '\n'; + (void) fprintf(stderr, "%s", argv[0]); + (void) fprintf(stderr, "%s", s); + (void) fprintf(stderr, "%s", errbuf); + } +} + +int getopt(argc, argv, opts) +int argc; +char **argv, *opts; +{ + static int sp = 1; + register int c; + register char *cp; + + if(sp == 1) + if(optind >= argc || + argv[optind][0] != '-' || argv[optind][1] == '\0') + return(EOF); + else if(strcmp(argv[optind], "--") == 0) { + optind++; + return(EOF); + } + optopt = c = argv[optind][sp]; + if(c == ':' || (cp=strchr(opts, c)) == NULL) { + _ERR(": illegal option -- ", c, argv); + if(argv[optind][++sp] == '\0') { + optind++; + sp = 1; + } + return('?'); + } + if(*++cp == ':') { + if(argv[optind][sp+1] != '\0') + optarg = &argv[optind++][sp+1]; + else if(++optind >= argc) { + _ERR(": option requires an argument -- ", c, argv); + sp = 1; + return('?'); + } else + optarg = argv[optind++]; + sp = 1; + } else { + if(argv[optind][++sp] == '\0') { + sp = 1; + optind++; + } + optarg = NULL; + } + return(c); +} + +#endif /* !unix && !xenix */ diff --git a/externals/mysql/extlib/dbug/dbug_long.h b/externals/mysql/extlib/dbug/dbug_long.h new file mode 100644 index 00000000000..829df181ef1 --- /dev/null +++ b/externals/mysql/extlib/dbug/dbug_long.h @@ -0,0 +1,160 @@ +#error This file is not used in MySQL - see ../include/my_dbug.h instead +/****************************************************************************** + * * + * N O T I C E * + * * + * Copyright Abandoned, 1987, Fred Fish * + * * + * * + * This previously copyrighted work has been placed into the public * + * domain by the author and may be freely used for any purpose, * + * private or commercial. * + * * + * Because of the number of inquiries I was receiving about the use * + * of this product in commercially developed works I have decided to * + * simply make it public domain to further its unrestricted use. I * + * specifically would be most happy to see this material become a * + * part of the standard Unix distributions by AT&T and the Berkeley * + * Computer Science Research Group, and a standard part of the GNU * + * system from the Free Software Foundation. * + * * + * I would appreciate it, as a courtesy, if this notice is left in * + * all copies and derivative works. Thank you. * + * * + * The author makes no warranty of any kind with respect to this * + * product and explicitly disclaims any implied warranties of mer- * + * chantability or fitness for any particular purpose. * + * * + ****************************************************************************** + */ + +/* + * FILE + * + * dbug.h user include file for programs using the dbug package + * + * SYNOPSIS + * + * #include + * + * SCCS ID + * + * @(#)dbug.h 1.13 7/17/89 + * + * DESCRIPTION + * + * Programs which use the dbug package must include this file. + * It contains the appropriate macros to call support routines + * in the dbug runtime library. + * + * To disable compilation of the macro expansions define the + * preprocessor symbol "DBUG_OFF". This will result in null + * macros expansions so that the resulting code will be smaller + * and faster. (The difference may be smaller than you think + * so this step is recommended only when absolutely necessary). + * In general, tradeoffs between space and efficiency are + * decided in favor of efficiency since space is seldom a + * problem on the new machines). + * + * All externally visible symbol names follow the pattern + * "_db_xxx..xx_" to minimize the possibility of a dbug package + * symbol colliding with a user defined symbol. + * + * The DBUG_ style macros are obsolete and should not be used + * in new code. Macros to map them to instances of DBUG_PRINT + * are provided for compatibility with older code. They may go + * away completely in subsequent releases. + * + * AUTHOR + * + * Fred Fish + * (Currently employed by Motorola Computer Division, Tempe, Az.) + * hao!noao!mcdsun!fnf + * (602) 438-3614 + * + */ + +/* + * Internally used dbug variables which must be global. + */ + +#ifndef DBUG_OFF + extern int _db_on_; /* TRUE if debug currently enabled */ + extern FILE *_db_fp_; /* Current debug output stream */ + extern char *_db_process_; /* Name of current process */ + extern int _db_keyword_ (); /* Accept/reject keyword */ + extern void _db_push_ (); /* Push state, set up new state */ + extern void _db_pop_ (); /* Pop previous debug state */ + extern void _db_enter_ (); /* New user function entered */ + extern void _db_return_ (); /* User function return */ + extern void _db_pargs_ (); /* Remember args for line */ + extern void _db_doprnt_ (); /* Print debug output */ + extern void _db_setjmp_ (); /* Save debugger environment */ + extern void _db_longjmp_ (); /* Restore debugger environment */ + extern void _db_dump_(); /* Dump memory */ +# endif + + +/* + * These macros provide a user interface into functions in the + * dbug runtime support library. They isolate users from changes + * in the MACROS and/or runtime support. + * + * The symbols "__LINE__" and "__FILE__" are expanded by the + * preprocessor to the current source file line number and file + * name respectively. + * + * WARNING --- Because the DBUG_ENTER macro allocates space on + * the user function's stack, it must precede any executable + * statements in the user function. + * + */ + +# ifdef DBUG_OFF +# define DBUG_ENTER(a1) +# define DBUG_RETURN(a1) return(a1) +# define DBUG_VOID_RETURN return +# define DBUG_EXECUTE(keyword,a1) +# define DBUG_PRINT(keyword,arglist) +# define DBUG_2(keyword,format) /* Obsolete */ +# define DBUG_3(keyword,format,a1) /* Obsolete */ +# define DBUG_4(keyword,format,a1,a2) /* Obsolete */ +# define DBUG_5(keyword,format,a1,a2,a3) /* Obsolete */ +# define DBUG_PUSH(a1) +# define DBUG_POP() +# define DBUG_PROCESS(a1) +# define DBUG_FILE (stderr) +# define DBUG_SETJMP setjmp +# define DBUG_LONGJMP longjmp +# define DBUG_DUMP(keyword,a1) +# else +# define DBUG_ENTER(a) \ + auto char *_db_func_; auto char *_db_file_; auto int _db_level_; \ + auto char **_db_framep_; \ + _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \ + &_db_framep_) +# define DBUG_LEAVE \ + (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)) +# define DBUG_RETURN(a1) return (DBUG_LEAVE, (a1)) +/* define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} Alternate form */ +# define DBUG_VOID_RETURN {DBUG_LEAVE; return;} +# define DBUG_EXECUTE(keyword,a1) \ + {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} +# define DBUG_PRINT(keyword,arglist) \ + {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} +# define DBUG_2(keyword,format) \ + DBUG_PRINT(keyword,(format)) /* Obsolete */ +# define DBUG_3(keyword,format,a1) \ + DBUG_PRINT(keyword,(format,a1)) /* Obsolete */ +# define DBUG_4(keyword,format,a1,a2) \ + DBUG_PRINT(keyword,(format,a1,a2)) /* Obsolete */ +# define DBUG_5(keyword,format,a1,a2,a3) \ + DBUG_PRINT(keyword,(format,a1,a2,a3)) /* Obsolete */ +# define DBUG_PUSH(a1) _db_push_ (a1) +# define DBUG_POP() _db_pop_ () +# define DBUG_PROCESS(a1) (_db_process_ = a1) +# define DBUG_FILE (_db_fp_) +# define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) +# define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) +# define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2) +# endif diff --git a/externals/mysql/extlib/dbug/example1.c b/externals/mysql/extlib/dbug/example1.c new file mode 100644 index 00000000000..7b3c3fcd63d --- /dev/null +++ b/externals/mysql/extlib/dbug/example1.c @@ -0,0 +1,10 @@ +main (argc, argv) +int argc; +char *argv[]; +{ + printf ("argv[0] = %d\n", argv[0]); + /* + * Rest of program + */ + printf ("== done ==\n"); +} diff --git a/externals/mysql/extlib/dbug/example2.c b/externals/mysql/extlib/dbug/example2.c new file mode 100644 index 00000000000..75fc1321b13 --- /dev/null +++ b/externals/mysql/extlib/dbug/example2.c @@ -0,0 +1,15 @@ +int debug = 0; + +main (argc, argv) +int argc; +char *argv[]; +{ + /* printf ("argv = %x\n", argv) */ + if (debug) printf ("argv[0] = %d\n", argv[0]); + /* + * Rest of program + */ +#ifdef DEBUG + printf ("== done ==\n"); +#endif +} diff --git a/externals/mysql/extlib/dbug/example3.c b/externals/mysql/extlib/dbug/example3.c new file mode 100644 index 00000000000..c035cdfffa0 --- /dev/null +++ b/externals/mysql/extlib/dbug/example3.c @@ -0,0 +1,14 @@ +main (argc, argv) +int argc; +char *argv[]; +{ +# ifdef DEBUG + printf ("argv[0] = %d\n", argv[0]); +# endif + /* + * Rest of program + */ +# ifdef DEBUG + printf ("== done ==\n"); +# endif +} diff --git a/externals/mysql/extlib/dbug/factorial.c b/externals/mysql/extlib/dbug/factorial.c new file mode 100644 index 00000000000..7b190ea8d8e --- /dev/null +++ b/externals/mysql/extlib/dbug/factorial.c @@ -0,0 +1,27 @@ +#ifdef DBUG_OFF /* We are testing dbug */ + +int factorial(register int value) { + if(value > 1) { + value *= factorial(value-1); + } + return value; +} + +#else + +#include + +int factorial ( +register int value) +{ + DBUG_ENTER ("factorial"); + DBUG_PRINT ("find", ("find %d factorial", value)); + if (value > 1) { + value *= factorial (value - 1); + } + DBUG_PRINT ("result", ("result is %d", value)); + DBUG_RETURN (value); +} + +#endif + diff --git a/externals/mysql/extlib/dbug/main.c b/externals/mysql/extlib/dbug/main.c new file mode 100644 index 00000000000..00e80c8ba31 --- /dev/null +++ b/externals/mysql/extlib/dbug/main.c @@ -0,0 +1,24 @@ +#include + +int main (argc, argv) +int argc; +char *argv[]; +{ + int result, ix; + extern int factorial(int); + DBUG_ENTER ("main"); + DBUG_PROCESS (argv[0]); + for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) { + switch (argv[ix][1]) { + case '#': + DBUG_PUSH (&(argv[ix][2])); + break; + } + } + for (; ix < argc; ix++) { + DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix])); + result = factorial (atoi(argv[ix])); + printf ("%d\n", result); + } + DBUG_RETURN (0); +} diff --git a/externals/mysql/extlib/dbug/my_main.c b/externals/mysql/extlib/dbug/my_main.c new file mode 100644 index 00000000000..31c15aa67aa --- /dev/null +++ b/externals/mysql/extlib/dbug/my_main.c @@ -0,0 +1,42 @@ +/* + this is modified version of the original example main.c + fixed so that it could compile and run in MySQL source tree +*/ + +#ifdef DBUG_OFF /* We are testing dbug */ +#undef DBUG_OFF +#endif + +#include /* This includes dbug.h */ +#include + +int main (argc, argv) +int argc; +char *argv[]; +{ + register int result, ix; + extern int factorial(int); +#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif +#ifdef THREAD + my_thread_global_init(); +#endif + { + DBUG_ENTER ("main"); + DBUG_PROCESS (argv[0]); + for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) { + switch (argv[ix][1]) { + case '#': + DBUG_PUSH (&(argv[ix][2])); + break; + } + } + for (; ix < argc; ix++) { + DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix])); + result = factorial (atoi(argv[ix])); + printf ("%d\n", result); + } + DBUG_RETURN (0); + } +} diff --git a/externals/mysql/extlib/dbug/sanity.c b/externals/mysql/extlib/dbug/sanity.c new file mode 100644 index 00000000000..df43fc14ba9 --- /dev/null +++ b/externals/mysql/extlib/dbug/sanity.c @@ -0,0 +1,13 @@ +/* Declarate _sanity() if not declared in main program */ + +#include + +extern int _sanity(const char *file,uint line); + +#if defined(SAFEMALLOC) && !defined(MASTER) /* Avoid errors in MySQL */ +int _sanity(const char * file __attribute__((unused)), + uint line __attribute__((unused))) +{ + return 0; +} +#endif diff --git a/externals/mysql/extlib/dbug/tests.c b/externals/mysql/extlib/dbug/tests.c new file mode 100644 index 00000000000..d76266d34a3 --- /dev/null +++ b/externals/mysql/extlib/dbug/tests.c @@ -0,0 +1,87 @@ +/* + A program to test DBUG features. Used by tests-t.pl +*/ + +char *push1=0; + +#include /* This includes dbug.h */ +#include +#include + +const char *func3() +{ + DBUG_ENTER("func3"); + DBUG_RETURN(DBUG_EVALUATE("ret3", "ok", "ko")); +} + +void func2() +{ + const char *s; + DBUG_ENTER("func2"); + s=func3(); + DBUG_PRINT("info", ("s=%s", s)); + DBUG_VOID_RETURN; +} + +int func1() +{ + DBUG_ENTER("func1"); + func2(); + if (push1) + { + DBUG_PUSH(push1); + fprintf(DBUG_FILE, "=> push1\n"); + } + DBUG_RETURN(10); +} + +int main (int argc, char *argv[]) +{ + int i; +#ifdef DBUG_OFF + return 1; +#endif + if (argc == 1) + return 0; + +#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif +#ifdef THREAD + my_thread_global_init(); +#endif + dup2(1, 2); + for (i = 1; i < argc; i++) + { + if (strncmp(argv[i], "--push1=", 8) == 0) + push1=argv[i]+8; + else + DBUG_PUSH (argv[i]); + } + { + DBUG_ENTER ("main"); + DBUG_PROCESS ("dbug-tests"); + func1(); + DBUG_EXECUTE_IF("dump", + { + char s[1000]; + DBUG_EXPLAIN(s, sizeof(s)-1); + DBUG_DUMP("dump", (uchar*)s, strlen(s)); + }); + DBUG_EXECUTE_IF("push", DBUG_PUSH("+t"); ); + DBUG_EXECUTE("execute", fprintf(DBUG_FILE, "=> execute\n"); ); + DBUG_EXECUTE_IF("set", DBUG_SET("+F"); ); + fprintf(DBUG_FILE, "=> evaluate: %s\n", + DBUG_EVALUATE("evaluate", "ON", "OFF")); + fprintf(DBUG_FILE, "=> evaluate_if: %s\n", + DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF")); + DBUG_EXECUTE_IF("pop", DBUG_POP(); ); + { + char s[1000] __attribute__((unused)); + DBUG_EXPLAIN(s, sizeof(s)-1); + DBUG_PRINT("explain", ("dbug explained: %s", s)); + } + func2(); + DBUG_RETURN (0); + } +} diff --git a/externals/mysql/extlib/regex/cclass.h b/externals/mysql/extlib/regex/cclass.h new file mode 100644 index 00000000000..b877b5dee6b --- /dev/null +++ b/externals/mysql/extlib/regex/cclass.h @@ -0,0 +1,22 @@ +/* character-class table */ + +#define CCLASS_ALNUM 0 +#define CCLASS_ALPHA 1 +#define CCLASS_BLANK 2 +#define CCLASS_CNTRL 3 +#define CCLASS_DIGIT 4 +#define CCLASS_GRAPH 5 +#define CCLASS_LOWER 6 +#define CCLASS_PRINT 7 +#define CCLASS_PUNCT 8 +#define CCLASS_SPACE 9 +#define CCLASS_UPPER 10 +#define CCLASS_XDIGIT 11 +#define CCLASS_LAST 12 + +extern struct cclass { + const char *name; + const char *chars; + const char *multis; + uint mask; +} cclasses[]; diff --git a/externals/mysql/extlib/regex/cname.h b/externals/mysql/extlib/regex/cname.h new file mode 100644 index 00000000000..06865f3e102 --- /dev/null +++ b/externals/mysql/extlib/regex/cname.h @@ -0,0 +1,104 @@ +/* character-name table */ +static struct cname { + const char *name; + const char code; +} cnames[] = { + {"NUL", '\0'}, + {"SOH", '\001'}, + {"STX", '\002'}, + {"ETX", '\003'}, + {"EOT", '\004'}, + {"ENQ", '\005'}, + {"ACK", '\006'}, + {"BEL", '\007'}, + {"alert", '\007'}, + {"BS", '\010'}, + {"backspace", '\b'}, + {"HT", '\011'}, + {"tab", '\t'}, + {"LF", '\012'}, + {"newline", '\n'}, + {"VT", '\013'}, + {"vertical-tab",'\v'}, + {"FF", '\014'}, + {"form-feed", '\f'}, + {"CR", '\015'}, + {"carriage-return", '\r'}, + {"SO", '\016'}, + {"SI", '\017'}, + {"DLE", '\020'}, + {"DC1", '\021'}, + {"DC2", '\022'}, + {"DC3", '\023'}, + {"DC4", '\024'}, + {"NAK", '\025'}, + {"SYN", '\026'}, + {"ETB", '\027'}, + {"CAN", '\030'}, + {"EM", '\031'}, + {"SUB", '\032'}, + {"ESC", '\033'}, + {"IS4", '\034'}, + {"FS", '\034'}, + {"IS3", '\035'}, + {"GS", '\035'}, + {"IS2", '\036'}, + {"RS", '\036'}, + {"IS1", '\037'}, + {"US", '\037'}, + {"space", ' '}, + {"exclamation-mark", '!'}, + {"quotation-mark", '"'}, + {"number-sign", '#'}, + {"dollar-sign", '$'}, + {"percent-sign", '%'}, + {"ampersand", '&'}, + {"apostrophe", '\''}, + {"left-parenthesis", '('}, + {"right-parenthesis", ')'}, + {"asterisk", '*'}, + {"plus-sign", '+'}, + {"comma", ','}, + {"hyphen", '-'}, + {"hyphen-minus", '-'}, + {"period", '.'}, + {"full-stop", '.'}, + {"slash", '/'}, + {"solidus", '/'}, + {"zero", '0'}, + {"one", '1'}, + {"two", '2'}, + {"three", '3'}, + {"four", '4'}, + {"five", '5'}, + {"six", '6'}, + {"seven", '7'}, + {"eight", '8'}, + {"nine", '9'}, + {"colon", ':'}, + {"semicolon", ';'}, + {"less-than-sign", '<'}, + {"equals-sign", '='}, + {"greater-than-sign", '>'}, + {"question-mark", '?'}, + {"commercial-at", '@'}, + {"left-square-bracket", '['}, + {"backslash", '\\'}, + {"reverse-solidus", '\\'}, + {"right-square-bracket",']'}, + {"circumflex", '^'}, + {"circumflex-accent", '^'}, + {"underscore", '_'}, + {"low-line", '_'}, + {"grave-accent", '`'}, + {"left-brace", '{'}, + {"left-curly-bracket", '{'}, + {"vertical-line", '|'}, + {"right-brace", '}'}, + {"right-curly-bracket", '}'}, + {"tilde", '~'}, + {"DEL", '\177'}, + {NULL, 0}, +}; + + diff --git a/externals/mysql/extlib/regex/debug.c b/externals/mysql/extlib/regex/debug.c new file mode 100644 index 00000000000..271b09bb27a --- /dev/null +++ b/externals/mysql/extlib/regex/debug.c @@ -0,0 +1,246 @@ +#include +#include +#include +#include + +#include "my_regex.h" +#include "utils.h" +#include "regex2.h" +#include "debug.ih" + +/* Added extra paramter to regchar to remove static buffer ; Monty 96.11.27 */ + +/* + - regprint - print a regexp for debugging + == void regprint(regex_t *r, FILE *d); + */ +void +regprint(r, d) +my_regex_t *r; +FILE *d; +{ + register struct re_guts *g = r->re_g; + register int i; + register int c; + register int last; + int nincat[NC]; + char buf[10]; + + fprintf(d, "%ld states, %d categories", (long)g->nstates, + g->ncategories); + fprintf(d, ", first %ld last %ld", (long)g->firststate, + (long)g->laststate); + if (g->iflags&USEBOL) + fprintf(d, ", USEBOL"); + if (g->iflags&USEEOL) + fprintf(d, ", USEEOL"); + if (g->iflags&BAD) + fprintf(d, ", BAD"); + if (g->nsub > 0) + fprintf(d, ", nsub=%ld", (long)g->nsub); + if (g->must != NULL) + fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, + g->must); + if (g->backrefs) + fprintf(d, ", backrefs"); + if (g->nplus > 0) + fprintf(d, ", nplus %ld", (long)g->nplus); + fprintf(d, "\n"); + s_print(r->charset, g, d); + for (i = 0; i < g->ncategories; i++) { + nincat[i] = 0; + for (c = CHAR_MIN; c <= CHAR_MAX; c++) + if (g->categories[c] == i) + nincat[i]++; + } + fprintf(d, "cc0#%d", nincat[0]); + for (i = 1; i < g->ncategories; i++) + if (nincat[i] == 1) { + for (c = CHAR_MIN; c <= CHAR_MAX; c++) + if (g->categories[c] == i) + break; + fprintf(d, ", %d=%s", i, regchar(r->charset,c,buf)); + } + fprintf(d, "\n"); + for (i = 1; i < g->ncategories; i++) + if (nincat[i] != 1) { + fprintf(d, "cc%d\t", i); + last = -1; + for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ + if (c <= CHAR_MAX && g->categories[c] == i) { + if (last < 0) { + fprintf(d, "%s", regchar(r->charset,c,buf)); + last = c; + } + } else { + if (last >= 0) { + if (last != c-1) + fprintf(d, "-%s", + regchar(r->charset,c-1,buf)); + last = -1; + } + } + fprintf(d, "\n"); + } +} + +/* + - s_print - print the strip for debugging + == static void s_print(register struct re_guts *g, FILE *d); + */ +static void +s_print(charset, g, d) +CHARSET_INFO *charset; +register struct re_guts *g; +FILE *d; +{ + register sop *s; + register cset *cs; + register int i; + register int done = 0; + register sop opnd; + register int col = 0; + register int last; + register sopno offset = 2; + char buf[10]; +# define GAP() { if (offset % 5 == 0) { \ + if (col > 40) { \ + fprintf(d, "\n\t"); \ + col = 0; \ + } else { \ + fprintf(d, " "); \ + col++; \ + } \ + } else \ + col++; \ + offset++; \ + } + + if (OP(g->strip[0]) != OEND) + fprintf(d, "missing initial OEND!\n"); + for (s = &g->strip[1]; !done; s++) { + opnd = OPND(*s); + switch (OP(*s)) { + case OEND: + fprintf(d, "\n"); + done = 1; + break; + case OCHAR: + if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) + fprintf(d, "\\%c", (char)opnd); + else + fprintf(d, "%s", regchar(charset,(char)opnd,buf)); + break; + case OBOL: + fprintf(d, "^"); + break; + case OEOL: + fprintf(d, "$"); + break; + case OBOW: + fprintf(d, "\\{"); + break; + case OEOW: + fprintf(d, "\\}"); + break; + case OANY: + fprintf(d, "."); + break; + case OANYOF: + fprintf(d, "[(%ld)", (long)opnd); + cs = &g->sets[opnd]; + last = -1; + for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ + if (CHIN(cs, i) && i < g->csetsize) { + if (last < 0) { + fprintf(d, "%s", regchar(charset,i,buf)); + last = i; + } + } else { + if (last >= 0) { + if (last != i-1) + fprintf(d, "-%s", + regchar(charset,i-1,buf)); + last = -1; + } + } + fprintf(d, "]"); + break; + case OBACK_: + fprintf(d, "(\\<%ld>", (long)opnd); + break; + case O_BACK: + fprintf(d, "<%ld>\\)", (long)opnd); + break; + case OPLUS_: + fprintf(d, "(+"); + if (OP(*(s+opnd)) != O_PLUS) + fprintf(d, "<%ld>", (long)opnd); + break; + case O_PLUS: + if (OP(*(s-opnd)) != OPLUS_) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, "+)"); + break; + case OQUEST_: + fprintf(d, "(?"); + if (OP(*(s+opnd)) != O_QUEST) + fprintf(d, "<%ld>", (long)opnd); + break; + case O_QUEST: + if (OP(*(s-opnd)) != OQUEST_) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, "?)"); + break; + case OLPAREN: + fprintf(d, "((<%ld>", (long)opnd); + break; + case ORPAREN: + fprintf(d, "<%ld>))", (long)opnd); + break; + case OCH_: + fprintf(d, "<"); + if (OP(*(s+opnd)) != OOR2) + fprintf(d, "<%ld>", (long)opnd); + break; + case OOR1: + if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, "|"); + break; + case OOR2: + fprintf(d, "|"); + if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) + fprintf(d, "<%ld>", (long)opnd); + break; + case O_CH: + if (OP(*(s-opnd)) != OOR1) + fprintf(d, "<%ld>", (long)opnd); + fprintf(d, ">"); + break; + default: + fprintf(d, "!%ld(%ld)!", OP(*s), opnd); + break; + } + if (!done) + GAP(); + } +} + +/* + - regchar - make a character printable + == static char *regchar(int ch); + */ +static char * /* -> representation */ +regchar(charset,ch,buf) +CHARSET_INFO *charset; +int ch; +char *buf; +{ + + if (my_isprint(charset,ch) || ch == ' ') + sprintf(buf, "%c", ch); + else + sprintf(buf, "\\%o", ch); + return(buf); +} diff --git a/externals/mysql/extlib/regex/engine.c b/externals/mysql/extlib/regex/engine.c new file mode 100644 index 00000000000..1968ca61a96 --- /dev/null +++ b/externals/mysql/extlib/regex/engine.c @@ -0,0 +1,1031 @@ +/* + * The matching engine and friends. This file is #included by regexec.c + * after suitable #defines of a variety of macros used herein, so that + * different state representations can be used without duplicating masses + * of code. + */ + +#ifdef SNAMES +#define matcher smatcher +#define fast sfast +#define slow sslow +#define dissect sdissect +#define backref sbackref +#define step sstep +#define print sprint +#define at sat +#define match smat +#endif +#ifdef LNAMES +#define matcher lmatcher +#define fast lfast +#define slow lslow +#define dissect ldissect +#define backref lbackref +#define step lstep +#define print lprint +#define at lat +#define match lmat +#endif + +/* another structure passed up and down to avoid zillions of parameters */ +struct match { + struct re_guts *g; + int eflags; + my_regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ + char *offp; /* offsets work from here */ + char *beginp; /* start of string -- virtual NUL precedes */ + char *endp; /* end of string -- virtual NUL here */ + char *coldp; /* can be no match starting before here */ + char **lastpos; /* [nplus+1] */ + STATEVARS; + states st; /* current states */ + states fresh; /* states for a fresh start */ + states tmp; /* temporary */ + states empty; /* empty set of states */ +}; + +#include "engine.ih" + +#ifdef REDEBUG +#define SP(t, s, c) print(m, t, s, c, stdout) +#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2) +#define NOTE(str) { if (m->eflags®_TRACE) printf("=%s\n", (str)); } +#else +#define SP(t, s, c) /* nothing */ +#define AT(t, p1, p2, s1, s2) /* nothing */ +#define NOTE(s) /* nothing */ +#endif + +/* + - matcher - the actual matching engine + == static int matcher(register struct re_guts *g, char *string, \ + == size_t nmatch, regmatch_t pmatch[], int eflags); + */ +static int /* 0 success, REG_NOMATCH failure */ +matcher(charset,g, str, nmatch, pmatch, eflags) +CHARSET_INFO *charset; +register struct re_guts *g; +char *str; +size_t nmatch; +my_regmatch_t pmatch[]; +int eflags; +{ + register char *endp; + register uint i; + struct match mv; + register struct match *m = &mv; + register char *dp; + register const sopno gf = g->firststate+1; /* +1 for OEND */ + register const sopno gl = g->laststate; + char *start; + char *stop; + + /* simplify the situation where possible */ + if (g->cflags®_NOSUB) + nmatch = 0; + if (eflags®_STARTEND) { + start = str + pmatch[0].rm_so; + stop = str + pmatch[0].rm_eo; + } else { + start = str; + stop = start + strlen(start); + } + if (stop < start) + return(REG_INVARG); + + /* prescreening; this does wonders for this rather slow code */ + if (g->must != NULL) { + for (dp = start; dp < stop; dp++) + if (*dp == g->must[0] && stop - dp >= g->mlen && + memcmp(dp, g->must, (size_t)g->mlen) == 0) + break; + if (dp == stop) /* we didn't find g->must */ + return(REG_NOMATCH); + } + + /* match struct setup */ + m->g = g; + m->eflags = eflags; + m->pmatch = NULL; + m->lastpos = NULL; + m->offp = str; + m->beginp = start; + m->endp = stop; + STATESETUP(m, 4); + SETUP(m->st); + SETUP(m->fresh); + SETUP(m->tmp); + SETUP(m->empty); + CLEAR(m->empty); + + /* this loop does only one repetition except for backrefs */ + for (;;) { + endp = fast(charset, m, start, stop, gf, gl); + if (endp == NULL) { /* a miss */ + if (m->pmatch != NULL) + free((char *)m->pmatch); + if (m->lastpos != NULL) + free((char *)m->lastpos); + STATETEARDOWN(m); + return(REG_NOMATCH); + } + if (nmatch == 0 && !g->backrefs) + break; /* no further info needed */ + + /* where? */ + assert(m->coldp != NULL); + for (;;) { + NOTE("finding start"); + endp = slow(charset, m, m->coldp, stop, gf, gl); + if (endp != NULL) + break; + assert(m->coldp < m->endp); + m->coldp++; + } + if (nmatch == 1 && !g->backrefs) + break; /* no further info needed */ + + /* oh my, he wants the subexpressions... */ + if (m->pmatch == NULL) + m->pmatch = (my_regmatch_t *)malloc((m->g->nsub + 1) * + sizeof(my_regmatch_t)); + if (m->pmatch == NULL) { + if (m->lastpos != NULL) + free((char *)m->lastpos); + STATETEARDOWN(m); + return(REG_ESPACE); + } + for (i = 1; i <= m->g->nsub; i++) + m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; + if (!g->backrefs && !(m->eflags®_BACKR)) { + NOTE("dissecting"); + dp = dissect(charset, m, m->coldp, endp, gf, gl); + } else { + if (g->nplus > 0 && m->lastpos == NULL) + m->lastpos = (char **)malloc((g->nplus+1) * + sizeof(char *)); + if (g->nplus > 0 && m->lastpos == NULL) { + free(m->pmatch); + STATETEARDOWN(m); + return(REG_ESPACE); + } + NOTE("backref dissect"); + dp = backref(charset, m, m->coldp, endp, gf, gl, (sopno)0); + } + if (dp != NULL) + break; + + /* uh-oh... we couldn't find a subexpression-level match */ + assert(g->backrefs); /* must be back references doing it */ + assert(g->nplus == 0 || m->lastpos != NULL); + for (;;) { + if (dp != NULL || endp <= m->coldp) + break; /* defeat */ + NOTE("backoff"); + endp = slow(charset, m, m->coldp, endp-1, gf, gl); + if (endp == NULL) + break; /* defeat */ + /* try it on a shorter possibility */ +#ifndef NDEBUG + for (i = 1; i <= m->g->nsub; i++) { + assert(m->pmatch[i].rm_so == -1); + assert(m->pmatch[i].rm_eo == -1); + } +#endif + NOTE("backoff dissect"); + dp = backref(charset, m, m->coldp, endp, gf, gl, (sopno)0); + } + assert(dp == NULL || dp == endp); + if (dp != NULL) /* found a shorter one */ + break; + + /* despite initial appearances, there is no match here */ + NOTE("false alarm"); + start = m->coldp + 1; /* recycle starting later */ + assert(start <= stop); + } + + /* fill in the details if requested */ + if (nmatch > 0) { + pmatch[0].rm_so = m->coldp - m->offp; + pmatch[0].rm_eo = endp - m->offp; + } + if (nmatch > 1) { + assert(m->pmatch != NULL); + for (i = 1; i < nmatch; i++) + if (i <= m->g->nsub) + pmatch[i] = m->pmatch[i]; + else { + pmatch[i].rm_so = -1; + pmatch[i].rm_eo = -1; + } + } + + if (m->pmatch != NULL) + free((char *)m->pmatch); + if (m->lastpos != NULL) + free((char *)m->lastpos); + STATETEARDOWN(m); + return(0); +} + +/* + - dissect - figure out what matched what, no back references + == static char *dissect(register struct match *m, char *start, \ + == char *stop, sopno startst, sopno stopst); + */ +static char * /* == stop (success) always */ +dissect(charset, m, start, stop, startst, stopst) +CHARSET_INFO *charset; +register struct match *m; +char *start; +char *stop; +sopno startst; +sopno stopst; +{ + register uint i; + register sopno ss; /* start sop of current subRE */ + register sopno es; /* end sop of current subRE */ + register char *sp; /* start of string matched by it */ + register char *stp; /* string matched by it cannot pass here */ + register char *rest; /* start of rest of string */ + register char *tail; /* string unmatched by rest of RE */ + register sopno ssub; /* start sop of subsubRE */ + register sopno esub; /* end sop of subsubRE */ + register char *ssp; /* start of string matched by subsubRE */ + register char *sep; /* end of string matched by subsubRE */ + register char *oldssp; /* previous ssp */ + register char *dp; /* used in debug mode to check asserts */ + + AT("diss", start, stop, startst, stopst); + sp = start; + for (ss = startst; ss < stopst; ss = es) { + /* identify end of subRE */ + es = ss; + switch (OP(m->g->strip[es])) { + case OPLUS_: + case OQUEST_: + es += OPND(m->g->strip[es]); + break; + case OCH_: + while (OP(m->g->strip[es]) != O_CH) + es += OPND(m->g->strip[es]); + break; + } + es++; + + /* figure out what it matched */ + switch (OP(m->g->strip[ss])) { + case OEND: + assert(nope); + break; + case OCHAR: + sp++; + break; + case OBOL: + case OEOL: + case OBOW: + case OEOW: + break; + case OANY: + case OANYOF: + sp++; + break; + case OBACK_: + case O_BACK: + assert(nope); + break; + /* cases where length of match is hard to find */ + case OQUEST_: + stp = stop; + for (;;) { + /* how long could this one be? */ + rest = slow(charset, m, sp, stp, ss, es); + assert(rest != NULL); /* it did match */ + /* could the rest match the rest? */ + tail = slow(charset, m, rest, stop, es, stopst); + if (tail == stop) + break; /* yes! */ + /* no -- try a shorter match for this one */ + stp = rest - 1; + assert(stp >= sp); /* it did work */ + } + ssub = ss + 1; + esub = es - 1; + /* did innards match? */ + if (slow(charset, m, sp, rest, ssub, esub) != NULL) { + dp = dissect(charset, m, sp, rest, ssub, esub); + assert(dp == rest); + } else /* no */ + assert(sp == rest); + sp = rest; + break; + case OPLUS_: + stp = stop; + for (;;) { + /* how long could this one be? */ + rest = slow(charset, m, sp, stp, ss, es); + assert(rest != NULL); /* it did match */ + /* could the rest match the rest? */ + tail = slow(charset, m, rest, stop, es, stopst); + if (tail == stop) + break; /* yes! */ + /* no -- try a shorter match for this one */ + stp = rest - 1; + assert(stp >= sp); /* it did work */ + } + ssub = ss + 1; + esub = es - 1; + ssp = sp; + oldssp = ssp; + for (;;) { /* find last match of innards */ + sep = slow(charset, m, ssp, rest, ssub, esub); + if (sep == NULL || sep == ssp) + break; /* failed or matched null */ + oldssp = ssp; /* on to next try */ + ssp = sep; + } + if (sep == NULL) { + /* last successful match */ + sep = ssp; + ssp = oldssp; + } + assert(sep == rest); /* must exhaust substring */ + assert(slow(charset, m, ssp, sep, ssub, esub) == rest); + dp = dissect(charset, m, ssp, sep, ssub, esub); + assert(dp == sep); + sp = rest; + break; + case OCH_: + stp = stop; + for (;;) { + /* how long could this one be? */ + rest = slow(charset, m, sp, stp, ss, es); + assert(rest != NULL); /* it did match */ + /* could the rest match the rest? */ + tail = slow(charset, m, rest, stop, es, stopst); + if (tail == stop) + break; /* yes! */ + /* no -- try a shorter match for this one */ + stp = rest - 1; + assert(stp >= sp); /* it did work */ + } + ssub = ss + 1; + esub = ss + OPND(m->g->strip[ss]) - 1; + assert(OP(m->g->strip[esub]) == OOR1); + for (;;) { /* find first matching branch */ + if (slow(charset, m, sp, rest, ssub, esub) == rest) + break; /* it matched all of it */ + /* that one missed, try next one */ + assert(OP(m->g->strip[esub]) == OOR1); + esub++; + assert(OP(m->g->strip[esub]) == OOR2); + ssub = esub + 1; + esub += OPND(m->g->strip[esub]); + if (OP(m->g->strip[esub]) == OOR2) + esub--; + else + assert(OP(m->g->strip[esub]) == O_CH); + } + dp = dissect(charset, m, sp, rest, ssub, esub); + assert(dp == rest); + sp = rest; + break; + case O_PLUS: + case O_QUEST: + case OOR1: + case OOR2: + case O_CH: + assert(nope); + break; + case OLPAREN: + i = OPND(m->g->strip[ss]); + assert(0 < i && i <= m->g->nsub); + m->pmatch[i].rm_so = sp - m->offp; + break; + case ORPAREN: + i = OPND(m->g->strip[ss]); + assert(0 < i && i <= m->g->nsub); + m->pmatch[i].rm_eo = sp - m->offp; + break; + default: /* uh oh */ + assert(nope); + break; + } + } + + assert(sp == stop); + return(sp); +} + +/* + - backref - figure out what matched what, figuring in back references + == static char *backref(register struct match *m, char *start, \ + == char *stop, sopno startst, sopno stopst, sopno lev); + */ +static char * /* == stop (success) or NULL (failure) */ +backref(charset,m, start, stop, startst, stopst, lev) +CHARSET_INFO *charset; +register struct match *m; +char *start; +char *stop; +sopno startst; +sopno stopst; +sopno lev; /* PLUS nesting level */ +{ + register uint i; + register sopno ss; /* start sop of current subRE */ + register char *sp; /* start of string matched by it */ + register sopno ssub; /* start sop of subsubRE */ + register sopno esub; /* end sop of subsubRE */ + register char *ssp; /* start of string matched by subsubRE */ + register char *dp; + register size_t len; + register int hard; + register sop s; + register regoff_t offsave; + register cset *cs; + + AT("back", start, stop, startst, stopst); + sp = start; + + /* get as far as we can with easy stuff */ + hard = 0; + for (ss = startst; !hard && ss < stopst; ss++) + switch (OP(s = m->g->strip[ss])) { + case OCHAR: + if (sp == stop || *sp++ != (char)OPND(s)) + return(NULL); + break; + case OANY: + if (sp == stop) + return(NULL); + sp++; + break; + case OANYOF: + cs = &m->g->sets[OPND(s)]; + if (sp == stop || !CHIN(cs, *sp++)) + return(NULL); + break; + case OBOL: + if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp < m->endp && *(sp-1) == '\n' && + (m->g->cflags®_NEWLINE)) ) + { /* yes */ } + else + return(NULL); + break; + case OEOL: + if ( (sp == m->endp && !(m->eflags®_NOTEOL)) || + (sp < m->endp && *sp == '\n' && + (m->g->cflags®_NEWLINE)) ) + { /* yes */ } + else + return(NULL); + break; + case OBOW: + if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp < m->endp && *(sp-1) == '\n' && + (m->g->cflags®_NEWLINE)) || + (sp > m->beginp && + !ISWORD(charset,*(sp-1))) ) && + (sp < m->endp && ISWORD(charset,*sp)) ) + { /* yes */ } + else + return(NULL); + break; + case OEOW: + if (( (sp == m->endp && !(m->eflags®_NOTEOL)) || + (sp < m->endp && *sp == '\n' && + (m->g->cflags®_NEWLINE)) || + (sp < m->endp && !ISWORD(charset,*sp)) ) && + (sp > m->beginp && ISWORD(charset,*(sp-1))) ) + { /* yes */ } + else + return(NULL); + break; + case O_QUEST: + break; + case OOR1: /* matches null but needs to skip */ + ss++; + s = m->g->strip[ss]; + do { + assert(OP(s) == OOR2); + ss += OPND(s); + } while (OP(s = m->g->strip[ss]) != O_CH); + /* note that the ss++ gets us past the O_CH */ + break; + default: /* have to make a choice */ + hard = 1; + break; + } + if (!hard) { /* that was it! */ + if (sp != stop) + return(NULL); + return(sp); + } + ss--; /* adjust for the for's final increment */ + + /* the hard stuff */ + AT("hard", sp, stop, ss, stopst); + s = m->g->strip[ss]; + switch (OP(s)) { + case OBACK_: /* the vilest depths */ + i = OPND(s); + assert(0 < i && i <= m->g->nsub); + if (m->pmatch[i].rm_eo == -1) + return(NULL); + assert(m->pmatch[i].rm_so != -1); + len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; + assert((size_t) (stop - m->beginp) >= len); + if (sp > stop - len) + return(NULL); /* not enough left to match */ + ssp = m->offp + m->pmatch[i].rm_so; + if (memcmp(sp, ssp, len) != 0) + return(NULL); + while (m->g->strip[ss] != SOP(O_BACK, i)) + ss++; + return(backref(charset, m, sp+len, stop, ss+1, stopst, lev)); + break; + case OQUEST_: /* to null or not */ + dp = backref(charset, m, sp, stop, ss+1, stopst, lev); + if (dp != NULL) + return(dp); /* not */ + return(backref(charset, m, sp, stop, ss+OPND(s)+1, stopst, lev)); + break; + case OPLUS_: + assert(m->lastpos != NULL); + assert(lev+1 <= m->g->nplus); + m->lastpos[lev+1] = sp; + return(backref(charset, m, sp, stop, ss+1, stopst, lev+1)); + break; + case O_PLUS: + if (sp == m->lastpos[lev]) /* last pass matched null */ + return(backref(charset, m, sp, stop, ss+1, stopst, lev-1)); + /* try another pass */ + m->lastpos[lev] = sp; + dp = backref(charset, m, sp, stop, ss-OPND(s)+1, stopst, lev); + if (dp == NULL) + return(backref(charset, m, sp, stop, ss+1, stopst, lev-1)); + else + return(dp); + break; + case OCH_: /* find the right one, if any */ + ssub = ss + 1; + esub = ss + OPND(s) - 1; + assert(OP(m->g->strip[esub]) == OOR1); + for (;;) { /* find first matching branch */ + dp = backref(charset, m, sp, stop, ssub, esub, lev); + if (dp != NULL) + return(dp); + /* that one missed, try next one */ + if (OP(m->g->strip[esub]) == O_CH) + return(NULL); /* there is none */ + esub++; + assert(OP(m->g->strip[esub]) == OOR2); + ssub = esub + 1; + esub += OPND(m->g->strip[esub]); + if (OP(m->g->strip[esub]) == OOR2) + esub--; + else + assert(OP(m->g->strip[esub]) == O_CH); + } + break; + case OLPAREN: /* must undo assignment if rest fails */ + i = OPND(s); + assert(0 < i && i <= m->g->nsub); + offsave = m->pmatch[i].rm_so; + m->pmatch[i].rm_so = sp - m->offp; + dp = backref(charset, m, sp, stop, ss+1, stopst, lev); + if (dp != NULL) + return(dp); + m->pmatch[i].rm_so = offsave; + return(NULL); + break; + case ORPAREN: /* must undo assignment if rest fails */ + i = OPND(s); + assert(0 < i && i <= m->g->nsub); + offsave = m->pmatch[i].rm_eo; + m->pmatch[i].rm_eo = sp - m->offp; + dp = backref(charset, m, sp, stop, ss+1, stopst, lev); + if (dp != NULL) + return(dp); + m->pmatch[i].rm_eo = offsave; + return(NULL); + break; + default: /* uh oh */ + assert(nope); + break; + } + + /* "can't happen" */ + assert(nope); + /* NOTREACHED */ + return 0; /* Keep gcc happy */ +} + +/* + - fast - step through the string at top speed + == static char *fast(register struct match *m, char *start, \ + == char *stop, sopno startst, sopno stopst); + */ +static char * /* where tentative match ended, or NULL */ +fast(charset, m, start, stop, startst, stopst) +CHARSET_INFO *charset; +register struct match *m; +char *start; +char *stop; +sopno startst; +sopno stopst; +{ + register states st = m->st; + register states fresh = m->fresh; + register states tmp = m->tmp; + register char *p = start; + register int c = (start == m->beginp) ? OUT : *(start-1); + register int lastc; /* previous c */ + register int flagch; + register int i; + register char *coldp; /* last p after which no match was underway */ + + CLEAR(st); + SET1(st, startst); + st = step(m->g, startst, stopst, st, NOTHING, st); + ASSIGN(fresh, st); + SP("start", st, *p); + coldp = NULL; + for (;;) { + /* next character */ + lastc = c; + c = (p == m->endp) ? OUT : *p; + if (EQ(st, fresh)) + coldp = p; + + /* is there an EOL and/or BOL between lastc and c? */ + flagch = '\0'; + i = 0; + if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || + (lastc == OUT && !(m->eflags®_NOTBOL)) ) { + flagch = BOL; + i = m->g->nbol; + } + if ( (c == '\n' && m->g->cflags®_NEWLINE) || + (c == OUT && !(m->eflags®_NOTEOL)) ) { + flagch = (flagch == BOL) ? BOLEOL : EOL; + i += m->g->neol; + } + if (i != 0) { + for (; i > 0; i--) + st = step(m->g, startst, stopst, st, flagch, st); + SP("boleol", st, c); + } + + /* how about a word boundary? */ + if ( (flagch == BOL || (lastc != OUT && !ISWORD(charset,lastc))) && + (c != OUT && ISWORD(charset,c)) ) { + flagch = BOW; + } + if ( (lastc != OUT && ISWORD(charset,lastc)) && + (flagch == EOL || (c != OUT && !ISWORD(charset,c))) ) { + flagch = EOW; + } + if (flagch == BOW || flagch == EOW) { + st = step(m->g, startst, stopst, st, flagch, st); + SP("boweow", st, c); + } + + /* are we done? */ + if (ISSET(st, stopst) || p == stop) + break; /* NOTE BREAK OUT */ + + /* no, we must deal with this character */ + ASSIGN(tmp, st); + ASSIGN(st, fresh); + assert(c != OUT); + st = step(m->g, startst, stopst, tmp, c, st); + SP("aft", st, c); + assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); + p++; + } + + assert(coldp != NULL); + m->coldp = coldp; + if (ISSET(st, stopst)) + return(p+1); + else + return(NULL); +} + +/* + - slow - step through the string more deliberately + == static char *slow(register struct match *m, char *start, \ + == char *stop, sopno startst, sopno stopst); + */ +static char * /* where it ended */ +slow(charset, m, start, stop, startst, stopst) +CHARSET_INFO *charset; +register struct match *m; +char *start; +char *stop; +sopno startst; +sopno stopst; +{ + register states st = m->st; + register states empty = m->empty; + register states tmp = m->tmp; + register char *p = start; + register int c = (start == m->beginp) ? OUT : *(start-1); + register int lastc; /* previous c */ + register int flagch; + register int i; + register char *matchp; /* last p at which a match ended */ + + AT("slow", start, stop, startst, stopst); + CLEAR(st); + SET1(st, startst); + SP("sstart", st, *p); + st = step(m->g, startst, stopst, st, NOTHING, st); + matchp = NULL; + for (;;) { + /* next character */ + lastc = c; + c = (p == m->endp) ? OUT : *p; + + /* is there an EOL and/or BOL between lastc and c? */ + flagch = '\0'; + i = 0; + if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || + (lastc == OUT && !(m->eflags®_NOTBOL)) ) { + flagch = BOL; + i = m->g->nbol; + } + if ( (c == '\n' && m->g->cflags®_NEWLINE) || + (c == OUT && !(m->eflags®_NOTEOL)) ) { + flagch = (flagch == BOL) ? BOLEOL : EOL; + i += m->g->neol; + } + if (i != 0) { + for (; i > 0; i--) + st = step(m->g, startst, stopst, st, flagch, st); + SP("sboleol", st, c); + } + + /* how about a word boundary? */ + if ( (flagch == BOL || (lastc != OUT && !ISWORD(charset,lastc))) && + (c != OUT && ISWORD(charset,c)) ) { + flagch = BOW; + } + if ( (lastc != OUT && ISWORD(charset,lastc)) && + (flagch == EOL || (c != OUT && !ISWORD(charset,c))) ) { + flagch = EOW; + } + if (flagch == BOW || flagch == EOW) { + st = step(m->g, startst, stopst, st, flagch, st); + SP("sboweow", st, c); + } + + /* are we done? */ + if (ISSET(st, stopst)) + matchp = p; + if (EQ(st, empty) || p == stop) + break; /* NOTE BREAK OUT */ + + /* no, we must deal with this character */ + ASSIGN(tmp, st); + ASSIGN(st, empty); + assert(c != OUT); + st = step(m->g, startst, stopst, tmp, c, st); + SP("saft", st, c); + assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); + p++; + } + + return(matchp); +} + + +/* + - step - map set of states reachable before char to set reachable after + == static states step(register struct re_guts *g, sopno start, sopno stop, \ + == register states bef, int ch, register states aft); + == #define BOL (OUT+1) + == #define EOL (BOL+1) + == #define BOLEOL (BOL+2) + == #define NOTHING (BOL+3) + == #define BOW (BOL+4) + == #define EOW (BOL+5) + == #define CODEMAX (BOL+5) // highest code used + == #define NONCHAR(c) ((c) > CHAR_MAX) + == #define NNONCHAR (CODEMAX-CHAR_MAX) + */ +static states +step(g, start, stop, bef, ch, aft) +register struct re_guts *g; +sopno start; /* start state within strip */ +sopno stop; /* state after stop state within strip */ +register states bef; /* states reachable before */ +int ch; /* character or NONCHAR code */ +register states aft; /* states already known reachable after */ +{ + register cset *cs; + register sop s; + register sopno pc; + register onestate here; /* note, macros know this name */ + register sopno look; + register onestate i; /* Changed from int by Monty */ + + for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { + s = g->strip[pc]; + switch (OP(s)) { + case OEND: + assert(pc == stop-1); + break; + case OCHAR: + /* only characters can match */ + assert(!NONCHAR(ch) || ch != (char)OPND(s)); + if (ch == (char)OPND(s)) + FWD(aft, bef, 1); + break; + case OBOL: + if (ch == BOL || ch == BOLEOL) + FWD(aft, bef, 1); + break; + case OEOL: + if (ch == EOL || ch == BOLEOL) + FWD(aft, bef, 1); + break; + case OBOW: + if (ch == BOW) + FWD(aft, bef, 1); + break; + case OEOW: + if (ch == EOW) + FWD(aft, bef, 1); + break; + case OANY: + if (!NONCHAR(ch)) + FWD(aft, bef, 1); + break; + case OANYOF: + cs = &g->sets[OPND(s)]; + if (!NONCHAR(ch) && CHIN(cs, ch)) + FWD(aft, bef, 1); + break; + case OBACK_: /* ignored here */ + case O_BACK: + FWD(aft, aft, 1); + break; + case OPLUS_: /* forward, this is just an empty */ + FWD(aft, aft, 1); + break; + case O_PLUS: /* both forward and back */ + FWD(aft, aft, 1); + i = ISSETBACK(aft, OPND(s)); + BACK(aft, aft, OPND(s)); + if (!i && ISSETBACK(aft, OPND(s))) { + /* oho, must reconsider loop body */ + pc -= OPND(s) + 1; + INIT(here, pc); + } + break; + case OQUEST_: /* two branches, both forward */ + FWD(aft, aft, 1); + FWD(aft, aft, OPND(s)); + break; + case O_QUEST: /* just an empty */ + FWD(aft, aft, 1); + break; + case OLPAREN: /* not significant here */ + case ORPAREN: + FWD(aft, aft, 1); + break; + case OCH_: /* mark the first two branches */ + FWD(aft, aft, 1); + assert(OP(g->strip[pc+OPND(s)]) == OOR2); + FWD(aft, aft, OPND(s)); + break; + case OOR1: /* done a branch, find the O_CH */ + if (ISSTATEIN(aft, here)) { + for (look = 1; + OP(s = g->strip[pc+look]) != O_CH; + look += OPND(s)) + assert(OP(s) == OOR2); + FWD(aft, aft, look); + } + break; + case OOR2: /* propagate OCH_'s marking */ + FWD(aft, aft, 1); + if (OP(g->strip[pc+OPND(s)]) != O_CH) { + assert(OP(g->strip[pc+OPND(s)]) == OOR2); + FWD(aft, aft, OPND(s)); + } + break; + case O_CH: /* just empty */ + FWD(aft, aft, 1); + break; + default: /* ooooops... */ + assert(nope); + break; + } + } + + return(aft); +} + +#ifdef REDEBUG +/* + - print - print a set of states + == #ifdef REDEBUG + == static void print(struct match *m, char *caption, states st, \ + == int ch, FILE *d); + == #endif + */ +static void +print(m, caption, st, ch, d) +struct match *m; +char *caption; +states st; +int ch; +FILE *d; +{ + register struct re_guts *g = m->g; + register int i; + register int first = 1; + char buf[10]; + + if (!(m->eflags®_TRACE)) + return; + + fprintf(d, "%s", caption); + if (ch != '\0') + fprintf(d, " %s", printchar(ch,buf)); + for (i = 0; i < g->nstates; i++) + if (ISSET(st, i)) { + fprintf(d, "%s%d", (first) ? "\t" : ", ", i); + first = 0; + } + fprintf(d, "\n"); +} + +/* + - at - print current situation + == #ifdef REDEBUG + == static void at(struct match *m, char *title, char *start, char *stop, \ + == sopno startst, sopno stopst); + == #endif + */ +static void +at(m, title, start, stop, startst, stopst) +struct match *m; +char *title; +char *start; +char *stop; +sopno startst; +sopno stopst; +{ + char buf[10]; + if (!(m->eflags®_TRACE)) + return; + + printf("%s %s-", title, printchar(*start,buf)); + printf("%s ", printchar(*stop,buf)); + printf("%ld-%ld\n", (long)startst, (long)stopst,buf); +} + +#ifndef PCHARDONE +#define PCHARDONE /* never again */ +/* + - printchar - make a character printable + == #ifdef REDEBUG + == static char *printchar(int ch); + == #endif + * + * Is this identical to regchar() over in debug.c? Well, yes. But a + * duplicate here avoids having a debugging-capable regexec.o tied to + * a matching debug.o, and this is convenient. It all disappears in + * the non-debug compilation anyway, so it doesn't matter much. + */ +static char * /* -> representation */ +printchar(ch,pbuf) +int ch; +char *pbuf; +{ + if (isprint(ch) || ch == ' ') + sprintf(pbuf, "%c", ch); + else + sprintf(pbuf, "\\%o", ch); + return(pbuf); +} +#endif +#endif + +#undef matcher +#undef fast +#undef slow +#undef dissect +#undef backref +#undef step +#undef print +#undef at +#undef match diff --git a/externals/mysql/extlib/regex/main.c b/externals/mysql/extlib/regex/main.c new file mode 100644 index 00000000000..fa97ca89047 --- /dev/null +++ b/externals/mysql/extlib/regex/main.c @@ -0,0 +1,509 @@ +#include +#include +#include +#include + +#include "my_regex.h" +#include "main.ih" + +char *progname; +int debug = 0; +int line = 0; +int status = 0; + +int copts = REG_EXTENDED; +int eopts = 0; +regoff_t startoff = 0; +regoff_t endoff = 0; + + +extern int split(); +extern void regprint(); + +/* + - main - do the simple case, hand off to regress() for regression + */ +int main(argc, argv) +int argc; +char *argv[]; +{ + my_regex_t re; +# define NS 10 + my_regmatch_t subs[NS]; + char erbuf[100]; + int err; + size_t len; + int c; + int errflg = 0; + register int i; + extern int optind; + extern char *optarg; + + progname = argv[0]; + + while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF) + switch (c) { + case 'c': /* compile options */ + copts = options('c', optarg); + break; + case 'e': /* execute options */ + eopts = options('e', optarg); + break; + case 'S': /* start offset */ + startoff = (regoff_t)atoi(optarg); + break; + case 'E': /* end offset */ + endoff = (regoff_t)atoi(optarg); + break; + case 'x': /* Debugging. */ + debug++; + break; + case '?': + default: + errflg++; + break; + } + if (errflg) { + fprintf(stderr, "usage: %s ", progname); + fprintf(stderr, "[-c copt][-C][-d] [re]\n"); + exit(2); + } + + if (optind >= argc) { + regress(stdin); + exit(status); + } + + err = my_regcomp(&re, argv[optind++], copts, &my_charset_latin1); + if (err) { + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "error %s, %d/%d `%s'\n", + eprint(err), (int) len, (int) sizeof(erbuf), erbuf); + exit(status); + } + regprint(&re, stdout); + + if (optind >= argc) { + my_regfree(&re); + exit(status); + } + + if (eopts®_STARTEND) { + subs[0].rm_so = startoff; + subs[0].rm_eo = strlen(argv[optind]) - endoff; + } + err = my_regexec(&re, argv[optind], (size_t)NS, subs, eopts); + if (err) { + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "error %s, %d/%d `%s'\n", + eprint(err), (int) len, (int) sizeof(erbuf), erbuf); + exit(status); + } + if (!(copts®_NOSUB)) { + len = (int)(subs[0].rm_eo - subs[0].rm_so); + if (subs[0].rm_so != -1) { + if (len != 0) + printf("match `%.*s'\n", (int)len, + argv[optind] + subs[0].rm_so); + else + printf("match `'@%.1s\n", + argv[optind] + subs[0].rm_so); + } + for (i = 1; i < NS; i++) + if (subs[i].rm_so != -1) + printf("(%d) `%.*s'\n", i, + (int)(subs[i].rm_eo - subs[i].rm_so), + argv[optind] + subs[i].rm_so); + } + exit(status); +} + +/* + - regress - main loop of regression test + == void regress(FILE *in); + */ +void +regress(in) +FILE *in; +{ + char inbuf[1000]; +# define MAXF 10 + char *f[MAXF]; + int nf; + int i; + char erbuf[100]; + size_t ne; + const char *badpat = "invalid regular expression"; +# define SHORT 10 + const char *bpname = "REG_BADPAT"; + my_regex_t re; + + while (fgets(inbuf, sizeof(inbuf), in) != NULL) { + line++; + if (inbuf[0] == '#' || inbuf[0] == '\n') + continue; /* NOTE CONTINUE */ + inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */ + if (debug) + fprintf(stdout, "%d:\n", line); + nf = split(inbuf, f, MAXF, "\t\t"); + if (nf < 3) { + fprintf(stderr, "bad input, line %d\n", line); + exit(1); + } + for (i = 0; i < nf; i++) + if (strcmp(f[i], "\"\"") == 0) + f[i] = (char*) ""; + if (nf <= 3) + f[3] = NULL; + if (nf <= 4) + f[4] = NULL; + rx_try(f[0], f[1], f[2], f[3], f[4], options('c', f[1])); + if (opt('&', f[1])) /* try with either type of RE */ + rx_try(f[0], f[1], f[2], f[3], f[4], + options('c', f[1]) &~ REG_EXTENDED); + } + + ne = my_regerror(REG_BADPAT, (my_regex_t *)NULL, erbuf, sizeof(erbuf)); + if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { + fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", + erbuf, badpat); + status = 1; + } + ne = my_regerror(REG_BADPAT, (my_regex_t *)NULL, erbuf, (size_t)SHORT); + if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || + ne != strlen(badpat)+1) { + fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", + erbuf, SHORT-1, badpat); + status = 1; + } + ne = my_regerror(REG_ITOA|REG_BADPAT, (my_regex_t *)NULL, erbuf, sizeof(erbuf)); + if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { + fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", + erbuf, bpname); + status = 1; + } + re.re_endp = bpname; + ne = my_regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); + if (atoi(erbuf) != (int)REG_BADPAT) { + fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", + erbuf, (long)REG_BADPAT); + status = 1; + } else if (ne != strlen(erbuf)+1) { + fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", + erbuf, (long)REG_BADPAT); + status = 1; + } +} + +/* + - rx_try - try it, and report on problems + == void rx_try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); + */ +void +rx_try(f0, f1, f2, f3, f4, opts) +char *f0; +char *f1; +char *f2; +char *f3; +char *f4; +int opts; /* may not match f1 */ +{ + my_regex_t re; +# define NSUBS 10 + my_regmatch_t subs[NSUBS]; +# define NSHOULD 15 + char *should[NSHOULD]; + int nshould; + char erbuf[100]; + int err; + int len; + const char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; + register int i; + char *grump; + char f0copy[1000]; + char f2copy[1000]; + + strcpy(f0copy, f0); + re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; + fixstr(f0copy); + err = my_regcomp(&re, f0copy, opts, &my_charset_latin1); + if (err != 0 && (!opt('C', f1) || err != efind(f2))) { + /* unexpected error or wrong error */ + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", + line, type, eprint(err), len, + (int) sizeof(erbuf), erbuf); + status = 1; + } else if (err == 0 && opt('C', f1)) { + /* unexpected success */ + fprintf(stderr, "%d: %s should have given REG_%s\n", + line, type, f2); + status = 1; + err = 1; /* so we won't try regexec */ + } + + if (err != 0) { + my_regfree(&re); + return; + } + + strcpy(f2copy, f2); + fixstr(f2copy); + + if (options('e', f1)®_STARTEND) { + if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL) + fprintf(stderr, "%d: bad STARTEND syntax\n", line); + subs[0].rm_so = strchr(f2, '(') - f2 + 1; + subs[0].rm_eo = strchr(f2, ')') - f2; + } + err = my_regexec(&re, f2copy, NSUBS, subs, options('e', f1)); + + if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { + /* unexpected error or wrong error */ + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); + fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", + line, type, eprint(err), len, + (int) sizeof(erbuf), erbuf); + status = 1; + } else if (err != 0) { + /* nothing more to check */ + } else if (f3 == NULL) { + /* unexpected success */ + fprintf(stderr, "%d: %s exec should have failed\n", + line, type); + status = 1; + err = 1; /* just on principle */ + } else if (opts®_NOSUB) { + /* nothing more to check */ + } else if ((grump = check(f2, subs[0], f3)) != NULL) { + fprintf(stderr, "%d: %s %s\n", line, type, grump); + status = 1; + err = 1; + } + + if (err != 0 || f4 == NULL) { + my_regfree(&re); + return; + } + + for (i = 1; i < NSHOULD; i++) + should[i] = NULL; + nshould = split(f4, should+1, NSHOULD-1, ","); + if (nshould == 0) { + nshould = 1; + should[1] = (char*) ""; + } + for (i = 1; i < NSUBS; i++) { + grump = check(f2, subs[i], should[i]); + if (grump != NULL) { + fprintf(stderr, "%d: %s $%d %s\n", line, + type, i, grump); + status = 1; + err = 1; + } + } + + my_regfree(&re); +} + +/* + - options - pick options out of a regression-test string + == int options(int type, char *s); + */ +int +options(type, s) +int type; /* 'c' compile, 'e' exec */ +char *s; +{ + register char *p; + register int o = (type == 'c') ? copts : eopts; + register const char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; + + for (p = s; *p != '\0'; p++) + if (strchr(legal, *p) != NULL) + switch (*p) { + case 'b': + o &= ~REG_EXTENDED; + break; + case 'i': + o |= REG_ICASE; + break; + case 's': + o |= REG_NOSUB; + break; + case 'n': + o |= REG_NEWLINE; + break; + case 'm': + o &= ~REG_EXTENDED; + o |= REG_NOSPEC; + break; + case 'p': + o |= REG_PEND; + break; + case '^': + o |= REG_NOTBOL; + break; + case '$': + o |= REG_NOTEOL; + break; + case '#': + o |= REG_STARTEND; + break; + case 't': /* trace */ + o |= REG_TRACE; + break; + case 'l': /* force long representation */ + o |= REG_LARGE; + break; + case 'r': /* force backref use */ + o |= REG_BACKR; + break; + } + return(o); +} + +/* + - opt - is a particular option in a regression string? + == int opt(int c, char *s); + */ +int /* predicate */ +opt(c, s) +int c; +char *s; +{ + return(strchr(s, c) != NULL); +} + +/* + - fixstr - transform magic characters in strings + == void fixstr(register char *p); + */ +void +fixstr(p) +register char *p; +{ + if (p == NULL) + return; + + for (; *p != '\0'; p++) + if (*p == 'N') + *p = '\n'; + else if (*p == 'T') + *p = '\t'; + else if (*p == 'S') + *p = ' '; + else if (*p == 'Z') + *p = '\0'; +} + +/* + - check - check a substring match + == char *check(char *str, regmatch_t sub, char *should); + */ +char * /* NULL or complaint */ +check(str, sub, should) +char *str; +my_regmatch_t sub; +char *should; +{ + register int len; + register int shlen; + register char *p; + static char grump[500]; + register char *at = NULL; + + if (should != NULL && strcmp(should, "-") == 0) + should = NULL; + if (should != NULL && should[0] == '@') { + at = should + 1; + should = (char*) ""; + } + + /* check rm_so and rm_eo for consistency */ + if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) || + (sub.rm_so != -1 && sub.rm_eo == -1) || + (sub.rm_so != -1 && sub.rm_so < 0) || + (sub.rm_eo != -1 && sub.rm_eo < 0) ) { + sprintf(grump, "start %ld end %ld", (long)sub.rm_so, + (long)sub.rm_eo); + return(grump); + } + + /* check for no match */ + if (sub.rm_so == -1 && should == NULL) + return(NULL); + if (sub.rm_so == -1) + return((char*) "did not match"); + + /* check for in range */ + if ((int) sub.rm_eo > (int) strlen(str)) { + sprintf(grump, "start %ld end %ld, past end of string", + (long)sub.rm_so, (long)sub.rm_eo); + return(grump); + } + + len = (int)(sub.rm_eo - sub.rm_so); + shlen = (int)strlen(should); + p = str + sub.rm_so; + + /* check for not supposed to match */ + if (should == NULL) { + sprintf(grump, "matched `%.*s'", len, p); + return(grump); + } + + /* check for wrong match */ + if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { + sprintf(grump, "matched `%.*s' instead", len, p); + return(grump); + } + if (shlen > 0) + return(NULL); + + /* check null match in right place */ + if (at == NULL) + return(NULL); + shlen = strlen(at); + if (shlen == 0) + shlen = 1; /* force check for end-of-string */ + if (strncmp(p, at, shlen) != 0) { + sprintf(grump, "matched null at `%.20s'", p); + return(grump); + } + return(NULL); +} + +/* + - eprint - convert error number to name + == static char *eprint(int err); + */ +static char * +eprint(err) +int err; +{ + static char epbuf[100]; + size_t len; + + len = my_regerror(REG_ITOA|err, (my_regex_t *)NULL, epbuf, sizeof(epbuf)); + assert(len <= sizeof(epbuf)); + return(epbuf); +} + +/* + - efind - convert error name to number + == static int efind(char *name); + */ +static int +efind(name) +char *name; +{ + static char efbuf[100]; + my_regex_t re; + + sprintf(efbuf, "REG_%s", name); + assert(strlen(efbuf) < sizeof(efbuf)); + re.re_endp = efbuf; + (void) my_regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); + return(atoi(efbuf)); +} diff --git a/externals/mysql/extlib/regex/my_regex.h b/externals/mysql/extlib/regex/my_regex.h new file mode 100644 index 00000000000..0d1cedf5430 --- /dev/null +++ b/externals/mysql/extlib/regex/my_regex.h @@ -0,0 +1,86 @@ +#ifndef _REGEX_H_ +#define _REGEX_H_ /* never again */ +/* ========= begin header generated by ./mkh ========= */ +#ifdef __cplusplus +extern "C" { +#endif + +#include "m_ctype.h" + +/* === regex2.h === */ +#ifdef _WIN64 +typedef __int64 regoff_t; +#else +typedef off_t regoff_t; +#endif +struct re_guts; /* none of your business :-) */ +typedef struct { + int re_magic; + size_t re_nsub; /* number of parenthesized subexpressions */ + const char *re_endp; /* end pointer for REG_PEND */ + struct re_guts *re_g; /* none of your business :-) */ + CHARSET_INFO *charset; /* For ctype things */ +} my_regex_t; +typedef struct { + regoff_t rm_so; /* start of match */ + regoff_t rm_eo; /* end of match */ +} my_regmatch_t; + + +/* === regcomp.c === */ +extern int my_regcomp(my_regex_t *, const char *, int, CHARSET_INFO *charset); +#define REG_BASIC 0000 +#define REG_EXTENDED 0001 +#define REG_ICASE 0002 +#define REG_NOSUB 0004 +#define REG_NEWLINE 0010 +#define REG_NOSPEC 0020 +#define REG_PEND 0040 +#define REG_DUMP 0200 + + +/* === regerror.c === */ +#define REG_NOMATCH 1 +#define REG_BADPAT 2 +#define REG_ECOLLATE 3 +#define REG_ECTYPE 4 +#define REG_EESCAPE 5 +#define REG_ESUBREG 6 +#define REG_EBRACK 7 +#define REG_EPAREN 8 +#define REG_EBRACE 9 +#define REG_BADBR 10 +#define REG_ERANGE 11 +#define REG_ESPACE 12 +#define REG_BADRPT 13 +#define REG_EMPTY 14 +#define REG_ASSERT 15 +#define REG_INVARG 16 +#define REG_ATOI 255 /* convert name to number (!) */ +#define REG_ITOA 0400 /* convert number to name (!) */ +extern size_t my_regerror(int, const my_regex_t *, char *, size_t); + + +/* === regexec.c === */ +extern int my_regexec(const my_regex_t *, const char *, size_t, my_regmatch_t [], int); +#define REG_NOTBOL 00001 +#define REG_NOTEOL 00002 +#define REG_STARTEND 00004 +#define REG_TRACE 00400 /* tracing of execution */ +#define REG_LARGE 01000 /* force large representation */ +#define REG_BACKR 02000 /* force use of backref code */ + + +/* === regfree.c === */ +extern void my_regfree(my_regex_t *); + +/* === reginit.c === */ + +extern void my_regex_init(CHARSET_INFO *cs); /* Should be called for multithread progs */ +extern void my_regex_end(void); /* If one wants a clean end */ + +#ifdef __cplusplus +} +#endif +/* ========= end header generated by ./mkh ========= */ +#endif diff --git a/externals/mysql/extlib/regex/regcomp.c b/externals/mysql/extlib/regex/regcomp.c new file mode 100644 index 00000000000..398e132d97d --- /dev/null +++ b/externals/mysql/extlib/regex/regcomp.c @@ -0,0 +1,1672 @@ +#include +#include +#include +#ifdef __WIN__ +#include +#endif + +#include "my_regex.h" +#include "utils.h" +#include "regex2.h" + +#include "cclass.h" +#include "cname.h" + +/* + * parse structure, passed up and down to avoid global variables and + * other clumsinesses + */ +struct parse { + char *next; /* next character in RE */ + char *end; /* end of string (-> NUL normally) */ + int error; /* has an error been seen? */ + sop *strip; /* malloced strip */ + sopno ssize; /* malloced strip size (allocated) */ + sopno slen; /* malloced strip length (used) */ + int ncsalloc; /* number of csets allocated */ + struct re_guts *g; +# define NPAREN 10 /* we need to remember () 1-9 for back refs */ + sopno pbegin[NPAREN]; /* -> ( ([0] unused) */ + sopno pend[NPAREN]; /* -> ) ([0] unused) */ + CHARSET_INFO *charset; /* for ctype things */ +}; + +#include "regcomp.ih" + +static char nuls[10]; /* place to point scanner in event of error */ + +struct cclass cclasses[CCLASS_LAST+1]= { + { "alnum", "","", _MY_U | _MY_L | _MY_NMR}, + { "alpha", "","", _MY_U | _MY_L }, + { "blank", "","", _MY_B }, + { "cntrl", "","", _MY_CTR }, + { "digit", "","", _MY_NMR }, + { "graph", "","", _MY_PNT | _MY_U | _MY_L | _MY_NMR}, + { "lower", "","", _MY_L }, + { "print", "","", _MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B }, + { "punct", "","", _MY_PNT }, + { "space", "","", _MY_SPC }, + { "upper", "","", _MY_U }, + { "xdigit", "","", _MY_X }, + { NULL,NULL,NULL, 0 } +}; + +/* + * macros for use with parse structure + * BEWARE: these know that the parse structure is named `p' !!! + */ +#define PEEK() (*p->next) +#define PEEK2() (*(p->next+1)) +#define MORE() (p->next < p->end) +#define MORE2() (p->next+1 < p->end) +#define SEE(c) (MORE() && PEEK() == (c)) +#define SEETWO(a, b) (MORE() && MORE2() && PEEK() == (a) && PEEK2() == (b)) +#define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) +#define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) +#define NEXT() (p->next++) +#define NEXT2() (p->next += 2) +#define NEXTn(n) (p->next += (n)) +#define GETNEXT() (*p->next++) +#define SETERROR(e) seterr(p, (e)) +#define REQUIRE(co, e) ((co) || SETERROR(e)) +#define MUSTSEE(c, e) (REQUIRE(MORE() && PEEK() == (c), e)) +#define MUSTEAT(c, e) (REQUIRE(MORE() && GETNEXT() == (c), e)) +#define MUSTNOTSEE(c, e) (REQUIRE(!MORE() || PEEK() != (c), e)) +#define EMIT(op, sopnd) doemit(p, (sop)(op), (size_t)(sopnd)) +#define INSERT(op, pos) doinsert(p, (sop)(op), HERE()-(pos)+1, pos) +#define AHEAD(pos) dofwd(p, pos, HERE()-(pos)) +#define ASTERN(sop, pos) EMIT(sop, HERE()-pos) +#define HERE() (p->slen) +#define THERE() (p->slen - 1) +#define THERETHERE() (p->slen - 2) +#define DROP(n) (p->slen -= (n)) + +#ifndef NDEBUG +static int never = 0; /* for use in asserts; shuts lint up */ +#else +#define never 0 /* some s have bugs too */ +#endif + +/* + - regcomp - interface for parser and compilation + = extern int regcomp(regex_t *, const char *, int); + = #define REG_BASIC 0000 + = #define REG_EXTENDED 0001 + = #define REG_ICASE 0002 + = #define REG_NOSUB 0004 + = #define REG_NEWLINE 0010 + = #define REG_NOSPEC 0020 + = #define REG_PEND 0040 + = #define REG_DUMP 0200 + */ +int /* 0 success, otherwise REG_something */ +my_regcomp(preg, pattern, cflags, charset) +my_regex_t *preg; +const char *pattern; +int cflags; +CHARSET_INFO *charset; +{ + struct parse pa; + register struct re_guts *g; + register struct parse *p = &pa; + register int i; + register size_t len; +#ifdef REDEBUG +# define GOODFLAGS(f) (f) +#else +# define GOODFLAGS(f) ((f)&~REG_DUMP) +#endif + + my_regex_init(charset); /* Init cclass if neaded */ + preg->charset=charset; + cflags = GOODFLAGS(cflags); + if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) + return(REG_INVARG); + + if (cflags®_PEND) { + if (preg->re_endp < pattern) + return(REG_INVARG); + len = preg->re_endp - pattern; + } else + len = strlen((char *)pattern); + + /* do the mallocs early so failure handling is easy */ + g = (struct re_guts *)malloc(sizeof(struct re_guts) + + (NC-1)*sizeof(cat_t)); + if (g == NULL) + return(REG_ESPACE); + p->ssize = (long) (len/(size_t)2*(size_t)3 + (size_t)1); /* ugh */ + p->strip = (sop *)malloc(p->ssize * sizeof(sop)); + p->slen = 0; + if (p->strip == NULL) { + free((char *)g); + return(REG_ESPACE); + } + + /* set things up */ + p->g = g; + p->next = (char *)pattern; /* convenience; we do not modify it */ + p->end = p->next + len; + p->error = 0; + p->ncsalloc = 0; + p->charset = preg->charset; + for (i = 0; i < NPAREN; i++) { + p->pbegin[i] = 0; + p->pend[i] = 0; + } + g->csetsize = NC; + g->sets = NULL; + g->setbits = NULL; + g->ncsets = 0; + g->cflags = cflags; + g->iflags = 0; + g->nbol = 0; + g->neol = 0; + g->must = NULL; + g->mlen = 0; + g->nsub = 0; + g->ncategories = 1; /* category 0 is "everything else" */ + g->categories = &g->catspace[-(CHAR_MIN)]; + (void) memset((char *)g->catspace, 0, NC*sizeof(cat_t)); + g->backrefs = 0; + + /* do it */ + EMIT(OEND, 0); + g->firststate = THERE(); + if (cflags®_EXTENDED) + p_ere(p, OUT); + else if (cflags®_NOSPEC) + p_str(p); + else + p_bre(p, OUT, OUT); + EMIT(OEND, 0); + g->laststate = THERE(); + + /* tidy up loose ends and fill things in */ + categorize(p, g); + stripsnug(p, g); + findmust(p, g); + g->nplus = pluscount(p, g); + g->magic = MAGIC2; + preg->re_nsub = g->nsub; + preg->re_g = g; + preg->re_magic = MAGIC1; +#ifndef REDEBUG + /* not debugging, so can't rely on the assert() in regexec() */ + if (g->iflags&BAD) + SETERROR(REG_ASSERT); +#endif + + /* win or lose, we're done */ + if (p->error != 0) /* lose */ + my_regfree(preg); + return(p->error); +} + +/* + - p_ere - ERE parser top level, concatenation and alternation + == static void p_ere(register struct parse *p, int stop); + */ +static void +p_ere(p, stop) +register struct parse *p; +int stop; /* character this ERE should end at */ +{ + register char c; + register sopno prevback; + register sopno prevfwd; + register sopno conc; + register int first = 1; /* is this the first alternative? */ + LINT_INIT(prevback); LINT_INIT(prevfwd); + for (;;) { + /* do a bunch of concatenated expressions */ + conc = HERE(); + while (MORE() && (c = PEEK()) != '|' && c != stop) + p_ere_exp(p); + if(REQUIRE(HERE() != conc, REG_EMPTY)) {}/* require nonempty */ + + if (!EAT('|')) + break; /* NOTE BREAK OUT */ + + if (first) { + INSERT(OCH_, conc); /* offset is wrong */ + prevfwd = conc; + prevback = conc; + first = 0; + } + ASTERN(OOR1, prevback); + prevback = THERE(); + AHEAD(prevfwd); /* fix previous offset */ + prevfwd = HERE(); + EMIT(OOR2, 0); /* offset is very wrong */ + } + + if (!first) { /* tail-end fixups */ + AHEAD(prevfwd); + ASTERN(O_CH, prevback); + } + + assert(!MORE() || SEE(stop)); +} + +/* + - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op + == static void p_ere_exp(register struct parse *p); + */ +static void +p_ere_exp(p) +register struct parse *p; +{ + register char c; + register sopno pos; + register int count; + register int count2; + register sopno subno; + int wascaret = 0; + + assert(MORE()); /* caller should have ensured this */ + c = GETNEXT(); + + pos = HERE(); + switch (c) { + case '(': + if(REQUIRE(MORE(), REG_EPAREN)) {} + p->g->nsub++; + subno = (sopno) p->g->nsub; + if (subno < NPAREN) + p->pbegin[subno] = HERE(); + EMIT(OLPAREN, subno); + if (!SEE(')')) + p_ere(p, ')'); + if (subno < NPAREN) { + p->pend[subno] = HERE(); + assert(p->pend[subno] != 0); + } + EMIT(ORPAREN, subno); + if(MUSTEAT(')', REG_EPAREN)) {} + break; +#ifndef POSIX_MISTAKE + case ')': /* happens only if no current unmatched ( */ + /* + * You may ask, why the ifndef? Because I didn't notice + * this until slightly too late for 1003.2, and none of the + * other 1003.2 regular-expression reviewers noticed it at + * all. So an unmatched ) is legal POSIX, at least until + * we can get it fixed. + */ + SETERROR(REG_EPAREN); + break; +#endif + case '^': + EMIT(OBOL, 0); + p->g->iflags |= USEBOL; + p->g->nbol++; + wascaret = 1; + break; + case '$': + EMIT(OEOL, 0); + p->g->iflags |= USEEOL; + p->g->neol++; + break; + case '|': + SETERROR(REG_EMPTY); + break; + case '*': + case '+': + case '?': + SETERROR(REG_BADRPT); + break; + case '.': + if (p->g->cflags®_NEWLINE) + nonnewline(p); + else + EMIT(OANY, 0); + break; + case '[': + p_bracket(p); + break; + case '\\': + if(REQUIRE(MORE(), REG_EESCAPE)) {} + c = GETNEXT(); + ordinary(p, c); + break; + case '{': /* okay as ordinary except if digit follows */ + if(REQUIRE(!MORE() || !my_isdigit(p->charset,PEEK()), REG_BADRPT)) {} + /* FALLTHROUGH */ + default: + ordinary(p, c); + break; + } + + if (!MORE()) + return; + c = PEEK(); + /* we call { a repetition if followed by a digit */ + if (!( c == '*' || c == '+' || c == '?' || + (c == '{' && MORE2() && + my_isdigit(p->charset,PEEK2())) )) + return; /* no repetition, we're done */ + NEXT(); + + if(REQUIRE(!wascaret, REG_BADRPT)) {} + switch (c) { + case '*': /* implemented as +? */ + /* this case does not require the (y|) trick, noKLUDGE */ + INSERT(OPLUS_, pos); + ASTERN(O_PLUS, pos); + INSERT(OQUEST_, pos); + ASTERN(O_QUEST, pos); + break; + case '+': + INSERT(OPLUS_, pos); + ASTERN(O_PLUS, pos); + break; + case '?': + /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ + INSERT(OCH_, pos); /* offset slightly wrong */ + ASTERN(OOR1, pos); /* this one's right */ + AHEAD(pos); /* fix the OCH_ */ + EMIT(OOR2, 0); /* offset very wrong... */ + AHEAD(THERE()); /* ...so fix it */ + ASTERN(O_CH, THERETHERE()); + break; + case '{': + count = p_count(p); + if (EAT(',')) { + if (my_isdigit(p->charset,PEEK())) { + count2 = p_count(p); + if(REQUIRE(count <= count2, REG_BADBR)) {} + } else /* single number with comma */ + count2 = RE_INFINITY; + } else /* just a single number */ + count2 = count; + repeat(p, pos, count, count2); + if (!EAT('}')) { /* error heuristics */ + while (MORE() && PEEK() != '}') + NEXT(); + if(REQUIRE(MORE(), REG_EBRACE)) {} + SETERROR(REG_BADBR); + } + break; + } + + if (!MORE()) + return; + c = PEEK(); + if (!( c == '*' || c == '+' || c == '?' || + (c == '{' && MORE2() && + my_isdigit(p->charset,PEEK2())) ) ) + return; + SETERROR(REG_BADRPT); +} + +/* + - p_str - string (no metacharacters) "parser" + == static void p_str(register struct parse *p); + */ +static void +p_str(p) +register struct parse *p; +{ + if(REQUIRE(MORE(), REG_EMPTY)) {} + while (MORE()) + ordinary(p, GETNEXT()); +} + +/* + - p_bre - BRE parser top level, anchoring and concatenation + == static void p_bre(register struct parse *p, register int end1, \ + == register int end2); + * Giving end1 as OUT essentially eliminates the end1/end2 check. + * + * This implementation is a bit of a kludge, in that a trailing $ is first + * taken as an ordinary character and then revised to be an anchor. The + * only undesirable side effect is that '$' gets included as a character + * category in such cases. This is fairly harmless; not worth fixing. + * The amount of lookahead needed to avoid this kludge is excessive. + */ +static void +p_bre(p, end1, end2) +register struct parse *p; +register int end1; /* first terminating character */ +register int end2; /* second terminating character */ +{ + register sopno start = HERE(); + register int first = 1; /* first subexpression? */ + register int wasdollar = 0; + + if (EAT('^')) { + EMIT(OBOL, 0); + p->g->iflags |= USEBOL; + p->g->nbol++; + } + while (MORE() && !SEETWO(end1, end2)) { + wasdollar = p_simp_re(p, first); + first = 0; + } + if (wasdollar) { /* oops, that was a trailing anchor */ + DROP(1); + EMIT(OEOL, 0); + p->g->iflags |= USEEOL; + p->g->neol++; + } + + if(REQUIRE(HERE() != start, REG_EMPTY)) {} /* require nonempty */ +} + +/* + - p_simp_re - parse a simple RE, an atom possibly followed by a repetition + == static int p_simp_re(register struct parse *p, int starordinary); + */ +static int /* was the simple RE an unbackslashed $? */ +p_simp_re(p, starordinary) +register struct parse *p; +int starordinary; /* is a leading * an ordinary character? */ +{ + register int c; + register int count; + register int count2; + register sopno pos; + register int i; + register sopno subno; +# define BACKSL (1<g->cflags®_NEWLINE) + nonnewline(p); + else + EMIT(OANY, 0); + break; + case '[': + p_bracket(p); + break; + case BACKSL|'{': + SETERROR(REG_BADRPT); + break; + case BACKSL|'(': + p->g->nsub++; + subno = (sopno) p->g->nsub; + if (subno < NPAREN) + p->pbegin[subno] = HERE(); + EMIT(OLPAREN, subno); + /* the MORE here is an error heuristic */ + if (MORE() && !SEETWO('\\', ')')) + p_bre(p, '\\', ')'); + if (subno < NPAREN) { + p->pend[subno] = HERE(); + assert(p->pend[subno] != 0); + } + EMIT(ORPAREN, subno); + if(REQUIRE(EATTWO('\\', ')'), REG_EPAREN)) {} + break; + case BACKSL|')': /* should not get here -- must be user */ + case BACKSL|'}': + SETERROR(REG_EPAREN); + break; + case BACKSL|'1': + case BACKSL|'2': + case BACKSL|'3': + case BACKSL|'4': + case BACKSL|'5': + case BACKSL|'6': + case BACKSL|'7': + case BACKSL|'8': + case BACKSL|'9': + i = (c&~BACKSL) - '0'; + assert(i < NPAREN); + if (p->pend[i] != 0) { + assert((uint) i <= p->g->nsub); + EMIT(OBACK_, i); + assert(p->pbegin[i] != 0); + assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); + assert(OP(p->strip[p->pend[i]]) == ORPAREN); + (void) dupl(p, p->pbegin[i]+1, p->pend[i]); + EMIT(O_BACK, i); + } else + SETERROR(REG_ESUBREG); + p->g->backrefs = 1; + break; + case '*': + if(REQUIRE(starordinary, REG_BADRPT)) {} + /* FALLTHROUGH */ + default: + ordinary(p, c &~ BACKSL); + break; + } + + if (EAT('*')) { /* implemented as +? */ + /* this case does not require the (y|) trick, noKLUDGE */ + INSERT(OPLUS_, pos); + ASTERN(O_PLUS, pos); + INSERT(OQUEST_, pos); + ASTERN(O_QUEST, pos); + } else if (EATTWO('\\', '{')) { + count = p_count(p); + if (EAT(',')) { + if (MORE() && my_isdigit(p->charset,PEEK())) { + count2 = p_count(p); + if(REQUIRE(count <= count2, REG_BADBR)) {} + } else /* single number with comma */ + count2 = RE_INFINITY; + } else /* just a single number */ + count2 = count; + repeat(p, pos, count, count2); + if (!EATTWO('\\', '}')) { /* error heuristics */ + while (MORE() && !SEETWO('\\', '}')) + NEXT(); + if(REQUIRE(MORE(), REG_EBRACE)) {} + SETERROR(REG_BADBR); + } + } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ + return(1); + + return(0); +} + +/* + - p_count - parse a repetition count + == static int p_count(register struct parse *p); + */ +static int /* the value */ +p_count(p) +register struct parse *p; +{ + register int count = 0; + register int ndigits = 0; + + while (MORE() && my_isdigit(p->charset,PEEK()) && count <= DUPMAX) { + count = count*10 + (GETNEXT() - '0'); + ndigits++; + } + + if(REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR)) {} + return(count); +} + +/* + - p_bracket - parse a bracketed character list + == static void p_bracket(register struct parse *p); + * + * Note a significant property of this code: if the allocset() did SETERROR, + * no set operations are done. + */ +static void +p_bracket(p) +register struct parse *p; +{ + register cset *cs = allocset(p); + register int invert = 0; + + /* Dept of Truly Sickening Special-Case Kludges */ + if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) { + EMIT(OBOW, 0); + NEXTn(6); + return; + } + if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) { + EMIT(OEOW, 0); + NEXTn(6); + return; + } + + if (EAT('^')) + invert++; /* make note to invert set at end */ + if (EAT(']')) + CHadd(cs, ']'); + else if (EAT('-')) + CHadd(cs, '-'); + while (MORE() && PEEK() != ']' && !SEETWO('-', ']')) + p_b_term(p, cs); + if (EAT('-')) + CHadd(cs, '-'); + if(MUSTEAT(']', REG_EBRACK)) {} + + if (p->error != 0) /* don't mess things up further */ + return; + + if (p->g->cflags®_ICASE) { + register int i; + register int ci; + + for (i = p->g->csetsize - 1; i >= 0; i--) + if (CHIN(cs, i) && my_isalpha(p->charset,i)) { + ci = othercase(p->charset,i); + if (ci != i) + CHadd(cs, ci); + } + if (cs->multis != NULL) + mccase(p, cs); + } + if (invert) { + register int i; + + for (i = p->g->csetsize - 1; i >= 0; i--) + if (CHIN(cs, i)) + CHsub(cs, i); + else + CHadd(cs, i); + if (p->g->cflags®_NEWLINE) + CHsub(cs, '\n'); + if (cs->multis != NULL) + mcinvert(p, cs); + } + + assert(cs->multis == NULL); /* xxx */ + + if (nch(p, cs) == 1) { /* optimize singleton sets */ + ordinary(p, firstch(p, cs)); + freeset(p, cs); + } else + EMIT(OANYOF, freezeset(p, cs)); +} + +/* + - p_b_term - parse one term of a bracketed character list + == static void p_b_term(register struct parse *p, register cset *cs); + */ +static void +p_b_term(p, cs) +register struct parse *p; +register cset *cs; +{ + register char c; + register char start, finish; + register int i; + + /* classify what we've got */ + switch ((MORE()) ? PEEK() : '\0') { + case '[': + c = (MORE2()) ? PEEK2() : '\0'; + break; + case '-': + SETERROR(REG_ERANGE); + return; /* NOTE RETURN */ + break; + default: + c = '\0'; + break; + } + + switch (c) { + case ':': /* character class */ + NEXT2(); + if(REQUIRE(MORE(), REG_EBRACK)) {} + c = PEEK(); + if(REQUIRE(c != '-' && c != ']', REG_ECTYPE)) {} + p_b_cclass(p, cs); + if(REQUIRE(MORE(), REG_EBRACK)) {} + if(REQUIRE(EATTWO(':', ']'), REG_ECTYPE)) {} + break; + case '=': /* equivalence class */ + NEXT2(); + if(REQUIRE(MORE(), REG_EBRACK)) {} + c = PEEK(); + if(REQUIRE(c != '-' && c != ']', REG_ECOLLATE)) {} + p_b_eclass(p, cs); + if(REQUIRE(MORE(), REG_EBRACK)) {} + if(REQUIRE(EATTWO('=', ']'), REG_ECOLLATE)) {} + break; + default: /* symbol, ordinary character, or range */ +/* xxx revision needed for multichar stuff */ + start = p_b_symbol(p); + if (SEE('-') && MORE2() && PEEK2() != ']') { + /* range */ + NEXT(); + if (EAT('-')) + finish = '-'; + else + finish = p_b_symbol(p); + } else + finish = start; +/* xxx what about signed chars here... */ + if(REQUIRE(start <= finish, REG_ERANGE)) {} + for (i = start; i <= finish; i++) + CHadd(cs, i); + break; + } +} + +/* + - p_b_cclass - parse a character-class name and deal with it + == static void p_b_cclass(register struct parse *p, register cset *cs); + */ +static void +p_b_cclass(p, cs) +register struct parse *p; +register cset *cs; +{ + register char *sp = p->next; + register struct cclass *cp; + register size_t len; + + while (MORE() && my_isalpha(p->charset,PEEK())) + NEXT(); + len = p->next - sp; + for (cp = cclasses; cp->name != NULL; cp++) + if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') + break; + if (cp->name == NULL) { + /* oops, didn't find it */ + SETERROR(REG_ECTYPE); + return; + } + +#ifndef USE_ORIG_REGEX_CODE + { + register size_t i; + for (i=1 ; i<256 ; i++) + if (p->charset->ctype[i+1] & cp->mask) + CHadd(cs, i); + } +#else + { + register char *u = (char*) cp->chars; + register char c; + + while ((c = *u++) != '\0') + CHadd(cs, c); + + for (u = (char*) cp->multis; *u != '\0'; u += strlen(u) + 1) + MCadd(p, cs, u); + } +#endif + +} + +/* + - p_b_eclass - parse an equivalence-class name and deal with it + == static void p_b_eclass(register struct parse *p, register cset *cs); + * + * This implementation is incomplete. xxx + */ +static void +p_b_eclass(p, cs) +register struct parse *p; +register cset *cs; +{ + register char c; + + c = p_b_coll_elem(p, '='); + CHadd(cs, c); +} + +/* + - p_b_symbol - parse a character or [..]ed multicharacter collating symbol + == static char p_b_symbol(register struct parse *p); + */ +static char /* value of symbol */ +p_b_symbol(p) +register struct parse *p; +{ + register char value; + + if(REQUIRE(MORE(), REG_EBRACK)) {} + if (!EATTWO('[', '.')) + return(GETNEXT()); + + /* collating symbol */ + value = p_b_coll_elem(p, '.'); + if(REQUIRE(EATTWO('.', ']'), REG_ECOLLATE)) {} + return(value); +} + +/* + - p_b_coll_elem - parse a collating-element name and look it up + == static char p_b_coll_elem(register struct parse *p, int endc); + */ +static char /* value of collating element */ +p_b_coll_elem(p, endc) +register struct parse *p; +int endc; /* name ended by endc,']' */ +{ + register char *sp = p->next; + register struct cname *cp; +#ifdef _WIN64 + register __int64 len; +#else + register int len; +#endif + while (MORE() && !SEETWO(endc, ']')) + NEXT(); + if (!MORE()) { + SETERROR(REG_EBRACK); + return(0); + } + len = p->next - sp; + for (cp = cnames; cp->name != NULL; cp++) + if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') + return(cp->code); /* known name */ + if (len == 1) + return(*sp); /* single character */ + SETERROR(REG_ECOLLATE); /* neither */ + return(0); +} + +/* + - othercase - return the case counterpart of an alphabetic + == static char othercase(int ch); + */ +static char /* if no counterpart, return ch */ +othercase(charset,ch) +CHARSET_INFO *charset; +int ch; +{ + /* + In MySQL some multi-byte character sets + have 'ctype' array but don't have 'to_lower' + and 'to_upper' arrays. In this case we handle + only basic latin letters a..z and A..Z. + + If 'to_lower' and 'to_upper' arrays are empty in a character set, + then my_isalpha(cs, ch) should never return TRUE for characters + other than basic latin letters. Otherwise it should be + considered as a mistake in character set definition. + */ + assert(my_isalpha(charset,ch)); + if (my_isupper(charset,ch)) + { + return(charset->to_lower ? my_tolower(charset,ch) : + ch - 'A' + 'a'); + } + else if (my_islower(charset,ch)) + { + return(charset->to_upper ? my_toupper(charset,ch) : + ch - 'a' + 'A'); + } + else /* peculiar, but could happen */ + return(ch); +} + +/* + - bothcases - emit a dualcase version of a two-case character + == static void bothcases(register struct parse *p, int ch); + * + * Boy, is this implementation ever a kludge... + */ +static void +bothcases(p, ch) +register struct parse *p; +int ch; +{ + register char *oldnext = p->next; + register char *oldend = p->end; + char bracket[3]; + + assert(othercase(p->charset, ch) != ch); /* p_bracket() would recurse */ + p->next = bracket; + p->end = bracket+2; + bracket[0] = ch; + bracket[1] = ']'; + bracket[2] = '\0'; + p_bracket(p); + assert(p->next == bracket+2); + p->next = oldnext; + p->end = oldend; +} + +/* + - ordinary - emit an ordinary character + == static void ordinary(register struct parse *p, register int ch); + */ +static void +ordinary(p, ch) +register struct parse *p; +register int ch; +{ + register cat_t *cap = p->g->categories; + + if ((p->g->cflags®_ICASE) && my_isalpha(p->charset,ch) && + othercase(p->charset,ch) != ch) + bothcases(p, ch); + else { + EMIT(OCHAR, (unsigned char)ch); + if (cap[ch] == 0) + cap[ch] = p->g->ncategories++; + } +} + +/* + - nonnewline - emit REG_NEWLINE version of OANY + == static void nonnewline(register struct parse *p); + * + * Boy, is this implementation ever a kludge... + */ +static void +nonnewline(p) +register struct parse *p; +{ + register char *oldnext = p->next; + register char *oldend = p->end; + char bracket[4]; + + p->next = bracket; + p->end = bracket+3; + bracket[0] = '^'; + bracket[1] = '\n'; + bracket[2] = ']'; + bracket[3] = '\0'; + p_bracket(p); + assert(p->next == bracket+3); + p->next = oldnext; + p->end = oldend; +} + +/* + - repeat - generate code for a bounded repetition, recursively if needed + == static void repeat(register struct parse *p, sopno start, int from, int to); + */ +static void +repeat(p, start, from, to) +register struct parse *p; +sopno start; /* operand from here to end of strip */ +int from; /* repeated from this number */ +int to; /* to this number of times (maybe RE_INFINITY) */ +{ + register sopno finish = HERE(); +# define N 2 +# define INF 3 +# define REP(f, t) ((f)*8 + (t)) +# define MAP(n) (((n) <= 1) ? (n) : ((n) == RE_INFINITY) ? INF : N) + register sopno copy; + + if (p->error != 0) /* head off possible runaway recursion */ + return; + + assert(from <= to); + + switch (REP(MAP(from), MAP(to))) { + case REP(0, 0): /* must be user doing this */ + DROP(finish-start); /* drop the operand */ + break; + case REP(0, 1): /* as x{1,1}? */ + case REP(0, N): /* as x{1,n}? */ + case REP(0, INF): /* as x{1,}? */ + /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ + INSERT(OCH_, start); /* offset is wrong... */ + repeat(p, start+1, 1, to); + ASTERN(OOR1, start); + AHEAD(start); /* ... fix it */ + EMIT(OOR2, 0); + AHEAD(THERE()); + ASTERN(O_CH, THERETHERE()); + break; + case REP(1, 1): /* trivial case */ + /* done */ + break; + case REP(1, N): /* as x?x{1,n-1} */ + /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ + INSERT(OCH_, start); + ASTERN(OOR1, start); + AHEAD(start); + EMIT(OOR2, 0); /* offset very wrong... */ + AHEAD(THERE()); /* ...so fix it */ + ASTERN(O_CH, THERETHERE()); + copy = dupl(p, start+1, finish+1); + assert(copy == finish+4); + repeat(p, copy, 1, to-1); + break; + case REP(1, INF): /* as x+ */ + INSERT(OPLUS_, start); + ASTERN(O_PLUS, start); + break; + case REP(N, N): /* as xx{m-1,n-1} */ + copy = dupl(p, start, finish); + repeat(p, copy, from-1, to-1); + break; + case REP(N, INF): /* as xx{n-1,INF} */ + copy = dupl(p, start, finish); + repeat(p, copy, from-1, to); + break; + default: /* "can't happen" */ + SETERROR(REG_ASSERT); /* just in case */ + break; + } +} + +/* + - seterr - set an error condition + == static int seterr(register struct parse *p, int e); + */ +static int /* useless but makes type checking happy */ +seterr(p, e) +register struct parse *p; +int e; +{ + if (p->error == 0) /* keep earliest error condition */ + p->error = e; + p->next = nuls; /* try to bring things to a halt */ + p->end = nuls; + return(0); /* make the return value well-defined */ +} + +/* + - allocset - allocate a set of characters for [] + == static cset *allocset(register struct parse *p); + */ +static cset * +allocset(p) +register struct parse *p; +{ + register int no = p->g->ncsets++; + register size_t nc; + register size_t nbytes; + register cset *cs; + register size_t css = (size_t)p->g->csetsize; + register int i; + + if (no >= p->ncsalloc) { /* need another column of space */ + p->ncsalloc += CHAR_BIT; + nc = p->ncsalloc; + assert(nc % CHAR_BIT == 0); + nbytes = nc / CHAR_BIT * css; + if (p->g->sets == NULL) + p->g->sets = (cset *)malloc(nc * sizeof(cset)); + else + p->g->sets = (cset *)realloc((char *)p->g->sets, + nc * sizeof(cset)); + if (p->g->setbits == NULL) + p->g->setbits = (uch *)malloc(nbytes); + else { + p->g->setbits = (uch *)realloc((char *)p->g->setbits, + nbytes); + /* xxx this isn't right if setbits is now NULL */ + for (i = 0; i < no; i++) + p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT); + } + if (p->g->sets != NULL && p->g->setbits != NULL) + (void) memset((char *)p->g->setbits + (nbytes - css), + 0, css); + else { + no = 0; + SETERROR(REG_ESPACE); + /* caller's responsibility not to do set ops */ + } + } + + assert(p->g->sets != NULL); /* xxx */ + cs = &p->g->sets[no]; + cs->ptr = p->g->setbits + css*((no)/CHAR_BIT); + cs->mask = 1 << ((no) % CHAR_BIT); + cs->hash = 0; + cs->smultis = 0; + cs->multis = NULL; + + return(cs); +} + +/* + - freeset - free a now-unused set + == static void freeset(register struct parse *p, register cset *cs); + */ +static void +freeset(p, cs) +register struct parse *p; +register cset *cs; +{ + register size_t i; + register cset *top = &p->g->sets[p->g->ncsets]; + register size_t css = (size_t)p->g->csetsize; + + for (i = 0; i < css; i++) + CHsub(cs, i); + if (cs == top-1) /* recover only the easy case */ + p->g->ncsets--; +} + +/* + - freezeset - final processing on a set of characters + == static int freezeset(register struct parse *p, register cset *cs); + * + * The main task here is merging identical sets. This is usually a waste + * of time (although the hash code minimizes the overhead), but can win + * big if REG_ICASE is being used. REG_ICASE, by the way, is why the hash + * is done using addition rather than xor -- all ASCII [aA] sets xor to + * the same value! + */ +static int /* set number */ +freezeset(p, cs) +register struct parse *p; +register cset *cs; +{ + register uch h = cs->hash; + register size_t i; + register cset *top = &p->g->sets[p->g->ncsets]; + register cset *cs2; + register size_t css = (size_t)p->g->csetsize; + + /* look for an earlier one which is the same */ + for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) + if (cs2->hash == h && cs2 != cs) { + /* maybe */ + for (i = 0; i < css; i++) + if (!!CHIN(cs2, i) != !!CHIN(cs, i)) + break; /* no */ + if (i == css) + break; /* yes */ + } + + if (cs2 < top) { /* found one */ + freeset(p, cs); + cs = cs2; + } + + return((int)(cs - p->g->sets)); +} + +/* + - firstch - return first character in a set (which must have at least one) + == static int firstch(register struct parse *p, register cset *cs); + */ +static int /* character; there is no "none" value */ +firstch(p, cs) +register struct parse *p; +register cset *cs; +{ + register size_t i; + register size_t css = (size_t)p->g->csetsize; + + for (i = 0; i < css; i++) + if (CHIN(cs, i)) + return((char)i); + assert(never); + return(0); /* arbitrary */ +} + +/* + - nch - number of characters in a set + == static int nch(register struct parse *p, register cset *cs); + */ +static int +nch(p, cs) +register struct parse *p; +register cset *cs; +{ + register size_t i; + register size_t css = (size_t)p->g->csetsize; + register int n = 0; + + for (i = 0; i < css; i++) + if (CHIN(cs, i)) + n++; + return(n); +} + +#ifdef USE_ORIG_REGEX_CODE +/* + - mcadd - add a collating element to a cset + == static void mcadd(register struct parse *p, register cset *cs, \ + == register char *cp); + */ +static void +mcadd(p, cs, cp) +register struct parse *p; +register cset *cs; +register char *cp; +{ + register size_t oldend = cs->smultis; + + cs->smultis += strlen(cp) + 1; + if (cs->multis == NULL) + cs->multis = malloc(cs->smultis); + else + cs->multis = realloc(cs->multis, cs->smultis); + if (cs->multis == NULL) { + SETERROR(REG_ESPACE); + return; + } + + (void) strcpy(cs->multis + oldend - 1, cp); + cs->multis[cs->smultis - 1] = '\0'; +} +#endif + +#ifdef NOT_USED +/* + - mcsub - subtract a collating element from a cset + == static void mcsub(register cset *cs, register char *cp); + */ +static void +mcsub(cs, cp) +register cset *cs; +register char *cp; +{ + register char *fp = mcfind(cs, cp); + register size_t len = strlen(fp); + + assert(fp != NULL); + (void) memmove(fp, fp + len + 1, + cs->smultis - (fp + len + 1 - cs->multis)); + cs->smultis -= len; + + if (cs->smultis == 0) { + free(cs->multis); + cs->multis = NULL; + return; + } + + cs->multis = realloc(cs->multis, cs->smultis); + assert(cs->multis != NULL); +} + +/* + - mcin - is a collating element in a cset? + == static int mcin(register cset *cs, register char *cp); + */ +static int +mcin(cs, cp) +register cset *cs; +register char *cp; +{ + return(mcfind(cs, cp) != NULL); +} + +/* + - mcfind - find a collating element in a cset + == static char *mcfind(register cset *cs, register char *cp); + */ +static char * +mcfind(cs, cp) +register cset *cs; +register char *cp; +{ + register char *p; + + if (cs->multis == NULL) + return(NULL); + for (p = cs->multis; *p != '\0'; p += strlen(p) + 1) + if (strcmp(cp, p) == 0) + return(p); + return(NULL); +} +#endif + +/* + - mcinvert - invert the list of collating elements in a cset + == static void mcinvert(register struct parse *p, register cset *cs); + * + * This would have to know the set of possibilities. Implementation + * is deferred. + */ +static void +mcinvert(p, cs) + register struct parse *p __attribute__((unused)); + register cset *cs __attribute__((unused)); +{ + assert(cs->multis == NULL); /* xxx */ +} + +/* + - mccase - add case counterparts of the list of collating elements in a cset + == static void mccase(register struct parse *p, register cset *cs); + * + * This would have to know the set of possibilities. Implementation + * is deferred. + */ +static void +mccase(p, cs) +register struct parse *p __attribute__((unused)); +register cset *cs __attribute__((unused)); +{ + assert(cs->multis == NULL); /* xxx */ +} + +/* + - isinsets - is this character in any sets? + == static int isinsets(register struct re_guts *g, int c); + */ +static int /* predicate */ +isinsets(g, c) +register struct re_guts *g; +int c; +{ + register uch *col; + register int i; + register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; + register unsigned uc = (unsigned char)c; + + for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) + if (col[uc] != 0) + return(1); + return(0); +} + +/* + - samesets - are these two characters in exactly the same sets? + == static int samesets(register struct re_guts *g, int c1, int c2); + */ +static int /* predicate */ +samesets(g, c1, c2) +register struct re_guts *g; +int c1; +int c2; +{ + register uch *col; + register int i; + register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; + register unsigned uc1 = (unsigned char)c1; + register unsigned uc2 = (unsigned char)c2; + + for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) + if (col[uc1] != col[uc2]) + return(0); + return(1); +} + +/* + - categorize - sort out character categories + == static void categorize(struct parse *p, register struct re_guts *g); + */ +static void +categorize(p, g) +struct parse *p; +register struct re_guts *g; +{ + register cat_t *cats = g->categories; + register int c; + register int c2; + register cat_t cat; + + /* avoid making error situations worse */ + if (p->error != 0) + return; + + for (c = CHAR_MIN; c <= CHAR_MAX; c++) + if (cats[c] == 0 && isinsets(g, c)) { + cat = g->ncategories++; + cats[c] = cat; + for (c2 = c+1; c2 <= CHAR_MAX; c2++) + if (cats[c2] == 0 && samesets(g, c, c2)) + cats[c2] = cat; + } +} + +/* + - dupl - emit a duplicate of a bunch of sops + == static sopno dupl(register struct parse *p, sopno start, sopno finish); + */ +static sopno /* start of duplicate */ +dupl(p, start, finish) +register struct parse *p; +sopno start; /* from here */ +sopno finish; /* to this less one */ +{ + register sopno ret = HERE(); + register sopno len = finish - start; + + assert(finish >= start); + if (len == 0) + return(ret); + enlarge(p, p->ssize + len); /* this many unexpected additions */ + assert(p->ssize >= p->slen + len); + (void) memcpy((char *)(p->strip + p->slen), + (char *)(p->strip + start), (size_t)len*sizeof(sop)); + p->slen += len; + return(ret); +} + +/* + - doemit - emit a strip operator + == static void doemit(register struct parse *p, sop op, size_t opnd); + * + * It might seem better to implement this as a macro with a function as + * hard-case backup, but it's just too big and messy unless there are + * some changes to the data structures. Maybe later. + */ +static void +doemit(p, op, opnd) +register struct parse *p; +sop op; +size_t opnd; +{ + /* avoid making error situations worse */ + if (p->error != 0) + return; + + /* deal with oversize operands ("can't happen", more or less) */ + assert(opnd < 1<slen >= p->ssize) + enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ + assert(p->slen < p->ssize); + + /* finally, it's all reduced to the easy case */ + p->strip[p->slen++] = SOP(op, opnd); +} + +/* + - doinsert - insert a sop into the strip + == static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); + */ +static void +doinsert(p, op, opnd, pos) +register struct parse *p; +sop op; +size_t opnd; +sopno pos; +{ + register sopno sn; + register sop s; + register int i; + + /* avoid making error situations worse */ + if (p->error != 0) + return; + + sn = HERE(); + EMIT(op, opnd); /* do checks, ensure space */ + assert(HERE() == sn+1); + s = p->strip[sn]; + + /* adjust paren pointers */ + assert(pos > 0); + for (i = 1; i < NPAREN; i++) { + if (p->pbegin[i] >= pos) { + p->pbegin[i]++; + } + if (p->pend[i] >= pos) { + p->pend[i]++; + } + } + { + int length=(HERE()-pos-1)*sizeof(sop); + bmove_upp((uchar *) &p->strip[pos+1]+length, + (uchar *) &p->strip[pos]+length, + length); + } +#ifdef OLD_CODE + memmove((char *)&p->strip[pos+1], (char *)&p->strip[pos], + (HERE()-pos-1)*sizeof(sop)); +#endif + p->strip[pos] = s; +} + +/* + - dofwd - complete a forward reference + == static void dofwd(register struct parse *p, sopno pos, sop value); + */ +static void +dofwd(p, pos, value) +register struct parse *p; +register sopno pos; +sop value; +{ + /* avoid making error situations worse */ + if (p->error != 0) + return; + + assert(value < 1<strip[pos] = OP(p->strip[pos]) | value; +} + +/* + - enlarge - enlarge the strip + == static void enlarge(register struct parse *p, sopno size); + */ +static void +enlarge(p, size) +register struct parse *p; +register sopno size; +{ + register sop *sp; + + if (p->ssize >= size) + return; + + sp = (sop *)realloc(p->strip, size*sizeof(sop)); + if (sp == NULL) { + SETERROR(REG_ESPACE); + return; + } + p->strip = sp; + p->ssize = size; +} + +/* + - stripsnug - compact the strip + == static void stripsnug(register struct parse *p, register struct re_guts *g); + */ +static void +stripsnug(p, g) +register struct parse *p; +register struct re_guts *g; +{ + g->nstates = p->slen; + g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop)); + if (g->strip == NULL) { + SETERROR(REG_ESPACE); + g->strip = p->strip; + } +} + +/* + - findmust - fill in must and mlen with longest mandatory literal string + == static void findmust(register struct parse *p, register struct re_guts *g); + * + * This algorithm could do fancy things like analyzing the operands of | + * for common subsequences. Someday. This code is simple and finds most + * of the interesting cases. + * + * Note that must and mlen got initialized during setup. + */ +static void +findmust(p, g) +struct parse *p; +register struct re_guts *g; +{ + register sop *scan; + sop *start; + register sop *newstart; + register sopno newlen; + register sop s; + register char *cp; + register sopno i; + LINT_INIT(start); LINT_INIT(newstart); + /* avoid making error situations worse */ + if (p->error != 0) + return; + + /* find the longest OCHAR sequence in strip */ + newlen = 0; + scan = g->strip + 1; + do { + s = *scan++; + switch (OP(s)) { + case OCHAR: /* sequence member */ + if (newlen == 0) /* new sequence */ + newstart = scan - 1; + newlen++; + break; + case OPLUS_: /* things that don't break one */ + case OLPAREN: + case ORPAREN: + break; + case OQUEST_: /* things that must be skipped */ + case OCH_: + scan--; + do { + scan += OPND(s); + s = *scan; + /* assert() interferes w debug printouts */ + if (OP(s) != O_QUEST && OP(s) != O_CH && + OP(s) != OOR2) { + g->iflags |= BAD; + return; + } + } while (OP(s) != O_QUEST && OP(s) != O_CH); + /* fallthrough */ + default: /* things that break a sequence */ + if (newlen > g->mlen) { /* ends one */ + start = newstart; + g->mlen = newlen; + } + newlen = 0; + break; + } + } while (OP(s) != OEND); + + if (g->mlen == 0) /* there isn't one */ + return; + + /* turn it into a character string */ + g->must = malloc((size_t)g->mlen + 1); + if (g->must == NULL) { /* argh; just forget it */ + g->mlen = 0; + return; + } + cp = g->must; + scan = start; + for (i = g->mlen; i > 0; i--) { + while (OP(s = *scan++) != OCHAR) + continue; + assert(cp < g->must + g->mlen); + *cp++ = (char)OPND(s); + } + assert(cp == g->must + g->mlen); + *cp++ = '\0'; /* just on general principles */ +} + +/* + - pluscount - count + nesting + == static sopno pluscount(register struct parse *p, register struct re_guts *g); + */ +static sopno /* nesting depth */ +pluscount(p, g) +struct parse *p; +register struct re_guts *g; +{ + register sop *scan; + register sop s; + register sopno plusnest = 0; + register sopno maxnest = 0; + + if (p->error != 0) + return(0); /* there may not be an OEND */ + + scan = g->strip + 1; + do { + s = *scan++; + switch (OP(s)) { + case OPLUS_: + plusnest++; + break; + case O_PLUS: + if (plusnest > maxnest) + maxnest = plusnest; + plusnest--; + break; + } + } while (OP(s) != OEND); + if (plusnest != 0) + g->iflags |= BAD; + return(maxnest); +} diff --git a/externals/mysql/extlib/regex/regerror.c b/externals/mysql/extlib/regex/regerror.c new file mode 100644 index 00000000000..489f2e35abb --- /dev/null +++ b/externals/mysql/extlib/regex/regerror.c @@ -0,0 +1,116 @@ +#include +#include +#include + +#include "my_regex.h" +#include "utils.h" +#include "regerror.ih" + +/* + = #define REG_NOMATCH 1 + = #define REG_BADPAT 2 + = #define REG_ECOLLATE 3 + = #define REG_ECTYPE 4 + = #define REG_EESCAPE 5 + = #define REG_ESUBREG 6 + = #define REG_EBRACK 7 + = #define REG_EPAREN 8 + = #define REG_EBRACE 9 + = #define REG_BADBR 10 + = #define REG_ERANGE 11 + = #define REG_ESPACE 12 + = #define REG_BADRPT 13 + = #define REG_EMPTY 14 + = #define REG_ASSERT 15 + = #define REG_INVARG 16 + = #define REG_ATOI 255 // convert name to number (!) + = #define REG_ITOA 0400 // convert number to name (!) + */ +static struct rerr { + int code; + const char *name; + const char *explain; +} rerrs[] = { + {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, + {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, + {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, + {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, + {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, + {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, + {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, + {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, + {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, + {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, + {REG_ERANGE, "REG_ERANGE", "invalid character range"}, + {REG_ESPACE, "REG_ESPACE", "out of memory"}, + {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, + {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, + {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, + {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, + {0, "", "*** unknown regexp error code ***"}, +}; + +/* + - regerror - the interface to error numbers + = extern size_t regerror(int, const regex_t *, char *, size_t); + */ +/* ARGSUSED */ +size_t +my_regerror(int errcode, const my_regex_t *preg, char *errbuf, size_t errbuf_size) +{ + register struct rerr *r; + register size_t len; + register int target = errcode &~ REG_ITOA; + register char *s; + char convbuf[50]; + + if (errcode == REG_ATOI) + s = regatoi(preg, convbuf); + else { + for (r = rerrs; r->code != 0; r++) + if (r->code == target) + break; + + if (errcode®_ITOA) { + if (r->code != 0) + (void) strcpy(convbuf, r->name); + else + sprintf(convbuf, "REG_0x%x", target); + assert(strlen(convbuf) < sizeof(convbuf)); + s = convbuf; + } else + s = (char*) r->explain; + } + + len = strlen(s) + 1; + if (errbuf_size > 0) { + if (errbuf_size > len) + (void) strcpy(errbuf, s); + else { + (void) strncpy(errbuf, s, errbuf_size-1); + errbuf[errbuf_size-1] = '\0'; + } + } + + return(len); +} + +/* + - regatoi - internal routine to implement REG_ATOI + == static char *regatoi(const regex_t *preg, char *localbuf); + */ +static char * +regatoi(preg, localbuf) +const my_regex_t *preg; +char *localbuf; +{ + register struct rerr *r; + for (r = rerrs; r->code != 0; r++) + if (strcmp(r->name, preg->re_endp) == 0) + break; + if (r->code == 0) + return((char*) "0"); + + sprintf(localbuf, "%d", r->code); + return(localbuf); +} diff --git a/externals/mysql/extlib/regex/regex2.h b/externals/mysql/extlib/regex/regex2.h new file mode 100644 index 00000000000..bba54ea2054 --- /dev/null +++ b/externals/mysql/extlib/regex/regex2.h @@ -0,0 +1,145 @@ +/* + * First, the stuff that ends up in the outside-world include file + = typedef off_t regoff_t; + = typedef struct { + = int re_magic; + = size_t re_nsub; // number of parenthesized subexpressions + = const char *re_endp; // end pointer for REG_PEND + = struct re_guts *re_g; // none of your business :-) + = } regex_t; + = typedef struct { + = regoff_t rm_so; // start of match + = regoff_t rm_eo; // end of match + = } regmatch_t; + */ +/* + * internals of regex_t + */ +#ifndef __regex2_h__ +#define __regex2_h__ + +#define MAGIC1 ((('r'^0200)<<8) | 'e') + +/* + * The internal representation is a *strip*, a sequence of + * operators ending with an endmarker. (Some terminology etc. is a + * historical relic of earlier versions which used multiple strips.) + * Certain oddities in the representation are there to permit running + * the machinery backwards; in particular, any deviation from sequential + * flow must be marked at both its source and its destination. Some + * fine points: + * + * - OPLUS_ and O_PLUS are *inside* the loop they create. + * - OQUEST_ and O_QUEST are *outside* the bypass they create. + * - OCH_ and O_CH are *outside* the multi-way branch they create, while + * OOR1 and OOR2 are respectively the end and the beginning of one of + * the branches. Note that there is an implicit OOR2 following OCH_ + * and an implicit OOR1 preceding O_CH. + * + * In state representations, an operator's bit is on to signify a state + * immediately *preceding* "execution" of that operator. + */ +typedef unsigned long sop; /* strip operator */ +typedef long sopno; +#define OPRMASK 0xf8000000 +#define OPDMASK 0x07ffffff +#define OPSHIFT ((unsigned long)27) +#define OP(n) ((unsigned long) ((n)&OPRMASK)) +#define OPND(n) ((unsigned long) ((n)&OPDMASK)) +#define SOP(op, opnd) (unsigned long) ((op)|(opnd)) +#define OSHIFT(A) ((unsigned long) (A) << OPSHIFT) +/* operators meaning operand */ +/* (back, fwd are offsets) */ +#define OEND OSHIFT(1) /* endmarker - */ +#define OCHAR OSHIFT(2) /* character unsigned char */ +#define OBOL OSHIFT(3) /* left anchor - */ +#define OEOL OSHIFT(4) /* right anchor - */ +#define OANY OSHIFT(5) /* . - */ +#define OANYOF OSHIFT(6) /* [...] set number */ +#define OBACK_ OSHIFT(7) /* begin \d paren number */ +#define O_BACK OSHIFT(8) /* end \d paren number */ +#define OPLUS_ OSHIFT(9) /* + prefix fwd to suffix */ +#define O_PLUS OSHIFT(10) /* + suffix back to prefix */ +#define OQUEST_ OSHIFT(11) /* ? prefix fwd to suffix */ +#define O_QUEST OSHIFT(12) /* ? suffix back to prefix */ +#define OLPAREN OSHIFT(13) /* ( fwd to ) */ +#define ORPAREN OSHIFT(14) /* ) back to ( */ +#define OCH_ OSHIFT(15) /* begin choice fwd to OOR2 */ +#define OOR1 OSHIFT(16) /* | pt. 1 back to OOR1 or OCH_ */ +#define OOR2 OSHIFT(17) /* | pt. 2 fwd to OOR2 or O_CH */ +#define O_CH OSHIFT(18) /* end choice back to OOR1 */ +#define OBOW OSHIFT(19) /* begin word - */ +#define OEOW OSHIFT(20) /* end word - */ + +/* + * Structure for [] character-set representation. Character sets are + * done as bit vectors, grouped 8 to a byte vector for compactness. + * The individual set therefore has both a pointer to the byte vector + * and a mask to pick out the relevant bit of each byte. A hash code + * simplifies testing whether two sets could be identical. + * + * This will get trickier for multicharacter collating elements. As + * preliminary hooks for dealing with such things, we also carry along + * a string of multi-character elements, and decide the size of the + * vectors at run time. + */ +#ifdef __WIN__ +typedef unsigned char uch ; +#endif + +typedef struct { + uch *ptr; /* -> uch [csetsize] */ + uch mask; /* bit within array */ + uch hash; /* hash code */ + size_t smultis; + char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */ +} cset; +/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ +#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (uch) (c)) +#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (uch)(c)) +#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask) +#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */ +#define MCsub(p, cs, cp) mcsub(p, cs, cp) +#define MCin(p, cs, cp) mcin(p, cs, cp) + +/* stuff for character categories */ +typedef unsigned char cat_t; + +/* + * main compiled-expression structure + */ +struct re_guts { + int magic; +# define MAGIC2 ((('R'^0200)<<8)|'E') + sop *strip; /* malloced area for strip */ + int csetsize; /* number of bits in a cset vector */ + int ncsets; /* number of csets in use */ + cset *sets; /* -> cset [ncsets] */ + uch *setbits; /* -> uch[csetsize][ncsets/CHAR_BIT] */ + int cflags; /* copy of regcomp() cflags argument */ + sopno nstates; /* = number of sops */ + sopno firststate; /* the initial OEND (normally 0) */ + sopno laststate; /* the final OEND */ + int iflags; /* internal flags */ +# define USEBOL 01 /* used ^ */ +# define USEEOL 02 /* used $ */ +# define BAD 04 /* something wrong */ + int nbol; /* number of ^ used */ + int neol; /* number of $ used */ + int ncategories; /* how many character categories */ + cat_t *categories; /* ->catspace[-CHAR_MIN] */ + char *must; /* match must contain this string */ + int mlen; /* length of must */ + size_t nsub; /* copy of re_nsub */ + int backrefs; /* does it use back references? */ + sopno nplus; /* how deep does it nest +s? */ + /* catspace must be last */ + cat_t catspace[1]; /* actually [NC] */ +}; + +/* misc utilities */ +#undef OUT /* May be defined in windows */ +#define OUT (CHAR_MAX+1) /* a non-character value */ +#define ISWORD(s,c) (my_isalnum(s,c) || (c) == '_') + +#endif /* __regex2_h__ */ diff --git a/externals/mysql/extlib/regex/regexec.c b/externals/mysql/extlib/regex/regexec.c new file mode 100644 index 00000000000..338c1bfa7fe --- /dev/null +++ b/externals/mysql/extlib/regex/regexec.c @@ -0,0 +1,139 @@ +/* + * the outer shell of regexec() + * + * This file includes engine.c *twice*, after muchos fiddling with the + * macros that code uses. This lets the same code operate on two different + * representations for state sets. + */ +#include +#include +#include +#ifdef __WIN__ +#include +#endif +#include "my_regex.h" +#include "utils.h" +#include "regex2.h" + +/* for use in asserts */ +#define nope 0 + +/* macros for manipulating states, small version */ +#define states long +#define states1 long /* for later use in regexec() decision. Ensure Win64 definition is correct.*/ +#define CLEAR(v) ((v) = 0) +#define SET0(v, n) ((v) &= ~((states) 1 << (n))) +#define SET1(v, n) ((v) |= (states) 1 << (n)) +#define ISSET(v, n) ((v) & ((states) 1 << (n))) +#define ASSIGN(d, s) ((d) = (s)) +#define EQ(a, b) ((a) == (b)) +#define STATEVARS int dummy /* dummy version */ +#define STATESETUP(m, n) /* nothing */ +#define STATETEARDOWN(m) /* nothing */ +#define SETUP(v) ((v) = 0) +#define onestate long /* Changed from int by Monty */ +#define INIT(o, n) ((o) = (unsigned states)1 << (n)) +#define INC(o) ((o) <<= 1) +#define ISSTATEIN(v, o) ((v) & (o)) +/* some abbreviations; note that some of these know variable names! */ +/* do "if I'm here, I can also be there" etc without branches */ +#define FWD(dst, src, n) ((dst) |= ((unsigned states)(src)&(here)) << (n)) +#define BACK(dst, src, n) ((dst) |= ((unsigned states)(src)&(here)) >> (n)) +#define ISSETBACK(v, n) ((v) & ((unsigned states)here >> (n))) +/* function names */ +#define SNAMES /* engine.c looks after details */ + +#include "engine.c" + +/* now undo things */ +#undef states +#undef CLEAR +#undef SET0 +#undef SET1 +#undef ISSET +#undef ASSIGN +#undef EQ +#undef STATEVARS +#undef STATESETUP +#undef STATETEARDOWN +#undef SETUP +#undef onestate +#undef INIT +#undef INC +#undef ISSTATEIN +#undef FWD +#undef BACK +#undef ISSETBACK +#undef SNAMES + +/* macros for manipulating states, large version */ +#define states char * +#define CLEAR(v) memset(v, 0, m->g->nstates) +#define SET0(v, n) ((v)[n] = 0) +#define SET1(v, n) ((v)[n] = 1) +#define ISSET(v, n) ((v)[n]) +#define ASSIGN(d, s) memcpy(d, s, m->g->nstates) +#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0) +#define STATEVARS int vn; char *space +#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \ + if ((m)->space == NULL) return(REG_ESPACE); \ + (m)->vn = 0; } +#define STATETEARDOWN(m) { free((m)->space); } +#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates]) +#define onestate int +#define INIT(o, n) ((o) = (n)) +#define INC(o) ((o)++) +#define ISSTATEIN(v, o) ((v)[o]) +/* some abbreviations; note that some of these know variable names! */ +/* do "if I'm here, I can also be there" etc without branches */ +#define FWD(dst, src, n) ((dst)[here+(n)] |= (src)[here]) +#define BACK(dst, src, n) ((dst)[here-(n)] |= (src)[here]) +#define ISSETBACK(v, n) ((v)[here - (n)]) +/* function names */ +#define LNAMES /* flag */ + +#include "engine.c" + +/* + - regexec - interface for matching + = extern int regexec(const regex_t *, const char *, size_t, \ + = regmatch_t [], int); + = #define REG_NOTBOL 00001 + = #define REG_NOTEOL 00002 + = #define REG_STARTEND 00004 + = #define REG_TRACE 00400 // tracing of execution + = #define REG_LARGE 01000 // force large representation + = #define REG_BACKR 02000 // force use of backref code + * + * We put this here so we can exploit knowledge of the state representation + * when choosing which matcher to call. Also, by this point the matchers + * have been prototyped. + */ +int /* 0 success, REG_NOMATCH failure */ +my_regexec(preg, str, nmatch, pmatch, eflags) +const my_regex_t *preg; +const char *str; +size_t nmatch; +my_regmatch_t pmatch[]; +int eflags; +{ + register struct re_guts *g = preg->re_g; +#ifdef REDEBUG +# define GOODFLAGS(f) (f) +#else +# define GOODFLAGS(f) ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND)) +#endif + + if (preg->re_magic != MAGIC1 || g->magic != MAGIC2) + return(REG_BADPAT); + assert(!(g->iflags&BAD)); + if (g->iflags&BAD) /* backstop for no-debug case */ + return(REG_BADPAT); + eflags = GOODFLAGS(eflags); + + if ((size_t) g->nstates <= CHAR_BIT*sizeof(states1) && + !(eflags®_LARGE)) + return(smatcher(preg->charset, g, (char *)str, nmatch, pmatch, eflags)); + else + return(lmatcher(preg->charset, g, (char *)str, nmatch, pmatch, eflags)); +} diff --git a/externals/mysql/extlib/regex/regexp.c b/externals/mysql/extlib/regex/regexp.c new file mode 100644 index 00000000000..8ddf90f2943 --- /dev/null +++ b/externals/mysql/extlib/regex/regexp.c @@ -0,0 +1,1348 @@ +/* + * + * regexp.c - regular expression matching + * + * DESCRIPTION + * + * Underneath the reformatting and comment blocks which were added to + * make it consistent with the rest of the code, you will find a + * modified version of Henry Specer's regular expression library. + * Henry's functions were modified to provide the minimal regular + * expression matching, as required by P1003. Henry's code was + * copyrighted, and copy of the copyright message and restrictions + * are provided, verbatim, below: + * + * Copyright (c) 1986 by University of Toronto. + * Written by Henry Spencer. Not derived from licensed software. + * + * Permission is granted to anyone to use this software for any + * purpose on any computer system, and to redistribute it freely, + * subject to the following restrictions: + * + * 1. The author is not responsible for the consequences of use of + * this software, no matter how awful, even if they arise + * from defects in it. + * + * 2. The origin of this software must not be misrepresented, either + * by explicit claim or by omission. + * + * 3. Altered versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * + * + * This version modified by Ian Phillipps to return pointer to terminating + * NUL on substitution string. [ Temp mail address ex-igp@camcon.co.uk ] + * + * Altered by amylaar to support excompatible option and the + * operators \< and >\ . ( 7.Sep. 1991 ) + * + * regsub altered by amylaar to take an additional parameter specifying + * maximum number of bytes that can be written to the memory region + * pointed to by dest + * + * Also altered by Fredrik Hubinette to handle the + operator and + * eight-bit chars. Mars 22 1996 + * + * + * Beware that some of this code is subtly aware of the way operator + * precedence is structured in regular expressions. Serious changes in + * regular-expression syntax might require a total rethink. + * + * AUTHORS + * + * Mark H. Colburn, NAPS International (mark@jhereg.mn.org) + * Henry Spencer, University of Torronto (henry@utzoo.edu) + * + * Sponsored by The USENIX Association for public distribution. + * + */ + +/* Headers */ +#include "my_global.h" +#include +#include "regexp.h" +#ifdef __WIN__ +#include +#else +#include "memory.h" +#include "error.h" +#endif + +/* + * The "internal use only" fields in regexp.h are present to pass info from + * compile to execute that permits the execute phase to run lots faster on + * simple cases. They are: + * + * regstart char that must begin a match; '\0' if none obvious + * reganch is the match anchored (at beginning-of-line only)? + * regmust string (pointer into program) that match must include, or NULL + * regmlen length of regmust string + * + * Regstart and reganch permit very fast decisions on suitable starting points + * for a match, cutting down the work a lot. Regmust permits fast rejection + * of lines that cannot possibly match. The regmust tests are costly enough + * that regcomp() supplies a regmust only if the r.e. contains something + * potentially expensive (at present, the only such thing detected is * or + + * at the start of the r.e., which can involve a lot of backup). Regmlen is + * supplied because the test in regexec() needs it and regcomp() is computing + * it anyway. + */ + +/* + * Structure for regexp "program". This is essentially a linear encoding + * of a nondeterministic finite-state machine (aka syntax charts or + * "railroad normal form" in parsing technology). Each node is an opcode + * plus a "nxt" pointer, possibly plus an operand. "Nxt" pointers of + * all nodes except BRANCH implement concatenation; a "nxt" pointer with + * a BRANCH on both ends of it is connecting two alternatives. (Here we + * have one of the subtle syntax dependencies: an individual BRANCH (as + * opposed to a collection of them) is never concatenated with anything + * because of operator precedence.) The operand of some types of node is + * a literal string; for others, it is a node leading into a sub-FSM. In + * particular, the operand of a BRANCH node is the first node of the branch. + * (NB this is *not* a tree structure: the tail of the branch connects + * to the thing following the set of BRANCHes.) The opcodes are: + */ + +/* definition number opnd? meaning */ +#define END 0 /* no End of program. */ +#define BOL 1 /* no Match "" at beginning of line. */ +#define EOL 2 /* no Match "" at end of line. */ +#define ANY 3 /* no Match any one character. */ +#define ANYOF 4 /* str Match any character in this string. */ +#define ANYBUT 5 /* str Match any character not in this + * string. */ +#define BRANCH 6 /* node Match this alternative, or the + * nxt... */ +#define BACK 7 /* no Match "", "nxt" ptr points backward. */ +#define EXACTLY 8 /* str Match this string. */ +#define NOTHING 9 /* no Match empty string. */ +#define STAR 10 /* node Match this (simple) thing 0 or more + * times. */ +#define WORDSTART 11 /* node matching a start of a word */ +#define WORDEND 12 /* node matching an end of a word */ +#define OPEN 20 /* no Mark this point in input as start of + * #n. */ + /* OPEN+1 is number 1, etc. */ +#define CLOSE 30 /* no Analogous to OPEN. */ + +/* + * Opcode notes: + * + * BRANCH The set of branches constituting a single choice are hooked + * together with their "nxt" pointers, since precedence prevents + * anything being concatenated to any individual branch. The + * "nxt" pointer of the last BRANCH in a choice points to the + * thing following the whole choice. This is also where the + * final "nxt" pointer of each individual branch points; each + * branch starts with the operand node of a BRANCH node. + * + * BACK Normal "nxt" pointers all implicitly point forward; BACK + * exists to make loop structures possible. + * + * STAR complex '*', are implemented as circular BRANCH structures + * using BACK. Simple cases (one character per match) are + * implemented with STAR for speed and to minimize recursive + * plunges. + * + * OPEN,CLOSE ...are numbered at compile time. + */ + +/* + * A node is one char of opcode followed by two chars of "nxt" pointer. + * "Nxt" pointers are stored as two 8-bit pieces, high order first. The + * value is a positive offset from the opcode of the node containing it. + * An operand, if any, simply follows the node. (Note that much of the + * code generation knows about this implicit relationship.) + * + * Using two bytes for the "nxt" pointer is vast overkill for most things, + * but allows patterns to get big without disasters. + */ +#define OP(p) (*(p)) +#define NEXT(p) (((*((p)+1)&0377)<<8) + (*((p)+2)&0377)) +#define OPERAND(p) ((p) + 3) + +/* + * The first byte of the regexp internal "program" is actually this magic + * number; the start node begins in the second byte. + */ +#define MAGIC 0234 + +/* + * Utility definitions. + */ + +#ifdef __WIN__ +#define error(X,Y) fprintf(stderr, X, Y) +#endif +#define regerror(X) error("Regexp: %s\n",X); +#define SPECIAL 0x100 +#define LBRAC ('('|SPECIAL) +#define RBRAC (')'|SPECIAL) +#define ASTERIX ('*'|SPECIAL) +#define PLUS ('+'|SPECIAL) +#define OR_OP ('|'|SPECIAL) +#define DOLLAR ('$'|SPECIAL) +#define DOT ('.'|SPECIAL) +#define CARET ('^'|SPECIAL) +#define LSQBRAC ('['|SPECIAL) +#define RSQBRAC (']'|SPECIAL) +#define LSHBRAC ('<'|SPECIAL) +#define RSHBRAC ('>'|SPECIAL) +#define FAIL(m) { regerror(m); return(NULL); } +#define ISMULT(c) ((c) == ASTERIX || (c)==PLUS) +#define META "^$.[()|*+\\" +#ifndef CHARBITS +#define CHARBITS 0xff +#define UCHARAT(p) ((int)*(unsigned char *)(p)) +#else +#define UCHARAT(p) ((int)*(p)&CHARBITS) +#endif +#define ISWORDPART(c) ( isalnum(c) || (c) == '_' ) + +/* + * Flags to be passed up and down. + */ +#define HASWIDTH 01 /* Known never to match null string. */ +#define SIMPLE 02 /* Simple enough to be STAR operand. */ +#define SPSTART 04 /* Starts with * */ +#define WORST 0 /* Worst case. */ +#ifdef __WIN__ +#define STRCHR(A,B) strchr(A,B) +#endif + +/* + * Global work variables for regcomp(). + */ +static short *regparse; /* Input-scan pointer. */ +static int regnpar; /* () count. */ +static char regdummy; +static char *regcode; /* Code-emit pointer; ®dummy = don't. */ +static long regsize; /* Code size. */ + +/* + * Forward declarations for regcomp()'s friends. + */ +#ifndef STATIC +#define STATIC static +#endif +STATIC char *reg(); +STATIC char *regbranch(); +STATIC char *regpiece(); +STATIC char *regatom(); +STATIC char *regnode(); +STATIC char *regnext(); +STATIC void regc(); +STATIC void reginsert(); +STATIC void regtail(); +STATIC void regoptail(); + +/* + - regcomp - compile a regular expression into internal code + * + * We can't allocate space until we know how big the compiled form will be, + * but we can't compile it (and thus know how big it is) until we've got a + * place to put the code. So we cheat: we compile it twice, once with code + * generation turned off and size counting turned on, and once "for real". + * This also means that we don't allocate space until we are sure that the + * thing really will compile successfully, and we never have to move the + * code and thus invalidate pointers into it. (Note that it has to be in + * one piece because free() must be able to free it all.) + * + * Beware that the optimization-preparation code in here knows about some + * of the structure of the compiled regexp. + */ +regexp *regcomp(exp,excompat) +char *exp; +int excompat; /* \( \) operators like in unix ex */ +{ + register regexp *r; + register char *scan; + register char *longest; + register int len; + int flags; + short *exp2,*dest,c; + + if (exp == (char *)NULL) + FAIL("NULL argument"); + + exp2=(short*)malloc( (strlen(exp)+1) * (sizeof(short[8])/sizeof(char[8])) ); + for ( scan=exp,dest=exp2;( c= UCHARAT(scan++)); ) { + switch (c) { + case '(': + case ')': + *dest++ = excompat ? c : c | SPECIAL; + break; + case '.': + case '*': + case '+': + case '|': + case '$': + case '^': + case '[': + case ']': + *dest++ = c | SPECIAL; + break; + case '\\': + switch ( c = *scan++ ) { + case '(': + case ')': + *dest++ = excompat ? c | SPECIAL : c; + break; + case '<': + case '>': + *dest++ = c | SPECIAL; + break; + case '{': + case '}': + FAIL("sorry, unimplemented operator"); + case 'b': *dest++ = '\b'; break; + case 't': *dest++ = '\t'; break; + case 'r': *dest++ = '\r'; break; + default: + *dest++ = c; + } + break; + default: + *dest++ = c; + } + } + *dest=0; + /* First pass: determine size, legality. */ + regparse = exp2; + regnpar = 1; + regsize = 0L; + regcode = ®dummy; + regc(MAGIC); + if (reg(0, &flags) == (char *)NULL) + return ((regexp *)NULL); + + /* Small enough for pointer-storage convention? */ + if (regsize >= 32767L) /* Probably could be 65535L. */ + FAIL("regexp too big"); + + /* Allocate space. */ + r = (regexp *) malloc(sizeof(regexp) + (unsigned) regsize); + if (r == (regexp *) NULL) + FAIL("out of space"); + (void) bzero(r, sizeof(regexp) + (unsigned)regsize); + + /* Second pass: emit code. */ + regparse = exp2; + regnpar = 1; + regcode = r->program; + regc(MAGIC); + if (reg(0, &flags) == NULL) + return ((regexp *) NULL); + + /* Dig out information for optimizations. */ + r->regstart = '\0'; /* Worst-case defaults. */ + r->reganch = 0; + r->regmust = NULL; + r->regmlen = 0; + scan = r->program + 1; /* First BRANCH. */ + if (OP(regnext(scan)) == END) { /* Only one top-level choice. */ + scan = OPERAND(scan); + + /* Starting-point info. */ + if (OP(scan) == EXACTLY) + r->regstart = *OPERAND(scan); + else if (OP(scan) == BOL) + r->reganch++; + + /* + * If there's something expensive in the r.e., find the longest + * literal string that must appear and make it the regmust. Resolve + * ties in favor of later strings, since the regstart check works + * with the beginning of the r.e. and avoiding duplication + * strengthens checking. Not a strong reason, but sufficient in the + * absence of others. + */ + if (flags & SPSTART) { + longest = NULL; + len = 0; + for (; scan != NULL; scan = regnext(scan)) + if (OP(scan) == EXACTLY && + (int)strlen(OPERAND(scan)) >= len) { + longest = OPERAND(scan); + len = strlen(OPERAND(scan)); + } + r->regmust = longest; + r->regmlen = len; + } + } + free((char*)exp2); + return (r); +} + +/* + - reg - regular expression, i.e. main body or parenthesized thing + * + * Caller must absorb opening parenthesis. + * + * Combining parenthesis handling with the base level of regular expression + * is a trifle forced, but the need to tie the tails of the branches to what + * follows makes it hard to avoid. + */ +static char *reg(paren, flagp) +int paren; /* Parenthesized? */ +int *flagp; +{ + register char *ret; + register char *br; + register char *ender; + register int parno=0; /* make gcc happy */ + int flags; + + *flagp = HASWIDTH; /* Tentatively. */ + + /* Make an OPEN node, if parenthesized. */ + if (paren) { + if (regnpar >= NSUBEXP) + FAIL("too many ()"); + parno = regnpar; + regnpar++; + ret = regnode(OPEN + parno); + } else + ret = (char *)NULL; + + /* Pick up the branches, linking them together. */ + br = regbranch(&flags); + if (br == (char *)NULL) + return ((char *)NULL); + if (ret != (char *)NULL) + regtail(ret, br); /* OPEN -> first. */ + else + ret = br; + if (!(flags & HASWIDTH)) + *flagp &= ~HASWIDTH; + *flagp |= flags & SPSTART; + while (*regparse == OR_OP) { + regparse++; + br = regbranch(&flags); + if (br == (char *)NULL) + return ((char *)NULL); + regtail(ret, br); /* BRANCH -> BRANCH. */ + if (!(flags & HASWIDTH)) + *flagp &= ~HASWIDTH; + *flagp |= flags & SPSTART; + } + + /* Make a closing node, and hook it on the end. */ + ender = regnode((paren) ? CLOSE + parno : END); + regtail(ret, ender); + + /* Hook the tails of the branches to the closing node. */ + for (br = ret; br != (char *)NULL; br = regnext(br)) + regoptail(br, ender); + + /* Check for proper termination. */ + if (paren && *regparse++ != RBRAC) { + FAIL("unmatched ()"); + } else if (!paren && *regparse != '\0') { + if (*regparse == RBRAC) { + FAIL("unmatched ()"); + } else + FAIL("junk on end");/* "Can't happen". */ + /* NOTREACHED */ + } + return (ret); +} + +/* + - regbranch - one alternative of an | operator + * + * Implements the concatenation operator. + */ +static char *regbranch(flagp) +int *flagp; +{ + register char *ret; + register char *chain; + register char *latest; + int flags; + + *flagp = WORST; /* Tentatively. */ + + ret = regnode(BRANCH); + chain = (char *)NULL; + while (*regparse != '\0' && *regparse != OR_OP && *regparse != RBRAC) { + latest = regpiece(&flags); + if (latest == (char *)NULL) + return ((char *)NULL); + *flagp |= flags & HASWIDTH; + if (chain == (char *)NULL) /* First piece. */ + *flagp |= flags & SPSTART; + else + regtail(chain, latest); + chain = latest; + } + if (chain == (char *)NULL) /* Loop ran zero times. */ + regnode(NOTHING); + + return (ret); +} + +/* + - regpiece - something followed by possible [*] + * + * Note that the branching code sequence used for * is somewhat optimized: + * they use the same NOTHING node as both the endmarker for their branch + * list and the body of the last branch. It might seem that this node could + * be dispensed with entirely, but the endmarker role is not redundant. + */ +static char *regpiece(flagp) +int *flagp; +{ + register char *ret; + register short op; + /* register char *nxt; */ + int flags; + + ret = regatom(&flags); + if (ret == (char *)NULL) + return ((char *)NULL); + + op = *regparse; + if (!ISMULT(op)) { + *flagp = flags; + return (ret); + } + if (!(flags & HASWIDTH)) + FAIL("* or + operand could be empty"); + *flagp = (WORST | SPSTART); + + if(op == ASTERIX) + { + if (flags & SIMPLE) + { + reginsert(STAR, ret); + } + else + { + /* Emit x* as (x&|), where & means "self". */ + reginsert(BRANCH, ret); /* Either x */ + regoptail(ret, regnode(BACK)); /* and loop */ + regoptail(ret, ret); /* back */ + regtail(ret, regnode(BRANCH)); /* or */ + regtail(ret, regnode(NOTHING)); /* null. */ + } + } + else if(op == PLUS) + { + /* Emit a+ as (a&) where & means "self" /Fredrik Hubinette */ + char *tmp; + tmp=regnode(BACK); + reginsert(BRANCH, tmp); + regtail(ret, tmp); + regoptail(tmp, ret); + regtail(ret, regnode(BRANCH)); + regtail(ret, regnode(NOTHING)); + } + + regparse++; + if (ISMULT(*regparse)) + FAIL("nested * or +"); + + return (ret); +} + + +/* + - regatom - the lowest level + * + * Optimization: gobbles an entire sequence of ordinary characters so that + * it can turn them into a single node, which is smaller to store and + * faster to run. + */ +static char *regatom(flagp) +int *flagp; +{ + register char *ret; + int flags; + + *flagp = WORST; /* Tentatively. */ + + switch (*regparse++) { + case CARET: + ret = regnode(BOL); + break; + case DOLLAR: + ret = regnode(EOL); + break; + case DOT: + ret = regnode(ANY); + *flagp |= HASWIDTH | SIMPLE; + break; + case LSHBRAC: + ret = regnode(WORDSTART); + break; + case RSHBRAC: + ret = regnode(WORDEND); + break; + case LSQBRAC:{ + register int class; + register int classend; + + if (*regparse == CARET) { /* Complement of range. */ + ret = regnode(ANYBUT); + regparse++; + } else + ret = regnode(ANYOF); + if (*regparse == RSQBRAC || *regparse == '-') + regc(*regparse++); + while (*regparse != '\0' && *regparse != RSQBRAC) { + if (*regparse == '-') { + regparse++; + if (*regparse == RSQBRAC || *regparse == '\0') + regc('-'); + else { + class = (CHARBITS & *(regparse - 2)) + 1; + classend = (CHARBITS & *(regparse)); + if (class > classend + 1) + FAIL("invalid [] range"); + for (; class <= classend; class++) + regc(class); + regparse++; + } + } else + regc(*regparse++); + } + regc('\0'); + if (*regparse != RSQBRAC) + FAIL("unmatched []"); + regparse++; + *flagp |= HASWIDTH | SIMPLE; + } + break; + case LBRAC: + ret = reg(1, &flags); + if (ret == (char *)NULL) + return ((char *)NULL); + *flagp |= flags & (HASWIDTH | SPSTART); + break; + case '\0': + case OR_OP: + case RBRAC: + FAIL("internal urp"); /* Supposed to be caught earlier. */ + + case ASTERIX: + FAIL("* follows nothing\n"); + + default:{ + register int len; + register short ender; + + regparse--; + for (len=0; regparse[len] && + !(regparse[len]&SPECIAL) && regparse[len] != RSQBRAC; len++) ; + if (len <= 0) + { + FAIL("internal disaster"); + } + ender = *(regparse + len); + if (len > 1 && ISMULT(ender)) + len--; /* Back off clear of * operand. */ + *flagp |= HASWIDTH; + if (len == 1) + *flagp |= SIMPLE; + ret = regnode(EXACTLY); + while (len > 0) { + regc(*regparse++); + len--; + } + regc('\0'); + } + break; + } + + return (ret); +} + +/* + - regnode - emit a node + */ +static char *regnode(op) +char op; +{ + register char *ret; + register char *ptr; + + ret = regcode; + if (ret == ®dummy) { + regsize += 3; + return (ret); + } + ptr = ret; + *ptr++ = op; + *ptr++ = '\0'; /* Null "nxt" pointer. */ + *ptr++ = '\0'; + regcode = ptr; + + return (ret); +} + +/* + - regc - emit (if appropriate) a byte of code + */ +static void regc(b) +char b; +{ + if (regcode != ®dummy) + *regcode++ = b; + else + regsize++; +} + +/* + - reginsert - insert an operator in front of already-emitted operand + * + * Means relocating the operand. + */ +static void reginsert(op, opnd) +char op; +char *opnd; +{ + register char *src; + register char *dst; + register char *place; + + if (regcode == ®dummy) { + regsize += 3; + return; + } + src = regcode; + regcode += 3; + dst = regcode; + while (src > opnd) + *--dst = *--src; + + place = opnd; /* Op node, where operand used to be. */ + *place++ = op; + *place++ = '\0'; + *place++ = '\0'; +} + +/* + - regtail - set the next-pointer at the end of a node chain + */ +static void regtail(p, val) +char *p; +char *val; +{ + register char *scan; + register char *temp; + register int offset; + + if (p == ®dummy) + return; + + /* Find last node. */ + scan = p; + for (;;) { + temp = regnext(scan); + if (temp == (char *)NULL) + break; + scan = temp; + } + + if (OP(scan) == BACK) + offset = scan - val; + else + offset = val - scan; + *(scan + 1) = (offset >> 8) & 0377; + *(scan + 2) = offset & 0377; +} + +/* + - regoptail - regtail on operand of first argument; nop if operandless + */ +static void regoptail(p, val) +char *p; +char *val; +{ + /* "Operandless" and "op != BRANCH" are synonymous in practice. */ + if (p == (char *)NULL || p == ®dummy || OP(p) != BRANCH) + return; + regtail(OPERAND(p), val); +} + +/* + * regexec and friends + */ + +/* + * Global work variables for regexec(). + */ +static char *reginput; /* String-input pointer. */ +static char *regbol; /* Beginning of input, for ^ check. */ +static char **regstartp; /* Pointer to startp array. */ +static char **regendp; /* Ditto for endp. */ + +/* + * Forwards. + */ +STATIC int regtry(); +STATIC int regmatch(); +STATIC int regrepeat(); + +#ifdef DEBUG +int regnarrate = 0; +void regdump(); +STATIC char *regprop(); +#endif + +/* + - regexec - match a regexp against a string + */ +int regexec(prog, string) +register regexp *prog; +register char *string; +{ + register char *s; + + /* Be paranoid... */ + if (prog == (regexp *)NULL || string == (char *)NULL) { + regerror("NULL parameter"); + return (0); + } + /* Check validity of program. */ + if (UCHARAT(prog->program) != MAGIC) { + regerror("corrupted program"); + return (0); + } + /* If there is a "must appear" string, look for it. */ + if (prog->regmust != (char *)NULL) { + s = string; + while ((s = STRCHR(s, prog->regmust[0])) != (char *)NULL) { + if (strncmp(s, prog->regmust, prog->regmlen) == 0) + break; /* Found it. */ + s++; + } + if (s == (char *)NULL) /* Not present. */ + return (0); + } + /* Mark beginning of line for ^ . */ + regbol = string; + + /* Simplest case: anchored match need be tried only once. */ + if (prog->reganch) + return (regtry(prog, string)); + + /* Messy cases: unanchored match. */ + s = string; + if (prog->regstart != '\0') + /* We know what char it must start with. */ + while ((s = STRCHR(s, prog->regstart)) != (char *)NULL) { + if (regtry(prog, s)) + return (1); + s++; + } + else + /* We don't -- general case. */ + do { + if (regtry(prog, s)) + return (1); + } while (*s++ != '\0'); + + /* Failure. */ + return (0); +} + +/* + - regtry - try match at specific point + */ + +static int regtry(regexp *prog, char *string) +{ + register int i; + register char **sp; + register char **ep; + + reginput = string; + regstartp = prog->startp; + regendp = prog->endp; + + sp = prog->startp; + ep = prog->endp; + for (i = NSUBEXP; i > 0; i--) { + *sp++ = (char *)NULL; + *ep++ = (char *)NULL; + } + if (regmatch(prog->program + 1)) { + prog->startp[0] = string; + prog->endp[0] = reginput; + return (1); + } else + return (0); +} + +/* + - regmatch - main matching routine + * + * Conceptually the strategy is simple: check to see whether the current + * node matches, call self recursively to see whether the rest matches, + * and then act accordingly. In practice we make some effort to avoid + * recursion, in particular by going through "ordinary" nodes (that don't + * need to know whether the rest of the match failed) by a loop instead of + * by recursion. + */ + +static int regmatch(char *prog) +{ + register char *scan; /* Current node. */ + char *nxt; /* nxt node. */ + + scan = prog; +#ifdef DEBUG + if (scan != (char *)NULL && regnarrate) + fprintf(stderr, "%s(\n", regprop(scan)); +#endif + while (scan != (char *)NULL) { +#ifdef DEBUG + if (regnarrate) + fprintf(stderr, "%s...\n", regprop(scan)); +#endif + nxt = regnext(scan); + + switch (OP(scan)) { + case BOL: + if (reginput != regbol) + return (0); + break; + case EOL: + if (*reginput != '\0') + return (0); + break; + case ANY: + if (*reginput == '\0') + return (0); + reginput++; + break; + case WORDSTART: + if (reginput == regbol) + break; + if (*reginput == '\0' || + ISWORDPART( *(reginput-1) ) || !ISWORDPART( *reginput ) ) + return (0); + break; + case WORDEND: + if (*reginput == '\0') + break; + if ( reginput == regbol || + !ISWORDPART( *(reginput-1) ) || ISWORDPART( *reginput ) ) + return (0); + break; + case EXACTLY:{ + register int len; + register char *opnd; + + opnd = OPERAND(scan); + /* Inline the first character, for speed. */ + if (*opnd != *reginput) + return (0); + len = strlen(opnd); + if (len > 1 && strncmp(opnd, reginput, len) != 0) + return (0); + reginput += len; + } + break; + case ANYOF: + if (*reginput == '\0' || + STRCHR(OPERAND(scan), *reginput) == (char *)NULL) + return (0); + reginput++; + break; + case ANYBUT: + if (*reginput == '\0' || + STRCHR(OPERAND(scan), *reginput) != (char *)NULL) + return (0); + reginput++; + break; + case NOTHING: + break; + case BACK: + break; + case OPEN + 1: + case OPEN + 2: + case OPEN + 3: + case OPEN + 4: + case OPEN + 5: + case OPEN + 6: + case OPEN + 7: + case OPEN + 8: + case OPEN + 9:{ + register int no; + register char *save; + + no = OP(scan) - OPEN; + save = reginput; + + if (regmatch(nxt)) { + /* + * Don't set startp if some later invocation of the same + * parentheses already has. + */ + if (regstartp[no] == (char *)NULL) + regstartp[no] = save; + return (1); + } else + return (0); + } + + case CLOSE + 1: + case CLOSE + 2: + case CLOSE + 3: + case CLOSE + 4: + case CLOSE + 5: + case CLOSE + 6: + case CLOSE + 7: + case CLOSE + 8: + case CLOSE + 9:{ + register int no; + register char *save; + + no = OP(scan) - CLOSE; + save = reginput; + + if (regmatch(nxt)) { + /* + * Don't set endp if some later invocation of the same + * parentheses already has. + */ + if (regendp[no] == (char *)NULL) + regendp[no] = save; + return (1); + } else + return (0); + } + + case BRANCH:{ + register char *save; + + if (OP(nxt) != BRANCH) /* No choice. */ + nxt = OPERAND(scan); /* Avoid recursion. */ + else { + do { + save = reginput; + if (regmatch(OPERAND(scan))) + return (1); + reginput = save; + scan = regnext(scan); + } while (scan != (char *)NULL && OP(scan) == BRANCH); + return (0); + /* NOTREACHED */ + } + } + break; + case STAR:{ + register char nextch; + register int no; + register char *save; + register int minimum; + + /* + * Lookahead to avoid useless match attempts when we know + * what character comes next. + */ + nextch = '\0'; + if (OP(nxt) == EXACTLY) + nextch = *OPERAND(nxt); + minimum = (OP(scan) == STAR) ? 0 : 1; + save = reginput; + no = regrepeat(OPERAND(scan)); + while (no >= minimum) { + /* If it could work, try it. */ + if (nextch == '\0' || *reginput == nextch) + if (regmatch(nxt)) + return (1); + /* Couldn't or didn't -- back up. */ + no--; + reginput = save + no; + } + return (0); + } + + case END: + return (1); /* Success! */ + + default: + regerror("memory corruption"); + return (0); + + } + + scan = nxt; + } + + /* + * We get here only if there's trouble -- normally "case END" is the + * terminating point. + */ + regerror("corrupted pointers"); + return (0); +} + +/* + - regrepeat - repeatedly match something simple, report how many + */ + +static int regrepeat(char *p) +{ + register int count = 0; + register char *scan; + register char *opnd; + + scan = reginput; + opnd = OPERAND(p); + switch (OP(p)) { + case ANY: + count = strlen(scan); + scan += count; + break; + case EXACTLY: + while (*opnd == *scan) { + count++; + scan++; + } + break; + case ANYOF: + while (*scan != '\0' && STRCHR(opnd, *scan) != (char *)NULL) { + count++; + scan++; + } + break; + case ANYBUT: + while (*scan != '\0' && STRCHR(opnd, *scan) == (char *)NULL) { + count++; + scan++; + } + break; + default: /* Oh dear. Called inappropriately. */ + regerror("internal foulup"); + count = 0; /* Best compromise. */ + break; + } + reginput = scan; + + return (count); +} + + +/* + - regnext - dig the "nxt" pointer out of a node + */ + +static char *regnext(register char *p) +{ + register int offset; + + if (p == ®dummy) + return ((char *)NULL); + + offset = NEXT(p); + if (offset == 0) + return ((char *)NULL); + + if (OP(p) == BACK) + return (p - offset); + else + return (p + offset); +} + +#ifdef DEBUG + +STATIC char *regprop(); + +/* + - regdump - dump a regexp onto stdout in vaguely comprehensible form + */ +void regdump(regexp *r) +{ + register char *s; + register char op = EXACTLY; /* Arbitrary non-END op. */ + register char *nxt; + + s = r->program + 1; + while (op != END) { /* While that wasn't END last time... */ + op = OP(s); + printf("%2ld%s", (long)(s - r->program), regprop(s)); /* Where, what. */ + nxt = regnext(s); + if (nxt == (char *)NULL) /* nxt ptr. */ + printf("(0)"); + else + printf("(%ld)", (long)( (s - r->program) + (nxt - s))); + s += 3; + if (op == ANYOF || op == ANYBUT || op == EXACTLY) { + /* Literal string, where present. */ + while (*s != '\0') { + putchar(*s); + s++; + } + s++; + } + putchar('\n'); + } + + /* Header fields of interest. */ + if (r->regstart != '\0') + printf("start `%c' ", r->regstart); + if (r->reganch) + printf("anchored "); + if (r->regmust != (char *)NULL) + printf("must have \"%s\"", r->regmust); + printf("\n"); +} + +/* + - regprop - printable representation of opcode + */ + +static char *regprop(char *op) +{ + register char *p; + static char buf[50]; + + strcpy(buf, ":"); + + switch (OP(op)) { + case BOL: + p = "BOL"; + break; + case EOL: + p = "EOL"; + break; + case ANY: + p = "ANY"; + break; + case ANYOF: + p = "ANYOF"; + break; + case ANYBUT: + p = "ANYBUT"; + break; + case BRANCH: + p = "BRANCH"; + break; + case EXACTLY: + p = "EXACTLY"; + break; + case NOTHING: + p = "NOTHING"; + break; + case BACK: + p = "BACK"; + break; + case END: + p = "END"; + break; + case OPEN + 1: + case OPEN + 2: + case OPEN + 3: + case OPEN + 4: + case OPEN + 5: + case OPEN + 6: + case OPEN + 7: + case OPEN + 8: + case OPEN + 9: + sprintf(buf + strlen(buf), "OPEN%d", OP(op) - OPEN); + p = (char *)NULL; + break; + case CLOSE + 1: + case CLOSE + 2: + case CLOSE + 3: + case CLOSE + 4: + case CLOSE + 5: + case CLOSE + 6: + case CLOSE + 7: + case CLOSE + 8: + case CLOSE + 9: + sprintf(buf + strlen(buf), "CLOSE%d", OP(op) - CLOSE); + p = (char *)NULL; + break; + case STAR: + p = "STAR"; + break; + default: + regerror("corrupted opcode"); + p=(char *)NULL; + break; + } + if (p != (char *)NULL) + strcat(buf, p); + return (buf); +} +#endif + +/* + - regsub - perform substitutions after a regexp match + */ + +char *regsub(regexp *prog, char *source, char *dest, int n) +{ + register char *src; + register char *dst; + register char c; + register int no; + register int len; + extern char *strncpy(); + + if (prog == (regexp *)NULL || + source == (char *)NULL || dest == (char *)NULL) { + regerror("NULL parm to regsub"); + return NULL; + } + if (UCHARAT(prog->program) != MAGIC) { + regerror("damaged regexp fed to regsub"); + return NULL; + } + src = source; + dst = dest; + while ((c = *src++) != '\0') { + if (c == '&') + no = 0; + else if (c == '\\' && '0' <= *src && *src <= '9') + no = *src++ - '0'; + else + no = -1; + + if (no < 0) { /* Ordinary character. */ + if (c == '\\' && (*src == '\\' || *src == '&')) + c = *src++; + if (--n < 0) { /* amylaar */ + regerror("line too long"); + return NULL; + } + *dst++ = c; + } else if (prog->startp[no] != (char *)NULL && + prog->endp[no] != (char *)NULL) { + len = prog->endp[no] - prog->startp[no]; + if ( (n-=len) < 0 ) { /* amylaar */ + regerror("line too long"); + return NULL; + } + strncpy(dst, prog->startp[no], len); + dst += len; + if (len != 0 && *(dst - 1) == '\0') { /* strncpy hit NUL. */ + regerror("damaged match string"); + return NULL; + } + } + } + if (--n < 0) { /* amylaar */ + regerror("line too long"); + return NULL; + } + *dst = '\0'; + return dst; +} + + +#if 0 /* Use the local regerror() in ed.c */ + +void regerror(char *s) +{ + fprintf(stderr, "regexp(3): %s", s); + exit(1); +} +#endif /* 0 */ diff --git a/externals/mysql/extlib/regex/regfree.c b/externals/mysql/extlib/regex/regfree.c new file mode 100644 index 00000000000..f764fcdf84e --- /dev/null +++ b/externals/mysql/extlib/regex/regfree.c @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include "my_regex.h" + +#include "utils.h" +#include "regex2.h" + +/* + - regfree - free everything + = extern void regfree(regex_t *); + */ +void +my_regfree(preg) +my_regex_t *preg; +{ + register struct re_guts *g; + + if (preg->re_magic != MAGIC1) /* oops */ + return; /* nice to complain, but hard */ + + g = preg->re_g; + if (g == NULL || g->magic != MAGIC2) /* oops again */ + return; + preg->re_magic = 0; /* mark it invalid */ + g->magic = 0; /* mark it invalid */ + + if (g->strip != NULL) + free((char *)g->strip); + if (g->sets != NULL) + free((char *)g->sets); + if (g->setbits != NULL) + free((char *)g->setbits); + if (g->must != NULL) + free(g->must); + free((char *)g); +} diff --git a/externals/mysql/extlib/regex/reginit.c b/externals/mysql/extlib/regex/reginit.c new file mode 100644 index 00000000000..5980de24030 --- /dev/null +++ b/externals/mysql/extlib/regex/reginit.c @@ -0,0 +1,81 @@ +/* Init cclasses array from ctypes */ + +#include +#include +#include +#include "cclass.h" + +static my_bool regex_inited=0; + +void my_regex_init(CHARSET_INFO *cs) +{ + char buff[CCLASS_LAST][256]; + int count[CCLASS_LAST]; + uint i; + + if (!regex_inited) + { + regex_inited=1; + bzero((uchar*) &count,sizeof(count)); + + for (i=1 ; i<= 255; i++) + { + if (my_isalnum(cs,i)) + buff[CCLASS_ALNUM][count[CCLASS_ALNUM]++]=(char) i; + if (my_isalpha(cs,i)) + buff[CCLASS_ALPHA][count[CCLASS_ALPHA]++]=(char) i; + if (my_iscntrl(cs,i)) + buff[CCLASS_CNTRL][count[CCLASS_CNTRL]++]=(char) i; + if (my_isdigit(cs,i)) + buff[CCLASS_DIGIT][count[CCLASS_DIGIT]++]=(char) i; + if (my_isgraph(cs,i)) + buff[CCLASS_GRAPH][count[CCLASS_GRAPH]++]=(char) i; + if (my_islower(cs,i)) + buff[CCLASS_LOWER][count[CCLASS_LOWER]++]=(char) i; + if (my_isprint(cs,i)) + buff[CCLASS_PRINT][count[CCLASS_PRINT]++]=(char) i; + if (my_ispunct(cs,i)) + buff[CCLASS_PUNCT][count[CCLASS_PUNCT]++]=(char) i; + if (my_isspace(cs,i)) + buff[CCLASS_SPACE][count[CCLASS_SPACE]++]=(char) i; + if (my_isupper(cs,i)) + buff[CCLASS_UPPER][count[CCLASS_UPPER]++]=(char) i; + if (my_isxdigit(cs,i)) + buff[CCLASS_XDIGIT][count[CCLASS_XDIGIT]++]=(char) i; + } + buff[CCLASS_BLANK][0]=' '; + buff[CCLASS_BLANK][1]='\t'; + count[CCLASS_BLANK]=2; + for (i=0; i < CCLASS_LAST ; i++) + { + char *tmp=(char*) malloc(count[i]+1); + if (!tmp) + { + /* + This is very unlikely to happen as this function is called once + at program startup + */ + fprintf(stderr, + "Fatal error: Can't allocate memory in regex_init\n"); + exit(1); + } + memcpy(tmp,buff[i],count[i]*sizeof(char)); + tmp[count[i]]=0; + cclasses[i].chars=tmp; + } + } + return; +} + +void my_regex_end() +{ + if (regex_inited) + { + int i; + for (i=0; i < CCLASS_LAST ; i++) + free((char*) cclasses[i].chars); + regex_inited=0; + } +} + + diff --git a/externals/mysql/extlib/regex/split.c b/externals/mysql/extlib/regex/split.c new file mode 100644 index 00000000000..bd2a53c01e3 --- /dev/null +++ b/externals/mysql/extlib/regex/split.c @@ -0,0 +1,316 @@ +#include +#include + +/* + - split - divide a string into fields, like awk split() + = int split(char *string, char *fields[], int nfields, char *sep); + */ +int /* number of fields, including overflow */ +split(string, fields, nfields, sep) +char *string; +char *fields[]; /* list is not NULL-terminated */ +int nfields; /* number of entries available in fields[] */ +char *sep; /* "" white, "c" single char, "ab" [ab]+ */ +{ + register char *p = string; + register char c; /* latest character */ + register char sepc = sep[0]; + register char sepc2; + register int fn; + register char **fp = fields; + register char *sepp; + register int trimtrail; + + /* white space */ + if (sepc == '\0') { + while ((c = *p++) == ' ' || c == '\t') + continue; + p--; + trimtrail = 1; + sep = (char*) " \t"; /* note, code below knows this is 2 long */ + sepc = ' '; + } else + trimtrail = 0; + sepc2 = sep[1]; /* now we can safely pick this up */ + + /* catch empties */ + if (*p == '\0') + return(0); + + /* single separator */ + if (sepc2 == '\0') { + fn = nfields; + for (;;) { + *fp++ = p; + fn--; + if (fn == 0) + break; + while ((c = *p++) != sepc) + if (c == '\0') + return(nfields - fn); + *(p-1) = '\0'; + } + /* we have overflowed the fields vector -- just count them */ + fn = nfields; + for (;;) { + while ((c = *p++) != sepc) + if (c == '\0') + return(fn); + fn++; + } + /* not reached */ + } + + /* two separators */ + if (sep[2] == '\0') { + fn = nfields; + for (;;) { + *fp++ = p; + fn--; + while ((c = *p++) != sepc && c != sepc2) + if (c == '\0') { + if (trimtrail && **(fp-1) == '\0') + fn++; + return(nfields - fn); + } + if (fn == 0) + break; + *(p-1) = '\0'; + while ((c = *p++) == sepc || c == sepc2) + continue; + p--; + } + /* we have overflowed the fields vector -- just count them */ + fn = nfields; + while (c != '\0') { + while ((c = *p++) == sepc || c == sepc2) + continue; + p--; + fn++; + while ((c = *p++) != '\0' && c != sepc && c != sepc2) + continue; + } + /* might have to trim trailing white space */ + if (trimtrail) { + p--; + while ((c = *--p) == sepc || c == sepc2) + continue; + p++; + if (*p != '\0') { + if (fn == nfields+1) + *p = '\0'; + fn--; + } + } + return(fn); + } + + /* n separators */ + fn = 0; + for (;;) { + if (fn < nfields) + *fp++ = p; + fn++; + for (;;) { + c = *p++; + if (c == '\0') + return(fn); + sepp = sep; + while ((sepc = *sepp++) != '\0' && sepc != c) + continue; + if (sepc != '\0') /* it was a separator */ + break; + } + if (fn < nfields) + *(p-1) = '\0'; + for (;;) { + c = *p++; + sepp = sep; + while ((sepc = *sepp++) != '\0' && sepc != c) + continue; + if (sepc == '\0') /* it wasn't a separator */ + break; + } + p--; + } + + /* not reached */ +} + +#ifdef TEST_SPLIT + + +/* + * test program + * pgm runs regression + * pgm sep splits stdin lines by sep + * pgm str sep splits str by sep + * pgm str sep n splits str by sep n times + */ +int +main(argc, argv) +int argc; +char *argv[]; +{ + char buf[512]; + register int n; +# define MNF 10 + char *fields[MNF]; + + if (argc > 4) + for (n = atoi(argv[3]); n > 0; n--) { + (void) strcpy(buf, argv[1]); + } + else if (argc > 3) + for (n = atoi(argv[3]); n > 0; n--) { + (void) strcpy(buf, argv[1]); + (void) split(buf, fields, MNF, argv[2]); + } + else if (argc > 2) + dosplit(argv[1], argv[2]); + else if (argc > 1) + while (fgets(buf, sizeof(buf), stdin) != NULL) { + buf[strlen(buf)-1] = '\0'; /* stomp newline */ + dosplit(buf, argv[1]); + } + else + regress(); + + exit(0); +} + +dosplit(string, seps) +char *string; +char *seps; +{ +# define NF 5 + char *fields[NF]; + register int nf; + + nf = split(string, fields, NF, seps); + print(nf, NF, fields); +} + +print(nf, nfp, fields) +int nf; +int nfp; +char *fields[]; +{ + register int fn; + register int bound; + + bound = (nf > nfp) ? nfp : nf; + printf("%d:\t", nf); + for (fn = 0; fn < bound; fn++) + printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n"); +} + +#define RNF 5 /* some table entries know this */ +struct { + char *str; + char *seps; + int nf; + char *fi[RNF]; +} tests[] = { + "", " ", 0, { "" }, + " ", " ", 2, { "", "" }, + "x", " ", 1, { "x" }, + "xy", " ", 1, { "xy" }, + "x y", " ", 2, { "x", "y" }, + "abc def g ", " ", 5, { "abc", "def", "", "g", "" }, + " a bcd", " ", 4, { "", "", "a", "bcd" }, + "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, + " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, + + "", " _", 0, { "" }, + " ", " _", 2, { "", "" }, + "x", " _", 1, { "x" }, + "x y", " _", 2, { "x", "y" }, + "ab _ cd", " _", 2, { "ab", "cd" }, + " a_b c ", " _", 5, { "", "a", "b", "c", "" }, + "a b c_d e f", " _", 6, { "a", "b", "c", "d", "e f" }, + " a b c d ", " _", 6, { "", "a", "b", "c", "d " }, + + "", " _~", 0, { "" }, + " ", " _~", 2, { "", "" }, + "x", " _~", 1, { "x" }, + "x y", " _~", 2, { "x", "y" }, + "ab _~ cd", " _~", 2, { "ab", "cd" }, + " a_b c~", " _~", 5, { "", "a", "b", "c", "" }, + "a b_c d~e f", " _~", 6, { "a", "b", "c", "d", "e f" }, + "~a b c d ", " _~", 6, { "", "a", "b", "c", "d " }, + + "", " _~-", 0, { "" }, + " ", " _~-", 2, { "", "" }, + "x", " _~-", 1, { "x" }, + "x y", " _~-", 2, { "x", "y" }, + "ab _~- cd", " _~-", 2, { "ab", "cd" }, + " a_b c~", " _~-", 5, { "", "a", "b", "c", "" }, + "a b_c-d~e f", " _~-", 6, { "a", "b", "c", "d", "e f" }, + "~a-b c d ", " _~-", 6, { "", "a", "b", "c", "d " }, + + "", " ", 0, { "" }, + " ", " ", 2, { "", "" }, + "x", " ", 1, { "x" }, + "xy", " ", 1, { "xy" }, + "x y", " ", 2, { "x", "y" }, + "abc def g ", " ", 4, { "abc", "def", "g", "" }, + " a bcd", " ", 3, { "", "a", "bcd" }, + "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, + " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, + + "", "", 0, { "" }, + " ", "", 0, { "" }, + "x", "", 1, { "x" }, + "xy", "", 1, { "xy" }, + "x y", "", 2, { "x", "y" }, + "abc def g ", "", 3, { "abc", "def", "g" }, + "\t a bcd", "", 2, { "a", "bcd" }, + " a \tb\t c ", "", 3, { "a", "b", "c" }, + "a b c d e ", "", 5, { "a", "b", "c", "d", "e" }, + "a b\tc d e f", "", 6, { "a", "b", "c", "d", "e f" }, + " a b c d e f ", "", 6, { "a", "b", "c", "d", "e f " }, + + NULL, NULL, 0, { NULL }, +}; + +regress() +{ + char buf[512]; + register int n; + char *fields[RNF+1]; + register int nf; + register int i; + register int printit; + register char *f; + + for (n = 0; tests[n].str != NULL; n++) { + (void) strcpy(buf, tests[n].str); + fields[RNF] = NULL; + nf = split(buf, fields, RNF, tests[n].seps); + printit = 0; + if (nf != tests[n].nf) { + printf("split `%s' by `%s' gave %d fields, not %d\n", + tests[n].str, tests[n].seps, nf, tests[n].nf); + printit = 1; + } else if (fields[RNF] != NULL) { + printf("split() went beyond array end\n"); + printit = 1; + } else { + for (i = 0; i < nf && i < RNF; i++) { + f = fields[i]; + if (f == NULL) + f = "(NULL)"; + if (strcmp(f, tests[n].fi[i]) != 0) { + printf("split `%s' by `%s', field %d is `%s', not `%s'\n", + tests[n].str, tests[n].seps, + i, fields[i], tests[n].fi[i]); + printit = 1; + } + } + } + if (printit) + print(nf, RNF, fields); + } +} +#endif diff --git a/externals/mysql/extlib/regex/utils.h b/externals/mysql/extlib/regex/utils.h new file mode 100644 index 00000000000..8f85b705bb5 --- /dev/null +++ b/externals/mysql/extlib/regex/utils.h @@ -0,0 +1,22 @@ +/* utility definitions */ +#ifdef _POSIX2_RE_DUP_MAX +#define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */ +#else +#define DUPMAX 255 +#endif +#define RE_INFINITY (DUPMAX + 1) +#define NC (CHAR_MAX - CHAR_MIN + 1) +typedef unsigned char uch; + +/* switch off assertions (if not already off) if no REDEBUG */ +#ifndef REDEBUG +#ifndef NDEBUG +#define NDEBUG /* no assertions please */ +#endif +#endif +#include + +/* for old systems with bcopy() but no memmove() */ +#ifdef USEBCOPY +#define memmove(d, s, c) bcopy(s, d, c) +#endif diff --git a/externals/mysql/extlib/yassl/include/buffer.hpp b/externals/mysql/extlib/yassl/include/buffer.hpp new file mode 100644 index 00000000000..a51bca9a630 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/buffer.hpp @@ -0,0 +1,207 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL buffer header defines input and output buffers to simulate streaming + * with SSL types and sockets + */ + +#ifndef yaSSL_BUFFER_HPP +#define yaSSL_BUFFER_HPP + +#include // assert +#include "yassl_types.hpp" // ysDelete +#include "memory.hpp" // mySTL::auto_ptr +#include STL_ALGORITHM_FILE + + +namespace STL = STL_NAMESPACE; + + +#ifdef _MSC_VER + // disable truncated debug symbols + #pragma warning(disable:4786) +#endif + + +namespace yaSSL { + +typedef unsigned char byte; +typedef unsigned int uint; +const uint AUTO = 0xFEEDBEEF; + + +// Checking Policy should implement a check function that tests whether the +// index is within the size limit of the array +struct Check { + void check(uint i, uint limit); +}; + + +struct NoCheck { + void check(uint, uint); +}; + +/* input_buffer operates like a smart c style array with a checking option, + * meant to be read from through [] with AUTO index or read(). + * Should only write to at/near construction with assign() or raw (e.g., recv) + * followed by add_size with the number of elements added by raw write. + * + * Not using vector because need checked []access, offset, and the ability to + * write to the buffer bulk wise and have the correct size + */ + +class input_buffer : public Check { + uint size_; // number of elements in buffer + uint current_; // current offset position in buffer + byte* buffer_; // storage for buffer + byte* end_; // end of storage marker +public: + input_buffer(); + + explicit input_buffer(uint s); + + // with assign + input_buffer(uint s, const byte* t, uint len); + + ~input_buffer(); + + // users can pass defualt zero length buffer and then allocate + void allocate(uint s); + + // for passing to raw writing functions at beginning, then use add_size + byte* get_buffer() const; + + // after a raw write user can set new size + // if you know the size before the write use assign() + void add_size(uint i); + + uint get_capacity() const; + + uint get_current() const; + + uint get_size() const; + + uint get_remaining() const; + + void set_current(uint i); + + // read only access through [], advance current + // user passes in AUTO index for ease of use + const byte& operator[](uint i); + + // end of input test + bool eof(); + + // peek ahead + byte peek() const; + + // write function, should use at/near construction + void assign(const byte* t, uint s); + + // use read to query input, adjusts current + void read(byte* dst, uint length); + +private: + input_buffer(const input_buffer&); // hide copy + input_buffer& operator=(const input_buffer&); // and assign +}; + + +/* output_buffer operates like a smart c style array with a checking option. + * Meant to be written to through [] with AUTO index or write(). + * Size (current) counter increases when written to. Can be constructed with + * zero length buffer but be sure to allocate before first use. + * Don't use add write for a couple bytes, use [] instead, way less overhead. + * + * Not using vector because need checked []access and the ability to + * write to the buffer bulk wise and retain correct size + */ +class output_buffer : public Check { + uint current_; // current offset and elements in buffer + byte* buffer_; // storage for buffer + byte* end_; // end of storage marker +public: + // default + output_buffer(); + + // with allocate + explicit output_buffer(uint s); + + // with assign + output_buffer(uint s, const byte* t, uint len); + + ~output_buffer(); + + uint get_size() const; + + uint get_capacity() const; + + void set_current(uint c); + + // users can pass defualt zero length buffer and then allocate + void allocate(uint s); + + // for passing to reading functions when finished + const byte* get_buffer() const; + + // allow write access through [], update current + // user passes in AUTO as index for ease of use + byte& operator[](uint i); + + // end of output test + bool eof(); + + void write(const byte* t, uint s); + +private: + output_buffer(const output_buffer&); // hide copy + output_buffer& operator=(const output_buffer&); // and assign +}; + + + + +// turn delete an incomplete type into comipler error instead of warning +template +inline void checked_delete(T* p) +{ + typedef char complete_type[sizeof(T) ? 1 : -1]; + (void)sizeof(complete_type); + ysDelete(p); +} + + +// checked delete functor increases effeciency, no indirection on function call +// sets pointer to zero so safe for std conatiners +struct del_ptr_zero +{ + template + void operator()(T*& p) const + { + T* tmp = 0; + STL::swap(tmp, p); + checked_delete(tmp); + } +}; + + + +} // naemspace + +#endif // yaSSL_BUUFER_HPP diff --git a/externals/mysql/extlib/yassl/include/cert_wrapper.hpp b/externals/mysql/extlib/yassl/include/cert_wrapper.hpp new file mode 100644 index 00000000000..572b9f87293 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/cert_wrapper.hpp @@ -0,0 +1,132 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* The certificate wrapper header defines certificate management functions + * + */ + + +#ifndef yaSSL_CERT_WRAPPER_HPP +#define yaSSL_CERT_WRAPPER_HPP + +#ifdef _MSC_VER + // disable truncated debug symbols + #pragma warning(disable:4786) +#endif + + +#include "yassl_types.hpp" // SignatureAlgorithm +#include "buffer.hpp" // input_buffer +#include "asn.hpp" // SignerList +#include "openssl/ssl.h" // internal and external use +#include STL_LIST_FILE +#include STL_ALGORITHM_FILE + + +namespace STL = STL_NAMESPACE; + + +namespace yaSSL { + +typedef unsigned char opaque; +class X509; // forward openSSL type + +using TaoCrypt::SignerList; + +// an x509 version 3 certificate +class x509 { + uint length_; + opaque* buffer_; +public: + explicit x509(uint sz); + ~x509(); + + uint get_length() const; + const opaque* get_buffer() const; + opaque* use_buffer(); + + x509(const x509&); + x509& operator=(const x509&); +private: + void Swap(x509&); +}; + + +// Certificate Manager keeps a list of the cert chain and public key +class CertManager { + typedef STL::list CertList; + + CertList list_; // self + input_buffer privateKey_; + + CertList peerList_; // peer + input_buffer peerPublicKey_; + X509* peerX509_; // peer's openSSL X509 + + SignatureAlgorithm keyType_; // self key type + SignatureAlgorithm peerKeyType_; // peer's key type + + SignerList signers_; // decoded CA keys and names + // plus verified chained certs + bool verifyPeer_; + bool verifyNone_; // no error if verify fails + bool failNoCert_; + bool sendVerify_; + VerifyCallback verifyCallback_; // user verify callback +public: + CertManager(); + ~CertManager(); + + void AddPeerCert(x509* x); // take ownership + void CopySelfCert(const x509* x); + int CopyCaCert(const x509* x); + int Validate(); + + int SetPrivateKey(const x509&); + + const x509* get_cert() const; + const opaque* get_peerKey() const; + const opaque* get_privateKey() const; + X509* get_peerX509() const; + SignatureAlgorithm get_keyType() const; + SignatureAlgorithm get_peerKeyType() const; + + uint get_peerKeyLength() const; + uint get_privateKeyLength() const; + + bool verifyPeer() const; + bool verifyNone() const; + bool failNoCert() const; + bool sendVerify() const; + + void setVerifyPeer(); + void setVerifyNone(); + void setFailNoCert(); + void setSendVerify(); + void setPeerX509(X509*); + void setVerifyCallback(VerifyCallback); +private: + CertManager(const CertManager&); // hide copy + CertManager& operator=(const CertManager&); // and assign +}; + + +} // naemspace + +#endif // yaSSL_CERT_WRAPPER_HPP diff --git a/externals/mysql/extlib/yassl/include/config.h b/externals/mysql/extlib/yassl/include/config.h new file mode 100644 index 00000000000..adea8dbe8ea --- /dev/null +++ b/externals/mysql/extlib/yassl/include/config.h @@ -0,0 +1,295 @@ + +/* Headers we may want to use. */ +/* #undef HAVE_ALLOCA_H */ +/* #undef HAVE_ARPA_INET_H */ +/* #undef HAVE_CRYPT_H */ +/* #undef HAVE_DIRENT_H */ +/* #undef HAVE_EXECINFO_H */ +#define HAVE_FCNTL_H 1 +/* #undef HAVE_FENV_H */ +#define HAVE_FLOAT_H 1 +/* #undef HAVE_FPU_CONTROL_H */ +/* #undef HAVE_GRP_H */ +/* #undef HAVE_IEEEFP_H */ +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +/* #undef HAVE_NETINET_IN_H */ +/* #undef HAVE_PATHS_H */ +/* #undef HAVE_PWD_H */ +/* #undef HAVE_SCHED_H */ +/* #undef HAVE_SELECT_H */ +#define HAVE_STDDEF_H 1 +#define HAVE_STDLIB_H 1 +/* #undef HAVE_STRINGS_H */ +#define HAVE_STRING_H 1 +/* #undef HAVE_SYNCH_H */ +/* #undef HAVE_SYSENT_H */ +/* #undef HAVE_SYS_FPU_H */ +/* #undef HAVE_SYS_IOCTL_H */ +/* #undef HAVE_SYS_IPC_H */ +/* #undef HAVE_SYS_MMAN_H */ +/* #undef HAVE_SYS_PRCTL_H */ +/* #undef HAVE_SYS_SELECT_H */ +/* #undef HAVE_SYS_SHM_H */ +/* #undef HAVE_SYS_SOCKET_H */ +#define HAVE_SYS_STAT_H 1 +/* #undef HAVE_SYS_STREAM_H */ +#define HAVE_SYS_TIMEB_H 1 +#define HAVE_SYS_TYPES_H 1 +/* #undef HAVE_SYS_UN_H */ +/* #undef HAVE_TERMIOS_H */ +/* #undef HAVE_TERMIO_H */ +/* #undef HAVE_UNISTD_H */ +/* #undef HAVE_UTIME_H */ + +/* Functions we may want to use. */ +#define HAVE_ACCESS 1 +/* #undef HAVE_AIOWAIT */ +/* #undef HAVE_ALARM */ +/* #undef HAVE_ALLOCA */ +/* #undef HAVE_BCMP */ +/* #undef HAVE_BFILL */ +/* #undef HAVE_BMOVE */ +/* #undef HAVE_BZERO */ +/* #undef HAVE_CLOCK_GETTIME */ +/* #undef HAVE_COMPRESS */ +/* #undef HAVE_CRYPT */ +/* #undef HAVE_DLERROR */ +/* #undef HAVE_DLOPEN */ +/* #undef HAVE_FCHMOD */ +/* #undef HAVE_FCNTL */ +/* #undef HAVE_FCONVERT */ +/* #undef HAVE_FDATASYNC */ +/* #undef HAVE_FESETROUND */ +/* #undef HAVE_FINITE */ +/* #undef HAVE_FP_EXCEPT */ +/* #undef HAVE_FSEEKO */ +/* #undef HAVE_FSYNC */ +/* #undef HAVE_GETADDRINFO */ +#define HAVE_GETCWD 1 +/* #undef HAVE_GETHOSTBYADDR_R */ +/* #undef HAVE_GETHOSTBYNAME_R */ +/* #undef HAVE_GETHRTIME */ +/* #undef HAVE_GETNAMEINFO */ +/* #undef HAVE_GETPAGESIZE */ +/* #undef HAVE_GETPASS */ +/* #undef HAVE_GETPASSPHRASE */ +/* #undef HAVE_GETPWNAM */ +/* #undef HAVE_GETPWUID */ +/* #undef HAVE_GETRLIMIT */ +/* #undef HAVE_GETRUSAGE */ +/* #undef HAVE_GETWD */ +/* #undef HAVE_GMTIME_R */ +/* #undef HAVE_INITGROUPS */ +/* #undef HAVE_ISNAN */ +#define HAVE_LDIV 1 +/* #undef HAVE_LOCALTIME_R */ +/* #undef HAVE_LOG2 */ +#define HAVE_LONGJMP 1 +/* #undef HAVE_LSTAT */ +/* #undef HAVE_MADVISE */ +/* #undef HAVE_DECL_MADVISE */ +/* #undef HAVE_MALLINFO */ +#define HAVE_MEMCPY 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMMOVE 1 +/* #undef HAVE_MKSTEMP */ +/* #undef HAVE_MLOCK */ +/* #undef HAVE_MLOCKALL */ +/* #undef HAVE_MMAP */ +/* #undef HAVE_MMAP64 */ +#define HAVE_PERROR 1 +/* #undef HAVE_POLL */ +/* #undef HAVE_PREAD */ +/* #undef HAVE_PTHREAD_ATTR_CREATE */ +/* #undef HAVE_PTHREAD_ATTR_GETSTACKSIZE */ +/* #undef HAVE_PTHREAD_ATTR_SETPRIO */ +/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ +/* #undef HAVE_PTHREAD_ATTR_SETSCOPE */ +/* #undef HAVE_PTHREAD_ATTR_SETSTACKSIZE */ +/* #undef HAVE_PTHREAD_CONDATTR_CREATE */ +/* #undef HAVE_PTHREAD_INIT */ +/* #undef HAVE_PTHREAD_KEY_DELETE */ +/* #undef HAVE_PTHREAD_KEY_DELETE */ +/* #undef HAVE_PTHREAD_KILL */ +/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */ +/* #undef HAVE_PTHREAD_SETPRIO_NP */ +/* #undef HAVE_PTHREAD_SETSCHEDPARAM */ +/* #undef HAVE_PTHREAD_SIGMASK */ +/* #undef HAVE_PTHREAD_THREADMASK */ +/* #undef HAVE_PTHREAD_YIELD_NP */ +/* #undef HAVE_READDIR_R */ +/* #undef HAVE_READLINK */ +/* #undef HAVE_REALPATH */ +#define HAVE_RENAME 1 +/* #undef HAVE_RINT */ +/* #undef HAVE_SCHED_YIELD */ +/* #undef HAVE_SELECT */ +/* #undef HAVE_SETFD */ +/* #undef HAVE_SETFILEPOINTER */ +/* #undef HAVE_SIGACTION */ +/* #undef HAVE_SIGTHREADMASK */ +/* #undef HAVE_SIGWAIT */ +/* #undef HAVE_SLEEP */ +/* #undef HAVE_SNPRINTF */ +/* #undef HAVE_STPCPY */ +#define HAVE_STRERROR 1 +/* #undef HAVE_STRLCPY */ +#define HAVE_STRNLEN 1 +#define HAVE_STRPBRK 1 +/* #undef HAVE_STRSEP */ +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +/* #undef HAVE_STRTOK_R */ +#define HAVE_STRTOL 1 +/* #undef HAVE_STRTOLL */ +#define HAVE_STRTOUL 1 +/* #undef HAVE_STRTOULL */ +#define HAVE_TELL 1 +/* #undef HAVE_THR_SETCONCURRENCY */ +/* #undef HAVE_THR_YIELD */ +/* #undef HAVE_VASPRINTF */ +#define HAVE_VSNPRINTF 1 + +/* Symbols we may use */ +/* #undef HAVE_SYS_ERRLIST */ +/* used by stacktrace functions */ +/* #undef HAVE_BSS_START */ + +/* Does "struct timespec" have a "sec" and "nsec" field? */ +/* #undef HAVE_TIMESPEC_TS_SEC */ + +/* Types we may use */ +#define SIZEOF_CHAR 1 +#if SIZEOF_CHAR +# define HAVE_CHAR 1 +#endif + +#define SIZEOF_CHARP 4 +#if SIZEOF_CHARP +# define HAVE_CHARP 1 +#endif + +#define SIZEOF_SHORT 2 +#if SIZEOF_SHORT +# define HAVE_SHORT 1 +#endif + +#define SIZEOF_INT 4 +#if SIZEOF_INT +# define HAVE_INT 1 +#endif + +#define SIZEOF_LONG 4 +#if SIZEOF_LONG +# define HAVE_LONG 1 +#endif + +#define SIZEOF_LONG_LONG 8 +#if SIZEOF_LONG_LONG +# define HAVE_LONG_LONG 1 +#endif + +#define SIZEOF_OFF_T 4 +#if SIZEOF_OFF_T +# define HAVE_OFF_T 1 +#endif + +/* #undef SIZEOF_SIGSET_T */ +#if SIZEOF_SIGSET_T +# define HAVE_SIGSET_T 1 +#endif + +#define SIZEOF_SIZE_T 4 +#if SIZEOF_SIZE_T +# define HAVE_SIZE_T 1 +#endif + +/* #undef SIZEOF_UCHAR */ +#if SIZEOF_UCHAR +# define HAVE_UCHAR 1 +#endif + +/* #undef SIZEOF_UINT */ +#if SIZEOF_UINT +# define HAVE_UINT 1 +#endif + +/* #undef SIZEOF_ULONG */ +#if SIZEOF_ULONG +# define HAVE_ULONG 1 +#endif + +/* #undef SIZEOF_INT8 */ +#if SIZEOF_INT8 +# define HAVE_INT8 1 +#endif +/* #undef SIZEOF_UINT8 */ +#if SIZEOF_UINT8 +# define HAVE_UINT8 1 +#endif + +/* #undef SIZEOF_INT16 */ +#if SIZEOF_INT16 +# define HAVE_INT16 1 +#endif +/* #undef SIZEOF_UINT16 */ +#if SIZEOF_UINT16 +# define HAVE_UINT16 1 +#endif + +/* #undef SIZEOF_INT32 */ +#if SIZEOF_INT32 +# define HAVE_INT32 1 +#endif +/* #undef SIZEOF_UINT32 */ +#if SIZEOF_UINT32 +# define HAVE_UINT32 1 +#endif +/* #undef SIZEOF_U_INT32_T */ +#if SIZEOF_U_INT32_T +# define HAVE_U_INT32_T 1 +#endif + +/* #undef SIZEOF_INT64 */ +#if SIZEOF_INT64 +# define HAVE_INT64 1 +#endif +/* #undef SIZEOF_UINT64 */ +#if SIZEOF_UINT64 +# define HAVE_UINT64 1 +#endif + +/* #undef SIZEOF_SOCKLEN_T */ +#if SIZEOF_SOCKLEN_T +# define HAVE_SOCKLEN_T 1 +#endif + +/* XXX mysql_client_test uses this -- rip it out, please! */ +#define MAX_INDEXES 64 + +#define QSORT_TYPE_IS_VOID 1 +#define RETQSORTTYPE void + +#define SIGNAL_RETURN_TYPE_IS_VOID 1 +#define RETSIGTYPE void + +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler calls + it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +# define inline +#endif + +#define TIME_WITH_SYS_TIME 1 + +#define STACK_DIRECTION -1 + +#define SHAREDIR "share" +#define THREAD 1 +#define THREAD_SAFE_CLIENT 1 + +#define DEFAULT_CHARSET_HOME "C:/mysql/" diff --git a/externals/mysql/extlib/yassl/include/crypto_wrapper.hpp b/externals/mysql/extlib/yassl/include/crypto_wrapper.hpp new file mode 100644 index 00000000000..07b5925265a --- /dev/null +++ b/externals/mysql/extlib/yassl/include/crypto_wrapper.hpp @@ -0,0 +1,427 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* The crypto wrapper header is used to define policies for the cipher + * components used by SSL. There are 3 policies to consider: + * + * 1) MAC, the Message Authentication Code used for each Message + * 2) Bulk Cipher, the Cipher used to encrypt/decrypt each Message + * 3) Atuhentication, the Digitial Signing/Verifiaction scheme used + * + * This header doesn't rely on a specific crypto libraries internals, + * only the implementation should. + */ + + +#ifndef yaSSL_CRYPTO_WRAPPER_HPP +#define yaSSL_CRYPTO_WRAPPER_HPP + +#include "yassl_types.hpp" +#include // FILE + + +namespace yaSSL { + + +// Digest policy should implement a get_digest, update, and get sizes for pad +// and digest +struct Digest : public virtual_base { + virtual void get_digest(byte*) = 0; + virtual void get_digest(byte*, const byte*, unsigned int) = 0; + virtual void update(const byte*, unsigned int) = 0; + virtual uint get_digestSize() const = 0; + virtual uint get_padSize() const = 0; + virtual ~Digest() {} +}; + + +// For use with NULL Digests +struct NO_MAC : public Digest { + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; +}; + + +// MD5 Digest +class MD5 : public Digest { +public: + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; + MD5(); + ~MD5(); + MD5(const MD5&); + MD5& operator=(const MD5&); +private: + struct MD5Impl; + MD5Impl* pimpl_; +}; + + +// SHA-1 Digest +class SHA : public Digest { +public: + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; + SHA(); + ~SHA(); + SHA(const SHA&); + SHA& operator=(const SHA&); +private: + struct SHAImpl; + SHAImpl* pimpl_; + +}; + + +// RIPEMD-160 Digest +class RMD : public Digest { +public: + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; + RMD(); + ~RMD(); + RMD(const RMD&); + RMD& operator=(const RMD&); +private: + struct RMDImpl; + RMDImpl* pimpl_; + +}; + + +// HMAC_MD5 +class HMAC_MD5 : public Digest { +public: + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; + HMAC_MD5(const byte*, unsigned int); + ~HMAC_MD5(); +private: + struct HMAC_MD5Impl; + HMAC_MD5Impl* pimpl_; + + HMAC_MD5(const HMAC_MD5&); + HMAC_MD5& operator=(const HMAC_MD5&); +}; + + +// HMAC_SHA-1 +class HMAC_SHA : public Digest { +public: + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; + HMAC_SHA(const byte*, unsigned int); + ~HMAC_SHA(); +private: + struct HMAC_SHAImpl; + HMAC_SHAImpl* pimpl_; + + HMAC_SHA(const HMAC_SHA&); + HMAC_SHA& operator=(const HMAC_SHA&); +}; + + +// HMAC_RMD +class HMAC_RMD : public Digest { +public: + void get_digest(byte*); + void get_digest(byte*, const byte*, unsigned int); + void update(const byte*, unsigned int); + uint get_digestSize() const; + uint get_padSize() const; + HMAC_RMD(const byte*, unsigned int); + ~HMAC_RMD(); +private: + struct HMAC_RMDImpl; + HMAC_RMDImpl* pimpl_; + + HMAC_RMD(const HMAC_RMD&); + HMAC_RMD& operator=(const HMAC_RMD&); +}; + + +// BulkCipher policy should implement encrypt, decrypt, get block size, +// and set keys for encrypt and decrypt +struct BulkCipher : public virtual_base { + virtual void encrypt(byte*, const byte*, unsigned int) = 0; + virtual void decrypt(byte*, const byte*, unsigned int) = 0; + virtual void set_encryptKey(const byte*, const byte* = 0) = 0; + virtual void set_decryptKey(const byte*, const byte* = 0) = 0; + virtual uint get_blockSize() const = 0; + virtual int get_keySize() const = 0; + virtual int get_ivSize() const = 0; + virtual ~BulkCipher() {} +}; + + +// For use with NULL Ciphers +struct NO_Cipher : public BulkCipher { + void encrypt(byte*, const byte*, unsigned int) {} + void decrypt(byte*, const byte*, unsigned int) {} + void set_encryptKey(const byte*, const byte*) {} + void set_decryptKey(const byte*, const byte*) {} + uint get_blockSize() const { return 0; } + int get_keySize() const { return 0; } + int get_ivSize() const { return 0; } +}; + + +// SSLv3 and TLSv1 always use DES in CBC mode so IV is required +class DES : public BulkCipher { +public: + void encrypt(byte*, const byte*, unsigned int); + void decrypt(byte*, const byte*, unsigned int); + void set_encryptKey(const byte*, const byte*); + void set_decryptKey(const byte*, const byte*); + uint get_blockSize() const { return DES_BLOCK; } + int get_keySize() const { return DES_KEY_SZ; } + int get_ivSize() const { return DES_IV_SZ; } + DES(); + ~DES(); +private: + struct DESImpl; + DESImpl* pimpl_; + + DES(const DES&); // hide copy + DES& operator=(const DES&); // & assign +}; + + +// 3DES Encrypt-Decrypt-Encrypt in CBC mode +class DES_EDE : public BulkCipher { +public: + void encrypt(byte*, const byte*, unsigned int); + void decrypt(byte*, const byte*, unsigned int); + void set_encryptKey(const byte*, const byte*); + void set_decryptKey(const byte*, const byte*); + uint get_blockSize() const { return DES_BLOCK; } + int get_keySize() const { return DES_EDE_KEY_SZ; } + int get_ivSize() const { return DES_IV_SZ; } + DES_EDE(); + ~DES_EDE(); +private: + struct DES_EDEImpl; + DES_EDEImpl* pimpl_; + + DES_EDE(const DES_EDE&); // hide copy + DES_EDE& operator=(const DES_EDE&); // & assign +}; + + +// Alledged RC4 +class RC4 : public BulkCipher { +public: + void encrypt(byte*, const byte*, unsigned int); + void decrypt(byte*, const byte*, unsigned int); + void set_encryptKey(const byte*, const byte*); + void set_decryptKey(const byte*, const byte*); + uint get_blockSize() const { return 0; } + int get_keySize() const { return RC4_KEY_SZ; } + int get_ivSize() const { return 0; } + RC4(); + ~RC4(); +private: + struct RC4Impl; + RC4Impl* pimpl_; + + RC4(const RC4&); // hide copy + RC4& operator=(const RC4&); // & assign +}; + + +// AES +class AES : public BulkCipher { +public: + void encrypt(byte*, const byte*, unsigned int); + void decrypt(byte*, const byte*, unsigned int); + void set_encryptKey(const byte*, const byte*); + void set_decryptKey(const byte*, const byte*); + uint get_blockSize() const { return AES_BLOCK_SZ; } + int get_keySize() const; + int get_ivSize() const { return AES_IV_SZ; } + explicit AES(unsigned int = AES_128_KEY_SZ); + ~AES(); +private: + struct AESImpl; + AESImpl* pimpl_; + + AES(const AES&); // hide copy + AES& operator=(const AES&); // & assign +}; + + +// Random number generator +class RandomPool { +public: + void Fill(opaque* dst, uint sz) const; + RandomPool(); + ~RandomPool(); + + int GetError() const; + + friend class RSA; + friend class DSS; + friend class DiffieHellman; +private: + struct RandomImpl; + RandomImpl* pimpl_; + + RandomPool(const RandomPool&); // hide copy + RandomPool& operator=(const RandomPool&); // & assign +}; + + +// Authentication policy should implement sign, and verify +struct Auth : public virtual_base { + virtual void sign(byte*, const byte*, unsigned int, const RandomPool&) = 0; + virtual bool verify(const byte*, unsigned int, const byte*, + unsigned int) = 0; + virtual uint get_signatureLength() const = 0; + virtual ~Auth() {} +}; + + +// For use with NULL Authentication schemes +struct NO_Auth : public Auth { + void sign(byte*, const byte*, unsigned int, const RandomPool&) {} + bool verify(const byte*, unsigned int, const byte*, unsigned int) + { return true; } +}; + + +// Digitial Signature Standard scheme +class DSS : public Auth { +public: + void sign(byte*, const byte*, unsigned int, const RandomPool&); + bool verify(const byte*, unsigned int, const byte*, unsigned int); + uint get_signatureLength() const; + DSS(const byte*, unsigned int, bool publicKey = true); + ~DSS(); +private: + struct DSSImpl; + DSSImpl* pimpl_; + + DSS(const DSS&); + DSS& operator=(const DSS&); +}; + + +// RSA Authentication and exchange +class RSA : public Auth { +public: + void sign(byte*, const byte*, unsigned int, const RandomPool&); + bool verify(const byte*, unsigned int, const byte*, unsigned int); + void encrypt(byte*, const byte*, unsigned int, const RandomPool&); + void decrypt(byte*, const byte*, unsigned int, const RandomPool&); + uint get_signatureLength() const; + uint get_cipherLength() const; + RSA(const byte*, unsigned int, bool publicKey = true); + ~RSA(); +private: + struct RSAImpl; + RSAImpl* pimpl_; + + RSA(const RSA&); // hide copy + RSA& operator=(const RSA&); // & assing +}; + + +class Integer; + +// Diffie-Hellman agreement +// hide for now TODO: figure out a way to give access to C clients p and g args +class DiffieHellman { +public: + DiffieHellman(const byte*, unsigned int, const byte*, unsigned int, + const byte*, unsigned int, const RandomPool& random); + //DiffieHellman(const char*, const RandomPool&); + DiffieHellman(const Integer&, const Integer&, const RandomPool&); + ~DiffieHellman(); + + DiffieHellman(const DiffieHellman&); + DiffieHellman& operator=(const DiffieHellman&); + + uint get_agreedKeyLength() const; + const byte* get_agreedKey() const; + const byte* get_publicKey() const; + void makeAgreement(const byte*, unsigned int); + + void set_sizes(int&, int&, int&) const; + void get_parms(byte*, byte*, byte*) const; +private: + struct DHImpl; + DHImpl* pimpl_; +}; + + +// Lagrge Integer +class Integer { +public: + Integer(); + ~Integer(); + + Integer(const Integer&); + Integer& operator=(const Integer&); + + void assign(const byte*, unsigned int); + + friend class DiffieHellman; +private: + struct IntegerImpl; + IntegerImpl* pimpl_; +}; + + +class x509; + + +struct EncryptedInfo { + enum { IV_SZ = 32, NAME_SZ = 80 }; + char name[NAME_SZ]; // max one line + byte iv[IV_SZ]; // in base16 rep + uint ivSz; + bool set; + + EncryptedInfo() : ivSz(0), set(false) {} +}; + +x509* PemToDer(FILE*, CertType, EncryptedInfo* info = 0); + + +} // naemspace + +#endif // yaSSL_CRYPTO_WRAPPER_HPP diff --git a/externals/mysql/extlib/yassl/include/factory.hpp b/externals/mysql/extlib/yassl/include/factory.hpp new file mode 100644 index 00000000000..e66e32dcdf6 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/factory.hpp @@ -0,0 +1,101 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* The factory header defines an Object Factory, used by SSL message and + * handshake types. + * + * See Desgin Pattern in GoF and Alexandrescu's chapter in Modern C++ Design, + * page 208 + */ + + + +#ifndef yaSSL_FACTORY_HPP +#define yaSSL_FACTORY_HPP + +#include STL_VECTOR_FILE +#include STL_PAIR_FILE + + +namespace STL = STL_NAMESPACE; + + + + + +namespace yaSSL { + + +// Factory uses its callback map to create objects by id, +// returning an abstract base pointer +template +class Factory { + typedef STL::pair CallBack; + typedef STL::vector CallBackVector; + + CallBackVector callbacks_; +public: + // pass function pointer to register all callbacks upon creation + explicit Factory(void (*init)(Factory&)) + { + init(*this); + } + + // reserve place in vector before registering, used by init funcion + void Reserve(size_t sz) + { + callbacks_.reserve(sz); + } + + // register callback + void Register(const IdentifierType& id, ProductCreator pc) + { + callbacks_.push_back(STL::make_pair(id, pc)); + } + + // THE Creator, returns a new object of the proper type or 0 + AbstractProduct* CreateObject(const IdentifierType& id) const + { + typedef typename STL::vector::const_iterator cIter; + + cIter first = callbacks_.begin(); + cIter last = callbacks_.end(); + + while (first != last) { + if (first->first == id) + break; + ++first; + } + + if (first == callbacks_.end()) + return 0; + return (first->second)(); + } +private: + Factory(const Factory&); // hide copy + Factory& operator=(const Factory&); // and assign +}; + + +} // naemspace + +#endif // yaSSL_FACTORY_HPP diff --git a/externals/mysql/extlib/yassl/include/handshake.hpp b/externals/mysql/extlib/yassl/include/handshake.hpp new file mode 100644 index 00000000000..549a31bf3e9 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/handshake.hpp @@ -0,0 +1,69 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* The handshake header declares function prototypes for creating and reading + * the various handshake messages. + */ + + + +#ifndef yaSSL_HANDSHAKE_HPP +#define yaSSL_HANDSHAKE_HPP + +#include "yassl_types.hpp" + + +namespace yaSSL { + +// forward decls +class SSL; +class Finished; +class Data; +class Alert; +struct Hashes; + +enum BufferOutput { buffered, unbuffered }; + +void sendClientHello(SSL&); +void sendServerHello(SSL&, BufferOutput = buffered); +void sendServerHelloDone(SSL&, BufferOutput = buffered); +void sendClientKeyExchange(SSL&, BufferOutput = buffered); +void sendServerKeyExchange(SSL&, BufferOutput = buffered); +void sendChangeCipher(SSL&, BufferOutput = buffered); +void sendFinished(SSL&, ConnectionEnd, BufferOutput = buffered); +void sendCertificate(SSL&, BufferOutput = buffered); +void sendCertificateRequest(SSL&, BufferOutput = buffered); +void sendCertificateVerify(SSL&, BufferOutput = buffered); +int sendData(SSL&, const void*, int); +int sendAlert(SSL& ssl, const Alert& alert); + +int receiveData(SSL&, Data&, bool peek = false); +void processReply(SSL&); + +void buildFinished(SSL&, Finished&, const opaque*); +void build_certHashes(SSL&, Hashes&); + +void hmac(SSL&, byte*, const byte*, uint, ContentType, bool verify = false); +void TLS_hmac(SSL&, byte*, const byte*, uint, ContentType, + bool verify = false); +void PRF(byte* digest, uint digLen, const byte* secret, uint secLen, + const byte* label, uint labLen, const byte* seed, uint seedLen); + +} // naemspace + +#endif // yaSSL_HANDSHAKE_HPP diff --git a/externals/mysql/extlib/yassl/include/lock.hpp b/externals/mysql/extlib/yassl/include/lock.hpp new file mode 100644 index 00000000000..0525943e45d --- /dev/null +++ b/externals/mysql/extlib/yassl/include/lock.hpp @@ -0,0 +1,87 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* lock.hpp provides an os specific Lock, locks mutex on entry and unlocks + * automatically upon exit, no-ops provided for Single Threaded +*/ + +#ifndef yaSSL_LOCK_HPP +#define yaSSL_LOCK_HPP + + +namespace yaSSL { + + +#ifdef MULTI_THREADED + #ifdef _WIN32 + #include + + class Mutex { + CRITICAL_SECTION cs_; + public: + Mutex(); + ~Mutex(); + + class Lock; + friend class Lock; + + class Lock { + Mutex& mutex_; + public: + explicit Lock(Mutex& lm); + ~Lock(); + }; + }; + #else // _WIN32 + #include + + class Mutex { + pthread_mutex_t mutex_; + public: + + Mutex(); + ~Mutex(); + + class Lock; + friend class Lock; + + class Lock { + Mutex& mutex_; + public: + explicit Lock(Mutex& lm); + ~Lock(); + }; + }; + + #endif // _WIN32 +#else // MULTI_THREADED (WE'RE SINGLE) + + class Mutex { + public: + class Lock { + public: + explicit Lock(Mutex&) {} + }; + }; + +#endif // MULTI_THREADED + + + +} // namespace +#endif // yaSSL_LOCK_HPP diff --git a/externals/mysql/extlib/yassl/include/log.hpp b/externals/mysql/extlib/yassl/include/log.hpp new file mode 100644 index 00000000000..fb480eeefb6 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/log.hpp @@ -0,0 +1,55 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL log interface + * + */ + +#ifndef yaSSL_LOG_HPP +#define yaSSL_LOG_HPP + +#include "socket_wrapper.hpp" + +#ifdef YASSL_LOG +#include +#endif + +namespace yaSSL { + +typedef unsigned int uint; + + +// Debug logger +class Log { +#ifdef YASSL_LOG + FILE* log_; +#endif +public: + explicit Log(const char* str = "yaSSL.log"); + ~Log(); + + void Trace(const char*); + void ShowTCP(socket_t, bool ended = false); + void ShowData(uint, bool sent = false); +}; + + +} // naemspace + +#endif // yaSSL_LOG_HPP diff --git a/externals/mysql/extlib/yassl/include/openssl/crypto.h b/externals/mysql/extlib/yassl/include/openssl/crypto.h new file mode 100644 index 00000000000..f53e5231027 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/crypto.h @@ -0,0 +1,18 @@ +/* crypto.h for openSSL */ + +#ifndef ysSSL_crypto_h__ +#define yaSSL_crypto_h__ + +#ifdef YASSL_PREFIX +#include "prefix_crypto.h" +#endif + +const char* SSLeay_version(int type); + +#define SSLEAY_NUMBER_DEFINED +#define SSLEAY_VERSION 0x0900L +#define SSLEAY_VERSION_NUMBER SSLEAY_VERSION + + +#endif /* yaSSL_crypto_h__ */ + diff --git a/externals/mysql/extlib/yassl/include/openssl/des.h b/externals/mysql/extlib/yassl/include/openssl/des.h new file mode 100644 index 00000000000..67be7eecfb9 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/des.h @@ -0,0 +1 @@ +/* des.h for openssl */ diff --git a/externals/mysql/extlib/yassl/include/openssl/des_old.h b/externals/mysql/extlib/yassl/include/openssl/des_old.h new file mode 100644 index 00000000000..40e8fbc02af --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/des_old.h @@ -0,0 +1 @@ +/* des_old.h for openvn */ diff --git a/externals/mysql/extlib/yassl/include/openssl/engine.h b/externals/mysql/extlib/yassl/include/openssl/engine.h new file mode 100644 index 00000000000..39952fcae84 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/engine.h @@ -0,0 +1,5 @@ +/* engine.h for libcurl */ + +#undef HAVE_OPENSSL_ENGINE_H + + diff --git a/externals/mysql/extlib/yassl/include/openssl/err.h b/externals/mysql/extlib/yassl/include/openssl/err.h new file mode 100644 index 00000000000..45ac1ca2469 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/err.h @@ -0,0 +1,8 @@ +/* err.h for openssl */ + +#ifndef yaSSL_err_h__ +#define yaSSL_err_h__ + + + +#endif /* yaSSL_err_h__ */ diff --git a/externals/mysql/extlib/yassl/include/openssl/evp.h b/externals/mysql/extlib/yassl/include/openssl/evp.h new file mode 100644 index 00000000000..1d66b08df46 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/evp.h @@ -0,0 +1,10 @@ +/* evp.h for openSSL */ + +#ifndef SSLEAY_NUMBER_DEFINED +#define SSLEAY_NUMBER_DEFINED + +/* for OpenVPN */ +#define SSLEAY_VERSION_NUMBER 0x0090700f + + +#endif /* SSLEAY_NUMBER_DEFINED */ diff --git a/externals/mysql/extlib/yassl/include/openssl/generate_prefix_files.pl b/externals/mysql/extlib/yassl/include/openssl/generate_prefix_files.pl new file mode 100644 index 00000000000..da591b31332 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/generate_prefix_files.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl +# +# This script generates defines for all functions +# in yassl/include/openssl/ so they are renamed to +# ya. Hopefully that is unique enough. +# +# The script is to be run manually when we import +# a new version of yaSSL +# + + + +# Find all functions in "input" and add macros +# to prefix/rename them into "output +sub generate_prefix($$) +{ + my $input= shift; + my $output= shift; + open(IN, $input) + or die("Can't open input file $input: $!"); + open(OUT, ">", $output) + or mtr_error("Can't open output file $output: $!"); + + while () + { + chomp; + + if ( /typedef/ ) + { + next; + } + + if ( /^\s*[a-zA-Z0-9*_ ]+\s+\*?([_a-zA-Z0-9]+)\s*\(/ ) + { + print OUT "#define $1 ya$1\n"; + } + } + + close OUT; + close IN; +} + +generate_prefix("ssl.h", "prefix_ssl.h"); +generate_prefix("crypto.h", "prefix_crypto.h"); + diff --git a/externals/mysql/extlib/yassl/include/openssl/hmac.h b/externals/mysql/extlib/yassl/include/openssl/hmac.h new file mode 100644 index 00000000000..a2eae4c08c1 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/hmac.h @@ -0,0 +1 @@ +/* hmac.h for openvpn */ diff --git a/externals/mysql/extlib/yassl/include/openssl/lhash.h b/externals/mysql/extlib/yassl/include/openssl/lhash.h new file mode 100644 index 00000000000..01f8535f869 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/lhash.h @@ -0,0 +1,2 @@ +/* lhash.h for openSSL */ + diff --git a/externals/mysql/extlib/yassl/include/openssl/md4.h b/externals/mysql/extlib/yassl/include/openssl/md4.h new file mode 100644 index 00000000000..2e99f977fca --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/md4.h @@ -0,0 +1 @@ +/* md4.h for libcurl */ diff --git a/externals/mysql/extlib/yassl/include/openssl/md5.h b/externals/mysql/extlib/yassl/include/openssl/md5.h new file mode 100644 index 00000000000..dfaf9799c44 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/md5.h @@ -0,0 +1,4 @@ +/* md5.h for openssl */ + +#include "ssl.h" /* in there for now */ + diff --git a/externals/mysql/extlib/yassl/include/openssl/objects.h b/externals/mysql/extlib/yassl/include/openssl/objects.h new file mode 100644 index 00000000000..99f2326e51b --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/objects.h @@ -0,0 +1 @@ +/* objects.h for openvpn */ diff --git a/externals/mysql/extlib/yassl/include/openssl/opensslv.h b/externals/mysql/extlib/yassl/include/openssl/opensslv.h new file mode 100644 index 00000000000..d932130684f --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/opensslv.h @@ -0,0 +1,12 @@ +/* opensslv.h compatibility */ + +#ifndef yaSSL_opensslv_h__ +#define yaSSL_opensslv_h__ + + +/* api version compatibility */ +#define OPENSSL_VERSION_NUMBER 0x0090700f + + +#endif /* yaSSLopensslv_h__ */ + diff --git a/externals/mysql/extlib/yassl/include/openssl/pem.h b/externals/mysql/extlib/yassl/include/openssl/pem.h new file mode 100644 index 00000000000..b4c63d56a4d --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/pem.h @@ -0,0 +1 @@ +/* pem.h for libcurl */ diff --git a/externals/mysql/extlib/yassl/include/openssl/pkcs12.h b/externals/mysql/extlib/yassl/include/openssl/pkcs12.h new file mode 100644 index 00000000000..e452fc879c4 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/pkcs12.h @@ -0,0 +1,5 @@ +/* pkcs12.h for libcurl */ + + +#undef HAVE_OPENSSL_PKCS12_H + diff --git a/externals/mysql/extlib/yassl/include/openssl/prefix_crypto.h b/externals/mysql/extlib/yassl/include/openssl/prefix_crypto.h new file mode 100644 index 00000000000..3fa5f32c627 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/prefix_crypto.h @@ -0,0 +1 @@ +#define SSLeay_version yaSSLeay_version diff --git a/externals/mysql/extlib/yassl/include/openssl/prefix_ssl.h b/externals/mysql/extlib/yassl/include/openssl/prefix_ssl.h new file mode 100644 index 00000000000..138d9fb8821 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/prefix_ssl.h @@ -0,0 +1,169 @@ +#define Copyright yaCopyright +#define yaSSL_CleanUp yayaSSL_CleanUp +#define BN_bin2bn yaBN_bin2bn +#define DH_new yaDH_new +#define DH_free yaDH_free +#define RSA_free yaRSA_free +#define RSA_generate_key yaRSA_generate_key +#define X509_free yaX509_free +#define X509_STORE_CTX_get_current_cert yaX509_STORE_CTX_get_current_cert +#define X509_STORE_CTX_get_error yaX509_STORE_CTX_get_error +#define X509_STORE_CTX_get_error_depth yaX509_STORE_CTX_get_error_depth +#define X509_NAME_oneline yaX509_NAME_oneline +#define X509_get_issuer_name yaX509_get_issuer_name +#define X509_get_subject_name yaX509_get_subject_name +#define X509_verify_cert_error_string yaX509_verify_cert_error_string +#define X509_LOOKUP_add_dir yaX509_LOOKUP_add_dir +#define X509_LOOKUP_load_file yaX509_LOOKUP_load_file +#define X509_LOOKUP_hash_dir yaX509_LOOKUP_hash_dir +#define X509_LOOKUP_file yaX509_LOOKUP_file +#define X509_STORE_add_lookup yaX509_STORE_add_lookup +#define X509_STORE_new yaX509_STORE_new +#define X509_STORE_get_by_subject yaX509_STORE_get_by_subject +#define ERR_get_error_line_data yaERR_get_error_line_data +#define ERR_print_errors_fp yaERR_print_errors_fp +#define ERR_error_string yaERR_error_string +#define ERR_remove_state yaERR_remove_state +#define ERR_get_error yaERR_get_error +#define ERR_peek_error yaERR_peek_error +#define ERR_GET_REASON yaERR_GET_REASON +#define SSL_CTX_new yaSSL_CTX_new +#define SSL_new yaSSL_new +#define SSL_set_fd yaSSL_set_fd +#define SSL_get_fd yaSSL_get_fd +#define SSL_connect yaSSL_connect +#define SSL_write yaSSL_write +#define SSL_read yaSSL_read +#define SSL_accept yaSSL_accept +#define SSL_CTX_free yaSSL_CTX_free +#define SSL_free yaSSL_free +#define SSL_clear yaSSL_clear +#define SSL_shutdown yaSSL_shutdown +#define SSL_set_connect_state yaSSL_set_connect_state +#define SSL_set_accept_state yaSSL_set_accept_state +#define SSL_do_handshake yaSSL_do_handshake +#define SSL_get_cipher yaSSL_get_cipher +#define SSL_get_cipher_name yaSSL_get_cipher_name +#define SSL_get_shared_ciphers yaSSL_get_shared_ciphers +#define SSL_get_cipher_list yaSSL_get_cipher_list +#define SSL_get_version yaSSL_get_version +#define SSLeay_version yaSSLeay_version +#define SSL_get_error yaSSL_get_error +#define SSL_load_error_strings yaSSL_load_error_strings +#define SSL_set_session yaSSL_set_session +#define SSL_get_session yaSSL_get_session +#define SSL_flush_sessions yaSSL_flush_sessions +#define SSL_SESSION_set_timeout yaSSL_SESSION_set_timeout +#define SSL_CTX_set_session_cache_mode yaSSL_CTX_set_session_cache_mode +#define SSL_get_peer_certificate yaSSL_get_peer_certificate +#define SSL_get_verify_result yaSSL_get_verify_result +#define SSL_CTX_set_verify yaSSL_CTX_set_verify +#define SSL_CTX_load_verify_locations yaSSL_CTX_load_verify_locations +#define SSL_CTX_set_default_verify_paths yaSSL_CTX_set_default_verify_paths +#define SSL_CTX_check_private_key yaSSL_CTX_check_private_key +#define SSL_CTX_set_session_id_context yaSSL_CTX_set_session_id_context +#define SSL_CTX_set_tmp_rsa_callback yaSSL_CTX_set_tmp_rsa_callback +#define SSL_CTX_set_options yaSSL_CTX_set_options +#define SSL_CTX_set_session_cache_mode yaSSL_CTX_set_session_cache_mode +#define SSL_CTX_set_timeout yaSSL_CTX_set_timeout +#define SSL_CTX_use_certificate_chain_file yaSSL_CTX_use_certificate_chain_file +#define SSL_CTX_set_default_passwd_cb yaSSL_CTX_set_default_passwd_cb +#define SSL_CTX_use_RSAPrivateKey_file yaSSL_CTX_use_RSAPrivateKey_file +#define SSL_CTX_set_info_callback yaSSL_CTX_set_info_callback +#define SSL_CTX_sess_accept yaSSL_CTX_sess_accept +#define SSL_CTX_sess_connect yaSSL_CTX_sess_connect +#define SSL_CTX_sess_accept_good yaSSL_CTX_sess_accept_good +#define SSL_CTX_sess_connect_good yaSSL_CTX_sess_connect_good +#define SSL_CTX_sess_accept_renegotiate yaSSL_CTX_sess_accept_renegotiate +#define SSL_CTX_sess_connect_renegotiate yaSSL_CTX_sess_connect_renegotiate +#define SSL_CTX_sess_hits yaSSL_CTX_sess_hits +#define SSL_CTX_sess_cb_hits yaSSL_CTX_sess_cb_hits +#define SSL_CTX_sess_cache_full yaSSL_CTX_sess_cache_full +#define SSL_CTX_sess_misses yaSSL_CTX_sess_misses +#define SSL_CTX_sess_timeouts yaSSL_CTX_sess_timeouts +#define SSL_CTX_sess_number yaSSL_CTX_sess_number +#define SSL_CTX_sess_get_cache_size yaSSL_CTX_sess_get_cache_size +#define SSL_CTX_get_verify_mode yaSSL_CTX_get_verify_mode +#define SSL_get_verify_mode yaSSL_get_verify_mode +#define SSL_CTX_get_verify_depth yaSSL_CTX_get_verify_depth +#define SSL_get_verify_depth yaSSL_get_verify_depth +#define SSL_get_default_timeout yaSSL_get_default_timeout +#define SSL_CTX_get_session_cache_mode yaSSL_CTX_get_session_cache_mode +#define SSL_session_reused yaSSL_session_reused +#define SSL_set_rfd yaSSL_set_rfd +#define SSL_set_wfd yaSSL_set_wfd +#define SSL_set_shutdown yaSSL_set_shutdown +#define SSL_set_quiet_shutdown yaSSL_set_quiet_shutdown +#define SSL_get_quiet_shutdown yaSSL_get_quiet_shutdown +#define SSL_want_read yaSSL_want_read +#define SSL_want_write yaSSL_want_write +#define SSL_pending yaSSL_pending +#define SSLv3_method yaSSLv3_method +#define SSLv3_server_method yaSSLv3_server_method +#define SSLv3_client_method yaSSLv3_client_method +#define TLSv1_server_method yaTLSv1_server_method +#define TLSv1_client_method yaTLSv1_client_method +#define TLSv1_1_server_method yaTLSv1_1_server_method +#define TLSv1_1_client_method yaTLSv1_1_client_method +#define SSLv23_server_method yaSSLv23_server_method +#define SSL_CTX_use_certificate_file yaSSL_CTX_use_certificate_file +#define SSL_CTX_use_PrivateKey_file yaSSL_CTX_use_PrivateKey_file +#define SSL_CTX_set_cipher_list yaSSL_CTX_set_cipher_list +#define SSL_CTX_sess_set_cache_size yaSSL_CTX_sess_set_cache_size +#define SSL_CTX_set_tmp_dh yaSSL_CTX_set_tmp_dh +#define OpenSSL_add_all_algorithms yaOpenSSL_add_all_algorithms +#define SSL_library_init yaSSL_library_init +#define SSLeay_add_ssl_algorithms yaSSLeay_add_ssl_algorithms +#define SSL_get_current_cipher yaSSL_get_current_cipher +#define SSL_CIPHER_description yaSSL_CIPHER_description +#define SSL_alert_type_string_long yaSSL_alert_type_string_long +#define SSL_alert_desc_string_long yaSSL_alert_desc_string_long +#define SSL_state_string_long yaSSL_state_string_long +#define EVP_md5 yaEVP_md5 +#define EVP_des_ede3_cbc yaEVP_des_ede3_cbc +#define EVP_BytesToKey yaEVP_BytesToKey +#define DES_set_key_unchecked yaDES_set_key_unchecked +#define DES_ede3_cbc_encrypt yaDES_ede3_cbc_encrypt +#define RAND_screen yaRAND_screen +#define RAND_file_name yaRAND_file_name +#define RAND_write_file yaRAND_write_file +#define RAND_load_file yaRAND_load_file +#define RAND_status yaRAND_status +#define RAND_bytes yaRAND_bytes +#define DES_set_key yaDES_set_key +#define DES_set_odd_parity yaDES_set_odd_parity +#define DES_ecb_encrypt yaDES_ecb_encrypt +#define SSL_CTX_set_default_passwd_cb_userdata yaSSL_CTX_set_default_passwd_cb_userdata +#define SSL_SESSION_free yaSSL_SESSION_free +#define SSL_peek yaSSL_peek +#define SSL_get_certificate yaSSL_get_certificate +#define SSL_get_privatekey yaSSL_get_privatekey +#define X509_get_pubkey yaX509_get_pubkey +#define EVP_PKEY_copy_parameters yaEVP_PKEY_copy_parameters +#define EVP_PKEY_free yaEVP_PKEY_free +#define ERR_error_string_n yaERR_error_string_n +#define ERR_free_strings yaERR_free_strings +#define EVP_cleanup yaEVP_cleanup +#define X509_get_ext_d2i yaX509_get_ext_d2i +#define GENERAL_NAMES_free yaGENERAL_NAMES_free +#define sk_GENERAL_NAME_num yask_GENERAL_NAME_num +#define sk_GENERAL_NAME_value yask_GENERAL_NAME_value +#define ASN1_STRING_data yaASN1_STRING_data +#define ASN1_STRING_length yaASN1_STRING_length +#define ASN1_STRING_type yaASN1_STRING_type +#define X509_NAME_get_index_by_NID yaX509_NAME_get_index_by_NID +#define X509_NAME_ENTRY_get_data yaX509_NAME_ENTRY_get_data +#define X509_NAME_get_entry yaX509_NAME_get_entry +#define ASN1_STRING_to_UTF8 yaASN1_STRING_to_UTF8 +#define SSLv23_client_method yaSSLv23_client_method +#define SSLv2_client_method yaSSLv2_client_method +#define SSL_get1_session yaSSL_get1_session +#define X509_get_notBefore yaX509_get_notBefore +#define X509_get_notAfter yaX509_get_notAfter +#define MD4_Init yaMD4_Init +#define MD4_Update yaMD4_Update +#define MD4_Final yaMD4_Final +#define MD5_Init yaMD5_Init +#define MD5_Update yaMD5_Update +#define MD5_Final yaMD5_Final +#define SSL_set_compression yaSSL_set_compression diff --git a/externals/mysql/extlib/yassl/include/openssl/rand.h b/externals/mysql/extlib/yassl/include/openssl/rand.h new file mode 100644 index 00000000000..df9c9020346 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/rand.h @@ -0,0 +1,2 @@ +/* rand.h for openSSL */ + diff --git a/externals/mysql/extlib/yassl/include/openssl/rsa.h b/externals/mysql/extlib/yassl/include/openssl/rsa.h new file mode 100644 index 00000000000..fe64e655bdc --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/rsa.h @@ -0,0 +1,10 @@ +/* rsa.h for openSSL */ + + +#ifndef yaSSL_rsa_h__ +#define yaSSL_rsa_h__ + +enum { RSA_F4 = 1 }; + + +#endif /* yaSSL_rsa_h__ */ diff --git a/externals/mysql/extlib/yassl/include/openssl/sha.h b/externals/mysql/extlib/yassl/include/openssl/sha.h new file mode 100644 index 00000000000..bb487c05c2e --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/sha.h @@ -0,0 +1 @@ +/* sha.h for openvpn */ diff --git a/externals/mysql/extlib/yassl/include/openssl/ssl.h b/externals/mysql/extlib/yassl/include/openssl/ssl.h new file mode 100644 index 00000000000..05b34a0dc45 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/ssl.h @@ -0,0 +1,554 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* ssl.h defines openssl compatibility layer + * + */ + + + +#ifndef yaSSL_openssl_h__ +#define yaSSL_openssl_h__ + +#ifdef YASSL_PREFIX +#include "prefix_ssl.h" +#endif + +#include /* ERR_print fp */ +#include "opensslv.h" /* for version number */ +#include "rsa.h" + + +#define YASSL_VERSION "1.7.2" + + +#if defined(__cplusplus) +extern "C" { +#endif + + void yaSSL_CleanUp(); /* call once at end of application use to + free static singleton memory holders, + not a leak per se, but helpful when + looking for them */ + +#if defined(__cplusplus) +} // extern +#endif + +#if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE) +namespace yaSSL { +extern "C" { +#endif + +#undef X509_NAME /* wincrypt.h clash */ + +#if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE) + class SSL; + class SSL_SESSION; + class SSL_METHOD; + class SSL_CTX; + class SSL_CIPHER; + + class RSA; + + class X509; + class X509_NAME; +#else + typedef struct SSL SSL; + typedef struct SSL_SESSION SSL_SESSION; + typedef struct SSL_METHOD SSL_METHOD; + typedef struct SSL_CTX SSL_CTX; + typedef struct SSL_CIPHER SSL_CIPHER; + + typedef struct RSA RSA; + + typedef struct X509 X509; + typedef struct X509_NAME X509_NAME; +#endif + + +/* Big Number stuff, different file? */ +typedef struct BIGNUM BIGNUM; + +BIGNUM *BN_bin2bn(const unsigned char*, int, BIGNUM*); + + +/* Diffie-Hellman stuff, different file? */ +/* mySQL deferences to set group parameters */ +typedef struct DH { + BIGNUM* p; + BIGNUM* g; +} DH; + +DH* DH_new(void); +void DH_free(DH*); + +/* RSA stuff */ + +void RSA_free(RSA*); +RSA* RSA_generate_key(int, unsigned long, void(*)(int, int, void*), void*); + + +/* X509 stuff, different file? */ + +typedef struct X509_STORE X509_STORE; +typedef struct X509_LOOKUP X509_LOOKUP; +typedef struct X509_OBJECT { char c; } X509_OBJECT; +typedef struct X509_CRL X509_CRL; +typedef struct X509_REVOKED X509_REVOKED; +typedef struct X509_LOOKUP_METHOD X509_LOOKUP_METHOD; + + +void X509_free(X509*); + + +/* bio stuff */ +typedef struct BIO BIO; + +/* ASN stuff */ + + + +/* because mySQL dereferences to use error and current_cert, even after calling + * get functions for local references */ +typedef struct X509_STORE_CTX { + int error; + int error_depth; + X509* current_cert; +} X509_STORE_CTX; + + + +X509* X509_STORE_CTX_get_current_cert(X509_STORE_CTX*); +int X509_STORE_CTX_get_error(X509_STORE_CTX*); +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX*); + +char* X509_NAME_oneline(X509_NAME*, char*, int); +X509_NAME* X509_get_issuer_name(X509*); +X509_NAME* X509_get_subject_name(X509*); +const char* X509_verify_cert_error_string(long); + +int X509_LOOKUP_add_dir(X509_LOOKUP*, const char*, long); +int X509_LOOKUP_load_file(X509_LOOKUP*, const char*, long); +X509_LOOKUP_METHOD* X509_LOOKUP_hash_dir(void); +X509_LOOKUP_METHOD* X509_LOOKUP_file(void); + +X509_LOOKUP* X509_STORE_add_lookup(X509_STORE*, X509_LOOKUP_METHOD*); +X509_STORE* X509_STORE_new(void); +int X509_STORE_get_by_subject(X509_STORE_CTX*, int, X509_NAME*, + X509_OBJECT*); + + + + +enum { /* X509 Constants */ + X509_V_OK = 0, + X509_V_ERR_CERT_CHAIN_TOO_LONG = 1, + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2, + X509_V_ERR_CERT_NOT_YET_VALID = 3, + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 4, + X509_V_ERR_CERT_HAS_EXPIRED = 5, + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 6, + X509_FILETYPE_PEM = 7, + X509_LU_X509 = 8, + X509_LU_CRL = 9, + X509_V_ERR_CRL_SIGNATURE_FAILURE = 10, + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 11, + X509_V_ERR_CRL_HAS_EXPIRED = 12, + X509_V_ERR_CERT_REVOKED = 13, + X509_V_FLAG_CRL_CHECK = 14, + X509_V_FLAG_CRL_CHECK_ALL = 15 +}; + + +/* Error stuff, could move to yassl_error */ +unsigned long ERR_get_error_line_data(const char**, int*, const char**, int *); +void ERR_print_errors_fp(FILE*); +char* ERR_error_string(unsigned long,char*); +void ERR_remove_state(unsigned long); +unsigned long ERR_get_error(void); +unsigned long ERR_peek_error(void); +int ERR_GET_REASON(int); + + +enum { /* ERR Constants */ + ERR_TXT_STRING = 1, + EVP_R_BAD_DECRYPT = 2 +}; + +/* + Allow type used by SSL_set_fd to be changed, default to int + in order to be compatible with OpenSSL + */ +#ifndef YASSL_SOCKET_T_DEFINED +typedef int YASSL_SOCKET_T; +#endif + +SSL_CTX* SSL_CTX_new(SSL_METHOD*); +SSL* SSL_new(SSL_CTX*); +int SSL_set_fd (SSL*, YASSL_SOCKET_T); +YASSL_SOCKET_T SSL_get_fd(const SSL*); +int SSL_connect(SSL*); /* if you get an error from connect + see note at top of REAMDE */ +int SSL_write(SSL*, const void*, int); +int SSL_read(SSL*, void*, int); +int SSL_accept(SSL*); +void SSL_CTX_free(SSL_CTX*); +void SSL_free(SSL*); +int SSL_clear(SSL*); +int SSL_shutdown(SSL*); + +void SSL_set_connect_state(SSL*); +void SSL_set_accept_state(SSL*); +int SSL_do_handshake(SSL*); + +const char* SSL_get_cipher(SSL*); +const char* SSL_get_cipher_name(SSL*); /* uses SSL_get_cipher */ +char* SSL_get_shared_ciphers(SSL*, char*, int); +const char* SSL_get_cipher_list(SSL*, int); +const char* SSL_get_version(SSL*); +const char* SSLeay_version(int); + +int SSL_get_error(SSL*, int); +void SSL_load_error_strings(void); + +int SSL_set_session(SSL *ssl, SSL_SESSION *session); +SSL_SESSION* SSL_get_session(SSL* ssl); +void SSL_flush_sessions(SSL_CTX *ctx, long tm); +long SSL_SESSION_set_timeout(SSL_SESSION*, long); +long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode); +X509* SSL_get_peer_certificate(SSL*); +long SSL_get_verify_result(SSL*); + + +typedef int (*VerifyCallback)(int, X509_STORE_CTX*); +typedef int (*pem_password_cb)(char*, int, int, void*); + +void SSL_CTX_set_verify(SSL_CTX*, int, VerifyCallback verify_callback); +int SSL_CTX_load_verify_locations(SSL_CTX*, const char*, const char*); +int SSL_CTX_set_default_verify_paths(SSL_CTX*); +int SSL_CTX_check_private_key(SSL_CTX*); +int SSL_CTX_set_session_id_context(SSL_CTX*, const unsigned char*, + unsigned int); + +void SSL_CTX_set_tmp_rsa_callback(SSL_CTX*, RSA*(*)(SSL*, int, int)); +long SSL_CTX_set_options(SSL_CTX*, long); +long SSL_CTX_set_session_cache_mode(SSL_CTX*, long); +long SSL_CTX_set_timeout(SSL_CTX*, long); +int SSL_CTX_use_certificate_chain_file(SSL_CTX*, const char*); +void SSL_CTX_set_default_passwd_cb(SSL_CTX*, pem_password_cb); +int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX*, const char*, int); +void SSL_CTX_set_info_callback(SSL_CTX*, void (*)()); + +long SSL_CTX_sess_accept(SSL_CTX*); +long SSL_CTX_sess_connect(SSL_CTX*); +long SSL_CTX_sess_accept_good(SSL_CTX*); +long SSL_CTX_sess_connect_good(SSL_CTX*); +long SSL_CTX_sess_accept_renegotiate(SSL_CTX*); +long SSL_CTX_sess_connect_renegotiate(SSL_CTX*); +long SSL_CTX_sess_hits(SSL_CTX*); +long SSL_CTX_sess_cb_hits(SSL_CTX*); +long SSL_CTX_sess_cache_full(SSL_CTX*); +long SSL_CTX_sess_misses(SSL_CTX*); +long SSL_CTX_sess_timeouts(SSL_CTX*); +long SSL_CTX_sess_number(SSL_CTX*); +long SSL_CTX_sess_get_cache_size(SSL_CTX*); + +int SSL_CTX_get_verify_mode(SSL_CTX*); +int SSL_get_verify_mode(SSL*); +int SSL_CTX_get_verify_depth(SSL_CTX*); +int SSL_get_verify_depth(SSL*); + +long SSL_get_default_timeout(SSL*); +long SSL_CTX_get_session_cache_mode(SSL_CTX*); +int SSL_session_reused(SSL*); + +int SSL_set_rfd(SSL*, int); +int SSL_set_wfd(SSL*, int); +void SSL_set_shutdown(SSL*, int); +void SSL_set_quiet_shutdown(SSL *ssl,int mode); +int SSL_get_quiet_shutdown(SSL *ssl); + +int SSL_want_read(SSL*); +int SSL_want_write(SSL*); + +int SSL_pending(SSL*); + + +enum { /* ssl Constants */ + SSL_WOULD_BLOCK = -8, + SSL_BAD_STAT = -7, + SSL_BAD_PATH = -6, + SSL_BAD_FILETYPE = -5, + SSL_BAD_FILE = -4, + SSL_NOT_IMPLEMENTED = -3, + SSL_UNKNOWN = -2, + SSL_FATAL_ERROR = -1, + SSL_NORMAL_SHUTDOWN = 0, + SSL_ERROR_NONE = 0, /* for most functions */ + SSL_FAILURE = 0, /* for some functions */ + SSL_SUCCESS = 1, + + SSL_FILETYPE_ASN1 = 10, + SSL_FILETYPE_PEM = 11, + SSL_FILETYPE_DEFAULT = 10, /* ASN1 */ + + SSL_VERIFY_NONE = 0, + SSL_VERIFY_PEER = 1, + SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 2, + SSL_VERIFY_CLIENT_ONCE = 4, + + SSL_SESS_CACHE_OFF = 30, + SSL_SESS_CACHE_CLIENT = 31, + SSL_SESS_CACHE_SERVER = 32, + SSL_SESS_CACHE_BOTH = 33, + SSL_SESS_CACHE_NO_AUTO_CLEAR = 34, + SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = 35, + + SSL_OP_MICROSOFT_SESS_ID_BUG = 50, + SSL_OP_NETSCAPE_CHALLENGE_BUG = 51, + SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 52, + SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 53, + SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 54, + SSL_OP_MSIE_SSLV2_RSA_PADDING = 55, + SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 56, + SSL_OP_TLS_D5_BUG = 57, + SSL_OP_TLS_BLOCK_PADDING_BUG = 58, + SSL_OP_TLS_ROLLBACK_BUG = 59, + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 60, + SSL_OP_ALL = 61, + SSL_OP_SINGLE_DH_USE = 62, + SSL_OP_EPHEMERAL_RSA = 63, + SSL_OP_NO_SSLv2 = 64, + SSL_OP_NO_SSLv3 = 65, + SSL_OP_NO_TLSv1 = 66, + SSL_OP_PKCS1_CHECK_1 = 67, + SSL_OP_PKCS1_CHECK_2 = 68, + SSL_OP_NETSCAPE_CA_DN_BUG = 69, + SSL_OP_NON_EXPORT_FIRST = 70, + SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 71, + + SSL_ERROR_WANT_READ = 80, + SSL_ERROR_WANT_WRITE = 81, + SSL_ERROR_SYSCALL = 82, + SSL_ERROR_WANT_X509_LOOKUP = 83, + SSL_ERROR_ZERO_RETURN = 84, + SSL_ERROR_SSL = 85, + + SSL_SENT_SHUTDOWN = 90, + SSL_RECEIVED_SHUTDOWN = 91, + SSL_CB_LOOP = 92, + SSL_ST_CONNECT = 93, + SSL_ST_ACCEPT = 94, + SSL_CB_ALERT = 95, + SSL_CB_READ = 96, + SSL_CB_HANDSHAKE_DONE = 97 + +}; + + +SSL_METHOD *SSLv3_method(void); +SSL_METHOD *SSLv3_server_method(void); +SSL_METHOD *SSLv3_client_method(void); +SSL_METHOD *TLSv1_server_method(void); +SSL_METHOD *TLSv1_client_method(void); +SSL_METHOD *TLSv1_1_server_method(void); +SSL_METHOD *TLSv1_1_client_method(void); +SSL_METHOD *SSLv23_server_method(void); + +int SSL_CTX_use_certificate_file(SSL_CTX*, const char*, int); +int SSL_CTX_use_PrivateKey_file(SSL_CTX*, const char*, int); +int SSL_CTX_set_cipher_list(SSL_CTX*, const char*); + +long SSL_CTX_sess_set_cache_size(SSL_CTX*, long); +long SSL_CTX_set_tmp_dh(SSL_CTX*, DH*); + +void OpenSSL_add_all_algorithms(void); +int SSL_library_init(); +int SSLeay_add_ssl_algorithms(void); + + +SSL_CIPHER* SSL_get_current_cipher(SSL*); +char* SSL_CIPHER_description(SSL_CIPHER*, char*, int); + + +char* SSL_alert_type_string_long(int); +char* SSL_alert_desc_string_long(int); +char* SSL_state_string_long(SSL*); + + +/* EVP stuff, des and md5, different file? */ +typedef char EVP_MD; + +typedef char EVP_CIPHER; + +typedef struct EVP_PKEY EVP_PKEY; + +typedef unsigned char DES_cblock[8]; +typedef const DES_cblock const_DES_cblock; +typedef DES_cblock DES_key_schedule; + +enum { + DES_ENCRYPT = 1, + DES_DECRYPT = 0 +}; + +const EVP_MD* EVP_md5(void); +const EVP_CIPHER* EVP_des_ede3_cbc(void); + +typedef unsigned char opaque; + +int EVP_BytesToKey(const EVP_CIPHER*, const EVP_MD*, const opaque*, + const opaque*, int, int, opaque*, opaque*); + +void DES_set_key_unchecked(const_DES_cblock*, DES_key_schedule*); +void DES_ede3_cbc_encrypt(const opaque*, opaque*, long, DES_key_schedule*, + DES_key_schedule*, DES_key_schedule*, DES_cblock*, int); + + +/* RAND stuff */ +void RAND_screen(void); +const char* RAND_file_name(char*, size_t); +int RAND_write_file(const char*); +int RAND_load_file(const char*, long); + + +/* for libcurl */ +int RAND_status(void); +int RAND_bytes(unsigned char* buf, int num); + +int DES_set_key(const_DES_cblock*, DES_key_schedule*); +void DES_set_odd_parity(DES_cblock*); +void DES_ecb_encrypt(DES_cblock*, DES_cblock*, DES_key_schedule*, int); + +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX*, void* userdata); +void SSL_SESSION_free(SSL_SESSION* session); +int SSL_peek(SSL* ssl, void* buf, int num); + +X509* SSL_get_certificate(SSL* ssl); +EVP_PKEY* SSL_get_privatekey(SSL* ssl); +EVP_PKEY* X509_get_pubkey(X509* x); + +int EVP_PKEY_copy_parameters(EVP_PKEY* to, const EVP_PKEY* from); +void EVP_PKEY_free(EVP_PKEY* pkey); +void ERR_error_string_n(unsigned long e, char *buf, size_t len); +void ERR_free_strings(void); +void EVP_cleanup(void); + +void* X509_get_ext_d2i(X509* x, int nid, int* crit, int* idx); + +#define GEN_IPADD 7 +#define NID_subject_alt_name 85 +#define STACK_OF(x) x + + +/* defined here because libcurl dereferences */ +typedef struct ASN1_STRING { + int type; + int length; + unsigned char* data; +} ASN1_STRING; + + +typedef struct GENERAL_NAME { + int type; + union { + ASN1_STRING* ia5; + } d; +} GENERAL_NAME; + +void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *x); + +int sk_GENERAL_NAME_num(STACK_OF(GENERAL_NAME) *x); +GENERAL_NAME* sk_GENERAL_NAME_value(STACK_OF(GENERAL_NAME) *x, int i); + + +unsigned char* ASN1_STRING_data(ASN1_STRING* x); +int ASN1_STRING_length(ASN1_STRING* x); +int ASN1_STRING_type(ASN1_STRING *x); + +typedef ASN1_STRING X509_NAME_ENTRY; + +int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos); + +ASN1_STRING* X509_NAME_ENTRY_get_data(X509_NAME_ENTRY* ne); +X509_NAME_ENTRY* X509_NAME_get_entry(X509_NAME* name, int loc); + +#define OPENSSL_malloc(x) malloc(x) +#define OPENSSL_free(x) free(x) + +int ASN1_STRING_to_UTF8(unsigned char** out, ASN1_STRING* in); + +SSL_METHOD* SSLv23_client_method(void); /* doesn't actually roll back */ +SSL_METHOD* SSLv2_client_method(void); /* will never work, no v 2 */ + + +SSL_SESSION* SSL_get1_session(SSL* ssl); /* what's ref count */ + + +#define CRYPTO_free(x) free(x) +#define ASN1_TIME ASN1_STRING + +ASN1_TIME* X509_get_notBefore(X509* x); +ASN1_TIME* X509_get_notAfter(X509* x); + + +#define ASN1_UTCTIME ASN1_STRING +#define NID_commonName 13 +#define V_ASN1_UTF8STRING 12 +#define GEN_DNS 2 + +#define CERTFICATE_ERROR 0x14090086 /* SSLv3 error */ + + +typedef struct MD4_CTX { + int buffer[32]; /* big enough to hold, check size in Init */ +} MD4_CTX; + +void MD4_Init(MD4_CTX*); +void MD4_Update(MD4_CTX*, const void*, unsigned long); +void MD4_Final(unsigned char*, MD4_CTX*); + + +typedef struct MD5_CTX { + int buffer[32]; /* big enough to hold, check size in Init */ +} MD5_CTX; + +void MD5_Init(MD5_CTX*); +void MD5_Update(MD5_CTX*, const void*, unsigned long); +void MD5_Final(unsigned char*, MD5_CTX*); + +#define MD5_DIGEST_LENGTH 16 + + +#define SSL_DEFAULT_CIPHER_LIST "" /* default all */ + + +/* yaSSL adds */ +int SSL_set_compression(SSL*); /* turn on yaSSL zlib compression */ + + + + +#if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE) +} /* namespace */ +} /* extern "C" */ +#endif + + +#endif /* yaSSL_openssl_h__ */ diff --git a/externals/mysql/extlib/yassl/include/openssl/x509.h b/externals/mysql/extlib/yassl/include/openssl/x509.h new file mode 100644 index 00000000000..dcd847c0337 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/x509.h @@ -0,0 +1 @@ +/* x509.h for libcurl */ diff --git a/externals/mysql/extlib/yassl/include/openssl/x509v3.h b/externals/mysql/extlib/yassl/include/openssl/x509v3.h new file mode 100644 index 00000000000..adf94af8f48 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/openssl/x509v3.h @@ -0,0 +1 @@ +/* x509v3.h for libcurl */ diff --git a/externals/mysql/extlib/yassl/include/socket_wrapper.hpp b/externals/mysql/extlib/yassl/include/socket_wrapper.hpp new file mode 100644 index 00000000000..308704c2af0 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/socket_wrapper.hpp @@ -0,0 +1,96 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* The socket wrapper header defines a Socket class that hides the differences + * between Berkely style sockets and Windows sockets, allowing transparent TCP + * access. + */ + + +#ifndef yaSSL_SOCKET_WRAPPER_HPP +#define yaSSL_SOCKET_WRAPPER_HPP + +#include + +#ifdef _WIN32 + #include +#else + #include + #include + #include + #include + #include + #include +#endif + + +namespace yaSSL { + +typedef unsigned int uint; + +#ifdef _WIN32 + typedef SOCKET socket_t; +#else + typedef int socket_t; + const socket_t INVALID_SOCKET = -1; + const int SD_RECEIVE = 0; + const int SD_SEND = 1; + const int SD_BOTH = 2; + const int SOCKET_ERROR = -1; +#endif + + + +typedef unsigned char byte; + + +// Wraps Windows Sockets and BSD Sockets +class Socket { + socket_t socket_; // underlying socket descriptor + bool wouldBlock_; // if non-blocking data, for last read + bool nonBlocking_; // is option set +public: + explicit Socket(socket_t s = INVALID_SOCKET); + ~Socket(); + + void set_fd(socket_t s); + uint get_ready() const; + socket_t get_fd() const; + + uint send(const byte* buf, unsigned int len, int flags = 0) const; + uint receive(byte* buf, unsigned int len, int flags = 0); + + bool wait(); + bool WouldBlock() const; + bool IsNonBlocking() const; + + void closeSocket(); + void shutDown(int how = SD_SEND); + + static int get_lastError(); + static void set_lastError(int error); +private: + Socket(const Socket&); // hide copy + Socket& operator= (const Socket&); // and assign +}; + + +} // naemspace + +#endif // yaSSL_SOCKET_WRAPPER_HPP diff --git a/externals/mysql/extlib/yassl/include/timer.hpp b/externals/mysql/extlib/yassl/include/timer.hpp new file mode 100644 index 00000000000..725e73cf453 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/timer.hpp @@ -0,0 +1,40 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* timer.hpp provides a high res and low res timers + * +*/ + + +#ifndef yaSSL_TIMER_HPP +#define yaSSL_TIMER_HPP + +namespace yaSSL { + +typedef double timer_d; +typedef unsigned int uint; + + + +timer_d timer(); +uint lowResTimer(); + + + +} // namespace +#endif // yaSSL_TIMER_HPP diff --git a/externals/mysql/extlib/yassl/include/yassl.hpp b/externals/mysql/extlib/yassl/include/yassl.hpp new file mode 100644 index 00000000000..29e0a5d94ec --- /dev/null +++ b/externals/mysql/extlib/yassl/include/yassl.hpp @@ -0,0 +1,85 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL externel header defines yaSSL API + */ + + +#ifndef yaSSL_EXT_HPP +#define yaSSL_EXT_HPP + + +namespace yaSSL { + + +#ifdef _WIN32 + typedef unsigned int SOCKET_T; +#else + typedef int SOCKET_T; +#endif + + +class Client { +public: + Client(); + ~Client(); + + // basics + int Connect(SOCKET_T); + int Write(const void*, int); + int Read(void*, int); + + // options + void SetCA(const char*); + void SetCert(const char*); + void SetKey(const char*); +private: + struct ClientImpl; + ClientImpl* pimpl_; + + Client(const Client&); // hide copy + Client& operator=(const Client&); // and assign +}; + + +class Server { +public: + Server(); + ~Server(); + + // basics + int Accept(SOCKET_T); + int Write(const void*, int); + int Read(void*, int); + + // options + void SetCA(const char*); + void SetCert(const char*); + void SetKey(const char*); +private: + struct ServerImpl; + ServerImpl* pimpl_; + + Server(const Server&); // hide copy + Server& operator=(const Server&); // and assign +}; + + +} // namespace yaSSL +#endif // yaSSL_EXT_HPP diff --git a/externals/mysql/extlib/yassl/include/yassl_error.hpp b/externals/mysql/extlib/yassl/include/yassl_error.hpp new file mode 100644 index 00000000000..63fa9a761ba --- /dev/null +++ b/externals/mysql/extlib/yassl/include/yassl_error.hpp @@ -0,0 +1,86 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL error header defines error codes and an exception class + */ + +#ifndef yaSSL_ERROR_HPP +#define yaSSL_ERROR_HPP + + + +namespace yaSSL { + + +enum YasslError { + no_error = 0, + + // 10 - 47 from AlertDescription, 0 also close_notify + + range_error = 101, + realloc_error = 102, + factory_error = 103, + unknown_cipher = 104, + prefix_error = 105, + record_layer = 106, + handshake_layer = 107, + out_of_order = 108, + bad_input = 109, + match_error = 110, + no_key_file = 111, + verify_error = 112, + send_error = 113, + receive_error = 114, + certificate_error = 115, + privateKey_error = 116, + badVersion_error = 117, + compress_error = 118, + decompress_error = 119, + pms_version_error = 120 + + // !!!! add error message to .cpp !!!! + + // 1000+ from TaoCrypt error.hpp + +}; + + +enum Library { yaSSL_Lib = 0, CryptoLib, SocketLib }; +enum { MAX_ERROR_SZ = 80 }; + +void SetErrorString(YasslError, char*); + +/* remove for now, if go back to exceptions use this wrapper +// Base class for all yaSSL exceptions +class Error : public mySTL::runtime_error { + YasslError error_; + Library lib_; +public: + explicit Error(const char* s = "", YasslError e = no_error, + Library l = yaSSL_Lib); + + YasslError get_number() const; + Library get_lib() const; +}; +*/ + + +} // naemspace + +#endif // yaSSL_ERROR_HPP diff --git a/externals/mysql/extlib/yassl/include/yassl_imp.hpp b/externals/mysql/extlib/yassl/include/yassl_imp.hpp new file mode 100644 index 00000000000..8893ba8a8ba --- /dev/null +++ b/externals/mysql/extlib/yassl/include/yassl_imp.hpp @@ -0,0 +1,748 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* yaSSL implementation header defines all strucutres from the SSL.v3 + * specification "draft-freier-ssl-version3-02.txt" + * all page citations refer to this document unless otherwise noted. + */ + + +#ifndef yaSSL_IMP_HPP +#define yaSSL_IMP_HPP + +#ifdef _MSC_VER + // disable truncated debug symbols + #pragma warning(disable:4786) +#endif + +#include "yassl_types.hpp" +#include "factory.hpp" +#include STL_LIST_FILE + + +namespace STL = STL_NAMESPACE; + + +namespace yaSSL { + + +class SSL; // forward decls +class input_buffer; +class output_buffer; + + +struct ProtocolVersion { + uint8 major_; + uint8 minor_; // major and minor SSL/TLS version numbers + + ProtocolVersion(uint8 maj = 3, uint8 min = 0); +}; + + +// Record Layer Header for PlainText, Compressed, and CipherText +struct RecordLayerHeader { + ContentType type_; + ProtocolVersion version_; + uint16 length_; // should not exceed 2^14 +}; + + +// base for all messages +struct Message : public virtual_base { + virtual input_buffer& set(input_buffer&) =0; + virtual output_buffer& get(output_buffer&) const =0; + + virtual void Process(input_buffer&, SSL&) =0; + virtual ContentType get_type() const =0; + virtual uint16 get_length() const =0; + + virtual ~Message() {} +}; + + +class ChangeCipherSpec : public Message { + CipherChoice type_; +public: + ChangeCipherSpec(); + + friend input_buffer& operator>>(input_buffer&, ChangeCipherSpec&); + friend output_buffer& operator<<(output_buffer&, const ChangeCipherSpec&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + ContentType get_type() const; + uint16 get_length() const; + void Process(input_buffer&, SSL&); +private: + ChangeCipherSpec(const ChangeCipherSpec&); // hide copy + ChangeCipherSpec& operator=(const ChangeCipherSpec&); // and assign +}; + + + +class Alert : public Message { + AlertLevel level_; + AlertDescription description_; +public: + Alert() {} + Alert(AlertLevel al, AlertDescription ad); + + ContentType get_type() const; + uint16 get_length() const; + void Process(input_buffer&, SSL&); + + friend input_buffer& operator>>(input_buffer&, Alert&); + friend output_buffer& operator<<(output_buffer&, const Alert&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; +private: + Alert(const Alert&); // hide copy + Alert& operator=(const Alert&); // and assign +}; + + +class Data : public Message { + uint16 length_; + opaque* buffer_; // read buffer used by fillData input + const opaque* write_buffer_; // write buffer used by output operator +public: + Data(); + Data(uint16 len, opaque* b); + + friend output_buffer& operator<<(output_buffer&, const Data&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + ContentType get_type() const; + uint16 get_length() const; + void set_length(uint16 l); + opaque* set_buffer(); + void SetData(uint16, const opaque*); + void Process(input_buffer&, SSL&); +private: + Data(const Data&); // hide copy + Data& operator=(const Data&); // and assign +}; + + +uint32 c24to32(const uint24); // forward form internal header +void c32to24(uint32, uint24&); + + +// HandShake header, same for each message type from page 20/21 +class HandShakeHeader : public Message { + HandShakeType type_; + uint24 length_; // length of message +public: + HandShakeHeader() {} + + ContentType get_type() const; + uint16 get_length() const; + HandShakeType get_handshakeType() const; + void Process(input_buffer&, SSL&); + + void set_type(HandShakeType hst); + void set_length(uint32 u32); + + friend input_buffer& operator>>(input_buffer&, HandShakeHeader&); + friend output_buffer& operator<<(output_buffer&, const HandShakeHeader&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; +private: + HandShakeHeader(const HandShakeHeader&); // hide copy + HandShakeHeader& operator=(const HandShakeHeader&); // and assign +}; + + +// Base Class for all handshake messages +class HandShakeBase : public virtual_base { + int length_; +public: + int get_length() const; + void set_length(int); + + // for building buffer's type field + virtual HandShakeType get_type() const =0; + + // handles dispactch of proper >> + virtual input_buffer& set(input_buffer& in) =0; + virtual output_buffer& get(output_buffer& out) const =0; + + virtual void Process(input_buffer&, SSL&) =0; + + virtual ~HandShakeBase() {} +}; + + +struct HelloRequest : public HandShakeBase { + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + void Process(input_buffer&, SSL&); + + HandShakeType get_type() const; +}; + + +// The Client's Hello Message from page 23 +class ClientHello : public HandShakeBase { + ProtocolVersion client_version_; + Random random_; + uint8 id_len_; // session id length + opaque session_id_[ID_LEN]; + uint16 suite_len_; // cipher suite length + opaque cipher_suites_[MAX_SUITE_SZ]; + uint8 comp_len_; // compression length + CompressionMethod compression_methods_; +public: + friend input_buffer& operator>>(input_buffer&, ClientHello&); + friend output_buffer& operator<<(output_buffer&, const ClientHello&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + HandShakeType get_type() const; + void Process(input_buffer&, SSL&); + + const opaque* get_random() const; + friend void buildClientHello(SSL&, ClientHello&); + friend void ProcessOldClientHello(input_buffer& input, SSL& ssl); + + ClientHello(); + ClientHello(ProtocolVersion pv, bool useCompression); +private: + ClientHello(const ClientHello&); // hide copy + ClientHello& operator=(const ClientHello&); // and assign +}; + + + +// The Server's Hello Message from page 24 +class ServerHello : public HandShakeBase { + ProtocolVersion server_version_; + Random random_; + uint8 id_len_; // session id length + opaque session_id_[ID_LEN]; + opaque cipher_suite_[SUITE_LEN]; + CompressionMethod compression_method_; +public: + ServerHello(ProtocolVersion pv, bool useCompression); + ServerHello(); + + friend input_buffer& operator>>(input_buffer&, ServerHello&); + friend output_buffer& operator<<(output_buffer&, const ServerHello&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + HandShakeType get_type() const; + void Process(input_buffer&, SSL&); + + const opaque* get_random() const; + friend void buildServerHello(SSL&, ServerHello&); +private: + ServerHello(const ServerHello&); // hide copy + ServerHello& operator=(const ServerHello&); // and assign +}; + + +class x509; + +// Certificate could be a chain +class Certificate : public HandShakeBase { + const x509* cert_; +public: + Certificate(); + explicit Certificate(const x509* cert); + friend output_buffer& operator<<(output_buffer&, const Certificate&); + + const opaque* get_buffer() const; + + // Process handles input, needs SSL + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + HandShakeType get_type() const; + void Process(input_buffer&, SSL&); +private: + Certificate(const Certificate&); // hide copy + Certificate& operator=(const Certificate&); // and assign +}; + + + +// RSA Public Key +struct ServerRSAParams { + opaque* rsa_modulus_; + opaque* rsa_exponent_; +}; + + +// Ephemeral Diffie-Hellman Parameters +class ServerDHParams { + int pSz_; + int gSz_; + int pubSz_; + opaque* p_; + opaque* g_; + opaque* Ys_; +public: + ServerDHParams(); + ~ServerDHParams(); + + int get_pSize() const; + int get_gSize() const; + int get_pubSize() const; + + const opaque* get_p() const; + const opaque* get_g() const; + const opaque* get_pub() const; + + opaque* alloc_p(int sz); + opaque* alloc_g(int sz); + opaque* alloc_pub(int sz); +private: + ServerDHParams(const ServerDHParams&); // hide copy + ServerDHParams& operator=(const ServerDHParams&); // and assign +}; + + +struct ServerKeyBase : public virtual_base { + virtual ~ServerKeyBase() {} + virtual void build(SSL&) {} + virtual void read(SSL&, input_buffer&) {} + virtual int get_length() const; + virtual opaque* get_serverKey() const; +}; + + +// Server random number for FORTEZZA KEA +struct Fortezza_Server : public ServerKeyBase { + opaque r_s_[FORTEZZA_MAX]; +}; + + +struct SignatureBase : public virtual_base { + virtual ~SignatureBase() {} +}; + +struct anonymous_sa : public SignatureBase {}; + + +struct Hashes { + uint8 md5_[MD5_LEN]; + uint8 sha_[SHA_LEN]; +}; + + +struct rsa_sa : public SignatureBase { + Hashes hashes_; +}; + + +struct dsa_sa : public SignatureBase { + uint8 sha_[SHA_LEN]; +}; + + +// Server's Diffie-Hellman exchange +class DH_Server : public ServerKeyBase { + ServerDHParams parms_; + opaque* signature_; + + int length_; // total length of message + opaque* keyMessage_; // total exchange message +public: + DH_Server(); + ~DH_Server(); + + void build(SSL&); + void read(SSL&, input_buffer&); + int get_length() const; + opaque* get_serverKey() const; +private: + DH_Server(const DH_Server&); // hide copy + DH_Server& operator=(const DH_Server&); // and assign +}; + + +// Server's RSA exchange +struct RSA_Server : public ServerKeyBase { + ServerRSAParams params_; + opaque* signature_; // signed rsa_sa hashes +}; + + +class ServerKeyExchange : public HandShakeBase { + ServerKeyBase* server_key_; +public: + explicit ServerKeyExchange(SSL&); + ServerKeyExchange(); + ~ServerKeyExchange(); + + void createKey(SSL&); + void build(SSL& ssl); + + const opaque* getKey() const; + int getKeyLength() const; + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + friend output_buffer& operator<<(output_buffer&, const ServerKeyExchange&); + + void Process(input_buffer&, SSL&); + HandShakeType get_type() const; +private: + ServerKeyExchange(const ServerKeyExchange&); // hide copy + ServerKeyExchange& operator=(const ServerKeyExchange&); // and assign +}; + + + +class CertificateRequest : public HandShakeBase { + ClientCertificateType certificate_types_[CERT_TYPES]; + int typeTotal_; + STL::list certificate_authorities_; +public: + CertificateRequest(); + ~CertificateRequest(); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + friend input_buffer& operator>>(input_buffer&, CertificateRequest&); + friend output_buffer& operator<<(output_buffer&, + const CertificateRequest&); + + void Process(input_buffer&, SSL&); + HandShakeType get_type() const; + + void Build(); +private: + CertificateRequest(const CertificateRequest&); // hide copy + CertificateRequest& operator=(const CertificateRequest&); // and assign +}; + + +struct ServerHelloDone : public HandShakeBase { + ServerHelloDone(); + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + void Process(input_buffer& input, SSL& ssl); + + HandShakeType get_type() const; +}; + + +struct PreMasterSecret { + opaque random_[SECRET_LEN]; // first two bytes Protocol Version +}; + + +struct ClientKeyBase : public virtual_base { + virtual ~ClientKeyBase() {} + virtual void build(SSL&) {} + virtual void read(SSL&, input_buffer&) {} + virtual int get_length() const; + virtual opaque* get_clientKey() const; +}; + + +class EncryptedPreMasterSecret : public ClientKeyBase { + opaque* secret_; + int length_; +public: + EncryptedPreMasterSecret(); + ~EncryptedPreMasterSecret(); + + void build(SSL&); + void read(SSL&, input_buffer&); + int get_length() const; + opaque* get_clientKey() const; + void alloc(int sz); +private: + // hide copy and assign + EncryptedPreMasterSecret(const EncryptedPreMasterSecret&); + EncryptedPreMasterSecret& operator=(const EncryptedPreMasterSecret&); +}; + + +// Fortezza Key Parameters from page 29 +// hard code lengths cause only used here +struct FortezzaKeys : public ClientKeyBase { + opaque y_c_ [128]; // client's Yc, public value + opaque r_c_ [128]; // client's Rc + opaque y_signature_ [40]; // DSS signed public key + opaque wrapped_client_write_key_ [12]; // wrapped by the TEK + opaque wrapped_server_write_key_ [12]; // wrapped by the TEK + opaque client_write_iv_ [24]; + opaque server_write_iv_ [24]; + opaque master_secret_iv_ [24]; // IV used to encrypt preMaster + opaque encrypted_preMasterSecret_[48]; // random & crypted by the TEK +}; + + + +// Diffie-Hellman public key from page 40/41 +class ClientDiffieHellmanPublic : public ClientKeyBase { + PublicValueEncoding public_value_encoding_; + int length_; // includes two byte length for message + opaque* Yc_; // length + Yc_ + // dh_Yc only if explicit, otherwise sent in certificate + enum { KEY_OFFSET = 2 }; +public: + ClientDiffieHellmanPublic(); + ~ClientDiffieHellmanPublic(); + + void build(SSL&); + void read(SSL&, input_buffer&); + int get_length() const; + opaque* get_clientKey() const; + void alloc(int sz, bool offset = false); +private: + // hide copy and assign + ClientDiffieHellmanPublic(const ClientDiffieHellmanPublic&); + ClientDiffieHellmanPublic& operator=(const ClientDiffieHellmanPublic&); +}; + + +class ClientKeyExchange : public HandShakeBase { + ClientKeyBase* client_key_; +public: + explicit ClientKeyExchange(SSL& ssl); + ClientKeyExchange(); + ~ClientKeyExchange(); + + void createKey(SSL&); + void build(SSL& ssl); + + const opaque* getKey() const; + int getKeyLength() const; + + friend output_buffer& operator<<(output_buffer&, const ClientKeyExchange&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + HandShakeType get_type() const; + void Process(input_buffer&, SSL&); +private: + ClientKeyExchange(const ClientKeyExchange&); // hide copy + ClientKeyExchange& operator=(const ClientKeyExchange&); // and assign +}; + + +class CertificateVerify : public HandShakeBase { + Hashes hashes_; + byte* signature_; // owns +public: + CertificateVerify(); + ~CertificateVerify(); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + friend input_buffer& operator>>(input_buffer&, CertificateVerify&); + friend output_buffer& operator<<(output_buffer&, const CertificateVerify&); + + void Process(input_buffer&, SSL&); + HandShakeType get_type() const; + + void Build(SSL&); +private: + CertificateVerify(const CertificateVerify&); // hide copy + CertificateVerify& operator=(const CertificateVerify&); // and assign +}; + + +class Finished : public HandShakeBase { + Hashes hashes_; +public: + Finished(); + + uint8* set_md5(); + uint8* set_sha(); + + friend input_buffer& operator>>(input_buffer&, Finished&); + friend output_buffer& operator<<(output_buffer&, const Finished&); + + input_buffer& set(input_buffer& in); + output_buffer& get(output_buffer& out) const; + + void Process(input_buffer&, SSL&); + + HandShakeType get_type() const; +private: + Finished(const Finished&); // hide copy + Finished& operator=(const Finished&); // and assign +}; + + +class RandomPool; // forward for connection + + +// SSL Connection defined on page 11 +struct Connection { + opaque *pre_master_secret_; + opaque master_secret_[SECRET_LEN]; + opaque client_random_[RAN_LEN]; + opaque server_random_[RAN_LEN]; + opaque sessionID_[ID_LEN]; + opaque client_write_MAC_secret_[SHA_LEN]; // sha is max size + opaque server_write_MAC_secret_[SHA_LEN]; + opaque client_write_key_[AES_256_KEY_SZ]; // aes 256bit is max sz + opaque server_write_key_[AES_256_KEY_SZ]; + opaque client_write_IV_[AES_IV_SZ]; // aes is max size + opaque server_write_IV_[AES_IV_SZ]; + uint32 sequence_number_; + uint32 peer_sequence_number_; + uint32 pre_secret_len_; // pre master length + bool send_server_key_; // server key exchange? + bool master_clean_; // master secret clean? + bool TLS_; // TLSv1 or greater + bool TLSv1_1_; // TLSv1.1 or greater + bool sessionID_Set_; // do we have a session + bool compression_; // zlib compression? + ProtocolVersion version_; // negotiated version + ProtocolVersion chVersion_; // client hello version + RandomPool& random_; + + Connection(ProtocolVersion v, RandomPool& ran); + ~Connection(); + + void AllocPreSecret(uint sz); + void CleanPreMaster(); + void CleanMaster(); + void TurnOffTLS(); + void TurnOffTLS1_1(); +private: + Connection(const Connection&); // hide copy + Connection& operator=(const Connection&); // and assign +}; + + +struct Ciphers; // forward + + +// TLSv1 Security Spec, defined on page 56 of RFC 2246 +struct Parameters { + ConnectionEnd entity_; + BulkCipherAlgorithm bulk_cipher_algorithm_; + CipherType cipher_type_; + uint8 key_size_; + uint8 iv_size_; + IsExportable is_exportable_; + MACAlgorithm mac_algorithm_; + uint8 hash_size_; + CompressionMethod compression_algorithm_; + KeyExchangeAlgorithm kea_; // yassl additions + SignatureAlgorithm sig_algo_; // signature auth type + SignatureAlgorithm verify_algo_; // cert verify auth type + bool pending_; + bool resumable_; // new conns by session + uint16 encrypt_size_; // current msg encrypt sz + Cipher suite_[SUITE_LEN]; // choosen suite + uint8 suites_size_; + Cipher suites_[MAX_SUITE_SZ]; + char cipher_name_[MAX_SUITE_NAME]; + char cipher_list_[MAX_CIPHERS][MAX_SUITE_NAME]; + bool removeDH_; // for server's later use + + Parameters(ConnectionEnd, const Ciphers&, ProtocolVersion, bool haveDH); + + void SetSuites(ProtocolVersion pv, bool removeDH = false, + bool removeRSA = false, bool removeDSA = false); + void SetCipherNames(); +private: + Parameters(const Parameters&); // hide copy + Parameters& operator=(const Parameters&); // and assing +}; + + +input_buffer& operator>>(input_buffer&, RecordLayerHeader&); +output_buffer& operator<<(output_buffer&, const RecordLayerHeader&); + +input_buffer& operator>>(input_buffer&, Message&); +output_buffer& operator<<(output_buffer&, const Message&); + +input_buffer& operator>>(input_buffer&, HandShakeBase&); +output_buffer& operator<<(output_buffer&, const HandShakeBase&); + + +// Message Factory definition +// uses the ContentType enumeration for unique id +typedef Factory MessageFactory; +void InitMessageFactory(MessageFactory&); // registers derived classes + +// HandShake Factory definition +// uses the HandShakeType enumeration for unique id +typedef Factory HandShakeFactory; +void InitHandShakeFactory(HandShakeFactory&); // registers derived classes + +// ServerKey Factory definition +// uses KeyExchangeAlgorithm enumeration for unique id +typedef Factory ServerKeyFactory; +void InitServerKeyFactory(ServerKeyFactory&); + +// ClientKey Factory definition +// uses KeyExchangeAlgorithm enumeration for unique id +typedef Factory ClientKeyFactory; +void InitClientKeyFactory(ClientKeyFactory&); + + +// Message Creators +Message* CreateHandShake(); +Message* CreateCipherSpec(); +Message* CreateAlert(); +Message* CreateData(); + + +// HandShake Creators +HandShakeBase* CreateCertificate(); +HandShakeBase* CreateHelloRequest(); +HandShakeBase* CreateClientHello(); +HandShakeBase* CreateServerHello(); +HandShakeBase* CreateServerKeyExchange(); +HandShakeBase* CreateCertificateRequest(); +HandShakeBase* CreateServerHelloDone(); +HandShakeBase* CreateClientKeyExchange(); +HandShakeBase* CreateCertificateVerify(); +HandShakeBase* CreateFinished(); + + +// ServerKey Exchange Creators +ServerKeyBase* CreateRSAServerKEA(); +ServerKeyBase* CreateDHServerKEA(); +ServerKeyBase* CreateFortezzaServerKEA(); + +// ClientKey Exchange Creators +ClientKeyBase* CreateRSAClient(); +ClientKeyBase* CreateDHClient(); +ClientKeyBase* CreateFortezzaClient(); + + + +} // naemspace + +#endif // yaSSL_IMP_HPP diff --git a/externals/mysql/extlib/yassl/include/yassl_int.hpp b/externals/mysql/extlib/yassl/include/yassl_int.hpp new file mode 100644 index 00000000000..d18dc41860c --- /dev/null +++ b/externals/mysql/extlib/yassl/include/yassl_int.hpp @@ -0,0 +1,693 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL internal header defines SSL supporting types not specified in the + * draft along with type conversion functions and openssl compatibility + */ + + +#ifndef yaSSL_INT_HPP +#define yaSSL_INT_HPP + +#include "yassl_imp.hpp" +#include "yassl_error.hpp" +#include "crypto_wrapper.hpp" +#include "cert_wrapper.hpp" +#include "log.hpp" +#include "lock.hpp" +#include "openssl/ssl.h" // ASN1_STRING and DH + +// Check if _POSIX_THREADS should be forced +#if !defined(_POSIX_THREADS) && (defined(__NETWARE__) || defined(__hpux)) +// HPUX does not define _POSIX_THREADS as it's not _fully_ implemented +// Netware supports pthreads but does not announce it +#define _POSIX_THREADS +#endif + +#ifdef _POSIX_THREADS + #include +#endif + + +namespace STL = STL_NAMESPACE; + + +namespace yaSSL { + + +// State Machine for Record Layer Protocol +enum RecordLayerState { + recordNotReady = 0, // fatal error, no more processing + recordReady +}; + + +// State Machine for HandShake Protocol +enum HandShakeState { + handShakeNotReady = 0, // fatal error, no more processing + preHandshake, // initial state + inHandshake, // handshake started + handShakeReady // handshake done +}; + + +// client input HandShake state, use if HandShakeState == inHandShake +enum ClientState { + serverNull = 0, + serverHelloComplete, + serverCertComplete, + serverKeyExchangeComplete, + serverHelloDoneComplete, + serverFinishedComplete +}; + + +// server input HandShake state, use if HandShakeState == inHandShake +enum ServerState { + clientNull = 0, + clientHelloComplete, + clientKeyExchangeComplete, + clientFinishedComplete +}; + + +// client connect state for nonblocking restart +enum ConnectState { + CONNECT_BEGIN = 0, + CLIENT_HELLO_SENT, + FIRST_REPLY_DONE, + FINISHED_DONE, + SECOND_REPLY_DONE +}; + + +// server accpet state for nonblocking restart +enum AcceptState { + ACCEPT_BEGIN = 0, + ACCEPT_FIRST_REPLY_DONE, + SERVER_HELLO_DONE, + ACCEPT_SECOND_REPLY_DONE, + ACCEPT_FINISHED_DONE, + ACCEPT_THIRD_REPLY_DONE +}; + + +// combines all states +class States { + RecordLayerState recordLayer_; + HandShakeState handshakeLayer_; + ClientState clientState_; + ServerState serverState_; + ConnectState connectState_; + AcceptState acceptState_; + char errorString_[MAX_ERROR_SZ]; + YasslError what_; +public: + States(); + + const RecordLayerState& getRecord() const; + const HandShakeState& getHandShake() const; + const ClientState& getClient() const; + const ServerState& getServer() const; + const ConnectState& GetConnect() const; + const AcceptState& GetAccept() const; + const char* getString() const; + YasslError What() const; + + RecordLayerState& useRecord(); + HandShakeState& useHandShake(); + ClientState& useClient(); + ServerState& useServer(); + ConnectState& UseConnect(); + AcceptState& UseAccept(); + char* useString(); + void SetError(YasslError); +private: + States(const States&); // hide copy + States& operator=(const States&); // and assign +}; + + +// holds all factories +class sslFactory { + MessageFactory messageFactory_; // creates new messages by type + HandShakeFactory handShakeFactory_; // creates new handshake types + ServerKeyFactory serverKeyFactory_; // creates new server key types + ClientKeyFactory clientKeyFactory_; // creates new client key types + + sslFactory(); // only GetSSL_Factory creates +public: + const MessageFactory& getMessage() const; + const HandShakeFactory& getHandShake() const; + const ServerKeyFactory& getServerKey() const; + const ClientKeyFactory& getClientKey() const; + + friend sslFactory& GetSSL_Factory(); // singleton creator +private: + sslFactory(const sslFactory&); // hide copy + sslFactory& operator=(const sslFactory&); // and assign +}; + + +#undef X509_NAME // wincrypt.h clash + +// openSSL X509 names +class X509_NAME { + char* name_; + size_t sz_; + ASN1_STRING entry_; +public: + X509_NAME(const char*, size_t sz); + ~X509_NAME(); + + const char* GetName() const; + ASN1_STRING* GetEntry(int i); + size_t GetLength() const; +private: + X509_NAME(const X509_NAME&); // hide copy + X509_NAME& operator=(const X509_NAME&); // and assign +}; + + +class StringHolder { + ASN1_STRING asnString_; +public: + StringHolder(const char* str, int sz); + ~StringHolder(); + + ASN1_STRING* GetString(); +private: + StringHolder(const StringHolder&); // hide copy + StringHolder& operator=(const StringHolder&); // and assign +}; + + +// openSSL X509 +class X509 { + X509_NAME issuer_; + X509_NAME subject_; + StringHolder beforeDate_; // not valid before + StringHolder afterDate_; // not valid after +public: + X509(const char* i, size_t, const char* s, size_t, + const char* b, int, const char* a, int); + ~X509() {} + + X509_NAME* GetIssuer(); + X509_NAME* GetSubject(); + + ASN1_STRING* GetBefore(); + ASN1_STRING* GetAfter(); + +private: + X509(const X509&); // hide copy + X509& operator=(const X509&); // and assign +}; + + +// openSSL bignum +struct BIGNUM { + /* + gcc 2.96 fix: because of two Integer classes (yaSSL::Integer and + TaoCrypt::Integer), we need to explicitly state the namespace + here to let gcc 2.96 deduce the correct type. + */ + yaSSL::Integer int_; + void assign(const byte* b, uint s) { int_.assign(b,s); } +}; + + +// openSSL session +class SSL_SESSION { + opaque sessionID_[ID_LEN]; + opaque master_secret_[SECRET_LEN]; + Cipher suite_[SUITE_LEN]; + uint bornOn_; // create time in seconds + uint timeout_; // timeout in seconds + RandomPool& random_; // will clean master secret + X509* peerX509_; +public: + explicit SSL_SESSION(RandomPool&); + SSL_SESSION(const SSL&, RandomPool&); + ~SSL_SESSION(); + + const opaque* GetID() const; + const opaque* GetSecret() const; + const Cipher* GetSuite() const; + uint GetBornOn() const; + uint GetTimeOut() const; + X509* GetPeerX509() const; + void SetTimeOut(uint); + + SSL_SESSION& operator=(const SSL_SESSION&); // allow assign for resumption +private: + SSL_SESSION(const SSL_SESSION&); // hide copy + + void CopyX509(X509*); +}; + + +// holds all sessions +class Sessions { + STL::list list_; + RandomPool random_; // for session cleaning + Mutex mutex_; // no-op for single threaded + int count_; // flush counter + + Sessions() : count_(0) {} // only GetSessions can create +public: + SSL_SESSION* lookup(const opaque*, SSL_SESSION* copy = 0); + void add(const SSL&); + void remove(const opaque*); + void Flush(); + + ~Sessions(); + + friend Sessions& GetSessions(); // singleton creator +private: + Sessions(const Sessions&); // hide copy + Sessions& operator=(const Sessions&); // and assign +}; + + +#ifdef _POSIX_THREADS + typedef pthread_t THREAD_ID_T; +#else + typedef DWORD THREAD_ID_T; +#endif + +// thread error data +struct ThreadError { + THREAD_ID_T threadID_; + int errorID_; +}; + + +// holds all errors +class Errors { + STL::list list_; + Mutex mutex_; + + Errors() {} // only GetErrors can create +public: + int Lookup(bool peek); // self lookup + void Add(int); + void Remove(); // remove self + + ~Errors() {} + + friend Errors& GetErrors(); // singleton creator +private: + Errors(const Errors&); // hide copy + Errors& operator=(const Errors); // and assign +}; + + +Sessions& GetSessions(); // forward singletons +sslFactory& GetSSL_Factory(); +Errors& GetErrors(); + + +// openSSL method and context types +class SSL_METHOD { + ProtocolVersion version_; + ConnectionEnd side_; + bool verifyPeer_; // request or send certificate + bool verifyNone_; // whether to verify certificate + bool failNoCert_; + bool multipleProtocol_; // for SSLv23 compatibility +public: + SSL_METHOD(ConnectionEnd ce, ProtocolVersion pv, + bool multipleProtocol = false); + + ProtocolVersion getVersion() const; + ConnectionEnd getSide() const; + + void setVerifyPeer(); + void setVerifyNone(); + void setFailNoCert(); + + bool verifyPeer() const; + bool verifyNone() const; + bool failNoCert() const; + bool multipleProtocol() const; +private: + SSL_METHOD(const SSL_METHOD&); // hide copy + SSL_METHOD& operator=(const SSL_METHOD&); // and assign +}; + + +struct Ciphers { + bool setSuites_; // user set suites from default + byte suites_[MAX_SUITE_SZ]; // new suites + int suiteSz_; // suite length in bytes + + Ciphers() : setSuites_(false), suiteSz_(0) {} +}; + + +struct DH; // forward + + +// save for SSL construction +struct DH_Parms { + Integer p_; + Integer g_; + bool set_; // if set by user + + DH_Parms() : set_(false) {} +}; + + +enum StatsField { + Accept, Connect, AcceptGood, ConnectGood, AcceptRenegotiate, + ConnectRenegotiate, Hits, CbHits, CacheFull, Misses, Timeouts, Number, + GetCacheSize, VerifyMode, VerifyDepth +}; + + +// SSL stats +struct Stats { + long accept_; + long connect_; + long acceptGood_; + long connectGood_; + long acceptRenegotiate_; + long connectRenegotiate_; + + long hits_; + long cbHits_; + long cacheFull_; + long misses_; + long timeouts_; + long number_; + long getCacheSize_; + + int verifyMode_; + int verifyDepth_; +public: + Stats() : accept_(0), connect_(0), acceptGood_(0), connectGood_(0), + acceptRenegotiate_(0), connectRenegotiate_(0), hits_(0), cbHits_(0), + cacheFull_(0), misses_(0), timeouts_(0), number_(0), getCacheSize_(0), + verifyMode_(0), verifyDepth_(0) + {} +private: + Stats(const Stats&); // hide copy + Stats& operator=(const Stats&); // and assign +}; + + +// the SSL context +class SSL_CTX { +public: + typedef STL::list CertList; +private: + SSL_METHOD* method_; + x509* certificate_; + x509* privateKey_; + CertList caList_; + Ciphers ciphers_; + DH_Parms dhParms_; + pem_password_cb passwordCb_; + void* userData_; + bool sessionCacheOff_; + bool sessionCacheFlushOff_; + Stats stats_; + Mutex mutex_; // for Stats + VerifyCallback verifyCallback_; +public: + explicit SSL_CTX(SSL_METHOD* meth); + ~SSL_CTX(); + + const x509* getCert() const; + const x509* getKey() const; + const SSL_METHOD* getMethod() const; + const Ciphers& GetCiphers() const; + const DH_Parms& GetDH_Parms() const; + const Stats& GetStats() const; + const VerifyCallback getVerifyCallback() const; + pem_password_cb GetPasswordCb() const; + void* GetUserData() const; + bool GetSessionCacheOff() const; + bool GetSessionCacheFlushOff() const; + + void setVerifyPeer(); + void setVerifyNone(); + void setFailNoCert(); + void setVerifyCallback(VerifyCallback); + bool SetCipherList(const char*); + bool SetDH(const DH&); + void SetPasswordCb(pem_password_cb cb); + void SetUserData(void*); + void SetSessionCacheOff(); + void SetSessionCacheFlushOff(); + + void IncrementStats(StatsField); + void AddCA(x509* ca); + const CertList& GetCA_List() const; + + friend int read_file(SSL_CTX*, const char*, int, CertType); +private: + SSL_CTX(const SSL_CTX&); // hide copy + SSL_CTX& operator=(const SSL_CTX&); // and assign +}; + + +// holds all cryptographic types +class Crypto { + Digest* digest_; // agreed upon digest + BulkCipher* cipher_; // agreed upon cipher + DiffieHellman* dh_; // dh parms + RandomPool random_; // random number generator + CertManager cert_; // manages certificates +public: + explicit Crypto(); + ~Crypto(); + + const Digest& get_digest() const; + const BulkCipher& get_cipher() const; + const DiffieHellman& get_dh() const; + const RandomPool& get_random() const; + const CertManager& get_certManager() const; + + Digest& use_digest(); + BulkCipher& use_cipher(); + DiffieHellman& use_dh(); + RandomPool& use_random(); + CertManager& use_certManager(); + + void SetDH(DiffieHellman*); + void SetDH(const DH_Parms&); + void setDigest(Digest*); + void setCipher(BulkCipher*); + + bool DhSet(); +private: + Crypto(const Crypto&); // hide copy + Crypto& operator=(const Crypto&); // and assign +}; + + +// holds all handshake and verify hashes +class sslHashes { + MD5 md5HandShake_; // md5 handshake hash + SHA shaHandShake_; // sha handshake hash + Finished verify_; // peer's verify hash + Hashes certVerify_; // peer's cert verify hash +public: + sslHashes() {} + + const MD5& get_MD5() const; + const SHA& get_SHA() const; + const Finished& get_verify() const; + const Hashes& get_certVerify() const; + + MD5& use_MD5(); + SHA& use_SHA(); + Finished& use_verify(); + Hashes& use_certVerify(); +private: + sslHashes(const sslHashes&); // hide copy + sslHashes& operator=(const sslHashes&); // and assign +}; + + +// holds input and output buffers +class Buffers { +public: + typedef STL::list inputList; + typedef STL::list outputList; +private: + inputList dataList_; // list of users app data / handshake + outputList handShakeList_; // buffered handshake msgs + input_buffer* rawInput_; // buffered raw input yet to process +public: + Buffers(); + ~Buffers(); + + const inputList& getData() const; + const outputList& getHandShake() const; + + inputList& useData(); + outputList& useHandShake(); + + void SetRawInput(input_buffer*); // takes ownership + input_buffer* TakeRawInput(); // takes ownership +private: + Buffers(const Buffers&); // hide copy + Buffers& operator=(const Buffers&); // and assign +}; + + +// wraps security parameters +class Security { + Connection conn_; // connection information + Parameters parms_; // may be pending + SSL_SESSION resumeSession_; // if resuming + SSL_CTX* ctx_; // context used to init + bool resuming_; // trying to resume +public: + Security(ProtocolVersion, RandomPool&, ConnectionEnd, const Ciphers&, + SSL_CTX*, bool); + + const SSL_CTX* GetContext() const; + const Connection& get_connection() const; + const Parameters& get_parms() const; + const SSL_SESSION& get_resume() const; + bool get_resuming() const; + + Connection& use_connection(); + Parameters& use_parms(); + SSL_SESSION& use_resume(); + + void set_resuming(bool b); +private: + Security(const Security&); // hide copy + Security& operator=(const Security&); // and assign +}; + + +// THE SSL type +class SSL { + Crypto crypto_; // agreed crypto agents + Security secure_; // Connection and Session parms + States states_; // Record and HandShake states + sslHashes hashes_; // handshake, finished hashes + Socket socket_; // socket wrapper + Buffers buffers_; // buffered handshakes and data + Log log_; // logger + bool quietShutdown_; + + // optimization variables + bool has_data_; // buffered data ready? +public: + SSL(SSL_CTX* ctx); + + // gets and uses + const Crypto& getCrypto() const; + const Security& getSecurity() const; + const States& getStates() const; + const sslHashes& getHashes() const; + const sslFactory& getFactory() const; + const Socket& getSocket() const; + YasslError GetError() const; + bool GetMultiProtocol() const; + bool CompressionOn() const; + + Crypto& useCrypto(); + Security& useSecurity(); + States& useStates(); + sslHashes& useHashes(); + Socket& useSocket(); + Log& useLog(); + Buffers& useBuffers(); + + bool HasData() const; + bool GetQuietShutdown() const; + + // sets + void set_pending(Cipher suite); + void set_random(const opaque*, ConnectionEnd); + void set_sessionID(const opaque*); + void set_session(SSL_SESSION*); + void set_preMaster(const opaque*, uint); + void set_masterSecret(const opaque*); + void SetError(YasslError); + int SetCompression(); + void UnSetCompression(); + void SetQuietShutdown(bool mode); + + // helpers + bool isTLS() const; + bool isTLSv1_1() const; + void order_error(); + void makeMasterSecret(); + void makeTLSMasterSecret(); + void addData(input_buffer* data); + void fillData(Data&); + void PeekData(Data&); + void addBuffer(output_buffer* b); + void flushBuffer(); + void verifyState(const RecordLayerHeader&); + void verifyState(const HandShakeHeader&); + void verifyState(ClientState); + void verifyState(ServerState); + void verfiyHandShakeComplete(); + void matchSuite(const opaque*, uint length); + void deriveKeys(); + void deriveTLSKeys(); + void Send(const byte*, uint); + + uint bufferedData(); + uint get_SEQIncrement(bool); + + const byte* get_macSecret(bool); +private: + void storeKeys(const opaque*); + void setKeys(); + void verifyClientState(HandShakeType); + void verifyServerState(HandShakeType); + + SSL(const SSL&); // hide copy + const SSL& operator=(const SSL&); // and assign +}; + + +// compression +int Compress(const byte*, int, input_buffer&); +int DeCompress(input_buffer&, int, input_buffer&); + + +// conversion functions +void c32to24(uint32, uint24&); +void c24to32(const uint24, uint32&); + +uint32 c24to32(const uint24); + +void ato16(const opaque*, uint16&); +void ato24(const opaque*, uint24&); + +void c16toa(uint16, opaque*); +void c24toa(const uint24, opaque*); +void c32toa(uint32 u32, opaque*); + + +} // naemspace + +#endif // yaSSL_INT_HPP diff --git a/externals/mysql/extlib/yassl/include/yassl_types.hpp b/externals/mysql/extlib/yassl/include/yassl_types.hpp new file mode 100644 index 00000000000..1af9e90f901 --- /dev/null +++ b/externals/mysql/extlib/yassl/include/yassl_types.hpp @@ -0,0 +1,528 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* yaSSL types header defines all constants, enums, and typedefs + * from the SSL.v3 specification "draft-freier-ssl-version3-02.txt" + */ + + +#ifndef yaSSL_TYPES_HPP +#define yaSSL_TYPES_HPP + +#include +#include +#include "type_traits.hpp" + + +#ifdef _MSC_VER + // disable conversion warning + // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy + #pragma warning(disable:4244 4996) +#endif + + +namespace yaSSL { + +#define YASSL_LIB + + +#ifdef YASSL_PURE_C + + // library allocation + struct new_t {}; // yaSSL New type + extern new_t ys; // pass in parameter + + } // namespace yaSSL + + void* operator new (size_t, yaSSL::new_t); + void* operator new[](size_t, yaSSL::new_t); + + void operator delete (void*, yaSSL::new_t); + void operator delete[](void*, yaSSL::new_t); + + + namespace yaSSL { + + + template + void ysDelete(T* ptr) + { + if (ptr) ptr->~T(); + ::operator delete(ptr, yaSSL::ys); + } + + template + void ysArrayDelete(T* ptr) + { + // can't do array placement destruction since not tracking size in + // allocation, only allow builtins to use array placement since they + // don't need destructors called + typedef char builtin[TaoCrypt::IsFundamentalType::Yes ? 1 : -1]; + (void)sizeof(builtin); + + ::operator delete[](ptr, yaSSL::ys); + } + + #define NEW_YS new (yaSSL::ys) + + // to resolve compiler generated operator delete on base classes with + // virtual destructors (when on stack), make sure doesn't get called + class virtual_base { + public: + static void operator delete(void*) { assert(0); } + }; + + +#else // YASSL_PURE_C + + + template + void ysDelete(T* ptr) + { + delete ptr; + } + + template + void ysArrayDelete(T* ptr) + { + delete[] ptr; + } + + #define NEW_YS new + + class virtual_base {}; + + + +#endif // YASSL_PURE_C + + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef uint8 uint24[3]; +typedef uint32 uint64[2]; + +typedef uint8 opaque; +typedef opaque byte; + +typedef unsigned int uint; + + +#ifdef USE_SYS_STL + // use system STL + #define STL_VECTOR_FILE + #define STL_LIST_FILE + #define STL_ALGORITHM_FILE + #define STL_MEMORY_FILE + #define STL_PAIR_FILE + + #define STL_NAMESPACE std +#else + // use mySTL + #define STL_VECTOR_FILE "vector.hpp" + #define STL_LIST_FILE "list.hpp" + #define STL_ALGORITHM_FILE "algorithm.hpp" + #define STL_MEMORY_FILE "memory.hpp" + #define STL_PAIR_FILE "pair.hpp" + + #define STL_NAMESPACE mySTL +#endif + + +#ifndef min +template +T min(T a, T b) +{ + return a < b ? a : b; +} +#endif + + + +// all length constants in bytes +const int ID_LEN = 32; // session id length +const int SUITE_LEN = 2; // cipher suite length +const int SECRET_LEN = 48; // pre RSA and all master secret length +const int MASTER_ROUNDS = 3; // master secret derivation rounds +const int RAN_LEN = 32; // client and server random length +const int MAC_BLOCK_SZ = 64; // MAC block size, & padding +const int MD5_LEN = 16; // MD5 digest length +const int SHA_LEN = 20; // SHA digest length +const int RMD_LEN = 20; // RIPEMD-160 digest length +const int PREFIX = 3; // up to 3 prefix letters for secret rounds +const int KEY_PREFIX = 7; // up to 7 prefix letters for key rounds +const int FORTEZZA_MAX = 128; // Maximum Fortezza Key length +const int MAX_SUITE_SZ = 128; // 64 max suites * sizeof(suite) +const int MAX_SUITE_NAME = 48; // max length of suite name +const int MAX_CIPHERS = 32; // max supported ciphers for cipher list +const int SIZEOF_ENUM = 1; // SSL considers an enum 1 byte, not 4 +const int SIZEOF_SENDER = 4; // Sender constant, for finished generation +const int PAD_MD5 = 48; // pad length 1 and 2 for md5 finished +const int PAD_SHA = 40; // should be 44, specd wrong by netscape +const int PAD_RMD = 44; // pad length for RIPEMD-160, some use 40?? +const int CERT_HEADER = 3; // always use 3 bytes for certificate +const int CERT_TYPES = 7; // certificate request types +const int REQUEST_HEADER = 2; // request uses 2 bytes +const int VERIFY_HEADER = 2; // verify length field +const int MIN_CERT_TYPES = 1; // minimum certificate request types +const int MIN_DIS_NAMES = 3; // minimum distinguished names +const int MIN_DIS_SIZE = 1; // minimum distinguished name size +const int RECORD_HEADER = 5; // type + version + length(2) +const int HANDSHAKE_HEADER = 4; // type + length(3) +const int FINISHED_SZ = MD5_LEN + SHA_LEN; // sizeof finished data +const int TLS_FINISHED_SZ = 12; // TLS verify data size +const int SEQ_SZ = 8; // 64 bit sequence number +const int LENGTH_SZ = 2; // length field for HMAC, data only +const int VERSION_SZ = SIZEOF_ENUM * 2; // SSL/TLS length of version +const int DES_KEY_SZ = 8; // DES Key length +const int DES_EDE_KEY_SZ = 24; // DES EDE Key length +const int DES_BLOCK = 8; // DES is always fixed block size 8 +const int DES_IV_SZ = DES_BLOCK; // Init Vector length for DES +const int RC4_KEY_SZ = 16; // RC4 Key length +const int AES_128_KEY_SZ = 16; // AES 128bit Key length +const int AES_192_KEY_SZ = 24; // AES 192bit Key length +const int AES_256_KEY_SZ = 32; // AES 256bit Key length +const int AES_BLOCK_SZ = 16; // AES 128bit block size, rfc 3268 +const int AES_IV_SZ = AES_BLOCK_SZ; // AES Init Vector length +const int DSS_SIG_SZ = 40; // two 20 byte high byte first Integers +const int DSS_ENCODED_EXTRA = 6; // seqID + len(1) + (intID + len(1)) * 2 +const int EVP_SALT_SZ = 8; +const int MASTER_LABEL_SZ = 13; // TLS master secret label size +const int KEY_LABEL_SZ = 13; // TLS key block expansion size +const int FINISHED_LABEL_SZ = 15; // TLS finished lable length +const int SEED_LEN = RAN_LEN * 2; // TLS seed, client + server random +const int DEFAULT_TIMEOUT = 500; // Default Session timeout in seconds +const int MAX_RECORD_SIZE = 16384; // 2^14, max size by standard +const int COMPRESS_EXTRA = 1024; // extra compression possible addition +const int SESSION_FLUSH_COUNT = 256; // when to flush session cache + + +typedef uint8 Cipher; // first byte is always 0x00 for SSLv3 & TLS + +typedef opaque Random[RAN_LEN]; + +typedef opaque* DistinguishedName; + +typedef bool IsExportable; + + +enum CompressionMethod { no_compression = 0, zlib = 221 }; + +enum CipherType { stream, block }; + +enum CipherChoice { change_cipher_spec_choice = 1 }; + +enum PublicValueEncoding { implicit_encoding, explicit_encoding }; + +enum ConnectionEnd { server_end, client_end }; + +enum AlertLevel { warning = 1, fatal = 2 }; + + + +// Record Layer Header identifier from page 12 +enum ContentType { + no_type = 0, + change_cipher_spec = 20, + alert = 21, + handshake = 22, + application_data = 23 +}; + + +// HandShake Layer Header identifier from page 20 +enum HandShakeType { + no_shake = -1, + hello_request = 0, + client_hello = 1, + server_hello = 2, + certificate = 11, + server_key_exchange = 12, + certificate_request = 13, + server_hello_done = 14, + certificate_verify = 15, + client_key_exchange = 16, + finished = 20 +}; + + +// Valid Alert types from page 16/17 +enum AlertDescription { + close_notify = 0, + unexpected_message = 10, + bad_record_mac = 20, + decompression_failure = 30, + handshake_failure = 40, + no_certificate = 41, + bad_certificate = 42, + unsupported_certificate = 43, + certificate_revoked = 44, + certificate_expired = 45, + certificate_unknown = 46, + illegal_parameter = 47 +}; + + +// Supported Key Exchange Protocols +enum KeyExchangeAlgorithm { + no_kea = 0, + rsa_kea, + diffie_hellman_kea, + fortezza_kea +}; + + +// Supported Authentication Schemes +enum SignatureAlgorithm { + anonymous_sa_algo = 0, + rsa_sa_algo, + dsa_sa_algo +}; + + +// Valid client certificate request types from page 27 +enum ClientCertificateType { + rsa_sign = 1, + dss_sign = 2, + rsa_fixed_dh = 3, + dss_fixed_dh = 4, + rsa_ephemeral_dh = 5, + dss_ephemeral_dh = 6, + fortezza_kea_cert = 20 +}; + + +// Supported Ciphers from page 43 +enum BulkCipherAlgorithm { + cipher_null, + rc4, + rc2, + des, + triple_des, // leading 3 (3des) not valid identifier + des40, + idea, + aes +}; + + +// Supported Message Authentication Codes from page 43 +enum MACAlgorithm { + no_mac, + md5, + sha, + rmd +}; + + +// Certificate file Type +enum CertType { Cert = 0, PrivateKey, CA }; + + +// all Cipher Suites from pages 41/42 +const Cipher SSL_NULL_WITH_NULL_NULL = 0; // { 0x00, 0x00 } +const Cipher SSL_RSA_WITH_NULL_MD5 = 1; // { 0x00, 0x01 } +const Cipher SSL_RSA_WITH_NULL_SHA = 2; // { 0x00, 0x02 } +const Cipher SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 3; // { 0x00, 0x03 } +const Cipher SSL_RSA_WITH_RC4_128_MD5 = 4; // { 0x00, 0x04 } +const Cipher SSL_RSA_WITH_RC4_128_SHA = 5; // { 0x00, 0x05 } +const Cipher SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 6; // { 0x00, 0x06 } +const Cipher SSL_RSA_WITH_IDEA_CBC_SHA = 7; // { 0x00, 0x07 } +const Cipher SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 8; // { 0x00, 0x08 } +const Cipher SSL_RSA_WITH_DES_CBC_SHA = 9; // { 0x00, 0x09 } +const Cipher SSL_RSA_WITH_3DES_EDE_CBC_SHA = 10; // { 0x00, 0x0A } +const Cipher SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 11; // { 0x00, 0x0B } +const Cipher SSL_DH_DSS_WITH_DES_CBC_SHA = 12; // { 0x00, 0x0C } +const Cipher SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; // { 0x00, 0x0D } +const Cipher SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 14; // { 0x00, 0x0E } +const Cipher SSL_DH_RSA_WITH_DES_CBC_SHA = 15; // { 0x00, 0x0F } +const Cipher SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; // { 0x00, 0x10 } +const Cipher SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 17; // { 0x00, 0x11 } +const Cipher SSL_DHE_DSS_WITH_DES_CBC_SHA = 18; // { 0x00, 0x12 } +const Cipher SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; // { 0x00, 0x13 } +const Cipher SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 20; // { 0x00, 0x14 } +const Cipher SSL_DHE_RSA_WITH_DES_CBC_SHA = 21; // { 0x00, 0x15 } +const Cipher SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; // { 0x00, 0x16 } +const Cipher SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 23; // { 0x00, 0x17 } +const Cipher SSL_DH_anon_WITH_RC4_128_MD5 = 24; // { 0x00, 0x18 } +const Cipher SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 25; // { 0x00, 0x19 } +const Cipher SSL_DH_anon_WITH_DES_CBC_SHA = 26; // { 0x00, 0x1A } +const Cipher SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 27; // { 0x00, 0x1B } +const Cipher SSL_FORTEZZA_KEA_WITH_NULL_SHA = 28; // { 0x00, 0x1C } +const Cipher SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 29; // { 0x00, 0x1D } +const Cipher SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 30; // { 0x00, 0x1E } + +// .. to 0x2B uses Kerberos Authentication + + +// TLS AES extensions +const Cipher TLS_RSA_WITH_AES_128_CBC_SHA = 47; // { 0x00, 0x2F } +const Cipher TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48; // { 0x00, 0x30 } +const Cipher TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49; // { 0x00, 0x31 } +const Cipher TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50; // { 0x00, 0x32 } +const Cipher TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51; // { 0x00, 0x33 } +const Cipher TLS_DH_anon_WITH_AES_128_CBC_SHA = 52; // { 0x00, 0x34 } + +const Cipher TLS_RSA_WITH_AES_256_CBC_SHA = 53; // { 0x00, 0x35 } +const Cipher TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54; // { 0x00, 0x36 } +const Cipher TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55; // { 0x00, 0x37 } +const Cipher TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56; // { 0x00, 0x38 } +const Cipher TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57; // { 0x00, 0x39 } +const Cipher TLS_DH_anon_WITH_AES_256_CBC_SHA = 58; // { 0x00, 0x3A } + + +// OpenPGP extensions + +const Cipher TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160 = 114; // { 0x00, 0x72 }; +const Cipher TLS_DHE_DSS_WITH_AES_128_CBC_RMD160 = 115; // { 0x00, 0x73 }; +const Cipher TLS_DHE_DSS_WITH_AES_256_CBC_RMD160 = 116; // { 0x00, 0x74 }; +const Cipher TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160 = 119; // { 0x00, 0x77 }; +const Cipher TLS_DHE_RSA_WITH_AES_128_CBC_RMD160 = 120; // { 0x00, 0x78 }; +const Cipher TLS_DHE_RSA_WITH_AES_256_CBC_RMD160 = 121; // { 0x00, 0x79 }; +const Cipher TLS_RSA_WITH_3DES_EDE_CBC_RMD160 = 124; // { 0x00, 0x7C }; +const Cipher TLS_RSA_WITH_AES_128_CBC_RMD160 = 125; // { 0x00, 0x7D }; +const Cipher TLS_RSA_WITH_AES_256_CBC_RMD160 = 126; // { 0x00, 0x7E }; + + +const char* const null_str = ""; + +const char* const cipher_names[128] = +{ + null_str, // SSL_NULL_WITH_NULL_NULL = 0 + null_str, // SSL_RSA_WITH_NULL_MD5 = 1 + null_str, // SSL_RSA_WITH_NULL_SHA = 2 + null_str, // SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 3 + "RC4-MD5", // SSL_RSA_WITH_RC4_128_MD5 = 4 + "RC4-SHA", // SSL_RSA_WITH_RC4_128_SHA = 5 + null_str, // SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 6 + null_str, // SSL_RSA_WITH_IDEA_CBC_SHA = 7 + null_str, // SSL_RSA_EXPORT_WITH_DES40_CBC_SHA = 8 + "DES-CBC-SHA", // SSL_RSA_WITH_DES_CBC_SHA = 9 + "DES-CBC3-SHA", // SSL_RSA_WITH_3DES_EDE_CBC_SHA = 10 + + null_str, // SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 11 + null_str, // SSL_DH_DSS_WITH_DES_CBC_SHA = 12 + null_str, // SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13 + null_str, // SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 14 + null_str, // SSL_DH_RSA_WITH_DES_CBC_SHA = 15 + null_str, // SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16 + null_str, // SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 17 + "EDH-DSS-DES-CBC-SHA", // SSL_DHE_DSS_WITH_DES_CBC_SHA = 18 + "EDH-DSS-DES-CBC3-SHA", // SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19 + null_str, // SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 20 + + "EDH-RSA-DES-CBC-SHA", // SSL_DHE_RSA_WITH_DES_CBC_SHA = 21 + "EDH-RSA-DES-CBC3-SHA", // SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22 + null_str, // SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 23 + null_str, // SSL_DH_anon_WITH_RC4_128_MD5 = 24 + null_str, // SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 25 + null_str, // SSL_DH_anon_WITH_DES_CBC_SHA = 26 + null_str, // SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 27 + null_str, // SSL_FORTEZZA_KEA_WITH_NULL_SHA = 28 + null_str, // SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 29 + null_str, // SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 30 + + null_str, null_str, null_str, null_str, null_str, // 31 - 35 + null_str, null_str, null_str, null_str, null_str, // 36 - 40 + null_str, null_str, null_str, null_str, null_str, // 41 - 45 + null_str, // 46 + + // TLS AES extensions + "AES128-SHA", // TLS_RSA_WITH_AES_128_CBC_SHA = 47 + null_str, // TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48 + null_str, // TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49 + "DHE-DSS-AES128-SHA", // TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50 + "DHE-RSA-AES128-SHA", // TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51 + null_str, // TLS_DH_anon_WITH_AES_128_CBC_SHA = 52 + + "AES256-SHA", // TLS_RSA_WITH_AES_256_CBC_SHA = 53 + null_str, // TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54 + null_str, // TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55 + "DHE-DSS-AES256-SHA", // TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56 + "DHE-RSA-AES256-SHA", // TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57 + null_str, // TLS_DH_anon_WITH_AES_256_CBC_SHA = 58 + + null_str, // 59 + null_str, // 60 + null_str, null_str, null_str, null_str, null_str, // 61 - 65 + null_str, null_str, null_str, null_str, null_str, // 66 - 70 + null_str, null_str, null_str, null_str, null_str, // 71 - 75 + null_str, null_str, null_str, null_str, null_str, // 76 - 80 + null_str, null_str, null_str, null_str, null_str, // 81 - 85 + null_str, null_str, null_str, null_str, null_str, // 86 - 90 + null_str, null_str, null_str, null_str, null_str, // 91 - 95 + null_str, null_str, null_str, null_str, null_str, // 96 - 100 + null_str, null_str, null_str, null_str, null_str, // 101 - 105 + null_str, null_str, null_str, null_str, null_str, // 106 - 110 + null_str, null_str, null_str, // 111 - 113 + + "DHE-DSS-DES-CBC3-RMD", // TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160 = 114 + "DHE-DSS-AES128-RMD", // TLS_DHE_DSS_WITH_AES_128_CBC_RMD160 = 115 + "DHE-DSS-AES256-RMD", // TLS_DHE_DSS_WITH_AES_256_CBC_RMD160 = 116 + null_str, // 117 + null_str, // 118 + "DHE-RSA-DES-CBC3-RMD", // TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160 = 119 + "DHE-RSA-AES128-RMD", // TLS_DHE_RSA_WITH_AES_128_CBC_RMD160 = 120 + "DHE-RSA-AES256-RMD", // TLS_DHE_RSA_WITH_AES_256_CBC_RMD160 = 121 + null_str, // 122 + null_str, // 123 + "DES-CBC3-RMD", // TLS_RSA_WITH_3DES_EDE_CBC_RMD160 = 124 + "AES128-RMD", // TLS_RSA_WITH_AES_128_CBC_RMD160 = 125 + "AES256-RMD", // TLS_RSA_WITH_AES_256_CBC_RMD160 = 126 + null_str // 127 +}; + +// fill with MD5 pad size since biggest required +const opaque PAD1[PAD_MD5] = { 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36 + }; +const opaque PAD2[PAD_MD5] = { 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, + 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, + 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, + 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, + 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, + 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c + }; + +const opaque client[SIZEOF_SENDER] = { 0x43, 0x4C, 0x4E, 0x54 }; +const opaque server[SIZEOF_SENDER] = { 0x53, 0x52, 0x56, 0x52 }; + +const opaque tls_client[FINISHED_LABEL_SZ + 1] = "client finished"; +const opaque tls_server[FINISHED_LABEL_SZ + 1] = "server finished"; + +const opaque master_label[MASTER_LABEL_SZ + 1] = "master secret"; +const opaque key_label [KEY_LABEL_SZ + 1] = "key expansion"; + + +} // naemspace + +#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 +/* + gcc 2.96 bails out because of two declarations of byte: yaSSL::byte and + TaoCrypt::byte. TODO: define global types.hpp and move the declaration of + 'byte' there. +*/ +using yaSSL::byte; +#endif + + +#endif // yaSSL_TYPES_HPP diff --git a/externals/mysql/extlib/yassl/src/buffer.cpp b/externals/mysql/extlib/yassl/src/buffer.cpp new file mode 100644 index 00000000000..0c3f23b0cb8 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/buffer.cpp @@ -0,0 +1,279 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL buffer header implements input/output buffers to simulate streaming + * with SSL types and sockets + */ + + +#include // memcpy +#include "runtime.hpp" +#include "buffer.hpp" +#include "yassl_types.hpp" + +namespace yaSSL { + + + +// Checking Policy should implement a check function that tests whether the +// index is within the size limit of the array + +void Check::check(uint i, uint limit) +{ + assert(i < limit); +} + + +void NoCheck::check(uint, uint) +{ +} + + +/* input_buffer operates like a smart c style array with a checking option, + * meant to be read from through [] with AUTO index or read(). + * Should only write to at/near construction with assign() or raw (e.g., recv) + * followed by add_size with the number of elements added by raw write. + * + * Not using vector because need checked []access, offset, and the ability to + * write to the buffer bulk wise and have the correct size + */ + + +input_buffer::input_buffer() + : size_(0), current_(0), buffer_(0), end_(0) +{} + + +input_buffer::input_buffer(uint s) + : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) +{} + + +// with assign +input_buffer::input_buffer(uint s, const byte* t, uint len) + : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) +{ + assign(t, len); +} + + +input_buffer::~input_buffer() +{ + ysArrayDelete(buffer_); +} + + +// users can pass defualt zero length buffer and then allocate +void input_buffer::allocate(uint s) +{ + assert(!buffer_); // find realloc error + buffer_ = NEW_YS byte[s]; + end_ = buffer_ + s; +} + + +// for passing to raw writing functions at beginning, then use add_size +byte* input_buffer::get_buffer() const +{ + return buffer_; +} + + +// after a raw write user can set NEW_YS size +// if you know the size before the write use assign() +void input_buffer::add_size(uint i) +{ + check(size_ + i-1, get_capacity()); + size_ += i; +} + + +uint input_buffer::get_capacity() const +{ + return end_ - buffer_; +} + + +uint input_buffer::get_current() const +{ + return current_; +} + + +uint input_buffer::get_size() const +{ + return size_; +} + + +uint input_buffer::get_remaining() const +{ + return size_ - current_; +} + + +void input_buffer::set_current(uint i) +{ + if (i) + check(i - 1, size_); + current_ = i; +} + + +// read only access through [], advance current +// user passes in AUTO index for ease of use +const byte& input_buffer::operator[](uint i) +{ + assert (i == AUTO); + check(current_, size_); + return buffer_[current_++]; +} + + +// end of input test +bool input_buffer::eof() +{ + return current_ >= size_; +} + + +// peek ahead +byte input_buffer::peek() const +{ + return buffer_[current_]; +} + + +// write function, should use at/near construction +void input_buffer::assign(const byte* t, uint s) +{ + check(current_, get_capacity()); + add_size(s); + memcpy(&buffer_[current_], t, s); +} + + +// use read to query input, adjusts current +void input_buffer::read(byte* dst, uint length) +{ + check(current_ + length - 1, size_); + memcpy(dst, &buffer_[current_], length); + current_ += length; +} + + + +/* output_buffer operates like a smart c style array with a checking option. + * Meant to be written to through [] with AUTO index or write(). + * Size (current) counter increases when written to. Can be constructed with + * zero length buffer but be sure to allocate before first use. + * Don't use add write for a couple bytes, use [] instead, way less overhead. + * + * Not using vector because need checked []access and the ability to + * write to the buffer bulk wise and retain correct size + */ + + +output_buffer::output_buffer() + : current_(0), buffer_(0), end_(0) +{} + + +// with allocate +output_buffer::output_buffer(uint s) + : current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) +{} + + +// with assign +output_buffer::output_buffer(uint s, const byte* t, uint len) + : current_(0), buffer_(NEW_YS byte[s]), end_(buffer_+ s) +{ + write(t, len); +} + + +output_buffer::~output_buffer() +{ + ysArrayDelete(buffer_); +} + + +uint output_buffer::get_size() const +{ + return current_; +} + + +uint output_buffer::get_capacity() const +{ + return end_ - buffer_; +} + + +void output_buffer::set_current(uint c) +{ + check(c, get_capacity()); + current_ = c; +} + + +// users can pass defualt zero length buffer and then allocate +void output_buffer::allocate(uint s) +{ + assert(!buffer_); // find realloc error + buffer_ = NEW_YS byte[s]; end_ = buffer_ + s; +} + + +// for passing to reading functions when finished +const byte* output_buffer::get_buffer() const +{ + return buffer_; +} + + +// allow write access through [], update current +// user passes in AUTO as index for ease of use +byte& output_buffer::operator[](uint i) +{ + assert(i == AUTO); + check(current_, get_capacity()); + return buffer_[current_++]; +} + + +// end of output test +bool output_buffer::eof() +{ + return current_ >= get_capacity(); +} + + +void output_buffer::write(const byte* t, uint s) +{ + check(current_ + s - 1, get_capacity()); + memcpy(&buffer_[current_], t, s); + current_ += s; +} + + + +} // naemspace + diff --git a/externals/mysql/extlib/yassl/src/cert_wrapper.cpp b/externals/mysql/extlib/yassl/src/cert_wrapper.cpp new file mode 100644 index 00000000000..ebec0882265 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/cert_wrapper.cpp @@ -0,0 +1,370 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* The certificate wrapper source implements certificate management functions + * + */ + +#include "runtime.hpp" +#include "cert_wrapper.hpp" +#include "yassl_int.hpp" +#include "error.hpp" + +#if defined(USE_CML_LIB) + #include "cmapi_cpp.h" +#else + #include "asn.hpp" + #include "file.hpp" +#endif // USE_CML_LIB + + +namespace yaSSL { + + +x509::x509(uint sz) : length_(sz), buffer_(NEW_YS opaque[sz]) +{ +} + + +x509::~x509() +{ + ysArrayDelete(buffer_); +} + + +x509::x509(const x509& that) : length_(that.length_), + buffer_(NEW_YS opaque[length_]) +{ + memcpy(buffer_, that.buffer_, length_); +} + + +void x509::Swap(x509& that) +{ + STL::swap(length_, that.length_); + STL::swap(buffer_, that.buffer_); +} + + +x509& x509::operator=(const x509& that) +{ + x509 temp(that); + Swap(temp); + return *this; +} + + +uint x509::get_length() const +{ + return length_; +} + + +const opaque* x509::get_buffer() const +{ + return buffer_; +} + + +opaque* x509::use_buffer() +{ + return buffer_; +} + + +//CertManager +CertManager::CertManager() + : peerX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false), + sendVerify_(false), verifyCallback_(0) +{} + + +CertManager::~CertManager() +{ + ysDelete(peerX509_); + + STL::for_each(signers_.begin(), signers_.end(), del_ptr_zero()) ; + + STL::for_each(peerList_.begin(), peerList_.end(), del_ptr_zero()) ; + + STL::for_each(list_.begin(), list_.end(), del_ptr_zero()) ; +} + + +bool CertManager::verifyPeer() const +{ + return verifyPeer_; +} + + +bool CertManager::verifyNone() const +{ + return verifyNone_; +} + + +bool CertManager::failNoCert() const +{ + return failNoCert_; +} + + +bool CertManager::sendVerify() const +{ + return sendVerify_; +} + + +void CertManager::setVerifyPeer() +{ + verifyPeer_ = true; +} + + +void CertManager::setVerifyNone() +{ + verifyNone_ = true; +} + + +void CertManager::setFailNoCert() +{ + failNoCert_ = true; +} + + +void CertManager::setSendVerify() +{ + sendVerify_ = true; +} + + +void CertManager::setVerifyCallback(VerifyCallback vc) +{ + verifyCallback_ = vc; +} + + +void CertManager::AddPeerCert(x509* x) +{ + peerList_.push_back(x); // take ownership +} + + +void CertManager::CopySelfCert(const x509* x) +{ + if (x) + list_.push_back(NEW_YS x509(*x)); +} + + +// add to signers +int CertManager::CopyCaCert(const x509* x) +{ + TaoCrypt::Source source(x->get_buffer(), x->get_length()); + TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_, + TaoCrypt::CertDecoder::CA); + + if (!cert.GetError().What()) { + const TaoCrypt::PublicKey& key = cert.GetPublicKey(); + signers_.push_back(NEW_YS TaoCrypt::Signer(key.GetKey(), key.size(), + cert.GetCommonName(), cert.GetHash())); + } + // just don't add, not an error return cert.GetError().What(); + return 0; +} + + +const x509* CertManager::get_cert() const +{ + return list_.front(); +} + + +const opaque* CertManager::get_peerKey() const +{ + return peerPublicKey_.get_buffer(); +} + + +X509* CertManager::get_peerX509() const +{ + return peerX509_; +} + + +SignatureAlgorithm CertManager::get_peerKeyType() const +{ + return peerKeyType_; +} + + +SignatureAlgorithm CertManager::get_keyType() const +{ + return keyType_; +} + + +uint CertManager::get_peerKeyLength() const +{ + return peerPublicKey_.get_size(); +} + + +const opaque* CertManager::get_privateKey() const +{ + return privateKey_.get_buffer(); +} + + +uint CertManager::get_privateKeyLength() const +{ + return privateKey_.get_size(); +} + + +// Validate the peer's certificate list, from root to peer (last to first) +int CertManager::Validate() +{ + CertList::reverse_iterator last = peerList_.rbegin(); + size_t count = peerList_.size(); + + while ( count > 1 ) { + TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length()); + TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_); + + if (int err = cert.GetError().What()) + return err; + + const TaoCrypt::PublicKey& key = cert.GetPublicKey(); + signers_.push_back(NEW_YS TaoCrypt::Signer(key.GetKey(), key.size(), + cert.GetCommonName(), cert.GetHash())); + ++last; + --count; + } + + if (count) { + // peer's is at the front + TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length()); + TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_); + + int err = cert.GetError().What(); + if ( err ) + return err; + + uint sz = cert.GetPublicKey().size(); + peerPublicKey_.allocate(sz); + peerPublicKey_.assign(cert.GetPublicKey().GetKey(), sz); + + if (cert.GetKeyType() == TaoCrypt::RSAk) + peerKeyType_ = rsa_sa_algo; + else + peerKeyType_ = dsa_sa_algo; + + size_t iSz = strlen(cert.GetIssuer()) + 1; + size_t sSz = strlen(cert.GetCommonName()) + 1; + int bSz = (int)strlen(cert.GetBeforeDate()) + 1; + int aSz = (int)strlen(cert.GetAfterDate()) + 1; + peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(), + sSz, cert.GetBeforeDate(), bSz, + cert.GetAfterDate(), aSz); + + if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) { + X509_STORE_CTX store; + store.error = err; + store.error_depth = static_cast(count) - 1; + store.current_cert = peerX509_; + + int ok = verifyCallback_(0, &store); + if (ok) return 0; + } + + if (err == TaoCrypt::SIG_OTHER_E) return err; + } + return 0; +} + + +// Set the private key +int CertManager::SetPrivateKey(const x509& key) +{ + privateKey_.allocate(key.get_length()); + privateKey_.assign(key.get_buffer(), key.get_length()); + + // set key type + if (x509* cert = list_.front()) { + TaoCrypt::Source source(cert->get_buffer(), cert->get_length()); + TaoCrypt::CertDecoder cd(source, false); + cd.DecodeToKey(); + if (int err = cd.GetError().What()) + return err; + if (cd.GetKeyType() == TaoCrypt::RSAk) + keyType_ = rsa_sa_algo; + else + keyType_ = dsa_sa_algo; + } + return 0; +} + + +// Store OpenSSL type peer's cert +void CertManager::setPeerX509(X509* x) +{ + assert(peerX509_ == 0); + if (x == 0) return; + + X509_NAME* issuer = x->GetIssuer(); + X509_NAME* subject = x->GetSubject(); + ASN1_STRING* before = x->GetBefore(); + ASN1_STRING* after = x->GetAfter(); + + peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), + subject->GetName(), subject->GetLength(), (const char*) before->data, + before->length, (const char*) after->data, after->length); +} + + +#if defined(USE_CML_LIB) + +// Get the peer's certificate, extract and save public key +void CertManager::SetPeerKey() +{ + // first cert is the peer's + x509* main = peerList_.front(); + + Bytes_struct cert; + cert.num = main->get_length(); + cert.data = main->set_buffer(); + + CML::Certificate cm(cert); + const CML::ASN::Cert& raw = cm.base(); + CTIL::CSM_Buffer key = raw.pubKeyInfo.key; + + uint sz; + opaque* key_buffer = reinterpret_cast(key.Get(sz)); + peerPublicKey_.allocate(sz); + peerPublicKey_.assign(key_buffer, sz); +} + + +#endif // USE_CML_LIB + + + +} // namespace diff --git a/externals/mysql/extlib/yassl/src/crypto_wrapper.cpp b/externals/mysql/extlib/yassl/src/crypto_wrapper.cpp new file mode 100644 index 00000000000..28d7f1b5693 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/crypto_wrapper.cpp @@ -0,0 +1,1013 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* The crypto wrapper source implements the policies for the cipher + * components used by SSL. + * + * The implementation relies on a specfic library, taoCrypt. + */ + +#if !defined(USE_CRYPTOPP_LIB) + +#include "runtime.hpp" +#include "crypto_wrapper.hpp" +#include "cert_wrapper.hpp" + +#include "md5.hpp" +#include "sha.hpp" +#include "ripemd.hpp" +#include "hmac.hpp" +#include "modes.hpp" +#include "des.hpp" +#include "arc4.hpp" +#include "aes.hpp" +#include "rsa.hpp" +#include "dsa.hpp" +#include "dh.hpp" +#include "random.hpp" +#include "file.hpp" +#include "coding.hpp" + + +namespace yaSSL { + + +// MD5 Implementation +struct MD5::MD5Impl { + TaoCrypt::MD5 md5_; + MD5Impl() {} + explicit MD5Impl(const TaoCrypt::MD5& md5) : md5_(md5) {} +}; + + +MD5::MD5() : pimpl_(NEW_YS MD5Impl) {} + + +MD5::~MD5() { ysDelete(pimpl_); } + + +MD5::MD5(const MD5& that) : Digest(), pimpl_(NEW_YS + MD5Impl(that.pimpl_->md5_)) {} + + +MD5& MD5::operator=(const MD5& that) +{ + pimpl_->md5_ = that.pimpl_->md5_; + return *this; +} + + +uint MD5::get_digestSize() const +{ + return MD5_LEN; +} + + +uint MD5::get_padSize() const +{ + return PAD_MD5; +} + + +// Fill out with MD5 digest from in that is sz bytes, out must be >= digest sz +void MD5::get_digest(byte* out, const byte* in, unsigned int sz) +{ + pimpl_->md5_.Update(in, sz); + pimpl_->md5_.Final(out); +} + +// Fill out with MD5 digest from previous updates +void MD5::get_digest(byte* out) +{ + pimpl_->md5_.Final(out); +} + + +// Update the current digest +void MD5::update(const byte* in, unsigned int sz) +{ + pimpl_->md5_.Update(in, sz); +} + + +// SHA Implementation +struct SHA::SHAImpl { + TaoCrypt::SHA sha_; + SHAImpl() {} + explicit SHAImpl(const TaoCrypt::SHA& sha) : sha_(sha) {} +}; + + +SHA::SHA() : pimpl_(NEW_YS SHAImpl) {} + + +SHA::~SHA() { ysDelete(pimpl_); } + + +SHA::SHA(const SHA& that) : Digest(), pimpl_(NEW_YS SHAImpl(that.pimpl_->sha_)) {} + +SHA& SHA::operator=(const SHA& that) +{ + pimpl_->sha_ = that.pimpl_->sha_; + return *this; +} + + +uint SHA::get_digestSize() const +{ + return SHA_LEN; +} + + +uint SHA::get_padSize() const +{ + return PAD_SHA; +} + + +// Fill out with SHA digest from in that is sz bytes, out must be >= digest sz +void SHA::get_digest(byte* out, const byte* in, unsigned int sz) +{ + pimpl_->sha_.Update(in, sz); + pimpl_->sha_.Final(out); +} + + +// Fill out with SHA digest from previous updates +void SHA::get_digest(byte* out) +{ + pimpl_->sha_.Final(out); +} + + +// Update the current digest +void SHA::update(const byte* in, unsigned int sz) +{ + pimpl_->sha_.Update(in, sz); +} + + +// RMD-160 Implementation +struct RMD::RMDImpl { + TaoCrypt::RIPEMD160 rmd_; + RMDImpl() {} + explicit RMDImpl(const TaoCrypt::RIPEMD160& rmd) : rmd_(rmd) {} +}; + + +RMD::RMD() : pimpl_(NEW_YS RMDImpl) {} + + +RMD::~RMD() { ysDelete(pimpl_); } + + +RMD::RMD(const RMD& that) : Digest(), pimpl_(NEW_YS RMDImpl(that.pimpl_->rmd_)) {} + +RMD& RMD::operator=(const RMD& that) +{ + pimpl_->rmd_ = that.pimpl_->rmd_; + return *this; +} + + +uint RMD::get_digestSize() const +{ + return RMD_LEN; +} + + +uint RMD::get_padSize() const +{ + return PAD_RMD; +} + + +// Fill out with RMD digest from in that is sz bytes, out must be >= digest sz +void RMD::get_digest(byte* out, const byte* in, unsigned int sz) +{ + pimpl_->rmd_.Update(in, sz); + pimpl_->rmd_.Final(out); +} + + +// Fill out with RMD digest from previous updates +void RMD::get_digest(byte* out) +{ + pimpl_->rmd_.Final(out); +} + + +// Update the current digest +void RMD::update(const byte* in, unsigned int sz) +{ + pimpl_->rmd_.Update(in, sz); +} + + +// HMAC_MD5 Implementation +struct HMAC_MD5::HMAC_MD5Impl { + TaoCrypt::HMAC mac_; + HMAC_MD5Impl() {} +}; + + +HMAC_MD5::HMAC_MD5(const byte* secret, unsigned int len) + : pimpl_(NEW_YS HMAC_MD5Impl) +{ + pimpl_->mac_.SetKey(secret, len); +} + + +HMAC_MD5::~HMAC_MD5() { ysDelete(pimpl_); } + + +uint HMAC_MD5::get_digestSize() const +{ + return MD5_LEN; +} + + +uint HMAC_MD5::get_padSize() const +{ + return PAD_MD5; +} + + +// Fill out with MD5 digest from in that is sz bytes, out must be >= digest sz +void HMAC_MD5::get_digest(byte* out, const byte* in, unsigned int sz) +{ + pimpl_->mac_.Update(in, sz); + pimpl_->mac_.Final(out); +} + +// Fill out with MD5 digest from previous updates +void HMAC_MD5::get_digest(byte* out) +{ + pimpl_->mac_.Final(out); +} + + +// Update the current digest +void HMAC_MD5::update(const byte* in, unsigned int sz) +{ + pimpl_->mac_.Update(in, sz); +} + + +// HMAC_SHA Implementation +struct HMAC_SHA::HMAC_SHAImpl { + TaoCrypt::HMAC mac_; + HMAC_SHAImpl() {} +}; + + +HMAC_SHA::HMAC_SHA(const byte* secret, unsigned int len) + : pimpl_(NEW_YS HMAC_SHAImpl) +{ + pimpl_->mac_.SetKey(secret, len); +} + + +HMAC_SHA::~HMAC_SHA() { ysDelete(pimpl_); } + + +uint HMAC_SHA::get_digestSize() const +{ + return SHA_LEN; +} + + +uint HMAC_SHA::get_padSize() const +{ + return PAD_SHA; +} + + +// Fill out with SHA digest from in that is sz bytes, out must be >= digest sz +void HMAC_SHA::get_digest(byte* out, const byte* in, unsigned int sz) +{ + pimpl_->mac_.Update(in, sz); + pimpl_->mac_.Final(out); +} + +// Fill out with SHA digest from previous updates +void HMAC_SHA::get_digest(byte* out) +{ + pimpl_->mac_.Final(out); +} + + +// Update the current digest +void HMAC_SHA::update(const byte* in, unsigned int sz) +{ + pimpl_->mac_.Update(in, sz); +} + + + +// HMAC_RMD Implementation +struct HMAC_RMD::HMAC_RMDImpl { + TaoCrypt::HMAC mac_; + HMAC_RMDImpl() {} +}; + + +HMAC_RMD::HMAC_RMD(const byte* secret, unsigned int len) + : pimpl_(NEW_YS HMAC_RMDImpl) +{ + pimpl_->mac_.SetKey(secret, len); +} + + +HMAC_RMD::~HMAC_RMD() { ysDelete(pimpl_); } + + +uint HMAC_RMD::get_digestSize() const +{ + return RMD_LEN; +} + + +uint HMAC_RMD::get_padSize() const +{ + return PAD_RMD; +} + + +// Fill out with RMD digest from in that is sz bytes, out must be >= digest sz +void HMAC_RMD::get_digest(byte* out, const byte* in, unsigned int sz) +{ + pimpl_->mac_.Update(in, sz); + pimpl_->mac_.Final(out); +} + +// Fill out with RMD digest from previous updates +void HMAC_RMD::get_digest(byte* out) +{ + pimpl_->mac_.Final(out); +} + + +// Update the current digest +void HMAC_RMD::update(const byte* in, unsigned int sz) +{ + pimpl_->mac_.Update(in, sz); +} + + +struct DES::DESImpl { + TaoCrypt::DES_CBC_Encryption encryption; + TaoCrypt::DES_CBC_Decryption decryption; +}; + + +DES::DES() : pimpl_(NEW_YS DESImpl) {} + +DES::~DES() { ysDelete(pimpl_); } + + +void DES::set_encryptKey(const byte* k, const byte* iv) +{ + pimpl_->encryption.SetKey(k, DES_KEY_SZ, iv); +} + + +void DES::set_decryptKey(const byte* k, const byte* iv) +{ + pimpl_->decryption.SetKey(k, DES_KEY_SZ, iv); +} + +// DES encrypt plain of length sz into cipher +void DES::encrypt(byte* cipher, const byte* plain, unsigned int sz) +{ + pimpl_->encryption.Process(cipher, plain, sz); +} + + +// DES decrypt cipher of length sz into plain +void DES::decrypt(byte* plain, const byte* cipher, unsigned int sz) +{ + pimpl_->decryption.Process(plain, cipher, sz); +} + + +struct DES_EDE::DES_EDEImpl { + TaoCrypt::DES_EDE3_CBC_Encryption encryption; + TaoCrypt::DES_EDE3_CBC_Decryption decryption; +}; + + +DES_EDE::DES_EDE() : pimpl_(NEW_YS DES_EDEImpl) {} + +DES_EDE::~DES_EDE() { ysDelete(pimpl_); } + + +void DES_EDE::set_encryptKey(const byte* k, const byte* iv) +{ + pimpl_->encryption.SetKey(k, DES_EDE_KEY_SZ, iv); +} + + +void DES_EDE::set_decryptKey(const byte* k, const byte* iv) +{ + pimpl_->decryption.SetKey(k, DES_EDE_KEY_SZ, iv); +} + + +// 3DES encrypt plain of length sz into cipher +void DES_EDE::encrypt(byte* cipher, const byte* plain, unsigned int sz) +{ + pimpl_->encryption.Process(cipher, plain, sz); +} + + +// 3DES decrypt cipher of length sz into plain +void DES_EDE::decrypt(byte* plain, const byte* cipher, unsigned int sz) +{ + pimpl_->decryption.Process(plain, cipher, sz); +} + + +// Implementation of alledged RC4 +struct RC4::RC4Impl { + TaoCrypt::ARC4::Encryption encryption; + TaoCrypt::ARC4::Decryption decryption; +}; + + +RC4::RC4() : pimpl_(NEW_YS RC4Impl) {} + +RC4::~RC4() { ysDelete(pimpl_); } + + +void RC4::set_encryptKey(const byte* k, const byte*) +{ + pimpl_->encryption.SetKey(k, RC4_KEY_SZ); +} + + +void RC4::set_decryptKey(const byte* k, const byte*) +{ + pimpl_->decryption.SetKey(k, RC4_KEY_SZ); +} + + +// RC4 encrypt plain of length sz into cipher +void RC4::encrypt(byte* cipher, const byte* plain, unsigned int sz) +{ + pimpl_->encryption.Process(cipher, plain, sz); +} + + +// RC4 decrypt cipher of length sz into plain +void RC4::decrypt(byte* plain, const byte* cipher, unsigned int sz) +{ + pimpl_->decryption.Process(plain, cipher, sz); +} + + + +// Implementation of AES +struct AES::AESImpl { + TaoCrypt::AES_CBC_Encryption encryption; + TaoCrypt::AES_CBC_Decryption decryption; + unsigned int keySz_; + + AESImpl(unsigned int ks) : keySz_(ks) {} +}; + + +AES::AES(unsigned int ks) : pimpl_(NEW_YS AESImpl(ks)) {} + +AES::~AES() { ysDelete(pimpl_); } + + +int AES::get_keySize() const +{ + return pimpl_->keySz_; +} + + +void AES::set_encryptKey(const byte* k, const byte* iv) +{ + pimpl_->encryption.SetKey(k, pimpl_->keySz_, iv); +} + + +void AES::set_decryptKey(const byte* k, const byte* iv) +{ + pimpl_->decryption.SetKey(k, pimpl_->keySz_, iv); +} + + +// AES encrypt plain of length sz into cipher +void AES::encrypt(byte* cipher, const byte* plain, unsigned int sz) +{ + pimpl_->encryption.Process(cipher, plain, sz); +} + + +// AES decrypt cipher of length sz into plain +void AES::decrypt(byte* plain, const byte* cipher, unsigned int sz) +{ + pimpl_->decryption.Process(plain, cipher, sz); +} + + +struct RandomPool::RandomImpl { + TaoCrypt::RandomNumberGenerator RNG_; +}; + +RandomPool::RandomPool() : pimpl_(NEW_YS RandomImpl) {} + +RandomPool::~RandomPool() { ysDelete(pimpl_); } + +int RandomPool::GetError() const +{ + return pimpl_->RNG_.GetError(); +} + +void RandomPool::Fill(opaque* dst, uint sz) const +{ + pimpl_->RNG_.GenerateBlock(dst, sz); +} + + +// Implementation of DSS Authentication +struct DSS::DSSImpl { + void SetPublic (const byte*, unsigned int); + void SetPrivate(const byte*, unsigned int); + TaoCrypt::DSA_PublicKey publicKey_; + TaoCrypt::DSA_PrivateKey privateKey_; +}; + + +// Decode and store the public key +void DSS::DSSImpl::SetPublic(const byte* key, unsigned int sz) +{ + TaoCrypt::Source source(key, sz); + publicKey_.Initialize(source); +} + + +// Decode and store the public key +void DSS::DSSImpl::SetPrivate(const byte* key, unsigned int sz) +{ + TaoCrypt::Source source(key, sz); + privateKey_.Initialize(source); + publicKey_ = TaoCrypt::DSA_PublicKey(privateKey_); + +} + + +// Set public or private key +DSS::DSS(const byte* key, unsigned int sz, bool publicKey) + : pimpl_(NEW_YS DSSImpl) +{ + if (publicKey) + pimpl_->SetPublic(key, sz); + else + pimpl_->SetPrivate(key, sz); +} + + +DSS::~DSS() +{ + ysDelete(pimpl_); +} + + +uint DSS::get_signatureLength() const +{ + return pimpl_->publicKey_.SignatureLength(); +} + + +// DSS Sign message of length sz into sig +void DSS::sign(byte* sig, const byte* sha_digest, unsigned int /* shaSz */, + const RandomPool& random) +{ + using namespace TaoCrypt; + + DSA_Signer signer(pimpl_->privateKey_); + signer.Sign(sha_digest, sig, random.pimpl_->RNG_); +} + + +// DSS Verify message of length sz against sig, is it correct? +bool DSS::verify(const byte* sha_digest, unsigned int /* shaSz */, + const byte* sig, unsigned int /* sigSz */) +{ + using namespace TaoCrypt; + + DSA_Verifier ver(pimpl_->publicKey_); + return ver.Verify(sha_digest, sig); +} + + +// Implementation of RSA key interface +struct RSA::RSAImpl { + void SetPublic (const byte*, unsigned int); + void SetPrivate(const byte*, unsigned int); + TaoCrypt::RSA_PublicKey publicKey_; + TaoCrypt::RSA_PrivateKey privateKey_; +}; + + +// Decode and store the public key +void RSA::RSAImpl::SetPublic(const byte* key, unsigned int sz) +{ + TaoCrypt::Source source(key, sz); + publicKey_.Initialize(source); +} + + +// Decode and store the private key +void RSA::RSAImpl::SetPrivate(const byte* key, unsigned int sz) +{ + TaoCrypt::Source source(key, sz); + privateKey_.Initialize(source); + publicKey_ = TaoCrypt::RSA_PublicKey(privateKey_); +} + + +// Set public or private key +RSA::RSA(const byte* key, unsigned int sz, bool publicKey) + : pimpl_(NEW_YS RSAImpl) +{ + if (publicKey) + pimpl_->SetPublic(key, sz); + else + pimpl_->SetPrivate(key, sz); +} + +RSA::~RSA() +{ + ysDelete(pimpl_); +} + + +// get cipher text length, varies on key size +unsigned int RSA::get_cipherLength() const +{ + return pimpl_->publicKey_.FixedCiphertextLength(); +} + + +// get signautre length, varies on key size +unsigned int RSA::get_signatureLength() const +{ + return get_cipherLength(); +} + + +// RSA Sign message of length sz into sig +void RSA::sign(byte* sig, const byte* message, unsigned int sz, + const RandomPool& random) +{ + TaoCrypt::RSAES_Decryptor dec(pimpl_->privateKey_); + dec.SSL_Sign(message, sz, sig, random.pimpl_->RNG_); +} + + +// RSA Verify message of length sz against sig +bool RSA::verify(const byte* message, unsigned int sz, const byte* sig, + unsigned int) +{ + TaoCrypt::RSAES_Encryptor enc(pimpl_->publicKey_); + return enc.SSL_Verify(message, sz, sig); +} + + +// RSA public encrypt plain of length sz into cipher +void RSA::encrypt(byte* cipher, const byte* plain, unsigned int sz, + const RandomPool& random) +{ + + TaoCrypt::RSAES_Encryptor enc(pimpl_->publicKey_); + enc.Encrypt(plain, sz, cipher, random.pimpl_->RNG_); +} + + +// RSA private decrypt cipher of length sz into plain +void RSA::decrypt(byte* plain, const byte* cipher, unsigned int sz, + const RandomPool& random) +{ + TaoCrypt::RSAES_Decryptor dec(pimpl_->privateKey_); + dec.Decrypt(cipher, sz, plain, random.pimpl_->RNG_); +} + + +struct Integer::IntegerImpl { + TaoCrypt::Integer int_; + + IntegerImpl() {} + explicit IntegerImpl(const TaoCrypt::Integer& i) : int_(i) {} +}; + +Integer::Integer() : pimpl_(NEW_YS IntegerImpl) {} + +Integer::~Integer() { ysDelete(pimpl_); } + + + +Integer::Integer(const Integer& other) : pimpl_(NEW_YS + IntegerImpl(other.pimpl_->int_)) +{} + + +Integer& Integer::operator=(const Integer& that) +{ + pimpl_->int_ = that.pimpl_->int_; + + return *this; +} + + +void Integer::assign(const byte* num, unsigned int sz) +{ + pimpl_->int_ = TaoCrypt::Integer(num, sz); +} + + +struct DiffieHellman::DHImpl { + TaoCrypt::DH dh_; + TaoCrypt::RandomNumberGenerator& ranPool_; + byte* publicKey_; + byte* privateKey_; + byte* agreedKey_; + + DHImpl(TaoCrypt::RandomNumberGenerator& r) : ranPool_(r), publicKey_(0), + privateKey_(0), agreedKey_(0) {} + ~DHImpl() + { + ysArrayDelete(agreedKey_); + ysArrayDelete(privateKey_); + ysArrayDelete(publicKey_); + } + + DHImpl(const DHImpl& that) : dh_(that.dh_), ranPool_(that.ranPool_), + publicKey_(0), privateKey_(0), agreedKey_(0) + { + uint length = dh_.GetByteLength(); + AllocKeys(length, length, length); + } + + void AllocKeys(unsigned int pubSz, unsigned int privSz, unsigned int agrSz) + { + publicKey_ = NEW_YS byte[pubSz]; + privateKey_ = NEW_YS byte[privSz]; + agreedKey_ = NEW_YS byte[agrSz]; + } +}; + + + +/* +// server Side DH, server's view +DiffieHellman::DiffieHellman(const char* file, const RandomPool& random) + : pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) +{ + using namespace TaoCrypt; + Source source; + FileSource(file, source); + if (source.size() == 0) + return; // TODO add error state, and force check + HexDecoder hd(source); + + pimpl_->dh_.Initialize(source); + + uint length = pimpl_->dh_.GetByteLength(); + + pimpl_->AllocKeys(length, length, length); + pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, + pimpl_->publicKey_); +} +*/ + + +// server Side DH, client's view +DiffieHellman::DiffieHellman(const byte* p, unsigned int pSz, const byte* g, + unsigned int gSz, const byte* pub, + unsigned int pubSz, const RandomPool& random) + : pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) +{ + using TaoCrypt::Integer; + + pimpl_->dh_.Initialize(Integer(p, pSz).Ref(), Integer(g, gSz).Ref()); + pimpl_->publicKey_ = NEW_YS opaque[pubSz]; + memcpy(pimpl_->publicKey_, pub, pubSz); +} + + +// Server Side DH, server's view +DiffieHellman::DiffieHellman(const Integer& p, const Integer& g, + const RandomPool& random) +: pimpl_(NEW_YS DHImpl(random.pimpl_->RNG_)) +{ + using TaoCrypt::Integer; + + pimpl_->dh_.Initialize(p.pimpl_->int_, g.pimpl_->int_); + + uint length = pimpl_->dh_.GetByteLength(); + + pimpl_->AllocKeys(length, length, length); + pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, + pimpl_->publicKey_); +} + +DiffieHellman::~DiffieHellman() { ysDelete(pimpl_); } + + +// Client side and view, use server that for p and g +DiffieHellman::DiffieHellman(const DiffieHellman& that) + : pimpl_(NEW_YS DHImpl(*that.pimpl_)) +{ + pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, + pimpl_->publicKey_); +} + + +DiffieHellman& DiffieHellman::operator=(const DiffieHellman& that) +{ + pimpl_->dh_ = that.pimpl_->dh_; + pimpl_->dh_.GenerateKeyPair(pimpl_->ranPool_, pimpl_->privateKey_, + pimpl_->publicKey_); + return *this; +} + + +void DiffieHellman::makeAgreement(const byte* other, unsigned int otherSz) +{ + pimpl_->dh_.Agree(pimpl_->agreedKey_, pimpl_->privateKey_, other, otherSz); +} + + +uint DiffieHellman::get_agreedKeyLength() const +{ + return pimpl_->dh_.GetByteLength(); +} + + +const byte* DiffieHellman::get_agreedKey() const +{ + return pimpl_->agreedKey_; +} + + +const byte* DiffieHellman::get_publicKey() const +{ + return pimpl_->publicKey_; +} + + +void DiffieHellman::set_sizes(int& pSz, int& gSz, int& pubSz) const +{ + using TaoCrypt::Integer; + Integer p = pimpl_->dh_.GetP(); + Integer g = pimpl_->dh_.GetG(); + + pSz = p.ByteCount(); + gSz = g.ByteCount(); + pubSz = pimpl_->dh_.GetByteLength(); +} + + +void DiffieHellman::get_parms(byte* bp, byte* bg, byte* bpub) const +{ + using TaoCrypt::Integer; + Integer p = pimpl_->dh_.GetP(); + Integer g = pimpl_->dh_.GetG(); + + p.Encode(bp, p.ByteCount()); + g.Encode(bg, g.ByteCount()); + memcpy(bpub, pimpl_->publicKey_, pimpl_->dh_.GetByteLength()); +} + + +// convert PEM file to DER x509 type +x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info) +{ + using namespace TaoCrypt; + + char header[80]; + char footer[80]; + + if (type == Cert) { + strncpy(header, "-----BEGIN CERTIFICATE-----", sizeof(header)); + strncpy(footer, "-----END CERTIFICATE-----", sizeof(footer)); + } else { + strncpy(header, "-----BEGIN RSA PRIVATE KEY-----", sizeof(header)); + strncpy(footer, "-----END RSA PRIVATE KEY-----", sizeof(header)); + } + + long begin = -1; + long end = 0; + bool foundEnd = false; + + char line[80]; + + while(fgets(line, sizeof(line), file)) + if (strncmp(header, line, strlen(header)) == 0) { + begin = ftell(file); + break; + } + + // remove encrypted header if there + if (fgets(line, sizeof(line), file)) { + char encHeader[] = "Proc-Type"; + if (strncmp(encHeader, line, strlen(encHeader)) == 0 && + fgets(line,sizeof(line), file)) { + + char* start = strstr(line, "DES"); + char* finish = strstr(line, ","); + if (!start) + start = strstr(line, "AES"); + + if (!info) return 0; + + if ( start && finish && (start < finish)) { + memcpy(info->name, start, finish - start); + info->name[finish - start] = 0; + memcpy(info->iv, finish + 1, sizeof(info->iv)); + + char* newline = strstr(line, "\r"); + if (!newline) newline = strstr(line, "\n"); + if (newline && (newline > finish)) { + info->ivSz = newline - (finish + 1); + info->set = true; + } + } + fgets(line,sizeof(line), file); // get blank line + begin = ftell(file); + } + + } + + while(fgets(line, sizeof(line), file)) + if (strncmp(footer, line, strlen(footer)) == 0) { + foundEnd = true; + break; + } + else + end = ftell(file); + + if (begin == -1 || !foundEnd) + return 0; + + input_buffer tmp(end - begin); + fseek(file, begin, SEEK_SET); + size_t bytes = fread(tmp.get_buffer(), end - begin, 1, file); + if (bytes != 1) + return 0; + + Source der(tmp.get_buffer(), end - begin); + Base64Decoder b64Dec(der); + + uint sz = der.size(); + mySTL::auto_ptr x(NEW_YS x509(sz)); + memcpy(x->use_buffer(), der.get_buffer(), sz); + + return x.release(); +} + + +} // namespace + + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION +namespace yaSSL { +template void ysDelete(DiffieHellman::DHImpl*); +template void ysDelete(Integer::IntegerImpl*); +template void ysDelete(RSA::RSAImpl*); +template void ysDelete(DSS::DSSImpl*); +template void ysDelete(RandomPool::RandomImpl*); +template void ysDelete(AES::AESImpl*); +template void ysDelete(RC4::RC4Impl*); +template void ysDelete(DES_EDE::DES_EDEImpl*); +template void ysDelete(DES::DESImpl*); +template void ysDelete(HMAC_RMD::HMAC_RMDImpl*); +template void ysDelete(HMAC_SHA::HMAC_SHAImpl*); +template void ysDelete(HMAC_MD5::HMAC_MD5Impl*); +template void ysDelete(RMD::RMDImpl*); +template void ysDelete(SHA::SHAImpl*); +template void ysDelete(MD5::MD5Impl*); +} +#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION + +#endif // !USE_CRYPTOPP_LIB diff --git a/externals/mysql/extlib/yassl/src/dummy.cpp b/externals/mysql/extlib/yassl/src/dummy.cpp new file mode 100644 index 00000000000..19b7fe887cd --- /dev/null +++ b/externals/mysql/extlib/yassl/src/dummy.cpp @@ -0,0 +1,4 @@ +/* + To make libtool always use a C++ linker when compiling with yaSSL we need + to add a dummy C++ file to the source list. +*/ diff --git a/externals/mysql/extlib/yassl/src/handshake.cpp b/externals/mysql/extlib/yassl/src/handshake.cpp new file mode 100644 index 00000000000..262b5cb3b8b --- /dev/null +++ b/externals/mysql/extlib/yassl/src/handshake.cpp @@ -0,0 +1,1117 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* The handshake source implements functions for creating and reading + * the various handshake messages. + */ + + + +#include "runtime.hpp" +#include "handshake.hpp" +#include "yassl_int.hpp" + + +namespace yaSSL { + + + +// Build a client hello message from cipher suites and compression method +void buildClientHello(SSL& ssl, ClientHello& hello) +{ + // store for pre master secret + ssl.useSecurity().use_connection().chVersion_ = hello.client_version_; + + ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN); + if (ssl.getSecurity().get_resuming()) { + hello.id_len_ = ID_LEN; + memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(), + ID_LEN); + } + else + hello.id_len_ = 0; + hello.suite_len_ = ssl.getSecurity().get_parms().suites_size_; + memcpy(hello.cipher_suites_, ssl.getSecurity().get_parms().suites_, + hello.suite_len_); + hello.comp_len_ = 1; + + hello.set_length(sizeof(ProtocolVersion) + + RAN_LEN + + hello.id_len_ + sizeof(hello.id_len_) + + hello.suite_len_ + sizeof(hello.suite_len_) + + hello.comp_len_ + sizeof(hello.comp_len_)); +} + + +// Build a server hello message +void buildServerHello(SSL& ssl, ServerHello& hello) +{ + if (ssl.getSecurity().get_resuming()) { + memcpy(hello.random_,ssl.getSecurity().get_connection().server_random_, + RAN_LEN); + memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(), + ID_LEN); + } + else { + ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN); + ssl.getCrypto().get_random().Fill(hello.session_id_, ID_LEN); + } + hello.id_len_ = ID_LEN; + ssl.set_sessionID(hello.session_id_); + + hello.cipher_suite_[0] = ssl.getSecurity().get_parms().suite_[0]; + hello.cipher_suite_[1] = ssl.getSecurity().get_parms().suite_[1]; + hello.compression_method_ = hello.compression_method_; + + hello.set_length(sizeof(ProtocolVersion) + RAN_LEN + ID_LEN + + sizeof(hello.id_len_) + SUITE_LEN + SIZEOF_ENUM); +} + + +// add handshake from buffer into md5 and sha hashes, use handshake header +void hashHandShake(SSL& ssl, const input_buffer& input, uint sz) +{ + const opaque* buffer = input.get_buffer() + input.get_current() - + HANDSHAKE_HEADER; + sz += HANDSHAKE_HEADER; + ssl.useHashes().use_MD5().update(buffer, sz); + ssl.useHashes().use_SHA().update(buffer, sz); +} + + +// locals +namespace { + +// Write a plaintext record to buffer +void buildOutput(output_buffer& buffer, const RecordLayerHeader& rlHdr, + const Message& msg) +{ + buffer.allocate(RECORD_HEADER + rlHdr.length_); + buffer << rlHdr << msg; +} + + +// Write a plaintext record to buffer +void buildOutput(output_buffer& buffer, const RecordLayerHeader& rlHdr, + const HandShakeHeader& hsHdr, const HandShakeBase& shake) +{ + buffer.allocate(RECORD_HEADER + rlHdr.length_); + buffer << rlHdr << hsHdr << shake; +} + + +// Build Record Layer header for Message without handshake header +void buildHeader(SSL& ssl, RecordLayerHeader& rlHeader, const Message& msg) +{ + ProtocolVersion pv = ssl.getSecurity().get_connection().version_; + rlHeader.type_ = msg.get_type(); + rlHeader.version_.major_ = pv.major_; + rlHeader.version_.minor_ = pv.minor_; + rlHeader.length_ = msg.get_length(); +} + + +// Build HandShake and RecordLayer Headers for handshake output +void buildHeaders(SSL& ssl, HandShakeHeader& hsHeader, + RecordLayerHeader& rlHeader, const HandShakeBase& shake) +{ + int sz = shake.get_length(); + + hsHeader.set_type(shake.get_type()); + hsHeader.set_length(sz); + + ProtocolVersion pv = ssl.getSecurity().get_connection().version_; + rlHeader.type_ = handshake; + rlHeader.version_.major_ = pv.major_; + rlHeader.version_.minor_ = pv.minor_; + rlHeader.length_ = sz + HANDSHAKE_HEADER; +} + + +// add handshake from buffer into md5 and sha hashes, exclude record header +void hashHandShake(SSL& ssl, const output_buffer& output, bool removeIV = false) +{ + uint sz = output.get_size() - RECORD_HEADER; + + const opaque* buffer = output.get_buffer() + RECORD_HEADER; + + if (removeIV) { // TLSv1_1 IV + uint blockSz = ssl.getCrypto().get_cipher().get_blockSize(); + sz -= blockSz; + buffer += blockSz; + } + + ssl.useHashes().use_MD5().update(buffer, sz); + ssl.useHashes().use_SHA().update(buffer, sz); +} + + +// calculate MD5 hash for finished +void buildMD5(SSL& ssl, Finished& fin, const opaque* sender) +{ + + opaque md5_result[MD5_LEN]; + opaque md5_inner[SIZEOF_SENDER + SECRET_LEN + PAD_MD5]; + opaque md5_outer[SECRET_LEN + PAD_MD5 + MD5_LEN]; + + const opaque* master_secret = + ssl.getSecurity().get_connection().master_secret_; + + // make md5 inner + memcpy(md5_inner, sender, SIZEOF_SENDER); + memcpy(&md5_inner[SIZEOF_SENDER], master_secret, SECRET_LEN); + memcpy(&md5_inner[SIZEOF_SENDER + SECRET_LEN], PAD1, PAD_MD5); + + ssl.useHashes().use_MD5().get_digest(md5_result, md5_inner, + sizeof(md5_inner)); + + // make md5 outer + memcpy(md5_outer, master_secret, SECRET_LEN); + memcpy(&md5_outer[SECRET_LEN], PAD2, PAD_MD5); + memcpy(&md5_outer[SECRET_LEN + PAD_MD5], md5_result, MD5_LEN); + + ssl.useHashes().use_MD5().get_digest(fin.set_md5(), md5_outer, + sizeof(md5_outer)); +} + + +// calculate SHA hash for finished +void buildSHA(SSL& ssl, Finished& fin, const opaque* sender) +{ + + opaque sha_result[SHA_LEN]; + opaque sha_inner[SIZEOF_SENDER + SECRET_LEN + PAD_SHA]; + opaque sha_outer[SECRET_LEN + PAD_SHA + SHA_LEN]; + + const opaque* master_secret = + ssl.getSecurity().get_connection().master_secret_; + + // make sha inner + memcpy(sha_inner, sender, SIZEOF_SENDER); + memcpy(&sha_inner[SIZEOF_SENDER], master_secret, SECRET_LEN); + memcpy(&sha_inner[SIZEOF_SENDER + SECRET_LEN], PAD1, PAD_SHA); + + ssl.useHashes().use_SHA().get_digest(sha_result, sha_inner, + sizeof(sha_inner)); + + // make sha outer + memcpy(sha_outer, master_secret, SECRET_LEN); + memcpy(&sha_outer[SECRET_LEN], PAD2, PAD_SHA); + memcpy(&sha_outer[SECRET_LEN + PAD_SHA], sha_result, SHA_LEN); + + ssl.useHashes().use_SHA().get_digest(fin.set_sha(), sha_outer, + sizeof(sha_outer)); +} + + +// decrypt input message in place, store size in case needed later +void decrypt_message(SSL& ssl, input_buffer& input, uint sz) +{ + input_buffer plain(sz); + opaque* cipher = input.get_buffer() + input.get_current(); + + ssl.useCrypto().use_cipher().decrypt(plain.get_buffer(), cipher, sz); + memcpy(cipher, plain.get_buffer(), sz); + ssl.useSecurity().use_parms().encrypt_size_ = sz; + + if (ssl.isTLSv1_1()) // IV + input.set_current(input.get_current() + + ssl.getCrypto().get_cipher().get_blockSize()); +} + + +// output operator for input_buffer +output_buffer& operator<<(output_buffer& output, const input_buffer& input) +{ + output.write(input.get_buffer(), input.get_size()); + return output; +} + + +// write headers, handshake hash, mac, pad, and encrypt +void cipherFinished(SSL& ssl, Finished& fin, output_buffer& output) +{ + uint digestSz = ssl.getCrypto().get_digest().get_digestSize(); + uint finishedSz = ssl.isTLS() ? TLS_FINISHED_SZ : FINISHED_SZ; + uint sz = RECORD_HEADER + HANDSHAKE_HEADER + finishedSz + digestSz; + uint pad = 0; + uint blockSz = ssl.getCrypto().get_cipher().get_blockSize(); + + if (ssl.getSecurity().get_parms().cipher_type_ == block) { + if (ssl.isTLSv1_1()) + sz += blockSz; // IV + sz += 1; // pad byte + pad = (sz - RECORD_HEADER) % blockSz; + pad = blockSz - pad; + sz += pad; + } + + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + buildHeaders(ssl, hsHeader, rlHeader, fin); + rlHeader.length_ = sz - RECORD_HEADER; // record header includes mac + // and pad, hanshake doesn't + input_buffer iv; + if (ssl.isTLSv1_1() && ssl.getSecurity().get_parms().cipher_type_== block){ + iv.allocate(blockSz); + ssl.getCrypto().get_random().Fill(iv.get_buffer(), blockSz); + iv.add_size(blockSz); + } + uint ivSz = iv.get_size(); + output.allocate(sz); + output << rlHeader << iv << hsHeader << fin; + + hashHandShake(ssl, output, ssl.isTLSv1_1() ? true : false); + opaque digest[SHA_LEN]; // max size + if (ssl.isTLS()) + TLS_hmac(ssl, digest, output.get_buffer() + RECORD_HEADER + ivSz, + output.get_size() - RECORD_HEADER - ivSz, handshake); + else + hmac(ssl, digest, output.get_buffer() + RECORD_HEADER, + output.get_size() - RECORD_HEADER, handshake); + output.write(digest, digestSz); + + if (ssl.getSecurity().get_parms().cipher_type_ == block) + for (uint i = 0; i <= pad; i++) output[AUTO] = pad; // pad byte gets + // pad value too + input_buffer cipher(rlHeader.length_); + ssl.useCrypto().use_cipher().encrypt(cipher.get_buffer(), + output.get_buffer() + RECORD_HEADER, output.get_size() - RECORD_HEADER); + output.set_current(RECORD_HEADER); + output.write(cipher.get_buffer(), cipher.get_capacity()); +} + + +// build an encrypted data or alert message for output +void buildMessage(SSL& ssl, output_buffer& output, const Message& msg) +{ + uint digestSz = ssl.getCrypto().get_digest().get_digestSize(); + uint sz = RECORD_HEADER + msg.get_length() + digestSz; + uint pad = 0; + uint blockSz = ssl.getCrypto().get_cipher().get_blockSize(); + + if (ssl.getSecurity().get_parms().cipher_type_ == block) { + if (ssl.isTLSv1_1()) // IV + sz += blockSz; + sz += 1; // pad byte + pad = (sz - RECORD_HEADER) % blockSz; + pad = blockSz - pad; + sz += pad; + } + + RecordLayerHeader rlHeader; + buildHeader(ssl, rlHeader, msg); + rlHeader.length_ = sz - RECORD_HEADER; // record header includes mac + // and pad, hanshake doesn't + input_buffer iv; + if (ssl.isTLSv1_1() && ssl.getSecurity().get_parms().cipher_type_== block){ + iv.allocate(blockSz); + ssl.getCrypto().get_random().Fill(iv.get_buffer(), blockSz); + iv.add_size(blockSz); + } + + uint ivSz = iv.get_size(); + output.allocate(sz); + output << rlHeader << iv << msg; + + opaque digest[SHA_LEN]; // max size + if (ssl.isTLS()) + TLS_hmac(ssl, digest, output.get_buffer() + RECORD_HEADER + ivSz, + output.get_size() - RECORD_HEADER - ivSz, msg.get_type()); + else + hmac(ssl, digest, output.get_buffer() + RECORD_HEADER, + output.get_size() - RECORD_HEADER, msg.get_type()); + output.write(digest, digestSz); + + if (ssl.getSecurity().get_parms().cipher_type_ == block) + for (uint i = 0; i <= pad; i++) output[AUTO] = pad; // pad byte gets + // pad value too + input_buffer cipher(rlHeader.length_); + ssl.useCrypto().use_cipher().encrypt(cipher.get_buffer(), + output.get_buffer() + RECORD_HEADER, output.get_size() - RECORD_HEADER); + output.set_current(RECORD_HEADER); + output.write(cipher.get_buffer(), cipher.get_capacity()); +} + + +// build alert message +void buildAlert(SSL& ssl, output_buffer& output, const Alert& alert) +{ + if (ssl.getSecurity().get_parms().pending_ == false) // encrypted + buildMessage(ssl, output, alert); + else { + RecordLayerHeader rlHeader; + buildHeader(ssl, rlHeader, alert); + buildOutput(output, rlHeader, alert); + } +} + + +// build TLS finished message +void buildFinishedTLS(SSL& ssl, Finished& fin, const opaque* sender) +{ + opaque handshake_hash[FINISHED_SZ]; + + ssl.useHashes().use_MD5().get_digest(handshake_hash); + ssl.useHashes().use_SHA().get_digest(&handshake_hash[MD5_LEN]); + + const opaque* side; + if ( strncmp((const char*)sender, (const char*)client, SIZEOF_SENDER) == 0) + side = tls_client; + else + side = tls_server; + + PRF(fin.set_md5(), TLS_FINISHED_SZ, + ssl.getSecurity().get_connection().master_secret_, SECRET_LEN, + side, FINISHED_LABEL_SZ, + handshake_hash, FINISHED_SZ); + + fin.set_length(TLS_FINISHED_SZ); // shorter length for TLS +} + + +// compute p_hash for MD5 or SHA-1 for TLSv1 PRF +void p_hash(output_buffer& result, const output_buffer& secret, + const output_buffer& seed, MACAlgorithm hash) +{ + uint len = hash == md5 ? MD5_LEN : SHA_LEN; + uint times = result.get_capacity() / len; + uint lastLen = result.get_capacity() % len; + opaque previous[SHA_LEN]; // max size + opaque current[SHA_LEN]; // max size + mySTL::auto_ptr hmac; + + if (lastLen) times += 1; + + if (hash == md5) + hmac.reset(NEW_YS HMAC_MD5(secret.get_buffer(), secret.get_size())); + else + hmac.reset(NEW_YS HMAC_SHA(secret.get_buffer(), secret.get_size())); + // A0 = seed + hmac->get_digest(previous, seed.get_buffer(), seed.get_size());// A1 + uint lastTime = times - 1; + + for (uint i = 0; i < times; i++) { + hmac->update(previous, len); + hmac->get_digest(current, seed.get_buffer(), seed.get_size()); + + if (lastLen && (i == lastTime)) + result.write(current, lastLen); + else { + result.write(current, len); + //memcpy(previous, current, len); + hmac->get_digest(previous, previous, len); + } + } +} + + +// calculate XOR for TLSv1 PRF +void get_xor(byte *digest, uint digLen, output_buffer& md5, + output_buffer& sha) +{ + for (uint i = 0; i < digLen; i++) + digest[i] = md5[AUTO] ^ sha[AUTO]; +} + + +// build MD5 part of certificate verify +void buildMD5_CertVerify(SSL& ssl, byte* digest) +{ + opaque md5_result[MD5_LEN]; + opaque md5_inner[SECRET_LEN + PAD_MD5]; + opaque md5_outer[SECRET_LEN + PAD_MD5 + MD5_LEN]; + + const opaque* master_secret = + ssl.getSecurity().get_connection().master_secret_; + + // make md5 inner + memcpy(md5_inner, master_secret, SECRET_LEN); + memcpy(&md5_inner[SECRET_LEN], PAD1, PAD_MD5); + + ssl.useHashes().use_MD5().get_digest(md5_result, md5_inner, + sizeof(md5_inner)); + + // make md5 outer + memcpy(md5_outer, master_secret, SECRET_LEN); + memcpy(&md5_outer[SECRET_LEN], PAD2, PAD_MD5); + memcpy(&md5_outer[SECRET_LEN + PAD_MD5], md5_result, MD5_LEN); + + ssl.useHashes().use_MD5().get_digest(digest, md5_outer, sizeof(md5_outer)); +} + + +// build SHA part of certificate verify +void buildSHA_CertVerify(SSL& ssl, byte* digest) +{ + opaque sha_result[SHA_LEN]; + opaque sha_inner[SECRET_LEN + PAD_SHA]; + opaque sha_outer[SECRET_LEN + PAD_SHA + SHA_LEN]; + + const opaque* master_secret = + ssl.getSecurity().get_connection().master_secret_; + + // make sha inner + memcpy(sha_inner, master_secret, SECRET_LEN); + memcpy(&sha_inner[SECRET_LEN], PAD1, PAD_SHA); + + ssl.useHashes().use_SHA().get_digest(sha_result, sha_inner, + sizeof(sha_inner)); + + // make sha outer + memcpy(sha_outer, master_secret, SECRET_LEN); + memcpy(&sha_outer[SECRET_LEN], PAD2, PAD_SHA); + memcpy(&sha_outer[SECRET_LEN + PAD_SHA], sha_result, SHA_LEN); + + ssl.useHashes().use_SHA().get_digest(digest, sha_outer, sizeof(sha_outer)); +} + + +} // namespace for locals + + +// some clients still send sslv2 client hello +void ProcessOldClientHello(input_buffer& input, SSL& ssl) +{ + if (input.get_remaining() < 2) { + ssl.SetError(bad_input); + return; + } + byte b0 = input[AUTO]; + byte b1 = input[AUTO]; + + uint16 sz = ((b0 & 0x7f) << 8) | b1; + + if (sz > input.get_remaining()) { + ssl.SetError(bad_input); + return; + } + + // hashHandShake manually + const opaque* buffer = input.get_buffer() + input.get_current(); + ssl.useHashes().use_MD5().update(buffer, sz); + ssl.useHashes().use_SHA().update(buffer, sz); + + b1 = input[AUTO]; // does this value mean client_hello? + + ClientHello ch; + ch.client_version_.major_ = input[AUTO]; + ch.client_version_.minor_ = input[AUTO]; + + byte len[2]; + + input.read(len, sizeof(len)); + ato16(len, ch.suite_len_); + + input.read(len, sizeof(len)); + uint16 sessionLen; + ato16(len, sessionLen); + ch.id_len_ = sessionLen; + + input.read(len, sizeof(len)); + uint16 randomLen; + ato16(len, randomLen); + if (ch.suite_len_ > MAX_SUITE_SZ || sessionLen > ID_LEN || + randomLen > RAN_LEN) { + ssl.SetError(bad_input); + return; + } + + int j = 0; + for (uint16 i = 0; i < ch.suite_len_; i += 3) { + byte first = input[AUTO]; + if (first) // sslv2 type + input.read(len, SUITE_LEN); // skip + else { + input.read(&ch.cipher_suites_[j], SUITE_LEN); + j += SUITE_LEN; + } + } + ch.suite_len_ = j; + + if (ch.id_len_) + input.read(ch.session_id_, ch.id_len_); + + if (randomLen < RAN_LEN) + memset(ch.random_, 0, RAN_LEN - randomLen); + input.read(&ch.random_[RAN_LEN - randomLen], randomLen); + + + ch.Process(input, ssl); +} + + +// Build a finished message, see 7.6.9 +void buildFinished(SSL& ssl, Finished& fin, const opaque* sender) +{ + // store current states, building requires get_digest which resets state + MD5 md5(ssl.getHashes().get_MD5()); + SHA sha(ssl.getHashes().get_SHA()); + + if (ssl.isTLS()) + buildFinishedTLS(ssl, fin, sender); + else { + buildMD5(ssl, fin, sender); + buildSHA(ssl, fin, sender); + } + + // restore + ssl.useHashes().use_MD5() = md5; + ssl.useHashes().use_SHA() = sha; +} + + +/* compute SSLv3 HMAC into digest see + * buffer is of sz size and includes HandShake Header but not a Record Header + * verify means to check peers hmac +*/ +void hmac(SSL& ssl, byte* digest, const byte* buffer, uint sz, + ContentType content, bool verify) +{ + Digest& mac = ssl.useCrypto().use_digest(); + opaque inner[SHA_LEN + PAD_MD5 + SEQ_SZ + SIZEOF_ENUM + LENGTH_SZ]; + opaque outer[SHA_LEN + PAD_MD5 + SHA_LEN]; + opaque result[SHA_LEN]; // max possible sizes + uint digestSz = mac.get_digestSize(); // actual sizes + uint padSz = mac.get_padSize(); + uint innerSz = digestSz + padSz + SEQ_SZ + SIZEOF_ENUM + LENGTH_SZ; + uint outerSz = digestSz + padSz + digestSz; + + // data + const opaque* mac_secret = ssl.get_macSecret(verify); + opaque seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 }; + opaque length[LENGTH_SZ]; + c16toa(sz, length); + c32toa(ssl.get_SEQIncrement(verify), &seq[sizeof(uint32)]); + + // make inner + memcpy(inner, mac_secret, digestSz); + memcpy(&inner[digestSz], PAD1, padSz); + memcpy(&inner[digestSz + padSz], seq, SEQ_SZ); + inner[digestSz + padSz + SEQ_SZ] = content; + memcpy(&inner[digestSz + padSz + SEQ_SZ + SIZEOF_ENUM], length, LENGTH_SZ); + + mac.update(inner, innerSz); + mac.get_digest(result, buffer, sz); // append content buffer + + // make outer + memcpy(outer, mac_secret, digestSz); + memcpy(&outer[digestSz], PAD2, padSz); + memcpy(&outer[digestSz + padSz], result, digestSz); + + mac.get_digest(digest, outer, outerSz); +} + + +// TLS type HAMC +void TLS_hmac(SSL& ssl, byte* digest, const byte* buffer, uint sz, + ContentType content, bool verify) +{ + mySTL::auto_ptr hmac; + opaque seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 }; + opaque length[LENGTH_SZ]; + opaque inner[SIZEOF_ENUM + VERSION_SZ + LENGTH_SZ]; // type + version + len + + c16toa(sz, length); + c32toa(ssl.get_SEQIncrement(verify), &seq[sizeof(uint32)]); + + MACAlgorithm algo = ssl.getSecurity().get_parms().mac_algorithm_; + + if (algo == sha) + hmac.reset(NEW_YS HMAC_SHA(ssl.get_macSecret(verify), SHA_LEN)); + else if (algo == rmd) + hmac.reset(NEW_YS HMAC_RMD(ssl.get_macSecret(verify), RMD_LEN)); + else + hmac.reset(NEW_YS HMAC_MD5(ssl.get_macSecret(verify), MD5_LEN)); + + hmac->update(seq, SEQ_SZ); // seq_num + inner[0] = content; // type + inner[SIZEOF_ENUM] = ssl.getSecurity().get_connection().version_.major_; + inner[SIZEOF_ENUM + SIZEOF_ENUM] = + ssl.getSecurity().get_connection().version_.minor_; // version + memcpy(&inner[SIZEOF_ENUM + VERSION_SZ], length, LENGTH_SZ); // length + hmac->update(inner, sizeof(inner)); + hmac->get_digest(digest, buffer, sz); // content +} + + +// compute TLSv1 PRF (pseudo random function using HMAC) +void PRF(byte* digest, uint digLen, const byte* secret, uint secLen, + const byte* label, uint labLen, const byte* seed, uint seedLen) +{ + uint half = (secLen + 1) / 2; + + output_buffer md5_half(half); + output_buffer sha_half(half); + output_buffer labelSeed(labLen + seedLen); + + md5_half.write(secret, half); + sha_half.write(secret + half - secLen % 2, half); + labelSeed.write(label, labLen); + labelSeed.write(seed, seedLen); + + output_buffer md5_result(digLen); + output_buffer sha_result(digLen); + + p_hash(md5_result, md5_half, labelSeed, md5); + p_hash(sha_result, sha_half, labelSeed, sha); + + md5_result.set_current(0); + sha_result.set_current(0); + get_xor(digest, digLen, md5_result, sha_result); +} + + +// build certificate hashes +void build_certHashes(SSL& ssl, Hashes& hashes) +{ + // store current states, building requires get_digest which resets state + MD5 md5(ssl.getHashes().get_MD5()); + SHA sha(ssl.getHashes().get_SHA()); + + if (ssl.isTLS()) { + ssl.useHashes().use_MD5().get_digest(hashes.md5_); + ssl.useHashes().use_SHA().get_digest(hashes.sha_); + } + else { + buildMD5_CertVerify(ssl, hashes.md5_); + buildSHA_CertVerify(ssl, hashes.sha_); + } + + // restore + ssl.useHashes().use_MD5() = md5; + ssl.useHashes().use_SHA() = sha; +} + + + +// do process input requests, return 0 is done, 1 is call again to complete +int DoProcessReply(SSL& ssl) +{ + // wait for input if blocking + if (!ssl.useSocket().wait()) { + ssl.SetError(receive_error); + return 0; + } + uint ready = ssl.getSocket().get_ready(); + if (!ready) return 1; + + // add buffered data if its there + input_buffer* buffered = ssl.useBuffers().TakeRawInput(); + uint buffSz = buffered ? buffered->get_size() : 0; + input_buffer buffer(buffSz + ready); + if (buffSz) { + buffer.assign(buffered->get_buffer(), buffSz); + ysDelete(buffered); + buffered = 0; + } + + // add new data + uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready); + if (read == static_cast(-1)) { + ssl.SetError(receive_error); + return 0; + } + buffer.add_size(read); + uint offset = 0; + const MessageFactory& mf = ssl.getFactory().getMessage(); + + // old style sslv2 client hello? + if (ssl.getSecurity().get_parms().entity_ == server_end && + ssl.getStates().getServer() == clientNull) + if (buffer.peek() != handshake) { + ProcessOldClientHello(buffer, ssl); + if (ssl.GetError()) + return 0; + } + + while(!buffer.eof()) { + // each record + RecordLayerHeader hdr; + bool needHdr = false; + + if (static_cast(RECORD_HEADER) > buffer.get_remaining()) + needHdr = true; + else { + buffer >> hdr; + ssl.verifyState(hdr); + } + + // make sure we have enough input in buffer to process this record + if (needHdr || hdr.length_ > buffer.get_remaining()) { + // put header in front for next time processing + uint extra = needHdr ? 0 : RECORD_HEADER; + uint sz = buffer.get_remaining() + extra; + ssl.useBuffers().SetRawInput(NEW_YS input_buffer(sz, + buffer.get_buffer() + buffer.get_current() - extra, sz)); + return 1; + } + + while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) { + // each message in record, can be more than 1 if not encrypted + if (ssl.getSecurity().get_parms().pending_ == false) // cipher on + decrypt_message(ssl, buffer, hdr.length_); + + mySTL::auto_ptr msg(mf.CreateObject(hdr.type_)); + if (!msg.get()) { + ssl.SetError(factory_error); + return 0; + } + buffer >> *msg; + msg->Process(buffer, ssl); + if (ssl.GetError()) + return 0; + } + offset += hdr.length_ + RECORD_HEADER; + } + return 0; +} + + +// process input requests +void processReply(SSL& ssl) +{ + if (ssl.GetError()) return; + + if (DoProcessReply(ssl)) + // didn't complete process + if (!ssl.getSocket().IsNonBlocking()) { + // keep trying now, blocking ok + while (!ssl.GetError()) + if (DoProcessReply(ssl) == 0) break; + } + else + // user will have try again later, non blocking + ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); +} + + +// send client_hello, no buffering +void sendClientHello(SSL& ssl) +{ + ssl.verifyState(serverNull); + if (ssl.GetError()) return; + + ClientHello ch(ssl.getSecurity().get_connection().version_, + ssl.getSecurity().get_connection().compression_); + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + output_buffer out; + + buildClientHello(ssl, ch); + ssl.set_random(ch.get_random(), client_end); + buildHeaders(ssl, hsHeader, rlHeader, ch); + buildOutput(out, rlHeader, hsHeader, ch); + hashHandShake(ssl, out); + + ssl.Send(out.get_buffer(), out.get_size()); +} + + +// send client key exchange +void sendClientKeyExchange(SSL& ssl, BufferOutput buffer) +{ + ssl.verifyState(serverHelloDoneComplete); + if (ssl.GetError()) return; + + ClientKeyExchange ck(ssl); + ck.build(ssl); + ssl.makeMasterSecret(); + + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + buildHeaders(ssl, hsHeader, rlHeader, ck); + buildOutput(*out.get(), rlHeader, hsHeader, ck); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send server key exchange +void sendServerKeyExchange(SSL& ssl, BufferOutput buffer) +{ + if (ssl.GetError()) return; + ServerKeyExchange sk(ssl); + sk.build(ssl); + + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + buildHeaders(ssl, hsHeader, rlHeader, sk); + buildOutput(*out.get(), rlHeader, hsHeader, sk); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send change cipher +void sendChangeCipher(SSL& ssl, BufferOutput buffer) +{ + if (ssl.getSecurity().get_parms().entity_ == server_end) + if (ssl.getSecurity().get_resuming()) + ssl.verifyState(clientKeyExchangeComplete); + else + ssl.verifyState(clientFinishedComplete); + if (ssl.GetError()) return; + + ChangeCipherSpec ccs; + RecordLayerHeader rlHeader; + buildHeader(ssl, rlHeader, ccs); + mySTL::auto_ptr out(NEW_YS output_buffer); + buildOutput(*out.get(), rlHeader, ccs); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send finished +void sendFinished(SSL& ssl, ConnectionEnd side, BufferOutput buffer) +{ + if (ssl.GetError()) return; + + Finished fin; + buildFinished(ssl, fin, side == client_end ? client : server); + mySTL::auto_ptr out(NEW_YS output_buffer); + cipherFinished(ssl, fin, *out.get()); // hashes handshake + + if (ssl.getSecurity().get_resuming()) { + if (side == server_end) + buildFinished(ssl, ssl.useHashes().use_verify(), client); // client + } + else { + if (!ssl.getSecurity().GetContext()->GetSessionCacheOff()) + GetSessions().add(ssl); // store session + if (side == client_end) + buildFinished(ssl, ssl.useHashes().use_verify(), server); // server + } + ssl.useSecurity().use_connection().CleanMaster(); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send data +int sendData(SSL& ssl, const void* buffer, int sz) +{ + if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) + ssl.SetError(no_error); + + ssl.verfiyHandShakeComplete(); + if (ssl.GetError()) return -1; + int sent = 0; + + for (;;) { + int len = min(sz - sent, MAX_RECORD_SIZE); + output_buffer out; + input_buffer tmp; + + Data data; + + if (ssl.CompressionOn()) { + if (Compress(static_cast(buffer) + sent, len, + tmp) == -1) { + ssl.SetError(compress_error); + return -1; + } + data.SetData(tmp.get_size(), tmp.get_buffer()); + } + else + data.SetData(len, static_cast(buffer) + sent); + + buildMessage(ssl, out, data); + ssl.Send(out.get_buffer(), out.get_size()); + + if (ssl.GetError()) return -1; + sent += len; + if (sent == sz) break; + } + ssl.useLog().ShowData(sent, true); + return sent; +} + + +// send alert +int sendAlert(SSL& ssl, const Alert& alert) +{ + output_buffer out; + buildAlert(ssl, out, alert); + ssl.Send(out.get_buffer(), out.get_size()); + + return alert.get_length(); +} + + +// process input data +int receiveData(SSL& ssl, Data& data, bool peek) +{ + if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) + ssl.SetError(no_error); + + ssl.verfiyHandShakeComplete(); + if (ssl.GetError()) return -1; + + if (!ssl.HasData()) + processReply(ssl); + + if (peek) + ssl.PeekData(data); + else + ssl.fillData(data); + + ssl.useLog().ShowData(data.get_length()); + if (ssl.GetError()) return -1; + + if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) { + ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); + return SSL_WOULD_BLOCK; + } + return data.get_length(); +} + + +// send server hello +void sendServerHello(SSL& ssl, BufferOutput buffer) +{ + if (ssl.getSecurity().get_resuming()) + ssl.verifyState(clientKeyExchangeComplete); + else + ssl.verifyState(clientHelloComplete); + if (ssl.GetError()) return; + + ServerHello sh(ssl.getSecurity().get_connection().version_, + ssl.getSecurity().get_connection().compression_); + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + + buildServerHello(ssl, sh); + ssl.set_random(sh.get_random(), server_end); + buildHeaders(ssl, hsHeader, rlHeader, sh); + buildOutput(*out.get(), rlHeader, hsHeader, sh); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send server hello done +void sendServerHelloDone(SSL& ssl, BufferOutput buffer) +{ + if (ssl.GetError()) return; + + ServerHelloDone shd; + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + + buildHeaders(ssl, hsHeader, rlHeader, shd); + buildOutput(*out.get(), rlHeader, hsHeader, shd); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send certificate +void sendCertificate(SSL& ssl, BufferOutput buffer) +{ + if (ssl.GetError()) return; + + Certificate cert(ssl.getCrypto().get_certManager().get_cert()); + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + + buildHeaders(ssl, hsHeader, rlHeader, cert); + buildOutput(*out.get(), rlHeader, hsHeader, cert); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send certificate request +void sendCertificateRequest(SSL& ssl, BufferOutput buffer) +{ + if (ssl.GetError()) return; + + CertificateRequest request; + request.Build(); + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + + buildHeaders(ssl, hsHeader, rlHeader, request); + buildOutput(*out.get(), rlHeader, hsHeader, request); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +// send certificate verify +void sendCertificateVerify(SSL& ssl, BufferOutput buffer) +{ + if (ssl.GetError()) return; + + CertificateVerify verify; + verify.Build(ssl); + RecordLayerHeader rlHeader; + HandShakeHeader hsHeader; + mySTL::auto_ptr out(NEW_YS output_buffer); + + buildHeaders(ssl, hsHeader, rlHeader, verify); + buildOutput(*out.get(), rlHeader, hsHeader, verify); + hashHandShake(ssl, *out.get()); + + if (buffer == buffered) + ssl.addBuffer(out.release()); + else + ssl.Send(out->get_buffer(), out->get_size()); +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/src/lock.cpp b/externals/mysql/extlib/yassl/src/lock.cpp new file mode 100644 index 00000000000..6d8e9c17477 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/lock.cpp @@ -0,0 +1,87 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* Locking functions + */ + +#include "runtime.hpp" +#include "lock.hpp" + + +namespace yaSSL { + + +#ifdef MULTI_THREADED + #ifdef _WIN32 + + Mutex::Mutex() + { + InitializeCriticalSection(&cs_); + } + + + Mutex::~Mutex() + { + DeleteCriticalSection(&cs_); + } + + + Mutex::Lock::Lock(Mutex& lm) : mutex_(lm) + { + EnterCriticalSection(&mutex_.cs_); + } + + + Mutex::Lock::~Lock() + { + LeaveCriticalSection(&mutex_.cs_); + } + + #else // _WIN32 + + Mutex::Mutex() + { + pthread_mutex_init(&mutex_, 0); + } + + + Mutex::~Mutex() + { + pthread_mutex_destroy(&mutex_); + } + + + Mutex::Lock::Lock(Mutex& lm) : mutex_(lm) + { + pthread_mutex_lock(&mutex_.mutex_); + } + + + Mutex::Lock::~Lock() + { + pthread_mutex_unlock(&mutex_.mutex_); + } + + + #endif // _WIN32 +#endif // MULTI_THREADED + + + +} // namespace yaSSL + diff --git a/externals/mysql/extlib/yassl/src/log.cpp b/externals/mysql/extlib/yassl/src/log.cpp new file mode 100644 index 00000000000..35db4136a54 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/log.cpp @@ -0,0 +1,146 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* Debug logging functions + */ + + +#include "runtime.hpp" +#include "log.hpp" + +#ifdef YASSL_LOG + #include + #include + #include +#endif + + + +namespace yaSSL { + + +#ifdef YASSL_LOG + + enum { MAX_MSG = 81 }; + + Log::Log(const char* str) + { + log_ = fopen(str, "w"); + Trace("********** Logger Attached **********"); + } + + + Log::~Log() + { + Trace("********** Logger Detached **********"); + fclose(log_); + } + + + // Trace a message + void Log::Trace(const char* str) + { + if (!log_) return; + + time_t clicks = time(0); + char timeStr[32]; + + // get rid of newline + strncpy(timeStr, ctime(&clicks), sizeof(timeStr)); + unsigned int len = strlen(timeStr); + timeStr[len - 1] = 0; + + char msg[MAX_MSG]; + + strncpy(msg, timeStr, sizeof(timeStr)); + strncat(msg, ":", 1); + strncat(msg, str, MAX_MSG - sizeof(timeStr) - 2); + strncat(msg, "\n", 1); + msg[MAX_MSG - 1] = 0; + + fputs(msg, log_); + } + + + #if defined(_WIN32) || defined(__MACH__) || defined(__hpux__) + typedef int socklen_t; + #endif + + + // write tcp address + void Log::ShowTCP(socket_t fd, bool ended) + { + sockaddr_in peeraddr; + socklen_t len = sizeof(peeraddr); + if (getpeername(fd, (sockaddr*)&peeraddr, &len) != 0) + return; + + const char* p = reinterpret_cast(&peeraddr.sin_addr); + char msg[MAX_MSG]; + char number[16]; + + if (ended) + strncpy(msg, "yaSSL conn DONE w/ peer ", 26); + else + strncpy(msg, "yaSSL conn BEGUN w/ peer ", 26); + for (int i = 0; i < 4; ++i) { + sprintf(number, "%u", static_cast(p[i])); + strncat(msg, number, 8); + if (i < 3) + strncat(msg, ".", 1); + } + strncat(msg, " port ", 8); + sprintf(number, "%d", htons(peeraddr.sin_port)); + strncat(msg, number, 8); + + msg[MAX_MSG - 1] = 0; + Trace(msg); + } + + + // log processed data + void Log::ShowData(uint bytes, bool sent) + { + char msg[MAX_MSG]; + char number[16]; + + if (sent) + strncpy(msg, "Sent ", 10); + else + strncpy(msg, "Received ", 10); + sprintf(number, "%u", bytes); + strncat(msg, number, 8); + strncat(msg, " bytes of application data", 27); + + msg[MAX_MSG - 1] = 0; + Trace(msg); + } + + +#else // no YASSL_LOG + + + Log::Log(const char*) {} + Log::~Log() {} + void Log::Trace(const char*) {} + void Log::ShowTCP(socket_t, bool) {} + void Log::ShowData(uint, bool) {} + + +#endif // YASSL_LOG +} // namespace diff --git a/externals/mysql/extlib/yassl/src/socket_wrapper.cpp b/externals/mysql/extlib/yassl/src/socket_wrapper.cpp new file mode 100644 index 00000000000..eee5d47377f --- /dev/null +++ b/externals/mysql/extlib/yassl/src/socket_wrapper.cpp @@ -0,0 +1,199 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* The socket wrapper source implements a Socket class that hides the + * differences between Berkely style sockets and Windows sockets, allowing + * transparent TCP access. + */ + + +#include "runtime.hpp" +#include "socket_wrapper.hpp" + +#ifndef _WIN32 + #include + #include + #include + #include + #include + #include + #include + #include +#endif // _WIN32 + +#if defined(__sun) || defined(__SCO_VERSION__) || defined(__NETWARE__) + #include +#endif + +#ifdef _WIN32 + const int SOCKET_EINVAL = WSAEINVAL; + const int SOCKET_EWOULDBLOCK = WSAEWOULDBLOCK; + const int SOCKET_EAGAIN = WSAEWOULDBLOCK; +#else + const int SOCKET_EINVAL = EINVAL; + const int SOCKET_EWOULDBLOCK = EWOULDBLOCK; + const int SOCKET_EAGAIN = EAGAIN; +#endif // _WIN32 + + +namespace yaSSL { + + +Socket::Socket(socket_t s) + : socket_(s), wouldBlock_(false), nonBlocking_(false) +{} + + +void Socket::set_fd(socket_t s) +{ + socket_ = s; +} + + +socket_t Socket::get_fd() const +{ + return socket_; +} + + +Socket::~Socket() +{ + // don't close automatically now +} + + +void Socket::closeSocket() +{ + if (socket_ != INVALID_SOCKET) { +#ifdef _WIN32 + closesocket(socket_); +#else + close(socket_); +#endif + socket_ = INVALID_SOCKET; + } +} + + +uint Socket::get_ready() const +{ +#ifdef _WIN32 + unsigned long ready = 0; + ioctlsocket(socket_, FIONREAD, &ready); +#else + /* + 64-bit Solaris requires the variable passed to + FIONREAD be a 32-bit value. + */ + unsigned int ready = 0; + ioctl(socket_, FIONREAD, &ready); +#endif + + return ready; +} + + +uint Socket::send(const byte* buf, unsigned int sz, int flags) const +{ + const byte* pos = buf; + const byte* end = pos + sz; + + while (pos != end) { + int sent = ::send(socket_, reinterpret_cast(pos), + static_cast(end - pos), flags); + + if (sent == -1) + return 0; + + pos += sent; + } + + return sz; +} + + +uint Socket::receive(byte* buf, unsigned int sz, int flags) +{ + wouldBlock_ = false; + + int recvd = ::recv(socket_, reinterpret_cast(buf), sz, flags); + + // idea to seperate error from would block by arnetheduck@gmail.com + if (recvd == -1) { + if (get_lastError() == SOCKET_EWOULDBLOCK || + get_lastError() == SOCKET_EAGAIN) { + wouldBlock_ = true; // would have blocked this time only + nonBlocking_ = true; // socket nonblocking, win32 only way to tell + return 0; + } + } + else if (recvd == 0) + return static_cast(-1); + + return recvd; +} + + +// wait if blocking for input, return false for error +bool Socket::wait() +{ + byte b; + return receive(&b, 1, MSG_PEEK) != static_cast(-1); +} + + +void Socket::shutDown(int how) +{ + shutdown(socket_, how); +} + + +int Socket::get_lastError() +{ +#ifdef _WIN32 + return WSAGetLastError(); +#else + return errno; +#endif +} + + +bool Socket::WouldBlock() const +{ + return wouldBlock_; +} + + +bool Socket::IsNonBlocking() const +{ + return nonBlocking_; +} + + +void Socket::set_lastError(int errorCode) +{ +#ifdef _WIN32 + WSASetLastError(errorCode); +#else + errno = errorCode; +#endif +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/src/ssl.cpp b/externals/mysql/extlib/yassl/src/ssl.cpp new file mode 100644 index 00000000000..29aa034f885 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/ssl.cpp @@ -0,0 +1,1672 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* SSL source implements all openssl compatibility API functions + * + * TODO: notes are mostly api additions to allow compilation with mysql + * they don't affect normal modes but should be provided for completeness + + * stunnel functions at end of file + */ + + + + +/* see man pages for function descriptions */ + +#include "runtime.hpp" +#include "openssl/ssl.h" +#include "handshake.hpp" +#include "yassl_int.hpp" +#include "md5.hpp" // for TaoCrypt MD5 size assert +#include "md4.hpp" // for TaoCrypt MD4 size assert +#include "file.hpp" // for TaoCrypt Source +#include "coding.hpp" // HexDecoder +#include "helpers.hpp" // for placement new hack +#include + +#ifdef _WIN32 + #include // FindFirstFile etc.. +#else + #include // file helper + #include // stat + #include // opendir +#endif + + +namespace yaSSL { + + + +int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) +{ + if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM) + return SSL_BAD_FILETYPE; + + if (file == NULL || !file[0]) + return SSL_BAD_FILE; + + FILE* input = fopen(file, "rb"); + if (!input) + return SSL_BAD_FILE; + + if (type == CA) { + // may have a bunch of CAs + x509* ptr; + while ( (ptr = PemToDer(input, Cert)) ) + ctx->AddCA(ptr); + + if (!feof(input)) { + fclose(input); + return SSL_BAD_FILE; + } + } + else { + x509*& x = (type == Cert) ? ctx->certificate_ : ctx->privateKey_; + + if (format == SSL_FILETYPE_ASN1) { + fseek(input, 0, SEEK_END); + long sz = ftell(input); + rewind(input); + x = NEW_YS x509(sz); // takes ownership + size_t bytes = fread(x->use_buffer(), sz, 1, input); + if (bytes != 1) { + fclose(input); + return SSL_BAD_FILE; + } + } + else { + EncryptedInfo info; + x = PemToDer(input, type, &info); + if (!x) { + fclose(input); + return SSL_BAD_FILE; + } + if (info.set) { + // decrypt + char password[80]; + pem_password_cb cb = ctx->GetPasswordCb(); + if (!cb) { + fclose(input); + return SSL_BAD_FILE; + } + int passwordSz = cb(password, sizeof(password), 0, + ctx->GetUserData()); + byte key[AES_256_KEY_SZ]; // max sizes + byte iv[AES_IV_SZ]; + + // use file's salt for key derivation, but not real iv + TaoCrypt::Source source(info.iv, info.ivSz); + TaoCrypt::HexDecoder dec(source); + memcpy(info.iv, source.get_buffer(), min((uint)sizeof(info.iv), + source.size())); + EVP_BytesToKey(info.name, "MD5", info.iv, (byte*)password, + passwordSz, 1, key, iv); + + mySTL::auto_ptr cipher; + if (strncmp(info.name, "DES-CBC", 7) == 0) + cipher.reset(NEW_YS DES); + else if (strncmp(info.name, "DES-EDE3-CBC", 13) == 0) + cipher.reset(NEW_YS DES_EDE); + else if (strncmp(info.name, "AES-128-CBC", 13) == 0) + cipher.reset(NEW_YS AES(AES_128_KEY_SZ)); + else if (strncmp(info.name, "AES-192-CBC", 13) == 0) + cipher.reset(NEW_YS AES(AES_192_KEY_SZ)); + else if (strncmp(info.name, "AES-256-CBC", 13) == 0) + cipher.reset(NEW_YS AES(AES_256_KEY_SZ)); + else { + fclose(input); + return SSL_BAD_FILE; + } + cipher->set_decryptKey(key, info.iv); + mySTL::auto_ptr newx(NEW_YS x509(x->get_length())); + cipher->decrypt(newx->use_buffer(), x->get_buffer(), + x->get_length()); + ysDelete(x); + x = newx.release(); + } + } + } + fclose(input); + return SSL_SUCCESS; +} + + +extern "C" { + + +SSL_METHOD* SSLv3_method() +{ + return SSLv3_client_method(); +} + + +SSL_METHOD* SSLv3_server_method() +{ + return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,0)); +} + + +SSL_METHOD* SSLv3_client_method() +{ + return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,0)); +} + + +SSL_METHOD* TLSv1_server_method() +{ + return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,1)); +} + + +SSL_METHOD* TLSv1_client_method() +{ + return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,1)); +} + + +SSL_METHOD* TLSv1_1_server_method() +{ + return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,2)); +} + + +SSL_METHOD* TLSv1_1_client_method() +{ + return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,2)); +} + + +SSL_METHOD* SSLv23_server_method() +{ + // compatibility only, no version 2 support, but does SSL 3 and TLS 1 + return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,2), true); +} + + +SSL_METHOD* SSLv23_client_method() +{ + // compatibility only, no version 2 support, but does SSL 3 and TLS 1 + // though it sends TLS1 hello not SSLv2 so SSLv3 only servers will decline + // TODO: maybe add support to send SSLv2 hello ??? + return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,2), true); +} + + +SSL_CTX* SSL_CTX_new(SSL_METHOD* method) +{ + return NEW_YS SSL_CTX(method); +} + + +void SSL_CTX_free(SSL_CTX* ctx) +{ + ysDelete(ctx); +} + + +SSL* SSL_new(SSL_CTX* ctx) +{ + return NEW_YS SSL(ctx); +} + + +void SSL_free(SSL* ssl) +{ + ysDelete(ssl); +} + + +int SSL_set_fd(SSL* ssl, YASSL_SOCKET_T fd) +{ + ssl->useSocket().set_fd(fd); + return SSL_SUCCESS; +} + + +YASSL_SOCKET_T SSL_get_fd(const SSL* ssl) +{ + return ssl->getSocket().get_fd(); +} + + +// if you get an error from connect see note at top of README +int SSL_connect(SSL* ssl) +{ + if (ssl->GetError() == YasslError(SSL_ERROR_WANT_READ)) + ssl->SetError(no_error); + + ClientState neededState; + + switch (ssl->getStates().GetConnect()) { + + case CONNECT_BEGIN : + sendClientHello(*ssl); + if (!ssl->GetError()) + ssl->useStates().UseConnect() = CLIENT_HELLO_SENT; + + case CLIENT_HELLO_SENT : + neededState = ssl->getSecurity().get_resuming() ? + serverFinishedComplete : serverHelloDoneComplete; + while (ssl->getStates().getClient() < neededState) { + if (ssl->GetError()) break; + processReply(*ssl); + } + if (!ssl->GetError()) + ssl->useStates().UseConnect() = FIRST_REPLY_DONE; + + case FIRST_REPLY_DONE : + if(ssl->getCrypto().get_certManager().sendVerify()) + sendCertificate(*ssl); + + if (!ssl->getSecurity().get_resuming()) + sendClientKeyExchange(*ssl); + + if(ssl->getCrypto().get_certManager().sendVerify()) + sendCertificateVerify(*ssl); + + sendChangeCipher(*ssl); + sendFinished(*ssl, client_end); + ssl->flushBuffer(); + + if (!ssl->GetError()) + ssl->useStates().UseConnect() = FINISHED_DONE; + + case FINISHED_DONE : + if (!ssl->getSecurity().get_resuming()) + while (ssl->getStates().getClient() < serverFinishedComplete) { + if (ssl->GetError()) break; + processReply(*ssl); + } + if (!ssl->GetError()) + ssl->useStates().UseConnect() = SECOND_REPLY_DONE; + + case SECOND_REPLY_DONE : + ssl->verifyState(serverFinishedComplete); + ssl->useLog().ShowTCP(ssl->getSocket().get_fd()); + + if (ssl->GetError()) { + GetErrors().Add(ssl->GetError()); + return SSL_FATAL_ERROR; + } + return SSL_SUCCESS; + + default : + return SSL_FATAL_ERROR; // unkown state + } +} + + +int SSL_write(SSL* ssl, const void* buffer, int sz) +{ + return sendData(*ssl, buffer, sz); +} + + +int SSL_read(SSL* ssl, void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast(buffer)); + return receiveData(*ssl, data); +} + + +int SSL_accept(SSL* ssl) +{ + if (ssl->GetError() == YasslError(SSL_ERROR_WANT_READ)) + ssl->SetError(no_error); + + switch (ssl->getStates().GetAccept()) { + + case ACCEPT_BEGIN : + processReply(*ssl); + if (!ssl->GetError()) + ssl->useStates().UseAccept() = ACCEPT_FIRST_REPLY_DONE; + + case ACCEPT_FIRST_REPLY_DONE : + sendServerHello(*ssl); + + if (!ssl->getSecurity().get_resuming()) { + sendCertificate(*ssl); + + if (ssl->getSecurity().get_connection().send_server_key_) + sendServerKeyExchange(*ssl); + + if(ssl->getCrypto().get_certManager().verifyPeer()) + sendCertificateRequest(*ssl); + + sendServerHelloDone(*ssl); + ssl->flushBuffer(); + } + + if (!ssl->GetError()) + ssl->useStates().UseAccept() = SERVER_HELLO_DONE; + + case SERVER_HELLO_DONE : + if (!ssl->getSecurity().get_resuming()) { + while (ssl->getStates().getServer() < clientFinishedComplete) { + if (ssl->GetError()) break; + processReply(*ssl); + } + } + if (!ssl->GetError()) + ssl->useStates().UseAccept() = ACCEPT_SECOND_REPLY_DONE; + + case ACCEPT_SECOND_REPLY_DONE : + sendChangeCipher(*ssl); + sendFinished(*ssl, server_end); + ssl->flushBuffer(); + + if (!ssl->GetError()) + ssl->useStates().UseAccept() = ACCEPT_FINISHED_DONE; + + case ACCEPT_FINISHED_DONE : + if (ssl->getSecurity().get_resuming()) { + while (ssl->getStates().getServer() < clientFinishedComplete) { + if (ssl->GetError()) break; + processReply(*ssl); + } + } + if (!ssl->GetError()) + ssl->useStates().UseAccept() = ACCEPT_THIRD_REPLY_DONE; + + case ACCEPT_THIRD_REPLY_DONE : + ssl->useLog().ShowTCP(ssl->getSocket().get_fd()); + + if (ssl->GetError()) { + GetErrors().Add(ssl->GetError()); + return SSL_FATAL_ERROR; + } + return SSL_SUCCESS; + + default: + return SSL_FATAL_ERROR; // unknown state + } +} + + +int SSL_do_handshake(SSL* ssl) +{ + if (ssl->getSecurity().get_parms().entity_ == client_end) + return SSL_connect(ssl); + else + return SSL_accept(ssl); +} + + +int SSL_clear(SSL* ssl) +{ + GetErrors().Remove(); + + return SSL_SUCCESS; +} + + +int SSL_shutdown(SSL* ssl) +{ + if (!ssl->GetQuietShutdown()) { + Alert alert(warning, close_notify); + sendAlert(*ssl, alert); + } + ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true); + + GetErrors().Remove(); + + return SSL_SUCCESS; +} + + +void SSL_set_quiet_shutdown(SSL *ssl,int mode) +{ + ssl->SetQuietShutdown(mode != 0); +} + + +int SSL_get_quiet_shutdown(SSL *ssl) +{ + return ssl->GetQuietShutdown(); +} + + +/* on by default but allow user to turn off */ +long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode) +{ + if (mode == SSL_SESS_CACHE_OFF) + ctx->SetSessionCacheOff(); + + if (mode == SSL_SESS_CACHE_NO_AUTO_CLEAR) + ctx->SetSessionCacheFlushOff(); + + return SSL_SUCCESS; +} + + +SSL_SESSION* SSL_get_session(SSL* ssl) +{ + if (ssl->getSecurity().GetContext()->GetSessionCacheOff()) + return 0; + + return GetSessions().lookup( + ssl->getSecurity().get_connection().sessionID_); +} + + +int SSL_set_session(SSL* ssl, SSL_SESSION* session) +{ + if (ssl->getSecurity().GetContext()->GetSessionCacheOff()) + return SSL_FAILURE; + + ssl->set_session(session); + return SSL_SUCCESS; +} + + +int SSL_session_reused(SSL* ssl) +{ + return ssl->getSecurity().get_resuming(); +} + + +long SSL_SESSION_set_timeout(SSL_SESSION* sess, long t) +{ + if (!sess) + return SSL_ERROR_NONE; + + sess->SetTimeOut(t); + return SSL_SUCCESS; +} + + +long SSL_get_default_timeout(SSL* /*ssl*/) +{ + return DEFAULT_TIMEOUT; +} + + +void SSL_flush_sessions(SSL_CTX *ctx, long /* tm */) +{ + if (ctx->GetSessionCacheOff()) + return; + + GetSessions().Flush(); +} + + +const char* SSL_get_cipher_name(SSL* ssl) +{ + return SSL_get_cipher(ssl); +} + + +const char* SSL_get_cipher(SSL* ssl) +{ + return ssl->getSecurity().get_parms().cipher_name_; +} + + +// SSLv2 only, not implemented +char* SSL_get_shared_ciphers(SSL* /*ssl*/, char* buf, int len) +{ + return strncpy(buf, "Not Implemented, SSLv2 only", len); +} + + +const char* SSL_get_cipher_list(SSL* ssl, int priority) +{ + if (priority < 0 || priority >= MAX_CIPHERS) + return 0; + + if (ssl->getSecurity().get_parms().cipher_list_[priority][0]) + return ssl->getSecurity().get_parms().cipher_list_[priority]; + + return 0; +} + + +int SSL_CTX_set_cipher_list(SSL_CTX* ctx, const char* list) +{ + if (ctx->SetCipherList(list)) + return SSL_SUCCESS; + else + return SSL_FAILURE; +} + + +const char* SSL_get_version(SSL* ssl) +{ + static const char* version3 = "SSLv3"; + static const char* version31 = "TLSv1"; + + return ssl->isTLS() ? version31 : version3; +} + +const char* SSLeay_version(int) +{ + static const char* version = "SSLeay yaSSL compatibility"; + return version; +} + + +int SSL_get_error(SSL* ssl, int /*previous*/) +{ + return ssl->getStates().What(); +} + + + +/* turn on yaSSL zlib compression + returns 0 for success, else error (not built in) + only need to turn on for client, becuase server on by default if built in + but calling for server will tell you whether it's available or not +*/ +int SSL_set_compression(SSL* ssl) /* Chad didn't rename to ya~ because it is prob. bug. */ +{ + return ssl->SetCompression(); +} + + + +X509* SSL_get_peer_certificate(SSL* ssl) +{ + return ssl->getCrypto().get_certManager().get_peerX509(); +} + + +void X509_free(X509* /*x*/) +{ + // peer cert set for deletion during destruction + // no need to delete now +} + + +X509* X509_STORE_CTX_get_current_cert(X509_STORE_CTX* ctx) +{ + return ctx->current_cert; +} + + +int X509_STORE_CTX_get_error(X509_STORE_CTX* ctx) +{ + return ctx->error; +} + + +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX* ctx) +{ + return ctx->error_depth; +} + + +// copy name into buffer, at most sz bytes, if buffer is null +// will malloc buffer, caller responsible for freeing +char* X509_NAME_oneline(X509_NAME* name, char* buffer, int sz) +{ + if (!name->GetName()) return buffer; + + int len = (int)strlen(name->GetName()) + 1; + int copySz = min(len, sz); + + if (!buffer) { + buffer = (char*)malloc(len); + if (!buffer) return buffer; + copySz = len; + } + + if (copySz == 0) + return buffer; + + memcpy(buffer, name->GetName(), copySz - 1); + buffer[copySz - 1] = 0; + + return buffer; +} + + +X509_NAME* X509_get_issuer_name(X509* x) +{ + return x->GetIssuer(); +} + + +X509_NAME* X509_get_subject_name(X509* x) +{ + return x->GetSubject(); +} + + +void SSL_load_error_strings() // compatibility only +{} + + +void SSL_set_connect_state(SSL*) +{ + // already a client by default +} + + +void SSL_set_accept_state(SSL* ssl) +{ + ssl->useSecurity().use_parms().entity_ = server_end; +} + + +long SSL_get_verify_result(SSL*) +{ + // won't get here if not OK + return X509_V_OK; +} + + +long SSL_CTX_sess_set_cache_size(SSL_CTX* /*ctx*/, long /*sz*/) +{ + // unlimited size, can't set for now + return 0; +} + + +long SSL_CTX_get_session_cache_mode(SSL_CTX*) +{ + // always 0, unlimited size for now + return 0; +} + + +long SSL_CTX_set_tmp_dh(SSL_CTX* ctx, DH* dh) +{ + if (ctx->SetDH(*dh)) + return SSL_SUCCESS; + else + return SSL_FAILURE; +} + + +int SSL_CTX_use_certificate_file(SSL_CTX* ctx, const char* file, int format) +{ + return read_file(ctx, file, format, Cert); +} + + +int SSL_CTX_use_PrivateKey_file(SSL_CTX* ctx, const char* file, int format) +{ + return read_file(ctx, file, format, PrivateKey); +} + + +void SSL_CTX_set_verify(SSL_CTX* ctx, int mode, VerifyCallback vc) +{ + if (mode & SSL_VERIFY_PEER) + ctx->setVerifyPeer(); + + if (mode == SSL_VERIFY_NONE) + ctx->setVerifyNone(); + + if (mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) + ctx->setFailNoCert(); + + ctx->setVerifyCallback(vc); +} + + +int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file, + const char* path) +{ + int ret = SSL_SUCCESS; + const int HALF_PATH = 128; + + if (file) ret = read_file(ctx, file, SSL_FILETYPE_PEM, CA); + + if (ret == SSL_SUCCESS && path) { + // call read_file for each reqular file in path +#ifdef _WIN32 + + WIN32_FIND_DATA FindFileData; + HANDLE hFind; + + char name[MAX_PATH + 1]; // directory specification + strncpy(name, path, MAX_PATH - 3); + strncat(name, "\\*", 3); + + hFind = FindFirstFile(name, &FindFileData); + if (hFind == INVALID_HANDLE_VALUE) return SSL_BAD_PATH; + + do { + if (FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) { + strncpy(name, path, MAX_PATH - 2 - HALF_PATH); + strncat(name, "\\", 2); + strncat(name, FindFileData.cFileName, HALF_PATH); + ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA); + } + } while (ret == SSL_SUCCESS && FindNextFile(hFind, &FindFileData)); + + FindClose(hFind); + +#else // _WIN32 + + const int MAX_PATH = 260; + + DIR* dir = opendir(path); + if (!dir) return SSL_BAD_PATH; + + struct dirent* entry; + struct stat buf; + char name[MAX_PATH + 1]; + + while (ret == SSL_SUCCESS && (entry = readdir(dir))) { + strncpy(name, path, MAX_PATH - 1 - HALF_PATH); + strncat(name, "/", 1); + strncat(name, entry->d_name, HALF_PATH); + if (stat(name, &buf) < 0) return SSL_BAD_STAT; + + if (S_ISREG(buf.st_mode)) + ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA); + } + + closedir(dir); + +#endif + } + + return ret; +} + + +int SSL_CTX_set_default_verify_paths(SSL_CTX* /*ctx*/) +{ + // TODO: figure out way to set/store default path, then call load_verify + return SSL_NOT_IMPLEMENTED; +} + + +int SSL_CTX_set_session_id_context(SSL_CTX*, const unsigned char*, + unsigned int) +{ + // No application specific context needed for yaSSL + return SSL_SUCCESS; +} + + +int SSL_CTX_check_private_key(SSL_CTX* /*ctx*/) +{ + // TODO: check private against public for RSA match + return SSL_NOT_IMPLEMENTED; +} + + +// TODO: all session stats +long SSL_CTX_sess_accept(SSL_CTX* ctx) +{ + return ctx->GetStats().accept_; +} + + +long SSL_CTX_sess_connect(SSL_CTX* ctx) +{ + return ctx->GetStats().connect_; +} + + +long SSL_CTX_sess_accept_good(SSL_CTX* ctx) +{ + return ctx->GetStats().acceptGood_; +} + + +long SSL_CTX_sess_connect_good(SSL_CTX* ctx) +{ + return ctx->GetStats().connectGood_; +} + + +long SSL_CTX_sess_accept_renegotiate(SSL_CTX* ctx) +{ + return ctx->GetStats().acceptRenegotiate_; +} + + +long SSL_CTX_sess_connect_renegotiate(SSL_CTX* ctx) +{ + return ctx->GetStats().connectRenegotiate_; +} + + +long SSL_CTX_sess_hits(SSL_CTX* ctx) +{ + return ctx->GetStats().hits_; +} + + +long SSL_CTX_sess_cb_hits(SSL_CTX* ctx) +{ + return ctx->GetStats().cbHits_; +} + + +long SSL_CTX_sess_cache_full(SSL_CTX* ctx) +{ + return ctx->GetStats().cacheFull_; +} + + +long SSL_CTX_sess_misses(SSL_CTX* ctx) +{ + return ctx->GetStats().misses_; +} + + +long SSL_CTX_sess_timeouts(SSL_CTX* ctx) +{ + return ctx->GetStats().timeouts_; +} + + +long SSL_CTX_sess_number(SSL_CTX* ctx) +{ + return ctx->GetStats().number_; +} + + +long SSL_CTX_sess_get_cache_size(SSL_CTX* ctx) +{ + return ctx->GetStats().getCacheSize_; +} +// end session stats TODO: + + +int SSL_CTX_get_verify_mode(SSL_CTX* ctx) +{ + return ctx->GetStats().verifyMode_; +} + + +int SSL_get_verify_mode(SSL* ssl) +{ + return ssl->getSecurity().GetContext()->GetStats().verifyMode_; +} + + +int SSL_CTX_get_verify_depth(SSL_CTX* ctx) +{ + return ctx->GetStats().verifyDepth_; +} + + +int SSL_get_verify_depth(SSL* ssl) +{ + return ssl->getSecurity().GetContext()->GetStats().verifyDepth_; +} + + +long SSL_CTX_set_options(SSL_CTX*, long) +{ + // TDOD: + return SSL_SUCCESS; +} + + +void SSL_CTX_set_info_callback(SSL_CTX*, void (*)()) +{ + // TDOD: +} + + +void OpenSSL_add_all_algorithms() // compatibility only +{} + + +int SSL_library_init() // compatiblity only +{ + return 1; +} + + +DH* DH_new(void) +{ + DH* dh = NEW_YS DH; + if (dh) + dh->p = dh->g = 0; + return dh; +} + + +void DH_free(DH* dh) +{ + ysDelete(dh->g); + ysDelete(dh->p); + ysDelete(dh); +} + + +// convert positive big-endian num of length sz into retVal, which may need to +// be created +BIGNUM* BN_bin2bn(const unsigned char* num, int sz, BIGNUM* retVal) +{ + bool created = false; + mySTL::auto_ptr bn; + + if (!retVal) { + created = true; + bn.reset(NEW_YS BIGNUM); + retVal = bn.get(); + } + + retVal->assign(num, sz); + + if (created) + return bn.release(); + else + return retVal; +} + + +unsigned long ERR_get_error_line_data(const char**, int*, const char**, int *) +{ + //return SSL_NOT_IMPLEMENTED; + return 0; +} + + +void ERR_print_errors_fp(FILE* /*fp*/) +{ + // need ssl access to implement TODO: + //fprintf(fp, "%s", ssl.get_states().errorString_.c_str()); +} + + +char* ERR_error_string(unsigned long errNumber, char* buffer) +{ + static char* msg = (char*)"Please supply a buffer for error string"; + + if (buffer) { + SetErrorString(YasslError(errNumber), buffer); + return buffer; + } + + return msg; +} + + +const char* X509_verify_cert_error_string(long /* error */) +{ + // TODO: + static const char* msg = "Not Implemented"; + return msg; +} + + +const EVP_MD* EVP_md5(void) +{ + static const char* type = "MD5"; + return type; +} + + +const EVP_CIPHER* EVP_des_ede3_cbc(void) +{ + static const char* type = "DES-EDE3-CBC"; + return type; +} + + +int EVP_BytesToKey(const EVP_CIPHER* type, const EVP_MD* md, const byte* salt, + const byte* data, int sz, int count, byte* key, byte* iv) +{ + // only support MD5 for now + if (strncmp(md, "MD5", 3)) return 0; + + int keyLen = 0; + int ivLen = 0; + + // only support CBC DES and AES for now + if (strncmp(type, "DES-CBC", 7) == 0) { + keyLen = DES_KEY_SZ; + ivLen = DES_IV_SZ; + } + else if (strncmp(type, "DES-EDE3-CBC", 12) == 0) { + keyLen = DES_EDE_KEY_SZ; + ivLen = DES_IV_SZ; + } + else if (strncmp(type, "AES-128-CBC", 11) == 0) { + keyLen = AES_128_KEY_SZ; + ivLen = AES_IV_SZ; + } + else if (strncmp(type, "AES-192-CBC", 11) == 0) { + keyLen = AES_192_KEY_SZ; + ivLen = AES_IV_SZ; + } + else if (strncmp(type, "AES-256-CBC", 11) == 0) { + keyLen = AES_256_KEY_SZ; + ivLen = AES_IV_SZ; + } + else + return 0; + + yaSSL::MD5 myMD; + uint digestSz = myMD.get_digestSize(); + byte digest[SHA_LEN]; // max size + + int keyLeft = keyLen; + int ivLeft = ivLen; + int keyOutput = 0; + + while (keyOutput < (keyLen + ivLen)) { + int digestLeft = digestSz; + // D_(i - 1) + if (keyOutput) // first time D_0 is empty + myMD.update(digest, digestSz); + // data + myMD.update(data, sz); + // salt + if (salt) + myMD.update(salt, EVP_SALT_SZ); + myMD.get_digest(digest); + // count + for (int j = 1; j < count; j++) { + myMD.update(digest, digestSz); + myMD.get_digest(digest); + } + + if (keyLeft) { + int store = min(keyLeft, static_cast(digestSz)); + memcpy(&key[keyLen - keyLeft], digest, store); + + keyOutput += store; + keyLeft -= store; + digestLeft -= store; + } + + if (ivLeft && digestLeft) { + int store = min(ivLeft, digestLeft); + memcpy(&iv[ivLen - ivLeft], &digest[digestSz - digestLeft], store); + + keyOutput += store; + ivLeft -= store; + } + } + assert(keyOutput == (keyLen + ivLen)); + return keyOutput; +} + + + +void DES_set_key_unchecked(const_DES_cblock* key, DES_key_schedule* schedule) +{ + memcpy(schedule, key, sizeof(const_DES_cblock)); +} + + +void DES_ede3_cbc_encrypt(const byte* input, byte* output, long sz, + DES_key_schedule* ks1, DES_key_schedule* ks2, + DES_key_schedule* ks3, DES_cblock* ivec, int enc) +{ + DES_EDE des; + byte key[DES_EDE_KEY_SZ]; + + memcpy(key, *ks1, DES_BLOCK); + memcpy(&key[DES_BLOCK], *ks2, DES_BLOCK); + memcpy(&key[DES_BLOCK * 2], *ks3, DES_BLOCK); + + if (enc) { + des.set_encryptKey(key, *ivec); + des.encrypt(output, input, sz); + } + else { + des.set_decryptKey(key, *ivec); + des.decrypt(output, input, sz); + } +} + + +// functions for libcurl +int RAND_status() +{ + return 1; /* TaoCrypt provides enough seed */ +} + + +int DES_set_key(const_DES_cblock* key, DES_key_schedule* schedule) +{ + memcpy(schedule, key, sizeof(const_DES_cblock)); + return 1; +} + + +void DES_set_odd_parity(DES_cblock* key) +{ + // not needed now for TaoCrypt +} + + +void DES_ecb_encrypt(DES_cblock* input, DES_cblock* output, + DES_key_schedule* key, int enc) +{ + DES des; + + if (enc) { + des.set_encryptKey(*key, 0); + des.encrypt(*output, *input, DES_BLOCK); + } + else { + des.set_decryptKey(*key, 0); + des.decrypt(*output, *input, DES_BLOCK); + } +} + + +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX* ctx, void* userdata) +{ + ctx->SetUserData(userdata); +} + + +X509* SSL_get_certificate(SSL* ssl) +{ + // only used to pass to get_privatekey which isn't used + return 0; +} + + +EVP_PKEY* SSL_get_privatekey(SSL* ssl) +{ + // only called, not used + return 0; +} + + +void SSL_SESSION_free(SSL_SESSION* session) +{ + // managed by singleton +} + + + +EVP_PKEY* X509_get_pubkey(X509* x) +{ + // called, not used though + return 0; +} + + +int EVP_PKEY_copy_parameters(EVP_PKEY* to, const EVP_PKEY* from) +{ + // called, not used though + return 0; +} + + +void EVP_PKEY_free(EVP_PKEY* pkey) +{ + // never allocated from above +} + + +void ERR_error_string_n(unsigned long e, char *buf, size_t len) +{ + if (len) ERR_error_string(e, buf); +} + + +void ERR_free_strings(void) +{ + // handled internally +} + + +void EVP_cleanup(void) +{ + // nothing to do yet +} + + +ASN1_TIME* X509_get_notBefore(X509* x) +{ + if (x) return x->GetBefore(); + return 0; +} + + +ASN1_TIME* X509_get_notAfter(X509* x) +{ + if (x) return x->GetAfter(); + return 0; +} + + +SSL_METHOD* SSLv2_client_method(void) /* will never work, no v 2 */ +{ + return 0; +} + + +SSL_SESSION* SSL_get1_session(SSL* ssl) /* what's ref count */ +{ + return SSL_get_session(ssl); +} + + +void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *x) +{ + // no extension names supported yet +} + + +int sk_GENERAL_NAME_num(STACK_OF(GENERAL_NAME) *x) +{ + // no extension names supported yet + return 0; +} + + +GENERAL_NAME* sk_GENERAL_NAME_value(STACK_OF(GENERAL_NAME) *x, int i) +{ + // no extension names supported yet + return 0; +} + + +unsigned char* ASN1_STRING_data(ASN1_STRING* x) +{ + if (x) return x->data; + return 0; +} + + +int ASN1_STRING_length(ASN1_STRING* x) +{ + if (x) return x->length; + return 0; +} + + +int ASN1_STRING_type(ASN1_STRING *x) +{ + if (x) return x->type; + return 0; +} + + +int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos) +{ + int idx = -1; // not found + const char* start = &name->GetName()[lastpos + 1]; + + switch (nid) { + case NID_commonName: + const char* found = strstr(start, "/CN="); + if (found) { + found += 4; // advance to str + idx = found - start + lastpos + 1; + } + break; + } + + return idx; +} + + +ASN1_STRING* X509_NAME_ENTRY_get_data(X509_NAME_ENTRY* ne) +{ + // the same in yaSSL + return ne; +} + + +X509_NAME_ENTRY* X509_NAME_get_entry(X509_NAME* name, int loc) +{ + return name->GetEntry(loc); +} + + +// already formatted, caller responsible for freeing *out +int ASN1_STRING_to_UTF8(unsigned char** out, ASN1_STRING* in) +{ + if (!in) return 0; + + *out = (unsigned char*)malloc(in->length + 1); + if (*out) { + memcpy(*out, in->data, in->length); + (*out)[in->length] = 0; + } + return in->length; +} + + +void* X509_get_ext_d2i(X509* x, int nid, int* crit, int* idx) +{ + // no extensions supported yet + return 0; +} + + +void MD4_Init(MD4_CTX* md4) +{ + // make sure we have a big enough buffer + typedef char ok[sizeof(md4->buffer) >= sizeof(TaoCrypt::MD4) ? 1 : -1]; + (void) sizeof(ok); + + // using TaoCrypt since no dynamic memory allocated + // and no destructor will be called + new (reinterpret_cast(md4->buffer)) TaoCrypt::MD4(); +} + + +void MD4_Update(MD4_CTX* md4, const void* data, unsigned long sz) +{ + reinterpret_cast(md4->buffer)->Update( + static_cast(data), static_cast(sz)); +} + + +void MD4_Final(unsigned char* hash, MD4_CTX* md4) +{ + reinterpret_cast(md4->buffer)->Final(hash); +} + + +void MD5_Init(MD5_CTX* md5) +{ + // make sure we have a big enough buffer + typedef char ok[sizeof(md5->buffer) >= sizeof(TaoCrypt::MD5) ? 1 : -1]; + (void) sizeof(ok); + + // using TaoCrypt since no dynamic memory allocated + // and no destructor will be called + new (reinterpret_cast(md5->buffer)) TaoCrypt::MD5(); +} + + +void MD5_Update(MD5_CTX* md5, const void* data, unsigned long sz) +{ + reinterpret_cast(md5->buffer)->Update( + static_cast(data), static_cast(sz)); +} + + +void MD5_Final(unsigned char* hash, MD5_CTX* md5) +{ + reinterpret_cast(md5->buffer)->Final(hash); +} + + +int RAND_bytes(unsigned char* buf, int num) +{ + RandomPool ran; + + if (ran.GetError()) return 0; + + ran.Fill(buf, num); + return 1; +} + + +int SSL_peek(SSL* ssl, void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast(buffer)); + return receiveData(*ssl, data, true); +} + + +int SSL_pending(SSL* ssl) +{ + // Just in case there's pending data that hasn't been processed yet... + char c; + SSL_peek(ssl, &c, 1); + + return ssl->bufferedData(); +} + + +void SSL_CTX_set_default_passwd_cb(SSL_CTX* ctx, pem_password_cb cb) +{ + ctx->SetPasswordCb(cb); +} + + +int SSLeay_add_ssl_algorithms() // compatibility only +{ + return 1; +} + + +void ERR_remove_state(unsigned long) +{ + GetErrors().Remove(); +} + + +int ERR_GET_REASON(int l) +{ + return l & 0xfff; +} + + +unsigned long err_helper(bool peek = false) +{ + int ysError = GetErrors().Lookup(peek); + + // translate cert error for libcurl, it uses OpenSSL hex code + switch (ysError) { + case TaoCrypt::SIG_OTHER_E: + return CERTFICATE_ERROR; + break; + default : + return 0; + } + + return 0; // shut up compiler +} + + +unsigned long ERR_peek_error() +{ + return err_helper(true); +} + + +unsigned long ERR_get_error() +{ + return err_helper(); +} + + + // functions for stunnel + + void RAND_screen() + { + // TODO: + } + + + const char* RAND_file_name(char*, size_t) + { + // TODO: + return 0; + } + + + int RAND_write_file(const char*) + { + // TODO: + return 0; + } + + + int RAND_load_file(const char*, long) + { + // TODO: + return 0; + } + + + void RSA_free(RSA*) + { + // TODO: + } + + + RSA* RSA_generate_key(int, unsigned long, void(*)(int, int, void*), void*) + { + // TODO: + return 0; + } + + + int X509_LOOKUP_add_dir(X509_LOOKUP*, const char*, long) + { + // TODO: + return SSL_SUCCESS; + } + + + int X509_LOOKUP_load_file(X509_LOOKUP*, const char*, long) + { + // TODO: + return SSL_SUCCESS; + } + + + X509_LOOKUP_METHOD* X509_LOOKUP_hash_dir(void) + { + // TODO: + return 0; + } + + + X509_LOOKUP_METHOD* X509_LOOKUP_file(void) + { + // TODO: + return 0; + } + + + X509_LOOKUP* X509_STORE_add_lookup(X509_STORE*, X509_LOOKUP_METHOD*) + { + // TODO: + return 0; + } + + + int X509_STORE_get_by_subject(X509_STORE_CTX*, int, X509_NAME*, X509_OBJECT*) + { + // TODO: + return SSL_SUCCESS; + } + + + X509_STORE* X509_STORE_new(void) + { + // TODO: + return 0; + } + + char* SSL_alert_type_string_long(int) + { + // TODO: + return 0; + } + + + char* SSL_alert_desc_string_long(int) + { + // TODO: + return 0; + } + + + char* SSL_state_string_long(SSL*) + { + // TODO: + return 0; + } + + + void SSL_CTX_set_tmp_rsa_callback(SSL_CTX*, RSA*(*)(SSL*, int, int)) + { + // TDOD: + } + + + long SSL_CTX_set_timeout(SSL_CTX*, long) + { + // TDOD: + return SSL_SUCCESS; + } + + + int SSL_CTX_use_certificate_chain_file(SSL_CTX*, const char*) + { + // TDOD: + return SSL_SUCCESS; + } + + + int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX*, const char*, int) + { + // TDOD: + return SSL_SUCCESS; + } + + + int SSL_set_rfd(SSL*, int) + { + return SSL_SUCCESS; // TODO: + } + + + int SSL_set_wfd(SSL*, int) + { + return SSL_SUCCESS; // TODO: + } + + + int SSL_want_read(SSL*) + { + return 0; // TODO: + } + + + int SSL_want_write(SSL*) + { + return 0; // TODO: + } + + + void SSL_set_shutdown(SSL*, int) + { + // TODO: + } + + + SSL_CIPHER* SSL_get_current_cipher(SSL*) + { + // TODO: + return 0; + } + + + char* SSL_CIPHER_description(SSL_CIPHER*, char*, int) + { + // TODO: + return 0; + } + + + + // end stunnel needs + + +} // extern "C" +} // namespace diff --git a/externals/mysql/extlib/yassl/src/template_instnt.cpp b/externals/mysql/extlib/yassl/src/template_instnt.cpp new file mode 100644 index 00000000000..fe3a251b865 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/template_instnt.cpp @@ -0,0 +1,110 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* Explicit template instantiation requests + */ + + +#include "runtime.hpp" +#include "handshake.hpp" +#include "yassl_int.hpp" +#include "crypto_wrapper.hpp" +#include "hmac.hpp" +#include "md5.hpp" +#include "sha.hpp" +#include "ripemd.hpp" +#include "openssl/ssl.h" + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION + +namespace mySTL { +template class list; +template yaSSL::del_ptr_zero for_each(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template pair* uninit_copy*, mySTL::pair*>(mySTL::pair*, mySTL::pair*, mySTL::pair*); +template pair* uninit_copy*, mySTL::pair*>(mySTL::pair*, mySTL::pair*, mySTL::pair*); +template void destroy*>(mySTL::pair*, mySTL::pair*); +template void destroy*>(mySTL::pair*, mySTL::pair*); +template pair* uninit_copy*, mySTL::pair*>(mySTL::pair*, mySTL::pair*, mySTL::pair*); +template void destroy*>(mySTL::pair*, mySTL::pair*); +template pair* uninit_copy*, mySTL::pair*>(mySTL::pair*, mySTL::pair*, mySTL::pair*); +template class list; +template class list; +template class list; +template class list; +template class list; +template class list; +template class list; +template void destroy*>(mySTL::pair*, mySTL::pair*); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template yaSSL::del_ptr_zero for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +template bool list::erase(list::iterator); +template void list::push_back(yaSSL::ThreadError); +template void list::pop_front(); +template void list::pop_back(); +template list::~list(); +template pair* GetArrayMemory >(size_t); +template void FreeArrayMemory >(pair*); +template pair* GetArrayMemory >(size_t); +template void FreeArrayMemory >(pair*); +template pair* GetArrayMemory >(size_t); +template void FreeArrayMemory >(pair*); +template pair* GetArrayMemory >(size_t); +template void FreeArrayMemory >(pair*); +} + +namespace yaSSL { +template void ysDelete(yaSSL::SSL_CTX*); +template void ysDelete(yaSSL::SSL*); +template void ysDelete(yaSSL::BIGNUM*); +template void ysDelete(unsigned char*); +template void ysDelete(yaSSL::DH*); +template void ysDelete(TaoCrypt::Signer*); +template void ysDelete(yaSSL::SSL_SESSION*); +template void ysDelete(input_buffer*); +template void ysDelete(output_buffer*); +template void ysDelete(x509*); +template void ysDelete(Auth*); +template void ysDelete(HandShakeBase*); +template void ysDelete(ServerKeyBase*); +template void ysDelete(ClientKeyBase*); +template void ysDelete(SSL_METHOD*); +template void ysDelete(DiffieHellman*); +template void ysDelete(BulkCipher*); +template void ysDelete(Digest*); +template void ysDelete(X509*); +template void ysDelete(Message*); +template void ysDelete(sslFactory*); +template void ysDelete(Sessions*); +template void ysDelete(Errors*); +template void ysArrayDelete(unsigned char*); +template void ysArrayDelete(char*); + +template int min(int, int); +template uint16 min(uint16, uint16); +template unsigned int min(unsigned int, unsigned int); +template unsigned long min(unsigned long, unsigned long); +} + +#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION + diff --git a/externals/mysql/extlib/yassl/src/timer.cpp b/externals/mysql/extlib/yassl/src/timer.cpp new file mode 100644 index 00000000000..c1286b0724c --- /dev/null +++ b/externals/mysql/extlib/yassl/src/timer.cpp @@ -0,0 +1,81 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* timer.cpp implements a high res and low res timer + * +*/ + +#include "runtime.hpp" +#include "timer.hpp" + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#else +#include +#endif + +namespace yaSSL { + +#ifdef _WIN32 + + timer_d timer() + { + static bool init(false); + static LARGE_INTEGER freq; + + if (!init) { + QueryPerformanceFrequency(&freq); + init = true; + } + + LARGE_INTEGER count; + QueryPerformanceCounter(&count); + + return static_cast(count.QuadPart) / freq.QuadPart; + } + + + uint lowResTimer() + { + return static_cast(timer()); + } + +#else // _WIN32 + + timer_d timer() + { + struct timeval tv; + gettimeofday(&tv, 0); + + return static_cast(tv.tv_sec) + + static_cast(tv.tv_usec) / 1000000; + } + + + uint lowResTimer() + { + struct timeval tv; + gettimeofday(&tv, 0); + + return tv.tv_sec; + } + + +#endif // _WIN32 +} // namespace yaSSL diff --git a/externals/mysql/extlib/yassl/src/yassl.cpp b/externals/mysql/extlib/yassl/src/yassl.cpp new file mode 100644 index 00000000000..815277ce6f3 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/yassl.cpp @@ -0,0 +1,229 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL implements external API + */ + +#include "runtime.hpp" +#include "yassl.hpp" +#include "yassl_int.hpp" +#include "handshake.hpp" +#include + +#include "openssl/ssl.h" // get rid of this + + + +namespace yaSSL { + + + +struct Base { + SSL_METHOD* method_; + SSL_CTX* ctx_; + SSL* ssl_; + + char* ca_; + char* cert_; + char* key_; + + DH* dh_; + + Base() : method_(0), ctx_(0), ssl_(0), ca_(0), cert_(0), key_(0), dh_(0) + {} + + ~Base() + { + if (dh_) DH_free(dh_); + delete[] key_; + delete[] cert_; + delete[] ca_; + SSL_CTX_free(ctx_); // frees method_ too + SSL_free(ssl_); + } +}; + + +void SetDH(Base&); + +void SetUpBase(Base& base, ConnectionEnd end, SOCKET_T s) +{ + base.method_ = new SSL_METHOD(end, ProtocolVersion(3,1)); + base.ctx_ = new SSL_CTX(base.method_); + + if (base.ca_) + if (SSL_CTX_load_verify_locations(base.ctx_, + base.ca_, 0) != SSL_SUCCESS) assert(0); + if (base.cert_) + if (SSL_CTX_use_certificate_file(base.ctx_, + base.cert_, SSL_FILETYPE_PEM) != SSL_SUCCESS) assert(0); + if (base.key_) + if (SSL_CTX_use_PrivateKey_file(base.ctx_, base.key_, + SSL_FILETYPE_PEM) != SSL_SUCCESS) assert(0); + + if (end == server_end) SetDH(base); + + base.ssl_ = new SSL(base.ctx_); + base.ssl_->useSocket().set_fd(s); +} + + +void SetDH(Base& base) +{ + static unsigned char dh512_p[] = + { + 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75, + 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F, + 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3, + 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12, + 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C, + 0x47,0x74,0xE8,0x33, + }; + + static unsigned char dh512_g[] = + { + 0x02, + }; + + if ( (base.dh_ = DH_new()) ) { + base.dh_->p = BN_bin2bn(dh512_p, sizeof(dh512_p), 0); + base.dh_->g = BN_bin2bn(dh512_g, sizeof(dh512_g), 0); + } + if (!base.dh_->p || !base.dh_->g) { + DH_free(base.dh_); + base.dh_ = 0; + } + SSL_CTX_set_tmp_dh(base.ctx_, base.dh_); +} + + +void NewCopy(char*& dst, const char* src) +{ + size_t len = strlen(src) + 1; + dst = new char[len]; + + strncpy(dst, src, len); +} + + +// Client Implementation +struct Client::ClientImpl { + Base base_; +}; + + +Client::Client() : pimpl_(new ClientImpl) +{} + + +Client::~Client() { delete pimpl_; } + + +int Client::Connect(SOCKET_T s) +{ + SetUpBase(pimpl_->base_, client_end, s); + return SSL_connect(pimpl_->base_.ssl_); +} + + +int Client::Write(const void* buffer, int sz) +{ + return sendData(*pimpl_->base_.ssl_, buffer, sz); +} + + +int Client::Read(void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast(buffer)); + return receiveData(*pimpl_->base_.ssl_, data); +} + + +void Client::SetCA(const char* name) +{ + NewCopy(pimpl_->base_.ca_, name); +} + + +void Client::SetCert(const char* name) +{ + NewCopy(pimpl_->base_.cert_, name); +} + + +void Client::SetKey(const char* name) +{ + NewCopy(pimpl_->base_.key_, name); +} + + + +// Server Implementation +struct Server::ServerImpl { + Base base_; +}; + + +Server::Server() : pimpl_(new ServerImpl) +{} + + +Server::~Server() { delete pimpl_; } + + +int Server::Accept(SOCKET_T s) +{ + SetUpBase(pimpl_->base_, server_end, s); + return SSL_accept(pimpl_->base_.ssl_); +} + + +int Server::Write(const void* buffer, int sz) +{ + return sendData(*pimpl_->base_.ssl_, buffer, sz); +} + + +int Server::Read(void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast(buffer)); + return receiveData(*pimpl_->base_.ssl_, data); +} + + +void Server::SetCA(const char* name) +{ + NewCopy(pimpl_->base_.ca_, name); +} + + +void Server::SetCert(const char* name) +{ + NewCopy(pimpl_->base_.cert_, name); +} + + +void Server::SetKey(const char* name) +{ + NewCopy(pimpl_->base_.key_, name); +} + + + +} // namespace yaSSL diff --git a/externals/mysql/extlib/yassl/src/yassl_error.cpp b/externals/mysql/extlib/yassl/src/yassl_error.cpp new file mode 100644 index 00000000000..a1ef8578da6 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/yassl_error.cpp @@ -0,0 +1,275 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL error implements and an exception class + */ + +#include "runtime.hpp" +#include "yassl_error.hpp" +#include "error.hpp" // TaoCrypt error numbers +#include "openssl/ssl.h" // SSL_ERROR_WANT_READ +#include // strncpy + +#ifdef _MSC_VER + // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy + #pragma warning(disable: 4996) +#endif + +namespace yaSSL { + + +/* may bring back in future +Error::Error(const char* s, YasslError e, Library l) + : mySTL::runtime_error(s), error_(e), lib_(l) +{ +} + + +YasslError Error::get_number() const +{ + return error_; +} + + +Library Error::get_lib() const +{ + + return lib_; +} +*/ + + +void SetErrorString(YasslError error, char* buffer) +{ + using namespace TaoCrypt; + const int max = MAX_ERROR_SZ; // shorthand + + switch (error) { + + // yaSSL proper errors + case range_error : + strncpy(buffer, "buffer index error, out of range", max); + break; + + case realloc_error : + strncpy(buffer, "trying to realloc a fixed buffer", max); + break; + + case factory_error : + strncpy(buffer, "unknown factory create request", max); + break; + + case unknown_cipher : + strncpy(buffer, "trying to use an unknown cipher", max); + break; + + case prefix_error : + strncpy(buffer, "bad master secret derivation, prefix too big", max); + break; + + case record_layer : + strncpy(buffer, "record layer not ready yet", max); + break; + + case handshake_layer : + strncpy(buffer, "handshake layer not ready yet", max); + break; + + case out_of_order : + strncpy(buffer, "handshake message received in wrong order", max); + break; + + case bad_input : + strncpy(buffer, "bad cipher suite input", max); + break; + + case match_error : + strncpy(buffer, "unable to match a supported cipher suite", max); + break; + + case no_key_file : + strncpy(buffer, "the server needs a private key file", max); + break; + + case verify_error : + strncpy(buffer, "unable to verify peer checksum", max); + break; + + case send_error : + strncpy(buffer, "socket layer send error", max); + break; + + case receive_error : + strncpy(buffer, "socket layer receive error", max); + break; + + case certificate_error : + strncpy(buffer, "unable to proccess cerificate", max); + break; + + case privateKey_error : + strncpy(buffer, "unable to proccess private key, bad format", max); + break; + + case badVersion_error : + strncpy(buffer, "protocl version mismatch", max); + break; + + case compress_error : + strncpy(buffer, "compression error", max); + break; + + case decompress_error : + strncpy(buffer, "decompression error", max); + break; + + case pms_version_error : + strncpy(buffer, "bad PreMasterSecret version error", max); + break; + + // openssl errors + case SSL_ERROR_WANT_READ : + strncpy(buffer, "the read operation would block", max); + break; + + case CERTFICATE_ERROR : + strncpy(buffer, "Unable to verify certificate", max); + break; + + // TaoCrypt errors + case NO_ERROR_E : + strncpy(buffer, "not in error state", max); + break; + + case WINCRYPT_E : + strncpy(buffer, "bad wincrypt acquire", max); + break; + + case CRYPTGEN_E : + strncpy(buffer, "CryptGenRandom error", max); + break; + + case OPEN_RAN_E : + strncpy(buffer, "unable to use random device", max); + break; + + case READ_RAN_E : + strncpy(buffer, "unable to use random device", max); + break; + + case INTEGER_E : + strncpy(buffer, "ASN: bad DER Integer Header", max); + break; + + case SEQUENCE_E : + strncpy(buffer, "ASN: bad Sequence Header", max); + break; + + case SET_E : + strncpy(buffer, "ASN: bad Set Header", max); + break; + + case VERSION_E : + strncpy(buffer, "ASN: version length not 1", max); + break; + + case SIG_OID_E : + strncpy(buffer, "ASN: signature OID mismatch", max); + break; + + case BIT_STR_E : + strncpy(buffer, "ASN: bad BitString Header", max); + break; + + case UNKNOWN_OID_E : + strncpy(buffer, "ASN: unknown key OID type", max); + break; + + case OBJECT_ID_E : + strncpy(buffer, "ASN: bad Ojbect ID Header", max); + break; + + case TAG_NULL_E : + strncpy(buffer, "ASN: expected TAG NULL", max); + break; + + case EXPECT_0_E : + strncpy(buffer, "ASN: expected 0", max); + break; + + case OCTET_STR_E : + strncpy(buffer, "ASN: bad Octet String Header", max); + break; + + case TIME_E : + strncpy(buffer, "ASN: bad TIME", max); + break; + + case DATE_SZ_E : + strncpy(buffer, "ASN: bad Date Size", max); + break; + + case SIG_LEN_E : + strncpy(buffer, "ASN: bad Signature Length", max); + break; + + case UNKOWN_SIG_E : + strncpy(buffer, "ASN: unknown signature OID", max); + break; + + case UNKOWN_HASH_E : + strncpy(buffer, "ASN: unknown hash OID", max); + break; + + case DSA_SZ_E : + strncpy(buffer, "ASN: bad DSA r or s size", max); + break; + + case BEFORE_DATE_E : + strncpy(buffer, "ASN: before date in the future", max); + break; + + case AFTER_DATE_E : + strncpy(buffer, "ASN: after date in the past", max); + break; + + case SIG_CONFIRM_E : + strncpy(buffer, "ASN: bad self signature confirmation", max); + break; + + case SIG_OTHER_E : + strncpy(buffer, "ASN: bad other signature confirmation", max); + break; + + case CONTENT_E : + strncpy(buffer, "bad content processing", max); + break; + + case PEM_E : + strncpy(buffer, "bad PEM format processing", max); + break; + + default : + strncpy(buffer, "unknown error number", max); + } +} + + + +} // namespace yaSSL diff --git a/externals/mysql/extlib/yassl/src/yassl_imp.cpp b/externals/mysql/extlib/yassl/src/yassl_imp.cpp new file mode 100644 index 00000000000..20dfe50f132 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/yassl_imp.cpp @@ -0,0 +1,2287 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* yaSSL source implements all SSL.v3 secification structures. + */ + +#include "runtime.hpp" +#include "yassl_int.hpp" +#include "handshake.hpp" + +#include "asn.hpp" // provide crypto wrapper?? + + + +namespace yaSSL { + + +namespace { // locals + +bool isTLS(ProtocolVersion pv) +{ + if (pv.major_ >= 3 && pv.minor_ >= 1) + return true; + + return false; +} + + +} // namespace (locals) + + +void hashHandShake(SSL&, const input_buffer&, uint); + + +ProtocolVersion::ProtocolVersion(uint8 maj, uint8 min) + : major_(maj), minor_(min) +{} + + +// construct key exchange with known ssl parms +void ClientKeyExchange::createKey(SSL& ssl) +{ + const ClientKeyFactory& ckf = ssl.getFactory().getClientKey(); + client_key_ = ckf.CreateObject(ssl.getSecurity().get_parms().kea_); + + if (!client_key_) + ssl.SetError(factory_error); +} + + +// construct key exchange with known ssl parms +void ServerKeyExchange::createKey(SSL& ssl) +{ + const ServerKeyFactory& skf = ssl.getFactory().getServerKey(); + server_key_ = skf.CreateObject(ssl.getSecurity().get_parms().kea_); + + if (!server_key_) + ssl.SetError(factory_error); +} + + +// build/set PreMaster secret and encrypt, client side +void EncryptedPreMasterSecret::build(SSL& ssl) +{ + opaque tmp[SECRET_LEN]; + memset(tmp, 0, sizeof(tmp)); + ssl.getCrypto().get_random().Fill(tmp, SECRET_LEN); + ProtocolVersion pv = ssl.getSecurity().get_connection().chVersion_; + tmp[0] = pv.major_; + tmp[1] = pv.minor_; + ssl.set_preMaster(tmp, SECRET_LEN); + + const CertManager& cert = ssl.getCrypto().get_certManager(); + RSA rsa(cert.get_peerKey(), cert.get_peerKeyLength()); + bool tls = ssl.isTLS(); // if TLS, put length for encrypted data + alloc(rsa.get_cipherLength() + (tls ? 2 : 0)); + byte* holder = secret_; + if (tls) { + byte len[2]; + c16toa(rsa.get_cipherLength(), len); + memcpy(secret_, len, sizeof(len)); + holder += 2; + } + rsa.encrypt(holder, tmp, SECRET_LEN, ssl.getCrypto().get_random()); +} + + +// build/set premaster and Client Public key, client side +void ClientDiffieHellmanPublic::build(SSL& ssl) +{ + DiffieHellman& dhServer = ssl.useCrypto().use_dh(); + DiffieHellman dhClient(dhServer); + + uint keyLength = dhClient.get_agreedKeyLength(); // pub and agree same + + alloc(keyLength, true); + dhClient.makeAgreement(dhServer.get_publicKey(), keyLength); + c16toa(keyLength, Yc_); + memcpy(Yc_ + KEY_OFFSET, dhClient.get_publicKey(), keyLength); + + // because of encoding first byte might be zero, don't use it for preMaster + if (*dhClient.get_agreedKey() == 0) + ssl.set_preMaster(dhClient.get_agreedKey() + 1, keyLength - 1); + else + ssl.set_preMaster(dhClient.get_agreedKey(), keyLength); +} + + +// build server exhange, server side +void DH_Server::build(SSL& ssl) +{ + DiffieHellman& dhServer = ssl.useCrypto().use_dh(); + + int pSz, gSz, pubSz; + dhServer.set_sizes(pSz, gSz, pubSz); + dhServer.get_parms(parms_.alloc_p(pSz), parms_.alloc_g(gSz), + parms_.alloc_pub(pubSz)); + + short sigSz = 0; + mySTL::auto_ptr auth; + const CertManager& cert = ssl.getCrypto().get_certManager(); + + if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) + { + if (cert.get_keyType() != rsa_sa_algo) { + ssl.SetError(privateKey_error); + return; + } + auth.reset(NEW_YS RSA(cert.get_privateKey(), + cert.get_privateKeyLength(), false)); + } + else { + if (cert.get_keyType() != dsa_sa_algo) { + ssl.SetError(privateKey_error); + return; + } + auth.reset(NEW_YS DSS(cert.get_privateKey(), + cert.get_privateKeyLength(), false)); + sigSz += DSS_ENCODED_EXTRA; + } + + sigSz += auth->get_signatureLength(); + if (!sigSz) { + ssl.SetError(privateKey_error); + return; + } + + length_ = 8; // pLen + gLen + YsLen + SigLen + length_ += pSz + gSz + pubSz + sigSz; + + output_buffer tmp(length_); + byte len[2]; + // P + c16toa(pSz, len); + tmp.write(len, sizeof(len)); + tmp.write(parms_.get_p(), pSz); + // G + c16toa(gSz, len); + tmp.write(len, sizeof(len)); + tmp.write(parms_.get_g(), gSz); + // Ys + c16toa(pubSz, len); + tmp.write(len, sizeof(len)); + tmp.write(parms_.get_pub(), pubSz); + + // Sig + byte hash[FINISHED_SZ]; + MD5 md5; + SHA sha; + signature_ = NEW_YS byte[sigSz]; + + const Connection& conn = ssl.getSecurity().get_connection(); + // md5 + md5.update(conn.client_random_, RAN_LEN); + md5.update(conn.server_random_, RAN_LEN); + md5.update(tmp.get_buffer(), tmp.get_size()); + md5.get_digest(hash); + + // sha + sha.update(conn.client_random_, RAN_LEN); + sha.update(conn.server_random_, RAN_LEN); + sha.update(tmp.get_buffer(), tmp.get_size()); + sha.get_digest(&hash[MD5_LEN]); + + if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) + auth->sign(signature_, hash, sizeof(hash), + ssl.getCrypto().get_random()); + else { + auth->sign(signature_, &hash[MD5_LEN], SHA_LEN, + ssl.getCrypto().get_random()); + byte encoded[DSS_SIG_SZ + DSS_ENCODED_EXTRA]; + TaoCrypt::EncodeDSA_Signature(signature_, encoded); + memcpy(signature_, encoded, sizeof(encoded)); + } + + c16toa(sigSz, len); + tmp.write(len, sizeof(len)); + tmp.write(signature_, sigSz); + + // key message + keyMessage_ = NEW_YS opaque[length_]; + memcpy(keyMessage_, tmp.get_buffer(), tmp.get_size()); +} + + +// read PreMaster secret and decrypt, server side +void EncryptedPreMasterSecret::read(SSL& ssl, input_buffer& input) +{ + const CertManager& cert = ssl.getCrypto().get_certManager(); + RSA rsa(cert.get_privateKey(), cert.get_privateKeyLength(), false); + uint16 cipherLen = rsa.get_cipherLength(); + if (ssl.isTLS()) { + byte len[2]; + input.read(len, sizeof(len)); + ato16(len, cipherLen); + } + alloc(cipherLen); + input.read(secret_, length_); + + opaque preMasterSecret[SECRET_LEN]; + rsa.decrypt(preMasterSecret, secret_, length_, + ssl.getCrypto().get_random()); + + ProtocolVersion pv = ssl.getSecurity().get_connection().chVersion_; + if (pv.major_ != preMasterSecret[0] || pv.minor_ != preMasterSecret[1]) + ssl.SetError(pms_version_error); // continue deriving for timing attack + + ssl.set_preMaster(preMasterSecret, SECRET_LEN); + ssl.makeMasterSecret(); +} + + +EncryptedPreMasterSecret::EncryptedPreMasterSecret() + : secret_(0), length_(0) +{} + + +EncryptedPreMasterSecret::~EncryptedPreMasterSecret() +{ + ysArrayDelete(secret_); +} + + +int EncryptedPreMasterSecret::get_length() const +{ + return length_; +} + + +opaque* EncryptedPreMasterSecret::get_clientKey() const +{ + return secret_; +} + + +void EncryptedPreMasterSecret::alloc(int sz) +{ + length_ = sz; + secret_ = NEW_YS opaque[sz]; +} + + +// read client's public key, server side +void ClientDiffieHellmanPublic::read(SSL& ssl, input_buffer& input) +{ + DiffieHellman& dh = ssl.useCrypto().use_dh(); + + uint16 keyLength; + byte tmp[2]; + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, keyLength); + + alloc(keyLength); + input.read(Yc_, keyLength); + dh.makeAgreement(Yc_, keyLength); + + // because of encoding, first byte might be 0, don't use for preMaster + if (*dh.get_agreedKey() == 0) + ssl.set_preMaster(dh.get_agreedKey() + 1, dh.get_agreedKeyLength() - 1); + else + ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength()); + ssl.makeMasterSecret(); +} + + +ClientDiffieHellmanPublic::ClientDiffieHellmanPublic() + : length_(0), Yc_(0) +{} + + +ClientDiffieHellmanPublic::~ClientDiffieHellmanPublic() +{ + ysArrayDelete(Yc_); +} + + +int ClientDiffieHellmanPublic::get_length() const +{ + return length_; +} + + +opaque* ClientDiffieHellmanPublic::get_clientKey() const +{ + return Yc_; +} + + +void ClientDiffieHellmanPublic::alloc(int sz, bool offset) +{ + length_ = sz + (offset ? KEY_OFFSET : 0); + Yc_ = NEW_YS opaque[length_]; +} + + +// read server's p, g, public key and sig, client side +void DH_Server::read(SSL& ssl, input_buffer& input) +{ + uint16 length, messageTotal = 6; // pSz + gSz + pubSz + byte tmp[2]; + + // p + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, length); + messageTotal += length; + + input.read(parms_.alloc_p(length), length); + + // g + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, length); + messageTotal += length; + + input.read(parms_.alloc_g(length), length); + + // pub + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, length); + messageTotal += length; + + input.read(parms_.alloc_pub(length), length); + + // save message for hash verify + input_buffer message(messageTotal); + input.set_current(input.get_current() - messageTotal); + input.read(message.get_buffer(), messageTotal); + message.add_size(messageTotal); + + // signature + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, length); + + signature_ = NEW_YS byte[length]; + input.read(signature_, length); + + // verify signature + byte hash[FINISHED_SZ]; + MD5 md5; + SHA sha; + + const Connection& conn = ssl.getSecurity().get_connection(); + // md5 + md5.update(conn.client_random_, RAN_LEN); + md5.update(conn.server_random_, RAN_LEN); + md5.update(message.get_buffer(), message.get_size()); + md5.get_digest(hash); + + // sha + sha.update(conn.client_random_, RAN_LEN); + sha.update(conn.server_random_, RAN_LEN); + sha.update(message.get_buffer(), message.get_size()); + sha.get_digest(&hash[MD5_LEN]); + + const CertManager& cert = ssl.getCrypto().get_certManager(); + + if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) { + RSA rsa(cert.get_peerKey(), cert.get_peerKeyLength()); + if (!rsa.verify(hash, sizeof(hash), signature_, length)) + ssl.SetError(verify_error); + } + else { + byte decodedSig[DSS_SIG_SZ]; + length = TaoCrypt::DecodeDSA_Signature(decodedSig, signature_, length); + + DSS dss(cert.get_peerKey(), cert.get_peerKeyLength()); + if (!dss.verify(&hash[MD5_LEN], SHA_LEN, decodedSig, length)) + ssl.SetError(verify_error); + } + + // save input + ssl.useCrypto().SetDH(NEW_YS DiffieHellman(parms_.get_p(), + parms_.get_pSize(), parms_.get_g(), parms_.get_gSize(), + parms_.get_pub(), parms_.get_pubSize(), + ssl.getCrypto().get_random())); +} + + +DH_Server::DH_Server() + : signature_(0), length_(0), keyMessage_(0) +{} + + +DH_Server::~DH_Server() +{ + ysArrayDelete(keyMessage_); + ysArrayDelete(signature_); +} + + +int DH_Server::get_length() const +{ + return length_; +} + + +opaque* DH_Server::get_serverKey() const +{ + return keyMessage_; +} + + +// set available suites +Parameters::Parameters(ConnectionEnd ce, const Ciphers& ciphers, + ProtocolVersion pv, bool haveDH) : entity_(ce) +{ + pending_ = true; // suite not set yet + strncpy(cipher_name_, "NONE", 5); + + removeDH_ = !haveDH; // only use on server side for set suites + + if (ciphers.setSuites_) { // use user set list + suites_size_ = ciphers.suiteSz_; + memcpy(suites_, ciphers.suites_, ciphers.suiteSz_); + SetCipherNames(); + } + else + SetSuites(pv, ce == server_end && removeDH_); // defaults + +} + + +void Parameters::SetSuites(ProtocolVersion pv, bool removeDH, bool removeRSA, + bool removeDSA) +{ + int i = 0; + // available suites, best first + // when adding more, make sure cipher_names is updated and + // MAX_CIPHERS is big enough + + if (isTLS(pv)) { + if (!removeDH) { + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_RSA_WITH_AES_256_CBC_SHA; + } + if (!removeDSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_DSS_WITH_AES_256_CBC_SHA; + } + } + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_RSA_WITH_AES_256_CBC_SHA; + } + if (!removeDH) { + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_RSA_WITH_AES_128_CBC_SHA; + } + if (!removeDSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_DSS_WITH_AES_128_CBC_SHA; + } + } + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_RSA_WITH_AES_128_CBC_SHA; + suites_[i++] = 0x00; + suites_[i++] = TLS_RSA_WITH_AES_256_CBC_RMD160; + suites_[i++] = 0x00; + suites_[i++] = TLS_RSA_WITH_AES_128_CBC_RMD160; + suites_[i++] = 0x00; + suites_[i++] = TLS_RSA_WITH_3DES_EDE_CBC_RMD160; + } + if (!removeDH) { + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_RSA_WITH_AES_256_CBC_RMD160; + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_RSA_WITH_AES_128_CBC_RMD160; + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160; + } + if (!removeDSA) { + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_DSS_WITH_AES_256_CBC_RMD160; + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_DSS_WITH_AES_128_CBC_RMD160; + suites_[i++] = 0x00; + suites_[i++] = TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160; + } + } + } + + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = SSL_RSA_WITH_RC4_128_SHA; + suites_[i++] = 0x00; + suites_[i++] = SSL_RSA_WITH_RC4_128_MD5; + + suites_[i++] = 0x00; + suites_[i++] = SSL_RSA_WITH_3DES_EDE_CBC_SHA; + suites_[i++] = 0x00; + suites_[i++] = SSL_RSA_WITH_DES_CBC_SHA; + } + if (!removeDH) { + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA; + } + if (!removeDSA) { + suites_[i++] = 0x00; + suites_[i++] = SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA; + } + if (!removeRSA) { + suites_[i++] = 0x00; + suites_[i++] = SSL_DHE_RSA_WITH_DES_CBC_SHA; + } + if (!removeDSA) { + suites_[i++] = 0x00; + suites_[i++] = SSL_DHE_DSS_WITH_DES_CBC_SHA; + } + } + + suites_size_ = i; + + SetCipherNames(); +} + + +void Parameters::SetCipherNames() +{ + const int suites = suites_size_ / 2; + int pos = 0; + + for (int j = 0; j < suites; j++) { + int index = suites_[j*2 + 1]; // every other suite is suite id + size_t len = strlen(cipher_names[index]) + 1; + strncpy(cipher_list_[pos++], cipher_names[index], len); + } + cipher_list_[pos][0] = 0; +} + + +// input operator for RecordLayerHeader, adjust stream +input_buffer& operator>>(input_buffer& input, RecordLayerHeader& hdr) +{ + hdr.type_ = ContentType(input[AUTO]); + hdr.version_.major_ = input[AUTO]; + hdr.version_.minor_ = input[AUTO]; + + // length + byte tmp[2]; + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, hdr.length_); + + return input; +} + + +// output operator for RecordLayerHeader +output_buffer& operator<<(output_buffer& output, const RecordLayerHeader& hdr) +{ + output[AUTO] = hdr.type_; + output[AUTO] = hdr.version_.major_; + output[AUTO] = hdr.version_.minor_; + + // length + byte tmp[2]; + c16toa(hdr.length_, tmp); + output[AUTO] = tmp[0]; + output[AUTO] = tmp[1]; + + return output; +} + + +// virtual input operator for Messages +input_buffer& operator>>(input_buffer& input, Message& msg) +{ + return msg.set(input); +} + +// virtual output operator for Messages +output_buffer& operator<<(output_buffer& output, const Message& msg) +{ + return msg.get(output); +} + + +// input operator for HandShakeHeader +input_buffer& operator>>(input_buffer& input, HandShakeHeader& hs) +{ + hs.type_ = HandShakeType(input[AUTO]); + + hs.length_[0] = input[AUTO]; + hs.length_[1] = input[AUTO]; + hs.length_[2] = input[AUTO]; + + return input; +} + + +// output operator for HandShakeHeader +output_buffer& operator<<(output_buffer& output, const HandShakeHeader& hdr) +{ + output[AUTO] = hdr.type_; + output.write(hdr.length_, sizeof(hdr.length_)); + return output; +} + + +// HandShake Header Processing function +void HandShakeHeader::Process(input_buffer& input, SSL& ssl) +{ + ssl.verifyState(*this); + if (ssl.GetError()) return; + const HandShakeFactory& hsf = ssl.getFactory().getHandShake(); + mySTL::auto_ptr hs(hsf.CreateObject(type_)); + if (!hs.get()) { + ssl.SetError(factory_error); + return; + } + + uint len = c24to32(length_); + if (len > input.get_remaining()) { + ssl.SetError(bad_input); + return; + } + hashHandShake(ssl, input, len); + + hs->set_length(len); + input >> *hs; + hs->Process(input, ssl); +} + + +ContentType HandShakeHeader::get_type() const +{ + return handshake; +} + + +uint16 HandShakeHeader::get_length() const +{ + return c24to32(length_); +} + + +HandShakeType HandShakeHeader::get_handshakeType() const +{ + return type_; +} + + +void HandShakeHeader::set_type(HandShakeType hst) +{ + type_ = hst; +} + + +void HandShakeHeader::set_length(uint32 u32) +{ + c32to24(u32, length_); +} + + +input_buffer& HandShakeHeader::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& HandShakeHeader::get(output_buffer& out) const +{ + return out << *this; +} + + + +int HandShakeBase::get_length() const +{ + return length_; +} + + +void HandShakeBase::set_length(int l) +{ + length_ = l; +} + + +// for building buffer's type field +HandShakeType HandShakeBase::get_type() const +{ + return no_shake; +} + + +input_buffer& HandShakeBase::set(input_buffer& in) +{ + return in; +} + + +output_buffer& HandShakeBase::get(output_buffer& out) const +{ + return out; +} + + +void HandShakeBase::Process(input_buffer&, SSL&) +{} + + +input_buffer& HelloRequest::set(input_buffer& in) +{ + return in; +} + + +output_buffer& HelloRequest::get(output_buffer& out) const +{ + return out; +} + + +void HelloRequest::Process(input_buffer&, SSL&) +{} + + +HandShakeType HelloRequest::get_type() const +{ + return hello_request; +} + + +// input operator for CipherSpec +input_buffer& operator>>(input_buffer& input, ChangeCipherSpec& cs) +{ + cs.type_ = CipherChoice(input[AUTO]); + return input; +} + +// output operator for CipherSpec +output_buffer& operator<<(output_buffer& output, const ChangeCipherSpec& cs) +{ + output[AUTO] = cs.type_; + return output; +} + + +ChangeCipherSpec::ChangeCipherSpec() + : type_(change_cipher_spec_choice) +{} + + +input_buffer& ChangeCipherSpec::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& ChangeCipherSpec::get(output_buffer& out) const +{ + return out << *this; +} + + +ContentType ChangeCipherSpec::get_type() const +{ + return change_cipher_spec; +} + + +uint16 ChangeCipherSpec::get_length() const +{ + return SIZEOF_ENUM; +} + + +// CipherSpec processing handler +void ChangeCipherSpec::Process(input_buffer&, SSL& ssl) +{ + ssl.useSecurity().use_parms().pending_ = false; + if (ssl.getSecurity().get_resuming()) { + if (ssl.getSecurity().get_parms().entity_ == client_end) + buildFinished(ssl, ssl.useHashes().use_verify(), server); // server + } + else if (ssl.getSecurity().get_parms().entity_ == server_end) + buildFinished(ssl, ssl.useHashes().use_verify(), client); // client +} + + +Alert::Alert(AlertLevel al, AlertDescription ad) + : level_(al), description_(ad) +{} + + +ContentType Alert::get_type() const +{ + return alert; +} + + +uint16 Alert::get_length() const +{ + return SIZEOF_ENUM * 2; +} + + +input_buffer& Alert::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& Alert::get(output_buffer& out) const +{ + return out << *this; +} + + +// input operator for Alert +input_buffer& operator>>(input_buffer& input, Alert& a) +{ + a.level_ = AlertLevel(input[AUTO]); + a.description_ = AlertDescription(input[AUTO]); + + return input; +} + + +// output operator for Alert +output_buffer& operator<<(output_buffer& output, const Alert& a) +{ + output[AUTO] = a.level_; + output[AUTO] = a.description_; + return output; +} + + +// Alert processing handler +void Alert::Process(input_buffer& input, SSL& ssl) +{ + if (ssl.getSecurity().get_parms().pending_ == false) { // encrypted alert + int aSz = get_length(); // alert size already read on input + opaque verify[SHA_LEN]; + const opaque* data = input.get_buffer() + input.get_current() - aSz; + + if (ssl.isTLS()) + TLS_hmac(ssl, verify, data, aSz, alert, true); + else + hmac(ssl, verify, data, aSz, alert, true); + + // read mac and fill + int digestSz = ssl.getCrypto().get_digest().get_digestSize(); + opaque mac[SHA_LEN]; + input.read(mac, digestSz); + + if (ssl.getSecurity().get_parms().cipher_type_ == block) { + int ivExtra = 0; + opaque fill; + + if (ssl.isTLSv1_1()) + ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); + int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - + aSz - digestSz; + for (int i = 0; i < padSz; i++) + fill = input[AUTO]; + } + + // verify + if (memcmp(mac, verify, digestSz)) { + ssl.SetError(verify_error); + return; + } + } + if (level_ == fatal) { + ssl.useStates().useRecord() = recordNotReady; + ssl.useStates().useHandShake() = handShakeNotReady; + ssl.SetError(YasslError(description_)); + } +} + + +Data::Data() + : length_(0), buffer_(0), write_buffer_(0) +{} + + +Data::Data(uint16 len, opaque* b) + : length_(len), buffer_(b), write_buffer_(0) +{} + + +void Data::SetData(uint16 len, const opaque* buffer) +{ + assert(write_buffer_ == 0); + + length_ = len; + write_buffer_ = buffer; +} + +input_buffer& Data::set(input_buffer& in) +{ + return in; +} + + +output_buffer& Data::get(output_buffer& out) const +{ + return out << *this; +} + + +ContentType Data::get_type() const +{ + return application_data; +} + + +uint16 Data::get_length() const +{ + return length_; +} + + +void Data::set_length(uint16 l) +{ + length_ = l; +} + + +opaque* Data::set_buffer() +{ + return buffer_; +} + + +// output operator for Data +output_buffer& operator<<(output_buffer& output, const Data& data) +{ + output.write(data.write_buffer_, data.length_); + return output; +} + + +// Process handler for Data +void Data::Process(input_buffer& input, SSL& ssl) +{ + int msgSz = ssl.getSecurity().get_parms().encrypt_size_; + int pad = 0, padByte = 0; + int ivExtra = 0; + + if (ssl.getSecurity().get_parms().cipher_type_ == block) { + if (ssl.isTLSv1_1()) // IV + ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); + pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1); + padByte = 1; + } + int digestSz = ssl.getCrypto().get_digest().get_digestSize(); + int dataSz = msgSz - ivExtra - digestSz - pad - padByte; + opaque verify[SHA_LEN]; + + const byte* rawData = input.get_buffer() + input.get_current(); + + // read data + if (dataSz) { // could be compressed + if (ssl.CompressionOn()) { + input_buffer tmp; + if (DeCompress(input, dataSz, tmp) == -1) { + ssl.SetError(decompress_error); + return; + } + ssl.addData(NEW_YS input_buffer(tmp.get_size(), + tmp.get_buffer(), tmp.get_size())); + } + else { + input_buffer* data; + ssl.addData(data = NEW_YS input_buffer(dataSz)); + input.read(data->get_buffer(), dataSz); + data->add_size(dataSz); + } + + if (ssl.isTLS()) + TLS_hmac(ssl, verify, rawData, dataSz, application_data, true); + else + hmac(ssl, verify, rawData, dataSz, application_data, true); + } + + // read mac and fill + opaque mac[SHA_LEN]; + opaque fill; + input.read(mac, digestSz); + for (int i = 0; i < pad; i++) + fill = input[AUTO]; + if (padByte) + fill = input[AUTO]; + + // verify + if (dataSz) { + if (memcmp(mac, verify, digestSz)) { + ssl.SetError(verify_error); + return; + } + } + else + ssl.get_SEQIncrement(true); // even though no data, increment verify +} + + +// virtual input operator for HandShakes +input_buffer& operator>>(input_buffer& input, HandShakeBase& hs) +{ + return hs.set(input); +} + + +// virtual output operator for HandShakes +output_buffer& operator<<(output_buffer& output, const HandShakeBase& hs) +{ + return hs.get(output); +} + + +Certificate::Certificate(const x509* cert) : cert_(cert) +{ + set_length(cert_->get_length() + 2 * CERT_HEADER); // list and cert size +} + + +const opaque* Certificate::get_buffer() const +{ + return cert_->get_buffer(); +} + + +// output operator for Certificate +output_buffer& operator<<(output_buffer& output, const Certificate& cert) +{ + uint sz = cert.get_length() - 2 * CERT_HEADER; + opaque tmp[CERT_HEADER]; + + c32to24(sz + CERT_HEADER, tmp); + output.write(tmp, CERT_HEADER); + c32to24(sz, tmp); + output.write(tmp, CERT_HEADER); + output.write(cert.get_buffer(), sz); + + return output; +} + + +// certificate processing handler +void Certificate::Process(input_buffer& input, SSL& ssl) +{ + CertManager& cm = ssl.useCrypto().use_certManager(); + + uint32 list_sz; + byte tmp[3]; + + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + tmp[2] = input[AUTO]; + c24to32(tmp, list_sz); + + while (list_sz) { + // cert size + uint32 cert_sz; + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + tmp[2] = input[AUTO]; + c24to32(tmp, cert_sz); + + x509* myCert; + cm.AddPeerCert(myCert = NEW_YS x509(cert_sz)); + input.read(myCert->use_buffer(), myCert->get_length()); + + list_sz -= cert_sz + CERT_HEADER; + } + if (int err = cm.Validate()) + ssl.SetError(YasslError(err)); + else if (ssl.getSecurity().get_parms().entity_ == client_end) + ssl.useStates().useClient() = serverCertComplete; +} + + +Certificate::Certificate() + : cert_(0) +{} + + +input_buffer& Certificate::set(input_buffer& in) +{ + return in; +} + + +output_buffer& Certificate::get(output_buffer& out) const +{ + return out << *this; +} + + +HandShakeType Certificate::get_type() const +{ + return certificate; +} + + +ServerDHParams::ServerDHParams() + : pSz_(0), gSz_(0), pubSz_(0), p_(0), g_(0), Ys_(0) +{} + + +ServerDHParams::~ServerDHParams() +{ + ysArrayDelete(Ys_); + ysArrayDelete(g_); + ysArrayDelete(p_); +} + + +int ServerDHParams::get_pSize() const +{ + return pSz_; +} + + +int ServerDHParams::get_gSize() const +{ + return gSz_; +} + + +int ServerDHParams::get_pubSize() const +{ + return pubSz_; +} + + +const opaque* ServerDHParams::get_p() const +{ + return p_; +} + + +const opaque* ServerDHParams::get_g() const +{ + return g_; +} + + +const opaque* ServerDHParams::get_pub() const +{ + return Ys_; +} + + +opaque* ServerDHParams::alloc_p(int sz) +{ + p_ = NEW_YS opaque[pSz_ = sz]; + return p_; +} + + +opaque* ServerDHParams::alloc_g(int sz) +{ + g_ = NEW_YS opaque[gSz_ = sz]; + return g_; +} + + +opaque* ServerDHParams::alloc_pub(int sz) +{ + Ys_ = NEW_YS opaque[pubSz_ = sz]; + return Ys_; +} + + +int ServerKeyBase::get_length() const +{ + return 0; +} + + +opaque* ServerKeyBase::get_serverKey() const +{ + return 0; +} + + +// input operator for ServerHello +input_buffer& operator>>(input_buffer& input, ServerHello& hello) +{ + // Protocol + hello.server_version_.major_ = input[AUTO]; + hello.server_version_.minor_ = input[AUTO]; + + // Random + input.read(hello.random_, RAN_LEN); + + // Session + hello.id_len_ = input[AUTO]; + if (hello.id_len_) + input.read(hello.session_id_, hello.id_len_); + + // Suites + hello.cipher_suite_[0] = input[AUTO]; + hello.cipher_suite_[1] = input[AUTO]; + + // Compression + hello.compression_method_ = CompressionMethod(input[AUTO]); + + return input; +} + + +// output operator for ServerHello +output_buffer& operator<<(output_buffer& output, const ServerHello& hello) +{ + // Protocol + output[AUTO] = hello.server_version_.major_; + output[AUTO] = hello.server_version_.minor_; + + // Random + output.write(hello.random_, RAN_LEN); + + // Session + output[AUTO] = hello.id_len_; + output.write(hello.session_id_, ID_LEN); + + // Suites + output[AUTO] = hello.cipher_suite_[0]; + output[AUTO] = hello.cipher_suite_[1]; + + // Compression + output[AUTO] = hello.compression_method_; + + return output; +} + + +// Server Hello processing handler +void ServerHello::Process(input_buffer&, SSL& ssl) +{ + if (ssl.GetMultiProtocol()) { // SSLv23 support + if (ssl.isTLS() && server_version_.minor_ < 1) + // downgrade to SSLv3 + ssl.useSecurity().use_connection().TurnOffTLS(); + else if (ssl.isTLSv1_1() && server_version_.minor_ == 1) + // downdrage to TLSv1 + ssl.useSecurity().use_connection().TurnOffTLS1_1(); + } + else if (ssl.isTLSv1_1() && server_version_.minor_ < 2) { + ssl.SetError(badVersion_error); + return; + } + else if (ssl.isTLS() && server_version_.minor_ < 1) { + ssl.SetError(badVersion_error); + return; + } + else if (!ssl.isTLS() && (server_version_.major_ == 3 && + server_version_.minor_ >= 1)) { + ssl.SetError(badVersion_error); + return; + } + ssl.set_pending(cipher_suite_[1]); + ssl.set_random(random_, server_end); + if (id_len_) + ssl.set_sessionID(session_id_); + else + ssl.useSecurity().use_connection().sessionID_Set_ = false; + + if (ssl.getSecurity().get_resuming()) + if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(), + ID_LEN) == 0) { + ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret()); + if (ssl.isTLS()) + ssl.deriveTLSKeys(); + else + ssl.deriveKeys(); + ssl.useStates().useClient() = serverHelloDoneComplete; + return; + } + else { + ssl.useSecurity().set_resuming(false); + ssl.useLog().Trace("server denied resumption"); + } + + if (ssl.CompressionOn() && !compression_method_) + ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request + + ssl.useStates().useClient() = serverHelloComplete; +} + + +ServerHello::ServerHello() +{ + memset(random_, 0, RAN_LEN); + memset(session_id_, 0, ID_LEN); +} + + +ServerHello::ServerHello(ProtocolVersion pv, bool useCompression) + : server_version_(pv), + compression_method_(useCompression ? zlib : no_compression) +{ + memset(random_, 0, RAN_LEN); + memset(session_id_, 0, ID_LEN); +} + + +input_buffer& ServerHello::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& ServerHello::get(output_buffer& out) const +{ + return out << *this; +} + + +HandShakeType ServerHello::get_type() const +{ + return server_hello; +} + + +const opaque* ServerHello::get_random() const +{ + return random_; +} + + +// Server Hello Done processing handler +void ServerHelloDone::Process(input_buffer&, SSL& ssl) +{ + ssl.useStates().useClient() = serverHelloDoneComplete; +} + + +ServerHelloDone::ServerHelloDone() +{ + set_length(0); +} + + +input_buffer& ServerHelloDone::set(input_buffer& in) +{ + return in; +} + + +output_buffer& ServerHelloDone::get(output_buffer& out) const +{ + return out; +} + + +HandShakeType ServerHelloDone::get_type() const +{ + return server_hello_done; +} + + +int ClientKeyBase::get_length() const +{ + return 0; +} + + +opaque* ClientKeyBase::get_clientKey() const +{ + return 0; +} + + +// input operator for Client Hello +input_buffer& operator>>(input_buffer& input, ClientHello& hello) +{ + uint begin = input.get_current(); // could have extensions at end + + // Protocol + hello.client_version_.major_ = input[AUTO]; + hello.client_version_.minor_ = input[AUTO]; + + // Random + input.read(hello.random_, RAN_LEN); + + // Session + hello.id_len_ = input[AUTO]; + if (hello.id_len_) input.read(hello.session_id_, ID_LEN); + + // Suites + byte tmp[2]; + uint16 len; + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; + ato16(tmp, len); + + hello.suite_len_ = min(len, static_cast(MAX_SUITE_SZ)); + input.read(hello.cipher_suites_, hello.suite_len_); + if (len > hello.suite_len_) // ignore extra suites + input.set_current(input.get_current() + len - hello.suite_len_); + + // Compression + hello.comp_len_ = input[AUTO]; + hello.compression_methods_ = no_compression; + while (hello.comp_len_--) { + CompressionMethod cm = CompressionMethod(input[AUTO]); + if (cm == zlib) + hello.compression_methods_ = zlib; + } + + uint read = input.get_current() - begin; + uint expected = hello.get_length(); + + // ignore client hello extensions for now + if (read < expected) + input.set_current(input.get_current() + expected - read); + + return input; +} + + +// output operaotr for Client Hello +output_buffer& operator<<(output_buffer& output, const ClientHello& hello) +{ + // Protocol + output[AUTO] = hello.client_version_.major_; + output[AUTO] = hello.client_version_.minor_; + + // Random + output.write(hello.random_, RAN_LEN); + + // Session + output[AUTO] = hello.id_len_; + if (hello.id_len_) output.write(hello.session_id_, ID_LEN); + + // Suites + byte tmp[2]; + c16toa(hello.suite_len_, tmp); + output[AUTO] = tmp[0]; + output[AUTO] = tmp[1]; + output.write(hello.cipher_suites_, hello.suite_len_); + + // Compression + output[AUTO] = hello.comp_len_; + output[AUTO] = hello.compression_methods_; + + return output; +} + + +// Client Hello processing handler +void ClientHello::Process(input_buffer&, SSL& ssl) +{ + // store version for pre master secret + ssl.useSecurity().use_connection().chVersion_ = client_version_; + + if (client_version_.major_ != 3) { + ssl.SetError(badVersion_error); + return; + } + if (ssl.GetMultiProtocol()) { // SSLv23 support + if (ssl.isTLS() && client_version_.minor_ < 1) { + // downgrade to SSLv3 + ssl.useSecurity().use_connection().TurnOffTLS(); + ProtocolVersion pv = ssl.getSecurity().get_connection().version_; + bool removeDH = ssl.getSecurity().get_parms().removeDH_; + bool removeRSA = false; + bool removeDSA = false; + + const CertManager& cm = ssl.getCrypto().get_certManager(); + if (cm.get_keyType() == rsa_sa_algo) + removeDSA = true; + else + removeRSA = true; + + // reset w/ SSL suites + ssl.useSecurity().use_parms().SetSuites(pv, removeDH, removeRSA, + removeDSA); + } + else if (ssl.isTLSv1_1() && client_version_.minor_ == 1) + // downgrade to TLSv1, but use same suites + ssl.useSecurity().use_connection().TurnOffTLS1_1(); + } + else if (ssl.isTLSv1_1() && client_version_.minor_ < 2) { + ssl.SetError(badVersion_error); + return; + } + else if (ssl.isTLS() && client_version_.minor_ < 1) { + ssl.SetError(badVersion_error); + return; + } + else if (!ssl.isTLS() && client_version_.minor_ >= 1) { + ssl.SetError(badVersion_error); + return; + } + + ssl.set_random(random_, client_end); + + while (id_len_) { // trying to resume + SSL_SESSION* session = 0; + if (!ssl.getSecurity().GetContext()->GetSessionCacheOff()) + session = GetSessions().lookup(session_id_); + if (!session) { + ssl.useLog().Trace("session lookup failed"); + break; + } + ssl.set_session(session); + ssl.useSecurity().set_resuming(true); + ssl.matchSuite(session->GetSuite(), SUITE_LEN); + ssl.set_pending(ssl.getSecurity().get_parms().suite_[1]); + ssl.set_masterSecret(session->GetSecret()); + + opaque serverRandom[RAN_LEN]; + ssl.getCrypto().get_random().Fill(serverRandom, sizeof(serverRandom)); + ssl.set_random(serverRandom, server_end); + if (ssl.isTLS()) + ssl.deriveTLSKeys(); + else + ssl.deriveKeys(); + ssl.useStates().useServer() = clientKeyExchangeComplete; + return; + } + ssl.matchSuite(cipher_suites_, suite_len_); + if (ssl.GetError()) return; + ssl.set_pending(ssl.getSecurity().get_parms().suite_[1]); + + if (compression_methods_ == zlib) + ssl.SetCompression(); + + ssl.useStates().useServer() = clientHelloComplete; +} + + +input_buffer& ClientHello::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& ClientHello::get(output_buffer& out) const +{ + return out << *this; +} + + +HandShakeType ClientHello::get_type() const +{ + return client_hello; +} + + +const opaque* ClientHello::get_random() const +{ + return random_; +} + + +ClientHello::ClientHello() +{ + memset(random_, 0, RAN_LEN); +} + + +ClientHello::ClientHello(ProtocolVersion pv, bool useCompression) + : client_version_(pv), + compression_methods_(useCompression ? zlib : no_compression) +{ + memset(random_, 0, RAN_LEN); +} + + +// output operator for ServerKeyExchange +output_buffer& operator<<(output_buffer& output, const ServerKeyExchange& sk) +{ + output.write(sk.getKey(), sk.getKeyLength()); + return output; +} + + +// Server Key Exchange processing handler +void ServerKeyExchange::Process(input_buffer& input, SSL& ssl) +{ + createKey(ssl); + if (ssl.GetError()) return; + server_key_->read(ssl, input); + + ssl.useStates().useClient() = serverKeyExchangeComplete; +} + + +ServerKeyExchange::ServerKeyExchange(SSL& ssl) +{ + createKey(ssl); +} + + +ServerKeyExchange::ServerKeyExchange() + : server_key_(0) +{} + + +ServerKeyExchange::~ServerKeyExchange() +{ + ysDelete(server_key_); +} + + +void ServerKeyExchange::build(SSL& ssl) +{ + server_key_->build(ssl); + set_length(server_key_->get_length()); +} + + +const opaque* ServerKeyExchange::getKey() const +{ + return server_key_->get_serverKey(); +} + + +int ServerKeyExchange::getKeyLength() const +{ + return server_key_->get_length(); +} + + +input_buffer& ServerKeyExchange::set(input_buffer& in) +{ + return in; // process does +} + + +output_buffer& ServerKeyExchange::get(output_buffer& out) const +{ + return out << *this; +} + + +HandShakeType ServerKeyExchange::get_type() const +{ + return server_key_exchange; +} + + +// CertificateRequest +CertificateRequest::CertificateRequest() + : typeTotal_(0) +{ + memset(certificate_types_, 0, sizeof(certificate_types_)); +} + + +CertificateRequest::~CertificateRequest() +{ + + STL::for_each(certificate_authorities_.begin(), + certificate_authorities_.end(), + del_ptr_zero()) ; +} + + +void CertificateRequest::Build() +{ + certificate_types_[0] = rsa_sign; + certificate_types_[1] = dss_sign; + + typeTotal_ = 2; + + uint16 authCount = 0; + uint16 authSz = 0; + + for (int j = 0; j < authCount; j++) { + int sz = REQUEST_HEADER + MIN_DIS_SIZE; + DistinguishedName dn; + certificate_authorities_.push_back(dn = NEW_YS byte[sz]); + + opaque tmp[REQUEST_HEADER]; + c16toa(MIN_DIS_SIZE, tmp); + memcpy(dn, tmp, sizeof(tmp)); + + // fill w/ junk for now + memcpy(dn, tmp, MIN_DIS_SIZE); + authSz += sz; + } + + set_length(SIZEOF_ENUM + typeTotal_ + REQUEST_HEADER + authSz); +} + + +input_buffer& CertificateRequest::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& CertificateRequest::get(output_buffer& out) const +{ + return out << *this; +} + + +// input operator for CertificateRequest +input_buffer& operator>>(input_buffer& input, CertificateRequest& request) +{ + // types + request.typeTotal_ = input[AUTO]; + for (int i = 0; i < request.typeTotal_; i++) + request.certificate_types_[i] = ClientCertificateType(input[AUTO]); + + byte tmp[REQUEST_HEADER]; + input.read(tmp, sizeof(tmp)); + uint16 sz; + ato16(tmp, sz); + + // authorities + while (sz) { + uint16 dnSz; + input.read(tmp, sizeof(tmp)); + ato16(tmp, dnSz); + + DistinguishedName dn; + request.certificate_authorities_.push_back(dn = NEW_YS + byte[REQUEST_HEADER + dnSz]); + memcpy(dn, tmp, REQUEST_HEADER); + input.read(&dn[REQUEST_HEADER], dnSz); + + sz -= dnSz + REQUEST_HEADER; + } + + return input; +} + + +// output operator for CertificateRequest +output_buffer& operator<<(output_buffer& output, + const CertificateRequest& request) +{ + // types + output[AUTO] = request.typeTotal_; + for (int i = 0; i < request.typeTotal_; i++) + output[AUTO] = request.certificate_types_[i]; + + // authorities + opaque tmp[REQUEST_HEADER]; + c16toa(request.get_length() - SIZEOF_ENUM - + request.typeTotal_ - REQUEST_HEADER, tmp); + output.write(tmp, sizeof(tmp)); + + STL::list::const_iterator first = + request.certificate_authorities_.begin(); + STL::list::const_iterator last = + request.certificate_authorities_.end(); + while (first != last) { + uint16 sz; + ato16(*first, sz); + output.write(*first, sz + REQUEST_HEADER); + + ++first; + } + + return output; +} + + +// CertificateRequest processing handler +void CertificateRequest::Process(input_buffer&, SSL& ssl) +{ + CertManager& cm = ssl.useCrypto().use_certManager(); + + // make sure user provided cert and key before sending and using + if (cm.get_cert() && cm.get_privateKey()) + cm.setSendVerify(); +} + + +HandShakeType CertificateRequest::get_type() const +{ + return certificate_request; +} + + +// CertificateVerify +CertificateVerify::CertificateVerify() : signature_(0) +{} + + +CertificateVerify::~CertificateVerify() +{ + ysArrayDelete(signature_); +} + + +void CertificateVerify::Build(SSL& ssl) +{ + build_certHashes(ssl, hashes_); + + uint16 sz = 0; + byte len[VERIFY_HEADER]; + mySTL::auto_array sig; + + // sign + const CertManager& cert = ssl.getCrypto().get_certManager(); + if (cert.get_keyType() == rsa_sa_algo) { + RSA rsa(cert.get_privateKey(), cert.get_privateKeyLength(), false); + + sz = rsa.get_cipherLength() + VERIFY_HEADER; + sig.reset(NEW_YS byte[sz]); + + c16toa(sz - VERIFY_HEADER, len); + memcpy(sig.get(), len, VERIFY_HEADER); + rsa.sign(sig.get() + VERIFY_HEADER, hashes_.md5_, sizeof(Hashes), + ssl.getCrypto().get_random()); + } + else { // DSA + DSS dss(cert.get_privateKey(), cert.get_privateKeyLength(), false); + + sz = DSS_SIG_SZ + DSS_ENCODED_EXTRA + VERIFY_HEADER; + sig.reset(NEW_YS byte[sz]); + + c16toa(sz - VERIFY_HEADER, len); + memcpy(sig.get(), len, VERIFY_HEADER); + dss.sign(sig.get() + VERIFY_HEADER, hashes_.sha_, SHA_LEN, + ssl.getCrypto().get_random()); + + byte encoded[DSS_SIG_SZ + DSS_ENCODED_EXTRA]; + TaoCrypt::EncodeDSA_Signature(sig.get() + VERIFY_HEADER, encoded); + memcpy(sig.get() + VERIFY_HEADER, encoded, sizeof(encoded)); + } + set_length(sz); + signature_ = sig.release(); +} + + +input_buffer& CertificateVerify::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& CertificateVerify::get(output_buffer& out) const +{ + return out << *this; +} + + +// input operator for CertificateVerify +input_buffer& operator>>(input_buffer& input, CertificateVerify& request) +{ + byte tmp[VERIFY_HEADER]; + input.read(tmp, sizeof(tmp)); + + uint16 sz = 0; + ato16(tmp, sz); + request.set_length(sz); + + request.signature_ = NEW_YS byte[sz]; + input.read(request.signature_, sz); + + return input; +} + + +// output operator for CertificateVerify +output_buffer& operator<<(output_buffer& output, + const CertificateVerify& verify) +{ + output.write(verify.signature_, verify.get_length()); + + return output; +} + + +// CertificateVerify processing handler +void CertificateVerify::Process(input_buffer&, SSL& ssl) +{ + const Hashes& hashVerify = ssl.getHashes().get_certVerify(); + const CertManager& cert = ssl.getCrypto().get_certManager(); + + if (cert.get_peerKeyType() == rsa_sa_algo) { + RSA rsa(cert.get_peerKey(), cert.get_peerKeyLength()); + + if (!rsa.verify(hashVerify.md5_, sizeof(hashVerify), signature_, + get_length())) + ssl.SetError(verify_error); + } + else { // DSA + byte decodedSig[DSS_SIG_SZ]; + TaoCrypt::DecodeDSA_Signature(decodedSig, signature_, get_length()); + + DSS dss(cert.get_peerKey(), cert.get_peerKeyLength()); + if (!dss.verify(hashVerify.sha_, SHA_LEN, decodedSig, get_length())) + ssl.SetError(verify_error); + } +} + + +HandShakeType CertificateVerify::get_type() const +{ + return certificate_verify; +} + + +// output operator for ClientKeyExchange +output_buffer& operator<<(output_buffer& output, const ClientKeyExchange& ck) +{ + output.write(ck.getKey(), ck.getKeyLength()); + return output; +} + + +// Client Key Exchange processing handler +void ClientKeyExchange::Process(input_buffer& input, SSL& ssl) +{ + createKey(ssl); + if (ssl.GetError()) return; + client_key_->read(ssl, input); + + if (ssl.getCrypto().get_certManager().verifyPeer()) + build_certHashes(ssl, ssl.useHashes().use_certVerify()); + + ssl.useStates().useServer() = clientKeyExchangeComplete; +} + + +ClientKeyExchange::ClientKeyExchange(SSL& ssl) +{ + createKey(ssl); +} + + +ClientKeyExchange::ClientKeyExchange() + : client_key_(0) +{} + + +ClientKeyExchange::~ClientKeyExchange() +{ + ysDelete(client_key_); +} + + +void ClientKeyExchange::build(SSL& ssl) +{ + client_key_->build(ssl); + set_length(client_key_->get_length()); +} + +const opaque* ClientKeyExchange::getKey() const +{ + return client_key_->get_clientKey(); +} + + +int ClientKeyExchange::getKeyLength() const +{ + return client_key_->get_length(); +} + + +input_buffer& ClientKeyExchange::set(input_buffer& in) +{ + return in; +} + + +output_buffer& ClientKeyExchange::get(output_buffer& out) const +{ + return out << *this; +} + + +HandShakeType ClientKeyExchange::get_type() const +{ + return client_key_exchange; +} + + +// input operator for Finished +input_buffer& operator>>(input_buffer& input, Finished&) +{ + /* do in process */ + + return input; +} + +// output operator for Finished +output_buffer& operator<<(output_buffer& output, const Finished& fin) +{ + if (fin.get_length() == FINISHED_SZ) { + output.write(fin.hashes_.md5_, MD5_LEN); + output.write(fin.hashes_.sha_, SHA_LEN); + } + else // TLS_FINISHED_SZ + output.write(fin.hashes_.md5_, TLS_FINISHED_SZ); + + return output; +} + + +// Finished processing handler +void Finished::Process(input_buffer& input, SSL& ssl) +{ + // verify hashes + const Finished& verify = ssl.getHashes().get_verify(); + uint finishedSz = ssl.isTLS() ? TLS_FINISHED_SZ : FINISHED_SZ; + + input.read(hashes_.md5_, finishedSz); + + if (memcmp(&hashes_, &verify.hashes_, finishedSz)) { + ssl.SetError(verify_error); + return; + } + + // read verify mac + opaque verifyMAC[SHA_LEN]; + uint macSz = finishedSz + HANDSHAKE_HEADER; + + if (ssl.isTLS()) + TLS_hmac(ssl, verifyMAC, input.get_buffer() + input.get_current() + - macSz, macSz, handshake, true); + else + hmac(ssl, verifyMAC, input.get_buffer() + input.get_current() - macSz, + macSz, handshake, true); + + // read mac and fill + opaque mac[SHA_LEN]; // max size + int digestSz = ssl.getCrypto().get_digest().get_digestSize(); + input.read(mac, digestSz); + + uint ivExtra = 0; + if (ssl.getSecurity().get_parms().cipher_type_ == block) + if (ssl.isTLSv1_1()) + ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); + + opaque fill; + int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - + HANDSHAKE_HEADER - finishedSz - digestSz; + for (int i = 0; i < padSz; i++) + fill = input[AUTO]; + + // verify mac + if (memcmp(mac, verifyMAC, digestSz)) { + ssl.SetError(verify_error); + return; + } + + // update states + ssl.useStates().useHandShake() = handShakeReady; + if (ssl.getSecurity().get_parms().entity_ == client_end) + ssl.useStates().useClient() = serverFinishedComplete; + else + ssl.useStates().useServer() = clientFinishedComplete; +} + + +Finished::Finished() +{ + set_length(FINISHED_SZ); +} + + +uint8* Finished::set_md5() +{ + return hashes_.md5_; +} + + +uint8* Finished::set_sha() +{ + return hashes_.sha_; +} + + +input_buffer& Finished::set(input_buffer& in) +{ + return in >> *this; +} + + +output_buffer& Finished::get(output_buffer& out) const +{ + return out << *this; +} + + +HandShakeType Finished::get_type() const +{ + return finished; +} + + +void clean(volatile opaque* p, uint sz, RandomPool& ran) +{ + uint i(0); + + for (i = 0; i < sz; ++i) + p[i] = 0; + + ran.Fill(const_cast(p), sz); + + for (i = 0; i < sz; ++i) + p[i] = 0; +} + + + +Connection::Connection(ProtocolVersion v, RandomPool& ran) + : pre_master_secret_(0), sequence_number_(0), peer_sequence_number_(0), + pre_secret_len_(0), send_server_key_(false), master_clean_(false), + TLS_(v.major_ >= 3 && v.minor_ >= 1), + TLSv1_1_(v.major_ >= 3 && v.minor_ >= 2), compression_(false), + version_(v), random_(ran) +{ + memset(sessionID_, 0, sizeof(sessionID_)); +} + + +Connection::~Connection() +{ + CleanMaster(); CleanPreMaster(); ysArrayDelete(pre_master_secret_); +} + + +void Connection::AllocPreSecret(uint sz) +{ + pre_master_secret_ = NEW_YS opaque[pre_secret_len_ = sz]; +} + + +void Connection::TurnOffTLS() +{ + TLS_ = false; + version_.minor_ = 0; +} + + +void Connection::TurnOffTLS1_1() +{ + TLSv1_1_ = false; + version_.minor_ = 1; +} + + +// wipeout master secret +void Connection::CleanMaster() +{ + if (!master_clean_) { + volatile opaque* p = master_secret_; + clean(p, SECRET_LEN, random_); + master_clean_ = true; + } +} + + +// wipeout pre master secret +void Connection::CleanPreMaster() +{ + if (pre_master_secret_) { + volatile opaque* p = pre_master_secret_; + clean(p, pre_secret_len_, random_); + + ysArrayDelete(pre_master_secret_); + pre_master_secret_ = 0; + } +} + + +// Create functions for message factory +Message* CreateCipherSpec() { return NEW_YS ChangeCipherSpec; } +Message* CreateAlert() { return NEW_YS Alert; } +Message* CreateHandShake() { return NEW_YS HandShakeHeader; } +Message* CreateData() { return NEW_YS Data; } + +// Create functions for handshake factory +HandShakeBase* CreateHelloRequest() { return NEW_YS HelloRequest; } +HandShakeBase* CreateClientHello() { return NEW_YS ClientHello; } +HandShakeBase* CreateServerHello() { return NEW_YS ServerHello; } +HandShakeBase* CreateCertificate() { return NEW_YS Certificate; } +HandShakeBase* CreateServerKeyExchange() { return NEW_YS ServerKeyExchange;} +HandShakeBase* CreateCertificateRequest() { return NEW_YS + CertificateRequest; } +HandShakeBase* CreateServerHelloDone() { return NEW_YS ServerHelloDone; } +HandShakeBase* CreateCertificateVerify() { return NEW_YS CertificateVerify;} +HandShakeBase* CreateClientKeyExchange() { return NEW_YS ClientKeyExchange;} +HandShakeBase* CreateFinished() { return NEW_YS Finished; } + +// Create functions for server key exchange factory +ServerKeyBase* CreateRSAServerKEA() { return NEW_YS RSA_Server; } +ServerKeyBase* CreateDHServerKEA() { return NEW_YS DH_Server; } +ServerKeyBase* CreateFortezzaServerKEA() { return NEW_YS Fortezza_Server; } + +// Create functions for client key exchange factory +ClientKeyBase* CreateRSAClient() { return NEW_YS + EncryptedPreMasterSecret; } +ClientKeyBase* CreateDHClient() { return NEW_YS + ClientDiffieHellmanPublic; } +ClientKeyBase* CreateFortezzaClient() { return NEW_YS FortezzaKeys; } + + +// Constructor calls this to Register compile time callbacks +void InitMessageFactory(MessageFactory& mf) +{ + mf.Reserve(4); + mf.Register(alert, CreateAlert); + mf.Register(change_cipher_spec, CreateCipherSpec); + mf.Register(handshake, CreateHandShake); + mf.Register(application_data, CreateData); +} + + +// Constructor calls this to Register compile time callbacks +void InitHandShakeFactory(HandShakeFactory& hsf) +{ + hsf.Reserve(10); + hsf.Register(hello_request, CreateHelloRequest); + hsf.Register(client_hello, CreateClientHello); + hsf.Register(server_hello, CreateServerHello); + hsf.Register(certificate, CreateCertificate); + hsf.Register(server_key_exchange, CreateServerKeyExchange); + hsf.Register(certificate_request, CreateCertificateRequest); + hsf.Register(server_hello_done, CreateServerHelloDone); + hsf.Register(certificate_verify, CreateCertificateVerify); + hsf.Register(client_key_exchange, CreateClientKeyExchange); + hsf.Register(finished, CreateFinished); +} + + +// Constructor calls this to Register compile time callbacks +void InitServerKeyFactory(ServerKeyFactory& skf) +{ + skf.Reserve(3); + skf.Register(rsa_kea, CreateRSAServerKEA); + skf.Register(diffie_hellman_kea, CreateDHServerKEA); + skf.Register(fortezza_kea, CreateFortezzaServerKEA); +} + + +// Constructor calls this to Register compile time callbacks +void InitClientKeyFactory(ClientKeyFactory& ckf) +{ + ckf.Reserve(3); + ckf.Register(rsa_kea, CreateRSAClient); + ckf.Register(diffie_hellman_kea, CreateDHClient); + ckf.Register(fortezza_kea, CreateFortezzaClient); +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/src/yassl_int.cpp b/externals/mysql/extlib/yassl/src/yassl_int.cpp new file mode 100644 index 00000000000..b7f91d72166 --- /dev/null +++ b/externals/mysql/extlib/yassl/src/yassl_int.cpp @@ -0,0 +1,2580 @@ +/* + Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* yaSSL internal source implements SSL supporting types not specified in the + * draft along with type conversion functions. + */ + +#include "runtime.hpp" +#include "yassl_int.hpp" +#include "handshake.hpp" +#include "timer.hpp" + +#ifdef _POSIX_THREADS + #include "pthread.h" +#endif + + +#ifdef HAVE_LIBZ + #include "zlib.h" +#endif + + +#ifdef YASSL_PURE_C + + void* operator new(size_t sz, yaSSL::new_t) + { + void* ptr = malloc(sz ? sz : 1); + if (!ptr) abort(); + + return ptr; + } + + + void operator delete(void* ptr, yaSSL::new_t) + { + if (ptr) free(ptr); + } + + + void* operator new[](size_t sz, yaSSL::new_t nt) + { + return ::operator new(sz, nt); + } + + + void operator delete[](void* ptr, yaSSL::new_t nt) + { + ::operator delete(ptr, nt); + } + + namespace yaSSL { + + new_t ys; // for yaSSL library new + + } + +#endif // YASSL_PURE_C + + +namespace yaSSL { + + + + + + +// convert a 32 bit integer into a 24 bit one +void c32to24(uint32 u32, uint24& u24) +{ + u24[0] = (u32 >> 16) & 0xff; + u24[1] = (u32 >> 8) & 0xff; + u24[2] = u32 & 0xff; +} + + +// convert a 24 bit integer into a 32 bit one +void c24to32(const uint24 u24, uint32& u32) +{ + u32 = 0; + u32 = (u24[0] << 16) | (u24[1] << 8) | u24[2]; +} + + +// convert with return for ease of use +uint32 c24to32(const uint24 u24) +{ + uint32 ret; + c24to32(u24, ret); + + return ret; +} + + +// using a for opaque since underlying type is unsgined char and o is not a +// good leading identifier + +// convert opaque to 16 bit integer +void ato16(const opaque* c, uint16& u16) +{ + u16 = 0; + u16 = (c[0] << 8) | (c[1]); +} + + +// convert (copy) opaque to 24 bit integer +void ato24(const opaque* c, uint24& u24) +{ + u24[0] = c[0]; + u24[1] = c[1]; + u24[2] = c[2]; +} + + +// convert 16 bit integer to opaque +void c16toa(uint16 u16, opaque* c) +{ + c[0] = (u16 >> 8) & 0xff; + c[1] = u16 & 0xff; +} + + +// convert 24 bit integer to opaque +void c24toa(const uint24 u24, opaque* c) +{ + c[0] = u24[0]; + c[1] = u24[1]; + c[2] = u24[2]; +} + + +// convert 32 bit integer to opaque +void c32toa(uint32 u32, opaque* c) +{ + c[0] = (u32 >> 24) & 0xff; + c[1] = (u32 >> 16) & 0xff; + c[2] = (u32 >> 8) & 0xff; + c[3] = u32 & 0xff; +} + + +States::States() : recordLayer_(recordReady), handshakeLayer_(preHandshake), + clientState_(serverNull), serverState_(clientNull), + connectState_(CONNECT_BEGIN), acceptState_(ACCEPT_BEGIN), + what_(no_error) {} + +const RecordLayerState& States::getRecord() const +{ + return recordLayer_; +} + + +const HandShakeState& States::getHandShake() const +{ + return handshakeLayer_; +} + + +const ClientState& States::getClient() const +{ + return clientState_; +} + + +const ServerState& States::getServer() const +{ + return serverState_; +} + + +const ConnectState& States::GetConnect() const +{ + return connectState_; +} + + +const AcceptState& States::GetAccept() const +{ + return acceptState_; +} + + +const char* States::getString() const +{ + return errorString_; +} + + +YasslError States::What() const +{ + return what_; +} + + +RecordLayerState& States::useRecord() +{ + return recordLayer_; +} + + +HandShakeState& States::useHandShake() +{ + return handshakeLayer_; +} + + +ClientState& States::useClient() +{ + return clientState_; +} + + +ServerState& States::useServer() +{ + return serverState_; +} + + +ConnectState& States::UseConnect() +{ + return connectState_; +} + + +AcceptState& States::UseAccept() +{ + return acceptState_; +} + + +char* States::useString() +{ + return errorString_; +} + + +void States::SetError(YasslError ye) +{ + what_ = ye; +} + + +sslFactory::sslFactory() : + messageFactory_(InitMessageFactory), + handShakeFactory_(InitHandShakeFactory), + serverKeyFactory_(InitServerKeyFactory), + clientKeyFactory_(InitClientKeyFactory) +{} + + +const MessageFactory& sslFactory::getMessage() const +{ + return messageFactory_; +} + + +const HandShakeFactory& sslFactory::getHandShake() const +{ + return handShakeFactory_; +} + + +const ServerKeyFactory& sslFactory::getServerKey() const +{ + return serverKeyFactory_; +} + + +const ClientKeyFactory& sslFactory::getClientKey() const +{ + return clientKeyFactory_; +} + + +// extract context parameters and store +SSL::SSL(SSL_CTX* ctx) + : secure_(ctx->getMethod()->getVersion(), crypto_.use_random(), + ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx, + ctx->GetDH_Parms().set_), quietShutdown_(false), has_data_(false) +{ + if (int err = crypto_.get_random().GetError()) { + SetError(YasslError(err)); + return; + } + + CertManager& cm = crypto_.use_certManager(); + cm.CopySelfCert(ctx->getCert()); + + bool serverSide = secure_.use_parms().entity_ == server_end; + + if (ctx->getKey()) { + if (int err = cm.SetPrivateKey(*ctx->getKey())) { + SetError(YasslError(err)); + return; + } + else if (serverSide) { + // remove RSA or DSA suites depending on cert key type + ProtocolVersion pv = secure_.get_connection().version_; + + bool removeDH = secure_.use_parms().removeDH_; + bool removeRSA = false; + bool removeDSA = false; + + if (cm.get_keyType() == rsa_sa_algo) + removeDSA = true; + else + removeRSA = true; + secure_.use_parms().SetSuites(pv, removeDH, removeRSA, removeDSA); + } + } + else if (serverSide) { + SetError(no_key_file); + return; + } + + if (ctx->getMethod()->verifyPeer()) + cm.setVerifyPeer(); + if (ctx->getMethod()->verifyNone()) + cm.setVerifyNone(); + if (ctx->getMethod()->failNoCert()) + cm.setFailNoCert(); + cm.setVerifyCallback(ctx->getVerifyCallback()); + + if (serverSide) + crypto_.SetDH(ctx->GetDH_Parms()); + + const SSL_CTX::CertList& ca = ctx->GetCA_List(); + SSL_CTX::CertList::const_iterator first(ca.begin()); + SSL_CTX::CertList::const_iterator last(ca.end()); + + while (first != last) { + if (int err = cm.CopyCaCert(*first)) { + SetError(YasslError(err)); + return; + } + ++first; + } +} + + +// store pending security parameters from Server Hello +void SSL::set_pending(Cipher suite) +{ + Parameters& parms = secure_.use_parms(); + + switch (suite) { + + case TLS_RSA_WITH_AES_256_CBC_SHA: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = sha; + parms.kea_ = rsa_kea; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = AES_256_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS AES(AES_256_KEY_SZ)); + strncpy(parms.cipher_name_, cipher_names[TLS_RSA_WITH_AES_256_CBC_SHA], + MAX_SUITE_NAME); + break; + + case TLS_RSA_WITH_AES_128_CBC_SHA: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = sha; + parms.kea_ = rsa_kea; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = AES_128_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS AES); + strncpy(parms.cipher_name_, cipher_names[TLS_RSA_WITH_AES_128_CBC_SHA], + MAX_SUITE_NAME); + break; + + case SSL_RSA_WITH_3DES_EDE_CBC_SHA: + parms.bulk_cipher_algorithm_ = triple_des; + parms.mac_algorithm_ = sha; + parms.kea_ = rsa_kea; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = DES_EDE_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS DES_EDE); + strncpy(parms.cipher_name_, cipher_names[SSL_RSA_WITH_3DES_EDE_CBC_SHA] + , MAX_SUITE_NAME); + break; + + case SSL_RSA_WITH_DES_CBC_SHA: + parms.bulk_cipher_algorithm_ = des; + parms.mac_algorithm_ = sha; + parms.kea_ = rsa_kea; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = DES_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS DES); + strncpy(parms.cipher_name_, cipher_names[SSL_RSA_WITH_DES_CBC_SHA], + MAX_SUITE_NAME); + break; + + case SSL_RSA_WITH_RC4_128_SHA: + parms.bulk_cipher_algorithm_ = rc4; + parms.mac_algorithm_ = sha; + parms.kea_ = rsa_kea; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = RC4_KEY_SZ; + parms.iv_size_ = 0; + parms.cipher_type_ = stream; + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS RC4); + strncpy(parms.cipher_name_, cipher_names[SSL_RSA_WITH_RC4_128_SHA], + MAX_SUITE_NAME); + break; + + case SSL_RSA_WITH_RC4_128_MD5: + parms.bulk_cipher_algorithm_ = rc4; + parms.mac_algorithm_ = md5; + parms.kea_ = rsa_kea; + parms.hash_size_ = MD5_LEN; + parms.key_size_ = RC4_KEY_SZ; + parms.iv_size_ = 0; + parms.cipher_type_ = stream; + crypto_.setDigest(NEW_YS MD5); + crypto_.setCipher(NEW_YS RC4); + strncpy(parms.cipher_name_, cipher_names[SSL_RSA_WITH_RC4_128_MD5], + MAX_SUITE_NAME); + break; + + case SSL_DHE_RSA_WITH_DES_CBC_SHA: + parms.bulk_cipher_algorithm_ = des; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = DES_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS DES); + strncpy(parms.cipher_name_, cipher_names[SSL_DHE_RSA_WITH_DES_CBC_SHA], + MAX_SUITE_NAME); + break; + + case SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + parms.bulk_cipher_algorithm_ = triple_des; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = DES_EDE_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS DES_EDE); + strncpy(parms.cipher_name_, + cipher_names[SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA], MAX_SUITE_NAME); + break; + + case TLS_DHE_RSA_WITH_AES_256_CBC_SHA: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = AES_256_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS AES(AES_256_KEY_SZ)); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_RSA_WITH_AES_256_CBC_SHA], MAX_SUITE_NAME); + break; + + case TLS_DHE_RSA_WITH_AES_128_CBC_SHA: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = AES_128_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS AES); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_RSA_WITH_AES_128_CBC_SHA], MAX_SUITE_NAME); + break; + + case SSL_DHE_DSS_WITH_DES_CBC_SHA: + parms.bulk_cipher_algorithm_ = des; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = DES_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS DES); + strncpy(parms.cipher_name_, cipher_names[SSL_DHE_DSS_WITH_DES_CBC_SHA], + MAX_SUITE_NAME); + break; + + case SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA: + parms.bulk_cipher_algorithm_ = triple_des; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = DES_EDE_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS DES_EDE); + strncpy(parms.cipher_name_, + cipher_names[SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA], MAX_SUITE_NAME); + break; + + case TLS_DHE_DSS_WITH_AES_256_CBC_SHA: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = AES_256_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS AES(AES_256_KEY_SZ)); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_DSS_WITH_AES_256_CBC_SHA], MAX_SUITE_NAME); + break; + + case TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = sha; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = SHA_LEN; + parms.key_size_ = AES_128_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS SHA); + crypto_.setCipher(NEW_YS AES); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_DSS_WITH_AES_128_CBC_SHA], MAX_SUITE_NAME); + break; + + case TLS_RSA_WITH_AES_256_CBC_RMD160: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = rmd; + parms.kea_ = rsa_kea; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = AES_256_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS AES(AES_256_KEY_SZ)); + strncpy(parms.cipher_name_, + cipher_names[TLS_RSA_WITH_AES_256_CBC_RMD160], MAX_SUITE_NAME); + break; + + case TLS_RSA_WITH_AES_128_CBC_RMD160: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = rmd; + parms.kea_ = rsa_kea; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = AES_128_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS AES); + strncpy(parms.cipher_name_, + cipher_names[TLS_RSA_WITH_AES_128_CBC_RMD160], MAX_SUITE_NAME); + break; + + case TLS_RSA_WITH_3DES_EDE_CBC_RMD160: + parms.bulk_cipher_algorithm_ = triple_des; + parms.mac_algorithm_ = rmd; + parms.kea_ = rsa_kea; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = DES_EDE_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS DES_EDE); + strncpy(parms.cipher_name_, + cipher_names[TLS_RSA_WITH_3DES_EDE_CBC_RMD160], MAX_SUITE_NAME); + break; + + case TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160: + parms.bulk_cipher_algorithm_ = triple_des; + parms.mac_algorithm_ = rmd; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = DES_EDE_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS DES_EDE); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD160], + MAX_SUITE_NAME); + break; + + case TLS_DHE_RSA_WITH_AES_256_CBC_RMD160: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = rmd; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = AES_256_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS AES(AES_256_KEY_SZ)); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_RSA_WITH_AES_256_CBC_RMD160], + MAX_SUITE_NAME); + break; + + case TLS_DHE_RSA_WITH_AES_128_CBC_RMD160: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = rmd; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = rsa_sa_algo; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = AES_128_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS AES); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_RSA_WITH_AES_128_CBC_RMD160], + MAX_SUITE_NAME); + break; + + case TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160: + parms.bulk_cipher_algorithm_ = triple_des; + parms.mac_algorithm_ = rmd; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = DES_EDE_KEY_SZ; + parms.iv_size_ = DES_IV_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS DES_EDE); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160], + MAX_SUITE_NAME); + break; + + case TLS_DHE_DSS_WITH_AES_256_CBC_RMD160: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = rmd; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = AES_256_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS AES(AES_256_KEY_SZ)); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_DSS_WITH_AES_256_CBC_RMD160], + MAX_SUITE_NAME); + break; + + case TLS_DHE_DSS_WITH_AES_128_CBC_RMD160: + parms.bulk_cipher_algorithm_ = aes; + parms.mac_algorithm_ = rmd; + parms.kea_ = diffie_hellman_kea; + parms.sig_algo_ = dsa_sa_algo; + parms.hash_size_ = RMD_LEN; + parms.key_size_ = AES_128_KEY_SZ; + parms.iv_size_ = AES_BLOCK_SZ; + parms.cipher_type_ = block; + secure_.use_connection().send_server_key_ = true; // eph + crypto_.setDigest(NEW_YS RMD); + crypto_.setCipher(NEW_YS AES); + strncpy(parms.cipher_name_, + cipher_names[TLS_DHE_DSS_WITH_AES_128_CBC_RMD160], + MAX_SUITE_NAME); + break; + + default: + SetError(unknown_cipher); + } +} + + +// store peer's random +void SSL::set_random(const opaque* random, ConnectionEnd sender) +{ + if (sender == client_end) + memcpy(secure_.use_connection().client_random_, random, RAN_LEN); + else + memcpy(secure_.use_connection().server_random_, random, RAN_LEN); +} + + +// store client pre master secret +void SSL::set_preMaster(const opaque* pre, uint sz) +{ + secure_.use_connection().AllocPreSecret(sz); + memcpy(secure_.use_connection().pre_master_secret_, pre, sz); +} + + +// set yaSSL zlib type compression +int SSL::SetCompression() +{ +#ifdef HAVE_LIBZ + secure_.use_connection().compression_ = true; + return 0; +#else + return -1; // not built in +#endif +} + + +// unset yaSSL zlib type compression +void SSL::UnSetCompression() +{ + secure_.use_connection().compression_ = false; +} + + +// is yaSSL zlib compression on +bool SSL::CompressionOn() const +{ + return secure_.get_connection().compression_; +} + + +// store master secret +void SSL::set_masterSecret(const opaque* sec) +{ + memcpy(secure_.use_connection().master_secret_, sec, SECRET_LEN); +} + +// store server issued id +void SSL::set_sessionID(const opaque* sessionID) +{ + memcpy(secure_.use_connection().sessionID_, sessionID, ID_LEN); + secure_.use_connection().sessionID_Set_ = true; +} + + +// store error +void SSL::SetError(YasslError ye) +{ + states_.SetError(ye); + //strncpy(states_.useString(), e.what(), mySTL::named_exception::NAME_SIZE); + // TODO: add string here +} + + +// set the quiet shutdown mode (close_nofiy not sent or received on shutdown) +void SSL::SetQuietShutdown(bool mode) +{ + quietShutdown_ = mode; +} + + +Buffers& SSL::useBuffers() +{ + return buffers_; +} + + +// locals +namespace { + +// DeriveKeys and MasterSecret helper sets prefix letters +static bool setPrefix(opaque* sha_input, int i) +{ + switch (i) { + case 0: + memcpy(sha_input, "A", 1); + break; + case 1: + memcpy(sha_input, "BB", 2); + break; + case 2: + memcpy(sha_input, "CCC", 3); + break; + case 3: + memcpy(sha_input, "DDDD", 4); + break; + case 4: + memcpy(sha_input, "EEEEE", 5); + break; + case 5: + memcpy(sha_input, "FFFFFF", 6); + break; + case 6: + memcpy(sha_input, "GGGGGGG", 7); + break; + default: + return false; // prefix_error + } + return true; +} + + +const char handshake_order[] = "Out of order HandShake Message!"; + + +} // namespcae for locals + + +void SSL::order_error() +{ + SetError(out_of_order); +} + + +// Create and store the master secret see page 32, 6.1 +void SSL::makeMasterSecret() +{ + if (isTLS()) + makeTLSMasterSecret(); + else { + opaque sha_output[SHA_LEN]; + + const uint& preSz = secure_.get_connection().pre_secret_len_; + output_buffer md5_input(preSz + SHA_LEN); + output_buffer sha_input(PREFIX + preSz + 2 * RAN_LEN); + + MD5 md5; + SHA sha; + + md5_input.write(secure_.get_connection().pre_master_secret_, preSz); + + for (int i = 0; i < MASTER_ROUNDS; ++i) { + opaque prefix[PREFIX]; + if (!setPrefix(prefix, i)) { + SetError(prefix_error); + return; + } + + sha_input.set_current(0); + sha_input.write(prefix, i + 1); + + sha_input.write(secure_.get_connection().pre_master_secret_,preSz); + sha_input.write(secure_.get_connection().client_random_, RAN_LEN); + sha_input.write(secure_.get_connection().server_random_, RAN_LEN); + sha.get_digest(sha_output, sha_input.get_buffer(), + sha_input.get_size()); + + md5_input.set_current(preSz); + md5_input.write(sha_output, SHA_LEN); + md5.get_digest(&secure_.use_connection().master_secret_[i*MD5_LEN], + md5_input.get_buffer(), md5_input.get_size()); + } + deriveKeys(); + } + secure_.use_connection().CleanPreMaster(); +} + + +// create TLSv1 master secret +void SSL::makeTLSMasterSecret() +{ + opaque seed[SEED_LEN]; + + memcpy(seed, secure_.get_connection().client_random_, RAN_LEN); + memcpy(&seed[RAN_LEN], secure_.get_connection().server_random_, RAN_LEN); + + PRF(secure_.use_connection().master_secret_, SECRET_LEN, + secure_.get_connection().pre_master_secret_, + secure_.get_connection().pre_secret_len_, + master_label, MASTER_LABEL_SZ, + seed, SEED_LEN); + + deriveTLSKeys(); +} + + +// derive mac, write, and iv keys for server and client, see page 34, 6.2.2 +void SSL::deriveKeys() +{ + int length = 2 * secure_.get_parms().hash_size_ + + 2 * secure_.get_parms().key_size_ + + 2 * secure_.get_parms().iv_size_; + int rounds = (length + MD5_LEN - 1 ) / MD5_LEN; + input_buffer key_data(rounds * MD5_LEN); + + opaque sha_output[SHA_LEN]; + opaque md5_input[SECRET_LEN + SHA_LEN]; + opaque sha_input[KEY_PREFIX + SECRET_LEN + 2 * RAN_LEN]; + + MD5 md5; + SHA sha; + + memcpy(md5_input, secure_.get_connection().master_secret_, SECRET_LEN); + + for (int i = 0; i < rounds; ++i) { + int j = i + 1; + if (!setPrefix(sha_input, i)) { + SetError(prefix_error); + return; + } + + memcpy(&sha_input[j], secure_.get_connection().master_secret_, + SECRET_LEN); + memcpy(&sha_input[j+SECRET_LEN], + secure_.get_connection().server_random_, RAN_LEN); + memcpy(&sha_input[j + SECRET_LEN + RAN_LEN], + secure_.get_connection().client_random_, RAN_LEN); + sha.get_digest(sha_output, sha_input, + sizeof(sha_input) - KEY_PREFIX + j); + + memcpy(&md5_input[SECRET_LEN], sha_output, SHA_LEN); + md5.get_digest(key_data.get_buffer() + i * MD5_LEN, + md5_input, sizeof(md5_input)); + } + storeKeys(key_data.get_buffer()); +} + + +// derive mac, write, and iv keys for server and client +void SSL::deriveTLSKeys() +{ + int length = 2 * secure_.get_parms().hash_size_ + + 2 * secure_.get_parms().key_size_ + + 2 * secure_.get_parms().iv_size_; + opaque seed[SEED_LEN]; + input_buffer key_data(length); + + memcpy(seed, secure_.get_connection().server_random_, RAN_LEN); + memcpy(&seed[RAN_LEN], secure_.get_connection().client_random_, RAN_LEN); + + PRF(key_data.get_buffer(), length, secure_.get_connection().master_secret_, + SECRET_LEN, key_label, KEY_LABEL_SZ, seed, SEED_LEN); + + storeKeys(key_data.get_buffer()); +} + + +// store mac, write, and iv keys for client and server +void SSL::storeKeys(const opaque* key_data) +{ + int sz = secure_.get_parms().hash_size_; + memcpy(secure_.use_connection().client_write_MAC_secret_, key_data, sz); + int i = sz; + memcpy(secure_.use_connection().server_write_MAC_secret_,&key_data[i], sz); + i += sz; + + sz = secure_.get_parms().key_size_; + memcpy(secure_.use_connection().client_write_key_, &key_data[i], sz); + i += sz; + memcpy(secure_.use_connection().server_write_key_, &key_data[i], sz); + i += sz; + + sz = secure_.get_parms().iv_size_; + memcpy(secure_.use_connection().client_write_IV_, &key_data[i], sz); + i += sz; + memcpy(secure_.use_connection().server_write_IV_, &key_data[i], sz); + + setKeys(); +} + + +// set encrypt/decrypt keys and ivs +void SSL::setKeys() +{ + Connection& conn = secure_.use_connection(); + + if (secure_.get_parms().entity_ == client_end) { + crypto_.use_cipher().set_encryptKey(conn.client_write_key_, + conn.client_write_IV_); + crypto_.use_cipher().set_decryptKey(conn.server_write_key_, + conn.server_write_IV_); + } + else { + crypto_.use_cipher().set_encryptKey(conn.server_write_key_, + conn.server_write_IV_); + crypto_.use_cipher().set_decryptKey(conn.client_write_key_, + conn.client_write_IV_); + } +} + + + +// local functors +namespace yassl_int_cpp_local1 { // for explicit templates + +struct SumData { + uint total_; + SumData() : total_(0) {} + void operator()(input_buffer* data) { total_ += data->get_remaining(); } +}; + + +struct SumBuffer { + uint total_; + SumBuffer() : total_(0) {} + void operator()(output_buffer* buffer) { total_ += buffer->get_size(); } +}; + +} // namespace for locals +using namespace yassl_int_cpp_local1; + + +uint SSL::bufferedData() +{ + return STL::for_each(buffers_.getData().begin(),buffers_.getData().end(), + SumData()).total_; +} + + +// use input buffer to fill data +void SSL::fillData(Data& data) +{ + if (GetError()) return; + uint dataSz = data.get_length(); // input, data size to fill + size_t elements = buffers_.getData().size(); + + data.set_length(0); // output, actual data filled + dataSz = min(dataSz, bufferedData()); + + for (size_t i = 0; i < elements; i++) { + input_buffer* front = buffers_.getData().front(); + uint frontSz = front->get_remaining(); + uint readSz = min(dataSz - data.get_length(), frontSz); + + front->read(data.set_buffer() + data.get_length(), readSz); + data.set_length(data.get_length() + readSz); + + if (readSz == frontSz) { + buffers_.useData().pop_front(); + ysDelete(front); + } + if (data.get_length() == dataSz) + break; + } + + if (buffers_.getData().size() == 0) has_data_ = false; // none left +} + + +// like Fill but keep data in buffer +void SSL::PeekData(Data& data) +{ + if (GetError()) return; + uint dataSz = data.get_length(); // input, data size to fill + size_t elements = buffers_.getData().size(); + + data.set_length(0); // output, actual data filled + dataSz = min(dataSz, bufferedData()); + + Buffers::inputList::iterator front = buffers_.useData().begin(); + + while (elements) { + uint frontSz = (*front)->get_remaining(); + uint readSz = min(dataSz - data.get_length(), frontSz); + uint before = (*front)->get_current(); + + (*front)->read(data.set_buffer() + data.get_length(), readSz); + data.set_length(data.get_length() + readSz); + (*front)->set_current(before); + + if (data.get_length() == dataSz) + break; + + elements--; + front++; + } +} + + +// flush output buffer +void SSL::flushBuffer() +{ + if (GetError()) return; + + uint sz = STL::for_each(buffers_.getHandShake().begin(), + buffers_.getHandShake().end(), + SumBuffer()).total_; + output_buffer out(sz); + size_t elements = buffers_.getHandShake().size(); + + for (size_t i = 0; i < elements; i++) { + output_buffer* front = buffers_.getHandShake().front(); + out.write(front->get_buffer(), front->get_size()); + + buffers_.useHandShake().pop_front(); + ysDelete(front); + } + Send(out.get_buffer(), out.get_size()); +} + + +void SSL::Send(const byte* buffer, uint sz) +{ + if (socket_.send(buffer, sz) != sz) + SetError(send_error); +} + + +// get sequence number, if verify get peer's +uint SSL::get_SEQIncrement(bool verify) +{ + if (verify) + return secure_.use_connection().peer_sequence_number_++; + else + return secure_.use_connection().sequence_number_++; +} + + +const byte* SSL::get_macSecret(bool verify) +{ + if ( (secure_.get_parms().entity_ == client_end && !verify) || + (secure_.get_parms().entity_ == server_end && verify) ) + return secure_.get_connection().client_write_MAC_secret_; + else + return secure_.get_connection().server_write_MAC_secret_; +} + + +void SSL::verifyState(const RecordLayerHeader& rlHeader) +{ + if (GetError()) return; + + if (rlHeader.version_.major_ != 3 || rlHeader.version_.minor_ > 2) { + SetError(badVersion_error); + return; + } + + if (states_.getRecord() == recordNotReady || + (rlHeader.type_ == application_data && // data and handshake + states_.getHandShake() != handShakeReady) ) // isn't complete yet + SetError(record_layer); +} + + +void SSL::verifyState(const HandShakeHeader& hsHeader) +{ + if (GetError()) return; + + if (states_.getHandShake() == handShakeNotReady) { + SetError(handshake_layer); + return; + } + + if (secure_.get_parms().entity_ == client_end) + verifyClientState(hsHeader.get_handshakeType()); + else + verifyServerState(hsHeader.get_handshakeType()); +} + + +void SSL::verifyState(ClientState cs) +{ + if (GetError()) return; + if (states_.getClient() != cs) order_error(); +} + + +void SSL::verifyState(ServerState ss) +{ + if (GetError()) return; + if (states_.getServer() != ss) order_error(); +} + + +void SSL::verfiyHandShakeComplete() +{ + if (GetError()) return; + if (states_.getHandShake() != handShakeReady) order_error(); +} + + +void SSL::verifyClientState(HandShakeType hsType) +{ + if (GetError()) return; + + switch(hsType) { + case server_hello : + if (states_.getClient() != serverNull) + order_error(); + break; + case certificate : + if (states_.getClient() != serverHelloComplete) + order_error(); + break; + case server_key_exchange : + if (states_.getClient() != serverCertComplete) + order_error(); + break; + case certificate_request : + if (states_.getClient() != serverCertComplete && + states_.getClient() != serverKeyExchangeComplete) + order_error(); + break; + case server_hello_done : + if (states_.getClient() != serverCertComplete && + states_.getClient() != serverKeyExchangeComplete) + order_error(); + break; + case finished : + if (states_.getClient() != serverHelloDoneComplete || + secure_.get_parms().pending_) // no change + order_error(); // cipher yet + break; + default : + order_error(); + }; +} + + +void SSL::verifyServerState(HandShakeType hsType) +{ + if (GetError()) return; + + switch(hsType) { + case client_hello : + if (states_.getServer() != clientNull) + order_error(); + break; + case certificate : + if (states_.getServer() != clientHelloComplete) + order_error(); + break; + case client_key_exchange : + if (states_.getServer() != clientHelloComplete) + order_error(); + break; + case certificate_verify : + if (states_.getServer() != clientKeyExchangeComplete) + order_error(); + break; + case finished : + if (states_.getServer() != clientKeyExchangeComplete || + secure_.get_parms().pending_) // no change + order_error(); // cipher yet + break; + default : + order_error(); + }; +} + + +// try to find a suite match +void SSL::matchSuite(const opaque* peer, uint length) +{ + if (length == 0 || (length % 2) != 0) { + SetError(bad_input); + return; + } + + // start with best, if a match we are good, Ciphers are at odd index + // since all SSL and TLS ciphers have 0x00 first byte + for (uint i = 1; i < secure_.get_parms().suites_size_; i += 2) + for (uint j = 1; j < length; j+= 2) + if (secure_.use_parms().suites_[i] == peer[j]) { + secure_.use_parms().suite_[0] = 0x00; + secure_.use_parms().suite_[1] = peer[j]; + + return; + } + + SetError(match_error); +} + + +void SSL::set_session(SSL_SESSION* s) +{ + if (getSecurity().GetContext()->GetSessionCacheOff()) + return; + + if (s && GetSessions().lookup(s->GetID(), &secure_.use_resume())) { + secure_.set_resuming(true); + crypto_.use_certManager().setPeerX509(s->GetPeerX509()); + } +} + + +const Crypto& SSL::getCrypto() const +{ + return crypto_; +} + + +const Security& SSL::getSecurity() const +{ + return secure_; +} + + +const States& SSL::getStates() const +{ + return states_; +} + + +const sslHashes& SSL::getHashes() const +{ + return hashes_; +} + + +const sslFactory& SSL::getFactory() const +{ + return GetSSL_Factory(); +} + + +const Socket& SSL::getSocket() const +{ + return socket_; +} + + +YasslError SSL::GetError() const +{ + return states_.What(); +} + + +bool SSL::GetQuietShutdown() const +{ + return quietShutdown_; +} + + +bool SSL::GetMultiProtocol() const +{ + return secure_.GetContext()->getMethod()->multipleProtocol(); +} + + +Crypto& SSL::useCrypto() +{ + return crypto_; +} + + +Security& SSL::useSecurity() +{ + return secure_; +} + + +States& SSL::useStates() +{ + return states_; +} + + +sslHashes& SSL::useHashes() +{ + return hashes_; +} + + +Socket& SSL::useSocket() +{ + return socket_; +} + + +Log& SSL::useLog() +{ + return log_; +} + + +bool SSL::isTLS() const +{ + return secure_.get_connection().TLS_; +} + + +bool SSL::isTLSv1_1() const +{ + return secure_.get_connection().TLSv1_1_; +} + + +// is there buffered data available, optimization to remove iteration on buffer +bool SSL::HasData() const +{ + return has_data_; +} + + +void SSL::addData(input_buffer* data) +{ + buffers_.useData().push_back(data); + if (!has_data_) has_data_ = true; +} + + +void SSL::addBuffer(output_buffer* b) +{ + buffers_.useHandShake().push_back(b); +} + + +void SSL_SESSION::CopyX509(X509* x) +{ + assert(peerX509_ == 0); + if (x == 0) return; + + X509_NAME* issuer = x->GetIssuer(); + X509_NAME* subject = x->GetSubject(); + ASN1_STRING* before = x->GetBefore(); + ASN1_STRING* after = x->GetAfter(); + + peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), + subject->GetName(), subject->GetLength(), (const char*) before->data, + before->length, (const char*) after->data, after->length); +} + + +// store connection parameters +SSL_SESSION::SSL_SESSION(const SSL& ssl, RandomPool& ran) + : timeout_(DEFAULT_TIMEOUT), random_(ran), peerX509_(0) +{ + const Connection& conn = ssl.getSecurity().get_connection(); + + memcpy(sessionID_, conn.sessionID_, ID_LEN); + memcpy(master_secret_, conn.master_secret_, SECRET_LEN); + memcpy(suite_, ssl.getSecurity().get_parms().suite_, SUITE_LEN); + + bornOn_ = lowResTimer(); + + CopyX509(ssl.getCrypto().get_certManager().get_peerX509()); +} + + +// for resumption copy in ssl::parameters +SSL_SESSION::SSL_SESSION(RandomPool& ran) + : bornOn_(0), timeout_(0), random_(ran), peerX509_(0) +{ + memset(sessionID_, 0, ID_LEN); + memset(master_secret_, 0, SECRET_LEN); + memset(suite_, 0, SUITE_LEN); +} + + +SSL_SESSION& SSL_SESSION::operator=(const SSL_SESSION& that) +{ + memcpy(sessionID_, that.sessionID_, ID_LEN); + memcpy(master_secret_, that.master_secret_, SECRET_LEN); + memcpy(suite_, that.suite_, SUITE_LEN); + + bornOn_ = that.bornOn_; + timeout_ = that.timeout_; + + if (peerX509_) { + ysDelete(peerX509_); + peerX509_ = 0; + } + CopyX509(that.peerX509_); + + return *this; +} + + +const opaque* SSL_SESSION::GetID() const +{ + return sessionID_; +} + + +const opaque* SSL_SESSION::GetSecret() const +{ + return master_secret_; +} + + +const Cipher* SSL_SESSION::GetSuite() const +{ + return suite_; +} + + +X509* SSL_SESSION::GetPeerX509() const +{ + return peerX509_; +} + + +uint SSL_SESSION::GetBornOn() const +{ + return bornOn_; +} + + +uint SSL_SESSION::GetTimeOut() const +{ + return timeout_; +} + + +void SSL_SESSION::SetTimeOut(uint t) +{ + timeout_ = t; +} + + +extern void clean(volatile opaque*, uint, RandomPool&); + + +// clean up secret data +SSL_SESSION::~SSL_SESSION() +{ + volatile opaque* p = master_secret_; + clean(p, SECRET_LEN, random_); + + ysDelete(peerX509_); +} + + +static Sessions* sessionsInstance = 0; + +Sessions& GetSessions() +{ + if (!sessionsInstance) + sessionsInstance = NEW_YS Sessions; + return *sessionsInstance; +} + + +static sslFactory* sslFactoryInstance = 0; + +sslFactory& GetSSL_Factory() +{ + if (!sslFactoryInstance) + sslFactoryInstance = NEW_YS sslFactory; + return *sslFactoryInstance; +} + + +static Errors* errorsInstance = 0; + +Errors& GetErrors() +{ + if (!errorsInstance) + errorsInstance = NEW_YS Errors; + return *errorsInstance; +} + + +typedef Mutex::Lock Lock; + + + +void Sessions::add(const SSL& ssl) +{ + if (ssl.getSecurity().get_connection().sessionID_Set_) { + Lock guard(mutex_); + list_.push_back(NEW_YS SSL_SESSION(ssl, random_)); + count_++; + } + + if (count_ > SESSION_FLUSH_COUNT) + if (!ssl.getSecurity().GetContext()->GetSessionCacheFlushOff()) + Flush(); +} + + +Sessions::~Sessions() +{ + STL::for_each(list_.begin(), list_.end(), del_ptr_zero()); +} + + +// locals +namespace yassl_int_cpp_local2 { // for explicit templates + +typedef STL::list::iterator sess_iterator; +typedef STL::list::iterator thr_iterator; + +struct sess_match { + const opaque* id_; + explicit sess_match(const opaque* p) : id_(p) {} + + bool operator()(SSL_SESSION* sess) + { + if ( memcmp(sess->GetID(), id_, ID_LEN) == 0) + return true; + return false; + } +}; + + +THREAD_ID_T GetSelf() +{ +#ifndef _POSIX_THREADS + return GetCurrentThreadId(); +#else + return pthread_self(); +#endif +} + +struct thr_match { + THREAD_ID_T id_; + explicit thr_match() : id_(GetSelf()) {} + + bool operator()(ThreadError thr) + { + if (thr.threadID_ == id_) + return true; + return false; + } +}; + + +} // local namespace +using namespace yassl_int_cpp_local2; + + +// lookup session by id, return a copy if space provided +SSL_SESSION* Sessions::lookup(const opaque* id, SSL_SESSION* copy) +{ + Lock guard(mutex_); + sess_iterator find = STL::find_if(list_.begin(), list_.end(), + sess_match(id)); + if (find != list_.end()) { + uint current = lowResTimer(); + if ( ((*find)->GetBornOn() + (*find)->GetTimeOut()) < current) { + del_ptr_zero()(*find); + list_.erase(find); + return 0; + } + if (copy) + *copy = *(*find); + return *find; + } + return 0; +} + + +// remove a session by id +void Sessions::remove(const opaque* id) +{ + Lock guard(mutex_); + sess_iterator find = STL::find_if(list_.begin(), list_.end(), + sess_match(id)); + if (find != list_.end()) { + del_ptr_zero()(*find); + list_.erase(find); + } +} + + +// flush expired sessions from cache +void Sessions::Flush() +{ + Lock guard(mutex_); + sess_iterator next = list_.begin(); + uint current = lowResTimer(); + + while (next != list_.end()) { + sess_iterator si = next; + ++next; + if ( ((*si)->GetBornOn() + (*si)->GetTimeOut()) < current) { + del_ptr_zero()(*si); + list_.erase(si); + } + } + count_ = 0; // reset flush counter +} + + +// remove a self thread error +void Errors::Remove() +{ + Lock guard(mutex_); + thr_iterator find = STL::find_if(list_.begin(), list_.end(), + thr_match()); + if (find != list_.end()) + list_.erase(find); +} + + +// lookup self error code +int Errors::Lookup(bool peek) +{ + Lock guard(mutex_); + thr_iterator find = STL::find_if(list_.begin(), list_.end(), + thr_match()); + if (find != list_.end()) { + int ret = find->errorID_; + if (!peek) + list_.erase(find); + return ret; + } + else + return 0; +} + + +// add a new error code for self +void Errors::Add(int error) +{ + ThreadError add; + add.errorID_ = error; + add.threadID_ = GetSelf(); + + Remove(); // may have old error + + Lock guard(mutex_); + list_.push_back(add); +} + + +SSL_METHOD::SSL_METHOD(ConnectionEnd ce, ProtocolVersion pv, bool multiProto) + : version_(pv), side_(ce), verifyPeer_(false), verifyNone_(false), + failNoCert_(false), multipleProtocol_(multiProto) +{} + + +ProtocolVersion SSL_METHOD::getVersion() const +{ + return version_; +} + + +ConnectionEnd SSL_METHOD::getSide() const +{ + return side_; +} + + +void SSL_METHOD::setVerifyPeer() +{ + verifyPeer_ = true; +} + + +void SSL_METHOD::setVerifyNone() +{ + verifyNone_ = true; +} + + +void SSL_METHOD::setFailNoCert() +{ + failNoCert_ = true; +} + + +bool SSL_METHOD::verifyPeer() const +{ + return verifyPeer_; +} + + +bool SSL_METHOD::verifyNone() const +{ + return verifyNone_; +} + + +bool SSL_METHOD::failNoCert() const +{ + return failNoCert_; +} + + +bool SSL_METHOD::multipleProtocol() const +{ + return multipleProtocol_; +} + + +SSL_CTX::SSL_CTX(SSL_METHOD* meth) + : method_(meth), certificate_(0), privateKey_(0), passwordCb_(0), + userData_(0), sessionCacheOff_(false), sessionCacheFlushOff_(false), + verifyCallback_(0) +{} + + +SSL_CTX::~SSL_CTX() +{ + ysDelete(method_); + ysDelete(certificate_); + ysDelete(privateKey_); + + STL::for_each(caList_.begin(), caList_.end(), del_ptr_zero()); +} + + +void SSL_CTX::AddCA(x509* ca) +{ + caList_.push_back(ca); +} + + +const SSL_CTX::CertList& +SSL_CTX::GetCA_List() const +{ + return caList_; +} + + +const VerifyCallback SSL_CTX::getVerifyCallback() const +{ + return verifyCallback_; +} + + +const x509* SSL_CTX::getCert() const +{ + return certificate_; +} + + +const x509* SSL_CTX::getKey() const +{ + return privateKey_; +} + + +const SSL_METHOD* SSL_CTX::getMethod() const +{ + return method_; +} + + +const Ciphers& SSL_CTX::GetCiphers() const +{ + return ciphers_; +} + + +const DH_Parms& SSL_CTX::GetDH_Parms() const +{ + return dhParms_; +} + + +const Stats& SSL_CTX::GetStats() const +{ + return stats_; +} + + +pem_password_cb SSL_CTX::GetPasswordCb() const +{ + return passwordCb_; +} + + +void SSL_CTX::SetPasswordCb(pem_password_cb cb) +{ + passwordCb_ = cb; +} + + +void* SSL_CTX::GetUserData() const +{ + return userData_; +} + + +bool SSL_CTX::GetSessionCacheOff() const +{ + return sessionCacheOff_; +} + + +bool SSL_CTX::GetSessionCacheFlushOff() const +{ + return sessionCacheFlushOff_; +} + + +void SSL_CTX::SetUserData(void* data) +{ + userData_ = data; +} + + +void SSL_CTX::SetSessionCacheOff() +{ + sessionCacheOff_ = true; +} + + +void SSL_CTX::SetSessionCacheFlushOff() +{ + sessionCacheFlushOff_ = true; +} + + +void SSL_CTX::setVerifyPeer() +{ + method_->setVerifyPeer(); +} + + +void SSL_CTX::setVerifyNone() +{ + method_->setVerifyNone(); +} + + +void SSL_CTX::setFailNoCert() +{ + method_->setFailNoCert(); +} + + +void SSL_CTX::setVerifyCallback(VerifyCallback vc) +{ + verifyCallback_ = vc; +} + + +bool SSL_CTX::SetDH(const DH& dh) +{ + dhParms_.p_ = dh.p->int_; + dhParms_.g_ = dh.g->int_; + + return dhParms_.set_ = true; +} + + +bool SSL_CTX::SetCipherList(const char* list) +{ + if (!list) + return false; + + bool ret = false; + char name[MAX_SUITE_NAME]; + + char needle[] = ":"; + char* haystack = const_cast(list); + char* prev; + + const int suiteSz = sizeof(cipher_names) / sizeof(cipher_names[0]); + int idx = 0; + + for(;;) { + size_t len; + prev = haystack; + haystack = strstr(haystack, needle); + + if (!haystack) // last cipher + len = min(sizeof(name), strlen(prev)); + else + len = min(sizeof(name), (size_t)(haystack - prev)); + + strncpy(name, prev, len); + name[(len == sizeof(name)) ? len - 1 : len] = 0; + + for (int i = 0; i < suiteSz; i++) + if (strncmp(name, cipher_names[i], sizeof(name)) == 0) { + + ciphers_.suites_[idx++] = 0x00; // first byte always zero + ciphers_.suites_[idx++] = i; + + if (!ret) ret = true; // found at least one + break; + } + if (!haystack) break; + haystack++; + } + + if (ret) { + ciphers_.setSuites_ = true; + ciphers_.suiteSz_ = idx; + } + + return ret; +} + + +void SSL_CTX::IncrementStats(StatsField fd) +{ + + Lock guard(mutex_); + + switch (fd) { + + case Accept: + ++stats_.accept_; + break; + + case Connect: + ++stats_.connect_; + break; + + case AcceptGood: + ++stats_.acceptGood_; + break; + + case ConnectGood: + ++stats_.connectGood_; + break; + + case AcceptRenegotiate: + ++stats_.acceptRenegotiate_; + break; + + case ConnectRenegotiate: + ++stats_.connectRenegotiate_; + break; + + case Hits: + ++stats_.hits_; + break; + + case CbHits: + ++stats_.cbHits_; + break; + + case CacheFull: + ++stats_.cacheFull_; + break; + + case Misses: + ++stats_.misses_; + break; + + case Timeouts: + ++stats_.timeouts_; + break; + + case Number: + ++stats_.number_; + break; + + case GetCacheSize: + ++stats_.getCacheSize_; + break; + + case VerifyMode: + ++stats_.verifyMode_; + break; + + case VerifyDepth: + ++stats_.verifyDepth_; + break; + + default: + break; + } +} + + +Crypto::Crypto() + : digest_(0), cipher_(0), dh_(0) +{} + + +Crypto::~Crypto() +{ + ysDelete(dh_); + ysDelete(cipher_); + ysDelete(digest_); +} + + +const Digest& Crypto::get_digest() const +{ + return *digest_; +} + + +const BulkCipher& Crypto::get_cipher() const +{ + return *cipher_; +} + + +const DiffieHellman& Crypto::get_dh() const +{ + return *dh_; +} + + +const RandomPool& Crypto::get_random() const +{ + return random_; +} + + +const CertManager& Crypto::get_certManager() const +{ + return cert_; +} + + + +Digest& Crypto::use_digest() +{ + return *digest_; +} + + +BulkCipher& Crypto::use_cipher() +{ + return *cipher_; +} + + +DiffieHellman& Crypto::use_dh() +{ + return *dh_; +} + + +RandomPool& Crypto::use_random() +{ + return random_; +} + + +CertManager& Crypto::use_certManager() +{ + return cert_; +} + + + +void Crypto::SetDH(DiffieHellman* dh) +{ + dh_ = dh; +} + + +void Crypto::SetDH(const DH_Parms& dh) +{ + if (dh.set_) + dh_ = NEW_YS DiffieHellman(dh.p_, dh.g_, random_); +} + + +bool Crypto::DhSet() +{ + return dh_ != 0; +} + + +void Crypto::setDigest(Digest* digest) +{ + digest_ = digest; +} + + +void Crypto::setCipher(BulkCipher* c) +{ + cipher_ = c; +} + + +const MD5& sslHashes::get_MD5() const +{ + return md5HandShake_; +} + + +const SHA& sslHashes::get_SHA() const +{ + return shaHandShake_; +} + + +const Finished& sslHashes::get_verify() const +{ + return verify_; +} + + +const Hashes& sslHashes::get_certVerify() const +{ + return certVerify_; +} + + +MD5& sslHashes::use_MD5(){ + return md5HandShake_; +} + + +SHA& sslHashes::use_SHA() +{ + return shaHandShake_; +} + + +Finished& sslHashes::use_verify() +{ + return verify_; +} + + +Hashes& sslHashes::use_certVerify() +{ + return certVerify_; +} + + +Buffers::Buffers() : rawInput_(0) +{} + + +Buffers::~Buffers() +{ + STL::for_each(handShakeList_.begin(), handShakeList_.end(), + del_ptr_zero()) ; + STL::for_each(dataList_.begin(), dataList_.end(), + del_ptr_zero()) ; + ysDelete(rawInput_); +} + + +void Buffers::SetRawInput(input_buffer* ib) +{ + assert(rawInput_ == 0); + rawInput_ = ib; +} + + +input_buffer* Buffers::TakeRawInput() +{ + input_buffer* ret = rawInput_; + rawInput_ = 0; + + return ret; +} + + +const Buffers::inputList& Buffers::getData() const +{ + return dataList_; +} + + +const Buffers::outputList& Buffers::getHandShake() const +{ + return handShakeList_; +} + + +Buffers::inputList& Buffers::useData() +{ + return dataList_; +} + + +Buffers::outputList& Buffers::useHandShake() +{ + return handShakeList_; +} + + +Security::Security(ProtocolVersion pv, RandomPool& ran, ConnectionEnd ce, + const Ciphers& ciphers, SSL_CTX* ctx, bool haveDH) + : conn_(pv, ran), parms_(ce, ciphers, pv, haveDH), resumeSession_(ran), + ctx_(ctx), resuming_(false) +{} + + +const Connection& Security::get_connection() const +{ + return conn_; +} + + +const SSL_CTX* Security::GetContext() const +{ + return ctx_; +} + + +const Parameters& Security::get_parms() const +{ + return parms_; +} + + +const SSL_SESSION& Security::get_resume() const +{ + return resumeSession_; +} + + +bool Security::get_resuming() const +{ + return resuming_; +} + + +Connection& Security::use_connection() +{ + return conn_; +} + + +Parameters& Security::use_parms() +{ + return parms_; +} + + +SSL_SESSION& Security::use_resume() +{ + return resumeSession_; +} + + +void Security::set_resuming(bool b) +{ + resuming_ = b; +} + + +X509_NAME::X509_NAME(const char* n, size_t sz) + : name_(0), sz_(sz) +{ + if (sz) { + name_ = NEW_YS char[sz]; + memcpy(name_, n, sz); + } + entry_.data = 0; +} + + +X509_NAME::~X509_NAME() +{ + ysArrayDelete(name_); + ysArrayDelete(entry_.data); +} + + +const char* X509_NAME::GetName() const +{ + return name_; +} + + +size_t X509_NAME::GetLength() const +{ + return sz_; +} + + +X509::X509(const char* i, size_t iSz, const char* s, size_t sSz, + const char* b, int bSz, const char* a, int aSz) + : issuer_(i, iSz), subject_(s, sSz), + beforeDate_(b, bSz), afterDate_(a, aSz) +{} + + +X509_NAME* X509::GetIssuer() +{ + return &issuer_; +} + + +X509_NAME* X509::GetSubject() +{ + return &subject_; +} + + +ASN1_STRING* X509::GetBefore() +{ + return beforeDate_.GetString(); +} + + +ASN1_STRING* X509::GetAfter() +{ + return afterDate_.GetString(); +} + + +ASN1_STRING* X509_NAME::GetEntry(int i) +{ + if (i < 0 || i >= int(sz_)) + return 0; + + if (entry_.data) + ysArrayDelete(entry_.data); + entry_.data = NEW_YS byte[sz_]; // max size; + + memcpy(entry_.data, &name_[i], sz_ - i); + if (entry_.data[sz_ -i - 1]) { + entry_.data[sz_ - i] = 0; + entry_.length = int(sz_) - i; + } + else + entry_.length = int(sz_) - i - 1; + entry_.type = 0; + + return &entry_; +} + + +StringHolder::StringHolder(const char* str, int sz) +{ + asnString_.length = sz; + asnString_.data = NEW_YS byte[sz + 1]; + memcpy(asnString_.data, str, sz); + asnString_.type = 0; // not used for now +} + + +StringHolder::~StringHolder() +{ + ysArrayDelete(asnString_.data); +} + + +ASN1_STRING* StringHolder::GetString() +{ + return &asnString_; +} + + +#ifdef HAVE_LIBZ + + void* myAlloc(void* /* opaque */, unsigned int item, unsigned int size) + { + return NEW_YS unsigned char[item * size]; + } + + + void myFree(void* /* opaque */, void* memory) + { + unsigned char* ptr = static_cast(memory); + yaSSL::ysArrayDelete(ptr); + } + + + // put size in front of compressed data + int Compress(const byte* in, int sz, input_buffer& buffer) + { + byte tmp[LENGTH_SZ]; + z_stream c_stream; /* compression stream */ + + buffer.allocate(sz + sizeof(uint16) + COMPRESS_EXTRA); + + c_stream.zalloc = myAlloc; + c_stream.zfree = myFree; + c_stream.opaque = (voidpf)0; + + c_stream.next_in = const_cast(in); + c_stream.avail_in = sz; + c_stream.next_out = buffer.get_buffer() + sizeof(tmp); + c_stream.avail_out = buffer.get_capacity() - sizeof(tmp); + + if (deflateInit(&c_stream, 8) != Z_OK) return -1; + int err = deflate(&c_stream, Z_FINISH); + deflateEnd(&c_stream); + if (err != Z_OK && err != Z_STREAM_END) return -1; + + c16toa(sz, tmp); + memcpy(buffer.get_buffer(), tmp, sizeof(tmp)); + buffer.add_size(c_stream.total_out + sizeof(tmp)); + + return 0; + } + + + // get uncompressed size in front + int DeCompress(input_buffer& in, int sz, input_buffer& out) + { + byte tmp[LENGTH_SZ]; + + in.read(tmp, sizeof(tmp)); + + uint16 len; + ato16(tmp, len); + + out.allocate(len); + + z_stream d_stream; /* decompression stream */ + + d_stream.zalloc = myAlloc; + d_stream.zfree = myFree; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = in.get_buffer() + in.get_current(); + d_stream.avail_in = sz - sizeof(tmp); + d_stream.next_out = out.get_buffer(); + d_stream.avail_out = out.get_capacity(); + + if (inflateInit(&d_stream) != Z_OK) return -1; + int err = inflate(&d_stream, Z_FINISH); + inflateEnd(&d_stream); + if (err != Z_OK && err != Z_STREAM_END) return -1; + + out.add_size(d_stream.total_out); + in.set_current(in.get_current() + sz - sizeof(tmp)); + + return 0; + } + + +#else // LIBZ + + // these versions should never get called + int Compress(const byte* in, int sz, input_buffer& buffer) + { + assert(0); + return -1; + } + + + int DeCompress(input_buffer& in, int sz, input_buffer& out) + { + assert(0); + return -1; + } + + +#endif // LIBZ + + +} // namespace + + + +extern "C" void yaSSL_CleanUp() +{ + TaoCrypt::CleanUp(); + yaSSL::ysDelete(yaSSL::sslFactoryInstance); + yaSSL::ysDelete(yaSSL::sessionsInstance); + yaSSL::ysDelete(yaSSL::errorsInstance); + + // In case user calls more than once, prevent seg fault + yaSSL::sslFactoryInstance = 0; + yaSSL::sessionsInstance = 0; + yaSSL::errorsInstance = 0; +} + + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION +namespace mySTL { +template yaSSL::yassl_int_cpp_local1::SumData for_each::iterator, yaSSL::yassl_int_cpp_local1::SumData>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local1::SumData); +template yaSSL::yassl_int_cpp_local1::SumBuffer for_each::iterator, yaSSL::yassl_int_cpp_local1::SumBuffer>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local1::SumBuffer); +template mySTL::list::iterator find_if::iterator, yaSSL::yassl_int_cpp_local2::sess_match>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local2::sess_match); +template mySTL::list::iterator find_if::iterator, yaSSL::yassl_int_cpp_local2::thr_match>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local2::thr_match); +} +#endif + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/aes.hpp b/externals/mysql/extlib/yassl/taocrypt/include/aes.hpp new file mode 100644 index 00000000000..dc19c98a83a --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/aes.hpp @@ -0,0 +1,98 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* aes.hpp defines AES +*/ + + +#ifndef TAO_CRYPT_AES_HPP +#define TAO_CRYPT_AES_HPP + +#include "misc.hpp" +#include "modes.hpp" + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_AES_ASM +#endif + + + +namespace TaoCrypt { + + +enum { AES_BLOCK_SIZE = 16 }; + + +// AES encryption and decryption, see FIPS-197 +class AES : public Mode_BASE { +public: + enum { BLOCK_SIZE = AES_BLOCK_SIZE }; + + AES(CipherDir DIR, Mode MODE) + : Mode_BASE(BLOCK_SIZE, DIR, MODE) {} + +#ifdef DO_AES_ASM + void Process(byte*, const byte*, word32); +#endif + void SetKey(const byte* key, word32 sz, CipherDir fake = ENCRYPTION); + void SetIV(const byte* iv) { memcpy(r_, iv, BLOCK_SIZE); } +private: + static const word32 rcon_[]; + + word32 rounds_; + word32 key_[60]; // max size + + static const word32 Te[5][256]; + static const word32 Td[5][256]; + + static const word32* Te0; + static const word32* Te1; + static const word32* Te2; + static const word32* Te3; + static const word32* Te4; + + static const word32* Td0; + static const word32* Td1; + static const word32* Td2; + static const word32* Td3; + static const word32* Td4; + + void encrypt(const byte*, const byte*, byte*) const; + void AsmEncrypt(const byte*, byte*, void*) const; + void decrypt(const byte*, const byte*, byte*) const; + void AsmDecrypt(const byte*, byte*, void*) const; + + void ProcessAndXorBlock(const byte*, const byte*, byte*) const; + + AES(const AES&); // hide copy + AES& operator=(const AES&); // and assign +}; + + +typedef BlockCipher AES_ECB_Encryption; +typedef BlockCipher AES_ECB_Decryption; + +typedef BlockCipher AES_CBC_Encryption; +typedef BlockCipher AES_CBC_Decryption; + + + +} // naemspace + +#endif // TAO_CRYPT_AES_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/algebra.hpp b/externals/mysql/extlib/yassl/taocrypt/include/algebra.hpp new file mode 100644 index 00000000000..298ef115a4a --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/algebra.hpp @@ -0,0 +1,226 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's algebra.h from CryptoPP */ + +#ifndef TAO_CRYPT_ALGEBRA_HPP +#define TAO_CRYPT_ALGEBRA_HPP + +#include "integer.hpp" + +namespace TaoCrypt { + + +// "const Element&" returned by member functions are references +// to internal data members. Since each object may have only +// one such data member for holding results, the following code +// will produce incorrect results: +// abcd = group.Add(group.Add(a,b), group.Add(c,d)); +// But this should be fine: +// abcd = group.Add(a, group.Add(b, group.Add(c,d)); + +// Abstract Group +class TAOCRYPT_NO_VTABLE AbstractGroup : public virtual_base +{ +public: + typedef Integer Element; + + virtual ~AbstractGroup() {} + + virtual bool Equal(const Element &a, const Element &b) const =0; + virtual const Element& Identity() const =0; + virtual const Element& Add(const Element &a, const Element &b) const =0; + virtual const Element& Inverse(const Element &a) const =0; + virtual bool InversionIsFast() const {return false;} + + virtual const Element& Double(const Element &a) const; + virtual const Element& Subtract(const Element &a, const Element &b) const; + virtual Element& Accumulate(Element &a, const Element &b) const; + virtual Element& Reduce(Element &a, const Element &b) const; + + virtual Element ScalarMultiply(const Element &a, const Integer &e) const; + virtual Element CascadeScalarMultiply(const Element &x, const Integer &e1, + const Element &y, const Integer &e2) const; + + virtual void SimultaneousMultiply(Element *results, const Element &base, + const Integer *exponents, unsigned int exponentsCount) const; +}; + +// Abstract Ring +class TAOCRYPT_NO_VTABLE AbstractRing : public AbstractGroup +{ +public: + typedef Integer Element; + + AbstractRing() : AbstractGroup() {m_mg.m_pRing = this;} + AbstractRing(const AbstractRing &source) : AbstractGroup() + {m_mg.m_pRing = this;} + AbstractRing& operator=(const AbstractRing &source) {return *this;} + + virtual bool IsUnit(const Element &a) const =0; + virtual const Element& MultiplicativeIdentity() const =0; + virtual const Element& Multiply(const Element&, const Element&) const =0; + virtual const Element& MultiplicativeInverse(const Element &a) const =0; + + virtual const Element& Square(const Element &a) const; + virtual const Element& Divide(const Element &a, const Element &b) const; + + virtual Element Exponentiate(const Element &a, const Integer &e) const; + virtual Element CascadeExponentiate(const Element &x, const Integer &e1, + const Element &y, const Integer &e2) const; + + virtual void SimultaneousExponentiate(Element *results, const Element&, + const Integer *exponents, unsigned int exponentsCount) const; + + virtual const AbstractGroup& MultiplicativeGroup() const + {return m_mg;} + +private: + class MultiplicativeGroupT : public AbstractGroup + { + public: + const AbstractRing& GetRing() const + {return *m_pRing;} + + bool Equal(const Element &a, const Element &b) const + {return GetRing().Equal(a, b);} + + const Element& Identity() const + {return GetRing().MultiplicativeIdentity();} + + const Element& Add(const Element &a, const Element &b) const + {return GetRing().Multiply(a, b);} + + Element& Accumulate(Element &a, const Element &b) const + {return a = GetRing().Multiply(a, b);} + + const Element& Inverse(const Element &a) const + {return GetRing().MultiplicativeInverse(a);} + + const Element& Subtract(const Element &a, const Element &b) const + {return GetRing().Divide(a, b);} + + Element& Reduce(Element &a, const Element &b) const + {return a = GetRing().Divide(a, b);} + + const Element& Double(const Element &a) const + {return GetRing().Square(a);} + + Element ScalarMultiply(const Element &a, const Integer &e) const + {return GetRing().Exponentiate(a, e);} + + Element CascadeScalarMultiply(const Element &x, const Integer &e1, + const Element &y, const Integer &e2) const + {return GetRing().CascadeExponentiate(x, e1, y, e2);} + + void SimultaneousMultiply(Element *results, const Element &base, + const Integer *exponents, unsigned int exponentsCount) const + {GetRing().SimultaneousExponentiate(results, base, exponents, + exponentsCount);} + + const AbstractRing* m_pRing; + }; + + MultiplicativeGroupT m_mg; +}; + + +// Abstract Euclidean Domain +class TAOCRYPT_NO_VTABLE AbstractEuclideanDomain + : public AbstractRing +{ +public: + typedef Integer Element; + + virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a, + const Element &d) const =0; + + virtual const Element& Mod(const Element &a, const Element &b) const =0; + virtual const Element& Gcd(const Element &a, const Element &b) const; + +protected: + mutable Element result; +}; + + +// EuclideanDomainOf +class EuclideanDomainOf : public AbstractEuclideanDomain +{ +public: + typedef Integer Element; + + EuclideanDomainOf() {} + + bool Equal(const Element &a, const Element &b) const + {return a==b;} + + const Element& Identity() const + {return Element::Zero();} + + const Element& Add(const Element &a, const Element &b) const + {return result = a+b;} + + Element& Accumulate(Element &a, const Element &b) const + {return a+=b;} + + const Element& Inverse(const Element &a) const + {return result = -a;} + + const Element& Subtract(const Element &a, const Element &b) const + {return result = a-b;} + + Element& Reduce(Element &a, const Element &b) const + {return a-=b;} + + const Element& Double(const Element &a) const + {return result = a.Doubled();} + + const Element& MultiplicativeIdentity() const + {return Element::One();} + + const Element& Multiply(const Element &a, const Element &b) const + {return result = a*b;} + + const Element& Square(const Element &a) const + {return result = a.Squared();} + + bool IsUnit(const Element &a) const + {return a.IsUnit();} + + const Element& MultiplicativeInverse(const Element &a) const + {return result = a.MultiplicativeInverse();} + + const Element& Divide(const Element &a, const Element &b) const + {return result = a/b;} + + const Element& Mod(const Element &a, const Element &b) const + {return result = a%b;} + + void DivisionAlgorithm(Element &r, Element &q, const Element &a, + const Element &d) const + {Element::Divide(r, q, a, d);} + +private: + mutable Element result; +}; + + + +} // namespace + +#endif // TAO_CRYPT_ALGEBRA_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/arc4.hpp b/externals/mysql/extlib/yassl/taocrypt/include/arc4.hpp new file mode 100644 index 00000000000..757e1a50d71 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/arc4.hpp @@ -0,0 +1,58 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* arc4.hpp defines ARC4 +*/ + + +#ifndef TAO_CRYPT_ARC4_HPP +#define TAO_CRYPT_ARC4_HPP + +#include "misc.hpp" + +namespace TaoCrypt { + + +// ARC4 encryption and decryption +class ARC4 { +public: + enum { STATE_SIZE = 256 }; + + typedef ARC4 Encryption; + typedef ARC4 Decryption; + + ARC4() {} + + void Process(byte*, const byte*, word32); + void SetKey(const byte*, word32); +private: + byte x_; + byte y_; + byte state_[STATE_SIZE]; + + ARC4(const ARC4&); // hide copy + const ARC4 operator=(const ARC4&); // and assign + + void AsmProcess(byte*, const byte*, word32); +}; + +} // namespace + + +#endif // TAO_CRYPT_ARC4_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/asn.hpp b/externals/mysql/extlib/yassl/taocrypt/include/asn.hpp new file mode 100644 index 00000000000..1c1850cb47e --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/asn.hpp @@ -0,0 +1,372 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* asn.hpp provides ASN1 BER, PublicKey, and x509v3 decoding +*/ + + +#ifndef TAO_CRYPT_ASN_HPP +#define TAO_CRYPT_ASN_HPP + + +#include "misc.hpp" +#include "block.hpp" +#include "error.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "list.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + +namespace TaoCrypt { + +// these tags and flags are not complete +enum ASNTag +{ + BOOLEAN = 0x01, + INTEGER = 0x02, + BIT_STRING = 0x03, + OCTET_STRING = 0x04, + TAG_NULL = 0x05, + OBJECT_IDENTIFIER = 0x06, + OBJECT_DESCRIPTOR = 0x07, + EXTERNAL = 0x08, + REAL = 0x09, + ENUMERATED = 0x0a, + UTF8_STRING = 0x0c, + SEQUENCE = 0x10, + SET = 0x11, + NUMERIC_STRING = 0x12, + PRINTABLE_STRING = 0x13, + T61_STRING = 0x14, + VIDEOTEXT_STRING = 0x15, + IA5_STRING = 0x16, + UTC_TIME = 0x17, + GENERALIZED_TIME = 0x18, + GRAPHIC_STRING = 0x19, + VISIBLE_STRING = 0x1a, + GENERAL_STRING = 0x1b, + LONG_LENGTH = 0x80 +}; + +enum ASNIdFlag +{ + UNIVERSAL = 0x00, + DATA = 0x01, + HEADER = 0x02, + CONSTRUCTED = 0x20, + APPLICATION = 0x40, + CONTEXT_SPECIFIC = 0x80, + PRIVATE = 0xc0 +}; + + +enum DNTags +{ + COMMON_NAME = 0x03, // CN + SUR_NAME = 0x04, // SN + COUNTRY_NAME = 0x06, // C + LOCALITY_NAME = 0x07, // L + STATE_NAME = 0x08, // ST + ORG_NAME = 0x0a, // O + ORGUNIT_NAME = 0x0b // OU +}; + + +enum PCKS12_Tags +{ + /* DATA = 1, */ // from ASN1 + SIGNED_DATA = 2, + ENVELOPED_DATA = 3, + SIGNED_AND_ENVELOPED_DATA = 4, + DIGESTED_DATA = 5, + ENCRYPTED_DATA = 6 +}; + + +enum Constants +{ + MIN_DATE_SZ = 13, + MAX_DATE_SZ = 16, + MAX_ALGO_SZ = 16, + MAX_LENGTH_SZ = 5, + MAX_SEQ_SZ = 5, // enum(seq|con) + length(4) + MAX_ALGO_SIZE = 9, + MAX_DIGEST_SZ = 25, // SHA + enum(Bit or Octet) + length(4) + DSA_SIG_SZ = 40, + ASN_NAME_MAX = 512 // max total of all included names +}; + + +class Source; +class RSA_PublicKey; +class RSA_PrivateKey; +class DSA_PublicKey; +class DSA_PrivateKey; +class Integer; +class DH; + + +// General BER decoding +class BER_Decoder : public virtual_base { +protected: + Source& source_; +public: + explicit BER_Decoder(Source& s) : source_(s) {} + virtual ~BER_Decoder() {} + + Integer& GetInteger(Integer&); + word32 GetSequence(); + word32 GetSet(); + word32 GetVersion(); + word32 GetExplicitVersion(); + + Error GetError(); +private: + virtual void ReadHeader() = 0; + + BER_Decoder(const BER_Decoder&); // hide copy + BER_Decoder& operator=(const BER_Decoder&); // and assign +}; + + +// RSA Private Key BER Decoder +class RSA_Private_Decoder : public BER_Decoder { +public: + explicit RSA_Private_Decoder(Source& s) : BER_Decoder(s) {} + void Decode(RSA_PrivateKey&); +private: + void ReadHeader(); +}; + + +// RSA Public Key BER Decoder +class RSA_Public_Decoder : public BER_Decoder { +public: + explicit RSA_Public_Decoder(Source& s) : BER_Decoder(s) {} + void Decode(RSA_PublicKey&); +private: + void ReadHeader(); +}; + + +// DSA Private Key BER Decoder +class DSA_Private_Decoder : public BER_Decoder { +public: + explicit DSA_Private_Decoder(Source& s) : BER_Decoder(s) {} + void Decode(DSA_PrivateKey&); +private: + void ReadHeader(); +}; + + +// DSA Public Key BER Decoder +class DSA_Public_Decoder : public BER_Decoder { +public: + explicit DSA_Public_Decoder(Source& s) : BER_Decoder(s) {} + void Decode(DSA_PublicKey&); +private: + void ReadHeader(); +}; + + +// DH Key BER Decoder +class DH_Decoder : public BER_Decoder { +public: + explicit DH_Decoder(Source& s) : BER_Decoder(s) {} + void Decode(DH&); +private: + void ReadHeader(); +}; + + +// PKCS12 BER Decoder +class PKCS12_Decoder : public BER_Decoder { +public: + explicit PKCS12_Decoder(Source& s) : BER_Decoder(s) {} + void Decode(); +private: + void ReadHeader(); +}; + + +// General PublicKey +class PublicKey { + byte* key_; + word32 sz_; +public: + explicit PublicKey(const byte* k = 0, word32 s = 0); + ~PublicKey() { tcArrayDelete(key_); } + + const byte* GetKey() const { return key_; } + word32 size() const { return sz_; } + + void SetKey(const byte*); + void SetSize(word32 s); + + void AddToEnd(const byte*, word32); +private: + PublicKey(const PublicKey&); // hide copy + PublicKey& operator=(const PublicKey&); // and assign +}; + + +enum { SHA_SIZE = 20 }; + + +// A Signing Authority +class Signer { + PublicKey key_; + char name_[ASN_NAME_MAX]; + byte hash_[SHA_SIZE]; +public: + Signer(const byte* k, word32 kSz, const char* n, const byte* h); + ~Signer(); + + const PublicKey& GetPublicKey() const { return key_; } + const char* GetName() const { return name_; } + const byte* GetHash() const { return hash_; } + +private: + Signer(const Signer&); // hide copy + Signer& operator=(const Signer&); // and assign +}; + + +typedef STL::list SignerList; + + +enum ContentType { HUH = 651 }; +enum SigType { SHAwDSA = 517, MD2wRSA = 646, MD5wRSA = 648, SHAwRSA =649}; +enum HashType { MD2h = 646, MD5h = 649, SHAh = 88 }; +enum KeyType { DSAk = 515, RSAk = 645 }; // sums of algo OID + + +// an x509v Certificate BER Decoder +class CertDecoder : public BER_Decoder { +public: + enum DateType { BEFORE, AFTER }; + enum NameType { ISSUER, SUBJECT }; + enum CertType { CA, USER }; + + explicit CertDecoder(Source&, bool decode = true, SignerList* sl = 0, + bool noVerify = false, CertType ct = USER); + ~CertDecoder(); + + const PublicKey& GetPublicKey() const { return key_; } + KeyType GetKeyType() const { return KeyType(keyOID_); } + const char* GetIssuer() const { return issuer_; } + const char* GetCommonName() const { return subject_; } + const byte* GetHash() const { return subjectHash_; } + const char* GetBeforeDate() const { return beforeDate_; } + const char* GetAfterDate() const { return afterDate_; } + + void DecodeToKey(); +private: + PublicKey key_; + word32 certBegin_; // offset to start of cert + word32 sigIndex_; // offset to start of signature + word32 sigLength_; // length of signature + word32 signatureOID_; // sum of algorithm object id + word32 keyOID_; // sum of key algo object id + byte subjectHash_[SHA_SIZE]; // hash of all Names + byte issuerHash_[SHA_SIZE]; // hash of all Names + byte* signature_; + char issuer_[ASN_NAME_MAX]; // Names + char subject_[ASN_NAME_MAX]; // Names + char beforeDate_[MAX_DATE_SZ]; // valid before date + char afterDate_[MAX_DATE_SZ]; // valid after date + bool verify_; // Default to yes, but could be off + + void ReadHeader(); + void Decode(SignerList*, CertType); + void StoreKey(); + void AddDSA(); + bool ValidateSelfSignature(); + bool ValidateSignature(SignerList*); + bool ConfirmSignature(Source&); + void GetKey(); + void GetName(NameType); + void GetValidity(); + void GetDate(DateType); + void GetCompareHash(const byte*, word32, byte*, word32); + word32 GetAlgoId(); + word32 GetSignature(); + word32 GetDigest(); +}; + + +word32 GetLength(Source&); + +word32 SetLength(word32, byte*); +word32 SetSequence(word32, byte*); + +word32 EncodeDSA_Signature(const byte* signature, byte* output); +word32 EncodeDSA_Signature(const Integer& r, const Integer& s, byte* output); +word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz); + + +// General DER encoding +class DER_Encoder : public virtual_base { +public: + DER_Encoder() {} + virtual ~DER_Encoder() {} + + word32 SetAlgoID(HashType, byte*); + + Error GetError() const { return error_; } +private: + //virtual void WriteHeader() = 0; + Error error_; + + DER_Encoder(const DER_Encoder&); // hide copy + DER_Encoder& operator=(const DER_Encoder&); // and assign +}; + + + +class Signature_Encoder : public DER_Encoder { + const byte* digest_; + word32 digestSz_; + SigType digestOID_; +public: + explicit Signature_Encoder(const byte*, word32, HashType, Source&); + +private: + void WriteHeader(); + word32 SetDigest(const byte*, word32, byte*); + + Signature_Encoder(const Signature_Encoder&); // hide copy + Signature_Encoder& operator=(const Signature_Encoder&); // and assign +}; + + +// Get Cert in PEM format from BEGIN to END +int GetCert(Source&); + +// Get Cert in PEM format from pkcs12 file +int GetPKCS_Cert(const char* password, Source&); + +} // namespace + + +#endif // TAO_CRYPT_ASN_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/block.hpp b/externals/mysql/extlib/yassl/taocrypt/include/block.hpp new file mode 100644 index 00000000000..529a91eee08 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/block.hpp @@ -0,0 +1,206 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* block.hpp provides word and byte blocks with configurable allocators +*/ + + +#ifndef TAO_CRYPT_BLOCK_HPP +#define TAO_CRYPT_BLOCK_HPP + +#include "misc.hpp" +#include // memcpy +#include // ptrdiff_t + +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + +namespace TaoCrypt { + + +// a Base class for Allocators +template +class AllocatorBase +{ +public: + typedef T value_type; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T* pointer; + typedef const T* const_pointer; + typedef T& reference; + typedef const T& const_reference; + + pointer address(reference r) const {return (&r);} + const_pointer address(const_reference r) const {return (&r); } + void construct(pointer p, const T& val) {new (p) T(val);} + void destroy(pointer p) {p->~T();} + size_type max_size() const {return ~size_type(0)/sizeof(T);} +protected: + static void CheckSize(size_t n) + { + assert(n <= ~size_t(0) / sizeof(T)); + } +}; + + +// General purpose realloc +template +typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize, + typename A::size_type newSize, bool preserve) +{ + if (oldSize == newSize) + return p; + + if (preserve) { + A b = A(); + typename A::pointer newPointer = b.allocate(newSize, 0); + memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize)); + a.deallocate(p, oldSize); + STL::swap(a, b); + return newPointer; + } + else { + a.deallocate(p, oldSize); + return a.allocate(newSize, 0); + } +} + + +// Allocator that zeros out memory on deletion +template +class AllocatorWithCleanup : public AllocatorBase +{ +public: + typedef typename AllocatorBase::pointer pointer; + typedef typename AllocatorBase::size_type size_type; + + pointer allocate(size_type n, const void* = 0) + { + this->CheckSize(n); + if (n == 0) + return 0; + return NEW_TC T[n]; + } + + void deallocate(void* p, size_type n) + { + memset(p, 0, n * sizeof(T)); + tcArrayDelete((T*)p); + } + + pointer reallocate(T* p, size_type oldSize, size_type newSize, + bool preserve) + { + return StdReallocate(*this, p, oldSize, newSize, preserve); + } + + // VS.NET STL enforces the policy of "All STL-compliant allocators have to + // provide a template class member called rebind". + template struct rebind { typedef AllocatorWithCleanup other;}; +}; + + +// Block class template +template > +class Block { +public: + explicit Block(word32 s = 0) : sz_(s), buffer_(allocator_.allocate(sz_)) + { CleanNew(sz_); } + + Block(const T* buff, word32 s) : sz_(s), buffer_(allocator_.allocate(sz_)) + { memcpy(buffer_, buff, sz_ * sizeof(T)); } + + Block(const Block& that) : sz_(that.sz_), buffer_(allocator_.allocate(sz_)) + { memcpy(buffer_, that.buffer_, sz_ * sizeof(T)); } + + Block& operator=(const Block& that) { + Block tmp(that); + Swap(tmp); + return *this; + } + + T& operator[] (word32 i) { assert(i < sz_); return buffer_[i]; } + const T& operator[] (word32 i) const + { assert(i < sz_); return buffer_[i]; } + + T* operator+ (word32 i) { return buffer_ + i; } + const T* operator+ (word32 i) const { return buffer_ + i; } + + word32 size() const { return sz_; } + + T* get_buffer() const { return buffer_; } + T* begin() const { return get_buffer(); } + + void CleanGrow(word32 newSize) + { + if (newSize > sz_) { + buffer_ = allocator_.reallocate(buffer_, sz_, newSize, true); + memset(buffer_ + sz_, 0, (newSize - sz_) * sizeof(T)); + sz_ = newSize; + } + } + + void CleanNew(word32 newSize) + { + New(newSize); + memset(buffer_, 0, sz_ * sizeof(T)); + } + + void New(word32 newSize) + { + buffer_ = allocator_.reallocate(buffer_, sz_, newSize, false); + sz_ = newSize; + } + + void resize(word32 newSize) + { + buffer_ = allocator_.reallocate(buffer_, sz_, newSize, true); + sz_ = newSize; + } + + void Swap(Block& other) { + STL::swap(sz_, other.sz_); + STL::swap(buffer_, other.buffer_); + STL::swap(allocator_, other.allocator_); + } + + ~Block() { allocator_.deallocate(buffer_, sz_); } +private: + word32 sz_; // size in Ts + T* buffer_; + A allocator_; +}; + + +typedef Block ByteBlock; +typedef Block WordBlock; +typedef Block Word32Block; + + +} // namespace + +#endif // TAO_CRYPT_BLOCK_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/blowfish.hpp b/externals/mysql/extlib/yassl/taocrypt/include/blowfish.hpp new file mode 100644 index 00000000000..90d2c014b4c --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/blowfish.hpp @@ -0,0 +1,88 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* blowfish.hpp defines Blowfish +*/ + + +#ifndef TAO_CRYPT_BLOWFISH_HPP +#define TAO_CRYPT_BLOWFISH_HPP + +#include "misc.hpp" +#include "modes.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_BLOWFISH_ASM +#endif + + +namespace TaoCrypt { + +enum { BLOWFISH_BLOCK_SIZE = 8 }; + + +// Blowfish encryption and decryption, see +class Blowfish : public Mode_BASE { +public: + enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 }; + + Blowfish(CipherDir DIR, Mode MODE) + : Mode_BASE(BLOCK_SIZE, DIR, MODE) {} + +#ifdef DO_BLOWFISH_ASM + void Process(byte*, const byte*, word32); +#endif + void SetKey(const byte* key, word32 sz, CipherDir fake = ENCRYPTION); + void SetIV(const byte* iv) { memcpy(r_, iv, BLOCK_SIZE); } +private: + static const word32 p_init_[ROUNDS + 2]; + static const word32 s_init_[4 * 256]; + + word32 pbox_[ROUNDS + 2]; + word32 sbox_[4 * 256]; + + void crypt_block(const word32 in[2], word32 out[2]) const; + void AsmProcess(const byte* in, byte* out) const; + void ProcessAndXorBlock(const byte*, const byte*, byte*) const; + + Blowfish(const Blowfish&); // hide copy + Blowfish& operator=(const Blowfish&); // and assign +}; + + +typedef BlockCipher Blowfish_ECB_Encryption; +typedef BlockCipher Blowfish_ECB_Decryption; + +typedef BlockCipher Blowfish_CBC_Encryption; +typedef BlockCipher Blowfish_CBC_Decryption; + + + +} // namespace + +#endif // TAO_CRYPT_BLOWFISH_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/coding.hpp b/externals/mysql/extlib/yassl/taocrypt/include/coding.hpp new file mode 100644 index 00000000000..3b1c0687604 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/coding.hpp @@ -0,0 +1,91 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* coding.hpp defines hex and base64 encoding/decoing +*/ + +#ifndef TAO_CRYPT_CODING_HPP +#define TAO_CRYPT_CODING_HPP + +#include "misc.hpp" +#include "block.hpp" + +namespace TaoCrypt { + +class Source; + + +// Hex Encoding, see RFC 3548 +class HexEncoder { + ByteBlock encoded_; + Source& plain_; +public: + explicit HexEncoder(Source& s) : plain_(s) { Encode(); } +private: + void Encode(); + + HexEncoder(const HexEncoder&); // hide copy + HexEncoder& operator=(const HexEncoder&); // and assign +}; + + +// Hex Decoding, see RFC 3548 +class HexDecoder { + ByteBlock decoded_; + Source& coded_; +public: + explicit HexDecoder(Source& s) : coded_(s) { Decode(); } +private: + void Decode(); + + HexDecoder(const HexDecoder&); // hide copy + HexDecoder& operator=(const HexDecoder&); // and assign +}; + + +// Base 64 encoding, see RFC 3548 +class Base64Encoder { + ByteBlock encoded_; + Source& plain_; +public: + explicit Base64Encoder(Source& s) : plain_(s) { Encode(); } +private: + void Encode(); + + Base64Encoder(const Base64Encoder&); // hide copy + Base64Encoder& operator=(const Base64Encoder&); // and assign +}; + + +// Base 64 decoding, see RFC 3548 +class Base64Decoder { + ByteBlock decoded_; + Source& coded_; +public: + explicit Base64Decoder(Source& s) : coded_(s) { Decode(); } +private: + void Decode(); + + Base64Decoder(const Base64Decoder&); // hide copy + Base64Decoder& operator=(const Base64Decoder&); // and assign +}; + + +} // namespace + +#endif // TAO_CRYPT_CODING_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/des.hpp b/externals/mysql/extlib/yassl/taocrypt/include/des.hpp new file mode 100644 index 00000000000..f99a289392f --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/des.hpp @@ -0,0 +1,130 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* des.hpp defines DES, DES_EDE2, and DES_EDE3 + see FIPS 46-2 and FIPS 81 +*/ + + +#ifndef TAO_CRYPT_DES_HPP +#define TAO_CRYPT_DES_HPP + +#include "misc.hpp" +#include "modes.hpp" + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_DES_ASM +#endif + + +namespace TaoCrypt { + + +enum { DES_BLOCK_SIZE = 8, DES_KEY_SIZE = 32 }; + + +class BasicDES { +public: + void SetKey(const byte*, word32, CipherDir dir); + void RawProcessBlock(word32&, word32&) const; +protected: + word32 k_[DES_KEY_SIZE]; +}; + + +// DES +class DES : public Mode_BASE, public BasicDES { +public: + DES(CipherDir DIR, Mode MODE) + : Mode_BASE(DES_BLOCK_SIZE, DIR, MODE) {} + +private: + void ProcessAndXorBlock(const byte*, const byte*, byte*) const; + + DES(const DES&); // hide copy + DES& operator=(const DES&); // and assign +}; + + +// DES_EDE2 +class DES_EDE2 : public Mode_BASE { +public: + DES_EDE2(CipherDir DIR, Mode MODE) + : Mode_BASE(DES_BLOCK_SIZE, DIR, MODE) {} + + void SetKey(const byte*, word32, CipherDir dir); +private: + BasicDES des1_; + BasicDES des2_; + + void ProcessAndXorBlock(const byte*, const byte*, byte*) const; + + DES_EDE2(const DES_EDE2&); // hide copy + DES_EDE2& operator=(const DES_EDE2&); // and assign +}; + + + +// DES_EDE3 +class DES_EDE3 : public Mode_BASE { +public: + DES_EDE3(CipherDir DIR, Mode MODE) + : Mode_BASE(DES_BLOCK_SIZE, DIR, MODE) {} + + void SetKey(const byte*, word32, CipherDir dir); + void SetIV(const byte* iv) { memcpy(r_, iv, DES_BLOCK_SIZE); } +#ifdef DO_DES_ASM + void Process(byte*, const byte*, word32); +#endif +private: + BasicDES des1_; + BasicDES des2_; + BasicDES des3_; + + void AsmProcess(const byte* in, byte* out, void* box) const; + void ProcessAndXorBlock(const byte*, const byte*, byte*) const; + + DES_EDE3(const DES_EDE3&); // hide copy + DES_EDE3& operator=(const DES_EDE3&); // and assign +}; + + +typedef BlockCipher DES_ECB_Encryption; +typedef BlockCipher DES_ECB_Decryption; + +typedef BlockCipher DES_CBC_Encryption; +typedef BlockCipher DES_CBC_Decryption; + +typedef BlockCipher DES_EDE2_ECB_Encryption; +typedef BlockCipher DES_EDE2_ECB_Decryption; + +typedef BlockCipher DES_EDE2_CBC_Encryption; +typedef BlockCipher DES_EDE2_CBC_Decryption; + +typedef BlockCipher DES_EDE3_ECB_Encryption; +typedef BlockCipher DES_EDE3_ECB_Decryption; + +typedef BlockCipher DES_EDE3_CBC_Encryption; +typedef BlockCipher DES_EDE3_CBC_Decryption; + + +} // namespace + + +#endif // TAO_CRYPT_DES_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/dh.hpp b/externals/mysql/extlib/yassl/taocrypt/include/dh.hpp new file mode 100644 index 00000000000..b7724cbd80d --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/dh.hpp @@ -0,0 +1,86 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* dh.hpp provides Diffie-Hellman support +*/ + + +#ifndef TAO_CRYPT_DH_HPP +#define TAO_CRYPT_DH_HPP + +#include "misc.hpp" +#include "integer.hpp" + +namespace TaoCrypt { + + +class Source; + + +// Diffie-Hellman +class DH { +public: + DH() {} + DH(Integer& p, Integer& g) : p_(p), g_(g) {} + explicit DH(Source&); + + DH(const DH& that) : p_(that.p_), g_(that.g_) {} + DH& operator=(const DH& that) + { + DH tmp(that); + Swap(tmp); + return *this; + } + + void Swap(DH& other) + { + p_.Swap(other.p_); + g_.Swap(other.g_); + } + + void Initialize(Source&); + void Initialize(Integer& p, Integer& g) + { + SetP(p); + SetG(g); + } + + void GenerateKeyPair(RandomNumberGenerator&, byte*, byte*); + void Agree(byte*, const byte*, const byte*, word32 otherSz = 0); + + void SetP(const Integer& p) { p_ = p; } + void SetG(const Integer& g) { g_ = g; } + + Integer& GetP() { return p_; } + Integer& GetG() { return g_; } + + // for p and agree + word32 GetByteLength() const { return p_.ByteCount(); } +private: + // group parms + Integer p_; + Integer g_; + + void GeneratePrivate(RandomNumberGenerator&, byte*); + void GeneratePublic(const byte*, byte*); +}; + + +} // namespace + +#endif // TAO_CRYPT_DH_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/dsa.hpp b/externals/mysql/extlib/yassl/taocrypt/include/dsa.hpp new file mode 100644 index 00000000000..f185b852cdc --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/dsa.hpp @@ -0,0 +1,126 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* dsa.hpp provides Digitial Signautre Algorithm see FIPS 186-2 +*/ + +#ifndef TAO_CRYPT_DSA_HPP +#define TAO_CRYPT_DSA_HPP + +#include "integer.hpp" + + +namespace TaoCrypt { + +class Source; + + +class DSA_PublicKey { +protected: + Integer p_; + Integer q_; + Integer g_; + Integer y_; +public: + DSA_PublicKey() {} + explicit DSA_PublicKey(Source&); + + void Initialize(Source&); + void Initialize(const Integer& p, const Integer& q, const Integer& g, + const Integer& y); + + const Integer& GetModulus() const; + const Integer& GetSubGroupOrder() const; + const Integer& GetSubGroupGenerator() const; + const Integer& GetPublicPart() const; + + void SetModulus(const Integer&); + void SetSubGroupOrder(const Integer&); + void SetSubGroupGenerator(const Integer&); + void SetPublicPart(const Integer&); + + word32 SignatureLength() const; + + DSA_PublicKey(const DSA_PublicKey&); + DSA_PublicKey& operator=(const DSA_PublicKey&); + + void Swap(DSA_PublicKey& other); +}; + + + +class DSA_PrivateKey : public DSA_PublicKey { + Integer x_; +public: + DSA_PrivateKey() {} + explicit DSA_PrivateKey(Source&); + + void Initialize(Source&); + void Initialize(const Integer& p, const Integer& q, const Integer& g, + const Integer& y, const Integer& x); + + const Integer& GetPrivatePart() const; + + void SetPrivatePart(const Integer&); +private: + DSA_PrivateKey(const DSA_PrivateKey&); // hide copy + DSA_PrivateKey& operator=(const DSA_PrivateKey&); // and assign +}; + + + +class DSA_Signer { + const DSA_PrivateKey& key_; + Integer r_; + Integer s_; +public: + explicit DSA_Signer(const DSA_PrivateKey&); + + word32 Sign(const byte* sha_digest, byte* sig, RandomNumberGenerator&); + + const Integer& GetR() const; + const Integer& GetS() const; +private: + DSA_Signer(const DSA_Signer&); // hide copy + DSA_Signer& operator=(DSA_Signer&); // and assign +}; + + +class DSA_Verifier { + const DSA_PublicKey& key_; + Integer r_; + Integer s_; +public: + explicit DSA_Verifier(const DSA_PublicKey&); + + bool Verify(const byte* sha_digest, const byte* sig); + + const Integer& GetR() const; + const Integer& GetS() const; +private: + DSA_Verifier(const DSA_Verifier&); // hide copy + DSA_Verifier& operator=(const DSA_Verifier&); // and assign +}; + + + + + +} // namespace + +#endif // TAO_CRYPT_DSA_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/error.hpp b/externals/mysql/extlib/yassl/taocrypt/include/error.hpp new file mode 100644 index 00000000000..ef8b065d2f1 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/error.hpp @@ -0,0 +1,88 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* error.hpp provides a taocrypt error numbers + * + */ + + +#ifndef TAO_CRYPT_ERROR_HPP +#define TAO_CRYPT_ERROR_HPP + + +namespace TaoCrypt { + + +enum ErrorNumber { + +NO_ERROR_E = 0, // "not in error state" + +// RandomNumberGenerator +WINCRYPT_E = 1001, // "bad wincrypt acquire" +CRYPTGEN_E = 1002, // "CryptGenRandom error" +OPEN_RAN_E = 1003, // "open /dev/urandom error" +READ_RAN_E = 1004, // "read /dev/urandom error" + +// Integer +INTEGER_E = 1010, // "bad DER Integer Header" + + +// ASN.1 +SEQUENCE_E = 1020, // "bad Sequence Header" +SET_E = 1021, // "bad Set Header" +VERSION_E = 1022, // "version length not 1" +SIG_OID_E = 1023, // "signature OID mismatch" +BIT_STR_E = 1024, // "bad BitString Header" +UNKNOWN_OID_E = 1025, // "unknown key OID type" +OBJECT_ID_E = 1026, // "bad Ojbect ID Header" +TAG_NULL_E = 1027, // "expected TAG NULL" +EXPECT_0_E = 1028, // "expected 0" +OCTET_STR_E = 1029, // "bad Octet String Header" +TIME_E = 1030, // "bad TIME" + +DATE_SZ_E = 1031, // "bad Date Size" +SIG_LEN_E = 1032, // "bad Signature Length" +UNKOWN_SIG_E = 1033, // "unknown signature OID" +UNKOWN_HASH_E = 1034, // "unknown hash OID" +DSA_SZ_E = 1035, // "bad DSA r or s size" +BEFORE_DATE_E = 1036, // "before date in the future" +AFTER_DATE_E = 1037, // "after date in the past" +SIG_CONFIRM_E = 1038, // "bad self signature confirmation" +SIG_OTHER_E = 1039, // "bad other signature confirmation" + +CONTENT_E = 1040, // "bad content processing" +PEM_E = 1041 // "bad pem format error" + + // add error string to yassl/src/yassl_error.cpp !!! +}; + + +struct Error { + ErrorNumber what_; // description number, 0 for no error + + explicit Error(ErrorNumber w = NO_ERROR_E) : what_(w) {} + + ErrorNumber What() const { return what_; } + void SetError(ErrorNumber w) { what_ = w; } +}; + + + +} // namespace TaoCrypt + +#endif // TAO_CRYPT_ERROR_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/file.hpp b/externals/mysql/extlib/yassl/taocrypt/include/file.hpp new file mode 100644 index 00000000000..0f85b46fdb2 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/file.hpp @@ -0,0 +1,123 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* file.hpp provies File Sources and Sinks +*/ + + +#ifndef TAO_CRYPT_FILE_HPP +#define TAO_CRYPT_FILE_HPP + +#include "misc.hpp" +#include "block.hpp" +#include "error.hpp" +#include + +namespace TaoCrypt { + + +class Source { + ByteBlock buffer_; + word32 current_; + Error error_; +public: + explicit Source(word32 sz = 0) : buffer_(sz), current_(0) {} + Source(const byte* b, word32 sz) : buffer_(b, sz), current_(0) {} + + word32 size() const { return buffer_.size(); } + void grow(word32 sz) { buffer_.CleanGrow(sz); } + + const byte* get_buffer() const { return buffer_.get_buffer(); } + const byte* get_current() const { return &buffer_[current_]; } + word32 get_index() const { return current_; } + void set_index(word32 i) { current_ = i; } + + byte operator[] (word32 i) { current_ = i; return next(); } + byte next() { return buffer_[current_++]; } + byte prev() { return buffer_[--current_]; } + + void add(const byte* data, word32 len) + { + memcpy(buffer_.get_buffer() + current_, data, len); + current_ += len; + } + + void advance(word32 i) { current_ += i; } + void reset(ByteBlock&); + + Error GetError() { return error_; } + void SetError(ErrorNumber w) { error_.SetError(w); } + + friend class FileSource; // for get() + + Source(const Source& that) + : buffer_(that.buffer_), current_(that.current_) {} + + Source& operator=(const Source& that) + { + Source tmp(that); + Swap(tmp); + return *this; + } + + void Swap(Source& other) + { + buffer_.Swap(other.buffer_); + STL::swap(current_, other.current_); + } + +}; + + +// File Source +class FileSource { + FILE* file_; +public: + FileSource(const char* fname, Source& source); + ~FileSource(); + + word32 size(bool use_current = false); +private: + word32 get(Source&); + word32 size_left(); + + FileSource(const FileSource&); // hide + FileSource& operator=(const FileSource&); // hide +}; + + +// File Sink +class FileSink { + FILE* file_; +public: + FileSink(const char* fname, Source& source); + ~FileSink(); + + word32 size(bool use_current = false); +private: + void put(Source&); + + FileSink(const FileSink&); // hide + FileSink& operator=(const FileSink&); // hide +}; + + + +} // namespace + +#endif // TAO_CRYPT_FILE_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/hash.hpp b/externals/mysql/extlib/yassl/taocrypt/include/hash.hpp new file mode 100644 index 00000000000..fa5f6c04720 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/hash.hpp @@ -0,0 +1,110 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* hash.hpp provides a base for digest types +*/ + + +#ifndef TAO_CRYPT_HASH_HPP +#define TAO_CRYPT_HASH_HPP + +#include "misc.hpp" + +namespace TaoCrypt { + + +// HASH +class HASH : public virtual_base { +public: + virtual ~HASH() {} + + virtual void Update(const byte*, word32) = 0; + virtual void Final(byte*) = 0; + + virtual void Init() = 0; + + virtual word32 getBlockSize() const = 0; + virtual word32 getDigestSize() const = 0; +}; + + +// HASH with Transform +class HASHwithTransform : public HASH { +public: + HASHwithTransform(word32 digSz, word32 buffSz); + virtual ~HASHwithTransform() {} + virtual ByteOrder getByteOrder() const = 0; + virtual word32 getPadSize() const = 0; + + virtual void Update(const byte*, word32); + virtual void Final(byte*); + + word32 GetBitCountLo() const { return loLen_ << 3; } + word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) + + (hiLen_ << 3); } + enum { MaxDigestSz = 8, MaxBufferSz = 64 }; +protected: + typedef word32 HashLengthType; + word32 buffLen_; // in bytes + HashLengthType loLen_; // length in bytes + HashLengthType hiLen_; // length in bytes + word32 digest_[MaxDigestSz]; + word32 buffer_[MaxBufferSz / sizeof(word32)]; + + virtual void Transform() = 0; + + void AddLength(word32); +}; + + +#ifdef WORD64_AVAILABLE + +// 64-bit HASH with Transform +class HASH64withTransform : public HASH { +public: + HASH64withTransform(word32 digSz, word32 buffSz); + virtual ~HASH64withTransform() {} + virtual ByteOrder getByteOrder() const = 0; + virtual word32 getPadSize() const = 0; + + virtual void Update(const byte*, word32); + virtual void Final(byte*); + + word32 GetBitCountLo() const { return loLen_ << 3; } + word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) + + (hiLen_ << 3); } + enum { MaxDigestSz = 8, MaxBufferSz = 128 }; +protected: + typedef word32 HashLengthType; + word32 buffLen_; // in bytes + HashLengthType loLen_; // length in bytes + HashLengthType hiLen_; // length in bytes + word64 digest_[MaxDigestSz]; + word64 buffer_[MaxBufferSz / sizeof(word64)]; + + virtual void Transform() = 0; + + void AddLength(word32); +}; + +#endif // WORD64_AVAILABLE + + +} // namespace + +#endif // TAO_CRYPT_HASH_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/hmac.hpp b/externals/mysql/extlib/yassl/taocrypt/include/hmac.hpp new file mode 100644 index 00000000000..1d486514e06 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/hmac.hpp @@ -0,0 +1,138 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* hamc.hpp implements HMAC, see RFC 2104 +*/ + + +#ifndef TAO_CRYPT_HMAC_HPP +#define TAO_CRYPT_HMAC_HPP + +#include "hash.hpp" + +namespace TaoCrypt { + + +// HMAC class template +template +class HMAC { +public: + enum { IPAD = 0x36, OPAD = 0x5C }; + + HMAC() : ipad_(reinterpret_cast(&ip_)), + opad_(reinterpret_cast(&op_)), + innerHash_(reinterpret_cast(&innerH_)) + { + Init(); + } + void Update(const byte*, word32); + void Final(byte*); + void Init(); + + void SetKey(const byte*, word32); +private: + byte* ipad_; + byte* opad_; + byte* innerHash_; + bool innerHashKeyed_; + T mac_; + + // MSVC 6 HACK, gives compiler error if calculated in array + enum { HMAC_BSIZE = T::BLOCK_SIZE / sizeof(word32), + HMAC_DSIZE = T::DIGEST_SIZE / sizeof(word32) }; + + word32 ip_[HMAC_BSIZE]; // align ipad_ on word32 + word32 op_[HMAC_BSIZE]; // align opad_ on word32 + word32 innerH_[HMAC_DSIZE]; // align innerHash_ on word32 + + void KeyInnerHash(); + + HMAC(const HMAC&); + HMAC& operator= (const HMAC&); +}; + + +// Setup +template +void HMAC::Init() +{ + mac_.Init(); + innerHashKeyed_ = false; +} + + +// Key generation +template +void HMAC::SetKey(const byte* key, word32 length) +{ + Init(); + + if (length <= T::BLOCK_SIZE) + memcpy(ipad_, key, length); + else { + mac_.Update(key, length); + mac_.Final(ipad_); + length = T::DIGEST_SIZE; + } + memset(ipad_ + length, 0, T::BLOCK_SIZE - length); + + for (word32 i = 0; i < T::BLOCK_SIZE; i++) { + opad_[i] = ipad_[i] ^ OPAD; + ipad_[i] ^= IPAD; + } +} + + +// Inner Key Hash +template +void HMAC::KeyInnerHash() +{ + mac_.Update(ipad_, T::BLOCK_SIZE); + innerHashKeyed_ = true; +} + + +// Update +template +void HMAC::Update(const byte* msg, word32 length) +{ + if (!innerHashKeyed_) + KeyInnerHash(); + mac_.Update(msg, length); +} + + +// Final +template +void HMAC::Final(byte* hash) +{ + if (!innerHashKeyed_) + KeyInnerHash(); + mac_.Final(innerHash_); + + mac_.Update(opad_, T::BLOCK_SIZE); + mac_.Update(innerHash_, T::DIGEST_SIZE); + mac_.Final(hash); + + innerHashKeyed_ = false; +} + + +} // namespace + +#endif // TAO_CRYPT_HMAC_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/integer.hpp b/externals/mysql/extlib/yassl/taocrypt/include/integer.hpp new file mode 100644 index 00000000000..186d62bb866 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/integer.hpp @@ -0,0 +1,328 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's integer.h from CryptoPP */ + + +#ifndef TAO_CRYPT_INTEGER_HPP +#define TAO_CRYPT_INTEGER_HPP + + +#ifdef _MSC_VER + // 4250: dominance + // 4660: explicitly instantiating a class already implicitly instantiated + // 4661: no suitable definition provided for explicit template request + // 4786: identifer was truncated in debug information + // 4355: 'this' : used in base member initializer list +# pragma warning(disable: 4250 4660 4661 4786 4355) +#endif + + +#include "misc.hpp" +#include "block.hpp" +#include "random.hpp" +#include "file.hpp" +#include +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +#ifdef TAOCRYPT_X86ASM_AVAILABLE + +#ifdef _M_IX86 + #if (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 500)) || \ + (defined(__ICL) && (__ICL >= 500)) + #define SSE2_INTRINSICS_AVAILABLE + #define TAOCRYPT_MM_MALLOC_AVAILABLE + #elif defined(_MSC_VER) + // _mm_free seems to be the only way to tell if the Processor Pack is + //installed or not + #include + #if defined(_mm_free) + #define SSE2_INTRINSICS_AVAILABLE + #define TAOCRYPT_MM_MALLOC_AVAILABLE + #endif + #endif +#endif + +// SSE2 intrinsics work in GCC 3.3 or later +#if defined(__SSE2__) && (__GNUC__ == 4 || __GNUC_MAJOR__ > 3 || \ + __GNUC_MINOR__ > 2) + #define SSE2_INTRINSICS_AVAILABLE +#endif + +#endif // X86ASM + + + + +namespace TaoCrypt { + +#if defined(SSE2_INTRINSICS_AVAILABLE) + + // Allocator handling proper alignment + template + class AlignedAllocator : public AllocatorBase + { + public: + typedef typename AllocatorBase::pointer pointer; + typedef typename AllocatorBase::size_type size_type; + + pointer allocate(size_type n, const void* = 0); + void deallocate(void* p, size_type n); + pointer reallocate(T* p, size_type oldSize, size_type newSize, + bool preserve) + { + return StdReallocate(*this, p, oldSize, newSize, preserve); + } + + #if !(defined(TAOCRYPT_MALLOC_ALIGNMENT_IS_16) || \ + defined(TAOCRYPT_MEMALIGN_AVAILABLE) || \ + defined(TAOCRYPT_MM_MALLOC_AVAILABLE)) + #define TAOCRYPT_NO_ALIGNED_ALLOC + AlignedAllocator() : m_pBlock(0) {} + protected: + void *m_pBlock; + #endif + }; + + typedef Block > AlignedWordBlock; +#else + typedef WordBlock AlignedWordBlock; +#endif + + +// general MIN +template inline +const T& min(const T& a, const T& b) +{ + return a < b ? a : b; +} + + +// general MAX +template inline +const T& max(const T& a, const T& b) +{ + return a > b ? a : b; +} + + +// Large Integer class +class Integer { +public: + enum Sign {POSITIVE = 0, NEGATIVE = 1 }; + enum Signedness { UNSIGNED, SIGNED }; + enum RandomNumberType { ANY, PRIME }; + + class DivideByZero {}; + + Integer(); + Integer(const Integer& t); + Integer(signed long value); + Integer(Sign s, word highWord, word lowWord); + + // BER Decode Source + explicit Integer(Source&); + + Integer(const byte* encodedInteger, unsigned int byteCount, + Signedness s = UNSIGNED); + + ~Integer() {} + + static const Integer& Zero(); + static const Integer& One(); + + Integer& Ref() { return *this; } + + Integer(RandomNumberGenerator& rng, const Integer& min, + const Integer& max); + + static Integer Power2(unsigned int e); + + unsigned int MinEncodedSize(Signedness = UNSIGNED) const; + unsigned int Encode(byte* output, unsigned int outputLen, + Signedness = UNSIGNED) const; + + void Decode(const byte* input, unsigned int inputLen, + Signedness = UNSIGNED); + void Decode(Source&); + + bool IsConvertableToLong() const; + signed long ConvertToLong() const; + + unsigned int BitCount() const; + unsigned int ByteCount() const; + unsigned int WordCount() const; + + bool GetBit(unsigned int i) const; + byte GetByte(unsigned int i) const; + unsigned long GetBits(unsigned int i, unsigned int n) const; + + bool IsZero() const { return !*this; } + bool NotZero() const { return !IsZero(); } + bool IsNegative() const { return sign_ == NEGATIVE; } + bool NotNegative() const { return !IsNegative(); } + bool IsPositive() const { return NotNegative() && NotZero(); } + bool NotPositive() const { return !IsPositive(); } + bool IsEven() const { return GetBit(0) == 0; } + bool IsOdd() const { return GetBit(0) == 1; } + + Integer& operator=(const Integer& t); + Integer& operator+=(const Integer& t); + Integer& operator-=(const Integer& t); + Integer& operator*=(const Integer& t) { return *this = Times(t); } + Integer& operator/=(const Integer& t) + { return *this = DividedBy(t);} + Integer& operator%=(const Integer& t) { return *this = Modulo(t); } + Integer& operator/=(word t) { return *this = DividedBy(t); } + Integer& operator%=(word t) { return *this = Modulo(t); } + Integer& operator<<=(unsigned int); + Integer& operator>>=(unsigned int); + + + void Randomize(RandomNumberGenerator &rng, unsigned int bitcount); + void Randomize(RandomNumberGenerator &rng, const Integer &min, + const Integer &max); + + void SetBit(unsigned int n, bool value = 1); + void SetByte(unsigned int n, byte value); + + void Negate(); + void SetPositive() { sign_ = POSITIVE; } + void SetNegative() { if (!!(*this)) sign_ = NEGATIVE; } + void Swap(Integer& a); + + bool operator!() const; + Integer operator+() const {return *this;} + Integer operator-() const; + Integer& operator++(); + Integer& operator--(); + Integer operator++(int) + { Integer temp = *this; ++*this; return temp; } + Integer operator--(int) + { Integer temp = *this; --*this; return temp; } + + int Compare(const Integer& a) const; + + Integer Plus(const Integer &b) const; + Integer Minus(const Integer &b) const; + Integer Times(const Integer &b) const; + Integer DividedBy(const Integer &b) const; + Integer Modulo(const Integer &b) const; + Integer DividedBy(word b) const; + word Modulo(word b) const; + + Integer operator>>(unsigned int n) const { return Integer(*this)>>=n; } + Integer operator<<(unsigned int n) const { return Integer(*this)<<=n; } + + Integer AbsoluteValue() const; + Integer Doubled() const { return Plus(*this); } + Integer Squared() const { return Times(*this); } + Integer SquareRoot() const; + + bool IsSquare() const; + bool IsUnit() const; + + Integer MultiplicativeInverse() const; + + friend Integer a_times_b_mod_c(const Integer& x, const Integer& y, + const Integer& m); + friend Integer a_exp_b_mod_c(const Integer& x, const Integer& e, + const Integer& m); + + static void Divide(Integer& r, Integer& q, const Integer& a, + const Integer& d); + static void Divide(word& r, Integer& q, const Integer& a, word d); + static void DivideByPowerOf2(Integer& r, Integer& q, const Integer& a, + unsigned int n); + static Integer Gcd(const Integer& a, const Integer& n); + + Integer InverseMod(const Integer& n) const; + word InverseMod(word n) const; + +private: + friend class ModularArithmetic; + friend class MontgomeryRepresentation; + + Integer(word value, unsigned int length); + int PositiveCompare(const Integer& t) const; + + friend void PositiveAdd(Integer& sum, const Integer& a, const Integer& b); + friend void PositiveSubtract(Integer& diff, const Integer& a, + const Integer& b); + friend void PositiveMultiply(Integer& product, const Integer& a, + const Integer& b); + friend void PositiveDivide(Integer& remainder, Integer& quotient, const + Integer& dividend, const Integer& divisor); + AlignedWordBlock reg_; + Sign sign_; +}; + +inline bool operator==(const Integer& a, const Integer& b) + {return a.Compare(b)==0;} +inline bool operator!=(const Integer& a, const Integer& b) + {return a.Compare(b)!=0;} +inline bool operator> (const Integer& a, const Integer& b) + {return a.Compare(b)> 0;} +inline bool operator>=(const Integer& a, const Integer& b) + {return a.Compare(b)>=0;} +inline bool operator< (const Integer& a, const Integer& b) + {return a.Compare(b)< 0;} +inline bool operator<=(const Integer& a, const Integer& b) + {return a.Compare(b)<=0;} + +inline Integer operator+(const Integer &a, const Integer &b) + {return a.Plus(b);} +inline Integer operator-(const Integer &a, const Integer &b) + {return a.Minus(b);} +inline Integer operator*(const Integer &a, const Integer &b) + {return a.Times(b);} +inline Integer operator/(const Integer &a, const Integer &b) + {return a.DividedBy(b);} +inline Integer operator%(const Integer &a, const Integer &b) + {return a.Modulo(b);} +inline Integer operator/(const Integer &a, word b) {return a.DividedBy(b);} +inline word operator%(const Integer &a, word b) {return a.Modulo(b);} + +inline void swap(Integer &a, Integer &b) +{ + a.Swap(b); +} + + +Integer CRT(const Integer& xp, const Integer& p, const Integer& xq, + const Integer& q, const Integer& u); + +inline Integer ModularExponentiation(const Integer& a, const Integer& e, + const Integer& m) +{ + return a_exp_b_mod_c(a, e, m); +} + +Integer ModularRoot(const Integer& a, const Integer& dp, const Integer& dq, + const Integer& p, const Integer& q, const Integer& u); + + + +} // namespace + +#endif // TAO_CRYPT_INTEGER_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/kernelc.hpp b/externals/mysql/extlib/yassl/taocrypt/include/kernelc.hpp new file mode 100644 index 00000000000..daa3762d5dd --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/kernelc.hpp @@ -0,0 +1,46 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* kernelc.hpp provides support for C std lib when compiled in kernel mode +*/ + +#ifndef TAOCRYPT_KERNELC_HPP +#define TAOCRYPT_KERNELC_HPP + +#include // get right size_t + +// system functions that c++ doesn't like headers for + +extern "C" void* memcpy(void*, const void*, size_t); +extern "C" void* memset(void*, int, size_t); +extern "C" void printk(char *fmt, ...); + +#define KERN_ERR "<3>" /* error conditions */ + +#if defined(NDEBUG) + #define assert(p) ((void)0) +#else + #define assert(expr) \ + if (!(expr)) { \ + printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ + #expr,__FILE__,__FUNCTION__,__LINE__); } +#endif + + + +#endif // TAOCRYPT_KERNELC_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/md2.hpp b/externals/mysql/extlib/yassl/taocrypt/include/md2.hpp new file mode 100644 index 00000000000..cb13d86ec07 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/md2.hpp @@ -0,0 +1,64 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* md2.hpp provides MD2 digest support, see RFC 1319 +*/ + +#ifndef TAO_CRYPT_MD2_HPP +#define TAO_CRYPT_MD2_HPP + + +#include "hash.hpp" +#include "block.hpp" + + +namespace TaoCrypt { + + +// MD2 digest +class MD2 : public HASH { +public: + enum { BLOCK_SIZE = 16, DIGEST_SIZE = 16, PAD_SIZE = 16, X_SIZE = 48 }; + MD2(); + + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + + void Update(const byte*, word32); + void Final(byte*); + + void Init(); + void Swap(MD2&); +private: + ByteBlock X_, C_, buffer_; + word32 count_; // bytes % PAD_SIZE + + MD2(const MD2&); + MD2& operator=(const MD2&); +}; + +inline void swap(MD2& a, MD2& b) +{ + a.Swap(b); +} + + +} // namespace + +#endif // TAO_CRYPT_MD2_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/md4.hpp b/externals/mysql/extlib/yassl/taocrypt/include/md4.hpp new file mode 100644 index 00000000000..28c2bc7efd1 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/md4.hpp @@ -0,0 +1,62 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* md4.hpp provides MD4 digest support + * WANRING: MD4 is considered insecure, only use if you have to, e.g., yaSSL + * libcurl supports needs this for NTLM authentication +*/ + +#ifndef TAO_CRYPT_MD4_HPP +#define TAO_CRYPT_MD4_HPP + +#include "hash.hpp" + +namespace TaoCrypt { + + +// MD4 digest +class MD4 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 16, PAD_SIZE = 56, + TAO_BYTE_ORDER = LittleEndianOrder }; // in Bytes + MD4() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + MD4(const MD4&); + MD4& operator= (const MD4&); + + void Init(); + void Swap(MD4&); +private: + void Transform(); +}; + +inline void swap(MD4& a, MD4& b) +{ + a.Swap(b); +} + + +} // namespace + +#endif // TAO_CRYPT_MD4_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/md5.hpp b/externals/mysql/extlib/yassl/taocrypt/include/md5.hpp new file mode 100644 index 00000000000..9b461543675 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/md5.hpp @@ -0,0 +1,70 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* md5.hpp provides MD5 digest support, see RFC 1321 +*/ + +#ifndef TAO_CRYPT_MD5_HPP +#define TAO_CRYPT_MD5_HPP + +#include "hash.hpp" + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_MD5_ASM +#endif + +namespace TaoCrypt { + + +// MD5 digest +class MD5 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 16, PAD_SIZE = 56, + TAO_BYTE_ORDER = LittleEndianOrder }; // in Bytes + MD5() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + MD5(const MD5&); + MD5& operator= (const MD5&); + +#ifdef DO_MD5_ASM + void Update(const byte*, word32); +#endif + + void Init(); + void Swap(MD5&); +private: + void Transform(); + void AsmTransform(const byte* data, word32 times); +}; + +inline void swap(MD5& a, MD5& b) +{ + a.Swap(b); +} + + +} // namespace + +#endif // TAO_CRYPT_MD5_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/misc.hpp b/externals/mysql/extlib/yassl/taocrypt/include/misc.hpp new file mode 100644 index 00000000000..a101a14bcdb --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/misc.hpp @@ -0,0 +1,886 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's misc.h from CryptoPP */ + +#ifndef TAO_CRYPT_MISC_HPP +#define TAO_CRYPT_MISC_HPP + + +#if !defined(DO_TAOCRYPT_KERNEL_MODE) + #include + #include + #include +#else + #include "kernelc.hpp" +#endif + +#include "types.hpp" +#include "type_traits.hpp" + + + +namespace TaoCrypt { + + +// Delete static singleton holders +void CleanUp(); + + +#ifdef YASSL_PURE_C + + // library allocation + struct new_t {}; // TaoCrypt New type + extern new_t tc; // pass in parameter + + } // namespace TaoCrypt + + void* operator new (size_t, TaoCrypt::new_t); + void* operator new[](size_t, TaoCrypt::new_t); + + void operator delete (void*, TaoCrypt::new_t); + void operator delete[](void*, TaoCrypt::new_t); + + + namespace TaoCrypt { + + template + void tcDelete(T* ptr) + { + if (ptr) ptr->~T(); + ::operator delete(ptr, TaoCrypt::tc); + } + + template + void tcArrayDelete(T* ptr) + { + // can't do array placement destruction since not tracking size in + // allocation, only allow builtins to use array placement since they + // don't need destructors called + typedef char builtin[IsFundamentalType::Yes ? 1 : -1]; + (void)sizeof(builtin); + + ::operator delete[](ptr, TaoCrypt::tc); + } + + #define NEW_TC new (TaoCrypt::tc) + + + // to resolve compiler generated operator delete on base classes with + // virtual destructors (when on stack), make sure doesn't get called + class virtual_base { + public: + static void operator delete(void*) { assert(0); } + }; + +#else // YASSL_PURE_C + + + template + void tcDelete(T* ptr) + { + delete ptr; + } + + template + void tcArrayDelete(T* ptr) + { + delete[] ptr; + } + + #define NEW_TC new + + class virtual_base {}; + + +#endif // YASSL_PURE_C + + +#if defined(_MSC_VER) || defined(__BCPLUSPLUS__) + #define INTEL_INTRINSICS + #define FAST_ROTATE +#elif defined(__MWERKS__) && TARGET_CPU_PPC + #define PPC_INTRINSICS + #define FAST_ROTATE +#elif defined(__GNUC__) && defined(__i386__) + // GCC does peephole optimizations which should result in using rotate + // instructions + #define FAST_ROTATE +#endif + + +// no gas on these systems ?, disable for now +#if defined(__sun__) || defined (__QNX__) || defined (__APPLE__) + #define TAOCRYPT_DISABLE_X86ASM +#endif + +// icc problem with -03 and integer, disable for now +#if defined(__INTEL_COMPILER) + #define TAOCRYPT_DISABLE_X86ASM +#endif + + +// Turn on ia32 ASM for Big Integer +// CodeWarrior defines _MSC_VER +#if !defined(TAOCRYPT_DISABLE_X86ASM) && ((defined(_MSC_VER) && \ + !defined(__MWERKS__) && defined(_M_IX86)) || \ + (defined(__GNUC__) && defined(__i386__))) + #define TAOCRYPT_X86ASM_AVAILABLE +#endif + + +#ifdef TAOCRYPT_X86ASM_AVAILABLE + bool HaveCpuId(); + bool IsPentium(); + void CpuId(word32 input, word32 *output); + + extern bool isMMX; +#endif + + + + +// Turn on ia32 ASM for Ciphers and Message Digests +// Seperate define since these are more complex, use member offsets +// and user may want to turn off while leaving Big Integer optos on +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && !defined(DISABLE_TAO_ASM) + #define TAO_ASM +#endif + + +// Extra word in older vtable implementations, for ASM member offset +#if defined(__GNUC__) && __GNUC__ < 3 + #define OLD_GCC_OFFSET +#endif + + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +# define TAOCRYPT_MALLOC_ALIGNMENT_IS_16 +#endif + +#if defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) +# define TAOCRYPT_MEMALIGN_AVAILABLE +#endif + + +#if defined(_WIN32) || defined(__CYGWIN__) + #define TAOCRYPT_WIN32_AVAILABLE +#endif + +#if defined(__unix__) || defined(__MACH__) + #define TAOCRYPT_UNIX_AVAILABLE +#endif + + +// VC60 workaround: it doesn't allow typename in some places +#if defined(_MSC_VER) && (_MSC_VER < 1300) + #define CPP_TYPENAME +#else + #define CPP_TYPENAME typename +#endif + + +#ifdef _MSC_VER + #define TAOCRYPT_NO_VTABLE __declspec(novtable) +#else + #define TAOCRYPT_NO_VTABLE +#endif + + +#ifdef USE_SYS_STL + // use system STL + #define STL_NAMESPACE std +#else + // use mySTL + #define STL_NAMESPACE mySTL +#endif + + +// ***************** DLL related ******************** + +#ifdef TAOCRYPT_WIN32_AVAILABLE + +#ifdef TAOCRYPT_EXPORTS + #define TAOCRYPT_IS_DLL + #define TAOCRYPT_DLL __declspec(dllexport) +#elif defined(TAOCRYPT_IMPORTS) + #define TAOCRYPT_IS_DLL + #define TAOCRYPT_DLL __declspec(dllimport) +#else + #define TAOCRYPT_DLL +#endif // EXPORTS + +#define TAOCRYPT_API __stdcall +#define TAOCRYPT_CDECL __cdecl + +#else // TAOCRYPT_WIN32_AVAILABLE + +#define TAOCRYPT_DLL +#define TAOCRYPT_API +#define TAOCRYPT_CDECL + +#endif // TAOCRYPT_WIN32_AVAILABLE + + +// ****************** tempalte stuff ******************* + + +#if defined(TAOCRYPT_MANUALLY_INSTANTIATE_TEMPLATES) && \ + !defined(TAOCRYPT_IMPORTS) + #define TAOCRYPT_DLL_TEMPLATE_CLASS template class TAOCRYPT_DLL +#elif defined(__MWERKS__) + #define TAOCRYPT_DLL_TEMPLATE_CLASS extern class TAOCRYPT_DLL +#else + #define TAOCRYPT_DLL_TEMPLATE_CLASS extern template class TAOCRYPT_DLL +#endif + + +#if defined(TAOCRYPT_MANUALLY_INSTANTIATE_TEMPLATES) && \ + !defined(TAOCRYPT_EXPORTS) + #define TAOCRYPT_STATIC_TEMPLATE_CLASS template class +#elif defined(__MWERKS__) + #define TAOCRYPT_STATIC_TEMPLATE_CLASS extern class +#else + #define TAOCRYPT_STATIC_TEMPLATE_CLASS extern template class +#endif + + +// ************** compile-time assertion *************** + +template +struct CompileAssert +{ + static char dummy[2*b-1]; +}; + +#define TAOCRYPT_COMPILE_ASSERT(assertion) \ + TAOCRYPT_COMPILE_ASSERT_INSTANCE(assertion, __LINE__) + +#if defined(TAOCRYPT_EXPORTS) || defined(TAOCRYPT_IMPORTS) + #define TAOCRYPT_COMPILE_ASSERT_INSTANCE(assertion, instance) +#else + #define TAOCRYPT_COMPILE_ASSERT_INSTANCE(assertion, instance) \ + (void)sizeof(CompileAssert<(assertion)>) +#endif + +#define TAOCRYPT_ASSERT_JOIN(X, Y) TAOCRYPT_DO_ASSERT_JOIN(X, Y) + +#define TAOCRYPT_DO_ASSERT_JOIN(X, Y) X##Y + + +/*************** helpers *****************************/ + +inline unsigned int BitsToBytes(unsigned int bitCount) +{ + return ((bitCount+7)/(8)); +} + +inline unsigned int BytesToWords(unsigned int byteCount) +{ + return ((byteCount+WORD_SIZE-1)/WORD_SIZE); +} + +inline unsigned int BitsToWords(unsigned int bitCount) +{ + return ((bitCount+WORD_BITS-1)/(WORD_BITS)); +} + +inline void CopyWords(word* r, const word* a, word32 n) +{ + for (word32 i = 0; i < n; i++) + r[i] = a[i]; +} + +inline unsigned int CountWords(const word* X, unsigned int N) +{ + while (N && X[N-1]==0) + N--; + return N; +} + +inline void SetWords(word* r, word a, unsigned int n) +{ + for (unsigned int i=0; i +struct EnumToType +{ + static ENUM_TYPE ToEnum() { return (ENUM_TYPE)VALUE; } +}; + +typedef EnumToType LittleEndian; +typedef EnumToType BigEndian; + + +#ifndef BIG_ENDIAN_ORDER + typedef LittleEndian HostByteOrder; +#else + typedef BigEndian HostByteOrder; +#endif + +inline ByteOrder GetHostByteOrder() +{ + return HostByteOrder::ToEnum(); +} + +inline bool HostByteOrderIs(ByteOrder order) +{ + return order == GetHostByteOrder(); +} + + +void xorbuf(byte*, const byte*, unsigned int); + + +template +inline bool IsPowerOf2(T n) +{ + return n > 0 && (n & (n-1)) == 0; +} + +template +inline T2 ModPowerOf2(T1 a, T2 b) +{ + assert(IsPowerOf2(b)); + return T2(a) & (b-1); +} + +template +inline T RoundDownToMultipleOf(T n, T m) +{ + return n - (IsPowerOf2(m) ? ModPowerOf2(n, m) : (n%m)); +} + +template +inline T RoundUpToMultipleOf(T n, T m) +{ + return RoundDownToMultipleOf(n+m-1, m); +} + +template +inline unsigned int GetAlignment(T* dummy = 0) // VC60 workaround +{ +#if (_MSC_VER >= 1300) + return __alignof(T); +#elif defined(__GNUC__) + return __alignof__(T); +#else + return sizeof(T); +#endif +} + +inline bool IsAlignedOn(const void* p, unsigned int alignment) +{ + return IsPowerOf2(alignment) ? ModPowerOf2((size_t)p, alignment) == 0 + : (size_t)p % alignment == 0; +} + +template +inline bool IsAligned(const void* p, T* dummy = 0) // VC60 workaround +{ + return IsAlignedOn(p, GetAlignment()); +} + + +template inline T rotlFixed(T x, unsigned int y) +{ + assert(y < sizeof(T)*8); + return (x<>(sizeof(T)*8-y)); +} + +template inline T rotrFixed(T x, unsigned int y) +{ + assert(y < sizeof(T)*8); + return (x>>y) | (x<<(sizeof(T)*8-y)); +} + +#ifdef INTEL_INTRINSICS + +#pragma intrinsic(_lrotl, _lrotr) + +template<> inline word32 rotlFixed(word32 x, word32 y) +{ + assert(y < 32); + return y ? _lrotl(x, y) : x; +} + +template<> inline word32 rotrFixed(word32 x, word32 y) +{ + assert(y < 32); + return y ? _lrotr(x, y) : x; +} + +#endif // INTEL_INTRINSICS + +#ifndef min +inline word32 min(word32 a, word32 b) +{ + return a < b ? a : b; +} +#endif + + +inline word32 ByteReverse(word32 value) +{ +#ifdef PPC_INTRINSICS + // PPC: load reverse indexed instruction + return (word32)__lwbrx(&value,0); +#elif defined(FAST_ROTATE) + // 5 instructions with rotate instruction, 9 without + return (rotrFixed(value, 8U) & 0xff00ff00) | + (rotlFixed(value, 8U) & 0x00ff00ff); +#else + // 6 instructions with rotate instruction, 8 without + value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); + return rotlFixed(value, 16U); +#endif +} + + +#ifdef WORD64_AVAILABLE + +inline word64 ByteReverse(word64 value) +{ +#ifdef TAOCRYPT_SLOW_WORD64 + return (word64(ByteReverse(word32(value))) << 32) | + ByteReverse(word32(value>>32)); +#else + value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | + ((value & W64LIT(0x00FF00FF00FF00FF)) << 8); + value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | + ((value & W64LIT(0x0000FFFF0000FFFF)) << 16); + return rotlFixed(value, 32U); +#endif +} + +#endif // WORD64_AVAILABLE + + +template +inline void ByteReverse(T* out, const T* in, word32 byteCount) +{ + assert(byteCount % sizeof(T) == 0); + word32 count = byteCount/sizeof(T); + for (word32 i=0; i(out); + const word32* i = reinterpret_cast(in); + ByteReverse(o, i, byteCount); +} + + +template +inline T ByteReverseIf(T value, ByteOrder order) +{ + return HostByteOrderIs(order) ? value : ByteReverse(value); +} + + +template +inline void ByteReverseIf(T* out, const T* in, word32 bc, ByteOrder order) +{ + if (!HostByteOrderIs(order)) + ByteReverse(out, in, bc); + else if (out != in) + memcpy(out, in, bc); +} + + + +// do Asm Reverse is host is Little and x86asm +#ifdef LITTLE_ENDIAN_ORDER + #ifdef TAOCRYPT_X86ASM_AVAILABLE + #define LittleReverse AsmReverse + #else + #define LittleReverse ByteReverse + #endif +#else + #define LittleReverse +#endif + + +// do Asm Reverse is host is Big and x86asm +#ifdef BIG_ENDIAN_ORDER + #ifdef TAOCRYPT_X86ASM_AVAILABLE + #define BigReverse AsmReverse + #else + #define BigReverse ByteReverse + #endif +#else + #define BigReverse +#endif + + +#ifdef TAOCRYPT_X86ASM_AVAILABLE + + // faster than rotate, use bswap + + inline word32 AsmReverse(word32 wd) + { + #ifdef __GNUC__ + __asm__ + ( + "bswap %1" + : "=r"(wd) + : "0"(wd) + ); + #else + __asm + { + mov eax, wd + bswap eax + mov wd, eax + } + #endif + return wd; + } + +#endif + + +template +inline void GetUserKey(ByteOrder order, T* out, word32 outlen, const byte* in, + word32 inlen) +{ + const unsigned int U = sizeof(T); + assert(inlen <= outlen*U); + memcpy(out, in, inlen); + memset((byte *)out+inlen, 0, outlen*U-inlen); + ByteReverseIf(out, out, RoundUpToMultipleOf(inlen, U), order); +} + + +#ifdef _MSC_VER + // disable conversion warning + #pragma warning(disable:4244) +#endif + + +inline byte UnalignedGetWordNonTemplate(ByteOrder order, const byte *block, + byte*) +{ + return block[0]; +} + +inline word16 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block, + word16*) +{ + return (order == BigEndianOrder) + ? block[1] | (block[0] << 8) + : block[0] | (block[1] << 8); +} + +inline word32 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block, + word32*) +{ + return (order == BigEndianOrder) + ? word32(block[3]) | (word32(block[2]) << 8) | (word32(block[1]) << 16) + | (word32(block[0]) << 24) + : word32(block[0]) | (word32(block[1]) << 8) | (word32(block[2]) << 16) + | (word32(block[3]) << 24); +} + +template +inline T UnalignedGetWord(ByteOrder order, const byte *block, T* dummy = 0) +{ + return UnalignedGetWordNonTemplate(order, block, dummy); +} + +inline void UnalignedPutWord(ByteOrder order, byte *block, byte value, + const byte *xorBlock = 0) +{ + block[0] = xorBlock ? (value ^ xorBlock[0]) : value; +} + +#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y))) + +inline void UnalignedPutWord(ByteOrder order, byte *block, word16 value, + const byte *xorBlock = 0) +{ + if (order == BigEndianOrder) + { + block[0] = GETBYTE(value, 1); + block[1] = GETBYTE(value, 0); + } + else + { + block[0] = GETBYTE(value, 0); + block[1] = GETBYTE(value, 1); + } + + if (xorBlock) + { + block[0] ^= xorBlock[0]; + block[1] ^= xorBlock[1]; + } +} + +inline void UnalignedPutWord(ByteOrder order, byte* block, word32 value, + const byte* xorBlock = 0) +{ + if (order == BigEndianOrder) + { + block[0] = GETBYTE(value, 3); + block[1] = GETBYTE(value, 2); + block[2] = GETBYTE(value, 1); + block[3] = GETBYTE(value, 0); + } + else + { + block[0] = GETBYTE(value, 0); + block[1] = GETBYTE(value, 1); + block[2] = GETBYTE(value, 2); + block[3] = GETBYTE(value, 3); + } + + if (xorBlock) + { + block[0] ^= xorBlock[0]; + block[1] ^= xorBlock[1]; + block[2] ^= xorBlock[2]; + block[3] ^= xorBlock[3]; + } +} + + +template +inline T GetWord(bool assumeAligned, ByteOrder order, const byte *block) +{ + if (assumeAligned) + { + assert(IsAligned(block)); + return ByteReverseIf(*reinterpret_cast(block), order); + } + else + return UnalignedGetWord(order, block); +} + +template +inline void GetWord(bool assumeAligned, ByteOrder order, T &result, + const byte *block) +{ + result = GetWord(assumeAligned, order, block); +} + +template +inline void PutWord(bool assumeAligned, ByteOrder order, byte* block, T value, + const byte *xorBlock = 0) +{ + if (assumeAligned) + { + assert(IsAligned(block)); + if (xorBlock) + *reinterpret_cast(block) = ByteReverseIf(value, order) + ^ *reinterpret_cast(xorBlock); + else + *reinterpret_cast(block) = ByteReverseIf(value, order); + } + else + UnalignedPutWord(order, block, value, xorBlock); +} + +template +class GetBlock +{ +public: + GetBlock(const void *block) + : m_block((const byte *)block) {} + + template + inline GetBlock & operator()(U &x) + { + TAOCRYPT_COMPILE_ASSERT(sizeof(U) >= sizeof(T)); + x = GetWord(A, B::ToEnum(), m_block); + m_block += sizeof(T); + return *this; + } + +private: + const byte *m_block; +}; + +template +class PutBlock +{ +public: + PutBlock(const void *xorBlock, void *block) + : m_xorBlock((const byte *)xorBlock), m_block((byte *)block) {} + + template + inline PutBlock & operator()(U x) + { + PutWord(A, B::ToEnum(), m_block, (T)x, m_xorBlock); + m_block += sizeof(T); + if (m_xorBlock) + m_xorBlock += sizeof(T); + return *this; + } + +private: + const byte *m_xorBlock; + byte *m_block; +}; + +template +struct BlockGetAndPut +{ + // function needed because of C++ grammatical ambiguity between + // expression-statements and declarations + static inline GetBlock Get(const void *block) + {return GetBlock(block);} + typedef PutBlock Put; +}; + + + +template struct SafeShifter; + +template<> struct SafeShifter +{ + template + static inline T RightShift(T value, unsigned int bits) + { + return 0; + } + + template + static inline T LeftShift(T value, unsigned int bits) + { + return 0; + } +}; + +template<> struct SafeShifter +{ + template + static inline T RightShift(T value, unsigned int bits) + { + return value >> bits; + } + + template + static inline T LeftShift(T value, unsigned int bits) + { + return value << bits; + } +}; + +template +inline T SafeRightShift(T value) +{ + return SafeShifter<(bits>=(8*sizeof(T)))>::RightShift(value, bits); +} + +template +inline T SafeLeftShift(T value) +{ + return SafeShifter<(bits>=(8*sizeof(T)))>::LeftShift(value, bits); +} + + +inline +word ShiftWordsLeftByBits(word* r, unsigned int n, unsigned int shiftBits) +{ + assert (shiftBits> (WORD_BITS-shiftBits); + } + return carry; +} + + +inline +word ShiftWordsRightByBits(word* r, unsigned int n, unsigned int shiftBits) +{ + assert (shiftBits=0; i--) + { + u = r[i]; + r[i] = (u >> shiftBits) | carry; + carry = u << (WORD_BITS-shiftBits); + } + return carry; +} + + +inline +void ShiftWordsLeftByWords(word* r, unsigned int n, unsigned int shiftWords) +{ + shiftWords = min(shiftWords, n); + if (shiftWords) + { + for (unsigned int i=n-1; i>=shiftWords; i--) + r[i] = r[i-shiftWords]; + SetWords(r, 0, shiftWords); + } +} + + +inline +void ShiftWordsRightByWords(word* r, unsigned int n, unsigned int shiftWords) +{ + shiftWords = min(shiftWords, n); + if (shiftWords) + { + for (unsigned int i=0; i+shiftWords +inline T1 SaturatingSubtract(T1 a, T2 b) +{ + TAOCRYPT_COMPILE_ASSERT_INSTANCE(T1(-1)>0, 0); // T1 is unsigned type + TAOCRYPT_COMPILE_ASSERT_INSTANCE(T2(-1)>0, 1); // T2 is unsigned type + return T1((a > b) ? (a - b) : 0); +} + + +// declares +unsigned int BytePrecision(word value); +unsigned int BitPrecision(word); +word Crop(word value, unsigned int size); + + + +} // namespace + +#endif // TAO_CRYPT_MISC_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/modarith.hpp b/externals/mysql/extlib/yassl/taocrypt/include/modarith.hpp new file mode 100644 index 00000000000..501a8129b90 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/modarith.hpp @@ -0,0 +1,165 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* based on Wei Dai's modarith.h from CryptoPP */ + + +#ifndef TAO_CRYPT_MODARITH_HPP +#define TAO_CRYPT_MODARITH_HPP + +#include "misc.hpp" +#include "algebra.hpp" + +namespace TaoCrypt { + + +// ModularArithmetic +class ModularArithmetic : public AbstractRing +{ +public: + + typedef int RandomizationParameter; + typedef Integer Element; + + ModularArithmetic(const Integer &modulus = Integer::One()) + : modulus(modulus), result((word)0, modulus.reg_.size()) {} + + ModularArithmetic(const ModularArithmetic &ma) + : AbstractRing(), + modulus(ma.modulus), result((word)0, modulus.reg_.size()) {} + + const Integer& GetModulus() const {return modulus;} + void SetModulus(const Integer &newModulus) + { + modulus = newModulus; + result.reg_.resize(modulus.reg_.size()); + } + + virtual bool IsMontgomeryRepresentation() const {return false;} + + virtual Integer ConvertIn(const Integer &a) const + {return a%modulus;} + + virtual Integer ConvertOut(const Integer &a) const + {return a;} + + const Integer& Half(const Integer &a) const; + + bool Equal(const Integer &a, const Integer &b) const + {return a==b;} + + const Integer& Identity() const + {return Integer::Zero();} + + const Integer& Add(const Integer &a, const Integer &b) const; + + Integer& Accumulate(Integer &a, const Integer &b) const; + + const Integer& Inverse(const Integer &a) const; + + const Integer& Subtract(const Integer &a, const Integer &b) const; + + Integer& Reduce(Integer &a, const Integer &b) const; + + const Integer& Double(const Integer &a) const + {return Add(a, a);} + + const Integer& MultiplicativeIdentity() const + {return Integer::One();} + + const Integer& Multiply(const Integer &a, const Integer &b) const + {return result1 = a*b%modulus;} + + const Integer& Square(const Integer &a) const + {return result1 = a.Squared()%modulus;} + + bool IsUnit(const Integer &a) const + {return Integer::Gcd(a, modulus).IsUnit();} + + const Integer& MultiplicativeInverse(const Integer &a) const + {return result1 = a.InverseMod(modulus);} + + const Integer& Divide(const Integer &a, const Integer &b) const + {return Multiply(a, MultiplicativeInverse(b));} + + Integer CascadeExponentiate(const Integer &x, const Integer &e1, + const Integer &y, const Integer &e2) const; + + void SimultaneousExponentiate(Element *results, const Element &base, + const Integer *exponents, unsigned int exponentsCount) const; + + unsigned int MaxElementBitLength() const + {return (modulus-1).BitCount();} + + unsigned int MaxElementByteLength() const + {return (modulus-1).ByteCount();} + + + static const RandomizationParameter DefaultRandomizationParameter; + +protected: + Integer modulus; + mutable Integer result, result1; + +}; + + + +//! do modular arithmetics in Montgomery representation for increased speed +class MontgomeryRepresentation : public ModularArithmetic +{ +public: + MontgomeryRepresentation(const Integer &modulus); // modulus must be odd + + bool IsMontgomeryRepresentation() const {return true;} + + Integer ConvertIn(const Integer &a) const + {return (a<<(WORD_BITS*modulus.reg_.size()))%modulus;} + + Integer ConvertOut(const Integer &a) const; + + const Integer& MultiplicativeIdentity() const + {return result1 = Integer::Power2(WORD_BITS*modulus.reg_.size())%modulus;} + + const Integer& Multiply(const Integer &a, const Integer &b) const; + + const Integer& Square(const Integer &a) const; + + const Integer& MultiplicativeInverse(const Integer &a) const; + + Integer CascadeExponentiate(const Integer &x, const Integer &e1, + const Integer &y, const Integer &e2) const + {return AbstractRing::CascadeExponentiate(x, e1, y, e2);} + + void SimultaneousExponentiate(Element *results, const Element &base, + const Integer *exponents, unsigned int exponentsCount) const + {AbstractRing::SimultaneousExponentiate(results, base, + exponents, exponentsCount);} + +private: + Integer u; + mutable AlignedWordBlock workspace; +}; + + + + +} // namespace + +#endif // TAO_CRYPT_MODARITH_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/modes.hpp b/externals/mysql/extlib/yassl/taocrypt/include/modes.hpp new file mode 100644 index 00000000000..d1ebce7568b --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/modes.hpp @@ -0,0 +1,155 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* modes.hpp provides ECB and CBC modes for block cipher encryption/decryption +*/ + + +#ifndef TAO_CRYPT_MODES_HPP +#define TAO_CRYPT_MODES_HPP + +#include "misc.hpp" + +namespace TaoCrypt { + + +enum Mode { ECB, CBC }; + + + +// BlockCipher abstraction +template +class BlockCipher { +public: + BlockCipher() : cipher_(DIR, MODE) {} + + void Process(byte* c, const byte* p, word32 sz) + { cipher_.Process(c, p, sz); } + void SetKey(const byte* k, word32 sz) + { cipher_.SetKey(k, sz, DIR); } + void SetKey(const byte* k, word32 sz, const byte* iv) + { cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv); } +private: + T cipher_; + + BlockCipher(const BlockCipher&); // hide copy + BlockCipher& operator=(const BlockCipher&); // and assign +}; + + +// Mode Base for block ciphers, static size +class Mode_BASE : public virtual_base { +public: + enum { MaxBlockSz = 16 }; + + explicit Mode_BASE(int sz, CipherDir dir, Mode mode) + : blockSz_(sz), reg_(reinterpret_cast(r_)), + tmp_(reinterpret_cast(t_)), dir_(dir), mode_(mode) + { + assert(sz <= MaxBlockSz); + } + virtual ~Mode_BASE() {} + + virtual void Process(byte*, const byte*, word32); + + void SetIV(const byte* iv) { memcpy(reg_, iv, blockSz_); } +protected: + int blockSz_; + byte* reg_; + byte* tmp_; + + word32 r_[MaxBlockSz / sizeof(word32)]; // align reg_ on word32 + word32 t_[MaxBlockSz / sizeof(word32)]; // align tmp_ on word32 + + CipherDir dir_; + Mode mode_; + + void ECB_Process(byte*, const byte*, word32); + void CBC_Encrypt(byte*, const byte*, word32); + void CBC_Decrypt(byte*, const byte*, word32); + + Mode_BASE(const Mode_BASE&); // hide copy + Mode_BASE& operator=(const Mode_BASE&); // and assign + +private: + virtual void ProcessAndXorBlock(const byte*, const byte*, byte*) const = 0; +}; + + +inline void Mode_BASE::Process(byte* out, const byte* in, word32 sz) +{ + if (mode_ == ECB) + ECB_Process(out, in, sz); + else if (mode_ == CBC) + if (dir_ == ENCRYPTION) + CBC_Encrypt(out, in, sz); + else + CBC_Decrypt(out, in, sz); +} + + +// ECB Process blocks +inline void Mode_BASE::ECB_Process(byte* out, const byte* in, word32 sz) +{ + word32 blocks = sz / blockSz_; + + while (blocks--) { + ProcessAndXorBlock(in, 0, out); + out += blockSz_; + in += blockSz_; + } +} + + +// CBC Encrypt +inline void Mode_BASE::CBC_Encrypt(byte* out, const byte* in, word32 sz) +{ + word32 blocks = sz / blockSz_; + + while (blocks--) { + xorbuf(reg_, in, blockSz_); + ProcessAndXorBlock(reg_, 0, reg_); + memcpy(out, reg_, blockSz_); + out += blockSz_; + in += blockSz_; + } +} + + +// CBC Decrypt +inline void Mode_BASE::CBC_Decrypt(byte* out, const byte* in, word32 sz) +{ + word32 blocks = sz / blockSz_; + byte hold[MaxBlockSz]; + + while (blocks--) { + memcpy(tmp_, in, blockSz_); + ProcessAndXorBlock(tmp_, 0, out); + xorbuf(out, reg_, blockSz_); + memcpy(hold, reg_, blockSz_); // swap reg_ and tmp_ + memcpy(reg_, tmp_, blockSz_); + memcpy(tmp_, hold, blockSz_); + out += blockSz_; + in += blockSz_; + } +} + + +} // namespace + +#endif // TAO_CRYPT_MODES_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/pwdbased.hpp b/externals/mysql/extlib/yassl/taocrypt/include/pwdbased.hpp new file mode 100644 index 00000000000..5ece1a8f43b --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/pwdbased.hpp @@ -0,0 +1,90 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* pwdbased.hpp defines PBKDF2 from PKCS #5 +*/ + + +#ifndef TAO_CRYPT_PWDBASED_HPP +#define TAO_CRYPT_PWDBASED_HPP + +#include +#include "misc.hpp" +#include "block.hpp" +#include "hmac.hpp" + +namespace TaoCrypt { + + +// From PKCS #5, T must be type suitable for HMAC +template +class PBKDF2_HMAC { +public: + word32 MaxDerivedKeyLength() const { return 0xFFFFFFFFU;} // avoid overflow + + word32 DeriveKey(byte* derived, word32 dLen, const byte* pwd, word32 pLen, + const byte* salt, word32 sLen, word32 iterations) const; +}; + + + +template +word32 PBKDF2_HMAC::DeriveKey(byte* derived, word32 dLen, const byte* pwd, + word32 pLen, const byte* salt, word32 sLen, + word32 iterations) const +{ + assert(dLen <= MaxDerivedKeyLength()); + assert(iterations > 0); + + ByteBlock buffer(T::DIGEST_SIZE); + HMAC hmac; + + hmac.SetKey(pwd, pLen); + + word32 i = 1; + + while (dLen > 0) { + hmac.Update(salt, sLen); + word32 j; + for (j = 0; j < 4; j++) { + byte b = i >> ((3-j)*8); + hmac.Update(&b, 1); + } + hmac.Final(buffer.get_buffer()); + + word32 segmentLen = min(dLen, buffer.size()); + memcpy(derived, buffer.get_buffer(), segmentLen); + + for (j = 1; j < iterations; j++) { + hmac.Update(buffer.get_buffer(), buffer.size()); + hmac.Final(buffer.get_buffer()); + xorbuf(derived, buffer.get_buffer(), segmentLen); + } + derived += segmentLen; + dLen -= segmentLen; + i++; + } + return iterations; +} + + + + +} // naemspace + +#endif // TAO_CRYPT_PWDBASED_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/random.hpp b/externals/mysql/extlib/yassl/taocrypt/include/random.hpp new file mode 100644 index 00000000000..91058e8c5cf --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/random.hpp @@ -0,0 +1,84 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* random.hpp provides a crypto secure Random Number Generator using an OS + specific seed +*/ + + +#ifndef TAO_CRYPT_RANDOM_HPP +#define TAO_CRYPT_RANDOM_HPP + +#include "arc4.hpp" +#include "error.hpp" + +namespace TaoCrypt { + + +// OS specific seeder +class OS_Seed { +public: + OS_Seed(); + ~OS_Seed(); + + void GenerateSeed(byte*, word32 sz); + Error GetError() const { return error_; } +private: +#if defined(_WIN32) + #if defined(_WIN64) + typedef unsigned __int64 ProviderHandle; + // type HCRYPTPROV, avoid #include + #else + typedef unsigned long ProviderHandle; + #endif + ProviderHandle handle_; +#else + int fd_; +#endif + Error error_; + + OS_Seed(const OS_Seed&); // hide copy + OS_Seed& operator=(const OS_Seed&); // hide assign +}; + + +// secure Random Nnumber Generator +class RandomNumberGenerator { +public: + RandomNumberGenerator(); + ~RandomNumberGenerator() {} + + void GenerateBlock(byte*, word32 sz); + byte GenerateByte(); + + ErrorNumber GetError() const { return seed_.GetError().What(); } +private: + OS_Seed seed_; + ARC4 cipher_; + + RandomNumberGenerator(const RandomNumberGenerator&); // hide copy + RandomNumberGenerator operator=(const RandomNumberGenerator&); // && assign +}; + + + + +} // namespace + +#endif // TAO_CRYPT_RANDOM_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/ripemd.hpp b/externals/mysql/extlib/yassl/taocrypt/include/ripemd.hpp new file mode 100644 index 00000000000..a63f92ceadd --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/ripemd.hpp @@ -0,0 +1,69 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* ripemd.hpp provides RIPEMD digest support +*/ + +#ifndef TAO_CRYPT_RIPEMD_HPP +#define TAO_CRYPT_RIPEMD_HPP + +#include "hash.hpp" + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_RIPEMD_ASM +#endif + +namespace TaoCrypt { + + +// RIPEMD160 digest +class RIPEMD160 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 20, PAD_SIZE = 56, + TAO_BYTE_ORDER = LittleEndianOrder }; // in Bytes + RIPEMD160() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + RIPEMD160(const RIPEMD160&); + RIPEMD160& operator= (const RIPEMD160&); + +#ifdef DO_RIPEMD_ASM + void Update(const byte*, word32); +#endif + void Init(); + void Swap(RIPEMD160&); +private: + void Transform(); + void AsmTransform(const byte* data, word32 times); +}; + +inline void swap(RIPEMD160& a, RIPEMD160& b) +{ + a.Swap(b); +} + + +} // namespace + +#endif // TAO_CRYPT_RIPEMD_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/rsa.hpp b/externals/mysql/extlib/yassl/taocrypt/include/rsa.hpp new file mode 100644 index 00000000000..c895ab6fd34 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/rsa.hpp @@ -0,0 +1,250 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* rsa.hpp provides RSA ES encrypt/decrypt, SSL (block type 1) sign and verify +*/ + +#ifndef TAO_CRYPT_RSA_HPP +#define TAO_CRYPT_RSA_HPP + +#include "integer.hpp" +#include "random.hpp" + + +namespace TaoCrypt { + +class Source; + + +// Public Key Length helper +class PK_Lengths { + const Integer& image_; +public: + explicit PK_Lengths(const Integer& i) : image_(i) {} + + word32 PaddedBlockBitLength() const {return image_.BitCount() - 1;} + word32 PaddedBlockByteLength() const + {return BitsToBytes(PaddedBlockBitLength());} + + word32 FixedCiphertextLength() const {return image_.ByteCount();} + word32 FixedMaxPlaintextLength() const + {return SaturatingSubtract(PaddedBlockBitLength() / 8, 10U); } +}; + + +// RSA Public Key +class RSA_PublicKey { +protected: + Integer n_; + Integer e_; +public: + RSA_PublicKey() {} + explicit RSA_PublicKey(Source&); + + void Initialize(const Integer& n, const Integer& e) {n_ = n; e_ = e;} + void Initialize(Source&); + + Integer ApplyFunction(const Integer& x) const; + + const Integer& GetModulus() const {return n_;} + const Integer& GetPublicExponent() const {return e_;} + + void SetModulus(const Integer& n) {n_ = n;} + void SetPublicExponent(const Integer& e) {e_ = e;} + + word32 FixedCiphertextLength() + { + return PK_Lengths(n_).FixedCiphertextLength(); + } + + RSA_PublicKey(const RSA_PublicKey& other) : n_(other.n_), e_(other.e_) {} + RSA_PublicKey& operator=(const RSA_PublicKey& that) + { + RSA_PublicKey tmp(that); + Swap(tmp); + return *this; + } + + void Swap(RSA_PublicKey& other) + { + n_.Swap(other.n_); + e_.Swap(other.e_); + } +}; + + +// RSA Private Key +class RSA_PrivateKey : public RSA_PublicKey { + Integer d_; + Integer p_; + Integer q_; + Integer dp_; + Integer dq_; + Integer u_; +public: + RSA_PrivateKey() {} + explicit RSA_PrivateKey(Source&); + + void Initialize(const Integer& n, const Integer& e, const Integer& d, + const Integer& p, const Integer& q, const Integer& dp, + const Integer& dq, const Integer& u) + {n_ = n; e_ = e; d_ = d; p_ = p; q_ = q; dp_ = dp; dq_ = dq; u_ = u;} + void Initialize(Source&); + + Integer CalculateInverse(RandomNumberGenerator&, const Integer&) const; + + const Integer& GetPrime1() const {return p_;} + const Integer& GetPrime2() const {return q_;} + const Integer& GetPrivateExponent() const {return d_;} + const Integer& GetModPrime1PrivateExponent() const {return dp_;} + const Integer& GetModPrime2PrivateExponent() const {return dq_;} + const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const + {return u_;} + + void SetPrime1(const Integer& p) {p_ = p;} + void SetPrime2(const Integer& q) {q_ = q;} + void SetPrivateExponent(const Integer& d) {d_ = d;} + void SetModPrime1PrivateExponent(const Integer& dp) {dp_ = dp;} + void SetModPrime2PrivateExponent(const Integer& dq) {dq_ = dq;} + void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer& u) {u_ = u;} +private: + RSA_PrivateKey(const RSA_PrivateKey&); // hide copy + RSA_PrivateKey& operator=(const RSA_PrivateKey&); // and assign +}; + + +// block type 2 padding +class RSA_BlockType2 { +public: + void Pad(const byte*, word32, byte*, word32, + RandomNumberGenerator&) const; + word32 UnPad(const byte*, word32, byte*) const; +}; + + +// block type 1 padding +class RSA_BlockType1 { +public: + void Pad(const byte*, word32, byte*, word32, + RandomNumberGenerator&) const; + word32 UnPad(const byte*, word32, byte*) const; +}; + + +// RSA Encryptor, can use any padding +template +class RSA_Encryptor { + const RSA_PublicKey& key_; + Pad padding_; +public: + explicit RSA_Encryptor(const RSA_PublicKey& k) : key_(k) {} + + void Encrypt(const byte*, word32, byte*, RandomNumberGenerator&); + bool SSL_Verify(const byte* msg, word32 sz, const byte* sig); +}; + + +// RSA Decryptor, can use any padding +template +class RSA_Decryptor { + const RSA_PrivateKey& key_; + Pad padding_; +public: + explicit RSA_Decryptor(const RSA_PrivateKey& k) : key_(k) {} + + word32 Decrypt(const byte*, word32, byte*, RandomNumberGenerator&); + void SSL_Sign(const byte*, word32, byte*, RandomNumberGenerator&); +}; + + +// Public Encrypt +template +void RSA_Encryptor::Encrypt(const byte* plain, word32 sz, byte* cipher, + RandomNumberGenerator& rng) +{ + PK_Lengths lengths(key_.GetModulus()); + assert(sz <= lengths.FixedMaxPlaintextLength()); + + ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); + padding_.Pad(plain, sz, paddedBlock.get_buffer(), + lengths.PaddedBlockBitLength(), rng); + + key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())). + Encode(cipher, lengths.FixedCiphertextLength()); +} + + +// Private Decrypt +template +word32 RSA_Decryptor::Decrypt(const byte* cipher, word32 sz, byte* plain, + RandomNumberGenerator& rng) +{ + PK_Lengths lengths(key_.GetModulus()); + assert(sz == lengths.FixedCiphertextLength()); + + if (sz != lengths.FixedCiphertextLength()) + return 0; + + ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); + Integer x = key_.CalculateInverse(rng, Integer(cipher, + lengths.FixedCiphertextLength()).Ref()); + if (x.ByteCount() > paddedBlock.size()) + x = Integer::Zero(); // don't return false, prevents timing attack + x.Encode(paddedBlock.get_buffer(), paddedBlock.size()); + return padding_.UnPad(paddedBlock.get_buffer(), + lengths.PaddedBlockBitLength(), plain); +} + + +// Private SSL type (block 1) Encrypt +template +void RSA_Decryptor::SSL_Sign(const byte* message, word32 sz, byte* sig, + RandomNumberGenerator& rng) +{ + RSA_PublicKey inverse; + inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent()); + RSA_Encryptor enc(inverse); // SSL Type + enc.Encrypt(message, sz, sig, rng); +} + + +word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain); + + +// Public SSL type (block 1) Decrypt +template +bool RSA_Encryptor::SSL_Verify(const byte* message, word32 sz, + const byte* sig) +{ + ByteBlock plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength()); + if (SSL_Decrypt(key_, sig, plain.get_buffer()) != sz) + return false; // not right justified or bad padding + + if ( (memcmp(plain.get_buffer(), message, sz)) == 0) + return true; + return false; +} + + +typedef RSA_Encryptor<> RSAES_Encryptor; +typedef RSA_Decryptor<> RSAES_Decryptor; + + +} // namespace + +#endif // TAO_CRYPT_RSA_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/runtime.hpp b/externals/mysql/extlib/yassl/taocrypt/include/runtime.hpp new file mode 100644 index 00000000000..6ece50d635f --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/runtime.hpp @@ -0,0 +1,72 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* runtime.hpp provides C++ runtime support functions when building a pure C + * version of yaSSL, user must define YASSL_PURE_C +*/ + + + +#ifndef yaSSL_NEW_HPP +#define yaSSL_NEW_HPP + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#ifdef __sun + +#include + +// Handler for pure virtual functions +namespace __Crun { + static void pure_error(void) + { + assert("Pure virtual method called." == "Aborted"); + } +} // namespace __Crun + +#endif // __sun + + +#if defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + +#if __GNUC__ > 2 + +extern "C" { +#if !defined(DO_TAOCRYPT_KERNEL_MODE) + #include +#else + #include "kernelc.hpp" +#endif + +/* Disallow inline __cxa_pure_virtual() */ +static int __cxa_pure_virtual() __attribute__((noinline, used)); +static int __cxa_pure_virtual() +{ + // oops, pure virtual called! + assert("Pure virtual method called." == "Aborted"); + return 0; +} + +} // extern "C" + +#endif // __GNUC__ > 2 +#endif // compiler check +#endif // yaSSL_NEW_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/sha.hpp b/externals/mysql/extlib/yassl/taocrypt/include/sha.hpp new file mode 100644 index 00000000000..c0b4368121b --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/sha.hpp @@ -0,0 +1,168 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* sha.hpp provides SHA-1 digests, see RFC 3174 +*/ + +#ifndef TAO_CRYPT_SHA_HPP +#define TAO_CRYPT_SHA_HPP + +#include "hash.hpp" + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_SHA_ASM +#endif + +namespace TaoCrypt { + + +// SHA-1 digest +class SHA : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 20, PAD_SIZE = 56, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + +#ifdef DO_SHA_ASM + void Update(const byte* data, word32 len); +#endif + void Init(); + + SHA(const SHA&); + SHA& operator= (const SHA&); + + void Swap(SHA&); +private: + void Transform(); + void AsmTransform(const byte* data, word32 times); +}; + + +inline void swap(SHA& a, SHA& b) +{ + a.Swap(b); +} + +// SHA-256 digest +class SHA256 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 32, PAD_SIZE = 56, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA256() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA256(const SHA256&); + SHA256& operator= (const SHA256&); + + void Swap(SHA256&); +private: + void Transform(); +}; + + +// SHA-224 digest +class SHA224 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 28, PAD_SIZE = 56, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA224() : HASHwithTransform(SHA256::DIGEST_SIZE /sizeof(word32),BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA224(const SHA224&); + SHA224& operator= (const SHA224&); + + void Swap(SHA224&); +private: + void Transform(); +}; + + +#ifdef WORD64_AVAILABLE + +// SHA-512 digest +class SHA512 : public HASH64withTransform { +public: + enum { BLOCK_SIZE = 128, DIGEST_SIZE = 64, PAD_SIZE = 112, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA512() : HASH64withTransform(DIGEST_SIZE / sizeof(word64), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA512(const SHA512&); + SHA512& operator= (const SHA512&); + + void Swap(SHA512&); +private: + void Transform(); +}; + + +// SHA-384 digest +class SHA384 : public HASH64withTransform { +public: + enum { BLOCK_SIZE = 128, DIGEST_SIZE = 48, PAD_SIZE = 112, + TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes + SHA384() : HASH64withTransform(SHA512::DIGEST_SIZE/ sizeof(word64), + BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + void Init(); + + SHA384(const SHA384&); + SHA384& operator= (const SHA384&); + + void Swap(SHA384&); +private: + void Transform(); +}; + +#endif // WORD64_AVAILABLE + + +} // namespace + + +#endif // TAO_CRYPT_SHA_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/twofish.hpp b/externals/mysql/extlib/yassl/taocrypt/include/twofish.hpp new file mode 100644 index 00000000000..bc6f89a9f39 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/twofish.hpp @@ -0,0 +1,94 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* twofish.hpp defines Twofish +*/ + + +#ifndef TAO_CRYPT_TWOFISH_HPP +#define TAO_CRYPT_TWOFISH_HPP + +#include "misc.hpp" +#include "modes.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_TWOFISH_ASM +#endif + +namespace TaoCrypt { + +enum { TWOFISH_BLOCK_SIZE = 16 }; + + +// Twofish encryption and decryption, see +class Twofish : public Mode_BASE { +public: + enum { BLOCK_SIZE = TWOFISH_BLOCK_SIZE }; + + Twofish(CipherDir DIR, Mode MODE) + : Mode_BASE(BLOCK_SIZE, DIR, MODE) {} + +#ifdef DO_TWOFISH_ASM + void Process(byte*, const byte*, word32); +#endif + void SetKey(const byte* key, word32 sz, CipherDir fake = ENCRYPTION); + void SetIV(const byte* iv) { memcpy(r_, iv, BLOCK_SIZE); } +private: + static const byte q_[2][256]; + static const word32 mds_[4][256]; + + word32 k_[40]; + word32 s_[4][256]; + + static word32 h0(word32 x, const word32 *key, unsigned int kLen); + static word32 h(word32 x, const word32 *key, unsigned int kLen); + + void ProcessAndXorBlock(const byte*, const byte*, byte*) const; + + void encrypt(const byte*, const byte*, byte*) const; + void decrypt(const byte*, const byte*, byte*) const; + + void AsmEncrypt(const byte* inBlock, byte* outBlock) const; + void AsmDecrypt(const byte* inBlock, byte* outBlock) const; + + Twofish(const Twofish&); // hide copy + Twofish& operator=(const Twofish&); // and assign +}; + + +typedef BlockCipher Twofish_ECB_Encryption; +typedef BlockCipher Twofish_ECB_Decryption; + +typedef BlockCipher Twofish_CBC_Encryption; +typedef BlockCipher Twofish_CBC_Decryption; + + + +} // naemspace + +#endif // TAO_CRYPT_TWOFISH_HPP + diff --git a/externals/mysql/extlib/yassl/taocrypt/include/type_traits.hpp b/externals/mysql/extlib/yassl/taocrypt/include/type_traits.hpp new file mode 100644 index 00000000000..7a664c816b0 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/type_traits.hpp @@ -0,0 +1,80 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* type_traits defines fundamental types + * see discussion in C++ Templates, $19.1 +*/ + + +#ifndef TAO_CRYPT_TYPE_TRAITS_HPP +#define TAO_CRYPT_TYPE_TRAITS_HPP + +#include "types.hpp" + +namespace TaoCrypt { + + +// primary template: in general T is not a fundamental type + +template +class IsFundamentalType { + public: + enum { Yes = 0, No = 1 }; +}; + + +// macro to specialize for fundamental types +#define MK_FUNDAMENTAL_TYPE(T) \ + template<> class IsFundamentalType { \ + public: \ + enum { Yes = 1, No = 0 }; \ + }; + + +MK_FUNDAMENTAL_TYPE(void) + +#ifndef bool_defined +MK_FUNDAMENTAL_TYPE(bool) +#endif + +MK_FUNDAMENTAL_TYPE( char) +MK_FUNDAMENTAL_TYPE(signed char) +MK_FUNDAMENTAL_TYPE(unsigned char) + +MK_FUNDAMENTAL_TYPE(signed short) +MK_FUNDAMENTAL_TYPE(unsigned short) +MK_FUNDAMENTAL_TYPE(signed int) +MK_FUNDAMENTAL_TYPE(unsigned int) +MK_FUNDAMENTAL_TYPE(signed long) +MK_FUNDAMENTAL_TYPE(unsigned long) + +MK_FUNDAMENTAL_TYPE(float) +MK_FUNDAMENTAL_TYPE( double) +MK_FUNDAMENTAL_TYPE(long double) + +#if defined(WORD64_AVAILABLE) && defined(WORD64_IS_DISTINCT_TYPE) + MK_FUNDAMENTAL_TYPE(word64) +#endif + + +#undef MK_FUNDAMENTAL_TYPE + + +} // namespace + +#endif // TAO_CRYPT_TYPE_TRAITS_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/include/types.hpp b/externals/mysql/extlib/yassl/taocrypt/include/types.hpp new file mode 100644 index 00000000000..3efdcdfbccb --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/include/types.hpp @@ -0,0 +1,99 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's misc.h from CryptoPP, basic crypt types */ + + +#ifndef TAO_CRYPT_TYPES_HPP +#define TAO_CRYPT_TYPES_HPP + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +namespace TaoCrypt { + + +#if defined(WORDS_BIGENDIAN) || (defined(__MWERKS__) && !defined(__INTEL__)) + #define BIG_ENDIAN_ORDER +#endif + +#ifndef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER +#endif + + +typedef unsigned char byte; +typedef unsigned short word16; +typedef unsigned int word32; + +#if defined(_MSC_VER) || defined(__BCPLUSPLUS__) + #define WORD64_AVAILABLE + #define WORD64_IS_DISTINCT_TYPE + typedef unsigned __int64 word64; + #define W64LIT(x) x##ui64 +#elif SIZEOF_LONG == 8 + #define WORD64_AVAILABLE + typedef unsigned long word64; + #define W64LIT(x) x##LL +#elif SIZEOF_LONG_LONG == 8 + #define WORD64_AVAILABLE + #define WORD64_IS_DISTINCT_TYPE + typedef unsigned long long word64; + #define W64LIT(x) x##LL +#endif + + +// compilers we've found 64-bit multiply insructions for +#if defined(__GNUC__) || defined(_MSC_VER) || defined(__DECCXX) + #if !(defined(__ICC) || defined(__INTEL_COMPILER)) + #define HAVE_64_MULTIPLY + #endif +#endif + + +#if defined(HAVE_64_MULTIPLY) && (defined(__alpha__) || defined(__ia64__) \ + || defined(_ARCH_PPC64) || defined(__mips64) || defined(__x86_64__) \ + || defined(_M_X64) || defined(_M_IA64)) +// These platforms have 64-bit CPU registers. Unfortunately most C++ compilers +// don't allow any way to access the 64-bit by 64-bit multiply instruction +// without using assembly, so in order to use word64 as word, the assembly +// instruction must be defined in Dword::Multiply(). + typedef word32 hword; + typedef word64 word; +#else + #define TAOCRYPT_NATIVE_DWORD_AVAILABLE + #ifdef WORD64_AVAILABLE + #define TAOCRYPT_SLOW_WORD64 + typedef word16 hword; + typedef word32 word; + typedef word64 dword; + #else + typedef byte hword; + typedef word16 word; + typedef word32 dword; + #endif +#endif + +const word32 WORD_SIZE = sizeof(word); +const word32 WORD_BITS = WORD_SIZE * 8; + + +} // namespace + +#endif // TAO_CRYPT_TYPES_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/algorithm.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/algorithm.hpp new file mode 100644 index 00000000000..d8bc29a0bb9 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/algorithm.hpp @@ -0,0 +1,108 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL algorithm implements max, min, for_each, swap, find_if, copy, + * copy_backward, fill + */ + +#ifndef mySTL_ALGORITHM_HPP +#define mySTL_ALGORITHM_HPP + + +namespace mySTL { + + +template +inline const T& max(const T& a, const T&b) +{ + return a < b ? b : a; +} + + +template +inline const T& min(const T& a, const T&b) +{ + return b < a ? b : a; +} + + +template +Func for_each(InIter first, InIter last, Func op) +{ + while (first != last) { + op(*first); + ++first; + } + return op; +} + + +template +inline void swap(T& a, T& b) +{ + T tmp = a; + a = b; + b = tmp; +} + + +template +InIter find_if(InIter first, InIter last, Pred pred) +{ + while (first != last && !pred(*first)) + ++first; + return first; +} + + +template +inline OutputIter copy(InputIter first, InputIter last, OutputIter place) +{ + while (first != last) { + *place = *first; + ++first; + ++place; + } + return place; +} + + +template +inline OutputIter +copy_backward(InputIter first, InputIter last, OutputIter place) +{ + while (first != last) + *--place = *--last; + return place; +} + + +template +void fill(InputIter first, InputIter last, const T& v) +{ + while (first != last) { + *first = v; + ++first; + } +} + + +} // namespace mySTL + +#endif // mySTL_ALGORITHM_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/helpers.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/helpers.hpp new file mode 100644 index 00000000000..c0495a71d84 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/helpers.hpp @@ -0,0 +1,153 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL helpers implements misc constructs for vector and list + * + */ + +#ifndef mySTL_HELPERS_HPP +#define mySTL_HELPERS_HPP + +#include +#ifdef _MSC_VER + #include +#endif + +/* + Workaround for the lack of operator new(size_t, void*) + in IBM VA C++ 6.0 + Also used as a workaround to avoid including +*/ + struct Dummy {}; + + inline void* operator new(size_t size, Dummy* d) + { + return static_cast(d); + } + + // for compilers that want matching delete + inline void operator delete(void* ptr, Dummy* d) + { + } + + typedef Dummy* yassl_pointer; + +namespace mySTL { + + +template +inline void construct(T* p, const T2& value) +{ + new (reinterpret_cast(p)) T(value); +} + + +template +inline void construct(T* p) +{ + new (reinterpret_cast(p)) T(); +} + + +template +inline void destroy(T* p) +{ + p->~T(); +} + + +template +void destroy(Iter first, Iter last) +{ + while (first != last) { + destroy(&*first); + ++first; + } +} + + +template +PlaceIter uninit_copy(Iter first, Iter last, PlaceIter place) +{ + while (first != last) { + construct(&*place, *first); + ++first; + ++place; + } + return place; +} + + +template +PlaceIter uninit_fill_n(PlaceIter place, Size n, const T& value) +{ + while (n) { + construct(&*place, value); + --n; + ++place; + } + return place; +} + + +template +T* GetArrayMemory(size_t items) +{ + unsigned char* ret; + + #ifdef YASSL_LIB + ret = NEW_YS unsigned char[sizeof(T) * items]; + #else + ret = NEW_TC unsigned char[sizeof(T) * items]; + #endif + + return reinterpret_cast(ret); +} + + +template +void FreeArrayMemory(T* ptr) +{ + unsigned char* p = reinterpret_cast(ptr); + + #ifdef YASSL_LIB + yaSSL::ysArrayDelete(p); + #else + TaoCrypt::tcArrayDelete(p); + #endif +} + + + +inline void* GetMemory(size_t bytes) +{ + return GetArrayMemory(bytes); +} + + +inline void FreeMemory(void* ptr) +{ + FreeArrayMemory(ptr); +} + + + +} // namespace mySTL + +#endif // mySTL_HELPERS_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/list.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/list.hpp new file mode 100644 index 00000000000..6a081cba5ad --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/list.hpp @@ -0,0 +1,367 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL list implements a simple list + * + */ + +#ifndef mySTL_LIST_HPP +#define mySTL_LIST_HPP + + +#include "helpers.hpp" + + +namespace mySTL { + + + +template +class list { + +#ifdef __SUNPRO_CC +/* + Sun Forte 7 C++ v. 5.4 needs class 'node' public to be visible to + the nested class 'iterator' (a non-standard behaviour). +*/ +public: +#endif + + struct node { + node(T t) : prev_(0), next_(0), value_(t) {} + + node* prev_; + node* next_; + T value_; + }; +public: + list() : head_(0), tail_(0), sz_(0) {} + ~list(); + + void push_front(T); + void pop_front(); + T front() const; + void push_back(T); + void pop_back(); + T back() const; + bool remove(T); + size_t size() const { return sz_; } + bool empty() const { return sz_ == 0; } + + class iterator { + node* current_; + public: + explicit iterator(node* p = 0) : current_(p) {} + + T& operator*() const + { + return current_->value_; + } + + T* operator->() const + { + return &(operator*()); + } + + iterator& operator++() + { + current_ = current_->next_; + return *this; + } + + iterator& operator--() + { + current_ = current_->prev_; + return *this; + } + + iterator operator++(int) + { + iterator tmp = *this; + current_ = current_->next_; + return tmp; + } + + iterator operator--(int) + { + iterator tmp = *this; + current_ = current_->prev_; + return tmp; + } + + bool operator==(const iterator& other) const + { + return current_ == other.current_; + } + + bool operator!=(const iterator& other) const + { + return current_ != other.current_; + } + + friend class list; + }; + + + class reverse_iterator { + node* current_; + public: + explicit reverse_iterator(node* p = 0) : current_(p) {} + + T& operator*() const + { + return current_->value_; + } + + T* operator->() const + { + return &(operator*()); + } + + reverse_iterator& operator++() + { + current_ = current_->prev_; + return *this; + } + + reverse_iterator& operator--() + { + current_ = current_->next_; + return *this; + } + + reverse_iterator operator++(int) + { + reverse_iterator tmp = *this; + current_ = current_->prev_; + return tmp; + } + + reverse_iterator operator--(int) + { + reverse_iterator tmp = *this; + current_ = current_->next_; + return tmp; + } + + bool operator==(const reverse_iterator& other) const + { + return current_ == other.current_; + } + + bool operator!=(const reverse_iterator& other) const + { + return current_ != other.current_; + } + + friend class list; + }; + + bool erase(iterator); + + iterator begin() const { return iterator(head_); } + reverse_iterator rbegin() const { return reverse_iterator(tail_); } + iterator end() const { return iterator(); } + reverse_iterator rend() const { return reverse_iterator(); } + + typedef iterator const_iterator; // for now + + class underflow {}; + class overflow {}; +private: + node* head_; + node* tail_; + size_t sz_; + + node* look_up(T); + + list(const list&); // hide copy + list& operator=(const list&); // and assign +}; + + +template +list::~list() +{ + node* start = head_; + node* next_; + + for (; start; start = next_) { + next_ = start->next_; + destroy(start); + FreeMemory(start); + } +} + + +template +void list::push_front(T t) +{ + void* mem = GetMemory(sizeof(node)); + node* add = new (reinterpret_cast(mem)) node(t); + + if (head_) { + add->next_ = head_; + head_->prev_ = add; + } + else + tail_ = add; + + head_ = add; + ++sz_; +} + + +template +void list::pop_front() +{ + node* front = head_; + + if (head_ == 0) + return; + else if (head_ == tail_) + head_ = tail_ = 0; + else { + head_ = head_->next_; + head_->prev_ = 0; + } + destroy(front); + FreeMemory(front); + --sz_; +} + + +template +T list::front() const +{ + if (head_ == 0) return T(); + return head_->value_; +} + + +template +void list::push_back(T t) +{ + void* mem = GetMemory(sizeof(node)); + node* add = new (reinterpret_cast(mem)) node(t); + + if (tail_) { + tail_->next_ = add; + add->prev_ = tail_; + } + else + head_ = add; + + tail_ = add; + ++sz_; +} + + +template +void list::pop_back() +{ + node* rear = tail_; + + if (tail_ == 0) + return; + else if (tail_ == head_) + tail_ = head_ = 0; + else { + tail_ = tail_->prev_; + tail_->next_ = 0; + } + destroy(rear); + FreeMemory(rear); + --sz_; +} + + +template +T list::back() const +{ + if (tail_ == 0) return T(); + return tail_->value_; +} + + +template +typename list::node* list::look_up(T t) +{ + node* list = head_; + + if (list == 0) return 0; + + for (; list; list = list->next_) + if (list->value_ == t) + return list; + + return 0; +} + + +template +bool list::remove(T t) +{ + node* del = look_up(t); + + if (del == 0) + return false; + else if (del == head_) + pop_front(); + else if (del == tail_) + pop_back(); + else { + del->prev_->next_ = del->next_; + del->next_->prev_ = del->prev_; + + destroy(del); + FreeMemory(del); + --sz_; + } + return true; +} + + +template +bool list::erase(iterator iter) +{ + node* del = iter.current_; + + if (del == 0) + return false; + else if (del == head_) + pop_front(); + else if (del == tail_) + pop_back(); + else { + del->prev_->next_ = del->next_; + del->next_->prev_ = del->prev_; + + destroy(del); + FreeMemory(del); + --sz_; + } + return true; +} + + + +} // namespace mySTL + +#endif // mySTL_LIST_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/memory.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/memory.hpp new file mode 100644 index 00000000000..b239aa6f907 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/memory.hpp @@ -0,0 +1,136 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL memory implements auto_ptr + * + */ + +#ifndef mySTL_MEMORY_HPP +#define mySTL_MEMORY_HPP + +#include "memory_array.hpp" // for auto_array + +#ifdef _MSC_VER + // disable operator-> warning for builtins + #pragma warning(disable:4284) +#endif + + +namespace mySTL { + + +template +struct auto_ptr_ref { + T* ptr_; + explicit auto_ptr_ref(T* p) : ptr_(p) {} +}; + + +template +class auto_ptr { + T* ptr_; + + void Destroy() + { + #ifdef YASSL_LIB + yaSSL::ysDelete(ptr_); + #else + TaoCrypt::tcDelete(ptr_); + #endif + } +public: + explicit auto_ptr(T* p = 0) : ptr_(p) {} + + ~auto_ptr() + { + Destroy(); + } + + + auto_ptr(auto_ptr& other) : ptr_(other.release()) {} + + auto_ptr& operator=(auto_ptr& that) + { + if (this != &that) { + Destroy(); + ptr_ = that.release(); + } + return *this; + } + + + T* operator->() const + { + return ptr_; + } + + T& operator*() const + { + return *ptr_; + } + + T* get() const + { + return ptr_; + } + + T* release() + { + T* tmp = ptr_; + ptr_ = 0; + return tmp; + } + + void reset(T* p = 0) + { + if (ptr_ != p) { + Destroy(); + ptr_ = p; + } + } + + // auto_ptr_ref conversions + auto_ptr(auto_ptr_ref ref) : ptr_(ref.ptr_) {} + + auto_ptr& operator=(auto_ptr_ref ref) + { + if (this->ptr_ != ref.ptr_) { + Destroy(); + ptr_ = ref.ptr_; + } + return *this; + } + + template + operator auto_ptr() + { + return auto_ptr(this->release()); + } + + template + operator auto_ptr_ref() + { + return auto_ptr_ref(this->release()); + } +}; + + +} // namespace mySTL + +#endif // mySTL_MEMORY_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/memory_array.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/memory_array.hpp new file mode 100644 index 00000000000..a044498cd98 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/memory_array.hpp @@ -0,0 +1,135 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL memory_arry implements auto_array + * + */ + +#ifndef mySTL_MEMORY_ARRAY_HPP +#define mySTL_MEMORY_ARRAY_HPP + + +#ifdef _MSC_VER + // disable operator-> warning for builtins + #pragma warning(disable:4284) +#endif + + +namespace mySTL { + + +template +struct auto_array_ref { + T* ptr_; + explicit auto_array_ref(T* p) : ptr_(p) {} +}; + + +template +class auto_array { + T* ptr_; + + void Destroy() + { + #ifdef YASSL_LIB + yaSSL::ysArrayDelete(ptr_); + #else + TaoCrypt::tcArrayDelete(ptr_); + #endif + } +public: + explicit auto_array(T* p = 0) : ptr_(p) {} + + ~auto_array() + { + Destroy(); + } + + + auto_array(auto_array& other) : ptr_(other.release()) {} + + auto_array& operator=(auto_array& that) + { + if (this != &that) { + Destroy(); + ptr_ = that.release(); + } + return *this; + } + + + T* operator->() const + { + return ptr_; + } + + T& operator*() const + { + return *ptr_; + } + + T* get() const + { + return ptr_; + } + + T* release() + { + T* tmp = ptr_; + ptr_ = 0; + return tmp; + } + + void reset(T* p = 0) + { + if (ptr_ != p) { + Destroy(); + ptr_ = p; + } + } + + // auto_array_ref conversions + auto_array(auto_array_ref ref) : ptr_(ref.ptr_) {} + + auto_array& operator=(auto_array_ref ref) + { + if (this->ptr_ != ref.ptr_) { + Destroy(); + ptr_ = ref.ptr_; + } + return *this; + } + + template + operator auto_array() + { + return auto_array(this->release()); + } + + template + operator auto_array_ref() + { + return auto_array_ref(this->release()); + } +}; + + +} // namespace mySTL + +#endif // mySTL_MEMORY_ARRAY_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/pair.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/pair.hpp new file mode 100644 index 00000000000..be2dbb14b88 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/pair.hpp @@ -0,0 +1,58 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL pair implements pair + * + */ + +#ifndef mySTL_PAIR_HPP +#define mySTL_PAIR_HPP + + + +namespace mySTL { + + +template +struct pair { + typedef T1 first_type; + typedef T2 second_type; + + first_type first; + second_type second; + + pair() {} + pair(const T1& t1, const T2& t2) : first(t1), second(t2) {} + + template + pair(const pair& p) : first(p.first), second(p.second) {} +}; + + +template +inline pair make_pair(const T1& a, const T2& b) +{ + return pair(a, b); +} + + + +} // namespace mySTL + +#endif // mySTL_PAIR_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/stdexcept.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/stdexcept.hpp new file mode 100644 index 00000000000..9696995248d --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/stdexcept.hpp @@ -0,0 +1,77 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL memory implements exception, runtime_error + * + */ + +#ifndef mySTL_STDEXCEPT_HPP +#define mySTL_STDEXCEPT_HPP + + +#include // strncpy +#include // assert +#include // size_t + + +namespace mySTL { + + +class exception { +public: + exception() {} + virtual ~exception() {} // to shut up compiler warnings + + virtual const char* what() const { return ""; } + + // for compiler generated call, never used + static void operator delete(void*) { assert(0); } +private: + // don't allow dynamic creation of exceptions + static void* operator new(size_t); +}; + + +class named_exception : public exception { +public: + enum { NAME_SIZE = 80 }; + + explicit named_exception(const char* str) + { + strncpy(name_, str, NAME_SIZE); + name_[NAME_SIZE - 1] = 0; + } + + virtual const char* what() const { return name_; } +private: + char name_[NAME_SIZE]; +}; + + +class runtime_error : public named_exception { +public: + explicit runtime_error(const char* str) : named_exception(str) {} +}; + + + + +} // namespace mySTL + +#endif // mySTL_STDEXCEPT_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/mySTL/vector.hpp b/externals/mysql/extlib/yassl/taocrypt/mySTL/vector.hpp new file mode 100644 index 00000000000..8ba8813ca70 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/mySTL/vector.hpp @@ -0,0 +1,154 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* mySTL vector implements simple vector, w/ swap + * + */ + +#ifndef mySTL_VECTOR_HPP +#define mySTL_VECTOR_HPP + +#include "helpers.hpp" // construct, destory, fill, etc. +#include "algorithm.hpp" // swap +#include // assert + + +namespace mySTL { + + +template +struct vector_base { + T* start_; + T* finish_; + T* end_of_storage_; + + vector_base() : start_(0), finish_(0), end_of_storage_(0) {} + vector_base(size_t n) + { + start_ = GetArrayMemory(n); + finish_ = start_; + end_of_storage_ = start_ + n; + } + + ~vector_base() + { + FreeArrayMemory(start_); + } + + void Swap(vector_base& that) + { + swap(start_, that.start_); + swap(finish_, that.finish_); + swap(end_of_storage_, that.end_of_storage_); + } +}; + + + +template +class vector { +public: + typedef T* iterator; + typedef const T* const_iterator; + + vector() {} + explicit vector(size_t n) : vec_(n) + { + vec_.finish_ = uninit_fill_n(vec_.start_, n, T()); + } + + ~vector() { destroy(vec_.start_, vec_.finish_); } + + vector(const vector& other) : vec_(other.size()) + { + vec_.finish_ = uninit_copy(other.vec_.start_, other.vec_.finish_, + vec_.start_); + } + + size_t capacity() const { return vec_.end_of_storage_ - vec_.start_; } + + size_t size() const { return vec_.finish_ - vec_.start_; } + + T& operator[](size_t idx) { return *(vec_.start_ + idx); } + const T& operator[](size_t idx) const { return *(vec_.start_ + idx); } + + const T* begin() const { return vec_.start_; } + const T* end() const { return vec_.finish_; } + + void push_back(const T& v) + { + if (vec_.finish_ != vec_.end_of_storage_) { + construct(vec_.finish_, v); + ++vec_.finish_; + } + else { + vector tmp(size() * 2 + 1, *this); + construct(tmp.vec_.finish_, v); + ++tmp.vec_.finish_; + Swap(tmp); + } + } + + void resize(size_t n, const T& v) + { + if (n == size()) return; + + if (n < size()) { + T* first = vec_.start_ + n; + destroy(first, vec_.finish_); + vec_.finish_ -= vec_.finish_ - first; + } + else { + vector tmp(n, *this); + tmp.vec_.finish_ = uninit_fill_n(tmp.vec_.finish_, n - size(), v); + Swap(tmp); + } + } + + void reserve(size_t n) + { + if (capacity() < n) { + vector tmp(n, *this); + Swap(tmp); + } + } + + void Swap(vector& that) + { + vec_.Swap(that.vec_); + } +private: + vector_base vec_; + + vector& operator=(const vector&); // hide assign + + // for growing, n must be bigger than other size + vector(size_t n, const vector& other) : vec_(n) + { + assert(n > other.size()); + vec_.finish_ = uninit_copy(other.vec_.start_, other.vec_.finish_, + vec_.start_); + } +}; + + + +} // namespace mySTL + +#endif // mySTL_VECTOR_HPP diff --git a/externals/mysql/extlib/yassl/taocrypt/src/aes.cpp b/externals/mysql/extlib/yassl/taocrypt/src/aes.cpp new file mode 100644 index 00000000000..b2b42d3dcf0 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/aes.cpp @@ -0,0 +1,1814 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* C++ based on Wei Dai's aes.cpp from CryptoPP */ +/* x86 asm original */ + +#if defined(TAOCRYPT_KERNEL_MODE) + #define DO_TAOCRYPT_KERNEL_MODE +#endif // only some modules now support this + +#include "runtime.hpp" +#include "aes.hpp" + + +namespace TaoCrypt { + + +#if defined(DO_AES_ASM) + +// ia32 optimized version +void AES::Process(byte* out, const byte* in, word32 sz) +{ + if (!isMMX) { + Mode_BASE::Process(out, in, sz); + return; + } + + word32 blocks = sz / BLOCK_SIZE; + + if (mode_ == ECB) + while (blocks--) { + if (dir_ == ENCRYPTION) + AsmEncrypt(in, out, (void*)Te0); + else + AsmDecrypt(in, out, (void*)Td0); + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } + else if (mode_ == CBC) + if (dir_ == ENCRYPTION) + while (blocks--) { + r_[0] ^= *(word32*)in; + r_[1] ^= *(word32*)(in + 4); + r_[2] ^= *(word32*)(in + 8); + r_[3] ^= *(word32*)(in + 12); + + AsmEncrypt((byte*)r_, (byte*)r_, (void*)Te0); + + memcpy(out, r_, BLOCK_SIZE); + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } + else + while (blocks--) { + AsmDecrypt(in, out, (void*)Td0); + + *(word32*)out ^= r_[0]; + *(word32*)(out + 4) ^= r_[1]; + *(word32*)(out + 8) ^= r_[2]; + *(word32*)(out + 12) ^= r_[3]; + + memcpy(r_, in, BLOCK_SIZE); + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } +} + +#endif // DO_AES_ASM + + +void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/) +{ + assert( (keylen == 16) || (keylen == 24) || (keylen == 32) ); + + rounds_ = keylen/4 + 6; + + word32 temp, *rk = key_; + unsigned int i=0; + + GetUserKey(BigEndianOrder, rk, keylen/4, userKey, keylen); + + switch(keylen) + { + case 16: + while (true) + { + temp = rk[3]; + rk[4] = rk[0] ^ + (Te4[GETBYTE(temp, 2)] & 0xff000000) ^ + (Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^ + (Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^ + (Te4[GETBYTE(temp, 3)] & 0x000000ff) ^ + rcon_[i]; + rk[5] = rk[1] ^ rk[4]; + rk[6] = rk[2] ^ rk[5]; + rk[7] = rk[3] ^ rk[6]; + if (++i == 10) + break; + rk += 4; + } + break; + + case 24: + while (true) // for (;;) here triggers a bug in VC60 SP4 w/ Pro Pack + { + temp = rk[ 5]; + rk[ 6] = rk[ 0] ^ + (Te4[GETBYTE(temp, 2)] & 0xff000000) ^ + (Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^ + (Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^ + (Te4[GETBYTE(temp, 3)] & 0x000000ff) ^ + rcon_[i]; + rk[ 7] = rk[ 1] ^ rk[ 6]; + rk[ 8] = rk[ 2] ^ rk[ 7]; + rk[ 9] = rk[ 3] ^ rk[ 8]; + if (++i == 8) + break; + rk[10] = rk[ 4] ^ rk[ 9]; + rk[11] = rk[ 5] ^ rk[10]; + rk += 6; + } + break; + + case 32: + while (true) + { + temp = rk[ 7]; + rk[ 8] = rk[ 0] ^ + (Te4[GETBYTE(temp, 2)] & 0xff000000) ^ + (Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^ + (Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^ + (Te4[GETBYTE(temp, 3)] & 0x000000ff) ^ + rcon_[i]; + rk[ 9] = rk[ 1] ^ rk[ 8]; + rk[10] = rk[ 2] ^ rk[ 9]; + rk[11] = rk[ 3] ^ rk[10]; + if (++i == 7) + break; + temp = rk[11]; + rk[12] = rk[ 4] ^ + (Te4[GETBYTE(temp, 3)] & 0xff000000) ^ + (Te4[GETBYTE(temp, 2)] & 0x00ff0000) ^ + (Te4[GETBYTE(temp, 1)] & 0x0000ff00) ^ + (Te4[GETBYTE(temp, 0)] & 0x000000ff); + rk[13] = rk[ 5] ^ rk[12]; + rk[14] = rk[ 6] ^ rk[13]; + rk[15] = rk[ 7] ^ rk[14]; + + rk += 8; + } + break; + } + + if (dir_ == DECRYPTION) + { + unsigned int i, j; + rk = key_; + + /* invert the order of the round keys: */ + for (i = 0, j = 4*rounds_; i < j; i += 4, j -= 4) { + temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp; + temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp; + temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp; + temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp; + } + // apply the inverse MixColumn transform to all round keys but the + // first and the last: + for (i = 1; i < rounds_; i++) { + rk += 4; + rk[0] = + Td0[Te4[GETBYTE(rk[0], 3)] & 0xff] ^ + Td1[Te4[GETBYTE(rk[0], 2)] & 0xff] ^ + Td2[Te4[GETBYTE(rk[0], 1)] & 0xff] ^ + Td3[Te4[GETBYTE(rk[0], 0)] & 0xff]; + rk[1] = + Td0[Te4[GETBYTE(rk[1], 3)] & 0xff] ^ + Td1[Te4[GETBYTE(rk[1], 2)] & 0xff] ^ + Td2[Te4[GETBYTE(rk[1], 1)] & 0xff] ^ + Td3[Te4[GETBYTE(rk[1], 0)] & 0xff]; + rk[2] = + Td0[Te4[GETBYTE(rk[2], 3)] & 0xff] ^ + Td1[Te4[GETBYTE(rk[2], 2)] & 0xff] ^ + Td2[Te4[GETBYTE(rk[2], 1)] & 0xff] ^ + Td3[Te4[GETBYTE(rk[2], 0)] & 0xff]; + rk[3] = + Td0[Te4[GETBYTE(rk[3], 3)] & 0xff] ^ + Td1[Te4[GETBYTE(rk[3], 2)] & 0xff] ^ + Td2[Te4[GETBYTE(rk[3], 1)] & 0xff] ^ + Td3[Te4[GETBYTE(rk[3], 0)] & 0xff]; + } + } +} + + +void AES::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) const +{ + if (dir_ == ENCRYPTION) + encrypt(in, xOr, out); + else + decrypt(in, xOr, out); +} + + +typedef BlockGetAndPut gpBlock; + + +void AES::encrypt(const byte* inBlock, const byte* xorBlock, + byte* outBlock) const +{ + word32 s0, s1, s2, s3; + word32 t0, t1, t2, t3; + + const word32 *rk = key_; + /* + * map byte array block to cipher state + * and add initial round key: + */ + gpBlock::Get(inBlock)(s0)(s1)(s2)(s3); + s0 ^= rk[0]; + s1 ^= rk[1]; + s2 ^= rk[2]; + s3 ^= rk[3]; + + /* + * Nr - 1 full rounds: + */ + + unsigned int r = rounds_ >> 1; + for (;;) { + t0 = + Te0[GETBYTE(s0, 3)] ^ + Te1[GETBYTE(s1, 2)] ^ + Te2[GETBYTE(s2, 1)] ^ + Te3[GETBYTE(s3, 0)] ^ + rk[4]; + t1 = + Te0[GETBYTE(s1, 3)] ^ + Te1[GETBYTE(s2, 2)] ^ + Te2[GETBYTE(s3, 1)] ^ + Te3[GETBYTE(s0, 0)] ^ + rk[5]; + t2 = + Te0[GETBYTE(s2, 3)] ^ + Te1[GETBYTE(s3, 2)] ^ + Te2[GETBYTE(s0, 1)] ^ + Te3[GETBYTE(s1, 0)] ^ + rk[6]; + t3 = + Te0[GETBYTE(s3, 3)] ^ + Te1[GETBYTE(s0, 2)] ^ + Te2[GETBYTE(s1, 1)] ^ + Te3[GETBYTE(s2, 0)] ^ + rk[7]; + + rk += 8; + if (--r == 0) { + break; + } + + s0 = + Te0[GETBYTE(t0, 3)] ^ + Te1[GETBYTE(t1, 2)] ^ + Te2[GETBYTE(t2, 1)] ^ + Te3[GETBYTE(t3, 0)] ^ + rk[0]; + s1 = + Te0[GETBYTE(t1, 3)] ^ + Te1[GETBYTE(t2, 2)] ^ + Te2[GETBYTE(t3, 1)] ^ + Te3[GETBYTE(t0, 0)] ^ + rk[1]; + s2 = + Te0[GETBYTE(t2, 3)] ^ + Te1[GETBYTE(t3, 2)] ^ + Te2[GETBYTE(t0, 1)] ^ + Te3[GETBYTE(t1, 0)] ^ + rk[2]; + s3 = + Te0[GETBYTE(t3, 3)] ^ + Te1[GETBYTE(t0, 2)] ^ + Te2[GETBYTE(t1, 1)] ^ + Te3[GETBYTE(t2, 0)] ^ + rk[3]; + } + + /* + * apply last round and + * map cipher state to byte array block: + */ + + s0 = + (Te4[GETBYTE(t0, 3)] & 0xff000000) ^ + (Te4[GETBYTE(t1, 2)] & 0x00ff0000) ^ + (Te4[GETBYTE(t2, 1)] & 0x0000ff00) ^ + (Te4[GETBYTE(t3, 0)] & 0x000000ff) ^ + rk[0]; + s1 = + (Te4[GETBYTE(t1, 3)] & 0xff000000) ^ + (Te4[GETBYTE(t2, 2)] & 0x00ff0000) ^ + (Te4[GETBYTE(t3, 1)] & 0x0000ff00) ^ + (Te4[GETBYTE(t0, 0)] & 0x000000ff) ^ + rk[1]; + s2 = + (Te4[GETBYTE(t2, 3)] & 0xff000000) ^ + (Te4[GETBYTE(t3, 2)] & 0x00ff0000) ^ + (Te4[GETBYTE(t0, 1)] & 0x0000ff00) ^ + (Te4[GETBYTE(t1, 0)] & 0x000000ff) ^ + rk[2]; + s3 = + (Te4[GETBYTE(t3, 3)] & 0xff000000) ^ + (Te4[GETBYTE(t0, 2)] & 0x00ff0000) ^ + (Te4[GETBYTE(t1, 1)] & 0x0000ff00) ^ + (Te4[GETBYTE(t2, 0)] & 0x000000ff) ^ + rk[3]; + + + gpBlock::Put(xorBlock, outBlock)(s0)(s1)(s2)(s3); +} + + +void AES::decrypt(const byte* inBlock, const byte* xorBlock, + byte* outBlock) const +{ + word32 s0, s1, s2, s3; + word32 t0, t1, t2, t3; + const word32* rk = key_; + + /* + * map byte array block to cipher state + * and add initial round key: + */ + gpBlock::Get(inBlock)(s0)(s1)(s2)(s3); + s0 ^= rk[0]; + s1 ^= rk[1]; + s2 ^= rk[2]; + s3 ^= rk[3]; + + /* + * Nr - 1 full rounds: + */ + + unsigned int r = rounds_ >> 1; + for (;;) { + t0 = + Td0[GETBYTE(s0, 3)] ^ + Td1[GETBYTE(s3, 2)] ^ + Td2[GETBYTE(s2, 1)] ^ + Td3[GETBYTE(s1, 0)] ^ + rk[4]; + t1 = + Td0[GETBYTE(s1, 3)] ^ + Td1[GETBYTE(s0, 2)] ^ + Td2[GETBYTE(s3, 1)] ^ + Td3[GETBYTE(s2, 0)] ^ + rk[5]; + t2 = + Td0[GETBYTE(s2, 3)] ^ + Td1[GETBYTE(s1, 2)] ^ + Td2[GETBYTE(s0, 1)] ^ + Td3[GETBYTE(s3, 0)] ^ + rk[6]; + t3 = + Td0[GETBYTE(s3, 3)] ^ + Td1[GETBYTE(s2, 2)] ^ + Td2[GETBYTE(s1, 1)] ^ + Td3[GETBYTE(s0, 0)] ^ + rk[7]; + + rk += 8; + if (--r == 0) { + break; + } + + s0 = + Td0[GETBYTE(t0, 3)] ^ + Td1[GETBYTE(t3, 2)] ^ + Td2[GETBYTE(t2, 1)] ^ + Td3[GETBYTE(t1, 0)] ^ + rk[0]; + s1 = + Td0[GETBYTE(t1, 3)] ^ + Td1[GETBYTE(t0, 2)] ^ + Td2[GETBYTE(t3, 1)] ^ + Td3[GETBYTE(t2, 0)] ^ + rk[1]; + s2 = + Td0[GETBYTE(t2, 3)] ^ + Td1[GETBYTE(t1, 2)] ^ + Td2[GETBYTE(t0, 1)] ^ + Td3[GETBYTE(t3, 0)] ^ + rk[2]; + s3 = + Td0[GETBYTE(t3, 3)] ^ + Td1[GETBYTE(t2, 2)] ^ + Td2[GETBYTE(t1, 1)] ^ + Td3[GETBYTE(t0, 0)] ^ + rk[3]; + } + /* + * apply last round and + * map cipher state to byte array block: + */ + s0 = + (Td4[GETBYTE(t0, 3)] & 0xff000000) ^ + (Td4[GETBYTE(t3, 2)] & 0x00ff0000) ^ + (Td4[GETBYTE(t2, 1)] & 0x0000ff00) ^ + (Td4[GETBYTE(t1, 0)] & 0x000000ff) ^ + rk[0]; + s1 = + (Td4[GETBYTE(t1, 3)] & 0xff000000) ^ + (Td4[GETBYTE(t0, 2)] & 0x00ff0000) ^ + (Td4[GETBYTE(t3, 1)] & 0x0000ff00) ^ + (Td4[GETBYTE(t2, 0)] & 0x000000ff) ^ + rk[1]; + s2 = + (Td4[GETBYTE(t2, 3)] & 0xff000000) ^ + (Td4[GETBYTE(t1, 2)] & 0x00ff0000) ^ + (Td4[GETBYTE(t0, 1)] & 0x0000ff00) ^ + (Td4[GETBYTE(t3, 0)] & 0x000000ff) ^ + rk[2]; + s3 = + (Td4[GETBYTE(t3, 3)] & 0xff000000) ^ + (Td4[GETBYTE(t2, 2)] & 0x00ff0000) ^ + (Td4[GETBYTE(t1, 1)] & 0x0000ff00) ^ + (Td4[GETBYTE(t0, 0)] & 0x000000ff) ^ + rk[3]; + + gpBlock::Put(xorBlock, outBlock)(s0)(s1)(s2)(s3); +} + + +#if defined(DO_AES_ASM) + #ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( sub esp, 4 ) \ + AS2( movd mm7, ebp ) \ + AS2( mov [ebp - 4], esi ) \ + AS2( mov ecx, DWORD PTR [ebp + 8] ) \ + AS2( mov esi, DWORD PTR [ebp + 12] ) \ + AS2( mov ebp, DWORD PTR [ebp + 20] ) + + #define EPILOG() \ + AS2( mov esi, [ebp - 4] ) \ + AS2( mov esp, ebp ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); + #else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( sub esp, 4 ) \ + AS2( movd mm7, ebp ) \ + AS2( mov [ebp - 4], esi ) \ + AS2( mov esi, DWORD PTR [ebp + 8] ) \ + AS2( mov ebp, DWORD PTR [ebp + 16] ) + + // ebp is restored at end + #define EPILOG() \ + AS2( mov esi, [ebp - 4] ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 12 ) + + + #endif + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const +{ + + PROLOG() + + #ifdef OLD_GCC_OFFSET + AS2( mov edx, DWORD PTR [ecx + 60] ) // rounds + AS2( lea edi, [ecx + 64] ) // rk + #else + AS2( mov edx, DWORD PTR [ecx + 56] ) // rounds + AS2( lea edi, [ecx + 60] ) // rk + #endif + + AS1( dec edx ) + AS2( movd mm6, edi ) // save rk + AS2( movd mm5, edx ) // save rounds + + AS2( mov eax, DWORD PTR [esi] ) + AS2( mov ebx, DWORD PTR [esi + 4] ) + AS2( mov ecx, DWORD PTR [esi + 8] ) + AS2( mov edx, DWORD PTR [esi + 12] ) + + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( xor eax, DWORD PTR [edi] ) // s0 + AS2( xor ebx, DWORD PTR [edi + 4] ) // s1 + AS2( xor ecx, DWORD PTR [edi + 8] ) // s2 + AS2( xor edx, DWORD PTR [edi + 12] ) // s3 + + AS1(loop1: ) + /* Put0 (mm0) = + Te0[get0,rs 24] ^ + Te1[get1,rs 16] ^ + Te2[get2,rs 8] ^ + Te3[get3,rs 0] + */ + + AS2( mov esi, eax ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, ebx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor esi, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx edi, ch ) + AS2( xor esi, DWORD PTR [ebp + 2048 + edi*4] ) + + AS2( movzx edi, dl ) + AS2( xor esi, DWORD PTR [ebp + 3072 + edi*4] ) + + AS2( movd mm0, esi ) + + /* Put1 (mm1) = + Te0[get1,rs 24] ^ + Te1[get2,rs 16] ^ + Te2[get3,rs 8] ^ + Te3[get0,rs 0] + */ + + AS2( mov esi, ebx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, ecx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor esi, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx edi, dh ) + AS2( xor esi, DWORD PTR [ebp + 2048 + edi*4] ) + + AS2( movzx edi, al ) + AS2( xor esi, DWORD PTR [ebp + 3072 + edi*4] ) + + AS2( movd mm1, esi ) + + + /* Put2 (mm2) = + Te0[get2,rs 24] ^ + Te1[get3,rs 16] ^ + Te2[get0,rs 8] ^ + Te3[get1,rs 0] + */ + + AS2( mov esi, ecx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, edx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor esi, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx edi, ah ) + AS2( xor esi, DWORD PTR [ebp + 2048 + edi*4] ) + + AS2( movzx edi, bl ) + AS2( xor esi, DWORD PTR [ebp + 3072 + edi*4] ) + + AS2( movd mm2, esi ) + + /* Put3 (edx) = + Te0[get3,rs 24] ^ + Te1[get0,rs 16] ^ + Te2[get1,rs 8] ^ + Te3[get2,rs 0] + */ + + AS2( mov esi, edx ) + AS2( shr esi, 24 ) + AS2( mov edx, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, eax ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor edx, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx esi, bh ) + AS2( xor edx, DWORD PTR [ebp + 2048 + esi*4] ) + + AS2( movzx edi, cl ) + AS2( xor edx, DWORD PTR [ebp + 3072 + edi*4] ) + + // xOr + + AS2( movd esi, mm6 ) // rk + + AS2( movd eax, mm0 ) + AS2( add esi, 16 ) + AS2( movd ebx, mm1 ) + AS2( movd mm6, esi ) // save back + AS2( movd ecx, mm2 ) + + AS2( xor eax, DWORD PTR [esi] ) + AS2( xor ebx, DWORD PTR [esi + 4] ) + AS2( movd edi, mm5 ) + AS2( xor ecx, DWORD PTR [esi + 8] ) + AS2( xor edx, DWORD PTR [esi + 12] ) + + AS1( dec edi ) + AS2( movd mm5, edi ) + + AS1( jnz loop1 ) + + // last round + /* + Put0 (mm0) = + (Te4[get0, rs24] & 0xff000000) ^ h = 4278190080 + (Te4[get1, rs16] & 0x00ff0000) ^ h = 16711680 + (Te4[get2, rs 8] & 0x0000ff00) ^ h = 65280 + (Te4[get3, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, eax ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and esi, 4278190080 ) + + AS2( mov edi, ebx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 16711680 ) + AS2( xor esi, edi ) + + AS2( movzx edi, ch ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 65280 ) + AS2( xor esi, edi ) + + AS2( movzx edi, dl ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 255 ) + AS2( xor esi, edi ) + + AS2( movd mm0, esi ) + + /* + Put1 (mm1) = + (Te4[get1, rs24] & 0xff000000) ^ h = 4278190080 + (Te4[get2, rs16] & 0x00ff0000) ^ h = 16711680 + (Te4[get3, rs 8] & 0x0000ff00) ^ h = 65280 + (Te4[get0, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, ebx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and esi, 4278190080 ) + + AS2( mov edi, ecx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 16711680 ) + AS2( xor esi, edi ) + + AS2( movzx edi, dh ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 65280 ) + AS2( xor esi, edi ) + + AS2( movzx edi, al ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 255 ) + AS2( xor esi, edi ) + + AS2( movd mm1, esi ) + + /* + Put2 (mm2) = + (Te4[get2, rs24] & 0xff000000) ^ h = 4278190080 + (Te4[get3, rs16] & 0x00ff0000) ^ h = 16711680 + (Te4[get0, rs 8] & 0x0000ff00) ^ h = 65280 + (Te4[get1, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, ecx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and esi, 4278190080 ) + + AS2( mov edi, edx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 16711680 ) + AS2( xor esi, edi ) + + AS2( movzx edi, ah ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 65280 ) + AS2( xor esi, edi ) + + AS2( movzx edi, bl ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 255 ) + AS2( xor esi, edi ) + + AS2( movd mm2, esi ) + + /* + Put3 (edx) = + (Te4[get3, rs24] & 0xff000000) ^ h = 4278190080 + (Te4[get0, rs16] & 0x00ff0000) ^ h = 16711680 + (Te4[get1, rs 8] & 0x0000ff00) ^ h = 65280 + (Te4[get2, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, edx ) + AS2( shr esi, 24 ) + AS2( mov edx, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and edx, 4278190080 ) + + AS2( mov edi, eax ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and esi, 16711680 ) + AS2( xor edx, esi ) + + AS2( movzx esi, bh ) + AS2( mov edi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and edi, 65280 ) + AS2( xor edx, edi ) + + AS2( movzx edi, cl ) + AS2( mov esi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and esi, 255 ) + AS2( xor edx, esi ) + + + // xOr + AS2( movd eax, mm0 ) + AS2( movd esi, mm6 ) // rk + AS2( movd ebx, mm1 ) + AS2( add esi, 16 ) + AS2( movd ecx, mm2 ) + + AS2( xor eax, DWORD PTR [esi] ) + AS2( xor ebx, DWORD PTR [esi + 4] ) + AS2( xor ecx, DWORD PTR [esi + 8] ) + AS2( xor edx, DWORD PTR [esi + 12] ) + + // end + AS2( movd ebp, mm7 ) + + // swap + AS1( bswap eax ) + AS1( bswap ebx ) + + // store + #ifdef __GNUC__ + AS2( mov esi, DWORD PTR [ebp + 16] ) // outBlock + #else + AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock + #endif + + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( mov DWORD PTR [esi], eax ) + AS2( mov DWORD PTR [esi + 4], ebx ) + AS2( mov DWORD PTR [esi + 8], ecx ) + AS2( mov DWORD PTR [esi + 12], edx ) + + + EPILOG() +} + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void AES::AsmDecrypt(const byte* inBlock, byte* outBlock, void* boxes) const +{ + + PROLOG() + + #ifdef OLD_GCC_OFFSET + AS2( mov edx, DWORD PTR [ecx + 60] ) // rounds + AS2( lea edi, [ecx + 64] ) // rk + #else + AS2( mov edx, DWORD PTR [ecx + 56] ) // rounds + AS2( lea edi, [ecx + 60] ) // rk + #endif + + AS1( dec edx ) + AS2( movd mm6, edi ) // save rk + AS2( movd mm5, edx ) // save rounds + + AS2( mov eax, DWORD PTR [esi] ) + AS2( mov ebx, DWORD PTR [esi + 4] ) + AS2( mov ecx, DWORD PTR [esi + 8] ) + AS2( mov edx, DWORD PTR [esi + 12] ) + + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( xor eax, DWORD PTR [edi] ) // s0 + AS2( xor ebx, DWORD PTR [edi + 4] ) // s1 + AS2( xor ecx, DWORD PTR [edi + 8] ) // s2 + AS2( xor edx, DWORD PTR [edi + 12] ) // s3 + + + AS1(loop2: ) + /* Put0 (mm0) = + Td0[GETBYTE(get0, rs24)] ^ + Td1[GETBYTE(get3, rs16)] ^ + Td2[GETBYTE(get2, rs 8)] ^ + Td3[GETBYTE(tet1, )] + */ + AS2( mov esi, eax ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, edx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor esi, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx edi, ch ) + AS2( xor esi, DWORD PTR [ebp + 2048 + edi*4] ) + + AS2( movzx edi, bl ) + AS2( xor esi, DWORD PTR [ebp + 3072 + edi*4] ) + + AS2( movd mm0, esi ) + + /* Put1 (mm1) = + Td0[GETBYTE(get1, rs24)] ^ + Td1[GETBYTE(get0, rs16)] ^ + Td2[GETBYTE(get3, rs 8)] ^ + Td3[GETBYTE(tet2, )] + */ + AS2( mov esi, ebx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, eax ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor esi, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx edi, dh ) + AS2( xor esi, DWORD PTR [ebp + 2048 + edi*4] ) + + AS2( movzx edi, cl ) + AS2( xor esi, DWORD PTR [ebp + 3072 + edi*4] ) + + AS2( movd mm1, esi ) + + /* Put2 (mm2) = + Td0[GETBYTE(get2, rs24)] ^ + Td1[GETBYTE(get1, rs16)] ^ + Td2[GETBYTE(get0, rs 8)] ^ + Td3[GETBYTE(tet3, )] + */ + AS2( mov esi, ecx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, ebx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor esi, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx edi, ah ) + AS2( xor esi, DWORD PTR [ebp + 2048 + edi*4] ) + + AS2( movzx edi, dl ) + AS2( xor esi, DWORD PTR [ebp + 3072 + edi*4] ) + + AS2( movd mm2, esi ) + + /* Put3 (edx) = + Td0[GETBYTE(get3, rs24)] ^ + Td1[GETBYTE(get2, rs16)] ^ + Td2[GETBYTE(get1, rs 8)] ^ + Td3[GETBYTE(tet0, )] + */ + AS2( mov esi, edx ) + AS2( shr esi, 24 ) + AS2( mov edx, DWORD PTR [ebp + esi*4] ) + + AS2( mov edi, ecx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( xor edx, DWORD PTR [ebp + 1024 + edi*4] ) + + AS2( movzx esi, bh ) + AS2( xor edx, DWORD PTR [ebp + 2048 + esi*4] ) + + AS2( movzx edi, al ) + AS2( xor edx, DWORD PTR [ebp + 3072 + edi*4] ) + + + // xOr + + AS2( movd esi, mm6 ) // rk + AS2( add esi, 16 ) + AS2( movd mm6, esi ) // save back + + AS2( movd eax, mm0 ) + AS2( movd ebx, mm1 ) + AS2( movd ecx, mm2 ) + + AS2( xor eax, DWORD PTR [esi] ) + AS2( xor ebx, DWORD PTR [esi + 4] ) + AS2( xor ecx, DWORD PTR [esi + 8] ) + AS2( xor edx, DWORD PTR [esi + 12] ) + + AS2( movd edi, mm5 ) + AS1( dec edi ) + AS2( movd mm5, edi ) + + AS1( jnz loop2 ) + + // last round + /* + Put0 (mm0) = + (Td4[get0, rs24] & 0xff000000) ^ h = 4278190080 + (Td4[get3, rs16] & 0x00ff0000) ^ h = 16711680 + (Td4[get2, rs 8] & 0x0000ff00) ^ h = 65280 + (Td4[get1, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, eax ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and esi, 4278190080 ) + + AS2( mov edi, edx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 16711680 ) + AS2( xor esi, edi ) + + AS2( movzx edi, ch ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 65280 ) + AS2( xor esi, edi ) + + AS2( movzx edi, bl ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 255 ) + AS2( xor esi, edi ) + + AS2( movd mm0, esi ) + + /* + Put1 (mm1) = + (Td4[get1, rs24] & 0xff000000) ^ h = 4278190080 + (Td4[get0, rs16] & 0x00ff0000) ^ h = 16711680 + (Td4[get3, rs 8] & 0x0000ff00) ^ h = 65280 + (Td4[get2, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, ebx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and esi, 4278190080 ) + + AS2( mov edi, eax ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 16711680 ) + AS2( xor esi, edi ) + + AS2( movzx edi, dh ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 65280 ) + AS2( xor esi, edi ) + + AS2( movzx edi, cl ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 255 ) + AS2( xor esi, edi ) + + AS2( movd mm1, esi ) + + /* + Put2 (mm2) = + (Td4[get2, rs24] & 0xff000000) ^ h = 4278190080 + (Td4[get1, rs16] & 0x00ff0000) ^ h = 16711680 + (Td4[get0, rs 8] & 0x0000ff00) ^ h = 65280 + (Td4[get3, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, ecx ) + AS2( shr esi, 24 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and esi, 4278190080 ) + + AS2( mov edi, ebx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 16711680 ) + AS2( xor esi, edi ) + + AS2( movzx edi, ah ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 65280 ) + AS2( xor esi, edi ) + + AS2( movzx edi, dl ) + AS2( mov edi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and edi, 255 ) + AS2( xor esi, edi ) + + AS2( movd mm2, esi ) + + /* + Put3 (edx) = + (Td4[get3, rs24] & 0xff000000) ^ h = 4278190080 + (Td4[get2, rs16] & 0x00ff0000) ^ h = 16711680 + (Td4[get1, rs 8] & 0x0000ff00) ^ h = 65280 + (Td4[get0, rs 0] & 0x000000ff) h = 255 + */ + AS2( mov esi, edx ) + AS2( shr esi, 24 ) + AS2( mov edx, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and edx, 4278190080 ) + + AS2( mov edi, ecx ) + AS2( shr edi, 16 ) + AS2( and edi, 255 ) + AS2( mov esi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and esi, 16711680 ) + AS2( xor edx, esi ) + + AS2( movzx esi, bh ) + AS2( mov edi, DWORD PTR [ebp + 4096 + esi*4] ) + AS2( and edi, 65280 ) + AS2( xor edx, edi ) + + AS2( movzx edi, al ) + AS2( mov esi, DWORD PTR [ebp + 4096 + edi*4] ) + AS2( and esi, 255 ) + AS2( xor edx, esi ) + + + // xOr + AS2( movd esi, mm6 ) // rk + AS2( add esi, 16 ) + + AS2( movd eax, mm0 ) + AS2( movd ebx, mm1 ) + AS2( movd ecx, mm2 ) + + AS2( xor eax, DWORD PTR [esi] ) + AS2( xor ebx, DWORD PTR [esi + 4] ) + AS2( xor ecx, DWORD PTR [esi + 8] ) + AS2( xor edx, DWORD PTR [esi + 12] ) + + // end + AS2( movd ebp, mm7 ) + + // swap + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + // store + #ifdef __GNUC__ + AS2( mov esi, DWORD PTR [ebp + 16] ) // outBlock + #else + AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock + #endif + AS2( mov DWORD PTR [esi], eax ) + AS2( mov DWORD PTR [esi + 4], ebx ) + AS2( mov DWORD PTR [esi + 8], ecx ) + AS2( mov DWORD PTR [esi + 12], edx ) + + + EPILOG() +} + + + +#endif // defined(DO_AES_ASM) + + + +const word32 AES::Te[5][256] = { +{ + 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, + 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, + 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, + 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, + 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, + 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, + 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, + 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, + 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, + 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, + 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, + 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, + 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, + 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, + 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, + 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, + 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, + 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, + 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, + 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, + 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, + 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, + 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, + 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, + 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, + 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, + 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, + 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, + 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, + 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, + 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, + 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, + 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, + 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, + 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, + 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, + 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, + 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, + 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, + 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, + 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, + 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, + 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, + 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, + 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, + 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, + 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, + 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, + 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, + 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, + 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, + 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, + 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, + 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, + 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, + 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, + 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, + 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, + 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, + 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, + 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, + 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, + 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, + 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, +}, +{ + 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, + 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, + 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, + 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, + 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, + 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, + 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, + 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, + 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, + 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, + 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, + 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, + 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, + 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, + 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, + 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, + 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, + 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, + 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, + 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, + 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, + 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, + 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, + 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, + 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, + 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, + 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, + 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, + 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, + 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, + 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, + 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, + 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, + 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, + 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, + 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, + 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, + 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, + 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, + 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, + 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, + 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, + 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, + 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, + 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, + 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, + 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, + 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, + 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, + 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, + 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, + 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, + 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, + 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, + 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, + 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, + 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, + 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, + 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, + 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, + 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, + 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, + 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, + 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, +}, +{ + 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, + 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, + 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, + 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, + 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, + 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, + 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, + 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, + 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, + 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, + 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, + 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, + 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, + 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, + 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, + 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, + 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, + 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, + 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, + 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, + 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, + 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, + 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, + 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, + 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, + 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, + 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, + 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, + 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, + 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, + 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, + 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, + 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, + 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, + 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, + 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, + 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, + 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, + 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, + 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, + 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, + 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, + 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, + 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, + 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, + 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, + 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, + 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, + 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, + 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, + 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, + 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, + 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, + 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, + 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, + 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, + 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, + 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, + 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, + 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, + 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, + 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, + 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, + 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, +}, +{ + 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, + 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, + 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, + 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, + 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, + 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, + 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, + 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, + 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, + 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, + 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, + 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, + 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, + 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, + 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, + 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, + 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, + 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, + 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, + 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, + 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, + 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, + 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, + 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, + 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, + 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, + 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, + 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, + 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, + 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, + 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, + 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, + 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, + 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, + 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, + 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, + 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, + 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, + 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, + 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, + 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, + 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, + 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, + 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, + 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, + 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, + 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, + 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, + 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, + 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, + 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, + 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, + 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, + 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, + 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, + 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, + 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, + 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, + 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, + 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, + 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, + 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, + 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, + 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, +}, +{ + 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, + 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, + 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, + 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, + 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, + 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, + 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, + 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, + 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, + 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, + 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, + 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, + 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, + 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, + 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, + 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, + 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, + 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, + 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, + 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, + 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, + 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, + 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, + 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, + 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, + 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, + 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, + 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, + 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, + 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, + 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, + 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, + 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, + 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, + 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, + 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, + 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, + 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, + 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, + 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, + 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, + 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, + 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, + 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, + 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, + 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, + 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, + 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, + 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, + 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, + 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, + 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, + 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, + 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, + 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, + 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, + 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, + 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, + 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, + 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, + 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, + 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, + 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, + 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, +} +}; + + +const word32 AES::Td[5][256] = { +{ + 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, + 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, + 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, + 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, + 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, + 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, + 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, + 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, + 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, + 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, + 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, + 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, + 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, + 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, + 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, + 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, + 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, + 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, + 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, + 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, + 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, + 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, + 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, + 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, + 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, + 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, + 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, + 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, + 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, + 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, + 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, + 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, + 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, + 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, + 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, + 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, + 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, + 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, + 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, + 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, + 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, + 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, + 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, + 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, + 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, + 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, + 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, + 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, + 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, + 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, + 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, + 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, + 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, + 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, + 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, + 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, + 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, + 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, + 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, + 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, + 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, + 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, + 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, + 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, +}, +{ + 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, + 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, + 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, + 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, + 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, + 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, + 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, + 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, + 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, + 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, + 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, + 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, + 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, + 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, + 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, + 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, + 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, + 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, + 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, + 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, + 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, + 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, + 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, + 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, + 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, + 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, + 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, + 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, + 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, + 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, + 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, + 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, + 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, + 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, + 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, + 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, + 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, + 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, + 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, + 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, + 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, + 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, + 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, + 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, + 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, + 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, + 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, + 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, + 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, + 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, + 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, + 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, + 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, + 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, + 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, + 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, + 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, + 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, + 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, + 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, + 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, + 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, + 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, + 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, +}, +{ + 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, + 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, + 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, + 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, + 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, + 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, + 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, + 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, + 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, + 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, + 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, + 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, + 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, + 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, + 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, + 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, + 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, + 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, + 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, + 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, + + 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, + 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, + 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, + 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, + 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, + 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, + 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, + 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, + 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, + 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, + 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, + 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, + 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, + 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, + 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, + 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, + 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, + 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, + 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, + 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, + 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, + 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, + 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, + 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, + 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, + 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, + 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, + 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, + 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, + 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, + 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, + 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, + 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, + 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, + 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, + 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, + 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, + 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, + 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, + 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, + 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, + 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, + 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, + 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, +}, +{ + 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, + 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, + 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, + 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, + 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, + 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, + 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, + 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, + 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, + 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, + 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, + 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, + 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, + 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, + 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, + 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, + 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, + 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, + 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, + 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, + 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, + 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, + 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, + 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, + 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, + 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, + 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, + 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, + 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, + 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, + 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, + 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, + 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, + 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, + 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, + 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, + 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, + 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, + 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, + 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, + 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, + 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, + 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, + 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, + 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, + 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, + 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, + 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, + 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, + 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, + 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, + 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, + 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, + 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, + 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, + 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, + 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, + 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, + 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, + 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, + 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, + 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, + 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, + 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, +}, +{ + 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, + 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, + 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, + 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, + 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, + 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, + 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, + 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, + 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, + 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, + 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, + 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, + 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, + 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, + 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, + 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, + 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, + 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, + 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, + 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, + 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, + 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, + 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, + 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, + 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, + 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, + 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, + 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, + 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, + 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, + 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, + 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, + 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, + 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, + 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, + 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, + 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, + 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, + 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, + 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, + 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, + 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, + 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, + 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, + 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, + 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, + 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, + 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, + 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, + 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, + 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, + 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, + 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, + 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, + 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, + 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, + 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, + 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, + 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, + 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, + 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, + 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, + 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, + 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, +} +}; + + +const word32* AES::Te0 = AES::Te[0]; +const word32* AES::Te1 = AES::Te[1]; +const word32* AES::Te2 = AES::Te[2]; +const word32* AES::Te3 = AES::Te[3]; +const word32* AES::Te4 = AES::Te[4]; + +const word32* AES::Td0 = AES::Td[0]; +const word32* AES::Td1 = AES::Td[1]; +const word32* AES::Td2 = AES::Td[2]; +const word32* AES::Td3 = AES::Td[3]; +const word32* AES::Td4 = AES::Td[4]; + + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/aestables.cpp b/externals/mysql/extlib/yassl/taocrypt/src/aestables.cpp new file mode 100644 index 00000000000..e9d6b7a80cb --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/aestables.cpp @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's aestables.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "aes.hpp" + + +namespace TaoCrypt { + + +const word32 AES::rcon_[] = { + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x1B000000, 0x36000000, + /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ +}; + + + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/algebra.cpp b/externals/mysql/extlib/yassl/taocrypt/src/algebra.cpp new file mode 100644 index 00000000000..cb597c41552 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/algebra.cpp @@ -0,0 +1,339 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's algebra.cpp from CryptoPP */ +#undef NDEBUG +#define DEBUG // GCC 4.0 bug if NDEBUG and Optimize > 1 + +#include "runtime.hpp" +#include "algebra.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "vector.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + +namespace TaoCrypt { + + +const Integer& AbstractGroup::Double(const Element &a) const +{ + return Add(a, a); +} + +const Integer& AbstractGroup::Subtract(const Element &a, const Element &b) const +{ + // make copy of a in case Inverse() overwrites it + Element a1(a); + return Add(a1, Inverse(b)); +} + +Integer& AbstractGroup::Accumulate(Element &a, const Element &b) const +{ + return a = Add(a, b); +} + +Integer& AbstractGroup::Reduce(Element &a, const Element &b) const +{ + return a = Subtract(a, b); +} + +const Integer& AbstractRing::Square(const Element &a) const +{ + return Multiply(a, a); +} + + +const Integer& AbstractRing::Divide(const Element &a, const Element &b) const +{ + // make copy of a in case MultiplicativeInverse() overwrites it + Element a1(a); + return Multiply(a1, MultiplicativeInverse(b)); +} + + +const Integer& AbstractEuclideanDomain::Mod(const Element &a, + const Element &b) const +{ + Element q; + DivisionAlgorithm(result, q, a, b); + return result; +} + +const Integer& AbstractEuclideanDomain::Gcd(const Element &a, + const Element &b) const +{ + STL::vector g(3); + g[0]= b; + g[1]= a; + unsigned int i0=0, i1=1, i2=2; + + while (!Equal(g[i1], this->Identity())) + { + g[i2] = Mod(g[i0], g[i1]); + unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; + } + + return result = g[i0]; +} + + +Integer AbstractGroup::ScalarMultiply(const Element &base, + const Integer &exponent) const +{ + Element result; + SimultaneousMultiply(&result, base, &exponent, 1); + return result; +} + + +Integer AbstractGroup::CascadeScalarMultiply(const Element &x, + const Integer &e1, const Element &y, const Integer &e2) const +{ + const unsigned expLen = max(e1.BitCount(), e2.BitCount()); + if (expLen==0) + return Identity(); + + const unsigned w = (expLen <= 46 ? 1 : (expLen <= 260 ? 2 : 3)); + const unsigned tableSize = 1< powerTable(tableSize << w); + + powerTable[1] = x; + powerTable[tableSize] = y; + if (w==1) + powerTable[3] = Add(x,y); + else + { + powerTable[2] = Double(x); + powerTable[2*tableSize] = Double(y); + + unsigned i, j; + + for (i=3; i=0; i--) + { + power1 = 2*power1 + e1.GetBit(i); + power2 = 2*power2 + e2.GetBit(i); + + if (i==0 || 2*power1 >= tableSize || 2*power2 >= tableSize) + { + unsigned squaresBefore = prevPosition-i; + unsigned squaresAfter = 0; + prevPosition = i; + while ((power1 || power2) && power1%2 == 0 && power2%2==0) + { + power1 /= 2; + power2 /= 2; + squaresBefore--; + squaresAfter++; + } + if (firstTime) + { + result = powerTable[(power2<= expLen) + { + finished = true; + return; + } + skipCount++; + } + + exp >>= skipCount; + windowBegin += skipCount; + expWindow = exp % (1 << windowSize); + + if (fastNegate && exp.GetBit(windowSize)) + { + negateNext = true; + expWindow = (1 << windowSize) - expWindow; + exp += windowModulus; + } + else + negateNext = false; + } + + Integer exp, windowModulus; + unsigned int windowSize, windowBegin, expWindow; + bool fastNegate, negateNext, firstTime, finished; +}; + + +void AbstractGroup::SimultaneousMultiply(Integer *results, const Integer &base, + const Integer *expBegin, unsigned int expCount) const +{ + STL::vector > buckets(expCount); + STL::vector exponents; + exponents.reserve(expCount); + unsigned int i; + + for (i=0; iNotNegative()); + exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0)); + exponents[i].FindNextWindow(); + buckets[i].resize(1<<(exponents[i].windowSize-1), Identity()); + } + + unsigned int expBitPosition = 0; + Element g = base; + bool notDone = true; + + while (notDone) + { + notDone = false; + for (i=0; i 1) + { + for (int j = buckets[i].size()-2; j >= 1; j--) + { + Accumulate(buckets[i][j], buckets[i][j+1]); + Accumulate(r, buckets[i][j]); + } + Accumulate(buckets[i][0], buckets[i][1]); + r = Add(Double(r), buckets[i][0]); + } + } +} + +Integer AbstractRing::Exponentiate(const Element &base, + const Integer &exponent) const +{ + Element result; + SimultaneousExponentiate(&result, base, &exponent, 1); + return result; +} + + +Integer AbstractRing::CascadeExponentiate(const Element &x, + const Integer &e1, const Element &y, const Integer &e2) const +{ + return MultiplicativeGroup().AbstractGroup::CascadeScalarMultiply( + x, e1, y, e2); +} + + +void AbstractRing::SimultaneousExponentiate(Integer *results, + const Integer &base, + const Integer *exponents, unsigned int expCount) const +{ + MultiplicativeGroup().AbstractGroup::SimultaneousMultiply(results, base, + exponents, expCount); +} + + +} // namespace + + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION +namespace mySTL { +template TaoCrypt::WindowSlider* uninit_copy(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); +template void destroy(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); +template TaoCrypt::WindowSlider* GetArrayMemory(size_t); +template void FreeArrayMemory(TaoCrypt::WindowSlider*); +} +#endif + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/arc4.cpp b/externals/mysql/extlib/yassl/taocrypt/src/arc4.cpp new file mode 100644 index 00000000000..0944cc31837 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/arc4.cpp @@ -0,0 +1,235 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's arc4.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "arc4.hpp" + + +#if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM) + #define DO_ARC4_ASM +#endif + + +namespace TaoCrypt { + +void ARC4::SetKey(const byte* key, word32 length) +{ + x_ = 1; + y_ = 0; + + word32 i; + + for (i = 0; i < STATE_SIZE; i++) + state_[i] = i; + + word32 keyIndex = 0, stateIndex = 0; + + for (i = 0; i < STATE_SIZE; i++) { + word32 a = state_[i]; + stateIndex += key[keyIndex] + a; + stateIndex &= 0xFF; + state_[i] = state_[stateIndex]; + state_[stateIndex] = a; + + if (++keyIndex >= length) + keyIndex = 0; + } +} + + +// local +namespace { + +inline unsigned int MakeByte(word32& x, word32& y, byte* s) +{ + word32 a = s[x]; + y = (y+a) & 0xff; + + word32 b = s[y]; + s[x] = b; + s[y] = a; + x = (x+1) & 0xff; + + return s[(a+b) & 0xff]; +} + +} // namespace + + + +void ARC4::Process(byte* out, const byte* in, word32 length) +{ + if (length == 0) return; + +#ifdef DO_ARC4_ASM + if (isMMX) { + AsmProcess(out, in, length); + return; + } +#endif + + byte *const s = state_; + word32 x = x_; + word32 y = y_; + + if (in == out) + while (length--) + *out++ ^= MakeByte(x, y, s); + else + while(length--) + *out++ = *in++ ^ MakeByte(x, y, s); + x_ = x; + y_ = y; +} + + + +#ifdef DO_ARC4_ASM + +#ifdef _MSC_VER + __declspec(naked) +#else + __attribute__ ((noinline)) +#endif +void ARC4::AsmProcess(byte* out, const byte* in, word32 length) +{ +#ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov ecx, DWORD PTR [ebp + 8] ) \ + AS2( mov edi, DWORD PTR [ebp + 12] ) \ + AS2( mov esi, DWORD PTR [ebp + 16] ) \ + AS2( mov ebp, DWORD PTR [ebp + 20] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( mov esp, ebp ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); +#else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edi, DWORD PTR [ebp + 8] ) \ + AS2( mov esi, DWORD PTR [ebp + 12] ) \ + AS2( mov ebp, DWORD PTR [ebp + 16] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 12 ) + +#endif + + PROLOG() + + AS2( sub esp, 4 ) // make room + + AS2( cmp ebp, 0 ) + AS1( jz nothing ) + + AS2( mov [esp], ebp ) // length + + AS2( movzx edx, BYTE PTR [ecx + 1] ) // y + AS2( lea ebp, [ecx + 2] ) // state_ + AS2( movzx ecx, BYTE PTR [ecx] ) // x + + // setup loop + // a = s[x]; + AS2( movzx eax, BYTE PTR [ebp + ecx] ) + + +AS1( begin: ) + + // y = (y+a) & 0xff; + AS2( add edx, eax ) + AS2( and edx, 255 ) + + // b = s[y]; + AS2( movzx ebx, BYTE PTR [ebp + edx] ) + + // s[x] = b; + AS2( mov [ebp + ecx], bl ) + + // s[y] = a; + AS2( mov [ebp + edx], al ) + + // x = (x+1) & 0xff; + AS1( inc ecx ) + AS2( and ecx, 255 ) + + //return s[(a+b) & 0xff]; + AS2( add eax, ebx ) + AS2( and eax, 255 ) + + AS2( movzx ebx, BYTE PTR [ebp + eax] ) + + // a = s[x]; for next round + AS2( movzx eax, BYTE PTR [ebp + ecx] ) + + // xOr w/ inByte + AS2( xor bl, BYTE PTR [esi] ) + AS1( inc esi ) + + // write to outByte + AS2( mov [edi], bl ) + AS1( inc edi ) + + AS1( dec DWORD PTR [esp] ) + AS1( jnz begin ) + + + // write back to x_ and y_ + AS2( mov [ebp - 2], cl ) + AS2( mov [ebp - 1], dl ) + + +AS1( nothing: ) + + + EPILOG() +} + +#endif // DO_ARC4_ASM + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/asn.cpp b/externals/mysql/extlib/yassl/taocrypt/src/asn.cpp new file mode 100644 index 00000000000..a06ab658c7b --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/asn.cpp @@ -0,0 +1,1185 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* asn.cpp implements ASN1 BER, PublicKey, and x509v3 decoding +*/ + +#include "runtime.hpp" +#include "asn.hpp" +#include "file.hpp" +#include "integer.hpp" +#include "rsa.hpp" +#include "dsa.hpp" +#include "dh.hpp" +#include "md5.hpp" +#include "md2.hpp" +#include "sha.hpp" +#include "coding.hpp" +#include // gmtime(); +#include "memory.hpp" // some auto_ptr don't have reset, also need auto_array + + +namespace TaoCrypt { + +namespace { // locals + + +// to the minute +bool operator>(tm& a, tm& b) +{ + if (a.tm_year > b.tm_year) + return true; + + if (a.tm_year == b.tm_year && a.tm_mon > b.tm_mon) + return true; + + if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && a.tm_mday >b.tm_mday) + return true; + + if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && + a.tm_mday == b.tm_mday && a.tm_hour > b.tm_hour) + return true; + + if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && + a.tm_mday == b.tm_mday && a.tm_hour == b.tm_hour && + a.tm_min > b.tm_min) + return true; + + return false; +} + + +bool operator<(tm& a, tm&b) +{ + return !(a>b); +} + + +// like atoi but only use first byte +word32 btoi(byte b) +{ + return b - 0x30; +} + + +// two byte date/time, add to value +void GetTime(int& value, const byte* date, int& i) +{ + value += btoi(date[i++]) * 10; + value += btoi(date[i++]); +} + + +// Make sure before and after dates are valid +bool ValidateDate(const byte* date, byte format, CertDecoder::DateType dt) +{ + tm certTime; + memset(&certTime, 0, sizeof(certTime)); + int i = 0; + + if (format == UTC_TIME) { + if (btoi(date[0]) >= 5) + certTime.tm_year = 1900; + else + certTime.tm_year = 2000; + } + else { // format == GENERALIZED_TIME + certTime.tm_year += btoi(date[i++]) * 1000; + certTime.tm_year += btoi(date[i++]) * 100; + } + + GetTime(certTime.tm_year, date, i); certTime.tm_year -= 1900; // adjust + GetTime(certTime.tm_mon, date, i); certTime.tm_mon -= 1; // adjust + GetTime(certTime.tm_mday, date, i); + GetTime(certTime.tm_hour, date, i); + GetTime(certTime.tm_min, date, i); + GetTime(certTime.tm_sec, date, i); + + assert(date[i] == 'Z'); // only Zulu supported for this profile + + time_t ltime = time(0); + tm* localTime = gmtime(<ime); + + if (dt == CertDecoder::BEFORE) { + if (*localTime < certTime) + return false; + } + else + if (*localTime > certTime) + return false; + + return true; +} + + +class BadCertificate {}; + +} // local namespace + + + +// used by Integer as well +word32 GetLength(Source& source) +{ + word32 length = 0; + + byte b = source.next(); + if (b >= LONG_LENGTH) { + word32 bytes = b & 0x7F; + + while (bytes--) { + b = source.next(); + length = (length << 8) | b; + } + } + else + length = b; + + return length; +} + + +word32 SetLength(word32 length, byte* output) +{ + word32 i = 0; + + if (length < LONG_LENGTH) + output[i++] = length; + else { + output[i++] = BytePrecision(length) | 0x80; + + for (int j = BytePrecision(length); j; --j) { + output[i] = length >> (j - 1) * 8; + i++; + } + } + return i; +} + + +PublicKey::PublicKey(const byte* k, word32 s) : key_(0), sz_(0) +{ + if (s) { + SetSize(s); + SetKey(k); + } +} + + +void PublicKey::SetSize(word32 s) +{ + sz_ = s; + key_ = NEW_TC byte[sz_]; +} + + +void PublicKey::SetKey(const byte* k) +{ + memcpy(key_, k, sz_); +} + + +void PublicKey::AddToEnd(const byte* data, word32 len) +{ + mySTL::auto_array tmp(NEW_TC byte[sz_ + len]); + + memcpy(tmp.get(), key_, sz_); + memcpy(tmp.get() + sz_, data, len); + + byte* del = 0; + STL::swap(del, key_); + tcArrayDelete(del); + + key_ = tmp.release(); + sz_ += len; +} + + +Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h) + : key_(k, kSz) +{ + int sz = strlen(n); + memcpy(name_, n, sz); + name_[sz] = 0; + + memcpy(hash_, h, SHA::DIGEST_SIZE); +} + +Signer::~Signer() +{ +} + + +Error BER_Decoder::GetError() +{ + return source_.GetError(); +} + + +Integer& BER_Decoder::GetInteger(Integer& integer) +{ + if (!source_.GetError().What()) + integer.Decode(source_); + return integer; +} + + +// Read a Sequence, return length +word32 BER_Decoder::GetSequence() +{ + if (source_.GetError().What()) return 0; + + byte b = source_.next(); + if (b != (SEQUENCE | CONSTRUCTED)) { + source_.SetError(SEQUENCE_E); + return 0; + } + + return GetLength(source_); +} + + +// Read a Sequence, return length +word32 BER_Decoder::GetSet() +{ + if (source_.GetError().What()) return 0; + + byte b = source_.next(); + if (b != (SET | CONSTRUCTED)) { + source_.SetError(SET_E); + return 0; + } + + return GetLength(source_); +} + + +// Read Version, return it +word32 BER_Decoder::GetVersion() +{ + if (source_.GetError().What()) return 0; + + byte b = source_.next(); + if (b != INTEGER) { + source_.SetError(INTEGER_E); + return 0; + } + + b = source_.next(); + if (b != 0x01) { + source_.SetError(VERSION_E); + return 0; + } + + return source_.next(); +} + + +// Read ExplicitVersion, return it or 0 if not there (not an error) +word32 BER_Decoder::GetExplicitVersion() +{ + if (source_.GetError().What()) return 0; + + byte b = source_.next(); + + if (b == (CONTEXT_SPECIFIC | CONSTRUCTED)) { // not an error if not here + source_.next(); + return GetVersion(); + } + else + source_.prev(); // put back + + return 0; +} + + +// Decode a BER encoded RSA Private Key +void RSA_Private_Decoder::Decode(RSA_PrivateKey& key) +{ + ReadHeader(); + if (source_.GetError().What()) return; + // public + key.SetModulus(GetInteger(Integer().Ref())); + key.SetPublicExponent(GetInteger(Integer().Ref())); + + // private + key.SetPrivateExponent(GetInteger(Integer().Ref())); + key.SetPrime1(GetInteger(Integer().Ref())); + key.SetPrime2(GetInteger(Integer().Ref())); + key.SetModPrime1PrivateExponent(GetInteger(Integer().Ref())); + key.SetModPrime2PrivateExponent(GetInteger(Integer().Ref())); + key.SetMultiplicativeInverseOfPrime2ModPrime1(GetInteger(Integer().Ref())); +} + + +void RSA_Private_Decoder::ReadHeader() +{ + GetSequence(); + GetVersion(); +} + + +// Decode a BER encoded DSA Private Key +void DSA_Private_Decoder::Decode(DSA_PrivateKey& key) +{ + ReadHeader(); + if (source_.GetError().What()) return; + // group parameters + key.SetModulus(GetInteger(Integer().Ref())); + key.SetSubGroupOrder(GetInteger(Integer().Ref())); + key.SetSubGroupGenerator(GetInteger(Integer().Ref())); + + // key + key.SetPublicPart(GetInteger(Integer().Ref())); + key.SetPrivatePart(GetInteger(Integer().Ref())); +} + + +void DSA_Private_Decoder::ReadHeader() +{ + GetSequence(); + GetVersion(); +} + + +// Decode a BER encoded RSA Public Key +void RSA_Public_Decoder::Decode(RSA_PublicKey& key) +{ + ReadHeader(); + if (source_.GetError().What()) return; + + // public key + key.SetModulus(GetInteger(Integer().Ref())); + key.SetPublicExponent(GetInteger(Integer().Ref())); +} + + +void RSA_Public_Decoder::ReadHeader() +{ + GetSequence(); +} + + +// Decode a BER encoded DSA Public Key +void DSA_Public_Decoder::Decode(DSA_PublicKey& key) +{ + ReadHeader(); + if (source_.GetError().What()) return; + + // group parameters + key.SetModulus(GetInteger(Integer().Ref())); + key.SetSubGroupOrder(GetInteger(Integer().Ref())); + key.SetSubGroupGenerator(GetInteger(Integer().Ref())); + + // key + key.SetPublicPart(GetInteger(Integer().Ref())); +} + + +void DSA_Public_Decoder::ReadHeader() +{ + GetSequence(); +} + + +void DH_Decoder::ReadHeader() +{ + GetSequence(); +} + + +// Decode a BER encoded Diffie-Hellman Key +void DH_Decoder::Decode(DH& key) +{ + ReadHeader(); + if (source_.GetError().What()) return; + + // group parms + key.SetP(GetInteger(Integer().Ref())); + key.SetG(GetInteger(Integer().Ref())); +} + + +CertDecoder::CertDecoder(Source& s, bool decode, SignerList* signers, + bool noVerify, CertType ct) + : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), + signature_(0), verify_(!noVerify) +{ + issuer_[0] = 0; + subject_[0] = 0; + + if (decode) + Decode(signers, ct); + +} + + +CertDecoder::~CertDecoder() +{ + tcArrayDelete(signature_); +} + + +// process certificate header, set signature offset +void CertDecoder::ReadHeader() +{ + if (source_.GetError().What()) return; + + GetSequence(); // total + certBegin_ = source_.get_index(); + + sigIndex_ = GetSequence(); // this cert + sigIndex_ += source_.get_index(); + + GetExplicitVersion(); // version + GetInteger(Integer().Ref()); // serial number +} + + +// Decode a x509v3 Certificate +void CertDecoder::Decode(SignerList* signers, CertType ct) +{ + if (source_.GetError().What()) return; + DecodeToKey(); + if (source_.GetError().What()) return; + + if (source_.get_index() != sigIndex_) + source_.set_index(sigIndex_); + + word32 confirmOID = GetAlgoId(); + GetSignature(); + if (source_.GetError().What()) return; + + if ( confirmOID != signatureOID_ ) { + source_.SetError(SIG_OID_E); + return; + } + + if (ct != CA && verify_ && !ValidateSignature(signers)) + source_.SetError(SIG_OTHER_E); +} + + +void CertDecoder::DecodeToKey() +{ + ReadHeader(); + signatureOID_ = GetAlgoId(); + GetName(ISSUER); + GetValidity(); + GetName(SUBJECT); + GetKey(); +} + + +// Read public key +void CertDecoder::GetKey() +{ + if (source_.GetError().What()) return; + + GetSequence(); + keyOID_ = GetAlgoId(); + + if (keyOID_ == RSAk) { + byte b = source_.next(); + if (b != BIT_STRING) { + source_.SetError(BIT_STR_E); + return; + } + b = source_.next(); // length, future + b = source_.next(); + while(b != 0) + b = source_.next(); + } + else if (keyOID_ == DSAk) + ; // do nothing + else { + source_.SetError(UNKNOWN_OID_E); + return; + } + + StoreKey(); + if (keyOID_ == DSAk) + AddDSA(); +} + + +// Save public key +void CertDecoder::StoreKey() +{ + if (source_.GetError().What()) return; + + word32 read = source_.get_index(); + word32 length = GetSequence(); + + read = source_.get_index() - read; + length += read; + + while (read--) source_.prev(); + + key_.SetSize(length); + key_.SetKey(source_.get_current()); + source_.advance(length); +} + + +// DSA has public key after group +void CertDecoder::AddDSA() +{ + if (source_.GetError().What()) return; + + byte b = source_.next(); + if (b != BIT_STRING) { + source_.SetError(BIT_STR_E); + return; + } + b = source_.next(); // length, future + b = source_.next(); + while(b != 0) + b = source_.next(); + + word32 idx = source_.get_index(); + b = source_.next(); + if (b != INTEGER) { + source_.SetError(INTEGER_E); + return; + } + + word32 length = GetLength(source_); + length += source_.get_index() - idx; + + key_.AddToEnd(source_.get_buffer() + idx, length); +} + + +// process algo OID by summing, return it +word32 CertDecoder::GetAlgoId() +{ + if (source_.GetError().What()) return 0; + word32 length = GetSequence(); + + byte b = source_.next(); + if (b != OBJECT_IDENTIFIER) { + source_.SetError(OBJECT_ID_E); + return 0; + } + + length = GetLength(source_); + word32 oid = 0; + + while(length--) + oid += source_.next(); // just sum it up for now + + if (oid != SHAwDSA && oid != DSAk) { + b = source_.next(); // should have NULL tag and 0 + + if (b != TAG_NULL) { + source_.SetError(TAG_NULL_E); + return 0; + } + + b = source_.next(); + if (b != 0) { + source_.SetError(EXPECT_0_E); + return 0; + } + } + + return oid; +} + + +// read cert signature, store in signature_ +word32 CertDecoder::GetSignature() +{ + if (source_.GetError().What()) return 0; + byte b = source_.next(); + + if (b != BIT_STRING) { + source_.SetError(BIT_STR_E); + return 0; + } + + sigLength_ = GetLength(source_); + + b = source_.next(); + if (b != 0) { + source_.SetError(EXPECT_0_E); + return 0; + } + sigLength_--; + + signature_ = NEW_TC byte[sigLength_]; + memcpy(signature_, source_.get_current(), sigLength_); + source_.advance(sigLength_); + + return sigLength_; +} + + +// read cert digest, store in signature_ +word32 CertDecoder::GetDigest() +{ + if (source_.GetError().What()) return 0; + byte b = source_.next(); + + if (b != OCTET_STRING) { + source_.SetError(OCTET_STR_E); + return 0; + } + + sigLength_ = GetLength(source_); + + signature_ = NEW_TC byte[sigLength_]; + memcpy(signature_, source_.get_current(), sigLength_); + source_.advance(sigLength_); + + return sigLength_; +} + + +// process NAME, either issuer or subject +void CertDecoder::GetName(NameType nt) +{ + if (source_.GetError().What()) return; + + SHA sha; + word32 length = GetSequence(); // length of all distinguished names + assert (length < ASN_NAME_MAX); + length += source_.get_index(); + + char* ptr = (nt == ISSUER) ? issuer_ : subject_; + word32 idx = 0; + + while (source_.get_index() < length) { + GetSet(); + GetSequence(); + + byte b = source_.next(); + if (b != OBJECT_IDENTIFIER) { + source_.SetError(OBJECT_ID_E); + return; + } + + word32 oidSz = GetLength(source_); + byte joint[2]; + memcpy(joint, source_.get_current(), sizeof(joint)); + + // v1 name types + if (joint[0] == 0x55 && joint[1] == 0x04) { + source_.advance(2); + byte id = source_.next(); + b = source_.next(); // strType + word32 strLen = GetLength(source_); + bool copy = false; + + if (id == COMMON_NAME) { + memcpy(&ptr[idx], "/CN=", 4); + idx += 4; + copy = true; + } + else if (id == SUR_NAME) { + memcpy(&ptr[idx], "/SN=", 4); + idx += 4; + copy = true; + } + else if (id == COUNTRY_NAME) { + memcpy(&ptr[idx], "/C=", 3); + idx += 3; + copy = true; + } + else if (id == LOCALITY_NAME) { + memcpy(&ptr[idx], "/L=", 3); + idx += 3; + copy = true; + } + else if (id == STATE_NAME) { + memcpy(&ptr[idx], "/ST=", 4); + idx += 4; + copy = true; + } + else if (id == ORG_NAME) { + memcpy(&ptr[idx], "/O=", 3); + idx += 3; + copy = true; + } + else if (id == ORGUNIT_NAME) { + memcpy(&ptr[idx], "/OU=", 4); + idx += 4; + copy = true; + } + + if (copy) { + memcpy(&ptr[idx], source_.get_current(), strLen); + idx += strLen; + } + + sha.Update(source_.get_current(), strLen); + source_.advance(strLen); + } + else { + bool email = false; + if (joint[0] == 0x2a && joint[1] == 0x86) // email id hdr + email = true; + + source_.advance(oidSz + 1); + word32 length = GetLength(source_); + + if (email) { + memcpy(&ptr[idx], "/emailAddress=", 14); + idx += 14; + + memcpy(&ptr[idx], source_.get_current(), length); + idx += length; + } + + source_.advance(length); + } + } + ptr[idx++] = 0; + + if (nt == ISSUER) + sha.Final(issuerHash_); + else + sha.Final(subjectHash_); +} + + +// process a Date, either BEFORE or AFTER +void CertDecoder::GetDate(DateType dt) +{ + if (source_.GetError().What()) return; + + byte b = source_.next(); + if (b != UTC_TIME && b != GENERALIZED_TIME) { + source_.SetError(TIME_E); + return; + } + + word32 length = GetLength(source_); + byte date[MAX_DATE_SZ]; + if (length > MAX_DATE_SZ || length < MIN_DATE_SZ) { + source_.SetError(DATE_SZ_E); + return; + } + + memcpy(date, source_.get_current(), length); + source_.advance(length); + + if (!ValidateDate(date, b, dt) && verify_) + if (dt == BEFORE) + source_.SetError(BEFORE_DATE_E); + else + source_.SetError(AFTER_DATE_E); + + // save for later use + if (dt == BEFORE) { + memcpy(beforeDate_, date, length); + beforeDate_[length] = 0; + } + else { // after + memcpy(afterDate_, date, length); + afterDate_[length] = 0; + } +} + + +void CertDecoder::GetValidity() +{ + if (source_.GetError().What()) return; + + GetSequence(); + GetDate(BEFORE); + GetDate(AFTER); +} + + +bool CertDecoder::ValidateSelfSignature() +{ + Source pub(key_.GetKey(), key_.size()); + return ConfirmSignature(pub); +} + + +// extract compare signature hash from plain and place into digest +void CertDecoder::GetCompareHash(const byte* plain, word32 sz, byte* digest, + word32 digSz) +{ + if (source_.GetError().What()) return; + + Source s(plain, sz); + CertDecoder dec(s, false); + + dec.GetSequence(); + dec.GetAlgoId(); + dec.GetDigest(); + + if (dec.sigLength_ > digSz) { + source_.SetError(SIG_LEN_E); + return; + } + + memcpy(digest, dec.signature_, dec.sigLength_); +} + + +// validate signature signed by someone else +bool CertDecoder::ValidateSignature(SignerList* signers) +{ + assert(signers); + + SignerList::iterator first = signers->begin(); + SignerList::iterator last = signers->end(); + + while (first != last) { + if ( memcmp(issuerHash_, (*first)->GetHash(), SHA::DIGEST_SIZE) == 0) { + + const PublicKey& iKey = (*first)->GetPublicKey(); + Source pub(iKey.GetKey(), iKey.size()); + return ConfirmSignature(pub); + } + ++first; + } + return false; +} + + +// confirm certificate signature +bool CertDecoder::ConfirmSignature(Source& pub) +{ + HashType ht; + mySTL::auto_ptr hasher; + + if (signatureOID_ == MD5wRSA) { + hasher.reset(NEW_TC MD5); + ht = MD5h; + } + else if (signatureOID_ == MD2wRSA) { + hasher.reset(NEW_TC MD2); + ht = MD2h; + } + else if (signatureOID_ == SHAwRSA || signatureOID_ == SHAwDSA) { + hasher.reset(NEW_TC SHA); + ht = SHAh; + } + else { + source_.SetError(UNKOWN_SIG_E); + return false; + } + + byte digest[SHA::DIGEST_SIZE]; // largest size + + hasher->Update(source_.get_buffer() + certBegin_, sigIndex_ - certBegin_); + hasher->Final(digest); + + if (keyOID_ == RSAk) { + // put in ASN.1 signature format + Source build; + Signature_Encoder(digest, hasher->getDigestSize(), ht, build); + + RSA_PublicKey pubKey(pub); + RSAES_Encryptor enc(pubKey); + + return enc.SSL_Verify(build.get_buffer(), build.size(), signature_); + } + else { // DSA + // extract r and s from sequence + byte seqDecoded[DSA_SIG_SZ]; + DecodeDSA_Signature(seqDecoded, signature_, sigLength_); + + DSA_PublicKey pubKey(pub); + DSA_Verifier ver(pubKey); + + return ver.Verify(digest, seqDecoded); + } +} + + +Signature_Encoder::Signature_Encoder(const byte* dig, word32 digSz, + HashType digOID, Source& source) +{ + // build bottom up + + // Digest + byte digArray[MAX_DIGEST_SZ]; + word32 digestSz = SetDigest(dig, digSz, digArray); + + // AlgoID + byte algoArray[MAX_ALGO_SZ]; + word32 algoSz = SetAlgoID(digOID, algoArray); + + // Sequence + byte seqArray[MAX_SEQ_SZ]; + word32 seqSz = SetSequence(digestSz + algoSz, seqArray); + + source.grow(seqSz + algoSz + digestSz); // make sure enough room + source.add(seqArray, seqSz); + source.add(algoArray, algoSz); + source.add(digArray, digestSz); +} + + + +word32 Signature_Encoder::SetDigest(const byte* d, word32 dSz, byte* output) +{ + output[0] = OCTET_STRING; + output[1] = dSz; + memcpy(&output[2], d, dSz); + + return dSz + 2; +} + + + +word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) +{ + // adding TAG_NULL and 0 to end + static const byte shaAlgoID[] = { 0x2b, 0x0e, 0x03, 0x02, 0x1a, + 0x05, 0x00 }; + static const byte md5AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x02, 0x05, 0x05, 0x00 }; + static const byte md2AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x02, 0x02, 0x05, 0x00}; + + int algoSz = 0; + const byte* algoName = 0; + + switch (aOID) { + case SHAh: + algoSz = sizeof(shaAlgoID); + algoName = shaAlgoID; + break; + + case MD2h: + algoSz = sizeof(md2AlgoID); + algoName = md2AlgoID; + break; + + case MD5h: + algoSz = sizeof(md5AlgoID); + algoName = md5AlgoID; + break; + + default: + error_.SetError(UNKOWN_HASH_E); + return 0; + } + + + byte ID_Length[MAX_LENGTH_SZ]; + word32 idSz = SetLength(algoSz - 2, ID_Length); // don't include TAG_NULL/0 + + byte seqArray[MAX_SEQ_SZ + 1]; // add object_id to end + word32 seqSz = SetSequence(idSz + algoSz + 1, seqArray); + seqArray[seqSz++] = OBJECT_IDENTIFIER; + + memcpy(output, seqArray, seqSz); + memcpy(output + seqSz, ID_Length, idSz); + memcpy(output + seqSz + idSz, algoName, algoSz); + + return seqSz + idSz + algoSz; +} + + +word32 SetSequence(word32 len, byte* output) +{ + + output[0] = SEQUENCE | CONSTRUCTED; + return SetLength(len, output + 1) + 1; +} + + +word32 EncodeDSA_Signature(const byte* signature, byte* output) +{ + Integer r(signature, 20); + Integer s(signature + 20, 20); + + return EncodeDSA_Signature(r, s, output); +} + + +word32 EncodeDSA_Signature(const Integer& r, const Integer& s, byte* output) +{ + word32 rSz = r.ByteCount(); + word32 sSz = s.ByteCount(); + + byte rLen[MAX_LENGTH_SZ + 1]; + byte sLen[MAX_LENGTH_SZ + 1]; + + rLen[0] = INTEGER; + sLen[0] = INTEGER; + + word32 rLenSz = SetLength(rSz, &rLen[1]) + 1; + word32 sLenSz = SetLength(sSz, &sLen[1]) + 1; + + byte seqArray[MAX_SEQ_SZ]; + + word32 seqSz = SetSequence(rLenSz + rSz + sLenSz + sSz, seqArray); + + // seq + memcpy(output, seqArray, seqSz); + // r + memcpy(output + seqSz, rLen, rLenSz); + r.Encode(output + seqSz + rLenSz, rSz); + // s + memcpy(output + seqSz + rLenSz + rSz, sLen, sLenSz); + s.Encode(output + seqSz + rLenSz + rSz + sLenSz, sSz); + + return seqSz + rLenSz + rSz + sLenSz + sSz; +} + + +// put sequence encoded dsa signature into decoded in 2 20 byte integers +word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz) +{ + Source source(encoded, sz); + + if (source.next() != (SEQUENCE | CONSTRUCTED)) { + source.SetError(SEQUENCE_E); + return 0; + } + + GetLength(source); // total + + // r + if (source.next() != INTEGER) { + source.SetError(INTEGER_E); + return 0; + } + word32 rLen = GetLength(source); + if (rLen != 20) + if (rLen == 21) { // zero at front, eat + source.next(); + --rLen; + } + else if (rLen == 19) { // add zero to front so 20 bytes + decoded[0] = 0; + decoded++; + } + else { + source.SetError(DSA_SZ_E); + return 0; + } + memcpy(decoded, source.get_buffer() + source.get_index(), rLen); + source.advance(rLen); + + // s + if (source.next() != INTEGER) { + source.SetError(INTEGER_E); + return 0; + } + word32 sLen = GetLength(source); + if (sLen != 20) + if (sLen == 21) { + source.next(); // zero at front, eat + --sLen; + } + else if (sLen == 19) { + decoded[rLen] = 0; // add zero to front so 20 bytes + decoded++; + } + else { + source.SetError(DSA_SZ_E); + return 0; + } + memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen); + source.advance(sLen); + + return 40; +} + + +// Get Cert in PEM format from BEGIN to END +int GetCert(Source& source) +{ + char header[] = "-----BEGIN CERTIFICATE-----"; + char footer[] = "-----END CERTIFICATE-----"; + + char* begin = strstr((char*)source.get_buffer(), header); + char* end = strstr((char*)source.get_buffer(), footer); + + if (!begin || !end || begin >= end) return -1; + + end += strlen(footer); + if (*end == '\r') end++; + + Source tmp((byte*)begin, end - begin + 1); + source.Swap(tmp); + + return 0; +} + + + +// Decode a BER encoded PKCS12 structure +void PKCS12_Decoder::Decode() +{ + ReadHeader(); + if (source_.GetError().What()) return; + + // Get AuthSafe + + GetSequence(); + + // get object id + byte obj_id = source_.next(); + if (obj_id != OBJECT_IDENTIFIER) { + source_.SetError(OBJECT_ID_E); + return; + } + + word32 length = GetLength(source_); + + word32 algo_sum = 0; + while (length--) + algo_sum += source_.next(); + + + + + + + // Get MacData optional + /* + mac digestInfo like certdecoder::getdigest? + macsalt octet string + iter integer + + */ +} + + +void PKCS12_Decoder::ReadHeader() +{ + // Gets Version + GetSequence(); + GetVersion(); +} + + +// Get Cert in PEM format from pkcs12 file +int GetPKCS_Cert(const char* password, Source& source) +{ + PKCS12_Decoder pkcs12(source); + pkcs12.Decode(); + + return 0; +} + + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/bftables.cpp b/externals/mysql/extlib/yassl/taocrypt/src/bftables.cpp new file mode 100644 index 00000000000..46469472e6a --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/bftables.cpp @@ -0,0 +1,303 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's bfinit.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "blowfish.hpp" + + +namespace TaoCrypt { + +const word32 Blowfish::p_init_[Blowfish::ROUNDS+2] = +{ + 608135816U, 2242054355U, 320440878U, 57701188U, + 2752067618U, 698298832U, 137296536U, 3964562569U, + 1160258022U, 953160567U, 3193202383U, 887688300U, + 3232508343U, 3380367581U, 1065670069U, 3041331479U, + 2450970073U, 2306472731U +} ; + + +const word32 Blowfish::s_init_[4*256] = { + 3509652390U, 2564797868U, 805139163U, 3491422135U, + 3101798381U, 1780907670U, 3128725573U, 4046225305U, + 614570311U, 3012652279U, 134345442U, 2240740374U, + 1667834072U, 1901547113U, 2757295779U, 4103290238U, + 227898511U, 1921955416U, 1904987480U, 2182433518U, + 2069144605U, 3260701109U, 2620446009U, 720527379U, + 3318853667U, 677414384U, 3393288472U, 3101374703U, + 2390351024U, 1614419982U, 1822297739U, 2954791486U, + 3608508353U, 3174124327U, 2024746970U, 1432378464U, + 3864339955U, 2857741204U, 1464375394U, 1676153920U, + 1439316330U, 715854006U, 3033291828U, 289532110U, + 2706671279U, 2087905683U, 3018724369U, 1668267050U, + 732546397U, 1947742710U, 3462151702U, 2609353502U, + 2950085171U, 1814351708U, 2050118529U, 680887927U, + 999245976U, 1800124847U, 3300911131U, 1713906067U, + 1641548236U, 4213287313U, 1216130144U, 1575780402U, + 4018429277U, 3917837745U, 3693486850U, 3949271944U, + 596196993U, 3549867205U, 258830323U, 2213823033U, + 772490370U, 2760122372U, 1774776394U, 2652871518U, + 566650946U, 4142492826U, 1728879713U, 2882767088U, + 1783734482U, 3629395816U, 2517608232U, 2874225571U, + 1861159788U, 326777828U, 3124490320U, 2130389656U, + 2716951837U, 967770486U, 1724537150U, 2185432712U, + 2364442137U, 1164943284U, 2105845187U, 998989502U, + 3765401048U, 2244026483U, 1075463327U, 1455516326U, + 1322494562U, 910128902U, 469688178U, 1117454909U, + 936433444U, 3490320968U, 3675253459U, 1240580251U, + 122909385U, 2157517691U, 634681816U, 4142456567U, + 3825094682U, 3061402683U, 2540495037U, 79693498U, + 3249098678U, 1084186820U, 1583128258U, 426386531U, + 1761308591U, 1047286709U, 322548459U, 995290223U, + 1845252383U, 2603652396U, 3431023940U, 2942221577U, + 3202600964U, 3727903485U, 1712269319U, 422464435U, + 3234572375U, 1170764815U, 3523960633U, 3117677531U, + 1434042557U, 442511882U, 3600875718U, 1076654713U, + 1738483198U, 4213154764U, 2393238008U, 3677496056U, + 1014306527U, 4251020053U, 793779912U, 2902807211U, + 842905082U, 4246964064U, 1395751752U, 1040244610U, + 2656851899U, 3396308128U, 445077038U, 3742853595U, + 3577915638U, 679411651U, 2892444358U, 2354009459U, + 1767581616U, 3150600392U, 3791627101U, 3102740896U, + 284835224U, 4246832056U, 1258075500U, 768725851U, + 2589189241U, 3069724005U, 3532540348U, 1274779536U, + 3789419226U, 2764799539U, 1660621633U, 3471099624U, + 4011903706U, 913787905U, 3497959166U, 737222580U, + 2514213453U, 2928710040U, 3937242737U, 1804850592U, + 3499020752U, 2949064160U, 2386320175U, 2390070455U, + 2415321851U, 4061277028U, 2290661394U, 2416832540U, + 1336762016U, 1754252060U, 3520065937U, 3014181293U, + 791618072U, 3188594551U, 3933548030U, 2332172193U, + 3852520463U, 3043980520U, 413987798U, 3465142937U, + 3030929376U, 4245938359U, 2093235073U, 3534596313U, + 375366246U, 2157278981U, 2479649556U, 555357303U, + 3870105701U, 2008414854U, 3344188149U, 4221384143U, + 3956125452U, 2067696032U, 3594591187U, 2921233993U, + 2428461U, 544322398U, 577241275U, 1471733935U, + 610547355U, 4027169054U, 1432588573U, 1507829418U, + 2025931657U, 3646575487U, 545086370U, 48609733U, + 2200306550U, 1653985193U, 298326376U, 1316178497U, + 3007786442U, 2064951626U, 458293330U, 2589141269U, + 3591329599U, 3164325604U, 727753846U, 2179363840U, + 146436021U, 1461446943U, 4069977195U, 705550613U, + 3059967265U, 3887724982U, 4281599278U, 3313849956U, + 1404054877U, 2845806497U, 146425753U, 1854211946U, + + 1266315497U, 3048417604U, 3681880366U, 3289982499U, + 2909710000U, 1235738493U, 2632868024U, 2414719590U, + 3970600049U, 1771706367U, 1449415276U, 3266420449U, + 422970021U, 1963543593U, 2690192192U, 3826793022U, + 1062508698U, 1531092325U, 1804592342U, 2583117782U, + 2714934279U, 4024971509U, 1294809318U, 4028980673U, + 1289560198U, 2221992742U, 1669523910U, 35572830U, + 157838143U, 1052438473U, 1016535060U, 1802137761U, + 1753167236U, 1386275462U, 3080475397U, 2857371447U, + 1040679964U, 2145300060U, 2390574316U, 1461121720U, + 2956646967U, 4031777805U, 4028374788U, 33600511U, + 2920084762U, 1018524850U, 629373528U, 3691585981U, + 3515945977U, 2091462646U, 2486323059U, 586499841U, + 988145025U, 935516892U, 3367335476U, 2599673255U, + 2839830854U, 265290510U, 3972581182U, 2759138881U, + 3795373465U, 1005194799U, 847297441U, 406762289U, + 1314163512U, 1332590856U, 1866599683U, 4127851711U, + 750260880U, 613907577U, 1450815602U, 3165620655U, + 3734664991U, 3650291728U, 3012275730U, 3704569646U, + 1427272223U, 778793252U, 1343938022U, 2676280711U, + 2052605720U, 1946737175U, 3164576444U, 3914038668U, + 3967478842U, 3682934266U, 1661551462U, 3294938066U, + 4011595847U, 840292616U, 3712170807U, 616741398U, + 312560963U, 711312465U, 1351876610U, 322626781U, + 1910503582U, 271666773U, 2175563734U, 1594956187U, + 70604529U, 3617834859U, 1007753275U, 1495573769U, + 4069517037U, 2549218298U, 2663038764U, 504708206U, + 2263041392U, 3941167025U, 2249088522U, 1514023603U, + 1998579484U, 1312622330U, 694541497U, 2582060303U, + 2151582166U, 1382467621U, 776784248U, 2618340202U, + 3323268794U, 2497899128U, 2784771155U, 503983604U, + 4076293799U, 907881277U, 423175695U, 432175456U, + 1378068232U, 4145222326U, 3954048622U, 3938656102U, + 3820766613U, 2793130115U, 2977904593U, 26017576U, + 3274890735U, 3194772133U, 1700274565U, 1756076034U, + 4006520079U, 3677328699U, 720338349U, 1533947780U, + 354530856U, 688349552U, 3973924725U, 1637815568U, + 332179504U, 3949051286U, 53804574U, 2852348879U, + 3044236432U, 1282449977U, 3583942155U, 3416972820U, + 4006381244U, 1617046695U, 2628476075U, 3002303598U, + 1686838959U, 431878346U, 2686675385U, 1700445008U, + 1080580658U, 1009431731U, 832498133U, 3223435511U, + 2605976345U, 2271191193U, 2516031870U, 1648197032U, + 4164389018U, 2548247927U, 300782431U, 375919233U, + 238389289U, 3353747414U, 2531188641U, 2019080857U, + 1475708069U, 455242339U, 2609103871U, 448939670U, + 3451063019U, 1395535956U, 2413381860U, 1841049896U, + 1491858159U, 885456874U, 4264095073U, 4001119347U, + 1565136089U, 3898914787U, 1108368660U, 540939232U, + 1173283510U, 2745871338U, 3681308437U, 4207628240U, + 3343053890U, 4016749493U, 1699691293U, 1103962373U, + 3625875870U, 2256883143U, 3830138730U, 1031889488U, + 3479347698U, 1535977030U, 4236805024U, 3251091107U, + 2132092099U, 1774941330U, 1199868427U, 1452454533U, + 157007616U, 2904115357U, 342012276U, 595725824U, + 1480756522U, 206960106U, 497939518U, 591360097U, + 863170706U, 2375253569U, 3596610801U, 1814182875U, + 2094937945U, 3421402208U, 1082520231U, 3463918190U, + 2785509508U, 435703966U, 3908032597U, 1641649973U, + 2842273706U, 3305899714U, 1510255612U, 2148256476U, + 2655287854U, 3276092548U, 4258621189U, 236887753U, + 3681803219U, 274041037U, 1734335097U, 3815195456U, + 3317970021U, 1899903192U, 1026095262U, 4050517792U, + 356393447U, 2410691914U, 3873677099U, 3682840055U, + + 3913112168U, 2491498743U, 4132185628U, 2489919796U, + 1091903735U, 1979897079U, 3170134830U, 3567386728U, + 3557303409U, 857797738U, 1136121015U, 1342202287U, + 507115054U, 2535736646U, 337727348U, 3213592640U, + 1301675037U, 2528481711U, 1895095763U, 1721773893U, + 3216771564U, 62756741U, 2142006736U, 835421444U, + 2531993523U, 1442658625U, 3659876326U, 2882144922U, + 676362277U, 1392781812U, 170690266U, 3921047035U, + 1759253602U, 3611846912U, 1745797284U, 664899054U, + 1329594018U, 3901205900U, 3045908486U, 2062866102U, + 2865634940U, 3543621612U, 3464012697U, 1080764994U, + 553557557U, 3656615353U, 3996768171U, 991055499U, + 499776247U, 1265440854U, 648242737U, 3940784050U, + 980351604U, 3713745714U, 1749149687U, 3396870395U, + 4211799374U, 3640570775U, 1161844396U, 3125318951U, + 1431517754U, 545492359U, 4268468663U, 3499529547U, + 1437099964U, 2702547544U, 3433638243U, 2581715763U, + 2787789398U, 1060185593U, 1593081372U, 2418618748U, + 4260947970U, 69676912U, 2159744348U, 86519011U, + 2512459080U, 3838209314U, 1220612927U, 3339683548U, + 133810670U, 1090789135U, 1078426020U, 1569222167U, + 845107691U, 3583754449U, 4072456591U, 1091646820U, + 628848692U, 1613405280U, 3757631651U, 526609435U, + 236106946U, 48312990U, 2942717905U, 3402727701U, + 1797494240U, 859738849U, 992217954U, 4005476642U, + 2243076622U, 3870952857U, 3732016268U, 765654824U, + 3490871365U, 2511836413U, 1685915746U, 3888969200U, + 1414112111U, 2273134842U, 3281911079U, 4080962846U, + 172450625U, 2569994100U, 980381355U, 4109958455U, + 2819808352U, 2716589560U, 2568741196U, 3681446669U, + 3329971472U, 1835478071U, 660984891U, 3704678404U, + 4045999559U, 3422617507U, 3040415634U, 1762651403U, + 1719377915U, 3470491036U, 2693910283U, 3642056355U, + 3138596744U, 1364962596U, 2073328063U, 1983633131U, + 926494387U, 3423689081U, 2150032023U, 4096667949U, + 1749200295U, 3328846651U, 309677260U, 2016342300U, + 1779581495U, 3079819751U, 111262694U, 1274766160U, + 443224088U, 298511866U, 1025883608U, 3806446537U, + 1145181785U, 168956806U, 3641502830U, 3584813610U, + 1689216846U, 3666258015U, 3200248200U, 1692713982U, + 2646376535U, 4042768518U, 1618508792U, 1610833997U, + 3523052358U, 4130873264U, 2001055236U, 3610705100U, + 2202168115U, 4028541809U, 2961195399U, 1006657119U, + 2006996926U, 3186142756U, 1430667929U, 3210227297U, + 1314452623U, 4074634658U, 4101304120U, 2273951170U, + 1399257539U, 3367210612U, 3027628629U, 1190975929U, + 2062231137U, 2333990788U, 2221543033U, 2438960610U, + 1181637006U, 548689776U, 2362791313U, 3372408396U, + 3104550113U, 3145860560U, 296247880U, 1970579870U, + 3078560182U, 3769228297U, 1714227617U, 3291629107U, + 3898220290U, 166772364U, 1251581989U, 493813264U, + 448347421U, 195405023U, 2709975567U, 677966185U, + 3703036547U, 1463355134U, 2715995803U, 1338867538U, + 1343315457U, 2802222074U, 2684532164U, 233230375U, + 2599980071U, 2000651841U, 3277868038U, 1638401717U, + 4028070440U, 3237316320U, 6314154U, 819756386U, + 300326615U, 590932579U, 1405279636U, 3267499572U, + 3150704214U, 2428286686U, 3959192993U, 3461946742U, + 1862657033U, 1266418056U, 963775037U, 2089974820U, + 2263052895U, 1917689273U, 448879540U, 3550394620U, + 3981727096U, 150775221U, 3627908307U, 1303187396U, + 508620638U, 2975983352U, 2726630617U, 1817252668U, + 1876281319U, 1457606340U, 908771278U, 3720792119U, + 3617206836U, 2455994898U, 1729034894U, 1080033504U, + + 976866871U, 3556439503U, 2881648439U, 1522871579U, + 1555064734U, 1336096578U, 3548522304U, 2579274686U, + 3574697629U, 3205460757U, 3593280638U, 3338716283U, + 3079412587U, 564236357U, 2993598910U, 1781952180U, + 1464380207U, 3163844217U, 3332601554U, 1699332808U, + 1393555694U, 1183702653U, 3581086237U, 1288719814U, + 691649499U, 2847557200U, 2895455976U, 3193889540U, + 2717570544U, 1781354906U, 1676643554U, 2592534050U, + 3230253752U, 1126444790U, 2770207658U, 2633158820U, + 2210423226U, 2615765581U, 2414155088U, 3127139286U, + 673620729U, 2805611233U, 1269405062U, 4015350505U, + 3341807571U, 4149409754U, 1057255273U, 2012875353U, + 2162469141U, 2276492801U, 2601117357U, 993977747U, + 3918593370U, 2654263191U, 753973209U, 36408145U, + 2530585658U, 25011837U, 3520020182U, 2088578344U, + 530523599U, 2918365339U, 1524020338U, 1518925132U, + 3760827505U, 3759777254U, 1202760957U, 3985898139U, + 3906192525U, 674977740U, 4174734889U, 2031300136U, + 2019492241U, 3983892565U, 4153806404U, 3822280332U, + 352677332U, 2297720250U, 60907813U, 90501309U, + 3286998549U, 1016092578U, 2535922412U, 2839152426U, + 457141659U, 509813237U, 4120667899U, 652014361U, + 1966332200U, 2975202805U, 55981186U, 2327461051U, + 676427537U, 3255491064U, 2882294119U, 3433927263U, + 1307055953U, 942726286U, 933058658U, 2468411793U, + 3933900994U, 4215176142U, 1361170020U, 2001714738U, + 2830558078U, 3274259782U, 1222529897U, 1679025792U, + 2729314320U, 3714953764U, 1770335741U, 151462246U, + 3013232138U, 1682292957U, 1483529935U, 471910574U, + 1539241949U, 458788160U, 3436315007U, 1807016891U, + 3718408830U, 978976581U, 1043663428U, 3165965781U, + 1927990952U, 4200891579U, 2372276910U, 3208408903U, + 3533431907U, 1412390302U, 2931980059U, 4132332400U, + 1947078029U, 3881505623U, 4168226417U, 2941484381U, + 1077988104U, 1320477388U, 886195818U, 18198404U, + 3786409000U, 2509781533U, 112762804U, 3463356488U, + 1866414978U, 891333506U, 18488651U, 661792760U, + 1628790961U, 3885187036U, 3141171499U, 876946877U, + 2693282273U, 1372485963U, 791857591U, 2686433993U, + 3759982718U, 3167212022U, 3472953795U, 2716379847U, + 445679433U, 3561995674U, 3504004811U, 3574258232U, + 54117162U, 3331405415U, 2381918588U, 3769707343U, + 4154350007U, 1140177722U, 4074052095U, 668550556U, + 3214352940U, 367459370U, 261225585U, 2610173221U, + 4209349473U, 3468074219U, 3265815641U, 314222801U, + 3066103646U, 3808782860U, 282218597U, 3406013506U, + 3773591054U, 379116347U, 1285071038U, 846784868U, + 2669647154U, 3771962079U, 3550491691U, 2305946142U, + 453669953U, 1268987020U, 3317592352U, 3279303384U, + 3744833421U, 2610507566U, 3859509063U, 266596637U, + 3847019092U, 517658769U, 3462560207U, 3443424879U, + 370717030U, 4247526661U, 2224018117U, 4143653529U, + 4112773975U, 2788324899U, 2477274417U, 1456262402U, + 2901442914U, 1517677493U, 1846949527U, 2295493580U, + 3734397586U, 2176403920U, 1280348187U, 1908823572U, + 3871786941U, 846861322U, 1172426758U, 3287448474U, + 3383383037U, 1655181056U, 3139813346U, 901632758U, + 1897031941U, 2986607138U, 3066810236U, 3447102507U, + 1393639104U, 373351379U, 950779232U, 625454576U, + 3124240540U, 4148612726U, 2007998917U, 544563296U, + 2244738638U, 2330496472U, 2058025392U, 1291430526U, + 424198748U, 50039436U, 29584100U, 3605783033U, + 2429876329U, 2791104160U, 1057563949U, 3255363231U, + 3075367218U, 3463963227U, 1469046755U, 985887462U +}; + + + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/blowfish.cpp b/externals/mysql/extlib/yassl/taocrypt/src/blowfish.cpp new file mode 100644 index 00000000000..66ff4d829d7 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/blowfish.cpp @@ -0,0 +1,342 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* C++ code based on Wei Dai's blowfish.cpp from CryptoPP */ +/* x86 asm is original */ + + +#if defined(TAOCRYPT_KERNEL_MODE) + #define DO_TAOCRYPT_KERNEL_MODE +#endif // only some modules now support this + + +#include "runtime.hpp" +#include "blowfish.hpp" + + + + + +namespace TaoCrypt { + + +#if defined(DO_BLOWFISH_ASM) + +// ia32 optimized version +void Blowfish::Process(byte* out, const byte* in, word32 sz) +{ + if (!isMMX) { + Mode_BASE::Process(out, in, sz); + return; + } + + word32 blocks = sz / BLOCK_SIZE; + + if (mode_ == ECB) + while (blocks--) { + AsmProcess(in, out); + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } + else if (mode_ == CBC) + if (dir_ == ENCRYPTION) + while (blocks--) { + r_[0] ^= *(word32*)in; + r_[1] ^= *(word32*)(in + 4); + + AsmProcess((byte*)r_, (byte*)r_); + + memcpy(out, r_, BLOCK_SIZE); + + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } + else + while (blocks--) { + AsmProcess(in, out); + + *(word32*)out ^= r_[0]; + *(word32*)(out + 4) ^= r_[1]; + + memcpy(r_, in, BLOCK_SIZE); + + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } +} + +#endif // DO_BLOWFISH_ASM + + +void Blowfish::SetKey(const byte* key_string, word32 keylength, CipherDir dir) +{ + assert(keylength >= 4 && keylength <= 56); + + unsigned i, j=0, k; + word32 data, dspace[2] = {0, 0}; + + memcpy(pbox_, p_init_, sizeof(p_init_)); + memcpy(sbox_, s_init_, sizeof(s_init_)); + + // Xor key string into encryption key vector + for (i=0 ; i> 8)&0xFF) +#define BFBYTE_2(x) ((x>>16)&0xFF) +#define BFBYTE_3(x) ( x>>24) + + +#define BF_S(Put, Get, I) (\ + Put ^= p[I], \ + tmp = p[18 + BFBYTE_3(Get)], \ + tmp += p[274+ BFBYTE_2(Get)], \ + tmp ^= p[530+ BFBYTE_1(Get)], \ + tmp += p[786+ BFBYTE_0(Get)], \ + Put ^= tmp \ + ) + + +#define BF_ROUNDS \ + BF_S(right, left, 1); \ + BF_S(left, right, 2); \ + BF_S(right, left, 3); \ + BF_S(left, right, 4); \ + BF_S(right, left, 5); \ + BF_S(left, right, 6); \ + BF_S(right, left, 7); \ + BF_S(left, right, 8); \ + BF_S(right, left, 9); \ + BF_S(left, right, 10); \ + BF_S(right, left, 11); \ + BF_S(left, right, 12); \ + BF_S(right, left, 13); \ + BF_S(left, right, 14); \ + BF_S(right, left, 15); \ + BF_S(left, right, 16); + +#define BF_EXTRA_ROUNDS \ + BF_S(right, left, 17); \ + BF_S(left, right, 18); \ + BF_S(right, left, 19); \ + BF_S(left, right, 20); + + +// Used by key setup, no byte swapping +void Blowfish::crypt_block(const word32 in[2], word32 out[2]) const +{ + word32 left = in[0]; + word32 right = in[1]; + + const word32* p = pbox_; + word32 tmp; + + left ^= p[0]; + + BF_ROUNDS + +#if ROUNDS == 20 + BF_EXTRA_ROUNDS +#endif + + right ^= p[ROUNDS + 1]; + + out[0] = right; + out[1] = left; +} + + +typedef BlockGetAndPut gpBlock; + +void Blowfish::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) + const +{ + word32 tmp, left, right; + const word32* p = pbox_; + + gpBlock::Get(in)(left)(right); + left ^= p[0]; + + BF_ROUNDS + +#if ROUNDS == 20 + BF_EXTRA_ROUNDS +#endif + + right ^= p[ROUNDS + 1]; + + gpBlock::Put(xOr, out)(right)(left); +} + + +#if defined(DO_BLOWFISH_ASM) + #ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( mov ecx, DWORD PTR [ebp + 8] ) \ + AS2( mov esi, DWORD PTR [ebp + 12] ) + + #define EPILOG() \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); + #else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( mov esi, DWORD PTR [ebp + 8] ) + + #define EPILOG() \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 8 ) + + #endif + + +#define BF_ROUND(P, G, I) \ + /* Put ^= p[I] */ \ + AS2( xor P, [edi + I*4] ) \ + /* tmp = p[18 + BFBYTE_3(Get)] */ \ + AS2( mov ecx, G ) \ + AS2( shr ecx, 16 ) \ + AS2( movzx edx, ch ) \ + AS2( mov esi, [edi + edx*4 + 72] ) \ + /* tmp += p[274+ BFBYTE_2(Get)] */ \ + AS2( movzx ecx, cl ) \ + AS2( add esi, [edi + ecx*4 + 1096] ) \ + /* tmp ^= p[530+ BFBYTE_1(Get)] */ \ + AS2( mov ecx, G ) \ + AS2( movzx edx, ch ) \ + AS2( xor esi, [edi + edx*4 + 2120] ) \ + /* tmp += p[786+ BFBYTE_0(Get)] */ \ + AS2( movzx ecx, cl ) \ + AS2( add esi, [edi + ecx*4 + 3144] ) \ + /* Put ^= tmp */ \ + AS2( xor P, esi ) + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void Blowfish::AsmProcess(const byte* inBlock, byte* outBlock) const +{ + PROLOG() + + #ifdef OLD_GCC_OFFSET + AS2( lea edi, [ecx + 60] ) // pbox + #else + AS2( lea edi, [ecx + 56] ) // pbox + #endif + + AS2( mov eax, DWORD PTR [esi] ) + AS2( mov edx, DWORD PTR [edi] ) + AS1( bswap eax ) + + AS2( mov ebx, DWORD PTR [esi + 4] ) + AS2( xor eax, edx ) // left + AS1( bswap ebx ) // right + + + BF_ROUND(ebx, eax, 1) + BF_ROUND(eax, ebx, 2) + BF_ROUND(ebx, eax, 3) + BF_ROUND(eax, ebx, 4) + BF_ROUND(ebx, eax, 5) + BF_ROUND(eax, ebx, 6) + BF_ROUND(ebx, eax, 7) + BF_ROUND(eax, ebx, 8) + BF_ROUND(ebx, eax, 9) + BF_ROUND(eax, ebx, 10) + BF_ROUND(ebx, eax, 11) + BF_ROUND(eax, ebx, 12) + BF_ROUND(ebx, eax, 13) + BF_ROUND(eax, ebx, 14) + BF_ROUND(ebx, eax, 15) + BF_ROUND(eax, ebx, 16) + #if ROUNDS == 20 + BF_ROUND(ebx, eax, 17) + BF_ROUND(eax, ebx, 18) + BF_ROUND(ebx, eax, 19) + BF_ROUND(eax, ebx, 20) + + AS2( xor ebx, [edi + 84] ) // 20 + 1 (x4) + #else + AS2( xor ebx, [edi + 68] ) // 16 + 1 (x4) + #endif + + #ifdef __GNUC__ + AS2( mov edi, [ebp + 16] ) // outBlock + #else + AS2( mov edi, [ebp + 12] ) // outBlock + #endif + + AS1( bswap ebx ) + AS1( bswap eax ) + + AS2( mov [edi] , ebx ) + AS2( mov [edi + 4], eax ) + + EPILOG() +} + + +#endif // DO_BLOWFISH_ASM + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/coding.cpp b/externals/mysql/extlib/yassl/taocrypt/src/coding.cpp new file mode 100644 index 00000000000..7a9d50aaac9 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/coding.cpp @@ -0,0 +1,253 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* coding.cpp implements hex and base64 encoding/decoing +*/ + +#include "runtime.hpp" +#include "coding.hpp" +#include "file.hpp" + + +namespace TaoCrypt { + + +namespace { // locals + +const byte bad = 0xFF; // invalid encoding + +const byte hexEncode[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F' + }; + +const byte hexDecode[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + bad, bad, bad, bad, bad, bad, bad, + 10, 11, 12, 13, 14, 15 + }; // A starts at 0x41 not 0x3A + + +const byte base64Encode[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', + 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', + 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', + 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', + 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + '+', '/' + }; + +const byte base64Decode[] = { 62, bad, bad, bad, 63, // + starts at 0x2B + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + bad, bad, bad, bad, bad, bad, bad, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, + bad, bad, bad, bad, bad, bad, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51 + }; + +const byte pad = '='; +const int pemLineSz = 64; + +} // local namespace + + +// Hex Encode +void HexEncoder::Encode() +{ + word32 bytes = plain_.size(); + encoded_.New(bytes * 2); + + word32 i = 0; + + while (bytes--) { + byte p = plain_.next(); + + byte b = p >> 4; + byte b2 = p & 0xF; + + encoded_[i++] = hexEncode[b]; + encoded_[i++] = hexEncode[b2]; + } + + plain_.reset(encoded_); +} + + +// Hex Decode +void HexDecoder::Decode() +{ + word32 bytes = coded_.size(); + assert((bytes % 2) == 0); + decoded_.New(bytes / 2); + + word32 i(0); + + while (bytes) { + byte b = coded_.next() - 0x30; // 0 starts at 0x30 + byte b2 = coded_.next() - 0x30; + + // sanity checks + assert( b < sizeof(hexDecode)/sizeof(hexDecode[0]) ); + assert( b2 < sizeof(hexDecode)/sizeof(hexDecode[0]) ); + + b = hexDecode[b]; + b2 = hexDecode[b2]; + + assert( b != bad && b2 != bad ); + + decoded_[i++] = (b << 4) | b2; + bytes -= 2; + } + + coded_.reset(decoded_); +} + + +// Base 64 Encode +void Base64Encoder::Encode() +{ + word32 bytes = plain_.size(); + word32 outSz = (bytes + 3 - 1) / 3 * 4; + + outSz += (outSz + pemLineSz - 1) / pemLineSz; // new lines + encoded_.New(outSz); + + word32 i = 0; + word32 j = 0; + + while (bytes > 2) { + byte b1 = plain_.next(); + byte b2 = plain_.next(); + byte b3 = plain_.next(); + + // encoded idx + byte e1 = b1 >> 2; + byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4); + byte e3 = ((b2 & 0xF) << 2) | (b3 >> 6); + byte e4 = b3 & 0x3F; + + // store + encoded_[i++] = base64Encode[e1]; + encoded_[i++] = base64Encode[e2]; + encoded_[i++] = base64Encode[e3]; + encoded_[i++] = base64Encode[e4]; + + bytes -= 3; + + if ((++j % 16) == 0 && bytes) + encoded_[i++] = '\n'; + } + + // last integral + if (bytes) { + bool twoBytes = (bytes == 2); + + byte b1 = plain_.next(); + byte b2 = (twoBytes) ? plain_.next() : 0; + + byte e1 = b1 >> 2; + byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4); + byte e3 = (b2 & 0xF) << 2; + + encoded_[i++] = base64Encode[e1]; + encoded_[i++] = base64Encode[e2]; + encoded_[i++] = (twoBytes) ? base64Encode[e3] : pad; + encoded_[i++] = pad; + } + + encoded_[i++] = '\n'; + assert(i == outSz); + + plain_.reset(encoded_); +} + + +// Base 64 Decode +void Base64Decoder::Decode() +{ + word32 bytes = coded_.size(); + word32 plainSz = bytes - ((bytes + (pemLineSz - 1)) / pemLineSz); + plainSz = (plainSz * 3 + 3) / 4; + decoded_.New(plainSz); + + word32 i = 0; + word32 j = 0; + + while (bytes > 3) { + byte e1 = coded_.next(); + byte e2 = coded_.next(); + byte e3 = coded_.next(); + byte e4 = coded_.next(); + + // do asserts first + if (e1 == 0) // end file 0's + break; + + bool pad3 = false; + bool pad4 = false; + if (e3 == pad) + pad3 = true; + if (e4 == pad) + pad4 = true; + + e1 = base64Decode[e1 - 0x2B]; + e2 = base64Decode[e2 - 0x2B]; + e3 = (e3 == pad) ? 0 : base64Decode[e3 - 0x2B]; + e4 = (e4 == pad) ? 0 : base64Decode[e4 - 0x2B]; + + byte b1 = (e1 << 2) | (e2 >> 4); + byte b2 = ((e2 & 0xF) << 4) | (e3 >> 2); + byte b3 = ((e3 & 0x3) << 6) | e4; + + decoded_[i++] = b1; + if (!pad3) + decoded_[i++] = b2; + if (!pad4) + decoded_[i++] = b3; + else + break; + + bytes -= 4; + if ((++j % 16) == 0) { + byte endLine = coded_.next(); + bytes--; + while (endLine == ' ') { // remove possible whitespace + endLine = coded_.next(); + bytes--; + } + if (endLine == '\r') { + endLine = coded_.next(); + bytes--; + } + if (endLine != '\n') { + coded_.SetError(PEM_E); + return; + } + } + } + + if (i != decoded_.size()) + decoded_.resize(i); + coded_.reset(decoded_); +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/crypto.cpp b/externals/mysql/extlib/yassl/taocrypt/src/crypto.cpp new file mode 100644 index 00000000000..90d406bf0c2 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/crypto.cpp @@ -0,0 +1,37 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* put features that other apps expect from OpenSSL type crypto */ + + + +extern "C" { + + // for libcurl configure test, these are the signatures they use + // locking handled internally by library + char CRYPTO_lock() { return 0;} + char CRYPTO_add_lock() { return 0;} + + + // for openvpn, test are the signatures they use + char EVP_CIPHER_CTX_init() { return 0; } + char CRYPTO_mem_ctrl() { return 0; } +} // extern "C" + + + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/des.cpp b/externals/mysql/extlib/yassl/taocrypt/src/des.cpp new file mode 100644 index 00000000000..5cffeaea9c9 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/des.cpp @@ -0,0 +1,776 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* C++ part based on Wei Dai's des.cpp from CryptoPP */ +/* x86 asm is original */ + + +#if defined(TAOCRYPT_KERNEL_MODE) + #define DO_TAOCRYPT_KERNEL_MODE +#endif // only some modules now support this + + +#include "runtime.hpp" +#include "des.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + + +namespace TaoCrypt { + + +/* permuted choice table (key) */ +static const byte pc1[] = { + 57, 49, 41, 33, 25, 17, 9, + 1, 58, 50, 42, 34, 26, 18, + 10, 2, 59, 51, 43, 35, 27, + 19, 11, 3, 60, 52, 44, 36, + + 63, 55, 47, 39, 31, 23, 15, + 7, 62, 54, 46, 38, 30, 22, + 14, 6, 61, 53, 45, 37, 29, + 21, 13, 5, 28, 20, 12, 4 +}; + +/* number left rotations of pc1 */ +static const byte totrot[] = { + 1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 +}; + +/* permuted choice key (table) */ +static const byte pc2[] = { + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 +}; + +/* End of DES-defined tables */ + +/* bit 0 is left-most in byte */ +static const int bytebit[] = { + 0200,0100,040,020,010,04,02,01 +}; + +const word32 Spbox[8][64] = { +{ +0x01010400,0x00000000,0x00010000,0x01010404, +0x01010004,0x00010404,0x00000004,0x00010000, +0x00000400,0x01010400,0x01010404,0x00000400, +0x01000404,0x01010004,0x01000000,0x00000004, +0x00000404,0x01000400,0x01000400,0x00010400, +0x00010400,0x01010000,0x01010000,0x01000404, +0x00010004,0x01000004,0x01000004,0x00010004, +0x00000000,0x00000404,0x00010404,0x01000000, +0x00010000,0x01010404,0x00000004,0x01010000, +0x01010400,0x01000000,0x01000000,0x00000400, +0x01010004,0x00010000,0x00010400,0x01000004, +0x00000400,0x00000004,0x01000404,0x00010404, +0x01010404,0x00010004,0x01010000,0x01000404, +0x01000004,0x00000404,0x00010404,0x01010400, +0x00000404,0x01000400,0x01000400,0x00000000, +0x00010004,0x00010400,0x00000000,0x01010004}, +{ +0x80108020,0x80008000,0x00008000,0x00108020, +0x00100000,0x00000020,0x80100020,0x80008020, +0x80000020,0x80108020,0x80108000,0x80000000, +0x80008000,0x00100000,0x00000020,0x80100020, +0x00108000,0x00100020,0x80008020,0x00000000, +0x80000000,0x00008000,0x00108020,0x80100000, +0x00100020,0x80000020,0x00000000,0x00108000, +0x00008020,0x80108000,0x80100000,0x00008020, +0x00000000,0x00108020,0x80100020,0x00100000, +0x80008020,0x80100000,0x80108000,0x00008000, +0x80100000,0x80008000,0x00000020,0x80108020, +0x00108020,0x00000020,0x00008000,0x80000000, +0x00008020,0x80108000,0x00100000,0x80000020, +0x00100020,0x80008020,0x80000020,0x00100020, +0x00108000,0x00000000,0x80008000,0x00008020, +0x80000000,0x80100020,0x80108020,0x00108000}, +{ +0x00000208,0x08020200,0x00000000,0x08020008, +0x08000200,0x00000000,0x00020208,0x08000200, +0x00020008,0x08000008,0x08000008,0x00020000, +0x08020208,0x00020008,0x08020000,0x00000208, +0x08000000,0x00000008,0x08020200,0x00000200, +0x00020200,0x08020000,0x08020008,0x00020208, +0x08000208,0x00020200,0x00020000,0x08000208, +0x00000008,0x08020208,0x00000200,0x08000000, +0x08020200,0x08000000,0x00020008,0x00000208, +0x00020000,0x08020200,0x08000200,0x00000000, +0x00000200,0x00020008,0x08020208,0x08000200, +0x08000008,0x00000200,0x00000000,0x08020008, +0x08000208,0x00020000,0x08000000,0x08020208, +0x00000008,0x00020208,0x00020200,0x08000008, +0x08020000,0x08000208,0x00000208,0x08020000, +0x00020208,0x00000008,0x08020008,0x00020200}, +{ +0x00802001,0x00002081,0x00002081,0x00000080, +0x00802080,0x00800081,0x00800001,0x00002001, +0x00000000,0x00802000,0x00802000,0x00802081, +0x00000081,0x00000000,0x00800080,0x00800001, +0x00000001,0x00002000,0x00800000,0x00802001, +0x00000080,0x00800000,0x00002001,0x00002080, +0x00800081,0x00000001,0x00002080,0x00800080, +0x00002000,0x00802080,0x00802081,0x00000081, +0x00800080,0x00800001,0x00802000,0x00802081, +0x00000081,0x00000000,0x00000000,0x00802000, +0x00002080,0x00800080,0x00800081,0x00000001, +0x00802001,0x00002081,0x00002081,0x00000080, +0x00802081,0x00000081,0x00000001,0x00002000, +0x00800001,0x00002001,0x00802080,0x00800081, +0x00002001,0x00002080,0x00800000,0x00802001, +0x00000080,0x00800000,0x00002000,0x00802080}, +{ +0x00000100,0x02080100,0x02080000,0x42000100, +0x00080000,0x00000100,0x40000000,0x02080000, +0x40080100,0x00080000,0x02000100,0x40080100, +0x42000100,0x42080000,0x00080100,0x40000000, +0x02000000,0x40080000,0x40080000,0x00000000, +0x40000100,0x42080100,0x42080100,0x02000100, +0x42080000,0x40000100,0x00000000,0x42000000, +0x02080100,0x02000000,0x42000000,0x00080100, +0x00080000,0x42000100,0x00000100,0x02000000, +0x40000000,0x02080000,0x42000100,0x40080100, +0x02000100,0x40000000,0x42080000,0x02080100, +0x40080100,0x00000100,0x02000000,0x42080000, +0x42080100,0x00080100,0x42000000,0x42080100, +0x02080000,0x00000000,0x40080000,0x42000000, +0x00080100,0x02000100,0x40000100,0x00080000, +0x00000000,0x40080000,0x02080100,0x40000100}, +{ +0x20000010,0x20400000,0x00004000,0x20404010, +0x20400000,0x00000010,0x20404010,0x00400000, +0x20004000,0x00404010,0x00400000,0x20000010, +0x00400010,0x20004000,0x20000000,0x00004010, +0x00000000,0x00400010,0x20004010,0x00004000, +0x00404000,0x20004010,0x00000010,0x20400010, +0x20400010,0x00000000,0x00404010,0x20404000, +0x00004010,0x00404000,0x20404000,0x20000000, +0x20004000,0x00000010,0x20400010,0x00404000, +0x20404010,0x00400000,0x00004010,0x20000010, +0x00400000,0x20004000,0x20000000,0x00004010, +0x20000010,0x20404010,0x00404000,0x20400000, +0x00404010,0x20404000,0x00000000,0x20400010, +0x00000010,0x00004000,0x20400000,0x00404010, +0x00004000,0x00400010,0x20004010,0x00000000, +0x20404000,0x20000000,0x00400010,0x20004010}, +{ +0x00200000,0x04200002,0x04000802,0x00000000, +0x00000800,0x04000802,0x00200802,0x04200800, +0x04200802,0x00200000,0x00000000,0x04000002, +0x00000002,0x04000000,0x04200002,0x00000802, +0x04000800,0x00200802,0x00200002,0x04000800, +0x04000002,0x04200000,0x04200800,0x00200002, +0x04200000,0x00000800,0x00000802,0x04200802, +0x00200800,0x00000002,0x04000000,0x00200800, +0x04000000,0x00200800,0x00200000,0x04000802, +0x04000802,0x04200002,0x04200002,0x00000002, +0x00200002,0x04000000,0x04000800,0x00200000, +0x04200800,0x00000802,0x00200802,0x04200800, +0x00000802,0x04000002,0x04200802,0x04200000, +0x00200800,0x00000000,0x00000002,0x04200802, +0x00000000,0x00200802,0x04200000,0x00000800, +0x04000002,0x04000800,0x00000800,0x00200002}, +{ +0x10001040,0x00001000,0x00040000,0x10041040, +0x10000000,0x10001040,0x00000040,0x10000000, +0x00040040,0x10040000,0x10041040,0x00041000, +0x10041000,0x00041040,0x00001000,0x00000040, +0x10040000,0x10000040,0x10001000,0x00001040, +0x00041000,0x00040040,0x10040040,0x10041000, +0x00001040,0x00000000,0x00000000,0x10040040, +0x10000040,0x10001000,0x00041040,0x00040000, +0x00041040,0x00040000,0x10041000,0x00001000, +0x00000040,0x10040040,0x00001000,0x00041040, +0x10001000,0x00000040,0x10000040,0x10040000, +0x10040040,0x10000000,0x00040000,0x10001040, +0x00000000,0x10041040,0x00040040,0x10000040, +0x10040000,0x10001000,0x10001040,0x00000000, +0x10041040,0x00041000,0x00041000,0x00001040, +0x00001040,0x00040040,0x10000000,0x10041000} +}; + + +void BasicDES::SetKey(const byte* key, word32 /*length*/, CipherDir dir) +{ + byte buffer[56+56+8]; + byte *const pc1m = buffer; /* place to modify pc1 into */ + byte *const pcr = pc1m + 56; /* place to rotate pc1 into */ + byte *const ks = pcr + 56; + register int i,j,l; + int m; + + for (j = 0; j < 56; j++) { /* convert pc1 to bits of key */ + l = pc1[j] - 1; /* integer bit location */ + m = l & 07; /* find bit */ + pc1m[j] = (key[l >> 3] & /* find which key byte l is in */ + bytebit[m]) /* and which bit of that byte */ + ? 1 : 0; /* and store 1-bit result */ + } + for (i = 0; i < 16; i++) { /* key chunk for each iteration */ + memset(ks, 0, 8); /* Clear key schedule */ + for (j = 0; j < 56; j++) /* rotate pc1 the right amount */ + pcr[j] = pc1m[(l = j + totrot[i]) < (j < 28 ? 28 : 56) ? l: l-28]; + /* rotate left and right halves independently */ + for (j = 0; j < 48; j++){ /* select bits individually */ + /* check bit that goes to ks[j] */ + if (pcr[pc2[j] - 1]){ + /* mask it in if it's there */ + l= j % 6; + ks[j/6] |= bytebit[l] >> 2; + } + } + /* Now convert to odd/even interleaved form for use in F */ + k_[2*i] = ((word32)ks[0] << 24) + | ((word32)ks[2] << 16) + | ((word32)ks[4] << 8) + | ((word32)ks[6]); + k_[2*i + 1] = ((word32)ks[1] << 24) + | ((word32)ks[3] << 16) + | ((word32)ks[5] << 8) + | ((word32)ks[7]); + } + + // reverse key schedule order + if (dir == DECRYPTION) + for (i = 0; i < 16; i += 2) { + STL::swap(k_[i], k_[32 - 2 - i]); + STL::swap(k_[i+1], k_[32 - 1 - i]); + } + +} + +static inline void IPERM(word32& left, word32& right) +{ + word32 work; + + right = rotlFixed(right, 4U); + work = (left ^ right) & 0xf0f0f0f0; + left ^= work; + + right = rotrFixed(right^work, 20U); + work = (left ^ right) & 0xffff0000; + left ^= work; + + right = rotrFixed(right^work, 18U); + work = (left ^ right) & 0x33333333; + left ^= work; + + right = rotrFixed(right^work, 6U); + work = (left ^ right) & 0x00ff00ff; + left ^= work; + + right = rotlFixed(right^work, 9U); + work = (left ^ right) & 0xaaaaaaaa; + left = rotlFixed(left^work, 1U); + right ^= work; +} + +static inline void FPERM(word32& left, word32& right) +{ + word32 work; + + right = rotrFixed(right, 1U); + work = (left ^ right) & 0xaaaaaaaa; + right ^= work; + left = rotrFixed(left^work, 9U); + work = (left ^ right) & 0x00ff00ff; + right ^= work; + left = rotlFixed(left^work, 6U); + work = (left ^ right) & 0x33333333; + right ^= work; + left = rotlFixed(left^work, 18U); + work = (left ^ right) & 0xffff0000; + right ^= work; + left = rotlFixed(left^work, 20U); + work = (left ^ right) & 0xf0f0f0f0; + right ^= work; + left = rotrFixed(left^work, 4U); +} + + +void BasicDES::RawProcessBlock(word32& lIn, word32& rIn) const +{ + word32 l = lIn, r = rIn; + const word32* kptr = k_; + + for (unsigned i=0; i<8; i++) + { + word32 work = rotrFixed(r, 4U) ^ kptr[4*i+0]; + l ^= Spbox[6][(work) & 0x3f] + ^ Spbox[4][(work >> 8) & 0x3f] + ^ Spbox[2][(work >> 16) & 0x3f] + ^ Spbox[0][(work >> 24) & 0x3f]; + work = r ^ kptr[4*i+1]; + l ^= Spbox[7][(work) & 0x3f] + ^ Spbox[5][(work >> 8) & 0x3f] + ^ Spbox[3][(work >> 16) & 0x3f] + ^ Spbox[1][(work >> 24) & 0x3f]; + + work = rotrFixed(l, 4U) ^ kptr[4*i+2]; + r ^= Spbox[6][(work) & 0x3f] + ^ Spbox[4][(work >> 8) & 0x3f] + ^ Spbox[2][(work >> 16) & 0x3f] + ^ Spbox[0][(work >> 24) & 0x3f]; + work = l ^ kptr[4*i+3]; + r ^= Spbox[7][(work) & 0x3f] + ^ Spbox[5][(work >> 8) & 0x3f] + ^ Spbox[3][(work >> 16) & 0x3f] + ^ Spbox[1][(work >> 24) & 0x3f]; + } + + lIn = l; rIn = r; +} + + + +typedef BlockGetAndPut Block; + + +void DES::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) const +{ + word32 l,r; + Block::Get(in)(l)(r); + IPERM(l,r); + + RawProcessBlock(l, r); + + FPERM(l,r); + Block::Put(xOr, out)(r)(l); +} + + +void DES_EDE2::SetKey(const byte* key, word32 sz, CipherDir dir) +{ + des1_.SetKey(key, sz, dir); + des2_.SetKey(key + 8, sz, ReverseDir(dir)); +} + + +void DES_EDE2::ProcessAndXorBlock(const byte* in, const byte* xOr, + byte* out) const +{ + word32 l,r; + Block::Get(in)(l)(r); + IPERM(l,r); + + des1_.RawProcessBlock(l, r); + des2_.RawProcessBlock(r, l); + des1_.RawProcessBlock(l, r); + + FPERM(l,r); + Block::Put(xOr, out)(r)(l); +} + + +void DES_EDE3::SetKey(const byte* key, word32 sz, CipherDir dir) +{ + des1_.SetKey(key+(dir==ENCRYPTION?0:2*8), sz, dir); + des2_.SetKey(key+8, sz, ReverseDir(dir)); + des3_.SetKey(key+(dir==DECRYPTION?0:2*8), sz, dir); +} + + + +#if defined(DO_DES_ASM) + +// ia32 optimized version +void DES_EDE3::Process(byte* out, const byte* in, word32 sz) +{ + if (!isMMX) { + Mode_BASE::Process(out, in, sz); + return; + } + + word32 blocks = sz / DES_BLOCK_SIZE; + + if (mode_ == CBC) + if (dir_ == ENCRYPTION) + while (blocks--) { + r_[0] ^= *(word32*)in; + r_[1] ^= *(word32*)(in + 4); + + AsmProcess((byte*)r_, (byte*)r_, (void*)Spbox); + + memcpy(out, r_, DES_BLOCK_SIZE); + + in += DES_BLOCK_SIZE; + out += DES_BLOCK_SIZE; + } + else + while (blocks--) { + AsmProcess(in, out, (void*)Spbox); + + *(word32*)out ^= r_[0]; + *(word32*)(out + 4) ^= r_[1]; + + memcpy(r_, in, DES_BLOCK_SIZE); + + out += DES_BLOCK_SIZE; + in += DES_BLOCK_SIZE; + } + else + while (blocks--) { + AsmProcess(in, out, (void*)Spbox); + + out += DES_BLOCK_SIZE; + in += DES_BLOCK_SIZE; + } +} + +#endif // DO_DES_ASM + + +void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, + byte* out) const +{ + word32 l,r; + Block::Get(in)(l)(r); + IPERM(l,r); + + des1_.RawProcessBlock(l, r); + des2_.RawProcessBlock(r, l); + des3_.RawProcessBlock(l, r); + + FPERM(l,r); + Block::Put(xOr, out)(r)(l); +} + + +#if defined(DO_DES_ASM) + +/* Uses IPERM algorithm from above + + left is in eax + right is in ebx + + uses ecx +*/ +#define AsmIPERM() {\ + AS2( rol ebx, 4 ) \ + AS2( mov ecx, eax ) \ + AS2( xor ecx, ebx ) \ + AS2( and ecx, 0xf0f0f0f0 ) \ + AS2( xor ebx, ecx ) \ + AS2( xor eax, ecx ) \ + AS2( ror ebx, 20 ) \ + AS2( mov ecx, eax ) \ + AS2( xor ecx, ebx ) \ + AS2( and ecx, 0xffff0000 ) \ + AS2( xor ebx, ecx ) \ + AS2( xor eax, ecx ) \ + AS2( ror ebx, 18 ) \ + AS2( mov ecx, eax ) \ + AS2( xor ecx, ebx ) \ + AS2( and ecx, 0x33333333 ) \ + AS2( xor ebx, ecx ) \ + AS2( xor eax, ecx ) \ + AS2( ror ebx, 6 ) \ + AS2( mov ecx, eax ) \ + AS2( xor ecx, ebx ) \ + AS2( and ecx, 0x00ff00ff ) \ + AS2( xor ebx, ecx ) \ + AS2( xor eax, ecx ) \ + AS2( rol ebx, 9 ) \ + AS2( mov ecx, eax ) \ + AS2( xor ecx, ebx ) \ + AS2( and ecx, 0xaaaaaaaa ) \ + AS2( xor eax, ecx ) \ + AS2( rol eax, 1 ) \ + AS2( xor ebx, ecx ) } + + +/* Uses FPERM algorithm from above + + left is in eax + right is in ebx + + uses ecx +*/ +#define AsmFPERM() {\ + AS2( ror ebx, 1 ) \ + AS2( mov ecx, eax ) \ + AS2( xor ecx, ebx ) \ + AS2( and ecx, 0xaaaaaaaa ) \ + AS2( xor eax, ecx ) \ + AS2( xor ebx, ecx ) \ + AS2( ror eax, 9 ) \ + AS2( mov ecx, ebx ) \ + AS2( xor ecx, eax ) \ + AS2( and ecx, 0x00ff00ff ) \ + AS2( xor eax, ecx ) \ + AS2( xor ebx, ecx ) \ + AS2( rol eax, 6 ) \ + AS2( mov ecx, ebx ) \ + AS2( xor ecx, eax ) \ + AS2( and ecx, 0x33333333 ) \ + AS2( xor eax, ecx ) \ + AS2( xor ebx, ecx ) \ + AS2( rol eax, 18 ) \ + AS2( mov ecx, ebx ) \ + AS2( xor ecx, eax ) \ + AS2( and ecx, 0xffff0000 ) \ + AS2( xor eax, ecx ) \ + AS2( xor ebx, ecx ) \ + AS2( rol eax, 20 ) \ + AS2( mov ecx, ebx ) \ + AS2( xor ecx, eax ) \ + AS2( and ecx, 0xf0f0f0f0 ) \ + AS2( xor eax, ecx ) \ + AS2( xor ebx, ecx ) \ + AS2( ror eax, 4 ) } + + + + +/* DesRound implements this algorithm: + + word32 work = rotrFixed(r, 4U) ^ key[0]; + l ^= Spbox[6][(work) & 0x3f] + ^ Spbox[4][(work >> 8) & 0x3f] + ^ Spbox[2][(work >> 16) & 0x3f] + ^ Spbox[0][(work >> 24) & 0x3f]; + work = r ^ key[1]; + l ^= Spbox[7][(work) & 0x3f] + ^ Spbox[5][(work >> 8) & 0x3f] + ^ Spbox[3][(work >> 16) & 0x3f] + ^ Spbox[1][(work >> 24) & 0x3f]; + + work = rotrFixed(l, 4U) ^ key[2]; + r ^= Spbox[6][(work) & 0x3f] + ^ Spbox[4][(work >> 8) & 0x3f] + ^ Spbox[2][(work >> 16) & 0x3f] + ^ Spbox[0][(work >> 24) & 0x3f]; + work = l ^ key[3]; + r ^= Spbox[7][(work) & 0x3f] + ^ Spbox[5][(work >> 8) & 0x3f] + ^ Spbox[3][(work >> 16) & 0x3f] + ^ Spbox[1][(work >> 24) & 0x3f]; + + left is in aex + right is in ebx + key is in edx + + edvances key for next round + + uses ecx, esi, and edi +*/ +#define DesRound() \ + AS2( mov ecx, ebx )\ + AS2( mov esi, DWORD PTR [edx] )\ + AS2( ror ecx, 4 )\ + AS2( xor ecx, esi )\ + AS2( and ecx, 0x3f3f3f3f )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor eax, [ebp + esi*4 + 6*256] )\ + AS2( shr ecx, 16 )\ + AS2( xor eax, [ebp + edi*4 + 4*256] )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor eax, [ebp + esi*4 + 2*256] )\ + AS2( mov esi, DWORD PTR [edx + 4] )\ + AS2( xor eax, [ebp + edi*4] )\ + AS2( mov ecx, ebx )\ + AS2( xor ecx, esi )\ + AS2( and ecx, 0x3f3f3f3f )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor eax, [ebp + esi*4 + 7*256] )\ + AS2( shr ecx, 16 )\ + AS2( xor eax, [ebp + edi*4 + 5*256] )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor eax, [ebp + esi*4 + 3*256] )\ + AS2( mov esi, DWORD PTR [edx + 8] )\ + AS2( xor eax, [ebp + edi*4 + 1*256] )\ + AS2( mov ecx, eax )\ + AS2( ror ecx, 4 )\ + AS2( xor ecx, esi )\ + AS2( and ecx, 0x3f3f3f3f )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor ebx, [ebp + esi*4 + 6*256] )\ + AS2( shr ecx, 16 )\ + AS2( xor ebx, [ebp + edi*4 + 4*256] )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor ebx, [ebp + esi*4 + 2*256] )\ + AS2( mov esi, DWORD PTR [edx + 12] )\ + AS2( xor ebx, [ebp + edi*4] )\ + AS2( mov ecx, eax )\ + AS2( xor ecx, esi )\ + AS2( and ecx, 0x3f3f3f3f )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor ebx, [ebp + esi*4 + 7*256] )\ + AS2( shr ecx, 16 )\ + AS2( xor ebx, [ebp + edi*4 + 5*256] )\ + AS2( movzx esi, cl )\ + AS2( movzx edi, ch )\ + AS2( xor ebx, [ebp + esi*4 + 3*256] )\ + AS2( add edx, 16 )\ + AS2( xor ebx, [ebp + edi*4 + 1*256] ) + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void DES_EDE3::AsmProcess(const byte* in, byte* out, void* box) const +{ +#ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + asm(".intel_syntax noprefix"); + + #define PROLOG() \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edx, DWORD PTR [ebp + 8] ) \ + AS2( mov esi, DWORD PTR [ebp + 12] ) \ + AS2( mov ebp, DWORD PTR [ebp + 20] ) + + // ebp restored at end + #define EPILOG() \ + AS2( movd edi, mm3 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd esi, mm5 ) \ + AS1( emms ) \ + asm(".att_syntax"); + +#else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov esi, DWORD PTR [ebp + 8] ) \ + AS2( mov edx, ecx ) \ + AS2( mov ebp, DWORD PTR [ebp + 16] ) + + // ebp restored at end + #define EPILOG() \ + AS2( movd edi, mm3 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd esi, mm5 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 12 ) + +#endif + + + PROLOG() + + AS2( movd mm2, edx ) + + #ifdef OLD_GCC_OFFSET + AS2( add edx, 60 ) // des1 = des1 key + #else + AS2( add edx, 56 ) // des1 = des1 key + #endif + + AS2( mov eax, DWORD PTR [esi] ) + AS2( mov ebx, DWORD PTR [esi + 4] ) + AS1( bswap eax ) // left + AS1( bswap ebx ) // right + + AsmIPERM() + + DesRound() // 1 + DesRound() // 2 + DesRound() // 3 + DesRound() // 4 + DesRound() // 5 + DesRound() // 6 + DesRound() // 7 + DesRound() // 8 + + // swap left and right + AS2( xchg eax, ebx ) + + DesRound() // 1 + DesRound() // 2 + DesRound() // 3 + DesRound() // 4 + DesRound() // 5 + DesRound() // 6 + DesRound() // 7 + DesRound() // 8 + + // swap left and right + AS2( xchg eax, ebx ) + + DesRound() // 1 + DesRound() // 2 + DesRound() // 3 + DesRound() // 4 + DesRound() // 5 + DesRound() // 6 + DesRound() // 7 + DesRound() // 8 + + AsmFPERM() + + //end + AS2( movd ebp, mm6 ) + + // swap and write out + AS1( bswap ebx ) + AS1( bswap eax ) + +#ifdef __GNUC__ + AS2( mov esi, DWORD PTR [ebp + 16] ) // outBlock +#else + AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock +#endif + + AS2( mov DWORD PTR [esi], ebx ) // right first + AS2( mov DWORD PTR [esi + 4], eax ) + + + EPILOG() +} + + + +#endif // defined(DO_DES_ASM) + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/dh.cpp b/externals/mysql/extlib/yassl/taocrypt/src/dh.cpp new file mode 100644 index 00000000000..d6a61cfb1f3 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/dh.cpp @@ -0,0 +1,103 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* dh.cpp implements Diffie-Hellman support +*/ + +#include "runtime.hpp" +#include "dh.hpp" +#include "asn.hpp" +#include + +namespace TaoCrypt { + + +namespace { // locals + +unsigned int DiscreteLogWorkFactor(unsigned int n) +{ + // assuming discrete log takes about the same time as factoring + if (n<5) + return 0; + else + return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * + pow(log(double(n)), 2.0/3.0) - 5); +} + +} // namespace locals + + +// Generate a DH Key Pair +void DH::GenerateKeyPair(RandomNumberGenerator& rng, byte* priv, byte* pub) +{ + GeneratePrivate(rng, priv); + GeneratePublic(priv, pub); +} + + +// Generate private value +void DH::GeneratePrivate(RandomNumberGenerator& rng, byte* priv) +{ + Integer x(rng, Integer::One(), min(p_ - 1, + Integer::Power2(2*DiscreteLogWorkFactor(p_.BitCount())) ) ); + x.Encode(priv, p_.ByteCount()); +} + + +// Generate public value +void DH::GeneratePublic(const byte* priv, byte* pub) +{ + const word32 bc(p_.ByteCount()); + Integer x(priv, bc); + Integer y(a_exp_b_mod_c(g_, x, p_)); + y.Encode(pub, bc); +} + + +// Generate Agreement +void DH::Agree(byte* agree, const byte* priv, const byte* otherPub, word32 + otherSz) +{ + const word32 bc(p_.ByteCount()); + Integer x(priv, bc); + Integer y; + if (otherSz) + y.Decode(otherPub, otherSz); + else + y.Decode(otherPub, bc); + + Integer z(a_exp_b_mod_c(y, x, p_)); + z.Encode(agree, bc); +} + + +DH::DH(Source& source) +{ + Initialize(source); +} + + +void DH::Initialize(Source& source) +{ + DH_Decoder decoder(source); + decoder.Decode(*this); +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/dsa.cpp b/externals/mysql/extlib/yassl/taocrypt/src/dsa.cpp new file mode 100644 index 00000000000..79ee91e76f9 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/dsa.cpp @@ -0,0 +1,271 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +#include "runtime.hpp" +#include "dsa.hpp" +#include "sha.hpp" +#include "asn.hpp" +#include "modarith.hpp" + + +namespace TaoCrypt { + + +void DSA_PublicKey::Swap(DSA_PublicKey& other) +{ + p_.Swap(other.p_); + q_.Swap(other.q_); + g_.Swap(other.g_); + y_.Swap(other.y_); +} + + +DSA_PublicKey::DSA_PublicKey(const DSA_PublicKey& other) + : p_(other.p_), q_(other.q_), g_(other.g_), y_(other.y_) +{} + + +DSA_PublicKey& DSA_PublicKey::operator=(const DSA_PublicKey& that) +{ + DSA_PublicKey tmp(that); + Swap(tmp); + return *this; +} + + +DSA_PublicKey::DSA_PublicKey(Source& source) +{ + Initialize(source); +} + + +void DSA_PublicKey::Initialize(Source& source) +{ + DSA_Public_Decoder decoder(source); + decoder.Decode(*this); +} + + +void DSA_PublicKey::Initialize(const Integer& p, const Integer& q, + const Integer& g, const Integer& y) +{ + p_ = p; + q_ = q; + g_ = g; + y_ = y; +} + + +const Integer& DSA_PublicKey::GetModulus() const +{ + return p_; +} + +const Integer& DSA_PublicKey::GetSubGroupOrder() const +{ + return q_; +} + + +const Integer& DSA_PublicKey::GetSubGroupGenerator() const +{ + return g_; +} + + +const Integer& DSA_PublicKey::GetPublicPart() const +{ + return y_; +} + + +void DSA_PublicKey::SetModulus(const Integer& p) +{ + p_ = p; +} + + +void DSA_PublicKey::SetSubGroupOrder(const Integer& q) +{ + q_ = q; +} + + +void DSA_PublicKey::SetSubGroupGenerator(const Integer& g) +{ + g_ = g; +} + + +void DSA_PublicKey::SetPublicPart(const Integer& y) +{ + y_ = y; +} + + +word32 DSA_PublicKey::SignatureLength() const +{ + return GetSubGroupOrder().ByteCount() * 2; // r and s +} + + + +DSA_PrivateKey::DSA_PrivateKey(Source& source) +{ + Initialize(source); +} + + +void DSA_PrivateKey::Initialize(Source& source) +{ + DSA_Private_Decoder decoder(source); + decoder.Decode(*this); +} + + +void DSA_PrivateKey::Initialize(const Integer& p, const Integer& q, + const Integer& g, const Integer& y, + const Integer& x) +{ + DSA_PublicKey::Initialize(p, q, g, y); + x_ = x; +} + + +const Integer& DSA_PrivateKey::GetPrivatePart() const +{ + return x_; +} + + +void DSA_PrivateKey::SetPrivatePart(const Integer& x) +{ + x_ = x; +} + + +DSA_Signer::DSA_Signer(const DSA_PrivateKey& key) + : key_(key) +{} + + +word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig, + RandomNumberGenerator& rng) +{ + const Integer& p = key_.GetModulus(); + const Integer& q = key_.GetSubGroupOrder(); + const Integer& g = key_.GetSubGroupGenerator(); + const Integer& x = key_.GetPrivatePart(); + + Integer k(rng, 1, q - 1); + + r_ = a_exp_b_mod_c(g, k, p); + r_ %= q; + + Integer H(sha_digest, SHA::DIGEST_SIZE); // sha Hash(m) + + Integer kInv = k.InverseMod(q); + s_ = (kInv * (H + x*r_)) % q; + + assert(!!r_ && !!s_); + + int rSz = r_.ByteCount(); + + if (rSz == 19) { + sig[0] = 0; + sig++; + } + + r_.Encode(sig, rSz); + + int sSz = s_.ByteCount(); + + if (sSz == 19) { + sig[rSz] = 0; + sig++; + } + + s_.Encode(sig + rSz, sSz); + + return 40; +} + + +DSA_Verifier::DSA_Verifier(const DSA_PublicKey& key) + : key_(key) +{} + + +bool DSA_Verifier::Verify(const byte* sha_digest, const byte* sig) +{ + const Integer& p = key_.GetModulus(); + const Integer& q = key_.GetSubGroupOrder(); + const Integer& g = key_.GetSubGroupGenerator(); + const Integer& y = key_.GetPublicPart(); + + int sz = q.ByteCount(); + + r_.Decode(sig, sz); + s_.Decode(sig + sz, sz); + + if (r_ >= q || r_ < 1 || s_ >= q || s_ < 1) + return false; + + Integer H(sha_digest, SHA::DIGEST_SIZE); // sha Hash(m) + + Integer w = s_.InverseMod(q); + Integer u1 = (H * w) % q; + Integer u2 = (r_ * w) % q; + + // verify r == ((g^u1 * y^u2) mod p) mod q + ModularArithmetic ma(p); + Integer v = ma.CascadeExponentiate(g, u1, y, u2); + v %= q; + + return r_ == v; +} + + + + +const Integer& DSA_Signer::GetR() const +{ + return r_; +} + + +const Integer& DSA_Signer::GetS() const +{ + return s_; +} + + +const Integer& DSA_Verifier::GetR() const +{ + return r_; +} + + +const Integer& DSA_Verifier::GetS() const +{ + return s_; +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/file.cpp b/externals/mysql/extlib/yassl/taocrypt/src/file.cpp new file mode 100644 index 00000000000..0498038a04b --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/file.cpp @@ -0,0 +1,115 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* file.cpp implements File Sources and Sinks +*/ + +#include "runtime.hpp" +#include "file.hpp" + + +namespace TaoCrypt { + + +FileSource::FileSource(const char* fname, Source& source) +{ + file_ = fopen(fname, "rb"); + if (file_) get(source); +} + + +FileSource::~FileSource() +{ + if (file_) + fclose(file_); +} + + + +// return size of source from beginning or current position +word32 FileSource::size(bool use_current) +{ + long current = ftell(file_); + long begin = current; + + if (!use_current) { + fseek(file_, 0, SEEK_SET); + begin = ftell(file_); + } + + fseek(file_, 0, SEEK_END); + long end = ftell(file_); + + fseek(file_, current, SEEK_SET); + + return end - begin; +} + + +word32 FileSource::size_left() +{ + return size(true); +} + + +// fill file source from source +word32 FileSource::get(Source& source) +{ + word32 sz(size()); + if (source.size() < sz) + source.grow(sz); + + size_t bytes = fread(source.buffer_.get_buffer(), 1, sz, file_); + + if (bytes == 1) + return sz; + else + return 0; +} + + +FileSink::FileSink(const char* fname, Source& source) +{ + file_ = fopen(fname, "wb"); + if (file_) put(source); +} + + +FileSink::~FileSink() +{ + if (file_) + fclose(file_); +} + + +// fill source from file sink +void FileSink::put(Source& source) +{ + fwrite(source.get_buffer(), 1, source.size(), file_); +} + + +// swap with other and reset to beginning +void Source::reset(ByteBlock& otherBlock) +{ + buffer_.Swap(otherBlock); + current_ = 0; +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/hash.cpp b/externals/mysql/extlib/yassl/taocrypt/src/hash.cpp new file mode 100644 index 00000000000..c51dc42a909 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/hash.cpp @@ -0,0 +1,196 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* hash.cpp implements a base for digest types +*/ + +#include "runtime.hpp" +#include +#include + +#include "hash.hpp" + + +namespace TaoCrypt { + + +HASHwithTransform::HASHwithTransform(word32 digSz, word32 buffSz) +{ + assert(digSz <= MaxDigestSz); + assert(buffSz <= MaxBufferSz); +} + + +void HASHwithTransform::AddLength(word32 len) +{ + HashLengthType tmp = loLen_; + if ( (loLen_ += len) < tmp) + hiLen_++; // carry low to high + hiLen_ += SafeRightShift<8*sizeof(HashLengthType)>(len); +} + + +// Update digest with data of size len, do in blocks +void HASHwithTransform::Update(const byte* data, word32 len) +{ + // do block size increments + word32 blockSz = getBlockSize(); + byte* local = reinterpret_cast(buffer_); + + while (len) { + word32 add = min(len, blockSz - buffLen_); + memcpy(&local[buffLen_], data, add); + + buffLen_ += add; + data += add; + len -= add; + + if (buffLen_ == blockSz) { + ByteReverseIf(local, local, blockSz, getByteOrder()); + Transform(); + AddLength(blockSz); + buffLen_ = 0; + } + } +} + + +// Final process, place digest in hash +void HASHwithTransform::Final(byte* hash) +{ + word32 blockSz = getBlockSize(); + word32 digestSz = getDigestSize(); + word32 padSz = getPadSize(); + ByteOrder order = getByteOrder(); + + AddLength(buffLen_); // before adding pads + HashLengthType preLoLen = GetBitCountLo(); + HashLengthType preHiLen = GetBitCountHi(); + byte* local = reinterpret_cast(buffer_); + + local[buffLen_++] = 0x80; // add 1 + + // pad with zeros + if (buffLen_ > padSz) { + memset(&local[buffLen_], 0, blockSz - buffLen_); + buffLen_ += blockSz - buffLen_; + + ByteReverseIf(local, local, blockSz, order); + Transform(); + buffLen_ = 0; + } + memset(&local[buffLen_], 0, padSz - buffLen_); + + ByteReverseIf(local, local, blockSz, order); + + memcpy(&local[padSz], order ? &preHiLen : &preLoLen, sizeof(preLoLen)); + memcpy(&local[padSz+4], order ? &preLoLen : &preHiLen, sizeof(preLoLen)); + + Transform(); + ByteReverseIf(digest_, digest_, digestSz, order); + memcpy(hash, digest_, digestSz); + + Init(); // reset state +} + + +#ifdef WORD64_AVAILABLE + +HASH64withTransform::HASH64withTransform(word32 digSz, word32 buffSz) +{ + assert(digSz <= MaxDigestSz); + assert(buffSz <= MaxBufferSz); +} + + +void HASH64withTransform::AddLength(word32 len) +{ + HashLengthType tmp = loLen_; + if ( (loLen_ += len) < tmp) + hiLen_++; // carry low to high + hiLen_ += SafeRightShift<8*sizeof(HashLengthType)>(len); +} + + +// Update digest with data of size len, do in blocks +void HASH64withTransform::Update(const byte* data, word32 len) +{ + // do block size increments + word32 blockSz = getBlockSize(); + byte* local = reinterpret_cast(buffer_); + + while (len) { + word32 add = min(len, blockSz - buffLen_); + memcpy(&local[buffLen_], data, add); + + buffLen_ += add; + data += add; + len -= add; + + if (buffLen_ == blockSz) { + ByteReverseIf(buffer_, buffer_, blockSz, getByteOrder()); + Transform(); + AddLength(blockSz); + buffLen_ = 0; + } + } +} + + +// Final process, place digest in hash +void HASH64withTransform::Final(byte* hash) +{ + word32 blockSz = getBlockSize(); + word32 digestSz = getDigestSize(); + word32 padSz = getPadSize(); + ByteOrder order = getByteOrder(); + + AddLength(buffLen_); // before adding pads + HashLengthType preLoLen = GetBitCountLo(); + HashLengthType preHiLen = GetBitCountHi(); + byte* local = reinterpret_cast(buffer_); + + local[buffLen_++] = 0x80; // add 1 + + // pad with zeros + if (buffLen_ > padSz) { + memset(&local[buffLen_], 0, blockSz - buffLen_); + buffLen_ += blockSz - buffLen_; + + ByteReverseIf(buffer_, buffer_, blockSz, order); + Transform(); + buffLen_ = 0; + } + memset(&local[buffLen_], 0, padSz - buffLen_); + + ByteReverseIf(buffer_, buffer_, padSz, order); + + buffer_[blockSz / sizeof(word64) - 2] = order ? preHiLen : preLoLen; + buffer_[blockSz / sizeof(word64) - 1] = order ? preLoLen : preHiLen; + + Transform(); + ByteReverseIf(digest_, digest_, digestSz, order); + memcpy(hash, digest_, digestSz); + + Init(); // reset state +} + +#endif // WORD64_AVAILABLE + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/integer.cpp b/externals/mysql/extlib/yassl/taocrypt/src/integer.cpp new file mode 100644 index 00000000000..85733b88aa9 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/integer.cpp @@ -0,0 +1,3964 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + + +/* based on Wei Dai's integer.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "integer.hpp" +#include "modarith.hpp" +#include "asn.hpp" + + + +#ifdef __DECCXX + #include // for asm overflow assembly +#endif + +#if defined(_M_X64) || defined(_M_IA64) + #include +#pragma intrinsic(_umul128) +#endif + + +#ifdef __GNUC__ + #include + #include +#endif + + +#ifdef SSE2_INTRINSICS_AVAILABLE + #ifdef __GNUC__ + #include + #ifdef TAOCRYPT_MEMALIGN_AVAILABLE + #include + #else + #include + #endif + #else + #include + #endif +#elif defined(_MSC_VER) && defined(_M_IX86) + #pragma message("You do not seem to have the Visual C++ Processor Pack ") + #pragma message("installed, so use of SSE2 intrinsics will be disabled.") +#elif defined(__GNUC__) && defined(__i386__) +/* #warning You do not have GCC 3.3 or later, or did not specify the -msse2 \ + compiler option. Use of SSE2 intrinsics will be disabled. +*/ +#endif + + +namespace TaoCrypt { + + +#ifdef SSE2_INTRINSICS_AVAILABLE + +template +CPP_TYPENAME AlignedAllocator::pointer AlignedAllocator::allocate( + size_type n, const void *) +{ + CheckSize(n); + if (n == 0) + return 0; + if (n >= 4) + { + void* p; + #ifdef TAOCRYPT_MM_MALLOC_AVAILABLE + p = _mm_malloc(sizeof(T)*n, 16); + #elif defined(TAOCRYPT_MEMALIGN_AVAILABLE) + p = memalign(16, sizeof(T)*n); + #elif defined(TAOCRYPT_MALLOC_ALIGNMENT_IS_16) + p = malloc(sizeof(T)*n); + #else + p = (byte *)malloc(sizeof(T)*n + 8); + // assume malloc alignment is at least 8 + #endif + + #ifdef TAOCRYPT_NO_ALIGNED_ALLOC + assert(m_pBlock == 0); + m_pBlock = p; + if (!IsAlignedOn(p, 16)) + { + assert(IsAlignedOn(p, 8)); + p = (byte *)p + 8; + } + #endif + + assert(IsAlignedOn(p, 16)); + return (T*)p; + } + return NEW_TC T[n]; +} + + +template +void AlignedAllocator::deallocate(void* p, size_type n) +{ + memset(p, 0, n*sizeof(T)); + if (n >= 4) + { + #ifdef TAOCRYPT_MM_MALLOC_AVAILABLE + _mm_free(p); + #elif defined(TAOCRYPT_NO_ALIGNED_ALLOC) + assert(m_pBlock == p || (byte*)m_pBlock+8 == p); + free(m_pBlock); + m_pBlock = 0; + #else + free(p); + #endif + } + else + tcArrayDelete((T *)p); +} + +#endif // SSE2 + + +// ******** start of integer needs + +// start 5.2.1 adds DWord and Word ******** + +// ******************************************************** + +class DWord { +public: +DWord() {} + +#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + explicit DWord(word low) + { + whole_ = low; + } +#else + explicit DWord(word low) + { + halfs_.low = low; + halfs_.high = 0; + } +#endif + + DWord(word low, word high) + { + halfs_.low = low; + halfs_.high = high; + } + + static DWord Multiply(word a, word b) + { + DWord r; + + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + r.whole_ = (dword)a * b; + + #elif defined(_M_X64) || defined(_M_IA64) + r.halfs_.low = _umul128(a, b, &r.halfs_.high); + + #elif defined(__alpha__) + r.halfs_.low = a*b; + #ifdef __GNUC__ + __asm__("umulh %1,%2,%0" : "=r" (r.halfs_.high) + : "r" (a), "r" (b)); + #elif defined(__DECCXX) + r.halfs_.high = asm("umulh %a0, %a1, %v0", a, b); + #else + #error unknown alpha compiler + #endif + + #elif defined(__ia64__) + r.halfs_.low = a*b; + __asm__("xmpy.hu %0=%1,%2" : "=f" (r.halfs_.high) + : "f" (a), "f" (b)); + + #elif defined(_ARCH_PPC64) + r.halfs_.low = a*b; + __asm__("mulhdu %0,%1,%2" : "=r" (r.halfs_.high) + : "r" (a), "r" (b) : "cc"); + + #elif defined(__x86_64__) + __asm__("mulq %3" : "=d" (r.halfs_.high), "=a" (r.halfs_.low) : + "a" (a), "rm" (b) : "cc"); + + #elif defined(__mips64) + __asm__("dmultu %2,%3" : "=h" (r.halfs_.high), "=l" (r.halfs_.low) + : "r" (a), "r" (b)); + + #elif defined(_M_IX86) + // for testing + word64 t = (word64)a * b; + r.halfs_.high = ((word32 *)(&t))[1]; + r.halfs_.low = (word32)t; + #else + #error can not implement DWord + #endif + + return r; + } + + static DWord MultiplyAndAdd(word a, word b, word c) + { + DWord r = Multiply(a, b); + return r += c; + } + + DWord & operator+=(word a) + { + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + whole_ = whole_ + a; + #else + halfs_.low += a; + halfs_.high += (halfs_.low < a); + #endif + return *this; + } + + DWord operator+(word a) + { + DWord r; + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + r.whole_ = whole_ + a; + #else + r.halfs_.low = halfs_.low + a; + r.halfs_.high = halfs_.high + (r.halfs_.low < a); + #endif + return r; + } + + DWord operator-(DWord a) + { + DWord r; + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + r.whole_ = whole_ - a.whole_; + #else + r.halfs_.low = halfs_.low - a.halfs_.low; + r.halfs_.high = halfs_.high - a.halfs_.high - + (r.halfs_.low > halfs_.low); + #endif + return r; + } + + DWord operator-(word a) + { + DWord r; + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + r.whole_ = whole_ - a; + #else + r.halfs_.low = halfs_.low - a; + r.halfs_.high = halfs_.high - (r.halfs_.low > halfs_.low); + #endif + return r; + } + + // returns quotient, which must fit in a word + word operator/(word divisor); + + word operator%(word a); + + bool operator!() const + { + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + return !whole_; + #else + return !halfs_.high && !halfs_.low; + #endif + } + + word GetLowHalf() const {return halfs_.low;} + word GetHighHalf() const {return halfs_.high;} + word GetHighHalfAsBorrow() const {return 0-halfs_.high;} + +private: + union + { + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + dword whole_; + #endif + struct + { + #ifdef LITTLE_ENDIAN_ORDER + word low; + word high; + #else + word high; + word low; + #endif + } halfs_; + }; +}; + + +class Word { +public: + Word() {} + + Word(word value) + { + whole_ = value; + } + + Word(hword low, hword high) + { + whole_ = low | (word(high) << (WORD_BITS/2)); + } + + static Word Multiply(hword a, hword b) + { + Word r; + r.whole_ = (word)a * b; + return r; + } + + Word operator-(Word a) + { + Word r; + r.whole_ = whole_ - a.whole_; + return r; + } + + Word operator-(hword a) + { + Word r; + r.whole_ = whole_ - a; + return r; + } + + // returns quotient, which must fit in a word + hword operator/(hword divisor) + { + return hword(whole_ / divisor); + } + + bool operator!() const + { + return !whole_; + } + + word GetWhole() const {return whole_;} + hword GetLowHalf() const {return hword(whole_);} + hword GetHighHalf() const {return hword(whole_>>(WORD_BITS/2));} + hword GetHighHalfAsBorrow() const {return 0-hword(whole_>>(WORD_BITS/2));} + +private: + word whole_; +}; + + +// dummy is VC60 compiler bug workaround +// do a 3 word by 2 word divide, returns quotient and leaves remainder in A +template +S DivideThreeWordsByTwo(S* A, S B0, S B1, D* dummy_VC6_WorkAround = 0) +{ + // assert {A[2],A[1]} < {B1,B0}, so quotient can fit in a S + assert(A[2] < B1 || (A[2]==B1 && A[1] < B0)); + + // estimate the quotient: do a 2 S by 1 S divide + S Q; + if (S(B1+1) == 0) + Q = A[2]; + else + Q = D(A[1], A[2]) / S(B1+1); + + // now subtract Q*B from A + D p = D::Multiply(B0, Q); + D u = (D) A[0] - p.GetLowHalf(); + A[0] = u.GetLowHalf(); + u = (D) A[1] - p.GetHighHalf() - u.GetHighHalfAsBorrow() - + D::Multiply(B1, Q); + A[1] = u.GetLowHalf(); + A[2] += u.GetHighHalf(); + + // Q <= actual quotient, so fix it + while (A[2] || A[1] > B1 || (A[1]==B1 && A[0]>=B0)) + { + u = (D) A[0] - B0; + A[0] = u.GetLowHalf(); + u = (D) A[1] - B1 - u.GetHighHalfAsBorrow(); + A[1] = u.GetLowHalf(); + A[2] += u.GetHighHalf(); + Q++; + assert(Q); // shouldn't overflow + } + + return Q; +} + + +// do a 4 word by 2 word divide, returns 2 word quotient in Q0 and Q1 +template +inline D DivideFourWordsByTwo(S *T, const D &Al, const D &Ah, const D &B) +{ + if (!B) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) + return D(Ah.GetLowHalf(), Ah.GetHighHalf()); + else + { + S Q[2]; + T[0] = Al.GetLowHalf(); + T[1] = Al.GetHighHalf(); + T[2] = Ah.GetLowHalf(); + T[3] = Ah.GetHighHalf(); + Q[1] = DivideThreeWordsByTwo(T+1, B.GetLowHalf(), + B.GetHighHalf()); + Q[0] = DivideThreeWordsByTwo(T, B.GetLowHalf(), B.GetHighHalf()); + return D(Q[0], Q[1]); + } +} + + +// returns quotient, which must fit in a word +inline word DWord::operator/(word a) +{ + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + return word(whole_ / a); + #else + hword r[4]; + return DivideFourWordsByTwo(r, halfs_.low, + halfs_.high, a).GetWhole(); + #endif +} + +inline word DWord::operator%(word a) +{ + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + return word(whole_ % a); + #else + if (a < (word(1) << (WORD_BITS/2))) + { + hword h = hword(a); + word r = halfs_.high % h; + r = ((halfs_.low >> (WORD_BITS/2)) + (r << (WORD_BITS/2))) % h; + return hword((hword(halfs_.low) + (r << (WORD_BITS/2))) % h); + } + else + { + hword r[4]; + DivideFourWordsByTwo(r, halfs_.low, halfs_.high, a); + return Word(r[0], r[1]).GetWhole(); + } + #endif +} + + + +// end 5.2.1 DWord and Word adds + + + + + +static const unsigned int RoundupSizeTable[] = {2, 2, 2, 4, 4, 8, 8, 8, 8}; + +static inline unsigned int RoundupSize(unsigned int n) +{ + if (n<=8) + return RoundupSizeTable[n]; + else if (n<=16) + return 16; + else if (n<=32) + return 32; + else if (n<=64) + return 64; + else return 1U << BitPrecision(n-1); +} + + +static int Compare(const word *A, const word *B, unsigned int N) +{ + while (N--) + if (A[N] > B[N]) + return 1; + else if (A[N] < B[N]) + return -1; + + return 0; +} + +static word Increment(word *A, unsigned int N, word B=1) +{ + assert(N); + word t = A[0]; + A[0] = t+B; + if (A[0] >= t) + return 0; + for (unsigned i=1; i= A0) + if (B0 >= B1) + { + s = 0; + d = (dword)(A1-A0)*(B0-B1); + } + else + { + s = (A1-A0); + d = (dword)s*(word)(B0-B1); + } + else + if (B0 > B1) + { + s = (B0-B1); + d = (word)(A1-A0)*(dword)s; + } + else + { + s = 0; + d = (dword)(A0-A1)*(B1-B0); + } +*/ + // this segment is the branchless equivalent of above + word D[4] = {A[1]-A[0], A[0]-A[1], B[0]-B[1], B[1]-B[0]}; + unsigned int ai = A[1] < A[0]; + unsigned int bi = B[0] < B[1]; + unsigned int di = ai & bi; + DWord d = DWord::Multiply(D[di], D[di+2]); + D[1] = D[3] = 0; + unsigned int si = ai + !bi; + word s = D[si]; + + DWord A0B0 = DWord::Multiply(A[0], B[0]); + C[0] = A0B0.GetLowHalf(); + + DWord A1B1 = DWord::Multiply(A[1], B[1]); + DWord t = (DWord) A0B0.GetHighHalf() + A0B0.GetLowHalf() + d.GetLowHalf() + + A1B1.GetLowHalf(); + C[1] = t.GetLowHalf(); + + t = A1B1 + t.GetHighHalf() + A0B0.GetHighHalf() + d.GetHighHalf() + + A1B1.GetHighHalf() - s; + C[2] = t.GetLowHalf(); + C[3] = t.GetHighHalf(); +} + +void Portable::Multiply2Bottom(word *C, const word *A, const word *B) +{ + DWord t = DWord::Multiply(A[0], B[0]); + C[0] = t.GetLowHalf(); + C[1] = t.GetHighHalf() + A[0]*B[1] + A[1]*B[0]; +} + +word Portable::Multiply2Add(word *C, const word *A, const word *B) +{ + word D[4] = {A[1]-A[0], A[0]-A[1], B[0]-B[1], B[1]-B[0]}; + unsigned int ai = A[1] < A[0]; + unsigned int bi = B[0] < B[1]; + unsigned int di = ai & bi; + DWord d = DWord::Multiply(D[di], D[di+2]); + D[1] = D[3] = 0; + unsigned int si = ai + !bi; + word s = D[si]; + + DWord A0B0 = DWord::Multiply(A[0], B[0]); + DWord t = A0B0 + C[0]; + C[0] = t.GetLowHalf(); + + DWord A1B1 = DWord::Multiply(A[1], B[1]); + t = (DWord) t.GetHighHalf() + A0B0.GetLowHalf() + d.GetLowHalf() + + A1B1.GetLowHalf() + C[1]; + C[1] = t.GetLowHalf(); + + t = (DWord) t.GetHighHalf() + A1B1.GetLowHalf() + A0B0.GetHighHalf() + + d.GetHighHalf() + A1B1.GetHighHalf() - s + C[2]; + C[2] = t.GetLowHalf(); + + t = (DWord) t.GetHighHalf() + A1B1.GetHighHalf() + C[3]; + C[3] = t.GetLowHalf(); + return t.GetHighHalf(); +} + + +#define MulAcc(x, y) \ + p = DWord::MultiplyAndAdd(A[x], B[y], c); \ + c = p.GetLowHalf(); \ + p = (DWord) d + p.GetHighHalf(); \ + d = p.GetLowHalf(); \ + e += p.GetHighHalf(); + +#define SaveMulAcc(s, x, y) \ + R[s] = c; \ + p = DWord::MultiplyAndAdd(A[x], B[y], d); \ + c = p.GetLowHalf(); \ + p = (DWord) e + p.GetHighHalf(); \ + d = p.GetLowHalf(); \ + e = p.GetHighHalf(); + +#define SquAcc(x, y) \ + q = DWord::Multiply(A[x], A[y]); \ + p = q + c; \ + c = p.GetLowHalf(); \ + p = (DWord) d + p.GetHighHalf(); \ + d = p.GetLowHalf(); \ + e += p.GetHighHalf(); \ + p = q + c; \ + c = p.GetLowHalf(); \ + p = (DWord) d + p.GetHighHalf(); \ + d = p.GetLowHalf(); \ + e += p.GetHighHalf(); + +#define SaveSquAcc(s, x, y) \ + R[s] = c; \ + q = DWord::Multiply(A[x], A[y]); \ + p = q + d; \ + c = p.GetLowHalf(); \ + p = (DWord) e + p.GetHighHalf(); \ + d = p.GetLowHalf(); \ + e = p.GetHighHalf(); \ + p = q + c; \ + c = p.GetLowHalf(); \ + p = (DWord) d + p.GetHighHalf(); \ + d = p.GetLowHalf(); \ + e += p.GetHighHalf(); + + +void Portable::Multiply4(word *R, const word *A, const word *B) +{ + DWord p; + word c, d, e; + + p = DWord::Multiply(A[0], B[0]); + R[0] = p.GetLowHalf(); + c = p.GetHighHalf(); + d = e = 0; + + MulAcc(0, 1); + MulAcc(1, 0); + + SaveMulAcc(1, 2, 0); + MulAcc(1, 1); + MulAcc(0, 2); + + SaveMulAcc(2, 0, 3); + MulAcc(1, 2); + MulAcc(2, 1); + MulAcc(3, 0); + + SaveMulAcc(3, 3, 1); + MulAcc(2, 2); + MulAcc(1, 3); + + SaveMulAcc(4, 2, 3); + MulAcc(3, 2); + + R[5] = c; + p = DWord::MultiplyAndAdd(A[3], B[3], d); + R[6] = p.GetLowHalf(); + R[7] = e + p.GetHighHalf(); +} + +void Portable::Square2(word *R, const word *A) +{ + DWord p, q; + word c, d, e; + + p = DWord::Multiply(A[0], A[0]); + R[0] = p.GetLowHalf(); + c = p.GetHighHalf(); + d = e = 0; + + SquAcc(0, 1); + + R[1] = c; + p = DWord::MultiplyAndAdd(A[1], A[1], d); + R[2] = p.GetLowHalf(); + R[3] = e + p.GetHighHalf(); +} + +void Portable::Square4(word *R, const word *A) +{ +#ifdef _MSC_VER + // VC60 workaround: MSVC 6.0 has an optimization bug that makes + // (dword)A*B where either A or B has been cast to a dword before + // very expensive. Revisit this function when this + // bug is fixed. + Multiply4(R, A, A); +#else + const word *B = A; + DWord p, q; + word c, d, e; + + p = DWord::Multiply(A[0], A[0]); + R[0] = p.GetLowHalf(); + c = p.GetHighHalf(); + d = e = 0; + + SquAcc(0, 1); + + SaveSquAcc(1, 2, 0); + MulAcc(1, 1); + + SaveSquAcc(2, 0, 3); + SquAcc(1, 2); + + SaveSquAcc(3, 3, 1); + MulAcc(2, 2); + + SaveSquAcc(4, 2, 3); + + R[5] = c; + p = DWord::MultiplyAndAdd(A[3], A[3], d); + R[6] = p.GetLowHalf(); + R[7] = e + p.GetHighHalf(); +#endif +} + +void Portable::Multiply8(word *R, const word *A, const word *B) +{ + DWord p; + word c, d, e; + + p = DWord::Multiply(A[0], B[0]); + R[0] = p.GetLowHalf(); + c = p.GetHighHalf(); + d = e = 0; + + MulAcc(0, 1); + MulAcc(1, 0); + + SaveMulAcc(1, 2, 0); + MulAcc(1, 1); + MulAcc(0, 2); + + SaveMulAcc(2, 0, 3); + MulAcc(1, 2); + MulAcc(2, 1); + MulAcc(3, 0); + + SaveMulAcc(3, 0, 4); + MulAcc(1, 3); + MulAcc(2, 2); + MulAcc(3, 1); + MulAcc(4, 0); + + SaveMulAcc(4, 0, 5); + MulAcc(1, 4); + MulAcc(2, 3); + MulAcc(3, 2); + MulAcc(4, 1); + MulAcc(5, 0); + + SaveMulAcc(5, 0, 6); + MulAcc(1, 5); + MulAcc(2, 4); + MulAcc(3, 3); + MulAcc(4, 2); + MulAcc(5, 1); + MulAcc(6, 0); + + SaveMulAcc(6, 0, 7); + MulAcc(1, 6); + MulAcc(2, 5); + MulAcc(3, 4); + MulAcc(4, 3); + MulAcc(5, 2); + MulAcc(6, 1); + MulAcc(7, 0); + + SaveMulAcc(7, 1, 7); + MulAcc(2, 6); + MulAcc(3, 5); + MulAcc(4, 4); + MulAcc(5, 3); + MulAcc(6, 2); + MulAcc(7, 1); + + SaveMulAcc(8, 2, 7); + MulAcc(3, 6); + MulAcc(4, 5); + MulAcc(5, 4); + MulAcc(6, 3); + MulAcc(7, 2); + + SaveMulAcc(9, 3, 7); + MulAcc(4, 6); + MulAcc(5, 5); + MulAcc(6, 4); + MulAcc(7, 3); + + SaveMulAcc(10, 4, 7); + MulAcc(5, 6); + MulAcc(6, 5); + MulAcc(7, 4); + + SaveMulAcc(11, 5, 7); + MulAcc(6, 6); + MulAcc(7, 5); + + SaveMulAcc(12, 6, 7); + MulAcc(7, 6); + + R[13] = c; + p = DWord::MultiplyAndAdd(A[7], B[7], d); + R[14] = p.GetLowHalf(); + R[15] = e + p.GetHighHalf(); +} + +void Portable::Multiply4Bottom(word *R, const word *A, const word *B) +{ + DWord p; + word c, d, e; + + p = DWord::Multiply(A[0], B[0]); + R[0] = p.GetLowHalf(); + c = p.GetHighHalf(); + d = e = 0; + + MulAcc(0, 1); + MulAcc(1, 0); + + SaveMulAcc(1, 2, 0); + MulAcc(1, 1); + MulAcc(0, 2); + + R[2] = c; + R[3] = d + A[0] * B[3] + A[1] * B[2] + A[2] * B[1] + A[3] * B[0]; +} + +void Portable::Multiply8Bottom(word *R, const word *A, const word *B) +{ + DWord p; + word c, d, e; + + p = DWord::Multiply(A[0], B[0]); + R[0] = p.GetLowHalf(); + c = p.GetHighHalf(); + d = e = 0; + + MulAcc(0, 1); + MulAcc(1, 0); + + SaveMulAcc(1, 2, 0); + MulAcc(1, 1); + MulAcc(0, 2); + + SaveMulAcc(2, 0, 3); + MulAcc(1, 2); + MulAcc(2, 1); + MulAcc(3, 0); + + SaveMulAcc(3, 0, 4); + MulAcc(1, 3); + MulAcc(2, 2); + MulAcc(3, 1); + MulAcc(4, 0); + + SaveMulAcc(4, 0, 5); + MulAcc(1, 4); + MulAcc(2, 3); + MulAcc(3, 2); + MulAcc(4, 1); + MulAcc(5, 0); + + SaveMulAcc(5, 0, 6); + MulAcc(1, 5); + MulAcc(2, 4); + MulAcc(3, 3); + MulAcc(4, 2); + MulAcc(5, 1); + MulAcc(6, 0); + + R[6] = c; + R[7] = d + A[0] * B[7] + A[1] * B[6] + A[2] * B[5] + A[3] * B[4] + + A[4] * B[3] + A[5] * B[2] + A[6] * B[1] + A[7] * B[0]; +} + + +#undef MulAcc +#undef SaveMulAcc +#undef SquAcc +#undef SaveSquAcc + +// optimized + +#ifdef TAOCRYPT_X86ASM_AVAILABLE + +// ************** x86 feature detection *************** + + +#ifdef SSE2_INTRINSICS_AVAILABLE + +#ifndef _MSC_VER + static jmp_buf s_env; + static void SigIllHandler(int) + { + longjmp(s_env, 1); + } +#endif + +static bool HasSSE2() +{ + if (!IsPentium()) + return false; + + word32 cpuid[4]; + CpuId(1, cpuid); + if ((cpuid[3] & (1 << 26)) == 0) + return false; + +#ifdef _MSC_VER + __try + { + __asm xorpd xmm0, xmm0 // executing SSE2 instruction + } + __except (1) + { + return false; + } + return true; +#else + typedef void (*SigHandler)(int); + + SigHandler oldHandler = signal(SIGILL, SigIllHandler); + if (oldHandler == SIG_ERR) + return false; + + bool result = true; + if (setjmp(s_env)) + result = false; + else + __asm __volatile ("xorpd %xmm0, %xmm0"); + + signal(SIGILL, oldHandler); + return result; +#endif +} +#endif // SSE2_INTRINSICS_AVAILABLE + + +static bool IsP4() +{ + if (!IsPentium()) + return false; + + word32 cpuid[4]; + + CpuId(1, cpuid); + return ((cpuid[0] >> 8) & 0xf) == 0xf; +} + +// ************** Pentium/P4 optimizations *************** + +class PentiumOptimized : public Portable +{ +public: + static word TAOCRYPT_CDECL Add(word *C, const word *A, const word *B, + unsigned int N); + static word TAOCRYPT_CDECL Subtract(word *C, const word *A, const word *B, + unsigned int N); + static void TAOCRYPT_CDECL Multiply4(word *C, const word *A, + const word *B); + static void TAOCRYPT_CDECL Multiply8(word *C, const word *A, + const word *B); + static void TAOCRYPT_CDECL Multiply8Bottom(word *C, const word *A, + const word *B); +}; + +class P4Optimized +{ +public: + static word TAOCRYPT_CDECL Add(word *C, const word *A, const word *B, + unsigned int N); + static word TAOCRYPT_CDECL Subtract(word *C, const word *A, const word *B, + unsigned int N); +#ifdef SSE2_INTRINSICS_AVAILABLE + static void TAOCRYPT_CDECL Multiply4(word *C, const word *A, + const word *B); + static void TAOCRYPT_CDECL Multiply8(word *C, const word *A, + const word *B); + static void TAOCRYPT_CDECL Multiply8Bottom(word *C, const word *A, + const word *B); +#endif +}; + +typedef word (TAOCRYPT_CDECL * PAddSub)(word *C, const word *A, const word *B, + unsigned int N); +typedef void (TAOCRYPT_CDECL * PMul)(word *C, const word *A, const word *B); + +static PAddSub s_pAdd, s_pSub; +#ifdef SSE2_INTRINSICS_AVAILABLE +static PMul s_pMul4, s_pMul8, s_pMul8B; +#endif + +static void SetPentiumFunctionPointers() +{ + if (!IsPentium()) + { + s_pAdd = &Portable::Add; + s_pSub = &Portable::Subtract; + } + else if (IsP4()) + { + s_pAdd = &P4Optimized::Add; + s_pSub = &P4Optimized::Subtract; + } + else + { + s_pAdd = &PentiumOptimized::Add; + s_pSub = &PentiumOptimized::Subtract; + } + +#ifdef SSE2_INTRINSICS_AVAILABLE + if (!IsPentium()) + { + s_pMul4 = &Portable::Multiply4; + s_pMul8 = &Portable::Multiply8; + s_pMul8B = &Portable::Multiply8Bottom; + } + else if (HasSSE2()) + { + s_pMul4 = &P4Optimized::Multiply4; + s_pMul8 = &P4Optimized::Multiply8; + s_pMul8B = &P4Optimized::Multiply8Bottom; + } + else + { + s_pMul4 = &PentiumOptimized::Multiply4; + s_pMul8 = &PentiumOptimized::Multiply8; + s_pMul8B = &PentiumOptimized::Multiply8Bottom; + } +#endif +} + +static const char s_RunAtStartupSetPentiumFunctionPointers = + (SetPentiumFunctionPointers(), 0); + + +class LowLevel : public PentiumOptimized +{ +public: + inline static word Add(word *C, const word *A, const word *B, + unsigned int N) + {return s_pAdd(C, A, B, N);} + inline static word Subtract(word *C, const word *A, const word *B, + unsigned int N) + {return s_pSub(C, A, B, N);} + inline static void Square4(word *R, const word *A) + {Multiply4(R, A, A);} +#ifdef SSE2_INTRINSICS_AVAILABLE + inline static void Multiply4(word *C, const word *A, const word *B) + {s_pMul4(C, A, B);} + inline static void Multiply8(word *C, const word *A, const word *B) + {s_pMul8(C, A, B);} + inline static void Multiply8Bottom(word *C, const word *A, const word *B) + {s_pMul8B(C, A, B);} +#endif +}; + +// use some tricks to share assembly code between MSVC and GCC +#ifdef _MSC_VER + #define TAOCRYPT_NAKED __declspec(naked) + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + #define AddPrologue \ + __asm push ebp \ + __asm push ebx \ + __asm push esi \ + __asm push edi \ + __asm mov ecx, [esp+20] \ + __asm mov edx, [esp+24] \ + __asm mov ebx, [esp+28] \ + __asm mov esi, [esp+32] + #define AddEpilogue \ + __asm pop edi \ + __asm pop esi \ + __asm pop ebx \ + __asm pop ebp \ + __asm ret + #define MulPrologue \ + __asm push ebp \ + __asm push ebx \ + __asm push esi \ + __asm push edi \ + __asm mov ecx, [esp+28] \ + __asm mov esi, [esp+24] \ + __asm push [esp+20] + #define MulEpilogue \ + __asm add esp, 4 \ + __asm pop edi \ + __asm pop esi \ + __asm pop ebx \ + __asm pop ebp \ + __asm ret +#else + #define TAOCRYPT_NAKED + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" + #define AddPrologue \ + __asm__ __volatile__ \ + ( \ + "push %%ebx;" /* save this manually, in case of -fPIC */ \ + "mov %2, %%ebx;" \ + ".intel_syntax noprefix;" \ + "push ebp;" + #define AddEpilogue \ + "pop ebp;" \ + ".att_syntax prefix;" \ + "pop %%ebx;" \ + : \ + : "c" (C), "d" (A), "m" (B), "S" (N) \ + : "%edi", "memory", "cc" \ + ); + #define MulPrologue \ + __asm__ __volatile__ \ + ( \ + "push %%ebx;" /* save this manually, in case of -fPIC */ \ + "push %%ebp;" \ + "push %0;" \ + ".intel_syntax noprefix;" + #define MulEpilogue \ + "add esp, 4;" \ + "pop ebp;" \ + "pop ebx;" \ + ".att_syntax prefix;" \ + : \ + : "rm" (Z), "S" (X), "c" (Y) \ + : "%eax", "%edx", "%edi", "memory", "cc" \ + ); +#endif + +TAOCRYPT_NAKED word PentiumOptimized::Add(word *C, const word *A, + const word *B, unsigned int N) +{ + AddPrologue + + // now: ebx = B, ecx = C, edx = A, esi = N + AS2( sub ecx, edx) // hold the distance between C & A so we + // can add this to A to get C + AS2( xor eax, eax) // clear eax + + AS2( sub eax, esi) // eax is a negative index from end of B + AS2( lea ebx, [ebx+4*esi]) // ebx is end of B + + AS2( sar eax, 1) // unit of eax is now dwords; this also + // clears the carry flag + AS1( jz loopendAdd) // if no dwords then nothing to do + + AS1(loopstartAdd:) + AS2( mov esi,[edx]) // load lower word of A + AS2( mov ebp,[edx+4]) // load higher word of A + + AS2( mov edi,[ebx+8*eax]) // load lower word of B + AS2( lea edx,[edx+8]) // advance A and C + + AS2( adc esi,edi) // add lower words + AS2( mov edi,[ebx+8*eax+4]) // load higher word of B + + AS2( adc ebp,edi) // add higher words + AS1( inc eax) // advance B + + AS2( mov [edx+ecx-8],esi) // store lower word result + AS2( mov [edx+ecx-4],ebp) // store higher word result + + AS1( jnz loopstartAdd) // loop until eax overflows and becomes zero + + AS1(loopendAdd:) + AS2( adc eax, 0) // store carry into eax (return result register) + + AddEpilogue +} + +TAOCRYPT_NAKED word PentiumOptimized::Subtract(word *C, const word *A, + const word *B, unsigned int N) +{ + AddPrologue + + // now: ebx = B, ecx = C, edx = A, esi = N + AS2( sub ecx, edx) // hold the distance between C & A so we + // can add this to A to get C + AS2( xor eax, eax) // clear eax + + AS2( sub eax, esi) // eax is a negative index from end of B + AS2( lea ebx, [ebx+4*esi]) // ebx is end of B + + AS2( sar eax, 1) // unit of eax is now dwords; this also + // clears the carry flag + AS1( jz loopendSub) // if no dwords then nothing to do + + AS1(loopstartSub:) + AS2( mov esi,[edx]) // load lower word of A + AS2( mov ebp,[edx+4]) // load higher word of A + + AS2( mov edi,[ebx+8*eax]) // load lower word of B + AS2( lea edx,[edx+8]) // advance A and C + + AS2( sbb esi,edi) // subtract lower words + AS2( mov edi,[ebx+8*eax+4]) // load higher word of B + + AS2( sbb ebp,edi) // subtract higher words + AS1( inc eax) // advance B + + AS2( mov [edx+ecx-8],esi) // store lower word result + AS2( mov [edx+ecx-4],ebp) // store higher word result + + AS1( jnz loopstartSub) // loop until eax overflows and becomes zero + + AS1(loopendSub:) + AS2( adc eax, 0) // store carry into eax (return result register) + + AddEpilogue +} + +// On Pentium 4, the adc and sbb instructions are very expensive, so avoid them. + +TAOCRYPT_NAKED word P4Optimized::Add(word *C, const word *A, const word *B, + unsigned int N) +{ + AddPrologue + + // now: ebx = B, ecx = C, edx = A, esi = N + AS2( xor eax, eax) + AS1( neg esi) + AS1( jz loopendAddP4) // if no dwords then nothing to do + + AS2( mov edi, [edx]) + AS2( mov ebp, [ebx]) + AS1( jmp carry1AddP4) + + AS1(loopstartAddP4:) + AS2( mov edi, [edx+8]) + AS2( add ecx, 8) + AS2( add edx, 8) + AS2( mov ebp, [ebx]) + AS2( add edi, eax) + AS1( jc carry1AddP4) + AS2( xor eax, eax) + + AS1(carry1AddP4:) + AS2( add edi, ebp) + AS2( mov ebp, 1) + AS2( mov [ecx], edi) + AS2( mov edi, [edx+4]) + AS2( cmovc eax, ebp) + AS2( mov ebp, [ebx+4]) + AS2( add ebx, 8) + AS2( add edi, eax) + AS1( jc carry2AddP4) + AS2( xor eax, eax) + + AS1(carry2AddP4:) + AS2( add edi, ebp) + AS2( mov ebp, 1) + AS2( cmovc eax, ebp) + AS2( mov [ecx+4], edi) + AS2( add esi, 2) + AS1( jnz loopstartAddP4) + + AS1(loopendAddP4:) + + AddEpilogue +} + +TAOCRYPT_NAKED word P4Optimized::Subtract(word *C, const word *A, + const word *B, unsigned int N) +{ + AddPrologue + + // now: ebx = B, ecx = C, edx = A, esi = N + AS2( xor eax, eax) + AS1( neg esi) + AS1( jz loopendSubP4) // if no dwords then nothing to do + + AS2( mov edi, [edx]) + AS2( mov ebp, [ebx]) + AS1( jmp carry1SubP4) + + AS1(loopstartSubP4:) + AS2( mov edi, [edx+8]) + AS2( add edx, 8) + AS2( add ecx, 8) + AS2( mov ebp, [ebx]) + AS2( sub edi, eax) + AS1( jc carry1SubP4) + AS2( xor eax, eax) + + AS1(carry1SubP4:) + AS2( sub edi, ebp) + AS2( mov ebp, 1) + AS2( mov [ecx], edi) + AS2( mov edi, [edx+4]) + AS2( cmovc eax, ebp) + AS2( mov ebp, [ebx+4]) + AS2( add ebx, 8) + AS2( sub edi, eax) + AS1( jc carry2SubP4) + AS2( xor eax, eax) + + AS1(carry2SubP4:) + AS2( sub edi, ebp) + AS2( mov ebp, 1) + AS2( cmovc eax, ebp) + AS2( mov [ecx+4], edi) + AS2( add esi, 2) + AS1( jnz loopstartSubP4) + + AS1(loopendSubP4:) + + AddEpilogue +} + +// multiply assembly code originally contributed by Leonard Janke + +#define MulStartup \ + AS2(xor ebp, ebp) \ + AS2(xor edi, edi) \ + AS2(xor ebx, ebx) + +#define MulShiftCarry \ + AS2(mov ebp, edx) \ + AS2(mov edi, ebx) \ + AS2(xor ebx, ebx) + +#define MulAccumulateBottom(i,j) \ + AS2(mov eax, [ecx+4*j]) \ + AS2(imul eax, dword ptr [esi+4*i]) \ + AS2(add ebp, eax) + +#define MulAccumulate(i,j) \ + AS2(mov eax, [ecx+4*j]) \ + AS1(mul dword ptr [esi+4*i]) \ + AS2(add ebp, eax) \ + AS2(adc edi, edx) \ + AS2(adc bl, bh) + +#define MulStoreDigit(i) \ + AS2(mov edx, edi) \ + AS2(mov edi, [esp]) \ + AS2(mov [edi+4*i], ebp) + +#define MulLastDiagonal(digits) \ + AS2(mov eax, [ecx+4*(digits-1)]) \ + AS1(mul dword ptr [esi+4*(digits-1)]) \ + AS2(add ebp, eax) \ + AS2(adc edx, edi) \ + AS2(mov edi, [esp]) \ + AS2(mov [edi+4*(2*digits-2)], ebp) \ + AS2(mov [edi+4*(2*digits-1)], edx) + +TAOCRYPT_NAKED void PentiumOptimized::Multiply4(word* Z, const word* X, + const word* Y) +{ + MulPrologue + // now: [esp] = Z, esi = X, ecx = Y + MulStartup + MulAccumulate(0,0) + MulStoreDigit(0) + MulShiftCarry + + MulAccumulate(1,0) + MulAccumulate(0,1) + MulStoreDigit(1) + MulShiftCarry + + MulAccumulate(2,0) + MulAccumulate(1,1) + MulAccumulate(0,2) + MulStoreDigit(2) + MulShiftCarry + + MulAccumulate(3,0) + MulAccumulate(2,1) + MulAccumulate(1,2) + MulAccumulate(0,3) + MulStoreDigit(3) + MulShiftCarry + + MulAccumulate(3,1) + MulAccumulate(2,2) + MulAccumulate(1,3) + MulStoreDigit(4) + MulShiftCarry + + MulAccumulate(3,2) + MulAccumulate(2,3) + MulStoreDigit(5) + MulShiftCarry + + MulLastDiagonal(4) + MulEpilogue +} + +TAOCRYPT_NAKED void PentiumOptimized::Multiply8(word* Z, const word* X, + const word* Y) +{ + MulPrologue + // now: [esp] = Z, esi = X, ecx = Y + MulStartup + MulAccumulate(0,0) + MulStoreDigit(0) + MulShiftCarry + + MulAccumulate(1,0) + MulAccumulate(0,1) + MulStoreDigit(1) + MulShiftCarry + + MulAccumulate(2,0) + MulAccumulate(1,1) + MulAccumulate(0,2) + MulStoreDigit(2) + MulShiftCarry + + MulAccumulate(3,0) + MulAccumulate(2,1) + MulAccumulate(1,2) + MulAccumulate(0,3) + MulStoreDigit(3) + MulShiftCarry + + MulAccumulate(4,0) + MulAccumulate(3,1) + MulAccumulate(2,2) + MulAccumulate(1,3) + MulAccumulate(0,4) + MulStoreDigit(4) + MulShiftCarry + + MulAccumulate(5,0) + MulAccumulate(4,1) + MulAccumulate(3,2) + MulAccumulate(2,3) + MulAccumulate(1,4) + MulAccumulate(0,5) + MulStoreDigit(5) + MulShiftCarry + + MulAccumulate(6,0) + MulAccumulate(5,1) + MulAccumulate(4,2) + MulAccumulate(3,3) + MulAccumulate(2,4) + MulAccumulate(1,5) + MulAccumulate(0,6) + MulStoreDigit(6) + MulShiftCarry + + MulAccumulate(7,0) + MulAccumulate(6,1) + MulAccumulate(5,2) + MulAccumulate(4,3) + MulAccumulate(3,4) + MulAccumulate(2,5) + MulAccumulate(1,6) + MulAccumulate(0,7) + MulStoreDigit(7) + MulShiftCarry + + MulAccumulate(7,1) + MulAccumulate(6,2) + MulAccumulate(5,3) + MulAccumulate(4,4) + MulAccumulate(3,5) + MulAccumulate(2,6) + MulAccumulate(1,7) + MulStoreDigit(8) + MulShiftCarry + + MulAccumulate(7,2) + MulAccumulate(6,3) + MulAccumulate(5,4) + MulAccumulate(4,5) + MulAccumulate(3,6) + MulAccumulate(2,7) + MulStoreDigit(9) + MulShiftCarry + + MulAccumulate(7,3) + MulAccumulate(6,4) + MulAccumulate(5,5) + MulAccumulate(4,6) + MulAccumulate(3,7) + MulStoreDigit(10) + MulShiftCarry + + MulAccumulate(7,4) + MulAccumulate(6,5) + MulAccumulate(5,6) + MulAccumulate(4,7) + MulStoreDigit(11) + MulShiftCarry + + MulAccumulate(7,5) + MulAccumulate(6,6) + MulAccumulate(5,7) + MulStoreDigit(12) + MulShiftCarry + + MulAccumulate(7,6) + MulAccumulate(6,7) + MulStoreDigit(13) + MulShiftCarry + + MulLastDiagonal(8) + MulEpilogue +} + +TAOCRYPT_NAKED void PentiumOptimized::Multiply8Bottom(word* Z, const word* X, + const word* Y) +{ + MulPrologue + // now: [esp] = Z, esi = X, ecx = Y + MulStartup + MulAccumulate(0,0) + MulStoreDigit(0) + MulShiftCarry + + MulAccumulate(1,0) + MulAccumulate(0,1) + MulStoreDigit(1) + MulShiftCarry + + MulAccumulate(2,0) + MulAccumulate(1,1) + MulAccumulate(0,2) + MulStoreDigit(2) + MulShiftCarry + + MulAccumulate(3,0) + MulAccumulate(2,1) + MulAccumulate(1,2) + MulAccumulate(0,3) + MulStoreDigit(3) + MulShiftCarry + + MulAccumulate(4,0) + MulAccumulate(3,1) + MulAccumulate(2,2) + MulAccumulate(1,3) + MulAccumulate(0,4) + MulStoreDigit(4) + MulShiftCarry + + MulAccumulate(5,0) + MulAccumulate(4,1) + MulAccumulate(3,2) + MulAccumulate(2,3) + MulAccumulate(1,4) + MulAccumulate(0,5) + MulStoreDigit(5) + MulShiftCarry + + MulAccumulate(6,0) + MulAccumulate(5,1) + MulAccumulate(4,2) + MulAccumulate(3,3) + MulAccumulate(2,4) + MulAccumulate(1,5) + MulAccumulate(0,6) + MulStoreDigit(6) + MulShiftCarry + + MulAccumulateBottom(7,0) + MulAccumulateBottom(6,1) + MulAccumulateBottom(5,2) + MulAccumulateBottom(4,3) + MulAccumulateBottom(3,4) + MulAccumulateBottom(2,5) + MulAccumulateBottom(1,6) + MulAccumulateBottom(0,7) + MulStoreDigit(7) + MulEpilogue +} + +#undef AS1 +#undef AS2 + +#else // not x86 - no processor specific code at this layer + +typedef Portable LowLevel; + +#endif + +#ifdef SSE2_INTRINSICS_AVAILABLE + +#ifdef __GNUC__ +#define TAOCRYPT_FASTCALL +#else +#define TAOCRYPT_FASTCALL __fastcall +#endif + +static void TAOCRYPT_FASTCALL P4_Mul(__m128i *C, const __m128i *A, + const __m128i *B) +{ + __m128i a3210 = _mm_load_si128(A); + __m128i b3210 = _mm_load_si128(B); + + __m128i sum; + + __m128i z = _mm_setzero_si128(); + __m128i a2b2_a0b0 = _mm_mul_epu32(a3210, b3210); + C[0] = a2b2_a0b0; + + __m128i a3120 = _mm_shuffle_epi32(a3210, _MM_SHUFFLE(3, 1, 2, 0)); + __m128i b3021 = _mm_shuffle_epi32(b3210, _MM_SHUFFLE(3, 0, 2, 1)); + __m128i a1b0_a0b1 = _mm_mul_epu32(a3120, b3021); + __m128i a1b0 = _mm_unpackhi_epi32(a1b0_a0b1, z); + __m128i a0b1 = _mm_unpacklo_epi32(a1b0_a0b1, z); + C[1] = _mm_add_epi64(a1b0, a0b1); + + __m128i a31 = _mm_srli_epi64(a3210, 32); + __m128i b31 = _mm_srli_epi64(b3210, 32); + __m128i a3b3_a1b1 = _mm_mul_epu32(a31, b31); + C[6] = a3b3_a1b1; + + __m128i a1b1 = _mm_unpacklo_epi32(a3b3_a1b1, z); + __m128i b3012 = _mm_shuffle_epi32(b3210, _MM_SHUFFLE(3, 0, 1, 2)); + __m128i a2b0_a0b2 = _mm_mul_epu32(a3210, b3012); + __m128i a0b2 = _mm_unpacklo_epi32(a2b0_a0b2, z); + __m128i a2b0 = _mm_unpackhi_epi32(a2b0_a0b2, z); + sum = _mm_add_epi64(a1b1, a0b2); + C[2] = _mm_add_epi64(sum, a2b0); + + __m128i a2301 = _mm_shuffle_epi32(a3210, _MM_SHUFFLE(2, 3, 0, 1)); + __m128i b2103 = _mm_shuffle_epi32(b3210, _MM_SHUFFLE(2, 1, 0, 3)); + __m128i a3b0_a1b2 = _mm_mul_epu32(a2301, b3012); + __m128i a2b1_a0b3 = _mm_mul_epu32(a3210, b2103); + __m128i a3b0 = _mm_unpackhi_epi32(a3b0_a1b2, z); + __m128i a1b2 = _mm_unpacklo_epi32(a3b0_a1b2, z); + __m128i a2b1 = _mm_unpackhi_epi32(a2b1_a0b3, z); + __m128i a0b3 = _mm_unpacklo_epi32(a2b1_a0b3, z); + __m128i sum1 = _mm_add_epi64(a3b0, a1b2); + sum = _mm_add_epi64(a2b1, a0b3); + C[3] = _mm_add_epi64(sum, sum1); + + __m128i a3b1_a1b3 = _mm_mul_epu32(a2301, b2103); + __m128i a2b2 = _mm_unpackhi_epi32(a2b2_a0b0, z); + __m128i a3b1 = _mm_unpackhi_epi32(a3b1_a1b3, z); + __m128i a1b3 = _mm_unpacklo_epi32(a3b1_a1b3, z); + sum = _mm_add_epi64(a2b2, a3b1); + C[4] = _mm_add_epi64(sum, a1b3); + + __m128i a1302 = _mm_shuffle_epi32(a3210, _MM_SHUFFLE(1, 3, 0, 2)); + __m128i b1203 = _mm_shuffle_epi32(b3210, _MM_SHUFFLE(1, 2, 0, 3)); + __m128i a3b2_a2b3 = _mm_mul_epu32(a1302, b1203); + __m128i a3b2 = _mm_unpackhi_epi32(a3b2_a2b3, z); + __m128i a2b3 = _mm_unpacklo_epi32(a3b2_a2b3, z); + C[5] = _mm_add_epi64(a3b2, a2b3); +} + +void P4Optimized::Multiply4(word *C, const word *A, const word *B) +{ + __m128i temp[7]; + const word *w = (word *)temp; + const __m64 *mw = (__m64 *)w; + + P4_Mul(temp, (__m128i *)A, (__m128i *)B); + + C[0] = w[0]; + + __m64 s1, s2; + + __m64 w1 = _mm_cvtsi32_si64(w[1]); + __m64 w4 = mw[2]; + __m64 w6 = mw[3]; + __m64 w8 = mw[4]; + __m64 w10 = mw[5]; + __m64 w12 = mw[6]; + __m64 w14 = mw[7]; + __m64 w16 = mw[8]; + __m64 w18 = mw[9]; + __m64 w20 = mw[10]; + __m64 w22 = mw[11]; + __m64 w26 = _mm_cvtsi32_si64(w[26]); + + s1 = _mm_add_si64(w1, w4); + C[1] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w6, w8); + s1 = _mm_add_si64(s1, s2); + C[2] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w10, w12); + s1 = _mm_add_si64(s1, s2); + C[3] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w14, w16); + s1 = _mm_add_si64(s1, s2); + C[4] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w18, w20); + s1 = _mm_add_si64(s1, s2); + C[5] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w22, w26); + s1 = _mm_add_si64(s1, s2); + C[6] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + C[7] = _mm_cvtsi64_si32(s1) + w[27]; + _mm_empty(); +} + +void P4Optimized::Multiply8(word *C, const word *A, const word *B) +{ + __m128i temp[28]; + const word *w = (word *)temp; + const __m64 *mw = (__m64 *)w; + const word *x = (word *)temp+7*4; + const __m64 *mx = (__m64 *)x; + const word *y = (word *)temp+7*4*2; + const __m64 *my = (__m64 *)y; + const word *z = (word *)temp+7*4*3; + const __m64 *mz = (__m64 *)z; + + P4_Mul(temp, (__m128i *)A, (__m128i *)B); + + P4_Mul(temp+7, (__m128i *)A+1, (__m128i *)B); + + P4_Mul(temp+14, (__m128i *)A, (__m128i *)B+1); + + P4_Mul(temp+21, (__m128i *)A+1, (__m128i *)B+1); + + C[0] = w[0]; + + __m64 s1, s2, s3, s4; + + __m64 w1 = _mm_cvtsi32_si64(w[1]); + __m64 w4 = mw[2]; + __m64 w6 = mw[3]; + __m64 w8 = mw[4]; + __m64 w10 = mw[5]; + __m64 w12 = mw[6]; + __m64 w14 = mw[7]; + __m64 w16 = mw[8]; + __m64 w18 = mw[9]; + __m64 w20 = mw[10]; + __m64 w22 = mw[11]; + __m64 w26 = _mm_cvtsi32_si64(w[26]); + __m64 w27 = _mm_cvtsi32_si64(w[27]); + + __m64 x0 = _mm_cvtsi32_si64(x[0]); + __m64 x1 = _mm_cvtsi32_si64(x[1]); + __m64 x4 = mx[2]; + __m64 x6 = mx[3]; + __m64 x8 = mx[4]; + __m64 x10 = mx[5]; + __m64 x12 = mx[6]; + __m64 x14 = mx[7]; + __m64 x16 = mx[8]; + __m64 x18 = mx[9]; + __m64 x20 = mx[10]; + __m64 x22 = mx[11]; + __m64 x26 = _mm_cvtsi32_si64(x[26]); + __m64 x27 = _mm_cvtsi32_si64(x[27]); + + __m64 y0 = _mm_cvtsi32_si64(y[0]); + __m64 y1 = _mm_cvtsi32_si64(y[1]); + __m64 y4 = my[2]; + __m64 y6 = my[3]; + __m64 y8 = my[4]; + __m64 y10 = my[5]; + __m64 y12 = my[6]; + __m64 y14 = my[7]; + __m64 y16 = my[8]; + __m64 y18 = my[9]; + __m64 y20 = my[10]; + __m64 y22 = my[11]; + __m64 y26 = _mm_cvtsi32_si64(y[26]); + __m64 y27 = _mm_cvtsi32_si64(y[27]); + + __m64 z0 = _mm_cvtsi32_si64(z[0]); + __m64 z1 = _mm_cvtsi32_si64(z[1]); + __m64 z4 = mz[2]; + __m64 z6 = mz[3]; + __m64 z8 = mz[4]; + __m64 z10 = mz[5]; + __m64 z12 = mz[6]; + __m64 z14 = mz[7]; + __m64 z16 = mz[8]; + __m64 z18 = mz[9]; + __m64 z20 = mz[10]; + __m64 z22 = mz[11]; + __m64 z26 = _mm_cvtsi32_si64(z[26]); + + s1 = _mm_add_si64(w1, w4); + C[1] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w6, w8); + s1 = _mm_add_si64(s1, s2); + C[2] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w10, w12); + s1 = _mm_add_si64(s1, s2); + C[3] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x0, y0); + s2 = _mm_add_si64(w14, w16); + s1 = _mm_add_si64(s1, s3); + s1 = _mm_add_si64(s1, s2); + C[4] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x1, y1); + s4 = _mm_add_si64(x4, y4); + s1 = _mm_add_si64(s1, w18); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, w20); + s1 = _mm_add_si64(s1, s3); + C[5] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x6, y6); + s4 = _mm_add_si64(x8, y8); + s1 = _mm_add_si64(s1, w22); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, w26); + s1 = _mm_add_si64(s1, s3); + C[6] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x10, y10); + s4 = _mm_add_si64(x12, y12); + s1 = _mm_add_si64(s1, w27); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, s3); + C[7] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x14, y14); + s4 = _mm_add_si64(x16, y16); + s1 = _mm_add_si64(s1, z0); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, s3); + C[8] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x18, y18); + s4 = _mm_add_si64(x20, y20); + s1 = _mm_add_si64(s1, z1); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, z4); + s1 = _mm_add_si64(s1, s3); + C[9] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x22, y22); + s4 = _mm_add_si64(x26, y26); + s1 = _mm_add_si64(s1, z6); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, z8); + s1 = _mm_add_si64(s1, s3); + C[10] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x27, y27); + s1 = _mm_add_si64(s1, z10); + s1 = _mm_add_si64(s1, z12); + s1 = _mm_add_si64(s1, s3); + C[11] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(z14, z16); + s1 = _mm_add_si64(s1, s3); + C[12] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(z18, z20); + s1 = _mm_add_si64(s1, s3); + C[13] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(z22, z26); + s1 = _mm_add_si64(s1, s3); + C[14] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + C[15] = z[27] + _mm_cvtsi64_si32(s1); + _mm_empty(); +} + +void P4Optimized::Multiply8Bottom(word *C, const word *A, const word *B) +{ + __m128i temp[21]; + const word *w = (word *)temp; + const __m64 *mw = (__m64 *)w; + const word *x = (word *)temp+7*4; + const __m64 *mx = (__m64 *)x; + const word *y = (word *)temp+7*4*2; + const __m64 *my = (__m64 *)y; + + P4_Mul(temp, (__m128i *)A, (__m128i *)B); + + P4_Mul(temp+7, (__m128i *)A+1, (__m128i *)B); + + P4_Mul(temp+14, (__m128i *)A, (__m128i *)B+1); + + C[0] = w[0]; + + __m64 s1, s2, s3, s4; + + __m64 w1 = _mm_cvtsi32_si64(w[1]); + __m64 w4 = mw[2]; + __m64 w6 = mw[3]; + __m64 w8 = mw[4]; + __m64 w10 = mw[5]; + __m64 w12 = mw[6]; + __m64 w14 = mw[7]; + __m64 w16 = mw[8]; + __m64 w18 = mw[9]; + __m64 w20 = mw[10]; + __m64 w22 = mw[11]; + __m64 w26 = _mm_cvtsi32_si64(w[26]); + + __m64 x0 = _mm_cvtsi32_si64(x[0]); + __m64 x1 = _mm_cvtsi32_si64(x[1]); + __m64 x4 = mx[2]; + __m64 x6 = mx[3]; + __m64 x8 = mx[4]; + + __m64 y0 = _mm_cvtsi32_si64(y[0]); + __m64 y1 = _mm_cvtsi32_si64(y[1]); + __m64 y4 = my[2]; + __m64 y6 = my[3]; + __m64 y8 = my[4]; + + s1 = _mm_add_si64(w1, w4); + C[1] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w6, w8); + s1 = _mm_add_si64(s1, s2); + C[2] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s2 = _mm_add_si64(w10, w12); + s1 = _mm_add_si64(s1, s2); + C[3] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x0, y0); + s2 = _mm_add_si64(w14, w16); + s1 = _mm_add_si64(s1, s3); + s1 = _mm_add_si64(s1, s2); + C[4] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x1, y1); + s4 = _mm_add_si64(x4, y4); + s1 = _mm_add_si64(s1, w18); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, w20); + s1 = _mm_add_si64(s1, s3); + C[5] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + s3 = _mm_add_si64(x6, y6); + s4 = _mm_add_si64(x8, y8); + s1 = _mm_add_si64(s1, w22); + s3 = _mm_add_si64(s3, s4); + s1 = _mm_add_si64(s1, w26); + s1 = _mm_add_si64(s1, s3); + C[6] = _mm_cvtsi64_si32(s1); + s1 = _mm_srli_si64(s1, 32); + + C[7] = _mm_cvtsi64_si32(s1) + w[27] + x[10] + y[10] + x[12] + y[12]; + _mm_empty(); +} + +#endif // #ifdef SSE2_INTRINSICS_AVAILABLE + +// end optimized + +// ******************************************************** + +#define A0 A +#define A1 (A+N2) +#define B0 B +#define B1 (B+N2) + +#define T0 T +#define T1 (T+N2) +#define T2 (T+N) +#define T3 (T+N+N2) + +#define R0 R +#define R1 (R+N2) +#define R2 (R+N) +#define R3 (R+N+N2) + +//VC60 workaround: compiler bug triggered without the extra dummy parameters + +// R[2*N] - result = A*B +// T[2*N] - temporary work space +// A[N] --- multiplier +// B[N] --- multiplicant + + +void RecursiveMultiply(word *R, word *T, const word *A, const word *B, + unsigned int N) +{ + assert(N>=2 && N%2==0); + + if (LowLevel::MultiplyRecursionLimit() >= 8 && N==8) + LowLevel::Multiply8(R, A, B); + else if (LowLevel::MultiplyRecursionLimit() >= 4 && N==4) + LowLevel::Multiply4(R, A, B); + else if (N==2) + LowLevel::Multiply2(R, A, B); + else + { + const unsigned int N2 = N/2; + int carry; + + int aComp = Compare(A0, A1, N2); + int bComp = Compare(B0, B1, N2); + + switch (2*aComp + aComp + bComp) + { + case -4: + LowLevel::Subtract(R0, A1, A0, N2); + LowLevel::Subtract(R1, B0, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + LowLevel::Subtract(T1, T1, R0, N2); + carry = -1; + break; + case -2: + LowLevel::Subtract(R0, A1, A0, N2); + LowLevel::Subtract(R1, B0, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + carry = 0; + break; + case 2: + LowLevel::Subtract(R0, A0, A1, N2); + LowLevel::Subtract(R1, B1, B0, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + carry = 0; + break; + case 4: + LowLevel::Subtract(R0, A1, A0, N2); + LowLevel::Subtract(R1, B0, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + LowLevel::Subtract(T1, T1, R1, N2); + carry = -1; + break; + default: + SetWords(T0, 0, N); + carry = 0; + } + + RecursiveMultiply(R0, T2, A0, B0, N2); + RecursiveMultiply(R2, T2, A1, B1, N2); + + // now T[01] holds (A1-A0)*(B0-B1),R[01] holds A0*B0, R[23] holds A1*B1 + + carry += LowLevel::Add(T0, T0, R0, N); + carry += LowLevel::Add(T0, T0, R2, N); + carry += LowLevel::Add(R1, R1, T0, N); + + assert (carry >= 0 && carry <= 2); + Increment(R3, N2, carry); + } +} + + +void RecursiveSquare(word *R, word *T, const word *A, unsigned int N) +{ + assert(N && N%2==0); + if (LowLevel::SquareRecursionLimit() >= 8 && N==8) + LowLevel::Square8(R, A); + if (LowLevel::SquareRecursionLimit() >= 4 && N==4) + LowLevel::Square4(R, A); + else if (N==2) + LowLevel::Square2(R, A); + else + { + const unsigned int N2 = N/2; + + RecursiveSquare(R0, T2, A0, N2); + RecursiveSquare(R2, T2, A1, N2); + RecursiveMultiply(T0, T2, A0, A1, N2); + + word carry = LowLevel::Add(R1, R1, T0, N); + carry += LowLevel::Add(R1, R1, T0, N); + Increment(R3, N2, carry); + } +} + + +// R[N] - bottom half of A*B +// T[N] - temporary work space +// A[N] - multiplier +// B[N] - multiplicant + + +void RecursiveMultiplyBottom(word *R, word *T, const word *A, const word *B, + unsigned int N) +{ + assert(N>=2 && N%2==0); + if (LowLevel::MultiplyBottomRecursionLimit() >= 8 && N==8) + LowLevel::Multiply8Bottom(R, A, B); + else if (LowLevel::MultiplyBottomRecursionLimit() >= 4 && N==4) + LowLevel::Multiply4Bottom(R, A, B); + else if (N==2) + LowLevel::Multiply2Bottom(R, A, B); + else + { + const unsigned int N2 = N/2; + + RecursiveMultiply(R, T, A0, B0, N2); + RecursiveMultiplyBottom(T0, T1, A1, B0, N2); + LowLevel::Add(R1, R1, T0, N2); + RecursiveMultiplyBottom(T0, T1, A0, B1, N2); + LowLevel::Add(R1, R1, T0, N2); + } +} + + +void RecursiveMultiplyTop(word *R, word *T, const word *L, const word *A, + const word *B, unsigned int N) +{ + assert(N>=2 && N%2==0); + + if (N==4) + { + LowLevel::Multiply4(T, A, B); + memcpy(R, T+4, 4*WORD_SIZE); + } + else if (N==2) + { + LowLevel::Multiply2(T, A, B); + memcpy(R, T+2, 2*WORD_SIZE); + } + else + { + const unsigned int N2 = N/2; + int carry; + + int aComp = Compare(A0, A1, N2); + int bComp = Compare(B0, B1, N2); + + switch (2*aComp + aComp + bComp) + { + case -4: + LowLevel::Subtract(R0, A1, A0, N2); + LowLevel::Subtract(R1, B0, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + LowLevel::Subtract(T1, T1, R0, N2); + carry = -1; + break; + case -2: + LowLevel::Subtract(R0, A1, A0, N2); + LowLevel::Subtract(R1, B0, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + carry = 0; + break; + case 2: + LowLevel::Subtract(R0, A0, A1, N2); + LowLevel::Subtract(R1, B1, B0, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + carry = 0; + break; + case 4: + LowLevel::Subtract(R0, A1, A0, N2); + LowLevel::Subtract(R1, B0, B1, N2); + RecursiveMultiply(T0, T2, R0, R1, N2); + LowLevel::Subtract(T1, T1, R1, N2); + carry = -1; + break; + default: + SetWords(T0, 0, N); + carry = 0; + } + + RecursiveMultiply(T2, R0, A1, B1, N2); + + // now T[01] holds (A1-A0)*(B0-B1), T[23] holds A1*B1 + + word c2 = LowLevel::Subtract(R0, L+N2, L, N2); + c2 += LowLevel::Subtract(R0, R0, T0, N2); + word t = (Compare(R0, T2, N2) == -1); + + carry += t; + carry += Increment(R0, N2, c2+t); + carry += LowLevel::Add(R0, R0, T1, N2); + carry += LowLevel::Add(R0, R0, T3, N2); + assert (carry >= 0 && carry <= 2); + + CopyWords(R1, T3, N2); + Increment(R1, N2, carry); + } +} + + +inline word Add(word *C, const word *A, const word *B, unsigned int N) +{ + return LowLevel::Add(C, A, B, N); +} + +inline word Subtract(word *C, const word *A, const word *B, unsigned int N) +{ + return LowLevel::Subtract(C, A, B, N); +} + +inline void Multiply(word *R, word *T, const word *A, const word *B, + unsigned int N) +{ + RecursiveMultiply(R, T, A, B, N); +} + +inline void Square(word *R, word *T, const word *A, unsigned int N) +{ + RecursiveSquare(R, T, A, N); +} + + +void AsymmetricMultiply(word *R, word *T, const word *A, unsigned int NA, + const word *B, unsigned int NB) +{ + if (NA == NB) + { + if (A == B) + Square(R, T, A, NA); + else + Multiply(R, T, A, B, NA); + + return; + } + + if (NA > NB) + { + STL::swap(A, B); + STL::swap(NA, NB); + } + + assert(NB % NA == 0); + assert((NB/NA)%2 == 0); // NB is an even multiple of NA + + if (NA==2 && !A[1]) + { + switch (A[0]) + { + case 0: + SetWords(R, 0, NB+2); + return; + case 1: + CopyWords(R, B, NB); + R[NB] = R[NB+1] = 0; + return; + default: + R[NB] = LinearMultiply(R, B, A[0], NB); + R[NB+1] = 0; + return; + } + } + + Multiply(R, T, A, B, NA); + CopyWords(T+2*NA, R+NA, NA); + + unsigned i; + + for (i=2*NA; i>=1; + i++; + } + k+=i; + + if (t==1 && f[1]==0 && EvenWordCount(f, fgLen)==2) + { + if (s%2==0) + CopyWords(R, b, N); + else + Subtract(R, M, b, N); + return k; + } + + ShiftWordsRightByBits(f, fgLen, i); + t=ShiftWordsLeftByBits(c, bcLen, i); + if (t) + { + c[bcLen] = t; + bcLen+=2; + assert(bcLen <= N); + } + + if (f[fgLen-2]==0 && g[fgLen-2]==0 && f[fgLen-1]==0 && g[fgLen-1]==0) + fgLen-=2; + + if (Compare(f, g, fgLen)==-1) + { + STL::swap(f, g); + STL::swap(b, c); + s++; + } + + Subtract(f, f, g, fgLen); + + if (Add(b, b, c, bcLen)) + { + b[bcLen] = 1; + bcLen+=2; + assert(bcLen <= N); + } + } +} + +// R[N] - result = A/(2^k) mod M +// A[N] - input +// M[N] - modulus + +void DivideByPower2Mod(word *R, const word *A, unsigned int k, const word *M, + unsigned int N) +{ + CopyWords(R, A, N); + + while (k--) + { + if (R[0]%2==0) + ShiftWordsRightByBits(R, N, 1); + else + { + word carry = Add(R, R, M, N); + ShiftWordsRightByBits(R, N, 1); + R[N-1] += carry<<(WORD_BITS-1); + } + } +} + +// R[N] - result = A*(2^k) mod M +// A[N] - input +// M[N] - modulus + +void MultiplyByPower2Mod(word *R, const word *A, unsigned int k, const word *M, + unsigned int N) +{ + CopyWords(R, A, N); + + while (k--) + if (ShiftWordsLeftByBits(R, N, 1) || Compare(R, M, N)>=0) + Subtract(R, R, M, N); +} + + +// ********** end of integer needs + + +Integer::Integer() + : reg_(2), sign_(POSITIVE) +{ + reg_[0] = reg_[1] = 0; +} + + +Integer::Integer(const Integer& t) + : reg_(RoundupSize(t.WordCount())), sign_(t.sign_) +{ + CopyWords(reg_.get_buffer(), t.reg_.get_buffer(), reg_.size()); +} + + +Integer::Integer(signed long value) + : reg_(2) +{ + if (value >= 0) + sign_ = POSITIVE; + else + { + sign_ = NEGATIVE; + value = -value; + } + reg_[0] = word(value); + reg_[1] = word(SafeRightShift(value)); +} + + +Integer::Integer(Sign s, word high, word low) + : reg_(2), sign_(s) +{ + reg_[0] = low; + reg_[1] = high; +} + + +Integer::Integer(word value, unsigned int length) + : reg_(RoundupSize(length)), sign_(POSITIVE) +{ + reg_[0] = value; + SetWords(reg_ + 1, 0, reg_.size() - 1); +} + + +Integer::Integer(const byte *encodedInteger, unsigned int byteCount, + Signedness s) +{ + Decode(encodedInteger, byteCount, s); +} + +class BadBER {}; + +// BER Decode Source +Integer::Integer(Source& source) + : reg_(2), sign_(POSITIVE) +{ + Decode(source); +} + +void Integer::Decode(Source& source) +{ + byte b = source.next(); + if (b != INTEGER) { + source.SetError(INTEGER_E); + return; + } + + word32 length = GetLength(source); + + if ( (b = source.next()) == 0x00) + length--; + else + source.prev(); + + unsigned int words = (length + WORD_SIZE - 1) / WORD_SIZE; + words = RoundupSize(words); + if (words > reg_.size()) reg_.CleanNew(words); + + for (int j = length; j > 0; j--) { + b = source.next(); + reg_ [(j-1) / WORD_SIZE] |= (word)b << ((j-1) % WORD_SIZE) * 8; + } +} + + +void Integer::Decode(const byte* input, unsigned int inputLen, Signedness s) +{ + unsigned int idx(0); + byte b = input[idx++]; + sign_ = ((s==SIGNED) && (b & 0x80)) ? NEGATIVE : POSITIVE; + + while (inputLen>0 && (sign_==POSITIVE ? b==0 : b==0xff)) + { + inputLen--; + b = input[idx++]; + } + + reg_.CleanNew(RoundupSize(BytesToWords(inputLen))); + + --idx; + for (unsigned int i=inputLen; i > 0; i--) + { + b = input[idx++]; + reg_[(i-1)/WORD_SIZE] |= (word)b << ((i-1)%WORD_SIZE)*8; + } + + if (sign_ == NEGATIVE) + { + for (unsigned i=inputLen; i 0; i--) + output[idx++] = GetByte(i-1); + } + else + { + // take two's complement of *this + Integer temp = Integer::Power2(8*max(ByteCount(), outputLen)) + *this; + for (unsigned i=0; i range); + + *this += min; +} + + +Integer Integer::Power2(unsigned int e) +{ + Integer r((word)0, BitsToWords(e + 1)); + r.SetBit(e); + return r; +} + + +void Integer::SetBit(unsigned int n, bool value) +{ + if (value) + { + reg_.CleanGrow(RoundupSize(BitsToWords(n + 1))); + reg_[n / WORD_BITS] |= (word(1) << (n % WORD_BITS)); + } + else + { + if (n / WORD_BITS < reg_.size()) + reg_[n / WORD_BITS] &= ~(word(1) << (n % WORD_BITS)); + } +} + + +void Integer::SetByte(unsigned int n, byte value) +{ + reg_.CleanGrow(RoundupSize(BytesToWords(n+1))); + reg_[n/WORD_SIZE] &= ~(word(0xff) << 8*(n%WORD_SIZE)); + reg_[n/WORD_SIZE] |= (word(value) << 8*(n%WORD_SIZE)); +} + + +void Integer::Negate() +{ + if (!!(*this)) // don't flip sign if *this==0 + sign_ = Sign(1 - sign_); +} + + +bool Integer::operator!() const +{ + return IsNegative() ? false : (reg_[0]==0 && WordCount()==0); +} + + +Integer& Integer::operator=(const Integer& t) +{ + if (this != &t) + { + reg_.New(RoundupSize(t.WordCount())); + CopyWords(reg_.get_buffer(), t.reg_.get_buffer(), reg_.size()); + sign_ = t.sign_; + } + return *this; +} + + +Integer& Integer::operator+=(const Integer& t) +{ + reg_.CleanGrow(t.reg_.size()); + if (NotNegative()) + { + if (t.NotNegative()) + PositiveAdd(*this, *this, t); + else + PositiveSubtract(*this, *this, t); + } + else + { + if (t.NotNegative()) + PositiveSubtract(*this, t, *this); + else + { + PositiveAdd(*this, *this, t); + sign_ = Integer::NEGATIVE; + } + } + return *this; +} + + +Integer Integer::operator-() const +{ + Integer result(*this); + result.Negate(); + return result; +} + + +Integer& Integer::operator-=(const Integer& t) +{ + reg_.CleanGrow(t.reg_.size()); + if (NotNegative()) + { + if (t.NotNegative()) + PositiveSubtract(*this, *this, t); + else + PositiveAdd(*this, *this, t); + } + else + { + if (t.NotNegative()) + { + PositiveAdd(*this, *this, t); + sign_ = Integer::NEGATIVE; + } + else + PositiveSubtract(*this, t, *this); + } + return *this; +} + + +Integer& Integer::operator++() +{ + if (NotNegative()) + { + if (Increment(reg_.get_buffer(), reg_.size())) + { + reg_.CleanGrow(2*reg_.size()); + reg_[reg_.size()/2]=1; + } + } + else + { + word borrow = Decrement(reg_.get_buffer(), reg_.size()); + assert(!borrow); + if (WordCount()==0) + *this = Zero(); + } + return *this; +} + +Integer& Integer::operator--() +{ + if (IsNegative()) + { + if (Increment(reg_.get_buffer(), reg_.size())) + { + reg_.CleanGrow(2*reg_.size()); + reg_[reg_.size()/2]=1; + } + } + else + { + if (Decrement(reg_.get_buffer(), reg_.size())) + *this = -One(); + } + return *this; +} + + +Integer& Integer::operator<<=(unsigned int n) +{ + const unsigned int wordCount = WordCount(); + const unsigned int shiftWords = n / WORD_BITS; + const unsigned int shiftBits = n % WORD_BITS; + + reg_.CleanGrow(RoundupSize(wordCount+BitsToWords(n))); + ShiftWordsLeftByWords(reg_.get_buffer(), wordCount + shiftWords, + shiftWords); + ShiftWordsLeftByBits(reg_+shiftWords, wordCount+BitsToWords(shiftBits), + shiftBits); + return *this; +} + +Integer& Integer::operator>>=(unsigned int n) +{ + const unsigned int wordCount = WordCount(); + const unsigned int shiftWords = n / WORD_BITS; + const unsigned int shiftBits = n % WORD_BITS; + + ShiftWordsRightByWords(reg_.get_buffer(), wordCount, shiftWords); + if (wordCount > shiftWords) + ShiftWordsRightByBits(reg_.get_buffer(), wordCount-shiftWords, + shiftBits); + if (IsNegative() && WordCount()==0) // avoid -0 + *this = Zero(); + return *this; +} + + +void PositiveAdd(Integer& sum, const Integer& a, const Integer& b) +{ + word carry; + if (a.reg_.size() == b.reg_.size()) + carry = Add(sum.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), a.reg_.size()); + else if (a.reg_.size() > b.reg_.size()) + { + carry = Add(sum.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), b.reg_.size()); + CopyWords(sum.reg_+b.reg_.size(), a.reg_+b.reg_.size(), + a.reg_.size()-b.reg_.size()); + carry = Increment(sum.reg_+b.reg_.size(), a.reg_.size()-b.reg_.size(), + carry); + } + else + { + carry = Add(sum.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), a.reg_.size()); + CopyWords(sum.reg_+a.reg_.size(), b.reg_+a.reg_.size(), + b.reg_.size()-a.reg_.size()); + carry = Increment(sum.reg_+a.reg_.size(), b.reg_.size()-a.reg_.size(), + carry); + } + + if (carry) + { + sum.reg_.CleanGrow(2*sum.reg_.size()); + sum.reg_[sum.reg_.size()/2] = 1; + } + sum.sign_ = Integer::POSITIVE; +} + +void PositiveSubtract(Integer &diff, const Integer &a, const Integer& b) +{ + unsigned aSize = a.WordCount(); + aSize += aSize%2; + unsigned bSize = b.WordCount(); + bSize += bSize%2; + + if (aSize == bSize) + { + if (Compare(a.reg_.get_buffer(), b.reg_.get_buffer(), aSize) >= 0) + { + Subtract(diff.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), aSize); + diff.sign_ = Integer::POSITIVE; + } + else + { + Subtract(diff.reg_.get_buffer(), b.reg_.get_buffer(), + a.reg_.get_buffer(), aSize); + diff.sign_ = Integer::NEGATIVE; + } + } + else if (aSize > bSize) + { + word borrow = Subtract(diff.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), bSize); + CopyWords(diff.reg_+bSize, a.reg_+bSize, aSize-bSize); + borrow = Decrement(diff.reg_+bSize, aSize-bSize, borrow); + assert(!borrow); + diff.sign_ = Integer::POSITIVE; + } + else + { + word borrow = Subtract(diff.reg_.get_buffer(), b.reg_.get_buffer(), + a.reg_.get_buffer(), aSize); + CopyWords(diff.reg_+aSize, b.reg_+aSize, bSize-aSize); + borrow = Decrement(diff.reg_+aSize, bSize-aSize, borrow); + assert(!borrow); + diff.sign_ = Integer::NEGATIVE; + } +} + + +unsigned int Integer::MinEncodedSize(Signedness signedness) const +{ + unsigned int outputLen = max(1U, ByteCount()); + if (signedness == UNSIGNED) + return outputLen; + if (NotNegative() && (GetByte(outputLen-1) & 0x80)) + outputLen++; + if (IsNegative() && *this < -Power2(outputLen*8-1)) + outputLen++; + return outputLen; +} + + +int Integer::Compare(const Integer& t) const +{ + if (NotNegative()) + { + if (t.NotNegative()) + return PositiveCompare(t); + else + return 1; + } + else + { + if (t.NotNegative()) + return -1; + else + return -PositiveCompare(t); + } +} + + +int Integer::PositiveCompare(const Integer& t) const +{ + unsigned size = WordCount(), tSize = t.WordCount(); + + if (size == tSize) + return TaoCrypt::Compare(reg_.get_buffer(), t.reg_.get_buffer(), size); + else + return size > tSize ? 1 : -1; +} + + +bool Integer::GetBit(unsigned int n) const +{ + if (n/WORD_BITS >= reg_.size()) + return 0; + else + return bool((reg_[n/WORD_BITS] >> (n % WORD_BITS)) & 1); +} + + +unsigned long Integer::GetBits(unsigned int i, unsigned int n) const +{ + assert(n <= sizeof(unsigned long)*8); + unsigned long v = 0; + for (unsigned int j=0; j= reg_.size()) + return 0; + else + return byte(reg_[n/WORD_SIZE] >> ((n%WORD_SIZE)*8)); +} + + +unsigned int Integer::BitCount() const +{ + unsigned wordCount = WordCount(); + if (wordCount) + return (wordCount-1)*WORD_BITS + BitPrecision(reg_[wordCount-1]); + else + return 0; +} + + +unsigned int Integer::ByteCount() const +{ + unsigned wordCount = WordCount(); + if (wordCount) + return (wordCount-1)*WORD_SIZE + BytePrecision(reg_[wordCount-1]); + else + return 0; +} + + +unsigned int Integer::WordCount() const +{ + return CountWords(reg_.get_buffer(), reg_.size()); +} + + +bool Integer::IsConvertableToLong() const +{ + if (ByteCount() > sizeof(long)) + return false; + + unsigned long value = reg_[0]; + value += SafeLeftShift(reg_[1]); + + if (sign_ == POSITIVE) + return (signed long)value >= 0; + else + return -(signed long)value < 0; +} + + +signed long Integer::ConvertToLong() const +{ + assert(IsConvertableToLong()); + + unsigned long value = reg_[0]; + value += SafeLeftShift(reg_[1]); + return sign_ == POSITIVE ? value : -(signed long)value; +} + + +void Integer::Swap(Integer& a) +{ + reg_.Swap(a.reg_); + STL::swap(sign_, a.sign_); +} + + +Integer Integer::Plus(const Integer& b) const +{ + Integer sum((word)0, max(reg_.size(), b.reg_.size())); + if (NotNegative()) + { + if (b.NotNegative()) + PositiveAdd(sum, *this, b); + else + PositiveSubtract(sum, *this, b); + } + else + { + if (b.NotNegative()) + PositiveSubtract(sum, b, *this); + else + { + PositiveAdd(sum, *this, b); + sum.sign_ = Integer::NEGATIVE; + } + } + return sum; +} + + +Integer Integer::Minus(const Integer& b) const +{ + Integer diff((word)0, max(reg_.size(), b.reg_.size())); + if (NotNegative()) + { + if (b.NotNegative()) + PositiveSubtract(diff, *this, b); + else + PositiveAdd(diff, *this, b); + } + else + { + if (b.NotNegative()) + { + PositiveAdd(diff, *this, b); + diff.sign_ = Integer::NEGATIVE; + } + else + PositiveSubtract(diff, b, *this); + } + return diff; +} + + +Integer Integer::Times(const Integer &b) const +{ + Integer product; + Multiply(product, *this, b); + return product; +} + + +#undef A0 +#undef A1 +#undef B0 +#undef B1 + +#undef T0 +#undef T1 +#undef T2 +#undef T3 + +#undef R0 +#undef R1 +#undef R2 +#undef R3 + + +static inline void AtomicDivide(word *Q, const word *A, const word *B) +{ + word T[4]; + DWord q = DivideFourWordsByTwo(T, DWord(A[0], A[1]), + DWord(A[2], A[3]), DWord(B[0], B[1])); + Q[0] = q.GetLowHalf(); + Q[1] = q.GetHighHalf(); + +#ifndef NDEBUG + if (B[0] || B[1]) + { + // multiply quotient and divisor and add remainder, make sure it + // equals dividend + assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0]= 0) + { + R[N] -= Subtract(R, R, B, N); + Q[1] += (++Q[0]==0); + assert(Q[0] || Q[1]); // no overflow + } +} + +// R[NB] -------- remainder = A%B +// Q[NA-NB+2] --- quotient = A/B +// T[NA+2*NB+4] - temp work space +// A[NA] -------- dividend +// B[NB] -------- divisor + + +void Divide(word* R, word* Q, word* T, const word* A, unsigned int NA, + const word* B, unsigned int NB) +{ + assert(NA && NB && NA%2==0 && NB%2==0); + assert(B[NB-1] || B[NB-2]); + assert(NB <= NA); + + // set up temporary work space + word *const TA=T; + word *const TB=T+NA+2; + word *const TP=T+NA+2+NB; + + // copy B into TB and normalize it so that TB has highest bit set to 1 + unsigned shiftWords = (B[NB-1]==0); + TB[0] = TB[NB-1] = 0; + CopyWords(TB+shiftWords, B, NB-shiftWords); + unsigned shiftBits = WORD_BITS - BitPrecision(TB[NB-1]); + assert(shiftBits < WORD_BITS); + ShiftWordsLeftByBits(TB, NB, shiftBits); + + // copy A into TA and normalize it + TA[0] = TA[NA] = TA[NA+1] = 0; + CopyWords(TA+shiftWords, A, NA); + ShiftWordsLeftByBits(TA, NA+2, shiftBits); + + if (TA[NA+1]==0 && TA[NA] <= 1) + { + Q[NA-NB+1] = Q[NA-NB] = 0; + while (TA[NA] || Compare(TA+NA-NB, TB, NB) >= 0) + { + TA[NA] -= Subtract(TA+NA-NB, TA+NA-NB, TB, NB); + ++Q[NA-NB]; + } + } + else + { + NA+=2; + assert(Compare(TA+NA-NB, TB, NB) < 0); + } + + word BT[2]; + BT[0] = TB[NB-2] + 1; + BT[1] = TB[NB-1] + (BT[0]==0); + + // start reducing TA mod TB, 2 words at a time + for (unsigned i=NA-2; i>=NB; i-=2) + { + AtomicDivide(Q+i-NB, TA+i-2, BT); + CorrectQuotientEstimate(TA+i-NB, TP, Q+i-NB, TB, NB); + } + + // copy TA into R, and denormalize it + CopyWords(R, TA+shiftWords, NB); + ShiftWordsRightByBits(R, NB, shiftBits); +} + + +void PositiveDivide(Integer& remainder, Integer& quotient, + const Integer& a, const Integer& b) +{ + unsigned aSize = a.WordCount(); + unsigned bSize = b.WordCount(); + + assert(bSize); + + if (a.PositiveCompare(b) == -1) + { + remainder = a; + remainder.sign_ = Integer::POSITIVE; + quotient = Integer::Zero(); + return; + } + + aSize += aSize%2; // round up to next even number + bSize += bSize%2; + + remainder.reg_.CleanNew(RoundupSize(bSize)); + remainder.sign_ = Integer::POSITIVE; + quotient.reg_.CleanNew(RoundupSize(aSize-bSize+2)); + quotient.sign_ = Integer::POSITIVE; + + AlignedWordBlock T(aSize+2*bSize+4); + Divide(remainder.reg_.get_buffer(), quotient.reg_.get_buffer(), + T.get_buffer(), a.reg_.get_buffer(), aSize, b.reg_.get_buffer(), + bSize); +} + +void Integer::Divide(Integer &remainder, Integer "ient, + const Integer ÷nd, const Integer &divisor) +{ + PositiveDivide(remainder, quotient, dividend, divisor); + + if (dividend.IsNegative()) + { + quotient.Negate(); + if (remainder.NotZero()) + { + --quotient; + remainder = divisor.AbsoluteValue() - remainder; + } + } + + if (divisor.IsNegative()) + quotient.Negate(); +} + +void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a, + unsigned int n) +{ + q = a; + q >>= n; + + const unsigned int wordCount = BitsToWords(n); + if (wordCount <= a.WordCount()) + { + r.reg_.resize(RoundupSize(wordCount)); + CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount); + SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount); + if (n % WORD_BITS != 0) + r.reg_[wordCount-1] %= (word(1) << (n % WORD_BITS)); + } + else + { + r.reg_.resize(RoundupSize(a.WordCount())); + CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), r.reg_.size()); + } + r.sign_ = POSITIVE; + + if (a.IsNegative() && r.NotZero()) + { + --q; + r = Power2(n) - r; + } +} + +Integer Integer::DividedBy(const Integer &b) const +{ + Integer remainder, quotient; + Integer::Divide(remainder, quotient, *this, b); + return quotient; +} + +Integer Integer::Modulo(const Integer &b) const +{ + Integer remainder, quotient; + Integer::Divide(remainder, quotient, *this, b); + return remainder; +} + +void Integer::Divide(word &remainder, Integer "ient, + const Integer ÷nd, word divisor) +{ + assert(divisor); + + if ((divisor & (divisor-1)) == 0) // divisor is a power of 2 + { + quotient = dividend >> (BitPrecision(divisor)-1); + remainder = dividend.reg_[0] & (divisor-1); + return; + } + + unsigned int i = dividend.WordCount(); + quotient.reg_.CleanNew(RoundupSize(i)); + remainder = 0; + while (i--) + { + quotient.reg_[i] = DWord(dividend.reg_[i], remainder) / divisor; + remainder = DWord(dividend.reg_[i], remainder) % divisor; + } + + if (dividend.NotNegative()) + quotient.sign_ = POSITIVE; + else + { + quotient.sign_ = NEGATIVE; + if (remainder) + { + --quotient; + remainder = divisor - remainder; + } + } +} + +Integer Integer::DividedBy(word b) const +{ + word remainder; + Integer quotient; + Integer::Divide(remainder, quotient, *this, b); + return quotient; +} + +word Integer::Modulo(word divisor) const +{ + assert(divisor); + + word remainder; + + if ((divisor & (divisor-1)) == 0) // divisor is a power of 2 + remainder = reg_[0] & (divisor-1); + else + { + unsigned int i = WordCount(); + + if (divisor <= 5) + { + DWord sum(0, 0); + while (i--) + sum += reg_[i]; + remainder = sum % divisor; + } + else + { + remainder = 0; + while (i--) + remainder = DWord(reg_[i], remainder) % divisor; + } + } + + if (IsNegative() && remainder) + remainder = divisor - remainder; + + return remainder; +} + + +Integer Integer::AbsoluteValue() const +{ + Integer result(*this); + result.sign_ = POSITIVE; + return result; +} + + +Integer Integer::SquareRoot() const +{ + if (!IsPositive()) + return Zero(); + + // overestimate square root + Integer x, y = Power2((BitCount()+1)/2); + assert(y*y >= *this); + + do + { + x = y; + y = (x + *this/x) >> 1; + } while (y=m) + return (*this%m).InverseMod(m); + + if (m.IsEven()) + { + if (!m || IsEven()) + return Zero(); // no inverse + if (*this == One()) + return One(); + + Integer u = m.InverseMod(*this); + return !u ? Zero() : (m*(*this-u)+1)/(*this); + } + + AlignedWordBlock T(m.reg_.size() * 4); + Integer r((word)0, m.reg_.size()); + unsigned k = AlmostInverse(r.reg_.get_buffer(), T.get_buffer(), + reg_.get_buffer(), reg_.size(), + m.reg_.get_buffer(), m.reg_.size()); + DivideByPower2Mod(r.reg_.get_buffer(), r.reg_.get_buffer(), k, + m.reg_.get_buffer(), m.reg_.size()); + return r; +} + +word Integer::InverseMod(const word mod) const +{ + word g0 = mod, g1 = *this % mod; + word v0 = 0, v1 = 1; + word y; + + while (g1) + { + if (g1 == 1) + return v1; + y = g0 / g1; + g0 = g0 % g1; + v0 += y * v1; + + if (!g0) + break; + if (g0 == 1) + return mod-v0; + y = g1 / g0; + g1 = g1 % g0; + v1 += y * v0; + } + return 0; +} + +// ********* ModArith stuff + +const Integer& ModularArithmetic::Half(const Integer &a) const +{ + if (a.reg_.size()==modulus.reg_.size()) + { + TaoCrypt::DivideByPower2Mod(result.reg_.begin(), a.reg_.begin(), 1, + modulus.reg_.begin(), a.reg_.size()); + return result; + } + else + return result1 = (a.IsEven() ? (a >> 1) : ((a+modulus) >> 1)); +} + +const Integer& ModularArithmetic::Add(const Integer &a, const Integer &b) const +{ + if (a.reg_.size()==modulus.reg_.size() && + b.reg_.size()==modulus.reg_.size()) + { + if (TaoCrypt::Add(result.reg_.begin(), a.reg_.begin(), b.reg_.begin(), + a.reg_.size()) + || Compare(result.reg_.get_buffer(), modulus.reg_.get_buffer(), + a.reg_.size()) >= 0) + { + TaoCrypt::Subtract(result.reg_.begin(), result.reg_.begin(), + modulus.reg_.begin(), a.reg_.size()); + } + return result; + } + else + { + result1 = a+b; + if (result1 >= modulus) + result1 -= modulus; + return result1; + } +} + +Integer& ModularArithmetic::Accumulate(Integer &a, const Integer &b) const +{ + if (a.reg_.size()==modulus.reg_.size() && + b.reg_.size()==modulus.reg_.size()) + { + if (TaoCrypt::Add(a.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), a.reg_.size()) + || Compare(a.reg_.get_buffer(), modulus.reg_.get_buffer(), + a.reg_.size()) >= 0) + { + TaoCrypt::Subtract(a.reg_.get_buffer(), a.reg_.get_buffer(), + modulus.reg_.get_buffer(), a.reg_.size()); + } + } + else + { + a+=b; + if (a>=modulus) + a-=modulus; + } + + return a; +} + +const Integer& ModularArithmetic::Subtract(const Integer &a, + const Integer &b) const +{ + if (a.reg_.size()==modulus.reg_.size() && + b.reg_.size()==modulus.reg_.size()) + { + if (TaoCrypt::Subtract(result.reg_.begin(), a.reg_.begin(), + b.reg_.begin(), a.reg_.size())) + TaoCrypt::Add(result.reg_.begin(), result.reg_.begin(), + modulus.reg_.begin(), a.reg_.size()); + return result; + } + else + { + result1 = a-b; + if (result1.IsNegative()) + result1 += modulus; + return result1; + } +} + +Integer& ModularArithmetic::Reduce(Integer &a, const Integer &b) const +{ + if (a.reg_.size()==modulus.reg_.size() && + b.reg_.size()==modulus.reg_.size()) + { + if (TaoCrypt::Subtract(a.reg_.get_buffer(), a.reg_.get_buffer(), + b.reg_.get_buffer(), a.reg_.size())) + TaoCrypt::Add(a.reg_.get_buffer(), a.reg_.get_buffer(), + modulus.reg_.get_buffer(), a.reg_.size()); + } + else + { + a-=b; + if (a.IsNegative()) + a+=modulus; + } + + return a; +} + +const Integer& ModularArithmetic::Inverse(const Integer &a) const +{ + if (!a) + return a; + + CopyWords(result.reg_.begin(), modulus.reg_.begin(), modulus.reg_.size()); + if (TaoCrypt::Subtract(result.reg_.begin(), result.reg_.begin(), + a.reg_.begin(), a.reg_.size())) + Decrement(result.reg_.begin()+a.reg_.size(), 1, + modulus.reg_.size()-a.reg_.size()); + + return result; +} + +Integer ModularArithmetic::CascadeExponentiate(const Integer &x, + const Integer &e1, const Integer &y, const Integer &e2) const +{ + if (modulus.IsOdd()) + { + MontgomeryRepresentation dr(modulus); + return dr.ConvertOut(dr.CascadeExponentiate(dr.ConvertIn(x), e1, + dr.ConvertIn(y), e2)); + } + else + return AbstractRing::CascadeExponentiate(x, e1, y, e2); +} + +void ModularArithmetic::SimultaneousExponentiate(Integer *results, + const Integer &base, const Integer *exponents, + unsigned int exponentsCount) const +{ + if (modulus.IsOdd()) + { + MontgomeryRepresentation dr(modulus); + dr.SimultaneousExponentiate(results, dr.ConvertIn(base), exponents, + exponentsCount); + for (unsigned int i=0; i + +namespace TaoCrypt { + + +MD2::MD2() + : X_(X_SIZE), C_(BLOCK_SIZE), buffer_(BLOCK_SIZE) +{ + Init(); +} + +void MD2::Init() +{ + memset(X_.get_buffer(), 0, X_SIZE); + memset(C_.get_buffer(), 0, BLOCK_SIZE); + memset(buffer_.get_buffer(), 0, BLOCK_SIZE); + count_ = 0; +} + + +void MD2::Update(const byte* data, word32 len) +{ + + static const byte S[256] = + { + 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, + 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, + 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, + 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, + 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, + 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, + 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, + 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, + 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, + 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, + 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, + 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, + 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, + 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, + 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, + 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, + 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, + 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 + }; + + while (len) { + word32 L = (PAD_SIZE - count_) < len ? (PAD_SIZE - count_) : len; + memcpy(buffer_.get_buffer() + count_, data, L); + count_ += L; + data += L; + len -= L; + + if (count_==PAD_SIZE) { + count_ = 0; + memcpy(X_.get_buffer() + PAD_SIZE, buffer_.get_buffer(), PAD_SIZE); + byte t = C_[15]; + + int i; + for(i = 0; i < PAD_SIZE; i++) { + X_[32 + i] = X_[PAD_SIZE + i] ^ X_[i]; + t = C_[i] ^= S[buffer_[i] ^ t]; + } + + t=0; + for(i = 0; i < 18; i++) { + for(int j = 0; j < X_SIZE; j += 8) { + t = X_[j+0] ^= S[t]; + t = X_[j+1] ^= S[t]; + t = X_[j+2] ^= S[t]; + t = X_[j+3] ^= S[t]; + t = X_[j+4] ^= S[t]; + t = X_[j+5] ^= S[t]; + t = X_[j+6] ^= S[t]; + t = X_[j+7] ^= S[t]; + } + t = (t + i) & 0xFF; + } + } + } +} + + +void MD2::Final(byte *hash) +{ + byte padding[BLOCK_SIZE]; + word32 padLen = PAD_SIZE - count_; + + for (word32 i = 0; i < padLen; i++) + padding[i] = static_cast(padLen); + + Update(padding, padLen); + Update(C_.get_buffer(), BLOCK_SIZE); + + memcpy(hash, X_.get_buffer(), DIGEST_SIZE); + + Init(); +} + + + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/md4.cpp b/externals/mysql/extlib/yassl/taocrypt/src/md4.cpp new file mode 100644 index 00000000000..cf17c218809 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/md4.cpp @@ -0,0 +1,157 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* based on Wei Dai's md4.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "md4.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + +namespace TaoCrypt { + +void MD4::Init() +{ + digest_[0] = 0x67452301L; + digest_[1] = 0xefcdab89L; + digest_[2] = 0x98badcfeL; + digest_[3] = 0x10325476L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +MD4::MD4(const MD4& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), + BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + +MD4& MD4::operator= (const MD4& that) +{ + MD4 tmp(that); + Swap(tmp); + + return *this; +} + + +void MD4::Swap(MD4& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void MD4::Transform() +{ +#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) + + word32 A, B, C, D; + + A = digest_[0]; + B = digest_[1]; + C = digest_[2]; + D = digest_[3]; + +#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+buffer_[k],s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 1, 7); + function(C,D,A,B, 2,11); + function(B,C,D,A, 3,19); + function(A,B,C,D, 4, 3); + function(D,A,B,C, 5, 7); + function(C,D,A,B, 6,11); + function(B,C,D,A, 7,19); + function(A,B,C,D, 8, 3); + function(D,A,B,C, 9, 7); + function(C,D,A,B,10,11); + function(B,C,D,A,11,19); + function(A,B,C,D,12, 3); + function(D,A,B,C,13, 7); + function(C,D,A,B,14,11); + function(B,C,D,A,15,19); + +#undef function +#define function(a,b,c,d,k,s) a=rotlFixed(a+G(b,c,d)+buffer_[k]+0x5a827999,s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 4, 5); + function(C,D,A,B, 8, 9); + function(B,C,D,A,12,13); + function(A,B,C,D, 1, 3); + function(D,A,B,C, 5, 5); + function(C,D,A,B, 9, 9); + function(B,C,D,A,13,13); + function(A,B,C,D, 2, 3); + function(D,A,B,C, 6, 5); + function(C,D,A,B,10, 9); + function(B,C,D,A,14,13); + function(A,B,C,D, 3, 3); + function(D,A,B,C, 7, 5); + function(C,D,A,B,11, 9); + function(B,C,D,A,15,13); + +#undef function +#define function(a,b,c,d,k,s) a=rotlFixed(a+H(b,c,d)+buffer_[k]+0x6ed9eba1,s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 8, 9); + function(C,D,A,B, 4,11); + function(B,C,D,A,12,15); + function(A,B,C,D, 2, 3); + function(D,A,B,C,10, 9); + function(C,D,A,B, 6,11); + function(B,C,D,A,14,15); + function(A,B,C,D, 1, 3); + function(D,A,B,C, 9, 9); + function(C,D,A,B, 5,11); + function(B,C,D,A,13,15); + function(A,B,C,D, 3, 3); + function(D,A,B,C,11, 9); + function(C,D,A,B, 7,11); + function(B,C,D,A,15,15); + + digest_[0] += A; + digest_[1] += B; + digest_[2] += C; + digest_[3] += D; +} + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/md5.cpp b/externals/mysql/extlib/yassl/taocrypt/src/md5.cpp new file mode 100644 index 00000000000..f18e0290c90 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/md5.cpp @@ -0,0 +1,498 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* based on Wei Dai's md5.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "md5.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + + +namespace TaoCrypt { + +void MD5::Init() +{ + digest_[0] = 0x67452301L; + digest_[1] = 0xefcdab89L; + digest_[2] = 0x98badcfeL; + digest_[3] = 0x10325476L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +MD5::MD5(const MD5& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), + BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + +MD5& MD5::operator= (const MD5& that) +{ + MD5 tmp(that); + Swap(tmp); + + return *this; +} + + +void MD5::Swap(MD5& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +#ifdef DO_MD5_ASM + +// Update digest with data of size len +void MD5::Update(const byte* data, word32 len) +{ + if (!isMMX) { + HASHwithTransform::Update(data, len); + return; + } + + byte* local = reinterpret_cast(buffer_); + + // remove buffered data if possible + if (buffLen_) { + word32 add = min(len, BLOCK_SIZE - buffLen_); + memcpy(&local[buffLen_], data, add); + + buffLen_ += add; + data += add; + len -= add; + + if (buffLen_ == BLOCK_SIZE) { + Transform(); + AddLength(BLOCK_SIZE); + buffLen_ = 0; + } + } + + // at once for asm + if (buffLen_ == 0) { + word32 times = len / BLOCK_SIZE; + if (times) { + AsmTransform(data, times); + const word32 add = BLOCK_SIZE * times; + AddLength(add); + len -= add; + data += add; + } + } + + // cache any data left + if (len) { + memcpy(&local[buffLen_], data, len); + buffLen_ += len; + } +} + + + + +/* + // w = rotlFixed(w + f(x, y, z) + index[edi] + data, s) + x +#define ASMMD5STEP(f, w, x, y, z, index, data, s) \ + f(x, y, z) \ + AS2( mov ebp, [edi + index * 4] ) \ + AS2( lea w, [esi + w + data] ) \ + AS2( add w, ebp ) \ + AS2( rol w, s ) \ + AS2( add w, x ) + + + // F1(x, y, z) (z ^ (x & (y ^ z))) + // place in esi +#define ASMF1(x, y, z) \ + AS2( mov esi, y ) \ + AS2( xor esi, z ) \ + AS2( and esi, x ) \ + AS2( xor esi, z ) + + +#define ASMF2(x, y, z) ASMF1(z, x, y) + + + // F3(x ^ y ^ z) + // place in esi +#define ASMF3(x, y, z) \ + AS2( mov esi, x ) \ + AS2( xor esi, y ) \ + AS2( xor esi, z ) + + + + // F4(x, y, z) (y ^ (x | ~z)) + // place in esi +#define ASMF4(x, y, z) \ + AS2( mov esi, z ) \ + AS1( not esi ) \ + AS2( or esi, x ) \ + AS2( xor esi, y ) +*/ + + + // combine above ASMMD5STEP(f w/ each f ASMF1 - F4 + + // esi already set up, after using set for next round + // ebp already set up, set up using next round index + +#define MD5STEP1(w, x, y, z, index, data, s) \ + AS2( xor esi, z ) \ + AS2( and esi, x ) \ + AS2( lea w, [ebp + w + data] ) \ + AS2( xor esi, z ) \ + AS2( add w, esi ) \ + AS2( mov esi, x ) \ + AS2( rol w, s ) \ + AS2( mov ebp, [edi + index * 4] ) \ + AS2( add w, x ) + +#define MD5STEP2(w, x, y, z, index, data, s) \ + AS2( xor esi, x ) \ + AS2( and esi, z ) \ + AS2( lea w, [ebp + w + data] ) \ + AS2( xor esi, y ) \ + AS2( add w, esi ) \ + AS2( mov esi, x ) \ + AS2( rol w, s ) \ + AS2( mov ebp, [edi + index * 4] ) \ + AS2( add w, x ) + + +#define MD5STEP3(w, x, y, z, index, data, s) \ + AS2( xor esi, z ) \ + AS2( lea w, [ebp + w + data] ) \ + AS2( xor esi, x ) \ + AS2( add w, esi ) \ + AS2( mov esi, x ) \ + AS2( rol w, s ) \ + AS2( mov ebp, [edi + index * 4] ) \ + AS2( add w, x ) + + +#define MD5STEP4(w, x, y, z, index, data, s) \ + AS2( or esi, x ) \ + AS2( lea w, [ebp + w + data] ) \ + AS2( xor esi, y ) \ + AS2( add w, esi ) \ + AS2( mov esi, y ) \ + AS2( rol w, s ) \ + AS1( not esi ) \ + AS2( mov ebp, [edi + index * 4] ) \ + AS2( add w, x ) + + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void MD5::AsmTransform(const byte* data, word32 times) +{ +#ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov ecx, DWORD PTR [ebp + 8] ) \ + AS2( mov edi, DWORD PTR [ebp + 12] ) \ + AS2( mov eax, DWORD PTR [ebp + 16] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( mov esp, ebp ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); +#else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edi, DWORD PTR [ebp + 8] ) \ + AS2( mov eax, DWORD PTR [ebp + 12] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 8 ) + +#endif + + + PROLOG() + + AS2( mov esi, ecx ) + + #ifdef OLD_GCC_OFFSET + AS2( add esi, 20 ) // digest_[0] + #else + AS2( add esi, 16 ) // digest_[0] + #endif + + AS2( movd mm2, eax ) // store times_ + AS2( movd mm1, esi ) // store digest_ + + AS2( mov eax, [esi] ) // a + AS2( mov ebx, [esi + 4] ) // b + AS2( mov ecx, [esi + 8] ) // c + AS2( mov edx, [esi + 12] ) // d + +AS1(loopStart:) + + // set up + AS2( mov esi, ecx ) + AS2( mov ebp, [edi] ) + + MD5STEP1( eax, ebx, ecx, edx, 1, 0xd76aa478, 7) + MD5STEP1( edx, eax, ebx, ecx, 2, 0xe8c7b756, 12) + MD5STEP1( ecx, edx, eax, ebx, 3, 0x242070db, 17) + MD5STEP1( ebx, ecx, edx, eax, 4, 0xc1bdceee, 22) + MD5STEP1( eax, ebx, ecx, edx, 5, 0xf57c0faf, 7) + MD5STEP1( edx, eax, ebx, ecx, 6, 0x4787c62a, 12) + MD5STEP1( ecx, edx, eax, ebx, 7, 0xa8304613, 17) + MD5STEP1( ebx, ecx, edx, eax, 8, 0xfd469501, 22) + MD5STEP1( eax, ebx, ecx, edx, 9, 0x698098d8, 7) + MD5STEP1( edx, eax, ebx, ecx, 10, 0x8b44f7af, 12) + MD5STEP1( ecx, edx, eax, ebx, 11, 0xffff5bb1, 17) + MD5STEP1( ebx, ecx, edx, eax, 12, 0x895cd7be, 22) + MD5STEP1( eax, ebx, ecx, edx, 13, 0x6b901122, 7) + MD5STEP1( edx, eax, ebx, ecx, 14, 0xfd987193, 12) + MD5STEP1( ecx, edx, eax, ebx, 15, 0xa679438e, 17) + MD5STEP1( ebx, ecx, edx, eax, 1, 0x49b40821, 22) + + MD5STEP2( eax, ebx, ecx, edx, 6, 0xf61e2562, 5) + MD5STEP2( edx, eax, ebx, ecx, 11, 0xc040b340, 9) + MD5STEP2( ecx, edx, eax, ebx, 0, 0x265e5a51, 14) + MD5STEP2( ebx, ecx, edx, eax, 5, 0xe9b6c7aa, 20) + MD5STEP2( eax, ebx, ecx, edx, 10, 0xd62f105d, 5) + MD5STEP2( edx, eax, ebx, ecx, 15, 0x02441453, 9) + MD5STEP2( ecx, edx, eax, ebx, 4, 0xd8a1e681, 14) + MD5STEP2( ebx, ecx, edx, eax, 9, 0xe7d3fbc8, 20) + MD5STEP2( eax, ebx, ecx, edx, 14, 0x21e1cde6, 5) + MD5STEP2( edx, eax, ebx, ecx, 3, 0xc33707d6, 9) + MD5STEP2( ecx, edx, eax, ebx, 8, 0xf4d50d87, 14) + MD5STEP2( ebx, ecx, edx, eax, 13, 0x455a14ed, 20) + MD5STEP2( eax, ebx, ecx, edx, 2, 0xa9e3e905, 5) + MD5STEP2( edx, eax, ebx, ecx, 7, 0xfcefa3f8, 9) + MD5STEP2( ecx, edx, eax, ebx, 12, 0x676f02d9, 14) + MD5STEP2( ebx, ecx, edx, eax, 5, 0x8d2a4c8a, 20) + + MD5STEP3( eax, ebx, ecx, edx, 8, 0xfffa3942, 4) + MD5STEP3( edx, eax, ebx, ecx, 11, 0x8771f681, 11) + MD5STEP3( ecx, edx, eax, ebx, 14, 0x6d9d6122, 16) + MD5STEP3( ebx, ecx, edx, eax, 1, 0xfde5380c, 23) + MD5STEP3( eax, ebx, ecx, edx, 4, 0xa4beea44, 4) + MD5STEP3( edx, eax, ebx, ecx, 7, 0x4bdecfa9, 11) + MD5STEP3( ecx, edx, eax, ebx, 10, 0xf6bb4b60, 16) + MD5STEP3( ebx, ecx, edx, eax, 13, 0xbebfbc70, 23) + MD5STEP3( eax, ebx, ecx, edx, 0, 0x289b7ec6, 4) + MD5STEP3( edx, eax, ebx, ecx, 3, 0xeaa127fa, 11) + MD5STEP3( ecx, edx, eax, ebx, 6, 0xd4ef3085, 16) + MD5STEP3( ebx, ecx, edx, eax, 9, 0x04881d05, 23) + MD5STEP3( eax, ebx, ecx, edx, 12, 0xd9d4d039, 4) + MD5STEP3( edx, eax, ebx, ecx, 15, 0xe6db99e5, 11) + MD5STEP3( ecx, edx, eax, ebx, 2, 0x1fa27cf8, 16) + MD5STEP3( ebx, ecx, edx, eax, 0, 0xc4ac5665, 23) + + // setup + AS2( mov esi, edx ) + AS1( not esi ) + + MD5STEP4( eax, ebx, ecx, edx, 7, 0xf4292244, 6) + MD5STEP4( edx, eax, ebx, ecx, 14, 0x432aff97, 10) + MD5STEP4( ecx, edx, eax, ebx, 5, 0xab9423a7, 15) + MD5STEP4( ebx, ecx, edx, eax, 12, 0xfc93a039, 21) + MD5STEP4( eax, ebx, ecx, edx, 3, 0x655b59c3, 6) + MD5STEP4( edx, eax, ebx, ecx, 10, 0x8f0ccc92, 10) + MD5STEP4( ecx, edx, eax, ebx, 1, 0xffeff47d, 15) + MD5STEP4( ebx, ecx, edx, eax, 8, 0x85845dd1, 21) + MD5STEP4( eax, ebx, ecx, edx, 15, 0x6fa87e4f, 6) + MD5STEP4( edx, eax, ebx, ecx, 6, 0xfe2ce6e0, 10) + MD5STEP4( ecx, edx, eax, ebx, 13, 0xa3014314, 15) + MD5STEP4( ebx, ecx, edx, eax, 4, 0x4e0811a1, 21) + MD5STEP4( eax, ebx, ecx, edx, 11, 0xf7537e82, 6) + MD5STEP4( edx, eax, ebx, ecx, 2, 0xbd3af235, 10) + MD5STEP4( ecx, edx, eax, ebx, 9, 0x2ad7d2bb, 15) + MD5STEP4( ebx, ecx, edx, eax, 9, 0xeb86d391, 21) + + AS2( movd esi, mm1 ) // digest_ + + AS2( add [esi], eax ) // write out + AS2( add [esi + 4], ebx ) + AS2( add [esi + 8], ecx ) + AS2( add [esi + 12], edx ) + + AS2( add edi, 64 ) + + AS2( mov eax, [esi] ) + AS2( mov ebx, [esi + 4] ) + AS2( mov ecx, [esi + 8] ) + AS2( mov edx, [esi + 12] ) + + AS2( movd ebp, mm2 ) // times + AS1( dec ebp ) + AS2( movd mm2, ebp ) + AS1( jnz loopStart ) + + + EPILOG() +} + + +#endif // DO_MD5_ASM + + +void MD5::Transform() +{ +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) + +#define MD5STEP(f, w, x, y, z, data, s) \ + w = rotlFixed(w + f(x, y, z) + data, s) + x + + // Copy context->state[] to working vars + word32 a = digest_[0]; + word32 b = digest_[1]; + word32 c = digest_[2]; + word32 d = digest_[3]; + + MD5STEP(F1, a, b, c, d, buffer_[0] + 0xd76aa478, 7); + MD5STEP(F1, d, a, b, c, buffer_[1] + 0xe8c7b756, 12); + MD5STEP(F1, c, d, a, b, buffer_[2] + 0x242070db, 17); + MD5STEP(F1, b, c, d, a, buffer_[3] + 0xc1bdceee, 22); + MD5STEP(F1, a, b, c, d, buffer_[4] + 0xf57c0faf, 7); + MD5STEP(F1, d, a, b, c, buffer_[5] + 0x4787c62a, 12); + MD5STEP(F1, c, d, a, b, buffer_[6] + 0xa8304613, 17); + MD5STEP(F1, b, c, d, a, buffer_[7] + 0xfd469501, 22); + MD5STEP(F1, a, b, c, d, buffer_[8] + 0x698098d8, 7); + MD5STEP(F1, d, a, b, c, buffer_[9] + 0x8b44f7af, 12); + MD5STEP(F1, c, d, a, b, buffer_[10] + 0xffff5bb1, 17); + MD5STEP(F1, b, c, d, a, buffer_[11] + 0x895cd7be, 22); + MD5STEP(F1, a, b, c, d, buffer_[12] + 0x6b901122, 7); + MD5STEP(F1, d, a, b, c, buffer_[13] + 0xfd987193, 12); + MD5STEP(F1, c, d, a, b, buffer_[14] + 0xa679438e, 17); + MD5STEP(F1, b, c, d, a, buffer_[15] + 0x49b40821, 22); + + MD5STEP(F2, a, b, c, d, buffer_[1] + 0xf61e2562, 5); + MD5STEP(F2, d, a, b, c, buffer_[6] + 0xc040b340, 9); + MD5STEP(F2, c, d, a, b, buffer_[11] + 0x265e5a51, 14); + MD5STEP(F2, b, c, d, a, buffer_[0] + 0xe9b6c7aa, 20); + MD5STEP(F2, a, b, c, d, buffer_[5] + 0xd62f105d, 5); + MD5STEP(F2, d, a, b, c, buffer_[10] + 0x02441453, 9); + MD5STEP(F2, c, d, a, b, buffer_[15] + 0xd8a1e681, 14); + MD5STEP(F2, b, c, d, a, buffer_[4] + 0xe7d3fbc8, 20); + MD5STEP(F2, a, b, c, d, buffer_[9] + 0x21e1cde6, 5); + MD5STEP(F2, d, a, b, c, buffer_[14] + 0xc33707d6, 9); + MD5STEP(F2, c, d, a, b, buffer_[3] + 0xf4d50d87, 14); + MD5STEP(F2, b, c, d, a, buffer_[8] + 0x455a14ed, 20); + MD5STEP(F2, a, b, c, d, buffer_[13] + 0xa9e3e905, 5); + MD5STEP(F2, d, a, b, c, buffer_[2] + 0xfcefa3f8, 9); + MD5STEP(F2, c, d, a, b, buffer_[7] + 0x676f02d9, 14); + MD5STEP(F2, b, c, d, a, buffer_[12] + 0x8d2a4c8a, 20); + + MD5STEP(F3, a, b, c, d, buffer_[5] + 0xfffa3942, 4); + MD5STEP(F3, d, a, b, c, buffer_[8] + 0x8771f681, 11); + MD5STEP(F3, c, d, a, b, buffer_[11] + 0x6d9d6122, 16); + MD5STEP(F3, b, c, d, a, buffer_[14] + 0xfde5380c, 23); + MD5STEP(F3, a, b, c, d, buffer_[1] + 0xa4beea44, 4); + MD5STEP(F3, d, a, b, c, buffer_[4] + 0x4bdecfa9, 11); + MD5STEP(F3, c, d, a, b, buffer_[7] + 0xf6bb4b60, 16); + MD5STEP(F3, b, c, d, a, buffer_[10] + 0xbebfbc70, 23); + MD5STEP(F3, a, b, c, d, buffer_[13] + 0x289b7ec6, 4); + MD5STEP(F3, d, a, b, c, buffer_[0] + 0xeaa127fa, 11); + MD5STEP(F3, c, d, a, b, buffer_[3] + 0xd4ef3085, 16); + MD5STEP(F3, b, c, d, a, buffer_[6] + 0x04881d05, 23); + MD5STEP(F3, a, b, c, d, buffer_[9] + 0xd9d4d039, 4); + MD5STEP(F3, d, a, b, c, buffer_[12] + 0xe6db99e5, 11); + MD5STEP(F3, c, d, a, b, buffer_[15] + 0x1fa27cf8, 16); + MD5STEP(F3, b, c, d, a, buffer_[2] + 0xc4ac5665, 23); + + MD5STEP(F4, a, b, c, d, buffer_[0] + 0xf4292244, 6); + MD5STEP(F4, d, a, b, c, buffer_[7] + 0x432aff97, 10); + MD5STEP(F4, c, d, a, b, buffer_[14] + 0xab9423a7, 15); + MD5STEP(F4, b, c, d, a, buffer_[5] + 0xfc93a039, 21); + MD5STEP(F4, a, b, c, d, buffer_[12] + 0x655b59c3, 6); + MD5STEP(F4, d, a, b, c, buffer_[3] + 0x8f0ccc92, 10); + MD5STEP(F4, c, d, a, b, buffer_[10] + 0xffeff47d, 15); + MD5STEP(F4, b, c, d, a, buffer_[1] + 0x85845dd1, 21); + MD5STEP(F4, a, b, c, d, buffer_[8] + 0x6fa87e4f, 6); + MD5STEP(F4, d, a, b, c, buffer_[15] + 0xfe2ce6e0, 10); + MD5STEP(F4, c, d, a, b, buffer_[6] + 0xa3014314, 15); + MD5STEP(F4, b, c, d, a, buffer_[13] + 0x4e0811a1, 21); + MD5STEP(F4, a, b, c, d, buffer_[4] + 0xf7537e82, 6); + MD5STEP(F4, d, a, b, c, buffer_[11] + 0xbd3af235, 10); + MD5STEP(F4, c, d, a, b, buffer_[2] + 0x2ad7d2bb, 15); + MD5STEP(F4, b, c, d, a, buffer_[9] + 0xeb86d391, 21); + + // Add the working vars back into digest state[] + digest_[0] += a; + digest_[1] += b; + digest_[2] += c; + digest_[3] += d; + + // Wipe variables + a = b = c = d = 0; +} + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/misc.cpp b/externals/mysql/extlib/yassl/taocrypt/src/misc.cpp new file mode 100644 index 00000000000..402645c93fd --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/misc.cpp @@ -0,0 +1,296 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's misc.cpp from CryptoPP */ + + +#include "runtime.hpp" +#include "misc.hpp" + + +#ifdef __GNUC__ + #include + #include +#endif + +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + +namespace STL = STL_NAMESPACE; + + +#ifdef YASSL_PURE_C + + void* operator new(size_t sz, TaoCrypt::new_t) + { + void* ptr = malloc(sz ? sz : 1); + if (!ptr) abort(); + + return ptr; + } + + + void operator delete(void* ptr, TaoCrypt::new_t) + { + if (ptr) free(ptr); + } + + + void* operator new[](size_t sz, TaoCrypt::new_t nt) + { + return ::operator new(sz, nt); + } + + + void operator delete[](void* ptr, TaoCrypt::new_t nt) + { + ::operator delete(ptr, nt); + } + + + /* uncomment to test + // make sure not using globals anywhere by forgetting to use overloaded + void* operator new(size_t sz); + + void operator delete(void* ptr); + + void* operator new[](size_t sz); + + void operator delete[](void* ptr); + */ + + + namespace TaoCrypt { + + new_t tc; // for library new + + } + +#if defined(__ICC) || defined(__INTEL_COMPILER) + +extern "C" { + + int __cxa_pure_virtual() { + assert("Pure virtual method called." == "Aborted"); + return 0; + } + +} // extern "C" + +#endif + +#endif // YASSL_PURE_C + + +namespace TaoCrypt { + + +inline void XorWords(word* r, const word* a, unsigned int n) +{ + for (unsigned int i=0; i> (i-1)*8) + break; + + return i; +} + + +unsigned int BitPrecision(word value) +{ + if (!value) + return 0; + + unsigned int l = 0, + h = 8 * sizeof(value); + + while (h-l > 1) + { + unsigned int t = (l+h)/2; + if (value >> t) + l = t; + else + h = t; + } + + return h; +} + + +word Crop(word value, unsigned int size) +{ + if (size < 8*sizeof(value)) + return (value & ((1L << size) - 1)); + else + return value; +} + + + +#ifdef TAOCRYPT_X86ASM_AVAILABLE + +#ifndef _MSC_VER + static jmp_buf s_env; + static void SigIllHandler(int) + { + longjmp(s_env, 1); + } +#endif + + +bool HaveCpuId() +{ +#ifdef _MSC_VER + __try + { + __asm + { + mov eax, 0 + cpuid + } + } + __except (1) + { + return false; + } + return true; +#else + word32 eax, ebx; + __asm__ __volatile + ( + /* Put EFLAGS in eax and ebx */ + "pushf;" + "pushf;" + "pop %0;" + "movl %0,%1;" + + /* Flip the cpuid bit and store back in EFLAGS */ + "xorl $0x200000,%0;" + "push %0;" + "popf;" + + /* Read EFLAGS again */ + "pushf;" + "pop %0;" + "popf" + : "=r" (eax), "=r" (ebx) + : + : "cc" + ); + + if (eax == ebx) + return false; + return true; +#endif +} + + +void CpuId(word32 input, word32 *output) +{ +#ifdef __GNUC__ + __asm__ + ( + // save ebx in case -fPIC is being used + "push %%ebx; cpuid; mov %%ebx, %%edi; pop %%ebx" + : "=a" (output[0]), "=D" (output[1]), "=c" (output[2]), "=d"(output[3]) + : "a" (input) + ); +#else + __asm + { + mov eax, input + cpuid + mov edi, output + mov [edi], eax + mov [edi+4], ebx + mov [edi+8], ecx + mov [edi+12], edx + } +#endif +} + + +bool IsPentium() +{ + if (!HaveCpuId()) + return false; + + word32 cpuid[4]; + + CpuId(0, cpuid); + STL::swap(cpuid[2], cpuid[3]); + if (memcmp(cpuid+1, "GenuineIntel", 12) != 0) + return false; + + CpuId(1, cpuid); + byte family = ((cpuid[0] >> 8) & 0xf); + if (family < 5) + return false; + + return true; +} + + + +static bool IsMmx() +{ + if (!IsPentium()) + return false; + + word32 cpuid[4]; + + CpuId(1, cpuid); + if ((cpuid[3] & (1 << 23)) == 0) + return false; + + return true; +} + + +bool isMMX = IsMmx(); + + +#endif // TAOCRYPT_X86ASM_AVAILABLE + + + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/random.cpp b/externals/mysql/extlib/yassl/taocrypt/src/random.cpp new file mode 100644 index 00000000000..89fd5f7c7bc --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/random.cpp @@ -0,0 +1,200 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* random.cpp implements a crypto secure Random Number Generator using an OS + specific seed, switch to /dev/random for more security but may block +*/ + +#include "runtime.hpp" +#include "random.hpp" +#include +#include + +#if defined(_WIN32) + #define _WIN32_WINNT 0x0400 + #include + #include +#else + #include + #include + #include +#endif // _WIN32 + +namespace TaoCrypt { + + +// Get seed and key cipher +RandomNumberGenerator::RandomNumberGenerator() +{ + byte key[32]; + byte junk[256]; + + seed_.GenerateSeed(key, sizeof(key)); + cipher_.SetKey(key, sizeof(key)); + GenerateBlock(junk, sizeof(junk)); // rid initial state +} + + +// place a generated block in output +void RandomNumberGenerator::GenerateBlock(byte* output, word32 sz) +{ + memset(output, 0, sz); + cipher_.Process(output, output, sz); +} + + +byte RandomNumberGenerator::GenerateByte() +{ + byte b; + GenerateBlock(&b, 1); + + return b; +} + + +#if defined(_WIN32) + +/* The OS_Seed implementation for windows */ + +OS_Seed::OS_Seed() +{ + if(!CryptAcquireContext(&handle_, 0, 0, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT)) + error_.SetError(WINCRYPT_E); +} + + +OS_Seed::~OS_Seed() +{ + CryptReleaseContext(handle_, 0); +} + + +void OS_Seed::GenerateSeed(byte* output, word32 sz) +{ + if (!CryptGenRandom(handle_, sz, output)) + error_.SetError(CRYPTGEN_E); +} + + +#elif defined(__NETWARE__) + +/* The OS_Seed implementation for Netware */ + +#include +#include + +// Loop on high resulution Read Time Stamp Counter +static void NetwareSeed(byte* output, word32 sz) +{ + word32 tscResult; + + for (word32 i = 0; i < sz; i += sizeof(tscResult)) { + #if defined(__GNUC__) + asm volatile("rdtsc" : "=A" (tscResult)); + #else + #ifdef __MWERKS__ + asm { + #else + __asm { + #endif + rdtsc + mov tscResult, eax + } + #endif + + memcpy(output, &tscResult, sizeof(tscResult)); + output += sizeof(tscResult); + + NXThreadYield(); // induce more variance + } +} + + +OS_Seed::OS_Seed() +{ +} + + +OS_Seed::~OS_Seed() +{ +} + + +void OS_Seed::GenerateSeed(byte* output, word32 sz) +{ + /* + Try to use NXSeedRandom as it will generate a strong + seed using the onboard 82802 chip + + As it's not always supported, fallback to default + implementation if an error is returned + */ + + if (NXSeedRandom(sz, output) != 0) + { + NetwareSeed(output, sz); + } +} + + +#else + +/* The default OS_Seed implementation */ + +OS_Seed::OS_Seed() +{ + fd_ = open("/dev/urandom",O_RDONLY); + if (fd_ == -1) { + fd_ = open("/dev/random",O_RDONLY); + if (fd_ == -1) + error_.SetError(OPEN_RAN_E); + } +} + + +OS_Seed::~OS_Seed() +{ + close(fd_); +} + + +// may block +void OS_Seed::GenerateSeed(byte* output, word32 sz) +{ + while (sz) { + int len = read(fd_, output, sz); + if (len == -1) { + error_.SetError(READ_RAN_E); + return; + } + + sz -= len; + output += len; + + if (sz) + sleep(1); + } +} + +#endif // _WIN32 + + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/ripemd.cpp b/externals/mysql/extlib/yassl/taocrypt/src/ripemd.cpp new file mode 100644 index 00000000000..a738c197bf2 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/ripemd.cpp @@ -0,0 +1,834 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* based on Wei Dai's ripemd.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "ripemd.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + + +namespace TaoCrypt { + +void RIPEMD160::Init() +{ + digest_[0] = 0x67452301L; + digest_[1] = 0xefcdab89L; + digest_[2] = 0x98badcfeL; + digest_[3] = 0x10325476L; + digest_[4] = 0xc3d2e1f0L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +RIPEMD160::RIPEMD160(const RIPEMD160& that) + : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +RIPEMD160& RIPEMD160::operator= (const RIPEMD160& that) +{ + RIPEMD160 tmp(that); + Swap(tmp); + + return *this; +} + + +void RIPEMD160::Swap(RIPEMD160& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +#ifdef DO_RIPEMD_ASM + +// Update digest with data of size len +void RIPEMD160::Update(const byte* data, word32 len) +{ + if (!isMMX) { + HASHwithTransform::Update(data, len); + return; + } + + byte* local = reinterpret_cast(buffer_); + + // remove buffered data if possible + if (buffLen_) { + word32 add = min(len, BLOCK_SIZE - buffLen_); + memcpy(&local[buffLen_], data, add); + + buffLen_ += add; + data += add; + len -= add; + + if (buffLen_ == BLOCK_SIZE) { + Transform(); + AddLength(BLOCK_SIZE); + buffLen_ = 0; + } + } + + // all at once for asm + if (buffLen_ == 0) { + word32 times = len / BLOCK_SIZE; + if (times) { + AsmTransform(data, times); + const word32 add = BLOCK_SIZE * times; + AddLength(add); + len -= add; + data += add; + } + } + + // cache any data left + if (len) { + memcpy(&local[buffLen_], data, len); + buffLen_ += len; + } +} + +#endif // DO_RIPEMD_ASM + + +// for all +#define F(x, y, z) (x ^ y ^ z) +#define G(x, y, z) (z ^ (x & (y^z))) +#define H(x, y, z) (z ^ (x | ~y)) +#define I(x, y, z) (y ^ (z & (x^y))) +#define J(x, y, z) (x ^ (y | ~z)) + +#define k0 0 +#define k1 0x5a827999 +#define k2 0x6ed9eba1 +#define k3 0x8f1bbcdc +#define k4 0xa953fd4e +#define k5 0x50a28be6 +#define k6 0x5c4dd124 +#define k7 0x6d703ef3 +#define k8 0x7a6d76e9 +#define k9 0 + +// for 160 and 320 +#define Subround(f, a, b, c, d, e, x, s, k) \ + a += f(b, c, d) + x + k;\ + a = rotlFixed((word32)a, s) + e;\ + c = rotlFixed((word32)c, 10U) + + +void RIPEMD160::Transform() +{ + unsigned long a1, b1, c1, d1, e1, a2, b2, c2, d2, e2; + a1 = a2 = digest_[0]; + b1 = b2 = digest_[1]; + c1 = c2 = digest_[2]; + d1 = d2 = digest_[3]; + e1 = e2 = digest_[4]; + + Subround(F, a1, b1, c1, d1, e1, buffer_[ 0], 11, k0); + Subround(F, e1, a1, b1, c1, d1, buffer_[ 1], 14, k0); + Subround(F, d1, e1, a1, b1, c1, buffer_[ 2], 15, k0); + Subround(F, c1, d1, e1, a1, b1, buffer_[ 3], 12, k0); + Subround(F, b1, c1, d1, e1, a1, buffer_[ 4], 5, k0); + Subround(F, a1, b1, c1, d1, e1, buffer_[ 5], 8, k0); + Subround(F, e1, a1, b1, c1, d1, buffer_[ 6], 7, k0); + Subround(F, d1, e1, a1, b1, c1, buffer_[ 7], 9, k0); + Subround(F, c1, d1, e1, a1, b1, buffer_[ 8], 11, k0); + Subround(F, b1, c1, d1, e1, a1, buffer_[ 9], 13, k0); + Subround(F, a1, b1, c1, d1, e1, buffer_[10], 14, k0); + Subround(F, e1, a1, b1, c1, d1, buffer_[11], 15, k0); + Subround(F, d1, e1, a1, b1, c1, buffer_[12], 6, k0); + Subround(F, c1, d1, e1, a1, b1, buffer_[13], 7, k0); + Subround(F, b1, c1, d1, e1, a1, buffer_[14], 9, k0); + Subround(F, a1, b1, c1, d1, e1, buffer_[15], 8, k0); + + Subround(G, e1, a1, b1, c1, d1, buffer_[ 7], 7, k1); + Subround(G, d1, e1, a1, b1, c1, buffer_[ 4], 6, k1); + Subround(G, c1, d1, e1, a1, b1, buffer_[13], 8, k1); + Subround(G, b1, c1, d1, e1, a1, buffer_[ 1], 13, k1); + Subround(G, a1, b1, c1, d1, e1, buffer_[10], 11, k1); + Subround(G, e1, a1, b1, c1, d1, buffer_[ 6], 9, k1); + Subround(G, d1, e1, a1, b1, c1, buffer_[15], 7, k1); + Subround(G, c1, d1, e1, a1, b1, buffer_[ 3], 15, k1); + Subround(G, b1, c1, d1, e1, a1, buffer_[12], 7, k1); + Subround(G, a1, b1, c1, d1, e1, buffer_[ 0], 12, k1); + Subround(G, e1, a1, b1, c1, d1, buffer_[ 9], 15, k1); + Subround(G, d1, e1, a1, b1, c1, buffer_[ 5], 9, k1); + Subround(G, c1, d1, e1, a1, b1, buffer_[ 2], 11, k1); + Subround(G, b1, c1, d1, e1, a1, buffer_[14], 7, k1); + Subround(G, a1, b1, c1, d1, e1, buffer_[11], 13, k1); + Subround(G, e1, a1, b1, c1, d1, buffer_[ 8], 12, k1); + + Subround(H, d1, e1, a1, b1, c1, buffer_[ 3], 11, k2); + Subround(H, c1, d1, e1, a1, b1, buffer_[10], 13, k2); + Subround(H, b1, c1, d1, e1, a1, buffer_[14], 6, k2); + Subround(H, a1, b1, c1, d1, e1, buffer_[ 4], 7, k2); + Subround(H, e1, a1, b1, c1, d1, buffer_[ 9], 14, k2); + Subround(H, d1, e1, a1, b1, c1, buffer_[15], 9, k2); + Subround(H, c1, d1, e1, a1, b1, buffer_[ 8], 13, k2); + Subround(H, b1, c1, d1, e1, a1, buffer_[ 1], 15, k2); + Subround(H, a1, b1, c1, d1, e1, buffer_[ 2], 14, k2); + Subround(H, e1, a1, b1, c1, d1, buffer_[ 7], 8, k2); + Subround(H, d1, e1, a1, b1, c1, buffer_[ 0], 13, k2); + Subround(H, c1, d1, e1, a1, b1, buffer_[ 6], 6, k2); + Subround(H, b1, c1, d1, e1, a1, buffer_[13], 5, k2); + Subround(H, a1, b1, c1, d1, e1, buffer_[11], 12, k2); + Subround(H, e1, a1, b1, c1, d1, buffer_[ 5], 7, k2); + Subround(H, d1, e1, a1, b1, c1, buffer_[12], 5, k2); + + Subround(I, c1, d1, e1, a1, b1, buffer_[ 1], 11, k3); + Subround(I, b1, c1, d1, e1, a1, buffer_[ 9], 12, k3); + Subround(I, a1, b1, c1, d1, e1, buffer_[11], 14, k3); + Subround(I, e1, a1, b1, c1, d1, buffer_[10], 15, k3); + Subround(I, d1, e1, a1, b1, c1, buffer_[ 0], 14, k3); + Subround(I, c1, d1, e1, a1, b1, buffer_[ 8], 15, k3); + Subround(I, b1, c1, d1, e1, a1, buffer_[12], 9, k3); + Subround(I, a1, b1, c1, d1, e1, buffer_[ 4], 8, k3); + Subround(I, e1, a1, b1, c1, d1, buffer_[13], 9, k3); + Subround(I, d1, e1, a1, b1, c1, buffer_[ 3], 14, k3); + Subround(I, c1, d1, e1, a1, b1, buffer_[ 7], 5, k3); + Subround(I, b1, c1, d1, e1, a1, buffer_[15], 6, k3); + Subround(I, a1, b1, c1, d1, e1, buffer_[14], 8, k3); + Subround(I, e1, a1, b1, c1, d1, buffer_[ 5], 6, k3); + Subround(I, d1, e1, a1, b1, c1, buffer_[ 6], 5, k3); + Subround(I, c1, d1, e1, a1, b1, buffer_[ 2], 12, k3); + + Subround(J, b1, c1, d1, e1, a1, buffer_[ 4], 9, k4); + Subround(J, a1, b1, c1, d1, e1, buffer_[ 0], 15, k4); + Subround(J, e1, a1, b1, c1, d1, buffer_[ 5], 5, k4); + Subround(J, d1, e1, a1, b1, c1, buffer_[ 9], 11, k4); + Subround(J, c1, d1, e1, a1, b1, buffer_[ 7], 6, k4); + Subround(J, b1, c1, d1, e1, a1, buffer_[12], 8, k4); + Subround(J, a1, b1, c1, d1, e1, buffer_[ 2], 13, k4); + Subround(J, e1, a1, b1, c1, d1, buffer_[10], 12, k4); + Subround(J, d1, e1, a1, b1, c1, buffer_[14], 5, k4); + Subround(J, c1, d1, e1, a1, b1, buffer_[ 1], 12, k4); + Subround(J, b1, c1, d1, e1, a1, buffer_[ 3], 13, k4); + Subround(J, a1, b1, c1, d1, e1, buffer_[ 8], 14, k4); + Subround(J, e1, a1, b1, c1, d1, buffer_[11], 11, k4); + Subround(J, d1, e1, a1, b1, c1, buffer_[ 6], 8, k4); + Subround(J, c1, d1, e1, a1, b1, buffer_[15], 5, k4); + Subround(J, b1, c1, d1, e1, a1, buffer_[13], 6, k4); + + Subround(J, a2, b2, c2, d2, e2, buffer_[ 5], 8, k5); + Subround(J, e2, a2, b2, c2, d2, buffer_[14], 9, k5); + Subround(J, d2, e2, a2, b2, c2, buffer_[ 7], 9, k5); + Subround(J, c2, d2, e2, a2, b2, buffer_[ 0], 11, k5); + Subround(J, b2, c2, d2, e2, a2, buffer_[ 9], 13, k5); + Subround(J, a2, b2, c2, d2, e2, buffer_[ 2], 15, k5); + Subround(J, e2, a2, b2, c2, d2, buffer_[11], 15, k5); + Subround(J, d2, e2, a2, b2, c2, buffer_[ 4], 5, k5); + Subround(J, c2, d2, e2, a2, b2, buffer_[13], 7, k5); + Subround(J, b2, c2, d2, e2, a2, buffer_[ 6], 7, k5); + Subround(J, a2, b2, c2, d2, e2, buffer_[15], 8, k5); + Subround(J, e2, a2, b2, c2, d2, buffer_[ 8], 11, k5); + Subround(J, d2, e2, a2, b2, c2, buffer_[ 1], 14, k5); + Subround(J, c2, d2, e2, a2, b2, buffer_[10], 14, k5); + Subround(J, b2, c2, d2, e2, a2, buffer_[ 3], 12, k5); + Subround(J, a2, b2, c2, d2, e2, buffer_[12], 6, k5); + + Subround(I, e2, a2, b2, c2, d2, buffer_[ 6], 9, k6); + Subround(I, d2, e2, a2, b2, c2, buffer_[11], 13, k6); + Subround(I, c2, d2, e2, a2, b2, buffer_[ 3], 15, k6); + Subround(I, b2, c2, d2, e2, a2, buffer_[ 7], 7, k6); + Subround(I, a2, b2, c2, d2, e2, buffer_[ 0], 12, k6); + Subround(I, e2, a2, b2, c2, d2, buffer_[13], 8, k6); + Subround(I, d2, e2, a2, b2, c2, buffer_[ 5], 9, k6); + Subround(I, c2, d2, e2, a2, b2, buffer_[10], 11, k6); + Subround(I, b2, c2, d2, e2, a2, buffer_[14], 7, k6); + Subround(I, a2, b2, c2, d2, e2, buffer_[15], 7, k6); + Subround(I, e2, a2, b2, c2, d2, buffer_[ 8], 12, k6); + Subround(I, d2, e2, a2, b2, c2, buffer_[12], 7, k6); + Subround(I, c2, d2, e2, a2, b2, buffer_[ 4], 6, k6); + Subround(I, b2, c2, d2, e2, a2, buffer_[ 9], 15, k6); + Subround(I, a2, b2, c2, d2, e2, buffer_[ 1], 13, k6); + Subround(I, e2, a2, b2, c2, d2, buffer_[ 2], 11, k6); + + Subround(H, d2, e2, a2, b2, c2, buffer_[15], 9, k7); + Subround(H, c2, d2, e2, a2, b2, buffer_[ 5], 7, k7); + Subround(H, b2, c2, d2, e2, a2, buffer_[ 1], 15, k7); + Subround(H, a2, b2, c2, d2, e2, buffer_[ 3], 11, k7); + Subround(H, e2, a2, b2, c2, d2, buffer_[ 7], 8, k7); + Subround(H, d2, e2, a2, b2, c2, buffer_[14], 6, k7); + Subround(H, c2, d2, e2, a2, b2, buffer_[ 6], 6, k7); + Subround(H, b2, c2, d2, e2, a2, buffer_[ 9], 14, k7); + Subround(H, a2, b2, c2, d2, e2, buffer_[11], 12, k7); + Subround(H, e2, a2, b2, c2, d2, buffer_[ 8], 13, k7); + Subround(H, d2, e2, a2, b2, c2, buffer_[12], 5, k7); + Subround(H, c2, d2, e2, a2, b2, buffer_[ 2], 14, k7); + Subround(H, b2, c2, d2, e2, a2, buffer_[10], 13, k7); + Subround(H, a2, b2, c2, d2, e2, buffer_[ 0], 13, k7); + Subround(H, e2, a2, b2, c2, d2, buffer_[ 4], 7, k7); + Subround(H, d2, e2, a2, b2, c2, buffer_[13], 5, k7); + + Subround(G, c2, d2, e2, a2, b2, buffer_[ 8], 15, k8); + Subround(G, b2, c2, d2, e2, a2, buffer_[ 6], 5, k8); + Subround(G, a2, b2, c2, d2, e2, buffer_[ 4], 8, k8); + Subround(G, e2, a2, b2, c2, d2, buffer_[ 1], 11, k8); + Subround(G, d2, e2, a2, b2, c2, buffer_[ 3], 14, k8); + Subround(G, c2, d2, e2, a2, b2, buffer_[11], 14, k8); + Subround(G, b2, c2, d2, e2, a2, buffer_[15], 6, k8); + Subround(G, a2, b2, c2, d2, e2, buffer_[ 0], 14, k8); + Subround(G, e2, a2, b2, c2, d2, buffer_[ 5], 6, k8); + Subround(G, d2, e2, a2, b2, c2, buffer_[12], 9, k8); + Subround(G, c2, d2, e2, a2, b2, buffer_[ 2], 12, k8); + Subround(G, b2, c2, d2, e2, a2, buffer_[13], 9, k8); + Subround(G, a2, b2, c2, d2, e2, buffer_[ 9], 12, k8); + Subround(G, e2, a2, b2, c2, d2, buffer_[ 7], 5, k8); + Subround(G, d2, e2, a2, b2, c2, buffer_[10], 15, k8); + Subround(G, c2, d2, e2, a2, b2, buffer_[14], 8, k8); + + Subround(F, b2, c2, d2, e2, a2, buffer_[12], 8, k9); + Subround(F, a2, b2, c2, d2, e2, buffer_[15], 5, k9); + Subround(F, e2, a2, b2, c2, d2, buffer_[10], 12, k9); + Subround(F, d2, e2, a2, b2, c2, buffer_[ 4], 9, k9); + Subround(F, c2, d2, e2, a2, b2, buffer_[ 1], 12, k9); + Subround(F, b2, c2, d2, e2, a2, buffer_[ 5], 5, k9); + Subround(F, a2, b2, c2, d2, e2, buffer_[ 8], 14, k9); + Subround(F, e2, a2, b2, c2, d2, buffer_[ 7], 6, k9); + Subround(F, d2, e2, a2, b2, c2, buffer_[ 6], 8, k9); + Subround(F, c2, d2, e2, a2, b2, buffer_[ 2], 13, k9); + Subround(F, b2, c2, d2, e2, a2, buffer_[13], 6, k9); + Subround(F, a2, b2, c2, d2, e2, buffer_[14], 5, k9); + Subround(F, e2, a2, b2, c2, d2, buffer_[ 0], 15, k9); + Subround(F, d2, e2, a2, b2, c2, buffer_[ 3], 13, k9); + Subround(F, c2, d2, e2, a2, b2, buffer_[ 9], 11, k9); + Subround(F, b2, c2, d2, e2, a2, buffer_[11], 11, k9); + + c1 = digest_[1] + c1 + d2; + digest_[1] = digest_[2] + d1 + e2; + digest_[2] = digest_[3] + e1 + a2; + digest_[3] = digest_[4] + a1 + b2; + digest_[4] = digest_[0] + b1 + c2; + digest_[0] = c1; +} + + +#ifdef DO_RIPEMD_ASM + +/* + // F(x ^ y ^ z) + // place in esi +#define ASMF(x, y, z) \ + AS2( mov esi, x ) \ + AS2( xor esi, y ) \ + AS2( xor esi, z ) + + + // G(z ^ (x & (y^z))) + // place in esi +#define ASMG(x, y, z) \ + AS2( mov esi, z ) \ + AS2( xor esi, y ) \ + AS2( and esi, x ) \ + AS2( xor esi, z ) + + + // H(z ^ (x | ~y)) + // place in esi +#define ASMH(x, y, z) \ + AS2( mov esi, y ) \ + AS1( not esi ) \ + AS2( or esi, x ) \ + AS2( xor esi, z ) + + + // I(y ^ (z & (x^y))) + // place in esi +#define ASMI(x, y, z) \ + AS2( mov esi, y ) \ + AS2( xor esi, x ) \ + AS2( and esi, z ) \ + AS2( xor esi, y ) + + + // J(x ^ (y | ~z))) + // place in esi +#define ASMJ(x, y, z) \ + AS2( mov esi, z ) \ + AS1( not esi ) \ + AS2( or esi, y ) \ + AS2( xor esi, x ) + + +// for 160 and 320 +// #define ASMSubround(f, a, b, c, d, e, i, s, k) +// a += f(b, c, d) + data[i] + k; +// a = rotlFixed((word32)a, s) + e; +// c = rotlFixed((word32)c, 10U) + +#define ASMSubround(f, a, b, c, d, e, index, s, k) \ + // a += f(b, c, d) + data[i] + k \ + AS2( mov esp, [edi + index * 4] ) \ + f(b, c, d) \ + AS2( add esi, k ) \ + AS2( add esi, esp ) \ + AS2( add a, esi ) \ + // a = rotlFixed((word32)a, s) + e \ + AS2( rol a, s ) \ + AS2( rol c, 10 ) \ + // c = rotlFixed((word32)c, 10U) \ + AS2( add a, e ) +*/ + + +// combine F into subround w/ setup +// esi already has c, setup for next round when done +// esp already has edi[index], setup for next round when done + +#define ASMSubroundF(a, b, c, d, e, index, s) \ + /* a += (b ^ c ^ d) + data[i] + k */ \ + AS2( xor esi, b ) \ + AS2( add a, [edi + index * 4] ) \ + AS2( xor esi, d ) \ + AS2( add a, esi ) \ + /* a = rotlFixed((word32)a, s) + e */ \ + AS2( mov esi, b ) \ + AS2( rol a, s ) \ + /* c = rotlFixed((word32)c, 10U) */ \ + AS2( rol c, 10 ) \ + AS2( add a, e ) + + +// combine G into subround w/ setup +// esi already has c, setup for next round when done +// esp already has edi[index], setup for next round when done + +#define ASMSubroundG(a, b, c, d, e, index, s, k) \ + /* a += (d ^ (b & (c^d))) + data[i] + k */ \ + AS2( xor esi, d ) \ + AS2( and esi, b ) \ + AS2( add a, [edi + index * 4] ) \ + AS2( xor esi, d ) \ + AS2( lea a, [esi + a + k] ) \ + /* a = rotlFixed((word32)a, s) + e */ \ + AS2( mov esi, b ) \ + AS2( rol a, s ) \ + /* c = rotlFixed((word32)c, 10U) */ \ + AS2( rol c, 10 ) \ + AS2( add a, e ) + + +// combine H into subround w/ setup +// esi already has c, setup for next round when done +// esp already has edi[index], setup for next round when done + +#define ASMSubroundH(a, b, c, d, e, index, s, k) \ + /* a += (d ^ (b | ~c)) + data[i] + k */ \ + AS1( not esi ) \ + AS2( or esi, b ) \ + AS2( add a, [edi + index * 4] ) \ + AS2( xor esi, d ) \ + AS2( lea a, [esi + a + k] ) \ + /* a = rotlFixed((word32)a, s) + e */ \ + AS2( mov esi, b ) \ + AS2( rol a, s ) \ + /* c = rotlFixed((word32)c, 10U) */ \ + AS2( rol c, 10 ) \ + AS2( add a, e ) + + +// combine I into subround w/ setup +// esi already has c, setup for next round when done +// esp already has edi[index], setup for next round when done + +#define ASMSubroundI(a, b, c, d, e, index, s, k) \ + /* a += (c ^ (d & (b^c))) + data[i] + k */ \ + AS2( xor esi, b ) \ + AS2( and esi, d ) \ + AS2( add a, [edi + index * 4] ) \ + AS2( xor esi, c ) \ + AS2( lea a, [esi + a + k] ) \ + /* a = rotlFixed((word32)a, s) + e */ \ + AS2( mov esi, b ) \ + AS2( rol a, s ) \ + /* c = rotlFixed((word32)c, 10U) */ \ + AS2( rol c, 10 ) \ + AS2( add a, e ) + + +// combine J into subround w/ setup +// esi already has d, setup for next round when done +// esp already has edi[index], setup for next round when done + +#define ASMSubroundJ(a, b, c, d, e, index, s, k) \ + /* a += (b ^ (c | ~d))) + data[i] + k */ \ + AS1( not esi ) \ + AS2( or esi, c ) \ + /* c = rotlFixed((word32)c, 10U) */ \ + AS2( add a, [edi + index * 4] ) \ + AS2( xor esi, b ) \ + AS2( rol c, 10 ) \ + AS2( lea a, [esi + a + k] ) \ + /* a = rotlFixed((word32)a, s) + e */ \ + AS2( rol a, s ) \ + AS2( mov esi, c ) \ + AS2( add a, e ) + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void RIPEMD160::AsmTransform(const byte* data, word32 times) +{ +#ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov ecx, DWORD PTR [ebp + 8] ) \ + AS2( mov edi, DWORD PTR [ebp + 12] ) \ + AS2( mov edx, DWORD PTR [ebp + 16] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( mov esp, ebp ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); +#else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edi, DWORD PTR [ebp + 8] ) \ + AS2( mov edx, DWORD PTR [ebp + 12] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 8 ) + +#endif + + PROLOG() + + #ifdef OLD_GCC_OFFSET + AS2( lea esi, [ecx + 20] ) // digest_[0] + #else + AS2( lea esi, [ecx + 16] ) // digest_[0] + #endif + + AS2( sub esp, 24 ) // make room for tmp a1 - e1 + AS2( movd mm1, esi ) // store digest_ + +AS1( loopStart: ) + + AS2( movd mm2, edx ) // store times_ + + AS2( mov eax, [esi] ) // a1 + AS2( mov ebx, [esi + 4] ) // b1 + AS2( mov ecx, [esi + 8] ) // c1 + AS2( mov edx, [esi + 12] ) // d1 + AS2( mov ebp, [esi + 16] ) // e1 + + // setup + AS2( mov esi, ecx ) + + ASMSubroundF( eax, ebx, ecx, edx, ebp, 0, 11) + ASMSubroundF( ebp, eax, ebx, ecx, edx, 1, 14) + ASMSubroundF( edx, ebp, eax, ebx, ecx, 2, 15) + ASMSubroundF( ecx, edx, ebp, eax, ebx, 3, 12) + ASMSubroundF( ebx, ecx, edx, ebp, eax, 4, 5) + ASMSubroundF( eax, ebx, ecx, edx, ebp, 5, 8) + ASMSubroundF( ebp, eax, ebx, ecx, edx, 6, 7) + ASMSubroundF( edx, ebp, eax, ebx, ecx, 7, 9) + ASMSubroundF( ecx, edx, ebp, eax, ebx, 8, 11) + ASMSubroundF( ebx, ecx, edx, ebp, eax, 9, 13) + ASMSubroundF( eax, ebx, ecx, edx, ebp, 10, 14) + ASMSubroundF( ebp, eax, ebx, ecx, edx, 11, 15) + ASMSubroundF( edx, ebp, eax, ebx, ecx, 12, 6) + ASMSubroundF( ecx, edx, ebp, eax, ebx, 13, 7) + ASMSubroundF( ebx, ecx, edx, ebp, eax, 14, 9) + ASMSubroundF( eax, ebx, ecx, edx, ebp, 15, 8) + + ASMSubroundG( ebp, eax, ebx, ecx, edx, 7, 7, k1) + ASMSubroundG( edx, ebp, eax, ebx, ecx, 4, 6, k1) + ASMSubroundG( ecx, edx, ebp, eax, ebx, 13, 8, k1) + ASMSubroundG( ebx, ecx, edx, ebp, eax, 1, 13, k1) + ASMSubroundG( eax, ebx, ecx, edx, ebp, 10, 11, k1) + ASMSubroundG( ebp, eax, ebx, ecx, edx, 6, 9, k1) + ASMSubroundG( edx, ebp, eax, ebx, ecx, 15, 7, k1) + ASMSubroundG( ecx, edx, ebp, eax, ebx, 3, 15, k1) + ASMSubroundG( ebx, ecx, edx, ebp, eax, 12, 7, k1) + ASMSubroundG( eax, ebx, ecx, edx, ebp, 0, 12, k1) + ASMSubroundG( ebp, eax, ebx, ecx, edx, 9, 15, k1) + ASMSubroundG( edx, ebp, eax, ebx, ecx, 5, 9, k1) + ASMSubroundG( ecx, edx, ebp, eax, ebx, 2, 11, k1) + ASMSubroundG( ebx, ecx, edx, ebp, eax, 14, 7, k1) + ASMSubroundG( eax, ebx, ecx, edx, ebp, 11, 13, k1) + ASMSubroundG( ebp, eax, ebx, ecx, edx, 8, 12, k1) + + ASMSubroundH( edx, ebp, eax, ebx, ecx, 3, 11, k2) + ASMSubroundH( ecx, edx, ebp, eax, ebx, 10, 13, k2) + ASMSubroundH( ebx, ecx, edx, ebp, eax, 14, 6, k2) + ASMSubroundH( eax, ebx, ecx, edx, ebp, 4, 7, k2) + ASMSubroundH( ebp, eax, ebx, ecx, edx, 9, 14, k2) + ASMSubroundH( edx, ebp, eax, ebx, ecx, 15, 9, k2) + ASMSubroundH( ecx, edx, ebp, eax, ebx, 8, 13, k2) + ASMSubroundH( ebx, ecx, edx, ebp, eax, 1, 15, k2) + ASMSubroundH( eax, ebx, ecx, edx, ebp, 2, 14, k2) + ASMSubroundH( ebp, eax, ebx, ecx, edx, 7, 8, k2) + ASMSubroundH( edx, ebp, eax, ebx, ecx, 0, 13, k2) + ASMSubroundH( ecx, edx, ebp, eax, ebx, 6, 6, k2) + ASMSubroundH( ebx, ecx, edx, ebp, eax, 13, 5, k2) + ASMSubroundH( eax, ebx, ecx, edx, ebp, 11, 12, k2) + ASMSubroundH( ebp, eax, ebx, ecx, edx, 5, 7, k2) + ASMSubroundH( edx, ebp, eax, ebx, ecx, 12, 5, k2) + + ASMSubroundI( ecx, edx, ebp, eax, ebx, 1, 11, k3) + ASMSubroundI( ebx, ecx, edx, ebp, eax, 9, 12, k3) + ASMSubroundI( eax, ebx, ecx, edx, ebp, 11, 14, k3) + ASMSubroundI( ebp, eax, ebx, ecx, edx, 10, 15, k3) + ASMSubroundI( edx, ebp, eax, ebx, ecx, 0, 14, k3) + ASMSubroundI( ecx, edx, ebp, eax, ebx, 8, 15, k3) + ASMSubroundI( ebx, ecx, edx, ebp, eax, 12, 9, k3) + ASMSubroundI( eax, ebx, ecx, edx, ebp, 4, 8, k3) + ASMSubroundI( ebp, eax, ebx, ecx, edx, 13, 9, k3) + ASMSubroundI( edx, ebp, eax, ebx, ecx, 3, 14, k3) + ASMSubroundI( ecx, edx, ebp, eax, ebx, 7, 5, k3) + ASMSubroundI( ebx, ecx, edx, ebp, eax, 15, 6, k3) + ASMSubroundI( eax, ebx, ecx, edx, ebp, 14, 8, k3) + ASMSubroundI( ebp, eax, ebx, ecx, edx, 5, 6, k3) + ASMSubroundI( edx, ebp, eax, ebx, ecx, 6, 5, k3) + ASMSubroundI( ecx, edx, ebp, eax, ebx, 2, 12, k3) + + // setup + AS2( mov esi, ebp ) + + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 4, 9, k4) + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 0, 15, k4) + ASMSubroundJ( ebp, eax, ebx, ecx, edx, 5, 5, k4) + ASMSubroundJ( edx, ebp, eax, ebx, ecx, 9, 11, k4) + ASMSubroundJ( ecx, edx, ebp, eax, ebx, 7, 6, k4) + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 12, 8, k4) + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 2, 13, k4) + ASMSubroundJ( ebp, eax, ebx, ecx, edx, 10, 12, k4) + ASMSubroundJ( edx, ebp, eax, ebx, ecx, 14, 5, k4) + ASMSubroundJ( ecx, edx, ebp, eax, ebx, 1, 12, k4) + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 3, 13, k4) + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 8, 14, k4) + ASMSubroundJ( ebp, eax, ebx, ecx, edx, 11, 11, k4) + ASMSubroundJ( edx, ebp, eax, ebx, ecx, 6, 8, k4) + ASMSubroundJ( ecx, edx, ebp, eax, ebx, 15, 5, k4) + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 13, 6, k4) + + // store a1 - e1 on stack + AS2( movd esi, mm1 ) // digest_ + + AS2( mov [esp], eax ) + AS2( mov [esp + 4], ebx ) + AS2( mov [esp + 8], ecx ) + AS2( mov [esp + 12], edx ) + AS2( mov [esp + 16], ebp ) + + AS2( mov eax, [esi] ) // a2 + AS2( mov ebx, [esi + 4] ) // b2 + AS2( mov ecx, [esi + 8] ) // c2 + AS2( mov edx, [esi + 12] ) // d2 + AS2( mov ebp, [esi + 16] ) // e2 + + + // setup + AS2( mov esi, edx ) + + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 5, 8, k5) + ASMSubroundJ( ebp, eax, ebx, ecx, edx, 14, 9, k5) + ASMSubroundJ( edx, ebp, eax, ebx, ecx, 7, 9, k5) + ASMSubroundJ( ecx, edx, ebp, eax, ebx, 0, 11, k5) + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 9, 13, k5) + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 2, 15, k5) + ASMSubroundJ( ebp, eax, ebx, ecx, edx, 11, 15, k5) + ASMSubroundJ( edx, ebp, eax, ebx, ecx, 4, 5, k5) + ASMSubroundJ( ecx, edx, ebp, eax, ebx, 13, 7, k5) + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 6, 7, k5) + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 15, 8, k5) + ASMSubroundJ( ebp, eax, ebx, ecx, edx, 8, 11, k5) + ASMSubroundJ( edx, ebp, eax, ebx, ecx, 1, 14, k5) + ASMSubroundJ( ecx, edx, ebp, eax, ebx, 10, 14, k5) + ASMSubroundJ( ebx, ecx, edx, ebp, eax, 3, 12, k5) + ASMSubroundJ( eax, ebx, ecx, edx, ebp, 12, 6, k5) + + // setup + AS2( mov esi, ebx ) + + ASMSubroundI( ebp, eax, ebx, ecx, edx, 6, 9, k6) + ASMSubroundI( edx, ebp, eax, ebx, ecx, 11, 13, k6) + ASMSubroundI( ecx, edx, ebp, eax, ebx, 3, 15, k6) + ASMSubroundI( ebx, ecx, edx, ebp, eax, 7, 7, k6) + ASMSubroundI( eax, ebx, ecx, edx, ebp, 0, 12, k6) + ASMSubroundI( ebp, eax, ebx, ecx, edx, 13, 8, k6) + ASMSubroundI( edx, ebp, eax, ebx, ecx, 5, 9, k6) + ASMSubroundI( ecx, edx, ebp, eax, ebx, 10, 11, k6) + ASMSubroundI( ebx, ecx, edx, ebp, eax, 14, 7, k6) + ASMSubroundI( eax, ebx, ecx, edx, ebp, 15, 7, k6) + ASMSubroundI( ebp, eax, ebx, ecx, edx, 8, 12, k6) + ASMSubroundI( edx, ebp, eax, ebx, ecx, 12, 7, k6) + ASMSubroundI( ecx, edx, ebp, eax, ebx, 4, 6, k6) + ASMSubroundI( ebx, ecx, edx, ebp, eax, 9, 15, k6) + ASMSubroundI( eax, ebx, ecx, edx, ebp, 1, 13, k6) + ASMSubroundI( ebp, eax, ebx, ecx, edx, 2, 11, k6) + + ASMSubroundH( edx, ebp, eax, ebx, ecx, 15, 9, k7) + ASMSubroundH( ecx, edx, ebp, eax, ebx, 5, 7, k7) + ASMSubroundH( ebx, ecx, edx, ebp, eax, 1, 15, k7) + ASMSubroundH( eax, ebx, ecx, edx, ebp, 3, 11, k7) + ASMSubroundH( ebp, eax, ebx, ecx, edx, 7, 8, k7) + ASMSubroundH( edx, ebp, eax, ebx, ecx, 14, 6, k7) + ASMSubroundH( ecx, edx, ebp, eax, ebx, 6, 6, k7) + ASMSubroundH( ebx, ecx, edx, ebp, eax, 9, 14, k7) + ASMSubroundH( eax, ebx, ecx, edx, ebp, 11, 12, k7) + ASMSubroundH( ebp, eax, ebx, ecx, edx, 8, 13, k7) + ASMSubroundH( edx, ebp, eax, ebx, ecx, 12, 5, k7) + ASMSubroundH( ecx, edx, ebp, eax, ebx, 2, 14, k7) + ASMSubroundH( ebx, ecx, edx, ebp, eax, 10, 13, k7) + ASMSubroundH( eax, ebx, ecx, edx, ebp, 0, 13, k7) + ASMSubroundH( ebp, eax, ebx, ecx, edx, 4, 7, k7) + ASMSubroundH( edx, ebp, eax, ebx, ecx, 13, 5, k7) + + ASMSubroundG( ecx, edx, ebp, eax, ebx, 8, 15, k8) + ASMSubroundG( ebx, ecx, edx, ebp, eax, 6, 5, k8) + ASMSubroundG( eax, ebx, ecx, edx, ebp, 4, 8, k8) + ASMSubroundG( ebp, eax, ebx, ecx, edx, 1, 11, k8) + ASMSubroundG( edx, ebp, eax, ebx, ecx, 3, 14, k8) + ASMSubroundG( ecx, edx, ebp, eax, ebx, 11, 14, k8) + ASMSubroundG( ebx, ecx, edx, ebp, eax, 15, 6, k8) + ASMSubroundG( eax, ebx, ecx, edx, ebp, 0, 14, k8) + ASMSubroundG( ebp, eax, ebx, ecx, edx, 5, 6, k8) + ASMSubroundG( edx, ebp, eax, ebx, ecx, 12, 9, k8) + ASMSubroundG( ecx, edx, ebp, eax, ebx, 2, 12, k8) + ASMSubroundG( ebx, ecx, edx, ebp, eax, 13, 9, k8) + ASMSubroundG( eax, ebx, ecx, edx, ebp, 9, 12, k8) + ASMSubroundG( ebp, eax, ebx, ecx, edx, 7, 5, k8) + ASMSubroundG( edx, ebp, eax, ebx, ecx, 10, 15, k8) + ASMSubroundG( ecx, edx, ebp, eax, ebx, 14, 8, k8) + + ASMSubroundF( ebx, ecx, edx, ebp, eax, 12, 8) + ASMSubroundF( eax, ebx, ecx, edx, ebp, 15, 5) + ASMSubroundF( ebp, eax, ebx, ecx, edx, 10, 12) + ASMSubroundF( edx, ebp, eax, ebx, ecx, 4, 9) + ASMSubroundF( ecx, edx, ebp, eax, ebx, 1, 12) + ASMSubroundF( ebx, ecx, edx, ebp, eax, 5, 5) + ASMSubroundF( eax, ebx, ecx, edx, ebp, 8, 14) + ASMSubroundF( ebp, eax, ebx, ecx, edx, 7, 6) + ASMSubroundF( edx, ebp, eax, ebx, ecx, 6, 8) + ASMSubroundF( ecx, edx, ebp, eax, ebx, 2, 13) + ASMSubroundF( ebx, ecx, edx, ebp, eax, 13, 6) + ASMSubroundF( eax, ebx, ecx, edx, ebp, 14, 5) + ASMSubroundF( ebp, eax, ebx, ecx, edx, 0, 15) + ASMSubroundF( edx, ebp, eax, ebx, ecx, 3, 13) + ASMSubroundF( ecx, edx, ebp, eax, ebx, 9, 11) + ASMSubroundF( ebx, ecx, edx, ebp, eax, 11, 11) + + // advance data and store for next round + AS2( add edi, 64 ) + AS2( movd esi, mm1 ) // digest_ + AS2( movd mm0, edi ) // store + + // now edi as tmp + + // c1 = digest_[1] + c1 + d2; + AS2( add [esp + 8], edx ) // + d2 + AS2( mov edi, [esi + 4] ) // digest_[1] + AS2( add [esp + 8], edi ) + + // digest_[1] = digest_[2] + d1 + e2; + AS2( mov [esi + 4], ebp ) // e2 + AS2( mov edi, [esp + 12] ) // d1 + AS2( add edi, [esi + 8] ) // digest_[2] + AS2( add [esi + 4], edi ) + + // digest_[2] = digest_[3] + e1 + a2; + AS2( mov [esi + 8], eax ) // a2 + AS2( mov edi, [esp + 16] ) // e1 + AS2( add edi, [esi + 12] ) // digest_[3] + AS2( add [esi + 8], edi ) + + // digest_[3] = digest_[4] + a1 + b2; + AS2( mov [esi + 12], ebx ) // b2 + AS2( mov edi, [esp] ) // a1 + AS2( add edi, [esi + 16] ) // digest_[4] + AS2( add [esi + 12], edi ) + + // digest_[4] = digest_[0] + b1 + c2; + AS2( mov [esi + 16], ecx ) // c2 + AS2( mov edi, [esp + 4] ) // b1 + AS2( add edi, [esi] ) // digest_[0] + AS2( add [esi + 16], edi ) + + // digest_[0] = c1; + AS2( mov edi, [esp + 8] ) // c1 + AS2( mov [esi], edi ) + + // setup for loop back + AS2( movd edx, mm2 ) // times + AS2( movd edi, mm0 ) // data, already advanced + AS1( dec edx ) + AS1( jnz loopStart ) + + + EPILOG() +} + + +#endif // DO_RIPEMD_ASM + + +} // namespace TaoCrypt diff --git a/externals/mysql/extlib/yassl/taocrypt/src/rsa.cpp b/externals/mysql/extlib/yassl/taocrypt/src/rsa.cpp new file mode 100644 index 00000000000..57d19a59c76 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/rsa.cpp @@ -0,0 +1,210 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's rsa.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "rsa.hpp" +#include "asn.hpp" +#include "modarith.hpp" + + + +namespace TaoCrypt { + + +Integer RSA_PublicKey::ApplyFunction(const Integer& x) const +{ + return a_exp_b_mod_c(x, e_, n_); +} + + +RSA_PublicKey::RSA_PublicKey(Source& source) +{ + Initialize(source); +} + + +void RSA_PublicKey::Initialize(Source& source) +{ + RSA_Public_Decoder decoder(source); + decoder.Decode(*this); +} + + +Integer RSA_PrivateKey::CalculateInverse(RandomNumberGenerator& rng, + const Integer& x) const +{ + ModularArithmetic modn(n_); + + Integer r(rng, Integer::One(), n_ - Integer::One()); + Integer re = modn.Exponentiate(r, e_); + re = modn.Multiply(re, x); // blind + + // here we follow the notation of PKCS #1 and let u=q inverse mod p + // but in ModRoot, u=p inverse mod q, so we reverse the order of p and q + + Integer y = ModularRoot(re, dq_, dp_, q_, p_, u_); + y = modn.Divide(y, r); // unblind + assert(modn.Exponentiate(y, e_) == x); // check + + return y; +} + + +RSA_PrivateKey::RSA_PrivateKey(Source& source) +{ + Initialize(source); +} + + +void RSA_PrivateKey::Initialize(Source& source) +{ + RSA_Private_Decoder decoder(source); + decoder.Decode(*this); +} + + +void RSA_BlockType2::Pad(const byte *input, word32 inputLen, byte *pkcsBlock, + word32 pkcsBlockLen, RandomNumberGenerator& rng) const +{ + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + pkcsBlock[0] = 0; + pkcsBlock++; + } + pkcsBlockLen /= 8; + + pkcsBlock[0] = 2; // block type 2 + + // pad with non-zero random bytes + word32 padLen = pkcsBlockLen - inputLen - 1; + rng.GenerateBlock(&pkcsBlock[1], padLen); + for (word32 i = 1; i < padLen; i++) + if (pkcsBlock[i] == 0) pkcsBlock[i] = 0x01; + + pkcsBlock[pkcsBlockLen-inputLen-1] = 0; // separator + memcpy(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen); +} + +word32 RSA_BlockType2::UnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen, + byte *output) const +{ + bool invalid = false; + unsigned int maxOutputLen = SaturatingSubtract(pkcsBlockLen / 8, 10U); + + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + invalid = (pkcsBlock[0] != 0) || invalid; + pkcsBlock++; + } + pkcsBlockLen /= 8; + + // Require block type 2. + invalid = (pkcsBlock[0] != 2) || invalid; + + // skip past the padding until we find the separator + unsigned i=1; + while (i maxOutputLen) || invalid; + + if (invalid) + return 0; + + memcpy (output, pkcsBlock+i, outputLen); + return outputLen; +} + + +void RSA_BlockType1::Pad(const byte* input, word32 inputLen, byte* pkcsBlock, + word32 pkcsBlockLen, RandomNumberGenerator&) const +{ + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + pkcsBlock[0] = 0; + pkcsBlock++; + } + pkcsBlockLen /= 8; + + pkcsBlock[0] = 1; // block type 1 for SSL + + // pad with 0xff bytes + memset(&pkcsBlock[1], 0xFF, pkcsBlockLen - inputLen - 2); + + pkcsBlock[pkcsBlockLen-inputLen-1] = 0; // separator + memcpy(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen); +} + + +word32 RSA_BlockType1::UnPad(const byte* pkcsBlock, word32 pkcsBlockLen, + byte* output) const +{ + bool invalid = false; + unsigned int maxOutputLen = SaturatingSubtract(pkcsBlockLen / 8, 10U); + + // convert from bit length to byte length + if (pkcsBlockLen % 8 != 0) + { + invalid = (pkcsBlock[0] != 0) || invalid; + pkcsBlock++; + } + pkcsBlockLen /= 8; + + // Require block type 1 for SSL. + invalid = (pkcsBlock[0] != 1) || invalid; + + // skip past the padding until we find the separator + unsigned i=1; + while (i maxOutputLen) || invalid; + + if (invalid) + return 0; + + memcpy(output, pkcsBlock+i, outputLen); + return outputLen; +} + + +word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain) +{ + PK_Lengths lengths(key.GetModulus()); + + ByteBlock paddedBlock(BitsToBytes(lengths.PaddedBlockBitLength())); + Integer x = key.ApplyFunction(Integer(sig, + lengths.FixedCiphertextLength())); + if (x.ByteCount() > paddedBlock.size()) + x = Integer::Zero(); + x.Encode(paddedBlock.get_buffer(), paddedBlock.size()); + return RSA_BlockType1().UnPad(paddedBlock.get_buffer(), + lengths.PaddedBlockBitLength(), plain); +} + + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/sha.cpp b/externals/mysql/extlib/yassl/taocrypt/src/sha.cpp new file mode 100644 index 00000000000..ef165a342ad --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/sha.cpp @@ -0,0 +1,1023 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's sha.cpp from CryptoPP */ + +#include "runtime.hpp" +#include +#include "sha.hpp" +#ifdef USE_SYS_STL + #include +#else + #include "algorithm.hpp" +#endif + + +namespace STL = STL_NAMESPACE; + + + +namespace TaoCrypt { + +#define blk0(i) (W[i] = buffer_[i]) +#define blk1(i) (W[i&15] = \ + rotlFixed(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1)) + +#define f1(x,y,z) (z^(x &(y^z))) +#define f2(x,y,z) (x^y^z) +#define f3(x,y,z) ((x&y)|(z&(x|y))) +#define f4(x,y,z) (x^y^z) + +// (R0+R1), R2, R3, R4 are the different operations used in SHA1 +#define R0(v,w,x,y,z,i) z+= f1(w,x,y) + blk0(i) + 0x5A827999+ \ + rotlFixed(v,5); w = rotlFixed(w,30); +#define R1(v,w,x,y,z,i) z+= f1(w,x,y) + blk1(i) + 0x5A827999+ \ + rotlFixed(v,5); w = rotlFixed(w,30); +#define R2(v,w,x,y,z,i) z+= f2(w,x,y) + blk1(i) + 0x6ED9EBA1+ \ + rotlFixed(v,5); w = rotlFixed(w,30); +#define R3(v,w,x,y,z,i) z+= f3(w,x,y) + blk1(i) + 0x8F1BBCDC+ \ + rotlFixed(v,5); w = rotlFixed(w,30); +#define R4(v,w,x,y,z,i) z+= f4(w,x,y) + blk1(i) + 0xCA62C1D6+ \ + rotlFixed(v,5); w = rotlFixed(w,30); + + +void SHA::Init() +{ + digest_[0] = 0x67452301L; + digest_[1] = 0xEFCDAB89L; + digest_[2] = 0x98BADCFEL; + digest_[3] = 0x10325476L; + digest_[4] = 0xC3D2E1F0L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + +void SHA256::Init() +{ + digest_[0] = 0x6A09E667L; + digest_[1] = 0xBB67AE85L; + digest_[2] = 0x3C6EF372L; + digest_[3] = 0xA54FF53AL; + digest_[4] = 0x510E527FL; + digest_[5] = 0x9B05688CL; + digest_[6] = 0x1F83D9ABL; + digest_[7] = 0x5BE0CD19L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +void SHA224::Init() +{ + digest_[0] = 0xc1059ed8; + digest_[1] = 0x367cd507; + digest_[2] = 0x3070dd17; + digest_[3] = 0xf70e5939; + digest_[4] = 0xffc00b31; + digest_[5] = 0x68581511; + digest_[6] = 0x64f98fa7; + digest_[7] = 0xbefa4fa4; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +#ifdef WORD64_AVAILABLE + +void SHA512::Init() +{ + digest_[0] = W64LIT(0x6a09e667f3bcc908); + digest_[1] = W64LIT(0xbb67ae8584caa73b); + digest_[2] = W64LIT(0x3c6ef372fe94f82b); + digest_[3] = W64LIT(0xa54ff53a5f1d36f1); + digest_[4] = W64LIT(0x510e527fade682d1); + digest_[5] = W64LIT(0x9b05688c2b3e6c1f); + digest_[6] = W64LIT(0x1f83d9abfb41bd6b); + digest_[7] = W64LIT(0x5be0cd19137e2179); + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +void SHA384::Init() +{ + digest_[0] = W64LIT(0xcbbb9d5dc1059ed8); + digest_[1] = W64LIT(0x629a292a367cd507); + digest_[2] = W64LIT(0x9159015a3070dd17); + digest_[3] = W64LIT(0x152fecd8f70e5939); + digest_[4] = W64LIT(0x67332667ffc00b31); + digest_[5] = W64LIT(0x8eb44a8768581511); + digest_[6] = W64LIT(0xdb0c2e0d64f98fa7); + digest_[7] = W64LIT(0x47b5481dbefa4fa4); + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + +#endif // WORD64_AVAILABLE + + +SHA::SHA(const SHA& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), + BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +SHA256::SHA256(const SHA256& that) : HASHwithTransform(DIGEST_SIZE / + sizeof(word32), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +SHA224::SHA224(const SHA224& that) : HASHwithTransform(SHA256::DIGEST_SIZE / + sizeof(word32), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +#ifdef WORD64_AVAILABLE + +SHA512::SHA512(const SHA512& that) : HASH64withTransform(DIGEST_SIZE / + sizeof(word64), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + + +SHA384::SHA384(const SHA384& that) : HASH64withTransform(SHA512::DIGEST_SIZE / + sizeof(word64), BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + +#endif // WORD64_AVAILABLE + + +SHA& SHA::operator= (const SHA& that) +{ + SHA tmp(that); + Swap(tmp); + + return *this; +} + + +SHA256& SHA256::operator= (const SHA256& that) +{ + SHA256 tmp(that); + Swap(tmp); + + return *this; +} + + +SHA224& SHA224::operator= (const SHA224& that) +{ + SHA224 tmp(that); + Swap(tmp); + + return *this; +} + + +#ifdef WORD64_AVAILABLE + +SHA512& SHA512::operator= (const SHA512& that) +{ + SHA512 tmp(that); + Swap(tmp); + + return *this; +} + + +SHA384& SHA384::operator= (const SHA384& that) +{ + SHA384 tmp(that); + Swap(tmp); + + return *this; +} + +#endif // WORD64_AVAILABLE + + +void SHA::Swap(SHA& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void SHA256::Swap(SHA256& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void SHA224::Swap(SHA224& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +#ifdef WORD64_AVAILABLE + +void SHA512::Swap(SHA512& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void SHA384::Swap(SHA384& other) +{ + STL::swap(loLen_, other.loLen_); + STL::swap(hiLen_, other.hiLen_); + STL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + +#endif // WORD64_AVIALABLE + + +#ifdef DO_SHA_ASM + +// Update digest with data of size len +void SHA::Update(const byte* data, word32 len) +{ + if (!isMMX) { + HASHwithTransform::Update(data, len); + return; + } + + byte* local = reinterpret_cast(buffer_); + + // remove buffered data if possible + if (buffLen_) { + word32 add = min(len, BLOCK_SIZE - buffLen_); + memcpy(&local[buffLen_], data, add); + + buffLen_ += add; + data += add; + len -= add; + + if (buffLen_ == BLOCK_SIZE) { + ByteReverse(local, local, BLOCK_SIZE); + Transform(); + AddLength(BLOCK_SIZE); + buffLen_ = 0; + } + } + + // all at once for asm + if (buffLen_ == 0) { + word32 times = len / BLOCK_SIZE; + if (times) { + AsmTransform(data, times); + const word32 add = BLOCK_SIZE * times; + AddLength(add); + len -= add; + data += add; + } + } + + // cache any data left + if (len) { + memcpy(&local[buffLen_], data, len); + buffLen_ += len; + } +} + +#endif // DO_SHA_ASM + + +void SHA::Transform() +{ + word32 W[BLOCK_SIZE / sizeof(word32)]; + + // Copy context->state[] to working vars + word32 a = digest_[0]; + word32 b = digest_[1]; + word32 c = digest_[2]; + word32 d = digest_[3]; + word32 e = digest_[4]; + + // 4 rounds of 20 operations each. Loop unrolled. + R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); + R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); + R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); + R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); + + R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); + + R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); + R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); + R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); + R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); + R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); + + R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); + R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); + R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); + R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); + R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); + + R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); + R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); + R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); + R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); + R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); + + // Add the working vars back into digest state[] + digest_[0] += a; + digest_[1] += b; + digest_[2] += c; + digest_[3] += d; + digest_[4] += e; + + // Wipe variables + a = b = c = d = e = 0; + memset(W, 0, sizeof(W)); +} + + +#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15])) + +#define Ch(x,y,z) (z^(x&(y^z))) +#define Maj(x,y,z) ((x&y)|(z&(x|y))) + +#define a(i) T[(0-i)&7] +#define b(i) T[(1-i)&7] +#define c(i) T[(2-i)&7] +#define d(i) T[(3-i)&7] +#define e(i) T[(4-i)&7] +#define f(i) T[(5-i)&7] +#define g(i) T[(6-i)&7] +#define h(i) T[(7-i)&7] + +#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk0(i));\ + d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i)) + +// for SHA256 +#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22)) +#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25)) +#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3)) +#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10)) + + +static const word32 K256[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + + +static void Transform256(word32* digest_, word32* buffer_) +{ + const word32* K = K256; + + word32 W[16]; + word32 T[8]; + + // Copy digest to working vars + memcpy(T, digest_, sizeof(T)); + + // 64 operations, partially loop unrolled + for (unsigned int j = 0; j < 64; j += 16) { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + + // Add the working vars back into digest + digest_[0] += a(0); + digest_[1] += b(0); + digest_[2] += c(0); + digest_[3] += d(0); + digest_[4] += e(0); + digest_[5] += f(0); + digest_[6] += g(0); + digest_[7] += h(0); + + // Wipe variables + memset(W, 0, sizeof(W)); + memset(T, 0, sizeof(T)); +} + + +// undef for 256 +#undef S0 +#undef S1 +#undef s0 +#undef s1 + + +void SHA256::Transform() +{ + Transform256(digest_, buffer_); +} + + +void SHA224::Transform() +{ + Transform256(digest_, buffer_); +} + + +#ifdef WORD64_AVAILABLE + +static const word64 K512[80] = { + W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd), + W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc), + W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019), + W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118), + W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe), + W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2), + W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1), + W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694), + W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3), + W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65), + W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483), + W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5), + W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210), + W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4), + W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725), + W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70), + W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926), + W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df), + W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8), + W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b), + W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001), + W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30), + W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910), + W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8), + W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53), + W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8), + W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb), + W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3), + W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60), + W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec), + W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9), + W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b), + W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207), + W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178), + W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6), + W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b), + W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493), + W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c), + W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a), + W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817) +}; + + +// for SHA512 +#define S0(x) (rotrFixed(x,28)^rotrFixed(x,34)^rotrFixed(x,39)) +#define S1(x) (rotrFixed(x,14)^rotrFixed(x,18)^rotrFixed(x,41)) +#define s0(x) (rotrFixed(x,1)^rotrFixed(x,8)^(x>>7)) +#define s1(x) (rotrFixed(x,19)^rotrFixed(x,61)^(x>>6)) + + +static void Transform512(word64* digest_, word64* buffer_) +{ + const word64* K = K512; + + word64 W[16]; + word64 T[8]; + + // Copy digest to working vars + memcpy(T, digest_, sizeof(T)); + + // 64 operations, partially loop unrolled + for (unsigned int j = 0; j < 80; j += 16) { + R( 0); R( 1); R( 2); R( 3); + R( 4); R( 5); R( 6); R( 7); + R( 8); R( 9); R(10); R(11); + R(12); R(13); R(14); R(15); + } + + // Add the working vars back into digest + + digest_[0] += a(0); + digest_[1] += b(0); + digest_[2] += c(0); + digest_[3] += d(0); + digest_[4] += e(0); + digest_[5] += f(0); + digest_[6] += g(0); + digest_[7] += h(0); + + // Wipe variables + memset(W, 0, sizeof(W)); + memset(T, 0, sizeof(T)); +} + + +void SHA512::Transform() +{ + Transform512(digest_, buffer_); +} + + +void SHA384::Transform() +{ + Transform512(digest_, buffer_); +} + +#endif // WORD64_AVIALABLE + + +#ifdef DO_SHA_ASM + +// f1(x,y,z) (z^(x &(y^z))) +// place in esi +#define ASMf1(x,y,z) \ + AS2( mov esi, y ) \ + AS2( xor esi, z ) \ + AS2( and esi, x ) \ + AS2( xor esi, z ) + + +// R0(v,w,x,y,z,i) = +// z+= f1(w,x,y) + W[i] + 0x5A827999 + rotlFixed(v,5); +// w = rotlFixed(w,30); + +// use esi for f +// use edi as tmp + + +#define ASMR0(v,w,x,y,z,i) \ + AS2( mov esi, x ) \ + AS2( mov edi, [esp + i * 4] ) \ + AS2( xor esi, y ) \ + AS2( and esi, w ) \ + AS2( lea z, [edi + z + 0x5A827999] ) \ + AS2( mov edi, v ) \ + AS2( xor esi, y ) \ + AS2( rol edi, 5 ) \ + AS2( add z, esi ) \ + AS2( rol w, 30 ) \ + AS2( add z, edi ) + + +/* Some macro stuff, but older gas ( < 2,16 ) can't process &, so do by hand + % won't work on gas at all + +#define xstr(s) str(s) +#define str(s) #s + +#define WOFF1(a) ( a & 15) +#define WOFF2(a) ((a + 2) & 15) +#define WOFF3(a) ((a + 8) & 15) +#define WOFF4(a) ((a + 13) & 15) + +#ifdef __GNUC__ + #define WGET1(i) asm("mov esp, [edi - "xstr(WOFF1(i))" * 4] "); + #define WGET2(i) asm("xor esp, [edi - "xstr(WOFF2(i))" * 4] "); + #define WGET3(i) asm("xor esp, [edi - "xstr(WOFF3(i))" * 4] "); + #define WGET4(i) asm("xor esp, [edi - "xstr(WOFF4(i))" * 4] "); + #define WPUT1(i) asm("mov [edi - "xstr(WOFF1(i))" * 4], esp "); +#else + #define WGET1(i) AS2( mov esp, [edi - WOFF1(i) * 4] ) + #define WGET2(i) AS2( xor esp, [edi - WOFF2(i) * 4] ) + #define WGET3(i) AS2( xor esp, [edi - WOFF3(i) * 4] ) + #define WGET4(i) AS2( xor esp, [edi - WOFF4(i) * 4] ) + #define WPUT1(i) AS2( mov [edi - WOFF1(i) * 4], esp ) +#endif +*/ + +// ASMR1 = ASMR0 but use esp for W calcs + +#define ASMR1(v,w,x,y,z,i,W1,W2,W3,W4) \ + AS2( mov edi, [esp + W1 * 4] ) \ + AS2( mov esi, x ) \ + AS2( xor edi, [esp + W2 * 4] ) \ + AS2( xor esi, y ) \ + AS2( xor edi, [esp + W3 * 4] ) \ + AS2( and esi, w ) \ + AS2( xor edi, [esp + W4 * 4] ) \ + AS2( rol edi, 1 ) \ + AS2( xor esi, y ) \ + AS2( mov [esp + W1 * 4], edi ) \ + AS2( lea z, [edi + z + 0x5A827999] ) \ + AS2( mov edi, v ) \ + AS2( rol edi, 5 ) \ + AS2( add z, esi ) \ + AS2( rol w, 30 ) \ + AS2( add z, edi ) + + +// ASMR2 = ASMR1 but f is xor, xor instead + +#define ASMR2(v,w,x,y,z,i,W1,W2,W3,W4) \ + AS2( mov edi, [esp + W1 * 4] ) \ + AS2( mov esi, x ) \ + AS2( xor edi, [esp + W2 * 4] ) \ + AS2( xor esi, y ) \ + AS2( xor edi, [esp + W3 * 4] ) \ + AS2( xor esi, w ) \ + AS2( xor edi, [esp + W4 * 4] ) \ + AS2( rol edi, 1 ) \ + AS2( add z, esi ) \ + AS2( mov [esp + W1 * 4], edi ) \ + AS2( lea z, [edi + z + 0x6ED9EBA1] ) \ + AS2( mov edi, v ) \ + AS2( rol edi, 5 ) \ + AS2( rol w, 30 ) \ + AS2( add z, edi ) + + +// ASMR3 = ASMR2 but f is (x&y)|(z&(x|y)) +// which is (w&x)|(y&(w|x)) + +#define ASMR3(v,w,x,y,z,i,W1,W2,W3,W4) \ + AS2( mov edi, [esp + W1 * 4] ) \ + AS2( mov esi, x ) \ + AS2( xor edi, [esp + W2 * 4] ) \ + AS2( or esi, w ) \ + AS2( xor edi, [esp + W3 * 4] ) \ + AS2( and esi, y ) \ + AS2( xor edi, [esp + W4 * 4] ) \ + AS2( movd mm0, esi ) \ + AS2( rol edi, 1 ) \ + AS2( mov esi, x ) \ + AS2( mov [esp + W1 * 4], edi ) \ + AS2( and esi, w ) \ + AS2( lea z, [edi + z + 0x8F1BBCDC] ) \ + AS2( movd edi, mm0 ) \ + AS2( or esi, edi ) \ + AS2( mov edi, v ) \ + AS2( rol edi, 5 ) \ + AS2( add z, esi ) \ + AS2( rol w, 30 ) \ + AS2( add z, edi ) + + +// ASMR4 = ASMR2 but different constant + +#define ASMR4(v,w,x,y,z,i,W1,W2,W3,W4) \ + AS2( mov edi, [esp + W1 * 4] ) \ + AS2( mov esi, x ) \ + AS2( xor edi, [esp + W2 * 4] ) \ + AS2( xor esi, y ) \ + AS2( xor edi, [esp + W3 * 4] ) \ + AS2( xor esi, w ) \ + AS2( xor edi, [esp + W4 * 4] ) \ + AS2( rol edi, 1 ) \ + AS2( add z, esi ) \ + AS2( mov [esp + W1 * 4], edi ) \ + AS2( lea z, [edi + z + 0xCA62C1D6] ) \ + AS2( mov edi, v ) \ + AS2( rol edi, 5 ) \ + AS2( rol w, 30 ) \ + AS2( add z, edi ) + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void SHA::AsmTransform(const byte* data, word32 times) +{ +#ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov ecx, DWORD PTR [ebp + 8] ) \ + AS2( mov edi, DWORD PTR [ebp + 12] ) \ + AS2( mov eax, DWORD PTR [ebp + 16] ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( mov esp, ebp ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); +#else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edi, data ) \ + AS2( mov eax, times ) + + #define EPILOG() \ + AS2( movd ebp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 8 ) +#endif + + PROLOG() + + AS2( mov esi, ecx ) + + #ifdef OLD_GCC_OFFSET + AS2( add esi, 20 ) // digest_[0] + #else + AS2( add esi, 16 ) // digest_[0] + #endif + + AS2( movd mm2, eax ) // store times_ + AS2( movd mm1, esi ) // store digest_ + + AS2( sub esp, 68 ) // make room on stack + +AS1( loopStart: ) + + // byte reverse 16 words of input, 4 at a time, put on stack for W[] + + // part 1 + AS2( mov eax, [edi] ) + AS2( mov ebx, [edi + 4] ) + AS2( mov ecx, [edi + 8] ) + AS2( mov edx, [edi + 12] ) + + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( mov [esp], eax ) + AS2( mov [esp + 4], ebx ) + AS2( mov [esp + 8], ecx ) + AS2( mov [esp + 12], edx ) + + // part 2 + AS2( mov eax, [edi + 16] ) + AS2( mov ebx, [edi + 20] ) + AS2( mov ecx, [edi + 24] ) + AS2( mov edx, [edi + 28] ) + + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( mov [esp + 16], eax ) + AS2( mov [esp + 20], ebx ) + AS2( mov [esp + 24], ecx ) + AS2( mov [esp + 28], edx ) + + + // part 3 + AS2( mov eax, [edi + 32] ) + AS2( mov ebx, [edi + 36] ) + AS2( mov ecx, [edi + 40] ) + AS2( mov edx, [edi + 44] ) + + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( mov [esp + 32], eax ) + AS2( mov [esp + 36], ebx ) + AS2( mov [esp + 40], ecx ) + AS2( mov [esp + 44], edx ) + + + // part 4 + AS2( mov eax, [edi + 48] ) + AS2( mov ebx, [edi + 52] ) + AS2( mov ecx, [edi + 56] ) + AS2( mov edx, [edi + 60] ) + + AS1( bswap eax ) + AS1( bswap ebx ) + AS1( bswap ecx ) + AS1( bswap edx ) + + AS2( mov [esp + 48], eax ) + AS2( mov [esp + 52], ebx ) + AS2( mov [esp + 56], ecx ) + AS2( mov [esp + 60], edx ) + + AS2( mov [esp + 64], edi ) // store edi for end + + // read from digest_ + AS2( mov eax, [esi] ) // a1 + AS2( mov ebx, [esi + 4] ) // b1 + AS2( mov ecx, [esi + 8] ) // c1 + AS2( mov edx, [esi + 12] ) // d1 + AS2( mov ebp, [esi + 16] ) // e1 + + + ASMR0(eax, ebx, ecx, edx, ebp, 0) + ASMR0(ebp, eax, ebx, ecx, edx, 1) + ASMR0(edx, ebp, eax, ebx, ecx, 2) + ASMR0(ecx, edx, ebp, eax, ebx, 3) + ASMR0(ebx, ecx, edx, ebp, eax, 4) + ASMR0(eax, ebx, ecx, edx, ebp, 5) + ASMR0(ebp, eax, ebx, ecx, edx, 6) + ASMR0(edx, ebp, eax, ebx, ecx, 7) + ASMR0(ecx, edx, ebp, eax, ebx, 8) + ASMR0(ebx, ecx, edx, ebp, eax, 9) + ASMR0(eax, ebx, ecx, edx, ebp, 10) + ASMR0(ebp, eax, ebx, ecx, edx, 11) + ASMR0(edx, ebp, eax, ebx, ecx, 12) + ASMR0(ecx, edx, ebp, eax, ebx, 13) + ASMR0(ebx, ecx, edx, ebp, eax, 14) + ASMR0(eax, ebx, ecx, edx, ebp, 15) + + ASMR1(ebp, eax, ebx, ecx, edx, 16, 0, 2, 8, 13) + ASMR1(edx, ebp, eax, ebx, ecx, 17, 1, 3, 9, 14) + ASMR1(ecx, edx, ebp, eax, ebx, 18, 2, 4, 10, 15) + ASMR1(ebx, ecx, edx, ebp, eax, 19, 3, 5, 11, 0) + + ASMR2(eax, ebx, ecx, edx, ebp, 20, 4, 6, 12, 1) + ASMR2(ebp, eax, ebx, ecx, edx, 21, 5, 7, 13, 2) + ASMR2(edx, ebp, eax, ebx, ecx, 22, 6, 8, 14, 3) + ASMR2(ecx, edx, ebp, eax, ebx, 23, 7, 9, 15, 4) + ASMR2(ebx, ecx, edx, ebp, eax, 24, 8, 10, 0, 5) + ASMR2(eax, ebx, ecx, edx, ebp, 25, 9, 11, 1, 6) + ASMR2(ebp, eax, ebx, ecx, edx, 26, 10, 12, 2, 7) + ASMR2(edx, ebp, eax, ebx, ecx, 27, 11, 13, 3, 8) + ASMR2(ecx, edx, ebp, eax, ebx, 28, 12, 14, 4, 9) + ASMR2(ebx, ecx, edx, ebp, eax, 29, 13, 15, 5, 10) + ASMR2(eax, ebx, ecx, edx, ebp, 30, 14, 0, 6, 11) + ASMR2(ebp, eax, ebx, ecx, edx, 31, 15, 1, 7, 12) + ASMR2(edx, ebp, eax, ebx, ecx, 32, 0, 2, 8, 13) + ASMR2(ecx, edx, ebp, eax, ebx, 33, 1, 3, 9, 14) + ASMR2(ebx, ecx, edx, ebp, eax, 34, 2, 4, 10, 15) + ASMR2(eax, ebx, ecx, edx, ebp, 35, 3, 5, 11, 0) + ASMR2(ebp, eax, ebx, ecx, edx, 36, 4, 6, 12, 1) + ASMR2(edx, ebp, eax, ebx, ecx, 37, 5, 7, 13, 2) + ASMR2(ecx, edx, ebp, eax, ebx, 38, 6, 8, 14, 3) + ASMR2(ebx, ecx, edx, ebp, eax, 39, 7, 9, 15, 4) + + + ASMR3(eax, ebx, ecx, edx, ebp, 40, 8, 10, 0, 5) + ASMR3(ebp, eax, ebx, ecx, edx, 41, 9, 11, 1, 6) + ASMR3(edx, ebp, eax, ebx, ecx, 42, 10, 12, 2, 7) + ASMR3(ecx, edx, ebp, eax, ebx, 43, 11, 13, 3, 8) + ASMR3(ebx, ecx, edx, ebp, eax, 44, 12, 14, 4, 9) + ASMR3(eax, ebx, ecx, edx, ebp, 45, 13, 15, 5, 10) + ASMR3(ebp, eax, ebx, ecx, edx, 46, 14, 0, 6, 11) + ASMR3(edx, ebp, eax, ebx, ecx, 47, 15, 1, 7, 12) + ASMR3(ecx, edx, ebp, eax, ebx, 48, 0, 2, 8, 13) + ASMR3(ebx, ecx, edx, ebp, eax, 49, 1, 3, 9, 14) + ASMR3(eax, ebx, ecx, edx, ebp, 50, 2, 4, 10, 15) + ASMR3(ebp, eax, ebx, ecx, edx, 51, 3, 5, 11, 0) + ASMR3(edx, ebp, eax, ebx, ecx, 52, 4, 6, 12, 1) + ASMR3(ecx, edx, ebp, eax, ebx, 53, 5, 7, 13, 2) + ASMR3(ebx, ecx, edx, ebp, eax, 54, 6, 8, 14, 3) + ASMR3(eax, ebx, ecx, edx, ebp, 55, 7, 9, 15, 4) + ASMR3(ebp, eax, ebx, ecx, edx, 56, 8, 10, 0, 5) + ASMR3(edx, ebp, eax, ebx, ecx, 57, 9, 11, 1, 6) + ASMR3(ecx, edx, ebp, eax, ebx, 58, 10, 12, 2, 7) + ASMR3(ebx, ecx, edx, ebp, eax, 59, 11, 13, 3, 8) + + ASMR4(eax, ebx, ecx, edx, ebp, 60, 12, 14, 4, 9) + ASMR4(ebp, eax, ebx, ecx, edx, 61, 13, 15, 5, 10) + ASMR4(edx, ebp, eax, ebx, ecx, 62, 14, 0, 6, 11) + ASMR4(ecx, edx, ebp, eax, ebx, 63, 15, 1, 7, 12) + ASMR4(ebx, ecx, edx, ebp, eax, 64, 0, 2, 8, 13) + ASMR4(eax, ebx, ecx, edx, ebp, 65, 1, 3, 9, 14) + ASMR4(ebp, eax, ebx, ecx, edx, 66, 2, 4, 10, 15) + ASMR4(edx, ebp, eax, ebx, ecx, 67, 3, 5, 11, 0) + ASMR4(ecx, edx, ebp, eax, ebx, 68, 4, 6, 12, 1) + ASMR4(ebx, ecx, edx, ebp, eax, 69, 5, 7, 13, 2) + ASMR4(eax, ebx, ecx, edx, ebp, 70, 6, 8, 14, 3) + ASMR4(ebp, eax, ebx, ecx, edx, 71, 7, 9, 15, 4) + ASMR4(edx, ebp, eax, ebx, ecx, 72, 8, 10, 0, 5) + ASMR4(ecx, edx, ebp, eax, ebx, 73, 9, 11, 1, 6) + ASMR4(ebx, ecx, edx, ebp, eax, 74, 10, 12, 2, 7) + ASMR4(eax, ebx, ecx, edx, ebp, 75, 11, 13, 3, 8) + ASMR4(ebp, eax, ebx, ecx, edx, 76, 12, 14, 4, 9) + ASMR4(edx, ebp, eax, ebx, ecx, 77, 13, 15, 5, 10) + ASMR4(ecx, edx, ebp, eax, ebx, 78, 14, 0, 6, 11) + ASMR4(ebx, ecx, edx, ebp, eax, 79, 15, 1, 7, 12) + + + AS2( movd esi, mm1 ) // digest_ + + AS2( add [esi], eax ) // write out + AS2( add [esi + 4], ebx ) + AS2( add [esi + 8], ecx ) + AS2( add [esi + 12], edx ) + AS2( add [esi + 16], ebp ) + + // setup next round + AS2( movd ebp, mm2 ) // times + + AS2( mov edi, DWORD PTR [esp + 64] ) // data + + AS2( add edi, 64 ) // next round of data + AS2( mov [esp + 64], edi ) // restore + + AS1( dec ebp ) + AS2( movd mm2, ebp ) + AS1( jnz loopStart ) + + + EPILOG() +} + + +#endif // DO_SHA_ASM + +} // namespace diff --git a/externals/mysql/extlib/yassl/taocrypt/src/template_instnt.cpp b/externals/mysql/extlib/yassl/taocrypt/src/template_instnt.cpp new file mode 100644 index 00000000000..390da58e191 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/template_instnt.cpp @@ -0,0 +1,82 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + + +/* Explicit template instantiation requests + */ + + +#include "runtime.hpp" +#include "integer.hpp" +#include "rsa.hpp" +#include "sha.hpp" +#include "md5.hpp" +#include "hmac.hpp" +#include "ripemd.hpp" +#include "pwdbased.hpp" +#include "algebra.hpp" +#include "vector.hpp" +#include "hash.hpp" + +#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION +namespace TaoCrypt { + +#if defined(SSE2_INTRINSICS_AVAILABLE) +template AlignedAllocator::pointer StdReallocate >(AlignedAllocator&, unsigned int*, AlignedAllocator::size_type, AlignedAllocator::size_type, bool); +#endif + +template class RSA_Decryptor; +template class RSA_Encryptor; +template class RSA_Encryptor; +template void tcDelete(HASH*); +template void tcDelete(Integer*); +template void tcArrayDelete(byte*); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, byte*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +template void tcArrayDelete(word*); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, word*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); + +#ifndef TAOCRYPT_SLOW_WORD64 // defined when word != word32 +template void tcArrayDelete(word32*); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, word32*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +#endif + +template void tcArrayDelete(char*); + +template class PBKDF2_HMAC; +template class HMAC; +template class HMAC; +template class HMAC; + +} + +namespace mySTL { +template vector* uninit_fill_n*, size_t, vector >(vector*, size_t, vector const&); +template void destroy*>(vector*, vector*); +template TaoCrypt::Integer* uninit_copy(TaoCrypt::Integer*, TaoCrypt::Integer*, TaoCrypt::Integer*); +template TaoCrypt::Integer* uninit_fill_n(TaoCrypt::Integer*, size_t, TaoCrypt::Integer const&); +template void destroy(TaoCrypt::Integer*, TaoCrypt::Integer*); +template TaoCrypt::byte* GetArrayMemory(size_t); +template void FreeArrayMemory(TaoCrypt::byte*); +template TaoCrypt::Integer* GetArrayMemory(size_t); +template void FreeArrayMemory(TaoCrypt::Integer*); +template vector* GetArrayMemory >(size_t); +template void FreeArrayMemory >(vector*); +template void FreeArrayMemory(void*); +} + +#endif diff --git a/externals/mysql/extlib/yassl/taocrypt/src/tftables.cpp b/externals/mysql/extlib/yassl/taocrypt/src/tftables.cpp new file mode 100644 index 00000000000..6917507b8b2 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/tftables.cpp @@ -0,0 +1,349 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* based on Wei Dai's tftables.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "twofish.hpp" + + +namespace TaoCrypt { + + +const byte Twofish::q_[2][256] = { +{ + 0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, + 0xE4, 0xDD, 0xD1, 0x38, 0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C, + 0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 0xF2, 0xD0, 0x8B, 0x30, + 0x84, 0x54, 0xDF, 0x23, 0x19, 0x5B, 0x3D, 0x59, 0xF3, 0xAE, 0xA2, 0x82, + 0x63, 0x01, 0x83, 0x2E, 0xD9, 0x51, 0x9B, 0x7C, 0xA6, 0xEB, 0xA5, 0xBE, + 0x16, 0x0C, 0xE3, 0x61, 0xC0, 0x8C, 0x3A, 0xF5, 0x73, 0x2C, 0x25, 0x0B, + 0xBB, 0x4E, 0x89, 0x6B, 0x53, 0x6A, 0xB4, 0xF1, 0xE1, 0xE6, 0xBD, 0x45, + 0xE2, 0xF4, 0xB6, 0x66, 0xCC, 0x95, 0x03, 0x56, 0xD4, 0x1C, 0x1E, 0xD7, + 0xFB, 0xC3, 0x8E, 0xB5, 0xE9, 0xCF, 0xBF, 0xBA, 0xEA, 0x77, 0x39, 0xAF, + 0x33, 0xC9, 0x62, 0x71, 0x81, 0x79, 0x09, 0xAD, 0x24, 0xCD, 0xF9, 0xD8, + 0xE5, 0xC5, 0xB9, 0x4D, 0x44, 0x08, 0x86, 0xE7, 0xA1, 0x1D, 0xAA, 0xED, + 0x06, 0x70, 0xB2, 0xD2, 0x41, 0x7B, 0xA0, 0x11, 0x31, 0xC2, 0x27, 0x90, + 0x20, 0xF6, 0x60, 0xFF, 0x96, 0x5C, 0xB1, 0xAB, 0x9E, 0x9C, 0x52, 0x1B, + 0x5F, 0x93, 0x0A, 0xEF, 0x91, 0x85, 0x49, 0xEE, 0x2D, 0x4F, 0x8F, 0x3B, + 0x47, 0x87, 0x6D, 0x46, 0xD6, 0x3E, 0x69, 0x64, 0x2A, 0xCE, 0xCB, 0x2F, + 0xFC, 0x97, 0x05, 0x7A, 0xAC, 0x7F, 0xD5, 0x1A, 0x4B, 0x0E, 0xA7, 0x5A, + 0x28, 0x14, 0x3F, 0x29, 0x88, 0x3C, 0x4C, 0x02, 0xB8, 0xDA, 0xB0, 0x17, + 0x55, 0x1F, 0x8A, 0x7D, 0x57, 0xC7, 0x8D, 0x74, 0xB7, 0xC4, 0x9F, 0x72, + 0x7E, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34, 0x6E, 0x50, 0xDE, 0x68, + 0x65, 0xBC, 0xDB, 0xF8, 0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, + 0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 0x6F, 0x9D, 0x36, 0x42, + 0x4A, 0x5E, 0xC1, 0xE0 +}, +{ + 0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 0x4A, 0xD3, 0xE6, 0x6B, + 0x45, 0x7D, 0xE8, 0x4B, 0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1, + 0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 0x5E, 0xBA, 0xAE, 0x5B, + 0x8A, 0x00, 0xBC, 0x9D, 0x6D, 0xC1, 0xB1, 0x0E, 0x80, 0x5D, 0xD2, 0xD5, + 0xA0, 0x84, 0x07, 0x14, 0xB5, 0x90, 0x2C, 0xA3, 0xB2, 0x73, 0x4C, 0x54, + 0x92, 0x74, 0x36, 0x51, 0x38, 0xB0, 0xBD, 0x5A, 0xFC, 0x60, 0x62, 0x96, + 0x6C, 0x42, 0xF7, 0x10, 0x7C, 0x28, 0x27, 0x8C, 0x13, 0x95, 0x9C, 0xC7, + 0x24, 0x46, 0x3B, 0x70, 0xCA, 0xE3, 0x85, 0xCB, 0x11, 0xD0, 0x93, 0xB8, + 0xA6, 0x83, 0x20, 0xFF, 0x9F, 0x77, 0xC3, 0xCC, 0x03, 0x6F, 0x08, 0xBF, + 0x40, 0xE7, 0x2B, 0xE2, 0x79, 0x0C, 0xAA, 0x82, 0x41, 0x3A, 0xEA, 0xB9, + 0xE4, 0x9A, 0xA4, 0x97, 0x7E, 0xDA, 0x7A, 0x17, 0x66, 0x94, 0xA1, 0x1D, + 0x3D, 0xF0, 0xDE, 0xB3, 0x0B, 0x72, 0xA7, 0x1C, 0xEF, 0xD1, 0x53, 0x3E, + 0x8F, 0x33, 0x26, 0x5F, 0xEC, 0x76, 0x2A, 0x49, 0x81, 0x88, 0xEE, 0x21, + 0xC4, 0x1A, 0xEB, 0xD9, 0xC5, 0x39, 0x99, 0xCD, 0xAD, 0x31, 0x8B, 0x01, + 0x18, 0x23, 0xDD, 0x1F, 0x4E, 0x2D, 0xF9, 0x48, 0x4F, 0xF2, 0x65, 0x8E, + 0x78, 0x5C, 0x58, 0x19, 0x8D, 0xE5, 0x98, 0x57, 0x67, 0x7F, 0x05, 0x64, + 0xAF, 0x63, 0xB6, 0xFE, 0xF5, 0xB7, 0x3C, 0xA5, 0xCE, 0xE9, 0x68, 0x44, + 0xE0, 0x4D, 0x43, 0x69, 0x29, 0x2E, 0xAC, 0x15, 0x59, 0xA8, 0x0A, 0x9E, + 0x6E, 0x47, 0xDF, 0x34, 0x35, 0x6A, 0xCF, 0xDC, 0x22, 0xC9, 0xC0, 0x9B, + 0x89, 0xD4, 0xED, 0xAB, 0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, + 0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 0x16, 0x25, 0x86, 0x56, + 0x55, 0x09, 0xBE, 0x91 +} +}; + + +const word32 Twofish::mds_[4][256] = { + { + 0xbcbc3275, 0xecec21f3, 0x202043c6, 0xb3b3c9f4, + 0xdada03db, 0x02028b7b, 0xe2e22bfb, 0x9e9efac8, + 0xc9c9ec4a, 0xd4d409d3, 0x18186be6, 0x1e1e9f6b, + 0x98980e45, 0xb2b2387d, 0xa6a6d2e8, 0x2626b74b, + 0x3c3c57d6, 0x93938a32, 0x8282eed8, 0x525298fd, + 0x7b7bd437, 0xbbbb3771, 0x5b5b97f1, 0x474783e1, + 0x24243c30, 0x5151e20f, 0xbabac6f8, 0x4a4af31b, + 0xbfbf4887, 0x0d0d70fa, 0xb0b0b306, 0x7575de3f, + 0xd2d2fd5e, 0x7d7d20ba, 0x666631ae, 0x3a3aa35b, + 0x59591c8a, 0x00000000, 0xcdcd93bc, 0x1a1ae09d, + 0xaeae2c6d, 0x7f7fabc1, 0x2b2bc7b1, 0xbebeb90e, + 0xe0e0a080, 0x8a8a105d, 0x3b3b52d2, 0x6464bad5, + 0xd8d888a0, 0xe7e7a584, 0x5f5fe807, 0x1b1b1114, + 0x2c2cc2b5, 0xfcfcb490, 0x3131272c, 0x808065a3, + 0x73732ab2, 0x0c0c8173, 0x79795f4c, 0x6b6b4154, + 0x4b4b0292, 0x53536974, 0x94948f36, 0x83831f51, + 0x2a2a3638, 0xc4c49cb0, 0x2222c8bd, 0xd5d5f85a, + 0xbdbdc3fc, 0x48487860, 0xffffce62, 0x4c4c0796, + 0x4141776c, 0xc7c7e642, 0xebeb24f7, 0x1c1c1410, + 0x5d5d637c, 0x36362228, 0x6767c027, 0xe9e9af8c, + 0x4444f913, 0x1414ea95, 0xf5f5bb9c, 0xcfcf18c7, + 0x3f3f2d24, 0xc0c0e346, 0x7272db3b, 0x54546c70, + 0x29294cca, 0xf0f035e3, 0x0808fe85, 0xc6c617cb, + 0xf3f34f11, 0x8c8ce4d0, 0xa4a45993, 0xcaca96b8, + 0x68683ba6, 0xb8b84d83, 0x38382820, 0xe5e52eff, + 0xadad569f, 0x0b0b8477, 0xc8c81dc3, 0x9999ffcc, + 0x5858ed03, 0x19199a6f, 0x0e0e0a08, 0x95957ebf, + 0x70705040, 0xf7f730e7, 0x6e6ecf2b, 0x1f1f6ee2, + 0xb5b53d79, 0x09090f0c, 0x616134aa, 0x57571682, + 0x9f9f0b41, 0x9d9d803a, 0x111164ea, 0x2525cdb9, + 0xafafdde4, 0x4545089a, 0xdfdf8da4, 0xa3a35c97, + 0xeaead57e, 0x353558da, 0xededd07a, 0x4343fc17, + 0xf8f8cb66, 0xfbfbb194, 0x3737d3a1, 0xfafa401d, + 0xc2c2683d, 0xb4b4ccf0, 0x32325dde, 0x9c9c71b3, + 0x5656e70b, 0xe3e3da72, 0x878760a7, 0x15151b1c, + 0xf9f93aef, 0x6363bfd1, 0x3434a953, 0x9a9a853e, + 0xb1b1428f, 0x7c7cd133, 0x88889b26, 0x3d3da65f, + 0xa1a1d7ec, 0xe4e4df76, 0x8181942a, 0x91910149, + 0x0f0ffb81, 0xeeeeaa88, 0x161661ee, 0xd7d77321, + 0x9797f5c4, 0xa5a5a81a, 0xfefe3feb, 0x6d6db5d9, + 0x7878aec5, 0xc5c56d39, 0x1d1de599, 0x7676a4cd, + 0x3e3edcad, 0xcbcb6731, 0xb6b6478b, 0xefef5b01, + 0x12121e18, 0x6060c523, 0x6a6ab0dd, 0x4d4df61f, + 0xcecee94e, 0xdede7c2d, 0x55559df9, 0x7e7e5a48, + 0x2121b24f, 0x03037af2, 0xa0a02665, 0x5e5e198e, + 0x5a5a6678, 0x65654b5c, 0x62624e58, 0xfdfd4519, + 0x0606f48d, 0x404086e5, 0xf2f2be98, 0x3333ac57, + 0x17179067, 0x05058e7f, 0xe8e85e05, 0x4f4f7d64, + 0x89896aaf, 0x10109563, 0x74742fb6, 0x0a0a75fe, + 0x5c5c92f5, 0x9b9b74b7, 0x2d2d333c, 0x3030d6a5, + 0x2e2e49ce, 0x494989e9, 0x46467268, 0x77775544, + 0xa8a8d8e0, 0x9696044d, 0x2828bd43, 0xa9a92969, + 0xd9d97929, 0x8686912e, 0xd1d187ac, 0xf4f44a15, + 0x8d8d1559, 0xd6d682a8, 0xb9b9bc0a, 0x42420d9e, + 0xf6f6c16e, 0x2f2fb847, 0xdddd06df, 0x23233934, + 0xcccc6235, 0xf1f1c46a, 0xc1c112cf, 0x8585ebdc, + 0x8f8f9e22, 0x7171a1c9, 0x9090f0c0, 0xaaaa539b, + 0x0101f189, 0x8b8be1d4, 0x4e4e8ced, 0x8e8e6fab, + 0xababa212, 0x6f6f3ea2, 0xe6e6540d, 0xdbdbf252, + 0x92927bbb, 0xb7b7b602, 0x6969ca2f, 0x3939d9a9, + 0xd3d30cd7, 0xa7a72361, 0xa2a2ad1e, 0xc3c399b4, + 0x6c6c4450, 0x07070504, 0x04047ff6, 0x272746c2, + 0xacaca716, 0xd0d07625, 0x50501386, 0xdcdcf756, + 0x84841a55, 0xe1e15109, 0x7a7a25be, 0x1313ef91 + }, + { + 0xa9d93939, 0x67901717, 0xb3719c9c, 0xe8d2a6a6, + 0x04050707, 0xfd985252, 0xa3658080, 0x76dfe4e4, + 0x9a084545, 0x92024b4b, 0x80a0e0e0, 0x78665a5a, + 0xe4ddafaf, 0xddb06a6a, 0xd1bf6363, 0x38362a2a, + 0x0d54e6e6, 0xc6432020, 0x3562cccc, 0x98bef2f2, + 0x181e1212, 0xf724ebeb, 0xecd7a1a1, 0x6c774141, + 0x43bd2828, 0x7532bcbc, 0x37d47b7b, 0x269b8888, + 0xfa700d0d, 0x13f94444, 0x94b1fbfb, 0x485a7e7e, + 0xf27a0303, 0xd0e48c8c, 0x8b47b6b6, 0x303c2424, + 0x84a5e7e7, 0x54416b6b, 0xdf06dddd, 0x23c56060, + 0x1945fdfd, 0x5ba33a3a, 0x3d68c2c2, 0x59158d8d, + 0xf321ecec, 0xae316666, 0xa23e6f6f, 0x82165757, + 0x63951010, 0x015befef, 0x834db8b8, 0x2e918686, + 0xd9b56d6d, 0x511f8383, 0x9b53aaaa, 0x7c635d5d, + 0xa63b6868, 0xeb3ffefe, 0xa5d63030, 0xbe257a7a, + 0x16a7acac, 0x0c0f0909, 0xe335f0f0, 0x6123a7a7, + 0xc0f09090, 0x8cafe9e9, 0x3a809d9d, 0xf5925c5c, + 0x73810c0c, 0x2c273131, 0x2576d0d0, 0x0be75656, + 0xbb7b9292, 0x4ee9cece, 0x89f10101, 0x6b9f1e1e, + 0x53a93434, 0x6ac4f1f1, 0xb499c3c3, 0xf1975b5b, + 0xe1834747, 0xe66b1818, 0xbdc82222, 0x450e9898, + 0xe26e1f1f, 0xf4c9b3b3, 0xb62f7474, 0x66cbf8f8, + 0xccff9999, 0x95ea1414, 0x03ed5858, 0x56f7dcdc, + 0xd4e18b8b, 0x1c1b1515, 0x1eada2a2, 0xd70cd3d3, + 0xfb2be2e2, 0xc31dc8c8, 0x8e195e5e, 0xb5c22c2c, + 0xe9894949, 0xcf12c1c1, 0xbf7e9595, 0xba207d7d, + 0xea641111, 0x77840b0b, 0x396dc5c5, 0xaf6a8989, + 0x33d17c7c, 0xc9a17171, 0x62ceffff, 0x7137bbbb, + 0x81fb0f0f, 0x793db5b5, 0x0951e1e1, 0xaddc3e3e, + 0x242d3f3f, 0xcda47676, 0xf99d5555, 0xd8ee8282, + 0xe5864040, 0xc5ae7878, 0xb9cd2525, 0x4d049696, + 0x44557777, 0x080a0e0e, 0x86135050, 0xe730f7f7, + 0xa1d33737, 0x1d40fafa, 0xaa346161, 0xed8c4e4e, + 0x06b3b0b0, 0x706c5454, 0xb22a7373, 0xd2523b3b, + 0x410b9f9f, 0x7b8b0202, 0xa088d8d8, 0x114ff3f3, + 0x3167cbcb, 0xc2462727, 0x27c06767, 0x90b4fcfc, + 0x20283838, 0xf67f0404, 0x60784848, 0xff2ee5e5, + 0x96074c4c, 0x5c4b6565, 0xb1c72b2b, 0xab6f8e8e, + 0x9e0d4242, 0x9cbbf5f5, 0x52f2dbdb, 0x1bf34a4a, + 0x5fa63d3d, 0x9359a4a4, 0x0abcb9b9, 0xef3af9f9, + 0x91ef1313, 0x85fe0808, 0x49019191, 0xee611616, + 0x2d7cdede, 0x4fb22121, 0x8f42b1b1, 0x3bdb7272, + 0x47b82f2f, 0x8748bfbf, 0x6d2caeae, 0x46e3c0c0, + 0xd6573c3c, 0x3e859a9a, 0x6929a9a9, 0x647d4f4f, + 0x2a948181, 0xce492e2e, 0xcb17c6c6, 0x2fca6969, + 0xfcc3bdbd, 0x975ca3a3, 0x055ee8e8, 0x7ad0eded, + 0xac87d1d1, 0x7f8e0505, 0xd5ba6464, 0x1aa8a5a5, + 0x4bb72626, 0x0eb9bebe, 0xa7608787, 0x5af8d5d5, + 0x28223636, 0x14111b1b, 0x3fde7575, 0x2979d9d9, + 0x88aaeeee, 0x3c332d2d, 0x4c5f7979, 0x02b6b7b7, + 0xb896caca, 0xda583535, 0xb09cc4c4, 0x17fc4343, + 0x551a8484, 0x1ff64d4d, 0x8a1c5959, 0x7d38b2b2, + 0x57ac3333, 0xc718cfcf, 0x8df40606, 0x74695353, + 0xb7749b9b, 0xc4f59797, 0x9f56adad, 0x72dae3e3, + 0x7ed5eaea, 0x154af4f4, 0x229e8f8f, 0x12a2abab, + 0x584e6262, 0x07e85f5f, 0x99e51d1d, 0x34392323, + 0x6ec1f6f6, 0x50446c6c, 0xde5d3232, 0x68724646, + 0x6526a0a0, 0xbc93cdcd, 0xdb03dada, 0xf8c6baba, + 0xc8fa9e9e, 0xa882d6d6, 0x2bcf6e6e, 0x40507070, + 0xdceb8585, 0xfe750a0a, 0x328a9393, 0xa48ddfdf, + 0xca4c2929, 0x10141c1c, 0x2173d7d7, 0xf0ccb4b4, + 0xd309d4d4, 0x5d108a8a, 0x0fe25151, 0x00000000, + 0x6f9a1919, 0x9de01a1a, 0x368f9494, 0x42e6c7c7, + 0x4aecc9c9, 0x5efdd2d2, 0xc1ab7f7f, 0xe0d8a8a8 + }, + { + 0xbc75bc32, 0xecf3ec21, 0x20c62043, 0xb3f4b3c9, + 0xdadbda03, 0x027b028b, 0xe2fbe22b, 0x9ec89efa, + 0xc94ac9ec, 0xd4d3d409, 0x18e6186b, 0x1e6b1e9f, + 0x9845980e, 0xb27db238, 0xa6e8a6d2, 0x264b26b7, + 0x3cd63c57, 0x9332938a, 0x82d882ee, 0x52fd5298, + 0x7b377bd4, 0xbb71bb37, 0x5bf15b97, 0x47e14783, + 0x2430243c, 0x510f51e2, 0xbaf8bac6, 0x4a1b4af3, + 0xbf87bf48, 0x0dfa0d70, 0xb006b0b3, 0x753f75de, + 0xd25ed2fd, 0x7dba7d20, 0x66ae6631, 0x3a5b3aa3, + 0x598a591c, 0x00000000, 0xcdbccd93, 0x1a9d1ae0, + 0xae6dae2c, 0x7fc17fab, 0x2bb12bc7, 0xbe0ebeb9, + 0xe080e0a0, 0x8a5d8a10, 0x3bd23b52, 0x64d564ba, + 0xd8a0d888, 0xe784e7a5, 0x5f075fe8, 0x1b141b11, + 0x2cb52cc2, 0xfc90fcb4, 0x312c3127, 0x80a38065, + 0x73b2732a, 0x0c730c81, 0x794c795f, 0x6b546b41, + 0x4b924b02, 0x53745369, 0x9436948f, 0x8351831f, + 0x2a382a36, 0xc4b0c49c, 0x22bd22c8, 0xd55ad5f8, + 0xbdfcbdc3, 0x48604878, 0xff62ffce, 0x4c964c07, + 0x416c4177, 0xc742c7e6, 0xebf7eb24, 0x1c101c14, + 0x5d7c5d63, 0x36283622, 0x672767c0, 0xe98ce9af, + 0x441344f9, 0x149514ea, 0xf59cf5bb, 0xcfc7cf18, + 0x3f243f2d, 0xc046c0e3, 0x723b72db, 0x5470546c, + 0x29ca294c, 0xf0e3f035, 0x088508fe, 0xc6cbc617, + 0xf311f34f, 0x8cd08ce4, 0xa493a459, 0xcab8ca96, + 0x68a6683b, 0xb883b84d, 0x38203828, 0xe5ffe52e, + 0xad9fad56, 0x0b770b84, 0xc8c3c81d, 0x99cc99ff, + 0x580358ed, 0x196f199a, 0x0e080e0a, 0x95bf957e, + 0x70407050, 0xf7e7f730, 0x6e2b6ecf, 0x1fe21f6e, + 0xb579b53d, 0x090c090f, 0x61aa6134, 0x57825716, + 0x9f419f0b, 0x9d3a9d80, 0x11ea1164, 0x25b925cd, + 0xafe4afdd, 0x459a4508, 0xdfa4df8d, 0xa397a35c, + 0xea7eead5, 0x35da3558, 0xed7aedd0, 0x431743fc, + 0xf866f8cb, 0xfb94fbb1, 0x37a137d3, 0xfa1dfa40, + 0xc23dc268, 0xb4f0b4cc, 0x32de325d, 0x9cb39c71, + 0x560b56e7, 0xe372e3da, 0x87a78760, 0x151c151b, + 0xf9eff93a, 0x63d163bf, 0x345334a9, 0x9a3e9a85, + 0xb18fb142, 0x7c337cd1, 0x8826889b, 0x3d5f3da6, + 0xa1eca1d7, 0xe476e4df, 0x812a8194, 0x91499101, + 0x0f810ffb, 0xee88eeaa, 0x16ee1661, 0xd721d773, + 0x97c497f5, 0xa51aa5a8, 0xfeebfe3f, 0x6dd96db5, + 0x78c578ae, 0xc539c56d, 0x1d991de5, 0x76cd76a4, + 0x3ead3edc, 0xcb31cb67, 0xb68bb647, 0xef01ef5b, + 0x1218121e, 0x602360c5, 0x6add6ab0, 0x4d1f4df6, + 0xce4ecee9, 0xde2dde7c, 0x55f9559d, 0x7e487e5a, + 0x214f21b2, 0x03f2037a, 0xa065a026, 0x5e8e5e19, + 0x5a785a66, 0x655c654b, 0x6258624e, 0xfd19fd45, + 0x068d06f4, 0x40e54086, 0xf298f2be, 0x335733ac, + 0x17671790, 0x057f058e, 0xe805e85e, 0x4f644f7d, + 0x89af896a, 0x10631095, 0x74b6742f, 0x0afe0a75, + 0x5cf55c92, 0x9bb79b74, 0x2d3c2d33, 0x30a530d6, + 0x2ece2e49, 0x49e94989, 0x46684672, 0x77447755, + 0xa8e0a8d8, 0x964d9604, 0x284328bd, 0xa969a929, + 0xd929d979, 0x862e8691, 0xd1acd187, 0xf415f44a, + 0x8d598d15, 0xd6a8d682, 0xb90ab9bc, 0x429e420d, + 0xf66ef6c1, 0x2f472fb8, 0xdddfdd06, 0x23342339, + 0xcc35cc62, 0xf16af1c4, 0xc1cfc112, 0x85dc85eb, + 0x8f228f9e, 0x71c971a1, 0x90c090f0, 0xaa9baa53, + 0x018901f1, 0x8bd48be1, 0x4eed4e8c, 0x8eab8e6f, + 0xab12aba2, 0x6fa26f3e, 0xe60de654, 0xdb52dbf2, + 0x92bb927b, 0xb702b7b6, 0x692f69ca, 0x39a939d9, + 0xd3d7d30c, 0xa761a723, 0xa21ea2ad, 0xc3b4c399, + 0x6c506c44, 0x07040705, 0x04f6047f, 0x27c22746, + 0xac16aca7, 0xd025d076, 0x50865013, 0xdc56dcf7, + 0x8455841a, 0xe109e151, 0x7abe7a25, 0x139113ef + }, + { + 0xd939a9d9, 0x90176790, 0x719cb371, 0xd2a6e8d2, + 0x05070405, 0x9852fd98, 0x6580a365, 0xdfe476df, + 0x08459a08, 0x024b9202, 0xa0e080a0, 0x665a7866, + 0xddafe4dd, 0xb06addb0, 0xbf63d1bf, 0x362a3836, + 0x54e60d54, 0x4320c643, 0x62cc3562, 0xbef298be, + 0x1e12181e, 0x24ebf724, 0xd7a1ecd7, 0x77416c77, + 0xbd2843bd, 0x32bc7532, 0xd47b37d4, 0x9b88269b, + 0x700dfa70, 0xf94413f9, 0xb1fb94b1, 0x5a7e485a, + 0x7a03f27a, 0xe48cd0e4, 0x47b68b47, 0x3c24303c, + 0xa5e784a5, 0x416b5441, 0x06dddf06, 0xc56023c5, + 0x45fd1945, 0xa33a5ba3, 0x68c23d68, 0x158d5915, + 0x21ecf321, 0x3166ae31, 0x3e6fa23e, 0x16578216, + 0x95106395, 0x5bef015b, 0x4db8834d, 0x91862e91, + 0xb56dd9b5, 0x1f83511f, 0x53aa9b53, 0x635d7c63, + 0x3b68a63b, 0x3ffeeb3f, 0xd630a5d6, 0x257abe25, + 0xa7ac16a7, 0x0f090c0f, 0x35f0e335, 0x23a76123, + 0xf090c0f0, 0xafe98caf, 0x809d3a80, 0x925cf592, + 0x810c7381, 0x27312c27, 0x76d02576, 0xe7560be7, + 0x7b92bb7b, 0xe9ce4ee9, 0xf10189f1, 0x9f1e6b9f, + 0xa93453a9, 0xc4f16ac4, 0x99c3b499, 0x975bf197, + 0x8347e183, 0x6b18e66b, 0xc822bdc8, 0x0e98450e, + 0x6e1fe26e, 0xc9b3f4c9, 0x2f74b62f, 0xcbf866cb, + 0xff99ccff, 0xea1495ea, 0xed5803ed, 0xf7dc56f7, + 0xe18bd4e1, 0x1b151c1b, 0xada21ead, 0x0cd3d70c, + 0x2be2fb2b, 0x1dc8c31d, 0x195e8e19, 0xc22cb5c2, + 0x8949e989, 0x12c1cf12, 0x7e95bf7e, 0x207dba20, + 0x6411ea64, 0x840b7784, 0x6dc5396d, 0x6a89af6a, + 0xd17c33d1, 0xa171c9a1, 0xceff62ce, 0x37bb7137, + 0xfb0f81fb, 0x3db5793d, 0x51e10951, 0xdc3eaddc, + 0x2d3f242d, 0xa476cda4, 0x9d55f99d, 0xee82d8ee, + 0x8640e586, 0xae78c5ae, 0xcd25b9cd, 0x04964d04, + 0x55774455, 0x0a0e080a, 0x13508613, 0x30f7e730, + 0xd337a1d3, 0x40fa1d40, 0x3461aa34, 0x8c4eed8c, + 0xb3b006b3, 0x6c54706c, 0x2a73b22a, 0x523bd252, + 0x0b9f410b, 0x8b027b8b, 0x88d8a088, 0x4ff3114f, + 0x67cb3167, 0x4627c246, 0xc06727c0, 0xb4fc90b4, + 0x28382028, 0x7f04f67f, 0x78486078, 0x2ee5ff2e, + 0x074c9607, 0x4b655c4b, 0xc72bb1c7, 0x6f8eab6f, + 0x0d429e0d, 0xbbf59cbb, 0xf2db52f2, 0xf34a1bf3, + 0xa63d5fa6, 0x59a49359, 0xbcb90abc, 0x3af9ef3a, + 0xef1391ef, 0xfe0885fe, 0x01914901, 0x6116ee61, + 0x7cde2d7c, 0xb2214fb2, 0x42b18f42, 0xdb723bdb, + 0xb82f47b8, 0x48bf8748, 0x2cae6d2c, 0xe3c046e3, + 0x573cd657, 0x859a3e85, 0x29a96929, 0x7d4f647d, + 0x94812a94, 0x492ece49, 0x17c6cb17, 0xca692fca, + 0xc3bdfcc3, 0x5ca3975c, 0x5ee8055e, 0xd0ed7ad0, + 0x87d1ac87, 0x8e057f8e, 0xba64d5ba, 0xa8a51aa8, + 0xb7264bb7, 0xb9be0eb9, 0x6087a760, 0xf8d55af8, + 0x22362822, 0x111b1411, 0xde753fde, 0x79d92979, + 0xaaee88aa, 0x332d3c33, 0x5f794c5f, 0xb6b702b6, + 0x96cab896, 0x5835da58, 0x9cc4b09c, 0xfc4317fc, + 0x1a84551a, 0xf64d1ff6, 0x1c598a1c, 0x38b27d38, + 0xac3357ac, 0x18cfc718, 0xf4068df4, 0x69537469, + 0x749bb774, 0xf597c4f5, 0x56ad9f56, 0xdae372da, + 0xd5ea7ed5, 0x4af4154a, 0x9e8f229e, 0xa2ab12a2, + 0x4e62584e, 0xe85f07e8, 0xe51d99e5, 0x39233439, + 0xc1f66ec1, 0x446c5044, 0x5d32de5d, 0x72466872, + 0x26a06526, 0x93cdbc93, 0x03dadb03, 0xc6baf8c6, + 0xfa9ec8fa, 0x82d6a882, 0xcf6e2bcf, 0x50704050, + 0xeb85dceb, 0x750afe75, 0x8a93328a, 0x8ddfa48d, + 0x4c29ca4c, 0x141c1014, 0x73d72173, 0xccb4f0cc, + 0x09d4d309, 0x108a5d10, 0xe2510fe2, 0x00000000, + 0x9a196f9a, 0xe01a9de0, 0x8f94368f, 0xe6c742e6, + 0xecc94aec, 0xfdd25efd, 0xab7fc1ab, 0xd8a8e0d8 + } +}; + + +} // namespace + diff --git a/externals/mysql/extlib/yassl/taocrypt/src/twofish.cpp b/externals/mysql/extlib/yassl/taocrypt/src/twofish.cpp new file mode 100644 index 00000000000..84dd35f9191 --- /dev/null +++ b/externals/mysql/extlib/yassl/taocrypt/src/twofish.cpp @@ -0,0 +1,575 @@ +/* + Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ + +/* C++ based on Wei Dai's twofish.cpp from CryptoPP */ +/* x86 asm original */ + + +#if defined(TAOCRYPT_KERNEL_MODE) + #define DO_TAOCRYPT_KERNEL_MODE +#endif // only some modules now support this + +#include "runtime.hpp" +#include "twofish.hpp" + + + +namespace TaoCrypt { + + +#if defined(DO_TWOFISH_ASM) + +// ia32 optimized version +void Twofish::Process(byte* out, const byte* in, word32 sz) +{ + if (!isMMX) { + Mode_BASE::Process(out, in, sz); + return; + } + + word32 blocks = sz / BLOCK_SIZE; + + if (mode_ == ECB) + while (blocks--) { + if (dir_ == ENCRYPTION) + AsmEncrypt(in, out); + else + AsmDecrypt(in, out); + + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } + else if (mode_ == CBC) + if (dir_ == ENCRYPTION) + while (blocks--) { + r_[0] ^= *(word32*)in; + r_[1] ^= *(word32*)(in + 4); + r_[2] ^= *(word32*)(in + 8); + r_[3] ^= *(word32*)(in + 12); + + AsmEncrypt((byte*)r_, (byte*)r_); + memcpy(out, r_, BLOCK_SIZE); + + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } + else + while (blocks--) { + AsmDecrypt(in, out); + + *(word32*)out ^= r_[0]; + *(word32*)(out + 4) ^= r_[1]; + *(word32*)(out + 8) ^= r_[2]; + *(word32*)(out + 12) ^= r_[3]; + + memcpy(r_, in, BLOCK_SIZE); + + out += BLOCK_SIZE; + in += BLOCK_SIZE; + } +} + +#endif // DO_TWOFISH_ASM + + +namespace { // locals + +// compute (c * x^4) mod (x^4 + (a + 1/a) * x^3 + a * x^2 + (a + 1/a) * x + 1) +// over GF(256) +static inline unsigned int Mod(unsigned int c) +{ + static const unsigned int modulus = 0x14d; + unsigned int c2 = (c<<1) ^ ((c & 0x80) ? modulus : 0); + unsigned int c1 = c2 ^ (c>>1) ^ ((c & 1) ? (modulus>>1) : 0); + return c | (c1 << 8) | (c2 << 16) | (c1 << 24); +} + +// compute RS(12,8) code with the above polynomial as generator +// this is equivalent to multiplying by the RS matrix +static word32 ReedSolomon(word32 high, word32 low) +{ + for (unsigned int i=0; i<8; i++) { + high = Mod(high>>24) ^ (high<<8) ^ (low>>24); + low <<= 8; + } + return high; +} + +} // local namespace + + + +inline word32 Twofish::h0(word32 x, const word32* key, unsigned int kLen) +{ + x = x | (x<<8) | (x<<16) | (x<<24); + switch(kLen) + { +#define Q(a, b, c, d, t) q_[a][GETBYTE(t,0)] ^ (q_[b][GETBYTE(t,1)] << 8) ^ \ + (q_[c][GETBYTE(t,2)] << 16) ^ (q_[d][GETBYTE(t,3)] << 24) + case 4: x = Q(1, 0, 0, 1, x) ^ key[6]; + case 3: x = Q(1, 1, 0, 0, x) ^ key[4]; + case 2: x = Q(0, 1, 0, 1, x) ^ key[2]; + x = Q(0, 0, 1, 1, x) ^ key[0]; + } + return x; +} + +inline word32 Twofish::h(word32 x, const word32* key, unsigned int kLen) +{ + x = h0(x, key, kLen); + return mds_[0][GETBYTE(x,0)] ^ mds_[1][GETBYTE(x,1)] ^ + mds_[2][GETBYTE(x,2)] ^ mds_[3][GETBYTE(x,3)]; +} + + +void Twofish::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/) +{ + assert(keylen >= 16 && keylen <= 32); + + unsigned int len = (keylen <= 16 ? 2 : (keylen <= 24 ? 3 : 4)); + word32 key[8]; + GetUserKey(LittleEndianOrder, key, len*2, userKey, keylen); + + unsigned int i; + for (i=0; i<40; i+=2) { + word32 a = h(i, key, len); + word32 b = rotlFixed(h(i+1, key+1, len), 8); + k_[i] = a+b; + k_[i+1] = rotlFixed(a+2*b, 9); + } + + word32 svec[8]; + for (i=0; i gpBlock; + +void Twofish::encrypt(const byte* inBlock, const byte* xorBlock, + byte* outBlock) const +{ + word32 x, y, a, b, c, d; + + gpBlock::Get(inBlock)(a)(b)(c)(d); + + a ^= k_[0]; + b ^= k_[1]; + c ^= k_[2]; + d ^= k_[3]; + + const word32 *k = k_+8; + + ENCCYCLE (0); + ENCCYCLE (1); + ENCCYCLE (2); + ENCCYCLE (3); + ENCCYCLE (4); + ENCCYCLE (5); + ENCCYCLE (6); + ENCCYCLE (7); + + c ^= k_[4]; + d ^= k_[5]; + a ^= k_[6]; + b ^= k_[7]; + + gpBlock::Put(xorBlock, outBlock)(c)(d)(a)(b); +} + + +void Twofish::decrypt(const byte* inBlock, const byte* xorBlock, + byte* outBlock) const +{ + word32 x, y, a, b, c, d; + + gpBlock::Get(inBlock)(c)(d)(a)(b); + + c ^= k_[4]; + d ^= k_[5]; + a ^= k_[6]; + b ^= k_[7]; + + const word32 *k = k_+8; + DECCYCLE (7); + DECCYCLE (6); + DECCYCLE (5); + DECCYCLE (4); + DECCYCLE (3); + DECCYCLE (2); + DECCYCLE (1); + DECCYCLE (0); + + a ^= k_[0]; + b ^= k_[1]; + c ^= k_[2]; + d ^= k_[3]; + + gpBlock::Put(xorBlock, outBlock)(a)(b)(c)(d); +} + + + +#if defined(DO_TWOFISH_ASM) + #ifdef __GNUC__ + #define AS1(x) asm(#x); + #define AS2(x, y) asm(#x ", " #y); + + #define PROLOG() \ + asm(".intel_syntax noprefix"); \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edi, DWORD PTR [ebp + 8] ) \ + AS2( mov esi, DWORD PTR [ebp + 12] ) + + #define EPILOG() \ + AS2( movd esp, mm6 ) \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS1( emms ) \ + asm(".att_syntax"); + #else + #define AS1(x) __asm x + #define AS2(x, y) __asm x, y + + #define PROLOG() \ + AS1( push ebp ) \ + AS2( mov ebp, esp ) \ + AS2( movd mm3, edi ) \ + AS2( movd mm4, ebx ) \ + AS2( movd mm5, esi ) \ + AS2( movd mm6, ebp ) \ + AS2( mov edi, ecx ) \ + AS2( mov esi, DWORD PTR [ebp + 8] ) + + /* ebp already set */ + #define EPILOG() \ + AS2( movd esi, mm5 ) \ + AS2( movd ebx, mm4 ) \ + AS2( movd edi, mm3 ) \ + AS2( mov esp, ebp ) \ + AS1( pop ebp ) \ + AS1( emms ) \ + AS1( ret 8 ) + + #endif + + + + + // x = esi, y = [esp], s_ = ebp + // edi always open for G1 and G2 + // G1 also uses edx after save and restore + // G2 also uses eax after save and restore + // and ecx for tmp [esp] which Rounds also use + // and restore from mm7 + + // x = G1(a) bytes(0,1,2,3) +#define ASMG1(z, zl, zh) \ + AS2( movd mm2, edx ) \ + AS2( movzx edi, zl ) \ + AS2( mov esi, DWORD PTR [ebp + edi*4] ) \ + AS2( movzx edx, zh ) \ + AS2( xor esi, DWORD PTR 1024[ebp + edx*4] ) \ + \ + AS2( mov edx, z ) \ + AS2( shr edx, 16 ) \ + AS2( movzx edi, dl ) \ + AS2( xor esi, DWORD PTR 2048[ebp + edi*4] ) \ + AS2( movzx edx, dh ) \ + AS2( xor esi, DWORD PTR 3072[ebp + edx*4] ) \ + AS2( movd edx, mm2 ) + + + // y = G2(b) bytes(3,0,1,2) [ put y into ecx for Rounds ] +#define ASMG2(z, zl, zh) \ + AS2( movd mm7, ecx ) \ + AS2( movd mm2, eax ) \ + AS2( mov edi, z ) \ + AS2( shr edi, 24 ) \ + AS2( mov ecx, DWORD PTR [ebp + edi*4] ) \ + AS2( movzx eax, zl ) \ + AS2( xor ecx, DWORD PTR 1024[ebp + eax*4] ) \ + \ + AS2( mov eax, z ) \ + AS2( shr eax, 16 ) \ + AS2( movzx edi, zh ) \ + AS2( xor ecx, DWORD PTR 2048[ebp + edi*4] ) \ + AS2( movzx eax, al ) \ + AS2( xor ecx, DWORD PTR 3072[ebp + eax*4] ) \ + AS2( movd eax, mm2 ) + + + // encrypt Round (n), + // x = esi, k = ebp, edi open + // y is in ecx from G2, restore when done from mm7 + // before C (which be same register!) +#define ASMENCROUND(N, A, A2, A3, B, B2, B3, C, D) \ + /* setup s_ */ \ + AS2( movd ebp, mm1 ) \ + ASMG1(A, A2, A3) \ + ASMG2(B, B2, B3) \ + /* setup k */ \ + AS2( movd ebp, mm0 ) \ + /* x += y */ \ + AS2( add esi, ecx ) \ + AS2( add ebp, 32 ) \ + /* y += x + k[2 * (n) + 1] */ \ + AS2( add ecx, esi ) \ + AS2( rol D, 1 ) \ + AS2( add ecx, DWORD PTR [ebp + 8 * N + 4] ) \ + /* (d) = rotlFixed(d, 1) ^ y */ \ + AS2( xor D, ecx ) \ + AS2( movd ecx, mm7 ) \ + /* (c) ^= x + k[2 * (n)] */ \ + AS2( mov edi, esi ) \ + AS2( add edi, DWORD PTR [ebp + 8 * N] ) \ + AS2( xor C, edi ) \ + /* (c) = rotrFixed(c, 1) */ \ + AS2( ror C, 1 ) + + + // decrypt Round (n), + // x = esi, k = ebp, edi open + // y is in ecx from G2, restore ecx from mm7 when done +#define ASMDECROUND(N, A, A2, A3, B, B2, B3, C, D) \ + /* setup s_ */ \ + AS2( movd ebp, mm1 ) \ + ASMG1(A, A2, A3) \ + ASMG2(B, B2, B3) \ + /* setup k */ \ + AS2( movd ebp, mm0 ) \ + /* x += y */ \ + AS2( add esi, ecx ) \ + AS2( add ebp, 32 ) \ + /* y += x */ \ + AS2( add ecx, esi ) \ + /* (d) ^= y + k[2 * (n) + 1] */ \ + AS2( mov edi, DWORD PTR [ebp + 8 * N + 4] ) \ + AS2( add edi, ecx ) \ + AS2( movd ecx, mm7 ) \ + AS2( xor D, edi ) \ + /* (d) = rotrFixed(d, 1) */ \ + AS2( ror D, 1 ) \ + /* (c) = rotlFixed(c, 1) */ \ + AS2( rol C, 1 ) \ + /* (c) ^= (x + k[2 * (n)]) */ \ + AS2( mov edi, esi ) \ + AS2( add edi, DWORD PTR [ebp + 8 * N] ) \ + AS2( xor C, edi ) + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void Twofish::AsmEncrypt(const byte* inBlock, byte* outBlock) const +{ + PROLOG() + + #ifdef OLD_GCC_OFFSET + AS2( add edi, 60 ) // k_ + #else + AS2( add edi, 56 ) // k_ + #endif + + AS2( mov ebp, edi ) + + AS2( mov eax, DWORD PTR [esi] ) // a + AS2( movd mm0, edi ) // store k_ + AS2( mov ebx, DWORD PTR [esi + 4] ) // b + AS2( add ebp, 160 ) // s_[0] + AS2( mov ecx, DWORD PTR [esi + 8] ) // c + AS2( movd mm1, ebp ) // store s_ + AS2( mov edx, DWORD PTR [esi + 12] ) // d + + AS2( xor eax, DWORD PTR [edi] ) // k_[0] + AS2( xor ebx, DWORD PTR [edi + 4] ) // [1] + AS2( xor ecx, DWORD PTR [edi + 8] ) // [2] + AS2( xor edx, DWORD PTR [edi + 12] ) // [3] + + + ASMENCROUND( 0, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND( 1, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND( 2, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND( 3, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND( 4, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND( 5, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND( 6, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND( 7, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND( 8, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND( 9, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND(10, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND(11, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND(12, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND(13, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMENCROUND(14, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMENCROUND(15, ecx, cl, ch, edx, dl, dh, eax, ebx) + + + AS2( movd ebp, mm6 ) + AS2( movd esi, mm0 ) // k_ + #ifdef __GNUC__ + AS2( mov edi, [ebp + 16] ) // outBlock + #else + AS2( mov edi, [ebp + 12] ) // outBlock + #endif + + AS2( xor ecx, DWORD PTR [esi + 16] ) // k_[4] + AS2( xor edx, DWORD PTR [esi + 20] ) // k_[5] + AS2( xor eax, DWORD PTR [esi + 24] ) // k_[6] + AS2( xor ebx, DWORD PTR [esi + 28] ) // k_[7] + + AS2( mov [edi], ecx ) // write out + AS2( mov [edi + 4], edx ) // write out + AS2( mov [edi + 8], eax ) // write out + AS2( mov [edi + 12], ebx ) // write out + + + EPILOG() +} + + +#ifdef _MSC_VER + __declspec(naked) +#endif +void Twofish::AsmDecrypt(const byte* inBlock, byte* outBlock) const +{ + PROLOG() + + #ifdef OLD_GCC_OFFSET + AS2( add edi, 60 ) // k_ + #else + AS2( add edi, 56 ) // k_ + #endif + + AS2( mov ebp, edi ) + + AS2( mov ecx, DWORD PTR [esi] ) // c + AS2( movd mm0, edi ) // store k_ + AS2( mov edx, DWORD PTR [esi + 4] ) // d + AS2( add ebp, 160 ) // s_[0] + AS2( mov eax, DWORD PTR [esi + 8] ) // a + AS2( movd mm1, ebp ) // store s_ + AS2( mov ebx, DWORD PTR [esi + 12] ) // b + + AS2( xor ecx, DWORD PTR [edi + 16] ) // k_[4] + AS2( xor edx, DWORD PTR [edi + 20] ) // [5] + AS2( xor eax, DWORD PTR [edi + 24] ) // [6] + AS2( xor ebx, DWORD PTR [edi + 28] ) // [7] + + + ASMDECROUND(15, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND(14, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND(13, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND(12, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND(11, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND(10, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND( 9, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND( 8, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND( 7, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND( 6, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND( 5, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND( 4, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND( 3, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND( 2, eax, al, ah, ebx, bl, bh, ecx, edx) + ASMDECROUND( 1, ecx, cl, ch, edx, dl, dh, eax, ebx) + ASMDECROUND( 0, eax, al, ah, ebx, bl, bh, ecx, edx) + + + AS2( movd ebp, mm6 ) + AS2( movd esi, mm0 ) // k_ + #ifdef __GNUC__ + AS2( mov edi, [ebp + 16] ) // outBlock + #else + AS2( mov edi, [ebp + 12] ) // outBlock + #endif + + AS2( xor eax, DWORD PTR [esi ] ) // k_[0] + AS2( xor ebx, DWORD PTR [esi + 4] ) // k_[1] + AS2( xor ecx, DWORD PTR [esi + 8] ) // k_[2] + AS2( xor edx, DWORD PTR [esi + 12] ) // k_[3] + + AS2( mov [edi], eax ) // write out + AS2( mov [edi + 4], ebx ) // write out + AS2( mov [edi + 8], ecx ) // write out + AS2( mov [edi + 12], edx ) // write out + + + EPILOG() +} + + + +#endif // defined(DO_TWOFISH_ASM) + + + + + +} // namespace + + diff --git a/externals/mysql/hash.h b/externals/mysql/hash.h new file mode 100644 index 00000000000..c1797c8293c --- /dev/null +++ b/externals/mysql/hash.h @@ -0,0 +1,84 @@ +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Dynamic hashing of record with different key-length */ + +#ifndef _hash_h +#define _hash_h +#ifdef __cplusplus +extern "C" { +#endif + +/* + Overhead to store an element in hash + Can be used to approximate memory consumption for a hash + */ +#define HASH_OVERHEAD (sizeof(char*)*2) + +/* flags for hash_init */ +#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */ + +typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool); +typedef void (*my_hash_free_key)(void *); +typedef my_bool (*my_hash_walk_action)(void *,void *); + +typedef struct st_hash { + size_t key_offset,key_length; /* Length of key if const length */ + size_t blength; + ulong records; + uint flags; + DYNAMIC_ARRAY array; /* Place for hash_keys */ + my_hash_get_key get_key; + void (*free)(void *); + CHARSET_INFO *charset; +} HASH; + +/* A search iterator state */ +typedef uint HASH_SEARCH_STATE; + +#define my_hash_init(A,B,C,D,E,F,G,H) \ + _my_hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO) +#define my_hash_init2(A,B,C,D,E,F,G,H,I) \ + _my_hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO) +my_bool _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset, + ulong default_array_elements, size_t key_offset, + size_t key_length, my_hash_get_key get_key, + void (*free_element)(void*), + uint flags CALLER_INFO_PROTO); +void my_hash_free(HASH *tree); +void my_hash_reset(HASH *hash); +uchar *my_hash_element(HASH *hash, ulong idx); +uchar *my_hash_search(const HASH *info, const uchar *key, size_t length); +uchar *my_hash_first(const HASH *info, const uchar *key, size_t length, + HASH_SEARCH_STATE *state); +uchar *my_hash_next(const HASH *info, const uchar *key, size_t length, + HASH_SEARCH_STATE *state); +my_bool my_hash_insert(HASH *info, const uchar *data); +my_bool my_hash_delete(HASH *hash, uchar *record); +my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, + size_t old_key_length); +void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row); +my_bool my_hash_check(HASH *hash); /* Only in debug library */ +my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument); + +#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H))) +#define my_hash_inited(H) ((H)->array.buffer != 0) +#define my_hash_init_opt(A,B,C,D,E,F,G,H) \ + (!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO)) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/externals/mysql/keycache.h b/externals/mysql/keycache.h new file mode 100644 index 00000000000..0375d1099bb --- /dev/null +++ b/externals/mysql/keycache.h @@ -0,0 +1,153 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file + Key cache API +*/ + +#ifndef _keycache_h +#define _keycache_h +C_MODE_START + +/* declare structures that is used by st_key_cache */ + +struct st_block_link; +typedef struct st_block_link BLOCK_LINK; +struct st_keycache_page; +typedef struct st_keycache_page KEYCACHE_PAGE; +struct st_hash_link; +typedef struct st_hash_link HASH_LINK; + +/* info about requests in a waiting queue */ +typedef struct st_keycache_wqueue +{ + struct st_my_thread_var *last_thread; /* circular list of waiting threads */ +} KEYCACHE_WQUEUE; + +/** Callback called when any block is flushed */ +typedef int (*KEYCACHE_POST_WRITE_CALLBACK)(void *arg, const uchar *buffert, + uint length, my_off_t filepos); + +#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */ + +/* + The key cache structure + It also contains read-only statistics parameters. +*/ + +typedef struct st_key_cache +{ + my_bool key_cache_inited; + my_bool in_resize; /* true during resize operation */ + my_bool resize_in_flush; /* true during flush of resize operation */ + my_bool can_be_used; /* usage of cache for read/write is allowed */ + size_t key_cache_mem_size; /* specified size of the cache memory */ + uint key_cache_block_size; /* size of the page buffer of a cache block */ + ulong min_warm_blocks; /* min number of warm blocks; */ + ulong age_threshold; /* age threshold for hot blocks */ + ulonglong keycache_time; /* total number of block link operations */ + uint hash_entries; /* max number of entries in the hash table */ + int hash_links; /* max number of hash links */ + int hash_links_used; /* number of hash links currently used */ + int disk_blocks; /* max number of blocks in the cache */ + ulong blocks_used; /* maximum number of concurrently used blocks */ + ulong blocks_unused; /* number of currently unused blocks */ + ulong blocks_changed; /* number of currently dirty blocks */ + ulong warm_blocks; /* number of blocks in warm sub-chain */ + ulong cnt_for_resize_op; /* counter to block resize operation */ + long blocks_available; /* number of blocks available in the LRU chain */ + HASH_LINK **hash_root; /* arr. of entries into hash table buckets */ + HASH_LINK *hash_link_root; /* memory for hash table links */ + HASH_LINK *free_hash_list; /* list of free hash links */ + BLOCK_LINK *free_block_list; /* list of free blocks */ + BLOCK_LINK *block_root; /* memory for block links */ + uchar HUGE_PTR *block_mem; /* memory for block buffers */ + BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */ + BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */ + pthread_mutex_t cache_lock; /* to lock access to the cache structure */ + KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */ + /* + Waiting for a zero resize count. Using a queue for symmetry though + only one thread can wait here. + */ + KEYCACHE_WQUEUE waiting_for_resize_cnt; + KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */ + KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */ + BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/ + BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file bl.*/ + KEYCACHE_POST_WRITE_CALLBACK post_write;/**< Called when flushing any block*/ + + /* + The following variables are and variables used to hold parameters for + initializing the key cache. + */ + + ulonglong param_buff_size; /* size the memory allocated for the cache */ + ulong param_block_size; /* size of the blocks in the key cache */ + ulong param_division_limit; /* min. percentage of warm blocks */ + ulong param_age_threshold; /* determines when hot block is downgraded */ + + /* Statistics variables. These are reset in reset_key_cache_counters(). */ + ulong global_blocks_changed; /* number of currently dirty blocks */ + ulonglong global_cache_w_requests;/* number of write requests (write hits) */ + ulonglong global_cache_write; /* number of writes from cache to files */ + ulonglong global_cache_r_requests;/* number of read requests (read hits) */ + ulonglong global_cache_read; /* number of reads from files to cache */ + + int blocks; /* max number of blocks in the cache */ + my_bool in_init; /* Set to 1 in MySQL during init/resize */ +} KEY_CACHE; + +/* The default key cache */ +extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache; + +extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, + size_t use_mem, uint division_limit, + uint age_threshold); +extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, + size_t use_mem, uint division_limit, + uint age_threshold); +extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, + uint age_threshold); +extern uchar *key_cache_read(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length,int return_buffer); +extern int key_cache_insert(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length); +extern int key_cache_write(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length, int force_write, + void *post_write_arg); +extern int flush_key_blocks(KEY_CACHE *keycache, + int file, enum flush_type type); +extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup); + +/* Functions to handle multiple key caches */ +extern my_bool multi_keycache_init(void); +extern void multi_keycache_free(void); +extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length, + KEY_CACHE *def); +extern my_bool multi_key_cache_set(const uchar *key, uint length, + KEY_CACHE *key_cache); +extern void multi_key_cache_change(KEY_CACHE *old_data, + KEY_CACHE *new_data); +extern int reset_key_cache_counters(const char *name, + KEY_CACHE *key_cache); +C_MODE_END +#endif /* _keycache_h */ diff --git a/externals/mysql/lf.h b/externals/mysql/lf.h new file mode 100644 index 00000000000..83358aa8e0d --- /dev/null +++ b/externals/mysql/lf.h @@ -0,0 +1,260 @@ +/* Copyright (C) 2007-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _lf_h +#define _lf_h + +#include + +/* + Helpers to define both func() and _func(), where + func() is a _func() protected by my_atomic_rwlock_wrlock() +*/ + +#define lock_wrap(f, t, proto_args, args, lock) \ +t _ ## f proto_args; \ +static inline t f proto_args \ +{ \ + t ret; \ + my_atomic_rwlock_wrlock(lock); \ + ret= _ ## f args; \ + my_atomic_rwlock_wrunlock(lock); \ + return ret; \ +} + +#define lock_wrap_void(f, proto_args, args, lock) \ +void _ ## f proto_args; \ +static inline void f proto_args \ +{ \ + my_atomic_rwlock_wrlock(lock); \ + _ ## f args; \ + my_atomic_rwlock_wrunlock(lock); \ +} + +#define nolock_wrap(f, t, proto_args, args) \ +t _ ## f proto_args; \ +static inline t f proto_args \ +{ \ + return _ ## f args; \ +} + +#define nolock_wrap_void(f, proto_args, args) \ +void _ ## f proto_args; \ +static inline void f proto_args \ +{ \ + _ ## f args; \ +} + +/* + wait-free dynamic array, see lf_dynarray.c + + 4 levels of 256 elements each mean 4311810304 elements in an array - it + should be enough for a while +*/ +#define LF_DYNARRAY_LEVEL_LENGTH 256 +#define LF_DYNARRAY_LEVELS 4 + +typedef struct { + void * volatile level[LF_DYNARRAY_LEVELS]; + uint size_of_element; + my_atomic_rwlock_t lock; +} LF_DYNARRAY; + +typedef int (*lf_dynarray_func)(void *, void *); + +void lf_dynarray_init(LF_DYNARRAY *array, uint element_size); +void lf_dynarray_destroy(LF_DYNARRAY *array); + +nolock_wrap(lf_dynarray_value, void *, + (LF_DYNARRAY *array, uint idx), + (array, idx)) +lock_wrap(lf_dynarray_lvalue, void *, + (LF_DYNARRAY *array, uint idx), + (array, idx), + &array->lock) +nolock_wrap(lf_dynarray_iterate, int, + (LF_DYNARRAY *array, lf_dynarray_func func, void *arg), + (array, func, arg)) + +/* + pin manager for memory allocator, lf_alloc-pin.c +*/ + +#define LF_PINBOX_PINS 4 +#define LF_PURGATORY_SIZE 10 + +typedef void lf_pinbox_free_func(void *, void *, void*); + +typedef struct { + LF_DYNARRAY pinarray; + lf_pinbox_free_func *free_func; + void *free_func_arg; + uint free_ptr_offset; + uint32 volatile pinstack_top_ver; /* this is a versioned pointer */ + uint32 volatile pins_in_array; /* number of elements in array */ +} LF_PINBOX; + +typedef struct { + void * volatile pin[LF_PINBOX_PINS]; + LF_PINBOX *pinbox; + void **stack_ends_here; + void *purgatory; + uint32 purgatory_count; + uint32 volatile link; +/* we want sizeof(LF_PINS) to be 64 to avoid false sharing */ +#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+3) != 64 + char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+3)]; +#endif +} LF_PINS; + +/* + shortcut macros to do an atomic_wrlock on a structure that uses pins + (e.g. lf_hash). +*/ +#define lf_rwlock_by_pins(PINS) \ + my_atomic_rwlock_wrlock(&(PINS)->pinbox->pinarray.lock) +#define lf_rwunlock_by_pins(PINS) \ + my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinarray.lock) + +/* + compile-time assert, to require "no less than N" pins + it's enough if it'll fail on at least one compiler, so + we'll enable it on GCC only, which supports zero-length arrays. +*/ +#if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG) +#define LF_REQUIRE_PINS(N) \ + static const char require_pins[LF_PINBOX_PINS-N] \ + __attribute__ ((unused)); \ + static const int LF_NUM_PINS_IN_THIS_FILE= N; +#define _lf_pin(PINS, PIN, ADDR) \ + ( \ + assert(PIN < LF_NUM_PINS_IN_THIS_FILE), \ + my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)) \ + ) +#else +#define LF_REQUIRE_PINS(N) +#define _lf_pin(PINS, PIN, ADDR) my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)) +#endif + +#define _lf_unpin(PINS, PIN) _lf_pin(PINS, PIN, NULL) +#define lf_pin(PINS, PIN, ADDR) \ + do { \ + lf_rwlock_by_pins(PINS); \ + _lf_pin(PINS, PIN, ADDR); \ + lf_rwunlock_by_pins(PINS); \ + } while (0) +#define lf_unpin(PINS, PIN) lf_pin(PINS, PIN, NULL) +#define _lf_assert_pin(PINS, PIN) assert((PINS)->pin[PIN] != 0) +#define _lf_assert_unpin(PINS, PIN) assert((PINS)->pin[PIN] == 0) + +void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset, + lf_pinbox_free_func *free_func, void * free_func_arg); +void lf_pinbox_destroy(LF_PINBOX *pinbox); + +lock_wrap(lf_pinbox_get_pins, LF_PINS *, + (LF_PINBOX *pinbox), + (pinbox), + &pinbox->pinarray.lock) +lock_wrap_void(lf_pinbox_put_pins, + (LF_PINS *pins), + (pins), + &pins->pinbox->pinarray.lock) +lock_wrap_void(lf_pinbox_free, + (LF_PINS *pins, void *addr), + (pins, addr), + &pins->pinbox->pinarray.lock) + +/* + memory allocator, lf_alloc-pin.c +*/ + +typedef struct st_lf_allocator { + LF_PINBOX pinbox; + uchar * volatile top; + uint element_size; + uint32 volatile mallocs; + void (*constructor)(uchar *); /* called, when an object is malloc()'ed */ + void (*destructor)(uchar *); /* called, when an object is free()'d */ +} LF_ALLOCATOR; + +void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset); +void lf_alloc_destroy(LF_ALLOCATOR *allocator); +uint lf_alloc_pool_count(LF_ALLOCATOR *allocator); +/* + shortcut macros to access underlying pinbox functions from an LF_ALLOCATOR + see _lf_pinbox_get_pins() and _lf_pinbox_put_pins() +*/ +#define _lf_alloc_free(PINS, PTR) _lf_pinbox_free((PINS), (PTR)) +#define lf_alloc_free(PINS, PTR) lf_pinbox_free((PINS), (PTR)) +#define _lf_alloc_get_pins(A) _lf_pinbox_get_pins(&(A)->pinbox) +#define lf_alloc_get_pins(A) lf_pinbox_get_pins(&(A)->pinbox) +#define _lf_alloc_put_pins(PINS) _lf_pinbox_put_pins(PINS) +#define lf_alloc_put_pins(PINS) lf_pinbox_put_pins(PINS) +#define lf_alloc_direct_free(ALLOC, ADDR) my_free((uchar*)(ADDR), MYF(0)) + +lock_wrap(lf_alloc_new, void *, + (LF_PINS *pins), + (pins), + &pins->pinbox->pinarray.lock) + +/* + extendible hash, lf_hash.c +*/ +#include + +#define LF_HASH_UNIQUE 1 + +/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */ +extern const int LF_HASH_OVERHEAD; + +typedef struct { + LF_DYNARRAY array; /* hash itself */ + LF_ALLOCATOR alloc; /* allocator for elements */ + my_hash_get_key get_key; /* see HASH */ + CHARSET_INFO *charset; /* see HASH */ + uint key_offset, key_length; /* see HASH */ + uint element_size; /* size of memcpy'ed area on insert */ + uint flags; /* LF_HASH_UNIQUE, etc */ + int32 volatile size; /* size of array */ + int32 volatile count; /* number of elements in the hash */ +} LF_HASH; + +void lf_hash_init(LF_HASH *hash, uint element_size, uint flags, + uint key_offset, uint key_length, my_hash_get_key get_key, + CHARSET_INFO *charset); +void lf_hash_destroy(LF_HASH *hash); +int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data); +void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen); +int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen); +/* + shortcut macros to access underlying pinbox functions from an LF_HASH + see _lf_pinbox_get_pins() and _lf_pinbox_put_pins() +*/ +#define _lf_hash_get_pins(HASH) _lf_alloc_get_pins(&(HASH)->alloc) +#define lf_hash_get_pins(HASH) lf_alloc_get_pins(&(HASH)->alloc) +#define _lf_hash_put_pins(PINS) _lf_pinbox_put_pins(PINS) +#define lf_hash_put_pins(PINS) lf_pinbox_put_pins(PINS) +#define lf_hash_search_unpin(PINS) lf_unpin((PINS), 2) +/* + cleanup +*/ + +#undef lock_wrap_void +#undef lock_wrap +#undef nolock_wrap_void +#undef nolock_wrap + +#endif + diff --git a/externals/mysql/libmysql/client.c b/externals/mysql/libmysql/client.c new file mode 100644 index 00000000000..bf4cf36339b --- /dev/null +++ b/externals/mysql/libmysql/client.c @@ -0,0 +1,3268 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This file is included by both libmysql.c (the MySQL client C API) + and the mysqld server to connect to another MYSQL server. + + The differences for the two cases are: + + - Things that only works for the client: + - Trying to automaticly determinate user name if not supplied to + mysql_real_connect() + - Support for reading local file with LOAD DATA LOCAL + - SHARED memory handling + - Protection against sigpipe + - Prepared statements + + - Things that only works for the server + - Alarm handling on connect + + In all other cases, the code should be idential for the client and + server. +*/ + +#include + +#include "mysql.h" + +#ifndef __WIN__ +#include +#endif + +/* Remove client convenience wrappers */ +#undef max_allowed_packet +#undef net_buffer_length + +#ifdef EMBEDDED_LIBRARY + +#undef MYSQL_SERVER + +#ifndef MYSQL_CLIENT +#define MYSQL_CLIENT +#endif + +#define CLI_MYSQL_REAL_CONNECT STDCALL cli_mysql_real_connect + +#undef net_flush +my_bool net_flush(NET *net); + +#else /*EMBEDDED_LIBRARY*/ +#define CLI_MYSQL_REAL_CONNECT STDCALL mysql_real_connect +#endif /*EMBEDDED_LIBRARY*/ +#include +#include +#include +#include +#include "mysql_version.h" +#include "mysqld_error.h" +#include "errmsg.h" +#include +#if defined(THREAD) && !defined(__WIN__) +#include /* because of signal() */ +#endif /* defined(THREAD) && !defined(__WIN__) */ + +#include +#include +#include +#ifdef HAVE_PWD_H +#include +#endif +#if !defined(MSDOS) && !defined(__WIN__) +#include +#include +#include +#include +#ifdef HAVE_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#endif /*!defined(MSDOS) && !defined(__WIN__) */ +#ifdef HAVE_SYS_UN_H +# include +#endif + +#if defined(MSDOS) || defined(__WIN__) +#define perror(A) +#else +#include +#define SOCKET_ERROR -1 +#endif + +#ifdef __WIN__ +#define CONNECT_TIMEOUT 20 +#else +#define CONNECT_TIMEOUT 0 +#endif + +#include "client_settings.h" +#include + +uint mysql_port=0; +char *mysql_unix_port= 0; +const char *unknown_sqlstate= "HY000"; +const char *not_error_sqlstate= "00000"; +const char *cant_connect_sqlstate= "08001"; +#ifdef HAVE_SMEM +char *shared_memory_base_name= 0; +const char *def_shared_memory_base_name= default_shared_memory_base_name; +#endif + +static void mysql_close_free_options(MYSQL *mysql); +static void mysql_close_free(MYSQL *mysql); + +#if !(defined(__WIN__) || defined(__NETWARE__)) +static int wait_for_data(my_socket fd, uint timeout); +#endif + +CHARSET_INFO *default_client_charset_info = &my_charset_latin1; + +/* Server error code and message */ +unsigned int mysql_server_last_errno; +char mysql_server_last_error[MYSQL_ERRMSG_SIZE]; + +/**************************************************************************** + A modified version of connect(). my_connect() allows you to specify + a timeout value, in seconds, that we should wait until we + derermine we can't connect to a particular host. If timeout is 0, + my_connect() will behave exactly like connect(). + + Base version coded by Steve Bernacki, Jr. +*****************************************************************************/ + +int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, + uint timeout) +{ +#if defined(__WIN__) || defined(__NETWARE__) + return connect(fd, (struct sockaddr*) name, namelen); +#else + int flags, res, s_err; + + /* + If they passed us a timeout of zero, we should behave + exactly like the normal connect() call does. + */ + + if (timeout == 0) + return connect(fd, (struct sockaddr*) name, namelen); + + flags = fcntl(fd, F_GETFL, 0); /* Set socket to not block */ +#ifdef O_NONBLOCK + fcntl(fd, F_SETFL, flags | O_NONBLOCK); /* and save the flags.. */ +#endif + + res= connect(fd, (struct sockaddr*) name, namelen); + s_err= errno; /* Save the error... */ + fcntl(fd, F_SETFL, flags); + if ((res != 0) && (s_err != EINPROGRESS)) + { + errno= s_err; /* Restore it */ + return(-1); + } + if (res == 0) /* Connected quickly! */ + return(0); + return wait_for_data(fd, timeout); +#endif +} + + +/* + Wait up to timeout seconds for a connection to be established. + + We prefer to do this with poll() as there is no limitations with this. + If not, we will use select() +*/ + +#if !(defined(__WIN__) || defined(__NETWARE__)) + +static int wait_for_data(my_socket fd, uint timeout) +{ +#ifdef HAVE_POLL + struct pollfd ufds; + int res; + + ufds.fd= fd; + ufds.events= POLLIN | POLLPRI; + if (!(res= poll(&ufds, 1, (int) timeout*1000))) + { + errno= EINTR; + return -1; + } + if (res < 0 || !(ufds.revents & (POLLIN | POLLPRI))) + return -1; + return 0; +#else + socklen_t s_err_size = sizeof(uint); + fd_set sfds; + struct timeval tv; + time_t start_time, now_time; + int res, s_err; + + if (fd >= FD_SETSIZE) /* Check if wrong error */ + return 0; /* Can't use timeout */ + + /* + Our connection is "in progress." We can use the select() call to wait + up to a specified period of time for the connection to suceed. + If select() returns 0 (after waiting howevermany seconds), our socket + never became writable (host is probably unreachable.) Otherwise, if + select() returns 1, then one of two conditions exist: + + 1. An error occured. We use getsockopt() to check for this. + 2. The connection was set up sucessfully: getsockopt() will + return 0 as an error. + + Thanks goes to Andrew Gierth + who posted this method of timing out a connect() in + comp.unix.programmer on August 15th, 1997. + */ + + FD_ZERO(&sfds); + FD_SET(fd, &sfds); + /* + select could be interrupted by a signal, and if it is, + the timeout should be adjusted and the select restarted + to work around OSes that don't restart select and + implementations of select that don't adjust tv upon + failure to reflect the time remaining + */ + start_time= my_time(0); + for (;;) + { + tv.tv_sec = (long) timeout; + tv.tv_usec = 0; +#if defined(HPUX10) && defined(THREAD) + if ((res = select(fd+1, NULL, (int*) &sfds, NULL, &tv)) > 0) + break; +#else + if ((res = select(fd+1, NULL, &sfds, NULL, &tv)) > 0) + break; +#endif + if (res == 0) /* timeout */ + return -1; + now_time= my_time(0); + timeout-= (uint) (now_time - start_time); + if (errno != EINTR || (int) timeout <= 0) + return -1; + } + + /* + select() returned something more interesting than zero, let's + see if we have any errors. If the next two statements pass, + we've got an open socket! + */ + + s_err=0; + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*) &s_err, &s_err_size) != 0) + return(-1); + + if (s_err) + { /* getsockopt could succeed */ + errno = s_err; + return(-1); /* but return an error... */ + } + return (0); /* ok */ +#endif /* HAVE_POLL */ +} +#endif /* defined(__WIN__) || defined(__NETWARE__) */ + +/** + Set the internal error message to mysql handler + + @param mysql connection handle (client side) + @param errcode CR_ error code, passed to ER macro to get + error text + @parma sqlstate SQL standard sqlstate +*/ + +void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate) +{ + NET *net; + DBUG_ENTER("set_mysql_error"); + DBUG_PRINT("enter", ("error :%d '%s'", errcode, ER(errcode))); + DBUG_ASSERT(mysql != 0); + + if (mysql) + { + net= &mysql->net; + net->last_errno= errcode; + strmov(net->last_error, ER(errcode)); + strmov(net->sqlstate, sqlstate); + } + else + { + mysql_server_last_errno= errcode; + strmov(mysql_server_last_error, ER(errcode)); + } + DBUG_VOID_RETURN; +} + +/** + Clear possible error state of struct NET + + @param net clear the state of the argument +*/ + +void net_clear_error(NET *net) +{ + net->last_errno= 0; + net->last_error[0]= '\0'; + strmov(net->sqlstate, not_error_sqlstate); +} + +/** + Set an error message on the client. + + @param mysql connection handle + @param errcode CR_* errcode, for client errors + @param sqlstate SQL standard sql state, unknown_sqlstate for the + majority of client errors. + @param format error message template, in sprintf format + @param ... variable number of arguments +*/ + +static void set_mysql_extended_error(MYSQL *mysql, int errcode, + const char *sqlstate, + const char *format, ...) +{ + NET *net; + va_list args; + DBUG_ENTER("set_mysql_extended_error"); + DBUG_PRINT("enter", ("error :%d '%s'", errcode, format)); + DBUG_ASSERT(mysql != 0); + + net= &mysql->net; + net->last_errno= errcode; + va_start(args, format); + my_vsnprintf(net->last_error, sizeof(net->last_error)-1, + format, args); + va_end(args); + strmov(net->sqlstate, sqlstate); + + DBUG_VOID_RETURN; +} + + + +/* + Create a named pipe connection +*/ + +#ifdef __WIN__ + +HANDLE create_named_pipe(MYSQL *mysql, uint connect_timeout, char **arg_host, + char **arg_unix_socket) +{ + HANDLE hPipe=INVALID_HANDLE_VALUE; + char pipe_name[1024]; + DWORD dwMode; + int i; + my_bool testing_named_pipes=0; + char *host= *arg_host, *unix_socket= *arg_unix_socket; + + if ( ! unix_socket || (unix_socket)[0] == 0x00) + unix_socket = mysql_unix_port; + if (!host || !strcmp(host,LOCAL_HOST)) + host=LOCAL_HOST_NAMEDPIPE; + + + pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */ + strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\", + unix_socket, NullS); + DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket)); + + for (i=0 ; i < 100 ; i++) /* Don't retry forever */ + { + if ((hPipe = CreateFile(pipe_name, + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL )) != INVALID_HANDLE_VALUE) + break; + if (GetLastError() != ERROR_PIPE_BUSY) + { + set_mysql_extended_error(mysql, CR_NAMEDPIPEOPEN_ERROR, + unknown_sqlstate, ER(CR_NAMEDPIPEOPEN_ERROR), + host, unix_socket, (ulong) GetLastError()); + return INVALID_HANDLE_VALUE; + } + /* wait for for an other instance */ + if (! WaitNamedPipe(pipe_name, connect_timeout*1000) ) + { + set_mysql_extended_error(mysql, CR_NAMEDPIPEWAIT_ERROR, unknown_sqlstate, + ER(CR_NAMEDPIPEWAIT_ERROR), + host, unix_socket, (ulong) GetLastError()); + return INVALID_HANDLE_VALUE; + } + } + if (hPipe == INVALID_HANDLE_VALUE) + { + set_mysql_extended_error(mysql, CR_NAMEDPIPEOPEN_ERROR, unknown_sqlstate, + ER(CR_NAMEDPIPEOPEN_ERROR), host, unix_socket, + (ulong) GetLastError()); + return INVALID_HANDLE_VALUE; + } + dwMode = PIPE_READMODE_BYTE | PIPE_WAIT; + if ( !SetNamedPipeHandleState(hPipe, &dwMode, NULL, NULL) ) + { + CloseHandle( hPipe ); + set_mysql_extended_error(mysql, CR_NAMEDPIPESETSTATE_ERROR, + unknown_sqlstate, ER(CR_NAMEDPIPESETSTATE_ERROR), + host, unix_socket, (ulong) GetLastError()); + return INVALID_HANDLE_VALUE; + } + *arg_host=host ; *arg_unix_socket=unix_socket; /* connect arg */ + return (hPipe); +} +#endif + + +/* + Create new shared memory connection, return handler of connection + + SYNOPSIS + create_shared_memory() + mysql Pointer of mysql structure + net Pointer of net structure + connect_timeout Timeout of connection +*/ + +#ifdef HAVE_SMEM +HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) +{ + ulong smem_buffer_length = shared_memory_buffer_length + 4; + /* + event_connect_request is event object for start connection actions + event_connect_answer is event object for confirm, that server put data + handle_connect_file_map is file-mapping object, use for create shared + memory + handle_connect_map is pointer on shared memory + handle_map is pointer on shared memory for client + event_server_wrote, + event_server_read, + event_client_wrote, + event_client_read are events for transfer data between server and client + handle_file_map is file-mapping object, use for create shared memory + */ + HANDLE event_connect_request = NULL; + HANDLE event_connect_answer = NULL; + HANDLE handle_connect_file_map = NULL; + char *handle_connect_map = NULL; + + char *handle_map = NULL; + HANDLE event_server_wrote = NULL; + HANDLE event_server_read = NULL; + HANDLE event_client_wrote = NULL; + HANDLE event_client_read = NULL; + HANDLE event_conn_closed = NULL; + HANDLE handle_file_map = NULL; + ulong connect_number; + char connect_number_char[22], *p; + char *tmp= NULL; + char *suffix_pos; + DWORD error_allow = 0; + DWORD error_code = 0; + DWORD event_access_rights= SYNCHRONIZE | EVENT_MODIFY_STATE; + char *shared_memory_base_name = mysql->options.shared_memory_base_name; + + /* + get enough space base-name + '_' + longest suffix we might ever send + */ + if (!(tmp= (char *)my_malloc(strlen(shared_memory_base_name) + 32L, MYF(MY_FAE)))) + goto err; + + /* + The name of event and file-mapping events create agree next rule: + shared_memory_base_name+unique_part + Where: + shared_memory_base_name is unique value for each server + unique_part is uniquel value for each object (events and file-mapping) + */ + suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", NullS); + strmov(suffix_pos, "CONNECT_REQUEST"); + if (!(event_connect_request= OpenEvent(event_access_rights, FALSE, tmp))) + { + error_allow = CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR; + goto err; + } + strmov(suffix_pos, "CONNECT_ANSWER"); + if (!(event_connect_answer= OpenEvent(event_access_rights,FALSE,tmp))) + { + error_allow = CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR; + goto err; + } + strmov(suffix_pos, "CONNECT_DATA"); + if (!(handle_connect_file_map= OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp))) + { + error_allow = CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR; + goto err; + } + if (!(handle_connect_map= MapViewOfFile(handle_connect_file_map, + FILE_MAP_WRITE,0,0,sizeof(DWORD)))) + { + error_allow = CR_SHARED_MEMORY_CONNECT_MAP_ERROR; + goto err; + } + + /* Send to server request of connection */ + if (!SetEvent(event_connect_request)) + { + error_allow = CR_SHARED_MEMORY_CONNECT_SET_ERROR; + goto err; + } + + /* Wait of answer from server */ + if (WaitForSingleObject(event_connect_answer,connect_timeout*1000) != + WAIT_OBJECT_0) + { + error_allow = CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR; + goto err; + } + + /* Get number of connection */ + connect_number = uint4korr(handle_connect_map);/*WAX2*/ + p= int10_to_str(connect_number, connect_number_char, 10); + + /* + The name of event and file-mapping events create agree next rule: + shared_memory_base_name+unique_part+number_of_connection + + Where: + shared_memory_base_name is uniquel value for each server + unique_part is uniquel value for each object (events and file-mapping) + number_of_connection is number of connection between server and client + */ + suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", connect_number_char, + "_", NullS); + strmov(suffix_pos, "DATA"); + if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_FILE_MAP_ERROR; + goto err2; + } + if ((handle_map = MapViewOfFile(handle_file_map,FILE_MAP_WRITE,0,0, + smem_buffer_length)) == NULL) + { + error_allow = CR_SHARED_MEMORY_MAP_ERROR; + goto err2; + } + + strmov(suffix_pos, "SERVER_WROTE"); + if ((event_server_wrote = OpenEvent(event_access_rights,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } + + strmov(suffix_pos, "SERVER_READ"); + if ((event_server_read = OpenEvent(event_access_rights,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } + + strmov(suffix_pos, "CLIENT_WROTE"); + if ((event_client_wrote = OpenEvent(event_access_rights,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } + + strmov(suffix_pos, "CLIENT_READ"); + if ((event_client_read = OpenEvent(event_access_rights,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } + + strmov(suffix_pos, "CONNECTION_CLOSED"); + if ((event_conn_closed = OpenEvent(event_access_rights,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } + /* + Set event that server should send data + */ + SetEvent(event_server_read); + +err2: + if (error_allow == 0) + { + net->vio= vio_new_win32shared_memory(net,handle_file_map,handle_map, + event_server_wrote, + event_server_read,event_client_wrote, + event_client_read,event_conn_closed); + } + else + { + error_code = GetLastError(); + if (event_server_read) + CloseHandle(event_server_read); + if (event_server_wrote) + CloseHandle(event_server_wrote); + if (event_client_read) + CloseHandle(event_client_read); + if (event_client_wrote) + CloseHandle(event_client_wrote); + if (event_conn_closed) + CloseHandle(event_conn_closed); + if (handle_map) + UnmapViewOfFile(handle_map); + if (handle_file_map) + CloseHandle(handle_file_map); + } +err: + if (tmp) + my_free(tmp, MYF(0)); + if (error_allow) + error_code = GetLastError(); + if (event_connect_request) + CloseHandle(event_connect_request); + if (event_connect_answer) + CloseHandle(event_connect_answer); + if (handle_connect_map) + UnmapViewOfFile(handle_connect_map); + if (handle_connect_file_map) + CloseHandle(handle_connect_file_map); + if (error_allow) + { + if (error_allow == CR_SHARED_MEMORY_EVENT_ERROR) + set_mysql_extended_error(mysql, error_allow, unknown_sqlstate, + ER(error_allow), suffix_pos, error_code); + else + set_mysql_extended_error(mysql, error_allow, unknown_sqlstate, + ER(error_allow), error_code); + return(INVALID_HANDLE_VALUE); + } + return(handle_map); +} +#endif + +/** + Read a packet from server. Give error message if socket was down + or packet is an error message + + @retval packet_error An error occurred during reading. + Error message is set. + @retval +*/ + +ulong +cli_safe_read(MYSQL *mysql) +{ + NET *net= &mysql->net; + ulong len=0; + init_sigpipe_variables + + /* Don't give sigpipe errors if the client doesn't want them */ + set_sigpipe(mysql); + if (net->vio != 0) + len=my_net_read(net); + reset_sigpipe(mysql); + + if (len == packet_error || len == 0) + { + DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %lu", + vio_description(net->vio),len)); +#ifdef MYSQL_SERVER + if (net->vio && vio_was_interrupted(net->vio)) + return (packet_error); +#endif /*MYSQL_SERVER*/ + end_server(mysql); + set_mysql_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ? + CR_NET_PACKET_TOO_LARGE: CR_SERVER_LOST, unknown_sqlstate); + return (packet_error); + } + if (net->read_pos[0] == 255) + { + if (len > 3) + { + char *pos=(char*) net->read_pos+1; + net->last_errno=uint2korr(pos); + pos+=2; + len-=2; + if (protocol_41(mysql) && pos[0] == '#') + { + strmake(net->sqlstate, pos+1, SQLSTATE_LENGTH); + pos+= SQLSTATE_LENGTH+1; + } + else + { + /* + The SQL state hasn't been received -- it should be reset to HY000 + (unknown error sql state). + */ + + strmov(net->sqlstate, unknown_sqlstate); + } + + (void) strmake(net->last_error,(char*) pos, + min((uint) len,(uint) sizeof(net->last_error)-1)); + } + else + set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate); + /* + Cover a protocol design error: error packet does not + contain the server status. Therefore, the client has no way + to find out whether there are more result sets of + a multiple-result-set statement pending. Luckily, in 5.0 an + error always aborts execution of a statement, wherever it is + a multi-statement or a stored procedure, so it should be + safe to unconditionally turn off the flag here. + */ + mysql->server_status&= ~SERVER_MORE_RESULTS_EXISTS; + + DBUG_PRINT("error",("Got error: %d/%s (%s)", + net->last_errno, + net->sqlstate, + net->last_error)); + return(packet_error); + } + return len; +} + +void free_rows(MYSQL_DATA *cur) +{ + if (cur) + { + free_root(&cur->alloc,MYF(0)); + my_free((uchar*) cur,MYF(0)); + } +} + +my_bool +cli_advanced_command(MYSQL *mysql, enum enum_server_command command, + const uchar *header, ulong header_length, + const uchar *arg, ulong arg_length, my_bool skip_check, + MYSQL_STMT *stmt) +{ + NET *net= &mysql->net; + my_bool result= 1; + init_sigpipe_variables + my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE; + DBUG_ENTER("cli_advanced_command"); + + /* Don't give sigpipe errors if the client doesn't want them */ + set_sigpipe(mysql); + + if (mysql->net.vio == 0) + { /* Do reconnect if possible */ + if (mysql_reconnect(mysql) || stmt_skip) + DBUG_RETURN(1); + } + if (mysql->status != MYSQL_STATUS_READY || + mysql->server_status & SERVER_MORE_RESULTS_EXISTS) + { + DBUG_PRINT("error",("state: %d", mysql->status)); + set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + DBUG_RETURN(1); + } + + net_clear_error(net); + mysql->info=0; + mysql->affected_rows= ~(my_ulonglong) 0; + /* + We don't want to clear the protocol buffer on COM_QUIT, because if + the previous command was a shutdown command, we may have the + response for the COM_QUIT already in the communication buffer + */ + net_clear(&mysql->net, (command != COM_QUIT)); + + if (net_write_command(net,(uchar) command, header, header_length, + arg, arg_length)) + { + DBUG_PRINT("error",("Can't send command to server. Error: %d", + socket_errno)); + if (net->last_errno == ER_NET_PACKET_TOO_LARGE) + { + set_mysql_error(mysql, CR_NET_PACKET_TOO_LARGE, unknown_sqlstate); + goto end; + } + end_server(mysql); + if (mysql_reconnect(mysql) || stmt_skip) + goto end; + if (net_write_command(net,(uchar) command, header, header_length, + arg, arg_length)) + { + set_mysql_error(mysql, CR_SERVER_GONE_ERROR, unknown_sqlstate); + goto end; + } + } + result=0; + if (!skip_check) + result= ((mysql->packet_length=cli_safe_read(mysql)) == packet_error ? + 1 : 0); +end: + reset_sigpipe(mysql); + DBUG_PRINT("exit",("result: %d", result)); + DBUG_RETURN(result); +} + +void free_old_query(MYSQL *mysql) +{ + DBUG_ENTER("free_old_query"); + if (mysql->fields) + free_root(&mysql->field_alloc,MYF(0)); + init_alloc_root(&mysql->field_alloc,8192,0); /* Assume rowlength < 8192 */ + mysql->fields= 0; + mysql->field_count= 0; /* For API */ + mysql->warning_count= 0; + mysql->info= 0; + DBUG_VOID_RETURN; +} + + +/** + Finish reading of a partial result set from the server. + Get the EOF packet, and update mysql->status + and mysql->warning_count. + + @return TRUE if a communication or protocol error, an error + is set in this case, FALSE otherwise. +*/ + +my_bool flush_one_result(MYSQL *mysql) +{ + ulong packet_length; + + DBUG_ASSERT(mysql->status != MYSQL_STATUS_READY); + + do + { + packet_length= cli_safe_read(mysql); + /* + There is an error reading from the connection, + or (sic!) there were no error and no + data in the stream, i.e. no more data from the server. + Since we know our position in the stream (somewhere in + the middle of a result set), this latter case is an error too + -- each result set must end with a EOF packet. + cli_safe_read() has set an error for us, just return. + */ + if (packet_length == packet_error) + return TRUE; + } + while (packet_length > 8 || mysql->net.read_pos[0] != 254); + + /* Analyze EOF packet of the result set. */ + + if (protocol_41(mysql)) + { + char *pos= (char*) mysql->net.read_pos + 1; + mysql->warning_count=uint2korr(pos); + pos+=2; + mysql->server_status=uint2korr(pos); + pos+=2; + } + return FALSE; +} + + +/** + Read a packet from network. If it's an OK packet, flush it. + + @return TRUE if error, FALSE otherwise. In case of + success, is_ok_packet is set to TRUE or FALSE, + based on what we got from network. +*/ + +my_bool opt_flush_ok_packet(MYSQL *mysql, my_bool *is_ok_packet) +{ + ulong packet_length= cli_safe_read(mysql); + + if (packet_length == packet_error) + return TRUE; + + /* cli_safe_read always reads a non-empty packet. */ + DBUG_ASSERT(packet_length); + + *is_ok_packet= mysql->net.read_pos[0] == 0; + if (*is_ok_packet) + { + uchar *pos= mysql->net.read_pos + 1; + + net_field_length_ll(&pos); /* affected rows */ + net_field_length_ll(&pos); /* insert id */ + + mysql->server_status=uint2korr(pos); + pos+=2; + + if (protocol_41(mysql)) + { + mysql->warning_count=uint2korr(pos); + pos+=2; + } + } + return FALSE; +} + + +/* + Flush result set sent from server +*/ + +static void cli_flush_use_result(MYSQL *mysql, my_bool flush_all_results) +{ + /* Clear the current execution status */ + DBUG_ENTER("cli_flush_use_result"); + DBUG_PRINT("warning",("Not all packets read, clearing them")); + + if (flush_one_result(mysql)) + DBUG_VOID_RETURN; /* An error occurred */ + + if (! flush_all_results) + DBUG_VOID_RETURN; + + while (mysql->server_status & SERVER_MORE_RESULTS_EXISTS) + { + my_bool is_ok_packet; + if (opt_flush_ok_packet(mysql, &is_ok_packet)) + DBUG_VOID_RETURN; /* An error occurred. */ + if (is_ok_packet) + { + /* + Indeed what we got from network was an OK packet, and we + know that OK is the last one in a multi-result-set, so + just return. + */ + DBUG_VOID_RETURN; + } + /* + It's a result set, not an OK packet. A result set contains + of two result set subsequences: field metadata, terminated + with EOF packet, and result set data, again terminated with + EOF packet. Read and flush them. + */ + if (flush_one_result(mysql) || flush_one_result(mysql)) + DBUG_VOID_RETURN; /* An error occurred. */ + } + + DBUG_VOID_RETURN; +} + + +#ifdef __WIN__ +static my_bool is_NT(void) +{ + char *os=getenv("OS"); + return (os && !strcmp(os, "Windows_NT")) ? 1 : 0; +} +#endif + + +#ifdef CHECK_LICENSE +/** + Check server side variable 'license'. + + If the variable does not exist or does not contain 'Commercial', + we're talking to non-commercial server from commercial client. + + @retval 0 success + @retval !0 network error or the server is not commercial. + Error code is saved in mysql->net.last_errno. +*/ + +static int check_license(MYSQL *mysql) +{ + MYSQL_ROW row; + MYSQL_RES *res; + NET *net= &mysql->net; + static const char query[]= "SELECT @@license"; + static const char required_license[]= STRINGIFY_ARG(LICENSE); + + if (mysql_real_query(mysql, query, sizeof(query)-1)) + { + if (net->last_errno == ER_UNKNOWN_SYSTEM_VARIABLE) + { + set_mysql_extended_error(mysql, CR_WRONG_LICENSE, unknown_sqlstate, + ER(CR_WRONG_LICENSE), required_license); + } + return 1; + } + if (!(res= mysql_use_result(mysql))) + return 1; + row= mysql_fetch_row(res); + /* + If no rows in result set, or column value is NULL (none of these + two is ever true for server variables now), or column value + mismatch, set wrong license error. + */ + if (!net->last_errno && + (!row || !row[0] || + strncmp(row[0], required_license, sizeof(required_license)))) + { + set_mysql_extended_error(mysql, CR_WRONG_LICENSE, unknown_sqlstate, + ER(CR_WRONG_LICENSE), required_license); + } + mysql_free_result(res); + return net->last_errno; +} +#endif /* CHECK_LICENSE */ + + +/************************************************************************** + Shut down connection +**************************************************************************/ + +void end_server(MYSQL *mysql) +{ + int save_errno= errno; + DBUG_ENTER("end_server"); + if (mysql->net.vio != 0) + { + init_sigpipe_variables + DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio))); + set_sigpipe(mysql); + vio_delete(mysql->net.vio); + reset_sigpipe(mysql); + mysql->net.vio= 0; /* Marker */ + } + net_end(&mysql->net); + free_old_query(mysql); + errno= save_errno; + DBUG_VOID_RETURN; +} + + +void STDCALL +mysql_free_result(MYSQL_RES *result) +{ + DBUG_ENTER("mysql_free_result"); + DBUG_PRINT("enter",("mysql_res: %p", result)); + if (result) + { + MYSQL *mysql= result->handle; + if (mysql) + { + if (mysql->unbuffered_fetch_owner == &result->unbuffered_fetch_cancelled) + mysql->unbuffered_fetch_owner= 0; + if (mysql->status == MYSQL_STATUS_USE_RESULT) + { + (*mysql->methods->flush_use_result)(mysql, FALSE); + mysql->status=MYSQL_STATUS_READY; + if (mysql->unbuffered_fetch_owner) + *mysql->unbuffered_fetch_owner= TRUE; + } + } + free_rows(result->data); + if (result->fields) + free_root(&result->field_alloc,MYF(0)); + if (result->row) + my_free((uchar*) result->row,MYF(0)); + my_free((uchar*) result,MYF(0)); + } + DBUG_VOID_RETURN; +} + +/**************************************************************************** + Get options from my.cnf +****************************************************************************/ + +static const char *default_options[]= +{ + "port","socket","compress","password","pipe", "timeout", "user", + "init-command", "host", "database", "debug", "return-found-rows", + "ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath", + "character-sets-dir", "default-character-set", "interactive-timeout", + "connect-timeout", "local-infile", "disable-local-infile", + "ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name", + "multi-results", "multi-statements", "multi-queries", "secure-auth", + "report-data-truncation", + NullS +}; + +static TYPELIB option_types={array_elements(default_options)-1, + "options",default_options, NULL}; + +const char *sql_protocol_names_lib[] = +{ "TCP", "SOCKET", "PIPE", "MEMORY", NullS }; +TYPELIB sql_protocol_typelib = {array_elements(sql_protocol_names_lib)-1,"", + sql_protocol_names_lib, NULL}; + +static int add_init_command(struct st_mysql_options *options, const char *cmd) +{ + char *tmp; + + if (!options->init_commands) + { + options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY), + MYF(MY_WME)); + init_dynamic_array(options->init_commands,sizeof(char*),5,5 CALLER_INFO); + } + + if (!(tmp= my_strdup(cmd,MYF(MY_WME))) || + insert_dynamic(options->init_commands, (uchar*)&tmp)) + { + my_free(tmp, MYF(MY_ALLOW_ZERO_PTR)); + return 1; + } + + return 0; +} + +void mysql_read_default_options(struct st_mysql_options *options, + const char *filename,const char *group) +{ + int argc; + char *argv_buff[1],**argv; + const char *groups[3]; + DBUG_ENTER("mysql_read_default_options"); + DBUG_PRINT("enter",("file: %s group: %s",filename,group ? group :"NULL")); + + argc=1; argv=argv_buff; argv_buff[0]= (char*) "client"; + groups[0]= (char*) "client"; groups[1]= (char*) group; groups[2]=0; + + my_load_defaults(filename, groups, &argc, &argv, NULL); + if (argc != 1) /* If some default option */ + { + char **option=argv; + while (*++option) + { + if (option[0] == args_separator) /* skip arguments separator */ + continue; + /* DBUG_PRINT("info",("option: %s",option[0])); */ + if (option[0][0] == '-' && option[0][1] == '-') + { + char *end=strcend(*option,'='); + char *opt_arg=0; + if (*end) + { + opt_arg=end+1; + *end=0; /* Remove '=' */ + } + /* Change all '_' in variable name to '-' */ + for (end= *option ; *(end= strcend(end,'_')) ; ) + *end= '-'; + switch (find_type(*option+2,&option_types,2)) { + case 1: /* port */ + if (opt_arg) + options->port=atoi(opt_arg); + break; + case 2: /* socket */ + if (opt_arg) + { + my_free(options->unix_socket,MYF(MY_ALLOW_ZERO_PTR)); + options->unix_socket=my_strdup(opt_arg,MYF(MY_WME)); + } + break; + case 3: /* compress */ + options->compress=1; + options->client_flag|= CLIENT_COMPRESS; + break; + case 4: /* password */ + if (opt_arg) + { + my_free(options->password,MYF(MY_ALLOW_ZERO_PTR)); + options->password=my_strdup(opt_arg,MYF(MY_WME)); + } + break; + case 5: + options->protocol = MYSQL_PROTOCOL_PIPE; + case 20: /* connect_timeout */ + case 6: /* timeout */ + if (opt_arg) + options->connect_timeout=atoi(opt_arg); + break; + case 7: /* user */ + if (opt_arg) + { + my_free(options->user,MYF(MY_ALLOW_ZERO_PTR)); + options->user=my_strdup(opt_arg,MYF(MY_WME)); + } + break; + case 8: /* init-command */ + add_init_command(options,opt_arg); + break; + case 9: /* host */ + if (opt_arg) + { + my_free(options->host,MYF(MY_ALLOW_ZERO_PTR)); + options->host=my_strdup(opt_arg,MYF(MY_WME)); + } + break; + case 10: /* database */ + if (opt_arg) + { + my_free(options->db,MYF(MY_ALLOW_ZERO_PTR)); + options->db=my_strdup(opt_arg,MYF(MY_WME)); + } + break; + case 11: /* debug */ +#ifdef MYSQL_CLIENT + mysql_debug(opt_arg ? opt_arg : "d:t:o,/tmp/client.trace"); + break; +#endif + case 12: /* return-found-rows */ + options->client_flag|=CLIENT_FOUND_ROWS; + break; +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + case 13: /* ssl_key */ + my_free(options->ssl_key, MYF(MY_ALLOW_ZERO_PTR)); + options->ssl_key = my_strdup(opt_arg, MYF(MY_WME)); + break; + case 14: /* ssl_cert */ + my_free(options->ssl_cert, MYF(MY_ALLOW_ZERO_PTR)); + options->ssl_cert = my_strdup(opt_arg, MYF(MY_WME)); + break; + case 15: /* ssl_ca */ + my_free(options->ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); + options->ssl_ca = my_strdup(opt_arg, MYF(MY_WME)); + break; + case 16: /* ssl_capath */ + my_free(options->ssl_capath, MYF(MY_ALLOW_ZERO_PTR)); + options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME)); + break; + case 23: /* ssl_cipher */ + my_free(options->ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME)); + break; +#else + case 13: /* Ignore SSL options */ + case 14: + case 15: + case 16: + case 23: + break; +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + case 17: /* charset-lib */ + my_free(options->charset_dir,MYF(MY_ALLOW_ZERO_PTR)); + options->charset_dir = my_strdup(opt_arg, MYF(MY_WME)); + break; + case 18: + my_free(options->charset_name,MYF(MY_ALLOW_ZERO_PTR)); + options->charset_name = my_strdup(opt_arg, MYF(MY_WME)); + break; + case 19: /* Interactive-timeout */ + options->client_flag|= CLIENT_INTERACTIVE; + break; + case 21: + if (!opt_arg || atoi(opt_arg) != 0) + options->client_flag|= CLIENT_LOCAL_FILES; + else + options->client_flag&= ~CLIENT_LOCAL_FILES; + break; + case 22: + options->client_flag&= ~CLIENT_LOCAL_FILES; + break; + case 24: /* max-allowed-packet */ + if (opt_arg) + options->max_allowed_packet= atoi(opt_arg); + break; + case 25: /* protocol */ + if ((options->protocol= find_type(opt_arg, + &sql_protocol_typelib,0)) <= 0) + { + fprintf(stderr, "Unknown option to protocol: %s\n", opt_arg); + exit(1); + } + break; + case 26: /* shared_memory_base_name */ +#ifdef HAVE_SMEM + if (options->shared_memory_base_name != def_shared_memory_base_name) + my_free(options->shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + options->shared_memory_base_name=my_strdup(opt_arg,MYF(MY_WME)); +#endif + break; + case 27: /* multi-results */ + options->client_flag|= CLIENT_MULTI_RESULTS; + break; + case 28: /* multi-statements */ + case 29: /* multi-queries */ + options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS; + break; + case 30: /* secure-auth */ + options->secure_auth= TRUE; + break; + case 31: /* report-data-truncation */ + options->report_data_truncation= opt_arg ? test(atoi(opt_arg)) : 1; + break; + default: + DBUG_PRINT("warning",("unknown option: %s",option[0])); + } + } + } + } + free_defaults(argv); + DBUG_VOID_RETURN; +} + + +/************************************************************************** + Get column lengths of the current row + If one uses mysql_use_result, res->lengths contains the length information, + else the lengths are calculated from the offset between pointers. +**************************************************************************/ + +static void cli_fetch_lengths(ulong *to, MYSQL_ROW column, + unsigned int field_count) +{ + ulong *prev_length; + char *start=0; + MYSQL_ROW end; + + prev_length=0; /* Keep gcc happy */ + for (end=column + field_count + 1 ; column != end ; column++, to++) + { + if (!*column) + { + *to= 0; /* Null */ + continue; + } + if (start) /* Found end of prev string */ + *prev_length= (ulong) (*column-start-1); + start= *column; + prev_length= to; + } +} + +/*************************************************************************** + Change field rows to field structs +***************************************************************************/ + +MYSQL_FIELD * +unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, + my_bool default_value, uint server_capabilities) +{ + MYSQL_ROWS *row; + MYSQL_FIELD *field,*result; + ulong lengths[9]; /* Max of fields */ + DBUG_ENTER("unpack_fields"); + + field= result= (MYSQL_FIELD*) alloc_root(alloc, + (uint) sizeof(*field)*fields); + if (!result) + { + free_rows(data); /* Free old data */ + DBUG_RETURN(0); + } + bzero((char*) field, (uint) sizeof(MYSQL_FIELD)*fields); + if (server_capabilities & CLIENT_PROTOCOL_41) + { + /* server is 4.1, and returns the new field result format */ + for (row=data->data; row ; row = row->next,field++) + { + uchar *pos; + /* fields count may be wrong */ + DBUG_ASSERT((uint) (field - result) < fields); + cli_fetch_lengths(&lengths[0], row->data, default_value ? 8 : 7); + field->catalog= strmake_root(alloc,(char*) row->data[0], lengths[0]); + field->db= strmake_root(alloc,(char*) row->data[1], lengths[1]); + field->table= strmake_root(alloc,(char*) row->data[2], lengths[2]); + field->org_table= strmake_root(alloc,(char*) row->data[3], lengths[3]); + field->name= strmake_root(alloc,(char*) row->data[4], lengths[4]); + field->org_name= strmake_root(alloc,(char*) row->data[5], lengths[5]); + + field->catalog_length= lengths[0]; + field->db_length= lengths[1]; + field->table_length= lengths[2]; + field->org_table_length= lengths[3]; + field->name_length= lengths[4]; + field->org_name_length= lengths[5]; + + /* Unpack fixed length parts */ + pos= (uchar*) row->data[6]; + field->charsetnr= uint2korr(pos); + field->length= (uint) uint4korr(pos+2); + field->type= (enum enum_field_types) pos[6]; + field->flags= uint2korr(pos+7); + field->decimals= (uint) pos[9]; + + if (INTERNAL_NUM_FIELD(field)) + field->flags|= NUM_FLAG; + if (default_value && row->data[7]) + { + field->def=strmake_root(alloc,(char*) row->data[7], lengths[7]); + field->def_length= lengths[7]; + } + else + field->def=0; + field->max_length= 0; + } + } +#ifndef DELETE_SUPPORT_OF_4_0_PROTOCOL + else + { + /* old protocol, for backward compatibility */ + for (row=data->data; row ; row = row->next,field++) + { + cli_fetch_lengths(&lengths[0], row->data, default_value ? 6 : 5); + field->org_table= field->table= strdup_root(alloc,(char*) row->data[0]); + field->name= strdup_root(alloc,(char*) row->data[1]); + field->length= (uint) uint3korr(row->data[2]); + field->type= (enum enum_field_types) (uchar) row->data[3][0]; + + field->catalog=(char*) ""; + field->db= (char*) ""; + field->catalog_length= 0; + field->db_length= 0; + field->org_table_length= field->table_length= lengths[0]; + field->name_length= lengths[1]; + + if (server_capabilities & CLIENT_LONG_FLAG) + { + field->flags= uint2korr(row->data[4]); + field->decimals=(uint) (uchar) row->data[4][2]; + } + else + { + field->flags= (uint) (uchar) row->data[4][0]; + field->decimals=(uint) (uchar) row->data[4][1]; + } + if (INTERNAL_NUM_FIELD(field)) + field->flags|= NUM_FLAG; + if (default_value && row->data[5]) + { + field->def=strdup_root(alloc,(char*) row->data[5]); + field->def_length= lengths[5]; + } + else + field->def=0; + field->max_length= 0; + } + } +#endif /* DELETE_SUPPORT_OF_4_0_PROTOCOL */ + free_rows(data); /* Free old data */ + DBUG_RETURN(result); +} + +/* Read all rows (fields or data) from server */ + +MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, + unsigned int fields) +{ + uint field; + ulong pkt_len; + ulong len; + uchar *cp; + char *to, *end_to; + MYSQL_DATA *result; + MYSQL_ROWS **prev_ptr,*cur; + NET *net = &mysql->net; + DBUG_ENTER("cli_read_rows"); + + if ((pkt_len= cli_safe_read(mysql)) == packet_error) + DBUG_RETURN(0); + if (!(result=(MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), + MYF(MY_WME | MY_ZEROFILL)))) + { + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(0); + } + init_alloc_root(&result->alloc,8192,0); /* Assume rowlength < 8192 */ + result->alloc.min_malloc=sizeof(MYSQL_ROWS); + prev_ptr= &result->data; + result->rows=0; + result->fields=fields; + + /* + The last EOF packet is either a single 254 character or (in MySQL 4.1) + 254 followed by 1-7 status bytes. + + This doesn't conflict with normal usage of 254 which stands for a + string where the length of the string is 8 bytes. (see net_field_length()) + */ + + while (*(cp=net->read_pos) != 254 || pkt_len >= 8) + { + result->rows++; + if (!(cur= (MYSQL_ROWS*) alloc_root(&result->alloc, + sizeof(MYSQL_ROWS))) || + !(cur->data= ((MYSQL_ROW) + alloc_root(&result->alloc, + (fields+1)*sizeof(char *)+pkt_len)))) + { + free_rows(result); + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(0); + } + *prev_ptr=cur; + prev_ptr= &cur->next; + to= (char*) (cur->data+fields+1); + end_to=to+pkt_len-1; + for (field=0 ; field < fields ; field++) + { + if ((len=(ulong) net_field_length(&cp)) == NULL_LENGTH) + { /* null field */ + cur->data[field] = 0; + } + else + { + cur->data[field] = to; + if (len > (ulong) (end_to - to)) + { + free_rows(result); + set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate); + DBUG_RETURN(0); + } + memcpy(to,(char*) cp,len); to[len]=0; + to+=len+1; + cp+=len; + if (mysql_fields) + { + if (mysql_fields[field].max_length < len) + mysql_fields[field].max_length=len; + } + } + } + cur->data[field]=to; /* End of last field */ + if ((pkt_len=cli_safe_read(mysql)) == packet_error) + { + free_rows(result); + DBUG_RETURN(0); + } + } + *prev_ptr=0; /* last pointer is null */ + if (pkt_len > 1) /* MySQL 4.1 protocol */ + { + mysql->warning_count= uint2korr(cp+1); + mysql->server_status= uint2korr(cp+3); + DBUG_PRINT("info",("status: %u warning_count: %u", + mysql->server_status, mysql->warning_count)); + } + DBUG_PRINT("exit", ("Got %lu rows", (ulong) result->rows)); + DBUG_RETURN(result); +} + +/* + Read one row. Uses packet buffer as storage for fields. + When next packet is read, the previous field values are destroyed +*/ + + +static int +read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths) +{ + uint field; + ulong pkt_len,len; + uchar *pos, *prev_pos, *end_pos; + NET *net= &mysql->net; + + if ((pkt_len=cli_safe_read(mysql)) == packet_error) + return -1; + if (pkt_len <= 8 && net->read_pos[0] == 254) + { + if (pkt_len > 1) /* MySQL 4.1 protocol */ + { + mysql->warning_count= uint2korr(net->read_pos+1); + mysql->server_status= uint2korr(net->read_pos+3); + } + return 1; /* End of data */ + } + prev_pos= 0; /* allowed to write at packet[-1] */ + pos=net->read_pos; + end_pos=pos+pkt_len; + for (field=0 ; field < fields ; field++) + { + if ((len=(ulong) net_field_length(&pos)) == NULL_LENGTH) + { /* null field */ + row[field] = 0; + *lengths++=0; + } + else + { + if (len > (ulong) (end_pos - pos)) + { + set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate); + return -1; + } + row[field] = (char*) pos; + pos+=len; + *lengths++=len; + } + if (prev_pos) + *prev_pos=0; /* Terminate prev field */ + prev_pos=pos; + } + row[field]=(char*) prev_pos+1; /* End of last field */ + *prev_pos=0; /* Terminate last field */ + return 0; +} + + +/**************************************************************************** + Init MySQL structure or allocate one +****************************************************************************/ + +MYSQL * STDCALL +mysql_init(MYSQL *mysql) +{ + if (mysql_server_init(0, NULL, NULL)) + return 0; + if (!mysql) + { + if (!(mysql=(MYSQL*) my_malloc(sizeof(*mysql),MYF(MY_WME | MY_ZEROFILL)))) + { + set_mysql_error(NULL, CR_OUT_OF_MEMORY, unknown_sqlstate); + return 0; + } + mysql->free_me=1; + } + else + bzero((char*) (mysql), sizeof(*(mysql))); + mysql->options.connect_timeout= CONNECT_TIMEOUT; + mysql->charset=default_client_charset_info; + strmov(mysql->net.sqlstate, not_error_sqlstate); + + /* + Only enable LOAD DATA INFILE by default if configured with + --enable-local-infile + */ + +#if defined(ENABLED_LOCAL_INFILE) && !defined(MYSQL_SERVER) + mysql->options.client_flag|= CLIENT_LOCAL_FILES; +#endif + +#ifdef HAVE_SMEM + mysql->options.shared_memory_base_name= (char*) def_shared_memory_base_name; +#endif + + mysql->options.methods_to_use= MYSQL_OPT_GUESS_CONNECTION; + mysql->options.report_data_truncation= TRUE; /* default */ + + /* + By default we don't reconnect because it could silently corrupt data (after + reconnection you potentially lose table locks, user variables, session + variables (transactions but they are specifically dealt with in + mysql_reconnect()). + This is a change: < 5.0.3 mysql->reconnect was set to 1 by default. + How this change impacts existing apps: + - existing apps which relyed on the default will see a behaviour change; + they will have to set reconnect=1 after mysql_real_connect(). + - existing apps which explicitely asked for reconnection (the only way they + could do it was by setting mysql.reconnect to 1 after mysql_real_connect()) + will not see a behaviour change. + - existing apps which explicitely asked for no reconnection + (mysql.reconnect=0) will not see a behaviour change. + */ + mysql->reconnect= 0; + + return mysql; +} + + +/* + Fill in SSL part of MYSQL structure and set 'use_ssl' flag. + NB! Errors are not reported until you do mysql_real_connect. +*/ + +#define strdup_if_not_null(A) (A) == 0 ? 0 : my_strdup((A),MYF(MY_WME)) + +my_bool STDCALL +mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , + const char *key __attribute__((unused)), + const char *cert __attribute__((unused)), + const char *ca __attribute__((unused)), + const char *capath __attribute__((unused)), + const char *cipher __attribute__((unused))) +{ + DBUG_ENTER("mysql_ssl_set"); +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + mysql->options.ssl_key= strdup_if_not_null(key); + mysql->options.ssl_cert= strdup_if_not_null(cert); + mysql->options.ssl_ca= strdup_if_not_null(ca); + mysql->options.ssl_capath= strdup_if_not_null(capath); + mysql->options.ssl_cipher= strdup_if_not_null(cipher); +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + DBUG_RETURN(0); +} + + +/* + Free strings in the SSL structure and clear 'use_ssl' flag. + NB! Errors are not reported until you do mysql_real_connect. +*/ + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + +static void +mysql_ssl_free(MYSQL *mysql __attribute__((unused))) +{ + struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd; + DBUG_ENTER("mysql_ssl_free"); + + my_free(mysql->options.ssl_key, MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.ssl_cert, MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.ssl_capath, MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + if (ssl_fd) + SSL_CTX_free(ssl_fd->ssl_context); + my_free(mysql->connector_fd,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.ssl_key = 0; + mysql->options.ssl_cert = 0; + mysql->options.ssl_ca = 0; + mysql->options.ssl_capath = 0; + mysql->options.ssl_cipher= 0; + mysql->options.use_ssl = FALSE; + mysql->connector_fd = 0; + DBUG_VOID_RETURN; +} + +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + +/* + Return the SSL cipher (if any) used for current + connection to the server. + + SYNOPSYS + mysql_get_ssl_cipher() + mysql pointer to the mysql connection + +*/ + +const char * STDCALL +mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused))) +{ + DBUG_ENTER("mysql_get_ssl_cipher"); +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + if (mysql->net.vio && mysql->net.vio->ssl_arg) + DBUG_RETURN(SSL_get_cipher_name((SSL*)mysql->net.vio->ssl_arg)); +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + DBUG_RETURN(NULL); +} + + +/* + Check the server's (subject) Common Name against the + hostname we connected to + + SYNOPSIS + ssl_verify_server_cert() + vio pointer to a SSL connected vio + server_hostname name of the server that we connected to + + RETURN VALUES + 0 Success + 1 Failed to validate server + + */ + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + +static int ssl_verify_server_cert(Vio *vio, const char* server_hostname) +{ + SSL *ssl; + X509 *server_cert; + char *cp1, *cp2; + char buf[256]; + DBUG_ENTER("ssl_verify_server_cert"); + DBUG_PRINT("enter", ("server_hostname: %s", server_hostname)); + + if (!(ssl= (SSL*)vio->ssl_arg)) + { + DBUG_PRINT("error", ("No SSL pointer found")); + DBUG_RETURN(1); + } + + if (!server_hostname) + { + DBUG_PRINT("error", ("No server hostname supplied")); + DBUG_RETURN(1); + } + + if (!(server_cert= SSL_get_peer_certificate(ssl))) + { + DBUG_PRINT("error", ("Could not get server certificate")); + DBUG_RETURN(1); + } + + /* + We already know that the certificate exchanged was valid; the SSL library + handled that. Now we need to verify that the contents of the certificate + are what we expect. + */ + + X509_NAME_oneline(X509_get_subject_name(server_cert), buf, sizeof(buf)); + X509_free (server_cert); + + DBUG_PRINT("info", ("hostname in cert: %s", buf)); + cp1= strstr(buf, "/CN="); + if (cp1) + { + cp1+= 4; /* Skip the "/CN=" that we found */ + /* Search for next / which might be the delimiter for email */ + cp2= strchr(cp1, '/'); + if (cp2) + *cp2= '\0'; + DBUG_PRINT("info", ("Server hostname in cert: %s", cp1)); + if (!strcmp(cp1, server_hostname)) + { + /* Success */ + DBUG_RETURN(0); + } + } + DBUG_PRINT("error", ("SSL certificate validation failure")); + DBUG_RETURN(1); +} + +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + + +/* + Note that the mysql argument must be initialized with mysql_init() + before calling mysql_real_connect ! +*/ + +static my_bool cli_read_query_result(MYSQL *mysql); +static MYSQL_RES *cli_use_result(MYSQL *mysql); + +static MYSQL_METHODS client_methods= +{ + cli_read_query_result, /* read_query_result */ + cli_advanced_command, /* advanced_command */ + cli_read_rows, /* read_rows */ + cli_use_result, /* use_result */ + cli_fetch_lengths, /* fetch_lengths */ + cli_flush_use_result /* flush_use_result */ +#ifndef MYSQL_SERVER + ,cli_list_fields, /* list_fields */ + cli_read_prepare_result, /* read_prepare_result */ + cli_stmt_execute, /* stmt_execute */ + cli_read_binary_rows, /* read_binary_rows */ + cli_unbuffered_fetch, /* unbuffered_fetch */ + NULL, /* free_embedded_thd */ + cli_read_statistics, /* read_statistics */ + cli_read_query_result, /* next_result */ + cli_read_change_user_result, /* read_change_user_result */ + cli_read_binary_rows /* read_rows_from_cursor */ +#endif +}; + +C_MODE_START +int mysql_init_character_set(MYSQL *mysql) +{ + const char *default_collation_name; + + /* Set character set */ + if (!mysql->options.charset_name) + { + default_collation_name= MYSQL_DEFAULT_COLLATION_NAME; + if (!(mysql->options.charset_name= + my_strdup(MYSQL_DEFAULT_CHARSET_NAME,MYF(MY_WME)))) + return 1; + } + else + default_collation_name= NULL; + + { + const char *save= charsets_dir; + if (mysql->options.charset_dir) + charsets_dir=mysql->options.charset_dir; + mysql->charset=get_charset_by_csname(mysql->options.charset_name, + MY_CS_PRIMARY, MYF(MY_WME)); + if (mysql->charset && default_collation_name) + { + CHARSET_INFO *collation; + if ((collation= + get_charset_by_name(default_collation_name, MYF(MY_WME)))) + { + if (!my_charset_same(mysql->charset, collation)) + { + my_printf_error(ER_UNKNOWN_ERROR, + "COLLATION %s is not valid for CHARACTER SET %s", + MYF(0), + default_collation_name, mysql->options.charset_name); + mysql->charset= NULL; + } + else + { + mysql->charset= collation; + } + } + else + mysql->charset= NULL; + } + charsets_dir= save; + } + + if (!mysql->charset) + { + if (mysql->options.charset_dir) + set_mysql_extended_error(mysql, CR_CANT_READ_CHARSET, unknown_sqlstate, + ER(CR_CANT_READ_CHARSET), + mysql->options.charset_name, + mysql->options.charset_dir); + else + { + char cs_dir_name[FN_REFLEN]; + get_charsets_dir(cs_dir_name); + set_mysql_extended_error(mysql, CR_CANT_READ_CHARSET, unknown_sqlstate, + ER(CR_CANT_READ_CHARSET), + mysql->options.charset_name, + cs_dir_name); + } + return 1; + } + return 0; +} +C_MODE_END + + +MYSQL * STDCALL +CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, + const char *passwd, const char *db, + uint port, const char *unix_socket,ulong client_flag) +{ + char buff[NAME_LEN+USERNAME_LENGTH+100]; + char *end,*host_info; + ulong pkt_length; + NET *net= &mysql->net; +#ifdef MYSQL_SERVER + thr_alarm_t alarmed; + ALARM alarm_buff; +#endif +#ifdef __WIN__ + HANDLE hPipe=INVALID_HANDLE_VALUE; +#endif +#ifdef HAVE_SYS_UN_H + struct sockaddr_un UNIXaddr; +#endif + init_sigpipe_variables + DBUG_ENTER("mysql_real_connect"); + LINT_INIT(host_info); + + DBUG_PRINT("enter",("host: %s db: %s user: %s", + host ? host : "(Null)", + db ? db : "(Null)", + user ? user : "(Null)")); + + /* Test whether we're already connected */ + if (net->vio) + { + set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate); + DBUG_RETURN(0); + } + + /* Don't give sigpipe errors if the client doesn't want them */ + set_sigpipe(mysql); + mysql->methods= &client_methods; + net->vio = 0; /* If something goes wrong */ + mysql->client_flag=0; /* For handshake */ + + /* use default options */ + if (mysql->options.my_cnf_file || mysql->options.my_cnf_group) + { + mysql_read_default_options(&mysql->options, + (mysql->options.my_cnf_file ? + mysql->options.my_cnf_file : "my"), + mysql->options.my_cnf_group); + my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.my_cnf_file=mysql->options.my_cnf_group=0; + } + + /* Some empty-string-tests are done because of ODBC */ + if (!host || !host[0]) + host=mysql->options.host; + if (!user || !user[0]) + { + user=mysql->options.user; + if (!user) + user= ""; + } + if (!passwd) + { + passwd=mysql->options.password; +#if !defined(DONT_USE_MYSQL_PWD) && !defined(MYSQL_SERVER) + if (!passwd) + passwd=getenv("MYSQL_PWD"); /* get it from environment */ +#endif + if (!passwd) + passwd= ""; + } + if (!db || !db[0]) + db=mysql->options.db; + if (!port) + port=mysql->options.port; + if (!unix_socket) + unix_socket=mysql->options.unix_socket; + + mysql->server_status=SERVER_STATUS_AUTOCOMMIT; + + /* + Part 0: Grab a socket and connect it to the server + */ +#if defined(HAVE_SMEM) + if ((!mysql->options.protocol || + mysql->options.protocol == MYSQL_PROTOCOL_MEMORY) && + (!host || !strcmp(host,LOCAL_HOST))) + { + if ((create_shared_memory(mysql,net, mysql->options.connect_timeout)) == + INVALID_HANDLE_VALUE) + { + DBUG_PRINT("error", + ("host: '%s' socket: '%s' shared memory: %s have_tcpip: %d", + host ? host : "", + unix_socket ? unix_socket : "", + (int) mysql->options.shared_memory_base_name, + (int) have_tcpip)); + if (mysql->options.protocol == MYSQL_PROTOCOL_MEMORY) + goto error; + + /* + Try also with PIPE or TCP/IP. Clear the error from + create_shared_memory(). + */ + + net_clear_error(net); + } + else + { + mysql->options.protocol=MYSQL_PROTOCOL_MEMORY; + unix_socket = 0; + host=mysql->options.shared_memory_base_name; + my_snprintf(host_info=buff, sizeof(buff)-1, + ER(CR_SHARED_MEMORY_CONNECTION), host); + } + } +#endif /* HAVE_SMEM */ +#if defined(HAVE_SYS_UN_H) + if (!net->vio && + (!mysql->options.protocol || + mysql->options.protocol == MYSQL_PROTOCOL_SOCKET) && + (unix_socket || mysql_unix_port) && + (!host || !strcmp(host,LOCAL_HOST))) + { + my_socket sock= socket(AF_UNIX, SOCK_STREAM, 0); + if (sock == SOCKET_ERROR) + { + set_mysql_extended_error(mysql, CR_SOCKET_CREATE_ERROR, + unknown_sqlstate, + ER(CR_SOCKET_CREATE_ERROR), + socket_errno); + goto error; + } + + net->vio= vio_new(sock, VIO_TYPE_SOCKET, + VIO_LOCALHOST | VIO_BUFFERED_READ); + if (!net->vio) + { + DBUG_PRINT("error",("Unknow protocol %d ", mysql->options.protocol)); + set_mysql_error(mysql, CR_CONN_UNKNOW_PROTOCOL, unknown_sqlstate); + closesocket(sock); + goto error; + } + + host= LOCAL_HOST; + if (!unix_socket) + unix_socket= mysql_unix_port; + host_info= (char*) ER(CR_LOCALHOST_CONNECTION); + DBUG_PRINT("info", ("Using UNIX sock '%s'", unix_socket)); + + bzero((char*) &UNIXaddr, sizeof(UNIXaddr)); + UNIXaddr.sun_family= AF_UNIX; + strmake(UNIXaddr.sun_path, unix_socket, sizeof(UNIXaddr.sun_path)-1); + + if (my_connect(sock, (struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), + mysql->options.connect_timeout)) + { + DBUG_PRINT("error",("Got error %d on connect to local server", + socket_errno)); + set_mysql_extended_error(mysql, CR_CONNECTION_ERROR, + unknown_sqlstate, + ER(CR_CONNECTION_ERROR), + unix_socket, socket_errno); + vio_delete(net->vio); + net->vio= 0; + goto error; + } + mysql->options.protocol=MYSQL_PROTOCOL_SOCKET; + } +#elif defined(__WIN__) + if (!net->vio && + (mysql->options.protocol == MYSQL_PROTOCOL_PIPE || + (host && !strcmp(host,LOCAL_HOST_NAMEDPIPE)) || + (! have_tcpip && (unix_socket || !host && is_NT())))) + { + if ((hPipe= create_named_pipe(mysql, mysql->options.connect_timeout, + (char**) &host, (char**) &unix_socket)) == + INVALID_HANDLE_VALUE) + { + DBUG_PRINT("error", + ("host: '%s' socket: '%s' have_tcpip: %d", + host ? host : "", + unix_socket ? unix_socket : "", + (int) have_tcpip)); + if (mysql->options.protocol == MYSQL_PROTOCOL_PIPE || + (host && !strcmp(host,LOCAL_HOST_NAMEDPIPE)) || + (unix_socket && !strcmp(unix_socket,MYSQL_NAMEDPIPE))) + goto error; + /* Try also with TCP/IP */ + } + else + { + net->vio=vio_new_win32pipe(hPipe); + my_snprintf(host_info=buff, sizeof(buff)-1, + ER(CR_NAMEDPIPE_CONNECTION), unix_socket); + } + } +#endif + if (!net->vio && + (!mysql->options.protocol || + mysql->options.protocol == MYSQL_PROTOCOL_TCP)) + { + struct addrinfo *res_lst, hints, *t_res; + int gai_errno; + char port_buf[NI_MAXSERV]; + + unix_socket=0; /* This is not used */ + + if (!port) + port= mysql_port; + + if (!host) + host= LOCAL_HOST; + + my_snprintf(host_info=buff, sizeof(buff)-1, ER(CR_TCP_CONNECTION), host); + DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host, port)); +#ifdef MYSQL_SERVER + thr_alarm_init(&alarmed); + thr_alarm(&alarmed, mysql->options.connect_timeout, &alarm_buff); +#endif + + DBUG_PRINT("info",("IP '%s'", "client")); + +#ifdef MYSQL_SERVER + thr_end_alarm(&alarmed); +#endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype= SOCK_STREAM; + hints.ai_protocol= IPPROTO_TCP; + hints.ai_family= AF_UNSPEC; + + DBUG_PRINT("info",("IPV6 getaddrinfo %s", host)); + my_snprintf(port_buf, NI_MAXSERV, "%d", port); + gai_errno= getaddrinfo(host, port_buf, &hints, &res_lst); + + if (gai_errno != 0) + { + /* + For DBUG we are keeping the right message but for client we default to + historical error message. + */ + DBUG_PRINT("info",("IPV6 getaddrinfo error %d", gai_errno)); + set_mysql_extended_error(mysql, CR_UNKNOWN_HOST, unknown_sqlstate, + ER(CR_UNKNOWN_HOST), host, errno); + + goto error; + } + + /* We only look at the first item (something to think about changing in the future) */ + t_res= res_lst; + { + my_socket sock= socket(t_res->ai_family, t_res->ai_socktype, + t_res->ai_protocol); + if (sock == SOCKET_ERROR) + { + set_mysql_extended_error(mysql, CR_IPSOCK_ERROR, unknown_sqlstate, + ER(CR_IPSOCK_ERROR), socket_errno); + freeaddrinfo(res_lst); + goto error; + } + + net->vio= vio_new(sock, VIO_TYPE_TCPIP, VIO_BUFFERED_READ); + if (! net->vio ) + { + DBUG_PRINT("error",("Unknow protocol %d ", mysql->options.protocol)); + set_mysql_error(mysql, CR_CONN_UNKNOW_PROTOCOL, unknown_sqlstate); + closesocket(sock); + freeaddrinfo(res_lst); + goto error; + } + + if (my_connect(sock, t_res->ai_addr, t_res->ai_addrlen, + mysql->options.connect_timeout)) + { + DBUG_PRINT("error",("Got error %d on connect to '%s'",socket_errno, + host)); + set_mysql_extended_error(mysql, CR_CONN_HOST_ERROR, unknown_sqlstate, + ER(CR_CONN_HOST_ERROR), host, socket_errno); + vio_delete(net->vio); + net->vio= 0; + freeaddrinfo(res_lst); + goto error; + } + } + + freeaddrinfo(res_lst); + } + + if (!net->vio) + { + DBUG_PRINT("error",("Unknow protocol %d ",mysql->options.protocol)); + set_mysql_error(mysql, CR_CONN_UNKNOW_PROTOCOL, unknown_sqlstate); + goto error; + } + + if (my_net_init(net, net->vio)) + { + vio_delete(net->vio); + net->vio = 0; + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + goto error; + } + vio_keepalive(net->vio,TRUE); + + /* If user set read_timeout, let it override the default */ + if (mysql->options.read_timeout) + my_net_set_read_timeout(net, mysql->options.read_timeout); + + /* If user set write_timeout, let it override the default */ + if (mysql->options.write_timeout) + my_net_set_write_timeout(net, mysql->options.write_timeout); + + if (mysql->options.max_allowed_packet) + net->max_packet_size= mysql->options.max_allowed_packet; + + /* Get version info */ + mysql->protocol_version= PROTOCOL_VERSION; /* Assume this */ + if (mysql->options.connect_timeout && + vio_poll_read(net->vio, mysql->options.connect_timeout)) + { + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "waiting for initial communication packet", + errno); + goto error; + } + + /* + Part 1: Connection established, read and parse first packet + */ + + if ((pkt_length=cli_safe_read(mysql)) == packet_error) + { + if (mysql->net.last_errno == CR_SERVER_LOST) + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "reading initial communication packet", + errno); + goto error; + } + /* Check if version of protocol matches current one */ + + mysql->protocol_version= net->read_pos[0]; + DBUG_DUMP("packet",(uchar*) net->read_pos,10); + DBUG_PRINT("info",("mysql protocol version %d, server=%d", + PROTOCOL_VERSION, mysql->protocol_version)); + if (mysql->protocol_version != PROTOCOL_VERSION) + { + set_mysql_extended_error(mysql, CR_VERSION_ERROR, unknown_sqlstate, + ER(CR_VERSION_ERROR), mysql->protocol_version, + PROTOCOL_VERSION); + goto error; + } + end=strend((char*) net->read_pos+1); + mysql->thread_id=uint4korr(end+1); + end+=5; + /* + Scramble is split into two parts because old clients does not understand + long scrambles; here goes the first part. + */ + strmake(mysql->scramble, end, SCRAMBLE_LENGTH_323); + end+= SCRAMBLE_LENGTH_323+1; + + if (pkt_length >= (uint) (end+1 - (char*) net->read_pos)) + mysql->server_capabilities=uint2korr(end); + if (pkt_length >= (uint) (end+18 - (char*) net->read_pos)) + { + /* New protocol with 16 bytes to describe server characteristics */ + mysql->server_language=end[2]; + mysql->server_status=uint2korr(end+3); + } + end+= 18; + if (pkt_length >= (uint) (end + SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1 - + (char *) net->read_pos)) + strmake(mysql->scramble+SCRAMBLE_LENGTH_323, end, + SCRAMBLE_LENGTH-SCRAMBLE_LENGTH_323); + else + mysql->server_capabilities&= ~CLIENT_SECURE_CONNECTION; + + if (mysql->options.secure_auth && passwd[0] && + !(mysql->server_capabilities & CLIENT_SECURE_CONNECTION)) + { + set_mysql_error(mysql, CR_SECURE_AUTH, unknown_sqlstate); + goto error; + } + + if (mysql_init_character_set(mysql)) + goto error; + + /* Save connection information */ + if (!my_multi_malloc(MYF(0), + &mysql->host_info, (uint) strlen(host_info)+1, + &mysql->host, (uint) strlen(host)+1, + &mysql->unix_socket,unix_socket ? + (uint) strlen(unix_socket)+1 : (uint) 1, + &mysql->server_version, + (uint) (end - (char*) net->read_pos), + NullS) || + !(mysql->user=my_strdup(user,MYF(0))) || + !(mysql->passwd=my_strdup(passwd,MYF(0)))) + { + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + goto error; + } + strmov(mysql->host_info,host_info); + strmov(mysql->host,host); + if (unix_socket) + strmov(mysql->unix_socket,unix_socket); + else + mysql->unix_socket=0; + strmov(mysql->server_version,(char*) net->read_pos+1); + mysql->port=port; + + /* + Part 2: format and send client info to the server for access check + */ + + client_flag|=mysql->options.client_flag; + client_flag|=CLIENT_CAPABILITIES; + if (client_flag & CLIENT_MULTI_STATEMENTS) + client_flag|= CLIENT_MULTI_RESULTS; + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + if (mysql->options.ssl_key || mysql->options.ssl_cert || + mysql->options.ssl_ca || mysql->options.ssl_capath || + mysql->options.ssl_cipher) + mysql->options.use_ssl= 1; + if (mysql->options.use_ssl) + client_flag|=CLIENT_SSL; +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY*/ + if (db) + client_flag|=CLIENT_CONNECT_WITH_DB; + + /* Remove options that server doesn't support */ + client_flag= ((client_flag & + ~(CLIENT_COMPRESS | CLIENT_SSL | CLIENT_PROTOCOL_41)) | + (client_flag & mysql->server_capabilities)); +#ifndef HAVE_COMPRESS + client_flag&= ~CLIENT_COMPRESS; +#endif + + if (client_flag & CLIENT_PROTOCOL_41) + { + /* 4.1 server and 4.1 client has a 32 byte option flag */ + int4store(buff,client_flag); + int4store(buff+4, net->max_packet_size); + buff[8]= (char) mysql->charset->number; + /* + Character set 45 (4-byte UTF-8) is not available on servers + before version 6.0, so we need to go ahead and switch to utf8_mb3. + */ + if (mysql->charset->number == 45 && mysql->server_version[0] < '6') + buff[8]= 33; + else + buff[8]= (char)mysql->charset->number; + + bzero(buff+9, 32-9); + end= buff+32; + } + else + { + int2store(buff,client_flag); + int3store(buff+2,net->max_packet_size); + end= buff+5; + } + mysql->client_flag=client_flag; + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + if (client_flag & CLIENT_SSL) + { + /* Do the SSL layering. */ + struct st_mysql_options *options= &mysql->options; + struct st_VioSSLFd *ssl_fd; + + /* + Send client_flag, max_packet_size - unencrypted otherwise + the server does not know we want to do SSL + */ + if (my_net_write(net, (uchar*) buff, (uint) (end-buff)) || net_flush(net)) + { + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "sending connection information to server", + errno); + goto error; + } + + /* Create the VioSSLConnectorFd - init SSL and load certs */ + if (!(ssl_fd= new_VioSSLConnectorFd(options->ssl_key, + options->ssl_cert, + options->ssl_ca, + options->ssl_capath, + options->ssl_cipher))) + { + set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate); + goto error; + } + mysql->connector_fd= (void*)ssl_fd; + + /* Connect to the server */ + DBUG_PRINT("info", ("IO layer change in progress...")); + if (sslconnect(ssl_fd, mysql->net.vio, + (long) (mysql->options.connect_timeout))) + { + set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate); + goto error; + } + DBUG_PRINT("info", ("IO layer change done!")); + + /* Verify server cert */ + if ((client_flag & CLIENT_SSL_VERIFY_SERVER_CERT) && + ssl_verify_server_cert(mysql->net.vio, mysql->host)) + { + set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate); + goto error; + } + + } +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + + DBUG_PRINT("info",("Server version = '%s' capabilites: %lu status: %u client_flag: %lu", + mysql->server_version,mysql->server_capabilities, + mysql->server_status, client_flag)); + /* This needs to be changed as it's not useful with big packets */ + if (user && user[0]) + strmake(end,user,USERNAME_LENGTH); /* Max user name */ + else + read_user_name((char*) end); + + /* We have to handle different version of handshake here */ +#ifdef _CUSTOMCONFIG_ +#include "_cust_libmysql.h" +#endif + DBUG_PRINT("info",("user: %s",end)); + end= strend(end) + 1; + if (passwd[0]) + { + if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + *end++= SCRAMBLE_LENGTH; + scramble(end, mysql->scramble, passwd); + end+= SCRAMBLE_LENGTH; + } + else + { + scramble_323(end, mysql->scramble, passwd); + end+= SCRAMBLE_LENGTH_323 + 1; + } + } + else + *end++= '\0'; /* empty password */ + + /* Add database if needed */ + if (db && (mysql->server_capabilities & CLIENT_CONNECT_WITH_DB)) + { + end= strmake(end, db, NAME_LEN) + 1; + mysql->db= my_strdup(db,MYF(MY_WME)); + db= 0; + } + /* Write authentication package */ + if (my_net_write(net, (uchar*) buff, (size_t) (end-buff)) || net_flush(net)) + { + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "sending authentication information", + errno); + goto error; + } + + /* + Part 3: Authorization data's been sent. Now server can reply with + OK-packet, or re-request scrambled password. + */ + + if ((pkt_length=cli_safe_read(mysql)) == packet_error) + { + if (mysql->net.last_errno == CR_SERVER_LOST) + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "reading authorization packet", + errno); + goto error; + } + + if (pkt_length == 1 && net->read_pos[0] == 254 && + mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + /* + By sending this very specific reply server asks us to send scrambled + password in old format. + */ + scramble_323(buff, mysql->scramble, passwd); + if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) || + net_flush(net)) + { + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "sending password information", + errno); + goto error; + } + /* Read what server thinks about out new auth message report */ + if (cli_safe_read(mysql) == packet_error) + { + if (mysql->net.last_errno == CR_SERVER_LOST) + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "reading final connect information", + errno); + goto error; + } + } + + if (client_flag & CLIENT_COMPRESS) /* We will use compression */ + net->compress=1; + +#ifdef CHECK_LICENSE + if (check_license(mysql)) + goto error; +#endif + + if (db && mysql_select_db(mysql, db)) + { + if (mysql->net.last_errno == CR_SERVER_LOST) + set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "Setting intital database", + errno); + goto error; + } + + if (mysql->options.init_commands) + { + DYNAMIC_ARRAY *init_commands= mysql->options.init_commands; + char **ptr= (char**)init_commands->buffer; + char **end_command= ptr + init_commands->elements; + + my_bool reconnect=mysql->reconnect; + mysql->reconnect=0; + + for (; ptr < end_command; ptr++) + { + MYSQL_RES *res; + if (mysql_real_query(mysql,*ptr, (ulong) strlen(*ptr))) + goto error; + if (mysql->fields) + { + if (!(res= cli_use_result(mysql))) + goto error; + mysql_free_result(res); + } + } + mysql->reconnect=reconnect; + } + + DBUG_PRINT("exit", ("Mysql handler: %p", mysql)); + reset_sigpipe(mysql); + DBUG_RETURN(mysql); + +error: + reset_sigpipe(mysql); + DBUG_PRINT("error",("message: %u/%s (%s)", + net->last_errno, + net->sqlstate, + net->last_error)); + { + /* Free alloced memory */ + end_server(mysql); + mysql_close_free(mysql); + if (!(((ulong) client_flag) & CLIENT_REMEMBER_OPTIONS)) + mysql_close_free_options(mysql); + } + DBUG_RETURN(0); +} + + +my_bool mysql_reconnect(MYSQL *mysql) +{ + MYSQL tmp_mysql; + DBUG_ENTER("mysql_reconnect"); + DBUG_ASSERT(mysql); + DBUG_PRINT("enter", ("mysql->reconnect: %d", mysql->reconnect)); + + if (!mysql->reconnect || + (mysql->server_status & SERVER_STATUS_IN_TRANS) || !mysql->host_info) + { + /* Allow reconnect next time */ + mysql->server_status&= ~SERVER_STATUS_IN_TRANS; + set_mysql_error(mysql, CR_SERVER_GONE_ERROR, unknown_sqlstate); + DBUG_RETURN(1); + } + mysql_init(&tmp_mysql); + tmp_mysql.options= mysql->options; + tmp_mysql.options.my_cnf_file= tmp_mysql.options.my_cnf_group= 0; + + if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd, + mysql->db, mysql->port, mysql->unix_socket, + mysql->client_flag | CLIENT_REMEMBER_OPTIONS)) + { + mysql->net.last_errno= tmp_mysql.net.last_errno; + strmov(mysql->net.last_error, tmp_mysql.net.last_error); + strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); + DBUG_RETURN(1); + } + if (mysql_set_character_set(&tmp_mysql, mysql->charset->csname)) + { + DBUG_PRINT("error", ("mysql_set_character_set() failed")); + bzero((char*) &tmp_mysql.options,sizeof(tmp_mysql.options)); + mysql_close(&tmp_mysql); + mysql->net.last_errno= tmp_mysql.net.last_errno; + strmov(mysql->net.last_error, tmp_mysql.net.last_error); + strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); + DBUG_RETURN(1); + } + + DBUG_PRINT("info", ("reconnect succeded")); + tmp_mysql.reconnect= 1; + tmp_mysql.free_me= mysql->free_me; + + /* + For each stmt in mysql->stmts, move it to tmp_mysql if it is + in state MYSQL_STMT_INIT_DONE, otherwise close it. + */ + { + LIST *element= mysql->stmts; + for (; element; element= element->next) + { + MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; + if (stmt->state != MYSQL_STMT_INIT_DONE) + { + stmt->mysql= 0; + stmt->last_errno= CR_SERVER_LOST; + strmov(stmt->last_error, ER(CR_SERVER_LOST)); + strmov(stmt->sqlstate, unknown_sqlstate); + } + else + { + tmp_mysql.stmts= list_add(tmp_mysql.stmts, &stmt->list); + } + /* No need to call list_delete for statement here */ + } + mysql->stmts= NULL; + } + + /* Don't free options as these are now used in tmp_mysql */ + bzero((char*) &mysql->options,sizeof(mysql->options)); + mysql->free_me=0; + mysql_close(mysql); + *mysql=tmp_mysql; + net_clear(&mysql->net, 1); + mysql->affected_rows= ~(my_ulonglong) 0; + DBUG_RETURN(0); +} + + +/************************************************************************** + Set current database +**************************************************************************/ + +int STDCALL +mysql_select_db(MYSQL *mysql, const char *db) +{ + int error; + DBUG_ENTER("mysql_select_db"); + DBUG_PRINT("enter",("db: '%s'",db)); + + if ((error=simple_command(mysql,COM_INIT_DB, (const uchar*) db, + (ulong) strlen(db),0))) + DBUG_RETURN(error); + my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); + mysql->db=my_strdup(db,MYF(MY_WME)); + DBUG_RETURN(0); +} + + +/************************************************************************* + Send a QUIT to the server and close the connection + If handle is alloced by mysql connect free it. +*************************************************************************/ + +static void mysql_close_free_options(MYSQL *mysql) +{ + DBUG_ENTER("mysql_close_free_options"); + + my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.host,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.unix_socket,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.client_ip,MYF(MY_ALLOW_ZERO_PTR)); + if (mysql->options.init_commands) + { + DYNAMIC_ARRAY *init_commands= mysql->options.init_commands; + char **ptr= (char**)init_commands->buffer; + char **end= ptr + init_commands->elements; + for (; ptroptions.shared_memory_base_name != def_shared_memory_base_name) + my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); +#endif /* HAVE_SMEM */ + bzero((char*) &mysql->options,sizeof(mysql->options)); + DBUG_VOID_RETURN; +} + + +static void mysql_close_free(MYSQL *mysql) +{ + my_free((uchar*) mysql->host_info,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); +#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100 + my_free(mysql->info_buffer,MYF(MY_ALLOW_ZERO_PTR)); + mysql->info_buffer= 0; +#endif + /* Clear pointers for better safety */ + mysql->host_info= mysql->user= mysql->passwd= mysql->db= 0; +} + + +/* + Clear connection pointer of every statement: this is necessary + to give error on attempt to use a prepared statement of closed + connection. + + SYNOPSYS + mysql_detach_stmt_list() + stmt_list pointer to mysql->stmts + func_name name of calling function + + NOTE + There is similar code in mysql_reconnect(), so changes here + should also be reflected there. +*/ + +void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)), + const char *func_name __attribute__((unused))) +{ +#ifdef MYSQL_CLIENT + /* Reset connection handle in all prepared statements. */ + LIST *element= *stmt_list; + char buff[MYSQL_ERRMSG_SIZE]; + DBUG_ENTER("mysql_detach_stmt_list"); + + my_snprintf(buff, sizeof(buff)-1, ER(CR_STMT_CLOSED), func_name); + for (; element; element= element->next) + { + MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; + set_stmt_error(stmt, CR_STMT_CLOSED, unknown_sqlstate, buff); + stmt->mysql= 0; + /* No need to call list_delete for statement here */ + } + *stmt_list= 0; + DBUG_VOID_RETURN; +#endif /* MYSQL_CLIENT */ +} + + +void STDCALL mysql_close(MYSQL *mysql) +{ + DBUG_ENTER("mysql_close"); + if (mysql) /* Some simple safety */ + { + /* If connection is still up, send a QUIT message */ + if (mysql->net.vio != 0) + { + free_old_query(mysql); + mysql->status=MYSQL_STATUS_READY; /* Force command */ + mysql->reconnect=0; + simple_command(mysql,COM_QUIT,(uchar*) 0,0,1); + end_server(mysql); /* Sets mysql->net.vio= 0 */ + } + mysql_close_free_options(mysql); + mysql_close_free(mysql); + mysql_detach_stmt_list(&mysql->stmts, "mysql_close"); +#ifndef MYSQL_SERVER + if (mysql->thd) + (*mysql->methods->free_embedded_thd)(mysql); +#endif + if (mysql->free_me) + my_free((uchar*) mysql,MYF(0)); + } + DBUG_VOID_RETURN; +} + + +static my_bool cli_read_query_result(MYSQL *mysql) +{ + uchar *pos; + ulong field_count; + MYSQL_DATA *fields; + ulong length; + DBUG_ENTER("cli_read_query_result"); + + if ((length = cli_safe_read(mysql)) == packet_error) + DBUG_RETURN(1); + free_old_query(mysql); /* Free old result */ +#ifdef MYSQL_CLIENT /* Avoid warn of unused labels*/ +get_info: +#endif + pos=(uchar*) mysql->net.read_pos; + if ((field_count= net_field_length(&pos)) == 0) + { + mysql->affected_rows= net_field_length_ll(&pos); + mysql->insert_id= net_field_length_ll(&pos); + DBUG_PRINT("info",("affected_rows: %lu insert_id: %lu", + (ulong) mysql->affected_rows, + (ulong) mysql->insert_id)); + if (protocol_41(mysql)) + { + mysql->server_status=uint2korr(pos); pos+=2; + mysql->warning_count=uint2korr(pos); pos+=2; + } + else if (mysql->server_capabilities & CLIENT_TRANSACTIONS) + { + /* MySQL 4.0 protocol */ + mysql->server_status=uint2korr(pos); pos+=2; + mysql->warning_count= 0; + } + DBUG_PRINT("info",("status: %u warning_count: %u", + mysql->server_status, mysql->warning_count)); + if (pos < mysql->net.read_pos+length && net_field_length(&pos)) + mysql->info=(char*) pos; + DBUG_RETURN(0); + } +#ifdef MYSQL_CLIENT + if (field_count == NULL_LENGTH) /* LOAD DATA LOCAL INFILE */ + { + int error; + + if (!(mysql->options.client_flag & CLIENT_LOCAL_FILES)) + { + set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate); + DBUG_RETURN(1); + } + + error= handle_local_infile(mysql,(char*) pos); + if ((length= cli_safe_read(mysql)) == packet_error || error) + DBUG_RETURN(1); + goto get_info; /* Get info packet */ + } +#endif + if (!(mysql->server_status & SERVER_STATUS_AUTOCOMMIT)) + mysql->server_status|= SERVER_STATUS_IN_TRANS; + + if (!(fields=cli_read_rows(mysql,(MYSQL_FIELD*)0, protocol_41(mysql) ? 7:5))) + DBUG_RETURN(1); + if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc, + (uint) field_count,0, + mysql->server_capabilities))) + DBUG_RETURN(1); + mysql->status= MYSQL_STATUS_GET_RESULT; + mysql->field_count= (uint) field_count; + DBUG_PRINT("exit",("ok")); + DBUG_RETURN(0); +} + + +/* + Send the query and return so we can do something else. + Needs to be followed by mysql_read_query_result() when we want to + finish processing it. +*/ + +int STDCALL +mysql_send_query(MYSQL* mysql, const char* query, ulong length) +{ + DBUG_ENTER("mysql_send_query"); + DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1)); +} + + +int STDCALL +mysql_real_query(MYSQL *mysql, const char *query, ulong length) +{ + DBUG_ENTER("mysql_real_query"); + DBUG_PRINT("enter",("handle: %p", mysql)); + DBUG_PRINT("query",("Query = '%-.4096s'",query)); + + if (mysql_send_query(mysql,query,length)) + DBUG_RETURN(1); + DBUG_RETURN((int) (*mysql->methods->read_query_result)(mysql)); +} + + +/************************************************************************** + Alloc result struct for buffered results. All rows are read to buffer. + mysql_data_seek may be used. +**************************************************************************/ + +MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql) +{ + MYSQL_RES *result; + DBUG_ENTER("mysql_store_result"); + + if (!mysql->fields) + DBUG_RETURN(0); + if (mysql->status != MYSQL_STATUS_GET_RESULT) + { + set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + DBUG_RETURN(0); + } + mysql->status=MYSQL_STATUS_READY; /* server is ready */ + if (!(result=(MYSQL_RES*) my_malloc((uint) (sizeof(MYSQL_RES)+ + sizeof(ulong) * + mysql->field_count), + MYF(MY_WME | MY_ZEROFILL)))) + { + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(0); + } + result->methods= mysql->methods; + result->eof=1; /* Marker for buffered */ + result->lengths=(ulong*) (result+1); + if (!(result->data= + (*mysql->methods->read_rows)(mysql,mysql->fields,mysql->field_count))) + { + my_free((uchar*) result,MYF(0)); + DBUG_RETURN(0); + } + mysql->affected_rows= result->row_count= result->data->rows; + result->data_cursor= result->data->data; + result->fields= mysql->fields; + result->field_alloc= mysql->field_alloc; + result->field_count= mysql->field_count; + /* The rest of result members is bzeroed in malloc */ + mysql->fields=0; /* fields is now in result */ + clear_alloc_root(&mysql->field_alloc); + /* just in case this was mistakenly called after mysql_stmt_execute() */ + mysql->unbuffered_fetch_owner= 0; + DBUG_RETURN(result); /* Data fetched */ +} + + +/************************************************************************** + Alloc struct for use with unbuffered reads. Data is fetched by domand + when calling to mysql_fetch_row. + mysql_data_seek is a noop. + + No other queries may be specified with the same MYSQL handle. + There shouldn't be much processing per row because mysql server shouldn't + have to wait for the client (and will not wait more than 30 sec/packet). +**************************************************************************/ + +static MYSQL_RES * cli_use_result(MYSQL *mysql) +{ + MYSQL_RES *result; + DBUG_ENTER("cli_use_result"); + + if (!mysql->fields) + DBUG_RETURN(0); + if (mysql->status != MYSQL_STATUS_GET_RESULT) + { + set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + DBUG_RETURN(0); + } + if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result)+ + sizeof(ulong)*mysql->field_count, + MYF(MY_WME | MY_ZEROFILL)))) + DBUG_RETURN(0); + result->lengths=(ulong*) (result+1); + result->methods= mysql->methods; + if (!(result->row=(MYSQL_ROW) + my_malloc(sizeof(result->row[0])*(mysql->field_count+1), MYF(MY_WME)))) + { /* Ptrs: to one row */ + my_free((uchar*) result,MYF(0)); + DBUG_RETURN(0); + } + result->fields= mysql->fields; + result->field_alloc= mysql->field_alloc; + result->field_count= mysql->field_count; + result->current_field=0; + result->handle= mysql; + result->current_row= 0; + mysql->fields=0; /* fields is now in result */ + clear_alloc_root(&mysql->field_alloc); + mysql->status=MYSQL_STATUS_USE_RESULT; + mysql->unbuffered_fetch_owner= &result->unbuffered_fetch_cancelled; + DBUG_RETURN(result); /* Data is read to be fetched */ +} + + +/************************************************************************** + Return next row of the query results +**************************************************************************/ + +MYSQL_ROW STDCALL +mysql_fetch_row(MYSQL_RES *res) +{ + DBUG_ENTER("mysql_fetch_row"); + if (!res->data) + { /* Unbufferred fetch */ + if (!res->eof) + { + MYSQL *mysql= res->handle; + if (mysql->status != MYSQL_STATUS_USE_RESULT) + { + set_mysql_error(mysql, + res->unbuffered_fetch_cancelled ? + CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC, + unknown_sqlstate); + } + else if (!(read_one_row(mysql, res->field_count, res->row, res->lengths))) + { + res->row_count++; + DBUG_RETURN(res->current_row=res->row); + } + DBUG_PRINT("info",("end of data")); + res->eof=1; + mysql->status=MYSQL_STATUS_READY; + /* + Reset only if owner points to us: there is a chance that somebody + started new query after mysql_stmt_close(): + */ + if (mysql->unbuffered_fetch_owner == &res->unbuffered_fetch_cancelled) + mysql->unbuffered_fetch_owner= 0; + /* Don't clear handle in mysql_free_result */ + res->handle=0; + } + DBUG_RETURN((MYSQL_ROW) NULL); + } + { + MYSQL_ROW tmp; + if (!res->data_cursor) + { + DBUG_PRINT("info",("end of data")); + DBUG_RETURN(res->current_row=(MYSQL_ROW) NULL); + } + tmp = res->data_cursor->data; + res->data_cursor = res->data_cursor->next; + DBUG_RETURN(res->current_row=tmp); + } +} + + +/************************************************************************** + Get column lengths of the current row + If one uses mysql_use_result, res->lengths contains the length information, + else the lengths are calculated from the offset between pointers. +**************************************************************************/ + +ulong * STDCALL +mysql_fetch_lengths(MYSQL_RES *res) +{ + MYSQL_ROW column; + + if (!(column=res->current_row)) + return 0; /* Something is wrong */ + if (res->data) + (*res->methods->fetch_lengths)(res->lengths, column, res->field_count); + return res->lengths; +} + + +int STDCALL +mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) +{ + DBUG_ENTER("mysql_option"); + DBUG_PRINT("enter",("option: %d",(int) option)); + switch (option) { + case MYSQL_OPT_CONNECT_TIMEOUT: + mysql->options.connect_timeout= *(uint*) arg; + break; + case MYSQL_OPT_READ_TIMEOUT: + mysql->options.read_timeout= *(uint*) arg; + break; + case MYSQL_OPT_WRITE_TIMEOUT: + mysql->options.write_timeout= *(uint*) arg; + break; + case MYSQL_OPT_COMPRESS: + mysql->options.compress= 1; /* Remember for connect */ + mysql->options.client_flag|= CLIENT_COMPRESS; + break; + case MYSQL_OPT_NAMED_PIPE: /* This option is depricated */ + mysql->options.protocol=MYSQL_PROTOCOL_PIPE; /* Force named pipe */ + break; + case MYSQL_OPT_LOCAL_INFILE: /* Allow LOAD DATA LOCAL ?*/ + if (!arg || test(*(uint*) arg)) + mysql->options.client_flag|= CLIENT_LOCAL_FILES; + else + mysql->options.client_flag&= ~CLIENT_LOCAL_FILES; + break; + case MYSQL_INIT_COMMAND: + add_init_command(&mysql->options,arg); + break; + case MYSQL_READ_DEFAULT_FILE: + my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.my_cnf_file=my_strdup(arg,MYF(MY_WME)); + break; + case MYSQL_READ_DEFAULT_GROUP: + my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.my_cnf_group=my_strdup(arg,MYF(MY_WME)); + break; + case MYSQL_SET_CHARSET_DIR: + my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.charset_dir=my_strdup(arg,MYF(MY_WME)); + break; + case MYSQL_SET_CHARSET_NAME: + my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.charset_name=my_strdup(arg,MYF(MY_WME)); + break; + case MYSQL_OPT_PROTOCOL: + mysql->options.protocol= *(uint*) arg; + break; + case MYSQL_SHARED_MEMORY_BASE_NAME: +#ifdef HAVE_SMEM + if (mysql->options.shared_memory_base_name != def_shared_memory_base_name) + my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + mysql->options.shared_memory_base_name=my_strdup(arg,MYF(MY_WME)); +#endif + break; + case MYSQL_OPT_USE_REMOTE_CONNECTION: + case MYSQL_OPT_USE_EMBEDDED_CONNECTION: + case MYSQL_OPT_GUESS_CONNECTION: + mysql->options.methods_to_use= option; + break; + case MYSQL_SET_CLIENT_IP: + mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); + break; + case MYSQL_SECURE_AUTH: + mysql->options.secure_auth= *(my_bool *) arg; + break; + case MYSQL_REPORT_DATA_TRUNCATION: + mysql->options.report_data_truncation= test(*(my_bool *) arg); + break; + case MYSQL_OPT_RECONNECT: + mysql->reconnect= *(my_bool *) arg; + break; + case MYSQL_OPT_SSL_VERIFY_SERVER_CERT: + if (*(my_bool*) arg) + mysql->options.client_flag|= CLIENT_SSL_VERIFY_SERVER_CERT; + else + mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT; + break; + default: + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + + +/**************************************************************************** + Functions to get information from the MySQL structure + These are functions to make shared libraries more usable. +****************************************************************************/ + +/* MYSQL_RES */ +my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res) +{ + return res->row_count; +} + +unsigned int STDCALL mysql_num_fields(MYSQL_RES *res) +{ + return res->field_count; +} + +uint STDCALL mysql_errno(MYSQL *mysql) +{ + return mysql ? mysql->net.last_errno : mysql_server_last_errno; +} + + +const char * STDCALL mysql_error(MYSQL *mysql) +{ + return mysql ? mysql->net.last_error : mysql_server_last_error; +} + + +/* + Get version number for server in a form easy to test on + + SYNOPSIS + mysql_get_server_version() + mysql Connection + + EXAMPLE + 4.1.0-alfa -> 40100 + + NOTES + We will ensure that a newer server always has a bigger number. + + RETURN + Signed number > 323000 +*/ + +ulong STDCALL +mysql_get_server_version(MYSQL *mysql) +{ + uint major, minor, version; + char *pos= mysql->server_version, *end_pos; + major= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; + minor= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; + version= (uint) strtoul(pos, &end_pos, 10); + return (ulong) major*10000L+(ulong) (minor*100+version); +} + + +/* + mysql_set_character_set function sends SET NAMES cs_name to + the server (which changes character_set_client, character_set_result + and character_set_connection) and updates mysql->charset so other + functions like mysql_real_escape will work correctly. +*/ +int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name) +{ + struct charset_info_st *cs; + const char *save_csdir= charsets_dir; + + if (mysql->options.charset_dir) + charsets_dir= mysql->options.charset_dir; + + if (strlen(cs_name) < MY_CS_NAME_SIZE && + (cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) + { + char buff[MY_CS_NAME_SIZE + 10]; + charsets_dir= save_csdir; + /* Skip execution of "SET NAMES" for pre-4.1 servers */ + if (mysql_get_server_version(mysql) < 40100) + return 0; + sprintf(buff, "SET NAMES %s", cs_name); + if (!mysql_real_query(mysql, buff, strlen(buff))) + { + mysql->charset= cs; + } + } + else + { + char cs_dir_name[FN_REFLEN]; + get_charsets_dir(cs_dir_name); + set_mysql_extended_error(mysql, CR_CANT_READ_CHARSET, unknown_sqlstate, + ER(CR_CANT_READ_CHARSET), cs_name, cs_dir_name); + } + charsets_dir= save_csdir; + return mysql->net.last_errno; +} + + diff --git a/externals/mysql/libmysql/client_settings.h b/externals/mysql/libmysql/client_settings.h new file mode 100644 index 00000000000..ec63f495552 --- /dev/null +++ b/externals/mysql/libmysql/client_settings.h @@ -0,0 +1,73 @@ +/* Copyright (C) 2003-2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +extern uint mysql_port; +extern char * mysql_unix_port; + +#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \ + CLIENT_LONG_FLAG | \ + CLIENT_TRANSACTIONS | \ + CLIENT_PROTOCOL_41 | \ + CLIENT_SECURE_CONNECTION | \ + CLIENT_MULTI_RESULTS | \ + CLIENT_PS_MULTI_RESULTS) + +sig_handler my_pipe_sig_handler(int sig); +void read_user_name(char *name); +my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); + +/* + Let the user specify that we don't want SIGPIPE; This doesn't however work + with threaded applications as we can have multiple read in progress. +*/ + +#if !defined(__WIN__) && defined(SIGPIPE) && !defined(THREAD) +#define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0; +#define set_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE, my_pipe_sig_handler) +#define reset_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler); +#else +#define init_sigpipe_variables +#define set_sigpipe(mysql) +#define reset_sigpipe(mysql) +#endif + +void mysql_read_default_options(struct st_mysql_options *options, + const char *filename,const char *group); +void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name); +MYSQL * STDCALL +cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, + const char *passwd, const char *db, + uint port, const char *unix_socket,ulong client_flag); + +void cli_mysql_close(MYSQL *mysql); + +MYSQL_FIELD * cli_list_fields(MYSQL *mysql); +my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt); +MYSQL_DATA * cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, + uint fields); +int cli_stmt_execute(MYSQL_STMT *stmt); +int cli_read_binary_rows(MYSQL_STMT *stmt); +int cli_unbuffered_fetch(MYSQL *mysql, char **row); +const char * cli_read_statistics(MYSQL *mysql); +int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd); + +#ifdef EMBEDDED_LIBRARY +int init_embedded_server(int argc, char **argv, char **groups); +void end_embedded_server(); +#endif /*EMBEDDED_LIBRARY*/ + +C_MODE_START +extern int mysql_init_character_set(MYSQL *mysql); +C_MODE_END diff --git a/externals/mysql/libmysql/conf_to_src.c b/externals/mysql/libmysql/conf_to_src.c new file mode 100644 index 00000000000..785e3cad4c1 --- /dev/null +++ b/externals/mysql/libmysql/conf_to_src.c @@ -0,0 +1,145 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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 + the Free Software Foundation. + + There are special exceptions to the terms and conditions of the GPL as it + is applied to this software. View the full text of the exception in file + EXCEPTIONS-CLIENT in the directory of this software distribution. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* can't use -lmysys because this prog is used to create -lstrings */ + + +#include +#include +#include +#include + +#define CHARSETS_SUBDIR "sql/share/charsets" +#define CTYPE_TABLE_SIZE 257 +#define TO_LOWER_TABLE_SIZE 256 +#define TO_UPPER_TABLE_SIZE 256 +#define SORT_ORDER_TABLE_SIZE 256 +#define ROW_LEN 16 + +void print_arrays_for(char *set); + +char *prog; +char buf[1024], *p, *endptr; + +int +main(int argc, char **argv) +{ + prog = *argv; + + if (argc < 2) { + fprintf(stderr, "usage: %s source-dir [charset [, charset]]\n", prog); + exit(EXIT_FAILURE); + } + + --argc; ++argv; /* skip program name */ + + if (chdir(*argv) != 0) { + fprintf(stderr, "%s: can't cd to %s\n", prog, *argv); + exit(EXIT_FAILURE); + } + --argc; ++argv; + + if (chdir(CHARSETS_SUBDIR) != 0) { + fprintf(stderr, "%s: can't cd to %s\n", prog, CHARSETS_SUBDIR); + exit(EXIT_FAILURE); + } + + while (argc--) + print_arrays_for(*argv++); + + exit(EXIT_SUCCESS); +} + +void +print_array(FILE *f, const char *set, const char *name, int n) +{ + int i; + char val[100]; + + printf("uchar %s_%s[] = {\n", name, set); + + p = buf; + *buf = '\0'; + for (i = 0; i < n; ++i) + { + /* get a word from f */ + endptr = p; + for (;;) + { + while (isspace(*endptr)) + ++endptr; + if (*endptr && *endptr != '#') /* not comment */ + break; + if ((fgets(buf, sizeof(buf), f)) == NULL) + return; /* XXX: break silently */ + endptr = buf; + } + + p = val; + while (!isspace(*endptr)) + *p++ = *endptr++; + *p = '\0'; + p = endptr; + + /* write the value out */ + + if (i == 0 || i % ROW_LEN == n % ROW_LEN) + printf(" "); + + printf("%3d", (unsigned char) strtol(val, (char **) NULL, 16)); + + if (i < n - 1) + printf(","); + + if ((i+1) % ROW_LEN == n % ROW_LEN) + printf("\n"); + } + + printf("};\n\n"); +} + +void +print_arrays_for(char *set) +{ + FILE *f; + + sprintf(buf, "%s.conf", set); + + if ((f = fopen(buf, "r")) == NULL) { + fprintf(stderr, "%s: can't read conf file for charset %s\n", prog, set); + exit(EXIT_FAILURE); + } + + printf("\ +/* The %s character set. Generated automatically by configure and\n\ + * the %s program\n\ + */\n\n", + set, prog); + + /* it would be nice if this used the code in mysys/charset.c, but... */ + print_array(f, set, "ctype", CTYPE_TABLE_SIZE); + print_array(f, set, "to_lower", TO_LOWER_TABLE_SIZE); + print_array(f, set, "to_upper", TO_UPPER_TABLE_SIZE); + print_array(f, set, "sort_order", SORT_ORDER_TABLE_SIZE); + printf("\n"); + + fclose(f); + + return; +} diff --git a/externals/mysql/libmysql/errmsg.c b/externals/mysql/libmysql/errmsg.c new file mode 100644 index 00000000000..abdf65322ef --- /dev/null +++ b/externals/mysql/libmysql/errmsg.c @@ -0,0 +1,255 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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 + the Free Software Foundation. + + There are special exceptions to the terms and conditions of the GPL as it + is applied to this software. View the full text of the exception in file + EXCEPTIONS-CLIENT in the directory of this software distribution. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Error messages for MySQL clients */ +/* (Error messages for the daemon are in share/language/errmsg.sys) */ + +#include +#include +#include "errmsg.h" + +#ifdef GERMAN +const char *client_errors[]= +{ + "Unbekannter MySQL Fehler", + "Kann UNIX-Socket nicht anlegen (%d)", + "Keine Verbindung zu lokalem MySQL Server, socket: '%-.100s' (%d)", + "Keine Verbindung zu MySQL Server auf %-.100s (%d)", + "Kann TCP/IP-Socket nicht anlegen (%d)", + "Unbekannter MySQL Server Host (%-.100s) (%d)", + "MySQL Server nicht vorhanden", + "Protokolle ungleich; Server Version = %d, Client Version = %d", + "MySQL client ran out of memory", + "Wrong host info", + "Localhost via UNIX socket", + "%-.100s via TCP/IP", + "Error in server handshake", + "Lost connection to MySQL server during query", + "Commands out of sync; you can't run this command now", + "Verbindung ueber Named Pipe: %-.32s", + "Kann nicht auf Named Pipe warten. Host: %-.64s pipe: %-.32s (%lu)", + "Kann Named Pipe nicht oeffnen. Host: %-.64s pipe: %-.32s (%lu)", + "Kann den Status der Named Pipe nicht setzen. Host: %-.64s pipe: %-.32s (%lu)", + "Can't initialize character set %-.32s (path: %-.100s)", + "Got packet bigger than 'max_allowed_packet' bytes", + "Embedded server", + "Error on SHOW SLAVE STATUS:", + "Error on SHOW SLAVE HOSTS:", + "Error connecting to slave:", + "Error connecting to master:", + "SSL connection error", + "Malformed packet", + "This client library is licensed only for use with MySQL servers having '%s' license", + "Invalid use of null pointer", + "Statement not prepared", + "No data supplied for parameters in prepared statement", + "Data truncated", + "No parameters exist in the statement", + "Invalid parameter number", + "Can't send long data for non-string/non-binary data types (parameter: %d)", + "Using unsupported buffer type: %d (parameter: %d)", + "Shared memory: %-.100s", + "Can't open shared memory; client could not create request event (%lu)", + "Can't open shared memory; no answer event received from server (%lu)", + "Can't open shared memory; server could not allocate file mapping (%lu)", + "Can't open shared memory; server could not get pointer to file mapping (%lu)", + "Can't open shared memory; client could not allocate file mapping (%lu)", + "Can't open shared memory; client could not get pointer to file mapping (%lu)", + "Can't open shared memory; client could not create %s event (%lu)", + "Can't open shared memory; no answer from server (%lu)", + "Can't open shared memory; cannot send request event to server (%lu)", + "Wrong or unknown protocol", + "Invalid connection handle", + "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", + "Row retrieval was canceled by mysql_stmt_close() call", + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "Attempt to read a row while there is no result set associated with the statement", + "This feature is not implemented yet", + "Lost connection to MySQL server at '%s', system error: %d", + "Statement closed indirectly because of a preceeding %s() call", + "The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again", + "This handle is already connected. Use a separate handle for each connection." + "" +}; + +/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ + +#elif defined PORTUGUESE +const char *client_errors[]= +{ + "Erro desconhecido do MySQL", + "Năo pode criar 'UNIX socket' (%d)", + "Năo pode se conectar ao servidor MySQL local através do 'socket' '%-.100s' (%d)", + "Năo pode se conectar ao servidor MySQL em '%-.100s' (%d)", + "Năo pode criar 'socket TCP/IP' (%d)", + "'Host' servidor MySQL '%-.100s' (%d) desconhecido", + "Servidor MySQL desapareceu", + "Incompatibilidade de protocolos; versăo do servidor = %d, versăo do cliente = %d", + "Cliente do MySQL com falta de memória", + "Informaçăo inválida de 'host'", + "Localhost via 'UNIX socket'", + "%-.100s via 'TCP/IP'", + "Erro na negociaçăo de acesso ao servidor", + "Conexăo perdida com servidor MySQL durante 'query'", + "Comandos fora de sincronismo; vocę năo pode executar este comando agora", + "Named pipe: %-.32s", + "Năo pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", + "Năo pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", + "Năo pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", + "Năo pode inicializar conjunto de caracteres %-.32s (caminho %-.100s)", + "Obteve pacote maior do que 'max_allowed_packet' bytes", + "Embedded server" + "Error on SHOW SLAVE STATUS:", + "Error on SHOW SLAVE HOSTS:", + "Error connecting to slave:", + "Error connecting to master:", + "SSL connection error", + "Malformed packet", + "This client library is licensed only for use with MySQL servers having '%s' license", + "Invalid use of null pointer", + "Statement not prepared", + "No data supplied for parameters in prepared statement", + "Data truncated", + "No parameters exist in the statement", + "Invalid parameter number", + "Can't send long data for non-string/non-binary data types (parameter: %d)", + "Using unsupported buffer type: %d (parameter: %d)", + "Shared memory: %-.100s", + "Can't open shared memory; client could not create request event (%lu)", + "Can't open shared memory; no answer event received from server (%lu)", + "Can't open shared memory; server could not allocate file mapping (%lu)", + "Can't open shared memory; server could not get pointer to file mapping (%lu)", + "Can't open shared memory; client could not allocate file mapping (%lu)", + "Can't open shared memory; client could not get pointer to file mapping (%lu)", + "Can't open shared memory; client could not create %s event (%lu)", + "Can't open shared memory; no answer from server (%lu)", + "Can't open shared memory; cannot send request event to server (%lu)", + "Wrong or unknown protocol", + "Invalid connection handle", + "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", + "Row retrieval was canceled by mysql_stmt_close() call", + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "Attempt to read a row while there is no result set associated with the statement", + "This feature is not implemented yet", + "Lost connection to MySQL server at '%s', system error: %d", + "Statement closed indirectly because of a preceeding %s() call", + "The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again", + "This handle is already connected. Use a separate handle for each connection." + "" +}; + +#else /* ENGLISH */ +const char *client_errors[]= +{ + "Unknown MySQL error", + "Can't create UNIX socket (%d)", + "Can't connect to local MySQL server through socket '%-.100s' (%d)", + "Can't connect to MySQL server on '%-.100s' (%d)", + "Can't create TCP/IP socket (%d)", + "Unknown MySQL server host '%-.100s' (%d)", + "MySQL server has gone away", + "Protocol mismatch; server version = %d, client version = %d", + "MySQL client ran out of memory", + "Wrong host info", + "Localhost via UNIX socket", + "%-.100s via TCP/IP", + "Error in server handshake", + "Lost connection to MySQL server during query", + "Commands out of sync; you can't run this command now", + "Named pipe: %-.32s", + "Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)", + "Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)", + "Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)", + "Can't initialize character set %-.32s (path: %-.100s)", + "Got packet bigger than 'max_allowed_packet' bytes", + "Embedded server", + "Error on SHOW SLAVE STATUS:", + "Error on SHOW SLAVE HOSTS:", + "Error connecting to slave:", + "Error connecting to master:", + "SSL connection error", + "Malformed packet", + "This client library is licensed only for use with MySQL servers having '%s' license", + "Invalid use of null pointer", + "Statement not prepared", + "No data supplied for parameters in prepared statement", + "Data truncated", + "No parameters exist in the statement", + "Invalid parameter number", + "Can't send long data for non-string/non-binary data types (parameter: %d)", + "Using unsupported buffer type: %d (parameter: %d)", + "Shared memory: %-.100s", + "Can't open shared memory; client could not create request event (%lu)", + "Can't open shared memory; no answer event received from server (%lu)", + "Can't open shared memory; server could not allocate file mapping (%lu)", + "Can't open shared memory; server could not get pointer to file mapping (%lu)", + "Can't open shared memory; client could not allocate file mapping (%lu)", + "Can't open shared memory; client could not get pointer to file mapping (%lu)", + "Can't open shared memory; client could not create %s event (%lu)", + "Can't open shared memory; no answer from server (%lu)", + "Can't open shared memory; cannot send request event to server (%lu)", + "Wrong or unknown protocol", + "Invalid connection handle", + "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", + "Row retrieval was canceled by mysql_stmt_close() call", + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "Attempt to read a row while there is no result set associated with the statement", + "This feature is not implemented yet", + "Lost connection to MySQL server at '%s', system error: %d", + "Statement closed indirectly because of a preceeding %s() call", + "The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again", + "This handle is already connected. Use a separate handle for each connection." + "" +}; +#endif + + +/* + Register client error messages for use with my_error(). + + SYNOPSIS + init_client_errs() + + RETURN + void +*/ + +void init_client_errs(void) +{ + (void) my_error_register(client_errors, CR_ERROR_FIRST, CR_ERROR_LAST); +} + + +/* + Unregister client error messages. + + SYNOPSIS + finish_client_errs() + + RETURN + void +*/ + +void finish_client_errs(void) +{ + (void) my_error_unregister(CR_ERROR_FIRST, CR_ERROR_LAST); +} diff --git a/externals/mysql/libmysql/get_password.c b/externals/mysql/libmysql/get_password.c new file mode 100644 index 00000000000..cbe5fce6949 --- /dev/null +++ b/externals/mysql/libmysql/get_password.c @@ -0,0 +1,220 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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 + the Free Software Foundation. + + There are special exceptions to the terms and conditions of the GPL as it + is applied to this software. View the full text of the exception in file + EXCEPTIONS-CLIENT in the directory of this software distribution. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* +** Ask for a password from tty +** This is an own file to avoid conflicts with curses +*/ +#include +#include +#include "mysql.h" +#include +#include + +#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE) +#undef HAVE_GETPASS +#endif + +#ifdef HAVE_GETPASS +#ifdef HAVE_PWD_H +#include +#endif /* HAVE_PWD_H */ +#else /* ! HAVE_GETPASS */ +#if !defined(__WIN__) && !defined(__NETWARE__) +#include +#ifdef HAVE_TERMIOS_H /* For tty-password */ +#include +#define TERMIO struct termios +#else +#ifdef HAVE_TERMIO_H /* For tty-password */ +#include +#define TERMIO struct termio +#else +#include +#define TERMIO struct sgttyb +#endif +#endif +#ifdef alpha_linux_port +#include /* QQ; Fix this in configure */ +#include +#endif +#else +#ifndef __NETWARE__ +#include +#endif /* __NETWARE__ */ +#endif /* __WIN__ */ +#endif /* HAVE_GETPASS */ + +#ifdef HAVE_GETPASSPHRASE /* For Solaris */ +#define getpass(A) getpassphrase(A) +#endif + +#if defined( __WIN__) || defined(__NETWARE__) +/* were just going to fake it here and get input from the keyboard */ + +#ifdef __NETWARE__ +#undef _getch +#undef _cputs +#define _getch getcharacter +#define _cputs(A) putstring(A) +#endif + +char *get_tty_password(const char *opt_message) +{ + char to[80]; + char *pos=to,*end=to+sizeof(to)-1; + int i=0; + DBUG_ENTER("get_tty_password"); + _cputs(opt_message ? opt_message : "Enter password: "); + for (;;) + { + char tmp; + tmp=_getch(); + if (tmp == '\b' || (int) tmp == 127) + { + if (pos != to) + { + _cputs("\b \b"); + pos--; + continue; + } + } + if (tmp == '\n' || tmp == '\r' || tmp == 3) + break; + if (iscntrl(tmp) || pos == end) + continue; + _cputs("*"); + *(pos++) = tmp; + } + while (pos != to && isspace(pos[-1]) == ' ') + pos--; /* Allow dummy space at end */ + *pos=0; + _cputs("\n"); + DBUG_RETURN(my_strdup(to,MYF(MY_FAE))); +} + +#else + +#ifndef HAVE_GETPASS +/* + Can't use fgets, because readline will get confused + length is max number of chars in to, not counting \0 + to will not include the eol characters. +*/ + +static void get_password(char *to,uint length,int fd, my_bool echo) +{ + char *pos=to,*end=to+length; + + for (;;) + { + char tmp; + if (my_read(fd,&tmp,1,MYF(0)) != 1) + break; + if (tmp == '\b' || (int) tmp == 127) + { + if (pos != to) + { + if (echo) + { + fputs("\b \b",stdout); + fflush(stdout); + } + pos--; + continue; + } + } + if (tmp == '\n' || tmp == '\r' || tmp == 3) + break; + if (iscntrl(tmp) || pos == end) + continue; + if (echo) + { + fputc('*',stdout); + fflush(stdout); + } + *(pos++) = tmp; + } + while (pos != to && isspace(pos[-1]) == ' ') + pos--; /* Allow dummy space at end */ + *pos=0; + return; +} +#endif /* ! HAVE_GETPASS */ + + +char *get_tty_password(const char *opt_message) +{ +#ifdef HAVE_GETPASS + char *passbuff; +#else /* ! HAVE_GETPASS */ + TERMIO org,tmp; +#endif /* HAVE_GETPASS */ + char buff[80]; + + DBUG_ENTER("get_tty_password"); + +#ifdef HAVE_GETPASS + passbuff = getpass(opt_message ? opt_message : "Enter password: "); + + /* copy the password to buff and clear original (static) buffer */ + strnmov(buff, passbuff, sizeof(buff) - 1); +#ifdef _PASSWORD_LEN + memset(passbuff, 0, _PASSWORD_LEN); +#endif +#else + if (isatty(fileno(stdout))) + { + fputs(opt_message ? opt_message : "Enter password: ",stdout); + fflush(stdout); + } +#if defined(HAVE_TERMIOS_H) + tcgetattr(fileno(stdin), &org); + tmp = org; + tmp.c_lflag &= ~(ECHO | ISIG | ICANON); + tmp.c_cc[VMIN] = 1; + tmp.c_cc[VTIME] = 0; + tcsetattr(fileno(stdin), TCSADRAIN, &tmp); + get_password(buff, sizeof(buff)-1, fileno(stdin), isatty(fileno(stdout))); + tcsetattr(fileno(stdin), TCSADRAIN, &org); +#elif defined(HAVE_TERMIO_H) + ioctl(fileno(stdin), (int) TCGETA, &org); + tmp=org; + tmp.c_lflag &= ~(ECHO | ISIG | ICANON); + tmp.c_cc[VMIN] = 1; + tmp.c_cc[VTIME]= 0; + ioctl(fileno(stdin),(int) TCSETA, &tmp); + get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stdout))); + ioctl(fileno(stdin),(int) TCSETA, &org); +#else + gtty(fileno(stdin), &org); + tmp=org; + tmp.sg_flags &= ~ECHO; + tmp.sg_flags |= RAW; + stty(fileno(stdin), &tmp); + get_password(buff,sizeof(buff)-1,fileno(stdin),isatty(fileno(stdout))); + stty(fileno(stdin), &org); +#endif + if (isatty(fileno(stdout))) + fputc('\n',stdout); +#endif /* HAVE_GETPASS */ + + DBUG_RETURN(my_strdup(buff,MYF(MY_FAE))); +} +#endif /*__WIN__*/ diff --git a/externals/mysql/libmysql/libmysql.c b/externals/mysql/libmysql/libmysql.c new file mode 100644 index 00000000000..299a5677ffe --- /dev/null +++ b/externals/mysql/libmysql/libmysql.c @@ -0,0 +1,4902 @@ +/* Copyright (C) 2000-2004 MySQL AB + + 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 + the Free Software Foundation. + + There are special exceptions to the terms and conditions of the GPL as it + is applied to this software. View the full text of the exception in file + EXCEPTIONS-CLIENT in the directory of this software distribution. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include +#include "mysql.h" +#include "mysql_version.h" +#include "mysqld_error.h" +#include "errmsg.h" +#include +#include +#include +#include +#ifdef HAVE_PWD_H +#include +#endif +#if !defined(MSDOS) && !defined(__WIN__) +#include +#include +#include +#include +#ifdef HAVE_SELECT_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#endif /* !defined(MSDOS) && !defined(__WIN__) */ +#ifdef HAVE_POLL +#include +#endif +#ifdef HAVE_SYS_UN_H +#include +#endif +#if defined(THREAD) && !defined(__WIN__) +#include /* because of signal() */ +#endif +#ifndef INADDR_NONE +#define INADDR_NONE -1 +#endif + +#include +#include "client_settings.h" + +#undef net_buffer_length +#undef max_allowed_packet + +ulong net_buffer_length=8192; +ulong max_allowed_packet= 1024L*1024L*1024L; + + +#ifdef EMBEDDED_LIBRARY +#undef net_flush +my_bool net_flush(NET *net); +#endif + +#if defined(MSDOS) || defined(__WIN__) +/* socket_errno is defined in my_global.h for all platforms */ +#define perror(A) +#else +#include +#define SOCKET_ERROR -1 +#endif /* __WIN__ */ + +/* + If allowed through some configuration, then this needs to + be changed +*/ +#define MAX_LONG_DATA_LENGTH 8192 +#define unsigned_field(A) ((A)->flags & UNSIGNED_FLAG) + +static void append_wild(char *to,char *end,const char *wild); +sig_handler my_pipe_sig_handler(int sig); + +static my_bool mysql_client_init= 0; +static my_bool org_my_init_done= 0; + + +/* + Initialize the MySQL client library + + SYNOPSIS + mysql_server_init() + + NOTES + Should be called before doing any other calls to the MySQL + client library to initialize thread specific variables etc. + It's called by mysql_init() to ensure that things will work for + old not threaded applications that doesn't call mysql_server_init() + directly. + + RETURN + 0 ok + 1 could not initialize environment (out of memory or thread keys) +*/ + +int STDCALL mysql_server_init(int argc __attribute__((unused)), + char **argv __attribute__((unused)), + char **groups __attribute__((unused))) +{ + int result= 0; + if (!mysql_client_init) + { + mysql_client_init=1; + org_my_init_done=my_init_done; + if (my_init()) /* Will init threads */ + return 1; + init_client_errs(); + if (!mysql_port) + { + mysql_port = MYSQL_PORT; +#ifndef MSDOS + { + struct servent *serv_ptr; + char *env; + + /* + if builder specifically requested a default port, use that + (even if it coincides with our factory default). + only if they didn't do we check /etc/services (and, failing + on that, fall back to the factory default of 3306). + either default can be overridden by the environment variable + MYSQL_TCP_PORT, which in turn can be overridden with command + line options. + */ + +#if MYSQL_PORT_DEFAULT == 0 + if ((serv_ptr = getservbyname("mysql", "tcp"))) + mysql_port = (uint) ntohs((ushort) serv_ptr->s_port); +#endif + if ((env = getenv("MYSQL_TCP_PORT"))) + mysql_port =(uint) atoi(env); + } +#endif + } + if (!mysql_unix_port) + { + char *env; +#ifdef __WIN__ + mysql_unix_port = (char*) MYSQL_NAMEDPIPE; +#else + mysql_unix_port = (char*) MYSQL_UNIX_ADDR; +#endif + if ((env = getenv("MYSQL_UNIX_PORT"))) + mysql_unix_port = env; + } + mysql_debug(NullS); +#if defined(SIGPIPE) && !defined(__WIN__) && !defined(__NETWARE__) + (void) signal(SIGPIPE, SIG_IGN); +#endif +#ifdef EMBEDDED_LIBRARY + if (argc > -1) + result= init_embedded_server(argc, argv, groups); +#endif + } +#ifdef THREAD + else + result= (int)my_thread_init(); /* Init if new thread */ +#endif + return result; +} + + +/* + Free all memory and resources used by the client library + + NOTES + When calling this there should not be any other threads using + the library. + + To make things simpler when used with windows dll's (which calls this + function automaticly), it's safe to call this function multiple times. +*/ + + +void STDCALL mysql_server_end() +{ + if (!mysql_client_init) + return; + +#ifdef EMBEDDED_LIBRARY + end_embedded_server(); +#endif + finish_client_errs(); + vio_end(); + + /* If library called my_init(), free memory allocated by it */ + if (!org_my_init_done) + { + my_end(0); + } + else + { + free_charsets(); + mysql_thread_end(); + } + + mysql_client_init= org_my_init_done= 0; +#ifdef EMBEDDED_SERVER + if (stderror_file) + { + fclose(stderror_file); + stderror_file= 0; + } +#endif +} + +static MYSQL_PARAMETERS mysql_internal_parameters= +{&max_allowed_packet, &net_buffer_length, 0}; + +MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void) +{ + return &mysql_internal_parameters; +} + +my_bool STDCALL mysql_thread_init() +{ +#ifdef THREAD + return my_thread_init(); +#else + return 0; +#endif +} + +void STDCALL mysql_thread_end() +{ +#ifdef THREAD + my_thread_end(); +#endif +} + + +/* + Expand wildcard to a sql string +*/ + +static void +append_wild(char *to, char *end, const char *wild) +{ + end-=5; /* Some extra */ + if (wild && wild[0]) + { + to=strmov(to," like '"); + while (*wild && to < end) + { + if (*wild == '\\' || *wild == '\'') + *to++='\\'; + *to++= *wild++; + } + if (*wild) /* Too small buffer */ + *to++='%'; /* Nicer this way */ + to[0]='\''; + to[1]=0; + } +} + + +/************************************************************************** + Init debugging if MYSQL_DEBUG environment variable is found +**************************************************************************/ + +void STDCALL +mysql_debug(const char *debug __attribute__((unused))) +{ +#ifndef DBUG_OFF + char *env; + if (debug) + { + DBUG_PUSH(debug); + } + else if ((env = getenv("MYSQL_DEBUG"))) + { + DBUG_PUSH(env); +#if !defined(_WINVER) && !defined(WINVER) + puts("\n-------------------------------------------------------"); + puts("MYSQL_DEBUG found. libmysql started with the following:"); + puts(env); + puts("-------------------------------------------------------\n"); +#else + { + char buff[80]; + buff[sizeof(buff)-1]= 0; + strxnmov(buff,sizeof(buff)-1,"libmysql: ", env, NullS); + MessageBox((HWND) 0,"Debugging variable MYSQL_DEBUG used",buff,MB_OK); + } +#endif + } +#endif +} + + +/************************************************************************** + Ignore SIGPIPE handler + ARGSUSED +**************************************************************************/ + +sig_handler +my_pipe_sig_handler(int sig __attribute__((unused))) +{ + DBUG_PRINT("info",("Hit by signal %d",sig)); +#ifdef DONT_REMEMBER_SIGNAL + (void) signal(SIGPIPE, my_pipe_sig_handler); +#endif +} + + +/************************************************************************** + Connect to sql server + If host == 0 then use localhost +**************************************************************************/ + +#ifdef USE_OLD_FUNCTIONS +MYSQL * STDCALL +mysql_connect(MYSQL *mysql,const char *host, + const char *user, const char *passwd) +{ + MYSQL *res; + mysql=mysql_init(mysql); /* Make it thread safe */ + { + DBUG_ENTER("mysql_connect"); + if (!(res=mysql_real_connect(mysql,host,user,passwd,NullS,0,NullS,0))) + { + if (mysql->free_me) + my_free((uchar*) mysql,MYF(0)); + } + mysql->reconnect= 1; + DBUG_RETURN(res); + } +} +#endif + + +/************************************************************************** + Change user and database +**************************************************************************/ + +int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd) +{ + NET *net= &mysql->net; + ulong pkt_length; + + pkt_length= cli_safe_read(mysql); + + if (pkt_length == packet_error) + return 1; + + if (pkt_length == 1 && net->read_pos[0] == 254 && + mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + /* + By sending this very specific reply server asks us to send scrambled + password in old format. The reply contains scramble_323. + */ + scramble_323(buff, mysql->scramble, passwd); + if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) || + net_flush(net)) + { + set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate); + return 1; + } + /* Read what server thinks about out new auth message report */ + if (cli_safe_read(mysql) == packet_error) + return 1; + } + return 0; +} + +my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, + const char *passwd, const char *db) +{ + char buff[USERNAME_LENGTH+SCRAMBLED_PASSWORD_CHAR_LENGTH+NAME_LEN+2]; + char *end= buff; + int rc; + CHARSET_INFO *saved_cs= mysql->charset; + + DBUG_ENTER("mysql_change_user"); + + /* Get the connection-default character set. */ + + if (mysql_init_character_set(mysql)) + { + mysql->charset= saved_cs; + DBUG_RETURN(TRUE); + } + + /* Use an empty string instead of NULL. */ + + if (!user) + user=""; + if (!passwd) + passwd=""; + + /* Store user into the buffer */ + end= strmake(end, user, USERNAME_LENGTH) + 1; + + /* write scrambled password according to server capabilities */ + if (passwd[0]) + { + if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + *end++= SCRAMBLE_LENGTH; + scramble(end, mysql->scramble, passwd); + end+= SCRAMBLE_LENGTH; + } + else + { + scramble_323(end, mysql->scramble, passwd); + end+= SCRAMBLE_LENGTH_323 + 1; + } + } + else + *end++= '\0'; /* empty password */ + /* Add database if needed */ + end= strmake(end, db ? db : "", NAME_LEN) + 1; + + /* Add character set number. */ + + if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + /* + Character set 45 (4-byte UTF-8) is not available on servers + before version 6.0, so we need to go ahead and switch to utf8_mb3. + */ + if (mysql->charset->number == 45 && mysql->server_version[0] < '6') + int2store(end, 33); + else + int2store(end, (ushort) mysql->charset->number); + end+= 2; + } + + /* Write authentication package */ + simple_command(mysql,COM_CHANGE_USER, (uchar*) buff, (ulong) (end-buff), 1); + + rc= (*mysql->methods->read_change_user_result)(mysql, buff, passwd); + + /* + The server will close all statements no matter was the attempt + to change user successful or not. + */ + mysql_detach_stmt_list(&mysql->stmts, "mysql_change_user"); + if (rc == 0) + { + /* Free old connect information */ + my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); + + /* alloc new connect information */ + mysql->user= my_strdup(user,MYF(MY_WME)); + mysql->passwd=my_strdup(passwd,MYF(MY_WME)); + mysql->db= db ? my_strdup(db,MYF(MY_WME)) : 0; + } + else + { + mysql->charset= saved_cs; + } + + DBUG_RETURN(rc); +} + +#if defined(HAVE_GETPWUID) && defined(NO_GETPWUID_DECL) +struct passwd *getpwuid(uid_t); +char* getlogin(void); +#endif + +#if defined(__NETWARE__) +/* Default to value of USER on NetWare, if unset use "UNKNOWN_USER" */ +void read_user_name(char *name) +{ + char *str=getenv("USER"); + strmake(name, str ? str : "UNKNOWN_USER", USERNAME_LENGTH); +} + +#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) + +void read_user_name(char *name) +{ + DBUG_ENTER("read_user_name"); + if (geteuid() == 0) + (void) strmov(name,"root"); /* allow use of surun */ + else + { +#ifdef HAVE_GETPWUID + struct passwd *skr; + const char *str; + if ((str=getlogin()) == NULL) + { + if ((skr=getpwuid(geteuid())) != NULL) + str=skr->pw_name; + else if (!(str=getenv("USER")) && !(str=getenv("LOGNAME")) && + !(str=getenv("LOGIN"))) + str="UNKNOWN_USER"; + } + (void) strmake(name,str,USERNAME_LENGTH); +#elif HAVE_CUSERID + (void) cuserid(name); +#else + strmov(name,"UNKNOWN_USER"); +#endif + } + DBUG_VOID_RETURN; +} + +#else /* If MSDOS || VMS */ + +void read_user_name(char *name) +{ + char *str=getenv("USER"); /* ODBC will send user variable */ + strmake(name,str ? str : "ODBC", USERNAME_LENGTH); +} + +#endif + +my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) +{ + my_bool result= 1; + uint packet_length=MY_ALIGN(mysql->net.max_packet-16,IO_SIZE); + NET *net= &mysql->net; + int readcount; + void *li_ptr; /* pass state to local_infile functions */ + char *buf; /* buffer to be filled by local_infile_read */ + struct st_mysql_options *options= &mysql->options; + DBUG_ENTER("handle_local_infile"); + + /* check that we've got valid callback functions */ + if (!(options->local_infile_init && + options->local_infile_read && + options->local_infile_end && + options->local_infile_error)) + { + /* if any of the functions is invalid, set the default */ + mysql_set_local_infile_default(mysql); + } + + /* copy filename into local memory and allocate read buffer */ + if (!(buf=my_malloc(packet_length, MYF(0)))) + { + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(1); + } + + /* initialize local infile (open file, usually) */ + if ((*options->local_infile_init)(&li_ptr, net_filename, + options->local_infile_userdata)) + { + (void) my_net_write(net,(const uchar*) "",0); /* Server needs one packet */ + net_flush(net); + strmov(net->sqlstate, unknown_sqlstate); + net->last_errno= + (*options->local_infile_error)(li_ptr, + net->last_error, + sizeof(net->last_error)-1); + goto err; + } + + /* read blocks of data from local infile callback */ + while ((readcount = + (*options->local_infile_read)(li_ptr, buf, + packet_length)) > 0) + { + if (my_net_write(net, (uchar*) buf, readcount)) + { + DBUG_PRINT("error", + ("Lost connection to MySQL server during LOAD DATA of local file")); + set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate); + goto err; + } + } + + /* Send empty packet to mark end of file */ + if (my_net_write(net, (const uchar*) "", 0) || net_flush(net)) + { + set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate); + goto err; + } + + if (readcount < 0) + { + net->last_errno= + (*options->local_infile_error)(li_ptr, + net->last_error, + sizeof(net->last_error)-1); + goto err; + } + + result=0; /* Ok */ + +err: + /* free up memory allocated with _init, usually */ + (*options->local_infile_end)(li_ptr); + my_free(buf, MYF(0)); + DBUG_RETURN(result); +} + + +/**************************************************************************** + Default handlers for LOAD LOCAL INFILE +****************************************************************************/ + +typedef struct st_default_local_infile +{ + int fd; + int error_num; + const char *filename; + char error_msg[LOCAL_INFILE_ERROR_LEN]; +} default_local_infile_data; + + +/* + Open file for LOAD LOCAL INFILE + + SYNOPSIS + default_local_infile_init() + ptr Store pointer to internal data here + filename File name to open. This may be in unix format ! + + + NOTES + Even if this function returns an error, the load data interface + guarantees that default_local_infile_end() is called. + + RETURN + 0 ok + 1 error +*/ + +static int default_local_infile_init(void **ptr, const char *filename, + void *userdata __attribute__ ((unused))) +{ + default_local_infile_data *data; + char tmp_name[FN_REFLEN]; + + if (!(*ptr= data= ((default_local_infile_data *) + my_malloc(sizeof(default_local_infile_data), MYF(0))))) + return 1; /* out of memory */ + + data->error_msg[0]= 0; + data->error_num= 0; + data->filename= filename; + + fn_format(tmp_name, filename, "", "", MY_UNPACK_FILENAME); + if ((data->fd = my_open(tmp_name, O_RDONLY, MYF(0))) < 0) + { + data->error_num= my_errno; + my_snprintf(data->error_msg, sizeof(data->error_msg)-1, + EE(EE_FILENOTFOUND), tmp_name, data->error_num); + return 1; + } + return 0; /* ok */ +} + + +/* + Read data for LOAD LOCAL INFILE + + SYNOPSIS + default_local_infile_read() + ptr Points to handle allocated by _init + buf Read data here + buf_len Ammount of data to read + + RETURN + > 0 number of bytes read + == 0 End of data + < 0 Error +*/ + +static int default_local_infile_read(void *ptr, char *buf, uint buf_len) +{ + int count; + default_local_infile_data*data = (default_local_infile_data *) ptr; + + if ((count= (int) my_read(data->fd, (uchar *) buf, buf_len, MYF(0))) < 0) + { + data->error_num= EE_READ; /* the errmsg for not entire file read */ + my_snprintf(data->error_msg, sizeof(data->error_msg)-1, + EE(EE_READ), + data->filename, my_errno); + } + return count; +} + + +/* + Read data for LOAD LOCAL INFILE + + SYNOPSIS + default_local_infile_end() + ptr Points to handle allocated by _init + May be NULL if _init failed! + + RETURN +*/ + +static void default_local_infile_end(void *ptr) +{ + default_local_infile_data *data= (default_local_infile_data *) ptr; + if (data) /* If not error on open */ + { + if (data->fd >= 0) + my_close(data->fd, MYF(MY_WME)); + my_free(ptr, MYF(MY_WME)); + } +} + + +/* + Return error from LOAD LOCAL INFILE + + SYNOPSIS + default_local_infile_end() + ptr Points to handle allocated by _init + May be NULL if _init failed! + error_msg Store error text here + error_msg_len Max lenght of error_msg + + RETURN + error message number +*/ + +static int +default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len) +{ + default_local_infile_data *data = (default_local_infile_data *) ptr; + if (data) /* If not error on open */ + { + strmake(error_msg, data->error_msg, error_msg_len); + return data->error_num; + } + /* This can only happen if we got error on malloc of handle */ + strmov(error_msg, ER(CR_OUT_OF_MEMORY)); + return CR_OUT_OF_MEMORY; +} + + +void +mysql_set_local_infile_handler(MYSQL *mysql, + int (*local_infile_init)(void **, const char *, + void *), + int (*local_infile_read)(void *, char *, uint), + void (*local_infile_end)(void *), + int (*local_infile_error)(void *, char *, uint), + void *userdata) +{ + mysql->options.local_infile_init= local_infile_init; + mysql->options.local_infile_read= local_infile_read; + mysql->options.local_infile_end= local_infile_end; + mysql->options.local_infile_error= local_infile_error; + mysql->options.local_infile_userdata = userdata; +} + + +void mysql_set_local_infile_default(MYSQL *mysql) +{ + mysql->options.local_infile_init= default_local_infile_init; + mysql->options.local_infile_read= default_local_infile_read; + mysql->options.local_infile_end= default_local_infile_end; + mysql->options.local_infile_error= default_local_infile_error; +} + + +/************************************************************************** + Do a query. If query returned rows, free old rows. + Read data by mysql_store_result or by repeat call of mysql_fetch_row +**************************************************************************/ + +int STDCALL +mysql_query(MYSQL *mysql, const char *query) +{ + return mysql_real_query(mysql,query, (uint) strlen(query)); +} + + +/************************************************************************** + Return next field of the query results +**************************************************************************/ + +MYSQL_FIELD * STDCALL +mysql_fetch_field(MYSQL_RES *result) +{ + if (result->current_field >= result->field_count) + return(NULL); + return &result->fields[result->current_field++]; +} + + +/************************************************************************** + Move to a specific row and column +**************************************************************************/ + +void STDCALL +mysql_data_seek(MYSQL_RES *result, my_ulonglong row) +{ + MYSQL_ROWS *tmp=0; + DBUG_PRINT("info",("mysql_data_seek(%ld)",(long) row)); + if (result->data) + for (tmp=result->data->data; row-- && tmp ; tmp = tmp->next) ; + result->current_row=0; + result->data_cursor = tmp; +} + + +/************************************************************************* + put the row or field cursor one a position one got from mysql_row_tell() + This doesn't restore any data. The next mysql_fetch_row or + mysql_fetch_field will return the next row or field after the last used +*************************************************************************/ + +MYSQL_ROW_OFFSET STDCALL +mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row) +{ + MYSQL_ROW_OFFSET return_value=result->data_cursor; + result->current_row= 0; + result->data_cursor= row; + return return_value; +} + + +MYSQL_FIELD_OFFSET STDCALL +mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset) +{ + MYSQL_FIELD_OFFSET return_value=result->current_field; + result->current_field=field_offset; + return return_value; +} + + +/***************************************************************************** + List all databases +*****************************************************************************/ + +MYSQL_RES * STDCALL +mysql_list_dbs(MYSQL *mysql, const char *wild) +{ + char buff[255]; + DBUG_ENTER("mysql_list_dbs"); + + append_wild(strmov(buff,"show databases"),buff+sizeof(buff),wild); + if (mysql_query(mysql,buff)) + DBUG_RETURN(0); + DBUG_RETURN (mysql_store_result(mysql)); +} + + +/***************************************************************************** + List all tables in a database + If wild is given then only the tables matching wild is returned +*****************************************************************************/ + +MYSQL_RES * STDCALL +mysql_list_tables(MYSQL *mysql, const char *wild) +{ + char buff[255]; + DBUG_ENTER("mysql_list_tables"); + + append_wild(strmov(buff,"show tables"),buff+sizeof(buff),wild); + if (mysql_query(mysql,buff)) + DBUG_RETURN(0); + DBUG_RETURN (mysql_store_result(mysql)); +} + + +MYSQL_FIELD *cli_list_fields(MYSQL *mysql) +{ + MYSQL_DATA *query; + if (!(query= cli_read_rows(mysql,(MYSQL_FIELD*) 0, + protocol_41(mysql) ? 8 : 6))) + return NULL; + + mysql->field_count= (uint) query->rows; + return unpack_fields(query,&mysql->field_alloc, + mysql->field_count, 1, mysql->server_capabilities); +} + + +/************************************************************************** + List all fields in a table + If wild is given then only the fields matching wild is returned + Instead of this use query: + show fields in 'table' like "wild" +**************************************************************************/ + +MYSQL_RES * STDCALL +mysql_list_fields(MYSQL *mysql, const char *table, const char *wild) +{ + MYSQL_RES *result; + MYSQL_FIELD *fields; + char buff[257],*end; + DBUG_ENTER("mysql_list_fields"); + DBUG_PRINT("enter",("table: '%s' wild: '%s'",table,wild ? wild : "")); + + end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128); + free_old_query(mysql); + if (simple_command(mysql, COM_FIELD_LIST, (uchar*) buff, + (ulong) (end-buff), 1) || + !(fields= (*mysql->methods->list_fields)(mysql))) + DBUG_RETURN(NULL); + + if (!(result = (MYSQL_RES *) my_malloc(sizeof(MYSQL_RES), + MYF(MY_WME | MY_ZEROFILL)))) + DBUG_RETURN(NULL); + + result->methods= mysql->methods; + result->field_alloc=mysql->field_alloc; + mysql->fields=0; + result->field_count = mysql->field_count; + result->fields= fields; + result->eof=1; + DBUG_RETURN(result); +} + +/* List all running processes (threads) in server */ + +MYSQL_RES * STDCALL +mysql_list_processes(MYSQL *mysql) +{ + MYSQL_DATA *fields; + uint field_count; + uchar *pos; + DBUG_ENTER("mysql_list_processes"); + + LINT_INIT(fields); + if (simple_command(mysql,COM_PROCESS_INFO,0,0,0)) + DBUG_RETURN(0); + free_old_query(mysql); + pos=(uchar*) mysql->net.read_pos; + field_count=(uint) net_field_length(&pos); + if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0, + protocol_41(mysql) ? 7 : 5))) + DBUG_RETURN(NULL); + if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, + mysql->server_capabilities))) + DBUG_RETURN(0); + mysql->status=MYSQL_STATUS_GET_RESULT; + mysql->field_count=field_count; + DBUG_RETURN(mysql_store_result(mysql)); +} + + +#ifdef USE_OLD_FUNCTIONS +int STDCALL +mysql_create_db(MYSQL *mysql, const char *db) +{ + DBUG_ENTER("mysql_createdb"); + DBUG_PRINT("enter",("db: %s",db)); + DBUG_RETURN(simple_command(mysql,COM_CREATE_DB,db, (ulong) strlen(db),0)); +} + + +int STDCALL +mysql_drop_db(MYSQL *mysql, const char *db) +{ + DBUG_ENTER("mysql_drop_db"); + DBUG_PRINT("enter",("db: %s",db)); + DBUG_RETURN(simple_command(mysql,COM_DROP_DB,db,(ulong) strlen(db),0)); +} +#endif + + +int STDCALL +mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level) +{ + uchar level[1]; + DBUG_ENTER("mysql_shutdown"); + level[0]= (uchar) shutdown_level; + DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, level, 1, 0)); +} + + +int STDCALL +mysql_refresh(MYSQL *mysql,uint options) +{ + uchar bits[1]; + DBUG_ENTER("mysql_refresh"); + bits[0]= (uchar) options; + DBUG_RETURN(simple_command(mysql, COM_REFRESH, bits, 1, 0)); +} + + +int STDCALL +mysql_kill(MYSQL *mysql,ulong pid) +{ + uchar buff[4]; + DBUG_ENTER("mysql_kill"); + int4store(buff,pid); + DBUG_RETURN(simple_command(mysql,COM_PROCESS_KILL,buff,sizeof(buff),0)); +} + + +int STDCALL +mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option) +{ + uchar buff[2]; + DBUG_ENTER("mysql_set_server_option"); + int2store(buff, (uint) option); + DBUG_RETURN(simple_command(mysql, COM_SET_OPTION, buff, sizeof(buff), 0)); +} + + +int STDCALL +mysql_dump_debug_info(MYSQL *mysql) +{ + DBUG_ENTER("mysql_dump_debug_info"); + DBUG_RETURN(simple_command(mysql,COM_DEBUG,0,0,0)); +} + + +const char *cli_read_statistics(MYSQL *mysql) +{ + mysql->net.read_pos[mysql->packet_length]=0; /* End of stat string */ + if (!mysql->net.read_pos[0]) + { + set_mysql_error(mysql, CR_WRONG_HOST_INFO, unknown_sqlstate); + return mysql->net.last_error; + } + return (char*) mysql->net.read_pos; +} + + +const char * STDCALL +mysql_stat(MYSQL *mysql) +{ + DBUG_ENTER("mysql_stat"); + if (simple_command(mysql,COM_STATISTICS,0,0,0)) + DBUG_RETURN(mysql->net.last_error); + DBUG_RETURN((*mysql->methods->read_statistics)(mysql)); +} + + +int STDCALL +mysql_ping(MYSQL *mysql) +{ + int res; + DBUG_ENTER("mysql_ping"); + res= simple_command(mysql,COM_PING,0,0,0); + if (res == CR_SERVER_LOST && mysql->reconnect) + res= simple_command(mysql,COM_PING,0,0,0); + DBUG_RETURN(res); +} + + +const char * STDCALL +mysql_get_server_info(MYSQL *mysql) +{ + return((char*) mysql->server_version); +} + + +const char * STDCALL +mysql_get_host_info(MYSQL *mysql) +{ + return(mysql->host_info); +} + + +uint STDCALL +mysql_get_proto_info(MYSQL *mysql) +{ + return (mysql->protocol_version); +} + +const char * STDCALL +mysql_get_client_info(void) +{ + return (char*) MYSQL_SERVER_VERSION; +} + +ulong STDCALL mysql_get_client_version(void) +{ + return MYSQL_VERSION_ID; +} + +my_bool STDCALL mysql_eof(MYSQL_RES *res) +{ + return res->eof; +} + +MYSQL_FIELD * STDCALL mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr) +{ + return &(res)->fields[fieldnr]; +} + +MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res) +{ + return (res)->fields; +} + +MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res) +{ + return res->data_cursor; +} + +MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res) +{ + return (res)->current_field; +} + +/* MYSQL */ + +unsigned int STDCALL mysql_field_count(MYSQL *mysql) +{ + return mysql->field_count; +} + +my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql) +{ + return mysql->affected_rows; +} + +my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql) +{ + return mysql->insert_id; +} + +const char *STDCALL mysql_sqlstate(MYSQL *mysql) +{ + return mysql ? mysql->net.sqlstate : cant_connect_sqlstate; +} + +uint STDCALL mysql_warning_count(MYSQL *mysql) +{ + return mysql->warning_count; +} + +const char *STDCALL mysql_info(MYSQL *mysql) +{ + return mysql->info; +} + +ulong STDCALL mysql_thread_id(MYSQL *mysql) +{ + return (mysql)->thread_id; +} + +const char * STDCALL mysql_character_set_name(MYSQL *mysql) +{ + return mysql->charset->csname; +} + +void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo) +{ + csinfo->number = mysql->charset->number; + csinfo->state = mysql->charset->state; + csinfo->csname = mysql->charset->csname; + csinfo->name = mysql->charset->name; + csinfo->comment = mysql->charset->comment; + csinfo->mbminlen = mysql->charset->mbminlen; + csinfo->mbmaxlen = mysql->charset->mbmaxlen; + + if (mysql->options.charset_dir) + csinfo->dir = mysql->options.charset_dir; + else + csinfo->dir = charsets_dir; +} + +uint STDCALL mysql_thread_safe(void) +{ +#ifdef THREAD + return 1; +#else + return 0; +#endif +} + + +my_bool STDCALL mysql_embedded(void) +{ +#ifdef EMBEDDED_LIBRARY + return 1; +#else + return 0; +#endif +} + +/**************************************************************************** + Some support functions +****************************************************************************/ + +/* + Functions called my my_net_init() to set some application specific variables +*/ + +void my_net_local_init(NET *net) +{ + net->max_packet= (uint) net_buffer_length; + my_net_set_read_timeout(net, CLIENT_NET_READ_TIMEOUT); + my_net_set_write_timeout(net, CLIENT_NET_WRITE_TIMEOUT); + net->retry_count= 1; + net->max_packet_size= max(net_buffer_length, max_allowed_packet); +} + +/* + This function is used to create HEX string that you + can use in a SQL statement in of the either ways: + INSERT INTO blob_column VALUES (0xAABBCC); (any MySQL version) + INSERT INTO blob_column VALUES (X'AABBCC'); (4.1 and higher) + + The string in "from" is encoded to a HEX string. + The result is placed in "to" and a terminating null byte is appended. + + The string pointed to by "from" must be "length" bytes long. + You must allocate the "to" buffer to be at least length*2+1 bytes long. + Each character needs two bytes, and you need room for the terminating + null byte. When mysql_hex_string() returns, the contents of "to" will + be a null-terminated string. The return value is the length of the + encoded string, not including the terminating null character. + + The return value does not contain any leading 0x or a leading X' and + trailing '. The caller must supply whichever of those is desired. +*/ + +ulong STDCALL +mysql_hex_string(char *to, const char *from, ulong length) +{ + char *to0= to; + const char *end; + + for (end= from + length; from < end; from++) + { + *to++= _dig_vec_upper[((unsigned char) *from) >> 4]; + *to++= _dig_vec_upper[((unsigned char) *from) & 0x0F]; + } + *to= '\0'; + return (ulong) (to-to0); +} + +/* + Add escape characters to a string (blob?) to make it suitable for a insert + to should at least have place for length*2+1 chars + Returns the length of the to string +*/ + +ulong STDCALL +mysql_escape_string(char *to,const char *from,ulong length) +{ + return escape_string_for_mysql(default_charset_info, to, 0, from, length); +} + +ulong STDCALL +mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, + ulong length) +{ + if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) + return escape_quotes_for_mysql(mysql->charset, to, 0, from, length); + return escape_string_for_mysql(mysql->charset, to, 0, from, length); +} + +void STDCALL +myodbc_remove_escape(MYSQL *mysql,char *name) +{ + char *to; +#ifdef USE_MB + my_bool use_mb_flag=use_mb(mysql->charset); + char *end; + LINT_INIT(end); + if (use_mb_flag) + for (end=name; *end ; end++) ; +#endif + + for (to=name ; *name ; name++) + { +#ifdef USE_MB + int l; + if (use_mb_flag && (l = my_ismbchar( mysql->charset, name , end ) ) ) + { + while (l--) + *to++ = *name++; + name--; + continue; + } +#endif + if (*name == '\\' && name[1]) + name++; + *to++= *name; + } + *to=0; +} + +/******************************************************************** + Implementation of new client API for 4.1 version. + + mysql_stmt_* are real prototypes used by applications. + + To make API work in embedded library all functions performing + real I/O are prefixed with 'cli_' (abbreviated from 'Call Level + Interface'). This functions are invoked via pointers set in + MYSQL::methods structure. Embedded counterparts, prefixed with + 'emb_' reside in libmysqld/lib_sql.cc. +*********************************************************************/ + +/******************* Declarations ***********************************/ + +/* Default number of rows fetched per one COM_STMT_FETCH command. */ + +#define DEFAULT_PREFETCH_ROWS (ulong) 1 + +/* + These functions are called by function pointer MYSQL_STMT::read_row_func. + Each function corresponds to one of the read methods: + - mysql_stmt_fetch without prior mysql_stmt_store_result, + - mysql_stmt_fetch when result is stored, + - mysql_stmt_fetch when there are no rows (always returns MYSQL_NO_DATA) +*/ + +static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row); +static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row); +static int stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row); +static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row); +static int stmt_read_row_no_result_set(MYSQL_STMT *stmt, unsigned char **row); + +/* + This function is used in mysql_stmt_store_result if + STMT_ATTR_UPDATE_MAX_LENGTH attribute is set. +*/ +static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); +static my_bool setup_one_fetch_function(MYSQL_BIND *, MYSQL_FIELD *field); + +/* Auxilary function used to reset statement handle. */ + +#define RESET_SERVER_SIDE 1 +#define RESET_LONG_DATA 2 +#define RESET_STORE_RESULT 4 +#define RESET_CLEAR_ERROR 8 + +static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags); + +/* + Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME + values stored in network buffer. +*/ + +/* 1 (length) + 2 (year) + 1 (month) + 1 (day) */ +#define MAX_DATE_REP_LENGTH 5 + +/* + 1 (length) + 1 (is negative) + 4 (day count) + 1 (hour) + + 1 (minute) + 1 (seconds) + 4 (microseconds) +*/ +#define MAX_TIME_REP_LENGTH 13 + +/* + 1 (length) + 2 (year) + 1 (month) + 1 (day) + + 1 (hour) + 1 (minute) + 1 (second) + 4 (microseconds) +*/ +#define MAX_DATETIME_REP_LENGTH 12 + +#define MAX_DOUBLE_STRING_REP_LENGTH 331 + +/* A macro to check truncation errors */ + +#define IS_TRUNCATED(value, is_unsigned, min, max, umax) \ + ((is_unsigned) ? (((value) > (umax) || (value) < 0) ? 1 : 0) : \ + (((value) > (max) || (value) < (min)) ? 1 : 0)) + +#define BIND_RESULT_DONE 1 +/* + We report truncations only if at least one of MYSQL_BIND::error + pointers is set. In this case stmt->bind_result_done |-ed with + this flag. +*/ +#define REPORT_DATA_TRUNCATION 2 + +/**************** Misc utility functions ****************************/ + +/* + Reallocate the NET package to have at least length bytes available. + + SYNPOSIS + my_realloc_str() + net The NET structure to modify. + length Ensure that net->buff has space for at least + this number of bytes. + + RETURN VALUES + 0 Success. + 1 Error, i.e. out of memory or requested packet size is bigger + than max_allowed_packet. The error code is stored in net->last_errno. +*/ + +static my_bool my_realloc_str(NET *net, ulong length) +{ + ulong buf_length= (ulong) (net->write_pos - net->buff); + my_bool res=0; + DBUG_ENTER("my_realloc_str"); + if (buf_length + length > net->max_packet) + { + res= net_realloc(net, buf_length + length); + if (res) + { + strmov(net->sqlstate, unknown_sqlstate); + strmov(net->last_error, ER(net->last_errno)); + } + net->write_pos= net->buff+ buf_length; + } + DBUG_RETURN(res); +} + + +static void stmt_clear_error(MYSQL_STMT *stmt) +{ + if (stmt->last_errno) + { + stmt->last_errno= 0; + stmt->last_error[0]= '\0'; + strmov(stmt->sqlstate, not_error_sqlstate); + } +} + +/** + Set statement error code, sqlstate, and error message + from given errcode and sqlstate. +*/ + +void set_stmt_error(MYSQL_STMT * stmt, int errcode, + const char *sqlstate, const char *err) +{ + DBUG_ENTER("set_stmt_error"); + DBUG_PRINT("enter", ("error: %d '%s'", errcode, ER(errcode))); + DBUG_ASSERT(stmt != 0); + + if (err == 0) + err= ER(errcode); + + stmt->last_errno= errcode; + strmov(stmt->last_error, ER(errcode)); + strmov(stmt->sqlstate, sqlstate); + + DBUG_VOID_RETURN; +} + + +/** + Set statement error code, sqlstate, and error message from NET. + + @param stmt a statement handle. Copy the error here. + @param net mysql->net. Source of the error. +*/ + +void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net) +{ + DBUG_ENTER("set_stmt_errmsg"); + DBUG_PRINT("enter", ("error: %d/%s '%s'", + net->last_errno, + net->sqlstate, + net->last_error)); + DBUG_ASSERT(stmt != 0); + + stmt->last_errno= net->last_errno; + if (net->last_error && net->last_error[0]) + strmov(stmt->last_error, net->last_error); + strmov(stmt->sqlstate, net->sqlstate); + + DBUG_VOID_RETURN; +} + +/* + Read and unpack server reply to COM_STMT_PREPARE command (sent from + mysql_stmt_prepare). + + SYNOPSIS + cli_read_prepare_result() + mysql connection handle + stmt statement handle + + RETURN VALUES + 0 ok + 1 error +*/ + +my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) +{ + uchar *pos; + uint field_count, param_count; + ulong packet_length; + MYSQL_DATA *fields_data; + DBUG_ENTER("cli_read_prepare_result"); + + if ((packet_length= cli_safe_read(mysql)) == packet_error) + DBUG_RETURN(1); + mysql->warning_count= 0; + + pos= (uchar*) mysql->net.read_pos; + stmt->stmt_id= uint4korr(pos+1); pos+= 5; + /* Number of columns in result set */ + field_count= uint2korr(pos); pos+= 2; + /* Number of placeholders in the statement */ + param_count= uint2korr(pos); pos+= 2; + if (packet_length >= 12) + mysql->warning_count= uint2korr(pos+1); + + if (param_count != 0) + { + MYSQL_DATA *param_data; + + /* skip parameters data: we don't support it yet */ + if (!(param_data= (*mysql->methods->read_rows)(mysql, (MYSQL_FIELD*)0, 7))) + DBUG_RETURN(1); + free_rows(param_data); + } + + if (field_count != 0) + { + if (!(mysql->server_status & SERVER_STATUS_AUTOCOMMIT)) + mysql->server_status|= SERVER_STATUS_IN_TRANS; + + if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7))) + DBUG_RETURN(1); + if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root, + field_count,0, + mysql->server_capabilities))) + DBUG_RETURN(1); + } + stmt->field_count= field_count; + stmt->param_count= (ulong) param_count; + DBUG_PRINT("exit",("field_count: %u param_count: %u warning_count: %u", + field_count, param_count, (uint) mysql->warning_count)); + + DBUG_RETURN(0); +} + + +/* + Allocate memory and init prepared statement structure. + + SYNOPSIS + mysql_stmt_init() + mysql connection handle + + DESCRIPTION + This is an entry point of the new API. Returned handle stands for + a server-side prepared statement. Memory for this structure (~700 + bytes) is allocated using 'malloc'. Once created, the handle can be + reused many times. Created statement handle is bound to connection + handle provided to this call: its lifetime is limited by lifetime + of connection. + 'mysql_stmt_init()' is a pure local call, server side structure is + created only in mysql_stmt_prepare. + Next steps you may want to make: + - set a statement attribute (mysql_stmt_attr_set()), + - prepare statement handle with a query (mysql_stmt_prepare()), + - close statement handle and free its memory (mysql_stmt_close()), + - reset statement with mysql_stmt_reset() (a no-op which will + just return). + Behaviour of the rest of API calls on this statement is not defined yet + (though we're working on making each wrong call sequence return + error). + + RETURN VALUE + statement structure upon success and NULL if out of + memory +*/ + +MYSQL_STMT * STDCALL +mysql_stmt_init(MYSQL *mysql) +{ + MYSQL_STMT *stmt; + DBUG_ENTER("mysql_stmt_init"); + + if (!(stmt= (MYSQL_STMT *) my_malloc(sizeof(MYSQL_STMT), + MYF(MY_WME | MY_ZEROFILL)))) + { + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(0); + } + + init_alloc_root(&stmt->mem_root, 2048, 2048); + init_alloc_root(&stmt->result.alloc, 4096, 4096); + stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS); + mysql->stmts= list_add(mysql->stmts, &stmt->list); + stmt->list.data= stmt; + stmt->state= MYSQL_STMT_INIT_DONE; + stmt->mysql= mysql; + stmt->read_row_func= stmt_read_row_no_result_set; + stmt->prefetch_rows= DEFAULT_PREFETCH_ROWS; + strmov(stmt->sqlstate, not_error_sqlstate); + /* The rest of statement members was bzeroed inside malloc */ + + DBUG_RETURN(stmt); +} + + +/* + Prepare server side statement with query. + + SYNOPSIS + mysql_stmt_prepare() + stmt statement handle + query statement to prepare + length statement length + + DESCRIPTION + Associate statement with statement handle. This is done both on + client and server sides. At this point the server parses given query + and creates an internal structure to represent it. + Next steps you may want to make: + - find out if this statement returns a result set by + calling mysql_stmt_field_count(), and get result set metadata + with mysql_stmt_result_metadata(), + - if query contains placeholders, bind input parameters to placeholders + using mysql_stmt_bind_param(), + - otherwise proceed directly to mysql_stmt_execute(). + + IMPLEMENTATION NOTES + - if this is a re-prepare of the statement, first close previous data + structure on the server and free old statement data + - then send the query to server and get back number of placeholders, + number of columns in result set (if any), and result set metadata. + At the same time allocate memory for input and output parameters + to have less checks in mysql_stmt_bind_{param, result}. + + RETURN VALUES + 0 success + !0 error +*/ + +int STDCALL +mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) +{ + MYSQL *mysql= stmt->mysql; + DBUG_ENTER("mysql_stmt_prepare"); + + if (!mysql) + { + /* mysql can be reset in mysql_close called from mysql_reconnect */ + set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + /* + Reset the last error in any case: that would clear the statement + if the previous prepare failed. + */ + stmt->last_errno= 0; + stmt->last_error[0]= '\0'; + + if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) + { + /* This is second prepare with another statement */ + uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ + + if (reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT)) + DBUG_RETURN(1); + /* + These members must be reset for API to + function in case of error or misuse. + */ + stmt->bind_param_done= stmt->bind_result_done= FALSE; + stmt->param_count= stmt->field_count= 0; + free_root(&stmt->mem_root, MYF(MY_KEEP_PREALLOC)); + + int4store(buff, stmt->stmt_id); + + /* + Close statement in server + + If there was a 'use' result from another statement, or from + mysql_use_result it won't be freed in mysql_stmt_free_result and + we should get 'Commands out of sync' here. + */ + stmt->state= MYSQL_STMT_INIT_DONE; + if (stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt)) + { + set_stmt_errmsg(stmt, &mysql->net); + DBUG_RETURN(1); + } + } + + if (stmt_command(mysql, COM_STMT_PREPARE, (const uchar*) query, length, stmt)) + { + set_stmt_errmsg(stmt, &mysql->net); + DBUG_RETURN(1); + } + + if ((*mysql->methods->read_prepare_result)(mysql, stmt)) + { + set_stmt_errmsg(stmt, &mysql->net); + DBUG_RETURN(1); + } + + /* + alloc_root will return valid address even in case when param_count + and field_count are zero. Thus we should never rely on stmt->bind + or stmt->params when checking for existence of placeholders or + result set. + */ + if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, + sizeof(MYSQL_BIND)* + (stmt->param_count + + stmt->field_count)))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + stmt->bind= stmt->params + stmt->param_count; + stmt->state= MYSQL_STMT_PREPARE_DONE; + DBUG_PRINT("info", ("Parameter count: %u", stmt->param_count)); + DBUG_RETURN(0); +} + +/* + Get result set metadata from reply to mysql_stmt_execute. + This is used mainly for SHOW commands, as metadata for these + commands is sent only with result set. + To be removed when all commands will fully support prepared mode. +*/ + +static void alloc_stmt_fields(MYSQL_STMT *stmt) +{ + MYSQL_FIELD *fields, *field, *end; + MEM_ROOT *alloc= &stmt->mem_root; + MYSQL *mysql= stmt->mysql; + + DBUG_ASSERT(mysql->field_count); + + stmt->field_count= mysql->field_count; + + /* + Get the field information for non-select statements + like SHOW and DESCRIBE commands + */ + if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(alloc, + sizeof(MYSQL_FIELD) * + stmt->field_count)) || + !(stmt->bind= (MYSQL_BIND *) alloc_root(alloc, + sizeof(MYSQL_BIND) * + stmt->field_count))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate, NULL); + return; + } + + for (fields= mysql->fields, end= fields+stmt->field_count, + field= stmt->fields; + field && fields < end; fields++, field++) + { + *field= *fields; /* To copy all numeric parts. */ + field->catalog= strmake_root(alloc, fields->catalog, + fields->catalog_length); + field->db= strmake_root(alloc, fields->db, fields->db_length); + field->table= strmake_root(alloc, fields->table, fields->table_length); + field->org_table= strmake_root(alloc, fields->org_table, + fields->org_table_length); + field->name= strmake_root(alloc, fields->name, fields->name_length); + field->org_name= strmake_root(alloc, fields->org_name, + fields->org_name_length); + field->def = fields->def ? strmake_root(alloc, fields->def, + fields->def_length) : 0; + field->def_length= field->def ? fields->def_length : 0; + field->extension= 0; /* Avoid dangling links. */ + field->max_length= 0; /* max_length is set in mysql_stmt_store_result() */ + } +} + + +/** + Update result set columns metadata if it was sent again in + reply to COM_STMT_EXECUTE. + + @note If the new field count is different from the original one, + an error is set and no update is performed. +*/ + +static void update_stmt_fields(MYSQL_STMT *stmt) +{ + MYSQL_FIELD *field= stmt->mysql->fields; + MYSQL_FIELD *field_end= field + stmt->field_count; + MYSQL_FIELD *stmt_field= stmt->fields; + MYSQL_BIND *my_bind= stmt->bind_result_done ? stmt->bind : 0; + + if (stmt->field_count != stmt->mysql->field_count) + { + /* + The tables used in the statement were altered, + and the query now returns a different number of columns. + There is no way to continue without reallocating the bind + array: + - if the number of columns increased, mysql_stmt_fetch() + will write beyond allocated memory + - if the number of columns decreased, some user-bound + buffers will be left unassigned without user knowing + that. + */ + set_stmt_error(stmt, CR_NEW_STMT_METADATA, unknown_sqlstate, NULL); + return; + } + + for (; field < field_end; ++field, ++stmt_field) + { + stmt_field->charsetnr= field->charsetnr; + stmt_field->length = field->length; + stmt_field->type = field->type; + stmt_field->flags = field->flags; + stmt_field->decimals = field->decimals; + if (my_bind) + { + /* Ignore return value: it should be 0 if bind_result succeeded. */ + (void) setup_one_fetch_function(my_bind++, stmt_field); + } + } +} + +/* + Returns prepared statement metadata in the form of a result set. + + SYNOPSIS + mysql_stmt_result_metadata() + stmt statement handle + + DESCRIPTION + This function should be used after mysql_stmt_execute(). + You can safely check that prepared statement has a result set by calling + mysql_stmt_field_count(): if number of fields is not zero, you can call + this function to get fields metadata. + Next steps you may want to make: + - find out number of columns in result set by calling + mysql_num_fields(res) (the same value is returned by + mysql_stmt_field_count()) + - fetch metadata for any column with mysql_fetch_field, + mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek. + - free returned MYSQL_RES structure with mysql_free_result. + - proceed to binding of output parameters. + + RETURN + NULL statement contains no result set or out of memory. + In the latter case you can retreive error message + with mysql_stmt_error. + MYSQL_RES a result set with no rows +*/ + +MYSQL_RES * STDCALL +mysql_stmt_result_metadata(MYSQL_STMT *stmt) +{ + MYSQL_RES *result; + DBUG_ENTER("mysql_stmt_result_metadata"); + + /* + stmt->fields is only defined if stmt->field_count is not null; + stmt->field_count is initialized in prepare. + */ + if (!stmt->field_count) + DBUG_RETURN(0); + + if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result), + MYF(MY_WME | MY_ZEROFILL)))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate, NULL); + DBUG_RETURN(0); + } + + result->methods= stmt->mysql->methods; + result->eof= 1; /* Marker for buffered */ + result->fields= stmt->fields; + result->field_count= stmt->field_count; + /* The rest of members of 'result' was bzeroed inside malloc */ + DBUG_RETURN(result); +} + + +/* + Returns parameter columns meta information in the form of + result set. + + SYNOPSYS + mysql_stmt_param_metadata() + stmt statement handle + + DESCRIPTION + This function can be called after you prepared the statement handle + with mysql_stmt_prepare(). + XXX: not implemented yet. + + RETURN + MYSQL_RES on success, 0 if there is no metadata. + Currently this function always returns 0. +*/ + +MYSQL_RES * STDCALL +mysql_stmt_param_metadata(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_stmt_param_metadata"); + + if (!stmt->param_count) + DBUG_RETURN(0); + + /* + TODO: Fix this when server sends the information. + Till then keep a dummy prototype. + */ + DBUG_RETURN(0); +} + + +/* Store type of parameter in network buffer. */ + +static void store_param_type(char **pos, MYSQL_BIND *param) +{ + uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0); + int2store(*pos, typecode); + *pos+= 2; +} + + +/* + Functions to store parameter data in network packet. + + SYNOPSIS + store_param_xxx() + net MySQL NET connection + param MySQL bind param + + DESCRIPTION + These funtions are invoked from mysql_stmt_execute() by + MYSQL_BIND::store_param_func pointer. This pointer is set once per + many executions in mysql_stmt_bind_param(). The caller must ensure + that network buffer have enough capacity to store parameter + (MYSQL_BIND::buffer_length contains needed number of bytes). +*/ + +static void store_param_tinyint(NET *net, MYSQL_BIND *param) +{ + *(net->write_pos++)= *(uchar *) param->buffer; +} + +static void store_param_short(NET *net, MYSQL_BIND *param) +{ + short value= *(short*) param->buffer; + int2store(net->write_pos,value); + net->write_pos+=2; +} + +static void store_param_int32(NET *net, MYSQL_BIND *param) +{ + int32 value= *(int32*) param->buffer; + int4store(net->write_pos,value); + net->write_pos+=4; +} + +static void store_param_int64(NET *net, MYSQL_BIND *param) +{ + longlong value= *(longlong*) param->buffer; + int8store(net->write_pos,value); + net->write_pos+= 8; +} + +static void store_param_float(NET *net, MYSQL_BIND *param) +{ + float value= *(float*) param->buffer; + float4store(net->write_pos, value); + net->write_pos+= 4; +} + +static void store_param_double(NET *net, MYSQL_BIND *param) +{ + double value= *(double*) param->buffer; + float8store(net->write_pos, value); + net->write_pos+= 8; +} + +static void store_param_time(NET *net, MYSQL_BIND *param) +{ + MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer; + char buff[MAX_TIME_REP_LENGTH], *pos; + uint length; + + pos= buff+1; + pos[0]= tm->neg ? 1: 0; + int4store(pos+1, tm->day); + pos[5]= (uchar) tm->hour; + pos[6]= (uchar) tm->minute; + pos[7]= (uchar) tm->second; + int4store(pos+8, tm->second_part); + if (tm->second_part) + length= 12; + else if (tm->hour || tm->minute || tm->second || tm->day) + length= 8; + else + length= 0; + buff[0]= (char) length++; + memcpy((char *)net->write_pos, buff, length); + net->write_pos+= length; +} + +static void net_store_datetime(NET *net, MYSQL_TIME *tm) +{ + char buff[MAX_DATETIME_REP_LENGTH], *pos; + uint length; + + pos= buff+1; + + int2store(pos, tm->year); + pos[2]= (uchar) tm->month; + pos[3]= (uchar) tm->day; + pos[4]= (uchar) tm->hour; + pos[5]= (uchar) tm->minute; + pos[6]= (uchar) tm->second; + int4store(pos+7, tm->second_part); + if (tm->second_part) + length= 11; + else if (tm->hour || tm->minute || tm->second) + length= 7; + else if (tm->year || tm->month || tm->day) + length= 4; + else + length= 0; + buff[0]= (char) length++; + memcpy((char *)net->write_pos, buff, length); + net->write_pos+= length; +} + +static void store_param_date(NET *net, MYSQL_BIND *param) +{ + MYSQL_TIME tm= *((MYSQL_TIME *) param->buffer); + tm.hour= tm.minute= tm.second= tm.second_part= 0; + net_store_datetime(net, &tm); +} + +static void store_param_datetime(NET *net, MYSQL_BIND *param) +{ + MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer; + net_store_datetime(net, tm); +} + +static void store_param_str(NET *net, MYSQL_BIND *param) +{ + /* param->length is always set in mysql_stmt_bind_param */ + ulong length= *param->length; + uchar *to= net_store_length(net->write_pos, length); + memcpy(to, param->buffer, length); + net->write_pos= to+length; +} + + +/* + Mark if the parameter is NULL. + + SYNOPSIS + store_param_null() + net MySQL NET connection + param MySQL bind param + + DESCRIPTION + A data package starts with a string of bits where we set a bit + if a parameter is NULL. Unlike bit string in result set row, here + we don't have reserved bits for OK/error packet. +*/ + +static void store_param_null(NET *net, MYSQL_BIND *param) +{ + uint pos= param->param_number; + net->buff[pos/8]|= (uchar) (1 << (pos & 7)); +} + + +/* + Store one parameter in network packet: data is read from + client buffer and saved in network packet by means of one + of store_param_xxxx functions. +*/ + +static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) +{ + NET *net= &stmt->mysql->net; + DBUG_ENTER("store_param"); + DBUG_PRINT("enter",("type: %d buffer: %p length: %lu is_null: %d", + param->buffer_type, + (param->buffer ? param->buffer : NullS), + *param->length, *param->is_null)); + + if (*param->is_null) + store_param_null(net, param); + else + { + /* + Param->length should ALWAYS point to the correct length for the type + Either to the length pointer given by the user or param->buffer_length + */ + if ((my_realloc_str(net, *param->length))) + { + set_stmt_errmsg(stmt, net); + DBUG_RETURN(1); + } + (*param->store_param_func)(net, param); + } + DBUG_RETURN(0); +} + + +/* + Auxilary function to send COM_STMT_EXECUTE packet to server and read reply. + Used from cli_stmt_execute, which is in turn used by mysql_stmt_execute. +*/ + +static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) +{ + MYSQL *mysql= stmt->mysql; + NET *net= &mysql->net; + uchar buff[4 /* size of stmt id */ + + 5 /* execution flags */]; + my_bool res; + DBUG_ENTER("execute"); + DBUG_DUMP("packet", (uchar *) packet, length); + + int4store(buff, stmt->stmt_id); /* Send stmt id to server */ + buff[4]= (char) stmt->flags; + int4store(buff+5, 1); /* iteration count */ + + res= test(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff), + (uchar*) packet, length, 1, stmt) || + (*mysql->methods->read_query_result)(mysql)); + stmt->affected_rows= mysql->affected_rows; + stmt->server_status= mysql->server_status; + stmt->insert_id= mysql->insert_id; + if (res) + { + set_stmt_errmsg(stmt, net); + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + + +int cli_stmt_execute(MYSQL_STMT *stmt) +{ + DBUG_ENTER("cli_stmt_execute"); + + if (stmt->param_count) + { + MYSQL *mysql= stmt->mysql; + NET *net= &mysql->net; + MYSQL_BIND *param, *param_end; + char *param_data; + ulong length; + uint null_count; + my_bool result; + + if (!stmt->bind_param_done) + { + set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + if (mysql->status != MYSQL_STATUS_READY || + mysql->server_status & SERVER_MORE_RESULTS_EXISTS) + { + set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + net_clear(net, 1); /* Sets net->write_pos */ + /* Reserve place for null-marker bytes */ + null_count= (stmt->param_count+7) /8; + if (my_realloc_str(net, null_count + 1)) + { + set_stmt_errmsg(stmt, net); + DBUG_RETURN(1); + } + bzero((char*) net->write_pos, null_count); + net->write_pos+= null_count; + param_end= stmt->params + stmt->param_count; + + /* In case if buffers (type) altered, indicate to server */ + *(net->write_pos)++= (uchar) stmt->send_types_to_server; + if (stmt->send_types_to_server) + { + if (my_realloc_str(net, 2 * stmt->param_count)) + { + set_stmt_errmsg(stmt, net); + DBUG_RETURN(1); + } + /* + Store types of parameters in first in first package + that is sent to the server. + */ + for (param= stmt->params; param < param_end ; param++) + store_param_type((char**) &net->write_pos, param); + } + + for (param= stmt->params; param < param_end; param++) + { + /* check if mysql_stmt_send_long_data() was used */ + if (param->long_data_used) + param->long_data_used= 0; /* Clear for next execute call */ + else if (store_param(stmt, param)) + DBUG_RETURN(1); + } + length= (ulong) (net->write_pos - net->buff); + /* TODO: Look into avoding the following memdup */ + if (!(param_data= my_memdup(net->buff, length, MYF(0)))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + result= execute(stmt, param_data, length); + stmt->send_types_to_server=0; + my_free(param_data, MYF(MY_WME)); + DBUG_RETURN(result); + } + DBUG_RETURN((int) execute(stmt,0,0)); +} + +/* + Read one row from buffered result set. Result set is created by prior + call to mysql_stmt_store_result(). + SYNOPSIS + stmt_read_row_buffered() + + RETURN VALUE + 0 - success; *row is set to valid row pointer (row data + is stored in result set buffer) + MYSQL_NO_DATA - end of result set. *row is set to NULL +*/ + +static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row) +{ + if (stmt->data_cursor) + { + *row= (uchar *) stmt->data_cursor->data; + stmt->data_cursor= stmt->data_cursor->next; + return 0; + } + *row= 0; + return MYSQL_NO_DATA; +} + +/* + Read one row from network: unbuffered non-cursor fetch. + If last row was read, or error occured, erase this statement + from record pointing to object unbuffered fetch is performed from. + + SYNOPSIS + stmt_read_row_unbuffered() + stmt statement handle + row pointer to write pointer to row data; + + RETURN VALUE + 0 - success; *row contains valid address of a row; + row data is stored in network buffer + 1 - error; error code is written to + stmt->last_{errno,error}; *row is not changed + MYSQL_NO_DATA - end of file was read from network; + *row is set to NULL +*/ + +static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row) +{ + int rc= 1; + MYSQL *mysql= stmt->mysql; + /* + This function won't be called if stmt->field_count is zero + or execution wasn't done: this is ensured by mysql_stmt_execute. + */ + if (!mysql) + { + set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL); + return 1; + } + if (mysql->status != MYSQL_STATUS_GET_RESULT) + { + set_stmt_error(stmt, stmt->unbuffered_fetch_cancelled ? + CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC, + unknown_sqlstate, NULL); + goto error; + } + if ((*mysql->methods->unbuffered_fetch)(mysql, (char**) row)) + { + set_stmt_errmsg(stmt, &mysql->net); + /* + If there was an error, there are no more pending rows: + reset statement status to not hang up in following + mysql_stmt_close (it will try to flush result set before + closing the statement). + */ + mysql->status= MYSQL_STATUS_READY; + goto error; + } + if (!*row) + { + mysql->status= MYSQL_STATUS_READY; + rc= MYSQL_NO_DATA; + goto error; + } + return 0; +error: + if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) + mysql->unbuffered_fetch_owner= 0; + return rc; +} + + +/* + Fetch statement row using server side cursor. + + SYNOPSIS + stmt_read_row_from_cursor() + + RETURN VALUE + 0 success + 1 error + MYSQL_NO_DATA end of data +*/ + +static int +stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row) +{ + if (stmt->data_cursor) + return stmt_read_row_buffered(stmt, row); + if (stmt->server_status & SERVER_STATUS_LAST_ROW_SENT) + stmt->server_status &= ~SERVER_STATUS_LAST_ROW_SENT; + else + { + MYSQL *mysql= stmt->mysql; + NET *net= &mysql->net; + MYSQL_DATA *result= &stmt->result; + uchar buff[4 /* statement id */ + + 4 /* number of rows to fetch */]; + + free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); + result->data= NULL; + result->rows= 0; + /* Send row request to the server */ + int4store(buff, stmt->stmt_id); + int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */ + if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH, + buff, sizeof(buff), (uchar*) 0, 0, + 1, stmt)) + { + set_stmt_errmsg(stmt, net); + return 1; + } + if ((*mysql->methods->read_rows_from_cursor)(stmt)) + return 1; + stmt->server_status= mysql->server_status; + + stmt->data_cursor= result->data; + return stmt_read_row_buffered(stmt, row); + } + *row= 0; + return MYSQL_NO_DATA; +} + + +/* + Default read row function to not SIGSEGV in client in + case of wrong sequence of API calls. +*/ + +static int +stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)), + unsigned char **row __attribute__((unused))) +{ + return MYSQL_NO_DATA; +} + +static int +stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)), + unsigned char **row __attribute__((unused))) +{ + set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate, NULL); + return 1; +} + + +/* + Get/set statement attributes + + SYNOPSIS + mysql_stmt_attr_get() + mysql_stmt_attr_set() + + attr_type statement attribute + value casted to const void * pointer to value. + + RETURN VALUE + 0 success + !0 wrong attribute type +*/ + +my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + const void *value) +{ + switch (attr_type) { + case STMT_ATTR_UPDATE_MAX_LENGTH: + stmt->update_max_length= value ? *(const my_bool*) value : 0; + break; + case STMT_ATTR_CURSOR_TYPE: + { + ulong cursor_type; + cursor_type= value ? *(ulong*) value : 0UL; + if (cursor_type > (ulong) CURSOR_TYPE_READ_ONLY) + goto err_not_implemented; + stmt->flags= cursor_type; + break; + } + case STMT_ATTR_PREFETCH_ROWS: + { + ulong prefetch_rows= value ? *(ulong*) value : DEFAULT_PREFETCH_ROWS; + if (value == 0) + return TRUE; + stmt->prefetch_rows= prefetch_rows; + break; + } + default: + goto err_not_implemented; + } + return FALSE; +err_not_implemented: + set_stmt_error(stmt, CR_NOT_IMPLEMENTED, unknown_sqlstate, NULL); + return TRUE; +} + + +my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + void *value) +{ + switch (attr_type) { + case STMT_ATTR_UPDATE_MAX_LENGTH: + *(my_bool*) value= stmt->update_max_length; + break; + case STMT_ATTR_CURSOR_TYPE: + *(ulong*) value= stmt->flags; + break; + case STMT_ATTR_PREFETCH_ROWS: + *(ulong*) value= stmt->prefetch_rows; + break; + default: + return TRUE; + } + return FALSE; +} + + +/** + Update statement result set metadata from with the new field + information sent during statement execute. + + @pre mysql->field_count is not zero + + @retval TRUE if error: out of memory or the new + result set has a different number of columns + @retval FALSE success +*/ + +static void reinit_result_set_metadata(MYSQL_STMT *stmt) +{ + /* Server has sent result set metadata */ + if (stmt->field_count == 0) + { + /* + This is 'SHOW'/'EXPLAIN'-like query. Current implementation of + prepared statements can't send result set metadata for these queries + on prepare stage. Read it now. + */ + alloc_stmt_fields(stmt); + } + else + { + /* + Update result set metadata if it for some reason changed between + prepare and execute, i.e.: + - in case of 'SELECT ?' we don't know column type unless data was + supplied to mysql_stmt_execute, so updated column type is sent + now. + - if data dictionary changed between prepare and execute, for + example a table used in the query was altered. + Note, that now (4.1.3) we always send metadata in reply to + COM_STMT_EXECUTE (even if it is not necessary), so either this or + previous branch always works. + TODO: send metadata only when it's really necessary and add a warning + 'Metadata changed' when it's sent twice. + */ + update_stmt_fields(stmt); + } +} + + +static void prepare_to_fetch_result(MYSQL_STMT *stmt) +{ + if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS) + { + stmt->mysql->status= MYSQL_STATUS_READY; + stmt->read_row_func= stmt_read_row_from_cursor; + } + else if (stmt->flags & CURSOR_TYPE_READ_ONLY) + { + /* + This is a single-row result set, a result set with no rows, EXPLAIN, + SHOW VARIABLES, or some other command which either a) bypasses the + cursors framework in the server and writes rows directly to the + network or b) is more efficient if all (few) result set rows are + precached on client and server's resources are freed. + */ + mysql_stmt_store_result(stmt); + } + else + { + stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled; + stmt->unbuffered_fetch_cancelled= FALSE; + stmt->read_row_func= stmt_read_row_unbuffered; + } +} + + +/* + Send placeholders data to server (if there are placeholders) + and execute prepared statement. + + SYNOPSIS + mysql_stmt_execute() + stmt statement handle. The handle must be created + with mysql_stmt_init() and prepared with + mysql_stmt_prepare(). If there are placeholders + in the statement they must be bound to local + variables with mysql_stmt_bind_param(). + + DESCRIPTION + This function will automatically flush pending result + set (if there is one), send parameters data to the server + and read result of statement execution. + If previous result set was cached with mysql_stmt_store_result() + it will also be freed in the beginning of this call. + The server can return 3 types of responses to this command: + - error, can be retrieved with mysql_stmt_error() + - ok, no result set pending. In this case we just update + stmt->insert_id and stmt->affected_rows. + - the query returns a result set: there could be 0 .. N + rows in it. In this case the server can also send updated + result set metadata. + + Next steps you may want to make: + - find out if there is result set with mysql_stmt_field_count(). + If there is one: + - optionally, cache entire result set on client to unblock + connection with mysql_stmt_store_result() + - bind client variables to result set columns and start read rows + with mysql_stmt_fetch(). + - reset statement with mysql_stmt_reset() or close it with + mysql_stmt_close() + Otherwise: + - find out last insert id and number of affected rows with + mysql_stmt_insert_id(), mysql_stmt_affected_rows() + + RETURN + 0 success + 1 error, message can be retrieved with mysql_stmt_error(). +*/ + +int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt) +{ + MYSQL *mysql= stmt->mysql; + DBUG_ENTER("mysql_stmt_execute"); + + if (!mysql) + { + /* Error is already set in mysql_detatch_stmt_list */ + DBUG_RETURN(1); + } + + if (reset_stmt_handle(stmt, RESET_STORE_RESULT | RESET_CLEAR_ERROR)) + DBUG_RETURN(1); + /* + No need to check for stmt->state: if the statement wasn't + prepared we'll get 'unknown statement handler' error from server. + */ + if (mysql->methods->stmt_execute(stmt)) + DBUG_RETURN(1); + stmt->state= MYSQL_STMT_EXECUTE_DONE; + if (mysql->field_count) + { + reinit_result_set_metadata(stmt); + prepare_to_fetch_result(stmt); + } + DBUG_RETURN(test(stmt->last_errno)); +} + + +/* + Return total parameters count in the statement +*/ + +ulong STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt) +{ + DBUG_ENTER("mysql_stmt_param_count"); + DBUG_RETURN(stmt->param_count); +} + +/* + Return total affected rows from the last statement +*/ + +my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt) +{ + return stmt->affected_rows; +} + + +/* + Returns the number of result columns for the most recent query + run on this statement. +*/ + +unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt) +{ + return stmt->field_count; +} + +/* + Return last inserted id for auto_increment columns. + + SYNOPSIS + mysql_stmt_insert_id() + stmt statement handle + + DESCRIPTION + Current implementation of this call has a caveat: stmt->insert_id is + unconditionally updated from mysql->insert_id in the end of each + mysql_stmt_execute(). This works OK if mysql->insert_id contains new + value (sent in reply to mysql_stmt_execute()), otherwise stmt->insert_id + value gets undefined, as it's updated from some arbitrary value saved in + connection structure during some other call. +*/ + +my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt) +{ + return stmt->insert_id; +} + + +static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */ +static my_bool int_is_null_false= 0; + + +/* + Set up input data buffers for a statement. + + SYNOPSIS + mysql_stmt_bind_param() + stmt statement handle + The statement must be prepared with mysql_stmt_prepare(). + my_bind Array of mysql_stmt_param_count() bind parameters. + This function doesn't check that size of this argument + is >= mysql_stmt_field_count(): it's user's responsibility. + + DESCRIPTION + Use this call after mysql_stmt_prepare() to bind user variables to + placeholders. + Each element of bind array stands for a placeholder. Placeholders + are counted from 0. For example statement + 'INSERT INTO t (a, b) VALUES (?, ?)' + contains two placeholders, and for such statement you should supply + bind array of two elements (MYSQL_BIND bind[2]). + + By properly initializing bind array you can bind virtually any + C language type to statement's placeholders: + First, it's strongly recommended to always zero-initialize entire + bind structure before setting its members. This will both shorten + your application code and make it robust to future extensions of + MYSQL_BIND structure. + Then you need to assign typecode of your application buffer to + MYSQL_BIND::buffer_type. The following typecodes with their + correspondence to C language types are supported: + MYSQL_TYPE_TINY for 8-bit integer variables. Normally it's + 'signed char' and 'unsigned char'; + MYSQL_TYPE_SHORT for 16-bit signed and unsigned variables. This + is usually 'short' and 'unsigned short'; + MYSQL_TYPE_LONG for 32-bit signed and unsigned variables. It + corresponds to 'int' and 'unsigned int' on + vast majority of platforms. On IA-32 and some + other 32-bit systems you can also use 'long' + here; + MYSQL_TYPE_LONGLONG 64-bit signed or unsigned integer. Stands for + '[unsigned] long long' on most platforms; + MYSQL_TYPE_FLOAT 32-bit floating point type, 'float' on most + systems; + MYSQL_TYPE_DOUBLE 64-bit floating point type, 'double' on most + systems; + MYSQL_TYPE_TIME broken-down time stored in MYSQL_TIME + structure + MYSQL_TYPE_DATE date stored in MYSQL_TIME structure + MYSQL_TYPE_DATETIME datetime stored in MYSQL_TIME structure See + more on how to use these types for sending + dates and times below; + MYSQL_TYPE_STRING character string, assumed to be in + character-set-client. If character set of + client is not equal to character set of + column, value for this placeholder will be + converted to destination character set before + insert. + MYSQL_TYPE_BLOB sequence of bytes. This sequence is assumed to + be in binary character set (which is the same + as no particular character set), and is never + converted to any other character set. See also + notes about supplying string/blob length + below. + MYSQL_TYPE_NULL special typecode for binding nulls. + These C/C++ types are not supported yet by the API: long double, + bool. + + As you can see from the list above, it's responsibility of + application programmer to ensure that chosen typecode properly + corresponds to host language type. For example on all platforms + where we build MySQL packages (as of MySQL 4.1.4) int is a 32-bit + type. So for int you can always assume that proper typecode is + MYSQL_TYPE_LONG (however queer it sounds, the name is legacy of the + old MySQL API). In contrary sizeof(long) can be 4 or 8 8-bit bytes, + depending on platform. + + TODO: provide client typedefs for each integer and floating point + typecode, i. e. int8, uint8, float32, etc. + + Once typecode was set, it's necessary to assign MYSQL_BIND::buffer + to point to the buffer of given type. Finally, additional actions + may be taken for some types or use cases: + + Binding integer types. + For integer types you might also need to set MYSQL_BIND::is_unsigned + member. Set it to TRUE when binding unsigned char, unsigned short, + unsigned int, unsigned long, unsigned long long. + + Binding floating point types. + For floating point types you just need to set + MYSQL_BIND::buffer_type and MYSQL_BIND::buffer. The rest of the + members should be zero-initialized. + + Binding NULLs. + You might have a column always NULL, never NULL, or sometimes + NULL. For an always NULL column set MYSQL_BIND::buffer_type to + MYSQL_TYPE_NULL. The rest of the members just need to be + zero-initialized. For never NULL columns set + MYSQL_BIND::is_null to 0, or this has already been done if you + zero-initialized the entire structure. If you set + MYSQL_TYPE::is_null to point to an application buffer of type + 'my_bool', then this buffer will be checked on each execution: + this way you can set the buffer to TRUE, or any non-0 value for + NULLs, and to FALSE or 0 for not NULL data. + + Binding text strings and sequences of bytes. + For strings, in addition to MYSQL_BIND::buffer_type and + MYSQL_BIND::buffer you need to set MYSQL_BIND::length or + MYSQL_BIND::buffer_length. If 'length' is set, 'buffer_length' + is ignored. 'buffer_length' member should be used when size of + string doesn't change between executions. If you want to vary + buffer length for each value, set 'length' to point to an + application buffer of type 'unsigned long' and set this long to + length of the string before each mysql_stmt_execute(). + + Binding dates and times. + For binding dates and times prepared statements API provides + clients with MYSQL_TIME structure. A pointer to instance of this + structure should be assigned to MYSQL_BIND::buffer whenever + MYSQL_TYPE_TIME, MYSQL_TYPE_DATE, MYSQL_TYPE_DATETIME typecodes + are used. When typecode is MYSQL_TYPE_TIME, only members + 'hour', 'minute', 'second' and 'neg' (is time offset negative) + are used. These members only will be sent to the server. + MYSQL_TYPE_DATE implies use of 'year', 'month', 'day', 'neg'. + MYSQL_TYPE_DATETIME utilizes both parts of MYSQL_TIME structure. + You don't have to set MYSQL_TIME::time_type member: it's not + used when sending data to the server, typecode information is + enough. 'second_part' member can hold microsecond precision of + time value, but now it's only supported on protocol level: you + can't store microsecond in a column, or use in temporal + calculations. However, if you send a time value with microsecond + part for 'SELECT ?', statement, you'll get it back unchanged + from the server. + + Data conversion. + If conversion from host language type to data representation, + corresponding to SQL type, is required it's done on the server. + Data truncation is possible when conversion is lossy. For + example, if you supply MYSQL_TYPE_DATETIME value out of valid + SQL type TIMESTAMP range, the same conversion will be applied as + if this value would have been sent as string in the old + protocol. TODO: document how the server will behave in case of + truncation/data loss. + + After variables were bound, you can repeatedly set/change their + values and mysql_stmt_execute() the statement. + + See also: mysql_stmt_send_long_data() for sending long text/blob + data in pieces, examples in tests/mysql_client_test.c. + Next steps you might want to make: + - execute statement with mysql_stmt_execute(), + - reset statement using mysql_stmt_reset() or reprepare it with + another query using mysql_stmt_prepare() + - close statement with mysql_stmt_close(). + + IMPLEMENTATION + The function copies given bind array to internal storage of the + statement, and sets up typecode-specific handlers to perform + serialization of bound data. This means that although you don't need + to call this routine after each assignment to bind buffers, you + need to call it each time you change parameter typecodes, or other + members of MYSQL_BIND array. + This is a pure local call. Data types of client buffers are sent + along with buffers' data at first execution of the statement. + + RETURN + 0 success + 1 error, can be retrieved with mysql_stmt_error. +*/ + +my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) +{ + uint count=0; + MYSQL_BIND *param, *end; + DBUG_ENTER("mysql_stmt_bind_param"); + + if (!stmt->param_count) + { + if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) + { + set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + DBUG_RETURN(0); + } + + /* Allocated on prepare */ + memcpy((char*) stmt->params, (char*) my_bind, + sizeof(MYSQL_BIND) * stmt->param_count); + + for (param= stmt->params, end= param+stmt->param_count; + param < end ; + param++) + { + param->param_number= count++; + param->long_data_used= 0; + + /* If param->is_null is not set, then the value can never be NULL */ + if (!param->is_null) + param->is_null= &int_is_null_false; + + /* Setup data copy functions for the different supported types */ + switch (param->buffer_type) { + case MYSQL_TYPE_NULL: + param->is_null= &int_is_null_true; + break; + case MYSQL_TYPE_TINY: + /* Force param->length as this is fixed for this type */ + param->length= ¶m->buffer_length; + param->buffer_length= 1; + param->store_param_func= store_param_tinyint; + break; + case MYSQL_TYPE_SHORT: + param->length= ¶m->buffer_length; + param->buffer_length= 2; + param->store_param_func= store_param_short; + break; + case MYSQL_TYPE_LONG: + param->length= ¶m->buffer_length; + param->buffer_length= 4; + param->store_param_func= store_param_int32; + break; + case MYSQL_TYPE_LONGLONG: + param->length= ¶m->buffer_length; + param->buffer_length= 8; + param->store_param_func= store_param_int64; + break; + case MYSQL_TYPE_FLOAT: + param->length= ¶m->buffer_length; + param->buffer_length= 4; + param->store_param_func= store_param_float; + break; + case MYSQL_TYPE_DOUBLE: + param->length= ¶m->buffer_length; + param->buffer_length= 8; + param->store_param_func= store_param_double; + break; + case MYSQL_TYPE_TIME: + param->store_param_func= store_param_time; + param->buffer_length= MAX_TIME_REP_LENGTH; + break; + case MYSQL_TYPE_DATE: + param->store_param_func= store_param_date; + param->buffer_length= MAX_DATE_REP_LENGTH; + break; + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + param->store_param_func= store_param_datetime; + param->buffer_length= MAX_DATETIME_REP_LENGTH; + break; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + param->store_param_func= store_param_str; + /* + For variable length types user must set either length or + buffer_length. + */ + break; + default: + strmov(stmt->sqlstate, unknown_sqlstate); + sprintf(stmt->last_error, + ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE), + param->buffer_type, count); + DBUG_RETURN(1); + } + /* + If param->length is not given, change it to point to buffer_length. + This way we can always use *param->length to get the length of data + */ + if (!param->length) + param->length= ¶m->buffer_length; + } + /* We have to send/resend type information to MySQL */ + stmt->send_types_to_server= TRUE; + stmt->bind_param_done= TRUE; + DBUG_RETURN(0); +} + + +/******************************************************************** + Long data implementation +*********************************************************************/ + +/* + Send long data in pieces to the server + + SYNOPSIS + mysql_stmt_send_long_data() + stmt Statement handler + param_number Parameter number (0 - N-1) + data Data to send to server + length Length of data to send (may be 0) + + DESCRIPTION + This call can be used repeatedly to send long data in pieces + for any string/binary placeholder. Data supplied for + a placeholder is saved at server side till execute, and then + used instead of value from MYSQL_BIND object. More precisely, + if long data for a parameter was supplied, MYSQL_BIND object + corresponding to this parameter is not sent to server. In the + end of execution long data states of placeholders are reset, + so next time values of such placeholders will be taken again + from MYSQL_BIND array. + The server does not reply to this call: if there was an error + in data handling (which now only can happen if server run out + of memory) it would be returned in reply to + mysql_stmt_execute(). + You should choose type of long data carefully if you care + about character set conversions performed by server when the + statement is executed. No conversion is performed at all for + MYSQL_TYPE_BLOB and other binary typecodes. For + MYSQL_TYPE_STRING and the rest of text placeholders data is + converted from client character set to character set of + connection. If these character sets are different, this + conversion may require additional memory at server, equal to + total size of supplied pieces. + + RETURN VALUES + 0 ok + 1 error +*/ + +my_bool STDCALL +mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, + const char *data, ulong length) +{ + MYSQL_BIND *param; + DBUG_ENTER("mysql_stmt_send_long_data"); + DBUG_ASSERT(stmt != 0); + DBUG_PRINT("enter",("param no: %d data: %p, length : %ld", + param_number, data, length)); + + /* + We only need to check for stmt->param_count, if it's not null + prepare was done. + */ + if (param_number >= stmt->param_count) + { + set_stmt_error(stmt, CR_INVALID_PARAMETER_NO, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + param= stmt->params+param_number; + if (!IS_LONGDATA(param->buffer_type)) + { + /* Long data handling should be used only for string/binary types */ + strmov(stmt->sqlstate, unknown_sqlstate); + sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE), + param->param_number); + DBUG_RETURN(1); + } + + /* + Send long data packet if there is data or we're sending long data + for the first time. + */ + if (length || param->long_data_used == 0) + { + MYSQL *mysql= stmt->mysql; + /* Packet header: stmt id (4 bytes), param no (2 bytes) */ + uchar buff[MYSQL_LONG_DATA_HEADER]; + + int4store(buff, stmt->stmt_id); + int2store(buff + 4, param_number); + param->long_data_used= 1; + + /* + Note that we don't get any ok packet from the server in this case + This is intentional to save bandwidth. + */ + if ((*mysql->methods->advanced_command)(mysql, COM_STMT_SEND_LONG_DATA, + buff, sizeof(buff), (uchar*) data, + length, 1, stmt)) + { + set_stmt_errmsg(stmt, &mysql->net); + DBUG_RETURN(1); + } + } + DBUG_RETURN(0); +} + + +/******************************************************************** + Fetch and conversion of result set rows (binary protocol). +*********************************************************************/ + +/* + Read date, (time, datetime) value from network buffer and store it + in MYSQL_TIME structure. + + SYNOPSIS + read_binary_{date,time,datetime}() + tm MYSQL_TIME structure to fill + pos pointer to current position in network buffer. + These functions increase pos to point to the beginning of the + next column. + + Auxiliary functions to read time (date, datetime) values from network + buffer and store in MYSQL_TIME structure. Jointly used by conversion + and no-conversion fetching. +*/ + +static void read_binary_time(MYSQL_TIME *tm, uchar **pos) +{ + /* net_field_length will set pos to the first byte of data */ + uint length= net_field_length(pos); + + if (length) + { + uchar *to= *pos; + tm->neg= to[0]; + + tm->day= (ulong) sint4korr(to+1); + tm->hour= (uint) to[5]; + tm->minute= (uint) to[6]; + tm->second= (uint) to[7]; + tm->second_part= (length > 8) ? (ulong) sint4korr(to+8) : 0; + tm->year= tm->month= 0; + if (tm->day) + { + /* Convert days to hours at once */ + tm->hour+= tm->day*24; + tm->day= 0; + } + tm->time_type= MYSQL_TIMESTAMP_TIME; + + *pos+= length; + } + else + set_zero_time(tm, MYSQL_TIMESTAMP_TIME); +} + +static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) +{ + uint length= net_field_length(pos); + + if (length) + { + uchar *to= *pos; + + tm->neg= 0; + tm->year= (uint) sint2korr(to); + tm->month= (uint) to[2]; + tm->day= (uint) to[3]; + + if (length > 4) + { + tm->hour= (uint) to[4]; + tm->minute= (uint) to[5]; + tm->second= (uint) to[6]; + } + else + tm->hour= tm->minute= tm->second= 0; + tm->second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; + tm->time_type= MYSQL_TIMESTAMP_DATETIME; + + *pos+= length; + } + else + set_zero_time(tm, MYSQL_TIMESTAMP_DATETIME); +} + +static void read_binary_date(MYSQL_TIME *tm, uchar **pos) +{ + uint length= net_field_length(pos); + + if (length) + { + uchar *to= *pos; + tm->year = (uint) sint2korr(to); + tm->month= (uint) to[2]; + tm->day= (uint) to[3]; + + tm->hour= tm->minute= tm->second= 0; + tm->second_part= 0; + tm->neg= 0; + tm->time_type= MYSQL_TIMESTAMP_DATE; + + *pos+= length; + } + else + set_zero_time(tm, MYSQL_TIMESTAMP_DATE); +} + + +/* + Convert string to supplied buffer of any type. + + SYNOPSIS + fetch_string_with_conversion() + param output buffer descriptor + value column data + length data length +*/ + +static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, + uint length) +{ + char *buffer= (char *)param->buffer; + int err= 0; + char *endptr= value + length; + + /* + This function should support all target buffer types: the rest + of conversion functions can delegate conversion to it. + */ + switch (param->buffer_type) { + case MYSQL_TYPE_NULL: /* do nothing */ + break; + case MYSQL_TYPE_TINY: + { + longlong data= my_strtoll10(value, &endptr, &err); + *param->error= (IS_TRUNCATED(data, param->is_unsigned, + INT_MIN8, INT_MAX8, UINT_MAX8) || err > 0); + *buffer= (uchar) data; + break; + } + case MYSQL_TYPE_SHORT: + { + longlong data= my_strtoll10(value, &endptr, &err); + *param->error= (IS_TRUNCATED(data, param->is_unsigned, + INT_MIN16, INT_MAX16, UINT_MAX16) || err > 0); + shortstore(buffer, (short) data); + break; + } + case MYSQL_TYPE_LONG: + { + longlong data= my_strtoll10(value, &endptr, &err); + *param->error= (IS_TRUNCATED(data, param->is_unsigned, + INT_MIN32, INT_MAX32, UINT_MAX32) || err > 0); + longstore(buffer, (int32) data); + break; + } + case MYSQL_TYPE_LONGLONG: + { + longlong data= my_strtoll10(value, &endptr, &err); + *param->error= param->is_unsigned ? err != 0 : + (err > 0 || (err == 0 && data < 0)); + longlongstore(buffer, data); + break; + } + case MYSQL_TYPE_FLOAT: + { + double data= my_strntod(&my_charset_latin1, value, length, &endptr, &err); + float fdata= (float) data; + *param->error= (fdata != data) | test(err); + floatstore(buffer, fdata); + break; + } + case MYSQL_TYPE_DOUBLE: + { + double data= my_strntod(&my_charset_latin1, value, length, &endptr, &err); + *param->error= test(err); + doublestore(buffer, data); + break; + } + case MYSQL_TYPE_TIME: + { + MYSQL_TIME *tm= (MYSQL_TIME *)buffer; + str_to_time(value, length, tm, &err); + *param->error= test(err); + break; + } + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + { + MYSQL_TIME *tm= (MYSQL_TIME *)buffer; + (void) str_to_datetime(value, length, tm, TIME_FUZZY_DATE, &err); + *param->error= test(err) && (param->buffer_type == MYSQL_TYPE_DATE && + tm->time_type != MYSQL_TIMESTAMP_DATE); + break; + } + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + default: + { + /* + Copy column data to the buffer taking into account offset, + data length and buffer length. + */ + char *start= value + param->offset; + char *end= value + length; + ulong copy_length; + if (start < end) + { + copy_length= end - start; + /* We've got some data beyond offset: copy up to buffer_length bytes */ + if (param->buffer_length) + memcpy(buffer, start, min(copy_length, param->buffer_length)); + } + else + copy_length= 0; + if (copy_length < param->buffer_length) + buffer[copy_length]= '\0'; + *param->error= copy_length > param->buffer_length; + /* + param->length will always contain length of entire column; + number of copied bytes may be way different: + */ + *param->length= length; + break; + } + } +} + + +/* + Convert integer value to client buffer of any type. + + SYNOPSIS + fetch_long_with_conversion() + param output buffer descriptor + field column metadata + value column data +*/ + +static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, + longlong value, my_bool is_unsigned) +{ + char *buffer= (char *)param->buffer; + + switch (param->buffer_type) { + case MYSQL_TYPE_NULL: /* do nothing */ + break; + case MYSQL_TYPE_TINY: + *param->error= IS_TRUNCATED(value, param->is_unsigned, + INT_MIN8, INT_MAX8, UINT_MAX8); + *(uchar *)param->buffer= (uchar) value; + break; + case MYSQL_TYPE_SHORT: + *param->error= IS_TRUNCATED(value, param->is_unsigned, + INT_MIN16, INT_MAX16, UINT_MAX16); + shortstore(buffer, (short) value); + break; + case MYSQL_TYPE_LONG: + *param->error= IS_TRUNCATED(value, param->is_unsigned, + INT_MIN32, INT_MAX32, UINT_MAX32); + longstore(buffer, (int32) value); + break; + case MYSQL_TYPE_LONGLONG: + longlongstore(buffer, value); + *param->error= param->is_unsigned != is_unsigned && value < 0; + break; + case MYSQL_TYPE_FLOAT: + { + /* + We need to mark the local variable volatile to + workaround Intel FPU executive precision feature. + (See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 for details) + */ + volatile float data; + if (is_unsigned) + { + data= (float) ulonglong2double(value); + *param->error= ((ulonglong) value) != ((ulonglong) data); + } + else + { + data= (float)value; + *param->error= value != ((longlong) data); + } + floatstore(buffer, data); + break; + } + case MYSQL_TYPE_DOUBLE: + { + volatile double data; + if (is_unsigned) + { + data= ulonglong2double(value); + *param->error= ((ulonglong) value) != ((ulonglong) data); + } + else + { + data= (double)value; + *param->error= value != ((longlong) data); + } + doublestore(buffer, data); + break; + } + case MYSQL_TYPE_TIME: + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DATETIME: + { + int error; + value= number_to_datetime(value, (MYSQL_TIME *) buffer, TIME_FUZZY_DATE, + &error); + *param->error= test(error); + break; + } + default: + { + uchar buff[22]; /* Enough for longlong */ + uchar *end= (uchar*) longlong10_to_str(value, (char*) buff, + is_unsigned ? 10: -10); + /* Resort to string conversion which supports all typecodes */ + uint length= (uint) (end-buff); + + if (field->flags & ZEROFILL_FLAG && length < field->length && + field->length < 21) + { + bmove_upp(buff+field->length,buff+length, length); + bfill(buff, field->length - length,'0'); + length= field->length; + } + fetch_string_with_conversion(param, (char*) buff, length); + break; + } + } +} + +/* + Convert double/float column to supplied buffer of any type. + + SYNOPSIS + fetch_float_with_conversion() + param output buffer descriptor + field column metadata + value column data + type either MY_GCVT_ARG_FLOAT or MY_GCVT_ARG_DOUBLE. + Affects the maximum number of significant digits + returned by my_gcvt(). +*/ + +static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, + double value, my_gcvt_arg_type type) +{ + char *buffer= (char *)param->buffer; + double val64 = (value < 0 ? -floor(-value) : floor(value)); + + switch (param->buffer_type) { + case MYSQL_TYPE_NULL: /* do nothing */ + break; + case MYSQL_TYPE_TINY: + /* + We need to _store_ data in the buffer before the truncation check to + workaround Intel FPU executive precision feature. + (See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 for details) + Sic: AFAIU it does not guarantee to work. + */ + if (param->is_unsigned) + *buffer= (uint8) value; + else + *buffer= (int8) value; + *param->error= val64 != (param->is_unsigned ? (double)((uint8) *buffer) : + (double)((int8) *buffer)); + break; + case MYSQL_TYPE_SHORT: + if (param->is_unsigned) + { + ushort data= (ushort) value; + shortstore(buffer, data); + } + else + { + short data= (short) value; + shortstore(buffer, data); + } + *param->error= val64 != (param->is_unsigned ? (double) (*(ushort*) buffer): + (double) (*(short*) buffer)); + break; + case MYSQL_TYPE_LONG: + if (param->is_unsigned) + { + uint32 data= (uint32) value; + longstore(buffer, data); + } + else + { + int32 data= (int32) value; + longstore(buffer, data); + } + *param->error= val64 != (param->is_unsigned ? (double) (*(uint32*) buffer): + (double) (*(int32*) buffer)); + break; + case MYSQL_TYPE_LONGLONG: + if (param->is_unsigned) + { + ulonglong data= (ulonglong) value; + longlongstore(buffer, data); + } + else + { + longlong data= (longlong) value; + longlongstore(buffer, data); + } + *param->error= val64 != (param->is_unsigned ? + ulonglong2double(*(ulonglong*) buffer) : + (double) (*(longlong*) buffer)); + break; + case MYSQL_TYPE_FLOAT: + { + float data= (float) value; + floatstore(buffer, data); + *param->error= (*(float*) buffer) != value; + break; + } + case MYSQL_TYPE_DOUBLE: + { + doublestore(buffer, value); + break; + } + default: + { + /* + Resort to fetch_string_with_conversion: this should handle + floating point -> string conversion nicely, honor all typecodes + and param->offset possibly set in mysql_stmt_fetch_column + */ + char buff[FLOATING_POINT_BUFFER]; + size_t len; + if (field->decimals >= NOT_FIXED_DEC) + len= my_gcvt(value, type, + (int) min(sizeof(buff)-1, param->buffer_length), + buff, NULL); + else + len= my_fcvt(value, (int) field->decimals, buff, NULL); + + if (field->flags & ZEROFILL_FLAG && len < field->length && + field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1) + { + bmove_upp((uchar*) buff + field->length, (uchar*) buff + len, + len); + bfill((char*) buff, field->length - len, '0'); + len= field->length; + } + fetch_string_with_conversion(param, buff, len); + + break; + } + } +} + + +/* + Fetch time/date/datetime to supplied buffer of any type + + SYNOPSIS + param output buffer descriptor + time column data +*/ + +static void fetch_datetime_with_conversion(MYSQL_BIND *param, + MYSQL_FIELD *field, + MYSQL_TIME *my_time) +{ + switch (param->buffer_type) { + case MYSQL_TYPE_NULL: /* do nothing */ + break; + case MYSQL_TYPE_DATE: + *(MYSQL_TIME *)(param->buffer)= *my_time; + *param->error= my_time->time_type != MYSQL_TIMESTAMP_DATE; + break; + case MYSQL_TYPE_TIME: + *(MYSQL_TIME *)(param->buffer)= *my_time; + *param->error= my_time->time_type != MYSQL_TIMESTAMP_TIME; + break; + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + *(MYSQL_TIME *)(param->buffer)= *my_time; + /* No error: time and date are compatible with datetime */ + break; + case MYSQL_TYPE_YEAR: + shortstore(param->buffer, my_time->year); + *param->error= 1; + break; + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + { + ulonglong value= TIME_to_ulonglong(my_time); + fetch_float_with_conversion(param, field, + ulonglong2double(value), MY_GCVT_ARG_DOUBLE); + break; + } + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_INT24: + case MYSQL_TYPE_LONG: + case MYSQL_TYPE_LONGLONG: + { + longlong value= (longlong) TIME_to_ulonglong(my_time); + fetch_long_with_conversion(param, field, value, TRUE); + break; + } + default: + { + /* + Convert time value to string and delegate the rest to + fetch_string_with_conversion: + */ + char buff[MAX_DATE_STRING_REP_LENGTH]; + uint length= my_TIME_to_str(my_time, buff); + /* Resort to string conversion */ + fetch_string_with_conversion(param, (char *)buff, length); + break; + } + } +} + + +/* + Fetch and convert result set column to output buffer. + + SYNOPSIS + fetch_result_with_conversion() + param output buffer descriptor + field column metadata + row points to a column of result set tuple in binary format + + DESCRIPTION + This is a fallback implementation of column fetch used + if column and output buffer types do not match. + Increases tuple pointer to point at the next column within the + tuple. +*/ + +static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, + uchar **row) +{ + enum enum_field_types field_type= field->type; + uint field_is_unsigned= field->flags & UNSIGNED_FLAG; + + switch (field_type) { + case MYSQL_TYPE_TINY: + { + uchar value= **row; + /* sic: we need to cast to 'signed char' as 'char' may be unsigned */ + longlong data= field_is_unsigned ? (longlong) value : + (longlong) (signed char) value; + fetch_long_with_conversion(param, field, data, 0); + *row+= 1; + break; + } + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_YEAR: + { + short value= sint2korr(*row); + longlong data= field_is_unsigned ? (longlong) (unsigned short) value : + (longlong) value; + fetch_long_with_conversion(param, field, data, 0); + *row+= 2; + break; + } + case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */ + case MYSQL_TYPE_LONG: + { + int32 value= sint4korr(*row); + longlong data= field_is_unsigned ? (longlong) (uint32) value : + (longlong) value; + fetch_long_with_conversion(param, field, data, 0); + *row+= 4; + break; + } + case MYSQL_TYPE_LONGLONG: + { + longlong value= (longlong)sint8korr(*row); + fetch_long_with_conversion(param, field, value, + field->flags & UNSIGNED_FLAG); + *row+= 8; + break; + } + case MYSQL_TYPE_FLOAT: + { + float value; + float4get(value,*row); + fetch_float_with_conversion(param, field, value, MY_GCVT_ARG_FLOAT); + *row+= 4; + break; + } + case MYSQL_TYPE_DOUBLE: + { + double value; + float8get(value,*row); + fetch_float_with_conversion(param, field, value, MY_GCVT_ARG_DOUBLE); + *row+= 8; + break; + } + case MYSQL_TYPE_DATE: + { + MYSQL_TIME tm; + + read_binary_date(&tm, row); + fetch_datetime_with_conversion(param, field, &tm); + break; + } + case MYSQL_TYPE_TIME: + { + MYSQL_TIME tm; + + read_binary_time(&tm, row); + fetch_datetime_with_conversion(param, field, &tm); + break; + } + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + { + MYSQL_TIME tm; + + read_binary_datetime(&tm, row); + fetch_datetime_with_conversion(param, field, &tm); + break; + } + default: + { + ulong length= net_field_length(row); + fetch_string_with_conversion(param, (char*) *row, length); + *row+= length; + break; + } + } +} + + +/* + Functions to fetch data to application buffers without conversion. + + All functions have the following characteristics: + + SYNOPSIS + fetch_result_xxx() + param MySQL bind param + pos Row value + + DESCRIPTION + These are no-conversion functions, used in binary protocol to store + rows in application buffers. A function used only if type of binary data + is compatible with type of application buffer. + + RETURN + none +*/ + +static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field, + uchar **row) +{ + my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG); + uchar data= **row; + *(uchar *)param->buffer= data; + *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX8; + (*row)++; +} + +static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field, + uchar **row) +{ + my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG); + ushort data= (ushort) sint2korr(*row); + shortstore(param->buffer, data); + *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX16; + *row+= 2; +} + +static void fetch_result_int32(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG); + uint32 data= (uint32) sint4korr(*row); + longstore(param->buffer, data); + *param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX32; + *row+= 4; +} + +static void fetch_result_int64(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG); + ulonglong data= (ulonglong) sint8korr(*row); + *param->error= param->is_unsigned != field_is_unsigned && data > LONGLONG_MAX; + longlongstore(param->buffer, data); + *row+= 8; +} + +static void fetch_result_float(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + float value; + float4get(value,*row); + floatstore(param->buffer, value); + *row+= 4; +} + +static void fetch_result_double(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + double value; + float8get(value,*row); + doublestore(param->buffer, value); + *row+= 8; +} + +static void fetch_result_time(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer; + read_binary_time(tm, row); +} + +static void fetch_result_date(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer; + read_binary_date(tm, row); +} + +static void fetch_result_datetime(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer; + read_binary_datetime(tm, row); +} + +static void fetch_result_bin(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + ulong length= net_field_length(row); + ulong copy_length= min(length, param->buffer_length); + memcpy(param->buffer, (char *)*row, copy_length); + *param->length= length; + *param->error= copy_length < length; + *row+= length; +} + +static void fetch_result_str(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) +{ + ulong length= net_field_length(row); + ulong copy_length= min(length, param->buffer_length); + memcpy(param->buffer, (char *)*row, copy_length); + /* Add an end null if there is room in the buffer */ + if (copy_length != param->buffer_length) + ((uchar *)param->buffer)[copy_length]= '\0'; + *param->length= length; /* return total length */ + *param->error= copy_length < length; + *row+= length; +} + + +/* + functions to calculate max lengths for strings during + mysql_stmt_store_result() +*/ + +static void skip_result_fixed(MYSQL_BIND *param, + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) + +{ + (*row)+= param->pack_length; +} + + +static void skip_result_with_length(MYSQL_BIND *param __attribute__((unused)), + MYSQL_FIELD *field __attribute__((unused)), + uchar **row) + +{ + ulong length= net_field_length(row); + (*row)+= length; +} + + +static void skip_result_string(MYSQL_BIND *param __attribute__((unused)), + MYSQL_FIELD *field, + uchar **row) + +{ + ulong length= net_field_length(row); + (*row)+= length; + if (field->max_length < length) + field->max_length= length; +} + + +/* + Check that two field types are binary compatible i. e. + have equal representation in the binary protocol and + require client-side buffers of the same type. + + SYNOPSIS + is_binary_compatible() + type1 parameter type supplied by user + type2 field type, obtained from result set metadata + + RETURN + TRUE or FALSE +*/ + +static my_bool is_binary_compatible(enum enum_field_types type1, + enum enum_field_types type2) +{ + static const enum enum_field_types + range1[]= { MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR, MYSQL_TYPE_NULL }, + range2[]= { MYSQL_TYPE_INT24, MYSQL_TYPE_LONG, MYSQL_TYPE_NULL }, + range3[]= { MYSQL_TYPE_DATETIME, MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_NULL }, + range4[]= { MYSQL_TYPE_ENUM, MYSQL_TYPE_SET, MYSQL_TYPE_TINY_BLOB, + MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB, + MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_STRING, MYSQL_TYPE_GEOMETRY, + MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NULL }; + static const enum enum_field_types + *range_list[]= { range1, range2, range3, range4 }, + **range_list_end= range_list + sizeof(range_list)/sizeof(*range_list); + const enum enum_field_types **range, *type; + + if (type1 == type2) + return TRUE; + for (range= range_list; range != range_list_end; ++range) + { + /* check that both type1 and type2 are in the same range */ + my_bool type1_found= FALSE, type2_found= FALSE; + for (type= *range; *type != MYSQL_TYPE_NULL; type++) + { + type1_found|= type1 == *type; + type2_found|= type2 == *type; + } + if (type1_found || type2_found) + return type1_found && type2_found; + } + return FALSE; +} + + +/* + Setup a fetch function for one column of a result set. + + SYNOPSIS + setup_one_fetch_function() + param output buffer descriptor + field column descriptor + + DESCRIPTION + When user binds result set buffers or when result set + metadata is changed, we need to setup fetch (and possibly + conversion) functions for all columns of the result set. + In addition to that here we set up skip_result function, used + to update result set metadata in case when + STMT_ATTR_UPDATE_MAX_LENGTH attribute is set. + Notice that while fetch_result is chosen depending on both + field->type and param->type, skip_result depends on field->type + only. + + RETURN + TRUE fetch function for this typecode was not found (typecode + is not supported by the client library) + FALSE success +*/ + +static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) +{ + DBUG_ENTER("setup_one_fetch_function"); + + /* Setup data copy functions for the different supported types */ + switch (param->buffer_type) { + case MYSQL_TYPE_NULL: /* for dummy binds */ + /* + It's not binary compatible with anything the server can return: + no need to setup fetch_result, as it'll be reset anyway + */ + *param->length= 0; + break; + case MYSQL_TYPE_TINY: + param->fetch_result= fetch_result_tinyint; + *param->length= 1; + break; + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_YEAR: + param->fetch_result= fetch_result_short; + *param->length= 2; + break; + case MYSQL_TYPE_INT24: + case MYSQL_TYPE_LONG: + param->fetch_result= fetch_result_int32; + *param->length= 4; + break; + case MYSQL_TYPE_LONGLONG: + param->fetch_result= fetch_result_int64; + *param->length= 8; + break; + case MYSQL_TYPE_FLOAT: + param->fetch_result= fetch_result_float; + *param->length= 4; + break; + case MYSQL_TYPE_DOUBLE: + param->fetch_result= fetch_result_double; + *param->length= 8; + break; + case MYSQL_TYPE_TIME: + param->fetch_result= fetch_result_time; + *param->length= sizeof(MYSQL_TIME); + break; + case MYSQL_TYPE_DATE: + param->fetch_result= fetch_result_date; + *param->length= sizeof(MYSQL_TIME); + break; + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + param->fetch_result= fetch_result_datetime; + *param->length= sizeof(MYSQL_TIME); + break; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_BIT: + DBUG_ASSERT(param->buffer_length != 0); + param->fetch_result= fetch_result_bin; + break; + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + case MYSQL_TYPE_NEWDATE: + DBUG_ASSERT(param->buffer_length != 0); + param->fetch_result= fetch_result_str; + break; + default: + DBUG_PRINT("error", ("Unknown param->buffer_type: %u", + (uint) param->buffer_type)); + DBUG_RETURN(TRUE); + } + if (! is_binary_compatible(param->buffer_type, field->type)) + param->fetch_result= fetch_result_with_conversion; + + /* Setup skip_result functions (to calculate max_length) */ + param->skip_result= skip_result_fixed; + switch (field->type) { + case MYSQL_TYPE_NULL: /* for dummy binds */ + param->pack_length= 0; + field->max_length= 0; + break; + case MYSQL_TYPE_TINY: + param->pack_length= 1; + field->max_length= 4; /* as in '-127' */ + break; + case MYSQL_TYPE_YEAR: + case MYSQL_TYPE_SHORT: + param->pack_length= 2; + field->max_length= 6; /* as in '-32767' */ + break; + case MYSQL_TYPE_INT24: + field->max_length= 9; /* as in '16777216' or in '-8388607' */ + param->pack_length= 4; + break; + case MYSQL_TYPE_LONG: + field->max_length= 11; /* '-2147483647' */ + param->pack_length= 4; + break; + case MYSQL_TYPE_LONGLONG: + field->max_length= 21; /* '18446744073709551616' */ + param->pack_length= 8; + break; + case MYSQL_TYPE_FLOAT: + param->pack_length= 4; + field->max_length= MAX_DOUBLE_STRING_REP_LENGTH; + break; + case MYSQL_TYPE_DOUBLE: + param->pack_length= 8; + field->max_length= MAX_DOUBLE_STRING_REP_LENGTH; + break; + case MYSQL_TYPE_TIME: + field->max_length= 15; /* 19:23:48.123456 */ + param->skip_result= skip_result_with_length; + case MYSQL_TYPE_DATE: + field->max_length= 10; /* 2003-11-11 */ + param->skip_result= skip_result_with_length; + break; + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_TIMESTAMP: + param->skip_result= skip_result_with_length; + field->max_length= MAX_DATE_STRING_REP_LENGTH; + break; + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + case MYSQL_TYPE_GEOMETRY: + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_BIT: + case MYSQL_TYPE_NEWDATE: + param->skip_result= skip_result_string; + break; + default: + DBUG_PRINT("error", ("Unknown field->type: %u", (uint) field->type)); + DBUG_RETURN(TRUE); + } + DBUG_RETURN(FALSE); +} + + +/* + Setup the bind buffers for resultset processing +*/ + +my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) +{ + MYSQL_BIND *param, *end; + MYSQL_FIELD *field; + ulong bind_count= stmt->field_count; + uint param_count= 0; + DBUG_ENTER("mysql_stmt_bind_result"); + DBUG_PRINT("enter",("field_count: %lu", bind_count)); + + if (!bind_count) + { + int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ? + CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA; + set_stmt_error(stmt, errorcode, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + /* + We only need to check that stmt->field_count - if it is not null + stmt->bind was initialized in mysql_stmt_prepare + stmt->bind overlaps with bind if mysql_stmt_bind_param + is called from mysql_stmt_store_result. + */ + + if (stmt->bind != my_bind) + memcpy((char*) stmt->bind, (char*) my_bind, + sizeof(MYSQL_BIND) * bind_count); + + for (param= stmt->bind, end= param + bind_count, field= stmt->fields ; + param < end ; + param++, field++) + { + DBUG_PRINT("info",("buffer_type: %u field_type: %u", + (uint) param->buffer_type, (uint) field->type)); + /* + Set param->is_null to point to a dummy variable if it's not set. + This is to make the execute code easier + */ + if (!param->is_null) + param->is_null= ¶m->is_null_value; + + if (!param->length) + param->length= ¶m->length_value; + + if (!param->error) + param->error= ¶m->error_value; + + param->param_number= param_count++; + param->offset= 0; + + if (setup_one_fetch_function(param, field)) + { + strmov(stmt->sqlstate, unknown_sqlstate); + sprintf(stmt->last_error, + ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE), + field->type, param_count); + DBUG_RETURN(1); + } + } + stmt->bind_result_done= BIND_RESULT_DONE; + if (stmt->mysql->options.report_data_truncation) + stmt->bind_result_done|= REPORT_DATA_TRUNCATION; + + DBUG_RETURN(0); +} + + +/* + Fetch row data to bind buffers +*/ + +static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) +{ + MYSQL_BIND *my_bind, *end; + MYSQL_FIELD *field; + uchar *null_ptr, bit; + int truncation_count= 0; + /* + Precondition: if stmt->field_count is zero or row is NULL, read_row_* + function must return no data. + */ + DBUG_ASSERT(stmt->field_count); + DBUG_ASSERT(row); + + if (!stmt->bind_result_done) + { + /* If output parameters were not bound we should just return success */ + return 0; + } + + null_ptr= row; + row+= (stmt->field_count+9)/8; /* skip null bits */ + bit= 4; /* first 2 bits are reserved */ + + /* Copy complete row to application buffers */ + for (my_bind= stmt->bind, end= my_bind + stmt->field_count, + field= stmt->fields ; + my_bind < end ; + my_bind++, field++) + { + *my_bind->error= 0; + if (*null_ptr & bit) + { + /* + We should set both row_ptr and is_null to be able to see + nulls in mysql_stmt_fetch_column. This is because is_null may point + to user data which can be overwritten between mysql_stmt_fetch and + mysql_stmt_fetch_column, and in this case nullness of column will be + lost. See mysql_stmt_fetch_column for details. + */ + my_bind->row_ptr= NULL; + *my_bind->is_null= 1; + } + else + { + *my_bind->is_null= 0; + my_bind->row_ptr= row; + (*my_bind->fetch_result)(my_bind, field, &row); + truncation_count+= *my_bind->error; + } + if (!((bit<<=1) & 255)) + { + bit= 1; /* To next uchar */ + null_ptr++; + } + } + if (truncation_count && (stmt->bind_result_done & REPORT_DATA_TRUNCATION)) + return MYSQL_DATA_TRUNCATED; + return 0; +} + + +int cli_unbuffered_fetch(MYSQL *mysql, char **row) +{ + if (packet_error == cli_safe_read(mysql)) + return 1; + + *row= ((mysql->net.read_pos[0] == 254) ? NULL : + (char*) (mysql->net.read_pos+1)); + return 0; +} + + +/* + Fetch and return row data to bound buffers, if any +*/ + +int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt) +{ + int rc; + uchar *row; + DBUG_ENTER("mysql_stmt_fetch"); + + if ((rc= (*stmt->read_row_func)(stmt, &row)) || + ((rc= stmt_fetch_row(stmt, row)) && rc != MYSQL_DATA_TRUNCATED)) + { + stmt->state= MYSQL_STMT_PREPARE_DONE; /* XXX: this is buggy */ + stmt->read_row_func= (rc == MYSQL_NO_DATA) ? + stmt_read_row_no_data : stmt_read_row_no_result_set; + } + else + { + /* This is to know in mysql_stmt_fetch_column that data was fetched */ + stmt->state= MYSQL_STMT_FETCH_DONE; + } + DBUG_RETURN(rc); +} + + +/* + Fetch data for one specified column data + + SYNOPSIS + mysql_stmt_fetch_column() + stmt Prepared statement handler + my_bind Where data should be placed. Should be filled in as + when calling mysql_stmt_bind_result() + column Column to fetch (first column is 0) + ulong offset Offset in result data (to fetch blob in pieces) + This is normally 0 + RETURN + 0 ok + 1 error +*/ + +int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, + uint column, ulong offset) +{ + MYSQL_BIND *param= stmt->bind+column; + DBUG_ENTER("mysql_stmt_fetch_column"); + + if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE) + { + set_stmt_error(stmt, CR_NO_DATA, unknown_sqlstate, NULL); + return 1; + } + if (column >= stmt->field_count) + { + set_stmt_error(stmt, CR_INVALID_PARAMETER_NO, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + if (!my_bind->error) + my_bind->error= &my_bind->error_value; + *my_bind->error= 0; + if (param->row_ptr) + { + MYSQL_FIELD *field= stmt->fields+column; + uchar *row= param->row_ptr; + my_bind->offset= offset; + if (my_bind->is_null) + *my_bind->is_null= 0; + if (my_bind->length) /* Set the length if non char/binary types */ + *my_bind->length= *param->length; + else + my_bind->length= ¶m->length_value; /* Needed for fetch_result() */ + fetch_result_with_conversion(my_bind, field, &row); + } + else + { + if (my_bind->is_null) + *my_bind->is_null= 1; + } + DBUG_RETURN(0); +} + + +/* + Read all rows of data from server (binary format) +*/ + +int cli_read_binary_rows(MYSQL_STMT *stmt) +{ + ulong pkt_len; + uchar *cp; + MYSQL *mysql= stmt->mysql; + MYSQL_DATA *result= &stmt->result; + MYSQL_ROWS *cur, **prev_ptr= &result->data; + NET *net; + + DBUG_ENTER("cli_read_binary_rows"); + + if (!mysql) + { + set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + net = &mysql->net; + + while ((pkt_len= cli_safe_read(mysql)) != packet_error) + { + cp= net->read_pos; + if (cp[0] != 254 || pkt_len >= 8) + { + if (!(cur= (MYSQL_ROWS*) alloc_root(&result->alloc, + sizeof(MYSQL_ROWS) + pkt_len - 1))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate, NULL); + goto err; + } + cur->data= (MYSQL_ROW) (cur+1); + *prev_ptr= cur; + prev_ptr= &cur->next; + memcpy((char *) cur->data, (char *) cp+1, pkt_len-1); + cur->length= pkt_len; /* To allow us to do sanity checks */ + result->rows++; + } + else + { + /* end of data */ + *prev_ptr= 0; + mysql->warning_count= uint2korr(cp+1); + mysql->server_status= uint2korr(cp+3); + DBUG_PRINT("info",("status: %u warning_count: %u", + mysql->server_status, mysql->warning_count)); + DBUG_RETURN(0); + } + } + set_stmt_errmsg(stmt, net); + +err: + DBUG_RETURN(1); +} + + +/* + Update meta data for statement + + SYNOPSIS + stmt_update_metadata() + stmt Statement handler + row Binary data + + NOTES + Only updates MYSQL_FIELD->max_length for strings +*/ + +static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data) +{ + MYSQL_BIND *my_bind, *end; + MYSQL_FIELD *field; + uchar *null_ptr, bit; + uchar *row= (uchar*) data->data; +#ifndef DBUG_OFF + uchar *row_end= row + data->length; +#endif + + null_ptr= row; + row+= (stmt->field_count+9)/8; /* skip null bits */ + bit= 4; /* first 2 bits are reserved */ + + /* Go through all fields and calculate metadata */ + for (my_bind= stmt->bind, end= my_bind + stmt->field_count, field= stmt->fields ; + my_bind < end ; + my_bind++, field++) + { + if (!(*null_ptr & bit)) + (*my_bind->skip_result)(my_bind, field, &row); + DBUG_ASSERT(row <= row_end); + if (!((bit<<=1) & 255)) + { + bit= 1; /* To next uchar */ + null_ptr++; + } + } +} + + +/* + Store or buffer the binary results to stmt +*/ + +int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) +{ + MYSQL *mysql= stmt->mysql; + MYSQL_DATA *result= &stmt->result; + DBUG_ENTER("mysql_stmt_store_result"); + + if (!mysql) + { + /* mysql can be reset in mysql_close called from mysql_reconnect */ + set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + if (!stmt->field_count) + DBUG_RETURN(0); + + if ((int) stmt->state < (int) MYSQL_STMT_EXECUTE_DONE) + { + set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + if (stmt->last_errno) + { + /* An attempt to use an invalid statement handle. */ + DBUG_RETURN(1); + } + + if (mysql->status == MYSQL_STATUS_READY && + stmt->server_status & SERVER_STATUS_CURSOR_EXISTS) + { + /* + Server side cursor exist, tell server to start sending the rows + */ + NET *net= &mysql->net; + uchar buff[4 /* statement id */ + + 4 /* number of rows to fetch */]; + + /* Send row request to the server */ + int4store(buff, stmt->stmt_id); + int4store(buff + 4, (int)~0); /* number of rows to fetch */ + if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff), + (uchar*) 0, 0, 1, stmt)) + { + set_stmt_errmsg(stmt, net); + DBUG_RETURN(1); + } + } + else if (mysql->status != MYSQL_STATUS_GET_RESULT) + { + set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + + if (stmt->update_max_length && !stmt->bind_result_done) + { + /* + We must initalize the bind structure to be able to calculate + max_length + */ + MYSQL_BIND *my_bind, *end; + MYSQL_FIELD *field; + bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count); + + for (my_bind= stmt->bind, end= my_bind + stmt->field_count, + field= stmt->fields; + my_bind < end ; + my_bind++, field++) + { + my_bind->buffer_type= MYSQL_TYPE_NULL; + my_bind->buffer_length=1; + } + + if (mysql_stmt_bind_result(stmt, stmt->bind)) + DBUG_RETURN(1); + stmt->bind_result_done= 0; /* No normal bind done */ + } + + if ((*mysql->methods->read_binary_rows)(stmt)) + { + free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); + result->data= NULL; + result->rows= 0; + mysql->status= MYSQL_STATUS_READY; + DBUG_RETURN(1); + } + + /* Assert that if there was a cursor, all rows have been fetched */ + DBUG_ASSERT(mysql->status != MYSQL_STATUS_READY || + (mysql->server_status & SERVER_STATUS_LAST_ROW_SENT)); + + if (stmt->update_max_length) + { + MYSQL_ROWS *cur= result->data; + for(; cur; cur=cur->next) + stmt_update_metadata(stmt, cur); + } + + stmt->data_cursor= result->data; + mysql->affected_rows= stmt->affected_rows= result->rows; + stmt->read_row_func= stmt_read_row_buffered; + mysql->unbuffered_fetch_owner= 0; /* set in stmt_execute */ + mysql->status= MYSQL_STATUS_READY; /* server is ready */ + DBUG_RETURN(0); /* Data buffered, must be fetched with mysql_stmt_fetch() */ +} + + +/* + Seek to desired row in the statement result set +*/ + +MYSQL_ROW_OFFSET STDCALL +mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row) +{ + MYSQL_ROW_OFFSET offset= stmt->data_cursor; + DBUG_ENTER("mysql_stmt_row_seek"); + + stmt->data_cursor= row; + DBUG_RETURN(offset); +} + + +/* + Return the current statement row cursor position +*/ + +MYSQL_ROW_OFFSET STDCALL +mysql_stmt_row_tell(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_stmt_row_tell"); + + DBUG_RETURN(stmt->data_cursor); +} + + +/* + Move the stmt result set data cursor to specified row +*/ + +void STDCALL +mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) +{ + MYSQL_ROWS *tmp= stmt->result.data; + DBUG_ENTER("mysql_stmt_data_seek"); + DBUG_PRINT("enter",("row id to seek: %ld",(long) row)); + + for (; tmp && row; --row, tmp= tmp->next) + ; + stmt->data_cursor= tmp; + if (!row && tmp) + { + /* Rewind the counter */ + stmt->read_row_func= stmt_read_row_buffered; + stmt->state= MYSQL_STMT_EXECUTE_DONE; + } + DBUG_VOID_RETURN; +} + + +/* + Return total rows the current statement result set +*/ + +my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_stmt_num_rows"); + + DBUG_RETURN(stmt->result.rows); +} + + +/* + Free the client side memory buffers, reset long data state + on client if necessary, and reset the server side statement if + this has been requested. +*/ + +static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) +{ + /* If statement hasn't been prepared there is nothing to reset */ + if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) + { + MYSQL *mysql= stmt->mysql; + MYSQL_DATA *result= &stmt->result; + + /* + Reset stored result set if so was requested or it's a part + of cursor fetch. + */ + if (flags & RESET_STORE_RESULT) + { + /* Result buffered */ + free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); + result->data= NULL; + result->rows= 0; + stmt->data_cursor= NULL; + } + if (flags & RESET_LONG_DATA) + { + MYSQL_BIND *param= stmt->params, *param_end= param + stmt->param_count; + /* Clear long_data_used flags */ + for (; param < param_end; param++) + param->long_data_used= 0; + } + stmt->read_row_func= stmt_read_row_no_result_set; + if (mysql) + { + if ((int) stmt->state > (int) MYSQL_STMT_PREPARE_DONE) + { + if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) + mysql->unbuffered_fetch_owner= 0; + if (stmt->field_count && mysql->status != MYSQL_STATUS_READY) + { + /* There is a result set and it belongs to this statement */ + (*mysql->methods->flush_use_result)(mysql, FALSE); + if (mysql->unbuffered_fetch_owner) + *mysql->unbuffered_fetch_owner= TRUE; + mysql->status= MYSQL_STATUS_READY; + } + } + if (flags & RESET_SERVER_SIDE) + { + /* + Reset the server side statement and close the server side + cursor if it exists. + */ + uchar buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */ + int4store(buff, stmt->stmt_id); + if ((*mysql->methods->advanced_command)(mysql, COM_STMT_RESET, buff, + sizeof(buff), 0, 0, 0, stmt)) + { + set_stmt_errmsg(stmt, &mysql->net); + stmt->state= MYSQL_STMT_INIT_DONE; + return 1; + } + } + } + if (flags & RESET_CLEAR_ERROR) + stmt_clear_error(stmt); + stmt->state= MYSQL_STMT_PREPARE_DONE; + } + return 0; +} + +my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_stmt_free_result"); + + /* Free the client side and close the server side cursor if there is one */ + DBUG_RETURN(reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT | + RESET_CLEAR_ERROR)); +} + +/******************************************************************** + statement error handling and close +*********************************************************************/ + +/* + Close the statement handle by freeing all alloced resources + + SYNOPSIS + mysql_stmt_close() + stmt Statement handle + + RETURN VALUES + 0 ok + 1 error +*/ + +my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) +{ + MYSQL *mysql= stmt->mysql; + int rc= 0; + DBUG_ENTER("mysql_stmt_close"); + + free_root(&stmt->result.alloc, MYF(0)); + free_root(&stmt->mem_root, MYF(0)); + + if (mysql) + { + mysql->stmts= list_delete(mysql->stmts, &stmt->list); + /* + Clear NET error state: if the following commands come through + successfully, connection will still be usable for other commands. + */ + net_clear_error(&mysql->net); + if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) + { + uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ + + if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) + mysql->unbuffered_fetch_owner= 0; + if (mysql->status != MYSQL_STATUS_READY) + { + /* + Flush result set of the connection. If it does not belong + to this statement, set a warning. + */ + (*mysql->methods->flush_use_result)(mysql, TRUE); + if (mysql->unbuffered_fetch_owner) + *mysql->unbuffered_fetch_owner= TRUE; + mysql->status= MYSQL_STATUS_READY; + } + int4store(buff, stmt->stmt_id); + if ((rc= stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt))) + { + set_stmt_errmsg(stmt, &mysql->net); + } + } + } + + my_free((uchar*) stmt, MYF(MY_WME)); + + DBUG_RETURN(test(rc)); +} + +/* + Reset the statement buffers in server +*/ + +my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_stmt_reset"); + DBUG_ASSERT(stmt != 0); + if (!stmt->mysql) + { + /* mysql can be reset in mysql_close called from mysql_reconnect */ + set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL); + DBUG_RETURN(1); + } + /* Reset the client and server sides of the prepared statement */ + DBUG_RETURN(reset_stmt_handle(stmt, + RESET_SERVER_SIDE | RESET_LONG_DATA | + RESET_CLEAR_ERROR)); +} + +/* + Return statement error code +*/ + +uint STDCALL mysql_stmt_errno(MYSQL_STMT * stmt) +{ + DBUG_ENTER("mysql_stmt_errno"); + DBUG_RETURN(stmt->last_errno); +} + +const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt) +{ + DBUG_ENTER("mysql_stmt_sqlstate"); + DBUG_RETURN(stmt->sqlstate); +} + +/* + Return statement error message +*/ + +const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt) +{ + DBUG_ENTER("mysql_stmt_error"); + DBUG_RETURN(stmt->last_error); +} + + +/******************************************************************** + Transactional APIs +*********************************************************************/ + +/* + Commit the current transaction +*/ + +my_bool STDCALL mysql_commit(MYSQL * mysql) +{ + DBUG_ENTER("mysql_commit"); + DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6)); +} + +/* + Rollback the current transaction +*/ + +my_bool STDCALL mysql_rollback(MYSQL * mysql) +{ + DBUG_ENTER("mysql_rollback"); + DBUG_RETURN((my_bool) mysql_real_query(mysql, "rollback", 8)); +} + + +/* + Set autocommit to either true or false +*/ + +my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode) +{ + DBUG_ENTER("mysql_autocommit"); + DBUG_PRINT("enter", ("mode : %d", auto_mode)); + + DBUG_RETURN((my_bool) mysql_real_query(mysql, auto_mode ? + "set autocommit=1":"set autocommit=0", + 16)); +} + + +/******************************************************************** + Multi query execution + SPs APIs +*********************************************************************/ + +/* + Returns true/false to indicate whether any more query results exist + to be read using mysql_next_result() +*/ + +my_bool STDCALL mysql_more_results(MYSQL *mysql) +{ + my_bool res; + DBUG_ENTER("mysql_more_results"); + + res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1: 0); + DBUG_PRINT("exit",("More results exists ? %d", res)); + DBUG_RETURN(res); +} + + +/* + Reads and returns the next query results +*/ +int STDCALL mysql_next_result(MYSQL *mysql) +{ + DBUG_ENTER("mysql_next_result"); + + if (mysql->status != MYSQL_STATUS_READY) + { + set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + DBUG_RETURN(1); + } + + net_clear_error(&mysql->net); + mysql->affected_rows= ~(my_ulonglong) 0; + + if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS) + DBUG_RETURN((*mysql->methods->next_result)(mysql)); + + DBUG_RETURN(-1); /* No more results */ +} + + +int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt) +{ + MYSQL *mysql= stmt->mysql; + int rc; + DBUG_ENTER("mysql_stmt_next_result"); + + if (!mysql) + DBUG_RETURN(1); + + if (stmt->last_errno) + DBUG_RETURN(stmt->last_errno); + + if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS) + { + if (reset_stmt_handle(stmt, RESET_STORE_RESULT)) + DBUG_RETURN(1); + } + + rc= mysql_next_result(mysql); + + if (rc) + { + set_stmt_errmsg(stmt, &mysql->net); + DBUG_RETURN(rc); + } + + stmt->state= MYSQL_STMT_EXECUTE_DONE; + stmt->bind_result_done= FALSE; + + if (mysql->field_count) + { + alloc_stmt_fields(stmt); + prepare_to_fetch_result(stmt); + } + else + { + stmt->field_count= mysql->field_count; + } + + DBUG_RETURN(0); +} + + +MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql) +{ + return (*mysql->methods->use_result)(mysql); +} + +my_bool STDCALL mysql_read_query_result(MYSQL *mysql) +{ + return (*mysql->methods->read_query_result)(mysql); +} + diff --git a/dep/include/mysql/Libmysql.def b/externals/mysql/libmysql/libmysql.def similarity index 73% rename from dep/include/mysql/Libmysql.def rename to externals/mysql/libmysql/libmysql.def index 81f86dc8726..869298497dd 100644 --- a/dep/include/mysql/Libmysql.def +++ b/externals/mysql/libmysql/libmysql.def @@ -1,33 +1,7 @@ LIBRARY LIBMYSQL VERSION 6.0 EXPORTS - _dig_vec_lower - _dig_vec_upper - bmove_upp - delete_dynamic - free_defaults - getopt_compare_strings - getopt_ull_limit_value - handle_options - init_dynamic_array - insert_dynamic - int2str - is_prefix - list_add - list_delete - load_defaults - my_end - my_getopt_print_errors - my_init - my_malloc - my_memdup - my_no_flags_free - my_path mysql_get_parameters - my_print_help - my_print_variables - my_realloc - my_strdup mysql_thread_end mysql_thread_init myodbc_remove_escape @@ -117,37 +91,17 @@ EXPORTS mysql_stmt_sqlstate mysql_sqlstate mysql_get_server_version - set_dynamic - strcend - strcont - strdup_root - strfill - strinstr - strmake - strmov - strxmov mysql_stmt_prepare mysql_stmt_init mysql_stmt_insert_id mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count - client_errors mysql_set_local_infile_default mysql_set_local_infile_handler - mysql_disable_reads_from_master - mysql_disable_rpl_parse - mysql_enable_reads_from_master - mysql_enable_rpl_parse - mysql_master_query - mysql_rpl_parse_enabled - mysql_rpl_probe - mysql_rpl_query_type - mysql_slave_query mysql_embedded mysql_server_init mysql_server_end mysql_set_character_set mysql_get_character_set_info - get_defaults_options - modify_defaults_file + mysql_stmt_next_result diff --git a/externals/mysql/libmysql/my_time.c b/externals/mysql/libmysql/my_time.c new file mode 100644 index 00000000000..9dd0502b638 --- /dev/null +++ b/externals/mysql/libmysql/my_time.c @@ -0,0 +1,1263 @@ +/* Copyright (C) 2004-2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +/* Windows version of localtime_r() is declared in my_ptrhead.h */ +#include + +ulonglong log_10_int[20]= +{ + 1, 10, 100, 1000, 10000UL, 100000UL, 1000000UL, 10000000UL, + 100000000ULL, 1000000000ULL, 10000000000ULL, 100000000000ULL, + 1000000000000ULL, 10000000000000ULL, 100000000000000ULL, + 1000000000000000ULL, 10000000000000000ULL, 100000000000000000ULL, + 1000000000000000000ULL, 10000000000000000000ULL +}; + + +/* Position for YYYY-DD-MM HH-MM-DD.FFFFFF AM in default format */ + +static uchar internal_format_positions[]= +{0, 1, 2, 3, 4, 5, 6, (uchar) 255}; + +static char time_separator=':'; + +static ulong const days_at_timestart=719528; /* daynr at 1970.01.01 */ +uchar days_in_month[]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0}; + +/* + Offset of system time zone from UTC in seconds used to speed up + work of my_system_gmt_sec() function. +*/ +static long my_time_zone=0; + + +/* Calc days in one year. works with 0 <= year <= 99 */ + +uint calc_days_in_year(uint year) +{ + return ((year & 3) == 0 && (year%100 || (year%400 == 0 && year)) ? + 366 : 365); +} + +/** + @brief Check datetime value for validity according to flags. + + @param[in] ltime Date to check. + @param[in] not_zero_date ltime is not the zero date + @param[in] flags flags to check + (see str_to_datetime() flags in my_time.h) + @param[out] was_cut set to 2 if value was invalid according to flags. + (Feb 29 in non-leap etc.) This remains unchanged + if value is not invalid. + + @details Here we assume that year and month is ok! + If month is 0 we allow any date. (This only happens if we allow zero + date parts in str_to_datetime()) + Disallow dates with zero year and non-zero month and/or day. + + @return + 0 OK + 1 error +*/ + +my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, + ulong flags, int *was_cut) +{ + if (not_zero_date) + { + if ((((flags & TIME_NO_ZERO_IN_DATE) || !(flags & TIME_FUZZY_DATE)) && + (ltime->month == 0 || ltime->day == 0)) || + (!(flags & TIME_INVALID_DATES) && + ltime->month && ltime->day > days_in_month[ltime->month-1] && + (ltime->month != 2 || calc_days_in_year(ltime->year) != 366 || + ltime->day != 29))) + { + *was_cut= 2; + return TRUE; + } + } + else if (flags & TIME_NO_ZERO_DATE) + { + /* + We don't set *was_cut here to signal that the problem was a zero date + and not an invalid date + */ + return TRUE; + } + return FALSE; +} + + +/* + Convert a timestamp string to a MYSQL_TIME value. + + SYNOPSIS + str_to_datetime() + str String to parse + length Length of string + l_time Date is stored here + flags Bitmap of following items + TIME_FUZZY_DATE Set if we should allow partial dates + TIME_DATETIME_ONLY Set if we only allow full datetimes. + TIME_NO_ZERO_IN_DATE Don't allow partial dates + TIME_NO_ZERO_DATE Don't allow 0000-00-00 date + TIME_INVALID_DATES Allow 2000-02-31 + was_cut 0 Value OK + 1 If value was cut during conversion + 2 check_date(date,flags) considers date invalid + + DESCRIPTION + At least the following formats are recogniced (based on number of digits) + YYMMDD, YYYYMMDD, YYMMDDHHMMSS, YYYYMMDDHHMMSS + YY-MM-DD, YYYY-MM-DD, YY-MM-DD HH.MM.SS + YYYYMMDDTHHMMSS where T is a the character T (ISO8601) + Also dates where all parts are zero are allowed + + The second part may have an optional .###### fraction part. + + NOTES + This function should work with a format position vector as long as the + following things holds: + - All date are kept together and all time parts are kept together + - Date and time parts must be separated by blank + - Second fractions must come after second part and be separated + by a '.'. (The second fractions are optional) + - AM/PM must come after second fractions (or after seconds if no fractions) + - Year must always been specified. + - If time is before date, then we will use datetime format only if + the argument consist of two parts, separated by space. + Otherwise we will assume the argument is a date. + - The hour part must be specified in hour-minute-second order. + + RETURN VALUES + MYSQL_TIMESTAMP_NONE String wasn't a timestamp, like + [DD [HH:[MM:[SS]]]].fraction. + l_time is not changed. + MYSQL_TIMESTAMP_DATE DATE string (YY MM and DD parts ok) + MYSQL_TIMESTAMP_DATETIME Full timestamp + MYSQL_TIMESTAMP_ERROR Timestamp with wrong values. + All elements in l_time is set to 0 +*/ + +#define MAX_DATE_PARTS 8 + +enum enum_mysql_timestamp_type +str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, + uint flags, int *was_cut) +{ + uint field_length, year_length, digits, i, number_of_fields; + uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; + uint add_hours= 0, start_loop; + ulong not_zero_date, allow_space; + my_bool is_internal_format; + const char *pos, *last_field_pos; + const char *end=str+length; + const uchar *format_position; + my_bool found_delimitier= 0, found_space= 0; + uint frac_pos, frac_len; + DBUG_ENTER("str_to_datetime"); + DBUG_PRINT("ENTER",("str: %.*s",length,str)); + + LINT_INIT(field_length); + LINT_INIT(year_length); + LINT_INIT(last_field_pos); + + *was_cut= 0; + + /* Skip space at start */ + for (; str != end && my_isspace(&my_charset_latin1, *str) ; str++) + ; + if (str == end || ! my_isdigit(&my_charset_latin1, *str)) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + + is_internal_format= 0; + /* This has to be changed if want to activate different timestamp formats */ + format_position= internal_format_positions; + + /* + Calculate number of digits in first part. + If length= 8 or >= 14 then year is of format YYYY. + (YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS) + */ + for (pos=str; + pos != end && (my_isdigit(&my_charset_latin1,*pos) || *pos == 'T'); + pos++) + ; + + digits= (uint) (pos-str); + start_loop= 0; /* Start of scan loop */ + date_len[format_position[0]]= 0; /* Length of year field */ + if (pos == end || *pos == '.') + { + /* Found date in internal format (only numbers like YYYYMMDD) */ + year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2; + field_length= year_length; + is_internal_format= 1; + format_position= internal_format_positions; + } + else + { + if (format_position[0] >= 3) /* If year is after HHMMDD */ + { + /* + If year is not in first part then we have to determinate if we got + a date field or a datetime field. + We do this by checking if there is two numbers separated by + space in the input. + */ + while (pos < end && !my_isspace(&my_charset_latin1, *pos)) + pos++; + while (pos < end && !my_isdigit(&my_charset_latin1, *pos)) + pos++; + if (pos == end) + { + if (flags & TIME_DATETIME_ONLY) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); /* Can't be a full datetime */ + } + /* Date field. Set hour, minutes and seconds to 0 */ + date[0]= date[1]= date[2]= date[3]= date[4]= 0; + start_loop= 5; /* Start with first date part */ + } + } + + field_length= format_position[0] == 0 ? 4 : 2; + } + + /* + Only allow space in the first "part" of the datetime field and: + - after days, part seconds + - before and after AM/PM (handled by code later) + + 2003-03-03 20:00:20 AM + 20:00:20.000000 AM 03-03-2000 + */ + i= max((uint) format_position[0], (uint) format_position[1]); + set_if_bigger(i, (uint) format_position[2]); + allow_space= ((1 << i) | (1 << format_position[6])); + allow_space&= (1 | 2 | 4 | 8); + + not_zero_date= 0; + for (i = start_loop; + i < MAX_DATE_PARTS-1 && str != end && + my_isdigit(&my_charset_latin1,*str); + i++) + { + const char *start= str; + ulong tmp_value= (uint) (uchar) (*str++ - '0'); + + /* + Internal format means no delimiters; every field has a fixed + width. Otherwise, we scan until we find a delimiter and discard + leading zeroes -- except for the microsecond part, where leading + zeroes are significant, and where we never process more than six + digits. + */ + my_bool scan_until_delim= !is_internal_format && + ((i != format_position[6])); + + while (str != end && my_isdigit(&my_charset_latin1,str[0]) && + (scan_until_delim || --field_length)) + { + tmp_value=tmp_value*10 + (ulong) (uchar) (*str - '0'); + str++; + } + date_len[i]= (uint) (str - start); + if (tmp_value > 999999) /* Impossible date part */ + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + date[i]=tmp_value; + not_zero_date|= tmp_value; + + /* Length of next field */ + field_length= format_position[i+1] == 0 ? 4 : 2; + + if ((last_field_pos= str) == end) + { + i++; /* Register last found part */ + break; + } + /* Allow a 'T' after day to allow CCYYMMDDT type of fields */ + if (i == format_position[2] && *str == 'T') + { + str++; /* ISO8601: CCYYMMDDThhmmss */ + continue; + } + if (i == format_position[5]) /* Seconds */ + { + if (*str == '.') /* Followed by part seconds */ + { + str++; + field_length= 6; /* 6 digits */ + } + continue; + } + while (str != end && + (my_ispunct(&my_charset_latin1,*str) || + my_isspace(&my_charset_latin1,*str))) + { + if (my_isspace(&my_charset_latin1,*str)) + { + if (!(allow_space & (1 << i))) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + found_space= 1; + } + str++; + found_delimitier= 1; /* Should be a 'normal' date */ + } + /* Check if next position is AM/PM */ + if (i == format_position[6]) /* Seconds, time for AM/PM */ + { + i++; /* Skip AM/PM part */ + if (format_position[7] != 255) /* If using AM/PM */ + { + if (str+2 <= end && (str[1] == 'M' || str[1] == 'm')) + { + if (str[0] == 'p' || str[0] == 'P') + add_hours= 12; + else if (str[0] != 'a' || str[0] != 'A') + continue; /* Not AM/PM */ + str+= 2; /* Skip AM/PM */ + /* Skip space after AM/PM */ + while (str != end && my_isspace(&my_charset_latin1,*str)) + str++; + } + } + } + last_field_pos= str; + } + if (found_delimitier && !found_space && (flags & TIME_DATETIME_ONLY)) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); /* Can't be a datetime */ + } + + str= last_field_pos; + + number_of_fields= i - start_loop; + while (i < MAX_DATE_PARTS) + { + date_len[i]= 0; + date[i++]= 0; + } + + if (!is_internal_format) + { + year_length= date_len[(uint) format_position[0]]; + if (!year_length) /* Year must be specified */ + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + + l_time->year= date[(uint) format_position[0]]; + l_time->month= date[(uint) format_position[1]]; + l_time->day= date[(uint) format_position[2]]; + l_time->hour= date[(uint) format_position[3]]; + l_time->minute= date[(uint) format_position[4]]; + l_time->second= date[(uint) format_position[5]]; + + frac_pos= (uint) format_position[6]; + frac_len= date_len[frac_pos]; + if (frac_len < 6) + date[frac_pos]*= (uint) log_10_int[6 - frac_len]; + l_time->second_part= date[frac_pos]; + + if (format_position[7] != (uchar) 255) + { + if (l_time->hour > 12) + { + *was_cut= 1; + goto err; + } + l_time->hour= l_time->hour%12 + add_hours; + } + } + else + { + l_time->year= date[0]; + l_time->month= date[1]; + l_time->day= date[2]; + l_time->hour= date[3]; + l_time->minute= date[4]; + l_time->second= date[5]; + if (date_len[6] < 6) + date[6]*= (uint) log_10_int[6 - date_len[6]]; + l_time->second_part=date[6]; + } + l_time->neg= 0; + + if (year_length == 2 && not_zero_date) + l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); + + if (number_of_fields < 3 || + l_time->year > 9999 || l_time->month > 12 || + l_time->day > 31 || l_time->hour > 23 || + l_time->minute > 59 || l_time->second > 59) + { + /* Only give warning for a zero date if there is some garbage after */ + if (!not_zero_date) /* If zero date */ + { + for (; str != end ; str++) + { + if (!my_isspace(&my_charset_latin1, *str)) + { + not_zero_date= 1; /* Give warning */ + break; + } + } + } + *was_cut= test(not_zero_date); + goto err; + } + + if (check_date(l_time, not_zero_date != 0, flags, was_cut)) + goto err; + + l_time->time_type= (number_of_fields <= 3 ? + MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME); + + for (; str != end ; str++) + { + if (!my_isspace(&my_charset_latin1,*str)) + { + *was_cut= 1; + break; + } + } + + DBUG_RETURN(l_time->time_type= + (number_of_fields <= 3 ? MYSQL_TIMESTAMP_DATE : + MYSQL_TIMESTAMP_DATETIME)); + +err: + bzero((char*) l_time, sizeof(*l_time)); + DBUG_RETURN(MYSQL_TIMESTAMP_ERROR); +} + + +/* + Convert a time string to a MYSQL_TIME struct. + + SYNOPSIS + str_to_time() + str A string in full TIMESTAMP format or + [-] DAYS [H]H:MM:SS, [H]H:MM:SS, [M]M:SS, [H]HMMSS, + [M]MSS or [S]S + There may be an optional [.second_part] after seconds + length Length of str + l_time Store result here + warning Set MYSQL_TIME_WARN_TRUNCATED flag if the input string + was cut during conversion, and/or + MYSQL_TIME_WARN_OUT_OF_RANGE flag, if the value is + out of range. + + NOTES + Because of the extra days argument, this function can only + work with times where the time arguments are in the above order. + + RETURN + 0 ok + 1 error +*/ + +my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time, + int *warning) +{ + ulong date[5]; + ulonglong value; + const char *end=str+length, *end_of_days; + my_bool found_days,found_hours; + uint state; + + l_time->neg=0; + *warning= 0; + for (; str != end && my_isspace(&my_charset_latin1,*str) ; str++) + length--; + if (str != end && *str == '-') + { + l_time->neg=1; + str++; + length--; + } + if (str == end) + return 1; + + /* Check first if this is a full TIMESTAMP */ + if (length >= 12) + { /* Probably full timestamp */ + int was_cut; + enum enum_mysql_timestamp_type + res= str_to_datetime(str, length, l_time, + (TIME_FUZZY_DATE | TIME_DATETIME_ONLY), &was_cut); + if ((int) res >= (int) MYSQL_TIMESTAMP_ERROR) + { + if (was_cut) + *warning|= MYSQL_TIME_WARN_TRUNCATED; + return res == MYSQL_TIMESTAMP_ERROR; + } + } + + /* Not a timestamp. Try to get this as a DAYS_TO_SECOND string */ + for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) + value=value*10L + (long) (*str - '0'); + + /* Skip all space after 'days' */ + end_of_days= str; + for (; str != end && my_isspace(&my_charset_latin1, str[0]) ; str++) + ; + + LINT_INIT(state); + found_days=found_hours=0; + if ((uint) (end-str) > 1 && str != end_of_days && + my_isdigit(&my_charset_latin1, *str)) + { /* Found days part */ + date[0]= (ulong) value; + state= 1; /* Assume next is hours */ + found_days= 1; + } + else if ((end-str) > 1 && *str == time_separator && + my_isdigit(&my_charset_latin1, str[1])) + { + date[0]= 0; /* Assume we found hours */ + date[1]= (ulong) value; + state=2; + found_hours=1; + str++; /* skip ':' */ + } + else + { + /* String given as one number; assume HHMMSS format */ + date[0]= 0; + date[1]= (ulong) (value/10000); + date[2]= (ulong) (value/100 % 100); + date[3]= (ulong) (value % 100); + state=4; + goto fractional; + } + + /* Read hours, minutes and seconds */ + for (;;) + { + for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) + value=value*10L + (long) (*str - '0'); + date[state++]= (ulong) value; + if (state == 4 || (end-str) < 2 || *str != time_separator || + !my_isdigit(&my_charset_latin1,str[1])) + break; + str++; /* Skip time_separator (':') */ + } + + if (state != 4) + { /* Not HH:MM:SS */ + /* Fix the date to assume that seconds was given */ + if (!found_hours && !found_days) + { + bmove_upp((uchar*) (date+4), (uchar*) (date+state), + sizeof(long)*(state-1)); + bzero((uchar*) date, sizeof(long)*(4-state)); + } + else + bzero((uchar*) (date+state), sizeof(long)*(4-state)); + } + +fractional: + /* Get fractional second part */ + if ((end-str) >= 2 && *str == '.' && my_isdigit(&my_charset_latin1,str[1])) + { + int field_length= 5; + str++; value=(uint) (uchar) (*str - '0'); + while (++str != end && my_isdigit(&my_charset_latin1, *str)) + { + if (field_length-- > 0) + value= value*10 + (uint) (uchar) (*str - '0'); + } + if (field_length > 0) + value*= (long) log_10_int[field_length]; + else if (field_length < 0) + *warning|= MYSQL_TIME_WARN_TRUNCATED; + date[4]= (ulong) value; + } + else + date[4]=0; + + /* Check for exponent part: E | E */ + /* (may occur as result of %g formatting of time value) */ + if ((end - str) > 1 && + (*str == 'e' || *str == 'E') && + (my_isdigit(&my_charset_latin1, str[1]) || + ((str[1] == '-' || str[1] == '+') && + (end - str) > 2 && + my_isdigit(&my_charset_latin1, str[2])))) + return 1; + + if (internal_format_positions[7] != 255) + { + /* Read a possible AM/PM */ + while (str != end && my_isspace(&my_charset_latin1, *str)) + str++; + if (str+2 <= end && (str[1] == 'M' || str[1] == 'm')) + { + if (str[0] == 'p' || str[0] == 'P') + { + str+= 2; + date[1]= date[1]%12 + 12; + } + else if (str[0] == 'a' || str[0] == 'A') + str+=2; + } + } + + /* Integer overflow checks */ + if (date[0] > UINT_MAX || date[1] > UINT_MAX || + date[2] > UINT_MAX || date[3] > UINT_MAX || + date[4] > UINT_MAX) + return 1; + + l_time->year= 0; /* For protocol::store_time */ + l_time->month= 0; + l_time->day= date[0]; + l_time->hour= date[1]; + l_time->minute= date[2]; + l_time->second= date[3]; + l_time->second_part= date[4]; + l_time->time_type= MYSQL_TIMESTAMP_TIME; + + /* Check if the value is valid and fits into MYSQL_TIME range */ + if (check_time_range(l_time, warning)) + return 1; + + /* Check if there is garbage at end of the MYSQL_TIME specification */ + if (str != end) + { + do + { + if (!my_isspace(&my_charset_latin1,*str)) + { + *warning|= MYSQL_TIME_WARN_TRUNCATED; + break; + } + } while (++str != end); + } + return 0; +} + + +/* + Check 'time' value to lie in the MYSQL_TIME range + + SYNOPSIS: + check_time_range() + time pointer to MYSQL_TIME value + warning set MYSQL_TIME_WARN_OUT_OF_RANGE flag if the value is out of range + + DESCRIPTION + If the time value lies outside of the range [-838:59:59, 838:59:59], + set it to the closest endpoint of the range and set + MYSQL_TIME_WARN_OUT_OF_RANGE flag in the 'warning' variable. + + RETURN + 0 time value is valid, but was possibly truncated + 1 time value is invalid +*/ + +int check_time_range(struct st_mysql_time *my_time, int *warning) +{ + longlong hour; + + if (my_time->minute >= 60 || my_time->second >= 60) + return 1; + + hour= my_time->hour + (24*my_time->day); + if (hour <= TIME_MAX_HOUR && + (hour != TIME_MAX_HOUR || my_time->minute != TIME_MAX_MINUTE || + my_time->second != TIME_MAX_SECOND || !my_time->second_part)) + return 0; + + my_time->day= 0; + my_time->hour= TIME_MAX_HOUR; + my_time->minute= TIME_MAX_MINUTE; + my_time->second= TIME_MAX_SECOND; + my_time->second_part= 0; + *warning|= MYSQL_TIME_WARN_OUT_OF_RANGE; + return 0; +} + + +/* + Prepare offset of system time zone from UTC for my_system_gmt_sec() func. + + SYNOPSIS + my_init_time() +*/ +void my_init_time(void) +{ + time_t seconds; + struct tm *l_time,tm_tmp; + MYSQL_TIME my_time; + my_bool not_used; + + seconds= (time_t) time((time_t*) 0); + localtime_r(&seconds,&tm_tmp); + l_time= &tm_tmp; + my_time_zone= 3600; /* Comp. for -3600 in my_gmt_sec */ + my_time.year= (uint) l_time->tm_year+1900; + my_time.month= (uint) l_time->tm_mon+1; + my_time.day= (uint) l_time->tm_mday; + my_time.hour= (uint) l_time->tm_hour; + my_time.minute= (uint) l_time->tm_min; + my_time.second= (uint) l_time->tm_sec; + my_system_gmt_sec(&my_time, &my_time_zone, ¬_used); /* Init my_time_zone */ +} + + +/* + Handle 2 digit year conversions + + SYNOPSIS + year_2000_handling() + year 2 digit year + + RETURN + Year between 1970-2069 +*/ + +uint year_2000_handling(uint year) +{ + if ((year=year+1900) < 1900+YY_PART_YEAR) + year+=100; + return year; +} + + +/* + Calculate nr of day since year 0 in new date-system (from 1615) + + SYNOPSIS + calc_daynr() + year Year (exact 4 digit year, no year conversions) + month Month + day Day + + NOTES: 0000-00-00 is a valid date, and will return 0 + + RETURN + Days since 0000-00-00 +*/ + +long calc_daynr(uint year,uint month,uint day) +{ + long delsum; + int temp; + int y= year; /* may be < 0 temporarily */ + DBUG_ENTER("calc_daynr"); + + if (y == 0 && month == 0 && day == 0) + DBUG_RETURN(0); /* Skip errors */ + delsum= (long) (365L * y+ 31*(month-1) +day); + if (month <= 2) + y--; + else + delsum-= (long) (month*4+23)/10; + temp=(int) ((y/100+1)*3)/4; + DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld", + y+(month <= 2),month,day,delsum+y/4-temp)); + DBUG_RETURN(delsum+(int) y/4-temp); +} /* calc_daynr */ + + +/* + Convert time in MYSQL_TIME representation in system time zone to its + my_time_t form (number of seconds in UTC since begginning of Unix Epoch). + + SYNOPSIS + my_system_gmt_sec() + t - time value to be converted + my_timezone - pointer to long where offset of system time zone + from UTC will be stored for caching + in_dst_time_gap - set to true if time falls into spring time-gap + + NOTES + The idea is to cache the time zone offset from UTC (including daylight + saving time) for the next call to make things faster. But currently we + just calculate this offset during startup (by calling my_init_time() + function) and use it all the time. + Time value provided should be legal time value (e.g. '2003-01-01 25:00:00' + is not allowed). + + RETURN VALUE + Time in UTC seconds since Unix Epoch representation. +*/ +my_time_t +my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone, + my_bool *in_dst_time_gap) +{ + uint loop; + time_t tmp= 0; + int shift= 0; + MYSQL_TIME tmp_time; + MYSQL_TIME *t= &tmp_time; + struct tm *l_time,tm_tmp; + long diff, current_timezone; + + /* + Use temp variable to avoid trashing input data, which could happen in + case of shift required for boundary dates processing. + */ + memcpy(&tmp_time, t_src, sizeof(MYSQL_TIME)); + + if (!validate_timestamp_range(t)) + return 0; + + /* + Calculate the gmt time based on current time and timezone + The -1 on the end is to ensure that if have a date that exists twice + (like 2002-10-27 02:00:0 MET), we will find the initial date. + + By doing -3600 we will have to call localtime_r() several times, but + I couldn't come up with a better way to get a repeatable result :( + + We can't use mktime() as it's buggy on many platforms and not thread safe. + + Note: this code assumes that our time_t estimation is not too far away + from real value (we assume that localtime_r(tmp) will return something + within 24 hrs from t) which is probably true for all current time zones. + + Note2: For the dates, which have time_t representation close to + MAX_INT32 (efficient time_t limit for supported platforms), we should + do a small trick to avoid overflow. That is, convert the date, which is + two days earlier, and then add these days to the final value. + + The same trick is done for the values close to 0 in time_t + representation for platfroms with unsigned time_t (QNX). + + To be more verbose, here is a sample (extracted from the code below): + (calc_daynr(2038, 1, 19) - (long) days_at_timestart)*86400L + 4*3600L + would return -2147480896 because of the long type overflow. In result + we would get 1901 year in localtime_r(), which is an obvious error. + + Alike problem raises with the dates close to Epoch. E.g. + (calc_daynr(1969, 12, 31) - (long) days_at_timestart)*86400L + 23*3600L + will give -3600. + + On some platforms, (E.g. on QNX) time_t is unsigned and localtime(-3600) + wil give us a date around 2106 year. Which is no good. + + Theoreticaly, there could be problems with the latter conversion: + there are at least two timezones, which had time switches near 1 Jan + of 1970 (because of political reasons). These are America/Hermosillo and + America/Mazatlan time zones. They changed their offset on + 1970-01-01 08:00:00 UTC from UTC-8 to UTC-7. For these zones + the code below will give incorrect results for dates close to + 1970-01-01, in the case OS takes into account these historical switches. + Luckily, it seems that we support only one platform with unsigned + time_t. It's QNX. And QNX does not support historical timezone data at all. + E.g. there are no /usr/share/zoneinfo/ files or any other mean to supply + historical information for localtime_r() etc. That is, the problem is not + relevant to QNX. + + We are safe with shifts close to MAX_INT32, as there are no known + time switches on Jan 2038 yet :) + */ + if ((t->year == TIMESTAMP_MAX_YEAR) && (t->month == 1) && (t->day > 4)) + { + /* + Below we will pass (uint) (t->day - shift) to calc_daynr. + As we don't want to get an overflow here, we will shift + only safe dates. That's why we have (t->day > 4) above. + */ + t->day-= 2; + shift= 2; + } +#ifdef TIME_T_UNSIGNED + else + { + /* + We can get 0 in time_t representaion only on 1969, 31 of Dec or on + 1970, 1 of Jan. For both dates we use shift, which is added + to t->day in order to step out a bit from the border. + This is required for platforms, where time_t is unsigned. + As far as I know, among the platforms we support it's only QNX. + Note: the order of below if-statements is significant. + */ + + if ((t->year == TIMESTAMP_MIN_YEAR + 1) && (t->month == 1) + && (t->day <= 10)) + { + t->day+= 2; + shift= -2; + } + + if ((t->year == TIMESTAMP_MIN_YEAR) && (t->month == 12) + && (t->day == 31)) + { + t->year++; + t->month= 1; + t->day= 2; + shift= -2; + } + } +#endif + + tmp= (time_t) (((calc_daynr((uint) t->year, (uint) t->month, (uint) t->day) - + (long) days_at_timestart)*86400L + (long) t->hour*3600L + + (long) (t->minute*60 + t->second)) + (time_t) my_time_zone - + 3600); + + current_timezone= my_time_zone; + localtime_r(&tmp,&tm_tmp); + l_time=&tm_tmp; + for (loop=0; + loop < 2 && + (t->hour != (uint) l_time->tm_hour || + t->minute != (uint) l_time->tm_min || + t->second != (uint) l_time->tm_sec); + loop++) + { /* One check should be enough ? */ + /* Get difference in days */ + int days= t->day - l_time->tm_mday; + if (days < -1) + days= 1; /* Month has wrapped */ + else if (days > 1) + days= -1; + diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) + + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); + current_timezone+= diff+3600; /* Compensate for -3600 above */ + tmp+= (time_t) diff; + localtime_r(&tmp,&tm_tmp); + l_time=&tm_tmp; + } + /* + Fix that if we are in the non existing daylight saving time hour + we move the start of the next real hour. + + This code doesn't handle such exotical thing as time-gaps whose length + is more than one hour or non-integer (latter can theoretically happen + if one of seconds will be removed due leap correction, or because of + general time correction like it happened for Africa/Monrovia time zone + in year 1972). + */ + if (loop == 2 && t->hour != (uint) l_time->tm_hour) + { + int days= t->day - l_time->tm_mday; + if (days < -1) + days=1; /* Month has wrapped */ + else if (days > 1) + days= -1; + diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+ + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); + if (diff == 3600) + tmp+=3600 - t->minute*60 - t->second; /* Move to next hour */ + else if (diff == -3600) + tmp-=t->minute*60 + t->second; /* Move to previous hour */ + + *in_dst_time_gap= 1; + } + *my_timezone= current_timezone; + + + /* shift back, if we were dealing with boundary dates */ + tmp+= shift*86400L; + + /* + This is possible for dates, which slightly exceed boundaries. + Conversion will pass ok for them, but we don't allow them. + First check will pass for platforms with signed time_t. + instruction above (tmp+= shift*86400L) could exceed + MAX_INT32 (== TIMESTAMP_MAX_VALUE) and overflow will happen. + So, tmp < TIMESTAMP_MIN_VALUE will be triggered. On platfroms + with unsigned time_t tmp+= shift*86400L might result in a number, + larger then TIMESTAMP_MAX_VALUE, so another check will work. + */ + if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE)) + tmp= 0; + + return (my_time_t) tmp; +} /* my_system_gmt_sec */ + + +/* Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000 */ + +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) +{ + bzero((void*) tm, sizeof(*tm)); + tm->time_type= time_type; +} + + +/* + Functions to convert time/date/datetime value to a string, + using default format. + This functions don't check that given MYSQL_TIME structure members are + in valid range. If they are not, return value won't reflect any + valid date either. Additionally, make_time doesn't take into + account time->day member: it's assumed that days have been converted + to hours already. + + RETURN + number of characters written to 'to' +*/ + +int my_time_to_str(const MYSQL_TIME *l_time, char *to) +{ + uint extra_hours= 0; + return my_sprintf(to, (to, "%s%02u:%02u:%02u", + (l_time->neg ? "-" : ""), + extra_hours+ l_time->hour, + l_time->minute, + l_time->second)); +} + +int my_date_to_str(const MYSQL_TIME *l_time, char *to) +{ + return my_sprintf(to, (to, "%04u-%02u-%02u", + l_time->year, + l_time->month, + l_time->day)); +} + +int my_datetime_to_str(const MYSQL_TIME *l_time, char *to) +{ + return my_sprintf(to, (to, "%04u-%02u-%02u %02u:%02u:%02u", + l_time->year, + l_time->month, + l_time->day, + l_time->hour, + l_time->minute, + l_time->second)); +} + + +/* + Convert struct DATE/TIME/DATETIME value to string using built-in + MySQL time conversion formats. + + SYNOPSIS + my_TIME_to_string() + + NOTE + The string must have at least MAX_DATE_STRING_REP_LENGTH bytes reserved. +*/ + +int my_TIME_to_str(const MYSQL_TIME *l_time, char *to) +{ + switch (l_time->time_type) { + case MYSQL_TIMESTAMP_DATETIME: + return my_datetime_to_str(l_time, to); + case MYSQL_TIMESTAMP_DATE: + return my_date_to_str(l_time, to); + case MYSQL_TIMESTAMP_TIME: + return my_time_to_str(l_time, to); + case MYSQL_TIMESTAMP_NONE: + case MYSQL_TIMESTAMP_ERROR: + to[0]='\0'; + return 0; + default: + DBUG_ASSERT(0); + return 0; + } +} + + +/* + Convert datetime value specified as number to broken-down TIME + representation and form value of DATETIME type as side-effect. + + SYNOPSIS + number_to_datetime() + nr - datetime value as number + time_res - pointer for structure for broken-down representation + flags - flags to use in validating date, as in str_to_datetime() + was_cut 0 Value ok + 1 If value was cut during conversion + 2 check_date(date,flags) considers date invalid + + DESCRIPTION + Convert a datetime value of formats YYMMDD, YYYYMMDD, YYMMDDHHMSS, + YYYYMMDDHHMMSS to broken-down MYSQL_TIME representation. Return value in + YYYYMMDDHHMMSS format as side-effect. + + This function also checks if datetime value fits in DATETIME range. + + RETURN VALUE + -1 Timestamp with wrong values + anything else DATETIME as integer in YYYYMMDDHHMMSS format + Datetime value in YYYYMMDDHHMMSS format. +*/ + +longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, + uint flags, int *was_cut) +{ + long part1,part2; + + *was_cut= 0; + bzero((char*) time_res, sizeof(*time_res)); + time_res->time_type=MYSQL_TIMESTAMP_DATE; + + if (nr == 0LL || nr >= 10000101000000LL) + { + time_res->time_type=MYSQL_TIMESTAMP_DATETIME; + goto ok; + } + if (nr < 101) + goto err; + if (nr <= (YY_PART_YEAR-1)*10000L+1231L) + { + nr= (nr+20000000L)*1000000L; /* YYMMDD, year: 2000-2069 */ + goto ok; + } + if (nr < (YY_PART_YEAR)*10000L+101L) + goto err; + if (nr <= 991231L) + { + nr= (nr+19000000L)*1000000L; /* YYMMDD, year: 1970-1999 */ + goto ok; + } + if (nr < 10000101L) + goto err; + if (nr <= 99991231L) + { + nr= nr*1000000L; + goto ok; + } + if (nr < 101000000L) + goto err; + + time_res->time_type=MYSQL_TIMESTAMP_DATETIME; + + if (nr <= (YY_PART_YEAR-1)*10000000000LL+1231235959LL) + { + nr= nr+20000000000000LL; /* YYMMDDHHMMSS, 2000-2069 */ + goto ok; + } + if (nr < YY_PART_YEAR*10000000000LL+ 101000000LL) + goto err; + if (nr <= 991231235959LL) + nr= nr+19000000000000LL; /* YYMMDDHHMMSS, 1970-1999 */ + + ok: + part1=(long) (nr/1000000LL); + part2=(long) (nr - (longlong) part1*1000000LL); + time_res->year= (int) (part1/10000L); part1%=10000L; + time_res->month= (int) part1 / 100; + time_res->day= (int) part1 % 100; + time_res->hour= (int) (part2/10000L); part2%=10000L; + time_res->minute=(int) part2 / 100; + time_res->second=(int) part2 % 100; + + if (time_res->year <= 9999 && time_res->month <= 12 && + time_res->day <= 31 && time_res->hour <= 23 && + time_res->minute <= 59 && time_res->second <= 59 && + !check_date(time_res, (nr != 0), flags, was_cut)) + return nr; + + /* Don't want to have was_cut get set if NO_ZERO_DATE was violated. */ + if (!nr && (flags & TIME_NO_ZERO_DATE)) + return -1LL; + + err: + *was_cut= 1; + return -1LL; +} + + +/* Convert time value to integer in YYYYMMDDHHMMSS format */ + +ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *my_time) +{ + return ((ulonglong) (my_time->year * 10000UL + + my_time->month * 100UL + + my_time->day) * 1000000ULL + + (ulonglong) (my_time->hour * 10000UL + + my_time->minute * 100UL + + my_time->second)); +} + + +/* Convert MYSQL_TIME value to integer in YYYYMMDD format */ + +ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *my_time) +{ + return (ulonglong) (my_time->year * 10000UL + my_time->month * 100UL + + my_time->day); +} + + +/* + Convert MYSQL_TIME value to integer in HHMMSS format. + This function doesn't take into account time->day member: + it's assumed that days have been converted to hours already. +*/ + +ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *my_time) +{ + return (ulonglong) (my_time->hour * 10000UL + + my_time->minute * 100UL + + my_time->second); +} + + +/* + Convert struct MYSQL_TIME (date and time split into year/month/day/hour/... + to a number in format YYYYMMDDHHMMSS (DATETIME), + YYYYMMDD (DATE) or HHMMSS (TIME). + + SYNOPSIS + TIME_to_ulonglong() + + DESCRIPTION + The function is used when we need to convert value of time item + to a number if it's used in numeric context, i. e.: + SELECT NOW()+1, CURDATE()+0, CURTIMIE()+0; + SELECT ?+1; + + NOTE + This function doesn't check that given MYSQL_TIME structure members are + in valid range. If they are not, return value won't reflect any + valid date either. +*/ + +ulonglong TIME_to_ulonglong(const MYSQL_TIME *my_time) +{ + switch (my_time->time_type) { + case MYSQL_TIMESTAMP_DATETIME: + return TIME_to_ulonglong_datetime(my_time); + case MYSQL_TIMESTAMP_DATE: + return TIME_to_ulonglong_date(my_time); + case MYSQL_TIMESTAMP_TIME: + return TIME_to_ulonglong_time(my_time); + case MYSQL_TIMESTAMP_NONE: + case MYSQL_TIMESTAMP_ERROR: + return 0ULL; + default: + DBUG_ASSERT(0); + } + return 0; +} + diff --git a/externals/mysql/libmysql/net_serv.c b/externals/mysql/libmysql/net_serv.c new file mode 100644 index 00000000000..7dd224b20ea --- /dev/null +++ b/externals/mysql/libmysql/net_serv.c @@ -0,0 +1,1177 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file + + This file is the net layer API for the MySQL client/server protocol, + which is a tightly coupled, proprietary protocol owned by MySQL AB. + @note + Any re-implementations of this protocol must also be under GPL + unless one has got an license from MySQL AB stating otherwise. + + Write and read of logical packets to/from socket. + + Writes are cached into net_buffer_length big packets. + Read packets are reallocated dynamicly when reading big packets. + Each logical packet has the following pre-info: + 3 byte length & 1 byte package-number. + + This file needs to be written in C as it's used by the libmysql client as a + C file. +*/ + +/* + HFTODO this must be hidden if we don't want client capabilities in + embedded library + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __NETWARE__ +#include +#endif + +#ifdef EMBEDDED_LIBRARY +#undef MYSQL_SERVER +#undef MYSQL_CLIENT +#define MYSQL_CLIENT +#endif /*EMBEDDED_LIBRARY */ + +#ifdef HAVE_DTRACE +/* Limit DTrace probes to server code for now */ +#ifndef MYSQL_SERVER +#undef _DTRACE_VERSION +#endif +#endif +#include "probes.h" + +/* + The following handles the differences when this is linked between the + client and the server. + + This gives an error if a too big packet is found + The server can change this with the -O switch, but because the client + can't normally do this the client should have a bigger max_allowed_packet. +*/ + +#if defined(__WIN__) || !defined(MYSQL_SERVER) + /* The following is because alarms doesn't work on windows. */ +#define NO_ALARM +#endif + +#ifndef NO_ALARM +#include "my_pthread.h" +void sql_print_error(const char *format,...); +#else +#define DONT_USE_THR_ALARM +#endif /* NO_ALARM */ + +#include "thr_alarm.h" + +#ifdef MYSQL_SERVER +/* + The following variables/functions should really not be declared + extern, but as it's hard to include mysql_priv.h here, we have to + live with this for a while. +*/ +extern uint test_flags; +extern ulong bytes_sent, bytes_received, net_big_packet_count; +#ifndef MYSQL_INSTANCE_MANAGER +#ifdef HAVE_QUERY_CACHE +#define USE_QUERY_CACHE +extern void query_cache_insert(const char *packet, ulong length, + unsigned pkt_nr); +#endif // HAVE_QUERY_CACHE +#define update_statistics(A) A +#endif /* MYSQL_INSTANCE_MANGER */ +#endif /* defined(MYSQL_SERVER) && !defined(MYSQL_INSTANCE_MANAGER) */ + +#if !defined(MYSQL_SERVER) || defined(MYSQL_INSTANCE_MANAGER) +#define update_statistics(A) +#define thd_increment_bytes_sent(N) +#endif + +#define TEST_BLOCKING 8 +#define MAX_PACKET_LENGTH (256L*256L*256L-1) + +static my_bool net_write_buff(NET *net,const uchar *packet,ulong len); + + +/** Init with packet info. */ + +my_bool my_net_init(NET *net, Vio* vio) +{ + DBUG_ENTER("my_net_init"); + net->vio = vio; + my_net_local_init(net); /* Set some limits */ + if (!(net->buff=(uchar*) my_malloc((size_t) net->max_packet+ + NET_HEADER_SIZE + COMP_HEADER_SIZE, + MYF(MY_WME)))) + DBUG_RETURN(1); + net->buff_end=net->buff+net->max_packet; + net->error=0; net->return_status=0; + net->pkt_nr=net->compress_pkt_nr=0; + net->write_pos=net->read_pos = net->buff; + net->last_error[0]=0; + net->compress=0; net->reading_or_writing=0; + net->where_b = net->remain_in_buf=0; + net->last_errno=0; + net->unused= 0; + + if (vio != 0) /* If real connection */ + { + net->fd = vio_fd(vio); /* For perl DBI/DBD */ +#if defined(MYSQL_SERVER) && !defined(__WIN__) + if (!(test_flags & TEST_BLOCKING)) + { + my_bool old_mode; + vio_blocking(vio, FALSE, &old_mode); + } +#endif + vio_fastsend(vio); + } + DBUG_RETURN(0); +} + + +void net_end(NET *net) +{ + DBUG_ENTER("net_end"); + my_free(net->buff,MYF(MY_ALLOW_ZERO_PTR)); + net->buff=0; + DBUG_VOID_RETURN; +} + + +/** Realloc the packet buffer. */ + +my_bool net_realloc(NET *net, size_t length) +{ + uchar *buff; + size_t pkt_length; + DBUG_ENTER("net_realloc"); + DBUG_PRINT("enter",("length: %lu", (ulong) length)); + + if (length >= net->max_packet_size) + { + DBUG_PRINT("error", ("Packet too large. Max size: %lu", + net->max_packet_size)); + /* @todo: 1 and 2 codes are identical. */ + net->error= 1; + net->last_errno= ER_NET_PACKET_TOO_LARGE; +#ifdef MYSQL_SERVER + my_error(ER_NET_PACKET_TOO_LARGE, MYF(0)); +#endif + DBUG_RETURN(1); + } + pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1); + /* + We must allocate some extra bytes for the end 0 and to be able to + read big compressed blocks + */ + if (!(buff= (uchar*) my_realloc((char*) net->buff, pkt_length + + NET_HEADER_SIZE + COMP_HEADER_SIZE, + MYF(MY_WME)))) + { + /* @todo: 1 and 2 codes are identical. */ + net->error= 1; + net->last_errno= ER_OUT_OF_RESOURCES; + /* In the server the error is reported by MY_WME flag. */ + DBUG_RETURN(1); + } + net->buff=net->write_pos=buff; + net->buff_end=buff+(net->max_packet= (ulong) pkt_length); + DBUG_RETURN(0); +} + + +/** + Check if there is any data to be read from the socket. + + @param sd socket descriptor + + @retval + 0 No data to read + @retval + 1 Data or EOF to read + @retval + -1 Don't know if data is ready or not +*/ + +#if !defined(EMBEDDED_LIBRARY) + +static int net_data_is_ready(my_socket sd) +{ +#ifdef HAVE_POLL + struct pollfd ufds; + int res; + + ufds.fd= sd; + ufds.events= POLLIN | POLLPRI; + if (!(res= poll(&ufds, 1, 0))) + return 0; + if (res < 0 || !(ufds.revents & (POLLIN | POLLPRI))) + return 0; + return 1; +#else + fd_set sfds; + struct timeval tv; + int res; + +#ifndef __WIN__ + /* Windows uses an _array_ of 64 fd's as default, so it's safe */ + if (sd >= FD_SETSIZE) + return -1; +#define NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE +#endif + + FD_ZERO(&sfds); + FD_SET(sd, &sfds); + + tv.tv_sec= tv.tv_usec= 0; + + if ((res= select(sd+1, &sfds, NULL, NULL, &tv)) < 0) + return 0; + else + return test(res ? FD_ISSET(sd, &sfds) : 0); +#endif /* HAVE_POLL */ +} + +#endif /* EMBEDDED_LIBRARY */ + +/** + Remove unwanted characters from connection + and check if disconnected. + + Read from socket until there is nothing more to read. Discard + what is read. + + If there is anything when to read 'net_clear' is called this + normally indicates an error in the protocol. + + When connection is properly closed (for TCP it means with + a FIN packet), then select() considers a socket "ready to read", + in the sense that there's EOF to read, but read() returns 0. + + @param net NET handler + @param clear_buffer if <> 0, then clear all data from comm buff +*/ + +void net_clear(NET *net, my_bool clear_buffer) +{ +#if !defined(EMBEDDED_LIBRARY) + size_t count; + int ready; +#endif + DBUG_ENTER("net_clear"); + +#if !defined(EMBEDDED_LIBRARY) + if (clear_buffer) + { + while ((ready= net_data_is_ready(net->vio->sd)) > 0) + { + /* The socket is ready */ + if ((long) (count= vio_read(net->vio, net->buff, + (size_t) net->max_packet)) > 0) + { + DBUG_PRINT("info",("skipped %ld bytes from file: %s", + (long) count, vio_description(net->vio))); +#if defined(EXTRA_DEBUG) + fprintf(stderr,"Note: net_clear() skipped %ld bytes from file: %s\n", + (long) count, vio_description(net->vio)); +#endif + } + else + { + DBUG_PRINT("info",("socket ready but only EOF to read - disconnected")); + net->error= 2; + break; + } + } +#ifdef NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE + /* 'net_data_is_ready' returned "don't know" */ + if (ready == -1) + { + /* Read unblocking to clear net */ + my_bool old_mode; + if (!vio_blocking(net->vio, FALSE, &old_mode)) + { + while ((long) (count= vio_read(net->vio, net->buff, + (size_t) net->max_packet)) > 0) + DBUG_PRINT("info",("skipped %ld bytes from file: %s", + (long) count, vio_description(net->vio))); + vio_blocking(net->vio, TRUE, &old_mode); + } + } +#endif /* NET_DATA_IS_READY_CAN_RETURN_MINUS_ONE */ + } +#endif /* EMBEDDED_LIBRARY */ + net->pkt_nr=net->compress_pkt_nr=0; /* Ready for new command */ + net->write_pos=net->buff; + DBUG_VOID_RETURN; +} + + +/** Flush write_buffer if not empty. */ + +my_bool net_flush(NET *net) +{ + my_bool error= 0; + DBUG_ENTER("net_flush"); + if (net->buff != net->write_pos) + { + error=test(net_real_write(net, net->buff, + (size_t) (net->write_pos - net->buff))); + net->write_pos=net->buff; + } + /* Sync packet number if using compression */ + if (net->compress) + net->pkt_nr=net->compress_pkt_nr; + DBUG_RETURN(error); +} + + +/***************************************************************************** +** Write something to server/client buffer +*****************************************************************************/ + +/** + Write a logical packet with packet header. + + Format: Packet length (3 bytes), packet number(1 byte) + When compression is used a 3 byte compression length is added + + @note + If compression is used the original package is modified! +*/ + +my_bool +my_net_write(NET *net,const uchar *packet,size_t len) +{ + uchar buff[NET_HEADER_SIZE]; + my_bool rc; + if (unlikely(!net->vio)) /* nowhere to write */ + return 0; + + MYSQL_NET_WRITE_START(len); + + /* + Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH + length. The last packet is always a packet that is < MAX_PACKET_LENGTH. + (The last packet may even have a length of 0) + */ + while (len >= MAX_PACKET_LENGTH) + { + const ulong z_size = MAX_PACKET_LENGTH; + int3store(buff, z_size); + buff[3]= (uchar) net->pkt_nr++; + if (net_write_buff(net, buff, NET_HEADER_SIZE) || + net_write_buff(net, packet, z_size)) + { + MYSQL_NET_WRITE_DONE(1); + return 1; + } + packet += z_size; + len-= z_size; + } + /* Write last packet */ + int3store(buff,len); + buff[3]= (uchar) net->pkt_nr++; + if (net_write_buff(net, buff, NET_HEADER_SIZE)) + { + MYSQL_NET_WRITE_DONE(1); + return 1; + } +#ifndef DEBUG_DATA_PACKETS + DBUG_DUMP("packet_header", buff, NET_HEADER_SIZE); +#endif + rc= test(net_write_buff(net,packet,len)); + MYSQL_NET_WRITE_DONE(rc); + return rc; +} + +/** + Send a command to the server. + + The reason for having both header and packet is so that libmysql + can easy add a header to a special command (like prepared statements) + without having to re-alloc the string. + + As the command is part of the first data packet, we have to do some data + juggling to put the command in there, without having to create a new + packet. + + This function will split big packets into sub-packets if needed. + (Each sub packet can only be 2^24 bytes) + + @param net NET handler + @param command Command in MySQL server (enum enum_server_command) + @param header Header to write after command + @param head_len Length of header + @param packet Query or parameter to query + @param len Length of packet + + @retval + 0 ok + @retval + 1 error +*/ + +my_bool +net_write_command(NET *net,uchar command, + const uchar *header, size_t head_len, + const uchar *packet, size_t len) +{ + ulong length=len+1+head_len; /* 1 extra byte for command */ + uchar buff[NET_HEADER_SIZE+1]; + uint header_size=NET_HEADER_SIZE+1; + my_bool rc; + DBUG_ENTER("net_write_command"); + DBUG_PRINT("enter",("length: %lu", (ulong) len)); + + MYSQL_NET_WRITE_START(length); + + buff[4]=command; /* For first packet */ + + if (length >= MAX_PACKET_LENGTH) + { + /* Take into account that we have the command in the first header */ + len= MAX_PACKET_LENGTH - 1 - head_len; + do + { + int3store(buff, MAX_PACKET_LENGTH); + buff[3]= (uchar) net->pkt_nr++; + if (net_write_buff(net, buff, header_size) || + net_write_buff(net, header, head_len) || + net_write_buff(net, packet, len)) + { + MYSQL_NET_WRITE_DONE(1); + DBUG_RETURN(1); + } + packet+= len; + length-= MAX_PACKET_LENGTH; + len= MAX_PACKET_LENGTH; + head_len= 0; + header_size= NET_HEADER_SIZE; + } while (length >= MAX_PACKET_LENGTH); + len=length; /* Data left to be written */ + } + int3store(buff,length); + buff[3]= (uchar) net->pkt_nr++; + rc= test(net_write_buff(net, buff, header_size) || + (head_len && net_write_buff(net, header, head_len)) || + net_write_buff(net, packet, len) || net_flush(net)); + MYSQL_NET_WRITE_DONE(rc); + DBUG_RETURN(rc); +} + +/** + Caching the data in a local buffer before sending it. + + Fill up net->buffer and send it to the client when full. + + If the rest of the to-be-sent-packet is bigger than buffer, + send it in one big block (to avoid copying to internal buffer). + If not, copy the rest of the data to the buffer and return without + sending data. + + @param net Network handler + @param packet Packet to send + @param len Length of packet + + @note + The cached buffer can be sent as it is with 'net_flush()'. + In this code we have to be careful to not send a packet longer than + MAX_PACKET_LENGTH to net_real_write() if we are using the compressed + protocol as we store the length of the compressed packet in 3 bytes. + + @retval + 0 ok + @retval + 1 +*/ + +static my_bool +net_write_buff(NET *net, const uchar *packet, ulong len) +{ + ulong left_length; + if (net->compress && net->max_packet > MAX_PACKET_LENGTH) + left_length= MAX_PACKET_LENGTH - (net->write_pos - net->buff); + else + left_length= (ulong) (net->buff_end - net->write_pos); + +#ifdef DEBUG_DATA_PACKETS + DBUG_DUMP("data", packet, len); +#endif + if (len > left_length) + { + if (net->write_pos != net->buff) + { + /* Fill up already used packet and write it */ + memcpy((char*) net->write_pos,packet,left_length); + if (net_real_write(net, net->buff, + (size_t) (net->write_pos - net->buff) + left_length)) + return 1; + net->write_pos= net->buff; + packet+= left_length; + len-= left_length; + } + if (net->compress) + { + /* + We can't have bigger packets than 16M with compression + Because the uncompressed length is stored in 3 bytes + */ + left_length= MAX_PACKET_LENGTH; + while (len > left_length) + { + if (net_real_write(net, packet, left_length)) + return 1; + packet+= left_length; + len-= left_length; + } + } + if (len > net->max_packet) + return net_real_write(net, packet, len) ? 1 : 0; + /* Send out rest of the blocks as full sized blocks */ + } + memcpy((char*) net->write_pos,packet,len); + net->write_pos+= len; + return 0; +} + + +/** + Read and write one packet using timeouts. + If needed, the packet is compressed before sending. + + @todo + - TODO is it needed to set this variable if we have no socket +*/ + +int +net_real_write(NET *net,const uchar *packet, size_t len) +{ + size_t length; + const uchar *pos,*end; + thr_alarm_t alarmed; +#ifndef NO_ALARM + ALARM alarm_buff; +#endif + uint retry_count=0; + my_bool net_blocking = vio_is_blocking(net->vio); + DBUG_ENTER("net_real_write"); + +#if defined(MYSQL_SERVER) && defined(USE_QUERY_CACHE) + query_cache_insert((char*) packet, len, net->pkt_nr); +#endif + + if (net->error == 2) + DBUG_RETURN(-1); /* socket can't be used */ + + net->reading_or_writing=2; +#ifdef HAVE_COMPRESS + if (net->compress) + { + size_t complen; + uchar *b; + uint header_length=NET_HEADER_SIZE+COMP_HEADER_SIZE; + if (!(b= (uchar*) my_malloc(len + NET_HEADER_SIZE + + COMP_HEADER_SIZE, MYF(MY_WME)))) + { + net->error= 2; + net->last_errno= ER_OUT_OF_RESOURCES; + /* In the server, the error is reported by MY_WME flag. */ + net->reading_or_writing= 0; + DBUG_RETURN(1); + } + memcpy(b+header_length,packet,len); + + if (my_compress(b+header_length, &len, &complen)) + complen=0; + int3store(&b[NET_HEADER_SIZE],complen); + int3store(b,len); + b[3]=(uchar) (net->compress_pkt_nr++); + len+= header_length; + packet= b; + } +#endif /* HAVE_COMPRESS */ + +#ifdef DEBUG_DATA_PACKETS + DBUG_DUMP("data", packet, len); +#endif + +#ifndef NO_ALARM + thr_alarm_init(&alarmed); + if (net_blocking) + thr_alarm(&alarmed, net->write_timeout, &alarm_buff); +#else + alarmed=0; + /* Write timeout is set in my_net_set_write_timeout */ +#endif /* NO_ALARM */ + + pos= packet; + end=pos+len; + while (pos != end) + { + if ((long) (length= vio_write(net->vio,pos,(size_t) (end-pos))) <= 0) + { + my_bool interrupted = vio_should_retry(net->vio); +#if !defined(__WIN__) + if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed)) + { + if (!thr_alarm(&alarmed, net->write_timeout, &alarm_buff)) + { /* Always true for client */ + my_bool old_mode; + while (vio_blocking(net->vio, TRUE, &old_mode) < 0) + { + if (vio_should_retry(net->vio) && retry_count++ < net->retry_count) + continue; +#ifdef EXTRA_DEBUG + fprintf(stderr, + "%s: my_net_write: fcntl returned error %d, aborting thread\n", + my_progname,vio_errno(net->vio)); +#endif /* EXTRA_DEBUG */ + net->error= 2; /* Close socket */ + net->last_errno= ER_NET_PACKET_TOO_LARGE; +#ifdef MYSQL_SERVER + my_error(ER_NET_PACKET_TOO_LARGE, MYF(0)); +#endif + goto end; + } + retry_count=0; + continue; + } + } + else +#endif /* !defined(__WIN__) */ + if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) && + interrupted) + { + if (retry_count++ < net->retry_count) + continue; +#ifdef EXTRA_DEBUG + fprintf(stderr, "%s: write looped, aborting thread\n", + my_progname); +#endif /* EXTRA_DEBUG */ + } +#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) + if (vio_errno(net->vio) == SOCKET_EINTR) + { + DBUG_PRINT("warning",("Interrupted write. Retrying...")); + continue; + } +#endif /* defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) */ + net->error= 2; /* Close socket */ + net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : + ER_NET_ERROR_ON_WRITE); +#ifdef MYSQL_SERVER + my_error(net->last_errno, MYF(0)); +#endif /* MYSQL_SERVER */ + break; + } + pos+=length; + update_statistics(thd_increment_bytes_sent(length)); + } +#ifndef __WIN__ + end: +#endif +#ifdef HAVE_COMPRESS + if (net->compress) + my_free((char*) packet,MYF(0)); +#endif + if (thr_alarm_in_use(&alarmed)) + { + my_bool old_mode; + thr_end_alarm(&alarmed); + vio_blocking(net->vio, net_blocking, &old_mode); + } + net->reading_or_writing=0; + DBUG_RETURN(((int) (pos != end))); +} + + +/***************************************************************************** +** Read something from server/clinet +*****************************************************************************/ + +#ifndef NO_ALARM + +static my_bool net_safe_read(NET *net, uchar *buff, size_t length, + thr_alarm_t *alarmed) +{ + uint retry_count=0; + while (length > 0) + { + size_t tmp; + if ((long) (tmp= vio_read(net->vio, buff, length)) <= 0) + { + my_bool interrupted = vio_should_retry(net->vio); + if (!thr_got_alarm(alarmed) && interrupted) + { /* Probably in MIT threads */ + if (retry_count++ < net->retry_count) + continue; + } + return 1; + } + length-= tmp; + buff+= tmp; + } + return 0; +} + +/** + Help function to clear the commuication buffer when we get a too big packet. + + @param net Communication handle + @param remain Bytes to read + @param alarmed Parameter for thr_alarm() + @param alarm_buff Parameter for thr_alarm() + + @retval + 0 Was able to read the whole packet + @retval + 1 Got mailformed packet from client +*/ + +static my_bool my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed, + ALARM *alarm_buff) +{ + uint32 old=remain; + DBUG_ENTER("my_net_skip_rest"); + DBUG_PRINT("enter",("bytes_to_skip: %u", (uint) remain)); + + /* The following is good for debugging */ + update_statistics(thd_increment_net_big_packet_count(1)); + + if (!thr_alarm_in_use(alarmed)) + { + my_bool old_mode; + if (thr_alarm(alarmed,net->read_timeout, alarm_buff) || + vio_blocking(net->vio, TRUE, &old_mode) < 0) + DBUG_RETURN(1); /* Can't setup, abort */ + } + for (;;) + { + while (remain > 0) + { + size_t length= min(remain, net->max_packet); + if (net_safe_read(net, net->buff, length, alarmed)) + DBUG_RETURN(1); + update_statistics(thd_increment_bytes_received(length)); + remain -= (uint32) length; + } + if (old != MAX_PACKET_LENGTH) + break; + if (net_safe_read(net, net->buff, NET_HEADER_SIZE, alarmed)) + DBUG_RETURN(1); + old=remain= uint3korr(net->buff); + net->pkt_nr++; + } + DBUG_RETURN(0); +} +#endif /* NO_ALARM */ + + +/** + Reads one packet to net->buff + net->where_b. + Long packets are handled by my_net_read(). + This function reallocates the net->buff buffer if necessary. + + @return + Returns length of packet. +*/ + +static ulong +my_real_read(NET *net, size_t *complen) +{ + uchar *pos; + size_t length; + uint i,retry_count=0; + ulong len=packet_error; + thr_alarm_t alarmed; +#ifndef NO_ALARM + ALARM alarm_buff; +#endif + my_bool net_blocking=vio_is_blocking(net->vio); + uint32 remain= (net->compress ? NET_HEADER_SIZE+COMP_HEADER_SIZE : + NET_HEADER_SIZE); + *complen = 0; + + net->reading_or_writing=1; + thr_alarm_init(&alarmed); +#ifndef NO_ALARM + if (net_blocking) + thr_alarm(&alarmed,net->read_timeout,&alarm_buff); +#else + /* Read timeout is set in my_net_set_read_timeout */ +#endif /* NO_ALARM */ + + pos = net->buff + net->where_b; /* net->packet -4 */ + for (i=0 ; i < 2 ; i++) + { + while (remain > 0) + { + /* First read is done with non blocking mode */ + if ((long) (length= vio_read(net->vio, pos, remain)) <= 0L) + { + my_bool interrupted = vio_should_retry(net->vio); + + DBUG_PRINT("info",("vio_read returned %ld errno: %d", + (long) length, vio_errno(net->vio))); +#if !defined(__WIN__) || defined(MYSQL_SERVER) + /* + We got an error that there was no data on the socket. We now set up + an alarm to not 'read forever', change the socket to non blocking + mode and try again + */ + if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed)) + { + if (!thr_alarm(&alarmed,net->read_timeout,&alarm_buff)) /* Don't wait too long */ + { + my_bool old_mode; + while (vio_blocking(net->vio, TRUE, &old_mode) < 0) + { + if (vio_should_retry(net->vio) && + retry_count++ < net->retry_count) + continue; + DBUG_PRINT("error", + ("fcntl returned error %d, aborting thread", + vio_errno(net->vio))); +#ifdef EXTRA_DEBUG + fprintf(stderr, + "%s: read: fcntl returned error %d, aborting thread\n", + my_progname,vio_errno(net->vio)); +#endif /* EXTRA_DEBUG */ + len= packet_error; + net->error= 2; /* Close socket */ + net->last_errno= ER_NET_FCNTL_ERROR; +#ifdef MYSQL_SERVER + my_error(ER_NET_FCNTL_ERROR, MYF(0)); +#endif + goto end; + } + retry_count=0; + continue; + } + } +#endif /* (!defined(__WIN__) || defined(MYSQL_SERVER) */ + if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) && + interrupted) + { /* Probably in MIT threads */ + if (retry_count++ < net->retry_count) + continue; +#ifdef EXTRA_DEBUG + fprintf(stderr, "%s: read looped with error %d, aborting thread\n", + my_progname,vio_errno(net->vio)); +#endif /* EXTRA_DEBUG */ + } +#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) + if (vio_errno(net->vio) == SOCKET_EINTR) + { + DBUG_PRINT("warning",("Interrupted read. Retrying...")); + continue; + } +#endif + DBUG_PRINT("error",("Couldn't read packet: remain: %u errno: %d length: %ld", + remain, vio_errno(net->vio), (long) length)); + len= packet_error; + net->error= 2; /* Close socket */ + net->last_errno= (vio_was_interrupted(net->vio) ? + ER_NET_READ_INTERRUPTED : + ER_NET_READ_ERROR); +#ifdef MYSQL_SERVER + my_error(net->last_errno, MYF(0)); +#endif + goto end; + } + remain -= (uint32) length; + pos+= length; + update_statistics(thd_increment_bytes_received(length)); + } + if (i == 0) + { /* First parts is packet length */ + ulong helping; + DBUG_DUMP("packet_header", net->buff+net->where_b, + NET_HEADER_SIZE); + if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr) + { + if (net->buff[net->where_b] != (uchar) 255) + { + DBUG_PRINT("error", + ("Packets out of order (Found: %d, expected %u)", + (int) net->buff[net->where_b + 3], + net->pkt_nr)); +#ifdef EXTRA_DEBUG + fflush(stdout); + fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n", + (int) net->buff[net->where_b + 3], + (uint) (uchar) net->pkt_nr); + fflush(stderr); + DBUG_ASSERT(0); +#endif + } + len= packet_error; + /* Not a NET error on the client. XXX: why? */ +#ifdef MYSQL_SERVER + my_error(ER_NET_PACKETS_OUT_OF_ORDER, MYF(0)); +#endif + goto end; + } + net->compress_pkt_nr= ++net->pkt_nr; +#ifdef HAVE_COMPRESS + if (net->compress) + { + /* + If the packet is compressed then complen > 0 and contains the + number of bytes in the uncompressed packet + */ + *complen=uint3korr(&(net->buff[net->where_b + NET_HEADER_SIZE])); + } +#endif + + len=uint3korr(net->buff+net->where_b); + if (!len) /* End of big multi-packet */ + goto end; + helping = max(len,*complen) + net->where_b; + /* The necessary size of net->buff */ + if (helping >= net->max_packet) + { + if (net_realloc(net,helping)) + { +#if defined(MYSQL_SERVER) && !defined(NO_ALARM) + if (!net->compress && + !my_net_skip_rest(net, (uint32) len, &alarmed, &alarm_buff)) + net->error= 3; /* Successfully skiped packet */ +#endif + len= packet_error; /* Return error and close connection */ + goto end; + } + } + pos=net->buff + net->where_b; + remain = (uint32) len; + } + } + +end: + if (thr_alarm_in_use(&alarmed)) + { + my_bool old_mode; + thr_end_alarm(&alarmed); + vio_blocking(net->vio, net_blocking, &old_mode); + } + net->reading_or_writing=0; +#ifdef DEBUG_DATA_PACKETS + if (len != packet_error) + DBUG_DUMP("data", net->buff+net->where_b, len); +#endif + return(len); +} + + +/** + Read a packet from the client/server and return it without the internal + package header. + + If the packet is the first packet of a multi-packet packet + (which is indicated by the length of the packet = 0xffffff) then + all sub packets are read and concatenated. + + If the packet was compressed, its uncompressed and the length of the + uncompressed packet is returned. + + @return + The function returns the length of the found packet or packet_error. + net->read_pos points to the read data. +*/ + +ulong +my_net_read(NET *net) +{ + size_t len, complen; + + MYSQL_NET_READ_START(); + +#ifdef HAVE_COMPRESS + if (!net->compress) + { +#endif + len = my_real_read(net,&complen); + if (len == MAX_PACKET_LENGTH) + { + /* First packet of a multi-packet. Concatenate the packets */ + ulong save_pos = net->where_b; + size_t total_length= 0; + do + { + net->where_b += len; + total_length += len; + len = my_real_read(net,&complen); + } while (len == MAX_PACKET_LENGTH); + if (len != packet_error) + len+= total_length; + net->where_b = save_pos; + } + net->read_pos = net->buff + net->where_b; + if (len != packet_error) + net->read_pos[len]=0; /* Safeguard for mysql_use_result */ + MYSQL_NET_READ_DONE(0, len); + return len; +#ifdef HAVE_COMPRESS + } + else + { + /* We are using the compressed protocol */ + + ulong buf_length; + ulong start_of_packet; + ulong first_packet_offset; + uint read_length, multi_byte_packet=0; + + if (net->remain_in_buf) + { + buf_length= net->buf_length; /* Data left in old packet */ + first_packet_offset= start_of_packet= (net->buf_length - + net->remain_in_buf); + /* Restore the character that was overwritten by the end 0 */ + net->buff[start_of_packet]= net->save_char; + } + else + { + /* reuse buffer, as there is nothing in it that we need */ + buf_length= start_of_packet= first_packet_offset= 0; + } + for (;;) + { + ulong packet_len; + + if (buf_length - start_of_packet >= NET_HEADER_SIZE) + { + read_length = uint3korr(net->buff+start_of_packet); + if (!read_length) + { + /* End of multi-byte packet */ + start_of_packet += NET_HEADER_SIZE; + break; + } + if (read_length + NET_HEADER_SIZE <= buf_length - start_of_packet) + { + if (multi_byte_packet) + { + /* Remove packet header for second packet */ + memmove(net->buff + first_packet_offset + start_of_packet, + net->buff + first_packet_offset + start_of_packet + + NET_HEADER_SIZE, + buf_length - start_of_packet); + start_of_packet += read_length; + buf_length -= NET_HEADER_SIZE; + } + else + start_of_packet+= read_length + NET_HEADER_SIZE; + + if (read_length != MAX_PACKET_LENGTH) /* last package */ + { + multi_byte_packet= 0; /* No last zero len packet */ + break; + } + multi_byte_packet= NET_HEADER_SIZE; + /* Move data down to read next data packet after current one */ + if (first_packet_offset) + { + memmove(net->buff,net->buff+first_packet_offset, + buf_length-first_packet_offset); + buf_length-=first_packet_offset; + start_of_packet -= first_packet_offset; + first_packet_offset=0; + } + continue; + } + } + /* Move data down to read next data packet after current one */ + if (first_packet_offset) + { + memmove(net->buff,net->buff+first_packet_offset, + buf_length-first_packet_offset); + buf_length-=first_packet_offset; + start_of_packet -= first_packet_offset; + first_packet_offset=0; + } + + net->where_b=buf_length; + if ((packet_len = my_real_read(net,&complen)) == packet_error) + { + MYSQL_NET_READ_DONE(1, 0); + return packet_error; + } + if (my_uncompress(net->buff + net->where_b, packet_len, + &complen)) + { + net->error= 2; /* caller will close socket */ + net->last_errno= ER_NET_UNCOMPRESS_ERROR; +#ifdef MYSQL_SERVER + my_error(ER_NET_UNCOMPRESS_ERROR, MYF(0)); +#endif + MYSQL_NET_READ_DONE(1, 0); + return packet_error; + } + buf_length+= complen; + } + + net->read_pos= net->buff+ first_packet_offset + NET_HEADER_SIZE; + net->buf_length= buf_length; + net->remain_in_buf= (ulong) (buf_length - start_of_packet); + len = ((ulong) (start_of_packet - first_packet_offset) - NET_HEADER_SIZE - + multi_byte_packet); + net->save_char= net->read_pos[len]; /* Must be saved */ + net->read_pos[len]=0; /* Safeguard for mysql_use_result */ + } +#endif /* HAVE_COMPRESS */ + MYSQL_NET_READ_DONE(0, len); + return len; +} + + +void my_net_set_read_timeout(NET *net, uint timeout) +{ + DBUG_ENTER("my_net_set_read_timeout"); + DBUG_PRINT("enter", ("timeout: %d", timeout)); + net->read_timeout= timeout; +#ifdef NO_ALARM + if (net->vio) + vio_timeout(net->vio, 0, timeout); +#endif + DBUG_VOID_RETURN; +} + + +void my_net_set_write_timeout(NET *net, uint timeout) +{ + DBUG_ENTER("my_net_set_write_timeout"); + DBUG_PRINT("enter", ("timeout: %d", timeout)); + net->write_timeout= timeout; +#ifdef NO_ALARM + if (net->vio) + vio_timeout(net->vio, 1, timeout); +#endif + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/libmysql/pack.c b/externals/mysql/libmysql/pack.c new file mode 100644 index 00000000000..02b117fde9c --- /dev/null +++ b/externals/mysql/libmysql/pack.c @@ -0,0 +1,119 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include + +/* Get the length of next field. Change parameter to point at fieldstart */ +ulong STDCALL net_field_length(uchar **packet) +{ + reg1 uchar *pos= (uchar *)*packet; + if (*pos < 251) + { + (*packet)++; + return (ulong) *pos; + } + if (*pos == 251) + { + (*packet)++; + return NULL_LENGTH; + } + if (*pos == 252) + { + (*packet)+=3; + return (ulong) uint2korr(pos+1); + } + if (*pos == 253) + { + (*packet)+=4; + return (ulong) uint3korr(pos+1); + } + (*packet)+=9; /* Must be 254 when here */ + return (ulong) uint4korr(pos+1); +} + +/* The same as above but returns longlong */ +my_ulonglong net_field_length_ll(uchar **packet) +{ + reg1 uchar *pos= *packet; + if (*pos < 251) + { + (*packet)++; + return (my_ulonglong) *pos; + } + if (*pos == 251) + { + (*packet)++; + return (my_ulonglong) NULL_LENGTH; + } + if (*pos == 252) + { + (*packet)+=3; + return (my_ulonglong) uint2korr(pos+1); + } + if (*pos == 253) + { + (*packet)+=4; + return (my_ulonglong) uint3korr(pos+1); + } + (*packet)+=9; /* Must be 254 when here */ +#ifdef NO_CLIENT_LONGLONG + return (my_ulonglong) uint4korr(pos+1); +#else + return (my_ulonglong) uint8korr(pos+1); +#endif +} + +/* + Store an integer with simple packing into a output package + + SYNOPSIS + net_store_length() + pkg Store the packed integer here + length integers to store + + NOTES + This is mostly used to store lengths of strings. + + RETURN + Position in 'pkg' after the packed length +*/ + +uchar *net_store_length(uchar *packet, ulonglong length) +{ + if (length < 251ULL) + { + *packet=(uchar) length; + return packet+1; + } + /* 251 is reserved for NULL */ + if (length < 65536ULL) + { + *packet++=252; + int2store(packet,(uint) length); + return packet+2; + } + if (length < 16777216ULL) + { + *packet++=253; + int3store(packet,(ulong) length); + return packet+3; + } + *packet++=254; + int8store(packet,length); + return packet+8; +} + diff --git a/externals/mysql/libmysql/password.c b/externals/mysql/libmysql/password.c new file mode 100644 index 00000000000..43430f37f96 --- /dev/null +++ b/externals/mysql/libmysql/password.c @@ -0,0 +1,496 @@ +/* Copyright (C) 2000-2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* password checking routines */ +/***************************************************************************** + The main idea is that no password are sent between client & server on + connection and that no password are saved in mysql in a decodable form. + + On connection a random string is generated and sent to the client. + The client generates a new string with a random generator inited with + the hash values from the password and the sent string. + This 'check' string is sent to the server where it is compared with + a string generated from the stored hash_value of the password and the + random string. + + The password is saved (in user.password) by using the PASSWORD() function in + mysql. + + This is .c file because it's used in libmysqlclient, which is entirely in C. + (we need it to be portable to a variety of systems). + Example: + update user set password=PASSWORD("hello") where user="test" + This saves a hashed number as a string in the password field. + + The new authentication is performed in following manner: + + SERVER: public_seed=create_random_string() + send(public_seed) + + CLIENT: recv(public_seed) + hash_stage1=sha1("password") + hash_stage2=sha1(hash_stage1) + reply=xor(hash_stage1, sha1(public_seed,hash_stage2) + + // this three steps are done in scramble() + + send(reply) + + + SERVER: recv(reply) + hash_stage1=xor(reply, sha1(public_seed,hash_stage2)) + candidate_hash2=sha1(hash_stage1) + check(candidate_hash2==hash_stage2) + + // this three steps are done in check_scramble() + +*****************************************************************************/ + +#include +#include +#include +#include +#include "mysql.h" + +/************ MySQL 3.23-4.0 authentication routines: untouched ***********/ + +/* + New (MySQL 3.21+) random generation structure initialization + SYNOPSIS + my_rnd_init() + rand_st OUT Structure to initialize + seed1 IN First initialization parameter + seed2 IN Second initialization parameter +*/ + +/* + Generate binary hash from raw text string + Used for Pre-4.1 password handling + SYNOPSIS + hash_password() + result OUT store hash in this location + password IN plain text password to build hash + password_len IN password length (password may be not null-terminated) +*/ + +void hash_password(ulong *result, const char *password, uint password_len) +{ + register ulong nr=1345345333L, add=7, nr2=0x12345671L; + ulong tmp; + const char *password_end= password + password_len; + for (; password < password_end; password++) + { + if (*password == ' ' || *password == '\t') + continue; /* skip space in password */ + tmp= (ulong) (uchar) *password; + nr^= (((nr & 63)+add)*tmp)+ (nr << 8); + nr2+=(nr2 << 8) ^ nr; + add+=tmp; + } + result[0]=nr & (((ulong) 1L << 31) -1L); /* Don't use sign bit (str2int) */; + result[1]=nr2 & (((ulong) 1L << 31) -1L); +} + + +/* + Create password to be stored in user database from raw string + Used for pre-4.1 password handling + SYNOPSIS + make_scrambled_password_323() + to OUT store scrambled password here + password IN user-supplied password +*/ + +void make_scrambled_password_323(char *to, const char *password) +{ + ulong hash_res[2]; + hash_password(hash_res, password, (uint) strlen(password)); + sprintf(to, "%08lx%08lx", hash_res[0], hash_res[1]); +} + + +/* + Scramble string with password. + Used in pre 4.1 authentication phase. + SYNOPSIS + scramble_323() + to OUT Store scrambled message here. Buffer must be at least + SCRAMBLE_LENGTH_323+1 bytes long + message IN Message to scramble. Message must be at least + SRAMBLE_LENGTH_323 bytes long. + password IN Password to use while scrambling +*/ + +void scramble_323(char *to, const char *message, const char *password) +{ + struct my_rnd_struct rand_st; + ulong hash_pass[2], hash_message[2]; + + if (password && password[0]) + { + char extra, *to_start=to; + const char *message_end= message + SCRAMBLE_LENGTH_323; + hash_password(hash_pass,password, (uint) strlen(password)); + hash_password(hash_message, message, SCRAMBLE_LENGTH_323); + my_rnd_init(&rand_st,hash_pass[0] ^ hash_message[0], + hash_pass[1] ^ hash_message[1]); + for (; message < message_end; message++) + *to++= (char) (floor(my_rnd(&rand_st)*31)+64); + extra=(char) (floor(my_rnd(&rand_st)*31)); + while (to_start != to) + *(to_start++)^=extra; + } + *to= 0; +} + + +/* + Check scrambled message + Used in pre 4.1 password handling + SYNOPSIS + check_scramble_323() + scrambled scrambled message to check. + message original random message which was used for scrambling; must + be exactly SCRAMBLED_LENGTH_323 bytes long and + NULL-terminated. + hash_pass password which should be used for scrambling + All params are IN. + + RETURN VALUE + 0 - password correct + !0 - password invalid +*/ + +my_bool +check_scramble_323(const char *scrambled, const char *message, + ulong *hash_pass) +{ + struct my_rnd_struct rand_st; + ulong hash_message[2]; + char buff[16],*to,extra; /* Big enough for check */ + const char *pos; + + hash_password(hash_message, message, SCRAMBLE_LENGTH_323); + my_rnd_init(&rand_st,hash_pass[0] ^ hash_message[0], + hash_pass[1] ^ hash_message[1]); + to=buff; + DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323); + for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++) + *to++=(char) (floor(my_rnd(&rand_st)*31)+64); + if (pos-scrambled != SCRAMBLE_LENGTH_323) + return 1; + extra=(char) (floor(my_rnd(&rand_st)*31)); + to=buff; + while (*scrambled) + { + if (*scrambled++ != (char) (*to++ ^ extra)) + return 1; /* Wrong password */ + } + return 0; +} + +static inline uint8 char_val(uint8 X) +{ + return (uint) (X >= '0' && X <= '9' ? X-'0' : + X >= 'A' && X <= 'Z' ? X-'A'+10 : X-'a'+10); +} + + +/* + Convert password from hex string (as stored in mysql.user) to binary form. + SYNOPSIS + get_salt_from_password_323() + res OUT store salt here + password IN password string as stored in mysql.user + NOTE + This function does not have length check for passwords. It will just crash + Password hashes in old format must have length divisible by 8 +*/ + +void get_salt_from_password_323(ulong *res, const char *password) +{ + res[0]= res[1]= 0; + if (password) + { + while (*password) + { + ulong val=0; + uint i; + for (i=0 ; i < 8 ; i++) + val=(val << 4)+char_val(*password++); + *res++=val; + } + } +} + + +/* + Convert scrambled password from binary form to asciiz hex string. + SYNOPSIS + make_password_from_salt_323() + to OUT store resulting string password here, at least 17 bytes + salt IN password in salt format, 2 ulongs +*/ + +void make_password_from_salt_323(char *to, const ulong *salt) +{ + sprintf(to,"%08lx%08lx", salt[0], salt[1]); +} + + +/* + **************** MySQL 4.1.1 authentication routines ************* +*/ + +/* + Generate string of printable random characters of requested length + SYNOPSIS + create_random_string() + to OUT buffer for generation; must be at least length+1 bytes + long; result string is always null-terminated + length IN how many random characters to put in buffer + rand_st INOUT structure used for number generation +*/ + +void create_random_string(char *to, uint length, + struct my_rnd_struct *rand_st) +{ + char *end= to + length; + /* Use pointer arithmetics as it is faster way to do so. */ + for (; to < end; to++) + *to= (char) (my_rnd(rand_st)*94+33); + *to= '\0'; +} + + +/* Character to use as version identifier for version 4.1 */ + +#define PVERSION41_CHAR '*' + + +/* + Convert given octet sequence to asciiz string of hex characters; + str..str+len and 'to' may not overlap. + SYNOPSIS + octet2hex() + buf OUT output buffer. Must be at least 2*len+1 bytes + str, len IN the beginning and the length of the input string + + RETURN + buf+len*2 +*/ + +char *octet2hex(char *to, const char *str, uint len) +{ + const char *str_end= str + len; + for (; str != str_end; ++str) + { + *to++= _dig_vec_upper[((uchar) *str) >> 4]; + *to++= _dig_vec_upper[((uchar) *str) & 0x0F]; + } + *to= '\0'; + return to; +} + + +/* + Convert given asciiz string of hex (0..9 a..f) characters to octet + sequence. + SYNOPSIS + hex2octet() + to OUT buffer to place result; must be at least len/2 bytes + str, len IN begin, length for character string; str and to may not + overlap; len % 2 == 0 +*/ + +static void +hex2octet(uint8 *to, const char *str, uint len) +{ + const char *str_end= str + len; + while (str < str_end) + { + register char tmp= char_val(*str++); + *to++= (tmp << 4) | char_val(*str++); + } +} + + +/* + Encrypt/Decrypt function used for password encryption in authentication. + Simple XOR is used here but it is OK as we crypt random strings. Note, + that XOR(s1, XOR(s1, s2)) == s2, XOR(s1, s2) == XOR(s2, s1) + SYNOPSIS + my_crypt() + to OUT buffer to hold crypted string; must be at least len bytes + long; to and s1 (or s2) may be the same. + s1, s2 IN input strings (of equal length) + len IN length of s1 and s2 +*/ + +static void +my_crypt(char *to, const uchar *s1, const uchar *s2, uint len) +{ + const uint8 *s1_end= s1 + len; + while (s1 < s1_end) + *to++= *s1++ ^ *s2++; +} + + +/* + MySQL 4.1.1 password hashing: SHA conversion (see RFC 2289, 3174) twice + applied to the password string, and then produced octet sequence is + converted to hex string. + The result of this function is used as return value from PASSWORD() and + is stored in the database. + SYNOPSIS + make_scrambled_password() + buf OUT buffer of size 2*SHA1_HASH_SIZE + 2 to store hex string + password IN NULL-terminated password string +*/ + +void +make_scrambled_password(char *to, const char *password) +{ + SHA1_CONTEXT sha1_context; + uint8 hash_stage2[SHA1_HASH_SIZE]; + + mysql_sha1_reset(&sha1_context); + /* stage 1: hash password */ + mysql_sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password)); + mysql_sha1_result(&sha1_context, (uint8 *) to); + /* stage 2: hash stage1 output */ + mysql_sha1_reset(&sha1_context); + mysql_sha1_input(&sha1_context, (uint8 *) to, SHA1_HASH_SIZE); + /* separate buffer is used to pass 'to' in octet2hex */ + mysql_sha1_result(&sha1_context, hash_stage2); + /* convert hash_stage2 to hex string */ + *to++= PVERSION41_CHAR; + octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE); +} + + +/* + Produce an obscure octet sequence from password and random + string, recieved from the server. This sequence corresponds to the + password, but password can not be easily restored from it. The sequence + is then sent to the server for validation. Trailing zero is not stored + in the buf as it is not needed. + This function is used by client to create authenticated reply to the + server's greeting. + SYNOPSIS + scramble() + buf OUT store scrambled string here. The buf must be at least + SHA1_HASH_SIZE bytes long. + message IN random message, must be exactly SCRAMBLE_LENGTH long and + NULL-terminated. + password IN users' password +*/ + +void +scramble(char *to, const char *message, const char *password) +{ + SHA1_CONTEXT sha1_context; + uint8 hash_stage1[SHA1_HASH_SIZE]; + uint8 hash_stage2[SHA1_HASH_SIZE]; + + mysql_sha1_reset(&sha1_context); + /* stage 1: hash password */ + mysql_sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password)); + mysql_sha1_result(&sha1_context, hash_stage1); + /* stage 2: hash stage 1; note that hash_stage2 is stored in the database */ + mysql_sha1_reset(&sha1_context); + mysql_sha1_input(&sha1_context, hash_stage1, SHA1_HASH_SIZE); + mysql_sha1_result(&sha1_context, hash_stage2); + /* create crypt string as sha1(message, hash_stage2) */; + mysql_sha1_reset(&sha1_context); + mysql_sha1_input(&sha1_context, (const uint8 *) message, SCRAMBLE_LENGTH); + mysql_sha1_input(&sha1_context, hash_stage2, SHA1_HASH_SIZE); + /* xor allows 'from' and 'to' overlap: lets take advantage of it */ + mysql_sha1_result(&sha1_context, (uint8 *) to); + my_crypt(to, (const uchar *) to, hash_stage1, SCRAMBLE_LENGTH); +} + + +/* + Check that scrambled message corresponds to the password; the function + is used by server to check that recieved reply is authentic. + This function does not check lengths of given strings: message must be + null-terminated, reply and hash_stage2 must be at least SHA1_HASH_SIZE + long (if not, something fishy is going on). + SYNOPSIS + check_scramble() + scramble clients' reply, presumably produced by scramble() + message original random string, previously sent to client + (presumably second argument of scramble()), must be + exactly SCRAMBLE_LENGTH long and NULL-terminated. + hash_stage2 hex2octet-decoded database entry + All params are IN. + + RETURN VALUE + 0 password is correct + !0 password is invalid +*/ + +my_bool +check_scramble(const char *scramble_arg, const char *message, + const uint8 *hash_stage2) +{ + SHA1_CONTEXT sha1_context; + uint8 buf[SHA1_HASH_SIZE]; + uint8 hash_stage2_reassured[SHA1_HASH_SIZE]; + + mysql_sha1_reset(&sha1_context); + /* create key to encrypt scramble */ + mysql_sha1_input(&sha1_context, (const uint8 *) message, SCRAMBLE_LENGTH); + mysql_sha1_input(&sha1_context, hash_stage2, SHA1_HASH_SIZE); + mysql_sha1_result(&sha1_context, buf); + /* encrypt scramble */ + my_crypt((char *) buf, buf, (const uchar *) scramble_arg, SCRAMBLE_LENGTH); + /* now buf supposedly contains hash_stage1: so we can get hash_stage2 */ + mysql_sha1_reset(&sha1_context); + mysql_sha1_input(&sha1_context, buf, SHA1_HASH_SIZE); + mysql_sha1_result(&sha1_context, hash_stage2_reassured); + return memcmp(hash_stage2, hash_stage2_reassured, SHA1_HASH_SIZE); +} + + +/* + Convert scrambled password from asciiz hex string to binary form. + + SYNOPSIS + get_salt_from_password() + res OUT buf to hold password. Must be at least SHA1_HASH_SIZE + bytes long. + password IN 4.1.1 version value of user.password +*/ + +void get_salt_from_password(uint8 *hash_stage2, const char *password) +{ + hex2octet(hash_stage2, password+1 /* skip '*' */, SHA1_HASH_SIZE * 2); +} + +/* + Convert scrambled password from binary form to asciiz hex string. + SYNOPSIS + make_password_from_salt() + to OUT store resulting string here, 2*SHA1_HASH_SIZE+2 bytes + salt IN password in salt format +*/ + +void make_password_from_salt(char *to, const uint8 *hash_stage2) +{ + *to++= PVERSION41_CHAR; + octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE); +} diff --git a/externals/mysql/libmysql/probes.h b/externals/mysql/libmysql/probes.h new file mode 100644 index 00000000000..2bcf627e68e --- /dev/null +++ b/externals/mysql/libmysql/probes.h @@ -0,0 +1,381 @@ +/* + * Generated by dtrace(1M). + */ + +#ifndef _PROBES_H +#define _PROBES_H + + + +#ifdef __cplusplus +extern "C" { +#endif + +#if _DTRACE_VERSION && defined(HAVE_DTRACE) + +#define MYSQL_COMMAND_DONE(arg0) \ + __dtrace_mysql___command__done(arg0) +#define MYSQL_COMMAND_DONE_ENABLED() \ + __dtraceenabled_mysql___command__done() +#define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3) \ + __dtrace_mysql___command__start(arg0, arg1, arg2, arg3) +#define MYSQL_COMMAND_START_ENABLED() \ + __dtraceenabled_mysql___command__start() +#define MYSQL_CONNECTION_DONE(arg0, arg1) \ + __dtrace_mysql___connection__done(arg0, arg1) +#define MYSQL_CONNECTION_DONE_ENABLED() \ + __dtraceenabled_mysql___connection__done() +#define MYSQL_CONNECTION_START(arg0, arg1, arg2) \ + __dtrace_mysql___connection__start(arg0, arg1, arg2) +#define MYSQL_CONNECTION_START_ENABLED() \ + __dtraceenabled_mysql___connection__start() +#define MYSQL_DELETE_DONE(arg0, arg1) \ + __dtrace_mysql___delete__done(arg0, arg1) +#define MYSQL_DELETE_DONE_ENABLED() \ + __dtraceenabled_mysql___delete__done() +#define MYSQL_DELETE_ROW_DONE(arg0) \ + __dtrace_mysql___delete__row__done(arg0) +#define MYSQL_DELETE_ROW_DONE_ENABLED() \ + __dtraceenabled_mysql___delete__row__done() +#define MYSQL_DELETE_ROW_START(arg0, arg1) \ + __dtrace_mysql___delete__row__start(arg0, arg1) +#define MYSQL_DELETE_ROW_START_ENABLED() \ + __dtraceenabled_mysql___delete__row__start() +#define MYSQL_DELETE_START(arg0) \ + __dtrace_mysql___delete__start(arg0) +#define MYSQL_DELETE_START_ENABLED() \ + __dtraceenabled_mysql___delete__start() +#define MYSQL_FILESORT_DONE(arg0, arg1) \ + __dtrace_mysql___filesort__done(arg0, arg1) +#define MYSQL_FILESORT_DONE_ENABLED() \ + __dtraceenabled_mysql___filesort__done() +#define MYSQL_FILESORT_START(arg0, arg1) \ + __dtrace_mysql___filesort__start(arg0, arg1) +#define MYSQL_FILESORT_START_ENABLED() \ + __dtraceenabled_mysql___filesort__start() +#define MYSQL_HANDLER_RDLOCK_DONE(arg0) \ + __dtrace_mysql___handler__rdlock__done(arg0) +#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() \ + __dtraceenabled_mysql___handler__rdlock__done() +#define MYSQL_HANDLER_RDLOCK_START(arg0, arg1) \ + __dtrace_mysql___handler__rdlock__start(arg0, arg1) +#define MYSQL_HANDLER_RDLOCK_START_ENABLED() \ + __dtraceenabled_mysql___handler__rdlock__start() +#define MYSQL_HANDLER_UNLOCK_DONE(arg0) \ + __dtrace_mysql___handler__unlock__done(arg0) +#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() \ + __dtraceenabled_mysql___handler__unlock__done() +#define MYSQL_HANDLER_UNLOCK_START(arg0, arg1) \ + __dtrace_mysql___handler__unlock__start(arg0, arg1) +#define MYSQL_HANDLER_UNLOCK_START_ENABLED() \ + __dtraceenabled_mysql___handler__unlock__start() +#define MYSQL_HANDLER_WRLOCK_DONE(arg0) \ + __dtrace_mysql___handler__wrlock__done(arg0) +#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() \ + __dtraceenabled_mysql___handler__wrlock__done() +#define MYSQL_HANDLER_WRLOCK_START(arg0, arg1) \ + __dtrace_mysql___handler__wrlock__start(arg0, arg1) +#define MYSQL_HANDLER_WRLOCK_START_ENABLED() \ + __dtraceenabled_mysql___handler__wrlock__start() +#define MYSQL_INSERT_DONE(arg0, arg1) \ + __dtrace_mysql___insert__done(arg0, arg1) +#define MYSQL_INSERT_DONE_ENABLED() \ + __dtraceenabled_mysql___insert__done() +#define MYSQL_INSERT_ROW_DONE(arg0) \ + __dtrace_mysql___insert__row__done(arg0) +#define MYSQL_INSERT_ROW_DONE_ENABLED() \ + __dtraceenabled_mysql___insert__row__done() +#define MYSQL_INSERT_ROW_START(arg0, arg1) \ + __dtrace_mysql___insert__row__start(arg0, arg1) +#define MYSQL_INSERT_ROW_START_ENABLED() \ + __dtraceenabled_mysql___insert__row__start() +#define MYSQL_INSERT_SELECT_DONE(arg0, arg1) \ + __dtrace_mysql___insert__select__done(arg0, arg1) +#define MYSQL_INSERT_SELECT_DONE_ENABLED() \ + __dtraceenabled_mysql___insert__select__done() +#define MYSQL_INSERT_SELECT_START(arg0) \ + __dtrace_mysql___insert__select__start(arg0) +#define MYSQL_INSERT_SELECT_START_ENABLED() \ + __dtraceenabled_mysql___insert__select__start() +#define MYSQL_INSERT_START(arg0) \ + __dtrace_mysql___insert__start(arg0) +#define MYSQL_INSERT_START_ENABLED() \ + __dtraceenabled_mysql___insert__start() +#define MYSQL_MULTI_DELETE_DONE(arg0, arg1) \ + __dtrace_mysql___multi__delete__done(arg0, arg1) +#define MYSQL_MULTI_DELETE_DONE_ENABLED() \ + __dtraceenabled_mysql___multi__delete__done() +#define MYSQL_MULTI_DELETE_START(arg0) \ + __dtrace_mysql___multi__delete__start(arg0) +#define MYSQL_MULTI_DELETE_START_ENABLED() \ + __dtraceenabled_mysql___multi__delete__start() +#define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2) \ + __dtrace_mysql___multi__update__done(arg0, arg1, arg2) +#define MYSQL_MULTI_UPDATE_DONE_ENABLED() \ + __dtraceenabled_mysql___multi__update__done() +#define MYSQL_MULTI_UPDATE_START(arg0) \ + __dtrace_mysql___multi__update__start(arg0) +#define MYSQL_MULTI_UPDATE_START_ENABLED() \ + __dtraceenabled_mysql___multi__update__start() +#define MYSQL_NET_READ_DONE(arg0, arg1) \ + __dtrace_mysql___net__read__done(arg0, arg1) +#define MYSQL_NET_READ_DONE_ENABLED() \ + __dtraceenabled_mysql___net__read__done() +#define MYSQL_NET_READ_START() \ + __dtrace_mysql___net__read__start() +#define MYSQL_NET_READ_START_ENABLED() \ + __dtraceenabled_mysql___net__read__start() +#define MYSQL_NET_WRITE_DONE(arg0) \ + __dtrace_mysql___net__write__done(arg0) +#define MYSQL_NET_WRITE_DONE_ENABLED() \ + __dtraceenabled_mysql___net__write__done() +#define MYSQL_NET_WRITE_START(arg0) \ + __dtrace_mysql___net__write__start(arg0) +#define MYSQL_NET_WRITE_START_ENABLED() \ + __dtraceenabled_mysql___net__write__start() +#define MYSQL_QUERY_CACHE_HIT(arg0, arg1) \ + __dtrace_mysql___query__cache__hit(arg0, arg1) +#define MYSQL_QUERY_CACHE_HIT_ENABLED() \ + __dtraceenabled_mysql___query__cache__hit() +#define MYSQL_QUERY_CACHE_MISS(arg0) \ + __dtrace_mysql___query__cache__miss(arg0) +#define MYSQL_QUERY_CACHE_MISS_ENABLED() \ + __dtraceenabled_mysql___query__cache__miss() +#define MYSQL_QUERY_DONE(arg0) \ + __dtrace_mysql___query__done(arg0) +#define MYSQL_QUERY_DONE_ENABLED() \ + __dtraceenabled_mysql___query__done() +#define MYSQL_QUERY_EXEC_DONE(arg0) \ + __dtrace_mysql___query__exec__done(arg0) +#define MYSQL_QUERY_EXEC_DONE_ENABLED() \ + __dtraceenabled_mysql___query__exec__done() +#define MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5) \ + __dtrace_mysql___query__exec__start(arg0, arg1, arg2, arg3, arg4, arg5) +#define MYSQL_QUERY_EXEC_START_ENABLED() \ + __dtraceenabled_mysql___query__exec__start() +#define MYSQL_QUERY_PARSE_DONE(arg0) \ + __dtrace_mysql___query__parse__done(arg0) +#define MYSQL_QUERY_PARSE_DONE_ENABLED() \ + __dtraceenabled_mysql___query__parse__done() +#define MYSQL_QUERY_PARSE_START(arg0) \ + __dtrace_mysql___query__parse__start(arg0) +#define MYSQL_QUERY_PARSE_START_ENABLED() \ + __dtraceenabled_mysql___query__parse__start() +#define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4) \ + __dtrace_mysql___query__start(arg0, arg1, arg2, arg3, arg4) +#define MYSQL_QUERY_START_ENABLED() \ + __dtraceenabled_mysql___query__start() +#define MYSQL_SELECT_DONE(arg0, arg1) \ + __dtrace_mysql___select__done(arg0, arg1) +#define MYSQL_SELECT_DONE_ENABLED() \ + __dtraceenabled_mysql___select__done() +#define MYSQL_SELECT_START(arg0) \ + __dtrace_mysql___select__start(arg0) +#define MYSQL_SELECT_START_ENABLED() \ + __dtraceenabled_mysql___select__start() +#define MYSQL_UPDATE_DONE(arg0, arg1, arg2) \ + __dtrace_mysql___update__done(arg0, arg1, arg2) +#define MYSQL_UPDATE_DONE_ENABLED() \ + __dtraceenabled_mysql___update__done() +#define MYSQL_UPDATE_ROW_DONE(arg0) \ + __dtrace_mysql___update__row__done(arg0) +#define MYSQL_UPDATE_ROW_DONE_ENABLED() \ + __dtraceenabled_mysql___update__row__done() +#define MYSQL_UPDATE_ROW_START(arg0, arg1) \ + __dtrace_mysql___update__row__start(arg0, arg1) +#define MYSQL_UPDATE_ROW_START_ENABLED() \ + __dtraceenabled_mysql___update__row__start() +#define MYSQL_UPDATE_START(arg0) \ + __dtrace_mysql___update__start(arg0) +#define MYSQL_UPDATE_START_ENABLED() \ + __dtraceenabled_mysql___update__start() + + +extern void __dtrace_mysql___command__done(int); +extern int __dtraceenabled_mysql___command__done(void); +extern void __dtrace_mysql___command__start(unsigned long, int, char *, char *); +extern int __dtraceenabled_mysql___command__start(void); +extern void __dtrace_mysql___connection__done(int, unsigned long); +extern int __dtraceenabled_mysql___connection__done(void); +extern void __dtrace_mysql___connection__start(unsigned long, char *, char *); +extern int __dtraceenabled_mysql___connection__start(void); +extern void __dtrace_mysql___delete__done(int, unsigned long); +extern int __dtraceenabled_mysql___delete__done(void); +extern void __dtrace_mysql___delete__row__done(int); +extern int __dtraceenabled_mysql___delete__row__done(void); +extern void __dtrace_mysql___delete__row__start(char *, char *); +extern int __dtraceenabled_mysql___delete__row__start(void); +extern void __dtrace_mysql___delete__start(char *); +extern int __dtraceenabled_mysql___delete__start(void); +extern void __dtrace_mysql___filesort__done(int, unsigned long); +extern int __dtraceenabled_mysql___filesort__done(void); +extern void __dtrace_mysql___filesort__start(char *, char *); +extern int __dtraceenabled_mysql___filesort__start(void); +extern void __dtrace_mysql___handler__rdlock__done(int); +extern int __dtraceenabled_mysql___handler__rdlock__done(void); +extern void __dtrace_mysql___handler__rdlock__start(char *, char *); +extern int __dtraceenabled_mysql___handler__rdlock__start(void); +extern void __dtrace_mysql___handler__unlock__done(int); +extern int __dtraceenabled_mysql___handler__unlock__done(void); +extern void __dtrace_mysql___handler__unlock__start(char *, char *); +extern int __dtraceenabled_mysql___handler__unlock__start(void); +extern void __dtrace_mysql___handler__wrlock__done(int); +extern int __dtraceenabled_mysql___handler__wrlock__done(void); +extern void __dtrace_mysql___handler__wrlock__start(char *, char *); +extern int __dtraceenabled_mysql___handler__wrlock__start(void); +extern void __dtrace_mysql___insert__done(int, unsigned long); +extern int __dtraceenabled_mysql___insert__done(void); +extern void __dtrace_mysql___insert__row__done(int); +extern int __dtraceenabled_mysql___insert__row__done(void); +extern void __dtrace_mysql___insert__row__start(char *, char *); +extern int __dtraceenabled_mysql___insert__row__start(void); +extern void __dtrace_mysql___insert__select__done(int, unsigned long); +extern int __dtraceenabled_mysql___insert__select__done(void); +extern void __dtrace_mysql___insert__select__start(char *); +extern int __dtraceenabled_mysql___insert__select__start(void); +extern void __dtrace_mysql___insert__start(char *); +extern int __dtraceenabled_mysql___insert__start(void); +extern void __dtrace_mysql___multi__delete__done(int, unsigned long); +extern int __dtraceenabled_mysql___multi__delete__done(void); +extern void __dtrace_mysql___multi__delete__start(char *); +extern int __dtraceenabled_mysql___multi__delete__start(void); +extern void __dtrace_mysql___multi__update__done(int, unsigned long, unsigned long); +extern int __dtraceenabled_mysql___multi__update__done(void); +extern void __dtrace_mysql___multi__update__start(char *); +extern int __dtraceenabled_mysql___multi__update__start(void); +extern void __dtrace_mysql___net__read__done(int, unsigned long); +extern int __dtraceenabled_mysql___net__read__done(void); +extern void __dtrace_mysql___net__read__start(void); +extern int __dtraceenabled_mysql___net__read__start(void); +extern void __dtrace_mysql___net__write__done(int); +extern int __dtraceenabled_mysql___net__write__done(void); +extern void __dtrace_mysql___net__write__start(unsigned long); +extern int __dtraceenabled_mysql___net__write__start(void); +extern void __dtrace_mysql___query__cache__hit(char *, unsigned long); +extern int __dtraceenabled_mysql___query__cache__hit(void); +extern void __dtrace_mysql___query__cache__miss(char *); +extern int __dtraceenabled_mysql___query__cache__miss(void); +extern void __dtrace_mysql___query__done(int); +extern int __dtraceenabled_mysql___query__done(void); +extern void __dtrace_mysql___query__exec__done(int); +extern int __dtraceenabled_mysql___query__exec__done(void); +extern void __dtrace_mysql___query__exec__start(char *, unsigned long, char *, char *, char *, int); +extern int __dtraceenabled_mysql___query__exec__start(void); +extern void __dtrace_mysql___query__parse__done(int); +extern int __dtraceenabled_mysql___query__parse__done(void); +extern void __dtrace_mysql___query__parse__start(char *); +extern int __dtraceenabled_mysql___query__parse__start(void); +extern void __dtrace_mysql___query__start(char *, unsigned long, char *, char *, char *); +extern int __dtraceenabled_mysql___query__start(void); +extern void __dtrace_mysql___select__done(int, unsigned long); +extern int __dtraceenabled_mysql___select__done(void); +extern void __dtrace_mysql___select__start(char *); +extern int __dtraceenabled_mysql___select__start(void); +extern void __dtrace_mysql___update__done(int, unsigned long, unsigned long); +extern int __dtraceenabled_mysql___update__done(void); +extern void __dtrace_mysql___update__row__done(int); +extern int __dtraceenabled_mysql___update__row__done(void); +extern void __dtrace_mysql___update__row__start(char *, char *); +extern int __dtraceenabled_mysql___update__row__start(void); +extern void __dtrace_mysql___update__start(char *); +extern int __dtraceenabled_mysql___update__start(void); + +#else + +#define MYSQL_COMMAND_DONE(arg0) +#define MYSQL_COMMAND_DONE_ENABLED() (0) +#define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3) +#define MYSQL_COMMAND_START_ENABLED() (0) +#define MYSQL_CONNECTION_DONE(arg0, arg1) +#define MYSQL_CONNECTION_DONE_ENABLED() (0) +#define MYSQL_CONNECTION_START(arg0, arg1, arg2) +#define MYSQL_CONNECTION_START_ENABLED() (0) +#define MYSQL_DELETE_DONE(arg0, arg1) +#define MYSQL_DELETE_DONE_ENABLED() (0) +#define MYSQL_DELETE_ROW_DONE(arg0) +#define MYSQL_DELETE_ROW_DONE_ENABLED() (0) +#define MYSQL_DELETE_ROW_START(arg0, arg1) +#define MYSQL_DELETE_ROW_START_ENABLED() (0) +#define MYSQL_DELETE_START(arg0) +#define MYSQL_DELETE_START_ENABLED() (0) +#define MYSQL_FILESORT_DONE(arg0, arg1) +#define MYSQL_FILESORT_DONE_ENABLED() (0) +#define MYSQL_FILESORT_START(arg0, arg1) +#define MYSQL_FILESORT_START_ENABLED() (0) +#define MYSQL_HANDLER_RDLOCK_DONE(arg0) +#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() (0) +#define MYSQL_HANDLER_RDLOCK_START(arg0, arg1) +#define MYSQL_HANDLER_RDLOCK_START_ENABLED() (0) +#define MYSQL_HANDLER_UNLOCK_DONE(arg0) +#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() (0) +#define MYSQL_HANDLER_UNLOCK_START(arg0, arg1) +#define MYSQL_HANDLER_UNLOCK_START_ENABLED() (0) +#define MYSQL_HANDLER_WRLOCK_DONE(arg0) +#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() (0) +#define MYSQL_HANDLER_WRLOCK_START(arg0, arg1) +#define MYSQL_HANDLER_WRLOCK_START_ENABLED() (0) +#define MYSQL_INSERT_DONE(arg0, arg1) +#define MYSQL_INSERT_DONE_ENABLED() (0) +#define MYSQL_INSERT_ROW_DONE(arg0) +#define MYSQL_INSERT_ROW_DONE_ENABLED() (0) +#define MYSQL_INSERT_ROW_START(arg0, arg1) +#define MYSQL_INSERT_ROW_START_ENABLED() (0) +#define MYSQL_INSERT_SELECT_DONE(arg0, arg1) +#define MYSQL_INSERT_SELECT_DONE_ENABLED() (0) +#define MYSQL_INSERT_SELECT_START(arg0) +#define MYSQL_INSERT_SELECT_START_ENABLED() (0) +#define MYSQL_INSERT_START(arg0) +#define MYSQL_INSERT_START_ENABLED() (0) +#define MYSQL_MULTI_DELETE_DONE(arg0, arg1) +#define MYSQL_MULTI_DELETE_DONE_ENABLED() (0) +#define MYSQL_MULTI_DELETE_START(arg0) +#define MYSQL_MULTI_DELETE_START_ENABLED() (0) +#define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2) +#define MYSQL_MULTI_UPDATE_DONE_ENABLED() (0) +#define MYSQL_MULTI_UPDATE_START(arg0) +#define MYSQL_MULTI_UPDATE_START_ENABLED() (0) +#define MYSQL_NET_READ_DONE(arg0, arg1) +#define MYSQL_NET_READ_DONE_ENABLED() (0) +#define MYSQL_NET_READ_START() +#define MYSQL_NET_READ_START_ENABLED() (0) +#define MYSQL_NET_WRITE_DONE(arg0) +#define MYSQL_NET_WRITE_DONE_ENABLED() (0) +#define MYSQL_NET_WRITE_START(arg0) +#define MYSQL_NET_WRITE_START_ENABLED() (0) +#define MYSQL_QUERY_CACHE_HIT(arg0, arg1) +#define MYSQL_QUERY_CACHE_HIT_ENABLED() (0) +#define MYSQL_QUERY_CACHE_MISS(arg0) +#define MYSQL_QUERY_CACHE_MISS_ENABLED() (0) +#define MYSQL_QUERY_DONE(arg0) +#define MYSQL_QUERY_DONE_ENABLED() (0) +#define MYSQL_QUERY_EXEC_DONE(arg0) +#define MYSQL_QUERY_EXEC_DONE_ENABLED() (0) +#define MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5) +#define MYSQL_QUERY_EXEC_START_ENABLED() (0) +#define MYSQL_QUERY_PARSE_DONE(arg0) +#define MYSQL_QUERY_PARSE_DONE_ENABLED() (0) +#define MYSQL_QUERY_PARSE_START(arg0) +#define MYSQL_QUERY_PARSE_START_ENABLED() (0) +#define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4) +#define MYSQL_QUERY_START_ENABLED() (0) +#define MYSQL_SELECT_DONE(arg0, arg1) +#define MYSQL_SELECT_DONE_ENABLED() (0) +#define MYSQL_SELECT_START(arg0) +#define MYSQL_SELECT_START_ENABLED() (0) +#define MYSQL_UPDATE_DONE(arg0, arg1, arg2) +#define MYSQL_UPDATE_DONE_ENABLED() (0) +#define MYSQL_UPDATE_ROW_DONE(arg0) +#define MYSQL_UPDATE_ROW_DONE_ENABLED() (0) +#define MYSQL_UPDATE_ROW_START(arg0, arg1) +#define MYSQL_UPDATE_ROW_START_ENABLED() (0) +#define MYSQL_UPDATE_START(arg0) +#define MYSQL_UPDATE_START_ENABLED() (0) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _PROBES_H */ diff --git a/dep/include/mysql/m_ctype.h b/externals/mysql/m_ctype.h similarity index 53% rename from dep/include/mysql/m_ctype.h rename to externals/mysql/m_ctype.h index ac067636b0a..33229a3347e 100644 --- a/dep/include/mysql/m_ctype.h +++ b/externals/mysql/m_ctype.h @@ -49,6 +49,13 @@ typedef struct unicase_info_st extern MY_UNICASE_INFO *my_unicase_default[256]; extern MY_UNICASE_INFO *my_unicase_turkish[256]; +typedef struct uni_ctype_st +{ + uchar pctype; + uchar *ctype; +} MY_UNI_CTYPE; + +extern MY_UNI_CTYPE my_uni_ctype[256]; /* wm_wc and wc_mb return codes */ #define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ @@ -78,7 +85,9 @@ extern MY_UNICASE_INFO *my_unicase_turkish[256]; #define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ #define MY_CS_CSSORT 1024 /* if case sensitive sort order */ -#define MY_CS_PUREASCII 2048 /* if a charset is pure ascii */ +#define MY_CS_HIDDEN 2048 /* don't display in SHOW */ +#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */ +#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ #define MY_CHARSET_UNDEFINED 0 /* Character repertoire flags */ @@ -86,6 +95,38 @@ extern MY_UNICASE_INFO *my_unicase_turkish[256]; #define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */ #define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */ +/* Flags for strxfrm */ +#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */ +#define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */ +#define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */ +#define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */ +#define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */ +#define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */ +#define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six */ +#define MY_STRXFRM_NLEVELS 6 /* Number of possible levels*/ + +#define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces */ +#define MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) */ + +#define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 */ +#define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 */ +#define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 */ +#define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 */ +#define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 */ +#define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 */ +#define MY_STRXFRM_DESC_SHIFT 8 + +#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions */ +#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions */ + +#define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level1 */ +#define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level2 */ +#define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level3 */ +#define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level4 */ +#define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level5 */ +#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */ +#define MY_STRXFRM_REVERSE_SHIFT 16 + typedef struct my_uni_idx_st { @@ -123,22 +164,23 @@ struct charset_info_st; /* See strings/CHARSET_INFO.txt for information about this structure */ typedef struct my_collation_handler_st { - my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); + my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); /* Collation routines */ int (*strnncoll)(struct charset_info_st *, - const uchar *, uint, const uchar *, uint, my_bool); + const uchar *, size_t, const uchar *, size_t, my_bool); int (*strnncollsp)(struct charset_info_st *, - const uchar *, uint, const uchar *, uint, + const uchar *, size_t, const uchar *, size_t, my_bool diff_if_only_endspace_difference); - int (*strnxfrm)(struct charset_info_st *, - uchar *, uint, const uchar *, uint); - uint (*strnxfrmlen)(struct charset_info_st *, uint); + size_t (*strnxfrm)(struct charset_info_st *, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags); + size_t (*strnxfrmlen)(struct charset_info_st *, size_t); my_bool (*like_range)(struct charset_info_st *, - const char *s, uint s_length, + const char *s, size_t s_length, pchar w_prefix, pchar w_one, pchar w_many, - uint res_length, + size_t res_length, char *min_str, char *max_str, - uint *min_len, uint *max_len); + size_t *min_len, size_t *max_len); int (*wildcmp)(struct charset_info_st *, const char *str,const char *str_end, const char *wildstr,const char *wildend, @@ -147,14 +189,14 @@ typedef struct my_collation_handler_st int (*strcasecmp)(struct charset_info_st *, const char *, const char *); uint (*instr)(struct charset_info_st *, - const char *b, uint b_length, - const char *s, uint s_length, + const char *b, size_t b_length, + const char *s, size_t s_length, my_match_t *match, uint nmatch); /* Hash calculation */ - void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len, + void (*hash_sort)(struct charset_info_st *cs, const uchar *key, size_t len, ulong *nr1, ulong *nr2); - my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len); + my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, size_t len); } MY_COLLATION_HANDLER; extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; @@ -162,64 +204,76 @@ extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; +/* Some typedef to make it easy for C++ to make function pointers */ +typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, my_wc_t *, + const uchar *, const uchar *); +typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, my_wc_t, + uchar *, uchar *); +typedef size_t (*my_charset_conv_case)(struct charset_info_st *, + char *, size_t, char *, size_t); + /* See strings/CHARSET_INFO.txt about information on this structure */ typedef struct my_charset_handler_st { - my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); + my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); /* Multibyte routines */ - int (*ismbchar)(struct charset_info_st *, const char *, const char *); - int (*mbcharlen)(struct charset_info_st *, uint); - uint (*numchars)(struct charset_info_st *, const char *b, const char *e); - uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos); - uint (*well_formed_len)(struct charset_info_st *, + uint (*ismbchar)(struct charset_info_st *, const char *, const char *); + uint (*mbcharlen)(struct charset_info_st *, uint c); + size_t (*numchars)(struct charset_info_st *, const char *b, const char *e); + size_t (*charpos)(struct charset_info_st *, const char *b, const char *e, + size_t pos); + size_t (*well_formed_len)(struct charset_info_st *, const char *b,const char *e, - uint nchars, int *error); - uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length); - uint (*numcells)(struct charset_info_st *, const char *b, const char *e); + size_t nchars, int *error); + size_t (*lengthsp)(struct charset_info_st *, const char *ptr, size_t length); + size_t (*numcells)(struct charset_info_st *, const char *b, const char *e); - /* Unicode convertion */ - int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc, - const unsigned char *s,const unsigned char *e); - int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc, - unsigned char *s,unsigned char *e); - - /* Functions for case and sort convertion */ - uint (*caseup_str)(struct charset_info_st *, char *); - uint (*casedn_str)(struct charset_info_st *, char *); - uint (*caseup)(struct charset_info_st *, char *src, uint srclen, - char *dst, uint dstlen); - uint (*casedn)(struct charset_info_st *, char *src, uint srclen, - char *dst, uint dstlen); + /* Unicode conversion */ + my_charset_conv_mb_wc mb_wc; + my_charset_conv_wc_mb wc_mb; + + /* CTYPE scanner */ + int (*ctype)(struct charset_info_st *cs, int *ctype, + const uchar *s, const uchar *e); + /* Functions for case and sort conversion */ + size_t (*caseup_str)(struct charset_info_st *, char *); + size_t (*casedn_str)(struct charset_info_st *, char *); + + my_charset_conv_case caseup; + my_charset_conv_case casedn; + /* Charset dependant snprintf() */ - int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt, - ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); - int (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix, - long int val); - int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n, - int radix, longlong val); + size_t (*snprintf)(struct charset_info_st *, char *to, size_t n, + const char *fmt, + ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); + size_t (*long10_to_str)(struct charset_info_st *, char *to, size_t n, + int radix, long int val); + size_t (*longlong10_to_str)(struct charset_info_st *, char *to, size_t n, + int radix, longlong val); - void (*fill)(struct charset_info_st *, char *to, uint len, int fill); + void (*fill)(struct charset_info_st *, char *to, size_t len, int fill); - /* String-to-number convertion routines */ - long (*strntol)(struct charset_info_st *, const char *s, uint l, + /* String-to-number conversion routines */ + long (*strntol)(struct charset_info_st *, const char *s, size_t l, int base, char **e, int *err); - ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, + ulong (*strntoul)(struct charset_info_st *, const char *s, size_t l, int base, char **e, int *err); - longlong (*strntoll)(struct charset_info_st *, const char *s, uint l, + longlong (*strntoll)(struct charset_info_st *, const char *s, size_t l, int base, char **e, int *err); - ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l, + ulonglong (*strntoull)(struct charset_info_st *, const char *s, size_t l, int base, char **e, int *err); - double (*strntod)(struct charset_info_st *, char *s, uint l, char **e, + double (*strntod)(struct charset_info_st *, char *s, size_t l, char **e, int *err); longlong (*strtoll10)(struct charset_info_st *cs, const char *nptr, char **endptr, int *error); ulonglong (*strntoull10rnd)(struct charset_info_st *cs, - const char *str, uint length, int unsigned_fl, + const char *str, size_t length, + int unsigned_fl, char **endptr, int *error); - ulong (*scan)(struct charset_info_st *, const char *b, const char *e, - int sq); + size_t (*scan)(struct charset_info_st *, const char *b, const char *e, + int sq); } MY_CHARSET_HANDLER; extern MY_CHARSET_HANDLER my_charset_8bit_handler; @@ -257,27 +311,32 @@ typedef struct charset_info_st uint16 max_sort_char; /* For LIKE optimization */ uchar pad_char; my_bool escape_with_backslash_is_dangerous; + uchar levels_for_compare; + uchar levels_for_order; MY_CHARSET_HANDLER *cset; MY_COLLATION_HANDLER *coll; } CHARSET_INFO; +#define ILLEGAL_CHARSET_INFO_NUMBER (~0U) -extern CHARSET_INFO my_charset_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; extern CHARSET_INFO my_charset_big5_chinese_ci; extern CHARSET_INFO my_charset_big5_bin; extern CHARSET_INFO my_charset_cp932_japanese_ci; extern CHARSET_INFO my_charset_cp932_bin; +extern CHARSET_INFO my_charset_cp1250_czech_ci; extern CHARSET_INFO my_charset_eucjpms_japanese_ci; extern CHARSET_INFO my_charset_eucjpms_bin; extern CHARSET_INFO my_charset_euckr_korean_ci; extern CHARSET_INFO my_charset_euckr_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; extern CHARSET_INFO my_charset_gb2312_chinese_ci; extern CHARSET_INFO my_charset_gb2312_bin; extern CHARSET_INFO my_charset_gbk_chinese_ci; extern CHARSET_INFO my_charset_gbk_bin; -extern CHARSET_INFO my_charset_latin1; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; extern CHARSET_INFO my_charset_latin1_german2_ci; extern CHARSET_INFO my_charset_latin1_bin; extern CHARSET_INFO my_charset_latin2_czech_ci; @@ -290,67 +349,85 @@ extern CHARSET_INFO my_charset_ucs2_bin; extern CHARSET_INFO my_charset_ucs2_unicode_ci; extern CHARSET_INFO my_charset_ujis_japanese_ci; extern CHARSET_INFO my_charset_ujis_bin; -extern CHARSET_INFO my_charset_utf8_general_ci; -extern CHARSET_INFO my_charset_utf8_unicode_ci; -extern CHARSET_INFO my_charset_utf8_bin; -extern CHARSET_INFO my_charset_cp1250_czech_ci; +extern CHARSET_INFO my_charset_utf16_bin; +extern CHARSET_INFO my_charset_utf16_general_ci; +extern CHARSET_INFO my_charset_utf16_unicode_ci; +extern CHARSET_INFO my_charset_utf32_bin; +extern CHARSET_INFO my_charset_utf32_general_ci; +extern CHARSET_INFO my_charset_utf32_unicode_ci; +extern CHARSET_INFO my_charset_utf8mb3_bin; +extern CHARSET_INFO my_charset_utf8mb3_general_ci; +extern CHARSET_INFO my_charset_utf8mb3_unicode_ci; +extern CHARSET_INFO my_charset_utf8mb4_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_general_ci; +extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; + +#define MY_UTF8MB3 "utf8mb3" +#define MY_UTF8MB4 "utf8" +#define my_charset_utf8_general_ci my_charset_utf8mb4_general_ci +#define my_charset_utf8_bin my_charset_utf8mb4_bin + /* declarations for simple charsets */ -extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, - uint); -uint my_strnxfrmlen_simple(CHARSET_INFO *, uint); -extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, - const uchar *, uint, my_bool); +extern size_t my_strnxfrm_simple(CHARSET_INFO *, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags); +size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t); +extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t, + const uchar *, size_t, my_bool); -extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint, - const uchar *, uint, +extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t, + const uchar *, size_t, my_bool diff_if_only_endspace_difference); extern void my_hash_sort_simple(CHARSET_INFO *cs, - const uchar *key, uint len, + const uchar *key, size_t len, ulong *nr1, ulong *nr2); -extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length); +extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length); extern uint my_instr_simple(struct charset_info_st *, - const char *b, uint b_length, - const char *s, uint s_length, + const char *b, size_t b_length, + const char *s, size_t s_length, my_match_t *match, uint nmatch); /* Functions for 8bit */ -extern uint my_caseup_str_8bit(CHARSET_INFO *, char *); -extern uint my_casedn_str_8bit(CHARSET_INFO *, char *); -extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); -extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); +extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *); +extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *); +extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e); int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); -ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq); +int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *); +int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *); -int my_snprintf_8bit(struct charset_info_st *, char *to, uint n, - const char *fmt, ...) +size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq); + +size_t my_snprintf_8bit(struct charset_info_st *, char *to, size_t n, + const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 4, 5); -long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base, +long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base, + char **e, int *err); +ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base, char **e, int *err); -ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base, +longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base, char **e, int *err); -longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base, +ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base, char **e, int *err); -ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base, - char **e, int *err); -double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e, +double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e, int *err); -int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, - long int val); -int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, - longlong val); +size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, + long int val); +size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, + longlong val); longlong my_strtoll10_8bit(CHARSET_INFO *cs, const char *nptr, char **endptr, int *error); @@ -358,34 +435,48 @@ longlong my_strtoll10_ucs2(CHARSET_INFO *cs, const char *nptr, char **endptr, int *error); ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs, - const char *str, uint length, int unsigned_fl, - char **endptr, int *error); + const char *str, size_t length, int + unsigned_fl, char **endptr, int *error); ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, - const char *str, uint length, int unsigned_fl, - char **endptr, int *error); + const char *str, size_t length, + int unsigned_fl, char **endptr, int *error); -void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill); +void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill); my_bool my_like_range_simple(CHARSET_INFO *cs, - const char *ptr, uint ptr_length, + const char *ptr, size_t ptr_length, pbool escape, pbool w_one, pbool w_many, - uint res_length, + size_t res_length, char *min_str, char *max_str, - uint *min_length, uint *max_length); + size_t *min_length, size_t *max_length); my_bool my_like_range_mb(CHARSET_INFO *cs, - const char *ptr, uint ptr_length, + const char *ptr, size_t ptr_length, pbool escape, pbool w_one, pbool w_many, - uint res_length, + size_t res_length, char *min_str, char *max_str, - uint *min_length, uint *max_length); + size_t *min_length, size_t *max_length); my_bool my_like_range_ucs2(CHARSET_INFO *cs, - const char *ptr, uint ptr_length, + const char *ptr, size_t ptr_length, pbool escape, pbool w_one, pbool w_many, - uint res_length, + size_t res_length, char *min_str, char *max_str, - uint *min_length, uint *max_length); + size_t *min_length, size_t *max_length); + +my_bool my_like_range_utf16(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); + +my_bool my_like_range_utf32(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); int my_wildcmp_8bit(CHARSET_INFO *, @@ -398,55 +489,96 @@ int my_wildcmp_bin(CHARSET_INFO *, const char *wildstr,const char *wildend, int escape, int w_one, int w_many); -uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); -uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); -uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos); -uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, - uint pos, int *error); -int my_mbcharlen_8bit(CHARSET_INFO *, uint c); +size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); +size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); +size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos); +size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, + size_t pos, int *error); +uint my_mbcharlen_8bit(CHARSET_INFO *, uint c); /* Functions for multibyte charsets */ -extern uint my_caseup_str_mb(CHARSET_INFO *, char *); -extern uint my_casedn_str_mb(CHARSET_INFO *, char *); -extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); -extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen, - char *dst, uint dstlen); +extern size_t my_caseup_str_mb(CHARSET_INFO *, char *); +extern size_t my_casedn_str_mb(CHARSET_INFO *, char *); +extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); int my_wildcmp_mb(CHARSET_INFO *, const char *str,const char *str_end, const char *wildstr,const char *wildend, int escape, int w_one, int w_many); -uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); -uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); -uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); -uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, - uint pos, int *error); +size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); +size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); +size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos); +size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, + size_t pos, int *error); uint my_instr_mb(struct charset_info_st *, - const char *b, uint b_length, - const char *s, uint s_length, + const char *b, size_t b_length, + const char *s, size_t s_length, my_match_t *match, uint nmatch); +int my_strnncoll_mb_bin(CHARSET_INFO * cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix); + +int my_strnncollsp_mb_bin(CHARSET_INFO *cs, + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference); + +int my_wildcmp_mb_bin(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many); + +int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), + const char *s, const char *t); + +void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2); + +size_t my_strnxfrm_mb(CHARSET_INFO *, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags); + +size_t my_strnxfrm_unicode(CHARSET_INFO *, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags); + int my_wildcmp_unicode(CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many, MY_UNICASE_INFO **weights); -extern my_bool my_parse_charset_xml(const char *bug, uint len, +extern my_bool my_parse_charset_xml(const char *bug, size_t len, int (*add)(CHARSET_INFO *cs)); +extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, + pchar c); -my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len); -my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len); +my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len); +my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len); uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); +uint my_charset_repertoire(CHARSET_INFO *cs); +uint my_strxfrm_flag_normalize(uint flags, uint nlevels); +void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend, + uint flags, uint level); +size_t my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs, + uchar *str, uchar *frmend, uchar *strend, + uint nweights, uint flags, uint level); + +my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); + #define _MY_U 01 /* Upper case */ #define _MY_L 02 /* Lower case */ #define _MY_NMR 04 /* Numeral (digit) */ @@ -481,7 +613,8 @@ my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); #define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) #define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) -#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d))) +#define my_strnxfrm(cs, d, dl, s, sl) \ + ((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), MY_STRXFRM_PAD_WITH_SPACE)) #define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0)) #define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \ ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j))) @@ -519,4 +652,3 @@ my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); #endif #endif /* _m_ctype_h */ - diff --git a/externals/mysql/m_string.h b/externals/mysql/m_string.h new file mode 100644 index 00000000000..bb8bad4b53e --- /dev/null +++ b/externals/mysql/m_string.h @@ -0,0 +1,393 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* There may be prolems include all of theese. Try to test in + configure with ones are needed? */ + +/* This is needed for the definitions of strchr... on solaris */ + +#ifndef _m_string_h +#define _m_string_h +#ifndef __USE_GNU +#define __USE_GNU /* We want to use stpcpy */ +#endif +#if defined(HAVE_STRINGS_H) +#include +#endif +#if defined(HAVE_STRING_H) +#include +#endif + +/* need by my_vsnprintf */ +#include + +#ifdef _AIX +#undef HAVE_BCMP +#endif + +/* This is needed for the definitions of bzero... on solaris */ +#if defined(HAVE_STRINGS_H) +#include +#endif + +/* This is needed for the definitions of memcpy... on solaris */ +#if defined(HAVE_MEMORY_H) && !defined(__cplusplus) +#include +#endif + +#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE) +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memset(A,C,B) bfill((A),(B),(C)) +# define memmove(d, s, n) bmove ((d), (s), (n)) +#elif defined(HAVE_MEMMOVE) +# define bmove(d, s, n) memmove((d), (s), (n)) +#else +# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */ +#endif + +/* Unixware 7 */ +#if !defined(HAVE_BFILL) +# define bfill(A,B,C) memset((A),(C),(B)) +# define bmove_align(A,B,C) memcpy((A),(B),(C)) +#endif + +#if !defined(HAVE_BCMP) +# define bcopy(s, d, n) memcpy((d), (s), (n)) +# define bcmp(A,B,C) memcmp((A),(B),(C)) +# define bzero(A,B) memset((A),0,(B)) +# define bmove_align(A,B,C) memcpy((A),(B),(C)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + my_str_malloc() and my_str_free() are assigned to implementations in + strings/alloc.c, but can be overridden in the calling program. + */ +extern void *(*my_str_malloc)(size_t); +extern void (*my_str_free)(void *); + +#if defined(HAVE_STPCPY) +#define strmov(A,B) stpcpy((A),(B)) +#ifndef stpcpy +extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ +#endif +#endif + +/* Declared in int2str() */ +extern char NEAR _dig_vec_upper[]; +extern char NEAR _dig_vec_lower[]; + +#ifdef BAD_STRING_COMPILER +#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) +#else +#define strmov_overlapp(A,B) strmov(A,B) +#define strmake_overlapp(A,B,C) strmake(A,B,C) +#endif + +#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */ +#define memcpy_fixed(A,B,C) bmove((A),(B),(C)) +#else +#define memcpy_fixed(A,B,C) memcpy((A),(B),(C)) +#endif + +#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512) +#define bmove512(A,B,C) memcpy(A,B,C) +#endif + + /* Prototypes for string functions */ + +#if !defined(bfill) && !defined(HAVE_BFILL) +extern void bfill(uchar *dst,size_t len,pchar fill); +#endif + +#if !defined(bzero) && !defined(HAVE_BZERO) +extern void bzero(uchar * dst,size_t len); +#endif + +#if !defined(bcmp) && !defined(HAVE_BCMP) +extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len); +#endif +#ifdef HAVE_purify +extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len); +#undef bcmp +#define bcmp(A,B,C) my_bcmp((A),(B),(C)) +#define bzero_if_purify(A,B) bzero(A,B) +#else +#define bzero_if_purify(A,B) +#endif /* HAVE_purify */ + +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) +#define LINT_INIT_STRUCT(var) bzero(&var, sizeof(var)) /* No uninitialize-warning */ +#else +#define LINT_INIT_STRUCT(var) +#endif + +#ifndef bmove512 +extern void bmove512(uchar *dst,const uchar *src,size_t len); +#endif + +#if !defined(HAVE_BMOVE) && !defined(bmove) +extern void bmove(uuchar *dst, const uchar *src,size_t len); +#endif + +extern void bmove_upp(uchar *dst,const uchar *src,size_t len); +extern void bchange(uchar *dst,size_t old_len,const uchar *src, + size_t new_len,size_t tot_len); +extern void strappend(char *s,size_t len,pchar fill); +extern char *strend(const char *s); +extern char *strcend(const char *, pchar); +extern char *strfield(char *src,int fields,int chars,int blanks, + int tabch); +extern char *strfill(char * s,size_t len,pchar fill); +extern size_t strinstr(const char *str,const char *search); +extern size_t r_strinstr(const char *str, size_t from, const char *search); +extern char *strkey(char *dst,char *head,char *tail,char *flags); +extern char *strmake(char *dst,const char *src,size_t length); +#ifndef strmake_overlapp +extern char *strmake_overlapp(char *dst,const char *src, size_t length); +#endif + +#ifndef strmov +extern char *strmov(char *dst,const char *src); +#endif +extern char *strnmov(char *dst,const char *src,size_t n); +extern char *strsuff(const char *src,const char *suffix); +extern char *strcont(const char *src,const char *set); +extern char *strxcat _VARARGS((char *dst,const char *src, ...)); +extern char *strxmov _VARARGS((char *dst,const char *src, ...)); +extern char *strxcpy _VARARGS((char *dst,const char *src, ...)); +extern char *strxncat _VARARGS((char *dst,size_t len, const char *src, ...)); +extern char *strxnmov _VARARGS((char *dst,size_t len, const char *src, ...)); +extern char *strxncpy _VARARGS((char *dst,size_t len, const char *src, ...)); + +/* Prototypes of normal stringfunctions (with may ours) */ + +#ifdef WANT_STRING_PROTOTYPES +extern char *strcat(char *, const char *); +extern char *strchr(const char *, pchar); +extern char *strrchr(const char *, pchar); +extern char *strcpy(char *, const char *); +extern int strcmp(const char *, const char *); +#ifndef __GNUC__ +extern size_t strlen(const char *); +#endif +#endif +#ifndef HAVE_STRNLEN +extern size_t strnlen(const char *s, size_t n); +#endif + +#if !defined(__cplusplus) +#ifndef HAVE_STRPBRK +extern char *strpbrk(const char *, const char *); +#endif +#ifndef HAVE_STRSTR +extern char *strstr(const char *, const char *); +#endif +#endif +extern int is_prefix(const char *, const char *); + +/* Conversion routines */ +typedef enum { + MY_GCVT_ARG_FLOAT, + MY_GCVT_ARG_DOUBLE +} my_gcvt_arg_type; + +double my_strtod(const char *str, char **end, int *error); +double my_atof(const char *nptr); +size_t my_fcvt(double x, int precision, char *to, my_bool *error); +size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, + my_bool *error); + +#define NOT_FIXED_DEC 31 + +/* + The longest string my_fcvt can return is 311 + "precision" bytes. + Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC + (+ 1 byte for the terminating '\0'). +*/ +#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC) + +/* + We want to use the 'e' format in some cases even if we have enough space + for the 'f' one just to mimic sprintf("%.15g") behavior for large integers, + and to improve it for numbers < 10^(-4). + That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require + it to be integer and be <= 10^DBL_DIG for the 'f' format to be used. + We don't lose precision, but make cases like "1e200" or "0.00001" look nicer. +*/ +#define MAX_DECPT_FOR_F_FORMAT DBL_DIG + +/* + The maximum possible field width for my_gcvt() conversion. + (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or + MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used). +*/ +#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + max(5, MAX_DECPT_FOR_F_FORMAT)) + + +extern char *llstr(longlong value,char *buff); +extern char *ullstr(longlong value,char *buff); +#ifndef HAVE_STRTOUL +extern long strtol(const char *str, char **ptr, int base); +extern ulong strtoul(const char *str, char **ptr, int base); +#endif + +extern char *int2str(long val, char *dst, int radix, int upcase); +extern char *int10_to_str(long val,char *dst,int radix); +extern char *str2int(const char *src,int radix,long lower,long upper, + long *val); +longlong my_strtoll10(const char *nptr, char **endptr, int *error); +#if SIZEOF_LONG == SIZEOF_LONG_LONG +#define ll2str(A,B,C,D) int2str((A),(B),(C),(D)) +#define longlong2str(A,B,C) int2str((A),(B),(C),1) +#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) +#undef strtoll +#define strtoll(A,B,C) strtol((A),(B),(C)) +#define strtoull(A,B,C) strtoul((A),(B),(C)) +#ifndef HAVE_STRTOULL +#define HAVE_STRTOULL +#endif +#ifndef HAVE_STRTOLL +#define HAVE_STRTOLL +#endif +#else +#ifdef HAVE_LONG_LONG +extern char *ll2str(longlong val,char *dst,int radix, int upcase); +#define longlong2str(A,B,C) ll2str((A),(B),(C),1) +extern char *longlong10_to_str(longlong val,char *dst,int radix); +#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO)) +extern longlong strtoll(const char *str, char **ptr, int base); +extern ulonglong strtoull(const char *str, char **ptr, int base); +#endif +#endif +#endif + +/* my_vsnprintf.c */ + +extern size_t my_vsnprintf(char *str, size_t n, + const char *format, va_list ap); +extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...) + ATTRIBUTE_FORMAT(printf, 3, 4); + +#if defined(__cplusplus) +} +#endif + +/* + LEX_STRING -- a pair of a C-string and its length. + (it's part of the plugin API as a MYSQL_LEX_STRING) +*/ + +typedef struct st_mysql_lex_string LEX_STRING; + +#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1)) +#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1)) +#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) + +/* A variant with const */ +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string LEX_CSTRING; + +/* A variant with const and unsigned */ +struct st_mysql_const_unsigned_lex_string +{ + const uchar *str; + size_t length; +}; +typedef struct st_mysql_const_unsigned_lex_string LEX_CUSTRING; + +/* SPACE_INT is a word that contains only spaces */ +#if SIZEOF_INT == 4 +#define SPACE_INT 0x20202020 +#elif SIZEOF_INT == 8 +#define SPACE_INT 0x2020202020202020 +#else +#error define the appropriate constant for a word full of spaces +#endif + +/** + Skip trailing space. + + On most systems reading memory in larger chunks (ideally equal to the size of + the chinks that the machine physically reads from memory) causes fewer memory + access loops and hence increased performance. + This is why the 'int' type is used : it's closest to that (according to how + it's defined in C). + So when we determine the amount of whitespace at the end of a string we do + the following : + 1. We divide the string into 3 zones : + a) from the start of the string (__start) to the first multiple + of sizeof(int) (__start_words) + b) from the end of the string (__end) to the last multiple of sizeof(int) + (__end_words) + c) a zone that is aligned to sizeof(int) and can be safely accessed + through an int * + 2. We start comparing backwards from (c) char-by-char. If all we find is + space then we continue + 3. If there are elements in zone (b) we compare them as unsigned ints to a + int mask (SPACE_INT) consisting of all spaces + 4. Finally we compare the remaining part (a) of the string char by char. + This covers for the last non-space unsigned int from 3. (if any) + + This algorithm works well for relatively larger strings, but it will slow + the things down for smaller strings (because of the additional calculations + and checks compared to the naive method). Thus the barrier of length 20 + is added. + + @param ptr pointer to the input string + @param len the length of the string + @return the last non-space character +*/ + +static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) +{ + const uchar *end= ptr + len; + + if (len > 20) + { + const uchar *end_words= (const uchar *)(intptr) + (((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT); + const uchar *start_words= (const uchar *)(intptr) + ((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT); + + DBUG_ASSERT(((ulonglong)(intptr)ptr) >= SIZEOF_INT); + if (end_words > ptr) + { + while (end > end_words && end[-1] == 0x20) + end--; + if (end[-1] == 0x20 && start_words < end_words) + while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT) + end -= SIZEOF_INT; + } + } + while (end > ptr && end[-1] == 0x20) + end--; + return (end); +} + +#ifdef SAFEMALLOC +#define TRASH(A,B) bfill(A, B, 0x8F) +#else +#define TRASH(A,B) /* nothing */ +#endif /* SAFEMALLOC */ + +#endif /* _m_string_h */ diff --git a/externals/mysql/my_aes.h b/externals/mysql/my_aes.h new file mode 100644 index 00000000000..8ea128ca268 --- /dev/null +++ b/externals/mysql/my_aes.h @@ -0,0 +1,65 @@ +/* Copyright (C) 2002 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +/* Header file for my_aes.c */ +/* Wrapper to give simple interface for MySQL to AES standard encryption */ + +#include "mysys/rijndael.h" + +C_MODE_START + +#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */ + +/* + my_aes_encrypt - Crypt buffer with AES encryption algorithm. + source - Pointer to data for encryption + source_length - size of encryption data + dest - buffer to place encrypted data (must be large enough) + key - Key to be used for encryption + kel_length - Length of the key. Will handle keys of any length + + returns - size of encrypted data, or negative in case of error. +*/ + +int my_aes_encrypt(const char *source, int source_length, char *dest, + const char *key, int key_length); + +/* + my_aes_decrypt - DeCrypt buffer with AES encryption algorithm. + source - Pointer to data for decryption + source_length - size of encrypted data + dest - buffer to place decrypted data (must be large enough) + key - Key to be used for decryption + kel_length - Length of the key. Will handle keys of any length + + returns - size of original data, or negative in case of error. +*/ + + +int my_aes_decrypt(const char *source, int source_length, char *dest, + const char *key, int key_length); + +/* + my_aes_get_size - get size of buffer which will be large enough for encrypted + data + source_length - length of data to be encrypted + + returns - size of buffer required to store encrypted data +*/ + +int my_aes_get_size(int source_length); + +C_MODE_END diff --git a/externals/mysql/my_alarm.h b/externals/mysql/my_alarm.h new file mode 100644 index 00000000000..dd2d5642f5f --- /dev/null +++ b/externals/mysql/my_alarm.h @@ -0,0 +1,58 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + File to include when we want to use alarm or a loop_counter to display + some information when a program is running +*/ +#ifndef _my_alarm_h +#define _my_alarm_h +#ifdef __cplusplus +extern "C" { +#endif + +extern int volatile my_have_got_alarm; +extern ulong my_time_to_wait_for_lock; + +#if defined(HAVE_ALARM) && !defined(NO_ALARM_LOOP) +#include +#define ALARM_VARIABLES uint alarm_old=0; \ + sig_return alarm_signal=0 +#define ALARM_INIT my_have_got_alarm=0 ; \ + alarm_old=(uint) alarm(MY_HOW_OFTEN_TO_ALARM); \ + alarm_signal=signal(SIGALRM,my_set_alarm_variable); +#define ALARM_END (void) signal(SIGALRM,alarm_signal); \ + (void) alarm(alarm_old); +#define ALARM_TEST my_have_got_alarm +#ifdef DONT_REMEMBER_SIGNAL +#define ALARM_REINIT (void) alarm(MY_HOW_OFTEN_TO_ALARM); \ + (void) signal(SIGALRM,my_set_alarm_variable);\ + my_have_got_alarm=0; +#else +#define ALARM_REINIT (void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \ + my_have_got_alarm=0; +#endif /* DONT_REMEMBER_SIGNAL */ +#else +#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1 +#define ALARM_INIT +#define ALARM_END +#define ALARM_TEST (alarm_pos++ >= alarm_end_pos) +#define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE +#endif /* HAVE_ALARM */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/dep/include/mysql/my_alloc.h b/externals/mysql/my_alloc.h similarity index 89% rename from dep/include/mysql/my_alloc.h rename to externals/mysql/my_alloc.h index ac56c97456c..6ade4d08980 100644 --- a/dep/include/mysql/my_alloc.h +++ b/externals/mysql/my_alloc.h @@ -26,8 +26,8 @@ typedef struct st_used_mem { /* struct for once_alloc (block) */ struct st_used_mem *next; /* Next block in use */ - unsigned int left; /* memory left in block */ - unsigned int size; /* size of block */ + size_t left; /* memory left in block */ + size_t size; /* size of block */ } USED_MEM; @@ -37,8 +37,8 @@ typedef struct st_mem_root USED_MEM *used; /* blocks almost without free memory */ USED_MEM *pre_alloc; /* preallocated block */ /* if block have less memory it will be put in 'used' list */ - unsigned int min_malloc; - unsigned int block_size; /* initial block size */ + size_t min_malloc; + size_t block_size; /* initial block size */ unsigned int block_num; /* allocated blocks counter */ /* first free block in queue test counter (if it exceed @@ -49,4 +49,3 @@ typedef struct st_mem_root void (*error_handler)(void); } MEM_ROOT; #endif - diff --git a/externals/mysql/my_atomic.h b/externals/mysql/my_atomic.h new file mode 100644 index 00000000000..40b8895657d --- /dev/null +++ b/externals/mysql/my_atomic.h @@ -0,0 +1,254 @@ +/* Copyright (C) 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This header defines five atomic operations: + + my_atomic_add#(&var, what) + add 'what' to *var, and return the old value of *var + + my_atomic_fas#(&var, what) + 'Fetch And Store' + store 'what' in *var, and return the old value of *var + + my_atomic_cas#(&var, &old, new) + 'Compare And Swap' + if *var is equal to *old, then store 'new' in *var, and return TRUE + otherwise store *var in *old, and return FALSE + + my_atomic_load#(&var) + return *var + + my_atomic_store#(&var, what) + store 'what' in *var + + '#' is substituted by a size suffix - 8, 16, 32, or ptr + (e.g. my_atomic_add8, my_atomic_fas32, my_atomic_casptr). + + NOTE This operations are not always atomic, so they always must be + enclosed in my_atomic_rwlock_rdlock(lock)/my_atomic_rwlock_rdunlock(lock) + or my_atomic_rwlock_wrlock(lock)/my_atomic_rwlock_wrunlock(lock). + Hint: if a code block makes intensive use of atomic ops, it make sense + to take/release rwlock once for the whole block, not for every statement. + + On architectures where these operations are really atomic, rwlocks will + be optimized away. + 8- and 16-bit atomics aren't implemented for windows (see generic-msvc.h), + but can be added, if necessary. +*/ + +#ifndef my_atomic_rwlock_init + +#define intptr void * + +#ifndef MY_ATOMIC_MODE_RWLOCKS +#include "atomic/nolock.h" +#endif + +#ifndef make_atomic_cas_body +/* nolock.h was not able to generate even a CAS function, fall back */ +#include "atomic/rwlock.h" +#else +/* define missing functions by using the already generated ones */ +#ifndef make_atomic_add_body +#define make_atomic_add_body(S) \ + int ## S tmp=*a; \ + while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \ + v=tmp; +#endif +#ifndef make_atomic_fas_body +#define make_atomic_fas_body(S) \ + int ## S tmp=*a; \ + while (!my_atomic_cas ## S(a, &tmp, v)); \ + v=tmp; +#endif +#ifndef make_atomic_load_body +#define make_atomic_load_body(S) \ + ret= 0; /* avoid compiler warning */ \ + (void)(my_atomic_cas ## S(a, &ret, ret)); +#endif +#ifndef make_atomic_store_body +#define make_atomic_store_body(S) \ + (void)(my_atomic_fas ## S (a, v)); +#endif +#endif + +/* + transparent_union doesn't work in g++ + Bug ? + + Darwin's gcc doesn't want to put pointers in a transparent_union + when built with -arch ppc64. Complains: + warning: 'transparent_union' attribute ignored +*/ +#if defined(__GNUC__) && !defined(__cplusplus) && \ + ! (defined(__APPLE__) && defined(_ARCH_PPC64)) +/* + we want to be able to use my_atomic_xxx functions with + both signed and unsigned integers. But gcc will issue a warning + "passing arg N of `my_atomic_XXX' as [un]signed due to prototype" + if the signedness of the argument doesn't match the prototype, or + "pointer targets in passing argument N of my_atomic_XXX differ in signedness" + if int* is used where uint* is expected (or vice versa). + Let's shut these warnings up +*/ +#define make_transparent_unions(S) \ + typedef union { \ + int ## S i; \ + uint ## S u; \ + } U_ ## S __attribute__ ((transparent_union)); \ + typedef union { \ + int ## S volatile *i; \ + uint ## S volatile *u; \ + } Uv_ ## S __attribute__ ((transparent_union)); +#define uintptr intptr +make_transparent_unions(8) +make_transparent_unions(16) +make_transparent_unions(32) +make_transparent_unions(ptr) +#undef uintptr +#undef make_transparent_unions +#define a U_a.i +#define cmp U_cmp.i +#define v U_v.i +#define set U_set.i +#else +#define U_32 int32 +#define U_ptr intptr +#define Uv_32 int32 +#define Uv_ptr intptr +#define U_a volatile *a +#define U_cmp *cmp +#define U_v v +#define U_set set +#endif /* __GCC__ transparent_union magic */ + +#ifdef HAVE_INLINE + +#define make_atomic_cas(S) \ +STATIC_INLINE int my_atomic_cas ## S(Uv_ ## S U_a, \ + Uv_ ## S U_cmp, U_ ## S U_set) \ +{ \ + int8 ret; \ + make_atomic_cas_body(S); \ + return ret; \ +} + +#define make_atomic_add(S) \ +STATIC_INLINE int ## S my_atomic_add ## S( \ + Uv_ ## S U_a, U_ ## S U_v) \ +{ \ + make_atomic_add_body(S); \ + return v; \ +} + +#define make_atomic_fas(S) \ +STATIC_INLINE int ## S my_atomic_fas ## S( \ + Uv_ ## S U_a, U_ ## S U_v) \ +{ \ + make_atomic_fas_body(S); \ + return v; \ +} + +#define make_atomic_load(S) \ +STATIC_INLINE int ## S my_atomic_load ## S(Uv_ ## S U_a) \ +{ \ + int ## S ret; \ + make_atomic_load_body(S); \ + return ret; \ +} + +#define make_atomic_store(S) \ +STATIC_INLINE void my_atomic_store ## S( \ + Uv_ ## S U_a, U_ ## S U_v) \ +{ \ + make_atomic_store_body(S); \ +} + +#else /* no inline functions */ + +#define make_atomic_add(S) \ +extern int ## S my_atomic_add ## S(Uv_ ## S U_a, U_ ## S U_v); + +#define make_atomic_fas(S) \ +extern int ## S my_atomic_fas ## S(Uv_ ## S U_a, U_ ## S U_v); + +#define make_atomic_cas(S) \ +extern int my_atomic_cas ## S(Uv_ ## S U_a, Uv_ ## S U_cmp, U_ ## S U_set); + +#define make_atomic_load(S) \ +extern int ## S my_atomic_load ## S(Uv_ ## S U_a); + +#define make_atomic_store(S) \ +extern void my_atomic_store ## S(Uv_ ## S U_a, U_ ## S U_v); + +#endif + +make_atomic_cas(32) +make_atomic_cas(ptr) + +make_atomic_add(32) + +make_atomic_load(32) +make_atomic_load(ptr) + +make_atomic_fas(32) +make_atomic_fas(ptr) + +make_atomic_store(32) +make_atomic_store(ptr) + +#ifdef _atomic_h_cleanup_ +#include _atomic_h_cleanup_ +#undef _atomic_h_cleanup_ +#endif + +#undef U_32 +#undef U_ptr +#undef a +#undef cmp +#undef v +#undef set +#undef U_a +#undef U_cmp +#undef U_v +#undef U_set +#undef make_atomic_add +#undef make_atomic_cas +#undef make_atomic_load +#undef make_atomic_store +#undef make_atomic_fas +#undef make_atomic_add_body +#undef make_atomic_cas_body +#undef make_atomic_load_body +#undef make_atomic_store_body +#undef make_atomic_fas_body +#undef intptr + +/* + the macro below defines (as an expression) the code that + will be run in spin-loops. Intel manuals recummend to have PAUSE there. + It is expected to be defined in include/atomic/ *.h files +*/ +#ifndef LF_BACKOFF +#define LF_BACKOFF (1) +#endif + +#define MY_ATOMIC_OK 0 +#define MY_ATOMIC_NOT_1CPU 1 +extern int my_atomic_initialize(); + +#endif + diff --git a/externals/mysql/my_attribute.h b/externals/mysql/my_attribute.h new file mode 100644 index 00000000000..8309d85f20a --- /dev/null +++ b/externals/mysql/my_attribute.h @@ -0,0 +1,63 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Helper macros used for setting different __attributes__ + on functions in a portable fashion +*/ + +#ifndef _my_attribute_h +#define _my_attribute_h + +/* + Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers. + Some forms of __attribute__ are actually supported in earlier versions of + g++, but we just disable them all because we only use them to generate + compilation warnings. +*/ +#ifndef __attribute__ +# if !defined(__GNUC__) +# define __attribute__(A) +# elif GCC_VERSION < 2008 +# define __attribute__(A) +# elif defined(__cplusplus) && GCC_VERSION < 3004 +# define __attribute__(A) +# endif +#endif + +/* + __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4 + But that's already covered by the __attribute__ tests above, so this is + just a convenience macro. +*/ +#ifndef ATTRIBUTE_FORMAT +# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n))) +#endif + +/* + + __attribute__((format(...))) on a function pointer is not supported + until gcc 3.1 +*/ +#ifndef ATTRIBUTE_FORMAT_FPTR +# if (GCC_VERSION >= 3001) +# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n) +# else +# define ATTRIBUTE_FORMAT_FPTR(style, m, n) +# endif /* GNUC >= 3.1 */ +#endif + + +#endif diff --git a/externals/mysql/my_base.h b/externals/mysql/my_base.h new file mode 100644 index 00000000000..e228b3975d0 --- /dev/null +++ b/externals/mysql/my_base.h @@ -0,0 +1,626 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file includes constants used with all databases */ + +#ifndef _my_base_h +#define _my_base_h + +#ifndef stdin /* Included first in handler */ +#define CHSIZE_USED +#include +#include /* This includes types */ +#include +#include +#include + +#ifndef EOVERFLOW +#define EOVERFLOW 84 +#endif + +#if !defined(USE_MY_FUNC) && !defined(THREAD) +#include /* For faster code, after test */ +#endif /* USE_MY_FUNC */ +#endif /* stdin */ +#include + +/* The following is bits in the flag parameter to ha_open() */ + +#define HA_OPEN_ABORT_IF_LOCKED 0 /* default */ +#define HA_OPEN_WAIT_IF_LOCKED 1 +#define HA_OPEN_IGNORE_IF_LOCKED 2 +#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */ +#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */ +#define HA_OPEN_ABORT_IF_CRASHED 16 +#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */ +#define HA_OPEN_FROM_SQL_LAYER 64 +#define HA_OPEN_MMAP 128 /* open memory mapped */ +#define HA_OPEN_COPY 256 /* Open copy (for repair) */ +/* Internal temp table, used for temporary results */ +#define HA_OPEN_INTERNAL_TABLE 512 + +/* The following is parameter to ha_rkey() how to use key */ + +/* + We define a complete-field prefix of a key value as a prefix where + the last included field in the prefix contains the full field, not + just some bytes from the start of the field. A partial-field prefix + is allowed to contain only a few first bytes from the last included + field. + + Below HA_READ_KEY_EXACT, ..., HA_READ_BEFORE_KEY can take a + complete-field prefix of a key value as the search + key. HA_READ_PREFIX and HA_READ_PREFIX_LAST could also take a + partial-field prefix, but currently (4.0.10) they are only used with + complete-field prefixes. MySQL uses a padding trick to implement + LIKE 'abc%' queries. + + NOTE that in InnoDB HA_READ_PREFIX_LAST will NOT work with a + partial-field prefix because InnoDB currently strips spaces from the + end of varchar fields! +*/ + +enum ha_rkey_function { + HA_READ_KEY_EXACT, /* Find first record else error */ + HA_READ_KEY_OR_NEXT, /* Record or next record */ + HA_READ_KEY_OR_PREV, /* Record or previous */ + HA_READ_AFTER_KEY, /* Find next rec. after key-record */ + HA_READ_BEFORE_KEY, /* Find next rec. before key-record */ + HA_READ_PREFIX, /* Key which as same prefix */ + HA_READ_PREFIX_LAST, /* Last key with the same prefix */ + HA_READ_PREFIX_LAST_OR_PREV, /* Last or prev key with the same prefix */ + HA_READ_MBR_CONTAIN, + HA_READ_MBR_INTERSECT, + HA_READ_MBR_WITHIN, + HA_READ_MBR_DISJOINT, + HA_READ_MBR_EQUAL +}; + + /* Key algorithm types */ + +enum ha_key_alg { + HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */ + HA_KEY_ALG_BTREE= 1, /* B-tree, default one */ + HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */ + HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */ + HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */ +}; + + /* Index and table build methods */ + +enum ha_build_method { + HA_BUILD_DEFAULT, + HA_BUILD_ONLINE, + HA_BUILD_OFFLINE +}; + + /* Storage media types */ + +enum ha_storage_media { + HA_SM_DEFAULT= 0, /* Not specified (engine default) */ + HA_SM_DISK= 1, /* DISK storage */ + HA_SM_MEMORY= 2 /* MAIN MEMORY storage */ +}; + + /* The following is parameter to ha_extra() */ + +enum ha_extra_function { + HA_EXTRA_NORMAL=0, /* Optimize for space (def) */ + HA_EXTRA_QUICK=1, /* Optimize for speed */ + HA_EXTRA_NOT_USED=2, + HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */ + HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */ + HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */ + HA_EXTRA_READCHECK=6, /* Use readcheck (def) */ + HA_EXTRA_KEYREAD=7, /* Read only key to database */ + HA_EXTRA_NO_KEYREAD=8, /* Normal read of records (def) */ + HA_EXTRA_NO_USER_CHANGE=9, /* No user is allowed to write */ + HA_EXTRA_KEY_CACHE=10, + HA_EXTRA_NO_KEY_CACHE=11, + HA_EXTRA_WAIT_LOCK=12, /* Wait until file is avalably (def) */ + HA_EXTRA_NO_WAIT_LOCK=13, /* If file is locked, return quickly */ + HA_EXTRA_WRITE_CACHE=14, /* Use write cache in ha_write() */ + HA_EXTRA_FLUSH_CACHE=15, /* flush write_record_cache */ + HA_EXTRA_NO_KEYS=16, /* Remove all update of keys */ + HA_EXTRA_KEYREAD_CHANGE_POS=17, /* Keyread, but change pos */ + /* xxxxchk -r must be used */ + HA_EXTRA_REMEMBER_POS=18, /* Remember pos for next/prev */ + HA_EXTRA_RESTORE_POS=19, + HA_EXTRA_REINIT_CACHE=20, /* init cache from current record */ + HA_EXTRA_FORCE_REOPEN=21, /* Datafile have changed on disk */ + HA_EXTRA_FLUSH, /* Flush tables to disk */ + HA_EXTRA_NO_ROWS, /* Don't write rows */ + HA_EXTRA_RESET_STATE, /* Reset positions */ + HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/ + HA_EXTRA_NO_IGNORE_DUP_KEY, + HA_EXTRA_PREPARE_FOR_DROP, + HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */ + HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */ + /* + On-the-fly switching between unique and non-unique key inserting. + */ + HA_EXTRA_CHANGE_KEY_TO_UNIQUE, + HA_EXTRA_CHANGE_KEY_TO_DUP, + /* + When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep + other fields intact. When this is off (by default) InnoDB will use memcpy + to overwrite entire row. + */ + HA_EXTRA_KEYREAD_PRESERVE_FIELDS, + HA_EXTRA_MMAP, + /* + Ignore if the a tuple is not found, continue processing the + transaction and ignore that 'row'. Needed for idempotency + handling on the slave + + Currently only used by NDB storage engine. Partition handler ignores flag. + */ + HA_EXTRA_IGNORE_NO_KEY, + HA_EXTRA_NO_IGNORE_NO_KEY, + /* + Mark the table as a log table. For some handlers (e.g. CSV) this results + in a special locking for the table. + */ + HA_EXTRA_MARK_AS_LOG_TABLE, + /* + Informs handler that write_row() which tries to insert new row into the + table and encounters some already existing row with same primary/unique + key can replace old row with new row instead of reporting error (basically + it informs handler that we do REPLACE instead of simple INSERT). + Off by default. + */ + HA_EXTRA_WRITE_CAN_REPLACE, + HA_EXTRA_WRITE_CANNOT_REPLACE, + /* + Inform handler that delete_row()/update_row() cannot batch deletes/updates + and should perform them immediately. This may be needed when table has + AFTER DELETE/UPDATE triggers which access to subject table. + These flags are reset by the handler::extra(HA_EXTRA_RESET) call. + */ + HA_EXTRA_DELETE_CANNOT_BATCH, + HA_EXTRA_UPDATE_CANNOT_BATCH, + /* + Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be + executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY. + */ + HA_EXTRA_INSERT_WITH_UPDATE, + /* Inform handler that we will do a rename */ + HA_EXTRA_PREPARE_FOR_RENAME, + /* + Special actions for MERGE tables. + */ + HA_EXTRA_ADD_CHILDREN_LIST, + HA_EXTRA_ATTACH_CHILDREN, + HA_EXTRA_IS_ATTACHED_CHILDREN, + HA_EXTRA_DETACH_CHILDREN, + HA_EXTRA_ORDERBY_LIMIT, + HA_EXTRA_NO_ORDERBY_LIMIT, + /* Inform handler we will force a close as part of flush */ + HA_EXTRA_PREPARE_FOR_FORCED_CLOSE, + HA_EXTRA_ALLOW_LOG_DELETE +}; + +/* Compatible option, to be deleted in 6.0 */ +#define HA_EXTRA_PREPARE_FOR_DELETE HA_EXTRA_PREPARE_FOR_DROP + + /* The following is parameter to ha_panic() */ + +enum ha_panic_function { + HA_PANIC_CLOSE, /* Close all databases */ + HA_PANIC_WRITE, /* Unlock and write status */ + HA_PANIC_READ /* Lock and read keyinfo */ +}; + + /* The following is parameter to ha_create(); keytypes */ + +enum ha_base_keytype { + HA_KEYTYPE_END=0, + HA_KEYTYPE_TEXT=1, /* Key is sorted as letters */ + HA_KEYTYPE_BINARY=2, /* Key is sorted as unsigned chars */ + HA_KEYTYPE_SHORT_INT=3, + HA_KEYTYPE_LONG_INT=4, + HA_KEYTYPE_FLOAT=5, + HA_KEYTYPE_DOUBLE=6, + HA_KEYTYPE_NUM=7, /* Not packed num with pre-space */ + HA_KEYTYPE_USHORT_INT=8, + HA_KEYTYPE_ULONG_INT=9, + HA_KEYTYPE_LONGLONG=10, + HA_KEYTYPE_ULONGLONG=11, + HA_KEYTYPE_INT24=12, + HA_KEYTYPE_UINT24=13, + HA_KEYTYPE_INT8=14, + /* Varchar (0-255 bytes) with length packed with 1 byte */ + HA_KEYTYPE_VARTEXT1=15, /* Key is sorted as letters */ + HA_KEYTYPE_VARBINARY1=16, /* Key is sorted as unsigned chars */ + /* Varchar (0-65535 bytes) with length packed with 2 bytes */ + HA_KEYTYPE_VARTEXT2=17, /* Key is sorted as letters */ + HA_KEYTYPE_VARBINARY2=18, /* Key is sorted as unsigned chars */ + HA_KEYTYPE_BIT=19 +}; + +#define HA_MAX_KEYTYPE 31 /* Must be log2-1 */ + +/* + These flags kan be OR:ed to key-flag + Note that these can only be up to 16 bits! +*/ + +#define HA_NOSAME 1 /* Set if not dupplicated records */ +#define HA_PACK_KEY 2 /* Pack string key to previous key */ +#define HA_AUTO_KEY 16 +#define HA_BINARY_PACK_KEY 32 /* Packing of all keys to prev key */ +#define HA_FULLTEXT 128 /* For full-text search */ +#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */ +#define HA_SPATIAL 1024 /* For spatial search */ +#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ +#define HA_GENERATED_KEY 8192 /* Automaticly generated key */ +#define HA_RTREE_INDEX 16384 /* For RTREE search */ + + /* The combination of the above can be used for key type comparison. */ +#define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \ + HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ + HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY | \ + HA_RTREE_INDEX) + +#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */ + + /* Automatic bits in key-flag */ + +#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */ +#define HA_VAR_LENGTH_KEY 8 +#define HA_NULL_PART_KEY 64 +#define HA_USES_COMMENT 4096 +#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */ +#define HA_USES_BLOCK_SIZE ((uint) 32768) +#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */ +#if MYSQL_VERSION_ID < 0x50200 +/* + Key has a part that can have end space. If this is an unique key + we have to handle it differently from other unique keys as we can find + many matching rows for one key (because end space are not compared) +*/ +#define HA_END_SPACE_KEY 0 /* was: 4096 */ +#else +#error HA_END_SPACE_KEY is obsolete, please remove it +#endif + + + /* These flags can be added to key-seg-flag */ + +#define HA_SPACE_PACK 1 /* Pack space in key-seg */ +#define HA_PART_KEY_SEG 4 /* Used by MySQL for part-key-cols */ +#define HA_VAR_LENGTH_PART 8 +#define HA_NULL_PART 16 +#define HA_BLOB_PART 32 +#define HA_SWAP_KEY 64 +#define HA_REVERSE_SORT 128 /* Sort key in reverse order */ +#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */ +/* + End space in unique/varchar are considered equal. (Like 'a' and 'a ') + Only needed for internal temporary tables. +*/ +#define HA_END_SPACE_ARE_EQUAL 512 +#define HA_BIT_PART 1024 + + /* optionbits for database */ +#define HA_OPTION_PACK_RECORD 1 +#define HA_OPTION_PACK_KEYS 2 +#define HA_OPTION_COMPRESS_RECORD 4 +#define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */ +#define HA_OPTION_TMP_TABLE 16 +#define HA_OPTION_CHECKSUM 32 +#define HA_OPTION_DELAY_KEY_WRITE 64 +#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */ +#define HA_OPTION_CREATE_FROM_ENGINE 256 +#define HA_OPTION_RELIES_ON_SQL_LAYER 512 +#define HA_OPTION_NULL_FIELDS 1024 +#define HA_OPTION_PAGE_CHECKSUM 2048 +#define HA_OPTION_TEMP_COMPRESS_RECORD (1L << 15) /* set by isamchk */ +#define HA_OPTION_READ_ONLY_DATA (1L << 16) /* Set by isamchk */ +#define HA_OPTION_NO_CHECKSUM (1L << 17) +#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18) + + /* Bits in flag to create() */ + +#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */ +#define HA_PACK_RECORD 2 /* Request packed record format */ +#define HA_CREATE_TMP_TABLE 4 +#define HA_CREATE_CHECKSUM 8 +#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */ +#define HA_CREATE_PAGE_CHECKSUM 32 +#define HA_CREATE_DELAY_KEY_WRITE 64 +#define HA_CREATE_RELIES_ON_SQL_LAYER 128 + +/* + The following flags (OR-ed) are passed to handler::info() method. + The method copies misc handler information out of the storage engine + to data structures accessible from MySQL + + Same flags are also passed down to mi_status, myrg_status, etc. +*/ + +/* this one is not used */ +#define HA_STATUS_POS 1 +/* + assuming the table keeps shared actual copy of the 'info' and + local, possibly outdated copy, the following flag means that + it should not try to get the actual data (locking the shared structure) + slightly outdated version will suffice +*/ +#define HA_STATUS_NO_LOCK 2 +/* update the time of the last modification (in handler::update_time) */ +#define HA_STATUS_TIME 4 +/* + update the 'constant' part of the info: + handler::max_data_file_length, max_index_file_length, create_time + sortkey, ref_length, block_size, data_file_name, index_file_name. + handler::table->s->keys_in_use, keys_for_keyread, rec_per_key +*/ +#define HA_STATUS_CONST 8 +/* + update the 'variable' part of the info: + handler::records, deleted, data_file_length, index_file_length, + delete_length, check_time, mean_rec_length +*/ +#define HA_STATUS_VARIABLE 16 +/* + get the information about the key that caused last duplicate value error + update handler::errkey and handler::dupp_ref + see handler::get_dup_key() +*/ +#define HA_STATUS_ERRKEY 32 +/* + update handler::auto_increment_value +*/ +#define HA_STATUS_AUTO 64 + +/* + Errorcodes given by handler functions + + opt_sum_query() assumes these codes are > 1 + Do not add error numbers before HA_ERR_FIRST. + If necessary to add lower numbers, change HA_ERR_FIRST accordingly. +*/ +#define HA_ERR_FIRST 120 /* Copy of first error nr.*/ + +#define HA_ERR_KEY_NOT_FOUND 120 /* Didn't find key on read or update */ +#define HA_ERR_FOUND_DUPP_KEY 121 /* Dupplicate key on write */ +#define HA_ERR_INTERNAL_ERROR 122 /* Internal error */ +#define HA_ERR_RECORD_CHANGED 123 /* Uppdate with is recoverable */ +#define HA_ERR_WRONG_INDEX 124 /* Wrong index given to function */ +#define HA_ERR_CRASHED 126 /* Indexfile is crashed */ +#define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */ +#define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */ +#define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */ +#define HA_ERR_WRONG_COMMAND 131 /* Command not supported */ +#define HA_ERR_OLD_FILE 132 /* old databasfile */ +#define HA_ERR_NO_ACTIVE_RECORD 133 /* No record read in update() */ +#define HA_ERR_RECORD_DELETED 134 /* A record is not there */ +#define HA_ERR_RECORD_FILE_FULL 135 /* No more room in file */ +#define HA_ERR_INDEX_FILE_FULL 136 /* No more room in file */ +#define HA_ERR_END_OF_FILE 137 /* end in next/prev/first/last */ +#define HA_ERR_UNSUPPORTED 138 /* unsupported extension used */ +#define HA_ERR_TO_BIG_ROW 139 /* Too big row */ +#define HA_WRONG_CREATE_OPTION 140 /* Wrong create option */ +#define HA_ERR_FOUND_DUPP_UNIQUE 141 /* Dupplicate unique on write */ +#define HA_ERR_UNKNOWN_CHARSET 142 /* Can't open charset */ +#define HA_ERR_WRONG_MRG_TABLE_DEF 143 /* conflicting tables in MERGE */ +#define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */ +#define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */ +#define HA_ERR_LOCK_WAIT_TIMEOUT 146 +#define HA_ERR_LOCK_TABLE_FULL 147 +#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */ +#define HA_ERR_LOCK_DEADLOCK 149 +#define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */ +#define HA_ERR_NO_REFERENCED_ROW 151 /* Cannot add a child row */ +#define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */ +#define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */ +#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */ +#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ +#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ +#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ +/* NULLs are not supported in spatial index */ +#define HA_ERR_NULL_IN_SPATIAL 158 +#define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */ +/* There's no partition in table for given value */ +#define HA_ERR_NO_PARTITION_FOUND 160 +#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */ +#define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr */ +/* + Upholding foreign key constraints would lead to a duplicate key error + in some other table. +*/ +#define HA_ERR_FOREIGN_DUPLICATE_KEY 163 +/* The table changed in storage engine */ +#define HA_ERR_TABLE_NEEDS_UPGRADE 164 +#define HA_ERR_TABLE_READONLY 165 /* The table is not writable */ + +#define HA_ERR_AUTOINC_READ_FAILED 166 /* Failed to get next autoinc value */ +#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set row autoinc value */ +#define HA_ERR_GENERIC 168 /* Generic error */ +/* row not actually updated: new values same as the old values */ +#define HA_ERR_RECORD_IS_THE_SAME 169 +/* It is not possible to log this statement */ +#define HA_ERR_LOGGING_IMPOSSIBLE 170 +#define HA_ERR_TABLESPACE_EXIST 171 +/* The event was corrupt, leading to illegal data being read */ +#define HA_ERR_CORRUPT_EVENT 172 +#define HA_ERR_NEW_FILE 173 /* New file format */ +/* The event could not be processed no other handler error happened */ +#define HA_ERR_ROWS_EVENT_APPLY 174 +#define HA_ERR_INITIALIZATION 175 /* Error during initialization */ +#define HA_ERR_FILE_TOO_SHORT 176 /* File too short */ +#define HA_ERR_WRONG_CRC 177 /* Wrong CRC on page */ +#define HA_ERR_LOCK_OR_ACTIVE_TRANSACTION 178 +#define HA_ERR_NO_SUCH_TABLESPACE 179 +#define HA_ERR_TABLESPACE_NOT_EMPTY 180 +#define HA_ERR_TABLESPACE_DATAFILE_EXIST 181 +#define HA_ERR_ROW_NOT_VISIBLE 182 +#define HA_ERR_LAST 182 /* Copy of last error nr */ + +/* Number of different errors */ +#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) + + /* Other constants */ + +#define HA_NAMELEN 64 /* Max length of saved filename */ +#define NO_SUCH_KEY (~(uint)0) /* used as a key no. */ + +typedef ulong key_part_map; +#define HA_WHOLE_KEY (~(key_part_map)0) + + /* Intern constants in databases */ + + /* bits in _search */ +#define SEARCH_FIND 1 +#define SEARCH_NO_FIND 2 +#define SEARCH_SAME 4 +#define SEARCH_BIGGER 8 +#define SEARCH_SMALLER 16 +#define SEARCH_SAVE_BUFF 32 +#define SEARCH_UPDATE 64 +#define SEARCH_PREFIX 128 +#define SEARCH_LAST 256 +#define MBR_CONTAIN 512 +#define MBR_INTERSECT 1024 +#define MBR_WITHIN 2048 +#define MBR_DISJOINT 4096 +#define MBR_EQUAL 8192 +#define MBR_DATA 16384 +#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ +#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ +/* Use this when inserting a key in position order */ +#define SEARCH_INSERT SEARCH_NULL_ARE_NOT_EQUAL*2 +/* Only part of the key is specified while reading */ +#define SEARCH_PART_KEY SEARCH_INSERT*2 +/* Used when user key (key 2) contains transaction id's */ +#define SEARCH_USER_KEY_HAS_TRANSID SEARCH_PART_KEY*2 +/* Used when page key (key 1) contains transaction id's */ +#define SEARCH_PAGE_KEY_HAS_TRANSID SEARCH_USER_KEY_HAS_TRANSID*2 + + /* bits in opt_flag */ +#define QUICK_USED 1 +#define READ_CACHE_USED 2 +#define READ_CHECK_USED 4 +#define KEY_READ_USED 8 +#define WRITE_CACHE_USED 16 +#define OPT_NO_ROWS 32 + + /* bits in update */ +#define HA_STATE_CHANGED 1 /* Database has changed */ +#define HA_STATE_AKTIV 2 /* Has a current record */ +#define HA_STATE_WRITTEN 4 /* Record is written */ +#define HA_STATE_DELETED 8 +#define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */ +#define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */ +#define HA_STATE_NO_KEY 64 /* Last read didn't find record */ +#define HA_STATE_KEY_CHANGED 128 +#define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */ +#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ +#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ +#define HA_STATE_EXTEND_BLOCK 2048 +#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */ + +/* myisampack expects no more than 32 field types. */ +enum en_fieldtype { + FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE, + FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO, + FIELD_VARCHAR,FIELD_CHECK, + FIELD_enum_val_count +}; + +enum data_file_type { + STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD +}; + +/* For key ranges */ + +/* from -inf */ +#define NO_MIN_RANGE 1 + +/* to +inf */ +#define NO_MAX_RANGE 2 + +/* X < key, i.e. not including the left endpoint */ +#define NEAR_MIN 4 + +/* X > key, i.e. not including the right endpoint */ +#define NEAR_MAX 8 + +/* + This flag means that index is a unique index, and the interval is + equivalent to "AND(keypart_i = const_i)", where all of const_i are not NULLs. +*/ +#define UNIQUE_RANGE 16 + +/* + This flag means that the interval is equivalent to + "AND(keypart_i = const_i)", where not all key parts may be used but all of + const_i are not NULLs. +*/ +#define EQ_RANGE 32 + +/* + This flag has the same meaning as UNIQUE_RANGE, except that for at least + one keypart the condition is "keypart IS NULL". +*/ +#define NULL_RANGE 64 + +#define GEOM_FLAG 128 + +#define SKIP_RANGE 256 +#define EMPTY_RANGE 512 + +typedef struct st_key_range +{ + const uchar *key; + uint length; + key_part_map keypart_map; + enum ha_rkey_function flag; +} key_range; + +typedef struct st_key_multi_range +{ + key_range start_key; + key_range end_key; + char *ptr; /* Free to use by caller (ptr to row etc) */ + uint range_flag; /* key range flags see above */ +} KEY_MULTI_RANGE; + + +/* For number of records */ +#ifdef BIG_TABLES +#define rows2double(A) ulonglong2double(A) +typedef my_off_t ha_rows; +#else +#define rows2double(A) (double) (A) +typedef ulong ha_rows; +#endif + +#define HA_POS_ERROR (~ (ha_rows) 0) +#define HA_OFFSET_ERROR (~ (my_off_t) 0) + +#if SYSTEM_SIZEOF_OFF_T == 4 +#define MAX_FILE_SIZE INT_MAX32 +#else +#define MAX_FILE_SIZE LONGLONG_MAX +#endif + +#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) + +/* invalidator function reference for Query Cache */ +typedef void (* invalidator_by_filename)(const char * filename); + +#endif /* _my_base_h */ diff --git a/externals/mysql/my_bit.h b/externals/mysql/my_bit.h new file mode 100644 index 00000000000..2e464e89049 --- /dev/null +++ b/externals/mysql/my_bit.h @@ -0,0 +1,109 @@ +/* + Some useful bit functions +*/ + +C_MODE_START +#ifdef HAVE_INLINE + +extern const char _my_bits_nbits[256]; +extern const uchar _my_bits_reverse_table[256]; + +/* + Find smallest X in 2^X >= value + This can be used to divide a number with value by doing a shift instead +*/ + +STATIC_INLINE uint my_bit_log2(ulong value) +{ + uint bit; + for (bit=0 ; value > 1 ; value>>=1, bit++) ; + return bit; +} + +STATIC_INLINE uint my_count_bits(ulonglong v) +{ +#if SIZEOF_LONG_LONG > 4 + /* The following code is a bit faster on 16 bit machines than if we would + only shift v */ + ulong v2=(ulong) (v >> 32); + return (uint) (uchar) (_my_bits_nbits[(uchar) v] + + _my_bits_nbits[(uchar) (v >> 8)] + + _my_bits_nbits[(uchar) (v >> 16)] + + _my_bits_nbits[(uchar) (v >> 24)] + + _my_bits_nbits[(uchar) (v2)] + + _my_bits_nbits[(uchar) (v2 >> 8)] + + _my_bits_nbits[(uchar) (v2 >> 16)] + + _my_bits_nbits[(uchar) (v2 >> 24)]); +#else + return (uint) (uchar) (_my_bits_nbits[(uchar) v] + + _my_bits_nbits[(uchar) (v >> 8)] + + _my_bits_nbits[(uchar) (v >> 16)] + + _my_bits_nbits[(uchar) (v >> 24)]); +#endif +} + +STATIC_INLINE uint my_count_bits_ushort(ushort v) +{ + return _my_bits_nbits[v]; +} + + +/* + Next highest power of two + + SYNOPSIS + my_round_up_to_next_power() + v Value to check + + RETURN + Next or equal power of 2 + Note: 0 will return 0 + + NOTES + Algorithm by Sean Anderson, according to: + http://graphics.stanford.edu/~seander/bithacks.html + (Orignal code public domain) + + Comments shows how this works with 01100000000000000000000000001011 +*/ + +STATIC_INLINE uint32 my_round_up_to_next_power(uint32 v) +{ + v--; /* 01100000000000000000000000001010 */ + v|= v >> 1; /* 01110000000000000000000000001111 */ + v|= v >> 2; /* 01111100000000000000000000001111 */ + v|= v >> 4; /* 01111111110000000000000000001111 */ + v|= v >> 8; /* 01111111111111111100000000001111 */ + v|= v >> 16; /* 01111111111111111111111111111111 */ + return v+1; /* 10000000000000000000000000000000 */ +} + +STATIC_INLINE uint32 my_clear_highest_bit(uint32 v) +{ + uint32 w=v >> 1; + w|= w >> 1; + w|= w >> 2; + w|= w >> 4; + w|= w >> 8; + w|= w >> 16; + return v & w; +} + +STATIC_INLINE uint32 my_reverse_bits(uint32 key) +{ + return + (_my_bits_reverse_table[ key & 255] << 24) | + (_my_bits_reverse_table[(key>> 8) & 255] << 16) | + (_my_bits_reverse_table[(key>>16) & 255] << 8) | + _my_bits_reverse_table[(key>>24) ]; +} + +#else /* HAVE_INLINE */ +extern uint my_bit_log2(ulong value); +extern uint32 my_round_up_to_next_power(uint32 v); +uint32 my_clear_highest_bit(uint32 v); +uint32 my_reverse_bits(uint32 key); +extern uint my_count_bits(ulonglong v); +extern uint my_count_bits_ushort(ushort v); +#endif /* HAVE_INLINE */ +C_MODE_END diff --git a/externals/mysql/my_bitmap.h b/externals/mysql/my_bitmap.h new file mode 100644 index 00000000000..d8c9a0c2b69 --- /dev/null +++ b/externals/mysql/my_bitmap.h @@ -0,0 +1,182 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _my_bitmap_h_ +#define _my_bitmap_h_ + +#define MY_BIT_NONE (~(uint) 0) + +#include + +typedef uint32 my_bitmap_map; + +typedef struct st_bitmap +{ + my_bitmap_map *bitmap; + uint n_bits; /* number of bits occupied by the above */ + my_bitmap_map last_word_mask; + my_bitmap_map *last_word_ptr; + /* + mutex will be acquired for the duration of each bitmap operation if + thread_safe flag in bitmap_init was set. Otherwise, we optimize by not + acquiring the mutex + */ +#ifdef THREAD + pthread_mutex_t *mutex; +#endif +} MY_BITMAP; + +#ifdef __cplusplus +extern "C" { +#endif +extern void create_last_word_mask(MY_BITMAP *map); +extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, + my_bool thread_safe); +extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); +extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); +extern my_bool bitmap_is_set_all(const MY_BITMAP *map); +extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2); +extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1, + const MY_BITMAP *map2); +extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); +extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern uint bitmap_set_next(MY_BITMAP *map); +extern uint bitmap_get_first(const MY_BITMAP *map); +extern uint bitmap_get_first_set(const MY_BITMAP *map); +extern uint bitmap_bits_set(const MY_BITMAP *map); +extern void bitmap_free(MY_BITMAP *map); +extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit); +extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size); +extern void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_invert(MY_BITMAP *map); +extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2); + +extern uint bitmap_lock_set_next(MY_BITMAP *map); +extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit); +#ifdef NOT_USED +extern uint bitmap_lock_bits_set(const MY_BITMAP *map); +extern my_bool bitmap_lock_is_set_all(const MY_BITMAP *map); +extern uint bitmap_lock_get_first(const MY_BITMAP *map); +extern uint bitmap_lock_get_first_set(const MY_BITMAP *map); +extern my_bool bitmap_lock_is_subset(const MY_BITMAP *map1, + const MY_BITMAP *map2); +extern my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size); +extern my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit); +extern my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map); +extern my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2); +extern void bitmap_lock_set_all(MY_BITMAP *map); +extern void bitmap_lock_clear_all(MY_BITMAP *map); +extern void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit); +extern void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit); +extern void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size); +extern void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_lock_xor(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_lock_invert(MY_BITMAP *map); +#endif +/* Fast, not thread safe, bitmap functions */ +#define bitmap_buffer_size(bits) (((bits)+31)/32)*4 +#define no_bytes_in_map(map) (((map)->n_bits + 7)/8) +#define no_words_in_map(map) (((map)->n_bits + 31)/32) +#define bytes_word_aligned(bytes) (4*((bytes + 3)/4)) +#define _bitmap_set_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ + |= (1 << ((BIT) & 7))) +#define _bitmap_flip_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ + ^= (1 << ((BIT) & 7))) +#define _bitmap_clear_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ + &= ~ (1 << ((BIT) & 7))) +#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ + & (1 << ((BIT) & 7))) +/* + WARNING! + + The below symbols are inline functions in DEBUG builds and macros in + non-DEBUG builds. The latter evaluate their 'bit' argument twice. + + NEVER use an increment/decrement operator with the 'bit' argument. + It would work with DEBUG builds, but fails later in production builds! + + FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index); +*/ +#ifndef DBUG_OFF +static inline void +bitmap_set_bit(MY_BITMAP *map,uint bit) +{ + DBUG_ASSERT(bit < (map)->n_bits); + _bitmap_set_bit(map,bit); +} +static inline void +bitmap_flip_bit(MY_BITMAP *map,uint bit) +{ + DBUG_ASSERT(bit < (map)->n_bits); + _bitmap_flip_bit(map,bit); +} +static inline void +bitmap_clear_bit(MY_BITMAP *map,uint bit) +{ + DBUG_ASSERT(bit < (map)->n_bits); + _bitmap_clear_bit(map,bit); +} +static inline uint +bitmap_is_set(const MY_BITMAP *map,uint bit) +{ + DBUG_ASSERT(bit < (map)->n_bits); + return _bitmap_is_set(map,bit); +} +#else +#define bitmap_set_bit(MAP, BIT) _bitmap_set_bit(MAP, BIT) +#define bitmap_flip_bit(MAP, BIT) _bitmap_flip_bit(MAP, BIT) +#define bitmap_clear_bit(MAP, BIT) _bitmap_clear_bit(MAP, BIT) +#define bitmap_is_set(MAP, BIT) _bitmap_is_set(MAP, BIT) +#endif + +static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) +{ + *(map1)->last_word_ptr|= (map1)->last_word_mask; + *(map2)->last_word_ptr|= (map2)->last_word_mask; + return memcmp((map1)->bitmap, (map2)->bitmap, 4*no_words_in_map((map1)))==0; +} + +#define bitmap_clear_all(MAP) \ + { memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); } +#define bitmap_set_all(MAP) \ + (memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP)))) + +/** + check, set and clear a bit of interest of an integer. + + If the bit is out of range @retval -1. Otherwise + bit_is_set @return 0 or 1 reflecting the bit is set or not; + bit_do_set @return 1 (bit is set 1) + bit_do_clear @return 0 (bit is cleared to 0) +*/ + +#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \ + (((I) & (1ULL << (B))) == 0 ? 0 : 1) : -1) +#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \ + ((I) |= (1ULL << (B)), 1) : -1) +#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \ + ((I) &= ~(1ULL << (B)), 0) : -1) + +#ifdef __cplusplus +} +#endif + +#endif /* _my_bitmap_h_ */ diff --git a/externals/mysql/my_charsets.h b/externals/mysql/my_charsets.h new file mode 100644 index 00000000000..ecb0de94f75 --- /dev/null +++ b/externals/mysql/my_charsets.h @@ -0,0 +1,57 @@ +/* Copyright (C) 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Character set configuration (hard-coded) */ +#define HAVE_CHARSET_armscii8 1 +#define HAVE_CHARSET_ascii 1 +#define HAVE_CHARSET_big5 1 +#define HAVE_CHARSET_cp1250 1 +#define HAVE_CHARSET_cp1251 1 +#define HAVE_CHARSET_cp1256 1 +#define HAVE_CHARSET_cp1257 1 +#define HAVE_CHARSET_cp850 1 +#define HAVE_CHARSET_cp852 1 +#define HAVE_CHARSET_cp866 1 +#define HAVE_CHARSET_cp932 1 +#define HAVE_CHARSET_dec8 1 +#define HAVE_CHARSET_eucjpms 1 +#define HAVE_CHARSET_euckr 1 +#define HAVE_CHARSET_gb2312 1 +#define HAVE_CHARSET_gbk 1 +#define HAVE_CHARSET_greek 1 +#define HAVE_CHARSET_hebrew 1 +#define HAVE_CHARSET_hp8 1 +#define HAVE_CHARSET_keybcs2 1 +#define HAVE_CHARSET_koi8r 1 +#define HAVE_CHARSET_koi8u 1 +#define HAVE_CHARSET_latin1 1 +#define HAVE_CHARSET_latin2 1 +#define HAVE_CHARSET_latin5 1 +#define HAVE_CHARSET_latin7 1 +#define HAVE_CHARSET_macce 1 +#define HAVE_CHARSET_macroman 1 +#define HAVE_CHARSET_sjis 1 +#define HAVE_CHARSET_swe7 1 +#define HAVE_CHARSET_tis620 1 +#define HAVE_CHARSET_ucs2 1 +#define HAVE_CHARSET_ujis 1 +#define HAVE_CHARSET_utf16 1 +#define HAVE_CHARSET_utf32 1 +#define HAVE_CHARSET_utf8mb3 1 +#define HAVE_CHARSET_utf8mb4 1 +#define HAVE_UCA_COLLATIONS 1 +#define MYSQL_DEFAULT_CHARSET_NAME "latin1" +#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" +#define USE_MB 1 diff --git a/externals/mysql/my_config.h b/externals/mysql/my_config.h new file mode 100644 index 00000000000..adea8dbe8ea --- /dev/null +++ b/externals/mysql/my_config.h @@ -0,0 +1,295 @@ + +/* Headers we may want to use. */ +/* #undef HAVE_ALLOCA_H */ +/* #undef HAVE_ARPA_INET_H */ +/* #undef HAVE_CRYPT_H */ +/* #undef HAVE_DIRENT_H */ +/* #undef HAVE_EXECINFO_H */ +#define HAVE_FCNTL_H 1 +/* #undef HAVE_FENV_H */ +#define HAVE_FLOAT_H 1 +/* #undef HAVE_FPU_CONTROL_H */ +/* #undef HAVE_GRP_H */ +/* #undef HAVE_IEEEFP_H */ +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +/* #undef HAVE_NETINET_IN_H */ +/* #undef HAVE_PATHS_H */ +/* #undef HAVE_PWD_H */ +/* #undef HAVE_SCHED_H */ +/* #undef HAVE_SELECT_H */ +#define HAVE_STDDEF_H 1 +#define HAVE_STDLIB_H 1 +/* #undef HAVE_STRINGS_H */ +#define HAVE_STRING_H 1 +/* #undef HAVE_SYNCH_H */ +/* #undef HAVE_SYSENT_H */ +/* #undef HAVE_SYS_FPU_H */ +/* #undef HAVE_SYS_IOCTL_H */ +/* #undef HAVE_SYS_IPC_H */ +/* #undef HAVE_SYS_MMAN_H */ +/* #undef HAVE_SYS_PRCTL_H */ +/* #undef HAVE_SYS_SELECT_H */ +/* #undef HAVE_SYS_SHM_H */ +/* #undef HAVE_SYS_SOCKET_H */ +#define HAVE_SYS_STAT_H 1 +/* #undef HAVE_SYS_STREAM_H */ +#define HAVE_SYS_TIMEB_H 1 +#define HAVE_SYS_TYPES_H 1 +/* #undef HAVE_SYS_UN_H */ +/* #undef HAVE_TERMIOS_H */ +/* #undef HAVE_TERMIO_H */ +/* #undef HAVE_UNISTD_H */ +/* #undef HAVE_UTIME_H */ + +/* Functions we may want to use. */ +#define HAVE_ACCESS 1 +/* #undef HAVE_AIOWAIT */ +/* #undef HAVE_ALARM */ +/* #undef HAVE_ALLOCA */ +/* #undef HAVE_BCMP */ +/* #undef HAVE_BFILL */ +/* #undef HAVE_BMOVE */ +/* #undef HAVE_BZERO */ +/* #undef HAVE_CLOCK_GETTIME */ +/* #undef HAVE_COMPRESS */ +/* #undef HAVE_CRYPT */ +/* #undef HAVE_DLERROR */ +/* #undef HAVE_DLOPEN */ +/* #undef HAVE_FCHMOD */ +/* #undef HAVE_FCNTL */ +/* #undef HAVE_FCONVERT */ +/* #undef HAVE_FDATASYNC */ +/* #undef HAVE_FESETROUND */ +/* #undef HAVE_FINITE */ +/* #undef HAVE_FP_EXCEPT */ +/* #undef HAVE_FSEEKO */ +/* #undef HAVE_FSYNC */ +/* #undef HAVE_GETADDRINFO */ +#define HAVE_GETCWD 1 +/* #undef HAVE_GETHOSTBYADDR_R */ +/* #undef HAVE_GETHOSTBYNAME_R */ +/* #undef HAVE_GETHRTIME */ +/* #undef HAVE_GETNAMEINFO */ +/* #undef HAVE_GETPAGESIZE */ +/* #undef HAVE_GETPASS */ +/* #undef HAVE_GETPASSPHRASE */ +/* #undef HAVE_GETPWNAM */ +/* #undef HAVE_GETPWUID */ +/* #undef HAVE_GETRLIMIT */ +/* #undef HAVE_GETRUSAGE */ +/* #undef HAVE_GETWD */ +/* #undef HAVE_GMTIME_R */ +/* #undef HAVE_INITGROUPS */ +/* #undef HAVE_ISNAN */ +#define HAVE_LDIV 1 +/* #undef HAVE_LOCALTIME_R */ +/* #undef HAVE_LOG2 */ +#define HAVE_LONGJMP 1 +/* #undef HAVE_LSTAT */ +/* #undef HAVE_MADVISE */ +/* #undef HAVE_DECL_MADVISE */ +/* #undef HAVE_MALLINFO */ +#define HAVE_MEMCPY 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMMOVE 1 +/* #undef HAVE_MKSTEMP */ +/* #undef HAVE_MLOCK */ +/* #undef HAVE_MLOCKALL */ +/* #undef HAVE_MMAP */ +/* #undef HAVE_MMAP64 */ +#define HAVE_PERROR 1 +/* #undef HAVE_POLL */ +/* #undef HAVE_PREAD */ +/* #undef HAVE_PTHREAD_ATTR_CREATE */ +/* #undef HAVE_PTHREAD_ATTR_GETSTACKSIZE */ +/* #undef HAVE_PTHREAD_ATTR_SETPRIO */ +/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ +/* #undef HAVE_PTHREAD_ATTR_SETSCOPE */ +/* #undef HAVE_PTHREAD_ATTR_SETSTACKSIZE */ +/* #undef HAVE_PTHREAD_CONDATTR_CREATE */ +/* #undef HAVE_PTHREAD_INIT */ +/* #undef HAVE_PTHREAD_KEY_DELETE */ +/* #undef HAVE_PTHREAD_KEY_DELETE */ +/* #undef HAVE_PTHREAD_KILL */ +/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */ +/* #undef HAVE_PTHREAD_SETPRIO_NP */ +/* #undef HAVE_PTHREAD_SETSCHEDPARAM */ +/* #undef HAVE_PTHREAD_SIGMASK */ +/* #undef HAVE_PTHREAD_THREADMASK */ +/* #undef HAVE_PTHREAD_YIELD_NP */ +/* #undef HAVE_READDIR_R */ +/* #undef HAVE_READLINK */ +/* #undef HAVE_REALPATH */ +#define HAVE_RENAME 1 +/* #undef HAVE_RINT */ +/* #undef HAVE_SCHED_YIELD */ +/* #undef HAVE_SELECT */ +/* #undef HAVE_SETFD */ +/* #undef HAVE_SETFILEPOINTER */ +/* #undef HAVE_SIGACTION */ +/* #undef HAVE_SIGTHREADMASK */ +/* #undef HAVE_SIGWAIT */ +/* #undef HAVE_SLEEP */ +/* #undef HAVE_SNPRINTF */ +/* #undef HAVE_STPCPY */ +#define HAVE_STRERROR 1 +/* #undef HAVE_STRLCPY */ +#define HAVE_STRNLEN 1 +#define HAVE_STRPBRK 1 +/* #undef HAVE_STRSEP */ +#define HAVE_STRSTR 1 +/* #undef HAVE_STRTOK_R */ +/* #undef HAVE_STRTOK_R */ +#define HAVE_STRTOL 1 +/* #undef HAVE_STRTOLL */ +#define HAVE_STRTOUL 1 +/* #undef HAVE_STRTOULL */ +#define HAVE_TELL 1 +/* #undef HAVE_THR_SETCONCURRENCY */ +/* #undef HAVE_THR_YIELD */ +/* #undef HAVE_VASPRINTF */ +#define HAVE_VSNPRINTF 1 + +/* Symbols we may use */ +/* #undef HAVE_SYS_ERRLIST */ +/* used by stacktrace functions */ +/* #undef HAVE_BSS_START */ + +/* Does "struct timespec" have a "sec" and "nsec" field? */ +/* #undef HAVE_TIMESPEC_TS_SEC */ + +/* Types we may use */ +#define SIZEOF_CHAR 1 +#if SIZEOF_CHAR +# define HAVE_CHAR 1 +#endif + +#define SIZEOF_CHARP 4 +#if SIZEOF_CHARP +# define HAVE_CHARP 1 +#endif + +#define SIZEOF_SHORT 2 +#if SIZEOF_SHORT +# define HAVE_SHORT 1 +#endif + +#define SIZEOF_INT 4 +#if SIZEOF_INT +# define HAVE_INT 1 +#endif + +#define SIZEOF_LONG 4 +#if SIZEOF_LONG +# define HAVE_LONG 1 +#endif + +#define SIZEOF_LONG_LONG 8 +#if SIZEOF_LONG_LONG +# define HAVE_LONG_LONG 1 +#endif + +#define SIZEOF_OFF_T 4 +#if SIZEOF_OFF_T +# define HAVE_OFF_T 1 +#endif + +/* #undef SIZEOF_SIGSET_T */ +#if SIZEOF_SIGSET_T +# define HAVE_SIGSET_T 1 +#endif + +#define SIZEOF_SIZE_T 4 +#if SIZEOF_SIZE_T +# define HAVE_SIZE_T 1 +#endif + +/* #undef SIZEOF_UCHAR */ +#if SIZEOF_UCHAR +# define HAVE_UCHAR 1 +#endif + +/* #undef SIZEOF_UINT */ +#if SIZEOF_UINT +# define HAVE_UINT 1 +#endif + +/* #undef SIZEOF_ULONG */ +#if SIZEOF_ULONG +# define HAVE_ULONG 1 +#endif + +/* #undef SIZEOF_INT8 */ +#if SIZEOF_INT8 +# define HAVE_INT8 1 +#endif +/* #undef SIZEOF_UINT8 */ +#if SIZEOF_UINT8 +# define HAVE_UINT8 1 +#endif + +/* #undef SIZEOF_INT16 */ +#if SIZEOF_INT16 +# define HAVE_INT16 1 +#endif +/* #undef SIZEOF_UINT16 */ +#if SIZEOF_UINT16 +# define HAVE_UINT16 1 +#endif + +/* #undef SIZEOF_INT32 */ +#if SIZEOF_INT32 +# define HAVE_INT32 1 +#endif +/* #undef SIZEOF_UINT32 */ +#if SIZEOF_UINT32 +# define HAVE_UINT32 1 +#endif +/* #undef SIZEOF_U_INT32_T */ +#if SIZEOF_U_INT32_T +# define HAVE_U_INT32_T 1 +#endif + +/* #undef SIZEOF_INT64 */ +#if SIZEOF_INT64 +# define HAVE_INT64 1 +#endif +/* #undef SIZEOF_UINT64 */ +#if SIZEOF_UINT64 +# define HAVE_UINT64 1 +#endif + +/* #undef SIZEOF_SOCKLEN_T */ +#if SIZEOF_SOCKLEN_T +# define HAVE_SOCKLEN_T 1 +#endif + +/* XXX mysql_client_test uses this -- rip it out, please! */ +#define MAX_INDEXES 64 + +#define QSORT_TYPE_IS_VOID 1 +#define RETQSORTTYPE void + +#define SIGNAL_RETURN_TYPE_IS_VOID 1 +#define RETSIGTYPE void + +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler calls + it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +# define inline +#endif + +#define TIME_WITH_SYS_TIME 1 + +#define STACK_DIRECTION -1 + +#define SHAREDIR "share" +#define THREAD 1 +#define THREAD_SAFE_CLIENT 1 + +#define DEFAULT_CHARSET_HOME "C:/mysql/" diff --git a/externals/mysql/my_dbug.h b/externals/mysql/my_dbug.h new file mode 100644 index 00000000000..c4a2f881e4b --- /dev/null +++ b/externals/mysql/my_dbug.h @@ -0,0 +1,140 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _dbug_h +#define _dbug_h + +#ifdef __cplusplus +extern "C" { +#endif +#if !defined(DBUG_OFF) && !defined(_lint) + +struct _db_stack_frame_ { + const char *func; /* function name of the previous stack frame */ + const char *file; /* filename of the function of previous frame */ + uint level; /* this nesting level, highest bit enables tracing */ + struct _db_stack_frame_ *prev; /* pointer to the previous frame */ +}; + +struct _db_code_state_; +extern my_bool _dbug_on_; +extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int); +extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len); +extern int _db_explain_init_(char *buf, size_t len); +extern int _db_is_pushed_(void); +extern void _db_setjmp_(void); +extern void _db_longjmp_(void); +extern void _db_process_(const char *name); +extern void _db_push_(const char *control); +extern void _db_pop_(void); +extern void _db_set_(const char *control); +extern void _db_set_init_(const char *control); +extern void _db_enter_(const char *_func_, const char *_file_, uint _line_, + struct _db_stack_frame_ *_stack_frame_); +extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_); +extern void _db_pargs_(uint _line_,const char *keyword); +extern void _db_doprnt_ _VARARGS((const char *format,...)) + ATTRIBUTE_FORMAT(printf, 1, 2); +extern void _db_dump_(uint _line_,const char *keyword, + const unsigned char *memory, size_t length); +extern void _db_end_(void); +extern void _db_lock_file_(void); +extern void _db_unlock_file_(void); +extern FILE *_db_fp_(void); +extern void _db_flush_(); + +#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \ + _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_) +#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_) +#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0) +#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0) +#define DBUG_EXECUTE(keyword,a1) \ + do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0) +#define DBUG_EXECUTE_IF(keyword,a1) \ + do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0) +#define DBUG_EVALUATE(keyword,a1,a2) \ + (_db_keyword_(0,(keyword), 0) ? (a1) : (a2)) +#define DBUG_EVALUATE_IF(keyword,a1,a2) \ + (_db_keyword_(0,(keyword), 1) ? (a1) : (a2)) +#define DBUG_PRINT(keyword,arglist) \ + do {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;} while(0) +#define DBUG_PUSH(a1) _db_push_ (a1) +#define DBUG_POP() _db_pop_ () +#define DBUG_SET(a1) _db_set_ (a1) +#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1) +#define DBUG_PROCESS(a1) _db_process_(a1) +#define DBUG_FILE _db_fp_() +#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) +#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) +#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2) +#define DBUG_END() _db_end_ () +#define DBUG_LOCK_FILE _db_lock_file_() +#define DBUG_UNLOCK_FILE _db_unlock_file_() +#define DBUG_ASSERT(A) assert(A) +#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len)) +#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len)) +#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0) +#define DEBUGGER_ON do { _dbug_on_= 1; } while(0) +#define IF_DBUG(A) A +#ifndef __WIN__ +#define DBUG_ABORT() (_db_flush_(), abort()) +#else +/* + Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can + call abort() instead of _exit(3) (now it would cause a "test signal" popup). +*/ +#include +#define DBUG_ABORT() (_db_flush_(),\ + (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\ + (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\ + _exit(3)) +#endif + +#else /* No debugger */ + +#define DBUG_ENTER(a1) +#define DBUG_LEAVE +#define DBUG_RETURN(a1) do { return(a1); } while(0) +#define DBUG_VOID_RETURN do { return; } while(0) +#define DBUG_EXECUTE(keyword,a1) do { } while(0) +#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0) +#define DBUG_EVALUATE(keyword,a1,a2) (a2) +#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2) +#define DBUG_PRINT(keyword,arglist) do { } while(0) +#define DBUG_PUSH(a1) do { } while(0) +#define DBUG_SET(a1) do { } while(0) +#define DBUG_SET_INITIAL(a1) do { } while(0) +#define DBUG_POP() do { } while(0) +#define DBUG_PROCESS(a1) do { } while(0) +#define DBUG_SETJMP(a1) setjmp(a1) +#define DBUG_LONGJMP(a1) longjmp(a1) +#define DBUG_DUMP(keyword,a1,a2) do { } while(0) +#define DBUG_END() do { } while(0) +#define DBUG_ASSERT(A) do { } while(0) +#define DBUG_LOCK_FILE do { } while(0) +#define DBUG_FILE (stderr) +#define DBUG_UNLOCK_FILE do { } while(0) +#define DBUG_EXPLAIN(buf,len) +#define DBUG_EXPLAIN_INITIAL(buf,len) +#define DEBUGGER_OFF do { } while(0) +#define DEBUGGER_ON do { } while(0) +#define IF_DBUG(A) +#define DBUG_ABORT() abort() + +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/externals/mysql/my_dir.h b/externals/mysql/my_dir.h new file mode 100644 index 00000000000..90d708ac811 --- /dev/null +++ b/externals/mysql/my_dir.h @@ -0,0 +1,109 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _my_dir_h +#define _my_dir_h +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef MY_DIR_H +#define MY_DIR_H + +#include + + /* Defines for my_dir and my_stat */ + +#define MY_S_IFMT S_IFMT /* type of file */ +#define MY_S_IFDIR S_IFDIR /* directory */ +#define MY_S_IFCHR S_IFCHR /* character special */ +#define MY_S_IFBLK S_IFBLK /* block special */ +#define MY_S_IFREG S_IFREG /* regular */ +#define MY_S_IFIFO S_IFIFO /* fifo */ +#define MY_S_ISUID S_ISUID /* set user id on execution */ +#define MY_S_ISGID S_ISGID /* set group id on execution */ +#define MY_S_ISVTX S_ISVTX /* save swapped text even after use */ +#define MY_S_IREAD S_IREAD /* read permission, owner */ +#define MY_S_IWRITE S_IWRITE /* write permission, owner */ +#define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */ + +#define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR) +#define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR) +#define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK) +#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG) +#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO) + +#define MY_DONT_SORT 512 /* my_lib; Don't sort files */ +#define MY_WANT_STAT 1024 /* my_lib; stat files */ + + /* typedefs for my_dir & my_stat */ + +#ifdef USE_MY_STAT_STRUCT + +typedef struct my_stat +{ + dev_t st_dev; /* major & minor device numbers */ + ino_t st_ino; /* inode number */ + ushort st_mode; /* file permissons (& suid sgid .. bits) */ + short st_nlink; /* number of links to file */ + ushort st_uid; /* user id */ + ushort st_gid; /* group id */ + dev_t st_rdev; /* more major & minor device numbers (???) */ + off_t st_size; /* size of file */ + time_t st_atime; /* time for last read */ + time_t st_mtime; /* time for last contens modify */ + time_t st_ctime; /* time for last inode or contents modify */ +} MY_STAT; + +#else + +#if(_MSC_VER) +#define MY_STAT struct _stati64 /* 64 bit file size */ +#else +#define MY_STAT struct stat /* Orginal struct have what we need */ +#endif + +#endif /* USE_MY_STAT_STRUCT */ + +/* Struct describing one file returned from my_dir */ +typedef struct fileinfo +{ + char *name; + MY_STAT *mystat; +} FILEINFO; + +typedef struct st_my_dir /* Struct returned from my_dir */ +{ + /* + These members are just copies of parts of DYNAMIC_ARRAY structure, + which is allocated right after the end of MY_DIR structure (MEM_ROOT + for storing names is also resides there). We've left them here because + we don't want to change code that uses my_dir. + */ + struct fileinfo *dir_entry; + uint number_off_files; +} MY_DIR; + +extern MY_DIR *my_dir(const char *path,myf MyFlags); +extern void my_dirend(MY_DIR *buffer); +extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags); +extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags); + +#endif /* MY_DIR_H */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/dep/include/mysql/my_getopt.h b/externals/mysql/my_getopt.h similarity index 76% rename from dep/include/mysql/my_getopt.h rename to externals/mysql/my_getopt.h index d5b6ae9e3fe..7cbad607aac 100644 --- a/dep/include/mysql/my_getopt.h +++ b/externals/mysql/my_getopt.h @@ -29,20 +29,25 @@ C_MODE_START #define GET_STR 9 #define GET_STR_ALLOC 10 #define GET_DISABLED 11 +#define GET_ENUM 12 +#define GET_SET 13 +#define GET_DOUBLE 14 #define GET_ASK_ADDR 128 #define GET_TYPE_MASK 127 enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG }; +struct st_typelib; + struct my_option { const char *name; /* Name of the option */ int id; /* unique id or short option */ const char *comment; /* option comment, for autom. --help */ - gptr *value; /* The variable value */ - gptr *u_max_value; /* The user def. max variable value */ - const char **str_values; /* Pointer to possible values */ + uchar **value; /* The variable value */ + uchar **u_max_value; /* The user def. max variable value */ + struct st_typelib *typelib; /* Pointer to possible values */ ulong var_type; enum get_opt_arg_type arg_type; longlong def_value; /* Default value */ @@ -50,7 +55,7 @@ struct my_option longlong max_value; /* Max allowed value */ longlong sub_size; /* Subtract this from given value */ long block_size; /* Value should be a mult. of this */ - int app_type; /* To be used by an application */ + void *app_type; /* To be used by an application */ }; typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * ); @@ -58,21 +63,24 @@ typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... extern char *disabled_my_option; extern my_bool my_getopt_print_errors; +extern my_bool my_getopt_skip_unknown; extern my_error_reporter my_getopt_error_reporter; extern int handle_options (int *argc, char ***argv, const struct my_option *longopts, my_get_one_option); +extern void my_cleanup_options(const struct my_option *options); extern void my_print_help(const struct my_option *options); extern void my_print_variables(const struct my_option *options); -extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint, - const struct my_option *)); +extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint, + const struct my_option *, int *)); ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, - bool *fixed); + my_bool *fix); +longlong getopt_ll_limit_value(longlong, const struct my_option *, + my_bool *fix); my_bool getopt_compare_strings(const char *s, const char *t, uint length); C_MODE_END #endif /* _my_getopt_h */ - diff --git a/dep/include/mysql/my_global.h b/externals/mysql/my_global.h similarity index 62% rename from dep/include/mysql/my_global.h rename to externals/mysql/my_global.h index 02bbd30e34a..131507c0bc5 100644 --- a/dep/include/mysql/my_global.h +++ b/externals/mysql/my_global.h @@ -18,17 +18,16 @@ #ifndef _global_h #define _global_h -#ifndef EMBEDDED_LIBRARY -#define HAVE_REPLICATION -#define HAVE_EXTERNAL_CLIENT -#endif +/* + InnoDB depends on some MySQL internals which other plugins should not + need. This is because of InnoDB's foreign key support, "safe" binlog + truncation, and other similar legacy features. -#if defined( __EMX__) && !defined( MYSQL_SERVER) -/* moved here to use below VOID macro redefinition */ -#define INCL_BASE -#define INCL_NOPMAPI -#include -#endif /* __EMX__ */ + We define accessors for these internals unconditionally, but do not + expose them in mysql/plugin.h. They are declared in ha_innodb.h for + InnoDB's use. +*/ +#define INNODB_COMPATIBILITY_HOOKS #ifdef __CYGWIN__ /* We use a Unix API, so pretend it's not Windows */ @@ -64,21 +63,15 @@ #ifdef __cplusplus #define C_MODE_START extern "C" { #define C_MODE_END } +#define STATIC_CAST(TYPE) static_cast #else #define C_MODE_START #define C_MODE_END +#define STATIC_CAST(TYPE) (TYPE) #endif #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #include -#elif defined(OS2) -#include -#elif defined(__NETWARE__) -#include -#include -#if defined(__cplusplus) && defined(inline) -#undef inline /* fix configure problem */ -#endif #else #include #if defined(__cplusplus) && defined(inline) @@ -86,13 +79,25 @@ #endif #endif /* _WIN32... */ -/* Make it easier to add conditionl code for windows */ +#include + +/* Make it easier to add conditional code for windows */ #ifdef __WIN__ #define IF_WIN(A,B) (A) #else #define IF_WIN(A,B) (B) #endif +#ifndef EMBEDDED_LIBRARY +#ifdef WITH_NDB_BINLOG +#define HAVE_NDB_BINLOG 1 +#endif +#endif /* !EMBEDDED_LIBRARY */ + +#ifndef EMBEDDED_LIBRARY +#define HAVE_REPLICATION +#define HAVE_EXTERNAL_CLIENT +#endif /* Some defines to avoid ifdefs in the code */ #ifndef NETWARE_YIELD @@ -149,8 +154,114 @@ #define __builtin_expect(x, expected_value) (x) #endif -#define likely(x) __builtin_expect((x),1) -#define unlikely(x) __builtin_expect((x),0) +/** + The semantics of builtin_expect() are that + 1) its two arguments are long + 2) it's likely that they are == + Those of our likely(x) are that x can be bool/int/longlong/pointer. +*/ +#define likely(x) __builtin_expect(((x) != 0),1) +#define unlikely(x) __builtin_expect(((x) != 0),0) + +/* + The macros below are useful in optimising places where it has been + discovered that cache misses stall the process and where a prefetch + of the cache line can improve matters. This is available in GCC 3.1.1 + and later versions. + PREFETCH_READ says that addr is going to be used for reading and that + it is to be kept in caches if possible for a while + PREFETCH_WRITE also says that the item to be cached is likely to be + updated. + The *LOCALITY scripts are also available for experimentation purposes + mostly and should only be used if they are verified to improve matters. + For more input see GCC manual (available in GCC 3.1.1 and later) +*/ + +#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10) +#define PREFETCH_READ(addr) __builtin_prefetch(addr, 0, 3) +#define PREFETCH_WRITE(addr) \ + __builtin_prefetch(addr, 1, 3) +#define PREFETCH_READ_LOCALITY(addr, locality) \ + __builtin_prefetch(addr, 0, locality) +#define PREFETCH_WRITE_LOCALITY(addr, locality) \ + __builtin_prefetch(addr, 1, locality) +#else +#define PREFETCH_READ(addr) +#define PREFETCH_READ_LOCALITY(addr, locality) +#define PREFETCH_WRITE(addr) +#define PREFETCH_WRITE_LOCALITY(addr, locality) +#endif + +/* + The following macro is used to ensure that code often used in most + SQL statements and definitely for parts of the SQL processing are + kept in a code segment by itself. This has the advantage that the + risk of common code being overlapping in caches of the CPU is less. + This can be a cause of big performance problems. + Routines should be put in this category with care and when they are + put there one should also strive to make as much of the error handling + as possible (or uncommon code of the routine) to execute in a + separate method to avoid moving to much code to this code segment. + + It is very easy to use, simply add HOT_METHOD at the end of the + function declaration. + For more input see GCC manual (available in GCC 2.95 and later) +*/ + +#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94) +#define HOT_METHOD \ + __attribute__ ((section ("hot_code_section"))) +#else +#define HOT_METHOD +#endif + +/* + The following macro is used to ensure that popular global variables + are located next to each other to avoid that they contend for the + same cache lines. + + It is very easy to use, simply add HOT_DATA at the end of the declaration + of the variable, the variable must be initialised because of the way + that linker works so a declaration using HOT_DATA should look like: + uint global_hot_data HOT_DATA = 0; + For more input see GCC manual (available in GCC 2.95 and later) +*/ + +#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94) +#define HOT_DATA \ + __attribute__ ((section ("hot_data_section"))) +#else +#define HOT_DATA +#endif + +/* + now let's figure out if inline functions are supported + autoconf defines 'inline' to be empty, if not +*/ +#define inline_test_1(X) X ## 1 +#define inline_test_2(X) inline_test_1(X) +#if inline_test_2(inline) != 1 +#define HAVE_INLINE +#endif +#undef inline_test_2 +#undef inline_test_1 +/* helper macro for "instantiating" inline functions */ +#define STATIC_INLINE static inline + +/* + The following macros are used to control inlining a bit more than + usual. These macros are used to ensure that inlining always or + never occurs (independent of compilation mode). + For more input see GCC manual (available in GCC 3.1.1 and later) +*/ + +#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10) +#define ALWAYS_INLINE __attribute__ ((always_inline)) +#define NEVER_INLINE __attribute__ ((noinline)) +#else +#define ALWAYS_INLINE +#define NEVER_INLINE +#endif /* Fix problem with S_ISLNK() on Linux */ @@ -170,10 +281,8 @@ /* The client defines this to avoid all thread code */ #if defined(UNDEF_THREADS_HACK) #undef THREAD -#undef HAVE_mit_thread #undef HAVE_LINUXTHREADS #undef HAVE_NPTL -#undef HAVE_UNIXWARE7_THREADS #endif #ifdef HAVE_THREADS_WITHOUT_SOCKETS @@ -218,7 +327,7 @@ #endif #endif -#if defined(THREAD) && !defined(__WIN__) && !defined(OS2) +#if defined(THREAD) && !defined(__WIN__) #ifndef _POSIX_PTHREAD_SEMANTICS #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ #endif @@ -229,10 +338,6 @@ #if !defined(_THREAD_SAFE) && !defined(_AIX) #define _THREAD_SAFE /* Required for OSF1 */ #endif -#ifndef HAVE_mit_thread -#ifdef HAVE_UNIXWARE7_THREADS -#include -#else #if defined(HPUX10) || defined(HPUX11) C_MODE_START /* HPUX needs this, signal.h bug */ #include @@ -240,8 +345,6 @@ C_MODE_END #else #include /* AIX must have this included first */ #endif -#endif /* HAVE_UNIXWARE7_THREADS */ -#endif /* HAVE_mit_thread */ #if !defined(SCO) && !defined(_REENTRANT) #define _REENTRANT 1 /* Threads requires reentrant code */ #endif @@ -310,6 +413,7 @@ C_MODE_END #ifndef stdin #include #endif +#include #ifdef HAVE_STDLIB_H #include #endif @@ -324,6 +428,9 @@ C_MODE_END #ifdef HAVE_FLOAT_H #include #endif +#ifdef HAVE_FENV_H +#include /* For fesetround() */ +#endif #ifdef HAVE_SYS_TYPES_H #include @@ -331,6 +438,9 @@ C_MODE_END #ifdef HAVE_FCNTL_H #include #endif +#ifdef HAVE_SYS_STAT_H +#include +#endif #ifdef HAVE_SYS_TIMEB_H #include /* Avoid warnings on SCO */ #endif @@ -354,17 +464,7 @@ C_MODE_END #ifdef HAVE_ALLOCA_H #include #endif -#ifdef HAVE_ATOMIC_ADD -#define new my_arg_new -#define need_to_restore_new 1 -C_MODE_START -#include -C_MODE_END -#ifdef need_to_restore_new /* probably safer than #ifdef new */ -#undef new -#undef need_to_restore_new -#endif -#endif + #include /* Recommended by debian */ /* We need the following to go around a problem with openssl on solaris */ #if defined(HAVE_CRYPT_H) @@ -378,14 +478,25 @@ C_MODE_END */ #include +/* an assert that works at compile-time. only for constant expression */ +#ifdef _some_old_compiler_that_does_not_understand_the_construct_below_ +#define compile_time_assert(X) do { } while(0) +#else +#define compile_time_assert(X) \ + do \ + { \ + typedef char compile_time_assert[(X) ? 1 : -1]; \ + } while(0) +#endif + /* Go around some bugs in different OS and compilers */ +#if defined (HPUX11) && defined(_LARGEFILE_SOURCE) +#define _LARGEFILE64_SOURCE +#endif #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) #include /* HPUX 10.20 defines ulong here. UGLY !!! */ #define HAVE_ULONG #endif -#ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */ -#undef HAVE_FINITE -#endif #if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) /* Fix bug in setrlimit */ #undef setrlimit @@ -403,13 +514,6 @@ extern "C" int madvise(void *addr, size_t len, int behav); #undef HAVE_FINITE #undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */ #undef LONGLONG_MAX /* standard system library 'limits.h' */ -#ifdef __cplusplus -#ifndef HAVE_RINT -#define HAVE_RINT -#endif /* rint() and isnan() functions are not */ -#define rint(a) std::rint(a) /* visible in C++ scope due to an error */ -#define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */ -#endif #endif /* We can not live without the following defines */ @@ -420,9 +524,7 @@ extern "C" int madvise(void *addr, size_t len, int behav); #define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */ #define USE_REGEX 1 /* We want the use the regex library */ /* Do not define for ultra sparcs */ -#ifndef OS2 #define USE_BMOVE512 1 /* Use this unless system bmove is faster */ -#endif #define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ #define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ @@ -438,17 +540,6 @@ extern "C" int madvise(void *addr, size_t len, int behav); #define DONT_REMEMBER_SIGNAL #endif -/* Define void to stop lint from generating "null effekt" comments */ -#ifndef DONT_DEFINE_VOID -#ifdef _lint -int __void__; -#define VOID(X) (__void__ = (int) (X)) -#else -#undef VOID -#define VOID(X) (X) -#endif -#endif /* DONT_DEFINE_VOID */ - #if defined(_lint) || defined(FORCE_INIT_OF_VARS) #define LINT_INIT(var) var=0 /* No uninitialize-warning */ #else @@ -461,13 +552,7 @@ int __void__; #define PURIFY_OR_LINT_INIT(var) #endif -/* Define some useful general macros */ -#if !defined(max) -#define max(a, b) ((a) > (b) ? (a) : (b)) -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#if defined(__EMX__) || !defined(HAVE_UINT) +#if !defined(HAVE_UINT) #undef HAVE_UINT #define HAVE_UINT typedef unsigned int uint; @@ -476,16 +561,13 @@ typedef unsigned short ushort; #define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; } +#define swap_variables(t, a, b) { t swap_dummy; swap_dummy= a; a= b; b= swap_dummy; } #define test(a) ((a) ? 1 : 0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) #define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) #define test_all_bits(a,b) (((a) & (b)) == (b)) #define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) -#ifndef HAVE_RINT -#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5)) -#endif /* Define some general constants */ #ifndef TRUE @@ -527,16 +609,21 @@ C_MODE_END */ #define _VARARGS(X) X #define _STATIC_VARARGS(X) X -#define _PC(X) X +/* The DBUG_ON flag always takes precedence over default DBUG_OFF */ #if defined(DBUG_ON) && defined(DBUG_OFF) #undef DBUG_OFF #endif -#if defined(_lint) && !defined(DBUG_OFF) -#define DBUG_OFF +/* We might be forced to turn debug off, if not turned off already */ +#if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF) +# define DBUG_OFF +# ifdef DBUG_ON +# undef DBUG_ON +# endif #endif +typedef char my_bool; /* Small bool */ #include #define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ @@ -551,7 +638,7 @@ typedef int my_socket; /* File descriptor for sockets */ #define INVALID_SOCKET -1 #endif /* Type for fuctions that handles signals */ -#define sig_handler RETSIGTYPE +#define sig_handler void C_MODE_START typedef void (*sig_return)();/* Returns type from signal */ C_MODE_END @@ -572,25 +659,10 @@ C_MODE_START typedef int (*qsort_cmp)(const void *,const void *); typedef int (*qsort_cmp2)(void*, const void *,const void *); C_MODE_END -#ifdef HAVE_mit_thread -#define qsort_t void -#undef QSORT_TYPE_IS_VOID -#define QSORT_TYPE_IS_VOID -#else #define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ -#endif -#ifdef HAVE_mit_thread -#define size_socket socklen_t /* Type of last arg to accept */ -#else #ifdef HAVE_SYS_SOCKET_H #include #endif -typedef SOCKET_SIZE_TYPE size_socket; -#endif - -#ifndef SOCKOPT_OPTLEN_TYPE -#define SOCKOPT_OPTLEN_TYPE size_socket -#endif /* file create flags */ @@ -635,7 +707,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define UNSINT32 /* unsigned int32 */ /* General constants */ -#define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */ #define FN_LEN 256 /* Max file name len */ #define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ @@ -646,15 +717,44 @@ typedef SOCKET_SIZE_TYPE size_socket; #define FN_PARENTDIR ".." /* Parent directory; Must be a string */ #ifndef FN_LIBCHAR -#ifdef __EMX__ -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#else #define FN_LIBCHAR '/' #define FN_ROOTDIR "/" #endif + +/* + MY_FILE_MIN is Windows speciality and is used to quickly detect + the mismatch of CRT and mysys file IO usage on Windows at runtime. + CRT file descriptors can be in the range 0-2047, whereas descriptors returned + by my_open() will start with 2048. If a file descriptor with value less then + MY_FILE_MIN is passed to mysys IO function, chances are it stemms from + open()/fileno() and not my_open()/my_fileno. + + For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN + is logically 0. +*/ + +#ifdef _WIN32 +#define MY_FILE_MIN 2048 +#else +#define MY_FILE_MIN 0 #endif -#define MY_NFILE 64 /* This is only used to save filenames */ + +/* + MY_NFILE is the default size of my_file_info array. + + It is larger on Windows, because it all file handles are stored in my_file_info + Default size is 16384 and this should be enough for most cases.If it is not + enough, --max-open-files with larger value can be used. + + For Posix , my_file_info array is only used to store filenames for + error reporting and its size is not a limitation for number of open files. +*/ +#ifdef _WIN32 +#define MY_NFILE (16384 + MY_FILE_MIN) +#else +#define MY_NFILE 64 +#endif + #ifndef OS_FILE_LIMIT #define OS_FILE_LIMIT 65535 #endif @@ -691,24 +791,22 @@ typedef SOCKET_SIZE_TYPE size_socket; /* Some things that this system doesn't have */ #define NO_HASH /* Not needed anymore */ -#ifdef __WIN__ -#define NO_DIR_LIBRARY /* Not standar dir-library */ -#define USE_MY_STAT_STRUCT /* For my_lib */ +#ifdef _WIN32 +#define NO_DIR_LIBRARY /* Not standard dir-library */ #endif /* Some defines of functions for portability */ #undef remove /* Crashes MySQL on SCO 5.0.0 */ #ifndef __WIN__ -#ifdef OS2 -#define closesocket(A) soclose(A) -#else #define closesocket(A) close(A) -#endif #ifndef ulonglong2double #define ulonglong2double(A) ((double) (ulonglong) (A)) #define my_off_t2double(A) ((double) (my_off_t) (A)) #endif +#ifndef double2ulonglong +#define double2ulonglong(A) ((ulonglong) (double) (A)) +#endif #endif #ifndef offsetof @@ -717,19 +815,15 @@ typedef SOCKET_SIZE_TYPE size_socket; #define ulong_to_double(X) ((double) (ulong) (X)) #define SET_STACK_SIZE(X) /* Not needed on real machines */ -#if !defined(HAVE_mit_thread) && !defined(HAVE_STRTOK_R) -#define strtok_r(A,B,C) strtok((A),(B)) +#ifndef STACK_DIRECTION +#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" #endif -/* Remove some things that mit_thread break or doesn't support */ -#if defined(HAVE_mit_thread) && defined(THREAD) -#undef HAVE_PREAD -#undef HAVE_REALPATH -#undef HAVE_MLOCK -#undef HAVE_TEMPNAM /* Use ours */ -#undef HAVE_PTHREAD_SETPRIO -#undef HAVE_FTRUNCATE -#undef HAVE_READLINK +#if !defined(HAVE_STRTOK_R) +inline char *strtok_r(char *str, const char *delim, char **saveptr) +{ + return strtok(str,delim); +} #endif /* This is from the old m-machine.h file */ @@ -780,19 +874,36 @@ typedef SOCKET_SIZE_TYPE size_socket; #define DBL_MAX 1.79769313486231470e+308 #define FLT_MAX ((float)3.40282346638528860e+38) #endif - -#ifndef HAVE_FINITE -#define finite(x) (1.0 / fabs(x) > 0.0) +#ifndef SIZE_T_MAX +#define SIZE_T_MAX ~((size_t) 0) #endif +#ifndef isfinite +#ifdef HAVE_FINITE +#define isfinite(x) finite(x) +#else +#define finite(x) (1.0 / fabs(x) > 0.0) +#endif /* HAVE_FINITE */ +#endif /* isfinite */ + #ifndef HAVE_ISNAN #define isnan(x) ((x) != (x)) #endif #ifdef HAVE_ISINF -/* isinf() can be used in both C and C++ code */ -#define my_isinf(X) isinf(X) +/* Check if C compiler is affected by GCC bug #39228 */ +#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF) +/* Force store/reload of the argument to/from a 64-bit double */ +static inline double my_isinf(double x) +{ + volatile double t= x; + return isinf(t); +} #else +/* System-provided isinf() is available and safe to use */ +#define my_isinf(X) isinf(X) +#endif +#else /* !HAVE_ISINF */ #define my_isinf(X) (!finite(X) && !isnan(X)) #endif @@ -823,8 +934,11 @@ typedef long long my_ptrdiff_t; #define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t))) /* Offset of field f in structure t */ #define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) -#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size) -#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B)) +#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size) +#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B)) + +#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B)) +#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))] /* Custom version of standard offsetof() macro which can be used to get @@ -841,7 +955,7 @@ typedef long long my_ptrdiff_t; #define my_offsetof(TYPE, MEMBER) \ ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) -#define NullS (char *) 0 +#define NullS STATIC_CAST(char *)(0) /* Nowdays we do not support MessyDos */ #ifndef NEAR #define NEAR /* Who needs segments ? */ @@ -859,36 +973,41 @@ typedef long long my_ptrdiff_t; /* Typdefs for easyier portability */ -#if defined(VOIDTYPE) -typedef void *gptr; /* Generic pointer */ -#else -typedef char *gptr; /* Generic pointer */ -#endif -#ifndef HAVE_INT_8_16_32 -typedef signed char int8; /* Signed integer >= 8 bits */ -typedef short int16; /* Signed integer >= 16 bits */ -#endif #ifndef HAVE_UCHAR typedef unsigned char uchar; /* Short for unsigned char */ #endif -typedef unsigned char uint8; /* Short for unsigned integer >= 8 bits */ -typedef unsigned short uint16; /* Short for unsigned integer >= 16 bits */ +#ifndef HAVE_INT8 +typedef signed char int8; /* Signed integer >= 8 bits */ +#endif +#ifndef HAVE_UINT8 +typedef unsigned char uint8; /* Unsigned integer >= 8 bits */ +#endif +#ifndef HAVE_INT16 +typedef short int16; +#endif +#ifndef HAVE_UINT16 +typedef unsigned short uint16; +#endif #if SIZEOF_INT == 4 -#ifndef HAVE_INT_8_16_32 -typedef int int32; +#ifndef HAVE_INT32 +typedef int int32; +#endif +#ifndef HAVE_UINT32 +typedef unsigned int uint32; #endif -typedef unsigned int uint32; /* Short for unsigned integer >= 32 bits */ #elif SIZEOF_LONG == 4 -#ifndef HAVE_INT_8_16_32 -typedef long int32; +#ifndef HAVE_INT32 +typedef long int32; +#endif +#ifndef HAVE_UINT32 +typedef unsigned long uint32; #endif -typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */ #else -#error "Neither int or long is of 4 bytes width" +#error Neither int or long is of 4 bytes width #endif -#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MISC) +#if !defined(HAVE_ULONG) && !defined(__USE_MISC) typedef unsigned long ulong; /* Short for unsigned long */ #endif #ifndef longlong_defined @@ -905,6 +1024,12 @@ typedef unsigned long ulonglong; /* ulong or unsigned long long */ typedef long longlong; #endif #endif +#ifndef HAVE_INT64 +typedef longlong int64; +#endif +#ifndef HAVE_UINT64 +typedef ulonglong uint64; +#endif #if defined(NO_CLIENT_LONG_LONG) typedef unsigned long my_ulonglong; @@ -914,6 +1039,18 @@ typedef unsigned __int64 my_ulonglong; typedef unsigned long long my_ulonglong; #endif +#if SIZEOF_CHARP == SIZEOF_INT +typedef int intptr; +#elif SIZEOF_CHARP == SIZEOF_LONG +typedef long intptr; +#elif SIZEOF_CHARP == SIZEOF_LONG_LONG +typedef long long intptr; +#else +#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long) +#endif + +#define MY_ERRPTR ((void*)(intptr)1) + #ifdef USE_RAID /* The following is done with a if to not get problems with pre-processors @@ -935,8 +1072,8 @@ typedef ulonglong my_off_t; #else typedef unsigned long my_off_t; #endif -#define MY_FILEPOS_ERROR (~(my_off_t) 0) -#if !defined(__WIN__) && !defined(OS2) +#define MY_FILEPOS_ERROR (~STATIC_CAST(my_off_t)(0)) +#if !defined(__WIN__) typedef off_t os_off_t; #endif @@ -949,16 +1086,6 @@ typedef off_t os_off_t; #define SOCKET_EADDRINUSE WSAEADDRINUSE #define SOCKET_ENFILE ENFILE #define SOCKET_EMFILE EMFILE -#elif defined(OS2) -#define socket_errno sock_errno() -#define SOCKET_EINTR SOCEINTR -#define SOCKET_EAGAIN SOCEINPROGRESS -#define SOCKET_ETIMEDOUT SOCKET_EINTR -#define SOCKET_EWOULDBLOCK SOCEWOULDBLOCK -#define SOCKET_EADDRINUSE SOCEADDRINUSE -#define SOCKET_ENFILE SOCENFILE -#define SOCKET_EMFILE SOCEMFILE -#define closesocket(A) soclose(A) #else /* Unix */ #define socket_errno errno #define closesocket(A) close(A) @@ -973,37 +1100,12 @@ typedef off_t os_off_t; typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ typedef short int15; /* Most effective integer 0 <= x <= 32767 */ -typedef char *my_string; /* String of characters */ -typedef unsigned long size_s; /* Size of strings (In string-funcs) */ typedef int myf; /* Type of MyFlags in my_funcs */ -#ifndef byte_defined -typedef char byte; /* Smallest addressable unit */ -#endif -typedef char my_bool; /* Small bool */ -#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus)) -typedef char bool; /* Ordinary boolean values 0 1 */ -#endif - /* Macros for converting *constants* to the right type */ + /* Macros for converting *constants* to the right type */ #define INT8(v) (int8) (v) #define INT16(v) (int16) (v) #define INT32(v) (int32) (v) -#define MYF(v) (myf) (v) - -#ifndef LL -#ifdef HAVE_LONG_LONG -#define LL(A) A ## LL -#else -#define LL(A) A ## L -#endif -#endif - -#ifndef ULL -#ifdef HAVE_LONG_LONG -#define ULL(A) A ## ULL -#else -#define ULL(A) A ## UL -#endif -#endif +#define MYF(v) STATIC_CAST(myf)(v) /* Defines to make it possible to prioritize register assignments. No @@ -1039,13 +1141,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */ #define dbug_volatile #endif +/* Some helper macros */ +#define YESNO(X) ((X) ? "yes" : "no") + /* Defines for time function */ #define SCALE_SEC 100 #define SCALE_USEC 10000 #define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */ -#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ - - +#define MY_HOW_OFTEN_TO_WRITE 10000 /* How often we want info on screen */ /* Define-funktions for reading and storing in machine independent format @@ -1053,8 +1156,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */ */ /* Optimized store functions for Intel x86 */ -#if defined(__i386__) && !defined(_WIN64) -#define sint2korr(A) (*((int16 *) (A))) +#if defined(__i386__) || defined(_WIN32) +#define sint2korr(A) (*((const int16 *) (A))) #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ (((uint32) 255L << 24) | \ (((uint32) (uchar) (A)[2]) << 16) |\ @@ -1063,9 +1166,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (((uint32) (uchar) (A)[2]) << 16) |\ (((uint32) (uchar) (A)[1]) << 8) | \ ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -#ifdef HAVE_purify +#define sint4korr(A) (*((const long *) (A))) +#define uint2korr(A) (*((const uint16 *) (A))) +#if defined(HAVE_purify) && !defined(_WIN32) #define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16)) @@ -1076,16 +1179,22 @@ typedef char bool; /* Ordinary boolean values 0 1 */ Please, note, uint3korr reads 4 bytes (not 3) ! It means, that you have to provide enough allocated space ! */ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#endif -#define uint4korr(A) (*((uint32 *) (A))) +#define uint3korr(A) (long) (*((const unsigned int *) (A)) & 0xFFFFFF) +#endif /* HAVE_purify && !_WIN32 */ +#define uint4korr(A) (*((const uint32 *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) ((uchar) (A)[3])) << 24)) +\ (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) +#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ + (((uint32) ((uchar) (A)[1])) << 8) + \ + (((uint32) ((uchar) (A)[2])) << 16) + \ + (((uint32) ((uchar) (A)[3])) << 24)) + \ + (((ulonglong) ((uchar) (A)[4])) << 32) + \ + (((ulonglong) ((uchar) (A)[5])) << 40)) +#define uint8korr(A) (*((const ulonglong *) (A))) +#define sint8korr(A) (*((const longlong *) (A))) #define int2store(T,A) *((uint16*) (T))= (uint16) (A) #define int3store(T,A) do { *(T)= (uchar) ((A));\ *(T+1)=(uchar) (((uint) (A) >> 8));\ @@ -1096,6 +1205,12 @@ typedef char bool; /* Ordinary boolean values 0 1 */ *((T)+2)=(uchar) (((A) >> 16));\ *((T)+3)=(uchar) (((A) >> 24)); \ *((T)+4)=(uchar) (((A) >> 32)); } while(0) +#define int6store(T,A) do { *(T)= (uchar)((A)); \ + *((T)+1)=(uchar) (((A) >> 8)); \ + *((T)+2)=(uchar) (((A) >> 16)); \ + *((T)+3)=(uchar) (((A) >> 24)); \ + *((T)+4)=(uchar) (((A) >> 32)); \ + *((T)+5)=(uchar) (((A) >> 40)); } while(0) #define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) typedef union { @@ -1104,21 +1219,20 @@ typedef union { } doubleget_union; #define doubleget(V,M) \ do { doubleget_union _tmp; \ - _tmp.m[0] = *((long*)(M)); \ - _tmp.m[1] = *(((long*) (M))+1); \ + _tmp.m[0] = *((const long*)(M)); \ + _tmp.m[1] = *(((const long*) (M))+1); \ (V) = _tmp.v; } while(0) -#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \ - *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \ +#define doublestore(T,V) do { *((long *) T) = ((const doubleget_union *)&V)->m[0]; \ + *(((long *) T)+1) = ((const doubleget_union *)&V)->m[1]; \ } while (0) -#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0) +#define float4get(V,M) do { *((float *) &(V)) = *((const float*) (M)); } while(0) #define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) -#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float)) -#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) +#define float4store(V,M) memcpy((uchar*) V,(const uchar*) (&M),sizeof(float)) +#define floatstore(T,V) memcpy((uchar*)(T), (const uchar*)(&V),sizeof(float)) +#define floatget(V,M) memcpy((uchar*) &V,(const uchar*) (M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) -#endif /* __i386__ */ +#else -#ifndef sint2korr /* We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines were done before) @@ -1152,6 +1266,12 @@ do { doubleget_union _tmp; \ (((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) ((uchar) (A)[3])) << 24)) +\ (((ulonglong) ((uchar) (A)[4])) << 32)) +#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ + (((uint32) ((uchar) (A)[1])) << 8) + \ + (((uint32) ((uchar) (A)[2])) << 16) + \ + (((uint32) ((uchar) (A)[3])) << 24)) + \ + (((ulonglong) ((uchar) (A)[4])) << 32) + \ + (((ulonglong) ((uchar) (A)[5])) << 40)) #define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16) +\ @@ -1174,68 +1294,76 @@ do { doubleget_union _tmp; \ *(((char *)(T))+1)=(char) (((A) >> 8));\ *(((char *)(T))+2)=(char) (((A) >> 16));\ *(((char *)(T))+3)=(char) (((A) >> 24)); } while(0) -#define int5store(T,A) do { *((char *)(T))=((A));\ - *(((char *)(T))+1)=(((A) >> 8));\ - *(((char *)(T))+2)=(((A) >> 16));\ - *(((char *)(T))+3)=(((A) >> 24)); \ - *(((char *)(T))+4)=(((A) >> 32)); } while(0) +#define int5store(T,A) do { *((char *)(T))= (char)((A)); \ + *(((char *)(T))+1)= (char)(((A) >> 8)); \ + *(((char *)(T))+2)= (char)(((A) >> 16)); \ + *(((char *)(T))+3)= (char)(((A) >> 24)); \ + *(((char *)(T))+4)= (char)(((A) >> 32)); \ + } while(0) +#define int6store(T,A) do { *((char *)(T))= (char)((A)); \ + *(((char *)(T))+1)= (char)(((A) >> 8)); \ + *(((char *)(T))+2)= (char)(((A) >> 16)); \ + *(((char *)(T))+3)= (char)(((A) >> 24)); \ + *(((char *)(T))+4)= (char)(((A) >> 32)); \ + *(((char *)(T))+5)= (char)(((A) >> 40)); \ + } while(0) #define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \ int4store((T),def_temp); \ int4store((T+4),def_temp2); } while(0) #ifdef WORDS_BIGENDIAN -#define float4store(T,A) do { *(T)= ((byte *) &A)[3];\ - *((T)+1)=(char) ((byte *) &A)[2];\ - *((T)+2)=(char) ((byte *) &A)[1];\ - *((T)+3)=(char) ((byte *) &A)[0]; } while(0) +#define float4store(T,A) do { *(T)= ((uchar *) &A)[3];\ + *((T)+1)=(char) ((uchar *) &A)[2];\ + *((T)+2)=(char) ((uchar *) &A)[1];\ + *((T)+3)=(char) ((uchar *) &A)[0]; } while(0) #define float4get(V,M) do { float def_temp;\ - ((byte*) &def_temp)[0]=(M)[3];\ - ((byte*) &def_temp)[1]=(M)[2];\ - ((byte*) &def_temp)[2]=(M)[1];\ - ((byte*) &def_temp)[3]=(M)[0];\ + ((uchar*) &def_temp)[0]=(M)[3];\ + ((uchar*) &def_temp)[1]=(M)[2];\ + ((uchar*) &def_temp)[2]=(M)[1];\ + ((uchar*) &def_temp)[3]=(M)[0];\ (V)=def_temp; } while(0) -#define float8store(T,V) do { *(T)= ((byte *) &V)[7];\ - *((T)+1)=(char) ((byte *) &V)[6];\ - *((T)+2)=(char) ((byte *) &V)[5];\ - *((T)+3)=(char) ((byte *) &V)[4];\ - *((T)+4)=(char) ((byte *) &V)[3];\ - *((T)+5)=(char) ((byte *) &V)[2];\ - *((T)+6)=(char) ((byte *) &V)[1];\ - *((T)+7)=(char) ((byte *) &V)[0]; } while(0) +#define float8store(T,V) do { *(T)= ((uchar *) &V)[7];\ + *((T)+1)=(char) ((uchar *) &V)[6];\ + *((T)+2)=(char) ((uchar *) &V)[5];\ + *((T)+3)=(char) ((uchar *) &V)[4];\ + *((T)+4)=(char) ((uchar *) &V)[3];\ + *((T)+5)=(char) ((uchar *) &V)[2];\ + *((T)+6)=(char) ((uchar *) &V)[1];\ + *((T)+7)=(char) ((uchar *) &V)[0]; } while(0) #define float8get(V,M) do { double def_temp;\ - ((byte*) &def_temp)[0]=(M)[7];\ - ((byte*) &def_temp)[1]=(M)[6];\ - ((byte*) &def_temp)[2]=(M)[5];\ - ((byte*) &def_temp)[3]=(M)[4];\ - ((byte*) &def_temp)[4]=(M)[3];\ - ((byte*) &def_temp)[5]=(M)[2];\ - ((byte*) &def_temp)[6]=(M)[1];\ - ((byte*) &def_temp)[7]=(M)[0];\ + ((uchar*) &def_temp)[0]=(M)[7];\ + ((uchar*) &def_temp)[1]=(M)[6];\ + ((uchar*) &def_temp)[2]=(M)[5];\ + ((uchar*) &def_temp)[3]=(M)[4];\ + ((uchar*) &def_temp)[4]=(M)[3];\ + ((uchar*) &def_temp)[5]=(M)[2];\ + ((uchar*) &def_temp)[6]=(M)[1];\ + ((uchar*) &def_temp)[7]=(M)[0];\ (V) = def_temp; } while(0) #else -#define float4get(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) -#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float)) +#define float4get(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float)) +#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float)) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\ - *(((char*)T)+1)=(char) ((byte *) &V)[5];\ - *(((char*)T)+2)=(char) ((byte *) &V)[6];\ - *(((char*)T)+3)=(char) ((byte *) &V)[7];\ - *(((char*)T)+4)=(char) ((byte *) &V)[0];\ - *(((char*)T)+5)=(char) ((byte *) &V)[1];\ - *(((char*)T)+6)=(char) ((byte *) &V)[2];\ - *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\ +#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\ + *(((char*)T)+1)=(char) ((uchar *) &V)[5];\ + *(((char*)T)+2)=(char) ((uchar *) &V)[6];\ + *(((char*)T)+3)=(char) ((uchar *) &V)[7];\ + *(((char*)T)+4)=(char) ((uchar *) &V)[0];\ + *(((char*)T)+5)=(char) ((uchar *) &V)[1];\ + *(((char*)T)+6)=(char) ((uchar *) &V)[2];\ + *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\ while(0) #define doubleget(V,M) do { double def_temp;\ - ((byte*) &def_temp)[0]=(M)[4];\ - ((byte*) &def_temp)[1]=(M)[5];\ - ((byte*) &def_temp)[2]=(M)[6];\ - ((byte*) &def_temp)[3]=(M)[7];\ - ((byte*) &def_temp)[4]=(M)[0];\ - ((byte*) &def_temp)[5]=(M)[1];\ - ((byte*) &def_temp)[6]=(M)[2];\ - ((byte*) &def_temp)[7]=(M)[3];\ + ((uchar*) &def_temp)[0]=(M)[4];\ + ((uchar*) &def_temp)[1]=(M)[5];\ + ((uchar*) &def_temp)[2]=(M)[6];\ + ((uchar*) &def_temp)[3]=(M)[7];\ + ((uchar*) &def_temp)[4]=(M)[0];\ + ((uchar*) &def_temp)[5]=(M)[1];\ + ((uchar*) &def_temp)[6]=(M)[2];\ + ((uchar*) &def_temp)[7]=(M)[3];\ (V) = def_temp; } while(0) #endif /* __FLOAT_WORD_ORDER */ @@ -1243,7 +1371,7 @@ do { doubleget_union _tmp; \ #define float8store(V,M) doublestore((V),(M)) #endif /* WORDS_BIGENDIAN */ -#endif /* sint2korr */ +#endif /* __i386__ OR _WIN32 */ /* Macro for reading 32-bit integer from network byte order (big-endian) @@ -1266,16 +1394,16 @@ do { doubleget_union _tmp; \ #define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\ ((short) ((short) (M)[0]) << 8)); } while(0) #define longget(V,M) do { int32 def_temp;\ - ((byte*) &def_temp)[0]=(M)[0];\ - ((byte*) &def_temp)[1]=(M)[1];\ - ((byte*) &def_temp)[2]=(M)[2];\ - ((byte*) &def_temp)[3]=(M)[3];\ + ((uchar*) &def_temp)[0]=(M)[0];\ + ((uchar*) &def_temp)[1]=(M)[1];\ + ((uchar*) &def_temp)[2]=(M)[2];\ + ((uchar*) &def_temp)[3]=(M)[3];\ (V)=def_temp; } while(0) #define ulongget(V,M) do { uint32 def_temp;\ - ((byte*) &def_temp)[0]=(M)[0];\ - ((byte*) &def_temp)[1]=(M)[1];\ - ((byte*) &def_temp)[2]=(M)[2];\ - ((byte*) &def_temp)[3]=(M)[3];\ + ((uchar*) &def_temp)[0]=(M)[0];\ + ((uchar*) &def_temp)[1]=(M)[1];\ + ((uchar*) &def_temp)[2]=(M)[2];\ + ((uchar*) &def_temp)[3]=(M)[3];\ (V)=def_temp; } while(0) #define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ *(((char*)T)+1)=(char)(def_temp); \ @@ -1285,12 +1413,12 @@ do { doubleget_union _tmp; \ *(((char*)T)+1)=(((A) >> 16));\ *(((char*)T)+0)=(((A) >> 24)); } while(0) -#define floatget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float)) -#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float)) -#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) -#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) -#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong)) -#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong)) +#define floatget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float)) +#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float)) +#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double)) +#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double)) +#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong)) +#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong)) #else @@ -1301,15 +1429,15 @@ do { doubleget_union _tmp; \ #define shortstore(T,V) int2store(T,V) #define longstore(T,V) int4store(T,V) #ifndef floatstore -#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float)) -#define floatget(V,M) memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float)) +#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(float)) +#define floatget(V,M) memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float)) #endif #ifndef doubleget -#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) -#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double)) +#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double)) +#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double)) #endif /* doubleget */ -#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong)) -#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong)) +#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong)) +#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong)) #endif /* WORDS_BIGENDIAN */ @@ -1326,13 +1454,16 @@ do { doubleget_union _tmp; \ #ifndef THREAD #define thread_safe_increment(V,L) (V)++ +#define thread_safe_decrement(V,L) (V)-- #define thread_safe_add(V,C,L) (V)+=(C) #define thread_safe_sub(V,C,L) (V)-=(C) #define statistic_increment(V,L) (V)++ +#define statistic_decrement(V,L) (V)-- #define statistic_add(V,C,L) (V)+=(C) +#define statistic_sub(V,C,L) (V)-=(C) #endif -#ifdef HAVE_CHARSET_utf8 +#if defined(HAVE_CHARSET_utf8mb3) || defined(HAVE_CHARSET_utf8mb4) #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" #else #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME @@ -1342,14 +1473,144 @@ do { doubleget_union _tmp; \ #define NO_EMBEDDED_ACCESS_CHECKS #endif +#ifdef HAVE_DLOPEN +#if defined(__WIN__) +#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name) +#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0) +#define dlclose(lib) FreeLibrary((HMODULE)lib) +#elif defined(HAVE_DLFCN_H) +#include +#endif +#endif + +/* FreeBSD 2.2.2 does not define RTLD_NOW) */ +#ifndef RTLD_NOW +#define RTLD_NOW 1 +#endif + +#ifndef HAVE_DLERROR +#define dlerror() "" +#endif + + +#ifndef __NETWARE__ +/* + * Include standard definitions of operator new and delete. + */ +#ifdef __cplusplus +#include +#endif +#else +/* + * Define placement versions of operator new and operator delete since + * we don't have when building for Netware. + */ +#ifdef __cplusplus +inline void *operator new(size_t, void *ptr) { return ptr; } +inline void *operator new[](size_t, void *ptr) { return ptr; } +inline void operator delete(void*, void*) { /* Do nothing */ } +inline void operator delete[](void*, void*) { /* Do nothing */ } +#endif +#endif /* Length of decimal number represented by INT32. */ - #define MY_INT32_NUM_DECIMAL_DIGITS 11 /* Length of decimal number represented by INT64. */ - #define MY_INT64_NUM_DECIMAL_DIGITS 21 -#endif /* my_global_h */ +/* Define some useful general macros (should be done after all headers). */ +#if !defined(max) +#define max(a, b) ((a) > (b) ? (a) : (b)) +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif +/* + Only Linux is known to need an explicit sync of the directory to make sure a + file creation/deletion/renaming in(from,to) this directory durable. +*/ +#ifdef TARGET_OS_LINUX +#define NEED_EXPLICIT_SYNC_DIR 1 +#else +/* + On linux default rwlock scheduling policy is good enough for + waiting_threads.c, on other systems use our special implementation + (which is slower). + QQ perhaps this should be tested in configure ? how ? +*/ +#define WT_RWLOCKS_USE_MUTEXES 1 +#endif + +#if !defined(__cplusplus) && !defined(bool) +#define bool In_C_you_should_use_my_bool_instead() +#endif + +/* Provide __func__ macro definition for platforms that miss it. */ +#if __STDC_VERSION__ < 199901L +# if __GNUC__ >= 2 +# define __func__ __FUNCTION__ +# else +# define __func__ "" +# endif +#elif defined(_MSC_VER) +# if _MSC_VER < 1300 +# define __func__ "" +# else +# define __func__ __FUNCTION__ +# endif +#elif defined(__BORLANDC__) +# define __func__ __FUNC__ +#else +# define __func__ "" +#endif + +#ifndef HAVE_RINT +/** + All integers up to this number can be represented exactly as double precision + values (DBL_MANT_DIG == 53 for IEEE 754 hardware). +*/ +#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1) + +/** + rint(3) implementation for platforms that do not have it. + Always rounds to the nearest integer with ties being rounded to the nearest + even integer to mimic glibc's rint() behavior in the "round-to-nearest" + FPU mode. Hardware-specific optimizations are possible (frndint on x86). + Unlike this implementation, hardware will also honor the FPU rounding mode. +*/ + +static inline double rint(double x) +{ + double f, i; + f = modf(x, &i); + + /* + All doubles with absolute values > MAX_EXACT_INTEGER are even anyway, + no need to check it. + */ + if (x > 0.0) + i += (double) ((f > 0.5) || (f == 0.5 && + i <= (double) MAX_EXACT_INTEGER && + (longlong) i % 2)); + else + i -= (double) ((f < -0.5) || (f == -0.5 && + i >= (double) -MAX_EXACT_INTEGER && + (longlong) i % 2)); + return i; +} +#endif /* HAVE_RINT */ + +/* + MYSQL_PLUGIN_IMPORT macro is used to export mysqld data + (i.e variables) for usage in storage engine loadable plugins. + Outside of Windows, it is dummy. +*/ +#ifndef MYSQL_PLUGIN_IMPORT +#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN)) +#define MYSQL_PLUGIN_IMPORT __declspec(dllimport) +#else +#define MYSQL_PLUGIN_IMPORT +#endif +#endif + +#endif /* my_global_h */ diff --git a/externals/mysql/my_libwrap.h b/externals/mysql/my_libwrap.h new file mode 100644 index 00000000000..9a8579475fb --- /dev/null +++ b/externals/mysql/my_libwrap.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef HAVE_LIBWRAP +#include +#include +#ifdef NEED_SYS_SYSLOG_H +#include +#endif /* NEED_SYS_SYSLOG_H */ + +extern void my_fromhost(struct request_info *req); +extern int my_hosts_access(struct request_info *req); +extern char *my_eval_client(struct request_info *req); + +#endif /* HAVE_LIBWRAP */ diff --git a/dep/include/mysql/my_list.h b/externals/mysql/my_list.h similarity index 91% rename from dep/include/mysql/my_list.h rename to externals/mysql/my_list.h index bdb0a89c4f5..775b56587b8 100644 --- a/dep/include/mysql/my_list.h +++ b/externals/mysql/my_list.h @@ -33,14 +33,13 @@ extern LIST *list_cons(void *data,LIST *root); extern LIST *list_reverse(LIST *root); extern void list_free(LIST *root,unsigned int free_data); extern unsigned int list_length(LIST *); -extern int list_walk(LIST *,list_walk_action action,gptr argument); +extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); #define list_rest(a) ((a)->next) #define list_push(a,b) (a)=list_cons((b),(a)) -#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); } +#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((unsigned char *) old,MYF(MY_FAE)); } #ifdef __cplusplus } #endif #endif - diff --git a/externals/mysql/my_md5.h b/externals/mysql/my_md5.h new file mode 100644 index 00000000000..6458f27c5cc --- /dev/null +++ b/externals/mysql/my_md5.h @@ -0,0 +1,54 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* See md5.c for explanation and copyright information. */ + +/* + * $FreeBSD: src/contrib/cvs/lib/md5.h,v 1.2 1999/12/11 15:10:02 peter Exp $ + */ + +/* Unlike previous versions of this code, uint32 need not be exactly + 32 bits, merely 32 bits or more. Choosing a data type which is 32 + bits instead of 64 is not important; speed is considerably more + important. ANSI guarantees that "unsigned long" will be big enough, + and always using it seems to have few disadvantages. */ +typedef uint32 cvs_uint32; + +typedef struct { + cvs_uint32 buf[4]; + cvs_uint32 bits[2]; + unsigned char in[64]; +} my_MD5Context; + +#ifdef __cplusplus +extern "C" { +#endif +void my_MD5Init (my_MD5Context *context); +void my_MD5Update (my_MD5Context *context, + unsigned char const *buf, unsigned len); +void my_MD5Final (unsigned char digest[16], + my_MD5Context *context); + +#ifdef __cplusplus +} +#endif + +#define MY_MD5_HASH(digest,buf,len) \ +do { \ + my_MD5Context ctx; \ + my_MD5Init (&ctx); \ + my_MD5Update (&ctx, buf, len); \ + my_MD5Final (digest, &ctx); \ +} while (0) diff --git a/externals/mysql/my_net.h b/externals/mysql/my_net.h new file mode 100644 index 00000000000..18fb3db8e88 --- /dev/null +++ b/externals/mysql/my_net.h @@ -0,0 +1,114 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + thread safe version of some common functions: + my_inet_ntoa + + This file is also used to make handling of sockets and ioctl() + portable accross systems. + +*/ + +#ifndef _my_net_h +#define _my_net_h +C_MODE_START + +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_POLL +#include +#endif +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + +#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__NETWARE__) +#include +#include +#include +#if !defined(alpha_linux_port) +#include +#endif +#endif + +#if defined(__WIN__) +#define O_NONBLOCK 1 /* For emulation of fcntl() */ + +/* + SHUT_RDWR is called SD_BOTH in windows and + is defined to 2 in winsock2.h + #define SD_BOTH 0x02 +*/ +#define SHUT_RDWR 0x02 + +#endif + +/* + On OSes which don't have the in_addr_t, we guess that using uint32 is the best + possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD64bit + & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too. +*/ +#ifndef HAVE_IN_ADDR_T +#define in_addr_t uint32 +#endif + +/* Thread safe or portable version of some functions */ + +void my_inet_ntoa(struct in_addr in, char *buf); + +/* + Handling of gethostbyname_r() +*/ + +#if !defined(HAVE_GETHOSTBYNAME_R) +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop); +void my_gethostbyname_r_free(); +#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop); +#define my_gethostbyname_r_free() +#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10) +#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) +#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */ + +#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) +#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop); +#define my_gethostbyname_r_free() +#else +#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E)) +#define my_gethostbyname_r_free() +#endif /* !defined(HAVE_GETHOSTBYNAME_R) */ + +#ifndef GETHOSTBYNAME_BUFF_SIZE +#define GETHOSTBYNAME_BUFF_SIZE 2048 +#endif + +C_MODE_END +#endif diff --git a/externals/mysql/my_no_pthread.h b/externals/mysql/my_no_pthread.h new file mode 100644 index 00000000000..b11dbff42f0 --- /dev/null +++ b/externals/mysql/my_no_pthread.h @@ -0,0 +1,50 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#if !defined(_my_no_pthread_h) && !defined(THREAD) +#define _my_no_pthread_h + + +/* + This block is to access some thread-related type definitions + even in builds which do not need thread functions, + as some variables (based on these types) are declared + even in non-threaded builds. + Case in point: 'mf_keycache.c' +*/ +#if defined(__WIN__) +#else /* Normal threads */ +#include + +#endif /* defined(__WIN__) */ + + +/* + This undefs some pthread mutex locks when one isn't using threads + to make thread safe code, that should also work in single thread + environment, easier to use. +*/ +#define pthread_mutex_init(A,B) +#define pthread_mutex_lock(A) +#define pthread_mutex_unlock(A) +#define pthread_mutex_destroy(A) +#define my_rwlock_init(A,B) +#define rw_rdlock(A) +#define rw_wrlock(A) +#define rw_unlock(A) +#define rwlock_destroy(A) + +#endif diff --git a/externals/mysql/my_nosys.h b/externals/mysql/my_nosys.h new file mode 100644 index 00000000000..df5639b81e2 --- /dev/null +++ b/externals/mysql/my_nosys.h @@ -0,0 +1,52 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Header to remove use of my_functions in functions where we need speed and + where calls to posix functions should work +*/ +#ifndef _my_nosys_h +#define _my_nosys_h +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __MY_NOSYS__ +#define __MY_NOSYS__ + +#ifndef HAVE_STDLIB_H +#include +#endif + +#undef my_read /* Can be predefined in raid.h */ +#undef my_write +#undef my_seek +#define my_read(a,b,c,d) my_quick_read(a,b,c,d) +#define my_write(a,b,c,d) my_quick_write(a,b,c) +extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count, + myf myFlags); +extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count); + +#if !defined(SAFEMALLOC) && defined(USE_HALLOC) +#define my_malloc(a,b) halloc(a,1) +#define my_no_flags_free(a) hfree(a) +#endif + +#endif /* __MY_NOSYS__ */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/dep/include/mysql/my_pthread.h b/externals/mysql/my_pthread.h similarity index 63% rename from dep/include/mysql/my_pthread.h rename to externals/mysql/my_pthread.h index 2c734952ccd..ab26860db43 100644 --- a/dep/include/mysql/my_pthread.h +++ b/externals/mysql/my_pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 @@ -18,7 +18,6 @@ #ifndef _my_pthread_h #define _my_pthread_h -#include #ifndef ETIME #define ETIME ETIMEDOUT /* For FreeBSD */ #endif @@ -30,24 +29,12 @@ extern "C" { #define EXTERNC #endif /* __cplusplus */ -#if defined(__WIN__) || defined(OS2) - -#ifdef OS2 -typedef ULONG HANDLE; -typedef ULONG DWORD; -typedef int sigset_t; -#endif - -#ifdef OS2 -typedef HMTX pthread_mutex_t; -#else +#if defined(__WIN__) typedef CRITICAL_SECTION pthread_mutex_t; -#endif -typedef HANDLE pthread_t; +typedef DWORD pthread_t; typedef struct thread_attr { DWORD dwStackSize ; DWORD dwCreatingFlag ; - int priority ; } pthread_attr_t ; typedef struct { int dummy; } pthread_condattr_t; @@ -74,15 +61,11 @@ typedef struct { } pthread_cond_t; + typedef int pthread_mutexattr_t; -#define win_pthread_self my_thread_var->pthread_self -#ifdef OS2 -#define pthread_handler_t EXTERNC void * _Optlink -typedef void * (_Optlink *pthread_handler)(void *); -#else +#define pthread_self() GetCurrentThreadId() #define pthread_handler_t EXTERNC void * __cdecl typedef void * (__cdecl *pthread_handler)(void *); -#endif /* Struct and macros to be used in combination with the @@ -94,28 +77,28 @@ typedef void * (__cdecl *pthread_handler)(void *); so it can be used directly as a 64 bit value. The value stored is in 100ns units. */ - union ft64 { +union ft64 { FILETIME ft; __int64 i64; - }; +}; + struct timespec { union ft64 tv; /* The max timeout value in millisecond for pthread_cond_timedwait */ long max_timeout_msec; }; -#define set_timespec(ABSTIME,SEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \ - (ABSTIME).max_timeout_msec= (long)((SEC)*1000); \ -} -#define set_timespec_nsec(ABSTIME,NSEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \ - (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ -} -void win_pthread_init(void); -int win_pthread_setspecific(void *A,void *B,uint length); +#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \ + (ABSTIME).tv.i64= (TIME)+(__int64)(NSEC)/100; \ + (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ +} while(0) + +#define set_timespec_nsec(ABSTIME,NSEC) do { \ + union ft64 tv; \ + GetSystemTimeAsFileTime(&tv.ft); \ + set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)); \ +} while(0) + int win_pthread_mutex_trylock(pthread_mutex_t *mutex); int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *); int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); @@ -127,134 +110,47 @@ int pthread_cond_broadcast(pthread_cond_t *cond); int pthread_cond_destroy(pthread_cond_t *cond); int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); -int pthread_attr_setprio(pthread_attr_t *connect_att,int priority); int pthread_attr_destroy(pthread_attr_t *connect_att); struct tm *localtime_r(const time_t *timep,struct tm *tmp); struct tm *gmtime_r(const time_t *timep,struct tm *tmp); +void pthread_exit(void *a); +int pthread_join(pthread_t thread, void **value_ptr); -void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ -#ifndef OS2 #define ETIMEDOUT 145 /* Win32 doesn't have this */ -#define getpid() GetCurrentThreadId() -#endif -#define pthread_self() win_pthread_self #define HAVE_LOCALTIME_R 1 #define _REENTRANT 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -#ifdef USE_TLS /* For LIBMYSQL.DLL */ + #undef SAFE_MUTEX /* This will cause conflicts */ #define pthread_key(T,V) DWORD V #define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF) #define pthread_key_delete(A) TlsFree(A) +#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V))) +#define pthread_setspecific(A,B) (!TlsSetValue((A),(B))) #define pthread_getspecific(A) (TlsGetValue(A)) #define my_pthread_getspecific(T,A) ((T) TlsGetValue(A)) #define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V)) -#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V))) -#define pthread_setspecific(A,B) (!TlsSetValue((A),(B))) -#else -#define pthread_key(T,V) __declspec(thread) T V -#define pthread_key_create(A,B) pthread_dummy(0) -#define pthread_key_delete(A) pthread_dummy(0) -#define pthread_getspecific(A) (&(A)) -#define my_pthread_getspecific(T,A) (&(A)) -#define my_pthread_getspecific_ptr(T,V) (V) -#define my_pthread_setspecific_ptr(T,V) ((T)=(V),0) -#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) -#endif /* USE_TLS */ #define pthread_equal(A,B) ((A) == (B)) -#ifdef OS2 -extern int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *); -extern int pthread_mutex_lock (pthread_mutex_t *); -extern int pthread_mutex_unlock (pthread_mutex_t *); -extern int pthread_mutex_destroy (pthread_mutex_t *); -#define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE, B, A) -#define pthread_kill(A,B) raise(B) -#define pthread_exit(A) pthread_dummy() -#else #define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A)) -#define pthread_mutex_unlock(A) LeaveCriticalSection(A) +#define pthread_mutex_unlock(A) (LeaveCriticalSection(A),0) #define pthread_mutex_destroy(A) DeleteCriticalSection(A) -#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#endif /* OS2 */ +#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) + /* Dummy defines for easier code */ #define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B) #define pthread_attr_setscope(A,B) #define pthread_detach_this_thread() #define pthread_condattr_init(A) #define pthread_condattr_destroy(A) +#define pthread_yield() SwitchToThread() -#define my_pthread_getprio(thread_id) pthread_dummy(0) - -#elif defined(HAVE_UNIXWARE7_THREADS) - -#include -#include - -#ifndef _REENTRANT -#define _REENTRANT -#endif - -#define HAVE_NONPOSIX_SIGWAIT -#define pthread_t thread_t -#define pthread_cond_t cond_t -#define pthread_mutex_t mutex_t -#define pthread_key_t thread_key_t -typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */ - -#define pthread_key_create(A,B) thr_keycreate((A),(B)) -#define pthread_key_delete(A) thr_keydelete(A) - -#define pthread_handler_t EXTERNC void * -#define pthread_key(T,V) pthread_key_t V - -void * my_pthread_getspecific_imp(pthread_key_t key); -#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) -#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V) - -#define pthread_setspecific(A,B) thr_setspecific(A,B) -#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V) - -#define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED,(A)) -#define pthread_cond_init(a,b) cond_init((a),USYNC_THREAD,NULL) -#define pthread_cond_destroy(a) cond_destroy(a) -#define pthread_cond_signal(a) cond_signal(a) -#define pthread_cond_wait(a,b) cond_wait((a),(b)) -#define pthread_cond_timedwait(a,b,c) cond_timedwait((a),(b),(c)) -#define pthread_cond_broadcast(a) cond_broadcast(a) - -#define pthread_mutex_init(a,b) mutex_init((a),USYNC_THREAD,NULL) -#define pthread_mutex_lock(a) mutex_lock(a) -#define pthread_mutex_unlock(a) mutex_unlock(a) -#define pthread_mutex_destroy(a) mutex_destroy(a) - -#define pthread_self() thr_self() -#define pthread_exit(A) thr_exit(A) -#define pthread_equal(A,B) (((A) == (B)) ? 1 : 0) -#define pthread_kill(A,B) thr_kill((A),(B)) -#define HAVE_PTHREAD_KILL - -#define pthread_sigmask(A,B,C) thr_sigsetmask((A),(B),(C)) - -extern int my_sigwait(const sigset_t *set,int *sig); - -#define pthread_detach_this_thread() pthread_dummy(0) - -#define pthread_attr_init(A) pthread_dummy(0) -#define pthread_attr_destroy(A) pthread_dummy(0) -#define pthread_attr_setscope(A,B) pthread_dummy(0) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define my_pthread_setprio(A,B) pthread_dummy (0) -#define my_pthread_getprio(A) pthread_dummy (0) -#define my_pthread_attr_setprio(A,B) pthread_dummy(0) #else /* Normal threads */ @@ -276,17 +172,12 @@ extern int my_sigwait(const sigset_t *set,int *sig); #ifdef HAVE_SYNCH_H #include #endif -#if defined(__EMX__) && (!defined(EMX_PTHREAD_REV) || (EMX_PTHREAD_REV < 2)) -#error Requires at least rev 2 of EMX pthreads library. -#endif #ifdef __NETWARE__ void my_pthread_exit(void *status); #define pthread_exit(A) my_pthread_exit(A) #endif -extern int my_pthread_getprio(pthread_t thread_id); - #define pthread_key(T,V) pthread_key_t V #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) @@ -304,21 +195,6 @@ extern int my_pthread_create_detached; #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL #define USE_ALARM_THREAD -#elif defined(HAVE_mit_thread) -#define USE_ALARM_THREAD -#undef HAVE_LOCALTIME_R -#define HAVE_LOCALTIME_R -#undef HAVE_GMTIME_R -#define HAVE_GMTIME_R -#undef HAVE_PTHREAD_ATTR_SETSCOPE -#define HAVE_PTHREAD_ATTR_SETSCOPE -#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE /* If we are running linux */ -#undef HAVE_RWLOCK_T -#undef HAVE_RWLOCK_INIT -#undef HAVE_PTHREAD_RWLOCK_RDLOCK -#undef HAVE_SNPRINTF - -#define my_pthread_attr_setprio(A,B) #endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ #if defined(_BSDI_VERSION) && _BSDI_VERSION < 199910 @@ -333,20 +209,20 @@ int my_sigwait(const sigset_t *set,int *sig); #ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT #ifndef SAFE_MUTEX -#define pthread_mutex_init(a,b) my_pthread_mutex_init((a),(b)) -extern int my_pthread_mutex_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr); +#define pthread_mutex_init(a,b) my_pthread_mutex_noposix_init((a),(b)) +extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp, + const pthread_mutexattr_t *attr); #endif /* SAFE_MUTEX */ -#define pthread_cond_init(a,b) my_pthread_cond_init((a),(b)) -extern int my_pthread_cond_init(pthread_cond_t *mp, - const pthread_condattr_t *attr); +#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b)) +extern int my_pthread_cond_noposix_init(pthread_cond_t *mp, + const pthread_condattr_t *attr); #endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ #if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK) #define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C)) #endif -#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) +#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #endif @@ -373,24 +249,6 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #define my_sigset(A,B) signal((A),(B)) #endif -#ifndef my_pthread_setprio -#if defined(HAVE_PTHREAD_SETPRIO_NP) /* FSU threads */ -#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B)) -#elif defined(HAVE_PTHREAD_SETPRIO) -#define my_pthread_setprio(A,B) pthread_setprio((A),(B)) -#else -extern void my_pthread_setprio(pthread_t thread_id,int prior); -#endif -#endif - -#ifndef my_pthread_attr_setprio -#ifdef HAVE_PTHREAD_ATTR_SETPRIO -#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B)) -#else -extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority); -#endif -#endif - #if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS) #define pthread_attr_setscope(A,B) #undef HAVE_GETHOSTBYADDR_R /* No definition */ @@ -403,15 +261,12 @@ extern int my_pthread_cond_timedwait(pthread_cond_t *cond, #define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) #endif -#if defined(OS2) -#define my_pthread_getspecific(T,A) ((T) &(A)) -#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) -#elif !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC) +#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC) #define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B)) #else #define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) void *my_pthread_getspecific_imp(pthread_key_t key); -#endif /* OS2 */ +#endif #ifndef HAVE_LOCALTIME_R struct tm *localtime_r(const time_t *clock, struct tm *res); @@ -432,34 +287,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #define pthread_key_delete(A) pthread_dummy(0) #endif -#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */ -#define pthread_cond_destroy(A) pthread_dummy(0) -#define pthread_mutex_destroy(A) pthread_dummy(0) -#define pthread_attr_delete(A) pthread_dummy(0) -#define pthread_condattr_delete(A) pthread_dummy(0) -#define pthread_attr_setstacksize(A,B) pthread_dummy(0) -#define pthread_equal(A,B) ((A) == (B)) -#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b)) -#define pthread_attr_init(A) pthread_attr_create(A) -#define pthread_attr_destroy(A) pthread_attr_delete(A) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } -#endif - -#ifdef HAVE_DARWIN5_THREADS -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy(ESRCH) -#define pthread_condattr_init(A) pthread_dummy(0) -#define pthread_condattr_destroy(A) pthread_dummy(0) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } -#endif - -#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) +#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) /* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */ #define pthread_key_create(A,B) \ pthread_keycreate(A,(B) ?\ @@ -472,11 +300,13 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #ifndef pthread_sigmask #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #endif -#define pthread_kill(A,B) pthread_dummy(ESRCH) +#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #undef pthread_detach_this_thread #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ -#define HAVE_PTHREAD_KILL +#ifndef HAVE_PTHREAD_KILL +# define HAVE_PTHREAD_KILL +#endif #endif #endif /* defined(__WIN__) */ @@ -499,64 +329,80 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); int my_pthread_mutex_trylock(pthread_mutex_t *mutex); #endif +#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) +/* no pthread_yield() available */ +#ifdef HAVE_SCHED_YIELD +#define pthread_yield() sched_yield() +#elif defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */ +#define pthread_yield() pthread_yield_np() +#elif defined(HAVE_THR_YIELD) +#define pthread_yield() thr_yield() +#endif +#endif + /* The defines set_timespec and set_timespec_nsec should be used for calculating an absolute time at which pthread_cond_timedwait should timeout */ + +#define set_timespec(ABSTIME,SEC) set_timespec_nsec((ABSTIME),(SEC)*1000000000ULL) + +#ifndef set_timespec_nsec +#define set_timespec_nsec(ABSTIME,NSEC) \ + set_timespec_time_nsec((ABSTIME),my_getsystime(),(NSEC)) +#endif /* !set_timespec_nsec */ + +/* adapt for two different flavors of struct timespec */ #ifdef HAVE_TIMESPEC_TS_SEC -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{ \ - (ABSTIME).ts_sec=time(0) + (time_t) (SEC); \ - (ABSTIME).ts_nsec=0; \ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{ \ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).ts_sec= (now / ULL(10000000)); \ - (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ +#define MY_tv_sec ts_sec +#define MY_tv_nsec ts_nsec #else -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{\ - struct timeval tv;\ - gettimeofday(&tv,0);\ - (ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\ - (ABSTIME).tv_nsec=tv.tv_usec*1000;\ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{\ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \ - (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ +#define MY_tv_sec tv_sec +#define MY_tv_nsec tv_nsec #endif /* HAVE_TIMESPEC_TS_SEC */ - /* safe_mutex adds checking to mutex for easier debugging */ +#ifndef set_timespec_time_nsec +#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \ + ulonglong nsec= (NSEC); \ + ulonglong now= (TIME) + (nsec/100); \ + (ABSTIME).MY_tv_sec= (now / 10000000ULL); \ + (ABSTIME).MY_tv_nsec= (now % 10000000ULL * 100 + (nsec % 100)); \ +} while(0) +#endif /* !set_timespec_time_nsec */ + +/* safe_mutex adds checking to mutex for easier debugging */ #if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY) #define SAFE_MUTEX_DETECT_DESTROY #endif +struct st_hash; typedef struct st_safe_mutex_t { pthread_mutex_t global,mutex; - const char *file; + const char *file, *name; uint line,count; + myf create_flags, active_flags; + ulong id; pthread_t thread; + struct st_hash *locked_mutex, *used_mutex; + struct st_safe_mutex_t *prev, *next; #ifdef SAFE_MUTEX_DETECT_DESTROY struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */ #endif } safe_mutex_t; +typedef struct st_safe_mutex_deadlock_t +{ + const char *file, *name; + safe_mutex_t *mutex; + uint line; + ulong count; + ulong id; + my_bool warning_only; +} safe_mutex_deadlock_t; + #ifdef SAFE_MUTEX_DETECT_DESTROY /* Used to track the destroying of mutexes. This needs to be a seperate @@ -574,8 +420,10 @@ typedef struct st_safe_mutex_info_t #endif /* SAFE_MUTEX_DETECT_DESTROY */ int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, + const char *name, myf my_flags, const char *file, uint line); -int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line); +int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file, + uint line); int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, @@ -584,8 +432,12 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, struct timespec *abstime, const char *file, uint line); void safe_mutex_global_init(void); void safe_mutex_end(FILE *file); +void safe_mutex_free_deadlock_data(safe_mutex_t *mp); /* Wrappers if safe mutex is actually used */ +#define MYF_TRY_LOCK 1 +#define MYF_NO_DEADLOCK_DETECTION 2 + #ifdef SAFE_MUTEX #undef pthread_mutex_init #undef pthread_mutex_lock @@ -597,13 +449,15 @@ void safe_mutex_end(FILE *file); #undef pthread_cond_wait #undef pthread_cond_timedwait #undef pthread_mutex_trylock -#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__) -#define pthread_mutex_lock(A) safe_mutex_lock((A), FALSE, __FILE__, __LINE__) +#define my_pthread_mutex_init(A,B,C,D) safe_mutex_init((A),(B),(C),(D),__FILE__,__LINE__) +#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),#A,0,__FILE__,__LINE__) +#define pthread_mutex_lock(A) safe_mutex_lock((A), 0, __FILE__, __LINE__) +#define my_pthread_mutex_lock(A,B) safe_mutex_lock((A), (B), __FILE__, __LINE__) #define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__) #define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__) #define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__) #define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__) -#define pthread_mutex_trylock(A) safe_mutex_lock((A), TRUE, __FILE__, __LINE__) +#define pthread_mutex_trylock(A) safe_mutex_lock((A), MYF_TRY_LOCK, __FILE__, __LINE__) #define pthread_mutex_t safe_mutex_t #define safe_mutex_assert_owner(mp) \ DBUG_ASSERT((mp)->count > 0 && \ @@ -612,10 +466,45 @@ void safe_mutex_end(FILE *file); DBUG_ASSERT(! (mp)->count || \ ! pthread_equal(pthread_self(), (mp)->thread)) #else +#define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B)) +#define my_pthread_mutex_lock(A,B) pthread_mutex_lock(A) #define safe_mutex_assert_owner(mp) #define safe_mutex_assert_not_owner(mp) #endif /* SAFE_MUTEX */ +#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) +typedef struct st_my_pthread_fastmutex_t +{ + pthread_mutex_t mutex; + uint spins; + uint rng_state; +} my_pthread_fastmutex_t; +void fastmutex_global_init(void); + +int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp, + const pthread_mutexattr_t *attr); +int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); + +#undef pthread_mutex_init +#undef pthread_mutex_lock +#undef pthread_mutex_unlock +#undef pthread_mutex_destroy +#undef pthread_mutex_wait +#undef pthread_mutex_timedwait +#undef pthread_mutex_t +#undef pthread_cond_wait +#undef pthread_cond_timedwait +#undef pthread_mutex_trylock +#define pthread_mutex_init(A,B) my_pthread_fastmutex_init((A),(B)) +#define pthread_mutex_lock(A) my_pthread_fastmutex_lock(A) +#define pthread_mutex_unlock(A) pthread_mutex_unlock(&(A)->mutex) +#define pthread_mutex_destroy(A) pthread_mutex_destroy(&(A)->mutex) +#define pthread_cond_wait(A,B) pthread_cond_wait((A),&(B)->mutex) +#define pthread_cond_timedwait(A,B,C) pthread_cond_timedwait((A),&(B)->mutex,(C)) +#define pthread_mutex_trylock(A) pthread_mutex_trylock(&(A)->mutex) +#define pthread_mutex_t my_pthread_fastmutex_t +#endif /* defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */ + /* READ-WRITE thread locking */ #ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */ @@ -704,13 +593,15 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr; #define ESRCH 1 #endif +typedef ulong my_thread_id; + +extern void my_threadattr_global_init(void); extern my_bool my_thread_global_init(void); extern void my_thread_global_end(void); extern my_bool my_thread_init(void); extern void my_thread_end(void); extern const char *my_thread_name(void); -extern long my_thread_id(void); -extern int pthread_no_free(void *); +extern my_thread_id my_thread_dbug_id(void); extern int pthread_dummy(int); /* All thread specific variables are in the following struct */ @@ -724,10 +615,13 @@ extern int pthread_dummy(int); */ #define DEFAULT_THREAD_STACK (256*1024L) #else -#define DEFAULT_THREAD_STACK (192*1024) +#define DEFAULT_THREAD_STACK (195*1024) #endif #endif +#define MY_PTHREAD_LOCK_READ 0 +#define MY_PTHREAD_LOCK_WRITE 1 + struct st_my_thread_var { int thr_errno; @@ -736,20 +630,26 @@ struct st_my_thread_var pthread_mutex_t * volatile current_mutex; pthread_cond_t * volatile current_cond; pthread_t pthread_self; - long id; + my_thread_id id; int cmp_length; int volatile abort; my_bool init; struct st_my_thread_var *next,**prev; void *opt_info; + uint lock_type; /* used by conditional release the queue */ + void *stack_ends_here; + safe_mutex_t *mutex_in_use; #ifndef DBUG_OFF - gptr dbug; + void *dbug; char name[THREAD_NAME_SIZE+1]; #endif }; extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); +extern void **my_thread_var_dbug(); +extern safe_mutex_t **my_thread_var_mutex_in_use(); extern uint my_thread_end_wait_time; +extern my_bool safe_mutex_deadlock_detector; #define my_thread_var (_my_thread_var()) #define my_errno my_thread_var->thr_errno /* @@ -765,36 +665,70 @@ extern uint my_thread_end_wait_time; extern uint thd_lib_detected; - /* statistics_xxx functions are for not essential statistic */ +/* + thread_safe_xxx functions are for critical statistic or counters. + The implementation is guaranteed to be thread safe, on all platforms. + Note that the calling code should *not* assume the counter is protected + by the mutex given, as the implementation of these helpers may change + to use my_atomic operations instead. +*/ +/* + Warning: + When compiling without threads, this file is not included. + See the *other* declarations of thread_safe_xxx in include/my_global.h + + Second warning: + See include/config-win.h, for yet another implementation. +*/ +#ifdef THREAD #ifndef thread_safe_increment -#ifdef HAVE_ATOMIC_ADD -#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V) -#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V) -#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V) -#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V) -#else #define thread_safe_increment(V,L) \ (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L))) #define thread_safe_decrement(V,L) \ (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L))) -#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) +#endif + +#ifndef thread_safe_add +#define thread_safe_add(V,C,L) \ + (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) #define thread_safe_sub(V,C,L) \ (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L))) -#endif /* HAVE_ATOMIC_ADD */ +#endif +#endif + +/* + statistics_xxx functions are for non critical statistic, + maintained in global variables. + When compiling with SAFE_STATISTICS: + - race conditions can not occur. + - some locking occurs, which may cause performance degradation. + + When compiling without SAFE_STATISTICS: + - race conditions can occur, making the result slightly inaccurate. + - the lock given is not honored. +*/ #ifdef SAFE_STATISTICS -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define statistic_decrement(V,L) thread_safe_decrement((V),(L)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) +#define statistic_increment(V,L) thread_safe_increment((V),(L)) +#define statistic_decrement(V,L) thread_safe_decrement((V),(L)) +#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) +#define statistic_sub(V,C,L) thread_safe_sub((V),(C),(L)) #else #define statistic_decrement(V,L) (V)-- #define statistic_increment(V,L) (V)++ #define statistic_add(V,C,L) (V)+=(C) +#define statistic_sub(V,C,L) (V)-=(C) #endif /* SAFE_STATISTICS */ -#endif /* thread_safe_increment */ + +/* + No locking needed, the counter is owned by the thread +*/ +#define status_var_increment(V) (V)++ +#define status_var_decrement(V) (V)-- +#define status_var_add(V,C) (V)+=(C) +#define status_var_sub(V,C) (V)-=(C) #ifdef __cplusplus } #endif #endif /* _my_ptread_h */ - diff --git a/externals/mysql/my_stacktrace.h b/externals/mysql/my_stacktrace.h new file mode 100644 index 00000000000..e7ce42c1f4f --- /dev/null +++ b/externals/mysql/my_stacktrace.h @@ -0,0 +1,66 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _my_stacktrace_h_ +#define _my_stacktrace_h_ + +#include + +#ifdef TARGET_OS_LINUX +#if defined (__x86_64__) || defined (__i386__) || \ + (defined(__alpha__) && defined(__GNUC__)) +#define HAVE_STACKTRACE 1 +#endif +#elif defined(__WIN__) +#define HAVE_STACKTRACE 1 +#endif + +#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) +#undef HAVE_STACKTRACE +#define HAVE_STACKTRACE 1 +#endif + +#if !defined(__NETWARE__) +#define HAVE_WRITE_CORE +#endif + +#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \ + HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \ + HAVE_WEAK_SYMBOL +#define BACKTRACE_DEMANGLE 1 +#endif + +C_MODE_START + +#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE) +void my_init_stacktrace(); +void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack); +void my_safe_print_str(const char* name, const char* val, int max_len); +void my_write_core(int sig); +#if BACKTRACE_DEMANGLE +char *my_demangle(const char *mangled_name, int *status); +#endif +#ifdef __WIN__ +void my_set_exception_pointers(EXCEPTION_POINTERS *ep); +#endif +#endif + +#ifdef HAVE_WRITE_CORE +void my_write_core(int sig); +#endif + +C_MODE_END + +#endif /* _my_stacktrace_h_ */ diff --git a/dep/include/mysql/my_sys.h b/externals/mysql/my_sys.h similarity index 61% rename from dep/include/mysql/my_sys.h rename to externals/mysql/my_sys.h index cafdf571968..c8ec79165d2 100644 --- a/dep/include/mysql/my_sys.h +++ b/externals/mysql/my_sys.h @@ -13,6 +13,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/** + @file + mysys library API +*/ + #ifndef _my_sys_h #define _my_sys_h C_MODE_START @@ -35,13 +40,21 @@ extern int NEAR my_errno; /* Last error in mysys */ #include #include -#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; } #define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;} #define MY_INIT(name); { my_progname= name; my_init(); } -#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */ -#define NRERRBUFFS (2) /* Buffers for parameters */ -#define MY_FILE_ERROR ((uint) ~0) +/** + Max length of an error message generated by mysys utilities. + Some mysys functions produce error messages. These mostly go + to stderr. + This constant defines the size of the buffer used to format + the message. It should be kept in sync with MYSQL_ERRMSG_SIZE, + since sometimes mysys errors are stored in the server diagnostics + area, and we would like to avoid unexpected truncation. +*/ +#define MYSYS_ERRMSG_SIZE (512) + +#define MY_FILE_ERROR ((size_t) -1) /* General bitmaps for my_func's */ #define MY_FFNF 1 /* Fatal if file not found */ @@ -51,6 +64,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_WME 16 /* Write message on error */ #define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ #define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */ +#define MY_SYNC_DIR 1024 /* my_create/delete/rename: sync directory */ #define MY_RAID 64 /* Support for RAID */ #define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */ #define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ @@ -61,18 +75,24 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */ #define MY_REDEL_MAKE_BACKUP 256 #define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */ -#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */ +#define MY_SHORT_WAIT 64 /* my_lock() don't wait if can't lock */ +#define MY_FORCE_LOCK 128 /* use my_lock() even if disable_locking */ +#define MY_NO_WAIT 256 /* my_lock() don't wait at all */ #define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */ #define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ -#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */ +#define MY_DONT_OVERWRITE_FILE 2048 /* my_copy: Don't overwrite file */ #define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ #define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */ +#define MY_REMOVE_NONE 0 /* Params for modify_defaults_file */ +#define MY_REMOVE_OPTION 1 +#define MY_REMOVE_SECTION 2 + #define ME_HIGHBYTE 8 /* Shift for colours */ #define ME_NOCUR 1 /* Don't use curses message */ #define ME_OLDWIN 2 /* Use old window */ @@ -85,6 +105,9 @@ extern int NEAR my_errno; /* Last error in mysys */ #define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */ #define ME_COLOUR2 ((2 << ME_HIGHBYTE)) #define ME_COLOUR3 ((3 << ME_HIGHBYTE)) +#define ME_FATALERROR 1024 /* Fatal statement error */ +#define ME_JUST_INFO 8192 /**< not error but just info */ +#define ME_JUST_WARNING 16384 /**< not error but just warning */ /* Bits in last argument to fn_format */ #define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */ @@ -95,6 +118,8 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_RETURN_REAL_PATH 32 /* return full path for file */ #define MY_SAFE_PATH 64 /* Return NULL if too long path */ #define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */ +#define MY_APPEND_EXT 256 /* add 'ext' as additional extension*/ + /* My seek flags */ #define MY_SEEK_SET 0 @@ -131,8 +156,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG) #define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) #define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) -#define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE__,__LINE__,C) -#define TRASH(A,B) bfill(A, B, 0x8F) +#define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C) #define QUICK_SAFEMALLOC sf_malloc_quick=1 #define NORMAL_SAFEMALLOC sf_malloc_quick=0 extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; @@ -144,29 +168,40 @@ extern ulonglong sf_malloc_mem_limit; #else #define my_checkmalloc() #undef TERMINATE -#define TERMINATE(A) {} +#define TERMINATE(A,B) {} #define QUICK_SAFEMALLOC #define NORMAL_SAFEMALLOC -extern gptr my_malloc(size_t Size, myf MyFlags); +extern void *my_malloc(size_t Size,myf MyFlags); #define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) -extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); -extern void my_no_flags_free(gptr ptr); -extern gptr my_memdup(const byte *from, size_t length, myf MyFlags); +extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); +extern void my_no_flags_free(void *ptr); +extern void *my_memdup(const void *from,size_t length,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags); -extern char *my_strdup_with_length(const char *from, size_t length, - myf MyFlags); +extern char *my_strndup(const char *from, size_t length, + myf MyFlags); /* we do use FG (as a no-op) in below so that a typo on FG is caught */ #define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) #define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */ -#define TRASH(A,B) /* nothing */ #endif +/* + ERROR INJECTION: Non-thread-safe global variable to request error inject. + Set this variable to non-zero to request the next my_malloc() to fail. + This works with my_malloc.c:my_malloc() and safemalloc.c:_mymalloc(). + If using this in tests, note that the error messages produced by + my_malloc and safemalloc are different. You may need to modify the + results with --replace_regex. You may find examples in + client/backup_stream.c and backup_client_coverage.test. + The global variable is defined in my_static.c. +*/ +IF_DBUG(extern int my_malloc_error_inject); + #ifdef HAVE_LARGE_PAGES extern uint my_get_large_page_size(void); -extern gptr my_large_malloc(size_t size, myf my_flags); -extern void my_large_free(gptr ptr, myf my_flags); +extern uchar * my_large_malloc(size_t size, myf my_flags); +extern void my_large_free(uchar * ptr, myf my_flags); #else #define my_get_large_page_size() (0) #define my_large_malloc(A,B) my_malloc_lock((A),(B)) @@ -191,22 +226,6 @@ extern void my_large_free(gptr ptr, myf my_flags); #define my_afree(PTR) my_free(PTR,MYF(MY_WME)) #endif /* HAVE_ALLOCA */ -#ifdef MSDOS -#ifdef __ZTC__ -void * __CDECL halloc(long count,size_t length); -void __CDECL hfree(void *ptr); -#endif -#if defined(USE_HALLOC) -#if defined(_VCM_) || defined(M_IC80386) -#undef USE_HALLOC -#endif -#endif -#ifdef USE_HALLOC -#define malloc(a) halloc((long) (a),1) -#define free(a) hfree(a) -#endif -#endif /* MSDOS */ - #ifndef errno /* did we already get it? */ #ifdef HAVE_ERRNO_AS_DEFINE #include /* errno is a define */ @@ -214,14 +233,28 @@ void __CDECL hfree(void *ptr); extern int errno; /* declare errno */ #endif #endif /* #ifndef errno */ -extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ extern const char *my_progname; /* program-name (printed in errors) */ +extern const char *my_progname_short; /* like above but without directory */ extern char NEAR curr_dir[]; /* Current directory for user */ -extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); -extern int (*fatal_error_handler_hook)(uint my_err, const char *str, - myf MyFlags); +extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); +extern void (*fatal_error_handler_hook)(uint my_err, const char *str, + myf MyFlags); extern uint my_file_limit; +extern ulong my_thread_stack_size; + +extern const char *(*proc_info_hook)(void *, const char *, const char *, + const char *, const unsigned int); + +#if defined(ENABLED_DEBUG_SYNC) +extern void (*debug_sync_C_callback_ptr)(const char *, size_t); +#define DEBUG_SYNC_C(_sync_point_name_) do { \ + if (debug_sync_C_callback_ptr != NULL) \ + (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \ + while(0) +#else +#define DEBUG_SYNC_C(_sync_point_name_) +#endif /* defined(ENABLED_DEBUG_SYNC) */ #ifdef HAVE_LARGE_PAGES extern my_bool my_use_large_pages; @@ -229,12 +262,14 @@ extern uint my_large_page_size; #endif /* charsets */ -extern CHARSET_INFO *default_charset_info; -extern CHARSET_INFO *all_charsets[256]; +#define MY_ALL_CHARSETS_SIZE 2048 +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]; extern CHARSET_INFO compiled_charsets[]; /* statistics */ extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; +extern ulong my_file_total_opened; extern uint mysys_usage_id; extern my_bool my_init_done; @@ -244,13 +279,13 @@ extern void (*my_sigtstp_cleanup)(void), (*my_sigtstp_restart)(void), (*my_abort_hook)(int); /* Executed when comming from shell */ -extern int NEAR my_umask, /* Default creation mask */ - NEAR my_umask_dir, +extern MYSQL_PLUGIN_IMPORT int NEAR my_umask; /* Default creation mask */ +extern int NEAR my_umask_dir, NEAR my_recived_signals, /* Signals we have got */ NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ NEAR my_dont_interrupt; /* call remember_intr when set */ extern my_bool NEAR mysys_uses_curses, my_use_symdir; -extern ulong sf_malloc_cur_memory, sf_malloc_max_memory; +extern size_t sf_malloc_cur_memory, sf_malloc_max_memory; extern ulong my_default_record_cache_size; extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, @@ -268,7 +303,7 @@ typedef struct wild_file_pack /* Struct to hold info when selecting files */ { uint wilds; /* How many wildcards */ uint not_pos; /* Start of not-theese-files */ - my_string *wild; /* Pointer to wildcards */ + char * *wild; /* Pointer to wildcards */ } WF_PACK; enum loglevel { @@ -285,7 +320,20 @@ enum cache_type enum flush_type { - FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE + FLUSH_KEEP, /* flush block and keep it in the cache */ + FLUSH_RELEASE, /* flush block and remove it from the cache */ + FLUSH_IGNORE_CHANGED, /* remove block from the cache */ + /* + As my_disable_flush_pagecache_blocks is always 0, the following option + is strictly equivalent to FLUSH_KEEP + */ + FLUSH_FORCE_WRITE, + /** + @brief like FLUSH_KEEP but return immediately if file is already being + flushed (even partially) by another thread; only for page cache, + forbidden for key cache. + */ + FLUSH_KEEP_LAZY }; typedef struct st_record_cache /* Used when cacheing records */ @@ -294,7 +342,7 @@ typedef struct st_record_cache /* Used when cacheing records */ int rc_seek,error,inited; uint rc_length,read_length,reclength; my_off_t rc_record_pos,end_of_file; - byte *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos; + uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos; #ifdef HAVE_AIOWAIT int use_async_io; my_aio_result aio_result; @@ -310,9 +358,13 @@ enum file_type struct st_my_file_info { - my_string name; - enum file_type type; -#if defined(THREAD) && !defined(HAVE_PREAD) + char *name; +#ifdef _WIN32 + HANDLE fhandle; /* win32 file handle */ + int oflag; /* open flags, e.g O_APPEND */ +#endif + enum file_type type; +#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32) pthread_mutex_t mutex; #endif }; @@ -321,7 +373,7 @@ extern struct st_my_file_info *my_file_info; typedef struct st_dynamic_array { - char *buffer; + uchar *buffer; uint elements,max_element; uint alloc_increment; uint size_of_element; @@ -340,11 +392,14 @@ typedef struct st_my_tmpdir typedef struct st_dynamic_string { char *str; - uint length,max_length,alloc_increment; + size_t length,max_length,alloc_increment; } DYNAMIC_STRING; struct st_io_cache; -typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); +/** Function called when certain events happen to an IO_CACHE */ +typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache *cache, + const uchar *buffert, uint length, + my_off_t filepos); #ifdef THREAD typedef struct st_io_cache_share @@ -356,8 +411,8 @@ typedef struct st_io_cache_share my_off_t pos_in_file; /* If a synchronized write cache is the source of the data. */ struct st_io_cache *source_cache; - byte *buffer; /* The read buffer. */ - byte *read_end; /* Behind last valid byte of buffer. */ + uchar *buffer; /* The read buffer. */ + uchar *read_end; /* Behind last valid byte of buffer. */ int running_threads; /* threads not in lock. */ int total_threads; /* threads sharing the cache. */ int error; /* Last error. */ @@ -370,7 +425,7 @@ typedef struct st_io_cache_share typedef struct st_io_cache /* Used when cacheing files */ { - /* Offset in file corresponding to the first byte of byte* buffer. */ + /* Offset in file corresponding to the first byte of uchar* buffer. */ my_off_t pos_in_file; /* The offset of end of file for READ_CACHE and WRITE_CACHE. @@ -379,26 +434,26 @@ typedef struct st_io_cache /* Used when cacheing files */ */ my_off_t end_of_file; /* Points to current read position in the buffer */ - byte *read_pos; + uchar *read_pos; /* the non-inclusive boundary in the buffer for the currently valid read */ - byte *read_end; - byte *buffer; /* The read buffer */ + uchar *read_end; + uchar *buffer; /* The read buffer */ /* Used in ASYNC_IO */ - byte *request_pos; + uchar *request_pos; /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */ - byte *write_buffer; + uchar *write_buffer; /* Only used in SEQ_READ_APPEND, and points to the current read position in the write buffer. Note that reads in SEQ_READ_APPEND caches can - happen from both read buffer (byte* buffer) and write buffer - (byte* write_buffer). + happen from both read buffer (uchar* buffer) and write buffer + (uchar* write_buffer). */ - byte *append_read_pos; + uchar *append_read_pos; /* Points to current write position in the write buffer */ - byte *write_pos; + uchar *write_pos; /* The non-inclusive boundary of the valid write area */ - byte *write_end; + uchar *write_end; /* Current_pos and current_end are convenience variables used by @@ -406,7 +461,7 @@ typedef struct st_io_cache /* Used when cacheing files */ current_pos points to &write_pos, and current_end to &write_end in a WRITE_CACHE, and &read_pos and &read_end respectively otherwise */ - byte **current_pos, **current_end; + uchar **current_pos, **current_end; #ifdef THREAD /* The lock is for append buffer used in SEQ_READ_APPEND cache @@ -430,12 +485,12 @@ typedef struct st_io_cache /* Used when cacheing files */ my_b_read() will call read_function to fetch the data. read_function must never be invoked directly. */ - int (*read_function)(struct st_io_cache *,byte *,uint); + int (*read_function)(struct st_io_cache *,uchar *,size_t); /* Same idea as in the case of read_function, except my_b_write() needs to be replaced with my_b_append() for a SEQ_READ_APPEND cache */ - int (*write_function)(struct st_io_cache *,const byte *,uint); + int (*write_function)(struct st_io_cache *,const uchar *,size_t); /* Specifies the type of the cache. Depending on the type of the cache certain operations might not be available and yield unpredicatable @@ -443,21 +498,24 @@ typedef struct st_io_cache /* Used when cacheing files */ */ enum cache_type type; /* - Callbacks when the actual read I/O happens. These were added and - are currently used for binary logging of LOAD DATA INFILE - when a - block is read from the file, we create a block create/append event, and - when IO_CACHE is closed, we create an end event. These functions could, - of course be used for other things + Callbacks were added and are currently used for binary logging of LOAD + DATA INFILE - when a block is read from the file, we create a block + create/append event, and when IO_CACHE is closed, we create an end event; + also used to write the MyISAM WRITE_CACHE blocks to the MyISAM physical + log. These functions could, of course be used for other things. Note: some + callbacks share the same argument ("arg"). */ - IO_CACHE_CALLBACK pre_read; - IO_CACHE_CALLBACK post_read; - IO_CACHE_CALLBACK pre_close; + IO_CACHE_CALLBACK pre_read; /**< called before reading from disk */ + IO_CACHE_CALLBACK post_read; /**< called after reading from disk */ + IO_CACHE_CALLBACK pre_close; /**< called before ending the cache */ + /** Called _after_ writing to disk; not honoured by SEQ_READ_APPEND */ + IO_CACHE_CALLBACK post_write; /* Counts the number of times, when we were forced to use disk. We use it to increase the binlog_cache_disk_use status variable. */ ulong disk_writes; - void* arg; /* for use by pre/post_read */ + void *arg; /**< used by pre/post_read,post_write */ char *file_name; /* if used with 'open_cached_file' */ char *dir,*prefix; File file; /* file descriptor */ @@ -469,10 +527,15 @@ typedef struct st_io_cache /* Used when cacheing files */ partial. */ int seek_not_done,error; + /** + Cumulative 'error' since last [re]init_io_cache(). Useful if cache's user + polls for errors only once in a while. + */ + int hard_write_error_in_the_past; /* buffer_length is memory size allocated for buffer or write_buffer */ - uint buffer_length; + size_t buffer_length; /* read_length is the same as buffer_length except when we use async io */ - uint read_length; + size_t read_length; myf myflags; /* Flags used to my_read/my_write */ /* alloced_buffer is 1 if the buffer was allocated by init_io_cache() and @@ -528,22 +591,23 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); (((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0)) #define my_b_tell(info) ((info)->pos_in_file + \ - (uint) (*(info)->current_pos - (info)->request_pos)) + (size_t) (*(info)->current_pos - (info)->request_pos)) #define my_b_get_buffer_start(info) (info)->request_pos #define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \ (char*) my_b_get_buffer_start(info) #define my_b_get_pos_in_file(info) (info)->pos_in_file - /* tell write offset in the SEQ_APPEND cache */ +int my_b_copy_to_file(IO_CACHE *cache, FILE *file); my_off_t my_b_append_tell(IO_CACHE* info); my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */ -#define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \ +#define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \ *(info)->current_pos) typedef uint32 ha_checksum; +extern ha_checksum my_crc_dbug_check; /* Define the type of function to be passed to process_default_option_files */ typedef int (*Process_option_func)(void *ctx, const char *group_name, @@ -557,23 +621,24 @@ typedef int (*Process_option_func)(void *ctx, const char *group_name, extern int my_copy(const char *from,const char *to,myf MyFlags); extern int my_append(const char *from,const char *to,myf MyFlags); extern int my_delete(const char *name,myf MyFlags); -extern int my_getwd(my_string buf,uint size,myf MyFlags); +extern int my_getwd(char * buf,size_t size,myf MyFlags); extern int my_setwd(const char *dir,myf MyFlags); extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags); -extern gptr my_once_alloc(uint Size,myf MyFlags); +extern void *my_once_alloc(size_t Size,myf MyFlags); extern void my_once_free(void); extern char *my_once_strdup(const char *src,myf myflags); -extern char *my_once_memdup(const char *src, uint len, myf myflags); +extern void *my_once_memdup(const void *src, size_t len, myf myflags); extern File my_open(const char *FileName,int Flags,myf MyFlags); extern File my_register_filename(File fd, const char *FileName, enum file_type type_of_file, uint error_message_number, myf MyFlags); extern File my_create(const char *FileName,int CreateFlags, - int AccsesFlags, myf MyFlags); + int AccessFlags, myf MyFlags); extern int my_close(File Filedes,myf MyFlags); extern File my_dup(File file, myf MyFlags); extern int my_mkdir(const char *dir, int Flags, myf MyFlags); extern int my_readlink(char *to, const char *filename, myf MyFlags); +extern int my_is_symlink(const char *filename); extern int my_realpath(char *to, const char *filename, myf MyFlags); extern File my_create_with_symlink(const char *linkname, const char *filename, int createflags, int access_flags, @@ -581,79 +646,93 @@ extern File my_create_with_symlink(const char *linkname, const char *filename, extern int my_delete_with_symlink(const char *name, myf MyFlags); extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags); extern int my_symlink(const char *content, const char *linkname, myf MyFlags); -extern uint my_read(File Filedes,byte *Buffer,uint Count,myf MyFlags); -extern uint my_pread(File Filedes,byte *Buffer,uint Count,my_off_t offset, +extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags); +extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset, myf MyFlags); extern int my_rename(const char *from,const char *to,myf MyFlags); extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_tell(File fd,myf MyFlags); -extern uint my_write(File Filedes,const byte *Buffer,uint Count, +extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count, myf MyFlags); -extern uint my_pwrite(File Filedes,const byte *Buffer,uint Count, +extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count, my_off_t offset,myf MyFlags); -extern uint my_fread(FILE *stream,byte *Buffer,uint Count,myf MyFlags); -extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count, +extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags); +extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count, myf MyFlags); extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags); -extern gptr _mymalloc(size_t uSize, const char *sFile, +extern void *_mymalloc(size_t uSize,const char *sFile, uint uLine, myf MyFlag); -extern gptr _myrealloc(gptr pPtr, size_t uSize, const char *sFile, - uint uLine, myf MyFlag); -extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...)); -extern void _myfree(gptr pPtr, const char *sFile, uint uLine, myf MyFlag); -extern int _sanity(const char *sFile,unsigned int uLine); -extern gptr _my_memdup(const byte *from, size_t length, - const char *sFile, uint uLine, myf MyFlag); -extern my_string _my_strdup(const char *from, const char *sFile, uint uLine, - myf MyFlag); -extern char *_my_strdup_with_length(const char *from, size_t length, - const char *sFile, uint uLine, - myf MyFlag); +extern void *_myrealloc(void *pPtr,size_t uSize,const char *sFile, + uint uLine, myf MyFlag); +extern void * my_multi_malloc _VARARGS((myf MyFlags, ...)); +extern void _myfree(void *pPtr,const char *sFile,uint uLine, myf MyFlag); +extern int _sanity(const char *sFile, uint uLine); +extern void *_my_memdup(const void *from, size_t length, + const char *sFile, uint uLine,myf MyFlag); +extern char * _my_strdup(const char *from, const char *sFile, uint uLine, + myf MyFlag); +extern char *_my_strndup(const char *from, size_t length, + const char *sFile, uint uLine, + myf MyFlag); /* implemented in my_memmem.c */ extern void *my_memmem(const void *haystack, size_t haystacklen, - const void *needle, size_t needlelen); + const void *needle, size_t needlelen); -#ifdef __WIN__ -extern int my_access(const char *path, int amode); -extern File my_sopen(const char *path, int oflag, int shflag, int pmode); +#ifdef _WIN32 +extern int my_access(const char *path, int amode); #else #define my_access access #endif -extern int check_if_legal_filename(const char *path); -#if defined(__WIN__) && defined(__NT__) +extern int check_if_legal_filename(const char *path); +extern int check_if_legal_tablename(const char *path); + +#ifdef _WIN32 extern int nt_share_delete(const char *name,myf MyFlags); #define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags)) #else #define my_delete_allow_opened(fname,flags) my_delete((fname),(flags)) #endif +#ifdef _WIN32 +/* Windows-only functions (CRT equivalents)*/ +extern File my_sopen(const char *path, int oflag, int shflag, int pmode); +extern HANDLE my_get_osfhandle(File fd); +extern void my_osmaperr(unsigned long last_error); +#endif + #ifndef TERMINATE -extern void TERMINATE(FILE *file); +extern void TERMINATE(FILE *file, uint flag); #endif extern void init_glob_errs(void); +extern void wait_for_free_space(const char *filename, int errors); extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); extern int my_fclose(FILE *fd,myf MyFlags); +extern File my_fileno(FILE *fd); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); +extern int my_chmod(const char *name, mode_t mode, myf my_flags); extern int my_sync(File fd, myf my_flags); -extern int my_error _VARARGS((int nr,myf MyFlags, ...)); -extern int my_printf_error _VARARGS((uint my_err, const char *format, - myf MyFlags, ...)) +extern int my_sync_dir(const char *dir_name, myf my_flags); +extern int my_sync_dir_by_file(const char *file_name, myf my_flags); +extern void my_error _VARARGS((int nr,myf MyFlags, ...)); +extern void my_printf_error _VARARGS((uint my_err, const char *format, + myf MyFlags, ...)) ATTRIBUTE_FORMAT(printf, 2, 4); +extern void my_printv_error(uint error, const char *format, myf MyFlags, + va_list ap); extern int my_error_register(const char **errmsgs, int first, int last); extern const char **my_error_unregister(int first, int last); -extern int my_message(uint my_err, const char *str,myf MyFlags); -extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags); -extern int my_message_curses(uint my_err, const char *str,myf MyFlags); +extern void my_message(uint my_err, const char *str,myf MyFlags); +extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags); extern my_bool my_init(void); extern void my_end(int infoflag); extern int my_redel(const char *from, const char *to, int MyFlags); extern int my_copystat(const char *from, const char *to, int MyFlags); -extern my_string my_filename(File fd); +extern char * my_filename(File fd); #ifndef THREAD extern void dont_break(void); @@ -663,140 +742,160 @@ extern void allow_break(void); #define allow_break() #endif +#ifdef EXTRA_DEBUG +void my_print_open_files(void); +#else +#define my_print_open_files() +#endif + extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); extern char *my_tmpdir(MY_TMPDIR *tmpdir); extern void free_tmpdir(MY_TMPDIR *tmpdir); extern void my_remember_signal(int signal_number,sig_handler (*func)(int)); -extern uint dirname_part(my_string to,const char *name); -extern uint dirname_length(const char *name); +extern size_t dirname_part(char * to,const char *name, size_t *to_res_length); +extern size_t dirname_length(const char *name); #define base_name(A) (A+dirname_length(A)) extern int test_if_hard_path(const char *dir_name); extern my_bool has_path(const char *name); extern char *convert_dirname(char *to, const char *from, const char *from_end); -extern void to_unix_path(my_string name); -extern my_string fn_ext(const char *name); -extern my_string fn_same(my_string toname,const char *name,int flag); -extern my_string fn_format(my_string to,const char *name,const char *dir, +extern void to_unix_path(char * name); +extern char * fn_ext(const char *name); +extern char * fn_same(char * toname,const char *name,int flag); +extern char * fn_format(char * to,const char *name,const char *dir, const char *form, uint flag); -extern size_s strlength(const char *str); -extern void pack_dirname(my_string to,const char *from); -extern uint unpack_dirname(my_string to,const char *from); -extern uint cleanup_dirname(my_string to,const char *from); -extern uint system_filename(my_string to,const char *from); -extern uint unpack_filename(my_string to,const char *from); -extern my_string intern_filename(my_string to,const char *from); -extern my_string directory_file_name(my_string dst, const char *src); -extern int pack_filename(my_string to, const char *name, size_s max_length); -extern my_string my_path(my_string to,const char *progname, +extern size_t strlength(const char *str); +extern void pack_dirname(char * to,const char *from); +extern size_t normalize_dirname(char * to, const char *from); +extern size_t unpack_dirname(char * to,const char *from); +extern size_t cleanup_dirname(char * to,const char *from); +extern size_t system_filename(char * to,const char *from); +extern size_t unpack_filename(char * to,const char *from); +extern char * intern_filename(char * to,const char *from); +extern char * directory_file_name(char * dst, const char *src); +extern int pack_filename(char * to, const char *name, size_t max_length); +extern char * my_path(char * to,const char *progname, const char *own_pathname_part); -extern my_string my_load_path(my_string to, const char *path, +extern char * my_load_path(char * to, const char *path, const char *own_path_prefix); -extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pattern); -extern WF_PACK *wf_comp(my_string str); +extern int wild_compare(const char *str,const char *wildstr, + pbool str_is_pattern); +extern WF_PACK *wf_comp(char * str); extern int wf_test(struct wild_file_pack *wf_pack,const char *name); extern void wf_end(struct wild_file_pack *buffer); -extern size_s strip_sp(my_string str); +extern size_t strip_sp(char * str); extern my_bool array_append_string_unique(const char *str, const char **array, size_t size); -extern void get_date(my_string to,int timeflag,time_t use_time); -extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,pbool remove_garbage); -extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file, - uint reclength,enum cache_type type, +extern void get_date(char * to,int timeflag,time_t use_time); +extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr, + pbool remove_garbage); +extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file, + size_t reclength,enum cache_type type, pbool use_async_io); -extern int read_cache_record(RECORD_CACHE *info,byte *to); +extern int read_cache_record(RECORD_CACHE *info,uchar *to); extern int end_record_cache(RECORD_CACHE *info); extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, - const byte *record,uint length); + const uchar *record,size_t length); extern int flush_write_cache(RECORD_CACHE *info); extern long my_clock(void); extern sig_handler sigtstp_handler(int signal_number); extern void handle_recived_signals(void); extern sig_handler my_set_alarm_variable(int signo); -extern void my_string_ptr_sort(void *base,uint items,size_s size); +extern void my_string_ptr_sort(uchar *base,uint items,size_t size); extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, - size_s size_of_element,uchar *buffer[]); + size_t size_of_element,uchar *buffer[]); extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, qsort_cmp cmp); extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, qsort2_cmp cmp, void *cmp_argument); -extern qsort2_cmp get_ptr_compare(uint); -void my_store_ptr(byte *buff, uint pack_length, my_off_t pos); -my_off_t my_get_ptr(byte *ptr, uint pack_length); -extern int init_io_cache(IO_CACHE *info,File file,uint cachesize, +extern qsort2_cmp get_ptr_compare(size_t); +void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); +my_off_t my_get_ptr(uchar *ptr, size_t pack_length); +extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, enum cache_type type,my_off_t seek_offset, pbool use_async_io, myf cache_myflags); extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, my_off_t seek_offset,pbool use_async_io, pbool clear_cache); extern void setup_io_cache(IO_CACHE* info); -extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count); +extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); #ifdef THREAD -extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count); +extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, IO_CACHE *write_cache, uint num_threads); extern void remove_io_thread(IO_CACHE *info); #endif -extern int _my_b_seq_read(IO_CACHE *info,byte *Buffer,uint Count); -extern int _my_b_net_read(IO_CACHE *info,byte *Buffer,uint Count); +extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count); +extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count); extern int _my_b_get(IO_CACHE *info); -extern int _my_b_async_read(IO_CACHE *info,byte *Buffer,uint Count); -extern int _my_b_write(IO_CACHE *info,const byte *Buffer,uint Count); -extern int my_b_append(IO_CACHE *info,const byte *Buffer,uint Count); -extern int my_b_safe_write(IO_CACHE *info,const byte *Buffer,uint Count); +extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count); +extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count); +extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count); +extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count); -extern int my_block_write(IO_CACHE *info, const byte *Buffer, - uint Count, my_off_t pos); +extern int my_block_write(IO_CACHE *info, const uchar *Buffer, + size_t Count, my_off_t pos); extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock); #define flush_io_cache(info) my_b_flush_io_cache((info),1) extern int end_io_cache(IO_CACHE *info); -extern uint my_b_fill(IO_CACHE *info); +extern size_t my_b_fill(IO_CACHE *info); extern void my_b_seek(IO_CACHE *info,my_off_t pos); -extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length); +extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length); extern my_off_t my_b_filelength(IO_CACHE *info); -extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...); -extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); +extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...); +extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, - const char *prefix, uint cache_size, + const char *prefix, size_t cache_size, myf cache_myflags); extern my_bool real_open_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache); File create_temp_file(char *to, const char *dir, const char *pfx, int mode, myf MyFlags); -#define my_init_dynamic_array(A,B,C,D) init_dynamic_array(A,B,C,D CALLER_INFO) -#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO) +#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D CALLER_INFO) +#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D ORIG_CALLER_INFO) +#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E CALLER_INFO) +#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E ORIG_CALLER_INFO) +extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size, + void *init_buffer, uint init_alloc, + uint alloc_increment + CALLER_INFO_PROTO); +/* init_dynamic_array() function is deprecated */ extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, uint init_alloc,uint alloc_increment CALLER_INFO_PROTO); -extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); -extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); -extern byte *pop_dynamic(DYNAMIC_ARRAY*); -extern my_bool set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index); -extern void get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index); +extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar * element); +extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); +extern uchar *pop_dynamic(DYNAMIC_ARRAY*); +extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index); +extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements); +extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index); extern void delete_dynamic(DYNAMIC_ARRAY *array); extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); extern void freeze_size(DYNAMIC_ARRAY *array); +extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element); #define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element) #define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index)) -#define push_dynamic(A,B) insert_dynamic(A,B) +#define push_dynamic(A,B) insert_dynamic((A),(B)) #define reset_dynamic(array) ((array)->elements= 0) +#define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp)) extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, - uint init_alloc,uint alloc_increment); + size_t init_alloc,size_t alloc_increment); extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, - uint length); + size_t length); extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...); extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); -extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size); +extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size); +extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); extern void dynstr_free(DYNAMIC_STRING *str); #ifdef HAVE_MLOCK -extern byte *my_malloc_lock(uint length,myf flags); -extern void my_free_lock(byte *ptr,myf flags); +extern void *my_malloc_lock(size_t length,myf flags); +extern void my_free_lock(void *ptr,myf flags); #else #define my_malloc_lock(A,B) my_malloc((A),(B)) #define my_free_lock(A,B) my_free((A),(B)) @@ -804,45 +903,62 @@ extern void my_free_lock(byte *ptr,myf flags); #define alloc_root_inited(A) ((A)->min_malloc != 0) #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) #define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0) -extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size, - uint pre_alloc_size); -extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); -extern gptr multi_alloc_root(MEM_ROOT *mem_root, ...); +extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size, + size_t pre_alloc_size); +extern void *alloc_root(MEM_ROOT *mem_root, size_t Size); +extern void *multi_alloc_root(MEM_ROOT *mem_root, ...); extern void free_root(MEM_ROOT *root, myf MyFLAGS); extern void set_prealloc_root(MEM_ROOT *root, char *ptr); -extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, - uint prealloc_size); +extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, + size_t prealloc_size); extern char *strdup_root(MEM_ROOT *root,const char *str); -extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); -extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); +extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len); +extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); extern int get_defaults_options(int argc, char **argv, char **defaults, char **extra_defaults, char **group_suffix); +extern const char *args_separator; +extern int my_load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv, const char ***); extern int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); + int *argc, char ***argv); extern int modify_defaults_file(const char *file_location, const char *option, const char *option_value, const char *section_name, int remove_option); extern int my_search_option_files(const char *conf_file, int *argc, char ***argv, uint *args_used, - Process_option_func func, void *func_ctx); + Process_option_func func, void *func_ctx, + const char **default_directories); extern void free_defaults(char **argv); extern void my_print_default_files(const char *conf_file); extern void print_defaults(const char *conf_file, const char **groups); -extern my_bool my_compress(byte *, ulong *, ulong *); -extern my_bool my_uncompress(byte *, ulong *, ulong *); -extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); -extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count); -extern uint my_bit_log2(ulong value); -extern uint my_count_bits(ulonglong v); -extern uint my_count_bits_ushort(ushort v); +extern my_bool my_compress(uchar *, size_t *, size_t *); +extern my_bool my_uncompress(uchar *, size_t , size_t *); +extern uchar *my_compress_alloc(const uchar *packet, size_t *len, + size_t *complen); +extern int packfrm(uchar *, size_t, uchar **, size_t *); +extern int unpackfrm(uchar **, size_t *, const uchar *); + +extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, + size_t count); +#ifndef DBUG_OFF +extern void my_debug_put_break_here(void); +#else +#define my_debug_put_break_here() do {} while(0) +#endif + extern void my_sleep(ulong m_seconds); extern ulong crc32(ulong crc, const uchar *buf, uint len); extern uint my_set_max_open_files(uint files); void my_free_open_file_info(void); -ulonglong my_getsystime(void); -my_bool my_gethwaddr(uchar *to); +extern time_t my_time(myf flags); +extern ulonglong my_getsystime(void); +extern ulonglong my_micro_time(); +extern ulonglong my_micro_time_and_time(time_t *time_arg); +time_t my_time_possible_from_micro(ulonglong microtime); +extern my_bool my_gethwaddr(uchar *to); +extern int my_getncpus(); #ifdef HAVE_SYS_MMAN_H #include @@ -850,15 +966,24 @@ my_bool my_gethwaddr(uchar *to); #ifndef MAP_NOSYNC #define MAP_NOSYNC 0 #endif +#ifndef MAP_NORESERVE +#define MAP_NORESERVE 0 /* For irix and AIX */ +#endif +#ifdef HAVE_MMAP64 +#define my_mmap(a,b,c,d,e,f) mmap64(a,b,c,d,e,f) +#else #define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f) +#endif #define my_munmap(a,b) munmap((a),(b)) #else /* not a complete set of mmap() flags, but only those that nesessary */ #define PROT_READ 1 #define PROT_WRITE 2 +#define MAP_NORESERVE 0 #define MAP_SHARED 0x0001 +#define MAP_PRIVATE 0x0002 #define MAP_NOSYNC 0x0800 #define MAP_FAILED ((void *)-1) #define MS_SYNC 0x0000 @@ -880,6 +1005,22 @@ int my_getpagesize(void); int my_msync(int, void *, size_t, int); +#define MY_UUID_SIZE 16 +#define MY_UUID_STRING_LENGTH (8+1+4+1+4+1+4+1+12) + +void my_uuid_init(ulong seed1, ulong seed2); +void my_uuid(uchar *guid); +void my_uuid2str(const uchar *guid, char *s); +void my_uuid_end(); + +struct my_rnd_struct { + unsigned long seed1,seed2,max_value; + double max_value_dbl; +}; + +void my_rnd_init(struct my_rnd_struct *rand_st, ulong seed1, ulong seed2); +double my_rnd(struct my_rnd_struct *rand_st); + /* character sets */ extern uint get_charset_number(const char *cs_name, uint cs_flags); extern uint get_collation_number(const char *name); @@ -889,24 +1030,30 @@ extern CHARSET_INFO *get_charset(uint cs_number, myf flags); extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags); -extern CHARSET_INFO *get_compatible_charset_with_ctype(CHARSET_INFO - *original_cs); + +extern my_bool resolve_charset(const char *cs_name, + CHARSET_INFO *default_cs, + CHARSET_INFO **cs); +extern my_bool resolve_collation(const char *cl_name, + CHARSET_INFO *default_cl, + CHARSET_INFO **cl); + extern void free_charsets(void); extern char *get_charsets_dir(char *buf); extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); extern my_bool init_compiled_charsets(myf flags); extern void add_compiled_collation(CHARSET_INFO *cs); -extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, - char *to, ulong to_length, - const char *from, ulong length); +extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info, + char *to, size_t to_length, + const char *from, size_t length); #ifdef __WIN__ #define BACKSLASH_MBTAIL /* File system character set */ extern CHARSET_INFO *fs_character_set(void); #endif -extern ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info, - char *to, ulong to_length, - const char *from, ulong length); +extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, + char *to, size_t to_length, + const char *from, size_t length); extern void thd_increment_bytes_sent(ulong length); extern void thd_increment_bytes_received(ulong length); @@ -923,7 +1070,7 @@ int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, void my_security_attr_free(SECURITY_ATTRIBUTES *sa); /* implemented in my_conio.c */ -char* my_cgets(char *string, unsigned long clen, unsigned long* plen); +char* my_cgets(char *string, size_t clen, size_t* plen); #endif #ifdef __NETWARE__ @@ -932,6 +1079,4 @@ void netware_reg_user(const char *ip, const char *user, #endif C_MODE_END -#include "raid.h" #endif /* _my_sys_h */ - diff --git a/externals/mysql/my_time.h b/externals/mysql/my_time.h new file mode 100644 index 00000000000..58995f1bf62 --- /dev/null +++ b/externals/mysql/my_time.h @@ -0,0 +1,172 @@ +/* Copyright (C) 2004-2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This is a private header of sql-common library, containing + declarations for my_time.c +*/ + +#ifndef _my_time_h_ +#define _my_time_h_ +#include "my_global.h" +#include "mysql_time.h" + +C_MODE_START + +extern ulonglong log_10_int[20]; +extern uchar days_in_month[]; + +/* + Portable time_t replacement. + Should be signed and hold seconds for 1902 -- 2038-01-19 range + i.e at least a 32bit variable + + Using the system built in time_t is not an option as + we rely on the above requirements in the time functions + + For example QNX has an unsigned time_t type +*/ +typedef long my_time_t; + +#define MY_TIME_T_MAX LONG_MAX +#define MY_TIME_T_MIN LONG_MIN + +/* Time handling defaults */ +#define TIMESTAMP_MAX_YEAR 2038 +#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1) +#define TIMESTAMP_MAX_VALUE INT_MAX32 +#define TIMESTAMP_MIN_VALUE 1 + +/* two-digit years < this are 20..; >= this are 19.. */ +#define YY_PART_YEAR 70 + +/* Flags to str_to_datetime */ +#define TIME_FUZZY_DATE 1 +#define TIME_DATETIME_ONLY 2 +/* Must be same as MODE_NO_ZERO_IN_DATE */ +#define TIME_NO_ZERO_IN_DATE (65536L*2*2*2*2*2*2*2) +/* Must be same as MODE_NO_ZERO_DATE */ +#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2) +#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2) + +#define MYSQL_TIME_WARN_TRUNCATED 1 +#define MYSQL_TIME_WARN_OUT_OF_RANGE 2 + +/* Limits for the TIME data type */ +#define TIME_MAX_HOUR 838 +#define TIME_MAX_MINUTE 59 +#define TIME_MAX_SECOND 59 +#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \ + TIME_MAX_SECOND) +#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \ + TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND) + +my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, + ulong flags, int *was_cut); +enum enum_mysql_timestamp_type +str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, + uint flags, int *was_cut); +longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, + uint flags, int *was_cut); +ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong(const MYSQL_TIME *); + + +my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, + int *warning); + +int check_time_range(struct st_mysql_time *, int *warning); + +long calc_daynr(uint year,uint month,uint day); +uint calc_days_in_year(uint year); +uint year_2000_handling(uint year); + +void my_init_time(void); + + +/* + Function to check sanity of a TIMESTAMP value + + DESCRIPTION + Check if a given MYSQL_TIME value fits in TIMESTAMP range. + This function doesn't make precise check, but rather a rough + estimate. + + RETURN VALUES + FALSE The value seems sane + TRUE The MYSQL_TIME value is definitely out of range +*/ + +static inline my_bool validate_timestamp_range(const MYSQL_TIME *t) +{ + if ((t->year > TIMESTAMP_MAX_YEAR || t->year < TIMESTAMP_MIN_YEAR) || + (t->year == TIMESTAMP_MAX_YEAR && (t->month > 1 || t->day > 19)) || + (t->year == TIMESTAMP_MIN_YEAR && (t->month < 12 || t->day < 31))) + return FALSE; + + return TRUE; +} + +my_time_t +my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, + my_bool *in_dst_time_gap); + +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); + +/* + Required buffer length for my_time_to_str, my_date_to_str, + my_datetime_to_str and TIME_to_string functions. Note, that the + caller is still responsible to check that given TIME structure + has values in valid ranges, otherwise size of the buffer could + be not enough. We also rely on the fact that even wrong values + sent using binary protocol fit in this buffer. +*/ +#define MAX_DATE_STRING_REP_LENGTH 30 + +int my_time_to_str(const MYSQL_TIME *l_time, char *to); +int my_date_to_str(const MYSQL_TIME *l_time, char *to); +int my_datetime_to_str(const MYSQL_TIME *l_time, char *to); +int my_TIME_to_str(const MYSQL_TIME *l_time, char *to); + +/* + Available interval types used in any statement. + + 'interval_type' must be sorted so that simple intervals comes first, + ie year, quarter, month, week, day, hour, etc. The order based on + interval size is also important and the intervals should be kept in a + large to smaller order. (get_interval_value() depends on this) + + Note: If you change the order of elements in this enum you should fix + order of elements in 'interval_type_to_name' and 'interval_names' + arrays + + See also interval_type_to_name, get_interval_value, interval_names +*/ + +enum interval_type +{ + INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK, INTERVAL_DAY, + INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_MICROSECOND, + INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE, + INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND, + INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND, + INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST +}; + +C_MODE_END + +#endif /* _my_time_h_ */ diff --git a/externals/mysql/my_tree.h b/externals/mysql/my_tree.h new file mode 100644 index 00000000000..e387b25d431 --- /dev/null +++ b/externals/mysql/my_tree.h @@ -0,0 +1,96 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _tree_h +#define _tree_h +#ifdef __cplusplus +extern "C" { +#endif + +#include "my_base.h" /* get 'enum ha_rkey_function' */ + +/* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */ +#define MAX_TREE_HEIGHT 64 + +#define ELEMENT_KEY(tree,element)\ +(tree->offset_to_key ? (void*)((uchar*) element+tree->offset_to_key) :\ + *((void**) (element+1))) + +#define tree_set_pointer(element,ptr) *((uchar **) (element+1))=((uchar*) (ptr)) + +#define TREE_NO_DUPS 1 + +typedef enum { left_root_right, right_root_left } TREE_WALK; +typedef uint32 element_count; +typedef int (*tree_walk_action)(void *,element_count,void *); + +typedef enum { free_init, free_free, free_end } TREE_FREE; +typedef void (*tree_element_free)(void*, TREE_FREE, void *); + +typedef struct st_tree_element { + struct st_tree_element *left,*right; + uint32 count:31, + colour:1; /* black is marked as 1 */ +} TREE_ELEMENT; + +#define ELEMENT_CHILD(element, offs) (*(TREE_ELEMENT**)((char*)element + offs)) + +typedef struct st_tree { + TREE_ELEMENT *root,null_element; + TREE_ELEMENT **parents[MAX_TREE_HEIGHT]; + uint offset_to_key,elements_in_tree,size_of_element; + ulong memory_limit, allocated; + qsort_cmp2 compare; + void *custom_arg; + MEM_ROOT mem_root; + my_bool with_delete; + tree_element_free free; + uint flag; +} TREE; + + /* Functions on whole tree */ +void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit, + int size, qsort_cmp2 compare, my_bool with_delete, + tree_element_free free_element, void *custom_arg); +void delete_tree(TREE*); +void reset_tree(TREE*); + + /* similar to delete tree, except we do not my_free() blocks in mem_root */ +#define is_tree_inited(tree) ((tree)->root != 0) + + /* Functions on leafs */ +TREE_ELEMENT *tree_insert(TREE *tree,void *key, uint key_size, + void *custom_arg); +void *tree_search(TREE *tree, void *key, void *custom_arg); +int tree_walk(TREE *tree,tree_walk_action action, + void *argument, TREE_WALK visit); +int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg); +void *tree_search_key(TREE *tree, const void *key, + TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos, + enum ha_rkey_function flag, void *custom_arg); +void *tree_search_edge(TREE *tree, TREE_ELEMENT **parents, + TREE_ELEMENT ***last_pos, int child_offs); +void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs, + int r_offs); +ha_rows tree_record_pos(TREE *tree, const void *key, + enum ha_rkey_function search_flag, void *custom_arg); +#define reset_free_element(tree) (tree)->free= 0 + +#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*)) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/externals/mysql/my_trie.h b/externals/mysql/my_trie.h new file mode 100644 index 00000000000..72dd485af04 --- /dev/null +++ b/externals/mysql/my_trie.h @@ -0,0 +1,141 @@ +/* Copyright (C) 2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _trie_h +#define _trie_h +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct st_trie_node +{ + uint16 leaf; /* Depth from root node if match, 0 else */ + uchar c; /* Label on this edge */ + struct st_trie_node *next; /* Next label */ + struct st_trie_node *links; /* Array of edges leaving this node */ + struct st_trie_node *fail; /* AC failure function */ +} TRIE_NODE; + +typedef struct st_trie +{ + TRIE_NODE root; + MEM_ROOT mem_root; + CHARSET_INFO *charset; + uint32 nnodes; + uint32 nwords; +} TRIE; + +typedef struct st_ac_trie_state +{ + TRIE *trie; + TRIE_NODE *node; +} AC_TRIE_STATE; + +extern TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset); +extern void trie_free (TRIE *trie); +extern my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen); +extern my_bool ac_trie_prepare (TRIE *trie); +extern void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state); + + +/* `trie_goto' is internal function and shouldn't be used. */ + +static inline TRIE_NODE *trie_goto (TRIE_NODE *root, TRIE_NODE *node, uchar c) +{ + TRIE_NODE *next; + DBUG_ENTER("trie_goto"); + for (next= node->links; next; next= next->next) + if (next->c == c) + DBUG_RETURN(next); + if (root == node) + DBUG_RETURN(root); + DBUG_RETURN(NULL); +} + + +/* + SYNOPSIS + int ac_trie_next (AC_TRIE_STATE *state, uchar *c); + state - valid pointer to `AC_TRIE_STATE' + c - character to lookup + + DESCRIPTION + Implementation of search using Aho-Corasick automaton. + Performs char-by-char search. + + RETURN VALUE + `ac_trie_next' returns length of matched word or 0. +*/ + +static inline int ac_trie_next (AC_TRIE_STATE *state, uchar *c) +{ + TRIE_NODE *root, *node; + DBUG_ENTER("ac_trie_next"); + DBUG_ASSERT(state && c); + root= &state->trie->root; + node= state->node; + while (! (state->node= trie_goto(root, node, *c))) + node= node->fail; + DBUG_RETURN(state->node->leaf); +} + + +/* + SYNOPSIS + my_bool trie_search (TRIE *trie, const uchar *key, uint keylen); + trie - valid pointer to `TRIE' + key - valid pointer to key to insert + keylen - non-0 key length + + DESCRIPTION + Performs key lookup in trie. + + RETURN VALUE + `trie_search' returns `true' if key is in `trie'. Otherwise, + `false' is returned. + + NOTES + Consecutive search here is "best by test". arrays are very short, so + binary search or hashing would add too much complexity that would + overweight speed gain. Especially because compiler can optimize simple + consecutive loop better (tested) +*/ + +static inline my_bool trie_search (TRIE *trie, const uchar *key, uint keylen) +{ + TRIE_NODE *node; + uint k; + DBUG_ENTER("trie_search"); + DBUG_ASSERT(trie && key && keylen); + node= &trie->root; + + for (k= 0; k < keylen; k++) + { + uchar p; + if (! (node= node->links)) + DBUG_RETURN(FALSE); + p= key[k]; + while (p != node->c) + if (! (node= node->next)) + DBUG_RETURN(FALSE); + } + + DBUG_RETURN(node->leaf > 0); +} + +#ifdef __cplusplus +} +#endif +#endif diff --git a/externals/mysql/my_uctype.h b/externals/mysql/my_uctype.h new file mode 100644 index 00000000000..9aaf478810c --- /dev/null +++ b/externals/mysql/my_uctype.h @@ -0,0 +1,1479 @@ +/* Copyright (C) 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +/* + Unicode ctype data + Generated from UnicodeData-5.0.0d9.txt +*/ +static unsigned char uctype_page00[256]= +{ + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, + 16, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 16, 16, 16, 16, 16, + 16, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 16, 16, 16, 16, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 16, 32, 16, 16, + 16, 16, 20, 20, 16, 2, 16, 16, 16, 20, 2, 16, 20, 20, 20, 16, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static unsigned char uctype_page01[256]= +{ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, + 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, + 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, + 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, + 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, + 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2 +}; + +static unsigned char uctype_page02[256]= +{ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, + 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 16, 16, 16, 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 2, 2, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 +}; + +static unsigned char uctype_page03[256]= +{ + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 2, 2, 2, 2, 16, 0, + 0, 0, 0, 0, 16, 16, 1, 16, 1, 1, 1, 0, 1, 0, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 2, 2, 2, 2, 1, 2, 16, 1, 2, 1, 1, 2, 2, 1, 1, 1 +}; + +static unsigned char uctype_page04[256]= +{ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 16, 18, 18, 18, 18, 0, 18, 18, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 +}; + +static unsigned char uctype_page05[256]= +{ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 16, 16, 16, 16, 16, 16, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 16, 16, 0, 0, 0, 0, 0, + 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 16, 18, + 16, 18, 18, 16, 18, 18, 16, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, + 2, 2, 2, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page06[256]= +{ + 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, + 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 16, 0, 0, 16, 16, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 2, 2, + 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 16, 2, 18, 18, 18, 18, 18, 18, 18, 32, 18, 18, + 18, 18, 18, 18, 18, 2, 2, 18, 18, 16, 18, 18, 18, 18, 2, 2, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 16, 16, 2 +}; + +static unsigned char uctype_page07[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 32, + 2, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 2, 2, 16, 16, 16, 16, 2, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page09[256]= +{ + 0, 18, 18, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, + 2, 18, 18, 18, 18, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 18, 18, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, + 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, + 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, + 18, 18, 18, 18, 18, 0, 0, 18, 18, 0, 0, 18, 18, 18, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 2, 2, 0, 2, + 2, 2, 18, 18, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2, 16, 16, 20, 20, 20, 20, 20, 20, 16, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page0A[256]= +{ + 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 2, + 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 18, 0, 18, 18, + 18, 18, 18, 0, 0, 0, 0, 18, 18, 0, 0, 18, 18, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 18, 18, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, + 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, + 18, 18, 18, 18, 18, 18, 0, 18, 18, 18, 0, 18, 18, 18, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 18, 18, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page0B[256]= +{ + 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, + 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, + 18, 18, 18, 18, 0, 0, 0, 18, 18, 0, 0, 18, 18, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 18, 0, 0, 0, 0, 2, 2, 0, 2, + 2, 2, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 2, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, + 2, 0, 2, 2, 2, 2, 0, 0, 0, 2, 2, 0, 2, 0, 2, 2, + 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, 18, + 18, 18, 18, 0, 0, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 20, 20, 20, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page0C[256]= +{ + 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, + 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, 18, + 18, 18, 18, 18, 18, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, + 0, 0, 0, 0, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, + 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, + 18, 18, 18, 18, 18, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, + 0, 0, 0, 0, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 2, 2, 18, 18, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page0D[256]= +{ + 0, 0, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, + 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, 18, + 18, 18, 18, 18, 0, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 18, 0, 0, 0, 0, 18, + 18, 18, 18, 18, 18, 0, 18, 0, 18, 18, 18, 18, 18, 18, 18, 18, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 18, 18, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page0E[256]= +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 18, 2, 2, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 16, + 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, 18, 18, 18, 16, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 2, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, + 0, 2, 2, 2, 0, 2, 0, 2, 0, 0, 2, 2, 0, 2, 2, 2, + 2, 18, 2, 2, 18, 18, 18, 18, 18, 18, 0, 18, 18, 2, 0, 0, + 2, 2, 2, 2, 2, 0, 2, 0, 18, 18, 18, 18, 18, 18, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 2, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page0F[256]= +{ + 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 16, 16, 16, 16, 16, 16, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 16, 18, 16, 18, 16, 18, 16, 16, 16, 16, 18, 18, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, + 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 16, 18, 18, 2, 2, 2, 2, 0, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 0, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 16, 16, + 16, 16, 16, 16, 16, 16, 18, 16, 16, 16, 16, 16, 16, 0, 0, 16, + 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page10[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 0, 18, 18, 18, 18, + 18, 18, 18, 0, 0, 0, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, + 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 0, 0, 0 +}; + +static unsigned char uctype_page11[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page12[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static unsigned char uctype_page13[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page14[256]= +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static unsigned char uctype_page16[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 2, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 7, 7, + 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page17[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, + 2, 2, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 18, 18, 18, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, + 2, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 32, 32, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 16, 16, 16, 2, 16, 16, 16, 16, 2, 18, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page18[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 8, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page19[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, + 16, 0, 0, 0, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, + 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 2, 2, 2, 2, 2, 2, 2, 18, 18, 0, 0, 0, 0, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 +}; + +static unsigned char uctype_page1A[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, 0, 0, 16, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page1B[256]= +{ + 18, 18, 18, 18, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page1D[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18 +}; + +static unsigned char uctype_page1E[256]= +{ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page1F[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 0, 1, 0, 1, 0, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1, 1, 16, 2, 16, + 16, 16, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1, 1, 16, 16, 16, + 2, 2, 2, 2, 0, 0, 2, 2, 1, 1, 1, 1, 0, 16, 16, 16, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 16, 16, 16, + 0, 0, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1, 1, 16, 16, 0 +}; + +static unsigned char uctype_page20[256]= +{ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 8, 32, 32, 32, 32, 32, 8, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 8, + 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, + 20, 2, 0, 0, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 2, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 0, + 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page21[256]= +{ + 16, 16, 1, 16, 16, 16, 16, 1, 16, 16, 2, 1, 1, 1, 2, 2, + 1, 1, 1, 2, 16, 1, 16, 16, 16, 1, 1, 1, 1, 1, 16, 16, + 16, 16, 16, 16, 1, 16, 1, 16, 1, 16, 1, 1, 1, 1, 16, 2, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 16, 16, 2, 2, 1, 1, + 16, 16, 16, 16, 16, 1, 2, 2, 2, 2, 16, 16, 16, 16, 2, 0, + 0, 0, 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 +}; + +static unsigned char uctype_page23[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page24[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 +}; + +static unsigned char uctype_page26[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page27[256]= +{ + 0, 16, 16, 16, 16, 0, 16, 16, 16, 16, 0, 0, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 0, 16, + 16, 16, 16, 0, 0, 0, 16, 0, 16, 16, 16, 16, 16, 16, 16, 0, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 16, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 +}; + +static unsigned char uctype_page2B[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page2C[256]= +{ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 0, 0, 0, + 0, 0, 0, 0, 2, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 2, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 20, 16, 16 +}; + +static unsigned char uctype_page2D[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page2E[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 16, 16, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_page2F[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0 +}; + +static unsigned char uctype_page30[256]= +{ + 8, 16, 16, 16, 16, 2, 2, 7, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 7, 7, 7, 7, 7, 7, 7, 7, 7, 18, 18, 18, 18, 18, 18, + 16, 2, 2, 2, 2, 2, 16, 16, 7, 7, 7, 2, 2, 16, 16, 16, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 0, 0, 18, 18, 16, 16, 2, 2, 2, + 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2 +}; + +static unsigned char uctype_page31[256]= +{ + 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 16, 16, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static unsigned char uctype_page32[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0 +}; + +static unsigned char uctype_page4D[256]= +{ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 +}; + +static unsigned char uctype_page9F[256]= +{ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageA4[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageA7[256]= +{ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 2, 2, 2, 2, 0, 0, 0, 0, 0, + 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageA8[256]= +{ + 2, 2, 18, 2, 2, 2, 18, 2, 2, 2, 2, 18, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 18, 18, 18, 18, 18, 16, 16, 16, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageD7[256]= +{ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageD8[256]= +{ + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageDB[256]= +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 +}; + +static unsigned char uctype_pageDC[256]= +{ + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageDF[256]= +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 +}; + +static unsigned char uctype_pageE0[256]= +{ + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageF8[256]= +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 +}; + +static unsigned char uctype_pageFA[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static unsigned char uctype_pageFB[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 18, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 0, + 2, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static unsigned char uctype_pageFD[256]= +{ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 0, 0 +}; + +static unsigned char uctype_pageFE[256]= +{ + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, + 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 32 +}; + +static unsigned char uctype_pageFF[256]= +{ + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, + 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, + 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 16, 16, 0, 0 +}; + +MY_UNI_CTYPE my_uni_ctype[256]={ + {0,uctype_page00}, + {0,uctype_page01}, + {0,uctype_page02}, + {0,uctype_page03}, + {0,uctype_page04}, + {0,uctype_page05}, + {0,uctype_page06}, + {0,uctype_page07}, + {0,NULL}, + {0,uctype_page09}, + {0,uctype_page0A}, + {0,uctype_page0B}, + {0,uctype_page0C}, + {0,uctype_page0D}, + {0,uctype_page0E}, + {0,uctype_page0F}, + {0,uctype_page10}, + {0,uctype_page11}, + {0,uctype_page12}, + {0,uctype_page13}, + {0,uctype_page14}, + {2,NULL}, + {0,uctype_page16}, + {0,uctype_page17}, + {0,uctype_page18}, + {0,uctype_page19}, + {0,uctype_page1A}, + {0,uctype_page1B}, + {0,NULL}, + {0,uctype_page1D}, + {0,uctype_page1E}, + {0,uctype_page1F}, + {0,uctype_page20}, + {0,uctype_page21}, + {16,NULL}, + {0,uctype_page23}, + {0,uctype_page24}, + {16,NULL}, + {0,uctype_page26}, + {0,uctype_page27}, + {16,NULL}, + {16,NULL}, + {16,NULL}, + {0,uctype_page2B}, + {0,uctype_page2C}, + {0,uctype_page2D}, + {0,uctype_page2E}, + {0,uctype_page2F}, + {0,uctype_page30}, + {0,uctype_page31}, + {0,uctype_page32}, + {16,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {0,uctype_page4D}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {0,uctype_page9F}, + {2,NULL}, + {2,NULL}, + {2,NULL}, + {2,NULL}, + {0,uctype_pageA4}, + {0,NULL}, + {0,NULL}, + {0,uctype_pageA7}, + {0,uctype_pageA8}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {3,NULL}, + {0,uctype_pageD7}, + {0,uctype_pageD8}, + {0,NULL}, + {0,NULL}, + {0,uctype_pageDB}, + {0,uctype_pageDC}, + {0,NULL}, + {0,NULL}, + {0,uctype_pageDF}, + {0,uctype_pageE0}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,NULL}, + {0,uctype_pageF8}, + {2,NULL}, + {0,uctype_pageFA}, + {0,uctype_pageFB}, + {2,NULL}, + {0,uctype_pageFD}, + {0,uctype_pageFE}, + {0,uctype_pageFF} +}; + + diff --git a/externals/mysql/my_vle.h b/externals/mysql/my_vle.h new file mode 100644 index 00000000000..c09f82229c4 --- /dev/null +++ b/externals/mysql/my_vle.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2005 MySQL AB + + 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 the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef VLE_H +#define VLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "my_global.h" + +/* + The size (in bytes) required to store the object ITEM, which can be + either an expression or a type (since sizeof() is used on the item). +*/ +#define my_vle_sizeof(ITEM) (((sizeof(ITEM) * CHAR_BIT) + 6) / 7) + +uchar *my_vle_encode(uchar *vle, size_t max, ulong value); +uchar const *my_vle_decode(ulong *value_ptr, uchar const *vle); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/externals/mysql/my_xml.h b/externals/mysql/my_xml.h new file mode 100644 index 00000000000..6a453ee90be --- /dev/null +++ b/externals/mysql/my_xml.h @@ -0,0 +1,89 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#ifndef _my_xml_h +#define _my_xml_h + +#ifdef __cplusplus +extern "C" { +#endif + + +#define MY_XML_OK 0 +#define MY_XML_ERROR 1 + +/* + A flag whether to use absolute tag names in call-back functions, + like "a", "a.b" and "a.b.c" (used in character set file parser), + or relative names like "a", "b" and "c". +*/ +#define MY_XML_FLAG_RELATIVE_NAMES 1 + +/* + A flag whether to skip normilization of text values before calling + call-back functions: i.e. skip leading/trailing spaces, + \r, \n, \t characters. +*/ +#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2 + +enum my_xml_node_type +{ + MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */ + MY_XML_NODE_ATTR, /* can have TEXT children */ + MY_XML_NODE_TEXT /* cannot have children */ +}; + +typedef struct xml_stack_st +{ + int flags; + enum my_xml_node_type current_node_type; + char errstr[128]; + char attr[128]; + char *attrend; + const char *beg; + const char *cur; + const char *end; + void *user_data; + int (*enter)(struct xml_stack_st *st,const char *val, size_t len); + int (*value)(struct xml_stack_st *st,const char *val, size_t len); + int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len); +} MY_XML_PARSER; + +void my_xml_parser_create(MY_XML_PARSER *st); +void my_xml_parser_free(MY_XML_PARSER *st); +int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len); + +void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, + const char *, + size_t len)); +void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, + const char *, + size_t len)); +void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, + const char *, + size_t len)); +void my_xml_set_user_data(MY_XML_PARSER *st, void *); + +size_t my_xml_error_pos(MY_XML_PARSER *st); +uint my_xml_error_lineno(MY_XML_PARSER *st); + +const char *my_xml_error_string(MY_XML_PARSER *st); + +#ifdef __cplusplus +} +#endif + +#endif /* _my_xml_h */ diff --git a/externals/mysql/myisampack.h b/externals/mysql/myisampack.h new file mode 100644 index 00000000000..34a085e4e5a --- /dev/null +++ b/externals/mysql/myisampack.h @@ -0,0 +1,238 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Storing of values in high byte first order. + + integer keys and file pointers are stored with high byte first to get + better compression +*/ + +/* these two are for uniformity */ +#define mi_sint1korr(A) ((int8)(*A)) +#define mi_uint1korr(A) ((uint8)(*A)) + +#define mi_sint2korr(A) ((int16) (((int16) (((const uchar*) (A))[1])) +\ + ((int16) ((int16) ((const char*) (A))[0]) << 8))) +#define mi_sint3korr(A) ((int32) (((((const uchar*) (A))[0]) & 128) ? \ + (((uint32) 255L << 24) | \ + (((uint32) ((const uchar*) (A))[0]) << 16) |\ + (((uint32) ((const uchar*) (A))[1]) << 8) | \ + ((uint32) ((const uchar*) (A))[2])) : \ + (((uint32) ((const uchar*) (A))[0]) << 16) |\ + (((uint32) ((const uchar*) (A))[1]) << 8) | \ + ((uint32) ((const uchar*) (A))[2]))) +#define mi_sint4korr(A) ((int32) (((int32) (((const uchar*) (A))[3])) +\ + ((int32) (((const uchar*) (A))[2]) << 8) +\ + ((int32) (((const uchar*) (A))[1]) << 16) +\ + ((int32) ((int16) ((const char*) (A))[0]) << 24))) +#define mi_sint8korr(A) ((longlong) mi_uint8korr(A)) +#define mi_uint2korr(A) ((uint16) (((uint16) (((const uchar*) (A))[1])) +\ + ((uint16) (((const uchar*) (A))[0]) << 8))) +#define mi_uint3korr(A) ((uint32) (((uint32) (((const uchar*) (A))[2])) +\ + (((uint32) (((const uchar*) (A))[1])) << 8) +\ + (((uint32) (((const uchar*) (A))[0])) << 16))) +#define mi_uint4korr(A) ((uint32) (((uint32) (((const uchar*) (A))[3])) +\ + (((uint32) (((const uchar*) (A))[2])) << 8) +\ + (((uint32) (((const uchar*) (A))[1])) << 16) +\ + (((uint32) (((const uchar*) (A))[0])) << 24))) +#define mi_uint5korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[4])) +\ + (((uint32) (((const uchar*) (A))[3])) << 8) +\ + (((uint32) (((const uchar*) (A))[2])) << 16) +\ + (((uint32) (((const uchar*) (A))[1])) << 24)) +\ + (((ulonglong) (((const uchar*) (A))[0])) << 32)) +#define mi_uint6korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[5])) +\ + (((uint32) (((const uchar*) (A))[4])) << 8) +\ + (((uint32) (((const uchar*) (A))[3])) << 16) +\ + (((uint32) (((const uchar*) (A))[2])) << 24)) +\ + (((ulonglong) (((uint32) (((const uchar*) (A))[1])) +\ + (((uint32) (((const uchar*) (A))[0]) << 8)))) <<\ + 32)) +#define mi_uint7korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[6])) +\ + (((uint32) (((const uchar*) (A))[5])) << 8) +\ + (((uint32) (((const uchar*) (A))[4])) << 16) +\ + (((uint32) (((const uchar*) (A))[3])) << 24)) +\ + (((ulonglong) (((uint32) (((const uchar*) (A))[2])) +\ + (((uint32) (((const uchar*) (A))[1])) << 8) +\ + (((uint32) (((const uchar*) (A))[0])) << 16))) <<\ + 32)) +#define mi_uint8korr(A) ((ulonglong)(((uint32) (((const uchar*) (A))[7])) +\ + (((uint32) (((const uchar*) (A))[6])) << 8) +\ + (((uint32) (((const uchar*) (A))[5])) << 16) +\ + (((uint32) (((const uchar*) (A))[4])) << 24)) +\ + (((ulonglong) (((uint32) (((const uchar*) (A))[3])) +\ + (((uint32) (((const uchar*) (A))[2])) << 8) +\ + (((uint32) (((const uchar*) (A))[1])) << 16) +\ + (((uint32) (((const uchar*) (A))[0])) << 24))) <<\ + 32)) + +/* This one is for uniformity */ +#define mi_int1store(T,A) *((uchar*)(T))= (uchar) (A) + +#define mi_int2store(T,A) { uint def_temp= (uint) (A) ;\ + ((uchar*) (T))[1]= (uchar) (def_temp);\ + ((uchar*) (T))[0]= (uchar) (def_temp >> 8); } +#define mi_int3store(T,A) { /*lint -save -e734 */\ + ulong def_temp= (ulong) (A);\ + ((uchar*) (T))[2]= (uchar) (def_temp);\ + ((uchar*) (T))[1]= (uchar) (def_temp >> 8);\ + ((uchar*) (T))[0]= (uchar) (def_temp >> 16);\ + /*lint -restore */} +#define mi_int4store(T,A) { ulong def_temp= (ulong) (A);\ + ((uchar*) (T))[3]= (uchar) (def_temp);\ + ((uchar*) (T))[2]= (uchar) (def_temp >> 8);\ + ((uchar*) (T))[1]= (uchar) (def_temp >> 16);\ + ((uchar*) (T))[0]= (uchar) (def_temp >> 24); } +#define mi_int5store(T,A) { ulong def_temp= (ulong) (A),\ + def_temp2= (ulong) ((A) >> 32);\ + ((uchar*) (T))[4]= (uchar) (def_temp);\ + ((uchar*) (T))[3]= (uchar) (def_temp >> 8);\ + ((uchar*) (T))[2]= (uchar) (def_temp >> 16);\ + ((uchar*) (T))[1]= (uchar) (def_temp >> 24);\ + ((uchar*) (T))[0]= (uchar) (def_temp2); } +#define mi_int6store(T,A) { ulong def_temp= (ulong) (A),\ + def_temp2= (ulong) ((A) >> 32);\ + ((uchar*) (T))[5]= (uchar) (def_temp);\ + ((uchar*) (T))[4]= (uchar) (def_temp >> 8);\ + ((uchar*) (T))[3]= (uchar) (def_temp >> 16);\ + ((uchar*) (T))[2]= (uchar) (def_temp >> 24);\ + ((uchar*) (T))[1]= (uchar) (def_temp2);\ + ((uchar*) (T))[0]= (uchar) (def_temp2 >> 8); } +#define mi_int7store(T,A) { ulong def_temp= (ulong) (A),\ + def_temp2= (ulong) ((A) >> 32);\ + ((uchar*) (T))[6]= (uchar) (def_temp);\ + ((uchar*) (T))[5]= (uchar) (def_temp >> 8);\ + ((uchar*) (T))[4]= (uchar) (def_temp >> 16);\ + ((uchar*) (T))[3]= (uchar) (def_temp >> 24);\ + ((uchar*) (T))[2]= (uchar) (def_temp2);\ + ((uchar*) (T))[1]= (uchar) (def_temp2 >> 8);\ + ((uchar*) (T))[0]= (uchar) (def_temp2 >> 16); } +#define mi_int8store(T,A) { ulong def_temp3= (ulong) (A),\ + def_temp4= (ulong) ((A) >> 32);\ + mi_int4store((uchar*) (T) + 0, def_temp4);\ + mi_int4store((uchar*) (T) + 4, def_temp3); } + +#ifdef WORDS_BIGENDIAN + +#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[0];\ + ((uchar*) (T))[1]= ((uchar*) &A)[1];\ + ((uchar*) (T))[2]= ((uchar*) &A)[2];\ + ((uchar*) (T))[3]= ((uchar*) &A)[3]; } + +#define mi_float4get(V,M) { float def_temp;\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[1]; \ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\ + (V)= def_temp; } + +#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[0];\ + ((uchar*) (T))[1]= ((const uchar*) &V)[1];\ + ((uchar*) (T))[2]= ((const uchar*) &V)[2];\ + ((uchar*) (T))[3]= ((const uchar*) &V)[3];\ + ((uchar*) (T))[4]= ((const uchar*) &V)[4];\ + ((uchar*) (T))[5]= ((const uchar*) &V)[5];\ + ((uchar*) (T))[6]= ((const uchar*) &V)[6];\ + ((uchar*) (T))[7]= ((const uchar*) &V)[7]; } + +#define mi_float8get(V,M) { double def_temp;\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[0];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[4]= ((const uchar*) (M))[4];\ + ((uchar*) &def_temp)[5]= ((const uchar*) (M))[5];\ + ((uchar*) &def_temp)[6]= ((const uchar*) (M))[6];\ + ((uchar*) &def_temp)[7]= ((const uchar*) (M))[7]; \ + (V)= def_temp; } +#else + +#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((const uchar*) &A)[3];\ + ((uchar*) (T))[1]= ((const uchar*) &A)[2];\ + ((uchar*) (T))[2]= ((const uchar*) &A)[1];\ + ((uchar*) (T))[3]= ((const uchar*) &A)[0]; } + +#define mi_float4get(V,M) { float def_temp;\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[0];\ + (V)= def_temp; } + +#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) +#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[3];\ + ((uchar*) (T))[1]= ((const uchar*) &V)[2];\ + ((uchar*) (T))[2]= ((const uchar*) &V)[1];\ + ((uchar*) (T))[3]= ((const uchar*) &V)[0];\ + ((uchar*) (T))[4]= ((const uchar*) &V)[7];\ + ((uchar*) (T))[5]= ((const uchar*) &V)[6];\ + ((uchar*) (T))[6]= ((const uchar*) &V)[5];\ + ((uchar*) (T))[7]= ((const uchar*) &V)[4];} + +#define mi_float8get(V,M) { double def_temp;\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[0];\ + ((uchar*) &def_temp)[4]= ((const uchar*) (M))[7];\ + ((uchar*) &def_temp)[5]= ((const uchar*) (M))[6];\ + ((uchar*) &def_temp)[6]= ((const uchar*) (M))[5];\ + ((uchar*) &def_temp)[7]= ((const uchar*) (M))[4];\ + (V)= def_temp; } + +#else +#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((const uchar*) &V)[7];\ + ((uchar*) (T))[1]= ((const uchar*) &V)[6];\ + ((uchar*) (T))[2]= ((const uchar*) &V)[5];\ + ((uchar*) (T))[3]= ((const uchar*) &V)[4];\ + ((uchar*) (T))[4]= ((const uchar*) &V)[3];\ + ((uchar*) (T))[5]= ((const uchar*) &V)[2];\ + ((uchar*) (T))[6]= ((const uchar*) &V)[1];\ + ((uchar*) (T))[7]= ((const uchar*) &V)[0];} + +#define mi_float8get(V,M) { double def_temp;\ + ((uchar*) &def_temp)[0]= ((const uchar*) (M))[7];\ + ((uchar*) &def_temp)[1]= ((const uchar*) (M))[6];\ + ((uchar*) &def_temp)[2]= ((const uchar*) (M))[5];\ + ((uchar*) &def_temp)[3]= ((const uchar*) (M))[4];\ + ((uchar*) &def_temp)[4]= ((const uchar*) (M))[3];\ + ((uchar*) &def_temp)[5]= ((const uchar*) (M))[2];\ + ((uchar*) &def_temp)[6]= ((const uchar*) (M))[1];\ + ((uchar*) &def_temp)[7]= ((const uchar*) (M))[0];\ + (V)= def_temp; } +#endif /* __FLOAT_WORD_ORDER */ +#endif /* WORDS_BIGENDIAN */ + +/* Fix to avoid warnings when sizeof(ha_rows) == sizeof(long) */ + +#ifdef BIG_TABLES +#define mi_rowstore(T,A) mi_int8store(T, A) +#define mi_rowkorr(T) mi_uint8korr(T) +#else +#define mi_rowstore(T,A) { mi_int4store(T, 0);\ + mi_int4store(((uchar*) (T) + 4), A); } +#define mi_rowkorr(T) mi_uint4korr((const uchar*) (T) + 4) +#endif + +#if SIZEOF_OFF_T > 4 +#define mi_sizestore(T,A) mi_int8store(T, A) +#define mi_sizekorr(T) mi_uint8korr(T) +#else +#define mi_sizestore(T,A) { if ((A) == HA_OFFSET_ERROR)\ + bfill((char*) (T), 8, 255);\ + else { mi_int4store((T), 0);\ + mi_int4store(((T) + 4), A); }} +#define mi_sizekorr(T) mi_uint4korr((const uchar*) (T) + 4) +#endif diff --git a/dep/include/mysql/mysql.h b/externals/mysql/mysql.h similarity index 63% rename from dep/include/mysql/mysql.h rename to externals/mysql/mysql.h index 4d4a3eb67c9..88333c4a723 100644 --- a/dep/include/mysql/mysql.h +++ b/externals/mysql/mysql.h @@ -39,14 +39,14 @@ #undef __WIN__ #endif -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -#ifndef _global_h /* If not standard header */ +#ifndef _global_h /* If not standard header */ #include #ifdef __LCC__ -#include /* For windows */ +#include /* For windows */ #endif typedef char my_bool; #if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) @@ -57,7 +57,6 @@ typedef char my_bool; #else #define STDCALL __stdcall #endif -typedef char * gptr; #ifndef my_socket_defined #ifdef __WIN__ @@ -71,32 +70,25 @@ typedef int my_socket; #include "mysql_version.h" #include "mysql_com.h" #include "mysql_time.h" -#include "typelib.h" #include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ extern unsigned int mysql_port; extern char *mysql_unix_port; -#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */ -#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ +#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */ +#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ #ifdef __NETWARE__ -// GCC have alternative #pragma pack(8) syntax and old gcc version not support pack(push,8), also any gcc version not support it at some paltform -#if defined( __GNUC__ ) -#pragma pack(8) -#else -#pragma pack(push,8) +#pragma pack(push, 8) /* 8 byte alignment */ #endif -#endif - -#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) -#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) -#define IS_BLOB(n) ((n) & BLOB_FLAG) -#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL) -#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) -#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR) +#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) +#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) +#define IS_BLOB(n) ((n) & BLOB_FLAG) +#define IS_NUM(t) ((t) <= MYSQL_TYPE_INT24 || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) +#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) +#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR) #define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) @@ -106,7 +98,7 @@ typedef struct st_mysql_field { char *table; /* Table of column if column was a field */ char *org_table; /* Org table name, if table was an alias */ char *db; /* Database for table */ - char *catalog; /* Catalog for table */ + char *catalog; /* Catalog for table */ char *def; /* Default value (set by mysql_list_fields) */ unsigned long length; /* Width of column (create length) */ unsigned long max_length; /* Max width for selected set */ @@ -121,9 +113,10 @@ typedef struct st_mysql_field { unsigned int decimals; /* Number of decimals in field */ unsigned int charsetnr; /* Character set */ enum enum_field_types type; /* Type of field. See mysql_com.h for types */ + void *extension; } MYSQL_FIELD; -typedef char **MYSQL_ROW; /* return data as array of strings */ +typedef char **MYSQL_ROW; /* return data as array of strings */ typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ #ifndef _global_h @@ -136,32 +129,35 @@ typedef unsigned long long my_ulonglong; #endif #endif +#include "typelib.h" + #define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) /* backward compatibility define - to be removed eventually */ #define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED typedef struct st_mysql_rows { - struct st_mysql_rows *next; /* list of rows */ + struct st_mysql_rows *next; /* list of rows */ MYSQL_ROW data; unsigned long length; } MYSQL_ROWS; -typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ +typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ #include "my_alloc.h" typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; typedef struct st_mysql_data { + MYSQL_ROWS *data; + struct embedded_query_result *embedded_info; + MEM_ROOT alloc; my_ulonglong rows; unsigned int fields; - MYSQL_ROWS *data; - MEM_ROOT alloc; /* extra info for embedded library */ - struct embedded_query_result *embedded_info; + void *extension; } MYSQL_DATA; -enum mysql_option +enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, @@ -181,33 +177,19 @@ struct st_mysql_options { char *host,*user,*password,*unix_socket,*db; struct st_dynamic_array *init_commands; char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; - char *ssl_key; /* PEM key file */ - char *ssl_cert; /* PEM cert file */ - char *ssl_ca; /* PEM CA file */ - char *ssl_capath; /* PEM directory of CA-s? */ - char *ssl_cipher; /* cipher to use */ + char *ssl_key; /* PEM key file */ + char *ssl_cert; /* PEM cert file */ + char *ssl_ca; /* PEM CA file */ + char *ssl_capath; /* PEM directory of CA-s? */ + char *ssl_cipher; /* cipher to use */ char *shared_memory_base_name; unsigned long max_allowed_packet; - my_bool use_ssl; /* if to use SSL or not */ + my_bool use_ssl; /* if to use SSL or not */ my_bool compress,named_pipe; - /* - On connect, find out the replication role of the server, and - establish connections to all the peers - */ - my_bool rpl_probe; - /* - Each call to mysql_real_query() will parse it to tell if it is a read - or a write, and direct it to the slave or the master - */ - my_bool rpl_parse; - /* - If set, never read from a master, only from slave, when doing - a read that is replication-aware - */ - my_bool no_master_reads; -#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY) - my_bool separate_thread; -#endif + my_bool unused1; + my_bool unused2; + my_bool unused3; + my_bool unused4; enum mysql_option methods_to_use; char *client_ip; /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */ @@ -221,27 +203,19 @@ struct st_mysql_options { void (*local_infile_end)(void *); int (*local_infile_error)(void *, char *, unsigned int); void *local_infile_userdata; + void *extension; }; -enum mysql_status +enum mysql_status { MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT }; -enum mysql_protocol_type +enum mysql_protocol_type { MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; -/* - There are three types of queries - the ones that have to go to - the master, the ones that go to a slave, and the adminstrative - type which must happen on the pivot connectioin -*/ -enum mysql_rpl_type -{ - MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN -}; typedef struct character_set { @@ -260,111 +234,78 @@ struct st_mysql_stmt; typedef struct st_mysql { - NET net; /* Communication parameters */ - gptr connector_fd; /* ConnectorFd for SSL */ - char *host,*user,*passwd,*unix_socket,*server_version,*host_info,*info; - char *db; + NET net; /* Communication parameters */ + unsigned char *connector_fd; /* ConnectorFd for SSL */ + char *host,*user,*passwd,*unix_socket,*server_version,*host_info; + char *info, *db; struct charset_info_st *charset; - MYSQL_FIELD *fields; - MEM_ROOT field_alloc; + MYSQL_FIELD *fields; + MEM_ROOT field_alloc; my_ulonglong affected_rows; - my_ulonglong insert_id; /* id if insert on table with NEXTNR */ - my_ulonglong extra_info; /* Not used */ - unsigned long thread_id; /* Id for connection in server */ + my_ulonglong insert_id; /* id if insert on table with NEXTNR */ + my_ulonglong extra_info; /* Not used */ + unsigned long thread_id; /* Id for connection in server */ unsigned long packet_length; - unsigned int port; + unsigned int port; unsigned long client_flag,server_capabilities; - unsigned int protocol_version; - unsigned int field_count; - unsigned int server_status; + unsigned int protocol_version; + unsigned int field_count; + unsigned int server_status; unsigned int server_language; - unsigned int warning_count; + unsigned int warning_count; struct st_mysql_options options; enum mysql_status status; - my_bool free_me; /* If free in mysql_close */ - my_bool reconnect; /* set to 1 if automatic reconnect */ + my_bool free_me; /* If free in mysql_close */ + my_bool reconnect; /* set to 1 if automatic reconnect */ /* session-wide random string */ - char scramble[SCRAMBLE_LENGTH+1]; - - /* - Set if this is the original connection, not a master or a slave we have - added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave() - */ - my_bool rpl_pivot; - /* - Pointers to the master, and the next slave connections, points to - itself if lone connection. - */ - struct st_mysql* master, *next_slave; - - struct st_mysql* last_used_slave; /* needed for round-robin slave pick */ - /* needed for send/read/store/use result to work correctly with replication */ - struct st_mysql* last_used_con; + char scramble[SCRAMBLE_LENGTH+1]; + my_bool unused1; + void *unused2, *unused3, *unused4, *unused5; LIST *stmts; /* list of all statements */ const struct st_mysql_methods *methods; void *thd; /* - Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag + Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag from mysql_stmt_close if close had to cancel result set of this object. */ my_bool *unbuffered_fetch_owner; -#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100 /* needed for embedded server - no net buffer to store the 'info' */ char *info_buffer; -#endif + void *extension; } MYSQL; + typedef struct st_mysql_res { - my_ulonglong row_count; - MYSQL_FIELD *fields; - MYSQL_DATA *data; - MYSQL_ROWS *data_cursor; - unsigned long *lengths; /* column lengths of current row */ - MYSQL *handle; /* for unbuffered reads */ - MEM_ROOT field_alloc; - unsigned int field_count, current_field; - MYSQL_ROW row; /* If unbuffered read */ - MYSQL_ROW current_row; /* buffer to current row */ - my_bool eof; /* Used by mysql_fetch_row */ - /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; + my_ulonglong row_count; + MYSQL_FIELD *fields; + MYSQL_DATA *data; + MYSQL_ROWS *data_cursor; + unsigned long *lengths; /* column lengths of current row */ + MYSQL *handle; /* for unbuffered reads */ const struct st_mysql_methods *methods; + MYSQL_ROW row; /* If unbuffered read */ + MYSQL_ROW current_row; /* buffer to current row */ + MEM_ROOT field_alloc; + unsigned int field_count, current_field; + my_bool eof; /* Used by mysql_fetch_row */ + /* mysql_stmt_close() had to cancel this result */ + my_bool unbuffered_fetch_cancelled; + void *extension; } MYSQL_RES; -#define MAX_MYSQL_MANAGER_ERR 256 -#define MAX_MYSQL_MANAGER_MSG 256 - -#define MANAGER_OK 200 -#define MANAGER_INFO 250 -#define MANAGER_ACCESS 401 -#define MANAGER_CLIENT_ERR 450 -#define MANAGER_INTERNAL_ERR 500 #if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) #define MYSQL_CLIENT #endif -typedef struct st_mysql_manager -{ - NET net; - char *host,*user,*passwd; - unsigned int port; - my_bool free_me; - my_bool eof; - int cmd_status; - int last_errno; - char* net_buf,*net_buf_pos,*net_data_end; - int net_buf_size; - char last_error[MAX_MYSQL_MANAGER_ERR]; -} MYSQL_MANAGER; - typedef struct st_mysql_parameters { unsigned long *p_max_allowed_packet; unsigned long *p_net_buffer_length; + void *extension; } MYSQL_PARAMETERS; #if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) @@ -379,6 +320,7 @@ typedef struct st_mysql_parameters */ int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); + /* mysql_server_init/end need to be called when using libmysqld or libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so @@ -411,7 +353,7 @@ my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); my_bool STDCALL mysql_eof(MYSQL_RES *res); MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, - unsigned int fieldnr); + unsigned int fieldnr); MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res); MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res); @@ -428,39 +370,29 @@ unsigned long STDCALL mysql_thread_id(MYSQL *mysql); const char * STDCALL mysql_character_set_name(MYSQL *mysql); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); -MYSQL * STDCALL mysql_init(MYSQL *mysql); -my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, - const char *cert, const char *ca, - const char *capath, const char *cipher); +MYSQL * STDCALL mysql_init(MYSQL *mysql); +my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, + const char *cert, const char *ca, + const char *capath, const char *cipher); const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); -my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, - const char *passwd, const char *db); -MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, - const char *user, - const char *passwd, - const char *db, - unsigned int port, - const char *unix_socket, - unsigned long clientflag); -int STDCALL mysql_select_db(MYSQL *mysql, const char *db); -int STDCALL mysql_query(MYSQL *mysql, const char *q); -int STDCALL mysql_send_query(MYSQL *mysql, const char *q, - unsigned long length); -int STDCALL mysql_real_query(MYSQL *mysql, const char *q, - unsigned long length); +my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, + const char *passwd, const char *db); +MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, + const char *user, + const char *passwd, + const char *db, + unsigned int port, + const char *unix_socket, + unsigned long clientflag); +int STDCALL mysql_select_db(MYSQL *mysql, const char *db); +int STDCALL mysql_query(MYSQL *mysql, const char *q); +int STDCALL mysql_send_query(MYSQL *mysql, const char *q, + unsigned long length); +int STDCALL mysql_real_query(MYSQL *mysql, const char *q, + unsigned long length); MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); -/* perform query on master */ -my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, - unsigned long length); -/* perform query on slave */ -my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, - unsigned long length); void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *charset); @@ -473,109 +405,66 @@ mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, - unsigned int), + unsigned int), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char*, - unsigned int), + unsigned int), void *); void mysql_set_local_infile_default(MYSQL *mysql); - -/* - enable/disable parsing of all queries to decide if they go on master or - slave -*/ -void STDCALL mysql_enable_rpl_parse(MYSQL* mysql); -void STDCALL mysql_disable_rpl_parse(MYSQL* mysql); -/* get the value of the parse flag */ -int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql); - -/* enable/disable reads from master */ -void STDCALL mysql_enable_reads_from_master(MYSQL* mysql); -void STDCALL mysql_disable_reads_from_master(MYSQL* mysql); -/* get the value of the master read flag */ -my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql); - -enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len); - -/* discover the master and its slaves */ -my_bool STDCALL mysql_rpl_probe(MYSQL* mysql); - -/* set the master, close/free the old one, if it is not a pivot */ -int STDCALL mysql_set_master(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); -int STDCALL mysql_add_slave(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); - -int STDCALL mysql_shutdown(MYSQL *mysql, +int STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level); -int STDCALL mysql_dump_debug_info(MYSQL *mysql); -int STDCALL mysql_refresh(MYSQL *mysql, - unsigned int refresh_options); -int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); -int STDCALL mysql_set_server_option(MYSQL *mysql, - enum enum_mysql_set_option - option); -int STDCALL mysql_ping(MYSQL *mysql); -const char * STDCALL mysql_stat(MYSQL *mysql); -const char * STDCALL mysql_get_server_info(MYSQL *mysql); -const char * STDCALL mysql_get_client_info(void); -unsigned long STDCALL mysql_get_client_version(void); -const char * STDCALL mysql_get_host_info(MYSQL *mysql); -unsigned long STDCALL mysql_get_server_version(MYSQL *mysql); -unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); -int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, - const char *arg); -void STDCALL mysql_free_result(MYSQL_RES *result); -void STDCALL mysql_data_seek(MYSQL_RES *result, - my_ulonglong offset); +int STDCALL mysql_dump_debug_info(MYSQL *mysql); +int STDCALL mysql_refresh(MYSQL *mysql, + unsigned int refresh_options); +int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); +int STDCALL mysql_set_server_option(MYSQL *mysql, + enum enum_mysql_set_option + option); +int STDCALL mysql_ping(MYSQL *mysql); +const char * STDCALL mysql_stat(MYSQL *mysql); +const char * STDCALL mysql_get_server_info(MYSQL *mysql); +const char * STDCALL mysql_get_client_info(void); +unsigned long STDCALL mysql_get_client_version(void); +const char * STDCALL mysql_get_host_info(MYSQL *mysql); +unsigned long STDCALL mysql_get_server_version(MYSQL *mysql); +unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); +MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); +MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); +MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); +int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, + const void *arg); +void STDCALL mysql_free_result(MYSQL_RES *result); +void STDCALL mysql_data_seek(MYSQL_RES *result, + my_ulonglong offset); MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, - MYSQL_ROW_OFFSET offset); + MYSQL_ROW_OFFSET offset); MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, - MYSQL_FIELD_OFFSET offset); -MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); + MYSQL_FIELD_OFFSET offset); +MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); -MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); +MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, - const char *wild); -unsigned long STDCALL mysql_escape_string(char *to,const char *from, - unsigned long from_length); -unsigned long STDCALL mysql_hex_string(char *to,const char *from, + const char *wild); +unsigned long STDCALL mysql_escape_string(char *to,const char *from, + unsigned long from_length); +unsigned long STDCALL mysql_hex_string(char *to,const char *from, unsigned long from_length); unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, - char *to,const char *from, - unsigned long length); -void STDCALL mysql_debug(const char *debug); -void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); -unsigned int STDCALL mysql_thread_safe(void); -my_bool STDCALL mysql_embedded(void); -MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con); -MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, - const char* host, - const char* user, - const char* passwd, - unsigned int port); -void STDCALL mysql_manager_close(MYSQL_MANAGER* con); -int STDCALL mysql_manager_command(MYSQL_MANAGER* con, - const char* cmd, int cmd_len); -int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, - char* res_buf, - int res_buf_size); + char *to,const char *from, + unsigned long length); +void STDCALL mysql_debug(const char *debug); +void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); +unsigned int STDCALL mysql_thread_safe(void); +my_bool STDCALL mysql_embedded(void); my_bool STDCALL mysql_read_query_result(MYSQL *mysql); /* - The following definitions are added for the enhanced + The following definitions are added for the enhanced client-server protocol */ @@ -652,28 +541,29 @@ enum enum_mysql_stmt_state typedef struct st_mysql_bind { - unsigned long *length; /* output length pointer */ - my_bool *is_null; /* Pointer to null indicator */ - void *buffer; /* buffer to get/put data */ + unsigned long *length; /* output length pointer */ + my_bool *is_null; /* Pointer to null indicator */ + void *buffer; /* buffer to get/put data */ /* set this if you want to track data truncations happened during fetch */ my_bool *error; - enum enum_field_types buffer_type; /* buffer type */ - /* output buffer length, must be set when fetching str/binary */ - unsigned long buffer_length; unsigned char *row_ptr; /* for the current data position */ - unsigned long offset; /* offset position for char/binary fetch */ - unsigned long length_value; /* Used if length is 0 */ - unsigned int param_number; /* For null count and error messages */ - unsigned int pack_length; /* Internal length for packed data */ - my_bool error_value; /* used if error is 0 */ - my_bool is_unsigned; /* set if integer type is unsigned */ - my_bool long_data_used; /* If used with mysql_send_long_data */ - my_bool is_null_value; /* Used if is_null is 0 */ void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char **row); void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, - unsigned char **row); + unsigned char **row); + /* output buffer length, must be set when fetching str/binary */ + unsigned long buffer_length; + unsigned long offset; /* offset position for char/binary fetch */ + unsigned long length_value; /* Used if length is 0 */ + unsigned int param_number; /* For null count and error messages */ + unsigned int pack_length; /* Internal length for packed data */ + enum enum_field_types buffer_type; /* buffer type */ + my_bool error_value; /* used if error is 0 */ + my_bool is_unsigned; /* set if integer type is unsigned */ + my_bool long_data_used; /* If used with mysql_send_long_data */ + my_bool is_null_value; /* Used if is_null is 0 */ + void *extension; } MYSQL_BIND; @@ -688,16 +578,16 @@ typedef struct st_mysql_stmt MYSQL_FIELD *fields; /* result set metadata */ MYSQL_DATA result; /* cached result set */ MYSQL_ROWS *data_cursor; /* current row in cached result */ - /* copy of mysql->affected_rows after statement execution */ - my_ulonglong affected_rows; - my_ulonglong insert_id; /* copy of mysql->insert_id */ /* mysql_stmt_fetch() calls this function to fetch one row (it's different for buffered, unbuffered and cursor fetch). */ - int (*read_row_func)(struct st_mysql_stmt *stmt, + int (*read_row_func)(struct st_mysql_stmt *stmt, unsigned char **row); - unsigned long stmt_id; /* Id for prepared statement */ + /* copy of mysql->affected_rows after statement execution */ + my_ulonglong affected_rows; + my_ulonglong insert_id; /* copy of mysql->insert_id */ + unsigned long stmt_id; /* Id for prepared statement */ unsigned long flags; /* i.e. type of cursor to open */ unsigned long prefetch_rows; /* number of rows per one COM_FETCH */ /* @@ -705,30 +595,31 @@ typedef struct st_mysql_stmt server-side cursor status for this statement. */ unsigned int server_status; - unsigned int last_errno; /* error code */ + unsigned int last_errno; /* error code */ unsigned int param_count; /* input parameter count */ unsigned int field_count; /* number of columns in result set */ enum enum_mysql_stmt_state state; /* statement state */ - char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ - char sqlstate[SQLSTATE_LENGTH+1]; + char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ + char sqlstate[SQLSTATE_LENGTH+1]; /* Types of input parameters should be sent to server */ my_bool send_types_to_server; my_bool bind_param_done; /* input buffers were supplied */ unsigned char bind_result_done; /* output buffers were supplied */ /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; + my_bool unbuffered_fetch_cancelled; /* - Is set to true if we need to calculate field->max_length for + Is set to true if we need to calculate field->max_length for metadata fields when doing mysql_stmt_store_result. */ - my_bool update_max_length; + my_bool update_max_length; + void *extension; } MYSQL_STMT; enum enum_stmt_attr_type { /* When doing mysql_stmt_store_result calculate max_length attribute - of statement metadata. This is to be consistent with the old API, + of statement metadata. This is to be consistent with the old API, where this was done automatically. In the new API we do that only by request because it slows down mysql_stmt_store_result sufficiently. @@ -751,19 +642,19 @@ typedef struct st_mysql_methods { my_bool (*read_query_result)(MYSQL *mysql); my_bool (*advanced_command)(MYSQL *mysql, - enum enum_server_command command, - const char *header, - unsigned long header_length, - const char *arg, - unsigned long arg_length, - my_bool skip_check, + enum enum_server_command command, + const unsigned char *header, + unsigned long header_length, + const unsigned char *arg, + unsigned long arg_length, + my_bool skip_check, MYSQL_STMT *stmt); MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, - unsigned int fields); + unsigned int fields); MYSQL_RES * (*use_result)(MYSQL *mysql); - void (*fetch_lengths)(unsigned long *to, - MYSQL_ROW column, unsigned int field_count); - void (*flush_use_result)(MYSQL *mysql); + void (*fetch_lengths)(unsigned long *to, + MYSQL_ROW column, unsigned int field_count); + void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results); #if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) MYSQL_FIELD * (*list_fields)(MYSQL *mysql); my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); @@ -784,7 +675,7 @@ int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length); int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); -int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, +int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); @@ -800,16 +691,16 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt); my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); -my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, +my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, unsigned int param_number, - const char *data, + const char *data, unsigned long length); MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt); MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt); const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt); const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt); -MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, +MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET offset); MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt); void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); @@ -823,6 +714,7 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql); my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); my_bool STDCALL mysql_more_results(MYSQL *mysql); int STDCALL mysql_next_result(MYSQL *mysql); +int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt); void STDCALL mysql_close(MYSQL *sock); @@ -833,11 +725,10 @@ void STDCALL mysql_close(MYSQL *sock); #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #ifdef USE_OLD_FUNCTIONS -MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, - const char *user, const char *passwd); -int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); -int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); -#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) +MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, + const char *user, const char *passwd); +int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); +int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); #endif #define HAVE_MYSQL_REAL_CONNECT @@ -847,26 +738,18 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); */ #define simple_command(mysql, command, arg, length, skip_check) \ - (*(mysql)->methods->advanced_command)(mysql, command, NullS, \ + (*(mysql)->methods->advanced_command)(mysql, command, 0, \ 0, arg, length, skip_check, NULL) #define stmt_command(mysql, command, arg, length, stmt) \ - (*(mysql)->methods->advanced_command)(mysql, command, NullS, \ + (*(mysql)->methods->advanced_command)(mysql, command, 0, \ 0, arg, length, 1, stmt) #ifdef __NETWARE__ - -// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some paltform -#if defined( __GNUC__ ) -#pragma pack() -#else -#pragma pack(pop) +#pragma pack(pop) /* restore alignment */ #endif -#endif - -#ifdef __cplusplus +#ifdef __cplusplus } #endif #endif /* _mysql_h */ - diff --git a/dep/include/mysql/mysql_com.h b/externals/mysql/mysql_com.h similarity index 69% rename from dep/include/mysql/mysql_com.h rename to externals/mysql/mysql_com.h index 0669a7e0d02..8b16fd2672a 100644 --- a/dep/include/mysql/mysql_com.h +++ b/externals/mysql/mysql_com.h @@ -20,12 +20,25 @@ #ifndef _mysql_com_h #define _mysql_com_h -#define NAME_LEN 64 /* Field/table name length */ #define HOSTNAME_LENGTH 60 -#define USERNAME_LENGTH 16 +#define SYSTEM_CHARSET_MBMAXLEN 4 +#define NAME_CHAR_LEN 64 /* Field/table name length */ +#define USERNAME_CHAR_LENGTH 16 +#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) +#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) + #define SERVER_VERSION_LENGTH 60 #define SQLSTATE_LENGTH 5 +/* + Maximum length of comments +*/ +#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 (3-byte) characters */ +#define TABLE_COMMENT_MAXLEN 2048 +#define COLUMN_COMMENT_MAXLEN 1024 +#define INDEX_COMMENT_MAXLEN 1024 + + /* USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain username and hostname parts of the user identifier with trailing zero in @@ -56,7 +69,7 @@ enum enum_server_command COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, - COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, + COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, /* don't forget to update const char *command_name[] in sql_parse.cc */ /* Must be last */ @@ -90,11 +103,18 @@ enum enum_server_command #define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ #define SET_FLAG 2048 /* field is a set */ #define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */ +#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */ #define NUM_FLAG 32768 /* Field is num (for clients) */ #define PART_KEY_FLAG 16384 /* Intern; Part of some key */ #define GROUP_FLAG 32768 /* Intern: Group field */ #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ #define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ +#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */ +#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ +#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ +#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ +#define FIELD_STORAGE_FLAGS 22 /* Storage type: bit 22, 23 and 24 */ +#define COLUMN_FORMAT_FLAGS 25 /* Column format: bit 25, 26 and 27 */ #define REFRESH_GRANT 1 /* Refresh grant tables */ #define REFRESH_LOG 2 /* Start on new log file */ @@ -116,6 +136,7 @@ enum enum_server_command #define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */ #define REFRESH_DES_KEY_FILE 0x40000L #define REFRESH_USER_RESOURCES 0x80000L +#define REFRESH_BACKUP_LOG 0x200000L #define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ @@ -135,28 +156,91 @@ enum enum_server_command #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ +#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */ #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define CLIENT_REMEMBER_OPTIONS (1UL << 31) +/* Gather all possible capabilites (flags) supported by the server */ +#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \ + CLIENT_FOUND_ROWS | \ + CLIENT_LONG_FLAG | \ + CLIENT_CONNECT_WITH_DB | \ + CLIENT_NO_SCHEMA | \ + CLIENT_COMPRESS | \ + CLIENT_ODBC | \ + CLIENT_LOCAL_FILES | \ + CLIENT_IGNORE_SPACE | \ + CLIENT_PROTOCOL_41 | \ + CLIENT_INTERACTIVE | \ + CLIENT_SSL | \ + CLIENT_IGNORE_SIGPIPE | \ + CLIENT_TRANSACTIONS | \ + CLIENT_RESERVED | \ + CLIENT_SECURE_CONNECTION | \ + CLIENT_MULTI_STATEMENTS | \ + CLIENT_MULTI_RESULTS | \ + CLIENT_PS_MULTI_RESULTS | \ + CLIENT_SSL_VERIFY_SERVER_CERT | \ + CLIENT_REMEMBER_OPTIONS) + +/* + Switch off the flags that are optional and depending on build flags + If any of the optional flags is supported by the build it will be switched + on before sending to the client during the connection handshake. +*/ +#define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \ + & ~CLIENT_COMPRESS) \ + & ~CLIENT_SSL_VERIFY_SERVER_CERT) + #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ #define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ #define SERVER_QUERY_NO_GOOD_INDEX_USED 16 #define SERVER_QUERY_NO_INDEX_USED 32 -/* +/** The server was able to fulfill the clients request and opened a read-only non-scrollable cursor for a query. This flag comes in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. */ #define SERVER_STATUS_CURSOR_EXISTS 64 -/* +/** This flag is sent when a read-only cursor is exhausted, in reply to COM_STMT_FETCH command. */ #define SERVER_STATUS_LAST_ROW_SENT 128 #define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ #define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512 +/** + Sent to the client if after a prepared statement reprepare + we discovered that the new statement returns a different + number of result set columns. +*/ +#define SERVER_STATUS_METADATA_CHANGED 1024 +/* + Tell clients that this query was logged to the slow query log. + Not yet set in the server, but interface is defined for applications + to use. See WorkLog 4098. +*/ +#define SERVER_QUERY_WAS_SLOW 2048 + +/** + To mark ResultSet containing output parameter values. +*/ +#define SERVER_PS_OUT_PARAMS 4096 + +/** + Server status flags that must be cleared when starting + execution of a new SQL statement. + Flags from this set are only added to the + current server status by the execution engine, but + never removed -- the execution engine expects them + to disappear automagically by the next command. +*/ +#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ + SERVER_QUERY_NO_INDEX_USED|\ + SERVER_MORE_RESULTS_EXISTS|\ + SERVER_STATUS_METADATA_CHANGED) #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /* Timeout on read */ @@ -165,6 +249,7 @@ enum enum_server_command #define ONLY_KILL_QUERY 1 + struct st_vio; /* Only C */ typedef struct st_vio Vio; @@ -174,75 +259,73 @@ typedef struct st_vio Vio; #define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ #define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ #define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ -#define MAX_BLOB_WIDTH 8192 /* Default width for blob */ +#define MAX_BLOB_WIDTH 16777216 /* Default width for blob */ typedef struct st_net { #if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY) - Vio* vio; + Vio *vio; unsigned char *buff,*buff_end,*write_pos,*read_pos; my_socket fd; /* For Perl DBI/dbd */ - unsigned long max_packet,max_packet_size; - unsigned int pkt_nr,compress_pkt_nr; - unsigned int write_timeout, read_timeout, retry_count; - int fcntl; - my_bool compress; /* The following variable is set if we are doing several queries in one command ( as in LOAD TABLE ... FROM MASTER ), and do not want to confuse the client with OK at the wrong time */ unsigned long remain_in_buf,length, buf_length, where_b; + unsigned long max_packet,max_packet_size; + unsigned int pkt_nr,compress_pkt_nr; + unsigned int write_timeout, read_timeout, retry_count; + int fcntl; unsigned int *return_status; unsigned char reading_or_writing; char save_char; - my_bool no_send_ok; /* For SPs and other things that do multiple stmts */ - my_bool no_send_eof; /* For SPs' first version read-only cursors */ - /* - Set if OK packet is already sent, and we do not need to send error - messages - */ - my_bool no_send_error; + my_bool unused1; /* Please remove with the next incompatible ABI change. */ + my_bool unused2; /* Please remove with the next incompatible ABI change */ + my_bool compress; + my_bool unused3; /* Please remove with the next incompatible ABI change. */ /* Pointer to query object in query cache, do not equal NULL (0) for queries in cache that have not stored its results yet */ #endif - char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1]; - unsigned int last_errno; - unsigned char error; - /* - 'query_cache_query' should be accessed only via query cache - functions and methods to maintain proper locking. + Unused, please remove with the next incompatible ABI change. */ - gptr query_cache_query; - - my_bool report_error; /* We should report error (we have unreported error) */ - my_bool return_errno; + unsigned char *unused; + unsigned int last_errno; + unsigned char error; + my_bool unused4; /* Please remove with the next incompatible ABI change. */ + my_bool unused5; /* Please remove with the next incompatible ABI change. */ + /** Client library error message buffer. Actually belongs to struct MYSQL. */ + char last_error[MYSQL_ERRMSG_SIZE]; + /** Client library sqlstate buffer. Set along with the error message. */ + char sqlstate[SQLSTATE_LENGTH+1]; + void *extension; } NET; + #define packet_error (~(unsigned long) 0) enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, - MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, - MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, - MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, - MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, - MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, - MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, - MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, - MYSQL_TYPE_BIT, + MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, + MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, + MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, + MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, + MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, + MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, + MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, + MYSQL_TYPE_BIT, MYSQL_TYPE_NEWDECIMAL=246, - MYSQL_TYPE_ENUM=247, - MYSQL_TYPE_SET=248, - MYSQL_TYPE_TINY_BLOB=249, - MYSQL_TYPE_MEDIUM_BLOB=250, - MYSQL_TYPE_LONG_BLOB=251, - MYSQL_TYPE_BLOB=252, - MYSQL_TYPE_VAR_STRING=253, - MYSQL_TYPE_STRING=254, - MYSQL_TYPE_GEOMETRY=255 - + MYSQL_TYPE_ENUM=247, + MYSQL_TYPE_SET=248, + MYSQL_TYPE_TINY_BLOB=249, + MYSQL_TYPE_MEDIUM_BLOB=250, + MYSQL_TYPE_LONG_BLOB=251, + MYSQL_TYPE_BLOB=252, + MYSQL_TYPE_VAR_STRING=253, + MYSQL_TYPE_STRING=254, + MYSQL_TYPE_GEOMETRY=255, + MAX_NO_FIELD_TYPES /* Should always be last */ }; /* For backward compatibility */ @@ -335,14 +418,14 @@ extern "C" { my_bool my_net_init(NET *net, Vio* vio); void my_net_local_init(NET *net); void net_end(NET *net); -void net_clear(NET *net); -my_bool net_realloc(NET *net, unsigned long length); + void net_clear(NET *net, my_bool clear_buffer); +my_bool net_realloc(NET *net, size_t length); my_bool net_flush(NET *net); -my_bool my_net_write(NET *net,const char *packet,unsigned long len); +my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); my_bool net_write_command(NET *net,unsigned char command, - const char *header, unsigned long head_len, - const char *packet, unsigned long len); -int net_real_write(NET *net,const char *packet,unsigned long len); + const unsigned char *header, size_t head_len, + const unsigned char *packet, size_t len); +int net_real_write(NET *net,const unsigned char *packet, size_t len); unsigned long my_net_read(NET *net); #ifdef _global_h @@ -350,18 +433,10 @@ void my_net_set_write_timeout(NET *net, uint timeout); void my_net_set_read_timeout(NET *net, uint timeout); #endif -/* - The following function is not meant for normal usage - Currently it's used internally by manager.c -*/ struct sockaddr; int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout); - -struct rand_struct { - unsigned long seed1,seed2,max_value; - double max_value_dbl; -}; +struct my_rnd_struct; #ifdef __cplusplus } @@ -369,8 +444,14 @@ struct rand_struct { /* The following is for user defined functions */ -enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, - DECIMAL_RESULT}; +enum Item_result +{ + STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT +#ifdef MYSQL_SERVER + ,IMPOSSIBLE_RESULT /* Yes, we know this is ugly, don't tell us */ + ,MAX_NO_ITEM_RESULTS = IMPOSSIBLE_RESULT /* Should always be last */ +#endif +}; typedef struct st_udf_args { @@ -381,6 +462,7 @@ typedef struct st_udf_args char *maybe_null; /* Set to 1 for all maybe_null args */ char **attributes; /* Pointer to attribute name */ unsigned long *attribute_lengths; /* Length of attribute arguments */ + void *extension; } UDF_ARGS; /* This holds information about the result */ @@ -392,6 +474,7 @@ typedef struct st_udf_init unsigned long max_length; /* For string functions */ char *ptr; /* free pointer for function data */ my_bool const_item; /* 1 if function always returns the same value */ + void *extension; } UDF_INIT; /* TODO: add a notion for determinism of the UDF. @@ -413,10 +496,8 @@ extern "C" { implemented in sql/password.c */ -void randominit(struct rand_struct *, unsigned long seed1, - unsigned long seed2); -double my_rnd(struct rand_struct *); -void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); +void create_random_string(char *to, unsigned int length, + struct my_rnd_struct *rand_st); void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); @@ -436,24 +517,18 @@ char *octet2hex(char *to, const char *str, unsigned int len); /* end of password.c */ -char *get_tty_password(char *opt_message); +char *get_tty_password(const char *opt_message); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); /* Some other useful functions */ -my_bool my_init(void); -extern int modify_defaults_file(const char *file_location, const char *option, - const char *option_value, - const char *section_name, int remove_option); -int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); my_bool my_thread_init(void); void my_thread_end(void); #ifdef _global_h ulong STDCALL net_field_length(uchar **packet); my_ulonglong net_field_length_ll(uchar **packet); -char *net_store_length(char *pkg, ulonglong length); +uchar *net_store_length(uchar *pkg, ulonglong length); #endif #ifdef __cplusplus @@ -464,5 +539,5 @@ char *net_store_length(char *pkg, ulonglong length); #define MYSQL_STMT_HEADER 4 #define MYSQL_LONG_DATA_HEADER 6 +#define NOT_FIXED_DEC 31 #endif - diff --git a/externals/mysql/mysql_config/mysql_config.c b/externals/mysql/mysql_config/mysql_config.c new file mode 100644 index 00000000000..d930868d39d --- /dev/null +++ b/externals/mysql/mysql_config/mysql_config.c @@ -0,0 +1,103 @@ +/* Copyright (C) 2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include + +#define INCLUDE "-IC:/Program Files/libmysql/include" +#define LIBS "-LC:/Program Files/libmysql/lib -lmysql" \ + "" +#define CFLAGS INCLUDE +#define VERSION "6.0.2" + +enum options_client +{ + OPT_CFLAGS= 256, + OPT_INCLUDE, + OPT_LIBS, + OPT_LIBS_R, + OPT_VERSION, +}; + +static struct my_option my_long_options[]= +{ + {"cflags", OPT_CFLAGS, "[" CFLAGS "]", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, + NO_ARG, 0, 0, 0, 0, 0, 0}, + {"include", OPT_INCLUDE, "[" INCLUDE "]", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"libs", OPT_LIBS, "[" LIBS "]", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"libs_r", OPT_LIBS_R, "[" LIBS "]", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"version", OPT_VERSION, "[" VERSION "]", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + + +void usage(void) +{ + puts("Copyright 2009 Sun Microsystems, Inc."); + puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n"); + puts("Get compiler flags for using the MySQL client library."); + printf("Usage: %s [OPTIONS]\n", my_progname); + my_print_help(my_long_options); +} + + +my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case OPT_CFLAGS: + puts(CFLAGS); + break; + case OPT_INCLUDE: + puts(INCLUDE); + break; + case OPT_LIBS: + case OPT_LIBS_R: + puts(LIBS); + break; + case OPT_VERSION: + puts(VERSION); + break; + } + + return 0; +} + + +int main(int ac, char **av) +{ + int error; + my_progname= av[0]; + + if (ac <= 1) + { + usage(); + exit(1); + } + + if ((error= handle_options(&ac, &av, my_long_options, get_one_option))) + exit(error); + + exit(0); +} diff --git a/dep/include/mysql/mysql_time.h b/externals/mysql/mysql_time.h similarity index 99% rename from dep/include/mysql/mysql_time.h rename to externals/mysql/mysql_time.h index 6dce2fd02c7..0a3f17a81fb 100644 --- a/dep/include/mysql/mysql_time.h +++ b/externals/mysql/mysql_time.h @@ -53,4 +53,3 @@ typedef struct st_mysql_time } MYSQL_TIME; #endif /* _mysql_time_h_ */ - diff --git a/externals/mysql/mysql_version.h b/externals/mysql/mysql_version.h new file mode 100644 index 00000000000..3f052b8dda8 --- /dev/null +++ b/externals/mysql/mysql_version.h @@ -0,0 +1,26 @@ +/* Copyright Abandoned 1996, 1999, 2001 MySQL AB + This file is public domain and comes with NO WARRANTY of any kind */ + +/* Version numbers for protocol & mysqld */ + +#ifndef _mysql_version_h +#define _mysql_version_h + +#ifdef _CUSTOMCONFIG_ +# include +#else +# define PROTOCOL_VERSION 10 +# define MYSQL_SERVER_VERSION "6.0.0" +# define MYSQL_VERSION_ID 60000 +# define MYSQL_PORT 3306 +# define MYSQL_PORT_DEFAULT 0 +# define MYSQL_UNIX_ADDR "/tmp/mysql.sock" +# define MYSQL_CONFIG_NAME "my" +# define MYSQL_COMPILATION_COMMENT "Source distribution" +#endif /* _CUSTOMCONFIG_ */ + +#ifndef LICENSE +# define LICENSE GPL +#endif /* LICENSE */ + +#endif /* _mysql_version_h */ diff --git a/dep/include/mysql/mysqld_error.h b/externals/mysql/mysqld_error.h similarity index 62% rename from dep/include/mysql/mysqld_error.h rename to externals/mysql/mysqld_error.h index b200fdc84d6..653e583e0f5 100644 --- a/dep/include/mysql/mysqld_error.h +++ b/externals/mysql/mysqld_error.h @@ -477,5 +477,254 @@ #define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473 #define ER_NAME_BECOMES_EMPTY 1474 #define ER_AMBIGUOUS_FIELD_TERM 1475 -#define ER_ERROR_LAST 1475 - +#define ER_FOREIGN_SERVER_EXISTS 1476 +#define ER_FOREIGN_SERVER_DOESNT_EXIST 1477 +#define ER_ILLEGAL_HA_CREATE_OPTION 1478 +#define ER_PARTITION_REQUIRES_VALUES_ERROR 1479 +#define ER_PARTITION_WRONG_VALUES_ERROR 1480 +#define ER_PARTITION_MAXVALUE_ERROR 1481 +#define ER_PARTITION_SUBPARTITION_ERROR 1482 +#define ER_PARTITION_SUBPART_MIX_ERROR 1483 +#define ER_PARTITION_WRONG_NO_PART_ERROR 1484 +#define ER_PARTITION_WRONG_NO_SUBPART_ERROR 1485 +#define ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR 1486 +#define ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR 1487 +#define ER_FIELD_NOT_FOUND_PART_ERROR 1488 +#define ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR 1489 +#define ER_INCONSISTENT_PARTITION_INFO_ERROR 1490 +#define ER_PARTITION_FUNC_NOT_ALLOWED_ERROR 1491 +#define ER_PARTITIONS_MUST_BE_DEFINED_ERROR 1492 +#define ER_RANGE_NOT_INCREASING_ERROR 1493 +#define ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR 1494 +#define ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR 1495 +#define ER_PARTITION_ENTRY_ERROR 1496 +#define ER_MIX_HANDLER_ERROR 1497 +#define ER_PARTITION_NOT_DEFINED_ERROR 1498 +#define ER_TOO_MANY_PARTITIONS_ERROR 1499 +#define ER_SUBPARTITION_ERROR 1500 +#define ER_CANT_CREATE_HANDLER_FILE 1501 +#define ER_BLOB_FIELD_IN_PART_FUNC_ERROR 1502 +#define ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF 1503 +#define ER_NO_PARTS_ERROR 1504 +#define ER_PARTITION_MGMT_ON_NONPARTITIONED 1505 +#define ER_FOREIGN_KEY_ON_PARTITIONED 1506 +#define ER_DROP_PARTITION_NON_EXISTENT 1507 +#define ER_DROP_LAST_PARTITION 1508 +#define ER_COALESCE_ONLY_ON_HASH_PARTITION 1509 +#define ER_REORG_HASH_ONLY_ON_SAME_NO 1510 +#define ER_REORG_NO_PARAM_ERROR 1511 +#define ER_ONLY_ON_RANGE_LIST_PARTITION 1512 +#define ER_ADD_PARTITION_SUBPART_ERROR 1513 +#define ER_ADD_PARTITION_NO_NEW_PARTITION 1514 +#define ER_COALESCE_PARTITION_NO_PARTITION 1515 +#define ER_REORG_PARTITION_NOT_EXIST 1516 +#define ER_SAME_NAME_PARTITION 1517 +#define ER_NO_BINLOG_ERROR 1518 +#define ER_CONSECUTIVE_REORG_PARTITIONS 1519 +#define ER_REORG_OUTSIDE_RANGE 1520 +#define ER_PARTITION_FUNCTION_FAILURE 1521 +#define ER_PART_STATE_ERROR 1522 +#define ER_LIMITED_PART_RANGE 1523 +#define ER_PLUGIN_IS_NOT_LOADED 1524 +#define ER_WRONG_VALUE 1525 +#define ER_NO_PARTITION_FOR_GIVEN_VALUE 1526 +#define ER_FILEGROUP_OPTION_ONLY_ONCE 1527 +#define ER_CREATE_FILEGROUP_FAILED 1528 +#define ER_DROP_FILEGROUP_FAILED 1529 +#define ER_TABLESPACE_AUTO_EXTEND_ERROR 1530 +#define ER_WRONG_SIZE_NUMBER 1531 +#define ER_SIZE_OVERFLOW_ERROR 1532 +#define ER_ALTER_FILEGROUP_FAILED 1533 +#define ER_BINLOG_ROW_LOGGING_FAILED 1534 +#define ER_BINLOG_ROW_WRONG_TABLE_DEF 1535 +#define ER_BINLOG_ROW_RBR_TO_SBR 1536 +#define ER_EVENT_ALREADY_EXISTS 1537 +#define ER_EVENT_STORE_FAILED 1538 +#define ER_EVENT_DOES_NOT_EXIST 1539 +#define ER_EVENT_CANT_ALTER 1540 +#define ER_EVENT_DROP_FAILED 1541 +#define ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG 1542 +#define ER_EVENT_ENDS_BEFORE_STARTS 1543 +#define ER_EVENT_EXEC_TIME_IN_THE_PAST 1544 +#define ER_EVENT_OPEN_TABLE_FAILED 1545 +#define ER_EVENT_NEITHER_M_EXPR_NOR_M_AT 1546 +#define ER_COL_COUNT_DOESNT_MATCH_CORRUPTED 1547 +#define ER_CANNOT_LOAD_FROM_TABLE 1548 +#define ER_EVENT_CANNOT_DELETE 1549 +#define ER_EVENT_COMPILE_ERROR 1550 +#define ER_EVENT_SAME_NAME 1551 +#define ER_EVENT_DATA_TOO_LONG 1552 +#define ER_DROP_INDEX_FK 1553 +#define ER_WARN_DEPRECATED_SYNTAX_WITH_VER 1554 +#define ER_CANT_WRITE_LOCK_LOG_TABLE 1555 +#define ER_CANT_LOCK_LOG_TABLE 1556 +#define ER_FOREIGN_DUPLICATE_KEY 1557 +#define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE 1558 +#define ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR 1559 +#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT 1560 +#define ER_NDB_CANT_SWITCH_BINLOG_FORMAT 1561 +#define ER_PARTITION_NO_TEMPORARY 1562 +#define ER_PARTITION_CONST_DOMAIN_ERROR 1563 +#define ER_PARTITION_FUNCTION_IS_NOT_ALLOWED 1564 +#define ER_DDL_LOG_ERROR 1565 +#define ER_NULL_IN_VALUES_LESS_THAN 1566 +#define ER_WRONG_PARTITION_NAME 1567 +#define ER_CANT_CHANGE_TX_ISOLATION 1568 +#define ER_DUP_ENTRY_AUTOINCREMENT_CASE 1569 +#define ER_EVENT_MODIFY_QUEUE_ERROR 1570 +#define ER_EVENT_SET_VAR_ERROR 1571 +#define ER_PARTITION_MERGE_ERROR 1572 +#define ER_CANT_ACTIVATE_LOG 1573 +#define ER_RBR_NOT_AVAILABLE 1574 +#define ER_BASE64_DECODE_ERROR 1575 +#define ER_EVENT_RECURSION_FORBIDDEN 1576 +#define ER_EVENTS_DB_ERROR 1577 +#define ER_ONLY_INTEGERS_ALLOWED 1578 +#define ER_UNSUPORTED_LOG_ENGINE 1579 +#define ER_BAD_LOG_STATEMENT 1580 +#define ER_CANT_RENAME_LOG_TABLE 1581 +#define ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 1582 +#define ER_WRONG_PARAMETERS_TO_NATIVE_FCT 1583 +#define ER_WRONG_PARAMETERS_TO_STORED_FCT 1584 +#define ER_NATIVE_FCT_NAME_COLLISION 1585 +#define ER_DUP_ENTRY_WITH_KEY_NAME 1586 +#define ER_BINLOG_PURGE_EMFILE 1587 +#define ER_EVENT_CANNOT_CREATE_IN_THE_PAST 1588 +#define ER_EVENT_CANNOT_ALTER_IN_THE_PAST 1589 +#define ER_SLAVE_INCIDENT 1590 +#define ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT 1591 +#define ER_BINLOG_UNSAFE_STATEMENT 1592 +#define ER_SLAVE_FATAL_ERROR 1593 +#define ER_SLAVE_RELAY_LOG_READ_FAILURE 1594 +#define ER_SLAVE_RELAY_LOG_WRITE_FAILURE 1595 +#define ER_SLAVE_CREATE_EVENT_FAILURE 1596 +#define ER_SLAVE_MASTER_COM_FAILURE 1597 +#define ER_BINLOG_LOGGING_IMPOSSIBLE 1598 +#define ER_VIEW_NO_CREATION_CTX 1599 +#define ER_VIEW_INVALID_CREATION_CTX 1600 +#define ER_SR_INVALID_CREATION_CTX 1601 +#define ER_TRG_CORRUPTED_FILE 1602 +#define ER_TRG_NO_CREATION_CTX 1603 +#define ER_TRG_INVALID_CREATION_CTX 1604 +#define ER_EVENT_INVALID_CREATION_CTX 1605 +#define ER_TRG_CANT_OPEN_TABLE 1606 +#define ER_CANT_CREATE_SROUTINE 1607 +#define ER_SLAVE_AMBIGOUS_EXEC_MODE 1608 +#define ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT 1609 +#define ER_SLAVE_CORRUPT_EVENT 1610 +#define ER_LOAD_DATA_INVALID_COLUMN 1611 +#define ER_LOG_PURGE_NO_FILE 1612 +#define ER_NEED_REPREPARE 1613 +#define ER_DELAYED_NOT_SUPPORTED 1614 +#define ER_WARN_AUTO_CONVERT_LOCK 1615 +#define ER_NO_AUTO_CONVERT_LOCK_STRICT 1616 +#define ER_NO_AUTO_CONVERT_LOCK_TRANSACTION 1617 +#define ER_NO_STORAGE_ENGINE 1618 +#define ER_BACKUP_BACKUP_START 1619 +#define ER_BACKUP_BACKUP_DONE 1620 +#define ER_BACKUP_RESTORE_START 1621 +#define ER_BACKUP_RESTORE_DONE 1622 +#define ER_BACKUP_NOTHING_TO_BACKUP 1623 +#define ER_BACKUP_CANNOT_INCLUDE_DB 1624 +#define ER_BACKUP_BACKUP 1625 +#define ER_BACKUP_RESTORE 1626 +#define ER_BACKUP_RUNNING 1627 +#define ER_BACKUP_BACKUP_PREPARE 1628 +#define ER_BACKUP_RESTORE_PREPARE 1629 +#define ER_BACKUP_INVALID_LOC 1630 +#define ER_BACKUP_READ_LOC 1631 +#define ER_BACKUP_WRITE_LOC 1632 +#define ER_BACKUP_LIST_DBS 1633 +#define ER_BACKUP_LIST_TABLES 1634 +#define ER_BACKUP_LIST_DB_TABLES 1635 +#define ER_BACKUP_SKIP_VIEW 1636 +#define ER_BACKUP_NO_ENGINE 1637 +#define ER_BACKUP_TABLE_OPEN 1638 +#define ER_BACKUP_READ_HEADER 1639 +#define ER_BACKUP_WRITE_HEADER 1640 +#define ER_BACKUP_NO_BACKUP_DRIVER 1641 +#define ER_BACKUP_NOT_ACCEPTED 1642 +#define ER_BACKUP_CREATE_BACKUP_DRIVER 1643 +#define ER_BACKUP_CREATE_RESTORE_DRIVER 1644 +#define ER_BACKUP_TOO_MANY_IMAGES 1645 +#define ER_BACKUP_WRITE_META 1646 +#define ER_BACKUP_READ_META 1647 +#define ER_BACKUP_CREATE_META 1648 +#define ER_BACKUP_GET_BUF 1649 +#define ER_BACKUP_WRITE_DATA 1650 +#define ER_BACKUP_READ_DATA 1651 +#define ER_BACKUP_NEXT_CHUNK 1652 +#define ER_BACKUP_INIT_BACKUP_DRIVER 1653 +#define ER_BACKUP_INIT_RESTORE_DRIVER 1654 +#define ER_BACKUP_STOP_BACKUP_DRIVER 1655 +#define ER_BACKUP_STOP_RESTORE_DRIVERS 1656 +#define ER_BACKUP_PREPARE_DRIVER 1657 +#define ER_BACKUP_CREATE_VP 1658 +#define ER_BACKUP_UNLOCK_DRIVER 1659 +#define ER_BACKUP_CANCEL_BACKUP 1660 +#define ER_BACKUP_CANCEL_RESTORE 1661 +#define ER_BACKUP_GET_DATA 1662 +#define ER_BACKUP_SEND_DATA 1663 +#define ER_BACKUP_SEND_DATA_RETRY 1664 +#define ER_BACKUP_OPEN_TABLES 1665 +#define ER_BACKUP_THREAD_INIT 1666 +#define ER_BACKUP_PROGRESS_TABLES 1667 +#define ER_TABLESPACE_EXIST 1668 +#define ER_NO_SUCH_TABLESPACE 1669 +#define ER_SLAVE_HEARTBEAT_FAILURE 1670 +#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE 1671 +#define ER_BACKUP_CANT_FIND_SE 1672 +#define ER_BACKUP_NO_NATIVE_BE 1673 +#define ER_BACKUP_UNKNOWN_BE 1674 +#define ER_BACKUP_WRONG_TABLE_BE 1675 +#define ER_BACKUP_CANT_RESTORE_DB 1676 +#define ER_BACKUP_CANT_RESTORE_TABLE 1677 +#define ER_BACKUP_CANT_RESTORE_VIEW 1678 +#define ER_BACKUP_CANT_RESTORE_SROUT 1679 +#define ER_BACKUP_CANT_RESTORE_EVENT 1680 +#define ER_BACKUP_CANT_RESTORE_TRIGGER 1681 +#define ER_BACKUP_CATALOG_ADD_DB 1682 +#define ER_BACKUP_CATALOG_ADD_TABLE 1683 +#define ER_BACKUP_CATALOG_ADD_VIEW 1684 +#define ER_BACKUP_CATALOG_ADD_SROUT 1685 +#define ER_BACKUP_CATALOG_ADD_EVENT 1686 +#define ER_BACKUP_CATALOG_ADD_TRIGGER 1687 +#define ER_BACKUP_UNKNOWN_OBJECT 1688 +#define ER_BACKUP_UNKNOWN_OBJECT_TYPE 1689 +#define ER_BACKUP_OPEN_WR 1690 +#define ER_BACKUP_OPEN_RD 1691 +#define ER_BACKUP_BAD_MAGIC 1692 +#define ER_BACKUP_CONTEXT_CREATE 1693 +#define ER_BACKUP_CONTEXT_REMOVE 1694 +#define ER_BAD_PATH 1695 +#define ER_DDL_BLOCK 1696 +#define ER_BACKUP_LOGGER_INIT 1697 +#define ER_BACKUP_WRITE_SUMMARY 1698 +#define ER_BACKUP_READ_SUMMARY 1699 +#define ER_BACKUP_GET_META_DB 1700 +#define ER_BACKUP_GET_META_TABLE 1701 +#define ER_BACKUP_GET_META_VIEW 1702 +#define ER_BACKUP_GET_META_SROUT 1703 +#define ER_BACKUP_GET_META_EVENT 1704 +#define ER_BACKUP_GET_META_TRIGGER 1705 +#define ER_BACKUP_CREATE_BE 1706 +#define ER_BACKUP_LIST_PERDB 1707 +#define ER_BACKUP_LIST_DB_VIEWS 1708 +#define ER_BACKUP_LIST_DB_SROUT 1709 +#define ER_BACKUP_LIST_DB_EVENTS 1710 +#define ER_BACKUP_LIST_DB_TRIGGERS 1711 +#define ER_BACKUP_LOG_WRITE_ERROR 1712 +#define ER_TABLESPACE_NOT_EMPTY 1713 +#define ER_BACKUP_CAT_ENUM 1714 +#define ER_BACKUP_CANT_RESTORE_TS 1715 +#define ER_BACKUP_TS_CHANGE 1716 +#define ER_BACKUP_GET_META_TS 1717 +#define ER_TABLESPACE_DATAFILE_EXIST 1718 +#define ER_BACKUP_CATALOG_ADD_TS 1719 +#define ER_DEBUG_SYNC_TIMEOUT 1720 +#define ER_DEBUG_SYNC_HIT_LIMIT 1721 +#define ER_BACKUP_FAILED_TO_INIT_COMPRESSION 1722 +#define ER_BACKUP_OBTAIN_NAME_LOCK_FAILED 1723 +#define ER_BACKUP_RELEASE_NAME_LOCK_FAILED 1724 +#define ER_BACKUP_BACKUPDIR 1725 +#define ER_ERROR_LAST 1725 diff --git a/externals/mysql/mysys/array.c b/externals/mysql/mysys/array.c new file mode 100644 index 00000000000..b31260344a9 --- /dev/null +++ b/externals/mysql/mysys/array.c @@ -0,0 +1,379 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Handling of arrays that can grow dynamicly. */ + +#include "mysys_priv.h" +#include "m_string.h" + +/* + Initiate dynamic array + + SYNOPSIS + init_dynamic_array2() + array Pointer to an array + element_size Size of element + init_buffer Initial buffer pointer + init_alloc Number of initial elements + alloc_increment Increment for adding new elements + + DESCRIPTION + init_dynamic_array() initiates array and allocate space for + init_alloc eilements. + Array is usable even if space allocation failed. + Static buffers must begin immediately after the array structure. + + RETURN VALUE + TRUE my_malloc_ci() failed + FALSE Ok +*/ + +my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, + void *init_buffer, uint init_alloc, + uint alloc_increment CALLER_INFO_PROTO) +{ + DBUG_ENTER("init_dynamic_array"); + if (!alloc_increment) + { + alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16); + if (init_alloc > 8 && alloc_increment > init_alloc * 2) + alloc_increment=init_alloc*2; + } + array->elements=0; + array->max_element=init_alloc; + array->alloc_increment=alloc_increment; + array->size_of_element=element_size; + if ((array->buffer= init_buffer)) + DBUG_RETURN(FALSE); + if (init_alloc && + !(array->buffer=(uchar*) my_malloc_ci(element_size*init_alloc, + MYF(MY_WME)))) + { + array->max_element=0; + DBUG_RETURN(TRUE); + } + DBUG_RETURN(FALSE); +} + +my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, + uint init_alloc, + uint alloc_increment CALLER_INFO_PROTO) +{ + /* placeholder to preserve ABI */ + return my_init_dynamic_array_ci(array, element_size, init_alloc, + alloc_increment); +} +/* + Insert element at the end of array. Allocate memory if needed. + + SYNOPSIS + insert_dynamic() + array + element + + RETURN VALUE + TRUE Insert failed + FALSE Ok +*/ + +my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar* element) +{ + uchar* buffer; + if (array->elements == array->max_element) + { /* Call only when nessesary */ + if (!(buffer=alloc_dynamic(array))) + return TRUE; + } + else + { + buffer=array->buffer+(array->elements * array->size_of_element); + array->elements++; + } + memcpy(buffer,element,(size_t) array->size_of_element); + return FALSE; +} + + +/* + Alloc space for next element(s) + + SYNOPSIS + alloc_dynamic() + array + + DESCRIPTION + alloc_dynamic() checks if there is empty space for at least + one element if not tries to allocate space for alloc_increment + elements at the end of array. + + RETURN VALUE + pointer Pointer to empty space for element + 0 Error +*/ + +uchar *alloc_dynamic(DYNAMIC_ARRAY *array) +{ + DBUG_ENTER("alloc_dynamic"); + if (array->elements == array->max_element) + { + char *new_ptr; + if (array->buffer == (uchar *)(array + 1)) + { + /* + In this senerio, the buffer is statically preallocated, + so we have to create an all-new malloc since we overflowed + */ + if (!(new_ptr= (char *) my_malloc((array->max_element+ + array->alloc_increment) * + array->size_of_element, + MYF(MY_WME)))) + DBUG_RETURN(0); + memcpy(new_ptr, array->buffer, + array->elements * array->size_of_element); + } + else if (!(new_ptr=(char*) + my_realloc(array->buffer,(array->max_element+ + array->alloc_increment)* + array->size_of_element, + MYF(MY_WME | MY_ALLOW_ZERO_PTR)))) + DBUG_RETURN(0); + array->buffer= (uchar*) new_ptr; + array->max_element+=array->alloc_increment; + } + DBUG_RETURN(array->buffer+(array->elements++ * array->size_of_element)); +} + + +/* + Pop last element from array. + + SYNOPSIS + pop_dynamic() + array + + RETURN VALUE + pointer Ok + 0 Array is empty +*/ + +uchar *pop_dynamic(DYNAMIC_ARRAY *array) +{ + if (array->elements) + return array->buffer+(--array->elements * array->size_of_element); + return 0; +} + +/* + Replace element in array with given element and index + + SYNOPSIS + set_dynamic() + array + element Element to be inserted + idx Index where element is to be inserted + + DESCRIPTION + set_dynamic() replaces element in array. + If idx > max_element insert new element. Allocate memory if needed. + + RETURN VALUE + TRUE Idx was out of range and allocation of new memory failed + FALSE Ok +*/ + +my_bool set_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx) +{ + if (idx >= array->elements) + { + if (idx >= array->max_element && allocate_dynamic(array, idx)) + return TRUE; + bzero((uchar*) (array->buffer+array->elements*array->size_of_element), + (idx - array->elements)*array->size_of_element); + array->elements=idx+1; + } + memcpy(array->buffer+(idx * array->size_of_element),element, + (size_t) array->size_of_element); + return FALSE; +} + + +/* + Ensure that dynamic array has enough elements + + SYNOPSIS + allocate_dynamic() + array + max_elements Numbers of elements that is needed + + NOTES + Any new allocated element are NOT initialized + + RETURN VALUE + FALSE Ok + TRUE Allocation of new memory failed +*/ + +my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements) +{ + DBUG_ENTER("allocate_dynamic"); + + if (max_elements >= array->max_element) + { + uint size; + uchar *new_ptr; + size= (max_elements + array->alloc_increment)/array->alloc_increment; + size*= array->alloc_increment; + if (array->buffer == (uchar *)(array + 1)) + { + /* + In this senerio, the buffer is statically preallocated, + so we have to create an all-new malloc since we overflowed + */ + if (!(new_ptr= (uchar *) my_malloc(size * + array->size_of_element, + MYF(MY_WME)))) + DBUG_RETURN(0); + memcpy(new_ptr, array->buffer, + array->elements * array->size_of_element); + } + else if (!(new_ptr= (uchar*) my_realloc(array->buffer,size* + array->size_of_element, + MYF(MY_WME | MY_ALLOW_ZERO_PTR)))) + DBUG_RETURN(TRUE); + array->buffer= new_ptr; + array->max_element= size; + } + DBUG_RETURN(FALSE); +} + + +/* + Get an element from array by given index + + SYNOPSIS + get_dynamic() + array + uchar* Element to be returned. If idx > elements contain zeroes. + idx Index of element wanted. +*/ + +void get_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx) +{ + if (idx >= array->elements) + { + DBUG_PRINT("warning",("To big array idx: %d, array size is %d", + idx,array->elements)); + bzero(element,array->size_of_element); + return; + } + memcpy(element,array->buffer+idx*array->size_of_element, + (size_t) array->size_of_element); +} + + +/* + Empty array by freeing all memory + + SYNOPSIS + delete_dynamic() + array Array to be deleted +*/ + +void delete_dynamic(DYNAMIC_ARRAY *array) +{ + /* + Just mark as empty if we are using a static buffer + */ + if (array->buffer == (uchar *)(array + 1)) + array->elements= 0; + else + if (array->buffer) + { + my_free(array->buffer,MYF(MY_WME)); + array->buffer=0; + array->elements=array->max_element=0; + } +} + +/* + Delete element by given index + + SYNOPSIS + delete_dynamic_element() + array + idx Index of element to be deleted +*/ + +void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx) +{ + char *ptr= (char*) array->buffer+array->size_of_element*idx; + array->elements--; + memmove(ptr,ptr+array->size_of_element, + (array->elements-idx)*array->size_of_element); +} + + +/* + Free unused memory + + SYNOPSIS + freeze_size() + array Array to be freed + +*/ + +void freeze_size(DYNAMIC_ARRAY *array) +{ + uint elements=max(array->elements,1); + + /* + Do nothing if we are using a static buffer + */ + if (array->buffer == (uchar *)(array + 1)) + return; + + if (array->buffer && array->max_element != elements) + { + array->buffer=(uchar*) my_realloc(array->buffer, + elements*array->size_of_element, + MYF(MY_WME)); + array->max_element=elements; + } +} + + +/* + Get the index of a dynamic element + + SYNOPSIS + get_index_dynamic() + array Array + element Whose element index + +*/ + +int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element) +{ + uint ret; + if (array->buffer > element) + return -1; + + ret= (element - array->buffer) / array->size_of_element; + if (ret > array->elements) + return -1; + + return ret; + +} diff --git a/externals/mysql/mysys/base64.c b/externals/mysql/mysys/base64.c new file mode 100644 index 00000000000..7e69ab54500 --- /dev/null +++ b/externals/mysql/mysys/base64.c @@ -0,0 +1,311 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include /* strchr() */ +#include /* my_isspace() */ +#include + +#ifndef MAIN + +static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + + +int +my_base64_needed_encoded_length(int length_of_data) +{ + int nb_base64_chars; + nb_base64_chars= (length_of_data + 2) / 3 * 4; + + return + nb_base64_chars + /* base64 char incl padding */ + (nb_base64_chars - 1)/ 76 + /* newlines */ + 1; /* NUL termination of string */ +} + + +int +my_base64_needed_decoded_length(int length_of_encoded_data) +{ + return (int) ceil(length_of_encoded_data * 3 / 4); +} + + +/* + Encode a data as base64. + + Note: We require that dst is pre-allocated to correct size. + See my_base64_needed_encoded_length(). +*/ + +int +my_base64_encode(const void *src, size_t src_len, char *dst) +{ + const unsigned char *s= (const unsigned char*)src; + size_t i= 0; + size_t len= 0; + + for (; i < src_len; len += 4) + { + unsigned c; + + if (len == 76) + { + len= 0; + *dst++= '\n'; + } + + c= s[i++]; + c <<= 8; + + if (i < src_len) + c += s[i]; + c <<= 8; + i++; + + if (i < src_len) + c += s[i]; + i++; + + *dst++= base64_table[(c >> 18) & 0x3f]; + *dst++= base64_table[(c >> 12) & 0x3f]; + + if (i > (src_len + 1)) + *dst++= '='; + else + *dst++= base64_table[(c >> 6) & 0x3f]; + + if (i > src_len) + *dst++= '='; + else + *dst++= base64_table[(c >> 0) & 0x3f]; + } + *dst= '\0'; + + return 0; +} + + +static inline uint +pos(unsigned char c) +{ + return (uint) (strchr(base64_table, c) - base64_table); +} + + +#define SKIP_SPACE(src, i, size) \ +{ \ + while (i < size && my_isspace(&my_charset_latin1, * src)) \ + { \ + i++; \ + src++; \ + } \ + if (i == size) \ + { \ + break; \ + } \ +} + + +/* + Decode a base64 string + + SYNOPSIS + base64_decode() + src Pointer to base64-encoded string + len Length of string at 'src' + dst Pointer to location where decoded data will be stored + end_ptr Pointer to variable that will refer to the character + after the end of the encoded data that were decoded. Can + be NULL. + + DESCRIPTION + + The base64-encoded data in the range ['src','*end_ptr') will be + decoded and stored starting at 'dst'. The decoding will stop + after 'len' characters have been read from 'src', or when padding + occurs in the base64-encoded data. In either case: if 'end_ptr' is + non-null, '*end_ptr' will be set to point to the character after + the last read character, even in the presence of error. + + NOTE + We require that 'dst' is pre-allocated to correct size. + + SEE ALSO + my_base64_needed_decoded_length(). + + RETURN VALUE + Number of bytes written at 'dst' or -1 in case of failure +*/ +int +my_base64_decode(const char *src_base, size_t len, + void *dst, const char **end_ptr) +{ + char b[3]; + size_t i= 0; + char *dst_base= (char *)dst; + char const *src= src_base; + char *d= dst_base; + size_t j; + + while (i < len) + { + unsigned c= 0; + size_t mark= 0; + + SKIP_SPACE(src, i, len); + + c += pos(*src++); + c <<= 6; + i++; + + SKIP_SPACE(src, i, len); + + c += pos(*src++); + c <<= 6; + i++; + + SKIP_SPACE(src, i, len); + + if (*src != '=') + c += pos(*src++); + else + { + src += 2; /* There should be two bytes padding */ + i= len; + mark= 2; + c <<= 6; + goto end; + } + c <<= 6; + i++; + + SKIP_SPACE(src, i, len); + + if (*src != '=') + c += pos(*src++); + else + { + src += 1; /* There should be one byte padding */ + i= len; + mark= 1; + goto end; + } + i++; + + end: + b[0]= (c >> 16) & 0xff; + b[1]= (c >> 8) & 0xff; + b[2]= (c >> 0) & 0xff; + + for (j=0; j<3-mark; j++) + *d++= b[j]; + } + + if (end_ptr != NULL) + *end_ptr= src; + + /* + The variable 'i' is set to 'len' when padding has been read, so it + does not actually reflect the number of bytes read from 'src'. + */ + return i != len ? -1 : (int) (d - dst_base); +} + + +#else /* MAIN */ + +#define require(b) { \ + if (!(b)) { \ + printf("Require failed at %s:%d\n", __FILE__, __LINE__); \ + abort(); \ + } \ +} + + +int +main(void) +{ + int i; + size_t j; + size_t k, l; + size_t dst_len; + size_t needed_length; + + for (i= 0; i < 500; i++) + { + /* Create source data */ + const size_t src_len= rand() % 1000 + 1; + + char * src= (char *) malloc(src_len); + char * s= src; + char * str; + char * dst; + + require(src); + for (j= 0; jname; cs++) + add_compiled_collation(cs); + + return FALSE; +} diff --git a/externals/mysql/mysys/charset.c b/externals/mysql/mysys/charset.c new file mode 100644 index 00000000000..a327b243e57 --- /dev/null +++ b/externals/mysql/mysys/charset.c @@ -0,0 +1,915 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include +#include +#include + + +/* + The code below implements this functionality: + + - Initializing charset related structures + - Loading dynamic charsets + - Searching for a proper CHARSET_INFO + using charset name, collation name or collation ID + - Setting server default character set +*/ + +my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2) +{ + return ((cs1 == cs2) || !strcmp(cs1->csname,cs2->csname)); +} + + +static uint +get_collation_number_internal(const char *name) +{ + CHARSET_INFO **cs; + for (cs= all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if ( cs[0] && cs[0]->name && + !my_strcasecmp(&my_charset_latin1, cs[0]->name, name)) + return cs[0]->number; + } + return 0; +} + + +static my_bool init_state_maps(CHARSET_INFO *cs) +{ + uint i; + uchar *state_map; + uchar *ident_map; + + if (!(cs->state_map= (uchar*) my_once_alloc(256, MYF(MY_WME)))) + return 1; + + if (!(cs->ident_map= (uchar*) my_once_alloc(256, MYF(MY_WME)))) + return 1; + + state_map= cs->state_map; + ident_map= cs->ident_map; + + /* Fill state_map with states to get a faster parser */ + for (i=0; i < 256 ; i++) + { + if (my_isalpha(cs,i)) + state_map[i]=(uchar) MY_LEX_IDENT; + else if (my_isdigit(cs,i)) + state_map[i]=(uchar) MY_LEX_NUMBER_IDENT; +#if defined(USE_MB) && defined(USE_MB_IDENT) + else if (my_mbcharlen(cs, i)>1) + state_map[i]=(uchar) MY_LEX_IDENT; +#endif + else if (my_isspace(cs,i)) + state_map[i]=(uchar) MY_LEX_SKIP; + else + state_map[i]=(uchar) MY_LEX_CHAR; + } + state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) MY_LEX_IDENT; + state_map[(uchar)'\'']=(uchar) MY_LEX_STRING; + state_map[(uchar)'.']=(uchar) MY_LEX_REAL_OR_POINT; + state_map[(uchar)'>']=state_map[(uchar)'=']=state_map[(uchar)'!']= (uchar) MY_LEX_CMP_OP; + state_map[(uchar)'<']= (uchar) MY_LEX_LONG_CMP_OP; + state_map[(uchar)'&']=state_map[(uchar)'|']=(uchar) MY_LEX_BOOL; + state_map[(uchar)'#']=(uchar) MY_LEX_COMMENT; + state_map[(uchar)';']=(uchar) MY_LEX_SEMICOLON; + state_map[(uchar)':']=(uchar) MY_LEX_SET_VAR; + state_map[0]=(uchar) MY_LEX_EOL; + state_map[(uchar)'\\']= (uchar) MY_LEX_ESCAPE; + state_map[(uchar)'/']= (uchar) MY_LEX_LONG_COMMENT; + state_map[(uchar)'*']= (uchar) MY_LEX_END_LONG_COMMENT; + state_map[(uchar)'@']= (uchar) MY_LEX_USER_END; + state_map[(uchar) '`']= (uchar) MY_LEX_USER_VARIABLE_DELIMITER; + state_map[(uchar)'"']= (uchar) MY_LEX_STRING_OR_DELIMITER; + + /* + Create a second map to make it faster to find identifiers + */ + for (i=0; i < 256 ; i++) + { + ident_map[i]= (uchar) (state_map[i] == MY_LEX_IDENT || + state_map[i] == MY_LEX_NUMBER_IDENT); + } + + /* Special handling of hex and binary strings */ + state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) MY_LEX_IDENT_OR_HEX; + state_map[(uchar)'b']= state_map[(uchar)'B']= (uchar) MY_LEX_IDENT_OR_BIN; + state_map[(uchar)'n']= state_map[(uchar)'N']= (uchar) MY_LEX_IDENT_OR_NCHAR; + return 0; +} + + +static void simple_cs_init_functions(CHARSET_INFO *cs) +{ + if (cs->state & MY_CS_BINSORT) + cs->coll= &my_collation_8bit_bin_handler; + else + cs->coll= &my_collation_8bit_simple_ci_handler; + + cs->cset= &my_charset_8bit_handler; +} + + + +static int cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) +{ + to->number= from->number ? from->number : to->number; + + if (from->csname) + if (!(to->csname= my_once_strdup(from->csname,MYF(MY_WME)))) + goto err; + + if (from->name) + if (!(to->name= my_once_strdup(from->name,MYF(MY_WME)))) + goto err; + + if (from->comment) + if (!(to->comment= my_once_strdup(from->comment,MYF(MY_WME)))) + goto err; + + if (from->ctype) + { + if (!(to->ctype= (uchar*) my_once_memdup((char*) from->ctype, + MY_CS_CTYPE_TABLE_SIZE, + MYF(MY_WME)))) + goto err; + if (init_state_maps(to)) + goto err; + } + if (from->to_lower) + if (!(to->to_lower= (uchar*) my_once_memdup((char*) from->to_lower, + MY_CS_TO_LOWER_TABLE_SIZE, + MYF(MY_WME)))) + goto err; + + if (from->to_upper) + if (!(to->to_upper= (uchar*) my_once_memdup((char*) from->to_upper, + MY_CS_TO_UPPER_TABLE_SIZE, + MYF(MY_WME)))) + goto err; + if (from->sort_order) + { + if (!(to->sort_order= (uchar*) my_once_memdup((char*) from->sort_order, + MY_CS_SORT_ORDER_TABLE_SIZE, + MYF(MY_WME)))) + goto err; + + } + if (from->tab_to_uni) + { + uint sz= MY_CS_TO_UNI_TABLE_SIZE*sizeof(uint16); + if (!(to->tab_to_uni= (uint16*) my_once_memdup((char*)from->tab_to_uni, + sz, MYF(MY_WME)))) + goto err; + } + if (from->tailoring) + if (!(to->tailoring= my_once_strdup(from->tailoring,MYF(MY_WME)))) + goto err; + + return 0; + +err: + return 1; +} + + + +static my_bool simple_cs_is_full(CHARSET_INFO *cs) +{ + return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper && + cs->to_lower) && + (cs->number && cs->name && + (cs->sort_order || (cs->state & MY_CS_BINSORT) ))); +} + + +static void +copy_uca_collation(CHARSET_INFO *to, CHARSET_INFO *from) +{ + to->cset= from->cset; + to->coll= from->coll; + to->strxfrm_multiply= from->strxfrm_multiply; + to->min_sort_char= from->min_sort_char; + to->max_sort_char= from->max_sort_char; + to->mbminlen= from->mbminlen; + to->mbmaxlen= from->mbmaxlen; + to->state|= MY_CS_AVAILABLE | MY_CS_LOADED | + MY_CS_STRNXFRM | MY_CS_UNICODE; +} + + +static int add_collation(CHARSET_INFO *cs) +{ + if (cs->name && (cs->number || + (cs->number=get_collation_number_internal(cs->name)))) + { + if (!all_charsets[cs->number]) + { + if (!(all_charsets[cs->number]= + (CHARSET_INFO*) my_once_alloc(sizeof(CHARSET_INFO),MYF(0)))) + return MY_XML_ERROR; + bzero((void*)all_charsets[cs->number],sizeof(CHARSET_INFO)); + } + + if (cs->primary_number == cs->number) + cs->state |= MY_CS_PRIMARY; + + if (cs->binary_number == cs->number) + cs->state |= MY_CS_BINSORT; + + all_charsets[cs->number]->state|= cs->state; + + if (!(all_charsets[cs->number]->state & MY_CS_COMPILED)) + { + CHARSET_INFO *newcs= all_charsets[cs->number]; + if (cs_copy_data(all_charsets[cs->number],cs)) + return MY_XML_ERROR; + + newcs->levels_for_compare= 1; + newcs->levels_for_order= 1; + + if (!strcmp(cs->csname,"ucs2") ) + { +#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS) + copy_uca_collation(newcs, &my_charset_ucs2_unicode_ci); + newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; +#endif + } + else if (!strcmp(cs->csname, "utf8")) + { +#if defined (HAVE_CHARSET_utf8mb3) && defined(HAVE_UCA_COLLATIONS) + copy_uca_collation(newcs, &my_charset_utf8mb4_unicode_ci); + newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED; +#endif + } + else if (!strcmp(cs->csname, "utf8mb3")) + { +#if defined (HAVE_CHARSET_utf8mb3) && defined(HAVE_UCA_COLLATIONS) + copy_uca_collation(newcs, &my_charset_utf8mb3_unicode_ci); + newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED; +#endif + } + else if (!strcmp(cs->csname, "utf16")) + { +#if defined (HAVE_CHARSET_utf16) && defined(HAVE_UCA_COLLATIONS) + copy_uca_collation(newcs, &my_charset_utf16_unicode_ci); + newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; +#endif + } + else if (!strcmp(cs->csname, "utf32")) + { +#if defined (HAVE_CHARSET_utf32) && defined(HAVE_UCA_COLLATIONS) + copy_uca_collation(newcs, &my_charset_utf32_unicode_ci); + newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; +#endif + } + else + { + uchar *sort_order= all_charsets[cs->number]->sort_order; + simple_cs_init_functions(all_charsets[cs->number]); + newcs->mbminlen= 1; + newcs->mbmaxlen= 1; + if (simple_cs_is_full(all_charsets[cs->number])) + { + all_charsets[cs->number]->state |= MY_CS_LOADED; + } + all_charsets[cs->number]->state|= MY_CS_AVAILABLE; + + /* + Check if case sensitive sort order: A < a < B. + We need MY_CS_FLAG for regex library, and for + case sensitivity flag for 5.0 client protocol, + to support isCaseSensitive() method in JDBC driver + */ + if (sort_order && sort_order['A'] < sort_order['a'] && + sort_order['a'] < sort_order['B']) + all_charsets[cs->number]->state|= MY_CS_CSSORT; + + if (my_charset_is_8bit_pure_ascii(all_charsets[cs->number])) + all_charsets[cs->number]->state|= MY_CS_PUREASCII; + if (!my_charset_is_ascii_compatible(cs)) + all_charsets[cs->number]->state|= MY_CS_NONASCII; + } + } + else + { + /* + We need the below to make get_charset_name() + and get_charset_number() working even if a + character set has not been really incompiled. + The above functions are used for example + in error message compiler extra/comp_err.c. + If a character set was compiled, this information + will get lost and overwritten in add_compiled_collation(). + */ + CHARSET_INFO *dst= all_charsets[cs->number]; + dst->number= cs->number; + if (cs->comment) + if (!(dst->comment= my_once_strdup(cs->comment,MYF(MY_WME)))) + return MY_XML_ERROR; + if (cs->csname && !dst->csname) + if (!(dst->csname= my_once_strdup(cs->csname,MYF(MY_WME)))) + return MY_XML_ERROR; + if (cs->name && !dst->name) + if (!(dst->name= my_once_strdup(cs->name,MYF(MY_WME)))) + return MY_XML_ERROR; + } + cs->number= 0; + cs->primary_number= 0; + cs->binary_number= 0; + cs->name= NULL; + cs->state= 0; + cs->sort_order= NULL; + cs->state= 0; + } + return MY_XML_OK; +} + + +#define MY_MAX_ALLOWED_BUF 1024*1024 +#define MY_CHARSET_INDEX "Index.xml" + +const char *charsets_dir= NULL; +static int charset_initialized=0; + + +static my_bool my_read_charset_file(const char *filename, myf myflags) +{ + uchar *buf; + int fd; + uint len, tmp_len; + MY_STAT stat_info; + + if (!my_stat(filename, &stat_info, MYF(myflags)) || + ((len= (uint)stat_info.st_size) > MY_MAX_ALLOWED_BUF) || + !(buf= (uchar*) my_malloc(len,myflags))) + return TRUE; + + if ((fd=my_open(filename,O_RDONLY,myflags)) < 0) + goto error; + tmp_len=my_read(fd, buf, len, myflags); + my_close(fd,myflags); + if (tmp_len != len) + goto error; + + if (my_parse_charset_xml((char*) buf,len,add_collation)) + { +#ifdef NOT_YET + printf("ERROR at line %d pos %d '%s'\n", + my_xml_error_lineno(&p)+1, + my_xml_error_pos(&p), + my_xml_error_string(&p)); +#endif + } + + my_free(buf, myflags); + return FALSE; + +error: + my_free(buf, myflags); + return TRUE; +} + + +char *get_charsets_dir(char *buf) +{ + const char *sharedir= SHAREDIR; + char *res; + DBUG_ENTER("get_charsets_dir"); + + if (charsets_dir != NULL) + strmake(buf, charsets_dir, FN_REFLEN-1); + else + { + if (test_if_hard_path(sharedir) || + is_prefix(sharedir, DEFAULT_CHARSET_HOME)) + strxmov(buf, sharedir, "/", CHARSET_DIR, NullS); + else + strxmov(buf, DEFAULT_CHARSET_HOME, "/", sharedir, "/", CHARSET_DIR, + NullS); + } + res= convert_dirname(buf,buf,NullS); + DBUG_PRINT("info",("charsets dir: '%s'", buf)); + DBUG_RETURN(res); +} + +CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]; +CHARSET_INFO *default_charset_info = &my_charset_latin1; + +void add_compiled_collation(CHARSET_INFO *cs) +{ + all_charsets[cs->number]= cs; + cs->state|= MY_CS_AVAILABLE; +} + +static void *cs_alloc(size_t size) +{ + return my_once_alloc(size, MYF(MY_WME)); +} + + +#ifdef __NETWARE__ +my_bool STDCALL init_available_charsets(myf myflags) +#else +static my_bool init_available_charsets(myf myflags) +#endif +{ + char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)]; + my_bool error=FALSE; + /* + We have to use charset_initialized to not lock on THR_LOCK_charset + inside get_internal_charset... + */ + if (!charset_initialized) + { + CHARSET_INFO **cs; + /* + To make things thread safe we are not allowing other threads to interfere + while we may changing the cs_info_table + */ + pthread_mutex_lock(&THR_LOCK_charset); + if (!charset_initialized) + { + bzero(&all_charsets,sizeof(all_charsets)); + init_compiled_charsets(myflags); + + /* Copy compiled charsets */ + for (cs=all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if (*cs) + { + if (cs[0]->ctype) + if (init_state_maps(*cs)) + *cs= NULL; + } + } + + strmov(get_charsets_dir(fname), MY_CHARSET_INDEX); + error= my_read_charset_file(fname,myflags); + charset_initialized=1; + } + pthread_mutex_unlock(&THR_LOCK_charset); + } + return error; +} + + +void free_charsets(void) +{ + charset_initialized=0; +} + + +uint get_collation_number(const char *name) +{ + init_available_charsets(MYF(0)); + return get_collation_number_internal(name); +} + + +uint get_charset_number(const char *charset_name, uint cs_flags) +{ + CHARSET_INFO **cs; + init_available_charsets(MYF(0)); + + for (cs= all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) && + !my_strcasecmp(&my_charset_latin1, cs[0]->csname, charset_name)) + return cs[0]->number; + } + return 0; +} + + +const char *get_charset_name(uint charset_number) +{ + CHARSET_INFO *cs; + init_available_charsets(MYF(0)); + + cs=all_charsets[charset_number]; + if (cs && (cs->number == charset_number) && cs->name ) + return (char*) cs->name; + + return (char*) "?"; /* this mimics find_type() */ +} + + +static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) +{ + char buf[FN_REFLEN]; + CHARSET_INFO *cs; + + if ((cs= all_charsets[cs_number])) + { + if (cs->state & MY_CS_READY) /* if CS is already initialized */ + return cs; + + /* + To make things thread safe we are not allowing other threads to interfere + while we may changing the cs_info_table + */ + pthread_mutex_lock(&THR_LOCK_charset); + + if (!(cs->state & (MY_CS_COMPILED|MY_CS_LOADED))) /* if CS is not in memory */ + { + strxmov(get_charsets_dir(buf), cs->csname, ".xml", NullS); + my_read_charset_file(buf,flags); + } + + if (cs->state & MY_CS_AVAILABLE) + { + if (!(cs->state & MY_CS_READY)) + { + if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) || + (cs->coll->init && cs->coll->init(cs, cs_alloc))) + cs= NULL; + else + cs->state|= MY_CS_READY; + } + } + else + cs= NULL; + + pthread_mutex_unlock(&THR_LOCK_charset); + } + return cs; +} + + +CHARSET_INFO *get_charset(uint cs_number, myf flags) +{ + CHARSET_INFO *cs; + if (cs_number == default_charset_info->number) + return default_charset_info; + + (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ + + if (!cs_number || cs_number > array_elements(all_charsets)) + return NULL; + + cs=get_internal_charset(cs_number, flags); + + if (!cs && (flags & MY_WME)) + { + char index_file[FN_REFLEN + sizeof(MY_CHARSET_INDEX)], cs_string[23]; + strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); + cs_string[0]='#'; + int10_to_str(cs_number, cs_string+1, 10); + my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_string, index_file); + } + return cs; +} + +CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) +{ + uint cs_number; + CHARSET_INFO *cs; + (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ + + cs_number=get_collation_number(cs_name); + cs= cs_number ? get_internal_charset(cs_number,flags) : NULL; + + if (!cs && (flags & MY_WME)) + { + char index_file[FN_REFLEN + sizeof(MY_CHARSET_INDEX)]; + strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); + my_error(EE_UNKNOWN_COLLATION, MYF(ME_BELL), cs_name, index_file); + } + + return cs; +} + + +CHARSET_INFO *get_charset_by_csname(const char *cs_name, + uint cs_flags, + myf flags) +{ + uint cs_number; + CHARSET_INFO *cs; + DBUG_ENTER("get_charset_by_csname"); + DBUG_PRINT("enter",("name: '%s'", cs_name)); + + (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ + + cs_number= get_charset_number(cs_name, cs_flags); + cs= cs_number ? get_internal_charset(cs_number, flags) : NULL; + + if (!cs && (flags & MY_WME)) + { + char index_file[FN_REFLEN + sizeof(MY_CHARSET_INDEX)]; + strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); + my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_name, index_file); + } + + DBUG_RETURN(cs); +} + + +/** + Resolve character set by the character set name (utf8, latin1, ...). + + The function tries to resolve character set by the specified name. If + there is character set with the given name, it is assigned to the "cs" + parameter and FALSE is returned. If there is no such character set, + "default_cs" is assigned to the "cs" and TRUE is returned. + + @param[in] cs_name Character set name. + @param[in] default_cs Default character set. + @param[out] cs Variable to store character set. + + @return FALSE if character set was resolved successfully; TRUE if there + is no character set with given name. +*/ + +my_bool resolve_charset(const char *cs_name, + CHARSET_INFO *default_cs, + CHARSET_INFO **cs) +{ + *cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)); + + if (*cs == NULL) + { + *cs= default_cs; + return TRUE; + } + + return FALSE; +} + + +/** + Resolve collation by the collation name (utf8_general_ci, ...). + + The function tries to resolve collation by the specified name. If there + is collation with the given name, it is assigned to the "cl" parameter + and FALSE is returned. If there is no such collation, "default_cl" is + assigned to the "cl" and TRUE is returned. + + @param[out] cl Variable to store collation. + @param[in] cl_name Collation name. + @param[in] default_cl Default collation. + + @return FALSE if collation was resolved successfully; TRUE if there is no + collation with given name. +*/ + +my_bool resolve_collation(const char *cl_name, + CHARSET_INFO *default_cl, + CHARSET_INFO **cl) +{ + *cl= get_charset_by_name(cl_name, MYF(0)); + + if (*cl == NULL) + { + *cl= default_cl; + return TRUE; + } + + return FALSE; +} + + +/* + Escape string with backslashes (\) + + SYNOPSIS + escape_string_for_mysql() + charset_info Charset of the strings + to Buffer for escaped string + to_length Length of destination buffer, or 0 + from The string to escape + length The length of the string to escape + + DESCRIPTION + This escapes the contents of a string by adding backslashes before special + characters, and turning others into specific escape sequences, such as + turning newlines into \n and null bytes into \0. + + NOTE + To maintain compatibility with the old C API, to_length may be 0 to mean + "big enough" + + RETURN VALUES + (size_t) -1 The escaped string did not fit in the to buffer + # The length of the escaped string +*/ + +size_t escape_string_for_mysql(CHARSET_INFO *charset_info, + char *to, size_t to_length, + const char *from, size_t length) +{ + const char *to_start= to; + const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length); + my_bool overflow= FALSE; +#ifdef USE_MB + my_bool use_mb_flag= use_mb(charset_info); +#endif + for (end= from + length; from < end; from++) + { + char escape= 0; +#ifdef USE_MB + int tmp_length; + if (use_mb_flag && (tmp_length= my_ismbchar(charset_info, from, end))) + { + if (to + tmp_length > to_end) + { + overflow= TRUE; + break; + } + while (tmp_length--) + *to++= *from++; + from--; + continue; + } + /* + If the next character appears to begin a multi-byte character, we + escape that first byte of that apparent multi-byte character. (The + character just looks like a multi-byte character -- if it were actually + a multi-byte character, it would have been passed through in the test + above.) + + Without this check, we can create a problem by converting an invalid + multi-byte character into a valid one. For example, 0xbf27 is not + a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) + */ + if (use_mb_flag && (tmp_length= my_mbcharlen(charset_info, *from)) > 1) + escape= *from; + else +#endif + switch (*from) { + case 0: /* Must be escaped for 'mysql' */ + escape= '0'; + break; + case '\n': /* Must be escaped for logs */ + escape= 'n'; + break; + case '\r': + escape= 'r'; + break; + case '\\': + escape= '\\'; + break; + case '\'': + escape= '\''; + break; + case '"': /* Better safe than sorry */ + escape= '"'; + break; + case '\032': /* This gives problems on Win32 */ + escape= 'Z'; + break; + } + if (escape) + { + if (to + 2 > to_end) + { + overflow= TRUE; + break; + } + *to++= '\\'; + *to++= escape; + } + else + { + if (to + 1 > to_end) + { + overflow= TRUE; + break; + } + *to++= *from; + } + } + *to= 0; + return overflow ? (size_t) -1 : (size_t) (to - to_start); +} + + +#ifdef BACKSLASH_MBTAIL +static CHARSET_INFO *fs_cset_cache= NULL; + +CHARSET_INFO *fs_character_set() +{ + if (!fs_cset_cache) + { + char buf[10]= "cp"; + GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, + buf+2, sizeof(buf)-3); + /* + We cannot call get_charset_by_name here + because fs_character_set() is executed before + LOCK_THD_charset mutex initialization, which + is used inside get_charset_by_name. + As we're now interested in cp932 only, + let's just detect it using strcmp(). + */ + fs_cset_cache= !strcmp(buf, "cp932") ? + &my_charset_cp932_japanese_ci : &my_charset_bin; + } + return fs_cset_cache; +} +#endif + +/* + Escape apostrophes by doubling them up + + SYNOPSIS + escape_quotes_for_mysql() + charset_info Charset of the strings + to Buffer for escaped string + to_length Length of destination buffer, or 0 + from The string to escape + length The length of the string to escape + + DESCRIPTION + This escapes the contents of a string by doubling up any apostrophes that + it contains. This is used when the NO_BACKSLASH_ESCAPES SQL_MODE is in + effect on the server. + + NOTE + To be consistent with escape_string_for_mysql(), to_length may be 0 to + mean "big enough" + + RETURN VALUES + ~0 The escaped string did not fit in the to buffer + >=0 The length of the escaped string +*/ + +size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, + char *to, size_t to_length, + const char *from, size_t length) +{ + const char *to_start= to; + const char *end, *to_end=to_start + (to_length ? to_length-1 : 2*length); + my_bool overflow= FALSE; +#ifdef USE_MB + my_bool use_mb_flag= use_mb(charset_info); +#endif + for (end= from + length; from < end; from++) + { +#ifdef USE_MB + int tmp_length; + if (use_mb_flag && (tmp_length= my_ismbchar(charset_info, from, end))) + { + if (to + tmp_length > to_end) + { + overflow= TRUE; + break; + } + while (tmp_length--) + *to++= *from++; + from--; + continue; + } + /* + We don't have the same issue here with a non-multi-byte character being + turned into a multi-byte character by the addition of an escaping + character, because we are only escaping the ' character with itself. + */ +#endif + if (*from == '\'') + { + if (to + 2 > to_end) + { + overflow= TRUE; + break; + } + *to++= '\''; + *to++= '\''; + } + else + { + if (to + 1 > to_end) + { + overflow= TRUE; + break; + } + *to++= *from; + } + } + *to= 0; + return overflow ? (ulong)~0 : (ulong) (to - to_start); +} diff --git a/externals/mysql/mysys/checksum.c b/externals/mysql/mysys/checksum.c new file mode 100644 index 00000000000..1d264b54321 --- /dev/null +++ b/externals/mysql/mysys/checksum.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +ha_checksum my_crc_dbug_check= 1; /* Unlikely number */ + +/* + Calculate a long checksum for a memoryblock. + + SYNOPSIS + my_checksum() + crc start value for crc + pos pointer to memory block + length length of the block +*/ + +ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length) +{ + crc= (ha_checksum) crc32((uint)crc, pos, length); + DBUG_PRINT("info", ("crc: %lu", (ulong) crc)); + if (crc == my_crc_dbug_check) + my_debug_put_break_here(); + return crc; +} diff --git a/externals/mysql/mysys/default.c b/externals/mysql/mysys/default.c new file mode 100644 index 00000000000..5e440b43fdd --- /dev/null +++ b/externals/mysql/mysys/default.c @@ -0,0 +1,1172 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/**************************************************************************** + Add all options from files named "group".cnf from the default_directories + before the command line arguments. + On Windows defaults will also search in the Windows directory for a file + called 'group'.ini + As long as the program uses the last argument for conflicting + options one only have to add a call to "load_defaults" to enable + use of default values. + pre- and end 'blank space' are removed from options and values. The + following escape sequences are recognized in values: \b \t \n \r \\ + + The following arguments are handled automaticly; If used, they must be + first argument on the command line! + --no-defaults ; no options are read. + --defaults-file=full-path-to-default-file ; Only this file will be read. + --defaults-extra-file=full-path-to-default-file ; Read this file before ~/ + --defaults-group-suffix ; Also read groups with concat(group, suffix) + --print-defaults ; Print the modified command line and exit +****************************************************************************/ + +#include "mysys_priv.h" +#include "m_string.h" +#include "m_ctype.h" +#include +#ifdef __WIN__ +#include +#endif + +/** + arguments separator + + load_defaults() loads arguments from config file and put them + before the arguments from command line, this separator is used to + separate the arguments loaded from config file and arguments user + provided on command line. + + Options with value loaded from config file are always in the form + '--option=value', while for command line options, the value can be + given as the next argument. Thus we used a separator so that + handle_options() can distinguish them. + + Note: any other places that does not need to distinguish them + should skip the separator. + + The content of arguments separator does not matter, one should only + check the pointer, use "----args-separator----" here to ease debug + if someone misused it. + + See BUG#25192 +*/ +const char *args_separator= "----args-separator----"; +const char *my_defaults_file=0; +const char *my_defaults_group_suffix=0; +char *my_defaults_extra_file=0; + +/* Which directories are searched for options (and in which order) */ + +#define MAX_DEFAULT_DIRS 6 +#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ +static const char **default_directories = NULL; + +#ifdef __WIN__ +static const char *f_extensions[]= { ".ini", ".cnf", 0 }; +#define NEWLINE "\r\n" +#else +static const char *f_extensions[]= { ".cnf", 0 }; +#define NEWLINE "\n" +#endif + +static int handle_default_option(void *in_ctx, const char *group_name, + const char *option); + +/* + This structure defines the context that we pass to callback + function 'handle_default_option' used in search_default_file + to process each option. This context is used if search_default_file + was called from load_defaults. +*/ + +struct handle_option_ctx +{ + MEM_ROOT *alloc; + DYNAMIC_ARRAY *args; + TYPELIB *group; +}; + +static int search_default_file(Process_option_func func, void *func_ctx, + const char *dir, const char *config_file); +static int search_default_file_with_ext(Process_option_func func, + void *func_ctx, + const char *dir, const char *ext, + const char *config_file, int recursion_level); + + +/** + Create the list of default directories. + + @param alloc MEM_ROOT where the list of directories is stored + + @details + The directories searched, in order, are: + - Windows: GetSystemWindowsDirectory() + - Windows: GetWindowsDirectory() + - Windows: C:/ + - Windows: Directory above where the executable is located + - Netware: sys:/etc/ + - Unix: /etc/ + - Unix: /etc/mysql/ + - Unix: --sysconfdir= (compile-time option) + - ALL: getenv(DEFAULT_HOME_ENV) + - ALL: --defaults-extra-file= (run-time option) + - Unix: ~/ + + On all systems, if a directory is already in the list, it will be moved + to the end of the list. This avoids reading defaults files multiple times, + while ensuring the correct precedence. + + @retval NULL Failure (out of memory, probably) + @retval other Pointer to NULL-terminated array of default directories +*/ + +static const char **init_default_directories(MEM_ROOT *alloc); + + +static char *remove_end_comment(char *ptr); + + +/* + Process config files in default directories. + + SYNOPSIS + my_search_option_files() + conf_file Basename for configuration file to search for. + If this is a path, then only this file is read. + argc Pointer to argc of original program + argv Pointer to argv of original program + args_used Pointer to variable for storing the number of + arguments used. + func Pointer to the function to process options + func_ctx It's context. Usually it is the structure to + store additional options. + DESCRIPTION + Process the default options from argc & argv + Read through each found config file looks and calls 'func' to process + each option. + + NOTES + --defaults-group-suffix is only processed if we are called from + load_defaults(). + + + RETURN + 0 ok + 1 given cinf_file doesn't exist + 2 out of memory + + The global variable 'my_defaults_group_suffix' is updated with value for + --defaults_group_suffix +*/ + +int my_search_option_files(const char *conf_file, int *argc, char ***argv, + uint *args_used, Process_option_func func, + void *func_ctx, const char **default_directories) +{ + const char **dirs, *forced_default_file, *forced_extra_defaults; + int error= 0; + DBUG_ENTER("my_search_option_files"); + + /* Check if we want to force the use a specific default file */ + *args_used+= get_defaults_options(*argc - *args_used, *argv + *args_used, + (char **) &forced_default_file, + (char **) &forced_extra_defaults, + (char **) &my_defaults_group_suffix); + + if (! my_defaults_group_suffix) + my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV)); + + if (forced_extra_defaults) + my_defaults_extra_file= (char *) forced_extra_defaults; + + if (forced_default_file) + my_defaults_file= forced_default_file; + + /* + We can only handle 'defaults-group-suffix' if we are called from + load_defaults() as otherwise we can't know the type of 'func_ctx' + */ + + if (my_defaults_group_suffix && func == handle_default_option) + { + /* Handle --defaults-group-suffix= */ + uint i; + const char **extra_groups; + const size_t instance_len= strlen(my_defaults_group_suffix); + struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx; + char *ptr; + TYPELIB *group= ctx->group; + + if (!(extra_groups= + (const char**)alloc_root(ctx->alloc, + (2*group->count+1)*sizeof(char*)))) + DBUG_RETURN(2); + + for (i= 0; i < group->count; i++) + { + size_t len; + extra_groups[i]= group->type_names[i]; /** copy group */ + + len= strlen(extra_groups[i]); + if (!(ptr= alloc_root(ctx->alloc, (uint) (len+instance_len+1)))) + DBUG_RETURN(2); + + extra_groups[i+group->count]= ptr; + + /** Construct new group */ + memcpy(ptr, extra_groups[i], len); + memcpy(ptr+len, my_defaults_group_suffix, instance_len+1); + } + + group->count*= 2; + group->type_names= extra_groups; + group->type_names[group->count]= 0; + } + + if (forced_default_file) + { + if ((error= search_default_file_with_ext(func, func_ctx, "", "", + forced_default_file, 0)) < 0) + goto err; + if (error > 0) + { + fprintf(stderr, "Could not open required defaults file: %s\n", + forced_default_file); + goto err; + } + } + else if (dirname_length(conf_file)) + { + if ((error= search_default_file(func, func_ctx, NullS, conf_file)) < 0) + goto err; + } + else + { + for (dirs= default_directories ; *dirs; dirs++) + { + if (**dirs) + { + if (search_default_file(func, func_ctx, *dirs, conf_file) < 0) + goto err; + } + else if (my_defaults_extra_file) + { + if ((error= search_default_file_with_ext(func, func_ctx, "", "", + my_defaults_extra_file, 0)) < 0) + goto err; /* Fatal error */ + if (error > 0) + { + fprintf(stderr, "Could not open required defaults file: %s\n", + my_defaults_extra_file); + goto err; + } + } + } + } + + DBUG_RETURN(0); + +err: + fprintf(stderr,"Fatal error in defaults handling. Program aborted\n"); + DBUG_RETURN(1); +} + + +/* + The option handler for load_defaults. + + SYNOPSIS + handle_deault_option() + in_ctx Handler context. In this case it is a + handle_option_ctx structure. + group_name The name of the group the option belongs to. + option The very option to be processed. It is already + prepared to be used in argv (has -- prefix). If it + is NULL, we are handling a new group (section). + + DESCRIPTION + This handler checks whether a group is one of the listed and adds an option + to the array if yes. Some other handler can record, for instance, all + groups and their options, not knowing in advance the names and amount of + groups. + + RETURN + 0 - ok + 1 - error occured +*/ + +static int handle_default_option(void *in_ctx, const char *group_name, + const char *option) +{ + char *tmp; + struct handle_option_ctx *ctx= (struct handle_option_ctx *) in_ctx; + + if (!option) + return 0; + + if (find_type((char *)group_name, ctx->group, 3)) + { + if (!(tmp= alloc_root(ctx->alloc, strlen(option) + 1))) + return 1; + if (insert_dynamic(ctx->args, (uchar*) &tmp)) + return 1; + strmov(tmp, option); + } + + return 0; +} + + +/* + Gets options from the command line + + SYNOPSIS + get_defaults_options() + argc Pointer to argc of original program + argv Pointer to argv of original program + defaults --defaults-file option + extra_defaults --defaults-extra-file option + + RETURN + # Number of arguments used from *argv + defaults and extra_defaults will be set to option of the appropriate + items of argv array, or to NULL if there are no such options +*/ + +int get_defaults_options(int argc, char **argv, + char **defaults, + char **extra_defaults, + char **group_suffix) +{ + int org_argc= argc, prev_argc= 0; + *defaults= *extra_defaults= *group_suffix= 0; + + while (argc >= 2 && argc != prev_argc) + { + /* Skip program name or previously handled argument */ + argv++; + prev_argc= argc; /* To check if we found */ + if (!*defaults && is_prefix(*argv,"--defaults-file=")) + { + *defaults= *argv + sizeof("--defaults-file=")-1; + argc--; + continue; + } + if (!*extra_defaults && is_prefix(*argv,"--defaults-extra-file=")) + { + *extra_defaults= *argv + sizeof("--defaults-extra-file=")-1; + argc--; + continue; + } + if (!*group_suffix && is_prefix(*argv, "--defaults-group-suffix=")) + { + *group_suffix= *argv + sizeof("--defaults-group-suffix=")-1; + argc--; + continue; + } + } + return org_argc - argc; +} + +/* + Wrapper around my_load_defaults() for interface compatibility. + + SYNOPSIS + load_defaults() + conf_file Basename for configuration file to search for. + If this is a path, then only this file is read. + groups Which [group] entrys to read. + Points to an null terminated array of pointers + argc Pointer to argc of original program + argv Pointer to argv of original program + + NOTES + + This function is NOT thread-safe as it uses a global pointer internally. + See also notes for my_load_defaults(). + + RETURN + 0 ok + 1 The given conf_file didn't exists +*/ +int load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv) +{ + return my_load_defaults(conf_file, groups, argc, argv, &default_directories); +} + +/* + Read options from configurations files + + SYNOPSIS + my_load_defaults() + conf_file Basename for configuration file to search for. + If this is a path, then only this file is read. + groups Which [group] entrys to read. + Points to an null terminated array of pointers + argc Pointer to argc of original program + argv Pointer to argv of original program + default_directories Pointer to a location where a pointer to the list + of default directories will be stored + + IMPLEMENTATION + + Read options from configuration files and put them BEFORE the arguments + that are already in argc and argv. This way the calling program can + easily command line options override options in configuration files + + NOTES + In case of fatal error, the function will print a warning and do + exit(1) + + To free used memory one should call free_defaults() with the argument + that was put in *argv + + RETURN + - If successful, 0 is returned. If 'default_directories' is not NULL, + a pointer to the array of default directory paths is stored to a location + it points to. That stored value must be passed to my_search_option_files() + later. + + - 1 is returned if the given conf_file didn't exist. In this case, the + value pointed to by default_directories is undefined. +*/ + + +int my_load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv, const char ***default_directories) +{ + DYNAMIC_ARRAY args; + TYPELIB group; + my_bool found_print_defaults= 0; + uint args_used= 0; + int error= 0; + MEM_ROOT alloc; + char *ptr,**res; + struct handle_option_ctx ctx; + const char **dirs; + DBUG_ENTER("load_defaults"); + + init_alloc_root(&alloc,512,0); + if ((dirs= init_default_directories(&alloc)) == NULL) + goto err; + /* + Check if the user doesn't want any default option processing + --no-defaults is always the first option + */ + if (*argc >= 2 && !strcmp(argv[0][1],"--no-defaults")) + { + /* remove the --no-defaults argument and return only the other arguments */ + uint i; + if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+ + (*argc + 1)*sizeof(char*)))) + goto err; + res= (char**) (ptr+sizeof(alloc)); + res[0]= **argv; /* Copy program name */ + /* set arguments separator */ + res[1]= (char *)args_separator; + for (i=2 ; i < (uint) *argc ; i++) + res[i]=argv[0][i]; + res[i]=0; /* End pointer */ + *argv=res; + *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ + if (default_directories) + *default_directories= dirs; + DBUG_RETURN(0); + } + + group.count=0; + group.name= "defaults"; + group.type_names= groups; + + for (; *groups ; groups++) + group.count++; + + if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32)) + goto err; + + ctx.alloc= &alloc; + ctx.args= &args; + ctx.group= &group; + + error= my_search_option_files(conf_file, argc, argv, &args_used, + handle_default_option, (void *) &ctx, + dirs); + /* + Here error contains <> 0 only if we have a fully specified conf_file + or a forced default file + */ + if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+ + (args.elements + *argc + 1 + 1) *sizeof(char*)))) + goto err; + res= (char**) (ptr+sizeof(alloc)); + + /* copy name + found arguments + command line arguments to new array */ + res[0]= argv[0][0]; /* Name MUST be set, even by embedded library */ + memcpy((uchar*) (res+1), args.buffer, args.elements*sizeof(char*)); + /* Skip --defaults-xxx options */ + (*argc)-= args_used; + (*argv)+= args_used; + + /* + Check if we wan't to see the new argument list + This options must always be the last of the default options + */ + if (*argc >= 2 && !strcmp(argv[0][1],"--print-defaults")) + { + found_print_defaults=1; + --*argc; ++*argv; /* skip argument */ + } + + /* set arguments separator for arguments from config file and + command line */ + res[args.elements+1]= (char *)args_separator; + + if (*argc) + memcpy((uchar*) (res+1+args.elements+1), (char*) ((*argv)+1), + (*argc-1)*sizeof(char*)); + res[args.elements+ *argc+1]=0; /* last null */ + + (*argc)+=args.elements+1; + *argv= (char**) res; + *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ + delete_dynamic(&args); + if (found_print_defaults) + { + int i; + printf("%s would have been started with the following arguments:\n", + **argv); + for (i=1 ; i < *argc ; i++) + if ((*argv)[i] != args_separator) /* skip arguments separator */ + printf("%s ", (*argv)[i]); + puts(""); + exit(0); + } + + if (error == 0 && default_directories) + *default_directories= dirs; + + DBUG_RETURN(error); + + err: + fprintf(stderr,"Fatal error in defaults handling. Program aborted\n"); + exit(1); + return 0; /* Keep compiler happy */ +} + + +void free_defaults(char **argv) +{ + MEM_ROOT ptr; + memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr)); + free_root(&ptr,MYF(0)); +} + + +static int search_default_file(Process_option_func opt_handler, + void *handler_ctx, + const char *dir, + const char *config_file) +{ + char **ext; + const char *empty_list[]= { "", 0 }; + my_bool have_ext= fn_ext(config_file)[0] != 0; + const char **exts_to_use= have_ext ? empty_list : f_extensions; + + for (ext= (char**) exts_to_use; *ext; ext++) + { + int error; + if ((error= search_default_file_with_ext(opt_handler, handler_ctx, + dir, *ext, + config_file, 0)) < 0) + return error; + } + return 0; +} + + +/* + Skip over keyword and get argument after keyword + + SYNOPSIS + get_argument() + keyword Include directive keyword + kwlen Length of keyword + ptr Pointer to the keword in the line under process + line line number + + RETURN + 0 error + # Returns pointer to the argument after the keyword. +*/ + +static char *get_argument(const char *keyword, size_t kwlen, + char *ptr, char *name, uint line) +{ + char *end; + + /* Skip over "include / includedir keyword" and following whitespace */ + + for (ptr+= kwlen - 1; + my_isspace(&my_charset_latin1, ptr[0]); + ptr++) + {} + + /* + Trim trailing whitespace from directory name + The -1 below is for the newline added by fgets() + Note that my_isspace() is true for \r and \n + */ + for (end= ptr + strlen(ptr) - 1; + my_isspace(&my_charset_latin1, *(end - 1)); + end--) + {} + end[0]= 0; /* Cut off end space */ + + /* Print error msg if there is nothing after !include* directive */ + if (end <= ptr) + { + fprintf(stderr, + "error: Wrong '!%s' directive in config file: %s at line %d\n", + keyword, name, line); + return 0; + } + return ptr; +} + + +/* + Open a configuration file (if exists) and read given options from it + + SYNOPSIS + search_default_file_with_ext() + opt_handler Option handler function. It is used to process + every separate option. + handler_ctx Pointer to the structure to store actual + parameters of the function. + dir directory to read + ext Extension for configuration file + config_file Name of configuration file + group groups to read + recursion_level the level of recursion, got while processing + "!include" or "!includedir" + + RETURN + 0 Success + -1 Fatal error, abort + 1 File not found (Warning) +*/ + +static int search_default_file_with_ext(Process_option_func opt_handler, + void *handler_ctx, + const char *dir, + const char *ext, + const char *config_file, + int recursion_level) +{ + char name[FN_REFLEN + 10], buff[4096], curr_gr[4096], *ptr, *end, **tmp_ext; + char *value, option[4096], tmp[FN_REFLEN]; + static const char includedir_keyword[]= "includedir"; + static const char include_keyword[]= "include"; + const int max_recursion_level= 10; + FILE *fp; + uint line=0; + my_bool found_group=0; + uint i; + MY_DIR *search_dir; + FILEINFO *search_file; + + if ((dir ? strlen(dir) : 0 )+strlen(config_file) >= FN_REFLEN-3) + return 0; /* Ignore wrong paths */ + if (dir) + { + end=convert_dirname(name, dir, NullS); + if (dir[0] == FN_HOMELIB) /* Add . to filenames in home */ + *end++='.'; + strxmov(end,config_file,ext,NullS); + } + else + { + strmov(name,config_file); + } + fn_format(name,name,"","",4); +#if !defined(__WIN__) && !defined(__NETWARE__) + { + MY_STAT stat_info; + if (!my_stat(name,&stat_info,MYF(0))) + return 1; + /* + Ignore world-writable regular files. + This is mainly done to protect us to not read a file created by + the mysqld server, but the check is still valid in most context. + */ + if ((stat_info.st_mode & S_IWOTH) && + (stat_info.st_mode & S_IFMT) == S_IFREG) + { + fprintf(stderr, "Warning: World-writable config file '%s' is ignored\n", + name); + return 0; + } + } +#endif + if (!(fp= my_fopen(name, O_RDONLY, MYF(0)))) + return 1; /* Ignore wrong files */ + + while (fgets(buff, sizeof(buff) - 1, fp)) + { + line++; + /* Ignore comment and empty lines */ + for (ptr= buff; my_isspace(&my_charset_latin1, *ptr); ptr++) + {} + + if (*ptr == '#' || *ptr == ';' || !*ptr) + continue; + + /* Configuration File Directives */ + if ((*ptr == '!')) + { + if (recursion_level >= max_recursion_level) + { + for (end= ptr + strlen(ptr) - 1; + my_isspace(&my_charset_latin1, *(end - 1)); + end--) + {} + end[0]= 0; + fprintf(stderr, + "Warning: skipping '%s' directive as maximum include" + "recursion level was reached in file %s at line %d\n", + ptr, name, line); + continue; + } + + /* skip over `!' and following whitespace */ + for (++ptr; my_isspace(&my_charset_latin1, ptr[0]); ptr++) + {} + + if ((!strncmp(ptr, includedir_keyword, + sizeof(includedir_keyword) - 1)) && + my_isspace(&my_charset_latin1, ptr[sizeof(includedir_keyword) - 1])) + { + if (!(ptr= get_argument(includedir_keyword, + sizeof(includedir_keyword), + ptr, name, line))) + goto err; + + if (!(search_dir= my_dir(ptr, MYF(MY_WME)))) + goto err; + + for (i= 0; i < (uint) search_dir->number_off_files; i++) + { + search_file= search_dir->dir_entry + i; + ext= fn_ext(search_file->name); + + /* check extension */ + for (tmp_ext= (char**) f_extensions; *tmp_ext; tmp_ext++) + { + if (!strcmp(ext, *tmp_ext)) + break; + } + + if (*tmp_ext) + { + fn_format(tmp, search_file->name, ptr, "", + MY_UNPACK_FILENAME | MY_SAFE_PATH); + + search_default_file_with_ext(opt_handler, handler_ctx, "", "", tmp, + recursion_level + 1); + } + } + + my_dirend(search_dir); + } + else if ((!strncmp(ptr, include_keyword, sizeof(include_keyword) - 1)) && + my_isspace(&my_charset_latin1, ptr[sizeof(include_keyword)-1])) + { + if (!(ptr= get_argument(include_keyword, + sizeof(include_keyword), ptr, + name, line))) + goto err; + + search_default_file_with_ext(opt_handler, handler_ctx, "", "", ptr, + recursion_level + 1); + } + + continue; + } + + if (*ptr == '[') /* Group name */ + { + found_group=1; + if (!(end=(char *) strchr(++ptr,']'))) + { + fprintf(stderr, + "error: Wrong group definition in config file: %s at line %d\n", + name,line); + goto err; + } + /* Remove end space */ + for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ; + end[0]=0; + + strmake(curr_gr, ptr, min((size_t) (end-ptr)+1, sizeof(curr_gr)-1)); + + /* signal that a new group is found */ + opt_handler(handler_ctx, curr_gr, NULL); + + continue; + } + if (!found_group) + { + fprintf(stderr, + "error: Found option without preceding group in config file: %s at line: %d\n", + name,line); + goto err; + } + + + end= remove_end_comment(ptr); + if ((value= strchr(ptr, '='))) + end= value; /* Option without argument */ + for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ; + if (!value) + { + strmake(strmov(option,"--"),ptr, (size_t) (end-ptr)); + if (opt_handler(handler_ctx, curr_gr, option)) + goto err; + } + else + { + /* Remove pre- and end space */ + char *value_end; + for (value++ ; my_isspace(&my_charset_latin1,*value); value++) ; + value_end=strend(value); + /* + We don't have to test for value_end >= value as we know there is + an '=' before + */ + for ( ; my_isspace(&my_charset_latin1,value_end[-1]) ; value_end--) ; + if (value_end < value) /* Empty string */ + value_end=value; + + /* remove quotes around argument */ + if ((*value == '\"' || *value == '\'') && /* First char is quote */ + (value + 1 < value_end ) && /* String is longer than 1 */ + *value == value_end[-1] ) /* First char is equal to last char */ + { + value++; + value_end--; + } + ptr=strnmov(strmov(option,"--"),ptr,(size_t) (end-ptr)); + *ptr++= '='; + + for ( ; value != value_end; value++) + { + if (*value == '\\' && value != value_end-1) + { + switch(*++value) { + case 'n': + *ptr++='\n'; + break; + case 't': + *ptr++= '\t'; + break; + case 'r': + *ptr++ = '\r'; + break; + case 'b': + *ptr++ = '\b'; + break; + case 's': + *ptr++= ' '; /* space */ + break; + case '\"': + *ptr++= '\"'; + break; + case '\'': + *ptr++= '\''; + break; + case '\\': + *ptr++= '\\'; + break; + default: /* Unknown; Keep '\' */ + *ptr++= '\\'; + *ptr++= *value; + break; + } + } + else + *ptr++= *value; + } + *ptr=0; + if (opt_handler(handler_ctx, curr_gr, option)) + goto err; + } + } + my_fclose(fp,MYF(0)); + return(0); + + err: + my_fclose(fp,MYF(0)); + return -1; /* Fatal error */ +} + + +static char *remove_end_comment(char *ptr) +{ + char quote= 0; /* we are inside quote marks */ + char escape= 0; /* symbol is protected by escape chagacter */ + + for (; *ptr; ptr++) + { + if ((*ptr == '\'' || *ptr == '\"') && !escape) + { + if (!quote) + quote= *ptr; + else if (quote == *ptr) + quote= 0; + } + /* We are not inside a string */ + if (!quote && *ptr == '#') + { + *ptr= 0; + return ptr; + } + escape= (quote && *ptr == '\\' && !escape); + } + return ptr; +} + +void my_print_default_files(const char *conf_file) +{ + const char *empty_list[]= { "", 0 }; + my_bool have_ext= fn_ext(conf_file)[0] != 0; + const char **exts_to_use= have_ext ? empty_list : f_extensions; + char name[FN_REFLEN], **ext; + + puts("\nDefault options are read from the following files in the given order:"); + + if (dirname_length(conf_file)) + fputs(conf_file,stdout); + else + { + const char **dirs; + MEM_ROOT alloc; + init_alloc_root(&alloc,512,0); + + if ((dirs= init_default_directories(&alloc)) == NULL) + { + fputs("Internal error initializing default directories list", stdout); + } + else + { + for ( ; *dirs; dirs++) + { + for (ext= (char**) exts_to_use; *ext; ext++) + { + const char *pos; + char *end; + if (**dirs) + pos= *dirs; + else if (my_defaults_extra_file) + pos= my_defaults_extra_file; + else + continue; + end= convert_dirname(name, pos, NullS); + if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ + *end++= '.'; + strxmov(end, conf_file, *ext, " ", NullS); + fputs(name, stdout); + } + } + } + + free_root(&alloc, MYF(0)); + } + puts(""); +} + +void print_defaults(const char *conf_file, const char **groups) +{ + const char **groups_save= groups; + my_print_default_files(conf_file); + + fputs("The following groups are read:",stdout); + for ( ; *groups ; groups++) + { + fputc(' ',stdout); + fputs(*groups,stdout); + } + + if (my_defaults_group_suffix) + { + groups= groups_save; + for ( ; *groups ; groups++) + { + fputc(' ',stdout); + fputs(*groups,stdout); + fputs(my_defaults_group_suffix,stdout); + } + } + puts("\nThe following options may be given as the first argument:\n\ +--print-defaults Print the program argument list and exit\n\ +--no-defaults Don't read default options from any options file\n\ +--defaults-file=# Only read default options from the given file #\n\ +--defaults-extra-file=# Read this file after the global files are read"); +} + + +static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) +{ + char buf[FN_REFLEN]; + size_t len; + char *p; + my_bool err __attribute__((unused)); + + len= normalize_dirname(buf, dir); + if (!(p= strmake_root(alloc, buf, len))) + return 1; /* Failure */ + /* Should never fail if DEFAULT_DIRS_SIZE is correct size */ + err= array_append_string_unique(p, dirs, DEFAULT_DIRS_SIZE); + DBUG_ASSERT(err == FALSE); + + return 0; +} + + +#ifdef __WIN__ +/* + This wrapper for GetSystemWindowsDirectory() will dynamically bind to the + function if it is available, emulate it on NT4 Terminal Server by stripping + the \SYSTEM32 from the end of the results of GetSystemDirectory(), or just + return GetSystemDirectory(). + */ + +typedef UINT (WINAPI *GET_SYSTEM_WINDOWS_DIRECTORY)(LPSTR, UINT); + +static size_t my_get_system_windows_directory(char *buffer, size_t size) +{ + size_t count; + GET_SYSTEM_WINDOWS_DIRECTORY + func_ptr= (GET_SYSTEM_WINDOWS_DIRECTORY) + GetProcAddress(GetModuleHandle("kernel32.dll"), + "GetSystemWindowsDirectoryA"); + + if (func_ptr) + return func_ptr(buffer, (uint) size); + + /* + Windows NT 4.0 Terminal Server Edition: + To retrieve the shared Windows directory, call GetSystemDirectory and + trim the "System32" element from the end of the returned path. + */ + count= GetSystemDirectory(buffer, (uint) size); + if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0) + { + count-= 8; + buffer[count] = '\0'; + } + return count; +} + + +static const char *my_get_module_parent(char *buf, size_t size) +{ + char *last= NULL; + char *end; + if (!GetModuleFileName(NULL, buf, (DWORD) size)) + return NULL; + end= strend(buf); + + /* + Look for the second-to-last \ in the filename, but hang on + to a pointer after the last \ in case we're in the root of + a drive. + */ + for ( ; end > buf; end--) + { + if (*end == FN_LIBCHAR) + { + if (last) + { + /* Keep the last '\' as this works both with D:\ and a directory */ + end[1]= 0; + break; + } + last= end; + } + } + + return buf; +} +#endif /* __WIN__ */ + + +static const char **init_default_directories(MEM_ROOT *alloc) +{ + const char **dirs; + char *env; + int errors= 0; + + dirs= (const char **)alloc_root(alloc, DEFAULT_DIRS_SIZE * sizeof(char *)); + if (dirs == NULL) + return NULL; + bzero((char *) dirs, DEFAULT_DIRS_SIZE * sizeof(char *)); + +#ifdef __WIN__ + + { + char fname_buffer[FN_REFLEN]; + if (my_get_system_windows_directory(fname_buffer, sizeof(fname_buffer))) + errors += add_directory(alloc, fname_buffer, dirs); + + if (GetWindowsDirectory(fname_buffer, sizeof(fname_buffer))) + errors += add_directory(alloc, fname_buffer, dirs); + + errors += add_directory(alloc, "C:/", dirs); + + if (my_get_module_parent(fname_buffer, sizeof(fname_buffer)) != NULL) + errors += add_directory(alloc, fname_buffer, dirs); + } + +#elif defined(__NETWARE__) + + errors += add_directory(alloc, "sys:/etc/", dirs); + +#else + + errors += add_directory(alloc, "/etc/", dirs); + errors += add_directory(alloc, "/etc/mysql/", dirs); + +#if defined(DEFAULT_SYSCONFDIR) + if (DEFAULT_SYSCONFDIR[0]) + errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); +#endif /* DEFAULT_SYSCONFDIR */ + +#endif + + if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) + errors += add_directory(alloc, env, dirs); + + /* Placeholder for --defaults-extra-file= */ + errors += add_directory(alloc, "", dirs); + +#if !defined(__WIN__) && !defined(__NETWARE__) + errors += add_directory(alloc, "~/", dirs); +#endif + + return (errors > 0 ? NULL : dirs); +} diff --git a/externals/mysql/mysys/default_modify.c b/externals/mysql/mysys/default_modify.c new file mode 100644 index 00000000000..35555f5766a --- /dev/null +++ b/externals/mysql/mysys/default_modify.c @@ -0,0 +1,254 @@ +/* Copyright (C) 2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "my_global.h" +#include "mysys_priv.h" +#include "m_string.h" +#include + +#define BUFF_SIZE 1024 +#define RESERVE 1024 /* Extend buffer with this extent */ + +#ifdef _WIN32 +#define NEWLINE "\r\n" +#define NEWLINE_LEN 2 +#else +#define NEWLINE "\n" +#define NEWLINE_LEN 1 +#endif + +static char *add_option(char *dst, const char *option_value, + const char *option, int remove_option); + + +/* + Add/remove option to the option file section. + + SYNOPSYS + modify_defaults_file() + file_location The location of configuration file to edit + option The name of the option to look for (can be NULL) + option value The value of the option we would like to set (can be NULL) + section_name The name of the section (must be NOT NULL) + remove_option This defines what we want to remove: + - MY_REMOVE_NONE -- nothing to remove; + - MY_REMOVE_OPTION -- remove the specified option; + - MY_REMOVE_SECTION -- remove the specified section; + IMPLEMENTATION + We open the option file first, then read the file line-by-line, + looking for the section we need. At the same time we put these lines + into a buffer. Then we look for the option within this section and + change/remove it. In the end we get a buffer with modified version of the + file. Then we write it to the file, truncate it if needed and close it. + Note that there is a small time gap, when the file is incomplete, + and this theoretically might introduce a problem. + + RETURN + 0 - ok + 1 - some error has occured. Probably due to the lack of resourses + 2 - cannot open the file +*/ + +int modify_defaults_file(const char *file_location, const char *option, + const char *option_value, + const char *section_name, int remove_option) +{ + FILE *cnf_file; + MY_STAT file_stat; + char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer; + size_t opt_len= 0, optval_len= 0, sect_len; + uint nr_newlines= 0, buffer_size; + my_bool in_section= FALSE, opt_applied= 0; + uint reserve_extended; + uint new_opt_len; + int reserve_occupied= 0; + DBUG_ENTER("modify_defaults_file"); + + if (!(cnf_file= my_fopen(file_location, O_RDWR | O_BINARY, MYF(0)))) + DBUG_RETURN(2); + + /* my_fstat doesn't use the flag parameter */ + if (my_fstat(my_fileno(cnf_file), &file_stat, MYF(0))) + goto malloc_err; + + if (option && option_value) + { + opt_len= strlen(option); + optval_len= strlen(option_value); + } + + new_opt_len= opt_len + 1 + optval_len + NEWLINE_LEN; + + /* calculate the size of the buffer we need */ + reserve_extended= (opt_len + + 1 + /* For '=' char */ + optval_len + /* Option value len */ + NEWLINE_LEN + /* Space for newline */ + RESERVE); /* Some additional space */ + + buffer_size= (uint)(file_stat.st_size + + 1); /* The ending zero */ + + /* + Reserve space to read the contents of the file and some more + for the option we want to add. + */ + if (!(file_buffer= (char*) my_malloc(buffer_size + reserve_extended, + MYF(MY_WME)))) + goto malloc_err; + + sect_len= strlen(section_name); + + for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); ) + { + /* Skip over whitespaces */ + for (src_ptr= linebuff; my_isspace(&my_charset_latin1, *src_ptr); + src_ptr++) + {} + + if (!*src_ptr) /* Empty line */ + { + nr_newlines++; + continue; + } + + /* correct the option (if requested) */ + if (option && in_section && !strncmp(src_ptr, option, opt_len) && + (*(src_ptr + opt_len) == '=' || + my_isspace(&my_charset_latin1, *(src_ptr + opt_len)) || + *(src_ptr + opt_len) == '\0')) + { + char *old_src_ptr= src_ptr; + src_ptr= strend(src_ptr+ opt_len); /* Find the end of the line */ + + /* could be negative */ + reserve_occupied+= (int) new_opt_len - (int) (src_ptr - old_src_ptr); + if (reserve_occupied >= (int) reserve_extended) + { + reserve_extended= (uint) reserve_occupied + RESERVE; + if (!(file_buffer= (char*) my_realloc(file_buffer, buffer_size + + reserve_extended, + MYF(MY_WME|MY_FREE_ON_ERROR)))) + goto malloc_err; + } + opt_applied= 1; + dst_ptr= add_option(dst_ptr, option_value, option, remove_option); + } + else + { + /* + If we are going to the new group and have an option to apply, do + it now. If we are removing a single option or the whole section + this will only trigger opt_applied flag. + */ + + if (in_section && !opt_applied && *src_ptr == '[') + { + dst_ptr= add_option(dst_ptr, option_value, option, remove_option); + opt_applied= 1; /* set the flag to do write() later */ + reserve_occupied= new_opt_len+ opt_len + 1 + NEWLINE_LEN; + } + + for (; nr_newlines; nr_newlines--) + dst_ptr= strmov(dst_ptr, NEWLINE); + + /* Skip the section if MY_REMOVE_SECTION was given */ + if (!in_section || remove_option != MY_REMOVE_SECTION) + dst_ptr= strmov(dst_ptr, linebuff); + } + /* Look for a section */ + if (*src_ptr == '[') + { + /* Copy the line to the buffer */ + if (!strncmp(++src_ptr, section_name, sect_len)) + { + src_ptr+= sect_len; + /* Skip over whitespaces. They are allowed after section name */ + for (; my_isspace(&my_charset_latin1, *src_ptr); src_ptr++) + {} + + if (*src_ptr != ']') + { + in_section= FALSE; + continue; /* Missing closing parenthesis. Assume this was no group */ + } + + if (remove_option == MY_REMOVE_SECTION) + dst_ptr= dst_ptr - strlen(linebuff); + + in_section= TRUE; + } + else + in_section= FALSE; /* mark that this section is of no interest to us */ + } + } + + /* + File ended. Apply an option or set opt_applied flag (in case of + MY_REMOVE_SECTION) so that the changes are saved. Do not do anything + if we are removing non-existent option. + */ + + if (!opt_applied && in_section && (remove_option != MY_REMOVE_OPTION)) + { + /* New option still remains to apply at the end */ + if (!remove_option && *(dst_ptr - 1) != '\n') + dst_ptr= strmov(dst_ptr, NEWLINE); + dst_ptr= add_option(dst_ptr, option_value, option, remove_option); + opt_applied= 1; + } + for (; nr_newlines; nr_newlines--) + dst_ptr= strmov(dst_ptr, NEWLINE); + + if (opt_applied) + { + /* Don't write the file if there are no changes to be made */ + if (my_chsize(my_fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0, + MYF(MY_WME)) || + my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) || + my_fwrite(cnf_file, (uchar*) file_buffer, (size_t) (dst_ptr - file_buffer), + MYF(MY_NABP))) + goto err; + } + if (my_fclose(cnf_file, MYF(MY_WME))) + DBUG_RETURN(1); + + my_free(file_buffer, MYF(0)); + DBUG_RETURN(0); + +err: + my_free(file_buffer, MYF(0)); +malloc_err: + my_fclose(cnf_file, MYF(0)); + DBUG_RETURN(1); /* out of resources */ +} + + +static char *add_option(char *dst, const char *option_value, + const char *option, int remove_option) +{ + if (!remove_option) + { + dst= strmov(dst, option); + if (*option_value) + { + *dst++= '='; + dst= strmov(dst, option_value); + } + /* add a newline */ + dst= strmov(dst, NEWLINE); + } + return dst; +} diff --git a/externals/mysql/mysys/errors.c b/externals/mysql/mysys/errors.c new file mode 100644 index 00000000000..0c1d8c1e0b6 --- /dev/null +++ b/externals/mysql/mysys/errors.c @@ -0,0 +1,110 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" + +#ifndef SHARED_LIBRARY + +const char * NEAR globerrs[GLOBERRS]= +{ + "Can't create/write to file '%s' (Errcode: %d)", + "Error reading file '%s' (Errcode: %d)", + "Error writing file '%s' (Errcode: %d)", + "Error on close of '%s' (Errcode: %d)", + "Out of memory (Needed %u bytes)", + "Error on delete of '%s' (Errcode: %d)", + "Error on rename of '%s' to '%s' (Errcode: %d)", + "", + "Unexpected eof found when reading file '%s' (Errcode: %d)", + "Can't lock file (Errcode: %d)", + "Can't unlock file (Errcode: %d)", + "Can't read dir of '%s' (Errcode: %d)", + "Can't get stat of '%s' (Errcode: %d)", + "Can't change size of file (Errcode: %d)", + "Can't open stream from handle (Errcode: %d)", + "Can't get working dirctory (Errcode: %d)", + "Can't change dir to '%s' (Errcode: %d)", + "Warning: '%s' had %d links", + "Warning: %d files and %d streams is left open\n", + "Disk is full writing '%s' (Errcode: %d). Waiting for someone to free space... (Expect up to %d secs delay for server to continue after freeing disk space)", + "Can't create directory '%s' (Errcode: %d)", + "Character set '%s' is not a compiled character set and is not specified in the '%s' file", + "Out of resources when opening file '%s' (Errcode: %d)", + "Can't read value for symlink '%s' (Error %d)", + "Can't create symlink '%s' pointing at '%s' (Error %d)", + "Error on realpath() on '%s' (Error %d)", + "Can't sync file '%s' to disk (Errcode: %d)", + "Collation '%s' is not a compiled collation and is not specified in the '%s' file", + "File '%s' not found (Errcode: %d)", + "File '%s' (fileno: %d) was not closed", + "Can't change mode for file '%s' to 0x%lx (Error: %d)" +}; + +void init_glob_errs(void) +{ + /* This is now done statically. */ +} + +#else + +void init_glob_errs() +{ + EE(EE_CANTCREATEFILE) = "Can't create/write to file '%s' (Errcode: %d)"; + EE(EE_READ) = "Error reading file '%s' (Errcode: %d)"; + EE(EE_WRITE) = "Error writing file '%s' (Errcode: %d)"; + EE(EE_BADCLOSE) = "Error on close of '%'s (Errcode: %d)"; + EE(EE_OUTOFMEMORY) = "Out of memory (Needed %u bytes)"; + EE(EE_DELETE) = "Error on delete of '%s' (Errcode: %d)"; + EE(EE_LINK) = "Error on rename of '%s' to '%s' (Errcode: %d)"; + EE(EE_EOFERR) = "Unexpected eof found when reading file '%s' (Errcode: %d)"; + EE(EE_CANTLOCK) = "Can't lock file (Errcode: %d)"; + EE(EE_CANTUNLOCK) = "Can't unlock file (Errcode: %d)"; + EE(EE_DIR) = "Can't read dir of '%s' (Errcode: %d)"; + EE(EE_STAT) = "Can't get stat of '%s' (Errcode: %d)"; + EE(EE_CANT_CHSIZE) = "Can't change size of file (Errcode: %d)"; + EE(EE_CANT_OPEN_STREAM)= "Can't open stream from handle (Errcode: %d)"; + EE(EE_GETWD) = "Can't get working directory (Errcode: %d)"; + EE(EE_SETWD) = "Can't change dir to '%s' (Errcode: %d)"; + EE(EE_LINK_WARNING) = "Warning: '%s' had %d links"; + EE(EE_OPEN_WARNING) = "Warning: %d files and %d streams is left open\n"; + EE(EE_DISK_FULL) = "Disk is full writing '%s'. Waiting for someone to free space..."; + EE(EE_CANT_MKDIR) ="Can't create directory '%s' (Errcode: %d)"; + EE(EE_UNKNOWN_CHARSET)= "Character set '%s' is not a compiled character set and is not specified in the %s file"; + EE(EE_OUT_OF_FILERESOURCES)="Out of resources when opening file '%s' (Errcode: %d)"; + EE(EE_CANT_READLINK)= "Can't read value for symlink '%s' (Error %d)"; + EE(EE_CANT_SYMLINK)= "Can't create symlink '%s' pointing at '%s' (Error %d)"; + EE(EE_REALPATH)= "Error on realpath() on '%s' (Error %d)"; + EE(EE_SYNC)= "Can't sync file '%s' to disk (Errcode: %d)"; + EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file"; + EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)"; + EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed"; + EE(EE_CANT_CHMOD) = "Can't change mode for file '%s' to 0x%lx (Error: %d)"; +} +#endif + +void wait_for_free_space(const char *filename, int errors) +{ + if (errors == 0) + my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), + filename,my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC); + if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE)) + my_printf_error(EE_DISK_FULL, + "Retry in %d secs. Message reprinted in %d secs", + MYF(ME_BELL | ME_NOREFRESH), + MY_WAIT_FOR_USER_TO_FIX_PANIC, + MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC ); + (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC); +} diff --git a/externals/mysql/mysys/hash.c b/externals/mysql/mysys/hash.c new file mode 100644 index 00000000000..a521cd84e91 --- /dev/null +++ b/externals/mysql/mysys/hash.c @@ -0,0 +1,763 @@ +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* The hash functions used for saveing keys */ +/* One of key_length or key_length_offset must be given */ +/* Key length of 0 isn't allowed */ + +#include "mysys_priv.h" +#include +#include +#include "hash.h" + +#define NO_RECORD ((uint) -1) +#define LOWFIND 1 +#define LOWUSED 2 +#define HIGHFIND 4 +#define HIGHUSED 8 + +typedef struct st_hash_info { + uint next; /* index to next key */ + uchar *data; /* data for current entry */ +} HASH_LINK; + +static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength); +static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink); +static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key, + size_t length); + +static uint calc_hash(const HASH *hash, const uchar *key, size_t length) +{ + ulong nr1=1, nr2=4; + hash->charset->coll->hash_sort(hash->charset,(uchar*) key,length,&nr1,&nr2); + return nr1; +} + +my_bool +_my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset, + ulong size, size_t key_offset, size_t key_length, + my_hash_get_key get_key, + void (*free_element)(void*), uint flags CALLER_INFO_PROTO) +{ + DBUG_ENTER("my_hash_init"); + DBUG_PRINT("enter",("hash: %p size: %u", hash, (uint) size)); + + hash->records=0; + if (my_init_dynamic_array_ci(&hash->array, sizeof(HASH_LINK), size, + growth_size)) + { + hash->free=0; /* Allow call to my_hash_free */ + DBUG_RETURN(1); + } + hash->key_offset=key_offset; + hash->key_length=key_length; + hash->blength=1; + hash->get_key=get_key; + hash->free=free_element; + hash->flags=flags; + hash->charset=charset; + DBUG_RETURN(0); +} + + +/* + Call hash->free on all elements in hash. + + SYNOPSIS + my_hash_free_elements() + hash hash table + + NOTES: + Sets records to 0 +*/ + +static inline void my_hash_free_elements(HASH *hash) +{ + if (hash->free) + { + HASH_LINK *data=dynamic_element(&hash->array,0,HASH_LINK*); + HASH_LINK *end= data + hash->records; + while (data < end) + (*hash->free)((data++)->data); + } + hash->records=0; +} + + +/* + Free memory used by hash. + + SYNOPSIS + my_hash_free() + hash the hash to delete elements of + + NOTES: Hash can't be reused without calling my_hash_init again. +*/ + +void my_hash_free(HASH *hash) +{ + DBUG_ENTER("my_hash_free"); + DBUG_PRINT("enter",("hash: %p", hash)); + + my_hash_free_elements(hash); + hash->free= 0; + delete_dynamic(&hash->array); + DBUG_VOID_RETURN; +} + + +/* + Delete all elements from the hash (the hash itself is to be reused). + + SYNOPSIS + my_hash_reset() + hash the hash to delete elements of +*/ + +void my_hash_reset(HASH *hash) +{ + DBUG_ENTER("my_hash_reset"); + DBUG_PRINT("enter",("hash: %pd", hash)); + + my_hash_free_elements(hash); + reset_dynamic(&hash->array); + /* Set row pointers so that the hash can be reused at once */ + hash->blength= 1; + DBUG_VOID_RETURN; +} + +/* some helper functions */ + +/* + This function is char* instead of uchar* as HPUX11 compiler can't + handle inline functions that are not defined as native types +*/ + +static inline char* +my_hash_key(const HASH *hash, const uchar *record, size_t *length, + my_bool first) +{ + if (hash->get_key) + return (char*) (*hash->get_key)(record,length,first); + *length=hash->key_length; + return (char*) record+hash->key_offset; +} + + /* Calculate pos according to keys */ + +static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength) +{ + if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1)); + return (hashnr & ((buffmax >> 1) -1)); +} + +static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos, + size_t buffmax, size_t maxlength) +{ + size_t length; + uchar *key= (uchar*) my_hash_key(hash, pos->data, &length, 0); + return my_hash_mask(calc_hash(hash, key, length), buffmax, maxlength); +} + + + +/* for compilers which can not handle inline */ +static +#if !defined(__USLC__) && !defined(__sgi) +inline +#endif +unsigned int rec_hashnr(HASH *hash,const uchar *record) +{ + size_t length; + uchar *key= (uchar*) my_hash_key(hash, record, &length, 0); + return calc_hash(hash,key,length); +} + + +uchar* my_hash_search(const HASH *hash, const uchar *key, size_t length) +{ + HASH_SEARCH_STATE state; + return my_hash_first(hash, key, length, &state); +} + +/* + Search after a record based on a key + + NOTE + Assigns the number of the found record to HASH_SEARCH_STATE state +*/ + +uchar* my_hash_first(const HASH *hash, const uchar *key, size_t length, + HASH_SEARCH_STATE *current_record) +{ + HASH_LINK *pos; + uint flag,idx; + DBUG_ENTER("my_hash_first"); + + flag=1; + if (hash->records) + { + idx= my_hash_mask(calc_hash(hash, key, length ? length : hash->key_length), + hash->blength, hash->records); + do + { + pos= dynamic_element(&hash->array,idx,HASH_LINK*); + if (!hashcmp(hash,pos,key,length)) + { + DBUG_PRINT("exit",("found key at %d",idx)); + *current_record= idx; + DBUG_RETURN (pos->data); + } + if (flag) + { + flag=0; /* Reset flag */ + if (my_hash_rec_mask(hash, pos, hash->blength, hash->records) != idx) + break; /* Wrong link */ + } + } + while ((idx=pos->next) != NO_RECORD); + } + *current_record= NO_RECORD; + DBUG_RETURN(0); +} + + /* Get next record with identical key */ + /* Can only be called if previous calls was my_hash_search */ + +uchar* my_hash_next(const HASH *hash, const uchar *key, size_t length, + HASH_SEARCH_STATE *current_record) +{ + HASH_LINK *pos; + uint idx; + + if (*current_record != NO_RECORD) + { + HASH_LINK *data=dynamic_element(&hash->array,0,HASH_LINK*); + for (idx=data[*current_record].next; idx != NO_RECORD ; idx=pos->next) + { + pos=data+idx; + if (!hashcmp(hash,pos,key,length)) + { + *current_record= idx; + return pos->data; + } + } + *current_record= NO_RECORD; + } + return 0; +} + + + /* Change link from pos to new_link */ + +static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink) +{ + HASH_LINK *old_link; + do + { + old_link=array+next_link; + } + while ((next_link=old_link->next) != find); + old_link->next= newlink; + return; +} + +/* + Compare a key in a record to a whole key. Return 0 if identical + + SYNOPSIS + hashcmp() + hash hash table + pos position of hash record to use in comparison + key key for comparison + length length of key + + NOTES: + If length is 0, comparison is done using the length of the + record being compared against. + + RETURN + = 0 key of record == key + != 0 key of record != key + */ + +static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key, + size_t length) +{ + size_t rec_keylength; + uchar *rec_key= (uchar*) my_hash_key(hash, pos->data, &rec_keylength, 1); + return ((length && length != rec_keylength) || + my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength, + (uchar*) key, rec_keylength)); +} + + +/** + Write a hash-key to the hash-index + + @return + @retval 0 ok + @retval 1 Duplicate key or out of memory +*/ + +my_bool my_hash_insert(HASH *info, const uchar *record) +{ + int flag; + size_t idx,halfbuff,hash_nr,first_index; + uchar *ptr_to_rec,*ptr_to_rec2; + HASH_LINK *data,*empty,*gpos,*gpos2,*pos; + + LINT_INIT(gpos); + LINT_INIT(gpos2); + LINT_INIT(ptr_to_rec); + LINT_INIT(ptr_to_rec2); + + if (info->flags & HASH_UNIQUE) + { + uchar *key= (uchar*) my_hash_key(info, record, &idx, 1); + if (my_hash_search(info, key, idx)) + return(TRUE); /* Duplicate entry */ + } + + flag=0; + if (!(empty=(HASH_LINK*) alloc_dynamic(&info->array))) + return(TRUE); /* No more memory */ + + data=dynamic_element(&info->array,0,HASH_LINK*); + halfbuff= info->blength >> 1; + + idx=first_index=info->records-halfbuff; + if (idx != info->records) /* If some records */ + { + do + { + pos=data+idx; + hash_nr=rec_hashnr(info,pos->data); + if (flag == 0) /* First loop; Check if ok */ + if (my_hash_mask(hash_nr, info->blength, info->records) != first_index) + break; + if (!(hash_nr & halfbuff)) + { /* Key will not move */ + if (!(flag & LOWFIND)) + { + if (flag & HIGHFIND) + { + flag=LOWFIND | HIGHFIND; + /* key shall be moved to the current empty position */ + gpos=empty; + ptr_to_rec=pos->data; + empty=pos; /* This place is now free */ + } + else + { + flag=LOWFIND | LOWUSED; /* key isn't changed */ + gpos=pos; + ptr_to_rec=pos->data; + } + } + else + { + if (!(flag & LOWUSED)) + { + /* Change link of previous LOW-key */ + gpos->data=ptr_to_rec; + gpos->next= (uint) (pos-data); + flag= (flag & HIGHFIND) | (LOWFIND | LOWUSED); + } + gpos=pos; + ptr_to_rec=pos->data; + } + } + else + { /* key will be moved */ + if (!(flag & HIGHFIND)) + { + flag= (flag & LOWFIND) | HIGHFIND; + /* key shall be moved to the last (empty) position */ + gpos2 = empty; empty=pos; + ptr_to_rec2=pos->data; + } + else + { + if (!(flag & HIGHUSED)) + { + /* Change link of previous hash-key and save */ + gpos2->data=ptr_to_rec2; + gpos2->next=(uint) (pos-data); + flag= (flag & LOWFIND) | (HIGHFIND | HIGHUSED); + } + gpos2=pos; + ptr_to_rec2=pos->data; + } + } + } + while ((idx=pos->next) != NO_RECORD); + + if ((flag & (LOWFIND | LOWUSED)) == LOWFIND) + { + gpos->data=ptr_to_rec; + gpos->next=NO_RECORD; + } + if ((flag & (HIGHFIND | HIGHUSED)) == HIGHFIND) + { + gpos2->data=ptr_to_rec2; + gpos2->next=NO_RECORD; + } + } + /* Check if we are at the empty position */ + + idx= my_hash_mask(rec_hashnr(info, record), info->blength, info->records + 1); + pos=data+idx; + if (pos == empty) + { + pos->data=(uchar*) record; + pos->next=NO_RECORD; + } + else + { + /* Check if more records in same hash-nr family */ + empty[0]=pos[0]; + gpos= data + my_hash_rec_mask(info, pos, info->blength, info->records + 1); + if (pos == gpos) + { + pos->data=(uchar*) record; + pos->next=(uint) (empty - data); + } + else + { + pos->data=(uchar*) record; + pos->next=NO_RECORD; + movelink(data,(uint) (pos-data),(uint) (gpos-data),(uint) (empty-data)); + } + } + if (++info->records == info->blength) + info->blength+= info->blength; + return(0); +} + + +/** + Remove one record from hash-table. + + @fn hash_delete() + @param hash Hash tree + @param record Row to be deleted + + @notes + The record with the same record ptr is removed. + If there is a free-function it's called if record was found. + + @return + @retval 0 ok + @retval 1 Record not found +*/ + +my_bool my_hash_delete(HASH *hash, uchar *record) +{ + uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index; + HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty; + DBUG_ENTER("my_hash_delete"); + if (!hash->records) + DBUG_RETURN(1); + + blength=hash->blength; + data=dynamic_element(&hash->array,0,HASH_LINK*); + /* Search after record with key */ + pos= data + my_hash_mask(rec_hashnr(hash, record), blength, hash->records); + gpos = 0; + + while (pos->data != record) + { + gpos=pos; + if (pos->next == NO_RECORD) + DBUG_RETURN(1); /* Key not found */ + pos=data+pos->next; + } + + if ( --(hash->records) < hash->blength >> 1) hash->blength>>=1; + lastpos=data+hash->records; + + /* Remove link to record */ + empty=pos; empty_index=(uint) (empty-data); + if (gpos) + gpos->next=pos->next; /* unlink current ptr */ + else if (pos->next != NO_RECORD) + { + empty=data+(empty_index=pos->next); + pos->data=empty->data; + pos->next=empty->next; + } + + if (empty == lastpos) /* last key at wrong pos or no next link */ + goto exit; + + /* Move the last key (lastpos) */ + lastpos_hashnr=rec_hashnr(hash,lastpos->data); + /* pos is where lastpos should be */ + pos= data + my_hash_mask(lastpos_hashnr, hash->blength, hash->records); + if (pos == empty) /* Move to empty position. */ + { + empty[0]=lastpos[0]; + goto exit; + } + pos_hashnr=rec_hashnr(hash,pos->data); + /* pos3 is where the pos should be */ + pos3= data + my_hash_mask(pos_hashnr, hash->blength, hash->records); + if (pos != pos3) + { /* pos is on wrong posit */ + empty[0]=pos[0]; /* Save it here */ + pos[0]=lastpos[0]; /* This should be here */ + movelink(data,(uint) (pos-data),(uint) (pos3-data),empty_index); + goto exit; + } + pos2= my_hash_mask(lastpos_hashnr, blength, hash->records + 1); + if (pos2 == my_hash_mask(pos_hashnr, blength, hash->records + 1)) + { /* Identical key-positions */ + if (pos2 != hash->records) + { + empty[0]=lastpos[0]; + movelink(data,(uint) (lastpos-data),(uint) (pos-data),empty_index); + goto exit; + } + idx= (uint) (pos-data); /* Link pos->next after lastpos */ + } + else idx= NO_RECORD; /* Different positions merge */ + + empty[0]=lastpos[0]; + movelink(data,idx,empty_index,pos->next); + pos->next=empty_index; + +exit: + (void) pop_dynamic(&hash->array); + if (hash->free) + (*hash->free)((uchar*) record); + DBUG_RETURN(0); +} + + +/** + Update keys when record has changed. + This is much more efficent than using a delete & insert. +*/ + +my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, + size_t old_key_length) +{ + uint new_index,new_pos_index,blength,records; + size_t idx,empty; + HASH_LINK org_link,*data,*previous,*pos; + DBUG_ENTER("my_hash_update"); + + if (HASH_UNIQUE & hash->flags) + { + HASH_SEARCH_STATE state; + uchar *found, *new_key= (uchar*) my_hash_key(hash, record, &idx, 1); + if ((found= my_hash_first(hash, new_key, idx, &state))) + { + do + { + if (found != record) + DBUG_RETURN(1); /* Duplicate entry */ + } + while ((found= my_hash_next(hash, new_key, idx, &state))); + } + } + + data=dynamic_element(&hash->array,0,HASH_LINK*); + blength=hash->blength; records=hash->records; + + /* Search after record with key */ + + idx= my_hash_mask(calc_hash(hash, old_key, (old_key_length ? + old_key_length : + hash->key_length)), + blength, records); + new_index= my_hash_mask(rec_hashnr(hash, record), blength, records); + if (idx == new_index) + DBUG_RETURN(0); /* Nothing to do (No record check) */ + previous=0; + for (;;) + { + + if ((pos= data+idx)->data == record) + break; + previous=pos; + if ((idx=pos->next) == NO_RECORD) + DBUG_RETURN(1); /* Not found in links */ + } + org_link= *pos; + empty=idx; + + /* Relink record from current chain */ + + if (!previous) + { + if (pos->next != NO_RECORD) + { + empty=pos->next; + *pos= data[pos->next]; + } + } + else + previous->next=pos->next; /* unlink pos */ + + /* Move data to correct position */ + if (new_index == empty) + { + /* + At this point record is unlinked from the old chain, thus it holds + random position. By the chance this position is equal to position + for the first element in the new chain. That means updated record + is the only record in the new chain. + */ + if (empty != idx) + { + /* + Record was moved while unlinking it from the old chain. + Copy data to a new position. + */ + data[empty]= org_link; + } + data[empty].next= NO_RECORD; + DBUG_RETURN(0); + } + pos=data+new_index; + new_pos_index= my_hash_rec_mask(hash, pos, blength, records); + if (new_index != new_pos_index) + { /* Other record in wrong position */ + data[empty] = *pos; + movelink(data,new_index,new_pos_index,empty); + org_link.next=NO_RECORD; + data[new_index]= org_link; + } + else + { /* Link in chain at right position */ + org_link.next=data[new_index].next; + data[empty]=org_link; + data[new_index].next=empty; + } + DBUG_RETURN(0); +} + + +uchar *my_hash_element(HASH *hash, ulong idx) +{ + if (idx < hash->records) + return dynamic_element(&hash->array,idx,HASH_LINK*)->data; + return 0; +} + + +/* + Replace old row with new row. This should only be used when key + isn't changed +*/ + +void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record, + uchar *new_row) +{ + if (*current_record != NO_RECORD) /* Safety */ + dynamic_element(&hash->array, *current_record, HASH_LINK*)->data= new_row; +} + + +/** + Iterate over all elements in hash and call function with the element + + @param hash hash array + @param action function to call for each argument + @param argument second argument for call to action + + @notes + If one of functions calls returns 1 then the iteration aborts + + @retval 0 ok + @retval 1 iteration aborted becasue action returned 1 +*/ + +my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument) +{ + uint records, i; + HASH_LINK *data; + + records= hash->records; + data= dynamic_element(&hash->array,0,HASH_LINK*); + + for (i= 0 ; i < records ; i++) + { + if ((*action)(data[i].data, argument)) + return 1; + } + return 0; +} + + +#ifndef DBUG_OFF + +my_bool my_hash_check(HASH *hash) +{ + int error; + uint i,rec_link,found,max_links,seek,links,idx; + uint records,blength; + HASH_LINK *data,*hash_info; + + records=hash->records; blength=hash->blength; + data=dynamic_element(&hash->array,0,HASH_LINK*); + error=0; + + for (i=found=max_links=seek=0 ; i < records ; i++) + { + if (my_hash_rec_mask(hash, data + i, blength, records) == i) + { + found++; seek++; links=1; + for (idx=data[i].next ; + idx != NO_RECORD && found < records + 1; + idx=hash_info->next) + { + if (idx >= records) + { + DBUG_PRINT("error", + ("Found pointer outside array to %d from link starting at %d", + idx,i)); + error=1; + } + hash_info=data+idx; + seek+= ++links; + if ((rec_link= my_hash_rec_mask(hash, hash_info, + blength, records)) != i) + { + DBUG_PRINT("error", ("Record in wrong link at %d: Start %d " + "Record: 0x%lx Record-link %d", + idx, i, (long) hash_info->data, rec_link)); + error=1; + } + else + found++; + } + if (links > max_links) max_links=links; + } + } + if (found != records) + { + DBUG_PRINT("error",("Found %u of %u records", found, records)); + error=1; + } + if (records) + DBUG_PRINT("info", + ("records: %u seeks: %d max links: %d hitrate: %.2f", + records,seek,max_links,(float) seek / (float) records)); + return error; +} +#endif diff --git a/externals/mysql/mysys/lf_alloc-pin.c b/externals/mysql/mysys/lf_alloc-pin.c new file mode 100644 index 00000000000..fda9b97791d --- /dev/null +++ b/externals/mysql/mysys/lf_alloc-pin.c @@ -0,0 +1,534 @@ +/* QQ: TODO multi-pinbox */ +/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + wait-free concurrent allocator based on pinning addresses + + It works as follows: every thread (strictly speaking - every CPU, but + it's too difficult to do) has a small array of pointers. They're called + "pins". Before using an object its address must be stored in this array + (pinned). When an object is no longer necessary its address must be + removed from this array (unpinned). When a thread wants to free() an + object it scans all pins of all threads to see if somebody has this + object pinned. If yes - the object is not freed (but stored in a + "purgatory"). To reduce the cost of a single free() pins are not scanned + on every free() but only added to (thread-local) purgatory. On every + LF_PURGATORY_SIZE free() purgatory is scanned and all unpinned objects + are freed. + + Pins are used to solve ABA problem. To use pins one must obey + a pinning protocol: + + 1. Let's assume that PTR is a shared pointer to an object. Shared means + that any thread may modify it anytime to point to a different object + and free the old object. Later the freed object may be potentially + allocated by another thread. If we're unlucky that other thread may + set PTR to point to this object again. This is ABA problem. + 2. Create a local pointer LOCAL_PTR. + 3. Pin the PTR in a loop: + do + { + LOCAL_PTR= PTR; + pin(PTR, PIN_NUMBER); + } while (LOCAL_PTR != PTR) + 4. It is guaranteed that after the loop has ended, LOCAL_PTR + points to an object (or NULL, if PTR may be NULL), that + will never be freed. It is not guaranteed though + that LOCAL_PTR == PTR (as PTR can change any time) + 5. When done working with the object, remove the pin: + unpin(PIN_NUMBER) + 6. When copying pins (as in the list traversing loop: + pin(CUR, 1); + while () + { + do // standard + { // pinning + NEXT=CUR->next; // loop + pin(NEXT, 0); // see #3 + } while (NEXT != CUR->next); // above + ... + ... + CUR=NEXT; + pin(CUR, 1); // copy pin[0] to pin[1] + } + which keeps CUR address constantly pinned), note than pins may be + copied only upwards (!!!), that is pin[N] to pin[M], M > N. + 7. Don't keep the object pinned longer than necessary - the number of + pins you have is limited (and small), keeping an object pinned + prevents its reuse and cause unnecessary mallocs. + + Explanations: + + 3. The loop is important. The following can occur: + thread1> LOCAL_PTR= PTR + thread2> free(PTR); PTR=0; + thread1> pin(PTR, PIN_NUMBER); + now thread1 cannot access LOCAL_PTR, even if it's pinned, + because it points to a freed memory. That is, it *must* + verify that it has indeed pinned PTR, the shared pointer. + + 6. When a thread wants to free some LOCAL_PTR, and it scans + all lists of pins to see whether it's pinned, it does it + upwards, from low pin numbers to high. Thus another thread + must copy an address from one pin to another in the same + direction - upwards, otherwise the scanning thread may + miss it. + + Implementation details: + + Pins are given away from a "pinbox". Pinbox is stack-based allocator. + It used dynarray for storing pins, new elements are allocated by dynarray + as necessary, old are pushed in the stack for reuse. ABA is solved by + versioning a pointer - because we use an array, a pointer to pins is 16 bit, + upper 16 bits are used for a version. + + It is assumed that pins belong to a THD and are not transferable + between THD's (LF_PINS::stack_ends_here being a primary reason + for this limitation). +*/ +#include +#include +#include + +#define LF_PINBOX_MAX_PINS 65536 + +static void _lf_pinbox_real_free(LF_PINS *pins); + +/* + Initialize a pinbox. Normally called from lf_alloc_init. + See the latter for details. +*/ +void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset, + lf_pinbox_free_func *free_func, void *free_func_arg) +{ + DBUG_ASSERT(free_ptr_offset % sizeof(void *) == 0); + compile_time_assert(sizeof(LF_PINS) == 64); + lf_dynarray_init(&pinbox->pinarray, sizeof(LF_PINS)); + pinbox->pinstack_top_ver= 0; + pinbox->pins_in_array= 0; + pinbox->free_ptr_offset= free_ptr_offset; + pinbox->free_func= free_func; + pinbox->free_func_arg= free_func_arg; +} + +void lf_pinbox_destroy(LF_PINBOX *pinbox) +{ + lf_dynarray_destroy(&pinbox->pinarray); +} + +/* + Get pins from a pinbox. Usually called via lf_alloc_get_pins() or + lf_hash_get_pins(). + + SYNOPSYS + pinbox - + + DESCRIPTION + get a new LF_PINS structure from a stack of unused pins, + or allocate a new one out of dynarray. + + NOTE + It is assumed that pins belong to a thread and are not transferable + between threads. +*/ +LF_PINS *_lf_pinbox_get_pins(LF_PINBOX *pinbox) +{ + uint32 pins, next, top_ver; + LF_PINS *el; + /* + We have an array of max. 64k elements. + The highest index currently allocated is pinbox->pins_in_array. + Freed elements are in a lifo stack, pinstack_top_ver. + pinstack_top_ver is 32 bits; 16 low bits are the index in the + array, to the first element of the list. 16 high bits are a version + (every time the 16 low bits are updated, the 16 high bits are + incremented). Versioniong prevents the ABA problem. + */ + top_ver= pinbox->pinstack_top_ver; + do + { + if (!(pins= top_ver % LF_PINBOX_MAX_PINS)) + { + /* the stack of free elements is empty */ + pins= my_atomic_add32((int32 volatile*) &pinbox->pins_in_array, 1)+1; + if (unlikely(pins >= LF_PINBOX_MAX_PINS)) + return 0; + /* + note that the first allocated element has index 1 (pins==1). + index 0 is reserved to mean "NULL pointer" + */ + el= (LF_PINS *)_lf_dynarray_lvalue(&pinbox->pinarray, pins); + if (unlikely(!el)) + return 0; + break; + } + el= (LF_PINS *)_lf_dynarray_value(&pinbox->pinarray, pins); + next= el->link; + } while (!my_atomic_cas32((int32 volatile*) &pinbox->pinstack_top_ver, + (int32*) &top_ver, + top_ver-pins+next+LF_PINBOX_MAX_PINS)); + /* + set el->link to the index of el in the dynarray (el->link has two usages: + - if element is allocated, it's its own index + - if element is free, it's its next element in the free stack + */ + el->link= pins; + el->purgatory_count= 0; + el->pinbox= pinbox; + el->stack_ends_here= & my_thread_var->stack_ends_here; + return el; +} + +/* + Put pins back to a pinbox. Usually called via lf_alloc_put_pins() or + lf_hash_put_pins(). + + DESCRIPTION + empty the purgatory (XXX deadlock warning below!), + push LF_PINS structure to a stack +*/ +void _lf_pinbox_put_pins(LF_PINS *pins) +{ + LF_PINBOX *pinbox= pins->pinbox; + uint32 top_ver, nr; + nr= pins->link; +#ifdef MY_LF_EXTRA_DEBUG + { + int i; + for (i= 0; i < LF_PINBOX_PINS; i++) + DBUG_ASSERT(pins->pin[i] == 0); + } +#endif + /* + XXX this will deadlock if other threads will wait for + the caller to do something after _lf_pinbox_put_pins(), + and they would have pinned addresses that the caller wants to free. + Thus: only free pins when all work is done and nobody can wait for you!!! + */ + while (pins->purgatory_count) + { + _lf_pinbox_real_free(pins); + if (pins->purgatory_count) + { + my_atomic_rwlock_wrunlock(&pins->pinbox->pinarray.lock); + pthread_yield(); + my_atomic_rwlock_wrlock(&pins->pinbox->pinarray.lock); + } + } + top_ver= pinbox->pinstack_top_ver; + do + { + pins->link= top_ver % LF_PINBOX_MAX_PINS; + } while (!my_atomic_cas32((int32 volatile*) &pinbox->pinstack_top_ver, + (int32*) &top_ver, + top_ver-pins->link+nr+LF_PINBOX_MAX_PINS)); + return; +} + +static int ptr_cmp(void **a, void **b) +{ + return *a < *b ? -1 : *a == *b ? 0 : 1; +} + +#define add_to_purgatory(PINS, ADDR) \ + do \ + { \ + *(void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset)= \ + (PINS)->purgatory; \ + (PINS)->purgatory= (ADDR); \ + (PINS)->purgatory_count++; \ + } while (0) + +/* + Free an object allocated via pinbox allocator + + DESCRIPTION + add an object to purgatory. if necessary, call _lf_pinbox_real_free() + to actually free something. +*/ +void _lf_pinbox_free(LF_PINS *pins, void *addr) +{ + add_to_purgatory(pins, addr); + if (pins->purgatory_count % LF_PURGATORY_SIZE) + _lf_pinbox_real_free(pins); +} + +struct st_harvester { + void **granary; + int npins; +}; + +/* + callback for _lf_dynarray_iterate: + scan all pins of all threads and accumulate all pins +*/ +static int harvest_pins(LF_PINS *el, struct st_harvester *hv) +{ + int i; + LF_PINS *el_end= el+min(hv->npins, LF_DYNARRAY_LEVEL_LENGTH); + for (; el < el_end; el++) + { + for (i= 0; i < LF_PINBOX_PINS; i++) + { + void *p= el->pin[i]; + if (p) + *hv->granary++= p; + } + } + /* + hv->npins may become negative below, but it means that + we're on the last dynarray page and harvest_pins() won't be + called again. We don't bother to make hv->npins() correct + (that is 0) in this case. + */ + hv->npins-= LF_DYNARRAY_LEVEL_LENGTH; + return 0; +} + +/* + callback for _lf_dynarray_iterate: + scan all pins of all threads and see if addr is present there +*/ +static int match_pins(LF_PINS *el, void *addr) +{ + int i; + LF_PINS *el_end= el+LF_DYNARRAY_LEVEL_LENGTH; + for (; el < el_end; el++) + for (i= 0; i < LF_PINBOX_PINS; i++) + if (el->pin[i] == addr) + return 1; + return 0; +} + +#if STACK_DIRECTION < 0 +#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END)) +#else +#define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR)) +#endif + +#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset))) +#define anext_node(X) next_node(&allocator->pinbox, (X)) + +/* + Scan the purgatory and free everything that can be freed +*/ +static void _lf_pinbox_real_free(LF_PINS *pins) +{ + int npins, alloca_size; + void *list, **addr; + void *first, *last= NULL; + LF_PINBOX *pinbox= pins->pinbox; + + LINT_INIT(first); + npins= pinbox->pins_in_array+1; + +#ifdef HAVE_ALLOCA + alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins; + /* create a sorted list of pinned addresses, to speed up searches */ + if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size) + { + struct st_harvester hv; + addr= (void **) alloca(alloca_size); + hv.granary= addr; + hv.npins= npins; + /* scan the dynarray and accumulate all pinned addresses */ + _lf_dynarray_iterate(&pinbox->pinarray, + (lf_dynarray_func)harvest_pins, &hv); + + npins= hv.granary-addr; + /* and sort them */ + if (npins) + qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp); + } + else +#endif + addr= 0; + + list= pins->purgatory; + pins->purgatory= 0; + pins->purgatory_count= 0; + while (list) + { + void *cur= list; + list= *(void **)((char *)cur+pinbox->free_ptr_offset); + if (npins) + { + if (addr) /* use binary search */ + { + void **a, **b, **c; + for (a= addr, b= addr+npins-1, c= a+(b-a)/2; (b-a) > 1; c= a+(b-a)/2) + if (cur == *c) + a= b= c; + else if (cur > *c) + a= c; + else + b= c; + if (cur == *a || cur == *b) + goto found; + } + else /* no alloca - no cookie. linear search here */ + { + if (_lf_dynarray_iterate(&pinbox->pinarray, + (lf_dynarray_func)match_pins, cur)) + goto found; + } + } + /* not pinned - freeing */ + if (last) + last= next_node(pinbox, last)= (uchar *)cur; + else + first= last= (uchar *)cur; + continue; +found: + /* pinned - keeping */ + add_to_purgatory(pins, cur); + } + if (last) + pinbox->free_func(first, last, pinbox->free_func_arg); +} + +/* lock-free memory allocator for fixed-size objects */ + +LF_REQUIRE_PINS(1) + +/* + callback for _lf_pinbox_real_free to free a list of unpinned objects - + add it back to the allocator stack + + DESCRIPTION + 'first' and 'last' are the ends of the linked list of nodes: + first->el->el->....->el->last. Use first==last to free only one element. +*/ +static void alloc_free(uchar *first, + uchar volatile *last, + LF_ALLOCATOR *allocator) +{ + /* + we need a union here to access type-punned pointer reliably. + otherwise gcc -fstrict-aliasing will not see 'tmp' changed in the loop + */ + union { uchar * node; void *ptr; } tmp; + tmp.node= allocator->top; + do + { + anext_node(last)= tmp.node; + } while (!my_atomic_casptr((void **)(char *)&allocator->top, + (void **)&tmp.ptr, first) && LF_BACKOFF); +} + +/* + initialize lock-free allocator + + SYNOPSYS + allocator - + size a size of an object to allocate + free_ptr_offset an offset inside the object to a sizeof(void *) + memory that is guaranteed to be unused after + the object is put in the purgatory. Unused by ANY + thread, not only the purgatory owner. + This memory will be used to link waiting-to-be-freed + objects in a purgatory list. +*/ +void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset) +{ + lf_pinbox_init(&allocator->pinbox, free_ptr_offset, + (lf_pinbox_free_func *)alloc_free, allocator); + allocator->top= 0; + allocator->mallocs= 0; + allocator->element_size= size; + allocator->constructor= 0; + allocator->destructor= 0; + DBUG_ASSERT(size >= sizeof(void*) + free_ptr_offset); +} + +/* + destroy the allocator, free everything that's in it + + NOTE + As every other init/destroy function here and elsewhere it + is not thread safe. No, this function is no different, ensure + that no thread needs the allocator before destroying it. + We are not responsible for any damage that may be caused by + accessing the allocator when it is being or has been destroyed. + Oh yes, and don't put your cat in a microwave. +*/ +void lf_alloc_destroy(LF_ALLOCATOR *allocator) +{ + uchar *node= allocator->top; + while (node) + { + uchar *tmp= anext_node(node); + if (allocator->destructor) + allocator->destructor(node); + my_free((void *)node, MYF(0)); + node= tmp; + } + lf_pinbox_destroy(&allocator->pinbox); + allocator->top= 0; +} + +/* + Allocate and return an new object. + + DESCRIPTION + Pop an unused object from the stack or malloc it is the stack is empty. + pin[0] is used, it's removed on return. +*/ +void *_lf_alloc_new(LF_PINS *pins) +{ + LF_ALLOCATOR *allocator= (LF_ALLOCATOR *)(pins->pinbox->free_func_arg); + uchar *node; + for (;;) + { + do + { + node= allocator->top; + _lf_pin(pins, 0, node); + } while (node != allocator->top && LF_BACKOFF); + if (!node) + { + node= (void *)my_malloc(allocator->element_size, MYF(MY_WME)); + if (allocator->constructor) + allocator->constructor(node); +#ifdef MY_LF_EXTRA_DEBUG + if (likely(node != 0)) + my_atomic_add32(&allocator->mallocs, 1); +#endif + break; + } + if (my_atomic_casptr((void **)(char *)&allocator->top, + (void *)&node, anext_node(node))) + break; + } + _lf_unpin(pins, 0); + return node; +} + +/* + count the number of objects in a pool. + + NOTE + This is NOT thread-safe !!! +*/ +uint lf_alloc_pool_count(LF_ALLOCATOR *allocator) +{ + uint i; + uchar *node; + for (node= allocator->top, i= 0; node; node= anext_node(node), i++) + /* no op */; + return i; +} + diff --git a/externals/mysql/mysys/lf_dynarray.c b/externals/mysql/mysys/lf_dynarray.c new file mode 100644 index 00000000000..b1cdce698a9 --- /dev/null +++ b/externals/mysql/mysys/lf_dynarray.c @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Analog of DYNAMIC_ARRAY that never reallocs + (so no pointer into the array may ever become invalid). + + Memory is allocated in non-contiguous chunks. + This data structure is not space efficient for sparse arrays. + + Every element is aligned to sizeof(element) boundary + (to avoid false sharing if element is big enough). + + LF_DYNARRAY is a recursive structure. On the zero level + LF_DYNARRAY::level[0] it's an array of LF_DYNARRAY_LEVEL_LENGTH elements, + on the first level it's an array of LF_DYNARRAY_LEVEL_LENGTH pointers + to arrays of elements, on the second level it's an array of pointers + to arrays of pointers to arrays of elements. And so on. + + With four levels the number of elements is limited to 4311810304 + (but as in all functions index is uint, the real limit is 2^32-1) + + Actually, it's wait-free, not lock-free ;-) +*/ + +#include +#include +#include +#include + +void lf_dynarray_init(LF_DYNARRAY *array, uint element_size) +{ + bzero(array, sizeof(*array)); + array->size_of_element= element_size; + my_atomic_rwlock_init(&array->lock); +} + +static void recursive_free(void **alloc, int level) +{ + if (!alloc) + return; + + if (level) + { + int i; + for (i= 0; i < LF_DYNARRAY_LEVEL_LENGTH; i++) + recursive_free(alloc[i], level-1); + my_free((void *)alloc, MYF(0)); + } + else + my_free(alloc[-1], MYF(0)); +} + +void lf_dynarray_destroy(LF_DYNARRAY *array) +{ + int i; + for (i= 0; i < LF_DYNARRAY_LEVELS; i++) + recursive_free(array->level[i], i); + my_atomic_rwlock_destroy(&array->lock); +} + +static const ulong dynarray_idxes_in_prev_levels[LF_DYNARRAY_LEVELS]= +{ + 0, /* +1 here to to avoid -1's below */ + LF_DYNARRAY_LEVEL_LENGTH, + LF_DYNARRAY_LEVEL_LENGTH * LF_DYNARRAY_LEVEL_LENGTH + + LF_DYNARRAY_LEVEL_LENGTH, + LF_DYNARRAY_LEVEL_LENGTH * LF_DYNARRAY_LEVEL_LENGTH * + LF_DYNARRAY_LEVEL_LENGTH + LF_DYNARRAY_LEVEL_LENGTH * + LF_DYNARRAY_LEVEL_LENGTH + LF_DYNARRAY_LEVEL_LENGTH +}; + +static const ulong dynarray_idxes_in_prev_level[LF_DYNARRAY_LEVELS]= +{ + 0, /* +1 here to to avoid -1's below */ + LF_DYNARRAY_LEVEL_LENGTH, + LF_DYNARRAY_LEVEL_LENGTH * LF_DYNARRAY_LEVEL_LENGTH, + LF_DYNARRAY_LEVEL_LENGTH * LF_DYNARRAY_LEVEL_LENGTH * + LF_DYNARRAY_LEVEL_LENGTH, +}; + +/* + Returns a valid lvalue pointer to the element number 'idx'. + Allocates memory if necessary. +*/ +void *_lf_dynarray_lvalue(LF_DYNARRAY *array, uint idx) +{ + void * ptr, * volatile * ptr_ptr= 0; + int i; + + for (i= LF_DYNARRAY_LEVELS-1; idx < dynarray_idxes_in_prev_levels[i]; i--) + /* no-op */; + ptr_ptr= &array->level[i]; + idx-= dynarray_idxes_in_prev_levels[i]; + for (; i > 0; i--) + { + if (!(ptr= *ptr_ptr)) + { + void *alloc= my_malloc(LF_DYNARRAY_LEVEL_LENGTH * sizeof(void *), + MYF(MY_WME|MY_ZEROFILL)); + if (unlikely(!alloc)) + return(NULL); + if (my_atomic_casptr(ptr_ptr, &ptr, alloc)) + ptr= alloc; + else + my_free(alloc, MYF(0)); + } + ptr_ptr= ((void **)ptr) + idx / dynarray_idxes_in_prev_level[i]; + idx%= dynarray_idxes_in_prev_level[i]; + } + if (!(ptr= *ptr_ptr)) + { + uchar *alloc, *data; + alloc= my_malloc(LF_DYNARRAY_LEVEL_LENGTH * array->size_of_element + + max(array->size_of_element, sizeof(void *)), + MYF(MY_WME|MY_ZEROFILL)); + if (unlikely(!alloc)) + return(NULL); + /* reserve the space for free() address */ + data= alloc + sizeof(void *); + { /* alignment */ + intptr mod= ((intptr)data) % array->size_of_element; + if (mod) + data+= array->size_of_element - mod; + } + ((void **)data)[-1]= alloc; /* free() will need the original pointer */ + if (my_atomic_casptr(ptr_ptr, &ptr, data)) + ptr= data; + else + my_free(alloc, MYF(0)); + } + return ((uchar*)ptr) + array->size_of_element * idx; +} + +/* + Returns a pointer to the element number 'idx' + or NULL if an element does not exists +*/ +void *_lf_dynarray_value(LF_DYNARRAY *array, uint idx) +{ + void * ptr, * volatile * ptr_ptr= 0; + int i; + + for (i= LF_DYNARRAY_LEVELS-1; idx < dynarray_idxes_in_prev_levels[i]; i--) + /* no-op */; + ptr_ptr= &array->level[i]; + idx-= dynarray_idxes_in_prev_levels[i]; + for (; i > 0; i--) + { + if (!(ptr= *ptr_ptr)) + return(NULL); + ptr_ptr= ((void **)ptr) + idx / dynarray_idxes_in_prev_level[i]; + idx %= dynarray_idxes_in_prev_level[i]; + } + if (!(ptr= *ptr_ptr)) + return(NULL); + return ((uchar*)ptr) + array->size_of_element * idx; +} + +static int recursive_iterate(LF_DYNARRAY *array, void *ptr, int level, + lf_dynarray_func func, void *arg) +{ + int res, i; + if (!ptr) + return 0; + if (!level) + return func(ptr, arg); + for (i= 0; i < LF_DYNARRAY_LEVEL_LENGTH; i++) + if ((res= recursive_iterate(array, ((void **)ptr)[i], level-1, func, arg))) + return res; + return 0; +} + +/* + Calls func(array, arg) on every array of LF_DYNARRAY_LEVEL_LENGTH elements + in lf_dynarray. + + DESCRIPTION + lf_dynarray consists of a set of arrays, LF_DYNARRAY_LEVEL_LENGTH elements + each. _lf_dynarray_iterate() calls user-supplied function on every array + from the set. It is the fastest way to scan the array, faster than + for (i=0; i < N; i++) { func(_lf_dynarray_value(dynarray, i)); } + + NOTE + if func() returns non-zero, the scan is aborted +*/ +int _lf_dynarray_iterate(LF_DYNARRAY *array, lf_dynarray_func func, void *arg) +{ + int i, res; + for (i= 0; i < LF_DYNARRAY_LEVELS; i++) + if ((res= recursive_iterate(array, array->level[i], i, func, arg))) + return res; + return 0; +} + diff --git a/externals/mysql/mysys/lf_hash.c b/externals/mysql/mysys/lf_hash.c new file mode 100644 index 00000000000..f478196c7c8 --- /dev/null +++ b/externals/mysql/mysys/lf_hash.c @@ -0,0 +1,505 @@ +/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + extensible hash + + TODO + try to get rid of dummy nodes ? + for non-unique hash, count only _distinct_ values + (but how to do it in lf_hash_delete ?) +*/ +#include +#include +#include +#include +#include + +LF_REQUIRE_PINS(3) + +/* An element of the list */ +typedef struct { + intptr volatile link; /* a pointer to the next element in a listand a flag */ + uint32 hashnr; /* reversed hash number, for sorting */ + const uchar *key; + size_t keylen; + /* + data is stored here, directly after the keylen. + thus the pointer to data is (void*)(slist_element_ptr+1) + */ +} LF_SLIST; + +const int LF_HASH_OVERHEAD= sizeof(LF_SLIST); + +/* + a structure to pass the context (pointers two the three successive elements + in a list) from lfind to linsert/ldelete +*/ +typedef struct { + intptr volatile *prev; + LF_SLIST *curr, *next; +} CURSOR; + +/* + the last bit in LF_SLIST::link is a "deleted" flag. + the helper macros below convert it to a pure pointer or a pure flag +*/ +#define PTR(V) (LF_SLIST *)((V) & (~(intptr)1)) +#define DELETED(V) ((V) & 1) + +/* + DESCRIPTION + Search for hashnr/key/keylen in the list starting from 'head' and + position the cursor. The list is ORDER BY hashnr, key + + RETURN + 0 - not found + 1 - found + + NOTE + cursor is positioned in either case + pins[0..2] are used, they are NOT removed on return +*/ +static int lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr, + const uchar *key, uint keylen, CURSOR *cursor, LF_PINS *pins) +{ + uint32 cur_hashnr; + const uchar *cur_key; + uint cur_keylen; + intptr link; + +retry: + cursor->prev= (intptr *)head; + do { /* PTR() isn't necessary below, head is a dummy node */ + cursor->curr= (LF_SLIST *)(*cursor->prev); + _lf_pin(pins, 1, cursor->curr); + } while (*cursor->prev != (intptr)cursor->curr && LF_BACKOFF); + for (;;) + { + if (unlikely(!cursor->curr)) + return 0; /* end of the list */ + do { + /* QQ: XXX or goto retry ? */ + link= cursor->curr->link; + cursor->next= PTR(link); + _lf_pin(pins, 0, cursor->next); + } while (link != cursor->curr->link && LF_BACKOFF); + cur_hashnr= cursor->curr->hashnr; + cur_key= cursor->curr->key; + cur_keylen= cursor->curr->keylen; + if (*cursor->prev != (intptr)cursor->curr) + { + (void)LF_BACKOFF; + goto retry; + } + if (!DELETED(link)) + { + if (cur_hashnr >= hashnr) + { + int r= 1; + if (cur_hashnr > hashnr || + (r= my_strnncoll(cs, (uchar*) cur_key, cur_keylen, (uchar*) key, + keylen)) >= 0) + return !r; + } + cursor->prev= &(cursor->curr->link); + _lf_pin(pins, 2, cursor->curr); + } + else + { + /* + we found a deleted node - be nice, help the other thread + and remove this deleted node + */ + if (my_atomic_casptr((void **)cursor->prev, + (void **)&cursor->curr, cursor->next)) + _lf_alloc_free(pins, cursor->curr); + else + { + (void)LF_BACKOFF; + goto retry; + } + } + cursor->curr= cursor->next; + _lf_pin(pins, 1, cursor->curr); + } +} + +/* + DESCRIPTION + insert a 'node' in the list that starts from 'head' in the correct + position (as found by lfind) + + RETURN + 0 - inserted + not 0 - a pointer to a duplicate (not pinned and thus unusable) + + NOTE + it uses pins[0..2], on return all pins are removed. + if there're nodes with the same key value, a new node is added before them. +*/ +static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs, + LF_SLIST *node, LF_PINS *pins, uint flags) +{ + CURSOR cursor; + int res; + + for (;;) + { + if (lfind(head, cs, node->hashnr, node->key, node->keylen, + &cursor, pins) && + (flags & LF_HASH_UNIQUE)) + { + res= 0; /* duplicate found */ + break; + } + else + { + node->link= (intptr)cursor.curr; + DBUG_ASSERT(node->link != (intptr)node); /* no circular references */ + DBUG_ASSERT(cursor.prev != &node->link); /* no circular references */ + if (my_atomic_casptr((void **)cursor.prev, (void **)&cursor.curr, node)) + { + res= 1; /* inserted ok */ + break; + } + } + } + _lf_unpin(pins, 0); + _lf_unpin(pins, 1); + _lf_unpin(pins, 2); + /* + Note that cursor.curr is not pinned here and the pointer is unreliable, + the object may dissapear anytime. But if it points to a dummy node, the + pointer is safe, because dummy nodes are never freed - initialize_bucket() + uses this fact. + */ + return res ? 0 : cursor.curr; +} + +/* + DESCRIPTION + deletes a node as identified by hashnr/keey/keylen from the list + that starts from 'head' + + RETURN + 0 - ok + 1 - not found + + NOTE + it uses pins[0..2], on return all pins are removed. +*/ +static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr, + const uchar *key, uint keylen, LF_PINS *pins) +{ + CURSOR cursor; + int res; + + for (;;) + { + if (!lfind(head, cs, hashnr, key, keylen, &cursor, pins)) + { + res= 1; /* not found */ + break; + } + else + { + /* mark the node deleted */ + if (my_atomic_casptr((void **)&(cursor.curr->link), + (void **)&cursor.next, + (void *)(((intptr)cursor.next) | 1))) + { + /* and remove it from the list */ + if (my_atomic_casptr((void **)cursor.prev, + (void **)&cursor.curr, cursor.next)) + _lf_alloc_free(pins, cursor.curr); + else + { + /* + somebody already "helped" us and removed the node ? + Let's check if we need to help that someone too! + (to ensure the number of "set DELETED flag" actions + is equal to the number of "remove from the list" actions) + */ + lfind(head, cs, hashnr, key, keylen, &cursor, pins); + } + res= 0; + break; + } + } + } + _lf_unpin(pins, 0); + _lf_unpin(pins, 1); + _lf_unpin(pins, 2); + return res; +} + +/* + DESCRIPTION + searches for a node as identified by hashnr/keey/keylen in the list + that starts from 'head' + + RETURN + 0 - not found + node - found + + NOTE + it uses pins[0..2], on return the pin[2] keeps the node found + all other pins are removed. +*/ +static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs, + uint32 hashnr, const uchar *key, uint keylen, + LF_PINS *pins) +{ + CURSOR cursor; + int res= lfind(head, cs, hashnr, key, keylen, &cursor, pins); + if (res) + _lf_pin(pins, 2, cursor.curr); + _lf_unpin(pins, 0); + _lf_unpin(pins, 1); + return res ? cursor.curr : 0; +} + +static inline const uchar* hash_key(const LF_HASH *hash, + const uchar *record, size_t *length) +{ + if (hash->get_key) + return (*hash->get_key)(record, length, 0); + *length= hash->key_length; + return record + hash->key_offset; +} + +/* + Compute the hash key value from the raw key. + + @note, that the hash value is limited to 2^31, because we need one + bit to distinguish between normal and dummy nodes. +*/ +static inline uint calc_hash(LF_HASH *hash, const uchar *key, uint keylen) +{ + ulong nr1= 1, nr2= 4; + hash->charset->coll->hash_sort(hash->charset, (uchar*) key, keylen, + &nr1, &nr2); + return nr1 & INT_MAX32; +} + +#define MAX_LOAD 1.0 /* average number of elements in a bucket */ + +static int initialize_bucket(LF_HASH *, LF_SLIST * volatile*, uint, LF_PINS *); + +/* + Initializes lf_hash, the arguments are compatible with hash_init + + @note element_size sets both the size of allocated memory block for + lf_alloc and a size of memcpy'ed block size in lf_hash_insert. Typically + they are the same, indeed. But LF_HASH::element_size can be decreased + after lf_hash_init, and then lf_alloc will allocate larger block that + lf_hash_insert will copy over. It is desireable if part of the element + is expensive to initialize - for example if there is a mutex or + DYNAMIC_ARRAY. In this case they should be initialize in the + LF_ALLOCATOR::constructor, and lf_hash_insert should not overwrite them. + See wt_init() for example. +*/ +void lf_hash_init(LF_HASH *hash, uint element_size, uint flags, + uint key_offset, uint key_length, my_hash_get_key get_key, + CHARSET_INFO *charset) +{ + lf_alloc_init(&hash->alloc, sizeof(LF_SLIST)+element_size, + offsetof(LF_SLIST, key)); + lf_dynarray_init(&hash->array, sizeof(LF_SLIST *)); + hash->size= 1; + hash->count= 0; + hash->element_size= element_size; + hash->flags= flags; + hash->charset= charset ? charset : &my_charset_bin; + hash->key_offset= key_offset; + hash->key_length= key_length; + hash->get_key= get_key; + DBUG_ASSERT(get_key ? !key_offset && !key_length : key_length); +} + +void lf_hash_destroy(LF_HASH *hash) +{ + LF_SLIST *el, **head= (LF_SLIST **)_lf_dynarray_value(&hash->array, 0); + + if (unlikely(!head)) + return; + el= *head; + + while (el) + { + intptr next= el->link; + if (el->hashnr & 1) + lf_alloc_direct_free(&hash->alloc, el); /* normal node */ + else + my_free((void *)el, MYF(0)); /* dummy node */ + el= (LF_SLIST *)next; + } + lf_alloc_destroy(&hash->alloc); + lf_dynarray_destroy(&hash->array); +} + +/* + DESCRIPTION + inserts a new element to a hash. it will have a _copy_ of + data, not a pointer to it. + + RETURN + 0 - inserted + 1 - didn't (unique key conflict) + -1 - out of memory + + NOTE + see linsert() for pin usage notes +*/ +int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data) +{ + int csize, bucket, hashnr; + LF_SLIST *node, * volatile *el; + + lf_rwlock_by_pins(pins); + node= (LF_SLIST *)_lf_alloc_new(pins); + if (unlikely(!node)) + return -1; + memcpy(node+1, data, hash->element_size); + node->key= hash_key(hash, (uchar *)(node+1), &node->keylen); + hashnr= calc_hash(hash, node->key, node->keylen); + bucket= hashnr % hash->size; + el= _lf_dynarray_lvalue(&hash->array, bucket); + if (unlikely(!el)) + return -1; + if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins))) + return -1; + node->hashnr= my_reverse_bits(hashnr) | 1; /* normal node */ + if (linsert(el, hash->charset, node, pins, hash->flags)) + { + _lf_alloc_free(pins, node); + lf_rwunlock_by_pins(pins); + return 1; + } + csize= hash->size; + if ((my_atomic_add32(&hash->count, 1)+1.0) / csize > MAX_LOAD) + my_atomic_cas32(&hash->size, &csize, csize*2); + lf_rwunlock_by_pins(pins); + return 0; +} + +/* + DESCRIPTION + deletes an element with the given key from the hash (if a hash is + not unique and there're many elements with this key - the "first" + matching element is deleted) + RETURN + 0 - deleted + 1 - didn't (not found) + -1 - out of memory + NOTE + see ldelete() for pin usage notes +*/ +int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen) +{ + LF_SLIST * volatile *el; + uint bucket, hashnr= calc_hash(hash, (uchar *)key, keylen); + + bucket= hashnr % hash->size; + lf_rwlock_by_pins(pins); + el= _lf_dynarray_lvalue(&hash->array, bucket); + if (unlikely(!el)) + return -1; + /* + note that we still need to initialize_bucket here, + we cannot return "node not found", because an old bucket of that + node may've been split and the node was assigned to a new bucket + that was never accessed before and thus is not initialized. + */ + if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins))) + return -1; + if (ldelete(el, hash->charset, my_reverse_bits(hashnr) | 1, + (uchar *)key, keylen, pins)) + { + lf_rwunlock_by_pins(pins); + return 1; + } + my_atomic_add32(&hash->count, -1); + lf_rwunlock_by_pins(pins); + return 0; +} + +/* + RETURN + a pointer to an element with the given key (if a hash is not unique and + there're many elements with this key - the "first" matching element) + NULL if nothing is found + MY_ERRPTR if OOM + + NOTE + see lsearch() for pin usage notes +*/ +void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen) +{ + LF_SLIST * volatile *el, *found; + uint bucket, hashnr= calc_hash(hash, (uchar *)key, keylen); + + bucket= hashnr % hash->size; + lf_rwlock_by_pins(pins); + el= _lf_dynarray_lvalue(&hash->array, bucket); + if (unlikely(!el)) + return MY_ERRPTR; + if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins))) + return MY_ERRPTR; + found= lsearch(el, hash->charset, my_reverse_bits(hashnr) | 1, + (uchar *)key, keylen, pins); + lf_rwunlock_by_pins(pins); + return found ? found+1 : 0; +} + +static const uchar *dummy_key= (uchar*)""; + +/* + RETURN + 0 - ok + -1 - out of memory +*/ +static int initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node, + uint bucket, LF_PINS *pins) +{ + uint parent= my_clear_highest_bit(bucket); + LF_SLIST *dummy= (LF_SLIST *)my_malloc(sizeof(LF_SLIST), MYF(MY_WME)); + LF_SLIST **tmp= 0, *cur; + LF_SLIST * volatile *el= _lf_dynarray_lvalue(&hash->array, parent); + if (unlikely(!el || !dummy)) + return -1; + if (*el == NULL && bucket && + unlikely(initialize_bucket(hash, el, parent, pins))) + return -1; + dummy->hashnr= my_reverse_bits(bucket) | 0; /* dummy node */ + dummy->key= dummy_key; + dummy->keylen= 0; + if ((cur= linsert(el, hash->charset, dummy, pins, LF_HASH_UNIQUE))) + { + my_free((void *)dummy, MYF(0)); + dummy= cur; + } + my_atomic_casptr((void **)node, (void **)&tmp, dummy); + /* + note that if the CAS above failed (after linsert() succeeded), + it would mean that some other thread has executed linsert() for + the same dummy node, its linsert() failed, it picked up our + dummy node (in "dummy= cur") and executed the same CAS as above. + Which means that even if CAS above failed we don't need to retry, + and we should not free(dummy) - there's no memory leak here + */ + return 0; +} diff --git a/externals/mysql/mysys/list.c b/externals/mysql/mysys/list.c new file mode 100644 index 00000000000..75678af7a66 --- /dev/null +++ b/externals/mysql/mysys/list.c @@ -0,0 +1,114 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Code for handling dubble-linked lists in C +*/ + +#include "mysys_priv.h" +#include + + + + /* Add a element to start of list */ + +LIST *list_add(LIST *root, LIST *element) +{ + DBUG_ENTER("list_add"); + DBUG_PRINT("enter",("root: %p element: %p", root, element)); + if (root) + { + if (root->prev) /* If add in mid of list */ + root->prev->next= element; + element->prev=root->prev; + root->prev=element; + } + else + element->prev=0; + element->next=root; + DBUG_RETURN(element); /* New root */ +} + + +LIST *list_delete(LIST *root, LIST *element) +{ + if (element->prev) + element->prev->next=element->next; + else + root=element->next; + if (element->next) + element->next->prev=element->prev; + return root; +} + + +void list_free(LIST *root, uint free_data) +{ + LIST *next; + while (root) + { + next=root->next; + if (free_data) + my_free((uchar*) root->data,MYF(0)); + my_free((uchar*) root,MYF(0)); + root=next; + } +} + + +LIST *list_cons(void *data, LIST *list) +{ + LIST *new_charset=(LIST*) my_malloc(sizeof(LIST),MYF(MY_FAE)); + if (!new_charset) + return 0; + new_charset->data=data; + return list_add(list,new_charset); +} + + +LIST *list_reverse(LIST *root) +{ + LIST *last; + + last=root; + while (root) + { + last=root; + root=root->next; + last->next=last->prev; + last->prev=root; + } + return last; +} + +uint list_length(LIST *list) +{ + uint count; + for (count=0 ; list ; list=list->next, count++) ; + return count; +} + + +int list_walk(LIST *list, list_walk_action action, uchar* argument) +{ + int error=0; + while (list) + { + if ((error = (*action)(list->data,argument))) + return error; + list=list_rest(list); + } + return 0; +} diff --git a/externals/mysql/mysys/make-conf.c b/externals/mysql/mysys/make-conf.c new file mode 100644 index 00000000000..0dacde4dee0 --- /dev/null +++ b/externals/mysql/mysys/make-conf.c @@ -0,0 +1,71 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* make-conf.c + * make a charset .conf file out of a ctype-charset.c file. + */ + +#ifndef CHARSET +#error You must define the charset, e.g.: -DCHARSET=latin1 +#endif + +/* some pre-processor tricks to get us going */ +#define _STRINGIZE_HELPER(x) #x +#define STRINGIZE(x) _STRINGIZE_HELPER(x) + +#define _JOIN_WORDS_HELPER(a, b) a ## b +#define JOIN_WORDS(a, b) _JOIN_WORDS_HELPER(a, b) + +#define CH_SRC ctype- ## CHARSET ## .c +#define CH_INCLUDE STRINGIZE(CH_SRC) + +/* aaaah, that's better */ +#include +#include CH_INCLUDE + +#include +#include + +#define ROW_LEN 16 + +void print_array(const char *name, const uchar *array, uint size); + +int main(void) +{ + printf("# Configuration file for the " + STRINGIZE(CHARSET) + " character set.\n"); + + print_array("ctype", JOIN_WORDS(ctype_, CHARSET), 257); + print_array("to_lower", JOIN_WORDS(to_lower_, CHARSET), 256); + print_array("to_upper", JOIN_WORDS(to_upper_, CHARSET), 256); + print_array("sort_order", JOIN_WORDS(sort_order_, CHARSET), 256); + + exit(EXIT_SUCCESS); +} + +void print_array(const char *name, const uchar *array, uint size) +{ + uint i; + + printf("\n# The %s array must have %d elements.\n", name, size); + + for (i = 0; i < size; ++i) { + printf(" %02X", array[i]); + + if ((i+1) % ROW_LEN == size % ROW_LEN) + printf("\n"); + } +} diff --git a/externals/mysql/mysys/md5.c b/externals/mysql/mysys/md5.c new file mode 100644 index 00000000000..2388cebedc4 --- /dev/null +++ b/externals/mysql/mysys/md5.c @@ -0,0 +1,325 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to MD5Init, call MD5Update as + * needed on buffers full of bytes, and then call MD5Final, which + * will fill a supplied 16-byte array with the digest. + */ + +/* This code was modified in 1997 by Jim Kingdon of Cyclic Software to + not require an integer type which is exactly 32 bits. This work + draws on the changes for the same purpose by Tatu Ylonen + as part of SSH, but since I didn't actually use + that code, there is no copyright issue. I hereby disclaim + copyright in any changes I have made; this code remains in the + public domain. */ + +#include +#include +#include "my_md5.h" + +#include /* for memcpy() and memset() */ + + +static void +my_MD5Transform (cvs_uint32 buf[4], const unsigned char in[64]); + +/* Little-endian byte-swapping routines. Note that these do not + depend on the size of datatypes such as uint32, nor do they require + us to detect the endianness of the machine we are running on. It + is possible they should be macros for speed, but I would be + surprised if they were a performance bottleneck for MD5. */ + +static uint32 getu32 (const unsigned char *addr) +{ + return (((((unsigned long)addr[3] << 8) | addr[2]) << 8) + | addr[1]) << 8 | addr[0]; +} + +static void +putu32 (uint32 data, unsigned char *addr) +{ + addr[0] = (unsigned char)data; + addr[1] = (unsigned char)(data >> 8); + addr[2] = (unsigned char)(data >> 16); + addr[3] = (unsigned char)(data >> 24); +} + +/* + Start MD5 accumulation. Set bit count to 0 and buffer to mysterious + initialization constants. +*/ +void +my_MD5Init (my_MD5Context *ctx) +{ + ctx->buf[0] = 0x67452301; + ctx->buf[1] = 0xefcdab89; + ctx->buf[2] = 0x98badcfe; + ctx->buf[3] = 0x10325476; + + ctx->bits[0] = 0; + ctx->bits[1] = 0; +} + +/* + Update context to reflect the concatenation of another buffer full + of bytes. +*/ +void +my_MD5Update (my_MD5Context *ctx, unsigned char const *buf, unsigned len) +{ + uint32 t; + + /* Update bitcount */ + + t = ctx->bits[0]; + if ((ctx->bits[0] = (t + ((uint32)len << 3)) & 0xffffffff) < t) + ctx->bits[1]++; /* Carry from low to high */ + ctx->bits[1] += len >> 29; + + t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ + + /* Handle any leading odd-sized chunks */ + + if ( t ) { + unsigned char *p = ctx->in + t; + + t = 64-t; + if (len < t) { + memcpy(p, buf, len); + return; + } + memcpy(p, buf, t); + my_MD5Transform (ctx->buf, ctx->in); + buf += t; + len -= t; + } + + /* Process data in 64-byte chunks */ + + while (len >= 64) { + memcpy(ctx->in, buf, 64); + my_MD5Transform (ctx->buf, ctx->in); + buf += 64; + len -= 64; + } + + /* Handle any remaining bytes of data. */ + + memcpy(ctx->in, buf, len); +} + +/* + Final wrapup - pad to 64-byte boundary with the bit pattern + 1 0* (64-bit count of bits processed, MSB-first) +*/ +void +my_MD5Final (unsigned char digest[16], my_MD5Context *ctx) +{ + unsigned count; + unsigned char *p; + + /* Compute number of bytes mod 64 */ + count = (ctx->bits[0] >> 3) & 0x3F; + + /* Set the first char of padding to 0x80. This is safe since there is + always at least one byte free */ + p = ctx->in + count; + *p++ = 0x80; + + /* Bytes of padding needed to make 64 bytes */ + count = 64 - 1 - count; + + /* Pad out to 56 mod 64 */ + if (count < 8) { + /* Two lots of padding: Pad the first block to 64 bytes */ + memset(p, 0, count); + my_MD5Transform (ctx->buf, ctx->in); + + /* Now fill the next block with 56 bytes */ + memset(ctx->in, 0, 56); + } else { + /* Pad block to 56 bytes */ + memset(p, 0, count-8); + } + + /* Append length in bits and transform */ + putu32(ctx->bits[0], ctx->in + 56); + putu32(ctx->bits[1], ctx->in + 60); + + my_MD5Transform (ctx->buf, ctx->in); + putu32(ctx->buf[0], digest); + putu32(ctx->buf[1], digest + 4); + putu32(ctx->buf[2], digest + 8); + putu32(ctx->buf[3], digest + 12); + memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ +} + +#ifndef ASM_MD5 + +/* The four core functions - F1 is optimized somewhat */ + +/* #define F1(x, y, z) (x & y | ~x & z) */ +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) + +/* This is the central step in the MD5 algorithm. */ +#define MD5STEP(f, w, x, y, z, data, s) \ + ( w += f(x, y, z) + data, w &= 0xffffffff, w = w<>(32-s), w += x ) + +/* + * The core of the MD5 algorithm, this alters an existing MD5 hash to + * reflect the addition of 16 longwords of new data. MD5Update blocks + * the data and converts bytes into longwords for this routine. + */ +static void +my_MD5Transform (uint32 buf[4], const unsigned char inraw[64]) +{ + register uint32 a, b, c, d; + uint32 in[16]; + int i; + + for (i = 0; i < 16; ++i) + in[i] = getu32 (inraw + 4 * i); + + a = buf[0]; + b = buf[1]; + c = buf[2]; + d = buf[3]; + + MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7); + MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12); + MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17); + MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22); + MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7); + MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12); + MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17); + MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22); + MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7); + MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12); + MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17); + MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22); + MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7); + MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12); + MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17); + MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22); + + MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5); + MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9); + MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14); + MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20); + MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5); + MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9); + MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14); + MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20); + MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6, 5); + MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6, 9); + MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14); + MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20); + MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905, 5); + MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8, 9); + MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14); + MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20); + + MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942, 4); + MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11); + MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16); + MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23); + MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44, 4); + MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11); + MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16); + MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23); + MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6, 4); + MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11); + MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16); + MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23); + MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039, 4); + MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11); + MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16); + MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23); + + MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244, 6); + MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10); + MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15); + MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21); + MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3, 6); + MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10); + MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15); + MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21); + MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f, 6); + MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10); + MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15); + MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21); + MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82, 6); + MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10); + MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15); + MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21); + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} +#endif + +#ifdef TEST +/* + Simple test program. Can use it to manually run the tests from + RFC1321 for example. +*/ +#include + +int +main (int argc, char **argv) +{ + my_MD5Context context; + unsigned char checksum[16]; + int i; + int j; + + if (argc < 2) + { + fprintf (stderr, "usage: %s string-to-hash\n", argv[0]); + exit (1); + } + for (j = 1; j < argc; ++j) + { + printf ("MD5 (\"%s\") = ", argv[j]); + my_MD5Init (&context); + my_MD5Update (&context, argv[j], strlen (argv[j])); + my_MD5Final (checksum, &context); + for (i = 0; i < 16; i++) + { + printf ("%02x", (unsigned int) checksum[i]); + } + printf ("\n"); + } + return 0; +} +#endif /* TEST */ diff --git a/externals/mysql/mysys/mf_arr_appstr.c b/externals/mysql/mysys/mf_arr_appstr.c new file mode 100644 index 00000000000..1edbea9df4a --- /dev/null +++ b/externals/mysql/mysys/mf_arr_appstr.c @@ -0,0 +1,61 @@ +/* Copyright (C) 2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include /* strcmp() */ + + +/** + Append str to array, or move to the end if it already exists + + @param str String to be appended + @param array The array, terminated by a NULL element, all unused elements + pre-initialized to NULL + @param size Size of the array; array must be terminated by a NULL + pointer, so can hold size - 1 elements + + @retval FALSE Success + @retval TRUE Failure, array is full +*/ + +my_bool array_append_string_unique(const char *str, + const char **array, size_t size) +{ + const char **p; + /* end points at the terminating NULL element */ + const char **end= array + size - 1; + DBUG_ASSERT(*end == NULL); + + for (p= array; *p; ++p) + { + if (strcmp(*p, str) == 0) + break; + } + if (p >= end) + return TRUE; /* Array is full */ + + DBUG_ASSERT(*p == NULL || strcmp(*p, str) == 0); + + while (*(p + 1)) + { + *p= *(p + 1); + ++p; + } + + DBUG_ASSERT(p < end); + *p= str; + + return FALSE; /* Success */ +} diff --git a/externals/mysql/mysys/mf_brkhant.c b/externals/mysql/mysys/mf_brkhant.c new file mode 100644 index 00000000000..3573b9973b2 --- /dev/null +++ b/externals/mysql/mysys/mf_brkhant.c @@ -0,0 +1,72 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Dont let the user break when you are doing something important */ +/* Remembers if it got 'SIGINT' and executes it on allow_break */ +/* A static buffer is used; don't call dont_break() twice in a row */ + +#include "mysys_priv.h" +#include "my_static.h" + + /* Set variable that we can't break */ + +#if !defined(THREAD) +void dont_break(void) +{ + my_dont_interrupt=1; + return; +} /* dont_break */ + +void allow_break(void) +{ + { + reg1 int index; + + my_dont_interrupt=0; + if (_my_signals) + { + if (_my_signals > MAX_SIGNALS) + _my_signals=MAX_SIGNALS; + for (index=0 ; index < _my_signals ; index++) + { + if (_my_sig_remember[index].func) /* Safequard */ + { + (*_my_sig_remember[index].func)(_my_sig_remember[index].number); + _my_sig_remember[index].func=0; + } + } + _my_signals=0; + } + } +} /* dont_break */ +#endif + + /* Set old status */ + +#if !defined(THREAD) +void my_remember_signal(int signal_number, sig_handler (*func) (int)) +{ +#ifndef __WIN__ + reg1 int index; + + index=_my_signals++; /* Nobody can break a ++ ? */ + if (index < MAX_SIGNALS) + { + _my_sig_remember[index].number=signal_number; + _my_sig_remember[index].func=func; + } +#endif /* __WIN__ */ +} /* my_remember_signal */ +#endif /* THREAD */ diff --git a/externals/mysql/mysys/mf_cache.c b/externals/mysql/mysys/mf_cache.c new file mode 100644 index 00000000000..f0df0f3fa77 --- /dev/null +++ b/externals/mysql/mysys/mf_cache.c @@ -0,0 +1,121 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Open a temporary file and cache it with io_cache. Delete it on close */ + +#include "mysys_priv.h" +#include +#include "my_static.h" +#include "mysys_err.h" + + /* + Remove an open tempfile so that it doesn't survive + if we crash; If the operating system doesn't support + this, just remember the file name for later removal + */ + +static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)), + const char *name) +{ +#if O_TEMPORARY == 0 +#if !defined(CANT_DELETE_OPEN_FILES) + /* The following should always succeed */ + (void) my_delete(name,MYF(MY_WME | ME_NOINPUT)); +#else + int length; + if (!(cache->file_name= + (char*) my_malloc((length=strlen(name)+1),MYF(MY_WME)))) + { + my_close(cache->file,MYF(0)); + cache->file = -1; + errno=my_errno=ENOMEM; + return 1; + } + memcpy(cache->file_name,name,length); +#endif +#endif /* O_TEMPORARY == 0 */ + return 0; +} + + /* + ** Open tempfile cached by IO_CACHE + ** Should be used when no seeks are done (only reinit_io_buff) + ** Return 0 if cache is inited ok + ** The actual file is created when the IO_CACHE buffer gets filled + ** If dir is not given, use TMPDIR. + */ + +my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix, + size_t cache_size, myf cache_myflags) +{ + DBUG_ENTER("open_cached_file"); + cache->dir= dir ? my_strdup(dir,MYF(cache_myflags & MY_WME)) : (char*) 0; + cache->prefix= (prefix ? my_strdup(prefix,MYF(cache_myflags & MY_WME)) : + (char*) 0); + cache->file_name=0; + cache->buffer=0; /* Mark that not open */ + if (!init_io_cache(cache,-1,cache_size,WRITE_CACHE,0L,0, + MYF(cache_myflags | MY_NABP))) + { + DBUG_RETURN(0); + } + my_free(cache->dir, MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); + DBUG_RETURN(1); +} + + /* Create the temporary file */ + +my_bool real_open_cached_file(IO_CACHE *cache) +{ + char name_buff[FN_REFLEN]; + int error=1; + DBUG_ENTER("real_open_cached_file"); + if ((cache->file=create_temp_file(name_buff, cache->dir, cache->prefix, + (O_RDWR | O_BINARY | O_TRUNC | + O_TEMPORARY | O_SHORT_LIVED), + MYF(MY_WME))) >= 0) + { + error=0; + cache_remove_open_tmp(cache, name_buff); + } + DBUG_RETURN(error); +} + + +void close_cached_file(IO_CACHE *cache) +{ + DBUG_ENTER("close_cached_file"); + if (my_b_inited(cache)) + { + File file=cache->file; + cache->file= -1; /* Don't flush data */ + (void) end_io_cache(cache); + if (file >= 0) + { + (void) my_close(file,MYF(0)); +#ifdef CANT_DELETE_OPEN_FILES + if (cache->file_name) + { + (void) my_delete(cache->file_name,MYF(MY_WME | ME_NOINPUT)); + my_free(cache->file_name,MYF(0)); + } +#endif + } + my_free(cache->dir,MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); + } + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/mysys/mf_dirname.c b/externals/mysql/mysys/mf_dirname.c new file mode 100644 index 00000000000..1b428ded751 --- /dev/null +++ b/externals/mysql/mysys/mf_dirname.c @@ -0,0 +1,165 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + + /* Functions definied in this file */ + +size_t dirname_length(const char *name) +{ + register char *pos, *gpos; +#ifdef BASKSLASH_MBTAIL + CHARSET_INFO *fs= fs_character_set(); +#endif +#ifdef FN_DEVCHAR + if ((pos=(char*)strrchr(name,FN_DEVCHAR)) == 0) +#endif + pos=(char*) name-1; + + gpos= pos++; + for ( ; *pos ; pos++) /* Find last FN_LIBCHAR */ + { +#ifdef BASKSLASH_MBTAIL + uint l; + if (use_mb(fs) && (l= my_ismbchar(fs, pos, pos + 3))) + { + pos+= l - 1; + continue; + } +#endif + if (*pos == FN_LIBCHAR || *pos == '/' +#ifdef FN_C_AFTER_DIR + || *pos == FN_C_AFTER_DIR || *pos == FN_C_AFTER_DIR_2 +#endif + ) + gpos=pos; + } + return (size_t) (gpos+1-(char*) name); +} + + +/* + Gives directory part of filename. Directory ends with '/' + + SYNOPSIS + dirname_part() + to Store directory name here + name Original name + to_length Store length of 'to' here + + RETURN + # Length of directory part in 'name' +*/ + +size_t dirname_part(char *to, const char *name, size_t *to_res_length) +{ + size_t length; + DBUG_ENTER("dirname_part"); + DBUG_PRINT("enter",("'%s'",name)); + + length=dirname_length(name); + *to_res_length= (size_t) (convert_dirname(to, name, name+length) - to); + DBUG_RETURN(length); +} /* dirname */ + + +/* + Convert directory name to use under this system + + SYNPOSIS + convert_dirname() + to Store result here. Must be at least of size + min(FN_REFLEN, strlen(from) + 1) to make room + for adding FN_LIBCHAR at the end. + from Original filename. May be == to + from_end Pointer at end of filename (normally end \0) + + IMPLEMENTATION + If MSDOS converts '/' to '\' + If VMS converts '<' to '[' and '>' to ']' + Adds a FN_LIBCHAR to end if the result string if there isn't one + and the last isn't dev_char. + Copies data from 'from' until ASCII(0) for until from == from_end + If you want to use the whole 'from' string, just send NullS as the + last argument. + + If the result string is larger than FN_REFLEN -1, then it's cut. + + RETURN + Returns pointer to end \0 in to +*/ + +#ifndef FN_DEVCHAR +#define FN_DEVCHAR '\0' /* For easier code */ +#endif + +char *convert_dirname(char *to, const char *from, const char *from_end) +{ + char *to_org=to; +#ifdef BACKSLASH_MBTAIL + CHARSET_INFO *fs= fs_character_set(); +#endif + DBUG_ENTER("convert_dirname"); + + /* We use -2 here, becasue we need place for the last FN_LIBCHAR */ + if (!from_end || (from_end - from) > FN_REFLEN-2) + from_end=from+FN_REFLEN -2; + +#if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2) + { + for (; from != from_end && *from ; from++) + { + if (*from == '/') + *to++= FN_LIBCHAR; +#ifdef FN_C_BEFORE_DIR_2 + else if (*from == FN_C_BEFORE_DIR_2) + *to++= FN_C_BEFORE_DIR; + else if (*from == FN_C_AFTER_DIR_2) + *to++= FN_C_AFTER_DIR; +#endif + else + { +#ifdef BACKSLASH_MBTAIL + uint l; + if (use_mb(fs) && (l= my_ismbchar(fs, from, from + 3))) + { + memmove(to, from, l); + to+= l; + from+= l - 1; + to_org= to; /* Don't look inside mbchar */ + } + else +#endif + { + *to++= *from; + } + } + } + *to=0; + } +#else + /* This is ok even if to == from, becasue we need to cut the string */ + to= strmake(to, from, (size_t) (from_end-from)); +#endif + + /* Add FN_LIBCHAR to the end of directory path */ + if (to != to_org && (to[-1] != FN_LIBCHAR && to[-1] != FN_DEVCHAR)) + { + *to++=FN_LIBCHAR; + *to=0; + } + DBUG_RETURN(to); /* Pointer to end of dir */ +} /* convert_dirname */ diff --git a/externals/mysql/mysys/mf_fn_ext.c b/externals/mysql/mysys/mf_fn_ext.c new file mode 100644 index 00000000000..da7fac3de73 --- /dev/null +++ b/externals/mysql/mysys/mf_fn_ext.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "mysys_priv.h" +#include + +/* + Return a pointer to the extension of the filename. + + SYNOPSIS + fn_ext() + name Name of file + + DESCRIPTION + The extension is defined as everything after the first extension character + (normally '.') after the directory name. + + RETURN VALUES + Pointer to to the extension character. If there isn't any extension, + points at the end ASCII(0) of the filename. +*/ + +char *fn_ext(const char *name) +{ + register const char *pos, *gpos; + DBUG_ENTER("fn_ext"); + DBUG_PRINT("mfunkt",("name: '%s'",name)); + +#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) || defined(BASKSLASH_MBTAIL) + { + char buff[FN_REFLEN]; + size_t res_length; + gpos= name+ dirname_part(buff,(char*) name, &res_length); + } +#else + if (!(gpos= strrchr(name, FN_LIBCHAR))) + gpos= name; +#endif + pos=strchr(gpos,FN_EXTCHAR); + DBUG_RETURN((char*) (pos ? pos : strend(gpos))); +} /* fn_ext */ diff --git a/externals/mysql/mysys/mf_format.c b/externals/mysql/mysys/mf_format.c new file mode 100644 index 00000000000..f199132626b --- /dev/null +++ b/externals/mysql/mysys/mf_format.c @@ -0,0 +1,142 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + +/* + Formats a filename with possible replace of directory of extension + Function can handle the case where 'to' == 'name' + For a description of the flag values, consult my_sys.h + The arguments should be in unix format. +*/ + +char * fn_format(char * to, const char *name, const char *dir, + const char *extension, uint flag) +{ + char dev[FN_REFLEN], buff[FN_REFLEN], *pos, *startpos; + const char *ext; + reg1 size_t length; + size_t dev_length; + DBUG_ENTER("fn_format"); + DBUG_PRINT("enter",("name: %s dir: %s extension: %s flag: %d", + name,dir,extension,flag)); + + /* Copy and skip directory */ + name+=(length=dirname_part(dev, (startpos=(char *) name), &dev_length)); + if (length == 0 || (flag & MY_REPLACE_DIR)) + { + /* Use given directory */ + convert_dirname(dev,dir,NullS); /* Fix to this OS */ + } + else if ((flag & MY_RELATIVE_PATH) && !test_if_hard_path(dev)) + { + /* Put 'dir' before the given path */ + strmake(buff,dev,sizeof(buff)-1); + pos=convert_dirname(dev,dir,NullS); + strmake(pos,buff,sizeof(buff)-1- (int) (pos-dev)); + } + + if (flag & MY_PACK_FILENAME) + pack_dirname(dev,dev); /* Put in ./.. and ~/.. */ + if (flag & MY_UNPACK_FILENAME) + (void) unpack_dirname(dev,dev); /* Replace ~/.. with dir */ + + if (!(flag & MY_APPEND_EXT) && + (pos= (char*) strchr(name,FN_EXTCHAR)) != NullS) + { + if ((flag & MY_REPLACE_EXT) == 0) /* If we should keep old ext */ + { + length=strlength(name); /* Use old extension */ + ext = ""; + } + else + { + length= (size_t) (pos-(char*) name); /* Change extension */ + ext= extension; + } + } + else + { + length=strlength(name); /* No ext, use the now one */ + ext=extension; + } + + if (strlen(dev)+length+strlen(ext) >= FN_REFLEN || length >= FN_LEN ) + { + /* To long path, return original or NULL */ + size_t tmp_length; + if (flag & MY_SAFE_PATH) + return NullS; + tmp_length= strlength(startpos); + DBUG_PRINT("error",("dev: '%s' ext: '%s' length: %u",dev,ext, + (uint) length)); + (void) strmake(to,startpos,min(tmp_length,FN_REFLEN-1)); + } + else + { + if (to == startpos) + { + bmove(buff,(uchar*) name,length); /* Save name for last copy */ + name=buff; + } + pos=strmake(strmov(to,dev),name,length); + (void) strmov(pos,ext); /* Don't convert extension */ + } + /* + If MY_RETURN_REAL_PATH and MY_RESOLVE_SYMLINK is given, only do + realpath if the file is a symbolic link + */ + if (flag & MY_RETURN_REAL_PATH) + (void) my_realpath(to, to, MYF(flag & MY_RESOLVE_SYMLINKS ? + MY_RESOLVE_LINK: 0)); + else if (flag & MY_RESOLVE_SYMLINKS) + { + strmov(buff,to); + (void) my_readlink(to, buff, MYF(0)); + } + DBUG_RETURN(to); +} /* fn_format */ + + +/* + strlength(const string str) + Return length of string with end-space:s not counted. +*/ + +size_t strlength(const char *str) +{ + reg1 const char * pos; + reg2 const char * found; + DBUG_ENTER("strlength"); + + pos= found= str; + + while (*pos) + { + if (*pos != ' ') + { + while (*++pos && *pos != ' ') {}; + if (!*pos) + { + found=pos; /* String ends here */ + break; + } + } + found=pos; + while (*++pos == ' ') {}; + } + DBUG_RETURN((size_t) (found - str)); +} /* strlength */ diff --git a/externals/mysql/mysys/mf_getdate.c b/externals/mysql/mysys/mf_getdate.c new file mode 100644 index 00000000000..3a8e1be6a0b --- /dev/null +++ b/externals/mysql/mysys/mf_getdate.c @@ -0,0 +1,81 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Get date in a printable form: yyyy-mm-dd hh:mm:ss */ + +#include "mysys_priv.h" +#include + +/* + get date as string + + SYNOPSIS + get_date() + to - string where date will be written + flag - format of date: + If flag & GETDATE_TIME Return date and time + If flag & GETDATE_SHORT_DATE Return short date format YYMMDD + If flag & GETDATE_HHMMSSTIME Return time in HHMMDD format. + If flag & GETDATE_GMT Date/time in GMT + If flag & GETDATE_FIXEDLENGTH Return fixed length date/time + date - for conversion +*/ + + +void get_date(register char * to, int flag, time_t date) +{ + reg2 struct tm *start_time; + time_t skr; +#if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT) + struct tm tm_tmp; +#endif + + skr=date ? (time_t) date : my_time(0); +#if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT) + if (flag & GETDATE_GMT) + localtime_r(&skr,&tm_tmp); + else + gmtime_r(&skr,&tm_tmp); + start_time= &tm_tmp; +#else + if (flag & GETDATE_GMT) + start_time= localtime(&skr); + else + start_time= gmtime(&skr); +#endif + if (flag & GETDATE_SHORT_DATE) + sprintf(to,"%02d%02d%02d", + start_time->tm_year % 100, + start_time->tm_mon+1, + start_time->tm_mday); + else + sprintf(to, ((flag & GETDATE_FIXEDLENGTH) ? + "%4d-%02d-%02d" : "%d-%02d-%02d"), + start_time->tm_year+1900, + start_time->tm_mon+1, + start_time->tm_mday); + if (flag & GETDATE_DATE_TIME) + sprintf(strend(to), + ((flag & GETDATE_FIXEDLENGTH) ? + " %02d:%02d:%02d" : " %2d:%02d:%02d"), + start_time->tm_hour, + start_time->tm_min, + start_time->tm_sec); + else if (flag & GETDATE_HHMMSSTIME) + sprintf(strend(to),"%02d%02d%02d", + start_time->tm_hour, + start_time->tm_min, + start_time->tm_sec); +} /* get_date */ diff --git a/externals/mysql/mysys/mf_iocache.c b/externals/mysql/mysys/mf_iocache.c new file mode 100644 index 00000000000..120d886ce06 --- /dev/null +++ b/externals/mysql/mysys/mf_iocache.c @@ -0,0 +1,1967 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Cashing of files with only does (sequential) read or writes of fixed- + length records. A read isn't allowed to go over file-length. A read is ok + if it ends at file-length and next read can try to read after file-length + (and get a EOF-error). + Possibly use of asyncronic io. + macros for read and writes for faster io. + Used instead of FILE when reading or writing whole files. + This code makes mf_rec_cache obsolete (currently only used by ISAM) + One can change info->pos_in_file to a higher value to skip bytes in file if + also info->read_pos is set to info->read_end. + If called through open_cached_file(), then the temporary file will + only be created if a write exeeds the file buffer or if one calls + my_b_flush_io_cache(). + + If one uses SEQ_READ_APPEND, then two buffers are allocated, one for + reading and another for writing. Reads are first done from disk and + then done from the write buffer. This is an efficient way to read + from a log file when one is writing to it at the same time. + For this to work, the file has to be opened in append mode! + Note that when one uses SEQ_READ_APPEND, one MUST write using + my_b_append ! This is needed because we need to lock the mutex + every time we access the write buffer. + +TODO: + When one SEQ_READ_APPEND and we are reading and writing at the same time, + each time the write buffer gets full and it's written to disk, we will + always do a disk read to read a part of the buffer from disk to the + read buffer. + This should be fixed so that when we do a my_b_flush_io_cache() and + we have been reading the write buffer, we should transfer the rest of the + write buffer to the read buffer before we start to reuse it. +*/ + +#define MAP_TO_USE_RAID +#include "mysys_priv.h" +#include +#ifdef HAVE_AIOWAIT +#include "mysys_err.h" +static void my_aiowait(my_aio_result *result); +#endif +#include + +#ifdef THREAD +#define lock_append_buffer(info) \ + pthread_mutex_lock(&(info)->append_buffer_lock) +#define unlock_append_buffer(info) \ + pthread_mutex_unlock(&(info)->append_buffer_lock) +#else +#define lock_append_buffer(info) +#define unlock_append_buffer(info) +#endif + +#define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1)) +#define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1)) + +/* + Setup internal pointers inside IO_CACHE + + SYNOPSIS + setup_io_cache() + info IO_CACHE handler + + NOTES + This is called on automaticly on init or reinit of IO_CACHE + It must be called externally if one moves or copies an IO_CACHE + object. +*/ + +void setup_io_cache(IO_CACHE* info) +{ + /* Ensure that my_b_tell() and my_b_bytes_in_cache works */ + if (info->type == WRITE_CACHE) + { + info->current_pos= &info->write_pos; + info->current_end= &info->write_end; + } + else + { + info->current_pos= &info->read_pos; + info->current_end= &info->read_end; + } +} + + +static void +init_functions(IO_CACHE* info) +{ + enum cache_type type= info->type; + switch (type) { + case READ_NET: + /* + Must be initialized by the caller. The problem is that + _my_b_net_read has to be defined in sql directory because of + the dependency on THD, and therefore cannot be visible to + programs that link against mysys but know nothing about THD, such + as myisamchk + */ + break; + case SEQ_READ_APPEND: + info->read_function = _my_b_seq_read; + info->write_function = 0; /* Force a core if used */ + break; + default: + info->read_function = +#ifdef THREAD + info->share ? _my_b_read_r : +#endif + _my_b_read; + info->write_function = _my_b_write; + } + + setup_io_cache(info); +} + + +/* FUNCTIONS TO SET UP OR RESET A CACHE */ + + +/* + Initialize an IO_CACHE object + + SYNOPSOS + init_io_cache() + info cache handler to initialize + file File that should be associated to to the handler + If == -1 then real_open_cached_file() + will be called when it's time to open file. + cachesize Size of buffer to allocate for read/write + If == 0 then use my_default_record_cache_size + type Type of cache + seek_offset Where cache should start reading/writing + use_async_io Set to 1 of we should use async_io (if avaiable) + cache_myflags Bitmap of differnt flags + MY_WME | MY_FAE | MY_NABP | MY_FNABP | + MY_DONT_CHECK_FILESIZE + + RETURN + 0 ok + # error +*/ + +int init_io_cache(IO_CACHE *info, File file, size_t cachesize, + enum cache_type type, my_off_t seek_offset, + pbool use_async_io, myf cache_myflags) +{ + size_t min_cache; + my_off_t pos; + my_off_t end_of_file= ~(my_off_t) 0; + DBUG_ENTER("init_io_cache"); + DBUG_PRINT("enter",("cache: %p type: %d pos: %ld", + info, (int) type, (ulong) seek_offset)); + + info->file= file; + info->type= TYPE_NOT_SET; /* Don't set it until mutex are created */ + info->pos_in_file= seek_offset; + info->pre_close= info->pre_read= info->post_read= info->post_write= NULL; + info->arg = 0; + info->alloced_buffer = 0; + info->buffer=0; + info->seek_not_done= 0; + + if (file >= 0) + { + pos= my_tell(file, MYF(0)); + if ((pos == (my_off_t) -1) && (my_errno == ESPIPE)) + { + /* + This kind of object doesn't support seek() or tell(). Don't set a + flag that will make us again try to seek() later and fail. + */ + info->seek_not_done= 0; + /* + Additionally, if we're supposed to start somewhere other than the + the beginning of whatever this file is, then somebody made a bad + assumption. + */ + DBUG_ASSERT(seek_offset == 0); + } + else + info->seek_not_done= test(seek_offset != pos); + } + + info->disk_writes= 0; +#ifdef THREAD + info->share=0; +#endif + + if (!cachesize && !(cachesize= my_default_record_cache_size)) + DBUG_RETURN(1); /* No cache requested */ + min_cache=use_async_io ? IO_SIZE*4 : IO_SIZE*2; + if (type == READ_CACHE || type == SEQ_READ_APPEND) + { /* Assume file isn't growing */ + if (!(cache_myflags & MY_DONT_CHECK_FILESIZE)) + { + /* Calculate end of file to avoid allocating oversized buffers */ + end_of_file=my_seek(file,0L,MY_SEEK_END,MYF(0)); + /* Need to reset seek_not_done now that we just did a seek. */ + info->seek_not_done= end_of_file == seek_offset ? 0 : 1; + if (end_of_file < seek_offset) + end_of_file=seek_offset; + /* Trim cache size if the file is very small */ + if ((my_off_t) cachesize > end_of_file-seek_offset+IO_SIZE*2-1) + { + cachesize= (size_t) (end_of_file-seek_offset)+IO_SIZE*2-1; + use_async_io=0; /* No need to use async */ + } + } + } + cache_myflags &= ~MY_DONT_CHECK_FILESIZE; + if (type != READ_NET && type != WRITE_NET) + { + /* Retry allocating memory in smaller blocks until we get one */ + cachesize= ((cachesize + min_cache-1) & ~(min_cache-1)); + for (;;) + { + size_t buffer_block; + if (cachesize < min_cache) + cachesize = min_cache; + buffer_block= cachesize; + if (type == SEQ_READ_APPEND) + buffer_block *= 2; + if ((info->buffer= + (uchar*) my_malloc(buffer_block, + MYF((cache_myflags & ~ MY_WME) | + (cachesize == min_cache ? MY_WME : 0)))) != 0) + { + info->write_buffer=info->buffer; + if (type == SEQ_READ_APPEND) + info->write_buffer = info->buffer + cachesize; + info->alloced_buffer=1; + break; /* Enough memory found */ + } + if (cachesize == min_cache) + DBUG_RETURN(2); /* Can't alloc cache */ + /* Try with less memory */ + cachesize= (cachesize*3/4 & ~(min_cache-1)); + } + } + + DBUG_PRINT("info",("init_io_cache: cachesize = %lu", (ulong) cachesize)); + info->read_length=info->buffer_length=cachesize; + info->myflags=cache_myflags & ~(MY_NABP | MY_FNABP); + info->request_pos= info->read_pos= info->write_pos = info->buffer; + if (type == SEQ_READ_APPEND) + { + info->append_read_pos = info->write_pos = info->write_buffer; + info->write_end = info->write_buffer + info->buffer_length; +#ifdef THREAD + pthread_mutex_init(&info->append_buffer_lock,MY_MUTEX_INIT_FAST); +#endif + } +#if defined(SAFE_MUTEX) && defined(THREAD) + else + { + /* Clear mutex so that safe_mutex will notice that it's not initialized */ + bzero((char*) &info->append_buffer_lock, sizeof(info)); + } +#endif + + if (type == WRITE_CACHE) + info->write_end= + info->buffer+info->buffer_length- (seek_offset & (IO_SIZE-1)); + else + info->read_end=info->buffer; /* Nothing in cache */ + + /* End_of_file may be changed by user later */ + info->end_of_file= end_of_file; + info->error= info->hard_write_error_in_the_past= 0; + info->type= type; + init_functions(info); +#ifdef HAVE_AIOWAIT + if (use_async_io && ! my_disable_async_io) + { + DBUG_PRINT("info",("Using async io")); + info->read_length/=2; + info->read_function=_my_b_async_read; + } + info->inited=info->aio_result.pending=0; +#endif + DBUG_RETURN(0); +} /* init_io_cache */ + + /* Wait until current request is ready */ + +#ifdef HAVE_AIOWAIT +static void my_aiowait(my_aio_result *result) +{ + if (result->pending) + { + struct aio_result_t *tmp; + for (;;) + { + if ((int) (tmp=aiowait((struct timeval *) 0)) == -1) + { + if (errno == EINTR) + continue; + DBUG_PRINT("error",("No aio request, error: %d",errno)); + result->pending=0; /* Assume everythings is ok */ + break; + } + ((my_aio_result*) tmp)->pending=0; + if ((my_aio_result*) tmp == result) + break; + } + } + return; +} +#endif + + +/* + Use this to reset cache to re-start reading or to change the type + between READ_CACHE <-> WRITE_CACHE + If we are doing a reinit of a cache where we have the start of the file + in the cache, we are reusing this memory without flushing it to disk. +*/ + +my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, + my_off_t seek_offset, + pbool use_async_io __attribute__((unused)), + pbool clear_cache) +{ + DBUG_ENTER("reinit_io_cache"); + DBUG_PRINT("enter",("cache: %p type: %d seek_offset: %lu clear_cache: %d", + info, type, (ulong) seek_offset, + (int) clear_cache)); + + /* One can't do reinit with the following types */ + DBUG_ASSERT(type != READ_NET && info->type != READ_NET && + type != WRITE_NET && info->type != WRITE_NET && + type != SEQ_READ_APPEND && info->type != SEQ_READ_APPEND); + + /* If the whole file is in memory, avoid flushing to disk */ + if (! clear_cache && + seek_offset >= info->pos_in_file && + seek_offset <= my_b_tell(info)) + { + /* Reuse current buffer without flushing it to disk */ + uchar *pos; + if (info->type == WRITE_CACHE && type == READ_CACHE) + { + info->read_end=info->write_pos; + info->end_of_file=my_b_tell(info); + /* + Trigger a new seek only if we have a valid + file handle. + */ + info->seek_not_done= (info->file != -1); + } + else if (type == WRITE_CACHE) + { + if (info->type == READ_CACHE) + { + info->write_end=info->write_buffer+info->buffer_length; + info->seek_not_done=1; + } + info->end_of_file = ~(my_off_t) 0; + } + pos=info->request_pos+(seek_offset-info->pos_in_file); + if (type == WRITE_CACHE) + info->write_pos=pos; + else + info->read_pos= pos; +#ifdef HAVE_AIOWAIT + my_aiowait(&info->aio_result); /* Wait for outstanding req */ +#endif + } + else + { + /* + If we change from WRITE_CACHE to READ_CACHE, assume that everything + after the current positions should be ignored + */ + if (info->type == WRITE_CACHE && type == READ_CACHE) + info->end_of_file=my_b_tell(info); + /* flush cache if we want to reuse it */ + if (!clear_cache && my_b_flush_io_cache(info,1)) + DBUG_RETURN(1); + info->pos_in_file=seek_offset; + /* Better to do always do a seek */ + info->seek_not_done=1; + info->request_pos=info->read_pos=info->write_pos=info->buffer; + if (type == READ_CACHE) + { + info->read_end=info->buffer; /* Nothing in cache */ + } + else + { + info->write_end=(info->buffer + info->buffer_length - + (seek_offset & (IO_SIZE-1))); + info->end_of_file= ~(my_off_t) 0; + } + } + info->type=type; + info->error= info->hard_write_error_in_the_past= 0; + init_functions(info); + +#ifdef HAVE_AIOWAIT + if (use_async_io && ! my_disable_async_io && + ((ulong) info->buffer_length < + (ulong) (info->end_of_file - seek_offset))) + { + info->read_length=info->buffer_length/2; + info->read_function=_my_b_async_read; + } + info->inited=0; +#endif + DBUG_RETURN(0); +} /* reinit_io_cache */ + + +/* FUNCTIONS TO DO READS FROM THE CACHE */ + + +/* + Read buffered. + + SYNOPSIS + _my_b_read() + info IO_CACHE pointer + Buffer Buffer to retrieve count bytes from file + Count Number of bytes to read into Buffer + + NOTE + This function is only called from the my_b_read() macro when there + isn't enough characters in the buffer to satisfy the request. + + WARNING + + When changing this function, be careful with handling file offsets + (end-of_file, pos_in_file). Do not cast them to possibly smaller + types than my_off_t unless you can be sure that their value fits. + Same applies to differences of file offsets. + + When changing this function, check _my_b_read_r(). It might need the + same change. + + RETURN + 0 we succeeded in reading all data + 1 Error: can't read requested characters +*/ + +int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) +{ + size_t length,diff_length,left_length, max_length; + my_off_t pos_in_file; + DBUG_ENTER("_my_b_read"); + + if ((left_length= (size_t) (info->read_end-info->read_pos))) + { + DBUG_ASSERT(Count >= left_length); /* User is not using my_b_read() */ + memcpy(Buffer,info->read_pos, left_length); + Buffer+=left_length; + Count-=left_length; + } + + /* pos_in_file always point on where info->buffer was read */ + pos_in_file=info->pos_in_file+ (size_t) (info->read_end - info->buffer); + + /* + Whenever a function which operates on IO_CACHE flushes/writes + some part of the IO_CACHE to disk it will set the property + "seek_not_done" to indicate this to other functions operating + on the IO_CACHE. + */ + if (info->seek_not_done) + { + if ((my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) + != MY_FILEPOS_ERROR)) + { + /* No error, reset seek_not_done flag. */ + info->seek_not_done= 0; + } + else + { + /* + If the seek failed and the error number is ESPIPE, it is because + info->file is a pipe or socket or FIFO. We never should have tried + to seek on that. See Bugs#25807 and #22828 for more info. + */ + DBUG_ASSERT(my_errno != ESPIPE); + info->error= -1; + DBUG_RETURN(1); + } + } + + diff_length= (size_t) (pos_in_file & (IO_SIZE-1)); + if (Count >= (size_t) (IO_SIZE+(IO_SIZE-diff_length))) + { /* Fill first intern buffer */ + size_t read_length; + if (info->end_of_file <= pos_in_file) + { /* End of file */ + info->error= (int) left_length; + DBUG_RETURN(1); + } + length=(Count & (size_t) ~(IO_SIZE-1))-diff_length; + if ((read_length= my_read(info->file,Buffer, length, info->myflags)) + != length) + { + info->error= (read_length == (size_t) -1 ? -1 : + (int) (read_length+left_length)); + DBUG_RETURN(1); + } + Count-=length; + Buffer+=length; + pos_in_file+=length; + left_length+=length; + diff_length=0; + } + + max_length= info->read_length-diff_length; + if (info->type != READ_FIFO && + max_length > (info->end_of_file - pos_in_file)) + max_length= (size_t) (info->end_of_file - pos_in_file); + if (!max_length) + { + if (Count) + { + info->error= (int) left_length; /* We only got this many char */ + DBUG_RETURN(1); + } + length=0; /* Didn't read any chars */ + } + else if ((length= my_read(info->file,info->buffer, max_length, + info->myflags)) < Count || + length == (size_t) -1) + { + if (length != (size_t) -1) + memcpy(Buffer, info->buffer, length); + info->pos_in_file= pos_in_file; + info->error= length == (size_t) -1 ? -1 : (int) (length+left_length); + info->read_pos=info->read_end=info->buffer; + DBUG_RETURN(1); + } + info->read_pos=info->buffer+Count; + info->read_end=info->buffer+length; + info->pos_in_file=pos_in_file; + memcpy(Buffer, info->buffer, Count); + DBUG_RETURN(0); +} + + +#ifdef THREAD +/* + Prepare IO_CACHE for shared use. + + SYNOPSIS + init_io_cache_share() + read_cache A read cache. This will be copied for + every thread after setup. + cshare The share. + write_cache If non-NULL a write cache that is to be + synchronized with the read caches. + num_threads Number of threads sharing the cache + including the write thread if any. + + DESCRIPTION + + The shared cache is used so: One IO_CACHE is initialized with + init_io_cache(). This includes the allocation of a buffer. Then a + share is allocated and init_io_cache_share() is called with the io + cache and the share. Then the io cache is copied for each thread. So + every thread has its own copy of IO_CACHE. But the allocated buffer + is shared because cache->buffer is the same for all caches. + + One thread reads data from the file into the buffer. All threads + read from the buffer, but every thread maintains its own set of + pointers into the buffer. When all threads have used up the buffer + contents, one of the threads reads the next block of data into the + buffer. To accomplish this, each thread enters the cache lock before + accessing the buffer. They wait in lock_io_cache() until all threads + joined the lock. The last thread entering the lock is in charge of + reading from file to buffer. It wakes all threads when done. + + Synchronizing a write cache to the read caches works so: Whenever + the write buffer needs a flush, the write thread enters the lock and + waits for all other threads to enter the lock too. They do this when + they have used up the read buffer. When all threads are in the lock, + the write thread copies the write buffer to the read buffer and + wakes all threads. + + share->running_threads is the number of threads not being in the + cache lock. When entering lock_io_cache() the number is decreased. + When the thread that fills the buffer enters unlock_io_cache() the + number is reset to the number of threads. The condition + running_threads == 0 means that all threads are in the lock. Bumping + up the number to the full count is non-intuitive. But increasing the + number by one for each thread that leaves the lock could lead to a + solo run of one thread. The last thread to join a lock reads from + file to buffer, wakes the other threads, processes the data in the + cache and enters the lock again. If no other thread left the lock + meanwhile, it would think it's the last one again and read the next + block... + + The share has copies of 'error', 'buffer', 'read_end', and + 'pos_in_file' from the thread that filled the buffer. We may not be + able to access this information directly from its cache because the + thread may be removed from the share before the variables could be + copied by all other threads. Or, if a write buffer is synchronized, + it would change its 'pos_in_file' after waking the other threads, + possibly before they could copy its value. + + However, the 'buffer' variable in the share is for a synchronized + write cache. It needs to know where to put the data. Otherwise it + would need access to the read cache of one of the threads that is + not yet removed from the share. + + RETURN + void +*/ + +void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, + IO_CACHE *write_cache, uint num_threads) +{ + DBUG_ENTER("init_io_cache_share"); + DBUG_PRINT("io_cache_share", ("read_cache: %p share: %p " + "write_cache: %p threads: %u", + read_cache, cshare, + write_cache, num_threads)); + + DBUG_ASSERT(num_threads > 1); + DBUG_ASSERT(read_cache->type == READ_CACHE); + DBUG_ASSERT(!write_cache || (write_cache->type == WRITE_CACHE)); + + pthread_mutex_init(&cshare->mutex, MY_MUTEX_INIT_FAST); + pthread_cond_init(&cshare->cond, 0); + pthread_cond_init(&cshare->cond_writer, 0); + + cshare->running_threads= num_threads; + cshare->total_threads= num_threads; + cshare->error= 0; /* Initialize. */ + cshare->buffer= read_cache->buffer; + cshare->read_end= NULL; /* See function comment of lock_io_cache(). */ + cshare->pos_in_file= 0; /* See function comment of lock_io_cache(). */ + cshare->source_cache= write_cache; /* Can be NULL. */ + + read_cache->share= cshare; + read_cache->read_function= _my_b_read_r; + read_cache->current_pos= NULL; + read_cache->current_end= NULL; + + if (write_cache) + write_cache->share= cshare; + + DBUG_VOID_RETURN; +} + + +/* + Remove a thread from shared access to IO_CACHE. + + SYNOPSIS + remove_io_thread() + cache The IO_CACHE to be removed from the share. + + NOTE + + Every thread must do that on exit for not to deadlock other threads. + + The last thread destroys the pthread resources. + + A writer flushes its cache first. + + RETURN + void +*/ + +void remove_io_thread(IO_CACHE *cache) +{ + IO_CACHE_SHARE *cshare= cache->share; + uint total; + DBUG_ENTER("remove_io_thread"); + + /* If the writer goes, it needs to flush the write cache. */ + if (cache == cshare->source_cache) + flush_io_cache(cache); + + pthread_mutex_lock(&cshare->mutex); + DBUG_PRINT("io_cache_share", ("%s: %p", + (cache == cshare->source_cache) ? + "writer" : "reader", cache)); + + /* Remove from share. */ + total= --cshare->total_threads; + DBUG_PRINT("io_cache_share", ("remaining threads: %u", total)); + + /* Detach from share. */ + cache->share= NULL; + + /* If the writer goes, let the readers know. */ + if (cache == cshare->source_cache) + { + DBUG_PRINT("io_cache_share", ("writer leaves")); + cshare->source_cache= NULL; + } + + /* If all threads are waiting for me to join the lock, wake them. */ + if (!--cshare->running_threads) + { + DBUG_PRINT("io_cache_share", ("the last running thread leaves, wake all")); + pthread_cond_signal(&cshare->cond_writer); + pthread_cond_broadcast(&cshare->cond); + } + + pthread_mutex_unlock(&cshare->mutex); + + if (!total) + { + DBUG_PRINT("io_cache_share", ("last thread removed, destroy share")); + pthread_cond_destroy (&cshare->cond_writer); + pthread_cond_destroy (&cshare->cond); + pthread_mutex_destroy(&cshare->mutex); + } + + DBUG_VOID_RETURN; +} + + +/* + Lock IO cache and wait for all other threads to join. + + SYNOPSIS + lock_io_cache() + cache The cache of the thread entering the lock. + pos File position of the block to read. + Unused for the write thread. + + DESCRIPTION + + Wait for all threads to finish with the current buffer. We want + all threads to proceed in concert. The last thread to join + lock_io_cache() will read the block from file and all threads start + to use it. Then they will join again for reading the next block. + + The waiting threads detect a fresh buffer by comparing + cshare->pos_in_file with the position they want to process next. + Since the first block may start at position 0, we take + cshare->read_end as an additional condition. This variable is + initialized to NULL and will be set after a block of data is written + to the buffer. + + RETURN + 1 OK, lock in place, go ahead and read. + 0 OK, unlocked, another thread did the read. +*/ + +static int lock_io_cache(IO_CACHE *cache, my_off_t pos) +{ + IO_CACHE_SHARE *cshare= cache->share; + DBUG_ENTER("lock_io_cache"); + + /* Enter the lock. */ + pthread_mutex_lock(&cshare->mutex); + cshare->running_threads--; + DBUG_PRINT("io_cache_share", ("%s: %p pos: %lu running: %u", + (cache == cshare->source_cache) ? + "writer" : "reader", cache, (ulong) pos, + cshare->running_threads)); + + if (cshare->source_cache) + { + /* A write cache is synchronized to the read caches. */ + + if (cache == cshare->source_cache) + { + /* The writer waits until all readers are here. */ + while (cshare->running_threads) + { + DBUG_PRINT("io_cache_share", ("writer waits in lock")); + pthread_cond_wait(&cshare->cond_writer, &cshare->mutex); + } + DBUG_PRINT("io_cache_share", ("writer awoke, going to copy")); + + /* Stay locked. Leave the lock later by unlock_io_cache(). */ + DBUG_RETURN(1); + } + + /* The last thread wakes the writer. */ + if (!cshare->running_threads) + { + DBUG_PRINT("io_cache_share", ("waking writer")); + pthread_cond_signal(&cshare->cond_writer); + } + + /* + Readers wait until the data is copied from the writer. Another + reason to stop waiting is the removal of the write thread. If this + happens, we leave the lock with old data in the buffer. + */ + while ((!cshare->read_end || (cshare->pos_in_file < pos)) && + cshare->source_cache) + { + DBUG_PRINT("io_cache_share", ("reader waits in lock")); + pthread_cond_wait(&cshare->cond, &cshare->mutex); + } + + /* + If the writer was removed from the share while this thread was + asleep, we need to simulate an EOF condition. The writer cannot + reset the share variables as they might still be in use by readers + of the last block. When we awake here then because the last + joining thread signalled us. If the writer is not the last, it + will not signal. So it is safe to clear the buffer here. + */ + if (!cshare->read_end || (cshare->pos_in_file < pos)) + { + DBUG_PRINT("io_cache_share", ("reader found writer removed. EOF")); + cshare->read_end= cshare->buffer; /* Empty buffer. */ + cshare->error= 0; /* EOF is not an error. */ + } + } + else + { + /* + There are read caches only. The last thread arriving in + lock_io_cache() continues with a locked cache and reads the block. + */ + if (!cshare->running_threads) + { + DBUG_PRINT("io_cache_share", ("last thread joined, going to read")); + /* Stay locked. Leave the lock later by unlock_io_cache(). */ + DBUG_RETURN(1); + } + + /* + All other threads wait until the requested block is read by the + last thread arriving. Another reason to stop waiting is the + removal of a thread. If this leads to all threads being in the + lock, we have to continue also. The first of the awaken threads + will then do the read. + */ + while ((!cshare->read_end || (cshare->pos_in_file < pos)) && + cshare->running_threads) + { + DBUG_PRINT("io_cache_share", ("reader waits in lock")); + pthread_cond_wait(&cshare->cond, &cshare->mutex); + } + + /* If the block is not yet read, continue with a locked cache and read. */ + if (!cshare->read_end || (cshare->pos_in_file < pos)) + { + DBUG_PRINT("io_cache_share", ("reader awoke, going to read")); + /* Stay locked. Leave the lock later by unlock_io_cache(). */ + DBUG_RETURN(1); + } + + /* Another thread did read the block already. */ + } + DBUG_PRINT("io_cache_share", ("reader awoke, going to process %u bytes", + (uint) (cshare->read_end ? (size_t) + (cshare->read_end - cshare->buffer) : + 0))); + + /* + Leave the lock. Do not call unlock_io_cache() later. The thread that + filled the buffer did this and marked all threads as running. + */ + pthread_mutex_unlock(&cshare->mutex); + DBUG_RETURN(0); +} + + +/* + Unlock IO cache. + + SYNOPSIS + unlock_io_cache() + cache The cache of the thread leaving the lock. + + NOTE + This is called by the thread that filled the buffer. It marks all + threads as running and awakes them. This must not be done by any + other thread. + + Do not signal cond_writer. Either there is no writer or the writer + is the only one who can call this function. + + The reason for resetting running_threads to total_threads before + waking all other threads is that it could be possible that this + thread is so fast with processing the buffer that it enters the lock + before even one other thread has left it. If every awoken thread + would increase running_threads by one, this thread could think that + he is again the last to join and would not wait for the other + threads to process the data. + + RETURN + void +*/ + +static void unlock_io_cache(IO_CACHE *cache) +{ + IO_CACHE_SHARE *cshare= cache->share; + DBUG_ENTER("unlock_io_cache"); + DBUG_PRINT("io_cache_share", ("%s: %p pos: %lu running: %u", + (cache == cshare->source_cache) ? + "writer" : "reader", + cache, (ulong) cshare->pos_in_file, + cshare->total_threads)); + + cshare->running_threads= cshare->total_threads; + pthread_cond_broadcast(&cshare->cond); + pthread_mutex_unlock(&cshare->mutex); + DBUG_VOID_RETURN; +} + + +/* + Read from IO_CACHE when it is shared between several threads. + + SYNOPSIS + _my_b_read_r() + cache IO_CACHE pointer + Buffer Buffer to retrieve count bytes from file + Count Number of bytes to read into Buffer + + NOTE + This function is only called from the my_b_read() macro when there + isn't enough characters in the buffer to satisfy the request. + + IMPLEMENTATION + + It works as follows: when a thread tries to read from a file (that + is, after using all the data from the (shared) buffer), it just + hangs on lock_io_cache(), waiting for other threads. When the very + last thread attempts a read, lock_io_cache() returns 1, the thread + does actual IO and unlock_io_cache(), which signals all the waiting + threads that data is in the buffer. + + WARNING + + When changing this function, be careful with handling file offsets + (end-of_file, pos_in_file). Do not cast them to possibly smaller + types than my_off_t unless you can be sure that their value fits. + Same applies to differences of file offsets. (Bug #11527) + + When changing this function, check _my_b_read(). It might need the + same change. + + RETURN + 0 we succeeded in reading all data + 1 Error: can't read requested characters +*/ + +int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count) +{ + my_off_t pos_in_file; + size_t length, diff_length, left_length; + IO_CACHE_SHARE *cshare= cache->share; + DBUG_ENTER("_my_b_read_r"); + + if ((left_length= (size_t) (cache->read_end - cache->read_pos))) + { + DBUG_ASSERT(Count >= left_length); /* User is not using my_b_read() */ + memcpy(Buffer, cache->read_pos, left_length); + Buffer+= left_length; + Count-= left_length; + } + while (Count) + { + size_t cnt, len; + + pos_in_file= cache->pos_in_file + (cache->read_end - cache->buffer); + diff_length= (size_t) (pos_in_file & (IO_SIZE-1)); + length=IO_ROUND_UP(Count+diff_length)-diff_length; + length= ((length <= cache->read_length) ? + length + IO_ROUND_DN(cache->read_length - length) : + length - IO_ROUND_UP(length - cache->read_length)); + if (cache->type != READ_FIFO && + (length > (cache->end_of_file - pos_in_file))) + length= (size_t) (cache->end_of_file - pos_in_file); + if (length == 0) + { + cache->error= (int) left_length; + DBUG_RETURN(1); + } + if (lock_io_cache(cache, pos_in_file)) + { + /* With a synchronized write/read cache we won't come here... */ + DBUG_ASSERT(!cshare->source_cache); + /* + ... unless the writer has gone before this thread entered the + lock. Simulate EOF in this case. It can be distinguished by + cache->file. + */ + if (cache->file < 0) + len= 0; + else + { + /* + Whenever a function which operates on IO_CACHE flushes/writes + some part of the IO_CACHE to disk it will set the property + "seek_not_done" to indicate this to other functions operating + on the IO_CACHE. + */ + if (cache->seek_not_done) + { + if (my_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0)) + == MY_FILEPOS_ERROR) + { + cache->error= -1; + unlock_io_cache(cache); + DBUG_RETURN(1); + } + } + len= my_read(cache->file, cache->buffer, length, cache->myflags); + } + DBUG_PRINT("io_cache_share", ("read %lu bytes", (ulong) len)); + + cache->read_end= cache->buffer + (len == (size_t) -1 ? 0 : len); + cache->error= (len == length ? 0 : (int) len); + cache->pos_in_file= pos_in_file; + + /* Copy important values to the share. */ + cshare->error= cache->error; + cshare->read_end= cache->read_end; + cshare->pos_in_file= pos_in_file; + + /* Mark all threads as running and wake them. */ + unlock_io_cache(cache); + } + else + { + /* + With a synchronized write/read cache readers always come here. + Copy important values from the share. + */ + cache->error= cshare->error; + cache->read_end= cshare->read_end; + cache->pos_in_file= cshare->pos_in_file; + + len= ((cache->error == -1) ? (size_t) -1 : + (size_t) (cache->read_end - cache->buffer)); + } + cache->read_pos= cache->buffer; + cache->seek_not_done= 0; + if (len == 0 || len == (size_t) -1) + { + DBUG_PRINT("io_cache_share", ("reader error. len %lu left %lu", + (ulong) len, (ulong) left_length)); + cache->error= (int) left_length; + DBUG_RETURN(1); + } + cnt= (len > Count) ? Count : len; + memcpy(Buffer, cache->read_pos, cnt); + Count -= cnt; + Buffer+= cnt; + left_length+= cnt; + cache->read_pos+= cnt; + } + DBUG_RETURN(0); +} + + +/* + Copy data from write cache to read cache. + + SYNOPSIS + copy_to_read_buffer() + write_cache The write cache. + write_buffer The source of data, mostly the cache buffer. + write_length The number of bytes to copy. + + NOTE + The write thread will wait for all read threads to join the cache + lock. Then it copies the data over and wakes the read threads. + + RETURN + void +*/ + +static void copy_to_read_buffer(IO_CACHE *write_cache, + const uchar *write_buffer, size_t write_length) +{ + IO_CACHE_SHARE *cshare= write_cache->share; + + DBUG_ASSERT(cshare->source_cache == write_cache); + /* + write_length is usually less or equal to buffer_length. + It can be bigger if _my_b_write() is called with a big length. + */ + while (write_length) + { + size_t copy_length= min(write_length, write_cache->buffer_length); + int __attribute__((unused)) rc; + + rc= lock_io_cache(write_cache, write_cache->pos_in_file); + /* The writing thread does always have the lock when it awakes. */ + DBUG_ASSERT(rc); + + memcpy(cshare->buffer, write_buffer, copy_length); + + cshare->error= 0; + cshare->read_end= cshare->buffer + copy_length; + cshare->pos_in_file= write_cache->pos_in_file; + + /* Mark all threads as running and wake them. */ + unlock_io_cache(write_cache); + + write_buffer+= copy_length; + write_length-= copy_length; + } +} +#endif /*THREAD*/ + + +/* + Do sequential read from the SEQ_READ_APPEND cache. + + We do this in three stages: + - first read from info->buffer + - then if there are still data to read, try the file descriptor + - afterwards, if there are still data to read, try append buffer + + RETURNS + 0 Success + 1 Failed to read +*/ + +int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count) +{ + size_t length, diff_length, left_length, save_count, max_length; + my_off_t pos_in_file; + save_count=Count; + + /* first, read the regular buffer */ + if ((left_length=(size_t) (info->read_end-info->read_pos))) + { + DBUG_ASSERT(Count > left_length); /* User is not using my_b_read() */ + memcpy(Buffer,info->read_pos, left_length); + Buffer+=left_length; + Count-=left_length; + } + lock_append_buffer(info); + + /* pos_in_file always point on where info->buffer was read */ + if ((pos_in_file=info->pos_in_file + + (size_t) (info->read_end - info->buffer)) >= info->end_of_file) + goto read_append_buffer; + + /* + With read-append cache we must always do a seek before we read, + because the write could have moved the file pointer astray + */ + if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == MY_FILEPOS_ERROR) + { + info->error= -1; + unlock_append_buffer(info); + return (1); + } + info->seek_not_done=0; + + diff_length= (size_t) (pos_in_file & (IO_SIZE-1)); + + /* now the second stage begins - read from file descriptor */ + if (Count >= (size_t) (IO_SIZE+(IO_SIZE-diff_length))) + { + /* Fill first intern buffer */ + size_t read_length; + + length=(Count & (size_t) ~(IO_SIZE-1))-diff_length; + if ((read_length= my_read(info->file,Buffer, length, + info->myflags)) == (size_t) -1) + { + info->error= -1; + unlock_append_buffer(info); + return 1; + } + Count-=read_length; + Buffer+=read_length; + pos_in_file+=read_length; + + if (read_length != length) + { + /* + We only got part of data; Read the rest of the data from the + write buffer + */ + goto read_append_buffer; + } + left_length+=length; + diff_length=0; + } + + max_length= info->read_length-diff_length; + if (max_length > (info->end_of_file - pos_in_file)) + max_length= (size_t) (info->end_of_file - pos_in_file); + if (!max_length) + { + if (Count) + goto read_append_buffer; + length=0; /* Didn't read any more chars */ + } + else + { + length= my_read(info->file,info->buffer, max_length, info->myflags); + if (length == (size_t) -1) + { + info->error= -1; + unlock_append_buffer(info); + return 1; + } + if (length < Count) + { + memcpy(Buffer, info->buffer, length); + Count -= length; + Buffer += length; + + /* + added the line below to make + DBUG_ASSERT(pos_in_file==info->end_of_file) pass. + otherwise this does not appear to be needed + */ + pos_in_file += length; + goto read_append_buffer; + } + } + unlock_append_buffer(info); + info->read_pos=info->buffer+Count; + info->read_end=info->buffer+length; + info->pos_in_file=pos_in_file; + memcpy(Buffer,info->buffer,(size_t) Count); + return 0; + +read_append_buffer: + + /* + Read data from the current write buffer. + Count should never be == 0 here (The code will work even if count is 0) + */ + + { + /* First copy the data to Count */ + size_t len_in_buff = (size_t) (info->write_pos - info->append_read_pos); + size_t copy_len; + size_t transfer_len; + + DBUG_ASSERT(info->append_read_pos <= info->write_pos); + /* + TODO: figure out if the assert below is needed or correct. + */ + DBUG_ASSERT(pos_in_file == info->end_of_file); + copy_len=min(Count, len_in_buff); + memcpy(Buffer, info->append_read_pos, copy_len); + info->append_read_pos += copy_len; + Count -= copy_len; + if (Count) + info->error= (int) (save_count - Count); + + /* Fill read buffer with data from write buffer */ + memcpy(info->buffer, info->append_read_pos, + (size_t) (transfer_len=len_in_buff - copy_len)); + info->read_pos= info->buffer; + info->read_end= info->buffer+transfer_len; + info->append_read_pos=info->write_pos; + info->pos_in_file=pos_in_file+copy_len; + info->end_of_file+=len_in_buff; + } + unlock_append_buffer(info); + return Count ? 1 : 0; +} + + +#ifdef HAVE_AIOWAIT + +/* + Read from the IO_CACHE into a buffer and feed asynchronously + from disk when needed. + + SYNOPSIS + _my_b_async_read() + info IO_CACHE pointer + Buffer Buffer to retrieve count bytes from file + Count Number of bytes to read into Buffer + + RETURN VALUE + -1 An error has occurred; my_errno is set. + 0 Success + 1 An error has occurred; IO_CACHE to error state. +*/ + +int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count) +{ + size_t length,read_length,diff_length,left_length,use_length,org_Count; + size_t max_length; + my_off_t next_pos_in_file; + uchar *read_buffer; + + memcpy(Buffer,info->read_pos, + (left_length= (size_t) (info->read_end-info->read_pos))); + Buffer+=left_length; + org_Count=Count; + Count-=left_length; + + if (info->inited) + { /* wait for read block */ + info->inited=0; /* No more block to read */ + my_aiowait(&info->aio_result); /* Wait for outstanding req */ + if (info->aio_result.result.aio_errno) + { + if (info->myflags & MY_WME) + my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG), + my_filename(info->file), + info->aio_result.result.aio_errno); + my_errno=info->aio_result.result.aio_errno; + info->error= -1; + return(1); + } + if (! (read_length= (size_t) info->aio_result.result.aio_return) || + read_length == (size_t) -1) + { + my_errno=0; /* For testing */ + info->error= (read_length == (size_t) -1 ? -1 : + (int) (read_length+left_length)); + return(1); + } + info->pos_in_file+= (size_t) (info->read_end - info->request_pos); + + if (info->request_pos != info->buffer) + info->request_pos=info->buffer; + else + info->request_pos=info->buffer+info->read_length; + info->read_pos=info->request_pos; + next_pos_in_file=info->aio_read_pos+read_length; + + /* Check if pos_in_file is changed + (_ni_read_cache may have skipped some bytes) */ + + if (info->aio_read_pos < info->pos_in_file) + { /* Fix if skipped bytes */ + if (info->aio_read_pos + read_length < info->pos_in_file) + { + read_length=0; /* Skip block */ + next_pos_in_file=info->pos_in_file; + } + else + { + my_off_t offset= (info->pos_in_file - info->aio_read_pos); + info->pos_in_file=info->aio_read_pos; /* Whe are here */ + info->read_pos=info->request_pos+offset; + read_length-=offset; /* Bytes left from read_pos */ + } + } +#ifndef DBUG_OFF + if (info->aio_read_pos > info->pos_in_file) + { + my_errno=EINVAL; + return(info->read_length= (size_t) -1); + } +#endif + /* Copy found bytes to buffer */ + length=min(Count,read_length); + memcpy(Buffer,info->read_pos,(size_t) length); + Buffer+=length; + Count-=length; + left_length+=length; + info->read_end=info->rc_pos+read_length; + info->read_pos+=length; + } + else + next_pos_in_file=(info->pos_in_file+ (size_t) + (info->read_end - info->request_pos)); + + /* If reading large blocks, or first read or read with skip */ + if (Count) + { + if (next_pos_in_file == info->end_of_file) + { + info->error=(int) (read_length+left_length); + return 1; + } + + if (my_seek(info->file,next_pos_in_file,MY_SEEK_SET,MYF(0)) + == MY_FILEPOS_ERROR) + { + info->error= -1; + return (1); + } + + read_length=IO_SIZE*2- (size_t) (next_pos_in_file & (IO_SIZE-1)); + if (Count < read_length) + { /* Small block, read to cache */ + if ((read_length=my_read(info->file,info->request_pos, + read_length, info->myflags)) == (size_t) -1) + return info->error= -1; + use_length=min(Count,read_length); + memcpy(Buffer,info->request_pos,(size_t) use_length); + info->read_pos=info->request_pos+Count; + info->read_end=info->request_pos+read_length; + info->pos_in_file=next_pos_in_file; /* Start of block in cache */ + next_pos_in_file+=read_length; + + if (Count != use_length) + { /* Didn't find hole block */ + if (info->myflags & (MY_WME | MY_FAE | MY_FNABP) && Count != org_Count) + my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG), + my_filename(info->file),my_errno); + info->error=(int) (read_length+left_length); + return 1; + } + } + else + { /* Big block, don't cache it */ + if ((read_length= my_read(info->file,Buffer, Count,info->myflags)) + != Count) + { + info->error= read_length == (size_t) -1 ? -1 : read_length+left_length; + return 1; + } + info->read_pos=info->read_end=info->request_pos; + info->pos_in_file=(next_pos_in_file+=Count); + } + } + + /* Read next block with asyncronic io */ + diff_length=(next_pos_in_file & (IO_SIZE-1)); + max_length= info->read_length - diff_length; + if (max_length > info->end_of_file - next_pos_in_file) + max_length= (size_t) (info->end_of_file - next_pos_in_file); + + if (info->request_pos != info->buffer) + read_buffer=info->buffer; + else + read_buffer=info->buffer+info->read_length; + info->aio_read_pos=next_pos_in_file; + if (max_length) + { + info->aio_result.result.aio_errno=AIO_INPROGRESS; /* Marker for test */ + DBUG_PRINT("aioread",("filepos: %ld length: %lu", + (ulong) next_pos_in_file, (ulong) max_length)); + if (aioread(info->file,read_buffer, max_length, + (my_off_t) next_pos_in_file,MY_SEEK_SET, + &info->aio_result.result)) + { /* Skip async io */ + my_errno=errno; + DBUG_PRINT("error",("got error: %d, aio_result: %d from aioread, async skipped", + errno, info->aio_result.result.aio_errno)); + if (info->request_pos != info->buffer) + { + bmove(info->buffer,info->request_pos, + (size_t) (info->read_end - info->read_pos)); + info->request_pos=info->buffer; + info->read_pos-=info->read_length; + info->read_end-=info->read_length; + } + info->read_length=info->buffer_length; /* Use hole buffer */ + info->read_function=_my_b_read; /* Use normal IO_READ next */ + } + else + info->inited=info->aio_result.pending=1; + } + return 0; /* Block read, async in use */ +} /* _my_b_async_read */ +#endif + + +/* Read one byte when buffer is empty */ + +int _my_b_get(IO_CACHE *info) +{ + uchar buff; + IO_CACHE_CALLBACK pre_read,post_read; + if ((pre_read = info->pre_read)) + (*pre_read)(info, NULL, 0, 0); + if ((*(info)->read_function)(info,&buff,1)) + return my_b_EOF; + if ((post_read = info->post_read)) + (*post_read)(info, NULL, 0, 0); + return (int) (uchar) buff; +} + +/* FUNCTIONS TO DO WRITES TO THE CACHE */ + +#define set_hard_write_error(CACHE) \ + ((CACHE)->error= (CACHE)->hard_write_error_in_the_past= -1) + +/* + Write a byte buffer to IO_CACHE and flush to disk + if IO_CACHE is full. + + RETURN VALUE + 1 On error on write + 0 On success + -1 On error; my_errno contains error code. +*/ + +int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count) +{ + size_t rest_length,length; + + if (info->pos_in_file+info->buffer_length > info->end_of_file) + { + my_errno=errno=EFBIG; + return set_hard_write_error(info); + } + + rest_length= (size_t) (info->write_end - info->write_pos); + memcpy(info->write_pos,Buffer,(size_t) rest_length); + Buffer+=rest_length; + Count-=rest_length; + info->write_pos+=rest_length; + + if (my_b_flush_io_cache(info,1)) + return 1; + if (Count >= IO_SIZE) + { /* Fill first intern buffer */ + length=Count & (size_t) ~(IO_SIZE-1); + if (info->seek_not_done) + { + /* + Whenever a function which operates on IO_CACHE flushes/writes + some part of the IO_CACHE to disk it will set the property + "seek_not_done" to indicate this to other functions operating + on the IO_CACHE. + */ + if (my_seek(info->file,info->pos_in_file,MY_SEEK_SET,MYF(0))) + { + set_hard_write_error(info); + return (1); + } + info->seek_not_done=0; + } + if (my_write(info->file, Buffer, length, info->myflags | MY_NABP)) + return set_hard_write_error(info); + if (info->post_write) + (*(info->post_write))(info, Buffer, length, info->pos_in_file); + +#ifdef THREAD + /* + In case of a shared I/O cache with a writer we normally do direct + write cache to read cache copy. Simulate this here by direct + caller buffer to read cache copy. Do it after the write so that + the cache readers actions on the flushed part can go in parallel + with the write of the extra stuff. copy_to_read_buffer() + synchronizes writer and readers so that after this call the + readers can act on the extra stuff while the writer can go ahead + and prepare the next output. copy_to_read_buffer() relies on + info->pos_in_file. + */ + if (info->share) + copy_to_read_buffer(info, Buffer, length); +#endif + + Count-=length; + Buffer+=length; + info->pos_in_file+=length; + } + memcpy(info->write_pos,Buffer,(size_t) Count); + info->write_pos+=Count; + return 0; +} + + +/* + Append a block to the write buffer. + This is done with the buffer locked to ensure that we don't read from + the write buffer before we are ready with it. +*/ + +int my_b_append(register IO_CACHE *info, const uchar *Buffer, size_t Count) +{ + size_t rest_length,length; + +#ifdef THREAD + /* + Assert that we cannot come here with a shared cache. If we do one + day, we might need to add a call to copy_to_read_buffer(). + */ + DBUG_ASSERT(!info->share); +#endif + DBUG_ASSERT(info->post_write == NULL); /* unsupported */ + lock_append_buffer(info); + rest_length= (size_t) (info->write_end - info->write_pos); + if (Count <= rest_length) + goto end; + memcpy(info->write_pos, Buffer, rest_length); + Buffer+=rest_length; + Count-=rest_length; + info->write_pos+=rest_length; + if (my_b_flush_io_cache(info,0)) + { + unlock_append_buffer(info); + return 1; + } + if (Count >= IO_SIZE) + { /* Fill first intern buffer */ + length=Count & (size_t) ~(IO_SIZE-1); + if (my_write(info->file,Buffer, length, info->myflags | MY_NABP)) + { + unlock_append_buffer(info); + return set_hard_write_error(info); + } + Count-=length; + Buffer+=length; + info->end_of_file+=length; + } + +end: + memcpy(info->write_pos,Buffer,(size_t) Count); + info->write_pos+=Count; + unlock_append_buffer(info); + return 0; +} + + +int my_b_safe_write(IO_CACHE *info, const uchar *Buffer, size_t Count) +{ + /* + Sasha: We are not writing this with the ? operator to avoid hitting + a possible compiler bug. At least gcc 2.95 cannot deal with + several layers of ternary operators that evaluated comma(,) operator + expressions inside - I do have a test case if somebody wants it + */ + if (info->type == SEQ_READ_APPEND) + return my_b_append(info, Buffer, Count); + return my_b_write(info, Buffer, Count); +} + + +/* + Write a block to disk where part of the data may be inside the record + buffer. As all write calls to the data goes through the cache, + we will never get a seek over the end of the buffer +*/ + +int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count, + my_off_t pos) +{ + size_t length; + int error=0; + +#ifdef THREAD + /* + Assert that we cannot come here with a shared cache. If we do one + day, we might need to add a call to copy_to_read_buffer(). + */ + DBUG_ASSERT(!info->share); +#endif + + if (pos < info->pos_in_file) + { + /* Of no overlap, write everything without buffering */ + if (pos + Count <= info->pos_in_file) + { + int ret= my_pwrite(info->file, Buffer, Count, pos, + info->myflags | MY_NABP); + if (unlikely(ret)) + set_hard_write_error(info); + if (info->post_write) + (*(info->post_write))(info, Buffer, Count, pos); + return ret; + } + /* Write the part of the block that is before buffer */ + length= (uint) (info->pos_in_file - pos); + if (my_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP)) + error= set_hard_write_error(info); + if (info->post_write) + (*(info->post_write))(info, Buffer, length, pos); + Buffer+=length; + pos+= length; + Count-= length; +#ifndef HAVE_PREAD + info->seek_not_done=1; +#endif + } + + /* Check if we want to write inside the used part of the buffer.*/ + length= (size_t) (info->write_end - info->buffer); + if (pos < info->pos_in_file + length) + { + size_t offset= (size_t) (pos - info->pos_in_file); + length-=offset; + if (length > Count) + length=Count; + memcpy(info->buffer+offset, Buffer, length); + Buffer+=length; + Count-= length; + /* Fix length of buffer if the new data was larger */ + if (info->buffer+length > info->write_pos) + info->write_pos=info->buffer+length; + if (!Count) + return (error); + } + /* Write at the end of the current buffer; This is the normal case */ + if (_my_b_write(info, Buffer, Count)) + error= -1; + return error; +} + + + /* Flush write cache */ + +#ifdef THREAD +#define LOCK_APPEND_BUFFER if (need_append_buffer_lock) \ + lock_append_buffer(info); +#define UNLOCK_APPEND_BUFFER if (need_append_buffer_lock) \ + unlock_append_buffer(info); +#else +#define LOCK_APPEND_BUFFER +#define UNLOCK_APPEND_BUFFER +#endif + + +int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock) +{ + size_t length; + my_bool append_cache; + my_off_t pos_in_file; + DBUG_ENTER("my_b_flush_io_cache"); + DBUG_PRINT("enter", ("cache: 0x%lx", (long) info)); + + if (!(append_cache = (info->type == SEQ_READ_APPEND))) + need_append_buffer_lock=0; + + if (info->type == WRITE_CACHE || append_cache) + { + if (info->file == -1) + { + if (real_open_cached_file(info)) + DBUG_RETURN(set_hard_write_error(info)); + } + LOCK_APPEND_BUFFER; + + if ((length=(size_t) (info->write_pos - info->write_buffer))) + { +#ifdef THREAD + /* + In case of a shared I/O cache with a writer we do direct write + cache to read cache copy. Do it before the write here so that + the readers can work in parallel with the write. + copy_to_read_buffer() relies on info->pos_in_file. + */ + if (info->share) + copy_to_read_buffer(info, info->write_buffer, length); +#endif + + pos_in_file=info->pos_in_file; + /* + If we have append cache, we always open the file with + O_APPEND which moves the pos to EOF automatically on every write + */ + if (!append_cache && info->seek_not_done) + { /* File touched, do seek */ + if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == + MY_FILEPOS_ERROR) + { + UNLOCK_APPEND_BUFFER; + DBUG_RETURN(set_hard_write_error(info)); + } + if (!append_cache) + info->seek_not_done=0; + } + info->write_end= (info->write_buffer+info->buffer_length- + ((pos_in_file+length) & (IO_SIZE-1))); + + if (my_write(info->file,info->write_buffer,length, + info->myflags | MY_NABP)) + set_hard_write_error(info); + else + info->error= 0; + if (!append_cache) + { + /* + This post_write is really POST-write; callers depend on this! So + always call it after writing to the file, not before. + */ + if (info->post_write) + (*(info->post_write))(info, info->write_buffer, + length, info->pos_in_file); + /* + The addition below will make the info->pos_in_file be the end of + written block; whereas the value we needed in post_write is the + value before the addition. That's why we called post_write before + this. + */ + info->pos_in_file+=length; + set_if_bigger(info->end_of_file,(pos_in_file+length)); + } + else + { + info->end_of_file+=(info->write_pos-info->append_read_pos); + DBUG_ASSERT(info->end_of_file == my_tell(info->file,MYF(0))); + DBUG_ASSERT(info->post_write == NULL); /* unsupported */ + } + + info->append_read_pos=info->write_pos=info->write_buffer; + ++info->disk_writes; + UNLOCK_APPEND_BUFFER; + DBUG_RETURN(info->error); + } + } +#ifdef HAVE_AIOWAIT + else if (info->type != READ_NET) + { + my_aiowait(&info->aio_result); /* Wait for outstanding req */ + info->inited=0; + } +#endif + UNLOCK_APPEND_BUFFER; + DBUG_RETURN(0); +} + +/* + Free an IO_CACHE object + + SYNOPSOS + end_io_cache() + info IO_CACHE Handle to free + + NOTES + It's currently safe to call this if one has called init_io_cache() + on the 'info' object, even if init_io_cache() failed. + This function is also safe to call twice with the same handle. + + RETURN + 0 ok + # Error +*/ + +int end_io_cache(IO_CACHE *info) +{ + int error=0; + IO_CACHE_CALLBACK pre_close; + DBUG_ENTER("end_io_cache"); + DBUG_PRINT("enter",("cache: %p", info)); + +#ifdef THREAD + /* + Every thread must call remove_io_thread(). The last one destroys + the share elements. + */ + DBUG_ASSERT(!info->share || !info->share->total_threads); +#endif + + if ((pre_close=info->pre_close)) + { + (*pre_close)(info, NULL, 0, 0); + info->pre_close= 0; + } + if (info->alloced_buffer) + { + info->alloced_buffer=0; + if (info->file != -1) /* File doesn't exist */ + error= my_b_flush_io_cache(info,1); + my_free((uchar*) info->buffer,MYF(MY_WME)); + info->buffer=info->read_pos=(uchar*) 0; + } + if (info->type == SEQ_READ_APPEND) + { + /* Destroy allocated mutex */ + info->type= TYPE_NOT_SET; +#ifdef THREAD + pthread_mutex_destroy(&info->append_buffer_lock); +#endif + } +#ifdef THREAD + info->share= 0; +#endif + DBUG_RETURN(error); +} /* end_io_cache */ + + +/********************************************************************** + Testing of MF_IOCACHE +**********************************************************************/ + +#ifdef MAIN + +#include + +void die(const char* fmt, ...) +{ + va_list va_args; + va_start(va_args,fmt); + fprintf(stderr,"Error:"); + vfprintf(stderr, fmt,va_args); + fprintf(stderr,", errno=%d\n", errno); + exit(1); +} + +int open_file(const char* fname, IO_CACHE* info, int cache_size) +{ + int fd; + if ((fd=my_open(fname,O_CREAT | O_RDWR,MYF(MY_WME))) < 0) + die("Could not open %s", fname); + if (init_io_cache(info, fd, cache_size, SEQ_READ_APPEND, 0,0,MYF(MY_WME))) + die("failed in init_io_cache()"); + return fd; +} + +void close_file(IO_CACHE* info) +{ + end_io_cache(info); + my_close(info->file, MYF(MY_WME)); +} + +int main(int argc, char** argv) +{ + IO_CACHE sra_cache; /* SEQ_READ_APPEND */ + MY_STAT status; + const char* fname="/tmp/iocache.test"; + int cache_size=16384; + char llstr_buf[22]; + int max_block,total_bytes=0; + int i,num_loops=100,error=0; + char *p; + char* block, *block_end; + MY_INIT(argv[0]); + max_block = cache_size*3; + if (!(block=(char*)my_malloc(max_block,MYF(MY_WME)))) + die("Not enough memory to allocate test block"); + block_end = block + max_block; + for (p = block,i=0; p < block_end;i++) + { + *p++ = (char)i; + } + if (my_stat(fname,&status, MYF(0)) && + my_delete(fname,MYF(MY_WME))) + { + die("Delete of %s failed, aborting", fname); + } + open_file(fname,&sra_cache, cache_size); + for (i = 0; i < num_loops; i++) + { + char buf[4]; + int block_size = abs(rand() % max_block); + int4store(buf, block_size); + if (my_b_append(&sra_cache,buf,4) || + my_b_append(&sra_cache, block, block_size)) + die("write failed"); + total_bytes += 4+block_size; + } + close_file(&sra_cache); + my_free(block,MYF(MY_WME)); + if (!my_stat(fname,&status,MYF(MY_WME))) + die("%s failed to stat, but I had just closed it,\ + wonder how that happened"); + printf("Final size of %s is %s, wrote %d bytes\n",fname, + llstr(status.st_size,llstr_buf), + total_bytes); + my_delete(fname, MYF(MY_WME)); + /* check correctness of tests */ + if (total_bytes != status.st_size) + { + fprintf(stderr,"Not the same number of bytes acutally in file as bytes \ +supposedly written\n"); + error=1; + } + exit(error); + return 0; +} +#endif diff --git a/externals/mysql/mysys/mf_iocache2.c b/externals/mysql/mysys/mf_iocache2.c new file mode 100644 index 00000000000..38415f3909c --- /dev/null +++ b/externals/mysql/mysys/mf_iocache2.c @@ -0,0 +1,466 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + More functions to be used with IO_CACHE files +*/ + +#define MAP_TO_USE_RAID +#include "mysys_priv.h" +#include +#include +#include + +/* + Copy contents of an IO_CACHE to a file. + + SYNOPSIS + my_b_copy_to_file() + cache IO_CACHE to copy from + file File to copy to + + DESCRIPTION + Copy the contents of the cache to the file. The cache will be + re-inited to a read cache and will read from the beginning of the + cache. + + If a failure to write fully occurs, the cache is only copied + partially. + + TODO + Make this function solid by handling partial reads from the cache + in a correct manner: it should be atomic. + + RETURN VALUE + 0 All OK + 1 An error occured +*/ +int +my_b_copy_to_file(IO_CACHE *cache, FILE *file) +{ + size_t bytes_in_cache; + DBUG_ENTER("my_b_copy_to_file"); + + /* Reinit the cache to read from the beginning of the cache */ + if (reinit_io_cache(cache, READ_CACHE, 0L, FALSE, FALSE)) + DBUG_RETURN(1); + bytes_in_cache= my_b_bytes_in_cache(cache); + do + { + if (my_fwrite(file, cache->read_pos, bytes_in_cache, + MYF(MY_WME | MY_NABP)) == (size_t) -1) + DBUG_RETURN(1); + cache->read_pos= cache->read_end; + } while ((bytes_in_cache= my_b_fill(cache))); + DBUG_RETURN(0); +} + + +my_off_t my_b_append_tell(IO_CACHE* info) +{ + /* + Prevent optimizer from putting res in a register when debugging + we need this to be able to see the value of res when the assert fails + */ + dbug_volatile my_off_t res; + + /* + We need to lock the append buffer mutex to keep flush_io_cache() + from messing with the variables that we need in order to provide the + answer to the question. + */ +#ifdef THREAD + pthread_mutex_lock(&info->append_buffer_lock); +#endif +#ifndef DBUG_OFF + /* + Make sure EOF is where we think it is. Note that we cannot just use + my_tell() because we have a reader thread that could have left the + file offset in a non-EOF location + */ + { + volatile my_off_t save_pos; + save_pos = my_tell(info->file,MYF(0)); + my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0)); + /* + Save the value of my_tell in res so we can see it when studying coredump + */ + DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer) + == (res=my_tell(info->file,MYF(0)))); + my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0)); + } +#endif + res = info->end_of_file + (info->write_pos-info->append_read_pos); +#ifdef THREAD + pthread_mutex_unlock(&info->append_buffer_lock); +#endif + return res; +} + +my_off_t my_b_safe_tell(IO_CACHE *info) +{ + if (unlikely(info->type == SEQ_READ_APPEND)) + return my_b_append_tell(info); + return my_b_tell(info); +} + +/* + Make next read happen at the given position + For write cache, make next write happen at the given position +*/ + +void my_b_seek(IO_CACHE *info,my_off_t pos) +{ + my_off_t offset; + DBUG_ENTER("my_b_seek"); + DBUG_PRINT("enter",("pos: %lu", (ulong) pos)); + + /* + TODO: + Verify that it is OK to do seek in the non-append + area in SEQ_READ_APPEND cache + a) see if this always works + b) see if there is a better way to make it work + */ + if (info->type == SEQ_READ_APPEND) + (void) flush_io_cache(info); + + offset=(pos - info->pos_in_file); + + if (info->type == READ_CACHE || info->type == SEQ_READ_APPEND) + { + /* TODO: explain why this works if pos < info->pos_in_file */ + if ((ulonglong) offset < (ulonglong) (info->read_end - info->buffer)) + { + /* The read is in the current buffer; Reuse it */ + info->read_pos = info->buffer + offset; + DBUG_VOID_RETURN; + } + else + { + /* Force a new read on next my_b_read */ + info->read_pos=info->read_end=info->buffer; + } + } + else if (info->type == WRITE_CACHE) + { + /* If write is in current buffer, reuse it */ + if ((ulonglong) offset < + (ulonglong) (info->write_end - info->write_buffer)) + { + info->write_pos = info->write_buffer + offset; + DBUG_VOID_RETURN; + } + (void) flush_io_cache(info); + /* Correct buffer end so that we write in increments of IO_SIZE */ + info->write_end=(info->write_buffer+info->buffer_length- + (pos & (IO_SIZE-1))); + } + info->pos_in_file=pos; + info->seek_not_done=1; + DBUG_VOID_RETURN; +} + + +/* + Fill buffer of the cache. + + NOTES + This assumes that you have already used all characters in the CACHE, + independent of the read_pos value! + + RETURN + 0 On error or EOF (info->error = -1 on error) + # Number of characters +*/ + + +size_t my_b_fill(IO_CACHE *info) +{ + my_off_t pos_in_file=(info->pos_in_file+ + (size_t) (info->read_end - info->buffer)); + size_t diff_length, length, max_length; + + if (info->seek_not_done) + { /* File touched, do seek */ + if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == + MY_FILEPOS_ERROR) + { + info->error= 0; + return 0; + } + info->seek_not_done=0; + } + diff_length=(size_t) (pos_in_file & (IO_SIZE-1)); + max_length=(info->read_length-diff_length); + if (max_length >= (info->end_of_file - pos_in_file)) + max_length= (size_t) (info->end_of_file - pos_in_file); + + if (!max_length) + { + info->error= 0; + return 0; /* EOF */ + } + if ((length= my_read(info->file,info->buffer,max_length, + info->myflags)) == (size_t) -1) + { + info->error= -1; + return 0; + } + info->read_pos=info->buffer; + info->read_end=info->buffer+length; + info->pos_in_file=pos_in_file; + return length; +} + + +/* + Read a string ended by '\n' into a buffer of 'max_length' size. + Returns number of characters read, 0 on error. + last byte is set to '\0' + If buffer is full then to[max_length-1] will be set to \0. +*/ + +size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length) +{ + char *start = to; + size_t length; + max_length--; /* Save place for end \0 */ + + /* Calculate number of characters in buffer */ + if (!(length= my_b_bytes_in_cache(info)) && + !(length= my_b_fill(info))) + return 0; + + for (;;) + { + uchar *pos, *end; + if (length > max_length) + length=max_length; + for (pos=info->read_pos,end=pos+length ; pos < end ;) + { + if ((*to++ = *pos++) == '\n') + { + info->read_pos=pos; + *to='\0'; + return (size_t) (to-start); + } + } + if (!(max_length-=length)) + { + /* Found enough charcters; Return found string */ + info->read_pos=pos; + *to='\0'; + return (size_t) (to-start); + } + if (!(length=my_b_fill(info))) + return 0; + } +} + + +my_off_t my_b_filelength(IO_CACHE *info) +{ + if (info->type == WRITE_CACHE) + return my_b_tell(info); + + info->seek_not_done= 1; + return my_seek(info->file, 0L, MY_SEEK_END, MYF(0)); +} + + +/* + Simple printf version. Supports '%s', '%d', '%u', "%ld" and "%lu" + Used for logging in MySQL + returns number of written character, or (size_t) -1 on error +*/ + +size_t my_b_printf(IO_CACHE *info, const char* fmt, ...) +{ + size_t result; + va_list args; + va_start(args,fmt); + result=my_b_vprintf(info, fmt, args); + va_end(args); + return result; +} + + +size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) +{ + size_t out_length= 0; + uint minimum_width; /* as yet unimplemented */ + uint minimum_width_sign; + uint precision; /* as yet unimplemented for anything but %b */ + my_bool is_zero_padded; + + /* + Store the location of the beginning of a format directive, for the + case where we learn we shouldn't have been parsing a format string + at all, and we don't want to lose the flag/precision/width/size + information. + */ + const char* backtrack; + + for (; *fmt != '\0'; fmt++) + { + /* Copy everything until '%' or end of string */ + const char *start=fmt; + size_t length; + + for (; (*fmt != '\0') && (*fmt != '%'); fmt++) ; + + length= (size_t) (fmt - start); + out_length+=length; + if (my_b_write(info, (const uchar*) start, length)) + goto err; + + if (*fmt == '\0') /* End of format */ + return out_length; + + /* + By this point, *fmt must be a percent; Keep track of this location and + skip over the percent character. + */ + DBUG_ASSERT(*fmt == '%'); + backtrack= fmt; + fmt++; + + is_zero_padded= FALSE; + minimum_width_sign= 1; + minimum_width= 0; + precision= 0; + /* Skip if max size is used (to be compatible with printf) */ + +process_flags: + switch (*fmt) + { + case '-': + minimum_width_sign= -1; fmt++; goto process_flags; + case '0': + is_zero_padded= TRUE; fmt++; goto process_flags; + case '#': + /** @todo Implement "#" conversion flag. */ fmt++; goto process_flags; + case ' ': + /** @todo Implement " " conversion flag. */ fmt++; goto process_flags; + case '+': + /** @todo Implement "+" conversion flag. */ fmt++; goto process_flags; + } + + if (*fmt == '*') + { + precision= (int) va_arg(args, int); + fmt++; + } + else + { + while (my_isdigit(&my_charset_latin1, *fmt)) { + minimum_width=(minimum_width * 10) + (*fmt - '0'); + fmt++; + } + } + minimum_width*= minimum_width_sign; + + if (*fmt == '.') + { + fmt++; + if (*fmt == '*') { + precision= (int) va_arg(args, int); + fmt++; + } + else + { + while (my_isdigit(&my_charset_latin1, *fmt)) { + precision=(precision * 10) + (*fmt - '0'); + fmt++; + } + } + } + + if (*fmt == 's') /* String parameter */ + { + reg2 char *par = va_arg(args, char *); + size_t length2 = strlen(par); + /* TODO: implement precision */ + out_length+= length2; + if (my_b_write(info, (uchar*) par, length2)) + goto err; + } + else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */ + { + char *par = va_arg(args, char *); + out_length+= precision; + if (my_b_write(info, (uchar*) par, precision)) + goto err; + } + else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ + { + register int iarg; + size_t length2; + char buff[17]; + + iarg = va_arg(args, int); + if (*fmt == 'd') + length2= (size_t) (int10_to_str((long) iarg,buff, -10) - buff); + else + length2= (uint) (int10_to_str((long) (uint) iarg,buff,10)- buff); + + /* minimum width padding */ + if (minimum_width > length2) + { + uchar *buffz; + + buffz= (uchar*) my_alloca(minimum_width - length2); + if (is_zero_padded) + memset(buffz, '0', minimum_width - length2); + else + memset(buffz, ' ', minimum_width - length2); + my_b_write(info, buffz, minimum_width - length2); + my_afree(buffz); + } + + out_length+= length2; + if (my_b_write(info, (uchar*) buff, length2)) + goto err; + } + else if ((*fmt == 'l' && fmt[1] == 'd') || fmt[1] == 'u') + /* long parameter */ + { + register long iarg; + size_t length2; + char buff[17]; + + iarg = va_arg(args, long); + if (*++fmt == 'd') + length2= (size_t) (int10_to_str(iarg,buff, -10) - buff); + else + length2= (size_t) (int10_to_str(iarg,buff,10)- buff); + out_length+= length2; + if (my_b_write(info, (uchar*) buff, length2)) + goto err; + } + else + { + /* %% or unknown code */ + if (my_b_write(info, (uchar*) backtrack, (size_t) (fmt-backtrack))) + goto err; + out_length+= fmt-backtrack; + } + } + return out_length; + +err: + return (size_t) -1; +} diff --git a/externals/mysql/mysys/mf_keycache.c b/externals/mysql/mysys/mf_keycache.c new file mode 100644 index 00000000000..aca47f564cf --- /dev/null +++ b/externals/mysql/mysys/mf_keycache.c @@ -0,0 +1,4580 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file + These functions handle keyblock cacheing for ISAM and MyISAM tables. + + One cache can handle many files. + It must contain buffers of the same blocksize. + init_key_cache() should be used to init cache handler. + + The free list (free_block_list) is a stack like structure. + When a block is freed by free_block(), it is pushed onto the stack. + When a new block is required it is first tried to pop one from the stack. + If the stack is empty, it is tried to get a never-used block from the pool. + If this is empty too, then a block is taken from the LRU ring, flushing it + to disk, if neccessary. This is handled in find_key_block(). + With the new free list, the blocks can have three temperatures: + hot, warm and cold (which is free). This is remembered in the block header + by the enum BLOCK_TEMPERATURE temperature variable. Remembering the + temperature is neccessary to correctly count the number of warm blocks, + which is required to decide when blocks are allowed to become hot. Whenever + a block is inserted to another (sub-)chain, we take the old and new + temperature into account to decide if we got one more or less warm block. + blocks_unused is the sum of never used blocks in the pool and of currently + free blocks. blocks_used is the number of blocks fetched from the pool and + as such gives the maximum number of in-use blocks at any time. +*/ + +/* + Key Cache Locking + ================= + + All key cache locking is done with a single mutex per key cache: + keycache->cache_lock. This mutex is locked almost all the time + when executing code in this file (mf_keycache.c). + However it is released for I/O and some copy operations. + + The cache_lock is also released when waiting for some event. Waiting + and signalling is done via condition variables. In most cases the + thread waits on its thread->suspend condition variable. Every thread + has a my_thread_var structure, which contains this variable and a + '*next' and '**prev' pointer. These pointers are used to insert the + thread into a wait queue. + + A thread can wait for one block and thus be in one wait queue at a + time only. + + Before starting to wait on its condition variable with + pthread_cond_wait(), the thread enters itself to a specific wait queue + with link_into_queue() (double linked with '*next' + '**prev') or + wait_on_queue() (single linked with '*next'). + + Another thread, when releasing a resource, looks up the waiting thread + in the related wait queue. It sends a signal with + pthread_cond_signal() to the waiting thread. + + NOTE: Depending on the particular wait situation, either the sending + thread removes the waiting thread from the wait queue with + unlink_from_queue() or release_whole_queue() respectively, or the waiting + thread removes itself. + + There is one exception from this locking scheme when one thread wants + to reuse a block for some other address. This works by first marking + the block reserved (status= BLOCK_IN_SWITCH) and then waiting for all + threads that are reading the block to finish. Each block has a + reference to a condition variable (condvar). It holds a reference to + the thread->suspend condition variable for the waiting thread (if such + a thread exists). When that thread is signaled, the reference is + cleared. The number of readers of a block is registered in + block->hash_link->requests. See wait_for_readers() / remove_reader() + for details. This is similar to the above, but it clearly means that + only one thread can wait for a particular block. There is no queue in + this case. Strangely enough block->convar is used for waiting for the + assigned hash_link only. More precisely it is used to wait for all + requests to be unregistered from the assigned hash_link. + + The resize_queue serves two purposes: + 1. Threads that want to do a resize wait there if in_resize is set. + This is not used in the server. The server refuses a second resize + request if one is already active. keycache->in_init is used for the + synchronization. See set_var.cc. + 2. Threads that want to access blocks during resize wait here during + the re-initialization phase. + When the resize is done, all threads on the queue are signalled. + Hypothetical resizers can compete for resizing, and read/write + requests will restart to request blocks from the freshly resized + cache. If the cache has been resized too small, it is disabled and + 'can_be_used' is false. In this case read/write requests bypass the + cache. Since they increment and decrement 'cnt_for_resize_op', the + next resizer can wait on the queue 'waiting_for_resize_cnt' until all + I/O finished. +*/ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include "my_static.h" +#include +#include +#include +#include + +/* + Some compilation flags have been added specifically for this module + to control the following: + - not to let a thread to yield the control when reading directly + from key cache, which might improve performance in many cases; + to enable this add: + #define SERIALIZED_READ_FROM_CACHE + - to set an upper bound for number of threads simultaneously + using the key cache; this setting helps to determine an optimal + size for hash table and improve performance when the number of + blocks in the key cache much less than the number of threads + accessing it; + to set this number equal to add + #define MAX_THREADS + - to substitute calls of pthread_cond_wait for calls of + pthread_cond_timedwait (wait with timeout set up); + this setting should be used only when you want to trap a deadlock + situation, which theoretically should not happen; + to set timeout equal to seconds add + #define KEYCACHE_TIMEOUT + - to enable the module traps and to send debug information from + key cache module to a special debug log add: + #define KEYCACHE_DEBUG + the name of this debug log file can be set through: + #define KEYCACHE_DEBUG_LOG + if the name is not defined, it's set by default; + if the KEYCACHE_DEBUG flag is not set up and we are in a debug + mode, i.e. when ! defined(DBUG_OFF), the debug information from the + module is sent to the regular debug log. + + Example of the settings: + #define SERIALIZED_READ_FROM_CACHE + #define MAX_THREADS 100 + #define KEYCACHE_TIMEOUT 1 + #define KEYCACHE_DEBUG + #define KEYCACHE_DEBUG_LOG "my_key_cache_debug.log" +*/ + +#define STRUCT_PTR(TYPE, MEMBER, a) \ + (TYPE *) ((char *) (a) - offsetof(TYPE, MEMBER)) + +/* types of condition variables */ +#define COND_FOR_REQUESTED 0 +#define COND_FOR_SAVED 1 +#define COND_FOR_READERS 2 + +typedef pthread_cond_t KEYCACHE_CONDVAR; + +/* descriptor of the page in the key cache block buffer */ +struct st_keycache_page +{ + int file; /* file to which the page belongs to */ + my_off_t filepos; /* position of the page in the file */ +}; + +/* element in the chain of a hash table bucket */ +struct st_hash_link +{ + struct st_hash_link *next, **prev; /* to connect links in the same bucket */ + struct st_block_link *block; /* reference to the block for the page: */ + File file; /* from such a file */ + my_off_t diskpos; /* with such an offset */ + uint requests; /* number of requests for the page */ +}; + +/* simple states of a block */ +#define BLOCK_ERROR 1 /* an error occured when performing file i/o */ +#define BLOCK_READ 2 /* file block is in the block buffer */ +#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */ +#define BLOCK_REASSIGNED 8 /* blk does not accept requests for old page */ +#define BLOCK_IN_FLUSH 16 /* block is selected for flush */ +#define BLOCK_CHANGED 32 /* block buffer contains a dirty page */ +#define BLOCK_IN_USE 64 /* block is not free */ +#define BLOCK_IN_EVICTION 128 /* block is selected for eviction */ +#define BLOCK_IN_FLUSHWRITE 256 /* block is in write to file */ +#define BLOCK_FOR_UPDATE 512 /* block is selected for buffer modification */ + +/* page status, returned by find_key_block */ +#define PAGE_READ 0 +#define PAGE_TO_BE_READ 1 +#define PAGE_WAIT_TO_BE_READ 2 + +/* block temperature determines in which (sub-)chain the block currently is */ +enum BLOCK_TEMPERATURE { BLOCK_COLD /*free*/ , BLOCK_WARM , BLOCK_HOT }; + +/* key cache block */ +struct st_block_link +{ + struct st_block_link + *next_used, **prev_used; /* to connect links in the LRU chain (ring) */ + struct st_block_link + *next_changed, **prev_changed; /* for lists of file dirty/clean blocks */ + struct st_hash_link *hash_link; /* backward ptr to referring hash_link */ + KEYCACHE_WQUEUE wqueue[2]; /* queues on waiting requests for new/old pages */ + uint requests; /* number of requests for the block */ + uchar *buffer; /* buffer for the block page */ + uint offset; /* beginning of modified data in the buffer */ + uint length; /* end of data in the buffer */ + uint status; /* state of the block */ + enum BLOCK_TEMPERATURE temperature; /* block temperature: cold, warm, hot */ + uint hits_left; /* number of hits left until promotion */ + ulonglong last_hit_time; /* timestamp of the last hit */ + KEYCACHE_CONDVAR *condvar; /* condition variable for 'no readers' event */ + void *post_write_arg; /**< post_write's argument*/ +}; + +KEY_CACHE dflt_key_cache_var; +KEY_CACHE *dflt_key_cache= &dflt_key_cache_var; + +#define FLUSH_CACHE 2000 /* sort this many blocks at once */ + +static int flush_all_key_blocks(KEY_CACHE *keycache); +#ifdef THREAD +static void wait_on_queue(KEYCACHE_WQUEUE *wqueue, + pthread_mutex_t *mutex); +static void release_whole_queue(KEYCACHE_WQUEUE *wqueue); +#else +#define wait_on_queue(wqueue, mutex) do {} while (0) +#define release_whole_queue(wqueue) do {} while (0) +#endif +static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block); +#if !defined(DBUG_OFF) +static void test_key_cache(KEY_CACHE *keycache, + const char *where, my_bool lock); +#endif + +#define KEYCACHE_HASH(f, pos) \ +(((ulong) ((pos) / keycache->key_cache_block_size) + \ + (ulong) (f)) & (keycache->hash_entries-1)) +#define FILE_HASH(f) ((uint) (f) & (CHANGED_BLOCKS_HASH-1)) + +#define DEFAULT_KEYCACHE_DEBUG_LOG "keycache_debug.log" + +#if defined(KEYCACHE_DEBUG) && ! defined(KEYCACHE_DEBUG_LOG) +#define KEYCACHE_DEBUG_LOG DEFAULT_KEYCACHE_DEBUG_LOG +#endif + +#if defined(KEYCACHE_DEBUG_LOG) +static FILE *keycache_debug_log=NULL; +static void keycache_debug_print _VARARGS((const char *fmt,...)); +#define KEYCACHE_DEBUG_OPEN \ + if (!keycache_debug_log) \ + { \ + keycache_debug_log= fopen(KEYCACHE_DEBUG_LOG, "w"); \ + (void) setvbuf(keycache_debug_log, NULL, _IOLBF, BUFSIZ); \ + } + +#define KEYCACHE_DEBUG_CLOSE \ + if (keycache_debug_log) \ + { \ + fclose(keycache_debug_log); \ + keycache_debug_log= 0; \ + } +#else +#define KEYCACHE_DEBUG_OPEN +#define KEYCACHE_DEBUG_CLOSE +#endif /* defined(KEYCACHE_DEBUG_LOG) */ + +#if defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) +#define KEYCACHE_DBUG_PRINT(l, m) \ + { if (keycache_debug_log) fprintf(keycache_debug_log, "%s: ", l); \ + keycache_debug_print m; } + +#define KEYCACHE_DBUG_ASSERT(a) \ + { if (! (a) && keycache_debug_log) fclose(keycache_debug_log); \ + assert(a); } +#else +#define KEYCACHE_DBUG_PRINT(l, m) DBUG_PRINT(l, m) +#define KEYCACHE_DBUG_ASSERT(a) DBUG_ASSERT(a) +#endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */ + +#if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF) +#ifdef THREAD +static long keycache_thread_id; +#define KEYCACHE_THREAD_TRACE(l) \ + KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id)) + +#define KEYCACHE_THREAD_TRACE_BEGIN(l) \ + { struct st_my_thread_var *thread_var= my_thread_var; \ + keycache_thread_id= thread_var->id; \ + KEYCACHE_DBUG_PRINT(l,("[thread %ld",keycache_thread_id)) } + +#define KEYCACHE_THREAD_TRACE_END(l) \ + KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id)) +#else /* THREAD */ +#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,("")) +#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,("")) +#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,("")) +#endif /* THREAD */ +#else +#define KEYCACHE_THREAD_TRACE_BEGIN(l) +#define KEYCACHE_THREAD_TRACE_END(l) +#define KEYCACHE_THREAD_TRACE(l) +#endif /* defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF) */ + +#define BLOCK_NUMBER(b) \ + ((uint) (((char*)(b)-(char *) keycache->block_root)/sizeof(BLOCK_LINK))) +#define HASH_LINK_NUMBER(h) \ + ((uint) (((char*)(h)-(char *) keycache->hash_link_root)/sizeof(HASH_LINK))) + +#if (defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)) || defined(KEYCACHE_DEBUG) +static int keycache_pthread_cond_wait(pthread_cond_t *cond, + pthread_mutex_t *mutex); +#else +#define keycache_pthread_cond_wait pthread_cond_wait +#endif + +#if defined(KEYCACHE_DEBUG) +static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex); +static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex); +static int keycache_pthread_cond_signal(pthread_cond_t *cond); +#else +#define keycache_pthread_mutex_lock pthread_mutex_lock +#define keycache_pthread_mutex_unlock pthread_mutex_unlock +#define keycache_pthread_cond_signal pthread_cond_signal +#endif /* defined(KEYCACHE_DEBUG) */ + +#if !defined(DBUG_OFF) +#if defined(inline) +#undef inline +#endif +#define inline /* disabled inline for easier debugging */ +static int fail_block(BLOCK_LINK *block); +static int fail_hlink(HASH_LINK *hlink); +static int cache_empty(KEY_CACHE *keycache); +#endif + +static inline uint next_power(uint value) +{ + return (uint) my_round_up_to_next_power((uint32) value) << 1; +} + + +/* + Initialize a key cache + + SYNOPSIS + init_key_cache() + keycache pointer to a key cache data structure + key_cache_block_size size of blocks to keep cached data + use_mem total memory to use for the key cache + division_limit division limit (may be zero) + age_threshold age threshold (may be zero) + + RETURN VALUE + number of blocks in the key cache, if successful, + 0 - otherwise. + + NOTES. + if keycache->key_cache_inited != 0 we assume that the key cache + is already initialized. This is for now used by myisamchk, but shouldn't + be something that a program should rely on! + + It's assumed that no two threads call this function simultaneously + referring to the same key cache handle. + +*/ + +int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, + size_t use_mem, uint division_limit, + uint age_threshold) +{ + ulong blocks, hash_links; + size_t length; + int error; + DBUG_ENTER("init_key_cache"); + DBUG_ASSERT(key_cache_block_size >= 512); + + KEYCACHE_DEBUG_OPEN; + if (keycache->key_cache_inited && keycache->disk_blocks > 0) + { + DBUG_PRINT("warning",("key cache already in use")); + DBUG_RETURN(0); + } + + keycache->global_cache_w_requests= keycache->global_cache_r_requests= 0; + keycache->global_cache_read= keycache->global_cache_write= 0; + keycache->disk_blocks= -1; + if (! keycache->key_cache_inited) + { + keycache->key_cache_inited= 1; + /* + Initialize these variables once only. + Their value must survive re-initialization during resizing. + */ + keycache->in_resize= 0; + keycache->resize_in_flush= 0; + keycache->cnt_for_resize_op= 0; + keycache->waiting_for_resize_cnt.last_thread= NULL; + keycache->in_init= 0; + pthread_mutex_init(&keycache->cache_lock, MY_MUTEX_INIT_FAST); + keycache->resize_queue.last_thread= NULL; + keycache->post_write= NULL; + } + + keycache->key_cache_mem_size= use_mem; + keycache->key_cache_block_size= key_cache_block_size; + DBUG_PRINT("info", ("key_cache_block_size: %u", + key_cache_block_size)); + + blocks= (ulong) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) + + sizeof(HASH_LINK*) * 5/4 + key_cache_block_size)); + /* It doesn't make sense to have too few blocks (less than 8) */ + if (blocks >= 8) + { + for ( ; ; ) + { + /* Set my_hash_entries to the next bigger 2 power */ + if ((keycache->hash_entries= next_power(blocks)) < blocks * 5/4) + keycache->hash_entries<<= 1; + hash_links= 2 * blocks; +#if defined(MAX_THREADS) + if (hash_links < MAX_THREADS + blocks - 1) + hash_links= MAX_THREADS + blocks - 1; +#endif + while ((length= (ALIGN_SIZE(blocks * sizeof(BLOCK_LINK)) + + ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) + + ALIGN_SIZE(sizeof(HASH_LINK*) * + keycache->hash_entries))) + + ((size_t) blocks * keycache->key_cache_block_size) > use_mem) + blocks--; + /* Allocate memory for cache page buffers */ + if ((keycache->block_mem= + my_large_malloc((size_t) blocks * keycache->key_cache_block_size, + MYF(0)))) + { + /* + Allocate memory for blocks, hash_links and hash entries; + For each block 2 hash links are allocated + */ + if ((keycache->block_root= (BLOCK_LINK*) my_malloc(length, + MYF(0)))) + break; + my_large_free(keycache->block_mem, MYF(0)); + keycache->block_mem= 0; + } + if (blocks < 8) + { + my_errno= ENOMEM; + my_error(EE_OUTOFMEMORY, MYF(0), blocks * keycache->key_cache_block_size); + goto err; + } + blocks= blocks / 4*3; + } + keycache->blocks_unused= blocks; + keycache->disk_blocks= (int) blocks; + keycache->hash_links= hash_links; + keycache->hash_root= (HASH_LINK**) ((char*) keycache->block_root + + ALIGN_SIZE(blocks*sizeof(BLOCK_LINK))); + keycache->hash_link_root= (HASH_LINK*) ((char*) keycache->hash_root + + ALIGN_SIZE((sizeof(HASH_LINK*) * + keycache->hash_entries))); + bzero((uchar*) keycache->block_root, + keycache->disk_blocks * sizeof(BLOCK_LINK)); + bzero((uchar*) keycache->hash_root, + keycache->hash_entries * sizeof(HASH_LINK*)); + bzero((uchar*) keycache->hash_link_root, + keycache->hash_links * sizeof(HASH_LINK)); + keycache->hash_links_used= 0; + keycache->free_hash_list= NULL; + keycache->blocks_used= keycache->blocks_changed= 0; + + keycache->global_blocks_changed= 0; + keycache->blocks_available=0; /* For debugging */ + + /* The LRU chain is empty after initialization */ + keycache->used_last= NULL; + keycache->used_ins= NULL; + keycache->free_block_list= NULL; + keycache->keycache_time= 0; + keycache->warm_blocks= 0; + keycache->min_warm_blocks= (division_limit ? + blocks * division_limit / 100 + 1 : + blocks); + keycache->age_threshold= (age_threshold ? + blocks * age_threshold / 100 : + blocks); + + keycache->can_be_used= 1; + + keycache->waiting_for_hash_link.last_thread= NULL; + keycache->waiting_for_block.last_thread= NULL; + DBUG_PRINT("exit", + ("disk_blocks: %d block_root: %p hash_entries: %d\ + hash_root: %p hash_links: %d hash_link_root: %p", + keycache->disk_blocks, keycache->block_root, + keycache->hash_entries, keycache->hash_root, + keycache->hash_links, keycache->hash_link_root)); + bzero((uchar*) keycache->changed_blocks, + sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH); + bzero((uchar*) keycache->file_blocks, + sizeof(keycache->file_blocks[0]) * CHANGED_BLOCKS_HASH); + } + else + { + /* key_buffer_size is specified too small. Disable the cache. */ + keycache->can_be_used= 0; + } + + keycache->blocks= keycache->disk_blocks > 0 ? keycache->disk_blocks : 0; + DBUG_RETURN((int) keycache->disk_blocks); + +err: + error= my_errno; + keycache->disk_blocks= 0; + keycache->blocks= 0; + if (keycache->block_mem) + { + my_large_free((uchar*) keycache->block_mem, MYF(0)); + keycache->block_mem= NULL; + } + if (keycache->block_root) + { + my_free((uchar*) keycache->block_root, MYF(0)); + keycache->block_root= NULL; + } + my_errno= error; + keycache->can_be_used= 0; + DBUG_RETURN(0); +} + + +/* + Resize a key cache + + SYNOPSIS + resize_key_cache() + keycache pointer to a key cache data structure + key_cache_block_size size of blocks to keep cached data + use_mem total memory to use for the new key cache + division_limit new division limit (if not zero) + age_threshold new age threshold (if not zero) + + RETURN VALUE + number of blocks in the key cache, if successful, + 0 - otherwise. + + NOTES. + The function first compares the memory size and the block size parameters + with the key cache values. + + If they differ the function free the the memory allocated for the + old key cache blocks by calling the end_key_cache function and + then rebuilds the key cache with new blocks by calling + init_key_cache. + + The function starts the operation only when all other threads + performing operations with the key cache let her to proceed + (when cnt_for_resize=0). +*/ + +int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, + size_t use_mem, uint division_limit, + uint age_threshold) +{ + int blocks; + DBUG_ENTER("resize_key_cache"); + + if (!keycache->key_cache_inited) + DBUG_RETURN(keycache->disk_blocks); + + if(key_cache_block_size == keycache->key_cache_block_size && + use_mem == keycache->key_cache_mem_size) + { + change_key_cache_param(keycache, division_limit, age_threshold); + DBUG_RETURN(keycache->disk_blocks); + } + + keycache_pthread_mutex_lock(&keycache->cache_lock); + +#ifdef THREAD + /* + We may need to wait for another thread which is doing a resize + already. This cannot happen in the MySQL server though. It allows + one resizer only. In set_var.cc keycache->in_init is used to block + multiple attempts. + */ + while (keycache->in_resize) + { + /* purecov: begin inspected */ + wait_on_queue(&keycache->resize_queue, &keycache->cache_lock); + /* purecov: end */ + } +#endif + + /* + Mark the operation in progress. This blocks other threads from doing + a resize in parallel. It prohibits new blocks to enter the cache. + Read/write requests can bypass the cache during the flush phase. + */ + keycache->in_resize= 1; + + /* Need to flush only if keycache is enabled. */ + if (keycache->can_be_used) + { + /* Start the flush phase. */ + keycache->resize_in_flush= 1; + + if (flush_all_key_blocks(keycache)) + { + /* TODO: if this happens, we should write a warning in the log file ! */ + keycache->resize_in_flush= 0; + blocks= 0; + keycache->can_be_used= 0; + goto finish; + } + DBUG_ASSERT(cache_empty(keycache)); + + /* End the flush phase. */ + keycache->resize_in_flush= 0; + } + +#ifdef THREAD + /* + Some direct read/write operations (bypassing the cache) may still be + unfinished. Wait until they are done. If the key cache can be used, + direct I/O is done in increments of key_cache_block_size. That is, + every block is checked if it is in the cache. We need to wait for + pending I/O before re-initializing the cache, because we may change + the block size. Otherwise they could check for blocks at file + positions where the new block division has none. We do also want to + wait for I/O done when (if) the cache was disabled. It must not + run in parallel with normal cache operation. + */ + while (keycache->cnt_for_resize_op) + wait_on_queue(&keycache->waiting_for_resize_cnt, &keycache->cache_lock); +#else + KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0); +#endif + + /* + Free old cache structures, allocate new structures, and initialize + them. Note that the cache_lock mutex and the resize_queue are left + untouched. We do not lose the cache_lock and will release it only at + the end of this function. + */ + end_key_cache(keycache, 0); /* Don't free mutex */ + /* The following will work even if use_mem is 0 */ + blocks= init_key_cache(keycache, key_cache_block_size, use_mem, + division_limit, age_threshold); + +finish: + /* + Mark the resize finished. This allows other threads to start a + resize or to request new cache blocks. + */ + keycache->in_resize= 0; + + /* Signal waiting threads. */ + release_whole_queue(&keycache->resize_queue); + + keycache_pthread_mutex_unlock(&keycache->cache_lock); + DBUG_RETURN(blocks); +} + + +/* + Increment counter blocking resize key cache operation +*/ +static inline void inc_counter_for_resize_op(KEY_CACHE *keycache) +{ + keycache->cnt_for_resize_op++; +} + + +/* + Decrement counter blocking resize key cache operation; + Signal the operation to proceed when counter becomes equal zero +*/ +static inline void dec_counter_for_resize_op(KEY_CACHE *keycache) +{ + if (!--keycache->cnt_for_resize_op) + release_whole_queue(&keycache->waiting_for_resize_cnt); +} + +/* + Change the key cache parameters + + SYNOPSIS + change_key_cache_param() + keycache pointer to a key cache data structure + division_limit new division limit (if not zero) + age_threshold new age threshold (if not zero) + + RETURN VALUE + none + + NOTES. + Presently the function resets the key cache parameters + concerning midpoint insertion strategy - division_limit and + age_threshold. +*/ + +void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, + uint age_threshold) +{ + DBUG_ENTER("change_key_cache_param"); + + keycache_pthread_mutex_lock(&keycache->cache_lock); + if (division_limit) + keycache->min_warm_blocks= (keycache->disk_blocks * + division_limit / 100 + 1); + if (age_threshold) + keycache->age_threshold= (keycache->disk_blocks * + age_threshold / 100); + keycache_pthread_mutex_unlock(&keycache->cache_lock); + DBUG_VOID_RETURN; +} + + +/* + Remove key_cache from memory + + SYNOPSIS + end_key_cache() + keycache key cache handle + cleanup Complete free (Free also mutex for key cache) + + RETURN VALUE + none +*/ + +void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) +{ + DBUG_ENTER("end_key_cache"); + DBUG_PRINT("enter", ("key_cache: %p", keycache)); + + if (!keycache->key_cache_inited) + DBUG_VOID_RETURN; + + if (keycache->disk_blocks > 0) + { + if (keycache->block_mem) + { + my_large_free((uchar*) keycache->block_mem, MYF(0)); + keycache->block_mem= NULL; + my_free((uchar*) keycache->block_root, MYF(0)); + keycache->block_root= NULL; + } + keycache->disk_blocks= -1; + /* Reset blocks_changed to be safe if flush_all_key_blocks is called */ + keycache->blocks_changed= 0; + } + + DBUG_PRINT("status", ("used: %lu changed: %lu w_requests: %lu " + "writes: %lu r_requests: %lu reads: %lu", + keycache->blocks_used, keycache->global_blocks_changed, + (ulong) keycache->global_cache_w_requests, + (ulong) keycache->global_cache_write, + (ulong) keycache->global_cache_r_requests, + (ulong) keycache->global_cache_read)); + + /* + Reset these values to be able to detect a disabled key cache. + See Bug#44068 (RESTORE can disable the MyISAM Key Cache). + */ + keycache->blocks_used= 0; + keycache->blocks_unused= 0; + + if (cleanup) + { + pthread_mutex_destroy(&keycache->cache_lock); + keycache->key_cache_inited= keycache->can_be_used= 0; + keycache->post_write= NULL; + KEYCACHE_DEBUG_CLOSE; + } + DBUG_VOID_RETURN; +} /* end_key_cache */ + + +/** + Does a my_pwrite() to the file and then calls callback. Arguments are those + of my_pwrite() plus the callback and its argument. + + @note The callback is really POST-write; callers depend on this! So always + call it after writing to the file, not before. + + @return Operation status + @retval 0 ok + @retval !=0 write or callback failed +*/ + +static inline int key_cache_pwrite(int Filedes, const uchar *Buffer, + uint Count, my_off_t offset, myf MyFlags, + KEYCACHE_POST_WRITE_CALLBACK callback, + void *callback_arg) +{ + int ret= my_pwrite(Filedes, Buffer, Count, offset, MyFlags); + if (callback) + ret|= (*callback)(callback_arg, Buffer, Count, offset); + return ret; +} + + +#ifdef THREAD + +/* + Link a thread into double-linked queue of waiting threads. + + SYNOPSIS + link_into_queue() + wqueue pointer to the queue structure + thread pointer to the thread to be added to the queue + + RETURN VALUE + none + + NOTES. + Queue is represented by a circular list of the thread structures + The list is double-linked of the type (**prev,*next), accessed by + a pointer to the last element. +*/ + +static void link_into_queue(KEYCACHE_WQUEUE *wqueue, + struct st_my_thread_var *thread) +{ + struct st_my_thread_var *last; + + DBUG_ASSERT(!thread->next && !thread->prev); + if (! (last= wqueue->last_thread)) + { + /* Queue is empty */ + thread->next= thread; + thread->prev= &thread->next; + } + else + { + thread->prev= last->next->prev; + last->next->prev= &thread->next; + thread->next= last->next; + last->next= thread; + } + wqueue->last_thread= thread; +} + +/* + Unlink a thread from double-linked queue of waiting threads + + SYNOPSIS + unlink_from_queue() + wqueue pointer to the queue structure + thread pointer to the thread to be removed from the queue + + RETURN VALUE + none + + NOTES. + See NOTES for link_into_queue +*/ + +static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, + struct st_my_thread_var *thread) +{ + KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id)); + DBUG_ASSERT(thread->next && thread->prev); + if (thread->next == thread) + /* The queue contains only one member */ + wqueue->last_thread= NULL; + else + { + thread->next->prev= thread->prev; + *thread->prev=thread->next; + if (wqueue->last_thread == thread) + wqueue->last_thread= STRUCT_PTR(struct st_my_thread_var, next, + thread->prev); + } + thread->next= NULL; +#if !defined(DBUG_OFF) + /* + This makes it easier to see it's not in a chain during debugging. + And some DBUG_ASSERT() rely on it. + */ + thread->prev= NULL; +#endif +} + + +/* + Add a thread to single-linked queue of waiting threads + + SYNOPSIS + wait_on_queue() + wqueue Pointer to the queue structure. + mutex Cache_lock to acquire after awake. + + RETURN VALUE + none + + NOTES. + Queue is represented by a circular list of the thread structures + The list is single-linked of the type (*next), accessed by a pointer + to the last element. + + The function protects against stray signals by verifying that the + current thread is unlinked from the queue when awaking. However, + since several threads can wait for the same event, it might be + necessary for the caller of the function to check again if the + condition for awake is indeed matched. +*/ + +static void wait_on_queue(KEYCACHE_WQUEUE *wqueue, + pthread_mutex_t *mutex) +{ + struct st_my_thread_var *last; + struct st_my_thread_var *thread= my_thread_var; + + /* Add to queue. */ + DBUG_ASSERT(!thread->next); + DBUG_ASSERT(!thread->prev); /* Not required, but must be true anyway. */ + if (! (last= wqueue->last_thread)) + thread->next= thread; + else + { + thread->next= last->next; + last->next= thread; + } + wqueue->last_thread= thread; + + /* + Wait until thread is removed from queue by the signalling thread. + The loop protects against stray signals. + */ + do + { + KEYCACHE_DBUG_PRINT("wait", ("suspend thread %ld", thread->id)); + keycache_pthread_cond_wait(&thread->suspend, mutex); + } + while (thread->next); +} + + +/* + Remove all threads from queue signaling them to proceed + + SYNOPSIS + release_whole_queue() + wqueue pointer to the queue structure + + RETURN VALUE + none + + NOTES. + See notes for wait_on_queue(). + When removed from the queue each thread is signaled via condition + variable thread->suspend. +*/ + +static void release_whole_queue(KEYCACHE_WQUEUE *wqueue) +{ + struct st_my_thread_var *last; + struct st_my_thread_var *next; + struct st_my_thread_var *thread; + + /* Queue may be empty. */ + if (!(last= wqueue->last_thread)) + return; + + next= last->next; + do + { + thread=next; + KEYCACHE_DBUG_PRINT("release_whole_queue: signal", + ("thread %ld", thread->id)); + /* Signal the thread. */ + keycache_pthread_cond_signal(&thread->suspend); + /* Take thread from queue. */ + next=thread->next; + thread->next= NULL; + } + while (thread != last); + + /* Now queue is definitely empty. */ + wqueue->last_thread= NULL; +} + +#endif /* THREAD */ + + +/* + Unlink a block from the chain of dirty/clean blocks +*/ + +static inline void unlink_changed(BLOCK_LINK *block) +{ + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + if (block->next_changed) + block->next_changed->prev_changed= block->prev_changed; + *block->prev_changed= block->next_changed; + +#if !defined(DBUG_OFF) + /* + This makes it easier to see it's not in a chain during debugging. + And some DBUG_ASSERT() rely on it. + */ + block->next_changed= NULL; + block->prev_changed= NULL; +#endif +} + + +/* + Link a block into the chain of dirty/clean blocks +*/ + +static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead) +{ + DBUG_ASSERT(!block->next_changed); + DBUG_ASSERT(!block->prev_changed); + block->prev_changed= phead; + if ((block->next_changed= *phead)) + (*phead)->prev_changed= &block->next_changed; + *phead= block; +} + + +/* + Link a block in a chain of clean blocks of a file. + + SYNOPSIS + link_to_file_list() + keycache Key cache handle + block Block to relink + file File to be linked to + unlink If to unlink first + + DESCRIPTION + Unlink a block from whichever chain it is linked in, if it's + asked for, and link it to the chain of clean blocks of the + specified file. + + NOTE + Please do never set/clear BLOCK_CHANGED outside of + link_to_file_list() or link_to_changed_list(). + You would risk to damage correct counting of changed blocks + and to find blocks in the wrong hash. + + RETURN + void +*/ + +static void link_to_file_list(KEY_CACHE *keycache, + BLOCK_LINK *block, int file, + my_bool unlink_block) +{ + DBUG_ASSERT(block->status & BLOCK_IN_USE); + DBUG_ASSERT(block->hash_link && block->hash_link->block == block); + DBUG_ASSERT(block->hash_link->file == file); + if (unlink_block) + unlink_changed(block); + link_changed(block, &keycache->file_blocks[FILE_HASH(file)]); + if (block->status & BLOCK_CHANGED) + { + block->status&= ~BLOCK_CHANGED; + keycache->blocks_changed--; + keycache->global_blocks_changed--; + } +} + + +/* + Re-link a block from the clean chain to the dirty chain of a file. + + SYNOPSIS + link_to_changed_list() + keycache key cache handle + block block to relink + + DESCRIPTION + Unlink a block from the chain of clean blocks of a file + and link it to the chain of dirty blocks of the same file. + + NOTE + Please do never set/clear BLOCK_CHANGED outside of + link_to_file_list() or link_to_changed_list(). + You would risk to damage correct counting of changed blocks + and to find blocks in the wrong hash. + + RETURN + void +*/ + +static void link_to_changed_list(KEY_CACHE *keycache, + BLOCK_LINK *block) +{ + DBUG_ASSERT(block->status & BLOCK_IN_USE); + DBUG_ASSERT(!(block->status & BLOCK_CHANGED)); + DBUG_ASSERT(block->hash_link && block->hash_link->block == block); + + unlink_changed(block); + link_changed(block, + &keycache->changed_blocks[FILE_HASH(block->hash_link->file)]); + block->status|=BLOCK_CHANGED; + keycache->blocks_changed++; + keycache->global_blocks_changed++; +} + + +/* + Link a block to the LRU chain at the beginning or at the end of + one of two parts. + + SYNOPSIS + link_block() + keycache pointer to a key cache data structure + block pointer to the block to link to the LRU chain + hot <-> to link the block into the hot subchain + at_end <-> to link the block at the end of the subchain + + RETURN VALUE + none + + NOTES. + The LRU ring is represented by a circular list of block structures. + The list is double-linked of the type (**prev,*next) type. + The LRU ring is divided into two parts - hot and warm. + There are two pointers to access the last blocks of these two + parts. The beginning of the warm part follows right after the + end of the hot part. + Only blocks of the warm part can be used for eviction. + The first block from the beginning of this subchain is always + taken for eviction (keycache->last_used->next) + + LRU chain: +------+ H O T +------+ + +----| end |----...<----| beg |----+ + | +------+last +------+ | + v<-link in latest hot (new end) | + | link in latest warm (new end)->^ + | +------+ W A R M +------+ | + +----| beg |---->...----| end |----+ + +------+ +------+ins + first for eviction + + It is also possible that the block is selected for eviction and thus + not linked in the LRU ring. +*/ + +static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot, + my_bool at_end) +{ + BLOCK_LINK *ins; + BLOCK_LINK **pins; + + DBUG_ASSERT((block->status & ~BLOCK_CHANGED) == (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/ + DBUG_ASSERT(!block->requests); + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + DBUG_ASSERT(!block->next_used); + DBUG_ASSERT(!block->prev_used); +#ifdef THREAD + if (!hot && keycache->waiting_for_block.last_thread) + { + /* Signal that in the LRU warm sub-chain an available block has appeared */ + struct st_my_thread_var *last_thread= + keycache->waiting_for_block.last_thread; + struct st_my_thread_var *first_thread= last_thread->next; + struct st_my_thread_var *next_thread= first_thread; + HASH_LINK *hash_link= (HASH_LINK *) first_thread->opt_info; + struct st_my_thread_var *thread; + do + { + thread= next_thread; + next_thread= thread->next; + /* + We notify about the event all threads that ask + for the same page as the first thread in the queue + */ + if ((HASH_LINK *) thread->opt_info == hash_link) + { + KEYCACHE_DBUG_PRINT("link_block: signal", ("thread %ld", thread->id)); + keycache_pthread_cond_signal(&thread->suspend); + unlink_from_queue(&keycache->waiting_for_block, thread); + block->requests++; + } + } + while (thread != last_thread); + hash_link->block= block; + /* + NOTE: We assigned the block to the hash_link and signalled the + requesting thread(s). But it is possible that other threads runs + first. These threads see the hash_link assigned to a block which + is assigned to another hash_link and not marked BLOCK_IN_SWITCH. + This can be a problem for functions that do not select the block + via its hash_link: flush and free. They do only see a block which + is in a "normal" state and don't know that it will be evicted soon. + + We cannot set BLOCK_IN_SWITCH here because only one of the + requesting threads must handle the eviction. All others must wait + for it to complete. If we set the flag here, the threads would not + know who is in charge of the eviction. Without the flag, the first + thread takes the stick and sets the flag. + + But we need to note in the block that is has been selected for + eviction. It must not be freed. The evicting thread will not + expect the block in the free list. Before freeing we could also + check if block->requests > 1. But I think including another flag + in the check of block->status is slightly more efficient and + probably easier to read. + */ + block->status|= BLOCK_IN_EVICTION; + KEYCACHE_THREAD_TRACE("link_block: after signaling"); +#if defined(KEYCACHE_DEBUG) + KEYCACHE_DBUG_PRINT("link_block", + ("linked,unlinked block %u status=%x #requests=%u #available=%u", + BLOCK_NUMBER(block), block->status, + block->requests, keycache->blocks_available)); +#endif + return; + } +#else /* THREAD */ + KEYCACHE_DBUG_ASSERT(! (!hot && keycache->waiting_for_block.last_thread)); + /* Condition not transformed using DeMorgan, to keep the text identical */ +#endif /* THREAD */ + pins= hot ? &keycache->used_ins : &keycache->used_last; + ins= *pins; + if (ins) + { + ins->next_used->prev_used= &block->next_used; + block->next_used= ins->next_used; + block->prev_used= &ins->next_used; + ins->next_used= block; + if (at_end) + *pins= block; + } + else + { + /* The LRU ring is empty. Let the block point to itself. */ + keycache->used_last= keycache->used_ins= block->next_used= block; + block->prev_used= &block->next_used; + } + KEYCACHE_THREAD_TRACE("link_block"); +#if defined(KEYCACHE_DEBUG) + keycache->blocks_available++; + KEYCACHE_DBUG_PRINT("link_block", + ("linked block %u:%1u status=%x #requests=%u #available=%u", + BLOCK_NUMBER(block), at_end, block->status, + block->requests, keycache->blocks_available)); + KEYCACHE_DBUG_ASSERT((ulong) keycache->blocks_available <= + keycache->blocks_used); +#endif +} + + +/* + Unlink a block from the LRU chain + + SYNOPSIS + unlink_block() + keycache pointer to a key cache data structure + block pointer to the block to unlink from the LRU chain + + RETURN VALUE + none + + NOTES. + See NOTES for link_block +*/ + +static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block) +{ + DBUG_ASSERT((block->status & ~BLOCK_CHANGED) == (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/ + DBUG_ASSERT(!block->requests); + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + DBUG_ASSERT(block->next_used && block->prev_used && + (block->next_used->prev_used == &block->next_used) && + (*block->prev_used == block)); + if (block->next_used == block) + /* The list contains only one member */ + keycache->used_last= keycache->used_ins= NULL; + else + { + block->next_used->prev_used= block->prev_used; + *block->prev_used= block->next_used; + if (keycache->used_last == block) + keycache->used_last= STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used); + if (keycache->used_ins == block) + keycache->used_ins=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used); + } + block->next_used= NULL; +#if !defined(DBUG_OFF) + /* + This makes it easier to see it's not in a chain during debugging. + And some DBUG_ASSERT() rely on it. + */ + block->prev_used= NULL; +#endif + + KEYCACHE_THREAD_TRACE("unlink_block"); +#if defined(KEYCACHE_DEBUG) + KEYCACHE_DBUG_ASSERT(keycache->blocks_available != 0); + keycache->blocks_available--; + KEYCACHE_DBUG_PRINT("unlink_block", + ("unlinked block %u status=%x #requests=%u #available=%u", + BLOCK_NUMBER(block), block->status, + block->requests, keycache->blocks_available)); +#endif +} + + +/* + Register requests for a block. + + SYNOPSIS + reg_requests() + keycache Pointer to a key cache data structure. + block Pointer to the block to register a request on. + count Number of requests. Always 1. + + NOTE + The first request unlinks the block from the LRU ring. This means + that it is protected against eveiction. + + RETURN + void +*/ +static void reg_requests(KEY_CACHE *keycache, BLOCK_LINK *block, int count) +{ + DBUG_ASSERT(block->status & BLOCK_IN_USE); + DBUG_ASSERT(block->hash_link); + + if (!block->requests) + unlink_block(keycache, block); + block->requests+=count; +} + + +/* + Unregister request for a block + linking it to the LRU chain if it's the last request + + SYNOPSIS + unreg_request() + keycache pointer to a key cache data structure + block pointer to the block to link to the LRU chain + at_end <-> to link the block at the end of the LRU chain + + RETURN VALUE + none + + NOTES. + Every linking to the LRU ring decrements by one a special block + counter (if it's positive). If the at_end parameter is TRUE the block is + added either at the end of warm sub-chain or at the end of hot sub-chain. + It is added to the hot subchain if its counter is zero and number of + blocks in warm sub-chain is not less than some low limit (determined by + the division_limit parameter). Otherwise the block is added to the warm + sub-chain. If the at_end parameter is FALSE the block is always added + at beginning of the warm sub-chain. + Thus a warm block can be promoted to the hot sub-chain when its counter + becomes zero for the first time. + At the same time the block at the very beginning of the hot subchain + might be moved to the beginning of the warm subchain if it stays untouched + for a too long time (this time is determined by parameter age_threshold). + + It is also possible that the block is selected for eviction and thus + not linked in the LRU ring. +*/ + +static void unreg_request(KEY_CACHE *keycache, + BLOCK_LINK *block, int at_end) +{ + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/ + DBUG_ASSERT(block->requests); + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + DBUG_ASSERT(!block->next_used); + DBUG_ASSERT(!block->prev_used); + /* + Unregister the request, but do not link erroneous blocks into the + LRU ring. + */ + if (!--block->requests && !(block->status & BLOCK_ERROR)) + { + my_bool hot; + if (block->hits_left) + block->hits_left--; + hot= !block->hits_left && at_end && + keycache->warm_blocks > keycache->min_warm_blocks; + if (hot) + { + if (block->temperature == BLOCK_WARM) + keycache->warm_blocks--; + block->temperature= BLOCK_HOT; + KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu", + keycache->warm_blocks)); + } + link_block(keycache, block, hot, (my_bool)at_end); + block->last_hit_time= keycache->keycache_time; + keycache->keycache_time++; + /* + At this place, the block might be in the LRU ring or not. If an + evicter was waiting for a block, it was selected for eviction and + not linked in the LRU ring. + */ + + /* + Check if we should link a hot block to the warm block sub-chain. + It is possible that we select the same block as above. But it can + also be another block. In any case a block from the LRU ring is + selected. In other words it works even if the above block was + selected for eviction and not linked in the LRU ring. Since this + happens only if the LRU ring is empty, the block selected below + would be NULL and the rest of the function skipped. + */ + block= keycache->used_ins; + if (block && keycache->keycache_time - block->last_hit_time > + keycache->age_threshold) + { + unlink_block(keycache, block); + link_block(keycache, block, 0, 0); + if (block->temperature != BLOCK_WARM) + { + keycache->warm_blocks++; + block->temperature= BLOCK_WARM; + } + KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu", + keycache->warm_blocks)); + } + } +} + +/* + Remove a reader of the page in block +*/ + +static void remove_reader(BLOCK_LINK *block) +{ + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(block->hash_link && block->hash_link->block == block); + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + DBUG_ASSERT(!block->next_used); + DBUG_ASSERT(!block->prev_used); + DBUG_ASSERT(block->hash_link->requests); +#ifdef THREAD + if (! --block->hash_link->requests && block->condvar) + keycache_pthread_cond_signal(block->condvar); +#else + --block->hash_link->requests; +#endif +} + + +/* + Wait until the last reader of the page in block + signals on its termination +*/ + +static void wait_for_readers(KEY_CACHE *keycache, + BLOCK_LINK *block) +{ +#ifdef THREAD + struct st_my_thread_var *thread= my_thread_var; + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(!(block->status & (BLOCK_IN_FLUSH | BLOCK_CHANGED))); + DBUG_ASSERT(block->hash_link); + DBUG_ASSERT(block->hash_link->block == block); + /* Linked in file_blocks or changed_blocks hash. */ + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + /* Not linked in LRU ring. */ + DBUG_ASSERT(!block->next_used); + DBUG_ASSERT(!block->prev_used); + while (block->hash_link->requests) + { + KEYCACHE_DBUG_PRINT("wait_for_readers: wait", + ("suspend thread %ld block %u", + thread->id, BLOCK_NUMBER(block))); + /* There must be no other waiter. We have no queue here. */ + DBUG_ASSERT(!block->condvar); + block->condvar= &thread->suspend; + keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); + block->condvar= NULL; + } +#else + KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0); +#endif +} + + +/* + Add a hash link to a bucket in the hash_table +*/ + +static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link) +{ + if (*start) + (*start)->prev= &hash_link->next; + hash_link->next= *start; + hash_link->prev= start; + *start= hash_link; +} + + +/* + Remove a hash link from the hash table +*/ + +static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link) +{ + KEYCACHE_DBUG_PRINT("unlink_hash", ("fd: %u pos_ %lu #requests=%u", + (uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests)); + KEYCACHE_DBUG_ASSERT(hash_link->requests == 0); + if ((*hash_link->prev= hash_link->next)) + hash_link->next->prev= hash_link->prev; + hash_link->block= NULL; +#ifdef THREAD + if (keycache->waiting_for_hash_link.last_thread) + { + /* Signal that a free hash link has appeared */ + struct st_my_thread_var *last_thread= + keycache->waiting_for_hash_link.last_thread; + struct st_my_thread_var *first_thread= last_thread->next; + struct st_my_thread_var *next_thread= first_thread; + KEYCACHE_PAGE *first_page= (KEYCACHE_PAGE *) (first_thread->opt_info); + struct st_my_thread_var *thread; + + hash_link->file= first_page->file; + hash_link->diskpos= first_page->filepos; + do + { + KEYCACHE_PAGE *page; + thread= next_thread; + page= (KEYCACHE_PAGE *) thread->opt_info; + next_thread= thread->next; + /* + We notify about the event all threads that ask + for the same page as the first thread in the queue + */ + if (page->file == hash_link->file && page->filepos == hash_link->diskpos) + { + KEYCACHE_DBUG_PRINT("unlink_hash: signal", ("thread %ld", thread->id)); + keycache_pthread_cond_signal(&thread->suspend); + unlink_from_queue(&keycache->waiting_for_hash_link, thread); + } + } + while (thread != last_thread); + link_hash(&keycache->hash_root[KEYCACHE_HASH(hash_link->file, + hash_link->diskpos)], + hash_link); + return; + } +#else /* THREAD */ + KEYCACHE_DBUG_ASSERT(! (keycache->waiting_for_hash_link.last_thread)); +#endif /* THREAD */ + hash_link->next= keycache->free_hash_list; + keycache->free_hash_list= hash_link; +} + + +/* + Get the hash link for a page +*/ + +static HASH_LINK *get_hash_link(KEY_CACHE *keycache, + int file, my_off_t filepos) +{ + reg1 HASH_LINK *hash_link, **start; +#if defined(KEYCACHE_DEBUG) + int cnt; +#endif + + KEYCACHE_DBUG_PRINT("get_hash_link", ("fd: %u pos: %lu", + (uint) file,(ulong) filepos)); + +restart: + /* + Find the bucket in the hash table for the pair (file, filepos); + start contains the head of the bucket list, + hash_link points to the first member of the list + */ + hash_link= *(start= &keycache->hash_root[KEYCACHE_HASH(file, filepos)]); +#if defined(KEYCACHE_DEBUG) + cnt= 0; +#endif + /* Look for an element for the pair (file, filepos) in the bucket chain */ + while (hash_link && + (hash_link->diskpos != filepos || hash_link->file != file)) + { + hash_link= hash_link->next; +#if defined(KEYCACHE_DEBUG) + cnt++; + if (! (cnt <= keycache->hash_links_used)) + { + int i; + for (i=0, hash_link= *start ; + i < cnt ; i++, hash_link= hash_link->next) + { + KEYCACHE_DBUG_PRINT("get_hash_link", ("fd: %u pos: %lu", + (uint) hash_link->file,(ulong) hash_link->diskpos)); + } + } + KEYCACHE_DBUG_ASSERT(cnt <= keycache->hash_links_used); +#endif + } + if (! hash_link) + { + /* There is no hash link in the hash table for the pair (file, filepos) */ + if (keycache->free_hash_list) + { + hash_link= keycache->free_hash_list; + keycache->free_hash_list= hash_link->next; + } + else if (keycache->hash_links_used < keycache->hash_links) + { + hash_link= &keycache->hash_link_root[keycache->hash_links_used++]; + } + else + { +#ifdef THREAD + /* Wait for a free hash link */ + struct st_my_thread_var *thread= my_thread_var; + KEYCACHE_PAGE page; + KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting")); + page.file= file; + page.filepos= filepos; + thread->opt_info= (void *) &page; + link_into_queue(&keycache->waiting_for_hash_link, thread); + KEYCACHE_DBUG_PRINT("get_hash_link: wait", + ("suspend thread %ld", thread->id)); + keycache_pthread_cond_wait(&thread->suspend, + &keycache->cache_lock); + thread->opt_info= NULL; +#else + KEYCACHE_DBUG_ASSERT(0); +#endif + goto restart; + } + hash_link->file= file; + hash_link->diskpos= filepos; + link_hash(start, hash_link); + } + /* Register the request for the page */ + hash_link->requests++; + + return hash_link; +} + + +/* + Get a block for the file page requested by a keycache read/write operation; + If the page is not in the cache return a free block, if there is none + return the lru block after saving its buffer if the page is dirty. + + SYNOPSIS + + find_key_block() + keycache pointer to a key cache data structure + file handler for the file to read page from + filepos position of the page in the file + init_hits_left how initialize the block counter for the page + wrmode <-> get for writing + page_st out {PAGE_READ,PAGE_TO_BE_READ,PAGE_WAIT_TO_BE_READ} + + RETURN VALUE + Pointer to the found block if successful, 0 - otherwise + + NOTES. + For the page from file positioned at filepos the function checks whether + the page is in the key cache specified by the first parameter. + If this is the case it immediately returns the block. + If not, the function first chooses a block for this page. If there is + no not used blocks in the key cache yet, the function takes the block + at the very beginning of the warm sub-chain. It saves the page in that + block if it's dirty before returning the pointer to it. + The function returns in the page_st parameter the following values: + PAGE_READ - if page already in the block, + PAGE_TO_BE_READ - if it is to be read yet by the current thread + WAIT_TO_BE_READ - if it is to be read by another thread + If an error occurs THE BLOCK_ERROR bit is set in the block status. + It might happen that there are no blocks in LRU chain (in warm part) - + all blocks are unlinked for some read/write operations. Then the function + waits until first of this operations links any block back. +*/ + +static BLOCK_LINK *find_key_block(KEY_CACHE *keycache, + File file, my_off_t filepos, + int init_hits_left, + int wrmode, int *page_st) +{ + HASH_LINK *hash_link; + BLOCK_LINK *block; + int error= 0; + int page_status; + + DBUG_ENTER("find_key_block"); + KEYCACHE_THREAD_TRACE("find_key_block:begin"); + DBUG_PRINT("enter", ("fd: %d pos: %lu wrmode: %d", + file, (ulong) filepos, wrmode)); + KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %d pos: %lu wrmode: %d", + file, (ulong) filepos, + wrmode)); +#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) + DBUG_EXECUTE("check_keycache2", + test_key_cache(keycache, "start of find_key_block", 0);); +#endif + +restart: + /* + If the flush phase of a resize operation fails, the cache is left + unusable. This will be detected only after "goto restart". + */ + if (!keycache->can_be_used) + DBUG_RETURN(0); + + /* + Find the hash_link for the requested file block (file, filepos). We + do always get a hash_link here. It has registered our request so + that no other thread can use it for another file block until we + release the request (which is done by remove_reader() usually). The + hash_link can have a block assigned to it or not. If there is a + block, it may be assigned to this hash_link or not. In cases where a + block is evicted from the cache, it is taken from the LRU ring and + referenced by the new hash_link. But the block can still be assigned + to its old hash_link for some time if it needs to be flushed first, + or if there are other threads still reading it. + + Summary: + hash_link is always returned. + hash_link->block can be: + - NULL or + - not assigned to this hash_link or + - assigned to this hash_link. If assigned, the block can have + - invalid data (when freshly assigned) or + - valid data. Valid data can be + - changed over the file contents (dirty) or + - not changed (clean). + */ + hash_link= get_hash_link(keycache, file, filepos); + DBUG_ASSERT((hash_link->file == file) && (hash_link->diskpos == filepos)); + + page_status= -1; + if ((block= hash_link->block) && + block->hash_link == hash_link && (block->status & BLOCK_READ)) + { + /* Assigned block with valid (changed or unchanged) contents. */ + page_status= PAGE_READ; + } + /* + else (page_status == -1) + - block == NULL or + - block not assigned to this hash_link or + - block assigned but not yet read from file (invalid data). + */ + + if (keycache->in_resize) + { + /* This is a request during a resize operation */ + + if (!block) + { + struct st_my_thread_var *thread; + + /* + The file block is not in the cache. We don't need it in the + cache: we are going to read or write directly to file. Cancel + the request. We can simply decrement hash_link->requests because + we did not release cache_lock since increasing it. So no other + thread can wait for our request to become released. + */ + if (hash_link->requests == 1) + { + /* + We are the only one to request this hash_link (this file/pos). + Free the hash_link. + */ + hash_link->requests--; + unlink_hash(keycache, hash_link); + DBUG_RETURN(0); + } + + /* + More requests on the hash_link. Someone tries to evict a block + for this hash_link (could have started before resizing started). + This means that the LRU ring is empty. Otherwise a block could + be assigned immediately. Behave like a thread that wants to + evict a block for this file/pos. Add to the queue of threads + waiting for a block. Wait until there is one assigned. + + Refresh the request on the hash-link so that it cannot be reused + for another file/pos. + */ + thread= my_thread_var; + thread->opt_info= (void *) hash_link; + link_into_queue(&keycache->waiting_for_block, thread); + do + { + KEYCACHE_DBUG_PRINT("find_key_block: wait", + ("suspend thread %ld", thread->id)); + keycache_pthread_cond_wait(&thread->suspend, + &keycache->cache_lock); + } while (thread->next); + thread->opt_info= NULL; + /* + A block should now be assigned to the hash_link. But it may + still need to be evicted. Anyway, we should re-check the + situation. page_status must be set correctly. + */ + hash_link->requests--; + goto restart; + } /* end of if (!block) */ + + /* + There is a block for this file/pos in the cache. Register a + request on it. This unlinks it from the LRU ring (if it is there) + and hence protects it against eviction (if not already in + eviction). We need this for returning the block to the caller, for + calling remove_reader() (for debugging purposes), and for calling + free_block(). The only case where we don't need the request is if + the block is in eviction. In that case we have to unregister the + request later. + */ + reg_requests(keycache, block, 1); + + if (page_status != PAGE_READ) + { + /* + - block not assigned to this hash_link or + - block assigned but not yet read from file (invalid data). + + This must be a block in eviction. It will be read soon. We need + to wait here until this happened. Otherwise the caller could + access a wrong block or a block which is in read. While waiting + we cannot lose hash_link nor block. We have registered a request + on the hash_link. Everything can happen to the block but changes + in the hash_link -> block relationship. In other words: + everything can happen to the block but free or another completed + eviction. + + Note that we bahave like a secondary requestor here. We just + cannot return with PAGE_WAIT_TO_BE_READ. This would work for + read requests and writes on dirty blocks that are not in flush + only. Waiting here on COND_FOR_REQUESTED works in all + situations. + */ + DBUG_ASSERT(((block->hash_link != hash_link) && + (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))) || + ((block->hash_link == hash_link) && + !(block->status & BLOCK_READ))); + wait_on_queue(&block->wqueue[COND_FOR_REQUESTED], &keycache->cache_lock); + /* + Here we can trust that the block has been assigned to this + hash_link (block->hash_link == hash_link) and read into the + buffer (BLOCK_READ). The worst things possible here are that the + block is in free (BLOCK_REASSIGNED). But the block is still + assigned to the hash_link. The freeing thread waits until we + release our request on the hash_link. The block must not be + again in eviction because we registered an request on it before + starting to wait. + */ + DBUG_ASSERT(block->hash_link == hash_link); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))); + } + /* + The block is in the cache. Assigned to the hash_link. Valid data. + Note that in case of page_st == PAGE_READ, the block can be marked + for eviction. In any case it can be marked for freeing. + */ + + if (!wrmode) + { + /* A reader can just read the block. */ + *page_st= PAGE_READ; + DBUG_ASSERT((hash_link->file == file) && + (hash_link->diskpos == filepos) && + (block->hash_link == hash_link)); + DBUG_RETURN(block); + } + + /* + This is a writer. No two writers for the same block can exist. + This must be assured by locks outside of the key cache. + */ + DBUG_ASSERT(!(block->status & BLOCK_FOR_UPDATE) || fail_block(block)); + + while (block->status & BLOCK_IN_FLUSH) + { + /* + Wait until the block is flushed to file. Do not release the + request on the hash_link yet to prevent that the block is freed + or reassigned while we wait. While we wait, several things can + happen to the block, including another flush. But the block + cannot be reassigned to another hash_link until we release our + request on it. But it can be marked BLOCK_REASSIGNED from free + or eviction, while they wait for us to release the hash_link. + */ + wait_on_queue(&block->wqueue[COND_FOR_SAVED], &keycache->cache_lock); + /* + If the flush phase failed, the resize could have finished while + we waited here. + */ + if (!keycache->in_resize) + { + remove_reader(block); + unreg_request(keycache, block, 1); + goto restart; + } + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(!(block->status & BLOCK_FOR_UPDATE) || fail_block(block)); + DBUG_ASSERT(block->hash_link == hash_link); + } + + if (block->status & BLOCK_CHANGED) + { + /* + We want to write a block with changed contents. If the cache + block size is bigger than the callers block size (e.g. MyISAM), + the caller may replace part of the block only. Changes of the + other part of the block must be preserved. Since the block has + not yet been selected for flush, we can still add our changes. + */ + *page_st= PAGE_READ; + DBUG_ASSERT((hash_link->file == file) && + (hash_link->diskpos == filepos) && + (block->hash_link == hash_link)); + DBUG_RETURN(block); + } + + /* + This is a write request for a clean block. We do not want to have + new dirty blocks in the cache while resizing. We will free the + block and write directly to file. If the block is in eviction or + in free, we just let it go. + + Unregister from the hash_link. This must be done before freeing + the block. And it must be done if not freeing the block. Because + we could have waited above, we need to call remove_reader(). Other + threads could wait for us to release our request on the hash_link. + */ + remove_reader(block); + + /* If the block is not in eviction and not in free, we can free it. */ + if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | + BLOCK_REASSIGNED))) + { + /* + Free block as we are going to write directly to file. + Although we have an exlusive lock for the updated key part, + the control can be yielded by the current thread as we might + have unfinished readers of other key parts in the block + buffer. Still we are guaranteed not to have any readers + of the key part we are writing into until the block is + removed from the cache as we set the BLOCK_REASSIGNED + flag (see the code below that handles reading requests). + */ + free_block(keycache, block); + } + else + { + /* + The block will be evicted/freed soon. Don't touch it in any way. + Unregister the request that we registered above. + */ + unreg_request(keycache, block, 1); + + /* + The block is still assigned to the hash_link (the file/pos that + we are going to write to). Wait until the eviction/free is + complete. Otherwise the direct write could complete before all + readers are done with the block. So they could read outdated + data. + + Since we released our request on the hash_link, it can be reused + for another file/pos. Hence we cannot just check for + block->hash_link == hash_link. As long as the resize is + proceeding the block cannot be reassigned to the same file/pos + again. So we can terminate the loop when the block is no longer + assigned to this file/pos. + */ + do + { + wait_on_queue(&block->wqueue[COND_FOR_SAVED], + &keycache->cache_lock); + /* + If the flush phase failed, the resize could have finished + while we waited here. + */ + if (!keycache->in_resize) + goto restart; + } while (block->hash_link && + (block->hash_link->file == file) && + (block->hash_link->diskpos == filepos)); + } + DBUG_RETURN(0); + } + + if (page_status == PAGE_READ && + (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | + BLOCK_REASSIGNED))) + { + /* + This is a request for a block to be removed from cache. The block + is assigned to this hash_link and contains valid data, but is + marked for eviction or to be freed. Possible reasons why it has + not yet been evicted/freed can be a flush before reassignment + (BLOCK_IN_SWITCH), readers of the block have not finished yet + (BLOCK_REASSIGNED), or the evicting thread did not yet awake after + the block has been selected for it (BLOCK_IN_EVICTION). + */ + + KEYCACHE_DBUG_PRINT("find_key_block", + ("request for old page in block %u " + "wrmode: %d block->status: %d", + BLOCK_NUMBER(block), wrmode, block->status)); + /* + Only reading requests can proceed until the old dirty page is flushed, + all others are to be suspended, then resubmitted + */ + if (!wrmode && !(block->status & BLOCK_REASSIGNED)) + { + /* + This is a read request and the block not yet reassigned. We can + register our request and proceed. This unlinks the block from + the LRU ring and protects it against eviction. + */ + reg_requests(keycache, block, 1); + } + else + { + /* + Either this is a write request for a block that is in eviction + or in free. We must not use it any more. Instead we must evict + another block. But we cannot do this before the eviction/free is + done. Otherwise we would find the same hash_link + block again + and again. + + Or this is a read request for a block in eviction/free that does + not require a flush, but waits for readers to finish with the + block. We do not read this block to let the eviction/free happen + as soon as possible. Again we must wait so that we don't find + the same hash_link + block again and again. + */ + DBUG_ASSERT(hash_link->requests); + hash_link->requests--; + KEYCACHE_DBUG_PRINT("find_key_block", + ("request waiting for old page to be saved")); + wait_on_queue(&block->wqueue[COND_FOR_SAVED], &keycache->cache_lock); + KEYCACHE_DBUG_PRINT("find_key_block", + ("request for old page resubmitted")); + /* + The block is no longer assigned to this hash_link. + Get another one. + */ + goto restart; + } + } + else + { + /* + This is a request for a new block or for a block not to be removed. + Either + - block == NULL or + - block not assigned to this hash_link or + - block assigned but not yet read from file, + or + - block assigned with valid (changed or unchanged) data and + - it will not be reassigned/freed. + */ + if (! block) + { + /* No block is assigned to the hash_link yet. */ + if (keycache->blocks_unused) + { + if (keycache->free_block_list) + { + /* There is a block in the free list. */ + block= keycache->free_block_list; + keycache->free_block_list= block->next_used; + block->next_used= NULL; + } + else + { + size_t block_mem_offset; + /* There are some never used blocks, take first of them */ + DBUG_ASSERT(keycache->blocks_used < + (ulong) keycache->disk_blocks); + block= &keycache->block_root[keycache->blocks_used]; + block_mem_offset= + ((size_t) keycache->blocks_used) * keycache->key_cache_block_size; + block->buffer= ADD_TO_PTR(keycache->block_mem, + block_mem_offset, + uchar*); + keycache->blocks_used++; + DBUG_ASSERT(!block->next_used); + } + DBUG_ASSERT(!block->prev_used); + DBUG_ASSERT(!block->next_changed); + DBUG_ASSERT(!block->prev_changed); + DBUG_ASSERT(!block->hash_link); + DBUG_ASSERT(!block->status); + DBUG_ASSERT(!block->requests); + keycache->blocks_unused--; + block->status= BLOCK_IN_USE; + block->length= 0; + block->offset= keycache->key_cache_block_size; + block->requests= 1; + block->temperature= BLOCK_COLD; + block->hits_left= init_hits_left; + block->last_hit_time= 0; + block->hash_link= hash_link; + hash_link->block= block; + link_to_file_list(keycache, block, file, 0); + page_status= PAGE_TO_BE_READ; + KEYCACHE_DBUG_PRINT("find_key_block", + ("got free or never used block %u", + BLOCK_NUMBER(block))); + } + else + { + /* + There are no free blocks and no never used blocks, use a block + from the LRU ring. + */ + +#ifdef THREAD + if (! keycache->used_last) + { + /* + The LRU ring is empty. Wait until a new block is added to + it. Several threads might wait here for the same hash_link, + all of them must get the same block. While waiting for a + block, after a block is selected for this hash_link, other + threads can run first before this one awakes. During this + time interval other threads find this hash_link pointing to + the block, which is still assigned to another hash_link. In + this case the block is not marked BLOCK_IN_SWITCH yet, but + it is marked BLOCK_IN_EVICTION. + */ + + struct st_my_thread_var *thread= my_thread_var; + thread->opt_info= (void *) hash_link; + link_into_queue(&keycache->waiting_for_block, thread); + do + { + KEYCACHE_DBUG_PRINT("find_key_block: wait", + ("suspend thread %ld", thread->id)); + keycache_pthread_cond_wait(&thread->suspend, + &keycache->cache_lock); + } + while (thread->next); + thread->opt_info= NULL; + /* Assert that block has a request registered. */ + DBUG_ASSERT(hash_link->block->requests); + /* Assert that block is not in LRU ring. */ + DBUG_ASSERT(!hash_link->block->next_used); + DBUG_ASSERT(!hash_link->block->prev_used); + } +#else + KEYCACHE_DBUG_ASSERT(keycache->used_last); +#endif + /* + If we waited above, hash_link->block has been assigned by + link_block(). Otherwise it is still NULL. In the latter case + we need to grab a block from the LRU ring ourselves. + */ + block= hash_link->block; + if (! block) + { + /* Select the last block from the LRU ring. */ + block= keycache->used_last->next_used; + block->hits_left= init_hits_left; + block->last_hit_time= 0; + hash_link->block= block; + /* + Register a request on the block. This unlinks it from the + LRU ring and protects it against eviction. + */ + DBUG_ASSERT(!block->requests); + reg_requests(keycache, block,1); + /* + We do not need to set block->status|= BLOCK_IN_EVICTION here + because we will set block->status|= BLOCK_IN_SWITCH + immediately without releasing the lock in between. This does + also support debugging. When looking at the block, one can + see if the block has been selected by link_block() after the + LRU ring was empty, or if it was grabbed directly from the + LRU ring in this branch. + */ + } + + /* + If we had to wait above, there is a small chance that another + thread grabbed this block for the same file block already. But + in most cases the first condition is true. + */ + if (block->hash_link != hash_link && + ! (block->status & BLOCK_IN_SWITCH) ) + { + /* this is a primary request for a new page */ + block->status|= BLOCK_IN_SWITCH; + + KEYCACHE_DBUG_PRINT("find_key_block", + ("got block %u for new page", BLOCK_NUMBER(block))); + + if (block->status & BLOCK_CHANGED) + { + /* The block contains a dirty page - push it out of the cache */ + + KEYCACHE_DBUG_PRINT("find_key_block", ("block is dirty")); + if (block->status & BLOCK_IN_FLUSH) + { + /* + The block is marked for flush. If we do not wait here, + it could happen that we write the block, reassign it to + another file block, then, before the new owner can read + the new file block, the flusher writes the cache block + (which still has the old contents) to the new file block! + */ + wait_on_queue(&block->wqueue[COND_FOR_SAVED], + &keycache->cache_lock); + /* + The block is marked BLOCK_IN_SWITCH. It should be left + alone except for reading. No free, no write. + */ + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + DBUG_ASSERT(!(block->status & (BLOCK_REASSIGNED | + BLOCK_CHANGED | + BLOCK_FOR_UPDATE))); + } + else + { + block->status|= BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE; + /* + BLOCK_IN_EVICTION may be true or not. Other flags must + have a fixed value. + */ + DBUG_ASSERT((block->status & ~BLOCK_IN_EVICTION) == + (BLOCK_READ | BLOCK_IN_SWITCH | + BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE | + BLOCK_CHANGED | BLOCK_IN_USE)); + DBUG_ASSERT(block->hash_link); + + keycache_pthread_mutex_unlock(&keycache->cache_lock); + /* + The call is thread safe because only the current + thread might change the block->hash_link value + */ + error= key_cache_pwrite(block->hash_link->file, + block->buffer + block->offset, + block->length - block->offset, + block->hash_link->diskpos + + block->offset, + MYF(MY_NABP | MY_WAIT_IF_FULL), + keycache->post_write, + block->post_write_arg); + keycache_pthread_mutex_lock(&keycache->cache_lock); + + /* Block status must not have changed. */ + DBUG_ASSERT((block->status & ~BLOCK_IN_EVICTION) == + (BLOCK_READ | BLOCK_IN_SWITCH | + BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE | + BLOCK_CHANGED | BLOCK_IN_USE) || fail_block(block)); + keycache->global_cache_write++; + } + } + + block->status|= BLOCK_REASSIGNED; + /* + The block comes from the LRU ring. It must have a hash_link + assigned. + */ + DBUG_ASSERT(block->hash_link); + if (block->hash_link) + { + /* + All pending requests for this page must be resubmitted. + This must be done before waiting for readers. They could + wait for the flush to complete. And we must also do it + after the wait. Flushers might try to free the block while + we wait. They would wait until the reassignment is + complete. Also the block status must reflect the correct + situation: The block is not changed nor in flush any more. + Note that we must not change the BLOCK_CHANGED flag + outside of link_to_file_list() so that it is always in the + correct queue and the *blocks_changed counters are + correct. + */ + block->status&= ~(BLOCK_IN_FLUSH | BLOCK_IN_FLUSHWRITE); + link_to_file_list(keycache, block, block->hash_link->file, 1); + release_whole_queue(&block->wqueue[COND_FOR_SAVED]); + /* + The block is still assigned to its old hash_link. + Wait until all pending read requests + for this page are executed + (we could have avoided this waiting, if we had read + a page in the cache in a sweep, without yielding control) + */ + wait_for_readers(keycache, block); + DBUG_ASSERT(block->hash_link && block->hash_link->block == block && + block->prev_changed); + /* The reader must not have been a writer. */ + DBUG_ASSERT(!(block->status & BLOCK_CHANGED)); + + /* Wake flushers that might have found the block in between. */ + release_whole_queue(&block->wqueue[COND_FOR_SAVED]); + + /* Remove the hash link for the old file block from the hash. */ + unlink_hash(keycache, block->hash_link); + + /* + For sanity checks link_to_file_list() asserts that block + and hash_link refer to each other. Hence we need to assign + the hash_link first, but then we would not know if it was + linked before. Hence we would not know if to unlink it. So + unlink it here and call link_to_file_list(..., FALSE). + */ + unlink_changed(block); + } + block->status= error ? BLOCK_ERROR : BLOCK_IN_USE ; + block->length= 0; + block->offset= keycache->key_cache_block_size; + block->hash_link= hash_link; + link_to_file_list(keycache, block, file, 0); + page_status= PAGE_TO_BE_READ; + + KEYCACHE_DBUG_ASSERT(block->hash_link->block == block); + KEYCACHE_DBUG_ASSERT(hash_link->block->hash_link == hash_link); + } + else + { + /* + Either (block->hash_link == hash_link), + or (block->status & BLOCK_IN_SWITCH). + + This is for secondary requests for a new file block only. + Either it is already assigned to the new hash_link meanwhile + (if we had to wait due to empty LRU), or it is already in + eviction by another thread. Since this block has been + grabbed from the LRU ring and attached to this hash_link, + another thread cannot grab the same block from the LRU ring + anymore. If the block is in eviction already, it must become + attached to the same hash_link and as such destined for the + same file block. + */ + KEYCACHE_DBUG_PRINT("find_key_block", + ("block->hash_link: %p hash_link: %p " + "block->status: %u", block->hash_link, + hash_link, block->status )); + page_status= (((block->hash_link == hash_link) && + (block->status & BLOCK_READ)) ? + PAGE_READ : PAGE_WAIT_TO_BE_READ); + } + } + } + else + { + /* + Block is not NULL. This hash_link points to a block. + Either + - block not assigned to this hash_link (yet) or + - block assigned but not yet read from file, + or + - block assigned with valid (changed or unchanged) data and + - it will not be reassigned/freed. + + The first condition means hash_link points to a block in + eviction. This is not necessarily marked by BLOCK_IN_SWITCH yet. + But then it is marked BLOCK_IN_EVICTION. See the NOTE in + link_block(). In both cases it is destined for this hash_link + and its file block address. When this hash_link got its block + address, the block was removed from the LRU ring and cannot be + selected for eviction (for another hash_link) again. + + Register a request on the block. This is another protection + against eviction. + */ + DBUG_ASSERT(((block->hash_link != hash_link) && + (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))) || + ((block->hash_link == hash_link) && + !(block->status & BLOCK_READ)) || + ((block->status & BLOCK_READ) && + !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH)))); + reg_requests(keycache, block, 1); + KEYCACHE_DBUG_PRINT("find_key_block", + ("block->hash_link: %p hash_link: %p " + "block->status: %u", block->hash_link, + hash_link, block->status )); + page_status= (((block->hash_link == hash_link) && + (block->status & BLOCK_READ)) ? + PAGE_READ : PAGE_WAIT_TO_BE_READ); + } + } + + KEYCACHE_DBUG_ASSERT(page_status != -1); + /* Same assert basically, but be very sure. */ + KEYCACHE_DBUG_ASSERT(block); + /* Assert that block has a request and is not in LRU ring. */ + DBUG_ASSERT(block->requests); + DBUG_ASSERT(!block->next_used); + DBUG_ASSERT(!block->prev_used); + /* Assert that we return the correct block. */ + DBUG_ASSERT((page_status == PAGE_WAIT_TO_BE_READ) || + ((block->hash_link->file == file) && + (block->hash_link->diskpos == filepos))); + *page_st=page_status; + KEYCACHE_DBUG_PRINT("find_key_block", + ("fd: %d pos: %lu block->status: %u page_status: %d", + file, (ulong) filepos, block->status, + page_status)); + +#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) + DBUG_EXECUTE("check_keycache2", + test_key_cache(keycache, "end of find_key_block",0);); +#endif + KEYCACHE_THREAD_TRACE("find_key_block:end"); + DBUG_RETURN(block); +} + + +/* + Read into a key cache block buffer from disk. + + SYNOPSIS + + read_block() + keycache pointer to a key cache data structure + block block to which buffer the data is to be read + read_length size of data to be read + min_length at least so much data must be read + primary <-> the current thread will read the data + + RETURN VALUE + None + + NOTES. + The function either reads a page data from file to the block buffer, + or waits until another thread reads it. What page to read is determined + by a block parameter - reference to a hash link for this page. + If an error occurs THE BLOCK_ERROR bit is set in the block status. + We do not report error when the size of successfully read + portion is less than read_length, but not less than min_length. +*/ + +static void read_block(KEY_CACHE *keycache, + BLOCK_LINK *block, uint read_length, + uint min_length, my_bool primary) +{ + uint got_length; + + /* On entry cache_lock is locked */ + + KEYCACHE_THREAD_TRACE("read_block"); + if (primary) + { + /* + This code is executed only by threads that submitted primary + requests. Until block->status contains BLOCK_READ, all other + request for the block become secondary requests. For a primary + request the block must be properly initialized. + */ + DBUG_ASSERT(((block->status & ~BLOCK_FOR_UPDATE) == BLOCK_IN_USE) || + fail_block(block)); + DBUG_ASSERT((block->length == 0) || fail_block(block)); + DBUG_ASSERT((block->offset == keycache->key_cache_block_size) || + fail_block(block)); + DBUG_ASSERT((block->requests > 0) || fail_block(block)); + + KEYCACHE_DBUG_PRINT("read_block", + ("page to be read by primary request")); + + keycache->global_cache_read++; + /* Page is not in buffer yet, is to be read from disk */ + keycache_pthread_mutex_unlock(&keycache->cache_lock); + /* + Here other threads may step in and register as secondary readers. + They will register in block->wqueue[COND_FOR_REQUESTED]. + */ + got_length= my_pread(block->hash_link->file, block->buffer, + read_length, block->hash_link->diskpos, MYF(0)); + keycache_pthread_mutex_lock(&keycache->cache_lock); + /* + The block can now have been marked for free (in case of + FLUSH_RELEASE). Otherwise the state must be unchanged. + */ + DBUG_ASSERT(((block->status & ~(BLOCK_REASSIGNED | + BLOCK_FOR_UPDATE)) == BLOCK_IN_USE) || + fail_block(block)); + DBUG_ASSERT((block->length == 0) || fail_block(block)); + DBUG_ASSERT((block->offset == keycache->key_cache_block_size) || + fail_block(block)); + DBUG_ASSERT((block->requests > 0) || fail_block(block)); + + if (got_length < min_length) + block->status|= BLOCK_ERROR; + else + { + block->status|= BLOCK_READ; + block->length= got_length; + /* + Do not set block->offset here. If this block is marked + BLOCK_CHANGED later, we want to flush only the modified part. So + only a writer may set block->offset down from + keycache->key_cache_block_size. + */ + } + KEYCACHE_DBUG_PRINT("read_block", + ("primary request: new page in cache")); + /* Signal that all pending requests for this page now can be processed */ + release_whole_queue(&block->wqueue[COND_FOR_REQUESTED]); + } + else + { + /* + This code is executed only by threads that submitted secondary + requests. At this point it could happen that the cache block is + not yet assigned to the hash_link for the requested file block. + But at awake from the wait this should be the case. Unfortunately + we cannot assert this here because we do not know the hash_link + for the requested file block nor the file and position. So we have + to assert this in the caller. + */ + KEYCACHE_DBUG_PRINT("read_block", + ("secondary request waiting for new page to be read")); + wait_on_queue(&block->wqueue[COND_FOR_REQUESTED], &keycache->cache_lock); + KEYCACHE_DBUG_PRINT("read_block", + ("secondary request: new page in cache")); + } +} + + +/* + Read a block of data from a cached file into a buffer; + + SYNOPSIS + + key_cache_read() + keycache pointer to a key cache data structure + file handler for the file for the block of data to be read + filepos position of the block of data in the file + level determines the weight of the data + buff buffer to where the data must be placed + length length of the buffer + block_length length of the block in the key cache buffer + return_buffer return pointer to the key cache buffer with the data + + RETURN VALUE + Returns address from where the data is placed if sucessful, 0 - otherwise. + + NOTES. + The function ensures that a block of data of size length from file + positioned at filepos is in the buffers for some key cache blocks. + Then the function either copies the data into the buffer buff, or, + if return_buffer is TRUE, it just returns the pointer to the key cache + buffer with the data. + Filepos must be a multiple of 'block_length', but it doesn't + have to be a multiple of key_cache_block_size; +*/ + +uchar *key_cache_read(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length __attribute__((unused)), + int return_buffer __attribute__((unused))) +{ + my_bool locked_and_incremented= FALSE; + int error=0; + uchar *start= buff; + DBUG_ENTER("key_cache_read"); + DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", + (uint) file, (ulong) filepos, length)); + + if (keycache->key_cache_inited) + { + /* Key cache is used */ + reg1 BLOCK_LINK *block; + uint read_length; + uint offset; + int page_st; + + /* + When the key cache is once initialized, we use the cache_lock to + reliably distinguish the cases of normal operation, resizing, and + disabled cache. We always increment and decrement + 'cnt_for_resize_op' so that a resizer can wait for pending I/O. + */ + keycache_pthread_mutex_lock(&keycache->cache_lock); + /* + Cache resizing has two phases: Flushing and re-initializing. In + the flush phase read requests are allowed to bypass the cache for + blocks not in the cache. find_key_block() returns NULL in this + case. + + After the flush phase new I/O requests must wait until the + re-initialization is done. The re-initialization can be done only + if no I/O request is in progress. The reason is that + key_cache_block_size can change. With enabled cache, I/O is done + in chunks of key_cache_block_size. Every chunk tries to use a + cache block first. If the block size changes in the middle, a + block could be missed and old data could be read. + */ + while (keycache->in_resize && !keycache->resize_in_flush) + wait_on_queue(&keycache->resize_queue, &keycache->cache_lock); + /* Register the I/O for the next resize. */ + inc_counter_for_resize_op(keycache); + locked_and_incremented= TRUE; + /* Requested data may not always be aligned to cache blocks. */ + offset= (uint) (filepos % keycache->key_cache_block_size); + /* Read data in key_cache_block_size increments */ + do + { + /* Cache could be disabled in a later iteration. */ + + if (!keycache->can_be_used) + { + KEYCACHE_DBUG_PRINT("key_cache_read", ("keycache cannot be used")); + goto no_key_cache; + } + /* Start reading at the beginning of the cache block. */ + filepos-= offset; + /* Do not read beyond the end of the cache block. */ + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); + +#ifndef THREAD + if (block_length > keycache->key_cache_block_size || offset) + return_buffer=0; +#endif + + /* Request the cache block that matches file/pos. */ + keycache->global_cache_r_requests++; + block=find_key_block(keycache, file, filepos, level, 0, &page_st); + if (!block) + { + /* + This happens only for requests submitted during key cache + resize. The block is not in the cache and shall not go in. + Read directly from file. + */ + keycache->global_cache_read++; + keycache_pthread_mutex_unlock(&keycache->cache_lock); + error= (my_pread(file, (uchar*) buff, read_length, + filepos + offset, MYF(MY_NABP)) != 0); + keycache_pthread_mutex_lock(&keycache->cache_lock); + goto next_block; + } + if (!(block->status & BLOCK_ERROR)) + { + if (page_st != PAGE_READ) + { + /* The requested page is to be read into the block buffer */ + read_block(keycache, block, + keycache->key_cache_block_size, read_length+offset, + (my_bool)(page_st == PAGE_TO_BE_READ)); + /* + A secondary request must now have the block assigned to the + requested file block. It does not hurt to check it for + primary requests too. + */ + DBUG_ASSERT(keycache->can_be_used); + DBUG_ASSERT(block->hash_link->file == file); + DBUG_ASSERT(block->hash_link->diskpos == filepos); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + } + else if (block->length < read_length + offset) + { + /* + Impossible if nothing goes wrong: + this could only happen if we are using a file with + small key blocks and are trying to read outside the file + */ + my_errno= -1; + block->status|= BLOCK_ERROR; + } + } + + /* block status may have added BLOCK_ERROR in the above 'if'. */ + if (!(block->status & BLOCK_ERROR)) + { +#ifndef THREAD + if (! return_buffer) +#endif + { + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_unlock(&keycache->cache_lock); +#endif + + /* Copy data from the cache buffer */ + if (!(read_length & 511)) + bmove512(buff, block->buffer+offset, read_length); + else + memcpy(buff, block->buffer+offset, (size_t) read_length); + +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_lock(&keycache->cache_lock); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); +#endif + } + } + + remove_reader(block); + + /* Error injection for coverage testing. */ + DBUG_EXECUTE_IF("key_cache_read_block_error", + block->status|= BLOCK_ERROR;); + + /* Do not link erroneous blocks into the LRU ring, but free them. */ + if (!(block->status & BLOCK_ERROR)) + { + /* + Link the block into the LRU ring if it's the last submitted + request for the block. This enables eviction for the block. + */ + unreg_request(keycache, block, 1); + } + else + { + free_block(keycache, block); + error= 1; + break; + } + +#ifndef THREAD + /* This is only true if we where able to read everything in one block */ + if (return_buffer) + DBUG_RETURN(block->buffer); +#endif + next_block: + buff+= read_length; + filepos+= read_length+offset; + offset= 0; + + } while ((length-= read_length)); + goto end; + } + KEYCACHE_DBUG_PRINT("key_cache_read", ("keycache not initialized")); + +no_key_cache: + /* Key cache is not used */ + + keycache->global_cache_r_requests++; + keycache->global_cache_read++; + + if (locked_and_incremented) + keycache_pthread_mutex_unlock(&keycache->cache_lock); + if (my_pread(file, (uchar*) buff, length, filepos, MYF(MY_NABP))) + error= 1; + if (locked_and_incremented) + keycache_pthread_mutex_lock(&keycache->cache_lock); + +end: + if (locked_and_incremented) + { + dec_counter_for_resize_op(keycache); + keycache_pthread_mutex_unlock(&keycache->cache_lock); + } + DBUG_PRINT("exit", ("error: %d", error )); + DBUG_RETURN(error ? (uchar*) 0 : start); +} + + +/* + Insert a block of file data from a buffer into key cache + + SYNOPSIS + key_cache_insert() + keycache pointer to a key cache data structure + file handler for the file to insert data from + filepos position of the block of data in the file to insert + level determines the weight of the data + buff buffer to read data from + length length of the data in the buffer + + NOTES + This is used by MyISAM to move all blocks from a index file to the key + cache + + RETURN VALUE + 0 if a success, 1 - otherwise. +*/ + +int key_cache_insert(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length) +{ + int error= 0; + DBUG_ENTER("key_cache_insert"); + DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", + (uint) file,(ulong) filepos, length)); + + if (keycache->key_cache_inited) + { + /* Key cache is used */ + reg1 BLOCK_LINK *block; + uint read_length; + uint offset; + int page_st; + my_bool locked_and_incremented= FALSE; + + /* + When the keycache is once initialized, we use the cache_lock to + reliably distinguish the cases of normal operation, resizing, and + disabled cache. We always increment and decrement + 'cnt_for_resize_op' so that a resizer can wait for pending I/O. + */ + keycache_pthread_mutex_lock(&keycache->cache_lock); + /* + We do not load index data into a disabled cache nor into an + ongoing resize. + */ + if (!keycache->can_be_used || keycache->in_resize) + goto no_key_cache; + /* Register the pseudo I/O for the next resize. */ + inc_counter_for_resize_op(keycache); + locked_and_incremented= TRUE; + /* Loaded data may not always be aligned to cache blocks. */ + offset= (uint) (filepos % keycache->key_cache_block_size); + /* Load data in key_cache_block_size increments. */ + do + { + /* Cache could be disabled or resizing in a later iteration. */ + if (!keycache->can_be_used || keycache->in_resize) + goto no_key_cache; + /* Start loading at the beginning of the cache block. */ + filepos-= offset; + /* Do not load beyond the end of the cache block. */ + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); + + /* The block has been read by the caller already. */ + keycache->global_cache_read++; + /* Request the cache block that matches file/pos. */ + keycache->global_cache_r_requests++; + block= find_key_block(keycache, file, filepos, level, 0, &page_st); + if (!block) + { + /* + This happens only for requests submitted during key cache + resize. The block is not in the cache and shall not go in. + Stop loading index data. + */ + goto no_key_cache; + } + if (!(block->status & BLOCK_ERROR)) + { + if ((page_st == PAGE_WAIT_TO_BE_READ) || + ((page_st == PAGE_TO_BE_READ) && + (offset || (read_length < keycache->key_cache_block_size)))) + { + /* + Either + + this is a secondary request for a block to be read into the + cache. The block is in eviction. It is not yet assigned to + the requested file block (It does not point to the right + hash_link). So we cannot call remove_reader() on the block. + And we cannot access the hash_link directly here. We need to + wait until the assignment is complete. read_block() executes + the correct wait when called with primary == FALSE. + + Or + + this is a primary request for a block to be read into the + cache and the supplied data does not fill the whole block. + + This function is called on behalf of a LOAD INDEX INTO CACHE + statement, which is a read-only task and allows other + readers. It is possible that a parallel running reader tries + to access this block. If it needs more data than has been + supplied here, it would report an error. To be sure that we + have all data in the block that is available in the file, we + read the block ourselves. + + Though reading again what the caller did read already is an + expensive operation, we need to do this for correctness. + */ + read_block(keycache, block, keycache->key_cache_block_size, + read_length + offset, (page_st == PAGE_TO_BE_READ)); + /* + A secondary request must now have the block assigned to the + requested file block. It does not hurt to check it for + primary requests too. + */ + DBUG_ASSERT(keycache->can_be_used); + DBUG_ASSERT(block->hash_link->file == file); + DBUG_ASSERT(block->hash_link->diskpos == filepos); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + } + else if (page_st == PAGE_TO_BE_READ) + { + /* + This is a new block in the cache. If we come here, we have + data for the whole block. + */ + DBUG_ASSERT(block->hash_link->requests); + DBUG_ASSERT(block->status & BLOCK_IN_USE); + DBUG_ASSERT((page_st == PAGE_TO_BE_READ) || + (block->status & BLOCK_READ)); + +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_unlock(&keycache->cache_lock); + /* + Here other threads may step in and register as secondary readers. + They will register in block->wqueue[COND_FOR_REQUESTED]. + */ +#endif + + /* Copy data from buff */ + if (!(read_length & 511)) + bmove512(block->buffer+offset, buff, read_length); + else + memcpy(block->buffer+offset, buff, (size_t) read_length); + +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_lock(&keycache->cache_lock); + DBUG_ASSERT(block->status & BLOCK_IN_USE); + DBUG_ASSERT((page_st == PAGE_TO_BE_READ) || + (block->status & BLOCK_READ)); +#endif + /* + After the data is in the buffer, we can declare the block + valid. Now other threads do not need to register as + secondary readers any more. They can immediately access the + block. + */ + block->status|= BLOCK_READ; + block->length= read_length+offset; + /* + Do not set block->offset here. If this block is marked + BLOCK_CHANGED later, we want to flush only the modified part. So + only a writer may set block->offset down from + keycache->key_cache_block_size. + */ + KEYCACHE_DBUG_PRINT("key_cache_insert", + ("primary request: new page in cache")); + /* Signal all pending requests. */ + release_whole_queue(&block->wqueue[COND_FOR_REQUESTED]); + } + else + { + /* + page_st == PAGE_READ. The block is in the buffer. All data + must already be present. Blocks are always read with all + data available on file. Assert that the block does not have + less contents than the preloader supplies. If the caller has + data beyond block->length, it means that a file write has + been done while this block was in cache and not extended + with the new data. If the condition is met, we can simply + ignore the block. + */ + DBUG_ASSERT((page_st == PAGE_READ) && + (read_length + offset <= block->length)); + } + + /* + A secondary request must now have the block assigned to the + requested file block. It does not hurt to check it for primary + requests too. + */ + DBUG_ASSERT(block->hash_link->file == file); + DBUG_ASSERT(block->hash_link->diskpos == filepos); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + } /* end of if (!(block->status & BLOCK_ERROR)) */ + + + remove_reader(block); + + /* Error injection for coverage testing. */ + DBUG_EXECUTE_IF("key_cache_insert_block_error", + block->status|= BLOCK_ERROR; errno=EIO;); + + /* Do not link erroneous blocks into the LRU ring, but free them. */ + if (!(block->status & BLOCK_ERROR)) + { + /* + Link the block into the LRU ring if it's the last submitted + request for the block. This enables eviction for the block. + */ + unreg_request(keycache, block, 1); + } + else + { + free_block(keycache, block); + error= 1; + break; + } + + buff+= read_length; + filepos+= read_length+offset; + offset= 0; + + } while ((length-= read_length)); + + no_key_cache: + if (locked_and_incremented) + dec_counter_for_resize_op(keycache); + keycache_pthread_mutex_unlock(&keycache->cache_lock); + } + DBUG_RETURN(error); +} + + +/* + Write a buffer into a cached file. + + SYNOPSIS + + key_cache_write() + keycache pointer to a key cache data structure + file handler for the file to write data to + filepos position in the file to write data to + level determines the weight of the data + buff buffer with the data + length length of the buffer + dont_write if is 0 then all dirty pages involved in writing + should have been flushed from key cache + post_write_arg argument which will be passed to key cache's + post_write callback + + RETURN VALUE + 0 if a success, 1 - otherwise. + + NOTES. + The function copies the data of size length from buff into buffers + for key cache blocks that are assigned to contain the portion of + the file starting with position filepos. + It ensures that this data is flushed to the file if dont_write is FALSE. + Filepos must be a multiple of 'block_length', but it doesn't + have to be a multiple of key_cache_block_size; + + dont_write is always TRUE in the server (info->lock_type is never F_UNLCK). +*/ + +int key_cache_write(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length __attribute__((unused)), + int dont_write, + void *post_write_arg) +{ + my_bool locked_and_incremented= FALSE; + int error=0; + DBUG_ENTER("key_cache_write"); + DBUG_PRINT("enter", + ("fd: %u pos: %lu length: %u block_length: %u" + " key_block_length: %u", + (uint) file, (ulong) filepos, length, block_length, + keycache ? keycache->key_cache_block_size : 0)); + + if (!dont_write) + { + /* purecov: begin inspected */ + /* Not used in the server. */ + /* Force writing from buff into disk. */ + keycache->global_cache_w_requests++; + keycache->global_cache_write++; + if (key_cache_pwrite(file, buff, length, filepos, + MYF(MY_NABP | MY_WAIT_IF_FULL), + keycache->post_write, post_write_arg)) + DBUG_RETURN(1); + /* purecov: end */ + } + +#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) + DBUG_EXECUTE("check_keycache", + test_key_cache(keycache, "start of key_cache_write", 1);); +#endif + + if (keycache->key_cache_inited) + { + /* Key cache is used */ + reg1 BLOCK_LINK *block; + uint read_length; + uint offset; + int page_st; + + /* + When the key cache is once initialized, we use the cache_lock to + reliably distinguish the cases of normal operation, resizing, and + disabled cache. We always increment and decrement + 'cnt_for_resize_op' so that a resizer can wait for pending I/O. + */ + keycache_pthread_mutex_lock(&keycache->cache_lock); + /* + Cache resizing has two phases: Flushing and re-initializing. In + the flush phase write requests can modify dirty blocks that are + not yet in flush. Otherwise they are allowed to bypass the cache. + find_key_block() returns NULL in both cases (clean blocks and + non-cached blocks). + + After the flush phase new I/O requests must wait until the + re-initialization is done. The re-initialization can be done only + if no I/O request is in progress. The reason is that + key_cache_block_size can change. With enabled cache I/O is done in + chunks of key_cache_block_size. Every chunk tries to use a cache + block first. If the block size changes in the middle, a block + could be missed and data could be written below a cached block. + */ + while (keycache->in_resize && !keycache->resize_in_flush) + wait_on_queue(&keycache->resize_queue, &keycache->cache_lock); + /* Register the I/O for the next resize. */ + inc_counter_for_resize_op(keycache); + locked_and_incremented= TRUE; + /* Requested data may not always be aligned to cache blocks. */ + offset= (uint) (filepos % keycache->key_cache_block_size); + /* Write data in key_cache_block_size increments. */ + do + { + /* Cache could be disabled in a later iteration. */ + if (!keycache->can_be_used) + goto no_key_cache; + /* Start writing at the beginning of the cache block. */ + filepos-= offset; + /* Do not write beyond the end of the cache block. */ + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); + + /* Request the cache block that matches file/pos. */ + keycache->global_cache_w_requests++; + block= find_key_block(keycache, file, filepos, level, 1, &page_st); + if (!block) + { + /* + This happens only for requests submitted during key cache + resize. The block is not in the cache and shall not go in. + Write directly to file. + */ + if (dont_write) + { + /* Used in the server. */ + keycache->global_cache_write++; + keycache_pthread_mutex_unlock(&keycache->cache_lock); + if (key_cache_pwrite(file, (uchar*) buff, read_length, + filepos + offset, + MYF(MY_NABP | MY_WAIT_IF_FULL), + keycache->post_write, post_write_arg)) + error=1; + keycache_pthread_mutex_lock(&keycache->cache_lock); + } + goto next_block; + } + /* + Prevent block from flushing and from being selected for to be + freed. This must be set when we release the cache_lock. + However, we must not set the status of the block before it is + assigned to this file/pos. + */ + if (page_st != PAGE_WAIT_TO_BE_READ) + block->status|= BLOCK_FOR_UPDATE; + /* + We must read the file block first if it is not yet in the cache + and we do not replace all of its contents. + + In cases where the cache block is big enough to contain (parts + of) index blocks of different indexes, our request can be + secondary (PAGE_WAIT_TO_BE_READ). In this case another thread is + reading the file block. If the read completes after us, it + overwrites our new contents with the old contents. So we have to + wait for the other thread to complete the read of this block. + read_block() takes care for the wait. + */ + if (!(block->status & BLOCK_ERROR) && + ((page_st == PAGE_TO_BE_READ && + (offset || read_length < keycache->key_cache_block_size)) || + (page_st == PAGE_WAIT_TO_BE_READ))) + { + read_block(keycache, block, + offset + read_length >= keycache->key_cache_block_size? + offset : keycache->key_cache_block_size, + offset, (page_st == PAGE_TO_BE_READ)); + DBUG_ASSERT(keycache->can_be_used); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + /* + Prevent block from flushing and from being selected for to be + freed. This must be set when we release the cache_lock. + Here we set it in case we could not set it above. + */ + block->status|= BLOCK_FOR_UPDATE; + } + /* + The block should always be assigned to the requested file block + here. It need not be BLOCK_READ when overwriting the whole block. + */ + DBUG_ASSERT(block->hash_link->file == file); + DBUG_ASSERT(block->hash_link->diskpos == filepos); + DBUG_ASSERT(block->status & BLOCK_IN_USE); + DBUG_ASSERT((page_st == PAGE_TO_BE_READ) || (block->status & BLOCK_READ)); + /* + The block to be written must not be marked BLOCK_REASSIGNED. + Otherwise it could be freed in dirty state or reused without + another flush during eviction. It must also not be in flush. + Otherwise the old contens may have been flushed already and + the flusher could clear BLOCK_CHANGED without flushing the + new changes again. + */ + DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED)); + + while (block->status & BLOCK_IN_FLUSHWRITE) + { + /* + Another thread is flushing the block. It was dirty already. + Wait until the block is flushed to file. Otherwise we could + modify the buffer contents just while it is written to file. + An unpredictable file block contents would be the result. + While we wait, several things can happen to the block, + including another flush. But the block cannot be reassigned to + another hash_link until we release our request on it. + */ + wait_on_queue(&block->wqueue[COND_FOR_SAVED], &keycache->cache_lock); + DBUG_ASSERT(keycache->can_be_used); + DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE)); + /* Still must not be marked for free. */ + DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED)); + DBUG_ASSERT(block->hash_link && (block->hash_link->block == block)); + } + + /* + We could perhaps release the cache_lock during access of the + data like in the other functions. Locks outside of the key cache + assure that readers and a writer do not access the same range of + data. Parallel accesses should happen only if the cache block + contains multiple index block(fragment)s. So different parts of + the buffer would be read/written. An attempt to flush during + memcpy() is prevented with BLOCK_FOR_UPDATE. + */ + if (!(block->status & BLOCK_ERROR)) + { + block->post_write_arg= post_write_arg; +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_unlock(&keycache->cache_lock); +#endif + if (!(read_length & 511)) + bmove512(block->buffer+offset, buff, read_length); + else + memcpy(block->buffer+offset, buff, (size_t) read_length); + +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_lock(&keycache->cache_lock); +#endif + } + + if (!dont_write) + { + /* Not used in the server. buff has been written to disk at start. */ + if ((block->status & BLOCK_CHANGED) && + (!offset && read_length >= keycache->key_cache_block_size)) + link_to_file_list(keycache, block, block->hash_link->file, 1); + } + else if (! (block->status & BLOCK_CHANGED)) + link_to_changed_list(keycache, block); + block->status|=BLOCK_READ; + /* + Allow block to be selected for to be freed. Since it is marked + BLOCK_CHANGED too, it won't be selected for to be freed without + a flush. + */ + block->status&= ~BLOCK_FOR_UPDATE; + set_if_smaller(block->offset, offset); + set_if_bigger(block->length, read_length+offset); + + /* Threads may be waiting for the changes to be complete. */ + release_whole_queue(&block->wqueue[COND_FOR_REQUESTED]); + + /* + If only a part of the cache block is to be replaced, and the + rest has been read from file, then the cache lock has been + released for I/O and it could be possible that another thread + wants to evict or free the block and waits for it to be + released. So we must not just decrement hash_link->requests, but + also wake a waiting thread. + */ + remove_reader(block); + + /* Error injection for coverage testing. */ + DBUG_EXECUTE_IF("key_cache_write_block_error", + block->status|= BLOCK_ERROR;); + + /* Do not link erroneous blocks into the LRU ring, but free them. */ + if (!(block->status & BLOCK_ERROR)) + { + /* + Link the block into the LRU ring if it's the last submitted + request for the block. This enables eviction for the block. + */ + unreg_request(keycache, block, 1); + } + else + { + /* Pretend a "clean" block to avoid complications. */ + block->status&= ~(BLOCK_CHANGED); + free_block(keycache, block); + error= 1; + break; + } + + next_block: + buff+= read_length; + filepos+= read_length+offset; + offset= 0; + + } while ((length-= read_length)); + goto end; + } + +no_key_cache: + /* Key cache is not used */ + if (dont_write) + { + /* Used in the server. */ + keycache->global_cache_w_requests++; + keycache->global_cache_write++; + if (locked_and_incremented) + keycache_pthread_mutex_unlock(&keycache->cache_lock); + if (key_cache_pwrite(file, (uchar*) buff, length, filepos, + MYF(MY_NABP | MY_WAIT_IF_FULL), + keycache->post_write, post_write_arg)) + error=1; + if (locked_and_incremented) + keycache_pthread_mutex_lock(&keycache->cache_lock); + } + +end: + if (locked_and_incremented) + { + dec_counter_for_resize_op(keycache); + keycache_pthread_mutex_unlock(&keycache->cache_lock); + } +#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) + DBUG_EXECUTE("exec", + test_key_cache(keycache, "end of key_cache_write", 1);); +#endif + DBUG_RETURN(error); +} + + +/* + Free block. + + SYNOPSIS + free_block() + keycache Pointer to a key cache data structure + block Pointer to the block to free + + DESCRIPTION + Remove reference to block from hash table. + Remove block from the chain of clean blocks. + Add block to the free list. + + NOTE + Block must not be free (status == 0). + Block must not be in free_block_list. + Block must not be in the LRU ring. + Block must not be in eviction (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH). + Block must not be in free (BLOCK_REASSIGNED). + Block must not be in flush (BLOCK_IN_FLUSH). + Block must not be dirty (BLOCK_CHANGED). + Block must not be in changed_blocks (dirty) hash. + Block must be in file_blocks (clean) hash. + Block must refer to a hash_link. + Block must have a request registered on it. +*/ + +static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block) +{ + KEYCACHE_THREAD_TRACE("free block"); + KEYCACHE_DBUG_PRINT("free_block", + ("block %u to be freed, hash_link %p status: %u", + BLOCK_NUMBER(block), block->hash_link, + block->status)); + /* + Assert that the block is not free already. And that it is in a clean + state. Note that the block might just be assigned to a hash_link and + not yet read (BLOCK_READ may not be set here). In this case a reader + is registered in the hash_link and free_block() will wait for it + below. + */ + DBUG_ASSERT((block->status & BLOCK_IN_USE) && + !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | + BLOCK_REASSIGNED | BLOCK_IN_FLUSH | + BLOCK_CHANGED | BLOCK_FOR_UPDATE))); + /* Assert that the block is in a file_blocks chain. */ + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + /* Assert that the block is not in the LRU ring. */ + DBUG_ASSERT(!block->next_used && !block->prev_used); + /* + IMHO the below condition (if()) makes no sense. I can't see how it + could be possible that free_block() is entered with a NULL hash_link + pointer. The only place where it can become NULL is in free_block() + (or before its first use ever, but for those blocks free_block() is + not called). I don't remove the conditional as it cannot harm, but + place an DBUG_ASSERT to confirm my hypothesis. Eventually the + condition (if()) can be removed. + */ + DBUG_ASSERT(block->hash_link && block->hash_link->block == block); + if (block->hash_link) + { + /* + While waiting for readers to finish, new readers might request the + block. But since we set block->status|= BLOCK_REASSIGNED, they + will wait on block->wqueue[COND_FOR_SAVED]. They must be signalled + later. + */ + block->status|= BLOCK_REASSIGNED; + wait_for_readers(keycache, block); + /* + The block must not have been freed by another thread. Repeat some + checks. An additional requirement is that it must be read now + (BLOCK_READ). + */ + DBUG_ASSERT(block->hash_link && block->hash_link->block == block); + DBUG_ASSERT((block->status & (BLOCK_READ | BLOCK_IN_USE | + BLOCK_REASSIGNED)) && + !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | + BLOCK_IN_FLUSH | BLOCK_CHANGED | + BLOCK_FOR_UPDATE))); + DBUG_ASSERT(block->prev_changed && *block->prev_changed == block); + DBUG_ASSERT(!block->prev_used); + /* + Unset BLOCK_REASSIGNED again. If we hand the block to an evicting + thread (through unreg_request() below), other threads must not see + this flag. They could become confused. + */ + block->status&= ~BLOCK_REASSIGNED; + /* + Do not release the hash_link until the block is off all lists. + At least not if we hand it over for eviction in unreg_request(). + */ + } + + /* + Unregister the block request and link the block into the LRU ring. + This enables eviction for the block. If the LRU ring was empty and + threads are waiting for a block, then the block wil be handed over + for eviction immediately. Otherwise we will unlink it from the LRU + ring again, without releasing the lock in between. So decrementing + the request counter and updating statistics are the only relevant + operation in this case. Assert that there are no other requests + registered. + */ + DBUG_ASSERT(block->requests == 1); + unreg_request(keycache, block, 0); + /* + Note that even without releasing the cache lock it is possible that + the block is immediately selected for eviction by link_block() and + thus not added to the LRU ring. In this case we must not touch the + block any more. + */ + if (block->status & BLOCK_IN_EVICTION) + return; + + /* Error blocks are not put into the LRU ring. */ + if (!(block->status & BLOCK_ERROR)) + { + /* Here the block must be in the LRU ring. Unlink it again. */ + DBUG_ASSERT(block->next_used && block->prev_used && + *block->prev_used == block); + unlink_block(keycache, block); + } + if (block->temperature == BLOCK_WARM) + keycache->warm_blocks--; + block->temperature= BLOCK_COLD; + + /* Remove from file_blocks hash. */ + unlink_changed(block); + + /* Remove reference to block from hash table. */ + unlink_hash(keycache, block->hash_link); + block->hash_link= NULL; + + block->status= 0; + block->length= 0; + block->offset= keycache->key_cache_block_size; + KEYCACHE_THREAD_TRACE("free block"); + KEYCACHE_DBUG_PRINT("free_block", ("block is freed")); + + /* Enforced by unlink_changed(), but just to be sure. */ + DBUG_ASSERT(!block->next_changed && !block->prev_changed); + /* Enforced by unlink_block(): not in LRU ring nor in free_block_list. */ + DBUG_ASSERT(!block->next_used && !block->prev_used); + /* Insert the free block in the free list. */ + block->next_used= keycache->free_block_list; + keycache->free_block_list= block; + /* Keep track of the number of currently unused blocks. */ + keycache->blocks_unused++; + + /* All pending requests for this page must be resubmitted. */ + release_whole_queue(&block->wqueue[COND_FOR_SAVED]); +} + + +static int cmp_sec_link(BLOCK_LINK **a, BLOCK_LINK **b) +{ + return (((*a)->hash_link->diskpos < (*b)->hash_link->diskpos) ? -1 : + ((*a)->hash_link->diskpos > (*b)->hash_link->diskpos) ? 1 : 0); +} + + +/* + Flush a portion of changed blocks to disk, + free used blocks if requested +*/ + +static int flush_cached_blocks(KEY_CACHE *keycache, + File file, BLOCK_LINK **cache, + BLOCK_LINK **end, + enum flush_type type) +{ + int error; + int last_errno= 0; + uint count= (uint) (end-cache); + + /* Don't lock the cache during the flush */ + keycache_pthread_mutex_unlock(&keycache->cache_lock); + /* + As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH + we are guarunteed no thread will change them + */ + my_qsort((uchar*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link); + + keycache_pthread_mutex_lock(&keycache->cache_lock); + /* + Note: Do not break the loop. We have registered a request on every + block in 'cache'. These must be unregistered by free_block() or + unreg_request(). + */ + for ( ; cache != end ; cache++) + { + BLOCK_LINK *block= *cache; + + KEYCACHE_DBUG_PRINT("flush_cached_blocks", + ("block %u to be flushed", BLOCK_NUMBER(block))); + /* + If the block contents is going to be changed, we abandon the flush + for this block. flush_key_blocks_int() will restart its search and + handle the block properly. + */ + if (!(block->status & BLOCK_FOR_UPDATE)) + { + /* Blocks coming here must have a certain status. */ + DBUG_ASSERT(block->hash_link); + DBUG_ASSERT(block->hash_link->block == block); + DBUG_ASSERT(block->hash_link->file == file); + DBUG_ASSERT((block->status & ~BLOCK_IN_EVICTION) == + (BLOCK_READ | BLOCK_IN_FLUSH | BLOCK_CHANGED | BLOCK_IN_USE)); + block->status|= BLOCK_IN_FLUSHWRITE; + keycache_pthread_mutex_unlock(&keycache->cache_lock); + error= key_cache_pwrite(file, + block->buffer+block->offset, + block->length - block->offset, + block->hash_link->diskpos+ block->offset, + MYF(MY_NABP | MY_WAIT_IF_FULL), + keycache->post_write, block->post_write_arg); + keycache_pthread_mutex_lock(&keycache->cache_lock); + keycache->global_cache_write++; + if (error) + { + block->status|= BLOCK_ERROR; + if (!last_errno) + last_errno= errno ? errno : -1; + } + block->status&= ~BLOCK_IN_FLUSHWRITE; + /* Block must not have changed status except BLOCK_FOR_UPDATE. */ + DBUG_ASSERT(block->hash_link); + DBUG_ASSERT(block->hash_link->block == block); + DBUG_ASSERT(block->hash_link->file == file); + DBUG_ASSERT((block->status & ~(BLOCK_FOR_UPDATE | BLOCK_IN_EVICTION)) == + (BLOCK_READ | BLOCK_IN_FLUSH | BLOCK_CHANGED | BLOCK_IN_USE)); + /* + Set correct status and link in right queue for free or later use. + free_block() must not see BLOCK_CHANGED and it may need to wait + for readers of the block. These should not see the block in the + wrong hash. If not freeing the block, we need to have it in the + right queue anyway. + */ + link_to_file_list(keycache, block, file, 1); + + } + block->status&= ~BLOCK_IN_FLUSH; + /* + Let to proceed for possible waiting requests to write to the block page. + It might happen only during an operation to resize the key cache. + */ + release_whole_queue(&block->wqueue[COND_FOR_SAVED]); + /* type will never be FLUSH_IGNORE_CHANGED here */ + if (!(type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE) && + !(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | + BLOCK_FOR_UPDATE))) + { + /* + Note that a request has been registered against the block in + flush_key_blocks_int(). + */ + free_block(keycache, block); + } + else + { + /* + Link the block into the LRU ring if it's the last submitted + request for the block. This enables eviction for the block. + Note that a request has been registered against the block in + flush_key_blocks_int(). + */ + unreg_request(keycache, block, 1); + } + + } /* end of for ( ; cache != end ; cache++) */ + return last_errno; +} + + +/* + flush all key blocks for a file to disk, but don't do any mutex locks. + + SYNOPSIS + flush_key_blocks_int() + keycache pointer to a key cache data structure + file handler for the file to flush to + flush_type type of the flush + + NOTES + This function doesn't do any mutex locks because it needs to be called both + from flush_key_blocks and flush_all_key_blocks (the later one does the + mutex lock in the resize_key_cache() function). + + We do only care about changed blocks that exist when the function is + entered. We do not guarantee that all changed blocks of the file are + flushed if more blocks change while this function is running. + + RETURN + 0 ok + 1 error +*/ + +static int flush_key_blocks_int(KEY_CACHE *keycache, + File file, enum flush_type type) +{ + BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache; + int last_errno= 0; + int last_errcnt= 0; + DBUG_ENTER("flush_key_blocks_int"); + DBUG_PRINT("enter",("file: %d blocks_used: %lu blocks_changed: %lu", + file, keycache->blocks_used, keycache->blocks_changed)); + +#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) + DBUG_EXECUTE("check_keycache", + test_key_cache(keycache, "start of flush_key_blocks", 0);); +#endif + + DBUG_ASSERT(type != FLUSH_KEEP_LAZY); + cache= cache_buff; + if (keycache->disk_blocks > 0 && + (!my_disable_flush_key_blocks || type != FLUSH_KEEP)) + { + /* Key cache exists and flush is not disabled */ + int error= 0; + uint count= FLUSH_CACHE; + BLOCK_LINK **pos,**end; + BLOCK_LINK *first_in_switch= NULL; + BLOCK_LINK *last_in_flush; + BLOCK_LINK *last_for_update; + BLOCK_LINK *block, *next; +#if defined(KEYCACHE_DEBUG) + uint cnt=0; +#endif + + if (type != FLUSH_IGNORE_CHANGED) + { + /* + Count how many key blocks we have to cache to be able + to flush all dirty pages with minimum seek moves + */ + count= 0; + for (block= keycache->changed_blocks[FILE_HASH(file)] ; + block ; + block= block->next_changed) + { + if ((block->hash_link->file == file) && + !(block->status & BLOCK_IN_FLUSH)) + { + count++; + KEYCACHE_DBUG_ASSERT(count<= keycache->blocks_used); + } + } + /* + Allocate a new buffer only if its bigger than the one we have. + Assure that we always have some entries for the case that new + changed blocks appear while we need to wait for something. + */ + if ((count > FLUSH_CACHE) && + !(cache= (BLOCK_LINK**) my_malloc(sizeof(BLOCK_LINK*)*count, + MYF(0)))) + cache= cache_buff; + /* + After a restart there could be more changed blocks than now. + So we should not let count become smaller than the fixed buffer. + */ + if (cache == cache_buff) + count= FLUSH_CACHE; + } + + /* Retrieve the blocks and write them to a buffer to be flushed */ +restart: + last_in_flush= NULL; + last_for_update= NULL; + end= (pos= cache)+count; + for (block= keycache->changed_blocks[FILE_HASH(file)] ; + block ; + block= next) + { +#if defined(KEYCACHE_DEBUG) + cnt++; + KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used); +#endif + next= block->next_changed; + if (block->hash_link->file == file) + { + if (!(block->status & (BLOCK_IN_FLUSH | BLOCK_FOR_UPDATE))) + { + /* + Note: The special handling of BLOCK_IN_SWITCH is obsolete + since we set BLOCK_IN_FLUSH if the eviction includes a + flush. It can be removed in a later version. + */ + if (!(block->status & BLOCK_IN_SWITCH)) + { + /* + We care only for the blocks for which flushing was not + initiated by another thread and which are not in eviction. + Registering a request on the block unlinks it from the LRU + ring and protects against eviction. + */ + reg_requests(keycache, block, 1); + if (type != FLUSH_IGNORE_CHANGED) + { + /* It's not a temporary file */ + if (pos == end) + { + /* + This should happen relatively seldom. Remove the + request because we won't do anything with the block + but restart and pick it again in the next iteration. + */ + unreg_request(keycache, block, 0); + /* + This happens only if there is not enough + memory for the big block + */ + if ((error= flush_cached_blocks(keycache, file, cache, + end,type))) + { + /* Do not loop infinitely trying to flush in vain. */ + if ((last_errno == error) && (++last_errcnt > 5)) + goto err; + last_errno= error; + } + /* + Restart the scan as some other thread might have changed + the changed blocks chain: the blocks that were in switch + state before the flush started have to be excluded + */ + goto restart; + } + /* + Mark the block with BLOCK_IN_FLUSH in order not to let + other threads to use it for new pages and interfere with + our sequence of flushing dirty file pages. We must not + set this flag before actually putting the block on the + write burst array called 'cache'. + */ + block->status|= BLOCK_IN_FLUSH; + /* Add block to the array for a write burst. */ + *pos++= block; + } + else + { + /* It's a temporary file */ + DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED)); + + /* + free_block() must not be called with BLOCK_CHANGED. Note + that we must not change the BLOCK_CHANGED flag outside of + link_to_file_list() so that it is always in the correct + queue and the *blocks_changed counters are correct. + */ + link_to_file_list(keycache, block, file, 1); + if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH))) + { + /* A request has been registered against the block above. */ + free_block(keycache, block); + } + else + { + /* + Link the block into the LRU ring if it's the last + submitted request for the block. This enables eviction + for the block. A request has been registered against + the block above. + */ + unreg_request(keycache, block, 1); + } + } + } + else + { + /* + Link the block into a list of blocks 'in switch'. + + WARNING: Here we introduce a place where a changed block + is not in the changed_blocks hash! This is acceptable for + a BLOCK_IN_SWITCH. Never try this for another situation. + Other parts of the key cache code rely on changed blocks + being in the changed_blocks hash. + */ + unlink_changed(block); + link_changed(block, &first_in_switch); + } + } + else if (type != FLUSH_KEEP) + { + /* + During the normal flush at end of statement (FLUSH_KEEP) we + do not need to ensure that blocks in flush or update by + other threads are flushed. They will be flushed by them + later. In all other cases we must assure that we do not have + any changed block of this file in the cache when this + function returns. + */ + if (block->status & BLOCK_IN_FLUSH) + { + /* Remember the last block found to be in flush. */ + last_in_flush= block; + } + else + { + /* Remember the last block found to be selected for update. */ + last_for_update= block; + } + } + } + } + if (pos != cache) + { + if ((error= flush_cached_blocks(keycache, file, cache, pos, type))) + { + /* Do not loop inifnitely trying to flush in vain. */ + if ((last_errno == error) && (++last_errcnt > 5)) + goto err; + last_errno= error; + } + /* + Do not restart here during the normal flush at end of statement + (FLUSH_KEEP). We have now flushed at least all blocks that were + changed when entering this function. In all other cases we must + assure that we do not have any changed block of this file in the + cache when this function returns. + */ + if (type != FLUSH_KEEP) + goto restart; + } + if (last_in_flush) + { + /* + There are no blocks to be flushed by this thread, but blocks in + flush by other threads. Wait until one of the blocks is flushed. + Re-check the condition for last_in_flush. We may have unlocked + the cache_lock in flush_cached_blocks(). The state of the block + could have changed. + */ + if (last_in_flush->status & BLOCK_IN_FLUSH) + wait_on_queue(&last_in_flush->wqueue[COND_FOR_SAVED], + &keycache->cache_lock); + /* Be sure not to lose a block. They may be flushed in random order. */ + goto restart; + } + if (last_for_update) + { + /* + There are no blocks to be flushed by this thread, but blocks for + update by other threads. Wait until one of the blocks is updated. + Re-check the condition for last_for_update. We may have unlocked + the cache_lock in flush_cached_blocks(). The state of the block + could have changed. + */ + if (last_for_update->status & BLOCK_FOR_UPDATE) + wait_on_queue(&last_for_update->wqueue[COND_FOR_REQUESTED], + &keycache->cache_lock); + /* The block is now changed. Flush it. */ + goto restart; + } + + /* + Wait until the list of blocks in switch is empty. The threads that + are switching these blocks will relink them to clean file chains + while we wait and thus empty the 'first_in_switch' chain. + */ + while (first_in_switch) + { +#if defined(KEYCACHE_DEBUG) + cnt= 0; +#endif + wait_on_queue(&first_in_switch->wqueue[COND_FOR_SAVED], + &keycache->cache_lock); +#if defined(KEYCACHE_DEBUG) + cnt++; + KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used); +#endif + /* + Do not restart here. We have flushed all blocks that were + changed when entering this function and were not marked for + eviction. Other threads have now flushed all remaining blocks in + the course of their eviction. + */ + } + + if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE)) + { + BLOCK_LINK *last_for_update= NULL; + BLOCK_LINK *last_in_switch= NULL; + uint total_found= 0; + uint found; + + /* + Finally free all clean blocks for this file. + During resize this may be run by two threads in parallel. + */ + do + { + found= 0; + for (block= keycache->file_blocks[FILE_HASH(file)] ; + block ; + block= next) + { + /* Remember the next block. After freeing we cannot get at it. */ + next= block->next_changed; + + /* Changed blocks cannot appear in the file_blocks hash. */ + DBUG_ASSERT(!(block->status & BLOCK_CHANGED)); + if (block->hash_link->file == file) + { + /* We must skip blocks that will be changed. */ + if (block->status & BLOCK_FOR_UPDATE) + { + last_for_update= block; + continue; + } + + /* + We must not free blocks in eviction (BLOCK_IN_EVICTION | + BLOCK_IN_SWITCH) or blocks intended to be freed + (BLOCK_REASSIGNED). + */ + if (!(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH | + BLOCK_REASSIGNED))) + { + struct st_hash_link *next_hash_link; + my_off_t next_diskpos; + File next_file; + uint next_status; + uint hash_requests; + + total_found++; + found++; + KEYCACHE_DBUG_ASSERT(found <= keycache->blocks_used); + + /* + Register a request. This unlinks the block from the LRU + ring and protects it against eviction. This is required + by free_block(). + */ + reg_requests(keycache, block, 1); + + /* + free_block() may need to wait for readers of the block. + This is the moment where the other thread can move the + 'next' block from the chain. free_block() needs to wait + if there are requests for the block pending. + */ + if (next && (hash_requests= block->hash_link->requests)) + { + /* Copy values from the 'next' block and its hash_link. */ + next_status= next->status; + next_hash_link= next->hash_link; + next_diskpos= next_hash_link->diskpos; + next_file= next_hash_link->file; + DBUG_ASSERT(next == next_hash_link->block); + } + + free_block(keycache, block); + /* + If we had to wait and the state of the 'next' block + changed, break the inner loop. 'next' may no longer be + part of the current chain. + + We do not want to break the loop after every free_block(), + not even only after waits. The chain might be quite long + and contain blocks for many files. Traversing it again and + again to find more blocks for this file could become quite + inefficient. + */ + if (next && hash_requests && + ((next_status != next->status) || + (next_hash_link != next->hash_link) || + (next_file != next_hash_link->file) || + (next_diskpos != next_hash_link->diskpos) || + (next != next_hash_link->block))) + break; + } + else + { + last_in_switch= block; + } + } + } /* end for block in file_blocks */ + } while (found); + + /* + If any clean block has been found, we may have waited for it to + become free. In this case it could be possible that another clean + block became dirty. This is possible if the write request existed + before the flush started (BLOCK_FOR_UPDATE). Re-check the hashes. + */ + if (total_found) + goto restart; + + /* + To avoid an infinite loop, wait until one of the blocks marked + for update is updated. + */ + if (last_for_update) + { + /* We did not wait. Block must not have changed status. */ + DBUG_ASSERT(last_for_update->status & BLOCK_FOR_UPDATE); + wait_on_queue(&last_for_update->wqueue[COND_FOR_REQUESTED], + &keycache->cache_lock); + goto restart; + } + + /* + To avoid an infinite loop wait until one of the blocks marked + for eviction is switched. + */ + if (last_in_switch) + { + /* We did not wait. Block must not have changed status. */ + DBUG_ASSERT(last_in_switch->status & (BLOCK_IN_EVICTION | + BLOCK_IN_SWITCH | + BLOCK_REASSIGNED)); + wait_on_queue(&last_in_switch->wqueue[COND_FOR_SAVED], + &keycache->cache_lock); + goto restart; + } + + } /* if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE)) */ + + } /* if (keycache->disk_blocks > 0 */ + +#ifndef DBUG_OFF + DBUG_EXECUTE("check_keycache", + test_key_cache(keycache, "end of flush_key_blocks", 0);); +#endif +err: + if (cache != cache_buff) + my_free((uchar*) cache, MYF(0)); + if (last_errno) + errno=last_errno; /* Return first error */ + DBUG_RETURN(last_errno != 0); +} + + +/* + Flush all blocks for a file to disk + + SYNOPSIS + + flush_key_blocks() + keycache pointer to a key cache data structure + file handler for the file to flush to + flush_type type of the flush + + RETURN + 0 ok + 1 error +*/ + +int flush_key_blocks(KEY_CACHE *keycache, + File file, enum flush_type type) +{ + int res= 0; + DBUG_ENTER("flush_key_blocks"); + DBUG_PRINT("enter", ("keycache: %p", keycache)); + + if (!keycache->key_cache_inited) + DBUG_RETURN(0); + + keycache_pthread_mutex_lock(&keycache->cache_lock); + /* While waiting for lock, keycache could have been ended. */ + if (keycache->disk_blocks > 0) + { + inc_counter_for_resize_op(keycache); + res= flush_key_blocks_int(keycache, file, type); + dec_counter_for_resize_op(keycache); + } + keycache_pthread_mutex_unlock(&keycache->cache_lock); + DBUG_RETURN(res); +} + + +/* + Flush all blocks in the key cache to disk. + + SYNOPSIS + flush_all_key_blocks() + keycache pointer to key cache root structure + + DESCRIPTION + + Flushing of the whole key cache is done in two phases. + + 1. Flush all changed blocks, waiting for them if necessary. Loop + until there is no changed block left in the cache. + + 2. Free all clean blocks. Normally this means free all blocks. The + changed blocks were flushed in phase 1 and became clean. However we + may need to wait for blocks that are read by other threads. While we + wait, a clean block could become changed if that operation started + before the resize operation started. To be safe we must restart at + phase 1. + + When we can run through the changed_blocks and file_blocks hashes + without finding a block any more, then we are done. + + Note that we hold keycache->cache_lock all the time unless we need + to wait for something. + + RETURN + 0 OK + != 0 Error +*/ + +static int flush_all_key_blocks(KEY_CACHE *keycache) +{ + BLOCK_LINK *block; + uint total_found; + uint found; + uint idx; + DBUG_ENTER("flush_all_key_blocks"); + + do + { + safe_mutex_assert_owner(&keycache->cache_lock); + total_found= 0; + + /* + Phase1: Flush all changed blocks, waiting for them if necessary. + Loop until there is no changed block left in the cache. + */ + do + { + found= 0; + /* Step over the whole changed_blocks hash array. */ + for (idx= 0; idx < CHANGED_BLOCKS_HASH; idx++) + { + /* + If an array element is non-empty, use the first block from its + chain to find a file for flush. All changed blocks for this + file are flushed. So the same block will not appear at this + place again with the next iteration. New writes for blocks are + not accepted during the flush. If multiple files share the + same hash bucket, one of them will be flushed per iteration + of the outer loop of phase 1. + */ + if ((block= keycache->changed_blocks[idx])) + { + found++; + /* + Flush dirty blocks but do not free them yet. They can be used + for reading until all other blocks are flushed too. + */ + if (flush_key_blocks_int(keycache, block->hash_link->file, + FLUSH_FORCE_WRITE)) + DBUG_RETURN(1); + } + } + + } while (found); + + /* + Phase 2: Free all clean blocks. Normally this means free all + blocks. The changed blocks were flushed in phase 1 and became + clean. However we may need to wait for blocks that are read by + other threads. While we wait, a clean block could become changed + if that operation started before the resize operation started. To + be safe we must restart at phase 1. + */ + do + { + found= 0; + /* Step over the whole file_blocks hash array. */ + for (idx= 0; idx < CHANGED_BLOCKS_HASH; idx++) + { + /* + If an array element is non-empty, use the first block from its + chain to find a file for flush. All blocks for this file are + freed. So the same block will not appear at this place again + with the next iteration. If multiple files share the + same hash bucket, one of them will be flushed per iteration + of the outer loop of phase 2. + */ + if ((block= keycache->file_blocks[idx])) + { + total_found++; + found++; + if (flush_key_blocks_int(keycache, block->hash_link->file, + FLUSH_RELEASE)) + DBUG_RETURN(1); + } + } + + } while (found); + + /* + If any clean block has been found, we may have waited for it to + become free. In this case it could be possible that another clean + block became dirty. This is possible if the write request existed + before the resize started (BLOCK_FOR_UPDATE). Re-check the hashes. + */ + } while (total_found); + +#ifndef DBUG_OFF + /* Now there should not exist any block any more. */ + for (idx= 0; idx < CHANGED_BLOCKS_HASH; idx++) + { + DBUG_ASSERT(!keycache->changed_blocks[idx]); + DBUG_ASSERT(!keycache->file_blocks[idx]); + } +#endif + + DBUG_RETURN(0); +} + + +/* + Reset the counters of a key cache. + + SYNOPSIS + reset_key_cache_counters() + name the name of a key cache + key_cache pointer to the key kache to be reset + + DESCRIPTION + This procedure is used by process_key_caches() to reset the counters of all + currently used key caches, both the default one and the named ones. + + RETURN + 0 on success (always because it can't fail) +*/ + +int reset_key_cache_counters(const char *name __attribute__((unused)), + KEY_CACHE *key_cache) +{ + DBUG_ENTER("reset_key_cache_counters"); + if (!key_cache->key_cache_inited) + { + DBUG_PRINT("info", ("Key cache %s not initialized.", name)); + DBUG_RETURN(0); + } + DBUG_PRINT("info", ("Resetting counters for key cache %s.", name)); + + key_cache->global_blocks_changed= 0; /* Key_blocks_not_flushed */ + key_cache->global_cache_r_requests= 0; /* Key_read_requests */ + key_cache->global_cache_read= 0; /* Key_reads */ + key_cache->global_cache_w_requests= 0; /* Key_write_requests */ + key_cache->global_cache_write= 0; /* Key_writes */ + DBUG_RETURN(0); +} + + +#ifndef DBUG_OFF +/* + Test if disk-cache is ok +*/ +static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)), + const char *where __attribute__((unused)), + my_bool lock __attribute__((unused))) +{ + /* TODO */ +} +#endif + +#if defined(KEYCACHE_TIMEOUT) + +#define KEYCACHE_DUMP_FILE "keycache_dump.txt" +#define MAX_QUEUE_LEN 100 + + +static void keycache_dump(KEY_CACHE *keycache) +{ + FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w"); + struct st_my_thread_var *last; + struct st_my_thread_var *thread; + BLOCK_LINK *block; + HASH_LINK *hash_link; + KEYCACHE_PAGE *page; + uint i; + + fprintf(keycache_dump_file, "thread:%u\n", thread->id); + + i=0; + thread=last=waiting_for_hash_link.last_thread; + fprintf(keycache_dump_file, "queue of threads waiting for hash link\n"); + if (thread) + do + { + thread=thread->next; + page= (KEYCACHE_PAGE *) thread->opt_info; + fprintf(keycache_dump_file, + "thread:%u, (file,filepos)=(%u,%lu)\n", + thread->id,(uint) page->file,(ulong) page->filepos); + if (++i == MAX_QUEUE_LEN) + break; + } + while (thread != last); + + i=0; + thread=last=waiting_for_block.last_thread; + fprintf(keycache_dump_file, "queue of threads waiting for block\n"); + if (thread) + do + { + thread=thread->next; + hash_link= (HASH_LINK *) thread->opt_info; + fprintf(keycache_dump_file, + "thread:%u hash_link:%u (file,filepos)=(%u,%lu)\n", + thread->id, (uint) HASH_LINK_NUMBER(hash_link), + (uint) hash_link->file,(ulong) hash_link->diskpos); + if (++i == MAX_QUEUE_LEN) + break; + } + while (thread != last); + + for (i=0 ; i< keycache->blocks_used ; i++) + { + int j; + block= &keycache->block_root[i]; + hash_link= block->hash_link; + fprintf(keycache_dump_file, + "block:%u hash_link:%d status:%x #requests=%u waiting_for_readers:%d\n", + i, (int) (hash_link ? HASH_LINK_NUMBER(hash_link) : -1), + block->status, block->requests, block->condvar ? 1 : 0); + for (j=0 ; j < 2; j++) + { + KEYCACHE_WQUEUE *wqueue=&block->wqueue[j]; + thread= last= wqueue->last_thread; + fprintf(keycache_dump_file, "queue #%d\n", j); + if (thread) + { + do + { + thread=thread->next; + fprintf(keycache_dump_file, + "thread:%u\n", thread->id); + if (++i == MAX_QUEUE_LEN) + break; + } + while (thread != last); + } + } + } + fprintf(keycache_dump_file, "LRU chain:"); + block= keycache= used_last; + if (block) + { + do + { + block= block->next_used; + fprintf(keycache_dump_file, + "block:%u, ", BLOCK_NUMBER(block)); + } + while (block != keycache->used_last); + } + fprintf(keycache_dump_file, "\n"); + + fclose(keycache_dump_file); +} + +#endif /* defined(KEYCACHE_TIMEOUT) */ + +#if defined(KEYCACHE_TIMEOUT) && !defined(__WIN__) + + +static int keycache_pthread_cond_wait(pthread_cond_t *cond, + pthread_mutex_t *mutex) +{ + int rc; + struct timeval now; /* time when we started waiting */ + struct timespec timeout; /* timeout value for the wait function */ + struct timezone tz; +#if defined(KEYCACHE_DEBUG) + int cnt=0; +#endif + + /* Get current time */ + gettimeofday(&now, &tz); + /* Prepare timeout value */ + timeout.tv_sec= now.tv_sec + KEYCACHE_TIMEOUT; + /* + timeval uses microseconds. + timespec uses nanoseconds. + 1 nanosecond = 1000 micro seconds + */ + timeout.tv_nsec= now.tv_usec * 1000; + KEYCACHE_THREAD_TRACE_END("started waiting"); +#if defined(KEYCACHE_DEBUG) + cnt++; + if (cnt % 100 == 0) + fprintf(keycache_debug_log, "waiting...\n"); + fflush(keycache_debug_log); +#endif + rc= pthread_cond_timedwait(cond, mutex, &timeout); + KEYCACHE_THREAD_TRACE_BEGIN("finished waiting"); + if (rc == ETIMEDOUT || rc == ETIME) + { +#if defined(KEYCACHE_DEBUG) + fprintf(keycache_debug_log,"aborted by keycache timeout\n"); + fclose(keycache_debug_log); + abort(); +#endif + keycache_dump(); + } + +#if defined(KEYCACHE_DEBUG) + KEYCACHE_DBUG_ASSERT(rc != ETIMEDOUT); +#else + assert(rc != ETIMEDOUT); +#endif + return rc; +} +#else +#if defined(KEYCACHE_DEBUG) +static int keycache_pthread_cond_wait(pthread_cond_t *cond, + pthread_mutex_t *mutex) +{ + int rc; + KEYCACHE_THREAD_TRACE_END("started waiting"); + rc= pthread_cond_wait(cond, mutex); + KEYCACHE_THREAD_TRACE_BEGIN("finished waiting"); + return rc; +} +#endif +#endif /* defined(KEYCACHE_TIMEOUT) && !defined(__WIN__) */ + +#if defined(KEYCACHE_DEBUG) + + +static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex) +{ + int rc; + rc= pthread_mutex_lock(mutex); + KEYCACHE_THREAD_TRACE_BEGIN(""); + return rc; +} + + +static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex) +{ + KEYCACHE_THREAD_TRACE_END(""); + pthread_mutex_unlock(mutex); +} + + +static int keycache_pthread_cond_signal(pthread_cond_t *cond) +{ + int rc; + KEYCACHE_THREAD_TRACE("signal"); + rc= pthread_cond_signal(cond); + return rc; +} + + +#if defined(KEYCACHE_DEBUG_LOG) + + +static void keycache_debug_print(const char * fmt,...) +{ + va_list args; + va_start(args,fmt); + if (keycache_debug_log) + { + (void) vfprintf(keycache_debug_log, fmt, args); + (void) fputc('\n',keycache_debug_log); + } + va_end(args); +} +#endif /* defined(KEYCACHE_DEBUG_LOG) */ + +#if defined(KEYCACHE_DEBUG_LOG) + + +void keycache_debug_log_close(void) +{ + if (keycache_debug_log) + fclose(keycache_debug_log); +} +#endif /* defined(KEYCACHE_DEBUG_LOG) */ + +#endif /* defined(KEYCACHE_DEBUG) */ + +#if !defined(DBUG_OFF) +#define F_B_PRT(_f_, _v_) DBUG_PRINT("assert_fail", (_f_, _v_)) + +static int fail_block(BLOCK_LINK *block) +{ + F_B_PRT("block->next_used: %lx\n", (ulong) block->next_used); + F_B_PRT("block->prev_used: %lx\n", (ulong) block->prev_used); + F_B_PRT("block->next_changed: %lx\n", (ulong) block->next_changed); + F_B_PRT("block->prev_changed: %lx\n", (ulong) block->prev_changed); + F_B_PRT("block->hash_link: %lx\n", (ulong) block->hash_link); + F_B_PRT("block->status: %u\n", block->status); + F_B_PRT("block->length: %u\n", block->length); + F_B_PRT("block->offset: %u\n", block->offset); + F_B_PRT("block->requests: %u\n", block->requests); + F_B_PRT("block->temperature: %u\n", block->temperature); + return 0; /* Let the assert fail. */ +} + +static int fail_hlink(HASH_LINK *hlink) +{ + F_B_PRT("hlink->next: %lx\n", (ulong) hlink->next); + F_B_PRT("hlink->prev: %lx\n", (ulong) hlink->prev); + F_B_PRT("hlink->block: %lx\n", (ulong) hlink->block); + F_B_PRT("hlink->diskpos: %lu\n", (ulong) hlink->diskpos); + F_B_PRT("hlink->file: %d\n", hlink->file); + return 0; /* Let the assert fail. */ +} + +static int cache_empty(KEY_CACHE *keycache) +{ + int errcnt= 0; + int idx; + if (keycache->disk_blocks <= 0) + return 1; + for (idx= 0; idx < keycache->disk_blocks; idx++) + { + BLOCK_LINK *block= keycache->block_root + idx; + if (block->status || block->requests || block->hash_link) + { + fprintf(stderr, "block index: %u\n", idx); + fail_block(block); + errcnt++; + } + } + for (idx= 0; idx < keycache->hash_links; idx++) + { + HASH_LINK *hash_link= keycache->hash_link_root + idx; + if (hash_link->requests || hash_link->block) + { + fprintf(stderr, "hash_link index: %u\n", idx); + fail_hlink(hash_link); + errcnt++; + } + } + if (errcnt) + { + fprintf(stderr, "blocks: %d used: %lu\n", + keycache->disk_blocks, keycache->blocks_used); + fprintf(stderr, "hash_links: %d used: %d\n", + keycache->hash_links, keycache->hash_links_used); + fprintf(stderr, "\n"); + } + return !errcnt; +} +#endif + diff --git a/externals/mysql/mysys/mf_keycaches.c b/externals/mysql/mysys/mf_keycaches.c new file mode 100644 index 00000000000..9ea5678da9a --- /dev/null +++ b/externals/mysql/mysys/mf_keycaches.c @@ -0,0 +1,106 @@ +/* Copyright (C) 2003-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Handling of multiple key caches + + The idea is to have a thread safe hash on the table name, + with a default key cache value that is returned if the table name is not in + the cache. +*/ + +#include "mysys_priv.h" +#include +#include +#include +#include "my_safehash.h" + +/***************************************************************************** + Functions to handle the key cache objects +*****************************************************************************/ + +/* Variable to store all key cache objects */ +static SAFE_HASH key_cache_hash; + + +my_bool multi_keycache_init(void) +{ + return safe_hash_init(&key_cache_hash, 16, (uchar*) dflt_key_cache); +} + + +void multi_keycache_free(void) +{ + safe_hash_free(&key_cache_hash); +} + +/* + Get a key cache to be used for a specific table. + + SYNOPSIS + multi_key_cache_search() + key key to find (usually table path) + uint length Length of key. + def Default value if no key cache + + NOTES + This function is coded in such a way that we will return the + default key cache even if one never called multi_keycache_init. + This will ensure that it works with old MyISAM clients. + + RETURN + key cache to use +*/ + +KEY_CACHE *multi_key_cache_search(uchar *key, uint length, + KEY_CACHE *def) +{ + if (!key_cache_hash.hash.records) + return def; + return (KEY_CACHE*) safe_hash_search(&key_cache_hash, key, length, + (void*) def); +} + + +/* + Assosiate a key cache with a key + + + SYONOPSIS + multi_key_cache_set() + key key (path to table etc..) + length Length of key + key_cache cache to assococite with the table + + NOTES + This can be used both to insert a new entry and change an existing + entry +*/ + + +my_bool multi_key_cache_set(const uchar *key, uint length, + KEY_CACHE *key_cache) +{ + return safe_hash_set(&key_cache_hash, key, length, (uchar*) key_cache); +} + + +void multi_key_cache_change(KEY_CACHE *old_data, + KEY_CACHE *new_data) +{ + safe_hash_change(&key_cache_hash, (uchar*) old_data, (uchar*) new_data); +} + + diff --git a/externals/mysql/mysys/mf_loadpath.c b/externals/mysql/mysys/mf_loadpath.c new file mode 100644 index 00000000000..fbf6f7f5d57 --- /dev/null +++ b/externals/mysql/mysys/mf_loadpath.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + + /* Returns full load-path for a file. to may be = path */ + /* if path is a hard-path return path */ + /* if path starts with home-dir return path */ + /* if path starts with current dir or parent-dir unpack path */ + /* if there is no path, prepend with own_path_prefix if given */ + /* else unpack path according to current dir */ + +char * my_load_path(char * to, const char *path, + const char *own_path_prefix) +{ + char buff[FN_REFLEN]; + int is_cur; + DBUG_ENTER("my_load_path"); + DBUG_PRINT("enter",("path: %s prefix: %s",path, + own_path_prefix ? own_path_prefix : "")); + + if ((path[0] == FN_HOMELIB && path[1] == FN_LIBCHAR) || + test_if_hard_path(path)) + (void) strmov(buff,path); + else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) || + (is_prefix(path,FN_PARENTDIR)) || + ! own_path_prefix) + { + if (is_cur) + is_cur=2; /* Remove current dir */ + if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0))) + (void) strcat(buff,path+is_cur); + else + (void) strmov(buff,path); /* Return org file name */ + } + else + (void) strxmov(buff,own_path_prefix,path,NullS); + strmov(to,buff); + DBUG_PRINT("exit",("to: %s",to)); + DBUG_RETURN(to); +} /* my_load_path */ diff --git a/externals/mysql/mysys/mf_pack.c b/externals/mysql/mysys/mf_pack.c new file mode 100644 index 00000000000..ab4cd352710 --- /dev/null +++ b/externals/mysql/mysys/mf_pack.c @@ -0,0 +1,526 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include +#ifdef HAVE_PWD_H +#include +#endif +#ifdef VMS +#include +#include +#include +#endif /* VMS */ + +static char * NEAR_F expand_tilde(char * *path); + + /* Pack a dirname ; Changes HOME to ~/ and current dev to ./ */ + /* from is a dirname (from dirname() ?) ending with FN_LIBCHAR */ + /* to may be == from */ + +void pack_dirname(char * to, const char *from) +{ + int cwd_err; + size_t d_length,length,buff_length; + char * start; + char buff[FN_REFLEN]; + DBUG_ENTER("pack_dirname"); + + LINT_INIT(buff_length); + (void) intern_filename(to,from); /* Change to intern name */ + +#ifdef FN_DEVCHAR + if ((start=strrchr(to,FN_DEVCHAR)) != 0) /* Skip device part */ + start++; + else +#endif + start=to; + + if (!(cwd_err= my_getwd(buff,FN_REFLEN,MYF(0)))) + { + buff_length= strlen(buff); + d_length= (size_t) (start-to); + if ((start == to || + (buff_length == d_length && !bcmp(buff,start,d_length))) && + *start != FN_LIBCHAR && *start) + { /* Put current dir before */ + bchange((uchar*) to, d_length, (uchar*) buff, buff_length, strlen(to)+1); + } + } + + if ((d_length= cleanup_dirname(to,to)) != 0) + { + length=0; + if (home_dir) + { + length= strlen(home_dir); + if (home_dir[length-1] == FN_LIBCHAR) + length--; /* Don't test last '/' */ + } + if (length > 1 && length < d_length) + { /* test if /xx/yy -> ~/yy */ + if (bcmp(to,home_dir,length) == 0 && to[length] == FN_LIBCHAR) + { + to[0]=FN_HOMELIB; /* Filename begins with ~ */ + (void) strmov_overlapp(to+1,to+length); + } + } + if (! cwd_err) + { /* Test if cwd is ~/... */ + if (length > 1 && length < buff_length) + { + if (bcmp(buff,home_dir,length) == 0 && buff[length] == FN_LIBCHAR) + { + buff[0]=FN_HOMELIB; + (void) strmov_overlapp(buff+1,buff+length); + } + } + if (is_prefix(to,buff)) + { + length= strlen(buff); + if (to[length]) + (void) strmov_overlapp(to,to+length); /* Remove everything before */ + else + { + to[0]= FN_CURLIB; /* Put ./ instead of cwd */ + to[1]= FN_LIBCHAR; + to[2]= '\0'; + } + } + } + } + DBUG_PRINT("exit",("to: '%s'",to)); + DBUG_VOID_RETURN; +} /* pack_dirname */ + + +/* + remove unwanted chars from dirname + + SYNOPSIS + cleanup_dirname() + to Store result here + from Dirname to fix. May be same as to + + IMPLEMENTATION + "/../" removes prev dir + "/~/" removes all before ~ + //" is same as "/", except on Win32 at start of a file + "/./" is removed + Unpacks home_dir if "~/.." used + Unpacks current dir if if "./.." used + + RETURN + # length of new name +*/ + +size_t cleanup_dirname(register char *to, const char *from) +{ + reg5 size_t length; + reg2 char * pos; + reg3 char * from_ptr; + reg4 char * start; + char parent[5], /* for "FN_PARENTDIR" */ + buff[FN_REFLEN+1],*end_parentdir; +#ifdef BACKSLASH_MBTAIL + CHARSET_INFO *fs= fs_character_set(); +#endif + DBUG_ENTER("cleanup_dirname"); + DBUG_PRINT("enter",("from: '%s'",from)); + + start=buff; + from_ptr=(char *) from; +#ifdef FN_DEVCHAR + if ((pos=strrchr(from_ptr,FN_DEVCHAR)) != 0) + { /* Skip device part */ + length=(size_t) (pos-from_ptr)+1; + start=strnmov(buff,from_ptr,length); from_ptr+=length; + } +#endif + + parent[0]=FN_LIBCHAR; + length=(size_t) (strmov(parent+1,FN_PARENTDIR)-parent); + for (pos=start ; (*pos= *from_ptr++) != 0 ; pos++) + { +#ifdef BACKSLASH_MBTAIL + uint l; + if (use_mb(fs) && (l= my_ismbchar(fs, from_ptr - 1, from_ptr + 2))) + { + for (l-- ; l ; *++pos= *from_ptr++, l--); + start= pos + 1; /* Don't look inside multi-byte char */ + continue; + } +#endif + if (*pos == '/') + *pos = FN_LIBCHAR; + if (*pos == FN_LIBCHAR) + { + if ((size_t) (pos-start) > length && bcmp(pos-length,parent,length) == 0) + { /* If .../../; skip prev */ + pos-=length; + if (pos != start) + { /* not /../ */ + pos--; + if (*pos == FN_HOMELIB && (pos == start || pos[-1] == FN_LIBCHAR)) + { + if (!home_dir) + { + pos+=length+1; /* Don't unpack ~/.. */ + continue; + } + pos=strmov(buff,home_dir)-1; /* Unpacks ~/.. */ + if (*pos == FN_LIBCHAR) + pos--; /* home ended with '/' */ + } + if (*pos == FN_CURLIB && (pos == start || pos[-1] == FN_LIBCHAR)) + { + if (my_getwd(curr_dir,FN_REFLEN,MYF(0))) + { + pos+=length+1; /* Don't unpack ./.. */ + continue; + } + pos=strmov(buff,curr_dir)-1; /* Unpacks ./.. */ + if (*pos == FN_LIBCHAR) + pos--; /* home ended with '/' */ + } + end_parentdir=pos; + while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */ + pos--; + if (pos[1] == FN_HOMELIB || bcmp(pos,parent,length) == 0) + { /* Don't remove ~user/ */ + pos=strmov(end_parentdir+1,parent); + *pos=FN_LIBCHAR; + continue; + } + } + } + else if ((size_t) (pos-start) == length-1 && + !bcmp(start,parent+1,length-1)) + start=pos; /* Starts with "../" */ + else if (pos-start > 0 && pos[-1] == FN_LIBCHAR) + { +#ifdef FN_NETWORK_DRIVES + if (pos-start != 1) +#endif + pos--; /* Remove dupplicate '/' */ + } + else if (pos-start > 1 && pos[-1] == FN_CURLIB && pos[-2] == FN_LIBCHAR) + pos-=2; /* Skip /./ */ + else if (pos > buff+1 && pos[-1] == FN_HOMELIB && pos[-2] == FN_LIBCHAR) + { /* Found ..../~/ */ + buff[0]=FN_HOMELIB; + buff[1]=FN_LIBCHAR; + start=buff; pos=buff+1; + } + } + } + (void) strmov(to,buff); + DBUG_PRINT("exit",("to: '%s'",to)); + DBUG_RETURN((size_t) (pos-buff)); +} /* cleanup_dirname */ + + +/* + On system where you don't have symbolic links, the following + code will allow you to create a file: + directory-name.sym that should contain the real path + to the directory. This will be used if the directory name + doesn't exists +*/ + + +my_bool my_use_symdir=0; /* Set this if you want to use symdirs */ + +#ifdef USE_SYMDIR +void symdirget(char *dir) +{ + char buff[FN_REFLEN]; + char *pos=strend(dir); + if (dir[0] && pos[-1] != FN_DEVCHAR && my_access(dir, F_OK)) + { + File file; + size_t length; + char temp= *(--pos); /* May be "/" or "\" */ + strmov(pos,".sym"); + file= my_open(dir, O_RDONLY, MYF(0)); + *pos++=temp; *pos=0; /* Restore old filename */ + if (file >= 0) + { + if ((length= my_read(file, buff, sizeof(buff), MYF(0))) > 0) + { + for (pos= buff + length ; + pos > buff && (iscntrl(pos[-1]) || isspace(pos[-1])) ; + pos --); + + /* Ensure that the symlink ends with the directory symbol */ + if (pos == buff || pos[-1] != FN_LIBCHAR) + *pos++=FN_LIBCHAR; + + strmake(dir,buff, (size_t) (pos-buff)); + } + my_close(file, MYF(0)); + } + } +} +#endif /* USE_SYMDIR */ + + +/** + Convert a directory name to a format which can be compared as strings + + @param to result buffer, FN_REFLEN chars in length; may be == from + @param from 'packed' directory name, in whatever format + @returns size of the normalized name + + @details + - Ensures that last char is FN_LIBCHAR, unless it is FN_DEVCHAR + - Uses cleanup_dirname + + It does *not* expand ~/ (although, see cleanup_dirname). Nor does it do + any case folding. All case-insensitive normalization should be done by + the caller. +*/ + +size_t normalize_dirname(char *to, const char *from) +{ + size_t length; + char buff[FN_REFLEN]; + DBUG_ENTER("normalize_dirname"); + + /* + Despite the name, this actually converts the name to the system's + format (TODO: rip out the non-working VMS stuff and name this + properly). + */ + (void) intern_filename(buff, from); + length= strlen(buff); /* Fix that '/' is last */ + if (length && +#ifdef FN_DEVCHAR + buff[length - 1] != FN_DEVCHAR && +#endif + buff[length - 1] != FN_LIBCHAR && buff[length - 1] != '/') + { + buff[length]= FN_LIBCHAR; + buff[length + 1]= '\0'; + } + + length=cleanup_dirname(to, buff); + + DBUG_RETURN(length); +} + + +/** + Fixes a directory name so that can be used by open() + + @param to Result buffer, FN_REFLEN characters. May be == from + @param from 'Packed' directory name (may contain ~) + + @details + - Uses normalize_dirname() + - Expands ~/... to home_dir/... + - Resolves MySQL's fake "foo.sym" symbolic directory names (if USE_SYMDIR) + - Changes a UNIX filename to system filename (replaces / with \ on windows) + + @returns + Length of new directory name (= length of to) +*/ + +size_t unpack_dirname(char *to, const char *from) +{ + size_t length, h_length; + char buff[FN_REFLEN+1+4],*suffix,*tilde_expansion; + DBUG_ENTER("unpack_dirname"); + + length= normalize_dirname(buff, from); + + if (buff[0] == FN_HOMELIB) + { + suffix=buff+1; tilde_expansion=expand_tilde(&suffix); + if (tilde_expansion) + { + length-= (size_t) (suffix-buff)-1; + if (length+(h_length= strlen(tilde_expansion)) <= FN_REFLEN) + { + if ((h_length > 0) && (tilde_expansion[h_length-1] == FN_LIBCHAR)) + h_length--; + if (buff+h_length < suffix) + bmove(buff+h_length,suffix,length); + else + bmove_upp((uchar*) buff+h_length+length, (uchar*) suffix+length, length); + bmove(buff,tilde_expansion,h_length); + } + } + } +#ifdef USE_SYMDIR + if (my_use_symdir) + symdirget(buff); +#endif + DBUG_RETURN(system_filename(to,buff)); /* Fix for open */ +} /* unpack_dirname */ + + + /* Expand tilde to home or user-directory */ + /* Path is reset to point at FN_LIBCHAR after ~xxx */ + +static char * NEAR_F expand_tilde(char * *path) +{ + if (path[0][0] == FN_LIBCHAR) + return home_dir; /* ~/ expanded to home */ +#ifdef HAVE_GETPWNAM + { + char *str,save; + struct passwd *user_entry; + + if (!(str=strchr(*path,FN_LIBCHAR))) + str=strend(*path); + save= *str; *str= '\0'; + user_entry=getpwnam(*path); + *str=save; + endpwent(); + if (user_entry) + { + *path=str; + return user_entry->pw_dir; + } + } +#endif + return (char *) 0; +} + + +/* + Fix filename so it can be used by open, create + + SYNOPSIS + unpack_filename() + to Store result here. Must be at least of size FN_REFLEN. + from Filename in unix format (with ~) + + RETURN + # length of to + + NOTES + to may be == from + ~ will only be expanded if total length < FN_REFLEN +*/ + + +size_t unpack_filename(char * to, const char *from) +{ + size_t length, n_length, buff_length; + char buff[FN_REFLEN]; + DBUG_ENTER("unpack_filename"); + + length=dirname_part(buff, from, &buff_length);/* copy & convert dirname */ + n_length=unpack_dirname(buff,buff); + if (n_length+strlen(from+length) < FN_REFLEN) + { + (void) strmov(buff+n_length,from+length); + length= system_filename(to,buff); /* Fix to usably filename */ + } + else + length= system_filename(to,from); /* Fix to usably filename */ + DBUG_RETURN(length); +} /* unpack_filename */ + + + /* Convert filename (unix standard) to system standard */ + /* Used before system command's like open(), create() .. */ + /* Returns used length of to; total length should be FN_REFLEN */ + +size_t system_filename(char * to, const char *from) +{ +#ifndef FN_C_BEFORE_DIR + return (size_t) (strmake(to,from,FN_REFLEN-1)-to); +#else /* VMS */ + + /* change 'dev:lib/xxx' to 'dev:[lib]xxx' */ + /* change 'dev:xxx' to 'dev:xxx' */ + /* change './xxx' to 'xxx' */ + /* change './lib/' or lib/ to '[.lib]' */ + /* change '/x/y/z to '[x.y]x' */ + /* change 'dev:/x' to 'dev:[000000]x' */ + + int libchar_found; + size_t length; + char * to_pos,from_pos,pos; + char buff[FN_REFLEN]; + DBUG_ENTER("system_filename"); + + libchar_found=0; + (void) strmov(buff,from); /* If to == from */ + from_pos= buff; + if ((pos=strrchr(from_pos,FN_DEVCHAR))) /* Skip device part */ + { + pos++; + to_pos=strnmov(to,from_pos,(size_t) (pos-from_pos)); + from_pos=pos; + } + else + to_pos=to; + + if (from_pos[0] == FN_CURLIB && from_pos[1] == FN_LIBCHAR) + from_pos+=2; /* Skip './' */ + if (strchr(from_pos,FN_LIBCHAR)) + { + *(to_pos++) = FN_C_BEFORE_DIR; + if (strinstr(from_pos,FN_ROOTDIR) == 1) + { + from_pos+=strlen(FN_ROOTDIR); /* Actually +1 but... */ + if (! strchr(from_pos,FN_LIBCHAR)) + { /* No dir, use [000000] */ + to_pos=strmov(to_pos,FN_C_ROOT_DIR); + libchar_found++; + } + } + else + *(to_pos++)=FN_C_DIR_SEP; /* '.' gives current dir */ + + while ((pos=strchr(from_pos,FN_LIBCHAR))) + { + if (libchar_found++) + *(to_pos++)=FN_C_DIR_SEP; /* Add '.' between dirs */ + if (strinstr(from_pos,FN_PARENTDIR) == 1 && + from_pos+strlen(FN_PARENTDIR) == pos) + to_pos=strmov(to_pos,FN_C_PARENT_DIR); /* Found '../' */ + else + to_pos=strnmov(to_pos,from_pos,(size_t) (pos-from_pos)); + from_pos=pos+1; + } + *(to_pos++)=FN_C_AFTER_DIR; + } + length= (size_t) (strmov(to_pos,from_pos)-to); + DBUG_PRINT("exit",("name: '%s'",to)); + DBUG_RETURN(length); +#endif +} /* system_filename */ + + + /* Fix a filename to intern (UNIX format) */ + +char *intern_filename(char *to, const char *from) +{ + size_t length, to_length; + char buff[FN_REFLEN]; + if (from == to) + { /* Dirname may destroy from */ + strmov(buff,from); + from=buff; + } + length= dirname_part(to, from, &to_length); /* Copy dirname & fix chars */ + (void) strmov(to + to_length,from+length); + return (to); +} /* intern_filename */ diff --git a/externals/mysql/mysys/mf_path.c b/externals/mysql/mysys/mf_path.c new file mode 100644 index 00000000000..d51cac732f5 --- /dev/null +++ b/externals/mysql/mysys/mf_path.c @@ -0,0 +1,123 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + +static char *find_file_in_path(char *to,const char *name); + + /* Finds where program can find it's files. + pre_pathname is found by first locking at progname (argv[0]). + if progname contains path the path is returned. + else if progname is found in path, return it + else if progname is given and POSIX environment variable "_" is set + then path is taken from "_". + If filename doesn't contain a path append MY_BASEDIR_VERSION or + MY_BASEDIR if defined, else append "/my/running". + own_path_name_part is concatinated to result. + my_path puts result in to and returns to */ + +char * my_path(char * to, const char *progname, + const char *own_pathname_part) +{ + char *start, *end, *prog; + size_t to_length; + DBUG_ENTER("my_path"); + + start=to; /* Return this */ + if (progname && (dirname_part(to, progname, &to_length) || + find_file_in_path(to,progname) || + ((prog=getenv("_")) != 0 && + dirname_part(to, prog, &to_length)))) + { + (void) intern_filename(to,to); + if (!test_if_hard_path(to)) + { + if (!my_getwd(curr_dir,FN_REFLEN,MYF(0))) + bchange((uchar*) to, 0, (uchar*) curr_dir, strlen(curr_dir), strlen(to)+1); + } + } + else + { + if ((end = getenv("MY_BASEDIR_VERSION")) == 0 && + (end = getenv("MY_BASEDIR")) == 0) + { +#ifdef DEFAULT_BASEDIR + end= (char*) DEFAULT_BASEDIR; +#else + end= (char*) "/my/"; +#endif + } + (void) intern_filename(to,end); + to=strend(to); + if (to != start && to[-1] != FN_LIBCHAR) + *to++ = FN_LIBCHAR; + (void) strmov(to,own_pathname_part); + } + DBUG_PRINT("exit",("to: '%s'",start)); + DBUG_RETURN(start); +} /* my_path */ + + + /* test if file without filename is found in path */ + /* Returns to if found and to has dirpart if found, else NullS */ + +#if defined(__WIN__) +#define F_OK 0 +#define PATH_SEP ';' +#define PROGRAM_EXTENSION ".exe" +#elif defined(__NETWARE__) +#define PATH_SEP ';' +#define PROGRAM_EXTENSION ".nlm" +#else +#define PATH_SEP ':' +#endif + +static char *find_file_in_path(char *to, const char *name) +{ + char *path,*pos,dir[2]; + const char *ext=""; + + if (!(path=getenv("PATH"))) + return NullS; + dir[0]=FN_LIBCHAR; dir[1]=0; +#ifdef PROGRAM_EXTENSION + if (!fn_ext(name)[0]) + ext=PROGRAM_EXTENSION; +#endif + + for (pos=path ; (pos=strchr(pos,PATH_SEP)) ; path= ++pos) + { + if (path != pos) + { + strxmov(strnmov(to,path,(uint) (pos-path)),dir,name,ext,NullS); + if (!access(to,F_OK)) + { + to[(uint) (pos-path)+1]=0; /* Return path only */ + return to; + } + } + } +#ifdef __WIN__ + to[0]=FN_CURLIB; + strxmov(to+1,dir,name,ext,NullS); + if (!access(to,F_OK)) /* Test in current dir */ + { + to[2]=0; /* Leave ".\" */ + return to; + } +#endif + return NullS; /* File not found */ +} diff --git a/externals/mysql/mysys/mf_qsort.c b/externals/mysql/mysys/mf_qsort.c new file mode 100644 index 00000000000..4b3ecb603a6 --- /dev/null +++ b/externals/mysql/mysys/mf_qsort.c @@ -0,0 +1,216 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + qsort implementation optimized for comparison of pointers + Inspired by the qsort implementations by Douglas C. Schmidt, + and Bentley & McIlroy's "Engineering a Sort Function". +*/ + + +#include "mysys_priv.h" +#ifndef SCO +#include +#endif + +/* We need to use qsort with 2 different compare functions */ +#ifdef QSORT_EXTRA_CMP_ARGUMENT +#define CMP(A,B) ((*cmp)(cmp_argument,(A),(B))) +#else +#define CMP(A,B) ((*cmp)((A),(B))) +#endif + +#define SWAP(A, B, size,swap_ptrs) \ +do { \ + if (swap_ptrs) \ + { \ + reg1 char **a = (char**) (A), **b = (char**) (B); \ + char *tmp = *a; *a++ = *b; *b++ = tmp; \ + } \ + else \ + { \ + reg1 char *a = (A), *b = (B); \ + reg3 char *end= a+size; \ + do \ + { \ + char tmp = *a; *a++ = *b; *b++ = tmp; \ + } while (a < end); \ + } \ +} while (0) + +/* Put the median in the middle argument */ +#define MEDIAN(low, mid, high) \ +{ \ + if (CMP(high,low) < 0) \ + SWAP(high, low, size, ptr_cmp); \ + if (CMP(mid, low) < 0) \ + SWAP(mid, low, size, ptr_cmp); \ + else if (CMP(high, mid) < 0) \ + SWAP(mid, high, size, ptr_cmp); \ +} + +/* The following node is used to store ranges to avoid recursive calls */ + +typedef struct st_stack +{ + char *low,*high; +} stack_node; + +#define PUSH(LOW,HIGH) {stack_ptr->low = LOW; stack_ptr++->high = HIGH;} +#define POP(LOW,HIGH) {LOW = (--stack_ptr)->low; HIGH = stack_ptr->high;} + +/* The following stack size is enough for ulong ~0 elements */ +#define STACK_SIZE (8 * sizeof(unsigned long int)) +#define THRESHOLD_FOR_INSERT_SORT 10 +#if defined(QSORT_TYPE_IS_VOID) +#define SORT_RETURN return +#else +#define SORT_RETURN return 0 +#endif + +/**************************************************************************** +** 'standard' quicksort with the following extensions: +** +** Can be compiled with the qsort2_cmp compare function +** Store ranges on stack to avoid recursion +** Use insert sort on small ranges +** Optimize for sorting of pointers (used often by MySQL) +** Use median comparison to find partition element +*****************************************************************************/ + +#ifdef QSORT_EXTRA_CMP_ARGUMENT +qsort_t my_qsort2(void *base_ptr, size_t count, size_t size, qsort2_cmp cmp, + void *cmp_argument) +#else +qsort_t my_qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp) +#endif +{ + char *low, *high, *pivot; + stack_node stack[STACK_SIZE], *stack_ptr; + my_bool ptr_cmp; + /* Handle the simple case first */ + /* This will also make the rest of the code simpler */ + if (count <= 1) + SORT_RETURN; + + low = (char*) base_ptr; + high = low+ size * (count - 1); + stack_ptr = stack + 1; +#ifdef HAVE_purify + /* The first element in the stack will be accessed for the last POP */ + stack[0].low=stack[0].high=0; +#endif + pivot = (char *) my_alloca((int) size); + ptr_cmp= size == sizeof(char*) && !((low - (char*) 0)& (sizeof(char*)-1)); + + /* The following loop sorts elements between high and low */ + do + { + char *low_ptr, *high_ptr, *mid; + + count=((size_t) (high - low) / size)+1; + /* If count is small, then an insert sort is faster than qsort */ + if (count < THRESHOLD_FOR_INSERT_SORT) + { + for (low_ptr = low + size; low_ptr <= high; low_ptr += size) + { + char *ptr; + for (ptr = low_ptr; ptr > low && CMP(ptr - size, ptr) > 0; + ptr -= size) + SWAP(ptr, ptr - size, size, ptr_cmp); + } + POP(low, high); + continue; + } + + /* Try to find a good middle element */ + mid= low + size * (count >> 1); + if (count > 40) /* Must be bigger than 24 */ + { + size_t step = size* (count / 8); + MEDIAN(low, low + step, low+step*2); + MEDIAN(mid - step, mid, mid+step); + MEDIAN(high - 2 * step, high-step, high); + /* Put best median in 'mid' */ + MEDIAN(low+step, mid, high-step); + low_ptr = low; + high_ptr = high; + } + else + { + MEDIAN(low, mid, high); + /* The low and high argument are already in sorted against 'pivot' */ + low_ptr = low + size; + high_ptr = high - size; + } + memcpy(pivot, mid, size); + + do + { + while (CMP(low_ptr, pivot) < 0) + low_ptr += size; + while (CMP(pivot, high_ptr) < 0) + high_ptr -= size; + + if (low_ptr < high_ptr) + { + SWAP(low_ptr, high_ptr, size, ptr_cmp); + low_ptr += size; + high_ptr -= size; + } + else + { + if (low_ptr == high_ptr) + { + low_ptr += size; + high_ptr -= size; + } + break; + } + } + while (low_ptr <= high_ptr); + + /* + Prepare for next iteration. + Skip partitions of size 1 as these doesn't have to be sorted + Push the larger partition and sort the smaller one first. + This ensures that the stack is keept small. + */ + + if ((int) (high_ptr - low) <= 0) + { + if ((int) (high - low_ptr) <= 0) + { + POP(low, high); /* Nothing more to sort */ + } + else + low = low_ptr; /* Ignore small left part. */ + } + else if ((int) (high - low_ptr) <= 0) + high = high_ptr; /* Ignore small right part. */ + else if ((high_ptr - low) > (high - low_ptr)) + { + PUSH(low, high_ptr); /* Push larger left part */ + low = low_ptr; + } + else + { + PUSH(low_ptr, high); /* Push larger right part */ + high = high_ptr; + } + } while (stack_ptr > stack); + my_afree(pivot); + SORT_RETURN; +} diff --git a/externals/mysql/mysys/mf_qsort2.c b/externals/mysql/mysys/mf_qsort2.c new file mode 100644 index 00000000000..ca2bd1a4952 --- /dev/null +++ b/externals/mysql/mysys/mf_qsort2.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* qsort that sends one extra argument to the compare subrutine */ + +#define QSORT_EXTRA_CMP_ARGUMENT +#include "mf_qsort.c" diff --git a/externals/mysql/mysys/mf_radix.c b/externals/mysql/mysys/mf_radix.c new file mode 100644 index 00000000000..582ca76b8f8 --- /dev/null +++ b/externals/mysql/mysys/mf_radix.c @@ -0,0 +1,54 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Radixsort for pointers to fixed length strings. + A very quick sort for not to long (< 20 char) strings. + Neads a extra buffers of number_of_elements pointers but is + 2-3 times faster than quicksort +*/ + +#include "mysys_priv.h" +#include + + /* Radixsort */ + +void radixsort_for_str_ptr(uchar **base, uint number_of_elements, size_t size_of_element, uchar **buffer) +{ + uchar **end,**ptr,**buffer_ptr; + uint32 *count_ptr,*count_end,count[256]; + int pass; + + end=base+number_of_elements; count_end=count+256; + for (pass=(int) size_of_element-1 ; pass >= 0 ; pass--) + { + bzero((uchar*) count,sizeof(uint32)*256); + for (ptr= base ; ptr < end ; ptr++) + count[ptr[0][pass]]++; + if (count[0] == number_of_elements) + goto next; + for (count_ptr=count+1 ; count_ptr < count_end ; count_ptr++) + { + if (*count_ptr == number_of_elements) + goto next; + (*count_ptr)+= *(count_ptr-1); + } + for (ptr= end ; ptr-- != base ;) + buffer[--count[ptr[0][pass]]]= *ptr; + for (ptr=base, buffer_ptr=buffer ; ptr < end ;) + (*ptr++) = *buffer_ptr++; + next:; + } +} diff --git a/externals/mysql/mysys/mf_same.c b/externals/mysql/mysys/mf_same.c new file mode 100644 index 00000000000..6738dc8051e --- /dev/null +++ b/externals/mysql/mysys/mf_same.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Kopierar biblioteksstrukturen och extensionen fr}n ett filnamn */ + +#include "mysys_priv.h" +#include + + /* + Copy directory and/or extension between filenames. + (For the meaning of 'flag', check mf_format.c) + 'to' may be equal to 'name'. + Returns 'to'. + */ + +char * fn_same(char *to, const char *name, int flag) +{ + char dev[FN_REFLEN]; + const char *ext; + size_t dev_length; + DBUG_ENTER("fn_same"); + DBUG_PRINT("enter",("to: %s name: %s flag: %d",to,name,flag)); + + if ((ext=strrchr(name+dirname_part(dev, name, &dev_length),FN_EXTCHAR)) == 0) + ext=""; + + DBUG_RETURN(fn_format(to,to,dev,ext,flag)); +} /* fn_same */ diff --git a/externals/mysql/mysys/mf_sort.c b/externals/mysql/mysys/mf_sort.c new file mode 100644 index 00000000000..686ebbc1d14 --- /dev/null +++ b/externals/mysql/mysys/mf_sort.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Sort of string pointers in string-order with radix or qsort */ + +#include "mysys_priv.h" +#include + +void my_string_ptr_sort(uchar *base, uint items, size_t size) +{ +#if INT_MAX > 65536L + uchar **ptr=0; + + if (size <= 20 && items >= 1000 && items < 100000 && + (ptr= (uchar**) my_malloc(items*sizeof(char*),MYF(0)))) + { + radixsort_for_str_ptr((uchar**) base,items,size,ptr); + my_free((uchar*) ptr,MYF(0)); + } + else +#endif + { + if (size && items) + { + my_qsort2(base,items, sizeof(uchar*), get_ptr_compare(size), + (void*) &size); + } + } +} diff --git a/externals/mysql/mysys/mf_soundex.c b/externals/mysql/mysys/mf_soundex.c new file mode 100644 index 00000000000..fe30d8c81af --- /dev/null +++ b/externals/mysql/mysys/mf_soundex.c @@ -0,0 +1,105 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/**************************************************************** +* SOUNDEX ALGORITHM in C * +* * +* The basic Algorithm source is taken from EDN Nov. * +* 14, 1985 pg. 36. * +* * +* As a test Those in Illinois will find that the * +* first group of numbers in their drivers license * +* number is the soundex number for their last name. * +* * +* RHW PC-IBBS ID. #1230 * +* * +* As an extension if remove_garbage is set then all non- * +* alpha characters are skipped * +* * +* Note, that this implementation corresponds to the * +* original version of the algorithm, not to the more * +* popular "enhanced" version, described by Knuth. * +****************************************************************/ + +#include "mysys_priv.h" +#include +#include "my_static.h" + +static char get_scode(CHARSET_INFO * cs, char **ptr,pbool remove_garbage); + + /* outputed string is 4 byte long */ + /* out_pntr can be == in_pntr */ + +void soundex(CHARSET_INFO * cs,register char * out_pntr, char * in_pntr, + pbool remove_garbage) +{ + char ch,last_ch; + reg3 char * end; + register uchar *map=cs->to_upper; + + if (remove_garbage) + { + while (*in_pntr && !my_isalpha(cs,*in_pntr)) /* Skip pre-space */ + in_pntr++; + } + *out_pntr++ = map[(uchar)*in_pntr]; /* Copy first letter */ + last_ch = get_scode(cs,&in_pntr,0); /* code of the first letter */ + /* for the first 'double-letter */ + /* check. */ + end=out_pntr+3; /* Loop on input letters until */ + /* end of input (null) or output */ + /* letter code count = 3 */ + + in_pntr++; + while (out_pntr < end && (ch = get_scode(cs,&in_pntr,remove_garbage)) != 0) + { + in_pntr++; + if ((ch != '0') && (ch != last_ch)) /* if not skipped or double */ + { + *out_pntr++ = ch; /* letter, copy to output */ + } /* for next double-letter check */ + last_ch = ch; /* save code of last input letter */ + } + while (out_pntr < end) + *out_pntr++ = '0'; + *out_pntr=0; /* end string */ + return; +} /* soundex */ + + + /* + If alpha, map input letter to soundex code. + If not alpha and remove_garbage is set then skip to next char + else return 0 + */ + +static char get_scode(CHARSET_INFO * cs,char **ptr, pbool remove_garbage) +{ + uchar ch; + + if (remove_garbage) + { + while (**ptr && !my_isalpha(cs,**ptr)) + (*ptr)++; + } + ch=my_toupper(cs,**ptr); + if (ch < 'A' || ch > 'Z') + { + if (my_isalpha(cs,ch)) /* If extended alfa (country spec) */ + return '0'; /* threat as vokal */ + return 0; /* Can't map */ + } + return(soundex_map[ch-'A']); +} /* get_scode */ diff --git a/externals/mysql/mysys/mf_strip.c b/externals/mysql/mysys/mf_strip.c new file mode 100644 index 00000000000..b33620b1b2d --- /dev/null +++ b/externals/mysql/mysys/mf_strip.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* T|mmer en str{ng p{ slut_space */ + +#include "mysys_priv.h" + +/* + strip_sp(char * str) + Strips end-space from string and returns new length. +*/ + +size_t strip_sp(register char * str) +{ + reg2 char * found; + reg3 char * start; + + start=found=str; + + while (*str) + { + if (*str != ' ') + { + while (*++str && *str != ' ') {}; + if (!*str) + return (size_t) (str-start); /* Return stringlength */ + } + found=str; + while (*++str == ' ') {}; + } + *found= '\0'; /* Stripp at first space */ + return (size_t) (found-start); +} /* strip_sp */ diff --git a/externals/mysql/mysys/mf_tempdir.c b/externals/mysql/mysys/mf_tempdir.c new file mode 100644 index 00000000000..d6492c90965 --- /dev/null +++ b/externals/mysql/mysys/mf_tempdir.c @@ -0,0 +1,95 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + +#if defined( __WIN__) || defined(__NETWARE__) +#define DELIM ';' +#else +#define DELIM ':' +#endif + +my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist) +{ + char *end, *copy; + char buff[FN_REFLEN]; + DBUG_ENTER("init_tmpdir"); + DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL")); + + pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST); + if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5)) + goto err; + if (!pathlist || !pathlist[0]) + { + /* Get default temporary directory */ + pathlist=getenv("TMPDIR"); /* Use this if possible */ +#if defined( __WIN__) || defined(__NETWARE__) + if (!pathlist) + pathlist=getenv("TEMP"); + if (!pathlist) + pathlist=getenv("TMP"); +#endif + if (!pathlist || !pathlist[0]) + pathlist=(char*) P_tmpdir; + } + do + { + uint length; + end=strcend(pathlist, DELIM); + strmake(buff, pathlist, (uint) (end-pathlist)); + length= cleanup_dirname(buff, buff); + if (!(copy= my_strndup(buff, length, MYF(MY_WME))) || + insert_dynamic(&tmpdir->full_list, (uchar*) ©)) + DBUG_RETURN(TRUE); + pathlist=end+1; + } + while (*end); + freeze_size(&tmpdir->full_list); + tmpdir->list=(char **)tmpdir->full_list.buffer; + tmpdir->max=tmpdir->full_list.elements-1; + tmpdir->cur=0; + DBUG_RETURN(FALSE); + +err: + delete_dynamic(&tmpdir->full_list); /* Safe to free */ + pthread_mutex_destroy(&tmpdir->mutex); + DBUG_RETURN(TRUE); +} + + +char *my_tmpdir(MY_TMPDIR *tmpdir) +{ + char *dir; + if (!tmpdir->max) + return tmpdir->list[0]; + pthread_mutex_lock(&tmpdir->mutex); + dir=tmpdir->list[tmpdir->cur]; + tmpdir->cur= (tmpdir->cur == tmpdir->max) ? 0 : tmpdir->cur+1; + pthread_mutex_unlock(&tmpdir->mutex); + return dir; +} + +void free_tmpdir(MY_TMPDIR *tmpdir) +{ + uint i; + if (!tmpdir->full_list.elements) + return; + for (i=0; i<=tmpdir->max; i++) + my_free(tmpdir->list[i], MYF(0)); + delete_dynamic(&tmpdir->full_list); + pthread_mutex_destroy(&tmpdir->mutex); +} + diff --git a/externals/mysql/mysys/mf_tempfile.c b/externals/mysql/mysys/mf_tempfile.c new file mode 100644 index 00000000000..40016210de4 --- /dev/null +++ b/externals/mysql/mysys/mf_tempfile.c @@ -0,0 +1,189 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include +#include "my_static.h" +#include "mysys_err.h" +#include +#ifdef HAVE_PATHS_H +#include +#endif + + + +/* + @brief + Create a temporary file with unique name in a given directory + + @details + create_temp_file + to pointer to buffer where temporary filename will be stored + dir directory where to create the file + prefix prefix the filename with this + mode Flags to use for my_create/my_open + MyFlags Magic flags + + @return + File descriptor of opened file if success + -1 and sets errno if fails. + + @note + The behaviour of this function differs a lot between + implementation, it's main use is to generate a file with + a name that does not already exist. + + When passing O_TEMPORARY flag in "mode" the file should + be automatically deleted + + The implementation using mkstemp should be considered the + reference implementation when adding a new or modifying an + existing one + +*/ + +File create_temp_file(char *to, const char *dir, const char *prefix, + int mode __attribute__((unused)), + myf MyFlags __attribute__((unused))) +{ + File file= -1; +#ifdef __WIN__ + TCHAR path_buf[MAX_PATH-14]; +#endif + + DBUG_ENTER("create_temp_file"); + DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir, prefix)); +#if defined (__WIN__) + + /* + Use GetTempPath to determine path for temporary files. + This is because the documentation for GetTempFileName + has the following to say about this parameter: + "If this parameter is NULL, the function fails." + */ + if (!dir) + { + if(GetTempPath(sizeof(path_buf), path_buf) > 0) + dir = path_buf; + } + /* + Use GetTempFileName to generate a unique filename, create + the file and release it's handle + - uses up to the first three letters from prefix + */ + if (GetTempFileName(dir, prefix, 0, to) == 0) + DBUG_RETURN(-1); + + DBUG_PRINT("info", ("name: %s", to)); + + /* + Open the file without the "open only if file doesn't already exist" + since the file has already been created by GetTempFileName + */ + if ((file= my_open(to, (mode & ~O_EXCL), MyFlags)) < 0) + { + /* Open failed, remove the file created by GetTempFileName */ + int tmp= my_errno; + (void) my_delete(to, MYF(0)); + my_errno= tmp; + } + +#elif defined(_ZTC__) + if (!dir) + dir=getenv("TMPDIR"); + if ((res=tempnam((char*) dir,(char *) prefix))) + { + strmake(to,res,FN_REFLEN-1); + (*free)(res); + file=my_create(to, 0, mode | O_EXCL | O_NOFOLLOW, MyFlags); + } +#elif defined(HAVE_MKSTEMP) && !defined(__NETWARE__) + { + char prefix_buff[30]; + uint pfx_len; + File org_file; + + pfx_len= (uint) (strmov(strnmov(prefix_buff, + prefix ? prefix : "tmp.", + sizeof(prefix_buff)-7),"XXXXXX") - + prefix_buff); + if (!dir && ! (dir =getenv("TMPDIR"))) + dir=P_tmpdir; + if (strlen(dir)+ pfx_len > FN_REFLEN-2) + { + errno=my_errno= ENAMETOOLONG; + DBUG_RETURN(file); + } + strmov(convert_dirname(to,dir,NullS),prefix_buff); + org_file=mkstemp(to); + if (mode & O_TEMPORARY) + (void) my_delete(to, MYF(MY_WME | ME_NOINPUT)); + file=my_register_filename(org_file, to, FILE_BY_MKSTEMP, + EE_CANTCREATEFILE, MyFlags); + /* If we didn't manage to register the name, remove the temp file */ + if (org_file >= 0 && file < 0) + { + int tmp=my_errno; + close(org_file); + (void) my_delete(to, MYF(MY_WME | ME_NOINPUT)); + my_errno=tmp; + } + } +#elif defined(HAVE_TEMPNAM) + { +#if !defined(__NETWARE__) + extern char **environ; +#endif + + char *res,**old_env,*temp_env[1]; + if (dir && !dir[0]) + { /* Change empty string to current dir */ + to[0]= FN_CURLIB; + to[1]= 0; + dir=to; + } +#if !defined(__NETWARE__) + old_env= (char**) environ; + if (dir) + { /* Don't use TMPDIR if dir is given */ + environ=(const char**) temp_env; + temp_env[0]=0; + } +#endif + if ((res=tempnam((char*) dir, (char*) prefix))) + { + strmake(to,res,FN_REFLEN-1); + (*free)(res); + file=my_create(to,0, + (int) (O_RDWR | O_BINARY | O_TRUNC | O_EXCL | O_NOFOLLOW | + O_TEMPORARY | O_SHORT_LIVED), + MYF(MY_WME)); + + } + else + { + DBUG_PRINT("error",("Got error: %d from tempnam",errno)); + } +#if !defined(__NETWARE__) + environ=(const char**) old_env; +#endif + } +#else +#error No implementation found for create_temp_file +#endif + if (file >= 0) + thread_safe_increment(my_tmp_file_created,&THR_LOCK_open); + DBUG_RETURN(file); +} diff --git a/externals/mysql/mysys/mf_unixpath.c b/externals/mysql/mysys/mf_unixpath.c new file mode 100644 index 00000000000..75f8de14879 --- /dev/null +++ b/externals/mysql/mysys/mf_unixpath.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + + /* convert filename to unix style filename */ + /* If MSDOS converts '\' to '/' */ + +void to_unix_path(char * to __attribute__((unused))) +{ +#if FN_LIBCHAR != '/' + { + to--; + while ((to=strchr(to+1,FN_LIBCHAR)) != 0) + *to='/'; + } +#endif +} diff --git a/externals/mysql/mysys/mf_util.c b/externals/mysql/mysys/mf_util.c new file mode 100644 index 00000000000..248b72b8748 --- /dev/null +++ b/externals/mysql/mysys/mf_util.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Utilities with are missing on some systems */ + +#include "mysys_priv.h" +#ifdef __ZTC__ +#include +#endif + +#ifdef __ZTC__ + + /* On ZORTECH C we don't have a getpid() call */ + +int getpid(void) +{ + return (int) _psp; +} + +#ifndef M_IC80386 + + /* Define halloc and hfree in as in MSC */ + +void * __CDECL halloc(long count,size_t length) +{ + return (void*) MK_FP(dos_alloc((uint) ((count*length+15) >> 4)),0); +} + +void __CDECL hfree(void *ptr) +{ + dos_free(FP_SEG(ptr)); +} + +#endif /* M_IC80386 */ +#endif /* __ZTC__ */ diff --git a/externals/mysql/mysys/mf_wcomp.c b/externals/mysql/mysys/mf_wcomp.c new file mode 100644 index 00000000000..4786537d1a5 --- /dev/null +++ b/externals/mysql/mysys/mf_wcomp.c @@ -0,0 +1,89 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Funktions for comparing with wild-cards */ + +#include "mysys_priv.h" + + /* Test if a string is "comparable" to a wild-card string */ + /* returns 0 if the strings are "comparable" */ + +char wild_many='*'; +char wild_one='?'; +char wild_prefix=0; /* QQ this can potentially cause a SIGSEGV */ + +int wild_compare(register const char *str, register const char *wildstr, + pbool str_is_pattern) +{ + char cmp; + DBUG_ENTER("wild_compare"); + + while (*wildstr) + { + while (*wildstr && *wildstr != wild_many && *wildstr != wild_one) + { + if (*wildstr == wild_prefix && wildstr[1]) + { + wildstr++; + if (str_is_pattern && *str++ != wild_prefix) + DBUG_RETURN(1); + } + if (*wildstr++ != *str++) + DBUG_RETURN(1); + } + if (! *wildstr ) + DBUG_RETURN(*str != 0); + if (*wildstr++ == wild_one) + { + if (! *str || (str_is_pattern && *str == wild_many)) + DBUG_RETURN(1); /* One char; skip */ + if (*str++ == wild_prefix && str_is_pattern && *str) + str++; + } + else + { /* Found '*' */ + while (str_is_pattern && *str == wild_many) + str++; + for (; *wildstr == wild_many || *wildstr == wild_one; wildstr++) + if (*wildstr == wild_many) + { + while (str_is_pattern && *str == wild_many) + str++; + } + else + { + if (str_is_pattern && *str == wild_prefix && str[1]) + str+=2; + else if (! *str++) + DBUG_RETURN (1); + } + if (!*wildstr) + DBUG_RETURN(0); /* '*' as last char: OK */ + if ((cmp= *wildstr) == wild_prefix && wildstr[1] && !str_is_pattern) + cmp=wildstr[1]; + for (;;str++) + { + while (*str && *str != cmp) + str++; + if (!*str) + DBUG_RETURN (1); + if (wild_compare(str,wildstr,str_is_pattern) == 0) + DBUG_RETURN (0); + } + /* We will never come here */ + } + } + DBUG_RETURN (*str != 0); +} /* wild_compare */ diff --git a/externals/mysql/mysys/mf_wfile.c b/externals/mysql/mysys/mf_wfile.c new file mode 100644 index 00000000000..f98d348994e --- /dev/null +++ b/externals/mysql/mysys/mf_wfile.c @@ -0,0 +1,124 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Functions for finding files with wildcards */ + +/* + The following file-name-test is supported: + - "name [[,] name...] ; Matches any of used filenames. + Each name can have "*" and/or "?" + wild-cards. + - [wildspec [,]] !wildspec2 ; File that matches wildspec and not + wildspec2. +*/ + +#include "mysys_priv.h" +#include + + /* Store wildcard-string in a easyer format */ + +WF_PACK *wf_comp(char * str) +{ + uint ant; + int not_pos; + register char * pos; + char * buffer; + WF_PACK *ret; + DBUG_ENTER("wf_comp"); + + not_pos= -1; /* Skip space and '!' in front */ + while (*str == ' ') + str++; + if (*str == '!') + { + not_pos=0; + while (*++str == ' ') {}; + } + if (*str == 0) /* Empty == everything */ + DBUG_RETURN((WF_PACK *) NULL); + + ant=1; /* Count filespecs */ + for (pos=str ; *pos ; pos++) + ant+= test(*pos == ' ' || *pos == ','); + + if ((ret= (WF_PACK*) my_malloc((uint) ant*(sizeof(char **)+2)+ + sizeof(WF_PACK)+ (uint) strlen(str)+1, + MYF(MY_WME))) + == 0) + DBUG_RETURN((WF_PACK *) NULL); + ret->wild= (char **) (ret+1); + buffer= (char *) (ret->wild+ant); + + ant=0; + for (pos=str ; *pos ; str= pos) + { + ret->wild[ant++]=buffer; + while (*pos != ' ' && *pos != ',' && *pos != '!' && *pos) + *buffer++ = *pos++; + + *buffer++ = '\0'; + while (*pos == ' ' || *pos == ',' || *pos == '!' ) + if (*pos++ == '!' && not_pos <0) + not_pos=(int) ant; + } + + ret->wilds=ant; + if (not_pos <0) + ret->not_pos=ant; + else + ret->not_pos=(uint) not_pos; + + DBUG_PRINT("exit",("antal: %d not_pos: %d",ret->wilds,ret->not_pos)); + DBUG_RETURN(ret); +} /* wf_comp */ + + + /* Test if a given filename is matched */ + +int wf_test(register WF_PACK *wf_pack, register const char *name) +{ + reg2 uint i; + reg3 uint not_pos; + DBUG_ENTER("wf_test"); + + if (! wf_pack || wf_pack->wilds == 0) + DBUG_RETURN(0); /* Everything goes */ + + not_pos=wf_pack->not_pos; + for (i=0 ; i < not_pos; i++) + if (wild_compare(name,wf_pack->wild[i],0) == 0) + goto found; + if (i) + DBUG_RETURN(1); /* No-match */ + +found: +/* Test that it isn't in not-list */ + + for (i=not_pos ; i < wf_pack->wilds; i++) + if (wild_compare(name,wf_pack->wild[i],0) == 0) + DBUG_RETURN(1); + DBUG_RETURN(0); +} /* wf_test */ + + + /* We need this because program don't know with malloc we used */ + +void wf_end(WF_PACK *buffer) +{ + DBUG_ENTER("wf_end"); + if (buffer) + my_free((uchar*) buffer,MYF(0)); + DBUG_VOID_RETURN; +} /* wf_end */ diff --git a/externals/mysql/mysys/mulalloc.c b/externals/mysql/mysys/mulalloc.c new file mode 100644 index 00000000000..f4ca3d9f9ab --- /dev/null +++ b/externals/mysql/mysys/mulalloc.c @@ -0,0 +1,63 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + +/* + Malloc many pointers at the same time + Only ptr1 can be free'd, and doing this will free all + the memory allocated. ptr2, etc all point inside big allocated + memory area. + + SYNOPSIS + my_multi_malloc() + myFlags Flags + ptr1, length1 Multiple arguments terminated by null ptr + ptr2, length2 ... + ... + NULL +*/ + +void* my_multi_malloc(myf myFlags, ...) +{ + va_list args; + char **ptr,*start,*res; + size_t tot_length,length; + DBUG_ENTER("my_multi_malloc"); + + va_start(args,myFlags); + tot_length=0; + while ((ptr=va_arg(args, char **))) + { + length=va_arg(args,uint); + tot_length+=ALIGN_SIZE(length); + } + va_end(args); + + if (!(start=(char *) my_malloc(tot_length,myFlags))) + DBUG_RETURN(0); /* purecov: inspected */ + + va_start(args,myFlags); + res=start; + while ((ptr=va_arg(args, char **))) + { + *ptr=res; + length=va_arg(args,uint); + res+=ALIGN_SIZE(length); + } + va_end(args); + DBUG_RETURN((void*) start); +} diff --git a/externals/mysql/mysys/my_access.c b/externals/mysql/mysys/my_access.c new file mode 100644 index 00000000000..210946d50a8 --- /dev/null +++ b/externals/mysql/mysys/my_access.c @@ -0,0 +1,201 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + +#ifdef __WIN__ + +/* + Check a file or path for accessability. + + SYNOPSIS + file_access() + path Path to file + amode Access method + + DESCRIPTION + This function wraps the normal access method because the access + available in MSVCRT> +reports that filenames such as LPT1 and + COM1 are valid (they are but should not be so for us). + + RETURN VALUES + 0 ok + -1 error (We use -1 as my_access is mapped to access on other platforms) +*/ + +int my_access(const char *path, int amode) +{ + WIN32_FILE_ATTRIBUTE_DATA fileinfo; + BOOL result; + + result= GetFileAttributesEx(path, GetFileExInfoStandard, &fileinfo); + if (! result || + (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) + { + my_errno= errno= EACCES; + return -1; + } + return 0; +} + +#endif /* __WIN__ */ + + +/* + List of file names that causes problem on windows + + NOTE that one can also not have file names of type CON.TXT + + NOTE: it is important to keep "CLOCK$" on the first place, + we skip it in check_if_legal_tablename. +*/ +static const char *reserved_names[]= +{ + "CLOCK$", + "CON", "PRN", "AUX", "NUL", + "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", + "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", + NullS +}; + +#define MAX_RESERVED_NAME_LENGTH 6 + + +/* + Looks up a null-terminated string in a list, + case insensitively. + + SYNOPSIS + str_list_find() + list list of items + str item to find + + RETURN + 0 ok + 1 reserved file name +*/ +static int str_list_find(const char **list, const char *str) +{ + const char **name; + for (name= list; *name; name++) + { + if (!my_strcasecmp(&my_charset_latin1, *name, str)) + return 1; + } + return 0; +} + + +/* + A map for faster reserved_names lookup, + helps to avoid loops in many cases. + 1 - can be the first letter + 2 - can be the second letter + 4 - can be the third letter +*/ +static char reserved_map[256]= +{ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* !"#$%&'()*+,-./ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0123456789:;<=>? */ + 0,1,0,1,0,0,0,0,0,0,0,0,7,4,5,2, /* @ABCDEFGHIJKLMNO */ + 3,0,2,0,4,2,0,0,4,0,0,0,0,0,0,0, /* PQRSTUVWXYZ[\]^_ */ + 0,1,0,1,0,0,0,0,0,0,0,0,7,4,5,2, /* bcdefghijklmno */ + 3,0,2,0,4,2,0,0,4,0,0,0,0,0,0,0, /* pqrstuvwxyz{|}~. */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* ................ */ +}; + + +/* + Check if a table name may cause problems + + SYNOPSIS + check_if_legal_tablename + name Table name (without any extensions) + + DESCRIPTION + We don't check 'CLOCK$' because dollar sign is encoded as @0024, + making table file name 'CLOCK@0024', which is safe. + This is why we start lookup from the second element + (i.e. &reserver_name[1]) + + RETURN + 0 ok + 1 reserved file name +*/ + +int check_if_legal_tablename(const char *name) +{ + DBUG_ENTER("check_if_legal_tablename"); + DBUG_RETURN((reserved_map[(uchar) name[0]] & 1) && + (reserved_map[(uchar) name[1]] & 2) && + (reserved_map[(uchar) name[2]] & 4) && + str_list_find(&reserved_names[1], name)); +} + + +#if defined(__WIN__) || defined(__EMX__) + + +/* + Check if a path will access a reserverd file name that may cause problems + + SYNOPSIS + check_if_legal_filename + path Path to file + + RETURN + 0 ok + 1 reserved file name +*/ + +int check_if_legal_filename(const char *path) +{ + const char *end; + const char **reserved_name; + DBUG_ENTER("check_if_legal_filename"); + + path+= dirname_length(path); /* To start of filename */ + if (!(end= strchr(path, FN_EXTCHAR))) + end= strend(path); + if (path == end || (uint) (end - path) > MAX_RESERVED_NAME_LENGTH) + DBUG_RETURN(0); /* Simplify inner loop */ + + for (reserved_name= reserved_names; *reserved_name; reserved_name++) + { + const char *reserved= *reserved_name; /* never empty */ + const char *name= path; + + do + { + if (*reserved != my_toupper(&my_charset_latin1, *name)) + break; + if (++name == end && !reserved[1]) + DBUG_RETURN(1); /* Found wrong path */ + } while (*++reserved); + } + DBUG_RETURN(0); +} + +#endif /* defined(__WIN__) || defined(__EMX__) */ diff --git a/externals/mysql/mysys/my_aes.c b/externals/mysql/mysys/my_aes.c new file mode 100644 index 00000000000..575d4702dee --- /dev/null +++ b/externals/mysql/mysys/my_aes.c @@ -0,0 +1,227 @@ +/* Copyright (C) 2002 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +/* + Implementation of AES Encryption for MySQL + Initial version by Peter Zaitsev June 2002 +*/ + + +#include +#include +#include "my_aes.h" + +enum encrypt_dir { AES_ENCRYPT, AES_DECRYPT }; + +#define AES_BLOCK_SIZE 16 /* Block size in bytes */ + +#define AES_BAD_DATA -1 /* If bad data discovered during decoding */ + + +/* The structure for key information */ +typedef struct { + int nr; /* Number of rounds */ + uint32 rk[4*(AES_MAXNR + 1)]; /* key schedule */ +} KEYINSTANCE; + + +/* + This is internal function just keeps joint code of Key generation + + SYNOPSIS + my_aes_create_key() + aes_key Address of Key Instance to be created + direction Direction (are we encoding or decoding) + key Key to use for real key creation + key_length Length of the key + + DESCRIPTION + + RESULT + 0 ok + -1 Error Note: The current impementation never returns this +*/ + +static int my_aes_create_key(KEYINSTANCE *aes_key, + enum encrypt_dir direction, const char *key, + int key_length) +{ + uint8 rkey[AES_KEY_LENGTH/8]; /* The real key to be used for encryption */ + uint8 *rkey_end=rkey+AES_KEY_LENGTH/8; /* Real key boundary */ + uint8 *ptr; /* Start of the real key*/ + const char *sptr; /* Start of the working key */ + const char *key_end=key+key_length; /* Working key boundary*/ + + bzero((char*) rkey,AES_KEY_LENGTH/8); /* Set initial key */ + + for (ptr= rkey, sptr= key; sptr < key_end; ptr++,sptr++) + { + if (ptr == rkey_end) + ptr= rkey; /* Just loop over tmp_key until we used all key */ + *ptr^= (uint8) *sptr; + } +#ifdef AES_USE_KEY_BITS + /* + This block is intended to allow more weak encryption if application + build with libmysqld needs to correspond to export regulations + It should be never used in normal distribution as does not give + any speed improvement. + To get worse security define AES_USE_KEY_BITS to number of bits + you want key to be. It should be divisible by 8 + + WARNING: Changing this value results in changing of enryption for + all key lengths so altering this value will result in impossibility + to decrypt data encrypted with previous value + */ +#define AES_USE_KEY_BYTES (AES_USE_KEY_BITS/8) + /* + To get weaker key we use first AES_USE_KEY_BYTES bytes of created key + and cyclically copy them until we created all required key length + */ + for (ptr= rkey+AES_USE_KEY_BYTES, sptr=rkey ; ptr < rkey_end; + ptr++,sptr++) + { + if (sptr == rkey+AES_USE_KEY_BYTES) + sptr=rkey; + *ptr=*sptr; + } +#endif + if (direction == AES_DECRYPT) + aes_key->nr = rijndaelKeySetupDec(aes_key->rk, rkey, AES_KEY_LENGTH); + else + aes_key->nr = rijndaelKeySetupEnc(aes_key->rk, rkey, AES_KEY_LENGTH); + return 0; +} + + +/* + Crypt buffer with AES encryption algorithm. + + SYNOPSIS + my_aes_encrypt() + source Pointer to data for encryption + source_length Size of encryption data + dest Buffer to place encrypted data (must be large enough) + key Key to be used for encryption + key_length Length of the key. Will handle keys of any length + + RETURN + >= 0 Size of encrypted data + < 0 Error +*/ + +int my_aes_encrypt(const char* source, int source_length, char* dest, + const char* key, int key_length) +{ + KEYINSTANCE aes_key; + uint8 block[AES_BLOCK_SIZE]; /* 128 bit block used for padding */ + int rc; /* result codes */ + int num_blocks; /* number of complete blocks */ + char pad_len; /* pad size for the last block */ + int i; + + if ((rc= my_aes_create_key(&aes_key,AES_ENCRYPT,key,key_length))) + return rc; + + num_blocks = source_length/AES_BLOCK_SIZE; + + for (i = num_blocks; i > 0; i--) /* Encode complete blocks */ + { + rijndaelEncrypt(aes_key.rk, aes_key.nr, (const uint8*) source, + (uint8*) dest); + source+= AES_BLOCK_SIZE; + dest+= AES_BLOCK_SIZE; + } + + /* Encode the rest. We always have incomplete block */ + pad_len = AES_BLOCK_SIZE - (source_length - AES_BLOCK_SIZE*num_blocks); + memcpy(block, source, 16 - pad_len); + bfill(block + AES_BLOCK_SIZE - pad_len, pad_len, pad_len); + rijndaelEncrypt(aes_key.rk, aes_key.nr, block, (uint8*) dest); + return AES_BLOCK_SIZE*(num_blocks + 1); +} + + +/* + DeCrypt buffer with AES encryption algorithm. + + SYNOPSIS + my_aes_decrypt() + source Pointer to data for decryption + source_length Size of encrypted data + dest Buffer to place decrypted data (must be large enough) + key Key to be used for decryption + key_length Length of the key. Will handle keys of any length + + RETURN + >= 0 Size of encrypted data + < 0 Error +*/ + +int my_aes_decrypt(const char *source, int source_length, char *dest, + const char *key, int key_length) +{ + KEYINSTANCE aes_key; + uint8 block[AES_BLOCK_SIZE]; /* 128 bit block used for padding */ + int rc; /* Result codes */ + int num_blocks; /* Number of complete blocks */ + uint pad_len; /* Pad size for the last block */ + int i; + + if ((rc=my_aes_create_key(&aes_key,AES_DECRYPT,key,key_length))) + return rc; + + num_blocks = source_length/AES_BLOCK_SIZE; + + if ((source_length != num_blocks*AES_BLOCK_SIZE) || num_blocks ==0 ) + return AES_BAD_DATA; /* Input size has to be even and at least one block */ + + for (i = num_blocks-1; i > 0; i--) /* Decode all but last blocks */ + { + rijndaelDecrypt(aes_key.rk, aes_key.nr, (const uint8*) source, + (uint8*) dest); + source+= AES_BLOCK_SIZE; + dest+= AES_BLOCK_SIZE; + } + + rijndaelDecrypt(aes_key.rk, aes_key.nr, (const uint8*) source, block); + /* Use last char in the block as size */ + pad_len = (uint) (uchar) block[AES_BLOCK_SIZE-1]; + + if (pad_len > AES_BLOCK_SIZE) + return AES_BAD_DATA; + /* We could also check whole padding but we do not really need this */ + + memcpy(dest, block, AES_BLOCK_SIZE - pad_len); + return AES_BLOCK_SIZE*num_blocks - pad_len; +} + + +/* + Get size of buffer which will be large enough for encrypted data + + SYNOPSIS + my_aes_get_size() + source_length Length of data to be encrypted + + RETURN + Size of buffer required to store encrypted data +*/ + +int my_aes_get_size(int source_length) +{ + return AES_BLOCK_SIZE*(source_length/AES_BLOCK_SIZE)+AES_BLOCK_SIZE; +} diff --git a/dep/include/mysql/mysql_embed.h b/externals/mysql/mysys/my_alarm.c similarity index 59% rename from dep/include/mysql/mysql_embed.h rename to externals/mysql/mysys/my_alarm.c index 2e44c99a192..d6a0da1bd13 100644 --- a/dep/include/mysql/mysql_embed.h +++ b/externals/mysql/mysys/my_alarm.c @@ -13,20 +13,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Defines that are unique to the embedded version of MySQL */ +/* Function to set a varible when we got a alarm */ +/* Used by my_lock samt functions in m_alarm.h */ -#ifdef EMBEDDED_LIBRARY -/* Things we don't need in the embedded version of MySQL */ -/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */ +#include "mysys_priv.h" +#include "my_alarm.h" -#undef HAVE_PSTACK /* No stacktrace */ -#undef HAVE_DLOPEN /* No udf functions */ -#undef HAVE_OPENSSL -#undef HAVE_SMEM /* No shared memory */ -#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ +#ifdef HAVE_ALARM -#define DONT_USE_RAID - -#endif /* EMBEDDED_LIBRARY */ + /* ARGSUSED */ +sig_handler my_set_alarm_variable(int signo __attribute__((unused))) +{ + my_have_got_alarm=1; /* Tell program that time expired */ + return; +} +#endif /* HAVE_ALARM */ diff --git a/externals/mysql/mysys/my_alloc.c b/externals/mysql/mysys/my_alloc.c new file mode 100644 index 00000000000..80add2f4936 --- /dev/null +++ b/externals/mysql/mysys/my_alloc.c @@ -0,0 +1,420 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Routines to handle mallocing of results which will be freed the same time */ + +#include +#include +#include +#undef EXTRA_DEBUG +#define EXTRA_DEBUG + + +/* + Initialize memory root + + SYNOPSIS + init_alloc_root() + mem_root - memory root to initialize + block_size - size of chunks (blocks) used for memory allocation + (It is external size of chunk i.e. it should include + memory required for internal structures, thus it + should be no less than ALLOC_ROOT_MIN_BLOCK_SIZE) + pre_alloc_size - if non-0, then size of block that should be + pre-allocated during memory root initialization. + + DESCRIPTION + This function prepares memory root for further use, sets initial size of + chunk for memory allocation and pre-allocates first block if specified. + Altough error can happen during execution of this function if + pre_alloc_size is non-0 it won't be reported. Instead it will be + reported as error in first alloc_root() on this memory root. +*/ + +void init_alloc_root(MEM_ROOT *mem_root, size_t block_size, + size_t pre_alloc_size __attribute__((unused))) +{ + DBUG_ENTER("init_alloc_root"); + DBUG_PRINT("enter",("root: %p", mem_root)); + + mem_root->free= mem_root->used= mem_root->pre_alloc= 0; + mem_root->min_malloc= 32; + mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE; + mem_root->error_handler= 0; + mem_root->block_num= 4; /* We shift this with >>2 */ + mem_root->first_block_usage= 0; + +#if !(defined(HAVE_purify) && defined(EXTRA_DEBUG)) + if (pre_alloc_size) + { + if ((mem_root->free= mem_root->pre_alloc= + (USED_MEM*) my_malloc(pre_alloc_size+ ALIGN_SIZE(sizeof(USED_MEM)), + MYF(0)))) + { + mem_root->free->size= pre_alloc_size+ALIGN_SIZE(sizeof(USED_MEM)); + mem_root->free->left= pre_alloc_size; + mem_root->free->next= 0; + } + } +#endif + DBUG_VOID_RETURN; +} + + +/* + SYNOPSIS + reset_root_defaults() + mem_root memory root to change defaults of + block_size new value of block size. Must be greater or equal + than ALLOC_ROOT_MIN_BLOCK_SIZE (this value is about + 68 bytes and depends on platform and compilation flags) + pre_alloc_size new size of preallocated block. If not zero, + must be equal to or greater than block size, + otherwise means 'no prealloc'. + DESCRIPTION + Function aligns and assigns new value to block size; then it tries to + reuse one of existing blocks as prealloc block, or malloc new one of + requested size. If no blocks can be reused, all unused blocks are freed + before allocation. +*/ + +void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, + size_t pre_alloc_size __attribute__((unused))) +{ + DBUG_ASSERT(alloc_root_inited(mem_root)); + + mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE; +#if !(defined(HAVE_purify) && defined(EXTRA_DEBUG)) + if (pre_alloc_size) + { + size_t size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM)); + if (!mem_root->pre_alloc || mem_root->pre_alloc->size != size) + { + USED_MEM *mem, **prev= &mem_root->free; + /* + Free unused blocks, so that consequent calls + to reset_root_defaults won't eat away memory. + */ + while (*prev) + { + mem= *prev; + if (mem->size == size) + { + /* We found a suitable block, no need to do anything else */ + mem_root->pre_alloc= mem; + return; + } + if (mem->left + ALIGN_SIZE(sizeof(USED_MEM)) == mem->size) + { + /* remove block from the list and free it */ + *prev= mem->next; + my_free(mem, MYF(0)); + } + else + prev= &mem->next; + } + /* Allocate new prealloc block and add it to the end of free list */ + if ((mem= (USED_MEM *) my_malloc(size, MYF(0)))) + { + mem->size= size; + mem->left= pre_alloc_size; + mem->next= *prev; + *prev= mem_root->pre_alloc= mem; + } + else + { + mem_root->pre_alloc= 0; + } + } + } + else +#endif + mem_root->pre_alloc= 0; +} + + +void *alloc_root(MEM_ROOT *mem_root, size_t length) +{ +#if defined(HAVE_purify) && defined(EXTRA_DEBUG) + reg1 USED_MEM *next; + DBUG_ENTER("alloc_root"); + DBUG_PRINT("enter",("root: %p", mem_root)); + + DBUG_ASSERT(alloc_root_inited(mem_root)); + + length+=ALIGN_SIZE(sizeof(USED_MEM)); + if (!(next = (USED_MEM*) my_malloc(length,MYF(MY_WME | ME_FATALERROR)))) + { + if (mem_root->error_handler) + (*mem_root->error_handler)(); + DBUG_RETURN((uchar*) 0); /* purecov: inspected */ + } + next->next= mem_root->used; + next->size= length; + mem_root->used= next; + DBUG_PRINT("exit",("ptr: %p", (((char*) next)+ + ALIGN_SIZE(sizeof(USED_MEM))))); + DBUG_RETURN((uchar*) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); +#else + size_t get_size, block_size; + uchar* point; + reg1 USED_MEM *next= 0; + reg2 USED_MEM **prev; + DBUG_ENTER("alloc_root"); + DBUG_PRINT("enter",("root: %p", mem_root)); + DBUG_ASSERT(alloc_root_inited(mem_root)); + + length= ALIGN_SIZE(length); + if ((*(prev= &mem_root->free)) != NULL) + { + if ((*prev)->left < length && + mem_root->first_block_usage++ >= ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP && + (*prev)->left < ALLOC_MAX_BLOCK_TO_DROP) + { + next= *prev; + *prev= next->next; /* Remove block from list */ + next->next= mem_root->used; + mem_root->used= next; + mem_root->first_block_usage= 0; + } + for (next= *prev ; next && next->left < length ; next= next->next) + prev= &next->next; + } + if (! next) + { /* Time to alloc new block */ + block_size= mem_root->block_size * (mem_root->block_num >> 2); + get_size= length+ALIGN_SIZE(sizeof(USED_MEM)); + get_size= max(get_size, block_size); + + if (!(next = (USED_MEM*) my_malloc(get_size,MYF(MY_WME | ME_FATALERROR)))) + { + if (mem_root->error_handler) + (*mem_root->error_handler)(); + DBUG_RETURN((void*) 0); /* purecov: inspected */ + } + mem_root->block_num++; + next->next= *prev; + next->size= get_size; + next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM)); + *prev=next; + } + + point= (uchar*) ((char*) next+ (next->size-next->left)); + /*TODO: next part may be unneded due to mem_root->first_block_usage counter*/ + if ((next->left-= length) < mem_root->min_malloc) + { /* Full block */ + *prev= next->next; /* Remove block from list */ + next->next= mem_root->used; + mem_root->used= next; + mem_root->first_block_usage= 0; + } + DBUG_PRINT("exit",("ptr: %p", point)); + DBUG_RETURN((void*) point); +#endif +} + + +/* + Allocate many pointers at the same time. + + DESCRIPTION + ptr1, ptr2, etc all point into big allocated memory area. + + SYNOPSIS + multi_alloc_root() + root Memory root + ptr1, length1 Multiple arguments terminated by a NULL pointer + ptr2, length2 ... + ... + NULL + + RETURN VALUE + A pointer to the beginning of the allocated memory block + in case of success or NULL if out of memory. +*/ + +void *multi_alloc_root(MEM_ROOT *root, ...) +{ + va_list args; + char **ptr, *start, *res; + size_t tot_length, length; + DBUG_ENTER("multi_alloc_root"); + + va_start(args, root); + tot_length= 0; + while ((ptr= va_arg(args, char **))) + { + length= va_arg(args, uint); + tot_length+= ALIGN_SIZE(length); + } + va_end(args); + + if (!(start= (char*) alloc_root(root, tot_length))) + DBUG_RETURN(0); /* purecov: inspected */ + + va_start(args, root); + res= start; + while ((ptr= va_arg(args, char **))) + { + *ptr= res; + length= va_arg(args, uint); + res+= ALIGN_SIZE(length); + } + va_end(args); + DBUG_RETURN((void*) start); +} + +#define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left) + +/* Mark all data in blocks free for reusage */ + +static inline void mark_blocks_free(MEM_ROOT* root) +{ + reg1 USED_MEM *next; + reg2 USED_MEM **last; + + /* iterate through (partially) free blocks, mark them free */ + last= &root->free; + for (next= root->free; next; next= *(last= &next->next)) + { + next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM)); + TRASH_MEM(next); + } + + /* Combine the free and the used list */ + *last= next=root->used; + + /* now go through the used blocks and mark them free */ + for (; next; next= next->next) + { + next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM)); + TRASH_MEM(next); + } + + /* Now everything is set; Indicate that nothing is used anymore */ + root->used= 0; + root->first_block_usage= 0; +} + + +/* + Deallocate everything used by alloc_root or just move + used blocks to free list if called with MY_USED_TO_FREE + + SYNOPSIS + free_root() + root Memory root + MyFlags Flags for what should be freed: + + MY_MARK_BLOCKS_FREED Don't free blocks, just mark them free + MY_KEEP_PREALLOC If this is not set, then free also the + preallocated block + + NOTES + One can call this function either with root block initialised with + init_alloc_root() or with a bzero()-ed block. + It's also safe to call this multiple times with the same mem_root. +*/ + +void free_root(MEM_ROOT *root, myf MyFlags) +{ + reg1 USED_MEM *next,*old; + DBUG_ENTER("free_root"); + DBUG_PRINT("enter",("root: %p flags: %u", root, (uint) MyFlags)); + + if (MyFlags & MY_MARK_BLOCKS_FREE) + { + mark_blocks_free(root); + DBUG_VOID_RETURN; + } + if (!(MyFlags & MY_KEEP_PREALLOC)) + root->pre_alloc=0; + + for (next=root->used; next ;) + { + old=next; next= next->next ; + if (old != root->pre_alloc) + my_free(old,MYF(0)); + } + for (next=root->free ; next ;) + { + old=next; next= next->next; + if (old != root->pre_alloc) + my_free(old,MYF(0)); + } + root->used=root->free=0; + if (root->pre_alloc) + { + root->free=root->pre_alloc; + root->free->left=root->pre_alloc->size-ALIGN_SIZE(sizeof(USED_MEM)); + TRASH_MEM(root->pre_alloc); + root->free->next=0; + } + root->block_num= 4; + root->first_block_usage= 0; + DBUG_VOID_RETURN; +} + +/* + Find block that contains an object and set the pre_alloc to it +*/ + +void set_prealloc_root(MEM_ROOT *root, char *ptr) +{ + USED_MEM *next; + for (next=root->used; next ; next=next->next) + { + if ((char*) next <= ptr && (char*) next + next->size > ptr) + { + root->pre_alloc=next; + return; + } + } + for (next=root->free ; next ; next=next->next) + { + if ((char*) next <= ptr && (char*) next + next->size > ptr) + { + root->pre_alloc=next; + return; + } + } +} + + +char *strdup_root(MEM_ROOT *root, const char *str) +{ + return strmake_root(root, str, strlen(str)); +} + + +char *strmake_root(MEM_ROOT *root, const char *str, size_t len) +{ + char *pos; + if ((pos=alloc_root(root,len+1))) + { + memcpy(pos,str,len); + pos[len]=0; + } + return pos; +} + + +void *memdup_root(MEM_ROOT *root, const void *str, size_t len) +{ + char *pos; + if ((pos=alloc_root(root,len))) + memcpy(pos,str,len); + return pos; +} diff --git a/externals/mysql/mysys/my_append.c b/externals/mysql/mysys/my_append.c new file mode 100644 index 00000000000..d410df1296f --- /dev/null +++ b/externals/mysql/mysys/my_append.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include +#include +#if defined(HAVE_UTIME_H) +#include +#elif defined(HAVE_SYS_UTIME_H) +#include +#elif !defined(HPUX10) +struct utimbuf { + time_t actime; + time_t modtime; +}; +#endif + +/* + Append a file to another + + NOTES + Don't set MY_FNABP or MY_NABP bits on when calling this function +*/ + +int my_append(const char *from, const char *to, myf MyFlags) +{ + uint Count; + File from_file,to_file; + uchar buff[IO_SIZE]; + DBUG_ENTER("my_append"); + DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); + + from_file= to_file= -1; + + if ((from_file=my_open(from,O_RDONLY,MyFlags)) >= 0) + { + if ((to_file=my_open(to,O_APPEND | O_WRONLY,MyFlags)) >= 0) + { + while ((Count=my_read(from_file,buff,IO_SIZE,MyFlags)) != 0) + if (Count == (uint) -1 || + my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP))) + goto err; + if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags)) + DBUG_RETURN(-1); /* Error on close */ + DBUG_RETURN(0); + } + } +err: + if (from_file >= 0) (void) my_close(from_file,MyFlags); + if (to_file >= 0) (void) my_close(to_file,MyFlags); + DBUG_RETURN(-1); +} diff --git a/externals/mysql/mysys/my_atomic.c b/externals/mysql/mysys/my_atomic.c new file mode 100644 index 00000000000..df6490b5770 --- /dev/null +++ b/externals/mysql/mysys/my_atomic.c @@ -0,0 +1,45 @@ +/* Copyright (C) 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +#ifndef HAVE_INLINE +/* the following will cause all inline functions to be instantiated */ +#define HAVE_INLINE +#undef STATIC_INLINE +#define STATIC_INLINE extern +#endif + +#include + +/* + checks that the current build of atomic ops + can run on this machine + + RETURN + ATOMIC_xxx values, see my_atomic.h +*/ +int my_atomic_initialize() +{ + compile_time_assert(sizeof(intptr) == sizeof(void *)); + /* currently the only thing worth checking is SMP/UP issue */ +#ifdef MY_ATOMIC_MODE_DUMMY + return my_getncpus() == 1 ? MY_ATOMIC_OK : MY_ATOMIC_NOT_1CPU; +#else + return MY_ATOMIC_OK; +#endif +} + diff --git a/externals/mysql/mysys/my_bit.c b/externals/mysql/mysys/my_bit.c new file mode 100644 index 00000000000..620d1b8ba50 --- /dev/null +++ b/externals/mysql/mysys/my_bit.c @@ -0,0 +1,70 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include + +#ifndef HAVE_INLINE +/* the following will cause all inline functions to be instantiated */ +#define HAVE_INLINE +#undef STATIC_INLINE +#define STATIC_INLINE extern +#endif + +#include + +const char _my_bits_nbits[256] = { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, +}; + +/* + perl -e 'print map{", 0x".unpack H2,pack B8,unpack b8,chr$_}(0..255)' +*/ +const uchar _my_bits_reverse_table[256]={ +0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, +0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, +0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, +0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, +0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, 0x02, +0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, +0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, +0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, +0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, +0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, +0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, +0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, +0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, +0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, +0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, +0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, +0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, +0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, +0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, +0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF +}; diff --git a/externals/mysql/mysys/my_bitmap.c b/externals/mysql/mysys/my_bitmap.c new file mode 100644 index 00000000000..d6cf5d4c517 --- /dev/null +++ b/externals/mysql/mysys/my_bitmap.c @@ -0,0 +1,1126 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Handling of uchar arrays as large bitmaps. + + API limitations (or, rather asserted safety assumptions, + to encourage correct programming) + + * the internal size is a set of 32 bit words + * the number of bits specified in creation can be any number > 0 + * there are THREAD safe versions of most calls called bitmap_lock_* + many of those are not used and not compiled normally but the code + already exist for them in an #ifdef:ed part. These can only be used + if THREAD was specified in bitmap_init + + TODO: + Make assembler THREAD safe versions of these using test-and-set instructions + + Original version created by Sergei Golubchik 2001 - 2004. + New version written and test program added and some changes to the interface + was made by Mikael Ronström 2005, with assistance of Tomas Ulin and Mats + Kindahl. +*/ + +#include "mysys_priv.h" +#include +#include +#include + +void create_last_word_mask(MY_BITMAP *map) +{ + /* Get the number of used bits (1..8) in the last byte */ + unsigned int const used= 1U + ((map->n_bits-1U) & 0x7U); + + /* + Create a mask with the upper 'unused' bits set and the lower 'used' + bits clear. The bits within each byte is stored in big-endian order. + */ + unsigned char const mask= (~((1 << used) - 1)) & 255; + + /* + The first bytes are to be set to zero since they represent real bits + in the bitvector. The last bytes are set to 0xFF since they represent + bytes not used by the bitvector. Finally the last byte contains bits + as set by the mask above. + */ + unsigned char *ptr= (unsigned char*)&map->last_word_mask; + + map->last_word_ptr= map->bitmap + no_words_in_map(map)-1; + switch (no_bytes_in_map(map) & 3) { + case 1: + map->last_word_mask= ~0U; + ptr[0]= mask; + return; + case 2: + map->last_word_mask= ~0U; + ptr[0]= 0; + ptr[1]= mask; + return; + case 3: + map->last_word_mask= 0U; + ptr[2]= mask; + ptr[3]= 0xFFU; + return; + case 0: + map->last_word_mask= 0U; + ptr[3]= mask; + return; + } +} + + +static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused))) +{ +#ifdef THREAD + if (map->mutex) + pthread_mutex_lock(map->mutex); +#endif +} + +static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused))) +{ +#ifdef THREAD + if (map->mutex) + pthread_mutex_unlock(map->mutex); +#endif +} + + +my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, + my_bool thread_safe __attribute__((unused))) +{ + DBUG_ENTER("bitmap_init"); + if (!buf) + { + uint size_in_bytes= bitmap_buffer_size(n_bits); + uint extra= 0; +#ifdef THREAD + if (thread_safe) + { + size_in_bytes= ALIGN_SIZE(size_in_bytes); + extra= sizeof(pthread_mutex_t); + } + map->mutex= 0; +#endif + if (!(buf= (my_bitmap_map*) my_malloc(size_in_bytes+extra, MYF(MY_WME)))) + DBUG_RETURN(1); +#ifdef THREAD + if (thread_safe) + { + map->mutex= (pthread_mutex_t *) ((char*) buf + size_in_bytes); + pthread_mutex_init(map->mutex, MY_MUTEX_INIT_FAST); + } +#endif + } +#ifdef THREAD + else + { + DBUG_ASSERT(thread_safe == 0); + } +#endif + + map->bitmap= buf; + map->n_bits= n_bits; + create_last_word_mask(map); + bitmap_clear_all(map); + DBUG_RETURN(0); +} + + +void bitmap_free(MY_BITMAP *map) +{ + DBUG_ENTER("bitmap_free"); + if (map->bitmap) + { +#ifdef THREAD + if (map->mutex) + pthread_mutex_destroy(map->mutex); +#endif + my_free((char*) map->bitmap, MYF(0)); + map->bitmap=0; + } + DBUG_VOID_RETURN; +} + + +/* + test if bit already set and set it if it was not (thread unsafe method) + + SYNOPSIS + bitmap_fast_test_and_set() + MAP bit map struct + BIT bit number + + RETURN + 0 bit was not set + !=0 bit was set +*/ + +my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit) +{ + uchar *value= ((uchar*) map->bitmap) + (bitmap_bit / 8); + uchar bit= 1 << ((bitmap_bit) & 7); + uchar res= (*value) & bit; + *value|= bit; + return res; +} + + +/* + test if bit already set and set it if it was not (thread safe method) + + SYNOPSIS + bitmap_fast_test_and_set() + map bit map struct + bitmap_bit bit number + + RETURN + 0 bit was not set + !=0 bit was set +*/ + +my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit) +{ + my_bool res; + DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); + bitmap_lock(map); + res= bitmap_fast_test_and_set(map, bitmap_bit); + bitmap_unlock(map); + return res; +} + +/* + test if bit already set and clear it if it was set(thread unsafe method) + + SYNOPSIS + bitmap_fast_test_and_set() + MAP bit map struct + BIT bit number + + RETURN + 0 bit was not set + !=0 bit was set +*/ + +my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit) +{ + uchar *byte= (uchar*) map->bitmap + (bitmap_bit / 8); + uchar bit= 1 << ((bitmap_bit) & 7); + uchar res= (*byte) & bit; + *byte&= ~bit; + return res; +} + + +my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit) +{ + my_bool res; + DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); + bitmap_lock(map); + res= bitmap_fast_test_and_clear(map, bitmap_bit); + bitmap_unlock(map); + return res; +} + + +uint bitmap_set_next(MY_BITMAP *map) +{ + uint bit_found; + DBUG_ASSERT(map->bitmap); + if ((bit_found= bitmap_get_first(map)) != MY_BIT_NONE) + bitmap_set_bit(map, bit_found); + return bit_found; +} + + +void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size) +{ + uint prefix_bytes, prefix_bits, d; + uchar *m= (uchar *)map->bitmap; + + DBUG_ASSERT(map->bitmap && + (prefix_size <= map->n_bits || prefix_size == (uint) ~0)); + set_if_smaller(prefix_size, map->n_bits); + if ((prefix_bytes= prefix_size / 8)) + memset(m, 0xff, prefix_bytes); + m+= prefix_bytes; + if ((prefix_bits= prefix_size & 7)) + *m++= (1 << prefix_bits)-1; + if ((d= no_bytes_in_map(map)-prefix_bytes)) + bzero(m, d); +} + + +my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size) +{ + uint prefix_bits= prefix_size & 0x7, res; + uchar *m= (uchar*)map->bitmap; + uchar *end_prefix= m+prefix_size/8; + uchar *end; + DBUG_ASSERT(m && prefix_size <= map->n_bits); + end= m+no_bytes_in_map(map); + + while (m < end_prefix) + if (*m++ != 0xff) + return 0; + + *map->last_word_ptr&= ~map->last_word_mask; /*Clear bits*/ + res= 0; + if (prefix_bits && *m++ != (1 << prefix_bits)-1) + goto ret; + + while (m < end) + if (*m++ != 0) + goto ret; + res= 1; +ret: + return res; +} + + +my_bool bitmap_is_set_all(const MY_BITMAP *map) +{ + my_bitmap_map *data_ptr= map->bitmap; + my_bitmap_map *end= map->last_word_ptr; + *map->last_word_ptr |= map->last_word_mask; + for (; data_ptr <= end; data_ptr++) + if (*data_ptr != 0xFFFFFFFF) + return FALSE; + return TRUE; +} + + +my_bool bitmap_is_clear_all(const MY_BITMAP *map) +{ + my_bitmap_map *data_ptr= map->bitmap; + my_bitmap_map *end; + if (*map->last_word_ptr & ~map->last_word_mask) + return FALSE; + end= map->last_word_ptr; + for (; data_ptr < end; data_ptr++) + if (*data_ptr) + return FALSE; + return TRUE; +} + +/* Return TRUE if map1 is a subset of map2 */ + +my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2) +{ + my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; + + DBUG_ASSERT(map1->bitmap && map2->bitmap && + map1->n_bits==map2->n_bits); + + end= map1->last_word_ptr; + *map1->last_word_ptr &= ~map1->last_word_mask; + *map2->last_word_ptr &= ~map2->last_word_mask; + while (m1 <= end) + { + if ((*m1++) & ~(*m2++)) + return 0; + } + return 1; +} + +/* True if bitmaps has any common bits */ + +my_bool bitmap_is_overlapping(const MY_BITMAP *map1, const MY_BITMAP *map2) +{ + my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; + + DBUG_ASSERT(map1->bitmap && map2->bitmap && + map1->n_bits==map2->n_bits); + + end= map1->last_word_ptr; + *map1->last_word_ptr &= ~map1->last_word_mask; + *map2->last_word_ptr &= ~map2->last_word_mask; + while (m1 <= end) + { + if ((*m1++) & (*m2++)) + return 1; + } + return 0; +} + + +void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2) +{ + my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; + uint len= no_words_in_map(map), len2 = no_words_in_map(map2); + + DBUG_ASSERT(map->bitmap && map2->bitmap); + + end= to+min(len,len2); + *map2->last_word_ptr&= ~map2->last_word_mask; /*Clear last bits in map2*/ + while (to < end) + *to++ &= *from++; + + if (len2 < len) + { + end+=len-len2; + while (to < end) + *to++=0; + } +} + + +/* + Set/clear all bits above a bit. + + SYNOPSIS + bitmap_set_above() + map RETURN The bitmap to change. + from_byte The bitmap buffer byte offset to start with. + use_bit The bit value (1/0) to use for all upper bits. + + NOTE + You can only set/clear full bytes. + The function is meant for the situation that you copy a smaller bitmap + to a bigger bitmap. Bitmap lengths are always multiple of eigth (the + size of a byte). Using 'from_byte' saves multiplication and division + by eight during parameter passing. + + RETURN + void +*/ + +void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit) +{ + uchar use_byte= use_bit ? 0xff : 0; + uchar *to= (uchar *)map->bitmap + from_byte; + uchar *end= (uchar *)map->bitmap + (map->n_bits+7)/8; + + while (to < end) + *to++= use_byte; +} + + +void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2) +{ + my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; + DBUG_ASSERT(map->bitmap && map2->bitmap && + map->n_bits==map2->n_bits); + + end= map->last_word_ptr; + + while (to <= end) + *to++ &= ~(*from++); +} + + +void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2) +{ + my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; + + DBUG_ASSERT(map->bitmap && map2->bitmap && + map->n_bits==map2->n_bits); + end= map->last_word_ptr; + + while (to <= end) + *to++ |= *from++; +} + + +void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2) +{ + my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end= map->last_word_ptr; + DBUG_ASSERT(map->bitmap && map2->bitmap && + map->n_bits==map2->n_bits); + while (to <= end) + *to++ ^= *from++; +} + + +void bitmap_invert(MY_BITMAP *map) +{ + my_bitmap_map *to= map->bitmap, *end; + + DBUG_ASSERT(map->bitmap); + end= map->last_word_ptr; + + while (to <= end) + *to++ ^= 0xFFFFFFFF; +} + + +uint bitmap_bits_set(const MY_BITMAP *map) +{ + uchar *m= (uchar*)map->bitmap; + uchar *end= m + no_bytes_in_map(map); + uint res= 0; + + DBUG_ASSERT(map->bitmap); + *map->last_word_ptr&= ~map->last_word_mask; /*Reset last bits to zero*/ + while (m < end) + res+= my_count_bits_ushort(*m++); + return res; +} + + +void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2) +{ + my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; + + DBUG_ASSERT(map->bitmap && map2->bitmap && + map->n_bits==map2->n_bits); + end= map->last_word_ptr; + while (to <= end) + *to++ = *from++; +} + + +uint bitmap_get_first_set(const MY_BITMAP *map) +{ + uchar *byte_ptr; + uint i,j,k; + my_bitmap_map *data_ptr, *end= map->last_word_ptr; + + DBUG_ASSERT(map->bitmap); + data_ptr= map->bitmap; + *map->last_word_ptr &= ~map->last_word_mask; + + for (i=0; data_ptr <= end; data_ptr++, i++) + { + if (*data_ptr) + { + byte_ptr= (uchar*)data_ptr; + for (j=0; ; j++, byte_ptr++) + { + if (*byte_ptr) + { + for (k=0; ; k++) + { + if (*byte_ptr & (1 << k)) + return (i*32) + (j*8) + k; + } + } + } + } + } + return MY_BIT_NONE; +} + + +uint bitmap_get_first(const MY_BITMAP *map) +{ + uchar *byte_ptr; + uint i,j,k; + my_bitmap_map *data_ptr, *end= map->last_word_ptr; + + DBUG_ASSERT(map->bitmap); + data_ptr= map->bitmap; + *map->last_word_ptr|= map->last_word_mask; + + for (i=0; data_ptr <= end; data_ptr++, i++) + { + if (*data_ptr != 0xFFFFFFFF) + { + byte_ptr= (uchar*)data_ptr; + for (j=0; ; j++, byte_ptr++) + { + if (*byte_ptr != 0xFF) + { + for (k=0; ; k++) + { + if (!(*byte_ptr & (1 << k))) + return (i*32) + (j*8) + k; + } + } + } + } + } + return MY_BIT_NONE; +} + + +uint bitmap_lock_set_next(MY_BITMAP *map) +{ + uint bit_found; + bitmap_lock(map); + bit_found= bitmap_set_next(map); + bitmap_unlock(map); + return bit_found; +} + + +void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit) +{ + bitmap_lock(map); + DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); + bitmap_clear_bit(map, bitmap_bit); + bitmap_unlock(map); +} + + +#ifdef NOT_USED +my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size) +{ + my_bool res; + bitmap_lock((MY_BITMAP *)map); + res= bitmap_is_prefix(map, prefix_size); + bitmap_unlock((MY_BITMAP *)map); + return res; +} + + +void bitmap_lock_set_all(MY_BITMAP *map) +{ + bitmap_lock(map); + bitmap_set_all(map); + bitmap_unlock(map); +} + + +void bitmap_lock_clear_all(MY_BITMAP *map) +{ + bitmap_lock(map); + bitmap_clear_all(map); + bitmap_unlock(map); +} + + +void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size) +{ + bitmap_lock(map); + bitmap_set_prefix(map, prefix_size); + bitmap_unlock(map); +} + + +my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map) +{ + uint res; + bitmap_lock((MY_BITMAP *)map); + res= bitmap_is_clear_all(map); + bitmap_unlock((MY_BITMAP *)map); + return res; +} + + +my_bool bitmap_lock_is_set_all(const MY_BITMAP *map) +{ + uint res; + bitmap_lock((MY_BITMAP *)map); + res= bitmap_is_set_all(map); + bitmap_unlock((MY_BITMAP *)map); + return res; +} + + +my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit) +{ + my_bool res; + DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); + bitmap_lock((MY_BITMAP *)map); + res= bitmap_is_set(map, bitmap_bit); + bitmap_unlock((MY_BITMAP *)map); + return res; +} + + +my_bool bitmap_lock_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2) +{ + uint res; + bitmap_lock((MY_BITMAP *)map1); + bitmap_lock((MY_BITMAP *)map2); + res= bitmap_is_subset(map1, map2); + bitmap_unlock((MY_BITMAP *)map2); + bitmap_unlock((MY_BITMAP *)map1); + return res; +} + + +my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) +{ + uint res; + + DBUG_ASSERT(map1->bitmap && map2->bitmap && + map1->n_bits==map2->n_bits); + bitmap_lock((MY_BITMAP *)map1); + bitmap_lock((MY_BITMAP *)map2); + res= bitmap_cmp(map1, map2); + bitmap_unlock((MY_BITMAP *)map2); + bitmap_unlock((MY_BITMAP *)map1); + return res; +} + + +void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2) +{ + bitmap_lock(map); + bitmap_lock((MY_BITMAP *)map2); + bitmap_intersect(map, map2); + bitmap_unlock((MY_BITMAP *)map2); + bitmap_unlock(map); +} + + +void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2) +{ + bitmap_lock(map); + bitmap_lock((MY_BITMAP *)map2); + bitmap_subtract(map, map2); + bitmap_unlock((MY_BITMAP *)map2); + bitmap_unlock(map); +} + + +void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2) +{ + bitmap_lock(map); + bitmap_lock((MY_BITMAP *)map2); + bitmap_union(map, map2); + bitmap_unlock((MY_BITMAP *)map2); + bitmap_unlock(map); +} + + +/* + SYNOPSIS + bitmap_bits_set() + map + RETURN + Number of set bits in the bitmap. +*/ +uint bitmap_lock_bits_set(const MY_BITMAP *map) +{ + uint res; + bitmap_lock((MY_BITMAP *)map); + DBUG_ASSERT(map->bitmap); + res= bitmap_bits_set(map); + bitmap_unlock((MY_BITMAP *)map); + return res; +} + + +/* + SYNOPSIS + bitmap_get_first() + map + RETURN + Number of first unset bit in the bitmap or MY_BIT_NONE if all bits are set. +*/ +uint bitmap_lock_get_first(const MY_BITMAP *map) +{ + uint res; + bitmap_lock((MY_BITMAP*)map); + res= bitmap_get_first(map); + bitmap_unlock((MY_BITMAP*)map); + return res; +} + + +uint bitmap_lock_get_first_set(const MY_BITMAP *map) +{ + uint res; + bitmap_lock((MY_BITMAP*)map); + res= bitmap_get_first_set(map); + bitmap_unlock((MY_BITMAP*)map); + return res; +} + + +void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit) +{ + DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); + bitmap_lock(map); + bitmap_set_bit(map, bitmap_bit); + bitmap_unlock(map); +} + + +void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit) +{ + DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); + bitmap_lock(map); + bitmap_flip_bit(map, bitmap_bit); + bitmap_unlock(map); +} +#endif +#ifdef MAIN + +uint get_rand_bit(uint bitsize) +{ + return (rand() % bitsize); +} + +my_bool test_set_get_clear_bit(MY_BITMAP *map, uint bitsize) +{ + uint i, test_bit; + uint no_loops= bitsize > 128 ? 128 : bitsize; + for (i=0; i < no_loops; i++) + { + test_bit= get_rand_bit(bitsize); + bitmap_set_bit(map, test_bit); + if (!bitmap_is_set(map, test_bit)) + goto error1; + bitmap_clear_bit(map, test_bit); + if (bitmap_is_set(map, test_bit)) + goto error2; + } + return FALSE; +error1: + printf("Error in set bit, bit %u, bitsize = %u", test_bit, bitsize); + return TRUE; +error2: + printf("Error in clear bit, bit %u, bitsize = %u", test_bit, bitsize); + return TRUE; +} + +my_bool test_flip_bit(MY_BITMAP *map, uint bitsize) +{ + uint i, test_bit; + uint no_loops= bitsize > 128 ? 128 : bitsize; + for (i=0; i < no_loops; i++) + { + test_bit= get_rand_bit(bitsize); + bitmap_flip_bit(map, test_bit); + if (!bitmap_is_set(map, test_bit)) + goto error1; + bitmap_flip_bit(map, test_bit); + if (bitmap_is_set(map, test_bit)) + goto error2; + } + return FALSE; +error1: + printf("Error in flip bit 1, bit %u, bitsize = %u", test_bit, bitsize); + return TRUE; +error2: + printf("Error in flip bit 2, bit %u, bitsize = %u", test_bit, bitsize); + return TRUE; +} + +my_bool test_operators(MY_BITMAP *map __attribute__((unused)), + uint bitsize __attribute__((unused))) +{ + return FALSE; +} + +my_bool test_get_all_bits(MY_BITMAP *map, uint bitsize) +{ + uint i; + bitmap_set_all(map); + if (!bitmap_is_set_all(map)) + goto error1; + if (!bitmap_is_prefix(map, bitsize)) + goto error5; + bitmap_clear_all(map); + if (!bitmap_is_clear_all(map)) + goto error2; + if (!bitmap_is_prefix(map, 0)) + goto error6; + for (i=0; i 128 ? 128 : bitsize; + MY_BITMAP map2_obj, map3_obj; + MY_BITMAP *map2= &map2_obj, *map3= &map3_obj; + my_bitmap_map map2buf[1024]; + my_bitmap_map map3buf[1024]; + bitmap_init(&map2_obj, map2buf, bitsize, FALSE); + bitmap_init(&map3_obj, map3buf, bitsize, FALSE); + bitmap_clear_all(map2); + bitmap_clear_all(map3); + for (i=0; i < no_loops; i++) + { + test_bit1=get_rand_bit(bitsize); + bitmap_set_prefix(map, test_bit1); + test_bit2=get_rand_bit(bitsize); + bitmap_set_prefix(map2, test_bit2); + bitmap_intersect(map, map2); + test_bit3= test_bit2 < test_bit1 ? test_bit2 : test_bit1; + bitmap_set_prefix(map3, test_bit3); + if (!bitmap_cmp(map, map3)) + goto error1; + bitmap_clear_all(map); + bitmap_clear_all(map2); + bitmap_clear_all(map3); + test_bit1=get_rand_bit(bitsize); + test_bit2=get_rand_bit(bitsize); + test_bit3=get_rand_bit(bitsize); + bitmap_set_prefix(map, test_bit1); + bitmap_set_prefix(map2, test_bit2); + test_bit3= test_bit2 > test_bit1 ? test_bit2 : test_bit1; + bitmap_set_prefix(map3, test_bit3); + bitmap_union(map, map2); + if (!bitmap_cmp(map, map3)) + goto error2; + bitmap_clear_all(map); + bitmap_clear_all(map2); + bitmap_clear_all(map3); + test_bit1=get_rand_bit(bitsize); + test_bit2=get_rand_bit(bitsize); + test_bit3=get_rand_bit(bitsize); + bitmap_set_prefix(map, test_bit1); + bitmap_set_prefix(map2, test_bit2); + bitmap_xor(map, map2); + test_bit3= test_bit2 > test_bit1 ? test_bit2 : test_bit1; + test_bit4= test_bit2 < test_bit1 ? test_bit2 : test_bit1; + bitmap_set_prefix(map3, test_bit3); + for (j=0; j < test_bit4; j++) + bitmap_clear_bit(map3, j); + if (!bitmap_cmp(map, map3)) + goto error3; + bitmap_clear_all(map); + bitmap_clear_all(map2); + bitmap_clear_all(map3); + test_bit1=get_rand_bit(bitsize); + test_bit2=get_rand_bit(bitsize); + test_bit3=get_rand_bit(bitsize); + bitmap_set_prefix(map, test_bit1); + bitmap_set_prefix(map2, test_bit2); + bitmap_subtract(map, map2); + if (test_bit2 < test_bit1) + { + bitmap_set_prefix(map3, test_bit1); + for (j=0; j < test_bit2; j++) + bitmap_clear_bit(map3, j); + } + if (!bitmap_cmp(map, map3)) + goto error4; + bitmap_clear_all(map); + bitmap_clear_all(map2); + bitmap_clear_all(map3); + test_bit1=get_rand_bit(bitsize); + bitmap_set_prefix(map, test_bit1); + bitmap_invert(map); + bitmap_set_all(map3); + for (j=0; j < test_bit1; j++) + bitmap_clear_bit(map3, j); + if (!bitmap_cmp(map, map3)) + goto error5; + bitmap_clear_all(map); + bitmap_clear_all(map3); + } + return FALSE; +error1: + printf("intersect error bitsize=%u,size1=%u,size2=%u", bitsize, + test_bit1,test_bit2); + return TRUE; +error2: + printf("union error bitsize=%u,size1=%u,size2=%u", bitsize, + test_bit1,test_bit2); + return TRUE; +error3: + printf("xor error bitsize=%u,size1=%u,size2=%u", bitsize, + test_bit1,test_bit2); + return TRUE; +error4: + printf("subtract error bitsize=%u,size1=%u,size2=%u", bitsize, + test_bit1,test_bit2); + return TRUE; +error5: + printf("invert error bitsize=%u,size=%u", bitsize, + test_bit1); + return TRUE; +} + +my_bool test_count_bits_set(MY_BITMAP *map, uint bitsize) +{ + uint i, bit_count=0, test_bit; + uint no_loops= bitsize > 128 ? 128 : bitsize; + for (i=0; i < no_loops; i++) + { + test_bit=get_rand_bit(bitsize); + if (!bitmap_is_set(map, test_bit)) + { + bitmap_set_bit(map, test_bit); + bit_count++; + } + } + if (bit_count==0 && bitsize > 0) + goto error1; + if (bitmap_bits_set(map) != bit_count) + goto error2; + return FALSE; +error1: + printf("No bits set bitsize = %u", bitsize); + return TRUE; +error2: + printf("Wrong count of bits set, bitsize = %u", bitsize); + return TRUE; +} + +my_bool test_get_first_bit(MY_BITMAP *map, uint bitsize) +{ + uint i, test_bit; + uint no_loops= bitsize > 128 ? 128 : bitsize; + for (i=0; i < no_loops; i++) + { + test_bit=get_rand_bit(bitsize); + bitmap_set_bit(map, test_bit); + if (bitmap_get_first_set(map) != test_bit) + goto error1; + bitmap_set_all(map); + bitmap_clear_bit(map, test_bit); + if (bitmap_get_first(map) != test_bit) + goto error2; + bitmap_clear_all(map); + } + return FALSE; +error1: + printf("get_first_set error bitsize=%u,prefix_size=%u",bitsize,test_bit); + return TRUE; +error2: + printf("get_first error bitsize= %u, prefix_size= %u",bitsize,test_bit); + return TRUE; +} + +my_bool test_get_next_bit(MY_BITMAP *map, uint bitsize) +{ + uint i, j, test_bit; + uint no_loops= bitsize > 128 ? 128 : bitsize; + for (i=0; i < no_loops; i++) + { + test_bit=get_rand_bit(bitsize); + for (j=0; j < test_bit; j++) + bitmap_set_next(map); + if (!bitmap_is_prefix(map, test_bit)) + goto error1; + bitmap_clear_all(map); + } + return FALSE; +error1: + printf("get_next error bitsize= %u, prefix_size= %u", bitsize,test_bit); + return TRUE; +} + +my_bool test_prefix(MY_BITMAP *map, uint bitsize) +{ + uint i, j, test_bit; + uint no_loops= bitsize > 128 ? 128 : bitsize; + for (i=0; i < no_loops; i++) + { + test_bit=get_rand_bit(bitsize); + bitmap_set_prefix(map, test_bit); + if (!bitmap_is_prefix(map, test_bit)) + goto error1; + bitmap_clear_all(map); + for (j=0; j < test_bit; j++) + bitmap_set_bit(map, j); + if (!bitmap_is_prefix(map, test_bit)) + goto error2; + bitmap_set_all(map); + for (j=bitsize - 1; ~(j-test_bit); j--) + bitmap_clear_bit(map, j); + if (!bitmap_is_prefix(map, test_bit)) + goto error3; + bitmap_clear_all(map); + } + return FALSE; +error1: + printf("prefix1 error bitsize = %u, prefix_size = %u", bitsize,test_bit); + return TRUE; +error2: + printf("prefix2 error bitsize = %u, prefix_size = %u", bitsize,test_bit); + return TRUE; +error3: + printf("prefix3 error bitsize = %u, prefix_size = %u", bitsize,test_bit); + return TRUE; +} + + +my_bool do_test(uint bitsize) +{ + MY_BITMAP map; + my_bitmap_map buf[1024]; + if (bitmap_init(&map, buf, bitsize, FALSE)) + { + printf("init error for bitsize %d", bitsize); + goto error; + } + if (test_set_get_clear_bit(&map,bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_flip_bit(&map,bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_operators(&map,bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_get_all_bits(&map, bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_compare_operators(&map,bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_count_bits_set(&map,bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_get_first_bit(&map,bitsize)) + goto error; + bitmap_clear_all(&map); + if (test_get_next_bit(&map,bitsize)) + goto error; + if (test_prefix(&map,bitsize)) + goto error; + return FALSE; +error: + printf("\n"); + return TRUE; +} + +int main() +{ + int i; + for (i= 1; i < 4096; i++) + { + printf("Start test for bitsize=%u\n",i); + if (do_test(i)) + return -1; + } + printf("OK\n"); + return 0; +} + +/* + In directory mysys: + make test_bitmap + will build the bitmap tests and ./test_bitmap will execute it +*/ + +#endif diff --git a/externals/mysql/mysys/my_chmod.c b/externals/mysql/mysys/my_chmod.c new file mode 100644 index 00000000000..afdea758833 --- /dev/null +++ b/externals/mysql/mysys/my_chmod.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" + +/** + @brief Change mode of file. + + @fn my_chmod() + @param name Filename + @param mode_t Mode + @param my_flags Flags + + @notes + The mode of the file given by path or referenced by fildes is changed + + @retval 0 Ok + @retval # Error +*/ + +int my_chmod(const char *name, mode_t mode, myf my_flags) +{ + DBUG_ENTER("my_chmod"); + DBUG_PRINT("my",("name: %s mode: %lu flags: %d", name, (ulong) mode, + my_flags)); + + if (chmod(name, mode)) + { + my_errno= errno; + if (my_flags & MY_WME) + my_error(EE_CANT_CHMOD, MYF(0), name, (ulong) mode, my_errno); + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} diff --git a/externals/mysql/mysys/my_chsize.c b/externals/mysql/mysys/my_chsize.c new file mode 100644 index 00000000000..b9013811b34 --- /dev/null +++ b/externals/mysql/mysys/my_chsize.c @@ -0,0 +1,107 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include "m_string.h" + +/* + Change size of file. + + SYNOPSIS + my_chsize() + fd File descriptor + new_length New file size + filler If we don't have truncate, fill up all bytes after + new_length with this character + MyFlags Flags + + DESCRIPTION + my_chsize() truncates file if shorter else fill with the filler character. + The function also changes the file pointer. Usually it points to the end + of the file after execution. + + RETURN VALUE + 0 Ok + 1 Error +*/ +int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) +{ + my_off_t oldsize; + uchar buff[IO_SIZE]; + DBUG_ENTER("my_chsize"); + DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %d",fd,(ulong) newlength, + MyFlags)); + + if ((oldsize= my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE))) == newlength) + DBUG_RETURN(0); + + DBUG_PRINT("info",("old_size: %ld", (ulong) oldsize)); + + if (oldsize > newlength) + { +#ifdef _WIN32 + if (my_win_chsize(fd, newlength)) + { + my_errno= errno; + goto err; + } + DBUG_RETURN(0); +#elif defined(HAVE_FTRUNCATE) + if (ftruncate(fd, (off_t) newlength)) + { + my_errno= errno; + goto err; + } + DBUG_RETURN(0); +#elif defined(HAVE_CHSIZE) + if (chsize(fd, (off_t) newlength)) + { + my_errno=errno; + goto err; + } + DBUG_RETURN(0); +#else + /* + Fill space between requested length and true length with 'filler' + We should never come here on any modern machine + */ + if (my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE)) + == MY_FILEPOS_ERROR) + { + goto err; + } + swap_variables(my_off_t, newlength, oldsize); +#endif + } + + /* Full file with 'filler' until it's as big as requested */ + bfill(buff, IO_SIZE, filler); + while (newlength-oldsize > IO_SIZE) + { + if (my_write(fd, buff, IO_SIZE, MYF(MY_NABP))) + goto err; + oldsize+= IO_SIZE; + } + if (my_write(fd,buff,(size_t) (newlength-oldsize), MYF(MY_NABP))) + goto err; + DBUG_RETURN(0); + +err: + DBUG_PRINT("error", ("errno: %d", errno)); + if (MyFlags & MY_WME) + my_error(EE_CANT_CHSIZE, MYF(ME_BELL+ME_WAITTANG), my_errno); + DBUG_RETURN(1); +} /* my_chsize */ diff --git a/externals/mysql/mysys/my_clock.c b/externals/mysql/mysys/my_clock.c new file mode 100644 index 00000000000..d17f26ed316 --- /dev/null +++ b/externals/mysql/mysys/my_clock.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "my_global.h" + +#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__NETWARE__) +#include "mysys_priv.h" +#include +#endif + +long my_clock(void) +{ +#if !defined(__WIN__) && !defined(__NETWARE__) + struct tms tmsbuf; + (void) times(&tmsbuf); + return (tmsbuf.tms_utime + tmsbuf.tms_stime); +#else + return clock(); +#endif +} diff --git a/externals/mysql/mysys/my_compress.c b/externals/mysql/mysys/my_compress.c new file mode 100644 index 00000000000..7edd07b18e2 --- /dev/null +++ b/externals/mysql/mysys/my_compress.c @@ -0,0 +1,264 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Written by Sinisa Milivojevic */ + +#include +#ifdef HAVE_COMPRESS +#include +#ifndef SCO +#include +#endif +#include + +/* + This replaces the packet with a compressed packet + + SYNOPSIS + my_compress() + packet Data to compress. This is is replaced with the compressed data. + len Length of data to compress at 'packet' + complen out: 0 if packet was not compressed + + RETURN + 1 error. 'len' is not changed' + 0 ok. In this case 'len' contains the size of the compressed packet +*/ + +my_bool my_compress(uchar *packet, size_t *len, size_t *complen) +{ + DBUG_ENTER("my_compress"); + if (*len < MIN_COMPRESS_LENGTH) + { + *complen=0; + DBUG_PRINT("note",("Packet too short: Not compressed")); + } + else + { + uchar *compbuf=my_compress_alloc(packet,len,complen); + if (!compbuf) + DBUG_RETURN(*complen ? 0 : 1); + memcpy(packet,compbuf,*len); + my_free(compbuf,MYF(MY_WME)); + } + DBUG_RETURN(0); +} + + +uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen) +{ + uchar *compbuf; + uLongf tmp_complen; + int res; + *complen= *len * 120 / 100 + 12; + + if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME)))) + return 0; /* Not enough memory */ + + tmp_complen= (uLongf) *complen; + res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len); + *complen= tmp_complen; + + if (res != Z_OK) + { + my_free(compbuf, MYF(MY_WME)); + return 0; + } + + if (*complen >= *len) + { + *complen= 0; + my_free(compbuf, MYF(MY_WME)); + DBUG_PRINT("note",("Packet got longer on compression; Not compressed")); + return 0; + } + /* Store length of compressed packet in *len */ + swap_variables(size_t, *len, *complen); + return compbuf; +} + + +/* + Uncompress packet + + SYNOPSIS + my_uncompress() + packet Compressed data. This is is replaced with the orignal data. + len Length of compressed data + complen Length of the packet buffer (must be enough for the original + data) + + RETURN + 1 error + 0 ok. In this case 'complen' contains the updated size of the + real data. +*/ + +my_bool my_uncompress(uchar *packet, size_t len, size_t *complen) +{ + uLongf tmp_complen; + DBUG_ENTER("my_uncompress"); + + if (*complen) /* If compressed */ + { + uchar *compbuf= (uchar *) my_malloc(*complen,MYF(MY_WME)); + int error; + if (!compbuf) + DBUG_RETURN(1); /* Not enough memory */ + + tmp_complen= (uLongf) *complen; + error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, + (uLong) len); + *complen= tmp_complen; + if (error != Z_OK) + { /* Probably wrong packet */ + DBUG_PRINT("error",("Can't uncompress packet, error: %d",error)); + my_free(compbuf, MYF(MY_WME)); + DBUG_RETURN(1); + } + memcpy(packet, compbuf, *complen); + my_free(compbuf, MYF(MY_WME)); + } + else + *complen= len; + DBUG_RETURN(0); +} + +/* + Internal representation of the frm blob is: + + ver 4 bytes + orglen 4 bytes + complen 4 bytes +*/ + +#define BLOB_HEADER 12 + + +/* + packfrm is a method used to compress the frm file for storage in a + handler. This method was developed for the NDB handler and has been moved + here to serve also other uses. + + SYNOPSIS + packfrm() + data Data reference to frm file data. + len Length of frm file data + out:pack_data Reference to the pointer to the packed frm data + out:pack_len Length of packed frm file data + + NOTES + data is replaced with compressed content + + RETURN VALUES + 0 Success + >0 Failure +*/ + +int packfrm(uchar *data, size_t len, + uchar **pack_data, size_t *pack_len) +{ + int error; + size_t org_len, comp_len, blob_len; + uchar *blob; + DBUG_ENTER("packfrm"); + DBUG_PRINT("enter", ("data: %p len: %lu", data, (ulong) len)); + + error= 1; + org_len= len; + if (my_compress((uchar*)data, &org_len, &comp_len)) + goto err; + + DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", (ulong) org_len, + (ulong) comp_len)); + DBUG_DUMP("compressed", data, org_len); + + error= 2; + blob_len= BLOB_HEADER + org_len; + if (!(blob= (uchar*) my_malloc(blob_len,MYF(MY_WME)))) + goto err; + + /* Store compressed blob in machine independent format */ + int4store(blob, 1); + int4store(blob+4, (uint32) len); + int4store(blob+8, (uint32) org_len); /* compressed length */ + + /* Copy frm data into blob, already in machine independent format */ + memcpy(blob+BLOB_HEADER, data, org_len); + + *pack_data= blob; + *pack_len= blob_len; + error= 0; + + DBUG_PRINT("exit", ("pack_data: %p pack_len: %lu", + *pack_data, (ulong) *pack_len)); +err: + DBUG_RETURN(error); + +} + +/* + unpackfrm is a method used to decompress the frm file received from a + handler. This method was developed for the NDB handler and has been moved + here to serve also other uses for other clustered storage engines. + + SYNOPSIS + unpackfrm() + pack_data Data reference to packed frm file data + out:unpack_data Reference to the pointer to the unpacked frm data + out:unpack_len Length of unpacked frm file data + + RETURN VALUES? + 0 Success + >0 Failure +*/ + +int unpackfrm(uchar **unpack_data, size_t *unpack_len, + const uchar *pack_data) +{ + uchar *data; + size_t complen, orglen; + ulong ver; + DBUG_ENTER("unpackfrm"); + DBUG_PRINT("enter", ("pack_data: %p", pack_data)); + + ver= uint4korr(pack_data); + orglen= uint4korr(pack_data+4); + complen= uint4korr(pack_data+8); + + DBUG_PRINT("blob",("ver: %lu complen: %lu orglen: %lu", + ver, (ulong) complen, (ulong) orglen)); + DBUG_DUMP("blob->data", pack_data + BLOB_HEADER, complen); + + if (ver != 1) + DBUG_RETURN(1); + if (!(data= my_malloc(max(orglen, complen), MYF(MY_WME)))) + DBUG_RETURN(2); + memcpy(data, pack_data + BLOB_HEADER, complen); + + if (my_uncompress(data, complen, &orglen)) + { + my_free(data, MYF(0)); + DBUG_RETURN(3); + } + + *unpack_data= data; + *unpack_len= orglen; + + DBUG_PRINT("exit", ("frmdata: %p len: %lu", *unpack_data, + (ulong) *unpack_len)); + DBUG_RETURN(0); +} +#endif /* HAVE_COMPRESS */ diff --git a/externals/mysql/mysys/my_conio.c b/externals/mysql/mysys/my_conio.c new file mode 100644 index 00000000000..b78966446ee --- /dev/null +++ b/externals/mysql/mysys/my_conio.c @@ -0,0 +1,222 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "mysys_priv.h" + +#ifdef __WIN__ + +static HANDLE my_coninpfh= 0; /* console input */ + +/* + functions my_pthread_auto_mutex_lock & my_pthread_auto_mutex_free + are experimental at this moment, they are intended to bring + ability of protecting code sections without necessity to explicitly + initialize synchronization object in one of threads + + if found useful they are to be exported in mysys +*/ + + +/* + int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, + int id, int time) + NOTES + creates a mutex with given name and tries to lock it time msec. + mutex name is appended with id to allow system wide or process wide + locks. Handle to created mutex returned in ph argument. + + RETURN + 0 thread owns mutex + <>0 error +*/ + +static +int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, int id, int time) +{ + int res; + char tname[FN_REFLEN]; + + sprintf(tname, "%s-%08X", name, id); + + *ph= CreateMutex(NULL, FALSE, tname); + if (*ph == NULL) + return GetLastError(); + + res= WaitForSingleObject(*ph, time); + + if (res == WAIT_TIMEOUT) + return ERROR_SEM_TIMEOUT; + + if (res == WAIT_FAILED) + return GetLastError(); + + return 0; +} + +/* + int my_pthread_auto_mutex_free(HANDLE* ph) + + NOTES + releases a mutex. + + RETURN + 0 thread released mutex + <>0 error + +*/ +static +int my_pthread_auto_mutex_free(HANDLE* ph) +{ + if (*ph) + { + ReleaseMutex(*ph); + CloseHandle(*ph); + *ph= NULL; + } + + return 0; +} + + +#define pthread_auto_mutex_decl(name) \ + HANDLE __h##name= NULL; + +#define pthread_auto_mutex_lock(name, proc, time) \ + my_pthread_auto_mutex_lock(&__h##name, #name, (proc), (time)) + +#define pthread_auto_mutex_free(name) \ + my_pthread_auto_mutex_free(&__h##name) + + +/* + char* my_cgets() + + NOTES + Replaces _cgets from libc to support input of more than 255 chars. + Reads from the console via ReadConsole into buffer which + should be at least clen characters. + Actual length of string returned in plen. + + WARNING + my_cgets() does NOT check the pushback character buffer (i.e., _chbuf). + Thus, my_cgets() will not return any character that is pushed back by + the _ungetch() call. + + RETURN + string pointer ok + NULL Error + +*/ + +char* my_cgets(char *buffer, size_t clen, size_t* plen) +{ + ULONG state; + char *result; + DWORD plen_res; + CONSOLE_SCREEN_BUFFER_INFO csbi; + + pthread_auto_mutex_decl(my_conio_cs); + + /* lock the console for the current process*/ + if (pthread_auto_mutex_lock(my_conio_cs, GetCurrentProcessId(), INFINITE)) + { + /* can not lock console */ + pthread_auto_mutex_free(my_conio_cs); + return NULL; + } + + /* init console input */ + if (my_coninpfh == 0) + { + /* same handle will be used until process termination */ + my_coninpfh= CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, NULL); + } + + if (my_coninpfh == INVALID_HANDLE_VALUE) + { + /* unlock the console */ + pthread_auto_mutex_free(my_conio_cs); + return(NULL); + } + + GetConsoleMode((HANDLE)my_coninpfh, &state); + SetConsoleMode((HANDLE)my_coninpfh, ENABLE_LINE_INPUT | + ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT); + + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); + + /* + there is no known way to determine allowed buffer size for input + though it is known it should not be more than 64K + so we cut 64K and try first size of screen buffer + if it is still to large we cut half of it and try again + later we may want to cycle from min(clen, 65535) to allowed size + with small decrement to determine exact allowed buffer + */ + clen= min(clen, 65535); + do + { + clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y); + if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, &plen_res, + NULL)) + { + result= NULL; + clen>>= 1; + } + else + { + result= buffer; + break; + } + } + while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY); + *plen= plen_res; + + /* We go here on error reading the string (Ctrl-C for example) */ + if (!*plen) + result= NULL; /* purecov: inspected */ + + if (result != NULL) + { + if (*plen > 1 && buffer[*plen - 2] == '\r') + { + *plen= *plen - 2; + } + else + { + if (*plen > 0 && buffer[*plen - 1] == '\r') + { + char tmp[3]; + int tmplen= sizeof(tmp); + + *plen= *plen - 1; + /* read /n left in the buffer */ + ReadConsole((HANDLE)my_coninpfh, (LPVOID)tmp, tmplen, &tmplen, NULL); + } + } + buffer[*plen]= '\0'; + } + + SetConsoleMode((HANDLE)my_coninpfh, state); + /* unlock the console */ + pthread_auto_mutex_free(my_conio_cs); + + return result; +} + +#endif /* __WIN__ */ diff --git a/externals/mysql/mysys/my_copy.c b/externals/mysql/mysys/my_copy.c new file mode 100644 index 00000000000..60096e9ea80 --- /dev/null +++ b/externals/mysql/mysys/my_copy.c @@ -0,0 +1,122 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include /* for stat */ +#include +#if defined(HAVE_UTIME_H) +#include +#elif defined(HAVE_SYS_UTIME_H) +#include +#elif !defined(HPUX10) +#include +struct utimbuf { + time_t actime; + time_t modtime; +}; +#endif + + +/* + int my_copy(const char *from, const char *to, myf MyFlags) + + NOTES + Ordinary ownership and accesstimes are copied from 'from-file' + If MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then + the modes of to-file isn't changed + If MyFlags & MY_DONT_OVERWRITE_FILE is set, we will give an error + if the file existed. + + WARNING + Don't set MY_FNABP or MY_NABP bits on when calling this function ! + + RETURN + 0 ok + # Error + +*/ + +int my_copy(const char *from, const char *to, myf MyFlags) +{ + uint Count; + my_bool new_file_stat= 0; /* 1 if we could stat "to" */ + int create_flag; + File from_file,to_file; + uchar buff[IO_SIZE]; + MY_STAT stat_buff,new_stat_buff; + DBUG_ENTER("my_copy"); + DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); + + from_file=to_file= -1; + DBUG_ASSERT(!(MyFlags & (MY_FNABP | MY_NABP))); /* for my_read/my_write */ + if (MyFlags & MY_HOLD_ORIGINAL_MODES) /* Copy stat if possible */ + new_file_stat= test(my_stat((char*) to, &new_stat_buff, MYF(0))); + + if ((from_file=my_open(from,O_RDONLY | O_SHARE,MyFlags)) >= 0) + { + if (!my_stat(from, &stat_buff, MyFlags)) + { + my_errno=errno; + goto err; + } + if (MyFlags & MY_HOLD_ORIGINAL_MODES && new_file_stat) + stat_buff=new_stat_buff; + create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC; + + if ((to_file= my_create(to,(int) stat_buff.st_mode, + O_WRONLY | create_flag | O_BINARY | O_SHARE, + MyFlags)) < 0) + goto err; + + while ((Count=my_read(from_file, buff, sizeof(buff), MyFlags)) != 0) + { + if (Count == (uint) -1 || + my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP))) + goto err; + } + + if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags)) + DBUG_RETURN(-1); /* Error on close */ + + /* Copy modes if possible */ + + if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) + DBUG_RETURN(0); /* File copyed but not stat */ + (void) chmod(to, stat_buff.st_mode & 07777); /* Copy modes */ +#if !defined(__WIN__) && !defined(__NETWARE__) + (void) chown(to, stat_buff.st_uid,stat_buff.st_gid); /* Copy ownership */ +#endif +#if !defined(VMS) && !defined(__ZTC__) + if (MyFlags & MY_COPYTIME) + { + struct utimbuf timep; + timep.actime = stat_buff.st_atime; + timep.modtime = stat_buff.st_mtime; + (void) utime((char*) to, &timep); /* last accessed and modified times */ + } +#endif + DBUG_RETURN(0); + } + +err: + if (from_file >= 0) (void) my_close(from_file,MyFlags); + if (to_file >= 0) + { + (void) my_close(to_file, MyFlags); + /* attempt to delete the to-file we've partially written */ + (void) my_delete(to, MyFlags); + } + DBUG_RETURN(-1); +} /* my_copy */ diff --git a/externals/mysql/mysys/my_create.c b/externals/mysql/mysys/my_create.c new file mode 100644 index 00000000000..d0436276d03 --- /dev/null +++ b/externals/mysql/mysys/my_create.c @@ -0,0 +1,76 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include +#include "mysys_err.h" +#include +#include +#if defined(_WIN32) +#include +#endif + + /* + ** Create a new file + ** Arguments: + ** Path-name of file + ** Read | write on file (umask value) + ** Read & Write on open file + ** Special flags + */ + + +File my_create(const char *FileName, int CreateFlags, int access_flags, + myf MyFlags) +{ + int fd, rc; + DBUG_ENTER("my_create"); + DBUG_PRINT("my",("Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %d", + FileName, CreateFlags, access_flags, MyFlags)); + +#if !defined(NO_OPEN_3) + fd= open((char *) FileName, access_flags | O_CREAT, + CreateFlags ? CreateFlags : my_umask); +#elif defined(_WIN32) + fd= my_win_open(FileName, access_flags | O_CREAT); +#else + fd= open(FileName, access_flags); +#endif + + if ((MyFlags & MY_SYNC_DIR) && (fd >=0) && + my_sync_dir_by_file(FileName, MyFlags)) + { + my_close(fd, MyFlags); + fd= -1; + } + + rc= my_register_filename(fd, FileName, FILE_BY_CREATE, + EE_CANTCREATEFILE, MyFlags); + /* + my_register_filename() may fail on some platforms even if the call to + *open() above succeeds. In this case, don't leave the stale file because + callers assume the file to not exist if my_create() fails, so they don't + do any cleanups. + */ + if (unlikely(fd >= 0 && rc < 0)) + { + int tmp= my_errno; + my_close(fd, MyFlags); + my_delete(FileName, MyFlags); + my_errno= tmp; + } + + DBUG_RETURN(rc); +} /* my_create */ diff --git a/externals/mysql/mysys/my_delete.c b/externals/mysql/mysys/my_delete.c new file mode 100644 index 00000000000..edee1c4e875 --- /dev/null +++ b/externals/mysql/mysys/my_delete.c @@ -0,0 +1,115 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + +int my_delete(const char *name, myf MyFlags) +{ + int err; + DBUG_ENTER("my_delete"); + DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags)); + + if ((err = unlink(name)) == -1) + { + my_errno=errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_DELETE,MYF(ME_BELL+ME_WAITTANG+(MyFlags & ME_NOINPUT)), + name,errno); + } + else if ((MyFlags & MY_SYNC_DIR) && + my_sync_dir_by_file(name, MyFlags)) + err= -1; + DBUG_RETURN(err); +} /* my_delete */ + +#if defined(__WIN__) +/** + Delete file which is possibly not closed. + + This function is intended to be used exclusively as a temporal solution + for Win NT in case when it is needed to delete a not closed file (note + that the file must be opened everywhere with FILE_SHARE_DELETE mode). + Deleting not-closed files can not be supported on Win 98|ME (and because + of that is considered harmful). + + The function deletes the file with its preliminary renaming. This is + because when not-closed share-delete file is deleted it still lives on + a disk until it will not be closed everwhere. This may conflict with an + attempt to create a new file with the same name. The deleted file is + renamed to ..deleted where - the initial name of the + file, - a hexadecimal number chosen to make the temporal name to + be unique. + + @param the name of the being deleted file + @param the flags instructing how to react on an error internally in + the function + + @note The per-thread @c my_errno holds additional info for a caller to + decide how critical the error can be. + + @retval + 0 ok + @retval + 1 error + + +*/ +int nt_share_delete(const char *name, myf MyFlags) +{ + char buf[MAX_PATH + 20]; + ulong cnt; + DBUG_ENTER("nt_share_delete"); + DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags)); + + for (cnt= GetTickCount(); cnt; cnt--) + { + errno= 0; + sprintf(buf, "%s.%08X.deleted", name, cnt); + if (MoveFile(name, buf)) + break; + + if ((errno= GetLastError()) == ERROR_ALREADY_EXISTS) + continue; + + /* This happened during tests with MERGE tables. */ + if (errno == ERROR_ACCESS_DENIED) + continue; + + DBUG_PRINT("warning", ("Failed to rename %s to %s, errno: %d", + name, buf, errno)); + break; + } + + if (errno == ERROR_FILE_NOT_FOUND) + { + my_errno= ENOENT; // marking, that `name' doesn't exist + } + else if (errno == 0) + { + if (DeleteFile(buf)) + DBUG_RETURN(0); + else if ((my_errno= GetLastError()) == 0) + my_errno= ENOENT; // marking, that `buf' doesn't exist + } else + my_errno= errno; + + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)), + name, my_errno); + DBUG_RETURN(-1); +} +#endif diff --git a/externals/mysql/mysys/my_div.c b/externals/mysql/mysys/my_div.c new file mode 100644 index 00000000000..d29d3668852 --- /dev/null +++ b/externals/mysql/mysys/my_div.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +/* + Get filename of file + + SYNOPSIS + my_filename() + fd File descriptor +*/ + +char * my_filename(File fd) +{ + DBUG_ENTER("my_filename"); + if ((uint) fd >= (uint) my_file_limit) + DBUG_RETURN((char*) "UNKNOWN"); + if (fd >= 0 && my_file_info[fd].type != UNOPEN) + { + DBUG_RETURN(my_file_info[fd].name); + } + else + DBUG_RETURN((char*) "UNOPENED"); /* Debug message */ +} diff --git a/externals/mysql/mysys/my_dup.c b/externals/mysql/mysys/my_dup.c new file mode 100644 index 00000000000..5fdd6e9f364 --- /dev/null +++ b/externals/mysql/mysys/my_dup.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include +#if defined(__WIN__) +#include +#endif + + /* Open a file */ + +File my_dup(File file, myf MyFlags) +{ + File fd; + const char *filename; + DBUG_ENTER("my_dup"); + DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags)); +#ifdef _WIN32 + fd= my_win_dup(file); +#else + fd= dup(file); +#endif + filename= (((uint) file < my_file_limit) ? + my_file_info[(int) file].name : "Unknown"); + DBUG_RETURN(my_register_filename(fd, filename, FILE_BY_DUP, + EE_FILENOTFOUND, MyFlags)); +} /* my_open */ diff --git a/externals/mysql/mysys/my_error.c b/externals/mysql/mysys/my_error.c new file mode 100644 index 00000000000..dea57480111 --- /dev/null +++ b/externals/mysql/mysys/my_error.c @@ -0,0 +1,289 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include +#include + +/* Max length of a error message. Should be kept in sync with MYSQL_ERRMSG_SIZE. */ +#define ERRMSGSIZE (512) + +/* Define some external variables for error handling */ + +/* + WARNING! + my_error family functions have to be used according following rules: + - if message have not parameters use my_message(ER_CODE, ER(ER_CODE), MYF(N)) + - if message registered use my_error(ER_CODE, MYF(N), ...). + - With some special text of errror message use: + my_printf_error(ER_CODE, format, MYF(N), ...) +*/ + +/* + Message texts are registered into a linked list of 'my_err_head' structs. + Each struct contains (1.) an array of pointers to C character strings with + '\0' termination, (2.) the error number for the first message in the array + (array index 0) and (3.) the error number for the last message in the array + (array index (last - first)). + The array may contain gaps with NULL pointers and pointers to empty strings. + Both kinds of gaps will be translated to "Unknown error %d.", if my_error() + is called with a respective error number. + The list of header structs is sorted in increasing order of error numbers. + Negative error numbers are allowed. Overlap of error numbers is not allowed. + Not registered error numbers will be translated to "Unknown error %d.". +*/ +static struct my_err_head +{ + struct my_err_head *meh_next; /* chain link */ + const char **meh_errmsgs; /* error messages array */ + int meh_first; /* error number matching array slot 0 */ + int meh_last; /* error number matching last slot */ +} my_errmsgs_globerrs = {NULL, globerrs, EE_ERROR_FIRST, EE_ERROR_LAST}; + +static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs; + + +/* + Error message to user + + SYNOPSIS + my_error() + nr Errno + MyFlags Flags + ... variable list +*/ + +void my_error(int nr, myf MyFlags, ...) +{ + const char *format; + struct my_err_head *meh_p; + va_list args; + char ebuff[ERRMSGSIZE]; + DBUG_ENTER("my_error"); + DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno)); + + /* Search for the error messages array, which could contain the message. */ + for (meh_p= my_errmsgs_list; meh_p; meh_p= meh_p->meh_next) + if (nr <= meh_p->meh_last) + break; + + /* get the error message string. Default, if NULL or empty string (""). */ + if (! (format= (meh_p && (nr >= meh_p->meh_first)) ? + meh_p->meh_errmsgs[nr - meh_p->meh_first] : NULL) || ! *format) + (void) my_snprintf(ebuff, sizeof(ebuff), "Unknown error %d", nr); + else + { + va_start(args,MyFlags); + (void) my_vsnprintf(ebuff, sizeof(ebuff), format, args); + va_end(args); + } + (*error_handler_hook)(nr, ebuff, MyFlags); + DBUG_VOID_RETURN; +} + + +/* + Error as printf + + SYNOPSIS + my_printf_error() + error Errno + format Format string + MyFlags Flags + ... variable list +*/ + +void my_printf_error(uint error, const char *format, myf MyFlags, ...) +{ + va_list args; + char ebuff[ERRMSGSIZE]; + DBUG_ENTER("my_printf_error"); + DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d format: %s", + error, MyFlags, errno, format)); + + va_start(args,MyFlags); + (void) my_vsnprintf(ebuff, sizeof(ebuff), format, args); + va_end(args); + (*error_handler_hook)(error, ebuff, MyFlags); + DBUG_VOID_RETURN; +} + + +/* + Error with va_list + + SYNOPSIS + my_printv_error() + error Errno + format Format string + MyFlags Flags + ... variable list +*/ + +void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap) +{ + char ebuff[ERRMSGSIZE]; + DBUG_ENTER("my_printv_error"); + DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d format: %s", + error, MyFlags, errno, format)); + + (void) my_vsnprintf(ebuff, sizeof(ebuff), format, ap); + (*error_handler_hook)(error, ebuff, MyFlags); + DBUG_VOID_RETURN; +} + + +/* + Give message using error_handler_hook + + SYNOPSIS + my_message() + error Errno + str Error message + MyFlags Flags +*/ + +void my_message(uint error, const char *str, register myf MyFlags) +{ + (*error_handler_hook)(error, str, MyFlags); +} + + +/* + Register error messages for use with my_error(). + + SYNOPSIS + my_error_register() + errmsgs array of pointers to error messages + first error number of first message in the array + last error number of last message in the array + + DESCRIPTION + The pointer array is expected to contain addresses to NUL-terminated + C character strings. The array contains (last - first + 1) pointers. + NULL pointers and empty strings ("") are allowed. These will be mapped to + "Unknown error" when my_error() is called with a matching error number. + This function registers the error numbers 'first' to 'last'. + No overlapping with previously registered error numbers is allowed. + + RETURN + 0 OK + != 0 Error +*/ + +int my_error_register(const char **errmsgs, int first, int last) +{ + struct my_err_head *meh_p; + struct my_err_head **search_meh_pp; + + /* Allocate a new header structure. */ + if (! (meh_p= (struct my_err_head*) my_malloc(sizeof(struct my_err_head), + MYF(MY_WME)))) + return 1; + meh_p->meh_errmsgs= errmsgs; + meh_p->meh_first= first; + meh_p->meh_last= last; + + /* Search for the right position in the list. */ + for (search_meh_pp= &my_errmsgs_list; + *search_meh_pp; + search_meh_pp= &(*search_meh_pp)->meh_next) + { + if ((*search_meh_pp)->meh_last > first) + break; + } + + /* Error numbers must be unique. No overlapping is allowed. */ + if (*search_meh_pp && ((*search_meh_pp)->meh_first <= last)) + { + my_free((uchar*)meh_p, MYF(0)); + return 1; + } + + /* Insert header into the chain. */ + meh_p->meh_next= *search_meh_pp; + *search_meh_pp= meh_p; + return 0; +} + + +/* + Unregister formerly registered error messages. + + SYNOPSIS + my_error_unregister() + first error number of first message + last error number of last message + + DESCRIPTION + This function unregisters the error numbers 'first' to 'last'. + These must have been previously registered by my_error_register(). + 'first' and 'last' must exactly match the registration. + If a matching registration is present, the header is removed from the + list and the pointer to the error messages pointers array is returned. + Otherwise, NULL is returned. + + RETURN + non-NULL OK, returns address of error messages pointers array. + NULL Error, no such number range registered. +*/ + +const char **my_error_unregister(int first, int last) +{ + struct my_err_head *meh_p; + struct my_err_head **search_meh_pp; + const char **errmsgs; + + /* Search for the registration in the list. */ + for (search_meh_pp= &my_errmsgs_list; + *search_meh_pp; + search_meh_pp= &(*search_meh_pp)->meh_next) + { + if (((*search_meh_pp)->meh_first == first) && + ((*search_meh_pp)->meh_last == last)) + break; + } + if (! *search_meh_pp) + return NULL; + + /* Remove header from the chain. */ + meh_p= *search_meh_pp; + *search_meh_pp= meh_p->meh_next; + + /* Save the return value and free the header. */ + errmsgs= meh_p->meh_errmsgs; + my_free((uchar*) meh_p, MYF(0)); + + return errmsgs; +} + + +void my_error_unregister_all(void) +{ + struct my_err_head *cursor, *saved_next; + + for (cursor= my_errmsgs_globerrs.meh_next; cursor != NULL; cursor= saved_next) + { + /* We need this ptr, but we're about to free its container, so save it. */ + saved_next= cursor->meh_next; + + my_free((uchar*) cursor, MYF(0)); + } + my_errmsgs_globerrs.meh_next= NULL; /* Freed in first iteration above. */ + + my_errmsgs_list= &my_errmsgs_globerrs; +} diff --git a/externals/mysql/mysys/my_file.c b/externals/mysql/mysys/my_file.c new file mode 100644 index 00000000000..ec0c9c425ea --- /dev/null +++ b/externals/mysql/mysys/my_file.c @@ -0,0 +1,135 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "my_static.h" +#include + +/* + set how many open files we want to be able to handle + + SYNOPSIS + set_maximum_open_files() + max_file_limit Files to open + + NOTES + The request may not fulfilled becasue of system limitations + + RETURN + Files available to open. + May be more or less than max_file_limit! +*/ + +#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) + +#ifndef RLIM_INFINITY +#define RLIM_INFINITY ((uint) 0xffffffff) +#endif + +static uint set_max_open_files(uint max_file_limit) +{ + struct rlimit rlimit; + uint old_cur; + DBUG_ENTER("set_max_open_files"); + DBUG_PRINT("enter",("files: %u", max_file_limit)); + + if (!getrlimit(RLIMIT_NOFILE,&rlimit)) + { + old_cur= (uint) rlimit.rlim_cur; + DBUG_PRINT("info", ("rlim_cur: %u rlim_max: %u", + (uint) rlimit.rlim_cur, + (uint) rlimit.rlim_max)); + if (rlimit.rlim_cur == RLIM_INFINITY) + rlimit.rlim_cur = max_file_limit; + if (rlimit.rlim_cur >= max_file_limit) + DBUG_RETURN(rlimit.rlim_cur); /* purecov: inspected */ + rlimit.rlim_cur= rlimit.rlim_max= max_file_limit; + if (setrlimit(RLIMIT_NOFILE, &rlimit)) + max_file_limit= old_cur; /* Use original value */ + else + { + rlimit.rlim_cur= 0; /* Safety if next call fails */ + (void) getrlimit(RLIMIT_NOFILE,&rlimit); + DBUG_PRINT("info", ("rlim_cur: %u", (uint) rlimit.rlim_cur)); + if (rlimit.rlim_cur) /* If call didn't fail */ + max_file_limit= (uint) rlimit.rlim_cur; + } + } + DBUG_PRINT("exit",("max_file_limit: %u", max_file_limit)); + DBUG_RETURN(max_file_limit); +} + +#else +static int set_max_open_files(uint max_file_limit) +{ + /* We don't know the limit. Return best guess */ + return min(max_file_limit, OS_FILE_LIMIT); +} +#endif + + +/* + Change number of open files + + SYNOPSIS: + my_set_max_open_files() + files Number of requested files + + RETURN + number of files available for open +*/ + +uint my_set_max_open_files(uint files) +{ + struct st_my_file_info *tmp; + DBUG_ENTER("my_set_max_open_files"); + DBUG_PRINT("enter",("files: %u my_file_limit: %u", files, my_file_limit)); + + files+= MY_FILE_MIN; + files= set_max_open_files(min(files, OS_FILE_LIMIT)); + if (files <= MY_NFILE) + DBUG_RETURN(files); + + if (!(tmp= (struct st_my_file_info*) my_malloc(sizeof(*tmp) * files, + MYF(MY_WME)))) + DBUG_RETURN(MY_NFILE); + + /* Copy any initialized files */ + memcpy((char*) tmp, (char*) my_file_info, + sizeof(*tmp) * min(my_file_limit, files)); + bzero((char*) (tmp + my_file_limit), + max((int) (files- my_file_limit), 0)*sizeof(*tmp)); + my_free_open_file_info(); /* Free if already allocated */ + my_file_info= tmp; + my_file_limit= files; + DBUG_PRINT("exit",("files: %u", files)); + DBUG_RETURN(files); +} + + +void my_free_open_file_info() +{ + DBUG_ENTER("my_free_file_info"); + if (my_file_info != my_file_info_default) + { + /* Copy data back for my_print_open_files */ + memcpy((char*) my_file_info_default, my_file_info, + sizeof(*my_file_info_default)* MY_NFILE); + my_free((char*) my_file_info, MYF(0)); + my_file_info= my_file_info_default; + my_file_limit= MY_NFILE; + } + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/mysys/my_fopen.c b/externals/mysql/mysys/my_fopen.c new file mode 100644 index 00000000000..ef8a385dcfe --- /dev/null +++ b/externals/mysql/mysys/my_fopen.c @@ -0,0 +1,226 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "my_static.h" +#include +#include "mysys_err.h" + +static void make_ftype(char * to,int flag); + +/* + Open a file as stream + + SYNOPSIS + my_fopen() + FileName Path-name of file + Flags Read | write | append | trunc (like for open()) + MyFlags Flags for handling errors + + RETURN + 0 Error + # File handler +*/ + +FILE *my_fopen(const char *filename, int flags, myf MyFlags) +{ + FILE *fd; + char type[5]; + DBUG_ENTER("my_fopen"); + DBUG_PRINT("my",("Name: '%s' flags: %d MyFlags: %d", + filename, flags, MyFlags)); + + make_ftype(type,flags); + +#ifdef _WIN32 + fd= my_win_fopen(filename, type); +#else + fd= fopen(filename, type); +#endif + if (fd != 0) + { + /* + The test works if MY_NFILE < 128. The problem is that fileno() is char + on some OS (SUNOS). Actually the filename save isn't that important + so we can ignore if this doesn't work. + */ + + int filedesc= my_fileno(fd); + if ((uint)filedesc >= my_file_limit) + { + thread_safe_increment(my_stream_opened,&THR_LOCK_open); + DBUG_RETURN(fd); /* safeguard */ + } + pthread_mutex_lock(&THR_LOCK_open); + if ((my_file_info[filedesc].name= (char*) + my_strdup(filename,MyFlags))) + { + my_stream_opened++; + my_file_total_opened++; + my_file_info[filedesc].type= STREAM_BY_FOPEN; + pthread_mutex_unlock(&THR_LOCK_open); + DBUG_PRINT("exit",("stream: %p", fd)); + DBUG_RETURN(fd); + } + pthread_mutex_unlock(&THR_LOCK_open); + (void) my_fclose(fd,MyFlags); + my_errno=ENOMEM; + } + else + my_errno=errno; + DBUG_PRINT("error",("Got error %d on open",my_errno)); + if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) + my_error((flags & O_RDONLY) || (flags == O_RDONLY ) ? EE_FILENOTFOUND : + EE_CANTCREATEFILE, + MYF(ME_BELL+ME_WAITTANG), filename, my_errno); + DBUG_RETURN((FILE*) 0); +} /* my_fopen */ + + + /* Close a stream */ + +/* Close a stream */ +int my_fclose(FILE *fd, myf MyFlags) +{ + int err,file; + DBUG_ENTER("my_fclose"); + DBUG_PRINT("my",("stream: %p MyFlags: %d", fd, MyFlags)); + + pthread_mutex_lock(&THR_LOCK_open); + file= my_fileno(fd); +#ifndef _WIN32 + err= fclose(fd); +#else + err= my_win_fclose(fd); +#endif + if(err < 0) + { + my_errno=errno; + if (MyFlags & (MY_FAE | MY_WME)) + my_error(EE_BADCLOSE, MYF(ME_BELL+ME_WAITTANG), + my_filename(file),errno); + } + else + my_stream_opened--; + if ((uint) file < my_file_limit && my_file_info[file].type != UNOPEN) + { + my_file_info[file].type = UNOPEN; + my_free(my_file_info[file].name, MYF(MY_ALLOW_ZERO_PTR)); + } + pthread_mutex_unlock(&THR_LOCK_open); + DBUG_RETURN(err); +} /* my_fclose */ + + + /* Make a stream out of a file handle */ + /* Name may be 0 */ + +FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) +{ + FILE *fd; + char type[5]; + DBUG_ENTER("my_fdopen"); + DBUG_PRINT("my",("fd: %d Flags: %d MyFlags: %d", + Filedes, Flags, MyFlags)); + + make_ftype(type,Flags); +#ifdef _WIN32 + fd= my_win_fdopen(Filedes, type); +#else + fd= fdopen(Filedes, type); +#endif + if (!fd) + { + my_errno=errno; + if (MyFlags & (MY_FAE | MY_WME)) + my_error(EE_CANT_OPEN_STREAM, MYF(ME_BELL+ME_WAITTANG),errno); + } + else + { + pthread_mutex_lock(&THR_LOCK_open); + my_stream_opened++; + if ((uint) Filedes < (uint) my_file_limit) + { + if (my_file_info[Filedes].type != UNOPEN) + { + my_file_opened--; /* File is opened with my_open ! */ + } + else + { + my_file_info[Filedes].name= my_strdup(name,MyFlags); + } + my_file_info[Filedes].type = STREAM_BY_FDOPEN; + } + pthread_mutex_unlock(&THR_LOCK_open); + } + + DBUG_PRINT("exit",("stream: %p", fd)); + DBUG_RETURN(fd); +} /* my_fdopen */ + + +/* + Make a fopen() typestring from a open() type bitmap + + SYNOPSIS + make_ftype() + to String for fopen() is stored here + flag Flag used by open() + + IMPLEMENTATION + This routine attempts to find the best possible match + between a numeric option and a string option that could be + fed to fopen. There is not a 1 to 1 mapping between the two. + + NOTE + On Unix, O_RDONLY is usually 0 + + MAPPING + r == O_RDONLY + w == O_WRONLY|O_TRUNC|O_CREAT + a == O_WRONLY|O_APPEND|O_CREAT + r+ == O_RDWR + w+ == O_RDWR|O_TRUNC|O_CREAT + a+ == O_RDWR|O_APPEND|O_CREAT +*/ + +static void make_ftype(register char * to, register int flag) +{ + /* check some possible invalid combinations */ + DBUG_ASSERT((flag & (O_TRUNC | O_APPEND)) != (O_TRUNC | O_APPEND)); + DBUG_ASSERT((flag & (O_WRONLY | O_RDWR)) != (O_WRONLY | O_RDWR)); + + if ((flag & (O_RDONLY|O_WRONLY)) == O_WRONLY) + *to++= (flag & O_APPEND) ? 'a' : 'w'; + else if (flag & O_RDWR) + { + /* Add '+' after theese */ + if (flag & (O_TRUNC | O_CREAT)) + *to++= 'w'; + else if (flag & O_APPEND) + *to++= 'a'; + else + *to++= 'r'; + *to++= '+'; + } + else + *to++= 'r'; + +#if FILE_BINARY /* If we have binary-files */ + if (flag & FILE_BINARY) + *to++='b'; +#endif + *to='\0'; +} /* make_ftype */ diff --git a/externals/mysql/mysys/my_fstream.c b/externals/mysql/mysys/my_fstream.c new file mode 100644 index 00000000000..c7006e0a955 --- /dev/null +++ b/externals/mysql/mysys/my_fstream.c @@ -0,0 +1,195 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* USE_MY_STREAM isn't set because we can't thrust my_fclose! */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include + +#ifdef HAVE_FSEEKO +#undef ftell +#undef fseek +#define ftell(A) ftello(A) +#define fseek(A,B,C) fseeko((A),(B),(C)) +#endif + +/* + Read a chunk of bytes from a FILE + + SYNOPSIS + my_fread() + stream File descriptor + Buffer Buffer to read to + Count Number of bytes to read + MyFlags Flags on what to do on error + + RETURN + (size_t) -1 Error + # Number of bytes read + */ + +size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags) +{ + size_t readbytes; + DBUG_ENTER("my_fread"); + DBUG_PRINT("my",("stream: %p Buffer: %p Count: %u MyFlags: %d", + stream, Buffer, (uint) Count, MyFlags)); + + if ((readbytes= fread(Buffer, sizeof(char), Count, stream)) != Count) + { + DBUG_PRINT("error",("Read only %d bytes", (int) readbytes)); + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + if (ferror(stream)) + my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG), + my_filename(my_fileno(stream)),errno); + else + if (MyFlags & (MY_NABP | MY_FNABP)) + my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG), + my_filename(my_fileno(stream)),errno); + } + my_errno=errno ? errno : -1; + if (ferror(stream) || MyFlags & (MY_NABP | MY_FNABP)) + DBUG_RETURN((size_t) -1); /* Return with error */ + } + if (MyFlags & (MY_NABP | MY_FNABP)) + DBUG_RETURN(0); /* Read ok */ + DBUG_RETURN(readbytes); +} /* my_fread */ + + +/* + Write a chunk of bytes to a stream + + my_fwrite() + stream File descriptor + Buffer Buffer to write from + Count Number of bytes to write + MyFlags Flags on what to do on error + + RETURN + (size_t) -1 Error + # Number of bytes written +*/ + +size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags) +{ + size_t writtenbytes =0; + my_off_t seekptr; +#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) + uint errors; +#endif + DBUG_ENTER("my_fwrite"); + DBUG_PRINT("my",("stream: %p Buffer: %p Count: %u MyFlags: %d", + stream, Buffer, (uint) Count, MyFlags)); + +#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) + errors=0; +#endif + seekptr= ftell(stream); + for (;;) + { + size_t written; + if ((written = (size_t) fwrite((char*) Buffer,sizeof(char), + Count, stream)) != Count) + { + DBUG_PRINT("error",("Write only %d bytes", (int) writtenbytes)); + my_errno=errno; + if (written != (size_t) -1) + { + seekptr+=written; + Buffer+=written; + writtenbytes+=written; + Count-=written; + } +#ifdef EINTR + if (errno == EINTR) + { + (void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0)); + continue; + } +#endif +#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) +#ifdef THREAD + if (my_thread_var->abort) + MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ +#endif + if ((errno == ENOSPC || errno == EDQUOT) && + (MyFlags & MY_WAIT_IF_FULL)) + { + wait_for_free_space("[stream]", errors); + errors++; + (void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0)); + continue; + } +#endif + if (ferror(stream) || (MyFlags & (MY_NABP | MY_FNABP))) + { + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG), + my_filename(my_fileno(stream)),errno); + } + writtenbytes= (size_t) -1; /* Return that we got error */ + break; + } + } + if (MyFlags & (MY_NABP | MY_FNABP)) + writtenbytes= 0; /* Everything OK */ + else + writtenbytes+= written; + break; + } + DBUG_RETURN(writtenbytes); +} /* my_fwrite */ + + +/* Seek to position in file */ + +my_off_t my_fseek(FILE *stream, my_off_t pos, int whence, + myf MyFlags __attribute__((unused))) +{ + DBUG_ENTER("my_fseek"); + DBUG_PRINT("my",("stream: %p pos: %lu whence: %d MyFlags: %d", + stream, (long) pos, whence, MyFlags)); + DBUG_RETURN(fseek(stream, (off_t) pos, whence) ? + MY_FILEPOS_ERROR : (my_off_t) ftell(stream)); +} /* my_seek */ + + +/* Tell current position of file */ + +my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused))) +{ + off_t pos; + DBUG_ENTER("my_ftell"); + DBUG_PRINT("my",("stream: %p MyFlags: %d", stream, MyFlags)); + pos=ftell(stream); + DBUG_PRINT("exit",("ftell: %lu",(ulong) pos)); + DBUG_RETURN((my_off_t) pos); +} /* my_ftell */ + + +/* Get a File corresponding to the stream*/ +int my_fileno(FILE *f) +{ +#ifdef _WIN32 + return my_win_fileno(f); +#else + return fileno(f); +#endif +} diff --git a/externals/mysql/mysys/my_gethostbyname.c b/externals/mysql/mysys/my_gethostbyname.c new file mode 100644 index 00000000000..067fdfee9db --- /dev/null +++ b/externals/mysql/mysys/my_gethostbyname.c @@ -0,0 +1,111 @@ +/* Copyright (C) 2002, 2004 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* Thread safe version of gethostbyname_r() */ + +#include "mysys_priv.h" +#if !defined(__WIN__) +#include +#endif +#include + +/* This file is not needed if my_gethostbyname_r is a macro */ +#if !defined(my_gethostbyname_r) + +/* + Emulate SOLARIS style calls, not because it's better, but just to make the + usage of getbostbyname_r simpler. +*/ + +#if defined(HAVE_GETHOSTBYNAME_R) + +#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) + +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop) +{ + struct hostent *hp; + DBUG_ASSERT((size_t) buflen >= sizeof(*result)); + if (gethostbyname_r(name,result, buffer, (size_t) buflen, &hp, h_errnop)) + return 0; + return hp; +} + +#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) + +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop) +{ + if (gethostbyname_r(name,result,(struct hostent_data *) buffer) == -1) + { + *h_errnop= errno; + return 0; + } + return result; +} + +#else + +/* gethostbyname_r with similar interface as gethostbyname() */ + +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop) +{ + struct hostent *hp; + DBUG_ASSERT(buflen >= sizeof(struct hostent_data)); + hp= gethostbyname_r(name,result,(struct hostent_data *) buffer); + *h_errnop= errno; + return hp; +} +#endif /* GLIBC2_STYLE_GETHOSTBYNAME_R */ + +#else /* !HAVE_GETHOSTBYNAME_R */ + +#ifdef THREAD +extern pthread_mutex_t LOCK_gethostbyname_r; +#endif + +/* + No gethostbyname_r() function exists. + In this case we have to keep a mutex over the call to ensure that no + other thread is going to reuse the internal memory. + + The user is responsible to call my_gethostbyname_r_free() when he + is finished with the structure. +*/ + +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop) +{ + struct hostent *hp; + pthread_mutex_lock(&LOCK_gethostbyname_r); + hp= gethostbyname(name); + *h_errnop= h_errno; + return hp; +} + +void my_gethostbyname_r_free() +{ + pthread_mutex_unlock(&LOCK_gethostbyname_r); +} + +#endif /* !HAVE_GETHOSTBYNAME_R */ +#endif /* !my_gethostbyname_r */ diff --git a/externals/mysql/mysys/my_gethwaddr.c b/externals/mysql/mysys/my_gethwaddr.c new file mode 100644 index 00000000000..7fae1a51446 --- /dev/null +++ b/externals/mysql/mysys/my_gethwaddr.c @@ -0,0 +1,222 @@ +/* Copyright (C) 2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* get hardware address for an interface */ +/* if there are many available, any non-zero one can be used */ + +#include "mysys_priv.h" +#include + +#ifndef MAIN + +#if defined(__FreeBSD__) || defined(__linux__) +static my_bool memcpy_and_test(uchar *to, uchar *from, uint len) +{ + uint i, res=1; + + for (i=0; i < len; i++) + if ((*to++= *from++)) + res=0; + return res; +} +#endif /* FreeBSD || linux */ + +#ifdef __FreeBSD__ + +#include +#include +#include +#include +#include + +my_bool my_gethwaddr(uchar *to) +{ + size_t len; + uchar *buf, *next, *end, *addr; + struct if_msghdr *ifm; + struct sockaddr_dl *sdl; + int i, res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0}; + + if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1) + goto err; + if (!(buf = alloca(len))) + goto err; + if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) + goto err; + + end = buf + len; + + for (next = buf ; res && next < end ; next += ifm->ifm_msglen) + { + ifm = (struct if_msghdr *)next; + if (ifm->ifm_type == RTM_IFINFO) + { + sdl = (struct sockaddr_dl *)(ifm + 1); + addr=LLADDR(sdl); + res=memcpy_and_test(to, addr, ETHER_ADDR_LEN); + } + } + +err: + return res; +} + +#elif __linux__ + +#include +#include +#include + +my_bool my_gethwaddr(uchar *to) +{ + int fd, res=1; + struct ifreq ifr; + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + goto err; + + bzero(&ifr, sizeof(ifr)); + strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1); + + do { + if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0) + res=memcpy_and_test(to, (uchar *)&ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN); + } while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6'); + + close(fd); +err: + return res; +} + +#elif defined(__WIN__) +#include + +/* + The following typedef is for dynamically loading + iphlpapi.dll / GetAdaptersAddresses. Dynamic loading is + used because GetAdaptersAddresses is not available on Windows 2000 + which MySQL still supports. Static linking would cause an unresolved export. +*/ +typedef DWORD (WINAPI *pfnGetAdaptersAddresses)(IN ULONG Family, + IN DWORD Flags,IN PVOID Reserved, + OUT PIP_ADAPTER_ADDRESSES pAdapterAddresses, + IN OUT PULONG pOutBufLen); + +/* + my_gethwaddr - Windows version + + @brief Retrieve MAC address from network hardware + + @param[out] to MAC address exactly six bytes + + @return Operation status + @retval 0 OK + @retval <>0 FAILED +*/ +my_bool my_gethwaddr(uchar *to) +{ + PIP_ADAPTER_ADDRESSES pAdapterAddresses; + PIP_ADAPTER_ADDRESSES pCurrAddresses; + IP_ADAPTER_ADDRESSES adapterAddresses; + ULONG address_len; + my_bool return_val= 1; + static pfnGetAdaptersAddresses fnGetAdaptersAddresses= + (pfnGetAdaptersAddresses)-1; + + if(fnGetAdaptersAddresses == (pfnGetAdaptersAddresses)-1) + { + /* Get the function from the DLL */ + fnGetAdaptersAddresses= (pfnGetAdaptersAddresses) + GetProcAddress(LoadLibrary("iphlpapi.dll"), + "GetAdaptersAddresses"); + } + if (!fnGetAdaptersAddresses) + return 1; /* failed to get function */ + address_len= sizeof (IP_ADAPTER_ADDRESSES); + + /* Get the required size for the address data. */ + if (fnGetAdaptersAddresses(AF_UNSPEC, 0, 0, &adapterAddresses, &address_len) + == ERROR_BUFFER_OVERFLOW) + { + pAdapterAddresses= my_malloc(address_len, 0); + if (!pAdapterAddresses) + return 1; /* error, alloc failed */ + } + else + pAdapterAddresses= &adapterAddresses; /* one is enough don't alloc */ + + /* Get the hardware info. */ + if (fnGetAdaptersAddresses(AF_UNSPEC, 0, 0, pAdapterAddresses, &address_len) + == NO_ERROR) + { + pCurrAddresses= pAdapterAddresses; + + while (pCurrAddresses) + { + /* Look for ethernet cards. */ + if (pCurrAddresses->IfType == IF_TYPE_ETHERNET_CSMACD) + { + /* check for a good address */ + if (pCurrAddresses->PhysicalAddressLength < 6) + continue; /* bad address */ + + /* save 6 bytes of the address in the 'to' parameter */ + memcpy(to, pCurrAddresses->PhysicalAddress, 6); + + /* Network card found, we're done. */ + return_val= 0; + break; + } + pCurrAddresses= pCurrAddresses->Next; + } + } + + /* Clean up memory allocation. */ + if (pAdapterAddresses != &adapterAddresses) + my_free(pAdapterAddresses, 0); + + return return_val; +} + +#else /* __FreeBSD__ || __linux__ || __WIN__ */ +/* just fail */ +my_bool my_gethwaddr(uchar *to __attribute__((unused))) +{ + return 1; +} +#endif + +#else /* MAIN */ +int main(int argc __attribute__((unused)),char **argv) +{ + uchar mac[6]; + uint i; + MY_INIT(argv[0]); + if (my_gethwaddr(mac)) + { + printf("my_gethwaddr failed with errno %d\n", errno); + exit(1); + } + for (i=0; i < sizeof(mac); i++) + { + if (i) printf(":"); + printf("%02x", mac[i]); + } + printf("\n"); + return 0; +} +#endif + diff --git a/externals/mysql/mysys/my_getncpus.c b/externals/mysql/mysys/my_getncpus.c new file mode 100644 index 00000000000..c09684abe5b --- /dev/null +++ b/externals/mysql/mysys/my_getncpus.c @@ -0,0 +1,49 @@ +/* Copyright (C) 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* get the number of (online) CPUs */ + +#include "mysys_priv.h" +#ifdef HAVE_UNISTD_H +#include +#endif + +static int ncpus=0; + +int my_getncpus() +{ + if (!ncpus) + { +#ifdef _SC_NPROCESSORS_ONLN + ncpus= sysconf(_SC_NPROCESSORS_ONLN); +#elif defined(__WIN__) + SYSTEM_INFO sysinfo; + + /* + * We are not calling GetNativeSystemInfo here because (1) we + * don't believe that they return different values for number + * of processors and (2) if WOW64 limits processors for Win32 + * then we don't want to try to override that. + */ + GetSystemInfo(&sysinfo); + + ncpus= sysinfo.dwNumberOfProcessors; +#else +/* unknown so play safe: assume SMP and forbid uniprocessor build */ + ncpus= 2; +#endif + } + return ncpus; +} diff --git a/externals/mysql/mysys/my_getopt.c b/externals/mysql/mysys/my_getopt.c new file mode 100644 index 00000000000..a16cc0897a8 --- /dev/null +++ b/externals/mysql/mysys/my_getopt.c @@ -0,0 +1,1301 @@ +/* Copyright (C) 2002-2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include +#include + +typedef void (*init_func_p)(const struct my_option *option, uchar* *variable, + longlong value); + +static void default_reporter(enum loglevel level, const char *format, ...); +my_error_reporter my_getopt_error_reporter= &default_reporter; + +static int findopt(char *, uint, const struct my_option **, char **); +my_bool getopt_compare_strings(const char *, const char *, uint); +static longlong getopt_ll(char *, const struct my_option *, int *); +static ulonglong getopt_ull(char *, const struct my_option *, int *); +static double getopt_double(char *, const struct my_option *, int *); +static void init_variables(const struct my_option *, init_func_p); +static void init_one_value(const struct my_option *opt, uchar **, longlong); +static void fini_one_value(const struct my_option *, uchar **, longlong); +static int setval(const struct my_option *, uchar **, char *, my_bool); +static char *check_struct_option(char *cur_arg, char *key_name); + +/* + The following three variables belong to same group and the number and + order of their arguments must correspond to each other. +*/ +static const char *special_opt_prefix[]= +{"skip", "disable", "enable", "maximum", "loose", 0}; +static const uint special_opt_prefix_lengths[]= +{ 4, 7, 6, 7, 5, 0}; +enum enum_special_opt +{ OPT_SKIP, OPT_DISABLE, OPT_ENABLE, OPT_MAXIMUM, OPT_LOOSE}; + +char *disabled_my_option= (char*) "0"; + +/* + This is a flag that can be set in client programs. 0 means that + my_getopt will not print error messages, but the client should do + it by itself +*/ + +my_bool my_getopt_print_errors= 1; + +/* + This is a flag that can be set in client programs. 1 means that + my_getopt will skip over options it does not know how to handle. +*/ + +my_bool my_getopt_skip_unknown= 0; + +static void default_reporter(enum loglevel level, + const char *format, ...) +{ + va_list args; + va_start(args, format); + if (level == WARNING_LEVEL) + fprintf(stderr, "%s", "Warning: "); + else if (level == INFORMATION_LEVEL) + fprintf(stderr, "%s", "Info: "); + vfprintf(stderr, format, args); + va_end(args); + fputc('\n', stderr); + fflush(stderr); +} + +/* + function: handle_options + + Sort options; put options first, until special end of options (--), or + until end of argv. Parse options; check that the given option matches with + one of the options in struct 'my_option', return error in case of ambiguous + or unknown option. Check that option was given an argument if it requires + one. Call function 'get_one_option()' once for each option. +*/ + +static uchar** (*getopt_get_addr)(const char *, uint, const struct my_option *, int *); + +void my_getopt_register_get_addr(uchar** (*func_addr)(const char *, uint, + const struct my_option *, int *)) +{ + getopt_get_addr= func_addr; +} + +int handle_options(int *argc, char ***argv, + const struct my_option *longopts, + my_get_one_option get_one_option) +{ + uint opt_found, argvpos= 0, length; + my_bool end_of_options= 0, must_be_var, set_maximum_value, + option_is_loose; + char **pos, **pos_end, *optend, *prev_found, + *opt_str, key_name[FN_REFLEN]; + const struct my_option *optp; + uchar* *value; + int error, i; + my_bool is_cmdline_arg= 1; + + LINT_INIT(opt_found); + /* handle_options() assumes arg0 (program name) always exists */ + DBUG_ASSERT(argc && *argc >= 1); + DBUG_ASSERT(argv && *argv); + (*argc)--; /* Skip the program name */ + (*argv)++; /* --- || ---- */ + init_variables(longopts, init_one_value); + + /* + Search for args_separator, if found, then the first part of the + arguments are loaded from configs + */ + for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++) + { + if (*pos == args_separator) + { + is_cmdline_arg= 0; + break; + } + } + + for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++) + { + char **first= pos; + char *cur_arg= *pos; + if (!is_cmdline_arg && (cur_arg == args_separator)) + { + is_cmdline_arg= 1; + + /* save the separator too if skip unkown options */ + if (my_getopt_skip_unknown) + (*argv)[argvpos++]= cur_arg; + else + (*argc)--; + continue; + } + if (cur_arg[0] == '-' && cur_arg[1] && !end_of_options) /* must be opt */ + { + char *argument= 0; + must_be_var= 0; + set_maximum_value= 0; + option_is_loose= 0; + + cur_arg++; /* skip '-' */ + if (*cur_arg == '-' || *cur_arg == 'O') /* check for long option, */ + { /* --set-variable, or -O */ + if (*cur_arg == 'O') + { + must_be_var= 1; + + if (!(*++cur_arg)) /* If not -Ovar=# */ + { + /* the argument must be in next argv */ + if (!*++pos) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Option '-O' requires an argument", + my_progname); + return EXIT_ARGUMENT_REQUIRED; + } + cur_arg= *pos; + (*argc)--; + } + } + else if (!getopt_compare_strings(cur_arg, "-set-variable", 13)) + { + must_be_var= 1; + if (cur_arg[13] == '=') + { + cur_arg+= 14; + if (!*cur_arg) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Option '--set-variable' requires an argument", + my_progname); + return EXIT_ARGUMENT_REQUIRED; + } + } + else if (cur_arg[14]) /* garbage, or another option. break out */ + must_be_var= 0; + else + { + /* the argument must be in next argv */ + if (!*++pos) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Option '--set-variable' requires an argument", + my_progname); + return EXIT_ARGUMENT_REQUIRED; + } + cur_arg= *pos; + (*argc)--; + } + } + else if (!must_be_var) + { + if (!*++cur_arg) /* skip the double dash */ + { + /* '--' means end of options, look no further */ + end_of_options= 1; + (*argc)--; + continue; + } + } + opt_str= check_struct_option(cur_arg, key_name); + optend= strcend(opt_str, '='); + length= (uint) (optend - opt_str); + if (*optend == '=') + optend++; + else + optend= 0; + + /* + Find first the right option. Return error in case of an ambiguous, + or unknown option + */ + LINT_INIT(prev_found); + optp= longopts; + if (!(opt_found= findopt(opt_str, length, &optp, &prev_found))) + { + /* + Didn't find any matching option. Let's see if someone called + option with a special option prefix + */ + if (!must_be_var) + { + if (optend) + must_be_var= 1; /* option is followed by an argument */ + for (i= 0; special_opt_prefix[i]; i++) + { + if (!getopt_compare_strings(special_opt_prefix[i], opt_str, + special_opt_prefix_lengths[i]) && + (opt_str[special_opt_prefix_lengths[i]] == '-' || + opt_str[special_opt_prefix_lengths[i]] == '_')) + { + /* + We were called with a special prefix, we can reuse opt_found + */ + opt_str+= special_opt_prefix_lengths[i] + 1; + length-= special_opt_prefix_lengths[i] + 1; + if (i == OPT_LOOSE) + option_is_loose= 1; + if ((opt_found= findopt(opt_str, length, &optp, &prev_found))) + { + if (opt_found > 1) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: ambiguous option '--%s-%s' (--%s-%s)", + my_progname, special_opt_prefix[i], + cur_arg, special_opt_prefix[i], + prev_found); + return EXIT_AMBIGUOUS_OPTION; + } + switch (i) { + case OPT_SKIP: + case OPT_DISABLE: /* fall through */ + /* + double negation is actually enable again, + for example: --skip-option=0 -> option = TRUE + */ + optend= (optend && *optend == '0' && !(*(optend + 1))) ? + (char*) "1" : disabled_my_option; + break; + case OPT_ENABLE: + optend= (optend && *optend == '0' && !(*(optend + 1))) ? + disabled_my_option : (char*) "1"; + break; + case OPT_MAXIMUM: + set_maximum_value= 1; + must_be_var= 1; + break; + } + break; /* break from the inner loop, main loop continues */ + } + i= -1; /* restart the loop */ + } + } + } + if (!opt_found) + { + if (my_getopt_skip_unknown) + { + /* + preserve all the components of this unknown option, this may + occurr when the user provides options like: "-O foo" or + "--set-variable foo" (note that theres a space in there) + Generally, these kind of options are to be avoided + */ + do { + (*argv)[argvpos++]= *first++; + } while (first <= pos); + continue; + } + if (must_be_var) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(option_is_loose ? + WARNING_LEVEL : ERROR_LEVEL, + "%s: unknown variable '%s'", + my_progname, cur_arg); + if (!option_is_loose) + return EXIT_UNKNOWN_VARIABLE; + } + else + { + if (my_getopt_print_errors) + my_getopt_error_reporter(option_is_loose ? + WARNING_LEVEL : ERROR_LEVEL, + "%s: unknown option '--%s'", + my_progname, cur_arg); + if (!option_is_loose) + return EXIT_UNKNOWN_OPTION; + } + if (option_is_loose) + { + (*argc)--; + continue; + } + } + } + if (opt_found > 1) + { + if (must_be_var) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: variable prefix '%s' is not unique", + my_progname, opt_str); + return EXIT_VAR_PREFIX_NOT_UNIQUE; + } + else + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: ambiguous option '--%s' (%s, %s)", + my_progname, opt_str, prev_found, + optp->name); + return EXIT_AMBIGUOUS_OPTION; + } + } + if ((optp->var_type & GET_TYPE_MASK) == GET_DISABLED) + { + if (my_getopt_print_errors) + fprintf(stderr, + "%s: %s: Option '%s' used, but is disabled\n", my_progname, + option_is_loose ? "WARNING" : "ERROR", opt_str); + if (option_is_loose) + { + (*argc)--; + continue; + } + return EXIT_OPTION_DISABLED; + } + if (must_be_var && (optp->var_type & GET_TYPE_MASK) == GET_NO_ARG) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '%s' cannot take an argument", + my_progname, optp->name); + return EXIT_NO_ARGUMENT_ALLOWED; + } + error= 0; + value= optp->var_type & GET_ASK_ADDR ? + (*getopt_get_addr)(key_name, (uint) strlen(key_name), optp, &error) : + optp->value; + if (error) + return error; + + if (optp->arg_type == NO_ARG) + { + if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '--%s' cannot take an argument", + my_progname, optp->name); + return EXIT_NO_ARGUMENT_ALLOWED; + } + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + /* + Set bool to 1 if no argument or if the user has used + --enable-'option-name'. + *optend was set to '0' if one used --disable-option + */ + (*argc)--; + if (!optend || *optend == '1' || + !my_strcasecmp(&my_charset_latin1, optend, "true")) + *((my_bool*) value)= (my_bool) 1; + else if (*optend == '0' || + !my_strcasecmp(&my_charset_latin1, optend, "false")) + *((my_bool*) value)= (my_bool) 0; + else + { + my_getopt_error_reporter(WARNING_LEVEL, + "%s: ignoring option '--%s' due to \ +invalid value '%s'", + my_progname, optp->name, optend); + continue; + } + if (get_one_option(optp->id, optp, + *((my_bool*) value) ? + (char*) "1" : disabled_my_option)) + return EXIT_ARGUMENT_INVALID; + continue; + } + argument= optend; + } + else if (optp->arg_type == OPT_ARG && + (optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + if (optend == disabled_my_option) + *((my_bool*) value)= (my_bool) 0; + else + { + if (!optend) /* No argument -> enable option */ + *((my_bool*) value)= (my_bool) 1; + else + argument= optend; + } + } + else if (optp->arg_type == REQUIRED_ARG && !optend) + { + /* Check if there are more arguments after this one, + + Note: options loaded from config file that requires value + should always be in the form '--option=value'. + */ + if (!is_cmdline_arg || !*++pos) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '--%s' requires an argument", + my_progname, optp->name); + return EXIT_ARGUMENT_REQUIRED; + } + argument= *pos; + (*argc)--; + } + else + argument= optend; + } + else /* must be short option */ + { + for (optend= cur_arg; *optend; optend++) + { + opt_found= 0; + for (optp= longopts; optp->id; optp++) + { + if (optp->id == (int) (uchar) *optend) + { + /* Option recognized. Find next what to do with it */ + opt_found= 1; + if ((optp->var_type & GET_TYPE_MASK) == GET_DISABLED) + { + if (my_getopt_print_errors) + fprintf(stderr, + "%s: ERROR: Option '-%c' used, but is disabled\n", + my_progname, optp->id); + return EXIT_OPTION_DISABLED; + } + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL && + optp->arg_type == NO_ARG) + { + *((my_bool*) optp->value)= (my_bool) 1; + if (get_one_option(optp->id, optp, argument)) + return EXIT_UNSPECIFIED_ERROR; + continue; + } + else if (optp->arg_type == REQUIRED_ARG || + optp->arg_type == OPT_ARG) + { + if (*(optend + 1)) + { + /* The rest of the option is option argument */ + argument= optend + 1; + /* This is in effect a jump out of the outer loop */ + optend= (char*) " "; + } + else + { + if (optp->arg_type == OPT_ARG) + { + if (optp->var_type == GET_BOOL) + *((my_bool*) optp->value)= (my_bool) 1; + if (get_one_option(optp->id, optp, argument)) + return EXIT_UNSPECIFIED_ERROR; + continue; + } + /* Check if there are more arguments after this one */ + if (!pos[1]) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '-%c' requires an argument", + my_progname, optp->id); + return EXIT_ARGUMENT_REQUIRED; + } + argument= *++pos; + (*argc)--; + /* the other loop will break, because *optend + 1 == 0 */ + } + } + if ((error= setval(optp, optp->value, argument, + set_maximum_value))) + { + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Error while setting value '%s' to '%s'", + my_progname, argument, optp->name); + return error; + } + if (get_one_option(optp->id, optp, argument)) + return EXIT_UNSPECIFIED_ERROR; + break; + } + } + if (!opt_found) + { + if (my_getopt_print_errors) + my_getopt_error_reporter(ERROR_LEVEL, + "%s: unknown option '-%c'", + my_progname, *optend); + return EXIT_UNKNOWN_OPTION; + } + } + (*argc)--; /* option handled (short), decrease argument count */ + continue; + } + if ((error= setval(optp, value, argument, set_maximum_value))) + { + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Error while setting value '%s' to '%s'", + my_progname, argument, optp->name); + return error; + } + if (get_one_option(optp->id, optp, argument)) + return EXIT_UNSPECIFIED_ERROR; + + (*argc)--; /* option handled (short or long), decrease argument count */ + } + else /* non-option found */ + (*argv)[argvpos++]= cur_arg; + } + /* + Destroy the first, already handled option, so that programs that look + for arguments in 'argv', without checking 'argc', know when to stop. + Items in argv, before the destroyed one, are all non-option -arguments + to the program, yet to be (possibly) handled. + */ + (*argv)[argvpos]= 0; + return 0; +} + + +/* + function: check_struct_option + + Arguments: Current argument under processing from argv and a variable + where to store the possible key name. + + Return value: In case option is a struct option, returns a pointer to + the current argument at the position where the struct option (key_name) + ends, the next character after the dot. In case argument is not a struct + option, returns a pointer to the argument. + + key_name will hold the name of the key, or 0 if not found. +*/ + +static char *check_struct_option(char *cur_arg, char *key_name) +{ + char *ptr, *end; + + ptr= strcend(cur_arg + 1, '.'); /* Skip the first character */ + end= strcend(cur_arg, '='); + + /* + If the first dot is after an equal sign, then it is part + of a variable value and the option is not a struct option. + Also, if the last character in the string before the ending + NULL, or the character right before equal sign is the first + dot found, the option is not a struct option. + */ + if (end - ptr > 1) + { + uint len= (uint) (ptr - cur_arg); + set_if_smaller(len, FN_REFLEN-1); + strmake(key_name, cur_arg, len); + return ++ptr; + } + else + { + key_name[0]= 0; + return cur_arg; + } +} + +/* + function: setval + + Arguments: opts, argument + Will set the option value to given value +*/ + +static int setval(const struct my_option *opts, uchar* *value, char *argument, + my_bool set_maximum_value) +{ + int err= 0; + + if (value && argument) + { + uchar* *result_pos= ((set_maximum_value) ? + opts->u_max_value : value); + + if (!result_pos) + return EXIT_NO_PTR_TO_VARIABLE; + + switch ((opts->var_type & GET_TYPE_MASK)) { + case GET_BOOL: /* If argument differs from 0, enable option, else disable */ + *((my_bool*) result_pos)= (my_bool) atoi(argument) != 0; + break; + case GET_INT: + *((int*) result_pos)= (int) getopt_ll(argument, opts, &err); + break; + case GET_UINT: + *((uint*) result_pos)= (uint) getopt_ull(argument, opts, &err); + break; + case GET_LONG: + *((long*) result_pos)= (long) getopt_ll(argument, opts, &err); + break; + case GET_ULONG: + *((long*) result_pos)= (long) getopt_ull(argument, opts, &err); + break; + case GET_LL: + *((longlong*) result_pos)= getopt_ll(argument, opts, &err); + break; + case GET_ULL: + *((ulonglong*) result_pos)= getopt_ull(argument, opts, &err); + break; + case GET_DOUBLE: + *((double*) result_pos)= getopt_double(argument, opts, &err); + break; + case GET_STR: + *((char**) result_pos)= argument; + break; + case GET_STR_ALLOC: + if ((*((char**) result_pos))) + my_free((*(char**) result_pos), MYF(MY_WME | MY_FAE)); + if (!(*((char**) result_pos)= my_strdup(argument, MYF(MY_WME)))) + return EXIT_OUT_OF_MEMORY; + break; + case GET_ENUM: + if (((*(int*)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0) + return EXIT_ARGUMENT_INVALID; + break; + case GET_SET: + *((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err); + if (err) + return EXIT_ARGUMENT_INVALID; + break; + default: /* dummy default to avoid compiler warnings */ + break; + } + if (err) + return EXIT_UNKNOWN_SUFFIX; + } + return 0; +} + + +/* + Find option + + SYNOPSIS + findopt() + optpat Prefix of option to find (with - or _) + length Length of optpat + opt_res Options + ffname Place for pointer to first found name + + IMPLEMENTATION + Go through all options in the my_option struct. Return number + of options found that match the pattern and in the argument + list the option found, if any. In case of ambiguous option, store + the name in ffname argument + + RETURN + 0 No matching options + # Number of matching options + ffname points to first matching option +*/ + +static int findopt(char *optpat, uint length, + const struct my_option **opt_res, + char **ffname) +{ + uint count; + struct my_option *opt= (struct my_option *) *opt_res; + + for (count= 0; opt->name; opt++) + { + if (!getopt_compare_strings(opt->name, optpat, length)) /* match found */ + { + (*opt_res)= opt; + if (!opt->name[length]) /* Exact match */ + return 1; + if (!count) + { + count= 1; + *ffname= (char *) opt->name; /* We only need to know one prev */ + } + else if (strcmp(*ffname, opt->name)) + { + /* + The above test is to not count same option twice + (see mysql.cc, option "help") + */ + count++; + } + } + } + return count; +} + + +/* + function: compare_strings + + Works like strncmp, other than 1.) considers '-' and '_' the same. + 2.) Returns -1 if strings differ, 0 if they are equal +*/ + +my_bool getopt_compare_strings(register const char *s, register const char *t, + uint length) +{ + char const *end= s + length; + for (;s != end ; s++, t++) + { + if ((*s != '-' ? *s : '_') != (*t != '-' ? *t : '_')) + return 1; + } + return 0; +} + +/* + function: eval_num_suffix + + Transforms a number with a suffix to real number. Suffix can + be k|K for kilo, m|M for mega or g|G for giga. +*/ + +static longlong eval_num_suffix(char *argument, int *error, char *option_name) +{ + char *endchar; + longlong num; + + *error= 0; + errno= 0; + num= strtoll(argument, &endchar, 10); + if (errno == ERANGE) + { + my_getopt_error_reporter(ERROR_LEVEL, + "Incorrect integer value: '%s'", argument); + *error= 1; + return 0; + } + if (*endchar == 'k' || *endchar == 'K') + num*= 1024L; + else if (*endchar == 'm' || *endchar == 'M') + num*= 1024L * 1024L; + else if (*endchar == 'g' || *endchar == 'G') + num*= 1024L * 1024L * 1024L; + else if (*endchar) + { + fprintf(stderr, + "Unknown suffix '%c' used for variable '%s' (value '%s')\n", + *endchar, option_name, argument); + *error= 1; + return 0; + } + return num; +} + +/* + function: getopt_ll + + Evaluates and returns the value that user gave as an argument + to a variable. Recognizes (case insensitive) K as KILO, M as MEGA + and G as GIGA bytes. Some values must be in certain blocks, as + defined in the given my_option struct, this function will check + that those values are honored. + In case of an error, set error value in *err. +*/ + +static longlong getopt_ll(char *arg, const struct my_option *optp, int *err) +{ + longlong num=eval_num_suffix(arg, err, (char*) optp->name); + return getopt_ll_limit_value(num, optp, NULL); +} + +/* + function: getopt_ll_limit_value + + Applies min/max/block_size to a numeric value of an option. + Returns "fixed" value. +*/ + +longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, + my_bool *fix) +{ + longlong old= num; + my_bool adjusted= FALSE; + char buf1[255], buf2[255]; + ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L); + + if (num > 0 && ((ulonglong) num > (ulonglong) optp->max_value) && + optp->max_value) /* if max value is not set -> no upper limit */ + { + num= (ulonglong) optp->max_value; + adjusted= TRUE; + } + + switch ((optp->var_type & GET_TYPE_MASK)) { + case GET_INT: + if (num > (longlong) INT_MAX) + { + num= ((longlong) INT_MAX); + adjusted= TRUE; + } + break; + case GET_LONG: +#if SIZEOF_LONG < SIZEOF_LONG_LONG + if (num > (longlong) LONG_MAX) + { + num= ((longlong) LONG_MAX); + adjusted= TRUE; + } +#endif + break; + default: + DBUG_ASSERT((optp->var_type & GET_TYPE_MASK) == GET_LL); + break; + } + + num= ((num - optp->sub_size) / block_size); + num= (longlong) (num * block_size); + + if (num < optp->min_value) + { + num= optp->min_value; + if (old < optp->min_value) + adjusted= TRUE; + } + + if (fix) + *fix= adjusted; + else if (adjusted) + my_getopt_error_reporter(WARNING_LEVEL, + "option '%s': signed value %s adjusted to %s", + optp->name, llstr(old, buf1), llstr(num, buf2)); + return num; +} + +/* + function: getopt_ull + + This is the same as getopt_ll, but is meant for unsigned long long + values. +*/ + +static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err) +{ + ulonglong num= eval_num_suffix(arg, err, (char*) optp->name); + return getopt_ull_limit_value(num, optp, NULL); +} + + +ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, + my_bool *fix) +{ + my_bool adjusted= FALSE; + ulonglong old= num; + char buf1[255], buf2[255]; + + if ((ulonglong) num > (ulonglong) optp->max_value && + optp->max_value) /* if max value is not set -> no upper limit */ + { + num= (ulonglong) optp->max_value; + adjusted= TRUE; + } + + switch ((optp->var_type & GET_TYPE_MASK)) { + case GET_UINT: + if (num > (ulonglong) UINT_MAX) + { + num= ((ulonglong) UINT_MAX); + adjusted= TRUE; + } + break; + case GET_ULONG: +#if SIZEOF_LONG < SIZEOF_LONG_LONG + if (num > (ulonglong) ULONG_MAX) + { + num= ((ulonglong) ULONG_MAX); + adjusted= TRUE; + } +#endif + break; + default: + DBUG_ASSERT((optp->var_type & GET_TYPE_MASK) == GET_ULL); + break; + } + + if (optp->block_size > 1) + { + num/= (ulonglong) optp->block_size; + num*= (ulonglong) optp->block_size; + } + + if (num < (ulonglong) optp->min_value) + { + num= (ulonglong) optp->min_value; + if (old < (ulonglong) optp->min_value) + adjusted= TRUE; + } + + if (fix) + *fix= adjusted; + else if (adjusted) + my_getopt_error_reporter(WARNING_LEVEL, + "option '%s': unsigned value %s adjusted to %s", + optp->name, ullstr(old, buf1), ullstr(num, buf2)); + return num; +} + + +/* + Get double value withing ranges + + Evaluates and returns the value that user gave as an argument to a variable. + + RETURN + decimal value of arg + + In case of an error, prints an error message and sets *err to + EXIT_ARGUMENT_INVALID. Otherwise err is not touched +*/ + +static double getopt_double(char *arg, const struct my_option *optp, int *err) +{ + double num; + int error; + char *end= arg + 1000; /* Big enough as *arg is \0 terminated */ + num= my_strtod(arg, &end, &error); + if (end[0] != 0 || error) + { + fprintf(stderr, + "%s: ERROR: Invalid decimal value for option '%s'\n", + my_progname, optp->name); + *err= EXIT_ARGUMENT_INVALID; + return 0.0; + } + if (optp->max_value && num > (double) optp->max_value) + num= (double) optp->max_value; + return max(num, (double) optp->min_value); +} + +/* + Init one value to it's default values + + SYNOPSIS + init_one_value() + option Option to initialize + value Pointer to variable +*/ + +static void init_one_value(const struct my_option *option, uchar* *variable, + longlong value) +{ + DBUG_ENTER("init_one_value"); + switch ((option->var_type & GET_TYPE_MASK)) { + case GET_BOOL: + *((my_bool*) variable)= (my_bool) value; + break; + case GET_INT: + *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL); + break; + case GET_ENUM: + *((uint*) variable)= (uint) value; + break; + case GET_UINT: + *((uint*) variable)= (uint) getopt_ull_limit_value((uint) value, option, NULL); + break; + case GET_LONG: + *((long*) variable)= (long) getopt_ll_limit_value((long) value, option, NULL); + break; + case GET_ULONG: + *((ulong*) variable)= (ulong) getopt_ull_limit_value((ulong) value, option, NULL); + break; + case GET_LL: + *((longlong*) variable)= (longlong) getopt_ll_limit_value((longlong) value, option, NULL); + break; + case GET_ULL: /* Fall through */ + case GET_SET: + *((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL); + break; + case GET_DOUBLE: + *((double*) variable)= (double) value; + break; + case GET_STR: + /* + Do not clear variable value if it has no default value. + The default value may already be set. + NOTE: To avoid compiler warnings, we first cast longlong to intptr, + so that the value has the same size as a pointer. + */ + if ((char*) (intptr) value) + *((char**) variable)= (char*) (intptr) value; + break; + case GET_STR_ALLOC: + /* + Do not clear variable value if it has no default value. + The default value may already be set. + NOTE: To avoid compiler warnings, we first cast longlong to intptr, + so that the value has the same size as a pointer. + */ + if ((char*) (intptr) value) + { + my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR)); + *((char**) variable)= my_strdup((char*) (intptr) value, MYF(MY_WME)); + } + break; + default: /* dummy default to avoid compiler warnings */ + break; + } + DBUG_VOID_RETURN; +} + + +/* + Init one value to it's default values + + SYNOPSIS + init_one_value() + option Option to initialize + value Pointer to variable +*/ + +static void fini_one_value(const struct my_option *option, uchar* *variable, + longlong value __attribute__ ((unused))) +{ + DBUG_ENTER("fini_one_value"); + switch ((option->var_type & GET_TYPE_MASK)) { + case GET_STR_ALLOC: + my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR)); + *((char**) variable)= NULL; + break; + default: /* dummy default to avoid compiler warnings */ + break; + } + DBUG_VOID_RETURN; +} + + +void my_cleanup_options(const struct my_option *options) +{ + init_variables(options, fini_one_value); +} + + +/* + initialize all variables to their default values + + SYNOPSIS + init_variables() + options Array of options + + NOTES + We will initialize the value that is pointed to by options->value. + If the value is of type GET_ASK_ADDR, we will also ask for the address + for a value and initialize. +*/ + +static void init_variables(const struct my_option *options, + init_func_p init_one_value) +{ + DBUG_ENTER("init_variables"); + for (; options->name; options++) + { + uchar* *variable; + DBUG_PRINT("options", ("name: '%s'", options->name)); + /* + We must set u_max_value first as for some variables + options->u_max_value == options->value and in this case we want to + set the value to default value. + */ + if (options->u_max_value) + init_one_value(options, options->u_max_value, options->max_value); + if (options->value) + init_one_value(options, options->value, options->def_value); + if (options->var_type & GET_ASK_ADDR && + (variable= (*getopt_get_addr)("", 0, options, 0))) + init_one_value(options, variable, options->def_value); + } + DBUG_VOID_RETURN; +} + + +/* + function: my_print_options + + Print help for all options and variables. +*/ + +void my_print_help(const struct my_option *options) +{ + uint col, name_space= 22, comment_space= 57; + const char *line_end; + const struct my_option *optp; + + for (optp= options; optp->id; optp++) + { + if (optp->id < 256) + { + printf(" -%c%s", optp->id, strlen(optp->name) ? ", " : " "); + col= 6; + } + else + { + printf(" "); + col= 2; + } + if (strlen(optp->name)) + { + printf("--%s", optp->name); + col+= 2 + (uint) strlen(optp->name); + if ((optp->var_type & GET_TYPE_MASK) == GET_STR || + (optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC) + { + printf("%s=name%s ", optp->arg_type == OPT_ARG ? "[" : "", + optp->arg_type == OPT_ARG ? "]" : ""); + col+= (optp->arg_type == OPT_ARG) ? 8 : 6; + } + else if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG || + (optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + putchar(' '); + col++; + } + else + { + printf("%s=#%s ", optp->arg_type == OPT_ARG ? "[" : "", + optp->arg_type == OPT_ARG ? "]" : ""); + col+= (optp->arg_type == OPT_ARG) ? 5 : 3; + } + if (col > name_space && optp->comment && *optp->comment) + { + putchar('\n'); + col= 0; + } + } + for (; col < name_space; col++) + putchar(' '); + if (optp->comment && *optp->comment) + { + const char *comment= optp->comment, *end= strend(comment); + + while ((uint) (end - comment) > comment_space) + { + for (line_end= comment + comment_space; + *line_end != ' ' && line_end > comment; + line_end--); + if (line_end == comment) + { + /* There was no space, try to find one going forward */ + for (line_end= comment + comment_space; + *line_end != ' ' && line_end < end; + line_end++); + } + for (; comment != line_end; comment++) + putchar(*comment); + if (comment < end) + { + comment++; /* skip the space, as a newline will take it's place now */ + putchar('\n'); + for (col= 0; col < name_space; col++) + putchar(' '); + } + } + printf("%s", comment); + } + putchar('\n'); + if ((optp->var_type & GET_TYPE_MASK) == GET_NO_ARG || + (optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + if (optp->def_value != 0) + { + printf("%*s(Defaults to on; use --skip-%s to disable.)\n", name_space, "", optp->name); + } + } + } +} + + +/* + function: my_print_options + + Print variables. +*/ + +void my_print_variables(const struct my_option *options) +{ + uint name_space= 34, length, nr; + ulonglong bit, llvalue; + char buff[255]; + const struct my_option *optp; + + printf("\nVariables (--variable-name=value)\n"); + printf("and boolean options {FALSE|TRUE} Value (after reading options)\n"); + printf("--------------------------------- -----------------------------\n"); + for (optp= options; optp->id; optp++) + { + uchar* *value= (optp->var_type & GET_ASK_ADDR ? + (*getopt_get_addr)("", 0, optp, 0) : optp->value); + if (value) + { + printf("%s ", optp->name); + length= (uint) strlen(optp->name)+1; + for (; length < name_space; length++) + putchar(' '); + switch ((optp->var_type & GET_TYPE_MASK)) { + case GET_SET: + if (!(llvalue= *(ulonglong*) value)) + printf("%s\n", "(No default value)"); + else + for (nr= 0, bit= 1; llvalue && nr < optp->typelib->count; nr++, bit<<=1) + { + if (!(bit & llvalue)) + continue; + llvalue&= ~bit; + printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr)); + } + break; + case GET_ENUM: + printf("%s\n", get_type(optp->typelib, *(uint*) value)); + break; + case GET_STR: + case GET_STR_ALLOC: /* fall through */ + printf("%s\n", *((char**) value) ? *((char**) value) : + "(No default value)"); + break; + case GET_BOOL: + printf("%s\n", *((my_bool*) value) ? "TRUE" : "FALSE"); + break; + case GET_INT: + printf("%d\n", *((int*) value)); + break; + case GET_UINT: + printf("%d\n", *((uint*) value)); + break; + case GET_LONG: + printf("%ld\n", *((long*) value)); + break; + case GET_ULONG: + printf("%lu\n", *((ulong*) value)); + break; + case GET_LL: + printf("%s\n", llstr(*((longlong*) value), buff)); + break; + case GET_ULL: + longlong2str(*((ulonglong*) value), buff, 10); + printf("%s\n", buff); + break; + case GET_DOUBLE: + printf("%g\n", *(double*) value); + break; + default: + printf("(Disabled)\n"); + break; + } + } + } +} diff --git a/externals/mysql/mysys/my_getpagesize.c b/externals/mysql/mysys/my_getpagesize.c new file mode 100644 index 00000000000..b0560cede35 --- /dev/null +++ b/externals/mysql/mysys/my_getpagesize.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +#ifndef HAVE_GETPAGESIZE + +#if defined __WIN__ + +int my_getpagesize(void) +{ + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +} + +#else + +/* Default implementation */ +int my_getpagesize(void) +{ + return (int)8192; +} + +#endif + +#endif + diff --git a/externals/mysql/mysys/my_getsystime.c b/externals/mysql/mysys/my_getsystime.c new file mode 100644 index 00000000000..46e0c5469e4 --- /dev/null +++ b/externals/mysql/mysys/my_getsystime.c @@ -0,0 +1,225 @@ +/* Copyright (C) 2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* get time since epoc in 100 nanosec units */ +/* thus to get the current time we should use the system function + with the highest possible resolution */ + +/* + TODO: in functions my_micro_time() and my_micro_time_and_time() there + exists some common code that should be merged into a function. +*/ + +#include "mysys_priv.h" +#include "my_static.h" + +#ifdef __NETWARE__ +#include +#endif + +ulonglong my_getsystime() +{ +#ifdef HAVE_CLOCK_GETTIME + struct timespec tp; + clock_gettime(CLOCK_REALTIME, &tp); + return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100; +#elif defined(__WIN__) + LARGE_INTEGER t_cnt; + if (query_performance_frequency) + { + QueryPerformanceCounter(&t_cnt); + return ((t_cnt.QuadPart / query_performance_frequency * 10000000) + + ((t_cnt.QuadPart % query_performance_frequency) * 10000000 / + query_performance_frequency) + query_performance_offset); + } + return 0; +#elif defined(__NETWARE__) + NXTime_t tm; + NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm); + return (ulonglong)tm/100; +#else + /* TODO: check for other possibilities for hi-res timestamping */ + struct timeval tv; + gettimeofday(&tv,NULL); + return (ulonglong)tv.tv_sec*10000000+(ulonglong)tv.tv_usec*10; +#endif +} + + +/* + Return current time + + SYNOPSIS + my_time() + flags If MY_WME is set, write error if time call fails + +*/ + +time_t my_time(myf flags __attribute__((unused))) +{ + time_t t; +#ifdef HAVE_GETHRTIME + (void) my_micro_time_and_time(&t); + return t; +#else + /* The following loop is here beacuse time() may fail on some systems */ + while ((t= time(0)) == (time_t) -1) + { + if (flags & MY_WME) + fprintf(stderr, "%s: Warning: time() call failed\n", my_progname); + } + return t; +#endif +} + + +/* + Return time in micro seconds + + SYNOPSIS + my_micro_time() + + NOTES + This function is to be used to measure performance in micro seconds. + As it's not defined whats the start time for the clock, this function + us only useful to measure time between two moments. + + For windows platforms we need the frequency value of the CUP. This is + initalized in my_init.c through QueryPerformanceFrequency(). + + If Windows platform doesn't support QueryPerformanceFrequency() we will + obtain the time via GetClockCount, which only supports milliseconds. + + RETURN + Value in microseconds from some undefined point in time +*/ + +ulonglong my_micro_time() +{ +#if defined(__WIN__) + ulonglong newtime; + GetSystemTimeAsFileTime((FILETIME*)&newtime); + return (newtime/10); +#elif defined(HAVE_GETHRTIME) + return gethrtime()/1000; +#else + ulonglong newtime; + struct timeval t; + /* + The following loop is here because gettimeofday may fail on some systems + */ + while (gettimeofday(&t, NULL) != 0) + {} + newtime= (ulonglong)t.tv_sec * 1000000 + t.tv_usec; + return newtime; +#endif /* defined(__WIN__) */ +} + + +/* + Return time in seconds and timer in microseconds (not different start!) + + SYNOPSIS + my_micro_time_and_time() + time_arg Will be set to seconds since epoch (00:00:00 UTC, + January 1, 1970) + + NOTES + This function is to be useful when we need both the time and microtime. + For example in MySQL this is used to get the query time start of a query + and to measure the time of a query (for the slow query log) + + IMPLEMENTATION + Value of time is as in time() call. + Value of microtime is same as my_micro_time(), which may be totally + unrealated to time() + + RETURN + Value in microseconds from some undefined point in time +*/ + +#define DELTA_FOR_SECONDS 500000000LL /* Half a second */ + +ulonglong my_micro_time_and_time(time_t *time_arg) +{ +#if defined(__WIN__) + ulonglong newtime; + GetSystemTimeAsFileTime((FILETIME*)&newtime); + *time_arg= (time_t) ((newtime - OFFSET_TO_EPOCH) / 10000000); + return (newtime/10); +#elif defined(HAVE_GETHRTIME) + /* + Solaris has a very slow time() call. We optimize this by using the very + fast gethrtime() call and only calling time() every 1/2 second + */ + static hrtime_t prev_gethrtime= 0; + static time_t cur_time= 0; + hrtime_t cur_gethrtime; + + pthread_mutex_lock(&THR_LOCK_time); + cur_gethrtime= gethrtime(); + if ((cur_gethrtime - prev_gethrtime) > DELTA_FOR_SECONDS) + { + cur_time= time(0); + prev_gethrtime= cur_gethrtime; + } + *time_arg= cur_time; + pthread_mutex_unlock(&THR_LOCK_time); + return cur_gethrtime/1000; +#else + ulonglong newtime; + struct timeval t; + /* + The following loop is here because gettimeofday may fail on some systems + */ + while (gettimeofday(&t, NULL) != 0) + {} + *time_arg= t.tv_sec; + newtime= (ulonglong)t.tv_sec * 1000000 + t.tv_usec; + return newtime; +#endif /* defined(__WIN__) */ +} + + +/* + Returns current time + + SYNOPSIS + my_time_possible_from_micro() + microtime Value from very recent my_micro_time() + + NOTES + This function returns the current time. The microtime argument is only used + if my_micro_time() uses a function that can safely be converted to the + current time. + + RETURN + current time +*/ + +time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused))) +{ +#if defined(__WIN__) + time_t t; + while ((t= time(0)) == (time_t) -1) + {} + return t; +#elif defined(HAVE_GETHRTIME) + return my_time(0); /* Cached time */ +#else + return (time_t) (microtime / 1000000); +#endif /* defined(__WIN__) */ +} + diff --git a/externals/mysql/mysys/my_getwd.c b/externals/mysql/mysys/my_getwd.c new file mode 100644 index 00000000000..0b467351f4b --- /dev/null +++ b/externals/mysql/mysys/my_getwd.c @@ -0,0 +1,185 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* my_setwd() and my_getwd() works with intern_filenames !! */ + +#include "mysys_priv.h" +#include +#include "mysys_err.h" +#ifdef HAVE_GETWD +#include +#endif +#if defined(__WIN__) +#include +#include +#include +#endif + +/* Gets current working directory in buff. + + SYNPOSIS + my_getwd() + buf Buffer to store result. Can be curr_dir[]. + size Size of buffer + MyFlags Flags + + NOTES + Directory is allways ended with FN_LIBCHAR + + RESULT + 0 ok + # error +*/ + +int my_getwd(char * buf, size_t size, myf MyFlags) +{ + char * pos; + DBUG_ENTER("my_getwd"); + DBUG_PRINT("my",("buf: %p size: %u MyFlags %d", + buf, (uint) size, MyFlags)); + + if (curr_dir[0]) /* Current pos is saved here */ + (void) strmake(buf,&curr_dir[0],size-1); + else + { +#if defined(HAVE_GETCWD) + if (!getcwd(buf,size-2) && MyFlags & MY_WME) + { + my_errno=errno; + my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); + return(-1); + } +#elif defined(HAVE_GETWD) + { + char pathname[MAXPATHLEN]; + getwd(pathname); + strmake(buf,pathname,size-1); + } +#elif defined(VMS) + if (!getcwd(buf,size-2,1) && MyFlags & MY_WME) + { + my_errno=errno; + my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); + return(-1); + } + intern_filename(buf,buf); +#else +#error "No way to get current directory" +#endif + if (*((pos=strend(buf))-1) != FN_LIBCHAR) /* End with FN_LIBCHAR */ + { + pos[0]= FN_LIBCHAR; + pos[1]=0; + } + (void) strmake(&curr_dir[0],buf, (size_t) (FN_REFLEN-1)); + } + DBUG_RETURN(0); +} /* my_getwd */ + + +/* Set new working directory */ + +int my_setwd(const char *dir, myf MyFlags) +{ + int res; + size_t length; + char *start, *pos; +#if defined(VMS) + char buff[FN_REFLEN]; +#endif + DBUG_ENTER("my_setwd"); + DBUG_PRINT("my",("dir: '%s' MyFlags %d", dir, MyFlags)); + + start=(char *) dir; + if (! dir[0] || (dir[0] == FN_LIBCHAR && dir[1] == 0)) + dir=FN_ROOTDIR; +#ifdef VMS + { + pos=strmov(buff,dir); + if (pos[-1] != FN_LIBCHAR) + { + pos[0]=FN_LIBCHAR; /* Mark as directory */ + pos[1]=0; + } + system_filename(buff,buff); /* Change to VMS format */ + dir=buff; + } +#endif /* VMS */ + if ((res=chdir((char*) dir)) != 0) + { + my_errno=errno; + if (MyFlags & MY_WME) + my_error(EE_SETWD,MYF(ME_BELL+ME_WAITTANG),start,errno); + } + else + { + if (test_if_hard_path(start)) + { /* Hard pathname */ + pos= strmake(&curr_dir[0],start,(size_t) FN_REFLEN-1); + if (pos[-1] != FN_LIBCHAR) + { + length=(uint) (pos-(char*) curr_dir); + curr_dir[length]=FN_LIBCHAR; /* must end with '/' */ + curr_dir[length+1]='\0'; + } + } + else + curr_dir[0]='\0'; /* Don't save name */ + } + DBUG_RETURN(res); +} /* my_setwd */ + + + + /* Test if hard pathname */ + /* Returns 1 if dirname is a hard path */ + +int test_if_hard_path(register const char *dir_name) +{ + if (dir_name[0] == FN_HOMELIB && dir_name[1] == FN_LIBCHAR) + return (home_dir != NullS && test_if_hard_path(home_dir)); + if (dir_name[0] == FN_LIBCHAR) + return (TRUE); +#ifdef FN_DEVCHAR + return (strchr(dir_name,FN_DEVCHAR) != 0); +#else + return FALSE; +#endif +} /* test_if_hard_path */ + + +/* + Test if a name contains an (absolute or relative) path. + + SYNOPSIS + has_path() + name The name to test. + + RETURN + TRUE name contains a path. + FALSE name does not contain a path. +*/ + +my_bool has_path(const char *name) +{ + return test(strchr(name, FN_LIBCHAR)) +#if FN_LIBCHAR != '/' + || test(strchr(name,'/')) +#endif +#ifdef FN_DEVCHAR + || test(strchr(name, FN_DEVCHAR)) +#endif + ; +} diff --git a/externals/mysql/mysys/my_handler_errors.h b/externals/mysql/mysys/my_handler_errors.h new file mode 100644 index 00000000000..47cce9dcd2d --- /dev/null +++ b/externals/mysql/mysys/my_handler_errors.h @@ -0,0 +1,137 @@ + +/* + Errors a handler can give you +*/ + +static const char *handler_error_messages[]= +{ + /* HA_ERR_KEY_NOT_FOUND */ + "Didn't find key on read or update", + /* HA_ERR_FOUND_DUPP_KEY */ + "Duplicate key on write or update", + /* HA_ERR_INTERNAL_ERROR */ + "Internal (unspecified) error in handler", + /* HA_ERR_RECORD_CHANGED */ + "Someone has changed the row since it was read (while the table was locked to prevent it)", + /* HA_ERR_WRONG_INDEX */ + "Wrong index given to function", + /* empty */ + "Undefined handler error 125", + /* HA_ERR_CRASHED */ + "Index file is crashed", + /* HA_ERR_WRONG_IN_RECORD */ + "Record file is crashed", + /* HA_ERR_OUT_OF_MEM */ + "Out of memory in engine", + /* empty */ + "Undefined handler error 129", + /* HA_ERR_NOT_A_TABLE */ + "Incorrect file format", + /* HA_ERR_WRONG_COMMAND */ + "Command not supported by database", + /* HA_ERR_OLD_FILE */ + "Old database file", + /* HA_ERR_NO_ACTIVE_RECORD */ + "No record read before update", + /* HA_ERR_RECORD_DELETED */ + "Record was already deleted (or record file crashed)", + /* HA_ERR_RECORD_FILE_FULL */ + "No more room in record file", + /* HA_ERR_INDEX_FILE_FULL */ + "No more room in index file", + /* HA_ERR_END_OF_FILE */ + "No more records (read after end of file)", + /* HA_ERR_UNSUPPORTED */ + "Unsupported extension used for table", + /* HA_ERR_TO_BIG_ROW */ + "Too big row", + /* HA_WRONG_CREATE_OPTION */ + "Wrong create options", + /* HA_ERR_FOUND_DUPP_UNIQUE */ + "Duplicate unique key or constraint on write or update", + /* HA_ERR_UNKNOWN_CHARSET */ + "Unknown character set used in table", + /* HA_ERR_WRONG_MRG_TABLE_DEF */ + "Conflicting table definitions in sub-tables of MERGE table", + /* HA_ERR_CRASHED_ON_REPAIR */ + "Table is crashed and last repair failed", + /* HA_ERR_CRASHED_ON_USAGE */ + "Table was marked as crashed and should be repaired", + /* HA_ERR_LOCK_WAIT_TIMEOUT */ + "Lock timed out; Retry transaction", + /* HA_ERR_LOCK_TABLE_FULL */ + "Lock table is full; Restart program with a larger lock table", + /* HA_ERR_READ_ONLY_TRANSACTION */ + "Updates are not allowed under a read only transactions", + /* HA_ERR_LOCK_DEADLOCK */ + "Lock deadlock; Retry transaction", + /* HA_ERR_CANNOT_ADD_FOREIGN */ + "Foreign key constraint is incorrectly formed", + /* HA_ERR_NO_REFERENCED_ROW */ + "Cannot add a child row", + /* HA_ERR_ROW_IS_REFERENCED */ + "Cannot delete a parent row", + /* HA_ERR_NO_SAVEPOINT */ + "No savepoint with that name", + /* HA_ERR_NON_UNIQUE_BLOCK_SIZE */ + "Non unique key block size", + /* HA_ERR_NO_SUCH_TABLE */ + "The table does not exist in engine", + /* HA_ERR_TABLE_EXIST */ + "The table already existed in storage engine", + /* HA_ERR_NO_CONNECTION */ + "Could not connect to storage engine", + /* HA_ERR_NULL_IN_SPATIAL */ + "Unexpected null pointer found when using spatial index", + /* HA_ERR_TABLE_DEF_CHANGED */ + "The table changed in storage engine", + /* HA_ERR_NO_PARTITION_FOUND */ + "There's no partition in table for the given value", + /* HA_ERR_RBR_LOGGING_FAILED */ + "Row-based binary logging of row failed", + /* HA_ERR_DROP_INDEX_FK */ + "Index needed in foreign key constraint", + /* HA_ERR_FOREIGN_DUPLICATE_KEY */ + "Upholding foreign key constraints would lead to a duplicate key error in " + "some other table", + /* HA_ERR_TABLE_NEEDS_UPGRADE */ + "Table needs to be upgraded before it can be used", + /* HA_ERR_TABLE_READONLY */ + "Table is read only", + /* HA_ERR_AUTOINC_READ_FAILED */ + "Failed to get next auto increment value", + /* HA_ERR_AUTOINC_ERANGE */ + "Failed to set row auto increment value", + /* HA_ERR_GENERIC */ + "Unknown (generic) error from engine", + /* HA_ERR_RECORD_IS_THE_SAME */ + "Record was not update. Original values was same as new values", + /* HA_ERR_LOGGING_IMPOSSIBLE */ + "It is not possible to log this statement", + /* HA_ERR_TABLESPACE_EXIST */ + "Tablespace exists", + /* HA_ERR_CORRUPT_EVENT */ + "The event was corrupt, leading to illegal data being read", + /* HA_ERR_NEW_FILE */ + "The table is of a new format not supported by this version", + /* HA_ERR_ROWS_EVENT_APPLY */ + "The event could not be processed. No other handler error happened", + /* HA_ERR_INITIALIZATION */ + "Got a fatal error during initialization of handler", + /* HA_ERR_FILE_TOO_SHORT */ + "File too short; Expected more data in file", + + /* HA_ERR_WRONG_CRC */ + "Read page with wrong checksum", + /* HA_ERR_LOCK_OR_ACTIVE_TRANSACTION */ + "Lock or active transaction", /* TODO: get a better message */ + /* HA_ERR_NO_SUCH_TABLESPACE */ + "No such table space", /* TODO: get a better message */ + /* HA_ERR_TABLESPACE_NOT_EMPTY */ + "Tablespace not empty", /* TODO: get a better message */ + /* HA_ERR_TABLESPACE_DATAFILE_EXIST */ + "Tablespace data file already exists", /* TODO: get a better message */ + /* HA_ERR_ROW_NOT_VISIBLE */ + "Row is not visible by the current transaction" +}; + diff --git a/externals/mysql/mysys/my_init.c b/externals/mysql/mysys/my_init.c new file mode 100644 index 00000000000..45545fb75d7 --- /dev/null +++ b/externals/mysql/mysys/my_init.c @@ -0,0 +1,558 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "my_static.h" +#include "mysys_err.h" +#include +#include +#include +#ifdef VMS +#include +#include +#endif +#ifdef __WIN__ +#ifdef _MSC_VER +#include +#include +/* WSAStartup needs winsock library*/ +#pragma comment(lib, "ws2_32") +#endif +my_bool have_tcpip=0; +static void my_win_init(void); +static my_bool win32_init_tcp_ip(); +#else +#define my_win_init() +#endif +#ifdef __NETWARE__ +static void netware_init(); +#else +#define netware_init() +#endif + +my_bool my_init_done= 0; +uint mysys_usage_id= 0; /* Incremented for each my_init() */ +ulong my_thread_stack_size= 65536; + +static ulong atoi_octal(const char *str) +{ + long int tmp; + while (*str && my_isspace(&my_charset_latin1, *str)) + str++; + str2int(str, + (*str == '0' ? 8 : 10), /* Octalt or decimalt */ + 0, INT_MAX, &tmp); + return (ulong) tmp; +} + + +/* + Init my_sys functions and my_sys variabels + + SYNOPSIS + my_init() + + RETURN + 0 ok + 1 Couldn't initialize environment +*/ + +my_bool my_init(void) +{ + char * str; + if (my_init_done) + return 0; + my_init_done=1; + mysys_usage_id++; + my_umask= 0660; /* Default umask for new files */ + my_umask_dir= 0700; /* Default umask for new directories */ + init_glob_errs(); + my_progname_short= "unknown"; + if (my_progname) + my_progname_short= my_progname + dirname_length(my_progname); + +#if defined(THREAD) + (void) my_threadattr_global_init(); +# if defined(SAFE_MUTEX) + safe_mutex_global_init(); /* Must be called early */ +# elif defined(MY_PTHREAD_FASTMUTEX) + fastmutex_global_init(); /* Must be called early */ +# endif +#endif + netware_init(); +#ifdef THREAD +#if defined(HAVE_PTHREAD_INIT) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif + if (my_thread_global_init()) + return 1; +#if !defined( __WIN__) && !defined(__NETWARE__) + sigfillset(&my_signals); /* signals blocked by mf_brkhant */ +#endif +#endif /* THREAD */ + { + DBUG_ENTER("my_init"); + DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown")); + if (!home_dir) + { /* Don't initialize twice */ + my_win_init(); + if ((home_dir=getenv("HOME")) != 0) + home_dir=intern_filename(home_dir_buff,home_dir); +#ifndef VMS + /* Default creation of new files */ + if ((str=getenv("UMASK")) != 0) + my_umask=(int) (atoi_octal(str) | 0600); + /* Default creation of new dir's */ + if ((str=getenv("UMASK_DIR")) != 0) + my_umask_dir=(int) (atoi_octal(str) | 0700); +#endif +#ifdef VMS + init_ctype(); /* Stupid linker don't link _ctype.c */ +#endif + DBUG_PRINT("exit",("home: '%s'",home_dir)); + } +#ifdef __WIN__ + win32_init_tcp_ip(); +#endif + DBUG_RETURN(0); + } +} /* my_init */ + + + /* End my_sys */ + +void my_end(int infoflag) +{ + /* + this code is suboptimal to workaround a bug in + Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be + optimized until this compiler is not in use anymore + */ + FILE *info_file= DBUG_FILE; + my_bool print_info= (info_file != stderr); + + if (!my_init_done) + return; + + /* + We do not use DBUG_ENTER here, as after cleanup DBUG is no longer + operational, so we cannot use DBUG_RETURN. + */ + DBUG_PRINT("info",("Shutting down: infoflag: %d print_info: %d", + infoflag, print_info)); + if (!info_file) + { + info_file= stderr; + print_info= 0; + } + + if ((infoflag & MY_CHECK_ERROR) || print_info) + + { /* Test if some file is left open */ + if (my_file_opened | my_stream_opened) + { + char ebuff[MYSYS_ERRMSG_SIZE]; + my_snprintf(ebuff, sizeof(ebuff), EE(EE_OPEN_WARNING), + my_file_opened, my_stream_opened); + my_message_no_curses(EE_OPEN_WARNING, ebuff, ME_BELL); + DBUG_PRINT("error", ("%s", ebuff)); + my_print_open_files(); + } + } + free_charsets(); + my_error_unregister_all(); + my_once_free(); +#ifdef THREAD + my_thread_destroy_mutex(); +#endif + + if ((infoflag & MY_GIVE_INFO) || print_info) + { +#ifdef HAVE_GETRUSAGE + struct rusage rus; +#ifdef HAVE_purify + /* Purify assumes that rus is uninitialized after getrusage call */ + bzero((char*) &rus, sizeof(rus)); +#endif + if (!getrusage(RUSAGE_SELF, &rus)) + fprintf(info_file,"\n\ +User time %.2f, System time %.2f\n\ +Maximum resident set size %ld, Integral resident set size %ld\n\ +Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\ +Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\ +Voluntary context switches %ld, Involuntary context switches %ld\n", + (rus.ru_utime.tv_sec * SCALE_SEC + + rus.ru_utime.tv_usec / SCALE_USEC) / 100.0, + (rus.ru_stime.tv_sec * SCALE_SEC + + rus.ru_stime.tv_usec / SCALE_USEC) / 100.0, + rus.ru_maxrss, rus.ru_idrss, + rus.ru_minflt, rus.ru_majflt, + rus.ru_nswap, rus.ru_inblock, rus.ru_oublock, + rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals, + rus.ru_nvcsw, rus.ru_nivcsw); +#endif +#if defined(__NETWARE__) && !defined(__WIN__) + fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC); +#endif +#if defined(SAFEMALLOC) + /* Wait for other threads to free mysys_var */ +#ifdef THREAD + (void) my_wait_for_other_threads_to_die(1); +#endif + TERMINATE(stderr, (infoflag & MY_GIVE_INFO) != 0); +#elif defined(__WIN__) && defined(_MSC_VER) + _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); + _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR ); + _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR ); + _CrtCheckMemory(); + _CrtDumpMemoryLeaks(); +#endif + } + else if (infoflag & MY_CHECK_ERROR) + { + TERMINATE(stderr, 0); /* Print memory leaks on screen */ + } + + if (!(infoflag & MY_DONT_FREE_DBUG)) + { + DBUG_END(); /* Must be done before my_thread_end */ + } +#ifdef THREAD + my_thread_end(); + my_thread_global_end(); +#if defined(SAFE_MUTEX) + /* + Check on destroying of mutexes. A few may be left that will get cleaned + up by C++ destructors + */ + safe_mutex_end((infoflag & (MY_GIVE_INFO | MY_CHECK_ERROR)) ? stderr : + (FILE *) 0); +#endif /* defined(SAFE_MUTEX) */ +#endif /* THREAD */ + +#ifdef __WIN__ + if (have_tcpip) + WSACleanup(); +#endif /* __WIN__ */ + my_init_done=0; +} /* my_end */ + +#ifndef DBUG_OFF +/* Dummy tag function for debugging */ + +void my_debug_put_break_here(void) +{ +} +#endif + +#ifdef __WIN__ + + +/* + my_parameter_handler + + Invalid parameter handler we will use instead of the one "baked" + into the CRT for MSC v8. This one just prints out what invalid + parameter was encountered. By providing this routine, routines like + lseek will return -1 when we expect them to instead of crash. +*/ + +void my_parameter_handler(const wchar_t * expression, const wchar_t * function, + const wchar_t * file, unsigned int line, + uintptr_t pReserved) +{ + DBUG_PRINT("my",("Expression: %s function: %s file: %s, line: %d", + expression, function, file, line)); +} + + +#ifdef __MSVC_RUNTIME_CHECKS +#include + +/* Turn off runtime checks for 'handle_rtc_failure' */ +#pragma runtime_checks("", off) + +/* + handle_rtc_failure + Catch the RTC error and dump it to stderr +*/ + +int handle_rtc_failure(int err_type, const char *file, int line, + const char* module, const char *format, ...) +{ + va_list args; + va_start(args, format); + fprintf(stderr, "Error:"); + vfprintf(stderr, format, args); + fprintf(stderr, " At %s:%d\n", file, line); + va_end(args); + (void) fflush(stderr); + + return 0; /* Error is handled */ +} +#pragma runtime_checks("", restore) +#endif + + +static void my_win_init(void) +{ + DBUG_ENTER("my_win_init"); + +#if defined(_MSC_VER) +#if _MSC_VER < 1300 + /* + Clear the OS system variable TZ and avoid the 100% CPU usage + Only for old versions of Visual C++ + */ + _putenv( "TZ=" ); +#endif +#if _MSC_VER >= 1400 + /* this is required to make crt functions return -1 appropriately */ + _set_invalid_parameter_handler(my_parameter_handler); +#endif +#endif +#ifdef __MSVC_RUNTIME_CHECKS + /* + Install handler to send RTC (Runtime Error Check) warnings + to log file + */ + _RTC_SetErrorFunc(handle_rtc_failure); +#endif + + _tzset(); + + + + + + + + + + + + + + + + + + + + + + + + + + /* The following is used by time functions */ +#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10) +#define MS 10000000 + { + FILETIME ft; + LARGE_INTEGER li, t_cnt; + DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency)); + if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency) == 0) + query_performance_frequency= 0; + else + { + GetSystemTimeAsFileTime(&ft); + li.LowPart= ft.dwLowDateTime; + li.HighPart= ft.dwHighDateTime; + query_performance_offset= li.QuadPart-OFFSET_TO_EPOC; + QueryPerformanceCounter(&t_cnt); + query_performance_offset-= (t_cnt.QuadPart / + query_performance_frequency * MS + + t_cnt.QuadPart % + query_performance_frequency * MS / + query_performance_frequency); + } + } + + { + /* + Open HKEY_LOCAL_MACHINE\SOFTWARE\MySQL and set any strings found + there as environment variables + */ + HKEY key_handle; + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCTSTR)"SOFTWARE\\MySQL", + 0, KEY_READ, &key_handle) == ERROR_SUCCESS) + { + LONG ret; + DWORD index= 0; + DWORD type; + char key_name[256], key_data[1024]; + DWORD key_name_len= sizeof(key_name) - 1; + DWORD key_data_len= sizeof(key_data) - 1; + + while ((ret= RegEnumValue(key_handle, index++, + key_name, &key_name_len, + NULL, &type, (LPBYTE)&key_data, + &key_data_len)) != ERROR_NO_MORE_ITEMS) + { + char env_string[sizeof(key_name) + sizeof(key_data) + 2]; + + if (ret == ERROR_MORE_DATA) + { + /* Registry value larger than 'key_data', skip it */ + DBUG_PRINT("error", ("Skipped registry value that was too large")); + } + else if (ret == ERROR_SUCCESS) + { + if (type == REG_SZ) + { + strxmov(env_string, key_name, "=", key_data, NullS); + + /* variable for putenv must be allocated ! */ + putenv(strdup(env_string)) ; + } + } + else + { + /* Unhandled error, break out of loop */ + break; + } + + key_name_len= sizeof(key_name) - 1; + key_data_len= sizeof(key_data) - 1; + } + + RegCloseKey(key_handle) ; + } + } + DBUG_VOID_RETURN ; +} + + +/*------------------------------------------------------------------ + Name: CheckForTcpip| Desc: checks if tcpip has been installed on system + According to Microsoft Developers documentation the first registry + entry should be enough to check if TCP/IP is installed, but as expected + this doesn't work on all Win32 machines :( +------------------------------------------------------------------*/ + +#define TCPIPKEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" +#define WINSOCK2KEY "SYSTEM\\CurrentControlSet\\Services\\Winsock2\\Parameters" +#define WINSOCKKEY "SYSTEM\\CurrentControlSet\\Services\\Winsock\\Parameters" + +static my_bool win32_have_tcpip(void) +{ + HKEY hTcpipRegKey; + if (RegOpenKeyEx ( HKEY_LOCAL_MACHINE, TCPIPKEY, 0, KEY_READ, + &hTcpipRegKey) != ERROR_SUCCESS) + { + if (RegOpenKeyEx ( HKEY_LOCAL_MACHINE, WINSOCK2KEY, 0, KEY_READ, + &hTcpipRegKey) != ERROR_SUCCESS) + { + if (RegOpenKeyEx ( HKEY_LOCAL_MACHINE, WINSOCKKEY, 0, KEY_READ, + &hTcpipRegKey) != ERROR_SUCCESS) + if (!getenv("HAVE_TCPIP") || have_tcpip) /* Provide a workaround */ + return (FALSE); + } + } + RegCloseKey ( hTcpipRegKey); + return (TRUE); +} + + +static my_bool win32_init_tcp_ip() +{ + if (win32_have_tcpip()) + { + WORD wVersionRequested = MAKEWORD( 2, 0 ); + WSADATA wsaData; + /* Be a good citizen: maybe another lib has already initialised + sockets, so dont clobber them unless necessary */ + if (WSAStartup( wVersionRequested, &wsaData )) + { + /* Load failed, maybe because of previously loaded + incompatible version; try again */ + WSACleanup( ); + if (!WSAStartup( wVersionRequested, &wsaData )) + have_tcpip=1; + } + else + { + if (wsaData.wVersion != wVersionRequested) + { + /* Version is no good, try again */ + WSACleanup( ); + if (!WSAStartup( wVersionRequested, &wsaData )) + have_tcpip=1; + } + else + have_tcpip=1; + } + } + return(0); +} +#endif /* __WIN__ */ + + +#ifdef __NETWARE__ +/* + Basic initialisation for netware +*/ + +static void netware_init() +{ + char cwd[PATH_MAX], *name; + + DBUG_ENTER("netware_init"); + + /* init only if we are not a client library */ + if (my_progname) + { +#if SUPPORTED_BY_LIBC /* Removed until supported in Libc */ + struct termios tp; + /* Disable control characters */ + tcgetattr(STDIN_FILENO, &tp); + tp.c_cc[VINTR] = _POSIX_VDISABLE; + tp.c_cc[VEOF] = _POSIX_VDISABLE; + tp.c_cc[VSUSP] = _POSIX_VDISABLE; + tcsetattr(STDIN_FILENO, TCSANOW, &tp); +#endif /* SUPPORTED_BY_LIBC */ + + /* With stdout redirection */ + if (!isatty(STDOUT_FILENO)) + { + setscreenmode(SCR_AUTOCLOSE_ON_EXIT); /* auto close the screen */ + } + else + { + setscreenmode(SCR_NO_MODE); /* keep the screen up */ + } + + /* Parse program name and change to base format */ + name= (char*) my_progname; + for (; *name; name++) + { + if (*name == '\\') + { + *name = '/'; + } + else + { + *name = tolower(*name); + } + } + } + + DBUG_VOID_RETURN; +} +#endif /* __NETWARE__ */ diff --git a/externals/mysql/mysys/my_largepage.c b/externals/mysql/mysys/my_largepage.c new file mode 100644 index 00000000000..9fa5b73bf88 --- /dev/null +++ b/externals/mysql/mysys/my_largepage.c @@ -0,0 +1,166 @@ +/* Copyright (C) 2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +#ifdef HAVE_LARGE_PAGES + +#ifdef HAVE_SYS_IPC_H +#include +#endif + +#ifdef HAVE_SYS_SHM_H +#include +#endif + +static uint my_get_large_page_size_int(void); +static uchar* my_large_malloc_int(size_t size, myf my_flags); +static my_bool my_large_free_int(uchar* ptr, myf my_flags); + +/* Gets the size of large pages from the OS */ + +uint my_get_large_page_size(void) +{ + uint size; + DBUG_ENTER("my_get_large_page_size"); + + if (!(size = my_get_large_page_size_int())) + fprintf(stderr, "Warning: Failed to determine large page size\n"); + + DBUG_RETURN(size); +} + +/* + General large pages allocator. + Tries to allocate memory from large pages pool and falls back to + my_malloc_lock() in case of failure +*/ + +uchar* my_large_malloc(size_t size, myf my_flags) +{ + uchar* ptr; + DBUG_ENTER("my_large_malloc"); + + if (my_use_large_pages && my_large_page_size) + { + if ((ptr = my_large_malloc_int(size, my_flags)) != NULL) + DBUG_RETURN(ptr); + if (my_flags & MY_WME) + fprintf(stderr, "Warning: Using conventional memory pool\n"); + } + + DBUG_RETURN(my_malloc_lock(size, my_flags)); +} + +/* + General large pages deallocator. + Tries to deallocate memory as if it was from large pages pool and falls back + to my_free_lock() in case of failure + */ + +void my_large_free(uchar* ptr, myf my_flags __attribute__((unused))) +{ + DBUG_ENTER("my_large_free"); + + /* + my_large_free_int() can only fail if ptr was not allocated with + my_large_malloc_int(), i.e. my_malloc_lock() was used so we should free it + with my_free_lock() + */ + if (!my_use_large_pages || !my_large_page_size || + !my_large_free_int(ptr, my_flags)) + my_free_lock(ptr, my_flags); + + DBUG_VOID_RETURN; +} + +#ifdef HUGETLB_USE_PROC_MEMINFO +/* Linux-specific function to determine the size of large pages */ + +uint my_get_large_page_size_int(void) +{ + FILE *f; + uint size = 0; + char buf[256]; + DBUG_ENTER("my_get_large_page_size_int"); + + if (!(f = my_fopen("/proc/meminfo", O_RDONLY, MYF(MY_WME)))) + goto finish; + + while (fgets(buf, sizeof(buf), f)) + if (sscanf(buf, "Hugepagesize: %u kB", &size)) + break; + + my_fclose(f, MYF(MY_WME)); + +finish: + DBUG_RETURN(size * 1024); +} +#endif /* HUGETLB_USE_PROC_MEMINFO */ + +#if HAVE_DECL_SHM_HUGETLB +/* Linux-specific large pages allocator */ + +uchar* my_large_malloc_int(size_t size, myf my_flags) +{ + int shmid; + uchar* ptr; + struct shmid_ds buf; + DBUG_ENTER("my_large_malloc_int"); + + /* Align block size to my_large_page_size */ + size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size; + + shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W); + if (shmid < 0) + { + if (my_flags & MY_WME) + fprintf(stderr, + "Warning: Failed to allocate %lu bytes from HugeTLB memory." + " errno %d\n", (ulong) size, errno); + + DBUG_RETURN(NULL); + } + + ptr = (uchar*) shmat(shmid, NULL, 0); + if (ptr == (uchar *) -1) + { + if (my_flags& MY_WME) + fprintf(stderr, "Warning: Failed to attach shared memory segment," + " errno %d\n", errno); + shmctl(shmid, IPC_RMID, &buf); + + DBUG_RETURN(NULL); + } + + /* + Remove the shared memory segment so that it will be automatically freed + after memory is detached or process exits + */ + shmctl(shmid, IPC_RMID, &buf); + + DBUG_RETURN(ptr); +} + +/* Linux-specific large pages deallocator */ + +my_bool my_large_free_int(uchar *ptr, myf my_flags __attribute__((unused))) +{ + DBUG_ENTER("my_large_free_int"); + DBUG_RETURN(shmdt(ptr) == 0); +} +#endif /* HAVE_DECL_SHM_HUGETLB */ + +#endif /* HAVE_LARGE_PAGES */ diff --git a/externals/mysql/mysys/my_lib.c b/externals/mysql/mysys/my_lib.c new file mode 100644 index 00000000000..30d0f89b14d --- /dev/null +++ b/externals/mysql/mysys/my_lib.c @@ -0,0 +1,559 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* TODO: check for overun of memory for names. */ +/* Convert MSDOS-TIME to standar time_t (still needed?) */ + +#include "mysys_priv.h" +#include +#include /* Structs used by my_dir,includes sys/types */ +#include "mysys_err.h" +#if defined(HAVE_DIRENT_H) +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if defined(HAVE_SYS_NDIR_H) +# include +# endif +# if defined(HAVE_SYS_DIR_H) +# include +# endif +# if defined(HAVE_NDIR_H) +# include +# endif +# if defined(_WIN32) +# ifdef __BORLANDC__ +# include +# endif +# endif +#endif +#ifdef VMS +#include +#include +#include +#endif + +#if defined(THREAD) && defined(HAVE_READDIR_R) +#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C) +#else +#define READDIR(A,B,C) (!(C=readdir(A))) +#endif + +/* + We are assuming that directory we are reading is either has less than + 100 files and so can be read in one initial chunk or has more than 1000 + files and so big increment are suitable. +*/ +#define ENTRIES_START_SIZE (8192/sizeof(FILEINFO)) +#define ENTRIES_INCREMENT (65536/sizeof(FILEINFO)) +#define NAMES_START_SIZE 32768 + + +static int comp_names(struct fileinfo *a,struct fileinfo *b); + + + /* We need this because program don't know with malloc we used */ + +void my_dirend(MY_DIR *buffer) +{ + DBUG_ENTER("my_dirend"); + if (buffer) + { + delete_dynamic((DYNAMIC_ARRAY*)((char*)buffer + + ALIGN_SIZE(sizeof(MY_DIR)))); + free_root((MEM_ROOT*)((char*)buffer + ALIGN_SIZE(sizeof(MY_DIR)) + + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))), MYF(0)); + my_free((uchar*) buffer,MYF(0)); + } + DBUG_VOID_RETURN; +} /* my_dirend */ + + + /* Compare in sort of filenames */ + +static int comp_names(struct fileinfo *a, struct fileinfo *b) +{ + return (strcmp(a->name,b->name)); +} /* comp_names */ + + +#if !defined(_WIN32) + +MY_DIR *my_dir(const char *path, myf MyFlags) +{ + char *buffer; + MY_DIR *result= 0; + FILEINFO finfo; + DYNAMIC_ARRAY *dir_entries_storage; + MEM_ROOT *names_storage; + DIR *dirp; + struct dirent *dp; + char tmp_path[FN_REFLEN+1],*tmp_file; +#ifdef THREAD + char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; +#endif + DBUG_ENTER("my_dir"); + DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags)); + +#if defined(THREAD) && !defined(HAVE_READDIR_R) + pthread_mutex_lock(&THR_LOCK_open); +#endif + + dirp = opendir(directory_file_name(tmp_path,(char *) path)); +#if defined(__amiga__) + if ((dirp->dd_fd) < 0) /* Directory doesn't exists */ + goto error; +#endif + if (dirp == NULL || + ! (buffer= my_malloc(ALIGN_SIZE(sizeof(MY_DIR)) + + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)) + + sizeof(MEM_ROOT), MyFlags))) + goto error; + + dir_entries_storage= (DYNAMIC_ARRAY*)(buffer + ALIGN_SIZE(sizeof(MY_DIR))); + names_storage= (MEM_ROOT*)(buffer + ALIGN_SIZE(sizeof(MY_DIR)) + + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))); + + if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), + ENTRIES_START_SIZE, ENTRIES_INCREMENT)) + { + my_free((uchar*) buffer,MYF(0)); + goto error; + } + init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE); + + /* MY_DIR structure is allocated and completly initialized at this point */ + result= (MY_DIR*)buffer; + + tmp_file=strend(tmp_path); + +#ifdef THREAD + dp= (struct dirent*) dirent_tmp; +#else + dp=0; +#endif + + while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp))) + { + if (!(finfo.name= strdup_root(names_storage, dp->d_name))) + goto error; + + if (MyFlags & MY_WANT_STAT) + { + if (!(finfo.mystat= (MY_STAT*)alloc_root(names_storage, + sizeof(MY_STAT)))) + goto error; + + bzero(finfo.mystat, sizeof(MY_STAT)); + (void) strmov(tmp_file,dp->d_name); + (void) my_stat(tmp_path, finfo.mystat, MyFlags); + if (!(finfo.mystat->st_mode & MY_S_IREAD)) + continue; + } + else + finfo.mystat= NULL; + + if (push_dynamic(dir_entries_storage, (uchar*)&finfo)) + goto error; + } + + (void) closedir(dirp); +#if defined(THREAD) && !defined(HAVE_READDIR_R) + pthread_mutex_unlock(&THR_LOCK_open); +#endif + result->dir_entry= (FILEINFO *)dir_entries_storage->buffer; + result->number_off_files= dir_entries_storage->elements; + + if (!(MyFlags & MY_DONT_SORT)) + my_qsort((void *) result->dir_entry, result->number_off_files, + sizeof(FILEINFO), (qsort_cmp) comp_names); + DBUG_RETURN(result); + + error: +#if defined(THREAD) && !defined(HAVE_READDIR_R) + pthread_mutex_unlock(&THR_LOCK_open); +#endif + my_errno=errno; + if (dirp) + (void) closedir(dirp); + my_dirend(result); + if (MyFlags & (MY_FAE | MY_WME)) + my_error(EE_DIR,MYF(ME_BELL+ME_WAITTANG),path,my_errno); + DBUG_RETURN((MY_DIR *) NULL); +} /* my_dir */ + + +/* + * Convert from directory name to filename. + * On VMS: + * xyzzy:[mukesh.emacs] => xyzzy:[mukesh]emacs.dir.1 + * xyzzy:[mukesh] => xyzzy:[000000]mukesh.dir.1 + * On UNIX, it's simple: just make sure there is a terminating / + + * Returns pointer to dst; + */ + +char * directory_file_name (char * dst, const char *src) +{ +#ifndef VMS + + /* Process as Unix format: just remove test the final slash. */ + + char * end; + + if (src[0] == 0) + src= (char*) "."; /* Use empty as current */ + end=strmov(dst, src); + if (end[-1] != FN_LIBCHAR) + { + end[0]=FN_LIBCHAR; /* Add last '/' */ + end[1]='\0'; + } + return dst; + +#else /* VMS */ + + long slen; + long rlen; + char * ptr, rptr; + char bracket; + struct FAB fab = cc$rms_fab; + struct NAM nam = cc$rms_nam; + char esa[NAM$C_MAXRSS]; + + if (! src[0]) + src="[.]"; /* Empty is == current dir */ + + slen = strlen (src) - 1; + if (src[slen] == FN_C_AFTER_DIR || src[slen] == FN_C_AFTER_DIR_2 || + src[slen] == FN_DEVCHAR) + { + /* VMS style - convert [x.y.z] to [x.y]z, [x] to [000000]x */ + fab.fab$l_fna = src; + fab.fab$b_fns = slen + 1; + fab.fab$l_nam = &nam; + fab.fab$l_fop = FAB$M_NAM; + + nam.nam$l_esa = esa; + nam.nam$b_ess = sizeof esa; + nam.nam$b_nop |= NAM$M_SYNCHK; + + /* We call SYS$PARSE to handle such things as [--] for us. */ + if (SYS$PARSE(&fab, 0, 0) == RMS$_NORMAL) + { + slen = nam.nam$b_esl - 1; + if (esa[slen] == ';' && esa[slen - 1] == '.') + slen -= 2; + esa[slen + 1] = '\0'; + src = esa; + } + if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2) + { + /* what about when we have logical_name:???? */ + if (src[slen] == FN_DEVCHAR) + { /* Xlate logical name and see what we get */ + (void) strmov(dst,src); + dst[slen] = 0; /* remove colon */ + if (!(src = getenv (dst))) + return dst; /* Can't translate */ + + /* should we jump to the beginning of this procedure? + Good points: allows us to use logical names that xlate + to Unix names, + Bad points: can be a problem if we just translated to a device + name... + For now, I'll punt and always expect VMS names, and hope for + the best! */ + + slen = strlen (src) - 1; + if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2) + { /* no recursion here! */ + (void) strmov(dst, src); + return(dst); + } + } + else + { /* not a directory spec */ + (void) strmov(dst, src); + return(dst); + } + } + + bracket = src[slen]; /* End char */ + if (!(ptr = strchr (src, bracket - 2))) + { /* no opening bracket */ + (void) strmov (dst, src); + return dst; + } + if (!(rptr = strrchr (src, '.'))) + rptr = ptr; + slen = rptr - src; + (void) strmake (dst, src, slen); + + if (*rptr == '.') + { /* Put bracket and add */ + dst[slen++] = bracket; /* (rptr+1) after this */ + } + else + { + /* If we have the top-level of a rooted directory (i.e. xx:[000000]), + then translate the device and recurse. */ + + if (dst[slen - 1] == ':' + && dst[slen - 2] != ':' /* skip decnet nodes */ + && strcmp(src + slen, "[000000]") == 0) + { + dst[slen - 1] = '\0'; + if ((ptr = getenv (dst)) + && (rlen = strlen (ptr) - 1) > 0 + && (ptr[rlen] == FN_C_AFTER_DIR || ptr[rlen] == FN_C_AFTER_DIR_2) + && ptr[rlen - 1] == '.') + { + (void) strmov(esa,ptr); + esa[rlen - 1] = FN_C_AFTER_DIR; + esa[rlen] = '\0'; + return (directory_file_name (dst, esa)); + } + else + dst[slen - 1] = ':'; + } + (void) strmov(dst+slen,"[000000]"); + slen += 8; + } + (void) strmov(strmov(dst+slen,rptr+1)-1,".DIR.1"); + return dst; + } + (void) strmov(dst, src); + if (dst[slen] == '/' && slen > 1) + dst[slen] = 0; + return dst; +#endif /* VMS */ +} /* directory_file_name */ + +#else + +/* +***************************************************************************** +** Read long filename using windows rutines +***************************************************************************** +*/ + +MY_DIR *my_dir(const char *path, myf MyFlags) +{ + char *buffer; + MY_DIR *result= 0; + FILEINFO finfo; + DYNAMIC_ARRAY *dir_entries_storage; + MEM_ROOT *names_storage; +#ifdef __BORLANDC__ + struct ffblk find; +#else + struct _finddata_t find; +#endif + ushort mode; + char tmp_path[FN_REFLEN],*tmp_file,attrib; +#ifdef _WIN64 + __int64 handle; +#else + long handle; +#endif + DBUG_ENTER("my_dir"); + DBUG_PRINT("my",("path: '%s' stat: %d MyFlags: %d",path,MyFlags)); + + /* Put LIB-CHAR as last path-character if not there */ + tmp_file=tmp_path; + if (!*path) + *tmp_file++ ='.'; /* From current dir */ + tmp_file= strnmov(tmp_file, path, FN_REFLEN-5); + if (tmp_file[-1] == FN_DEVCHAR) + *tmp_file++= '.'; /* From current dev-dir */ + if (tmp_file[-1] != FN_LIBCHAR) + *tmp_file++ =FN_LIBCHAR; + tmp_file[0]='*'; /* Windows needs this !??? */ + tmp_file[1]='.'; + tmp_file[2]='*'; + tmp_file[3]='\0'; + + if (!(buffer= my_malloc(ALIGN_SIZE(sizeof(MY_DIR)) + + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)) + + sizeof(MEM_ROOT), MyFlags))) + goto error; + + dir_entries_storage= (DYNAMIC_ARRAY*)(buffer + ALIGN_SIZE(sizeof(MY_DIR))); + names_storage= (MEM_ROOT*)(buffer + ALIGN_SIZE(sizeof(MY_DIR)) + + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))); + + if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), + ENTRIES_START_SIZE, ENTRIES_INCREMENT)) + { + my_free((uchar*) buffer,MYF(0)); + goto error; + } + init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE); + + /* MY_DIR structure is allocated and completly initialized at this point */ + result= (MY_DIR*)buffer; + +#ifdef __BORLANDC__ + if ((handle= findfirst(tmp_path,&find,0)) == -1L) +#else + if ((handle=_findfirst(tmp_path,&find)) == -1L) +#endif + { + DBUG_PRINT("info", ("findfirst returned error, errno: %d", errno)); + if (errno != EINVAL) + goto error; + /* + Could not read the directory, no read access. + Probably because by "chmod -r". + continue and return zero files in dir + */ + } + else + { + + do + { +#ifdef __BORLANDC__ + attrib= find.ff_attrib; +#else + attrib= find.attrib; + /* + Do not show hidden and system files which Windows sometimes create. + Note. Because Borland's findfirst() is called with the third + argument = 0 hidden/system files are excluded from the search. + */ + if (attrib & (_A_HIDDEN | _A_SYSTEM)) + continue; +#endif +#ifdef __BORLANDC__ + if (!(finfo.name= strdup_root(names_storage, find.ff_name))) + goto error; +#else + if (!(finfo.name= strdup_root(names_storage, find.name))) + goto error; +#endif + if (MyFlags & MY_WANT_STAT) + { + if (!(finfo.mystat= (MY_STAT*)alloc_root(names_storage, + sizeof(MY_STAT)))) + goto error; + + bzero(finfo.mystat, sizeof(MY_STAT)); +#ifdef __BORLANDC__ + finfo.mystat->st_size=find.ff_fsize; +#else + finfo.mystat->st_size=find.size; +#endif + mode= MY_S_IREAD; + if (!(attrib & _A_RDONLY)) + mode|= MY_S_IWRITE; + if (attrib & _A_SUBDIR) + mode|= MY_S_IFDIR; + finfo.mystat->st_mode= mode; +#ifdef __BORLANDC__ + finfo.mystat->st_mtime= ((uint32) find.ff_ftime); +#else + finfo.mystat->st_mtime= ((uint32) find.time_write); +#endif + } + else + finfo.mystat= NULL; + + if (push_dynamic(dir_entries_storage, (uchar*)&finfo)) + goto error; + } +#ifdef __BORLANDC__ + while (findnext(&find) == 0); +#else + while (_findnext(handle,&find) == 0); + + _findclose(handle); +#endif + } + + result->dir_entry= (FILEINFO *)dir_entries_storage->buffer; + result->number_off_files= dir_entries_storage->elements; + + if (!(MyFlags & MY_DONT_SORT)) + my_qsort((void *) result->dir_entry, result->number_off_files, + sizeof(FILEINFO), (qsort_cmp) comp_names); + DBUG_PRINT("exit", ("found %d files", result->number_off_files)); + DBUG_RETURN(result); +error: + my_errno=errno; +#ifndef __BORLANDC__ + if (handle != -1) + _findclose(handle); +#endif + my_dirend(result); + if (MyFlags & MY_FAE+MY_WME) + my_error(EE_DIR,MYF(ME_BELL+ME_WAITTANG),path,errno); + DBUG_RETURN((MY_DIR *) NULL); +} /* my_dir */ + +#endif /* _WIN32 */ + +/**************************************************************************** +** File status +** Note that MY_STAT is assumed to be same as struct stat +****************************************************************************/ + + +int my_fstat(File Filedes, MY_STAT *stat_area, + myf MyFlags __attribute__((unused))) +{ + DBUG_ENTER("my_fstat"); + DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags)); +#ifdef _WIN32 + DBUG_RETURN(my_win_fstat(Filedes, stat_area)); +#else + DBUG_RETURN(fstat(Filedes, (struct stat *) stat_area)); +#endif +} + + +MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags) +{ + int m_used; + DBUG_ENTER("my_stat"); + DBUG_PRINT("my", ("path: '%s' stat_area: %p MyFlags: %d", path, + stat_area, my_flags)); + + if ((m_used= (stat_area == NULL))) + if (!(stat_area= (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags))) + goto error; +#ifndef _WIN32 + if (! stat((char *) path, (struct stat *) stat_area) ) + DBUG_RETURN(stat_area); +#else + if (! my_win_stat(path, stat_area) ) + DBUG_RETURN(stat_area); +#endif + DBUG_PRINT("error",("Got errno: %d from stat", errno)); + my_errno= errno; + if (m_used) /* Free if new area */ + my_free((uchar*) stat_area,MYF(0)); + +error: + if (my_flags & (MY_FAE+MY_WME)) + { + my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),path,my_errno); + DBUG_RETURN((MY_STAT *) NULL); + } + DBUG_RETURN((MY_STAT *) NULL); +} /* my_stat */ diff --git a/externals/mysql/mysys/my_libwrap.c b/externals/mysql/mysys/my_libwrap.c new file mode 100644 index 00000000000..e72334ba806 --- /dev/null +++ b/externals/mysql/mysys/my_libwrap.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This is needed to be able to compile with original libwrap header + files that don't have the prototypes +*/ + +#include +#include + +#ifdef HAVE_LIBWRAP + +void my_fromhost(struct request_info *req) +{ + fromhost(req); +} + +int my_hosts_access(struct request_info *req) +{ + return hosts_access(req); +} + +char *my_eval_client(struct request_info *req) +{ + return eval_client(req); +} + +#endif /* HAVE_LIBWRAP */ diff --git a/externals/mysql/mysys/my_lock.c b/externals/mysql/mysys/my_lock.c new file mode 100644 index 00000000000..408089df3e9 --- /dev/null +++ b/externals/mysql/mysys/my_lock.c @@ -0,0 +1,290 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#undef MY_HOW_OFTEN_TO_ALARM +#define MY_HOW_OFTEN_TO_ALARM ((int) my_time_to_wait_for_lock) +#ifdef NO_ALARM_LOOP +#undef NO_ALARM_LOOP +#endif +#include +#ifdef __NETWARE__ +#include +#endif + +#ifdef _WIN32 +#define WIN_LOCK_INFINITE -1 +#define WIN_LOCK_SLEEP_MILLIS 100 + +static int win_lock(File fd, int locktype, my_off_t start, my_off_t length, + int timeout_sec) +{ + LARGE_INTEGER liOffset,liLength; + DWORD dwFlags; + OVERLAPPED ov= {0}; + HANDLE hFile= (HANDLE)my_get_osfhandle(fd); + DWORD lastError= 0; + int i; + int timeout_millis= timeout_sec * 1000; + + DBUG_ENTER("win_lock"); + + liOffset.QuadPart= start; + liLength.QuadPart= length; + + ov.Offset= liOffset.LowPart; + ov.OffsetHigh= liOffset.HighPart; + + if (locktype == F_UNLCK) + { + if (UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov)) + DBUG_RETURN(0); + /* + For compatibility with fcntl implementation, ignore error, + if region was not locked + */ + if (GetLastError() == ERROR_NOT_LOCKED) + { + SetLastError(0); + DBUG_RETURN(0); + } + goto error; + } + else if (locktype == F_RDLCK) + /* read lock is mapped to a shared lock. */ + dwFlags= 0; + else + /* write lock is mapped to an exclusive lock. */ + dwFlags= LOCKFILE_EXCLUSIVE_LOCK; + + /* + Drop old lock first to avoid double locking. + During analyze of Bug#38133 (Myisamlog test fails on Windows) + I met the situation that the program myisamlog locked the file + exclusively, then additionally shared, then did one unlock, and + then blocked on an attempt to lock it exclusively again. + Unlocking before every lock fixed the problem. + Note that this introduces a race condition. When the application + wants to convert an exclusive lock into a shared one, it will now + first unlock the file and then lock it shared. A waiting exclusive + lock could step in here. For reasons described in Bug#38133 and + Bug#41124 (Server hangs on Windows with --external-locking after + INSERT...SELECT) and in the review thread at + http://lists.mysql.com/commits/60721 it seems to be the better + option than not to unlock here. + If one day someone notices a way how to do file lock type changes + on Windows without unlocking before taking the new lock, please + change this code accordingly to fix the race condition. + */ + if (!UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov) && + (GetLastError() != ERROR_NOT_LOCKED)) + goto error; + + if (timeout_sec == WIN_LOCK_INFINITE) + { + if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov)) + DBUG_RETURN(0); + goto error; + } + + dwFlags|= LOCKFILE_FAIL_IMMEDIATELY; + timeout_millis= timeout_sec * 1000; + /* Try lock in a loop, until the lock is acquired or timeout happens */ + for(i= 0; ;i+= WIN_LOCK_SLEEP_MILLIS) + { + if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov)) + DBUG_RETURN(0); + + if (GetLastError() != ERROR_LOCK_VIOLATION) + goto error; + + if (i >= timeout_millis) + break; + Sleep(WIN_LOCK_SLEEP_MILLIS); + } + + /* timeout */ + errno= EAGAIN; + DBUG_RETURN(-1); + +error: + my_osmaperr(GetLastError()); + DBUG_RETURN(-1); +} +#endif + + + +/* + Lock a part of a file + + RETURN VALUE + 0 Success + -1 An error has occured and 'my_errno' is set + to indicate the actual error code. +*/ + +int my_lock(File fd, int locktype, my_off_t start, my_off_t length, + myf MyFlags) +{ +#ifdef HAVE_FCNTL + int value; + ALARM_VARIABLES; +#endif +#ifdef __NETWARE__ + int nxErrno; +#endif + + DBUG_ENTER("my_lock"); + DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d", + fd,locktype,(long) start,(long) length,MyFlags)); +#ifdef VMS + DBUG_RETURN(0); +#else + if (my_disable_locking && ! (MyFlags & MY_FORCE_LOCK)) + DBUG_RETURN(0); + +#if defined(__NETWARE__) + { + NXSOffset_t nxLength = length; + unsigned long nxLockFlags = 0; + + if ((MyFlags & MY_SHORT_WAIT)) + { + /* not yet implemented */ + MyFlags|= MY_NO_WAIT; + } + + if (length == F_TO_EOF) + { + /* EOF is interpreted as a very large length. */ + nxLength = 0x7FFFFFFFFFFFFFFF; + } + + if (locktype == F_UNLCK) + { + /* The lock flags are currently ignored by NKS. */ + if (!(nxErrno= NXFileRangeUnlock(fd, 0L, start, nxLength))) + DBUG_RETURN(0); + } + else + { + if (locktype == F_RDLCK) + { + /* A read lock is mapped to a shared lock. */ + nxLockFlags = NX_RANGE_LOCK_SHARED; + } + else + { + /* A write lock is mapped to an exclusive lock. */ + nxLockFlags = NX_RANGE_LOCK_EXCL; + } + + if (MyFlags & MY_NO_WAIT) + { + /* Don't block on the lock. */ + nxLockFlags |= NX_RANGE_LOCK_TRYLOCK; + } + + if (!(nxErrno= NXFileRangeLock(fd, nxLockFlags, start, nxLength))) + DBUG_RETURN(0); + } + } +#elif defined(_WIN32) + { + int timeout_sec; + if (MyFlags & MY_NO_WAIT) + timeout_sec= 0; + else if(MyFlags & MY_SHORT_WAIT) + timeout_sec= my_time_to_wait_for_lock; + else + timeout_sec= WIN_LOCK_INFINITE; + + if(win_lock(fd, locktype, start, length, timeout_sec) == 0) + DBUG_RETURN(0); + } +#else +#if defined(HAVE_FCNTL) + { + struct flock lock; + + lock.l_type= (short) locktype; + lock.l_whence= SEEK_SET; + lock.l_start= (off_t) start; + lock.l_len= (off_t) length; + + if (MyFlags & (MY_NO_WAIT | MY_SHORT_WAIT)) + { + if (fcntl(fd,F_SETLK,&lock) != -1) /* Check if we can lock */ + DBUG_RETURN(0); /* Ok, file locked */ + if (MyFlags & MY_NO_WAIT) + { + my_errno= (errno == EACCES) ? EAGAIN : errno ? errno : -1; + DBUG_RETURN(-1); + } + + DBUG_PRINT("info",("Was locked, trying with alarm")); + ALARM_INIT; + while ((value=fcntl(fd,F_SETLKW,&lock)) && ! ALARM_TEST && + errno == EINTR) + { /* Setup again so we don`t miss it */ + ALARM_REINIT; + } + ALARM_END; + if (value != -1) + DBUG_RETURN(0); + if (errno == EINTR) + errno=EAGAIN; + } + else if (fcntl(fd,F_SETLKW,&lock) != -1) /* Wait until a lock */ + DBUG_RETURN(0); + } +#else + if (MyFlags & MY_SEEK_NOT_DONE) + { + if (my_seek(fd,start,MY_SEEK_SET,MYF(MyFlags & ~MY_SEEK_NOT_DONE)) + == MY_FILEPOS_ERROR) + { + /* + If an error has occured in my_seek then we will already + have an error code in my_errno; Just return error code. + */ + DBUG_RETURN(-1); + } + } + if (lockf(fd,locktype,length) != -1) + DBUG_RETURN(0); +#endif /* HAVE_FCNTL */ +#endif /* HAVE_LOCKING */ + +#ifdef __NETWARE__ + my_errno = nxErrno; +#else + /* We got an error. We don't want EACCES errors */ + my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1; +#endif + if (MyFlags & MY_WME) + { + if (locktype == F_UNLCK) + my_error(EE_CANTUNLOCK,MYF(ME_BELL+ME_WAITTANG),my_errno); + else + my_error(EE_CANTLOCK,MYF(ME_BELL+ME_WAITTANG),my_errno); + } + DBUG_PRINT("error",("my_errno: %d (%d)",my_errno,errno)); + DBUG_RETURN(-1); +#endif /* ! VMS */ +} /* my_lock */ diff --git a/externals/mysql/mysys/my_lockmem.c b/externals/mysql/mysys/my_lockmem.c new file mode 100644 index 00000000000..7d226b187d8 --- /dev/null +++ b/externals/mysql/mysys/my_lockmem.c @@ -0,0 +1,103 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Alloc a block of locked memory */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + +#ifdef HAVE_MLOCK +#include + +struct st_mem_list +{ + LIST list; + uchar *page; + uint size; +}; + +LIST *mem_list; + +void *my_malloc_lock(size_t size,myf MyFlags) +{ + int success; + uint pagesize=sysconf(_SC_PAGESIZE); + uchar *ptr; + struct st_mem_list *element; + DBUG_ENTER("my_malloc_lock"); + + size=((size-1) & ~(pagesize-1))+pagesize; +#if HAVE_MEMALIGN + if (!(ptr=memalign(pagesize,size))) +#else + if (!(ptr=valloc(size))) +#endif + { + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); + DBUG_RETURN(0); + } + success = mlock((uchar*) ptr,size); + if (success != 0 && geteuid() == 0) + { + DBUG_PRINT("warning",("Failed to lock memory. errno %d\n", + errno)); + fprintf(stderr, "Warning: Failed to lock memory. errno %d\n", + errno); + } + else + { + /* Add block in a list for munlock */ + if (!(element=(struct st_mem_list*) my_malloc(sizeof(*element),MyFlags))) + { + (void) munlock((uchar*) ptr,size); + free(ptr); + DBUG_RETURN(0); + } + element->list.data=(uchar*) element; + element->page=ptr; + element->size=size; + pthread_mutex_lock(&THR_LOCK_malloc); + mem_list=list_add(mem_list,&element->list); + pthread_mutex_unlock(&THR_LOCK_malloc); + } + DBUG_RETURN(ptr); +} + + +void my_free_lock(void *ptr,myf Myflags __attribute__((unused))) +{ + LIST *list; + struct st_mem_list *element=0; + + pthread_mutex_lock(&THR_LOCK_malloc); + for (list=mem_list ; list ; list=list->next) + { + element=(struct st_mem_list*) list->data; + if (ptr == element->page) + { /* Found locked mem */ + (void) munlock((uchar*) ptr,element->size); + mem_list=list_delete(mem_list,list); + break; + } + } + pthread_mutex_unlock(&THR_LOCK_malloc); + if (element) + my_free((uchar*) element,MYF(0)); + free(ptr); /* Free even if not locked */ +} + +#endif /* HAVE_MLOCK */ diff --git a/externals/mysql/mysys/my_malloc.c b/externals/mysql/mysys/my_malloc.c new file mode 100644 index 00000000000..f1254c0f31c --- /dev/null +++ b/externals/mysql/mysys/my_malloc.c @@ -0,0 +1,100 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef SAFEMALLOC /* We don't need SAFEMALLOC here */ +#undef SAFEMALLOC +#endif + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + + /* My memory allocator */ + +void *my_malloc(size_t size, myf my_flags) +{ + void* point; + DBUG_ENTER("my_malloc"); + DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags)); + + if (!size) + size=1; /* Safety */ + + /* If compiled with DBUG, test for error injection. Described in my_sys.h. */ + /* purecov: begin tested */ + if (!(point= IF_DBUG(my_malloc_error_inject ? NULL :) (char*) malloc(size))) + { + IF_DBUG(if (my_malloc_error_inject) errno= ENOMEM; + my_malloc_error_inject= 0); + my_errno=errno; + if (my_flags & MY_FAE) + error_handler_hook=fatal_error_handler_hook; + if (my_flags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH),size); + if (my_flags & MY_FAE) + exit(1); + } + else if (my_flags & MY_ZEROFILL) + bzero(point,size); + DBUG_PRINT("exit",("ptr: %p", point)); + DBUG_RETURN((void*) point); + /* purecov: end */ +} /* my_malloc */ + + + /* Free memory allocated with my_malloc */ + /*ARGSUSED*/ + +void my_no_flags_free(void* ptr) +{ + DBUG_ENTER("my_free"); + DBUG_PRINT("my",("ptr: %p", ptr)); + if (ptr) + free(ptr); + DBUG_VOID_RETURN; +} /* my_free */ + + + /* malloc and copy */ + +void* my_memdup(const void *from, size_t length, myf my_flags) +{ + void *ptr; + if ((ptr= my_malloc(length,my_flags)) != 0) + memcpy(ptr, from, length); + return(ptr); +} + + +char *my_strdup(const char *from, myf my_flags) +{ + char *ptr; + size_t length= strlen(from)+1; + if ((ptr= (char*) my_malloc(length, my_flags))) + memcpy((uchar*) ptr, (uchar*) from,(size_t) length); + return(ptr); +} + + +char *my_strndup(const char *from, size_t length, myf my_flags) +{ + char *ptr; + if ((ptr= (char*) my_malloc(length+1,my_flags)) != 0) + { + memcpy((uchar*) ptr, (uchar*) from, length); + ptr[length]=0; + } + return((char*) ptr); +} diff --git a/externals/mysql/mysys/my_memmem.c b/externals/mysql/mysys/my_memmem.c new file mode 100644 index 00000000000..c000f14bc66 --- /dev/null +++ b/externals/mysql/mysys/my_memmem.c @@ -0,0 +1,83 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +/* + my_memmem, port of a GNU extension. + + Returns a pointer to the beginning of the substring, needle, or NULL if the + substring is not found in haystack. +*/ + +void *my_memmem(const void *haystack, size_t haystacklen, + const void *needle, size_t needlelen) +{ + const unsigned char *cursor; + const unsigned char *last_possible_needle_location = + (unsigned char *)haystack + haystacklen - needlelen; + + /* Easy answers */ + if (needlelen > haystacklen) return(NULL); + if (needle == NULL) return(NULL); + if (haystack == NULL) return(NULL); + if (needlelen == 0) return(NULL); + if (haystacklen == 0) return(NULL); + + for (cursor = haystack; cursor <= last_possible_needle_location; cursor++) { + if (memcmp(needle, cursor, needlelen) == 0) { + return((void *) cursor); + } + } + return(NULL); +} + + + +#ifdef MAIN +#include + +int main(int argc, char *argv[]) { + char haystack[10], needle[3]; + + memmove(haystack, "0123456789", 10); + + memmove(needle, "no", 2); + assert(my_memmem(haystack, 10, needle, 2) == NULL); + + memmove(needle, "345", 3); + assert(my_memmem(haystack, 10, needle, 3) != NULL); + + memmove(needle, "789", 3); + assert(my_memmem(haystack, 10, needle, 3) != NULL); + assert(my_memmem(haystack, 9, needle, 3) == NULL); + + memmove(needle, "012", 3); + assert(my_memmem(haystack, 10, needle, 3) != NULL); + assert(my_memmem(NULL, 10, needle, 3) == NULL); + + assert(my_memmem(NULL, 10, needle, 3) == NULL); + assert(my_memmem(haystack, 0, needle, 3) == NULL); + assert(my_memmem(haystack, 10, NULL, 3) == NULL); + assert(my_memmem(haystack, 10, needle, 0) == NULL); + + assert(my_memmem(haystack, 1, needle, 3) == NULL); + + printf("success\n"); + return(0); +} + +#endif diff --git a/externals/mysql/mysys/my_messnc.c b/externals/mysql/mysys/my_messnc.c new file mode 100644 index 00000000000..6f86bf34782 --- /dev/null +++ b/externals/mysql/mysys/my_messnc.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +void my_message_no_curses(uint error __attribute__((unused)), + const char *str, myf MyFlags) +{ + DBUG_ENTER("my_message_no_curses"); + DBUG_PRINT("enter",("message: %s",str)); + (void) fflush(stdout); + if (MyFlags & ME_BELL) +#ifdef __NETWARE__ + ringbell(); /* Bell */ +#else + (void) fputc('\007',stderr); /* Bell */ +#endif /* __NETWARE__ */ + if (my_progname) + { + (void)fputs(my_progname,stderr); (void)fputs(": ",stderr); + } + (void)fputs(str,stderr); + (void)fputc('\n',stderr); + (void)fflush(stderr); + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/mysys/my_mkdir.c b/externals/mysql/mysys/my_mkdir.c new file mode 100644 index 00000000000..676c6c1cd51 --- /dev/null +++ b/externals/mysql/mysys/my_mkdir.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include +#ifdef __WIN__ +#include +#endif + +int my_mkdir(const char *dir, int Flags, myf MyFlags) +{ + DBUG_ENTER("my_dir"); + DBUG_PRINT("enter",("dir: %s",dir)); + +#if defined(__WIN__) + if (mkdir((char*) dir)) +#else + if (mkdir((char*) dir, Flags & my_umask_dir)) +#endif + { + my_errno=errno; + DBUG_PRINT("error",("error %d when creating direcory %s",my_errno,dir)); + if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) + my_error(EE_CANT_MKDIR, MYF(ME_BELL+ME_WAITTANG), dir, my_errno); + DBUG_RETURN(-1); + } + DBUG_RETURN(0); +} diff --git a/externals/mysql/mysys/my_mmap.c b/externals/mysql/mysys/my_mmap.c new file mode 100644 index 00000000000..303d8efaf30 --- /dev/null +++ b/externals/mysql/mysys/my_mmap.c @@ -0,0 +1,80 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +#ifdef HAVE_SYS_MMAN_H + +/* + system msync() only syncs mmap'ed area to fs cache. + fsync() is required to really sync to disc +*/ +int my_msync(int fd, void *addr, size_t len, int flags) +{ + msync(addr, len, flags); + return my_sync(fd, MYF(0)); +} + +#elif defined(_WIN32) + +static SECURITY_ATTRIBUTES mmap_security_attributes= + {sizeof(SECURITY_ATTRIBUTES), 0, TRUE}; + +void *my_mmap(void *addr, size_t len, int prot, + int flags, File fd, my_off_t offset) +{ + HANDLE hFileMap; + LPVOID ptr; + HANDLE hFile= (HANDLE)my_get_osfhandle(fd); + if (hFile == INVALID_HANDLE_VALUE) + return MAP_FAILED; + + hFileMap=CreateFileMapping(hFile, &mmap_security_attributes, + PAGE_READWRITE, 0, (DWORD) len, NULL); + if (hFileMap == 0) + return MAP_FAILED; + + ptr=MapViewOfFile(hFileMap, + prot & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ, + (DWORD)(offset >> 32), (DWORD)offset, len); + + /* + MSDN explicitly states that it's possible to close File Mapping Object + even when a view is not unmapped - then the object will be held open + implicitly until unmap, as every view stores internally a handler of + a corresponding File Mapping Object + */ + CloseHandle(hFileMap); + + if (ptr) + return ptr; + + return MAP_FAILED; +} + +int my_munmap(void *addr, size_t len) +{ + return UnmapViewOfFile(addr) ? 0 : -1; +} + +int my_msync(int fd, void *addr, size_t len, int flags) +{ + return FlushViewOfFile(addr, len) ? 0 : -1; +} + +#else +#warning "no mmap!" +#endif + diff --git a/externals/mysql/mysys/my_net.c b/externals/mysql/mysys/my_net.c new file mode 100644 index 00000000000..81d977210f8 --- /dev/null +++ b/externals/mysql/mysys/my_net.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* thread safe version of some common functions */ + +#include "mysys_priv.h" +#include + +/* for thread safe my_inet_ntoa */ +#if !defined(__WIN__) +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#endif /* !defined(__WIN__) */ + +void my_inet_ntoa(struct in_addr in, char *buf) +{ + char *ptr; + pthread_mutex_lock(&THR_LOCK_net); + ptr=inet_ntoa(in); + strmov(buf,ptr); + pthread_mutex_unlock(&THR_LOCK_net); +} diff --git a/externals/mysql/mysys/my_netware.c b/externals/mysql/mysys/my_netware.c new file mode 100644 index 00000000000..5b5c39c0ac0 --- /dev/null +++ b/externals/mysql/mysys/my_netware.c @@ -0,0 +1,150 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Functions specific to netware +*/ + +#include +#ifdef __NETWARE__ + #include + #include + +/* + PMUserLicenseRequest is an API exported by the polimgr.nlm + (loaded by the NetWare OS when it comes up) for use by other + NLM-based NetWare products/services. + PMUserLicenseRequest provides a couple of functions: + 1) it will optionally request a User license or ensure that + one already exists for the specified User in userInfo + 2) it utilizes the NetWare usage metering service to + record usage information about your product/service. +*/ + +long PMMeteredUsageRequest +( + /* + NDS distinguished name or IP address or ??. asciiz string, e.g. + ".CN=Admin.O=this.T=MYTREE." + */ + char *userInfo, + long infoType, /* see defined values */ + /* + string used to identify the calling service, used to index the + metered info e.g. "iPrint" + */ + char *serviceID, + char tranAddrType, /* type of address that follows */ + char *tranAddr, /* ptr to a 10-byte array */ + long flags, /* see defined values */ + /* NLS error code, if any. NULL input is okay */ + long *licRequestErrCode, + /* meter service error code, if any. NULL input is okay */ + long *storeMeterInfoErrCode, + /* + error code from NLSMeter if + storeMeterInfoErrCode == PM_LICREQ_NLSMETERERROR. + NULL input is okay + */ + long *NLSMeterErrCode +); + +typedef long(*PMUR)(const char*, long, const char*, char, + const char*, long, long*, long*, long*); + +/* infoType */ +/* indicates that the info in the userInfo param is an NDS user */ +#define PM_USERINFO_TYPE_NDS 1 +/* indicates that the info in the userInfo param is NOT an NDS user */ +#define PM_USERINFO_TYPE_ADDRESS 2 + +/* Flags */ + +/* + Tells the service that it should not check to see if the NDS user + contained in the userInfo param has a NetWare User License - just + record metering information; this is ignored if infoType != + PM_USERINFO_TYPE_NDS +*/ + +#define PM_FLAGS_METER_ONLY 0x0000001 + +/* + Indicates that the values in the userInfo and serviceID parameters + are unicode strings, so that the metering service bypasses + converting these to unicode (again) +*/ +#define PM_LICREQ_ALREADY_UNICODE 0x0000002 +/* + Useful only if infoType is PM_USERINFO_TYPE_NDS - indicates a "no + stop" policy of the calling service +*/ +#define PM_LICREQ_ALWAYS_METER 0x0000004 + + +/* + net Address Types - system-defined types of net addresses that can + be used in the tranAddrType field +*/ + +#define NLS_TRAN_TYPE_IPX 0x00000001 /* An IPX address */ +#define NLS_TRAN_TYPE_IP 0x00000008 /* An IP address */ +#define NLS_ADDR_TYPE_MAC 0x000000F1 /* a MAC address */ + +/* + Net Address Sizes - lengths that correspond to the tranAddrType + field (just fyi) +*/ +#define NLS_IPX_ADDR_SIZE 10 /* the size of an IPX address */ +#define NLS_IP_ADDR_SIZE 4 /* the size of an IP address */ +#define NLS_MAC_ADDR_SIZE 6 /* the size of a MAC address */ + + +void netware_reg_user(const char *ip, const char *user, + const char *application) +{ + PMUR usage_request; + long licRequestErrCode = 0; + long storeMeterInfoErrCode = 0; + long nlsMeterErrCode = 0; + + /* import the symbol */ + usage_request= ((PMUR)ImportPublicObject(getnlmhandle(), + "PMMeteredUsageRequest")); + if (usage_request != NULL) + { + unsigned long iaddr; + char addr[NLS_IPX_ADDR_SIZE]; + + /* create address */ + iaddr = htonl(inet_addr(ip)); + bzero(addr, NLS_IPX_ADDR_SIZE); + memcpy(addr, &iaddr, NLS_IP_ADDR_SIZE); + + /* call to NLS */ + usage_request(user, + PM_USERINFO_TYPE_ADDRESS, + application, + NLS_TRAN_TYPE_IP, + addr, + PM_FLAGS_METER_ONLY, + &licRequestErrCode, + &storeMeterInfoErrCode, + &nlsMeterErrCode); + /* release symbol */ + UnImportPublicObject(getnlmhandle(), "PMMeteredUsageRequest"); + } +} +#endif /* __NETWARE__ */ diff --git a/externals/mysql/mysys/my_new.cc b/externals/mysql/mysys/my_new.cc new file mode 100644 index 00000000000..7da54ffac87 --- /dev/null +++ b/externals/mysql/mysys/my_new.cc @@ -0,0 +1,58 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This is a replacement of new/delete operators to be used when compiling + with gcc 3.0.x to avoid including libstdc++ +*/ + +#include "mysys_priv.h" + +#ifdef USE_MYSYS_NEW + +void *operator new (size_t sz) +{ + return (void *) malloc (sz ? sz : 1); +} + +void *operator new[] (size_t sz) +{ + return (void *) malloc (sz ? sz : 1); +} + +void operator delete (void *ptr) +{ + if (ptr) + free(ptr); +} + +void operator delete[] (void *ptr) throw () +{ + if (ptr) + free(ptr); +} + +C_MODE_START + +int __cxa_pure_virtual() +{ + assert(! "Aborted: pure virtual method called."); + return 0; +} + +C_MODE_END + +#endif /* USE_MYSYS_NEW */ + diff --git a/externals/mysql/mysys/my_once.c b/externals/mysql/mysys/my_once.c new file mode 100644 index 00000000000..b6f6656fce2 --- /dev/null +++ b/externals/mysql/mysys/my_once.c @@ -0,0 +1,122 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Not MT-SAFE */ + +#ifdef SAFEMALLOC /* We don't need SAFEMALLOC here */ +#undef SAFEMALLOC +#endif + +#include "mysys_priv.h" +#include "my_static.h" +#include "mysys_err.h" +#include + +/* + Alloc for things we don't nead to free + + SYNOPSIS + my_once_alloc() + Size + MyFlags + + NOTES + No DBUG_ENTER... here to get smaller dbug-startup +*/ + +void* my_once_alloc(size_t Size, myf MyFlags) +{ + size_t get_size, max_left; + uchar* point; + reg1 USED_MEM *next; + reg2 USED_MEM **prev; + + Size= ALIGN_SIZE(Size); + prev= &my_once_root_block; + max_left=0; + for (next=my_once_root_block ; next && next->left < Size ; next= next->next) + { + if (next->left > max_left) + max_left=next->left; + prev= &next->next; + } + if (! next) + { /* Time to alloc new block */ + get_size= Size+ALIGN_SIZE(sizeof(USED_MEM)); + if (max_left*4 < my_once_extra && get_size < my_once_extra) + get_size=my_once_extra; /* Normal alloc */ + + if ((next = (USED_MEM*) malloc(get_size)) == 0) + { + my_errno=errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),get_size); + return((uchar*) 0); + } + DBUG_PRINT("test",("my_once_malloc %lu byte malloced", (ulong) get_size)); + next->next= 0; + next->size= get_size; + next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM)); + *prev=next; + } + point= (uchar*) ((char*) next+ (next->size-next->left)); + next->left-= Size; + + if (MyFlags & MY_ZEROFILL) + bzero(point, Size); + return((void*) point); +} /* my_once_alloc */ + + +char *my_once_strdup(const char *src,myf myflags) +{ + size_t len= strlen(src)+1; + uchar *dst= my_once_alloc(len, myflags); + if (dst) + memcpy(dst, src, len); + return (char*) dst; +} + + +void *my_once_memdup(const void *src, size_t len, myf myflags) +{ + uchar *dst= my_once_alloc(len, myflags); + if (dst) + memcpy(dst, src, len); + return dst; +} + + +/* + Deallocate everything used by my_once_alloc + + SYNOPSIS + my_once_free() +*/ + +void my_once_free(void) +{ + reg1 USED_MEM *next,*old; + DBUG_ENTER("my_once_free"); + + for (next=my_once_root_block ; next ; ) + { + old=next; next= next->next ; + free((uchar*) old); + } + my_once_root_block=0; + + DBUG_VOID_RETURN; +} /* my_once_free */ diff --git a/externals/mysql/mysys/my_open.c b/externals/mysql/mysys/my_open.c new file mode 100644 index 00000000000..ebdf9e38ab3 --- /dev/null +++ b/externals/mysql/mysys/my_open.c @@ -0,0 +1,191 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include + + +/* + Open a file + + SYNOPSIS + my_open() + FileName Fully qualified file name + Flags Read | write + MyFlags Special flags + + RETURN VALUE + File descriptor +*/ + +File my_open(const char *FileName, int Flags, myf MyFlags) + /* Path-name of file */ + /* Read | write .. */ + /* Special flags */ +{ + File fd; + DBUG_ENTER("my_open"); + DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d", + FileName, Flags, MyFlags)); +#if defined(_WIN32) + fd= my_win_open(FileName, Flags); +#elif !defined(NO_OPEN_3) + fd = open(FileName, Flags, my_umask); /* Normal unix */ +#else + fd = open((char *) FileName, Flags); +#endif + + DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_OPEN, + EE_FILENOTFOUND, MyFlags)); +} /* my_open */ + + +/* + Close a file + + SYNOPSIS + my_close() + fd File sescriptor + myf Special Flags + +*/ + +int my_close(File fd, myf MyFlags) +{ + int err; + DBUG_ENTER("my_close"); + DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags)); + + pthread_mutex_lock(&THR_LOCK_open); +#ifndef _WIN32 + do + { + err= close(fd); + } while (err == -1 && errno == EINTR); +#else + err= my_win_close(fd); +#endif + if (err) + { + DBUG_PRINT("error",("Got error %d on close",err)); + my_errno=errno; + if (MyFlags & (MY_FAE | MY_WME)) + my_error(EE_BADCLOSE, MYF(ME_BELL+ME_WAITTANG),my_filename(fd),errno); + } + if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN) + { + my_free(my_file_info[fd].name, MYF(0)); +#if defined(THREAD) && !defined(HAVE_PREAD) && !defined (_WIN32) + pthread_mutex_destroy(&my_file_info[fd].mutex); +#endif + my_file_info[fd].type = UNOPEN; + } + my_file_opened--; + pthread_mutex_unlock(&THR_LOCK_open); + DBUG_RETURN(err); +} /* my_close */ + + +/* + Register file in my_file_info[] + + SYNOPSIS + my_register_filename() + fd File number opened, -1 if error on open + FileName File name + type_file_type How file was created + error_message_number Error message number if caller got error (fd == -1) + MyFlags Flags for my_close() + + RETURN + -1 error + # Filenumber + +*/ + +File my_register_filename(File fd, const char *FileName, enum file_type + type_of_file, uint error_message_number, myf MyFlags) +{ + DBUG_ENTER("my_register_filename"); + if ((int) fd >= MY_FILE_MIN) + { + if ((uint) fd >= my_file_limit) + { +#if defined(THREAD) && !defined(HAVE_PREAD) + my_errno= EMFILE; +#else + thread_safe_increment(my_file_opened,&THR_LOCK_open); + DBUG_RETURN(fd); /* safeguard */ +#endif + } + else + { + pthread_mutex_lock(&THR_LOCK_open); + if ((my_file_info[fd].name = (char*) my_strdup(FileName,MyFlags))) + { + my_file_opened++; + my_file_total_opened++; + my_file_info[fd].type = type_of_file; +#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32) + pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST); +#endif + pthread_mutex_unlock(&THR_LOCK_open); + DBUG_PRINT("exit",("fd: %d",fd)); + DBUG_RETURN(fd); + } + pthread_mutex_unlock(&THR_LOCK_open); + my_errno= ENOMEM; + } + (void) my_close(fd, MyFlags); + } + else + my_errno= errno; + + DBUG_PRINT("error",("Got error %d on open", my_errno)); + if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) + { + if (my_errno == EMFILE) + error_message_number= EE_OUT_OF_FILERESOURCES; + DBUG_PRINT("error",("print err: %d",error_message_number)); + my_error(error_message_number, MYF(ME_BELL+ME_WAITTANG), + FileName, my_errno); + } + DBUG_RETURN(-1); +} + + + + +#ifdef EXTRA_DEBUG + +void my_print_open_files(void) +{ + if (my_file_opened | my_stream_opened) + { + uint i; + for (i= 0 ; i < my_file_limit ; i++) + { + if (my_file_info[i].type != UNOPEN) + { + fprintf(stderr, EE(EE_FILE_NOT_CLOSED), my_file_info[i].name, i); + fputc('\n', stderr); + } + } + } +} + +#endif diff --git a/externals/mysql/mysys/my_port.c b/externals/mysql/mysys/my_port.c new file mode 100644 index 00000000000..9ad333421ca --- /dev/null +++ b/externals/mysql/mysys/my_port.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* + Small functions to make code portable +*/ + +#include "mysys_priv.h" + +#ifdef _AIX + +/* + On AIX, at least with gcc 3.1, the expression + '(double) (ulonglong) var' doesn't always work for big unsigned + integers like '18446744073709551615'. The end result is that the + high bit is simply dropped. (probably bug in gcc optimizations) + Handling the conversion in a sub function seems to work. +*/ + + + +double my_ulonglong2double(unsigned long long nr) +{ + return (double) nr; +} +#endif /* _AIX */ diff --git a/externals/mysql/mysys/my_pread.c b/externals/mysql/mysys/my_pread.c new file mode 100644 index 00000000000..eaabcb1b728 --- /dev/null +++ b/externals/mysql/mysys/my_pread.c @@ -0,0 +1,206 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include "my_base.h" +#include +#include +#if defined (HAVE_PREAD) && !defined(_WIN32) +#include +#endif + + + +/* + Read a chunk of bytes from a file from a given position + + SYNOPSIOS + my_pread() + Filedes File decsriptor + Buffer Buffer to read data into + Count Number of bytes to read + offset Position to read from + MyFlags Flags + + NOTES + This differs from the normal pread() call in that we don't care + to set the position in the file back to the original position + if the system doesn't support pread(). + + RETURN + (size_t) -1 Error + # Number of bytes read +*/ + +size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, + myf MyFlags) +{ + size_t readbytes; + int error= 0; +#if !defined (HAVE_PREAD) && !defined (_WIN32) + int save_errno; +#endif + DBUG_ENTER("my_pread"); + DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d", + Filedes, (ulonglong)offset, Buffer, (ulong)Count, MyFlags)); + for (;;) + { + errno= 0; /* Linux, Windows don't reset this on EOF/success */ +#if !defined (HAVE_PREAD) && !defined (_WIN32) + pthread_mutex_lock(&my_file_info[Filedes].mutex); + readbytes= (uint) -1; + error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 || + (readbytes= read(Filedes, Buffer, Count)) != Count); + save_errno= errno; + pthread_mutex_unlock(&my_file_info[Filedes].mutex); + if (error) + errno= save_errno; +#else +#if defined(_WIN32) + readbytes= my_win_pread(Filedes, Buffer, Count, offset); +#else + readbytes= pread(Filedes, Buffer, Count, offset); +#endif + error= (readbytes != Count); +#endif + if(error) + { + my_errno= errno ? errno : -1; + if (errno == 0 || (readbytes != (size_t) -1 && + (MyFlags & (MY_NABP | MY_FNABP)))) + my_errno= HA_ERR_FILE_TOO_SHORT; + + DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d", + (int) readbytes, (uint) Count,Filedes,my_errno)); +#ifdef THREAD + if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR) + { + DBUG_PRINT("debug", ("my_pread() was interrupted and returned %d", + (int) readbytes)); + continue; /* Interrupted */ + } +#endif + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + if (readbytes == (size_t) -1) + my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG), + my_filename(Filedes),my_errno); + else if (MyFlags & (MY_NABP | MY_FNABP)) + my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG), + my_filename(Filedes),my_errno); + } + if (readbytes == (size_t) -1 || (MyFlags & (MY_FNABP | MY_NABP))) + DBUG_RETURN(MY_FILE_ERROR); /* Return with error */ + } + if (MyFlags & (MY_NABP | MY_FNABP)) + DBUG_RETURN(0); /* Read went ok; Return 0 */ + DBUG_RETURN(readbytes); /* purecov: inspected */ + } +} /* my_pread */ + + +/* + Write a chunk of bytes to a file at a given position + + SYNOPSIOS + my_pwrite() + Filedes File decsriptor + Buffer Buffer to write data from + Count Number of bytes to write + offset Position to write to + MyFlags Flags + + NOTES + This differs from the normal pwrite() call in that we don't care + to set the position in the file back to the original position + if the system doesn't support pwrite() + + RETURN + (size_t) -1 Error + # Number of bytes read +*/ + +size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count, + my_off_t offset, myf MyFlags) +{ + size_t writtenbytes, written; + uint errors; + + DBUG_ENTER("my_pwrite"); + DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d", + Filedes, offset, Buffer, (ulong)Count, MyFlags)); + errors= 0; + written= 0; + + for (;;) + { +#if !defined (HAVE_PREAD) && !defined (_WIN32) + int error; + writtenbytes= (size_t) -1; + pthread_mutex_lock(&my_file_info[Filedes].mutex); + error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 && + (writtenbytes= write(Filedes, Buffer, Count)) == Count); + pthread_mutex_unlock(&my_file_info[Filedes].mutex); + if (error) + break; +#elif defined (_WIN32) + writtenbytes= my_win_pwrite(Filedes, Buffer, Count, offset); +#else + writtenbytes= pwrite(Filedes, Buffer, Count, offset); +#endif + if(writtenbytes == Count) + break; + my_errno= errno; + if (writtenbytes != (size_t) -1) + { + written+= writtenbytes; + Buffer+= writtenbytes; + Count-= writtenbytes; + offset+= writtenbytes; + } + DBUG_PRINT("error",("Write only %u bytes", (uint) writtenbytes)); +#ifndef NO_BACKGROUND +#ifdef THREAD + if (my_thread_var->abort) + MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ +#endif + if ((my_errno == ENOSPC || my_errno == EDQUOT) && + (MyFlags & MY_WAIT_IF_FULL)) + { + wait_for_free_space(my_filename(Filedes), errors); + errors++; + continue; + } + if ((writtenbytes && writtenbytes != (size_t) -1) || my_errno == EINTR) + continue; /* Retry */ +#endif + if (MyFlags & (MY_NABP | MY_FNABP)) + { + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG), + my_filename(Filedes),my_errno); + } + DBUG_RETURN(MY_FILE_ERROR); /* Error on read */ + } + else + break; /* Return bytes written */ + } + DBUG_EXECUTE_IF("check", my_seek(Filedes, -1, SEEK_SET, MYF(0));); + if (MyFlags & (MY_NABP | MY_FNABP)) + DBUG_RETURN(0); /* Want only errors */ + DBUG_RETURN(writtenbytes+written); /* purecov: inspected */ +} /* my_pwrite */ diff --git a/externals/mysql/mysys/my_pthread.c b/externals/mysql/mysys/my_pthread.c new file mode 100644 index 00000000000..848397f38ab --- /dev/null +++ b/externals/mysql/mysys/my_pthread.c @@ -0,0 +1,501 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Functions to get threads more portable */ + +#define DONT_REMAP_PTHREAD_FUNCTIONS + +#include "mysys_priv.h" +#ifdef THREAD +#include +#include +#include + +#if (defined(__BSD__) || defined(_BSDI_VERSION)) +#define SCHED_POLICY SCHED_RR +#else +#define SCHED_POLICY SCHED_OTHER +#endif + +uint thd_lib_detected= 0; + +/* To allow use of pthread_getspecific with two arguments */ + +#ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC +#undef pthread_getspecific + +void *my_pthread_getspecific_imp(pthread_key_t key) +{ + void *value; + if (pthread_getspecific(key,(void *) &value)) + return 0; + return value; +} +#endif + +#ifdef __NETWARE__ +/* + Don't kill the LibC Reaper thread or the main thread +*/ +#include +#undef pthread_exit +void my_pthread_exit(void *status) +{ + NXThreadId_t tid; + NXContext_t ctx; + char name[NX_MAX_OBJECT_NAME_LEN+1] = ""; + + tid= NXThreadGetId(); + if (tid == NX_INVALID_THREAD_ID || !tid) + return; + if (NXThreadGetContext(tid, &ctx) || + NXContextGetName(ctx, name, sizeof(name)-1)) + return; + + /* + "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" + with a debug build of LibC the reaper can have different names + */ + if (!strindex(name, "\'s")) + pthread_exit(status); +} +#endif + +/* + Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 + (and DEC OSF/1 3.2 too) +*/ + +int my_pthread_create_detached=1; + +#if defined(HAVE_NONPOSIX_SIGWAIT) || defined(HAVE_DEC_3_2_THREADS) + +int my_sigwait(const sigset_t *set,int *sig) +{ + int signal=sigwait((sigset_t*) set); + if (signal < 0) + return errno; + *sig=signal; + return 0; +} +#endif + +/* localtime_r for SCO 3.2V4.2 */ + +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) + +extern pthread_mutex_t LOCK_localtime_r; + +#endif + +#if !defined(HAVE_LOCALTIME_R) +struct tm *localtime_r(const time_t *clock, struct tm *res) +{ + struct tm *tmp; + pthread_mutex_lock(&LOCK_localtime_r); + tmp=localtime(clock); + *res= *tmp; + pthread_mutex_unlock(&LOCK_localtime_r); + return res; +} +#endif + +#if !defined(HAVE_GMTIME_R) +/* + Reentrant version of standard gmtime() function. + Needed on some systems which don't implement it. +*/ + +struct tm *gmtime_r(const time_t *clock, struct tm *res) +{ + struct tm *tmp; + pthread_mutex_lock(&LOCK_localtime_r); + tmp= gmtime(clock); + *res= *tmp; + pthread_mutex_unlock(&LOCK_localtime_r); + return res; +} +#endif + +/**************************************************************************** +** Replacement of sigwait if the system doesn't have one (like BSDI 3.0) +** +** Note: +** This version of sigwait() is assumed to called in a loop so the signalmask +** is permanently modified to reflect the signal set. This is done to get +** a much faster implementation. +** +** This implementation isn't thread safe: It assumes that only one +** thread is using sigwait. +** +** If one later supplies a different signal mask, all old signals that +** was used before are unblocked and set to SIGDFL. +** +** Author: Gary Wisniewski , much modified by Monty +****************************************************************************/ + +#if !defined(HAVE_SIGWAIT) && !defined(sigwait) && !defined(__WIN__) && !defined(HAVE_rts_threads) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) + +#if !defined(DONT_USE_SIGSUSPEND) + +static sigset_t sigwait_set,rev_sigwait_set,px_recd; + +void px_handle_sig(int sig) +{ + sigaddset(&px_recd, sig); +} + + +void sigwait_setup(sigset_t *set) +{ + int i; + struct sigaction sact,sact1; + sigset_t unblock_mask; + + sact.sa_flags = 0; + sact.sa_handler = px_handle_sig; + memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */ + sigemptyset(&unblock_mask); + pthread_sigmask(SIG_UNBLOCK,(sigset_t*) 0,&rev_sigwait_set); + + for (i = 1; i <= sizeof(sigwait_set)*8; i++) + { + if (sigismember(set,i)) + { + sigdelset(&rev_sigwait_set,i); + if (!sigismember(&sigwait_set,i)) + sigaction(i, &sact, (struct sigaction*) 0); + } + else + { + sigdelset(&px_recd,i); /* Don't handle this */ + if (sigismember(&sigwait_set,i)) + { /* Remove the old handler */ + sigaddset(&unblock_mask,i); + sigdelset(&rev_sigwait_set,i); + sact1.sa_flags = 0; + sact1.sa_handler = SIG_DFL; + sigemptyset(&sact1.sa_mask); + sigaction(i, &sact1, 0); + } + } + } + memcpy_fixed(&sigwait_set,set,sizeof(*set)); + pthread_sigmask(SIG_BLOCK,(sigset_t*) set,(sigset_t*) 0); + pthread_sigmask(SIG_UNBLOCK,&unblock_mask,(sigset_t*) 0); +} + + +int sigwait(sigset_t *setp, int *sigp) +{ + if (memcmp(setp,&sigwait_set,sizeof(sigwait_set))) + sigwait_setup(setp); /* Init or change of set */ + + for (;;) + { + /* + This is a fast, not 100% portable implementation to find the signal. + Because the handler is blocked there should be at most 1 bit set, but + the specification on this is somewhat shady so we use a set instead a + single variable. + */ + + ulong *ptr= (ulong*) &px_recd; + ulong *end=ptr+sizeof(px_recd)/sizeof(ulong); + + for ( ; ptr != end ; ptr++) + { + if (*ptr) + { + ulong set= *ptr; + int found= (int) ((char*) ptr - (char*) &px_recd)*8+1; + while (!(set & 1)) + { + found++; + set>>=1; + } + *sigp=found; + sigdelset(&px_recd,found); + return 0; + } + } + sigsuspend(&rev_sigwait_set); + } + return 0; +} +#else /* !DONT_USE_SIGSUSPEND */ + +/**************************************************************************** +** Replacement of sigwait if the system doesn't have one (like BSDI 3.0) +** +** Note: +** This version of sigwait() is assumed to called in a loop so the signalmask +** is permanently modified to reflect the signal set. This is done to get +** a much faster implementation. +** +** This implementation uses a extra thread to handle the signals and one +** must always call sigwait() with the same signal mask! +** +** BSDI 3.0 NOTE: +** +** pthread_kill() doesn't work on a thread in a select() or sleep() loop? +** After adding the sleep to sigwait_thread, all signals are checked and +** delivered every second. This isn't that terrible performance vice, but +** someone should report this to BSDI and ask for a fix! +** Another problem is that when the sleep() ends, every select() in other +** threads are interrupted! +****************************************************************************/ + +static sigset_t pending_set; +static my_bool inited=0; +static pthread_cond_t COND_sigwait; +static pthread_mutex_t LOCK_sigwait; + + +void sigwait_handle_sig(int sig) +{ + pthread_mutex_lock(&LOCK_sigwait); + sigaddset(&pending_set, sig); + pthread_cond_signal(&COND_sigwait); /* inform sigwait() about signal */ + pthread_mutex_unlock(&LOCK_sigwait); +} + +void *sigwait_thread(void *set_arg) +{ + sigset_t *set=(sigset_t*) set_arg; + + int i; + struct sigaction sact; + sact.sa_flags = 0; + sact.sa_handler = sigwait_handle_sig; + memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */ + sigemptyset(&pending_set); + + for (i = 1; i <= sizeof(pending_set)*8; i++) + { + if (sigismember(set,i)) + { + sigaction(i, &sact, (struct sigaction*) 0); + } + } + /* Ensure that init_thr_alarm() is called */ + DBUG_ASSERT(thr_client_alarm); + sigaddset(set, thr_client_alarm); + pthread_sigmask(SIG_UNBLOCK,(sigset_t*) set,(sigset_t*) 0); + alarm_thread=pthread_self(); /* For thr_alarm */ + + for (;;) + { /* Wait for signals */ +#ifdef HAVE_NOT_BROKEN_SELECT + fd_set fd; + FD_ZERO(&fd); + select(0,&fd,0,0,0); +#else + sleep(1); /* Because of broken BSDI */ +#endif + } +} + + +int sigwait(sigset_t *setp, int *sigp) +{ + if (!inited) + { + pthread_attr_t thr_attr; + pthread_t sigwait_thread_id; + inited=1; + sigemptyset(&pending_set); + pthread_mutex_init(&LOCK_sigwait,MY_MUTEX_INIT_FAST); + pthread_cond_init(&COND_sigwait,NULL); + + pthread_attr_init(&thr_attr); + pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS); + pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED); + pthread_attr_setstacksize(&thr_attr,8196); + pthread_create(&sigwait_thread_id,&thr_attr,sigwait_thread,setp); + pthread_attr_destroy(&thr_attr); + } + + pthread_mutex_lock(&LOCK_sigwait); + for (;;) + { + ulong *ptr= (ulong*) &pending_set; + ulong *end=ptr+sizeof(pending_set)/sizeof(ulong); + + for ( ; ptr != end ; ptr++) + { + if (*ptr) + { + ulong set= *ptr; + int found= (int) ((char*) ptr - (char*) &pending_set)*8+1; + while (!(set & 1)) + { + found++; + set>>=1; + } + *sigp=found; + sigdelset(&pending_set,found); + pthread_mutex_unlock(&LOCK_sigwait); + return 0; + } + } + pthread_cond_wait(&COND_sigwait,&LOCK_sigwait); + } + return 0; +} + +#endif /* DONT_USE_SIGSUSPEND */ +#endif /* HAVE_SIGWAIT */ + + +/**************************************************************************** + The following functions fixes that all pthread functions should work + according to latest posix standard +****************************************************************************/ + +/* Undefined wrappers set my_pthread.h so that we call os functions */ +#undef pthread_mutex_init +#undef pthread_mutex_lock +#undef pthread_mutex_unlock +#undef pthread_mutex_destroy +#undef pthread_mutex_wait +#undef pthread_mutex_timedwait +#undef pthread_mutex_trylock +#undef pthread_mutex_t +#undef pthread_cond_init +#undef pthread_cond_wait +#undef pthread_cond_timedwait +#undef pthread_cond_t +#undef pthread_attr_getstacksize + +/***************************************************************************** +** Patches for AIX and DEC OSF/1 3.2 +*****************************************************************************/ + +#if defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT) + +#include + +int my_pthread_mutex_noposix_init(pthread_mutex_t *mp, + const pthread_mutexattr_t *attr) +{ + int error; + if (!attr) + error=pthread_mutex_init(mp,pthread_mutexattr_default); + else + error=pthread_mutex_init(mp,*attr); + return error; +} + +int my_pthread_cond_noposix_init(pthread_cond_t *mp, + const pthread_condattr_t *attr) +{ + int error; + if (!attr) + error=pthread_cond_init(mp,pthread_condattr_default); + else + error=pthread_cond_init(mp,*attr); + return error; +} + +#endif + + +/***************************************************************************** + Patches for HPUX + We need these because the pthread_mutex.. code returns -1 on error, + instead of the error code. + + Note that currently we only remap pthread_ functions used by MySQL. + If we are depending on the value for some other pthread_xxx functions, + this has to be added here. +****************************************************************************/ + +#if defined(HPUX10) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) + +int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + struct timespec *abstime) +{ + int error=pthread_cond_timedwait(cond, mutex, abstime); + if (error == -1) /* Safety if the lib is fixed */ + { + if (!(error=errno)) + error= ETIMEDOUT; /* Can happen on HPUX */ + } + if (error == EAGAIN) /* Correct errno to Posix */ + error= ETIMEDOUT; + return error; +} +#endif + +#if defined(HPUX10) + +void my_pthread_attr_getstacksize(pthread_attr_t *connection_attrib, + size_t *stack_size) +{ + *stack_size= pthread_attr_getstacksize(*connection_attrib); +} +#endif + + +#ifdef HAVE_POSIX1003_4a_MUTEX +/* + In HP-UX-10.20 and other old Posix 1003.4a Draft 4 implementations + pthread_mutex_trylock returns 1 on success, not 0 like + pthread_mutex_lock + + From the HP-UX-10.20 man page: + RETURN VALUES + If the function fails, errno may be set to one of the following + values: + Return | Error | Description + _______|__________|_________________________________________ + 1 | | Successful completion. + 0 | | The mutex is locked; therefore, it was + | | not acquired. + -1 | [EINVAL] | The value specified by mutex is invalid. + +*/ + +/* + Convert pthread_mutex_trylock to return values according to latest POSIX + + RETURN VALUES + 0 If we are able successfully lock the mutex. + EBUSY Mutex was locked by another thread + # Other error number returned by pthread_mutex_trylock() + (Not likely) +*/ + +int my_pthread_mutex_trylock(pthread_mutex_t *mutex) +{ + int error= pthread_mutex_trylock(mutex); + if (error == 1) + return 0; /* Got lock on mutex */ + if (error == 0) /* Someon else is locking mutex */ + return EBUSY; + if (error == -1) /* Safety if the lib is fixed */ + error= errno; /* Probably invalid parameter */ + return error; +} +#endif /* HAVE_POSIX1003_4a_MUTEX */ + +/* Some help functions */ + +int pthread_dummy(int ret) +{ + return ret; +} +#endif /* THREAD */ diff --git a/externals/mysql/mysys/my_quick.c b/externals/mysql/mysys/my_quick.c new file mode 100644 index 00000000000..b93e7e17224 --- /dev/null +++ b/externals/mysql/mysys/my_quick.c @@ -0,0 +1,81 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Quicker interface to read & write. Used with my_nosys.h */ + +#include "mysys_priv.h" +#include "my_nosys.h" + + +#ifdef _WIN32 +extern size_t my_win_read(File Filedes,uchar *Buffer,size_t Count); +#endif + +size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags) +{ + size_t readbytes; +#ifdef _WIN32 + readbytes= my_win_read(Filedes, Buffer, Count); +#else + readbytes= read(Filedes, Buffer, Count); +#endif + if(readbytes != Count) + { +#ifndef DBUG_OFF + if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR) + { + DBUG_PRINT("error", ("my_quick_read() was interrupted and returned %d" + ". This function does not retry the read!", + (int) readbytes)); + } +#endif + my_errno=errno; + return readbytes; + } + return (MyFlags & (MY_NABP | MY_FNABP)) ? 0 : readbytes; +} + + + +size_t my_quick_write(File Filedes, const uchar *Buffer, size_t Count) +{ +#ifdef _WIN32 + return my_win_write(Filedes, Buffer, Count); +#else + +#ifndef DBUG_OFF + size_t writtenbytes; +#endif + + if (( +#ifndef DBUG_OFF + writtenbytes = +#endif + (size_t) write(Filedes,Buffer,Count)) != Count) + { +#ifndef DBUG_OFF + if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR) + { + DBUG_PRINT("error", ("my_quick_write() was interrupted and returned %d" + ". This function does not retry the write!", + (int) writtenbytes)); + } +#endif + my_errno=errno; + return (size_t) -1; + } + return 0; +#endif +} diff --git a/externals/mysql/mysys/my_read.c b/externals/mysql/mysys/my_read.c new file mode 100644 index 00000000000..75f9dd64f1d --- /dev/null +++ b/externals/mysql/mysys/my_read.c @@ -0,0 +1,97 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include + +/* + Read a chunk of bytes from a file with retry's if needed + + The parameters are: + File descriptor + Buffer to hold at least Count bytes + Bytes to read + Flags on what to do on error + + Return: + -1 on error + 0 if flag has bits MY_NABP or MY_FNABP set + N number of bytes read. +*/ + +size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags) +{ + size_t readbytes, save_count; + DBUG_ENTER("my_read"); + DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d", + Filedes, Buffer, (ulong) Count, MyFlags)); + save_count= Count; + + for (;;) + { + errno= 0; /* Linux, Windows don't reset this on EOF/success */ +#ifdef _WIN32 + readbytes= my_win_read(Filedes, Buffer, Count); +#else + readbytes= read(Filedes, Buffer, Count); +#endif + + if (readbytes != Count) + { + my_errno= errno; + if (errno == 0 || (readbytes != (size_t) -1 && + (MyFlags & (MY_NABP | MY_FNABP)))) + my_errno= HA_ERR_FILE_TOO_SHORT; + DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d", + (int) readbytes, (ulong) Count, Filedes, + my_errno)); +#ifdef THREAD + if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) + { + DBUG_PRINT("debug", ("my_read() was interrupted and returned %ld", + (long) readbytes)); + continue; /* Interrupted */ + } +#endif + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + if (readbytes == (size_t) -1) + my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG), + my_filename(Filedes),my_errno); + else if (MyFlags & (MY_NABP | MY_FNABP)) + my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG), + my_filename(Filedes),my_errno); + } + if (readbytes == (size_t) -1 || + ((MyFlags & (MY_FNABP | MY_NABP)) && !(MyFlags & MY_FULL_IO))) + DBUG_RETURN(MY_FILE_ERROR); /* Return with error */ + if (readbytes != (size_t) -1 && (MyFlags & MY_FULL_IO)) + { + Buffer+= readbytes; + Count-= readbytes; + continue; + } + } + + if (MyFlags & (MY_NABP | MY_FNABP)) + readbytes= 0; /* Ok on read */ + else if (MyFlags & MY_FULL_IO) + readbytes= save_count; + break; + } + DBUG_RETURN(readbytes); +} /* my_read */ diff --git a/externals/mysql/mysys/my_realloc.c b/externals/mysql/mysys/my_realloc.c new file mode 100644 index 00000000000..d686f4cfb17 --- /dev/null +++ b/externals/mysql/mysys/my_realloc.c @@ -0,0 +1,75 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef SAFEMALLOC /* We don't need SAFEMALLOC here */ +#undef SAFEMALLOC +#endif + +#include "mysys_priv.h" +#include "mysys_err.h" + + /* My memory re allocator */ + +/** + @brief wrapper around realloc() + + @param oldpoint pointer to currently allocated area + @param size new size requested, must be >0 + @param my_flags flags + + @note if size==0 realloc() may return NULL; my_realloc() treats this as an + error which is not the intention of realloc() +*/ +void* my_realloc(void* oldpoint, size_t size, myf my_flags) +{ + void *point; + DBUG_ENTER("my_realloc"); + DBUG_PRINT("my",("ptr: %p size: %lu my_flags: %d", oldpoint, + (ulong) size, my_flags)); + + DBUG_ASSERT(size > 0); + if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) + DBUG_RETURN(my_malloc(size,my_flags)); +#ifdef USE_HALLOC + if (!(point = malloc(size))) + { + if (my_flags & MY_FREE_ON_ERROR) + my_free(oldpoint,my_flags); + if (my_flags & MY_HOLD_ON_ERROR) + DBUG_RETURN(oldpoint); + my_errno=errno; + if (my_flags & MY_FAE+MY_WME) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); + } + else + { + memcpy(point,oldpoint,size); + free(oldpoint); + } +#else + if ((point= (uchar*) realloc(oldpoint,size)) == NULL) + { + if (my_flags & MY_FREE_ON_ERROR) + my_free(oldpoint, my_flags); + if (my_flags & MY_HOLD_ON_ERROR) + DBUG_RETURN(oldpoint); + my_errno=errno; + if (my_flags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); + } +#endif + DBUG_PRINT("exit",("ptr: %p", point)); + DBUG_RETURN(point); +} /* my_realloc */ diff --git a/externals/mysql/mysys/my_redel.c b/externals/mysql/mysys/my_redel.c new file mode 100644 index 00000000000..4e482a34f88 --- /dev/null +++ b/externals/mysql/mysys/my_redel.c @@ -0,0 +1,120 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include +#include +#include "mysys_err.h" +#if defined(HAVE_UTIME_H) +#include +#elif defined(HAVE_SYS_UTIME_H) +#include +#elif !defined(HPUX10) +struct utimbuf { + time_t actime; + time_t modtime; +}; +#endif + + /* + Rename with copy stat form old file + Copy stats from old file to new file, deletes orginal and + changes new file name to old file name + + if MY_REDEL_MAKE_COPY is given, then the orginal file + is renamed to org_name-'current_time'.BAK + */ + +#define REDEL_EXT ".BAK" + +int my_redel(const char *org_name, const char *tmp_name, myf MyFlags) +{ + int error=1; + DBUG_ENTER("my_redel"); + DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d", + org_name,tmp_name,MyFlags)); + + if (my_copystat(org_name,tmp_name,MyFlags) < 0) + goto end; + if (MyFlags & MY_REDEL_MAKE_BACKUP) + { + char name_buff[FN_REFLEN+20]; + char ext[20]; + ext[0]='-'; + get_date(ext+1,2+4,(time_t) 0); + strmov(strend(ext),REDEL_EXT); + if (my_rename(org_name, fn_format(name_buff, org_name, "", ext, 2), + MyFlags)) + goto end; + } + else if (my_delete_allow_opened(org_name, MyFlags)) + goto end; + if (my_rename(tmp_name,org_name,MyFlags)) + goto end; + + error=0; +end: + DBUG_RETURN(error); +} /* my_redel */ + + + /* Copy stat from one file to another */ + /* Return -1 if can't get stat, 1 if wrong type of file */ + +int my_copystat(const char *from, const char *to, int MyFlags) +{ + struct stat statbuf; + + if (stat((char*) from, &statbuf)) + { + my_errno=errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),from,errno); + return -1; /* Can't get stat on input file */ + } + if ((statbuf.st_mode & S_IFMT) != S_IFREG) + return 1; + (void) chmod(to, statbuf.st_mode & 07777); /* Copy modes */ + +#if !defined(__WIN__) && !defined(__NETWARE__) + if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING) + { + if (MyFlags & MY_LINK_WARNING) + my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink); + } + (void) chown(to, statbuf.st_uid, statbuf.st_gid); /* Copy ownership */ +#endif /* !__WIN__ && !__NETWARE__ */ + +#ifndef VMS +#ifndef __ZTC__ + if (MyFlags & MY_COPYTIME) + { + struct utimbuf timep; + timep.actime = statbuf.st_atime; + timep.modtime = statbuf.st_mtime; + (void) utime((char*) to, &timep);/* Update last accessed and modified times */ + } +#else + if (MyFlags & MY_COPYTIME) + { + time_t time[2]; + time[0]= statbuf.st_atime; + time[1]= statbuf.st_mtime; + (void) utime((char*) to, time);/* Update last accessed and modified times */ + } +#endif +#endif + return 0; +} /* my_copystat */ diff --git a/externals/mysql/mysys/my_rename.c b/externals/mysql/mysys/my_rename.c new file mode 100644 index 00000000000..39e6056a9e4 --- /dev/null +++ b/externals/mysql/mysys/my_rename.c @@ -0,0 +1,79 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include +#include "mysys_err.h" +#include "m_string.h" +#undef my_rename + + /* On unix rename deletes to file if it exists */ + +int my_rename(const char *from, const char *to, myf MyFlags) +{ + int error = 0; + DBUG_ENTER("my_rename"); + DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); + +#if defined(HAVE_FILE_VERSIONS) + { /* Check that there isn't a old file */ + int save_errno; + MY_STAT my_stat_result; + save_errno=my_errno; + if (my_stat(to,&my_stat_result,MYF(0))) + { + my_errno=EEXIST; + error= -1; + if (MyFlags & MY_FAE+MY_WME) + my_error(EE_LINK, MYF(ME_BELL+ME_WAITTANG),from,to,my_errno); + DBUG_RETURN(error); + } + my_errno=save_errno; + } +#endif +#if defined(HAVE_RENAME) +#if defined(__WIN__) || defined(__NETWARE__) + /* + On windows we can't rename over an existing file: + Remove any conflicting files: + */ + (void) my_delete(to, MYF(0)); +#endif + if (rename(from,to)) +#else + if (link(from, to) || unlink(from)) +#endif + { + my_errno=errno; + error = -1; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_LINK, MYF(ME_BELL+ME_WAITTANG),from,to,my_errno); + } + else if (MyFlags & MY_SYNC_DIR) + { +#ifdef NEED_EXPLICIT_SYNC_DIR + /* do only the needed amount of syncs: */ + char dir_from[FN_REFLEN], dir_to[FN_REFLEN]; + size_t dir_from_length, dir_to_length; + dirname_part(dir_from, from, &dir_from_length); + dirname_part(dir_to, to, &dir_to_length); + if (my_sync_dir(dir_from, MyFlags) || + (strcmp(dir_from, dir_to) && + my_sync_dir(dir_to, MyFlags))) + error= -1; +#endif + } + DBUG_RETURN(error); +} /* my_rename */ diff --git a/externals/mysql/mysys/my_rnd.c b/externals/mysql/mysys/my_rnd.c new file mode 100644 index 00000000000..b7dca0f2afd --- /dev/null +++ b/externals/mysql/mysys/my_rnd.c @@ -0,0 +1,55 @@ +/* Copyright (C) 2007 MySQL AB & Michael Widenius + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include + +/* + Initialize random generator + + NOTES + MySQL's password checks depends on this, so don't do any changes + that changes the random numbers that are generated! +*/ + +void my_rnd_init(struct my_rnd_struct *rand_st, ulong seed1, ulong seed2) +{ +#ifdef HAVE_purify + bzero((char*) rand_st,sizeof(*rand_st)); /* Avoid UMC varnings */ +#endif + rand_st->max_value= 0x3FFFFFFFL; + rand_st->max_value_dbl=(double) rand_st->max_value; + rand_st->seed1=seed1%rand_st->max_value ; + rand_st->seed2=seed2%rand_st->max_value; +} + + +/* + Generate random number. + + SYNOPSIS + my_rnd() + rand_st INOUT Structure used for number generation + + RETURN VALUE + generated pseudo random number +*/ + +double my_rnd(struct my_rnd_struct *rand_st) +{ + rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) % rand_st->max_value; + rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) % rand_st->max_value; + return (((double) rand_st->seed1)/rand_st->max_value_dbl); +} diff --git a/externals/mysql/mysys/my_safehash.c b/externals/mysql/mysys/my_safehash.c new file mode 100644 index 00000000000..bad7e7c7025 --- /dev/null +++ b/externals/mysql/mysys/my_safehash.c @@ -0,0 +1,296 @@ +/* Copyright (C) 2003-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Handling of multiple key caches + + The idea is to have a thread safe hash on the table name, + with a default key cache value that is returned if the table name is not in + the cache. +*/ + +#include "mysys_priv.h" +#include +#include "my_safehash.h" + +/***************************************************************************** + General functions to handle SAFE_HASH objects. + + A SAFE_HASH object is used to store the hash, the mutex and default value + needed by the rest of the key cache code. + This is a separate struct to make it easy to later reuse the code for other + purposes + + All entries are linked in a list to allow us to traverse all elements + and delete selected ones. (HASH doesn't allow any easy ways to do this). +*****************************************************************************/ + + +/* + Free a SAFE_HASH_ENTRY + + SYNOPSIS + safe_hash_entry_free() + entry The entry which should be freed + + NOTE + This function is called by the hash object on delete +*/ + +static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry) +{ + DBUG_ENTER("safe_hash_entry_free"); + my_free((uchar*) entry, MYF(0)); + DBUG_VOID_RETURN; +} + + +/* + Get key and length for a SAFE_HASH_ENTRY + + SYNOPSIS + safe_hash_entry_get() + entry The entry for which the key should be returned + length Length of the key + + RETURN + # reference on the key +*/ + +static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, size_t *length, + my_bool not_used __attribute__((unused))) +{ + *length= entry->length; + return (uchar*) entry->key; +} + + +/* + Init a SAFE_HASH object + + SYNOPSIS + safe_hash_init() + hash safe_hash handler + elements Expected max number of elements + default_value default value + + NOTES + In case of error we set hash->default_value to 0 to allow one to call + safe_hash_free on an object that couldn't be initialized. + + RETURN + 0 OK + 1 error +*/ + +my_bool safe_hash_init(SAFE_HASH *hash, uint elements, + uchar *default_value) +{ + DBUG_ENTER("safe_hash_init"); + if (my_hash_init(&hash->hash, &my_charset_bin, elements, + 0, 0, (my_hash_get_key) safe_hash_entry_get, + (void (*)(void*)) safe_hash_entry_free, 0)) + { + hash->default_value= 0; + DBUG_RETURN(1); + } + my_rwlock_init(&hash->mutex, 0); + hash->default_value= default_value; + hash->root= 0; + DBUG_RETURN(0); +} + + +/* + Free a SAFE_HASH object + + SYNOPSIS + safe_hash_free() + hash Hash handle + + NOTES + This is safe to call on any object that has been sent to safe_hash_init() +*/ + +void safe_hash_free(SAFE_HASH *hash) +{ + /* + Test if safe_hash_init succeeded. This will also guard us against multiple + free calls. + */ + if (hash->default_value) + { + my_hash_free(&hash->hash); + rwlock_destroy(&hash->mutex); + hash->default_value=0; + } +} + + +/* + Return the value stored for a key or default value if no key + + SYNOPSIS + safe_hash_search() + hash Hash handle + key key (path to table etc..) + length Length of key + def Default value of data + + RETURN + # data associated with the key of default value if data was not found +*/ + +uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length, + uchar *def) +{ + uchar *result; + DBUG_ENTER("safe_hash_search"); + rw_rdlock(&hash->mutex); + result= my_hash_search(&hash->hash, key, length); + rw_unlock(&hash->mutex); + if (!result) + result= def; + else + result= ((SAFE_HASH_ENTRY*) result)->data; + DBUG_PRINT("exit",("data: %p", result)); + DBUG_RETURN(result); +} + + +/* + Associate a key with some data + + SYNOPSIS + safe_hash_set() + hash Hash handle + key key (path to table etc..) + length Length of key + data data to to associate with the data + + NOTES + This can be used both to insert a new entry and change an existing + entry. + If one associates a key with the default key cache, the key is deleted + + RETURN + 0 OK + 1 error (Can only be EOM). In this case my_message() is called. +*/ + +my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length, + uchar *data) +{ + SAFE_HASH_ENTRY *entry; + my_bool error= 0; + DBUG_ENTER("safe_hash_set"); + DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data)); + + rw_wrlock(&hash->mutex); + entry= (SAFE_HASH_ENTRY*) my_hash_search(&hash->hash, key, length); + + if (data == hash->default_value) + { + /* + The key is to be associated with the default entry. In this case + we can just delete the entry (if it existed) from the hash as a + search will return the default entry + */ + if (!entry) /* nothing to do */ + goto end; + /* unlink entry from list */ + if ((*entry->prev= entry->next)) + entry->next->prev= entry->prev; + my_hash_delete(&hash->hash, (uchar*) entry); + goto end; + } + if (entry) + { + /* Entry existed; Just change the pointer to point at the new data */ + entry->data= data; + } + else + { + if (!(entry= (SAFE_HASH_ENTRY *) my_malloc(sizeof(*entry) + length, + MYF(MY_WME)))) + { + error= 1; + goto end; + } + entry->key= (uchar*) (entry +1); + memcpy((char*) entry->key, (char*) key, length); + entry->length= length; + entry->data= data; + /* Link entry to list */ + if ((entry->next= hash->root)) + entry->next->prev= &entry->next; + entry->prev= &hash->root; + hash->root= entry; + if (my_hash_insert(&hash->hash, (uchar*) entry)) + { + /* This can only happen if hash got out of memory */ + my_free((char*) entry, MYF(0)); + error= 1; + goto end; + } + } + +end: + rw_unlock(&hash->mutex); + DBUG_RETURN(error); +} + + +/* + Change all entries with one data value to another data value + + SYNOPSIS + safe_hash_change() + hash Hash handle + old_data Old data + new_data Change all 'old_data' to this + + NOTES + We use the linked list to traverse all elements in the hash as + this allows us to delete elements in the case where 'new_data' is the + default value. +*/ + +void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data) +{ + SAFE_HASH_ENTRY *entry, *next; + DBUG_ENTER("safe_hash_change"); + + rw_wrlock(&hash->mutex); + + for (entry= hash->root ; entry ; entry= next) + { + next= entry->next; + if (entry->data == old_data) + { + if (new_data == hash->default_value) + { + if ((*entry->prev= entry->next)) + entry->next->prev= entry->prev; + my_hash_delete(&hash->hash, (uchar*) entry); + } + else + entry->data= new_data; + } + } + + rw_unlock(&hash->mutex); + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/mysys/my_safehash.h b/externals/mysql/mysys/my_safehash.h new file mode 100644 index 00000000000..110f4ed325a --- /dev/null +++ b/externals/mysql/mysys/my_safehash.h @@ -0,0 +1,57 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Handling of multiple key caches + + The idea is to have a thread safe hash on the table name, + with a default key cache value that is returned if the table name is not in + the cache. +*/ + +#include + +/* + Struct to store a key and pointer to object +*/ + +typedef struct st_safe_hash_entry +{ + uchar *key; + uint length; + uchar *data; + struct st_safe_hash_entry *next, **prev; +} SAFE_HASH_ENTRY; + + +typedef struct st_safe_hash_with_default +{ +#ifdef THREAD + rw_lock_t mutex; +#endif + HASH hash; + uchar *default_value; + SAFE_HASH_ENTRY *root; +} SAFE_HASH; + + +my_bool safe_hash_init(SAFE_HASH *hash, uint elements, + uchar *default_value); +void safe_hash_free(SAFE_HASH *hash); +uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length, + uchar *def); +my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length, + uchar *data); +void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data); diff --git a/externals/mysql/mysys/my_seek.c b/externals/mysql/mysys/my_seek.c new file mode 100644 index 00000000000..8502c259353 --- /dev/null +++ b/externals/mysql/mysys/my_seek.c @@ -0,0 +1,95 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +/* + Seek to a position in a file. + + ARGUMENTS + File fd The file descriptor + my_off_t pos The expected position (absolute or relative) + int whence A direction parameter and one of + {SEEK_SET, SEEK_CUR, SEEK_END} + myf MyFlags MY_THREADSAFE must be set in case my_seek may be mixed + with my_pread/my_pwrite calls and fd is shared among + threads. + + DESCRIPTION + The my_seek function is a wrapper around the system call lseek and + repositions the offset of the file descriptor fd to the argument + offset according to the directive whence as follows: + SEEK_SET The offset is set to offset bytes. + SEEK_CUR The offset is set to its current location plus offset bytes + SEEK_END The offset is set to the size of the file plus offset bytes + + RETURN VALUE + my_off_t newpos The new position in the file. + MY_FILEPOS_ERROR An error was encountered while performing + the seek. my_errno is set to indicate the + actual error. +*/ + +my_off_t my_seek(File fd, my_off_t pos, int whence, + myf MyFlags __attribute__((unused))) +{ + os_off_t newpos= -1; + DBUG_ENTER("my_seek"); + DBUG_PRINT("my",("fd: %d Pos: %llu Whence: %d MyFlags: %d", + fd, (ulonglong) pos, whence, MyFlags)); + DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */ + + /* + Make sure we are using a valid file descriptor! + */ + DBUG_ASSERT(fd != -1); +#if defined (_WIN32) + newpos= my_win_lseek(fd, pos, whence); +#else + newpos= lseek(fd, pos, whence); +#endif + if (newpos == (os_off_t) -1) + { + my_errno= errno; + DBUG_PRINT("error",("lseek: %llu errno: %d", (ulonglong) newpos,errno)); + DBUG_RETURN(MY_FILEPOS_ERROR); + } + if ((my_off_t) newpos != pos) + { + DBUG_PRINT("exit",("pos: %llu", (ulonglong) newpos)); + } + DBUG_RETURN((my_off_t) newpos); +} /* my_seek */ + + + /* Tell current position of file */ + /* ARGSUSED */ + +my_off_t my_tell(File fd, myf MyFlags __attribute__((unused))) +{ + os_off_t pos; + DBUG_ENTER("my_tell"); + DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags)); + DBUG_ASSERT(fd >= 0); +#if defined (HAVE_TELL) && !defined (_WIN32) + pos= tell(fd); +#else + pos= my_seek(fd, 0L, MY_SEEK_CUR,0); +#endif + if (pos == (os_off_t) -1) + my_errno= errno; + DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos)); + DBUG_RETURN((my_off_t) pos); +} /* my_tell */ diff --git a/externals/mysql/mysys/my_sleep.c b/externals/mysql/mysys/my_sleep.c new file mode 100644 index 00000000000..cb21c15a925 --- /dev/null +++ b/externals/mysql/mysys/my_sleep.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Wait a given number of microseconds */ + +#include "mysys_priv.h" +#include + +void my_sleep(ulong m_seconds) +{ +#ifdef __NETWARE__ + delay(m_seconds/1000+1); +#elif defined(__WIN__) + Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */ +#elif defined(HAVE_SELECT) + struct timeval t; + t.tv_sec= m_seconds / 1000000L; + t.tv_usec= m_seconds % 1000000L; + select(0,0,0,0,&t); /* sleep */ +#else + uint sec= (uint) ((m_seconds + 999999L) / 1000000L); + ulong start= (ulong) time((time_t*) 0); + while ((ulong) time((time_t*) 0) < start+sec); +#endif +} diff --git a/externals/mysql/mysys/my_static.c b/externals/mysql/mysys/my_static.c new file mode 100644 index 00000000000..57158772d9f --- /dev/null +++ b/externals/mysql/mysys/my_static.c @@ -0,0 +1,129 @@ +/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Static variables for mysys library. All definied here for easy making of + a shared library +*/ + +#include "mysys_priv.h" +#include "my_static.h" +#include "my_alarm.h" + +my_bool timed_mutexes= 0; + + /* from my_init */ +char * home_dir=0; +const char *my_progname= NULL, *my_progname_short= NULL; +char NEAR curr_dir[FN_REFLEN]= {0}, + NEAR home_dir_buff[FN_REFLEN]= {0}; +ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0; +ulong my_file_total_opened= 0; +int NEAR my_umask=0664, NEAR my_umask_dir=0777; +#ifndef THREAD +int NEAR my_errno=0; +#endif +struct st_my_file_info my_file_info_default[MY_NFILE]; +uint my_file_limit= MY_NFILE; +struct st_my_file_info *my_file_info= my_file_info_default; + + /* From mf_brkhant */ +int NEAR my_dont_interrupt=0; +volatile int _my_signals=0; +struct st_remember _my_sig_remember[MAX_SIGNALS]={{0,0}}; +#ifdef THREAD +sigset_t my_signals; /* signals blocked by mf_brkhant */ +#endif + + /* from mf_reccache.c */ +ulong my_default_record_cache_size=RECORD_CACHE_SIZE; + + /* from soundex.c */ + /* ABCDEFGHIJKLMNOPQRSTUVWXYZ */ + /* :::::::::::::::::::::::::: */ +const char *soundex_map= "01230120022455012623010202"; + + /* from my_malloc */ +USED_MEM* my_once_root_block=0; /* pointer to first block */ +uint my_once_extra=ONCE_ALLOC_INIT; /* Memory to alloc / block */ + + /* from my_largepage.c */ +#ifdef HAVE_LARGE_PAGES +my_bool my_use_large_pages= 0; +uint my_large_page_size= 0; +#endif + +/* ERROR INJECTION: Described in my_sys.h. */ +IF_DBUG(int my_malloc_error_inject= 0); + + /* from safe_malloc */ +uint sf_malloc_prehunc=0, /* If you have problem with core- */ + sf_malloc_endhunc=0, /* dump when malloc-message.... */ + /* set theese to 64 or 128 */ + sf_malloc_quick=0; /* set if no calls to sanity */ +size_t sf_malloc_cur_memory= 0L; /* Current memory usage */ +size_t sf_malloc_max_memory= 0L; /* Maximum memory usage */ +uint sf_malloc_count= 0; /* Number of times NEW() was called */ +uchar *sf_min_adress= (uchar*) ~(unsigned long) 0L, + *sf_max_adress= (uchar*) 0L; +/* Root of the linked list of struct st_irem */ +struct st_irem *sf_malloc_root = NULL; + + /* from my_alarm */ +int volatile my_have_got_alarm=0; /* declare variable to reset */ +ulong my_time_to_wait_for_lock=2; /* In seconds */ + + /* from errors.c */ +#ifdef SHARED_LIBRARY +char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */ +#endif +void (*my_abort_hook)(int) = (void(*)(int)) exit; +void (*error_handler_hook)(uint error,const char *str,myf MyFlags)= + my_message_no_curses; +void (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)= + my_message_no_curses; + +static const char *proc_info_dummy(void *a __attribute__((unused)), + const char *b __attribute__((unused)), + const char *c __attribute__((unused)), + const char *d __attribute__((unused)), + const unsigned int e __attribute__((unused))) +{ + return 0; +} + +/* this is to be able to call set_thd_proc_info from the C code */ +const char *(*proc_info_hook)(void *, const char *, const char *, const char *, + const unsigned int)= proc_info_dummy; + +#if defined(ENABLED_DEBUG_SYNC) +/** + Global pointer to be set if callback function is defined + (e.g. in mysqld). See sql/debug_sync.cc. +*/ +void (*debug_sync_C_callback_ptr)(const char *, size_t); +#endif /* defined(ENABLED_DEBUG_SYNC) */ + +#ifdef __WIN__ +/* from my_getsystime.c */ +ulonglong query_performance_frequency, query_performance_offset; +#endif + + /* How to disable options */ +my_bool NEAR my_disable_locking=0; +my_bool NEAR my_disable_async_io=0; +my_bool NEAR my_disable_flush_key_blocks=0; +my_bool NEAR my_disable_symlinks=0; +my_bool NEAR mysys_uses_curses=0; diff --git a/externals/mysql/mysys/my_static.h b/externals/mysql/mysys/my_static.h new file mode 100644 index 00000000000..90168b099a8 --- /dev/null +++ b/externals/mysql/mysys/my_static.h @@ -0,0 +1,74 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Static variables for mysys library. All definied here for easy making of + a shared library +*/ + +C_MODE_START +#include + +#define MAX_SIGNALS 10 /* Max signals under a dont-allow */ +#define MIN_KEYBLOCK (min(IO_SIZE,1024)) +#define MAX_KEYBLOCK 8192 /* Max keyblocklength == 8*IO_SIZE */ +#define MAX_BLOCK_TYPES MAX_KEYBLOCK/MIN_KEYBLOCK + +struct st_remember { + int number; + sig_handler (*func)(int number); +}; + +/* + Structure that stores information of a allocated memory block + The data is at &struct_adr+sizeof(ALIGN_SIZE(sizeof(struct irem))) + The lspecialvalue is at the previous 4 bytes from this, which may not + necessarily be in the struct if the struct size isn't aligned at a 8 byte + boundary. +*/ + +struct st_irem +{ + struct st_irem *next; /* Linked list of structures */ + struct st_irem *prev; /* Other link */ + char *filename; /* File in which memory was new'ed */ + size_t datasize; /* Size requested */ + uint32 linenum; /* Line number in above file */ + uint32 SpecialValue; /* Underrun marker value */ +}; + + +extern char NEAR curr_dir[FN_REFLEN],NEAR home_dir_buff[FN_REFLEN]; + +extern volatile int _my_signals; +extern struct st_remember _my_sig_remember[MAX_SIGNALS]; + +extern const char *soundex_map; + +extern USED_MEM* my_once_root_block; +extern uint my_once_extra; + +extern uchar *sf_min_adress,*sf_max_adress; +extern uint sf_malloc_count; +extern struct st_irem *sf_malloc_root; + +extern struct st_my_file_info my_file_info_default[MY_NFILE]; + +extern ulonglong query_performance_frequency, query_performance_offset; + +#if defined(THREAD) && !defined(__WIN__) +extern sigset_t my_signals; /* signals blocked by mf_brkhant */ +#endif +C_MODE_END diff --git a/externals/mysql/mysys/my_symlink.c b/externals/mysql/mysys/my_symlink.c new file mode 100644 index 00000000000..258e227bb7b --- /dev/null +++ b/externals/mysql/mysys/my_symlink.c @@ -0,0 +1,153 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include +#include +#ifdef HAVE_REALPATH +#include +#include +#endif + +/* + Reads the content of a symbolic link + If the file is not a symbolic link, return the original file name in to. + + RETURN + 0 If filename was a symlink, (to will be set to value of symlink) + 1 If filename was a normal file (to will be set to filename) + -1 on error. +*/ + +int my_readlink(char *to, const char *filename, myf MyFlags) +{ +#ifndef HAVE_READLINK + strmov(to,filename); + return 1; +#else + int result=0; + int length; + DBUG_ENTER("my_readlink"); + + if ((length=readlink(filename, to, FN_REFLEN-1)) < 0) + { + /* Don't give an error if this wasn't a symlink */ + if ((my_errno=errno) == EINVAL) + { + result= 1; + strmov(to,filename); + } + else + { + if (MyFlags & MY_WME) + my_error(EE_CANT_READLINK, MYF(0), filename, errno); + result= -1; + } + } + else + to[length]=0; + DBUG_PRINT("exit" ,("result: %d", result)); + DBUG_RETURN(result); +#endif /* HAVE_READLINK */ +} + + +/* Create a symbolic link */ + +int my_symlink(const char *content, const char *linkname, myf MyFlags) +{ +#ifndef HAVE_READLINK + return 0; +#else + int result; + DBUG_ENTER("my_symlink"); + DBUG_PRINT("enter",("content: %s linkname: %s", content, linkname)); + + result= 0; + if (symlink(content, linkname)) + { + result= -1; + my_errno=errno; + if (MyFlags & MY_WME) + my_error(EE_CANT_SYMLINK, MYF(0), linkname, content, errno); + } + else if ((MyFlags & MY_SYNC_DIR) && my_sync_dir_by_file(linkname, MyFlags)) + result= -1; + DBUG_RETURN(result); +#endif /* HAVE_READLINK */ +} + +#if defined(SCO) +#define BUFF_LEN 4097 +#elif defined(MAXPATHLEN) +#define BUFF_LEN MAXPATHLEN +#else +#define BUFF_LEN FN_LEN +#endif + + +int my_is_symlink(const char *filename __attribute__((unused))) +{ +#if defined (HAVE_LSTAT) && defined (S_ISLNK) + struct stat stat_buff; + return !lstat(filename, &stat_buff) && S_ISLNK(stat_buff.st_mode); +#elif defined (_WIN32) + DWORD dwAttr = GetFileAttributes(filename); + return (dwAttr != INVALID_FILE_ATTRIBUTES) && + (dwAttr & FILE_ATTRIBUTE_REPARSE_POINT); +#else /* No symlinks */ + return 0; +#endif +} + + +/* + Resolve all symbolic links in path + 'to' may be equal to 'filename' +*/ + +int my_realpath(char *to, const char *filename, + myf MyFlags __attribute__((unused))) +{ +#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH) + int result=0; + char buff[BUFF_LEN]; + char *ptr; + DBUG_ENTER("my_realpath"); + + DBUG_PRINT("info",("executing realpath")); + if ((ptr=realpath(filename,buff))) + strmake(to,ptr,FN_REFLEN-1); + else + { + /* + Realpath didn't work; Use my_load_path() which is a poor substitute + original name but will at least be able to resolve paths that starts + with '.'. + */ + DBUG_PRINT("error",("realpath failed with errno: %d", errno)); + my_errno=errno; + if (MyFlags & MY_WME) + my_error(EE_REALPATH, MYF(0), filename, my_errno); + my_load_path(to, filename, NullS); + result= -1; + } + DBUG_RETURN(result); +#else + my_load_path(to, filename, NullS); + return 0; +#endif +} diff --git a/externals/mysql/mysys/my_symlink2.c b/externals/mysql/mysys/my_symlink2.c new file mode 100644 index 00000000000..7c3ddbb911c --- /dev/null +++ b/externals/mysql/mysys/my_symlink2.c @@ -0,0 +1,183 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Advanced symlink handling. + This is used in MyISAM to let users symlinks tables to different disk. + The main idea with these functions is to automaticly create, delete and + rename files and symlinks like they would be one unit. +*/ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + +File my_create_with_symlink(const char *linkname, const char *filename, + int createflags, int access_flags, myf MyFlags) +{ + File file; + int tmp_errno; + /* Test if we should create a link */ + int create_link; + char abs_linkname[FN_REFLEN]; + DBUG_ENTER("my_create_with_symlink"); + DBUG_PRINT("enter", ("linkname: %s filename: %s", + linkname ? linkname : "(null)", + filename ? filename : "(null)")); + + if (my_disable_symlinks) + { + DBUG_PRINT("info", ("Symlinks disabled")); + /* Create only the file, not the link and file */ + create_link= 0; + if (linkname) + filename= linkname; + } + else + { + if (linkname) + my_realpath(abs_linkname, linkname, MYF(0)); + create_link= (linkname && strcmp(abs_linkname,filename)); + } + + if (!(MyFlags & MY_DELETE_OLD)) + { + if (!access(filename,F_OK)) + { + my_errno= errno= EEXIST; + my_error(EE_CANTCREATEFILE, MYF(0), filename, EEXIST); + DBUG_RETURN(-1); + } + if (create_link && !access(linkname,F_OK)) + { + my_errno= errno= EEXIST; + my_error(EE_CANTCREATEFILE, MYF(0), linkname, EEXIST); + DBUG_RETURN(-1); + } + } + + if ((file=my_create(filename, createflags, access_flags, MyFlags)) >= 0) + { + if (create_link) + { + /* Delete old link/file */ + if (MyFlags & MY_DELETE_OLD) + my_delete(linkname, MYF(0)); + /* Create link */ + if (my_symlink(filename, linkname, MyFlags)) + { + /* Fail, remove everything we have done */ + tmp_errno=my_errno; + my_close(file,MYF(0)); + my_delete(filename, MYF(0)); + file= -1; + my_errno=tmp_errno; + } + } + } + DBUG_RETURN(file); +} + +/* + If the file was a symlink, delete both symlink and the file which the + symlink pointed to. +*/ + +int my_delete_with_symlink(const char *name, myf MyFlags) +{ + char link_name[FN_REFLEN]; + int was_symlink= (!my_disable_symlinks && + !my_readlink(link_name, name, MYF(0))); + int result; + DBUG_ENTER("my_delete_with_symlink"); + + if (!(result=my_delete(name, MyFlags))) + { + if (was_symlink) + result=my_delete(link_name, MyFlags); + } + DBUG_RETURN(result); +} + +/* + If the file is a normal file, just rename it. + If the file is a symlink: + - Create a new file with the name 'to' that points at + symlink_dir/basename(to) + - Rename the symlinked file to symlink_dir/basename(to) + - Delete 'from' + If something goes wrong, restore everything. +*/ + +int my_rename_with_symlink(const char *from, const char *to, myf MyFlags) +{ +#ifndef HAVE_READLINK + return my_rename(from, to, MyFlags); +#else + char link_name[FN_REFLEN], tmp_name[FN_REFLEN]; + int was_symlink= (!my_disable_symlinks && + !my_readlink(link_name, from, MYF(0))); + int result=0; + int name_is_different; + DBUG_ENTER("my_rename_with_symlink"); + + if (!was_symlink) + DBUG_RETURN(my_rename(from, to, MyFlags)); + + /* Change filename that symlink pointed to */ + strmov(tmp_name, to); + fn_same(tmp_name,link_name,1); /* Copy dir */ + name_is_different= strcmp(link_name, tmp_name); + if (name_is_different && !access(tmp_name, F_OK)) + { + my_errno= EEXIST; + if (MyFlags & MY_WME) + my_error(EE_CANTCREATEFILE, MYF(0), tmp_name, EEXIST); + DBUG_RETURN(1); + } + + /* Create new symlink */ + if (my_symlink(tmp_name, to, MyFlags)) + DBUG_RETURN(1); + + /* + Rename symlinked file if the base name didn't change. + This can happen if you use this function where 'from' and 'to' has + the same basename and different directories. + */ + + if (name_is_different && my_rename(link_name, tmp_name, MyFlags)) + { + int save_errno=my_errno; + my_delete(to, MyFlags); /* Remove created symlink */ + my_errno=save_errno; + DBUG_RETURN(1); + } + + /* Remove original symlink */ + if (my_delete(from, MyFlags)) + { + int save_errno=my_errno; + /* Remove created link */ + my_delete(to, MyFlags); + /* Rename file back */ + if (strcmp(link_name, tmp_name)) + (void) my_rename(tmp_name, link_name, MyFlags); + my_errno=save_errno; + result= 1; + } + DBUG_RETURN(result); +#endif /* HAVE_READLINK */ +} diff --git a/externals/mysql/mysys/my_sync.c b/externals/mysql/mysys/my_sync.c new file mode 100644 index 00000000000..4d5b96704a5 --- /dev/null +++ b/externals/mysql/mysys/my_sync.c @@ -0,0 +1,155 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + +/* + Sync data in file to disk + + SYNOPSIS + my_sync() + fd File descritor to sync + my_flags Flags (now only MY_WME is supported) + + NOTE + If file system supports its, only file data is synced, not inode data. + + MY_IGNORE_BADFD is useful when fd is "volatile" - not protected by a + mutex. In this case by the time of fsync(), fd may be already closed by + another thread, or even reassigned to a different file. With this flag - + MY_IGNORE_BADFD - such a situation will not be considered an error. + (which is correct behaviour, if we know that the other thread synced the + file before closing) + + RETURN + 0 ok + -1 error +*/ + +int my_sync(File fd, myf my_flags) +{ + int res; + DBUG_ENTER("my_sync"); + DBUG_PRINT("my",("fd: %d my_flags: %d", fd, my_flags)); + + do + { +#if defined(F_FULLFSYNC) + /* + In Mac OS X >= 10.3 this call is safer than fsync() (it forces the + disk's cache and guarantees ordered writes). + */ + if (!(res= fcntl(fd, F_FULLFSYNC, 0))) + break; /* ok */ + /* Some file systems don't support F_FULLFSYNC and fail above: */ + DBUG_PRINT("info",("fcntl(F_FULLFSYNC) failed, falling back")); +#endif +#if defined(HAVE_FDATASYNC) + res= fdatasync(fd); +#elif defined(HAVE_FSYNC) + res= fsync(fd); +#elif defined(_WIN32) + res= my_win_fsync(fd); +#else +#error Cannot find a way to sync a file, durability in danger + res= 0; /* No sync (strange OS) */ +#endif + } while (res == -1 && errno == EINTR); + + if (res) + { + int er= errno; + if (!(my_errno= er)) + my_errno= -1; /* Unknown error */ + if ((my_flags & MY_IGNORE_BADFD) && + (er == EBADF || er == EINVAL || er == EROFS)) + { + DBUG_PRINT("info", ("ignoring errno %d", er)); + res= 0; + } + else if (my_flags & MY_WME) + my_error(EE_SYNC, MYF(ME_BELL+ME_WAITTANG), my_filename(fd), my_errno); + } + DBUG_RETURN(res); +} /* my_sync */ + + +static const char cur_dir_name[]= {FN_CURLIB, 0}; +/* + Force directory information to disk. + + SYNOPSIS + my_sync_dir() + dir_name the name of the directory + my_flags flags (MY_WME etc) + + RETURN + 0 if ok, !=0 if error +*/ +int my_sync_dir(const char *dir_name, myf my_flags) +{ +#ifdef NEED_EXPLICIT_SYNC_DIR + DBUG_ENTER("my_sync_dir"); + DBUG_PRINT("my",("Dir: '%s' my_flags: %d", dir_name, my_flags)); + File dir_fd; + int res= 0; + const char *correct_dir_name; + /* Sometimes the path does not contain an explicit directory */ + correct_dir_name= (dir_name[0] == 0) ? cur_dir_name : dir_name; + /* + Syncing a dir may give EINVAL on tmpfs on Linux, which is ok. + EIO on the other hand is very important. Hence MY_IGNORE_BADFD. + */ + if ((dir_fd= my_open(correct_dir_name, O_RDONLY, MYF(my_flags))) >= 0) + { + if (my_sync(dir_fd, MYF(my_flags | MY_IGNORE_BADFD))) + res= 2; + if (my_close(dir_fd, MYF(my_flags))) + res= 3; + } + else + res= 1; + DBUG_RETURN(res); +#else + return 0; +#endif +} + + +/* + Force directory information to disk. + + SYNOPSIS + my_sync_dir_by_file() + file_name the name of a file in the directory + my_flags flags (MY_WME etc) + + RETURN + 0 if ok, !=0 if error +*/ +int my_sync_dir_by_file(const char *file_name, myf my_flags) +{ +#ifdef NEED_EXPLICIT_SYNC_DIR + char dir_name[FN_REFLEN]; + size_t dir_name_length; + dirname_part(dir_name, file_name, &dir_name_length); + return my_sync_dir(dir_name, my_flags); +#else + return 0; +#endif +} + diff --git a/externals/mysql/mysys/my_thr_init.c b/externals/mysql/mysys/my_thr_init.c new file mode 100644 index 00000000000..ec56e20e793 --- /dev/null +++ b/externals/mysql/mysys/my_thr_init.c @@ -0,0 +1,524 @@ +/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file + Functions for initialization and allocation of all mysys & debug + thread variables. +*/ + +#include "mysys_priv.h" +#include +#include + +#ifdef THREAD +pthread_key(struct st_my_thread_var*, THR_KEY_mysys); +pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open, + THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_heap, THR_LOCK_net, + THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time; +/** For insert/delete in the list of MyISAM open tables */ +pthread_mutex_t THR_LOCK_myisam; +/** For writing to the MyISAM logs */ +pthread_mutex_t THR_LOCK_myisam_log; +pthread_cond_t THR_COND_threads; +uint THR_thread_count= 0; +uint my_thread_end_wait_time= 5; +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) +pthread_mutex_t LOCK_localtime_r; +#endif +#ifndef HAVE_GETHOSTBYNAME_R +pthread_mutex_t LOCK_gethostbyname_r; +#endif +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +pthread_mutexattr_t my_fast_mutexattr; +#endif +#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP +pthread_mutexattr_t my_errorcheck_mutexattr; +#endif +#ifdef _MSC_VER +static void install_sigabrt_handler(); +#endif +#ifdef TARGET_OS_LINUX + +/* + Dummy thread spawned in my_thread_global_init() below to avoid + race conditions in NPTL pthread_exit code. +*/ + +static pthread_handler_t +nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) +{ + /* Do nothing! */ + pthread_exit(0); + return 0; +} + +#endif /* TARGET_OS_LINUX */ + + + +/** + Initialize thread attributes. +*/ + +void my_threadattr_global_init(void) +{ +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP + /* + Set mutex type to "fast" a.k.a "adaptive" + + In this case the thread may steal the mutex from some other thread + that is waiting for the same mutex. This will save us some + context switches but may cause a thread to 'starve forever' while + waiting for the mutex (not likely if the code within the mutex is + short). + */ + pthread_mutexattr_init(&my_fast_mutexattr); /* ?= MY_MUTEX_INIT_FAST */ + pthread_mutexattr_settype(&my_fast_mutexattr, + PTHREAD_MUTEX_ADAPTIVE_NP); +#endif +#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP + /* + Set mutex type to "errorcheck" + */ + pthread_mutexattr_init(&my_errorcheck_mutexattr); + pthread_mutexattr_settype(&my_errorcheck_mutexattr, + PTHREAD_MUTEX_ERRORCHECK); +#endif +} + + +static uint get_thread_lib(void); + +/* + initialize thread environment + + SYNOPSIS + my_thread_global_init() + + RETURN + 0 ok + 1 error (Couldn't create THR_KEY_mysys) +*/ + +my_bool my_thread_global_init(void) +{ + int pth_ret; + thd_lib_detected= get_thread_lib(); + + if ((pth_ret= pthread_key_create(&THR_KEY_mysys, NULL)) != 0) + { + fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret); + return 1; + } + +#ifdef TARGET_OS_LINUX + /* + BUG#24507: Race conditions inside current NPTL pthread_exit() + implementation. + + To avoid a possible segmentation fault during concurrent + executions of pthread_exit(), a dummy thread is spawned which + initializes internal variables of pthread lib. See bug description + for a full explanation. + + TODO: Remove this code when fixed versions of glibc6 are in common + use. + */ + if (thd_lib_detected == THD_LIB_NPTL) + { + pthread_t dummy_thread; + pthread_attr_t dummy_thread_attr; + + pthread_attr_init(&dummy_thread_attr); + pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_DETACHED); + + pthread_create(&dummy_thread,&dummy_thread_attr, + nptl_pthread_exit_hack_handler, NULL); + } +#endif /* TARGET_OS_LINUX */ + + /* Mutex used by my_thread_init() and after my_thread_destroy_mutex() */ + my_pthread_mutex_init(&THR_LOCK_threads, MY_MUTEX_INIT_FAST, + "THR_LOCK_threads", MYF_NO_DEADLOCK_DETECTION); + my_pthread_mutex_init(&THR_LOCK_malloc, MY_MUTEX_INIT_FAST, + "THR_LOCK_malloc", MYF_NO_DEADLOCK_DETECTION); + + if (my_thread_init()) + return 1; + + + /* Mutex uses by mysys */ + pthread_mutex_init(&THR_LOCK_open,MY_MUTEX_INIT_FAST); + pthread_mutex_init(&THR_LOCK_lock,MY_MUTEX_INIT_FAST); + pthread_mutex_init(&THR_LOCK_isam,MY_MUTEX_INIT_SLOW); + pthread_mutex_init(&THR_LOCK_myisam,MY_MUTEX_INIT_SLOW); + pthread_mutex_init(&THR_LOCK_myisam_log,MY_MUTEX_INIT_SLOW); + pthread_mutex_init(&THR_LOCK_heap,MY_MUTEX_INIT_FAST); + pthread_mutex_init(&THR_LOCK_net,MY_MUTEX_INIT_FAST); + pthread_mutex_init(&THR_LOCK_charset,MY_MUTEX_INIT_FAST); + pthread_mutex_init(&THR_LOCK_time,MY_MUTEX_INIT_FAST); + pthread_cond_init(&THR_COND_threads, NULL); + +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) + pthread_mutex_init(&LOCK_localtime_r,MY_MUTEX_INIT_SLOW); +#endif +#ifndef HAVE_GETHOSTBYNAME_R + pthread_mutex_init(&LOCK_gethostbyname_r,MY_MUTEX_INIT_SLOW); +#endif + return 0; +} + + +/** + Wait for all threads in system to die + @fn my_wait_for_other_threads_to_die() + @param number_of_threads Wait until this number of threads + + @retval 0 Less or equal to number_of_threads left + @retval 1 Wait failed +*/ + +my_bool my_wait_for_other_threads_to_die(uint number_of_threads) +{ + struct timespec abstime; + my_bool all_threads_killed= 1; + + set_timespec(abstime, my_thread_end_wait_time); + pthread_mutex_lock(&THR_LOCK_threads); + while (THR_thread_count > number_of_threads) + { + int error= pthread_cond_timedwait(&THR_COND_threads, &THR_LOCK_threads, + &abstime); + if (error == ETIMEDOUT || error == ETIME) + { + all_threads_killed= 0; + break; + } + } + pthread_mutex_unlock(&THR_LOCK_threads); + return all_threads_killed; +} + + +/** + End the mysys thread system. Called when ending the last thread +*/ + + +void my_thread_global_end(void) +{ + my_bool all_threads_killed; + + if (!(all_threads_killed= my_wait_for_other_threads_to_die(0))) + { +#ifdef HAVE_PTHREAD_KILL + /* + We shouldn't give an error here, because if we don't have + pthread_kill(), programs like mysqld can't ensure that all threads + are killed when we enter here. + */ + if (THR_thread_count) + fprintf(stderr, + "Error in my_thread_global_end(): %d threads didn't exit\n", + THR_thread_count); +#endif + } + + pthread_key_delete(THR_KEY_mysys); +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP + pthread_mutexattr_destroy(&my_fast_mutexattr); +#endif +#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP + pthread_mutexattr_destroy(&my_errorcheck_mutexattr); +#endif + if (all_threads_killed) + { + pthread_mutex_destroy(&THR_LOCK_threads); + pthread_cond_destroy(&THR_COND_threads); + pthread_mutex_destroy(&THR_LOCK_malloc); + } +} + +/* Free all mutex used by mysys */ + +void my_thread_destroy_mutex(void) +{ + struct st_my_thread_var *tmp; + tmp= my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys); +#ifdef SAFE_MUTEX + if (tmp) + { + safe_mutex_free_deadlock_data(&tmp->mutex); + } +#endif + + pthread_mutex_destroy(&THR_LOCK_open); + pthread_mutex_destroy(&THR_LOCK_lock); + pthread_mutex_destroy(&THR_LOCK_isam); + pthread_mutex_destroy(&THR_LOCK_myisam); + pthread_mutex_destroy(&THR_LOCK_myisam_log); + pthread_mutex_destroy(&THR_LOCK_heap); + pthread_mutex_destroy(&THR_LOCK_net); + pthread_mutex_destroy(&THR_LOCK_time); + pthread_mutex_destroy(&THR_LOCK_charset); +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) + pthread_mutex_destroy(&LOCK_localtime_r); +#endif +#ifndef HAVE_GETHOSTBYNAME_R + pthread_mutex_destroy(&LOCK_gethostbyname_r); +#endif +} + +static my_thread_id thread_id= 0; + +/* + Allocate thread specific memory for the thread, used by mysys and dbug + + SYNOPSIS + my_thread_init() + + NOTES + We can't use mutex_locks here if we are using windows as + we may have compiled the program with SAFE_MUTEX, in which + case the checking of mutex_locks will not work until + the pthread_self thread specific variable is initialized. + + This function may called multiple times for a thread, for example + if one uses my_init() followed by mysql_server_init(). + + RETURN + 0 ok + 1 Fatal error; mysys/dbug functions can't be used +*/ + +my_bool my_thread_init(void) +{ + struct st_my_thread_var *tmp; + my_bool error=0; + +#ifdef EXTRA_DEBUG_THREADS + fprintf(stderr,"my_thread_init(): thread_id: 0x%lx\n", + (ulong) pthread_self()); +#endif + + if (my_pthread_getspecific(struct st_my_thread_var *,THR_KEY_mysys)) + { +#ifdef EXTRA_DEBUG_THREADS + fprintf(stderr,"my_thread_init() called more than once in thread 0x%lx\n", + (long) pthread_self()); +#endif + goto end; + } + +#ifdef _MSC_VER + install_sigabrt_handler(); +#endif + + if (!(tmp= (struct st_my_thread_var *) calloc(1, sizeof(*tmp)))) + { + error= 1; + goto end; + } + pthread_setspecific(THR_KEY_mysys,tmp); + tmp->pthread_self= pthread_self(); + my_pthread_mutex_init(&tmp->mutex, MY_MUTEX_INIT_FAST, "mysys_var->mutex", + 0); + pthread_cond_init(&tmp->suspend, NULL); + + tmp->stack_ends_here= (char*)&tmp + + STACK_DIRECTION * (long)my_thread_stack_size; + + pthread_mutex_lock(&THR_LOCK_threads); + tmp->id= ++thread_id; + ++THR_thread_count; + pthread_mutex_unlock(&THR_LOCK_threads); + tmp->init= 1; +#ifndef DBUG_OFF + /* Generate unique name for thread */ + (void) my_thread_name(); +#endif + +end: + return error; +} + + +/* + Deallocate memory used by the thread for book-keeping + + SYNOPSIS + my_thread_end() + + NOTE + This may be called multiple times for a thread. + This happens for example when one calls 'mysql_server_init()' + mysql_server_end() and then ends with a mysql_end(). +*/ + +void my_thread_end(void) +{ + struct st_my_thread_var *tmp; + tmp= my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys); + +#ifdef EXTRA_DEBUG_THREADS + fprintf(stderr,"my_thread_end(): tmp: 0x%lx pthread_self: 0x%lx thread_id: %ld\n", + (long) tmp, (long) pthread_self(), tmp ? (long) tmp->id : 0L); +#endif + if (tmp && tmp->init) + { + +#if !defined(__bsdi__) && !defined(__OpenBSD__) + /* bsdi and openbsd 3.5 dumps core here */ + pthread_cond_destroy(&tmp->suspend); +#endif + pthread_mutex_destroy(&tmp->mutex); + +#if !defined(DBUG_OFF) + /* tmp->dbug is allocated inside DBUG library */ + if (tmp->dbug) + { + /* + Frees memory allocated in SET DEBUG=...; does nothing if there were no + SET DEBUG in a thread. + */ + DBUG_POP(); + free(tmp->dbug); + tmp->dbug=0; + } +#endif +#ifndef DBUG_OFF + /* To find bugs when accessing unallocated data */ + bfill(tmp, sizeof(tmp), 0x8F); +#endif + free(tmp); + pthread_setspecific(THR_KEY_mysys,0); + /* + Decrement counter for number of running threads. We are using this + in my_thread_global_end() to wait until all threads have called + my_thread_end and thus freed all memory they have allocated in + my_thread_init() and DBUG_xxxx + */ + pthread_mutex_lock(&THR_LOCK_threads); + DBUG_ASSERT(THR_thread_count != 0); + if (--THR_thread_count == 0) + pthread_cond_signal(&THR_COND_threads); + pthread_mutex_unlock(&THR_LOCK_threads); + } + else + { + pthread_setspecific(THR_KEY_mysys,0); + } +} + +struct st_my_thread_var *_my_thread_var(void) +{ + return my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys); +} + +#ifndef DBUG_OFF +/* Return pointer to DBUG for holding current state */ + +extern void **my_thread_var_dbug() +{ + struct st_my_thread_var *tmp= + my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys); + return tmp && tmp->init ? &tmp->dbug : 0; +} +#endif + +/* Return pointer to mutex_in_use */ + +safe_mutex_t **my_thread_var_mutex_in_use() +{ + struct st_my_thread_var *tmp= + my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys); + return tmp ? &tmp->mutex_in_use : 0; +} + +/**************************************************************************** + Get name of current thread. +****************************************************************************/ + +my_thread_id my_thread_dbug_id() +{ + return my_thread_var->id; +} + +#ifdef DBUG_OFF +const char *my_thread_name(void) +{ + return "no_name"; +} + +#else + +const char *my_thread_name(void) +{ + char name_buff[100]; + struct st_my_thread_var *tmp=my_thread_var; + if (!tmp->name[0]) + { + my_thread_id id= my_thread_dbug_id(); + sprintf(name_buff,"T@%lu", (ulong) id); + strmake(tmp->name,name_buff,THREAD_NAME_SIZE); + } + return tmp->name; +} +#endif /* DBUG_OFF */ + + +static uint get_thread_lib(void) +{ +#ifdef _CS_GNU_LIBPTHREAD_VERSION + char buff[64]; + + confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); + + if (!strncasecmp(buff, "NPTL", 4)) + return THD_LIB_NPTL; + if (!strncasecmp(buff, "linuxthreads", 12)) + return THD_LIB_LT; +#endif + return THD_LIB_OTHER; +} + +#ifdef _WIN32 +/* + In Visual Studio 2005 and later, default SIGABRT handler will overwrite + any unhandled exception filter set by the application and will try to + call JIT debugger. This is not what we want, this we calling __debugbreak + to stop in debugger, if process is being debugged or to generate + EXCEPTION_BREAKPOINT and then handle_segfault will do its magic. +*/ + +#if (_MSC_VER >= 1400) +static void my_sigabrt_handler(int sig) +{ + __debugbreak(); +} +#endif /*_MSC_VER >=1400 */ + +static void install_sigabrt_handler(void) +{ +#if (_MSC_VER >=1400) + /*abort() should not override our exception filter*/ + _set_abort_behavior(0,_CALL_REPORTFAULT); + signal(SIGABRT,my_sigabrt_handler); +#endif /* _MSC_VER >=1400 */ +} +#endif + +#endif /* THREAD */ diff --git a/externals/mysql/mysys/my_uuid.c b/externals/mysql/mysys/my_uuid.c new file mode 100644 index 00000000000..64db822cfb0 --- /dev/null +++ b/externals/mysql/mysys/my_uuid.c @@ -0,0 +1,243 @@ +/* Copyright (C) 2007 MySQL AB, Sergei Golubchik & Michael Widenius + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + implements Universal Unique Identifiers (UUIDs), as in + DCE 1.1: Remote Procedure Call, + Open Group Technical Standard Document Number C706, October 1997, + (supersedes C309 DCE: Remote Procedure Call 8/1994, + which was basis for ISO/IEC 11578:1996 specification) + + A UUID has the following structure: + + Field NDR Data Type Octet # Note + time_low unsigned long 0-3 The low field of the + timestamp. + time_mid unsigned short 4-5 The middle field of + the timestamp. + time_hi_and_version unsigned short 6-7 The high field of the + timestamp multiplexed + with the version number. + clock_seq_hi_and_reserved unsigned small 8 The high field of the + clock sequence multi- + plexed with the variant. + clock_seq_low unsigned small 9 The low field of the + clock sequence. + node character 10-15 The spatially unique node + identifier. +*/ + +#include "mysys_priv.h" +#include +#include /* mi_int2store, mi_int4store */ + +static my_bool my_uuid_inited= 0; +static struct my_rnd_struct uuid_rand; +static uint nanoseq; +static ulonglong uuid_time= 0; +static uchar uuid_suffix[2+6]; /* clock_seq and node */ + +#ifdef THREAD +static pthread_mutex_t LOCK_uuid_generator; +#endif + +/* + Number of 100-nanosecond intervals between + 1582-10-15 00:00:00.00 and 1970-01-01 00:00:00.00 +*/ + +#define UUID_TIME_OFFSET ((ulonglong) 141427 * 24 * 60 * 60 * \ + 1000 * 1000 * 10) +#define UUID_VERSION 0x1000 +#define UUID_VARIANT 0x8000 + + +/* Helper function */ + +static void set_clock_seq() +{ + uint16 clock_seq= ((uint)(my_rnd(&uuid_rand)*16383)) | UUID_VARIANT; + mi_int2store(uuid_suffix, clock_seq); +} + + +/** + Init structures needed for my_uuid + + @func my_uuid_init() + @param seed1 Seed for random generator + @param seed2 Seed for random generator + + @note + Seed1 & seed2 should NOT depend on clock. This is to be able to + generate a random mac address according to UUID specs. +*/ + +void my_uuid_init(ulong seed1, ulong seed2) +{ + uchar *mac= uuid_suffix+2; + ulonglong now; + + if (my_uuid_inited) + return; + my_uuid_inited= 1; + now= my_getsystime(); + nanoseq= 0; + + if (my_gethwaddr(mac)) + { + uint i; + /* + Generating random "hardware addr" + + Specs explicitly specify that node identifier should NOT + correlate with a clock_seq value, so we use a separate + randominit() here. + */ + /* purecov: begin inspected */ + my_rnd_init(&uuid_rand, (ulong) (seed2+ now/2), (ulong) (now+rand())); + for (i=0; i < sizeof(mac); i++) + mac[i]= (uchar)(my_rnd(&uuid_rand)*255); + /* purecov: end */ + } + my_rnd_init(&uuid_rand, (ulong) (seed1 + now), (ulong) (now/2+ getpid())); + set_clock_seq(); + pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST); +} + + +/** + Create a global unique identifier (uuid) + + @func my_uuid() + @param to Store uuid here. Must be of size MY_uuid_SIZE (16) +*/ + +void my_uuid(uchar *to) +{ + ulonglong tv; + uint32 time_low; + uint16 time_mid, time_hi_and_version; + + DBUG_ASSERT(my_uuid_inited); + + pthread_mutex_lock(&LOCK_uuid_generator); + tv= my_getsystime() + UUID_TIME_OFFSET + nanoseq; + + if (likely(tv > uuid_time)) + { + /* + Current time is ahead of last timestamp, as it should be. + If we "borrowed time", give it back, just as long as we + stay ahead of the previous timestamp. + */ + if (nanoseq) + { + uint delta; + DBUG_ASSERT((tv > uuid_time) && (nanoseq > 0)); + /* + -1 so we won't make tv= uuid_time for nanoseq >= (tv - uuid_time) + */ + delta= min(nanoseq, (uint)(tv - uuid_time -1)); + tv-= delta; + nanoseq-= delta; + } + } + else + { + if (unlikely(tv == uuid_time)) + { + /* + For low-res system clocks. If several requests for UUIDs + end up on the same tick, we add a nano-second to make them + different. + ( current_timestamp + nanoseq * calls_in_this_period ) + may end up > next_timestamp; this is OK. Nonetheless, we'll + try to unwind nanoseq when we get a chance to. + If nanoseq overflows, we'll start over with a new numberspace + (so the if() below is needed so we can avoid the ++tv and thus + match the follow-up if() if nanoseq overflows!). + */ + if (likely(++nanoseq)) + ++tv; + } + + if (unlikely(tv <= uuid_time)) + { + /* + If the admin changes the system clock (or due to Daylight + Saving Time), the system clock may be turned *back* so we + go through a period once more for which we already gave out + UUIDs. To avoid duplicate UUIDs despite potentially identical + times, we make a new random component. + We also come here if the nanoseq "borrowing" overflows. + In either case, we throw away any nanoseq borrowing since it's + irrelevant in the new numberspace. + */ + set_clock_seq(); + tv= my_getsystime() + UUID_TIME_OFFSET; + nanoseq= 0; + DBUG_PRINT("uuid",("making new numberspace")); + } + } + + uuid_time=tv; + pthread_mutex_unlock(&LOCK_uuid_generator); + + time_low= (uint32) (tv & 0xFFFFFFFF); + time_mid= (uint16) ((tv >> 32) & 0xFFFF); + time_hi_and_version= (uint16) ((tv >> 48) | UUID_VERSION); + + /* + Note, that the standard does NOT specify byte ordering in + multi-byte fields. it's implementation defined (but must be + the same for all fields). + We use big-endian, so we can use memcmp() to compare UUIDs + and for straightforward UUID to string conversion. + */ + mi_int4store(to, time_low); + mi_int2store(to+4, time_mid); + mi_int2store(to+6, time_hi_and_version); + bmove(to+8, uuid_suffix, sizeof(uuid_suffix)); +} + + +/** + Convert uuid to string representation + + @func my_uuid2str() + @param guid uuid + @param s Output buffer.Must be at least MY_UUID_STRING_LENGTH+1 large. +*/ +void my_uuid2str(const uchar *guid, char *s) +{ + int i; + for (i=0; i < MY_UUID_SIZE; i++) + { + *s++= _dig_vec_lower[guid[i] >>4]; + *s++= _dig_vec_lower[guid[i] & 15]; + if(i == 3 || i == 5 || i == 7 || i == 9) + *s++= '-'; + } +} + +void my_uuid_end() +{ + if (my_uuid_inited) + { + my_uuid_inited= 0; + pthread_mutex_destroy(&LOCK_uuid_generator); + } +} diff --git a/externals/mysql/mysys/my_vle.c b/externals/mysql/mysys/my_vle.c new file mode 100644 index 00000000000..09f297eb553 --- /dev/null +++ b/externals/mysql/mysys/my_vle.c @@ -0,0 +1,109 @@ +/* Copyright (C) 2005 MySQL AB + + 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 the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Variable length encoding. + + A method to store an arbitrary-size non-negative integer. We let the + most significant bit of the number indicate that the next byte + should be contatenated to form the real number. +*/ + +#include "my_vle.h" + +/* + Function to encode an unsigned long as VLE. The bytes for the VLE + will be written to the location pointed to by 'out'. The maximum + number of bytes written will be 'max'. + + PARAMETERS + + out Pointer to beginning of where to store VLE bytes. + max Maximum number of bytes to write. + n Number to encode. + + RETURN VALUE + On success, one past the end of the array containing the VLE + bytes. On failure, the 'out' pointer is returned. +*/ + +uchar* +my_vle_encode(uchar* out, size_t max, ulong n) +{ + uchar buf[my_vle_sizeof(n)]; + uchar *ptr= buf; + size_t len; + + do + { + *ptr++= (uchar) (n & 0x7F); + n>>= 7; + } + while (n > 0); + + len= ptr - buf; + + if (len <= max) + { + /* + The bytes are stored in reverse order in 'buf'. Let's write them + in correct order to the output buffer and set the MSB at the + same time. + */ + while (ptr-- > buf) + { + uchar v= *ptr; + if (ptr > buf) + v|= 0x80; + *out++= v; + } + } + + return out; +} + +/* + Function to decode a VLE representation of an integral value. + + + PARAMETERS + + result_ptr Pointer to an unsigned long where the value will be written. + vle Pointer to the VLE bytes. + + RETURN VALUE + + One-past the end of the VLE bytes. The routine will never read + more than sizeof(*result_ptr) + 1 bytes. +*/ + +uchar const* +my_vle_decode(ulong *result_ptr, uchar const *vle) +{ + ulong result= 0; + size_t cnt= 1; + + do + { + result<<= 7; + result|= (*vle & 0x7F); + } + while ((*vle++ & 0x80) && ++cnt <= sizeof(*result_ptr) + 1); + + if (cnt <= sizeof(*result_ptr) + 1) + *result_ptr= result; + + return vle; +} diff --git a/externals/mysql/mysys/my_wincond.c b/externals/mysql/mysys/my_wincond.c new file mode 100644 index 00000000000..862eafce435 --- /dev/null +++ b/externals/mysql/mysys/my_wincond.c @@ -0,0 +1,222 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/***************************************************************************** +** The following is a simple implementation of posix conditions +*****************************************************************************/ +#if defined(_WIN32) + +#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */ +#include "mysys_priv.h" +#include +#include +#include + +int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) +{ + cond->waiting= 0; + InitializeCriticalSection(&cond->lock_waiting); + + cond->events[SIGNAL]= CreateEvent(NULL, /* no security */ + FALSE, /* auto-reset event */ + FALSE, /* non-signaled initially */ + NULL); /* unnamed */ + + /* Create a manual-reset event. */ + cond->events[BROADCAST]= CreateEvent(NULL, /* no security */ + TRUE, /* manual-reset */ + FALSE, /* non-signaled initially */ + NULL); /* unnamed */ + + + cond->broadcast_block_event= CreateEvent(NULL, /* no security */ + TRUE, /* manual-reset */ + TRUE, /* signaled initially */ + NULL); /* unnamed */ + + if( cond->events[SIGNAL] == NULL || + cond->events[BROADCAST] == NULL || + cond->broadcast_block_event == NULL ) + return ENOMEM; + return 0; +} + +int pthread_cond_destroy(pthread_cond_t *cond) +{ + DeleteCriticalSection(&cond->lock_waiting); + + if (CloseHandle(cond->events[SIGNAL]) == 0 || + CloseHandle(cond->events[BROADCAST]) == 0 || + CloseHandle(cond->broadcast_block_event) == 0) + return EINVAL; + return 0; +} + + +int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +{ + return pthread_cond_timedwait(cond,mutex,NULL); +} + + +int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + struct timespec *abstime) +{ + int result; + long timeout; + union ft64 now; + + if( abstime != NULL ) + { + GetSystemTimeAsFileTime(&now.ft); + + /* + Calculate time left to abstime + - subtract start time from current time(values are in 100ns units) + - convert to millisec by dividing with 10000 + */ + timeout= (long)((abstime->tv.i64 - now.i64) / 10000); + + /* Don't allow the timeout to be negative */ + if (timeout < 0) + timeout= 0L; + + /* + Make sure the calucated timeout does not exceed original timeout + value which could cause "wait for ever" if system time changes + */ + if (timeout > abstime->max_timeout_msec) + timeout= abstime->max_timeout_msec; + + } + else + { + /* No time specified; don't expire */ + timeout= INFINITE; + } + + /* + Block access if previous broadcast hasn't finished. + This is just for safety and should normally not + affect the total time spent in this function. + */ + WaitForSingleObject(cond->broadcast_block_event, INFINITE); + + EnterCriticalSection(&cond->lock_waiting); + cond->waiting++; + LeaveCriticalSection(&cond->lock_waiting); + + LeaveCriticalSection(mutex); + + result= WaitForMultipleObjects(2, cond->events, FALSE, timeout); + + EnterCriticalSection(&cond->lock_waiting); + cond->waiting--; + + if (cond->waiting == 0) + { + /* + We're the last waiter to be notified or to stop waiting, so + reset the manual event. + */ + /* Close broadcast gate */ + ResetEvent(cond->events[BROADCAST]); + /* Open block gate */ + SetEvent(cond->broadcast_block_event); + } + LeaveCriticalSection(&cond->lock_waiting); + + EnterCriticalSection(mutex); + + return result == WAIT_TIMEOUT ? ETIMEDOUT : 0; +} + +int pthread_cond_signal(pthread_cond_t *cond) +{ + EnterCriticalSection(&cond->lock_waiting); + + if(cond->waiting > 0) + SetEvent(cond->events[SIGNAL]); + + LeaveCriticalSection(&cond->lock_waiting); + + return 0; +} + + +int pthread_cond_broadcast(pthread_cond_t *cond) +{ + EnterCriticalSection(&cond->lock_waiting); + /* + The mutex protect us from broadcasting if + there isn't any thread waiting to open the + block gate after this call has closed it. + */ + if(cond->waiting > 0) + { + /* Close block gate */ + ResetEvent(cond->broadcast_block_event); + /* Open broadcast gate */ + SetEvent(cond->events[BROADCAST]); + } + + LeaveCriticalSection(&cond->lock_waiting); + + return 0; +} + + +int pthread_attr_init(pthread_attr_t *connect_att) +{ + connect_att->dwStackSize = 0; + connect_att->dwCreatingFlag = 0; + return 0; +} + +int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack) +{ + connect_att->dwStackSize=stack; + return 0; +} + +int pthread_attr_destroy(pthread_attr_t *connect_att) +{ + bzero((uchar*) connect_att,sizeof(*connect_att)); + return 0; +} + +/**************************************************************************** +** Fix localtime_r() to be a bit safer +****************************************************************************/ + +struct tm *localtime_r(const time_t *timep,struct tm *tmp) +{ + if (*timep == (time_t) -1) /* This will crash win32 */ + { + bzero(tmp,sizeof(*tmp)); + } + else + { + struct tm *res=localtime(timep); + if (!res) /* Wrong date */ + { + bzero(tmp,sizeof(*tmp)); /* Keep things safe */ + return 0; + } + *tmp= *res; + } + return tmp; +} +#endif /* __WIN__ */ diff --git a/externals/mysql/mysys/my_windac.c b/externals/mysql/mysys/my_windac.c new file mode 100644 index 00000000000..f846853f7be --- /dev/null +++ b/externals/mysql/mysys/my_windac.c @@ -0,0 +1,223 @@ +/* Copyright (C) 2000-2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "m_string.h" +#ifdef __WIN__ + +/* Windows NT/2000 discretionary access control utility functions. */ + +/* + Check if the operating system is built on NT technology. + + RETURN + 0 Windows 95/98/Me + 1 otherwise +*/ + +static my_bool is_nt() +{ + return GetVersion() < 0x80000000; +} + +/* + Auxilary structure to store pointers to the data which we need to keep + around while SECURITY_ATTRIBUTES is in use. +*/ + +typedef struct st_my_security_attr +{ + PSID everyone_sid; + PACL dacl; +} My_security_attr; + + +/* + Allocate and initialize SECURITY_ATTRIBUTES setting up access + rights for the owner and group `Everybody'. + + SYNOPSIS + my_security_attr_create() + psa [OUT] pointer to store the pointer to SA in + perror [OUT] pointer to store error message if there was an + error + owner_rights [IN] access rights for the owner + everyone_rights [IN] access rights for group Everybody + + DESCRIPTION + Set up the security attributes to provide clients with sufficient + access rights to a kernel object. We need this function + because if we simply grant all access to everybody (by installing + a NULL DACL) a mailicious user can attempt a denial of service + attack by taking ownership over the kernel object. Upon successful + return `psa' contains a pointer to SECUIRITY_ATTRIBUTES that can be used + to create kernel objects with proper access rights. + + RETURN + 0 success, psa is 0 or points to a valid SA structure, + perror is left intact + !0 error, SA is set to 0, error message is stored in perror +*/ + +int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, + DWORD owner_rights, DWORD everyone_rights) +{ + /* Top-level SID authority */ + SID_IDENTIFIER_AUTHORITY world_auth= SECURITY_WORLD_SID_AUTHORITY; + PSID everyone_sid= 0; + HANDLE htoken= 0; + SECURITY_ATTRIBUTES *sa= 0; + PACL dacl= 0; + DWORD owner_token_length, dacl_length; + SECURITY_DESCRIPTOR *sd; + PTOKEN_USER owner_token; + PSID owner_sid; + My_security_attr *attr; + + if (! is_nt()) + { + *psa= 0; + return 0; + } + + /* + Get SID of Everyone group. Easier to retrieve all SIDs each time + this function is called than worry about thread safety. + */ + if (! AllocateAndInitializeSid(&world_auth, 1, SECURITY_WORLD_RID, + 0, 0, 0, 0, 0, 0, 0, &everyone_sid)) + { + *perror= "Failed to retrieve the SID of Everyone group"; + goto error; + } + + /* + Get SID of the owner. Using GetSecurityInfo this task can be done + in just one call instead of five, but GetSecurityInfo declared in + aclapi.h, so I hesitate to use it. + SIC: OpenThreadToken works only if there is an active impersonation + token, hence OpenProcessToken is used. + */ + if (! OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &htoken)) + { + *perror= "Failed to retrieve thread access token"; + goto error; + } + GetTokenInformation(htoken, TokenUser, 0, 0, &owner_token_length); + + if (! my_multi_malloc(MYF(MY_WME), + &sa, ALIGN_SIZE(sizeof(SECURITY_ATTRIBUTES)) + + sizeof(My_security_attr), + &sd, sizeof(SECURITY_DESCRIPTOR), + &owner_token, owner_token_length, + 0)) + { + *perror= "Failed to allocate memory for SECURITY_ATTRIBUTES"; + goto error; + } + bzero(owner_token, owner_token_length); + if (! GetTokenInformation(htoken, TokenUser, owner_token, + owner_token_length, &owner_token_length)) + { + *perror= "GetTokenInformation failed"; + goto error; + } + owner_sid= owner_token->User.Sid; + + if (! IsValidSid(owner_sid)) + { + *perror= "IsValidSid failed"; + goto error; + } + + /* Calculate the amount of memory that must be allocated for the DACL */ + dacl_length= sizeof(ACL) + (sizeof(ACCESS_ALLOWED_ACE)-sizeof(DWORD)) * 2 + + GetLengthSid(everyone_sid) + GetLengthSid(owner_sid); + + /* Create an ACL */ + if (! (dacl= (PACL) my_malloc(dacl_length, MYF(MY_ZEROFILL|MY_WME)))) + { + *perror= "Failed to allocate memory for DACL"; + goto error; + } + if (! InitializeAcl(dacl, dacl_length, ACL_REVISION)) + { + *perror= "Failed to initialize DACL"; + goto error; + } + if (! AddAccessAllowedAce(dacl, ACL_REVISION, everyone_rights, everyone_sid)) + { + *perror= "Failed to set up DACL"; + goto error; + } + if (! AddAccessAllowedAce(dacl, ACL_REVISION, owner_rights, owner_sid)) + { + *perror= "Failed to set up DACL"; + goto error; + } + if (! InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) + { + *perror= "Could not initialize security descriptor"; + goto error; + } + if (! SetSecurityDescriptorDacl(sd, TRUE, dacl, FALSE)) + { + *perror= "Failed to install DACL"; + goto error; + } + + sa->nLength= sizeof(*sa); + sa->bInheritHandle= TRUE; + sa->lpSecurityDescriptor= sd; + /* Save pointers to everyone_sid and dacl to be able to clean them up */ + attr= (My_security_attr*) (((char*) sa) + ALIGN_SIZE(sizeof(*sa))); + attr->everyone_sid= everyone_sid; + attr->dacl= dacl; + *psa= sa; + + CloseHandle(htoken); + return 0; +error: + if (everyone_sid) + FreeSid(everyone_sid); + if (htoken) + CloseHandle(htoken); + my_free((uchar*) sa, MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*) dacl, MYF(MY_ALLOW_ZERO_PTR)); + *psa= 0; + return 1; +} + +/* + Cleanup security attributes freeing used memory. + + SYNOPSIS + my_security_attr_free() + sa security attributes +*/ + +void my_security_attr_free(SECURITY_ATTRIBUTES *sa) +{ + if (sa) + { + My_security_attr *attr= (My_security_attr*) + (((char*)sa) + ALIGN_SIZE(sizeof(*sa))); + FreeSid(attr->everyone_sid); + my_free((uchar*) attr->dacl, MYF(0)); + my_free((uchar*) sa, MYF(0)); + } +} + +#endif /* __WIN__ */ diff --git a/externals/mysql/mysys/my_winerr.c b/externals/mysql/mysys/my_winerr.c new file mode 100644 index 00000000000..179909970a0 --- /dev/null +++ b/externals/mysql/mysys/my_winerr.c @@ -0,0 +1,127 @@ +/* Copyright (C) 2008 MySQL AB + +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 +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Convert Windows API error (GetLastError() to Posix equivalent (errno) + The exported function my_osmaperr() is modelled after and borrows + heavily from undocumented _dosmaperr()(found of the static Microsoft C runtime). +*/ + +#ifdef _WIN32 + +#include +#include + + +struct errentry +{ + unsigned long oscode; /* OS return value */ + int sysv_errno; /* System V error code */ +}; + +static struct errentry errtable[]= { + { ERROR_INVALID_FUNCTION, EINVAL }, /* 1 */ + { ERROR_FILE_NOT_FOUND, ENOENT }, /* 2 */ + { ERROR_PATH_NOT_FOUND, ENOENT }, /* 3 */ + { ERROR_TOO_MANY_OPEN_FILES, EMFILE }, /* 4 */ + { ERROR_ACCESS_DENIED, EACCES }, /* 5 */ + { ERROR_INVALID_HANDLE, EBADF }, /* 6 */ + { ERROR_ARENA_TRASHED, ENOMEM }, /* 7 */ + { ERROR_NOT_ENOUGH_MEMORY, ENOMEM }, /* 8 */ + { ERROR_INVALID_BLOCK, ENOMEM }, /* 9 */ + { ERROR_BAD_ENVIRONMENT, E2BIG }, /* 10 */ + { ERROR_BAD_FORMAT, ENOEXEC }, /* 11 */ + { ERROR_INVALID_ACCESS, EINVAL }, /* 12 */ + { ERROR_INVALID_DATA, EINVAL }, /* 13 */ + { ERROR_INVALID_DRIVE, ENOENT }, /* 15 */ + { ERROR_CURRENT_DIRECTORY, EACCES }, /* 16 */ + { ERROR_NOT_SAME_DEVICE, EXDEV }, /* 17 */ + { ERROR_NO_MORE_FILES, ENOENT }, /* 18 */ + { ERROR_LOCK_VIOLATION, EACCES }, /* 33 */ + { ERROR_BAD_NETPATH, ENOENT }, /* 53 */ + { ERROR_NETWORK_ACCESS_DENIED, EACCES }, /* 65 */ + { ERROR_BAD_NET_NAME, ENOENT }, /* 67 */ + { ERROR_FILE_EXISTS, EEXIST }, /* 80 */ + { ERROR_CANNOT_MAKE, EACCES }, /* 82 */ + { ERROR_FAIL_I24, EACCES }, /* 83 */ + { ERROR_INVALID_PARAMETER, EINVAL }, /* 87 */ + { ERROR_NO_PROC_SLOTS, EAGAIN }, /* 89 */ + { ERROR_DRIVE_LOCKED, EACCES }, /* 108 */ + { ERROR_BROKEN_PIPE, EPIPE }, /* 109 */ + { ERROR_DISK_FULL, ENOSPC }, /* 112 */ + { ERROR_INVALID_TARGET_HANDLE, EBADF }, /* 114 */ + { ERROR_INVALID_HANDLE, EINVAL }, /* 124 */ + { ERROR_WAIT_NO_CHILDREN, ECHILD }, /* 128 */ + { ERROR_CHILD_NOT_COMPLETE, ECHILD }, /* 129 */ + { ERROR_DIRECT_ACCESS_HANDLE, EBADF }, /* 130 */ + { ERROR_NEGATIVE_SEEK, EINVAL }, /* 131 */ + { ERROR_SEEK_ON_DEVICE, EACCES }, /* 132 */ + { ERROR_DIR_NOT_EMPTY, ENOTEMPTY }, /* 145 */ + { ERROR_NOT_LOCKED, EACCES }, /* 158 */ + { ERROR_BAD_PATHNAME, ENOENT }, /* 161 */ + { ERROR_MAX_THRDS_REACHED, EAGAIN }, /* 164 */ + { ERROR_LOCK_FAILED, EACCES }, /* 167 */ + { ERROR_ALREADY_EXISTS, EEXIST }, /* 183 */ + { ERROR_FILENAME_EXCED_RANGE, ENOENT }, /* 206 */ + { ERROR_NESTING_NOT_ALLOWED, EAGAIN }, /* 215 */ + { ERROR_NOT_ENOUGH_QUOTA, ENOMEM } /* 1816 */ +}; + +/* size of the table */ +#define ERRTABLESIZE (sizeof(errtable)/sizeof(errtable[0])) + +/* The following two constants must be the minimum and maximum +values in the (contiguous) range of Exec Failure errors. */ +#define MIN_EXEC_ERROR ERROR_INVALID_STARTING_CODESEG +#define MAX_EXEC_ERROR ERROR_INFLOOP_IN_RELOC_CHAIN + +/* These are the low and high value in the range of errors that are +access violations */ +#define MIN_EACCES_RANGE ERROR_WRITE_PROTECT +#define MAX_EACCES_RANGE ERROR_SHARING_BUFFER_EXCEEDED + + +static int get_errno_from_oserr(unsigned long oserrno) +{ + int i; + + /* check the table for the OS error code */ + for (i= 0; i < ERRTABLESIZE; ++i) + { + if (oserrno == errtable[i].oscode) + { + return errtable[i].sysv_errno; + } + } + + /* The error code wasn't in the table. We check for a range of */ + /* EACCES errors or exec failure errors (ENOEXEC). Otherwise */ + /* EINVAL is returned. */ + + if (oserrno >= MIN_EACCES_RANGE && oserrno <= MAX_EACCES_RANGE) + return EACCES; + else if (oserrno >= MIN_EXEC_ERROR && oserrno <= MAX_EXEC_ERROR) + return ENOEXEC; + else + return EINVAL; +} + +/* Set errno corresponsing to GetLastError() value */ +void my_osmaperr ( unsigned long oserrno) +{ + errno= get_errno_from_oserr(oserrno); +} + +#endif diff --git a/externals/mysql/mysys/my_winfile.c b/externals/mysql/mysys/my_winfile.c new file mode 100644 index 00000000000..d5917d4e5ac --- /dev/null +++ b/externals/mysql/mysys/my_winfile.c @@ -0,0 +1,667 @@ +/* Copyright (C) 2008 MySQL AB + +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 +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + The purpose of this file is to provide implementation of file IO routines on + Windows that can be thought as drop-in replacement for corresponding C runtime + functionality. + + Compared to Windows CRT, this one + - does not have the same file descriptor + limitation (default is 16384 and can be increased further, whereas CRT poses + a hard limit of 2048 file descriptors) + - the file operations are not serialized + - positional IO pread/pwrite is ported here. + - no text mode for files, all IO is "binary" + + Naming convention: + All routines are prefixed with my_win_, e.g Posix open() is implemented with + my_win_open() + + Implemented are + - POSIX routines(e.g open, read, lseek ...) + - Some ANSI C stream routines (fopen, fdopen, fileno, fclose) + - Windows CRT equvalients (my_get_osfhandle, open_osfhandle) + + Worth to note: + - File descriptors used here are located in a range that is not compatible + with CRT on purpose. Attempt to use a file descriptor from Windows CRT library + range in my_win_* function will be punished with DBUG_ASSERT() + + - File streams (FILE *) are actually from the C runtime. The routines provided + here are useful only in scernarios that use low-level IO with my_win_fileno() +*/ + +#ifdef _WIN32 + +#include "mysys_priv.h" +#include +#include + +/* Associates a file descriptor with an existing operating-system file handle.*/ +File my_open_osfhandle(HANDLE handle, int oflag) +{ + int offset= -1; + uint i; + DBUG_ENTER("my_open_osfhandle"); + + pthread_mutex_lock(&THR_LOCK_open); + for(i= MY_FILE_MIN; i < my_file_limit;i++) + { + if(my_file_info[i].fhandle == 0) + { + struct st_my_file_info *finfo= &(my_file_info[i]); + finfo->type= FILE_BY_OPEN; + finfo->fhandle= handle; + finfo->oflag= oflag; + offset= i; + break; + } + } + pthread_mutex_unlock(&THR_LOCK_open); + if(offset == -1) + errno= EMFILE; /* to many file handles open */ + DBUG_RETURN(offset); +} + + +static void invalidate_fd(File fd) +{ + DBUG_ENTER("invalidate_fd"); + DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit); + my_file_info[fd].fhandle= 0; + DBUG_VOID_RETURN; +} + + +/* Get Windows handle for a file descriptor */ +HANDLE my_get_osfhandle(File fd) +{ + DBUG_ENTER("my_get_osfhandle"); + DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit); + DBUG_RETURN(my_file_info[fd].fhandle); +} + + +static int my_get_open_flags(File fd) +{ + DBUG_ENTER("my_get_osfhandle"); + DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit); + DBUG_RETURN(my_file_info[fd].oflag); +} + + +/* + Open a file with sharing. Similar to _sopen() from libc, but allows managing + share delete on win32 + + SYNOPSIS + my_win_sopen() + path file name + oflag operation flags + shflag share flag + pmode permission flags + + RETURN VALUE + File descriptor of opened file if success + -1 and sets errno if fails. +*/ + +File my_win_sopen(const char *path, int oflag, int shflag, int pmode) +{ + int fh; /* handle of opened file */ + int mask; + HANDLE osfh; /* OS handle of opened file */ + DWORD fileaccess; /* OS file access (requested) */ + DWORD fileshare; /* OS file sharing mode */ + DWORD filecreate; /* OS method of opening/creating */ + DWORD fileattrib; /* OS file attribute flags */ + SECURITY_ATTRIBUTES SecurityAttributes; + + DBUG_ENTER("my_win_sopen"); + + if (check_if_legal_filename(path)) + { + errno= EACCES; + DBUG_RETURN(-1); + } + SecurityAttributes.nLength= sizeof(SecurityAttributes); + SecurityAttributes.lpSecurityDescriptor= NULL; + SecurityAttributes.bInheritHandle= !(oflag & _O_NOINHERIT); + + /* decode the access flags */ + switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) { + case _O_RDONLY: /* read access */ + fileaccess= GENERIC_READ; + break; + case _O_WRONLY: /* write access */ + fileaccess= GENERIC_WRITE; + break; + case _O_RDWR: /* read and write access */ + fileaccess= GENERIC_READ | GENERIC_WRITE; + break; + default: /* error, bad oflag */ + errno= EINVAL; + DBUG_RETURN(-1); + } + + /* decode sharing flags */ + switch (shflag) { + case _SH_DENYRW: /* exclusive access except delete */ + fileshare= FILE_SHARE_DELETE; + break; + case _SH_DENYWR: /* share read and delete access */ + fileshare= FILE_SHARE_READ | FILE_SHARE_DELETE; + break; + case _SH_DENYRD: /* share write and delete access */ + fileshare= FILE_SHARE_WRITE | FILE_SHARE_DELETE; + break; + case _SH_DENYNO: /* share read, write and delete access */ + fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + break; + case _SH_DENYRWD: /* exclusive access */ + fileshare= 0L; + break; + case _SH_DENYWRD: /* share read access */ + fileshare= FILE_SHARE_READ; + break; + case _SH_DENYRDD: /* share write access */ + fileshare= FILE_SHARE_WRITE; + break; + case _SH_DENYDEL: /* share read and write access */ + fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE; + break; + default: /* error, bad shflag */ + errno= EINVAL; + DBUG_RETURN(-1); + } + + /* decode open/create method flags */ + switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) { + case 0: + case _O_EXCL: /* ignore EXCL w/o CREAT */ + filecreate= OPEN_EXISTING; + break; + + case _O_CREAT: + filecreate= OPEN_ALWAYS; + break; + + case _O_CREAT | _O_EXCL: + case _O_CREAT | _O_TRUNC | _O_EXCL: + filecreate= CREATE_NEW; + break; + + case _O_TRUNC: + case _O_TRUNC | _O_EXCL: /* ignore EXCL w/o CREAT */ + filecreate= TRUNCATE_EXISTING; + break; + + case _O_CREAT | _O_TRUNC: + filecreate= CREATE_ALWAYS; + break; + + default: + /* this can't happen ... all cases are covered */ + errno= EINVAL; + DBUG_RETURN(-1); + } + + /* decode file attribute flags if _O_CREAT was specified */ + fileattrib= FILE_ATTRIBUTE_NORMAL; /* default */ + if (oflag & _O_CREAT) + { + _umask((mask= _umask(0))); + + if (!((pmode & ~mask) & _S_IWRITE)) + fileattrib= FILE_ATTRIBUTE_READONLY; + } + + /* Set temporary file (delete-on-close) attribute if requested. */ + if (oflag & _O_TEMPORARY) + { + fileattrib|= FILE_FLAG_DELETE_ON_CLOSE; + fileaccess|= DELETE; + } + + /* Set temporary file (delay-flush-to-disk) attribute if requested.*/ + if (oflag & _O_SHORT_LIVED) + fileattrib|= FILE_ATTRIBUTE_TEMPORARY; + + /* Set sequential or random access attribute if requested. */ + if (oflag & _O_SEQUENTIAL) + fileattrib|= FILE_FLAG_SEQUENTIAL_SCAN; + else if (oflag & _O_RANDOM) + fileattrib|= FILE_FLAG_RANDOM_ACCESS; + + /* try to open/create the file */ + if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes, + filecreate, fileattrib, NULL)) == INVALID_HANDLE_VALUE) + { + /* + OS call to open/create file failed! map the error, release + the lock, and return -1. note that it's not necessary to + call _free_osfhnd (it hasn't been used yet). + */ + my_osmaperr(GetLastError()); /* map error */ + DBUG_RETURN(-1); /* return error to caller */ + } + + if ((fh= my_open_osfhandle(osfh, + oflag & (_O_APPEND | _O_RDONLY | _O_TEXT))) == -1) + { + CloseHandle(osfh); + } + + DBUG_RETURN(fh); /* return handle */ +} + + +File my_win_open(const char *path, int flags) +{ + DBUG_ENTER("my_win_open"); + DBUG_RETURN(my_win_sopen((char *) path, flags | _O_BINARY, _SH_DENYNO, + _S_IREAD | S_IWRITE)); +} + + +int my_win_close(File fd) +{ + DBUG_ENTER("my_win_close"); + if(CloseHandle(my_get_osfhandle(fd))) + { + invalidate_fd(fd); + DBUG_RETURN(0); + } + my_osmaperr(GetLastError()); + DBUG_RETURN(-1); +} + + +size_t my_win_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset) +{ + DWORD nBytesRead; + HANDLE hFile; + OVERLAPPED ov= {0}; + LARGE_INTEGER li; + + DBUG_ENTER("my_win_pread"); + + if(!Count) + DBUG_RETURN(0); +#ifdef _WIN64 + if(Count > UINT_MAX) + Count= UINT_MAX; +#endif + + hFile= (HANDLE)my_get_osfhandle(Filedes); + li.QuadPart= offset; + ov.Offset= li.LowPart; + ov.OffsetHigh= li.HighPart; + + if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, &ov)) + { + DWORD lastError= GetLastError(); + if(lastError == ERROR_HANDLE_EOF) + DBUG_RETURN(0); /*return 0 at EOF*/ + my_osmaperr(lastError); + DBUG_RETURN(-1); + } + DBUG_RETURN(nBytesRead); +} + + +size_t my_win_read(File Filedes, uchar *Buffer, size_t Count) +{ + DWORD nBytesRead; + HANDLE hFile; + + DBUG_ENTER("my_win_read"); + if(!Count) + return 0; +#ifdef _WIN64 + if(Count > UINT_MAX) + Count= UINT_MAX; +#endif + + hFile= (HANDLE)my_get_osfhandle(Filedes); + + if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, NULL)) + { + DWORD lastError= GetLastError(); + /* + ERROR_BROKEN_PIPE is returned when no more data coming + through e.g. a command pipe in windows : see MSDN on ReadFile. + */ + if(lastError == ERROR_HANDLE_EOF || lastError == ERROR_BROKEN_PIPE) + DBUG_RETURN(0); /*return 0 at EOF*/ + my_osmaperr(lastError); + DBUG_RETURN(-1); + } + DBUG_RETURN(nBytesRead); +} + + +size_t my_win_pwrite(File Filedes, const uchar *Buffer, size_t Count, + my_off_t offset) +{ + DWORD nBytesWritten; + HANDLE hFile; + OVERLAPPED ov= {0}; + LARGE_INTEGER li; + + DBUG_ENTER("my_win_pwrite"); + DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count: %zd, offset: %llu", + Filedes, Buffer, Count, (ulonglong)offset)); + + if(!Count) + DBUG_RETURN(0); + +#ifdef _WIN64 + if(Count > UINT_MAX) + Count= UINT_MAX; +#endif + + hFile= (HANDLE)my_get_osfhandle(Filedes); + li.QuadPart= offset; + ov.Offset= li.LowPart; + ov.OffsetHigh= li.HighPart; + + if(!WriteFile(hFile, Buffer, (DWORD)Count, &nBytesWritten, &ov)) + { + my_osmaperr(GetLastError()); + DBUG_RETURN(-1); + } + else + DBUG_RETURN(nBytesWritten); +} + + +my_off_t my_win_lseek(File fd, my_off_t pos, int whence) +{ + LARGE_INTEGER offset; + LARGE_INTEGER newpos; + + DBUG_ENTER("my_win_lseek"); + + /* Check compatibility of Windows and Posix seek constants */ + compile_time_assert(FILE_BEGIN == SEEK_SET && FILE_CURRENT == SEEK_CUR + && FILE_END == SEEK_END); + + offset.QuadPart= pos; + if(!SetFilePointerEx(my_get_osfhandle(fd), offset, &newpos, whence)) + { + my_osmaperr(GetLastError()); + newpos.QuadPart= -1; + } + DBUG_RETURN(newpos.QuadPart); +} + + +#ifndef FILE_WRITE_TO_END_OF_FILE +#define FILE_WRITE_TO_END_OF_FILE 0xffffffff +#endif +size_t my_win_write(File fd, const uchar *Buffer, size_t Count) +{ + DWORD nWritten; + OVERLAPPED ov; + OVERLAPPED *pov= NULL; + HANDLE hFile; + + DBUG_ENTER("my_win_write"); + DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count %zd", fd, Buffer, Count)); + if(my_get_open_flags(fd) & _O_APPEND) + { + /* + Atomic append to the end of file is is done by special initialization of + the OVERLAPPED structure. See MSDN WriteFile documentation for more info. + */ + memset(&ov, 0, sizeof(ov)); + ov.Offset= FILE_WRITE_TO_END_OF_FILE; + ov.OffsetHigh= -1; + pov= &ov; + } + + hFile= my_get_osfhandle(fd); + if(!WriteFile(hFile, Buffer, (DWORD)Count, &nWritten, pov)) + { + nWritten= (size_t)-1; + my_osmaperr(GetLastError()); + } + DBUG_RETURN((size_t)nWritten); +} + + +int my_win_chsize(File fd, my_off_t newlength) +{ + HANDLE hFile; + LARGE_INTEGER length; + DBUG_ENTER("my_win_chsize"); + + hFile= (HANDLE) my_get_osfhandle(fd); + length.QuadPart= newlength; + if (!SetFilePointerEx(hFile, length , NULL , FILE_BEGIN)) + goto err; + if (!SetEndOfFile(hFile)) + goto err; + DBUG_RETURN(0); +err: + my_osmaperr(GetLastError()); + my_errno= errno; + DBUG_RETURN(-1); +} + + +/* Get the file descriptor for stdin,stdout or stderr */ +static File my_get_stdfile_descriptor(FILE *stream) +{ + HANDLE hFile; + DWORD nStdHandle; + DBUG_ENTER("my_get_stdfile_descriptor"); + + if(stream == stdin) + nStdHandle= STD_INPUT_HANDLE; + else if(stream == stdout) + nStdHandle= STD_OUTPUT_HANDLE; + else if(stream == stderr) + nStdHandle= STD_ERROR_HANDLE; + else + DBUG_RETURN(-1); + + hFile= GetStdHandle(nStdHandle); + if(hFile != INVALID_HANDLE_VALUE) + DBUG_RETURN(my_open_osfhandle(hFile, 0)); + DBUG_RETURN(-1); +} + + +File my_win_fileno(FILE *file) +{ + HANDLE hFile= (HANDLE)_get_osfhandle(fileno(file)); + int retval= -1; + uint i; + + DBUG_ENTER("my_win_fileno"); + + for(i= MY_FILE_MIN; i < my_file_limit; i++) + { + if(my_file_info[i].fhandle == hFile) + { + retval= i; + break; + } + } + if(retval == -1) + /* try std stream */ + DBUG_RETURN(my_get_stdfile_descriptor(file)); + DBUG_RETURN(retval); +} + + +FILE *my_win_fopen(const char *filename, const char *type) +{ + FILE *file; + int flags= 0; + DBUG_ENTER("my_win_open"); + + /* + If we are not creating, then we need to use my_access to make sure + the file exists since Windows doesn't handle files like "com1.sym" + very well + */ + if (check_if_legal_filename(filename)) + { + errno= EACCES; + DBUG_RETURN(NULL); + } + + file= fopen(filename, type); + if(!file) + DBUG_RETURN(NULL); + + if(strchr(type,'a') != NULL) + flags= O_APPEND; + + /* + Register file handle in my_table_info. + Necessary for my_fileno() + */ + if(my_open_osfhandle((HANDLE)_get_osfhandle(fileno(file)), flags) < 0) + { + fclose(file); + DBUG_RETURN(NULL); + } + DBUG_RETURN(file); +} + + +FILE * my_win_fdopen(File fd, const char *type) +{ + FILE *file; + int crt_fd; + int flags= 0; + + DBUG_ENTER("my_win_fdopen"); + + if(strchr(type,'a') != NULL) + flags= O_APPEND; + /* Convert OS file handle to CRT file descriptor and then call fdopen*/ + crt_fd= _open_osfhandle((intptr_t)my_get_osfhandle(fd), flags); + if(crt_fd < 0) + file= NULL; + else + file= fdopen(crt_fd, type); + DBUG_RETURN(file); +} + + +int my_win_fclose(FILE *file) +{ + File fd; + + DBUG_ENTER("my_win_close"); + fd= my_fileno(file); + if(fd < 0) + DBUG_RETURN(-1); + if(fclose(file) < 0) + DBUG_RETURN(-1); + invalidate_fd(fd); + DBUG_RETURN(0); +} + + + +/* + Quick and dirty my_fstat() implementation for Windows. + Use CRT fstat on temporarily allocated file descriptor. + Patch file size, because size that fstat returns is not + reliable (may be outdated) +*/ +int my_win_fstat(File fd, struct _stati64 *buf) +{ + int crt_fd; + int retval; + HANDLE hFile, hDup; + + DBUG_ENTER("my_win_fstat"); + + hFile= my_get_osfhandle(fd); + if(!DuplicateHandle( GetCurrentProcess(), hFile, GetCurrentProcess(), + &hDup ,0,FALSE,DUPLICATE_SAME_ACCESS)) + { + my_osmaperr(GetLastError()); + DBUG_RETURN(-1); + } + if ((crt_fd= _open_osfhandle((intptr_t)hDup,0)) < 0) + DBUG_RETURN(-1); + + retval= _fstati64(crt_fd, buf); + if(retval == 0) + { + /* File size returned by stat is not accurate (may be outdated), fix it*/ + GetFileSizeEx(hDup, (PLARGE_INTEGER) (&(buf->st_size))); + } + _close(crt_fd); + DBUG_RETURN(retval); +} + + + +int my_win_stat( const char *path, struct _stati64 *buf) +{ + DBUG_ENTER("my_win_stat"); + if(_stati64( path, buf) == 0) + { + /* File size returned by stat is not accurate (may be outdated), fix it*/ + WIN32_FILE_ATTRIBUTE_DATA data; + if (GetFileAttributesEx(path, GetFileExInfoStandard, &data)) + { + LARGE_INTEGER li; + li.LowPart= data.nFileSizeLow; + li.HighPart= data.nFileSizeHigh; + buf->st_size= li.QuadPart; + } + DBUG_RETURN(0); + } + DBUG_RETURN(-1); +} + + + +int my_win_fsync(File fd) +{ + DBUG_ENTER("my_win_fsync"); + if(FlushFileBuffers(my_get_osfhandle(fd))) + DBUG_RETURN(0); + my_osmaperr(GetLastError()); + DBUG_RETURN(-1); +} + + + +int my_win_dup(File fd) +{ + HANDLE hDup; + DBUG_ENTER("my_win_dup"); + if (DuplicateHandle(GetCurrentProcess(), my_get_osfhandle(fd), + GetCurrentProcess(), &hDup, 0, FALSE, DUPLICATE_SAME_ACCESS)) + { + DBUG_RETURN(my_open_osfhandle(hDup, my_get_open_flags(fd))); + } + my_osmaperr(GetLastError()); + DBUG_RETURN(-1); +} + +#endif /*_WIN32*/ diff --git a/externals/mysql/mysys/my_winthread.c b/externals/mysql/mysys/my_winthread.c new file mode 100644 index 00000000000..9e8458b0799 --- /dev/null +++ b/externals/mysql/mysys/my_winthread.c @@ -0,0 +1,132 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/***************************************************************************** +** Simulation of posix threads calls for Windows +*****************************************************************************/ +#if defined (_WIN32) +/* SAFE_MUTEX will not work until the thread structure is up to date */ +#undef SAFE_MUTEX +#include "mysys_priv.h" +#include +#include + +static void install_sigabrt_handler(void); + +struct thread_start_parameter +{ + pthread_handler func; + void *arg; +}; + +/** + Adapter to @c pthread_mutex_trylock() + + @retval 0 Mutex was acquired + @retval EBUSY Mutex was already locked by a thread + */ +int +win_pthread_mutex_trylock(pthread_mutex_t *mutex) +{ + if (TryEnterCriticalSection(mutex)) + { + /* Don't allow recursive lock */ + if (mutex->RecursionCount > 1){ + LeaveCriticalSection(mutex); + return EBUSY; + } + return 0; + } + return EBUSY; +} + +static unsigned int __stdcall pthread_start(void *p) +{ + struct thread_start_parameter *par= (struct thread_start_parameter *)p; + pthread_handler func= par->func; + void *arg= par->arg; + free(p); + (*func)(arg); + return 0; +} + + +int pthread_create(pthread_t *thread_id, pthread_attr_t *attr, + pthread_handler func, void *param) +{ + uintptr_t handle; + struct thread_start_parameter *par; + unsigned int stack_size; + DBUG_ENTER("pthread_create"); + + par= (struct thread_start_parameter *)malloc(sizeof(*par)); + if (!par) + goto error_return; + + par->func= func; + par->arg= param; + stack_size= attr?attr->dwStackSize:0; + + handle= _beginthreadex(NULL, stack_size , pthread_start, par, 0, thread_id); + if (!handle) + goto error_return; + DBUG_PRINT("info", ("thread id=%u",*thread_id)); + + /* Do not need thread handle, close it */ + CloseHandle((HANDLE)handle); + DBUG_RETURN(0); + +error_return: + DBUG_PRINT("error", + ("Can't create thread to handle request (error %d)",errno)); + DBUG_RETURN(-1); +} + + +void pthread_exit(void *a) +{ + _endthreadex(0); +} + +int pthread_join(pthread_t thread, void **value_ptr) +{ + DWORD ret; + HANDLE handle; + + handle= OpenThread(SYNCHRONIZE, FALSE, thread); + if (!handle) + { + errno= EINVAL; + goto error_return; + } + + ret= WaitForSingleObject(handle, INFINITE); + + if(ret != WAIT_OBJECT_0) + { + errno= EINVAL; + goto error_return; + } + + CloseHandle(handle); + return 0; + +error_return: + if(handle) + CloseHandle(handle); + return -1; +} + +#endif diff --git a/externals/mysql/mysys/my_write.c b/externals/mysql/mysys/my_write.c new file mode 100644 index 00000000000..3eac1364f46 --- /dev/null +++ b/externals/mysql/mysys/my_write.c @@ -0,0 +1,101 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + + + /* Write a chunk of bytes to a file */ + +size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) +{ + size_t writtenbytes, written; + uint errors; + DBUG_ENTER("my_write"); + DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d", + Filedes, Buffer, (ulong) Count, MyFlags)); + errors= 0; written= 0; + + /* The behavior of write(fd, buf, 0) is not portable */ + if (unlikely(!Count)) + DBUG_RETURN(0); + + for (;;) + { +#ifdef _WIN32 + writtenbytes= my_win_write(Filedes, Buffer, Count); +#else + writtenbytes= write(Filedes, Buffer, Count); +#endif + if (writtenbytes == Count) + break; + if (writtenbytes != (size_t) -1) + { /* Safeguard */ + written+= writtenbytes; + Buffer+= writtenbytes; + Count-= writtenbytes; + } + my_errno= errno; + DBUG_PRINT("error",("Write only %ld bytes, error: %d", + (long) writtenbytes, my_errno)); +#ifndef NO_BACKGROUND +#ifdef THREAD + if (my_thread_var->abort) + MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ +#endif + if ((my_errno == ENOSPC || my_errno == EDQUOT) && + (MyFlags & MY_WAIT_IF_FULL)) + { + wait_for_free_space(my_filename(Filedes), errors); + errors++; + continue; + } + + if ((writtenbytes == 0 || writtenbytes == (size_t) -1)) + { + if (my_errno == EINTR) + { + DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld", + (long) writtenbytes)); + continue; /* Interrupted */ + } + + if (!writtenbytes && !errors++) /* Retry once */ + { + /* We may come here if the file quota is exeeded */ + errno= EFBIG; /* Assume this is the error */ + continue; + } + } + else + continue; /* Retry */ +#endif + if (MyFlags & (MY_NABP | MY_FNABP)) + { + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG), + my_filename(Filedes),my_errno); + } + DBUG_RETURN(MY_FILE_ERROR); /* Error on read */ + } + else + break; /* Return bytes written */ + } + if (MyFlags & (MY_NABP | MY_FNABP)) + DBUG_RETURN(0); /* Want only errors */ + DBUG_RETURN(writtenbytes+written); +} /* my_write */ diff --git a/externals/mysql/mysys/mysys_priv.h b/externals/mysql/mysys/mysys_priv.h new file mode 100644 index 00000000000..73f8f85f1b9 --- /dev/null +++ b/externals/mysql/mysys/mysys_priv.h @@ -0,0 +1,72 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +#ifdef USE_SYSTEM_WRAPPERS +#include "system_wrappers.h" +#endif + +#ifdef HAVE_GETRUSAGE +#include +#endif + +#ifdef THREAD +#include +extern pthread_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache; +extern pthread_mutex_t THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_net; +extern pthread_mutex_t THR_LOCK_charset, THR_LOCK_time; +#else +#include +#endif + + +/* + EDQUOT is used only in 3 C files only in mysys/. If it does not exist on + system, we set it to some value which can never happen. +*/ +#ifndef EDQUOT +#define EDQUOT (-1) +#endif + +void my_error_unregister_all(void); + +#ifdef _WIN32 +/* my_winfile.c exports, should not be used outside mysys */ +extern File my_win_open(const char *path, int oflag); +extern int my_win_close(File fd); +extern size_t my_win_read(File fd, uchar *buffer, size_t count); +extern size_t my_win_write(File fd, const uchar *buffer, size_t count); +extern size_t my_win_pread(File fd, uchar *buffer, size_t count, + my_off_t offset); +extern size_t my_win_pwrite(File fd, const uchar *buffer, size_t count, + my_off_t offset); +extern my_off_t my_win_lseek(File fd, my_off_t pos, int whence); +extern int my_win_chsize(File fd, my_off_t newlength); +extern FILE* my_win_fopen(const char *filename, const char *type); +extern File my_win_fclose(FILE *file); +extern File my_win_fileno(FILE *file); +extern FILE* my_win_fdopen(File Filedes, const char *type); +extern int my_win_stat(const char *path, struct _stati64 *buf); +extern int my_win_fstat(File fd, struct _stati64 *buf); +extern int my_win_fsync(File fd); +extern File my_win_dup(File fd); +extern File my_win_sopen(const char *path, int oflag, int shflag, int perm); +extern File my_open_osfhandle(HANDLE handle, int oflag); +#endif + +void my_thread_destroy_mutex(void); +my_bool my_wait_for_other_threads_to_die(uint number_of_threads); diff --git a/externals/mysql/mysys/ptr_cmp.c b/externals/mysql/mysys/ptr_cmp.c new file mode 100644 index 00000000000..24ab6a1ea9c --- /dev/null +++ b/externals/mysql/mysys/ptr_cmp.c @@ -0,0 +1,192 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + get_ptr_compare(len) returns a pointer to a optimal byte-compare function + for a array of stringpointer where all strings have size len. + The bytes are compare as unsigned chars. + */ + +#include "mysys_priv.h" +#include + +static int ptr_compare(size_t *compare_length, uchar **a, uchar **b); +static int ptr_compare_0(size_t *compare_length, uchar **a, uchar **b); +static int ptr_compare_1(size_t *compare_length, uchar **a, uchar **b); +static int ptr_compare_2(size_t *compare_length, uchar **a, uchar **b); +static int ptr_compare_3(size_t *compare_length, uchar **a, uchar **b); + + /* Get a pointer to a optimal byte-compare function for a given size */ + +qsort2_cmp get_ptr_compare (size_t size) +{ + if (size < 4) + return (qsort2_cmp) ptr_compare; + switch (size & 3) { + case 0: return (qsort2_cmp) ptr_compare_0; + case 1: return (qsort2_cmp) ptr_compare_1; + case 2: return (qsort2_cmp) ptr_compare_2; + case 3: return (qsort2_cmp) ptr_compare_3; + } + return 0; /* Impossible */ +} + + + /* + Compare to keys to see witch is smaller. + Loop unrolled to make it quick !! + */ + +#define cmp(N) if (first[N] != last[N]) return (int) first[N] - (int) last[N] + +static int ptr_compare(size_t *compare_length, uchar **a, uchar **b) +{ + reg3 int length= *compare_length; + reg1 uchar *first,*last; + + first= *a; last= *b; + while (--length) + { + if (*first++ != *last++) + return (int) first[-1] - (int) last[-1]; + } + return (int) first[0] - (int) last[0]; +} + + +static int ptr_compare_0(size_t *compare_length,uchar **a, uchar **b) +{ + reg3 int length= *compare_length; + reg1 uchar *first,*last; + + first= *a; last= *b; + loop: + cmp(0); + cmp(1); + cmp(2); + cmp(3); + if ((length-=4)) + { + first+=4; + last+=4; + goto loop; + } + return (0); +} + + +static int ptr_compare_1(size_t *compare_length,uchar **a, uchar **b) +{ + reg3 int length= *compare_length-1; + reg1 uchar *first,*last; + + first= *a+1; last= *b+1; + cmp(-1); + loop: + cmp(0); + cmp(1); + cmp(2); + cmp(3); + if ((length-=4)) + { + first+=4; + last+=4; + goto loop; + } + return (0); +} + +static int ptr_compare_2(size_t *compare_length,uchar **a, uchar **b) +{ + reg3 int length= *compare_length-2; + reg1 uchar *first,*last; + + first= *a +2 ; last= *b +2; + cmp(-2); + cmp(-1); + loop: + cmp(0); + cmp(1); + cmp(2); + cmp(3); + if ((length-=4)) + { + first+=4; + last+=4; + goto loop; + } + return (0); +} + +static int ptr_compare_3(size_t *compare_length,uchar **a, uchar **b) +{ + reg3 int length= *compare_length-3; + reg1 uchar *first,*last; + + first= *a +3 ; last= *b +3; + cmp(-3); + cmp(-2); + cmp(-1); + loop: + cmp(0); + cmp(1); + cmp(2); + cmp(3); + if ((length-=4)) + { + first+=4; + last+=4; + goto loop; + } + return (0); +} + +void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos) +{ + switch (pack_length) { +#if SIZEOF_OFF_T > 4 + case 8: mi_int8store(buff,pos); break; + case 7: mi_int7store(buff,pos); break; + case 6: mi_int6store(buff,pos); break; + case 5: mi_int5store(buff,pos); break; +#endif + case 4: mi_int4store(buff,pos); break; + case 3: mi_int3store(buff,pos); break; + case 2: mi_int2store(buff,pos); break; + case 1: buff[0]= (uchar) pos; break; + default: DBUG_ASSERT(0); + } + return; +} + +my_off_t my_get_ptr(uchar *ptr, size_t pack_length) +{ + my_off_t pos; + switch (pack_length) { +#if SIZEOF_OFF_T > 4 + case 8: pos= (my_off_t) mi_uint8korr(ptr); break; + case 7: pos= (my_off_t) mi_uint7korr(ptr); break; + case 6: pos= (my_off_t) mi_uint6korr(ptr); break; + case 5: pos= (my_off_t) mi_uint5korr(ptr); break; +#endif + case 4: pos= (my_off_t) mi_uint4korr(ptr); break; + case 3: pos= (my_off_t) mi_uint3korr(ptr); break; + case 2: pos= (my_off_t) mi_uint2korr(ptr); break; + case 1: pos= (my_off_t) *(uchar*) ptr; break; + default: DBUG_ASSERT(0); return 0; + } + return pos; +} + diff --git a/externals/mysql/mysys/queues.c b/externals/mysql/mysys/queues.c new file mode 100644 index 00000000000..7ca978f185f --- /dev/null +++ b/externals/mysql/mysys/queues.c @@ -0,0 +1,690 @@ +/* Copyright (C) 2000, 2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Code for generell handling of priority Queues. + Implemention of queues from "Algoritms in C" by Robert Sedgewick. + An optimisation of _downheap suggested in Exercise 7.51 in "Data + Structures & Algorithms in C++" by Mark Allen Weiss, Second Edition + was implemented by Mikael Ronstrom 2005. Also the O(N) algorithm + of queue_fix was implemented. +*/ + +#include "mysys_priv.h" +#include "mysys_err.h" +#include + + +/* + Init queue + + SYNOPSIS + init_queue() + queue Queue to initialise + max_elements Max elements that will be put in queue + offset_to_key Offset to key in element stored in queue + Used when sending pointers to compare function + max_at_top Set to 1 if you want biggest element on top. + compare Compare function for elements, takes 3 arguments. + first_cmp_arg First argument to compare function + + NOTES + Will allocate max_element pointers for queue array + + RETURN + 0 ok + 1 Could not allocate memory +*/ + +int init_queue(QUEUE *queue, uint max_elements, uint offset_to_key, + pbool max_at_top, int (*compare) (void *, uchar *, uchar *), + void *first_cmp_arg) +{ + DBUG_ENTER("init_queue"); + if ((queue->root= (uchar **) my_malloc((max_elements+1)*sizeof(void*), + MYF(MY_WME))) == 0) + DBUG_RETURN(1); + queue->elements=0; + queue->compare=compare; + queue->first_cmp_arg=first_cmp_arg; + queue->max_elements=max_elements; + queue->offset_to_key=offset_to_key; + queue_set_max_at_top(queue, max_at_top); + DBUG_RETURN(0); +} + + + +/* + Init queue, uses init_queue internally for init work but also accepts + auto_extent as parameter + + SYNOPSIS + init_queue_ex() + queue Queue to initialise + max_elements Max elements that will be put in queue + offset_to_key Offset to key in element stored in queue + Used when sending pointers to compare function + max_at_top Set to 1 if you want biggest element on top. + compare Compare function for elements, takes 3 arguments. + first_cmp_arg First argument to compare function + auto_extent When the queue is full and there is insert operation + extend the queue. + + NOTES + Will allocate max_element pointers for queue array + + RETURN + 0 ok + 1 Could not allocate memory +*/ + +int init_queue_ex(QUEUE *queue, uint max_elements, uint offset_to_key, + pbool max_at_top, int (*compare) (void *, uchar *, uchar *), + void *first_cmp_arg, uint auto_extent) +{ + int ret; + DBUG_ENTER("init_queue_ex"); + + if ((ret= init_queue(queue, max_elements, offset_to_key, max_at_top, compare, + first_cmp_arg))) + DBUG_RETURN(ret); + + queue->auto_extent= auto_extent; + DBUG_RETURN(0); +} + +/* + Reinitialize queue for other usage + + SYNOPSIS + reinit_queue() + queue Queue to initialise + max_elements Max elements that will be put in queue + offset_to_key Offset to key in element stored in queue + Used when sending pointers to compare function + max_at_top Set to 1 if you want biggest element on top. + compare Compare function for elements, takes 3 arguments. + first_cmp_arg First argument to compare function + + NOTES + This will delete all elements from the queue. If you don't want this, + use resize_queue() instead. + + RETURN + 0 ok + EE_OUTOFMEMORY Wrong max_elements +*/ + +int reinit_queue(QUEUE *queue, uint max_elements, uint offset_to_key, + pbool max_at_top, int (*compare) (void *, uchar *, uchar *), + void *first_cmp_arg) +{ + DBUG_ENTER("reinit_queue"); + queue->elements=0; + queue->compare=compare; + queue->first_cmp_arg=first_cmp_arg; + queue->offset_to_key=offset_to_key; + queue_set_max_at_top(queue, max_at_top); + resize_queue(queue, max_elements); + DBUG_RETURN(0); +} + + +/* + Resize queue + + SYNOPSIS + resize_queue() + queue Queue + max_elements New max size for queue + + NOTES + If you resize queue to be less than the elements you have in it, + the extra elements will be deleted + + RETURN + 0 ok + 1 Error. In this case the queue is unchanged +*/ + +int resize_queue(QUEUE *queue, uint max_elements) +{ + uchar **new_root; + DBUG_ENTER("resize_queue"); + if (queue->max_elements == max_elements) + DBUG_RETURN(0); + if ((new_root= (uchar **) my_realloc((void *)queue->root, + (max_elements+1)*sizeof(void*), + MYF(MY_WME))) == 0) + DBUG_RETURN(1); + set_if_smaller(queue->elements, max_elements); + queue->max_elements= max_elements; + queue->root= new_root; + DBUG_RETURN(0); +} + + +/* + Delete queue + + SYNOPSIS + delete_queue() + queue Queue to delete + + IMPLEMENTATION + Just free allocated memory. + + NOTES + Can be called safely multiple times +*/ + +void delete_queue(QUEUE *queue) +{ + DBUG_ENTER("delete_queue"); + if (queue->root) + { + my_free((uchar*) queue->root,MYF(0)); + queue->root=0; + } + DBUG_VOID_RETURN; +} + + + /* Code for insert, search and delete of elements */ + +void queue_insert(register QUEUE *queue, uchar *element) +{ + reg2 uint idx, next; + DBUG_ASSERT(queue->elements < queue->max_elements); + queue->root[0]= element; + idx= ++queue->elements; + /* max_at_top swaps the comparison if we want to order by desc */ + while ((queue->compare(queue->first_cmp_arg, + element + queue->offset_to_key, + queue->root[(next= idx >> 1)] + + queue->offset_to_key) * queue->max_at_top) < 0) + { + queue->root[idx]= queue->root[next]; + idx= next; + } + queue->root[idx]= element; +} + +/* + Does safe insert. If no more space left on the queue resize it. + Return codes: + 0 - OK + 1 - Cannot allocate more memory + 2 - auto_extend is 0, the operation would + +*/ + +int queue_insert_safe(register QUEUE *queue, uchar *element) +{ + + if (queue->elements == queue->max_elements) + { + if (!queue->auto_extent) + return 2; + else if (resize_queue(queue, queue->max_elements + queue->auto_extent)) + return 1; + } + + queue_insert(queue, element); + return 0; +} + + + /* Remove item from queue */ + /* Returns pointer to removed element */ + +uchar *queue_remove(register QUEUE *queue, uint idx) +{ + uchar *element; + DBUG_ASSERT(idx < queue->max_elements); + element= queue->root[++idx]; /* Intern index starts from 1 */ + queue->root[idx]= queue->root[queue->elements--]; + _downheap(queue, idx); + return element; +} + + /* Fix when element on top has been replaced */ + +#ifndef queue_replaced +void queue_replaced(QUEUE *queue) +{ + _downheap(queue,1); +} +#endif + +#ifndef OLD_VERSION + +void _downheap(register QUEUE *queue, uint idx) +{ + uchar *element; + uint elements,half_queue,offset_to_key, next_index; + my_bool first= TRUE; + uint start_idx= idx; + + offset_to_key=queue->offset_to_key; + element=queue->root[idx]; + half_queue=(elements=queue->elements) >> 1; + + while (idx <= half_queue) + { + next_index=idx+idx; + if (next_index < elements && + (queue->compare(queue->first_cmp_arg, + queue->root[next_index]+offset_to_key, + queue->root[next_index+1]+offset_to_key) * + queue->max_at_top) > 0) + next_index++; + if (first && + (((queue->compare(queue->first_cmp_arg, + queue->root[next_index]+offset_to_key, + element+offset_to_key) * queue->max_at_top) >= 0))) + { + queue->root[idx]= element; + return; + } + queue->root[idx]=queue->root[next_index]; + idx=next_index; + first= FALSE; + } + + next_index= idx >> 1; + while (next_index > start_idx) + { + if ((queue->compare(queue->first_cmp_arg, + queue->root[next_index]+offset_to_key, + element+offset_to_key) * + queue->max_at_top) < 0) + break; + queue->root[idx]=queue->root[next_index]; + idx=next_index; + next_index= idx >> 1; + } + queue->root[idx]=element; +} + +#else + /* + The old _downheap version is kept for comparisons with the benchmark + suit or new benchmarks anyone wants to run for comparisons. + */ + /* Fix heap when index have changed */ +void _downheap(register QUEUE *queue, uint idx) +{ + uchar *element; + uint elements,half_queue,next_index,offset_to_key; + + offset_to_key=queue->offset_to_key; + element=queue->root[idx]; + half_queue=(elements=queue->elements) >> 1; + + while (idx <= half_queue) + { + next_index=idx+idx; + if (next_index < elements && + (queue->compare(queue->first_cmp_arg, + queue->root[next_index]+offset_to_key, + queue->root[next_index+1]+offset_to_key) * + queue->max_at_top) > 0) + next_index++; + if ((queue->compare(queue->first_cmp_arg, + queue->root[next_index]+offset_to_key, + element+offset_to_key) * queue->max_at_top) >= 0) + break; + queue->root[idx]=queue->root[next_index]; + idx=next_index; + } + queue->root[idx]=element; +} + + +#endif + +/* + Fix heap when every element was changed. +*/ + +void queue_fix(QUEUE *queue) +{ + uint i; + for (i= queue->elements >> 1; i > 0; i--) + _downheap(queue, i); +} + +#ifdef MAIN + /* + A test program for the priority queue implementation. + It can also be used to benchmark changes of the implementation + Build by doing the following in the directory mysys + make test_priority_queue + ./test_priority_queue + + Written by Mikael Ronström, 2005 + */ + +static uint num_array[1025]; +static uint tot_no_parts= 0; +static uint tot_no_loops= 0; +static uint expected_part= 0; +static uint expected_num= 0; +static my_bool max_ind= 0; +static my_bool fix_used= 0; +static ulonglong start_time= 0; + +static my_bool is_divisible_by(uint num, uint divisor) +{ + uint quotient= num / divisor; + if (quotient * divisor == num) + return TRUE; + return FALSE; +} + +void calculate_next() +{ + uint part= expected_part, num= expected_num; + uint no_parts= tot_no_parts; + if (max_ind) + { + do + { + while (++part <= no_parts) + { + if (is_divisible_by(num, part) && + (num <= ((1 << 21) + part))) + { + expected_part= part; + expected_num= num; + return; + } + } + part= 0; + } while (--num); + } + else + { + do + { + while (--part > 0) + { + if (is_divisible_by(num, part)) + { + expected_part= part; + expected_num= num; + return; + } + } + part= no_parts + 1; + } while (++num); + } +} + +void calculate_end_next(uint part) +{ + uint no_parts= tot_no_parts, num; + num_array[part]= 0; + if (max_ind) + { + expected_num= 0; + for (part= no_parts; part > 0 ; part--) + { + if (num_array[part]) + { + num= num_array[part] & 0x3FFFFF; + if (num >= expected_num) + { + expected_num= num; + expected_part= part; + } + } + } + if (expected_num == 0) + expected_part= 0; + } + else + { + expected_num= 0xFFFFFFFF; + for (part= 1; part <= no_parts; part++) + { + if (num_array[part]) + { + num= num_array[part] & 0x3FFFFF; + if (num <= expected_num) + { + expected_num= num; + expected_part= part; + } + } + } + if (expected_num == 0xFFFFFFFF) + expected_part= 0; + } + return; +} +static int test_compare(void *null_arg, uchar *a, uchar *b) +{ + uint a_num= (*(uint*)a) & 0x3FFFFF; + uint b_num= (*(uint*)b) & 0x3FFFFF; + uint a_part, b_part; + if (a_num > b_num) + return +1; + if (a_num < b_num) + return -1; + a_part= (*(uint*)a) >> 22; + b_part= (*(uint*)b) >> 22; + if (a_part < b_part) + return +1; + if (a_part > b_part) + return -1; + return 0; +} + +my_bool check_num(uint num_part) +{ + uint part= num_part >> 22; + uint num= num_part & 0x3FFFFF; + if (part == expected_part) + if (num == expected_num) + return FALSE; + printf("Expect part %u Expect num 0x%x got part %u num 0x%x max_ind %u fix_used %u \n", + expected_part, expected_num, part, num, max_ind, fix_used); + return TRUE; +} + + +void perform_insert(QUEUE *queue) +{ + uint i= 1, no_parts= tot_no_parts; + uint backward_start= 0; + + expected_part= 1; + expected_num= 1; + + if (max_ind) + backward_start= 1 << 21; + + do + { + uint num= (i + backward_start); + if (max_ind) + { + while (!is_divisible_by(num, i)) + num--; + if (max_ind && (num > expected_num || + (num == expected_num && i < expected_part))) + { + expected_num= num; + expected_part= i; + } + } + num_array[i]= num + (i << 22); + if (fix_used) + queue_element(queue, i-1)= (uchar*)&num_array[i]; + else + queue_insert(queue, (uchar*)&num_array[i]); + } while (++i <= no_parts); + if (fix_used) + { + queue->elements= no_parts; + queue_fix(queue); + } +} + +my_bool perform_ins_del(QUEUE *queue, my_bool max_ind) +{ + uint i= 0, no_loops= tot_no_loops, j= tot_no_parts; + do + { + uint num_part= *(uint*)queue_top(queue); + uint part= num_part >> 22; + if (check_num(num_part)) + return TRUE; + if (j++ >= no_loops) + { + calculate_end_next(part); + queue_remove(queue, (uint) 0); + } + else + { + calculate_next(); + if (max_ind) + num_array[part]-= part; + else + num_array[part]+= part; + queue_top(queue)= (uchar*)&num_array[part]; + queue_replaced(queue); + } + } while (++i < no_loops); + return FALSE; +} + +my_bool do_test(uint no_parts, uint l_max_ind, my_bool l_fix_used) +{ + QUEUE queue; + my_bool result; + max_ind= l_max_ind; + fix_used= l_fix_used; + init_queue(&queue, no_parts, 0, max_ind, test_compare, NULL); + tot_no_parts= no_parts; + tot_no_loops= 1024; + perform_insert(&queue); + if ((result= perform_ins_del(&queue, max_ind))) + delete_queue(&queue); + if (result) + { + printf("Error\n"); + return TRUE; + } + return FALSE; +} + +static void start_measurement() +{ + start_time= my_getsystime(); +} + +static void stop_measurement() +{ + ulonglong stop_time= my_getsystime(); + uint time_in_micros; + stop_time-= start_time; + stop_time/= 10; /* Convert to microseconds */ + time_in_micros= (uint)stop_time; + printf("Time expired is %u microseconds \n", time_in_micros); +} + +static void benchmark_test() +{ + QUEUE queue_real; + QUEUE *queue= &queue_real; + uint i, add; + fix_used= TRUE; + max_ind= FALSE; + tot_no_parts= 1024; + init_queue(queue, tot_no_parts, 0, max_ind, test_compare, NULL); + /* + First benchmark whether queue_fix is faster than using queue_insert + for sizes of 16 partitions. + */ + for (tot_no_parts= 2, add=2; tot_no_parts < 128; + tot_no_parts+= add, add++) + { + printf("Start benchmark queue_fix, tot_no_parts= %u \n", tot_no_parts); + start_measurement(); + for (i= 0; i < 128; i++) + { + perform_insert(queue); + queue_remove_all(queue); + } + stop_measurement(); + + fix_used= FALSE; + printf("Start benchmark queue_insert\n"); + start_measurement(); + for (i= 0; i < 128; i++) + { + perform_insert(queue); + queue_remove_all(queue); + } + stop_measurement(); + } + /* + Now benchmark insertion and deletion of 16400 elements. + Used in consecutive runs this shows whether the optimised _downheap + is faster than the standard implementation. + */ + printf("Start benchmarking _downheap \n"); + start_measurement(); + perform_insert(queue); + for (i= 0; i < 65536; i++) + { + uint num, part; + num= *(uint*)queue_top(queue); + num+= 16; + part= num >> 22; + num_array[part]= num; + queue_top(queue)= (uchar*)&num_array[part]; + queue_replaced(queue); + } + for (i= 0; i < 16; i++) + queue_remove(queue, (uint) 0); + queue_remove_all(queue); + stop_measurement(); +} + +int main() +{ + int i, add= 1; + for (i= 1; i < 1024; i+=add, add++) + { + printf("Start test for priority queue of size %u\n", i); + if (do_test(i, 0, 1)) + return -1; + if (do_test(i, 1, 1)) + return -1; + if (do_test(i, 0, 0)) + return -1; + if (do_test(i, 1, 0)) + return -1; + } + benchmark_test(); + printf("OK\n"); + return 0; +} +#endif diff --git a/externals/mysql/mysys/rijndael.c b/externals/mysql/mysys/rijndael.c new file mode 100644 index 00000000000..539d94d28c6 --- /dev/null +++ b/externals/mysql/mysys/rijndael.c @@ -0,0 +1,1395 @@ +/* Copyright (C) 2002, 2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +/* + Based on version 3.0 (December 2000) + + Optimised ANSI C code for the Rijndael cipher (now AES) + + author Vincent Rijmen + author Antoon Bosselaers + author Paulo Barreto +*/ + +#include +#include "mysys/rijndael.h" + +/* + Define the following to use fastest and much larger code (~10K extra code) + #define FULL_UNROLL +*/ + + +#ifdef NOT_USED +Te0[x] = S [x].[02, 01, 01, 03]; +Te1[x] = S [x].[03, 02, 01, 01]; +Te2[x] = S [x].[01, 03, 02, 01]; +Te3[x] = S [x].[01, 01, 03, 02]; +Te4[x] = S [x].[01, 01, 01, 01]; + +Td0[x] = Si[x].[0e, 09, 0d, 0b]; +Td1[x] = Si[x].[0b, 0e, 09, 0d]; +Td2[x] = Si[x].[0d, 0b, 0e, 09]; +Td3[x] = Si[x].[09, 0d, 0b, 0e]; +Td4[x] = Si[x].[01, 01, 01, 01]; +#endif + + +static const uint32 Te0[256]= +{ + 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, + 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, + 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, + 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, + 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, + 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, + 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, + 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, + 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, + 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, + 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, + 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, + 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, + 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, + 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, + 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, + 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, + 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, + 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, + 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, + 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, + 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, + 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, + 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, + 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, + 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, + 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, + 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, + 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, + 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, + 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, + 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, + 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, + 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, + 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, + 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, + 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, + 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, + 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, + 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, + 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, + 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, + 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, + 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, + 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, + 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, + 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, + 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, + 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, + 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, + 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, + 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, + 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, + 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, + 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, + 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, + 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, + 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, + 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, + 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, + 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, + 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, + 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, + 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, +}; + +static const uint32 Te1[256]= +{ + 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, + 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, + 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, + 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, + 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, + 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, + 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, + 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, + 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, + 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, + 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, + 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, + 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, + 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, + 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, + 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, + 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, + 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, + 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, + 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, + 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, + 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, + 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, + 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, + 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, + 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, + 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, + 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, + 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, + 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, + 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, + 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, + 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, + 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, + 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, + 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, + 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, + 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, + 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, + 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, + 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, + 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, + 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, + 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, + 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, + 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, + 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, + 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, + 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, + 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, + 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, + 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, + 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, + 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, + 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, + 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, + 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, + 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, + 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, + 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, + 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, + 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, + 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, + 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, +}; + +static const uint32 Te2[256]= +{ + 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, + 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, + 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, + 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, + 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, + 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, + 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, + 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, + 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, + 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, + 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, + 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, + 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, + 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, + 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, + 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, + 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, + 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, + 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, + 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, + 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, + 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, + 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, + 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, + 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, + 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, + 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, + 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, + 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, + 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, + 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, + 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, + 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, + 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, + 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, + 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, + 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, + 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, + 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, + 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, + 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, + 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, + 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, + 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, + 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, + 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, + 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, + 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, + 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, + 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, + 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, + 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, + 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, + 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, + 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, + 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, + 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, + 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, + 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, + 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, + 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, + 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, + 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, + 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, +}; + +static const uint32 Te3[256]= +{ + 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, + 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, + 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, + 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, + 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, + 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, + 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, + 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, + 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, + 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, + 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, + 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, + 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, + 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, + 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, + 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, + 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, + 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, + 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, + 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, + 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, + 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, + 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, + 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, + 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, + 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, + 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, + 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, + 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, + 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, + 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, + 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, + 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, + 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, + 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, + 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, + 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, + 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, + 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, + 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, + 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, + 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, + 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, + 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, + 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, + 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, + 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, + 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, + 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, + 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, + 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, + 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, + 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, + 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, + 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, + 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, + 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, + 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, + 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, + 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, + 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, + 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, + 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, + 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, +}; + +static const uint32 Te4[256]= +{ + 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, + 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, + 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, + 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, + 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, + 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, + 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, + 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, + 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, + 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, + 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, + 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, + 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, + 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, + 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, + 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, + 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, + 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, + 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, + 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, + 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, + 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, + 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, + 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, + 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, + 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, + 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, + 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, + 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, + 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, + 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, + 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, + 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, + 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, + 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, + 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, + 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, + 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, + 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, + 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, + 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, + 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, + 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, + 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, + 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, + 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, + 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, + 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, + 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, + 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, + 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, + 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, + 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, + 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, + 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, + 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, + 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, + 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, + 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, + 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, + 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, + 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, + 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, + 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, +}; + +static const uint32 Td0[256]= +{ + 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, + 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, + 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, + 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, + 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, + 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, + 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, + 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, + 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, + 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, + 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, + 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, + 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, + 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, + 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, + 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, + 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, + 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, + 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, + 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, + 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, + 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, + 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, + 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, + 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, + 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, + 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, + 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, + 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, + 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, + 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, + 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, + 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, + 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, + 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, + 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, + 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, + 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, + 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, + 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, + 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, + 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, + 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, + 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, + 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, + 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, + 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, + 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, + 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, + 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, + 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, + 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, + 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, + 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, + 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, + 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, + 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, + 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, + 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, + 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, + 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, + 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, + 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, + 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, +}; + +static const uint32 Td1[256]= +{ + 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, + 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, + 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, + 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, + 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, + 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, + 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, + 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, + 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, + 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, + 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, + 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, + 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, + 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, + 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, + 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, + 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, + 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, + 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, + 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, + 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, + 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, + 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, + 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, + 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, + 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, + 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, + 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, + 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, + 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, + 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, + 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, + 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, + 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, + 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, + 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, + 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, + 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, + 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, + 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, + 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, + 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, + 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, + 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, + 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, + 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, + 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, + 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, + 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, + 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, + 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, + 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, + 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, + 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, + 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, + 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, + 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, + 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, + 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, + 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, + 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, + 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, + 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, + 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, +}; + +static const uint32 Td2[256]= +{ + 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, + 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, + 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, + 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, + 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, + 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, + 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, + 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, + 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, + 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, + 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, + 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, + 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, + 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, + 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, + 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, + 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, + 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, + 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, + 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, + + 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, + 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, + 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, + 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, + 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, + 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, + 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, + 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, + 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, + 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, + 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, + 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, + 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, + 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, + 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, + 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, + 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, + 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, + 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, + 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, + 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, + 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, + 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, + 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, + 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, + 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, + 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, + 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, + 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, + 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, + 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, + 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, + 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, + 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, + 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, + 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, + 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, + 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, + 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, + 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, + 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, + 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, + 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, + 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, +}; + +static const uint32 Td3[256]= +{ + 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, + 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, + 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, + 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, + 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, + 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, + 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, + 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, + 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, + 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, + 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, + 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, + 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, + 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, + 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, + 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, + 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, + 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, + 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, + 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, + 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, + 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, + 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, + 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, + 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, + 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, + 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, + 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, + 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, + 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, + 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, + 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, + 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, + 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, + 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, + 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, + 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, + 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, + 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, + 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, + 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, + 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, + 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, + 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, + 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, + 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, + 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, + 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, + 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, + 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, + 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, + 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, + 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, + 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, + 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, + 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, + 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, + 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, + 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, + 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, + 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, + 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, + 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, + 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, +}; + +static const uint32 Td4[256]= +{ + 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, + 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, + 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, + 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, + 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, + 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, + 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, + 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, + 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, + 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, + 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, + 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, + 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, + 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, + 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, + 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, + 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, + 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, + 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, + 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, + 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, + 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, + 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, + 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, + 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, + 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, + 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, + 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, + 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, + 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, + 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, + 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, + 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, + 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, + 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, + 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, + 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, + 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, + 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, + 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, + 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, + 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, + 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, + 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, + 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, + 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, + 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, + 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, + 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, + 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, + 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, + 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, + 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, + 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, + 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, + 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, + 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, + 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, + 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, + 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, + 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, + 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, + 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, + 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, +}; + + +/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ +static const uint32 rcon[]= +{ + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x1B000000, 0x36000000, +}; + +#if defined(_MSC_VER) && defined(__i386__) + +#define RJ_SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) +#define GETuint32(p) RJ_SWAP(*((uint32 *)(p))) +#define PUTuint32(ct, st) { *((uint32 *)(ct)) = RJ_SWAP((st)); } + +#else + +#define GETuint32(pt) (((uint32)(pt)[0] << 24) ^ ((uint32)(pt)[1] << 16)\ + ^ ((uint32)(pt)[2] << 8) ^ ((uint32)(pt)[3])) +#define PUTuint32(ct, st) { (ct)[0] = (uint8)((st) >> 24); (ct)[1]\ += (uint8)((st) >> 16); (ct)[2] = (uint8)((st) >> 8); (ct)[3] = (uint8)(st); } + +#endif /* defined(_MSC_VER) && defined(__i386__) */ + + +/* + Expand the cipher key into the encryption key schedule. + + RETURN + The number of rounds for the given cipher key size. +*/ + +int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], + int keyBits) +{ + int i = 0; + uint32 temp; + + rk[0] = GETuint32(cipherKey ); + rk[1] = GETuint32(cipherKey + 4); + rk[2] = GETuint32(cipherKey + 8); + rk[3] = GETuint32(cipherKey + 12); + if (keyBits == 128) + { + for (;;) + { + temp = rk[3]; + rk[4] = (rk[0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]); + rk[5] = rk[1] ^ rk[4]; + rk[6] = rk[2] ^ rk[5]; + rk[7] = rk[3] ^ rk[6]; + if (++i == 10) + return 10; + rk += 4; + } + } + rk[4] = GETuint32(cipherKey + 16); + rk[5] = GETuint32(cipherKey + 20); + if (keyBits == 192) + { + for (;;) + { + temp = rk[ 5]; + rk[ 6] = (rk[ 0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]); + rk[ 7] = rk[ 1] ^ rk[ 6]; + rk[ 8] = rk[ 2] ^ rk[ 7]; + rk[ 9] = rk[ 3] ^ rk[ 8]; + if (++i == 8) + { + return 12; + } + rk[10] = rk[ 4] ^ rk[ 9]; + rk[11] = rk[ 5] ^ rk[10]; + rk += 6; + } + } + rk[6] = GETuint32(cipherKey + 24); + rk[7] = GETuint32(cipherKey + 28); + if (keyBits == 256) + { + for (;;) + { + temp = rk[ 7]; + rk[ 8] = (rk[ 0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]); + rk[ 9] = rk[ 1] ^ rk[ 8]; + rk[10] = rk[ 2] ^ rk[ 9]; + rk[11] = rk[ 3] ^ rk[10]; + if (++i == 7) + { + return 14; + } + temp = rk[11]; + rk[12] = (rk[ 4] ^ + (Te4[(temp >> 24) ] & 0xff000000) ^ + (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(temp ) & 0xff] & 0x000000ff)); + rk[13] = rk[ 5] ^ rk[12]; + rk[14] = rk[ 6] ^ rk[13]; + rk[15] = rk[ 7] ^ rk[14]; + rk += 8; + } + } + return 0; +} + + +/* + Expand the cipher key into the decryption key schedule. + + RETURN + The number of rounds for the given cipher key size. +*/ + +int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], + int keyBits) +{ + int nr, i, j; + uint32 temp; + + /* expand the cipher key: */ + nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits); + /* invert the order of the round keys: */ + for (i = 0, j = 4*nr; i < j; i += 4, j -= 4) + { + temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp; + temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp; + temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp; + temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp; + } + /* + Apply the inverse MixColumn transform to all round keys but the first + and the last: + */ + for (i = 1; i < nr; i++) + { + rk += 4; + + rk[0]= ( + Td0[Te4[(rk[0] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[0] ) & 0xff] & 0xff]); + + rk[1]= (Td0[Te4[(rk[1] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[1] ) & 0xff] & 0xff]); + + rk[2]= (Td0[Te4[(rk[2] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[2] ) & 0xff] & 0xff]); + + rk[3]= (Td0[Te4[(rk[3] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[3] ) & 0xff] & 0xff]); + } + return nr; +} + + +void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, + const uint8 pt[16], uint8 ct[16]) +{ + uint32 s0, s1, s2, s3, t0, t1, t2, t3; +#ifndef FULL_UNROLL + int r; +#endif /* FULL_UNROLL */ + + /* map byte array block to cipher state and add initial round key: */ + s0 = GETuint32(pt ) ^ rk[0]; + s1 = GETuint32(pt + 4) ^ rk[1]; + s2 = GETuint32(pt + 8) ^ rk[2]; + s3 = GETuint32(pt + 12) ^ rk[3]; + +#ifdef FULL_UNROLL + /* round 1: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[ 4]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[ 5]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[ 6]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[ 7]); + + /* round 2: */ + s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] + ^ Te3[t3 & 0xff] ^ rk[ 8]); + s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] + ^ Te3[t0 & 0xff] ^ rk[ 9]); + s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] + ^ Te3[t1 & 0xff] ^ rk[10]); + s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] + ^ Te3[t2 & 0xff] ^ rk[11]); + + /* round 3: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[12]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[13]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[14]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[15]); + + /* round 4: */ + s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] + ^ Te3[t3 & 0xff] ^ rk[16]); + s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] + ^ Te3[t0 & 0xff] ^ rk[17]); + s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] + ^ Te3[t1 & 0xff] ^ rk[18]); + s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] + ^ Te3[t2 & 0xff] ^ rk[19]); + + /* round 5: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[20]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[21]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[22]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[23]); + + /* round 6: */ + s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] + ^ Te3[t3 & 0xff] ^ rk[24]); + s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] + ^ Te3[t0 & 0xff] ^ rk[25]); + s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] + ^ Te3[t1 & 0xff] ^ rk[26]); + s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] + ^ Te3[t2 & 0xff] ^ rk[27]); + + /* round 7: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[28]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[29]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[30]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[31]); + + /* round 8: */ + s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] + ^ Te3[t3 & 0xff] ^ rk[32]); + s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] + ^ Te3[t0 & 0xff] ^ rk[33]); + s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] + ^ Te3[t1 & 0xff] ^ rk[34]); + s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] + ^ Te3[t2 & 0xff] ^ rk[35]); + + /* round 9: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[36]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[37]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[38]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[39]); + + if (Nr > 10) + { + /* round 10: */ + s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] + ^ Te3[t3 & 0xff] ^ rk[40]); + s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] + ^ Te3[t0 & 0xff] ^ rk[41]); + s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] + ^ Te3[t1 & 0xff] ^ rk[42]); + s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] + ^ Te3[t2 & 0xff] ^ rk[43]); + + /* round 11: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[44]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[45]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[46]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[47]); + + if (Nr > 12) + { + /* round 12: */ + s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] + ^ Te3[t3 & 0xff] ^ rk[48]); + s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] + ^ Te3[t0 & 0xff] ^ rk[49]); + s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] + ^ Te3[t1 & 0xff] ^ rk[50]); + s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] + ^ Te3[t2 & 0xff] ^ rk[51]); + + /* round 13: */ + t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] + ^ Te3[s3 & 0xff] ^ rk[52]); + t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] + ^ Te3[s0 & 0xff] ^ rk[53]); + t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] + ^ Te3[s1 & 0xff] ^ rk[54]); + t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] + ^ Te3[s2 & 0xff] ^ rk[55]); + } + } + rk += Nr << 2; +#else /* !FULL_UNROLL */ + + /* Nr - 1 full rounds: */ + + r = Nr >> 1; + for (;;) + { + t0= (Te0[(s0 >> 24) ] ^ + Te1[(s1 >> 16) & 0xff] ^ + Te2[(s2 >> 8) & 0xff] ^ + Te3[(s3 ) & 0xff] ^ + rk[4]); + + t1= (Te0[(s1 >> 24) ] ^ + Te1[(s2 >> 16) & 0xff] ^ + Te2[(s3 >> 8) & 0xff] ^ + Te3[(s0 ) & 0xff] ^ + rk[5]); + + t2= (Te0[(s2 >> 24) ] ^ + Te1[(s3 >> 16) & 0xff] ^ + Te2[(s0 >> 8) & 0xff] ^ + Te3[(s1 ) & 0xff] ^ + rk[6]); + + t3= (Te0[(s3 >> 24) ] ^ + Te1[(s0 >> 16) & 0xff] ^ + Te2[(s1 >> 8) & 0xff] ^ + Te3[(s2 ) & 0xff] ^ + rk[7]); + + rk+= 8; + if (--r == 0) + break; + + s0= (Te0[(t0 >> 24) ] ^ + Te1[(t1 >> 16) & 0xff] ^ + Te2[(t2 >> 8) & 0xff] ^ + Te3[(t3 ) & 0xff] ^ + rk[0]); + + s1= (Te0[(t1 >> 24) ] ^ + Te1[(t2 >> 16) & 0xff] ^ + Te2[(t3 >> 8) & 0xff] ^ + Te3[(t0 ) & 0xff] ^ + rk[1]); + + s2= (Te0[(t2 >> 24) ] ^ + Te1[(t3 >> 16) & 0xff] ^ + Te2[(t0 >> 8) & 0xff] ^ + Te3[(t1 ) & 0xff] ^ + rk[2]); + + s3= (Te0[(t3 >> 24) ] ^ + Te1[(t0 >> 16) & 0xff] ^ + Te2[(t1 >> 8) & 0xff] ^ + Te3[(t2 ) & 0xff] ^ + rk[3]); + } +#endif /* FULL_UNROLL */ + + /* Apply last round and map cipher state to byte array block: */ + s0= ((Te4[(t0 >> 24) ] & 0xff000000) ^ + (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t3 ) & 0xff] & 0x000000ff) ^ + rk[0]); + PUTuint32(ct , s0); + + s1= ((Te4[(t1 >> 24) ] & 0xff000000) ^ + (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t0 ) & 0xff] & 0x000000ff) ^ + rk[1]); + PUTuint32(ct + 4, s1); + + s2= ((Te4[(t2 >> 24) ] & 0xff000000) ^ + (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t1 ) & 0xff] & 0x000000ff) ^ + rk[2]); + PUTuint32(ct + 8, s2); + + s3= ((Te4[(t3 >> 24) ] & 0xff000000) ^ + (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t2 ) & 0xff] & 0x000000ff) ^ + rk[3]); + PUTuint32(ct + 12, s3); +} + + +void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, + const uint8 ct[16], uint8 pt[16]) +{ + uint32 s0, s1, s2, s3, t0, t1, t2, t3; +#ifndef FULL_UNROLL + int r; +#endif /* FULL_UNROLL */ + + /* Map byte array block to cipher state and add initial round key: */ + + s0 = GETuint32(ct ) ^ rk[0]; + s1 = GETuint32(ct + 4) ^ rk[1]; + s2 = GETuint32(ct + 8) ^ rk[2]; + s3 = GETuint32(ct + 12) ^ rk[3]; + +#ifdef FULL_UNROLL + /* round 1: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[ 4]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[ 5]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[ 6]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[ 7]); + + /* round 2: */ + s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] + ^ Td3[t1 & 0xff] ^ rk[ 8]); + s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] + ^ Td3[t2 & 0xff] ^ rk[ 9]); + s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] + ^ Td3[t3 & 0xff] ^ rk[10]); + s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] + ^ Td3[t0 & 0xff] ^ rk[11]); + + /* round 3: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[12]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[13]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[14]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[15]); + + /* round 4: */ + s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] + ^ Td3[t1 & 0xff] ^ rk[16]); + s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] + ^ Td3[t2 & 0xff] ^ rk[17]); + s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] + ^ Td3[t3 & 0xff] ^ rk[18]); + s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] + ^ Td3[t0 & 0xff] ^ rk[19]); + + /* round 5: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[20]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[21]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[22]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[23]); + + /* round 6: */ + s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] + ^ Td3[t1 & 0xff] ^ rk[24]); + s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] + ^ Td3[t2 & 0xff] ^ rk[25]); + s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] + ^ Td3[t3 & 0xff] ^ rk[26]); + s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] + ^ Td3[t0 & 0xff] ^ rk[27]); + + /* round 7: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[28]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[29]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[30]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[31]); + + /* round 8: */ + s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] + ^ Td3[t1 & 0xff] ^ rk[32]); + s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] + ^ Td3[t2 & 0xff] ^ rk[33]); + s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] + ^ Td3[t3 & 0xff] ^ rk[34]); + s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] + ^ Td3[t0 & 0xff] ^ rk[35]); + + /* round 9: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[36]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[37]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[38]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[39]); + + if (Nr > 10) + { + /* round 10: */ + s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] + ^ Td3[t1 & 0xff] ^ rk[40]); + s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] + ^ Td3[t2 & 0xff] ^ rk[41]); + s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] + ^ Td3[t3 & 0xff] ^ rk[42]); + s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] + ^ Td3[t0 & 0xff] ^ rk[43]); + + /* round 11: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[44]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[45]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[46]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[47]); + + if (Nr > 12) + { + /* round 12: */ + s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] + ^ Td3[t1 & 0xff] ^ rk[48]); + s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] + ^ Td3[t2 & 0xff] ^ rk[49]); + s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] + ^ Td3[t3 & 0xff] ^ rk[50]); + s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] + ^ Td3[t0 & 0xff] ^ rk[51]); + + /* round 13: */ + t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] + ^ Td3[s1 & 0xff] ^ rk[52]); + t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] + ^ Td3[s2 & 0xff] ^ rk[53]); + t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] + ^ Td3[s3 & 0xff] ^ rk[54]); + t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] + ^ Td3[s0 & 0xff] ^ rk[55]); + } + } + rk += Nr << 2; +#else /* !FULL_UNROLL */ + + /* Nr - 1 full rounds: */ + r= (Nr >> 1); + for (;;) + { + t0= (Td0[(s0 >> 24) ] ^ + Td1[(s3 >> 16) & 0xff] ^ + Td2[(s2 >> 8) & 0xff] ^ + Td3[(s1 ) & 0xff] ^ + rk[4]); + + t1= (Td0[(s1 >> 24) ] ^ + Td1[(s0 >> 16) & 0xff] ^ + Td2[(s3 >> 8) & 0xff] ^ + Td3[(s2 ) & 0xff] ^ + rk[5]); + + t2= (Td0[(s2 >> 24) ] ^ + Td1[(s1 >> 16) & 0xff] ^ + Td2[(s0 >> 8) & 0xff] ^ + Td3[(s3 ) & 0xff] ^ + rk[6]); + + t3= (Td0[(s3 >> 24) ] ^ + Td1[(s2 >> 16) & 0xff] ^ + Td2[(s1 >> 8) & 0xff] ^ + Td3[(s0 ) & 0xff] ^ + rk[7]); + + rk+= 8; + if (--r == 0) + break; + + s0= (Td0[(t0 >> 24) ] ^ + Td1[(t3 >> 16) & 0xff] ^ + Td2[(t2 >> 8) & 0xff] ^ + Td3[(t1 ) & 0xff] ^ + rk[0]); + + s1= (Td0[(t1 >> 24) ] ^ + Td1[(t0 >> 16) & 0xff] ^ + Td2[(t3 >> 8) & 0xff] ^ + Td3[(t2 ) & 0xff] ^ + rk[1]); + + s2= (Td0[(t2 >> 24) ] ^ + Td1[(t1 >> 16) & 0xff] ^ + Td2[(t0 >> 8) & 0xff] ^ + Td3[(t3 ) & 0xff] ^ + rk[2]); + + s3= (Td0[(t3 >> 24) ] ^ + Td1[(t2 >> 16) & 0xff] ^ + Td2[(t1 >> 8) & 0xff] ^ + Td3[(t0 ) & 0xff] ^ + rk[3]); + } + +#endif /* FULL_UNROLL */ + + /* Apply last round and map cipher state to byte array block: */ + + s0= ((Td4[(t0 >> 24) ] & 0xff000000) ^ + (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t1 ) & 0xff] & 0x000000ff) ^ + rk[0]); + PUTuint32(pt , s0); + + s1= ((Td4[(t1 >> 24) ] & 0xff000000) ^ + (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t2 ) & 0xff] & 0x000000ff) ^ + rk[1]); + PUTuint32(pt + 4, s1); + + s2= ((Td4[(t2 >> 24) ] & 0xff000000) ^ + (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t3 ) & 0xff] & 0x000000ff) ^ + rk[2]); + PUTuint32(pt + 8, s2); + + s3= ((Td4[(t3 >> 24) ] & 0xff000000) ^ + (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t0 ) & 0xff] & 0x000000ff) ^ + rk[3]); + PUTuint32(pt + 12, s3); +} diff --git a/externals/mysql/mysys/rijndael.h b/externals/mysql/mysys/rijndael.h new file mode 100644 index 00000000000..89963a85c99 --- /dev/null +++ b/externals/mysql/mysys/rijndael.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2002 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +/* + rijndael-alg-fst.h + + @version 3.0 (December 2000) + Optimised ANSI C code for the Rijndael cipher (now AES) + @author Vincent Rijmen + @author Antoon Bosselaers + @author Paulo Barreto + + This code is hereby placed in the public domain. + Modified by Peter Zaitsev to fit MySQL coding style. + */ + +#define AES_MAXKC (256/32) +#define AES_MAXKB (256/8) +#define AES_MAXNR 14 + +int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], + int keyBits); +int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], + int keyBits); +void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, + const uint8 pt[16], uint8 ct[16]); +void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, + const uint8 ct[16], uint8 pt[16]); diff --git a/externals/mysql/mysys/safemalloc.c b/externals/mysql/mysys/safemalloc.c new file mode 100644 index 00000000000..fc32df728b7 --- /dev/null +++ b/externals/mysql/mysys/safemalloc.c @@ -0,0 +1,576 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + * Memory sub-system, written by Bjorn Benson + Fixed to use my_sys scheme by Michael Widenius + + [This posting refers to an article entitled "oops, corrupted memory + again!" in net.lang.c. I am posting it here because it is source.] + + My tool for approaching this problem is to build another level of data + abstraction on top of malloc() and free() that implements some checking. + This does a number of things for you: + - Checks for overruns and underruns on allocated data + - Keeps track of where in the program the memory was malloc'ed + - Reports on pieces of memory that were not free'ed + - Records some statistics such as maximum memory used + - Marks newly malloc'ed and newly free'ed memory with special values + You can use this scheme to: + - Find bugs such as overrun, underrun, etc because you know where + a piece of data was malloc'ed and where it was free'ed + - Find bugs where memory was not free'ed + - Find bugs where newly malloc'ed memory is used without initializing + - Find bugs where newly free'ed memory is still used + - Determine how much memory your program really uses + - and other things + + To implement my scheme you must have a C compiler that has __LINE__ and + __FILE__ macros. If your compiler doesn't have these then (a) buy another: + compilers that do are available on UNIX 4.2bsd based systems and the PC, + and probably on other machines; or (b) change my scheme somehow. I have + recomendations on both these points if you would like them (e-mail please). + + There are 4 functions in my package: + char *NEW( uSize ) Allocate memory of uSize bytes + (equivalent to malloc()) + char *REA( pPtr, uSize) Allocate memory of uSize bytes, move data and + free pPtr. + (equivalent to realloc()) + FREE( pPtr ) Free memory allocated by NEW + (equivalent to free()) + TERMINATE(file,flag) End system, report errors and stats on file + I personally use two more functions, but have not included them here: + char *STRSAVE( sPtr ) Save a copy of the string in dynamic memory + char *RENEW( pPtr, uSize ) + (equivalent to realloc()) + +*/ + +#ifndef SAFEMALLOC +#define SAFEMALLOC /* Get protos from my_sys */ +#endif + +#include "mysys_priv.h" +#include +#include "my_static.h" +#include "mysys_err.h" + +ulonglong sf_malloc_mem_limit= ~(ulonglong)0; + +#ifndef PEDANTIC_SAFEMALLOC +/* + Set to 1 after TERMINATE() if we had to fiddle with sf_malloc_count and + the linked list of blocks so that _sanity() will not fuss when it + is not supposed to +*/ +static int sf_malloc_tampered= 0; +#endif + + + /* Static functions prototypes */ + +static int check_ptr(const char *where, uchar *ptr, const char *sFile, + uint uLine); +static int _checkchunk(struct st_irem *pRec, const char *sFile, uint uLine); + +/* + Note: We only fill up the allocated block. This do not include + malloc() roundoff or the extra space required by the irem + structures. +*/ + +/* + NEW'ed memory is filled with this value so that references to it will + end up being very strange. +*/ +#define ALLOC_VAL (uchar) 0xA5 +/* + FEEE'ed memory is filled with this value so that references to it will + end up being very strange. +*/ +#define FREE_VAL (uchar) 0x8F +#define MAGICKEY 0x14235296 /* A magic value for underrun key */ + +/* + Warning: do not change the MAGICEND? values to something with the + high bit set. Various C compilers (like the 4.2bsd one) do not do + the sign extension right later on in this code and you will get + erroneous errors. +*/ + +#define MAGICEND0 0x68 /* Magic values for overrun keys */ +#define MAGICEND1 0x34 /* " */ +#define MAGICEND2 0x7A /* " */ +#define MAGICEND3 0x15 /* " */ + + +/* Allocate some memory. */ + +void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) +{ + struct st_irem *irem; + uchar *data; + DBUG_ENTER("_mymalloc"); + DBUG_PRINT("enter",("Size: %lu", (ulong) size)); + + if (!sf_malloc_quick) + (void) _sanity (filename, lineno); + + /* + Test for memory limit overrun. + If compiled with DBUG, test for error injection. Described in my_sys.h. + */ + if ((size + sf_malloc_cur_memory > sf_malloc_mem_limit) + IF_DBUG(|| my_malloc_error_inject)) + { + IF_DBUG(if (my_malloc_error_inject) + errno= ENOMEM; + my_malloc_error_inject= 0); + irem= 0; + } + else + { + /* Allocate the physical memory */ + irem= (struct st_irem *) malloc (ALIGN_SIZE(sizeof(struct st_irem)) + + sf_malloc_prehunc + + size + /* size requested */ + 4 + /* overrun mark */ + sf_malloc_endhunc); + } + /* Check if there isn't anymore memory avaiable */ + if (!irem) + { + if (MyFlags & MY_FAE) + error_handler_hook=fatal_error_handler_hook; + if (MyFlags & (MY_FAE+MY_WME)) + { + char buff[MYSYS_ERRMSG_SIZE]; + my_errno=errno; + my_snprintf(buff, sizeof(buff), "Out of memory at line %d, '%s'", + lineno, filename); + my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); + my_snprintf(buff, sizeof(buff), + "needed %lu byte (%luk), memory in use: %lu bytes (%luk)", + (ulong) size, (ulong) (size + 1023L) / 1024L, + (ulong) sf_malloc_max_memory, + (ulong) (sf_malloc_max_memory + 1023L) / 1024L); + my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); + } + DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", + sf_malloc_max_memory,lineno, filename)); + if (MyFlags & MY_FAE) + exit(1); + DBUG_RETURN ((void*) 0); + } + + /* Fill up the structure */ + data= (((uchar*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + + sf_malloc_prehunc); + *((uint32*) (data-sizeof(uint32)))= MAGICKEY; + data[size + 0]= MAGICEND0; + data[size + 1]= MAGICEND1; + data[size + 2]= MAGICEND2; + data[size + 3]= MAGICEND3; + irem->filename= (char *) filename; + irem->linenum= lineno; + irem->datasize= size; + irem->prev= NULL; + + /* Add this remember structure to the linked list */ + pthread_mutex_lock(&THR_LOCK_malloc); + if ((irem->next= sf_malloc_root)) + sf_malloc_root->prev= irem; + sf_malloc_root= irem; + + /* Keep the statistics */ + sf_malloc_cur_memory+= size; + if (sf_malloc_cur_memory > sf_malloc_max_memory) + sf_malloc_max_memory= sf_malloc_cur_memory; + sf_malloc_count++; + pthread_mutex_unlock(&THR_LOCK_malloc); + + /* Set the memory to the aribtrary wierd value */ + if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) + bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); + /* Return a pointer to the real data */ + DBUG_PRINT("exit",("ptr: %p", data)); + if (sf_min_adress > data) + sf_min_adress= data; + if (sf_max_adress < data) + sf_max_adress= data; + DBUG_RETURN((void*) data); +} + + +/* + Allocate some new memory and move old memoryblock there. + Free then old memoryblock +*/ + +void *_myrealloc(register void *ptr, register size_t size, + const char *filename, uint lineno, myf MyFlags) +{ + struct st_irem *irem; + char *data; + DBUG_ENTER("_myrealloc"); + + if (!ptr && (MyFlags & MY_ALLOW_ZERO_PTR)) + DBUG_RETURN(_mymalloc(size, filename, lineno, MyFlags)); + + if (!sf_malloc_quick) + (void) _sanity (filename, lineno); + + if (check_ptr("Reallocating", (uchar*) ptr, filename, lineno)) + DBUG_RETURN((uchar*) NULL); + + irem= (struct st_irem *) (((char*) ptr) - ALIGN_SIZE(sizeof(struct st_irem))- + sf_malloc_prehunc); + if (*((uint32*) (((char*) ptr)- sizeof(uint32))) != MAGICKEY) + { + fprintf(stderr, "Error: Reallocating unallocated data at line %d, '%s'\n", + lineno, filename); + DBUG_PRINT("safe",("Reallocating unallocated data at line %d, '%s'", + lineno, filename)); + (void) fflush(stderr); + DBUG_RETURN((uchar*) NULL); + } + + if ((data= _mymalloc(size,filename,lineno,MyFlags))) /* Allocate new area */ + { + size=min(size, irem->datasize); /* Move as much as possibly */ + memcpy((uchar*) data, ptr, (size_t) size); /* Copy old data */ + _myfree(ptr, filename, lineno, 0); /* Free not needed area */ + } + else + { + if (MyFlags & MY_HOLD_ON_ERROR) + DBUG_RETURN(ptr); + if (MyFlags & MY_FREE_ON_ERROR) + _myfree(ptr, filename, lineno, 0); + } + DBUG_RETURN(data); +} /* _myrealloc */ + + +/* Deallocate some memory. */ + +void _myfree(void *ptr, const char *filename, uint lineno, myf myflags) +{ + struct st_irem *irem; + DBUG_ENTER("_myfree"); + DBUG_PRINT("enter",("ptr: %p", ptr)); + + if (!sf_malloc_quick) + (void) _sanity (filename, lineno); + + if ((!ptr && (myflags & MY_ALLOW_ZERO_PTR)) || + check_ptr("Freeing",(uchar*) ptr,filename,lineno)) + DBUG_VOID_RETURN; + + /* Calculate the address of the remember structure */ + irem= (struct st_irem *) ((char*) ptr- ALIGN_SIZE(sizeof(struct st_irem))- + sf_malloc_prehunc); + + /* + Check to make sure that we have a real remember structure. + Note: this test could fail for four reasons: + (1) The memory was already free'ed + (2) The memory was never new'ed + (3) There was an underrun + (4) A stray pointer hit this location + */ + + if (*((uint32*) ((char*) ptr- sizeof(uint32))) != MAGICKEY) + { + fprintf(stderr, "Error: Freeing unallocated data at line %d, '%s'\n", + lineno, filename); + DBUG_PRINT("safe",("Unallocated data at line %d, '%s'",lineno,filename)); + (void) fflush(stderr); + DBUG_VOID_RETURN; + } + + /* Remove this structure from the linked list */ + pthread_mutex_lock(&THR_LOCK_malloc); + if (irem->prev) + irem->prev->next= irem->next; + else + sf_malloc_root= irem->next; + + if (irem->next) + irem->next->prev= irem->prev; + /* Handle the statistics */ + sf_malloc_cur_memory-= irem->datasize; + sf_malloc_count--; + pthread_mutex_unlock(&THR_LOCK_malloc); + +#ifndef HAVE_purify + /* Mark this data as free'ed */ + if (!sf_malloc_quick) + bfill(ptr, irem->datasize, (pchar) FREE_VAL); +#endif + *((uint32*) ((char*) ptr- sizeof(uint32)))= ~MAGICKEY; + /* Actually free the memory */ + free((char*) irem); + DBUG_VOID_RETURN; +} + + /* Check if we have a wrong pointer */ + +static int check_ptr(const char *where, uchar *ptr, const char *filename, + uint lineno) +{ + if (!ptr) + { + fprintf(stderr, "Error: %s NULL pointer at line %d, '%s'\n", + where,lineno, filename); + DBUG_PRINT("safe",("Null pointer at line %d '%s'", lineno, filename)); + (void) fflush(stderr); + return 1; + } +#ifndef _MSC_VER + if ((long) ptr & (ALIGN_SIZE(1)-1)) + { + fprintf(stderr, "Error: %s wrong aligned pointer at line %d, '%s'\n", + where,lineno, filename); + DBUG_PRINT("safe",("Wrong aligned pointer at line %d, '%s'", + lineno,filename)); + (void) fflush(stderr); + return 1; + } +#endif + if (ptr < sf_min_adress || ptr > sf_max_adress) + { + fprintf(stderr, "Error: %s pointer out of range at line %d, '%s'\n", + where,lineno, filename); + DBUG_PRINT("safe",("Pointer out of range at line %d '%s'", + lineno,filename)); + (void) fflush(stderr); + return 1; + } + return 0; +} + + +/* + Report on all the memory pieces that have not been free'ed + + SYNOPSIS + TERMINATE() + file Write output to this file + flag If <> 0, also write statistics + */ + +void TERMINATE(FILE *file, uint flag) +{ + struct st_irem *irem; + DBUG_ENTER("TERMINATE"); + pthread_mutex_lock(&THR_LOCK_malloc); + + /* + Report the difference between number of calls to + NEW and the number of calls to FREE. >0 means more + NEWs than FREEs. <0, etc. + */ + + if (sf_malloc_count) + { + if (file) + { + fprintf(file, "Warning: Not freed memory segments: %u\n", sf_malloc_count); + (void) fflush(file); + } + DBUG_PRINT("safe",("sf_malloc_count: %u", sf_malloc_count)); + } + + /* + Report on all the memory that was allocated with NEW + but not free'ed with FREE. + */ + + if ((irem= sf_malloc_root)) + { + if (file) + { + fprintf(file, "Warning: Memory that was not free'ed (%lu bytes):\n", + (ulong) sf_malloc_cur_memory); + (void) fflush(file); + } + DBUG_PRINT("safe",("Memory that was not free'ed (%lu bytes):", + (ulong) sf_malloc_cur_memory)); + while (irem) + { + char *data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + + sf_malloc_prehunc); + if (file) + { + fprintf(file, + "\t%6lu bytes at %p, allocated at line %4u in '%s'", + (ulong) irem->datasize, data, irem->linenum, irem->filename); + fprintf(file, "\n"); + (void) fflush(file); + } + DBUG_PRINT("safe", + ("%6lu bytes at %p, allocated at line %4d in '%s'", + (ulong) irem->datasize, + data, irem->linenum, irem->filename)); + irem= irem->next; + } + } + /* Report the memory usage statistics */ + if (file && flag) + { + fprintf(file, "Maximum memory usage: %lu bytes (%luk)\n", + (ulong) sf_malloc_max_memory, + (ulong) (sf_malloc_max_memory + 1023L) / 1024L); + (void) fflush(file); + } + DBUG_PRINT("safe",("Maximum memory usage: %lu bytes (%luk)", + (ulong) sf_malloc_max_memory, + (ulong) (sf_malloc_max_memory + 1023L) /1024L)); + pthread_mutex_unlock(&THR_LOCK_malloc); + DBUG_VOID_RETURN; +} + + +/* + Report where a piece of memory was allocated + + This is usefull to call from withing a debugger +*/ + + +void sf_malloc_report_allocated(void *memory) +{ + struct st_irem *irem; + for (irem= sf_malloc_root ; irem ; irem=irem->next) + { + char *data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + + sf_malloc_prehunc); + if (data <= (char*) memory && (char*) memory <= data + irem->datasize) + { + printf("%lu bytes at %p, allocated at line %u in '%s'\n", + (ulong) irem->datasize, data, irem->linenum, irem->filename); + break; + } + } +} + + /* Returns 0 if chunk is ok */ + +static int _checkchunk(register struct st_irem *irem, const char *filename, + uint lineno) +{ + int flag=0; + char *magicp, *data; + + data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + + sf_malloc_prehunc); + /* Check for a possible underrun */ + if (*((uint32*) (data- sizeof(uint32))) != MAGICKEY) + { + fprintf(stderr, "Error: Memory allocated at %s:%d was underrun,", + irem->filename, irem->linenum); + fprintf(stderr, " discovered at %s:%d\n", filename, lineno); + (void) fflush(stderr); + DBUG_PRINT("safe",("Underrun at %p, allocated at %s:%d", + data, irem->filename, irem->linenum)); + flag=1; + } + + /* Check for a possible overrun */ + magicp= data + irem->datasize; + if (*magicp++ != MAGICEND0 || + *magicp++ != MAGICEND1 || + *magicp++ != MAGICEND2 || + *magicp++ != MAGICEND3) + { + fprintf(stderr, "Error: Memory allocated at %s:%d was overrun,", + irem->filename, irem->linenum); + fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno); + (void) fflush(stderr); + DBUG_PRINT("safe",("Overrun at %p, allocated at %s:%d", + data, irem->filename, irem->linenum)); + flag=1; + } + return(flag); +} + + + /* Returns how many wrong chunks */ + +int _sanity(const char *filename, uint lineno) +{ + reg1 struct st_irem *irem; + reg2 int flag=0; + uint count=0; + + pthread_mutex_lock(&THR_LOCK_malloc); +#ifndef PEDANTIC_SAFEMALLOC + if (sf_malloc_tampered && (int) sf_malloc_count < 0) + sf_malloc_count=0; +#endif + count=sf_malloc_count; + for (irem= sf_malloc_root; irem != NULL && count-- ; irem= irem->next) + flag+= _checkchunk (irem, filename, lineno); + pthread_mutex_unlock(&THR_LOCK_malloc); + if (count || irem) + { + const char *format="Error: Safemalloc link list destroyed, discovered at '%s:%d'"; + fprintf(stderr, format, filename, lineno); fputc('\n',stderr); + fprintf(stderr, "root=%p,count=%d,irem=%p\n", sf_malloc_root,count,irem); + (void) fflush(stderr); + DBUG_PRINT("safe",(format, filename, lineno)); + flag=1; + } + return flag; +} /* _sanity */ + + + /* malloc and copy */ + +void *_my_memdup(const void *from, size_t length, const char *filename, + uint lineno, myf MyFlags) +{ + void *ptr; + if ((ptr= _mymalloc(length,filename,lineno,MyFlags)) != 0) + memcpy(ptr, from, length); + return(ptr); +} /*_my_memdup */ + + +char *_my_strdup(const char *from, const char *filename, uint lineno, + myf MyFlags) +{ + char *ptr; + size_t length= strlen(from)+1; + if ((ptr= (char*) _mymalloc(length,filename,lineno,MyFlags)) != 0) + memcpy((uchar*) ptr, (uchar*) from, (size_t) length); + return(ptr); +} /* _my_strdup */ + + +char *_my_strndup(const char *from, size_t length, + const char *filename, uint lineno, + myf MyFlags) +{ + char *ptr; + if ((ptr= (char*) _mymalloc(length+1,filename,lineno,MyFlags)) != 0) + { + memcpy((uchar*) ptr, (uchar*) from, (size_t) length); + ptr[length]=0; + } + return(ptr); +} diff --git a/externals/mysql/mysys/sha1.c b/externals/mysql/mysys/sha1.c new file mode 100644 index 00000000000..3469e480c26 --- /dev/null +++ b/externals/mysql/mysys/sha1.c @@ -0,0 +1,391 @@ +/* Copyright (C) 2002, 2004, 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Original Source from: http://www.faqs.org/rfcs/rfc3174.html + + DESCRIPTION + This file implements the Secure Hashing Algorithm 1 as + defined in FIPS PUB 180-1 published April 17, 1995. + + The SHA-1, produces a 160-bit message digest for a given data + stream. It should take about 2**n steps to find a message with the + same digest as a given message and 2**(n/2) to find any two + messages with the same digest, when n is the digest size in bits. + Therefore, this algorithm can serve as a means of providing a + "fingerprint" for a message. + + PORTABILITY ISSUES + SHA-1 is defined in terms of 32-bit "words". This code uses + (included via "sha1.h" to define 32 and 8 bit unsigned + integer types. If your C compiler does not support 32 bit unsigned + integers, this code is not appropriate. + + CAVEATS + SHA-1 is designed to work with messages less than 2^64 bits long. + Although SHA-1 allows a message digest to be generated for messages + of any number of bits less than 2^64, this implementation only + works with messages with a length that is a multiple of the size of + an 8-bit character. + + CHANGES + 2002 by Peter Zaitsev to + - fit to new prototypes according to MySQL standard + - Some optimizations + - All checking is now done in debug only mode + - More comments +*/ + +#include "my_global.h" +#include "m_string.h" +#include "sha1.h" + +/* + Define the SHA1 circular left shift macro +*/ + +#define SHA1CircularShift(bits,word) \ + (((word) << (bits)) | ((word) >> (32-(bits)))) + +/* Local Function Prototyptes */ +static void SHA1PadMessage(SHA1_CONTEXT*); +static void SHA1ProcessMessageBlock(SHA1_CONTEXT*); + + +/* + Initialize SHA1Context + + SYNOPSIS + mysql_sha1_reset() + context [in/out] The context to reset. + + DESCRIPTION + This function will initialize the SHA1Context in preparation + for computing a new SHA1 message digest. + + RETURN + SHA_SUCCESS ok + != SHA_SUCCESS sha Error Code. +*/ + + +const uint32 sha_const_key[5]= +{ + 0x67452301, + 0xEFCDAB89, + 0x98BADCFE, + 0x10325476, + 0xC3D2E1F0 +}; + + +int mysql_sha1_reset(SHA1_CONTEXT *context) +{ +#ifndef DBUG_OFF + if (!context) + return SHA_NULL; +#endif + + context->Length = 0; + context->Message_Block_Index = 0; + + context->Intermediate_Hash[0] = sha_const_key[0]; + context->Intermediate_Hash[1] = sha_const_key[1]; + context->Intermediate_Hash[2] = sha_const_key[2]; + context->Intermediate_Hash[3] = sha_const_key[3]; + context->Intermediate_Hash[4] = sha_const_key[4]; + + context->Computed = 0; + context->Corrupted = 0; + + return SHA_SUCCESS; +} + + +/* + Return the 160-bit message digest into the array provided by the caller + + SYNOPSIS + mysql_sha1_result() + context [in/out] The context to use to calculate the SHA-1 hash. + Message_Digest: [out] Where the digest is returned. + + DESCRIPTION + NOTE: The first octet of hash is stored in the 0th element, + the last octet of hash in the 19th element. + + RETURN + SHA_SUCCESS ok + != SHA_SUCCESS sha Error Code. +*/ + +int mysql_sha1_result(SHA1_CONTEXT *context, + uint8 Message_Digest[SHA1_HASH_SIZE]) +{ + int i; + +#ifndef DBUG_OFF + if (!context || !Message_Digest) + return SHA_NULL; + + if (context->Corrupted) + return context->Corrupted; +#endif + + if (!context->Computed) + { + SHA1PadMessage(context); + /* message may be sensitive, clear it out */ + bzero((char*) context->Message_Block,64); + context->Length = 0; /* and clear length */ + context->Computed = 1; + } + + for (i = 0; i < SHA1_HASH_SIZE; i++) + Message_Digest[i] = (int8)((context->Intermediate_Hash[i>>2] >> 8 + * ( 3 - ( i & 0x03 ) ))); + return SHA_SUCCESS; +} + + +/* + Accepts an array of octets as the next portion of the message. + + SYNOPSIS + mysql_sha1_input() + context [in/out] The SHA context to update + message_array An array of characters representing the next portion + of the message. + length The length of the message in message_array + + RETURN + SHA_SUCCESS ok + != SHA_SUCCESS sha Error Code. +*/ + +int mysql_sha1_input(SHA1_CONTEXT *context, const uint8 *message_array, + unsigned length) +{ + if (!length) + return SHA_SUCCESS; + +#ifndef DBUG_OFF + /* We assume client konows what it is doing in non-debug mode */ + if (!context || !message_array) + return SHA_NULL; + if (context->Computed) + return (context->Corrupted= SHA_STATE_ERROR); + if (context->Corrupted) + return context->Corrupted; +#endif + + while (length--) + { + context->Message_Block[context->Message_Block_Index++]= + (*message_array & 0xFF); + context->Length += 8; /* Length is in bits */ + +#ifndef DBUG_OFF + /* + Then we're not debugging we assume we never will get message longer + 2^64 bits. + */ + if (context->Length == 0) + return (context->Corrupted= 1); /* Message is too long */ +#endif + + if (context->Message_Block_Index == 64) + { + SHA1ProcessMessageBlock(context); + } + message_array++; + } + return SHA_SUCCESS; +} + + +/* + Process the next 512 bits of the message stored in the Message_Block array. + + SYNOPSIS + SHA1ProcessMessageBlock() + + DESCRIPTION + Many of the variable names in this code, especially the single + character names, were used because those were the names used in + the publication. +*/ + +/* Constants defined in SHA-1 */ +static const uint32 K[]= +{ + 0x5A827999, + 0x6ED9EBA1, + 0x8F1BBCDC, + 0xCA62C1D6 +}; + + +static void SHA1ProcessMessageBlock(SHA1_CONTEXT *context) +{ + int t; /* Loop counter */ + uint32 temp; /* Temporary word value */ + uint32 W[80]; /* Word sequence */ + uint32 A, B, C, D, E; /* Word buffers */ + int idx; + + /* + Initialize the first 16 words in the array W + */ + + for (t = 0; t < 16; t++) + { + idx=t*4; + W[t] = context->Message_Block[idx] << 24; + W[t] |= context->Message_Block[idx + 1] << 16; + W[t] |= context->Message_Block[idx + 2] << 8; + W[t] |= context->Message_Block[idx + 3]; + } + + + for (t = 16; t < 80; t++) + { + W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); + } + + A = context->Intermediate_Hash[0]; + B = context->Intermediate_Hash[1]; + C = context->Intermediate_Hash[2]; + D = context->Intermediate_Hash[3]; + E = context->Intermediate_Hash[4]; + + for (t = 0; t < 20; t++) + { + temp= SHA1CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[t] + K[0]; + E = D; + D = C; + C = SHA1CircularShift(30,B); + B = A; + A = temp; + } + + for (t = 20; t < 40; t++) + { + temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1]; + E = D; + D = C; + C = SHA1CircularShift(30,B); + B = A; + A = temp; + } + + for (t = 40; t < 60; t++) + { + temp= (SHA1CircularShift(5,A) + ((B & C) | (B & D) | (C & D)) + E + W[t] + + K[2]); + E = D; + D = C; + C = SHA1CircularShift(30,B); + B = A; + A = temp; + } + + for (t = 60; t < 80; t++) + { + temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3]; + E = D; + D = C; + C = SHA1CircularShift(30,B); + B = A; + A = temp; + } + + context->Intermediate_Hash[0] += A; + context->Intermediate_Hash[1] += B; + context->Intermediate_Hash[2] += C; + context->Intermediate_Hash[3] += D; + context->Intermediate_Hash[4] += E; + + context->Message_Block_Index = 0; +} + + +/* + Pad message + + SYNOPSIS + SHA1PadMessage() + context: [in/out] The context to pad + + DESCRIPTION + According to the standard, the message must be padded to an even + 512 bits. The first padding bit must be a '1'. The last 64 bits + represent the length of the original message. All bits in between + should be 0. This function will pad the message according to + those rules by filling the Message_Block array accordingly. It + will also call the ProcessMessageBlock function provided + appropriately. When it returns, it can be assumed that the message + digest has been computed. + +*/ + +static void SHA1PadMessage(SHA1_CONTEXT *context) +{ + /* + Check to see if the current message block is too small to hold + the initial padding bits and length. If so, we will pad the + block, process it, and then continue padding into a second + block. + */ + + int i=context->Message_Block_Index; + + if (i > 55) + { + context->Message_Block[i++] = 0x80; + bzero((char*) &context->Message_Block[i], + sizeof(context->Message_Block[0])*(64-i)); + context->Message_Block_Index=64; + + /* This function sets context->Message_Block_Index to zero */ + SHA1ProcessMessageBlock(context); + + bzero((char*) &context->Message_Block[0], + sizeof(context->Message_Block[0])*56); + context->Message_Block_Index=56; + } + else + { + context->Message_Block[i++] = 0x80; + bzero((char*) &context->Message_Block[i], + sizeof(context->Message_Block[0])*(56-i)); + context->Message_Block_Index=56; + } + + /* + Store the message length as the last 8 octets + */ + + context->Message_Block[56] = (int8) (context->Length >> 56); + context->Message_Block[57] = (int8) (context->Length >> 48); + context->Message_Block[58] = (int8) (context->Length >> 40); + context->Message_Block[59] = (int8) (context->Length >> 32); + context->Message_Block[60] = (int8) (context->Length >> 24); + context->Message_Block[61] = (int8) (context->Length >> 16); + context->Message_Block[62] = (int8) (context->Length >> 8); + context->Message_Block[63] = (int8) (context->Length); + + SHA1ProcessMessageBlock(context); +} diff --git a/externals/mysql/mysys/stacktrace.c b/externals/mysql/mysys/stacktrace.c new file mode 100644 index 00000000000..fc7d6e41d95 --- /dev/null +++ b/externals/mysql/mysys/stacktrace.c @@ -0,0 +1,651 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +#ifndef __WIN__ +#include +#include +#include +#ifdef HAVE_STACKTRACE +#include +#include + +#if HAVE_EXECINFO_H +#include +#endif + +#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) + +static char *heap_start; + +#ifdef HAVE_BSS_START +extern char *__bss_start; +#endif + +void my_init_stacktrace() +{ +#ifdef HAVE_BSS_START + heap_start = (char*) &__bss_start; +#endif +} + +void my_safe_print_str(const char* name, const char* val, int max_len) +{ + char *heap_end= (char*) sbrk(0); + fprintf(stderr, "%s at %p ", name, val); + + if (!PTR_SANE(val)) + { + fprintf(stderr, "is an invalid pointer\n"); + return; + } + + fprintf(stderr, "= "); + for (; max_len && PTR_SANE(val) && *val; --max_len) + fputc(*val++, stderr); + fputc('\n', stderr); +} + +#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) + +#if BACKTRACE_DEMANGLE + +char __attribute__ ((weak)) +*my_demangle(const char *mangled_name __attribute__((unused)), + int *status __attribute__((unused))) +{ + return NULL; +} + +static void my_demangle_symbols(char **addrs, int n) +{ + int status, i; + char *begin, *end, *demangled; + + for (i= 0; i < n; i++) + { + demangled= NULL; + begin= strchr(addrs[i], '('); + end= begin ? strchr(begin, '+') : NULL; + + if (begin && end) + { + *begin++= *end++= '\0'; + demangled= my_demangle(begin, &status); + if (!demangled || status) + { + demangled= NULL; + begin[-1]= '('; + end[-1]= '+'; + } + } + + if (demangled) + fprintf(stderr, "%s(%s+%s\n", addrs[i], demangled, end); + else + fprintf(stderr, "%s\n", addrs[i]); + } +} + +#endif /* BACKTRACE_DEMANGLE */ + +void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) +{ + void *addrs[128]; + char **strings= NULL; + int n = backtrace(addrs, array_elements(addrs)); + fprintf(stderr, "stack_bottom = %p thread_stack 0x%lx\n", + stack_bottom, thread_stack); +#if BACKTRACE_DEMANGLE + if ((strings= backtrace_symbols(addrs, n))) + { + my_demangle_symbols(strings, n); + free(strings); + } +#endif +#if HAVE_BACKTRACE_SYMBOLS_FD + if (!strings) + { + backtrace_symbols_fd(addrs, n, fileno(stderr)); + } +#endif +} + +#elif defined(TARGET_OS_LINUX) + +#ifdef __i386__ +#define SIGRETURN_FRAME_OFFSET 17 +#endif + +#ifdef __x86_64__ +#define SIGRETURN_FRAME_OFFSET 23 +#endif + +#if defined(__alpha__) && defined(__GNUC__) +/* + The only way to backtrace without a symbol table on alpha + is to find stq fp,N(sp), and the first byte + of the instruction opcode will give us the value of N. From this + we can find where the old value of fp is stored +*/ + +#define MAX_INSTR_IN_FUNC 10000 + +inline uchar** find_prev_fp(uint32* pc, uchar** fp) +{ + int i; + for (i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc) + { + uchar* p = (uchar*)pc; + if (p[2] == 222 && p[3] == 35) + { + return (uchar**)((uchar*)fp - *(short int*)p); + } + } + return 0; +} + +inline uint32* find_prev_pc(uint32* pc, uchar** fp) +{ + int i; + for (i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc) + { + char* p = (char*)pc; + if (p[1] == 0 && p[2] == 94 && p[3] == -73) + { + uint32* prev_pc = (uint32*)*((fp+p[0]/sizeof(fp))); + return prev_pc; + } + } + return 0; +} +#endif /* defined(__alpha__) && defined(__GNUC__) */ + +void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) +{ + uchar** fp; + uint frame_count = 0, sigreturn_frame_count; +#if defined(__alpha__) && defined(__GNUC__) + uint32* pc; +#endif + LINT_INIT(fp); + + +#ifdef __i386__ + __asm __volatile__ ("movl %%ebp,%0" + :"=r"(fp) + :"r"(fp)); +#endif +#ifdef __x86_64__ + __asm __volatile__ ("movq %%rbp,%0" + :"=r"(fp) + :"r"(fp)); +#endif +#if defined(__alpha__) && defined(__GNUC__) + __asm __volatile__ ("mov $30,%0" + :"=r"(fp) + :"r"(fp)); +#endif + if (!fp) + { + fprintf(stderr, "frame pointer is NULL, did you compile with\n\ +-fomit-frame-pointer? Aborting backtrace!\n"); + return; + } + + if (!stack_bottom || (uchar*) stack_bottom > (uchar*) &fp) + { + ulong tmp= min(0x10000,thread_stack); + /* Assume that the stack starts at the previous even 65K */ + stack_bottom= (uchar*) (((ulong) &fp + tmp) & + ~(ulong) 0xFFFF); + fprintf(stderr, "Cannot determine thread, fp=%p, backtrace may not be correct.\n", fp); + } + if (fp > (uchar**) stack_bottom || + fp < (uchar**) stack_bottom - thread_stack) + { + fprintf(stderr, "Bogus stack limit or frame pointer,\ + fp=%p, stack_bottom=%p, thread_stack=%ld, aborting backtrace.\n", + fp, stack_bottom, thread_stack); + return; + } + + fprintf(stderr, "Stack range sanity check OK, backtrace follows:\n"); +#if defined(__alpha__) && defined(__GNUC__) + fprintf(stderr, "Warning: Alpha stacks are difficult -\ + will be taking some wild guesses, stack trace may be incorrect or \ + terminate abruptly\n"); + /* On Alpha, we need to get pc */ + __asm __volatile__ ("bsr %0, do_next; do_next: " + :"=r"(pc) + :"r"(pc)); +#endif /* __alpha__ */ + + /* We are 1 frame above signal frame with NPTL and 2 frames above with LT */ + sigreturn_frame_count = thd_lib_detected == THD_LIB_LT ? 2 : 1; + + while (fp < (uchar**) stack_bottom) + { +#if defined(__i386__) || defined(__x86_64__) + uchar** new_fp = (uchar**)*fp; + fprintf(stderr, "%p\n", frame_count == sigreturn_frame_count ? + *(fp + SIGRETURN_FRAME_OFFSET) : *(fp + 1)); +#endif /* defined(__386__) || defined(__x86_64__) */ + +#if defined(__alpha__) && defined(__GNUC__) + uchar** new_fp = find_prev_fp(pc, fp); + if (frame_count == sigreturn_frame_count - 1) + { + new_fp += 90; + } + + if (fp && pc) + { + pc = find_prev_pc(pc, fp); + if (pc) + fprintf(stderr, "%p\n", pc); + else + { + fprintf(stderr, "Not smart enough to deal with the rest\ + of this stack\n"); + goto end; + } + } + else + { + fprintf(stderr, "Not smart enough to deal with the rest of this stack\n"); + goto end; + } +#endif /* defined(__alpha__) && defined(__GNUC__) */ + if (new_fp <= fp ) + { + fprintf(stderr, "New value of fp=%p failed sanity check,\ + terminating stack trace!\n", new_fp); + goto end; + } + fp = new_fp; + ++frame_count; + } + + fprintf(stderr, "Stack trace seems successful - bottom reached\n"); + +end: + fprintf(stderr, + "Please read http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html\n" + "and follow instructions on how to resolve the stack trace.\n" + "Resolved stack trace is much more helpful in diagnosing the\n" + "problem, so please do resolve it\n"); +} +#endif /* TARGET_OS_LINUX */ +#endif /* HAVE_STACKTRACE */ + +/* Produce a core for the thread */ +void my_write_core(int sig) +{ + signal(sig, SIG_DFL); +#ifdef HAVE_gcov + /* + For GCOV build, crashing will prevent the writing of code coverage + information from this process, causing gcov output to be incomplete. + So we force the writing of coverage information here before terminating. + */ + extern void __gcov_flush(void); + __gcov_flush(); +#endif + pthread_kill(pthread_self(), sig); +#if defined(P_MYID) && !defined(SCO) + /* On Solaris, the above kill is not enough */ + sigsend(P_PID,P_MYID,sig); +#endif +} + +#else /* __WIN__*/ + +#include +#include + +/* + Stack tracing on Windows is implemented using Debug Helper library(dbghelp.dll) + We do not redistribute dbghelp and the one comes with older OS (up to Windows 2000) + is missing some important functions like functions StackWalk64 or MinidumpWriteDump. + Hence, we have to load functions at runtime using LoadLibrary/GetProcAddress. +*/ + +typedef DWORD (WINAPI *SymSetOptions_FctType)(DWORD dwOptions); +typedef BOOL (WINAPI *SymGetModuleInfo64_FctType) + (HANDLE,DWORD64,PIMAGEHLP_MODULE64) ; +typedef BOOL (WINAPI *SymGetSymFromAddr64_FctType) + (HANDLE,DWORD64,PDWORD64,PIMAGEHLP_SYMBOL64) ; +typedef BOOL (WINAPI *SymGetLineFromAddr64_FctType) + (HANDLE,DWORD64,PDWORD,PIMAGEHLP_LINE64); +typedef BOOL (WINAPI *SymInitialize_FctType) + (HANDLE,PSTR,BOOL); +typedef BOOL (WINAPI *StackWalk64_FctType) + (DWORD,HANDLE,HANDLE,LPSTACKFRAME64,PVOID,PREAD_PROCESS_MEMORY_ROUTINE64, + PFUNCTION_TABLE_ACCESS_ROUTINE64,PGET_MODULE_BASE_ROUTINE64 , + PTRANSLATE_ADDRESS_ROUTINE64); +typedef BOOL (WINAPI *MiniDumpWriteDump_FctType)( + IN HANDLE hProcess, + IN DWORD ProcessId, + IN HANDLE hFile, + IN MINIDUMP_TYPE DumpType, + IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL + IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL + IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL + ); + +static SymSetOptions_FctType pSymSetOptions; +static SymGetModuleInfo64_FctType pSymGetModuleInfo64; +static SymGetSymFromAddr64_FctType pSymGetSymFromAddr64; +static SymInitialize_FctType pSymInitialize; +static StackWalk64_FctType pStackWalk64; +static SymGetLineFromAddr64_FctType pSymGetLineFromAddr64; +static MiniDumpWriteDump_FctType pMiniDumpWriteDump; + +static EXCEPTION_POINTERS *exception_ptrs; + +#define MODULE64_SIZE_WINXP 576 +#define STACKWALK_MAX_FRAMES 64 + +void my_init_stacktrace() +{ +} + +/* + Dynamically load dbghelp functions +*/ +BOOL init_dbghelp_functions() +{ + static BOOL first_time= TRUE; + static BOOL rc; + HMODULE hDbghlp; + + if(first_time) + { + first_time= FALSE; + hDbghlp= LoadLibrary("dbghelp"); + if(!hDbghlp) + { + rc= FALSE; + return rc; + } + pSymSetOptions= (SymSetOptions_FctType) + GetProcAddress(hDbghlp,"SymSetOptions"); + pSymInitialize= (SymInitialize_FctType) + GetProcAddress(hDbghlp,"SymInitialize"); + pSymGetModuleInfo64= (SymGetModuleInfo64_FctType) + GetProcAddress(hDbghlp,"SymGetModuleInfo64"); + pSymGetLineFromAddr64= (SymGetLineFromAddr64_FctType) + GetProcAddress(hDbghlp,"SymGetLineFromAddr64"); + pSymGetSymFromAddr64=(SymGetSymFromAddr64_FctType) + GetProcAddress(hDbghlp,"SymGetSymFromAddr64"); + pStackWalk64= (StackWalk64_FctType) + GetProcAddress(hDbghlp,"StackWalk64"); + pMiniDumpWriteDump = (MiniDumpWriteDump_FctType) + GetProcAddress(hDbghlp,"MiniDumpWriteDump"); + + rc = (BOOL)(pSymSetOptions && pSymInitialize && pSymGetModuleInfo64 + && pSymGetLineFromAddr64 && pSymGetSymFromAddr64 && pStackWalk64); + } + return rc; +} + +void my_set_exception_pointers(EXCEPTION_POINTERS *ep) +{ + exception_ptrs = ep; +} + + +/* + Get symbol path - semicolon-separated list of directories to search for debug + symbols. We expect PDB in the same directory as corresponding exe or dll, + so the path is build from directories of the loaded modules. If environment + variable _NT_SYMBOL_PATH is set, it's value appended to the symbol search path +*/ +static void get_symbol_path(char *path, size_t size) +{ + HANDLE hSnap; + char *envvar; + + path[0]= '\0'; + /* + Enumerate all modules, and add their directories to the path. + Avoid duplicate entries. + */ + hSnap= CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId()); + if (hSnap != INVALID_HANDLE_VALUE) + { + BOOL ret; + MODULEENTRY32 mod; + mod.dwSize= sizeof(MODULEENTRY32); + for (ret= Module32First(hSnap, &mod); ret; ret= Module32Next(hSnap, &mod)) + { + char *module_dir= mod.szExePath; + char *p= strrchr(module_dir,'\\'); + if (!p) + { + /* + Path separator was not found. Not known to happen, if ever happens, + will indicate current directory. + */ + module_dir[0]= '.'; + p= module_dir + 1; + } + *p++= ';'; + *p= '\0'; + + if (!strstr(path, module_dir)) + { + size_t dir_len = strlen(module_dir); + if (size > dir_len) + { + strncat(path, module_dir, size-1); + size -= dir_len; + } + } + } + CloseHandle(hSnap); + } + + /* Add _NT_SYMBOL_PATH, if present. */ + envvar= getenv("_NT_SYMBOL_PATH"); + if(envvar && size) + { + strncat(path, envvar, size-1); + } +} + +#define MAX_SYMBOL_PATH 32768 + +/* Platform SDK in VS2003 does not have definition for SYMOPT_NO_PROMPTS*/ +#ifndef SYMOPT_NO_PROMPTS +#define SYMOPT_NO_PROMPTS 0 +#endif + +void my_print_stacktrace(uchar* unused1, ulong unused2) +{ + HANDLE hProcess= GetCurrentProcess(); + HANDLE hThread= GetCurrentThread(); + static IMAGEHLP_MODULE64 module= {sizeof(module)}; + static IMAGEHLP_SYMBOL64_PACKAGE package; + DWORD64 addr; + DWORD machine; + int i; + CONTEXT context; + STACKFRAME64 frame={0}; + static char symbol_path[MAX_SYMBOL_PATH]; + + if(!exception_ptrs || !init_dbghelp_functions()) + return; + + /* Copy context, as stackwalking on original will unwind the stack */ + context = *(exception_ptrs->ContextRecord); + /*Initialize symbols.*/ + pSymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_NO_PROMPTS|SYMOPT_DEFERRED_LOADS|SYMOPT_DEBUG); + get_symbol_path(symbol_path, sizeof(symbol_path)); + pSymInitialize(hProcess, symbol_path, TRUE); + + /*Prepare stackframe for the first StackWalk64 call*/ + frame.AddrFrame.Mode= frame.AddrPC.Mode= frame.AddrStack.Mode= AddrModeFlat; +#if (defined _M_IX86) + machine= IMAGE_FILE_MACHINE_I386; + frame.AddrFrame.Offset= context.Ebp; + frame.AddrPC.Offset= context.Eip; + frame.AddrStack.Offset= context.Esp; +#elif (defined _M_X64) + machine = IMAGE_FILE_MACHINE_AMD64; + frame.AddrFrame.Offset= context.Rbp; + frame.AddrPC.Offset= context.Rip; + frame.AddrStack.Offset= context.Rsp; +#else + /*There is currently no need to support IA64*/ +#pragma error ("unsupported architecture") +#endif + + package.sym.SizeOfStruct= sizeof(package.sym); + package.sym.MaxNameLength= sizeof(package.name); + + /*Walk the stack, output useful information*/ + for(i= 0; i< STACKWALK_MAX_FRAMES;i++) + { + DWORD64 function_offset= 0; + DWORD line_offset= 0; + IMAGEHLP_LINE64 line= {sizeof(line)}; + BOOL have_module= FALSE; + BOOL have_symbol= FALSE; + BOOL have_source= FALSE; + + if(!pStackWalk64(machine, hProcess, hThread, &frame, &context, 0, 0, 0 ,0)) + break; + addr= frame.AddrPC.Offset; + + have_module= pSymGetModuleInfo64(hProcess,addr,&module); +#ifdef _M_IX86 + if(!have_module) + { + /* + ModuleInfo structure has been "compatibly" extended in releases after XP, + and its size was increased. To make XP dbghelp.dll function + happy, pretend passing the old structure. + */ + module.SizeOfStruct= MODULE64_SIZE_WINXP; + have_module= pSymGetModuleInfo64(hProcess, addr, &module); + } +#endif + + have_symbol= pSymGetSymFromAddr64(hProcess, addr, &function_offset, + &(package.sym)); + have_source= pSymGetLineFromAddr64(hProcess, addr, &line_offset, &line); + + fprintf(stderr, "%p ", addr); + if(have_module) + { + char *base_image_name= strrchr(module.ImageName, '\\'); + if(base_image_name) + base_image_name++; + else + base_image_name= module.ImageName; + fprintf(stderr, "%s!", base_image_name); + } + if(have_symbol) + fprintf(stderr, "%s()", package.sym.Name); + else if(have_module) + fprintf(stderr, "???"); + + if(have_source) + { + char *base_file_name= strrchr(line.FileName, '\\'); + if(base_file_name) + base_file_name++; + else + base_file_name= line.FileName; + fprintf(stderr,"[%s:%u]", base_file_name, line.LineNumber); + } + fprintf(stderr, "\n"); + } + fflush(stderr); +} + + +/* + Write dump. The dump is created in current directory, + file name is constructed from executable name plus + ".dmp" extension +*/ +void my_write_core(int unused) +{ + char path[MAX_PATH]; + char dump_fname[MAX_PATH]= "core.dmp"; + MINIDUMP_EXCEPTION_INFORMATION info; + HANDLE hFile; + + if(!exception_ptrs || !init_dbghelp_functions() || !pMiniDumpWriteDump) + return; + + info.ExceptionPointers= exception_ptrs; + info.ClientPointers= FALSE; + info.ThreadId= GetCurrentThreadId(); + + if(GetModuleFileName(NULL, path, sizeof(path))) + { + _splitpath(path, NULL, NULL,dump_fname,NULL); + strncat(dump_fname, ".dmp", sizeof(dump_fname)); + } + + hFile= CreateFile(dump_fname, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, 0); + if(hFile) + { + /* Create minidump */ + MINIDUMP_TYPE dump_type = (MINIDUMP_TYPE) + (MiniDumpWithDataSegs|MiniDumpWithPrivateReadWriteMemory); + + if(pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), + hFile, dump_type, &info, 0, 0)) + { + fprintf(stderr, "Minidump written to %s\n", + _fullpath(path, dump_fname, sizeof(path)) ? path : dump_fname); + } + else + { + fprintf(stderr,"MiniDumpWriteDump() failed, last error %u\n", + GetLastError()); + } + CloseHandle(hFile); + } + else + { + fprintf(stderr, "CreateFile(%s) failed, last error %u\n", dump_fname, + GetLastError()); + } + fflush(stderr); +} + + +void my_safe_print_str(const char *name, const char *val, int len) +{ + fprintf(stderr,"%s at %p", name, val); + __try + { + fprintf(stderr,"=%.*s\n", len, val); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + fprintf(stderr,"is an invalid string pointer\n"); + } +} +#endif /*__WIN__*/ diff --git a/externals/mysql/mysys/string.c b/externals/mysql/mysys/string.c new file mode 100644 index 00000000000..b234a589406 --- /dev/null +++ b/externals/mysql/mysys/string.c @@ -0,0 +1,185 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Code for handling strings with can grow dynamicly. + Copyright Monty Program KB. + By monty. +*/ + +#include "mysys_priv.h" +#include + +my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, + size_t init_alloc, size_t alloc_increment) +{ + uint length; + DBUG_ENTER("init_dynamic_string"); + + if (!alloc_increment) + alloc_increment=128; + length=1; + if (init_str && (length= strlen(init_str)+1) < init_alloc) + init_alloc=((length+alloc_increment-1)/alloc_increment)*alloc_increment; + if (!init_alloc) + init_alloc=alloc_increment; + + if (!(str->str=(char*) my_malloc(init_alloc,MYF(MY_WME)))) + DBUG_RETURN(TRUE); + str->length=length-1; + if (init_str) + memcpy(str->str,init_str,length); + str->max_length=init_alloc; + str->alloc_increment=alloc_increment; + DBUG_RETURN(FALSE); +} + + +my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str) +{ + uint length=0; + DBUG_ENTER("dynstr_set"); + + if (init_str && (length= (uint) strlen(init_str)+1) > str->max_length) + { + str->max_length=((length+str->alloc_increment-1)/str->alloc_increment)* + str->alloc_increment; + if (!str->max_length) + str->max_length=str->alloc_increment; + if (!(str->str=(char*) my_realloc(str->str,str->max_length,MYF(MY_WME)))) + DBUG_RETURN(TRUE); + } + if (init_str) + { + str->length=length-1; + memcpy(str->str,init_str,length); + } + else + str->length=0; + DBUG_RETURN(FALSE); +} + + +my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size) +{ + DBUG_ENTER("dynstr_realloc"); + + if (!additional_size) DBUG_RETURN(FALSE); + if (str->length + additional_size > str->max_length) + { + str->max_length=((str->length + additional_size+str->alloc_increment-1)/ + str->alloc_increment)*str->alloc_increment; + if (!(str->str=(char*) my_realloc(str->str,str->max_length,MYF(MY_WME)))) + DBUG_RETURN(TRUE); + } + DBUG_RETURN(FALSE); +} + + +my_bool dynstr_append(DYNAMIC_STRING *str, const char *append) +{ + return dynstr_append_mem(str,append,(uint) strlen(append)); +} + + +my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, + size_t length) +{ + char *new_ptr; + if (str->length+length >= str->max_length) + { + uint new_length=(str->length+length+str->alloc_increment)/ + str->alloc_increment; + new_length*=str->alloc_increment; + if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME)))) + return TRUE; + str->str=new_ptr; + str->max_length=new_length; + } + memcpy(str->str + str->length,append,length); + str->length+=length; + str->str[str->length]=0; /* Safety for C programs */ + return FALSE; +} + + +my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n) +{ + str->length-=n; + str->str[str->length]= '\0'; + return FALSE; +} + +/* + Concatenates any number of strings, escapes any OS quote in the result then + surround the whole affair in another set of quotes which is finally appended + to specified DYNAMIC_STRING. This function is especially useful when + building strings to be executed with the system() function. + + @param str Dynamic String which will have addtional strings appended. + @param append String to be appended. + @param ... Optional. Additional string(s) to be appended. + + @note The final argument in the list must be NullS even if no additional + options are passed. + + @return True = Success. +*/ + +my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) +{ +#ifdef __WIN__ + const char *quote_str= "\""; + const uint quote_len= 1; +#else + const char *quote_str= "\'"; + const uint quote_len= 1; +#endif /* __WIN__ */ + my_bool ret= TRUE; + va_list dirty_text; + + ret&= dynstr_append_mem(str, quote_str, quote_len); /* Leading quote */ + va_start(dirty_text, append); + while (append != NullS) + { + const char *cur_pos= append; + const char *next_pos= cur_pos; + + /* Search for quote in each string and replace with escaped quote */ + while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0') + { + ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos); + ret&= dynstr_append_mem(str ,"\\", 1); + ret&= dynstr_append_mem(str, quote_str, quote_len); + cur_pos= next_pos + 1; + } + ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos); + append= va_arg(dirty_text, char *); + } + va_end(dirty_text); + ret&= dynstr_append_mem(str, quote_str, quote_len); /* Trailing quote */ + + return ret; +} + + +void dynstr_free(DYNAMIC_STRING *str) +{ + if (str->str) + { + my_free(str->str,MYF(MY_WME)); + str->str=0; + } +} diff --git a/externals/mysql/mysys/test_fn.c b/externals/mysql/mysys/test_fn.c new file mode 100644 index 00000000000..249cc878390 --- /dev/null +++ b/externals/mysql/mysys/test_fn.c @@ -0,0 +1,69 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" + +const char *test_names[]= +{ + "/usr/my/include/srclib/myfunc/dbug/test", + "test", + "dbug/test", + "/usr/my/srclib/myfunc/dbug/test", + "/usr/monty/oldcopy/jazz/setupp.frm", + "~/monty.tst", + "~/dbug/monty.tst", + "./hejsan", + "./dbug/test", + "../dbug/test", + "../myfunc/test", + "../../monty/rutedit", + "/usr/monty//usr/monty/rutedit", + "/usr/./monty/rutedit", + "/usr/my/../monty/rutedit", + "/usr/my/~/rutedit", + "~/../my", + "~/../my/srclib/myfunc/test", + "~/../my/srclib/myfunc/./dbug/test", + "/../usr/my/srclib/dbug", + "c/../my", + "/c/../my", + NullS, +}; + +int main(int argc __attribute__((unused)), char **argv) +{ + const char **pos; + char buff[FN_REFLEN],buff2[FN_REFLEN]; + DBUG_ENTER ("main"); + DBUG_PROCESS (argv[0]); + MY_INIT(argv[0]); + + if (argv[1] && argv[1][1] == '#') + DBUG_PUSH(argv[1]+2); + + for (pos=test_names; *pos ; pos++) + { + printf("org : '%s'\n",*pos); + printf("pack: '%s'\n",fn_format(buff,*pos,"","",8)); + printf("unpack: '%s'\n",fn_format(buff2,*pos,"","",4)); + unpack_filename(buff,buff); + if (strcmp(buff,buff2) != 0) + { + printf("error on cmp: '%s' != '%s'\n",buff,buff2); + } + puts(""); + } + DBUG_RETURN(0); +} diff --git a/externals/mysql/mysys/test_xml.c b/externals/mysql/mysys/test_xml.c new file mode 100644 index 00000000000..0cb10e1c8d9 --- /dev/null +++ b/externals/mysql/mysys/test_xml.c @@ -0,0 +1,104 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include "my_xml.h" + +static void mstr(char *str,const char *src,uint l1,uint l2) +{ + l1 = l1 + +#if defined(THREAD) && !defined(DONT_USE_THR_ALARM) +#include +#include +#include +#include +#include +#include +#include "thr_alarm.h" + +#ifdef HAVE_SYS_SELECT_H +#include /* AIX needs this for fd_set */ +#endif + +#ifndef ETIME +#define ETIME ETIMEDOUT +#endif + +uint thr_client_alarm; +static int alarm_aborted=1; /* No alarm thread */ +my_bool thr_alarm_inited= 0; +volatile my_bool alarm_thread_running= 0; +time_t next_alarm_expire_time= ~ (time_t) 0; +static sig_handler process_alarm_part2(int sig); + +#if !defined(__WIN__) + +static pthread_mutex_t LOCK_alarm; +static pthread_cond_t COND_alarm; +static sigset_t full_signal_set; +static QUEUE alarm_queue; +static uint max_used_alarms=0; +pthread_t alarm_thread; + +#ifdef USE_ALARM_THREAD +static void *alarm_handler(void *arg); +#define reschedule_alarms() pthread_cond_signal(&COND_alarm) +#else +#define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM) +#endif + +static sig_handler thread_alarm(int sig __attribute__((unused))); + +static int compare_ulong(void *not_used __attribute__((unused)), + uchar *a_ptr,uchar* b_ptr) +{ + ulong a=*((ulong*) a_ptr),b= *((ulong*) b_ptr); + return (a < b) ? -1 : (a == b) ? 0 : 1; +} + +void init_thr_alarm(uint max_alarms) +{ + sigset_t s; + DBUG_ENTER("init_thr_alarm"); + alarm_aborted=0; + next_alarm_expire_time= ~ (time_t) 0; + init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0, + compare_ulong,NullS); + sigfillset(&full_signal_set); /* Neaded to block signals */ + pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST); + pthread_cond_init(&COND_alarm,NULL); + if (thd_lib_detected == THD_LIB_LT) + thr_client_alarm= SIGALRM; + else + thr_client_alarm= SIGUSR1; +#ifndef USE_ALARM_THREAD + if (thd_lib_detected != THD_LIB_LT) +#endif + { + my_sigset(thr_client_alarm, thread_alarm); + } + sigemptyset(&s); + sigaddset(&s, THR_SERVER_ALARM); + alarm_thread=pthread_self(); +#if defined(USE_ALARM_THREAD) + { + pthread_attr_t thr_attr; + pthread_attr_init(&thr_attr); + pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS); + pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED); + pthread_attr_setstacksize(&thr_attr,8196); + pthread_create(&alarm_thread,&thr_attr,alarm_handler,NULL); + pthread_attr_destroy(&thr_attr); + } +#elif defined(USE_ONE_SIGNAL_HAND) + pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ + if (thd_lib_detected == THD_LIB_LT) + { + my_sigset(thr_client_alarm, process_alarm); /* Linuxthreads */ + pthread_sigmask(SIG_UNBLOCK, &s, NULL); + } +#else + my_sigset(THR_SERVER_ALARM, process_alarm); + pthread_sigmask(SIG_UNBLOCK, &s, NULL); +#endif + DBUG_VOID_RETURN; +} + + +void resize_thr_alarm(uint max_alarms) +{ + pthread_mutex_lock(&LOCK_alarm); + /* + It's ok not to shrink the queue as there may be more pending alarms than + than max_alarms + */ + if (alarm_queue.elements < max_alarms) + resize_queue(&alarm_queue,max_alarms+1); + pthread_mutex_unlock(&LOCK_alarm); +} + + +/* + Request alarm after sec seconds. + + SYNOPSIS + thr_alarm() + alrm Pointer to alarm detection + alarm_data Structure to store in alarm queue + + NOTES + This function can't be called from the alarm-handling thread. + + RETURN VALUES + 0 ok + 1 If no more alarms are allowed (aborted by process) + + Stores in first argument a pointer to a non-zero int which is set to 0 + when the alarm has been given +*/ + +my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data) +{ + time_t now; +#ifndef USE_ONE_SIGNAL_HAND + sigset_t old_mask; +#endif + my_bool reschedule; + struct st_my_thread_var *current_my_thread_var= my_thread_var; + DBUG_ENTER("thr_alarm"); + DBUG_PRINT("enter",("thread: %s sec: %d",my_thread_name(),sec)); + + now= my_time(0); +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask); +#endif + pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */ + if (alarm_aborted > 0) + { /* No signal thread */ + DBUG_PRINT("info", ("alarm aborted")); + *alrm= 0; /* No alarm */ + pthread_mutex_unlock(&LOCK_alarm); +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_SETMASK,&old_mask,NULL); +#endif + DBUG_RETURN(1); + } + if (alarm_aborted < 0) + sec= 1; /* Abort mode */ + + if (alarm_queue.elements >= max_used_alarms) + { + if (alarm_queue.elements == alarm_queue.max_elements) + { + DBUG_PRINT("info", ("alarm queue full")); + fprintf(stderr,"Warning: thr_alarm queue is full\n"); + *alrm= 0; /* No alarm */ + pthread_mutex_unlock(&LOCK_alarm); +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_SETMASK,&old_mask,NULL); +#endif + DBUG_RETURN(1); + } + max_used_alarms=alarm_queue.elements+1; + } + reschedule= (ulong) next_alarm_expire_time > (ulong) now + sec; + if (!alarm_data) + { + if (!(alarm_data=(ALARM*) my_malloc(sizeof(ALARM),MYF(MY_WME)))) + { + DBUG_PRINT("info", ("failed my_malloc()")); + *alrm= 0; /* No alarm */ + pthread_mutex_unlock(&LOCK_alarm); +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_SETMASK,&old_mask,NULL); +#endif + DBUG_RETURN(1); + } + alarm_data->malloced=1; + } + else + alarm_data->malloced=0; + alarm_data->expire_time=now+sec; + alarm_data->alarmed=0; + alarm_data->thread= current_my_thread_var->pthread_self; + alarm_data->thread_id= current_my_thread_var->id; + queue_insert(&alarm_queue,(uchar*) alarm_data); + + /* Reschedule alarm if the current one has more than sec left */ + if (reschedule) + { + DBUG_PRINT("info", ("reschedule")); + if (pthread_equal(pthread_self(),alarm_thread)) + { + alarm(sec); /* purecov: inspected */ + next_alarm_expire_time= now + sec; + } + else + reschedule_alarms(); /* Reschedule alarms */ + } + pthread_mutex_unlock(&LOCK_alarm); +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_SETMASK,&old_mask,NULL); +#endif + (*alrm)= &alarm_data->alarmed; + DBUG_RETURN(0); +} + + +/* + Remove alarm from list of alarms +*/ + +void thr_end_alarm(thr_alarm_t *alarmed) +{ + ALARM *alarm_data; +#ifndef USE_ONE_SIGNAL_HAND + sigset_t old_mask; +#endif + uint i, found=0; + DBUG_ENTER("thr_end_alarm"); + +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask); +#endif + pthread_mutex_lock(&LOCK_alarm); + + alarm_data= (ALARM*) ((uchar*) *alarmed - offsetof(ALARM,alarmed)); + for (i=0 ; i < alarm_queue.elements ; i++) + { + if ((ALARM*) queue_element(&alarm_queue,i) == alarm_data) + { + queue_remove(&alarm_queue,i),MYF(0); + if (alarm_data->malloced) + my_free((uchar*) alarm_data,MYF(0)); + found++; +#ifdef DBUG_OFF + break; +#endif + } + } + DBUG_ASSERT(!*alarmed || found == 1); + if (!found) + { + if (*alarmed) + fprintf(stderr,"Warning: Didn't find alarm 0x%lx in queue of %d alarms\n", + (long) *alarmed, alarm_queue.elements); + DBUG_PRINT("warning",("Didn't find alarm %p in queue\n", + *alarmed)); + } + pthread_mutex_unlock(&LOCK_alarm); +#ifndef USE_ONE_SIGNAL_HAND + pthread_sigmask(SIG_SETMASK,&old_mask,NULL); +#endif + DBUG_VOID_RETURN; +} + +/* + Come here when some alarm in queue is due. + Mark all alarms with are finnished in list. + Shedule alarms to be sent again after 1-10 sec (many alarms at once) + If alarm_aborted is set then all alarms are given and resent + every second. +*/ + +sig_handler process_alarm(int sig __attribute__((unused))) +{ + sigset_t old_mask; +/* + This must be first as we can't call DBUG inside an alarm for a normal thread +*/ + + if (thd_lib_detected == THD_LIB_LT && + !pthread_equal(pthread_self(),alarm_thread)) + { +#if defined(MAIN) && !defined(__bsdi__) + printf("thread_alarm in process_alarm\n"); fflush(stdout); +#endif +#ifdef DONT_REMEMBER_SIGNAL + my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */ +#endif + return; + } + + /* + We have to do do the handling of the alarm in a sub function, + because otherwise we would get problems with two threads calling + DBUG_... functions at the same time (as two threads may call + process_alarm() at the same time + */ + +#ifndef USE_ALARM_THREAD + pthread_sigmask(SIG_SETMASK,&full_signal_set,&old_mask); + pthread_mutex_lock(&LOCK_alarm); +#endif + process_alarm_part2(sig); +#ifndef USE_ALARM_THREAD +#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND) + my_sigset(THR_SERVER_ALARM,process_alarm); +#endif + pthread_mutex_unlock(&LOCK_alarm); + pthread_sigmask(SIG_SETMASK,&old_mask,NULL); +#endif + return; +} + + +static sig_handler process_alarm_part2(int sig __attribute__((unused))) +{ + ALARM *alarm_data; + DBUG_ENTER("process_alarm"); + DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements)); + +#if defined(MAIN) && !defined(__bsdi__) + printf("process_alarm\n"); fflush(stdout); +#endif + if (alarm_queue.elements) + { + if (alarm_aborted) + { + uint i; + for (i=0 ; i < alarm_queue.elements ;) + { + alarm_data=(ALARM*) queue_element(&alarm_queue,i); + alarm_data->alarmed=1; /* Info to thread */ + if (pthread_equal(alarm_data->thread,alarm_thread) || + pthread_kill(alarm_data->thread, thr_client_alarm)) + { +#ifdef MAIN + printf("Warning: pthread_kill couldn't find thread!!!\n"); +#endif + queue_remove(&alarm_queue,i); /* No thread. Remove alarm */ + } + else + i++; /* Signal next thread */ + } +#ifndef USE_ALARM_THREAD + if (alarm_queue.elements) + alarm(1); /* Signal soon again */ +#endif + } + else + { + ulong now=(ulong) my_time(0); + ulong next=now+10-(now%10); + while ((alarm_data=(ALARM*) queue_top(&alarm_queue))->expire_time <= now) + { + alarm_data->alarmed=1; /* Info to thread */ + DBUG_PRINT("info",("sending signal to waiting thread")); + if (pthread_equal(alarm_data->thread,alarm_thread) || + pthread_kill(alarm_data->thread, thr_client_alarm)) + { +#ifdef MAIN + printf("Warning: pthread_kill couldn't find thread!!!\n"); +#endif + queue_remove(&alarm_queue,0); /* No thread. Remove alarm */ + if (!alarm_queue.elements) + break; + } + else + { + alarm_data->expire_time=next; + queue_replaced(&alarm_queue); + } + } +#ifndef USE_ALARM_THREAD + if (alarm_queue.elements) + { +#ifdef __bsdi__ + alarm(0); /* Remove old alarm */ +#endif + alarm((uint) (alarm_data->expire_time-now)); + next_alarm_expire_time= alarm_data->expire_time; + } +#endif + } + } + else + { + /* + Ensure that next time we call thr_alarm(), we will schedule a new alarm + */ + next_alarm_expire_time= ~(time_t) 0; + } + DBUG_VOID_RETURN; +} + + +/* + Schedule all alarms now and optionally free all structures + + SYNPOSIS + end_thr_alarm() + free_structures Set to 1 if we should free memory used for + the alarm queue. + When we call this we should KNOW that there + is no active alarms + IMPLEMENTATION + Set alarm_abort to -1 which will change the behavior of alarms as follows: + - All old alarms will be rescheduled at once + - All new alarms will be rescheduled to one second +*/ + +void end_thr_alarm(my_bool free_structures) +{ + DBUG_ENTER("end_thr_alarm"); + if (alarm_aborted != 1) /* If memory not freed */ + { + pthread_mutex_lock(&LOCK_alarm); + DBUG_PRINT("info",("Resheduling %d waiting alarms",alarm_queue.elements)); + alarm_aborted= -1; /* mark aborted */ + if (alarm_queue.elements || (alarm_thread_running && free_structures)) + { + if (pthread_equal(pthread_self(),alarm_thread)) + alarm(1); /* Shut down everything soon */ + else + reschedule_alarms(); + } + if (free_structures) + { + struct timespec abstime; + + DBUG_ASSERT(!alarm_queue.elements); + + /* Wait until alarm thread dies */ + set_timespec(abstime, 10); /* Wait up to 10 seconds */ + while (alarm_thread_running) + { + int error= pthread_cond_timedwait(&COND_alarm, &LOCK_alarm, &abstime); + if (error == ETIME || error == ETIMEDOUT) + break; /* Don't wait forever */ + } + delete_queue(&alarm_queue); + alarm_aborted= 1; + pthread_mutex_unlock(&LOCK_alarm); + if (!alarm_thread_running) /* Safety */ + { + pthread_mutex_destroy(&LOCK_alarm); + pthread_cond_destroy(&COND_alarm); + } + } + else + pthread_mutex_unlock(&LOCK_alarm); + } + DBUG_VOID_RETURN; +} + + +/* + Remove another thread from the alarm +*/ + +void thr_alarm_kill(my_thread_id thread_id) +{ + uint i; + if (alarm_aborted) + return; + pthread_mutex_lock(&LOCK_alarm); + for (i=0 ; i < alarm_queue.elements ; i++) + { + if (((ALARM*) queue_element(&alarm_queue,i))->thread_id == thread_id) + { + ALARM *tmp=(ALARM*) queue_remove(&alarm_queue,i); + tmp->expire_time=0; + queue_insert(&alarm_queue,(uchar*) tmp); + reschedule_alarms(); + break; + } + } + pthread_mutex_unlock(&LOCK_alarm); +} + + +void thr_alarm_info(ALARM_INFO *info) +{ + pthread_mutex_lock(&LOCK_alarm); + info->next_alarm_time= 0; + info->max_used_alarms= max_used_alarms; + if ((info->active_alarms= alarm_queue.elements)) + { + ulong now=(ulong) my_time(0); + long time_diff; + ALARM *alarm_data= (ALARM*) queue_top(&alarm_queue); + time_diff= (long) (alarm_data->expire_time - now); + info->next_alarm_time= (ulong) (time_diff < 0 ? 0 : time_diff); + } + pthread_mutex_unlock(&LOCK_alarm); +} + +/* + This is here for thread to get interruptet from read/write/fcntl + ARGSUSED +*/ + + +static sig_handler thread_alarm(int sig) +{ +#ifdef MAIN + printf("thread_alarm\n"); fflush(stdout); +#endif +#ifdef DONT_REMEMBER_SIGNAL + my_sigset(sig,thread_alarm); /* int. thread system calls */ +#endif +} + + +#ifdef HAVE_TIMESPEC_TS_SEC +#define tv_sec ts_sec +#define tv_nsec ts_nsec +#endif + +/* set up a alarm thread with uses 'sleep' to sleep between alarms */ + +#ifdef USE_ALARM_THREAD +static void *alarm_handler(void *arg __attribute__((unused))) +{ + int error; + struct timespec abstime; +#ifdef MAIN + puts("Starting alarm thread"); +#endif + my_thread_init(); + alarm_thread_running= 1; + pthread_mutex_lock(&LOCK_alarm); + for (;;) + { + if (alarm_queue.elements) + { + ulong sleep_time,now= my_time(0); + if (alarm_aborted) + sleep_time=now+1; + else + sleep_time= ((ALARM*) queue_top(&alarm_queue))->expire_time; + if (sleep_time > now) + { + abstime.tv_sec=sleep_time; + abstime.tv_nsec=0; + next_alarm_expire_time= sleep_time; + if ((error=pthread_cond_timedwait(&COND_alarm,&LOCK_alarm,&abstime)) && + error != ETIME && error != ETIMEDOUT) + { +#ifdef MAIN + printf("Got error: %d from ptread_cond_timedwait (errno: %d)\n", + error,errno); +#endif + } + } + } + else if (alarm_aborted == -1) + break; + else + { + next_alarm_expire_time= ~ (time_t) 0; + if ((error=pthread_cond_wait(&COND_alarm,&LOCK_alarm))) + { +#ifdef MAIN + printf("Got error: %d from ptread_cond_wait (errno: %d)\n", + error,errno); +#endif + } + } + process_alarm(0); + } + bzero((char*) &alarm_thread,sizeof(alarm_thread)); /* For easy debugging */ + alarm_thread_running= 0; + pthread_cond_signal(&COND_alarm); + pthread_mutex_unlock(&LOCK_alarm); + pthread_exit(0); + return 0; /* Impossible */ +} +#endif /* USE_ALARM_THREAD */ + +/***************************************************************************** + thr_alarm for win95 +*****************************************************************************/ + +#else /* __WIN__ */ + +void thr_alarm_kill(my_thread_id thread_id) +{ + /* Can't do this yet */ +} + +sig_handler process_alarm(int sig __attribute__((unused))) +{ + /* Can't do this yet */ +} + + +my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm) +{ + (*alrm)= &alarm->alarmed; + if (alarm_aborted) + { + alarm->alarmed.crono=0; + return 1; + } + if (!(alarm->alarmed.crono=SetTimer((HWND) NULL,0, sec*1000, + (TIMERPROC) NULL))) + return 1; + return 0; +} + + +my_bool thr_got_alarm(thr_alarm_t *alrm_ptr) +{ + thr_alarm_t alrm= *alrm_ptr; + MSG msg; + if (alrm->crono) + { + PeekMessage(&msg,NULL,WM_TIMER,WM_TIMER,PM_REMOVE) ; + if (msg.message == WM_TIMER || alarm_aborted) + { + KillTimer(NULL, alrm->crono); + alrm->crono = 0; + } + } + return !alrm->crono || alarm_aborted; +} + + +void thr_end_alarm(thr_alarm_t *alrm_ptr) +{ + thr_alarm_t alrm= *alrm_ptr; + /* alrm may be zero if thr_alarm aborted with an error */ + if (alrm && alrm->crono) + + { + KillTimer(NULL, alrm->crono); + alrm->crono = 0; + } +} + +void end_thr_alarm(my_bool free_structures) +{ + DBUG_ENTER("end_thr_alarm"); + alarm_aborted=1; /* No more alarms */ + DBUG_VOID_RETURN; +} + +void init_thr_alarm(uint max_alarm) +{ + DBUG_ENTER("init_thr_alarm"); + alarm_aborted=0; /* Yes, Gimmie alarms */ + DBUG_VOID_RETURN; +} + +void thr_alarm_info(ALARM_INFO *info) +{ + bzero((char*) info, sizeof(*info)); +} + +void resize_thr_alarm(uint max_alarms) +{ +} + +#endif /* __WIN__ */ + +#endif /* THREAD */ + + +/**************************************************************************** + Handling of test case (when compiled with -DMAIN) +***************************************************************************/ + +#ifdef MAIN +#if defined(THREAD) && !defined(DONT_USE_THR_ALARM) + +static pthread_cond_t COND_thread_count; +static pthread_mutex_t LOCK_thread_count; +static uint thread_count; + +#ifdef HPUX10 +typedef int * fd_set_ptr; +#else +typedef fd_set * fd_set_ptr; +#endif /* HPUX10 */ + +static void *test_thread(void *arg) +{ + int i,param=*((int*) arg),wait_time,retry; + time_t start_time; + thr_alarm_t got_alarm; + fd_set fd; + FD_ZERO(&fd); + my_thread_init(); + printf("Thread %d (%s) started\n",param,my_thread_name()); fflush(stdout); + for (i=1 ; i <= 10 ; i++) + { + wait_time=param ? 11-i : i; + start_time= my_time(0); + if (thr_alarm(&got_alarm,wait_time,0)) + { + printf("Thread: %s Alarms aborted\n",my_thread_name()); + break; + } + if (wait_time == 3) + { + printf("Thread: %s Simulation of no alarm needed\n",my_thread_name()); + fflush(stdout); + } + else + { + for (retry=0 ; !thr_got_alarm(&got_alarm) && retry < 10 ; retry++) + { + printf("Thread: %s Waiting %d sec\n",my_thread_name(),wait_time); + select(0,(fd_set_ptr) &fd,0,0,0); + } + if (!thr_got_alarm(&got_alarm)) + { + printf("Thread: %s didn't get an alarm. Aborting!\n", + my_thread_name()); + break; + } + if (wait_time == 7) + { /* Simulate alarm-miss */ + fd_set readFDs; + uint max_connection=fileno(stdin); + FD_ZERO(&readFDs); + FD_SET(max_connection,&readFDs); + retry=0; + for (;;) + { + printf("Thread: %s Simulating alarm miss\n",my_thread_name()); + fflush(stdout); + if (select(max_connection+1, (fd_set_ptr) &readFDs,0,0,0) < 0) + { + if (errno == EINTR) + break; /* Got new interrupt */ + printf("Got errno: %d from select. Retrying..\n",errno); + if (retry++ >= 3) + { + printf("Warning: Interrupt of select() doesn't set errno!\n"); + break; + } + } + else /* This shouldn't happen */ + { + if (!FD_ISSET(max_connection,&readFDs)) + { + printf("Select interrupted, but errno not set\n"); + fflush(stdout); + if (retry++ >= 3) + break; + continue; + } + (void) getchar(); /* Somebody was playing */ + } + } + } + } + printf("Thread: %s Slept for %d (%d) sec\n",my_thread_name(), + (int) (my_time(0)-start_time), wait_time); fflush(stdout); + thr_end_alarm(&got_alarm); + fflush(stdout); + } + pthread_mutex_lock(&LOCK_thread_count); + thread_count--; + pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */ + pthread_mutex_unlock(&LOCK_thread_count); + free((uchar*) arg); + return 0; +} + +#ifdef USE_ONE_SIGNAL_HAND +static sig_handler print_signal_warning(int sig) +{ + printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name()); + fflush(stdout); +#ifdef DONT_REMEMBER_SIGNAL + my_sigset(sig,print_signal_warning); /* int. thread system calls */ +#endif + if (sig == SIGALRM) + alarm(2); /* reschedule alarm */ +} +#endif /* USE_ONE_SIGNAL_HAND */ + + +static void *signal_hand(void *arg __attribute__((unused))) +{ + sigset_t set; + int sig,error,err_count=0;; + + my_thread_init(); + pthread_detach_this_thread(); + init_thr_alarm(10); /* Setup alarm handler */ + pthread_mutex_lock(&LOCK_thread_count); /* Required by bsdi */ + pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */ + pthread_mutex_unlock(&LOCK_thread_count); + + sigemptyset(&set); /* Catch all signals */ + sigaddset(&set,SIGINT); + sigaddset(&set,SIGQUIT); + sigaddset(&set,SIGTERM); + sigaddset(&set,SIGHUP); +#ifdef SIGTSTP + sigaddset(&set,SIGTSTP); +#endif +#ifdef USE_ONE_SIGNAL_HAND + sigaddset(&set,THR_SERVER_ALARM); /* For alarms */ + puts("Starting signal and alarm handling thread"); +#else + puts("Starting signal handling thread"); +#endif + printf("server alarm: %d thread alarm: %d\n", + THR_SERVER_ALARM, thr_client_alarm); + DBUG_PRINT("info",("Starting signal and alarm handling thread")); + for(;;) + { + while ((error=my_sigwait(&set,&sig)) == EINTR) + printf("sigwait restarted\n"); + if (error) + { + fprintf(stderr,"Got error %d from sigwait\n",error); + if (err_count++ > 5) + exit(1); /* Too many errors in test */ + continue; + } +#ifdef USE_ONE_SIGNAL_HAND + if (sig != THR_SERVER_ALARM) +#endif + printf("Main thread: Got signal %d\n",sig); + switch (sig) { + case SIGINT: + case SIGQUIT: + case SIGTERM: + case SIGHUP: + printf("Aborting nicely\n"); + end_thr_alarm(0); + break; +#ifdef SIGTSTP + case SIGTSTP: + printf("Aborting\n"); + exit(1); + return 0; /* Keep some compilers happy */ +#endif +#ifdef USE_ONE_SIGNAL_HAND + case THR_SERVER_ALARM: + process_alarm(sig); + break; +#endif + } + } +} + + +int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) +{ + pthread_t tid; + pthread_attr_t thr_attr; + int i,*param,error; + sigset_t set; + ALARM_INFO alarm_info; + MY_INIT(argv[0]); + + if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '#') + { + DBUG_PUSH(argv[1]+2); + } + pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); + pthread_cond_init(&COND_thread_count,NULL); + + /* Start a alarm handling thread */ + sigemptyset(&set); + sigaddset(&set,SIGINT); + sigaddset(&set,SIGQUIT); + sigaddset(&set,SIGTERM); + sigaddset(&set,SIGHUP); + signal(SIGTERM,SIG_DFL); /* If it's blocked by parent */ +#ifdef SIGTSTP + sigaddset(&set,SIGTSTP); +#endif + sigaddset(&set,THR_SERVER_ALARM); + sigdelset(&set, thr_client_alarm); + (void) pthread_sigmask(SIG_SETMASK,&set,NULL); +#ifdef NOT_USED + sigemptyset(&set); + sigaddset(&set, thr_client_alarm); + pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0); +#endif + + pthread_attr_init(&thr_attr); + pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS); + pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED); + pthread_attr_setstacksize(&thr_attr,65536L); + + /* Start signal thread and wait for it to start */ + pthread_mutex_lock(&LOCK_thread_count); + pthread_create(&tid,&thr_attr,signal_hand,NULL); + pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); + DBUG_PRINT("info",("signal thread created")); + + thr_setconcurrency(3); + pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS); + printf("Main thread: %s\n",my_thread_name()); + for (i=0 ; i < 2 ; i++) + { + param=(int*) malloc(sizeof(int)); + *param= i; + pthread_mutex_lock(&LOCK_thread_count); + if ((error=pthread_create(&tid,&thr_attr,test_thread,(void*) param))) + { + printf("Can't create thread %d, error: %d\n",i,error); + exit(1); + } + thread_count++; + pthread_mutex_unlock(&LOCK_thread_count); + } + + pthread_attr_destroy(&thr_attr); + pthread_mutex_lock(&LOCK_thread_count); + thr_alarm_info(&alarm_info); + printf("Main_thread: Alarms: %u max_alarms: %u next_alarm_time: %lu\n", + alarm_info.active_alarms, alarm_info.max_used_alarms, + alarm_info.next_alarm_time); + while (thread_count) + { + pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); + if (thread_count == 1) + { + printf("Calling end_thr_alarm. This should cancel the last thread\n"); + end_thr_alarm(0); + } + } + pthread_mutex_unlock(&LOCK_thread_count); + thr_alarm_info(&alarm_info); + end_thr_alarm(1); + printf("Main_thread: Alarms: %u max_alarms: %u next_alarm_time: %lu\n", + alarm_info.active_alarms, alarm_info.max_used_alarms, + alarm_info.next_alarm_time); + printf("Test succeeded\n"); + return 0; +} + +#else /* THREAD */ + +int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) +{ +#ifndef THREAD + printf("thr_alarm disabled because we are not using threads\n"); +#else + printf("thr_alarm disabled with DONT_USE_THR_ALARM\n"); +#endif + exit(1); +} + +#endif /* THREAD */ +#endif /* MAIN */ diff --git a/externals/mysql/mysys/thr_lock.c b/externals/mysql/mysys/thr_lock.c new file mode 100644 index 00000000000..f9f32933fdf --- /dev/null +++ b/externals/mysql/mysys/thr_lock.c @@ -0,0 +1,1687 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* +Read and write locks for Posix threads. All tread must acquire +all locks it needs through thr_multi_lock() to avoid dead-locks. +A lock consists of a master lock (THR_LOCK), and lock instances +(THR_LOCK_DATA). +Any thread can have any number of lock instances (read and write:s) on +any lock. All lock instances must be freed. +Locks are prioritized according to: + +The current lock types are: + +TL_READ # Low priority read +TL_READ_WITH_SHARED_LOCKS +TL_READ_HIGH_PRIORITY # High priority read +TL_READ_NO_INSERT # Read without concurrent inserts +TL_WRITE_ALLOW_WRITE # Write lock that allows other writers +TL_WRITE_ALLOW_READ # Write lock, but allow reading +TL_WRITE_CONCURRENT_INSERT + # Insert that can be mixed when selects +TL_WRITE_DELAYED # Used by delayed insert + # Allows lower locks to take over +TL_WRITE_LOW_PRIORITY # Low priority write +TL_WRITE # High priority write +TL_WRITE_ONLY # High priority write + # Abort all new lock request with an error + +Locks are prioritized according to: + +WRITE_ALLOW_WRITE, WRITE_ALLOW_READ, WRITE_CONCURRENT_INSERT, WRITE_DELAYED, +WRITE_LOW_PRIORITY, READ, WRITE, READ_HIGH_PRIORITY and WRITE_ONLY + +Locks in the same privilege level are scheduled in first-in-first-out order. + +To allow concurrent read/writes locks, with 'WRITE_CONCURRENT_INSERT' one +should put a pointer to the following functions in the lock structure: +(If the pointer is zero (default), the function is not called) + +check_status: + Before giving a lock of type TL_WRITE_CONCURRENT_INSERT, + we check if this function exists and returns 0. + If not, then the lock is upgraded to TL_WRITE_LOCK + In MyISAM this is a simple check if the insert can be done + at the end of the datafile. +update_status: + in thr_reschedule_write_lock(), when an insert delayed thread + downgrades TL_WRITE lock to TL_WRITE_DELAYED, to allow SELECT + threads to proceed. + A storage engine should also call update_status internally + in the ::external_lock(F_UNLCK) method. + In MyISAM and CSV this functions updates the length of the datafile. +get_status: + When one gets a lock this functions is called. + In MyISAM this stores the number of rows and size of the datafile + for concurrent reads. + +The lock algorithm allows one to have one TL_WRITE_ALLOW_READ, +TL_WRITE_CONCURRENT_INSERT or one TL_WRITE_DELAYED lock at the same +time as multiple read locks. + +In addition, if lock->allow_multiple_concurrent_insert is set then there can +be any number of TL_WRITE_CONCURRENT_INSERT locks aktive at the same time. +*/ + +#if !defined(MAIN) && !defined(DBUG_OFF) && !defined(EXTRA_DEBUG) +#define FORCE_DBUG_OFF +#endif + +#include "mysys_priv.h" + +#ifdef THREAD +#include "thr_lock.h" +#include +#include + +my_bool thr_lock_inited=0; +ulong locks_immediate = 0L, locks_waited = 0L; +ulong table_lock_wait_timeout; +enum thr_lock_type thr_upgraded_concurrent_insert_lock = TL_WRITE; + +/* The following constants are only for debug output */ +#define MAX_THREADS 100 +#define MAX_LOCKS 100 + + +LIST *thr_lock_thread_list; /* List of threads in use */ +ulong max_write_lock_count= ~(ulong) 0L; + +static inline pthread_cond_t *get_cond(void) +{ + return &my_thread_var->suspend; +} + +/* +** For the future (now the thread specific cond is alloced by my_pthread.c) +*/ + +my_bool init_thr_lock() +{ + thr_lock_inited=1; + return 0; +} + +static inline my_bool +thr_lock_owner_equal(THR_LOCK_OWNER *rhs, THR_LOCK_OWNER *lhs) +{ + return rhs == lhs; +} + + +#ifdef EXTRA_DEBUG +#define MAX_FOUND_ERRORS 10 /* Report 10 first errors */ +static uint found_errors=0; + +static int check_lock(struct st_lock_list *list, const char* lock_type, + const char *where, my_bool same_owner, my_bool no_cond) +{ + THR_LOCK_DATA *data,**prev; + uint count=0; + THR_LOCK_OWNER *first_owner; + LINT_INIT(first_owner); + + prev= &list->data; + if (list->data) + { + enum thr_lock_type last_lock_type=list->data->type; + + if (same_owner && list->data) + first_owner= list->data->owner; + for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next) + { + if (data->type != last_lock_type) + last_lock_type=TL_IGNORE; + if (data->prev != prev) + { + fprintf(stderr, + "Warning: prev link %d didn't point at previous lock at %s: %s\n", + count, lock_type, where); + return 1; + } + if (same_owner && + !thr_lock_owner_equal(data->owner, first_owner) && + last_lock_type != TL_WRITE_ALLOW_WRITE && + last_lock_type != TL_WRITE_CONCURRENT_INSERT) + { + fprintf(stderr, + "Warning: Found locks from different threads in %s: %s\n", + lock_type,where); + return 1; + } + if (no_cond && data->cond) + { + fprintf(stderr, + "Warning: Found active lock with not reset cond %s: %s\n", + lock_type,where); + return 1; + } + prev= &data->next; + } + if (data) + { + fprintf(stderr,"Warning: found too many locks at %s: %s\n", + lock_type,where); + return 1; + } + } + if (prev != list->last) + { + fprintf(stderr,"Warning: last didn't point at last lock at %s: %s\n", + lock_type, where); + return 1; + } + return 0; +} + + +static void check_locks(THR_LOCK *lock, const char *where, + my_bool allow_no_locks) +{ + uint old_found_errors=found_errors; + DBUG_ENTER("check_locks"); + + if (found_errors < MAX_FOUND_ERRORS) + { + if (check_lock(&lock->write,"write",where,1,1) | + check_lock(&lock->write_wait,"write_wait",where,0,0) | + check_lock(&lock->read,"read",where,0,1) | + check_lock(&lock->read_wait,"read_wait",where,0,0)) + found_errors++; + + if (found_errors < MAX_FOUND_ERRORS) + { + uint count=0; + THR_LOCK_DATA *data; + for (data=lock->read.data ; data ; data=data->next) + { + if (data->type == TL_READ_NO_INSERT) + count++; + /* Protect against infinite loop. */ + DBUG_ASSERT(count <= lock->read_no_write_count); + } + if (count != lock->read_no_write_count) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': Locks read_no_write_count was %u when it should have been %u\n", where, lock->read_no_write_count,count); + } + + if (!lock->write.data) + { + if (!allow_no_locks && !lock->read.data && + (lock->write_wait.data || lock->read_wait.data)) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': No locks in use but locks are in wait queue\n", + where); + } + if (!lock->write_wait.data) + { + if (!allow_no_locks && lock->read_wait.data) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': No write locks and waiting read locks\n", + where); + } + } + else + { + if (!allow_no_locks && + (((lock->write_wait.data->type == TL_WRITE_CONCURRENT_INSERT || + lock->write_wait.data->type == TL_WRITE_ALLOW_WRITE) && + !lock->read_no_write_count) || + lock->write_wait.data->type == TL_WRITE_ALLOW_READ || + (lock->write_wait.data->type == TL_WRITE_DELAYED && + !lock->read.data))) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': Write lock %d waiting while no exclusive read locks\n",where,(int) lock->write_wait.data->type); + } + } + } + else + { + /* We have at least one write lock */ + if (lock->write.data->type == TL_WRITE_CONCURRENT_INSERT) + { + THR_LOCK_DATA *data; + for (data=lock->write.data->next ; data ; data=data->next) + { + if (data->type != TL_WRITE_CONCURRENT_INSERT) + { + fprintf(stderr, + "Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write locks\n", + where); + break; + } + } + } + if (lock->write_wait.data) + { + if (!allow_no_locks && + lock->write.data->type == TL_WRITE_ALLOW_WRITE && + lock->write_wait.data->type == TL_WRITE_ALLOW_WRITE) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock\n", + where); + } + } + if (lock->read.data) + { + if (!thr_lock_owner_equal(lock->write.data->owner, + lock->read.data->owner) && + ((lock->write.data->type > TL_WRITE_DELAYED && + lock->write.data->type != TL_WRITE_ONLY) || + ((lock->write.data->type == TL_WRITE_CONCURRENT_INSERT || + lock->write.data->type == TL_WRITE_ALLOW_WRITE) && + lock->read_no_write_count))) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': Found lock of type %d that is write and read locked\n", + where, lock->write.data->type); + DBUG_PRINT("warning",("At '%s': Found lock of type %d that is write and read locked\n", + where, lock->write.data->type)); + + } + } + if (lock->read_wait.data) + { + if (!allow_no_locks && lock->write.data->type <= TL_WRITE_DELAYED && + lock->read_wait.data->type <= TL_READ_HIGH_PRIORITY) + { + found_errors++; + fprintf(stderr, + "Warning at '%s': Found read lock of type %d waiting for write lock of type %d\n", + where, + (int) lock->read_wait.data->type, + (int) lock->write.data->type); + } + } + } + } + if (found_errors != old_found_errors) + { + fflush(stderr); + DBUG_PRINT("error",("Found wrong lock")); + } + } + DBUG_VOID_RETURN; +} + +#else /* EXTRA_DEBUG */ +#define check_locks(A,B,C) +#endif + + + /* Initialize a lock */ + +void thr_lock_init(THR_LOCK *lock) +{ + DBUG_ENTER("thr_lock_init"); + bzero((char*) lock,sizeof(*lock)); + pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST); + lock->read.last= &lock->read.data; + lock->read_wait.last= &lock->read_wait.data; + lock->write_wait.last= &lock->write_wait.data; + lock->write.last= &lock->write.data; + + pthread_mutex_lock(&THR_LOCK_lock); /* Add to locks in use */ + lock->list.data=(void*) lock; + thr_lock_thread_list=list_add(thr_lock_thread_list,&lock->list); + pthread_mutex_unlock(&THR_LOCK_lock); + DBUG_VOID_RETURN; +} + + +void thr_lock_delete(THR_LOCK *lock) +{ + DBUG_ENTER("thr_lock_delete"); + pthread_mutex_lock(&THR_LOCK_lock); + thr_lock_thread_list=list_delete(thr_lock_thread_list,&lock->list); + pthread_mutex_unlock(&THR_LOCK_lock); + pthread_mutex_destroy(&lock->mutex); + DBUG_VOID_RETURN; +} + + +void thr_lock_info_init(THR_LOCK_INFO *info) +{ + struct st_my_thread_var *tmp= my_thread_var; + info->thread= tmp->pthread_self; + info->thread_id= tmp->id; + info->n_cursors= 0; +} + + /* Initialize a lock instance */ + +void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, void *param) +{ + data->lock=lock; + data->type=TL_UNLOCK; + data->owner= 0; /* no owner yet */ + data->status_param=param; + data->cond=0; +} + + +static inline my_bool +have_old_read_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner) +{ + for ( ; data ; data=data->next) + { + if (thr_lock_owner_equal(data->owner, owner)) + return 1; /* Already locked by thread */ + } + return 0; +} + +static inline my_bool have_specific_lock(THR_LOCK_DATA *data, + enum thr_lock_type type) +{ + for ( ; data ; data=data->next) + { + if (data->type == type) + return 1; + } + return 0; +} + + +static void wake_up_waiters(THR_LOCK *lock); + +static enum enum_thr_lock_result +wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, + my_bool in_wait_list) +{ + struct st_my_thread_var *thread_var= my_thread_var; + pthread_cond_t *cond= &thread_var->suspend; + struct timespec wait_timeout; + enum enum_thr_lock_result result= THR_LOCK_ABORTED; + my_bool can_deadlock= test(data->owner->info->n_cursors); + const char *old_proc_info; + DBUG_ENTER("wait_for_lock"); + + /* + One can use this to signal when a thread is going to wait for a lock. + See debug_sync.cc. + + Beware of waiting for a signal here. The lock has aquired its mutex. + While waiting on a signal here, the locking thread could not aquire + the mutex to release the lock. One could lock up the table + completely. + + In detail it works so: When thr_lock() tries to acquire a table + lock, it locks the lock->mutex, checks if it can have the lock, and + if not, it calls wait_for_lock(). Here it unlocks the table lock + while waiting on a condition. The sync point is located before this + wait for condition. If we have a waiting action here, we hold the + the table locks mutex all the time. Any attempt to look at the table + lock by another thread blocks it immediately on lock->mutex. This + can easily become an unexpected and unobvious blockage. So be + warned: Do not request a WAIT_FOR action for the 'wait_for_lock' + sync point unless you really know what you do. + */ + DEBUG_SYNC_C("wait_for_lock"); + + if (!in_wait_list) + { + (*wait->last)=data; /* Wait for lock */ + data->prev= wait->last; + wait->last= &data->next; + } + + statistic_increment(locks_waited, &THR_LOCK_lock); + + /* Set up control struct to allow others to abort locks */ + thread_var->current_mutex= &data->lock->mutex; + thread_var->current_cond= cond; + data->cond= cond; + + old_proc_info= proc_info_hook(NULL, "Table lock", + __func__, __FILE__, __LINE__); + + if (can_deadlock) + set_timespec(wait_timeout, table_lock_wait_timeout); + while (!thread_var->abort || in_wait_list) + { + int rc= (can_deadlock ? + pthread_cond_timedwait(cond, &data->lock->mutex, + &wait_timeout) : + pthread_cond_wait(cond, &data->lock->mutex)); + /* + We must break the wait if one of the following occurs: + - the connection has been aborted (!thread_var->abort), but + this is not a delayed insert thread (in_wait_list). For a delayed + insert thread the proper action at shutdown is, apparently, to + acquire the lock and complete the insert. + - the lock has been granted (data->cond is set to NULL by the granter), + or the waiting has been aborted (additionally data->type is set to + TL_UNLOCK). + - the wait has timed out (rc == ETIMEDOUT) + Order of checks below is important to not report about timeout + if the predicate is true. + */ + if (data->cond == 0) + { + DBUG_PRINT("thr_lock", ("lock granted/aborted")); + break; + } + if (rc == ETIMEDOUT || rc == ETIME) + { + /* purecov: begin inspected */ + DBUG_PRINT("thr_lock", ("lock timed out")); + result= THR_LOCK_WAIT_TIMEOUT; + break; + /* purecov: end */ + } + } + DBUG_PRINT("thr_lock", ("aborted: %d in_wait_list: %d", + thread_var->abort, in_wait_list)); + + if (data->cond || data->type == TL_UNLOCK) + { + if (data->cond) /* aborted or timed out */ + { + if (((*data->prev)=data->next)) /* remove from wait-list */ + data->next->prev= data->prev; + else + wait->last=data->prev; + data->type= TL_UNLOCK; /* No lock */ + check_locks(data->lock, "killed or timed out wait_for_lock", 1); + wake_up_waiters(data->lock); + } + else + { + DBUG_PRINT("thr_lock", ("lock aborted")); + check_locks(data->lock, "aborted wait_for_lock", 0); + } + } + else + { + result= THR_LOCK_SUCCESS; + if (data->lock->get_status) + (*data->lock->get_status)(data->status_param, + data->type == TL_WRITE_CONCURRENT_INSERT); + check_locks(data->lock,"got wait_for_lock",0); + } + pthread_mutex_unlock(&data->lock->mutex); + + /* The following must be done after unlock of lock->mutex */ + pthread_mutex_lock(&thread_var->mutex); + thread_var->current_mutex= 0; + thread_var->current_cond= 0; + pthread_mutex_unlock(&thread_var->mutex); + + proc_info_hook(NULL, old_proc_info, __func__, __FILE__, __LINE__); + + DBUG_RETURN(result); +} + + +enum enum_thr_lock_result +thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, + enum thr_lock_type lock_type) +{ + THR_LOCK *lock=data->lock; + enum enum_thr_lock_result result= THR_LOCK_SUCCESS; + struct st_lock_list *wait_queue; + THR_LOCK_DATA *lock_owner; + DBUG_ENTER("thr_lock"); + + data->next=0; + data->cond=0; /* safety */ + data->type=lock_type; + data->owner= owner; /* Must be reset ! */ + pthread_mutex_lock(&lock->mutex); + DBUG_PRINT("lock",("data: %p thread: 0x%lx lock: %p type: %d", + data, data->owner->info->thread_id, + lock, (int) lock_type)); + check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ? + "enter read_lock" : "enter write_lock",0); + if ((int) lock_type <= (int) TL_READ_NO_INSERT) + { + /* Request for READ lock */ + if (lock->write.data) + { + /* + We can allow a read lock even if there is already a write lock + on the table in one the following cases: + - This thread alread have a write lock on the table + - The write lock is TL_WRITE_ALLOW_READ or TL_WRITE_DELAYED + and the read lock is TL_READ_HIGH_PRIORITY or TL_READ + - The write lock is TL_WRITE_CONCURRENT_INSERT or TL_WRITE_ALLOW_WRITE + and the read lock is not TL_READ_NO_INSERT + */ + + DBUG_PRINT("lock",("write locked 1 by thread: 0x%lx", + lock->write.data->owner->info->thread_id)); + if (thr_lock_owner_equal(data->owner, lock->write.data->owner) || + (lock->write.data->type <= TL_WRITE_DELAYED && + (((int) lock_type <= (int) TL_READ_HIGH_PRIORITY) || + (lock->write.data->type != TL_WRITE_CONCURRENT_INSERT && + lock->write.data->type != TL_WRITE_ALLOW_READ)))) + { /* Already got a write lock */ + (*lock->read.last)=data; /* Add to running FIFO */ + data->prev=lock->read.last; + lock->read.last= &data->next; + if (lock_type == TL_READ_NO_INSERT) + lock->read_no_write_count++; + check_locks(lock,"read lock with old write lock",0); + if (lock->get_status) + (*lock->get_status)(data->status_param, 0); + statistic_increment(locks_immediate,&THR_LOCK_lock); + goto end; + } + if (lock->write.data->type == TL_WRITE_ONLY) + { + /* We are not allowed to get a READ lock in this case */ + data->type=TL_UNLOCK; + result= THR_LOCK_ABORTED; /* Can't wait for this one */ + goto end; + } + } + else if (!lock->write_wait.data || + lock->write_wait.data->type <= TL_WRITE_LOW_PRIORITY || + lock_type == TL_READ_HIGH_PRIORITY || + have_old_read_lock(lock->read.data, data->owner)) + { /* No important write-locks */ + (*lock->read.last)=data; /* Add to running FIFO */ + data->prev=lock->read.last; + lock->read.last= &data->next; + if (lock_type == TL_READ_NO_INSERT) + lock->read_no_write_count++; + check_locks(lock,"read lock with no write locks",0); + if (lock->get_status) + (*lock->get_status)(data->status_param, 0); + statistic_increment(locks_immediate,&THR_LOCK_lock); + goto end; + } + /* + We're here if there is an active write lock or no write + lock but a high priority write waiting in the write_wait queue. + In the latter case we should yield the lock to the writer. + */ + wait_queue= &lock->read_wait; + } + else /* Request for WRITE lock */ + { + if (lock_type == TL_WRITE_DELAYED) + { + if (lock->write.data && lock->write.data->type == TL_WRITE_ONLY) + { + data->type=TL_UNLOCK; + result= THR_LOCK_ABORTED; /* Can't wait for this one */ + goto end; + } + /* + if there is a TL_WRITE_ALLOW_READ lock, we have to wait for a lock + (TL_WRITE_ALLOW_READ is used for ALTER TABLE in MySQL) + */ + if ((!lock->write.data || + lock->write.data->type != TL_WRITE_ALLOW_READ) && + !have_specific_lock(lock->write_wait.data,TL_WRITE_ALLOW_READ) && + (lock->write.data || lock->read.data)) + { + /* Add delayed write lock to write_wait queue, and return at once */ + (*lock->write_wait.last)=data; + data->prev=lock->write_wait.last; + lock->write_wait.last= &data->next; + data->cond=get_cond(); + /* + We don't have to do get_status here as we will do it when we change + the delayed lock to a real write lock + */ + statistic_increment(locks_immediate,&THR_LOCK_lock); + goto end; + } + } + else if (lock_type == TL_WRITE_CONCURRENT_INSERT && ! lock->check_status) + data->type=lock_type= thr_upgraded_concurrent_insert_lock; + + if (lock->write.data) /* If there is a write lock */ + { + if (lock->write.data->type == TL_WRITE_ONLY) + { + /* purecov: begin tested */ + /* Allow lock owner to bypass TL_WRITE_ONLY. */ + if (!thr_lock_owner_equal(data->owner, lock->write.data->owner)) + { + /* We are not allowed to get a lock in this case */ + data->type=TL_UNLOCK; + result= THR_LOCK_ABORTED; /* Can't wait for this one */ + goto end; + } + /* purecov: end */ + } + + /* + The following test will not work if the old lock was a + TL_WRITE_ALLOW_WRITE, TL_WRITE_ALLOW_READ or TL_WRITE_DELAYED in + the same thread, but this will never happen within MySQL. + + The idea is to allow us to get a lock at once if we already have + a write lock or if there is no pending write locks and if all + write locks are of the same type and are either + TL_WRITE_ALLOW_WRITE or TL_WRITE_CONCURRENT_INSERT + */ + if (thr_lock_owner_equal(data->owner, lock->write.data->owner) || + (!lock->write_wait.data && lock_type == lock->write.data->type && + (lock_type == TL_WRITE_ALLOW_WRITE || + (lock_type == TL_WRITE_CONCURRENT_INSERT && + lock->allow_multiple_concurrent_insert)))) + { + DBUG_PRINT("info", ("write_wait.data: %p old_type: %d", + lock->write_wait.data, + lock->write.data->type)); + + (*lock->write.last)=data; /* Add to running fifo */ + data->prev=lock->write.last; + lock->write.last= &data->next; + check_locks(lock,"second write lock",0); + if (lock->get_status) + (*lock->get_status)(data->status_param, + lock_type == TL_WRITE_CONCURRENT_INSERT); + statistic_increment(locks_immediate,&THR_LOCK_lock); + goto end; + } + DBUG_PRINT("lock",("write locked 2 by thread: 0x%lx", + lock->write.data->owner->info->thread_id)); + } + else + { + DBUG_PRINT("info", ("write_wait.data: %p", + lock->write_wait.data)); + if (!lock->write_wait.data) + { /* no scheduled write locks */ + my_bool concurrent_insert= 0; + if (lock_type == TL_WRITE_CONCURRENT_INSERT) + { + concurrent_insert= 1; + if ((*lock->check_status)(data->status_param)) + { + concurrent_insert= 0; + data->type=lock_type= thr_upgraded_concurrent_insert_lock; + } + } + + if (!lock->read.data || + (lock_type <= TL_WRITE_DELAYED && + ((lock_type != TL_WRITE_CONCURRENT_INSERT && + lock_type != TL_WRITE_ALLOW_WRITE) || + !lock->read_no_write_count))) + { + (*lock->write.last)=data; /* Add as current write lock */ + data->prev=lock->write.last; + lock->write.last= &data->next; + if (lock->get_status) + (*lock->get_status)(data->status_param, concurrent_insert); + check_locks(lock,"only write lock",0); + statistic_increment(locks_immediate,&THR_LOCK_lock); + goto end; + } + } + DBUG_PRINT("lock",("write locked 3 by thread: 0x%lx type: %d", + lock->read.data->owner->info->thread_id, data->type)); + } + wait_queue= &lock->write_wait; + } + /* + Try to detect a trivial deadlock when using cursors: attempt to + lock a table that is already locked by an open cursor within the + same connection. lock_owner can be zero if we succumbed to a high + priority writer in the write_wait queue. + */ + lock_owner= lock->read.data ? lock->read.data : lock->write.data; + if (lock_owner && lock_owner->owner->info == owner->info) + { + DBUG_PRINT("lock",("deadlock")); + result= THR_LOCK_DEADLOCK; + goto end; + } + /* Can't get lock yet; Wait for it */ + DBUG_RETURN(wait_for_lock(wait_queue, data, 0)); +end: + pthread_mutex_unlock(&lock->mutex); + DBUG_RETURN(result); +} + + +static inline void free_all_read_locks(THR_LOCK *lock, + my_bool using_concurrent_insert) +{ + THR_LOCK_DATA *data=lock->read_wait.data; + + check_locks(lock,"before freeing read locks",1); + + /* move all locks from read_wait list to read list */ + (*lock->read.last)=data; + data->prev=lock->read.last; + lock->read.last=lock->read_wait.last; + + /* Clear read_wait list */ + lock->read_wait.last= &lock->read_wait.data; + + do + { + pthread_cond_t *cond=data->cond; + if ((int) data->type == (int) TL_READ_NO_INSERT) + { + if (using_concurrent_insert) + { + /* + We can't free this lock; + Link lock away from read chain back into read_wait chain + */ + if (((*data->prev)=data->next)) + data->next->prev=data->prev; + else + lock->read.last=data->prev; + *lock->read_wait.last= data; + data->prev= lock->read_wait.last; + lock->read_wait.last= &data->next; + continue; + } + lock->read_no_write_count++; + } + /* purecov: begin inspected */ + DBUG_PRINT("lock",("giving read lock to thread: 0x%lx", + data->owner->info->thread_id)); + /* purecov: end */ + data->cond=0; /* Mark thread free */ + pthread_cond_signal(cond); + } while ((data=data->next)); + *lock->read_wait.last=0; + if (!lock->read_wait.data) + lock->write_lock_count=0; + check_locks(lock,"after giving read locks",0); +} + + /* Unlock lock and free next thread on same lock */ + +void thr_unlock(THR_LOCK_DATA *data) +{ + THR_LOCK *lock=data->lock; + enum thr_lock_type lock_type=data->type; + DBUG_ENTER("thr_unlock"); + DBUG_PRINT("lock",("data: %p thread: 0x%lx lock: %p", + data, data->owner->info->thread_id, lock)); + pthread_mutex_lock(&lock->mutex); + check_locks(lock,"start of release lock",0); + + if (((*data->prev)=data->next)) /* remove from lock-list */ + data->next->prev= data->prev; + else if (lock_type <= TL_READ_NO_INSERT) + lock->read.last=data->prev; + else if (lock_type == TL_WRITE_DELAYED && data->cond) + { + /* + This only happens in extreme circumstances when a + write delayed lock that is waiting for a lock + */ + lock->write_wait.last=data->prev; /* Put it on wait queue */ + } + else + lock->write.last=data->prev; + if (lock_type == TL_READ_NO_INSERT) + lock->read_no_write_count--; + data->type=TL_UNLOCK; /* Mark unlocked */ + check_locks(lock,"after releasing lock",1); + wake_up_waiters(lock); + pthread_mutex_unlock(&lock->mutex); + DBUG_VOID_RETURN; +} + + +/** + @brief Wake up all threads which pending requests for the lock + can be satisfied. + + @param lock Lock for which threads should be woken up + +*/ + +static void wake_up_waiters(THR_LOCK *lock) +{ + THR_LOCK_DATA *data; + enum thr_lock_type lock_type; + DBUG_ENTER("wake_up_waiters"); + + if (!lock->write.data) /* If no active write locks */ + { + data=lock->write_wait.data; + if (!lock->read.data) /* If no more locks in use */ + { + /* Release write-locks with TL_WRITE or TL_WRITE_ONLY priority first */ + if (data && + (data->type != TL_WRITE_LOW_PRIORITY || !lock->read_wait.data || + lock->read_wait.data->type < TL_READ_HIGH_PRIORITY)) + { + if (lock->write_lock_count++ > max_write_lock_count) + { + /* Too many write locks in a row; Release all waiting read locks */ + lock->write_lock_count=0; + if (lock->read_wait.data) + { + DBUG_PRINT("info",("Freeing all read_locks because of max_write_lock_count")); + free_all_read_locks(lock,0); + goto end; + } + } + for (;;) + { + if (((*data->prev)=data->next)) /* remove from wait-list */ + data->next->prev= data->prev; + else + lock->write_wait.last=data->prev; + (*lock->write.last)=data; /* Put in execute list */ + data->prev=lock->write.last; + data->next=0; + lock->write.last= &data->next; + if (data->type == TL_WRITE_CONCURRENT_INSERT && + (*lock->check_status)(data->status_param)) + data->type=TL_WRITE; /* Upgrade lock */ + /* purecov: begin inspected */ + DBUG_PRINT("lock",("giving write lock of type %d to thread: 0x%lx", + data->type, data->owner->info->thread_id)); + /* purecov: end */ + { + pthread_cond_t *cond=data->cond; + data->cond=0; /* Mark thread free */ + pthread_cond_signal(cond); /* Start waiting thread */ + } + if (data->type != TL_WRITE_ALLOW_WRITE || + !lock->write_wait.data || + lock->write_wait.data->type != TL_WRITE_ALLOW_WRITE) + break; + data=lock->write_wait.data; /* Free this too */ + } + if (data->type >= TL_WRITE_LOW_PRIORITY) + goto end; + /* Release possible read locks together with the write lock */ + } + if (lock->read_wait.data) + free_all_read_locks(lock, + data && + (data->type == TL_WRITE_CONCURRENT_INSERT || + data->type == TL_WRITE_ALLOW_WRITE)); + else + { + DBUG_PRINT("lock",("No waiting read locks to free")); + } + } + else if (data && + (lock_type=data->type) <= TL_WRITE_DELAYED && + ((lock_type != TL_WRITE_CONCURRENT_INSERT && + lock_type != TL_WRITE_ALLOW_WRITE) || + !lock->read_no_write_count)) + { + /* + For DELAYED, ALLOW_READ, WRITE_ALLOW_WRITE or CONCURRENT_INSERT locks + start WRITE locks together with the READ locks + */ + if (lock_type == TL_WRITE_CONCURRENT_INSERT && + (*lock->check_status)(data->status_param)) + { + data->type=TL_WRITE; /* Upgrade lock */ + if (lock->read_wait.data) + free_all_read_locks(lock,0); + goto end; + } + do { + pthread_cond_t *cond=data->cond; + if (((*data->prev)=data->next)) /* remove from wait-list */ + data->next->prev= data->prev; + else + lock->write_wait.last=data->prev; + (*lock->write.last)=data; /* Put in execute list */ + data->prev=lock->write.last; + lock->write.last= &data->next; + data->next=0; /* Only one write lock */ + data->cond=0; /* Mark thread free */ + pthread_cond_signal(cond); /* Start waiting thread */ + } while (lock_type == TL_WRITE_ALLOW_WRITE && + (data=lock->write_wait.data) && + data->type == TL_WRITE_ALLOW_WRITE); + if (lock->read_wait.data) + free_all_read_locks(lock, + (lock_type == TL_WRITE_CONCURRENT_INSERT || + lock_type == TL_WRITE_ALLOW_WRITE)); + } + else if (!data && lock->read_wait.data) + free_all_read_locks(lock,0); + } +end: + check_locks(lock, "after waking up waiters", 0); + DBUG_VOID_RETURN; +} + + +/* +** Get all locks in a specific order to avoid dead-locks +** Sort acording to lock position and put write_locks before read_locks if +** lock on same lock. +*/ + + +#define LOCK_CMP(A,B) ((uchar*) (A->lock) - (uint) ((A)->type) < (uchar*) (B->lock)- (uint) ((B)->type)) + +static void sort_locks(THR_LOCK_DATA **data,uint count) +{ + THR_LOCK_DATA **pos,**end,**prev,*tmp; + + /* Sort locks with insertion sort (fast because almost always few locks) */ + + for (pos=data+1,end=data+count; pos < end ; pos++) + { + tmp= *pos; + if (LOCK_CMP(tmp,pos[-1])) + { + prev=pos; + do { + prev[0]=prev[-1]; + } while (--prev != data && LOCK_CMP(tmp,prev[-1])); + prev[0]=tmp; + } + } +} + + +enum enum_thr_lock_result +thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_OWNER *owner) +{ + THR_LOCK_DATA **pos,**end; + DBUG_ENTER("thr_multi_lock"); + DBUG_PRINT("lock",("data: %p count: %d", data, count)); + if (count > 1) + sort_locks(data,count); + /* lock everything */ + for (pos=data,end=data+count; pos < end ; pos++) + { + enum enum_thr_lock_result result= thr_lock(*pos, owner, (*pos)->type); + if (result != THR_LOCK_SUCCESS) + { /* Aborted */ + thr_multi_unlock(data,(uint) (pos-data)); + DBUG_RETURN(result); + } +#ifdef MAIN + printf("Thread: %s Got lock: 0x%lx type: %d\n",my_thread_name(), + (long) pos[0]->lock, pos[0]->type); fflush(stdout); +#endif + } + thr_lock_merge_status(data, count); + DBUG_RETURN(THR_LOCK_SUCCESS); +} + + +/** + Ensure that all locks for a given table have the same + status_param. + + This is a MyISAM and possibly Maria specific crutch. MyISAM + engine stores data file length, record count and other table + properties in status_param member of handler. When a table is + locked, connection-local copy is made from a global copy + (myisam_share) by mi_get_status(). When a table is unlocked, + the changed status is transferred back to the global share by + mi_update_status(). + + One thing MyISAM doesn't do is to ensure that when the same + table is opened twice in a connection all instances share the + same status_param. This is necessary, however: for one, to keep + all instances of a connection "on the same page" with regard to + the current state of the table. For other, unless this is done, + myisam_share will always get updated from the last unlocked + instance (in mi_update_status()), and when this instance was not + the one that was used to update data, records may be lost. + + For each table, this function looks up the last lock_data in the + list of acquired locks, and makes sure that all other instances + share status_param with it. +*/ + +void +thr_lock_merge_status(THR_LOCK_DATA **data, uint count) +{ +#if !defined(DONT_USE_RW_LOCKS) + THR_LOCK_DATA **pos= data; + THR_LOCK_DATA **end= data + count; + if (count > 1) + { + THR_LOCK_DATA *last_lock= end[-1]; + pos=end-1; + do + { + pos--; + if (last_lock->lock == (*pos)->lock && + last_lock->lock->copy_status) + { + if (last_lock->type <= TL_READ_NO_INSERT) + { + THR_LOCK_DATA **read_lock; + /* + If we are locking the same table with read locks we must ensure + that all tables share the status of the last write lock or + the same read lock. + */ + for (; + (*pos)->type <= TL_READ_NO_INSERT && + pos != data && + pos[-1]->lock == (*pos)->lock ; + pos--) ; + + read_lock = pos+1; + do + { + (last_lock->lock->copy_status)((*read_lock)->status_param, + (*pos)->status_param); + } while (*(read_lock++) != last_lock); + last_lock= (*pos); /* Point at last write lock */ + } + else + (*last_lock->lock->copy_status)((*pos)->status_param, + last_lock->status_param); + } + else + last_lock=(*pos); + } while (pos != data); + } +#endif +} + + /* free all locks */ + +void thr_multi_unlock(THR_LOCK_DATA **data,uint count) +{ + THR_LOCK_DATA **pos,**end; + DBUG_ENTER("thr_multi_unlock"); + DBUG_PRINT("lock",("data: %p count: %d", data, count)); + + for (pos=data,end=data+count; pos < end ; pos++) + { +#ifdef MAIN + printf("Thread: %s Rel lock: 0x%lx type: %d\n", + my_thread_name(), (long) pos[0]->lock, pos[0]->type); + fflush(stdout); +#endif + if ((*pos)->type != TL_UNLOCK) + thr_unlock(*pos); + else + { + DBUG_PRINT("lock",("Free lock: data: %p thread: 0x%lx lock: %p", + *pos, (*pos)->owner->info->thread_id, + (*pos)->lock)); + } + } + DBUG_VOID_RETURN; +} + +/* + Abort all threads waiting for a lock. The lock will be upgraded to + TL_WRITE_ONLY to abort any new accesses to the lock +*/ + +void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock) +{ + THR_LOCK_DATA *data; + DBUG_ENTER("thr_abort_locks"); + pthread_mutex_lock(&lock->mutex); + + for (data=lock->read_wait.data; data ; data=data->next) + { + data->type=TL_UNLOCK; /* Mark killed */ + /* It's safe to signal the cond first: we're still holding the mutex. */ + pthread_cond_signal(data->cond); + data->cond=0; /* Removed from list */ + } + for (data=lock->write_wait.data; data ; data=data->next) + { + data->type=TL_UNLOCK; + pthread_cond_signal(data->cond); + data->cond=0; + } + lock->read_wait.last= &lock->read_wait.data; + lock->write_wait.last= &lock->write_wait.data; + lock->read_wait.data=lock->write_wait.data=0; + if (upgrade_lock && lock->write.data) + lock->write.data->type=TL_WRITE_ONLY; + pthread_mutex_unlock(&lock->mutex); + DBUG_VOID_RETURN; +} + + +/* + Abort all locks for specific table/thread combination + + This is used to abort all locks for a specific thread +*/ + +my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread_id) +{ + THR_LOCK_DATA *data; + my_bool found= FALSE; + DBUG_ENTER("thr_abort_locks_for_thread"); + + pthread_mutex_lock(&lock->mutex); + for (data= lock->read_wait.data; data ; data= data->next) + { + if (data->owner->info->thread_id == thread_id) /* purecov: tested */ + { + DBUG_PRINT("info",("Aborting read-wait lock")); + data->type= TL_UNLOCK; /* Mark killed */ + /* It's safe to signal the cond first: we're still holding the mutex. */ + found= TRUE; + pthread_cond_signal(data->cond); + data->cond= 0; /* Removed from list */ + + if (((*data->prev)= data->next)) + data->next->prev= data->prev; + else + lock->read_wait.last= data->prev; + } + } + for (data= lock->write_wait.data; data ; data= data->next) + { + if (data->owner->info->thread_id == thread_id) /* purecov: tested */ + { + DBUG_PRINT("info",("Aborting write-wait lock")); + data->type= TL_UNLOCK; + found= TRUE; + pthread_cond_signal(data->cond); + data->cond= 0; + + if (((*data->prev)= data->next)) + data->next->prev= data->prev; + else + lock->write_wait.last= data->prev; + } + } + wake_up_waiters(lock); + pthread_mutex_unlock(&lock->mutex); + DBUG_RETURN(found); +} + + +/* + Downgrade a WRITE_* to a lower WRITE level + SYNOPSIS + thr_downgrade_write_lock() + in_data Lock data of thread downgrading its lock + new_lock_type New write lock type + RETURN VALUE + NONE + DESCRIPTION + This can be used to downgrade a lock already owned. When the downgrade + occurs also other waiters, both readers and writers can be allowed to + start. + The previous lock is often TL_WRITE_ONLY but can also be + TL_WRITE and TL_WRITE_ALLOW_READ. The normal downgrade variants are + TL_WRITE_ONLY => TL_WRITE_ALLOW_READ After a short exclusive lock + TL_WRITE_ALLOW_READ => TL_WRITE_ALLOW_WRITE After discovering that the + operation didn't need such a high lock. + TL_WRITE_ONLY => TL_WRITE after a short exclusive lock while holding a + write table lock + TL_WRITE_ONLY => TL_WRITE_ALLOW_WRITE After a short exclusive lock after + already earlier having dongraded lock to TL_WRITE_ALLOW_WRITE + The implementation is conservative and rather don't start rather than + go on unknown paths to start, the common cases are handled. + + NOTE: + In its current implementation it is only allowed to downgrade from + TL_WRITE_ONLY. In this case there are no waiters. Thus no wake up + logic is required. +*/ + +void thr_downgrade_write_lock(THR_LOCK_DATA *in_data, + enum thr_lock_type new_lock_type) +{ + THR_LOCK *lock=in_data->lock; +#ifndef DBUG_OFF + enum thr_lock_type old_lock_type= in_data->type; +#endif + DBUG_ENTER("thr_downgrade_write_only_lock"); + + pthread_mutex_lock(&lock->mutex); + DBUG_ASSERT(old_lock_type == TL_WRITE_ONLY); + DBUG_ASSERT(old_lock_type > new_lock_type); + in_data->type= new_lock_type; + check_locks(lock,"after downgrading lock",0); + + pthread_mutex_unlock(&lock->mutex); + DBUG_VOID_RETURN; +} + +/* Upgrade a WRITE_DELAY lock to a WRITE_LOCK */ + +my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data, + enum thr_lock_type new_lock_type) +{ + THR_LOCK *lock=data->lock; + DBUG_ENTER("thr_upgrade_write_delay_lock"); + + pthread_mutex_lock(&lock->mutex); + if (data->type == TL_UNLOCK || data->type >= TL_WRITE_LOW_PRIORITY) + { + pthread_mutex_unlock(&lock->mutex); + DBUG_RETURN(data->type == TL_UNLOCK); /* Test if Aborted */ + } + check_locks(lock,"before upgrading lock",0); + /* TODO: Upgrade to TL_WRITE_CONCURRENT_INSERT in some cases */ + data->type= new_lock_type; /* Upgrade lock */ + + /* Check if someone has given us the lock */ + if (!data->cond) + { + if (!lock->read.data) /* No read locks */ + { /* We have the lock */ + if (lock->get_status) + (*lock->get_status)(data->status_param, 0); + pthread_mutex_unlock(&lock->mutex); + DBUG_RETURN(0); + } + + if (((*data->prev)=data->next)) /* remove from lock-list */ + data->next->prev= data->prev; + else + lock->write.last=data->prev; + + if ((data->next=lock->write_wait.data)) /* Put first in lock_list */ + data->next->prev= &data->next; + else + lock->write_wait.last= &data->next; + data->prev= &lock->write_wait.data; + lock->write_wait.data=data; + check_locks(lock,"upgrading lock",0); + } + else + { + check_locks(lock,"waiting for lock",0); + } + DBUG_RETURN(wait_for_lock(&lock->write_wait,data,1)); +} + + +/* downgrade a WRITE lock to a WRITE_DELAY lock if there is pending locks */ + +my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data) +{ + THR_LOCK *lock=data->lock; + enum thr_lock_type write_lock_type; + DBUG_ENTER("thr_reschedule_write_lock"); + + pthread_mutex_lock(&lock->mutex); + if (!lock->read_wait.data) /* No waiting read locks */ + { + pthread_mutex_unlock(&lock->mutex); + DBUG_RETURN(0); + } + + write_lock_type= data->type; + data->type=TL_WRITE_DELAYED; + if (lock->update_status) + (*lock->update_status)(data->status_param); + if (((*data->prev)=data->next)) /* remove from lock-list */ + data->next->prev= data->prev; + else + lock->write.last=data->prev; + + if ((data->next=lock->write_wait.data)) /* Put first in lock_list */ + data->next->prev= &data->next; + else + lock->write_wait.last= &data->next; + data->prev= &lock->write_wait.data; + data->cond=get_cond(); /* This was zero */ + lock->write_wait.data=data; + free_all_read_locks(lock,0); + + pthread_mutex_unlock(&lock->mutex); + DBUG_RETURN(thr_upgrade_write_delay_lock(data, write_lock_type)); +} + + +#include + +static void thr_print_lock(const char* name,struct st_lock_list *list) +{ + THR_LOCK_DATA *data,**prev; + uint count=0; + + if (list->data) + { + printf("%-10s: ",name); + prev= &list->data; + for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next) + { + printf("0x%lx (%lu:%d); ", (ulong) data, data->owner->info->thread_id, + (int) data->type); + if (data->prev != prev) + printf("\nWarning: prev didn't point at previous lock\n"); + prev= &data->next; + } + puts(""); + if (prev != list->last) + printf("Warning: last didn't point at last lock\n"); + } +} + +void thr_print_locks(void) +{ + LIST *list; + uint count=0; + + pthread_mutex_lock(&THR_LOCK_lock); + puts("Current locks:"); + for (list= thr_lock_thread_list; list && count++ < MAX_THREADS; + list= list_rest(list)) + { + THR_LOCK *lock=(THR_LOCK*) list->data; + pthread_mutex_lock(&lock->mutex); + printf("lock: 0x%lx:",(ulong) lock); + if ((lock->write_wait.data || lock->read_wait.data) && + (! lock->read.data && ! lock->write.data)) + printf(" WARNING: "); + if (lock->write.data) + printf(" write"); + if (lock->write_wait.data) + printf(" write_wait"); + if (lock->read.data) + printf(" read"); + if (lock->read_wait.data) + printf(" read_wait"); + puts(""); + thr_print_lock("write",&lock->write); + thr_print_lock("write_wait",&lock->write_wait); + thr_print_lock("read",&lock->read); + thr_print_lock("read_wait",&lock->read_wait); + pthread_mutex_unlock(&lock->mutex); + puts(""); + } + fflush(stdout); + pthread_mutex_unlock(&THR_LOCK_lock); +} + +#endif /* THREAD */ + +/***************************************************************************** +** Test of thread locks +****************************************************************************/ + +#ifdef MAIN + +#ifdef THREAD + +struct st_test { + uint lock_nr; + enum thr_lock_type lock_type; +}; + +THR_LOCK locks[6]; /* Number of locks +1 */ + +struct st_test test_0[] = {{0,TL_READ}}; /* One lock */ +struct st_test test_1[] = {{0,TL_READ},{0,TL_WRITE}}; /* Read and write lock of lock 0 */ +struct st_test test_2[] = {{1,TL_WRITE},{0,TL_READ},{2,TL_READ}}; +struct st_test test_3[] = {{2,TL_WRITE},{1,TL_READ},{0,TL_READ}}; /* Deadlock with test_2 ? */ +struct st_test test_4[] = {{0,TL_WRITE},{0,TL_READ},{0,TL_WRITE},{0,TL_READ}}; +struct st_test test_5[] = {{0,TL_READ},{1,TL_READ},{2,TL_READ},{3,TL_READ}}; /* Many reads */ +struct st_test test_6[] = {{0,TL_WRITE},{1,TL_WRITE},{2,TL_WRITE},{3,TL_WRITE}}; /* Many writes */ +struct st_test test_7[] = {{3,TL_READ}}; +struct st_test test_8[] = {{1,TL_READ_NO_INSERT},{2,TL_READ_NO_INSERT},{3,TL_READ_NO_INSERT}}; /* Should be quick */ +struct st_test test_9[] = {{4,TL_READ_HIGH_PRIORITY}}; +struct st_test test_10[] ={{4,TL_WRITE}}; +struct st_test test_11[] = {{0,TL_WRITE_LOW_PRIORITY},{1,TL_WRITE_LOW_PRIORITY},{2,TL_WRITE_LOW_PRIORITY},{3,TL_WRITE_LOW_PRIORITY}}; /* Many writes */ +struct st_test test_12[] = {{0,TL_WRITE_ALLOW_READ},{1,TL_WRITE_ALLOW_READ},{2,TL_WRITE_ALLOW_READ},{3,TL_WRITE_ALLOW_READ}}; /* Many writes */ +struct st_test test_13[] = {{0,TL_WRITE_CONCURRENT_INSERT},{1,TL_WRITE_CONCURRENT_INSERT},{2,TL_WRITE_CONCURRENT_INSERT},{3,TL_WRITE_CONCURRENT_INSERT}}; +struct st_test test_14[] = {{0,TL_WRITE_CONCURRENT_INSERT},{1,TL_READ}}; +struct st_test test_15[] = {{0,TL_WRITE_ALLOW_WRITE},{1,TL_READ}}; +struct st_test test_16[] = {{0,TL_WRITE_ALLOW_WRITE},{1,TL_WRITE_ALLOW_WRITE}}; + +struct st_test test_17[] = {{5,TL_WRITE_CONCURRENT_INSERT}}; +struct st_test test_18[] = {{5,TL_WRITE_CONCURRENT_INSERT}}; +struct st_test test_19[] = {{5,TL_READ}}; +struct st_test test_20[] = {{5,TL_READ_NO_INSERT}}; +struct st_test test_21[] = {{5,TL_WRITE}}; + + +struct st_test *tests[]= +{ + test_0, test_1, test_2, test_3, test_4, test_5, test_6, test_7, test_8, + test_9, test_10, test_11, test_12, test_13, test_14, test_15, test_16, + test_17, test_18, test_19, test_20, test_21 +}; + +int lock_counts[]= {sizeof(test_0)/sizeof(struct st_test), + sizeof(test_1)/sizeof(struct st_test), + sizeof(test_2)/sizeof(struct st_test), + sizeof(test_3)/sizeof(struct st_test), + sizeof(test_4)/sizeof(struct st_test), + sizeof(test_5)/sizeof(struct st_test), + sizeof(test_6)/sizeof(struct st_test), + sizeof(test_7)/sizeof(struct st_test), + sizeof(test_8)/sizeof(struct st_test), + sizeof(test_9)/sizeof(struct st_test), + sizeof(test_10)/sizeof(struct st_test), + sizeof(test_11)/sizeof(struct st_test), + sizeof(test_12)/sizeof(struct st_test), + sizeof(test_13)/sizeof(struct st_test), + sizeof(test_14)/sizeof(struct st_test), + sizeof(test_15)/sizeof(struct st_test), + sizeof(test_16)/sizeof(struct st_test), + sizeof(test_17)/sizeof(struct st_test), + sizeof(test_18)/sizeof(struct st_test), + sizeof(test_19)/sizeof(struct st_test), + sizeof(test_20)/sizeof(struct st_test), + sizeof(test_21)/sizeof(struct st_test) +}; + + +static pthread_cond_t COND_thread_count; +static pthread_mutex_t LOCK_thread_count; +static uint thread_count; +static ulong sum=0; + +#define MAX_LOCK_COUNT 8 + +/* The following functions is for WRITE_CONCURRENT_INSERT */ + +static void test_get_status(void* param __attribute__((unused)), + int concurrent_insert __attribute__((unused))) +{ +} + +static void test_update_status(void* param __attribute__((unused))) +{ +} + +static void test_copy_status(void* to __attribute__((unused)) , + void *from __attribute__((unused))) +{ +} + +static my_bool test_check_status(void* param __attribute__((unused))) +{ + return 0; +} + + +static void *test_thread(void *arg) +{ + int i,j,param=*((int*) arg); + THR_LOCK_DATA data[MAX_LOCK_COUNT]; + THR_LOCK_OWNER owner; + THR_LOCK_INFO lock_info; + THR_LOCK_DATA *multi_locks[MAX_LOCK_COUNT]; + my_thread_init(); + + printf("Thread %s (%d) started\n",my_thread_name(),param); fflush(stdout); + + thr_lock_info_init(&lock_info); + thr_lock_owner_init(&owner, &lock_info); + for (i=0; i < lock_counts[param] ; i++) + thr_lock_data_init(locks+tests[param][i].lock_nr,data+i,NULL); + for (j=1 ; j < 10 ; j++) /* try locking 10 times */ + { + for (i=0; i < lock_counts[param] ; i++) + { /* Init multi locks */ + multi_locks[i]= &data[i]; + data[i].type= tests[param][i].lock_type; + } + thr_multi_lock(multi_locks, lock_counts[param], &owner); + pthread_mutex_lock(&LOCK_thread_count); + { + int tmp=rand() & 7; /* Do something from 0-2 sec */ + if (tmp == 0) + sleep(1); + else if (tmp == 1) + sleep(2); + else + { + ulong k; + for (k=0 ; k < (ulong) (tmp-2)*100000L ; k++) + sum+=k; + } + } + pthread_mutex_unlock(&LOCK_thread_count); + thr_multi_unlock(multi_locks,lock_counts[param]); + } + + printf("Thread %s (%d) ended\n",my_thread_name(),param); fflush(stdout); + thr_print_locks(); + pthread_mutex_lock(&LOCK_thread_count); + thread_count--; + pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */ + pthread_mutex_unlock(&LOCK_thread_count); + free((uchar*) arg); + return 0; +} + + +int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) +{ + pthread_t tid; + pthread_attr_t thr_attr; + int *param,error; + uint i; + MY_INIT(argv[0]); + if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '#') + DBUG_PUSH(argv[1]+2); + + printf("Main thread: %s\n",my_thread_name()); + + if ((error=pthread_cond_init(&COND_thread_count,NULL))) + { + fprintf(stderr,"Got error: %d from pthread_cond_init (errno: %d)", + error,errno); + exit(1); + } + if ((error=pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST))) + { + fprintf(stderr,"Got error: %d from pthread_cond_init (errno: %d)", + error,errno); + exit(1); + } + + for (i=0 ; i < array_elements(locks) ; i++) + { + thr_lock_init(locks+i); + locks[i].check_status= test_check_status; + locks[i].update_status=test_update_status; + locks[i].copy_status= test_copy_status; + locks[i].get_status= test_get_status; + locks[i].allow_multiple_concurrent_insert= 1; + } + if ((error=pthread_attr_init(&thr_attr))) + { + fprintf(stderr,"Got error: %d from pthread_attr_init (errno: %d)", + error,errno); + exit(1); + } + if ((error=pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED))) + { + fprintf(stderr, + "Got error: %d from pthread_attr_setdetachstate (errno: %d)", + error,errno); + exit(1); + } +#ifndef pthread_attr_setstacksize /* void return value */ + if ((error=pthread_attr_setstacksize(&thr_attr,65536L))) + { + fprintf(stderr,"Got error: %d from pthread_attr_setstacksize (errno: %d)", + error,errno); + exit(1); + } +#endif +#ifdef HAVE_THR_SETCONCURRENCY + (void) thr_setconcurrency(2); +#endif + for (i=0 ; i < array_elements(lock_counts) ; i++) + { + param=(int*) malloc(sizeof(int)); + *param=i; + + if ((error=pthread_mutex_lock(&LOCK_thread_count))) + { + fprintf(stderr,"Got error: %d from pthread_mutex_lock (errno: %d)", + error,errno); + exit(1); + } + if ((error=pthread_create(&tid,&thr_attr,test_thread,(void*) param))) + { + fprintf(stderr,"Got error: %d from pthread_create (errno: %d)\n", + error,errno); + pthread_mutex_unlock(&LOCK_thread_count); + exit(1); + } + thread_count++; + pthread_mutex_unlock(&LOCK_thread_count); + } + + pthread_attr_destroy(&thr_attr); + if ((error=pthread_mutex_lock(&LOCK_thread_count))) + fprintf(stderr,"Got error: %d from pthread_mutex_lock\n",error); + while (thread_count) + { + if ((error=pthread_cond_wait(&COND_thread_count,&LOCK_thread_count))) + fprintf(stderr,"Got error: %d from pthread_cond_wait\n",error); + } + if ((error=pthread_mutex_unlock(&LOCK_thread_count))) + fprintf(stderr,"Got error: %d from pthread_mutex_unlock\n",error); + for (i=0 ; i < array_elements(locks) ; i++) + thr_lock_delete(locks+i); +#ifdef EXTRA_DEBUG + if (found_errors) + printf("Got %d warnings\n",found_errors); + else +#endif + printf("Test succeeded\n"); + return 0; +} + +#else /* THREAD */ + +int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) +{ + printf("thr_lock disabled because we are not using threads\n"); + exit(1); +} + +#endif /* THREAD */ +#endif /* MAIN */ diff --git a/externals/mysql/mysys/thr_mutex.c b/externals/mysql/mysys/thr_mutex.c new file mode 100644 index 00000000000..9c7eb714326 --- /dev/null +++ b/externals/mysql/mysys/thr_mutex.c @@ -0,0 +1,875 @@ +/* Copyright (C) 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This makes a wrapper for mutex handling to make it easier to debug mutex */ + +#include +#if defined(TARGET_OS_LINUX) && !defined (__USE_UNIX98) +#define __USE_UNIX98 /* To get rw locks under Linux */ +#endif +#if defined(THREAD) && defined(SAFE_MUTEX) +#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */ +#include "mysys_priv.h" +#include "my_static.h" +#include +#include + +#ifndef DO_NOT_REMOVE_THREAD_WRAPPERS +/* Remove wrappers */ +#undef pthread_mutex_t +#undef pthread_mutex_init +#undef pthread_mutex_lock +#undef pthread_mutex_unlock +#undef pthread_mutex_destroy +#undef pthread_cond_wait +#undef pthread_cond_timedwait +#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT +#define pthread_mutex_init(a,b) my_pthread_noposix_mutex_init((a),(b)) +#endif +#endif /* DO_NOT_REMOVE_THREAD_WRAPPERS */ + +static pthread_mutex_t THR_LOCK_mutex; +static ulong safe_mutex_count= 0; /* Number of mutexes created */ +static ulong safe_mutex_id= 0; +my_bool safe_mutex_deadlock_detector= 1; /* On by default */ + +#ifdef SAFE_MUTEX_DETECT_DESTROY +static struct st_safe_mutex_create_info_t *safe_mutex_create_root= NULL; +#endif + +static my_bool add_used_to_locked_mutex(safe_mutex_t *used_mutex, + safe_mutex_deadlock_t *locked_mutex); +static my_bool add_to_locked_mutex(safe_mutex_deadlock_t *locked_mutex, + safe_mutex_t *current_mutex); +static my_bool remove_from_locked_mutex(safe_mutex_t *mp, + safe_mutex_t *delete_mutex); +static my_bool remove_from_used_mutex(safe_mutex_deadlock_t *locked_mutex, + safe_mutex_t *mutex); +static void print_deadlock_warning(safe_mutex_t *new_mutex, + safe_mutex_t *conflicting_mutex); + +void safe_mutex_global_init(void) +{ + pthread_mutex_init(&THR_LOCK_mutex,MY_MUTEX_INIT_FAST); + safe_mutex_id= safe_mutex_count= 0; + safe_mutex_deadlock_detector= 1; + +#ifdef SAFE_MUTEX_DETECT_DESTROY + safe_mutex_create_root= 0; +#endif +} + +static inline void remove_from_active_list(safe_mutex_t *mp) +{ + if (!(mp->active_flags & (MYF_NO_DEADLOCK_DETECTION | MYF_TRY_LOCK))) + { + /* Remove mutex from active mutex linked list */ + if (mp->next) + mp->next->prev= mp->prev; + if (mp->prev) + mp->prev->next= mp->next; + else + *my_thread_var_mutex_in_use()= mp->next; + } + mp->prev= mp->next= 0; +} + + +int safe_mutex_init(safe_mutex_t *mp, + const pthread_mutexattr_t *attr __attribute__((unused)), + const char *name, + myf my_flags, + const char *file, + uint line) +{ + DBUG_ENTER("safe_mutex_init"); + DBUG_PRINT("enter",("mutex: 0x%lx name: %s", (ulong) mp, name)); + bzero((char*) mp,sizeof(*mp)); + pthread_mutex_init(&mp->global,MY_MUTEX_INIT_ERRCHK); + pthread_mutex_init(&mp->mutex,attr); + /* Mark that mutex is initialized */ + mp->file= file; + mp->line= line; + /* Skip the very common '&' prefix from the autogenerated name */ + mp->name= name[0] == '&' ? name + 1 : name; + + if (safe_mutex_deadlock_detector && !( my_flags & MYF_NO_DEADLOCK_DETECTION)) + { + if (!my_multi_malloc(MY_FAE | MY_WME, + &mp->locked_mutex, sizeof(*mp->locked_mutex), + &mp->used_mutex, sizeof(*mp->used_mutex), NullS)) + { + /* Disable deadlock handling for this mutex */ + my_flags|= MYF_NO_DEADLOCK_DETECTION; + } + else + { + pthread_mutex_lock(&THR_LOCK_mutex); + mp->id= ++safe_mutex_id; + pthread_mutex_unlock(&THR_LOCK_mutex); + my_hash_init(mp->locked_mutex, &my_charset_bin, + 1000, + offsetof(safe_mutex_deadlock_t, id), + sizeof(mp->id), + 0, 0, HASH_UNIQUE); + my_hash_init(mp->used_mutex, &my_charset_bin, + 1000, + offsetof(safe_mutex_t, id), + sizeof(mp->id), + 0, 0, HASH_UNIQUE); + } + } + else + my_flags|= MYF_NO_DEADLOCK_DETECTION; + mp->create_flags= my_flags; + +#ifdef SAFE_MUTEX_DETECT_DESTROY + /* + Monitor the freeing of mutexes. This code depends on single thread init + and destroy + */ + if ((mp->info= (safe_mutex_info_t *) malloc(sizeof(safe_mutex_info_t)))) + { + struct st_safe_mutex_info_t *info= mp->info; + + info->init_file= file; + info->init_line= line; + info->prev= NULL; + info->next= NULL; + + pthread_mutex_lock(&THR_LOCK_mutex); + if ((info->next= safe_mutex_create_root)) + safe_mutex_create_root->prev= info; + safe_mutex_create_root= info; + safe_mutex_count++; + pthread_mutex_unlock(&THR_LOCK_mutex); + } +#else + thread_safe_increment(safe_mutex_count, &THR_LOCK_mutex); +#endif /* SAFE_MUTEX_DETECT_DESTROY */ + DBUG_RETURN(0); +} + + +int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file, + uint line) +{ + int error; + DBUG_PRINT("mutex", ("%s (0x%lx) locking", mp->name ? mp->name : "Null", + (ulong) mp)); + if (!mp->file) + { + fprintf(stderr, + "safe_mutex: Trying to lock unitialized mutex at %s, line %d\n", + file, line); + fflush(stderr); + abort(); + } + + pthread_mutex_lock(&mp->global); + if (mp->count > 0) + { + /* + Check that we are not trying to lock mutex twice. This is an error + even if we are using 'try_lock' as it's not portably what happens + if you lock the mutex many times and this is in any case bad + behaviour that should not be encouraged + */ + if (pthread_equal(pthread_self(),mp->thread)) + { + fprintf(stderr, + "safe_mutex: Trying to lock mutex at %s, line %d, when the" + " mutex was already locked at %s, line %d in thread %s\n", + file,line,mp->file, mp->line, my_thread_name()); + fflush(stderr); + abort(); + } + } + pthread_mutex_unlock(&mp->global); + + /* + If we are imitating trylock(), we need to take special + precautions. + + - We cannot use pthread_mutex_lock() only since another thread can + overtake this thread and take the lock before this thread + causing pthread_mutex_trylock() to hang. In this case, we should + just return EBUSY. Hence, we use pthread_mutex_trylock() to be + able to return immediately. + + - We cannot just use trylock() and continue execution below, since + this would generate an error and abort execution if the thread + was overtaken and trylock() returned EBUSY . In this case, we + instead just return EBUSY, since this is the expected behaviour + of trylock(). + */ + if (my_flags & MYF_TRY_LOCK) + { + error= pthread_mutex_trylock(&mp->mutex); + if (error == EBUSY) + return error; + } + else + error= pthread_mutex_lock(&mp->mutex); + + if (error || (error=pthread_mutex_lock(&mp->global))) + { + fprintf(stderr,"Got error %d when trying to lock mutex %s at %s, line %d\n", + error, mp->name, file, line); + fflush(stderr); + abort(); + } + mp->thread= pthread_self(); + if (mp->count++) + { + fprintf(stderr,"safe_mutex: Error in thread libray: Got mutex %s at %s, " + "line %d more than 1 time\n", mp->name, file,line); + fflush(stderr); + abort(); + } + mp->file= file; + mp->line= line; + mp->active_flags= mp->create_flags | my_flags; + pthread_mutex_unlock(&mp->global); + + /* Deadlock detection */ + + mp->prev= mp->next= 0; + if (!(mp->active_flags & (MYF_TRY_LOCK | MYF_NO_DEADLOCK_DETECTION))) + { + safe_mutex_t **mutex_in_use= my_thread_var_mutex_in_use(); + + if (!mutex_in_use) + { + /* thread has not called my_thread_init() */ + mp->active_flags|= MYF_NO_DEADLOCK_DETECTION; + } + else + { + safe_mutex_t *mutex_root; + if ((mutex_root= *mutex_in_use)) /* If not first locked */ + { + /* + Protect locked_mutex against changes if a mutex is deleted + */ + pthread_mutex_lock(&THR_LOCK_mutex); + + if (! my_hash_search(mutex_root->locked_mutex, (uchar*) &mp->id, 0)) + { + safe_mutex_deadlock_t *deadlock; + safe_mutex_t *mutex; + + /* Create object to store mutex info */ + if (!(deadlock= my_malloc(sizeof(*deadlock), + MYF(MY_ZEROFILL | MY_WME | MY_FAE)))) + goto abort_loop; + deadlock->name= mp->name; + deadlock->id= mp->id; + deadlock->mutex= mp; + /* The following is useful for debugging wrong mutex usage */ + deadlock->file= file; + deadlock->line= line; + + /* Check if potential deadlock */ + mutex= mutex_root; + do + { + if (my_hash_search(mp->locked_mutex, (uchar*) &mutex->id, 0)) + { + print_deadlock_warning(mp, mutex); + /* Mark wrong usage to avoid future warnings for same error */ + deadlock->warning_only= 1; + add_to_locked_mutex(deadlock, mutex_root); + DBUG_ASSERT(deadlock->count > 0); + goto abort_loop; + } + } + while ((mutex= mutex->next)); + + /* + Copy current mutex and all mutex that has been locked + after current mutex (mp->locked_mutex) to all mutex that + was locked before previous mutex (mutex_root->used_mutex) + + For example if A->B would have been done before and we + are now locking (C) in B->C, then we would add C into + B->locked_mutex and A->locked_mutex + */ + my_hash_iterate(mutex_root->used_mutex, + (my_hash_walk_action) add_used_to_locked_mutex, + deadlock); + + /* + Copy all current mutex and all mutex locked after current one + into the prev mutex + */ + add_used_to_locked_mutex(mutex_root, deadlock); + DBUG_ASSERT(deadlock->count > 0); + } + abort_loop: + pthread_mutex_unlock(&THR_LOCK_mutex); + } + /* Link mutex into mutex_in_use list */ + if ((mp->next= *mutex_in_use)) + (*mutex_in_use)->prev= mp; + *mutex_in_use= mp; + } + } + + DBUG_PRINT("mutex", ("%s (0x%lx) locked", mp->name, (ulong) mp)); + return error; +} + + +int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line) +{ + int error; + DBUG_PRINT("mutex", ("%s (0x%lx) unlocking", mp->name, (ulong) mp)); + pthread_mutex_lock(&mp->global); + if (mp->count == 0) + { + fprintf(stderr, + "safe_mutex: Trying to unlock mutex %s that wasn't locked at " + "%s, line %d\n" + "Last used at %s, line: %d\n", + mp->name ? mp->name : "Null", file, line, + mp->file ? mp->file : "Null", mp->line); + fflush(stderr); + abort(); + } + if (!pthread_equal(pthread_self(),mp->thread)) + { + fprintf(stderr, + "safe_mutex: Trying to unlock mutex %s at %s, line %d that was " + "locked by " + "another thread at: %s, line: %d\n", + mp->name, file, line, mp->file, mp->line); + fflush(stderr); + abort(); + } + mp->thread= 0; + mp->count--; + + remove_from_active_list(mp); + +#ifdef __WIN__ + pthread_mutex_unlock(&mp->mutex); + error=0; +#else + error=pthread_mutex_unlock(&mp->mutex); + if (error) + { + fprintf(stderr, + "safe_mutex: Got error: %d (%d) when trying to unlock mutex " + "%s at %s, line %d\n", error, errno, mp->name, file, line); + fflush(stderr); + abort(); + } +#endif /* __WIN__ */ + pthread_mutex_unlock(&mp->global); + return error; +} + + +int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp, const char *file, + uint line) +{ + int error; + safe_mutex_t save_state; + + pthread_mutex_lock(&mp->global); + if (mp->count == 0) + { + fprintf(stderr, + "safe_mutex: Trying to cond_wait on a unlocked mutex %s at %s, " + "line %d\n", + mp->name ? mp->name : "Null", file, line); + fflush(stderr); + abort(); + } + if (!pthread_equal(pthread_self(),mp->thread)) + { + fprintf(stderr, + "safe_mutex: Trying to cond_wait on a mutex %s at %s, line %d " + "that was locked by another thread at: %s, line: %d\n", + mp->name, file, line, mp->file, mp->line); + fflush(stderr); + abort(); + } + + if (mp->count-- != 1) + { + fprintf(stderr, + "safe_mutex: Count was %d on locked mutex %s at %s, line %d\n", + mp->count+1, mp->name, file, line); + fflush(stderr); + abort(); + } + save_state= *mp; + remove_from_active_list(mp); + pthread_mutex_unlock(&mp->global); + error=pthread_cond_wait(cond,&mp->mutex); + pthread_mutex_lock(&mp->global); + + if (error) + { + fprintf(stderr, + "safe_mutex: Got error: %d (%d) when doing a safe_mutex_wait on " + "%s at %s, line %d\n", error, errno, mp->name, file, line); + fflush(stderr); + abort(); + } + /* Restore state as it was before */ + mp->thread= save_state.thread; + mp->active_flags= save_state.active_flags; + mp->next= save_state.next; + mp->prev= save_state.prev; + + if (mp->count++) + { + fprintf(stderr, + "safe_mutex: Count was %d in thread 0x%lx when locking mutex %s " + "at %s, line %d\n", + mp->count-1, my_thread_dbug_id(), mp->name, file, line); + fflush(stderr); + abort(); + } + mp->file= file; + mp->line=line; + pthread_mutex_unlock(&mp->global); + return error; +} + + +int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, + struct timespec *abstime, + const char *file, uint line) +{ + int error; + safe_mutex_t save_state; + + pthread_mutex_lock(&mp->global); + if (mp->count != 1 || !pthread_equal(pthread_self(),mp->thread)) + { + fprintf(stderr, + "safe_mutex: Trying to cond_wait at %s, line %d on a not hold " + "mutex %s\n", + file, line, mp->name ? mp->name : "Null"); + fflush(stderr); + abort(); + } + mp->count--; /* Mutex will be released */ + save_state= *mp; + remove_from_active_list(mp); + pthread_mutex_unlock(&mp->global); + error=pthread_cond_timedwait(cond,&mp->mutex,abstime); +#ifdef EXTRA_DEBUG + if (error && (error != EINTR && error != ETIMEDOUT && error != ETIME)) + { + fprintf(stderr, + "safe_mutex: Got error: %d (%d) when doing a safe_mutex_timedwait " + "on %s at %s, line %d\n", + error, errno, mp->name, file, line); + } +#endif + pthread_mutex_lock(&mp->global); + /* Restore state as it was before */ + mp->thread= save_state.thread; + mp->active_flags= save_state.active_flags; + mp->next= save_state.next; + mp->prev= save_state.prev; + + if (mp->count++) + { + fprintf(stderr, + "safe_mutex: Count was %d in thread 0x%lx when locking mutex " + "%s at %s, line %d (error: %d (%d))\n", + mp->count-1, my_thread_dbug_id(), mp->name, file, line, + error, error); + fflush(stderr); + abort(); + } + mp->file= file; + mp->line=line; + pthread_mutex_unlock(&mp->global); + return error; +} + + +int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line) +{ + int error=0; + DBUG_ENTER("safe_mutex_destroy"); + DBUG_PRINT("enter", ("mutex: 0x%lx name: %s", (ulong) mp, mp->name)); + if (!mp->file) + { + fprintf(stderr, + "safe_mutex: Trying to destroy unitialized mutex at %s, line %d\n", + file, line); + fflush(stderr); + abort(); + } + if (mp->count != 0) + { + fprintf(stderr, + "safe_mutex: Trying to destroy a mutex %s that was locked at %s, " + "line %d at %s, line %d\n", + mp->name, mp->file, mp->line, file, line); + fflush(stderr); + abort(); + } + + /* Free all entries that points to this one */ + safe_mutex_free_deadlock_data(mp); + +#ifdef __WIN__ + pthread_mutex_destroy(&mp->global); + pthread_mutex_destroy(&mp->mutex); +#else + if (pthread_mutex_destroy(&mp->global)) + error=1; + if (pthread_mutex_destroy(&mp->mutex)) + error=1; +#endif + mp->file= 0; /* Mark destroyed */ + +#ifdef SAFE_MUTEX_DETECT_DESTROY + if (mp->info) + { + struct st_safe_mutex_info_t *info= mp->info; + pthread_mutex_lock(&THR_LOCK_mutex); + + if (info->prev) + info->prev->next = info->next; + else + safe_mutex_create_root = info->next; + if (info->next) + info->next->prev = info->prev; + safe_mutex_count--; + + pthread_mutex_unlock(&THR_LOCK_mutex); + free(info); + mp->info= NULL; /* Get crash if double free */ + } +#else + thread_safe_sub(safe_mutex_count, 1, &THR_LOCK_mutex); +#endif /* SAFE_MUTEX_DETECT_DESTROY */ + DBUG_RETURN(error); +} + + +/** + Free all data related to deadlock detection + + This is also useful together with safemalloc when you don't want to + have reports of not freed memory for mysys mutexes. +*/ + +void safe_mutex_free_deadlock_data(safe_mutex_t *mp) +{ + /* Free all entries that points to this one */ + if (!(mp->create_flags & MYF_NO_DEADLOCK_DETECTION)) + { + pthread_mutex_lock(&THR_LOCK_mutex); + my_hash_iterate(mp->used_mutex, + (my_hash_walk_action) remove_from_locked_mutex, + mp); + my_hash_iterate(mp->locked_mutex, + (my_hash_walk_action) remove_from_used_mutex, + mp); + pthread_mutex_unlock(&THR_LOCK_mutex); + + my_hash_free(mp->used_mutex); + my_hash_free(mp->locked_mutex); + my_free(mp->locked_mutex, 0); + mp->create_flags|= MYF_NO_DEADLOCK_DETECTION; + } +} + +/* + Free global resources and check that all mutex has been destroyed + + SYNOPSIS + safe_mutex_end() + file Print errors on this file + + NOTES + We can't use DBUG_PRINT() here as we have in my_end() disabled + DBUG handling before calling this function. + + In MySQL one may get one warning for a mutex created in my_thr_init.c + This is ok, as this thread may not yet have been exited. +*/ + +void safe_mutex_end(FILE *file __attribute__((unused))) +{ + if (!safe_mutex_count) /* safetly */ + pthread_mutex_destroy(&THR_LOCK_mutex); +#ifdef SAFE_MUTEX_DETECT_DESTROY + if (!file) + return; + + if (safe_mutex_count) + { + fprintf(file, "Warning: Not destroyed mutex: %lu\n", safe_mutex_count); + (void) fflush(file); + } + { + struct st_safe_mutex_info_t *ptr; + for (ptr= safe_mutex_create_root ; ptr ; ptr= ptr->next) + { + fprintf(file, "\tMutex %s initiated at line %4u in '%s'\n", + ptr->name, ptr->init_line, ptr->init_file); + (void) fflush(file); + } + } +#endif /* SAFE_MUTEX_DETECT_DESTROY */ +} + + +static my_bool add_used_to_locked_mutex(safe_mutex_t *used_mutex, + safe_mutex_deadlock_t *locked_mutex) +{ + /* Add mutex to all parent of the current mutex */ + if (!locked_mutex->warning_only) + { + (void) my_hash_iterate(locked_mutex->mutex->locked_mutex, + (my_hash_walk_action) add_to_locked_mutex, + used_mutex); + /* mark that locked_mutex is locked after used_mutex */ + (void) add_to_locked_mutex(locked_mutex, used_mutex); + } + return 0; +} + + +/** + register that locked_mutex was locked after current_mutex +*/ + +static my_bool add_to_locked_mutex(safe_mutex_deadlock_t *locked_mutex, + safe_mutex_t *current_mutex) +{ + DBUG_ENTER("add_to_locked_mutex"); + DBUG_PRINT("info", ("inserting 0x%lx into 0x%lx (id: %lu -> %lu)", + (ulong) locked_mutex, (long) current_mutex, + locked_mutex->id, current_mutex->id)); + if (my_hash_insert(current_mutex->locked_mutex, (uchar*) locked_mutex)) + { + /* Got mutex through two paths; ignore */ + DBUG_RETURN(0); + } + locked_mutex->count++; + if (my_hash_insert(locked_mutex->mutex->used_mutex, + (uchar*) current_mutex)) + { + DBUG_ASSERT(0); + } + DBUG_RETURN(0); +} + + +/** + Remove mutex from the locked mutex hash + @fn remove_from_used_mutex() + @param mp Mutex that has delete_mutex in it's locked_mutex hash + @param delete_mutex Mutex should be removed from the hash + + @notes + safe_mutex_deadlock_t entries in the locked hash are shared. + When counter goes to 0, we delete the safe_mutex_deadlock_t entry. +*/ + +static my_bool remove_from_locked_mutex(safe_mutex_t *mp, + safe_mutex_t *delete_mutex) +{ + safe_mutex_deadlock_t *found; + DBUG_ENTER("remove_from_locked_mutex"); + DBUG_PRINT("enter", ("delete_mutex: 0x%lx mutex: 0x%lx (id: %lu <- %lu)", + (ulong) delete_mutex, (ulong) mp, + delete_mutex->id, mp->id)); + + found= (safe_mutex_deadlock_t*) my_hash_search(mp->locked_mutex, + (uchar*) &delete_mutex->id, 0); + DBUG_ASSERT(found); + if (found) + { + if (my_hash_delete(mp->locked_mutex, (uchar*) found)) + { + DBUG_ASSERT(0); + } + if (!--found->count) + my_free(found, MYF(0)); + } + DBUG_RETURN(0); +} + +static my_bool remove_from_used_mutex(safe_mutex_deadlock_t *locked_mutex, + safe_mutex_t *mutex) +{ + DBUG_ENTER("remove_from_used_mutex"); + DBUG_PRINT("enter", ("delete_mutex: 0x%lx mutex: 0x%lx (id: %lu <- %lu)", + (ulong) mutex, (ulong) locked_mutex, + mutex->id, locked_mutex->id)); + if (my_hash_delete(locked_mutex->mutex->used_mutex, (uchar*) mutex)) + { + DBUG_ASSERT(0); + } + if (!--locked_mutex->count) + my_free(locked_mutex, MYF(0)); + DBUG_RETURN(0); +} + + +static void print_deadlock_warning(safe_mutex_t *new_mutex, + safe_mutex_t *parent_mutex) +{ + safe_mutex_t *mutex_root; + DBUG_ENTER("print_deadlock_warning"); + DBUG_PRINT("enter", ("mutex: %s parent: %s", + new_mutex->name, parent_mutex->name)); + + fprintf(stderr, "safe_mutex: Found wrong usage of mutex " + "'%s' and '%s'\n", + parent_mutex->name, new_mutex->name); + DBUG_PRINT("info", ("safe_mutex: Found wrong usage of mutex " + "'%s' and '%s'", + parent_mutex->name, new_mutex->name)); + fprintf(stderr, "Mutex currently locked (in reverse order):\n"); + DBUG_PRINT("info", ("Mutex currently locked (in reverse order):")); + fprintf(stderr, "%-32.32s %s line %u\n", new_mutex->name, new_mutex->file, + new_mutex->line); + DBUG_PRINT("info", ("%-32.32s %s line %u\n", new_mutex->name, + new_mutex->file, new_mutex->line)); + for (mutex_root= *my_thread_var_mutex_in_use() ; + mutex_root; + mutex_root= mutex_root->next) + { + fprintf(stderr, "%-32.32s %s line %u\n", mutex_root->name, + mutex_root->file, mutex_root->line); + DBUG_PRINT("info", ("%-32.32s %s line %u", mutex_root->name, + mutex_root->file, mutex_root->line)); + } + fflush(stderr); + DBUG_VOID_RETURN; +} + + +#endif /* THREAD && SAFE_MUTEX */ + +#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) + +#include "mysys_priv.h" +#include "my_static.h" +#include + +#include +#include +#include +#include +#include + +#undef pthread_mutex_t +#undef pthread_mutex_init +#undef pthread_mutex_lock +#undef pthread_mutex_trylock +#undef pthread_mutex_unlock +#undef pthread_mutex_destroy +#undef pthread_cond_wait +#undef pthread_cond_timedwait + +ulong mutex_delay(ulong delayloops) +{ + ulong i; + volatile ulong j; + + j = 0; + + for (i = 0; i < delayloops * 50; i++) + j += i; + + return(j); +} + +#define MY_PTHREAD_FASTMUTEX_SPINS 8 +#define MY_PTHREAD_FASTMUTEX_DELAY 4 + +static int cpu_count= 0; + +int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp, + const pthread_mutexattr_t *attr) +{ + if ((cpu_count > 1) && (attr == MY_MUTEX_INIT_FAST)) + mp->spins= MY_PTHREAD_FASTMUTEX_SPINS; + else + mp->spins= 0; + mp->rng_state= 1; + return pthread_mutex_init(&mp->mutex, attr); +} + +/** + Park-Miller random number generator. A simple linear congruential + generator that operates in multiplicative group of integers modulo n. + + x_{k+1} = (x_k g) mod n + + Popular pair of parameters: n = 2^32 ⒠5 = 4294967291 and g = 279470273. + The period of the generator is about 2^31. + Largest value that can be returned: 2147483646 (RAND_MAX) + + Reference: + + S. K. Park and K. W. Miller + "Random number generators: good ones are hard to find" + Commun. ACM, October 1988, Volume 31, No 10, pages 1192-1201. +*/ + +static double park_rng(my_pthread_fastmutex_t *mp) +{ + mp->rng_state= ((my_ulonglong)mp->rng_state * 279470273U) % 4294967291U; + return (mp->rng_state / 2147483647.0); +} + +int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp) +{ + int res; + uint i; + uint maxdelay= MY_PTHREAD_FASTMUTEX_DELAY; + + for (i= 0; i < mp->spins; i++) + { + res= pthread_mutex_trylock(&mp->mutex); + + if (res == 0) + return 0; + + if (res != EBUSY) + return res; + + mutex_delay(maxdelay); + maxdelay += park_rng(mp) * MY_PTHREAD_FASTMUTEX_DELAY + 1; + } + return pthread_mutex_lock(&mp->mutex); +} + + +void fastmutex_global_init(void) +{ +#ifdef _SC_NPROCESSORS_CONF + cpu_count= sysconf(_SC_NPROCESSORS_CONF); +#endif +} + +#endif /* defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */ diff --git a/externals/mysql/mysys/thr_rwlock.c b/externals/mysql/mysys/thr_rwlock.c new file mode 100644 index 00000000000..280a0ec19e7 --- /dev/null +++ b/externals/mysql/mysys/thr_rwlock.c @@ -0,0 +1,171 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Synchronization - readers / writer thread locks */ + +#include "mysys_priv.h" +#if defined(THREAD) && !defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && !defined(HAVE_RWLOCK_INIT) +#include + +/* + Source base from Sun Microsystems SPILT, simplified for MySQL use + -- Joshua Chamas + Some cleanup and additional code by Monty +*/ + +/* +* Multithreaded Demo Source +* +* Copyright (C) 1995 by Sun Microsystems, Inc. +* All rights reserved. +* +* This file is a product of SunSoft, Inc. and is provided for +* unrestricted use provided that this legend is included on all +* media and as a part of the software program in whole or part. +* Users may copy, modify or distribute this file at will. +* +* THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING +* THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR +* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +* +* This file is provided with no support and without any obligation on the +* part of SunSoft, Inc. to assist in its use, correction, modification or +* enhancement. +* +* SUNSOFT AND SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT +* TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS +* FILE OR ANY PART THEREOF. +* +* IN NO EVENT WILL SUNSOFT OR SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY +* LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL +* DAMAGES, EVEN IF THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH +* DAMAGES. +* +* SunSoft, Inc. +* 2550 Garcia Avenue +* Mountain View, California 94043 +*/ + +int my_rwlock_init(rw_lock_t *rwp, void *arg __attribute__((unused))) +{ + pthread_condattr_t cond_attr; + + pthread_mutex_init( &rwp->lock, MY_MUTEX_INIT_FAST); + pthread_condattr_init( &cond_attr ); + pthread_cond_init( &rwp->readers, &cond_attr ); + pthread_cond_init( &rwp->writers, &cond_attr ); + pthread_condattr_destroy(&cond_attr); + + rwp->state = 0; + rwp->waiters = 0; + + return(0); +} + + +int my_rwlock_destroy(rw_lock_t *rwp) +{ + pthread_mutex_destroy( &rwp->lock ); + pthread_cond_destroy( &rwp->readers ); + pthread_cond_destroy( &rwp->writers ); + return(0); +} + + +int my_rw_rdlock(rw_lock_t *rwp) +{ + pthread_mutex_lock(&rwp->lock); + + /* active or queued writers */ + while ((rwp->state < 0 ) || rwp->waiters) + pthread_cond_wait( &rwp->readers, &rwp->lock); + + rwp->state++; + pthread_mutex_unlock(&rwp->lock); + return(0); +} + +int my_rw_tryrdlock(rw_lock_t *rwp) +{ + int res; + pthread_mutex_lock(&rwp->lock); + if ((rwp->state < 0 ) || rwp->waiters) + res= EBUSY; /* Can't get lock */ + else + { + res=0; + rwp->state++; + } + pthread_mutex_unlock(&rwp->lock); + return(res); +} + + +int my_rw_wrlock(rw_lock_t *rwp) +{ + pthread_mutex_lock(&rwp->lock); + rwp->waiters++; /* another writer queued */ + + while (rwp->state) + pthread_cond_wait(&rwp->writers, &rwp->lock); + rwp->state = -1; + rwp->waiters--; + pthread_mutex_unlock(&rwp->lock); + return(0); +} + + +int my_rw_trywrlock(rw_lock_t *rwp) +{ + int res; + pthread_mutex_lock(&rwp->lock); + if (rwp->state) + res= EBUSY; /* Can't get lock */ + else + { + res=0; + rwp->state = -1; + } + pthread_mutex_unlock(&rwp->lock); + return(res); +} + + +int my_rw_unlock(rw_lock_t *rwp) +{ + DBUG_PRINT("rw_unlock", + ("state: %d waiters: %d", rwp->state, rwp->waiters)); + pthread_mutex_lock(&rwp->lock); + + if (rwp->state == -1) /* writer releasing */ + { + rwp->state= 0; /* mark as available */ + + if ( rwp->waiters ) /* writers queued */ + pthread_cond_signal( &rwp->writers ); + else + pthread_cond_broadcast( &rwp->readers ); + } + else + { + if ( --rwp->state == 0 ) /* no more readers */ + pthread_cond_signal( &rwp->writers ); + } + + pthread_mutex_unlock( &rwp->lock ); + return(0); +} + +#endif diff --git a/externals/mysql/mysys/tree.c b/externals/mysql/mysys/tree.c new file mode 100644 index 00000000000..e721cc0cc5e --- /dev/null +++ b/externals/mysql/mysys/tree.c @@ -0,0 +1,757 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Code for handling red-black (balanced) binary trees. + key in tree is allocated accrding to following: + + 1) If size < 0 then tree will not allocate keys and only a pointer to + each key is saved in tree. + compare and search functions uses and returns key-pointer + + 2) If size == 0 then there are two options: + - key_size != 0 to tree_insert: The key will be stored in the tree. + - key_size == 0 to tree_insert: A pointer to the key is stored. + compare and search functions uses and returns key-pointer. + + 3) if key_size is given to init_tree then each node will continue the + key and calls to insert_key may increase length of key. + if key_size > sizeof(pointer) and key_size is a multiple of 8 (double + allign) then key will be put on a 8 alligned adress. Else + the key will be on adress (element+1). This is transparent for user + compare and search functions uses a pointer to given key-argument. + + - If you use a free function for tree-elements and you are freeing + the element itself, you should use key_size = 0 to init_tree and + tree_search + + The actual key in TREE_ELEMENT is saved as a pointer or after the + TREE_ELEMENT struct. + If one uses only pointers in tree one can use tree_set_pointer() to + change address of data. + + Implemented by monty. +*/ + +/* + NOTE: + tree->compare function should be ALWAYS called as + (*tree->compare)(custom_arg, ELEMENT_KEY(tree,element), key) + and not other way around, as + (*tree->compare)(custom_arg, key, ELEMENT_KEY(tree,element)) + + ft_boolean_search.c (at least) relies on that. +*/ + +#include "mysys_priv.h" +#include +#include +#include "my_base.h" + +#define BLACK 1 +#define RED 0 +#define DEFAULT_ALLOC_SIZE 8192 +#define DEFAULT_ALIGN_SIZE 8192 + +static void delete_tree_element(TREE *,TREE_ELEMENT *); +static int tree_walk_left_root_right(TREE *,TREE_ELEMENT *, + tree_walk_action,void *); +static int tree_walk_right_root_left(TREE *,TREE_ELEMENT *, + tree_walk_action,void *); +static void left_rotate(TREE_ELEMENT **parent,TREE_ELEMENT *leaf); +static void right_rotate(TREE_ELEMENT **parent, TREE_ELEMENT *leaf); +static void rb_insert(TREE *tree,TREE_ELEMENT ***parent, + TREE_ELEMENT *leaf); +static void rb_delete_fixup(TREE *tree,TREE_ELEMENT ***parent); + + + /* The actuall code for handling binary trees */ + +#ifndef DBUG_OFF +static int test_rb_tree(TREE_ELEMENT *element); +#endif + +void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit, + int size, qsort_cmp2 compare, my_bool with_delete, + tree_element_free free_element, void *custom_arg) +{ + DBUG_ENTER("init_tree"); + DBUG_PRINT("enter",("tree: %p size: %d", tree, size)); + + if (default_alloc_size < DEFAULT_ALLOC_SIZE) + default_alloc_size= DEFAULT_ALLOC_SIZE; + default_alloc_size= MY_ALIGN(default_alloc_size, DEFAULT_ALIGN_SIZE); + bzero((uchar*) &tree->null_element,sizeof(tree->null_element)); + tree->root= &tree->null_element; + tree->compare=compare; + tree->size_of_element=size > 0 ? (uint) size : 0; + tree->memory_limit=memory_limit; + tree->free=free_element; + tree->allocated=0; + tree->elements_in_tree=0; + tree->custom_arg = custom_arg; + tree->null_element.colour=BLACK; + tree->null_element.left=tree->null_element.right=0; + tree->flag= 0; + if (!free_element && size >= 0 && + ((uint) size <= sizeof(void*) || ((uint) size & (sizeof(void*)-1)))) + { + /* + We know that the data doesn't have to be aligned (like if the key + contains a double), so we can store the data combined with the + TREE_ELEMENT. + */ + tree->offset_to_key=sizeof(TREE_ELEMENT); /* Put key after element */ + /* Fix allocation size so that we don't lose any memory */ + default_alloc_size/=(sizeof(TREE_ELEMENT)+size); + if (!default_alloc_size) + default_alloc_size=1; + default_alloc_size*=(sizeof(TREE_ELEMENT)+size); + } + else + { + tree->offset_to_key=0; /* use key through pointer */ + tree->size_of_element+=sizeof(void*); + } + if (!(tree->with_delete=with_delete)) + { + init_alloc_root(&tree->mem_root, (uint) default_alloc_size, 0); + tree->mem_root.min_malloc=(sizeof(TREE_ELEMENT)+tree->size_of_element); + } + DBUG_VOID_RETURN; +} + +static void free_tree(TREE *tree, myf free_flags) +{ + DBUG_ENTER("free_tree"); + DBUG_PRINT("enter",("tree: %p", tree)); + + if (tree->root) /* If initialized */ + { + if (tree->with_delete) + delete_tree_element(tree,tree->root); + else + { + if (tree->free) + { + if (tree->memory_limit) + (*tree->free)(NULL, free_init, tree->custom_arg); + delete_tree_element(tree,tree->root); + if (tree->memory_limit) + (*tree->free)(NULL, free_end, tree->custom_arg); + } + free_root(&tree->mem_root, free_flags); + } + } + tree->root= &tree->null_element; + tree->elements_in_tree=0; + tree->allocated=0; + + DBUG_VOID_RETURN; +} + +void delete_tree(TREE* tree) +{ + free_tree(tree, MYF(0)); /* my_free() mem_root if applicable */ +} + +void reset_tree(TREE* tree) +{ + /* do not free mem_root, just mark blocks as free */ + free_tree(tree, MYF(MY_MARK_BLOCKS_FREE)); +} + + +static void delete_tree_element(TREE *tree, TREE_ELEMENT *element) +{ + if (element != &tree->null_element) + { + delete_tree_element(tree,element->left); + if (tree->free) + (*tree->free)(ELEMENT_KEY(tree,element), free_free, tree->custom_arg); + delete_tree_element(tree,element->right); + if (tree->with_delete) + my_free((char*) element,MYF(0)); + } +} + + +/* + insert, search and delete of elements + + The following should be true: + parent[0] = & parent[-1][0]->left || + parent[0] = & parent[-1][0]->right +*/ + +TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size, + void* custom_arg) +{ + int cmp; + TREE_ELEMENT *element,***parent; + + parent= tree->parents; + *parent = &tree->root; element= tree->root; + for (;;) + { + if (element == &tree->null_element || + (cmp = (*tree->compare)(custom_arg, ELEMENT_KEY(tree,element), + key)) == 0) + break; + if (cmp < 0) + { + *++parent= &element->right; element= element->right; + } + else + { + *++parent = &element->left; element= element->left; + } + } + if (element == &tree->null_element) + { + uint alloc_size=sizeof(TREE_ELEMENT)+key_size+tree->size_of_element; + tree->allocated+=alloc_size; + + if (tree->memory_limit && tree->elements_in_tree + && tree->allocated > tree->memory_limit) + { + reset_tree(tree); + return tree_insert(tree, key, key_size, custom_arg); + } + + key_size+=tree->size_of_element; + if (tree->with_delete) + element=(TREE_ELEMENT *) my_malloc(alloc_size, MYF(MY_WME)); + else + element=(TREE_ELEMENT *) alloc_root(&tree->mem_root,alloc_size); + if (!element) + return(NULL); + **parent=element; + element->left=element->right= &tree->null_element; + if (!tree->offset_to_key) + { + if (key_size == sizeof(void*)) /* no length, save pointer */ + *((void**) (element+1))=key; + else + { + *((void**) (element+1))= (void*) ((void **) (element+1)+1); + memcpy((uchar*) *((void **) (element+1)),key, + (size_t) (key_size-sizeof(void*))); + } + } + else + memcpy((uchar*) element+tree->offset_to_key,key,(size_t) key_size); + element->count=1; /* May give warning in purify */ + tree->elements_in_tree++; + rb_insert(tree,parent,element); /* rebalance tree */ + } + else + { + if (tree->flag & TREE_NO_DUPS) + return(NULL); + element->count++; + /* Avoid a wrap over of the count. */ + if (! element->count) + element->count--; + } + DBUG_EXECUTE("check_tree", test_rb_tree(tree->root);); + return element; +} + +int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg) +{ + int cmp,remove_colour; + TREE_ELEMENT *element,***parent, ***org_parent, *nod; + if (!tree->with_delete) + return 1; /* not allowed */ + + parent= tree->parents; + *parent= &tree->root; element= tree->root; + for (;;) + { + if (element == &tree->null_element) + return 1; /* Was not in tree */ + if ((cmp = (*tree->compare)(custom_arg, ELEMENT_KEY(tree,element), + key)) == 0) + break; + if (cmp < 0) + { + *++parent= &element->right; element= element->right; + } + else + { + *++parent = &element->left; element= element->left; + } + } + if (element->left == &tree->null_element) + { + (**parent)=element->right; + remove_colour= element->colour; + } + else if (element->right == &tree->null_element) + { + (**parent)=element->left; + remove_colour= element->colour; + } + else + { + org_parent= parent; + *++parent= &element->right; nod= element->right; + while (nod->left != &tree->null_element) + { + *++parent= &nod->left; nod= nod->left; + } + (**parent)=nod->right; /* unlink nod from tree */ + remove_colour= nod->colour; + org_parent[0][0]=nod; /* put y in place of element */ + org_parent[1]= &nod->right; + nod->left=element->left; + nod->right=element->right; + nod->colour=element->colour; + } + if (remove_colour == BLACK) + rb_delete_fixup(tree,parent); + if (tree->free) + (*tree->free)(ELEMENT_KEY(tree,element), free_free, tree->custom_arg); + tree->allocated-= sizeof(TREE_ELEMENT) + tree->size_of_element + key_size; + my_free((uchar*) element,MYF(0)); + tree->elements_in_tree--; + return 0; +} + + +void *tree_search(TREE *tree, void *key, void *custom_arg) +{ + int cmp; + TREE_ELEMENT *element=tree->root; + + for (;;) + { + if (element == &tree->null_element) + return (void*) 0; + if ((cmp = (*tree->compare)(custom_arg, ELEMENT_KEY(tree,element), + key)) == 0) + return ELEMENT_KEY(tree,element); + if (cmp < 0) + element=element->right; + else + element=element->left; + } +} + +void *tree_search_key(TREE *tree, const void *key, + TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos, + enum ha_rkey_function flag, void *custom_arg) +{ + int cmp; + TREE_ELEMENT *element= tree->root; + TREE_ELEMENT **last_left_step_parent= NULL, **last_right_step_parent= NULL; + TREE_ELEMENT **last_equal_element= NULL; + +/* + TODO: support for HA_READ_KEY_OR_PREV, HA_READ_PREFIX flags if needed. +*/ + + *parents = &tree->null_element; + while (element != &tree->null_element) + { + *++parents= element; + if ((cmp= (*tree->compare)(custom_arg, ELEMENT_KEY(tree, element), + key)) == 0) + { + switch (flag) { + case HA_READ_KEY_EXACT: + case HA_READ_KEY_OR_NEXT: + case HA_READ_BEFORE_KEY: + last_equal_element= parents; + cmp= 1; + break; + case HA_READ_AFTER_KEY: + cmp= -1; + break; + case HA_READ_PREFIX_LAST: + case HA_READ_PREFIX_LAST_OR_PREV: + last_equal_element= parents; + cmp= -1; + break; + default: + return NULL; + } + } + if (cmp < 0) /* element < key */ + { + last_right_step_parent= parents; + element= element->right; + } + else + { + last_left_step_parent= parents; + element= element->left; + } + } + switch (flag) { + case HA_READ_KEY_EXACT: + case HA_READ_PREFIX_LAST: + *last_pos= last_equal_element; + break; + case HA_READ_KEY_OR_NEXT: + *last_pos= last_equal_element ? last_equal_element : last_left_step_parent; + break; + case HA_READ_AFTER_KEY: + *last_pos= last_left_step_parent; + break; + case HA_READ_PREFIX_LAST_OR_PREV: + *last_pos= last_equal_element ? last_equal_element : last_right_step_parent; + break; + case HA_READ_BEFORE_KEY: + *last_pos= last_right_step_parent; + break; + default: + return NULL; + } + return *last_pos ? ELEMENT_KEY(tree, **last_pos) : NULL; +} + +/* + Search first (the most left) or last (the most right) tree element +*/ +void *tree_search_edge(TREE *tree, TREE_ELEMENT **parents, + TREE_ELEMENT ***last_pos, int child_offs) +{ + TREE_ELEMENT *element= tree->root; + + *parents= &tree->null_element; + while (element != &tree->null_element) + { + *++parents= element; + element= ELEMENT_CHILD(element, child_offs); + } + *last_pos= parents; + return **last_pos != &tree->null_element ? + ELEMENT_KEY(tree, **last_pos) : NULL; +} + +void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs, + int r_offs) +{ + TREE_ELEMENT *x= **last_pos; + + if (ELEMENT_CHILD(x, r_offs) != &tree->null_element) + { + x= ELEMENT_CHILD(x, r_offs); + *++*last_pos= x; + while (ELEMENT_CHILD(x, l_offs) != &tree->null_element) + { + x= ELEMENT_CHILD(x, l_offs); + *++*last_pos= x; + } + return ELEMENT_KEY(tree, x); + } + else + { + TREE_ELEMENT *y= *--*last_pos; + while (y != &tree->null_element && x == ELEMENT_CHILD(y, r_offs)) + { + x= y; + y= *--*last_pos; + } + return y == &tree->null_element ? NULL : ELEMENT_KEY(tree, y); + } +} + +/* + Expected that tree is fully balanced + (each path from root to leaf has the same length) +*/ +ha_rows tree_record_pos(TREE *tree, const void *key, + enum ha_rkey_function flag, void *custom_arg) +{ + int cmp; + TREE_ELEMENT *element= tree->root; + double left= 1; + double right= tree->elements_in_tree; + + while (element != &tree->null_element) + { + if ((cmp= (*tree->compare)(custom_arg, ELEMENT_KEY(tree, element), + key)) == 0) + { + switch (flag) { + case HA_READ_KEY_EXACT: + case HA_READ_BEFORE_KEY: + cmp= 1; + break; + case HA_READ_AFTER_KEY: + cmp= -1; + break; + default: + return HA_POS_ERROR; + } + } + if (cmp < 0) /* element < key */ + { + element= element->right; + left= (left + right) / 2; + } + else + { + element= element->left; + right= (left + right) / 2; + } + } + switch (flag) { + case HA_READ_KEY_EXACT: + case HA_READ_BEFORE_KEY: + return (ha_rows) right; + case HA_READ_AFTER_KEY: + return (ha_rows) left; + default: + return HA_POS_ERROR; + } +} + +int tree_walk(TREE *tree, tree_walk_action action, void *argument, TREE_WALK visit) +{ + switch (visit) { + case left_root_right: + return tree_walk_left_root_right(tree,tree->root,action,argument); + case right_root_left: + return tree_walk_right_root_left(tree,tree->root,action,argument); + } + return 0; /* Keep gcc happy */ +} + +static int tree_walk_left_root_right(TREE *tree, TREE_ELEMENT *element, tree_walk_action action, void *argument) +{ + int error; + if (element->left) /* Not null_element */ + { + if ((error=tree_walk_left_root_right(tree,element->left,action, + argument)) == 0 && + (error=(*action)(ELEMENT_KEY(tree,element), + (element_count) element->count, + argument)) == 0) + error=tree_walk_left_root_right(tree,element->right,action,argument); + return error; + } + return 0; +} + +static int tree_walk_right_root_left(TREE *tree, TREE_ELEMENT *element, tree_walk_action action, void *argument) +{ + int error; + if (element->right) /* Not null_element */ + { + if ((error=tree_walk_right_root_left(tree,element->right,action, + argument)) == 0 && + (error=(*action)(ELEMENT_KEY(tree,element), + (element_count) element->count, + argument)) == 0) + error=tree_walk_right_root_left(tree,element->left,action,argument); + return error; + } + return 0; +} + + + /* Functions to fix up the tree after insert and delete */ + +static void left_rotate(TREE_ELEMENT **parent, TREE_ELEMENT *leaf) +{ + TREE_ELEMENT *y; + + y=leaf->right; + leaf->right=y->left; + parent[0]=y; + y->left=leaf; +} + +static void right_rotate(TREE_ELEMENT **parent, TREE_ELEMENT *leaf) +{ + TREE_ELEMENT *x; + + x=leaf->left; + leaf->left=x->right; + parent[0]=x; + x->right=leaf; +} + +static void rb_insert(TREE *tree, TREE_ELEMENT ***parent, TREE_ELEMENT *leaf) +{ + TREE_ELEMENT *y,*par,*par2; + + leaf->colour=RED; + while (leaf != tree->root && (par=parent[-1][0])->colour == RED) + { + if (par == (par2=parent[-2][0])->left) + { + y= par2->right; + if (y->colour == RED) + { + par->colour=BLACK; + y->colour=BLACK; + leaf=par2; + parent-=2; + leaf->colour=RED; /* And the loop continues */ + } + else + { + if (leaf == par->right) + { + left_rotate(parent[-1],par); + par=leaf; /* leaf is now parent to old leaf */ + } + par->colour=BLACK; + par2->colour=RED; + right_rotate(parent[-2],par2); + break; + } + } + else + { + y= par2->left; + if (y->colour == RED) + { + par->colour=BLACK; + y->colour=BLACK; + leaf=par2; + parent-=2; + leaf->colour=RED; /* And the loop continues */ + } + else + { + if (leaf == par->left) + { + right_rotate(parent[-1],par); + par=leaf; + } + par->colour=BLACK; + par2->colour=RED; + left_rotate(parent[-2],par2); + break; + } + } + } + tree->root->colour=BLACK; +} + +static void rb_delete_fixup(TREE *tree, TREE_ELEMENT ***parent) +{ + TREE_ELEMENT *x,*w,*par; + + x= **parent; + while (x != tree->root && x->colour == BLACK) + { + if (x == (par=parent[-1][0])->left) + { + w=par->right; + if (w->colour == RED) + { + w->colour=BLACK; + par->colour=RED; + left_rotate(parent[-1],par); + parent[0]= &w->left; + *++parent= &par->left; + w=par->right; + } + if (w->left->colour == BLACK && w->right->colour == BLACK) + { + w->colour=RED; + x=par; + parent--; + } + else + { + if (w->right->colour == BLACK) + { + w->left->colour=BLACK; + w->colour=RED; + right_rotate(&par->right,w); + w=par->right; + } + w->colour=par->colour; + par->colour=BLACK; + w->right->colour=BLACK; + left_rotate(parent[-1],par); + x=tree->root; + break; + } + } + else + { + w=par->left; + if (w->colour == RED) + { + w->colour=BLACK; + par->colour=RED; + right_rotate(parent[-1],par); + parent[0]= &w->right; + *++parent= &par->right; + w=par->left; + } + if (w->right->colour == BLACK && w->left->colour == BLACK) + { + w->colour=RED; + x=par; + parent--; + } + else + { + if (w->left->colour == BLACK) + { + w->right->colour=BLACK; + w->colour=RED; + left_rotate(&par->left,w); + w=par->left; + } + w->colour=par->colour; + par->colour=BLACK; + w->left->colour=BLACK; + right_rotate(parent[-1],par); + x=tree->root; + break; + } + } + } + x->colour=BLACK; +} + +#ifndef DBUG_OFF + + /* Test that the proporties for a red-black tree holds */ + +static int test_rb_tree(TREE_ELEMENT *element) +{ + int count_l,count_r; + + if (!element->left) + return 0; /* Found end of tree */ + if (element->colour == RED && + (element->left->colour == RED || element->right->colour == RED)) + { + printf("Wrong tree: Found two red in a row\n"); + return -1; + } + count_l=test_rb_tree(element->left); + count_r=test_rb_tree(element->right); + if (count_l >= 0 && count_r >= 0) + { + if (count_l == count_r) + return count_l+(element->colour == BLACK); + printf("Wrong tree: Incorrect black-count: %d - %d\n",count_l,count_r); + } + return -1; +} +#endif diff --git a/externals/mysql/mysys/trie.c b/externals/mysql/mysys/trie.c new file mode 100644 index 00000000000..5738b9b866b --- /dev/null +++ b/externals/mysql/mysys/trie.c @@ -0,0 +1,236 @@ +/* Copyright (C) 2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Implementation of trie and Aho-Corasick automaton. + Supports only charsets that can be compared byte-wise. + + TODO: + Add character frequencies. Can increase lookup speed + up to 30%. + Implement character-wise comparision. +*/ + + +#include "mysys_priv.h" +#include +#include +#include + + +/* + SYNOPSIS + TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset); + + DESCRIPTION + Allocates or initializes a `TRIE' object. If `trie' is a `NULL' + pointer, the function allocates, initializes, and returns a new + object. Otherwise, the object is initialized and the address of + the object is returned. If `trie_init()' allocates a new object, + it will be freed when `trie_free()' is called. + + RETURN VALUE + An initialized `TRIE*' object. `NULL' if there was insufficient + memory to allocate a new object. +*/ + +TRIE *trie_init (TRIE *trie, CHARSET_INFO *charset) +{ + MEM_ROOT mem_root; + DBUG_ENTER("trie_init"); + DBUG_ASSERT(charset); + init_alloc_root(&mem_root, + (sizeof(TRIE_NODE) * 128) + ALLOC_ROOT_MIN_BLOCK_SIZE, + sizeof(TRIE_NODE) * 128); + if (! trie) + { + if (! (trie= (TRIE *)alloc_root(&mem_root, sizeof(TRIE)))) + { + free_root(&mem_root, MYF(0)); + DBUG_RETURN(NULL); + } + } + + memcpy(&trie->mem_root, &mem_root, sizeof(MEM_ROOT)); + trie->root.leaf= 0; + trie->root.c= 0; + trie->root.next= NULL; + trie->root.links= NULL; + trie->root.fail= NULL; + trie->charset= charset; + trie->nnodes= 0; + trie->nwords= 0; + DBUG_RETURN(trie); +} + + +/* + SYNOPSIS + void trie_free (TRIE *trie); + trie - valid pointer to `TRIE' + + DESCRIPTION + Frees the memory allocated for a `trie'. + + RETURN VALUE + None. +*/ + +void trie_free (TRIE *trie) +{ + MEM_ROOT mem_root; + DBUG_ENTER("trie_free"); + DBUG_ASSERT(trie); + memcpy(&mem_root, &trie->mem_root, sizeof(MEM_ROOT)); + free_root(&mem_root, MYF(0)); + DBUG_VOID_RETURN; +} + + +/* + SYNOPSIS + my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen); + trie - valid pointer to `TRIE' + key - valid pointer to key to insert + keylen - non-0 key length + + DESCRIPTION + Inserts new key into trie. + + RETURN VALUE + Upon successful completion, `trie_insert' returns `FALSE'. Otherwise + `TRUE' is returned. + + NOTES + If this function fails you must assume `trie' is broken. + However it can be freed with trie_free(). +*/ + +my_bool trie_insert (TRIE *trie, const uchar *key, uint keylen) +{ + TRIE_NODE *node; + TRIE_NODE *next; + uchar p; + uint k; + DBUG_ENTER("trie_insert"); + DBUG_ASSERT(trie && key && keylen); + node= &trie->root; + trie->root.fail= NULL; + for (k= 0; k < keylen; k++) + { + p= key[k]; + for (next= node->links; next; next= next->next) + if (next->c == p) + break; + + if (! next) + { + TRIE_NODE *tmp= (TRIE_NODE *)alloc_root(&trie->mem_root, + sizeof(TRIE_NODE)); + if (! tmp) + DBUG_RETURN(TRUE); + tmp->leaf= 0; + tmp->c= p; + tmp->links= tmp->fail= tmp->next= NULL; + trie->nnodes++; + if (! node->links) + { + node->links= tmp; + } + else + { + for (next= node->links; next->next; next= next->next) /* no-op */; + next->next= tmp; + } + node= tmp; + } + else + { + node= next; + } + } + node->leaf= keylen; + trie->nwords++; + DBUG_RETURN(FALSE); +} + + +/* + SYNOPSIS + my_bool trie_prepare (TRIE *trie); + trie - valid pointer to `TRIE' + + DESCRIPTION + Constructs Aho-Corasick automaton. + + RETURN VALUE + Upon successful completion, `trie_prepare' returns `FALSE'. Otherwise + `TRUE' is returned. +*/ + +my_bool ac_trie_prepare (TRIE *trie) +{ + TRIE_NODE **tmp_nodes; + TRIE_NODE *node; + uint32 fnode= 0; + uint32 lnode= 0; + DBUG_ENTER("trie_prepare"); + DBUG_ASSERT(trie); + + tmp_nodes= (TRIE_NODE **)my_malloc(trie->nnodes * sizeof(TRIE_NODE *), MYF(0)); + if (! tmp_nodes) + DBUG_RETURN(TRUE); + + trie->root.fail= &trie->root; + for (node= trie->root.links; node; node= node->next) + { + node->fail= &trie->root; + tmp_nodes[lnode++]= node; + } + + while (fnode < lnode) + { + TRIE_NODE *current= (TRIE_NODE *)tmp_nodes[fnode++]; + for (node= current->links; node; node= node->next) + { + TRIE_NODE *fail= current->fail; + tmp_nodes[lnode++]= node; + while (! (node->fail= trie_goto(&trie->root, fail, node->c))) + fail= fail->fail; + } + } + my_free((uchar*)tmp_nodes, MYF(0)); + DBUG_RETURN(FALSE); +} + + +/* + SYNOPSIS + void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state); + trie - valid pointer to `TRIE' + state - value pointer to `AC_TRIE_STATE' + + DESCRIPTION + Initializes `AC_TRIE_STATE' object. +*/ + +void ac_trie_init (TRIE *trie, AC_TRIE_STATE *state) +{ + DBUG_ENTER("ac_trie_init"); + DBUG_ASSERT(trie && state); + state->trie= trie; + state->node= &trie->root; + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/mysys/typelib.c b/externals/mysql/mysys/typelib.c new file mode 100644 index 00000000000..5c3e30488d7 --- /dev/null +++ b/externals/mysql/mysys/typelib.c @@ -0,0 +1,243 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Functions to handle typelib */ + +#include "mysys_priv.h" +#include +#include + + +static const char field_separator=','; + +int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) +{ + int res; + const char **ptr; + + if ((res= find_type((char *) x, typelib, 2)) <= 0) + { + ptr= typelib->type_names; + if (!*x) + fprintf(stderr, "No option given to %s\n", option); + else + fprintf(stderr, "Unknown option to %s: %s\n", option, x); + fprintf(stderr, "Alternatives are: '%s'", *ptr); + while (*++ptr) + fprintf(stderr, ",'%s'", *ptr); + fprintf(stderr, "\n"); + exit(1); + } + return res; +} + + +/* + Search after a string in a list of strings. Endspace in x is not compared. + + SYNOPSIS + find_type() + x String to find + lib TYPELIB (struct of pointer to values + count) + full_name bitmap of what to do + If & 1 accept only whole names + If & 2 don't expand if half field + If & 4 allow #number# as type + If & 8 use ',' as string terminator + + NOTES + If part, uniq field is found and full_name == 0 then x is expanded + to full field. + + RETURN + -1 Too many matching values + 0 No matching value + >0 Offset+1 in typelib for matched string +*/ + + +int find_type(char *x, const TYPELIB *typelib, uint full_name) +{ + int find,pos,findpos; + reg1 char * i; + reg2 const char *j; + DBUG_ENTER("find_type"); + DBUG_PRINT("enter",("x: '%s' lib: %p", x, typelib)); + + if (!typelib->count) + { + DBUG_PRINT("exit",("no count")); + DBUG_RETURN(0); + } + LINT_INIT(findpos); + find=0; + for (pos=0 ; (j=typelib->type_names[pos]) ; pos++) + { + for (i=x ; + *i && (!(full_name & 8) || *i != field_separator) && + my_toupper(&my_charset_latin1,*i) == + my_toupper(&my_charset_latin1,*j) ; i++, j++) ; + if (! *j) + { + while (*i == ' ') + i++; /* skip_end_space */ + if (! *i || ((full_name & 8) && *i == field_separator)) + DBUG_RETURN(pos+1); + } + if ((!*i && (!(full_name & 8) || *i != field_separator)) && + (!*j || !(full_name & 1))) + { + find++; + findpos=pos; + } + } + if (find == 0 && (full_name & 4) && x[0] == '#' && strend(x)[-1] == '#' && + (findpos=atoi(x+1)-1) >= 0 && (uint) findpos < typelib->count) + find=1; + else if (find == 0 || ! x[0]) + { + DBUG_PRINT("exit",("Couldn't find type")); + DBUG_RETURN(0); + } + else if (find != 1 || (full_name & 1)) + { + DBUG_PRINT("exit",("Too many possybilities")); + DBUG_RETURN(-1); + } + if (!(full_name & 2)) + (void) strmov(x,typelib->type_names[findpos]); + DBUG_RETURN(findpos+1); +} /* find_type */ + + + /* Get name of type nr 'nr' */ + /* Warning first type is 1, 0 = empty field */ + +void make_type(register char * to, register uint nr, + register TYPELIB *typelib) +{ + DBUG_ENTER("make_type"); + if (!nr) + to[0]=0; + else + (void) strmov(to,get_type(typelib,nr-1)); + DBUG_VOID_RETURN; +} /* make_type */ + + + /* Get type */ + /* Warning first type is 0 */ + +const char *get_type(TYPELIB *typelib, uint nr) +{ + if (nr < (uint) typelib->count && typelib->type_names) + return(typelib->type_names[nr]); + return "?"; +} + + +/* + Create an integer value to represent the supplied comma-seperated + string where each string in the TYPELIB denotes a bit position. + + SYNOPSIS + find_typeset() + x string to decompose + lib TYPELIB (struct of pointer to values + count) + err index (not char position) of string element which was not + found or 0 if there was no error + + RETURN + a integer representation of the supplied string +*/ + +my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) +{ + my_ulonglong result; + int find; + char *i; + DBUG_ENTER("find_set"); + DBUG_PRINT("enter",("x: '%s' lib: %p", x, lib)); + + if (!lib->count) + { + DBUG_PRINT("exit",("no count")); + DBUG_RETURN(0); + } + result= 0; + *err= 0; + while (*x) + { + (*err)++; + i= x; + while (*x && *x != field_separator) x++; + if ((find= find_type(i, lib, 2 | 8) - 1) < 0) + DBUG_RETURN(0); + result|= (1ULL << find); + } + *err= 0; + DBUG_RETURN(result); +} /* find_set */ + + +/* + Create a copy of a specified TYPELIB structure. + + SYNOPSIS + copy_typelib() + root pointer to a MEM_ROOT object for allocations + from pointer to a source TYPELIB structure + + RETURN + pointer to the new TYPELIB structure on successful copy, or + NULL otherwise +*/ + +TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from) +{ + TYPELIB *to; + uint i; + + if (!from) + return NULL; + + if (!(to= (TYPELIB*) alloc_root(root, sizeof(TYPELIB)))) + return NULL; + + if (!(to->type_names= (const char **) + alloc_root(root, (sizeof(char *) + sizeof(int)) * (from->count + 1)))) + return NULL; + to->type_lengths= (unsigned int *)(to->type_names + from->count + 1); + to->count= from->count; + if (from->name) + { + if (!(to->name= strdup_root(root, from->name))) + return NULL; + } + else + to->name= NULL; + + for (i= 0; i < from->count; i++) + { + if (!(to->type_names[i]= strmake_root(root, from->type_names[i], + from->type_lengths[i]))) + return NULL; + to->type_lengths[i]= from->type_lengths[i]; + } + to->type_names[to->count]= NULL; + to->type_lengths[to->count]= 0; + + return to; +} diff --git a/externals/mysql/mysys/waiting_threads.c b/externals/mysql/mysys/waiting_threads.c new file mode 100644 index 00000000000..46b3c1d4910 --- /dev/null +++ b/externals/mysql/mysys/waiting_threads.c @@ -0,0 +1,1153 @@ +/* Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file + + "waiting threads" subsystem - a unified interface for threads to wait + on each other, with built-in deadlock detection. + + Main concepts + ^^^^^^^^^^^^^ + a thread - is represented by a WT_THD structure. One physical thread + can have only one WT_THD descriptor at any given moment. + + a resource - a thread does not wait for other threads directly, + instead it waits for a "resource", which is "owned" by other threads. + It waits, exactly, for all "owners" to "release" a resource. + It does not have to correspond to a physical resource. For example, it + may be convenient in certain cases to force resource == thread. + A resource is represented by a WT_RESOURCE structure. + + a resource identifier - a pair of {resource type, value}. A value is + an ulonglong number. Represented by a WT_RESOURCE_ID structure. + + a resource type - a pointer to a statically defined instance of + WT_RESOURCE_TYPE structure. This structure contains a pointer to + a function that knows how to compare values of this resource type. + In the simple case it could be wt_resource_id_memcmp(). + + a wait-for graph - a graph, that represenst "wait-for" relationships. + It has two types of nodes - threads and resources. There are directed + edges from a thread to a resource it is waiting for (WT_THD::waiting_for), + from a thread to resources that it "owns" (WT_THD::my_resources), + and from a resource to threads that "own" it (WT_RESOURCE::owners) + + Graph completeness + ^^^^^^^^^^^^^^^^^^ + + For flawless deadlock detection wait-for graph must be complete. + It means that when a thread starts waiting it needs to know *all* its + blockers, and call wt_thd_will_wait_for() for every one of them. + Otherwise two phenomena should be expected: + + 1. Fuzzy timeouts: + + thread A needs to get a lock, and is blocked by a thread B. + it waits. + Just before the timeout thread B releases the lock. + thread A is ready to grab the lock but discovers that it is also + blocked by a thread C. + It waits and times out. + + As a result thread A has waited two timeout intervals, instead of one. + + 2. Unreliable cycle detection: + + Thread A waits for threads B and C + Thread C waits for D + Thread D wants to start waiting for A + + one can see immediately that thread D creates a cycle, and thus + a deadlock is detected. + + But if thread A would only wait for B, and start waiting for C + when B would unlock, thread D would be allowed to wait, a deadlock + would be only detected when B unlocks or somebody times out. + + These two phenomena don't affect a correctness, and strictly speaking, + the caller is not required to call wt_thd_will_wait_for() for *all* + blockers - it may optimize wt_thd_will_wait_for() calls. But they + may be perceived as bugs by users, it must be understood that such + an optimization comes with its price. + + Usage + ^^^^^ + + First, the wt* subsystem must be initialized by calling + wt_init(). In the server you don't need to do it, it's done + in mysqld.cc. + + Similarly, wt_end() frees wt* structures, should be called + at the end, but in the server mysqld.cc takes care of that. + + Every WT_THD should be initialized with wt_thd_lazy_init(). + After that they can be used in other wt_thd_* calls. + Before discarding, WT_THD should be free'd with + wt_thd_destroy(). In the server both are handled in sql_class.cc, + it's an error to try to do it manually. + + To use the deadlock detection one needs to use this thread's WT_THD, + call wt_thd_will_wait_for() for every thread it needs to wait on, + then call wt_thd_cond_timedwait(). When thread releases a resource + it should call wt_thd_release() (or wt_thd_release_all()) - it will + notify (send a signal) threads waiting in wt_thd_cond_timedwait(), + if appropriate. + + Just like with pthread's cond_wait, there could be spurious + wake-ups from wt_thd_cond_timedwait(). A caller is expected to + handle that (that is, to re-check the blocking criteria). + + wt_thd_will_wait_for() and wt_thd_cond_timedwait() return either + WT_OK or WT_DEADLOCK. Additionally wt_thd_cond_timedwait() can return + WT_TIMEOUT. Out of memory and other fatal errors are reported as + WT_DEADLOCK - and a transaction must be aborted just the same. + + Configuration + ^^^^^^^^^^^^^ + There are four config variables. Two deadlock search depths - short and + long - and two timeouts. Deadlock search is performed with the short + depth on every wt_thd_will_wait_for() call. wt_thd_cond_timedwait() + waits with a short timeout, performs a deadlock search with the long + depth, and waits with a long timeout. As most deadlock cycles are supposed + to be short, most deadlocks will be detected at once, and waits will + rarely be necessary. + + These config variables are thread-local. Different threads may have + different search depth and timeout values. + + Also, deadlock detector supports different killing strategies, the victim + in a deadlock cycle is selected based on the "weight". See "weight" + description in waiting_threads.h for details. It's up to the caller to + set weights accordingly. + + Status + ^^^^^^ + We calculate the number of successfull waits (WT_OK returned from + wt_thd_cond_timedwait()), a number of timeouts, a deadlock cycle + length distribution - number of deadlocks with every length from + 1 to WT_CYCLE_STATS, and a wait time distribution - number + of waits with a time from 1 us to 1 min in WT_WAIT_STATS + intervals on a log e scale. +*/ + +/* + Note that if your lock system satisfy the following condition: + + there exist four lock levels A, B, C, D, such as + A is compatible with B + A is not compatible with C + D is not compatible with B + + (example A=IX, B=IS, C=S, D=X) + + you need to include lock level in the resource identifier - a + thread waiting for lock of the type A on resource R and another + thread waiting for lock of the type B on resource R should wait on + different WT_RESOURCE structures, on different {lock, resource} + pairs. Otherwise the following is possible: + + thread1> take S-lock on R + thread2> take IS-lock on R + thread3> wants X-lock on R, starts waiting for threads 1 and 2 on R. + thread3 is killed (or timeout or whatever) + WT_RESOURCE structure for R is still in the hash, as it has two owners + thread4> wants an IX-lock on R + WT_RESOURCE for R is found in the hash, thread4 starts waiting on it. + !! now thread4 is waiting for both thread1 and thread2 + !! while, in fact, IX-lock and IS-lock are compatible and + !! thread4 should not wait for thread2. +*/ + +#include +#include + +/* status variables */ + +/** + preset table of wait intervals +*/ +ulonglong wt_wait_table[WT_WAIT_STATS]; +/** + wait time distribution (log e scale) +*/ +uint32 wt_wait_stats[WT_WAIT_STATS+1]; +/** + distribution of cycle lengths + first column tells whether this was during short or long detection +*/ +uint32 wt_cycle_stats[2][WT_CYCLE_STATS+1]; +uint32 wt_success_stats; + +static my_atomic_rwlock_t cycle_stats_lock, wait_stats_lock, success_stats_lock; + +#ifdef SAFE_STATISTICS +#define incr(VAR, LOCK) \ + do { \ + my_atomic_rwlock_wrlock(&(LOCK)); \ + my_atomic_add32(&(VAR), 1); \ + my_atomic_rwlock_wrunlock(&(LOCK)); \ + } while(0) +#else +#define incr(VAR,LOCK) do { (VAR)++; } while(0) +#endif + +static void increment_success_stats() +{ + incr(wt_success_stats, success_stats_lock); +} + +static void increment_cycle_stats(uint depth, uint slot) +{ + if (depth >= WT_CYCLE_STATS) + depth= WT_CYCLE_STATS; + incr(wt_cycle_stats[slot][depth], cycle_stats_lock); +} + +static void increment_wait_stats(ulonglong waited,int ret) +{ + uint i; + if ((ret) == ETIMEDOUT) + i= WT_WAIT_STATS; + else + for (i= 0; i < WT_WAIT_STATS && waited/10 > wt_wait_table[i]; i++) ; + incr(wt_wait_stats[i], wait_stats_lock); +} + +/* + 'lock' protects 'owners', 'state', and 'waiter_count' + 'id' is read-only + + a resource is picked up from a hash in a lock-free manner + it's returned pinned, so it cannot be freed at once + but it may be freed right after the pin is removed + to free a resource it should + 1. have no owners + 2. have no waiters + + two ways to access a resource: + 1. find it in a hash + - it's returned pinned. + a) take a lock in exclusive mode + b) check the state, it should be ACTIVE to be usable + c) unpin + 2. by a direct reference + - could only used if a resource cannot be freed + e.g. accessing a resource by thd->waiting_for is safe, + a resource cannot be freed as there's a thread waiting for it +*/ +struct st_wt_resource { + WT_RESOURCE_ID id; + uint waiter_count; + enum { ACTIVE, FREE } state; +#ifndef DBUG_OFF + pthread_mutex_t *cond_mutex; /* a mutex for the 'cond' below */ +#endif + /* + before the 'lock' all elements are mutable, after (and including) - + immutable in the sense that lf_hash_insert() won't memcpy() over them. + See wt_init(). + */ +#ifdef WT_RWLOCKS_USE_MUTEXES + /* + we need a special rwlock-like 'lock' to allow readers bypass + waiting writers, otherwise readers can deadlock. For example: + + A waits on resource x, owned by B, B waits on resource y, owned + by A, we have a cycle (A->x->B->y->A) + Both A and B start deadlock detection: + + A locks x B locks y + A goes deeper B goes deeper + A locks y B locks x + + with mutexes it would deadlock. With rwlocks it won't, as long + as both A and B are taking read locks (and they do). + But other threads may take write locks. Assume there's + C who wants to start waiting on x, and D who wants to start + waiting on y. + + A read-locks x B read-locks y + A goes deeper B goes deeper + => C write-locks x (to add a new edge) D write-locks y + .. C is blocked D is blocked + A read-locks y B read-locks x + + Now, if a read lock can bypass a pending wrote lock request, we're fine. + If it can not, we have a deadlock. + + writer starvation is technically possible, but unlikely, because + the contention is expected to be low. + */ + struct { + pthread_cond_t cond; + pthread_mutex_t mutex; + uint readers: 16; + uint pending_writers: 15; + uint write_locked: 1; + } lock; +#else + rw_lock_t lock; +#endif + pthread_cond_t cond; /* the corresponding mutex is provided by the caller */ + DYNAMIC_ARRAY owners; +}; + +#ifdef WT_RWLOCKS_USE_MUTEXES +static void rc_rwlock_init(WT_RESOURCE *rc) +{ + pthread_cond_init(&rc->lock.cond, 0); + pthread_mutex_init(&rc->lock.mutex, MY_MUTEX_INIT_FAST); +} +static void rc_rwlock_destroy(WT_RESOURCE *rc) +{ + DBUG_ASSERT(rc->lock.write_locked == 0); + DBUG_ASSERT(rc->lock.readers == 0); + pthread_cond_destroy(&rc->lock.cond); + pthread_mutex_destroy(&rc->lock.mutex); +} +static void rc_rdlock(WT_RESOURCE *rc) +{ + DBUG_PRINT("wt", ("TRYLOCK resid=%ld for READ", (ulong)rc->id.value)); + pthread_mutex_lock(&rc->lock.mutex); + while (rc->lock.write_locked) + pthread_cond_wait(&rc->lock.cond, &rc->lock.mutex); + rc->lock.readers++; + pthread_mutex_unlock(&rc->lock.mutex); + DBUG_PRINT("wt", ("LOCK resid=%ld for READ", (ulong)rc->id.value)); +} +static void rc_wrlock(WT_RESOURCE *rc) +{ + DBUG_PRINT("wt", ("TRYLOCK resid=%ld for WRITE", (ulong)rc->id.value)); + pthread_mutex_lock(&rc->lock.mutex); + while (rc->lock.write_locked || rc->lock.readers) + pthread_cond_wait(&rc->lock.cond, &rc->lock.mutex); + rc->lock.write_locked= 1; + pthread_mutex_unlock(&rc->lock.mutex); + DBUG_PRINT("wt", ("LOCK resid=%ld for WRITE", (ulong)rc->id.value)); +} +static void rc_unlock(WT_RESOURCE *rc) +{ + DBUG_PRINT("wt", ("UNLOCK resid=%ld", (ulong)rc->id.value)); + pthread_mutex_lock(&rc->lock.mutex); + if (rc->lock.write_locked) + { + rc->lock.write_locked= 0; + pthread_cond_broadcast(&rc->lock.cond); + } + else if (--rc->lock.readers == 0) + pthread_cond_broadcast(&rc->lock.cond); + pthread_mutex_unlock(&rc->lock.mutex); +} +#else +static void rc_rwlock_init(WT_RESOURCE *rc) +{ + my_rwlock_init(&rc->lock, 0); +} +static void rc_rwlock_destroy(WT_RESOURCE *rc) +{ + rwlock_destroy(&rc->lock); +} +static void rc_rdlock(WT_RESOURCE *rc) +{ + DBUG_PRINT("wt", ("TRYLOCK resid=%ld for READ", (ulong)rc->id.value)); + rw_rdlock(&rc->lock); + DBUG_PRINT("wt", ("LOCK resid=%ld for READ", (ulong)rc->id.value)); +} +static void rc_wrlock(WT_RESOURCE *rc) +{ + DBUG_PRINT("wt", ("TRYLOCK resid=%ld for WRITE", (ulong)rc->id.value)); + rw_wrlock(&rc->lock); + DBUG_PRINT("wt", ("LOCK resid=%ld for WRITE", (ulong)rc->id.value)); +} +static void rc_unlock(WT_RESOURCE *rc) +{ + DBUG_PRINT("wt", ("UNLOCK resid=%ld", (ulong)rc->id.value)); + rw_unlock(&rc->lock); +} +#endif + +/* + All resources are stored in a lock-free hash. Different threads + may add new resources and perform deadlock detection concurrently. +*/ +static LF_HASH reshash; + +/** + WT_RESOURCE constructor + + It's called from lf_hash and takes a pointer to an LF_SLIST instance. + WT_RESOURCE is located at arg+sizeof(LF_SLIST) +*/ +static void wt_resource_init(uchar *arg) +{ + WT_RESOURCE *rc= (WT_RESOURCE*)(arg+LF_HASH_OVERHEAD); + DBUG_ENTER("wt_resource_init"); + + bzero(rc, sizeof(*rc)); + rc_rwlock_init(rc); + pthread_cond_init(&rc->cond, 0); + my_init_dynamic_array(&rc->owners, sizeof(WT_THD *), 0, 5); + DBUG_VOID_RETURN; +} + +/** + WT_RESOURCE destructor + + It's called from lf_hash and takes a pointer to an LF_SLIST instance. + WT_RESOURCE is located at arg+sizeof(LF_SLIST) +*/ +static void wt_resource_destroy(uchar *arg) +{ + WT_RESOURCE *rc= (WT_RESOURCE*)(arg+LF_HASH_OVERHEAD); + DBUG_ENTER("wt_resource_destroy"); + + DBUG_ASSERT(rc->owners.elements == 0); + rc_rwlock_destroy(rc); + pthread_cond_destroy(&rc->cond); + delete_dynamic(&rc->owners); + DBUG_VOID_RETURN; +} + +void wt_init() +{ + DBUG_ENTER("wt_init"); + DBUG_ASSERT(reshash.alloc.constructor != wt_resource_init); + + lf_hash_init(&reshash, sizeof(WT_RESOURCE), LF_HASH_UNIQUE, 0, + sizeof_WT_RESOURCE_ID, 0, 0); + reshash.alloc.constructor= wt_resource_init; + reshash.alloc.destructor= wt_resource_destroy; + /* + Note a trick: we initialize the hash with the real element size, + but fix it later to a shortened element size. This way + the allocator will allocate elements correctly, but + lf_hash_insert() will only overwrite part of the element with memcpy(). + lock, condition, and dynamic array will be intact. + */ + reshash.element_size= offsetof(WT_RESOURCE, lock); + bzero(wt_wait_stats, sizeof(wt_wait_stats)); + bzero(wt_cycle_stats, sizeof(wt_cycle_stats)); + wt_success_stats= 0; + { /* initialize wt_wait_table[]. from 1 us to 1 min, log e scale */ + int i; + double from= log(1); /* 1 us */ + double to= log(60e6); /* 1 min */ + for (i= 0; i < WT_WAIT_STATS; i++) + { + wt_wait_table[i]= (ulonglong)exp((to-from)/(WT_WAIT_STATS-1)*i+from); + DBUG_ASSERT(i == 0 || wt_wait_table[i-1] != wt_wait_table[i]); + } + } + my_atomic_rwlock_init(&cycle_stats_lock); + my_atomic_rwlock_init(&success_stats_lock); + my_atomic_rwlock_init(&wait_stats_lock); + DBUG_VOID_RETURN; +} + +void wt_end() +{ + DBUG_ENTER("wt_end"); + + DBUG_ASSERT(reshash.count == 0); + lf_hash_destroy(&reshash); + my_atomic_rwlock_destroy(&cycle_stats_lock); + my_atomic_rwlock_destroy(&success_stats_lock); + my_atomic_rwlock_destroy(&wait_stats_lock); + DBUG_VOID_RETURN; +} + +/** + Lazy WT_THD initialization + + Cheap initialization of WT_THD. Only initialize fields that don't require + memory allocations - basically, it only does assignments. The rest of the + WT_THD structure will be initialized on demand, on the first use. + This allows one to initialize lazily all WT_THD structures, even if some + (or even most) of them will never be used for deadlock detection. + + @param ds a pointer to deadlock search depth short value + @param ts a pointer to deadlock timeout short value + @param dl a pointer to deadlock search depth long value + @param tl a pointer to deadlock timeout long value + + @note these are pointers to values, and WT_THD stores them as pointers. + It allows one later to change search depths and timeouts for existing + threads. It also means that the pointers must stay valid for the lifetime + of WT_THD. +*/ +void wt_thd_lazy_init(WT_THD *thd, const ulong *ds, const ulong *ts, + const ulong *dl, const ulong *tl) +{ + DBUG_ENTER("wt_thd_lazy_init"); + thd->waiting_for= 0; + thd->weight= 0; + thd->deadlock_search_depth_short= ds; + thd->timeout_short= ts; + thd->deadlock_search_depth_long= dl; + thd->timeout_long= tl; + /* dynamic array is also initialized lazily - without memory allocations */ + my_init_dynamic_array(&thd->my_resources, sizeof(WT_RESOURCE *), 0, 5); +#ifndef DBUG_OFF + thd->name= my_thread_name(); +#endif + DBUG_VOID_RETURN; +} + +/** + Finalize WT_THD initialization + + After lazy WT_THD initialization, parts of the structure are still + uninitialized. This function completes the initialization, allocating + memory, if necessary. It's called automatically on demand, when WT_THD + is about to be used. +*/ +static int fix_thd_pins(WT_THD *thd) +{ + if (unlikely(thd->pins == 0)) + { + thd->pins= lf_hash_get_pins(&reshash); +#ifndef DBUG_OFF + thd->name= my_thread_name(); +#endif + } + return thd->pins == 0; +} + +void wt_thd_destroy(WT_THD *thd) +{ + DBUG_ENTER("wt_thd_destroy"); + + DBUG_ASSERT(thd->my_resources.elements == 0); + DBUG_ASSERT(thd->waiting_for == 0); + + if (thd->pins != 0) + lf_hash_put_pins(thd->pins); + + delete_dynamic(&thd->my_resources); + DBUG_VOID_RETURN; +} +/** + Trivial resource id comparison function - bytewise memcmp. + + It can be used in WT_RESOURCE_TYPE structures where bytewise + comparison of values is sufficient. +*/ +my_bool wt_resource_id_memcmp(const void *a, const void *b) +{ + /* we use the fact that there's no padding in the middle of WT_RESOURCE_ID */ + compile_time_assert(offsetof(WT_RESOURCE_ID, type) == sizeof(ulonglong)); + return memcmp(a, b, sizeof_WT_RESOURCE_ID); +} + +/** + arguments for the recursive deadlock_search function +*/ +struct deadlock_arg { + WT_THD * const thd; /**< starting point of a search */ + uint const max_depth; /**< search depth limit */ + WT_THD *victim; /**< a thread to be killed to resolve a deadlock */ + WT_RESOURCE *last_locked_rc; /**< see comment at the end of deadlock_search() */ +}; + +/** + helper function to change the victim, according to the weight +*/ +static void change_victim(WT_THD* found, struct deadlock_arg *arg) +{ + if (found->weight < arg->victim->weight) + { + if (arg->victim != arg->thd) + { + rc_unlock(arg->victim->waiting_for); /* release the previous victim */ + DBUG_ASSERT(arg->last_locked_rc == found->waiting_for); + } + arg->victim= found; + arg->last_locked_rc= 0; + } +} + +/** + recursive loop detection in a wait-for graph with a limited search depth +*/ +static int deadlock_search(struct deadlock_arg *arg, WT_THD *blocker, + uint depth) +{ + WT_RESOURCE *rc, *volatile *shared_ptr= &blocker->waiting_for; + WT_THD *cursor; + uint i; + int ret= WT_OK; + DBUG_ENTER("deadlock_search"); + DBUG_PRINT("wt", ("enter: thd=%s, blocker=%s, depth=%u", + arg->thd->name, blocker->name, depth)); + + LF_REQUIRE_PINS(1); + + arg->last_locked_rc= 0; + + if (depth > arg->max_depth) + { + DBUG_PRINT("wt", ("exit: WT_DEPTH_EXCEEDED (early)")); + DBUG_RETURN(WT_DEPTH_EXCEEDED); + } + +retry: + /* + safe dereference as explained in lf_alloc-pin.c + (in short: protects against lf_alloc_free() in lf_hash_delete()) + */ + do + { + rc= *shared_ptr; + lf_pin(arg->thd->pins, 0, rc); + } while (rc != *shared_ptr && LF_BACKOFF); + + if (rc == 0) + { + DBUG_PRINT("wt", ("exit: OK (early)")); + DBUG_RETURN(0); + } + + rc_rdlock(rc); + if (rc->state != ACTIVE || *shared_ptr != rc) + { + /* blocker is not waiting on this resource anymore */ + rc_unlock(rc); + lf_unpin(arg->thd->pins, 0); + goto retry; + } + /* as the state is locked, we can unpin now */ + lf_unpin(arg->thd->pins, 0); + + /* + Below is not a pure depth-first search. It's a depth-first with a + slightest hint of breadth-first. Depth-first is: + + check(element, X): + foreach current in element->nodes[] do: + if current == X return error; + check(current, X); + + while we do + + check(element, X): + foreach current in element->nodes[] do: + if current == X return error; + foreach current in element->nodes[] do: + check(current, X); + + preferring shorter deadlocks over longer ones. + */ + for (i= 0; i < rc->owners.elements; i++) + { + cursor= *dynamic_element(&rc->owners, i, WT_THD**); + /* + We're only looking for (and detecting) cycles that include 'arg->thd'. + That is, only deadlocks that *we* have created. For example, + thd->A->B->thd + (thd waits for A, A waits for B, while B is waiting for thd). + While walking the graph we can encounter other cicles, e.g. + thd->A->B->C->A + This will not be detected. Instead we will walk it in circles until + the search depth limit is reached (the latter guarantees that an + infinite loop is impossible). We expect the thread that has created + the cycle (one of A, B, and C) to detect its deadlock. + */ + if (cursor == arg->thd) + { + ret= WT_DEADLOCK; + increment_cycle_stats(depth, arg->max_depth == + *arg->thd->deadlock_search_depth_long); + arg->victim= cursor; + goto end; + } + } + for (i= 0; i < rc->owners.elements; i++) + { + cursor= *dynamic_element(&rc->owners, i, WT_THD**); + switch (deadlock_search(arg, cursor, depth+1)) { + case WT_OK: + break; + case WT_DEPTH_EXCEEDED: + ret= WT_DEPTH_EXCEEDED; + break; + case WT_DEADLOCK: + ret= WT_DEADLOCK; + change_victim(cursor, arg); /* also sets arg->last_locked_rc to 0 */ + i= rc->owners.elements; /* jump out of the loop */ + break; + default: + DBUG_ASSERT(0); + } + if (arg->last_locked_rc) + rc_unlock(arg->last_locked_rc); + } +end: + /* + Note that 'rc' is locked in this function, but it's never unlocked here. + Instead it's saved in arg->last_locked_rc and the *caller* is + expected to unlock it. It's done to support different killing + strategies. This is how it works: + Assuming a graph + + thd->A->B->C->thd + + deadlock_search() function starts from thd, locks it (in fact it locks not + a thd, but a resource it is waiting on, but below, for simplicity, I'll + talk about "locking a thd"). Then it goes down recursively, locks A, and so + on. Goes down recursively, locks B. Goes down recursively, locks C. + Notices that C is waiting on thd. Deadlock detected. Sets arg->victim=thd. + Returns from the last deadlock_search() call. C stays locked! + Now it checks whether C is a more appropriate victim than 'thd'. + If yes - arg->victim=C, otherwise C is unlocked. Returns. B stays locked. + Now it checks whether B is a more appropriate victim than arg->victim. + If yes - old arg->victim is unlocked and arg->victim=B, + otherwise B is unlocked. Return. + And so on. + + In short, a resource is locked in a frame. But it's not unlocked in the + same frame, it's unlocked by the caller, and only after the caller checks + that it doesn't need to use current WT_THD as a victim. If it does - the + lock is kept and the old victim's resource is unlocked. When the recursion + is unrolled and we are back to deadlock() function, there are only two + locks left - on thd and on the victim. + */ + arg->last_locked_rc= rc; + DBUG_PRINT("wt", ("exit: %s", + ret == WT_DEPTH_EXCEEDED ? "WT_DEPTH_EXCEEDED" : + ret ? "WT_DEADLOCK" : "OK")); + DBUG_RETURN(ret); +} + +/** + Deadlock detection in a wait-for graph + + A wrapper for recursive deadlock_search() - prepares deadlock_arg structure, + invokes deadlock_search(), increments statistics, notifies the victim. + + @param thd thread that is going to wait. Deadlock is detected + if, while walking the graph, we reach a thread that + is waiting on thd + @param blocker starting point of a search. In wt_thd_cond_timedwait() + it's thd, in wt_thd_will_wait_for() it's a thread that + thd is going to wait for + @param depth starting search depth. In general it's the number of + edges in the wait-for graph between thd and the + blocker. Practically only two values are used (and + supported) - when thd == blocker it's 0, when thd + waits directly for blocker, it's 1 + @param max_depth search depth limit +*/ +static int deadlock(WT_THD *thd, WT_THD *blocker, uint depth, + uint max_depth) +{ + struct deadlock_arg arg= {thd, max_depth, 0, 0}; + int ret; + DBUG_ENTER("deadlock"); + DBUG_ASSERT(depth < 2); + ret= deadlock_search(&arg, blocker, depth); + if (ret == WT_DEPTH_EXCEEDED) + { + increment_cycle_stats(WT_CYCLE_STATS, max_depth == + *thd->deadlock_search_depth_long); + ret= WT_OK; + } + /* + if we started with depth==1, blocker was never considered for a victim + in deadlock_search(). Do it here. + */ + if (ret == WT_DEADLOCK && depth) + change_victim(blocker, &arg); + if (arg.last_locked_rc) + { + /* + Special return code if there's nobody to wait for. + + depth == 0 means that we start the search from thd (thd == blocker). + ret == WT_OK means that no cycle was found and + arg.last_locked_rc == thd->waiting_for. + and arg.last_locked_rc->owners.elements == 0 means that + (applying the rule above) thd->waiting_for->owners.elements == 0, + and thd doesn't have anybody to wait for. + */ + if (depth == 0 && ret == WT_OK && arg.last_locked_rc->owners.elements == 0) + { + DBUG_ASSERT(thd == blocker); + DBUG_ASSERT(arg.last_locked_rc == thd->waiting_for); + ret= WT_FREE_TO_GO; + } + rc_unlock(arg.last_locked_rc); + } + /* notify the victim, if appropriate */ + if (ret == WT_DEADLOCK && arg.victim != thd) + { + DBUG_PRINT("wt", ("killing %s", arg.victim->name)); + arg.victim->killed= 1; + pthread_cond_broadcast(&arg.victim->waiting_for->cond); + rc_unlock(arg.victim->waiting_for); + ret= WT_OK; + } + DBUG_RETURN(ret); +} + + +/** + Delete an element from reshash if it has no waiters or owners + + rc->lock must be locked by the caller and it's unlocked on return. +*/ +static int unlock_lock_and_free_resource(WT_THD *thd, WT_RESOURCE *rc) +{ + uint keylen; + const void *key; + DBUG_ENTER("unlock_lock_and_free_resource"); + + DBUG_ASSERT(rc->state == ACTIVE); + + if (rc->owners.elements || rc->waiter_count) + { + DBUG_PRINT("wt", ("nothing to do, %u owners, %u waiters", + rc->owners.elements, rc->waiter_count)); + rc_unlock(rc); + DBUG_RETURN(0); + } + + if (fix_thd_pins(thd)) + { + rc_unlock(rc); + DBUG_RETURN(1); + } + + /* XXX if (rc->id.type->make_key) key= rc->id.type->make_key(&rc->id, &keylen); else */ + { + key= &rc->id; + keylen= sizeof_WT_RESOURCE_ID; + } + + /* + To free the element correctly we need to: + 1. take its lock (already done). + 2. set the state to FREE + 3. release the lock + 4. remove from the hash + */ + rc->state= FREE; + rc_unlock(rc); + DBUG_RETURN(lf_hash_delete(&reshash, thd->pins, key, keylen) == -1); +} + + +/** + register the fact that thd is not waiting anymore + + decrease waiter_count, clear waiting_for, free the resource if appropriate. + thd->waiting_for must be locked! +*/ +static int stop_waiting_locked(WT_THD *thd) +{ + int ret; + WT_RESOURCE *rc= thd->waiting_for; + DBUG_ENTER("stop_waiting_locked"); + + DBUG_ASSERT(rc->waiter_count); + DBUG_ASSERT(rc->state == ACTIVE); + rc->waiter_count--; + thd->waiting_for= 0; + ret= unlock_lock_and_free_resource(thd, rc); + DBUG_RETURN((thd->killed || ret) ? WT_DEADLOCK : WT_OK); +} + +/** + register the fact that thd is not waiting anymore + + locks thd->waiting_for and calls stop_waiting_locked(). +*/ +static int stop_waiting(WT_THD *thd) +{ + int ret; + WT_RESOURCE *rc= thd->waiting_for; + DBUG_ENTER("stop_waiting"); + + if (!rc) + DBUG_RETURN(WT_OK); + /* + nobody's trying to free the resource now, + as its waiter_count is guaranteed to be non-zero + */ + rc_wrlock(rc); + ret= stop_waiting_locked(thd); + DBUG_RETURN(ret); +} + +/** + notify the system that a thread needs to wait for another thread + + called by a *waiter* to declare that it (thd) will wait for another + thread (blocker) on a specific resource (resid). + can be called many times, if many blockers own a blocking resource. + but must always be called with the same resource id - a thread cannot + wait for more than one resource at a time. + + @return WT_OK or WT_DEADLOCK + + As a new edge is added to the wait-for graph, a deadlock detection is + performed for this new edge. +*/ +int wt_thd_will_wait_for(WT_THD *thd, WT_THD *blocker, + const WT_RESOURCE_ID *resid) +{ + uint i; + WT_RESOURCE *rc; + DBUG_ENTER("wt_thd_will_wait_for"); + + LF_REQUIRE_PINS(3); + + DBUG_PRINT("wt", ("enter: thd=%s, blocker=%s, resid=%lu", + thd->name, blocker->name, (ulong)resid->value)); + + if (fix_thd_pins(thd)) + DBUG_RETURN(WT_DEADLOCK); + + if (thd->waiting_for == 0) + { + uint keylen; + const void *key; + /* XXX if (restype->make_key) key= restype->make_key(resid, &keylen); else */ + { + key= resid; + keylen= sizeof_WT_RESOURCE_ID; + } + + DBUG_PRINT("wt", ("first blocker")); + +retry: + while ((rc= lf_hash_search(&reshash, thd->pins, key, keylen)) == 0) + { + WT_RESOURCE tmp; + + DBUG_PRINT("wt", ("failed to find rc in hash, inserting")); + bzero(&tmp, sizeof(tmp)); + tmp.id= *resid; + tmp.state= ACTIVE; + + if (lf_hash_insert(&reshash, thd->pins, &tmp) == -1) /* if OOM */ + DBUG_RETURN(WT_DEADLOCK); + /* + Two cases: either lf_hash_insert() failed - because another thread + has just inserted a resource with the same id - and we need to retry. + Or lf_hash_insert() succeeded, and then we need to repeat + lf_hash_search() to find a real address of the newly inserted element. + That is, we don't care what lf_hash_insert() has returned. + And we need to repeat the loop anyway. + */ + } + if (rc == MY_ERRPTR) + DBUG_RETURN(WT_DEADLOCK); + + DBUG_PRINT("wt", ("found in hash rc=%p", rc)); + + rc_wrlock(rc); + if (rc->state != ACTIVE) + { + DBUG_PRINT("wt", ("but it's not active, retrying")); + /* Somebody has freed the element while we weren't looking */ + rc_unlock(rc); + lf_hash_search_unpin(thd->pins); + goto retry; + } + + lf_hash_search_unpin(thd->pins); /* the element cannot go away anymore */ + thd->waiting_for= rc; + rc->waiter_count++; + thd->killed= 0; + } + else + { + DBUG_ASSERT(thd->waiting_for->id.type == resid->type); + DBUG_ASSERT(resid->type->compare(&thd->waiting_for->id, resid) == 0); + DBUG_PRINT("wt", ("adding another blocker")); + + /* + we can safely access the resource here, it's in the hash as it has + non-zero waiter_count + */ + rc= thd->waiting_for; + rc_wrlock(rc); + DBUG_ASSERT(rc->waiter_count); + DBUG_ASSERT(rc->state == ACTIVE); + + if (thd->killed) + { + stop_waiting_locked(thd); + DBUG_RETURN(WT_DEADLOCK); + } + } + /* + Another thread could be waiting on this resource for this very 'blocker'. + In this case we should not add it to the list for the second time. + */ + for (i= 0; i < rc->owners.elements; i++) + if (*dynamic_element(&rc->owners, i, WT_THD**) == blocker) + break; + if (i >= rc->owners.elements) + { + if (push_dynamic(&blocker->my_resources, (void*)&rc)) + { + stop_waiting_locked(thd); + DBUG_RETURN(WT_DEADLOCK); /* deadlock and OOM use the same error code */ + } + if (push_dynamic(&rc->owners, (void*)&blocker)) + { + pop_dynamic(&blocker->my_resources); + stop_waiting_locked(thd); + DBUG_RETURN(WT_DEADLOCK); + } + } + rc_unlock(rc); + + if (deadlock(thd, blocker, 1, *thd->deadlock_search_depth_short) != WT_OK) + { + stop_waiting(thd); + DBUG_RETURN(WT_DEADLOCK); + } + DBUG_RETURN(WT_OK); +} + +/** + called by a *waiter* (thd) to start waiting + + It's supposed to be a drop-in replacement for + pthread_cond_timedwait(), and it takes mutex as an argument. + + @return one of WT_TIMEOUT, WT_DEADLOCK, WT_OK +*/ +int wt_thd_cond_timedwait(WT_THD *thd, pthread_mutex_t *mutex) +{ + int ret= WT_TIMEOUT; + struct timespec timeout; + ulonglong before, after, starttime; + WT_RESOURCE *rc= thd->waiting_for; + DBUG_ENTER("wt_thd_cond_timedwait"); + DBUG_PRINT("wt", ("enter: thd=%s, rc=%p", thd->name, rc)); + +#ifndef DBUG_OFF + if (rc->cond_mutex) + DBUG_ASSERT(rc->cond_mutex == mutex); + else + rc->cond_mutex= mutex; + safe_mutex_assert_owner(mutex); +#endif + + before= starttime= my_getsystime(); + +#ifdef __WIN__ + /* + only for the sake of Windows we distinguish between + 'before' and 'starttime': + + my_getsystime() returns high-resolution value, that cannot be used for + waiting (it doesn't follow system clock changes), but is good for time + intervals. + + GetSystemTimeAsFileTime() follows system clock, but is low-resolution + and will result in lousy intervals. + */ + GetSystemTimeAsFileTime((PFILETIME)&starttime); +#endif + + rc_wrlock(rc); + if (rc->owners.elements == 0) + ret= WT_OK; + rc_unlock(rc); + + set_timespec_time_nsec(timeout, starttime, (*thd->timeout_short)*1000ULL); + if (ret == WT_TIMEOUT && !thd->killed) + ret= pthread_cond_timedwait(&rc->cond, mutex, &timeout); + if (ret == WT_TIMEOUT && !thd->killed) + { + int r= deadlock(thd, thd, 0, *thd->deadlock_search_depth_long); + if (r == WT_FREE_TO_GO) + ret= WT_OK; + else if (r != WT_OK) + ret= WT_DEADLOCK; + else if (*thd->timeout_long > *thd->timeout_short) + { + set_timespec_time_nsec(timeout, starttime, (*thd->timeout_long)*1000ULL); + if (!thd->killed) + ret= pthread_cond_timedwait(&rc->cond, mutex, &timeout); + } + } + after= my_getsystime(); + if (stop_waiting(thd) == WT_DEADLOCK) /* if we're killed */ + ret= WT_DEADLOCK; + increment_wait_stats(after-before, ret); + if (ret == WT_OK) + increment_success_stats(); + DBUG_RETURN(ret); +} + +/** + called by a *blocker* when it releases a resource + + it's conceptually similar to pthread_cond_broadcast, and must be done + under the same mutex as wt_thd_cond_timedwait(). + + @param resid a resource to release. 0 to release all resources +*/ + +void wt_thd_release(WT_THD *thd, const WT_RESOURCE_ID *resid) +{ + uint i; + DBUG_ENTER("wt_thd_release"); + + for (i= 0; i < thd->my_resources.elements; i++) + { + WT_RESOURCE *rc= *dynamic_element(&thd->my_resources, i, WT_RESOURCE**); + if (!resid || (resid->type->compare(&rc->id, resid) == 0)) + { + uint j; + + rc_wrlock(rc); + /* + nobody's trying to free the resource now, + as its owners[] array is not empty (at least thd must be there) + */ + DBUG_ASSERT(rc->state == ACTIVE); + for (j= 0; j < rc->owners.elements; j++) + if (*dynamic_element(&rc->owners, j, WT_THD**) == thd) + break; + DBUG_ASSERT(j < rc->owners.elements); + delete_dynamic_element(&rc->owners, j); + if (rc->owners.elements == 0) + { + pthread_cond_broadcast(&rc->cond); +#ifndef DBUG_OFF + if (rc->cond_mutex) + safe_mutex_assert_owner(rc->cond_mutex); +#endif + } + unlock_lock_and_free_resource(thd, rc); + if (resid) + { + delete_dynamic_element(&thd->my_resources, i); + DBUG_VOID_RETURN; + } + } + } + if (!resid) + reset_dynamic(&thd->my_resources); + DBUG_VOID_RETURN; +} + diff --git a/externals/mysql/mysys/wqueue.c b/externals/mysql/mysys/wqueue.c new file mode 100644 index 00000000000..fcc0a39725d --- /dev/null +++ b/externals/mysql/mysys/wqueue.c @@ -0,0 +1,225 @@ + +#include + +#define STRUCT_PTR(TYPE, MEMBER, a) \ + (TYPE *) ((char *) (a) - offsetof(TYPE, MEMBER)) +/* + Link a thread into double-linked queue of waiting threads. + + SYNOPSIS + wqueue_link_into_queue() + wqueue pointer to the queue structure + thread pointer to the thread to be added to the queue + + RETURN VALUE + none + + NOTES. + Queue is represented by a circular list of the thread structures + The list is double-linked of the type (**prev,*next), accessed by + a pointer to the last element. +*/ + +void wqueue_link_into_queue(WQUEUE *wqueue, struct st_my_thread_var *thread) +{ + struct st_my_thread_var *last; + if (!(last= wqueue->last_thread)) + { + /* Queue is empty */ + thread->next= thread; + thread->prev= &thread->next; + } + else + { + thread->prev= last->next->prev; + last->next->prev= &thread->next; + thread->next= last->next; + last->next= thread; + } + wqueue->last_thread= thread; +} + + +/* + Add a thread to single-linked queue of waiting threads + + SYNOPSIS + wqueue_add_to_queue() + wqueue pointer to the queue structure + thread pointer to the thread to be added to the queue + + RETURN VALUE + none + + NOTES. + Queue is represented by a circular list of the thread structures + The list is single-linked of the type (*next), accessed by a pointer + to the last element. +*/ + +void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread) +{ + struct st_my_thread_var *last; + if (!(last= wqueue->last_thread)) + thread->next= thread; + else + { + thread->next= last->next; + last->next= thread; + } +#ifndef DBUG_OFF + thread->prev= NULL; /* force segfault if used */ +#endif + wqueue->last_thread= thread; +} + +/* + Unlink a thread from double-linked queue of waiting threads + + SYNOPSIS + wqueue_unlink_from_queue() + wqueue pointer to the queue structure + thread pointer to the thread to be removed from the queue + + RETURN VALUE + none + + NOTES. + See NOTES for link_into_queue +*/ + +void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread) +{ + if (thread->next == thread) + /* The queue contains only one member */ + wqueue->last_thread= NULL; + else + { + thread->next->prev= thread->prev; + *thread->prev= thread->next; + if (wqueue->last_thread == thread) + wqueue->last_thread= STRUCT_PTR(struct st_my_thread_var, next, + thread->prev); + } + thread->next= NULL; +} + + +/* + Remove all threads from queue signaling them to proceed + + SYNOPSIS + wqueue_realease_queue() + wqueue pointer to the queue structure + thread pointer to the thread to be added to the queue + + RETURN VALUE + none + + NOTES. + See notes for add_to_queue + When removed from the queue each thread is signaled via condition + variable thread->suspend. +*/ + +void wqueue_release_queue(WQUEUE *wqueue) +{ + struct st_my_thread_var *last= wqueue->last_thread; + struct st_my_thread_var *next= last->next; + struct st_my_thread_var *thread; + do + { + thread= next; + pthread_cond_signal(&thread->suspend); + next= thread->next; + thread->next= NULL; + } + while (thread != last); + wqueue->last_thread= NULL; +} + + +/** + @brief Removes all threads waiting for read or first one waiting for write. + + @param wqueue pointer to the queue structure + @param thread pointer to the thread to be added to the queue + + @note This function is applicable only to single linked lists. +*/ + +void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue) +{ + struct st_my_thread_var *last= wqueue->last_thread; + struct st_my_thread_var *next= last->next; + struct st_my_thread_var *thread; + struct st_my_thread_var *new_list= NULL; + uint first_type= next->lock_type; + if (first_type == MY_PTHREAD_LOCK_WRITE) + { + /* release first waiting for write lock */ + pthread_cond_signal(&next->suspend); + if (next == last) + wqueue->last_thread= NULL; + else + last->next= next->next; + next->next= NULL; + return; + } + do + { + thread= next; + next= thread->next; + if (thread->lock_type == MY_PTHREAD_LOCK_WRITE) + { + /* skip waiting for write lock */ + if (new_list) + { + thread->next= new_list->next; + new_list= new_list->next= thread; + } + else + new_list= thread->next= thread; + } + else + { + /* release waiting for read lock */ + pthread_cond_signal(&thread->suspend); + thread->next= NULL; + } + } while (thread != last); + wqueue->last_thread= new_list; +} + + +/* + Add thread and wait + + SYNOPSYS + wqueue_add_and_wait() + wqueue queue to add to + thread thread which is waiting + lock mutex need for the operation +*/ + +void wqueue_add_and_wait(WQUEUE *wqueue, + struct st_my_thread_var *thread, + pthread_mutex_t *lock) +{ + DBUG_ENTER("wqueue_add_and_wait"); + DBUG_PRINT("enter", + ("thread: 0x%lx cond: 0x%lx mutex: 0x%lx", + (ulong) thread, (ulong) &thread->suspend, (ulong) lock)); + wqueue_add_to_queue(wqueue, thread); + do + { + DBUG_PRINT("info", ("wait... cond: 0x%lx mutex: 0x%lx", + (ulong) &thread->suspend, (ulong) lock)); + pthread_cond_wait(&thread->suspend, lock); + DBUG_PRINT("info", ("wait done cond: 0x%lx mutex: 0x%lx next: 0x%lx", + (ulong) &thread->suspend, (ulong) lock, + (ulong) thread->next)); + } + while (thread->next); + DBUG_VOID_RETURN; +} diff --git a/externals/mysql/mysys_err.h b/externals/mysql/mysys_err.h new file mode 100644 index 00000000000..7167395f71f --- /dev/null +++ b/externals/mysql/mysys_err.h @@ -0,0 +1,90 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _mysys_err_h +#define _mysys_err_h +#ifdef __cplusplus +extern "C" { +#endif + +#define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */ +#define EE(X) (globerrs[(X) - EE_ERROR_FIRST]) + +extern const char * NEAR globerrs[]; /* my_error_messages is here */ + +/* Error message numbers in global map */ +/* + Do not add error numbers before EE_ERROR_FIRST. + If necessary to add lower numbers, change EE_ERROR_FIRST accordingly. + + We start with error 1 to not confuse peoples with 'error 0' +*/ + +#define EE_ERROR_FIRST 1 /*Copy first error nr.*/ +#define EE_CANTCREATEFILE 1 +#define EE_READ 2 +#define EE_WRITE 3 +#define EE_BADCLOSE 4 +#define EE_OUTOFMEMORY 5 +#define EE_DELETE 6 +#define EE_LINK 7 +#define EE_EOFERR 9 +#define EE_CANTLOCK 10 +#define EE_CANTUNLOCK 11 +#define EE_DIR 12 +#define EE_STAT 13 +#define EE_CANT_CHSIZE 14 +#define EE_CANT_OPEN_STREAM 15 +#define EE_GETWD 16 +#define EE_SETWD 17 +#define EE_LINK_WARNING 18 +#define EE_OPEN_WARNING 19 +#define EE_DISK_FULL 20 +#define EE_CANT_MKDIR 21 +#define EE_UNKNOWN_CHARSET 22 +#define EE_OUT_OF_FILERESOURCES 23 +#define EE_CANT_READLINK 24 +#define EE_CANT_SYMLINK 25 +#define EE_REALPATH 26 +#define EE_SYNC 27 +#define EE_UNKNOWN_COLLATION 28 +#define EE_FILENOTFOUND 29 +#define EE_FILE_NOT_CLOSED 30 +#define EE_CANT_CHMOD 31 +#define EE_ERROR_LAST 31 /* Copy last error nr */ +/* Add error numbers before EE_ERROR_LAST and change it accordingly. */ + + /* exit codes for all MySQL programs */ + +#define EXIT_UNSPECIFIED_ERROR 1 +#define EXIT_UNKNOWN_OPTION 2 +#define EXIT_AMBIGUOUS_OPTION 3 +#define EXIT_NO_ARGUMENT_ALLOWED 4 +#define EXIT_ARGUMENT_REQUIRED 5 +#define EXIT_VAR_PREFIX_NOT_UNIQUE 6 +#define EXIT_UNKNOWN_VARIABLE 7 +#define EXIT_OUT_OF_MEMORY 8 +#define EXIT_UNKNOWN_SUFFIX 9 +#define EXIT_NO_PTR_TO_VARIABLE 10 +#define EXIT_CANNOT_CONNECT_TO_SERVICE 11 +#define EXIT_OPTION_DISABLED 12 +#define EXIT_ARGUMENT_INVALID 13 + + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/externals/mysql/queues.h b/externals/mysql/queues.h new file mode 100644 index 00000000000..d01b73ba999 --- /dev/null +++ b/externals/mysql/queues.h @@ -0,0 +1,72 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Code for generell handling of priority Queues. + Implemention of queues from "Algoritms in C" by Robert Sedgewick. + Copyright Monty Program KB. + By monty. +*/ + +#ifndef _queues_h +#define _queues_h +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct st_queue { + uchar **root; + void *first_cmp_arg; + uint elements; + uint max_elements; + uint offset_to_key; /* compare is done on element+offset */ + int max_at_top; /* Normally 1, set to -1 if queue_top gives max */ + int (*compare)(void *, uchar *,uchar *); + uint auto_extent; +} QUEUE; + +#define queue_top(queue) ((queue)->root[1]) +#define queue_element(queue,index) ((queue)->root[index+1]) +#define queue_end(queue) ((queue)->root[(queue)->elements]) +#define queue_replaced(queue) _downheap(queue,1) +#define queue_set_cmp_arg(queue, set_arg) (queue)->first_cmp_arg= set_arg +#define queue_set_max_at_top(queue, set_arg) \ + (queue)->max_at_top= set_arg ? -1 : 1 +typedef int (*queue_compare)(void *,uchar *, uchar *); + +int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key, + pbool max_at_top, queue_compare compare, + void *first_cmp_arg); +int init_queue_ex(QUEUE *queue,uint max_elements,uint offset_to_key, + pbool max_at_top, queue_compare compare, + void *first_cmp_arg, uint auto_extent); +int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key, + pbool max_at_top, queue_compare compare, + void *first_cmp_arg); +int resize_queue(QUEUE *queue, uint max_elements); +void delete_queue(QUEUE *queue); +void queue_insert(QUEUE *queue,uchar *element); +int queue_insert_safe(QUEUE *queue, uchar *element); +uchar *queue_remove(QUEUE *queue,uint idx); +#define queue_remove_all(queue) { (queue)->elements= 0; } +#define queue_is_full(queue) (queue->elements == queue->max_elements) +void _downheap(QUEUE *queue,uint idx); +void queue_fix(QUEUE *queue); +#define is_queue_inited(queue) ((queue)->root != 0) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/externals/mysql/service_versions.h b/externals/mysql/service_versions.h new file mode 100644 index 00000000000..114957cdd86 --- /dev/null +++ b/externals/mysql/service_versions.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef _WIN32 +#define SERVICE_VERSION __declspec(dllexport) void * +#else +#define SERVICE_VERSION void * +#endif + +#define VERSION_my_snprintf 0x0100 +#define VERSION_thd_alloc 0x0100 + diff --git a/externals/mysql/sha1.h b/externals/mysql/sha1.h new file mode 100644 index 00000000000..e476456a9bd --- /dev/null +++ b/externals/mysql/sha1.h @@ -0,0 +1,66 @@ +/* Copyright (C) 2002, 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This is the header file for code which implements the Secure + Hashing Algorithm 1 as defined in FIPS PUB 180-1 published + April 17, 1995. + + Many of the variable names in this code, especially the + single character names, were used because those were the names + used in the publication. + + Please read the file sha1.c for more information. + + Modified 2002 by Peter Zaitsev to better follow MySQL standards +*/ + + +enum sha_result_codes +{ + SHA_SUCCESS = 0, + SHA_NULL, /* Null pointer parameter */ + SHA_INPUT_TOO_LONG, /* input data too long */ + SHA_STATE_ERROR /* called Input after Result */ +}; + +#define SHA1_HASH_SIZE 20 /* Hash size in bytes */ + +/* + This structure will hold context information for the SHA-1 + hashing operation +*/ + +typedef struct SHA1_CONTEXT +{ + ulonglong Length; /* Message length in bits */ + uint32 Intermediate_Hash[SHA1_HASH_SIZE/4]; /* Message Digest */ + int Computed; /* Is the digest computed? */ + int Corrupted; /* Is the message digest corrupted? */ + int16 Message_Block_Index; /* Index into message block array */ + uint8 Message_Block[64]; /* 512-bit message blocks */ +} SHA1_CONTEXT; + +/* + Function Prototypes +*/ + +C_MODE_START + +int mysql_sha1_reset(SHA1_CONTEXT*); +int mysql_sha1_input(SHA1_CONTEXT*, const uint8 *, unsigned int); +int mysql_sha1_result(SHA1_CONTEXT* , uint8 Message_Digest[SHA1_HASH_SIZE]); + +C_MODE_END diff --git a/externals/mysql/sha2.h b/externals/mysql/sha2.h new file mode 100644 index 00000000000..49dbac56055 --- /dev/null +++ b/externals/mysql/sha2.h @@ -0,0 +1,72 @@ +/* Copyright (C) 2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef included_sha2_h +#define included_sha2_h + +#include + +#if defined(HAVE_YASSL) || defined(HAVE_OPENSSL) + +# ifdef HAVE_STDDEF_H +# include +# endif + +# ifndef HAVE_YASSL +# include + +# else + +#include "../extra/yassl/taocrypt/include/sha.hpp" + +# ifdef __cplusplus +extern "C" { +# endif + +#ifndef SHA512_DIGEST_LENGTH +#define SHA512_DIGEST_LENGTH TaoCrypt::SHA512::DIGEST_SIZE +#endif + +#ifndef SHA384_DIGEST_LENGTH +#define SHA384_DIGEST_LENGTH TaoCrypt::SHA384::DIGEST_SIZE +#endif + +#ifndef SHA256_DIGEST_LENGTH +#define SHA256_DIGEST_LENGTH TaoCrypt::SHA256::DIGEST_SIZE +#endif + +#ifndef SHA224_DIGEST_LENGTH +#define SHA224_DIGEST_LENGTH TaoCrypt::SHA224::DIGEST_SIZE +#endif + +#define GEN_YASSL_SHA2_BRIDGE(size) \ +unsigned char* SHA##size(const unsigned char *input_ptr, size_t input_length, \ + char unsigned *output_ptr); + +GEN_YASSL_SHA2_BRIDGE(512); +GEN_YASSL_SHA2_BRIDGE(384); +GEN_YASSL_SHA2_BRIDGE(256); +GEN_YASSL_SHA2_BRIDGE(224); + +#undef GEN_YASSL_SHA2_BRIDGE + +# ifdef __cplusplus +} +# endif + +# endif /* HAVE_YASSL */ + +#endif /* HAVE_OPENSSL || HAVE_YASSL */ +#endif /* included_sha2_h */ diff --git a/externals/mysql/sql_common.h b/externals/mysql/sql_common.h new file mode 100644 index 00000000000..9e43d076ba9 --- /dev/null +++ b/externals/mysql/sql_common.h @@ -0,0 +1,50 @@ +/* Copyright (C) 2003-2004, 2006 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +extern const char *unknown_sqlstate; +extern const char *cant_connect_sqlstate; +extern const char *not_error_sqlstate; + +#ifdef __cplusplus +extern "C" { +#endif + +extern CHARSET_INFO *default_client_charset_info; +MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, + my_bool default_value, uint server_capabilities); +void free_rows(MYSQL_DATA *cur); +void free_old_query(MYSQL *mysql); +void end_server(MYSQL *mysql); +my_bool mysql_reconnect(MYSQL *mysql); +void mysql_read_default_options(struct st_mysql_options *options, + const char *filename,const char *group); +my_bool +cli_advanced_command(MYSQL *mysql, enum enum_server_command command, + const unsigned char *header, ulong header_length, + const unsigned char *arg, ulong arg_length, + my_bool skip_check, MYSQL_STMT *stmt); +unsigned long cli_safe_read(MYSQL *mysql); +void net_clear_error(NET *net); +void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net); +void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate, + const char *err); +void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate); +#ifdef __cplusplus +} +#endif + +#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41) + diff --git a/externals/mysql/sslopt-case.h b/externals/mysql/sslopt-case.h new file mode 100644 index 00000000000..ee6c83cd2a0 --- /dev/null +++ b/externals/mysql/sslopt-case.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + case OPT_SSL_KEY: + case OPT_SSL_CERT: + case OPT_SSL_CA: + case OPT_SSL_CAPATH: + case OPT_SSL_CIPHER: + /* + Enable use of SSL if we are using any ssl option + One can disable SSL later by using --skip-ssl or --ssl=0 + */ + opt_use_ssl= 1; + break; +#endif diff --git a/externals/mysql/sslopt-longopts.h b/externals/mysql/sslopt-longopts.h new file mode 100644 index 00000000000..06422e5917d --- /dev/null +++ b/externals/mysql/sslopt-longopts.h @@ -0,0 +1,45 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + + {"ssl", OPT_SSL_SSL, + "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.", + (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, + 0, 0, 0}, + {"ssl-ca", OPT_SSL_CA, + "CA file in PEM format (check OpenSSL docs, implies --ssl).", + (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-capath", OPT_SSL_CAPATH, + "CA directory (check OpenSSL docs, implies --ssl).", + (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).", + (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).", + (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).", + (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, +#ifdef MYSQL_CLIENT + {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, + "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.", + (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/sslopt-vars.h b/externals/mysql/sslopt-vars.h new file mode 100644 index 00000000000..9d25c3364ed --- /dev/null +++ b/externals/mysql/sslopt-vars.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) +#ifdef SSL_VARS_NOT_STATIC +#define SSL_STATIC +#else +#define SSL_STATIC static +#endif +SSL_STATIC my_bool opt_use_ssl = 0; +SSL_STATIC char *opt_ssl_ca = 0; +SSL_STATIC char *opt_ssl_capath = 0; +SSL_STATIC char *opt_ssl_cert = 0; +SSL_STATIC char *opt_ssl_cipher = 0; +SSL_STATIC char *opt_ssl_key = 0; +#ifdef MYSQL_CLIENT +SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; +#endif +#endif diff --git a/externals/mysql/strings/bchange.c b/externals/mysql/strings/bchange.c new file mode 100644 index 00000000000..0b2c62019b5 --- /dev/null +++ b/externals/mysql/strings/bchange.c @@ -0,0 +1,38 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : bchange.c + Author : Michael widenius + Updated: 1987-03-20 + Defines: bchange() + + bchange(dst, old_length, src, new_length, tot_length) + replaces old_length characters at dst to new_length characters from + src in a buffer with tot_length bytes. +*/ + +#include +#include "m_string.h" + +void bchange(register uchar *dst, size_t old_length, register const uchar *src, + size_t new_length, size_t tot_length) +{ + size_t rest=tot_length-old_length; + if (old_length < new_length) + bmove_upp(dst+rest+new_length,dst+tot_length,rest); + else + bmove(dst+new_length,dst+old_length,rest); + memcpy(dst,src,new_length); +} diff --git a/externals/mysql/strings/bcmp.c b/externals/mysql/strings/bcmp.c new file mode 100644 index 00000000000..1b6ed22fc22 --- /dev/null +++ b/externals/mysql/strings/bcmp.c @@ -0,0 +1,66 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + bcmp(s1, s2, len) returns 0 if the "len" bytes starting at "s1" are + identical to the "len" bytes starting at "s2", non-zero if they are + different. + Now only used with purify because purify gives wrong warnings when + comparing a shorter string with bcmp. +*/ + +#include +#include "m_string.h" + +#ifdef HAVE_purify +#undef bcmp +#undef HAVE_BCMP +#endif + +#if !defined(bcmp) && !defined(HAVE_BCMP) + +#if defined(MC68000) && defined(DS90) + +int bcmp(s1,s2, len) +const char *s1; +const char *s2; +uint len; /* 0 <= len <= 65535 */ +{ + asm(" movl 12(a7),d0 "); + asm(" subqw #1,d0 "); + asm(" blt .L5 "); + asm(" movl 4(a7),a1 "); + asm(" movl 8(a7),a0 "); + asm(".L4: cmpmb (a0)+,(a1)+ "); + asm(" dbne d0,.L4 "); + asm(".L5: addqw #1,d0 "); +} + +#else + +#ifndef HAVE_purify +size_t bcmp(register const uchar *s1,register const uchar *s2, + register size_t len) +#else +size_t my_bcmp(register const uchar *s1,register const uchar *s2, + register size_t len) +#endif +{ + while (len-- != 0 && *s1++ == *s2++) ; + return len+1; +} + +#endif +#endif /* BSD_FUNCS */ diff --git a/externals/mysql/strings/bfill.c b/externals/mysql/strings/bfill.c new file mode 100644 index 00000000000..2750553f48a --- /dev/null +++ b/externals/mysql/strings/bfill.c @@ -0,0 +1,98 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* File : bfill.c + Author : Richard A. O'Keefe. + Michael Widenius; ifdef MC68000 + Updated: 23 April 1984 + Defines: bfill() + + bfill(dst, len, fill) moves "len" fill characters to "dst". + Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' '). + + Note: the "b" routines are there to exploit certain VAX order codes, + but the MOVC5 instruction will only move 65535 characters. The asm + code is presented for your interest and amusement. +*/ + +#include +#include "m_string.h" + +#if !defined(bfill) && !defined(HAVE_BFILL) + +#if VaxAsm + +void bfill(dst, len, fill) +char *dst; +uint len; +int fill; /* actually char */ +{ + asm("movc5 $0,*4(ap),12(ap),8(ap),*4(ap)"); +} + +#elif defined(MC68000) && defined(DS90) + +void bfill(dst, len,fill) /* Optimized with long-fill */ +char *dst; +uint len; +pchar fill; +{ +asm(" movl 8.(a7),d1 "); +asm(" jeq .L9 "); +asm(" movl 4.(a7),a0 "); +asm(" moveq #0,d0 "); +asm(" movb 15.(a7),d0 "); +asm(" movl d2,a1 "); +asm(" movw d0,d2 "); +asm(" aslw #8,d0 "); +asm(" orw d2,d0 "); +asm(" movl d0,d2 "); +asm(" swap d0 "); +asm(" orl d2,d0 "); +asm(" movl a0,d2 "); +asm(" btst #0,d2 "); +asm(" jeq .L1 "); +asm(" movb d0,(a0)+ "); +asm(" subql #1,d1 "); +asm(".L1: movl d1,d2 "); +asm(" lsrl #2,d2 "); +asm(" jcc .L2 "); +asm(" movw d0,(a0)+ "); +asm(" jra .L2 "); +asm(".L3: movl d0,(a0)+ "); +asm(".L2: dbra d2,.L3 "); +asm(" addqw #1,d2 "); +asm(" subql #1,d2 "); +asm(" jcc .L3 "); +asm(" andl #1,d1 "); +asm(" jeq .L8 "); +asm(" movb d0,(a0) "); +asm(".L8: movl a1,d2 "); +asm(".L9: rts "); +} +#else + +void bfill(dst, len, fill) +register byte *dst; +register uint len; +register pchar fill; +{ + while (len-- != 0) *dst++ = fill; +} + +#endif +#endif diff --git a/externals/mysql/strings/bmove.c b/externals/mysql/strings/bmove.c new file mode 100644 index 00000000000..ae9641a5d58 --- /dev/null +++ b/externals/mysql/strings/bmove.c @@ -0,0 +1,80 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* File : bmove.c + Author : Richard A. O'Keefe. + Michael Widenius; ifdef MC68000 + Updated: 23 April 1984 + Defines: bmove() + + bmove(dst, src, len) moves exactly "len" bytes from the source "src" + to the destination "dst". It does not check for NUL characters as + strncpy() and strnmov() do. Thus if your C compiler doesn't support + structure assignment, you can simulate it with + bmove(&to, &from, sizeof from); + The standard 4.2bsd routine for this purpose is bcopy. But as bcopy + has its first two arguments the other way around you may find this a + bit easier to get right. + No value is returned. + + Note: the "b" routines are there to exploit certain VAX order codes, + but the MOVC3 instruction will only move 65535 characters. The asm + code is presented for your interest and amusement. +*/ + +#include +#include "m_string.h" + +#if !defined(HAVE_BMOVE) && !defined(bmove) + +#if VaxAsm + +void bmove(dst, src, len) + char *dst, *src; + uint len; + { + asm("movc3 12(ap),*8(ap),*4(ap)"); + } + +#else +#if defined(MC68000) && defined(DS90) + +void bmove(dst, src, len) +char *dst,*src; +uint len; /* 0 <= len <= 65535 */ +{ +asm(" movl 12(a7),d0 "); +asm(" subql #1,d0 "); +asm(" blt .L5 "); +asm(" movl 4(a7),a1 "); +asm(" movl 8(a7),a0 "); +asm(".L4: movb (a0)+,(a1)+ "); +asm(" dbf d0,.L4 "); +asm(".L5: "); +} +#else + +void bmove(dst, src, len) +register char *dst; +register const char *src; +register uint len; +{ + while (len-- != 0) *dst++ = *src++; +} +#endif +#endif +#endif diff --git a/externals/mysql/strings/bmove512.c b/externals/mysql/strings/bmove512.c new file mode 100644 index 00000000000..0ae23d1f42d --- /dev/null +++ b/externals/mysql/strings/bmove512.c @@ -0,0 +1,125 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : bmove512.c + Author : Michael Widenius; + Defines: bmove512() + + bmove512(dst, src, len) moves exactly "len" bytes from the source "src" + to the destination "dst". "src" and "dst" must be alligned on long + boundory and len must be a mutliple of 512 byte. If len is not a + multiple of 512 byte len/512*512+1 bytes is copyed. + bmove512 is moustly used to copy IO_BLOCKS. bmove512 should be the + fastest way to move a mutiple of 512 byte. +*/ + +#include +#include "m_string.h" + +#ifndef bmove512 + +#ifdef HAVE_LONG_LONG +#define LONG ulonglong +#else +#define LONG ulong +#endif + +void bmove512(uchar *to, const uchar *from, register size_t length) +{ + reg1 LONG *f,*t,*end= (LONG*) ((char*) from+length); + + f= (LONG*) from; + t= (LONG*) to; + +#if defined(m88k) || defined(sparc) || defined(HAVE_LONG_LONG) + do { + t[0]=f[0]; t[1]=f[1]; t[2]=f[2]; t[3]=f[3]; + t[4]=f[4]; t[5]=f[5]; t[6]=f[6]; t[7]=f[7]; + t[8]=f[8]; t[9]=f[9]; t[10]=f[10]; t[11]=f[11]; + t[12]=f[12]; t[13]=f[13]; t[14]=f[14]; t[15]=f[15]; + t[16]=f[16]; t[17]=f[17]; t[18]=f[18]; t[19]=f[19]; + t[20]=f[20]; t[21]=f[21]; t[22]=f[22]; t[23]=f[23]; + t[24]=f[24]; t[25]=f[25]; t[26]=f[26]; t[27]=f[27]; + t[28]=f[28]; t[29]=f[29]; t[30]=f[30]; t[31]=f[31]; + t[32]=f[32]; t[33]=f[33]; t[34]=f[34]; t[35]=f[35]; + t[36]=f[36]; t[37]=f[37]; t[38]=f[38]; t[39]=f[39]; + t[40]=f[40]; t[41]=f[41]; t[42]=f[42]; t[43]=f[43]; + t[44]=f[44]; t[45]=f[45]; t[46]=f[46]; t[47]=f[47]; + t[48]=f[48]; t[49]=f[49]; t[50]=f[50]; t[51]=f[51]; + t[52]=f[52]; t[53]=f[53]; t[54]=f[54]; t[55]=f[55]; + t[56]=f[56]; t[57]=f[57]; t[58]=f[58]; t[59]=f[59]; + t[60]=f[60]; t[61]=f[61]; t[62]=f[62]; t[63]=f[63]; +#ifdef HAVE_LONG_LONG + t+=64; f+=64; +#else + t[64]=f[64]; t[65]=f[65]; t[66]=f[66]; t[67]=f[67]; + t[68]=f[68]; t[69]=f[69]; t[70]=f[70]; t[71]=f[71]; + t[72]=f[72]; t[73]=f[73]; t[74]=f[74]; t[75]=f[75]; + t[76]=f[76]; t[77]=f[77]; t[78]=f[78]; t[79]=f[79]; + t[80]=f[80]; t[81]=f[81]; t[82]=f[82]; t[83]=f[83]; + t[84]=f[84]; t[85]=f[85]; t[86]=f[86]; t[87]=f[87]; + t[88]=f[88]; t[89]=f[89]; t[90]=f[90]; t[91]=f[91]; + t[92]=f[92]; t[93]=f[93]; t[94]=f[94]; t[95]=f[95]; + t[96]=f[96]; t[97]=f[97]; t[98]=f[98]; t[99]=f[99]; + t[100]=f[100]; t[101]=f[101]; t[102]=f[102]; t[103]=f[103]; + t[104]=f[104]; t[105]=f[105]; t[106]=f[106]; t[107]=f[107]; + t[108]=f[108]; t[109]=f[109]; t[110]=f[110]; t[111]=f[111]; + t[112]=f[112]; t[113]=f[113]; t[114]=f[114]; t[115]=f[115]; + t[116]=f[116]; t[117]=f[117]; t[118]=f[118]; t[119]=f[119]; + t[120]=f[120]; t[121]=f[121]; t[122]=f[122]; t[123]=f[123]; + t[124]=f[124]; t[125]=f[125]; t[126]=f[126]; t[127]=f[127]; + t+=128; f+=128; +#endif + } while (f < end); +#else + do { + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + *t++ = *f++; *t++ = *f++; *t++ = *f++; *t++ = *f++; + } while (f < end); +#endif + return; +} /* bmove512 */ + +#endif /* bmove512 */ diff --git a/externals/mysql/strings/bmove_upp.c b/externals/mysql/strings/bmove_upp.c new file mode 100644 index 00000000000..fb47bda2d1d --- /dev/null +++ b/externals/mysql/strings/bmove_upp.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : bmove.c + Author : Michael widenius + Updated: 1987-03-20 + Defines: bmove_upp() + + bmove_upp(dst, src, len) moves exactly "len" bytes from the source + "src-len" to the destination "dst-len" counting downwards. +*/ + +#include +#include "m_string.h" + +#if defined(MC68000) && defined(DS90) + +/* 0 <= len <= 65535 */ +void bmove_upp(byte *dst, const byte *src,uint len) +{ +asm(" movl 12(a7),d0 "); +asm(" subql #1,d0 "); +asm(" blt .L5 "); +asm(" movl 4(a7),a1 "); +asm(" movl 8(a7),a0 "); +asm(".L4: movb -(a0),-(a1) "); +asm(" dbf d0,.L4 "); +asm(".L5: "); +} +#else + +void bmove_upp(register uchar *dst, register const uchar *src, + register size_t len) +{ + while (len-- != 0) *--dst = *--src; +} + +#endif diff --git a/externals/mysql/strings/conf_to_src.c b/externals/mysql/strings/conf_to_src.c new file mode 100644 index 00000000000..fd5d3f432f5 --- /dev/null +++ b/externals/mysql/strings/conf_to_src.c @@ -0,0 +1,358 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include + +#define ROW_LEN 16 +#define ROW16_LEN 8 +#define MAX_BUF 64*1024 + +static CHARSET_INFO all_charsets[512]; + + +void +print_array(FILE *f, const char *set, const char *name, uchar *a, int n) +{ + int i; + + fprintf(f,"uchar %s_%s[] = {\n", name, set); + + for (i=0 ;iname && !strcmp(cs->name, charset_name)) + return cs->number; + } + return 0; +} + +char *mdup(const char *src, uint len) +{ + char *dst=(char*)malloc(len); + if (!dst) + exit(1); + memcpy(dst,src,len); + return dst; +} + +static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) +{ + to->number= from->number ? from->number : to->number; + to->state|= from->state; + + if (from->csname) + to->csname= strdup(from->csname); + + if (from->name) + to->name= strdup(from->name); + + if (from->ctype) + to->ctype= (uchar*) mdup((char*) from->ctype, MY_CS_CTYPE_TABLE_SIZE); + if (from->to_lower) + to->to_lower= (uchar*) mdup((char*) from->to_lower, MY_CS_TO_LOWER_TABLE_SIZE); + if (from->to_upper) + to->to_upper= (uchar*) mdup((char*) from->to_upper, MY_CS_TO_UPPER_TABLE_SIZE); + if (from->sort_order) + { + to->sort_order= (uchar*) mdup((char*) from->sort_order, MY_CS_SORT_ORDER_TABLE_SIZE); + /* + set_max_sort_char(to); + */ + } + if (from->tab_to_uni) + { + uint sz= MY_CS_TO_UNI_TABLE_SIZE*sizeof(uint16); + to->tab_to_uni= (uint16*) mdup((char*)from->tab_to_uni, sz); + /* + create_fromuni(to); + */ + } +} + +static my_bool simple_cs_is_full(CHARSET_INFO *cs) +{ + return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper && + cs->to_lower) && + (cs->number && cs->name && + (cs->sort_order || (cs->state & MY_CS_BINSORT)))); +} + +static int add_collation(CHARSET_INFO *cs) +{ + if (cs->name && (cs->number || (cs->number=get_charset_number(cs->name)))) + { + if (!(all_charsets[cs->number].state & MY_CS_COMPILED)) + { + simple_cs_copy_data(&all_charsets[cs->number],cs); + + } + + cs->number= 0; + cs->name= NULL; + cs->state= 0; + cs->sort_order= NULL; + cs->state= 0; + } + return MY_XML_OK; +} + + +static int my_read_charset_file(const char *filename) +{ + char buf[MAX_BUF]; + int fd; + uint len; + + if ((fd=open(filename,O_RDONLY)) < 0) + { + fprintf(stderr,"Can't open '%s'\n",filename); + return 1; + } + + len=read(fd,buf,MAX_BUF); + DBUG_ASSERT(len < MAX_BUF); + close(fd); + + if (my_parse_charset_xml(buf,len,add_collation)) + { +#if 0 + printf("ERROR at line %d pos %d '%s'\n", + my_xml_error_lineno(&p)+1, + my_xml_error_pos(&p), + my_xml_error_string(&p)); +#endif + } + + return FALSE; +} + +static int +is_case_sensitive(CHARSET_INFO *cs) +{ + return (cs->sort_order && + cs->sort_order['A'] < cs->sort_order['a'] && + cs->sort_order['a'] < cs->sort_order['B']) ? 1 : 0; +} + + +void dispcset(FILE *f,CHARSET_INFO *cs) +{ + fprintf(f,"{\n"); + fprintf(f," %d,%d,%d,\n",cs->number,0,0); + fprintf(f," MY_CS_COMPILED%s%s%s%s%s,\n", + cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "", + cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "", + is_case_sensitive(cs) ? "|MY_CS_CSSORT" : "", + my_charset_is_8bit_pure_ascii(cs) ? "|MY_CS_PUREASCII" : "", + !my_charset_is_ascii_compatible(cs) ? "|MY_CS_NONASCII": ""); + + if (cs->name) + { + fprintf(f," \"%s\", /* cset name */\n",cs->csname); + fprintf(f," \"%s\", /* coll name */\n",cs->name); + fprintf(f," \"\", /* comment */\n"); + fprintf(f," NULL, /* tailoring */\n"); + fprintf(f," ctype_%s, /* ctype */\n",cs->name); + fprintf(f," to_lower_%s, /* lower */\n",cs->name); + fprintf(f," to_upper_%s, /* upper */\n",cs->name); + if (cs->sort_order) + fprintf(f," sort_order_%s, /* sort_order */\n",cs->name); + else + fprintf(f," NULL, /* sort_order */\n"); + fprintf(f," NULL, /* contractions */\n"); + fprintf(f," NULL, /* sort_order_big*/\n"); + fprintf(f," to_uni_%s, /* to_uni */\n",cs->name); + } + else + { + fprintf(f," NULL, /* cset name */\n"); + fprintf(f," NULL, /* coll name */\n"); + fprintf(f," NULL, /* comment */\n"); + fprintf(f," NULL, /* tailoging */\n"); + fprintf(f," NULL, /* ctype */\n"); + fprintf(f," NULL, /* lower */\n"); + fprintf(f," NULL, /* upper */\n"); + fprintf(f," NULL, /* sort order */\n"); + fprintf(f," NULL, /* contractions */\n"); + fprintf(f," NULL, /* sort_order_big*/\n"); + fprintf(f," NULL, /* to_uni */\n"); + } + + fprintf(f," NULL, /* from_uni */\n"); + fprintf(f," my_unicase_default, /* caseinfo */\n"); + fprintf(f," NULL, /* state map */\n"); + fprintf(f," NULL, /* ident map */\n"); + fprintf(f," 1, /* strxfrm_multiply*/\n"); + fprintf(f," 1, /* caseup_multiply*/\n"); + fprintf(f," 1, /* casedn_multiply*/\n"); + fprintf(f," 1, /* mbminlen */\n"); + fprintf(f," 1, /* mbmaxlen */\n"); + fprintf(f," 0, /* min_sort_char */\n"); + fprintf(f," 255, /* max_sort_char */\n"); + fprintf(f," ' ', /* pad_char */\n"); + fprintf(f," 0, /* escape_with_backslash_is_dangerous */\n"); + fprintf(f," 1, /* levels_for_compare */\n"); + fprintf(f," 1, /* levels_for_order */\n"); + + fprintf(f," &my_charset_8bit_handler,\n"); + if (cs->state & MY_CS_BINSORT) + fprintf(f," &my_collation_8bit_bin_handler,\n"); + else + fprintf(f," &my_collation_8bit_simple_ci_handler,\n"); + fprintf(f,"}\n"); +} + + +static void +fprint_copyright(FILE *file) +{ + fprintf(file, +"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n" +"\n" +" This program is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; version 2 of the License.\n" +"\n" +" This program is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with this program; if not, write to the Free Software\n" +" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */\n" +"\n"); +} + + +int +main(int argc, char **argv __attribute__((unused))) +{ + CHARSET_INFO ncs; + CHARSET_INFO *cs; + char filename[256]; + FILE *f= stdout; + + if (argc < 2) + { + fprintf(stderr, "usage: %s source-dir\n", argv[0]); + exit(EXIT_FAILURE); + } + + bzero((void*)&ncs,sizeof(ncs)); + bzero((void*)&all_charsets,sizeof(all_charsets)); + + sprintf(filename,"%s/%s",argv[1],"Index.xml"); + my_read_charset_file(filename); + + for (cs= all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if (cs->number && !(cs->state & MY_CS_COMPILED)) + { + if ( (!simple_cs_is_full(cs)) && (cs->csname)) + { + sprintf(filename,"%s/%s.xml",argv[1],cs->csname); + my_read_charset_file(filename); + } + } + } + + fprintf(f, "/*\n"); + fprintf(f, " This file was generated by the conf_to_src utility. " + "Do not edit it directly,\n"); + fprintf(f, " edit the XML definitions in sql/share/charsets/ instead.\n\n"); + fprintf(f, " To re-generate, run the following in the strings/ " + "directory:\n"); + fprintf(f, " ./conf_to_src ../sql/share/charsets/ > FILE\n"); + fprintf(f, "*/\n\n"); + fprint_copyright(f); + fprintf(f,"#include \n"); + fprintf(f,"#include \n\n"); + + + for (cs= all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if (simple_cs_is_full(cs)) + { + fprintf(f,"#ifdef HAVE_CHARSET_%s\n",cs->csname); + print_array(f, cs->name, "ctype", cs->ctype, MY_CS_CTYPE_TABLE_SIZE); + print_array(f, cs->name, "to_lower", cs->to_lower, MY_CS_TO_LOWER_TABLE_SIZE); + print_array(f, cs->name, "to_upper", cs->to_upper, MY_CS_TO_UPPER_TABLE_SIZE); + if (cs->sort_order) + print_array(f, cs->name, "sort_order", cs->sort_order, MY_CS_SORT_ORDER_TABLE_SIZE); + print_array16(f, cs->name, "to_uni", cs->tab_to_uni, MY_CS_TO_UNI_TABLE_SIZE); + fprintf(f,"#endif\n"); + fprintf(f,"\n"); + } + } + + fprintf(f,"CHARSET_INFO compiled_charsets[] = {\n"); + for (cs= all_charsets; + cs < all_charsets + array_elements(all_charsets); + cs++) + { + if (simple_cs_is_full(cs)) + { + fprintf(f,"#ifdef HAVE_CHARSET_%s\n",cs->csname); + dispcset(f,cs); + fprintf(f,",\n"); + fprintf(f,"#endif\n"); + } + } + + dispcset(f,&ncs); + fprintf(f,"};\n"); + + return 0; +} diff --git a/externals/mysql/strings/ctype-big5.c b/externals/mysql/strings/ctype-big5.c new file mode 100644 index 00000000000..caf4af577b8 --- /dev/null +++ b/externals/mysql/strings/ctype-big5.c @@ -0,0 +1,6407 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + * This file is basicly usa7 character sets with some extra functions + * for big5 handling +*/ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_big5=1 + * .configure. mbmaxlen_big5=2 + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_big5 + +/* + Support for Chinese(BIG5) characters, by jou@nematic.ieo.nctu.edu.tw + modified by Wei He (hewei@mail.ied.ac.cn) + modified by Alex Barkov +*/ + +#define isbig5head(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xf9) +#define isbig5tail(c) ((0x40<=(uchar)(c) && (uchar)(c)<=0x7e) || \ + (0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) + +#define isbig5code(c,d) (isbig5head(c) && isbig5tail(d)) +#define big5code(c,d) (((uchar)(c) <<8) | (uchar)(d)) +#define big5head(e) ((uchar)(e>>8)) +#define big5tail(e) ((uchar)(e&0xff)) + +static uchar NEAR ctype_big5[257] = +{ + 0, /* For standard library */ + 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 132,132,132,132,132,132,132,132,132,132,16,16,16,16,16,16, + 16,129,129,129,129,129,129,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,16,16,16,16,16, + 16,130,130,130,130,130,130,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,16,16,16,16,32, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, +}; + +static uchar NEAR to_lower_big5[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR to_upper_big5[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR sort_order_big5[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '\\', ']', '[', '^', '_', + 0x60, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', 0x7E, '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uint16 big5strokexfrm(uint16 i) +{ + if ((i == 0xA440) || (i == 0xA441)) return 0xA440; + else if (((i >= 0xA442) && (i <= 0xA453)) || ((i >= 0xC940) && (i <= 0xC944))) return 0xA442; + else if (((i >= 0xA454) && (i <= 0xA47E)) || ((i >= 0xC945) && (i <= 0xC94C))) return 0xA454; + else if (((i >= 0xA4A1) && (i <= 0xA4FD)) || ((i >= 0xC94D) && (i <= 0xC962))) return 0xA4A1; + else if (((i >= 0xA4FE) && (i <= 0xA5DF)) || ((i >= 0xC963) && (i <= 0xC9AA))) return 0xA4FE; + else if (((i >= 0xA5E0) && (i <= 0xA6E9)) || ((i >= 0xC9AB) && (i <= 0xCA59))) return 0xA5E0; + else if (((i >= 0xA6EA) && (i <= 0xA8C2)) || ((i >= 0xCA5A) && (i <= 0xCBB0))) return 0xA6EA; + else if ((i == 0xA260) || ((i >= 0xA8C3) && (i <= 0xAB44)) || ((i >= 0xCBB1) && (i <= 0xCDDC))) return 0xA8C3; + else if ((i == 0xA259) || (i == 0xF9DA) || ((i >= 0xAB45) && (i <= 0xADBB)) || ((i >= 0xCDDD) && (i <= 0xD0C7))) return 0xAB45; + else if ((i == 0xA25A) || ((i >= 0xADBC) && (i <= 0xB0AD)) || ((i >= 0xD0C8) && (i <= 0xD44A))) return 0xADBC; + else if ((i == 0xA25B) || (i == 0xA25C) || ((i >= 0xB0AE) && (i <= 0xB3C2)) || ((i >= 0xD44B) && (i <= 0xD850))) return 0xB0AE; + else if ((i == 0xF9DB) || ((i >= 0xB3C3) && (i <= 0xB6C2)) || ((i >= 0xD851) && (i <= 0xDCB0))) return 0xB3C3; + else if ((i == 0xA25D) || (i == 0xA25F) || (i == 0xC6A1) || (i == 0xF9D6) || (i == 0xF9D8) || ((i >= 0xB6C3) && (i <= 0xB9AB)) || ((i >= 0xDCB1) && (i <= 0xE0EF))) return 0xB6C3; + else if ((i == 0xF9DC) || ((i >= 0xB9AC) && (i <= 0xBBF4)) || ((i >= 0xE0F0) && (i <= 0xE4E5))) return 0xB9AC; + else if ((i == 0xA261) || ((i >= 0xBBF5) && (i <= 0xBEA6)) || ((i >= 0xE4E6) && (i <= 0xE8F3))) return 0xBBF5; + else if ((i == 0xA25E) || (i == 0xF9D7) || (i == 0xF9D9) || ((i >= 0xBEA7) && (i <= 0xC074)) || ((i >= 0xE8F4) && (i <= 0xECB8))) return 0xBEA7; + else if (((i >= 0xC075) && (i <= 0xC24E)) || ((i >= 0xECB9) && (i <= 0xEFB6))) return 0xC075; + else if (((i >= 0xC24F) && (i <= 0xC35E)) || ((i >= 0xEFB7) && (i <= 0xF1EA))) return 0xC24F; + else if (((i >= 0xC35F) && (i <= 0xC454)) || ((i >= 0xF1EB) && (i <= 0xF3FC))) return 0xC35F; + else if (((i >= 0xC455) && (i <= 0xC4D6)) || ((i >= 0xF3FD) && (i <= 0xF5BF))) return 0xC455; + else if (((i >= 0xC4D7) && (i <= 0xC56A)) || ((i >= 0xF5C0) && (i <= 0xF6D5))) return 0xC4D7; + else if (((i >= 0xC56B) && (i <= 0xC5C7)) || ((i >= 0xF6D6) && (i <= 0xF7CF))) return 0xC56B; + else if (((i >= 0xC5C8) && (i <= 0xC5F0)) || ((i >= 0xF7D0) && (i <= 0xF8A4))) return 0xC5C8; + else if (((i >= 0xC5F1) && (i <= 0xC654)) || ((i >= 0xF8A5) && (i <= 0xF8ED))) return 0xC5F1; + else if (((i >= 0xC655) && (i <= 0xC664)) || ((i >= 0xF8EE) && (i <= 0xF96A))) return 0xC655; + else if (((i >= 0xC665) && (i <= 0xC66B)) || ((i >= 0xF96B) && (i <= 0xF9A1))) return 0xC665; + else if (((i >= 0xC66C) && (i <= 0xC675)) || ((i >= 0xF9A2) && (i <= 0xF9B9))) return 0xC66C; + else if (((i >= 0xC676) && (i <= 0xC678)) || ((i >= 0xF9BA) && (i <= 0xF9C5))) return 0xC676; + else if (((i >= 0xC679) && (i <= 0xC67C)) || ((i >= 0xF9C7) && (i <= 0xF9CB))) return 0xC679; + else if ((i == 0xC67D) || ((i >= 0xF9CC) && (i <= 0xF9CF))) return 0xC67D; + else if (i == 0xF9D0) return 0xF9D0; + else if ((i == 0xC67E) || (i == 0xF9D1)) return 0xC67E; + else if ((i == 0xF9C6) || (i == 0xF9D2)) return 0xF9C6; + else if (i == 0xF9D3) return 0xF9D3; + else if (i == 0xF9D4) return 0xF9D4; + else if (i == 0xF9D5) return 0xF9D5; + return 0xA140; +} + + + +static int my_strnncoll_big5_internal(const uchar **a_res, + const uchar **b_res, size_t length) +{ + const uchar *a= *a_res, *b= *b_res; + + while (length--) + { + if ((length > 0) && isbig5code(*a,*(a+1)) && isbig5code(*b, *(b+1))) + { + if (*a != *b || *(a+1) != *(b+1)) + return ((int) big5code(*a,*(a+1)) - + (int) big5code(*b,*(b+1))); + a+= 2; + b+= 2; + length--; + } + else if (sort_order_big5[*a++] != + sort_order_big5[*b++]) + return ((int) sort_order_big5[a[-1]] - + (int) sort_order_big5[b[-1]]); + } + *a_res= a; + *b_res= b; + return 0; +} + + +/* Compare strings */ + +static int my_strnncoll_big5(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool b_is_prefix) +{ + size_t length= min(a_length, b_length); + int res= my_strnncoll_big5_internal(&a, &b, length); + return res ? res : (int)((b_is_prefix ? length : a_length) - b_length); +} + + +/* compare strings, ignore end space */ + +static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + size_t length= min(a_length, b_length); + int res= my_strnncoll_big5_internal(&a, &b, length); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + if (!res && a_length != b_length) + { + const uchar *end; + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a_length < b_length) + { + /* put longer key in a */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (end= a + a_length-length; a < end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + } + return res; +} + + +static size_t +my_strnxfrm_big5(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + uchar *de= dst + dstlen; + const uchar *se= src + srclen; + const uchar *sort_order= cs->sort_order; + + for (; dst < de && src < se && nweights; nweights--) + { + if (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) + { + /* + Note, it is safe not to check (src < se) + in the code below, because ismbchar() would + not return TRUE if src was too short + */ + uint16 e= big5strokexfrm((uint16) big5code(*src, *(src + 1))); + *dst++= big5head(e); + if (dst < de) + *dst++= big5tail(e); + src+= 2; + } + else + *dst++= sort_order ? sort_order[*src++] : *src++; + } + return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); +} + + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +#define max_sort_char ((char) 255) + +static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr,size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length) +{ + const char *end= ptr + ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + size_t charlen= res_length / cs->mbmaxlen; + + for (; ptr != end && min_str != min_end && charlen > 0; ptr++, charlen--) + { + if (ptr+1 != end && isbig5code(ptr[0],ptr[1])) + { + *min_str++= *max_str++ = *ptr++; + *min_str++= *max_str++ = *ptr; + continue; + } + if (*ptr == escape && ptr+1 != end) + { + ptr++; /* Skip escape */ + if (isbig5code(ptr[0], ptr[1])) + *min_str++= *max_str++ = *ptr++; + if (min_str < min_end) + *min_str++= *max_str++= *ptr; + continue; + } + if (*ptr == w_one) /* '_' in SQL */ + { + *min_str++='\0'; /* This should be min char */ + *max_str++=max_sort_char; + continue; + } + if (*ptr == w_many) /* '%' in SQL */ + { + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + do { + *min_str++ = 0; + *max_str++ = max_sort_char; + } while (min_str != min_end); + return 0; + } + *min_str++= *max_str++ = *ptr; + } + + *min_length= *max_length= (size_t) (min_str-min_org); + while (min_str != min_end) + *min_str++= *max_str++= ' '; + return 0; +} + + +static uint ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0); +} + + +static uint mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c) +{ + return (isbig5head(c)? 2 : 1); +} + + +/* page 0 0xA140-0xC7FC */ +static uint16 tab_big5_uni0[]={ +0x3000,0xFF0C,0x3001,0x3002,0xFF0E,0x2022,0xFF1B,0xFF1A, +0xFF1F,0xFF01,0xFE30,0x2026,0x2025,0xFE50,0xFF64,0xFE52, +0x00B7,0xFE54,0xFE55,0xFE56,0xFE57,0xFF5C,0x2013,0xFE31, +0x2014,0xFE33,0xFFFD,0xFE34,0xFE4F,0xFF08,0xFF09,0xFE35, +0xFE36,0xFF5B,0xFF5D,0xFE37,0xFE38,0x3014,0x3015,0xFE39, +0xFE3A,0x3010,0x3011,0xFE3B,0xFE3C,0x300A,0x300B,0xFE3D, +0xFE3E,0x3008,0x3009,0xFE3F,0xFE40,0x300C,0x300D,0xFE41, +0xFE42,0x300E,0x300F,0xFE43,0xFE44,0xFE59,0xFE5A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFE5B,0xFE5C,0xFE5D,0xFE5E,0x2018,0x2019,0x201C, +0x201D,0x301D,0x301E,0x2035,0x2032,0xFF03,0xFF06,0xFF0A, +0x203B,0x00A7,0x3003,0x25CB,0x25CF,0x25B3,0x25B2,0x25CE, +0x2606,0x2605,0x25C7,0x25C6,0x25A1,0x25A0,0x25BD,0x25BC, +0x32A3,0x2105,0x203E,0xFFFD,0xFF3F,0xFFFD,0xFE49,0xFE4A, +0xFE4D,0xFE4E,0xFE4B,0xFE4C,0xFE5F,0xFE60,0xFE61,0xFF0B, +0xFF0D,0x00D7,0x00F7,0x00B1,0x221A,0xFF1C,0xFF1E,0xFF1D, +0x2266,0x2267,0x2260,0x221E,0x2252,0x2261,0xFE62,0xFE63, +0xFE64,0xFE65,0xFE66,0x223C,0x2229,0x222A,0x22A5,0x2220, +0x221F,0x22BF,0x33D2,0x33D1,0x222B,0x222E,0x2235,0x2234, +0x2640,0x2642,0x2641,0x2609,0x2191,0x2193,0x2190,0x2192, +0x2196,0x2197,0x2199,0x2198,0x2225,0x2223,0xFFFD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFFFD,0xFF0F,0xFF3C,0xFF04,0x00A5,0x3012,0x00A2,0x00A3, +0xFF05,0xFF20,0x2103,0x2109,0xFE69,0xFE6A,0xFE6B,0x33D5, +0x339C,0x339D,0x339E,0x33CE,0x33A1,0x338E,0x338F,0x33C4, +0x00B0,0x5159,0x515B,0x515E,0x515D,0x5161,0x5163,0x55E7, +0x74E9,0x7CCE,0x2581,0x2582,0x2583,0x2584,0x2585,0x2586, +0x2587,0x2588,0x258F,0x258E,0x258D,0x258C,0x258B,0x258A, +0x2589,0x253C,0x2534,0x252C,0x2524,0x251C,0x2594,0x2500, +0x2502,0x2595,0x250C,0x2510,0x2514,0x2518,0x256D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x256E,0x2570,0x256F,0x2550,0x255E,0x256A,0x2561, +0x25E2,0x25E3,0x25E5,0x25E4,0x2571,0x2572,0x2573,0xFF10, +0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, +0xFF19,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166, +0x2167,0x2168,0x2169,0x3021,0x3022,0x3023,0x3024,0x3025, +0x3026,0x3027,0x3028,0x3029,0xFFFD,0x5344,0xFFFD,0xFF21, +0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28,0xFF29, +0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30,0xFF31, +0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38,0xFF39, +0xFF3A,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, +0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, +0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFF57,0xFF58,0xFF59,0xFF5A,0x0391,0x0392,0x0393,0x0394, +0x0395,0x0396,0x0397,0x0398,0x0399,0x039A,0x039B,0x039C, +0x039D,0x039E,0x039F,0x03A0,0x03A1,0x03A3,0x03A4,0x03A5, +0x03A6,0x03A7,0x03A8,0x03A9,0x03B1,0x03B2,0x03B3,0x03B4, +0x03B5,0x03B6,0x03B7,0x03B8,0x03B9,0x03BA,0x03BB,0x03BC, +0x03BD,0x03BE,0x03BF,0x03C0,0x03C1,0x03C3,0x03C4,0x03C5, +0x03C6,0x03C7,0x03C8,0x03C9,0x3105,0x3106,0x3107,0x3108, +0x3109,0x310A,0x310B,0x310C,0x310D,0x310E,0x310F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3110,0x3111,0x3112,0x3113,0x3114,0x3115,0x3116, +0x3117,0x3118,0x3119,0x311A,0x311B,0x311C,0x311D,0x311E, +0x311F,0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126, +0x3127,0x3128,0x3129,0x02D9,0x02C9,0x02CA,0x02C7,0x02CB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4E00,0x4E59,0x4E01,0x4E03,0x4E43,0x4E5D,0x4E86,0x4E8C, +0x4EBA,0x513F,0x5165,0x516B,0x51E0,0x5200,0x5201,0x529B, +0x5315,0x5341,0x535C,0x53C8,0x4E09,0x4E0B,0x4E08,0x4E0A, +0x4E2B,0x4E38,0x51E1,0x4E45,0x4E48,0x4E5F,0x4E5E,0x4E8E, +0x4EA1,0x5140,0x5203,0x52FA,0x5343,0x53C9,0x53E3,0x571F, +0x58EB,0x5915,0x5927,0x5973,0x5B50,0x5B51,0x5B53,0x5BF8, +0x5C0F,0x5C22,0x5C38,0x5C71,0x5DDD,0x5DE5,0x5DF1,0x5DF2, +0x5DF3,0x5DFE,0x5E72,0x5EFE,0x5F0B,0x5F13,0x624D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4E11,0x4E10,0x4E0D,0x4E2D,0x4E30,0x4E39,0x4E4B, +0x5C39,0x4E88,0x4E91,0x4E95,0x4E92,0x4E94,0x4EA2,0x4EC1, +0x4EC0,0x4EC3,0x4EC6,0x4EC7,0x4ECD,0x4ECA,0x4ECB,0x4EC4, +0x5143,0x5141,0x5167,0x516D,0x516E,0x516C,0x5197,0x51F6, +0x5206,0x5207,0x5208,0x52FB,0x52FE,0x52FF,0x5316,0x5339, +0x5348,0x5347,0x5345,0x535E,0x5384,0x53CB,0x53CA,0x53CD, +0x58EC,0x5929,0x592B,0x592A,0x592D,0x5B54,0x5C11,0x5C24, +0x5C3A,0x5C6F,0x5DF4,0x5E7B,0x5EFF,0x5F14,0x5F15,0x5FC3, +0x6208,0x6236,0x624B,0x624E,0x652F,0x6587,0x6597,0x65A4, +0x65B9,0x65E5,0x66F0,0x6708,0x6728,0x6B20,0x6B62,0x6B79, +0x6BCB,0x6BD4,0x6BDB,0x6C0F,0x6C34,0x706B,0x722A,0x7236, +0x723B,0x7247,0x7259,0x725B,0x72AC,0x738B,0x4E19, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4E16,0x4E15,0x4E14,0x4E18,0x4E3B,0x4E4D,0x4E4F,0x4E4E, +0x4EE5,0x4ED8,0x4ED4,0x4ED5,0x4ED6,0x4ED7,0x4EE3,0x4EE4, +0x4ED9,0x4EDE,0x5145,0x5144,0x5189,0x518A,0x51AC,0x51F9, +0x51FA,0x51F8,0x520A,0x52A0,0x529F,0x5305,0x5306,0x5317, +0x531D,0x4EDF,0x534A,0x5349,0x5361,0x5360,0x536F,0x536E, +0x53BB,0x53EF,0x53E4,0x53F3,0x53EC,0x53EE,0x53E9,0x53E8, +0x53FC,0x53F8,0x53F5,0x53EB,0x53E6,0x53EA,0x53F2,0x53F1, +0x53F0,0x53E5,0x53ED,0x53FB,0x56DB,0x56DA,0x5916, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x592E,0x5931,0x5974,0x5976,0x5B55,0x5B83,0x5C3C, +0x5DE8,0x5DE7,0x5DE6,0x5E02,0x5E03,0x5E73,0x5E7C,0x5F01, +0x5F18,0x5F17,0x5FC5,0x620A,0x6253,0x6254,0x6252,0x6251, +0x65A5,0x65E6,0x672E,0x672C,0x672A,0x672B,0x672D,0x6B63, +0x6BCD,0x6C11,0x6C10,0x6C38,0x6C41,0x6C40,0x6C3E,0x72AF, +0x7384,0x7389,0x74DC,0x74E6,0x7518,0x751F,0x7528,0x7529, +0x7530,0x7531,0x7532,0x7533,0x758B,0x767D,0x76AE,0x76BF, +0x76EE,0x77DB,0x77E2,0x77F3,0x793A,0x79BE,0x7A74,0x7ACB, +0x4E1E,0x4E1F,0x4E52,0x4E53,0x4E69,0x4E99,0x4EA4,0x4EA6, +0x4EA5,0x4EFF,0x4F09,0x4F19,0x4F0A,0x4F15,0x4F0D,0x4F10, +0x4F11,0x4F0F,0x4EF2,0x4EF6,0x4EFB,0x4EF0,0x4EF3,0x4EFD, +0x4F01,0x4F0B,0x5149,0x5147,0x5146,0x5148,0x5168, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5171,0x518D,0x51B0,0x5217,0x5211,0x5212,0x520E,0x5216, +0x52A3,0x5308,0x5321,0x5320,0x5370,0x5371,0x5409,0x540F, +0x540C,0x540A,0x5410,0x5401,0x540B,0x5404,0x5411,0x540D, +0x5408,0x5403,0x540E,0x5406,0x5412,0x56E0,0x56DE,0x56DD, +0x5733,0x5730,0x5728,0x572D,0x572C,0x572F,0x5729,0x5919, +0x591A,0x5937,0x5938,0x5984,0x5978,0x5983,0x597D,0x5979, +0x5982,0x5981,0x5B57,0x5B58,0x5B87,0x5B88,0x5B85,0x5B89, +0x5BFA,0x5C16,0x5C79,0x5DDE,0x5E06,0x5E76,0x5E74, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F0F,0x5F1B,0x5FD9,0x5FD6,0x620E,0x620C,0x620D, +0x6210,0x6263,0x625B,0x6258,0x6536,0x65E9,0x65E8,0x65EC, +0x65ED,0x66F2,0x66F3,0x6709,0x673D,0x6734,0x6731,0x6735, +0x6B21,0x6B64,0x6B7B,0x6C16,0x6C5D,0x6C57,0x6C59,0x6C5F, +0x6C60,0x6C50,0x6C55,0x6C61,0x6C5B,0x6C4D,0x6C4E,0x7070, +0x725F,0x725D,0x767E,0x7AF9,0x7C73,0x7CF8,0x7F36,0x7F8A, +0x7FBD,0x8001,0x8003,0x800C,0x8012,0x8033,0x807F,0x8089, +0x808B,0x808C,0x81E3,0x81EA,0x81F3,0x81FC,0x820C,0x821B, +0x821F,0x826E,0x8272,0x827E,0x866B,0x8840,0x884C,0x8863, +0x897F,0x9621,0x4E32,0x4EA8,0x4F4D,0x4F4F,0x4F47,0x4F57, +0x4F5E,0x4F34,0x4F5B,0x4F55,0x4F30,0x4F50,0x4F51,0x4F3D, +0x4F3A,0x4F38,0x4F43,0x4F54,0x4F3C,0x4F46,0x4F63, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4F5C,0x4F60,0x4F2F,0x4F4E,0x4F36,0x4F59,0x4F5D,0x4F48, +0x4F5A,0x514C,0x514B,0x514D,0x5175,0x51B6,0x51B7,0x5225, +0x5224,0x5229,0x522A,0x5228,0x52AB,0x52A9,0x52AA,0x52AC, +0x5323,0x5373,0x5375,0x541D,0x542D,0x541E,0x543E,0x5426, +0x544E,0x5427,0x5446,0x5443,0x5433,0x5448,0x5442,0x541B, +0x5429,0x544A,0x5439,0x543B,0x5438,0x542E,0x5435,0x5436, +0x5420,0x543C,0x5440,0x5431,0x542B,0x541F,0x542C,0x56EA, +0x56F0,0x56E4,0x56EB,0x574A,0x5751,0x5740,0x574D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5747,0x574E,0x573E,0x5750,0x574F,0x573B,0x58EF, +0x593E,0x599D,0x5992,0x59A8,0x599E,0x59A3,0x5999,0x5996, +0x598D,0x59A4,0x5993,0x598A,0x59A5,0x5B5D,0x5B5C,0x5B5A, +0x5B5B,0x5B8C,0x5B8B,0x5B8F,0x5C2C,0x5C40,0x5C41,0x5C3F, +0x5C3E,0x5C90,0x5C91,0x5C94,0x5C8C,0x5DEB,0x5E0C,0x5E8F, +0x5E87,0x5E8A,0x5EF7,0x5F04,0x5F1F,0x5F64,0x5F62,0x5F77, +0x5F79,0x5FD8,0x5FCC,0x5FD7,0x5FCD,0x5FF1,0x5FEB,0x5FF8, +0x5FEA,0x6212,0x6211,0x6284,0x6297,0x6296,0x6280,0x6276, +0x6289,0x626D,0x628A,0x627C,0x627E,0x6279,0x6273,0x6292, +0x626F,0x6298,0x626E,0x6295,0x6293,0x6291,0x6286,0x6539, +0x653B,0x6538,0x65F1,0x66F4,0x675F,0x674E,0x674F,0x6750, +0x6751,0x675C,0x6756,0x675E,0x6749,0x6746,0x6760, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6753,0x6757,0x6B65,0x6BCF,0x6C42,0x6C5E,0x6C99,0x6C81, +0x6C88,0x6C89,0x6C85,0x6C9B,0x6C6A,0x6C7A,0x6C90,0x6C70, +0x6C8C,0x6C68,0x6C96,0x6C92,0x6C7D,0x6C83,0x6C72,0x6C7E, +0x6C74,0x6C86,0x6C76,0x6C8D,0x6C94,0x6C98,0x6C82,0x7076, +0x707C,0x707D,0x7078,0x7262,0x7261,0x7260,0x72C4,0x72C2, +0x7396,0x752C,0x752B,0x7537,0x7538,0x7682,0x76EF,0x77E3, +0x79C1,0x79C0,0x79BF,0x7A76,0x7CFB,0x7F55,0x8096,0x8093, +0x809D,0x8098,0x809B,0x809A,0x80B2,0x826F,0x8292, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x828B,0x828D,0x898B,0x89D2,0x8A00,0x8C37,0x8C46, +0x8C55,0x8C9D,0x8D64,0x8D70,0x8DB3,0x8EAB,0x8ECA,0x8F9B, +0x8FB0,0x8FC2,0x8FC6,0x8FC5,0x8FC4,0x5DE1,0x9091,0x90A2, +0x90AA,0x90A6,0x90A3,0x9149,0x91C6,0x91CC,0x9632,0x962E, +0x9631,0x962A,0x962C,0x4E26,0x4E56,0x4E73,0x4E8B,0x4E9B, +0x4E9E,0x4EAB,0x4EAC,0x4F6F,0x4F9D,0x4F8D,0x4F73,0x4F7F, +0x4F6C,0x4F9B,0x4F8B,0x4F86,0x4F83,0x4F70,0x4F75,0x4F88, +0x4F69,0x4F7B,0x4F96,0x4F7E,0x4F8F,0x4F91,0x4F7A,0x5154, +0x5152,0x5155,0x5169,0x5177,0x5176,0x5178,0x51BD,0x51FD, +0x523B,0x5238,0x5237,0x523A,0x5230,0x522E,0x5236,0x5241, +0x52BE,0x52BB,0x5352,0x5354,0x5353,0x5351,0x5366,0x5377, +0x5378,0x5379,0x53D6,0x53D4,0x53D7,0x5473,0x5475, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5496,0x5478,0x5495,0x5480,0x547B,0x5477,0x5484,0x5492, +0x5486,0x547C,0x5490,0x5471,0x5476,0x548C,0x549A,0x5462, +0x5468,0x548B,0x547D,0x548E,0x56FA,0x5783,0x5777,0x576A, +0x5769,0x5761,0x5766,0x5764,0x577C,0x591C,0x5949,0x5947, +0x5948,0x5944,0x5954,0x59BE,0x59BB,0x59D4,0x59B9,0x59AE, +0x59D1,0x59C6,0x59D0,0x59CD,0x59CB,0x59D3,0x59CA,0x59AF, +0x59B3,0x59D2,0x59C5,0x5B5F,0x5B64,0x5B63,0x5B97,0x5B9A, +0x5B98,0x5B9C,0x5B99,0x5B9B,0x5C1A,0x5C48,0x5C45, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5C46,0x5CB7,0x5CA1,0x5CB8,0x5CA9,0x5CAB,0x5CB1, +0x5CB3,0x5E18,0x5E1A,0x5E16,0x5E15,0x5E1B,0x5E11,0x5E78, +0x5E9A,0x5E97,0x5E9C,0x5E95,0x5E96,0x5EF6,0x5F26,0x5F27, +0x5F29,0x5F80,0x5F81,0x5F7F,0x5F7C,0x5FDD,0x5FE0,0x5FFD, +0x5FF5,0x5FFF,0x600F,0x6014,0x602F,0x6035,0x6016,0x602A, +0x6015,0x6021,0x6027,0x6029,0x602B,0x601B,0x6216,0x6215, +0x623F,0x623E,0x6240,0x627F,0x62C9,0x62CC,0x62C4,0x62BF, +0x62C2,0x62B9,0x62D2,0x62DB,0x62AB,0x62D3,0x62D4,0x62CB, +0x62C8,0x62A8,0x62BD,0x62BC,0x62D0,0x62D9,0x62C7,0x62CD, +0x62B5,0x62DA,0x62B1,0x62D8,0x62D6,0x62D7,0x62C6,0x62AC, +0x62CE,0x653E,0x65A7,0x65BC,0x65FA,0x6614,0x6613,0x660C, +0x6606,0x6602,0x660E,0x6600,0x660F,0x6615,0x660A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6607,0x670D,0x670B,0x676D,0x678B,0x6795,0x6771,0x679C, +0x6773,0x6777,0x6787,0x679D,0x6797,0x676F,0x6770,0x677F, +0x6789,0x677E,0x6790,0x6775,0x679A,0x6793,0x677C,0x676A, +0x6772,0x6B23,0x6B66,0x6B67,0x6B7F,0x6C13,0x6C1B,0x6CE3, +0x6CE8,0x6CF3,0x6CB1,0x6CCC,0x6CE5,0x6CB3,0x6CBD,0x6CBE, +0x6CBC,0x6CE2,0x6CAB,0x6CD5,0x6CD3,0x6CB8,0x6CC4,0x6CB9, +0x6CC1,0x6CAE,0x6CD7,0x6CC5,0x6CF1,0x6CBF,0x6CBB,0x6CE1, +0x6CDB,0x6CCA,0x6CAC,0x6CEF,0x6CDC,0x6CD6,0x6CE0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7095,0x708E,0x7092,0x708A,0x7099,0x722C,0x722D, +0x7238,0x7248,0x7267,0x7269,0x72C0,0x72CE,0x72D9,0x72D7, +0x72D0,0x73A9,0x73A8,0x739F,0x73AB,0x73A5,0x753D,0x759D, +0x7599,0x759A,0x7684,0x76C2,0x76F2,0x76F4,0x77E5,0x77FD, +0x793E,0x7940,0x7941,0x79C9,0x79C8,0x7A7A,0x7A79,0x7AFA, +0x7CFE,0x7F54,0x7F8C,0x7F8B,0x8005,0x80BA,0x80A5,0x80A2, +0x80B1,0x80A1,0x80AB,0x80A9,0x80B4,0x80AA,0x80AF,0x81E5, +0x81FE,0x820D,0x82B3,0x829D,0x8299,0x82AD,0x82BD,0x829F, +0x82B9,0x82B1,0x82AC,0x82A5,0x82AF,0x82B8,0x82A3,0x82B0, +0x82BE,0x82B7,0x864E,0x8671,0x521D,0x8868,0x8ECB,0x8FCE, +0x8FD4,0x8FD1,0x90B5,0x90B8,0x90B1,0x90B6,0x91C7,0x91D1, +0x9577,0x9580,0x961C,0x9640,0x963F,0x963B,0x9644, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9642,0x96B9,0x96E8,0x9752,0x975E,0x4E9F,0x4EAD,0x4EAE, +0x4FE1,0x4FB5,0x4FAF,0x4FBF,0x4FE0,0x4FD1,0x4FCF,0x4FDD, +0x4FC3,0x4FB6,0x4FD8,0x4FDF,0x4FCA,0x4FD7,0x4FAE,0x4FD0, +0x4FC4,0x4FC2,0x4FDA,0x4FCE,0x4FDE,0x4FB7,0x5157,0x5192, +0x5191,0x51A0,0x524E,0x5243,0x524A,0x524D,0x524C,0x524B, +0x5247,0x52C7,0x52C9,0x52C3,0x52C1,0x530D,0x5357,0x537B, +0x539A,0x53DB,0x54AC,0x54C0,0x54A8,0x54CE,0x54C9,0x54B8, +0x54A6,0x54B3,0x54C7,0x54C2,0x54BD,0x54AA,0x54C1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x54C4,0x54C8,0x54AF,0x54AB,0x54B1,0x54BB,0x54A9, +0x54A7,0x54BF,0x56FF,0x5782,0x578B,0x57A0,0x57A3,0x57A2, +0x57CE,0x57AE,0x5793,0x5955,0x5951,0x594F,0x594E,0x5950, +0x59DC,0x59D8,0x59FF,0x59E3,0x59E8,0x5A03,0x59E5,0x59EA, +0x59DA,0x59E6,0x5A01,0x59FB,0x5B69,0x5BA3,0x5BA6,0x5BA4, +0x5BA2,0x5BA5,0x5C01,0x5C4E,0x5C4F,0x5C4D,0x5C4B,0x5CD9, +0x5CD2,0x5DF7,0x5E1D,0x5E25,0x5E1F,0x5E7D,0x5EA0,0x5EA6, +0x5EFA,0x5F08,0x5F2D,0x5F65,0x5F88,0x5F85,0x5F8A,0x5F8B, +0x5F87,0x5F8C,0x5F89,0x6012,0x601D,0x6020,0x6025,0x600E, +0x6028,0x604D,0x6070,0x6068,0x6062,0x6046,0x6043,0x606C, +0x606B,0x606A,0x6064,0x6241,0x62DC,0x6316,0x6309,0x62FC, +0x62ED,0x6301,0x62EE,0x62FD,0x6307,0x62F1,0x62F7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x62EF,0x62EC,0x62FE,0x62F4,0x6311,0x6302,0x653F,0x6545, +0x65AB,0x65BD,0x65E2,0x6625,0x662D,0x6620,0x6627,0x662F, +0x661F,0x6628,0x6631,0x6624,0x66F7,0x67FF,0x67D3,0x67F1, +0x67D4,0x67D0,0x67EC,0x67B6,0x67AF,0x67F5,0x67E9,0x67EF, +0x67C4,0x67D1,0x67B4,0x67DA,0x67E5,0x67B8,0x67CF,0x67DE, +0x67F3,0x67B0,0x67D9,0x67E2,0x67DD,0x67D2,0x6B6A,0x6B83, +0x6B86,0x6BB5,0x6BD2,0x6BD7,0x6C1F,0x6CC9,0x6D0B,0x6D32, +0x6D2A,0x6D41,0x6D25,0x6D0C,0x6D31,0x6D1E,0x6D17, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6D3B,0x6D3D,0x6D3E,0x6D36,0x6D1B,0x6CF5,0x6D39, +0x6D27,0x6D38,0x6D29,0x6D2E,0x6D35,0x6D0E,0x6D2B,0x70AB, +0x70BA,0x70B3,0x70AC,0x70AF,0x70AD,0x70B8,0x70AE,0x70A4, +0x7230,0x7272,0x726F,0x7274,0x72E9,0x72E0,0x72E1,0x73B7, +0x73CA,0x73BB,0x73B2,0x73CD,0x73C0,0x73B3,0x751A,0x752D, +0x754F,0x754C,0x754E,0x754B,0x75AB,0x75A4,0x75A5,0x75A2, +0x75A3,0x7678,0x7686,0x7687,0x7688,0x76C8,0x76C6,0x76C3, +0x76C5,0x7701,0x76F9,0x76F8,0x7709,0x770B,0x76FE,0x76FC, +0x7707,0x77DC,0x7802,0x7814,0x780C,0x780D,0x7946,0x7949, +0x7948,0x7947,0x79B9,0x79BA,0x79D1,0x79D2,0x79CB,0x7A7F, +0x7A81,0x7AFF,0x7AFD,0x7C7D,0x7D02,0x7D05,0x7D00,0x7D09, +0x7D07,0x7D04,0x7D06,0x7F38,0x7F8E,0x7FBF,0x8004, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8010,0x800D,0x8011,0x8036,0x80D6,0x80E5,0x80DA,0x80C3, +0x80C4,0x80CC,0x80E1,0x80DB,0x80CE,0x80DE,0x80E4,0x80DD, +0x81F4,0x8222,0x82E7,0x8303,0x8305,0x82E3,0x82DB,0x82E6, +0x8304,0x82E5,0x8302,0x8309,0x82D2,0x82D7,0x82F1,0x8301, +0x82DC,0x82D4,0x82D1,0x82DE,0x82D3,0x82DF,0x82EF,0x8306, +0x8650,0x8679,0x867B,0x867A,0x884D,0x886B,0x8981,0x89D4, +0x8A08,0x8A02,0x8A03,0x8C9E,0x8CA0,0x8D74,0x8D73,0x8DB4, +0x8ECD,0x8ECC,0x8FF0,0x8FE6,0x8FE2,0x8FEA,0x8FE5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8FED,0x8FEB,0x8FE4,0x8FE8,0x90CA,0x90CE,0x90C1, +0x90C3,0x914B,0x914A,0x91CD,0x9582,0x9650,0x964B,0x964C, +0x964D,0x9762,0x9769,0x97CB,0x97ED,0x97F3,0x9801,0x98A8, +0x98DB,0x98DF,0x9996,0x9999,0x4E58,0x4EB3,0x500C,0x500D, +0x5023,0x4FEF,0x5026,0x5025,0x4FF8,0x5029,0x5016,0x5006, +0x503C,0x501F,0x501A,0x5012,0x5011,0x4FFA,0x5000,0x5014, +0x5028,0x4FF1,0x5021,0x500B,0x5019,0x5018,0x4FF3,0x4FEE, +0x502D,0x502A,0x4FFE,0x502B,0x5009,0x517C,0x51A4,0x51A5, +0x51A2,0x51CD,0x51CC,0x51C6,0x51CB,0x5256,0x525C,0x5254, +0x525B,0x525D,0x532A,0x537F,0x539F,0x539D,0x53DF,0x54E8, +0x5510,0x5501,0x5537,0x54FC,0x54E5,0x54F2,0x5506,0x54FA, +0x5514,0x54E9,0x54ED,0x54E1,0x5509,0x54EE,0x54EA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x54E6,0x5527,0x5507,0x54FD,0x550F,0x5703,0x5704,0x57C2, +0x57D4,0x57CB,0x57C3,0x5809,0x590F,0x5957,0x5958,0x595A, +0x5A11,0x5A18,0x5A1C,0x5A1F,0x5A1B,0x5A13,0x59EC,0x5A20, +0x5A23,0x5A29,0x5A25,0x5A0C,0x5A09,0x5B6B,0x5C58,0x5BB0, +0x5BB3,0x5BB6,0x5BB4,0x5BAE,0x5BB5,0x5BB9,0x5BB8,0x5C04, +0x5C51,0x5C55,0x5C50,0x5CED,0x5CFD,0x5CFB,0x5CEA,0x5CE8, +0x5CF0,0x5CF6,0x5D01,0x5CF4,0x5DEE,0x5E2D,0x5E2B,0x5EAB, +0x5EAD,0x5EA7,0x5F31,0x5F92,0x5F91,0x5F90,0x6059, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6063,0x6065,0x6050,0x6055,0x606D,0x6069,0x606F, +0x6084,0x609F,0x609A,0x608D,0x6094,0x608C,0x6085,0x6096, +0x6247,0x62F3,0x6308,0x62FF,0x634E,0x633E,0x632F,0x6355, +0x6342,0x6346,0x634F,0x6349,0x633A,0x6350,0x633D,0x632A, +0x632B,0x6328,0x634D,0x634C,0x6548,0x6549,0x6599,0x65C1, +0x65C5,0x6642,0x6649,0x664F,0x6643,0x6652,0x664C,0x6645, +0x6641,0x66F8,0x6714,0x6715,0x6717,0x6821,0x6838,0x6848, +0x6846,0x6853,0x6839,0x6842,0x6854,0x6829,0x68B3,0x6817, +0x684C,0x6851,0x683D,0x67F4,0x6850,0x6840,0x683C,0x6843, +0x682A,0x6845,0x6813,0x6818,0x6841,0x6B8A,0x6B89,0x6BB7, +0x6C23,0x6C27,0x6C28,0x6C26,0x6C24,0x6CF0,0x6D6A,0x6D95, +0x6D88,0x6D87,0x6D66,0x6D78,0x6D77,0x6D59,0x6D93, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6D6C,0x6D89,0x6D6E,0x6D5A,0x6D74,0x6D69,0x6D8C,0x6D8A, +0x6D79,0x6D85,0x6D65,0x6D94,0x70CA,0x70D8,0x70E4,0x70D9, +0x70C8,0x70CF,0x7239,0x7279,0x72FC,0x72F9,0x72FD,0x72F8, +0x72F7,0x7386,0x73ED,0x7409,0x73EE,0x73E0,0x73EA,0x73DE, +0x7554,0x755D,0x755C,0x755A,0x7559,0x75BE,0x75C5,0x75C7, +0x75B2,0x75B3,0x75BD,0x75BC,0x75B9,0x75C2,0x75B8,0x768B, +0x76B0,0x76CA,0x76CD,0x76CE,0x7729,0x771F,0x7720,0x7728, +0x77E9,0x7830,0x7827,0x7838,0x781D,0x7834,0x7837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7825,0x782D,0x7820,0x781F,0x7832,0x7955,0x7950, +0x7960,0x795F,0x7956,0x795E,0x795D,0x7957,0x795A,0x79E4, +0x79E3,0x79E7,0x79DF,0x79E6,0x79E9,0x79D8,0x7A84,0x7A88, +0x7AD9,0x7B06,0x7B11,0x7C89,0x7D21,0x7D17,0x7D0B,0x7D0A, +0x7D20,0x7D22,0x7D14,0x7D10,0x7D15,0x7D1A,0x7D1C,0x7D0D, +0x7D19,0x7D1B,0x7F3A,0x7F5F,0x7F94,0x7FC5,0x7FC1,0x8006, +0x8018,0x8015,0x8019,0x8017,0x803D,0x803F,0x80F1,0x8102, +0x80F0,0x8105,0x80ED,0x80F4,0x8106,0x80F8,0x80F3,0x8108, +0x80FD,0x810A,0x80FC,0x80EF,0x81ED,0x81EC,0x8200,0x8210, +0x822A,0x822B,0x8228,0x822C,0x82BB,0x832B,0x8352,0x8354, +0x834A,0x8338,0x8350,0x8349,0x8335,0x8334,0x834F,0x8332, +0x8339,0x8336,0x8317,0x8340,0x8331,0x8328,0x8343, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8654,0x868A,0x86AA,0x8693,0x86A4,0x86A9,0x868C,0x86A3, +0x869C,0x8870,0x8877,0x8881,0x8882,0x887D,0x8879,0x8A18, +0x8A10,0x8A0E,0x8A0C,0x8A15,0x8A0A,0x8A17,0x8A13,0x8A16, +0x8A0F,0x8A11,0x8C48,0x8C7A,0x8C79,0x8CA1,0x8CA2,0x8D77, +0x8EAC,0x8ED2,0x8ED4,0x8ECF,0x8FB1,0x9001,0x9006,0x8FF7, +0x9000,0x8FFA,0x8FF4,0x9003,0x8FFD,0x9005,0x8FF8,0x9095, +0x90E1,0x90DD,0x90E2,0x9152,0x914D,0x914C,0x91D8,0x91DD, +0x91D7,0x91DC,0x91D9,0x9583,0x9662,0x9663,0x9661, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x965B,0x965D,0x9664,0x9658,0x965E,0x96BB,0x98E2, +0x99AC,0x9AA8,0x9AD8,0x9B25,0x9B32,0x9B3C,0x4E7E,0x507A, +0x507D,0x505C,0x5047,0x5043,0x504C,0x505A,0x5049,0x5065, +0x5076,0x504E,0x5055,0x5075,0x5074,0x5077,0x504F,0x500F, +0x506F,0x506D,0x515C,0x5195,0x51F0,0x526A,0x526F,0x52D2, +0x52D9,0x52D8,0x52D5,0x5310,0x530F,0x5319,0x533F,0x5340, +0x533E,0x53C3,0x66FC,0x5546,0x556A,0x5566,0x5544,0x555E, +0x5561,0x5543,0x554A,0x5531,0x5556,0x554F,0x5555,0x552F, +0x5564,0x5538,0x552E,0x555C,0x552C,0x5563,0x5533,0x5541, +0x5557,0x5708,0x570B,0x5709,0x57DF,0x5805,0x580A,0x5806, +0x57E0,0x57E4,0x57FA,0x5802,0x5835,0x57F7,0x57F9,0x5920, +0x5962,0x5A36,0x5A41,0x5A49,0x5A66,0x5A6A,0x5A40, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5A3C,0x5A62,0x5A5A,0x5A46,0x5A4A,0x5B70,0x5BC7,0x5BC5, +0x5BC4,0x5BC2,0x5BBF,0x5BC6,0x5C09,0x5C08,0x5C07,0x5C60, +0x5C5C,0x5C5D,0x5D07,0x5D06,0x5D0E,0x5D1B,0x5D16,0x5D22, +0x5D11,0x5D29,0x5D14,0x5D19,0x5D24,0x5D27,0x5D17,0x5DE2, +0x5E38,0x5E36,0x5E33,0x5E37,0x5EB7,0x5EB8,0x5EB6,0x5EB5, +0x5EBE,0x5F35,0x5F37,0x5F57,0x5F6C,0x5F69,0x5F6B,0x5F97, +0x5F99,0x5F9E,0x5F98,0x5FA1,0x5FA0,0x5F9C,0x607F,0x60A3, +0x6089,0x60A0,0x60A8,0x60CB,0x60B4,0x60E6,0x60BD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x60C5,0x60BB,0x60B5,0x60DC,0x60BC,0x60D8,0x60D5, +0x60C6,0x60DF,0x60B8,0x60DA,0x60C7,0x621A,0x621B,0x6248, +0x63A0,0x63A7,0x6372,0x6396,0x63A2,0x63A5,0x6377,0x6367, +0x6398,0x63AA,0x6371,0x63A9,0x6389,0x6383,0x639B,0x636B, +0x63A8,0x6384,0x6388,0x6399,0x63A1,0x63AC,0x6392,0x638F, +0x6380,0x637B,0x6369,0x6368,0x637A,0x655D,0x6556,0x6551, +0x6559,0x6557,0x555F,0x654F,0x6558,0x6555,0x6554,0x659C, +0x659B,0x65AC,0x65CF,0x65CB,0x65CC,0x65CE,0x665D,0x665A, +0x6664,0x6668,0x6666,0x665E,0x66F9,0x52D7,0x671B,0x6881, +0x68AF,0x68A2,0x6893,0x68B5,0x687F,0x6876,0x68B1,0x68A7, +0x6897,0x68B0,0x6883,0x68C4,0x68AD,0x6886,0x6885,0x6894, +0x689D,0x68A8,0x689F,0x68A1,0x6882,0x6B32,0x6BBA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6BEB,0x6BEC,0x6C2B,0x6D8E,0x6DBC,0x6DF3,0x6DD9,0x6DB2, +0x6DE1,0x6DCC,0x6DE4,0x6DFB,0x6DFA,0x6E05,0x6DC7,0x6DCB, +0x6DAF,0x6DD1,0x6DAE,0x6DDE,0x6DF9,0x6DB8,0x6DF7,0x6DF5, +0x6DC5,0x6DD2,0x6E1A,0x6DB5,0x6DDA,0x6DEB,0x6DD8,0x6DEA, +0x6DF1,0x6DEE,0x6DE8,0x6DC6,0x6DC4,0x6DAA,0x6DEC,0x6DBF, +0x6DE6,0x70F9,0x7109,0x710A,0x70FD,0x70EF,0x723D,0x727D, +0x7281,0x731C,0x731B,0x7316,0x7313,0x7319,0x7387,0x7405, +0x740A,0x7403,0x7406,0x73FE,0x740D,0x74E0,0x74F6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x74F7,0x751C,0x7522,0x7565,0x7566,0x7562,0x7570, +0x758F,0x75D4,0x75D5,0x75B5,0x75CA,0x75CD,0x768E,0x76D4, +0x76D2,0x76DB,0x7737,0x773E,0x773C,0x7736,0x7738,0x773A, +0x786B,0x7843,0x784E,0x7965,0x7968,0x796D,0x79FB,0x7A92, +0x7A95,0x7B20,0x7B28,0x7B1B,0x7B2C,0x7B26,0x7B19,0x7B1E, +0x7B2E,0x7C92,0x7C97,0x7C95,0x7D46,0x7D43,0x7D71,0x7D2E, +0x7D39,0x7D3C,0x7D40,0x7D30,0x7D33,0x7D44,0x7D2F,0x7D42, +0x7D32,0x7D31,0x7F3D,0x7F9E,0x7F9A,0x7FCC,0x7FCE,0x7FD2, +0x801C,0x804A,0x8046,0x812F,0x8116,0x8123,0x812B,0x8129, +0x8130,0x8124,0x8202,0x8235,0x8237,0x8236,0x8239,0x838E, +0x839E,0x8398,0x8378,0x83A2,0x8396,0x83BD,0x83AB,0x8392, +0x838A,0x8393,0x8389,0x83A0,0x8377,0x837B,0x837C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8386,0x83A7,0x8655,0x5F6A,0x86C7,0x86C0,0x86B6,0x86C4, +0x86B5,0x86C6,0x86CB,0x86B1,0x86AF,0x86C9,0x8853,0x889E, +0x8888,0x88AB,0x8892,0x8896,0x888D,0x888B,0x8993,0x898F, +0x8A2A,0x8A1D,0x8A23,0x8A25,0x8A31,0x8A2D,0x8A1F,0x8A1B, +0x8A22,0x8C49,0x8C5A,0x8CA9,0x8CAC,0x8CAB,0x8CA8,0x8CAA, +0x8CA7,0x8D67,0x8D66,0x8DBE,0x8DBA,0x8EDB,0x8EDF,0x9019, +0x900D,0x901A,0x9017,0x9023,0x901F,0x901D,0x9010,0x9015, +0x901E,0x9020,0x900F,0x9022,0x9016,0x901B,0x9014, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x90E8,0x90ED,0x90FD,0x9157,0x91CE,0x91F5,0x91E6, +0x91E3,0x91E7,0x91ED,0x91E9,0x9589,0x966A,0x9675,0x9673, +0x9678,0x9670,0x9674,0x9676,0x9677,0x966C,0x96C0,0x96EA, +0x96E9,0x7AE0,0x7ADF,0x9802,0x9803,0x9B5A,0x9CE5,0x9E75, +0x9E7F,0x9EA5,0x9EBB,0x50A2,0x508D,0x5085,0x5099,0x5091, +0x5080,0x5096,0x5098,0x509A,0x6700,0x51F1,0x5272,0x5274, +0x5275,0x5269,0x52DE,0x52DD,0x52DB,0x535A,0x53A5,0x557B, +0x5580,0x55A7,0x557C,0x558A,0x559D,0x5598,0x5582,0x559C, +0x55AA,0x5594,0x5587,0x558B,0x5583,0x55B3,0x55AE,0x559F, +0x553E,0x55B2,0x559A,0x55BB,0x55AC,0x55B1,0x557E,0x5589, +0x55AB,0x5599,0x570D,0x582F,0x582A,0x5834,0x5824,0x5830, +0x5831,0x5821,0x581D,0x5820,0x58F9,0x58FA,0x5960, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5A77,0x5A9A,0x5A7F,0x5A92,0x5A9B,0x5AA7,0x5B73,0x5B71, +0x5BD2,0x5BCC,0x5BD3,0x5BD0,0x5C0A,0x5C0B,0x5C31,0x5D4C, +0x5D50,0x5D34,0x5D47,0x5DFD,0x5E45,0x5E3D,0x5E40,0x5E43, +0x5E7E,0x5ECA,0x5EC1,0x5EC2,0x5EC4,0x5F3C,0x5F6D,0x5FA9, +0x5FAA,0x5FA8,0x60D1,0x60E1,0x60B2,0x60B6,0x60E0,0x611C, +0x6123,0x60FA,0x6115,0x60F0,0x60FB,0x60F4,0x6168,0x60F1, +0x610E,0x60F6,0x6109,0x6100,0x6112,0x621F,0x6249,0x63A3, +0x638C,0x63CF,0x63C0,0x63E9,0x63C9,0x63C6,0x63CD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x63D2,0x63E3,0x63D0,0x63E1,0x63D6,0x63ED,0x63EE, +0x6376,0x63F4,0x63EA,0x63DB,0x6452,0x63DA,0x63F9,0x655E, +0x6566,0x6562,0x6563,0x6591,0x6590,0x65AF,0x666E,0x6670, +0x6674,0x6676,0x666F,0x6691,0x667A,0x667E,0x6677,0x66FE, +0x66FF,0x671F,0x671D,0x68FA,0x68D5,0x68E0,0x68D8,0x68D7, +0x6905,0x68DF,0x68F5,0x68EE,0x68E7,0x68F9,0x68D2,0x68F2, +0x68E3,0x68CB,0x68CD,0x690D,0x6912,0x690E,0x68C9,0x68DA, +0x696E,0x68FB,0x6B3E,0x6B3A,0x6B3D,0x6B98,0x6B96,0x6BBC, +0x6BEF,0x6C2E,0x6C2F,0x6C2C,0x6E2F,0x6E38,0x6E54,0x6E21, +0x6E32,0x6E67,0x6E4A,0x6E20,0x6E25,0x6E23,0x6E1B,0x6E5B, +0x6E58,0x6E24,0x6E56,0x6E6E,0x6E2D,0x6E26,0x6E6F,0x6E34, +0x6E4D,0x6E3A,0x6E2C,0x6E43,0x6E1D,0x6E3E,0x6ECB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E89,0x6E19,0x6E4E,0x6E63,0x6E44,0x6E72,0x6E69,0x6E5F, +0x7119,0x711A,0x7126,0x7130,0x7121,0x7136,0x716E,0x711C, +0x724C,0x7284,0x7280,0x7336,0x7325,0x7334,0x7329,0x743A, +0x742A,0x7433,0x7422,0x7425,0x7435,0x7436,0x7434,0x742F, +0x741B,0x7426,0x7428,0x7525,0x7526,0x756B,0x756A,0x75E2, +0x75DB,0x75E3,0x75D9,0x75D8,0x75DE,0x75E0,0x767B,0x767C, +0x7696,0x7693,0x76B4,0x76DC,0x774F,0x77ED,0x785D,0x786C, +0x786F,0x7A0D,0x7A08,0x7A0B,0x7A05,0x7A00,0x7A98, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7A97,0x7A96,0x7AE5,0x7AE3,0x7B49,0x7B56,0x7B46, +0x7B50,0x7B52,0x7B54,0x7B4D,0x7B4B,0x7B4F,0x7B51,0x7C9F, +0x7CA5,0x7D5E,0x7D50,0x7D68,0x7D55,0x7D2B,0x7D6E,0x7D72, +0x7D61,0x7D66,0x7D62,0x7D70,0x7D73,0x5584,0x7FD4,0x7FD5, +0x800B,0x8052,0x8085,0x8155,0x8154,0x814B,0x8151,0x814E, +0x8139,0x8146,0x813E,0x814C,0x8153,0x8174,0x8212,0x821C, +0x83E9,0x8403,0x83F8,0x840D,0x83E0,0x83C5,0x840B,0x83C1, +0x83EF,0x83F1,0x83F4,0x8457,0x840A,0x83F0,0x840C,0x83CC, +0x83FD,0x83F2,0x83CA,0x8438,0x840E,0x8404,0x83DC,0x8407, +0x83D4,0x83DF,0x865B,0x86DF,0x86D9,0x86ED,0x86D4,0x86DB, +0x86E4,0x86D0,0x86DE,0x8857,0x88C1,0x88C2,0x88B1,0x8983, +0x8996,0x8A3B,0x8A60,0x8A55,0x8A5E,0x8A3C,0x8A41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8A54,0x8A5B,0x8A50,0x8A46,0x8A34,0x8A3A,0x8A36,0x8A56, +0x8C61,0x8C82,0x8CAF,0x8CBC,0x8CB3,0x8CBD,0x8CC1,0x8CBB, +0x8CC0,0x8CB4,0x8CB7,0x8CB6,0x8CBF,0x8CB8,0x8D8A,0x8D85, +0x8D81,0x8DCE,0x8DDD,0x8DCB,0x8DDA,0x8DD1,0x8DCC,0x8DDB, +0x8DC6,0x8EFB,0x8EF8,0x8EFC,0x8F9C,0x902E,0x9035,0x9031, +0x9038,0x9032,0x9036,0x9102,0x90F5,0x9109,0x90FE,0x9163, +0x9165,0x91CF,0x9214,0x9215,0x9223,0x9209,0x921E,0x920D, +0x9210,0x9207,0x9211,0x9594,0x958F,0x958B,0x9591, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9593,0x9592,0x958E,0x968A,0x968E,0x968B,0x967D, +0x9685,0x9686,0x968D,0x9672,0x9684,0x96C1,0x96C5,0x96C4, +0x96C6,0x96C7,0x96EF,0x96F2,0x97CC,0x9805,0x9806,0x9808, +0x98E7,0x98EA,0x98EF,0x98E9,0x98F2,0x98ED,0x99AE,0x99AD, +0x9EC3,0x9ECD,0x9ED1,0x4E82,0x50AD,0x50B5,0x50B2,0x50B3, +0x50C5,0x50BE,0x50AC,0x50B7,0x50BB,0x50AF,0x50C7,0x527F, +0x5277,0x527D,0x52DF,0x52E6,0x52E4,0x52E2,0x52E3,0x532F, +0x55DF,0x55E8,0x55D3,0x55E6,0x55CE,0x55DC,0x55C7,0x55D1, +0x55E3,0x55E4,0x55EF,0x55DA,0x55E1,0x55C5,0x55C6,0x55E5, +0x55C9,0x5712,0x5713,0x585E,0x5851,0x5858,0x5857,0x585A, +0x5854,0x586B,0x584C,0x586D,0x584A,0x5862,0x5852,0x584B, +0x5967,0x5AC1,0x5AC9,0x5ACC,0x5ABE,0x5ABD,0x5ABC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5AB3,0x5AC2,0x5AB2,0x5D69,0x5D6F,0x5E4C,0x5E79,0x5EC9, +0x5EC8,0x5F12,0x5F59,0x5FAC,0x5FAE,0x611A,0x610F,0x6148, +0x611F,0x60F3,0x611B,0x60F9,0x6101,0x6108,0x614E,0x614C, +0x6144,0x614D,0x613E,0x6134,0x6127,0x610D,0x6106,0x6137, +0x6221,0x6222,0x6413,0x643E,0x641E,0x642A,0x642D,0x643D, +0x642C,0x640F,0x641C,0x6414,0x640D,0x6436,0x6416,0x6417, +0x6406,0x656C,0x659F,0x65B0,0x6697,0x6689,0x6687,0x6688, +0x6696,0x6684,0x6698,0x668D,0x6703,0x6994,0x696D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x695A,0x6977,0x6960,0x6954,0x6975,0x6930,0x6982, +0x694A,0x6968,0x696B,0x695E,0x6953,0x6979,0x6986,0x695D, +0x6963,0x695B,0x6B47,0x6B72,0x6BC0,0x6BBF,0x6BD3,0x6BFD, +0x6EA2,0x6EAF,0x6ED3,0x6EB6,0x6EC2,0x6E90,0x6E9D,0x6EC7, +0x6EC5,0x6EA5,0x6E98,0x6EBC,0x6EBA,0x6EAB,0x6ED1,0x6E96, +0x6E9C,0x6EC4,0x6ED4,0x6EAA,0x6EA7,0x6EB4,0x714E,0x7159, +0x7169,0x7164,0x7149,0x7167,0x715C,0x716C,0x7166,0x714C, +0x7165,0x715E,0x7146,0x7168,0x7156,0x723A,0x7252,0x7337, +0x7345,0x733F,0x733E,0x746F,0x745A,0x7455,0x745F,0x745E, +0x7441,0x743F,0x7459,0x745B,0x745C,0x7576,0x7578,0x7600, +0x75F0,0x7601,0x75F2,0x75F1,0x75FA,0x75FF,0x75F4,0x75F3, +0x76DE,0x76DF,0x775B,0x776B,0x7766,0x775E,0x7763, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7779,0x776A,0x776C,0x775C,0x7765,0x7768,0x7762,0x77EE, +0x788E,0x78B0,0x7897,0x7898,0x788C,0x7889,0x787C,0x7891, +0x7893,0x787F,0x797A,0x797F,0x7981,0x842C,0x79BD,0x7A1C, +0x7A1A,0x7A20,0x7A14,0x7A1F,0x7A1E,0x7A9F,0x7AA0,0x7B77, +0x7BC0,0x7B60,0x7B6E,0x7B67,0x7CB1,0x7CB3,0x7CB5,0x7D93, +0x7D79,0x7D91,0x7D81,0x7D8F,0x7D5B,0x7F6E,0x7F69,0x7F6A, +0x7F72,0x7FA9,0x7FA8,0x7FA4,0x8056,0x8058,0x8086,0x8084, +0x8171,0x8170,0x8178,0x8165,0x816E,0x8173,0x816B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8179,0x817A,0x8166,0x8205,0x8247,0x8482,0x8477, +0x843D,0x8431,0x8475,0x8466,0x846B,0x8449,0x846C,0x845B, +0x843C,0x8435,0x8461,0x8463,0x8469,0x846D,0x8446,0x865E, +0x865C,0x865F,0x86F9,0x8713,0x8708,0x8707,0x8700,0x86FE, +0x86FB,0x8702,0x8703,0x8706,0x870A,0x8859,0x88DF,0x88D4, +0x88D9,0x88DC,0x88D8,0x88DD,0x88E1,0x88CA,0x88D5,0x88D2, +0x899C,0x89E3,0x8A6B,0x8A72,0x8A73,0x8A66,0x8A69,0x8A70, +0x8A87,0x8A7C,0x8A63,0x8AA0,0x8A71,0x8A85,0x8A6D,0x8A62, +0x8A6E,0x8A6C,0x8A79,0x8A7B,0x8A3E,0x8A68,0x8C62,0x8C8A, +0x8C89,0x8CCA,0x8CC7,0x8CC8,0x8CC4,0x8CB2,0x8CC3,0x8CC2, +0x8CC5,0x8DE1,0x8DDF,0x8DE8,0x8DEF,0x8DF3,0x8DFA,0x8DEA, +0x8DE4,0x8DE6,0x8EB2,0x8F03,0x8F09,0x8EFE,0x8F0A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8F9F,0x8FB2,0x904B,0x904A,0x9053,0x9042,0x9054,0x903C, +0x9055,0x9050,0x9047,0x904F,0x904E,0x904D,0x9051,0x903E, +0x9041,0x9112,0x9117,0x916C,0x916A,0x9169,0x91C9,0x9237, +0x9257,0x9238,0x923D,0x9240,0x923E,0x925B,0x924B,0x9264, +0x9251,0x9234,0x9249,0x924D,0x9245,0x9239,0x923F,0x925A, +0x9598,0x9698,0x9694,0x9695,0x96CD,0x96CB,0x96C9,0x96CA, +0x96F7,0x96FB,0x96F9,0x96F6,0x9756,0x9774,0x9776,0x9810, +0x9811,0x9813,0x980A,0x9812,0x980C,0x98FC,0x98F4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x98FD,0x98FE,0x99B3,0x99B1,0x99B4,0x9AE1,0x9CE9, +0x9E82,0x9F0E,0x9F13,0x9F20,0x50E7,0x50EE,0x50E5,0x50D6, +0x50ED,0x50DA,0x50D5,0x50CF,0x50D1,0x50F1,0x50CE,0x50E9, +0x5162,0x51F3,0x5283,0x5282,0x5331,0x53AD,0x55FE,0x5600, +0x561B,0x5617,0x55FD,0x5614,0x5606,0x5609,0x560D,0x560E, +0x55F7,0x5616,0x561F,0x5608,0x5610,0x55F6,0x5718,0x5716, +0x5875,0x587E,0x5883,0x5893,0x588A,0x5879,0x5885,0x587D, +0x58FD,0x5925,0x5922,0x5924,0x596A,0x5969,0x5AE1,0x5AE6, +0x5AE9,0x5AD7,0x5AD6,0x5AD8,0x5AE3,0x5B75,0x5BDE,0x5BE7, +0x5BE1,0x5BE5,0x5BE6,0x5BE8,0x5BE2,0x5BE4,0x5BDF,0x5C0D, +0x5C62,0x5D84,0x5D87,0x5E5B,0x5E63,0x5E55,0x5E57,0x5E54, +0x5ED3,0x5ED6,0x5F0A,0x5F46,0x5F70,0x5FB9,0x6147, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x613F,0x614B,0x6177,0x6162,0x6163,0x615F,0x615A,0x6158, +0x6175,0x622A,0x6487,0x6458,0x6454,0x64A4,0x6478,0x645F, +0x647A,0x6451,0x6467,0x6434,0x646D,0x647B,0x6572,0x65A1, +0x65D7,0x65D6,0x66A2,0x66A8,0x669D,0x699C,0x69A8,0x6995, +0x69C1,0x69AE,0x69D3,0x69CB,0x699B,0x69B7,0x69BB,0x69AB, +0x69B4,0x69D0,0x69CD,0x69AD,0x69CC,0x69A6,0x69C3,0x69A3, +0x6B49,0x6B4C,0x6C33,0x6F33,0x6F14,0x6EFE,0x6F13,0x6EF4, +0x6F29,0x6F3E,0x6F20,0x6F2C,0x6F0F,0x6F02,0x6F22, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6EFF,0x6EEF,0x6F06,0x6F31,0x6F38,0x6F32,0x6F23, +0x6F15,0x6F2B,0x6F2F,0x6F88,0x6F2A,0x6EEC,0x6F01,0x6EF2, +0x6ECC,0x6EF7,0x7194,0x7199,0x717D,0x718A,0x7184,0x7192, +0x723E,0x7292,0x7296,0x7344,0x7350,0x7464,0x7463,0x746A, +0x7470,0x746D,0x7504,0x7591,0x7627,0x760D,0x760B,0x7609, +0x7613,0x76E1,0x76E3,0x7784,0x777D,0x777F,0x7761,0x78C1, +0x789F,0x78A7,0x78B3,0x78A9,0x78A3,0x798E,0x798F,0x798D, +0x7A2E,0x7A31,0x7AAA,0x7AA9,0x7AED,0x7AEF,0x7BA1,0x7B95, +0x7B8B,0x7B75,0x7B97,0x7B9D,0x7B94,0x7B8F,0x7BB8,0x7B87, +0x7B84,0x7CB9,0x7CBD,0x7CBE,0x7DBB,0x7DB0,0x7D9C,0x7DBD, +0x7DBE,0x7DA0,0x7DCA,0x7DB4,0x7DB2,0x7DB1,0x7DBA,0x7DA2, +0x7DBF,0x7DB5,0x7DB8,0x7DAD,0x7DD2,0x7DC7,0x7DAC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7F70,0x7FE0,0x7FE1,0x7FDF,0x805E,0x805A,0x8087,0x8150, +0x8180,0x818F,0x8188,0x818A,0x817F,0x8182,0x81E7,0x81FA, +0x8207,0x8214,0x821E,0x824B,0x84C9,0x84BF,0x84C6,0x84C4, +0x8499,0x849E,0x84B2,0x849C,0x84CB,0x84B8,0x84C0,0x84D3, +0x8490,0x84BC,0x84D1,0x84CA,0x873F,0x871C,0x873B,0x8722, +0x8725,0x8734,0x8718,0x8755,0x8737,0x8729,0x88F3,0x8902, +0x88F4,0x88F9,0x88F8,0x88FD,0x88E8,0x891A,0x88EF,0x8AA6, +0x8A8C,0x8A9E,0x8AA3,0x8A8D,0x8AA1,0x8A93,0x8AA4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AAA,0x8AA5,0x8AA8,0x8A98,0x8A91,0x8A9A,0x8AA7, +0x8C6A,0x8C8D,0x8C8C,0x8CD3,0x8CD1,0x8CD2,0x8D6B,0x8D99, +0x8D95,0x8DFC,0x8F14,0x8F12,0x8F15,0x8F13,0x8FA3,0x9060, +0x9058,0x905C,0x9063,0x9059,0x905E,0x9062,0x905D,0x905B, +0x9119,0x9118,0x911E,0x9175,0x9178,0x9177,0x9174,0x9278, +0x9280,0x9285,0x9298,0x9296,0x927B,0x9293,0x929C,0x92A8, +0x927C,0x9291,0x95A1,0x95A8,0x95A9,0x95A3,0x95A5,0x95A4, +0x9699,0x969C,0x969B,0x96CC,0x96D2,0x9700,0x977C,0x9785, +0x97F6,0x9817,0x9818,0x98AF,0x98B1,0x9903,0x9905,0x990C, +0x9909,0x99C1,0x9AAF,0x9AB0,0x9AE6,0x9B41,0x9B42,0x9CF4, +0x9CF6,0x9CF3,0x9EBC,0x9F3B,0x9F4A,0x5104,0x5100,0x50FB, +0x50F5,0x50F9,0x5102,0x5108,0x5109,0x5105,0x51DC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5287,0x5288,0x5289,0x528D,0x528A,0x52F0,0x53B2,0x562E, +0x563B,0x5639,0x5632,0x563F,0x5634,0x5629,0x5653,0x564E, +0x5657,0x5674,0x5636,0x562F,0x5630,0x5880,0x589F,0x589E, +0x58B3,0x589C,0x58AE,0x58A9,0x58A6,0x596D,0x5B09,0x5AFB, +0x5B0B,0x5AF5,0x5B0C,0x5B08,0x5BEE,0x5BEC,0x5BE9,0x5BEB, +0x5C64,0x5C65,0x5D9D,0x5D94,0x5E62,0x5E5F,0x5E61,0x5EE2, +0x5EDA,0x5EDF,0x5EDD,0x5EE3,0x5EE0,0x5F48,0x5F71,0x5FB7, +0x5FB5,0x6176,0x6167,0x616E,0x615D,0x6155,0x6182, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x617C,0x6170,0x616B,0x617E,0x61A7,0x6190,0x61AB, +0x618E,0x61AC,0x619A,0x61A4,0x6194,0x61AE,0x622E,0x6469, +0x646F,0x6479,0x649E,0x64B2,0x6488,0x6490,0x64B0,0x64A5, +0x6493,0x6495,0x64A9,0x6492,0x64AE,0x64AD,0x64AB,0x649A, +0x64AC,0x6499,0x64A2,0x64B3,0x6575,0x6577,0x6578,0x66AE, +0x66AB,0x66B4,0x66B1,0x6A23,0x6A1F,0x69E8,0x6A01,0x6A1E, +0x6A19,0x69FD,0x6A21,0x6A13,0x6A0A,0x69F3,0x6A02,0x6A05, +0x69ED,0x6A11,0x6B50,0x6B4E,0x6BA4,0x6BC5,0x6BC6,0x6F3F, +0x6F7C,0x6F84,0x6F51,0x6F66,0x6F54,0x6F86,0x6F6D,0x6F5B, +0x6F78,0x6F6E,0x6F8E,0x6F7A,0x6F70,0x6F64,0x6F97,0x6F58, +0x6ED5,0x6F6F,0x6F60,0x6F5F,0x719F,0x71AC,0x71B1,0x71A8, +0x7256,0x729B,0x734E,0x7357,0x7469,0x748B,0x7483, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x747E,0x7480,0x757F,0x7620,0x7629,0x761F,0x7624,0x7626, +0x7621,0x7622,0x769A,0x76BA,0x76E4,0x778E,0x7787,0x778C, +0x7791,0x778B,0x78CB,0x78C5,0x78BA,0x78CA,0x78BE,0x78D5, +0x78BC,0x78D0,0x7A3F,0x7A3C,0x7A40,0x7A3D,0x7A37,0x7A3B, +0x7AAF,0x7AAE,0x7BAD,0x7BB1,0x7BC4,0x7BB4,0x7BC6,0x7BC7, +0x7BC1,0x7BA0,0x7BCC,0x7CCA,0x7DE0,0x7DF4,0x7DEF,0x7DFB, +0x7DD8,0x7DEC,0x7DDD,0x7DE8,0x7DE3,0x7DDA,0x7DDE,0x7DE9, +0x7D9E,0x7DD9,0x7DF2,0x7DF9,0x7F75,0x7F77,0x7FAF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7FE9,0x8026,0x819B,0x819C,0x819D,0x81A0,0x819A, +0x8198,0x8517,0x853D,0x851A,0x84EE,0x852C,0x852D,0x8513, +0x8511,0x8523,0x8521,0x8514,0x84EC,0x8525,0x84FF,0x8506, +0x8782,0x8774,0x8776,0x8760,0x8766,0x8778,0x8768,0x8759, +0x8757,0x874C,0x8753,0x885B,0x885D,0x8910,0x8907,0x8912, +0x8913,0x8915,0x890A,0x8ABC,0x8AD2,0x8AC7,0x8AC4,0x8A95, +0x8ACB,0x8AF8,0x8AB2,0x8AC9,0x8AC2,0x8ABF,0x8AB0,0x8AD6, +0x8ACD,0x8AB6,0x8AB9,0x8ADB,0x8C4C,0x8C4E,0x8C6C,0x8CE0, +0x8CDE,0x8CE6,0x8CE4,0x8CEC,0x8CED,0x8CE2,0x8CE3,0x8CDC, +0x8CEA,0x8CE1,0x8D6D,0x8D9F,0x8DA3,0x8E2B,0x8E10,0x8E1D, +0x8E22,0x8E0F,0x8E29,0x8E1F,0x8E21,0x8E1E,0x8EBA,0x8F1D, +0x8F1B,0x8F1F,0x8F29,0x8F26,0x8F2A,0x8F1C,0x8F1E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8F25,0x9069,0x906E,0x9068,0x906D,0x9077,0x9130,0x912D, +0x9127,0x9131,0x9187,0x9189,0x918B,0x9183,0x92C5,0x92BB, +0x92B7,0x92EA,0x92AC,0x92E4,0x92C1,0x92B3,0x92BC,0x92D2, +0x92C7,0x92F0,0x92B2,0x95AD,0x95B1,0x9704,0x9706,0x9707, +0x9709,0x9760,0x978D,0x978B,0x978F,0x9821,0x982B,0x981C, +0x98B3,0x990A,0x9913,0x9912,0x9918,0x99DD,0x99D0,0x99DF, +0x99DB,0x99D1,0x99D5,0x99D2,0x99D9,0x9AB7,0x9AEE,0x9AEF, +0x9B27,0x9B45,0x9B44,0x9B77,0x9B6F,0x9D06,0x9D09, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9D03,0x9EA9,0x9EBE,0x9ECE,0x58A8,0x9F52,0x5112, +0x5118,0x5114,0x5110,0x5115,0x5180,0x51AA,0x51DD,0x5291, +0x5293,0x52F3,0x5659,0x566B,0x5679,0x5669,0x5664,0x5678, +0x566A,0x5668,0x5665,0x5671,0x566F,0x566C,0x5662,0x5676, +0x58C1,0x58BE,0x58C7,0x58C5,0x596E,0x5B1D,0x5B34,0x5B78, +0x5BF0,0x5C0E,0x5F4A,0x61B2,0x6191,0x61A9,0x618A,0x61CD, +0x61B6,0x61BE,0x61CA,0x61C8,0x6230,0x64C5,0x64C1,0x64CB, +0x64BB,0x64BC,0x64DA,0x64C4,0x64C7,0x64C2,0x64CD,0x64BF, +0x64D2,0x64D4,0x64BE,0x6574,0x66C6,0x66C9,0x66B9,0x66C4, +0x66C7,0x66B8,0x6A3D,0x6A38,0x6A3A,0x6A59,0x6A6B,0x6A58, +0x6A39,0x6A44,0x6A62,0x6A61,0x6A4B,0x6A47,0x6A35,0x6A5F, +0x6A48,0x6B59,0x6B77,0x6C05,0x6FC2,0x6FB1,0x6FA1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6FC3,0x6FA4,0x6FC1,0x6FA7,0x6FB3,0x6FC0,0x6FB9,0x6FB6, +0x6FA6,0x6FA0,0x6FB4,0x71BE,0x71C9,0x71D0,0x71D2,0x71C8, +0x71D5,0x71B9,0x71CE,0x71D9,0x71DC,0x71C3,0x71C4,0x7368, +0x749C,0x74A3,0x7498,0x749F,0x749E,0x74E2,0x750C,0x750D, +0x7634,0x7638,0x763A,0x76E7,0x76E5,0x77A0,0x779E,0x779F, +0x77A5,0x78E8,0x78DA,0x78EC,0x78E7,0x79A6,0x7A4D,0x7A4E, +0x7A46,0x7A4C,0x7A4B,0x7ABA,0x7BD9,0x7C11,0x7BC9,0x7BE4, +0x7BDB,0x7BE1,0x7BE9,0x7BE6,0x7CD5,0x7CD6,0x7E0A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7E11,0x7E08,0x7E1B,0x7E23,0x7E1E,0x7E1D,0x7E09, +0x7E10,0x7F79,0x7FB2,0x7FF0,0x7FF1,0x7FEE,0x8028,0x81B3, +0x81A9,0x81A8,0x81FB,0x8208,0x8258,0x8259,0x854A,0x8559, +0x8548,0x8568,0x8569,0x8543,0x8549,0x856D,0x856A,0x855E, +0x8783,0x879F,0x879E,0x87A2,0x878D,0x8861,0x892A,0x8932, +0x8925,0x892B,0x8921,0x89AA,0x89A6,0x8AE6,0x8AFA,0x8AEB, +0x8AF1,0x8B00,0x8ADC,0x8AE7,0x8AEE,0x8AFE,0x8B01,0x8B02, +0x8AF7,0x8AED,0x8AF3,0x8AF6,0x8AFC,0x8C6B,0x8C6D,0x8C93, +0x8CF4,0x8E44,0x8E31,0x8E34,0x8E42,0x8E39,0x8E35,0x8F3B, +0x8F2F,0x8F38,0x8F33,0x8FA8,0x8FA6,0x9075,0x9074,0x9078, +0x9072,0x907C,0x907A,0x9134,0x9192,0x9320,0x9336,0x92F8, +0x9333,0x932F,0x9322,0x92FC,0x932B,0x9304,0x931A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9310,0x9326,0x9321,0x9315,0x932E,0x9319,0x95BB,0x96A7, +0x96A8,0x96AA,0x96D5,0x970E,0x9711,0x9716,0x970D,0x9713, +0x970F,0x975B,0x975C,0x9766,0x9798,0x9830,0x9838,0x983B, +0x9837,0x982D,0x9839,0x9824,0x9910,0x9928,0x991E,0x991B, +0x9921,0x991A,0x99ED,0x99E2,0x99F1,0x9AB8,0x9ABC,0x9AFB, +0x9AED,0x9B28,0x9B91,0x9D15,0x9D23,0x9D26,0x9D28,0x9D12, +0x9D1B,0x9ED8,0x9ED4,0x9F8D,0x9F9C,0x512A,0x511F,0x5121, +0x5132,0x52F5,0x568E,0x5680,0x5690,0x5685,0x5687, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x568F,0x58D5,0x58D3,0x58D1,0x58CE,0x5B30,0x5B2A, +0x5B24,0x5B7A,0x5C37,0x5C68,0x5DBC,0x5DBA,0x5DBD,0x5DB8, +0x5E6B,0x5F4C,0x5FBD,0x61C9,0x61C2,0x61C7,0x61E6,0x61CB, +0x6232,0x6234,0x64CE,0x64CA,0x64D8,0x64E0,0x64F0,0x64E6, +0x64EC,0x64F1,0x64E2,0x64ED,0x6582,0x6583,0x66D9,0x66D6, +0x6A80,0x6A94,0x6A84,0x6AA2,0x6A9C,0x6ADB,0x6AA3,0x6A7E, +0x6A97,0x6A90,0x6AA0,0x6B5C,0x6BAE,0x6BDA,0x6C08,0x6FD8, +0x6FF1,0x6FDF,0x6FE0,0x6FDB,0x6FE4,0x6FEB,0x6FEF,0x6F80, +0x6FEC,0x6FE1,0x6FE9,0x6FD5,0x6FEE,0x6FF0,0x71E7,0x71DF, +0x71EE,0x71E6,0x71E5,0x71ED,0x71EC,0x71F4,0x71E0,0x7235, +0x7246,0x7370,0x7372,0x74A9,0x74B0,0x74A6,0x74A8,0x7646, +0x7642,0x764C,0x76EA,0x77B3,0x77AA,0x77B0,0x77AC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x77A7,0x77AD,0x77EF,0x78F7,0x78FA,0x78F4,0x78EF,0x7901, +0x79A7,0x79AA,0x7A57,0x7ABF,0x7C07,0x7C0D,0x7BFE,0x7BF7, +0x7C0C,0x7BE0,0x7CE0,0x7CDC,0x7CDE,0x7CE2,0x7CDF,0x7CD9, +0x7CDD,0x7E2E,0x7E3E,0x7E46,0x7E37,0x7E32,0x7E43,0x7E2B, +0x7E3D,0x7E31,0x7E45,0x7E41,0x7E34,0x7E39,0x7E48,0x7E35, +0x7E3F,0x7E2F,0x7F44,0x7FF3,0x7FFC,0x8071,0x8072,0x8070, +0x806F,0x8073,0x81C6,0x81C3,0x81BA,0x81C2,0x81C0,0x81BF, +0x81BD,0x81C9,0x81BE,0x81E8,0x8209,0x8271,0x85AA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8584,0x857E,0x859C,0x8591,0x8594,0x85AF,0x859B, +0x8587,0x85A8,0x858A,0x8667,0x87C0,0x87D1,0x87B3,0x87D2, +0x87C6,0x87AB,0x87BB,0x87BA,0x87C8,0x87CB,0x893B,0x8936, +0x8944,0x8938,0x893D,0x89AC,0x8B0E,0x8B17,0x8B19,0x8B1B, +0x8B0A,0x8B20,0x8B1D,0x8B04,0x8B10,0x8C41,0x8C3F,0x8C73, +0x8CFA,0x8CFD,0x8CFC,0x8CF8,0x8CFB,0x8DA8,0x8E49,0x8E4B, +0x8E48,0x8E4A,0x8F44,0x8F3E,0x8F42,0x8F45,0x8F3F,0x907F, +0x907D,0x9084,0x9081,0x9082,0x9080,0x9139,0x91A3,0x919E, +0x919C,0x934D,0x9382,0x9328,0x9375,0x934A,0x9365,0x934B, +0x9318,0x937E,0x936C,0x935B,0x9370,0x935A,0x9354,0x95CA, +0x95CB,0x95CC,0x95C8,0x95C6,0x96B1,0x96B8,0x96D6,0x971C, +0x971E,0x97A0,0x97D3,0x9846,0x98B6,0x9935,0x9A01, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x99FF,0x9BAE,0x9BAB,0x9BAA,0x9BAD,0x9D3B,0x9D3F,0x9E8B, +0x9ECF,0x9EDE,0x9EDC,0x9EDD,0x9EDB,0x9F3E,0x9F4B,0x53E2, +0x5695,0x56AE,0x58D9,0x58D8,0x5B38,0x5F5D,0x61E3,0x6233, +0x64F4,0x64F2,0x64FE,0x6506,0x64FA,0x64FB,0x64F7,0x65B7, +0x66DC,0x6726,0x6AB3,0x6AAC,0x6AC3,0x6ABB,0x6AB8,0x6AC2, +0x6AAE,0x6AAF,0x6B5F,0x6B78,0x6BAF,0x7009,0x700B,0x6FFE, +0x7006,0x6FFA,0x7011,0x700F,0x71FB,0x71FC,0x71FE,0x71F8, +0x7377,0x7375,0x74A7,0x74BF,0x7515,0x7656,0x7658, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7652,0x77BD,0x77BF,0x77BB,0x77BC,0x790E,0x79AE, +0x7A61,0x7A62,0x7A60,0x7AC4,0x7AC5,0x7C2B,0x7C27,0x7C2A, +0x7C1E,0x7C23,0x7C21,0x7CE7,0x7E54,0x7E55,0x7E5E,0x7E5A, +0x7E61,0x7E52,0x7E59,0x7F48,0x7FF9,0x7FFB,0x8077,0x8076, +0x81CD,0x81CF,0x820A,0x85CF,0x85A9,0x85CD,0x85D0,0x85C9, +0x85B0,0x85BA,0x85B9,0x85A6,0x87EF,0x87EC,0x87F2,0x87E0, +0x8986,0x89B2,0x89F4,0x8B28,0x8B39,0x8B2C,0x8B2B,0x8C50, +0x8D05,0x8E59,0x8E63,0x8E66,0x8E64,0x8E5F,0x8E55,0x8EC0, +0x8F49,0x8F4D,0x9087,0x9083,0x9088,0x91AB,0x91AC,0x91D0, +0x9394,0x938A,0x9396,0x93A2,0x93B3,0x93AE,0x93AC,0x93B0, +0x9398,0x939A,0x9397,0x95D4,0x95D6,0x95D0,0x95D5,0x96E2, +0x96DC,0x96D9,0x96DB,0x96DE,0x9724,0x97A3,0x97A6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x97AD,0x97F9,0x984D,0x984F,0x984C,0x984E,0x9853,0x98BA, +0x993E,0x993F,0x993D,0x992E,0x99A5,0x9A0E,0x9AC1,0x9B03, +0x9B06,0x9B4F,0x9B4E,0x9B4D,0x9BCA,0x9BC9,0x9BFD,0x9BC8, +0x9BC0,0x9D51,0x9D5D,0x9D60,0x9EE0,0x9F15,0x9F2C,0x5133, +0x56A5,0x58DE,0x58DF,0x58E2,0x5BF5,0x9F90,0x5EEC,0x61F2, +0x61F7,0x61F6,0x61F5,0x6500,0x650F,0x66E0,0x66DD,0x6AE5, +0x6ADD,0x6ADA,0x6AD3,0x701B,0x701F,0x7028,0x701A,0x701D, +0x7015,0x7018,0x7206,0x720D,0x7258,0x72A2,0x7378, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x737A,0x74BD,0x74CA,0x74E3,0x7587,0x7586,0x765F, +0x7661,0x77C7,0x7919,0x79B1,0x7A6B,0x7A69,0x7C3E,0x7C3F, +0x7C38,0x7C3D,0x7C37,0x7C40,0x7E6B,0x7E6D,0x7E79,0x7E69, +0x7E6A,0x7F85,0x7E73,0x7FB6,0x7FB9,0x7FB8,0x81D8,0x85E9, +0x85DD,0x85EA,0x85D5,0x85E4,0x85E5,0x85F7,0x87FB,0x8805, +0x880D,0x87F9,0x87FE,0x8960,0x895F,0x8956,0x895E,0x8B41, +0x8B5C,0x8B58,0x8B49,0x8B5A,0x8B4E,0x8B4F,0x8B46,0x8B59, +0x8D08,0x8D0A,0x8E7C,0x8E72,0x8E87,0x8E76,0x8E6C,0x8E7A, +0x8E74,0x8F54,0x8F4E,0x8FAD,0x908A,0x908B,0x91B1,0x91AE, +0x93E1,0x93D1,0x93DF,0x93C3,0x93C8,0x93DC,0x93DD,0x93D6, +0x93E2,0x93CD,0x93D8,0x93E4,0x93D7,0x93E8,0x95DC,0x96B4, +0x96E3,0x972A,0x9727,0x9761,0x97DC,0x97FB,0x985E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9858,0x985B,0x98BC,0x9945,0x9949,0x9A16,0x9A19,0x9B0D, +0x9BE8,0x9BE7,0x9BD6,0x9BDB,0x9D89,0x9D61,0x9D72,0x9D6A, +0x9D6C,0x9E92,0x9E97,0x9E93,0x9EB4,0x52F8,0x56A8,0x56B7, +0x56B6,0x56B4,0x56BC,0x58E4,0x5B40,0x5B43,0x5B7D,0x5BF6, +0x5DC9,0x61F8,0x61FA,0x6518,0x6514,0x6519,0x66E6,0x6727, +0x6AEC,0x703E,0x7030,0x7032,0x7210,0x737B,0x74CF,0x7662, +0x7665,0x7926,0x792A,0x792C,0x792B,0x7AC7,0x7AF6,0x7C4C, +0x7C43,0x7C4D,0x7CEF,0x7CF0,0x8FAE,0x7E7D,0x7E7C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7E82,0x7F4C,0x8000,0x81DA,0x8266,0x85FB,0x85F9, +0x8611,0x85FA,0x8606,0x860B,0x8607,0x860A,0x8814,0x8815, +0x8964,0x89BA,0x89F8,0x8B70,0x8B6C,0x8B66,0x8B6F,0x8B5F, +0x8B6B,0x8D0F,0x8D0D,0x8E89,0x8E81,0x8E85,0x8E82,0x91B4, +0x91CB,0x9418,0x9403,0x93FD,0x95E1,0x9730,0x98C4,0x9952, +0x9951,0x99A8,0x9A2B,0x9A30,0x9A37,0x9A35,0x9C13,0x9C0D, +0x9E79,0x9EB5,0x9EE8,0x9F2F,0x9F5F,0x9F63,0x9F61,0x5137, +0x5138,0x56C1,0x56C0,0x56C2,0x5914,0x5C6C,0x5DCD,0x61FC, +0x61FE,0x651D,0x651C,0x6595,0x66E9,0x6AFB,0x6B04,0x6AFA, +0x6BB2,0x704C,0x721B,0x72A7,0x74D6,0x74D4,0x7669,0x77D3, +0x7C50,0x7E8F,0x7E8C,0x7FBC,0x8617,0x862D,0x861A,0x8823, +0x8822,0x8821,0x881F,0x896A,0x896C,0x89BD,0x8B74, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B77,0x8B7D,0x8D13,0x8E8A,0x8E8D,0x8E8B,0x8F5F,0x8FAF, +0x91BA,0x942E,0x9433,0x9435,0x943A,0x9438,0x9432,0x942B, +0x95E2,0x9738,0x9739,0x9732,0x97FF,0x9867,0x9865,0x9957, +0x9A45,0x9A43,0x9A40,0x9A3E,0x9ACF,0x9B54,0x9B51,0x9C2D, +0x9C25,0x9DAF,0x9DB4,0x9DC2,0x9DB8,0x9E9D,0x9EEF,0x9F19, +0x9F5C,0x9F66,0x9F67,0x513C,0x513B,0x56C8,0x56CA,0x56C9, +0x5B7F,0x5DD4,0x5DD2,0x5F4E,0x61FF,0x6524,0x6B0A,0x6B61, +0x7051,0x7058,0x7380,0x74E4,0x758A,0x766E,0x766C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x79B3,0x7C60,0x7C5F,0x807E,0x807D,0x81DF,0x8972, +0x896F,0x89FC,0x8B80,0x8D16,0x8D17,0x8E91,0x8E93,0x8F61, +0x9148,0x9444,0x9451,0x9452,0x973D,0x973E,0x97C3,0x97C1, +0x986B,0x9955,0x9A55,0x9A4D,0x9AD2,0x9B1A,0x9C49,0x9C31, +0x9C3E,0x9C3B,0x9DD3,0x9DD7,0x9F34,0x9F6C,0x9F6A,0x9F94, +0x56CC,0x5DD6,0x6200,0x6523,0x652B,0x652A,0x66EC,0x6B10, +0x74DA,0x7ACA,0x7C64,0x7C63,0x7C65,0x7E93,0x7E96,0x7E94, +0x81E2,0x8638,0x863F,0x8831,0x8B8A,0x9090,0x908F,0x9463, +0x9460,0x9464,0x9768,0x986F,0x995C,0x9A5A,0x9A5B,0x9A57, +0x9AD3,0x9AD4,0x9AD1,0x9C54,0x9C57,0x9C56,0x9DE5,0x9E9F, +0x9EF4,0x56D1,0x58E9,0x652C,0x705E,0x7671,0x7672,0x77D7, +0x7F50,0x7F88,0x8836,0x8839,0x8862,0x8B93,0x8B92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B96,0x8277,0x8D1B,0x91C0,0x946A,0x9742,0x9748,0x9744, +0x97C6,0x9870,0x9A5F,0x9B22,0x9B58,0x9C5F,0x9DF9,0x9DFA, +0x9E7C,0x9E7D,0x9F07,0x9F77,0x9F72,0x5EF3,0x6B16,0x7063, +0x7C6C,0x7C6E,0x883B,0x89C0,0x8EA1,0x91C1,0x9472,0x9470, +0x9871,0x995E,0x9AD6,0x9B23,0x9ECC,0x7064,0x77DA,0x8B9A, +0x9477,0x97C9,0x9A62,0x9A65,0x7E9C,0x8B9C,0x8EAA,0x91C5, +0x947D,0x947E,0x947C,0x9C77,0x9C78,0x9EF7,0x8C54,0x947F, +0x9E1A,0x7228,0x9A6A,0x9B31,0x9E1B,0x9E1E,0x7C72, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x30FE,0x309D,0x309E,0x3005,0x3041,0x3042,0x3043, +0x3044,0x3045,0x3046,0x3047,0x3048,0x3049,0x304A,0x304B, +0x304C,0x304D,0x304E,0x304F,0x3050,0x3051,0x3052,0x3053, +0x3054,0x3055,0x3056,0x3057,0x3058,0x3059,0x305A,0x305B, +0x305C,0x305D,0x305E,0x305F,0x3060,0x3061,0x3062,0x3063, +0x3064,0x3065,0x3066,0x3067,0x3068,0x3069,0x306A,0x306B, +0x306C,0x306D,0x306E,0x306F,0x3070,0x3071,0x3072,0x3073, +0x3074,0x3075,0x3076,0x3077,0x3078,0x3079,0x307A,0x307B, +0x307C,0x307D,0x307E,0x307F,0x3080,0x3081,0x3082,0x3083, +0x3084,0x3085,0x3086,0x3087,0x3088,0x3089,0x308A,0x308B, +0x308C,0x308D,0x308E,0x308F,0x3090,0x3091,0x3092,0x3093, +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x30A8,0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF, +0x30B0,0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7, +0x30B8,0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF, +0x30C0,0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7, +0x30C8,0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF, +0x30D0,0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7, +0x30D8,0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF, +0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x30E7,0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED, +0x30EE,0x30EF,0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5, +0x30F6,0x0414,0x0415,0x0401,0x0416,0x0417,0x0418,0x0419, +0x041A,0x041B,0x041C,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446, +0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E, +0x044F,0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466, +0x2467,0x2468,0x2469,0x2474,0x2475,0x2476,0x2477,0x2478, +0x2479,0x247A,0x247B,0x247C,0x247D}; + +/* page 1 0xC940-0xF9DC */ +static uint16 tab_big5_uni1[]={ +0x4E42,0x4E5C,0x51F5,0x531A,0x5382,0x4E07,0x4E0C,0x4E47, +0x4E8D,0x56D7,0xFA0C,0x5C6E,0x5F73,0x4E0F,0x5187,0x4E0E, +0x4E2E,0x4E93,0x4EC2,0x4EC9,0x4EC8,0x5198,0x52FC,0x536C, +0x53B9,0x5720,0x5903,0x592C,0x5C10,0x5DFF,0x65E1,0x6BB3, +0x6BCC,0x6C14,0x723F,0x4E31,0x4E3C,0x4EE8,0x4EDC,0x4EE9, +0x4EE1,0x4EDD,0x4EDA,0x520C,0x531C,0x534C,0x5722,0x5723, +0x5917,0x592F,0x5B81,0x5B84,0x5C12,0x5C3B,0x5C74,0x5C73, +0x5E04,0x5E80,0x5E82,0x5FC9,0x6209,0x6250,0x6C15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C36,0x6C43,0x6C3F,0x6C3B,0x72AE,0x72B0,0x738A, +0x79B8,0x808A,0x961E,0x4F0E,0x4F18,0x4F2C,0x4EF5,0x4F14, +0x4EF1,0x4F00,0x4EF7,0x4F08,0x4F1D,0x4F02,0x4F05,0x4F22, +0x4F13,0x4F04,0x4EF4,0x4F12,0x51B1,0x5213,0x5209,0x5210, +0x52A6,0x5322,0x531F,0x534D,0x538A,0x5407,0x56E1,0x56DF, +0x572E,0x572A,0x5734,0x593C,0x5980,0x597C,0x5985,0x597B, +0x597E,0x5977,0x597F,0x5B56,0x5C15,0x5C25,0x5C7C,0x5C7A, +0x5C7B,0x5C7E,0x5DDF,0x5E75,0x5E84,0x5F02,0x5F1A,0x5F74, +0x5FD5,0x5FD4,0x5FCF,0x625C,0x625E,0x6264,0x6261,0x6266, +0x6262,0x6259,0x6260,0x625A,0x6265,0x65EF,0x65EE,0x673E, +0x6739,0x6738,0x673B,0x673A,0x673F,0x673C,0x6733,0x6C18, +0x6C46,0x6C52,0x6C5C,0x6C4F,0x6C4A,0x6C54,0x6C4B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C4C,0x7071,0x725E,0x72B4,0x72B5,0x738E,0x752A,0x767F, +0x7A75,0x7F51,0x8278,0x827C,0x8280,0x827D,0x827F,0x864D, +0x897E,0x9099,0x9097,0x9098,0x909B,0x9094,0x9622,0x9624, +0x9620,0x9623,0x4F56,0x4F3B,0x4F62,0x4F49,0x4F53,0x4F64, +0x4F3E,0x4F67,0x4F52,0x4F5F,0x4F41,0x4F58,0x4F2D,0x4F33, +0x4F3F,0x4F61,0x518F,0x51B9,0x521C,0x521E,0x5221,0x52AD, +0x52AE,0x5309,0x5363,0x5372,0x538E,0x538F,0x5430,0x5437, +0x542A,0x5454,0x5445,0x5419,0x541C,0x5425,0x5418, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x543D,0x544F,0x5441,0x5428,0x5424,0x5447,0x56EE, +0x56E7,0x56E5,0x5741,0x5745,0x574C,0x5749,0x574B,0x5752, +0x5906,0x5940,0x59A6,0x5998,0x59A0,0x5997,0x598E,0x59A2, +0x5990,0x598F,0x59A7,0x59A1,0x5B8E,0x5B92,0x5C28,0x5C2A, +0x5C8D,0x5C8F,0x5C88,0x5C8B,0x5C89,0x5C92,0x5C8A,0x5C86, +0x5C93,0x5C95,0x5DE0,0x5E0A,0x5E0E,0x5E8B,0x5E89,0x5E8C, +0x5E88,0x5E8D,0x5F05,0x5F1D,0x5F78,0x5F76,0x5FD2,0x5FD1, +0x5FD0,0x5FED,0x5FE8,0x5FEE,0x5FF3,0x5FE1,0x5FE4,0x5FE3, +0x5FFA,0x5FEF,0x5FF7,0x5FFB,0x6000,0x5FF4,0x623A,0x6283, +0x628C,0x628E,0x628F,0x6294,0x6287,0x6271,0x627B,0x627A, +0x6270,0x6281,0x6288,0x6277,0x627D,0x6272,0x6274,0x6537, +0x65F0,0x65F4,0x65F3,0x65F2,0x65F5,0x6745,0x6747, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6759,0x6755,0x674C,0x6748,0x675D,0x674D,0x675A,0x674B, +0x6BD0,0x6C19,0x6C1A,0x6C78,0x6C67,0x6C6B,0x6C84,0x6C8B, +0x6C8F,0x6C71,0x6C6F,0x6C69,0x6C9A,0x6C6D,0x6C87,0x6C95, +0x6C9C,0x6C66,0x6C73,0x6C65,0x6C7B,0x6C8E,0x7074,0x707A, +0x7263,0x72BF,0x72BD,0x72C3,0x72C6,0x72C1,0x72BA,0x72C5, +0x7395,0x7397,0x7393,0x7394,0x7392,0x753A,0x7539,0x7594, +0x7595,0x7681,0x793D,0x8034,0x8095,0x8099,0x8090,0x8092, +0x809C,0x8290,0x828F,0x8285,0x828E,0x8291,0x8293, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x828A,0x8283,0x8284,0x8C78,0x8FC9,0x8FBF,0x909F, +0x90A1,0x90A5,0x909E,0x90A7,0x90A0,0x9630,0x9628,0x962F, +0x962D,0x4E33,0x4F98,0x4F7C,0x4F85,0x4F7D,0x4F80,0x4F87, +0x4F76,0x4F74,0x4F89,0x4F84,0x4F77,0x4F4C,0x4F97,0x4F6A, +0x4F9A,0x4F79,0x4F81,0x4F78,0x4F90,0x4F9C,0x4F94,0x4F9E, +0x4F92,0x4F82,0x4F95,0x4F6B,0x4F6E,0x519E,0x51BC,0x51BE, +0x5235,0x5232,0x5233,0x5246,0x5231,0x52BC,0x530A,0x530B, +0x533C,0x5392,0x5394,0x5487,0x547F,0x5481,0x5491,0x5482, +0x5488,0x546B,0x547A,0x547E,0x5465,0x546C,0x5474,0x5466, +0x548D,0x546F,0x5461,0x5460,0x5498,0x5463,0x5467,0x5464, +0x56F7,0x56F9,0x576F,0x5772,0x576D,0x576B,0x5771,0x5770, +0x5776,0x5780,0x5775,0x577B,0x5773,0x5774,0x5762, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5768,0x577D,0x590C,0x5945,0x59B5,0x59BA,0x59CF,0x59CE, +0x59B2,0x59CC,0x59C1,0x59B6,0x59BC,0x59C3,0x59D6,0x59B1, +0x59BD,0x59C0,0x59C8,0x59B4,0x59C7,0x5B62,0x5B65,0x5B93, +0x5B95,0x5C44,0x5C47,0x5CAE,0x5CA4,0x5CA0,0x5CB5,0x5CAF, +0x5CA8,0x5CAC,0x5C9F,0x5CA3,0x5CAD,0x5CA2,0x5CAA,0x5CA7, +0x5C9D,0x5CA5,0x5CB6,0x5CB0,0x5CA6,0x5E17,0x5E14,0x5E19, +0x5F28,0x5F22,0x5F23,0x5F24,0x5F54,0x5F82,0x5F7E,0x5F7D, +0x5FDE,0x5FE5,0x602D,0x6026,0x6019,0x6032,0x600B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6034,0x600A,0x6017,0x6033,0x601A,0x601E,0x602C, +0x6022,0x600D,0x6010,0x602E,0x6013,0x6011,0x600C,0x6009, +0x601C,0x6214,0x623D,0x62AD,0x62B4,0x62D1,0x62BE,0x62AA, +0x62B6,0x62CA,0x62AE,0x62B3,0x62AF,0x62BB,0x62A9,0x62B0, +0x62B8,0x653D,0x65A8,0x65BB,0x6609,0x65FC,0x6604,0x6612, +0x6608,0x65FB,0x6603,0x660B,0x660D,0x6605,0x65FD,0x6611, +0x6610,0x66F6,0x670A,0x6785,0x676C,0x678E,0x6792,0x6776, +0x677B,0x6798,0x6786,0x6784,0x6774,0x678D,0x678C,0x677A, +0x679F,0x6791,0x6799,0x6783,0x677D,0x6781,0x6778,0x6779, +0x6794,0x6B25,0x6B80,0x6B7E,0x6BDE,0x6C1D,0x6C93,0x6CEC, +0x6CEB,0x6CEE,0x6CD9,0x6CB6,0x6CD4,0x6CAD,0x6CE7,0x6CB7, +0x6CD0,0x6CC2,0x6CBA,0x6CC3,0x6CC6,0x6CED,0x6CF2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6CD2,0x6CDD,0x6CB4,0x6C8A,0x6C9D,0x6C80,0x6CDE,0x6CC0, +0x6D30,0x6CCD,0x6CC7,0x6CB0,0x6CF9,0x6CCF,0x6CE9,0x6CD1, +0x7094,0x7098,0x7085,0x7093,0x7086,0x7084,0x7091,0x7096, +0x7082,0x709A,0x7083,0x726A,0x72D6,0x72CB,0x72D8,0x72C9, +0x72DC,0x72D2,0x72D4,0x72DA,0x72CC,0x72D1,0x73A4,0x73A1, +0x73AD,0x73A6,0x73A2,0x73A0,0x73AC,0x739D,0x74DD,0x74E8, +0x753F,0x7540,0x753E,0x758C,0x7598,0x76AF,0x76F3,0x76F1, +0x76F0,0x76F5,0x77F8,0x77FC,0x77F9,0x77FB,0x77FA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x77F7,0x7942,0x793F,0x79C5,0x7A78,0x7A7B,0x7AFB, +0x7C75,0x7CFD,0x8035,0x808F,0x80AE,0x80A3,0x80B8,0x80B5, +0x80AD,0x8220,0x82A0,0x82C0,0x82AB,0x829A,0x8298,0x829B, +0x82B5,0x82A7,0x82AE,0x82BC,0x829E,0x82BA,0x82B4,0x82A8, +0x82A1,0x82A9,0x82C2,0x82A4,0x82C3,0x82B6,0x82A2,0x8670, +0x866F,0x866D,0x866E,0x8C56,0x8FD2,0x8FCB,0x8FD3,0x8FCD, +0x8FD6,0x8FD5,0x8FD7,0x90B2,0x90B4,0x90AF,0x90B3,0x90B0, +0x9639,0x963D,0x963C,0x963A,0x9643,0x4FCD,0x4FC5,0x4FD3, +0x4FB2,0x4FC9,0x4FCB,0x4FC1,0x4FD4,0x4FDC,0x4FD9,0x4FBB, +0x4FB3,0x4FDB,0x4FC7,0x4FD6,0x4FBA,0x4FC0,0x4FB9,0x4FEC, +0x5244,0x5249,0x52C0,0x52C2,0x533D,0x537C,0x5397,0x5396, +0x5399,0x5398,0x54BA,0x54A1,0x54AD,0x54A5,0x54CF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x54C3,0x830D,0x54B7,0x54AE,0x54D6,0x54B6,0x54C5,0x54C6, +0x54A0,0x5470,0x54BC,0x54A2,0x54BE,0x5472,0x54DE,0x54B0, +0x57B5,0x579E,0x579F,0x57A4,0x578C,0x5797,0x579D,0x579B, +0x5794,0x5798,0x578F,0x5799,0x57A5,0x579A,0x5795,0x58F4, +0x590D,0x5953,0x59E1,0x59DE,0x59EE,0x5A00,0x59F1,0x59DD, +0x59FA,0x59FD,0x59FC,0x59F6,0x59E4,0x59F2,0x59F7,0x59DB, +0x59E9,0x59F3,0x59F5,0x59E0,0x59FE,0x59F4,0x59ED,0x5BA8, +0x5C4C,0x5CD0,0x5CD8,0x5CCC,0x5CD7,0x5CCB,0x5CDB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5CDE,0x5CDA,0x5CC9,0x5CC7,0x5CCA,0x5CD6,0x5CD3, +0x5CD4,0x5CCF,0x5CC8,0x5CC6,0x5CCE,0x5CDF,0x5CF8,0x5DF9, +0x5E21,0x5E22,0x5E23,0x5E20,0x5E24,0x5EB0,0x5EA4,0x5EA2, +0x5E9B,0x5EA3,0x5EA5,0x5F07,0x5F2E,0x5F56,0x5F86,0x6037, +0x6039,0x6054,0x6072,0x605E,0x6045,0x6053,0x6047,0x6049, +0x605B,0x604C,0x6040,0x6042,0x605F,0x6024,0x6044,0x6058, +0x6066,0x606E,0x6242,0x6243,0x62CF,0x630D,0x630B,0x62F5, +0x630E,0x6303,0x62EB,0x62F9,0x630F,0x630C,0x62F8,0x62F6, +0x6300,0x6313,0x6314,0x62FA,0x6315,0x62FB,0x62F0,0x6541, +0x6543,0x65AA,0x65BF,0x6636,0x6621,0x6632,0x6635,0x661C, +0x6626,0x6622,0x6633,0x662B,0x663A,0x661D,0x6634,0x6639, +0x662E,0x670F,0x6710,0x67C1,0x67F2,0x67C8,0x67BA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x67DC,0x67BB,0x67F8,0x67D8,0x67C0,0x67B7,0x67C5,0x67EB, +0x67E4,0x67DF,0x67B5,0x67CD,0x67B3,0x67F7,0x67F6,0x67EE, +0x67E3,0x67C2,0x67B9,0x67CE,0x67E7,0x67F0,0x67B2,0x67FC, +0x67C6,0x67ED,0x67CC,0x67AE,0x67E6,0x67DB,0x67FA,0x67C9, +0x67CA,0x67C3,0x67EA,0x67CB,0x6B28,0x6B82,0x6B84,0x6BB6, +0x6BD6,0x6BD8,0x6BE0,0x6C20,0x6C21,0x6D28,0x6D34,0x6D2D, +0x6D1F,0x6D3C,0x6D3F,0x6D12,0x6D0A,0x6CDA,0x6D33,0x6D04, +0x6D19,0x6D3A,0x6D1A,0x6D11,0x6D00,0x6D1D,0x6D42, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6D01,0x6D18,0x6D37,0x6D03,0x6D0F,0x6D40,0x6D07, +0x6D20,0x6D2C,0x6D08,0x6D22,0x6D09,0x6D10,0x70B7,0x709F, +0x70BE,0x70B1,0x70B0,0x70A1,0x70B4,0x70B5,0x70A9,0x7241, +0x7249,0x724A,0x726C,0x7270,0x7273,0x726E,0x72CA,0x72E4, +0x72E8,0x72EB,0x72DF,0x72EA,0x72E6,0x72E3,0x7385,0x73CC, +0x73C2,0x73C8,0x73C5,0x73B9,0x73B6,0x73B5,0x73B4,0x73EB, +0x73BF,0x73C7,0x73BE,0x73C3,0x73C6,0x73B8,0x73CB,0x74EC, +0x74EE,0x752E,0x7547,0x7548,0x75A7,0x75AA,0x7679,0x76C4, +0x7708,0x7703,0x7704,0x7705,0x770A,0x76F7,0x76FB,0x76FA, +0x77E7,0x77E8,0x7806,0x7811,0x7812,0x7805,0x7810,0x780F, +0x780E,0x7809,0x7803,0x7813,0x794A,0x794C,0x794B,0x7945, +0x7944,0x79D5,0x79CD,0x79CF,0x79D6,0x79CE,0x7A80, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7A7E,0x7AD1,0x7B00,0x7B01,0x7C7A,0x7C78,0x7C79,0x7C7F, +0x7C80,0x7C81,0x7D03,0x7D08,0x7D01,0x7F58,0x7F91,0x7F8D, +0x7FBE,0x8007,0x800E,0x800F,0x8014,0x8037,0x80D8,0x80C7, +0x80E0,0x80D1,0x80C8,0x80C2,0x80D0,0x80C5,0x80E3,0x80D9, +0x80DC,0x80CA,0x80D5,0x80C9,0x80CF,0x80D7,0x80E6,0x80CD, +0x81FF,0x8221,0x8294,0x82D9,0x82FE,0x82F9,0x8307,0x82E8, +0x8300,0x82D5,0x833A,0x82EB,0x82D6,0x82F4,0x82EC,0x82E1, +0x82F2,0x82F5,0x830C,0x82FB,0x82F6,0x82F0,0x82EA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x82E4,0x82E0,0x82FA,0x82F3,0x82ED,0x8677,0x8674, +0x867C,0x8673,0x8841,0x884E,0x8867,0x886A,0x8869,0x89D3, +0x8A04,0x8A07,0x8D72,0x8FE3,0x8FE1,0x8FEE,0x8FE0,0x90F1, +0x90BD,0x90BF,0x90D5,0x90C5,0x90BE,0x90C7,0x90CB,0x90C8, +0x91D4,0x91D3,0x9654,0x964F,0x9651,0x9653,0x964A,0x964E, +0x501E,0x5005,0x5007,0x5013,0x5022,0x5030,0x501B,0x4FF5, +0x4FF4,0x5033,0x5037,0x502C,0x4FF6,0x4FF7,0x5017,0x501C, +0x5020,0x5027,0x5035,0x502F,0x5031,0x500E,0x515A,0x5194, +0x5193,0x51CA,0x51C4,0x51C5,0x51C8,0x51CE,0x5261,0x525A, +0x5252,0x525E,0x525F,0x5255,0x5262,0x52CD,0x530E,0x539E, +0x5526,0x54E2,0x5517,0x5512,0x54E7,0x54F3,0x54E4,0x551A, +0x54FF,0x5504,0x5508,0x54EB,0x5511,0x5505,0x54F1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x550A,0x54FB,0x54F7,0x54F8,0x54E0,0x550E,0x5503,0x550B, +0x5701,0x5702,0x57CC,0x5832,0x57D5,0x57D2,0x57BA,0x57C6, +0x57BD,0x57BC,0x57B8,0x57B6,0x57BF,0x57C7,0x57D0,0x57B9, +0x57C1,0x590E,0x594A,0x5A19,0x5A16,0x5A2D,0x5A2E,0x5A15, +0x5A0F,0x5A17,0x5A0A,0x5A1E,0x5A33,0x5B6C,0x5BA7,0x5BAD, +0x5BAC,0x5C03,0x5C56,0x5C54,0x5CEC,0x5CFF,0x5CEE,0x5CF1, +0x5CF7,0x5D00,0x5CF9,0x5E29,0x5E28,0x5EA8,0x5EAE,0x5EAA, +0x5EAC,0x5F33,0x5F30,0x5F67,0x605D,0x605A,0x6067, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6041,0x60A2,0x6088,0x6080,0x6092,0x6081,0x609D, +0x6083,0x6095,0x609B,0x6097,0x6087,0x609C,0x608E,0x6219, +0x6246,0x62F2,0x6310,0x6356,0x632C,0x6344,0x6345,0x6336, +0x6343,0x63E4,0x6339,0x634B,0x634A,0x633C,0x6329,0x6341, +0x6334,0x6358,0x6354,0x6359,0x632D,0x6347,0x6333,0x635A, +0x6351,0x6338,0x6357,0x6340,0x6348,0x654A,0x6546,0x65C6, +0x65C3,0x65C4,0x65C2,0x664A,0x665F,0x6647,0x6651,0x6712, +0x6713,0x681F,0x681A,0x6849,0x6832,0x6833,0x683B,0x684B, +0x684F,0x6816,0x6831,0x681C,0x6835,0x682B,0x682D,0x682F, +0x684E,0x6844,0x6834,0x681D,0x6812,0x6814,0x6826,0x6828, +0x682E,0x684D,0x683A,0x6825,0x6820,0x6B2C,0x6B2F,0x6B2D, +0x6B31,0x6B34,0x6B6D,0x8082,0x6B88,0x6BE6,0x6BE4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6BE8,0x6BE3,0x6BE2,0x6BE7,0x6C25,0x6D7A,0x6D63,0x6D64, +0x6D76,0x6D0D,0x6D61,0x6D92,0x6D58,0x6D62,0x6D6D,0x6D6F, +0x6D91,0x6D8D,0x6DEF,0x6D7F,0x6D86,0x6D5E,0x6D67,0x6D60, +0x6D97,0x6D70,0x6D7C,0x6D5F,0x6D82,0x6D98,0x6D2F,0x6D68, +0x6D8B,0x6D7E,0x6D80,0x6D84,0x6D16,0x6D83,0x6D7B,0x6D7D, +0x6D75,0x6D90,0x70DC,0x70D3,0x70D1,0x70DD,0x70CB,0x7F39, +0x70E2,0x70D7,0x70D2,0x70DE,0x70E0,0x70D4,0x70CD,0x70C5, +0x70C6,0x70C7,0x70DA,0x70CE,0x70E1,0x7242,0x7278, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7277,0x7276,0x7300,0x72FA,0x72F4,0x72FE,0x72F6, +0x72F3,0x72FB,0x7301,0x73D3,0x73D9,0x73E5,0x73D6,0x73BC, +0x73E7,0x73E3,0x73E9,0x73DC,0x73D2,0x73DB,0x73D4,0x73DD, +0x73DA,0x73D7,0x73D8,0x73E8,0x74DE,0x74DF,0x74F4,0x74F5, +0x7521,0x755B,0x755F,0x75B0,0x75C1,0x75BB,0x75C4,0x75C0, +0x75BF,0x75B6,0x75BA,0x768A,0x76C9,0x771D,0x771B,0x7710, +0x7713,0x7712,0x7723,0x7711,0x7715,0x7719,0x771A,0x7722, +0x7727,0x7823,0x782C,0x7822,0x7835,0x782F,0x7828,0x782E, +0x782B,0x7821,0x7829,0x7833,0x782A,0x7831,0x7954,0x795B, +0x794F,0x795C,0x7953,0x7952,0x7951,0x79EB,0x79EC,0x79E0, +0x79EE,0x79ED,0x79EA,0x79DC,0x79DE,0x79DD,0x7A86,0x7A89, +0x7A85,0x7A8B,0x7A8C,0x7A8A,0x7A87,0x7AD8,0x7B10, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7B04,0x7B13,0x7B05,0x7B0F,0x7B08,0x7B0A,0x7B0E,0x7B09, +0x7B12,0x7C84,0x7C91,0x7C8A,0x7C8C,0x7C88,0x7C8D,0x7C85, +0x7D1E,0x7D1D,0x7D11,0x7D0E,0x7D18,0x7D16,0x7D13,0x7D1F, +0x7D12,0x7D0F,0x7D0C,0x7F5C,0x7F61,0x7F5E,0x7F60,0x7F5D, +0x7F5B,0x7F96,0x7F92,0x7FC3,0x7FC2,0x7FC0,0x8016,0x803E, +0x8039,0x80FA,0x80F2,0x80F9,0x80F5,0x8101,0x80FB,0x8100, +0x8201,0x822F,0x8225,0x8333,0x832D,0x8344,0x8319,0x8351, +0x8325,0x8356,0x833F,0x8341,0x8326,0x831C,0x8322, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8342,0x834E,0x831B,0x832A,0x8308,0x833C,0x834D, +0x8316,0x8324,0x8320,0x8337,0x832F,0x8329,0x8347,0x8345, +0x834C,0x8353,0x831E,0x832C,0x834B,0x8327,0x8348,0x8653, +0x8652,0x86A2,0x86A8,0x8696,0x868D,0x8691,0x869E,0x8687, +0x8697,0x8686,0x868B,0x869A,0x8685,0x86A5,0x8699,0x86A1, +0x86A7,0x8695,0x8698,0x868E,0x869D,0x8690,0x8694,0x8843, +0x8844,0x886D,0x8875,0x8876,0x8872,0x8880,0x8871,0x887F, +0x886F,0x8883,0x887E,0x8874,0x887C,0x8A12,0x8C47,0x8C57, +0x8C7B,0x8CA4,0x8CA3,0x8D76,0x8D78,0x8DB5,0x8DB7,0x8DB6, +0x8ED1,0x8ED3,0x8FFE,0x8FF5,0x9002,0x8FFF,0x8FFB,0x9004, +0x8FFC,0x8FF6,0x90D6,0x90E0,0x90D9,0x90DA,0x90E3,0x90DF, +0x90E5,0x90D8,0x90DB,0x90D7,0x90DC,0x90E4,0x9150, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x914E,0x914F,0x91D5,0x91E2,0x91DA,0x965C,0x965F,0x96BC, +0x98E3,0x9ADF,0x9B2F,0x4E7F,0x5070,0x506A,0x5061,0x505E, +0x5060,0x5053,0x504B,0x505D,0x5072,0x5048,0x504D,0x5041, +0x505B,0x504A,0x5062,0x5015,0x5045,0x505F,0x5069,0x506B, +0x5063,0x5064,0x5046,0x5040,0x506E,0x5073,0x5057,0x5051, +0x51D0,0x526B,0x526D,0x526C,0x526E,0x52D6,0x52D3,0x532D, +0x539C,0x5575,0x5576,0x553C,0x554D,0x5550,0x5534,0x552A, +0x5551,0x5562,0x5536,0x5535,0x5530,0x5552,0x5545, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x550C,0x5532,0x5565,0x554E,0x5539,0x5548,0x552D, +0x553B,0x5540,0x554B,0x570A,0x5707,0x57FB,0x5814,0x57E2, +0x57F6,0x57DC,0x57F4,0x5800,0x57ED,0x57FD,0x5808,0x57F8, +0x580B,0x57F3,0x57CF,0x5807,0x57EE,0x57E3,0x57F2,0x57E5, +0x57EC,0x57E1,0x580E,0x57FC,0x5810,0x57E7,0x5801,0x580C, +0x57F1,0x57E9,0x57F0,0x580D,0x5804,0x595C,0x5A60,0x5A58, +0x5A55,0x5A67,0x5A5E,0x5A38,0x5A35,0x5A6D,0x5A50,0x5A5F, +0x5A65,0x5A6C,0x5A53,0x5A64,0x5A57,0x5A43,0x5A5D,0x5A52, +0x5A44,0x5A5B,0x5A48,0x5A8E,0x5A3E,0x5A4D,0x5A39,0x5A4C, +0x5A70,0x5A69,0x5A47,0x5A51,0x5A56,0x5A42,0x5A5C,0x5B72, +0x5B6E,0x5BC1,0x5BC0,0x5C59,0x5D1E,0x5D0B,0x5D1D,0x5D1A, +0x5D20,0x5D0C,0x5D28,0x5D0D,0x5D26,0x5D25,0x5D0F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5D30,0x5D12,0x5D23,0x5D1F,0x5D2E,0x5E3E,0x5E34,0x5EB1, +0x5EB4,0x5EB9,0x5EB2,0x5EB3,0x5F36,0x5F38,0x5F9B,0x5F96, +0x5F9F,0x608A,0x6090,0x6086,0x60BE,0x60B0,0x60BA,0x60D3, +0x60D4,0x60CF,0x60E4,0x60D9,0x60DD,0x60C8,0x60B1,0x60DB, +0x60B7,0x60CA,0x60BF,0x60C3,0x60CD,0x60C0,0x6332,0x6365, +0x638A,0x6382,0x637D,0x63BD,0x639E,0x63AD,0x639D,0x6397, +0x63AB,0x638E,0x636F,0x6387,0x6390,0x636E,0x63AF,0x6375, +0x639C,0x636D,0x63AE,0x637C,0x63A4,0x633B,0x639F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6378,0x6385,0x6381,0x6391,0x638D,0x6370,0x6553, +0x65CD,0x6665,0x6661,0x665B,0x6659,0x665C,0x6662,0x6718, +0x6879,0x6887,0x6890,0x689C,0x686D,0x686E,0x68AE,0x68AB, +0x6956,0x686F,0x68A3,0x68AC,0x68A9,0x6875,0x6874,0x68B2, +0x688F,0x6877,0x6892,0x687C,0x686B,0x6872,0x68AA,0x6880, +0x6871,0x687E,0x689B,0x6896,0x688B,0x68A0,0x6889,0x68A4, +0x6878,0x687B,0x6891,0x688C,0x688A,0x687D,0x6B36,0x6B33, +0x6B37,0x6B38,0x6B91,0x6B8F,0x6B8D,0x6B8E,0x6B8C,0x6C2A, +0x6DC0,0x6DAB,0x6DB4,0x6DB3,0x6E74,0x6DAC,0x6DE9,0x6DE2, +0x6DB7,0x6DF6,0x6DD4,0x6E00,0x6DC8,0x6DE0,0x6DDF,0x6DD6, +0x6DBE,0x6DE5,0x6DDC,0x6DDD,0x6DDB,0x6DF4,0x6DCA,0x6DBD, +0x6DED,0x6DF0,0x6DBA,0x6DD5,0x6DC2,0x6DCF,0x6DC9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6DD0,0x6DF2,0x6DD3,0x6DFD,0x6DD7,0x6DCD,0x6DE3,0x6DBB, +0x70FA,0x710D,0x70F7,0x7117,0x70F4,0x710C,0x70F0,0x7104, +0x70F3,0x7110,0x70FC,0x70FF,0x7106,0x7113,0x7100,0x70F8, +0x70F6,0x710B,0x7102,0x710E,0x727E,0x727B,0x727C,0x727F, +0x731D,0x7317,0x7307,0x7311,0x7318,0x730A,0x7308,0x72FF, +0x730F,0x731E,0x7388,0x73F6,0x73F8,0x73F5,0x7404,0x7401, +0x73FD,0x7407,0x7400,0x73FA,0x73FC,0x73FF,0x740C,0x740B, +0x73F4,0x7408,0x7564,0x7563,0x75CE,0x75D2,0x75CF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x75CB,0x75CC,0x75D1,0x75D0,0x768F,0x7689,0x76D3, +0x7739,0x772F,0x772D,0x7731,0x7732,0x7734,0x7733,0x773D, +0x7725,0x773B,0x7735,0x7848,0x7852,0x7849,0x784D,0x784A, +0x784C,0x7826,0x7845,0x7850,0x7964,0x7967,0x7969,0x796A, +0x7963,0x796B,0x7961,0x79BB,0x79FA,0x79F8,0x79F6,0x79F7, +0x7A8F,0x7A94,0x7A90,0x7B35,0x7B47,0x7B34,0x7B25,0x7B30, +0x7B22,0x7B24,0x7B33,0x7B18,0x7B2A,0x7B1D,0x7B31,0x7B2B, +0x7B2D,0x7B2F,0x7B32,0x7B38,0x7B1A,0x7B23,0x7C94,0x7C98, +0x7C96,0x7CA3,0x7D35,0x7D3D,0x7D38,0x7D36,0x7D3A,0x7D45, +0x7D2C,0x7D29,0x7D41,0x7D47,0x7D3E,0x7D3F,0x7D4A,0x7D3B, +0x7D28,0x7F63,0x7F95,0x7F9C,0x7F9D,0x7F9B,0x7FCA,0x7FCB, +0x7FCD,0x7FD0,0x7FD1,0x7FC7,0x7FCF,0x7FC9,0x801F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x801E,0x801B,0x8047,0x8043,0x8048,0x8118,0x8125,0x8119, +0x811B,0x812D,0x811F,0x812C,0x811E,0x8121,0x8115,0x8127, +0x811D,0x8122,0x8211,0x8238,0x8233,0x823A,0x8234,0x8232, +0x8274,0x8390,0x83A3,0x83A8,0x838D,0x837A,0x8373,0x83A4, +0x8374,0x838F,0x8381,0x8395,0x8399,0x8375,0x8394,0x83A9, +0x837D,0x8383,0x838C,0x839D,0x839B,0x83AA,0x838B,0x837E, +0x83A5,0x83AF,0x8388,0x8397,0x83B0,0x837F,0x83A6,0x8387, +0x83AE,0x8376,0x839A,0x8659,0x8656,0x86BF,0x86B7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x86C2,0x86C1,0x86C5,0x86BA,0x86B0,0x86C8,0x86B9, +0x86B3,0x86B8,0x86CC,0x86B4,0x86BB,0x86BC,0x86C3,0x86BD, +0x86BE,0x8852,0x8889,0x8895,0x88A8,0x88A2,0x88AA,0x889A, +0x8891,0x88A1,0x889F,0x8898,0x88A7,0x8899,0x889B,0x8897, +0x88A4,0x88AC,0x888C,0x8893,0x888E,0x8982,0x89D6,0x89D9, +0x89D5,0x8A30,0x8A27,0x8A2C,0x8A1E,0x8C39,0x8C3B,0x8C5C, +0x8C5D,0x8C7D,0x8CA5,0x8D7D,0x8D7B,0x8D79,0x8DBC,0x8DC2, +0x8DB9,0x8DBF,0x8DC1,0x8ED8,0x8EDE,0x8EDD,0x8EDC,0x8ED7, +0x8EE0,0x8EE1,0x9024,0x900B,0x9011,0x901C,0x900C,0x9021, +0x90EF,0x90EA,0x90F0,0x90F4,0x90F2,0x90F3,0x90D4,0x90EB, +0x90EC,0x90E9,0x9156,0x9158,0x915A,0x9153,0x9155,0x91EC, +0x91F4,0x91F1,0x91F3,0x91F8,0x91E4,0x91F9,0x91EA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x91EB,0x91F7,0x91E8,0x91EE,0x957A,0x9586,0x9588,0x967C, +0x966D,0x966B,0x9671,0x966F,0x96BF,0x976A,0x9804,0x98E5, +0x9997,0x509B,0x5095,0x5094,0x509E,0x508B,0x50A3,0x5083, +0x508C,0x508E,0x509D,0x5068,0x509C,0x5092,0x5082,0x5087, +0x515F,0x51D4,0x5312,0x5311,0x53A4,0x53A7,0x5591,0x55A8, +0x55A5,0x55AD,0x5577,0x5645,0x55A2,0x5593,0x5588,0x558F, +0x55B5,0x5581,0x55A3,0x5592,0x55A4,0x557D,0x558C,0x55A6, +0x557F,0x5595,0x55A1,0x558E,0x570C,0x5829,0x5837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5819,0x581E,0x5827,0x5823,0x5828,0x57F5,0x5848, +0x5825,0x581C,0x581B,0x5833,0x583F,0x5836,0x582E,0x5839, +0x5838,0x582D,0x582C,0x583B,0x5961,0x5AAF,0x5A94,0x5A9F, +0x5A7A,0x5AA2,0x5A9E,0x5A78,0x5AA6,0x5A7C,0x5AA5,0x5AAC, +0x5A95,0x5AAE,0x5A37,0x5A84,0x5A8A,0x5A97,0x5A83,0x5A8B, +0x5AA9,0x5A7B,0x5A7D,0x5A8C,0x5A9C,0x5A8F,0x5A93,0x5A9D, +0x5BEA,0x5BCD,0x5BCB,0x5BD4,0x5BD1,0x5BCA,0x5BCE,0x5C0C, +0x5C30,0x5D37,0x5D43,0x5D6B,0x5D41,0x5D4B,0x5D3F,0x5D35, +0x5D51,0x5D4E,0x5D55,0x5D33,0x5D3A,0x5D52,0x5D3D,0x5D31, +0x5D59,0x5D42,0x5D39,0x5D49,0x5D38,0x5D3C,0x5D32,0x5D36, +0x5D40,0x5D45,0x5E44,0x5E41,0x5F58,0x5FA6,0x5FA5,0x5FAB, +0x60C9,0x60B9,0x60CC,0x60E2,0x60CE,0x60C4,0x6114, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x60F2,0x610A,0x6116,0x6105,0x60F5,0x6113,0x60F8,0x60FC, +0x60FE,0x60C1,0x6103,0x6118,0x611D,0x6110,0x60FF,0x6104, +0x610B,0x624A,0x6394,0x63B1,0x63B0,0x63CE,0x63E5,0x63E8, +0x63EF,0x63C3,0x649D,0x63F3,0x63CA,0x63E0,0x63F6,0x63D5, +0x63F2,0x63F5,0x6461,0x63DF,0x63BE,0x63DD,0x63DC,0x63C4, +0x63D8,0x63D3,0x63C2,0x63C7,0x63CC,0x63CB,0x63C8,0x63F0, +0x63D7,0x63D9,0x6532,0x6567,0x656A,0x6564,0x655C,0x6568, +0x6565,0x658C,0x659D,0x659E,0x65AE,0x65D0,0x65D2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x667C,0x666C,0x667B,0x6680,0x6671,0x6679,0x666A, +0x6672,0x6701,0x690C,0x68D3,0x6904,0x68DC,0x692A,0x68EC, +0x68EA,0x68F1,0x690F,0x68D6,0x68F7,0x68EB,0x68E4,0x68F6, +0x6913,0x6910,0x68F3,0x68E1,0x6907,0x68CC,0x6908,0x6970, +0x68B4,0x6911,0x68EF,0x68C6,0x6914,0x68F8,0x68D0,0x68FD, +0x68FC,0x68E8,0x690B,0x690A,0x6917,0x68CE,0x68C8,0x68DD, +0x68DE,0x68E6,0x68F4,0x68D1,0x6906,0x68D4,0x68E9,0x6915, +0x6925,0x68C7,0x6B39,0x6B3B,0x6B3F,0x6B3C,0x6B94,0x6B97, +0x6B99,0x6B95,0x6BBD,0x6BF0,0x6BF2,0x6BF3,0x6C30,0x6DFC, +0x6E46,0x6E47,0x6E1F,0x6E49,0x6E88,0x6E3C,0x6E3D,0x6E45, +0x6E62,0x6E2B,0x6E3F,0x6E41,0x6E5D,0x6E73,0x6E1C,0x6E33, +0x6E4B,0x6E40,0x6E51,0x6E3B,0x6E03,0x6E2E,0x6E5E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E68,0x6E5C,0x6E61,0x6E31,0x6E28,0x6E60,0x6E71,0x6E6B, +0x6E39,0x6E22,0x6E30,0x6E53,0x6E65,0x6E27,0x6E78,0x6E64, +0x6E77,0x6E55,0x6E79,0x6E52,0x6E66,0x6E35,0x6E36,0x6E5A, +0x7120,0x711E,0x712F,0x70FB,0x712E,0x7131,0x7123,0x7125, +0x7122,0x7132,0x711F,0x7128,0x713A,0x711B,0x724B,0x725A, +0x7288,0x7289,0x7286,0x7285,0x728B,0x7312,0x730B,0x7330, +0x7322,0x7331,0x7333,0x7327,0x7332,0x732D,0x7326,0x7323, +0x7335,0x730C,0x742E,0x742C,0x7430,0x742B,0x7416, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x741A,0x7421,0x742D,0x7431,0x7424,0x7423,0x741D, +0x7429,0x7420,0x7432,0x74FB,0x752F,0x756F,0x756C,0x75E7, +0x75DA,0x75E1,0x75E6,0x75DD,0x75DF,0x75E4,0x75D7,0x7695, +0x7692,0x76DA,0x7746,0x7747,0x7744,0x774D,0x7745,0x774A, +0x774E,0x774B,0x774C,0x77DE,0x77EC,0x7860,0x7864,0x7865, +0x785C,0x786D,0x7871,0x786A,0x786E,0x7870,0x7869,0x7868, +0x785E,0x7862,0x7974,0x7973,0x7972,0x7970,0x7A02,0x7A0A, +0x7A03,0x7A0C,0x7A04,0x7A99,0x7AE6,0x7AE4,0x7B4A,0x7B3B, +0x7B44,0x7B48,0x7B4C,0x7B4E,0x7B40,0x7B58,0x7B45,0x7CA2, +0x7C9E,0x7CA8,0x7CA1,0x7D58,0x7D6F,0x7D63,0x7D53,0x7D56, +0x7D67,0x7D6A,0x7D4F,0x7D6D,0x7D5C,0x7D6B,0x7D52,0x7D54, +0x7D69,0x7D51,0x7D5F,0x7D4E,0x7F3E,0x7F3F,0x7F65, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7F66,0x7FA2,0x7FA0,0x7FA1,0x7FD7,0x8051,0x804F,0x8050, +0x80FE,0x80D4,0x8143,0x814A,0x8152,0x814F,0x8147,0x813D, +0x814D,0x813A,0x81E6,0x81EE,0x81F7,0x81F8,0x81F9,0x8204, +0x823C,0x823D,0x823F,0x8275,0x833B,0x83CF,0x83F9,0x8423, +0x83C0,0x83E8,0x8412,0x83E7,0x83E4,0x83FC,0x83F6,0x8410, +0x83C6,0x83C8,0x83EB,0x83E3,0x83BF,0x8401,0x83DD,0x83E5, +0x83D8,0x83FF,0x83E1,0x83CB,0x83CE,0x83D6,0x83F5,0x83C9, +0x8409,0x840F,0x83DE,0x8411,0x8406,0x83C2,0x83F3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x83D5,0x83FA,0x83C7,0x83D1,0x83EA,0x8413,0x83C3, +0x83EC,0x83EE,0x83C4,0x83FB,0x83D7,0x83E2,0x841B,0x83DB, +0x83FE,0x86D8,0x86E2,0x86E6,0x86D3,0x86E3,0x86DA,0x86EA, +0x86DD,0x86EB,0x86DC,0x86EC,0x86E9,0x86D7,0x86E8,0x86D1, +0x8848,0x8856,0x8855,0x88BA,0x88D7,0x88B9,0x88B8,0x88C0, +0x88BE,0x88B6,0x88BC,0x88B7,0x88BD,0x88B2,0x8901,0x88C9, +0x8995,0x8998,0x8997,0x89DD,0x89DA,0x89DB,0x8A4E,0x8A4D, +0x8A39,0x8A59,0x8A40,0x8A57,0x8A58,0x8A44,0x8A45,0x8A52, +0x8A48,0x8A51,0x8A4A,0x8A4C,0x8A4F,0x8C5F,0x8C81,0x8C80, +0x8CBA,0x8CBE,0x8CB0,0x8CB9,0x8CB5,0x8D84,0x8D80,0x8D89, +0x8DD8,0x8DD3,0x8DCD,0x8DC7,0x8DD6,0x8DDC,0x8DCF,0x8DD5, +0x8DD9,0x8DC8,0x8DD7,0x8DC5,0x8EEF,0x8EF7,0x8EFA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8EF9,0x8EE6,0x8EEE,0x8EE5,0x8EF5,0x8EE7,0x8EE8,0x8EF6, +0x8EEB,0x8EF1,0x8EEC,0x8EF4,0x8EE9,0x902D,0x9034,0x902F, +0x9106,0x912C,0x9104,0x90FF,0x90FC,0x9108,0x90F9,0x90FB, +0x9101,0x9100,0x9107,0x9105,0x9103,0x9161,0x9164,0x915F, +0x9162,0x9160,0x9201,0x920A,0x9225,0x9203,0x921A,0x9226, +0x920F,0x920C,0x9200,0x9212,0x91FF,0x91FD,0x9206,0x9204, +0x9227,0x9202,0x921C,0x9224,0x9219,0x9217,0x9205,0x9216, +0x957B,0x958D,0x958C,0x9590,0x9687,0x967E,0x9688, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9689,0x9683,0x9680,0x96C2,0x96C8,0x96C3,0x96F1, +0x96F0,0x976C,0x9770,0x976E,0x9807,0x98A9,0x98EB,0x9CE6, +0x9EF9,0x4E83,0x4E84,0x4EB6,0x50BD,0x50BF,0x50C6,0x50AE, +0x50C4,0x50CA,0x50B4,0x50C8,0x50C2,0x50B0,0x50C1,0x50BA, +0x50B1,0x50CB,0x50C9,0x50B6,0x50B8,0x51D7,0x527A,0x5278, +0x527B,0x527C,0x55C3,0x55DB,0x55CC,0x55D0,0x55CB,0x55CA, +0x55DD,0x55C0,0x55D4,0x55C4,0x55E9,0x55BF,0x55D2,0x558D, +0x55CF,0x55D5,0x55E2,0x55D6,0x55C8,0x55F2,0x55CD,0x55D9, +0x55C2,0x5714,0x5853,0x5868,0x5864,0x584F,0x584D,0x5849, +0x586F,0x5855,0x584E,0x585D,0x5859,0x5865,0x585B,0x583D, +0x5863,0x5871,0x58FC,0x5AC7,0x5AC4,0x5ACB,0x5ABA,0x5AB8, +0x5AB1,0x5AB5,0x5AB0,0x5ABF,0x5AC8,0x5ABB,0x5AC6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5AB7,0x5AC0,0x5ACA,0x5AB4,0x5AB6,0x5ACD,0x5AB9,0x5A90, +0x5BD6,0x5BD8,0x5BD9,0x5C1F,0x5C33,0x5D71,0x5D63,0x5D4A, +0x5D65,0x5D72,0x5D6C,0x5D5E,0x5D68,0x5D67,0x5D62,0x5DF0, +0x5E4F,0x5E4E,0x5E4A,0x5E4D,0x5E4B,0x5EC5,0x5ECC,0x5EC6, +0x5ECB,0x5EC7,0x5F40,0x5FAF,0x5FAD,0x60F7,0x6149,0x614A, +0x612B,0x6145,0x6136,0x6132,0x612E,0x6146,0x612F,0x614F, +0x6129,0x6140,0x6220,0x9168,0x6223,0x6225,0x6224,0x63C5, +0x63F1,0x63EB,0x6410,0x6412,0x6409,0x6420,0x6424, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6433,0x6443,0x641F,0x6415,0x6418,0x6439,0x6437, +0x6422,0x6423,0x640C,0x6426,0x6430,0x6428,0x6441,0x6435, +0x642F,0x640A,0x641A,0x6440,0x6425,0x6427,0x640B,0x63E7, +0x641B,0x642E,0x6421,0x640E,0x656F,0x6592,0x65D3,0x6686, +0x668C,0x6695,0x6690,0x668B,0x668A,0x6699,0x6694,0x6678, +0x6720,0x6966,0x695F,0x6938,0x694E,0x6962,0x6971,0x693F, +0x6945,0x696A,0x6939,0x6942,0x6957,0x6959,0x697A,0x6948, +0x6949,0x6935,0x696C,0x6933,0x693D,0x6965,0x68F0,0x6978, +0x6934,0x6969,0x6940,0x696F,0x6944,0x6976,0x6958,0x6941, +0x6974,0x694C,0x693B,0x694B,0x6937,0x695C,0x694F,0x6951, +0x6932,0x6952,0x692F,0x697B,0x693C,0x6B46,0x6B45,0x6B43, +0x6B42,0x6B48,0x6B41,0x6B9B,0xFA0D,0x6BFB,0x6BFC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6BF9,0x6BF7,0x6BF8,0x6E9B,0x6ED6,0x6EC8,0x6E8F,0x6EC0, +0x6E9F,0x6E93,0x6E94,0x6EA0,0x6EB1,0x6EB9,0x6EC6,0x6ED2, +0x6EBD,0x6EC1,0x6E9E,0x6EC9,0x6EB7,0x6EB0,0x6ECD,0x6EA6, +0x6ECF,0x6EB2,0x6EBE,0x6EC3,0x6EDC,0x6ED8,0x6E99,0x6E92, +0x6E8E,0x6E8D,0x6EA4,0x6EA1,0x6EBF,0x6EB3,0x6ED0,0x6ECA, +0x6E97,0x6EAE,0x6EA3,0x7147,0x7154,0x7152,0x7163,0x7160, +0x7141,0x715D,0x7162,0x7172,0x7178,0x716A,0x7161,0x7142, +0x7158,0x7143,0x714B,0x7170,0x715F,0x7150,0x7153, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7144,0x714D,0x715A,0x724F,0x728D,0x728C,0x7291, +0x7290,0x728E,0x733C,0x7342,0x733B,0x733A,0x7340,0x734A, +0x7349,0x7444,0x744A,0x744B,0x7452,0x7451,0x7457,0x7440, +0x744F,0x7450,0x744E,0x7442,0x7446,0x744D,0x7454,0x74E1, +0x74FF,0x74FE,0x74FD,0x751D,0x7579,0x7577,0x6983,0x75EF, +0x760F,0x7603,0x75F7,0x75FE,0x75FC,0x75F9,0x75F8,0x7610, +0x75FB,0x75F6,0x75ED,0x75F5,0x75FD,0x7699,0x76B5,0x76DD, +0x7755,0x775F,0x7760,0x7752,0x7756,0x775A,0x7769,0x7767, +0x7754,0x7759,0x776D,0x77E0,0x7887,0x789A,0x7894,0x788F, +0x7884,0x7895,0x7885,0x7886,0x78A1,0x7883,0x7879,0x7899, +0x7880,0x7896,0x787B,0x797C,0x7982,0x797D,0x7979,0x7A11, +0x7A18,0x7A19,0x7A12,0x7A17,0x7A15,0x7A22,0x7A13, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7A1B,0x7A10,0x7AA3,0x7AA2,0x7A9E,0x7AEB,0x7B66,0x7B64, +0x7B6D,0x7B74,0x7B69,0x7B72,0x7B65,0x7B73,0x7B71,0x7B70, +0x7B61,0x7B78,0x7B76,0x7B63,0x7CB2,0x7CB4,0x7CAF,0x7D88, +0x7D86,0x7D80,0x7D8D,0x7D7F,0x7D85,0x7D7A,0x7D8E,0x7D7B, +0x7D83,0x7D7C,0x7D8C,0x7D94,0x7D84,0x7D7D,0x7D92,0x7F6D, +0x7F6B,0x7F67,0x7F68,0x7F6C,0x7FA6,0x7FA5,0x7FA7,0x7FDB, +0x7FDC,0x8021,0x8164,0x8160,0x8177,0x815C,0x8169,0x815B, +0x8162,0x8172,0x6721,0x815E,0x8176,0x8167,0x816F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8144,0x8161,0x821D,0x8249,0x8244,0x8240,0x8242, +0x8245,0x84F1,0x843F,0x8456,0x8476,0x8479,0x848F,0x848D, +0x8465,0x8451,0x8440,0x8486,0x8467,0x8430,0x844D,0x847D, +0x845A,0x8459,0x8474,0x8473,0x845D,0x8507,0x845E,0x8437, +0x843A,0x8434,0x847A,0x8443,0x8478,0x8432,0x8445,0x8429, +0x83D9,0x844B,0x842F,0x8442,0x842D,0x845F,0x8470,0x8439, +0x844E,0x844C,0x8452,0x846F,0x84C5,0x848E,0x843B,0x8447, +0x8436,0x8433,0x8468,0x847E,0x8444,0x842B,0x8460,0x8454, +0x846E,0x8450,0x870B,0x8704,0x86F7,0x870C,0x86FA,0x86D6, +0x86F5,0x874D,0x86F8,0x870E,0x8709,0x8701,0x86F6,0x870D, +0x8705,0x88D6,0x88CB,0x88CD,0x88CE,0x88DE,0x88DB,0x88DA, +0x88CC,0x88D0,0x8985,0x899B,0x89DF,0x89E5,0x89E4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x89E1,0x89E0,0x89E2,0x89DC,0x89E6,0x8A76,0x8A86,0x8A7F, +0x8A61,0x8A3F,0x8A77,0x8A82,0x8A84,0x8A75,0x8A83,0x8A81, +0x8A74,0x8A7A,0x8C3C,0x8C4B,0x8C4A,0x8C65,0x8C64,0x8C66, +0x8C86,0x8C84,0x8C85,0x8CCC,0x8D68,0x8D69,0x8D91,0x8D8C, +0x8D8E,0x8D8F,0x8D8D,0x8D93,0x8D94,0x8D90,0x8D92,0x8DF0, +0x8DE0,0x8DEC,0x8DF1,0x8DEE,0x8DD0,0x8DE9,0x8DE3,0x8DE2, +0x8DE7,0x8DF2,0x8DEB,0x8DF4,0x8F06,0x8EFF,0x8F01,0x8F00, +0x8F05,0x8F07,0x8F08,0x8F02,0x8F0B,0x9052,0x903F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9044,0x9049,0x903D,0x9110,0x910D,0x910F,0x9111, +0x9116,0x9114,0x910B,0x910E,0x916E,0x916F,0x9248,0x9252, +0x9230,0x923A,0x9266,0x9233,0x9265,0x925E,0x9283,0x922E, +0x924A,0x9246,0x926D,0x926C,0x924F,0x9260,0x9267,0x926F, +0x9236,0x9261,0x9270,0x9231,0x9254,0x9263,0x9250,0x9272, +0x924E,0x9253,0x924C,0x9256,0x9232,0x959F,0x959C,0x959E, +0x959B,0x9692,0x9693,0x9691,0x9697,0x96CE,0x96FA,0x96FD, +0x96F8,0x96F5,0x9773,0x9777,0x9778,0x9772,0x980F,0x980D, +0x980E,0x98AC,0x98F6,0x98F9,0x99AF,0x99B2,0x99B0,0x99B5, +0x9AAD,0x9AAB,0x9B5B,0x9CEA,0x9CED,0x9CE7,0x9E80,0x9EFD, +0x50E6,0x50D4,0x50D7,0x50E8,0x50F3,0x50DB,0x50EA,0x50DD, +0x50E4,0x50D3,0x50EC,0x50F0,0x50EF,0x50E3,0x50E0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x51D8,0x5280,0x5281,0x52E9,0x52EB,0x5330,0x53AC,0x5627, +0x5615,0x560C,0x5612,0x55FC,0x560F,0x561C,0x5601,0x5613, +0x5602,0x55FA,0x561D,0x5604,0x55FF,0x55F9,0x5889,0x587C, +0x5890,0x5898,0x5886,0x5881,0x587F,0x5874,0x588B,0x587A, +0x5887,0x5891,0x588E,0x5876,0x5882,0x5888,0x587B,0x5894, +0x588F,0x58FE,0x596B,0x5ADC,0x5AEE,0x5AE5,0x5AD5,0x5AEA, +0x5ADA,0x5AED,0x5AEB,0x5AF3,0x5AE2,0x5AE0,0x5ADB,0x5AEC, +0x5ADE,0x5ADD,0x5AD9,0x5AE8,0x5ADF,0x5B77,0x5BE0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5BE3,0x5C63,0x5D82,0x5D80,0x5D7D,0x5D86,0x5D7A, +0x5D81,0x5D77,0x5D8A,0x5D89,0x5D88,0x5D7E,0x5D7C,0x5D8D, +0x5D79,0x5D7F,0x5E58,0x5E59,0x5E53,0x5ED8,0x5ED1,0x5ED7, +0x5ECE,0x5EDC,0x5ED5,0x5ED9,0x5ED2,0x5ED4,0x5F44,0x5F43, +0x5F6F,0x5FB6,0x612C,0x6128,0x6141,0x615E,0x6171,0x6173, +0x6152,0x6153,0x6172,0x616C,0x6180,0x6174,0x6154,0x617A, +0x615B,0x6165,0x613B,0x616A,0x6161,0x6156,0x6229,0x6227, +0x622B,0x642B,0x644D,0x645B,0x645D,0x6474,0x6476,0x6472, +0x6473,0x647D,0x6475,0x6466,0x64A6,0x644E,0x6482,0x645E, +0x645C,0x644B,0x6453,0x6460,0x6450,0x647F,0x643F,0x646C, +0x646B,0x6459,0x6465,0x6477,0x6573,0x65A0,0x66A1,0x66A0, +0x669F,0x6705,0x6704,0x6722,0x69B1,0x69B6,0x69C9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x69A0,0x69CE,0x6996,0x69B0,0x69AC,0x69BC,0x6991,0x6999, +0x698E,0x69A7,0x698D,0x69A9,0x69BE,0x69AF,0x69BF,0x69C4, +0x69BD,0x69A4,0x69D4,0x69B9,0x69CA,0x699A,0x69CF,0x69B3, +0x6993,0x69AA,0x69A1,0x699E,0x69D9,0x6997,0x6990,0x69C2, +0x69B5,0x69A5,0x69C6,0x6B4A,0x6B4D,0x6B4B,0x6B9E,0x6B9F, +0x6BA0,0x6BC3,0x6BC4,0x6BFE,0x6ECE,0x6EF5,0x6EF1,0x6F03, +0x6F25,0x6EF8,0x6F37,0x6EFB,0x6F2E,0x6F09,0x6F4E,0x6F19, +0x6F1A,0x6F27,0x6F18,0x6F3B,0x6F12,0x6EED,0x6F0A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6F36,0x6F73,0x6EF9,0x6EEE,0x6F2D,0x6F40,0x6F30, +0x6F3C,0x6F35,0x6EEB,0x6F07,0x6F0E,0x6F43,0x6F05,0x6EFD, +0x6EF6,0x6F39,0x6F1C,0x6EFC,0x6F3A,0x6F1F,0x6F0D,0x6F1E, +0x6F08,0x6F21,0x7187,0x7190,0x7189,0x7180,0x7185,0x7182, +0x718F,0x717B,0x7186,0x7181,0x7197,0x7244,0x7253,0x7297, +0x7295,0x7293,0x7343,0x734D,0x7351,0x734C,0x7462,0x7473, +0x7471,0x7475,0x7472,0x7467,0x746E,0x7500,0x7502,0x7503, +0x757D,0x7590,0x7616,0x7608,0x760C,0x7615,0x7611,0x760A, +0x7614,0x76B8,0x7781,0x777C,0x7785,0x7782,0x776E,0x7780, +0x776F,0x777E,0x7783,0x78B2,0x78AA,0x78B4,0x78AD,0x78A8, +0x787E,0x78AB,0x789E,0x78A5,0x78A0,0x78AC,0x78A2,0x78A4, +0x7998,0x798A,0x798B,0x7996,0x7995,0x7994,0x7993, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7997,0x7988,0x7992,0x7990,0x7A2B,0x7A4A,0x7A30,0x7A2F, +0x7A28,0x7A26,0x7AA8,0x7AAB,0x7AAC,0x7AEE,0x7B88,0x7B9C, +0x7B8A,0x7B91,0x7B90,0x7B96,0x7B8D,0x7B8C,0x7B9B,0x7B8E, +0x7B85,0x7B98,0x5284,0x7B99,0x7BA4,0x7B82,0x7CBB,0x7CBF, +0x7CBC,0x7CBA,0x7DA7,0x7DB7,0x7DC2,0x7DA3,0x7DAA,0x7DC1, +0x7DC0,0x7DC5,0x7D9D,0x7DCE,0x7DC4,0x7DC6,0x7DCB,0x7DCC, +0x7DAF,0x7DB9,0x7D96,0x7DBC,0x7D9F,0x7DA6,0x7DAE,0x7DA9, +0x7DA1,0x7DC9,0x7F73,0x7FE2,0x7FE3,0x7FE5,0x7FDE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8024,0x805D,0x805C,0x8189,0x8186,0x8183,0x8187, +0x818D,0x818C,0x818B,0x8215,0x8497,0x84A4,0x84A1,0x849F, +0x84BA,0x84CE,0x84C2,0x84AC,0x84AE,0x84AB,0x84B9,0x84B4, +0x84C1,0x84CD,0x84AA,0x849A,0x84B1,0x84D0,0x849D,0x84A7, +0x84BB,0x84A2,0x8494,0x84C7,0x84CC,0x849B,0x84A9,0x84AF, +0x84A8,0x84D6,0x8498,0x84B6,0x84CF,0x84A0,0x84D7,0x84D4, +0x84D2,0x84DB,0x84B0,0x8491,0x8661,0x8733,0x8723,0x8728, +0x876B,0x8740,0x872E,0x871E,0x8721,0x8719,0x871B,0x8743, +0x872C,0x8741,0x873E,0x8746,0x8720,0x8732,0x872A,0x872D, +0x873C,0x8712,0x873A,0x8731,0x8735,0x8742,0x8726,0x8727, +0x8738,0x8724,0x871A,0x8730,0x8711,0x88F7,0x88E7,0x88F1, +0x88F2,0x88FA,0x88FE,0x88EE,0x88FC,0x88F6,0x88FB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x88F0,0x88EC,0x88EB,0x899D,0x89A1,0x899F,0x899E,0x89E9, +0x89EB,0x89E8,0x8AAB,0x8A99,0x8A8B,0x8A92,0x8A8F,0x8A96, +0x8C3D,0x8C68,0x8C69,0x8CD5,0x8CCF,0x8CD7,0x8D96,0x8E09, +0x8E02,0x8DFF,0x8E0D,0x8DFD,0x8E0A,0x8E03,0x8E07,0x8E06, +0x8E05,0x8DFE,0x8E00,0x8E04,0x8F10,0x8F11,0x8F0E,0x8F0D, +0x9123,0x911C,0x9120,0x9122,0x911F,0x911D,0x911A,0x9124, +0x9121,0x911B,0x917A,0x9172,0x9179,0x9173,0x92A5,0x92A4, +0x9276,0x929B,0x927A,0x92A0,0x9294,0x92AA,0x928D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x92A6,0x929A,0x92AB,0x9279,0x9297,0x927F,0x92A3, +0x92EE,0x928E,0x9282,0x9295,0x92A2,0x927D,0x9288,0x92A1, +0x928A,0x9286,0x928C,0x9299,0x92A7,0x927E,0x9287,0x92A9, +0x929D,0x928B,0x922D,0x969E,0x96A1,0x96FF,0x9758,0x977D, +0x977A,0x977E,0x9783,0x9780,0x9782,0x977B,0x9784,0x9781, +0x977F,0x97CE,0x97CD,0x9816,0x98AD,0x98AE,0x9902,0x9900, +0x9907,0x999D,0x999C,0x99C3,0x99B9,0x99BB,0x99BA,0x99C2, +0x99BD,0x99C7,0x9AB1,0x9AE3,0x9AE7,0x9B3E,0x9B3F,0x9B60, +0x9B61,0x9B5F,0x9CF1,0x9CF2,0x9CF5,0x9EA7,0x50FF,0x5103, +0x5130,0x50F8,0x5106,0x5107,0x50F6,0x50FE,0x510B,0x510C, +0x50FD,0x510A,0x528B,0x528C,0x52F1,0x52EF,0x5648,0x5642, +0x564C,0x5635,0x5641,0x564A,0x5649,0x5646,0x5658, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x565A,0x5640,0x5633,0x563D,0x562C,0x563E,0x5638,0x562A, +0x563A,0x571A,0x58AB,0x589D,0x58B1,0x58A0,0x58A3,0x58AF, +0x58AC,0x58A5,0x58A1,0x58FF,0x5AFF,0x5AF4,0x5AFD,0x5AF7, +0x5AF6,0x5B03,0x5AF8,0x5B02,0x5AF9,0x5B01,0x5B07,0x5B05, +0x5B0F,0x5C67,0x5D99,0x5D97,0x5D9F,0x5D92,0x5DA2,0x5D93, +0x5D95,0x5DA0,0x5D9C,0x5DA1,0x5D9A,0x5D9E,0x5E69,0x5E5D, +0x5E60,0x5E5C,0x7DF3,0x5EDB,0x5EDE,0x5EE1,0x5F49,0x5FB2, +0x618B,0x6183,0x6179,0x61B1,0x61B0,0x61A2,0x6189, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x619B,0x6193,0x61AF,0x61AD,0x619F,0x6192,0x61AA, +0x61A1,0x618D,0x6166,0x61B3,0x622D,0x646E,0x6470,0x6496, +0x64A0,0x6485,0x6497,0x649C,0x648F,0x648B,0x648A,0x648C, +0x64A3,0x649F,0x6468,0x64B1,0x6498,0x6576,0x657A,0x6579, +0x657B,0x65B2,0x65B3,0x66B5,0x66B0,0x66A9,0x66B2,0x66B7, +0x66AA,0x66AF,0x6A00,0x6A06,0x6A17,0x69E5,0x69F8,0x6A15, +0x69F1,0x69E4,0x6A20,0x69FF,0x69EC,0x69E2,0x6A1B,0x6A1D, +0x69FE,0x6A27,0x69F2,0x69EE,0x6A14,0x69F7,0x69E7,0x6A40, +0x6A08,0x69E6,0x69FB,0x6A0D,0x69FC,0x69EB,0x6A09,0x6A04, +0x6A18,0x6A25,0x6A0F,0x69F6,0x6A26,0x6A07,0x69F4,0x6A16, +0x6B51,0x6BA5,0x6BA3,0x6BA2,0x6BA6,0x6C01,0x6C00,0x6BFF, +0x6C02,0x6F41,0x6F26,0x6F7E,0x6F87,0x6FC6,0x6F92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6F8D,0x6F89,0x6F8C,0x6F62,0x6F4F,0x6F85,0x6F5A,0x6F96, +0x6F76,0x6F6C,0x6F82,0x6F55,0x6F72,0x6F52,0x6F50,0x6F57, +0x6F94,0x6F93,0x6F5D,0x6F00,0x6F61,0x6F6B,0x6F7D,0x6F67, +0x6F90,0x6F53,0x6F8B,0x6F69,0x6F7F,0x6F95,0x6F63,0x6F77, +0x6F6A,0x6F7B,0x71B2,0x71AF,0x719B,0x71B0,0x71A0,0x719A, +0x71A9,0x71B5,0x719D,0x71A5,0x719E,0x71A4,0x71A1,0x71AA, +0x719C,0x71A7,0x71B3,0x7298,0x729A,0x7358,0x7352,0x735E, +0x735F,0x7360,0x735D,0x735B,0x7361,0x735A,0x7359, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7362,0x7487,0x7489,0x748A,0x7486,0x7481,0x747D, +0x7485,0x7488,0x747C,0x7479,0x7508,0x7507,0x757E,0x7625, +0x761E,0x7619,0x761D,0x761C,0x7623,0x761A,0x7628,0x761B, +0x769C,0x769D,0x769E,0x769B,0x778D,0x778F,0x7789,0x7788, +0x78CD,0x78BB,0x78CF,0x78CC,0x78D1,0x78CE,0x78D4,0x78C8, +0x78C3,0x78C4,0x78C9,0x799A,0x79A1,0x79A0,0x799C,0x79A2, +0x799B,0x6B76,0x7A39,0x7AB2,0x7AB4,0x7AB3,0x7BB7,0x7BCB, +0x7BBE,0x7BAC,0x7BCE,0x7BAF,0x7BB9,0x7BCA,0x7BB5,0x7CC5, +0x7CC8,0x7CCC,0x7CCB,0x7DF7,0x7DDB,0x7DEA,0x7DE7,0x7DD7, +0x7DE1,0x7E03,0x7DFA,0x7DE6,0x7DF6,0x7DF1,0x7DF0,0x7DEE, +0x7DDF,0x7F76,0x7FAC,0x7FB0,0x7FAD,0x7FED,0x7FEB,0x7FEA, +0x7FEC,0x7FE6,0x7FE8,0x8064,0x8067,0x81A3,0x819F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x819E,0x8195,0x81A2,0x8199,0x8197,0x8216,0x824F,0x8253, +0x8252,0x8250,0x824E,0x8251,0x8524,0x853B,0x850F,0x8500, +0x8529,0x850E,0x8509,0x850D,0x851F,0x850A,0x8527,0x851C, +0x84FB,0x852B,0x84FA,0x8508,0x850C,0x84F4,0x852A,0x84F2, +0x8515,0x84F7,0x84EB,0x84F3,0x84FC,0x8512,0x84EA,0x84E9, +0x8516,0x84FE,0x8528,0x851D,0x852E,0x8502,0x84FD,0x851E, +0x84F6,0x8531,0x8526,0x84E7,0x84E8,0x84F0,0x84EF,0x84F9, +0x8518,0x8520,0x8530,0x850B,0x8519,0x852F,0x8662, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8756,0x8763,0x8764,0x8777,0x87E1,0x8773,0x8758, +0x8754,0x875B,0x8752,0x8761,0x875A,0x8751,0x875E,0x876D, +0x876A,0x8750,0x874E,0x875F,0x875D,0x876F,0x876C,0x877A, +0x876E,0x875C,0x8765,0x874F,0x877B,0x8775,0x8762,0x8767, +0x8769,0x885A,0x8905,0x890C,0x8914,0x890B,0x8917,0x8918, +0x8919,0x8906,0x8916,0x8911,0x890E,0x8909,0x89A2,0x89A4, +0x89A3,0x89ED,0x89F0,0x89EC,0x8ACF,0x8AC6,0x8AB8,0x8AD3, +0x8AD1,0x8AD4,0x8AD5,0x8ABB,0x8AD7,0x8ABE,0x8AC0,0x8AC5, +0x8AD8,0x8AC3,0x8ABA,0x8ABD,0x8AD9,0x8C3E,0x8C4D,0x8C8F, +0x8CE5,0x8CDF,0x8CD9,0x8CE8,0x8CDA,0x8CDD,0x8CE7,0x8DA0, +0x8D9C,0x8DA1,0x8D9B,0x8E20,0x8E23,0x8E25,0x8E24,0x8E2E, +0x8E15,0x8E1B,0x8E16,0x8E11,0x8E19,0x8E26,0x8E27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E14,0x8E12,0x8E18,0x8E13,0x8E1C,0x8E17,0x8E1A,0x8F2C, +0x8F24,0x8F18,0x8F1A,0x8F20,0x8F23,0x8F16,0x8F17,0x9073, +0x9070,0x906F,0x9067,0x906B,0x912F,0x912B,0x9129,0x912A, +0x9132,0x9126,0x912E,0x9185,0x9186,0x918A,0x9181,0x9182, +0x9184,0x9180,0x92D0,0x92C3,0x92C4,0x92C0,0x92D9,0x92B6, +0x92CF,0x92F1,0x92DF,0x92D8,0x92E9,0x92D7,0x92DD,0x92CC, +0x92EF,0x92C2,0x92E8,0x92CA,0x92C8,0x92CE,0x92E6,0x92CD, +0x92D5,0x92C9,0x92E0,0x92DE,0x92E7,0x92D1,0x92D3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x92B5,0x92E1,0x92C6,0x92B4,0x957C,0x95AC,0x95AB, +0x95AE,0x95B0,0x96A4,0x96A2,0x96D3,0x9705,0x9708,0x9702, +0x975A,0x978A,0x978E,0x9788,0x97D0,0x97CF,0x981E,0x981D, +0x9826,0x9829,0x9828,0x9820,0x981B,0x9827,0x98B2,0x9908, +0x98FA,0x9911,0x9914,0x9916,0x9917,0x9915,0x99DC,0x99CD, +0x99CF,0x99D3,0x99D4,0x99CE,0x99C9,0x99D6,0x99D8,0x99CB, +0x99D7,0x99CC,0x9AB3,0x9AEC,0x9AEB,0x9AF3,0x9AF2,0x9AF1, +0x9B46,0x9B43,0x9B67,0x9B74,0x9B71,0x9B66,0x9B76,0x9B75, +0x9B70,0x9B68,0x9B64,0x9B6C,0x9CFC,0x9CFA,0x9CFD,0x9CFF, +0x9CF7,0x9D07,0x9D00,0x9CF9,0x9CFB,0x9D08,0x9D05,0x9D04, +0x9E83,0x9ED3,0x9F0F,0x9F10,0x511C,0x5113,0x5117,0x511A, +0x5111,0x51DE,0x5334,0x53E1,0x5670,0x5660,0x566E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5673,0x5666,0x5663,0x566D,0x5672,0x565E,0x5677,0x571C, +0x571B,0x58C8,0x58BD,0x58C9,0x58BF,0x58BA,0x58C2,0x58BC, +0x58C6,0x5B17,0x5B19,0x5B1B,0x5B21,0x5B14,0x5B13,0x5B10, +0x5B16,0x5B28,0x5B1A,0x5B20,0x5B1E,0x5BEF,0x5DAC,0x5DB1, +0x5DA9,0x5DA7,0x5DB5,0x5DB0,0x5DAE,0x5DAA,0x5DA8,0x5DB2, +0x5DAD,0x5DAF,0x5DB4,0x5E67,0x5E68,0x5E66,0x5E6F,0x5EE9, +0x5EE7,0x5EE6,0x5EE8,0x5EE5,0x5F4B,0x5FBC,0x619D,0x61A8, +0x6196,0x61C5,0x61B4,0x61C6,0x61C1,0x61CC,0x61BA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x61BF,0x61B8,0x618C,0x64D7,0x64D6,0x64D0,0x64CF, +0x64C9,0x64BD,0x6489,0x64C3,0x64DB,0x64F3,0x64D9,0x6533, +0x657F,0x657C,0x65A2,0x66C8,0x66BE,0x66C0,0x66CA,0x66CB, +0x66CF,0x66BD,0x66BB,0x66BA,0x66CC,0x6723,0x6A34,0x6A66, +0x6A49,0x6A67,0x6A32,0x6A68,0x6A3E,0x6A5D,0x6A6D,0x6A76, +0x6A5B,0x6A51,0x6A28,0x6A5A,0x6A3B,0x6A3F,0x6A41,0x6A6A, +0x6A64,0x6A50,0x6A4F,0x6A54,0x6A6F,0x6A69,0x6A60,0x6A3C, +0x6A5E,0x6A56,0x6A55,0x6A4D,0x6A4E,0x6A46,0x6B55,0x6B54, +0x6B56,0x6BA7,0x6BAA,0x6BAB,0x6BC8,0x6BC7,0x6C04,0x6C03, +0x6C06,0x6FAD,0x6FCB,0x6FA3,0x6FC7,0x6FBC,0x6FCE,0x6FC8, +0x6F5E,0x6FC4,0x6FBD,0x6F9E,0x6FCA,0x6FA8,0x7004,0x6FA5, +0x6FAE,0x6FBA,0x6FAC,0x6FAA,0x6FCF,0x6FBF,0x6FB8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6FA2,0x6FC9,0x6FAB,0x6FCD,0x6FAF,0x6FB2,0x6FB0,0x71C5, +0x71C2,0x71BF,0x71B8,0x71D6,0x71C0,0x71C1,0x71CB,0x71D4, +0x71CA,0x71C7,0x71CF,0x71BD,0x71D8,0x71BC,0x71C6,0x71DA, +0x71DB,0x729D,0x729E,0x7369,0x7366,0x7367,0x736C,0x7365, +0x736B,0x736A,0x747F,0x749A,0x74A0,0x7494,0x7492,0x7495, +0x74A1,0x750B,0x7580,0x762F,0x762D,0x7631,0x763D,0x7633, +0x763C,0x7635,0x7632,0x7630,0x76BB,0x76E6,0x779A,0x779D, +0x77A1,0x779C,0x779B,0x77A2,0x77A3,0x7795,0x7799, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7797,0x78DD,0x78E9,0x78E5,0x78EA,0x78DE,0x78E3, +0x78DB,0x78E1,0x78E2,0x78ED,0x78DF,0x78E0,0x79A4,0x7A44, +0x7A48,0x7A47,0x7AB6,0x7AB8,0x7AB5,0x7AB1,0x7AB7,0x7BDE, +0x7BE3,0x7BE7,0x7BDD,0x7BD5,0x7BE5,0x7BDA,0x7BE8,0x7BF9, +0x7BD4,0x7BEA,0x7BE2,0x7BDC,0x7BEB,0x7BD8,0x7BDF,0x7CD2, +0x7CD4,0x7CD7,0x7CD0,0x7CD1,0x7E12,0x7E21,0x7E17,0x7E0C, +0x7E1F,0x7E20,0x7E13,0x7E0E,0x7E1C,0x7E15,0x7E1A,0x7E22, +0x7E0B,0x7E0F,0x7E16,0x7E0D,0x7E14,0x7E25,0x7E24,0x7F43, +0x7F7B,0x7F7C,0x7F7A,0x7FB1,0x7FEF,0x802A,0x8029,0x806C, +0x81B1,0x81A6,0x81AE,0x81B9,0x81B5,0x81AB,0x81B0,0x81AC, +0x81B4,0x81B2,0x81B7,0x81A7,0x81F2,0x8255,0x8256,0x8257, +0x8556,0x8545,0x856B,0x854D,0x8553,0x8561,0x8558, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8540,0x8546,0x8564,0x8541,0x8562,0x8544,0x8551,0x8547, +0x8563,0x853E,0x855B,0x8571,0x854E,0x856E,0x8575,0x8555, +0x8567,0x8560,0x858C,0x8566,0x855D,0x8554,0x8565,0x856C, +0x8663,0x8665,0x8664,0x879B,0x878F,0x8797,0x8793,0x8792, +0x8788,0x8781,0x8796,0x8798,0x8779,0x8787,0x87A3,0x8785, +0x8790,0x8791,0x879D,0x8784,0x8794,0x879C,0x879A,0x8789, +0x891E,0x8926,0x8930,0x892D,0x892E,0x8927,0x8931,0x8922, +0x8929,0x8923,0x892F,0x892C,0x891F,0x89F1,0x8AE0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AE2,0x8AF2,0x8AF4,0x8AF5,0x8ADD,0x8B14,0x8AE4, +0x8ADF,0x8AF0,0x8AC8,0x8ADE,0x8AE1,0x8AE8,0x8AFF,0x8AEF, +0x8AFB,0x8C91,0x8C92,0x8C90,0x8CF5,0x8CEE,0x8CF1,0x8CF0, +0x8CF3,0x8D6C,0x8D6E,0x8DA5,0x8DA7,0x8E33,0x8E3E,0x8E38, +0x8E40,0x8E45,0x8E36,0x8E3C,0x8E3D,0x8E41,0x8E30,0x8E3F, +0x8EBD,0x8F36,0x8F2E,0x8F35,0x8F32,0x8F39,0x8F37,0x8F34, +0x9076,0x9079,0x907B,0x9086,0x90FA,0x9133,0x9135,0x9136, +0x9193,0x9190,0x9191,0x918D,0x918F,0x9327,0x931E,0x9308, +0x931F,0x9306,0x930F,0x937A,0x9338,0x933C,0x931B,0x9323, +0x9312,0x9301,0x9346,0x932D,0x930E,0x930D,0x92CB,0x931D, +0x92FA,0x9325,0x9313,0x92F9,0x92F7,0x9334,0x9302,0x9324, +0x92FF,0x9329,0x9339,0x9335,0x932A,0x9314,0x930C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x930B,0x92FE,0x9309,0x9300,0x92FB,0x9316,0x95BC,0x95CD, +0x95BE,0x95B9,0x95BA,0x95B6,0x95BF,0x95B5,0x95BD,0x96A9, +0x96D4,0x970B,0x9712,0x9710,0x9799,0x9797,0x9794,0x97F0, +0x97F8,0x9835,0x982F,0x9832,0x9924,0x991F,0x9927,0x9929, +0x999E,0x99EE,0x99EC,0x99E5,0x99E4,0x99F0,0x99E3,0x99EA, +0x99E9,0x99E7,0x9AB9,0x9ABF,0x9AB4,0x9ABB,0x9AF6,0x9AFA, +0x9AF9,0x9AF7,0x9B33,0x9B80,0x9B85,0x9B87,0x9B7C,0x9B7E, +0x9B7B,0x9B82,0x9B93,0x9B92,0x9B90,0x9B7A,0x9B95, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9B7D,0x9B88,0x9D25,0x9D17,0x9D20,0x9D1E,0x9D14, +0x9D29,0x9D1D,0x9D18,0x9D22,0x9D10,0x9D19,0x9D1F,0x9E88, +0x9E86,0x9E87,0x9EAE,0x9EAD,0x9ED5,0x9ED6,0x9EFA,0x9F12, +0x9F3D,0x5126,0x5125,0x5122,0x5124,0x5120,0x5129,0x52F4, +0x5693,0x568C,0x568D,0x5686,0x5684,0x5683,0x567E,0x5682, +0x567F,0x5681,0x58D6,0x58D4,0x58CF,0x58D2,0x5B2D,0x5B25, +0x5B32,0x5B23,0x5B2C,0x5B27,0x5B26,0x5B2F,0x5B2E,0x5B7B, +0x5BF1,0x5BF2,0x5DB7,0x5E6C,0x5E6A,0x5FBE,0x5FBB,0x61C3, +0x61B5,0x61BC,0x61E7,0x61E0,0x61E5,0x61E4,0x61E8,0x61DE, +0x64EF,0x64E9,0x64E3,0x64EB,0x64E4,0x64E8,0x6581,0x6580, +0x65B6,0x65DA,0x66D2,0x6A8D,0x6A96,0x6A81,0x6AA5,0x6A89, +0x6A9F,0x6A9B,0x6AA1,0x6A9E,0x6A87,0x6A93,0x6A8E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6A95,0x6A83,0x6AA8,0x6AA4,0x6A91,0x6A7F,0x6AA6,0x6A9A, +0x6A85,0x6A8C,0x6A92,0x6B5B,0x6BAD,0x6C09,0x6FCC,0x6FA9, +0x6FF4,0x6FD4,0x6FE3,0x6FDC,0x6FED,0x6FE7,0x6FE6,0x6FDE, +0x6FF2,0x6FDD,0x6FE2,0x6FE8,0x71E1,0x71F1,0x71E8,0x71F2, +0x71E4,0x71F0,0x71E2,0x7373,0x736E,0x736F,0x7497,0x74B2, +0x74AB,0x7490,0x74AA,0x74AD,0x74B1,0x74A5,0x74AF,0x7510, +0x7511,0x7512,0x750F,0x7584,0x7643,0x7648,0x7649,0x7647, +0x76A4,0x76E9,0x77B5,0x77AB,0x77B2,0x77B7,0x77B6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x77B4,0x77B1,0x77A8,0x77F0,0x78F3,0x78FD,0x7902, +0x78FB,0x78FC,0x78F2,0x7905,0x78F9,0x78FE,0x7904,0x79AB, +0x79A8,0x7A5C,0x7A5B,0x7A56,0x7A58,0x7A54,0x7A5A,0x7ABE, +0x7AC0,0x7AC1,0x7C05,0x7C0F,0x7BF2,0x7C00,0x7BFF,0x7BFB, +0x7C0E,0x7BF4,0x7C0B,0x7BF3,0x7C02,0x7C09,0x7C03,0x7C01, +0x7BF8,0x7BFD,0x7C06,0x7BF0,0x7BF1,0x7C10,0x7C0A,0x7CE8, +0x7E2D,0x7E3C,0x7E42,0x7E33,0x9848,0x7E38,0x7E2A,0x7E49, +0x7E40,0x7E47,0x7E29,0x7E4C,0x7E30,0x7E3B,0x7E36,0x7E44, +0x7E3A,0x7F45,0x7F7F,0x7F7E,0x7F7D,0x7FF4,0x7FF2,0x802C, +0x81BB,0x81C4,0x81CC,0x81CA,0x81C5,0x81C7,0x81BC,0x81E9, +0x825B,0x825A,0x825C,0x8583,0x8580,0x858F,0x85A7,0x8595, +0x85A0,0x858B,0x85A3,0x857B,0x85A4,0x859A,0x859E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8577,0x857C,0x8589,0x85A1,0x857A,0x8578,0x8557,0x858E, +0x8596,0x8586,0x858D,0x8599,0x859D,0x8581,0x85A2,0x8582, +0x8588,0x8585,0x8579,0x8576,0x8598,0x8590,0x859F,0x8668, +0x87BE,0x87AA,0x87AD,0x87C5,0x87B0,0x87AC,0x87B9,0x87B5, +0x87BC,0x87AE,0x87C9,0x87C3,0x87C2,0x87CC,0x87B7,0x87AF, +0x87C4,0x87CA,0x87B4,0x87B6,0x87BF,0x87B8,0x87BD,0x87DE, +0x87B2,0x8935,0x8933,0x893C,0x893E,0x8941,0x8952,0x8937, +0x8942,0x89AD,0x89AF,0x89AE,0x89F2,0x89F3,0x8B1E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8B18,0x8B16,0x8B11,0x8B05,0x8B0B,0x8B22,0x8B0F, +0x8B12,0x8B15,0x8B07,0x8B0D,0x8B08,0x8B06,0x8B1C,0x8B13, +0x8B1A,0x8C4F,0x8C70,0x8C72,0x8C71,0x8C6F,0x8C95,0x8C94, +0x8CF9,0x8D6F,0x8E4E,0x8E4D,0x8E53,0x8E50,0x8E4C,0x8E47, +0x8F43,0x8F40,0x9085,0x907E,0x9138,0x919A,0x91A2,0x919B, +0x9199,0x919F,0x91A1,0x919D,0x91A0,0x93A1,0x9383,0x93AF, +0x9364,0x9356,0x9347,0x937C,0x9358,0x935C,0x9376,0x9349, +0x9350,0x9351,0x9360,0x936D,0x938F,0x934C,0x936A,0x9379, +0x9357,0x9355,0x9352,0x934F,0x9371,0x9377,0x937B,0x9361, +0x935E,0x9363,0x9367,0x9380,0x934E,0x9359,0x95C7,0x95C0, +0x95C9,0x95C3,0x95C5,0x95B7,0x96AE,0x96B0,0x96AC,0x9720, +0x971F,0x9718,0x971D,0x9719,0x979A,0x97A1,0x979C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x979E,0x979D,0x97D5,0x97D4,0x97F1,0x9841,0x9844,0x984A, +0x9849,0x9845,0x9843,0x9925,0x992B,0x992C,0x992A,0x9933, +0x9932,0x992F,0x992D,0x9931,0x9930,0x9998,0x99A3,0x99A1, +0x9A02,0x99FA,0x99F4,0x99F7,0x99F9,0x99F8,0x99F6,0x99FB, +0x99FD,0x99FE,0x99FC,0x9A03,0x9ABE,0x9AFE,0x9AFD,0x9B01, +0x9AFC,0x9B48,0x9B9A,0x9BA8,0x9B9E,0x9B9B,0x9BA6,0x9BA1, +0x9BA5,0x9BA4,0x9B86,0x9BA2,0x9BA0,0x9BAF,0x9D33,0x9D41, +0x9D67,0x9D36,0x9D2E,0x9D2F,0x9D31,0x9D38,0x9D30, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9D45,0x9D42,0x9D43,0x9D3E,0x9D37,0x9D40,0x9D3D, +0x7FF5,0x9D2D,0x9E8A,0x9E89,0x9E8D,0x9EB0,0x9EC8,0x9EDA, +0x9EFB,0x9EFF,0x9F24,0x9F23,0x9F22,0x9F54,0x9FA0,0x5131, +0x512D,0x512E,0x5698,0x569C,0x5697,0x569A,0x569D,0x5699, +0x5970,0x5B3C,0x5C69,0x5C6A,0x5DC0,0x5E6D,0x5E6E,0x61D8, +0x61DF,0x61ED,0x61EE,0x61F1,0x61EA,0x61F0,0x61EB,0x61D6, +0x61E9,0x64FF,0x6504,0x64FD,0x64F8,0x6501,0x6503,0x64FC, +0x6594,0x65DB,0x66DA,0x66DB,0x66D8,0x6AC5,0x6AB9,0x6ABD, +0x6AE1,0x6AC6,0x6ABA,0x6AB6,0x6AB7,0x6AC7,0x6AB4,0x6AAD, +0x6B5E,0x6BC9,0x6C0B,0x7007,0x700C,0x700D,0x7001,0x7005, +0x7014,0x700E,0x6FFF,0x7000,0x6FFB,0x7026,0x6FFC,0x6FF7, +0x700A,0x7201,0x71FF,0x71F9,0x7203,0x71FD,0x7376, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x74B8,0x74C0,0x74B5,0x74C1,0x74BE,0x74B6,0x74BB,0x74C2, +0x7514,0x7513,0x765C,0x7664,0x7659,0x7650,0x7653,0x7657, +0x765A,0x76A6,0x76BD,0x76EC,0x77C2,0x77BA,0x78FF,0x790C, +0x7913,0x7914,0x7909,0x7910,0x7912,0x7911,0x79AD,0x79AC, +0x7A5F,0x7C1C,0x7C29,0x7C19,0x7C20,0x7C1F,0x7C2D,0x7C1D, +0x7C26,0x7C28,0x7C22,0x7C25,0x7C30,0x7E5C,0x7E50,0x7E56, +0x7E63,0x7E58,0x7E62,0x7E5F,0x7E51,0x7E60,0x7E57,0x7E53, +0x7FB5,0x7FB3,0x7FF7,0x7FF8,0x8075,0x81D1,0x81D2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x81D0,0x825F,0x825E,0x85B4,0x85C6,0x85C0,0x85C3, +0x85C2,0x85B3,0x85B5,0x85BD,0x85C7,0x85C4,0x85BF,0x85CB, +0x85CE,0x85C8,0x85C5,0x85B1,0x85B6,0x85D2,0x8624,0x85B8, +0x85B7,0x85BE,0x8669,0x87E7,0x87E6,0x87E2,0x87DB,0x87EB, +0x87EA,0x87E5,0x87DF,0x87F3,0x87E4,0x87D4,0x87DC,0x87D3, +0x87ED,0x87D8,0x87E3,0x87A4,0x87D7,0x87D9,0x8801,0x87F4, +0x87E8,0x87DD,0x8953,0x894B,0x894F,0x894C,0x8946,0x8950, +0x8951,0x8949,0x8B2A,0x8B27,0x8B23,0x8B33,0x8B30,0x8B35, +0x8B47,0x8B2F,0x8B3C,0x8B3E,0x8B31,0x8B25,0x8B37,0x8B26, +0x8B36,0x8B2E,0x8B24,0x8B3B,0x8B3D,0x8B3A,0x8C42,0x8C75, +0x8C99,0x8C98,0x8C97,0x8CFE,0x8D04,0x8D02,0x8D00,0x8E5C, +0x8E62,0x8E60,0x8E57,0x8E56,0x8E5E,0x8E65,0x8E67, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E5B,0x8E5A,0x8E61,0x8E5D,0x8E69,0x8E54,0x8F46,0x8F47, +0x8F48,0x8F4B,0x9128,0x913A,0x913B,0x913E,0x91A8,0x91A5, +0x91A7,0x91AF,0x91AA,0x93B5,0x938C,0x9392,0x93B7,0x939B, +0x939D,0x9389,0x93A7,0x938E,0x93AA,0x939E,0x93A6,0x9395, +0x9388,0x9399,0x939F,0x938D,0x93B1,0x9391,0x93B2,0x93A4, +0x93A8,0x93B4,0x93A3,0x93A5,0x95D2,0x95D3,0x95D1,0x96B3, +0x96D7,0x96DA,0x5DC2,0x96DF,0x96D8,0x96DD,0x9723,0x9722, +0x9725,0x97AC,0x97AE,0x97A8,0x97AB,0x97A4,0x97AA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x97A2,0x97A5,0x97D7,0x97D9,0x97D6,0x97D8,0x97FA, +0x9850,0x9851,0x9852,0x98B8,0x9941,0x993C,0x993A,0x9A0F, +0x9A0B,0x9A09,0x9A0D,0x9A04,0x9A11,0x9A0A,0x9A05,0x9A07, +0x9A06,0x9AC0,0x9ADC,0x9B08,0x9B04,0x9B05,0x9B29,0x9B35, +0x9B4A,0x9B4C,0x9B4B,0x9BC7,0x9BC6,0x9BC3,0x9BBF,0x9BC1, +0x9BB5,0x9BB8,0x9BD3,0x9BB6,0x9BC4,0x9BB9,0x9BBD,0x9D5C, +0x9D53,0x9D4F,0x9D4A,0x9D5B,0x9D4B,0x9D59,0x9D56,0x9D4C, +0x9D57,0x9D52,0x9D54,0x9D5F,0x9D58,0x9D5A,0x9E8E,0x9E8C, +0x9EDF,0x9F01,0x9F00,0x9F16,0x9F25,0x9F2B,0x9F2A,0x9F29, +0x9F28,0x9F4C,0x9F55,0x5134,0x5135,0x5296,0x52F7,0x53B4, +0x56AB,0x56AD,0x56A6,0x56A7,0x56AA,0x56AC,0x58DA,0x58DD, +0x58DB,0x5912,0x5B3D,0x5B3E,0x5B3F,0x5DC3,0x5E70, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5FBF,0x61FB,0x6507,0x6510,0x650D,0x6509,0x650C,0x650E, +0x6584,0x65DE,0x65DD,0x66DE,0x6AE7,0x6AE0,0x6ACC,0x6AD1, +0x6AD9,0x6ACB,0x6ADF,0x6ADC,0x6AD0,0x6AEB,0x6ACF,0x6ACD, +0x6ADE,0x6B60,0x6BB0,0x6C0C,0x7019,0x7027,0x7020,0x7016, +0x702B,0x7021,0x7022,0x7023,0x7029,0x7017,0x7024,0x701C, +0x702A,0x720C,0x720A,0x7207,0x7202,0x7205,0x72A5,0x72A6, +0x72A4,0x72A3,0x72A1,0x74CB,0x74C5,0x74B7,0x74C3,0x7516, +0x7660,0x77C9,0x77CA,0x77C4,0x77F1,0x791D,0x791B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7921,0x791C,0x7917,0x791E,0x79B0,0x7A67,0x7A68, +0x7C33,0x7C3C,0x7C39,0x7C2C,0x7C3B,0x7CEC,0x7CEA,0x7E76, +0x7E75,0x7E78,0x7E70,0x7E77,0x7E6F,0x7E7A,0x7E72,0x7E74, +0x7E68,0x7F4B,0x7F4A,0x7F83,0x7F86,0x7FB7,0x7FFD,0x7FFE, +0x8078,0x81D7,0x81D5,0x8264,0x8261,0x8263,0x85EB,0x85F1, +0x85ED,0x85D9,0x85E1,0x85E8,0x85DA,0x85D7,0x85EC,0x85F2, +0x85F8,0x85D8,0x85DF,0x85E3,0x85DC,0x85D1,0x85F0,0x85E6, +0x85EF,0x85DE,0x85E2,0x8800,0x87FA,0x8803,0x87F6,0x87F7, +0x8809,0x880C,0x880B,0x8806,0x87FC,0x8808,0x87FF,0x880A, +0x8802,0x8962,0x895A,0x895B,0x8957,0x8961,0x895C,0x8958, +0x895D,0x8959,0x8988,0x89B7,0x89B6,0x89F6,0x8B50,0x8B48, +0x8B4A,0x8B40,0x8B53,0x8B56,0x8B54,0x8B4B,0x8B55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B51,0x8B42,0x8B52,0x8B57,0x8C43,0x8C77,0x8C76,0x8C9A, +0x8D06,0x8D07,0x8D09,0x8DAC,0x8DAA,0x8DAD,0x8DAB,0x8E6D, +0x8E78,0x8E73,0x8E6A,0x8E6F,0x8E7B,0x8EC2,0x8F52,0x8F51, +0x8F4F,0x8F50,0x8F53,0x8FB4,0x9140,0x913F,0x91B0,0x91AD, +0x93DE,0x93C7,0x93CF,0x93C2,0x93DA,0x93D0,0x93F9,0x93EC, +0x93CC,0x93D9,0x93A9,0x93E6,0x93CA,0x93D4,0x93EE,0x93E3, +0x93D5,0x93C4,0x93CE,0x93C0,0x93D2,0x93E7,0x957D,0x95DA, +0x95DB,0x96E1,0x9729,0x972B,0x972C,0x9728,0x9726, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x97B3,0x97B7,0x97B6,0x97DD,0x97DE,0x97DF,0x985C, +0x9859,0x985D,0x9857,0x98BF,0x98BD,0x98BB,0x98BE,0x9948, +0x9947,0x9943,0x99A6,0x99A7,0x9A1A,0x9A15,0x9A25,0x9A1D, +0x9A24,0x9A1B,0x9A22,0x9A20,0x9A27,0x9A23,0x9A1E,0x9A1C, +0x9A14,0x9AC2,0x9B0B,0x9B0A,0x9B0E,0x9B0C,0x9B37,0x9BEA, +0x9BEB,0x9BE0,0x9BDE,0x9BE4,0x9BE6,0x9BE2,0x9BF0,0x9BD4, +0x9BD7,0x9BEC,0x9BDC,0x9BD9,0x9BE5,0x9BD5,0x9BE1,0x9BDA, +0x9D77,0x9D81,0x9D8A,0x9D84,0x9D88,0x9D71,0x9D80,0x9D78, +0x9D86,0x9D8B,0x9D8C,0x9D7D,0x9D6B,0x9D74,0x9D75,0x9D70, +0x9D69,0x9D85,0x9D73,0x9D7B,0x9D82,0x9D6F,0x9D79,0x9D7F, +0x9D87,0x9D68,0x9E94,0x9E91,0x9EC0,0x9EFC,0x9F2D,0x9F40, +0x9F41,0x9F4D,0x9F56,0x9F57,0x9F58,0x5337,0x56B2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x56B5,0x56B3,0x58E3,0x5B45,0x5DC6,0x5DC7,0x5EEE,0x5EEF, +0x5FC0,0x5FC1,0x61F9,0x6517,0x6516,0x6515,0x6513,0x65DF, +0x66E8,0x66E3,0x66E4,0x6AF3,0x6AF0,0x6AEA,0x6AE8,0x6AF9, +0x6AF1,0x6AEE,0x6AEF,0x703C,0x7035,0x702F,0x7037,0x7034, +0x7031,0x7042,0x7038,0x703F,0x703A,0x7039,0x7040,0x703B, +0x7033,0x7041,0x7213,0x7214,0x72A8,0x737D,0x737C,0x74BA, +0x76AB,0x76AA,0x76BE,0x76ED,0x77CC,0x77CE,0x77CF,0x77CD, +0x77F2,0x7925,0x7923,0x7927,0x7928,0x7924,0x7929, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x79B2,0x7A6E,0x7A6C,0x7A6D,0x7AF7,0x7C49,0x7C48, +0x7C4A,0x7C47,0x7C45,0x7CEE,0x7E7B,0x7E7E,0x7E81,0x7E80, +0x7FBA,0x7FFF,0x8079,0x81DB,0x81D9,0x820B,0x8268,0x8269, +0x8622,0x85FF,0x8601,0x85FE,0x861B,0x8600,0x85F6,0x8604, +0x8609,0x8605,0x860C,0x85FD,0x8819,0x8810,0x8811,0x8817, +0x8813,0x8816,0x8963,0x8966,0x89B9,0x89F7,0x8B60,0x8B6A, +0x8B5D,0x8B68,0x8B63,0x8B65,0x8B67,0x8B6D,0x8DAE,0x8E86, +0x8E88,0x8E84,0x8F59,0x8F56,0x8F57,0x8F55,0x8F58,0x8F5A, +0x908D,0x9143,0x9141,0x91B7,0x91B5,0x91B2,0x91B3,0x940B, +0x9413,0x93FB,0x9420,0x940F,0x9414,0x93FE,0x9415,0x9410, +0x9428,0x9419,0x940D,0x93F5,0x9400,0x93F7,0x9407,0x940E, +0x9416,0x9412,0x93FA,0x9409,0x93F8,0x940A,0x93FF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x93FC,0x940C,0x93F6,0x9411,0x9406,0x95DE,0x95E0,0x95DF, +0x972E,0x972F,0x97B9,0x97BB,0x97FD,0x97FE,0x9860,0x9862, +0x9863,0x985F,0x98C1,0x98C2,0x9950,0x994E,0x9959,0x994C, +0x994B,0x9953,0x9A32,0x9A34,0x9A31,0x9A2C,0x9A2A,0x9A36, +0x9A29,0x9A2E,0x9A38,0x9A2D,0x9AC7,0x9ACA,0x9AC6,0x9B10, +0x9B12,0x9B11,0x9C0B,0x9C08,0x9BF7,0x9C05,0x9C12,0x9BF8, +0x9C40,0x9C07,0x9C0E,0x9C06,0x9C17,0x9C14,0x9C09,0x9D9F, +0x9D99,0x9DA4,0x9D9D,0x9D92,0x9D98,0x9D90,0x9D9B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9DA0,0x9D94,0x9D9C,0x9DAA,0x9D97,0x9DA1,0x9D9A, +0x9DA2,0x9DA8,0x9D9E,0x9DA3,0x9DBF,0x9DA9,0x9D96,0x9DA6, +0x9DA7,0x9E99,0x9E9B,0x9E9A,0x9EE5,0x9EE4,0x9EE7,0x9EE6, +0x9F30,0x9F2E,0x9F5B,0x9F60,0x9F5E,0x9F5D,0x9F59,0x9F91, +0x513A,0x5139,0x5298,0x5297,0x56C3,0x56BD,0x56BE,0x5B48, +0x5B47,0x5DCB,0x5DCF,0x5EF1,0x61FD,0x651B,0x6B02,0x6AFC, +0x6B03,0x6AF8,0x6B00,0x7043,0x7044,0x704A,0x7048,0x7049, +0x7045,0x7046,0x721D,0x721A,0x7219,0x737E,0x7517,0x766A, +0x77D0,0x792D,0x7931,0x792F,0x7C54,0x7C53,0x7CF2,0x7E8A, +0x7E87,0x7E88,0x7E8B,0x7E86,0x7E8D,0x7F4D,0x7FBB,0x8030, +0x81DD,0x8618,0x862A,0x8626,0x861F,0x8623,0x861C,0x8619, +0x8627,0x862E,0x8621,0x8620,0x8629,0x861E,0x8625, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8829,0x881D,0x881B,0x8820,0x8824,0x881C,0x882B,0x884A, +0x896D,0x8969,0x896E,0x896B,0x89FA,0x8B79,0x8B78,0x8B45, +0x8B7A,0x8B7B,0x8D10,0x8D14,0x8DAF,0x8E8E,0x8E8C,0x8F5E, +0x8F5B,0x8F5D,0x9146,0x9144,0x9145,0x91B9,0x943F,0x943B, +0x9436,0x9429,0x943D,0x943C,0x9430,0x9439,0x942A,0x9437, +0x942C,0x9440,0x9431,0x95E5,0x95E4,0x95E3,0x9735,0x973A, +0x97BF,0x97E1,0x9864,0x98C9,0x98C6,0x98C0,0x9958,0x9956, +0x9A39,0x9A3D,0x9A46,0x9A44,0x9A42,0x9A41,0x9A3A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9A3F,0x9ACD,0x9B15,0x9B17,0x9B18,0x9B16,0x9B3A, +0x9B52,0x9C2B,0x9C1D,0x9C1C,0x9C2C,0x9C23,0x9C28,0x9C29, +0x9C24,0x9C21,0x9DB7,0x9DB6,0x9DBC,0x9DC1,0x9DC7,0x9DCA, +0x9DCF,0x9DBE,0x9DC5,0x9DC3,0x9DBB,0x9DB5,0x9DCE,0x9DB9, +0x9DBA,0x9DAC,0x9DC8,0x9DB1,0x9DAD,0x9DCC,0x9DB3,0x9DCD, +0x9DB2,0x9E7A,0x9E9C,0x9EEB,0x9EEE,0x9EED,0x9F1B,0x9F18, +0x9F1A,0x9F31,0x9F4E,0x9F65,0x9F64,0x9F92,0x4EB9,0x56C6, +0x56C5,0x56CB,0x5971,0x5B4B,0x5B4C,0x5DD5,0x5DD1,0x5EF2, +0x6521,0x6520,0x6526,0x6522,0x6B0B,0x6B08,0x6B09,0x6C0D, +0x7055,0x7056,0x7057,0x7052,0x721E,0x721F,0x72A9,0x737F, +0x74D8,0x74D5,0x74D9,0x74D7,0x766D,0x76AD,0x7935,0x79B4, +0x7A70,0x7A71,0x7C57,0x7C5C,0x7C59,0x7C5B,0x7C5A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7CF4,0x7CF1,0x7E91,0x7F4F,0x7F87,0x81DE,0x826B,0x8634, +0x8635,0x8633,0x862C,0x8632,0x8636,0x882C,0x8828,0x8826, +0x882A,0x8825,0x8971,0x89BF,0x89BE,0x89FB,0x8B7E,0x8B84, +0x8B82,0x8B86,0x8B85,0x8B7F,0x8D15,0x8E95,0x8E94,0x8E9A, +0x8E92,0x8E90,0x8E96,0x8E97,0x8F60,0x8F62,0x9147,0x944C, +0x9450,0x944A,0x944B,0x944F,0x9447,0x9445,0x9448,0x9449, +0x9446,0x973F,0x97E3,0x986A,0x9869,0x98CB,0x9954,0x995B, +0x9A4E,0x9A53,0x9A54,0x9A4C,0x9A4F,0x9A48,0x9A4A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9A49,0x9A52,0x9A50,0x9AD0,0x9B19,0x9B2B,0x9B3B, +0x9B56,0x9B55,0x9C46,0x9C48,0x9C3F,0x9C44,0x9C39,0x9C33, +0x9C41,0x9C3C,0x9C37,0x9C34,0x9C32,0x9C3D,0x9C36,0x9DDB, +0x9DD2,0x9DDE,0x9DDA,0x9DCB,0x9DD0,0x9DDC,0x9DD1,0x9DDF, +0x9DE9,0x9DD9,0x9DD8,0x9DD6,0x9DF5,0x9DD5,0x9DDD,0x9EB6, +0x9EF0,0x9F35,0x9F33,0x9F32,0x9F42,0x9F6B,0x9F95,0x9FA2, +0x513D,0x5299,0x58E8,0x58E7,0x5972,0x5B4D,0x5DD8,0x882F, +0x5F4F,0x6201,0x6203,0x6204,0x6529,0x6525,0x6596,0x66EB, +0x6B11,0x6B12,0x6B0F,0x6BCA,0x705B,0x705A,0x7222,0x7382, +0x7381,0x7383,0x7670,0x77D4,0x7C67,0x7C66,0x7E95,0x826C, +0x863A,0x8640,0x8639,0x863C,0x8631,0x863B,0x863E,0x8830, +0x8832,0x882E,0x8833,0x8976,0x8974,0x8973,0x89FE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B8C,0x8B8E,0x8B8B,0x8B88,0x8C45,0x8D19,0x8E98,0x8F64, +0x8F63,0x91BC,0x9462,0x9455,0x945D,0x9457,0x945E,0x97C4, +0x97C5,0x9800,0x9A56,0x9A59,0x9B1E,0x9B1F,0x9B20,0x9C52, +0x9C58,0x9C50,0x9C4A,0x9C4D,0x9C4B,0x9C55,0x9C59,0x9C4C, +0x9C4E,0x9DFB,0x9DF7,0x9DEF,0x9DE3,0x9DEB,0x9DF8,0x9DE4, +0x9DF6,0x9DE1,0x9DEE,0x9DE6,0x9DF2,0x9DF0,0x9DE2,0x9DEC, +0x9DF4,0x9DF3,0x9DE8,0x9DED,0x9EC2,0x9ED0,0x9EF2,0x9EF3, +0x9F06,0x9F1C,0x9F38,0x9F37,0x9F36,0x9F43,0x9F4F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9F71,0x9F70,0x9F6E,0x9F6F,0x56D3,0x56CD,0x5B4E, +0x5C6D,0x652D,0x66ED,0x66EE,0x6B13,0x705F,0x7061,0x705D, +0x7060,0x7223,0x74DB,0x74E5,0x77D5,0x7938,0x79B7,0x79B6, +0x7C6A,0x7E97,0x7F89,0x826D,0x8643,0x8838,0x8837,0x8835, +0x884B,0x8B94,0x8B95,0x8E9E,0x8E9F,0x8EA0,0x8E9D,0x91BE, +0x91BD,0x91C2,0x946B,0x9468,0x9469,0x96E5,0x9746,0x9743, +0x9747,0x97C7,0x97E5,0x9A5E,0x9AD5,0x9B59,0x9C63,0x9C67, +0x9C66,0x9C62,0x9C5E,0x9C60,0x9E02,0x9DFE,0x9E07,0x9E03, +0x9E06,0x9E05,0x9E00,0x9E01,0x9E09,0x9DFF,0x9DFD,0x9E04, +0x9EA0,0x9F1E,0x9F46,0x9F74,0x9F75,0x9F76,0x56D4,0x652E, +0x65B8,0x6B18,0x6B19,0x6B17,0x6B1A,0x7062,0x7226,0x72AA, +0x77D8,0x77D9,0x7939,0x7C69,0x7C6B,0x7CF6,0x7E9A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7E98,0x7E9B,0x7E99,0x81E0,0x81E1,0x8646,0x8647,0x8648, +0x8979,0x897A,0x897C,0x897B,0x89FF,0x8B98,0x8B99,0x8EA5, +0x8EA4,0x8EA3,0x946E,0x946D,0x946F,0x9471,0x9473,0x9749, +0x9872,0x995F,0x9C68,0x9C6E,0x9C6D,0x9E0B,0x9E0D,0x9E10, +0x9E0F,0x9E12,0x9E11,0x9EA1,0x9EF5,0x9F09,0x9F47,0x9F78, +0x9F7B,0x9F7A,0x9F79,0x571E,0x7066,0x7C6F,0x883C,0x8DB2, +0x8EA6,0x91C3,0x9474,0x9478,0x9476,0x9475,0x9A60,0x9C74, +0x9C73,0x9C71,0x9C75,0x9E14,0x9E13,0x9EF6,0x9F0A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9FA4,0x7068,0x7065,0x7CF7,0x866A,0x883E,0x883D, +0x883F,0x8B9E,0x8C9C,0x8EA9,0x8EC9,0x974B,0x9873,0x9874, +0x98CC,0x9961,0x99AB,0x9A64,0x9A66,0x9A67,0x9B24,0x9E15, +0x9E17,0x9F48,0x6207,0x6B1E,0x7227,0x864C,0x8EA8,0x9482, +0x9480,0x9481,0x9A69,0x9A68,0x9B2E,0x9E19,0x7229,0x864B, +0x8B9F,0x9483,0x9C79,0x9EB7,0x7675,0x9A6B,0x9C7A,0x9E1D, +0x7069,0x706A,0x9EA4,0x9F7E,0x9F49,0x9F98,0x7881,0x92B9, +0x88CF,0x58BB,0x6052,0x7CA7,0x5AFA}; + +static int func_big5_uni_onechar(int code){ + if ((code>=0xA140)&&(code<=0xC7FC)) + return(tab_big5_uni0[code-0xA140]); + if ((code>=0xC940)&&(code<=0xF9DC)) + return(tab_big5_uni1[code-0xC940]); + return(0); +} + + +/* page 0 0x00A2-0x00F7 */ +static uint16 tab_uni_big50[]={ +0xA246,0xA247, 0,0xA244, 0,0xA1B1, 0, 0, + 0, 0, 0, 0, 0, 0,0xA258,0xA1D3, + 0, 0, 0, 0, 0,0xA150, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1D1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1D2}; + +/* page 1 0x02C7-0x0451 */ +static uint16 tab_uni_big51[]={ +0xA3BE, 0,0xA3BC,0xA3BD,0xA3BF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA3BB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA344,0xA345,0xA346,0xA347,0xA348,0xA349, +0xA34A,0xA34B,0xA34C,0xA34D,0xA34E,0xA34F,0xA350,0xA351, +0xA352,0xA353,0xA354, 0,0xA355,0xA356,0xA357,0xA358, +0xA359,0xA35A,0xA35B, 0, 0, 0, 0, 0, + 0, 0,0xA35C,0xA35D,0xA35E,0xA35F,0xA360,0xA361, +0xA362,0xA363,0xA364,0xA365,0xA366,0xA367,0xA368,0xA369, +0xA36A,0xA36B,0xA36C, 0,0xA36D,0xA36E,0xA36F,0xA370, +0xA371,0xA372,0xA373, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xC7B3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xC7B1,0xC7B2,0xC7B4, +0xC7B5,0xC7B6,0xC7B7,0xC7B8,0xC7B9,0xC7BA, 0, 0, + 0, 0, 0, 0,0xC7BB,0xC7BC,0xC7BD,0xC7BE, +0xC7BF,0xC7C0,0xC7C1,0xC7C2,0xC7C3,0xC7C4,0xC7C5,0xC7C6, +0xC7C7,0xC7C8,0xC7C9,0xC7CA,0xC7CB,0xC7CC,0xC7CD,0xC7CF, +0xC7D0,0xC7D1,0xC7D2,0xC7D3,0xC7D4,0xC7D5,0xC7D6,0xC7D7, +0xC7D8,0xC7D9,0xC7DA,0xC7DB,0xC7DC,0xC7DD,0xC7DE,0xC7DF, +0xC7E0,0xC7E1,0xC7E2,0xC7E3,0xC7E4,0xC7E5,0xC7E6,0xC7E7, +0xC7E8, 0,0xC7CE}; + +/* page 2 0x2013-0x22BF */ +static uint16 tab_uni_big52[]={ +0xA156,0xA158, 0, 0, 0,0xA1A5,0xA1A6, 0, + 0,0xA1A7,0xA1A8, 0, 0, 0, 0,0xA145, + 0, 0,0xA14C,0xA14B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA1AC, + 0, 0,0xA1AB, 0, 0, 0, 0, 0, +0xA1B0, 0, 0,0xA1C2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA24A, 0,0xA1C1, 0, 0, 0,0xA24B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA2B9,0xA2BA,0xA2BB, +0xA2BC,0xA2BD,0xA2BE,0xA2BF,0xA2C0,0xA2C1,0xA2C2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1F6,0xA1F4,0xA1F7, +0xA1F5, 0, 0,0xA1F8,0xA1F9,0xA1FB,0xA1FA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA1D4, + 0, 0, 0,0xA1DB,0xA1E8,0xA1E7, 0, 0, +0xA1FD, 0,0xA1FC, 0, 0, 0,0xA1E4,0xA1E5, +0xA1EC, 0, 0,0xA1ED, 0, 0, 0, 0, + 0,0xA1EF,0xA1EE, 0, 0, 0, 0, 0, + 0,0xA1E3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA1DC, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1DA,0xA1DD, 0, + 0, 0, 0,0xA1D8,0xA1D9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA1E6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA1E9}; + +/* page 3 0x2460-0x2642 */ +static uint16 tab_uni_big53[]={ +0xC7E9,0xC7EA,0xC7EB,0xC7EC,0xC7ED,0xC7EE,0xC7EF,0xC7F0, +0xC7F1,0xC7F2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xC7F3,0xC7F4,0xC7F5,0xC7F6, +0xC7F7,0xC7F8,0xC7F9,0xC7FA,0xC7FB,0xC7FC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA277, 0,0xA278, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA27A, 0, 0, 0, +0xA27B, 0, 0, 0,0xA27C, 0, 0, 0, +0xA27D, 0, 0, 0,0xA275, 0, 0, 0, + 0, 0, 0, 0,0xA274, 0, 0, 0, + 0, 0, 0, 0,0xA273, 0, 0, 0, + 0, 0, 0, 0,0xA272, 0, 0, 0, + 0, 0, 0, 0,0xA271, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA2A4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA2A5, 0, + 0,0xA2A7, 0, 0, 0, 0, 0, 0, + 0, 0,0xA2A6, 0, 0,0xA27E,0xA2A1,0xA2A3, +0xA2A2,0xA2AC,0xA2AD,0xA2AE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA262,0xA263,0xA264,0xA265,0xA266,0xA267,0xA268, +0xA269,0xA270,0xA26F,0xA26E,0xA26D,0xA26C,0xA26B,0xA26A, + 0, 0, 0, 0,0xA276,0xA279, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1BD,0xA1BC, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA1B6,0xA1B5, 0, 0, 0, 0, + 0, 0, 0, 0,0xA1BF,0xA1BE, 0, 0, + 0, 0, 0, 0, 0, 0,0xA1BB,0xA1BA, + 0, 0, 0,0xA1B3, 0, 0,0xA1B7,0xA1B4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA2A8,0xA2A9,0xA2AB,0xA2AA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1B9,0xA1B8, 0, + 0,0xA1F3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1F0,0xA1F2,0xA1F1}; + +/* page 4 0x3000-0x3129 */ +static uint16 tab_uni_big54[]={ +0xA140,0xA142,0xA143,0xA1B2, 0,0xC6A4, 0, 0, +0xA171,0xA172,0xA16D,0xA16E,0xA175,0xA176,0xA179,0xA17A, +0xA169,0xA16A,0xA245, 0,0xA165,0xA166, 0, 0, + 0, 0, 0, 0, 0,0xA1A9,0xA1AA, 0, + 0,0xA2C3,0xA2C4,0xA2C5,0xA2C6,0xA2C7,0xA2C8,0xA2C9, +0xA2CA,0xA2CB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xC6A5,0xC6A6,0xC6A7,0xC6A8,0xC6A9,0xC6AA,0xC6AB, +0xC6AC,0xC6AD,0xC6AE,0xC6AF,0xC6B0,0xC6B1,0xC6B2,0xC6B3, +0xC6B4,0xC6B5,0xC6B6,0xC6B7,0xC6B8,0xC6B9,0xC6BA,0xC6BB, +0xC6BC,0xC6BD,0xC6BE,0xC6BF,0xC6C0,0xC6C1,0xC6C2,0xC6C3, +0xC6C4,0xC6C5,0xC6C6,0xC6C7,0xC6C8,0xC6C9,0xC6CA,0xC6CB, +0xC6CC,0xC6CD,0xC6CE,0xC6CF,0xC6D0,0xC6D1,0xC6D2,0xC6D3, +0xC6D4,0xC6D5,0xC6D6,0xC6D7,0xC6D8,0xC6D9,0xC6DA,0xC6DB, +0xC6DC,0xC6DD,0xC6DE,0xC6DF,0xC6E0,0xC6E1,0xC6E2,0xC6E3, +0xC6E4,0xC6E5,0xC6E6,0xC6E7,0xC6E8,0xC6E9,0xC6EA,0xC6EB, +0xC6EC,0xC6ED,0xC6EE,0xC6EF,0xC6F0,0xC6F1,0xC6F2,0xC6F3, +0xC6F4,0xC6F5,0xC6F6,0xC6F7, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xC6A2,0xC6A3, 0, + 0,0xC6F8,0xC6F9,0xC6FA,0xC6FB,0xC6FC,0xC6FD,0xC6FE, +0xC740,0xC741,0xC742,0xC743,0xC744,0xC745,0xC746,0xC747, +0xC748,0xC749,0xC74A,0xC74B,0xC74C,0xC74D,0xC74E,0xC74F, +0xC750,0xC751,0xC752,0xC753,0xC754,0xC755,0xC756,0xC757, +0xC758,0xC759,0xC75A,0xC75B,0xC75C,0xC75D,0xC75E,0xC75F, +0xC760,0xC761,0xC762,0xC763,0xC764,0xC765,0xC766,0xC767, +0xC768,0xC769,0xC76A,0xC76B,0xC76C,0xC76D,0xC76E,0xC76F, +0xC770,0xC771,0xC772,0xC773,0xC774,0xC775,0xC776,0xC777, +0xC778,0xC779,0xC77A,0xC77B,0xC77C,0xC77D,0xC77E,0xC7A1, +0xC7A2,0xC7A3,0xC7A4,0xC7A5,0xC7A6,0xC7A7,0xC7A8,0xC7A9, +0xC7AA,0xC7AB,0xC7AC,0xC7AD,0xC7AE,0xC7AF,0xC7B0, 0, + 0, 0, 0, 0, 0, 0,0xC6A1, 0, + 0, 0, 0, 0, 0,0xA374,0xA375,0xA376, +0xA377,0xA378,0xA379,0xA37A,0xA37B,0xA37C,0xA37D,0xA37E, +0xA3A1,0xA3A2,0xA3A3,0xA3A4,0xA3A5,0xA3A6,0xA3A7,0xA3A8, +0xA3A9,0xA3AA,0xA3AB,0xA3AC,0xA3AD,0xA3AE,0xA3AF,0xA3B0, +0xA3B1,0xA3B2,0xA3B3,0xA3B4,0xA3B5,0xA3B6,0xA3B7,0xA3B8, +0xA3B9,0xA3BA}; + +/* page 5 0x32A3-0x32A3 */ +static uint16 tab_uni_big55[]={ +0xA1C0}; + +/* page 6 0x338E-0x33D5 */ +static uint16 tab_uni_big56[]={ +0xA255,0xA256, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA250,0xA251, +0xA252, 0, 0,0xA254, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA257, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA253, 0, 0,0xA1EB,0xA1EA, 0, 0,0xA24F +}; + +/* page 7 0x4E00-0x9483 */ +static uint16 tab_uni_big57[]={ +0xA440,0xA442, 0,0xA443, 0, 0, 0,0xC945, +0xA456,0xA454,0xA457,0xA455,0xC946,0xA4A3,0xC94F,0xC94D, +0xA4A2,0xA4A1, 0, 0,0xA542,0xA541,0xA540, 0, +0xA543,0xA4FE, 0, 0, 0, 0,0xA5E0,0xA5E1, + 0, 0, 0, 0, 0, 0,0xA8C3, 0, + 0, 0, 0,0xA458, 0,0xA4A4,0xC950, 0, +0xA4A5,0xC963,0xA6EA,0xCBB1, 0, 0, 0, 0, +0xA459,0xA4A6, 0,0xA544,0xC964, 0, 0, 0, + 0, 0,0xC940,0xA444, 0,0xA45B, 0,0xC947, +0xA45C, 0, 0,0xA4A7, 0,0xA545,0xA547,0xA546, + 0, 0,0xA5E2,0xA5E3, 0, 0,0xA8C4, 0, +0xADBC,0xA441, 0, 0,0xC941,0xA445,0xA45E,0xA45D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA5E4, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA8C5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xB0AE,0xD44B, + 0, 0,0xB6C3,0xDCB1,0xDCB2, 0,0xA446, 0, +0xA4A9, 0, 0,0xA8C6,0xA447,0xC948,0xA45F, 0, + 0,0xA4AA,0xA4AC,0xC951,0xA4AD,0xA4AB, 0, 0, + 0,0xA5E5, 0,0xA8C7, 0, 0,0xA8C8,0xAB45, + 0,0xA460,0xA4AE, 0,0xA5E6,0xA5E8,0xA5E7, 0, +0xA6EB, 0, 0,0xA8C9,0xA8CA,0xAB46,0xAB47, 0, + 0, 0, 0,0xADBD, 0, 0,0xDCB3, 0, + 0,0xF6D6,0xA448, 0, 0, 0, 0, 0, +0xA4B0,0xA4AF,0xC952,0xA4B1,0xA4B7, 0,0xA4B2,0xA4B3, +0xC954,0xC953,0xA4B5,0xA4B6, 0,0xA4B4, 0, 0, + 0, 0, 0, 0,0xA54A,0xA54B,0xA54C,0xA54D, +0xA549,0xA550,0xC96A, 0,0xC966,0xC969,0xA551,0xA561, + 0,0xC968, 0,0xA54E,0xA54F,0xA548, 0, 0, +0xC965,0xC967, 0, 0, 0, 0, 0, 0, +0xA5F5,0xC9B0,0xA5F2,0xA5F6,0xC9BA,0xC9AE,0xA5F3,0xC9B2, + 0, 0, 0,0xA5F4, 0,0xA5F7, 0,0xA5E9, +0xC9B1,0xA5F8,0xC9B5, 0,0xC9B9,0xC9B6, 0, 0, +0xC9B3,0xA5EA,0xA5EC,0xA5F9, 0,0xA5EE,0xC9AB,0xA5F1, +0xA5EF,0xA5F0,0xC9BB,0xC9B8,0xC9AF,0xA5ED, 0, 0, +0xC9AC,0xA5EB, 0, 0, 0,0xC9B4, 0, 0, + 0, 0,0xC9B7, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xC9AD,0xCA66, 0,0xA742, +0xA6F4, 0, 0,0xCA67,0xA6F1, 0,0xA744, 0, +0xA6F9, 0,0xA6F8,0xCA5B,0xA6FC,0xA6F7,0xCA60,0xCA68, + 0,0xCA64, 0,0xA6FA, 0, 0,0xA6FD,0xA6EE, +0xA747,0xCA5D, 0, 0,0xCBBD,0xA6EC,0xA743,0xA6ED, +0xA6F5,0xA6F6,0xCA62,0xCA5E,0xA6FB,0xA6F3,0xCA5A,0xA6EF, +0xCA65,0xA745,0xA748,0xA6F2,0xA740,0xA746,0xA6F0,0xCA63, +0xA741,0xCA69,0xCA5C,0xA6FE,0xCA5F, 0, 0,0xCA61, + 0,0xA8D8,0xCBBF,0xCBCB,0xA8D0, 0,0xCBCC,0xA8CB, +0xA8D5, 0, 0,0xA8CE,0xCBB9,0xA8D6,0xCBB8,0xCBBC, +0xCBC3,0xCBC1,0xA8DE,0xA8D9,0xCBB3,0xCBB5,0xA8DB,0xA8CF, +0xCBB6,0xCBC2,0xCBC9,0xA8D4,0xCBBB,0xCBB4,0xA8D3,0xCBB7, +0xA8D7,0xCBBA, 0,0xA8D2, 0,0xA8CD, 0,0xA8DC, +0xCBC4,0xA8DD,0xCBC8, 0,0xCBC6,0xCBCA,0xA8DA,0xCBBE, +0xCBB2, 0,0xCBC0,0xA8D1,0xCBC5,0xA8CC,0xCBC7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xAB56,0xAB4A, + 0, 0,0xCDE0,0xCDE8, 0,0xAB49,0xAB51,0xAB5D, + 0,0xCDEE,0xCDEC,0xCDE7, 0, 0, 0,0xAB4B, +0xCDED,0xCDE3,0xAB59,0xAB50,0xAB58,0xCDDE, 0,0xCDEA, + 0,0xCDE1,0xAB54,0xCDE2, 0,0xCDDD,0xAB5B,0xAB4E, +0xAB57,0xAB4D, 0,0xCDDF,0xCDE4, 0,0xCDEB,0xAB55, +0xAB52,0xCDE6,0xAB5A,0xCDE9,0xCDE5,0xAB4F,0xAB5C,0xAB53, +0xAB4C,0xAB48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCDEF, 0,0xADD7,0xADC1, + 0,0xADD1, 0,0xADD6,0xD0D0,0xD0CF,0xD0D4,0xD0D5, +0xADC4, 0,0xADCD, 0, 0, 0,0xADDA, 0, +0xADCE, 0, 0, 0, 0,0xD0C9,0xADC7,0xD0CA, + 0,0xADDC, 0,0xADD3,0xADBE,0xADBF,0xD0DD,0xB0BF, + 0,0xADCC,0xADCB,0xD0CB,0xADCF,0xD45B,0xADC6,0xD0D6, +0xADD5,0xADD4,0xADCA,0xD0CE,0xD0D7, 0,0xD0C8,0xADC9, +0xD0D8,0xADD2,0xD0CC,0xADC0, 0,0xADC3,0xADC2,0xD0D9, +0xADD0,0xADC5,0xADD9,0xADDB,0xD0D3,0xADD8, 0,0xD0DB, +0xD0CD,0xD0DC, 0,0xD0D1, 0,0xD0DA, 0,0xD0D2, + 0, 0, 0, 0,0xADC8, 0, 0, 0, +0xD463,0xD457, 0,0xB0B3, 0,0xD45C,0xD462,0xB0B2, +0xD455,0xB0B6,0xD459,0xD452,0xB0B4,0xD456,0xB0B9,0xB0BE, + 0,0xD467, 0,0xD451, 0,0xB0BA, 0,0xD466, + 0, 0,0xB0B5,0xD458,0xB0B1,0xD453,0xD44F,0xD45D, +0xD450,0xD44E,0xD45A,0xD460,0xD461,0xB0B7, 0, 0, +0xD85B,0xD45E,0xD44D,0xD45F, 0,0xB0C1,0xD464,0xB0C0, +0xD44C, 0,0xD454,0xD465,0xB0BC,0xB0BB,0xB0B8,0xB0BD, + 0, 0,0xB0AF, 0, 0,0xB0B0, 0, 0, +0xB3C8, 0,0xD85E,0xD857, 0,0xB3C5, 0,0xD85F, + 0, 0, 0,0xD855,0xD858,0xB3C4,0xD859, 0, + 0,0xB3C7,0xD85D, 0,0xD853,0xD852,0xB3C9, 0, +0xB3CA,0xB3C6,0xB3CB,0xD851,0xD85C,0xD85A,0xD854, 0, + 0, 0,0xB3C3,0xD856, 0, 0, 0, 0, + 0, 0, 0, 0,0xB6CA,0xB6C4,0xDCB7,0xB6CD, +0xDCBD,0xDCC0,0xB6C6,0xB6C7,0xDCBA,0xB6C5,0xDCC3,0xB6CB, +0xDCC4, 0,0xDCBF,0xB6CC, 0,0xDCB4,0xB6C9,0xDCB5, + 0,0xDCBE,0xDCBC, 0,0xDCB8,0xB6C8,0xDCB6,0xB6CE, +0xDCBB,0xDCC2,0xDCB9,0xDCC1, 0, 0,0xB9B6,0xB9B3, + 0,0xB9B4, 0,0xE0F9,0xE0F1,0xB9B2,0xB9AF,0xE0F2, + 0, 0,0xB9B1,0xE0F5, 0,0xE0F7, 0, 0, +0xE0FE, 0, 0,0xE0FD,0xE0F8,0xB9AE,0xE0F0,0xB9AC, +0xE0F3,0xB9B7,0xE0F6, 0,0xE0FA,0xB9B0,0xB9AD,0xE0FC, +0xE0FB,0xB9B5, 0,0xE0F4, 0,0xBBF8,0xE4EC, 0, +0xE4E9,0xBBF9, 0,0xBBF7, 0,0xE4F0,0xE4ED,0xE4E6, +0xBBF6, 0,0xBBFA,0xE4E7,0xBBF5,0xBBFD,0xE4EA,0xE4EB, +0xBBFB,0xBBFC,0xE4F1,0xE4EE,0xE4EF, 0, 0, 0, +0xBEAA,0xE8F8,0xBEA7,0xE8F5,0xBEA9,0xBEAB, 0,0xE8F6, +0xBEA8, 0,0xE8F7, 0,0xE8F4, 0, 0,0xC076, +0xECBD,0xC077,0xECBB, 0,0xECBC,0xECBA,0xECB9, 0, + 0,0xECBE,0xC075, 0, 0,0xEFB8,0xEFB9, 0, +0xE4E8,0xEFB7,0xC078,0xC35F,0xF1EB,0xF1EC, 0,0xC4D7, +0xC4D8,0xF5C1,0xF5C0,0xC56C,0xC56B,0xF7D0, 0,0xA449, +0xA461,0xA4B9, 0,0xA4B8,0xA553,0xA552,0xA5FC,0xA5FB, +0xA5FD,0xA5FA, 0,0xA74A,0xA749,0xA74B, 0, 0, + 0, 0,0xA8E0, 0,0xA8DF,0xA8E1, 0,0xAB5E, + 0,0xA259,0xD0DE,0xA25A,0xB0C2,0xA25C,0xA25B,0xD860, + 0,0xA25D,0xB9B8,0xA25E, 0,0xA44A, 0,0xA4BA, +0xA5FE,0xA8E2, 0,0xA44B,0xA4BD,0xA4BB,0xA4BC, 0, + 0,0xA640, 0, 0, 0,0xA74C,0xA8E4,0xA8E3, +0xA8E5, 0, 0, 0,0xADDD, 0, 0, 0, +0xBEAC, 0, 0, 0, 0, 0, 0,0xC94E, + 0,0xA554,0xA555, 0, 0,0xA641, 0,0xCA6A, + 0,0xAB60,0xAB5F,0xD0E0,0xD0DF,0xB0C3, 0,0xA4BE, +0xC955, 0, 0, 0, 0, 0,0xCBCD, 0, +0xAB61, 0,0xADE0, 0,0xADDE,0xADDF, 0, 0, + 0, 0,0xBEAD, 0,0xA556, 0, 0, 0, +0xA642,0xC9BC, 0, 0, 0, 0,0xA74D,0xA74E, + 0,0xCA6B, 0, 0,0xCBCE,0xA8E6,0xCBCF, 0, + 0, 0, 0, 0,0xD0E2,0xD0E3,0xADE3, 0, +0xD0E4, 0,0xD0E1,0xADE4,0xADE2,0xADE1,0xD0E5, 0, +0xD468, 0, 0, 0,0xD861, 0, 0,0xDCC5, +0xE140, 0, 0, 0,0xBBFE,0xBEAE,0xE8F9, 0, +0xA44C,0xA45A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB0C4,0xB3CD, 0,0xB9B9, 0,0xC942,0xA4BF, 0, +0xA559,0xA557,0xA558, 0, 0,0xA8E7, 0, 0, +0xA44D,0xA44E, 0,0xA462, 0, 0,0xA4C0,0xA4C1, +0xA4C2,0xC9BE,0xA55A, 0,0xC96B, 0,0xA646, 0, +0xC9BF,0xA644,0xA645,0xC9BD, 0, 0,0xA647,0xA643, + 0, 0, 0, 0,0xCA6C,0xAAEC,0xCA6D, 0, + 0,0xCA6E, 0, 0,0xA750,0xA74F, 0, 0, +0xA753,0xA751,0xA752, 0, 0, 0,0xA8ED, 0, +0xA8EC,0xCBD4,0xCBD1,0xCBD2, 0,0xCBD0,0xA8EE,0xA8EA, +0xA8E9, 0,0xA8EB,0xA8E8, 0, 0, 0, 0, + 0,0xA8EF, 0,0xAB63,0xCDF0, 0,0xCBD3,0xAB68, + 0,0xCDF1,0xAB64,0xAB67,0xAB66,0xAB65,0xAB62, 0, + 0, 0,0xD0E8, 0,0xADE7,0xD0EB,0xADE5, 0, + 0, 0,0xD0E7,0xADE8,0xADE6,0xADE9,0xD0E9,0xD0EA, + 0,0xD0E6,0xD0EC, 0, 0, 0, 0, 0, + 0,0xB3D1,0xB0C5,0xD469,0xD46B,0xD46A,0xD46C,0xB0C6, + 0, 0,0xB3CE, 0,0xB3CF,0xB3D0, 0,0xB6D0, +0xDCC7, 0,0xDCC6,0xDCC8,0xDCC9,0xB6D1, 0,0xB6CF, +0xE141,0xE142,0xB9BB,0xB9BA,0xE35A, 0, 0,0xBC40, +0xBC41,0xBC42,0xBC44,0xE4F2,0xE4F3,0xBC43, 0, 0, + 0,0xBEAF, 0,0xBEB0, 0, 0,0xF1ED,0xF5C3, +0xF5C2,0xF7D1, 0,0xA44F, 0, 0, 0,0xA55C, +0xA55B, 0, 0,0xA648, 0, 0,0xC9C0, 0, + 0,0xA755,0xA756,0xA754,0xA757,0xCA6F,0xCA70, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA8F1,0xCBD5, 0,0xA8F0, 0, +0xCDF2,0xAB6C,0xCDF3,0xAB6B, 0, 0, 0,0xAB69, + 0,0xAB6A, 0, 0, 0,0xD0ED, 0, 0, + 0, 0,0xB0C7,0xD46E, 0,0xB0CA,0xD46D,0xB1E5, +0xB0C9,0xB0C8, 0,0xB3D4, 0,0xB3D3,0xB3D2,0xB6D2, + 0, 0,0xB6D5,0xB6D6,0xB6D4, 0,0xB6D3, 0, + 0,0xE143, 0,0xE144, 0, 0, 0,0xE4F5, +0xBC45,0xE4F4, 0,0xBEB1,0xECBF,0xC079, 0,0xF1EE, +0xC455, 0,0xA463,0xA4C3,0xC956, 0,0xA4C4,0xA4C5, + 0, 0, 0, 0, 0,0xA55D,0xA55E, 0, +0xA649,0xCA71,0xCBD6,0xCBD7, 0,0xAB6D,0xD0EE,0xB0CC, +0xB0CB,0xD863,0xD862, 0, 0,0xA450,0xA4C6,0xA55F, + 0,0xB0CD,0xC943, 0,0xC96C,0xA560, 0,0xC9C2, +0xA64B,0xA64A,0xC9C1,0xA758, 0, 0, 0, 0, + 0, 0,0xADEA, 0, 0,0xD46F, 0,0xB6D7, +0xE145,0xB9BC, 0, 0,0xE8FA, 0, 0,0xF3FD, + 0,0xA4C7, 0, 0,0xCBD8,0xCDF4,0xB0D0,0xB0CE, +0xB0CF,0xA451, 0,0xA464,0xA2CD,0xA4CA, 0,0xA4C9, +0xA4C8,0xA563,0xA562, 0,0xC96D,0xC9C3, 0, 0, + 0,0xA8F5,0xA8F2,0xA8F4,0xA8F3, 0, 0,0xAB6E, + 0, 0,0xB3D5, 0,0xA452, 0,0xA4CB, 0, +0xA565,0xA564, 0,0xCA72, 0, 0,0xA8F6, 0, + 0, 0, 0, 0,0xC957, 0,0xA567,0xA566, +0xA64C,0xA64D,0xCA73,0xA759, 0,0xA75A, 0,0xA8F7, +0xA8F8,0xA8F9, 0,0xAB6F,0xCDF5, 0, 0,0xADEB, + 0, 0,0xC944, 0,0xA4CC, 0, 0, 0, + 0, 0,0xC9C4, 0, 0, 0,0xCA74,0xCA75, + 0, 0,0xCBD9, 0,0xCBDA, 0,0xCDF7,0xCDF6, +0xCDF9,0xCDF8,0xAB70, 0,0xD470,0xADED,0xD0EF,0xADEC, + 0, 0, 0, 0,0xD864,0xB3D6, 0,0xD865, + 0, 0, 0, 0,0xE146,0xB9BD, 0, 0, + 0, 0,0xBC46, 0,0xF1EF, 0, 0, 0, + 0,0xC958, 0,0xA568, 0, 0, 0, 0, + 0, 0, 0,0xB0D1, 0, 0, 0, 0, +0xA453,0xA465,0xA4CE,0xA4CD, 0,0xA4CF, 0, 0, + 0, 0, 0, 0,0xA8FB, 0,0xA8FA,0xA8FC, + 0, 0, 0,0xAB71, 0, 0, 0,0xADEE, + 0,0xE8FB,0xC24F,0xA466,0xA56A,0xA579,0xA574, 0, +0xA56F,0xA56E,0xA575,0xA573,0xA56C,0xA57A,0xA56D,0xA569, +0xA578,0xA577,0xA576,0xA56B, 0,0xA572, 0, 0, +0xA571, 0, 0,0xA57B,0xA570, 0, 0, 0, + 0,0xA653, 0,0xA659,0xA655, 0,0xA65B,0xC9C5, +0xA658,0xA64E,0xA651,0xA654,0xA650,0xA657,0xA65A,0xA64F, +0xA652,0xA656,0xA65C, 0, 0, 0, 0, 0, +0xCA7E,0xCA7B, 0,0xA767,0xCA7C,0xA75B,0xA75D,0xA775, +0xA770, 0, 0, 0,0xCAA5,0xCA7D,0xA75F,0xA761, +0xCAA4,0xA768,0xCA78,0xA774,0xA776,0xA75C,0xA76D, 0, +0xCA76,0xA773, 0,0xA764, 0,0xA76E,0xA76F,0xCA77, +0xA76C,0xA76A, 0,0xA76B,0xA771,0xCAA1,0xA75E, 0, +0xA772,0xCAA3,0xA766,0xA763, 0,0xCA7A,0xA762,0xCAA6, +0xA765, 0,0xA769, 0, 0, 0,0xA760,0xCAA2, + 0, 0, 0, 0,0xCA79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCBEB,0xCBEA,0xA94F,0xCBED,0xCBEF,0xCBE4,0xCBE7,0xCBEE, +0xA950, 0, 0,0xCBE1,0xCBE5, 0, 0,0xCBE9, +0xCE49,0xA94B,0xCE4D,0xA8FD,0xCBE6,0xA8FE,0xA94C,0xA945, +0xA941, 0,0xCBE2,0xA944,0xA949,0xA952,0xCBE3,0xCBDC, +0xA943,0xCBDD,0xCBDF, 0,0xA946, 0,0xA948,0xCBDB, +0xCBE0, 0, 0,0xA951,0xA94D,0xCBE8,0xA953, 0, +0xA94A,0xCBDE,0xA947, 0, 0,0xA942,0xA940, 0, +0xCBEC, 0,0xA94E, 0, 0, 0, 0, 0, +0xCE48,0xCDFB,0xCE4B, 0, 0,0xCDFD,0xAB78,0xABA8, +0xAB74,0xABA7,0xAB7D,0xABA4,0xAB72,0xCDFC,0xCE43,0xABA3, +0xCE4F,0xABA5, 0,0xAB79, 0, 0,0xCE45,0xCE42, +0xAB77, 0,0xCDFA,0xABA6,0xCE4A,0xAB7C,0xCE4C,0xABA9, +0xAB73,0xAB7E,0xAB7B,0xCE40,0xABA1,0xCE46,0xCE47,0xAB7A, +0xABA2,0xAB76, 0, 0, 0, 0,0xAB75,0xCDFE, + 0, 0, 0, 0, 0, 0,0xCE44, 0, + 0, 0, 0, 0, 0, 0,0xCE4E, 0, +0xD144,0xADFB,0xD0F1, 0,0xD0F6,0xADF4,0xAE40,0xD0F4, +0xADEF,0xADF9,0xADFE,0xD0FB, 0,0xADFA,0xADFD, 0, + 0,0xD0FE,0xADF5,0xD0F5, 0, 0, 0,0xD142, +0xD143, 0,0xADF7,0xD141,0xADF3,0xAE43, 0,0xD0F8, + 0,0xADF1, 0,0xD146,0xD0F9,0xD0FD,0xADF6,0xAE42, +0xD0FA,0xADFC,0xD140,0xD147,0xD4A1, 0,0xD145,0xAE44, +0xADF0,0xD0FC,0xD0F3, 0,0xADF8, 0, 0,0xD0F2, + 0, 0,0xD0F7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD0F0,0xAE41, + 0, 0,0xD477, 0,0xB0E4,0xD4A7,0xB0E2,0xB0DF, +0xD47C,0xB0DB,0xD4A2,0xB0E6,0xD476,0xD47B,0xD47A,0xADF2, +0xB0E1,0xD4A5, 0,0xD4A8,0xD473, 0,0xB3E8, 0, +0xD4A9,0xB0E7, 0,0xB0D9,0xB0D6,0xD47E,0xB0D3, 0, +0xD4A6, 0,0xB0DA,0xD4AA, 0,0xD474,0xD4A4,0xB0DD, +0xD475,0xD478,0xD47D, 0, 0,0xB0DE,0xB0DC,0xB0E8, + 0, 0, 0, 0,0xB0E3, 0,0xB0D7,0xB1D2, + 0,0xB0D8,0xD479,0xB0E5,0xB0E0,0xD4A3,0xB0D5, 0, + 0, 0,0xB0D4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD471,0xD472,0xD86A, + 0, 0, 0,0xB3D7,0xB3DA,0xD875,0xB3EE,0xD878, +0xB3D8,0xD871,0xB3DE,0xB3E4,0xB5BD, 0, 0,0xB3E2, +0xD86E,0xB3EF,0xB3DB,0xB3E3,0xD876,0xDCD7,0xD87B,0xD86F, + 0,0xD866,0xD873,0xD86D,0xB3E1,0xD879, 0, 0, +0xB3DD,0xB3F1,0xB3EA, 0,0xB3DF,0xB3DC, 0,0xB3E7, + 0,0xD87A,0xD86C,0xD872,0xD874,0xD868,0xD877,0xB3D9, +0xD867, 0,0xB3E0,0xB3F0,0xB3EC,0xD869,0xB3E6, 0, + 0,0xB3ED,0xB3E9,0xB3E5, 0,0xD870, 0, 0, + 0, 0, 0,0xB3EB, 0, 0, 0,0xDCD5, +0xDCD1, 0,0xDCE0,0xDCCA,0xDCD3,0xB6E5,0xB6E6,0xB6DE, +0xDCDC,0xB6E8,0xDCCF,0xDCCE,0xDCCC,0xDCDE,0xB6DC,0xDCD8, +0xDCCD,0xB6DF,0xDCD6,0xB6DA,0xDCD2,0xDCD9,0xDCDB, 0, + 0,0xDCDF,0xB6E3,0xDCCB,0xB6DD,0xDCD0, 0,0xB6D8, + 0,0xB6E4,0xDCDA,0xB6E0,0xB6E1,0xB6E7,0xB6DB,0xA25F, +0xB6D9,0xDCD4, 0, 0, 0, 0, 0,0xB6E2, + 0, 0,0xDCDD, 0, 0, 0,0xB9CD,0xB9C8, + 0,0xE155,0xE151, 0,0xE14B,0xB9C2,0xB9BE,0xE154, +0xB9BF,0xE14E,0xE150, 0,0xE153, 0,0xB9C4, 0, +0xB9CB,0xB9C5, 0, 0,0xE149,0xB9C6,0xB9C7,0xE14C, +0xB9CC, 0,0xE14A,0xE14F,0xB9C3,0xE148,0xB9C9,0xB9C1, + 0, 0, 0,0xB9C0,0xE14D,0xE152, 0,0xB9CA, + 0, 0, 0, 0, 0, 0, 0,0xE147, + 0,0xBC4D,0xE547, 0,0xE544, 0,0xBC47,0xBC53, +0xBC54, 0,0xBC4A,0xE542,0xBC4C,0xE4F9,0xBC52, 0, +0xE546,0xBC49,0xE548,0xBC48, 0,0xE543,0xE545,0xBC4B, +0xE541,0xE4FA,0xE4F7, 0, 0,0xD86B,0xE4FD, 0, +0xE4F6,0xE4FC,0xE4FB, 0,0xE4F8, 0,0xBC4F, 0, + 0, 0, 0,0xBC4E, 0, 0, 0,0xBC50, +0xE4FE,0xBEB2,0xE540, 0, 0, 0,0xE945, 0, +0xE8FD, 0,0xBEBE,0xE942,0xBEB6,0xBEBA,0xE941, 0, +0xBEB9,0xBEB5,0xBEB8,0xBEB3,0xBEBD,0xE943,0xE8FE,0xBEBC, +0xE8FC,0xBEBB,0xE944,0xE940,0xBC51, 0,0xBEBF,0xE946, +0xBEB7,0xBEB4, 0, 0, 0, 0,0xECC6,0xECC8, +0xC07B,0xECC9,0xECC7,0xECC5,0xECC4,0xC07D,0xECC3,0xC07E, + 0, 0, 0, 0,0xECC1,0xECC2,0xC07A,0xC0A1, +0xC07C, 0, 0,0xECC0, 0,0xC250, 0,0xEFBC, +0xEFBA,0xEFBF,0xEFBD, 0,0xEFBB,0xEFBE, 0, 0, + 0, 0, 0, 0, 0,0xC360,0xF1F2,0xF1F3, +0xC456, 0,0xF1F4,0xF1F0,0xF1F5,0xF1F1,0xC251, 0, + 0, 0,0xF3FE,0xF441,0xC459,0xF440,0xC458,0xC457, + 0, 0, 0, 0,0xC45A,0xF5C5,0xF5C6, 0, +0xC4DA,0xC4D9,0xC4DB,0xF5C4, 0,0xF6D8,0xF6D7, 0, +0xC56D,0xC56F,0xC56E,0xF6D9,0xC5C8,0xF8A6, 0, 0, + 0,0xC5F1, 0,0xF8A5,0xF8EE, 0, 0,0xC949, + 0, 0,0xA57D,0xA57C, 0,0xA65F,0xA65E,0xC9C7, +0xA65D,0xC9C6, 0, 0,0xA779,0xCAA9, 0,0xCAA8, + 0, 0,0xA777,0xA77A, 0, 0,0xCAA7, 0, +0xA778, 0, 0, 0, 0, 0, 0,0xCBF0, + 0,0xCBF1,0xA954, 0, 0, 0, 0,0xABAA, + 0,0xD148,0xD149,0xAE45,0xAE46, 0, 0,0xD4AC, +0xB0E9,0xB0EB,0xD4AB,0xB0EA,0xD87C,0xB3F2, 0, 0, + 0, 0,0xB6E9,0xB6EA,0xDCE1, 0,0xB9CF, 0, +0xB9CE, 0,0xE549,0xE948,0xE947, 0,0xF96B,0xA467, +0xC959, 0,0xC96E,0xC96F, 0, 0, 0, 0, +0xA662,0xA666,0xC9C9, 0,0xA664,0xA663,0xC9C8,0xA665, +0xA661, 0, 0,0xA660,0xC9CA, 0, 0, 0, + 0, 0, 0,0xA7A6, 0, 0,0xA7A3, 0, +0xA77D,0xCAAA, 0, 0, 0,0xCAAB, 0,0xA7A1, + 0,0xCAAD,0xA77B,0xCAAE,0xCAAC,0xA77E,0xA7A2,0xA7A5, +0xA7A4,0xA77C,0xCAAF, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA959,0xCBFE, 0,0xA95B, 0,0xA95A, 0, +0xCC40,0xA958,0xA957,0xCBF5, 0,0xCBF4, 0,0xCBF2, +0xCBF7,0xCBF6,0xCBF3,0xCBFC,0xCBFD,0xCBFA,0xCBF8,0xA956, + 0, 0, 0,0xCBFB,0xA95C,0xCC41, 0, 0, +0xCBF9, 0,0xABAB,0xA955, 0, 0, 0, 0, + 0, 0, 0,0xABAC,0xCE54, 0, 0,0xCE5A, + 0, 0, 0,0xABB2,0xCE58,0xCE5E, 0,0xCE55, +0xCE59,0xCE5B,0xCE5D,0xCE57, 0,0xCE56,0xCE51,0xCE52, +0xABAD, 0,0xABAF,0xABAE,0xCE53,0xCE5C, 0, 0, + 0, 0, 0, 0, 0, 0,0xABB1, 0, + 0, 0, 0, 0, 0,0xCE50,0xD153, 0, +0xD152,0xD157,0xD14E, 0,0xD151,0xD150, 0,0xD154, + 0,0xD158,0xAE47,0xAE4A, 0, 0,0xD14F,0xD155, + 0, 0, 0,0xAE49,0xD14A, 0,0xABB0,0xD4BA, +0xD156, 0,0xD14D, 0,0xAE48,0xD14C, 0, 0, + 0, 0, 0, 0,0xD4B1, 0, 0,0xB0EC, +0xB0F0,0xD4C1,0xD4AF,0xD4BD,0xB0F1,0xD4BF, 0,0xD4C5, + 0,0xD4C9, 0, 0,0xD4C0,0xD4B4,0xD4BC, 0, +0xD4CA,0xD4C8,0xD4BE,0xD4B9,0xD4B2,0xD8A6,0xD4B0,0xB0F5, +0xD4B7,0xB0F6,0xB0F2,0xD4AD,0xD4C3,0xD4B5, 0, 0, +0xD4B3,0xD4C6,0xB0F3, 0,0xD4CC,0xB0ED,0xB0EF,0xD4BB, +0xD4B6,0xAE4B,0xB0EE,0xD4B8,0xD4C7,0xD4CB,0xD4C2, 0, +0xD4C4, 0, 0, 0,0xD4AE, 0, 0, 0, + 0,0xD8A1, 0,0xD8AA,0xD8A9,0xB3FA,0xD8A2, 0, +0xB3FB,0xB3F9, 0,0xD8A4,0xB3F6,0xD8A8, 0,0xD8A3, +0xD8A5,0xD87D,0xB3F4, 0,0xD8B2,0xD8B1,0xD8AE,0xB3F3, +0xB3F7,0xB3F8,0xD14B,0xD8AB,0xB3F5,0xB0F4,0xD8AD,0xD87E, +0xD8B0,0xD8AF, 0,0xD8B3, 0,0xDCEF, 0,0xD8AC, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD8A7,0xDCE7,0xB6F4,0xB6F7,0xB6F2,0xDCE6,0xDCEA,0xDCE5, + 0,0xB6EC,0xB6F6,0xDCE2,0xB6F0,0xDCE9, 0,0xB6EE, +0xB6ED,0xDCEC,0xB6EF,0xDCEE, 0,0xDCEB,0xB6EB, 0, + 0, 0,0xB6F5,0xDCF0,0xDCE4,0xDCED, 0, 0, +0xDCE3, 0, 0,0xB6F1, 0,0xB6F3, 0,0xDCE8, + 0,0xDCF1, 0, 0,0xE15D,0xB9D0,0xE163, 0, + 0,0xB9D5,0xE15F,0xE166,0xE157,0xB9D7,0xB9D1,0xE15C, +0xBC55,0xE15B,0xE164,0xB9D2, 0,0xB9D6,0xE15A,0xE160, +0xE165,0xE156,0xB9D4,0xE15E, 0, 0,0xE162,0xE168, +0xE158,0xE161, 0,0xB9D3,0xE167, 0, 0, 0, +0xE159, 0, 0, 0,0xBC59,0xE54B,0xBC57,0xBC56, +0xE54D,0xE552, 0,0xE54E, 0,0xE551,0xBC5C, 0, +0xBEA5,0xBC5B, 0,0xE54A,0xE550, 0,0xBC5A,0xE54F, + 0,0xE54C, 0,0xBC58, 0, 0, 0, 0, + 0, 0,0xE94D,0xF9D9,0xE94F,0xE94A,0xBEC1,0xE94C, + 0,0xBEC0,0xE94E, 0, 0,0xBEC3,0xE950,0xBEC2, +0xE949,0xE94B, 0, 0, 0, 0,0xC0A5,0xECCC, + 0,0xC0A4,0xECCD,0xC0A3,0xECCB,0xC0A2,0xECCA, 0, +0xC253,0xC252,0xF1F6,0xF1F8, 0,0xF1F7,0xC361,0xC362, + 0, 0,0xC363,0xF442,0xC45B, 0, 0,0xF7D3, +0xF7D2,0xC5F2, 0,0xA468,0xA4D0, 0, 0,0xA7A7, + 0, 0, 0, 0,0xCE5F, 0, 0, 0, + 0,0xB3FC,0xB3FD, 0,0xDCF2,0xB9D8,0xE169,0xE553, + 0, 0, 0,0xC95A, 0, 0,0xCAB0, 0, + 0, 0, 0, 0,0xCC42,0xCE60,0xD159,0xAE4C, + 0, 0,0xF1F9, 0,0xC4DC,0xA469,0xA57E,0xC970, + 0,0xA667,0xA668, 0,0xA95D, 0, 0, 0, +0xB0F7, 0,0xB9DA, 0,0xB9DB,0xB9D9, 0,0xA46A, + 0,0xA4D1,0xA4D3,0xA4D2,0xC95B,0xA4D4,0xA5A1,0xC971, + 0,0xA5A2, 0, 0, 0, 0, 0,0xA669, +0xA66A, 0, 0, 0,0xC9CB, 0,0xA7A8, 0, +0xCAB1, 0, 0, 0,0xA961,0xCC43, 0,0xA95F, +0xA960,0xA95E,0xD15A, 0, 0, 0,0xABB6,0xABB5, +0xABB7,0xABB4, 0,0xCE61,0xA962,0xABB3, 0,0xAE4D, +0xAE4E, 0,0xAE4F, 0,0xD4CD, 0, 0, 0, +0xB3FE,0xD8B4,0xB0F8, 0, 0, 0, 0,0xB6F8, + 0,0xB9DD,0xB9DC,0xE16A, 0,0xBC5D,0xBEC4, 0, +0xEFC0,0xF6DA,0xF7D4,0xA46B,0xA5A3, 0,0xA5A4,0xC9D1, +0xA66C,0xA66F, 0,0xC9CF,0xC9CD,0xA66E,0xC9D0,0xC9D2, +0xC9CC,0xA671,0xA670,0xA66D,0xA66B,0xC9CE, 0, 0, + 0, 0,0xA7B3, 0, 0,0xA7B0,0xCAB6,0xCAB9, +0xCAB8, 0,0xA7AA,0xA7B2, 0, 0,0xA7AF,0xCAB5, +0xCAB3,0xA7AE, 0, 0, 0,0xA7A9,0xA7AC, 0, +0xCAB4,0xCABB,0xCAB7,0xA7AD,0xA7B1,0xA7B4,0xCAB2,0xCABA, +0xA7AB, 0, 0, 0, 0, 0,0xA967,0xA96F, + 0,0xCC4F,0xCC48,0xA970,0xCC53,0xCC44,0xCC4B, 0, + 0,0xA966,0xCC45,0xA964,0xCC4C,0xCC50,0xA963, 0, +0xCC51,0xCC4A, 0,0xCC4D, 0,0xA972,0xA969,0xCC54, +0xCC52, 0,0xA96E,0xA96C,0xCC49,0xA96B,0xCC47,0xCC46, +0xA96A,0xA968,0xA971,0xA96D,0xA965, 0,0xCC4E, 0, +0xABB9, 0,0xABC0,0xCE6F,0xABB8,0xCE67,0xCE63, 0, +0xCE73,0xCE62, 0,0xABBB,0xCE6C,0xABBE,0xABC1, 0, +0xABBC,0xCE70,0xABBF, 0,0xAE56,0xCE76,0xCE64, 0, + 0,0xCE66,0xCE6D,0xCE71,0xCE75,0xCE72,0xCE6B,0xCE6E, + 0, 0,0xCE68,0xABC3,0xCE6A,0xCE69,0xCE74,0xABBA, +0xCE65,0xABC2, 0,0xABBD, 0, 0, 0, 0, + 0,0xAE5C,0xD162, 0,0xAE5B, 0, 0,0xD160, + 0,0xAE50, 0,0xAE55, 0,0xD15F,0xD15C,0xD161, +0xAE51,0xD15B, 0,0xAE54,0xAE52, 0,0xD163,0xAE53, +0xAE57, 0, 0,0xAE58, 0,0xAE5A, 0, 0, + 0,0xAE59, 0, 0, 0,0xD15D,0xD15E, 0, + 0, 0, 0,0xD164, 0,0xD4D4,0xB0F9,0xD8C2, +0xD4D3,0xD4E6, 0, 0,0xB140, 0,0xD4E4, 0, +0xB0FE,0xB0FA,0xD4ED,0xD4DD,0xD4E0, 0,0xB143,0xD4EA, +0xD4E2,0xB0FB,0xB144, 0,0xD4E7,0xD4E5, 0, 0, +0xD4D6,0xD4EB,0xD4DF,0xD4DA, 0,0xD4D0,0xD4EC,0xD4DC, +0xD4CF, 0,0xB142,0xD4E1,0xD4EE,0xD4DE,0xD4D2,0xD4D7, +0xD4CE, 0,0xB141, 0,0xD4DB,0xD4D8,0xB0FC,0xD4D1, + 0,0xD4E9,0xB0FD, 0,0xD4D9,0xD4D5, 0, 0, +0xD4E8, 0, 0, 0, 0, 0, 0,0xB440, +0xD8BB, 0,0xD8B8,0xD8C9,0xD8BD,0xD8CA, 0,0xB442, + 0, 0, 0,0xD8C6,0xD8C3, 0, 0, 0, + 0, 0,0xD8C4,0xD8C7,0xD8CB, 0,0xD4E3,0xD8CD, +0xDD47, 0,0xB443,0xD8CE,0xD8B6,0xD8C0, 0,0xD8C5, + 0, 0,0xB441,0xB444,0xD8CC,0xD8CF,0xD8BA,0xD8B7, + 0, 0,0xD8B9, 0, 0,0xD8BE,0xD8BC,0xB445, + 0,0xD8C8, 0, 0,0xD8BF, 0,0xD8C1,0xD8B5, +0xDCFA,0xDCF8,0xB742,0xB740,0xDD43,0xDCF9,0xDD44,0xDD40, +0xDCF7,0xDD46,0xDCF6,0xDCFD,0xB6FE,0xB6FD,0xB6FC,0xDCFB, +0xDD41,0xB6F9,0xB741, 0,0xDCF4, 0,0xDCFE,0xDCF3, +0xDCFC,0xB6FA,0xDD42,0xDCF5,0xB6FB,0xDD45, 0, 0, + 0, 0, 0, 0, 0,0xE16E,0xB9E2,0xB9E1, +0xB9E3,0xE17A,0xE170,0xE176,0xE16B,0xE179,0xE178,0xE17C, +0xE175,0xB9DE,0xE174,0xB9E4, 0,0xE16D,0xB9DF, 0, +0xE17B,0xB9E0,0xE16F,0xE172,0xE177,0xE171,0xE16C, 0, + 0, 0, 0,0xE173,0xE555,0xBC61,0xE558,0xE557, +0xE55A,0xE55C,0xF9DC,0xBC5F, 0,0xE556, 0,0xE554, + 0,0xE55D,0xE55B,0xE559, 0,0xE55F, 0,0xE55E, +0xBC63,0xBC5E, 0,0xBC60,0xBC62, 0, 0,0xE560, +0xE957, 0, 0,0xE956,0xE955, 0,0xE958,0xE951, + 0,0xE952,0xE95A,0xE953, 0,0xBEC5,0xE95C, 0, +0xE95B,0xE954, 0,0xECD1,0xC0A8,0xECCF,0xECD4,0xECD3, +0xE959, 0,0xC0A7, 0,0xECD2,0xECCE,0xECD6,0xECD5, +0xC0A6, 0,0xECD0, 0,0xBEC6, 0, 0, 0, +0xC254, 0, 0, 0,0xEFC1,0xF1FA,0xF1FB,0xF1FC, +0xC45C, 0, 0,0xC45D, 0,0xF443, 0,0xF5C8, +0xF5C7, 0, 0,0xF6DB,0xF6DC,0xF7D5,0xF8A7, 0, +0xA46C,0xA46D, 0,0xA46E,0xA4D5,0xA5A5,0xC9D3,0xA672, +0xA673, 0,0xA7B7,0xA7B8,0xA7B6,0xA7B5, 0,0xA973, + 0, 0,0xCC55,0xA975,0xA974,0xCC56, 0, 0, + 0,0xABC4, 0,0xAE5D,0xD165, 0,0xD4F0, 0, +0xB145,0xB447,0xD4EF,0xB446, 0,0xB9E5, 0,0xE17D, +0xBEC7, 0,0xC0A9,0xECD7, 0,0xC45E, 0,0xC570, + 0,0xC972, 0,0xA5A6,0xC973,0xA676, 0,0xA674, +0xA675,0xA677, 0,0xA7BA,0xA7B9, 0,0xCABC,0xA7BB, + 0, 0,0xCABD,0xCC57, 0,0xCC58, 0,0xA976, +0xA978,0xA97A,0xA977,0xA97B,0xA979, 0, 0, 0, + 0, 0,0xABC8,0xABC5,0xABC7,0xABC9,0xABC6,0xD166, +0xCE77, 0, 0, 0,0xD168,0xD167,0xAE63, 0, +0xAE5F, 0, 0,0xAE60,0xAE62,0xAE64,0xAE61, 0, +0xAE66,0xAE65, 0, 0, 0, 0, 0,0xB14A, +0xD4F2,0xD4F1,0xB149, 0,0xB148,0xB147,0xB14B,0xB146, + 0, 0,0xD8D5,0xD8D2,0xB449,0xD8D1,0xD8D6, 0, +0xB44B,0xD8D4,0xB448,0xB44A,0xD8D3, 0,0xDD48, 0, +0xDD49,0xDD4A, 0, 0, 0, 0,0xB9E6,0xB9EE, +0xE17E,0xB9E8,0xB9EC,0xE1A1,0xB9ED,0xB9E9,0xB9EA,0xB9E7, +0xB9EB,0xBC66,0xD8D0,0xBC67,0xBC65, 0,0xBC64,0xE95D, +0xBEC8,0xECD8,0xECD9, 0, 0,0xC364,0xC45F, 0, +0xA46F, 0,0xA678, 0, 0, 0, 0, 0, + 0,0xABCA, 0,0xD169,0xAE67, 0, 0,0xB14E, +0xB14D,0xB14C,0xB44C,0xB44D,0xD8D7,0xB9EF,0xBEC9,0xA470, +0xC95C,0xA4D6,0xC974, 0, 0,0xC9D4,0xA679, 0, + 0, 0,0xA97C, 0, 0, 0, 0,0xDD4B, + 0, 0,0xA471, 0,0xA4D7,0xC9D5, 0, 0, +0xCABE, 0,0xCABF, 0,0xA7BC, 0, 0, 0, +0xD8D8,0xB44E, 0,0xDD4C, 0, 0, 0,0xC0AA, +0xA472,0xA4A8,0xA4D8,0xC975,0xA5A7, 0,0xA7C0,0xA7BF, +0xA7BD,0xA7BE, 0, 0,0xCC59,0xA97E,0xA9A1,0xCC5A, +0xA97D, 0, 0,0xABCE,0xCE78,0xABCD,0xABCB,0xABCC, +0xAE6A,0xAE68, 0, 0,0xD16B,0xAE69,0xD16A, 0, +0xAE5E,0xD4F3, 0, 0,0xB150,0xB151, 0, 0, +0xB14F, 0,0xB9F0,0xE1A2,0xBC68,0xBC69, 0,0xE561, +0xC0AB,0xEFC2,0xEFC3, 0,0xC4DD,0xF8A8,0xC94B,0xA4D9, + 0,0xA473, 0,0xC977,0xC976, 0, 0, 0, + 0,0xA67A,0xC9D7,0xC9D8,0xC9D6, 0,0xC9D9, 0, + 0, 0, 0, 0, 0, 0,0xCAC7, 0, +0xCAC2,0xCAC4,0xCAC6,0xCAC3,0xA7C4,0xCAC0, 0,0xCAC1, +0xA7C1,0xA7C2,0xCAC5,0xCAC8,0xA7C3,0xCAC9, 0, 0, + 0, 0, 0, 0, 0,0xCC68, 0,0xCC62, +0xCC5D,0xA9A3,0xCC65,0xCC63,0xCC5C,0xCC69,0xCC6C,0xCC67, +0xCC60,0xA9A5,0xCC66,0xA9A6,0xCC61,0xCC64,0xCC5B,0xCC5F, +0xCC6B,0xA9A7, 0,0xA9A8, 0,0xCC5E,0xCC6A,0xA9A2, +0xA9A4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCEAB,0xCEA4, +0xCEAA,0xCEA3,0xCEA5,0xCE7D,0xCE7B, 0,0xCEAC,0xCEA9, +0xCE79, 0,0xABD0,0xCEA7,0xCEA8, 0,0xCEA6,0xCE7C, +0xCE7A,0xABCF,0xCEA2,0xCE7E, 0, 0,0xCEA1,0xCEAD, + 0, 0, 0, 0, 0, 0, 0, 0, +0xAE6F, 0,0xAE6E, 0,0xD16C,0xAE6B,0xD16E, 0, +0xAE70,0xD16F, 0, 0,0xAE73, 0,0xAE71,0xD170, +0xCEAE,0xD172, 0,0xAE6D, 0,0xAE6C, 0,0xD16D, +0xD171,0xAE72, 0, 0, 0, 0,0xB153,0xB152, + 0, 0, 0,0xD4F5,0xD4F9,0xD4FB,0xB154,0xD4FE, + 0,0xB158,0xD541, 0,0xB15A, 0,0xB156,0xB15E, + 0,0xB15B,0xD4F7,0xB155, 0,0xD4F6,0xD4F4,0xD543, +0xD4F8, 0,0xB157,0xD542,0xB15C,0xD4FD,0xD4FC,0xB15D, +0xD4FA,0xB159, 0, 0, 0, 0,0xD544, 0, +0xD540,0xD8E7,0xD8EE,0xD8E3,0xB451,0xD8DF,0xD8EF,0xD8D9, +0xD8EC,0xD8EA,0xD8E4, 0,0xD8ED,0xD8E6, 0,0xD8DE, +0xD8F0,0xD8DC,0xD8E9,0xD8DA, 0,0xD8F1, 0,0xB452, + 0,0xD8EB,0xDD4F,0xD8DD,0xB44F, 0,0xD8E1, 0, +0xB450,0xD8E0,0xD8E5, 0, 0,0xD8E2, 0, 0, + 0,0xD8E8, 0, 0, 0, 0,0xDD53, 0, + 0, 0,0xDD56,0xDD4E, 0,0xDD50, 0,0xDD55, +0xDD54,0xB743, 0,0xD8DB,0xDD52, 0, 0,0xB744, + 0,0xDD4D,0xDD51, 0, 0, 0, 0,0xE1A9, + 0,0xE1B0,0xE1A7, 0,0xE1AE,0xE1A5,0xE1AD,0xE1B1, +0xE1A4,0xE1A8,0xE1A3, 0,0xB9F1, 0,0xE1A6,0xB9F2, +0xE1AC,0xE1AB,0xE1AA, 0, 0,0xE1AF, 0, 0, + 0, 0,0xE565,0xE567,0xBC6B,0xE568, 0,0xE563, + 0,0xE562,0xE56C, 0,0xE56A,0xBC6A,0xE56D,0xE564, +0xE569,0xE56B,0xE566, 0, 0, 0, 0,0xE961, +0xE966,0xE960,0xE965, 0,0xE95E,0xE968,0xE964,0xE969, +0xE963,0xE95F,0xE967, 0,0xE96A,0xE962, 0,0xECDA, +0xC0AF, 0,0xC0AD, 0,0xC0AC,0xC0AE, 0, 0, +0xEFC4, 0,0xF172,0xF1FD, 0, 0,0xF444,0xF445, + 0,0xC460, 0,0xF5C9, 0,0xC4DE, 0,0xF5CA, + 0,0xF6DE,0xC572, 0,0xC571,0xF6DD,0xC5C9, 0, +0xF7D6, 0, 0, 0, 0,0xA474,0xA67B,0xC9DA, +0xCACA,0xA8B5,0xB15F, 0, 0,0xA475,0xA5AA,0xA5A9, +0xA5A8, 0, 0,0xA7C5, 0, 0,0xAE74, 0, +0xDD57,0xA476,0xA477,0xA478,0xA4DA, 0, 0,0xABD1, + 0,0xCEAF, 0, 0, 0,0xB453,0xA479,0xC95D, + 0, 0,0xA5AB,0xA5AC,0xC978, 0,0xA67C, 0, + 0, 0,0xCACB, 0,0xA7C6, 0,0xCACC, 0, + 0,0xA9AE, 0, 0,0xCC6E,0xA9AC,0xA9AB,0xCC6D, +0xA9A9,0xCC6F,0xA9AA,0xA9AD, 0,0xABD2, 0,0xABD4, +0xCEB3,0xCEB0,0xCEB1,0xCEB2,0xCEB4,0xABD3, 0, 0, +0xD174,0xD173, 0,0xAE76, 0,0xAE75, 0, 0, + 0, 0, 0,0xB162,0xD546, 0,0xB161,0xB163, +0xB160, 0, 0, 0, 0,0xB455,0xD545, 0, +0xB456,0xD8F3, 0,0xB457,0xD8F2,0xB454, 0, 0, + 0, 0,0xDD5A,0xDD5C,0xB745,0xDD5B,0xDD59,0xDD58, + 0, 0, 0,0xE1B4,0xB9F7,0xB9F5, 0,0xB9F6, +0xE1B2,0xE1B3, 0,0xB9F3,0xE571,0xE56F, 0,0xBC6D, +0xE570,0xBC6E,0xBC6C,0xB9F4, 0, 0,0xE96D,0xE96B, +0xE96C,0xE56E,0xECDC,0xC0B0,0xECDB,0xEFC5,0xEFC6,0xE96E, +0xF1FE, 0,0xA47A,0xA5AD,0xA67E,0xC9DB,0xA67D, 0, +0xA9AF,0xB746, 0,0xA4DB,0xA5AE,0xABD5,0xB458, 0, +0xC979, 0,0xC97A, 0,0xC9DC, 0, 0,0xA7C8, +0xCAD0,0xCACE,0xA7C9,0xCACD,0xCACF,0xCAD1, 0,0xA7C7, + 0, 0, 0, 0, 0,0xA9B3,0xA9B4,0xA9B1, + 0, 0,0xA9B0,0xCEB8,0xA9B2, 0, 0, 0, +0xABD6, 0,0xCEB7,0xCEB9,0xCEB6,0xCEBA,0xABD7,0xAE79, +0xD175, 0,0xD177,0xAE77,0xD178,0xAE78,0xD176, 0, +0xCEB5,0xD547,0xD54A,0xD54B,0xD548,0xB167,0xB166,0xB164, +0xB165,0xD549, 0, 0, 0, 0,0xB168, 0, + 0,0xB45A,0xB45B, 0,0xB45C,0xDD5D,0xDD5F,0xDD61, +0xB748,0xB747,0xB459,0xDD60,0xDD5E, 0,0xE1B8, 0, + 0,0xE1B6,0xE1BC,0xB9F8,0xE1BD,0xE1BA,0xB9F9,0xE1B7, +0xE1B5,0xE1BB,0xBC70,0xE573,0xE1B9,0xBC72,0xE574,0xBC71, +0xBC74,0xE575,0xBC6F,0xBC73, 0,0xE973,0xE971,0xE970, +0xE972,0xE96F, 0, 0,0xC366, 0,0xF446,0xF447, + 0,0xF5CB,0xF6DF,0xC655, 0, 0,0xA9B5,0xA7CA, + 0, 0,0xABD8, 0, 0, 0,0xA47B,0xA4DC, + 0,0xA5AF,0xC9DD, 0,0xA7CB,0xCAD2, 0,0xCEBB, +0xABD9, 0,0xB9FA,0xA47C, 0, 0, 0,0xA6A1, + 0, 0,0xB749,0xA47D,0xA4DD,0xA4DE, 0,0xA5B1, +0xA5B0, 0,0xC9DE,0xA6A2, 0,0xCAD3, 0,0xA7CC, + 0, 0,0xCC71,0xCC72,0xCC73, 0,0xA9B6,0xA9B7, +0xCC70,0xA9B8, 0, 0, 0,0xABDA,0xCEBC, 0, +0xD17A,0xAE7A, 0,0xD179, 0,0xB169,0xD54C,0xB16A, +0xD54D, 0, 0, 0,0xB45D, 0, 0, 0, +0xDD62, 0, 0,0xE1BF,0xE1BE, 0,0xB9FB, 0, +0xBC75,0xE576,0xBECA,0xE974,0xC0B1, 0,0xC573,0xF7D8, + 0, 0, 0, 0,0xCC74, 0,0xCEBD,0xB16B, +0xD8F4,0xB74A, 0, 0, 0,0xC255, 0, 0, + 0, 0,0xA7CE, 0,0xA7CD,0xABDB, 0,0xD17B, + 0,0xB16D,0xB343,0xB16E,0xB16C,0xB45E, 0,0xE1C0, +0xB9FC,0xBC76, 0,0xC94C,0xC9DF, 0,0xCAD5,0xA7CF, +0xCAD4,0xA7D0, 0, 0,0xA9BC,0xCC77,0xCC76,0xA9BB, +0xA9B9,0xA9BA,0xCC75, 0, 0,0xABDD,0xCEBE,0xABE0, +0xABDC,0xABE2,0xABDE,0xABDF,0xABE1, 0, 0, 0, +0xAE7D,0xAE7C,0xAE7B, 0, 0, 0,0xD54F,0xB16F, +0xB172,0xB170, 0,0xD54E,0xB175, 0,0xB171,0xD550, +0xB174,0xB173, 0, 0, 0,0xD8F6,0xD8F5, 0, +0xB461,0xB45F,0xB460,0xD8F7,0xB74B,0xDD64,0xB74C,0xDD63, + 0, 0,0xE577, 0, 0,0xBC78,0xE1C1,0xBC77, + 0,0xB9FD, 0,0xECDE,0xE975,0xC0B2,0xECDD,0xF240, +0xF448,0xF449, 0,0xA4DF, 0,0xA5B2, 0, 0, + 0,0xC97B, 0, 0,0xA7D2,0xA7D4, 0,0xC9E2, +0xCAD8,0xCAD7,0xCAD6, 0,0xC9E1,0xC9E0,0xA6A4,0xA7D3, +0xA7D1,0xA6A3, 0, 0, 0,0xA9BD,0xCC78, 0, +0xA9BE,0xCADD, 0,0xCADF,0xCADE,0xCC79, 0, 0, +0xCADA, 0,0xA7D8,0xA7D6, 0,0xCAD9,0xCADB,0xCAE1, + 0,0xA7D5, 0,0xCADC,0xCAE5,0xA9C0, 0,0xCAE2, +0xA7D7, 0,0xCAE0,0xCAE3, 0,0xA9BF, 0,0xA9C1, +0xCAE4, 0, 0, 0, 0, 0, 0, 0, + 0,0xCCAF,0xCCA2,0xCC7E,0xCCAE,0xCCA9,0xABE7,0xA9C2, +0xCCAA,0xCCAD,0xABE3,0xCCAC,0xA9C3,0xA9C8,0xA9C6,0xCCA3, + 0,0xCC7C,0xCCA5,0xA9CD,0xCCB0,0xABE4,0xCCA6, 0, +0xABE5,0xA9C9,0xCCA8, 0,0xCECD,0xABE6,0xCC7B,0xA9CA, +0xABE8,0xA9CB,0xA9C7,0xA9CC,0xCCA7,0xCC7A,0xCCAB,0xA9C4, + 0, 0,0xCC7D,0xCCA4,0xCCA1,0xA9C5, 0,0xCEBF, + 0,0xCEC0, 0, 0, 0, 0, 0, 0, +0xCECA,0xD1A1,0xCECB,0xABEE,0xCECE,0xCEC4,0xABED,0xCEC6, + 0,0xCEC7, 0, 0,0xCEC9,0xABE9, 0, 0, +0xAEA3, 0,0xF9DA,0xCEC5,0xCEC1,0xAEA4, 0, 0, +0xCECF,0xAE7E,0xD17D,0xCEC8, 0,0xD17C,0xCEC3,0xCECC, + 0, 0,0xABEC,0xAEA1,0xABF2,0xAEA2,0xCED0,0xD17E, +0xABEB,0xAEA6,0xABF1,0xABF0,0xABEF,0xAEA5,0xCED1,0xAEA7, +0xABEA, 0,0xCEC2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xB176, +0xD1A4,0xD1A6, 0,0xD1A8,0xAEA8,0xAEAE,0xD553,0xD1AC, +0xD1A3,0xB178,0xD551, 0,0xAEAD,0xAEAB,0xD1AE, 0, +0xD552, 0,0xD1A5, 0,0xAEAC,0xD1A9,0xAEAF,0xD1AB, + 0, 0,0xAEAA,0xD1AA,0xD1AD,0xD1A7, 0,0xAEA9, +0xB179, 0,0xD1A2,0xB177, 0, 0, 0, 0, +0xB17A, 0, 0, 0, 0, 0, 0, 0, +0xD555,0xD55E,0xB464, 0,0xB17C,0xB1A3,0xB465,0xD560, +0xB1AA,0xD8F9,0xD556,0xB1A2,0xB1A5,0xB17E,0xD554,0xD562, +0xD565,0xD949, 0,0xD563,0xD8FD,0xB1A1,0xB1A8,0xB1AC, +0xD55D,0xD8F8,0xD561,0xB17B,0xD8FA,0xD564,0xD8FC,0xD559, + 0,0xB462, 0,0xD557,0xD558,0xB1A7, 0, 0, +0xB1A6,0xD55B,0xB1AB,0xD55F,0xB1A4,0xD55C, 0,0xB1A9, +0xB466,0xB463,0xD8FB, 0,0xD55A, 0,0xB17D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB46B,0xB46F,0xD940,0xB751,0xB46D,0xD944,0xB471,0xDD65, +0xD946,0xB753,0xB469,0xB46C,0xD947, 0,0xD948,0xD94E, +0xB473,0xB754, 0,0xD94A,0xD94F,0xD943,0xB75E, 0, +0xB755,0xB472,0xD941,0xD950, 0,0xB75D,0xB470,0xB74E, +0xD94D, 0,0xB474,0xD945,0xD8FE,0xB46A,0xD942, 0, +0xD94B, 0,0xB74D,0xB752,0xB467,0xD94C, 0,0xB750, + 0, 0, 0,0xB468, 0, 0, 0,0xB75C, +0xE1C3,0xDD70, 0,0xDD68,0xE1C2, 0,0xDD6C,0xDD6E, + 0, 0,0xDD6B, 0,0xB75B, 0,0xDD6A,0xB75F, + 0, 0, 0,0xE1D2, 0, 0,0xB75A,0xBA40, +0xDD71,0xE1C4, 0, 0,0xB758,0xDD69,0xDD6D,0xB9FE, +0xB74F,0xDD66,0xDD67,0xBA41,0xB757,0xB759,0xB756,0xDD6F, + 0, 0,0xE1C8,0xE1C9,0xE1CE,0xBC7D,0xE1D5, 0, +0xBA47, 0,0xBA46,0xE1D0, 0,0xBC7C,0xE1C5,0xBA45, + 0,0xE1D4,0xBA43,0xBA44, 0,0xE1D1,0xE5AA,0xBC7A, +0xB46E, 0,0xE1D3,0xBCA3,0xE1CB, 0,0xBC7B, 0, +0xBCA2,0xE1C6,0xE1CA,0xE1C7,0xE1CD,0xBA48,0xBC79,0xBA42, + 0,0xE57A,0xE1CF, 0,0xBCA1, 0,0xBCA4, 0, +0xE1CC, 0,0xBC7E,0xE579, 0, 0, 0, 0, + 0,0xE57E,0xBECE,0xE578,0xE9A3,0xE5A9,0xBCA8, 0, +0xBCA6,0xBECC,0xE5A6,0xE5A2,0xBCAC, 0,0xE978, 0, + 0, 0,0xBCAA,0xE5A1, 0,0xE976, 0,0xE5A5, + 0,0xE5A8,0xE57D, 0,0xBCAB, 0, 0,0xBCA5, +0xE977,0xBECD,0xE5A7,0xBCA7,0xBCA9,0xE5A4,0xBCAD,0xE5A3, +0xE57C,0xE57B,0xBECB,0xE5AB,0xE97A,0xECE0,0xBED0, 0, +0xE9A2, 0,0xE97E, 0,0xECE1, 0,0xBED1,0xE9A1, + 0,0xE97C,0xC0B4,0xECDF, 0,0xE979,0xE97B,0xC0B5, +0xBED3,0xC0B3,0xBED2,0xC0B7,0xE97D,0xBECF, 0, 0, + 0, 0, 0, 0, 0, 0,0xEFCF, 0, +0xEFC7, 0, 0, 0, 0, 0,0xECE7,0xEFC8, +0xECE3, 0, 0,0xC256,0xECE5,0xECE4,0xC0B6,0xECE2, +0xECE6,0xEFD0,0xEFCC,0xEFCE, 0,0xEFC9,0xEFCA, 0, +0xEFCD,0xEFCB,0xC367, 0, 0,0xC36A,0xC369,0xC368, +0xC461,0xF44A,0xC462,0xF241,0xC4DF,0xF5CC,0xC4E0,0xC574, +0xC5CA,0xF7D9, 0,0xF7DA,0xF7DB, 0, 0,0xF9BA, +0xA4E0,0xC97C,0xA5B3, 0,0xA6A6,0xA6A7,0xA6A5, 0, +0xA6A8,0xA7DA,0xA7D9, 0,0xCCB1,0xA9CF,0xA9CE, 0, + 0,0xD1AF,0xB1AD,0xB1AE, 0, 0, 0,0xB475, +0xDD72,0xB760,0xB761,0xDD74,0xDD76,0xDD75, 0,0xE1D7, + 0,0xE1D6,0xBA49,0xE1D8, 0,0xE5AC,0xBCAE, 0, +0xBED4, 0,0xC0B8,0xC257,0xC0B9, 0,0xA4E1, 0, + 0, 0,0xCAE6, 0, 0,0xCCB2,0xA9D1,0xA9D0, +0xA9D2,0xABF3,0xCED2,0xCED3, 0, 0,0xD1B0,0xAEB0, +0xB1AF,0xB476,0xD951,0xA4E2, 0,0xA47E,0xA4E3, 0, +0xC97D,0xA5B7,0xA5B6,0xA5B4,0xA5B5, 0, 0, 0, +0xA6AB,0xC9E9,0xC9EB,0xA6AA,0xC9E3, 0,0xC9E4, 0, +0xC9EA,0xC9E6,0xC9E8,0xA6A9,0xC9E5,0xC9EC,0xC9E7, 0, + 0, 0, 0, 0, 0,0xA7E1,0xA7EA,0xA7E8, +0xCAF0,0xCAED,0xCAF5,0xA7E6,0xCAF6, 0,0xA7DF,0xCAF3, + 0,0xA7E5,0xCAEF,0xCAEE,0xA7E3,0xCAF4,0xA7E4,0xA9D3, +0xA7DE,0xCAF1, 0,0xCAE7,0xA7DB, 0,0xA7EE,0xCAEC, +0xCAF2,0xA7E0,0xA7E2, 0,0xCAE8, 0,0xCAE9,0xCAEA, + 0,0xA7ED,0xA7E7,0xA7EC,0xCAEB,0xA7EB,0xA7DD,0xA7DC, +0xA7E9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA9E1,0xCCBE,0xCCB7,0xA9DC,0xA9EF,0xCCB3,0xCCBA,0xCCBC, +0xCCBF,0xA9EA, 0,0xCCBB,0xCCB4,0xA9E8,0xCCB8, 0, +0xCCC0,0xA9D9, 0,0xCCBD,0xA9E3,0xA9E2,0xCCB6,0xA9D7, + 0, 0,0xA9D8, 0,0xA9D6, 0,0xA9EE,0xA9E6, +0xA9E0,0xA9D4,0xCCB9,0xA9DF,0xA9D5,0xA9E7,0xA9F0,0xCED4, +0xA9E4,0xCCB5,0xA9DA,0xA9DD,0xA9DE, 0,0xA9EC,0xA9ED, +0xA9EB,0xA9E5,0xA9E9,0xA9DB,0xABF4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCEDA,0xAC41,0xABF8,0xABFA,0xAC40, +0xCEE6,0xABFD,0xD1B1,0xAEB1,0xAC43,0xCED7,0xCEDF,0xABFE, +0xCEDE,0xCEDB,0xCEE3,0xCEE5,0xABF7,0xABFB,0xAC42,0xAEB3, +0xCEE0,0xABF9,0xAC45,0xCED9, 0, 0, 0,0xABFC, +0xAEB2,0xABF6, 0,0xCED6,0xCEDD,0xCED5,0xCED8,0xCEDC, +0xD1B2,0xAC44, 0,0xCEE1,0xCEE2,0xCEE4,0xABF5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xAEC1,0xD1BE,0xAEBF,0xAEC0,0xD1B4,0xD1C4, 0,0xAEB6, + 0, 0,0xD566,0xD1C6,0xD1C0, 0,0xD1B7, 0, +0xD1C9,0xD1BA,0xAEBC,0xD57D,0xD1BD,0xAEBE,0xAEB5, 0, +0xD1CB,0xD1BF,0xAEB8,0xD1B8,0xD1B5,0xD1B6,0xAEB9,0xD1C5, +0xD1CC,0xAEBB,0xD1BC,0xD1BB,0xAEC3,0xAEC2,0xAEB4,0xAEBA, +0xAEBD,0xD1C8, 0, 0,0xD1C2,0xAEB7,0xD1B3,0xD1CA, +0xD1C1,0xD1C3,0xD1C7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD567, 0,0xB1B7, +0xB1CB,0xB1CA, 0,0xB1BF, 0,0xD579,0xD575,0xD572, +0xD5A6,0xB1BA,0xB1B2, 0, 0,0xD577,0xB4A8,0xB1B6, +0xD5A1, 0,0xB1CC,0xB1C9,0xD57B,0xD56A, 0, 0, +0xB1C8,0xD5A3,0xD569,0xB1BD,0xB1C1,0xD5A2, 0,0xD573, +0xB1C2,0xB1BC,0xD568, 0,0xB478,0xD5A5,0xD571,0xB1C7, +0xD574,0xD5A4,0xB1C6, 0,0xD952, 0,0xB1B3,0xD56F, +0xB1B8,0xB1C3, 0,0xB1BE,0xD578,0xD56E,0xD56C,0xD57E, +0xB1B0,0xB1C4,0xB1B4,0xB477,0xD57C,0xB1B5, 0,0xB1B1, +0xB1C0,0xB1BB,0xB1B9,0xD570,0xB1C5,0xD56D,0xD57A,0xD576, +0xD954,0xD953, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD56B,0xD964, 0, +0xB47A, 0,0xD96A,0xD959,0xD967,0xDD77,0xB47D,0xD96B, +0xD96E,0xB47C,0xD95C,0xD96D,0xD96C,0xB47E,0xD955,0xB479, +0xB4A3, 0,0xB4A1,0xD969, 0,0xD95F,0xB4A5,0xD970, +0xD968,0xD971,0xB4AD,0xB4AB,0xD966,0xD965, 0,0xD963, +0xD95D,0xB4A4, 0,0xB4A2,0xD1B9,0xD956, 0,0xDDB7, +0xD957,0xB47B,0xB4AA,0xDD79, 0,0xB4A6,0xB4A7,0xD958, +0xD96F,0xDD78,0xD960,0xD95B,0xB4A9,0xD961,0xD95E, 0, + 0,0xB4AE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xB770, 0, + 0,0xDD7C,0xDDB1,0xDDB6,0xDDAA,0xB76C,0xDDBB,0xB769, +0xDD7A, 0,0xDD7B,0xB762,0xB76B,0xDDA4,0xB76E,0xB76F, +0xDDA5, 0,0xDDB2,0xDDB8,0xB76A, 0,0xB764,0xDDA3, +0xDD7D,0xDDBA,0xDDA8,0xDDA9,0xDD7E,0xDDB4,0xDDAB,0xDDB5, +0xDDAD, 0,0xB765,0xE1D9,0xB768,0xB766,0xDDB9,0xDDB0, +0xDDAC, 0, 0,0xDDA1,0xBA53,0xDDAF,0xB76D,0xDDA7, + 0,0xDDA6, 0, 0, 0,0xB767,0xB763,0xE1EE, +0xDDB3,0xDDAE, 0,0xDDA2, 0, 0, 0, 0, + 0, 0, 0,0xE1E9, 0,0xE1DA,0xE1E5, 0, +0xE1EC,0xBA51,0xB4AC,0xE1EA,0xBA4C, 0, 0, 0, +0xBA4B,0xE1F1, 0,0xE1DB,0xE1E8,0xE1DC,0xE1E7,0xBA4F, +0xE1EB,0xD962, 0, 0, 0,0xE1F2,0xE1E3,0xBA52, +0xE5BA,0xBCAF, 0,0xE1F0,0xE1EF,0xBA54,0xE5AD,0xBCB0, +0xE5AE, 0,0xE1DF,0xE1E0,0xE1DD,0xE1E2,0xE1DE,0xE1F3, +0xBA4E,0xBCB1,0xBA50,0xBA55, 0,0xE1E1, 0,0xE1ED, + 0, 0,0xE1E6, 0, 0,0xE5B1, 0,0xBA4A, +0xBCB4,0xE9AA,0xE5B6,0xE5B5,0xE5B7, 0, 0,0xE5B4, +0xBCB5, 0,0xBCBB,0xBCB8, 0,0xBCB9,0xE5AF,0xE5B2, +0xE5BC,0xBCC1,0xBCBF, 0,0xE5B3,0xD95A,0xBCB2,0xE5B9, +0xE5B0, 0,0xBCC2,0xE5B8,0xBA4D,0xBCB7,0xE1E4, 0, + 0,0xBCBA, 0,0xBCBE,0xBCC0,0xBCBD,0xBCBC, 0, +0xBCB6,0xE5BB,0xBCB3,0xBCC3, 0, 0, 0, 0, + 0, 0, 0,0xBED8,0xBED9,0xE9A9,0xBEE2,0xBEDF, + 0,0xBED6,0xBEDD,0xE9AB,0xBEDB,0xBED5, 0,0xBEDC, + 0,0xE9A8,0xC0BB,0xBED7, 0,0xBEDE,0xC0BA,0xE9A7, +0xE9A6, 0,0xBEE0, 0,0xBEE1, 0,0xE9A5,0xE9A4, +0xC0BC,0xE9AE,0xBEDA,0xE9AC, 0, 0, 0, 0, +0xC0BD, 0,0xC0C2,0xECEA,0xECEC, 0,0xC0BF, 0, +0xECED,0xECE9, 0,0xECEB,0xC0C0,0xC0C3, 0,0xECE8, +0xC0BE,0xC0C1,0xC259,0xE9AD,0xC258, 0, 0,0xC25E, +0xEFD4, 0,0xC25C,0xC25D,0xEFD7,0xEFD3,0xC25A,0xEFD1, +0xC36B,0xEFD5, 0,0xEFD6,0xEFD2, 0,0xC25B,0xF242, + 0,0xF245, 0, 0,0xF246,0xF244,0xF247,0xC36C, +0xF243, 0, 0,0xF44E,0xC464,0xF44D,0xF44C,0xF44B, +0xC463,0xC465, 0,0xF5CD,0xC4E2,0xC4E1, 0, 0, +0xF6E1,0xF6E0,0xF6E3,0xC5CB,0xC575,0xF7DD,0xF6E2, 0, + 0,0xF7DC,0xC5CD,0xC5CC,0xC5F3,0xF8A9,0xF8EF,0xA4E4, + 0, 0,0xD972,0xE9AF, 0, 0,0xA6AC,0xCAF7, +0xA7F1,0xA7EF, 0,0xA7F0, 0,0xCCC1,0xA9F1,0xAC46, + 0,0xCEE7, 0,0xCEE8, 0,0xAC47,0xD1CE, 0, +0xAEC4,0xAEC5,0xD1CD, 0, 0, 0, 0,0xB1D3, + 0,0xB1CF, 0,0xD5A7,0xB1D6,0xB1D5,0xB1CE,0xB1D1, +0xB1D4,0xB1D0, 0, 0,0xD976,0xB1CD,0xB4AF, 0, + 0, 0,0xB4B1,0xB4B2,0xD975,0xD978,0xB4B0,0xD973, +0xD977, 0,0xD974, 0,0xB771, 0, 0,0xDDBC, + 0, 0,0xBA56,0xE1F4,0xBEE3,0xBCC4,0xE5BD,0xBCC5, +0xBCC6,0xE5BF,0xE5BE,0xE5C0,0xE9B1, 0, 0,0xE9B0, +0xECEF,0xECEE,0xC0C4,0xC0C5,0xF248, 0, 0,0xA4E5, + 0, 0, 0, 0,0xD979, 0, 0, 0, +0xB4B4,0xB4B3,0xDDBD, 0,0xEFD8,0xC4E3,0xF7DE,0xA4E6, + 0,0xAEC6, 0,0xB1D8,0xB1D7,0xD97A,0xD97B,0xB772, +0xE1F5,0xBA57,0xE9B2, 0,0xA4E7,0xA5B8, 0,0xA9F2, +0xCCC2, 0,0xCEE9,0xAC48,0xB1D9, 0,0xD97C,0xB4B5, +0xB773, 0,0xE5C1,0xE5C2, 0, 0,0xECF0,0xC25F, +0xF8F0,0xA4E8, 0,0xCCC3,0xA9F3,0xAC49, 0,0xCEEA, + 0,0xAEC7,0xD1D2,0xD1D0,0xD1D1,0xAEC8,0xD1CF, 0, + 0, 0, 0,0xB1DB,0xB1DC,0xD5A8,0xB1DD,0xB1DA, +0xD97D, 0,0xD97E,0xDDBE, 0, 0,0xBA59,0xBA58, + 0, 0,0xECF1,0xEFD9, 0,0xF24A,0xF249,0xF44F, + 0,0xC95E,0xAC4A, 0, 0,0xA4E9,0xA5B9, 0, +0xA6AE,0xA6AD, 0, 0,0xA6AF,0xA6B0,0xC9EE,0xC9ED, +0xCAF8,0xA7F2,0xCAFB,0xCAFA,0xCAF9,0xCAFC, 0, 0, + 0, 0,0xA9F4,0xCCC9,0xCCC5,0xCCCE, 0, 0, +0xA9FB, 0,0xA9F9,0xCCCA,0xCCC6,0xCCCD,0xA9F8,0xAA40, +0xCCC8,0xCCC4,0xA9FE,0xCCCB,0xA9F7,0xCCCC,0xA9FA,0xA9FC, +0xCCD0,0xCCCF,0xCCC7,0xA9F6,0xA9F5,0xA9FD, 0, 0, + 0, 0, 0, 0,0xCEEF,0xCEF5, 0,0xAC50, +0xAC4D,0xCEEC,0xCEF1, 0,0xAC53,0xAC4B,0xCEF0,0xAC4E, +0xAC51, 0, 0,0xCEF3, 0,0xAC4C,0xCEF8,0xAC4F, + 0,0xAC52,0xCEED,0xCEF2,0xCEF6,0xCEEE,0xCEEB, 0, + 0,0xCEF7,0xCEF4, 0, 0, 0, 0, 0, + 0,0xAED0,0xAEC9,0xAECC, 0,0xAECF, 0,0xD1D5, + 0,0xAECA,0xD1D3, 0,0xAECE, 0, 0,0xAECB, + 0,0xD1D6,0xAECD, 0, 0, 0, 0, 0, + 0,0xD5AC,0xB1DF,0xD5AB,0xD5AD,0xB1DE,0xB1E3,0xD1D4, + 0,0xD5AA,0xD5AE, 0,0xB1E0,0xD5A9,0xB1E2, 0, +0xB1E1, 0,0xD9A7, 0,0xD9A2, 0,0xB4B6,0xB4BA, +0xB4B7,0xD9A5,0xD9A8, 0,0xB4B8, 0,0xB4B9,0xB4BE, +0xDDC7,0xD9A6,0xB4BC,0xD9A3,0xD9A1, 0,0xB4BD, 0, +0xD9A4, 0, 0, 0,0xB779, 0,0xDDBF,0xB776, +0xB777,0xB775,0xDDC4,0xDDC3,0xDDC0,0xB77B, 0, 0, +0xDDC2,0xB4BB, 0, 0,0xDDC6,0xDDC1,0xB778,0xB774, +0xB77A,0xDDC5, 0, 0, 0,0xBA5C, 0,0xE1F8, +0xE1F7,0xE1F6,0xBA5A, 0, 0, 0, 0, 0, +0xBA5B,0xE5C5,0xE5C8,0xBCC8, 0, 0,0xBCC7,0xE5C9, +0xE5C4,0xBCCA,0xE5C6, 0,0xBCC9,0xE5C3, 0,0xE5C7, +0xBEE9,0xBEE6,0xE9BB,0xE9BA, 0,0xE9B9,0xE9B4, 0, +0xE9B5, 0, 0, 0,0xBEE7, 0,0xBEE4,0xBEE8, +0xE9B3,0xBEE5,0xE9B6,0xE9B7,0xE9BC, 0, 0,0xE9B8, + 0, 0,0xECF2, 0, 0, 0,0xC0C7, 0, +0xEFDC,0xC0C6,0xEFDA,0xEFDB,0xC260,0xC36E,0xF24B, 0, +0xC36D, 0, 0,0xF451,0xF452, 0,0xC466, 0, +0xF450,0xC4E4, 0,0xF7DF,0xC5CE,0xF8AA,0xF8AB, 0, +0xA4EA, 0,0xA6B1,0xA6B2,0xA7F3, 0,0xCCD1,0xAC54, +0xAED1,0xB1E4, 0, 0,0xB0D2, 0,0xB4BF,0xB4C0, +0xB3CC,0xD9A9, 0,0xB77C,0xE1FA,0xE1F9, 0, 0, +0xA4EB,0xA6B3,0xCCD2,0xAA42, 0,0xAA41, 0,0xCEF9, +0xCEFA, 0,0xD1D7,0xD1D8,0xAED2,0xAED3, 0,0xAED4, +0xD5AF, 0, 0,0xB1E6, 0,0xB4C2, 0,0xB4C1, +0xDDC8,0xDF7A,0xE1FB,0xE9BD, 0, 0,0xC261,0xC467, +0xA4EC, 0,0xA5BC,0xA5BD,0xA5BB,0xA5BE,0xA5BA, 0, + 0,0xA6B6, 0,0xC9F6,0xA6B5,0xA6B7, 0, 0, +0xC9F1,0xC9F0,0xC9F3,0xC9F2,0xC9F5,0xA6B4,0xC9EF,0xC9F4, + 0, 0, 0, 0, 0,0xCAFD,0xA7FD,0xCAFE, +0xCB43,0xA7FC, 0,0xCB47,0xCB42,0xCB45,0xA7F5,0xA7F6, +0xA7F7,0xA7F8, 0,0xA840, 0,0xCB41,0xA7FA,0xA841, + 0,0xCB40,0xCB46, 0,0xA7F9,0xCB44,0xA7FB,0xA7F4, +0xA7FE, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xAA57, 0,0xCCD4,0xAA43, 0,0xAA4D, +0xAA4E,0xAA46,0xAA58,0xAA48,0xCCDC,0xAA53,0xCCD7,0xAA49, +0xCCE6,0xCCE7,0xCCDF,0xCCD8,0xAA56,0xCCE4,0xAA51,0xAA4F, + 0,0xCCE5, 0,0xCCE3,0xCCDB,0xCCD3,0xCCDA,0xAA4A, + 0,0xAA50, 0,0xAA44,0xCCDE,0xCCDD,0xCCD5, 0, +0xAA52,0xCCE1,0xCCD6,0xAA55,0xCCE8,0xAA45, 0,0xAA4C, +0xCCD9,0xCCE2,0xAA54, 0,0xAA47,0xAA4B, 0,0xCCE0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCF5B,0xAC5C, +0xAC69, 0,0xCF56,0xCF4C,0xAC62,0xCF4A,0xAC5B,0xCF45, +0xAC65,0xCF52,0xCEFE,0xCF41, 0, 0, 0, 0, +0xCF44,0xCEFB,0xCF51,0xCF61,0xAC60,0xCF46,0xCF58, 0, +0xCEFD,0xCF5F,0xCF60,0xCF63,0xCF5A,0xCF4B,0xCF53,0xAC66, +0xAC59,0xAC61,0xAC6D,0xAC56,0xAC58, 0, 0, 0, +0xCF43,0xAC6A,0xAC63,0xCF5D,0xCF40,0xAC6C,0xAC67,0xCF49, + 0, 0,0xAC6B,0xCF50,0xCF48,0xAC64,0xCF5C,0xCF54, + 0,0xAC5E,0xCF62,0xCF47,0xAC5A,0xCF59,0xCF4F,0xAC5F, +0xCF55,0xAC57,0xCEFC,0xAC68,0xAEE3,0xAC5D,0xCF4E,0xCF4D, +0xCF42, 0,0xCF5E, 0,0xCF57, 0, 0,0xAC55, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD1EC,0xAEEA,0xD1ED, 0,0xD1E1,0xAEDF, +0xAEEB, 0,0xD1DA, 0,0xD1E3,0xD1EB, 0,0xD1D9, +0xD1F4,0xAED5, 0, 0, 0,0xD1F3,0xD1EE, 0, +0xD1EF,0xAEDD,0xAEE8,0xD1E5, 0,0xD1E6,0xD1F0,0xD1E7, + 0,0xD1E2,0xD1DC,0xD1DD,0xD1EA,0xD1E4, 0, 0, +0xAED6,0xAEDA,0xD1F2,0xD1DE,0xAEE6,0xAEE2, 0, 0, +0xAEE5,0xAEEC,0xAEDB,0xAEE7,0xD1E9,0xAEE9,0xAED8, 0, +0xAED7,0xD1DB, 0,0xD1DF,0xAEE0,0xD1F1,0xD1E8,0xD1E0, +0xAEE4,0xAEE1, 0,0xAED9,0xAEDC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD5C4, 0,0xD5B4,0xD5B5,0xD5B9, + 0,0xD5C8,0xD5C5, 0,0xD5BE,0xD5BD,0xB1ED,0xD5C1, +0xD5D0,0xD5B0, 0,0xD5D1,0xD5C3,0xD5D5,0xD5C9,0xB1EC, +0xD5C7,0xB1E7,0xB1FC,0xB1F2, 0,0xB1F6,0xB1F5,0xD5B1, + 0,0xD5CE,0xD5D4,0xD5CC,0xD5D3, 0, 0,0xD5C0, +0xD5B2,0xD5D2,0xD5C2,0xB1EA,0xB1F7, 0,0xD5CB,0xB1F0, + 0, 0, 0,0xD5CA,0xD5B3,0xB1F8, 0,0xB1FA, +0xD5CD,0xB1FB,0xB1E9,0xD5BA,0xD5CF, 0, 0,0xB1EF, +0xB1F9,0xD5BC,0xD5C6,0xD5B7,0xD5BB,0xB1F4,0xD5B6,0xB1E8, +0xB1F1,0xB1EE,0xD5BF,0xAEDE,0xD9C0,0xB1EB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xB1F3, 0,0xD9C3,0xD9D9, +0xD9CE,0xB4D6, 0,0xB4D1,0xD9BD,0xB4D2,0xD9CD, 0, +0xD9C6,0xD9D3,0xB4CE,0xD9AB,0xD9D5,0xB4C4,0xD9B3,0xB4C7, +0xB4C6, 0,0xB4D7, 0,0xD9AD,0xD9CF,0xD9D0,0xB4C9, +0xB4C5,0xD9BB, 0,0xB4D0,0xD9B6, 0,0xD9D1,0xB4CC, +0xD9C9,0xD9D6,0xD9B0,0xD9B5,0xD9AF, 0,0xB4CB,0xD9C2, +0xDDDE,0xD9B1,0xB4CF,0xD9BA,0xD9D2,0xB4CA,0xD9B7,0xD9B4, +0xD9C5,0xB4CD,0xB4C3,0xB4D9,0xD9C8,0xD9C7, 0, 0, + 0, 0, 0, 0,0xD9AC,0xB4C8,0xD9D4,0xD9BC, +0xD9BE, 0,0xD9CB,0xD9CA,0xD9AA,0xB4D3,0xB4D5,0xD9B2, +0xD9B9,0xD9C1,0xB4D4,0xD9B8,0xD9C4,0xD9D7, 0,0xD9CC, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD9D8, 0, 0, + 0, 0,0xD9AE, 0, 0, 0, 0,0xDDF2, +0xB7A6, 0,0xDDF0,0xDDDB,0xDDE0,0xDDD9, 0,0xDDEC, +0xDDCB,0xDDD2, 0,0xDDEA,0xDDF4,0xDDDC, 0,0xDDCF, +0xDDE2,0xDDE7,0xDDD3, 0,0xDDE4,0xDDD0, 0, 0, +0xDDD7,0xDDD8,0xB7A8,0xDDEB,0xDDE9, 0,0xDDCC,0xDDEE, + 0,0xDDEF,0xDDF1,0xB7AC,0xB7A4, 0,0xD5B8,0xDDD4, +0xDDE6,0xDDD5,0xB7A1,0xB7B1,0xDDED,0xB7AF,0xB7AB,0xDDCA, +0xB7A3, 0,0xDDCD,0xB7B0, 0,0xDDDD,0xDDC9, 0, +0xB7A9,0xDDE1,0xDDD1,0xB7AA,0xDDDA,0xB77E,0xB4D8,0xDDE3, +0xD9BF,0xDDCE, 0, 0,0xDDE8,0xB7A5,0xDDE5,0xB7A2, +0xDDDF,0xB7AD,0xDDD6,0xDDF3, 0, 0, 0, 0, + 0, 0,0xB7A7,0xDEC6, 0, 0,0xB7AE, 0, + 0, 0, 0, 0, 0,0xE24A,0xE248, 0, +0xE25E,0xE246, 0,0xE258,0xB77D,0xBA5F,0xE242,0xE25D, + 0,0xE247,0xE255,0xBA64,0xBA5D, 0,0xE25B, 0, +0xE240,0xE25A, 0,0xBA6F,0xE251,0xE261,0xBA6D,0xE249, +0xBA5E,0xE24B,0xE259,0xBA67,0xE244,0xBA6B,0xBA61,0xE24D, +0xE243,0xE1FC, 0,0xE257,0xBA68,0xE260,0xE1FD,0xBA65, + 0,0xE253, 0,0xBA66,0xE245,0xE250,0xE24C,0xE24E, + 0,0xBA60,0xE25F,0xBA6E,0xE24F, 0,0xE262, 0, + 0,0xE1FE,0xE254,0xBA63,0xBA6C,0xBA6A,0xE241,0xE256, +0xBA69, 0, 0,0xBA62,0xE252, 0, 0, 0, + 0,0xE25C, 0, 0, 0, 0, 0, 0, + 0, 0,0xE5D5, 0,0xE5D1,0xE5CD,0xE5E1,0xE5DE, +0xBCCD, 0, 0,0xE5E5,0xE5D4,0xBCD8,0xE5DB, 0, + 0,0xE5D0,0xE5DA,0xBCD5,0xE5EE, 0,0xE5EB,0xE5DD, +0xE5CE, 0, 0,0xE5E2,0xE5E4,0xBCD1,0xE5D8,0xE5D3, +0xE5CA,0xBCCE,0xBCD6, 0,0xE5E7,0xBCD7,0xE5CB,0xE5ED, +0xE5E0,0xE5E6,0xBCD4, 0, 0,0xE5E3, 0,0xE5EA, + 0,0xBCD9, 0,0xBCD3,0xE5DC,0xE5CF,0xE5EF,0xE5CC, +0xE5E8,0xBCD0, 0,0xE5D6, 0,0xE5D7,0xBCCF,0xBCCC, +0xE5D2,0xBCD2, 0,0xBCCB, 0,0xE5E9,0xE5EC,0xE5D9, +0xE9CA, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE9C2, 0,0xE9BE,0xBEF6, 0, 0, +0xBEEB,0xBEF0,0xBEEC,0xE9CC,0xE9D7,0xBEEA,0xE9C4,0xE9CD, +0xE5DF,0xE9CE, 0, 0,0xBEF1, 0,0xE9DD,0xBEF5, +0xBEF8,0xE9C0, 0,0xBEF4, 0,0xE9DB,0xE9DC,0xE9D2, +0xE9D1,0xE9C9, 0, 0,0xE9D3,0xE9DA,0xE9D9, 0, +0xBEEF,0xBEED,0xE9CB,0xE9C8, 0,0xE9C5,0xE9D8,0xBEF7, +0xE9D6,0xBEF3,0xBEF2, 0,0xE9D0, 0,0xE9BF,0xE9C1, +0xE9C3,0xE9D5,0xE9CF,0xBEEE, 0,0xE9C6, 0,0xE9D4, + 0, 0, 0, 0, 0, 0,0xE9C7, 0, + 0, 0, 0, 0, 0, 0,0xC0CF,0xED45, +0xC0C8,0xECF5, 0,0xED41,0xC0CA,0xED48, 0,0xECFC, + 0,0xECF7, 0, 0,0xED49,0xECF3,0xECFE, 0, +0xC0D1,0xED44,0xED4A,0xECFD,0xC0C9,0xED40,0xECF4,0xC0D0, + 0, 0,0xED47,0xECF9,0xC0CC, 0,0xECFB,0xECF8, +0xC0D2,0xECFA,0xC0CB,0xC0CE,0xED43,0xECF6,0xED46, 0, +0xED42, 0, 0, 0,0xC263,0xEFE7,0xC268,0xC269, + 0, 0, 0,0xC262,0xEFE6, 0,0xEFE3,0xEFE4, +0xC266,0xEFDE,0xEFE2,0xC265, 0,0xEFDF, 0, 0, + 0, 0,0xC267,0xC264, 0,0xEFDD,0xEFE1,0xEFE5, + 0, 0, 0,0xF251,0xF24E,0xF257, 0,0xF256, +0xF254,0xF24F, 0,0xC372, 0, 0, 0, 0, + 0,0xF250,0xC371,0xC0CD,0xF253,0xC370,0xF258,0xF252, +0xF24D,0xEFE0, 0, 0, 0,0xC36F, 0,0xF24C, +0xF456, 0,0xF455,0xF255,0xC468, 0,0xF459,0xF45A, +0xF454,0xF458, 0,0xF453, 0, 0, 0, 0, +0xF5D1,0xF457,0xC4E7,0xC4E5,0xF5CF, 0, 0, 0, +0xF5D2, 0,0xF5CE,0xF5D0,0xC4E6, 0, 0, 0, +0xF6E5,0xF6E6,0xC576,0xF6E4, 0, 0, 0,0xF7E2, +0xC5CF,0xF7E0,0xF7E1,0xF8AC, 0, 0,0xC656,0xF8F3, +0xF8F1,0xF8F2,0xF8F4, 0, 0, 0,0xF9BB, 0, +0xA4ED,0xA6B8, 0,0xAA59, 0,0xCCE9, 0, 0, +0xCF64, 0, 0, 0,0xD1F5,0xD1F7, 0,0xD1F6, + 0,0xD1F8,0xB1FD,0xD5D7,0xD1F9, 0,0xD5D6,0xD5D8, +0xD5D9,0xD9DA,0xB4DB,0xD9DB,0xD9DD,0xB4DC,0xB4DA,0xD9DC, + 0,0xDDFA,0xDDF8,0xDDF7, 0,0xDDF6,0xDDF5,0xB7B2, +0xDDF9,0xBA70,0xE263,0xE265,0xBA71,0xE264,0xBCDB, 0, +0xBCDA,0xE5F0, 0, 0,0xE9DF,0xE9DE,0xE9E0, 0, + 0,0xBEF9, 0,0xED4B,0xC0D3, 0,0xEFE8,0xC26A, +0xF259,0xC577,0xA4EE,0xA5BF,0xA6B9,0xA842,0xAA5A,0xAA5B, + 0, 0,0xAC6E, 0, 0,0xD1FA, 0, 0, + 0, 0,0xB7B3, 0, 0, 0,0xE6D1,0xBEFA, +0xC26B,0xA4EF, 0,0xA6BA, 0, 0,0xCCEB,0xAA5C, +0xCCEA, 0,0xCF65,0xAC6F,0xCF66, 0,0xAC70, 0, +0xD1FC,0xAEEE,0xAEED, 0,0xD5DE,0xD5DC,0xD5DD,0xD5DB, + 0,0xD5DA, 0, 0,0xD9DE,0xD9E1,0xB4DE,0xD9DF, +0xB4DD,0xD9E0, 0,0xDDFB, 0, 0,0xE266,0xE267, +0xE268, 0,0xE5F3,0xE5F2,0xBCDC,0xE5F1,0xE5F4,0xE9E1, + 0, 0,0xE9E2,0xE9E3, 0,0xED4C,0xC0D4,0xC26C, +0xF25A, 0,0xC4E8,0xC95F, 0,0xAC71,0xCF67,0xAEEF, + 0, 0,0xB1FE, 0,0xB4DF,0xD9E2, 0,0xB7B5, +0xB7B4, 0, 0,0xE269,0xE26A,0xBCDD,0xBCDE,0xE9E5, +0xE9E4,0xEFE9,0xF7E3,0xA4F0,0xC960,0xA5C0, 0,0xA843, +0xCB48, 0,0xAC72,0xB7B6,0xA4F1, 0,0xCF68,0xAC73, +0xCF69, 0,0xC0D5,0xA4F2, 0, 0,0xCCEC, 0, +0xCF6A, 0,0xD242,0xD241,0xD1FE, 0,0xD1FD,0xD243, +0xD240, 0, 0,0xB240,0xB241, 0, 0,0xB4E0, +0xD9E3, 0,0xD9E4,0xD9E5, 0, 0, 0,0xDE41, +0xDE42,0xDE40, 0,0xDDFD,0xDDFE,0xB7B7,0xE26B,0xE5F7, +0xE5F6,0xE5F5,0xE5F8,0xE9E7,0xE9E6,0xBEFB,0xE9E8, 0, +0xC0D6,0xED4D, 0,0xEFEA,0xF25B,0xF6E7, 0,0xA4F3, +0xA5C2,0xA5C1, 0,0xAA5D,0xC961,0xC97E,0xA6BB, 0, +0xC9F7,0xCB49,0xCB4A,0xAA5E, 0,0xCCED, 0,0xAC74, +0xCF6B,0xCF6C, 0,0xAEF0,0xAEF4,0xD244,0xAEF3,0xAEF1, +0xAEF2, 0,0xD5DF,0xB242,0xB4E3, 0,0xB4E1,0xB4E2, +0xD9E6, 0, 0,0xBA72,0xA4F4, 0,0xC9A1, 0, +0xA5C3, 0, 0,0xC9A4, 0, 0,0xA5C6,0xC9A3, +0xA5C5,0xA5C4,0xA844,0xC9A2, 0, 0,0xC9F8, 0, + 0, 0,0xC9FC,0xC9FE,0xCA40,0xA6C5,0xA6C6,0xC9FB, +0xA6C1, 0,0xC9F9, 0,0xC9FD,0xA6C2, 0,0xA6BD, + 0,0xA6BE, 0,0xA6C4,0xC9FA,0xA6BC,0xA845,0xA6BF, +0xA6C0,0xA6C3, 0, 0, 0,0xCB5B,0xCB59,0xCB4C, +0xA851,0xCB53,0xA84C,0xCB4D, 0,0xCB55, 0,0xCB52, +0xA84F,0xCB51,0xA856,0xCB5A,0xA858, 0,0xA85A, 0, +0xCB4B, 0,0xA84D,0xCB5C, 0,0xA854,0xA857, 0, +0xCD45,0xA847,0xA85E,0xA855,0xCB4E,0xA84A,0xA859,0xCB56, +0xA848,0xA849,0xCD43,0xCB4F,0xA850,0xA85B,0xCB5D,0xCB50, +0xA84E, 0,0xA853,0xCCEE,0xA85C,0xCB57,0xA852, 0, +0xA85D,0xA846,0xCB54,0xA84B,0xCB58,0xCD44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xAA6A,0xAA7A,0xCCF5,0xAA71, 0, +0xCD4B,0xAA62, 0,0xAA65,0xCD42, 0,0xCCF3,0xCCF7, +0xAA6D,0xAA6F,0xCCFA,0xAA76,0xAA68,0xAA66,0xAA67,0xAA75, +0xCD47,0xAA70,0xCCF9,0xCCFB,0xAA6E,0xAA73,0xCCFC,0xCD4A, + 0,0xAC75,0xAA79, 0,0xAA63,0xCD49, 0,0xCD4D, +0xCCF8,0xCD4F,0xCD40,0xAA6C,0xCCF4,0xAA6B,0xAA7D,0xAA72, + 0,0xCCF2,0xCF75,0xAA78,0xAA7C,0xCD41,0xCD46, 0, +0xAA7E,0xAA77,0xAA69,0xAA5F, 0,0xAA64, 0,0xCCF6, +0xAA60,0xCD4E, 0,0xCCF0,0xCCEF,0xCCFD,0xCCF1,0xAA7B, +0xAEF5,0xAA74,0xCCFE,0xAA61, 0,0xACA6, 0, 0, + 0,0xCD4C, 0, 0, 0, 0, 0, 0, +0xCF7C,0xCFA1, 0,0xCFA4,0xCF77, 0, 0,0xCFA7, +0xCFAA,0xCFAC,0xCF74,0xAC76,0xAC7B,0xD249,0xACAD,0xCFA5, +0xCFAD,0xCF7B,0xCF73, 0, 0, 0,0xD264,0xAC7E, +0xCFA2,0xCF78,0xCF7A,0xACA5, 0,0xCF7D,0xAC7D,0xCF70, +0xCFA8, 0,0xCFAB, 0, 0,0xAC7A, 0,0xACA8, +0xCF6D,0xACAA,0xAC78,0xACAE,0xCFA9,0xCF6F,0xACAB,0xD25E, +0xCD48,0xAC7C,0xAC77,0xCF76,0xCF6E,0xACAC,0xACA4,0xCFA3, +0xACA9,0xACA7,0xCF79,0xACA1,0xCF71,0xACA2,0xACA3,0xCF72, +0xCFA6,0xAC79,0xCF7E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD24C,0xAEFD,0xAF43, 0, 0, 0,0xD255,0xD25B, +0xD257,0xD24A,0xD24D,0xD246,0xD247,0xAF4A,0xAEFA,0xD256, +0xD25F,0xAF45,0xAEF6, 0,0xAF40,0xD24E,0xAF42,0xD24F, +0xD259, 0, 0, 0,0xAF44,0xD268,0xD248,0xAEFC, +0xAEFB,0xAF48,0xD245,0xD266,0xD25A,0xD267,0xD261,0xD253, +0xD262, 0,0xD25C,0xD265,0xD263,0xAF49,0xD254,0xAEF9, +0xAEF8,0xAF41,0xAF47,0xD260,0xAF46,0xD251,0xB243, 0, +0xD269,0xD250,0xD24B,0xAEFE,0xAF4B,0xAEF7, 0,0xD258, +0xD25D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xB265,0xD5E1,0xD5E5, 0,0xB252,0xB250, + 0, 0,0xB247,0xD5E3,0xD5E2,0xB25B, 0,0xD5E8, +0xB255, 0,0xD5FA,0xD647,0xB244,0xD5F7,0xD5F0,0xB267, +0xD5E0, 0,0xD5FC, 0,0xB264,0xB258,0xB263,0xB24E, +0xD5EC,0xD5FE,0xD5F6,0xB24F,0xB249,0xD645, 0,0xD5FD, +0xD640,0xB251,0xB259,0xD642,0xD5EA,0xD5FB,0xD5EF,0xD644, +0xB25E,0xB246,0xB25C,0xD5F4,0xD5F2,0xD5F3,0xB253,0xD5EE, +0xD5ED,0xB248,0xD5E7,0xD646,0xB24A,0xD5F1,0xB268, 0, +0xB262,0xD5E6,0xB25F,0xB25D,0xB266,0xD5F8,0xB261,0xD252, +0xD5F9,0xB260,0xD641,0xB245,0xD5F5,0xB257,0xD5E9,0xB256, + 0,0xB254,0xB24C,0xB24B,0xD9E7,0xD643, 0, 0, +0xD5EB, 0, 0,0xD9FC, 0,0xB24D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xB541,0xB25A,0xB4EE,0xD9F6,0xB4FC, 0,0xD9EA, +0xB4EB,0xB4E7,0xDA49,0xB4ED,0xB4F1,0xB4EC,0xB4F5,0xDA4D, +0xDA44, 0, 0,0xD9F1,0xB4FA,0xB4F4,0xD9FD,0xB4E4, +0xDA4A,0xDA43,0xB4E8,0xD9F7,0xB4F7,0xDA55,0xDA56, 0, +0xB4E5,0xDA48,0xB4F9,0xD9FB,0xD9ED,0xD9EE,0xB4FD,0xD9F2, +0xD9F9,0xD9F3, 0,0xB4FB,0xB544,0xD9EF,0xD9E8,0xD9E9, + 0,0xD9EB,0xB4EA,0xD9F8, 0,0xB4F8,0xB542, 0, + 0,0xD9FA,0xDA53,0xDA4B,0xB4E6,0xDA51,0xB4F2, 0, +0xB4F0, 0,0xDA57,0xB4EF,0xDA41,0xD9F4,0xD9FE,0xB547, +0xDA45,0xDA42,0xD9F0,0xB543,0xDA4F,0xDA4C,0xDA54,0xB4E9, +0xDA40,0xB546, 0,0xDA47, 0, 0,0xB4F3,0xB4F6, + 0,0xDA46,0xB545,0xD9F5,0xD5E4, 0, 0,0xDA50, +0xDA4E,0xDA52, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD9EC,0xB540, 0, 0, 0,0xDE61,0xDE60,0xDE46, +0xB7BD, 0,0xDE5F,0xDE49,0xDE4A, 0,0xB7C7,0xDE68, +0xB7C2,0xDE5E, 0,0xDE43,0xB7C8,0xB7BE,0xDE52,0xDE48, +0xDE4B,0xDE63,0xB7B8,0xDE6A,0xDE62,0xB7C1,0xDE57,0xB7CC, + 0, 0,0xB7CB,0xB7C5, 0, 0,0xDE69,0xB7B9, +0xDE55,0xDE4C,0xDE59,0xDE65,0xB7CD, 0,0xB7BB,0xDE54, + 0,0xDE4D,0xB7C4, 0,0xB7C3,0xDE50,0xDE5A,0xDE64, +0xDE47,0xDE51,0xB7BC,0xDE5B,0xB7C9,0xB7C0,0xDE4E,0xB7BF, +0xDE45,0xDE53,0xDE67,0xB4FE,0xBAB0,0xDE56,0xE26C,0xDE58, +0xDE66,0xB7C6,0xDE4F,0xB7BA,0xB7CA,0xBCF0,0xDE44, 0, +0xDE5D, 0, 0, 0,0xDE5C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE2AA,0xBAAD,0xE27D,0xE2A4,0xBAA2, + 0,0xE26E,0xBAAF, 0,0xBA77,0xE26D,0xE2B0,0xBAB1, +0xE271,0xE2A3, 0,0xE273,0xE2B3,0xE2AF,0xBA75,0xBAA1, +0xE653,0xBAAE,0xBA7D,0xE26F, 0,0xE2AE,0xBAA3,0xE2AB, +0xE2B8,0xE275,0xE27E, 0, 0,0xE2B6,0xE2AC,0xBA7C, + 0, 0,0xE27C,0xBA76,0xBA74,0xBAA8, 0, 0, +0xE27A,0xE277,0xE278, 0,0xE2B2, 0,0xE2B7,0xE2B5, +0xBA7A,0xE2B9,0xBA7E,0xBAA7, 0,0xE270,0xE5FA,0xE279, + 0,0xBA78,0xBAAC,0xBAA9,0xBA7B,0xE2A5,0xE274,0xBAAA, +0xE2A7,0xBAA4,0xBAA6,0xBA73, 0,0xE2A9,0xE2A1,0xE272, +0xBAA5,0xE2B1,0xE2B4,0xE27B,0xE2A8, 0,0xBA79,0xBCDF, +0xE2A6,0xE5F9, 0,0xE2AD, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE276,0xE644, +0xE64E,0xBCE2,0xE64D,0xE659,0xBCE4,0xE64B, 0,0xE64F, +0xBCEF, 0,0xE646,0xBCE7, 0,0xE652,0xE9F0,0xBCF3, +0xBCF2,0xE654,0xE643,0xE65E,0xBCED, 0,0xBCE3,0xE657, + 0,0xE65B,0xE660,0xE655,0xE649,0xBCE6,0xBCE9,0xBCF1, +0xBCEC, 0,0xE64C,0xE2A2, 0, 0,0xE648,0xE65F, +0xBCE8, 0,0xBCEB,0xE661,0xBCE0,0xE656,0xE5FB,0xE65C, +0xC0DF, 0,0xE64A, 0,0xBCE1,0xE645,0xBCE5,0xE5FC, +0xBAAB,0xE641, 0,0xE65A,0xE642,0xE640,0xBCEA, 0, +0xE658, 0,0xE5FE,0xE651,0xE650,0xE65D,0xE647,0xBCEE, + 0, 0, 0, 0, 0, 0,0xE9F3, 0, +0xBF49,0xBEFE,0xEA40,0xE9EB,0xBF41,0xE9F7,0xBF48,0xBF43, +0xE9F5,0xED4F,0xE9FB,0xEA42,0xE9FA,0xE9E9,0xE9F8,0xEA44, +0xEA46,0xBEFD,0xEA45,0xBF44,0xBF4A, 0,0xBF47, 0, +0xE9FE,0xBF46,0xE9F9, 0,0xE9ED,0xE9F2, 0,0xE9FD, +0xBF45,0xBF42,0xBEFC,0xBF40,0xE9F1, 0,0xE5FD,0xE9EC, +0xE9EF,0xEA41,0xE9F4,0xE9EA,0xED4E,0xEA43,0xE9EE,0xE9FC, + 0, 0, 0, 0,0xED51,0xC0E3, 0, 0, +0xC0D7, 0, 0,0xC0DB,0xED53,0xED59,0xED57,0xC0D9, +0xC0DA,0xC0E1,0xED5A,0xED52,0xC0DC, 0,0xED56,0xED55, +0xED5B,0xC0E2, 0,0xC0DD,0xC0E0,0xED54,0xC0E4,0xC0DE, +0xC0E5,0xC0D8,0xED58, 0,0xED50, 0, 0,0xEFF7, + 0, 0,0xC271,0xEFF4,0xEFF6, 0,0xC26F,0xEFF2, +0xEFF3,0xEFEE, 0, 0,0xE9F6,0xEFEF,0xC270,0xEFEB, + 0,0xC26D,0xEFF8,0xC26E,0xEFEC,0xEFED,0xEFF1,0xC273, + 0,0xC272, 0, 0,0xEFF0,0xC378,0xF25F,0xF265, +0xC379,0xF25C,0xC376,0xC373,0xF267,0xC377, 0,0xC374, +0xF25E,0xF261,0xF262,0xF263,0xF266, 0,0xEFF5,0xF25D, +0xC375,0xF264,0xF268,0xF260, 0, 0, 0,0xF45D, +0xC46A,0xF460,0xC46B,0xF468,0xF45F,0xF45C, 0,0xF45E, +0xF462,0xF465,0xF464,0xF467,0xF45B, 0,0xC469,0xF463, +0xF466,0xF469,0xF461,0xF5D3,0xF5D4,0xF5D8,0xF5D9, 0, +0xF5D6,0xF5D7,0xF5D5, 0,0xC4E9, 0, 0, 0, + 0,0xC578,0xF6EB, 0, 0,0xF6E8,0xF6E9,0xF6EA, +0xC579, 0,0xF7E5,0xF7E4, 0,0xF8AF,0xC5F4,0xF8AD, +0xF8B0,0xF8AE,0xF8F5,0xC657,0xC665,0xF9A3,0xF96C, 0, +0xF9A2,0xF9D0,0xF9D1,0xA4F5, 0, 0, 0, 0, +0xA6C7,0xCA41, 0, 0,0xCB5E, 0,0xA85F, 0, +0xA862, 0,0xCB5F, 0,0xA860,0xA861, 0, 0, + 0, 0,0xCD58,0xCD5A,0xCD55,0xCD52,0xCD54, 0, + 0, 0,0xAAA4, 0, 0, 0,0xAAA2, 0, + 0,0xCD56,0xAAA3,0xCD53,0xCD50,0xAAA1,0xCD57, 0, +0xCD51,0xAAA5,0xCD59, 0, 0, 0, 0,0xCFAF, + 0,0xCFB3, 0, 0,0xACB7, 0, 0, 0, + 0,0xCFB6, 0,0xACAF,0xACB2,0xACB4,0xACB6,0xACB3, +0xCFB2,0xCFB1, 0,0xACB1,0xCFB4,0xCFB5, 0,0xCFAE, +0xACB5, 0,0xACB0, 0, 0, 0,0xCFB0, 0, + 0, 0, 0, 0, 0,0xD277,0xD278,0xD279, +0xAF50, 0,0xAF4C,0xD26E, 0,0xD276,0xD27B,0xAF51, + 0,0xD26C,0xD272,0xD26B,0xD275, 0, 0,0xD271, +0xAF4D,0xAF4F,0xD27A, 0,0xD26A,0xD26D,0xD273, 0, +0xD274,0xD27C,0xD270, 0,0xAF4E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xB26D, +0xD64E, 0, 0,0xD650,0xD64C, 0,0xD658,0xD64A, +0xD657,0xB269,0xD648,0xDA5B,0xD652,0xB26C, 0,0xD653, +0xD656, 0,0xD65A, 0,0xD64F, 0,0xD654, 0, + 0,0xB26A,0xB26B,0xD659,0xD64D,0xD649,0xD65B, 0, +0xD651, 0, 0,0xD655, 0, 0, 0,0xD64B, + 0,0xB548,0xB549,0xDA65,0xB54F, 0,0xDA59,0xDA62, +0xDA58,0xB54C,0xDA60,0xDA5E, 0,0xDA5F,0xB54A, 0, +0xDA63, 0, 0, 0, 0, 0,0xDA5C,0xDA5A, +0xB54B,0xDA5D,0xDA61, 0, 0, 0,0xB54D, 0, + 0, 0,0xDA64, 0, 0, 0, 0, 0, + 0,0xDE70,0xDE77,0xDE79,0xDEA1, 0,0xB7DA,0xDE6B, + 0,0xB7D2, 0,0xDE7A,0xB7D7,0xDEA2,0xB7CE, 0, +0xDE7D, 0,0xDE6D,0xDE7E,0xDE6C, 0,0xB7DC, 0, +0xDE78,0xB7CF,0xDEA3, 0,0xB7D4,0xDE71,0xB7D9,0xDE7C, +0xDE6F,0xDE76,0xDE72,0xDE6E,0xB7D1,0xB7D8,0xB7D6,0xB7D3, +0xB7DB,0xB7D0,0xDE75, 0,0xB7D5, 0,0xB54E, 0, +0xDE7B, 0,0xDE73, 0, 0, 0, 0, 0, +0xDE74, 0, 0,0xE2C1, 0,0xBAB4, 0, 0, +0xE2BD,0xE2C3,0xE2BF, 0,0xBAB6,0xE2BE,0xE2C2,0xE2BA, + 0,0xE2BC,0xBAB5, 0, 0, 0, 0,0xE2C0, +0xE2BB, 0,0xBAB7, 0,0xBAB2, 0, 0,0xE2C4, + 0,0xBAB3,0xE667,0xE664,0xE670,0xE66A,0xE66C,0xBCF4, +0xE666,0xE66E, 0, 0,0xE66D,0xE66B, 0,0xE671, +0xBCF7,0xE668,0xE66F, 0,0xBCF5, 0, 0,0xE663, +0xE665,0xBCF6,0xE662,0xE672, 0,0xE669, 0, 0, +0xEA4A,0xBF51, 0, 0,0xEA55,0xEA53,0xBF4B,0xEA49, +0xEA4C,0xEA4D,0xEA48,0xBF55,0xBF56,0xEA47,0xEA56,0xEA51, +0xBF4F,0xBF4C,0xEA50,0xEA4E, 0, 0,0xBF52,0xEA52, +0xBF4D, 0,0xBF4E, 0,0xEA4F,0xBF50,0xEA4B, 0, +0xEA54,0xBF53,0xEA57,0xEA58,0xBF54, 0, 0,0xC0E7, +0xC0EE,0xED5C,0xED62, 0,0xED60,0xC0EA,0xC0E9,0xC0E6, +0xED5E, 0, 0, 0,0xC0EC,0xC0EB,0xC0E8, 0, +0xED61,0xED5D,0xED5F, 0,0xC0ED, 0, 0, 0, +0xC277,0xEFFB, 0,0xC274,0xC275,0xEFFD,0xC276,0xEFFA, + 0,0xEFF9,0xF26C,0xEFFC, 0,0xF26D,0xC37A,0xF26B, + 0, 0,0xF26A, 0,0xF269,0xC37B, 0, 0, +0xC46C, 0, 0,0xF46A,0xF46B, 0, 0, 0, + 0,0xF5DC,0xF5DB,0xC4EA, 0,0xF5DA,0xF6EC,0xF6ED, + 0, 0,0xF7E6,0xF8B1, 0, 0,0xF8F6,0xF9BC, +0xC679,0xF9C6,0xA4F6, 0,0xAAA6,0xAAA7, 0, 0, +0xACB8, 0, 0, 0, 0,0xC0EF,0xA4F7, 0, +0xAAA8,0xAF52,0xB7DD,0xA4F8, 0,0xB26E,0xBAB8,0xC962, + 0,0xCFB7,0xD27D, 0,0xE2C5, 0,0xC0F0,0xA4F9, +0xAAA9,0xCFB8,0xCFB9,0xDA66,0xB550, 0, 0,0xDEA4, + 0, 0,0xB7DE,0xE2C6, 0, 0,0xBCF8, 0, +0xC37C,0xA4FA,0xDA67,0xA4FB, 0,0xA6C9,0xCA42,0xA6C8, +0xA865,0xA864,0xA863,0xCB60, 0, 0, 0,0xAAAA, + 0,0xAAAB,0xCD5B, 0,0xCFBA, 0,0xCFBD,0xACBA, +0xCFBB, 0,0xACB9,0xCFBC,0xACBB, 0,0xD2A2,0xD2A1, +0xD27E,0xAF53, 0,0xD65D,0xD65E,0xB26F,0xD65C,0xD65F, +0xB552,0xB270, 0, 0,0xB551,0xDA6B,0xDA6A, 0, +0xDA68,0xDA69, 0,0xDA6C,0xDEA6,0xDEA5,0xDEA9, 0, +0xDEA8,0xDEA7,0xBAB9,0xE2C9, 0,0xE2C8,0xBABA,0xE2C7, +0xE673, 0,0xE674,0xBCF9, 0,0xEA59,0xEA5A, 0, + 0,0xF272,0xC37D,0xF271,0xF270,0xF26E,0xF26F,0xC4EB, +0xF46C,0xF6EE,0xF8F7, 0,0xA4FC, 0,0xC9A5,0xA5C7, +0xC9A6, 0, 0, 0,0xCA43,0xCA44, 0, 0, + 0, 0,0xCB66, 0, 0,0xCB62, 0,0xCB61, +0xAAAC,0xCB65,0xA867,0xCB63,0xA866,0xCB67,0xCB64, 0, + 0,0xCD5F,0xCFBE,0xCD5D,0xCD64, 0,0xAAAD, 0, +0xAAB0,0xCD65,0xCD61, 0,0xCD62, 0,0xCD5C,0xAAAF, +0xCD5E,0xAAAE,0xCD63, 0,0xCD60, 0, 0,0xCFC2, +0xACBD,0xACBE, 0,0xCFC5,0xCFBF, 0,0xCFC4, 0, +0xCFC0,0xACBC,0xCFC3,0xCFC1, 0, 0, 0, 0, + 0, 0, 0,0xD2A8,0xD2A5, 0,0xD2A7,0xAF58, +0xAF57,0xAF55,0xD2A4,0xD2A9,0xAF54,0xAF56,0xD2A6,0xD667, +0xD2A3,0xD2AA, 0, 0, 0, 0, 0,0xD662, +0xD666, 0,0xD665,0xDA6E,0xDA79, 0, 0,0xD668, + 0,0xD663,0xDA6D,0xB274, 0, 0,0xB273,0xD661, +0xD664,0xB275, 0,0xB272,0xB271,0xD660,0xD669, 0, + 0, 0,0xDA70,0xDA77, 0,0xB554,0xDA76,0xDA73, + 0,0xB556, 0, 0, 0,0xDA75, 0, 0, +0xDA6F,0xDA71,0xDA74,0xDA72,0xB555,0xDA78,0xB553,0xB7DF, + 0, 0,0xDEAD,0xDEAC,0xDEAA, 0,0xB7E2,0xB7E1, +0xDEAE, 0,0xDEAB,0xE2CA,0xBABB,0xB7E0, 0, 0, + 0,0xDEB0,0xDEAF, 0,0xE2CD,0xE2CB,0xBCFA, 0, +0xBABC,0xE2CC,0xE676, 0, 0, 0, 0,0xBCFB, +0xE675,0xE67E,0xE67D,0xE67B, 0,0xE67A,0xE677,0xE678, +0xE679,0xE67C,0xE6A1, 0, 0,0xEA5F,0xEA5C,0xEA5D, +0xBF57,0xEA5B,0xEA61,0xEA60,0xEA5E, 0,0xED64,0xED65, +0xC0F1, 0,0xC0F2,0xED63, 0,0xC279,0xEFFE,0xC278, +0xC37E, 0,0xC3A1,0xC46D,0xF46E,0xF46D,0xF5DD,0xF6EF, +0xC57A,0xF7E8,0xF7E7,0xF7E9,0xA5C8,0xCFC6,0xAF59,0xB276, +0xD66A,0xA5C9,0xC9A7,0xA4FD, 0, 0,0xCA45, 0, + 0, 0,0xCB6C,0xCB6A,0xCB6B,0xCB68,0xA868,0xCB69, + 0, 0, 0, 0, 0,0xCD6D, 0,0xAAB3, +0xCD6B,0xCD67,0xCD6A, 0,0xCD66,0xAAB5,0xCD69, 0, +0xAAB2,0xAAB1, 0,0xAAB4,0xCD6C,0xCD68, 0, 0, + 0, 0,0xACC2,0xACC5,0xCFCE,0xCFCD,0xCFCC,0xACBF, +0xCFD5,0xCFCB, 0,0xACC1,0xD2AF, 0,0xCFD2,0xCFD0, +0xACC4, 0,0xCFC8,0xCFD3, 0,0xCFCA,0xCFD4,0xCFD1, +0xCFC9, 0,0xACC0,0xCFD6,0xCFC7,0xACC3, 0, 0, + 0, 0,0xD2B4,0xD2AB,0xD2B6, 0,0xD2AE,0xD2B9, +0xD2BA,0xD2AC,0xD2B8,0xD2B5,0xD2B3,0xD2B7,0xAF5F, 0, +0xAF5D, 0, 0,0xD2B1, 0,0xD2AD, 0,0xD2B0, +0xD2BB,0xD2B2,0xAF5E,0xCFCF, 0,0xAF5A,0xAF5C, 0, + 0, 0, 0, 0,0xD678,0xD66D,0xD66B, 0, +0xD66C, 0,0xD673, 0,0xD674,0xD670,0xB27B,0xD675, +0xD672,0xD66F, 0,0xB279,0xD66E,0xB277,0xB27A,0xD671, +0xD679,0xAF5B,0xB278,0xD677,0xD676,0xB27C, 0, 0, + 0, 0, 0, 0, 0, 0,0xDA7E, 0, + 0, 0,0xDAA1,0xB560, 0,0xDAA7, 0, 0, +0xDAA9,0xDAA2,0xB55A,0xDAA6,0xDAA5,0xB55B,0xB561, 0, +0xB562,0xDAA8,0xB558,0xDA7D,0xDA7B,0xDAA3,0xDA7A,0xB55F, +0xDA7C,0xDAA4,0xDAAA,0xB559,0xB55E,0xB55C,0xB55D, 0, + 0, 0,0xB557, 0, 0, 0, 0,0xB7E9, +0xDEB7,0xB7E8,0xDEBB, 0,0xDEB1, 0,0xDEBC, 0, + 0, 0,0xDEB2,0xDEB3, 0,0xDEBD,0xDEBA,0xDEB8, +0xDEB9,0xDEB5,0xDEB4, 0,0xDEBE,0xB7E5, 0,0xDEB6, + 0,0xB7EA,0xB7E4,0xB7EB,0xB7EC, 0,0xB7E7,0xB7E6, + 0, 0,0xE2CE,0xBABE,0xBABD, 0, 0,0xE2D3, + 0,0xBCFC,0xBABF, 0, 0,0xBAC1,0xE2D4,0xB7E3, +0xBAC0,0xE2D0,0xE2D2,0xE2CF, 0,0xE2D1, 0, 0, + 0,0xE6AB, 0, 0,0xE6AA,0xE6A7,0xBD40,0xEA62, +0xBD41,0xE6A6, 0,0xBCFE, 0,0xE6A8,0xE6A5,0xE6A2, +0xE6A9,0xE6A3,0xE6A4,0xBCFD, 0, 0, 0, 0, +0xED69, 0,0xEA66, 0,0xEA65,0xEA67, 0,0xED66, +0xBF5A, 0,0xEA63, 0,0xBF58, 0,0xBF5C,0xBF5B, +0xEA64,0xEA68, 0,0xBF59, 0,0xED6D,0xC0F5,0xC27A, +0xC0F6,0xC0F3,0xED6A,0xED68, 0,0xED6B, 0,0xED6E, +0xC0F4,0xED6C,0xED67, 0, 0,0xF042,0xF045,0xF275, +0xF040, 0,0xF46F,0xF046, 0,0xC3A2,0xF044,0xC27B, +0xF041,0xF043,0xF047,0xF276, 0,0xF274, 0, 0, + 0, 0,0xC3A3,0xF273, 0, 0, 0,0xC46E, + 0, 0, 0, 0,0xC4ED,0xF6F1,0xC4EC,0xF6F3, +0xF6F0,0xF6F2,0xC5D0,0xF8B2,0xA5CA,0xCD6E,0xD2BC,0xD2BD, +0xB27D,0xDEBF,0xBF5D,0xC3A4,0xC57B,0xF8B3,0xA5CB, 0, +0xCD6F,0xA260, 0, 0,0xCFD7, 0,0xCFD8, 0, + 0, 0, 0, 0,0xD2BE,0xD2BF,0xB27E,0xB2A1, + 0, 0, 0,0xDAAB, 0,0xDEC2,0xDEC1,0xDEC0, +0xE2D5, 0,0xE2D6,0xE2D7,0xBAC2, 0, 0,0xE6AD, +0xE6AC, 0, 0,0xEA69,0xBF5E,0xBF5F, 0,0xED72, +0xED6F,0xED70,0xED71,0xF049,0xF048,0xC27C,0xF277,0xF5DE, +0xA5CC, 0,0xACC6, 0,0xB2A2,0xDEC3, 0,0xA5CD, + 0,0xD2C0,0xB2A3, 0, 0,0xB563,0xB564, 0, +0xA5CE,0xA5CF,0xCA46,0xA86A,0xA869,0xACC7,0xCFD9,0xDAAC, +0xA5D0,0xA5D1,0xA5D2,0xA5D3, 0, 0, 0,0xA86B, +0xA86C,0xCB6E,0xCB6D, 0, 0,0xAAB6,0xCD72,0xCD70, +0xCD71, 0, 0, 0, 0, 0, 0,0xCFDA, +0xCFDB, 0, 0,0xACCB,0xACC9, 0,0xACCA,0xACC8, + 0, 0, 0, 0,0xAF60, 0, 0, 0, + 0,0xAF64,0xAF63,0xD2C1,0xAF62,0xAF61, 0,0xD2C2, + 0, 0,0xB2A6,0xD67B,0xD67A,0xB2A4,0xB2A5, 0, + 0, 0,0xB566,0xB565,0xDAAE, 0, 0,0xDAAD, +0xB2A7, 0, 0, 0, 0, 0,0xB7ED,0xDEC5, +0xB7EE,0xDEC4, 0, 0, 0,0xE2D8,0xE6AE,0xBD42, +0xEA6A, 0, 0, 0,0xED73, 0,0xC3A6,0xC3A5, + 0, 0,0xC57C,0xA5D4,0xCD73, 0, 0,0xB2A8, +0xE2D9,0xBAC3, 0, 0,0xCB6F,0xCB70, 0, 0, +0xCD74,0xAAB8,0xAAB9, 0, 0,0xAAB7, 0, 0, + 0, 0,0xACCF,0xACD0,0xACCD,0xACCE, 0,0xCFDC, + 0, 0,0xCFDD,0xACCC, 0, 0, 0, 0, +0xD2C3, 0,0xAF68,0xAF69, 0,0xB2AB,0xD2C9, 0, +0xAF6E,0xAF6C,0xD2CA,0xD2C5,0xAF6B,0xAF6A,0xAF65,0xD2C8, +0xD2C7,0xD2C4,0xAF6D, 0,0xD2C6,0xAF66, 0,0xAF67, + 0, 0,0xB2AC,0xD6A1,0xD6A2,0xB2AD,0xD67C,0xD67E, +0xD6A4,0xD6A3,0xD67D, 0,0xB2A9,0xB2AA, 0,0xDAB6, +0xB56B,0xB56A,0xDAB0,0xB568, 0,0xDAB3,0xB56C,0xDAB4, +0xB56D,0xDAB1,0xB567,0xB569,0xDAB5, 0,0xDAB2,0xDAAF, + 0, 0, 0, 0, 0,0xDED2, 0,0xDEC7, +0xB7F0,0xB7F3,0xB7F2,0xB7F7,0xB7F6,0xDED3,0xDED1,0xDECA, +0xDECE,0xDECD,0xB7F4,0xDED0,0xDECC,0xDED4,0xDECB,0xB7F5, +0xB7EF,0xB7F1, 0,0xDEC9, 0, 0, 0, 0, +0xE2DB,0xBAC7,0xE2DF,0xBAC6,0xE2DC,0xBAC5, 0,0xDEC8, +0xDECF,0xE2DE, 0,0xBAC8,0xE2E0,0xE2DD,0xE2DA, 0, + 0,0xE6B1,0xE6B5,0xE6B7,0xE6B3,0xE6B2,0xE6B0,0xBD45, +0xBD43,0xBD48,0xBD49,0xE6B4,0xBD46,0xE6AF,0xBD47,0xBAC4, +0xE6B6,0xBD44, 0, 0, 0,0xEA6C, 0,0xEA6B, +0xEA73,0xEA6D,0xEA72,0xEA6F,0xBF60,0xEA71, 0, 0, +0xBF61, 0,0xBF62, 0,0xEA70,0xEA6E, 0, 0, + 0, 0,0xC0F8,0xED74, 0, 0,0xC0F7,0xED77, +0xED75,0xED76, 0, 0,0xC0F9, 0, 0, 0, +0xF04D, 0,0xC2A1,0xF04E, 0, 0,0xC27D,0xF04F, +0xC27E,0xF04C,0xF050, 0,0xF04A, 0, 0,0xC3A7, +0xF278,0xC3A8,0xC46F, 0,0xF04B,0xC470, 0, 0, + 0,0xC4EE,0xF5DF, 0,0xC57E,0xF6F4,0xC57D, 0, +0xF7EA,0xC5F5,0xC5F6, 0, 0,0xF9CC, 0, 0, +0xACD1,0xCFDE, 0,0xB56E,0xB56F,0xA5D5,0xA6CA,0xCA47, + 0,0xCB71,0xA86D, 0,0xAABA, 0,0xACD2,0xACD3, +0xACD4,0xD6A6,0xD2CB,0xAF6F, 0, 0,0xB2AE,0xD6A5, + 0, 0,0xDAB8,0xB571, 0,0xDAB7,0xB570, 0, + 0,0xDED5,0xBD4A,0xE6BB,0xE6B8,0xE6B9,0xE6BA, 0, + 0, 0, 0, 0,0xED78, 0,0xF051, 0, + 0, 0,0xF471,0xF470, 0,0xF6F5,0xA5D6,0xCD75, +0xAF70, 0, 0, 0,0xB572,0xDED6, 0, 0, +0xE2E1, 0,0xBD4B,0xEA74, 0,0xF052,0xF472,0xA5D7, + 0, 0,0xAABB,0xACD7,0xCFDF,0xACD8,0xACD6, 0, +0xACD5,0xD2CC,0xAF71, 0, 0,0xAF72,0xAF73, 0, + 0, 0,0xB2B0,0xD6A7,0xB2AF, 0, 0, 0, + 0, 0,0xDAB9,0xB2B1,0xB573,0xDED7,0xB7F8,0xB7F9, + 0,0xBAC9, 0,0xBACA,0xBD4C,0xBF64,0xEA75,0xBF63, + 0,0xED79,0xC0FA, 0,0xF053,0xF473,0xA5D8,0xA86E, +0xCD78,0xCD77,0xAABC,0xCD76,0xAABD,0xCD79, 0,0xCFE5, +0xACDB,0xACDA,0xCFE7,0xCFE6,0xACDF, 0,0xACDE, 0, + 0,0xACD9, 0,0xCFE1,0xCFE2,0xCFE3, 0,0xACE0, +0xCFE0,0xACDC,0xCFE4,0xACDD, 0, 0, 0, 0, +0xD2CF,0xD2D3,0xD2D1,0xD2D0, 0,0xD2D4, 0, 0, + 0,0xD2D5,0xD2D6,0xD2CE, 0,0xD2CD, 0,0xAF75, +0xAF76, 0,0xD2D7,0xD2D2, 0,0xD6B0, 0,0xD2D8, +0xAF77,0xAF74, 0, 0, 0,0xD6AA, 0,0xD6A9, + 0,0xD6AB,0xD6AC,0xD6AE,0xD6AD,0xD6B2,0xB2B5,0xB2B2, +0xB2B6,0xD6A8,0xB2B7,0xD6B1,0xB2B4,0xD6AF,0xB2B3, 0, + 0, 0, 0, 0,0xDABC,0xDABE,0xDABA,0xDABB, + 0, 0,0xDABF,0xDAC1,0xDAC2,0xDABD,0xDAC0,0xB574, + 0, 0,0xDEDB, 0,0xDEE0,0xDED8,0xDEDC, 0, + 0,0xDEE1,0xDEDD,0xB7FA,0xB843, 0,0xB7FD,0xDED9, +0xDEDA,0xBACE,0xB846,0xB7FE, 0,0xB844,0xB7FC,0xDEDF, +0xB845,0xDEDE,0xB841,0xB7FB,0xB842,0xDEE2,0xE2E6,0xE2E8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xB840, 0, 0,0xE2E3,0xBACC,0xE2E9,0xBACD, +0xE2E7,0xE2E2,0xE2E5,0xE2EA,0xBACB,0xE2E4, 0,0xBD4E, +0xE6BF,0xE6BE, 0,0xBD51,0xBD4F,0xE6BC,0xBD4D,0xE6BD, + 0,0xBD50, 0, 0, 0,0xEA7D, 0,0xEAA1, + 0,0xEA7E,0xEA76,0xEA7A,0xEA79,0xEA77,0xBF66,0xBF67, +0xBF65,0xEA78,0xEA7B,0xEA7C, 0,0xBF68, 0,0xC140, +0xEDA3, 0,0xC0FC,0xED7B,0xC0FE,0xC141, 0, 0, +0xC0FD,0xEDA2,0xED7C,0xC0FB,0xEDA1,0xED7A,0xED7E,0xED7D, + 0, 0,0xF055,0xC2A4,0xC2A5,0xC2A2, 0,0xC2A3, + 0, 0,0xF054, 0,0xF27B, 0, 0,0xC3A9, + 0,0xF279,0xF27A, 0,0xF474,0xF477,0xF475,0xF476, +0xF5E0, 0, 0,0xC4EF,0xF7EB,0xF8B4, 0,0xC5F7, +0xF8F8,0xF8F9,0xC666,0xA5D9,0xACE1, 0,0xDAC3, 0, +0xDEE3, 0,0xA5DA,0xA86F, 0,0xAABE, 0,0xCFE8, +0xCFE9,0xAF78, 0, 0,0xDAC4,0xB575,0xB847,0xC142, +0xEDA4,0xF27C,0xF478,0xA5DB, 0, 0, 0,0xCDA1, +0xCD7A,0xCD7C,0xCD7E,0xCD7D,0xCD7B,0xAABF, 0, 0, + 0, 0,0xACE2,0xCFF2, 0,0xCFED,0xCFEA, 0, + 0,0xCFF1, 0, 0,0xACE4,0xACE5,0xCFF0,0xCFEF, +0xCFEE,0xCFEB,0xCFEC,0xCFF3,0xACE3, 0, 0, 0, + 0, 0, 0, 0, 0,0xAF7C, 0,0xAFA4, +0xAFA3,0xD2E1,0xD2DB,0xD2D9, 0,0xAFA1,0xD6B9,0xAF7A, +0xD2DE,0xD2E2,0xD2E4,0xD2E0,0xD2DA,0xAFA2,0xD2DF,0xD2DD, +0xAF79,0xD2E5,0xAFA5,0xD2E3,0xAF7D,0xD2DC, 0,0xAF7E, +0xAF7B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xB2B9, 0,0xD6BA, 0, 0, +0xD6B3,0xD6B5,0xD6B7, 0,0xD6B8,0xD6B6,0xB2BA, 0, +0xD6BB, 0,0xD6B4, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDAC8,0xB576,0xDAD0, 0, +0xDAC5, 0,0xDAD1, 0,0xDAC6,0xDAC7, 0, 0, +0xDACF,0xDACE,0xDACB,0xB2B8,0xB577,0xDAC9,0xDACC,0xB578, +0xDACD,0xDACA, 0, 0, 0, 0, 0, 0, + 0,0xDEEE, 0,0xDEF2,0xB84E, 0,0xE2F0,0xB851, +0xDEF0,0xF9D6, 0,0xDEED,0xDEE8,0xDEEA,0xDEEB,0xDEE4, + 0,0xB84D, 0, 0,0xB84C, 0,0xB848,0xDEE7, + 0,0xB84F, 0,0xB850,0xDEE6,0xDEE9,0xDEF1,0xB84A, +0xB84B,0xDEEF,0xDEE5, 0, 0, 0,0xE2F2,0xBAD0, +0xE2F4,0xDEEC,0xE2F6,0xBAD4,0xE2F7,0xE2F3, 0,0xBAD1, +0xE2EF,0xBAD3,0xE2EC,0xE2F1,0xE2F5,0xE2EE, 0, 0, +0xB849, 0,0xE2EB,0xBAD2,0xE2ED, 0, 0, 0, + 0, 0,0xBD54,0xE6C1,0xBD58, 0,0xBD56, 0, + 0,0xBACF, 0,0xE6C8,0xE6C9,0xBD53, 0, 0, +0xE6C7,0xE6CA,0xBD55,0xBD52,0xE6C3,0xE6C0,0xE6C5,0xE6C2, +0xBD59,0xE6C4, 0, 0,0xE6C6,0xBD57, 0, 0, + 0, 0,0xBF6A,0xEAA8, 0,0xEAA2,0xEAA6,0xEAAC, +0xEAAD,0xEAA9,0xEAAA,0xEAA7, 0,0xEAA4, 0,0xBF6C, +0xBF69,0xEAA3,0xEAA5, 0,0xBF6B,0xEAAB, 0,0xC146, + 0, 0,0xEDAA,0xEDA5,0xC145, 0, 0,0xC143, + 0,0xEDAC,0xC144,0xEDA8,0xEDA9,0xEDA6,0xEDAD,0xF056, + 0,0xC147,0xEDA7, 0,0xEDAE,0xEDAB, 0, 0, + 0,0xF05A, 0, 0,0xF057, 0,0xC2A6, 0, +0xF05B,0xF05D,0xF05C,0xF058,0xF059, 0, 0,0xF2A3, + 0,0xC3AA, 0,0xF27E,0xF2A2,0xF27D,0xF2A4, 0, + 0,0xF2A1, 0,0xF47A,0xF47D,0xF479,0xC471,0xF47B, +0xF47C,0xF47E,0xC472,0xC474,0xC473,0xF5E1, 0,0xF5E3, + 0,0xF5E2, 0, 0, 0,0xF6F6, 0, 0, +0xF8B5,0xF8FA,0xA5DC, 0, 0,0xCB72,0xAAC0,0xCDA3, +0xAAC1,0xAAC2,0xCDA2, 0,0xCFF8,0xCFF7,0xACE6,0xACE9, +0xACE8,0xACE7,0xCFF4,0xCFF6,0xCFF5, 0, 0,0xD2E8, +0xAFA7,0xD2EC,0xD2EB,0xD2EA,0xD2E6,0xAFA6,0xAFAA,0xAFAD, + 0, 0,0xAFAE,0xD2E7,0xD2E9,0xAFAC,0xAFAB,0xAFA9, +0xAFA8,0xD6C2, 0,0xD6C0,0xD6BC,0xB2BB, 0,0xD6BD, +0xB2BC,0xD6BE,0xD6BF,0xD6C1, 0,0xB2BD, 0, 0, +0xDAD5, 0,0xDAD4,0xDAD3,0xDAD2, 0, 0, 0, + 0,0xDEF6,0xB852, 0,0xDEF3,0xDEF5, 0,0xB853, + 0,0xB854,0xDEF4, 0, 0, 0, 0, 0, +0xE341, 0,0xE2F9,0xE2FA, 0,0xBAD7,0xBAD5,0xBAD6, +0xE343, 0,0xE342,0xE2FE,0xE2FD,0xE2FC,0xE2FB,0xE340, +0xE2F8, 0,0xE6CB,0xE6D0,0xE6CE, 0, 0, 0, +0xE6CD,0xE6CC,0xE6CF, 0,0xEAAE, 0,0xBF6D,0xC148, +0xEDB0, 0,0xC149,0xEDAF,0xF05F,0xF05E,0xC2A7, 0, +0xF2A5,0xC3AB,0xF4A1,0xC5A1,0xF6F7, 0,0xF8B7,0xF8B6, +0xC9A8,0xACEA,0xACEB,0xD6C3, 0,0xB856,0xA5DD,0xA872, +0xA871,0xA870, 0, 0, 0,0xCDA4, 0, 0, +0xAAC4,0xAAC3, 0,0xACEE, 0,0xCFFA,0xCFFD,0xCFFB, + 0,0xACEC,0xACED, 0, 0,0xCFF9,0xCFFC, 0, +0xAFB5, 0, 0, 0,0xD2F3,0xD2F5,0xD2F4,0xAFB2, +0xD2EF, 0, 0,0xAFB0,0xAFAF, 0,0xAFB3,0xAFB1, + 0,0xAFB4,0xD2F2,0xD2ED,0xD2EE,0xD2F1,0xD2F0, 0, + 0, 0, 0, 0, 0, 0,0xD6C6,0xD6C7, +0xD6C5, 0,0xD6C4,0xB2BE, 0, 0, 0, 0, +0xB57D, 0,0xDAD6,0xDAD8,0xDADA,0xB57C, 0, 0, +0xB57A, 0,0xDAD7,0xB57B,0xDAD9,0xB579, 0, 0, +0xDF41,0xDEF7,0xDEFA,0xDEFE,0xB85A,0xDEFC, 0,0xDEFB, +0xDEF8,0xDEF9,0xB858,0xDF40,0xB857, 0,0xB85C,0xB85B, +0xB859, 0,0xDEFD, 0, 0, 0,0xE349, 0, +0xE348, 0, 0,0xE344, 0, 0,0xBAD8,0xE347, +0xE346,0xBAD9, 0, 0, 0, 0, 0,0xBD5E, + 0,0xE6D2, 0,0xBD5F,0xBD5B,0xBD5D, 0,0xBD5A, +0xBD5C, 0, 0, 0,0xEAAF, 0,0xBF70,0xEAB1, +0xEAB0, 0,0xE345,0xBF72,0xBF71,0xBF6E,0xBF6F, 0, + 0, 0, 0, 0,0xEDB5, 0,0xEDB3,0xC14A, +0xEDB4, 0,0xEDB6,0xEDB2,0xEDB1, 0, 0,0xF060, +0xC2AA,0xC2A8,0xC2A9, 0, 0, 0, 0,0xF2A6, +0xF2A7,0xC3AD, 0,0xC3AC,0xF4A3,0xF4A4,0xF4A2, 0, +0xF6F8,0xF6F9, 0, 0,0xA5DE,0xCA48,0xA873, 0, +0xCDA5,0xAAC6,0xAAC5,0xCDA6, 0, 0,0xD040,0xACEF, +0xCFFE,0xACF0, 0, 0,0xAFB6,0xD2F8,0xD2F6,0xD2FC, +0xAFB7,0xD2F7,0xD2FB,0xD2F9,0xD2FA, 0, 0,0xD6C8, +0xD6CA, 0,0xB2BF, 0,0xD6C9,0xB2C0,0xB5A2,0xB5A1, +0xB57E,0xDADB, 0, 0, 0, 0,0xDF44,0xB85D, +0xB85E, 0,0xDF43,0xDF42, 0, 0, 0, 0, +0xE34A,0xBADB,0xBADA,0xE34B,0xE34C, 0,0xBD61,0xBD60, + 0,0xEAB5,0xE6D3,0xE6D5,0xE6D4,0xEAB4,0xEAB2,0xEAB6, +0xEAB3, 0,0xBF73, 0, 0, 0,0xEDB7,0xC14B, +0xEDB8,0xEDB9, 0, 0,0xC2AB,0xC2AC, 0,0xC475, + 0, 0,0xC5D1,0xA5DF, 0, 0, 0, 0, + 0,0xD041, 0, 0, 0, 0, 0, 0, +0xD2FD,0xAFB8, 0, 0, 0, 0, 0,0xB3BA, +0xB3B9, 0, 0,0xB5A4,0xDADD,0xB5A3,0xDADC, 0, + 0, 0, 0,0xDF45, 0,0xBADC,0xE34D,0xBADD, + 0, 0, 0, 0, 0, 0,0xC476,0xF4A5, + 0,0xA6CB,0xAAC7,0xCDA7, 0,0xACF2, 0,0xACF1, +0xD042,0xD043, 0, 0,0xD340,0xD342,0xAFB9, 0, +0xD344,0xD347,0xD345, 0, 0, 0,0xD346,0xD343, +0xD2FE,0xAFBA,0xD348,0xD341, 0, 0, 0, 0, +0xD6D3,0xB2C6,0xD6DC,0xB2C3, 0,0xD6D5,0xB2C7, 0, +0xB2C1, 0,0xD6D0,0xD6DD,0xD6D1,0xD6CE,0xB2C5, 0, +0xB2C2, 0,0xD6D4,0xD6D7,0xB2C4,0xD6D8,0xB2C8,0xD6D9, +0xD6CF,0xD6D6,0xD6DA,0xD6D2,0xD6CD,0xD6CB, 0, 0, +0xD6DB, 0, 0,0xDADF, 0, 0, 0, 0, +0xDAE4, 0, 0, 0,0xDAE0,0xDAE6,0xB5A7,0xD6CC, +0xDAE1,0xB5A5,0xDADE,0xB5AC,0xDAE2,0xB5AB,0xDAE3,0xB5AD, +0xB5A8,0xB5AE,0xB5A9, 0,0xB5AA, 0,0xB5A6, 0, +0xDAE5, 0, 0, 0, 0, 0, 0, 0, +0xB861,0xDF50, 0,0xDF53,0xDF47,0xDF4C,0xDF46,0xB863, + 0,0xDF4A, 0, 0, 0,0xDF48,0xB862, 0, +0xDF4F,0xDF4E,0xDF4B,0xDF4D,0xDF49,0xBAE1,0xDF52,0xB85F, +0xDF51, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE35D, 0,0xBAE8,0xE358, 0,0xBAE7, +0xE34E, 0,0xE350,0xBAE0,0xE355,0xE354,0xE357,0xBAE5, +0xE352,0xE351, 0, 0,0xBAE4,0xBADF,0xE353,0xBAE2, +0xE359,0xE35B, 0,0xE356,0xE34F,0xBAE3, 0, 0, +0xBD69,0xBADE, 0, 0,0xE35C, 0, 0, 0, + 0, 0, 0, 0,0xE6D9,0xBD62, 0,0xE6DB, + 0,0xBD63, 0, 0,0xBD65,0xE6DE, 0,0xE6D6, +0xBAE6,0xE6DC, 0, 0, 0, 0,0xE6D8, 0, +0xB860,0xBD68, 0, 0,0xBD64, 0,0xBD66,0xBD67, + 0,0xBF76,0xE6DD,0xE6D7,0xBD6A, 0,0xE6DA, 0, + 0, 0, 0, 0,0xEAC0,0xEABB, 0, 0, +0xEAC5,0xBF74,0xEABD,0xBF78,0xEAC3,0xEABA,0xEAB7,0xEAC6, +0xC151,0xBF79,0xEAC2,0xEAB8,0xBF77,0xEABC,0xBF7B,0xEAB9, +0xEABE,0xBF7A,0xEAC1,0xEAC4, 0, 0, 0, 0, +0xEDCB,0xEDCC,0xEDBC,0xEDC3,0xEDC1, 0, 0,0xC14F, +0xEDC8,0xEABF, 0,0xEDBF, 0,0xEDC9,0xC14E,0xEDBE, +0xEDBD,0xEDC7,0xEDC4,0xEDC6, 0,0xEDBA,0xEDCA,0xC14C, + 0,0xEDC5,0xEDCE,0xEDC2,0xC150,0xC14D,0xEDC0,0xEDBB, +0xEDCD,0xBF75, 0, 0, 0, 0, 0, 0, + 0,0xF063, 0, 0,0xF061,0xF067,0xC2B0,0xF065, +0xF064,0xC2B2,0xF06A,0xC2B1, 0,0xF06B,0xF068,0xC2AE, +0xF069,0xF062,0xC2AF,0xC2AD,0xF2AB,0xF066, 0, 0, +0xF06C, 0, 0,0xF2A8, 0, 0, 0,0xC3B2, +0xC3B0,0xF2AA, 0,0xF2AC,0xF2A9,0xC3B1,0xC3AE,0xC3AF, +0xC3B3, 0, 0,0xC478, 0,0xF4AA, 0,0xF4A9, +0xF4A7,0xF4A6,0xF4A8, 0,0xC477,0xC479, 0, 0, +0xC4F0, 0, 0,0xF5E5,0xF5E4, 0, 0,0xF6FA, + 0,0xF6FC,0xF6FE,0xF6FD,0xF6FB, 0, 0,0xC5A3, +0xC5A2, 0, 0,0xC5D3,0xC5D2,0xC5D4,0xF7ED,0xF7EC, + 0,0xF8FB,0xF8B8,0xF8FC,0xC658, 0,0xC659,0xF96D, + 0, 0,0xC67E,0xA6CC, 0,0xCDA8, 0, 0, +0xD045,0xD046,0xD044, 0, 0,0xACF3, 0,0xD047, +0xD048,0xD049, 0, 0,0xD349,0xD34F, 0, 0, +0xD34D,0xAFBB,0xD34B, 0,0xD34C,0xD34E, 0, 0, + 0,0xD34A,0xB2C9, 0,0xD6DE,0xB2CB,0xD6E0,0xB2CA, +0xD6DF, 0, 0, 0, 0, 0,0xDAE8,0xB5AF, + 0,0xDAEA,0xDAE7,0xD6E1, 0,0xB5B0, 0,0xF9DB, +0xDAE9, 0, 0, 0, 0, 0, 0,0xDF56, + 0,0xB864,0xDF54,0xB865,0xDF55,0xB866, 0, 0, + 0,0xBAE9,0xE361,0xE35E,0xE360,0xBAEA,0xBAEB,0xE35F, + 0, 0, 0, 0, 0,0xE6DF, 0, 0, +0xE6E0, 0,0xBD6B,0xE6E2,0xE6E1, 0,0xA261, 0, +0xEACA,0xEACB,0xEAC7, 0,0xEAC8,0xBF7C,0xBF7D,0xEAC9, + 0,0xC157, 0, 0,0xC153,0xC158,0xC154,0xC156, +0xC152, 0,0xC155, 0, 0, 0, 0,0xC2B3, +0xEDCF, 0,0xF2AE, 0,0xF2AD, 0,0xF4AB,0xC47A, +0xC47B,0xF741,0xF5E6, 0,0xF740, 0,0xF8FD,0xF9A4, +0xA6CD, 0, 0,0xA874, 0,0xCDA9,0xAAC8, 0, +0xACF6,0xD04C,0xACF4,0xD04A,0xACF9,0xACF5,0xACFA,0xACF8, +0xD04B,0xACF7,0xAFBF,0xAFBE,0xD35A,0xAFC7,0xD353,0xD359, +0xAFC3,0xD352,0xD358,0xD356,0xAFC2,0xAFC4,0xD355,0xAFBD, +0xD354,0xAFC8,0xAFC5,0xAFC9,0xAFC6,0xD351,0xD350,0xD357, +0xAFC0,0xAFBC,0xAFC1, 0, 0, 0, 0, 0, +0xD6F0,0xD6E9, 0,0xB5B5,0xD6E8, 0,0xB2CF,0xB2D6, +0xB2D3,0xB2D9,0xB2D8,0xB2D4, 0,0xD6E2,0xD6E5, 0, +0xD6E4,0xB2D0,0xD6E6,0xD6EF,0xB2D1,0xD6E3,0xD6EC,0xD6ED, +0xB2D2,0xD6EA,0xB2D7,0xB2CD,0xB2D5,0xD6E7,0xB2CC,0xD6EB, + 0, 0,0xD6EE, 0, 0, 0,0xDAFB,0xDAF2, +0xB5B2,0xDAF9,0xDAF6,0xDAEE,0xDAF7,0xB5B4,0xDAEF, 0, +0xDAEB, 0, 0,0xB86C,0xDAF4, 0,0xB5B1,0xDAFA, + 0,0xB5B8,0xB5BA,0xDAED, 0, 0,0xB5B9,0xDAF0, +0xB5B3,0xDAF8,0xDAF1,0xDAF5, 0,0xDAF3,0xB5B6,0xDAEC, +0xB5BB,0xB2CE,0xB5B7,0xB5BC, 0, 0, 0, 0, + 0,0xB868,0xDF5D,0xDF5F,0xDF61,0xDF65, 0,0xDF5B, +0xDF59,0xB86A, 0,0xDF60,0xDF64,0xDF5C,0xDF58, 0, +0xDF57, 0, 0, 0,0xDF62,0xDF5A,0xDF5E,0xB86B, + 0,0xB869,0xDF66,0xB867,0xDF63, 0,0xE372, 0, + 0, 0, 0, 0,0xBAEE,0xE36A,0xBD78,0xE374, +0xBAF1,0xE378,0xBAF7,0xE365, 0, 0,0xE375,0xE362, + 0,0xE377,0xE366, 0,0xBAFE,0xBAFB,0xE376,0xE370, +0xBAED,0xBAF5,0xBAF4, 0,0xBAF3,0xBAF9, 0,0xE363, +0xBAFA,0xE371,0xBAF6,0xBAEC,0xE373,0xBAEF,0xBAF0,0xBAF8, +0xE368,0xE367,0xE364, 0,0xE36C,0xE369,0xE36D,0xBAFD, + 0,0xE379,0xBAF2,0xE36E,0xE36F, 0,0xE36B, 0, + 0, 0,0xBAFC, 0, 0, 0, 0,0xE6E7, +0xBD70,0xBD79,0xBD75,0xE6E4, 0,0xBD72,0xBD76,0xE6F0, +0xBD6C,0xE6E8, 0,0xBD74, 0, 0,0xE6EB,0xE6E6, +0xBD73,0xBD77,0xE6E5, 0,0xBD71, 0,0xE6EF,0xBD6E, +0xE6EE,0xE6ED,0xBD7A,0xE572,0xBD6D, 0,0xE6EC,0xE6E3, + 0,0xBD7B,0xE6EA,0xBD6F, 0, 0, 0, 0, + 0, 0, 0,0xE6E9, 0, 0, 0, 0, +0xBFA2,0xBFA7,0xBF7E,0xEAD8,0xEACF,0xEADB,0xEAD3,0xEAD9, +0xBFA8,0xBFA1,0xEACC,0xEAD2,0xEADC,0xEAD5,0xEADA,0xEACE, + 0, 0,0xEAD6,0xBFA3,0xEAD4,0xBFA6,0xBFA5,0xEAD0, +0xEAD1,0xEACD,0xEAD7,0xBFA4,0xEADE,0xEADD, 0, 0, + 0,0xEDDA,0xEDD6,0xC15F, 0,0xEDD0,0xC159,0xC169, +0xEDDC,0xC161,0xC15D,0xEDD3,0xC164,0xC167,0xEDDE,0xC15C, +0xEDD5,0xC165,0xEDE0,0xEDDD,0xEDD1,0xC160,0xC15A,0xC168, +0xEDD8,0xC163,0xEDD2,0xC15E,0xEDDF,0xC162,0xC15B,0xEDD9, +0xC166,0xEDD7, 0, 0,0xEDDB, 0, 0, 0, +0xF06E,0xF074,0xC2B9,0xF077,0xC2B4,0xC2B5,0xF06F,0xF076, +0xF071,0xC2BA,0xC2B7, 0,0xF06D, 0,0xC2B6,0xF073, +0xF075,0xC2B8,0xF072,0xF070, 0, 0, 0, 0, +0xF2B8,0xC3B7,0xC3B8,0xC3B4, 0,0xC3B5, 0,0xF2B4, +0xF2B2, 0,0xF2B6,0xC3BA,0xF2B7,0xF2B0,0xF2AF,0xF2B3, +0xF2B1,0xC3B6,0xF2B5,0xF4AC,0xC47E,0xC47D,0xF4AD, 0, +0xF4AF,0xF4AE,0xC4A1, 0, 0, 0,0xF5EB,0xF5E8, +0xF5E9, 0,0xF5E7,0xF5EA,0xC4F2,0xF5EC, 0,0xC4F1, + 0,0xF742, 0,0xC5D5,0xC5D7,0xF7EE,0xC5D6,0xF8B9, +0xF940,0xF942,0xF8FE,0xF941,0xC66C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA6CE, 0, +0xACFB,0xD26F,0xAFCA, 0, 0,0xB2DA,0xDAFC,0xDAFD, + 0, 0, 0,0xEADF,0xC16A,0xEDE1, 0, 0, +0xC2BB, 0,0xF2BA,0xF2B9,0xC4A2,0xF5ED, 0,0xF743, +0xC5F8,0xCA49, 0, 0,0xAAC9,0xA875, 0, 0, +0xD04D, 0, 0,0xD360,0xD35B,0xD35F,0xD35D,0xAFCB, +0xD35E,0xD35C, 0,0xD6F1, 0,0xDAFE,0xDB40,0xDF69, +0xDF6A,0xB86E,0xB86F,0xDF68,0xDF6B,0xDF67,0xB86D, 0, +0xBB40, 0,0xB870,0xE37A, 0,0xBD7C,0xE6F1,0xBD7D, + 0,0xBFA9,0xEAE2,0xEAE0,0xEAE1,0xEDE4,0xEDE3,0xEDE2, + 0, 0, 0,0xF2BB, 0,0xC3B9,0xF2BC,0xF744, +0xC5F9,0xF8BA,0xA6CF,0xAACB,0xAACA,0xD04F,0xACFC, 0, + 0,0xD04E,0xD362, 0,0xAFCC,0xD6F2,0xD361, 0, + 0, 0,0xB2DC,0xD6F5,0xD6F3,0xD6F4,0xB2DB, 0, +0xDB42,0xDB43,0xDB41, 0,0xB873,0xDF6D,0xDF6C,0xDF6E, +0xB872,0xB871, 0, 0,0xE6F2,0xE6F4, 0,0xBD7E, +0xE6F3,0xEAE3,0xBFAA,0xF079, 0,0xF078,0xC3BB,0xF2BD, +0xC3BD,0xC3BC,0xF4B0,0xF5EE,0xC4F3,0xA6D0,0xD050,0xACFD, +0xD365,0xAFCE,0xD364,0xD363, 0,0xAFCD, 0,0xD6FB, + 0,0xD6FD,0xD6F6,0xD6F7,0xB2DD,0xD6F8,0xB2DE,0xD6FC, +0xD6F9,0xD6FA,0xB2DF, 0,0xB5BE,0xB5BF, 0,0xDB44, + 0, 0, 0,0xDF6F,0xDF70, 0,0xE37E,0xBB43, +0xBB41,0xBB42,0xE37B,0xE37C, 0,0xE37D,0xE6F9, 0, +0xE6FA,0xBDA1,0xE6F7,0xE6F6,0xE6F8,0xE6F5,0xBFAD,0xEAE4, +0xBFAB,0xBFAC,0xEDE6,0xC16B,0xEDE5,0xEFA8, 0,0xF07A, +0xF07B,0xC2BC, 0,0xC2BD,0xC16C,0xF2BE,0xF2BF,0xF4B1, +0xC4A3,0xA6D1, 0,0xA6D2,0xACFE,0xAACC,0xAFCF,0xD051, + 0, 0, 0,0xB5C0,0xA6D3,0xAD41,0xD052,0xD053, +0xAD40,0xAD42,0xA6D4, 0,0xD054,0xAFD1,0xD366,0xAFD3, +0xAFD0,0xAFD2, 0,0xD741,0xB2E0, 0,0xD740,0xD6FE, + 0,0xDF71, 0, 0,0xE3A1, 0,0xBDA2, 0, +0xBFAE,0xEAE6,0xEAE5, 0,0xEDE7, 0, 0, 0, +0xF5EF, 0, 0,0xA6D5,0xCB73,0xCDAA,0xAD43,0xD055, + 0,0xD368, 0, 0, 0,0xAFD4,0xD367,0xAFD5, + 0, 0, 0,0xD743, 0, 0,0xB2E2,0xD742, +0xD744, 0,0xB2E1, 0, 0, 0, 0,0xDB46, +0xDB47,0xDB45,0xB5C1, 0, 0, 0,0xB874, 0, +0xB875, 0,0xBB45, 0,0xE3A3,0xE3A2,0xBB44, 0, + 0, 0, 0, 0,0xE6FB, 0, 0,0xE6FC, + 0, 0, 0, 0,0xEAE7, 0, 0,0xC170, +0xC16F,0xC16D,0xC16E,0xC171, 0,0xF07C,0xC2BF,0xC2BE, +0xF2C0,0xF4B2, 0, 0, 0,0xC5A5,0xC5A4,0xA6D6, + 0, 0,0xD1FB, 0,0xB877,0xB5C2,0xB876,0xBB46, + 0,0xA6D7,0xC9A9,0xA6D8,0xA6D9, 0, 0,0xCDAB, +0xCB76, 0,0xCB77,0xA877, 0,0xCB74,0xA876, 0, +0xA879,0xCB75,0xA87B,0xA87A,0xCB78,0xA878, 0, 0, + 0,0xAAD1,0xAACF,0xCDAD, 0,0xAACE, 0, 0, + 0,0xAAD3,0xAAD5,0xAAD2, 0,0xCDB0,0xCDAC,0xAAD6, + 0,0xAAD0,0xA87C, 0,0xAAD4,0xCDAF, 0, 0, +0xCDAE, 0,0xAACD, 0, 0, 0, 0, 0, + 0, 0,0xD05B,0xAD47,0xAD48,0xD05D, 0,0xD057, +0xD05A,0xD063,0xD061, 0,0xAD49,0xD067,0xAD4C,0xD064, +0xD05C,0xD059, 0, 0,0xDB49,0xD062,0xAD44,0xD065, +0xD056,0xD05F,0xAD46,0xAD4B,0xD060,0xAD4F,0xAD4D, 0, +0xD058,0xAD4A, 0,0xD05E,0xAD4E,0xAD45,0xD066, 0, + 0, 0, 0, 0, 0,0xAFDA, 0,0xAFE3, +0xAFD8,0xAFD6,0xD36A,0xAFDE,0xAFDB,0xD36C, 0, 0, +0xAFDD,0xD36B,0xD369,0xD36E,0xAFE2,0xAFE0,0xDB48, 0, +0xD36F,0xD36D,0xAFD7, 0, 0,0xAFD9,0xAFDC, 0, +0xAFDF, 0,0xAFE1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD74E,0xB2E4, 0, +0xD745,0xD747, 0,0xD748, 0,0xD750,0xD74C,0xD74A, + 0,0xD74D,0xD751,0xB2E5,0xB2E9,0xD746, 0,0xD74F, + 0,0xB2E7, 0,0xB2E6,0xD74B,0xD749, 0,0xB2E3, +0xB2E8, 0, 0, 0, 0, 0, 0, 0, + 0,0xB5C8,0xDB51, 0, 0,0xDB4F,0xB5CA, 0, + 0, 0, 0,0xDB4A,0xDFA1, 0,0xB5C9,0xDB4E, + 0, 0,0xDB4B,0xB5C5,0xB5CB,0xDB50,0xB5C7,0xDB4D, +0xBB47,0xB5C6,0xDB4C,0xB5CC,0xB5C4,0xB5C3, 0, 0, + 0, 0, 0,0xDF77,0xDF75, 0,0xDF7B, 0, +0xDF73,0xDFA2,0xDF78, 0,0xDF72,0xB87B,0xB8A3,0xDF7D, + 0,0xDF76, 0,0xB87E, 0, 0,0xB87C,0xDF7E, +0xB879,0xB878,0xDF79,0xB87D,0xB5CD, 0,0xDF7C,0xDF74, +0xB87A,0xB8A1,0xB8A2, 0, 0, 0, 0,0xBB4C, +0xBB48, 0,0xBB4D,0xE3A6, 0, 0,0xE3A5,0xE3A7, +0xBB4A,0xE3A4,0xBB4B,0xE3AA,0xE3A9,0xE3A8, 0,0xBB49, + 0, 0, 0, 0, 0,0xE741, 0,0xE744, +0xBDA8,0xE743,0xBDA7,0xBDA3,0xBDA4,0xBDA5,0xE740,0xE6FE, +0xBDA6, 0,0xE742,0xE6FD, 0, 0,0xEAE9,0xEAF3, +0xBFB1,0xBFB0, 0,0xEAED,0xEAEF, 0,0xEAEA, 0, +0xEAEE,0xEAE8,0xEAF1,0xBFAF,0xEAF0,0xEAEC, 0,0xEAF2, + 0,0xEAEB,0xC174,0xEDE8,0xEDEE,0xC178,0xC17A,0xC177, +0xC176, 0,0xC175,0xC173,0xEDE9,0xEDEC,0xC172,0xEDED, + 0,0xC179,0xEDEB, 0,0xEDEA,0xC2C0, 0,0xC2C1, +0xF0A1,0xF07D,0xF07E, 0, 0,0xF2C2, 0,0xF2C1, +0xC3BE,0xF4B4,0xC4A4,0xF4B3, 0,0xF5F0,0xF745,0xC5A6, +0xF943,0xF944,0xC5D8,0xA6DA, 0,0xAAD7,0xDB52,0xBB4E, +0xC17B,0xEDEF,0xA6DB, 0,0xAFE5,0xAFE4,0xDB53, 0, + 0, 0,0xEAF4,0xA6DC,0xAD50, 0, 0,0xDB54, +0xDB55,0xDB56,0xBB4F,0xBFB2,0xA6DD, 0,0xAAD8,0xD068, +0xAFE6,0xD370,0xB2EA, 0,0xDB57,0xB8A4, 0,0xBB50, +0xBFB3,0xC17C,0xC2C2,0xF4B5,0xA6DE,0xAAD9, 0, 0, +0xAFE7,0xD752,0xB5CE, 0,0xBB51,0xE3AB,0xE745, 0, + 0, 0, 0,0xA6DF,0xB5CF,0xDFA3,0xBB52,0xA6E0, +0xCDB1,0xD069,0xAD51, 0, 0,0xD372, 0, 0, +0xAFEA, 0,0xAFE8,0xAFE9,0xAFEB, 0, 0,0xD371, + 0, 0,0xD757,0xD754,0xD756,0xB2EB,0xB2ED,0xB2EC, +0xD753,0xB2EE,0xD755, 0,0xDB58,0xDB59, 0,0xDB5A, +0xDFA6, 0,0xDFA7, 0,0xDFA5,0xDFA8, 0,0xB8A5, + 0,0xDFA4, 0,0xBB53, 0, 0,0xE74A,0xE746, +0xE749,0xE74B,0xE748,0xE747, 0,0xEAF5,0xEAF6,0xEAF7, +0xBFB4,0xBFB5,0xEDF1,0xEDF0,0xEDF2, 0,0xF0A3,0xF0A2, + 0,0xF2C4, 0,0xF2C5,0xF2C3, 0,0xC4A5, 0, +0xF4B6,0xF4B7, 0,0xF746,0xF7EF,0xF8BB,0xA6E1,0xA87D, + 0,0xC17D,0xA6E2, 0,0xD758,0xDB5B, 0,0xC641, +0xCA4A, 0, 0, 0,0xCA4B,0xCA4D,0xA6E3,0xCA4E, +0xCA4C, 0, 0,0xCBA2,0xCBA3,0xCB7B, 0, 0, + 0, 0,0xCBA1,0xA8A1, 0,0xA8A2,0xCB7C,0xCB7A, +0xCB79,0xCB7D,0xA87E,0xCB7E,0xD06A, 0, 0, 0, +0xCDB6,0xAADC,0xCDB5,0xCDB7, 0,0xAADB,0xCDBC,0xAADF, +0xCDB2,0xCDC0,0xCDC6,0xAAE6,0xCDC3,0xAAE3, 0,0xCDB9, +0xCDBF,0xCDC1, 0,0xCDB4,0xAAE2,0xAADD,0xCDBA,0xAAE4, +0xAAE7,0xAAE1, 0,0xAADA,0xCDBE,0xCDB8,0xCDC5,0xAAE9, +0xAAE5,0xAAE0,0xCDBD,0xAFEC,0xCDBB,0xAADE,0xAAE8, 0, +0xCDB3, 0,0xCDC2,0xCDC4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xAD62,0xAD5C,0xAD64,0xAD61,0xD071,0xD074,0xAD5D, + 0,0xD06B, 0,0xAD56,0xAD60, 0,0xAD63,0xAD65, +0xD0A2,0xD077, 0,0xAD55,0xD0A1,0xAD59,0xAD57,0xAD52, +0xD06F, 0,0xD07E,0xD073,0xD076,0xD0A5, 0,0xAD66, +0xD07D,0xAD5E,0xD078,0xD0A4,0xD075,0xD079,0xD07C, 0, + 0,0xD06D,0xD0A3,0xD07B, 0, 0,0xD06C, 0, +0xD070,0xAD5F,0xAD5A,0xAD53,0xAD58,0xAD54,0xAD67,0xD06E, +0xD3A5,0xAD5B, 0, 0,0xD07A,0xCE41, 0, 0, + 0, 0, 0, 0, 0, 0,0xD3A8,0xAFFA, + 0,0xD376, 0,0xD3A3,0xD37D, 0,0xD3B2, 0, +0xD3AA, 0,0xD37E, 0,0xD3A9,0xD378,0xD37C,0xD3B5, +0xAFFD,0xD3AD,0xD3A4,0xAFED,0xD3B3,0xD374, 0,0xD3AC, + 0,0xAFFC,0xAFF7,0xD373,0xAFF5,0xAFF4,0xAFF9,0xD3AB, +0xAFF1,0xAFF8,0xD072,0xDB5C,0xD3A6, 0, 0,0xD37A, +0xAFFB,0xD37B,0xD3A1,0xAFFE,0xD375,0xD3AF, 0,0xD3AE, +0xD3B6,0xAFF3,0xAFF0,0xD3B4,0xD3B0,0xD3A7,0xD3A2,0xAFF6, +0xAFF2,0xD377,0xAFEE,0xD3B1,0xAFEF, 0,0xD379, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD75E,0xD760,0xD765,0xD779,0xB2FC, +0xB2F2, 0,0xD75D,0xB2FD,0xB2FE,0xD768,0xD76F,0xD775, + 0,0xD762, 0,0xD769, 0, 0,0xB340,0xD777, +0xD772,0xB2FA,0xB2F8,0xD76E,0xD76A,0xD75C,0xB2EF,0xD761, +0xD759, 0,0xB2F7,0xB2F9,0xD766,0xD763,0xB2F4,0xD773, +0xB2F1,0xD764,0xD77A,0xD76C, 0,0xD76B,0xB2F0, 0, +0xB2FB, 0,0xB2F3,0xD75A,0xD75F,0xD770,0xD776,0xB341, +0xD75B,0xD767,0xD76D,0xB2F6, 0, 0,0xD778,0xD771, +0xD774, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xB2F5, 0,0xDB6C, +0xDB60,0xB5D7,0xDB7D,0xDBA7,0xDBAA,0xB5D5,0xDB68,0xDBA3, +0xDB69,0xDB77,0xB5E2,0xDB73,0xB5DF, 0,0xDB74,0xDB5D, + 0,0xDBA4, 0, 0,0xB5E8,0xDBA1,0xDB75,0xDBAC, +0xDB70,0xDFC8, 0,0xDBAF,0xB5E6,0xDB6E,0xDB7A,0xB5E9, +0xB5D4,0xDB72,0xDBAD,0xDB6B,0xDB64,0xDB6F, 0,0xDB63, +0xDB61,0xB5D0,0xDBA5,0xDB6A,0xDBA8, 0,0xDBA9,0xB5D8, +0xB5DD,0xB5D9,0xB5E1,0xDB7E,0xB5DA,0xDB76,0xDB66, 0, +0xB5D2,0xDB5E,0xDBA2,0xDBAB,0xDB65,0xB5E0,0xDBB0,0xDB71, + 0,0xDB6D, 0,0xB5D1,0xB5E5, 0,0xDB7C,0xB5E7, + 0,0xDB78,0xB5DC,0xB5D6,0xB5DE,0xB5D3,0xB5E4,0xDB79, +0xDB67,0xDB7B,0xDB62,0xDBA6, 0, 0, 0, 0, + 0, 0, 0,0xDBAE, 0, 0, 0, 0, + 0, 0, 0,0xDB5F, 0, 0, 0, 0, + 0,0xDFC7, 0,0xDFDD,0xB855,0xDFCC, 0,0xDFCA, +0xDFB5,0xB8A9,0xDFC5,0xDFD9,0xDFC1,0xB8B1,0xDFD8,0xDFBF, +0xB5E3,0xDFCF,0xDFC0,0xDFD6,0xB8B0,0xB8A8, 0,0xDFAA, +0xDFB2, 0,0xDFCB,0xDFC3,0xDFDC,0xDFC6,0xB8B6,0xDFD7, + 0,0xB8AD, 0,0xDFC9,0xDFD1,0xDFB6,0xDFD0, 0, +0xDFE1,0xDFB1,0xDFD2, 0,0xDFDF, 0,0xDFAB,0xB5DB, + 0,0xDFB9,0xDFB8,0xB8AF, 0,0xDFBC,0xDFBE,0xDFCD, +0xDFDE,0xB8B2, 0,0xB8B3, 0,0xDFB0,0xB8AB,0xDFB4, +0xDFDA,0xB8B4, 0,0xB8AC,0xB8AE,0xB8B5,0xDFE0,0xDFD3, +0xDFCE, 0, 0,0xDFBB,0xDFBA,0xB8AA,0xDFAC,0xB8A7, +0xDFC4,0xDFAD,0xDFC2, 0, 0,0xDFB7,0xDFDB, 0, + 0, 0,0xB8A6, 0, 0, 0,0xDFB3, 0, + 0, 0, 0, 0, 0,0xDFAF,0xDFD5,0xDFAE, +0xBB60,0xE3D3, 0, 0,0xE3C2, 0, 0,0xE3AC, +0xE3CA,0xBB58,0xE3BB,0xE3C5,0xBB5B,0xE3BE,0xBB59,0xE3AF, +0xE3CD,0xE3AE,0xE3C1, 0,0xE3AD, 0, 0,0xE3BF, +0xE3C8,0xE3C6,0xE3BA,0xE3B5,0xE3B3, 0,0xE3B4,0xE3C7, +0xE3D2,0xE3BC,0xBB5A, 0,0xE3B7, 0,0xE3CB, 0, +0xBB5D,0xE3B6,0xE3B0,0xE3C0,0xBB61, 0, 0,0xBB55, +0xBB5E,0xE3B8,0xE3B2, 0,0xBB57,0xDFD4,0xBB56,0xE3C3, + 0,0xBB54,0xBB63,0xBB5C,0xE3C4,0xE3B9,0xE3B1,0xE3CC, +0xE3BD,0xBB62,0xE3D0,0xBB5F,0xE3CF, 0,0xE3C9,0xE3CE, + 0, 0, 0,0xE3D1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE773, +0xE774,0xE767,0xE766,0xE762,0xBDB4, 0,0xBDAC,0xE776, +0xE775,0xDFA9,0xE75F,0xE763,0xE75D, 0,0xE770,0xE761, + 0,0xE777,0xE75A,0xE758,0xE764,0xE76E,0xE769,0xBDB6, +0xE74F, 0,0xE76D, 0, 0, 0,0xBDB7,0xDFBD, +0xE75B,0xE752,0xE755,0xE77B,0xE75C,0xE753,0xE751,0xE74E, + 0,0xBDB0,0xE765,0xBDAF,0xBDB3,0xE760,0xE768,0xBDA9, +0xE778,0xE77C,0xBDAB, 0,0xE757,0xE76B,0xE76F,0xE754, +0xE779,0xBDB2, 0,0xBDB1,0xE74C,0xBDB5,0xE772,0xE756, +0xE76A,0xE750,0xE75E,0xE759,0xBDAD,0xBDAE,0xE76C,0xE77D, +0xE77A,0xE771, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE74D, 0,0xBDAA,0xEB49, 0, +0xEB40,0xEB43, 0,0xBFBB,0xEB45,0xEAF9,0xEB41,0xEB47, +0xBFB8,0xBFBC,0xBFB6, 0, 0,0xEAFB,0xEB4C, 0, + 0,0xEB46, 0,0xEAFC,0xEB55,0xEB4F,0xEAF8,0xEE46, +0xEAFE,0xBFB7, 0,0xEB4A, 0,0xEB54,0xBFBF, 0, +0xEB51,0xEAFD,0xEB44,0xEB48,0xEB42,0xEB56,0xEB53,0xEB50, +0xBFB9,0xBFBA,0xBFBE,0xEAFA,0xEB57,0xBFBD,0xEB4D, 0, + 0,0xEB4B, 0, 0, 0,0xEB4E,0xEE53,0xEE40, +0xEE45,0xEE52,0xEE44,0xEDFB,0xEE41, 0,0xC1A2, 0, +0xEDF4,0xEE4D,0xEE4F,0xEDF3,0xC1A1,0xEE51,0xEE49,0xC1A8, +0xEE50,0xEE42,0xC1AA,0xEDF9,0xEB52,0xEE4A,0xEE47,0xEDF5, +0xEE55,0xC1A4, 0, 0,0xC1A5,0xEDF7,0xEE48, 0, +0xEE54,0xEE4B,0xEDFD,0xC1A7,0xC1A3,0xEE4C,0xEDFE,0xEE56, +0xEDF8,0xEE43,0xEE4E,0xEDFA,0xEDFC, 0,0xC2CB,0xEDF6, +0xC1A9,0xC2C4,0xC17E, 0, 0, 0, 0,0xC1A6, +0xC2C8,0xF0B3, 0,0xF0A9,0xF0A4,0xF0AA,0xF0B4,0xF0B8, +0xF0B7,0xC2CA,0xC2C9, 0, 0,0xF0AB,0xF0B9,0xF0AE, +0xF0A6, 0,0xF0A8,0xF0A7,0xF0AD,0xF0B2,0xF0A5,0xF0AC, +0xF0B1,0xC2C7, 0,0xF0AF, 0,0xC2C5,0xF0B0,0xC2C3, +0xC2C6,0xF2D5,0xF0B5, 0, 0,0xC3C2, 0,0xF2CD, +0xF2D1,0xF2C9,0xF2CC, 0,0xF2D4,0xC3C0,0xF2D9,0xF2D2, + 0,0xF2CA,0xF2DA,0xF2D3,0xC3C3,0xC3C4,0xF2D7, 0, +0xF2CB,0xC3BF,0xC3C1,0xF2C6,0xF2CE,0xF2C8, 0,0xF2D8, +0xF2D6,0xF2C7,0xF2CF, 0, 0, 0,0xF4BE,0xC3C5, +0xF2D0,0xC4A7,0xC4A9,0xC4A6, 0,0xF4C3,0xF4BB,0xF4B9, +0xF4BD,0xF4BA, 0, 0,0xF4BF,0xF4C1,0xC4AA,0xC4AC, + 0,0xF4C0,0xC4AD,0xC4AB,0xF4C2, 0, 0, 0, + 0,0xC4A8, 0, 0, 0, 0, 0,0xC4F4, +0xF5F1,0xF5F7,0xC4F6,0xF4BC,0xF5F6, 0,0xF5FD,0xF5F4, +0xF5FB,0xF5FA,0xF4B8,0xF5F5,0xF0B6,0xF5FE,0xF5F3,0xF5F8, + 0,0xF5FC,0xF5F2, 0,0xF74A,0xC4F5,0xF5F9, 0, + 0,0xF7F4,0xF74B,0xF749,0xF747,0xF748,0xF74C, 0, +0xC5D9,0xF7F2,0xF7F0,0xF7F5,0xF7F3, 0,0xF7F6,0xC5DA, +0xF7F1, 0, 0,0xF8BC, 0, 0,0xF945,0xF946, +0xF947, 0, 0,0xF9C7,0xF9BD,0xCA4F,0xAAEA, 0, +0xAD68, 0,0xD3B8,0xD3B7,0xB040,0xB342,0xD77C, 0, + 0,0xD77B, 0,0xB5EA,0xB8B8, 0,0xB8B7,0xB8B9, + 0,0xE3D4,0xE77E,0xEB58,0xEB5A,0xEB59, 0,0xC1AB, +0xEE57,0xF0BA,0xF9A5,0xA6E4, 0,0xCDC9,0xCDCA,0xCDC8, +0xCDC7,0xAAEB, 0,0xD0A9,0xD0A7, 0, 0,0xD0A6, + 0,0xAD69,0xAD6B,0xAD6A,0xD0A8, 0, 0, 0, + 0, 0, 0, 0, 0,0xD3C4,0xD3C1,0xD3BF, + 0, 0,0xB041,0xD3C2,0xB046,0xD3BC,0xD3CB, 0, +0xD3CD,0xD3BD, 0,0xB043,0xD3CE,0xD3C9,0xD3BB,0xD3C0, +0xD3CA,0xD3C6,0xD3C3, 0,0xB048,0xD3CC,0xD3BE, 0, + 0,0xD3C7,0xD3B9,0xB047,0xB044,0xD3C5, 0,0xD3C8, +0xD3BA,0xB045,0xB042, 0, 0, 0, 0,0xB34C, +0xD7A5,0xB34B, 0,0xD7A8,0xD7AB,0xB348,0xB346,0xD77E, +0xD7A9,0xD7A7,0xD7A4,0xD7AC,0xD7AD,0xD7AF,0xD7B0,0xD77D, +0xB345,0xD7A2,0xD7A1,0xD7AE,0xB347,0xD7A3,0xB349,0xB344, +0xD7A6,0xB34D, 0,0xB34A,0xD7AA, 0, 0, 0, +0xB5F1,0xDBBF, 0,0xDBB4,0xB5EE, 0,0xDFE7,0xDBBD, +0xDBB1,0xB5EC,0xDBB6,0xB5EF,0xDBBA,0xDBB8,0xB5F2,0xB5EB, + 0, 0,0xDBB2,0xDBB5,0xB5F0, 0,0xDBB3, 0, +0xDBBE,0xDBBC,0xDBB7,0xDBB9,0xDBBB,0xB5ED, 0, 0, + 0, 0, 0, 0, 0,0xDFE8,0xDFEE,0xDFE4, +0xDFEA,0xB8BA,0xDFE6,0xB8C0, 0, 0,0xB8BF, 0, +0xB8BE,0xDFED,0xB8C1,0xB8C2,0xDFE3,0xDFF0,0xB8C3,0xB8BD, +0xB8BC,0xDFEC,0xB8C4,0xDFE2,0xDFE5,0xDFEF,0xDFEB, 0, + 0,0xE3F4,0xE3E9,0xB8BB, 0, 0, 0, 0, +0xBB6A,0xE3DD,0xE3F2,0xE3DE,0xBB65, 0,0xE3DB, 0, +0xE3E4,0xE3DC,0xBB67,0xE3D6,0xE3F1,0xBB68,0xE3EE,0xE3EF, +0xE3D7,0xBB6D,0xE3E6, 0,0xE3E0,0xE3E7,0xE3DA, 0, +0xE3F3,0xE3EB,0xE3E5,0xE3D5,0xBB69,0xE3EC, 0,0xBB6C, +0xE3F0, 0,0xE3EA,0xBB66,0xE3E8, 0,0xE3E2,0xBB64, +0xE3D9,0xE3E1,0xE3ED,0xE3DF, 0, 0,0xE3E3, 0, + 0, 0, 0, 0,0xBDC1,0xDFE9,0xE7B2,0xE7BB, +0xE7B1,0xE7AD,0xE7AA,0xBDC2,0xE7A8,0xBB6B,0xE7A1,0xBDC0, +0xE7A7,0xBDBF,0xE7AC,0xE7A9,0xE7B9,0xE7B4,0xE7AE,0xE7B3, +0xBDBB,0xE7AB,0xE7BE,0xE7A2,0xE7A3,0xE7BA,0xBDBC,0xE7BF, +0xBDBE,0xE7C0,0xE7B0,0xE3D8,0xE7B6,0xE7AF,0xE7B8,0xE7B5, + 0, 0, 0,0xE7A6,0xBDB9,0xE7BD,0xBDBA,0xE7A4, +0xBDBD,0xEB64,0xE7B7,0xE7BC, 0, 0, 0, 0, + 0,0xEB61,0xBDB8,0xBFC0,0xEB6B,0xEB67, 0,0xEB65, +0xEB60,0xEB6F, 0, 0, 0,0xBFC4, 0,0xEB5C, +0xEB68,0xEB69,0xEB5F,0xEB5E,0xEB6C, 0,0xEB62,0xEB5D, +0xEB63, 0,0xEB6E,0xEB5B,0xEB6D,0xEB6A,0xBFC2,0xBFC1, + 0, 0,0xBFC3,0xEB66,0xF0CB, 0, 0, 0, + 0, 0,0xEE59,0xC1B1,0xEE5D,0xEE5A,0xEE61,0xEE67, +0xEE5C, 0,0xEE70,0xC1AE,0xEE6A,0xEE5F,0xEE6B,0xEE66, +0xEE6D,0xEE5E,0xC1B3,0xC1B2,0xEE60,0xEE6E,0xEE58,0xEE6C, +0xC1AC, 0,0xEE64,0xEE63,0xEE68,0xEE5B,0xC1B0, 0, +0xC1B4,0xEE62,0xEE69,0xC1B5,0xEE65, 0, 0, 0, + 0,0xC1AD,0xC1AF,0xF0C7,0xF0C5, 0, 0,0xF0CC, +0xF0C9,0xF0CD, 0,0xF0BE,0xF0C6,0xF0D1,0xEE6F,0xF0C2, +0xC2CF,0xE7A5,0xF0BD,0xF0CA,0xF0C4,0xF0C1,0xF0BC,0xF0BB, +0xF0D0, 0,0xF0C0,0xF0BF,0xC2CD,0xF0C8, 0,0xC2CC, + 0, 0,0xC2CE,0xF0C3,0xF0CF, 0,0xF2DE,0xF2DF, + 0,0xC3C9,0xF2DC,0xC3C6,0xF2E4, 0,0xC3CA,0xF2E6, +0xF2DB,0xF0CE,0xF2E8,0xF2DD, 0,0xC3C7,0xF2E3, 0, +0xF2E5,0xF2E0,0xF2E7,0xF2E2,0xF2E1,0xC3C8, 0, 0, +0xF4C5,0xF4C6, 0,0xF4C8,0xC4AE,0xC4AF,0xF4C9,0xF4C7, + 0,0xF4C4, 0,0xF642,0xF645,0xF641, 0,0xC4FA, +0xF643,0xC4F9,0xC4F8,0xC4F7,0xF644,0xF751,0xF74F, 0, +0xF74E,0xF640,0xF750,0xF646,0xF74D, 0,0xF7F9,0xF7D7, +0xF7F7,0xC5DB,0xF7F8,0xF7FA, 0,0xF8BF,0xC5FA,0xF8BE, +0xF8BD,0xC5FB, 0,0xC65A,0xF96E,0xF9A7,0xF9A6,0xF9A8, +0xA6E5,0xD0AA, 0,0xD3CF,0xD3D0, 0, 0, 0, +0xDBC0, 0,0xF647,0xF8C0,0xA6E6,0xAD6C,0xD0AB, 0, + 0, 0,0xD7B1,0xB34E, 0,0xDBC2,0xDBC1,0xB5F3, + 0,0xB8C5,0xE7C1,0xBDC3, 0,0xBDC4, 0, 0, + 0,0xBFC5,0xC5FC,0xA6E7, 0, 0, 0,0xD0AC, +0xAAED,0xD0AE,0xD0AD,0xAD6D, 0,0xD3D1, 0,0xD3D8, +0xB049,0xD3D6,0xD3D4, 0,0xD3DB,0xD3D2,0xD3D3,0xB04A, + 0,0xB04E, 0, 0,0xD3DC,0xB04D,0xD3DA,0xD3D7, +0xD3D5,0xB04B,0xB04C,0xD3D9, 0, 0, 0, 0, +0xB350,0xD7B2, 0,0xB355,0xD7C2,0xB354,0xD7C4, 0, + 0,0xD7B8,0xB352,0xD7C3, 0,0xD7B3,0xB353,0xD7BF, +0xD7BB,0xD7BD,0xD7B7,0xD7BE, 0, 0,0xB34F,0xD7BA, + 0,0xD7B9,0xD7B5, 0,0xD7C0, 0, 0,0xD7BC, +0xD7B4, 0,0xD7B6,0xB351,0xD7C1, 0, 0, 0, + 0,0xB5F6,0xDBCD, 0, 0, 0,0xDBC9,0xDBCB, +0xDBC6,0xDBC5,0xDBC3, 0,0xDBCA,0xDBCC,0xDBC8, 0, +0xDBC7,0xB5F4,0xB5F5, 0, 0, 0, 0, 0, + 0,0xDBCF,0xB8CD,0xDFF2,0xDFF8,0xDFF3,0xDFF4,0xF9D8, +0xDFF9, 0,0xB8CF, 0,0xB8C7,0xB8CE,0xDFF1,0xDBC4, +0xB8CA,0xB8C8,0xDFF7,0xDFF6,0xB8C9,0xB8CB,0xDFF5,0xB8C6, + 0,0xB8CC, 0, 0, 0, 0, 0,0xE3F6, +0xBB74, 0, 0,0xE442,0xE441, 0,0xE3FB,0xBB76, +0xE440,0xE3F7,0xE3F8,0xBB6E,0xBB70, 0,0xE3FD,0xE3F5, +0xBB72,0xBB71,0xE3F9,0xE3FE,0xE3FC,0xBB73,0xE3FA, 0, + 0,0xDBCE,0xBB6F, 0, 0,0xE7C2,0xE7C9,0xBDC6, + 0,0xE7CD,0xBDCA,0xE7C5,0xE7C3, 0,0xE7CC, 0, +0xBDC5,0xE7CB,0xBDC7,0xBDC8,0xE7C4,0xBDC9,0xE7CA,0xE7C6, +0xE7C7,0xE7C8,0xBB75, 0, 0, 0,0xEB70,0xEB7C, + 0,0xBFCA,0xEB77,0xEB79, 0,0xBFC8,0xEB71,0xEB75, + 0,0xEB78,0xBFC6,0xBFC9,0xEB7B,0xEB73,0xEB74,0xEB7A, +0xEB72,0xEB76,0xBFC7,0xEE72, 0,0xEE71,0xC1B7,0xEE77, +0xC1B9, 0, 0,0xC1B6,0xEE73,0xC1BA,0xEE74, 0, + 0,0xEE75,0xEE78, 0,0xC1B8, 0,0xF0D6, 0, + 0,0xF0D9, 0,0xF0D3,0xF0D5, 0, 0,0xF0D4, +0xF0D7,0xF0D8,0xEE76,0xF0D2, 0, 0,0xC3CD,0xF2EC, +0xF2EF,0xF2F1,0xF2EA,0xF2EB,0xF2EE,0xF2F0,0xC3CE,0xC3CC, +0xC3CB,0xF2ED,0xF2E9,0xF4CA,0xC4B0, 0,0xF4CB, 0, + 0,0xF649,0xC4FB,0xF64B,0xC4FC,0xF648,0xF64A,0xC5A8, + 0,0xF752,0xC5A7,0xF7FD,0xF7FC, 0,0xF7FB, 0, + 0,0xF948,0xF949,0xF94B,0xF94A, 0,0xCA50,0xA6E8, + 0,0xAD6E,0xD7C5,0xB5F7, 0,0xDFFA,0xC2D0, 0, +0xF2F2, 0, 0,0xA8A3, 0, 0, 0,0xB357, + 0, 0, 0,0xB356, 0,0xDBD0,0xB5F8,0xDBD2, +0xDBD1, 0, 0,0xDFFB,0xB8D0,0xE443,0xE446,0xE445, + 0,0xE444,0xE7CE,0xE7D0,0xE7CF, 0,0xBFCC, 0, + 0, 0,0xBFCB, 0,0xC1BB,0xEE79,0xEE7B,0xEE7A, + 0, 0,0xC2D1, 0, 0, 0,0xF2F4,0xF2F3, + 0,0xF4CC,0xC4B1, 0, 0,0xC4FD,0xF754,0xF753, +0xC65B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA8A4,0xD0AF,0xAD6F,0xD7C8,0xD7C6, 0, + 0,0xD7C7,0xDBD4,0xDBD5,0xE043,0xDBD3, 0,0xDFFC, +0xE041,0xE040,0xE042,0xB8D1,0xDFFE,0xDFFD,0xE044, 0, +0xE449,0xE447, 0,0xE448,0xE7D3,0xE7D1, 0, 0, +0xE7D2,0xEB7D,0xEE7C,0xEE7D,0xC2D2, 0,0xF2F5,0xF4CD, +0xC4B2, 0,0xF64C,0xF755,0xC5A9, 0,0xF7FE,0xF94C, +0xA8A5, 0,0xAD71,0xAD72,0xD0B0, 0, 0,0xD0B1, +0xAD70, 0,0xB054, 0,0xB052, 0,0xB051,0xB058, +0xB050,0xB059,0xD3DD,0xB056, 0,0xB053,0xB057,0xB055, +0xB04F, 0, 0,0xB35F, 0,0xB359,0xD7CC,0xB35E, + 0, 0,0xB360,0xB35A, 0,0xB35B, 0,0xD7CA, + 0, 0,0xB358, 0,0xD7CB,0xB35D, 0, 0, +0xD7C9,0xB35C, 0, 0,0xB644, 0,0xB646, 0, + 0,0xDBD8,0xB645,0xB5F9,0xB5FD, 0,0xB8E4,0xE049, +0xDBDA,0xB5FE, 0, 0,0xDBDD,0xDBDE,0xB643, 0, +0xDBE0, 0,0xDBE2, 0,0xDBE3,0xDBD7,0xDBD6,0xDBE4, +0xB642,0xDBE1,0xDBDF, 0,0xB640,0xB5FB,0xB647,0xDBDB, +0xDBDC,0xDBD9, 0,0xB641, 0, 0,0xB5FC, 0, +0xB5FA,0xE048,0xB8DF,0xB8DA, 0, 0,0xB8D5, 0, +0xB8E5,0xB8D6, 0,0xB8D2,0xB8E1,0xB8DE,0xB8E0, 0, +0xB8D7,0xB8DC,0xB8D3,0xB8D4,0xE050,0xE04D,0xE045,0xE04A, + 0,0xB8E2,0xE051,0xB8E3,0xB8D9, 0, 0,0xE047, + 0,0xE04F,0xE04B,0xE04E,0xE04C,0xB8DD,0xE046,0xB8D8, + 0, 0, 0,0xE44C,0xBB78,0xBB7B, 0,0xE44E, + 0,0xBBA5,0xE44D,0xBB7D, 0,0xBDCF,0xE44F, 0, +0xBBA4,0xE44B,0xBBA6, 0, 0, 0,0xBB79, 0, +0xB8DB,0xBB7C, 0,0xBB7A,0xBB7E,0xBBA2,0xBB77,0xBBA7, +0xBBA3, 0,0xBBA1,0xE44A, 0, 0, 0, 0, +0xBDD6, 0,0xBDD2, 0, 0, 0,0xBDD9, 0, +0xE7D6,0xBDDA,0xE7E2,0xE7DB,0xBDCB,0xE7E3,0xE7DD,0xBDD5, +0xE7DE, 0,0xBDD4,0xE7E1,0xBDCE,0xE7DF,0xE7D5,0xBDCD, +0xEBAA,0xBDD3, 0,0xBDD0, 0,0xBDD8, 0,0xE7D4, + 0,0xE7D8,0xBDCC,0xE7D7,0xE7D9,0xE7DA,0xBDD7,0xE7DC, +0xE7E0,0xE7E4, 0,0xBDDB,0xBFD2,0xEBA5,0xEBAB,0xEBA8, +0xEB7E,0xEBAC,0xEBA1, 0,0xEBA7, 0,0xBFCD,0xBFD3, +0xEBAD, 0, 0,0xBFCF, 0,0xBFD9,0xBFD4,0xEBAF, +0xEBA9,0xBFD0,0xEBA2,0xBFDA,0xEBA3,0xEBA4,0xBFDB,0xBFD8, +0xBDD1, 0,0xBFCE,0xEBB0,0xBFDC, 0,0xBFD5,0xEBAE, +0xBFD1,0xBFD6,0xBFD7, 0,0xC1C3,0xEEA4,0xEEAD,0xEEAA, +0xEEAC, 0,0xC1C0,0xEEA5, 0,0xEEAB,0xC1BC,0xEEA7, +0xC1C4,0xEEA3,0xEEA8,0xEEAF,0xEBA6,0xEEA9,0xEEA2,0xC1BD, +0xEEA1,0xC1BE,0xEEB0,0xC1BF,0xEEAE,0xC1C2,0xEE7E, 0, +0xC1C1, 0,0xEEA6,0xF0DC,0xF0EA,0xF0E5,0xF0E7,0xF0DB, +0xC2D3, 0,0xF0DA,0xC2D6,0xC2D5, 0,0xF0E9,0xF0E1, +0xF0DE,0xF0E4, 0,0xF0DD, 0,0xF0DF,0xF0E8,0xF0E6, + 0,0xC2D4,0xF0ED,0xF0EB,0xF0E2,0xF0EC,0xF0E3, 0, +0xF2F9,0xC3CF,0xF341, 0, 0,0xF64F,0xC3D6,0xF0E0, +0xF2F7,0xC3D2,0xF2F8,0xF2FD, 0, 0,0xC3D4,0xC3D5, +0xF2F6,0xF340,0xF342,0xF2FA,0xF2FC,0xF2FE,0xF2FB,0xF343, +0xC3D1,0xC3D7,0xC3D3, 0,0xC3D0,0xF4D0, 0,0xC4B7, +0xF4CE, 0, 0,0xF4D2, 0,0xF4D3,0xC4B5,0xF4D4, +0xF4D1, 0,0xF4CF,0xC4B8,0xC4B4,0xF4D5, 0,0xC4B6, +0xC4B3, 0, 0, 0,0xC4FE, 0, 0,0xC540, +0xF64E,0xF64D,0xF650,0xF651, 0,0xC541,0xF756,0xF75B, +0xC5AA, 0,0xF758, 0,0xF757,0xF75A,0xF759, 0, +0xF843, 0,0xC5DC,0xF842,0xF840, 0,0xF841, 0, + 0, 0,0xC5FE,0xC5FD,0xF8C1,0xF8C2,0xC640, 0, +0xF94D,0xF94E,0xC667, 0,0xC66D, 0,0xF9A9,0xF9C8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA8A6, + 0,0xD7CD, 0,0xD7CE,0xE052,0xE450,0xE7E5,0xC1C6, + 0,0xC1C5,0xF0EE,0xF344, 0,0xF844,0xA8A7,0xD3DE, +0xB05A,0xB361,0xE054,0xE053,0xBDDC,0xE7E6,0xBDDD,0xEEB1, +0xC2D7, 0, 0, 0,0xC676,0xA8A8,0xCDCB,0xD3DF, + 0, 0,0xB362, 0,0xD7CF,0xD7D0, 0,0xDBE5, + 0,0xB648,0xB8E6, 0,0xE056,0xE055,0xE057, 0, +0xE451,0xE452,0xBBA8,0xBFDD,0xBDDE,0xBFDE, 0,0xEEB5, +0xEEB2,0xEEB4,0xEEB3,0xC1C7, 0,0xF0EF,0xF346,0xF345, +0xCBA4,0xB05C,0xB05B,0xD3E0, 0,0xD7D1, 0, 0, +0xDBE7,0xDBE6,0xB649, 0,0xE059,0xE05A,0xE058, 0, + 0,0xB8E8,0xB8E7, 0,0xBBAA,0xBBA9, 0,0xE7E7, +0xEBB3,0xEBB1,0xEBB2,0xBFDF,0xEEB7,0xEEB6, 0,0xF0F2, +0xF0F1,0xF0F0,0xF347, 0,0xF9AA,0xA8A9,0xAD73, 0, +0xAD74,0xB05D,0xB05E,0xD3E2,0xD3E1,0xD7D2, 0,0xB368, +0xB366,0xB363,0xB367,0xB365,0xB364, 0, 0,0xB64A, +0xDBEA, 0,0xB8ED,0xB64C,0xB651,0xDBEC,0xB653,0xB652, +0xB655,0xDBEB,0xDBE8,0xB64F,0xB64B,0xB64D,0xDBE9,0xB654, +0xB650,0xB64E,0xB8EF,0xB8EE,0xB8EC,0xB8F0, 0,0xB8EA, +0xB8EB, 0,0xB8E9, 0,0xE05B, 0, 0,0xE454, + 0,0xBBAC,0xBBAD,0xBBAB, 0,0xE453, 0,0xE455, + 0,0xE7EA,0xE7EC, 0,0xBDE7,0xE7ED,0xBDE0,0xE7E9, +0xBDDF,0xBDE9,0xBDE5,0xBDE6,0xBDE2,0xE7E8,0xBDE1,0xE7EE, +0xE7EB, 0,0xBDE8, 0,0xBDE3,0xBDE4,0xEBB5, 0, +0xEBB7,0xEBB6, 0,0xEBB8,0xBFE0,0xEBB4, 0, 0, +0xC1CB,0xEEB8,0xC1C8,0xC1CC,0xC1CA,0xC1C9,0xF0F3, 0, +0xF0F6, 0,0xF0F5, 0,0xF0F4,0xC2D8,0xF348,0xF349, +0xC3D8,0xF34A,0xC3D9, 0, 0,0xC4BA, 0,0xC4B9, +0xF652, 0, 0,0xC542,0xF653,0xF75C,0xC5AB,0xC5AC, + 0,0xF845, 0,0xC642, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA8AA, 0,0xB36A,0xB369, +0xE05C,0xE05D, 0,0xBBAE,0xEBB9,0xBDEA,0xEBBA,0xEEB9, +0xA8AB, 0,0xD0B2,0xAD76,0xAD75, 0,0xD3E3,0xB05F, +0xD3E4,0xD7D5, 0,0xD7D4, 0,0xD7D3, 0, 0, +0xDBEE,0xB658, 0, 0,0xDBED,0xB657, 0, 0, + 0,0xDBEF,0xB656, 0,0xE05F,0xE062,0xE060,0xE061, +0xE065,0xE05E,0xE066,0xE063,0xE064,0xBBB0,0xE456, 0, + 0,0xBBAF, 0,0xE7F2,0xE7F0, 0, 0,0xBDEB, +0xE7EF,0xE7F1, 0,0xBDEC, 0,0xEBBB, 0,0xEBBC, +0xC1CD, 0,0xF34C,0xF34E,0xF34B,0xF34D,0xF4D6,0xF654, + 0, 0,0xF96F,0xA8AC,0xAD77,0xD3E5,0xD3E7,0xD3E6, + 0,0xD7D8,0xB36C, 0,0xD7D6, 0,0xB36B,0xD7D9, + 0,0xD7DA,0xD7D7, 0, 0,0xDBFB,0xB660,0xDBF3, +0xDBF9, 0, 0,0xB65B,0xB65E,0xDBF2,0xB659,0xDBF6, +0xE06C,0xB65D, 0,0xDBF1, 0,0xDBF7,0xDBF4,0xDBFA, +0xDBF0,0xDBF8,0xB65C,0xB65F,0xDBF5,0xB65A, 0,0xB8F2, +0xE068,0xB8F1,0xE06F,0xE06E,0xB8F8, 0,0xB8F9,0xE070, +0xB8F3,0xE06D,0xB8F7,0xE072,0xE069, 0,0xE06B,0xB8F4, +0xE067,0xE06A,0xE071,0xB8F5,0xE073, 0, 0, 0, + 0, 0,0xB8F6, 0,0xBBB1,0xE45B,0xE461,0xE459, +0xE462, 0,0xE458,0xE45D,0xE463,0xE460,0xE45F,0xE45E, + 0,0xE457,0xE45C, 0, 0,0xE45A, 0,0xBDF1, +0xBDEE,0xE7FB,0xE841,0xE843,0xE840,0xE7F8,0xE7FA,0xE845, +0xE842,0xE7FC,0xE846,0xE7F9,0xE844,0xBDEF,0xBDF5,0xBDF3, +0xE7F3,0xBDF4,0xBDF0,0xE7F4,0xE7F6,0xE7F5,0xE7FD,0xE7FE, + 0,0xBDF2, 0,0xBDED, 0, 0,0xE7F7, 0, +0xEBC6,0xBFE2, 0,0xEBBD,0xBFE3,0xBFE6,0xEBC2, 0, +0xEBBF,0xBFE5, 0, 0,0xEBC3,0xEBC4,0xEBBE,0xEBC7, +0xEBC0,0xEBC5,0xBFE4, 0,0xBFE1,0xEBC1, 0,0xEEBF, +0xC1D0,0xC1CE,0xC1D1,0xC1CF,0xEEBE,0xEEBB,0xEEBA, 0, +0xEEBD, 0, 0,0xEEBC,0xF145,0xC2DE,0xF0FB,0xF0FA, + 0,0xC2D9,0xF141,0xF140,0xF0F7,0xF143,0xF0FC,0xC2DD, +0xF0F9,0xF142,0xF0F8,0xC2DA,0xC2DC,0xF0FD,0xC2DB,0xF0FE, + 0,0xF144,0xF352, 0,0xC3DE,0xF34F, 0,0xF353, + 0, 0,0xC3DB,0xF351,0xC3E0, 0,0xC3DD, 0, +0xF350, 0,0xC3DF,0xF354,0xC3DA, 0, 0, 0, + 0,0xC4BC,0xC4BE, 0,0xF4D9,0xC4BD,0xF4D7,0xC3DC, +0xF4D8,0xC4BB,0xC543,0xC545,0xF656,0xC544,0xF655, 0, +0xF761,0xC5AD,0xF760,0xC5AE,0xF75E,0xF75D,0xF762,0xF763, +0xF846, 0,0xF75F, 0, 0,0xF8C6,0xF8C3,0xF8C4, +0xF8C5,0xC65C, 0,0xF951,0xF950,0xF94F,0xF970, 0, +0xF9BE,0xF9AB,0xC66E,0xA8AD,0xB060, 0, 0, 0, + 0, 0,0xB8FA, 0, 0, 0, 0, 0, + 0, 0,0xBDF6, 0, 0,0xEBC8, 0, 0, +0xC2DF, 0,0xF355, 0, 0, 0, 0, 0, + 0,0xF9AC,0xA8AE,0xAAEE,0xAD79,0xAD78, 0,0xB063, + 0,0xD3E8,0xB061,0xD3E9,0xB062, 0, 0,0xD7DF, +0xD7DB, 0, 0,0xB36D,0xD7DE,0xD7DD,0xD7DC,0xB36E, +0xD7E0,0xD7E1, 0, 0, 0,0xDC43,0xDC41,0xDC45, +0xDC46,0xDC4C, 0,0xDC48,0xDC4A, 0,0xDC42,0xDBFC, + 0,0xDC49, 0, 0,0xDC4B,0xDC44,0xDC47,0xDBFD, +0xB662,0xDC40,0xDBFE,0xB661,0xB663, 0,0xB8FD,0xE075, +0xE077,0xE076,0xE07B,0xB8FB, 0,0xE078,0xE074,0xE079, +0xE07A,0xB8FC,0xB8FE,0xE07C, 0,0xE467,0xE466, 0, +0xE464,0xE465,0xBBB3,0xBBB5,0xBBB2,0xBBB4,0xE84D,0xE84E, +0xE849, 0,0xE84A,0xBDF8,0xBDFD,0xBDF7,0xBDFE,0xBDF9, +0xE84B, 0, 0,0xE84C,0xE848,0xBE40,0xBDFB, 0, + 0,0xBDFA,0xBDFC, 0,0xE847, 0,0xEBCA,0xBFE8, + 0, 0,0xEBCC,0xBFEA,0xEBCF,0xEBCB,0xEBC9,0xEBCE, +0xBFE9,0xEBCD, 0,0xBFE7, 0, 0,0xC1D3,0xC1D6, +0xEEC1, 0,0xC1D4,0xEEC0,0xC1D2,0xC1D5,0xF146,0xF147, +0xF148,0xC2E0, 0,0xF149, 0,0xC2E1,0xC3E2,0xF358, +0xF359,0xF357,0xF356,0xF35A,0xC3E1,0xF4DD,0xF4DB,0xF4DC, +0xF4DE,0xF4DA,0xF4DF,0xF658, 0,0xF659,0xF657,0xC546, +0xF764,0xC5AF,0xF765,0xF848,0xF847, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA8AF,0xB664, 0, 0,0xB940, + 0, 0, 0,0xBBB6, 0, 0,0xBFEC, 0, +0xBFEB, 0, 0, 0, 0,0xC3E3,0xC47C,0xC547, +0xA8B0,0xB064,0xB941, 0,0xF35B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCBA6, + 0, 0,0xA8B1, 0,0xA8B4,0xA8B3,0xA8B2, 0, + 0,0xCBA5, 0,0xCDCD, 0,0xCDCF,0xAAEF, 0, + 0,0xAAF1,0xCDCC,0xCDCE,0xAAF0,0xCDD1,0xCDD0,0xCDD2, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD0B6,0xD0B4,0xAD7C,0xD0B3,0xADA3,0xAD7E,0xAD7B, 0, +0xADA4, 0,0xAD7D,0xADA2, 0,0xADA1,0xD0B5, 0, +0xAD7A, 0, 0, 0,0xB06A,0xD3EB,0xD3F1,0xB067, +0xB06E, 0,0xB069,0xD3EE,0xD3F0,0xB06C,0xD3EA,0xD3ED, +0xB068,0xB065,0xD3EC,0xB06B,0xD3EF,0xB06D,0xB066, 0, + 0, 0, 0,0xD7E3,0xD7E6,0xB370, 0,0xB37A, +0xB376,0xD7E4, 0, 0,0xB37E,0xB377,0xB37C,0xB372, + 0,0xB36F,0xB371,0xB37D,0xD7E5,0xB375,0xB378,0xB374, +0xB379,0xD7E7,0xB37B,0xB373,0xD7E2, 0, 0, 0, + 0, 0, 0, 0, 0,0xDC4D,0xB665,0xDC4F, + 0,0xB667,0xB669, 0,0xDC4E,0xB666,0xB66A, 0, +0xB668, 0, 0, 0,0xB947,0xE0A3,0xB94F,0xE07E, + 0,0xB950,0xB945, 0,0xE0A1, 0, 0,0xB94A, + 0,0xE0A2,0xB943,0xB942, 0,0xB94D,0xB94C,0xB94B, +0xB949,0xB94E,0xE07D,0xB944,0xB946,0xB948, 0, 0, +0xBBB8,0xBBBB, 0,0xBBBF,0xBBB9,0xBBBE,0xBBBC, 0, +0xBBB7, 0,0xBBBD,0xBBBA, 0, 0, 0,0xE852, +0xBE43,0xBE41, 0,0xE853, 0,0xBE44,0xBE42,0xE851, +0xE850, 0,0xBFF0,0xE84F,0xBFEE,0xBFED,0xEBD0,0xBE45, +0xBFEF,0xEBD1,0xBFF2,0xEBD2,0xBFF1,0xC1D8,0xEEC3,0xC1D7, +0xC1DC,0xC1DA,0xC1DB,0xC2E3,0xC1D9,0xEEC2,0xEBD3,0xC2E2, +0xC2E4, 0,0xC3E4,0xC3E5, 0,0xF4E0, 0,0xC5DE, +0xC5DD,0xA8B6, 0, 0,0xCA55,0xB06F, 0,0xCA52, +0xCA53,0xCA51, 0,0xCA54, 0, 0,0xCBAA,0xCBA7, +0xCBAC,0xCBA8,0xA8B7,0xA8BA, 0,0xCBA9,0xA8B9,0xCBAB, + 0, 0,0xA8B8, 0, 0, 0, 0,0xCDD5, +0xCDD7,0xAAF4,0xCDD3,0xCDD6,0xCDD4,0xAAF2,0xAAF5, 0, +0xAAF3, 0, 0, 0, 0,0xD0B8,0xD0BC,0xD0B9, + 0,0xADA7, 0,0xADA8, 0,0xD0BB, 0,0xD0BD, +0xD0BF, 0,0xADA5,0xD0BE, 0, 0,0xADA6, 0, + 0, 0, 0, 0,0xD7EE,0xD0BA,0xD3F2,0xD3FB, +0xD3F9,0xD3F4,0xD3F5,0xD3FA,0xD3FC,0xB071, 0,0xD3F7, +0xD3F3,0xB070,0xB072,0xD3F6,0xD3FD,0xD3F8, 0, 0, +0xB3A1,0xD7F1,0xD7E9,0xD7EF,0xD7F0,0xB3A2, 0,0xD7E8, +0xD7EA,0xD0B7,0xD7EC,0xD7ED,0xD7EB,0xB66C, 0, 0, + 0,0xDC56,0xEBD4,0xDC57,0xDC54,0xB3A3,0xB66E,0xDC53, +0xDC59,0xDC58,0xB66B,0xDC5C,0xDC52,0xDC5B,0xDC50,0xDC5A, +0xDC55,0xB66D, 0,0xE0AA, 0,0xE0A5,0xE0AB,0xE0A6, +0xE0A4,0xE0A7,0xB951, 0,0xE0A9, 0,0xE0A8,0xB952, +0xBBC1,0xBBC0,0xE46E,0xE471,0xE469,0xE46D,0xBBC2,0xE46C, +0xE46A,0xE470,0xE46B,0xE468,0xE46F, 0,0xE859,0xBE48, +0xF14A,0xE856,0xE857,0xE855,0xDC51,0xBE47,0xE85A,0xE854, +0xBE46,0xBE49,0xE858,0xEBD5,0xBFF3,0xEBD6,0xEBD7, 0, +0xEEC4,0xC1DD,0xF14B,0xF14C, 0, 0,0xF14D,0xF35D, +0xF35C,0xF4E2, 0,0xF4E1,0xF65B,0xF65C,0xF65A,0xF766, +0xC5B0,0xA8BB,0xADAA,0xADA9,0xB075,0xB074,0xD440,0xD441, +0xD3FE, 0,0xB073,0xD7F5, 0,0xD7F6,0xD7F2,0xB3A4, +0xD7F3, 0,0xD7F4, 0, 0, 0, 0,0xDC5F, +0xDC61,0xDC5D,0xDC60,0xB66F,0xDC5E,0xB670, 0, 0, +0xDD73,0xB955,0xB954, 0,0xB953, 0,0xE0AC,0xE0AD, + 0, 0,0xE473,0xE475,0xBBC6,0xBBC3, 0,0xBBC5, +0xBBC4,0xE474,0xE472, 0, 0, 0, 0, 0, +0xE861,0xE85E,0xE85F,0xBE4D,0xE860,0xE85B,0xE85C,0xBE4A, + 0,0xBE4B,0xE85D,0xBE4C, 0,0xEBDB, 0,0xEBDC, +0xEBD9,0xEBDA,0xBFF4,0xEBD8, 0, 0, 0, 0, + 0,0xEEC8,0xEEC5,0xEEC7,0xC1E0,0xEECB,0xC1DF,0xEEC9, +0xEECC,0xEECA,0xEEC6,0xC1DE, 0,0xF14F, 0,0xF150, +0xF14E, 0,0xF152,0xC2E5,0xC2E6,0xF35F,0xC3E7,0xF151, +0xF35E,0xC3E6,0xF4E5,0xF4E6,0xC4BF,0xF4E4, 0,0xF4E3, + 0,0xF65D,0xC548, 0,0xF849,0xF8C8,0xF8C7, 0, +0xC643,0xC65D,0xF8C9,0xF971, 0,0xC66F,0xA8BC,0xAAF6, + 0,0xB956, 0,0xC4C0,0xA8BD,0xADAB,0xB3A5,0xB671, +0xC2E7,0xAAF7, 0,0xD0C1,0xD0C0,0xD442, 0,0xB078, +0xB076,0xB07A,0xD444, 0,0xB079,0xB077, 0, 0, + 0, 0,0xD443,0xB3A8,0xD7FC, 0,0xB3A7,0xB3A9, +0xD842,0xB3AB,0xD7FE,0xD840,0xD7F7,0xB3AA,0xD843, 0, + 0,0xD7F9, 0,0xD7FA,0xD7F8,0xB3A6, 0,0xD841, +0xD7FB,0xD7FD, 0, 0, 0,0xDC6D, 0,0xDC6C, +0xDC6A,0xDC62,0xDC71,0xDC65,0xDC6F,0xDC76,0xDC6E,0xB679, + 0,0xB675,0xDC63, 0,0xDC69,0xB677, 0,0xDC68, +0xB678,0xB67A,0xDC6B, 0,0xB672,0xB673,0xDC77,0xDC75, + 0,0xDC74,0xDC66, 0,0xDC72, 0,0xB676, 0, + 0, 0, 0,0xB674,0xDC73,0xDC64,0xDC67,0xDC70, + 0, 0, 0, 0, 0,0xE4BA,0xE0B7, 0, +0xE0B0,0xE0C3,0xE0CC,0xE0B3,0xB961, 0,0xE0C0,0xB957, +0xB959,0xB965,0xE0B1, 0, 0,0xB95A,0xB95C,0xB966, +0xB95B, 0, 0, 0, 0,0xB964,0xE0B9, 0, +0xE0AE,0xB962,0xE0B8,0xB95E,0xE0CA,0xB963,0xE0C8,0xE0BC, +0xE0C6,0xB960,0xE0AF,0xE0C9,0xE0C4, 0,0xE0CB,0xB958, + 0, 0,0xB967,0xB95D, 0, 0,0xE0B5, 0, +0xE0BD,0xE0C1, 0,0xE0C5,0xB95F,0xE0B4,0xE0B2,0xE0BE, + 0, 0, 0, 0,0xE0BB,0xE0BA, 0,0xE0BF, +0xE0C2, 0,0xE0C7, 0, 0, 0,0xE478, 0, +0xBBC7,0xE4A4,0xE47A,0xBBCC,0xBBD0,0xE4AD,0xE4B5,0xE4A6, +0xBBC8, 0,0xE4AA,0xE0B6, 0,0xBBC9,0xE4B1,0xE4B6, +0xE4AE, 0,0xE4B0,0xE4B9,0xE4B2,0xE47E,0xE4A9, 0, + 0,0xBBD1, 0,0xBBCD,0xE47C,0xE4AB,0xBBCB,0xE4A5, +0xBBCA,0xE4B3,0xE4A2,0xE479,0xBBCE,0xE4B8, 0, 0, +0xE47B,0xE4AF,0xE4AC,0xE4A7,0xE477,0xE476,0xE4A1,0xE4B4, +0xBBCF,0xE4B7,0xE47D,0xE4A3,0xBE52, 0, 0, 0, + 0, 0,0xBE5A,0xBE55,0xE8A4,0xE8A1,0xE867,0xBE50, + 0,0xF9D7, 0,0xBE4F,0xBE56, 0, 0, 0, +0xE865,0xBE54,0xE871,0xE863,0xE864,0xBE4E,0xE8A3,0xBE58, +0xE874,0xE879,0xE873,0xEBEE,0xE86F,0xE877,0xE875,0xE868, +0xE862,0xE87D,0xBE57,0xE87E, 0,0xE878, 0,0xE86D, +0xE86B,0xE866, 0, 0, 0,0xE86E,0xE87B,0xE86A, +0xE87A,0xE8A2, 0, 0,0xBE53, 0,0xE876,0xE87C, +0xE872,0xE86C,0xBE51, 0, 0, 0,0xE4A8,0xE870, +0xBE59,0xE869, 0, 0, 0, 0, 0,0xEBF4, +0xBFF7,0xEBF3,0xEBF0,0xEC44,0xBFFB, 0,0xEC41,0xEBF8, +0xEC43,0xEBE9,0xEBF6, 0,0xBFFD, 0,0xEBE1, 0, +0xEBDF,0xEC42, 0,0xEC40,0xEBFE,0xEBED,0xEBEC,0xEBE2, +0xC040, 0,0xEBE8,0xEBF2,0xEBFD,0xC043,0xEC45, 0, +0xC1E8,0xC045,0xBFFE,0xEBE6, 0,0xEBEF,0xEBDE,0xEBE0, +0xBFF5,0xC042,0xBFFA,0xEBE7,0xEBF7,0xEBF1,0xC041,0xEBDD, +0xC1E3,0xEBF9,0xEBFC,0xBFFC, 0,0xEBEB,0xC044,0xBFF9, + 0, 0, 0,0xBFF8,0xEBF5,0xEBFB,0xBFF6, 0, +0xEBE4,0xEBFA, 0, 0,0xEBE5, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xEBEA,0xEED2, + 0,0xEED7,0xC1E5,0xC1E7,0xEEDD,0xC1E1,0xEEEC,0xEEE3, +0xEED8,0xEED9,0xEEE2, 0,0xC1EE,0xEEE1,0xEED1,0xEEE0, +0xEED4,0xEEED,0xC1ED,0xC1EB,0xEED5, 0,0xEEE8, 0, +0xEEDA,0xEEE7, 0,0xEEE9,0xEED0,0xC1E6, 0,0xEEEA, + 0, 0,0xEEDE, 0,0xC1EA,0xEEDB, 0, 0, +0xC1EC,0xEEE4, 0, 0, 0,0xC1E4,0xEED6,0xEEE5, + 0,0xEEDF,0xEBE3,0xEEE6,0xEED3, 0,0xC1E9, 0, +0xEEEB, 0,0xC1E2,0xEECE, 0, 0, 0, 0, +0xF160,0xF159,0xC2E9, 0,0xF154,0xF163,0xF15B,0xEEDC, + 0,0xF165,0xF155, 0,0xC2E8,0xF15F,0xC2EA,0xC2F2, +0xC2F0,0xF161,0xC2F1,0xF157, 0,0xF158,0xF15D,0xF162, + 0,0xEECD,0xC2EB,0xF16A,0xF167,0xF16B,0xF15E,0xF15A, +0xF168,0xF36A,0xF15C, 0,0xC2EE, 0,0xC2ED,0xEECF, +0xC2EF,0xF164,0xF166,0xC2EC,0xF169,0xF153, 0,0xF156, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF373, 0,0xF363,0xC3EB,0xF371, 0, 0,0xF361, +0xC3EC, 0,0xF36C, 0,0xF368,0xC3F1,0xF372,0xF362, +0xF365,0xC3E9,0xF374, 0,0xF36D,0xF370,0xC3EF,0xC3F4, +0xC3F2,0xF369,0xF364, 0,0xC3ED,0xC3EE,0xF360,0xC3EA, + 0,0xC3E8,0xC3F0,0xF36F,0xC3F3, 0,0xF36B,0xF375, +0xC3F5, 0, 0, 0,0xF367, 0,0xF36E, 0, + 0, 0, 0, 0, 0,0xF4F3,0xF542,0xF4F5, +0xF4FC,0xF366,0xF4FA,0xF4E9,0xF540,0xC4C3,0xF4ED,0xF4FE, +0xF4F4, 0, 0,0xC4C2, 0, 0,0xF544,0xF4F6, + 0,0xF4FB,0xF4FD,0xF4E7,0xF541,0xF4F2,0xF4F7,0xF4EB, +0xF4EF,0xF543,0xF4F9,0xF4E8,0xF4EC,0xF4EE,0xF4F8, 0, +0xC4C1,0xF4F1, 0, 0, 0, 0, 0, 0, +0xF4EA, 0, 0, 0, 0, 0, 0, 0, +0xF4F0,0xF661,0xF666,0xC54F,0xF668, 0,0xC549, 0, +0xF664,0xF66A,0xC54E,0xC54A, 0,0xC54B,0xF660,0xF667, +0xC54D,0xF665,0xC54C,0xF65F,0xF663,0xF662, 0,0xF65E, +0xF669, 0, 0, 0,0xC5B1,0xF76D,0xF770,0xF76C, +0xF76E,0xF76F,0xF769,0xF76A,0xF767, 0, 0,0xF76B, +0xF768,0xC5B2,0xC5B3, 0, 0,0xF84B, 0,0xF84D, + 0, 0, 0, 0, 0,0xF84C,0xF84E, 0, +0xC5E0, 0,0xF84A,0xC5DF,0xC5E1, 0, 0, 0, +0xF8CB,0xF8CC,0xC644,0xF8CA, 0,0xF953,0xF952,0xF954, +0xC65F,0xF955,0xC65E,0xF956,0xF972,0xF975,0xF974,0xC668, +0xF973, 0, 0, 0,0xC672,0xC670,0xC671,0xC677, +0xF9C0,0xF9C1,0xF9BF,0xF9C9}; + +/* page 8 0x9577-0x9FA4 */ +static uint16 tab_uni_big58[]={ +0xAAF8, 0, 0,0xD844,0xDC78,0xE8A5,0xF376, 0, + 0,0xAAF9, 0,0xADAC,0xB07B, 0, 0,0xD845, + 0,0xD846,0xB3AC, 0,0xB67D,0xDC7A,0xDC79,0xB6A3, +0xB67C,0xDC7B,0xB67E,0xB6A2,0xB6A1,0xB67B, 0, 0, + 0,0xB968, 0, 0,0xE0D0,0xE0CE, 0,0xE0CF, +0xE0CD, 0,0xBBD2, 0,0xBBD5,0xBBD7,0xBBD6, 0, + 0,0xBBD3,0xBBD4, 0,0xE8A7,0xE8A6,0xBE5B,0xE8A8, + 0,0xE8A9,0xBE5C, 0, 0, 0,0xEC4D,0xEC4B, +0xEEF3, 0,0xEC49,0xEC4A,0xC046,0xEC46,0xEC4E,0xEC48, +0xEC4C,0xEEEF, 0, 0,0xEEF1, 0,0xEEF2,0xC1F3, +0xEEEE,0xC1F2,0xEEF0,0xC1EF,0xC1F0,0xC1F1,0xEC47, 0, + 0,0xC2F5,0xF16E,0xF16C,0xF16D,0xC2F3,0xC2F6,0xC2F4, + 0, 0, 0,0xF377,0xF378,0xC3F6, 0,0xF545, +0xF547,0xF546,0xC4C4,0xC550,0xF66D,0xF66C,0xF66B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xAAFA, 0,0xC9AA, + 0,0xCA58,0xA6E9,0xCA56,0xCA59,0xCA57, 0, 0, + 0,0xCBAE, 0,0xA8C1, 0,0xA8C2,0xCBB0,0xA8BF, +0xCBAF,0xCBAD,0xA8C0,0xA8BE, 0, 0, 0, 0, + 0, 0,0xCDD8,0xCDDB,0xAAFD,0xCDDA,0xCDD9, 0, +0xAAFC,0xAAFB, 0,0xAB40,0xCDDC,0xAAFE, 0, 0, + 0, 0, 0,0xD0C6,0xADAE,0xADAF,0xADB0,0xD0C7, +0xD0C3,0xADAD,0xD0C4, 0,0xD0C5,0xD0C2, 0, 0, + 0,0xB0A4, 0, 0,0xB0A1,0xD445,0xB0A2,0xB0A5, +0xD446, 0,0xB07E,0xB07C,0xB07D,0xB0A3, 0, 0, + 0, 0, 0,0xB3AD,0xD849,0xB3B5,0xD848, 0, +0xD84B,0xB3B1,0xD84A,0xB6AB,0xB3AF,0xB3B2,0xB3AE,0xB3B3, +0xB3B4,0xB3B0, 0, 0, 0,0xD847,0xB6A7,0xDC7D, + 0,0xDCA3, 0, 0,0xDCA2,0xB6AC,0xB6A8,0xB6A9, +0xDC7C,0xDC7E,0xDCA1,0xB6A4,0xB6A6, 0,0xB6AA,0xB6A5, + 0, 0,0xE0D3,0xE0D1,0xE0D2,0xB96A,0xB96B, 0, +0xE0D4,0xB969,0xBBD8, 0,0xBBDA,0xBBD9, 0,0xE4BB, + 0, 0,0xE4BC,0xE8AB, 0,0xE8AA, 0, 0, +0xC047,0xC048,0xEC4F,0xC049, 0,0xEEF6, 0,0xEEF4, + 0,0xEEF5,0xC1F4, 0,0xF16F,0xC3F7, 0, 0, + 0,0xC1F5,0xAB41, 0,0xB0A6,0xD447, 0, 0, +0xD84C,0xB3B6,0xB6AD,0xDCA4,0xDCA6,0xB6AF,0xB6AE,0xB6B0, +0xB6B1,0xDCA5,0xB96E,0xB96F,0xB96D,0xBBDB,0xB96C,0xE0D5, + 0, 0, 0,0xBBDC,0xE8AC,0xEC50,0xC04A,0xC1F6, +0xF170,0xF174,0xC2F9,0xF171,0xC2FA,0xC2F8,0xF175,0xC2FB, +0xF173, 0,0xF379,0xC2F7,0xC3F8, 0,0xF8CD, 0, + 0,0xAB42,0xB3B8,0xB3B7, 0, 0, 0, 0, +0xB6B2,0xDCA8,0xDCA7,0xB6B3, 0, 0,0xE0D9,0xB973, +0xB970,0xE0D8,0xB972,0xE0D6,0xB971, 0,0xE0D7, 0, +0xE4BD,0xBBDD, 0,0xE8AF, 0,0xBE5D,0xE8AD,0xBE5E, +0xBE5F,0xE8AE,0xBE60, 0,0xEC51, 0,0xC04E,0xC04B, +0xC050,0xEC53,0xC04C,0xEC52,0xC04F, 0, 0,0xC04D, + 0,0xEEF9,0xEEFB, 0, 0,0xC1F7,0xEEFA,0xC1F8, +0xEEF8,0xEEF7, 0,0xF177,0xF176,0xC2FC,0xF178,0xF37E, +0xC3FA,0xF37D,0xF37A,0xC3F9,0xF37B,0xF37C, 0,0xF548, +0xF549,0xC4C5, 0,0xC553, 0, 0,0xF66E, 0, + 0,0xC551,0xC552,0xF66F, 0, 0,0xC5B4,0xC5B5, +0xF771, 0, 0,0xC645,0xF8CF,0xC647, 0,0xF8CE, +0xF8D0,0xC646,0xF957, 0,0xF9AD, 0, 0, 0, + 0, 0, 0,0xAB43, 0, 0, 0,0xB974, + 0,0xE4BE, 0,0xE8B0,0xC051,0xC052, 0,0xAB44, + 0,0xBE61,0xC3FB,0xADB1, 0, 0, 0,0xC053, + 0,0xC5E2,0xADB2,0xD84D, 0,0xDCA9, 0,0xDCAB, + 0,0xDCAA, 0,0xE0DD,0xE0DA,0xB975, 0,0xB976, +0xE0DB,0xE0DC, 0,0xE4C0,0xE4C5,0xBBDE,0xE4BF,0xE4C1, +0xE4C8,0xE4C3,0xE4C7,0xE4C4,0xE4C2,0xE4C6,0xBBDF, 0, + 0,0xE8B3, 0,0xE8B1,0xBE63, 0,0xBE62,0xE8B2, +0xBE64, 0, 0, 0, 0,0xEC56, 0, 0, +0xEC55,0xC054,0xEC54,0xEEFC, 0,0xEEFE,0xEF41,0xEF40, + 0,0xC1F9,0xEEFD,0xF1A1,0xC2FD,0xF17D,0xF1A2,0xC2FE, + 0,0xF17B, 0,0xF17E,0xF17C,0xF179,0xC340,0xF17A, + 0, 0, 0, 0,0xF3A1, 0, 0,0xF3A3, +0xF3A2, 0,0xF54A, 0,0xF54B, 0, 0, 0, +0xF670, 0,0xC5B7, 0,0xC5B6,0xF84F,0xF850,0xC648, +0xF8D1, 0,0xC669, 0,0xADB3,0xB6B4,0xE4CA,0xE4C9, +0xE8B5,0xE8B4, 0, 0,0xC1FA,0xEF43,0xEF42,0xF1A5, +0xF1A3,0xF1A6,0xF1A4, 0, 0,0xC3FC,0xF3A4,0xF3A5, +0xF3A6, 0,0xF671, 0,0xF772, 0,0xF8D2, 0, + 0, 0, 0, 0, 0, 0,0xADB4, 0, + 0,0xEC57,0xEF44, 0,0xADB5, 0, 0,0xBBE0, + 0,0xEC58,0xC341,0xF1A7,0xC3FD, 0,0xF54C,0xF54D, +0xC554,0xF851,0xADB6,0xB3BB,0xB3BC,0xD84E,0xB6B5,0xB6B6, +0xDCAC,0xB6B7, 0,0xB97A, 0,0xB97C,0xE0DF,0xE0E0, +0xE0DE,0xB977,0xB978,0xB97B,0xB979, 0, 0,0xE4CB, +0xBBE1,0xBBE2, 0, 0,0xE8BC,0xBE67,0xE8B7,0xE8B6, + 0,0xE8BB,0xBE65, 0, 0,0xC05B, 0,0xE8B8, +0xE8BD,0xE8BA,0xE8B9, 0,0xBE66, 0,0xC059, 0, +0xEC5A,0xC055, 0,0xEC5B, 0, 0,0xEC59, 0, +0xC058,0xC056,0xC05A, 0,0xC057, 0, 0, 0, + 0, 0,0xEF45, 0,0xEF4A,0xEF46,0xEF49,0xC1FB, + 0,0xEDD4,0xEF48,0xEF47, 0,0xC344,0xC342,0xC345, +0xC343,0xF1A8,0xF1A9,0xF1AA,0xC346, 0, 0, 0, +0xF3AA,0xC440,0xF3A8, 0,0xC441,0xF3A7,0xF3A9,0xC3FE, +0xF551,0xF54E, 0,0xF54F,0xF550,0xF672,0xC556, 0, +0xC555, 0,0xF774,0xF773,0xC5B8, 0, 0, 0, +0xC5E3,0xC649,0xC660,0xF958,0xF9AE,0xF9AF, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xADB7,0xDCAD, 0, 0,0xE0E1,0xE4CC,0xE4CD, +0xBBE3, 0,0xBBE4,0xE8BE,0xBE68, 0, 0,0xC1FC, + 0,0xF1AB, 0,0xC347,0xF3AD,0xC442,0xF3AC,0xF3AE, +0xF3AB,0xF675,0xF552,0xF553, 0,0xC4C6, 0,0xF674, + 0, 0,0xF673, 0,0xF775,0xF9B0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xADB8, 0, 0, 0, +0xADB9, 0, 0,0xB0A7,0xD448, 0,0xD84F, 0, +0xB6B8, 0,0xB6BB,0xB6B9,0xDCAE, 0,0xB6BD, 0, +0xB6BA, 0, 0,0xB6BC, 0,0xB97E, 0,0xE0E2, + 0, 0,0xE0E3,0xE8C0, 0,0xB97D,0xB9A1,0xB9A2, + 0,0xE4CF, 0,0xE4CE,0xBBE5, 0,0xBBE6, 0, +0xE4D0,0xE8BF,0xBBE8,0xBE69, 0,0xBBE7, 0, 0, + 0,0xC05C,0xE8C1,0xBE6B,0xBE6A,0xE8C2,0xE8C5,0xE8C3, +0xE8C4,0xBE6C, 0,0xC061,0xC05F, 0, 0,0xC05E, +0xEC5D, 0,0xC060, 0, 0,0xEC5C,0xEF4B, 0, +0xEC5E,0xC05D,0xEC5F,0xEF4E,0xEF4C,0xEF4D,0xEF52,0xC34B, +0xEF51,0xEF54,0xEF53,0xEF50,0xEF4F, 0,0xC1FD, 0, + 0, 0, 0,0xF1AE, 0,0xF1AD,0xC34A,0xC348, +0xC349, 0,0xF1AC, 0,0xF3B1, 0,0xC443, 0, +0xF3B0,0xF3AF,0xC444, 0,0xF558,0xF557, 0,0xF555, + 0,0xF554,0xC4C8,0xC4C7,0xF559,0xF776,0xC5B9,0xF677, +0xC557,0xF676,0xF556, 0,0xF777,0xC5E4, 0,0xC661, +0xF959, 0,0xF9B1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xADBA, +0xD850,0xEF55,0xADBB, 0, 0,0xE4D2,0xE4D1,0xEC60, + 0, 0,0xEF57, 0,0xEF56, 0,0xC34C,0xF3B2, +0xF3B3,0xC4C9, 0, 0,0xF9B2,0xB0A8,0xB6BF,0xB6BE, +0xE0E4,0xE0E6,0xB9A4,0xE0E5,0xB9A3,0xB9A5,0xE0E7, 0, + 0, 0,0xE4D4,0xE4D6,0xE4D5, 0,0xE4D8, 0, + 0, 0,0xBBE9,0xE4D7,0xE4D3, 0, 0, 0, +0xE4D9, 0,0xE8CC, 0,0xE8CF,0xE8D1,0xE8C7,0xE8CB, +0xE8C8,0xBE6E,0xBE71,0xBE73,0xE8C9,0xE8CA,0xBE72,0xE8CD, +0xE8D0,0xE8CE,0xBE74, 0,0xBE70,0xE8C6,0xBE6D, 0, +0xBE6F, 0, 0,0xC063,0xEC66,0xEC64,0xEC63, 0, +0xEC69, 0,0xEC68,0xEC67, 0,0xEC62,0xC062,0xEC61, + 0,0xEC65,0xC064, 0, 0,0xEF5A, 0,0xEF5E, +0xEF5B,0xEF5D,0xEF5C,0xEF59,0xEF5F,0xEF62,0xEF60,0xEF61, +0xC240, 0,0xC1FE,0xEF58,0xEF63,0xF1B3,0xF1B6,0xF1B8, +0xF1B7, 0,0xF1B1,0xF1B5,0xF1B0, 0,0xF1B2,0xC34D, +0xF1AF, 0,0xF1B4, 0, 0,0xF3C0,0xF3B5,0xC445, + 0, 0,0xC446,0xF3B4,0xF3B9,0xF3BF,0xF3B7,0xF3BE, + 0,0xF3BB, 0,0xF3BA,0xF3BD,0xF3B8,0xF3B6, 0, +0xF3BC, 0,0xF560,0xF55E,0xC4CA,0xF55D,0xF563,0xF561, + 0,0xC4CB,0xF55C,0xF55A, 0,0xF55B,0xC4CD,0xF55F, +0xC4CC,0xF562,0xF678,0xF67E, 0, 0,0xF679,0xC55B, +0xF6A1,0xC55A,0xF67D,0xF67C,0xC559,0xF67B,0xC558,0xF67A, + 0,0xF77D,0xF7A1,0xF77E, 0,0xF77B,0xC5BB,0xF778, +0xF77C,0xF7A3, 0,0xF7A2,0xF779,0xF77A,0xC5BA,0xF852, +0xC5E7, 0,0xF853,0xC5E5,0xC5E6, 0, 0,0xF8D3, +0xC64A,0xF976, 0,0xC66A, 0,0xF9B3,0xC66B,0xF9B4, +0xF9B5,0xF9C3,0xF9C2,0xC67A,0xF9CD, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xB0A9, 0, 0,0xE0E9, 0,0xE0E8, 0, +0xBBEA,0xBBEB,0xE4DA, 0,0xE8D2,0xEC6C, 0, 0, +0xBE75,0xC065,0xEC6A, 0,0xEC6D,0xC066, 0,0xEF64, +0xEC6B,0xF1B9,0xC34E,0xF3C1, 0, 0, 0,0xF566, +0xF564, 0, 0,0xF565, 0, 0,0xF6A2, 0, +0xC55C,0xF7A4,0xC5EA,0xC5BC,0xC5E8,0xC5E9,0xF8D4,0xC662, + 0,0xB0AA, 0, 0, 0,0xF1BA, 0, 0, +0xD449, 0,0xB9A6, 0,0xE4DB, 0, 0,0xBBEC, +0xE4DC, 0, 0, 0,0xE8D4,0xE8D3,0xC068,0xBE76, +0xBE77, 0,0xE8D7,0xE8D6,0xE8D5, 0, 0,0xEC6E, +0xEC71, 0,0xEC70,0xEC6F,0xC067,0xEF68,0xEF66,0xEF65, + 0, 0,0xEF67, 0,0xC34F,0xF1BC,0xF1BD,0xC350, + 0,0xF1BB, 0,0xF3C3,0xF3C2,0xF3C5,0xC447,0xF3C4, + 0,0xF567,0xF569,0xF568, 0, 0,0xF6A3,0xF6A6, +0xF6A4,0xF6A5,0xF7A5,0xC5BD, 0, 0, 0,0xF854, +0xF855,0xF856, 0,0xC64B,0xC663,0xF9B6,0xB0AB, 0, +0xBE78,0xC069,0xF1BE, 0,0xF7A6, 0, 0,0xF9C4, +0xD44A, 0,0xC67B,0xB0AC,0xEC72, 0,0xF1BF, 0, +0xF3C6, 0, 0,0xF6A7,0xF7A7,0xB0AD, 0,0xE4DD, +0xE4DE, 0,0xBBED,0xBBEE,0xE8D9,0xBE7A,0xBE79,0xE8D8, + 0,0xEF69, 0,0xF1C0,0xF1C2,0xF1C1,0xC353,0xC352, +0xC351, 0,0xC55E,0xF6A8, 0,0xC55D,0xF7A9,0xF7A8, + 0,0xC64C,0xF8D5,0xB3BD,0xE0EA, 0, 0, 0, +0xE4E1,0xE4DF,0xE4E0, 0, 0,0xE8E2, 0,0xE8DD, +0xE8DA,0xE8E1, 0, 0, 0,0xE8E3, 0, 0, +0xBE7C,0xE8E0,0xE8DC, 0, 0,0xE8DB,0xE8DF,0xE8DE, +0xBE7B, 0, 0,0xEC7D,0xEC78,0xEC76,0xECA1,0xEC77, + 0,0xEC73, 0,0xEC79, 0, 0,0xEC74,0xEF72, +0xEC75,0xECA2, 0, 0, 0, 0, 0, 0, + 0,0xEC7C,0xC06A,0xEC7B,0xEC7A, 0,0xEC7E, 0, + 0, 0, 0,0xEF6A,0xEF6D, 0, 0,0xEF6C, + 0,0xEF74,0xEF6F,0xEF73, 0,0xEF71,0xEF70,0xEF6E, + 0,0xEF6B, 0,0xC243,0xC242, 0,0xC244,0xC241, +0xEF75, 0, 0, 0, 0, 0,0xF1C8,0xF1CB, + 0,0xF1C9,0xF1CD, 0, 0, 0,0xF1CE, 0, +0xF1C6,0xC358,0xF1C7, 0,0xF1C5,0xF1CC, 0,0xF1C4, +0xF1C3,0xC357,0xC355,0xC354, 0, 0, 0, 0, + 0, 0, 0, 0,0xF1CA,0xF3CF,0xF3D5,0xC44A, +0xF3D0, 0,0xF3D3,0xF3D7,0xC44B,0xF3D2, 0,0xF3CA, + 0,0xF3C9,0xF3D6,0xF3CD, 0,0xF3CB,0xF3D4,0xF3CC, +0xC449,0xC448, 0,0xF3C7,0xF3C8,0xF3D1, 0, 0, + 0,0xF3CE, 0, 0, 0, 0, 0, 0, +0xF56C,0xF56F, 0, 0, 0, 0,0xC356, 0, + 0, 0, 0, 0, 0, 0,0xF56D,0xF573, +0xF571,0xF56B,0xF576, 0,0xF56A, 0,0xC4CF,0xF572, + 0, 0, 0,0xF56E,0xC4CE,0xF575, 0, 0, +0xF574, 0, 0, 0, 0,0xF6AB,0xF6AA, 0, + 0, 0,0xF6B1, 0,0xF6AD,0xF6B0,0xC560, 0, + 0,0xF6AE,0xF6AF, 0,0xF6A9,0xF6AC,0xC55F, 0, + 0, 0,0xC5BF,0xF7B4,0xF7AF,0xF7B3, 0,0xF7B6, +0xF7B2, 0,0xF7AE, 0,0xC5C1,0xF7B1,0xF7B5,0xC5C0, +0xF7AC,0xF570,0xF7B0, 0, 0,0xF7AD, 0,0xF7AA, + 0,0xF7AB,0xC5BE,0xF85A,0xF85C,0xF85F,0xF85B,0xF860, + 0,0xF859, 0,0xF857, 0,0xC5EB,0xF85D,0xC5ED, +0xC5EC,0xF858,0xF85E, 0, 0, 0, 0,0xF8DA, +0xC64D,0xF8DB, 0,0xF8D9,0xF8D6, 0, 0,0xF8D8, +0xF8D7,0xF95A, 0, 0, 0, 0,0xF95C,0xF95B, + 0, 0,0xF979, 0,0xF978,0xF977,0xF97A, 0, +0xC673,0xC674,0xF9CA,0xF9CE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xB3BE,0xDCAF, +0xE0ED, 0,0xB9A7,0xE0EB, 0, 0,0xE0EC, 0, + 0, 0,0xE4E2,0xE4E3,0xBBF1,0xBBEF,0xE4E4,0xBBF0, +0xE8E8, 0,0xE8EB,0xE8E5,0xE8EC,0xE8E4,0xE8E6, 0, +0xE8E7,0xE8EA, 0, 0,0xBEA1,0xE8EF,0xE8EE,0xBE7D, +0xE8E9,0xE8ED,0xBE7E, 0, 0, 0, 0, 0, + 0,0xECAC, 0,0xC06F, 0,0xECA7,0xC06B, 0, +0xECA4,0xECAA,0xECAD, 0,0xC070, 0,0xECA9,0xECA6, +0xECAE,0xECA5, 0,0xECAB,0xC06C, 0,0xECA3,0xC06D, + 0,0xC06E,0xECA8, 0, 0, 0,0xEFA9,0xEF7A, +0xEF7B,0xEF7E,0xEF7C, 0,0xEF76, 0, 0,0xEF79, +0xEFA5,0xEF7D, 0, 0,0xC245, 0,0xEFA7,0xEFA4, +0xC246,0xEFA6,0xEF77,0xEFA2,0xEFA3, 0,0xEFA1, 0, + 0, 0, 0,0xF1D2,0xF1D4,0xF1D7, 0, 0, +0xF1D1, 0,0xC359,0xF1D9,0xF1D0,0xF1DA, 0,0xF1D6, +0xF1D8,0xF1DC,0xF1D5,0xF1DD,0xF1D3,0xF1CF,0xC35A, 0, +0xF1DB,0xC35B,0xC44D, 0, 0, 0, 0, 0, +0xEF78,0xF3F1,0xF3E8,0xC44F,0xF3E4,0xC450, 0, 0, +0xF3ED,0xF3E7,0xF3DD,0xC44E,0xF3EA,0xF3E5,0xF3E6, 0, +0xF3D8,0xF3DF,0xF3EE, 0,0xF3EB, 0,0xF3E3, 0, +0xF3EF,0xF3DE,0xF3D9,0xF3EC, 0,0xF3DB,0xF3E9,0xF3E0, +0xF3F0,0xF3DC,0xC44C,0xF3DA,0xF3E1,0xF3E2, 0, 0, + 0,0xF57D, 0,0xF57B, 0,0xF5A2, 0,0xF5AE, +0xF5A5,0xF57C,0xF578,0xF5A7,0xF57E,0xF5A3,0xF57A,0xF5AA, +0xF577,0xF5A1,0xF5A6,0xF5A8,0xF5AB,0xF579, 0,0xF5AF, +0xF5B0,0xF5A9,0xF5AD,0xF5A4, 0,0xF6C1,0xF6C4, 0, +0xC561, 0,0xF6C3,0xF6C8,0xF6C6,0xC562,0xF6BD,0xF6B3, +0xF6B2,0xC564,0xF6BF,0xF6C0,0xF6BC,0xF6B4, 0,0xF6B9, +0xF5AC, 0,0xF6B5,0xC563,0xF6BB, 0,0xF6BA, 0, +0xF6B6,0xF6C2, 0,0xF6B7,0xF7BB,0xF6C5,0xF6C7,0xF6BE, +0xF6B8,0xF7BC,0xF7BE,0xF7B8,0xC5C2, 0,0xF7C5,0xF7C3, +0xC5C3,0xF7C2,0xF7C1,0xF7BA,0xF7B7,0xF7BD,0xF7C6,0xF7B9, +0xF7BF, 0,0xF869,0xF86E,0xF864,0xF867,0xC5EE,0xF86B, + 0,0xF872,0xF7C0, 0,0xF865,0xF86F,0xF873,0xF86A, +0xF863,0xF86D, 0,0xF86C,0xF871,0xF870,0xF7C4,0xF868, +0xF862,0xF866,0xC64E,0xC64F,0xF861, 0,0xF8E6,0xF8DD, +0xF8E5,0xF8E2,0xF8E3,0xF8DC,0xF8DF,0xF8E7,0xF8E1,0xF8E0, +0xF8DE, 0,0xF8E4, 0,0xF95D, 0,0xF95E, 0, +0xF960,0xF95F,0xF962,0xF961,0xF97C,0xF97B,0xF9B7, 0, +0xF9B8, 0,0xF9C5,0xC678,0xC67C, 0,0xF9CF,0xC67D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xB3BF, 0, + 0, 0,0xC4D0,0xF6C9, 0,0xC650,0xC651, 0, +0xB3C0,0xE0EE, 0,0xB9A8,0xE8F0, 0, 0,0xECB0, +0xECB1,0xECAF,0xEFAB,0xEFAA,0xC247,0xF1DF,0xEFAC,0xF1DE, + 0, 0,0xF3F3,0xC451,0xC453,0xF3F2, 0, 0, +0xC452, 0,0xF5B1,0xF5B3,0xF5B2,0xF6CA,0xC565, 0, +0xC5EF,0xF8E8,0xF963, 0, 0,0xF9D2,0xB3C1, 0, +0xE4E5, 0,0xBEA2, 0, 0, 0,0xECB3,0xECB2, + 0,0xEFAD, 0, 0, 0,0xC454,0xC4D1,0xF7C7, +0xF9CB, 0, 0, 0,0xB3C2,0xBBF2, 0,0xBEA3, + 0,0xF3F4, 0,0xF874,0xB6C0, 0, 0, 0, + 0,0xEFAE, 0, 0, 0,0xC664,0xB6C1,0xBEA4, +0xC248,0xF875,0xB6C2, 0,0xE8F1,0xC072,0xECB4,0xECB5, + 0,0xC071, 0,0xEFAF,0xC24C,0xC24A,0xC24B,0xC249, +0xF1E0,0xC35C, 0, 0, 0,0xF5B5,0xF5B4,0xF5B7, +0xF5B6,0xC4D2, 0, 0,0xF6CB, 0,0xF6CD,0xF6CC, +0xC566,0xF7C8, 0,0xF876,0xF877,0xC5F0,0xF964,0xF97D, +0xC675, 0,0xDCB0,0xECB6,0xEFB0,0xF3F5,0xE0EF, 0, +0xEFB1,0xF1E2,0xF1E1, 0, 0, 0, 0,0xF878, +0xC652, 0,0xF965,0xF97E, 0, 0, 0,0xB9A9, +0xE8F2,0xE8F3, 0,0xECB7,0xB9AA, 0,0xC35D,0xF1E3, + 0,0xF6CF,0xC567,0xF6D0,0xF6CE,0xF879, 0,0xF8E9, + 0,0xB9AB, 0,0xEFB4,0xEFB3,0xEFB2,0xF1E4, 0, + 0,0xF1E8,0xF1E7,0xF1E6,0xF1E5,0xC35E,0xF3F6,0xF5B9, +0xC4D3,0xF5B8,0xF6D1,0xF7CB,0xF7CA,0xC5C4,0xF7C9,0xF87C, +0xF87B,0xF87A, 0, 0,0xBBF3, 0,0xECB8,0xC24D, + 0,0xF3F7,0xF3F8,0xF7CC,0xF87D, 0, 0,0xF8EA, +0xF966,0xF9B9,0xF9D4,0xBBF4,0xC24E,0xF1E9,0xF3F9,0xF6D2, +0xF87E, 0, 0,0xBEA6, 0,0xEFB5,0xF1EA,0xF3FA, +0xF3FB,0xF3FC,0xF5BE, 0,0xF5BA,0xC568,0xF5BD,0xF5BC, +0xC4D4,0xF5BB,0xC4D6, 0,0xC4D5,0xF6D4,0xF6D3,0xC569, +0xC56A, 0, 0,0xC5C6,0xF7CD,0xC5C5, 0,0xF8A3, +0xF8A4,0xF8A2,0xF8A1,0xC654, 0,0xF8EB,0xF8EC,0xF8ED, +0xC653,0xF967,0xF96A,0xF969,0xF968, 0, 0,0xF9D3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xC073, 0, + 0,0xC365,0xF5BF,0xF6D5, 0,0xC5C7,0xF7CE, 0, + 0,0xF9D5, 0, 0, 0,0xC074, 0, 0, + 0,0xEFB6, 0,0xF7CF, 0,0xF9A1}; + +/* page 9 0xFA0C-0xFA0D */ +static uint16 tab_uni_big59[]={ +0xC94A,0xDDFC}; + +/* page 10 0xFE30-0xFFFD */ +static uint16 tab_uni_big510[]={ +0xA14A,0xA157, 0,0xA159,0xA15B,0xA15F,0xA160,0xA163, +0xA164,0xA167,0xA168,0xA16B,0xA16C,0xA16F,0xA170,0xA173, +0xA174,0xA177,0xA178,0xA17B,0xA17C, 0, 0, 0, + 0,0xA1C6,0xA1C7,0xA1CA,0xA1CB,0xA1C8,0xA1C9,0xA15C, +0xA14D, 0,0xA14F, 0,0xA151,0xA152,0xA153,0xA154, + 0,0xA17D,0xA17E,0xA1A1,0xA1A2,0xA1A3,0xA1A4,0xA1CC, +0xA1CD,0xA1CE,0xA1DE,0xA1DF,0xA1E0,0xA1E1,0xA1E2, 0, + 0,0xA24C,0xA24D,0xA24E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA149, 0,0xA1AD,0xA243,0xA248,0xA1AE, 0, +0xA15D,0xA15E,0xA1AF,0xA1CF,0xA141,0xA1D0,0xA144,0xA241, +0xA2AF,0xA2B0,0xA2B1,0xA2B2,0xA2B3,0xA2B4,0xA2B5,0xA2B6, +0xA2B7,0xA2B8,0xA147,0xA146,0xA1D5,0xA1D7,0xA1D6,0xA148, +0xA249,0xA2CF,0xA2D0,0xA2D1,0xA2D2,0xA2D3,0xA2D4,0xA2D5, +0xA2D6,0xA2D7,0xA2D8,0xA2D9,0xA2DA,0xA2DB,0xA2DC,0xA2DD, +0xA2DE,0xA2DF,0xA2E0,0xA2E1,0xA2E2,0xA2E3,0xA2E4,0xA2E5, +0xA2E6,0xA2E7,0xA2E8, 0,0xA242, 0, 0,0xA1C4, + 0,0xA2E9,0xA2EA,0xA2EB,0xA2EC,0xA2ED,0xA2EE,0xA2EF, +0xA2F0,0xA2F1,0xA2F2,0xA2F3,0xA2F4,0xA2F5,0xA2F6,0xA2F7, +0xA2F8,0xA2F9,0xA2FA,0xA2FB,0xA2FC,0xA2FD,0xA2FE,0xA340, +0xA341,0xA342,0xA343,0xA161,0xA155,0xA162, 0, 0, + 0, 0, 0, 0,0xA14E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA2CE}; + +static int func_uni_big5_onechar(int code){ + if ((code>=0x00A2)&&(code<=0x00F7)) + return(tab_uni_big50[code-0x00A2]); + if ((code>=0x02C7)&&(code<=0x0451)) + return(tab_uni_big51[code-0x02C7]); + if ((code>=0x2013)&&(code<=0x22BF)) + return(tab_uni_big52[code-0x2013]); + if ((code>=0x2460)&&(code<=0x2642)) + return(tab_uni_big53[code-0x2460]); + if ((code>=0x3000)&&(code<=0x3129)) + return(tab_uni_big54[code-0x3000]); + if ((code>=0x32A3)&&(code<=0x32A3)) + return(tab_uni_big55[code-0x32A3]); + if ((code>=0x338E)&&(code<=0x33D5)) + return(tab_uni_big56[code-0x338E]); + if ((code>=0x4E00)&&(code<=0x9483)) + return(tab_uni_big57[code-0x4E00]); + if ((code>=0x9577)&&(code<=0x9FA4)) + return(tab_uni_big58[code-0x9577]); + if ((code>=0xFA0C)&&(code<=0xFA0D)) + return(tab_uni_big59[code-0xFA0C]); + if ((code>=0xFE30)&&(code<=0xFFFD)) + return(tab_uni_big510[code-0xFE30]); + return(0); +} + + +static int +my_wc_mb_big5(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + + int code; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((int) wc < 0x80) + { + s[0]= (uchar) wc; + return 1; + } + + if (!(code=func_uni_big5_onechar(wc))) + return MY_CS_ILUNI; + + if (s+2>e) + return MY_CS_TOOSMALL; + + s[0]=code>>8; + s[1]=code&0xFF; + + return 2; +} + + +static int +my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc,const uchar *s,const uchar *e) +{ + + int hi; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((hi= s[0]) < 0x80) + { + pwc[0]=hi; + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + if (!(pwc[0]=func_big5_uni_onechar((hi<<8)+s[1]))) + return -2; + + return 2; +} + + +/* + Returns a well formed length of a BIG5 string. + CP950 and HKSCS additional characters are also accepted. +*/ +static +size_t my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) +{ + const char *b0= b; + const char *emb= e - 1; /* Last possible end of an MB character */ + + *error= 0; + while (pos-- && b < e) + { + if ((uchar) b[0] < 128) + { + /* Single byte ascii character */ + b++; + } + else if ((b < emb) && isbig5code((uchar)*b, (uchar)b[1])) + { + /* Double byte character */ + b+= 2; + } + else + { + /* Wrong byte sequence */ + *error= 1; + break; + } + } + return (size_t) (b - b0); +} + + +static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler = +{ + NULL, /* init */ + my_strnncoll_big5, + my_strnncollsp_big5, + my_strnxfrm_big5, + my_strnxfrmlen_simple, + my_like_range_big5, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_big5_handler= +{ + NULL, /* init */ + ismbchar_big5, + mbcharlen_big5, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_big5, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_big5, /* mb_wc */ + my_wc_mb_big5, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb, + my_casedn_str_mb, + my_caseup_mb, + my_casedn_mb, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + +CHARSET_INFO my_charset_big5_chinese_ci= +{ + 1,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ + "big5", /* cs name */ + "big5_chinese_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_big5, + to_lower_big5, + to_upper_big5, + sort_order_big5, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_big5_handler, + &my_collation_big5_chinese_ci_handler +}; + + +CHARSET_INFO my_charset_big5_bin= +{ + 84,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "big5", /* cs name */ + "big5_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_big5, + to_lower_big5, + to_upper_big5, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_big5_handler, + &my_collation_mb_bin_handler +}; + + +#endif diff --git a/externals/mysql/strings/ctype-bin.c b/externals/mysql/strings/ctype-bin.c new file mode 100644 index 00000000000..49510231153 --- /dev/null +++ b/externals/mysql/strings/ctype-bin.c @@ -0,0 +1,570 @@ +/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* This file is for binary pseudo charset, created by bar@mysql.com */ + + +#include +#include "m_string.h" +#include "m_ctype.h" + +static uchar ctype_bin[]= +{ + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + + +/* Dummy array for toupper / tolower / sortorder */ + +static uchar bin_char_array[] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + + +static my_bool +my_coll_init_8bit_bin(CHARSET_INFO *cs, + void *(*alloc)(size_t) __attribute__((unused))) +{ + cs->max_sort_char=255; + return FALSE; +} + +static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + size_t len=min(slen,tlen); + int cmp= memcmp(s,t,len); + return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen); +} + + +size_t my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr __attribute__((unused)), + size_t length) +{ + return length; +} + + +/* + Compare two strings. Result is sign(first_argument - second_argument) + + SYNOPSIS + my_strnncollsp_binary() + cs Chararacter set + s String to compare + slen Length of 's' + t String to compare + tlen Length of 't' + + NOTE + This function is used for real binary strings, i.e. for + BLOB, BINARY(N) and VARBINARY(N). + It compares trailing spaces as spaces. + + RETURN + < 0 s < t + 0 s == t + > 0 s > t +*/ + +static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + return my_strnncoll_binary(cs,s,slen,t,tlen,0); +} + + +static int my_strnncoll_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + size_t len=min(slen,tlen); + int cmp= memcmp(s,t,len); + return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen); +} + + +/* + Compare two strings. Result is sign(first_argument - second_argument) + + SYNOPSIS + my_strnncollsp_8bit_bin() + cs Chararacter set + s String to compare + slen Length of 's' + t String to compare + tlen Length of 't' + diff_if_only_endspace_difference + Set to 1 if the strings should be regarded as different + if they only difference in end space + + NOTE + This function is used for character strings with binary collations. + The shorter string is extended with end space to be as long as the longer + one. + + RETURN + < 0 s < t + 0 s == t + > 0 s > t +*/ + +static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + const uchar *end; + size_t length; + int res; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + end= a + (length= min(a_length, b_length)); + while (a < end) + { + if (*a++ != *b++) + return ((int) a[-1] - (int) b[-1]); + } + res= 0; + if (a_length != b_length) + { + int swap= 1; + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + if (a_length < b_length) + { + /* put shorter key in s */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (end= a + a_length-length; a < end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + } + return res; +} + + +/* This function is used for all conversion functions */ + +static size_t my_case_str_bin(CHARSET_INFO *cs __attribute__((unused)), + char *str __attribute__((unused))) +{ + return 0; +} + + +static size_t my_case_bin(CHARSET_INFO *cs __attribute__((unused)), + char *src __attribute__((unused)), + size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + return srclen; +} + + +static int my_strcasecmp_bin(CHARSET_INFO * cs __attribute__((unused)), + const char *s, const char *t) +{ + return strcmp(s,t); +} + + +uint my_mbcharlen_8bit(CHARSET_INFO *cs __attribute__((unused)), + uint c __attribute__((unused))) +{ + return 1; +} + + +static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *wc, + const uchar *str, + const uchar *end __attribute__((unused))) +{ + if (str >= end) + return MY_CS_TOOSMALL; + + *wc=str[0]; + return 1; +} + + +static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, + uchar *s, + uchar *e __attribute__((unused))) +{ + if (s >= e) + return MY_CS_TOOSMALL; + + if (wc < 256) + { + s[0]= (char) wc; + return 1; + } + return MY_CS_ILUNI; +} + + +void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) +{ + const uchar *pos = key; + + /* + Remove trailing spaces. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + key= skip_trailing_space(key, len); + + for (; pos < (uchar*) key ; pos++) + { + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * + ((uint)*pos)) + (nr1[0] << 8); + nr2[0]+=3; + } +} + + +void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) +{ + const uchar *pos = key; + + key+= len; + + for (; pos < (uchar*) key ; pos++) + { + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * + ((uint)*pos)) + (nr1[0] << 8); + nr2[0]+=3; + } +} + + +/* + The following defines is here to keep the following code identical to + the one in ctype-simple.c +*/ + +#define likeconv(s,A) (A) +#define INC_PTR(cs,A,B) (A)++ + + +int my_wildcmp_bin(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + int result= -1; /* Not found, using wildcards */ + + while (wildstr != wildend) + { + while (*wildstr != w_many && *wildstr != w_one) + { + if (*wildstr == escape && wildstr+1 != wildend) + wildstr++; + if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++)) + return(1); /* No match */ + if (wildstr == wildend) + return(str != str_end); /* Match if both are at end */ + result=1; /* Found an anchor char */ + } + if (*wildstr == w_one) + { + do + { + if (str == str_end) /* Skip one char if possible */ + return(result); + INC_PTR(cs,str,str_end); + } while (++wildstr < wildend && *wildstr == w_one); + if (wildstr == wildend) + break; + } + if (*wildstr == w_many) + { /* Found w_many */ + uchar cmp; + wildstr++; + /* Remove any '%' and '_' from the wild search string */ + for (; wildstr != wildend ; wildstr++) + { + if (*wildstr == w_many) + continue; + if (*wildstr == w_one) + { + if (str == str_end) + return(-1); + INC_PTR(cs,str,str_end); + continue; + } + break; /* Not a wild character */ + } + if (wildstr == wildend) + return(0); /* match if w_many is last */ + if (str == str_end) + return(-1); + + if ((cmp= *wildstr) == escape && wildstr+1 != wildend) + cmp= *++wildstr; + + INC_PTR(cs,wildstr,wildend); /* This is compared through cmp */ + cmp=likeconv(cs,cmp); + do + { + while (str != str_end && (uchar) likeconv(cs,*str) != cmp) + str++; + if (str++ == str_end) + return(-1); + { + int tmp=my_wildcmp_bin(cs,str,str_end,wildstr,wildend,escape,w_one, + w_many); + if (tmp <= 0) + return(tmp); + } + } while (str != str_end && wildstr[0] != w_many); + return(-1); + } + } + return(str != str_end ? 1 : 0); +} + + +static size_t +my_strnxfrm_8bit_bin(CHARSET_INFO *cs, + uchar * dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + set_if_smaller(srclen, dstlen); + set_if_smaller(srclen, nweights); + if (dst != src) + memcpy(dst, src, srclen); + return my_strxfrm_pad_desc_and_reverse(cs, dst, dst + srclen, dst + dstlen, + nweights - srclen, flags, 0); +} + + +static +uint my_instr_bin(CHARSET_INFO *cs __attribute__((unused)), + const char *b, size_t b_length, + const char *s, size_t s_length, + my_match_t *match, uint nmatch) +{ + register const uchar *str, *search, *end, *search_end; + + if (s_length <= b_length) + { + if (!s_length) + { + if (nmatch) + { + match->beg= 0; + match->end= 0; + match->mb_len= 0; + } + return 1; /* Empty string is always found */ + } + + str= (const uchar*) b; + search= (const uchar*) s; + end= (const uchar*) b+b_length-s_length+1; + search_end= (const uchar*) s + s_length; + +skip: + while (str != end) + { + if ( (*str++) == (*search)) + { + register const uchar *i,*j; + + i= str; + j= search+1; + + while (j != search_end) + if ((*i++) != (*j++)) + goto skip; + + if (nmatch > 0) + { + match[0].beg= 0; + match[0].end= (size_t) (str- (const uchar*)b-1); + match[0].mb_len= match[0].end; + + if (nmatch > 1) + { + match[1].beg= match[0].end; + match[1].end= match[0].end+s_length; + match[1].mb_len= match[1].end-match[1].beg; + } + } + return 2; + } + } + } + return 0; +} + + +MY_COLLATION_HANDLER my_collation_8bit_bin_handler = +{ + my_coll_init_8bit_bin, + my_strnncoll_8bit_bin, + my_strnncollsp_8bit_bin, + my_strnxfrm_8bit_bin, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_bin, + my_strcasecmp_bin, + my_instr_bin, + my_hash_sort_8bit_bin, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_binary_handler = +{ + NULL, /* init */ + my_strnncoll_binary, + my_strnncollsp_binary, + my_strnxfrm_8bit_bin, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_bin, + my_strcasecmp_bin, + my_instr_bin, + my_hash_sort_bin, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + NULL, /* ismbchar */ + my_mbcharlen_8bit, /* mbcharlen */ + my_numchars_8bit, + my_charpos_8bit, + my_well_formed_len_8bit, + my_lengthsp_binary, + my_numcells_8bit, + my_mb_wc_bin, + my_wc_mb_bin, + my_mb_ctype_8bit, + my_case_str_bin, + my_case_str_bin, + my_case_bin, + my_case_bin, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_bin = +{ + 63,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */ + "binary", /* cs name */ + "binary", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_bin, /* ctype */ + bin_char_array, /* to_lower */ + bin_char_array, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + 0, /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_binary_handler +}; diff --git a/externals/mysql/strings/ctype-cp932.c b/externals/mysql/strings/ctype-cp932.c new file mode 100644 index 00000000000..14532f54b8a --- /dev/null +++ b/externals/mysql/strings/ctype-cp932.c @@ -0,0 +1,5555 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is for cp932 charaset (Windows Japanese), + and created based on ctype-sjis.c file */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_cp932 + + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_cp932=1 + * .configure. mbmaxlen_cp932=2 + */ + +static uchar NEAR ctype_cp932[257] = +{ + 0, /* For standard library */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ + 0040, 0050, 0050, 0050, 0050, 0050, 0040, 0040, /* ^H - ^O */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^P - ^W */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^X - ^Z ^[ ^\ ^] ^^ ^_ */ + 0110, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* SPC ! " # $ % ^ ' */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* ( ) * + , - . / */ + 0204, 0204, 0204, 0204, 0204, 0204, 0204, 0204, /* 0 1 2 3 4 5 6 7 */ + 0204, 0204, 0020, 0020, 0020, 0020, 0020, 0020, /* 8 9 : ; < = > ? */ + 0020, 0201, 0201, 0201, 0201, 0201, 0201, 0001, /* @ A B C D E F G */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* H I J K L M N O */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* P Q R S T U V W */ + 0001, 0001, 0001, 0020, 0020, 0020, 0020, 0020, /* X Y Z [ \ ] ^ _ */ + 0020, 0202, 0202, 0202, 0202, 0202, 0202, 0002, /* ` a b c d e f g */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* h i j k l m n o */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* p q r s t u v w */ + 0002, 0002, 0002, 0020, 0020, 0020, 0020, 0040, /* x y z { | } + DEL */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0000, 0000, 0000 +}; + +static uchar NEAR to_lower_cp932[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR to_upper_cp932[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR sort_order_cp932[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +#define iscp932head(c) ((0x81<=(c) && (c)<=0x9f) || \ + ((0xe0<=(c)) && (c)<=0xfc)) +#define iscp932tail(c) ((0x40<=(c) && (c)<=0x7e) || \ + (0x80<=(c) && (c)<=0xfc)) + + +static uint ismbchar_cp932(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return (iscp932head((uchar) *p) && (e-p)>1 && iscp932tail((uchar)p[1]) ? 2: 0); +} + +static uint mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (iscp932head((uchar) c) ? 2 : 1); +} + + +#define cp932code(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) + + +static int my_strnncoll_cp932_internal(CHARSET_INFO *cs, + const uchar **a_res, size_t a_length, + const uchar **b_res, size_t b_length) +{ + const uchar *a= *a_res, *b= *b_res; + const uchar *a_end= a + a_length; + const uchar *b_end= b + b_length; + while (a < a_end && b < b_end) + { + if (ismbchar_cp932(cs,(char*) a, (char*) a_end) && + ismbchar_cp932(cs,(char*) b, (char*) b_end)) + { + uint a_char= cp932code(*a, *(a+1)); + uint b_char= cp932code(*b, *(b+1)); + if (a_char != b_char) + return a_char - b_char; + a += 2; + b += 2; + } else + { + if (sort_order_cp932[(uchar)*a] != sort_order_cp932[(uchar)*b]) + return sort_order_cp932[(uchar)*a] - sort_order_cp932[(uchar)*b]; + a++; + b++; + } + } + *a_res= a; + *b_res= b; + return 0; +} + + +static int my_strnncoll_cp932(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool b_is_prefix) +{ + int res= my_strnncoll_cp932_internal(cs, &a, a_length, &b, b_length); + if (b_is_prefix && a_length > b_length) + a_length= b_length; + return res ? res : (int) (a_length - b_length); +} + + +static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + const uchar *a_end= a + a_length; + const uchar *b_end= b + b_length; + int res= my_strnncoll_cp932_internal(cs, &a, a_length, &b, b_length); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + if (!res && (a != a_end || b != b_end)) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a == a_end) + { + /* put shorter key in a */ + a_end= b_end; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (; a < a_end ; a++) + { + if (*a != (uchar) ' ') + return (*a < (uchar) ' ') ? -swap : swap; + } + } + return res; +} + + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +#define max_sort_char ((char) 255) + +static my_bool my_like_range_cp932(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr,size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length, size_t *max_length) +{ + const char *end=ptr+ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + + while (ptr < end && min_str < min_end) { + if (ismbchar_cp932(cs, ptr, end)) { + *min_str++ = *max_str++ = *ptr++; + if (min_str < min_end) + *min_str++ = *max_str++ = *ptr++; + continue; + } + if (*ptr == escape && ptr+1 < end) { + ptr++; /* Skip escape */ + if (ismbchar_cp932(cs, ptr, end)) + *min_str++ = *max_str++ = *ptr++; + if (min_str < min_end) + *min_str++ = *max_str++ = *ptr++; + continue; + } + if (*ptr == w_one) { /* '_' in SQL */ + *min_str++ = '\0'; /* This should be min char */ + *max_str++ = max_sort_char; + ptr++; + continue; + } + if (*ptr == w_many) + { /* '%' in SQL */ + *min_length = (size_t)(min_str - min_org); + *max_length = res_length; + do + { + *min_str++= 0; + *max_str++= max_sort_char; + } while (min_str < min_end); + return 0; + } + *min_str++ = *max_str++ = *ptr++; + } + *min_length = *max_length = (size_t) (min_str - min_org); + while (min_str < min_end) + *min_str++ = *max_str++ = ' '; /* Because if key compression */ + return 0; +} + +/* page 0 0x00A1-0x00DF */ +static uint16 tab_cp932_uni0[]={ +0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67,0xFF68, +0xFF69,0xFF6A,0xFF6B,0xFF6C,0xFF6D,0xFF6E,0xFF6F,0xFF70, +0xFF71,0xFF72,0xFF73,0xFF74,0xFF75,0xFF76,0xFF77,0xFF78, +0xFF79,0xFF7A,0xFF7B,0xFF7C,0xFF7D,0xFF7E,0xFF7F,0xFF80, +0xFF81,0xFF82,0xFF83,0xFF84,0xFF85,0xFF86,0xFF87,0xFF88, +0xFF89,0xFF8A,0xFF8B,0xFF8C,0xFF8D,0xFF8E,0xFF8F,0xFF90, +0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97,0xFF98, +0xFF99,0xFF9A,0xFF9B,0xFF9C,0xFF9D,0xFF9E,0xFF9F}; + +/* page 1 0x8140-0x84BE */ +static uint16 tab_cp932_uni1[]={ +0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B, +0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E, +0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD, +0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0xFF3C, +0xFF5E,0x2225,0xFF5C,0x2026,0x2025,0x2018,0x2019,0x201C, +0x201D,0xFF08,0xFF09,0x3014,0x3015,0xFF3B,0xFF3D,0xFF5B, +0xFF5D,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E, +0x300F,0x3010,0x3011,0xFF0B,0xFF0D,0x00B1,0x00D7, 0, +0x00F7,0xFF1D,0x2260,0xFF1C,0xFF1E,0x2266,0x2267,0x221E, +0x2234,0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFFE5, +0xFF04,0xFFE0,0xFFE1,0xFF05,0xFF03,0xFF06,0xFF0A,0xFF20, +0x00A7,0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7,0x25C6, +0x25A1,0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x203B,0x3012, +0x2192,0x2190,0x2191,0x2193,0x3013, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2208,0x220B,0x2286,0x2287,0x2282,0x2283,0x222A,0x2229, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2227,0x2228,0xFFE2,0x21D2,0x21D4,0x2200,0x2203, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2220,0x22A5,0x2312,0x2202,0x2207,0x2261, +0x2252,0x226A,0x226B,0x221A,0x223D,0x221D,0x2235,0x222B, +0x222C, 0, 0, 0, 0, 0, 0, 0, +0x212B,0x2030,0x266F,0x266D,0x266A,0x2020,0x2021,0x00B6, + 0, 0, 0, 0,0x25EF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFF10, +0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, +0xFF19, 0, 0, 0, 0, 0, 0, 0, +0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28, +0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30, +0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38, +0xFF39,0xFF3A, 0, 0, 0, 0, 0, 0, + 0,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, +0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, +0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57, +0xFF58,0xFF59,0xFF5A, 0, 0, 0, 0,0x3041, +0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048,0x3049, +0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050,0x3051, +0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058,0x3059, +0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060,0x3061, +0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068,0x3069, +0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070,0x3071, +0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078,0x3079, +0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080,0x3081, +0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088,0x3089, +0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090,0x3091, +0x3092,0x3093, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, +0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, +0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, +0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, +0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, +0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, +0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, +0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF, 0, +0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7, +0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF, +0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6, 0, + 0, 0, 0, 0, 0, 0, 0,0x0391, +0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398,0x0399, +0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0,0x03A1, +0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, 0, + 0, 0, 0, 0, 0, 0, 0,0x03B1, +0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8,0x03B9, +0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0,0x03C1, +0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, +0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, +0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, +0x042F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D, 0, +0x043E,0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445, +0x0446,0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D, +0x044E,0x044F, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2500, +0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C,0x2524, +0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B,0x2517, +0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F,0x2528, +0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542}; + +/* page 2 0x8740-0x879C - NEC Row 13 */ +static uint16 tab_cp932_uni2[]={ +0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, +0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, +0x2470,0x2471,0x2472,0x2473,0x2160,0x2161,0x2162,0x2163, +0x2164,0x2165,0x2166,0x2167,0x2168,0x2169, 0,0x3349, +0x3314,0x3322,0x334D,0x3318,0x3327,0x3303,0x3336,0x3351, +0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,0x333B,0x339C, +0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1, 0, 0, + 0, 0, 0, 0, 0, 0,0x337B, 0, +0x301D,0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6, +0x32A7,0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C, +0x2252,0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220, +0x221F,0x22BF,0x2235,0x2229,0x222A}; + +/* page 3 0x889F-0x9FFC */ +static uint16 tab_cp932_uni3[]={ +0x4E9C,0x5516,0x5A03,0x963F,0x54C0,0x611B,0x6328,0x59F6, +0x9022,0x8475,0x831C,0x7A50,0x60AA,0x63E1,0x6E25,0x65ED, +0x8466,0x82A6,0x9BF5,0x6893,0x5727,0x65A1,0x6271,0x5B9B, +0x59D0,0x867B,0x98F4,0x7D62,0x7DBE,0x9B8E,0x6216,0x7C9F, +0x88B7,0x5B89,0x5EB5,0x6309,0x6697,0x6848,0x95C7,0x978D, +0x674F,0x4EE5,0x4F0A,0x4F4D,0x4F9D,0x5049,0x56F2,0x5937, +0x59D4,0x5A01,0x5C09,0x60DF,0x610F,0x6170,0x6613,0x6905, +0x70BA,0x754F,0x7570,0x79FB,0x7DAD,0x7DEF,0x80C3,0x840E, +0x8863,0x8B02,0x9055,0x907A,0x533B,0x4E95,0x4EA5,0x57DF, +0x80B2,0x90C1,0x78EF,0x4E00,0x58F1,0x6EA2,0x9038,0x7A32, +0x8328,0x828B,0x9C2F,0x5141,0x5370,0x54BD,0x54E1,0x56E0, +0x59FB,0x5F15,0x98F2,0x6DEB,0x80E4,0x852D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9662,0x9670,0x96A0,0x97FB,0x540B,0x53F3,0x5B87, +0x70CF,0x7FBD,0x8FC2,0x96E8,0x536F,0x9D5C,0x7ABA,0x4E11, +0x7893,0x81FC,0x6E26,0x5618,0x5504,0x6B1D,0x851A,0x9C3B, +0x59E5,0x53A9,0x6D66,0x74DC,0x958F,0x5642,0x4E91,0x904B, +0x96F2,0x834F,0x990C,0x53E1,0x55B6,0x5B30,0x5F71,0x6620, +0x66F3,0x6804,0x6C38,0x6CF3,0x6D29,0x745B,0x76C8,0x7A4E, +0x9834,0x82F1,0x885B,0x8A60,0x92ED,0x6DB2,0x75AB,0x76CA, +0x99C5,0x60A6,0x8B01,0x8D8A,0x95B2,0x698E,0x53AD,0x5186, + 0,0x5712,0x5830,0x5944,0x5BB4,0x5EF6,0x6028,0x63A9, +0x63F4,0x6CBF,0x6F14,0x708E,0x7114,0x7159,0x71D5,0x733F, +0x7E01,0x8276,0x82D1,0x8597,0x9060,0x925B,0x9D1B,0x5869, +0x65BC,0x6C5A,0x7525,0x51F9,0x592E,0x5965,0x5F80,0x5FDC, +0x62BC,0x65FA,0x6A2A,0x6B27,0x6BB4,0x738B,0x7FC1,0x8956, +0x9D2C,0x9D0E,0x9EC4,0x5CA1,0x6C96,0x837B,0x5104,0x5C4B, +0x61B6,0x81C6,0x6876,0x7261,0x4E59,0x4FFA,0x5378,0x6069, +0x6E29,0x7A4F,0x97F3,0x4E0B,0x5316,0x4EEE,0x4F55,0x4F3D, +0x4FA1,0x4F73,0x52A0,0x53EF,0x5609,0x590F,0x5AC1,0x5BB6, +0x5BE1,0x79D1,0x6687,0x679C,0x67B6,0x6B4C,0x6CB3,0x706B, +0x73C2,0x798D,0x79BE,0x7A3C,0x7B87,0x82B1,0x82DB,0x8304, +0x8377,0x83EF,0x83D3,0x8766,0x8AB2,0x5629,0x8CA8,0x8FE6, +0x904E,0x971E,0x868A,0x4FC4,0x5CE8,0x6211,0x7259,0x753B, +0x81E5,0x82BD,0x86FE,0x8CC0,0x96C5,0x9913,0x99D5,0x4ECB, +0x4F1A,0x89E3,0x56DE,0x584A,0x58CA,0x5EFB,0x5FEB,0x602A, +0x6094,0x6062,0x61D0,0x6212,0x62D0,0x6539, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9B41,0x6666,0x68B0,0x6D77,0x7070,0x754C,0x7686, +0x7D75,0x82A5,0x87F9,0x958B,0x968E,0x8C9D,0x51F1,0x52BE, +0x5916,0x54B3,0x5BB3,0x5D16,0x6168,0x6982,0x6DAF,0x788D, +0x84CB,0x8857,0x8A72,0x93A7,0x9AB8,0x6D6C,0x99A8,0x86D9, +0x57A3,0x67FF,0x86CE,0x920E,0x5283,0x5687,0x5404,0x5ED3, +0x62E1,0x64B9,0x683C,0x6838,0x6BBB,0x7372,0x78BA,0x7A6B, +0x899A,0x89D2,0x8D6B,0x8F03,0x90ED,0x95A3,0x9694,0x9769, +0x5B66,0x5CB3,0x697D,0x984D,0x984E,0x639B,0x7B20,0x6A2B, + 0,0x6A7F,0x68B6,0x9C0D,0x6F5F,0x5272,0x559D,0x6070, +0x62EC,0x6D3B,0x6E07,0x6ED1,0x845B,0x8910,0x8F44,0x4E14, +0x9C39,0x53F6,0x691B,0x6A3A,0x9784,0x682A,0x515C,0x7AC3, +0x84B2,0x91DC,0x938C,0x565B,0x9D28,0x6822,0x8305,0x8431, +0x7CA5,0x5208,0x82C5,0x74E6,0x4E7E,0x4F83,0x51A0,0x5BD2, +0x520A,0x52D8,0x52E7,0x5DFB,0x559A,0x582A,0x59E6,0x5B8C, +0x5B98,0x5BDB,0x5E72,0x5E79,0x60A3,0x611F,0x6163,0x61BE, +0x63DB,0x6562,0x67D1,0x6853,0x68FA,0x6B3E,0x6B53,0x6C57, +0x6F22,0x6F97,0x6F45,0x74B0,0x7518,0x76E3,0x770B,0x7AFF, +0x7BA1,0x7C21,0x7DE9,0x7F36,0x7FF0,0x809D,0x8266,0x839E, +0x89B3,0x8ACC,0x8CAB,0x9084,0x9451,0x9593,0x9591,0x95A2, +0x9665,0x97D3,0x9928,0x8218,0x4E38,0x542B,0x5CB8,0x5DCC, +0x73A9,0x764C,0x773C,0x5CA9,0x7FEB,0x8D0B,0x96C1,0x9811, +0x9854,0x9858,0x4F01,0x4F0E,0x5371,0x559C,0x5668,0x57FA, +0x5947,0x5B09,0x5BC4,0x5C90,0x5E0C,0x5E7E,0x5FCC,0x63EE, +0x673A,0x65D7,0x65E2,0x671F,0x68CB,0x68C4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6A5F,0x5E30,0x6BC5,0x6C17,0x6C7D,0x757F,0x7948, +0x5B63,0x7A00,0x7D00,0x5FBD,0x898F,0x8A18,0x8CB4,0x8D77, +0x8ECC,0x8F1D,0x98E2,0x9A0E,0x9B3C,0x4E80,0x507D,0x5100, +0x5993,0x5B9C,0x622F,0x6280,0x64EC,0x6B3A,0x72A0,0x7591, +0x7947,0x7FA9,0x87FB,0x8ABC,0x8B70,0x63AC,0x83CA,0x97A0, +0x5409,0x5403,0x55AB,0x6854,0x6A58,0x8A70,0x7827,0x6775, +0x9ECD,0x5374,0x5BA2,0x811A,0x8650,0x9006,0x4E18,0x4E45, +0x4EC7,0x4F11,0x53CA,0x5438,0x5BAE,0x5F13,0x6025,0x6551, + 0,0x673D,0x6C42,0x6C72,0x6CE3,0x7078,0x7403,0x7A76, +0x7AAE,0x7B08,0x7D1A,0x7CFE,0x7D66,0x65E7,0x725B,0x53BB, +0x5C45,0x5DE8,0x62D2,0x62E0,0x6319,0x6E20,0x865A,0x8A31, +0x8DDD,0x92F8,0x6F01,0x79A6,0x9B5A,0x4EA8,0x4EAB,0x4EAC, +0x4F9B,0x4FA0,0x50D1,0x5147,0x7AF6,0x5171,0x51F6,0x5354, +0x5321,0x537F,0x53EB,0x55AC,0x5883,0x5CE1,0x5F37,0x5F4A, +0x602F,0x6050,0x606D,0x631F,0x6559,0x6A4B,0x6CC1,0x72C2, +0x72ED,0x77EF,0x80F8,0x8105,0x8208,0x854E,0x90F7,0x93E1, +0x97FF,0x9957,0x9A5A,0x4EF0,0x51DD,0x5C2D,0x6681,0x696D, +0x5C40,0x66F2,0x6975,0x7389,0x6850,0x7C81,0x50C5,0x52E4, +0x5747,0x5DFE,0x9326,0x65A4,0x6B23,0x6B3D,0x7434,0x7981, +0x79BD,0x7B4B,0x7DCA,0x82B9,0x83CC,0x887F,0x895F,0x8B39, +0x8FD1,0x91D1,0x541F,0x9280,0x4E5D,0x5036,0x53E5,0x533A, +0x72D7,0x7396,0x77E9,0x82E6,0x8EAF,0x99C6,0x99C8,0x99D2, +0x5177,0x611A,0x865E,0x55B0,0x7A7A,0x5076,0x5BD3,0x9047, +0x9685,0x4E32,0x6ADB,0x91E7,0x5C51,0x5C48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6398,0x7A9F,0x6C93,0x9774,0x8F61,0x7AAA,0x718A, +0x9688,0x7C82,0x6817,0x7E70,0x6851,0x936C,0x52F2,0x541B, +0x85AB,0x8A13,0x7FA4,0x8ECD,0x90E1,0x5366,0x8888,0x7941, +0x4FC2,0x50BE,0x5211,0x5144,0x5553,0x572D,0x73EA,0x578B, +0x5951,0x5F62,0x5F84,0x6075,0x6176,0x6167,0x61A9,0x63B2, +0x643A,0x656C,0x666F,0x6842,0x6E13,0x7566,0x7A3D,0x7CFB, +0x7D4C,0x7D99,0x7E4B,0x7F6B,0x830E,0x834A,0x86CD,0x8A08, +0x8A63,0x8B66,0x8EFD,0x981A,0x9D8F,0x82B8,0x8FCE,0x9BE8, + 0,0x5287,0x621F,0x6483,0x6FC0,0x9699,0x6841,0x5091, +0x6B20,0x6C7A,0x6F54,0x7A74,0x7D50,0x8840,0x8A23,0x6708, +0x4EF6,0x5039,0x5026,0x5065,0x517C,0x5238,0x5263,0x55A7, +0x570F,0x5805,0x5ACC,0x5EFA,0x61B2,0x61F8,0x62F3,0x6372, +0x691C,0x6A29,0x727D,0x72AC,0x732E,0x7814,0x786F,0x7D79, +0x770C,0x80A9,0x898B,0x8B19,0x8CE2,0x8ED2,0x9063,0x9375, +0x967A,0x9855,0x9A13,0x9E78,0x5143,0x539F,0x53B3,0x5E7B, +0x5F26,0x6E1B,0x6E90,0x7384,0x73FE,0x7D43,0x8237,0x8A00, +0x8AFA,0x9650,0x4E4E,0x500B,0x53E4,0x547C,0x56FA,0x59D1, +0x5B64,0x5DF1,0x5EAB,0x5F27,0x6238,0x6545,0x67AF,0x6E56, +0x72D0,0x7CCA,0x88B4,0x80A1,0x80E1,0x83F0,0x864E,0x8A87, +0x8DE8,0x9237,0x96C7,0x9867,0x9F13,0x4E94,0x4E92,0x4F0D, +0x5348,0x5449,0x543E,0x5A2F,0x5F8C,0x5FA1,0x609F,0x68A7, +0x6A8E,0x745A,0x7881,0x8A9E,0x8AA4,0x8B77,0x9190,0x4E5E, +0x9BC9,0x4EA4,0x4F7C,0x4FAF,0x5019,0x5016,0x5149,0x516C, +0x529F,0x52B9,0x52FE,0x539A,0x53E3,0x5411, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x540E,0x5589,0x5751,0x57A2,0x597D,0x5B54,0x5B5D, +0x5B8F,0x5DE5,0x5DE7,0x5DF7,0x5E78,0x5E83,0x5E9A,0x5EB7, +0x5F18,0x6052,0x614C,0x6297,0x62D8,0x63A7,0x653B,0x6602, +0x6643,0x66F4,0x676D,0x6821,0x6897,0x69CB,0x6C5F,0x6D2A, +0x6D69,0x6E2F,0x6E9D,0x7532,0x7687,0x786C,0x7A3F,0x7CE0, +0x7D05,0x7D18,0x7D5E,0x7DB1,0x8015,0x8003,0x80AF,0x80B1, +0x8154,0x818F,0x822A,0x8352,0x884C,0x8861,0x8B1B,0x8CA2, +0x8CFC,0x90CA,0x9175,0x9271,0x783F,0x92FC,0x95A4,0x964D, + 0,0x9805,0x9999,0x9AD8,0x9D3B,0x525B,0x52AB,0x53F7, +0x5408,0x58D5,0x62F7,0x6FE0,0x8C6A,0x8F5F,0x9EB9,0x514B, +0x523B,0x544A,0x56FD,0x7A40,0x9177,0x9D60,0x9ED2,0x7344, +0x6F09,0x8170,0x7511,0x5FFD,0x60DA,0x9AA8,0x72DB,0x8FBC, +0x6B64,0x9803,0x4ECA,0x56F0,0x5764,0x58BE,0x5A5A,0x6068, +0x61C7,0x660F,0x6606,0x6839,0x68B1,0x6DF7,0x75D5,0x7D3A, +0x826E,0x9B42,0x4E9B,0x4F50,0x53C9,0x5506,0x5D6F,0x5DE6, +0x5DEE,0x67FB,0x6C99,0x7473,0x7802,0x8A50,0x9396,0x88DF, +0x5750,0x5EA7,0x632B,0x50B5,0x50AC,0x518D,0x6700,0x54C9, +0x585E,0x59BB,0x5BB0,0x5F69,0x624D,0x63A1,0x683D,0x6B73, +0x6E08,0x707D,0x91C7,0x7280,0x7815,0x7826,0x796D,0x658E, +0x7D30,0x83DC,0x88C1,0x8F09,0x969B,0x5264,0x5728,0x6750, +0x7F6A,0x8CA1,0x51B4,0x5742,0x962A,0x583A,0x698A,0x80B4, +0x54B2,0x5D0E,0x57FC,0x7895,0x9DFA,0x4F5C,0x524A,0x548B, +0x643E,0x6628,0x6714,0x67F5,0x7A84,0x7B56,0x7D22,0x932F, +0x685C,0x9BAD,0x7B39,0x5319,0x518A,0x5237, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5BDF,0x62F6,0x64AE,0x64E6,0x672D,0x6BBA,0x85A9, +0x96D1,0x7690,0x9BD6,0x634C,0x9306,0x9BAB,0x76BF,0x6652, +0x4E09,0x5098,0x53C2,0x5C71,0x60E8,0x6492,0x6563,0x685F, +0x71E6,0x73CA,0x7523,0x7B97,0x7E82,0x8695,0x8B83,0x8CDB, +0x9178,0x9910,0x65AC,0x66AB,0x6B8B,0x4ED5,0x4ED4,0x4F3A, +0x4F7F,0x523A,0x53F8,0x53F2,0x55E3,0x56DB,0x58EB,0x59CB, +0x59C9,0x59FF,0x5B50,0x5C4D,0x5E02,0x5E2B,0x5FD7,0x601D, +0x6307,0x652F,0x5B5C,0x65AF,0x65BD,0x65E8,0x679D,0x6B62, + 0,0x6B7B,0x6C0F,0x7345,0x7949,0x79C1,0x7CF8,0x7D19, +0x7D2B,0x80A2,0x8102,0x81F3,0x8996,0x8A5E,0x8A69,0x8A66, +0x8A8C,0x8AEE,0x8CC7,0x8CDC,0x96CC,0x98FC,0x6B6F,0x4E8B, +0x4F3C,0x4F8D,0x5150,0x5B57,0x5BFA,0x6148,0x6301,0x6642, +0x6B21,0x6ECB,0x6CBB,0x723E,0x74BD,0x75D4,0x78C1,0x793A, +0x800C,0x8033,0x81EA,0x8494,0x8F9E,0x6C50,0x9E7F,0x5F0F, +0x8B58,0x9D2B,0x7AFA,0x8EF8,0x5B8D,0x96EB,0x4E03,0x53F1, +0x57F7,0x5931,0x5AC9,0x5BA4,0x6089,0x6E7F,0x6F06,0x75BE, +0x8CEA,0x5B9F,0x8500,0x7BE0,0x5072,0x67F4,0x829D,0x5C61, +0x854A,0x7E1E,0x820E,0x5199,0x5C04,0x6368,0x8D66,0x659C, +0x716E,0x793E,0x7D17,0x8005,0x8B1D,0x8ECA,0x906E,0x86C7, +0x90AA,0x501F,0x52FA,0x5C3A,0x6753,0x707C,0x7235,0x914C, +0x91C8,0x932B,0x82E5,0x5BC2,0x5F31,0x60F9,0x4E3B,0x53D6, +0x5B88,0x624B,0x6731,0x6B8A,0x72E9,0x73E0,0x7A2E,0x816B, +0x8DA3,0x9152,0x9996,0x5112,0x53D7,0x546A,0x5BFF,0x6388, +0x6A39,0x7DAC,0x9700,0x56DA,0x53CE,0x5468, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B97,0x5C31,0x5DDE,0x4FEE,0x6101,0x62FE,0x6D32, +0x79C0,0x79CB,0x7D42,0x7E4D,0x7FD2,0x81ED,0x821F,0x8490, +0x8846,0x8972,0x8B90,0x8E74,0x8F2F,0x9031,0x914B,0x916C, +0x96C6,0x919C,0x4EC0,0x4F4F,0x5145,0x5341,0x5F93,0x620E, +0x67D4,0x6C41,0x6E0B,0x7363,0x7E26,0x91CD,0x9283,0x53D4, +0x5919,0x5BBF,0x6DD1,0x795D,0x7E2E,0x7C9B,0x587E,0x719F, +0x51FA,0x8853,0x8FF0,0x4FCA,0x5CFB,0x6625,0x77AC,0x7AE3, +0x821C,0x99FF,0x51C6,0x5FAA,0x65EC,0x696F,0x6B89,0x6DF3, + 0,0x6E96,0x6F64,0x76FE,0x7D14,0x5DE1,0x9075,0x9187, +0x9806,0x51E6,0x521D,0x6240,0x6691,0x66D9,0x6E1A,0x5EB6, +0x7DD2,0x7F72,0x66F8,0x85AF,0x85F7,0x8AF8,0x52A9,0x53D9, +0x5973,0x5E8F,0x5F90,0x6055,0x92E4,0x9664,0x50B7,0x511F, +0x52DD,0x5320,0x5347,0x53EC,0x54E8,0x5546,0x5531,0x5617, +0x5968,0x59BE,0x5A3C,0x5BB5,0x5C06,0x5C0F,0x5C11,0x5C1A, +0x5E84,0x5E8A,0x5EE0,0x5F70,0x627F,0x6284,0x62DB,0x638C, +0x6377,0x6607,0x660C,0x662D,0x6676,0x677E,0x68A2,0x6A1F, +0x6A35,0x6CBC,0x6D88,0x6E09,0x6E58,0x713C,0x7126,0x7167, +0x75C7,0x7701,0x785D,0x7901,0x7965,0x79F0,0x7AE0,0x7B11, +0x7CA7,0x7D39,0x8096,0x83D6,0x848B,0x8549,0x885D,0x88F3, +0x8A1F,0x8A3C,0x8A54,0x8A73,0x8C61,0x8CDE,0x91A4,0x9266, +0x937E,0x9418,0x969C,0x9798,0x4E0A,0x4E08,0x4E1E,0x4E57, +0x5197,0x5270,0x57CE,0x5834,0x58CC,0x5B22,0x5E38,0x60C5, +0x64FE,0x6761,0x6756,0x6D44,0x72B6,0x7573,0x7A63,0x84B8, +0x8B72,0x91B8,0x9320,0x5631,0x57F4,0x98FE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x62ED,0x690D,0x6B96,0x71ED,0x7E54,0x8077,0x8272, +0x89E6,0x98DF,0x8755,0x8FB1,0x5C3B,0x4F38,0x4FE1,0x4FB5, +0x5507,0x5A20,0x5BDD,0x5BE9,0x5FC3,0x614E,0x632F,0x65B0, +0x664B,0x68EE,0x699B,0x6D78,0x6DF1,0x7533,0x75B9,0x771F, +0x795E,0x79E6,0x7D33,0x81E3,0x82AF,0x85AA,0x89AA,0x8A3A, +0x8EAB,0x8F9B,0x9032,0x91DD,0x9707,0x4EBA,0x4EC1,0x5203, +0x5875,0x58EC,0x5C0B,0x751A,0x5C3D,0x814E,0x8A0A,0x8FC5, +0x9663,0x976D,0x7B25,0x8ACF,0x9808,0x9162,0x56F3,0x53A8, + 0,0x9017,0x5439,0x5782,0x5E25,0x63A8,0x6C34,0x708A, +0x7761,0x7C8B,0x7FE0,0x8870,0x9042,0x9154,0x9310,0x9318, +0x968F,0x745E,0x9AC4,0x5D07,0x5D69,0x6570,0x67A2,0x8DA8, +0x96DB,0x636E,0x6749,0x6919,0x83C5,0x9817,0x96C0,0x88FE, +0x6F84,0x647A,0x5BF8,0x4E16,0x702C,0x755D,0x662F,0x51C4, +0x5236,0x52E2,0x59D3,0x5F81,0x6027,0x6210,0x653F,0x6574, +0x661F,0x6674,0x68F2,0x6816,0x6B63,0x6E05,0x7272,0x751F, +0x76DB,0x7CBE,0x8056,0x58F0,0x88FD,0x897F,0x8AA0,0x8A93, +0x8ACB,0x901D,0x9192,0x9752,0x9759,0x6589,0x7A0E,0x8106, +0x96BB,0x5E2D,0x60DC,0x621A,0x65A5,0x6614,0x6790,0x77F3, +0x7A4D,0x7C4D,0x7E3E,0x810A,0x8CAC,0x8D64,0x8DE1,0x8E5F, +0x78A9,0x5207,0x62D9,0x63A5,0x6442,0x6298,0x8A2D,0x7A83, +0x7BC0,0x8AAC,0x96EA,0x7D76,0x820C,0x8749,0x4ED9,0x5148, +0x5343,0x5360,0x5BA3,0x5C02,0x5C16,0x5DDD,0x6226,0x6247, +0x64B0,0x6813,0x6834,0x6CC9,0x6D45,0x6D17,0x67D3,0x6F5C, +0x714E,0x717D,0x65CB,0x7A7F,0x7BAD,0x7DDA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7E4A,0x7FA8,0x817A,0x821B,0x8239,0x85A6,0x8A6E, +0x8CCE,0x8DF5,0x9078,0x9077,0x92AD,0x9291,0x9583,0x9BAE, +0x524D,0x5584,0x6F38,0x7136,0x5168,0x7985,0x7E55,0x81B3, +0x7CCE,0x564C,0x5851,0x5CA8,0x63AA,0x66FE,0x66FD,0x695A, +0x72D9,0x758F,0x758E,0x790E,0x7956,0x79DF,0x7C97,0x7D20, +0x7D44,0x8607,0x8A34,0x963B,0x9061,0x9F20,0x50E7,0x5275, +0x53CC,0x53E2,0x5009,0x55AA,0x58EE,0x594F,0x723D,0x5B8B, +0x5C64,0x531D,0x60E3,0x60F3,0x635C,0x6383,0x633F,0x63BB, + 0,0x64CD,0x65E9,0x66F9,0x5DE3,0x69CD,0x69FD,0x6F15, +0x71E5,0x4E89,0x75E9,0x76F8,0x7A93,0x7CDF,0x7DCF,0x7D9C, +0x8061,0x8349,0x8358,0x846C,0x84BC,0x85FB,0x88C5,0x8D70, +0x9001,0x906D,0x9397,0x971C,0x9A12,0x50CF,0x5897,0x618E, +0x81D3,0x8535,0x8D08,0x9020,0x4FC3,0x5074,0x5247,0x5373, +0x606F,0x6349,0x675F,0x6E2C,0x8DB3,0x901F,0x4FD7,0x5C5E, +0x8CCA,0x65CF,0x7D9A,0x5352,0x8896,0x5176,0x63C3,0x5B58, +0x5B6B,0x5C0A,0x640D,0x6751,0x905C,0x4ED6,0x591A,0x592A, +0x6C70,0x8A51,0x553E,0x5815,0x59A5,0x60F0,0x6253,0x67C1, +0x8235,0x6955,0x9640,0x99C4,0x9A28,0x4F53,0x5806,0x5BFE, +0x8010,0x5CB1,0x5E2F,0x5F85,0x6020,0x614B,0x6234,0x66FF, +0x6CF0,0x6EDE,0x80CE,0x817F,0x82D4,0x888B,0x8CB8,0x9000, +0x902E,0x968A,0x9EDB,0x9BDB,0x4EE3,0x53F0,0x5927,0x7B2C, +0x918D,0x984C,0x9DF9,0x6EDD,0x7027,0x5353,0x5544,0x5B85, +0x6258,0x629E,0x62D3,0x6CA2,0x6FEF,0x7422,0x8A17,0x9438, +0x6FC1,0x8AFE,0x8338,0x51E7,0x86F8,0x53EA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x53E9,0x4F46,0x9054,0x8FB0,0x596A,0x8131,0x5DFD, +0x7AEA,0x8FBF,0x68DA,0x8C37,0x72F8,0x9C48,0x6A3D,0x8AB0, +0x4E39,0x5358,0x5606,0x5766,0x62C5,0x63A2,0x65E6,0x6B4E, +0x6DE1,0x6E5B,0x70AD,0x77ED,0x7AEF,0x7BAA,0x7DBB,0x803D, +0x80C6,0x86CB,0x8A95,0x935B,0x56E3,0x58C7,0x5F3E,0x65AD, +0x6696,0x6A80,0x6BB5,0x7537,0x8AC7,0x5024,0x77E5,0x5730, +0x5F1B,0x6065,0x667A,0x6C60,0x75F4,0x7A1A,0x7F6E,0x81F4, +0x8718,0x9045,0x99B3,0x7BC9,0x755C,0x7AF9,0x7B51,0x84C4, + 0,0x9010,0x79E9,0x7A92,0x8336,0x5AE1,0x7740,0x4E2D, +0x4EF2,0x5B99,0x5FE0,0x62BD,0x663C,0x67F1,0x6CE8,0x866B, +0x8877,0x8A3B,0x914E,0x92F3,0x99D0,0x6A17,0x7026,0x732A, +0x82E7,0x8457,0x8CAF,0x4E01,0x5146,0x51CB,0x558B,0x5BF5, +0x5E16,0x5E33,0x5E81,0x5F14,0x5F35,0x5F6B,0x5FB4,0x61F2, +0x6311,0x66A2,0x671D,0x6F6E,0x7252,0x753A,0x773A,0x8074, +0x8139,0x8178,0x8776,0x8ABF,0x8ADC,0x8D85,0x8DF3,0x929A, +0x9577,0x9802,0x9CE5,0x52C5,0x6357,0x76F4,0x6715,0x6C88, +0x73CD,0x8CC3,0x93AE,0x9673,0x6D25,0x589C,0x690E,0x69CC, +0x8FFD,0x939A,0x75DB,0x901A,0x585A,0x6802,0x63B4,0x69FB, +0x4F43,0x6F2C,0x67D8,0x8FBB,0x8526,0x7DB4,0x9354,0x693F, +0x6F70,0x576A,0x58F7,0x5B2C,0x7D2C,0x722A,0x540A,0x91E3, +0x9DB4,0x4EAD,0x4F4E,0x505C,0x5075,0x5243,0x8C9E,0x5448, +0x5824,0x5B9A,0x5E1D,0x5E95,0x5EAD,0x5EF7,0x5F1F,0x608C, +0x62B5,0x633A,0x63D0,0x68AF,0x6C40,0x7887,0x798E,0x7A0B, +0x7DE0,0x8247,0x8A02,0x8AE6,0x8E44,0x9013, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x90B8,0x912D,0x91D8,0x9F0E,0x6CE5,0x6458,0x64E2, +0x6575,0x6EF4,0x7684,0x7B1B,0x9069,0x93D1,0x6EBA,0x54F2, +0x5FB9,0x64A4,0x8F4D,0x8FED,0x9244,0x5178,0x586B,0x5929, +0x5C55,0x5E97,0x6DFB,0x7E8F,0x751C,0x8CBC,0x8EE2,0x985B, +0x70B9,0x4F1D,0x6BBF,0x6FB1,0x7530,0x96FB,0x514E,0x5410, +0x5835,0x5857,0x59AC,0x5C60,0x5F92,0x6597,0x675C,0x6E21, +0x767B,0x83DF,0x8CED,0x9014,0x90FD,0x934D,0x7825,0x783A, +0x52AA,0x5EA6,0x571F,0x5974,0x6012,0x5012,0x515A,0x51AC, + 0,0x51CD,0x5200,0x5510,0x5854,0x5858,0x5957,0x5B95, +0x5CF6,0x5D8B,0x60BC,0x6295,0x642D,0x6771,0x6843,0x68BC, +0x68DF,0x76D7,0x6DD8,0x6E6F,0x6D9B,0x706F,0x71C8,0x5F53, +0x75D8,0x7977,0x7B49,0x7B54,0x7B52,0x7CD6,0x7D71,0x5230, +0x8463,0x8569,0x85E4,0x8A0E,0x8B04,0x8C46,0x8E0F,0x9003, +0x900F,0x9419,0x9676,0x982D,0x9A30,0x95D8,0x50CD,0x52D5, +0x540C,0x5802,0x5C0E,0x61A7,0x649E,0x6D1E,0x77B3,0x7AE5, +0x80F4,0x8404,0x9053,0x9285,0x5CE0,0x9D07,0x533F,0x5F97, +0x5FB3,0x6D9C,0x7279,0x7763,0x79BF,0x7BE4,0x6BD2,0x72EC, +0x8AAD,0x6803,0x6A61,0x51F8,0x7A81,0x6934,0x5C4A,0x9CF6, +0x82EB,0x5BC5,0x9149,0x701E,0x5678,0x5C6F,0x60C7,0x6566, +0x6C8C,0x8C5A,0x9041,0x9813,0x5451,0x66C7,0x920D,0x5948, +0x90A3,0x5185,0x4E4D,0x51EA,0x8599,0x8B0E,0x7058,0x637A, +0x934B,0x6962,0x99B4,0x7E04,0x7577,0x5357,0x6960,0x8EDF, +0x96E3,0x6C5D,0x4E8C,0x5C3C,0x5F10,0x8FE9,0x5302,0x8CD1, +0x8089,0x8679,0x5EFF,0x65E5,0x4E73,0x5165, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5982,0x5C3F,0x97EE,0x4EFB,0x598A,0x5FCD,0x8A8D, +0x6FE1,0x79B0,0x7962,0x5BE7,0x8471,0x732B,0x71B1,0x5E74, +0x5FF5,0x637B,0x649A,0x71C3,0x7C98,0x4E43,0x5EFC,0x4E4B, +0x57DC,0x56A2,0x60A9,0x6FC3,0x7D0D,0x80FD,0x8133,0x81BF, +0x8FB2,0x8997,0x86A4,0x5DF4,0x628A,0x64AD,0x8987,0x6777, +0x6CE2,0x6D3E,0x7436,0x7834,0x5A46,0x7F75,0x82AD,0x99AC, +0x4FF3,0x5EC3,0x62DD,0x6392,0x6557,0x676F,0x76C3,0x724C, +0x80CC,0x80BA,0x8F29,0x914D,0x500D,0x57F9,0x5A92,0x6885, + 0,0x6973,0x7164,0x72FD,0x8CB7,0x58F2,0x8CE0,0x966A, +0x9019,0x877F,0x79E4,0x77E7,0x8429,0x4F2F,0x5265,0x535A, +0x62CD,0x67CF,0x6CCA,0x767D,0x7B94,0x7C95,0x8236,0x8584, +0x8FEB,0x66DD,0x6F20,0x7206,0x7E1B,0x83AB,0x99C1,0x9EA6, +0x51FD,0x7BB1,0x7872,0x7BB8,0x8087,0x7B48,0x6AE8,0x5E61, +0x808C,0x7551,0x7560,0x516B,0x9262,0x6E8C,0x767A,0x9197, +0x9AEA,0x4F10,0x7F70,0x629C,0x7B4F,0x95A5,0x9CE9,0x567A, +0x5859,0x86E4,0x96BC,0x4F34,0x5224,0x534A,0x53CD,0x53DB, +0x5E06,0x642C,0x6591,0x677F,0x6C3E,0x6C4E,0x7248,0x72AF, +0x73ED,0x7554,0x7E41,0x822C,0x85E9,0x8CA9,0x7BC4,0x91C6, +0x7169,0x9812,0x98EF,0x633D,0x6669,0x756A,0x76E4,0x78D0, +0x8543,0x86EE,0x532A,0x5351,0x5426,0x5983,0x5E87,0x5F7C, +0x60B2,0x6249,0x6279,0x62AB,0x6590,0x6BD4,0x6CCC,0x75B2, +0x76AE,0x7891,0x79D8,0x7DCB,0x7F77,0x80A5,0x88AB,0x8AB9, +0x8CBB,0x907F,0x975E,0x98DB,0x6A0B,0x7C38,0x5099,0x5C3E, +0x5FAE,0x6787,0x6BD8,0x7435,0x7709,0x7F8E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9F3B,0x67CA,0x7A17,0x5339,0x758B,0x9AED,0x5F66, +0x819D,0x83F1,0x8098,0x5F3C,0x5FC5,0x7562,0x7B46,0x903C, +0x6867,0x59EB,0x5A9B,0x7D10,0x767E,0x8B2C,0x4FF5,0x5F6A, +0x6A19,0x6C37,0x6F02,0x74E2,0x7968,0x8868,0x8A55,0x8C79, +0x5EDF,0x63CF,0x75C5,0x79D2,0x82D7,0x9328,0x92F2,0x849C, +0x86ED,0x9C2D,0x54C1,0x5F6C,0x658C,0x6D5C,0x7015,0x8CA7, +0x8CD3,0x983B,0x654F,0x74F6,0x4E0D,0x4ED8,0x57E0,0x592B, +0x5A66,0x5BCC,0x51A8,0x5E03,0x5E9C,0x6016,0x6276,0x6577, + 0,0x65A7,0x666E,0x6D6E,0x7236,0x7B26,0x8150,0x819A, +0x8299,0x8B5C,0x8CA0,0x8CE6,0x8D74,0x961C,0x9644,0x4FAE, +0x64AB,0x6B66,0x821E,0x8461,0x856A,0x90E8,0x5C01,0x6953, +0x98A8,0x847A,0x8557,0x4F0F,0x526F,0x5FA9,0x5E45,0x670D, +0x798F,0x8179,0x8907,0x8986,0x6DF5,0x5F17,0x6255,0x6CB8, +0x4ECF,0x7269,0x9B92,0x5206,0x543B,0x5674,0x58B3,0x61A4, +0x626E,0x711A,0x596E,0x7C89,0x7CDE,0x7D1B,0x96F0,0x6587, +0x805E,0x4E19,0x4F75,0x5175,0x5840,0x5E63,0x5E73,0x5F0A, +0x67C4,0x4E26,0x853D,0x9589,0x965B,0x7C73,0x9801,0x50FB, +0x58C1,0x7656,0x78A7,0x5225,0x77A5,0x8511,0x7B86,0x504F, +0x5909,0x7247,0x7BC7,0x7DE8,0x8FBA,0x8FD4,0x904D,0x4FBF, +0x52C9,0x5A29,0x5F01,0x97AD,0x4FDD,0x8217,0x92EA,0x5703, +0x6355,0x6B69,0x752B,0x88DC,0x8F14,0x7A42,0x52DF,0x5893, +0x6155,0x620A,0x66AE,0x6BCD,0x7C3F,0x83E9,0x5023,0x4FF8, +0x5305,0x5446,0x5831,0x5949,0x5B9D,0x5CF0,0x5CEF,0x5D29, +0x5E96,0x62B1,0x6367,0x653E,0x65B9,0x670B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6CD5,0x6CE1,0x70F9,0x7832,0x7E2B,0x80DE,0x82B3, +0x840C,0x84EC,0x8702,0x8912,0x8A2A,0x8C4A,0x90A6,0x92D2, +0x98FD,0x9CF3,0x9D6C,0x4E4F,0x4EA1,0x508D,0x5256,0x574A, +0x59A8,0x5E3D,0x5FD8,0x5FD9,0x623F,0x66B4,0x671B,0x67D0, +0x68D2,0x5192,0x7D21,0x80AA,0x81A8,0x8B00,0x8C8C,0x8CBF, +0x927E,0x9632,0x5420,0x982C,0x5317,0x50D5,0x535C,0x58A8, +0x64B2,0x6734,0x7267,0x7766,0x7A46,0x91E6,0x52C3,0x6CA1, +0x6B86,0x5800,0x5E4C,0x5954,0x672C,0x7FFB,0x51E1,0x76C6, + 0,0x6469,0x78E8,0x9B54,0x9EBB,0x57CB,0x59B9,0x6627, +0x679A,0x6BCE,0x54E9,0x69D9,0x5E55,0x819C,0x6795,0x9BAA, +0x67FE,0x9C52,0x685D,0x4EA6,0x4FE3,0x53C8,0x62B9,0x672B, +0x6CAB,0x8FC4,0x4FAD,0x7E6D,0x9EBF,0x4E07,0x6162,0x6E80, +0x6F2B,0x8513,0x5473,0x672A,0x9B45,0x5DF3,0x7B95,0x5CAC, +0x5BC6,0x871C,0x6E4A,0x84D1,0x7A14,0x8108,0x5999,0x7C8D, +0x6C11,0x7720,0x52D9,0x5922,0x7121,0x725F,0x77DB,0x9727, +0x9D61,0x690B,0x5A7F,0x5A18,0x51A5,0x540D,0x547D,0x660E, +0x76DF,0x8FF7,0x9298,0x9CF4,0x59EA,0x725D,0x6EC5,0x514D, +0x68C9,0x7DBF,0x7DEC,0x9762,0x9EBA,0x6478,0x6A21,0x8302, +0x5984,0x5B5F,0x6BDB,0x731B,0x76F2,0x7DB2,0x8017,0x8499, +0x5132,0x6728,0x9ED9,0x76EE,0x6762,0x52FF,0x9905,0x5C24, +0x623B,0x7C7E,0x8CB0,0x554F,0x60B6,0x7D0B,0x9580,0x5301, +0x4E5F,0x51B6,0x591C,0x723A,0x8036,0x91CE,0x5F25,0x77E2, +0x5384,0x5F79,0x7D04,0x85AC,0x8A33,0x8E8D,0x9756,0x67F3, +0x85AE,0x9453,0x6109,0x6108,0x6CB9,0x7652, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AED,0x8F38,0x552F,0x4F51,0x512A,0x52C7,0x53CB, +0x5BA5,0x5E7D,0x60A0,0x6182,0x63D6,0x6709,0x67DA,0x6E67, +0x6D8C,0x7336,0x7337,0x7531,0x7950,0x88D5,0x8A98,0x904A, +0x9091,0x90F5,0x96C4,0x878D,0x5915,0x4E88,0x4F59,0x4E0E, +0x8A89,0x8F3F,0x9810,0x50AD,0x5E7C,0x5996,0x5BB9,0x5EB8, +0x63DA,0x63FA,0x64C1,0x66DC,0x694A,0x69D8,0x6D0B,0x6EB6, +0x7194,0x7528,0x7AAF,0x7F8A,0x8000,0x8449,0x84C9,0x8981, +0x8B21,0x8E0A,0x9065,0x967D,0x990A,0x617E,0x6291,0x6B32, + 0,0x6C83,0x6D74,0x7FCC,0x7FFC,0x6DC0,0x7F85,0x87BA, +0x88F8,0x6765,0x83B1,0x983C,0x96F7,0x6D1B,0x7D61,0x843D, +0x916A,0x4E71,0x5375,0x5D50,0x6B04,0x6FEB,0x85CD,0x862D, +0x89A7,0x5229,0x540F,0x5C65,0x674E,0x68A8,0x7406,0x7483, +0x75E2,0x88CF,0x88E1,0x91CC,0x96E2,0x9678,0x5F8B,0x7387, +0x7ACB,0x844E,0x63A0,0x7565,0x5289,0x6D41,0x6E9C,0x7409, +0x7559,0x786B,0x7C92,0x9686,0x7ADC,0x9F8D,0x4FB6,0x616E, +0x65C5,0x865C,0x4E86,0x4EAE,0x50DA,0x4E21,0x51CC,0x5BEE, +0x6599,0x6881,0x6DBC,0x731F,0x7642,0x77AD,0x7A1C,0x7CE7, +0x826F,0x8AD2,0x907C,0x91CF,0x9675,0x9818,0x529B,0x7DD1, +0x502B,0x5398,0x6797,0x6DCB,0x71D0,0x7433,0x81E8,0x8F2A, +0x96A3,0x9C57,0x9E9F,0x7460,0x5841,0x6D99,0x7D2F,0x985E, +0x4EE4,0x4F36,0x4F8B,0x51B7,0x52B1,0x5DBA,0x601C,0x73B2, +0x793C,0x82D3,0x9234,0x96B7,0x96F6,0x970A,0x9E97,0x9F62, +0x66A6,0x6B74,0x5217,0x52A3,0x70C8,0x88C2,0x5EC9,0x604B, +0x6190,0x6F23,0x7149,0x7C3E,0x7DF4,0x806F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x84EE,0x9023,0x932C,0x5442,0x9B6F,0x6AD3,0x7089, +0x8CC2,0x8DEF,0x9732,0x52B4,0x5A41,0x5ECA,0x5F04,0x6717, +0x697C,0x6994,0x6D6A,0x6F0F,0x7262,0x72FC,0x7BED,0x8001, +0x807E,0x874B,0x90CE,0x516D,0x9E93,0x7984,0x808B,0x9332, +0x8AD6,0x502D,0x548C,0x8A71,0x6B6A,0x8CC4,0x8107,0x60D1, +0x67A0,0x9DF2,0x4E99,0x4E98,0x9C10,0x8A6B,0x85C1,0x8568, +0x6900,0x6E7E,0x7897,0x8155, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F0C,0x4E10,0x4E15,0x4E2A,0x4E31,0x4E36,0x4E3C,0x4E3F, +0x4E42,0x4E56,0x4E58,0x4E82,0x4E85,0x8C6B,0x4E8A,0x8212, +0x5F0D,0x4E8E,0x4E9E,0x4E9F,0x4EA0,0x4EA2,0x4EB0,0x4EB3, +0x4EB6,0x4ECE,0x4ECD,0x4EC4,0x4EC6,0x4EC2,0x4ED7,0x4EDE, +0x4EED,0x4EDF,0x4EF7,0x4F09,0x4F5A,0x4F30,0x4F5B,0x4F5D, +0x4F57,0x4F47,0x4F76,0x4F88,0x4F8F,0x4F98,0x4F7B,0x4F69, +0x4F70,0x4F91,0x4F6F,0x4F86,0x4F96,0x5118,0x4FD4,0x4FDF, +0x4FCE,0x4FD8,0x4FDB,0x4FD1,0x4FDA,0x4FD0,0x4FE4,0x4FE5, +0x501A,0x5028,0x5014,0x502A,0x5025,0x5005,0x4F1C,0x4FF6, +0x5021,0x5029,0x502C,0x4FFE,0x4FEF,0x5011,0x5006,0x5043, +0x5047,0x6703,0x5055,0x5050,0x5048,0x505A,0x5056,0x506C, +0x5078,0x5080,0x509A,0x5085,0x50B4,0x50B2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x50C9,0x50CA,0x50B3,0x50C2,0x50D6,0x50DE,0x50E5, +0x50ED,0x50E3,0x50EE,0x50F9,0x50F5,0x5109,0x5101,0x5102, +0x5116,0x5115,0x5114,0x511A,0x5121,0x513A,0x5137,0x513C, +0x513B,0x513F,0x5140,0x5152,0x514C,0x5154,0x5162,0x7AF8, +0x5169,0x516A,0x516E,0x5180,0x5182,0x56D8,0x518C,0x5189, +0x518F,0x5191,0x5193,0x5195,0x5196,0x51A4,0x51A6,0x51A2, +0x51A9,0x51AA,0x51AB,0x51B3,0x51B1,0x51B2,0x51B0,0x51B5, +0x51BD,0x51C5,0x51C9,0x51DB,0x51E0,0x8655,0x51E9,0x51ED, + 0,0x51F0,0x51F5,0x51FE,0x5204,0x520B,0x5214,0x520E, +0x5227,0x522A,0x522E,0x5233,0x5239,0x524F,0x5244,0x524B, +0x524C,0x525E,0x5254,0x526A,0x5274,0x5269,0x5273,0x527F, +0x527D,0x528D,0x5294,0x5292,0x5271,0x5288,0x5291,0x8FA8, +0x8FA7,0x52AC,0x52AD,0x52BC,0x52B5,0x52C1,0x52CD,0x52D7, +0x52DE,0x52E3,0x52E6,0x98ED,0x52E0,0x52F3,0x52F5,0x52F8, +0x52F9,0x5306,0x5308,0x7538,0x530D,0x5310,0x530F,0x5315, +0x531A,0x5323,0x532F,0x5331,0x5333,0x5338,0x5340,0x5346, +0x5345,0x4E17,0x5349,0x534D,0x51D6,0x535E,0x5369,0x536E, +0x5918,0x537B,0x5377,0x5382,0x5396,0x53A0,0x53A6,0x53A5, +0x53AE,0x53B0,0x53B6,0x53C3,0x7C12,0x96D9,0x53DF,0x66FC, +0x71EE,0x53EE,0x53E8,0x53ED,0x53FA,0x5401,0x543D,0x5440, +0x542C,0x542D,0x543C,0x542E,0x5436,0x5429,0x541D,0x544E, +0x548F,0x5475,0x548E,0x545F,0x5471,0x5477,0x5470,0x5492, +0x547B,0x5480,0x5476,0x5484,0x5490,0x5486,0x54C7,0x54A2, +0x54B8,0x54A5,0x54AC,0x54C4,0x54C8,0x54A8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x54AB,0x54C2,0x54A4,0x54BE,0x54BC,0x54D8,0x54E5, +0x54E6,0x550F,0x5514,0x54FD,0x54EE,0x54ED,0x54FA,0x54E2, +0x5539,0x5540,0x5563,0x554C,0x552E,0x555C,0x5545,0x5556, +0x5557,0x5538,0x5533,0x555D,0x5599,0x5580,0x54AF,0x558A, +0x559F,0x557B,0x557E,0x5598,0x559E,0x55AE,0x557C,0x5583, +0x55A9,0x5587,0x55A8,0x55DA,0x55C5,0x55DF,0x55C4,0x55DC, +0x55E4,0x55D4,0x5614,0x55F7,0x5616,0x55FE,0x55FD,0x561B, +0x55F9,0x564E,0x5650,0x71DF,0x5634,0x5636,0x5632,0x5638, + 0,0x566B,0x5664,0x562F,0x566C,0x566A,0x5686,0x5680, +0x568A,0x56A0,0x5694,0x568F,0x56A5,0x56AE,0x56B6,0x56B4, +0x56C2,0x56BC,0x56C1,0x56C3,0x56C0,0x56C8,0x56CE,0x56D1, +0x56D3,0x56D7,0x56EE,0x56F9,0x5700,0x56FF,0x5704,0x5709, +0x5708,0x570B,0x570D,0x5713,0x5718,0x5716,0x55C7,0x571C, +0x5726,0x5737,0x5738,0x574E,0x573B,0x5740,0x574F,0x5769, +0x57C0,0x5788,0x5761,0x577F,0x5789,0x5793,0x57A0,0x57B3, +0x57A4,0x57AA,0x57B0,0x57C3,0x57C6,0x57D4,0x57D2,0x57D3, +0x580A,0x57D6,0x57E3,0x580B,0x5819,0x581D,0x5872,0x5821, +0x5862,0x584B,0x5870,0x6BC0,0x5852,0x583D,0x5879,0x5885, +0x58B9,0x589F,0x58AB,0x58BA,0x58DE,0x58BB,0x58B8,0x58AE, +0x58C5,0x58D3,0x58D1,0x58D7,0x58D9,0x58D8,0x58E5,0x58DC, +0x58E4,0x58DF,0x58EF,0x58FA,0x58F9,0x58FB,0x58FC,0x58FD, +0x5902,0x590A,0x5910,0x591B,0x68A6,0x5925,0x592C,0x592D, +0x5932,0x5938,0x593E,0x7AD2,0x5955,0x5950,0x594E,0x595A, +0x5958,0x5962,0x5960,0x5967,0x596C,0x5969, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5978,0x5981,0x599D,0x4F5E,0x4FAB,0x59A3,0x59B2, +0x59C6,0x59E8,0x59DC,0x598D,0x59D9,0x59DA,0x5A25,0x5A1F, +0x5A11,0x5A1C,0x5A09,0x5A1A,0x5A40,0x5A6C,0x5A49,0x5A35, +0x5A36,0x5A62,0x5A6A,0x5A9A,0x5ABC,0x5ABE,0x5ACB,0x5AC2, +0x5ABD,0x5AE3,0x5AD7,0x5AE6,0x5AE9,0x5AD6,0x5AFA,0x5AFB, +0x5B0C,0x5B0B,0x5B16,0x5B32,0x5AD0,0x5B2A,0x5B36,0x5B3E, +0x5B43,0x5B45,0x5B40,0x5B51,0x5B55,0x5B5A,0x5B5B,0x5B65, +0x5B69,0x5B70,0x5B73,0x5B75,0x5B78,0x6588,0x5B7A,0x5B80, + 0,0x5B83,0x5BA6,0x5BB8,0x5BC3,0x5BC7,0x5BC9,0x5BD4, +0x5BD0,0x5BE4,0x5BE6,0x5BE2,0x5BDE,0x5BE5,0x5BEB,0x5BF0, +0x5BF6,0x5BF3,0x5C05,0x5C07,0x5C08,0x5C0D,0x5C13,0x5C20, +0x5C22,0x5C28,0x5C38,0x5C39,0x5C41,0x5C46,0x5C4E,0x5C53, +0x5C50,0x5C4F,0x5B71,0x5C6C,0x5C6E,0x4E62,0x5C76,0x5C79, +0x5C8C,0x5C91,0x5C94,0x599B,0x5CAB,0x5CBB,0x5CB6,0x5CBC, +0x5CB7,0x5CC5,0x5CBE,0x5CC7,0x5CD9,0x5CE9,0x5CFD,0x5CFA, +0x5CED,0x5D8C,0x5CEA,0x5D0B,0x5D15,0x5D17,0x5D5C,0x5D1F, +0x5D1B,0x5D11,0x5D14,0x5D22,0x5D1A,0x5D19,0x5D18,0x5D4C, +0x5D52,0x5D4E,0x5D4B,0x5D6C,0x5D73,0x5D76,0x5D87,0x5D84, +0x5D82,0x5DA2,0x5D9D,0x5DAC,0x5DAE,0x5DBD,0x5D90,0x5DB7, +0x5DBC,0x5DC9,0x5DCD,0x5DD3,0x5DD2,0x5DD6,0x5DDB,0x5DEB, +0x5DF2,0x5DF5,0x5E0B,0x5E1A,0x5E19,0x5E11,0x5E1B,0x5E36, +0x5E37,0x5E44,0x5E43,0x5E40,0x5E4E,0x5E57,0x5E54,0x5E5F, +0x5E62,0x5E64,0x5E47,0x5E75,0x5E76,0x5E7A,0x9EBC,0x5E7F, +0x5EA0,0x5EC1,0x5EC2,0x5EC8,0x5ED0,0x5ECF, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5ED6,0x5EE3,0x5EDD,0x5EDA,0x5EDB,0x5EE2,0x5EE1, +0x5EE8,0x5EE9,0x5EEC,0x5EF1,0x5EF3,0x5EF0,0x5EF4,0x5EF8, +0x5EFE,0x5F03,0x5F09,0x5F5D,0x5F5C,0x5F0B,0x5F11,0x5F16, +0x5F29,0x5F2D,0x5F38,0x5F41,0x5F48,0x5F4C,0x5F4E,0x5F2F, +0x5F51,0x5F56,0x5F57,0x5F59,0x5F61,0x5F6D,0x5F73,0x5F77, +0x5F83,0x5F82,0x5F7F,0x5F8A,0x5F88,0x5F91,0x5F87,0x5F9E, +0x5F99,0x5F98,0x5FA0,0x5FA8,0x5FAD,0x5FBC,0x5FD6,0x5FFB, +0x5FE4,0x5FF8,0x5FF1,0x5FDD,0x60B3,0x5FFF,0x6021,0x6060, + 0,0x6019,0x6010,0x6029,0x600E,0x6031,0x601B,0x6015, +0x602B,0x6026,0x600F,0x603A,0x605A,0x6041,0x606A,0x6077, +0x605F,0x604A,0x6046,0x604D,0x6063,0x6043,0x6064,0x6042, +0x606C,0x606B,0x6059,0x6081,0x608D,0x60E7,0x6083,0x609A, +0x6084,0x609B,0x6096,0x6097,0x6092,0x60A7,0x608B,0x60E1, +0x60B8,0x60E0,0x60D3,0x60B4,0x5FF0,0x60BD,0x60C6,0x60B5, +0x60D8,0x614D,0x6115,0x6106,0x60F6,0x60F7,0x6100,0x60F4, +0x60FA,0x6103,0x6121,0x60FB,0x60F1,0x610D,0x610E,0x6147, +0x613E,0x6128,0x6127,0x614A,0x613F,0x613C,0x612C,0x6134, +0x613D,0x6142,0x6144,0x6173,0x6177,0x6158,0x6159,0x615A, +0x616B,0x6174,0x616F,0x6165,0x6171,0x615F,0x615D,0x6153, +0x6175,0x6199,0x6196,0x6187,0x61AC,0x6194,0x619A,0x618A, +0x6191,0x61AB,0x61AE,0x61CC,0x61CA,0x61C9,0x61F7,0x61C8, +0x61C3,0x61C6,0x61BA,0x61CB,0x7F79,0x61CD,0x61E6,0x61E3, +0x61F6,0x61FA,0x61F4,0x61FF,0x61FD,0x61FC,0x61FE,0x6200, +0x6208,0x6209,0x620D,0x620C,0x6214,0x621B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x621E,0x6221,0x622A,0x622E,0x6230,0x6232,0x6233, +0x6241,0x624E,0x625E,0x6263,0x625B,0x6260,0x6268,0x627C, +0x6282,0x6289,0x627E,0x6292,0x6293,0x6296,0x62D4,0x6283, +0x6294,0x62D7,0x62D1,0x62BB,0x62CF,0x62FF,0x62C6,0x64D4, +0x62C8,0x62DC,0x62CC,0x62CA,0x62C2,0x62C7,0x629B,0x62C9, +0x630C,0x62EE,0x62F1,0x6327,0x6302,0x6308,0x62EF,0x62F5, +0x6350,0x633E,0x634D,0x641C,0x634F,0x6396,0x638E,0x6380, +0x63AB,0x6376,0x63A3,0x638F,0x6389,0x639F,0x63B5,0x636B, + 0,0x6369,0x63BE,0x63E9,0x63C0,0x63C6,0x63E3,0x63C9, +0x63D2,0x63F6,0x63C4,0x6416,0x6434,0x6406,0x6413,0x6426, +0x6436,0x651D,0x6417,0x6428,0x640F,0x6467,0x646F,0x6476, +0x644E,0x652A,0x6495,0x6493,0x64A5,0x64A9,0x6488,0x64BC, +0x64DA,0x64D2,0x64C5,0x64C7,0x64BB,0x64D8,0x64C2,0x64F1, +0x64E7,0x8209,0x64E0,0x64E1,0x62AC,0x64E3,0x64EF,0x652C, +0x64F6,0x64F4,0x64F2,0x64FA,0x6500,0x64FD,0x6518,0x651C, +0x6505,0x6524,0x6523,0x652B,0x6534,0x6535,0x6537,0x6536, +0x6538,0x754B,0x6548,0x6556,0x6555,0x654D,0x6558,0x655E, +0x655D,0x6572,0x6578,0x6582,0x6583,0x8B8A,0x659B,0x659F, +0x65AB,0x65B7,0x65C3,0x65C6,0x65C1,0x65C4,0x65CC,0x65D2, +0x65DB,0x65D9,0x65E0,0x65E1,0x65F1,0x6772,0x660A,0x6603, +0x65FB,0x6773,0x6635,0x6636,0x6634,0x661C,0x664F,0x6644, +0x6649,0x6641,0x665E,0x665D,0x6664,0x6667,0x6668,0x665F, +0x6662,0x6670,0x6683,0x6688,0x668E,0x6689,0x6684,0x6698, +0x669D,0x66C1,0x66B9,0x66C9,0x66BE,0x66BC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x66C4,0x66B8,0x66D6,0x66DA,0x66E0,0x663F,0x66E6, +0x66E9,0x66F0,0x66F5,0x66F7,0x670F,0x6716,0x671E,0x6726, +0x6727,0x9738,0x672E,0x673F,0x6736,0x6741,0x6738,0x6737, +0x6746,0x675E,0x6760,0x6759,0x6763,0x6764,0x6789,0x6770, +0x67A9,0x677C,0x676A,0x678C,0x678B,0x67A6,0x67A1,0x6785, +0x67B7,0x67EF,0x67B4,0x67EC,0x67B3,0x67E9,0x67B8,0x67E4, +0x67DE,0x67DD,0x67E2,0x67EE,0x67B9,0x67CE,0x67C6,0x67E7, +0x6A9C,0x681E,0x6846,0x6829,0x6840,0x684D,0x6832,0x684E, + 0,0x68B3,0x682B,0x6859,0x6863,0x6877,0x687F,0x689F, +0x688F,0x68AD,0x6894,0x689D,0x689B,0x6883,0x6AAE,0x68B9, +0x6874,0x68B5,0x68A0,0x68BA,0x690F,0x688D,0x687E,0x6901, +0x68CA,0x6908,0x68D8,0x6922,0x6926,0x68E1,0x690C,0x68CD, +0x68D4,0x68E7,0x68D5,0x6936,0x6912,0x6904,0x68D7,0x68E3, +0x6925,0x68F9,0x68E0,0x68EF,0x6928,0x692A,0x691A,0x6923, +0x6921,0x68C6,0x6979,0x6977,0x695C,0x6978,0x696B,0x6954, +0x697E,0x696E,0x6939,0x6974,0x693D,0x6959,0x6930,0x6961, +0x695E,0x695D,0x6981,0x696A,0x69B2,0x69AE,0x69D0,0x69BF, +0x69C1,0x69D3,0x69BE,0x69CE,0x5BE8,0x69CA,0x69DD,0x69BB, +0x69C3,0x69A7,0x6A2E,0x6991,0x69A0,0x699C,0x6995,0x69B4, +0x69DE,0x69E8,0x6A02,0x6A1B,0x69FF,0x6B0A,0x69F9,0x69F2, +0x69E7,0x6A05,0x69B1,0x6A1E,0x69ED,0x6A14,0x69EB,0x6A0A, +0x6A12,0x6AC1,0x6A23,0x6A13,0x6A44,0x6A0C,0x6A72,0x6A36, +0x6A78,0x6A47,0x6A62,0x6A59,0x6A66,0x6A48,0x6A38,0x6A22, +0x6A90,0x6A8D,0x6AA0,0x6A84,0x6AA2,0x6AA3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6A97,0x8617,0x6ABB,0x6AC3,0x6AC2,0x6AB8,0x6AB3, +0x6AAC,0x6ADE,0x6AD1,0x6ADF,0x6AAA,0x6ADA,0x6AEA,0x6AFB, +0x6B05,0x8616,0x6AFA,0x6B12,0x6B16,0x9B31,0x6B1F,0x6B38, +0x6B37,0x76DC,0x6B39,0x98EE,0x6B47,0x6B43,0x6B49,0x6B50, +0x6B59,0x6B54,0x6B5B,0x6B5F,0x6B61,0x6B78,0x6B79,0x6B7F, +0x6B80,0x6B84,0x6B83,0x6B8D,0x6B98,0x6B95,0x6B9E,0x6BA4, +0x6BAA,0x6BAB,0x6BAF,0x6BB2,0x6BB1,0x6BB3,0x6BB7,0x6BBC, +0x6BC6,0x6BCB,0x6BD3,0x6BDF,0x6BEC,0x6BEB,0x6BF3,0x6BEF, + 0,0x9EBE,0x6C08,0x6C13,0x6C14,0x6C1B,0x6C24,0x6C23, +0x6C5E,0x6C55,0x6C62,0x6C6A,0x6C82,0x6C8D,0x6C9A,0x6C81, +0x6C9B,0x6C7E,0x6C68,0x6C73,0x6C92,0x6C90,0x6CC4,0x6CF1, +0x6CD3,0x6CBD,0x6CD7,0x6CC5,0x6CDD,0x6CAE,0x6CB1,0x6CBE, +0x6CBA,0x6CDB,0x6CEF,0x6CD9,0x6CEA,0x6D1F,0x884D,0x6D36, +0x6D2B,0x6D3D,0x6D38,0x6D19,0x6D35,0x6D33,0x6D12,0x6D0C, +0x6D63,0x6D93,0x6D64,0x6D5A,0x6D79,0x6D59,0x6D8E,0x6D95, +0x6FE4,0x6D85,0x6DF9,0x6E15,0x6E0A,0x6DB5,0x6DC7,0x6DE6, +0x6DB8,0x6DC6,0x6DEC,0x6DDE,0x6DCC,0x6DE8,0x6DD2,0x6DC5, +0x6DFA,0x6DD9,0x6DE4,0x6DD5,0x6DEA,0x6DEE,0x6E2D,0x6E6E, +0x6E2E,0x6E19,0x6E72,0x6E5F,0x6E3E,0x6E23,0x6E6B,0x6E2B, +0x6E76,0x6E4D,0x6E1F,0x6E43,0x6E3A,0x6E4E,0x6E24,0x6EFF, +0x6E1D,0x6E38,0x6E82,0x6EAA,0x6E98,0x6EC9,0x6EB7,0x6ED3, +0x6EBD,0x6EAF,0x6EC4,0x6EB2,0x6ED4,0x6ED5,0x6E8F,0x6EA5, +0x6EC2,0x6E9F,0x6F41,0x6F11,0x704C,0x6EEC,0x6EF8,0x6EFE, +0x6F3F,0x6EF2,0x6F31,0x6EEF,0x6F32,0x6ECC}; + +/* page 4 0xE040-0xEAA4 */ +static uint16 tab_cp932_uni4[]={ +0x6F3E,0x6F13,0x6EF7,0x6F86,0x6F7A,0x6F78,0x6F81,0x6F80, +0x6F6F,0x6F5B,0x6FF3,0x6F6D,0x6F82,0x6F7C,0x6F58,0x6F8E, +0x6F91,0x6FC2,0x6F66,0x6FB3,0x6FA3,0x6FA1,0x6FA4,0x6FB9, +0x6FC6,0x6FAA,0x6FDF,0x6FD5,0x6FEC,0x6FD4,0x6FD8,0x6FF1, +0x6FEE,0x6FDB,0x7009,0x700B,0x6FFA,0x7011,0x7001,0x700F, +0x6FFE,0x701B,0x701A,0x6F74,0x701D,0x7018,0x701F,0x7030, +0x703E,0x7032,0x7051,0x7063,0x7099,0x7092,0x70AF,0x70F1, +0x70AC,0x70B8,0x70B3,0x70AE,0x70DF,0x70CB,0x70DD, 0, +0x70D9,0x7109,0x70FD,0x711C,0x7119,0x7165,0x7155,0x7188, +0x7166,0x7162,0x714C,0x7156,0x716C,0x718F,0x71FB,0x7184, +0x7195,0x71A8,0x71AC,0x71D7,0x71B9,0x71BE,0x71D2,0x71C9, +0x71D4,0x71CE,0x71E0,0x71EC,0x71E7,0x71F5,0x71FC,0x71F9, +0x71FF,0x720D,0x7210,0x721B,0x7228,0x722D,0x722C,0x7230, +0x7232,0x723B,0x723C,0x723F,0x7240,0x7246,0x724B,0x7258, +0x7274,0x727E,0x7282,0x7281,0x7287,0x7292,0x7296,0x72A2, +0x72A7,0x72B9,0x72B2,0x72C3,0x72C6,0x72C4,0x72CE,0x72D2, +0x72E2,0x72E0,0x72E1,0x72F9,0x72F7,0x500F,0x7317,0x730A, +0x731C,0x7316,0x731D,0x7334,0x732F,0x7329,0x7325,0x733E, +0x734E,0x734F,0x9ED8,0x7357,0x736A,0x7368,0x7370,0x7378, +0x7375,0x737B,0x737A,0x73C8,0x73B3,0x73CE,0x73BB,0x73C0, +0x73E5,0x73EE,0x73DE,0x74A2,0x7405,0x746F,0x7425,0x73F8, +0x7432,0x743A,0x7455,0x743F,0x745F,0x7459,0x7441,0x745C, +0x7469,0x7470,0x7463,0x746A,0x7476,0x747E,0x748B,0x749E, +0x74A7,0x74CA,0x74CF,0x74D4,0x73F1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x74E0,0x74E3,0x74E7,0x74E9,0x74EE,0x74F2,0x74F0,0x74F1, +0x74F8,0x74F7,0x7504,0x7503,0x7505,0x750C,0x750E,0x750D, +0x7515,0x7513,0x751E,0x7526,0x752C,0x753C,0x7544,0x754D, +0x754A,0x7549,0x755B,0x7546,0x755A,0x7569,0x7564,0x7567, +0x756B,0x756D,0x7578,0x7576,0x7586,0x7587,0x7574,0x758A, +0x7589,0x7582,0x7594,0x759A,0x759D,0x75A5,0x75A3,0x75C2, +0x75B3,0x75C3,0x75B5,0x75BD,0x75B8,0x75BC,0x75B1,0x75CD, +0x75CA,0x75D2,0x75D9,0x75E3,0x75DE,0x75FE,0x75FF, 0, +0x75FC,0x7601,0x75F0,0x75FA,0x75F2,0x75F3,0x760B,0x760D, +0x7609,0x761F,0x7627,0x7620,0x7621,0x7622,0x7624,0x7634, +0x7630,0x763B,0x7647,0x7648,0x7646,0x765C,0x7658,0x7661, +0x7662,0x7668,0x7669,0x766A,0x7667,0x766C,0x7670,0x7672, +0x7676,0x7678,0x767C,0x7680,0x7683,0x7688,0x768B,0x768E, +0x7696,0x7693,0x7699,0x769A,0x76B0,0x76B4,0x76B8,0x76B9, +0x76BA,0x76C2,0x76CD,0x76D6,0x76D2,0x76DE,0x76E1,0x76E5, +0x76E7,0x76EA,0x862F,0x76FB,0x7708,0x7707,0x7704,0x7729, +0x7724,0x771E,0x7725,0x7726,0x771B,0x7737,0x7738,0x7747, +0x775A,0x7768,0x776B,0x775B,0x7765,0x777F,0x777E,0x7779, +0x778E,0x778B,0x7791,0x77A0,0x779E,0x77B0,0x77B6,0x77B9, +0x77BF,0x77BC,0x77BD,0x77BB,0x77C7,0x77CD,0x77D7,0x77DA, +0x77DC,0x77E3,0x77EE,0x77FC,0x780C,0x7812,0x7926,0x7820, +0x792A,0x7845,0x788E,0x7874,0x7886,0x787C,0x789A,0x788C, +0x78A3,0x78B5,0x78AA,0x78AF,0x78D1,0x78C6,0x78CB,0x78D4, +0x78BE,0x78BC,0x78C5,0x78CA,0x78EC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x78E7,0x78DA,0x78FD,0x78F4,0x7907,0x7912,0x7911,0x7919, +0x792C,0x792B,0x7940,0x7960,0x7957,0x795F,0x795A,0x7955, +0x7953,0x797A,0x797F,0x798A,0x799D,0x79A7,0x9F4B,0x79AA, +0x79AE,0x79B3,0x79B9,0x79BA,0x79C9,0x79D5,0x79E7,0x79EC, +0x79E1,0x79E3,0x7A08,0x7A0D,0x7A18,0x7A19,0x7A20,0x7A1F, +0x7980,0x7A31,0x7A3B,0x7A3E,0x7A37,0x7A43,0x7A57,0x7A49, +0x7A61,0x7A62,0x7A69,0x9F9D,0x7A70,0x7A79,0x7A7D,0x7A88, +0x7A97,0x7A95,0x7A98,0x7A96,0x7AA9,0x7AC8,0x7AB0, 0, +0x7AB6,0x7AC5,0x7AC4,0x7ABF,0x9083,0x7AC7,0x7ACA,0x7ACD, +0x7ACF,0x7AD5,0x7AD3,0x7AD9,0x7ADA,0x7ADD,0x7AE1,0x7AE2, +0x7AE6,0x7AED,0x7AF0,0x7B02,0x7B0F,0x7B0A,0x7B06,0x7B33, +0x7B18,0x7B19,0x7B1E,0x7B35,0x7B28,0x7B36,0x7B50,0x7B7A, +0x7B04,0x7B4D,0x7B0B,0x7B4C,0x7B45,0x7B75,0x7B65,0x7B74, +0x7B67,0x7B70,0x7B71,0x7B6C,0x7B6E,0x7B9D,0x7B98,0x7B9F, +0x7B8D,0x7B9C,0x7B9A,0x7B8B,0x7B92,0x7B8F,0x7B5D,0x7B99, +0x7BCB,0x7BC1,0x7BCC,0x7BCF,0x7BB4,0x7BC6,0x7BDD,0x7BE9, +0x7C11,0x7C14,0x7BE6,0x7BE5,0x7C60,0x7C00,0x7C07,0x7C13, +0x7BF3,0x7BF7,0x7C17,0x7C0D,0x7BF6,0x7C23,0x7C27,0x7C2A, +0x7C1F,0x7C37,0x7C2B,0x7C3D,0x7C4C,0x7C43,0x7C54,0x7C4F, +0x7C40,0x7C50,0x7C58,0x7C5F,0x7C64,0x7C56,0x7C65,0x7C6C, +0x7C75,0x7C83,0x7C90,0x7CA4,0x7CAD,0x7CA2,0x7CAB,0x7CA1, +0x7CA8,0x7CB3,0x7CB2,0x7CB1,0x7CAE,0x7CB9,0x7CBD,0x7CC0, +0x7CC5,0x7CC2,0x7CD8,0x7CD2,0x7CDC,0x7CE2,0x9B3B,0x7CEF, +0x7CF2,0x7CF4,0x7CF6,0x7CFA,0x7D06, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7D02,0x7D1C,0x7D15,0x7D0A,0x7D45,0x7D4B,0x7D2E,0x7D32, +0x7D3F,0x7D35,0x7D46,0x7D73,0x7D56,0x7D4E,0x7D72,0x7D68, +0x7D6E,0x7D4F,0x7D63,0x7D93,0x7D89,0x7D5B,0x7D8F,0x7D7D, +0x7D9B,0x7DBA,0x7DAE,0x7DA3,0x7DB5,0x7DC7,0x7DBD,0x7DAB, +0x7E3D,0x7DA2,0x7DAF,0x7DDC,0x7DB8,0x7D9F,0x7DB0,0x7DD8, +0x7DDD,0x7DE4,0x7DDE,0x7DFB,0x7DF2,0x7DE1,0x7E05,0x7E0A, +0x7E23,0x7E21,0x7E12,0x7E31,0x7E1F,0x7E09,0x7E0B,0x7E22, +0x7E46,0x7E66,0x7E3B,0x7E35,0x7E39,0x7E43,0x7E37, 0, +0x7E32,0x7E3A,0x7E67,0x7E5D,0x7E56,0x7E5E,0x7E59,0x7E5A, +0x7E79,0x7E6A,0x7E69,0x7E7C,0x7E7B,0x7E83,0x7DD5,0x7E7D, +0x8FAE,0x7E7F,0x7E88,0x7E89,0x7E8C,0x7E92,0x7E90,0x7E93, +0x7E94,0x7E96,0x7E8E,0x7E9B,0x7E9C,0x7F38,0x7F3A,0x7F45, +0x7F4C,0x7F4D,0x7F4E,0x7F50,0x7F51,0x7F55,0x7F54,0x7F58, +0x7F5F,0x7F60,0x7F68,0x7F69,0x7F67,0x7F78,0x7F82,0x7F86, +0x7F83,0x7F88,0x7F87,0x7F8C,0x7F94,0x7F9E,0x7F9D,0x7F9A, +0x7FA3,0x7FAF,0x7FB2,0x7FB9,0x7FAE,0x7FB6,0x7FB8,0x8B71, +0x7FC5,0x7FC6,0x7FCA,0x7FD5,0x7FD4,0x7FE1,0x7FE6,0x7FE9, +0x7FF3,0x7FF9,0x98DC,0x8006,0x8004,0x800B,0x8012,0x8018, +0x8019,0x801C,0x8021,0x8028,0x803F,0x803B,0x804A,0x8046, +0x8052,0x8058,0x805A,0x805F,0x8062,0x8068,0x8073,0x8072, +0x8070,0x8076,0x8079,0x807D,0x807F,0x8084,0x8086,0x8085, +0x809B,0x8093,0x809A,0x80AD,0x5190,0x80AC,0x80DB,0x80E5, +0x80D9,0x80DD,0x80C4,0x80DA,0x80D6,0x8109,0x80EF,0x80F1, +0x811B,0x8129,0x8123,0x812F,0x814B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x968B,0x8146,0x813E,0x8153,0x8151,0x80FC,0x8171,0x816E, +0x8165,0x8166,0x8174,0x8183,0x8188,0x818A,0x8180,0x8182, +0x81A0,0x8195,0x81A4,0x81A3,0x815F,0x8193,0x81A9,0x81B0, +0x81B5,0x81BE,0x81B8,0x81BD,0x81C0,0x81C2,0x81BA,0x81C9, +0x81CD,0x81D1,0x81D9,0x81D8,0x81C8,0x81DA,0x81DF,0x81E0, +0x81E7,0x81FA,0x81FB,0x81FE,0x8201,0x8202,0x8205,0x8207, +0x820A,0x820D,0x8210,0x8216,0x8229,0x822B,0x8238,0x8233, +0x8240,0x8259,0x8258,0x825D,0x825A,0x825F,0x8264, 0, +0x8262,0x8268,0x826A,0x826B,0x822E,0x8271,0x8277,0x8278, +0x827E,0x828D,0x8292,0x82AB,0x829F,0x82BB,0x82AC,0x82E1, +0x82E3,0x82DF,0x82D2,0x82F4,0x82F3,0x82FA,0x8393,0x8303, +0x82FB,0x82F9,0x82DE,0x8306,0x82DC,0x8309,0x82D9,0x8335, +0x8334,0x8316,0x8332,0x8331,0x8340,0x8339,0x8350,0x8345, +0x832F,0x832B,0x8317,0x8318,0x8385,0x839A,0x83AA,0x839F, +0x83A2,0x8396,0x8323,0x838E,0x8387,0x838A,0x837C,0x83B5, +0x8373,0x8375,0x83A0,0x8389,0x83A8,0x83F4,0x8413,0x83EB, +0x83CE,0x83FD,0x8403,0x83D8,0x840B,0x83C1,0x83F7,0x8407, +0x83E0,0x83F2,0x840D,0x8422,0x8420,0x83BD,0x8438,0x8506, +0x83FB,0x846D,0x842A,0x843C,0x855A,0x8484,0x8477,0x846B, +0x84AD,0x846E,0x8482,0x8469,0x8446,0x842C,0x846F,0x8479, +0x8435,0x84CA,0x8462,0x84B9,0x84BF,0x849F,0x84D9,0x84CD, +0x84BB,0x84DA,0x84D0,0x84C1,0x84C6,0x84D6,0x84A1,0x8521, +0x84FF,0x84F4,0x8517,0x8518,0x852C,0x851F,0x8515,0x8514, +0x84FC,0x8540,0x8563,0x8558,0x8548, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8541,0x8602,0x854B,0x8555,0x8580,0x85A4,0x8588,0x8591, +0x858A,0x85A8,0x856D,0x8594,0x859B,0x85EA,0x8587,0x859C, +0x8577,0x857E,0x8590,0x85C9,0x85BA,0x85CF,0x85B9,0x85D0, +0x85D5,0x85DD,0x85E5,0x85DC,0x85F9,0x860A,0x8613,0x860B, +0x85FE,0x85FA,0x8606,0x8622,0x861A,0x8630,0x863F,0x864D, +0x4E55,0x8654,0x865F,0x8667,0x8671,0x8693,0x86A3,0x86A9, +0x86AA,0x868B,0x868C,0x86B6,0x86AF,0x86C4,0x86C6,0x86B0, +0x86C9,0x8823,0x86AB,0x86D4,0x86DE,0x86E9,0x86EC, 0, +0x86DF,0x86DB,0x86EF,0x8712,0x8706,0x8708,0x8700,0x8703, +0x86FB,0x8711,0x8709,0x870D,0x86F9,0x870A,0x8734,0x873F, +0x8737,0x873B,0x8725,0x8729,0x871A,0x8760,0x875F,0x8778, +0x874C,0x874E,0x8774,0x8757,0x8768,0x876E,0x8759,0x8753, +0x8763,0x876A,0x8805,0x87A2,0x879F,0x8782,0x87AF,0x87CB, +0x87BD,0x87C0,0x87D0,0x96D6,0x87AB,0x87C4,0x87B3,0x87C7, +0x87C6,0x87BB,0x87EF,0x87F2,0x87E0,0x880F,0x880D,0x87FE, +0x87F6,0x87F7,0x880E,0x87D2,0x8811,0x8816,0x8815,0x8822, +0x8821,0x8831,0x8836,0x8839,0x8827,0x883B,0x8844,0x8842, +0x8852,0x8859,0x885E,0x8862,0x886B,0x8881,0x887E,0x889E, +0x8875,0x887D,0x88B5,0x8872,0x8882,0x8897,0x8892,0x88AE, +0x8899,0x88A2,0x888D,0x88A4,0x88B0,0x88BF,0x88B1,0x88C3, +0x88C4,0x88D4,0x88D8,0x88D9,0x88DD,0x88F9,0x8902,0x88FC, +0x88F4,0x88E8,0x88F2,0x8904,0x890C,0x890A,0x8913,0x8943, +0x891E,0x8925,0x892A,0x892B,0x8941,0x8944,0x893B,0x8936, +0x8938,0x894C,0x891D,0x8960,0x895E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8966,0x8964,0x896D,0x896A,0x896F,0x8974,0x8977,0x897E, +0x8983,0x8988,0x898A,0x8993,0x8998,0x89A1,0x89A9,0x89A6, +0x89AC,0x89AF,0x89B2,0x89BA,0x89BD,0x89BF,0x89C0,0x89DA, +0x89DC,0x89DD,0x89E7,0x89F4,0x89F8,0x8A03,0x8A16,0x8A10, +0x8A0C,0x8A1B,0x8A1D,0x8A25,0x8A36,0x8A41,0x8A5B,0x8A52, +0x8A46,0x8A48,0x8A7C,0x8A6D,0x8A6C,0x8A62,0x8A85,0x8A82, +0x8A84,0x8AA8,0x8AA1,0x8A91,0x8AA5,0x8AA6,0x8A9A,0x8AA3, +0x8AC4,0x8ACD,0x8AC2,0x8ADA,0x8AEB,0x8AF3,0x8AE7, 0, +0x8AE4,0x8AF1,0x8B14,0x8AE0,0x8AE2,0x8AF7,0x8ADE,0x8ADB, +0x8B0C,0x8B07,0x8B1A,0x8AE1,0x8B16,0x8B10,0x8B17,0x8B20, +0x8B33,0x97AB,0x8B26,0x8B2B,0x8B3E,0x8B28,0x8B41,0x8B4C, +0x8B4F,0x8B4E,0x8B49,0x8B56,0x8B5B,0x8B5A,0x8B6B,0x8B5F, +0x8B6C,0x8B6F,0x8B74,0x8B7D,0x8B80,0x8B8C,0x8B8E,0x8B92, +0x8B93,0x8B96,0x8B99,0x8B9A,0x8C3A,0x8C41,0x8C3F,0x8C48, +0x8C4C,0x8C4E,0x8C50,0x8C55,0x8C62,0x8C6C,0x8C78,0x8C7A, +0x8C82,0x8C89,0x8C85,0x8C8A,0x8C8D,0x8C8E,0x8C94,0x8C7C, +0x8C98,0x621D,0x8CAD,0x8CAA,0x8CBD,0x8CB2,0x8CB3,0x8CAE, +0x8CB6,0x8CC8,0x8CC1,0x8CE4,0x8CE3,0x8CDA,0x8CFD,0x8CFA, +0x8CFB,0x8D04,0x8D05,0x8D0A,0x8D07,0x8D0F,0x8D0D,0x8D10, +0x9F4E,0x8D13,0x8CCD,0x8D14,0x8D16,0x8D67,0x8D6D,0x8D71, +0x8D73,0x8D81,0x8D99,0x8DC2,0x8DBE,0x8DBA,0x8DCF,0x8DDA, +0x8DD6,0x8DCC,0x8DDB,0x8DCB,0x8DEA,0x8DEB,0x8DDF,0x8DE3, +0x8DFC,0x8E08,0x8E09,0x8DFF,0x8E1D,0x8E1E,0x8E10,0x8E1F, +0x8E42,0x8E35,0x8E30,0x8E34,0x8E4A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E47,0x8E49,0x8E4C,0x8E50,0x8E48,0x8E59,0x8E64,0x8E60, +0x8E2A,0x8E63,0x8E55,0x8E76,0x8E72,0x8E7C,0x8E81,0x8E87, +0x8E85,0x8E84,0x8E8B,0x8E8A,0x8E93,0x8E91,0x8E94,0x8E99, +0x8EAA,0x8EA1,0x8EAC,0x8EB0,0x8EC6,0x8EB1,0x8EBE,0x8EC5, +0x8EC8,0x8ECB,0x8EDB,0x8EE3,0x8EFC,0x8EFB,0x8EEB,0x8EFE, +0x8F0A,0x8F05,0x8F15,0x8F12,0x8F19,0x8F13,0x8F1C,0x8F1F, +0x8F1B,0x8F0C,0x8F26,0x8F33,0x8F3B,0x8F39,0x8F45,0x8F42, +0x8F3E,0x8F4C,0x8F49,0x8F46,0x8F4E,0x8F57,0x8F5C, 0, +0x8F62,0x8F63,0x8F64,0x8F9C,0x8F9F,0x8FA3,0x8FAD,0x8FAF, +0x8FB7,0x8FDA,0x8FE5,0x8FE2,0x8FEA,0x8FEF,0x9087,0x8FF4, +0x9005,0x8FF9,0x8FFA,0x9011,0x9015,0x9021,0x900D,0x901E, +0x9016,0x900B,0x9027,0x9036,0x9035,0x9039,0x8FF8,0x904F, +0x9050,0x9051,0x9052,0x900E,0x9049,0x903E,0x9056,0x9058, +0x905E,0x9068,0x906F,0x9076,0x96A8,0x9072,0x9082,0x907D, +0x9081,0x9080,0x908A,0x9089,0x908F,0x90A8,0x90AF,0x90B1, +0x90B5,0x90E2,0x90E4,0x6248,0x90DB,0x9102,0x9112,0x9119, +0x9132,0x9130,0x914A,0x9156,0x9158,0x9163,0x9165,0x9169, +0x9173,0x9172,0x918B,0x9189,0x9182,0x91A2,0x91AB,0x91AF, +0x91AA,0x91B5,0x91B4,0x91BA,0x91C0,0x91C1,0x91C9,0x91CB, +0x91D0,0x91D6,0x91DF,0x91E1,0x91DB,0x91FC,0x91F5,0x91F6, +0x921E,0x91FF,0x9214,0x922C,0x9215,0x9211,0x925E,0x9257, +0x9245,0x9249,0x9264,0x9248,0x9295,0x923F,0x924B,0x9250, +0x929C,0x9296,0x9293,0x929B,0x925A,0x92CF,0x92B9,0x92B7, +0x92E9,0x930F,0x92FA,0x9344,0x932E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9319,0x9322,0x931A,0x9323,0x933A,0x9335,0x933B,0x935C, +0x9360,0x937C,0x936E,0x9356,0x93B0,0x93AC,0x93AD,0x9394, +0x93B9,0x93D6,0x93D7,0x93E8,0x93E5,0x93D8,0x93C3,0x93DD, +0x93D0,0x93C8,0x93E4,0x941A,0x9414,0x9413,0x9403,0x9407, +0x9410,0x9436,0x942B,0x9435,0x9421,0x943A,0x9441,0x9452, +0x9444,0x945B,0x9460,0x9462,0x945E,0x946A,0x9229,0x9470, +0x9475,0x9477,0x947D,0x945A,0x947C,0x947E,0x9481,0x947F, +0x9582,0x9587,0x958A,0x9594,0x9596,0x9598,0x9599, 0, +0x95A0,0x95A8,0x95A7,0x95AD,0x95BC,0x95BB,0x95B9,0x95BE, +0x95CA,0x6FF6,0x95C3,0x95CD,0x95CC,0x95D5,0x95D4,0x95D6, +0x95DC,0x95E1,0x95E5,0x95E2,0x9621,0x9628,0x962E,0x962F, +0x9642,0x964C,0x964F,0x964B,0x9677,0x965C,0x965E,0x965D, +0x965F,0x9666,0x9672,0x966C,0x968D,0x9698,0x9695,0x9697, +0x96AA,0x96A7,0x96B1,0x96B2,0x96B0,0x96B4,0x96B6,0x96B8, +0x96B9,0x96CE,0x96CB,0x96C9,0x96CD,0x894D,0x96DC,0x970D, +0x96D5,0x96F9,0x9704,0x9706,0x9708,0x9713,0x970E,0x9711, +0x970F,0x9716,0x9719,0x9724,0x972A,0x9730,0x9739,0x973D, +0x973E,0x9744,0x9746,0x9748,0x9742,0x9749,0x975C,0x9760, +0x9764,0x9766,0x9768,0x52D2,0x976B,0x9771,0x9779,0x9785, +0x977C,0x9781,0x977A,0x9786,0x978B,0x978F,0x9790,0x979C, +0x97A8,0x97A6,0x97A3,0x97B3,0x97B4,0x97C3,0x97C6,0x97C8, +0x97CB,0x97DC,0x97ED,0x9F4F,0x97F2,0x7ADF,0x97F6,0x97F5, +0x980F,0x980C,0x9838,0x9824,0x9821,0x9837,0x983D,0x9846, +0x984F,0x984B,0x986B,0x986F,0x9870, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9871,0x9874,0x9873,0x98AA,0x98AF,0x98B1,0x98B6,0x98C4, +0x98C3,0x98C6,0x98E9,0x98EB,0x9903,0x9909,0x9912,0x9914, +0x9918,0x9921,0x991D,0x991E,0x9924,0x9920,0x992C,0x992E, +0x993D,0x993E,0x9942,0x9949,0x9945,0x9950,0x994B,0x9951, +0x9952,0x994C,0x9955,0x9997,0x9998,0x99A5,0x99AD,0x99AE, +0x99BC,0x99DF,0x99DB,0x99DD,0x99D8,0x99D1,0x99ED,0x99EE, +0x99F1,0x99F2,0x99FB,0x99F8,0x9A01,0x9A0F,0x9A05,0x99E2, +0x9A19,0x9A2B,0x9A37,0x9A45,0x9A42,0x9A40,0x9A43, 0, +0x9A3E,0x9A55,0x9A4D,0x9A5B,0x9A57,0x9A5F,0x9A62,0x9A65, +0x9A64,0x9A69,0x9A6B,0x9A6A,0x9AAD,0x9AB0,0x9ABC,0x9AC0, +0x9ACF,0x9AD1,0x9AD3,0x9AD4,0x9ADE,0x9ADF,0x9AE2,0x9AE3, +0x9AE6,0x9AEF,0x9AEB,0x9AEE,0x9AF4,0x9AF1,0x9AF7,0x9AFB, +0x9B06,0x9B18,0x9B1A,0x9B1F,0x9B22,0x9B23,0x9B25,0x9B27, +0x9B28,0x9B29,0x9B2A,0x9B2E,0x9B2F,0x9B32,0x9B44,0x9B43, +0x9B4F,0x9B4D,0x9B4E,0x9B51,0x9B58,0x9B74,0x9B93,0x9B83, +0x9B91,0x9B96,0x9B97,0x9B9F,0x9BA0,0x9BA8,0x9BB4,0x9BC0, +0x9BCA,0x9BB9,0x9BC6,0x9BCF,0x9BD1,0x9BD2,0x9BE3,0x9BE2, +0x9BE4,0x9BD4,0x9BE1,0x9C3A,0x9BF2,0x9BF1,0x9BF0,0x9C15, +0x9C14,0x9C09,0x9C13,0x9C0C,0x9C06,0x9C08,0x9C12,0x9C0A, +0x9C04,0x9C2E,0x9C1B,0x9C25,0x9C24,0x9C21,0x9C30,0x9C47, +0x9C32,0x9C46,0x9C3E,0x9C5A,0x9C60,0x9C67,0x9C76,0x9C78, +0x9CE7,0x9CEC,0x9CF0,0x9D09,0x9D08,0x9CEB,0x9D03,0x9D06, +0x9D2A,0x9D26,0x9DAF,0x9D23,0x9D1F,0x9D44,0x9D15,0x9D12, +0x9D41,0x9D3F,0x9D3E,0x9D46,0x9D48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9D5D,0x9D5E,0x9D64,0x9D51,0x9D50,0x9D59,0x9D72,0x9D89, +0x9D87,0x9DAB,0x9D6F,0x9D7A,0x9D9A,0x9DA4,0x9DA9,0x9DB2, +0x9DC4,0x9DC1,0x9DBB,0x9DB8,0x9DBA,0x9DC6,0x9DCF,0x9DC2, +0x9DD9,0x9DD3,0x9DF8,0x9DE6,0x9DED,0x9DEF,0x9DFD,0x9E1A, +0x9E1B,0x9E1E,0x9E75,0x9E79,0x9E7D,0x9E81,0x9E88,0x9E8B, +0x9E8C,0x9E92,0x9E95,0x9E91,0x9E9D,0x9EA5,0x9EA9,0x9EB8, +0x9EAA,0x9EAD,0x9761,0x9ECC,0x9ECE,0x9ECF,0x9ED0,0x9ED4, +0x9EDC,0x9EDE,0x9EDD,0x9EE0,0x9EE5,0x9EE8,0x9EEF, 0, +0x9EF4,0x9EF6,0x9EF7,0x9EF9,0x9EFB,0x9EFC,0x9EFD,0x9F07, +0x9F08,0x76B7,0x9F15,0x9F21,0x9F2C,0x9F3E,0x9F4A,0x9F52, +0x9F54,0x9F63,0x9F5F,0x9F60,0x9F61,0x9F66,0x9F67,0x9F6C, +0x9F6A,0x9F77,0x9F72,0x9F76,0x9F95,0x9F9C,0x9FA0,0x582F, +0x69C7,0x9059,0x7464,0x51DC,0x7199}; + +/* page 5 0xED40-0xEEFC - +IBM Selected Kanji and Non-Kanji(NEC implementation) */ +static uint16 tab_cp932_uni5[]={ +0x7E8A,0x891C,0x9348,0x9288,0x84DC,0x4FC9,0x70BB,0x6631, +0x68C8,0x92F9,0x66FB,0x5F45,0x4E28,0x4EE1,0x4EFC,0x4F00, +0x4F03,0x4F39,0x4F56,0x4F92,0x4F8A,0x4F9A,0x4F94,0x4FCD, +0x5040,0x5022,0x4FFF,0x501E,0x5046,0x5070,0x5042,0x5094, +0x50F4,0x50D8,0x514A,0x5164,0x519D,0x51BE,0x51EC,0x5215, +0x529C,0x52A6,0x52C0,0x52DB,0x5300,0x5307,0x5324,0x5372, +0x5393,0x53B2,0x53DD,0xFA0E,0x549C,0x548A,0x54A9,0x54FF, +0x5586,0x5759,0x5765,0x57AC,0x57C8,0x57C7,0xFA0F, 0, +0xFA10,0x589E,0x58B2,0x590B,0x5953,0x595B,0x595D,0x5963, +0x59A4,0x59BA,0x5B56,0x5BC0,0x752F,0x5BD8,0x5BEC,0x5C1E, +0x5CA6,0x5CBA,0x5CF5,0x5D27,0x5D53,0xFA11,0x5D42,0x5D6D, +0x5DB8,0x5DB9,0x5DD0,0x5F21,0x5F34,0x5F67,0x5FB7,0x5FDE, +0x605D,0x6085,0x608A,0x60DE,0x60D5,0x6120,0x60F2,0x6111, +0x6137,0x6130,0x6198,0x6213,0x62A6,0x63F5,0x6460,0x649D, +0x64CE,0x654E,0x6600,0x6615,0x663B,0x6609,0x662E,0x661E, +0x6624,0x6665,0x6657,0x6659,0xFA12,0x6673,0x6699,0x66A0, +0x66B2,0x66BF,0x66FA,0x670E,0xF929,0x6766,0x67BB,0x6852, +0x67C0,0x6801,0x6844,0x68CF,0xFA13,0x6968,0xFA14,0x6998, +0x69E2,0x6A30,0x6A6B,0x6A46,0x6A73,0x6A7E,0x6AE2,0x6AE4, +0x6BD6,0x6C3F,0x6C5C,0x6C86,0x6C6F,0x6CDA,0x6D04,0x6D87, +0x6D6F,0x6D96,0x6DAC,0x6DCF,0x6DF8,0x6DF2,0x6DFC,0x6E39, +0x6E5C,0x6E27,0x6E3C,0x6EBF,0x6F88,0x6FB5,0x6FF5,0x7005, +0x7007,0x7028,0x7085,0x70AB,0x710F,0x7104,0x715C,0x7146, +0x7147,0xFA15,0x71C1,0x71FE,0x72B1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x72BE,0x7324,0xFA16,0x7377,0x73BD,0x73C9,0x73D6,0x73E3, +0x73D2,0x7407,0x73F5,0x7426,0x742A,0x7429,0x742E,0x7462, +0x7489,0x749F,0x7501,0x756F,0x7682,0x769C,0x769E,0x769B, +0x76A6,0xFA17,0x7746,0x52AF,0x7821,0x784E,0x7864,0x787A, +0x7930,0xFA18,0xFA19,0xFA1A,0x7994,0xFA1B,0x799B,0x7AD1, +0x7AE7,0xFA1C,0x7AEB,0x7B9E,0xFA1D,0x7D48,0x7D5C,0x7DB7, +0x7DA0,0x7DD6,0x7E52,0x7F47,0x7FA1,0xFA1E,0x8301,0x8362, +0x837F,0x83C7,0x83F6,0x8448,0x84B4,0x8553,0x8559, 0, +0x856B,0xFA1F,0x85B0,0xFA20,0xFA21,0x8807,0x88F5,0x8A12, +0x8A37,0x8A79,0x8AA7,0x8ABE,0x8ADF,0xFA22,0x8AF6,0x8B53, +0x8B7F,0x8CF0,0x8CF4,0x8D12,0x8D76,0xFA23,0x8ECF,0xFA24, +0xFA25,0x9067,0x90DE,0xFA26,0x9115,0x9127,0x91DA,0x91D7, +0x91DE,0x91ED,0x91EE,0x91E4,0x91E5,0x9206,0x9210,0x920A, +0x923A,0x9240,0x923C,0x924E,0x9259,0x9251,0x9239,0x9267, +0x92A7,0x9277,0x9278,0x92E7,0x92D7,0x92D9,0x92D0,0xFA27, +0x92D5,0x92E0,0x92D3,0x9325,0x9321,0x92FB,0xFA28,0x931E, +0x92FF,0x931D,0x9302,0x9370,0x9357,0x93A4,0x93C6,0x93DE, +0x93F8,0x9431,0x9445,0x9448,0x9592,0xF9DC,0xFA29,0x969D, +0x96AF,0x9733,0x973B,0x9743,0x974D,0x974F,0x9751,0x9755, +0x9857,0x9865,0xFA2A,0xFA2B,0x9927,0xFA2C,0x999E,0x9A4E, +0x9AD9,0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00, +0x9D70,0x9D6B,0xFA2D,0x9E19,0x9ED1, 0, 0,0x2170, +0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177,0x2178, +0x2179,0xFFE2,0xFFE4,0xFF07,0xFF02}; + +/* page 6 0xF040-0xF9FC - User defined characters */ +static uint16 tab_cp932_uni6[]={ +0xE000,0xE001,0xE002,0xE003,0xE004,0xE005,0xE006,0xE007, +0xE008,0xE009,0xE00A,0xE00B,0xE00C,0xE00D,0xE00E,0xE00F, +0xE010,0xE011,0xE012,0xE013,0xE014,0xE015,0xE016,0xE017, +0xE018,0xE019,0xE01A,0xE01B,0xE01C,0xE01D,0xE01E,0xE01F, +0xE020,0xE021,0xE022,0xE023,0xE024,0xE025,0xE026,0xE027, +0xE028,0xE029,0xE02A,0xE02B,0xE02C,0xE02D,0xE02E,0xE02F, +0xE030,0xE031,0xE032,0xE033,0xE034,0xE035,0xE036,0xE037, +0xE038,0xE039,0xE03A,0xE03B,0xE03C,0xE03D,0xE03E, 0, +0xE03F,0xE040,0xE041,0xE042,0xE043,0xE044,0xE045,0xE046, +0xE047,0xE048,0xE049,0xE04A,0xE04B,0xE04C,0xE04D,0xE04E, +0xE04F,0xE050,0xE051,0xE052,0xE053,0xE054,0xE055,0xE056, +0xE057,0xE058,0xE059,0xE05A,0xE05B,0xE05C,0xE05D,0xE05E, +0xE05F,0xE060,0xE061,0xE062,0xE063,0xE064,0xE065,0xE066, +0xE067,0xE068,0xE069,0xE06A,0xE06B,0xE06C,0xE06D,0xE06E, +0xE06F,0xE070,0xE071,0xE072,0xE073,0xE074,0xE075,0xE076, +0xE077,0xE078,0xE079,0xE07A,0xE07B,0xE07C,0xE07D,0xE07E, +0xE07F,0xE080,0xE081,0xE082,0xE083,0xE084,0xE085,0xE086, +0xE087,0xE088,0xE089,0xE08A,0xE08B,0xE08C,0xE08D,0xE08E, +0xE08F,0xE090,0xE091,0xE092,0xE093,0xE094,0xE095,0xE096, +0xE097,0xE098,0xE099,0xE09A,0xE09B,0xE09C,0xE09D,0xE09E, +0xE09F,0xE0A0,0xE0A1,0xE0A2,0xE0A3,0xE0A4,0xE0A5,0xE0A6, +0xE0A7,0xE0A8,0xE0A9,0xE0AA,0xE0AB,0xE0AC,0xE0AD,0xE0AE, +0xE0AF,0xE0B0,0xE0B1,0xE0B2,0xE0B3,0xE0B4,0xE0B5,0xE0B6, +0xE0B7,0xE0B8,0xE0B9,0xE0BA,0xE0BB, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE0BC,0xE0BD,0xE0BE,0xE0BF,0xE0C0,0xE0C1,0xE0C2,0xE0C3, +0xE0C4,0xE0C5,0xE0C6,0xE0C7,0xE0C8,0xE0C9,0xE0CA,0xE0CB, +0xE0CC,0xE0CD,0xE0CE,0xE0CF,0xE0D0,0xE0D1,0xE0D2,0xE0D3, +0xE0D4,0xE0D5,0xE0D6,0xE0D7,0xE0D8,0xE0D9,0xE0DA,0xE0DB, +0xE0DC,0xE0DD,0xE0DE,0xE0DF,0xE0E0,0xE0E1,0xE0E2,0xE0E3, +0xE0E4,0xE0E5,0xE0E6,0xE0E7,0xE0E8,0xE0E9,0xE0EA,0xE0EB, +0xE0EC,0xE0ED,0xE0EE,0xE0EF,0xE0F0,0xE0F1,0xE0F2,0xE0F3, +0xE0F4,0xE0F5,0xE0F6,0xE0F7,0xE0F8,0xE0F9,0xE0FA, 0, +0xE0FB,0xE0FC,0xE0FD,0xE0FE,0xE0FF,0xE100,0xE101,0xE102, +0xE103,0xE104,0xE105,0xE106,0xE107,0xE108,0xE109,0xE10A, +0xE10B,0xE10C,0xE10D,0xE10E,0xE10F,0xE110,0xE111,0xE112, +0xE113,0xE114,0xE115,0xE116,0xE117,0xE118,0xE119,0xE11A, +0xE11B,0xE11C,0xE11D,0xE11E,0xE11F,0xE120,0xE121,0xE122, +0xE123,0xE124,0xE125,0xE126,0xE127,0xE128,0xE129,0xE12A, +0xE12B,0xE12C,0xE12D,0xE12E,0xE12F,0xE130,0xE131,0xE132, +0xE133,0xE134,0xE135,0xE136,0xE137,0xE138,0xE139,0xE13A, +0xE13B,0xE13C,0xE13D,0xE13E,0xE13F,0xE140,0xE141,0xE142, +0xE143,0xE144,0xE145,0xE146,0xE147,0xE148,0xE149,0xE14A, +0xE14B,0xE14C,0xE14D,0xE14E,0xE14F,0xE150,0xE151,0xE152, +0xE153,0xE154,0xE155,0xE156,0xE157,0xE158,0xE159,0xE15A, +0xE15B,0xE15C,0xE15D,0xE15E,0xE15F,0xE160,0xE161,0xE162, +0xE163,0xE164,0xE165,0xE166,0xE167,0xE168,0xE169,0xE16A, +0xE16B,0xE16C,0xE16D,0xE16E,0xE16F,0xE170,0xE171,0xE172, +0xE173,0xE174,0xE175,0xE176,0xE177, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE178,0xE179,0xE17A,0xE17B,0xE17C,0xE17D,0xE17E,0xE17F, +0xE180,0xE181,0xE182,0xE183,0xE184,0xE185,0xE186,0xE187, +0xE188,0xE189,0xE18A,0xE18B,0xE18C,0xE18D,0xE18E,0xE18F, +0xE190,0xE191,0xE192,0xE193,0xE194,0xE195,0xE196,0xE197, +0xE198,0xE199,0xE19A,0xE19B,0xE19C,0xE19D,0xE19E,0xE19F, +0xE1A0,0xE1A1,0xE1A2,0xE1A3,0xE1A4,0xE1A5,0xE1A6,0xE1A7, +0xE1A8,0xE1A9,0xE1AA,0xE1AB,0xE1AC,0xE1AD,0xE1AE,0xE1AF, +0xE1B0,0xE1B1,0xE1B2,0xE1B3,0xE1B4,0xE1B5,0xE1B6, 0, +0xE1B7,0xE1B8,0xE1B9,0xE1BA,0xE1BB,0xE1BC,0xE1BD,0xE1BE, +0xE1BF,0xE1C0,0xE1C1,0xE1C2,0xE1C3,0xE1C4,0xE1C5,0xE1C6, +0xE1C7,0xE1C8,0xE1C9,0xE1CA,0xE1CB,0xE1CC,0xE1CD,0xE1CE, +0xE1CF,0xE1D0,0xE1D1,0xE1D2,0xE1D3,0xE1D4,0xE1D5,0xE1D6, +0xE1D7,0xE1D8,0xE1D9,0xE1DA,0xE1DB,0xE1DC,0xE1DD,0xE1DE, +0xE1DF,0xE1E0,0xE1E1,0xE1E2,0xE1E3,0xE1E4,0xE1E5,0xE1E6, +0xE1E7,0xE1E8,0xE1E9,0xE1EA,0xE1EB,0xE1EC,0xE1ED,0xE1EE, +0xE1EF,0xE1F0,0xE1F1,0xE1F2,0xE1F3,0xE1F4,0xE1F5,0xE1F6, +0xE1F7,0xE1F8,0xE1F9,0xE1FA,0xE1FB,0xE1FC,0xE1FD,0xE1FE, +0xE1FF,0xE200,0xE201,0xE202,0xE203,0xE204,0xE205,0xE206, +0xE207,0xE208,0xE209,0xE20A,0xE20B,0xE20C,0xE20D,0xE20E, +0xE20F,0xE210,0xE211,0xE212,0xE213,0xE214,0xE215,0xE216, +0xE217,0xE218,0xE219,0xE21A,0xE21B,0xE21C,0xE21D,0xE21E, +0xE21F,0xE220,0xE221,0xE222,0xE223,0xE224,0xE225,0xE226, +0xE227,0xE228,0xE229,0xE22A,0xE22B,0xE22C,0xE22D,0xE22E, +0xE22F,0xE230,0xE231,0xE232,0xE233, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE234,0xE235,0xE236,0xE237,0xE238,0xE239,0xE23A,0xE23B, +0xE23C,0xE23D,0xE23E,0xE23F,0xE240,0xE241,0xE242,0xE243, +0xE244,0xE245,0xE246,0xE247,0xE248,0xE249,0xE24A,0xE24B, +0xE24C,0xE24D,0xE24E,0xE24F,0xE250,0xE251,0xE252,0xE253, +0xE254,0xE255,0xE256,0xE257,0xE258,0xE259,0xE25A,0xE25B, +0xE25C,0xE25D,0xE25E,0xE25F,0xE260,0xE261,0xE262,0xE263, +0xE264,0xE265,0xE266,0xE267,0xE268,0xE269,0xE26A,0xE26B, +0xE26C,0xE26D,0xE26E,0xE26F,0xE270,0xE271,0xE272, 0, +0xE273,0xE274,0xE275,0xE276,0xE277,0xE278,0xE279,0xE27A, +0xE27B,0xE27C,0xE27D,0xE27E,0xE27F,0xE280,0xE281,0xE282, +0xE283,0xE284,0xE285,0xE286,0xE287,0xE288,0xE289,0xE28A, +0xE28B,0xE28C,0xE28D,0xE28E,0xE28F,0xE290,0xE291,0xE292, +0xE293,0xE294,0xE295,0xE296,0xE297,0xE298,0xE299,0xE29A, +0xE29B,0xE29C,0xE29D,0xE29E,0xE29F,0xE2A0,0xE2A1,0xE2A2, +0xE2A3,0xE2A4,0xE2A5,0xE2A6,0xE2A7,0xE2A8,0xE2A9,0xE2AA, +0xE2AB,0xE2AC,0xE2AD,0xE2AE,0xE2AF,0xE2B0,0xE2B1,0xE2B2, +0xE2B3,0xE2B4,0xE2B5,0xE2B6,0xE2B7,0xE2B8,0xE2B9,0xE2BA, +0xE2BB,0xE2BC,0xE2BD,0xE2BE,0xE2BF,0xE2C0,0xE2C1,0xE2C2, +0xE2C3,0xE2C4,0xE2C5,0xE2C6,0xE2C7,0xE2C8,0xE2C9,0xE2CA, +0xE2CB,0xE2CC,0xE2CD,0xE2CE,0xE2CF,0xE2D0,0xE2D1,0xE2D2, +0xE2D3,0xE2D4,0xE2D5,0xE2D6,0xE2D7,0xE2D8,0xE2D9,0xE2DA, +0xE2DB,0xE2DC,0xE2DD,0xE2DE,0xE2DF,0xE2E0,0xE2E1,0xE2E2, +0xE2E3,0xE2E4,0xE2E5,0xE2E6,0xE2E7,0xE2E8,0xE2E9,0xE2EA, +0xE2EB,0xE2EC,0xE2ED,0xE2EE,0xE2EF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE2F0,0xE2F1,0xE2F2,0xE2F3,0xE2F4,0xE2F5,0xE2F6,0xE2F7, +0xE2F8,0xE2F9,0xE2FA,0xE2FB,0xE2FC,0xE2FD,0xE2FE,0xE2FF, +0xE300,0xE301,0xE302,0xE303,0xE304,0xE305,0xE306,0xE307, +0xE308,0xE309,0xE30A,0xE30B,0xE30C,0xE30D,0xE30E,0xE30F, +0xE310,0xE311,0xE312,0xE313,0xE314,0xE315,0xE316,0xE317, +0xE318,0xE319,0xE31A,0xE31B,0xE31C,0xE31D,0xE31E,0xE31F, +0xE320,0xE321,0xE322,0xE323,0xE324,0xE325,0xE326,0xE327, +0xE328,0xE329,0xE32A,0xE32B,0xE32C,0xE32D,0xE32E, 0, +0xE32F,0xE330,0xE331,0xE332,0xE333,0xE334,0xE335,0xE336, +0xE337,0xE338,0xE339,0xE33A,0xE33B,0xE33C,0xE33D,0xE33E, +0xE33F,0xE340,0xE341,0xE342,0xE343,0xE344,0xE345,0xE346, +0xE347,0xE348,0xE349,0xE34A,0xE34B,0xE34C,0xE34D,0xE34E, +0xE34F,0xE350,0xE351,0xE352,0xE353,0xE354,0xE355,0xE356, +0xE357,0xE358,0xE359,0xE35A,0xE35B,0xE35C,0xE35D,0xE35E, +0xE35F,0xE360,0xE361,0xE362,0xE363,0xE364,0xE365,0xE366, +0xE367,0xE368,0xE369,0xE36A,0xE36B,0xE36C,0xE36D,0xE36E, +0xE36F,0xE370,0xE371,0xE372,0xE373,0xE374,0xE375,0xE376, +0xE377,0xE378,0xE379,0xE37A,0xE37B,0xE37C,0xE37D,0xE37E, +0xE37F,0xE380,0xE381,0xE382,0xE383,0xE384,0xE385,0xE386, +0xE387,0xE388,0xE389,0xE38A,0xE38B,0xE38C,0xE38D,0xE38E, +0xE38F,0xE390,0xE391,0xE392,0xE393,0xE394,0xE395,0xE396, +0xE397,0xE398,0xE399,0xE39A,0xE39B,0xE39C,0xE39D,0xE39E, +0xE39F,0xE3A0,0xE3A1,0xE3A2,0xE3A3,0xE3A4,0xE3A5,0xE3A6, +0xE3A7,0xE3A8,0xE3A9,0xE3AA,0xE3AB, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE3AC,0xE3AD,0xE3AE,0xE3AF,0xE3B0,0xE3B1,0xE3B2,0xE3B3, +0xE3B4,0xE3B5,0xE3B6,0xE3B7,0xE3B8,0xE3B9,0xE3BA,0xE3BB, +0xE3BC,0xE3BD,0xE3BE,0xE3BF,0xE3C0,0xE3C1,0xE3C2,0xE3C3, +0xE3C4,0xE3C5,0xE3C6,0xE3C7,0xE3C8,0xE3C9,0xE3CA,0xE3CB, +0xE3CC,0xE3CD,0xE3CE,0xE3CF,0xE3D0,0xE3D1,0xE3D2,0xE3D3, +0xE3D4,0xE3D5,0xE3D6,0xE3D7,0xE3D8,0xE3D9,0xE3DA,0xE3DB, +0xE3DC,0xE3DD,0xE3DE,0xE3DF,0xE3E0,0xE3E1,0xE3E2,0xE3E3, +0xE3E4,0xE3E5,0xE3E6,0xE3E7,0xE3E8,0xE3E9,0xE3EA, 0, +0xE3EB,0xE3EC,0xE3ED,0xE3EE,0xE3EF,0xE3F0,0xE3F1,0xE3F2, +0xE3F3,0xE3F4,0xE3F5,0xE3F6,0xE3F7,0xE3F8,0xE3F9,0xE3FA, +0xE3FB,0xE3FC,0xE3FD,0xE3FE,0xE3FF,0xE400,0xE401,0xE402, +0xE403,0xE404,0xE405,0xE406,0xE407,0xE408,0xE409,0xE40A, +0xE40B,0xE40C,0xE40D,0xE40E,0xE40F,0xE410,0xE411,0xE412, +0xE413,0xE414,0xE415,0xE416,0xE417,0xE418,0xE419,0xE41A, +0xE41B,0xE41C,0xE41D,0xE41E,0xE41F,0xE420,0xE421,0xE422, +0xE423,0xE424,0xE425,0xE426,0xE427,0xE428,0xE429,0xE42A, +0xE42B,0xE42C,0xE42D,0xE42E,0xE42F,0xE430,0xE431,0xE432, +0xE433,0xE434,0xE435,0xE436,0xE437,0xE438,0xE439,0xE43A, +0xE43B,0xE43C,0xE43D,0xE43E,0xE43F,0xE440,0xE441,0xE442, +0xE443,0xE444,0xE445,0xE446,0xE447,0xE448,0xE449,0xE44A, +0xE44B,0xE44C,0xE44D,0xE44E,0xE44F,0xE450,0xE451,0xE452, +0xE453,0xE454,0xE455,0xE456,0xE457,0xE458,0xE459,0xE45A, +0xE45B,0xE45C,0xE45D,0xE45E,0xE45F,0xE460,0xE461,0xE462, +0xE463,0xE464,0xE465,0xE466,0xE467, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE468,0xE469,0xE46A,0xE46B,0xE46C,0xE46D,0xE46E,0xE46F, +0xE470,0xE471,0xE472,0xE473,0xE474,0xE475,0xE476,0xE477, +0xE478,0xE479,0xE47A,0xE47B,0xE47C,0xE47D,0xE47E,0xE47F, +0xE480,0xE481,0xE482,0xE483,0xE484,0xE485,0xE486,0xE487, +0xE488,0xE489,0xE48A,0xE48B,0xE48C,0xE48D,0xE48E,0xE48F, +0xE490,0xE491,0xE492,0xE493,0xE494,0xE495,0xE496,0xE497, +0xE498,0xE499,0xE49A,0xE49B,0xE49C,0xE49D,0xE49E,0xE49F, +0xE4A0,0xE4A1,0xE4A2,0xE4A3,0xE4A4,0xE4A5,0xE4A6, 0, +0xE4A7,0xE4A8,0xE4A9,0xE4AA,0xE4AB,0xE4AC,0xE4AD,0xE4AE, +0xE4AF,0xE4B0,0xE4B1,0xE4B2,0xE4B3,0xE4B4,0xE4B5,0xE4B6, +0xE4B7,0xE4B8,0xE4B9,0xE4BA,0xE4BB,0xE4BC,0xE4BD,0xE4BE, +0xE4BF,0xE4C0,0xE4C1,0xE4C2,0xE4C3,0xE4C4,0xE4C5,0xE4C6, +0xE4C7,0xE4C8,0xE4C9,0xE4CA,0xE4CB,0xE4CC,0xE4CD,0xE4CE, +0xE4CF,0xE4D0,0xE4D1,0xE4D2,0xE4D3,0xE4D4,0xE4D5,0xE4D6, +0xE4D7,0xE4D8,0xE4D9,0xE4DA,0xE4DB,0xE4DC,0xE4DD,0xE4DE, +0xE4DF,0xE4E0,0xE4E1,0xE4E2,0xE4E3,0xE4E4,0xE4E5,0xE4E6, +0xE4E7,0xE4E8,0xE4E9,0xE4EA,0xE4EB,0xE4EC,0xE4ED,0xE4EE, +0xE4EF,0xE4F0,0xE4F1,0xE4F2,0xE4F3,0xE4F4,0xE4F5,0xE4F6, +0xE4F7,0xE4F8,0xE4F9,0xE4FA,0xE4FB,0xE4FC,0xE4FD,0xE4FE, +0xE4FF,0xE500,0xE501,0xE502,0xE503,0xE504,0xE505,0xE506, +0xE507,0xE508,0xE509,0xE50A,0xE50B,0xE50C,0xE50D,0xE50E, +0xE50F,0xE510,0xE511,0xE512,0xE513,0xE514,0xE515,0xE516, +0xE517,0xE518,0xE519,0xE51A,0xE51B,0xE51C,0xE51D,0xE51E, +0xE51F,0xE520,0xE521,0xE522,0xE523, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE524,0xE525,0xE526,0xE527,0xE528,0xE529,0xE52A,0xE52B, +0xE52C,0xE52D,0xE52E,0xE52F,0xE530,0xE531,0xE532,0xE533, +0xE534,0xE535,0xE536,0xE537,0xE538,0xE539,0xE53A,0xE53B, +0xE53C,0xE53D,0xE53E,0xE53F,0xE540,0xE541,0xE542,0xE543, +0xE544,0xE545,0xE546,0xE547,0xE548,0xE549,0xE54A,0xE54B, +0xE54C,0xE54D,0xE54E,0xE54F,0xE550,0xE551,0xE552,0xE553, +0xE554,0xE555,0xE556,0xE557,0xE558,0xE559,0xE55A,0xE55B, +0xE55C,0xE55D,0xE55E,0xE55F,0xE560,0xE561,0xE562, 0, +0xE563,0xE564,0xE565,0xE566,0xE567,0xE568,0xE569,0xE56A, +0xE56B,0xE56C,0xE56D,0xE56E,0xE56F,0xE570,0xE571,0xE572, +0xE573,0xE574,0xE575,0xE576,0xE577,0xE578,0xE579,0xE57A, +0xE57B,0xE57C,0xE57D,0xE57E,0xE57F,0xE580,0xE581,0xE582, +0xE583,0xE584,0xE585,0xE586,0xE587,0xE588,0xE589,0xE58A, +0xE58B,0xE58C,0xE58D,0xE58E,0xE58F,0xE590,0xE591,0xE592, +0xE593,0xE594,0xE595,0xE596,0xE597,0xE598,0xE599,0xE59A, +0xE59B,0xE59C,0xE59D,0xE59E,0xE59F,0xE5A0,0xE5A1,0xE5A2, +0xE5A3,0xE5A4,0xE5A5,0xE5A6,0xE5A7,0xE5A8,0xE5A9,0xE5AA, +0xE5AB,0xE5AC,0xE5AD,0xE5AE,0xE5AF,0xE5B0,0xE5B1,0xE5B2, +0xE5B3,0xE5B4,0xE5B5,0xE5B6,0xE5B7,0xE5B8,0xE5B9,0xE5BA, +0xE5BB,0xE5BC,0xE5BD,0xE5BE,0xE5BF,0xE5C0,0xE5C1,0xE5C2, +0xE5C3,0xE5C4,0xE5C5,0xE5C6,0xE5C7,0xE5C8,0xE5C9,0xE5CA, +0xE5CB,0xE5CC,0xE5CD,0xE5CE,0xE5CF,0xE5D0,0xE5D1,0xE5D2, +0xE5D3,0xE5D4,0xE5D5,0xE5D6,0xE5D7,0xE5D8,0xE5D9,0xE5DA, +0xE5DB,0xE5DC,0xE5DD,0xE5DE,0xE5DF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE5E0,0xE5E1,0xE5E2,0xE5E3,0xE5E4,0xE5E5,0xE5E6,0xE5E7, +0xE5E8,0xE5E9,0xE5EA,0xE5EB,0xE5EC,0xE5ED,0xE5EE,0xE5EF, +0xE5F0,0xE5F1,0xE5F2,0xE5F3,0xE5F4,0xE5F5,0xE5F6,0xE5F7, +0xE5F8,0xE5F9,0xE5FA,0xE5FB,0xE5FC,0xE5FD,0xE5FE,0xE5FF, +0xE600,0xE601,0xE602,0xE603,0xE604,0xE605,0xE606,0xE607, +0xE608,0xE609,0xE60A,0xE60B,0xE60C,0xE60D,0xE60E,0xE60F, +0xE610,0xE611,0xE612,0xE613,0xE614,0xE615,0xE616,0xE617, +0xE618,0xE619,0xE61A,0xE61B,0xE61C,0xE61D,0xE61E, 0, +0xE61F,0xE620,0xE621,0xE622,0xE623,0xE624,0xE625,0xE626, +0xE627,0xE628,0xE629,0xE62A,0xE62B,0xE62C,0xE62D,0xE62E, +0xE62F,0xE630,0xE631,0xE632,0xE633,0xE634,0xE635,0xE636, +0xE637,0xE638,0xE639,0xE63A,0xE63B,0xE63C,0xE63D,0xE63E, +0xE63F,0xE640,0xE641,0xE642,0xE643,0xE644,0xE645,0xE646, +0xE647,0xE648,0xE649,0xE64A,0xE64B,0xE64C,0xE64D,0xE64E, +0xE64F,0xE650,0xE651,0xE652,0xE653,0xE654,0xE655,0xE656, +0xE657,0xE658,0xE659,0xE65A,0xE65B,0xE65C,0xE65D,0xE65E, +0xE65F,0xE660,0xE661,0xE662,0xE663,0xE664,0xE665,0xE666, +0xE667,0xE668,0xE669,0xE66A,0xE66B,0xE66C,0xE66D,0xE66E, +0xE66F,0xE670,0xE671,0xE672,0xE673,0xE674,0xE675,0xE676, +0xE677,0xE678,0xE679,0xE67A,0xE67B,0xE67C,0xE67D,0xE67E, +0xE67F,0xE680,0xE681,0xE682,0xE683,0xE684,0xE685,0xE686, +0xE687,0xE688,0xE689,0xE68A,0xE68B,0xE68C,0xE68D,0xE68E, +0xE68F,0xE690,0xE691,0xE692,0xE693,0xE694,0xE695,0xE696, +0xE697,0xE698,0xE699,0xE69A,0xE69B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE69C,0xE69D,0xE69E,0xE69F,0xE6A0,0xE6A1,0xE6A2,0xE6A3, +0xE6A4,0xE6A5,0xE6A6,0xE6A7,0xE6A8,0xE6A9,0xE6AA,0xE6AB, +0xE6AC,0xE6AD,0xE6AE,0xE6AF,0xE6B0,0xE6B1,0xE6B2,0xE6B3, +0xE6B4,0xE6B5,0xE6B6,0xE6B7,0xE6B8,0xE6B9,0xE6BA,0xE6BB, +0xE6BC,0xE6BD,0xE6BE,0xE6BF,0xE6C0,0xE6C1,0xE6C2,0xE6C3, +0xE6C4,0xE6C5,0xE6C6,0xE6C7,0xE6C8,0xE6C9,0xE6CA,0xE6CB, +0xE6CC,0xE6CD,0xE6CE,0xE6CF,0xE6D0,0xE6D1,0xE6D2,0xE6D3, +0xE6D4,0xE6D5,0xE6D6,0xE6D7,0xE6D8,0xE6D9,0xE6DA, 0, +0xE6DB,0xE6DC,0xE6DD,0xE6DE,0xE6DF,0xE6E0,0xE6E1,0xE6E2, +0xE6E3,0xE6E4,0xE6E5,0xE6E6,0xE6E7,0xE6E8,0xE6E9,0xE6EA, +0xE6EB,0xE6EC,0xE6ED,0xE6EE,0xE6EF,0xE6F0,0xE6F1,0xE6F2, +0xE6F3,0xE6F4,0xE6F5,0xE6F6,0xE6F7,0xE6F8,0xE6F9,0xE6FA, +0xE6FB,0xE6FC,0xE6FD,0xE6FE,0xE6FF,0xE700,0xE701,0xE702, +0xE703,0xE704,0xE705,0xE706,0xE707,0xE708,0xE709,0xE70A, +0xE70B,0xE70C,0xE70D,0xE70E,0xE70F,0xE710,0xE711,0xE712, +0xE713,0xE714,0xE715,0xE716,0xE717,0xE718,0xE719,0xE71A, +0xE71B,0xE71C,0xE71D,0xE71E,0xE71F,0xE720,0xE721,0xE722, +0xE723,0xE724,0xE725,0xE726,0xE727,0xE728,0xE729,0xE72A, +0xE72B,0xE72C,0xE72D,0xE72E,0xE72F,0xE730,0xE731,0xE732, +0xE733,0xE734,0xE735,0xE736,0xE737,0xE738,0xE739,0xE73A, +0xE73B,0xE73C,0xE73D,0xE73E,0xE73F,0xE740,0xE741,0xE742, +0xE743,0xE744,0xE745,0xE746,0xE747,0xE748,0xE749,0xE74A, +0xE74B,0xE74C,0xE74D,0xE74E,0xE74F,0xE750,0xE751,0xE752, +0xE753,0xE754,0xE755,0xE756,0xE757, 0, 0, 0}; + +/* page 7 0xFA40-0xFC4B - +IBM Selected Kanji and Non-Kanji */ +static uint16 tab_cp932_uni7[]={ +0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, +0x2178,0x2179,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165, +0x2166,0x2167,0x2168,0x2169,0xFFE2,0xFFE4,0xFF07,0xFF02, +0x3231,0x2116,0x2121,0x2235,0x7E8A,0x891C,0x9348,0x9288, +0x84DC,0x4FC9,0x70BB,0x6631,0x68C8,0x92F9,0x66FB,0x5F45, +0x4E28,0x4EE1,0x4EFC,0x4F00,0x4F03,0x4F39,0x4F56,0x4F92, +0x4F8A,0x4F9A,0x4F94,0x4FCD,0x5040,0x5022,0x4FFF,0x501E, +0x5046,0x5070,0x5042,0x5094,0x50F4,0x50D8,0x514A, 0, +0x5164,0x519D,0x51BE,0x51EC,0x5215,0x529C,0x52A6,0x52C0, +0x52DB,0x5300,0x5307,0x5324,0x5372,0x5393,0x53B2,0x53DD, +0xFA0E,0x549C,0x548A,0x54A9,0x54FF,0x5586,0x5759,0x5765, +0x57AC,0x57C8,0x57C7,0xFA0F,0xFA10,0x589E,0x58B2,0x590B, +0x5953,0x595B,0x595D,0x5963,0x59A4,0x59BA,0x5B56,0x5BC0, +0x752F,0x5BD8,0x5BEC,0x5C1E,0x5CA6,0x5CBA,0x5CF5,0x5D27, +0x5D53,0xFA11,0x5D42,0x5D6D,0x5DB8,0x5DB9,0x5DD0,0x5F21, +0x5F34,0x5F67,0x5FB7,0x5FDE,0x605D,0x6085,0x608A,0x60DE, +0x60D5,0x6120,0x60F2,0x6111,0x6137,0x6130,0x6198,0x6213, +0x62A6,0x63F5,0x6460,0x649D,0x64CE,0x654E,0x6600,0x6615, +0x663B,0x6609,0x662E,0x661E,0x6624,0x6665,0x6657,0x6659, +0xFA12,0x6673,0x6699,0x66A0,0x66B2,0x66BF,0x66FA,0x670E, +0xF929,0x6766,0x67BB,0x6852,0x67C0,0x6801,0x6844,0x68CF, +0xFA13,0x6968,0xFA14,0x6998,0x69E2,0x6A30,0x6A6B,0x6A46, +0x6A73,0x6A7E,0x6AE2,0x6AE4,0x6BD6,0x6C3F,0x6C5C,0x6C86, +0x6C6F,0x6CDA,0x6D04,0x6D87,0x6D6F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6D96,0x6DAC,0x6DCF,0x6DF8,0x6DF2,0x6DFC,0x6E39,0x6E5C, +0x6E27,0x6E3C,0x6EBF,0x6F88,0x6FB5,0x6FF5,0x7005,0x7007, +0x7028,0x7085,0x70AB,0x710F,0x7104,0x715C,0x7146,0x7147, +0xFA15,0x71C1,0x71FE,0x72B1,0x72BE,0x7324,0xFA16,0x7377, +0x73BD,0x73C9,0x73D6,0x73E3,0x73D2,0x7407,0x73F5,0x7426, +0x742A,0x7429,0x742E,0x7462,0x7489,0x749F,0x7501,0x756F, +0x7682,0x769C,0x769E,0x769B,0x76A6,0xFA17,0x7746,0x52AF, +0x7821,0x784E,0x7864,0x787A,0x7930,0xFA18,0xFA19, 0, +0xFA1A,0x7994,0xFA1B,0x799B,0x7AD1,0x7AE7,0xFA1C,0x7AEB, +0x7B9E,0xFA1D,0x7D48,0x7D5C,0x7DB7,0x7DA0,0x7DD6,0x7E52, +0x7F47,0x7FA1,0xFA1E,0x8301,0x8362,0x837F,0x83C7,0x83F6, +0x8448,0x84B4,0x8553,0x8559,0x856B,0xFA1F,0x85B0,0xFA20, +0xFA21,0x8807,0x88F5,0x8A12,0x8A37,0x8A79,0x8AA7,0x8ABE, +0x8ADF,0xFA22,0x8AF6,0x8B53,0x8B7F,0x8CF0,0x8CF4,0x8D12, +0x8D76,0xFA23,0x8ECF,0xFA24,0xFA25,0x9067,0x90DE,0xFA26, +0x9115,0x9127,0x91DA,0x91D7,0x91DE,0x91ED,0x91EE,0x91E4, +0x91E5,0x9206,0x9210,0x920A,0x923A,0x9240,0x923C,0x924E, +0x9259,0x9251,0x9239,0x9267,0x92A7,0x9277,0x9278,0x92E7, +0x92D7,0x92D9,0x92D0,0xFA27,0x92D5,0x92E0,0x92D3,0x9325, +0x9321,0x92FB,0xFA28,0x931E,0x92FF,0x931D,0x9302,0x9370, +0x9357,0x93A4,0x93C6,0x93DE,0x93F8,0x9431,0x9445,0x9448, +0x9592,0xF9DC,0xFA29,0x969D,0x96AF,0x9733,0x973B,0x9743, +0x974D,0x974F,0x9751,0x9755,0x9857,0x9865,0xFA2A,0xFA2B, +0x9927,0xFA2C,0x999E,0x9A4E,0x9AD9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00,0x9D70, +0x9D6B,0xFA2D,0x9E19,0x9ED1}; + +static int func_cp932_uni_onechar(int code){ + if ((code>=0x00A1)&&(code<=0x00DF)) + return(tab_cp932_uni0[code-0x00A1]); + if ((code>=0x8140)&&(code<=0x84BE)) + return(tab_cp932_uni1[code-0x8140]); + if ((code>=0x8740)&&(code<=0x879C)) + return(tab_cp932_uni2[code-0x8740]); + if ((code>=0x889F)&&(code<=0x9FFC)) + return(tab_cp932_uni3[code-0x889F]); + if ((code>=0xE040)&&(code<=0xEAA4)) + return(tab_cp932_uni4[code-0xE040]); + if ((code>=0xED40)&&(code<=0xEEFC)) + return(tab_cp932_uni5[code-0xED40]); + if ((code>=0xF040)&&(code<=0xF9FC)) + return(tab_cp932_uni6[code-0xF040]); + if ((code>=0xFA40)&&(code<=0xFC4B)) + return(tab_cp932_uni7[code-0xFA40]); + return(0); +} + +/* page 0 0x005C-0x00F7 */ +static uint16 tab_uni_cp9320[]={ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8198,0x814E, 0, 0, 0, + 0, 0, 0, 0,0x818B,0x817D, 0, 0, +0x814C, 0,0x81F7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x817E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8180}; + +/* page 1 0x0391-0x0451 */ +static uint16 tab_uni_cp9321[]={ +0x839F,0x83A0,0x83A1,0x83A2,0x83A3,0x83A4,0x83A5,0x83A6, +0x83A7,0x83A8,0x83A9,0x83AA,0x83AB,0x83AC,0x83AD,0x83AE, +0x83AF, 0,0x83B0,0x83B1,0x83B2,0x83B3,0x83B4,0x83B5, +0x83B6, 0, 0, 0, 0, 0, 0, 0, +0x83BF,0x83C0,0x83C1,0x83C2,0x83C3,0x83C4,0x83C5,0x83C6, +0x83C7,0x83C8,0x83C9,0x83CA,0x83CB,0x83CC,0x83CD,0x83CE, +0x83CF, 0,0x83D0,0x83D1,0x83D2,0x83D3,0x83D4,0x83D5, +0x83D6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8446, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8440, +0x8441,0x8442,0x8443,0x8444,0x8445,0x8447,0x8448,0x8449, +0x844A,0x844B,0x844C,0x844D,0x844E,0x844F,0x8450,0x8451, +0x8452,0x8453,0x8454,0x8455,0x8456,0x8457,0x8458,0x8459, +0x845A,0x845B,0x845C,0x845D,0x845E,0x845F,0x8460,0x8470, +0x8471,0x8472,0x8473,0x8474,0x8475,0x8477,0x8478,0x8479, +0x847A,0x847B,0x847C,0x847D,0x847E,0x8480,0x8481,0x8482, +0x8483,0x8484,0x8485,0x8486,0x8487,0x8488,0x8489,0x848A, +0x848B,0x848C,0x848D,0x848E,0x848F,0x8490,0x8491, 0, +0x8476}; + +/* page 2 0x2010-0x2473 */ +static uint16 tab_uni_cp9322[]={ +0x815D, 0, 0, 0, 0,0x815C, 0, 0, +0x8165,0x8166, 0, 0,0x8167,0x8168, 0, 0, +0x81F5,0x81F6, 0, 0, 0,0x8164,0x8163, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81F1, 0,0x818C,0x818D, 0, 0, 0, 0, + 0, 0, 0,0x81A6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x818E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8782, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8784, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x81F0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8754,0x8755,0x8756,0x8757,0x8758,0x8759,0x875A,0x875B, +0x875C,0x875D, 0, 0, 0, 0, 0, 0, +0xFA40,0xFA41,0xFA42,0xFA43,0xFA44,0xFA45,0xFA46,0xFA47, +0xFA48,0xFA49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81A9,0x81AA,0x81A8,0x81AB, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81CB, 0,0x81CC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81CD, 0,0x81DD,0x81CE, 0, 0, 0,0x81DE, +0x81B8, 0, 0,0x81B9, 0, 0, 0, 0, + 0,0x8794, 0, 0, 0, 0, 0, 0, + 0, 0,0x81E3, 0, 0,0x81E5,0x8187,0x8798, +0x81DA, 0, 0, 0, 0,0x8161, 0,0x81C8, +0x81C9,0x81BF,0x81BE,0x81E7,0x81E8, 0,0x8793, 0, + 0, 0, 0, 0,0x8188,0x81E6, 0, 0, + 0, 0, 0, 0, 0,0x81E4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81E0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8182,0x81DF, 0, 0, 0, 0,0x8185,0x8186, + 0, 0,0x81E1,0x81E2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81BC,0x81BD, 0, 0,0x81BA,0x81BB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x81DB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8799, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81DC, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8740,0x8741,0x8742,0x8743,0x8744,0x8745,0x8746,0x8747, +0x8748,0x8749,0x874A,0x874B,0x874C,0x874D,0x874E,0x874F, +0x8750,0x8751,0x8752,0x8753}; + +/* page 3 0x2500-0x266F */ +static uint16 tab_uni_cp9323[]={ +0x849F,0x84AA,0x84A0,0x84AB, 0, 0, 0, 0, + 0, 0, 0, 0,0x84A1, 0, 0,0x84AC, +0x84A2, 0, 0,0x84AD,0x84A4, 0, 0,0x84AF, +0x84A3, 0, 0,0x84AE,0x84A5,0x84BA, 0, 0, +0x84B5, 0, 0,0x84B0,0x84A7,0x84BC, 0, 0, +0x84B7, 0, 0,0x84B2,0x84A6, 0, 0,0x84B6, +0x84BB, 0, 0,0x84B1,0x84A8, 0, 0,0x84B8, +0x84BD, 0, 0,0x84B3,0x84A9, 0, 0,0x84B9, + 0, 0,0x84BE, 0, 0, 0, 0, 0, + 0, 0, 0,0x84B4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81A1,0x81A0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81A3,0x81A2, 0, 0, 0, 0, + 0, 0, 0, 0,0x81A5,0x81A4, 0, 0, + 0, 0, 0, 0, 0, 0,0x819F,0x819E, + 0, 0, 0,0x819B, 0, 0,0x819D,0x819C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x81FC, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x819A,0x8199, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x818A, 0,0x8189, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81F4, 0, 0,0x81F3, 0,0x81F2 +}; + +/* page 4 0x3000-0x30FE */ +static uint16 tab_uni_cp9324[]={ +0x8140,0x8141,0x8142,0x8156, 0,0x8158,0x8159,0x815A, +0x8171,0x8172,0x8173,0x8174,0x8175,0x8176,0x8177,0x8178, +0x8179,0x817A,0x81A7,0x81AC,0x816B,0x816C, 0, 0, + 0, 0, 0, 0, 0,0x8780, 0,0x8781, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x829F,0x82A0,0x82A1,0x82A2,0x82A3,0x82A4,0x82A5, +0x82A6,0x82A7,0x82A8,0x82A9,0x82AA,0x82AB,0x82AC,0x82AD, +0x82AE,0x82AF,0x82B0,0x82B1,0x82B2,0x82B3,0x82B4,0x82B5, +0x82B6,0x82B7,0x82B8,0x82B9,0x82BA,0x82BB,0x82BC,0x82BD, +0x82BE,0x82BF,0x82C0,0x82C1,0x82C2,0x82C3,0x82C4,0x82C5, +0x82C6,0x82C7,0x82C8,0x82C9,0x82CA,0x82CB,0x82CC,0x82CD, +0x82CE,0x82CF,0x82D0,0x82D1,0x82D2,0x82D3,0x82D4,0x82D5, +0x82D6,0x82D7,0x82D8,0x82D9,0x82DA,0x82DB,0x82DC,0x82DD, +0x82DE,0x82DF,0x82E0,0x82E1,0x82E2,0x82E3,0x82E4,0x82E5, +0x82E6,0x82E7,0x82E8,0x82E9,0x82EA,0x82EB,0x82EC,0x82ED, +0x82EE,0x82EF,0x82F0,0x82F1, 0, 0, 0, 0, + 0, 0, 0,0x814A,0x814B,0x8154,0x8155, 0, + 0,0x8340,0x8341,0x8342,0x8343,0x8344,0x8345,0x8346, +0x8347,0x8348,0x8349,0x834A,0x834B,0x834C,0x834D,0x834E, +0x834F,0x8350,0x8351,0x8352,0x8353,0x8354,0x8355,0x8356, +0x8357,0x8358,0x8359,0x835A,0x835B,0x835C,0x835D,0x835E, +0x835F,0x8360,0x8361,0x8362,0x8363,0x8364,0x8365,0x8366, +0x8367,0x8368,0x8369,0x836A,0x836B,0x836C,0x836D,0x836E, +0x836F,0x8370,0x8371,0x8372,0x8373,0x8374,0x8375,0x8376, +0x8377,0x8378,0x8379,0x837A,0x837B,0x837C,0x837D,0x837E, +0x8380,0x8381,0x8382,0x8383,0x8384,0x8385,0x8386,0x8387, +0x8388,0x8389,0x838A,0x838B,0x838C,0x838D,0x838E,0x838F, +0x8390,0x8391,0x8392,0x8393,0x8394,0x8395,0x8396, 0, + 0, 0, 0,0x8145,0x815B,0x8152,0x8153}; + +/* page 5 0x3230-0x33CD */ +static uint16 tab_uni_cp9325[]={ + 0,0x878A,0x878B, 0, 0, 0, 0, 0, + 0,0x878C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8785,0x8786,0x8787,0x8788, +0x8789, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8765, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x8769, 0, 0, + 0, 0, 0, 0,0x8760, 0, 0, 0, +0x8763, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8761,0x876B, 0, 0,0x876A,0x8764, + 0, 0, 0,0x876C, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8766, 0, + 0, 0, 0,0x876E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x875F,0x876D, 0, 0,0x8762, 0, 0, + 0,0x8767, 0, 0, 0, 0, 0,0x8768, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x877E,0x878F,0x878E,0x878D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8772,0x8773, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x876F,0x8770,0x8771, 0, + 0,0x8775, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8774, 0, 0, 0, + 0, 0, 0, 0, 0,0x8783}; + +/* page 6 0x4E00-0x9481 */ +static uint16 tab_uni_cp9326[]={ +0x88EA,0x929A, 0,0x8EB5, 0, 0, 0,0x969C, +0x8FE4,0x8E4F,0x8FE3,0x89BA, 0,0x9573,0x975E, 0, +0x98A0,0x894E, 0, 0,0x8A8E,0x98A1,0x90A2,0x99C0, +0x8B75,0x95B8, 0, 0, 0, 0,0x8FE5, 0, + 0,0x97BC, 0, 0, 0, 0,0x95C0, 0, +0xFA68, 0,0x98A2, 0, 0,0x9286, 0, 0, + 0,0x98A3,0x8BF8, 0, 0, 0,0x98A4, 0, +0x8ADB,0x924F, 0,0x8EE5,0x98A5, 0, 0,0x98A6, + 0, 0,0x98A7,0x9454, 0,0x8B76, 0, 0, + 0, 0, 0,0x9456, 0,0x93E1,0x8CC1,0x9652, + 0, 0, 0, 0, 0,0xE568,0x98A8,0x8FE6, +0x98A9,0x89B3, 0, 0, 0,0x8BE3,0x8CEE,0x96E7, + 0, 0,0x9BA4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9790, 0,0x93FB, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8AA3, 0, +0x8B54, 0,0x98AA, 0, 0,0x98AB,0x97B9, 0, +0x975C,0x9188,0x98AD,0x8E96,0x93F1, 0,0x98B0, 0, + 0,0x895D,0x8CDD, 0,0x8CDC,0x88E4, 0, 0, +0x986A,0x9869, 0,0x8DB1,0x889F, 0,0x98B1,0x98B2, +0x98B3,0x9653,0x98B4, 0,0x8CF0,0x88E5,0x9692, 0, +0x8B9C, 0, 0,0x8B9D,0x8B9E,0x92E0,0x97BA, 0, +0x98B5, 0, 0,0x98B6, 0, 0,0x98B7, 0, + 0, 0,0x906C, 0, 0, 0, 0, 0, +0x8F59,0x906D,0x98BC, 0,0x98BA, 0,0x98BB,0x8B77, + 0, 0,0x8DA1,0x89EE, 0,0x98B9,0x98B8,0x95A7, + 0, 0, 0, 0,0x8E65,0x8E64,0x91BC,0x98BD, +0x9574,0x90E5, 0, 0, 0,0x8157,0x98BE,0x98C0, + 0,0xFA69, 0,0x91E3,0x97DF,0x88C8, 0, 0, + 0, 0, 0, 0, 0,0x98BF,0x89BC, 0, +0x8BC2, 0,0x9287, 0, 0, 0,0x8C8F,0x98C1, + 0, 0, 0,0x9443,0xFA6A, 0, 0, 0, +0xFA6B,0x8AE9, 0,0xFA6C, 0, 0, 0, 0, + 0,0x98C2,0x88C9, 0, 0,0x8CDE,0x8AEA,0x959A, +0x94B0,0x8B78, 0, 0, 0, 0, 0, 0, + 0, 0,0x89EF, 0,0x98E5,0x9360, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x948C, +0x98C4, 0, 0, 0,0x94BA, 0,0x97E0, 0, +0x904C,0xFA6D,0x8E66, 0,0x8E97,0x89BE, 0, 0, + 0, 0, 0,0x92CF, 0, 0,0x9241,0x98C8, + 0, 0, 0, 0, 0,0x88CA,0x92E1,0x8F5A, +0x8DB2,0x9743, 0,0x91CC, 0,0x89BD,0xFA6E,0x98C7, + 0,0x975D,0x98C3,0x98C5,0x8DEC,0x98C6,0x9B43, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x98CE, 0, 0, 0, 0, 0,0x98D1, +0x98CF, 0, 0,0x89C0, 0,0x95B9,0x98C9, 0, + 0, 0, 0,0x98CD,0x8CF1, 0, 0,0x8E67, + 0, 0, 0,0x8AA4, 0, 0,0x98D2, 0, +0x98CA, 0,0xFA70,0x97E1, 0,0x8E98, 0,0x98CB, + 0,0x98D0,0xFA6F, 0,0xFA72, 0,0x98D3, 0, +0x98CC, 0,0xFA71,0x8B9F, 0,0x88CB, 0, 0, +0x8BA0,0x89BF, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9B44, 0,0x9699,0x958E,0x8CF2, + 0, 0, 0, 0, 0,0x904E,0x97B5, 0, + 0, 0, 0, 0, 0, 0, 0,0x95D6, + 0, 0,0x8C57,0x91A3,0x89E2, 0, 0, 0, + 0,0xFA61,0x8F72, 0, 0,0xFA73,0x98D7, 0, +0x98DC,0x98DA, 0, 0,0x98D5, 0, 0,0x91AD, +0x98D8, 0,0x98DB,0x98D9, 0,0x95DB, 0,0x98D6, + 0,0x904D, 0,0x9693,0x98DD,0x98DE, 0, 0, + 0, 0, 0, 0, 0, 0,0x8F43,0x98EB, + 0, 0, 0,0x946F, 0,0x9555,0x98E6, 0, +0x95EE, 0,0x89B4, 0, 0, 0,0x98EA,0xFA76, + 0, 0, 0, 0, 0,0x98E4,0x98ED, 0, + 0,0x9171, 0,0x8CC2, 0,0x947B, 0,0xE0C5, + 0,0x98EC,0x937C, 0,0x98E1, 0,0x8CF4, 0, + 0,0x8CF3,0x98DF, 0, 0, 0,0xFA77,0x8ED8, + 0,0x98E7,0xFA75,0x95ED,0x926C,0x98E3,0x8C91, 0, +0x98E0,0x98E8,0x98E2,0x97CF,0x98E9,0x9860, 0, 0, + 0, 0, 0, 0, 0, 0,0x8BE4, 0, + 0,0x8C90, 0, 0, 0, 0, 0, 0, +0xFA74, 0,0xFA7A,0x98EE, 0, 0,0xFA78,0x98EF, +0x98F3,0x88CC, 0, 0, 0, 0, 0,0x95CE, +0x98F2, 0, 0, 0, 0,0x98F1,0x98F5, 0, + 0, 0,0x98F4, 0,0x92E2, 0, 0, 0, + 0, 0, 0, 0, 0,0x8C92, 0, 0, + 0, 0, 0, 0,0x98F6, 0, 0, 0, +0xFA79, 0,0x8EC3, 0,0x91A4,0x92E3,0x8BF4, 0, +0x98F7, 0, 0, 0, 0,0x8B55, 0, 0, +0x98F8, 0, 0, 0, 0,0x98FA, 0, 0, + 0, 0, 0, 0, 0,0x9654, 0, 0, + 0,0x8C86, 0, 0,0xFA7B, 0, 0, 0, +0x8E50,0x94F5,0x98F9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8DC3,0x9762, 0, 0, + 0, 0,0x98FC,0x9942,0x98FB,0x8DC2, 0,0x8F9D, + 0, 0, 0, 0, 0, 0,0x8C58, 0, + 0, 0,0x9943, 0, 0,0x8BCD, 0, 0, + 0,0x9940,0x9941, 0, 0,0x93AD, 0,0x919C, + 0,0x8BA1, 0, 0, 0,0x966C,0x9944, 0, +0xFA7D, 0,0x97BB, 0, 0, 0,0x9945, 0, + 0, 0, 0,0x9948, 0,0x9946, 0,0x916D, + 0, 0, 0, 0, 0,0x9947,0x9949, 0, + 0, 0, 0, 0,0xFA7C,0x994B, 0, 0, + 0,0x994A, 0,0x95C6, 0, 0, 0, 0, +0x8B56,0x994D,0x994E, 0,0x89AD, 0, 0, 0, + 0,0x994C, 0, 0, 0, 0, 0, 0, + 0, 0,0x8EF2, 0,0x9951,0x9950,0x994F, 0, +0x98D4, 0,0x9952, 0, 0, 0, 0,0x8F9E, + 0,0x9953, 0, 0, 0, 0, 0, 0, + 0, 0,0x9744, 0, 0, 0, 0, 0, + 0, 0,0x96D7, 0, 0, 0, 0,0x9955, + 0, 0,0x9954,0x9957,0x9956, 0, 0,0x9958, +0x9959,0x88F2, 0,0x8CB3,0x8C5A,0x8F5B,0x929B,0x8BA2, +0x90E6,0x8CF5,0xFA7E,0x8D8E,0x995B,0x96C6,0x9365, 0, +0x8E99, 0,0x995A, 0,0x995C, 0, 0, 0, + 0, 0,0x937D, 0,0x8A95, 0, 0, 0, + 0, 0,0x995D, 0,0xFA80,0x93FC, 0, 0, +0x9153,0x995F,0x9960,0x94AA,0x8CF6,0x985A,0x9961, 0, + 0,0x8BA4, 0, 0, 0,0x95BA,0x91B4,0x8BEF, +0x9354, 0, 0, 0,0x8C93, 0, 0, 0, +0x9962, 0,0x9963, 0, 0,0x93E0,0x897E, 0, + 0,0x9966,0x8DFB, 0,0x9965,0x8DC4, 0,0x9967, +0xE3EC,0x9968,0x9660,0x9969, 0,0x996A,0x996B,0x8FE7, + 0,0x8ECA, 0, 0, 0,0xFA81, 0, 0, +0x8AA5, 0,0x996E, 0,0x996C,0x96BB,0x996D, 0, +0x9579,0x996F,0x9970,0x9971,0x937E, 0, 0, 0, +0x9975,0x9973,0x9974,0x9972,0x8DE1,0x9976,0x96E8,0x97E2, + 0, 0, 0, 0, 0,0x9977,0xFA82, 0, + 0, 0, 0, 0,0x90A6,0x9978,0x8F79, 0, + 0,0x9979, 0,0x929C,0x97BD,0x9380, 0, 0, + 0, 0, 0, 0, 0, 0,0x99C3, 0, + 0, 0, 0,0x997A,0xEAA3,0x8BC3, 0, 0, +0x997B,0x967D, 0, 0, 0, 0,0x8F88,0x91FA, + 0,0x997D,0x93E2, 0,0xFA83,0x997E, 0, 0, +0x9980,0x8A4D, 0, 0, 0,0x9981,0x8BA5, 0, +0x93CA,0x899A,0x8F6F, 0, 0,0x949F,0x9982, 0, +0x9381, 0, 0,0x906E,0x9983, 0,0x95AA,0x90D8, +0x8AA0, 0,0x8AA7,0x9984, 0, 0,0x9986, 0, + 0,0x8C59, 0, 0,0x9985,0xFA84, 0,0x97F1, + 0, 0, 0, 0, 0,0x8F89, 0, 0, + 0, 0, 0, 0,0x94BB,0x95CA, 0,0x9987, + 0,0x9798,0x9988, 0, 0, 0,0x9989, 0, +0x939E, 0, 0,0x998A, 0, 0,0x90A7,0x8DFC, +0x8C94,0x998B,0x8E68,0x8D8F, 0, 0, 0, 0, + 0, 0, 0,0x92E4,0x998D, 0, 0,0x91A5, + 0, 0,0x8DED,0x998E,0x998F,0x914F, 0,0x998C, + 0, 0, 0, 0,0x9991, 0,0x9655, 0, + 0, 0, 0,0x8D84, 0, 0,0x9990, 0, + 0, 0, 0,0x8C95,0x8DDC,0x948D, 0, 0, + 0,0x9994,0x9992, 0, 0, 0, 0,0x959B, +0x8FE8,0x999B,0x8A84,0x9995,0x9993,0x916E, 0, 0, + 0, 0, 0, 0, 0,0x9997, 0,0x9996, + 0, 0, 0,0x8A63, 0, 0, 0,0x8C80, +0x999C,0x97AB, 0, 0, 0,0x9998, 0, 0, + 0,0x999D,0x999A, 0,0x9999, 0, 0, 0, + 0, 0, 0,0x97CD,0xFA85, 0, 0,0x8CF7, +0x89C1, 0, 0,0x97F2, 0, 0,0xFA86, 0, + 0,0x8F95,0x9377,0x8D85,0x99A0,0x99A1, 0,0xFB77, + 0,0x97E3, 0, 0,0x984A,0x99A3, 0, 0, + 0,0x8CF8, 0, 0,0x99A2, 0,0x8A4E, 0, +0xFA87,0x99A4, 0,0x9675, 0,0x92BA, 0,0x9745, + 0,0x95D7, 0, 0, 0,0x99A5, 0, 0, + 0, 0,0xE8D3, 0, 0,0x93AE, 0,0x99A6, +0x8AA8,0x96B1, 0,0xFA88, 0,0x8F9F,0x99A7,0x95E5, +0x99AB, 0,0x90A8,0x99A8,0x8BCE, 0,0x99A9,0x8AA9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8C4D,0x99AC, 0,0x99AD, 0, 0, +0x99AE,0x99AF,0x8ED9, 0, 0, 0,0x8CF9,0x96DC, +0xFA89,0x96E6,0x93F5, 0, 0,0x95EF,0x99B0,0xFA8A, +0x99B1, 0, 0, 0, 0,0x99B3, 0,0x99B5, +0x99B4, 0, 0, 0, 0,0x99B6,0x89BB,0x966B, + 0,0x8DFA,0x99B7, 0, 0,0x9178, 0, 0, +0x8FA0,0x8BA7, 0,0x99B8,0xFA8B, 0, 0, 0, + 0, 0,0x94D9, 0, 0, 0, 0,0x99B9, + 0,0x99BA, 0,0x99BB, 0, 0, 0, 0, +0x99BC,0x9543,0x8BE6,0x88E3, 0, 0, 0,0x93BD, +0x99BD,0x8F5C, 0,0x90E7, 0,0x99BF,0x99BE,0x8FA1, +0x8CDF,0x99C1,0x94BC, 0, 0,0x99C2, 0, 0, + 0,0x94DA,0x91B2,0x91EC,0x8BA6, 0, 0,0x93EC, +0x9250, 0,0x948E, 0,0x966D, 0,0x99C4, 0, +0x90E8, 0, 0, 0, 0, 0,0x8C54, 0, + 0,0x99C5, 0, 0, 0, 0,0x99C6,0x894B, +0x88F3,0x8AEB,0xFA8C,0x91A6,0x8B70,0x9791, 0,0x99C9, +0x89B5, 0, 0,0x99C8, 0, 0, 0,0x8BA8, + 0, 0,0x99CA, 0,0x96EF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFA8D, 0, 0,0x99CB, 0, +0x97D0, 0,0x8CFA, 0, 0, 0, 0,0x8CB4, +0x99CC, 0, 0, 0, 0,0x99CE,0x99CD, 0, +0x907E,0x8958, 0, 0, 0,0x897D,0x99CF, 0, +0x99D0, 0,0xFA8E,0x8CB5, 0, 0,0x99D1, 0, + 0, 0, 0,0x8B8E, 0, 0, 0, 0, + 0, 0,0x8E51,0x99D2, 0, 0, 0, 0, +0x9694,0x8DB3,0x8B79,0x9746,0x916F,0x94BD,0x8EFB, 0, + 0, 0, 0, 0,0x8F66, 0,0x8EE6,0x8EF3, + 0,0x8F96, 0,0x94BE, 0,0xFA8F, 0,0x99D5, + 0,0x8962,0x9170,0x8CFB,0x8CC3,0x8BE5, 0, 0, +0x99D9,0x9240,0x91FC,0x8BA9,0x8FA2,0x99DA,0x99D8,0x89C2, +0x91E4,0x8EB6,0x8E6A,0x8945, 0, 0,0x8A90,0x8D86, +0x8E69, 0,0x99DB, 0, 0, 0, 0, 0, + 0,0x99DC, 0,0x8B68,0x8A65, 0, 0, 0, +0x8D87,0x8B67,0x92DD,0x8944,0x93AF,0x96BC,0x8D40,0x9799, +0x9366,0x8CFC, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8C4E, 0,0x99E5, 0,0x8BE1, +0x9669, 0, 0, 0, 0, 0,0x94DB, 0, + 0,0x99E4, 0,0x8ADC,0x99DF,0x99E0,0x99E2, 0, + 0, 0, 0, 0, 0, 0,0x99E3, 0, +0x8B7A,0x9081, 0,0x95AB,0x99E1,0x99DD,0x8CE1, 0, +0x99DE, 0,0x9843, 0, 0, 0,0x95F0, 0, +0x92E6,0x8CE0,0x8D90, 0, 0, 0,0x99E6, 0, + 0,0x93DB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x99EA, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8EFC, 0,0x8EF4, 0, 0, 0, 0, 0, +0x99ED,0x99EB, 0,0x96A1, 0,0x99E8,0x99F1,0x99EC, + 0, 0, 0,0x99EF,0x8CC4,0x96BD, 0, 0, +0x99F0, 0, 0, 0,0x99F2, 0,0x99F4, 0, + 0, 0,0xFA92,0x8DEE,0x9861, 0,0x99E9,0x99E7, +0x99F3, 0,0x99EE, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFA91, 0, 0, 0, + 0, 0,0x99F6, 0,0x9A42,0x99F8, 0, 0, +0x99FC,0xFA93, 0,0x9A40,0x99F9, 0, 0,0x9A5D, + 0, 0,0x8DE7,0x8A50, 0, 0, 0, 0, +0x99F7, 0, 0, 0,0x9A44,0x88F4,0x9A43, 0, +0x88A3,0x9569,0x9A41, 0,0x99FA, 0, 0,0x99F5, +0x99FB,0x8DC6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A45, 0, 0, 0, 0, 0, 0, 0, + 0,0x88F5,0x9A4E, 0, 0,0x9A46,0x9A47, 0, +0x8FA3,0x9689, 0, 0, 0,0x9A4C,0x9A4B, 0, + 0, 0,0x934E, 0, 0, 0, 0, 0, + 0, 0,0x9A4D, 0, 0,0x9A4A, 0,0xFA94, + 0, 0, 0, 0,0x8953, 0,0x8DB4,0x904F, + 0, 0, 0, 0, 0, 0, 0,0x9A48, +0x9382, 0, 0, 0,0x9A49, 0,0x88A0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9A53,0x9742, + 0,0x8FA5, 0,0x9A59, 0, 0, 0, 0, +0x9A58,0x9A4F, 0, 0, 0, 0,0x91C1, 0, +0x9A50, 0, 0, 0,0x91ED,0x9A55,0x8FA4, 0, + 0, 0, 0, 0,0x9A52, 0, 0,0x96E2, + 0, 0, 0,0x8C5B, 0, 0,0x9A56,0x9A57, + 0, 0, 0, 0,0x9A54,0x9A5A, 0, 0, + 0, 0, 0,0x9A51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9A60,0x9A65, 0,0x9A61, 0, +0x9A5C, 0, 0,0x9A66,0x9150, 0,0xFA95,0x9A68, + 0,0x8D41,0x9A5E,0x929D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A62,0x9A5B,0x8AAB, 0,0x8AEC,0x8A85,0x9A63,0x9A5F, + 0, 0, 0, 0, 0, 0, 0,0x8C96, +0x9A69,0x9A67,0x9172,0x8B69,0x8BAA, 0,0x9A64, 0, +0x8BF2, 0, 0, 0, 0, 0,0x8963, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A6D,0x9A6B, 0,0x9AA5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A70, 0, 0, 0, + 0, 0,0x9A6A, 0,0x9A6E, 0, 0,0x9A6C, + 0, 0, 0,0x8E6B,0x9A6F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9A72, + 0,0x9A77, 0, 0, 0,0x9A75,0x9A74, 0, + 0, 0, 0, 0, 0, 0,0x9251, 0, + 0,0x89C3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A71, 0,0x9A73,0x8FA6, +0x8952, 0, 0,0x9A76, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x89DC, 0, 0, 0, 0, 0,0x9A82, + 0,0x8FFA,0x9A7D, 0,0x9A7B, 0,0x9A7C, 0, +0x9A7E, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x895C, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9158, 0,0x9A78, 0, +0x9A79, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8A9A, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A81, 0, 0, 0, +0x8AED, 0,0x9A84,0x9A80,0x9A83, 0, 0, 0, + 0, 0, 0, 0,0x95AC, 0, 0, 0, +0x93D3, 0,0x94B6, 0, 0, 0, 0, 0, +0x9A86, 0, 0, 0, 0, 0,0x9A85,0x8A64, + 0, 0,0x9A87, 0, 0, 0, 0,0x9A8A, + 0, 0, 0, 0,0x9A89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A88, 0,0x9458, 0, 0,0x9A8B, 0, 0, + 0, 0, 0, 0, 0, 0,0x9A8C, 0, + 0, 0, 0, 0,0x9A8E, 0,0x9A8D, 0, + 0, 0, 0, 0,0x9A90, 0, 0, 0, +0x9A93,0x9A91,0x9A8F,0x9A92, 0, 0, 0, 0, +0x9A94, 0, 0, 0, 0, 0,0x9A95, 0, + 0,0x9A96, 0,0x9A97, 0, 0, 0,0x9A98, +0x9964, 0,0x8EFA,0x8E6C, 0, 0,0x89F1, 0, +0x88F6, 0, 0,0x9263, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9A99, 0, +0x8DA2, 0,0x88CD,0x907D, 0, 0, 0, 0, + 0,0x9A9A,0x8CC5, 0, 0,0x8D91, 0,0x9A9C, +0x9A9B, 0, 0,0x95DE,0x9A9D, 0, 0, 0, +0x9A9F,0x9A9E, 0,0x9AA0, 0,0x9AA1, 0,0x8C97, + 0, 0,0x8980,0x9AA2, 0, 0,0x9AA4, 0, +0x9AA3, 0, 0, 0,0x9AA6, 0, 0,0x9379, + 0, 0, 0, 0, 0, 0,0x9AA7,0x88B3, +0x8DDD, 0, 0, 0, 0,0x8C5C, 0, 0, +0x926E, 0, 0, 0, 0, 0, 0,0x9AA8, +0x9AA9, 0, 0,0x9AAB, 0, 0, 0, 0, +0x9AAC, 0,0x8DE2, 0, 0, 0, 0,0x8BCF, + 0, 0,0x9656, 0, 0, 0,0x9AAA,0x9AAD, +0x8DBF,0x8D42, 0, 0, 0, 0, 0, 0, + 0,0xFA96, 0, 0, 0, 0, 0, 0, + 0,0x9AB1, 0, 0,0x8DA3,0xFA97,0x9252, 0, + 0,0x9AAE,0x92D8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9AB2, + 0, 0,0x9082, 0, 0, 0, 0, 0, +0x9AB0,0x9AB3, 0,0x8C5E, 0, 0, 0, 0, + 0, 0, 0,0x9AB4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9AB5, 0,0x8D43,0x8A5F,0x9AB7, 0, 0, 0, + 0, 0,0x9AB8, 0,0xFA98, 0, 0, 0, +0x9AB9, 0, 0,0x9AB6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9AAF, 0, 0,0x9ABA, 0, 0,0x9ABB,0xFA9A, +0xFA99, 0, 0,0x9684, 0, 0,0x8FE9, 0, + 0, 0,0x9ABD,0x9ABE,0x9ABC, 0,0x9AC0, 0, + 0, 0, 0, 0,0x9457, 0, 0,0x88E6, +0x9575, 0, 0,0x9AC1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8FFB, 0, 0,0x8EB7, + 0,0x947C,0x8AEE, 0,0x8DE9, 0, 0, 0, +0x9678, 0,0x93B0, 0, 0,0x8C98,0x91CD, 0, + 0, 0,0x9ABF,0x9AC2, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x91C2, 0, 0, + 0,0x9AC3, 0, 0, 0,0x9AC4, 0, 0, + 0,0x9AC6, 0, 0,0x92E7, 0, 0, 0, + 0, 0,0x8AAC, 0, 0, 0, 0,0xEA9F, +0x8981,0x95F1, 0, 0,0x8FEA,0x9367, 0, 0, + 0, 0,0x8DE4, 0, 0,0x9ACC, 0, 0, +0x95BB,0x97DB, 0, 0, 0, 0, 0, 0, + 0, 0,0x89F2,0x9AC8, 0, 0, 0, 0, + 0,0x9159,0x9ACB, 0,0x9383, 0, 0,0x9368, +0x9384,0x94B7,0x92CB, 0, 0, 0,0x8DC7, 0, + 0, 0,0x9AC7, 0, 0, 0, 0, 0, + 0,0x8996, 0,0x9355, 0, 0, 0, 0, +0x9AC9, 0,0x9AC5, 0, 0,0x906F, 0, 0, + 0,0x9ACD, 0, 0, 0, 0,0x8F6D, 0, + 0, 0, 0,0x8BAB, 0,0x9ACE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x95E6, 0, 0, 0,0x919D, + 0, 0, 0, 0,0x92C4, 0,0xFA9D,0x9AD0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x966E, 0, 0,0x9AD1, 0, 0,0x9AD6, 0, + 0, 0,0xFA9E,0x95AD, 0, 0, 0, 0, +0x9AD5,0x9ACF,0x9AD2,0x9AD4, 0, 0,0x8DA4, 0, + 0,0x95C7, 0, 0, 0,0x9AD7, 0,0x9264, + 0, 0,0x89F3, 0,0x8FEB, 0, 0, 0, + 0,0x9AD9, 0,0x9AD8, 0,0x8D88, 0,0x9ADA, +0x9ADC,0x9ADB, 0, 0,0x9ADE, 0,0x9AD3,0x9AE0, + 0, 0, 0, 0,0x9ADF,0x9ADD, 0, 0, + 0, 0, 0,0x8E6D,0x9070, 0,0x9173,0x9AE1, +0x90BA,0x88EB,0x9484, 0, 0, 0, 0,0x92D9, + 0,0x9AE3,0x9AE2,0x9AE4,0x9AE5,0x9AE6, 0, 0, + 0, 0,0x9AE7, 0, 0, 0, 0, 0, + 0,0x95CF,0x9AE8,0xFA9F, 0, 0, 0,0x89C4, +0x9AE9, 0, 0, 0, 0,0x975B,0x8A4F, 0, +0x99C7,0x8F67,0x91BD,0x9AEA,0x96E9, 0, 0, 0, + 0, 0,0x96B2, 0, 0,0x9AEC, 0,0x91E5, + 0,0x9356,0x91BE,0x9576,0x9AED,0x9AEE,0x899B, 0, + 0,0x8EB8,0x9AEF, 0, 0, 0, 0,0x88CE, +0x9AF0, 0, 0, 0, 0, 0,0x9AF1, 0, + 0, 0, 0, 0,0x8982, 0, 0,0x8AEF, +0x93DE,0x95F2, 0, 0, 0, 0,0x9AF5,0x9174, +0x9AF4,0x8C5F, 0,0xFAA0,0x967A,0x9AF3, 0,0x9385, +0x9AF7, 0,0x9AF6,0xFAA1, 0,0xFAA2, 0, 0, +0x9AF9, 0,0x9AF8,0xFAA3, 0,0x899C, 0,0x9AFA, +0x8FA7,0x9AFC,0x9244, 0,0x9AFB, 0,0x95B1, 0, + 0, 0, 0,0x8F97,0x937A, 0, 0, 0, +0x9B40, 0, 0, 0, 0,0x8D44, 0, 0, + 0,0x9B41,0x9440,0x94DC,0x96CF, 0, 0, 0, + 0, 0,0x9444, 0, 0,0x9B4A, 0, 0, + 0, 0, 0,0x8B57, 0, 0,0x9764, 0, + 0,0x96AD, 0,0x9BAA, 0,0x9B42, 0, 0, + 0, 0, 0,0x9B45,0xFAA4,0x91C3, 0, 0, +0x9657, 0, 0, 0,0x9369, 0, 0, 0, + 0, 0,0x9B46, 0, 0, 0, 0, 0, + 0,0x9685,0xFAA5,0x8DC8, 0, 0,0x8FA8, 0, + 0, 0, 0, 0, 0, 0,0x9B47, 0, + 0,0x8E6F, 0,0x8E6E, 0, 0, 0, 0, +0x88B7,0x8CC6, 0,0x90A9,0x88CF, 0, 0, 0, + 0,0x9B4B,0x9B4C, 0,0x9B49, 0, 0, 0, + 0, 0, 0, 0, 0,0x8957,0x8AAD, 0, +0x9B48, 0,0x96C3,0x9550, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x88A6, 0, + 0, 0, 0,0x88F7, 0, 0, 0,0x8E70, + 0,0x88D0, 0,0x88A1, 0, 0, 0, 0, + 0,0x9B51, 0, 0, 0, 0, 0, 0, + 0,0x9B4F, 0, 0, 0, 0, 0, 0, +0x96BA, 0,0x9B52, 0,0x9B50, 0, 0,0x9B4E, +0x9050, 0, 0, 0, 0,0x9B4D, 0, 0, + 0,0x95D8, 0, 0, 0, 0, 0,0x8CE2, + 0, 0, 0, 0, 0,0x9B56,0x9B57, 0, + 0, 0, 0, 0,0x8FA9, 0, 0, 0, +0x9B53,0x984B, 0, 0, 0, 0,0x946B, 0, + 0,0x9B55, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8DA5, 0, 0, 0, 0, 0, + 0, 0,0x9B58, 0, 0, 0,0x9577, 0, + 0, 0,0x9B59, 0,0x9B54, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x96B9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x947D, 0, 0, 0, 0, 0, + 0, 0,0x9B5A,0x9551, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9B5B,0x9B5F,0x9B5C, 0, + 0,0x89C5,0x9B5E, 0, 0, 0, 0, 0, + 0,0x8EB9, 0,0x9B5D,0x8C99, 0, 0, 0, +0x9B6B, 0, 0, 0, 0, 0,0x9B64,0x9B61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9284, 0,0x9B60, 0, 0,0x9B62, 0, + 0,0x9B63, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9B65,0x9B66, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AF0, 0,0x9B68,0x9B67, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9B69, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8FEC, 0, 0, 0, 0, 0, + 0, 0,0x9B6C, 0,0x92DA, 0, 0, 0, +0x8964, 0,0x9B6A, 0, 0, 0,0x9B6D, 0, + 0, 0, 0, 0, 0, 0,0x9B6E, 0, +0x9B71, 0, 0,0x9B6F, 0,0x9B70, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E71,0x9B72, 0, 0,0x8D45,0x9B73,0xFAA6,0x8E9A, +0x91B6, 0,0x9B74,0x9B75,0x8E79,0x8D46, 0,0x96D0, + 0, 0, 0,0x8B47,0x8CC7,0x9B76,0x8A77, 0, + 0,0x9B77, 0,0x91B7, 0, 0, 0, 0, +0x9B78,0x9BA1, 0,0x9B79, 0,0x9B7A, 0, 0, +0x9B7B, 0,0x9B7D, 0, 0, 0, 0, 0, +0x9B7E, 0, 0,0x9B80, 0,0x91EE, 0,0x8946, +0x8EE7,0x88C0, 0,0x9176,0x8AAE,0x8EB3, 0,0x8D47, + 0, 0, 0, 0, 0,0x9386, 0,0x8F40, +0x8AAF,0x9288,0x92E8,0x88B6,0x8B58,0x95F3, 0,0x8EC0, + 0, 0,0x8B71,0x90E9,0x8EBA,0x9747,0x9B81, 0, + 0, 0, 0, 0, 0, 0,0x8B7B, 0, +0x8DC9, 0, 0,0x8A51,0x8983,0x8FAA,0x89C6, 0, +0x9B82,0x9765, 0, 0, 0, 0, 0,0x8F68, +0xFAA7, 0,0x8EE2,0x9B83,0x8AF1,0x93D0,0x96A7,0x9B84, + 0,0x9B85, 0, 0,0x9578, 0, 0, 0, +0x9B87, 0,0x8AA6,0x8BF5,0x9B86, 0, 0, 0, +0xFAA9, 0, 0,0x8AB0, 0,0x9051,0x9B8B,0x8E40, + 0,0x89C7,0x9B8A, 0,0x9B88,0x9B8C,0x9B89,0x944A, +0x9ECB,0x9052, 0,0x9B8D,0xFAAA, 0,0x97BE, 0, +0x9B8E, 0, 0,0x9B90, 0,0x929E,0x9B8F, 0, +0x90A1, 0,0x8E9B, 0, 0, 0,0x91CE,0x8EF5, + 0,0x9595,0x90EA, 0,0x8ECB,0x9B91,0x8FAB,0x9B92, +0x9B93,0x88D1,0x91B8,0x9071, 0,0x9B94,0x93B1,0x8FAC, + 0,0x8FAD, 0,0x9B95, 0, 0,0x90EB, 0, + 0, 0,0x8FAE, 0, 0, 0,0xFAAB, 0, +0x9B96, 0,0x9B97, 0,0x96DE, 0, 0, 0, +0x9B98, 0, 0, 0, 0,0x8BC4, 0, 0, + 0,0x8F41, 0, 0, 0, 0, 0, 0, +0x9B99,0x9B9A,0x8EDA,0x904B,0x93F2,0x9073,0x94F6,0x9441, +0x8BC7,0x9B9B, 0, 0, 0,0x8B8F,0x9B9C, 0, +0x8BFC, 0,0x93CD,0x89AE, 0,0x8E72,0x9B9D,0x9BA0, +0x9B9F,0x8BFB, 0,0x9B9E, 0,0x9357, 0, 0, + 0, 0, 0, 0, 0, 0,0x91AE, 0, +0x936A,0x8EC6, 0, 0,0x9177,0x979A, 0, 0, + 0, 0, 0, 0,0x9BA2, 0,0x9BA3,0x93D4, + 0,0x8E52, 0, 0, 0, 0,0x9BA5, 0, + 0,0x9BA6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9BA7, 0, 0, 0, +0x8AF2,0x9BA8, 0, 0,0x9BA9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x89AA, 0, 0, 0, 0,0xFAAC, 0, +0x915A,0x8AE2, 0,0x9BAB,0x96A6, 0, 0, 0, + 0,0x91D0, 0,0x8A78, 0, 0,0x9BAD,0x9BAF, +0x8ADD, 0,0xFAAD,0x9BAC,0x9BAE, 0,0x9BB1, 0, + 0, 0, 0, 0, 0,0x9BB0, 0,0x9BB2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9BB3, 0, 0, 0, 0, 0, 0, +0x93BB,0x8BAC, 0, 0, 0, 0, 0, 0, +0x89E3,0x9BB4,0x9BB9, 0, 0,0x9BB7, 0,0x95F5, +0x95F4, 0, 0, 0, 0,0xFAAE,0x9387, 0, + 0, 0,0x9BB6,0x8F73, 0,0x9BB5, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9092, + 0, 0, 0,0x9BBA, 0, 0,0x8DE8, 0, + 0,0x9BC0, 0, 0,0x9BC1,0x9BBB,0x8A52,0x9BBC, +0x9BC5,0x9BC4,0x9BC3,0x9BBF, 0, 0, 0,0x9BBE, + 0, 0,0x9BC2, 0, 0, 0, 0,0xFAAF, + 0,0x95F6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFAB2, 0, 0, 0, 0, 0, + 0, 0, 0,0x9BC9,0x9BC6, 0,0x9BC8, 0, +0x9792, 0,0x9BC7,0xFAB0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9BBD, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9093, 0, 0,0x9BCA,0xFAB3, 0,0x8DB5, + 0, 0, 0,0x9BCB, 0, 0,0x9BCC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9BCF, 0,0x9BCE, 0, 0,0x9BCD, + 0, 0, 0,0x9388,0x9BB8, 0, 0, 0, +0x9BD5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9BD1, 0, 0, + 0, 0,0x9BD0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9BD2, 0,0x9BD3, 0, + 0, 0, 0, 0, 0, 0, 0,0x9BD6, +0xFAB4,0xFAB5,0x97E4, 0,0x9BD7,0x9BD4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9BD8, 0, 0,0x8ADE,0x9BD9, 0, 0, +0xFAB6, 0,0x9BDB,0x9BDA, 0, 0,0x9BDC, 0, + 0, 0, 0,0x9BDD, 0,0x90EC,0x8F42, 0, + 0,0x8F84, 0,0x9183, 0,0x8D48,0x8DB6,0x8D49, +0x8B90, 0, 0,0x9BDE, 0, 0,0x8DB7, 0, + 0,0x8CC8,0x9BDF,0x96A4,0x9462,0x9BE0, 0,0x8D4A, + 0, 0, 0,0x8AAA, 0,0x9246,0x8BD0, 0, + 0, 0,0x8E73,0x957A, 0, 0,0x94BF, 0, + 0, 0, 0,0x9BE1,0x8AF3, 0, 0, 0, + 0,0x9BE4, 0, 0, 0, 0,0x929F, 0, + 0,0x9BE3,0x9BE2,0x9BE5, 0,0x92E9, 0, 0, + 0, 0, 0, 0, 0,0x9083, 0, 0, + 0, 0, 0,0x8E74, 0,0x90C8, 0,0x91D1, +0x8B41, 0, 0,0x92A0, 0, 0,0x9BE6,0x9BE7, +0x8FED, 0, 0, 0, 0,0x9658, 0, 0, +0x9BEA, 0, 0,0x9BE9,0x9BE8,0x959D, 0,0x9BF1, + 0, 0, 0, 0,0x9679, 0,0x9BEB, 0, + 0, 0, 0, 0,0x9BED,0x968B, 0,0x9BEC, + 0, 0, 0, 0, 0, 0, 0,0x9BEE, + 0,0x94A6,0x9BEF,0x95BC,0x9BF0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8AB1,0x95BD,0x944E,0x9BF2,0x9BF3, 0, +0x8D4B,0x8AB2,0x9BF4,0x8CB6,0x9763,0x9748,0x8AF4,0x9BF6, + 0,0x92A1, 0,0x8D4C,0x8FAF, 0, 0,0x94DD, + 0, 0,0x8FB0, 0, 0, 0, 0,0x8F98, + 0, 0, 0, 0, 0,0x92EA,0x95F7,0x9358, + 0, 0,0x8D4D, 0,0x957B, 0, 0, 0, +0x9BF7, 0, 0, 0, 0, 0,0x9378,0x8DC0, + 0, 0, 0,0x8CC9, 0,0x92EB, 0, 0, + 0, 0, 0, 0, 0,0x88C1,0x8F8E,0x8D4E, +0x9766, 0, 0, 0, 0, 0, 0, 0, + 0,0x9BF8,0x9BF9,0x9470, 0, 0, 0, 0, +0x9BFA,0x97F5,0x984C, 0, 0, 0, 0,0x9BFC, +0x9BFB, 0, 0,0x8A66, 0, 0,0x9C40, 0, + 0, 0,0x9C43,0x9C44, 0,0x9C42, 0,0x955F, +0x8FB1,0x9C46,0x9C45,0x9C41, 0, 0, 0, 0, +0x9C47,0x9C48, 0, 0,0x9C49, 0, 0, 0, +0x9C4C,0x9C4A, 0,0x9C4B,0x9C4D, 0,0x8984,0x92EC, +0x9C4E, 0,0x8C9A,0x89F4,0x9455, 0,0x9C4F,0x93F9, + 0,0x95D9, 0,0x9C50,0x984D, 0, 0, 0, + 0,0x9C51,0x95BE,0x9C54,0x989F,0x98AF, 0,0x8EAE, +0x93F3,0x9C55, 0,0x8B7C,0x92A2,0x88F8,0x9C56,0x95A4, +0x8D4F, 0, 0,0x926F, 0, 0, 0,0x92ED, + 0,0xFAB7, 0, 0, 0,0x96ED,0x8CB7,0x8CCA, + 0,0x9C57, 0, 0, 0,0x9C58, 0,0x9C5E, + 0,0x8EE3, 0, 0,0xFAB8,0x92A3, 0,0x8BAD, +0x9C59, 0, 0, 0,0x954A, 0,0x9265, 0, + 0,0x9C5A, 0, 0, 0,0xFA67, 0, 0, +0x9C5B, 0,0x8BAE, 0,0x9C5C, 0,0x9C5D, 0, + 0,0x9C5F, 0,0x9396, 0, 0,0x9C60,0x9C61, + 0,0x9C62, 0, 0,0x9C53,0x9C52, 0, 0, + 0,0x9C63,0x8C60, 0, 0, 0,0x9546,0xFAB9, + 0,0x8DCA,0x9556,0x92A4,0x956A,0x9C64, 0, 0, +0x8FB2,0x8965, 0,0x9C65, 0, 0, 0,0x9C66, + 0,0x96F0, 0, 0,0x94DE, 0, 0,0x9C69, +0x899D,0x90AA,0x9C68,0x9C67,0x8C61,0x91D2, 0,0x9C6D, +0x9C6B, 0,0x9C6A,0x97A5,0x8CE3, 0, 0, 0, +0x8F99,0x9C6C,0x936B,0x8F5D, 0, 0, 0,0x93BE, +0x9C70,0x9C6F, 0, 0, 0, 0,0x9C6E, 0, +0x9C71,0x8CE4, 0, 0, 0, 0, 0, 0, +0x9C72,0x959C,0x8F7A, 0, 0,0x9C73,0x94F7, 0, + 0, 0, 0,0x93BF,0x92A5, 0, 0,0xFABA, + 0,0x934F, 0, 0,0x9C74,0x8B4A, 0, 0, + 0, 0, 0,0x9053, 0,0x954B, 0, 0, + 0, 0, 0, 0,0x8AF5,0x9445, 0, 0, + 0, 0, 0, 0, 0, 0,0x9C75,0x8E75, +0x9659,0x965A, 0, 0,0x899E,0x9C7A,0xFABB, 0, +0x9289, 0, 0, 0,0x9C77, 0, 0, 0, + 0, 0, 0,0x89F5, 0, 0, 0, 0, +0x9CAB,0x9C79, 0, 0, 0,0x944F, 0, 0, +0x9C78, 0, 0,0x9C76, 0,0x8D9A, 0,0x9C7C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9C83,0x9C89, +0x9C81, 0,0x937B, 0, 0,0x9C86,0x957C, 0, + 0,0x9C80, 0,0x9C85,0x97E5,0x8E76, 0, 0, +0x91D3,0x9C7D, 0, 0, 0,0x8B7D,0x9C88,0x90AB, +0x8985,0x9C82,0x89F6,0x9C87, 0, 0, 0,0x8BAF, + 0,0x9C84, 0, 0, 0, 0, 0, 0, + 0, 0,0x9C8A, 0, 0, 0, 0, 0, + 0,0x9C8C,0x9C96,0x9C94, 0, 0,0x9C91, 0, + 0, 0,0x9C90,0x97F6, 0,0x9C92, 0, 0, +0x8BB0, 0,0x8D50, 0, 0,0x8F9A, 0, 0, + 0,0x9C99,0x9C8B, 0, 0,0xFABC, 0,0x9C8F, +0x9C7E, 0,0x89F8,0x9C93,0x9C95,0x9270, 0, 0, +0x8DA6,0x89B6,0x9C8D,0x9C98,0x9C97,0x8BB1, 0,0x91A7, +0x8A86, 0, 0, 0, 0,0x8C62, 0,0x9C8E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9C9A, 0,0x9C9D,0x9C9F,0xFABD, 0, 0, + 0,0x8EBB,0xFABE,0x9CA5,0x92EE,0x9C9B, 0, 0, + 0, 0,0x9CA3, 0,0x89F7, 0,0x9CA1,0x9CA2, + 0, 0,0x9C9E,0x9CA0, 0, 0, 0,0x8CE5, +0x9749, 0, 0,0x8AB3, 0, 0,0x8978,0x9CA4, + 0,0x9459,0x88AB, 0, 0, 0, 0, 0, + 0, 0,0x94DF,0x9C7B,0x9CAA,0x9CAE,0x96E3, 0, +0x9CA7, 0, 0, 0,0x9389,0x9CAC, 0, 0, + 0, 0, 0, 0, 0,0x8FEE,0x9CAD,0x93D5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9866, 0,0x9CA9, 0,0xFAC0, 0, 0, +0x9CAF, 0,0x8D9B, 0,0x90C9, 0,0xFABF,0x88D2, +0x9CA8,0x9CA6, 0,0x9179, 0, 0, 0,0x9C9C, +0x8E53, 0, 0, 0, 0, 0, 0, 0, +0x91C4,0x9CBB,0xFAC2,0x917A,0x9CB6, 0,0x9CB3,0x9CB4, + 0,0x8EE4,0x9CB7,0x9CBA, 0, 0, 0, 0, +0x9CB5,0x8F44, 0,0x9CB8, 0, 0,0x9CB2, 0, +0x96FA,0x96F9, 0, 0, 0,0x9CBC,0x9CBD,0x88D3, + 0,0xFAC3, 0, 0, 0,0x9CB1, 0, 0, + 0, 0,0x8BF0,0x88A4, 0, 0, 0,0x8AB4, +0xFAC1,0x9CB9, 0, 0, 0, 0, 0,0x9CC1, +0x9CC0, 0, 0, 0,0x9CC5, 0, 0, 0, +0xFAC5, 0, 0, 0,0x9CC6, 0, 0,0xFAC4, + 0, 0, 0, 0,0x9CC4,0x9CC7,0x9CBF,0x9CC3, + 0, 0,0x9CC8, 0,0x9CC9, 0, 0,0x9CBE, +0x8E9C, 0,0x9CC2,0x91D4,0x8D51,0x9CB0,0x9054, 0, + 0, 0, 0,0x9CD6, 0,0x95E7, 0, 0, +0x9CCC,0x9CCD,0x9CCE, 0, 0,0x9CD5, 0,0x9CD4, + 0, 0,0x969D,0x8AB5, 0,0x9CD2, 0,0x8C64, +0x8A53, 0, 0,0x9CCF, 0, 0,0x97B6,0x9CD1, +0x88D4,0x9CD3, 0,0x9CCA,0x9CD0,0x9CD7,0x8C63,0x9CCB, + 0, 0, 0, 0, 0, 0,0x977C, 0, + 0, 0,0x974A, 0, 0, 0, 0,0x9CDA, + 0, 0,0x9CDE, 0, 0, 0,0x919E, 0, +0x97F7,0x9CDF, 0, 0,0x9CDC, 0,0x9CD9, 0, +0xFAC6,0x9CD8,0x9CDD, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x95AE, 0, 0,0x93B2, + 0,0x8C65, 0,0x9CE0,0x9CDB, 0,0x9CE1, 0, + 0, 0,0x8C9B, 0, 0, 0,0x89AF, 0, + 0, 0,0x9CE9, 0, 0, 0,0x8AB6, 0, + 0, 0, 0,0x9CE7, 0, 0,0x9CE8,0x8DA7, +0x9CE6,0x9CE4,0x9CE3,0x9CEA,0x9CE2,0x9CEC, 0, 0, +0x89F9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9CEE, 0, 0,0x9CED, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x92A6, 0,0x9CF1, 0,0x9CEF,0x9CE5, +0x8C9C, 0,0x9CF0, 0,0x9CF4,0x9CF3,0x9CF5,0x9CF2, +0x9CF6, 0, 0, 0, 0, 0, 0, 0, +0x9CF7,0x9CF8,0x95E8, 0,0x9CFA,0x9CF9,0x8F5E, 0, +0x90AC,0x89E4,0x89FA,0xFAC7,0x9CFB, 0,0x88BD, 0, + 0, 0,0x90CA,0x9CFC, 0,0xE6C1,0x9D40,0x8C81, + 0,0x9D41, 0, 0, 0, 0,0x90ED, 0, + 0, 0,0x9D42, 0, 0, 0,0x9D43,0x8B59, +0x9D44, 0,0x9D45,0x9D46,0x91D5, 0, 0, 0, +0x8CCB, 0, 0,0x96DF, 0, 0, 0,0x965B, +0x8F8A,0x9D47, 0, 0, 0, 0, 0,0x90EE, +0xE7BB,0x94E0, 0,0x8EE8, 0,0x8DCB,0x9D48, 0, + 0, 0, 0,0x91C5, 0,0x95A5, 0, 0, +0x91EF, 0, 0,0x9D4B, 0, 0,0x9D49, 0, +0x9D4C, 0, 0,0x9D4A, 0, 0, 0, 0, +0x9D4D, 0, 0, 0, 0, 0,0x95AF, 0, + 0,0x88B5, 0, 0, 0, 0,0x957D, 0, + 0,0x94E1, 0, 0,0x9D4E, 0,0x9D51,0x8FB3, +0x8B5A, 0,0x9D4F,0x9D56,0x8FB4, 0, 0, 0, + 0,0x9D50,0x9463, 0, 0, 0, 0, 0, + 0,0x977D,0x9D52,0x9D53,0x9D57,0x938A,0x9D54,0x8D52, +0x90DC, 0, 0,0x9D65,0x94B2, 0,0x91F0, 0, + 0, 0, 0, 0, 0, 0,0xFAC8, 0, + 0, 0, 0,0x94E2,0x9DAB, 0, 0, 0, + 0,0x95F8, 0, 0, 0,0x92EF, 0, 0, + 0,0x9695, 0,0x9D5A,0x899F,0x928A, 0, 0, + 0, 0,0x9D63, 0, 0,0x9253,0x9D5D,0x9D64, +0x9D5F,0x9D66,0x9D62, 0,0x9D61,0x948F, 0,0x9D5B, +0x89FB,0x9D59,0x8B91,0x91F1,0x9D55, 0, 0,0x9D58, +0x8D53,0x90D9, 0,0x8FB5,0x9D60,0x9471, 0, 0, +0x8B92,0x8A67, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8A87,0x9040,0x9D68,0x9D6D, + 0,0x9D69, 0,0x8C9D, 0,0x9D6E,0x8E41,0x8D89, + 0, 0, 0, 0, 0, 0,0x8F45,0x9D5C, + 0,0x8E9D,0x9D6B, 0, 0, 0, 0,0x8E77, +0x9D6C,0x88C2, 0, 0,0x9D67, 0, 0, 0, + 0,0x92A7, 0, 0, 0, 0, 0, 0, + 0,0x8B93, 0, 0, 0, 0, 0,0x8BB2, + 0, 0, 0, 0, 0, 0, 0,0x9D6A, +0x88A5, 0, 0,0x8DC1, 0, 0, 0,0x9055, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x92F0, 0, 0,0x94D2,0x9D70,0x917D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x91A8, 0, 0,0x8E4A,0x9D71, 0,0x9D73, +0x9D6F, 0, 0, 0, 0,0x95DF, 0,0x92BB, + 0, 0, 0, 0,0x917B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x95F9, +0x8ECC,0x9D80, 0,0x9D7E, 0, 0,0x9098, 0, + 0, 0,0x8C9E, 0, 0, 0,0x9D78,0x8FB7, + 0, 0,0x93E6,0x9450, 0, 0, 0, 0, +0x9D76, 0, 0,0x917C, 0, 0, 0, 0, +0x8EF6,0x9D7B, 0, 0,0x8FB6, 0,0x9D75,0x9D7A, + 0, 0,0x9472, 0, 0, 0,0x9D74, 0, +0x8C40, 0, 0,0x8A7C, 0, 0, 0,0x9D7C, +0x97A9,0x8DCC,0x9254,0x9D79, 0,0x90DA, 0,0x8D54, +0x9084,0x8986,0x915B,0x9D77,0x8B64, 0, 0, 0, + 0, 0,0x8C66, 0,0x92CD,0x9D7D, 0, 0, + 0, 0, 0,0x917E, 0, 0,0x9D81, 0, +0x9D83, 0, 0,0x91B5,0x9D89, 0,0x9D84, 0, + 0,0x9D86, 0, 0, 0, 0, 0,0x9560, +0x92F1, 0,0x9D87, 0, 0, 0,0x974B, 0, + 0, 0,0x9767,0x8AB7, 0, 0, 0, 0, + 0,0x88AC, 0,0x9D85, 0, 0, 0, 0, + 0,0x9D82, 0, 0, 0, 0,0x8AF6, 0, + 0, 0, 0, 0,0x8987,0xFAC9,0x9D88, 0, + 0, 0,0x9768, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9D8C, 0, + 0, 0, 0, 0, 0,0x91B9, 0,0x9D93, + 0, 0, 0,0x9D8D, 0, 0,0x9D8A,0x9D91, + 0, 0, 0, 0,0x9D72, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9D8E, 0, +0x9D92, 0, 0, 0,0x94C0,0x938B, 0, 0, + 0, 0, 0, 0,0x9D8B, 0,0x9D8F, 0, + 0, 0,0x8C67, 0, 0, 0,0x8DEF, 0, + 0, 0,0x90DB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9D97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9345, 0, 0, 0, 0, 0, 0, 0, +0xFACA, 0, 0, 0, 0, 0, 0,0x9D94, + 0,0x9680, 0, 0, 0, 0, 0,0x9D95, + 0, 0, 0, 0, 0, 0,0x9D96, 0, +0x96CC, 0,0x90A0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8C82, 0, 0, 0, 0, +0x9D9D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8E54,0x9D9A, 0,0x9D99, 0, 0, + 0, 0,0x9451, 0, 0,0xFACB,0x93B3, 0, + 0, 0, 0, 0,0x9350,0x9D9B, 0, 0, + 0,0x9D9C, 0,0x958F, 0,0x9464,0x8E42, 0, +0x90EF, 0,0x966F, 0, 0, 0, 0, 0, + 0,0x8A68, 0,0x9DA3,0x9D9E, 0, 0, 0, + 0,0x9769,0x9DA5, 0, 0,0x9DA1, 0,0x9DA2, + 0, 0, 0, 0, 0,0x9180,0xFACC, 0, + 0, 0,0x9DA0, 0,0x9D5E, 0, 0, 0, +0x9DA4, 0,0x9D9F, 0, 0, 0, 0, 0, +0x9DA9,0x9DAA,0x9346,0x9DAC, 0, 0,0x8E43,0x9DA7, + 0, 0, 0, 0,0x8B5B, 0, 0,0x9DAD, + 0,0x9DA6,0x9DB1, 0,0x9DB0, 0,0x9DAF, 0, + 0, 0,0x9DB2, 0, 0,0x9DB4,0x8FEF, 0, +0x9DB3, 0, 0, 0, 0,0x9DB7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9DB5, 0, 0, 0,0x9DB6,0x9D90, 0, 0, + 0, 0, 0,0x9DB9,0x9DB8, 0, 0, 0, + 0, 0,0x9D98,0x9DBA,0x9DAE, 0, 0,0x8E78, + 0, 0, 0, 0,0x9DBB,0x9DBC,0x9DBE,0x9DBD, +0x9DBF,0x89FC, 0,0x8D55, 0, 0,0x95FA,0x90AD, + 0, 0, 0, 0, 0,0x8CCC, 0, 0, +0x9DC1, 0, 0, 0, 0,0x9DC4,0xFACD,0x9571, + 0,0x8B7E, 0, 0, 0,0x9DC3,0x9DC2,0x9473, +0x9DC5,0x8BB3, 0, 0, 0,0x9DC7,0x9DC6, 0, + 0, 0,0x8AB8,0x8E55, 0, 0,0x93D6, 0, + 0, 0, 0, 0,0x8C68, 0, 0, 0, +0x9094, 0,0x9DC8, 0,0x90AE,0x9347, 0,0x957E, +0x9DC9, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9DCA,0x9DCB, 0, 0, 0,0x95B6, +0x9B7C,0x90C4, 0, 0,0x956B, 0,0x8DD6, 0, +0x94E3,0x94C1, 0, 0, 0, 0, 0,0x936C, + 0,0x97BF, 0,0x9DCD,0x8ECE, 0, 0,0x9DCE, + 0,0x88B4, 0, 0,0x8BD2,0x90CB, 0,0x9580, + 0, 0, 0,0x9DCF,0x8E61,0x9266, 0,0x8E7A, +0x9056, 0, 0, 0, 0, 0, 0,0x9DD0, + 0,0x95FB, 0, 0,0x8997,0x8E7B, 0, 0, + 0,0x9DD3, 0,0x9DD1,0x9DD4,0x97B7,0x9DD2, 0, + 0, 0, 0,0x90F9,0x9DD5, 0, 0,0x91B0, + 0, 0,0x9DD6, 0, 0, 0, 0,0x8AF8, + 0,0x9DD8, 0,0x9DD7, 0, 0, 0, 0, +0x9DD9,0x9DDA,0x8AF9, 0, 0,0x93FA,0x9255,0x8B8C, +0x8E7C,0x9181, 0, 0,0x8F7B,0x88AE, 0, 0, + 0,0x9DDB, 0, 0, 0, 0, 0, 0, + 0, 0,0x89A0,0x9DDF, 0, 0, 0, 0, +0xFACE, 0,0x8D56,0x9DDE, 0, 0,0x8DA9,0x8FB8, + 0,0xFAD1,0x9DDD, 0,0x8FB9, 0,0x96BE,0x8DA8, + 0, 0, 0,0x88D5,0x90CC,0xFACF, 0, 0, + 0, 0, 0, 0,0x9DE4, 0,0xFAD3,0x90AF, +0x8966, 0, 0, 0,0xFAD4,0x8F74, 0,0x9686, +0x8DF0, 0, 0, 0, 0,0x8FBA,0xFAD2,0x90A5, + 0,0xFA63, 0, 0,0x9DE3,0x9DE1,0x9DE2, 0, + 0, 0, 0,0xFAD0,0x928B, 0, 0,0x9E45, + 0,0x9DE8,0x8E9E,0x8D57,0x9DE6, 0, 0, 0, + 0,0x9DE7, 0,0x9057, 0, 0, 0,0x9DE5, + 0, 0,0x8E4E, 0, 0, 0, 0,0xFAD6, + 0,0xFAD7, 0, 0, 0,0x9DEA,0x9DE9,0x9DEE, + 0,0xFAD7,0x9DEF, 0,0x9DEB,0xFAD5,0x8A41,0x9DEC, +0x9DED,0x94D3, 0, 0, 0, 0,0x9581,0x8C69, +0x9DF0, 0, 0,0xFAD9,0x90B0, 0,0x8FBB, 0, + 0, 0,0x9271, 0, 0, 0, 0, 0, + 0,0x8BC5, 0,0x9DF1,0x9DF5, 0, 0,0x89C9, +0x9DF2,0x9DF4, 0, 0, 0, 0,0x9DF3, 0, + 0,0x8F8B, 0, 0, 0, 0,0x9267,0x88C3, +0x9DF6,0xFADA, 0, 0, 0,0x9DF7, 0, 0, +0xFADB, 0,0x92A8, 0, 0, 0,0x97EF, 0, + 0, 0, 0,0x8E62, 0, 0,0x95E9, 0, + 0, 0,0xFADC, 0,0x965C, 0, 0, 0, +0x9E41,0x9DF9, 0, 0,0x9DFC, 0,0x9DFB,0xFADD, + 0,0x9DF8, 0, 0,0x9E40, 0, 0,0x93DC, + 0,0x9DFA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9E42, 0, + 0,0x8F8C,0x9E43, 0,0x976A,0x9498, 0, 0, +0x9E44, 0, 0, 0, 0, 0,0x9E46, 0, + 0,0x9E47, 0, 0, 0, 0, 0, 0, +0x9E48, 0,0x8BC8,0x8967,0x8D58,0x9E49, 0,0x9E4A, +0x8F91,0x9182,0xFADE,0xFA66,0x99D6,0x915D,0x915C,0x91D6, +0x8DC5, 0, 0,0x98F0, 0, 0, 0, 0, +0x8C8E,0x974C, 0,0x95FC, 0,0x959E,0xFADF,0x9E4B, + 0, 0, 0, 0,0x8DF1,0x92BD,0x9E4C,0x984E, + 0, 0, 0,0x965D, 0,0x92A9,0x9E4D,0x8AFA, + 0, 0, 0, 0, 0, 0,0x9E4E,0x9E4F, +0x96D8, 0,0x96A2,0x9696,0x967B,0x8E44,0x9E51, 0, + 0,0x8EE9, 0, 0,0x9670, 0,0x9E53,0x9E56, +0x9E55, 0,0x8AF7, 0, 0,0x8B80, 0,0x9E52, + 0,0x9E54, 0, 0, 0, 0,0x9E57, 0, + 0,0x9099, 0, 0, 0, 0,0x979B,0x88C7, +0x8DDE,0x91BA, 0,0x8EDB, 0, 0,0x8FF1, 0, + 0,0x9E5A, 0, 0,0x936D, 0,0x9E58,0x91A9, +0x9E59,0x8FF0,0x96DB,0x9E5B,0x9E5C,0x9788,0xFAE1, 0, + 0, 0,0x9E61, 0, 0,0x8D59, 0,0x9474, +0x9E5E,0x938C,0x9DDC,0x9DE0, 0,0x8B6E, 0,0x9466, + 0, 0, 0, 0,0x9E60, 0,0x8FBC,0x94C2, + 0, 0, 0, 0, 0,0x9E66, 0,0x94F8, + 0,0x9E5D, 0,0x9E63,0x9E62, 0, 0, 0, +0x90CD, 0, 0, 0, 0,0x968D, 0,0x97D1, + 0, 0,0x9687, 0,0x89CA,0x8E7D, 0, 0, +0x9867,0x9E65,0x9095, 0, 0, 0,0x9E64, 0, + 0,0x9E5F, 0, 0, 0, 0, 0,0x8CCD, + 0, 0, 0,0x9E6B,0x9E69, 0,0x89CB,0x9E67, +0x9E6D,0x9E73, 0,0xFAE2, 0, 0, 0, 0, +0xFAE4,0x91C6, 0, 0,0x95BF, 0,0x9E75, 0, + 0, 0,0x9541, 0, 0, 0,0x9E74,0x9490, +0x965E,0x8AB9, 0,0x90F5,0x8F5F, 0, 0, 0, +0x92D1, 0,0x974D, 0, 0,0x9E70,0x9E6F, 0, + 0, 0,0x9E71, 0,0x9E6E, 0, 0,0x9E76, + 0,0x9E6C, 0, 0,0x9E6A, 0,0x9E72,0x9E68, + 0,0x928C, 0,0x96F6,0x8EC4,0x8DF2, 0, 0, + 0, 0, 0,0x8DB8, 0, 0,0x968F,0x8A60, + 0,0xFAE5,0x92CC,0x93C8,0x8968, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x90F0, 0, 0,0x90B2,0x8C49, + 0, 0, 0, 0, 0, 0,0x9E78, 0, + 0,0x8D5A,0x8A9C, 0, 0, 0, 0, 0, + 0,0x9E7A,0x8A94,0x9E81, 0, 0, 0, 0, + 0, 0,0x9E7D, 0,0x90F1, 0, 0, 0, +0x8A6A,0x8DAA, 0, 0,0x8A69,0x8DCD, 0, 0, +0x9E7B,0x8C85,0x8C6A,0x938D,0xFAE6, 0,0x9E79, 0, +0x88C4, 0, 0, 0, 0,0x9E7C,0x9E7E, 0, +0x8BCB,0x8C4B,0xFAE3,0x8ABA,0x8B6A, 0, 0, 0, + 0,0x9E82, 0, 0,0x8DF7,0x9691, 0,0x8E56, + 0, 0, 0,0x9E83, 0, 0, 0,0x954F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9E8F, 0,0x89B1,0x9E84, + 0, 0, 0, 0, 0, 0,0x9E95,0x9E85, + 0,0x97C0, 0,0x9E8C, 0,0x947E, 0, 0, + 0, 0, 0, 0, 0,0x9E94, 0,0x9E87, + 0, 0, 0,0x88B2,0x9E89, 0, 0,0x8D5B, + 0, 0, 0,0x9E8B, 0,0x9E8A, 0,0x9E86, +0x9E91, 0,0x8FBD, 0, 0, 0,0x9AEB,0x8CE6, +0x979C, 0, 0, 0, 0,0x9E88, 0,0x92F2, +0x8A42,0x8DAB, 0,0x9E80, 0,0x9E90,0x8A81, 0, + 0,0x9E8E,0x9E92, 0,0x938E, 0, 0, 0, + 0, 0, 0, 0,0x8AFC, 0,0x9EB0, 0, +0xFA64,0x96C7,0x9E97,0x8AFB, 0,0x9E9E, 0,0xFAE7, + 0, 0,0x965F, 0,0x9E9F,0x9EA1, 0,0x9EA5, +0x9E99, 0,0x9249, 0, 0, 0, 0,0x938F, +0x9EA9,0x9E9C, 0,0x9EA6, 0, 0, 0,0x9EA0, + 0, 0, 0, 0, 0, 0,0x9058,0x9EAA, + 0, 0,0x90B1, 0, 0, 0, 0, 0, + 0,0x9EA8,0x8ABB, 0, 0, 0, 0, 0, +0x986F,0x9E96, 0, 0,0x9EA4,0x88D6, 0, 0, +0x9E98, 0, 0,0x96B8,0x9E9D,0x9041,0x92C5,0x9E93, + 0, 0,0x9EA3, 0, 0, 0, 0, 0, + 0,0x909A,0x9EAD,0x8A91,0x8C9F, 0, 0, 0, + 0,0x9EAF,0x9E9A,0x9EAE, 0,0x9EA7,0x9E9B, 0, +0x9EAB, 0,0x9EAC, 0, 0, 0, 0, 0, +0x9EBD, 0, 0, 0,0x93CC, 0,0x9EA2, 0, + 0,0x9EB9, 0, 0, 0,0x9EBB, 0,0x92D6, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x976B, 0, 0, 0, 0, 0, + 0, 0, 0,0x9596,0x9EB6,0x91C8, 0, 0, + 0,0x9EBC,0x915E, 0,0x9EB3,0x9EC0,0x9EBF, 0, +0x93ED,0x9EBE,0x93E8, 0, 0, 0, 0, 0, +0xFAE9, 0,0x9EC2,0x9EB5, 0,0x8BC6,0x9EB8,0x8F7C, + 0, 0, 0,0x9480,0x9EBA,0x8BC9, 0,0x9EB2, +0x9EB4,0x9EB1, 0, 0,0x984F,0x8A79,0x9EB7, 0, + 0,0x9EC1,0x8A54, 0, 0, 0, 0, 0, + 0, 0,0x8DE5, 0, 0, 0,0x897C, 0, + 0,0x9ED2, 0, 0,0x9850,0x9ED5, 0, 0, +0xFAEB, 0, 0,0x9059,0x9ED4, 0, 0, 0, +0x9ED3, 0, 0, 0, 0, 0, 0,0x9ED0, + 0, 0, 0, 0, 0, 0,0x9EC4, 0, + 0,0x9EE1,0x9EC3, 0,0x9ED6, 0, 0, 0, + 0, 0, 0,0x9ECE, 0, 0,0x9EC9,0x9EC6, + 0,0x9EC7, 0,0x9ECF, 0, 0, 0,0xEAA0, + 0, 0,0x9ECC,0x8D5C,0x92C6,0x9184,0x9ECA, 0, +0x9EC5, 0, 0,0x9EC8, 0, 0, 0, 0, +0x976C,0x968A, 0, 0, 0,0x9ECD,0x9ED7, 0, + 0, 0,0xFAEC, 0, 0, 0, 0,0x9EDF, +0x9ED8, 0, 0,0x9EE5, 0,0x9EE3, 0, 0, + 0, 0,0x9EDE, 0, 0, 0, 0, 0, + 0,0x9EDD, 0,0x92CE, 0,0x9185, 0,0x9EDB, + 0, 0,0x9ED9, 0, 0,0x9EE0, 0, 0, + 0, 0,0x9EE6,0x94F3,0x9EEC, 0, 0, 0, + 0, 0,0x9EE7,0x9EEA,0x9EE4, 0, 0,0x9294, + 0,0x9557, 0,0x9EDA, 0, 0,0x9EE2,0x8FBE, + 0,0x96CD,0x9EF6,0x9EE9, 0, 0, 0, 0, + 0,0x8CA0,0x89A1,0x8A7E, 0, 0,0x9ED1, 0, +0xFAED, 0, 0, 0, 0,0x8FBF,0x9EEE, 0, +0x9EF5,0x8EF7,0x8A92, 0, 0,0x924D, 0, 0, + 0, 0, 0, 0,0x9EEB, 0,0xFAEF,0x9EF0, +0x9EF4, 0, 0,0x8BB4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B6B,0x9EF2, 0, 0, 0, 0, 0,0x8B40, + 0,0x93C9,0x9EF1, 0, 0, 0,0x9EF3, 0, + 0, 0, 0,0xFAEE, 0, 0, 0, 0, + 0, 0,0x9EED,0xFAF0, 0, 0, 0, 0, +0x9EEF, 0, 0, 0, 0, 0,0xFAF1,0x8A80, +0x9268, 0, 0, 0,0x9EFA, 0, 0, 0, + 0, 0, 0, 0, 0,0x9EF8,0x8CE7, 0, +0x9EF7, 0, 0, 0, 0, 0, 0,0x9F40, + 0, 0, 0, 0,0x9E77, 0, 0, 0, +0x9EF9, 0,0x9EFB,0x9EFC, 0, 0, 0, 0, + 0, 0,0x9F4B, 0,0x9F47, 0,0x9E8D, 0, + 0, 0, 0,0x9F46, 0, 0, 0, 0, +0x9F45, 0, 0,0x9F42, 0, 0, 0, 0, + 0,0x9EE8,0x9F44,0x9F43, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9F49, 0,0x9845, 0, 0, 0, 0, + 0, 0,0x9F4C,0x8BF9, 0, 0,0x9F48,0x9F4A, + 0, 0,0xFAF2, 0,0xFAF3, 0, 0, 0, +0x94A5, 0,0x9F4D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9F51,0x9F4E, 0, 0, 0, 0, + 0, 0, 0, 0,0x9793,0x9F4F, 0, 0, + 0, 0,0x9EDC, 0, 0, 0, 0, 0, + 0, 0,0x9F52, 0, 0, 0,0x9F53, 0, + 0, 0, 0, 0, 0,0x8954, 0,0x9F55, +0x8C87,0x8E9F, 0,0x8BD3, 0, 0, 0,0x89A2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x977E, 0, 0, 0, 0,0x9F57, +0x9F56,0x9F59,0x8B5C, 0, 0,0x8BD4,0x8ABC, 0, + 0, 0, 0,0x9F5C, 0, 0, 0,0x9F5B, + 0,0x9F5D, 0, 0,0x89CC, 0,0x9256, 0, +0x9F5E, 0, 0,0x8ABD,0x9F60, 0, 0, 0, + 0,0x9F5F, 0,0x9F61, 0, 0, 0,0x9F62, + 0,0x9F63,0x8E7E,0x90B3,0x8D9F, 0,0x9590, 0, + 0,0x95E0,0x9863, 0, 0, 0, 0,0x8E95, + 0, 0, 0,0x8DCE,0x97F0, 0, 0, 0, +0x9F64,0x9F65, 0,0x8E80, 0, 0, 0,0x9F66, +0x9F67, 0, 0,0x9F69,0x9F68, 0,0x9677, 0, + 0,0x8F7D,0x8EEA,0x8E63, 0,0x9F6A, 0, 0, + 0, 0, 0, 0, 0,0x9F6C,0x9042, 0, +0x9F6B, 0, 0, 0, 0, 0,0x9F6D, 0, + 0, 0, 0, 0,0x9F6E, 0, 0, 0, + 0, 0,0x9F6F,0x9F70, 0, 0, 0,0x9F71, + 0,0x9F73,0x9F72,0x9F74,0x89A3,0x9269, 0,0x9F75, + 0, 0,0x8E45,0x8A6B,0x9F76, 0, 0,0x9361, +0x9ACA, 0, 0, 0, 0,0x8B42,0x9F77, 0, + 0, 0, 0,0x9F78, 0,0x95EA,0x9688, 0, + 0, 0,0x93C5,0x9F79,0x94E4, 0,0xFAF4, 0, +0x94F9, 0, 0,0x96D1, 0, 0, 0,0x9F7A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9F7C,0x9F7B, 0, 0,0x9F7E, + 0, 0, 0,0x9F7D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9F81, 0, 0, 0, 0, 0, 0,0x8E81, + 0,0x96AF, 0,0x9F82,0x9F83, 0, 0,0x8B43, + 0, 0, 0,0x9F84, 0, 0, 0, 0, + 0, 0, 0,0x9F86,0x9F85, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9085, 0, 0,0x9558, +0x8969, 0, 0, 0, 0, 0,0x94C3,0xFAF5, +0x92F3,0x8F60,0x8B81, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x94C4, 0, +0x8EAC, 0, 0, 0, 0,0x9F88, 0,0x8ABE, + 0, 0,0x8998, 0,0xFAF6,0x93F0,0x9F87,0x8D5D, +0x9272, 0,0x9F89, 0, 0, 0, 0, 0, +0x9F91, 0,0x9F8A, 0, 0, 0, 0,0xFAF8, +0x91BF, 0,0x8B82,0x9F92, 0, 0, 0, 0, + 0, 0,0x8C88, 0, 0,0x8B44,0x9F90, 0, + 0,0x9F8E,0x9F8B,0x9780, 0, 0,0xFAF7, 0, +0x92BE, 0, 0, 0,0x93D7,0x9F8C, 0, 0, +0x9F94, 0,0x9F93,0x8C42, 0, 0,0x89AB, 0, + 0,0x8DB9,0x9F8D,0x9F8F, 0, 0, 0, 0, + 0,0x9676,0x91F2, 0, 0, 0, 0, 0, + 0, 0, 0,0x9697, 0, 0,0x9F9C, 0, + 0,0x9F9D, 0,0x89CD, 0, 0, 0, 0, +0x95A6,0x96FB,0x9F9F,0x8EA1,0x8FC0,0x9F98,0x9F9E,0x8988, + 0,0x8BB5, 0, 0,0x9F95,0x9F9A, 0, 0, + 0,0x90F2,0x9491, 0,0x94E5, 0, 0, 0, + 0, 0, 0,0x9F97, 0,0x9640, 0,0x9F99, + 0,0x9FA2,0xFAF9,0x9FA0, 0,0x9F9B, 0, 0, + 0,0x9641,0x9467,0x8B83, 0,0x9344, 0, 0, +0x928D, 0,0x9FA3, 0, 0, 0, 0,0x9FA1, +0x91D7,0x9F96, 0,0x896A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFAFA, 0, 0, 0, + 0, 0, 0,0x976D,0x9FAE, 0, 0, 0, + 0, 0,0x9FAD, 0, 0, 0, 0,0x90F4, + 0,0x9FAA, 0,0x978C, 0, 0,0x93B4,0x9FA4, + 0, 0, 0, 0, 0,0x92C3, 0, 0, + 0,0x896B,0x8D5E,0x9FA7, 0, 0, 0, 0, + 0, 0,0x8F46,0x9FAC, 0,0x9FAB,0x9FA6, 0, +0x9FA9, 0, 0,0x8A88, 0,0x9FA8,0x9468, 0, + 0,0x97AC, 0, 0,0x8FF2,0x90F3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9FB4,0x9FB2, 0,0x956C, 0, 0, 0, + 0, 0, 0,0x9FAF,0x9FB1, 0,0x8959, 0, + 0,0x8D5F,0x9851, 0,0x8A5C, 0,0x9582,0xFAFC, + 0, 0, 0, 0,0x9781, 0, 0,0x8A43, +0x905A,0x9FB3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9FB8, 0,0xFAFB, +0x8FC1, 0, 0, 0,0x974F, 0,0x9FB5, 0, + 0, 0, 0,0x9FB0, 0,0x9FB6,0xFB40, 0, + 0,0x97DC, 0,0x9393,0x93C0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFB41, 0, 0,0x8A55, + 0, 0,0x8974, 0, 0,0x9FBC, 0, 0, +0x9FBF, 0, 0, 0,0x97C1, 0, 0, 0, +0x9784, 0, 0, 0, 0,0x9FC6,0x9FC0,0x9FBD, + 0, 0, 0,0x97D2,0x9FC3, 0, 0,0xFB42, + 0,0x8F69,0x9FC5, 0, 0,0x9FCA, 0, 0, +0x9391,0x9FC8, 0, 0, 0, 0,0x9FC2, 0, + 0,0x9257, 0, 0,0x9FC9, 0,0x9FBE, 0, +0x9FC4, 0,0x9FCB,0x88FA,0x9FC1, 0,0x9FCC, 0, + 0,0x905B,0xFB44,0x8F7E, 0,0x95A3, 0,0x8DAC, +0xFB43,0x9FB9,0x9FC7,0x9359,0xFB45, 0, 0, 0, + 0, 0, 0, 0, 0,0x90B4, 0,0x8A89, +0x8DCF,0x8FC2,0x9FBB,0x8F61, 0, 0, 0, 0, + 0, 0, 0,0x8C6B, 0,0x9FBA, 0, 0, + 0,0x9FD0,0x8F8D,0x8CB8, 0,0x9FDF, 0,0x9FD9, +0x8B94,0x936E, 0,0x9FD4,0x9FDD,0x88AD,0x8951,0xFB48, + 0,0x89B7, 0,0x9FD6,0x91AA,0x9FCD,0x9FCF,0x8D60, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9FE0,0xFB46,0x9FDB, 0,0xFB49, 0,0x9FD3, 0, + 0, 0, 0,0x9FDA, 0, 0, 0, 0, + 0, 0,0x96A9, 0, 0,0x9FD8,0x9FDC, 0, + 0, 0, 0, 0, 0, 0,0x8CCE, 0, +0x8FC3, 0, 0,0x9258,0xFB47, 0, 0,0x9FD2, + 0, 0, 0, 0, 0, 0, 0,0x974E, + 0, 0, 0,0x9FD5, 0, 0,0x9FCE,0x9392, + 0, 0,0x9FD1, 0, 0, 0,0x9FD7, 0, + 0, 0, 0, 0, 0, 0,0x9870,0x8EBC, +0x969E, 0,0x9FE1, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x94AC, 0, 0,0x9FED, +0x8CB9, 0, 0, 0, 0, 0,0x8F80, 0, +0x9FE3, 0, 0, 0,0x97AD,0x8D61, 0,0x9FF0, + 0, 0,0x88EC, 0, 0,0x9FEE, 0, 0, + 0, 0,0x9FE2, 0, 0, 0, 0,0x9FE8, + 0, 0,0x9FEA, 0, 0, 0,0x976E,0x9FE5, + 0, 0,0x934D, 0, 0,0x9FE7, 0,0xFB4A, + 0, 0,0x9FEF, 0,0x9FE9,0x96C5, 0, 0, + 0,0x9FE4, 0,0x8EA0,0x9FFC, 0, 0, 0, + 0,0x8A8A, 0,0x9FE6,0x9FEB,0x9FEC, 0, 0, + 0, 0, 0, 0, 0,0x91EA,0x91D8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9FF4, 0, 0,0x9FFA, + 0, 0,0x9FF8, 0,0x9348, 0, 0,0xE042, +0x9FF5, 0, 0, 0, 0, 0,0x9FF6,0x9FDE, + 0,0x8B99,0x9559, 0, 0, 0,0x8EBD, 0, + 0,0x8D97, 0, 0, 0, 0, 0,0x9852, + 0,0x9FF2, 0,0xE041,0x8989,0x9186, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9499, 0,0x8ABF,0x97F8, 0, 0, 0, 0, + 0, 0, 0,0x969F,0x92D0, 0, 0, 0, + 0,0x9FF9,0x9FFB, 0, 0, 0, 0, 0, +0x9151, 0, 0, 0, 0, 0,0xE040,0x9FF7, + 0,0x9FF1, 0, 0, 0,0x8AC1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8C89, 0, 0, 0, +0xE04E, 0, 0,0xE049,0x90F6, 0, 0,0x8A83, + 0, 0, 0, 0,0x8F81, 0,0xE052, 0, + 0, 0, 0, 0, 0,0xE04B,0x92AA,0xE048, +0x92D7, 0, 0, 0,0xE06B, 0, 0, 0, +0xE045, 0,0xE044, 0,0xE04D, 0, 0, 0, +0xE047,0xE046,0xE04C, 0,0x909F, 0,0xE043, 0, +0xFB4B, 0, 0, 0, 0, 0,0xE04F, 0, + 0,0xE050, 0, 0, 0, 0, 0,0x8AC0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE055, 0,0xE054,0xE056, 0, 0, 0, + 0, 0,0xE059, 0, 0, 0, 0, 0, + 0,0x9362, 0,0xE053, 0,0xFB4C, 0, 0, + 0,0xE057, 0, 0, 0, 0, 0, 0, +0x8C83,0x91F7,0xE051,0x945A, 0, 0,0xE058, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE05D,0xE05B, 0, 0, +0xE05E, 0, 0,0xE061, 0, 0, 0,0xE05A, +0x8D8A,0x9447, 0, 0,0x9FB7, 0, 0, 0, + 0, 0, 0,0x9794,0xE05C, 0,0xE060,0x91F3, + 0,0xE05F, 0,0xE04A, 0,0xFB4D,0xE889, 0, + 0, 0,0xE064, 0, 0, 0,0xE068, 0, + 0,0xE066, 0, 0, 0,0xFB4E, 0,0xFB4F, + 0,0xE062, 0,0xE063, 0, 0, 0,0xE067, + 0,0xE065, 0, 0, 0,0x956D, 0, 0, +0xE06D, 0,0xE06A,0xE069, 0,0xE06C,0x93D2,0xE06E, + 0, 0, 0, 0, 0, 0,0x9295,0x91EB, +0xFB50, 0, 0, 0,0x90A3, 0, 0, 0, +0xE06F, 0,0xE071, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE070, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9FF3, 0, 0, 0, + 0,0xE072, 0, 0, 0, 0, 0, 0, +0x93E5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE073, 0, 0, 0, 0, + 0, 0, 0,0x89CE, 0, 0, 0,0x9394, +0x8A44, 0, 0, 0, 0, 0, 0, 0, +0x8B84, 0, 0, 0,0x8EDC,0x8DD0, 0, 0, + 0, 0, 0, 0, 0,0xFB51, 0, 0, + 0,0x9846,0x9086, 0, 0, 0,0x898A, 0, + 0, 0,0xE075, 0, 0, 0, 0, 0, + 0,0xE074, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFB52,0xE078,0x9259,0xE07B,0xE076, + 0, 0, 0,0xE07A, 0, 0, 0, 0, +0xE079,0x935F,0x88D7,0xFA62, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x97F3, 0, 0,0xE07D, 0, 0, 0,0x8947, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE080, 0, 0, 0,0xE07E, 0,0xE07C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE077, 0, 0, 0, 0, 0, 0, + 0,0x9642, 0, 0, 0,0xE082, 0, 0, + 0, 0, 0, 0,0xFB54, 0, 0, 0, + 0,0xE081, 0, 0, 0, 0, 0,0xFB53, + 0, 0, 0, 0,0x898B, 0, 0, 0, + 0,0xE084,0x95B0, 0,0xE083, 0, 0, 0, + 0,0x96B3, 0, 0, 0, 0,0x8FC5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9152, 0, + 0, 0, 0, 0,0x8FC4, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFB56,0xFB57, + 0,0x97F9, 0, 0,0xE08A, 0,0x90F7, 0, + 0, 0, 0, 0, 0,0xE086,0xE08B, 0, + 0,0x898C, 0, 0,0xFB55, 0, 0, 0, + 0, 0,0xE089, 0,0x9481,0xE085,0xE088,0x8FC6, + 0,0x94CF, 0, 0,0xE08C, 0,0x8ECF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x90F8, 0, 0, + 0, 0, 0, 0,0xE08F, 0, 0, 0, +0xE087, 0,0x8C46, 0, 0, 0, 0,0xE08D, + 0, 0, 0, 0,0x976F,0xE090, 0, 0, + 0,0xEAA4, 0, 0, 0, 0, 0,0x8F6E, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE091, 0, 0, 0,0xE092, 0, 0, 0, + 0,0x944D, 0, 0, 0, 0, 0, 0, + 0,0xE094, 0, 0, 0, 0,0xE095, 0, + 0,0xFB59, 0,0x9452, 0, 0, 0, 0, +0x9395,0xE097, 0, 0, 0, 0,0xE099, 0, +0x97D3, 0,0xE096, 0,0xE098,0x898D, 0,0xE093, + 0, 0, 0, 0, 0, 0, 0,0x9A7A, +0xE09A, 0, 0, 0, 0,0x9187,0x8E57,0xE09C, + 0, 0, 0, 0,0xE09B,0x9043,0x99D7, 0, + 0, 0, 0, 0, 0,0xE09D, 0, 0, + 0,0xE09F, 0,0xE08E,0xE09E, 0,0xFB5A,0xE0A0, + 0, 0, 0, 0, 0, 0,0x949A, 0, + 0, 0, 0, 0, 0,0xE0A1, 0, 0, +0xE0A2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE0A3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE0A4, 0,0x92DC, 0,0xE0A6,0xE0A5, 0, 0, +0xE0A7, 0,0xE0A8, 0, 0,0x8EDD,0x9583, 0, + 0, 0,0x96EA,0xE0A9,0xE0AA,0x9175,0x8EA2,0xE0AB, +0xE0AC, 0, 0, 0, 0, 0,0xE0AD,0x95D0, +0x94C5, 0, 0,0xE0AE,0x9476, 0, 0, 0, + 0, 0,0x92AB, 0, 0, 0, 0, 0, +0xE0AF,0x89E5, 0,0x8B8D, 0,0x96C4, 0,0x96B4, + 0,0x89B2,0x9853, 0, 0, 0, 0,0x9671, + 0,0x95A8, 0, 0, 0, 0, 0, 0, + 0, 0,0x90B5, 0,0xE0B0, 0, 0, 0, + 0,0x93C1, 0, 0, 0,0x8CA1,0xE0B1, 0, +0x8DD2,0xE0B3,0xE0B2, 0, 0, 0, 0,0xE0B4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0B5, 0, 0, 0,0xE0B6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B5D, 0,0xE0B7, 0, 0, 0, 0,0xE0B8, + 0, 0, 0, 0,0x8CA2, 0, 0,0x94C6, + 0,0xFB5B,0xE0BA, 0, 0, 0,0x8FF3, 0, + 0,0xE0B9, 0, 0, 0, 0,0xFB5C, 0, + 0, 0,0x8BB6,0xE0BB,0xE0BD, 0,0xE0BC, 0, + 0, 0, 0, 0, 0, 0,0xE0BE, 0, +0x8CCF, 0,0xE0BF, 0, 0, 0, 0,0x8BE7, + 0,0x915F, 0,0x8D9D, 0, 0, 0, 0, +0xE0C1,0xE0C2,0xE0C0, 0, 0, 0, 0, 0, + 0,0x8EEB, 0, 0,0x93C6,0x8BB7, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE0C4, +0x924B,0xE0C3, 0, 0,0x9854,0x9482, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0C7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0C9,0xE0C6, + 0, 0, 0,0x96D2,0xE0C8,0xE0CA, 0,0x97C2, + 0, 0, 0, 0,0xFB5D,0xE0CE, 0, 0, + 0,0xE0CD,0x9296,0x944C, 0, 0,0x8CA3,0xE0CC, + 0, 0, 0, 0,0xE0CB, 0,0x9750,0x9751, + 0, 0, 0, 0, 0, 0,0xE0CF,0x898E, + 0, 0, 0, 0,0x8D96,0x8E82, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0D0,0xE0D1, + 0, 0, 0, 0, 0, 0, 0,0xE0D3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8F62, 0, 0, 0, 0, +0xE0D5, 0,0xE0D4, 0, 0, 0, 0, 0, +0xE0D6, 0,0x8A6C, 0, 0,0xE0D8, 0,0xFB5F, +0xE0D7, 0,0xE0DA,0xE0D9, 0, 0, 0, 0, + 0, 0, 0, 0,0x8CBA, 0, 0,0x97A6, + 0,0x8BCA, 0,0x89A4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8BE8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8ADF, 0, 0, 0, 0, 0, 0, + 0, 0,0x97E6,0xE0DC, 0, 0, 0, 0, + 0, 0, 0,0xE0DE, 0,0xFB60, 0, 0, +0xE0DF, 0,0x89CF, 0, 0, 0, 0, 0, +0xE0DB,0xFB61,0x8E58, 0, 0,0x92BF,0xE0DD, 0, + 0, 0,0xFB64, 0, 0, 0,0xFB62, 0, + 0, 0, 0, 0, 0, 0,0xE0E2, 0, +0x8EEC, 0, 0,0xFB63, 0,0xE0E0, 0, 0, + 0, 0,0x8C5D, 0, 0,0x94C7,0xE0E1, 0, + 0,0xE0FC, 0, 0, 0,0xFB66, 0, 0, +0xE0E7, 0, 0, 0, 0, 0,0x8CBB, 0, + 0, 0, 0,0x8B85, 0,0xE0E4,0x979D,0xFB65, + 0,0x97AE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x91F4, 0, 0,0xE0E6,0xFB67, 0, + 0,0xFB69,0xFB68, 0, 0, 0,0xFB6A, 0, + 0, 0,0xE0E8,0x97D4,0x8BD5,0x94FA,0x9469, 0, + 0, 0,0xE0E9, 0, 0, 0, 0,0xE0EB, + 0,0xE0EE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE0EA, 0, 0, + 0,0xE0ED,0x8CE8,0x896C,0xE0EF, 0,0x9090,0xE0EC, +0x97DA, 0,0xFB6B,0xE0F2,0xEAA2, 0, 0, 0, + 0,0xE0F0,0xE0F3, 0, 0, 0, 0,0xE0E5, +0xE0F1, 0, 0,0x8DBA, 0, 0,0xE0F4, 0, + 0, 0, 0, 0, 0, 0,0xE0F5, 0, + 0, 0, 0,0x979E, 0, 0, 0, 0, + 0,0xFB6C, 0,0xE0F6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0F7,0xFB6D, + 0, 0,0xE0E3, 0, 0, 0, 0,0xE0F8, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8AC2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x8EA3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0F9, 0, 0, 0, 0,0xE0FA, + 0, 0, 0, 0,0xE0FB, 0, 0, 0, + 0, 0, 0, 0,0x895A, 0, 0, 0, +0xE140, 0,0x955A,0xE141, 0, 0,0x8AA2,0xE142, + 0,0xE143, 0, 0, 0, 0,0xE144, 0, +0xE146,0xE147,0xE145, 0, 0, 0,0x9572,0xE149, +0xE148, 0, 0, 0, 0, 0, 0, 0, + 0,0xFB6E, 0,0xE14B,0xE14A,0xE14C, 0, 0, + 0, 0, 0, 0,0xE14D,0xE14F,0xE14E, 0, + 0,0x8D99, 0,0xE151, 0,0xE150, 0, 0, +0x8AC3, 0,0x9072, 0,0x935B, 0,0xE152,0x90B6, + 0, 0, 0,0x8E59, 0,0x8999,0xE153, 0, +0x9770, 0, 0,0x95E1,0xE154, 0, 0,0xFAA8, +0x9363,0x9752,0x8D62,0x905C, 0, 0, 0,0x926A, +0x99B2, 0,0x92AC,0x89E6,0xE155, 0, 0, 0, + 0, 0, 0, 0,0xE156, 0,0xE15B, 0, + 0,0xE159,0xE158,0x9DC0,0x8A45,0xE157, 0,0x88D8, + 0,0x94A8, 0, 0,0x94C8, 0, 0, 0, + 0,0x97AF,0xE15C,0xE15A,0x927B,0x90A4, 0, 0, +0x94A9, 0,0x954C, 0,0xE15E,0x97AA,0x8C6C,0xE15F, + 0,0xE15D,0x94D4,0xE160, 0,0xE161, 0,0xFB6F, +0x88D9, 0, 0,0x8FF4,0xE166, 0,0xE163,0x93EB, +0xE162, 0, 0, 0, 0, 0, 0,0x8B45, + 0, 0,0xE169, 0, 0, 0,0xE164,0xE165, + 0,0xE168,0xE167,0x9544, 0, 0,0x9161,0x9160, + 0,0x8B5E, 0, 0,0xE16A, 0, 0, 0, + 0, 0,0xE16B, 0, 0,0xE16C, 0, 0, + 0, 0, 0,0xE16E, 0,0xE16D, 0, 0, + 0, 0, 0,0x8975, 0, 0, 0, 0, + 0,0xE176,0x94E6,0xE170, 0,0xE172, 0, 0, +0xE174,0x905D, 0, 0,0xE175,0xE173,0x8EBE, 0, + 0, 0,0xE16F,0xE171, 0,0x9561, 0,0x8FC7, + 0, 0,0xE178, 0, 0,0xE177, 0, 0, + 0, 0,0xE179, 0,0x8EA4,0x8DAD, 0, 0, +0x9397,0xE17A, 0,0x92C9, 0, 0,0xE17C, 0, + 0, 0,0x979F,0xE17B, 0, 0, 0, 0, + 0,0x9189, 0, 0, 0, 0, 0, 0, +0xE182, 0,0xE184,0xE185,0x9273, 0, 0, 0, + 0, 0,0xE183, 0,0xE180, 0,0xE17D,0xE17E, + 0,0xE181, 0, 0, 0, 0, 0, 0, + 0,0xE188, 0,0xE186, 0,0xE187, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE189, +0xE18B,0xE18C,0xE18D, 0,0xE18E, 0, 0,0xE18A, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE190, 0, 0, 0,0xE18F, 0, 0, 0, + 0, 0, 0,0xE191, 0, 0, 0, 0, + 0, 0,0x97C3, 0, 0, 0,0xE194,0xE192, +0xE193, 0, 0, 0,0x8AE0, 0, 0, 0, + 0, 0,0x96FC, 0, 0, 0,0x95C8, 0, +0xE196, 0, 0, 0,0xE195, 0, 0, 0, + 0,0xE197,0xE198, 0, 0, 0, 0,0xE19C, +0xE199,0xE19A,0xE19B, 0,0xE19D, 0, 0, 0, +0xE19E, 0,0xE19F, 0, 0, 0,0xE1A0, 0, +0xE1A1, 0,0x94AD,0x936F,0xE1A2,0x9492,0x9553, 0, +0xE1A3, 0,0xFB70,0xE1A4,0x9349, 0,0x8A46,0x8D63, +0xE1A5, 0, 0,0xE1A6, 0, 0,0xE1A7, 0, +0x8E48, 0, 0,0xE1A9, 0, 0,0xE1A8, 0, + 0,0xE1AA,0xE1AB,0xFB73,0xFB71, 0,0xFB72, 0, + 0, 0, 0, 0, 0, 0,0xFB74, 0, + 0, 0, 0, 0, 0, 0,0x94E7, 0, +0xE1AC, 0, 0, 0,0xE1AD, 0, 0,0xEA89, +0xE1AE,0xE1AF,0xE1B0, 0, 0, 0, 0,0x8E4D, + 0, 0,0xE1B1,0x9475, 0, 0,0x967E, 0, +0x896D, 0,0x8976, 0, 0,0xE1B2, 0, 0, + 0, 0,0xE1B4, 0, 0, 0,0xE1B3,0x9390, + 0, 0, 0,0x90B7,0x9F58, 0,0xE1B5,0x96BF, + 0,0xE1B6, 0,0x8AC4,0x94D5,0xE1B7, 0,0xE1B8, + 0, 0,0xE1B9, 0, 0, 0,0x96DA, 0, + 0, 0,0x96D3, 0,0x92BC, 0, 0, 0, +0x918A, 0, 0,0xE1BB, 0, 0,0x8F82, 0, + 0,0x8FC8, 0, 0,0xE1BE, 0, 0,0xE1BD, +0xE1BC,0x94FB, 0,0x8AC5,0x8CA7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE1C4, 0, 0,0xE1C1,0x905E, +0x96B0, 0, 0, 0,0xE1C0,0xE1C2,0xE1C3, 0, + 0,0xE1BF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE1C5, +0xE1C6, 0,0x92AD, 0,0x8AE1, 0, 0, 0, +0x9285, 0, 0, 0, 0, 0,0xFB76,0xE1C7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE1C8,0xE1CB, 0, 0, 0, 0, + 0,0x9087, 0,0x93C2, 0,0xE1CC,0x9672, 0, +0xE1C9, 0, 0,0xE1CA, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE1CF, 0, 0, 0, 0,0xE1CE,0xE1CD, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE1D1, 0, 0,0xE1D0, 0, + 0,0xE1D2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE1D4, 0, +0xE1D3, 0, 0, 0, 0,0x95CB, 0, 0, + 0, 0, 0, 0,0x8F75,0x97C4, 0, 0, +0xE1D5, 0, 0,0x93B5, 0, 0,0xE1D6, 0, + 0,0xE1D7, 0,0xE1DB,0xE1D9,0xE1DA, 0,0xE1D8, + 0, 0, 0, 0, 0, 0, 0,0xE1DC, + 0, 0, 0, 0, 0,0xE1DD, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE1DE, + 0, 0,0xE1DF,0x96B5,0xE1E0, 0, 0, 0, + 0, 0,0x96EE,0xE1E1, 0,0x926D, 0,0x948A, + 0,0x8BE9, 0, 0, 0,0x925A,0xE1E2,0x8BB8, + 0, 0, 0,0x90CE, 0, 0, 0, 0, + 0, 0, 0, 0,0xE1E3, 0, 0, 0, + 0, 0,0x8DBB, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE1E4, 0, 0, 0, + 0, 0,0xE1E5, 0,0x8CA4,0x8DD3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE1E7,0xFB78, 0, 0, 0,0x9375,0x8DD4,0x8B6D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9643, 0,0x946A, 0, 0, 0, + 0, 0,0x9376, 0, 0, 0, 0,0x8D7B, + 0, 0, 0, 0, 0,0xE1E9, 0, 0, + 0, 0, 0, 0, 0, 0,0xFB79, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x8FC9, 0, 0, + 0, 0, 0, 0,0xFB7A, 0, 0, 0, + 0, 0, 0,0x97B0,0x8D64, 0, 0,0x8CA5, + 0, 0,0x94A1, 0,0xE1EB, 0, 0, 0, + 0, 0,0xFB7B, 0,0xE1ED, 0, 0, 0, + 0,0x8CE9, 0, 0, 0, 0,0xE1EC,0x92F4, + 0, 0, 0, 0,0xE1EF,0x8A56,0xE1EA, 0, + 0,0x94E8, 0,0x894F, 0,0x8DEA, 0,0x9871, + 0, 0,0xE1EE, 0, 0, 0, 0, 0, + 0, 0, 0,0xE1F0, 0, 0, 0,0x95C9, + 0,0x90D7,0xE1F2, 0, 0, 0, 0,0xE1F3, + 0, 0, 0, 0, 0,0xE1F1, 0, 0, + 0, 0,0x8A6D, 0,0xE1F9, 0,0xE1F8, 0, + 0,0x8EA5, 0, 0, 0,0xE1FA,0xE1F5, 0, + 0, 0,0xE1FB,0xE1F6, 0, 0, 0, 0, +0x94D6,0xE1F4, 0, 0,0xE1F7, 0, 0, 0, + 0, 0,0xE241, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE240, +0x9681, 0, 0, 0,0xE1FC, 0, 0,0x88E9, + 0, 0, 0, 0,0xE243, 0, 0, 0, + 0, 0, 0, 0, 0,0xE242, 0, 0, + 0,0x8FCA, 0, 0, 0, 0, 0,0xE244, + 0, 0, 0, 0, 0, 0,0x9162, 0, + 0,0xE246,0xE245, 0, 0, 0, 0, 0, + 0,0xE247, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE1E6, 0, + 0, 0,0xE1E8,0xE249,0xE248, 0, 0, 0, +0xFB7C, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8EA6, 0,0x97E7, 0,0x8ED0, 0, +0xE24A,0x8C56, 0, 0, 0, 0, 0,0x8B5F, +0x8B46,0x8E83, 0, 0, 0, 0, 0, 0, +0x9753, 0, 0,0xE250, 0,0xE24F,0x9163,0xE24C, + 0, 0,0xE24E, 0, 0,0x8F6A,0x905F,0xE24D, +0xE24B, 0,0x9449, 0, 0,0x8FCB, 0, 0, +0x955B, 0, 0, 0, 0,0x8DD5, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9398, + 0, 0,0xE251, 0, 0, 0, 0,0xE252, +0xE268,0x8BD6, 0, 0,0x985C,0x9154, 0, 0, + 0, 0,0xE253, 0, 0,0x89D0,0x92F5,0x959F, + 0, 0, 0, 0,0xFB81, 0, 0, 0, + 0, 0, 0,0xFB83, 0,0xE254, 0, 0, + 0, 0, 0, 0, 0, 0,0x8B9A,0xE255, + 0, 0,0xE257, 0, 0, 0,0xE258, 0, +0x9448, 0, 0,0xE259, 0, 0, 0, 0, + 0,0xE25A,0xE25B, 0, 0,0x8BD7,0x89D1,0x93C3, +0x8F47,0x8E84, 0, 0, 0, 0, 0, 0, + 0,0xE25C, 0,0x8F48, 0, 0, 0, 0, + 0,0x89C8,0x9562, 0, 0,0xE25D, 0, 0, +0x94E9, 0, 0, 0, 0, 0, 0,0x9164, + 0,0xE260, 0,0xE261,0x9489, 0,0x9060,0xE25E, + 0,0x9281, 0, 0,0xE25F, 0, 0, 0, +0x8FCC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x88DA, 0, 0, 0, 0, +0x8B48, 0, 0, 0, 0, 0, 0, 0, +0xE262, 0, 0,0x92F6, 0,0xE263,0x90C5, 0, + 0, 0, 0, 0,0x96AB, 0, 0,0x9542, +0xE264,0xE265,0x9274, 0,0x97C5, 0, 0,0xE267, +0xE266, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8EED, 0, + 0,0xE269,0x88EE, 0, 0, 0, 0,0xE26C, + 0, 0, 0,0xE26A,0x89D2,0x8C6D,0xE26B,0x8D65, +0x8D92, 0,0x95E4,0xE26D, 0, 0,0x9673, 0, + 0,0xE26F, 0, 0, 0,0x90CF,0x896E,0x89B8, +0x88AA, 0, 0, 0, 0, 0, 0,0xE26E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE270,0xE271,0x8FF5, 0, 0, 0, 0, + 0,0xE272, 0,0x8A6E, 0, 0, 0, 0, +0xE274, 0, 0, 0,0x8C8A, 0,0x8B86, 0, + 0,0xE275,0x8BF3, 0, 0,0xE276, 0,0x90FA, + 0,0x93CB, 0,0x90DE,0x8DF3, 0, 0, 0, +0xE277, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9282,0x918B, 0,0xE279,0xE27B,0xE278, +0xE27A, 0, 0, 0, 0, 0, 0,0x8C41, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE27C,0x8C45, 0, 0, 0,0x8B87,0x9771, +0xE27E, 0, 0, 0, 0, 0,0xE280, 0, + 0, 0,0x894D, 0, 0, 0, 0,0xE283, + 0, 0, 0,0x8A96,0xE282,0xE281, 0,0xE285, +0xE27D, 0,0xE286,0x97A7, 0,0xE287, 0,0xE288, + 0,0xFB84,0x9AF2,0xE28A, 0,0xE289, 0, 0, + 0,0xE28B,0xE28C, 0,0x97B3,0xE28D, 0,0xE8ED, +0x8FCD,0xE28E,0xE28F,0x8F76, 0,0x93B6,0xE290,0xFB85, + 0, 0,0x9247,0xFB87, 0,0xE291, 0,0x925B, +0xE292, 0, 0, 0, 0, 0,0x8BA3, 0, +0x995E,0x927C,0x8EB1, 0, 0, 0, 0,0x8AC6, + 0, 0,0xE293, 0,0xE2A0, 0,0xE296, 0, +0x8B88, 0,0xE295,0xE2A2, 0, 0, 0,0xE294, + 0,0x8FCE, 0, 0, 0, 0, 0, 0, +0xE298,0xE299, 0,0x934A, 0, 0,0xE29A, 0, +0x8A7D, 0, 0, 0, 0,0x9079,0x9584, 0, +0xE29C, 0, 0, 0,0x91E6, 0, 0, 0, + 0, 0, 0,0xE297, 0,0xE29B,0xE29D, 0, + 0,0x8DF9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE2A4,0x954D, 0, +0x94A4,0x9399, 0,0x8BD8,0xE2A3,0xE2A1, 0,0x94B3, +0xE29E,0x927D,0x939B, 0,0x939A, 0,0x8DF4, 0, + 0, 0, 0, 0, 0,0xE2B6, 0, 0, + 0, 0, 0, 0, 0,0xE2A6, 0,0xE2A8, + 0, 0, 0, 0,0xE2AB, 0,0xE2AC, 0, +0xE2A9,0xE2AA, 0, 0,0xE2A7,0xE2A5, 0, 0, + 0, 0,0xE29F, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x95CD,0x89D3, + 0, 0, 0,0xE2B3, 0,0xE2B0, 0,0xE2B5, + 0, 0,0xE2B4, 0,0x9493,0x96A5, 0,0x8E5A, +0xE2AE,0xE2B7,0xE2B2, 0,0xE2B1,0xE2AD,0xFB88,0xE2AF, + 0,0x8AC7, 0, 0, 0, 0, 0, 0, + 0, 0,0x925C, 0, 0,0x90FB, 0, 0, + 0,0x94A0, 0, 0,0xE2BC, 0, 0, 0, +0x94A2, 0, 0, 0, 0, 0, 0, 0, +0x90DF,0xE2B9, 0, 0,0x94CD, 0,0xE2BD,0x95D1, + 0,0x927A, 0,0xE2B8,0xE2BA, 0, 0,0xE2BB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE2BE, 0, 0, +0x8EC2, 0, 0, 0,0x93C4,0xE2C3,0xE2C2, 0, + 0,0xE2BF, 0, 0, 0,0x9855, 0, 0, + 0, 0, 0,0xE2C8, 0, 0,0xE2CC,0xE2C9, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE2C5, 0, 0, 0, 0, 0, 0,0xE2C6, + 0, 0, 0, 0, 0,0xE2CB, 0, 0, + 0,0xE2C0,0x99D3,0xE2C7,0xE2C1, 0, 0,0xE2CA, + 0, 0, 0, 0, 0, 0, 0,0xE2D0, + 0,0x8AC8, 0,0xE2CD, 0, 0, 0,0xE2CE, + 0, 0,0xE2CF,0xE2D2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2D1, +0x94F4, 0, 0, 0, 0,0xE2D3,0x97FA,0x95EB, +0xE2D8, 0, 0,0xE2D5, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2D4,0x90D0, 0,0xE2D7, +0xE2D9, 0, 0, 0,0xE2D6, 0,0xE2DD, 0, +0xE2DA, 0, 0, 0, 0, 0, 0,0xE2DB, +0xE2C4, 0, 0, 0,0xE2DC,0xE2DE, 0, 0, + 0, 0, 0, 0,0xE2DF, 0, 0, 0, + 0, 0, 0,0x95C4, 0,0xE2E0, 0, 0, + 0, 0, 0, 0, 0, 0,0x96E0, 0, + 0,0x8BCC,0x8C48,0xE2E1, 0, 0, 0, 0, + 0,0x95B2, 0,0x9088, 0,0x96AE, 0, 0, +0xE2E2, 0,0x97B1, 0, 0,0x9494, 0,0x9165, +0x9453, 0, 0,0x8F6C, 0, 0, 0,0x88BE, + 0,0xE2E7,0xE2E5, 0,0xE2E3,0x8A9F, 0,0x8FCF, +0xE2E8, 0, 0,0xE2E6, 0,0xE2E4,0xE2EC, 0, + 0,0xE2EB,0xE2EA,0xE2E9, 0, 0, 0, 0, + 0,0xE2ED, 0, 0, 0,0xE2EE,0x90B8, 0, +0xE2EF, 0,0xE2F1, 0, 0,0xE2F0, 0, 0, + 0, 0,0x8CD0, 0, 0, 0,0x9157, 0, + 0, 0,0xE2F3, 0, 0, 0,0x939C, 0, +0xE2F2, 0, 0, 0,0xE2F4, 0,0x95B3,0x918C, +0x8D66, 0,0xE2F5, 0, 0, 0, 0,0x97C6, + 0, 0, 0, 0, 0, 0, 0,0xE2F7, + 0, 0,0xE2F8, 0,0xE2F9, 0,0xE2FA, 0, +0x8E85, 0,0xE2FB,0x8C6E, 0, 0,0x8B8A, 0, +0x8B49, 0,0xE340, 0,0x96F1,0x8D67,0xE2FC, 0, + 0, 0,0xE343,0x96E4, 0,0x945B, 0, 0, +0x9552, 0, 0, 0,0x8F83,0xE342, 0,0x8ED1, +0x8D68,0x8E86,0x8B89,0x95B4,0xE341, 0, 0, 0, +0x9166,0x9661,0x8DF5, 0, 0, 0, 0, 0, + 0, 0, 0,0x8E87,0x92DB, 0,0xE346,0x97DD, +0x8DD7, 0,0xE347,0x9061, 0,0xE349, 0, 0, + 0,0x8FD0,0x8DAE, 0, 0, 0, 0,0xE348, + 0, 0,0x8F49,0x8CBC,0x9167,0xE344,0xE34A, 0, +0xFB8A, 0, 0,0xE345,0x8C6F, 0,0xE34D,0xE351, +0x8C8B, 0, 0, 0, 0, 0,0xE34C, 0, + 0, 0, 0,0xE355,0xFB8B, 0,0x8D69, 0, + 0,0x978D,0x88BA,0xE352, 0, 0,0x8B8B, 0, +0xE34F, 0, 0, 0, 0, 0,0xE350, 0, + 0,0x939D,0xE34E,0xE34B, 0,0x8A47,0x90E2, 0, + 0,0x8CA6, 0, 0, 0,0xE357, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE354, 0, 0, 0, 0, 0,0xE356, + 0, 0, 0,0xE353, 0, 0, 0, 0, + 0,0x8C70,0x91B1,0xE358,0x918E, 0, 0,0xE365, +0xFB8D, 0,0xE361,0xE35B, 0, 0, 0, 0, + 0, 0, 0,0xE35F,0x8EF8,0x88DB,0xE35A,0xE362, +0xE366,0x8D6A,0x96D4, 0,0x92D4,0xE35C, 0,0xFB8C, +0xE364, 0,0xE359,0x925D, 0,0xE35E,0x88BB,0x96C8, + 0, 0, 0, 0, 0, 0, 0,0xE35D, + 0, 0,0x8BD9,0x94EA, 0, 0, 0,0x918D, + 0,0x97CE,0x8F8F, 0, 0,0xE38E,0xFB8E, 0, +0xE367, 0,0x90FC, 0,0xE363,0xE368,0xE36A, 0, +0x92F7,0xE36D, 0, 0,0xE369, 0, 0, 0, +0x95D2,0x8AC9, 0, 0,0x96C9, 0, 0,0x88DC, + 0, 0,0xE36C, 0,0x97FB, 0, 0, 0, + 0, 0, 0,0xE36B, 0, 0, 0, 0, + 0,0x898F, 0, 0,0x93EA,0xE36E, 0, 0, + 0,0xE375,0xE36F,0xE376, 0, 0, 0, 0, + 0, 0,0xE372, 0, 0, 0, 0, 0, + 0, 0, 0,0x949B, 0, 0,0x8EC8,0xE374, + 0,0xE371,0xE377,0xE370, 0, 0,0x8F63, 0, + 0, 0, 0,0x9644, 0, 0,0x8F6B, 0, + 0,0xE373,0xE380, 0, 0,0xE37B, 0,0xE37E, + 0,0xE37C,0xE381,0xE37A, 0,0xE360,0x90D1, 0, + 0,0x94C9, 0,0xE37D, 0, 0,0xE378, 0, + 0, 0,0x9140,0x8C71, 0,0x8F4A, 0, 0, + 0, 0,0xFB8F, 0,0x9044,0x9155,0xE384, 0, + 0,0xE386,0xE387, 0, 0,0xE383,0xE385, 0, + 0, 0, 0, 0, 0, 0,0xE379,0xE382, + 0,0xE38A,0xE389, 0, 0,0x969A, 0, 0, +0x8C4A, 0, 0, 0, 0, 0, 0, 0, + 0,0xE388, 0,0xE38C,0xE38B,0xE38F, 0,0xE391, + 0, 0,0x8E5B,0xE38D, 0, 0, 0, 0, +0xE392,0xE393,0xFA5C, 0,0xE394, 0,0xE39A,0x935A, +0xE396, 0,0xE395,0xE397,0xE398, 0,0xE399, 0, + 0, 0, 0,0xE39B,0xE39C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8ACA, 0, +0xE39D, 0,0xE39E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE39F, 0,0xFB90, + 0, 0, 0, 0,0xE3A0,0xE3A1,0xE3A2, 0, +0xE3A3,0xE3A4, 0, 0,0xE3A6,0xE3A5, 0, 0, +0xE3A7, 0, 0, 0, 0, 0, 0,0xE3A8, +0xE3A9, 0, 0, 0, 0, 0, 0,0xE3AC, +0xE3AA,0xE3AB,0x8DDF,0x8C72, 0, 0,0x9275, 0, +0x94B1, 0,0x8F90, 0, 0,0x946C, 0,0x94EB, +0xE3AD,0x9CEB, 0, 0, 0, 0, 0, 0, + 0, 0,0xE3AE,0xE3B0, 0,0x9785,0xE3AF,0xE3B2, +0xE3B1, 0,0x9772, 0,0xE3B3, 0,0x94FC, 0, + 0, 0, 0, 0,0xE3B4, 0, 0, 0, + 0, 0,0xE3B7, 0, 0,0xE3B6,0xE3B5, 0, + 0,0xFB91, 0,0xE3B8,0x8C51, 0, 0, 0, +0x9141,0x8B60, 0, 0, 0, 0,0xE3BC,0xE3B9, + 0, 0,0xE3BA, 0, 0, 0,0xE3BD, 0, +0xE3BE,0xE3BB, 0, 0, 0,0x8948, 0, 0, + 0,0x89A5, 0, 0, 0,0xE3C0,0xE3C1, 0, + 0, 0,0xE3C2, 0,0x9782, 0, 0, 0, + 0, 0,0x8F4B, 0,0xE3C4,0xE3C3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9089,0xE3C5, 0, 0, 0, 0,0xE3C6, 0, + 0,0xE3C7, 0,0x8AE3, 0, 0, 0, 0, +0x8ACB, 0, 0,0xE3C8, 0, 0, 0, 0, + 0,0xE3C9, 0,0x967C,0x9783, 0, 0, 0, +0x9773,0x9856, 0,0x8D6C,0xE3CC,0x8ED2,0xE3CB, 0, + 0, 0, 0,0xE3CD,0x8EA7, 0, 0, 0, +0x91CF, 0,0xE3CE, 0, 0,0x8D6B, 0,0x96D5, +0xE3CF,0xE3D0, 0, 0,0xE3D1, 0, 0, 0, + 0,0xE3D2, 0, 0, 0, 0, 0, 0, +0xE3D3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8EA8, 0, 0,0x96EB, 0, + 0, 0, 0,0xE3D5, 0,0x925E, 0,0xE3D4, + 0, 0, 0, 0, 0, 0,0xE3D7, 0, + 0, 0,0xE3D6, 0, 0, 0, 0, 0, + 0, 0,0xE3D8, 0, 0, 0,0x90B9, 0, +0xE3D9, 0,0xE3DA, 0, 0, 0,0x95B7,0xE3DB, + 0,0x918F,0xE3DC, 0, 0, 0, 0, 0, +0xE3DD, 0, 0, 0, 0, 0, 0,0x97FC, +0xE3E0, 0,0xE3DF,0xE3DE,0x92AE, 0,0xE3E1,0x9045, + 0,0xE3E2, 0, 0, 0,0xE3E3,0x9857,0xE3E4, + 0, 0, 0, 0,0xE3E5,0xE3E7,0xE3E6,0x94A3, + 0,0x93F7, 0,0x985D,0x94A7, 0, 0, 0, + 0, 0, 0,0xE3E9, 0, 0,0x8FD1, 0, +0x9549, 0,0xE3EA,0xE3E8, 0,0x8ACC, 0, 0, + 0,0x8CD2,0x8E88, 0, 0,0x94EC, 0, 0, + 0,0x8CA8,0x9662, 0,0xE3ED,0xE3EB, 0,0x8D6D, + 0,0x8D6E,0x88E7, 0,0x8DE6, 0, 0, 0, + 0, 0,0x9478, 0, 0, 0, 0, 0, + 0, 0, 0,0x88DD,0xE3F2, 0,0x925F, 0, + 0, 0, 0, 0,0x9477, 0,0x91D9, 0, + 0, 0, 0, 0, 0, 0,0xE3F4, 0, + 0,0xE3F0,0xE3F3,0xE3EE, 0,0xE3F1,0x9645, 0, + 0,0x8CD3, 0, 0,0x88FB,0xE3EF, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE3F6, + 0,0xE3F7, 0, 0,0x93B7, 0, 0, 0, +0x8BB9, 0, 0, 0,0xE445,0x945C, 0, 0, + 0, 0,0x8E89, 0, 0,0x8BBA,0x90C6,0x9865, +0x96AC,0xE3F5,0x90D2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8B72,0xE3F8, 0, 0, 0, 0, + 0, 0, 0,0xE3FA, 0, 0, 0, 0, + 0,0xE3F9, 0, 0, 0, 0, 0,0xE3FB, + 0,0x9245, 0,0x945D, 0, 0, 0, 0, + 0,0x92AF, 0, 0, 0, 0,0xE442, 0, + 0, 0, 0, 0, 0, 0,0xE441, 0, + 0, 0, 0,0xE3FC, 0, 0,0x9074, 0, +0x9585,0xE444, 0,0xE443,0x8D6F,0x9872, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE454, + 0, 0, 0, 0, 0,0xE448,0xE449, 0, + 0, 0, 0,0x8EEE, 0, 0,0xE447, 0, +0x8D98,0xE446, 0, 0,0xE44A, 0, 0, 0, +0x92B0,0x95A0,0x9142, 0, 0, 0, 0,0x91DA, +0xE44E, 0,0xE44F,0xE44B, 0, 0, 0, 0, +0xE44C, 0,0xE44D, 0, 0, 0, 0,0x8D70, + 0, 0, 0,0xE455, 0,0xE451, 0, 0, + 0, 0,0x9586, 0,0x968C,0x9547, 0, 0, +0xE450, 0, 0,0xE453,0xE452, 0, 0, 0, +0x9663,0xE456, 0, 0, 0, 0, 0, 0, +0xE457, 0, 0,0x9156, 0,0xE458, 0, 0, +0xE45A, 0,0xE45E, 0, 0,0xE45B,0xE459,0x945E, +0xE45C, 0,0xE45D, 0, 0, 0,0x89B0, 0, +0xE464,0xE45F, 0, 0, 0,0xE460, 0, 0, + 0,0xE461, 0,0x919F, 0, 0, 0, 0, +0xE463,0xE462,0xE465, 0, 0, 0, 0,0xE466, +0xE467, 0, 0,0x9062, 0,0x89E7, 0,0xE468, +0x97D5, 0,0x8EA9, 0, 0,0x8F4C, 0, 0, + 0, 0, 0,0x8E8A,0x9276, 0, 0, 0, + 0, 0,0xE469,0xE46A,0x8950, 0,0xE46B, 0, + 0,0xE46C,0xE46D, 0, 0,0xE46E, 0,0xE46F, +0x8BBB,0x9DA8,0xE470, 0,0x90E3,0xE471,0x8EC9, 0, +0xE472, 0,0x98AE, 0, 0, 0,0xE473,0x95DC, +0x8ADA, 0, 0,0x9143,0x8F77, 0,0x9591,0x8F4D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE474,0x8D71,0xE475,0x94CA, 0,0xE484, 0, + 0, 0, 0,0xE477, 0,0x91C7,0x9495,0x8CBD, +0xE476,0x9144, 0, 0, 0, 0, 0, 0, +0xE478, 0, 0, 0, 0, 0, 0,0x92F8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE47A,0xE479,0xE47C, 0, 0,0xE47B, 0,0xE47D, + 0, 0,0xE480, 0,0xE47E, 0,0x8ACD, 0, +0xE481, 0,0xE482,0xE483, 0, 0,0x8DAF,0x97C7, + 0,0xE485,0x9046, 0, 0, 0,0x8990,0xE486, +0xE487, 0, 0, 0, 0, 0,0xE488, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x88F0, 0,0xE489, 0, 0, + 0, 0,0xE48A, 0, 0, 0, 0, 0, + 0,0x9587, 0, 0, 0,0x8EC5, 0,0xE48C, + 0, 0, 0, 0, 0,0x8A48,0x88B0, 0, + 0, 0, 0,0xE48B,0xE48E,0x946D, 0,0x9063, + 0,0x89D4, 0,0x9646, 0, 0, 0, 0, +0x8C7C,0x8BDA, 0,0xE48D, 0,0x89E8, 0, 0, + 0, 0, 0, 0, 0,0x8AA1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8991,0xE492,0x97E8,0x91DB, 0, 0,0x9563, + 0,0xE49E, 0,0x89D5,0xE49C, 0,0xE49A,0xE491, + 0,0xE48F, 0,0xE490, 0,0x8EE1,0x8BEA,0x9297, + 0, 0, 0,0x93CF, 0, 0, 0, 0, + 0,0x8970, 0,0xE494,0xE493, 0, 0, 0, + 0,0xE499,0xE495,0xE498, 0, 0, 0, 0, + 0,0xFB93,0x96CE,0xE497,0x89D6,0x8A9D,0xE49B, 0, + 0,0xE49D, 0, 0, 0, 0,0x8C73, 0, + 0, 0, 0, 0, 0, 0,0xE4A1,0xE4AA, +0xE4AB, 0, 0, 0,0x88A9, 0, 0, 0, + 0, 0, 0,0xE4B2, 0, 0, 0, 0, +0x88EF, 0, 0,0xE4A9, 0, 0, 0,0xE4A8, + 0,0xE4A3,0xE4A2, 0,0xE4A0,0xE49F,0x9283, 0, +0x91F9,0xE4A5, 0, 0, 0, 0, 0, 0, +0xE4A4, 0, 0, 0, 0,0xE4A7, 0, 0, + 0,0x9190,0x8C74, 0, 0, 0, 0,0x8960, +0xE4A6, 0,0x8D72, 0, 0, 0, 0, 0, +0x9191, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFB94, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4B8, 0,0xE4B9, 0,0x89D7, + 0, 0, 0,0x89AC,0xE4B6, 0, 0,0xFB95, + 0, 0, 0, 0, 0,0xE4AC, 0,0xE4B4, + 0,0xE4BB,0xE4B5, 0, 0, 0,0xE4B3, 0, + 0, 0, 0,0xE496, 0, 0,0xE4B1, 0, + 0, 0,0xE4AD, 0, 0, 0,0x8ACE,0xE4AF, +0xE4BA, 0,0xE4B0, 0, 0, 0, 0, 0, +0xE4BC, 0,0xE4AE,0x949C, 0, 0, 0, 0, + 0,0x9789, 0, 0, 0,0xE4B7, 0, 0, + 0, 0, 0, 0, 0,0xE4CD, 0, 0, + 0,0xE4C5, 0, 0, 0,0x909B, 0,0xFB96, + 0, 0,0x8B65, 0,0x8BDB, 0,0xE4C0, 0, + 0, 0, 0,0x89D9, 0, 0,0x8FD2, 0, +0xE4C3, 0, 0, 0,0x8DD8, 0, 0,0x9370, +0xE4C8, 0, 0, 0, 0, 0, 0, 0, + 0,0x95EC, 0,0xE4BF, 0, 0, 0,0x89D8, +0x8CD4,0x9548,0xE4C9, 0,0xE4BD, 0,0xFB97,0xE4C6, + 0, 0, 0,0xE4D0, 0,0xE4C1, 0, 0, + 0, 0, 0,0xE4C2,0x93B8, 0, 0,0xE4C7, + 0, 0, 0,0xE4C4,0x9647,0xE4CA,0x88DE, 0, + 0, 0, 0,0xE4BE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE4CC, 0,0xE4CB, 0, 0, 0, 0, 0, + 0,0x948B,0xE4D2, 0,0xE4DD, 0, 0, 0, + 0,0x8A9E, 0, 0, 0,0xE4E0, 0, 0, +0xE4CE, 0, 0, 0,0xE4D3,0x978E, 0, 0, + 0, 0, 0, 0, 0, 0,0xE4DC, 0, +0xFB98,0x9774, 0, 0, 0, 0,0x97A8, 0, + 0, 0, 0, 0, 0, 0, 0,0x9298, + 0, 0, 0,0x8A8B, 0, 0, 0, 0, + 0,0x9592,0xE4E2,0x939F, 0, 0,0x88AF, 0, + 0,0xE4DB, 0,0xE4D7,0x9192,0xE4D1,0xE4D9,0xE4DE, + 0,0x944B, 0, 0, 0,0x88A8, 0,0xE4D6, + 0,0xE4DF,0x9598, 0, 0, 0, 0, 0, + 0, 0,0xE4DA, 0,0xE4D5, 0, 0, 0, + 0, 0, 0,0x8FD3, 0, 0, 0, 0, +0x8F4E, 0, 0, 0,0x8EAA, 0, 0, 0, + 0,0x96D6, 0, 0,0x9566, 0, 0,0xE4E5, + 0,0xE4EE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE4D8, 0, 0, + 0, 0,0x8A97, 0,0xFB99, 0, 0, 0, +0x8FF6,0xE4E3, 0,0xE4E8,0x9193, 0, 0,0xE4E4, + 0,0xE4EB, 0, 0,0x927E, 0,0xE4EC, 0, + 0,0x9775,0xE4E1,0x8A57, 0,0xE4E7, 0, 0, +0xE4EA,0x96AA, 0, 0, 0, 0,0xE4ED, 0, + 0,0xE4E6,0xE4E9, 0,0xFA60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9648, 0,0x9840, 0, + 0, 0, 0, 0,0xE4F1, 0, 0, 0, + 0, 0, 0, 0,0xE4F8, 0, 0,0xE4F0, +0x8EC1, 0, 0, 0, 0, 0,0xE4CF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x95CC, 0,0x96A0,0xE4F7,0xE4F6, 0,0xE4F2, +0xE4F3, 0,0x8955, 0, 0, 0, 0,0xE4F5, + 0,0xE4EF, 0, 0, 0, 0,0x92D3, 0, + 0, 0, 0, 0,0xE4F4,0x88FC, 0, 0, + 0, 0, 0, 0, 0,0x91A0, 0, 0, + 0, 0, 0, 0, 0,0x95C1, 0, 0, +0xE4F9,0xE540, 0,0x94D7, 0, 0, 0, 0, +0xE4FC,0x8FD4,0x8EC7,0xE542, 0, 0,0x8BBC, 0, + 0, 0, 0,0xFB9A, 0,0xE543, 0,0x9599, +0xE4FB,0xFB9B,0xE4D4, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4FA, 0, 0, 0, 0, +0x986E,0x93A0,0x9593,0xFB9C, 0,0xE54A, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE550, + 0, 0, 0, 0, 0, 0,0xE551, 0, +0xE544, 0, 0, 0,0x9496, 0, 0,0xE54E, +0xE546, 0,0xE548, 0, 0, 0, 0, 0, +0xE552,0xE547, 0, 0,0xE54B, 0, 0,0x8992, + 0,0x93E3, 0,0xE54C,0xE54F, 0, 0, 0, + 0, 0, 0, 0,0xE545, 0,0x9145, 0, +0xE549,0x8E46,0x9064,0x8C4F,0x96F2, 0,0x96F7,0x8F92, +0xFB9E, 0, 0, 0, 0, 0, 0, 0, + 0,0xE556,0xE554, 0, 0, 0, 0, 0, + 0,0x986D, 0, 0, 0, 0, 0, 0, + 0,0xE553, 0, 0, 0,0x9795, 0,0xE555, +0xE557, 0, 0, 0, 0,0xE558, 0, 0, + 0, 0, 0, 0,0xE55B,0xE559, 0, 0, + 0, 0, 0, 0,0x93A1,0xE55A, 0, 0, + 0,0x94CB,0xE54D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8F93, + 0,0xE55C,0xE561,0x9194, 0, 0,0xE560, 0, + 0, 0,0xE541, 0, 0, 0,0xE562,0x9168, + 0, 0,0xE55D,0xE55F, 0, 0, 0, 0, + 0, 0, 0,0xE55E, 0, 0,0x9F50,0x9F41, + 0, 0,0xE564, 0, 0, 0, 0, 0, + 0, 0,0xE563, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9796, 0,0xE1BA, +0xE565, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE566, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE567,0x8CD5, 0, +0x8B73, 0, 0, 0,0xE569,0x997C, 0, 0, + 0, 0,0x8B95, 0,0x97B8, 0,0x8BF1,0xE56A, + 0, 0, 0, 0, 0, 0, 0,0xE56B, + 0, 0, 0,0x928E, 0, 0, 0, 0, + 0,0xE56C, 0, 0, 0, 0, 0, 0, + 0,0x93F8, 0,0x88B8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x89E1,0xE571,0xE572, 0, 0, 0, + 0, 0, 0,0xE56D, 0,0x8E5C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE56E,0x9461, 0, 0, 0, + 0,0xE56F,0xE570,0xE57A, 0, 0, 0,0xE574, +0xE577, 0, 0, 0, 0, 0,0xE573, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE575, 0,0xE576,0x8ED6, + 0,0xE578, 0,0x9260, 0,0x8C75,0x8A61, 0, + 0, 0, 0, 0,0xE57B, 0, 0, 0, + 0,0x8A5E, 0,0xE581, 0, 0,0xE57C,0xE580, + 0, 0, 0, 0,0x94B8, 0, 0, 0, + 0,0xE57D, 0, 0,0xE57E,0x9567,0x94D8,0xE582, + 0, 0, 0, 0, 0, 0, 0, 0, +0x91FB,0xE58C, 0,0xE588, 0, 0,0x89E9, 0, +0xE586, 0,0x9649,0xE587, 0, 0,0xE584, 0, +0xE585,0xE58A,0xE58D, 0, 0,0xE58B, 0, 0, + 0,0xE589,0xE583, 0, 0, 0, 0, 0, +0x9277, 0,0xE594, 0,0x96A8, 0, 0, 0, + 0, 0, 0, 0, 0,0xE592, 0, 0, + 0,0xE593, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE58E, 0, 0,0xE590, + 0, 0, 0,0xE591, 0, 0, 0,0xE58F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x90E4, 0,0x9858,0xE598, 0,0xE599, 0, + 0, 0, 0,0xE59F, 0,0x9049, 0,0xE59B, + 0,0xE59E, 0, 0, 0, 0, 0,0xE596, +0xE595, 0, 0,0xE5A0, 0, 0,0x89DA, 0, +0xE59C, 0,0xE5A1, 0, 0, 0,0xE59D, 0, + 0, 0, 0, 0,0xE59A, 0,0x92B1, 0, +0xE597, 0, 0, 0, 0, 0, 0,0x9488, + 0, 0,0xE5A5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x975A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE5A4, + 0, 0,0xE5A3, 0, 0, 0, 0, 0, + 0, 0, 0,0xE5AC, 0, 0, 0,0xE5A6, + 0, 0, 0,0xE5AE, 0, 0, 0, 0, + 0, 0,0x9786,0xE5B1, 0,0xE5A8, 0, 0, +0xE5A9, 0, 0, 0,0xE5AD, 0,0xE5B0,0xE5AF, + 0, 0, 0,0xE5A7, 0, 0, 0, 0, +0xE5AA, 0,0xE5BB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE5B4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE5B2, + 0, 0,0xE5B3, 0, 0, 0,0xE5B8,0xE5B9, + 0,0x8A49, 0,0x8B61, 0, 0,0xE5B7, 0, + 0, 0, 0, 0, 0,0xE5A2, 0,0xFBA1, + 0, 0, 0, 0, 0,0xE5B6,0xE5BA,0xE5B5, + 0,0xE5BC, 0, 0, 0,0xE5BE,0xE5BD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE5C0,0xE5BF,0xE579, 0, 0, 0,0xE5C4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE5C1, 0, 0, 0, 0,0xE5C2, 0, + 0,0xE5C3, 0,0xE5C5, 0, 0, 0, 0, +0x8C8C, 0,0xE5C7, 0,0xE5C6, 0,0x8F4F, 0, + 0, 0, 0, 0,0x8D73,0x9FA5, 0, 0, + 0, 0,0xE5C8,0x8F70, 0, 0, 0,0x8A58, + 0,0xE5C9, 0,0x8971, 0,0x8FD5,0xE5CA, 0, + 0,0x8D74,0xE5CB,0x88DF, 0, 0, 0, 0, +0x955C, 0, 0,0xE5CC, 0, 0, 0, 0, +0x908A, 0,0xE5D3, 0, 0,0xE5D0, 0,0x928F, + 0, 0, 0, 0, 0,0xE5D1,0xE5CE,0x8BDC, + 0,0xE5CD,0xE5D4, 0, 0, 0, 0, 0, +0x8C55, 0, 0,0x91DC, 0,0xE5DA, 0, 0, + 0, 0,0xE5D6, 0, 0, 0,0x91B3,0xE5D5, + 0,0xE5D8, 0, 0, 0, 0,0xE5CF, 0, + 0, 0,0xE5D9, 0,0xE5DB, 0, 0, 0, + 0, 0, 0,0x94ED, 0, 0,0xE5D7, 0, +0xE5DC,0xE5DE, 0, 0,0x8CD1,0xE5D2, 0,0x88BF, + 0, 0, 0, 0, 0, 0, 0,0xE5DD, + 0,0x8DD9,0x97F4,0xE5DF,0xE5E0,0x9195, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x97A0, + 0, 0, 0, 0,0xE5E1,0x9754, 0, 0, +0xE5E2,0xE5E3, 0, 0,0x95E2,0xE5E4, 0,0x8DBE, + 0,0x97A1, 0, 0, 0, 0, 0, 0, +0xE5E9, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE5EA,0x8FD6,0xE5E8,0xFBA2, 0, 0, +0x9787,0xE5E5, 0, 0,0xE5E7,0x90BB,0x909E, 0, + 0, 0,0xE5E6, 0,0xE5EB, 0, 0,0x95A1, + 0, 0,0xE5ED, 0,0xE5EC, 0, 0, 0, +0x8A8C, 0,0x964A,0xE5EE, 0, 0, 0, 0, + 0, 0, 0, 0,0xFA5D,0xE5FA,0xE5F0, 0, + 0, 0, 0, 0, 0,0xE5F1, 0, 0, + 0, 0,0xE5F2,0xE5F3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE5F7, 0, +0xE5F8, 0, 0,0xE5F6, 0, 0, 0, 0, + 0,0xE5F4, 0,0xE5EF,0xE5F5, 0, 0, 0, + 0, 0, 0, 0,0xE5F9,0xE8B5, 0, 0, + 0, 0, 0, 0, 0, 0,0x89A6, 0, + 0, 0, 0, 0, 0, 0,0xE5FC,0x8BDD, +0xE5FB, 0, 0, 0,0xE641, 0,0xE640, 0, + 0, 0,0xE643, 0, 0,0xE642, 0,0xE644, + 0, 0,0x8F50, 0,0xE645, 0, 0,0xE646, + 0, 0, 0, 0, 0, 0,0xE647,0x90BC, + 0,0x9776, 0,0xE648, 0, 0,0x95A2,0x9465, +0xE649, 0,0xE64A,0x8CA9, 0, 0, 0,0x8B4B, + 0, 0, 0,0xE64B, 0, 0,0x8E8B,0x9460, +0xE64C, 0,0x8A6F, 0, 0, 0, 0, 0, + 0,0xE64D, 0, 0, 0, 0,0xE64F,0x9797, + 0,0xE64E,0x9065, 0,0xE650, 0, 0,0xE651, + 0, 0,0xE652,0x8ACF, 0, 0, 0, 0, + 0, 0,0xE653, 0, 0,0xE654, 0,0xE655, +0xE656, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8A70, 0, 0, 0, 0, 0, + 0, 0,0xE657, 0,0xE658,0xE659, 0, 0, + 0, 0, 0,0x89F0, 0, 0,0x9047,0xE65A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE65B, 0, 0, 0, +0xE65C, 0, 0, 0, 0, 0, 0, 0, +0x8CBE, 0,0x92F9,0xE65D, 0, 0, 0, 0, +0x8C76, 0,0x9075, 0,0xE660, 0,0x93A2, 0, +0xE65F, 0,0xFBA3,0x8C50, 0, 0,0xE65E,0x91F5, +0x8B4C, 0, 0,0xE661, 0,0xE662, 0,0x8FD7, + 0, 0, 0,0x8C8D, 0,0xE663, 0, 0, + 0, 0,0x964B, 0, 0,0x90DD, 0, 0, + 0,0x8B96, 0,0x96F3,0x9169, 0,0xE664,0xFBA4, + 0, 0,0x9066,0x9290,0x8FD8, 0, 0, 0, + 0,0xE665, 0, 0, 0, 0,0xE668, 0, +0xE669, 0, 0, 0, 0, 0, 0, 0, +0x8DBC,0x91C0,0xE667, 0,0x8FD9,0x955D, 0, 0, + 0, 0, 0,0xE666, 0, 0,0x8E8C, 0, +0x8972, 0,0xE66D,0x8C77, 0, 0,0x8E8E, 0, + 0,0x8E8D, 0,0x986C,0xE66C,0xE66B,0x9146, 0, +0x8B6C,0x9862,0x8A59,0x8FDA, 0, 0, 0, 0, + 0,0xFBA5, 0, 0,0xE66A, 0, 0, 0, + 0, 0,0xE66F, 0,0xE670,0xE66E, 0,0x8CD6, + 0,0x975F, 0, 0,0x8E8F,0x9446, 0, 0, + 0,0xE673, 0,0x90BE, 0,0x9261, 0, 0, +0x9755, 0,0xE676, 0, 0, 0,0x8CEA, 0, +0x90BD,0xE672, 0,0xE677,0x8CEB,0xE674,0xE675,0xFBA6, +0xE671, 0, 0, 0,0x90E0,0x93C7, 0, 0, +0x924E, 0,0x89DB, 0, 0, 0, 0, 0, + 0,0x94EE, 0, 0,0x8B62, 0,0xFBA7,0x92B2, + 0, 0,0xE67A, 0,0xE678, 0, 0,0x926B, + 0, 0, 0,0x90BF,0x8AD0,0xE679, 0,0x907A, + 0, 0,0x97C8, 0, 0, 0,0x985F, 0, + 0, 0,0xE67B,0xE687,0x92B3, 0,0xE686,0xFBA8, +0xE683,0xE68B,0xE684, 0,0xE680, 0,0x92FA,0xE67E, + 0, 0, 0,0xE67C, 0,0x9740,0x8E90, 0, + 0,0xE681, 0,0xE67D, 0, 0,0xFBAA,0xE685, +0x8F94, 0,0x8CBF, 0, 0, 0,0x91F8, 0, +0x9664,0x8979,0x88E0, 0,0x93A3, 0, 0,0xE689, + 0, 0, 0, 0,0xE688, 0,0x93E4, 0, +0xE68D, 0, 0, 0,0xE682, 0,0xE68C,0xE68E, + 0,0x8CAA,0xE68A,0x8D75, 0,0x8ED3, 0, 0, +0xE68F,0x9777, 0, 0, 0, 0,0xE692, 0, +0xE695, 0, 0,0xE693,0x9554, 0, 0, 0, + 0, 0, 0,0xE690, 0, 0, 0, 0, + 0,0x8BDE, 0, 0, 0, 0,0xE694, 0, + 0,0xE696, 0, 0, 0, 0, 0, 0, + 0,0xE69A, 0, 0,0xE697, 0,0xE699,0xE698, + 0, 0, 0,0xFBAB, 0, 0,0xE69B, 0, +0x8EAF, 0,0xE69D,0xE69C,0x9588, 0, 0,0xE69F, + 0, 0, 0, 0, 0, 0,0x8C78, 0, + 0, 0, 0,0xE69E,0xE6A0, 0, 0,0xE6A1, +0x8B63,0xE3BF,0x8FF7, 0,0xE6A2, 0, 0,0x8CEC, + 0, 0, 0, 0, 0,0xE6A3, 0,0xFBAC, +0xE6A4, 0, 0,0x8E5D, 0, 0, 0, 0, + 0, 0,0x9DCC, 0,0xE6A5, 0,0xE6A6, 0, +0x8F51, 0,0xE6A7,0xE6A8, 0, 0,0xE6A9, 0, + 0,0xE6AA,0xE6AB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x924A, + 0, 0,0xE6AC, 0, 0, 0, 0,0xE6AE, + 0,0xE6AD, 0, 0, 0, 0,0x93A4, 0, +0xE6AF, 0,0x964C, 0,0xE6B0, 0,0xE6B1, 0, +0xE6B2, 0, 0, 0, 0,0xE6B3, 0, 0, + 0, 0,0x93D8, 0, 0, 0, 0, 0, + 0,0x8FDB,0xE6B4, 0, 0, 0, 0, 0, + 0, 0,0x8D8B,0x98AC,0xE6B5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE6B6,0x955E,0xE6B7, 0,0xE6BF, 0, 0, 0, + 0, 0,0xE6B8, 0, 0,0xE6BA, 0, 0, + 0,0xE6B9,0xE6BB, 0,0x9665,0xE6BC,0xE6BD, 0, + 0, 0, 0, 0,0xE6BE, 0, 0, 0, +0xE6C0, 0, 0, 0, 0,0x8A4C,0x92E5, 0, +0x9589,0x8DE0,0x8D76, 0, 0, 0, 0,0x956E, +0x89DD,0x94CC,0xE6C3,0x8AD1,0x90D3,0xE6C2,0xE6C7,0x9299, +0x96E1, 0,0xE6C5,0xE6C6,0x8B4D, 0,0xE6C8,0x9483, +0x91DD, 0, 0,0x94EF,0x935C,0xE6C4, 0,0x9666, +0x89EA,0xE6CA,0x9847,0x92C0,0x9864, 0, 0,0x8E91, +0xE6C9, 0,0x91AF, 0, 0,0xE6DA,0x9147, 0, + 0,0x93F6, 0,0x956F, 0, 0, 0, 0, + 0, 0,0xE6CD,0x8E5E,0x8E92, 0,0x8FDC, 0, +0x9485, 0,0x8CAB,0xE6CC,0xE6CB, 0,0x958A, 0, + 0, 0,0x8EBF, 0, 0,0x9371, 0, 0, +0xFBAD, 0, 0, 0,0xFBAE, 0, 0, 0, + 0, 0,0xE6CF,0xE6D0,0x8D77,0xE6CE, 0, 0, + 0, 0, 0, 0,0xE6D1,0xE6D2, 0,0xE6D4, +0x91A1, 0,0xE6D3,0x8AE4, 0,0xE6D6, 0,0xE6D5, +0xE6D7, 0,0xFBAF,0xE6D9,0xE6DB, 0,0xE6DC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x90D4, 0,0x8ECD,0xE6DD, + 0, 0, 0,0x8A71, 0,0xE6DE, 0, 0, +0x9196,0xE6DF, 0,0xE6E0,0x958B, 0,0xFBB0,0x8B4E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE6E1, 0, 0, 0,0x92B4, 0, 0, + 0, 0,0x897A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE6E2, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8EEF, 0, 0, 0, 0, +0x9096, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x91AB, 0, 0, 0, 0, + 0, 0,0xE6E5, 0, 0, 0,0xE6E4, 0, + 0, 0,0xE6E3, 0, 0, 0, 0, 0, + 0, 0, 0,0xE6EB,0xE6E9, 0, 0,0xE6E6, + 0, 0, 0, 0, 0, 0,0xE6E8, 0, + 0, 0,0xE6E7,0xE6EA, 0,0x8B97, 0,0xE6EE, + 0,0x90D5, 0,0xE6EF, 0, 0, 0, 0, +0x8CD7, 0,0xE6EC,0xE6ED, 0, 0, 0,0x9848, + 0, 0, 0,0x92B5, 0,0x9148, 0, 0, + 0, 0, 0, 0,0xE6F0, 0, 0,0xE6F3, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE6F1,0xE6F2,0x9778, 0, 0, 0, 0,0x93A5, +0xE6F6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE6F4,0xE6F5,0xE6F7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE748, 0, 0, 0, 0, 0, +0xE6FA, 0, 0, 0,0xE6FB,0xE6F9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE6F8, 0,0x92FB, 0, 0,0xE740, +0xE744,0xE741,0xE6FC, 0,0xE742, 0, 0, 0, +0xE743, 0, 0, 0, 0,0xE74A, 0, 0, + 0,0xE745, 0, 0, 0, 0, 0,0x90D6, +0xE747, 0, 0,0xE749,0xE746, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE74C, 0,0x8F52, 0,0xE74B, 0, + 0, 0, 0, 0,0xE74D, 0, 0, 0, + 0,0xE74E, 0, 0,0xE751,0xE750, 0,0xE74F, + 0, 0,0xE753,0xE752, 0,0x96F4, 0, 0, + 0,0xE755, 0,0xE754,0xE756, 0, 0, 0, + 0,0xE757, 0, 0, 0, 0, 0, 0, + 0,0xE759, 0, 0, 0, 0, 0, 0, + 0, 0,0xE758,0x9067,0xE75A, 0, 0,0x8BEB, +0xE75B,0xE75D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE75E, 0, + 0, 0, 0, 0, 0,0xE75F,0xE75C, 0, +0xE760, 0,0x8ED4,0xE761,0x8B4F,0x8C52, 0,0xFBB2, + 0, 0,0x8CAC, 0, 0, 0, 0, 0, + 0, 0, 0,0xE762, 0, 0, 0,0x93EE, + 0, 0,0x935D,0xE763, 0, 0, 0, 0, + 0, 0, 0,0xE766, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8EB2, 0, 0,0xE765,0xE764,0x8C79,0xE767, 0, + 0, 0, 0,0x8A72, 0,0xE769, 0, 0, + 0,0x8DDA,0xE768, 0,0xE771, 0, 0, 0, + 0, 0,0xE76B,0xE76D,0x95E3,0xE76A, 0, 0, + 0,0xE76C, 0,0xE770,0xE76E,0x8B50, 0,0xE76F, + 0, 0, 0, 0, 0, 0,0xE772, 0, + 0,0x9479,0x97D6, 0, 0, 0, 0,0x8F53, + 0, 0, 0,0xE773, 0, 0, 0, 0, +0x9741,0xE775, 0,0xE774, 0, 0,0xE778,0x9760, + 0, 0,0xE777, 0,0x8A8D,0xE776,0xE77B, 0, + 0,0xE77A, 0, 0,0xE779,0x9351,0xE77C, 0, + 0, 0, 0, 0, 0, 0, 0,0xE77D, + 0, 0, 0, 0,0xE77E, 0, 0,0x8D8C, + 0,0x8C44,0xE780,0xE781,0xE782, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9068,0xE783, 0,0x8EAB,0xE784, + 0, 0, 0,0xE785, 0, 0, 0,0x999F, +0x999E, 0, 0, 0, 0,0xE786,0xE390,0xE787, +0x9243,0x904A,0x945F, 0, 0, 0, 0,0xE788, + 0, 0,0x95D3,0x92D2,0x8D9E, 0, 0,0x9248, + 0, 0,0x8949, 0,0x9698,0x9076, 0, 0, + 0, 0, 0, 0, 0, 0,0x8C7D, 0, + 0,0x8BDF, 0, 0,0x95D4, 0, 0, 0, + 0, 0,0xE789, 0, 0, 0, 0, 0, + 0, 0,0xE78B, 0, 0,0xE78A,0x89DE, 0, + 0,0x93F4,0xE78C,0x9497, 0,0x9352, 0,0xE78D, +0x8F71, 0, 0, 0,0xE78F, 0, 0,0x96C0, +0xE79E,0xE791,0xE792, 0, 0,0x92C7, 0, 0, +0x91DE,0x9197, 0,0x93A6, 0,0xE790,0x8B74, 0, + 0, 0, 0,0xE799, 0,0xE796,0xE7A3,0x93A7, +0x9280,0xE793, 0,0x92FC,0x9372,0xE794,0xE798,0x9080, + 0,0x9487,0x92CA, 0, 0,0x90C0,0xE797,0x91AC, +0x91A2,0xE795,0x88A7,0x9841, 0, 0, 0,0xE79A, + 0, 0, 0, 0, 0, 0,0x91DF, 0, + 0,0x8F54,0x9069, 0, 0,0xE79C,0xE79B, 0, +0x88ED,0xE79D, 0, 0,0x954E, 0,0xE7A5, 0, + 0,0x93D9,0x908B, 0, 0,0x9278, 0,0x8BF6, + 0,0xE7A4,0x9756,0x895E, 0,0x95D5,0x89DF,0xE79F, +0xE7A0,0xE7A1,0xE7A2,0x93B9,0x9242,0x88E1,0xE7A6, 0, +0xE7A7,0xEAA1, 0, 0,0x91BB, 0,0xE7A8, 0, +0x8993,0x916B, 0,0x8CAD, 0,0x9779, 0,0xFBB5, +0xE7A9,0x934B, 0, 0, 0,0x9198,0x8ED5,0xE7AA, + 0, 0,0xE7AD, 0, 0,0x8F85,0xE7AB,0x914A, +0x9149, 0,0x88E2, 0,0x97C9,0xE7AF, 0,0x94F0, +0xE7B1,0xE7B0,0xE7AE,0xE284,0x8AD2, 0, 0,0xE78E, + 0,0xE7B3,0xE7B2, 0, 0, 0, 0,0xE7B4, + 0,0x9757, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x93DF, 0, 0,0x964D, 0, +0xE7B5, 0,0x8ED7, 0, 0, 0, 0,0xE7B6, + 0,0xE7B7, 0, 0, 0,0xE7B8, 0, 0, +0x9340, 0, 0, 0, 0, 0, 0, 0, + 0,0x88E8, 0, 0, 0, 0, 0, 0, + 0, 0,0x8D78, 0, 0, 0,0x9859, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE7BC, 0, 0,0xFBB6, 0, + 0,0x8C53,0xE7B9, 0,0xE7BA, 0, 0, 0, +0x9594, 0, 0, 0, 0,0x8A73, 0, 0, + 0, 0, 0, 0, 0,0x9758, 0,0x8BBD, + 0, 0, 0, 0, 0,0x9373, 0, 0, + 0, 0,0xE7BD, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE7BE, 0, 0,0xFBB8, 0, 0, + 0,0xE7BF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFBB9, + 0, 0, 0, 0, 0,0x9341, 0, 0, +0xE7C1, 0,0xE7C0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x93D1,0xE7C2,0x8F55,0x8EDE,0x947A,0x9291, 0, + 0, 0,0x8EF0, 0,0x908C, 0,0xE7C3, 0, +0xE7C4, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x907C,0xE7C5, 0,0xE7C6, 0, 0, + 0,0xE7C7,0x978F, 0,0x8F56, 0, 0, 0, + 0, 0,0xE7C9,0xE7C8, 0,0x8D79, 0,0x8D93, +0x8E5F, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE7CC, 0, 0, 0, 0,0x8F86, + 0,0xE7CB, 0,0xE7CA, 0,0x91E7, 0, 0, +0x8CED, 0,0x90C1, 0, 0, 0, 0,0x94AE, + 0, 0, 0, 0,0x8F58, 0, 0, 0, + 0, 0,0xE7CD, 0,0x8FDD, 0, 0, 0, + 0, 0,0xE7D0,0xE7CE, 0, 0, 0,0xE7CF, + 0, 0, 0, 0,0xE7D2,0xE7D1, 0, 0, +0x8FF8, 0,0xE7D3, 0, 0, 0, 0, 0, +0xE7D4,0xE7D5, 0, 0, 0, 0,0x94CE,0x8DD1, +0x8EDF,0xE7D6, 0,0xE7D7,0x97A2,0x8F64,0x96EC,0x97CA, +0xE7D8,0x8BE0, 0, 0, 0, 0,0xE7D9,0xFBBB, +0x9342, 0,0xFBBA,0xE7DC,0x8A98,0x906A,0xFBBC,0xE7DA, + 0,0xE7DB, 0,0x92DE,0xFBBF,0xFBC0,0x9674,0x8BFA, + 0, 0, 0, 0, 0,0xFBBD,0xFBBE, 0, + 0, 0, 0, 0, 0,0xE7DE,0xE7DF, 0, + 0, 0, 0, 0,0xE7DD, 0, 0,0xE7E1, + 0, 0, 0, 0, 0, 0,0xFBC1, 0, + 0, 0,0xFBC3, 0, 0,0x93DD,0x8A62, 0, +0xFBC2,0xE7E5, 0, 0,0xE7E2,0xE7E4, 0, 0, + 0, 0, 0, 0, 0, 0,0xE7E0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE86E, 0, 0,0xE7E3, 0, 0, 0, + 0, 0, 0, 0,0x97E9, 0, 0,0x8CD8, + 0,0xFBCA,0xFBC4, 0,0xFBC6, 0, 0,0xE7ED, +0xFBC5, 0, 0, 0,0x9353,0xE7E8, 0, 0, +0xE7EB,0xE7E9, 0,0xE7EE, 0, 0,0xFBC7, 0, +0xE7EF,0xFBC9, 0, 0, 0, 0, 0,0xE7E7, + 0,0xFBC8,0xE7F4,0x8994, 0, 0,0xE7E6, 0, + 0, 0,0x94AB, 0,0xE7EA, 0,0x8FDE,0xFBCB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8D7A, 0, 0, 0, 0, 0,0xFBCD, +0xFBCE, 0, 0, 0, 0, 0,0x9667, 0, +0x8BE2, 0, 0,0x8F65, 0,0x93BA, 0, 0, +0xFA5F, 0, 0, 0, 0, 0, 0, 0, + 0,0x914C, 0,0xE7F2, 0,0xE7EC,0xE7F1, 0, +0x96C1, 0,0x92B6,0xE7F3,0xE7F0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFBCC, + 0, 0, 0, 0, 0,0x914B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7F7, + 0,0xE7F6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7F5, +0xFBD2, 0,0x964E,0xFBD6, 0,0xFBD4, 0,0xFBD0, + 0,0xFBD1, 0, 0, 0, 0, 0, 0, +0xFBD5, 0, 0, 0,0x8F9B, 0, 0,0xFBCF, + 0,0xE7F8,0x95DD, 0, 0,0x8973, 0, 0, + 0, 0,0x9565,0x9292, 0, 0, 0, 0, +0x8B98,0xFA65,0xE7FA,0xFBD9,0x8D7C, 0, 0,0xFBDC, + 0, 0,0xFBDE, 0, 0, 0,0x8E4B, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7F9, +0x908D, 0, 0, 0, 0, 0, 0, 0, +0x908E,0xE840,0xE842, 0, 0,0xFBDD,0xFBDB, 0, +0x8FF9,0xFBD8,0xE841,0xE843, 0,0xFBD7,0x8BD1, 0, +0x9564, 0, 0,0x8EE0,0x9842, 0,0xE7FC,0x8DF6, + 0, 0,0x985E, 0, 0,0xE845, 0, 0, + 0, 0,0xE844,0xE846, 0, 0, 0, 0, + 0, 0, 0, 0,0xE7FB, 0, 0, 0, +0xFA5E, 0, 0,0x93E7, 0,0x9374, 0, 0, + 0, 0, 0, 0,0x92D5, 0,0xE84B,0xFBE0, + 0, 0, 0,0x9262,0xE847, 0, 0, 0, +0xE848, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8C4C, 0,0xE84A, 0, +0xFBDF, 0, 0, 0, 0,0x8CAE, 0, 0, + 0, 0, 0, 0,0xE849, 0,0x8FDF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8A99, 0, 0, 0, + 0, 0, 0, 0,0xE84F, 0,0x8DBD,0x9199, + 0, 0,0x92C8, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFBE1, 0, 0,0x8A5A, + 0, 0, 0, 0,0xE84D,0xE84E,0x92C1, 0, +0xE84C, 0, 0, 0, 0, 0, 0, 0, + 0,0xE850, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE856, 0, 0,0xFBE2, 0, +0xE859, 0, 0, 0, 0, 0, 0, 0, +0xE858,0x934C, 0, 0, 0, 0,0xE851,0xE852, +0xE855, 0, 0, 0, 0,0xE857,0xFBE3, 0, + 0,0x8BBE, 0, 0,0xE85A,0xE854, 0, 0, +0xE853, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFBE4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE85E, 0, 0, 0,0xE85F, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE860, 0, 0,0xE85D,0xE85C, 0, 0, 0, +0x8FE0,0x93A8,0xE85B, 0, 0, 0, 0, 0, + 0,0xE864, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE862, 0, 0, 0, 0, + 0,0xFBE5, 0, 0, 0,0xE863,0xE861, 0, +0x91F6, 0,0xE865, 0, 0, 0, 0, 0, + 0,0xE866, 0, 0,0xE868,0xFBE6, 0, 0, +0xFBE7, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AD3,0xE867,0x96F8, 0, 0, 0, 0, + 0, 0,0xE873,0xE869, 0, 0,0xE86C, 0, +0xE86A, 0,0xE86B, 0, 0, 0, 0, 0, + 0, 0,0xE86D, 0, 0, 0, 0, 0, +0xE86F, 0, 0, 0, 0,0xE870, 0,0xE871, + 0, 0, 0, 0,0xE874,0xE872,0xE875,0xE877, + 0,0xE876}; + +/* page 7 0x9577-0x9FA0 */ +static uint16 tab_uni_cp9327[]={ +0x92B7, 0, 0, 0, 0, 0, 0, 0, + 0,0x96E5, 0,0xE878,0x914D, 0, 0, 0, +0xE879, 0,0x95C2,0xE87A,0x8A4A, 0, 0, 0, +0x895B, 0,0x8AD5,0xFBE8,0x8AD4,0xE87B, 0,0xE87C, + 0,0xE87D,0xE87E, 0, 0, 0, 0, 0, + 0,0xE880, 0,0x8AD6,0x8A74,0x8D7D,0x94B4, 0, +0xE882,0xE881, 0, 0, 0, 0,0xE883, 0, + 0, 0, 0,0x897B, 0, 0, 0, 0, + 0, 0,0xE886, 0,0xE885,0xE884, 0,0xE887, + 0, 0, 0, 0,0xE88A, 0, 0, 0, +0x88C5, 0, 0,0xE888, 0,0xE88C,0xE88B, 0, + 0, 0, 0, 0, 0,0xE88E,0xE88D,0xE88F, + 0,0x93AC, 0, 0, 0,0xE890, 0, 0, + 0, 0,0xE891,0xE893, 0, 0,0xE892, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x958C, 0, 0, + 0, 0,0xE894, 0, 0, 0, 0, 0, + 0,0xE895, 0,0x8DE3, 0, 0, 0,0xE896, +0xE897, 0, 0,0x9668, 0, 0, 0, 0, + 0, 0, 0, 0,0x916A, 0, 0, 0, +0x88A2,0x91C9, 0,0xE898, 0,0x958D, 0, 0, + 0, 0, 0, 0,0xE89B,0xE899,0x8D7E, 0, +0xE89A,0x8CC0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x95C3,0xE89D,0xE89F,0xE89E, +0xE8A0, 0, 0,0x8940,0x9077,0x8F9C,0x8AD7,0xE8A1, + 0, 0, 0,0x9486, 0,0xE8A3, 0, 0, + 0,0x8941, 0,0xE8A2,0x92C2, 0,0x97CB,0x93A9, +0xE89C,0x97A4, 0,0x8CAF, 0, 0,0x977A, 0, + 0, 0, 0, 0, 0, 0,0x8BF7,0x97B2, + 0,0x8C47, 0,0x91E0,0xE440, 0,0xE8A4,0x8A4B, +0x908F, 0, 0, 0, 0,0x8A75,0xE8A6, 0, +0xE8A7,0xE8A5,0x8C84, 0,0x8DDB,0x8FE1,0xFBEB, 0, + 0,0x8942, 0, 0,0x97D7, 0, 0, 0, +0xE8A9,0xE7AC, 0,0xE8A8, 0, 0, 0, 0, +0xFBEC,0xE8AC,0xE8AA,0xE8AB, 0,0xE8AD, 0,0xE8AE, +0x97EA,0xE8AF,0xE8B0, 0,0x90C7,0x94B9, 0, 0, + 0,0x909D,0x8AE5, 0, 0,0x9759,0x89EB,0x8F57, +0x8CD9, 0,0xE8B3, 0,0xE8B2,0x8E93,0xE8B4,0xE8B1, + 0, 0,0x8E47, 0, 0, 0,0xE8B8,0xE5AB, + 0, 0,0x99D4, 0,0x9097,0xE8B6, 0, 0, + 0, 0, 0,0x97A3,0x93EF, 0, 0, 0, + 0,0x894A, 0,0x90E1,0x8EB4, 0, 0, 0, + 0,0x95B5, 0,0x895F, 0, 0, 0,0x97EB, +0x978B, 0,0xE8B9, 0,0x9364, 0, 0, 0, + 0,0x8EF9, 0, 0, 0,0xE8BA, 0,0xE8BB, +0x906B,0xE8BC, 0,0x97EC, 0, 0,0xE8B7,0xE8BE, +0xE8C0, 0,0xE8BF, 0,0xE8BD, 0, 0,0xE8C1, + 0, 0,0xE8C2, 0, 0,0x919A, 0,0x89E0, + 0, 0, 0, 0, 0,0xE8C3, 0, 0, +0x96B6, 0, 0,0xE8C4, 0, 0, 0, 0, + 0,0xE8C5, 0,0x9849,0xFBED, 0, 0, 0, + 0,0x9E50,0xE8C6, 0,0xFBEE, 0,0xE8C7,0xE8C8, + 0, 0, 0,0xE8CC,0xFBEF,0xE8C9, 0,0xE8CA, + 0,0xE8CB,0xE8CD, 0, 0, 0,0xFBF0, 0, +0xFBF1, 0,0xFBF2,0x90C2, 0, 0,0xFBF3,0x96F5, + 0, 0,0x90C3, 0, 0,0xE8CE, 0,0x94F1, + 0,0xE8CF,0xEA72,0x96CA, 0,0xE8D0, 0,0xE8D1, + 0,0xE8D2,0x8A76, 0,0xE8D4, 0,0x9078, 0, + 0, 0,0xE8D5, 0, 0,0x8C43, 0, 0, + 0, 0,0xE8D6,0xE8DA, 0,0xE8D8, 0, 0, + 0, 0,0xE8D9, 0, 0,0x8A93,0xE8D7,0xE8DB, + 0, 0, 0, 0,0xE8DC, 0,0x88C6, 0, +0xE8DD,0xE8DE, 0, 0, 0, 0, 0, 0, + 0,0x8FE2, 0, 0, 0,0xE8DF, 0, 0, + 0,0x8B66, 0, 0,0xE8E2, 0, 0,0xE8E1, + 0,0xE8E0, 0, 0,0xE691, 0,0x95DA, 0, + 0, 0, 0, 0,0xE8E3,0xE8E4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE8E5, 0, 0,0xE8E6, + 0,0xE8E7, 0, 0,0xE8E8, 0, 0, 0, + 0, 0, 0, 0,0x8AD8, 0, 0, 0, + 0, 0, 0, 0, 0,0xE8E9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE8EA,0x9442, + 0, 0, 0,0xE8EC,0x89B9, 0,0xE8EF,0xE8EE, + 0, 0, 0, 0,0x8943, 0, 0, 0, +0x8BBF, 0,0x95C5,0x92B8,0x8DA0, 0,0x8D80,0x8F87, + 0,0x907B, 0, 0, 0,0xE8F1, 0, 0, +0xE8F0,0x9761,0x8AE6,0x94D0,0x93DA, 0, 0, 0, +0x909C,0x97CC, 0,0x8C7A, 0, 0, 0, 0, + 0, 0,0xE8F4, 0, 0,0xE8F3, 0, 0, + 0, 0, 0, 0, 0,0x966A,0x93AA, 0, + 0, 0, 0, 0, 0,0x896F, 0, 0, +0xE8F5,0xE8F2, 0, 0,0x9570,0x978A,0xE8F6, 0, + 0, 0, 0, 0, 0, 0, 0,0xE8F7, + 0, 0, 0, 0,0xE8F9,0x91E8,0x8A7A,0x8A7B, +0xE8F8, 0, 0, 0, 0,0x8AE7,0x8CB0, 0, +0xFBF4,0x8AE8, 0, 0,0x935E, 0, 0,0x97DE, + 0, 0, 0, 0, 0, 0,0xFBF5, 0, +0x8CDA, 0, 0, 0,0xE8FA, 0, 0, 0, +0xE8FB,0xE8FC,0xE940, 0,0xE942,0xE941, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9597, 0,0xE943, 0, 0, 0, 0, +0xE944, 0,0xE945, 0, 0, 0, 0,0xE946, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE948,0xE947, 0,0xE949, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x94F2,0xE3CA, 0, 0, +0x9048, 0, 0,0x8B51, 0, 0, 0, 0, + 0, 0,0xE94A, 0,0xE94B, 0,0x99AA,0x9F5A, +0x94D1, 0, 0,0x88F9, 0,0x88B9, 0, 0, + 0, 0, 0, 0, 0,0x8E94,0x964F,0x8FFC, + 0, 0, 0, 0,0xE94C, 0,0x96DD, 0, + 0, 0,0xE94D,0x977B, 0,0x8961, 0, 0, + 0,0x8E60, 0,0xE94E,0x89EC,0xE94F, 0, 0, + 0,0xE950, 0, 0, 0, 0,0xE952,0xE953, + 0,0xE955,0xE951, 0, 0,0xE954, 0, 0, +0xFBF8,0x8AD9, 0, 0, 0,0xE956, 0,0xE957, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE958,0xE959, + 0, 0, 0,0xE95A, 0, 0,0xE95C, 0, + 0, 0,0xE95B, 0,0xE95E,0xE961, 0, 0, + 0,0xE95D,0xE95F,0xE960, 0, 0,0xE962, 0, +0x8BC0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8EF1, +0xE963,0xE964,0x8D81, 0, 0, 0, 0,0xFBFA, + 0, 0, 0, 0, 0, 0,0xE965, 0, + 0,0x8A5D, 0, 0, 0,0x946E,0xE966,0xE967, + 0, 0, 0, 0,0x9279,0x93E9, 0, 0, + 0, 0, 0, 0, 0,0xE968, 0, 0, + 0, 0,0x949D, 0, 0,0x91CA,0x8977,0x8BEC, + 0,0x8BED, 0, 0, 0, 0, 0, 0, + 0,0x9293,0xE96D,0x8BEE, 0, 0,0x89ED, 0, + 0,0xE96C, 0, 0,0xE96A, 0,0xE96B, 0, +0xE969, 0, 0,0xE977, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE96E,0xE96F, + 0, 0,0xE970,0xE971, 0, 0, 0, 0, + 0,0xE973, 0, 0,0xE972, 0, 0, 0, +0x8F78, 0,0xE974, 0, 0, 0,0xE976, 0, + 0, 0, 0, 0, 0, 0, 0,0x8B52, +0xE975, 0, 0,0x919B,0x8CB1, 0, 0, 0, + 0, 0,0xE978, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x91CB, 0, 0,0xE979, 0, 0, 0, + 0,0x93AB, 0, 0, 0, 0, 0, 0, +0xE97A, 0, 0, 0, 0, 0, 0,0xE980, + 0,0xE97D, 0,0xE97C,0xE97E, 0,0xE97B, 0, + 0, 0, 0, 0, 0, 0,0xE982,0xFBFB, + 0, 0, 0, 0, 0, 0,0xE981, 0, +0xE984, 0, 0,0x8BC1,0xE983, 0, 0, 0, +0xE985, 0, 0,0xE986, 0,0xE988,0xE987, 0, + 0, 0,0xE989,0xE98B,0xE98A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8D9C, 0, 0, 0, 0,0xE98C, 0, + 0,0xE98D, 0, 0, 0, 0, 0, 0, + 0,0x8A5B, 0, 0, 0,0xE98E, 0, 0, + 0,0xE98F, 0, 0, 0,0x9091, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE990, 0,0xE991, 0,0xE992,0xE993, 0, 0, + 0,0x8D82,0xFBFC, 0, 0,0xFC40, 0,0xE994, +0xE995, 0, 0,0xE996,0xE997, 0, 0,0xE998, + 0, 0, 0,0x94AF,0xE99A, 0,0x9545,0xE99B, +0xE999, 0,0xE99D, 0, 0,0xE99C, 0, 0, +0xE99E, 0, 0, 0,0xE99F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE9A0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE9A1, 0,0xE9A2, 0, 0, 0, 0, +0xE9A3, 0, 0,0xE9A4,0xE9A5, 0,0xE9A6, 0, +0xE9A7,0xE9A8,0xE9A9,0xE9AA, 0, 0, 0,0xE9AB, +0xE9AC, 0,0x9F54,0xE9AD, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2F6,0x8B53, 0, 0, + 0, 0,0x8A40,0x8DB0,0xE9AF,0xE9AE,0x96A3, 0, + 0, 0, 0, 0, 0, 0,0xE9B1,0xE9B2, +0xE9B0, 0,0xE9B3, 0, 0,0x9682, 0, 0, + 0,0xE9B4, 0,0x8B9B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9844, 0, 0,0xFC42, 0,0xE9B5,0xFC41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE9B7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x88BC, +0xFC43, 0,0xE9B8,0x95A9,0xE9B6, 0, 0,0xE9B9, +0xE9BA, 0, 0, 0, 0, 0, 0, 0, +0xE9BB,0xE9BC, 0, 0, 0, 0, 0, 0, + 0,0xE9BD, 0,0x968E,0x8E4C, 0,0x8DF8,0x914E, + 0, 0,0xFC44, 0, 0,0xE9BE, 0, 0, + 0, 0,0xE9C1, 0,0xFC45, 0, 0, 0, + 0,0xE9BF, 0, 0, 0, 0, 0,0xE9C2, + 0, 0,0x8CEF,0xE9C0, 0, 0, 0, 0, +0xE9C3, 0,0xE9C4,0xE9C5, 0,0xE9C9, 0,0x8E49, + 0, 0, 0, 0,0x91E2, 0, 0, 0, + 0, 0,0xE9CA,0xE9C7,0xE9C6,0xE9C8, 0, 0, + 0,0x8C7E, 0, 0, 0, 0, 0, 0, + 0,0xE9CE,0xE9CD,0xE9CC, 0, 0,0x88B1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFC46, 0, 0, 0,0xE9D8, 0,0xE9D4, + 0,0xE9D5,0xE9D1,0xE9D7, 0,0xE9D3,0x8A82, 0, + 0,0x986B, 0,0xE9D6,0xE9D2,0xE9D0,0xE9CF, 0, + 0, 0, 0, 0,0xE9DA, 0, 0, 0, + 0, 0,0xE9DD, 0, 0,0xE9DC,0xE9DB, 0, + 0, 0, 0, 0, 0, 0,0x9568,0xE9D9, +0x88F1,0xE9DE, 0,0xE9E0, 0, 0, 0, 0, + 0, 0,0x8A8F,0xE9CB,0x8956, 0, 0,0xE9E2, + 0, 0, 0, 0, 0, 0, 0,0xE9E1, +0xE9DF,0x924C, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9690, 0, 0, 0, 0, +0x97D8, 0, 0,0xE9E3, 0, 0, 0, 0, + 0,0xE9E4, 0, 0, 0, 0, 0, 0, +0xE9E5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE9E6, + 0,0xE9E7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x92B9, 0, +0xE9E8, 0,0x94B5, 0,0xE9ED,0xE9E9, 0, 0, + 0,0xE9EA, 0, 0,0x9650,0x96C2, 0,0x93CE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE9EE, 0, 0,0xE9EF, +0x93BC,0xE9EC,0xE9EB, 0, 0, 0, 0,0x89A8, + 0, 0, 0,0xE9F7, 0, 0,0xE9F6, 0, + 0, 0, 0, 0,0x8995, 0, 0, 0, +0xE9F4, 0, 0, 0,0xE9F3, 0, 0,0xE9F1, + 0,0x8A9B, 0,0xE9F0,0x8EB0,0x89A7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8D83, 0, 0,0xE9FA, +0xE9F9, 0,0xE9F8, 0, 0,0xE9F5, 0,0xE9FB, + 0,0xE9FC, 0, 0, 0, 0, 0, 0, + 0,0xEA44,0xEA43, 0, 0, 0, 0, 0, + 0, 0,0xEA45, 0, 0,0x894C,0xEA40,0xEA41, + 0,0x8D94,0x96B7, 0, 0,0xEA42, 0, 0, + 0, 0, 0, 0,0xFC48,0x9651, 0, 0, +0xEA4A,0xFC47, 0,0xEA46, 0, 0, 0, 0, + 0, 0, 0,0xEA4B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA48, 0,0xEA47, 0, 0, 0, 0, 0, +0x8C7B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xEA4C, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xEA4D, 0, 0, + 0, 0,0xEA4E, 0,0xEA49, 0, 0, 0, +0xE9F2, 0, 0,0xEA4F, 0,0x92DF, 0, 0, + 0,0xEA53, 0,0xEA54,0xEA52, 0, 0, 0, + 0, 0,0xEA51,0xEA57, 0,0xEA50, 0,0xEA55, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA56, 0, 0, 0,0xEA59, 0, 0, 0, + 0, 0,0xEA58, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEA5B, + 0, 0, 0, 0, 0, 0,0xEA5C, 0, +0xEA5D, 0, 0,0x9868, 0, 0, 0, 0, + 0,0xEA5A,0x91E9,0x8DEB, 0, 0,0xEA5E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFC4A,0xEA5F,0xEA60, 0, 0,0xEA61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xEA62, 0, + 0,0x8CB2,0xEA63, 0, 0, 0,0xEA64, 0, +0x8EAD, 0,0xEA65, 0, 0, 0, 0, 0, + 0,0xEA66, 0, 0,0xEA67,0xEA68, 0, 0, + 0, 0,0xEA6B,0xEA69,0x985B, 0,0xEA6A, 0, +0x97ED, 0, 0, 0, 0, 0,0xEA6C, 0, +0x97D9, 0, 0, 0, 0, 0,0xEA6D,0x949E, + 0, 0,0xEA6E,0xEA70, 0, 0,0xEA71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEA6F,0x8D8D,0x96CB,0x9683,0x9BF5, 0,0x9F80, +0x969B, 0, 0, 0, 0,0x89A9, 0, 0, + 0, 0, 0, 0, 0,0xEA73,0x8B6F,0xEA74, +0xEA75,0xEA76,0xFC4B,0x8D95, 0,0xEA77, 0, 0, + 0,0xE0D2,0x96D9, 0,0x91E1,0xEA78,0xEA7A,0xEA79, + 0,0xEA7B, 0, 0, 0, 0,0xEA7C, 0, + 0,0xEA7D, 0, 0, 0, 0, 0, 0, +0xEA7E, 0, 0, 0, 0,0xEA80, 0,0xEA81, +0xEA82, 0,0xEA83, 0,0xEA84,0xEA85,0xEA86, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA87,0xEA88, 0, 0, 0, 0, 0,0x9343, + 0, 0, 0, 0,0x8CDB, 0,0xEA8A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x916C,0xEA8B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xEA8C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9540, 0, 0,0xEA8D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xEA8E,0xE256, 0, 0,0xE6D8, +0xE8EB, 0, 0,0xEA8F, 0,0xEA90, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA92,0xEA93,0xEA94,0x97EE,0xEA91, 0, 0,0xEA95, +0xEA96, 0, 0,0xEA98, 0,0xEA97, 0, 0, + 0, 0, 0,0xEA9A, 0, 0, 0,0xEA9B, +0xEA99, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x97B4, 0, + 0, 0, 0, 0, 0, 0,0xEA9C, 0, + 0, 0, 0, 0, 0,0xEA9D,0xE273, 0, + 0,0xEA9E}; + +/* page 8 0xE000-0xE757 - User defined characters */ +static uint16 tab_uni_cp9328[]={ +0xF040,0xF041,0xF042,0xF043,0xF044,0xF045,0xF046,0xF047, +0xF048,0xF049,0xF04A,0xF04B,0xF04C,0xF04D,0xF04E,0xF04F, +0xF050,0xF051,0xF052,0xF053,0xF054,0xF055,0xF056,0xF057, +0xF058,0xF059,0xF05A,0xF05B,0xF05C,0xF05D,0xF05E,0xF05F, +0xF060,0xF061,0xF062,0xF063,0xF064,0xF065,0xF066,0xF067, +0xF068,0xF069,0xF06A,0xF06B,0xF06C,0xF06D,0xF06E,0xF06F, +0xF070,0xF071,0xF072,0xF073,0xF074,0xF075,0xF076,0xF077, +0xF078,0xF079,0xF07A,0xF07B,0xF07C,0xF07D,0xF07E,0xF080, +0xF081,0xF082,0xF083,0xF084,0xF085,0xF086,0xF087,0xF088, +0xF089,0xF08A,0xF08B,0xF08C,0xF08D,0xF08E,0xF08F,0xF090, +0xF091,0xF092,0xF093,0xF094,0xF095,0xF096,0xF097,0xF098, +0xF099,0xF09A,0xF09B,0xF09C,0xF09D,0xF09E,0xF09F,0xF0A0, +0xF0A1,0xF0A2,0xF0A3,0xF0A4,0xF0A5,0xF0A6,0xF0A7,0xF0A8, +0xF0A9,0xF0AA,0xF0AB,0xF0AC,0xF0AD,0xF0AE,0xF0AF,0xF0B0, +0xF0B1,0xF0B2,0xF0B3,0xF0B4,0xF0B5,0xF0B6,0xF0B7,0xF0B8, +0xF0B9,0xF0BA,0xF0BB,0xF0BC,0xF0BD,0xF0BE,0xF0BF,0xF0C0, +0xF0C1,0xF0C2,0xF0C3,0xF0C4,0xF0C5,0xF0C6,0xF0C7,0xF0C8, +0xF0C9,0xF0CA,0xF0CB,0xF0CC,0xF0CD,0xF0CE,0xF0CF,0xF0D0, +0xF0D1,0xF0D2,0xF0D3,0xF0D4,0xF0D5,0xF0D6,0xF0D7,0xF0D8, +0xF0D9,0xF0DA,0xF0DB,0xF0DC,0xF0DD,0xF0DE,0xF0DF,0xF0E0, +0xF0E1,0xF0E2,0xF0E3,0xF0E4,0xF0E5,0xF0E6,0xF0E7,0xF0E8, +0xF0E9,0xF0EA,0xF0EB,0xF0EC,0xF0ED,0xF0EE,0xF0EF,0xF0F0, +0xF0F1,0xF0F2,0xF0F3,0xF0F4,0xF0F5,0xF0F6,0xF0F7,0xF0F8, +0xF0F9,0xF0FA,0xF0FB,0xF0FC,0xF140,0xF141,0xF142,0xF143, +0xF144,0xF145,0xF146,0xF147,0xF148,0xF149,0xF14A,0xF14B, +0xF14C,0xF14D,0xF14E,0xF14F,0xF150,0xF151,0xF152,0xF153, +0xF154,0xF155,0xF156,0xF157,0xF158,0xF159,0xF15A,0xF15B, +0xF15C,0xF15D,0xF15E,0xF15F,0xF160,0xF161,0xF162,0xF163, +0xF164,0xF165,0xF166,0xF167,0xF168,0xF169,0xF16A,0xF16B, +0xF16C,0xF16D,0xF16E,0xF16F,0xF170,0xF171,0xF172,0xF173, +0xF174,0xF175,0xF176,0xF177,0xF178,0xF179,0xF17A,0xF17B, +0xF17C,0xF17D,0xF17E,0xF180,0xF181,0xF182,0xF183,0xF184, +0xF185,0xF186,0xF187,0xF188,0xF189,0xF18A,0xF18B,0xF18C, +0xF18D,0xF18E,0xF18F,0xF190,0xF191,0xF192,0xF193,0xF194, +0xF195,0xF196,0xF197,0xF198,0xF199,0xF19A,0xF19B,0xF19C, +0xF19D,0xF19E,0xF19F,0xF1A0,0xF1A1,0xF1A2,0xF1A3,0xF1A4, +0xF1A5,0xF1A6,0xF1A7,0xF1A8,0xF1A9,0xF1AA,0xF1AB,0xF1AC, +0xF1AD,0xF1AE,0xF1AF,0xF1B0,0xF1B1,0xF1B2,0xF1B3,0xF1B4, +0xF1B5,0xF1B6,0xF1B7,0xF1B8,0xF1B9,0xF1BA,0xF1BB,0xF1BC, +0xF1BD,0xF1BE,0xF1BF,0xF1C0,0xF1C1,0xF1C2,0xF1C3,0xF1C4, +0xF1C5,0xF1C6,0xF1C7,0xF1C8,0xF1C9,0xF1CA,0xF1CB,0xF1CC, +0xF1CD,0xF1CE,0xF1CF,0xF1D0,0xF1D1,0xF1D2,0xF1D3,0xF1D4, +0xF1D5,0xF1D6,0xF1D7,0xF1D8,0xF1D9,0xF1DA,0xF1DB,0xF1DC, +0xF1DD,0xF1DE,0xF1DF,0xF1E0,0xF1E1,0xF1E2,0xF1E3,0xF1E4, +0xF1E5,0xF1E6,0xF1E7,0xF1E8,0xF1E9,0xF1EA,0xF1EB,0xF1EC, +0xF1ED,0xF1EE,0xF1EF,0xF1F0,0xF1F1,0xF1F2,0xF1F3,0xF1F4, +0xF1F5,0xF1F6,0xF1F7,0xF1F8,0xF1F9,0xF1FA,0xF1FB,0xF1FC, +0xF240,0xF241,0xF242,0xF243,0xF244,0xF245,0xF246,0xF247, +0xF248,0xF249,0xF24A,0xF24B,0xF24C,0xF24D,0xF24E,0xF24F, +0xF250,0xF251,0xF252,0xF253,0xF254,0xF255,0xF256,0xF257, +0xF258,0xF259,0xF25A,0xF25B,0xF25C,0xF25D,0xF25E,0xF25F, +0xF260,0xF261,0xF262,0xF263,0xF264,0xF265,0xF266,0xF267, +0xF268,0xF269,0xF26A,0xF26B,0xF26C,0xF26D,0xF26E,0xF26F, +0xF270,0xF271,0xF272,0xF273,0xF274,0xF275,0xF276,0xF277, +0xF278,0xF279,0xF27A,0xF27B,0xF27C,0xF27D,0xF27E,0xF280, +0xF281,0xF282,0xF283,0xF284,0xF285,0xF286,0xF287,0xF288, +0xF289,0xF28A,0xF28B,0xF28C,0xF28D,0xF28E,0xF28F,0xF290, +0xF291,0xF292,0xF293,0xF294,0xF295,0xF296,0xF297,0xF298, +0xF299,0xF29A,0xF29B,0xF29C,0xF29D,0xF29E,0xF29F,0xF2A0, +0xF2A1,0xF2A2,0xF2A3,0xF2A4,0xF2A5,0xF2A6,0xF2A7,0xF2A8, +0xF2A9,0xF2AA,0xF2AB,0xF2AC,0xF2AD,0xF2AE,0xF2AF,0xF2B0, +0xF2B1,0xF2B2,0xF2B3,0xF2B4,0xF2B5,0xF2B6,0xF2B7,0xF2B8, +0xF2B9,0xF2BA,0xF2BB,0xF2BC,0xF2BD,0xF2BE,0xF2BF,0xF2C0, +0xF2C1,0xF2C2,0xF2C3,0xF2C4,0xF2C5,0xF2C6,0xF2C7,0xF2C8, +0xF2C9,0xF2CA,0xF2CB,0xF2CC,0xF2CD,0xF2CE,0xF2CF,0xF2D0, +0xF2D1,0xF2D2,0xF2D3,0xF2D4,0xF2D5,0xF2D6,0xF2D7,0xF2D8, +0xF2D9,0xF2DA,0xF2DB,0xF2DC,0xF2DD,0xF2DE,0xF2DF,0xF2E0, +0xF2E1,0xF2E2,0xF2E3,0xF2E4,0xF2E5,0xF2E6,0xF2E7,0xF2E8, +0xF2E9,0xF2EA,0xF2EB,0xF2EC,0xF2ED,0xF2EE,0xF2EF,0xF2F0, +0xF2F1,0xF2F2,0xF2F3,0xF2F4,0xF2F5,0xF2F6,0xF2F7,0xF2F8, +0xF2F9,0xF2FA,0xF2FB,0xF2FC,0xF340,0xF341,0xF342,0xF343, +0xF344,0xF345,0xF346,0xF347,0xF348,0xF349,0xF34A,0xF34B, +0xF34C,0xF34D,0xF34E,0xF34F,0xF350,0xF351,0xF352,0xF353, +0xF354,0xF355,0xF356,0xF357,0xF358,0xF359,0xF35A,0xF35B, +0xF35C,0xF35D,0xF35E,0xF35F,0xF360,0xF361,0xF362,0xF363, +0xF364,0xF365,0xF366,0xF367,0xF368,0xF369,0xF36A,0xF36B, +0xF36C,0xF36D,0xF36E,0xF36F,0xF370,0xF371,0xF372,0xF373, +0xF374,0xF375,0xF376,0xF377,0xF378,0xF379,0xF37A,0xF37B, +0xF37C,0xF37D,0xF37E,0xF380,0xF381,0xF382,0xF383,0xF384, +0xF385,0xF386,0xF387,0xF388,0xF389,0xF38A,0xF38B,0xF38C, +0xF38D,0xF38E,0xF38F,0xF390,0xF391,0xF392,0xF393,0xF394, +0xF395,0xF396,0xF397,0xF398,0xF399,0xF39A,0xF39B,0xF39C, +0xF39D,0xF39E,0xF39F,0xF3A0,0xF3A1,0xF3A2,0xF3A3,0xF3A4, +0xF3A5,0xF3A6,0xF3A7,0xF3A8,0xF3A9,0xF3AA,0xF3AB,0xF3AC, +0xF3AD,0xF3AE,0xF3AF,0xF3B0,0xF3B1,0xF3B2,0xF3B3,0xF3B4, +0xF3B5,0xF3B6,0xF3B7,0xF3B8,0xF3B9,0xF3BA,0xF3BB,0xF3BC, +0xF3BD,0xF3BE,0xF3BF,0xF3C0,0xF3C1,0xF3C2,0xF3C3,0xF3C4, +0xF3C5,0xF3C6,0xF3C7,0xF3C8,0xF3C9,0xF3CA,0xF3CB,0xF3CC, +0xF3CD,0xF3CE,0xF3CF,0xF3D0,0xF3D1,0xF3D2,0xF3D3,0xF3D4, +0xF3D5,0xF3D6,0xF3D7,0xF3D8,0xF3D9,0xF3DA,0xF3DB,0xF3DC, +0xF3DD,0xF3DE,0xF3DF,0xF3E0,0xF3E1,0xF3E2,0xF3E3,0xF3E4, +0xF3E5,0xF3E6,0xF3E7,0xF3E8,0xF3E9,0xF3EA,0xF3EB,0xF3EC, +0xF3ED,0xF3EE,0xF3EF,0xF3F0,0xF3F1,0xF3F2,0xF3F3,0xF3F4, +0xF3F5,0xF3F6,0xF3F7,0xF3F8,0xF3F9,0xF3FA,0xF3FB,0xF3FC, +0xF440,0xF441,0xF442,0xF443,0xF444,0xF445,0xF446,0xF447, +0xF448,0xF449,0xF44A,0xF44B,0xF44C,0xF44D,0xF44E,0xF44F, +0xF450,0xF451,0xF452,0xF453,0xF454,0xF455,0xF456,0xF457, +0xF458,0xF459,0xF45A,0xF45B,0xF45C,0xF45D,0xF45E,0xF45F, +0xF460,0xF461,0xF462,0xF463,0xF464,0xF465,0xF466,0xF467, +0xF468,0xF469,0xF46A,0xF46B,0xF46C,0xF46D,0xF46E,0xF46F, +0xF470,0xF471,0xF472,0xF473,0xF474,0xF475,0xF476,0xF477, +0xF478,0xF479,0xF47A,0xF47B,0xF47C,0xF47D,0xF47E,0xF480, +0xF481,0xF482,0xF483,0xF484,0xF485,0xF486,0xF487,0xF488, +0xF489,0xF48A,0xF48B,0xF48C,0xF48D,0xF48E,0xF48F,0xF490, +0xF491,0xF492,0xF493,0xF494,0xF495,0xF496,0xF497,0xF498, +0xF499,0xF49A,0xF49B,0xF49C,0xF49D,0xF49E,0xF49F,0xF4A0, +0xF4A1,0xF4A2,0xF4A3,0xF4A4,0xF4A5,0xF4A6,0xF4A7,0xF4A8, +0xF4A9,0xF4AA,0xF4AB,0xF4AC,0xF4AD,0xF4AE,0xF4AF,0xF4B0, +0xF4B1,0xF4B2,0xF4B3,0xF4B4,0xF4B5,0xF4B6,0xF4B7,0xF4B8, +0xF4B9,0xF4BA,0xF4BB,0xF4BC,0xF4BD,0xF4BE,0xF4BF,0xF4C0, +0xF4C1,0xF4C2,0xF4C3,0xF4C4,0xF4C5,0xF4C6,0xF4C7,0xF4C8, +0xF4C9,0xF4CA,0xF4CB,0xF4CC,0xF4CD,0xF4CE,0xF4CF,0xF4D0, +0xF4D1,0xF4D2,0xF4D3,0xF4D4,0xF4D5,0xF4D6,0xF4D7,0xF4D8, +0xF4D9,0xF4DA,0xF4DB,0xF4DC,0xF4DD,0xF4DE,0xF4DF,0xF4E0, +0xF4E1,0xF4E2,0xF4E3,0xF4E4,0xF4E5,0xF4E6,0xF4E7,0xF4E8, +0xF4E9,0xF4EA,0xF4EB,0xF4EC,0xF4ED,0xF4EE,0xF4EF,0xF4F0, +0xF4F1,0xF4F2,0xF4F3,0xF4F4,0xF4F5,0xF4F6,0xF4F7,0xF4F8, +0xF4F9,0xF4FA,0xF4FB,0xF4FC,0xF540,0xF541,0xF542,0xF543, +0xF544,0xF545,0xF546,0xF547,0xF548,0xF549,0xF54A,0xF54B, +0xF54C,0xF54D,0xF54E,0xF54F,0xF550,0xF551,0xF552,0xF553, +0xF554,0xF555,0xF556,0xF557,0xF558,0xF559,0xF55A,0xF55B, +0xF55C,0xF55D,0xF55E,0xF55F,0xF560,0xF561,0xF562,0xF563, +0xF564,0xF565,0xF566,0xF567,0xF568,0xF569,0xF56A,0xF56B, +0xF56C,0xF56D,0xF56E,0xF56F,0xF570,0xF571,0xF572,0xF573, +0xF574,0xF575,0xF576,0xF577,0xF578,0xF579,0xF57A,0xF57B, +0xF57C,0xF57D,0xF57E,0xF580,0xF581,0xF582,0xF583,0xF584, +0xF585,0xF586,0xF587,0xF588,0xF589,0xF58A,0xF58B,0xF58C, +0xF58D,0xF58E,0xF58F,0xF590,0xF591,0xF592,0xF593,0xF594, +0xF595,0xF596,0xF597,0xF598,0xF599,0xF59A,0xF59B,0xF59C, +0xF59D,0xF59E,0xF59F,0xF5A0,0xF5A1,0xF5A2,0xF5A3,0xF5A4, +0xF5A5,0xF5A6,0xF5A7,0xF5A8,0xF5A9,0xF5AA,0xF5AB,0xF5AC, +0xF5AD,0xF5AE,0xF5AF,0xF5B0,0xF5B1,0xF5B2,0xF5B3,0xF5B4, +0xF5B5,0xF5B6,0xF5B7,0xF5B8,0xF5B9,0xF5BA,0xF5BB,0xF5BC, +0xF5BD,0xF5BE,0xF5BF,0xF5C0,0xF5C1,0xF5C2,0xF5C3,0xF5C4, +0xF5C5,0xF5C6,0xF5C7,0xF5C8,0xF5C9,0xF5CA,0xF5CB,0xF5CC, +0xF5CD,0xF5CE,0xF5CF,0xF5D0,0xF5D1,0xF5D2,0xF5D3,0xF5D4, +0xF5D5,0xF5D6,0xF5D7,0xF5D8,0xF5D9,0xF5DA,0xF5DB,0xF5DC, +0xF5DD,0xF5DE,0xF5DF,0xF5E0,0xF5E1,0xF5E2,0xF5E3,0xF5E4, +0xF5E5,0xF5E6,0xF5E7,0xF5E8,0xF5E9,0xF5EA,0xF5EB,0xF5EC, +0xF5ED,0xF5EE,0xF5EF,0xF5F0,0xF5F1,0xF5F2,0xF5F3,0xF5F4, +0xF5F5,0xF5F6,0xF5F7,0xF5F8,0xF5F9,0xF5FA,0xF5FB,0xF5FC, +0xF640,0xF641,0xF642,0xF643,0xF644,0xF645,0xF646,0xF647, +0xF648,0xF649,0xF64A,0xF64B,0xF64C,0xF64D,0xF64E,0xF64F, +0xF650,0xF651,0xF652,0xF653,0xF654,0xF655,0xF656,0xF657, +0xF658,0xF659,0xF65A,0xF65B,0xF65C,0xF65D,0xF65E,0xF65F, +0xF660,0xF661,0xF662,0xF663,0xF664,0xF665,0xF666,0xF667, +0xF668,0xF669,0xF66A,0xF66B,0xF66C,0xF66D,0xF66E,0xF66F, +0xF670,0xF671,0xF672,0xF673,0xF674,0xF675,0xF676,0xF677, +0xF678,0xF679,0xF67A,0xF67B,0xF67C,0xF67D,0xF67E,0xF680, +0xF681,0xF682,0xF683,0xF684,0xF685,0xF686,0xF687,0xF688, +0xF689,0xF68A,0xF68B,0xF68C,0xF68D,0xF68E,0xF68F,0xF690, +0xF691,0xF692,0xF693,0xF694,0xF695,0xF696,0xF697,0xF698, +0xF699,0xF69A,0xF69B,0xF69C,0xF69D,0xF69E,0xF69F,0xF6A0, +0xF6A1,0xF6A2,0xF6A3,0xF6A4,0xF6A5,0xF6A6,0xF6A7,0xF6A8, +0xF6A9,0xF6AA,0xF6AB,0xF6AC,0xF6AD,0xF6AE,0xF6AF,0xF6B0, +0xF6B1,0xF6B2,0xF6B3,0xF6B4,0xF6B5,0xF6B6,0xF6B7,0xF6B8, +0xF6B9,0xF6BA,0xF6BB,0xF6BC,0xF6BD,0xF6BE,0xF6BF,0xF6C0, +0xF6C1,0xF6C2,0xF6C3,0xF6C4,0xF6C5,0xF6C6,0xF6C7,0xF6C8, +0xF6C9,0xF6CA,0xF6CB,0xF6CC,0xF6CD,0xF6CE,0xF6CF,0xF6D0, +0xF6D1,0xF6D2,0xF6D3,0xF6D4,0xF6D5,0xF6D6,0xF6D7,0xF6D8, +0xF6D9,0xF6DA,0xF6DB,0xF6DC,0xF6DD,0xF6DE,0xF6DF,0xF6E0, +0xF6E1,0xF6E2,0xF6E3,0xF6E4,0xF6E5,0xF6E6,0xF6E7,0xF6E8, +0xF6E9,0xF6EA,0xF6EB,0xF6EC,0xF6ED,0xF6EE,0xF6EF,0xF6F0, +0xF6F1,0xF6F2,0xF6F3,0xF6F4,0xF6F5,0xF6F6,0xF6F7,0xF6F8, +0xF6F9,0xF6FA,0xF6FB,0xF6FC,0xF740,0xF741,0xF742,0xF743, +0xF744,0xF745,0xF746,0xF747,0xF748,0xF749,0xF74A,0xF74B, +0xF74C,0xF74D,0xF74E,0xF74F,0xF750,0xF751,0xF752,0xF753, +0xF754,0xF755,0xF756,0xF757,0xF758,0xF759,0xF75A,0xF75B, +0xF75C,0xF75D,0xF75E,0xF75F,0xF760,0xF761,0xF762,0xF763, +0xF764,0xF765,0xF766,0xF767,0xF768,0xF769,0xF76A,0xF76B, +0xF76C,0xF76D,0xF76E,0xF76F,0xF770,0xF771,0xF772,0xF773, +0xF774,0xF775,0xF776,0xF777,0xF778,0xF779,0xF77A,0xF77B, +0xF77C,0xF77D,0xF77E,0xF780,0xF781,0xF782,0xF783,0xF784, +0xF785,0xF786,0xF787,0xF788,0xF789,0xF78A,0xF78B,0xF78C, +0xF78D,0xF78E,0xF78F,0xF790,0xF791,0xF792,0xF793,0xF794, +0xF795,0xF796,0xF797,0xF798,0xF799,0xF79A,0xF79B,0xF79C, +0xF79D,0xF79E,0xF79F,0xF7A0,0xF7A1,0xF7A2,0xF7A3,0xF7A4, +0xF7A5,0xF7A6,0xF7A7,0xF7A8,0xF7A9,0xF7AA,0xF7AB,0xF7AC, +0xF7AD,0xF7AE,0xF7AF,0xF7B0,0xF7B1,0xF7B2,0xF7B3,0xF7B4, +0xF7B5,0xF7B6,0xF7B7,0xF7B8,0xF7B9,0xF7BA,0xF7BB,0xF7BC, +0xF7BD,0xF7BE,0xF7BF,0xF7C0,0xF7C1,0xF7C2,0xF7C3,0xF7C4, +0xF7C5,0xF7C6,0xF7C7,0xF7C8,0xF7C9,0xF7CA,0xF7CB,0xF7CC, +0xF7CD,0xF7CE,0xF7CF,0xF7D0,0xF7D1,0xF7D2,0xF7D3,0xF7D4, +0xF7D5,0xF7D6,0xF7D7,0xF7D8,0xF7D9,0xF7DA,0xF7DB,0xF7DC, +0xF7DD,0xF7DE,0xF7DF,0xF7E0,0xF7E1,0xF7E2,0xF7E3,0xF7E4, +0xF7E5,0xF7E6,0xF7E7,0xF7E8,0xF7E9,0xF7EA,0xF7EB,0xF7EC, +0xF7ED,0xF7EE,0xF7EF,0xF7F0,0xF7F1,0xF7F2,0xF7F3,0xF7F4, +0xF7F5,0xF7F6,0xF7F7,0xF7F8,0xF7F9,0xF7FA,0xF7FB,0xF7FC, +0xF840,0xF841,0xF842,0xF843,0xF844,0xF845,0xF846,0xF847, +0xF848,0xF849,0xF84A,0xF84B,0xF84C,0xF84D,0xF84E,0xF84F, +0xF850,0xF851,0xF852,0xF853,0xF854,0xF855,0xF856,0xF857, +0xF858,0xF859,0xF85A,0xF85B,0xF85C,0xF85D,0xF85E,0xF85F, +0xF860,0xF861,0xF862,0xF863,0xF864,0xF865,0xF866,0xF867, +0xF868,0xF869,0xF86A,0xF86B,0xF86C,0xF86D,0xF86E,0xF86F, +0xF870,0xF871,0xF872,0xF873,0xF874,0xF875,0xF876,0xF877, +0xF878,0xF879,0xF87A,0xF87B,0xF87C,0xF87D,0xF87E,0xF880, +0xF881,0xF882,0xF883,0xF884,0xF885,0xF886,0xF887,0xF888, +0xF889,0xF88A,0xF88B,0xF88C,0xF88D,0xF88E,0xF88F,0xF890, +0xF891,0xF892,0xF893,0xF894,0xF895,0xF896,0xF897,0xF898, +0xF899,0xF89A,0xF89B,0xF89C,0xF89D,0xF89E,0xF89F,0xF8A0, +0xF8A1,0xF8A2,0xF8A3,0xF8A4,0xF8A5,0xF8A6,0xF8A7,0xF8A8, +0xF8A9,0xF8AA,0xF8AB,0xF8AC,0xF8AD,0xF8AE,0xF8AF,0xF8B0, +0xF8B1,0xF8B2,0xF8B3,0xF8B4,0xF8B5,0xF8B6,0xF8B7,0xF8B8, +0xF8B9,0xF8BA,0xF8BB,0xF8BC,0xF8BD,0xF8BE,0xF8BF,0xF8C0, +0xF8C1,0xF8C2,0xF8C3,0xF8C4,0xF8C5,0xF8C6,0xF8C7,0xF8C8, +0xF8C9,0xF8CA,0xF8CB,0xF8CC,0xF8CD,0xF8CE,0xF8CF,0xF8D0, +0xF8D1,0xF8D2,0xF8D3,0xF8D4,0xF8D5,0xF8D6,0xF8D7,0xF8D8, +0xF8D9,0xF8DA,0xF8DB,0xF8DC,0xF8DD,0xF8DE,0xF8DF,0xF8E0, +0xF8E1,0xF8E2,0xF8E3,0xF8E4,0xF8E5,0xF8E6,0xF8E7,0xF8E8, +0xF8E9,0xF8EA,0xF8EB,0xF8EC,0xF8ED,0xF8EE,0xF8EF,0xF8F0, +0xF8F1,0xF8F2,0xF8F3,0xF8F4,0xF8F5,0xF8F6,0xF8F7,0xF8F8, +0xF8F9,0xF8FA,0xF8FB,0xF8FC,0xF940,0xF941,0xF942,0xF943, +0xF944,0xF945,0xF946,0xF947,0xF948,0xF949,0xF94A,0xF94B, +0xF94C,0xF94D,0xF94E,0xF94F,0xF950,0xF951,0xF952,0xF953, +0xF954,0xF955,0xF956,0xF957,0xF958,0xF959,0xF95A,0xF95B, +0xF95C,0xF95D,0xF95E,0xF95F,0xF960,0xF961,0xF962,0xF963, +0xF964,0xF965,0xF966,0xF967,0xF968,0xF969,0xF96A,0xF96B, +0xF96C,0xF96D,0xF96E,0xF96F,0xF970,0xF971,0xF972,0xF973, +0xF974,0xF975,0xF976,0xF977,0xF978,0xF979,0xF97A,0xF97B, +0xF97C,0xF97D,0xF97E,0xF980,0xF981,0xF982,0xF983,0xF984, +0xF985,0xF986,0xF987,0xF988,0xF989,0xF98A,0xF98B,0xF98C, +0xF98D,0xF98E,0xF98F,0xF990,0xF991,0xF992,0xF993,0xF994, +0xF995,0xF996,0xF997,0xF998,0xF999,0xF99A,0xF99B,0xF99C, +0xF99D,0xF99E,0xF99F,0xF9A0,0xF9A1,0xF9A2,0xF9A3,0xF9A4, +0xF9A5,0xF9A6,0xF9A7,0xF9A8,0xF9A9,0xF9AA,0xF9AB,0xF9AC, +0xF9AD,0xF9AE,0xF9AF,0xF9B0,0xF9B1,0xF9B2,0xF9B3,0xF9B4, +0xF9B5,0xF9B6,0xF9B7,0xF9B8,0xF9B9,0xF9BA,0xF9BB,0xF9BC, +0xF9BD,0xF9BE,0xF9BF,0xF9C0,0xF9C1,0xF9C2,0xF9C3,0xF9C4, +0xF9C5,0xF9C6,0xF9C7,0xF9C8,0xF9C9,0xF9CA,0xF9CB,0xF9CC, +0xF9CD,0xF9CE,0xF9CF,0xF9D0,0xF9D1,0xF9D2,0xF9D3,0xF9D4, +0xF9D5,0xF9D6,0xF9D7,0xF9D8,0xF9D9,0xF9DA,0xF9DB,0xF9DC, +0xF9DD,0xF9DE,0xF9DF,0xF9E0,0xF9E1,0xF9E2,0xF9E3,0xF9E4, +0xF9E5,0xF9E6,0xF9E7,0xF9E8,0xF9E9,0xF9EA,0xF9EB,0xF9EC, +0xF9ED,0xF9EE,0xF9EF,0xF9F0,0xF9F1,0xF9F2,0xF9F3,0xF9F4, +0xF9F5,0xF9F6,0xF9F7,0xF9F8,0xF9F9,0xF9FA,0xF9FB,0xF9FC}; + +/* page 9 0xF920-0xFA2D */ +static uint16 tab_uni_cp9329[]={ + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFAE0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFBE9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFA90,0xFA9B, +0xFA9C,0xFAB1,0xFAD8,0xFAE8,0xFAEA,0xFB58,0xFB5E,0xFB75, +0xFB7D,0xFB7E,0xFB80,0xFB82,0xFB86,0xFB89,0xFB92,0xFB9D, +0xFB9F,0xFBA0,0xFBA9,0xFBB1,0xFBB3,0xFBB4,0xFBB7,0xFBD3, +0xFBDA,0xFBEA,0xFBF6,0xFBF7,0xFBF9,0xFC49}; + +/* page 10 0xFF01-0xFFE5 */ +static uint16 tab_uni_cp93210[]={ +0x8149,0xFA57,0x8194,0x8190,0x8193,0x8195,0xFA56,0x8169, +0x816A,0x8196,0x817B,0x8143,0x817C,0x8144,0x815E,0x824F, +0x8250,0x8251,0x8252,0x8253,0x8254,0x8255,0x8256,0x8257, +0x8258,0x8146,0x8147,0x8183,0x8181,0x8184,0x8148,0x8197, +0x8260,0x8261,0x8262,0x8263,0x8264,0x8265,0x8266,0x8267, +0x8268,0x8269,0x826A,0x826B,0x826C,0x826D,0x826E,0x826F, +0x8270,0x8271,0x8272,0x8273,0x8274,0x8275,0x8276,0x8277, +0x8278,0x8279,0x816D,0x815F,0x816E,0x814F,0x8151,0x814D, +0x8281,0x8282,0x8283,0x8284,0x8285,0x8286,0x8287,0x8288, +0x8289,0x828A,0x828B,0x828C,0x828D,0x828E,0x828F,0x8290, +0x8291,0x8292,0x8293,0x8294,0x8295,0x8296,0x8297,0x8298, +0x8299,0x829A,0x816F,0x8162,0x8170,0x8160, 0, 0, +0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,0x00A8, +0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,0x00B0, +0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,0x00B8, +0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,0x00C0, +0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,0x00C8, +0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,0x00D0, +0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,0x00D8, +0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8191, +0x8192,0x81CA,0x8150,0xFA55,0x818F}; + +static int func_uni_cp932_onechar(int code){ + if ((code>=0x005C)&&(code<=0x00F7)) + return(tab_uni_cp9320[code-0x005C]); + if ((code>=0x0391)&&(code<=0x0451)) + return(tab_uni_cp9321[code-0x0391]); + if ((code>=0x2010)&&(code<=0x2473)) + return(tab_uni_cp9322[code-0x2010]); + if ((code>=0x2500)&&(code<=0x266F)) + return(tab_uni_cp9323[code-0x2500]); + if ((code>=0x3000)&&(code<=0x30FE)) + return(tab_uni_cp9324[code-0x3000]); + if ((code>=0x3230)&&(code<=0x33CD)) + return(tab_uni_cp9325[code-0x3230]); + if ((code>=0x4E00)&&(code<=0x9481)) + return(tab_uni_cp9326[code-0x4E00]); + if ((code>=0x9577)&&(code<=0x9FA0)) + return(tab_uni_cp9327[code-0x9577]); + if ((code>=0xE000)&&(code<=0xE757)) + return(tab_uni_cp9328[code-0xE000]); + if ((code>=0xF920)&&(code<=0xFA2D)) + return(tab_uni_cp9329[code-0xF920]); + if ((code>=0xFF01)&&(code<=0xFFE5)) + return(tab_uni_cp93210[code-0xFF01]); + return(0); +} + + +static int +my_wc_mb_cp932(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + int code; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((int) wc < 0x80) + { + s[0]= (uchar) wc; + return 1; + } + + if (!(code=func_uni_cp932_onechar(wc))) + return MY_CS_ILUNI; + + if (code>=0xA1 && code <= 0xDF) + { + s[0]= code; + return 1; + } + + s[0]=code>>8; + s[1]=code&0xFF; + return 2; +} + + +static int +my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e){ + int hi; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((hi= s[0]) < 0x80) + { + pwc[0]=hi; + return 1; + } + + if (hi >= 0xA1 && hi <= 0xDF) + { + pwc[0]= func_cp932_uni_onechar(hi); + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + if (!(pwc[0]=func_cp932_uni_onechar((hi<<8)+s[1]))) + return -2; + + return 2; +} + +static +size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *str_end) +{ + size_t clen= 0; + const uchar *b= (const uchar *) str; + const uchar *e= (const uchar *) str_end; + + for (clen= 0; b < e; ) + { + if (*b >= 0xA1 && *b <= 0xDF) + { + clen++; + b++; + } + else if (*b > 0x7F) + { + clen+= 2; + b+= 2; + } + else + { + clen++; + b++; + } + } + return clen; +} + +/* + Returns a well formed length of a cp932 string. + cp932 additional characters are also accepted. +*/ + +static +size_t my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) +{ + const char *b0= b; + *error= 0; + while (pos-- && b < e) + { + /* + Cast to int8 for extra safety. + "char" can be unsigned by default + on some platforms. + */ + if (((int8)b[0]) >= 0) + { + /* Single byte ascii character */ + b++; + } + else if (iscp932head((uchar)*b) && (e-b)>1 && iscp932tail((uchar)b[1])) + { + /* Double byte character */ + b+= 2; + } + else if (((uchar)*b) >= 0xA1 && ((uchar)*b) <= 0xDF) + { + /* Half width kana */ + b++; + } + else + { + /* Wrong byte sequence */ + *error= 1; + break; + } + } + return (size_t) (b - b0); +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_cp932, + my_strnncollsp_cp932, + my_strnxfrm_mb, + my_strnxfrmlen_simple, + my_like_range_cp932, + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_8bit, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_cp932, + mbcharlen_cp932, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_cp932, + my_lengthsp_8bit, + my_numcells_cp932, + my_mb_wc_cp932, /* mb_wc */ + my_wc_mb_cp932, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_8bit, + my_casedn_str_8bit, + my_caseup_8bit, + my_casedn_8bit, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_cp932_japanese_ci= +{ + 95,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ + "cp932", /* cs name */ + "cp932_japanese_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp932, + to_lower_cp932, + to_upper_cp932, + sort_order_cp932, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + +CHARSET_INFO my_charset_cp932_bin= +{ + 96,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "cp932", /* cs name */ + "cp932_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp932, + to_lower_cp932, + to_upper_cp932, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + +#endif diff --git a/externals/mysql/strings/ctype-czech.c b/externals/mysql/strings/ctype-czech.c new file mode 100644 index 00000000000..73d03e94ffd --- /dev/null +++ b/externals/mysql/strings/ctype-czech.c @@ -0,0 +1,813 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + File strings/ctype-czech.c for MySQL. + + This file implements the Czech sorting for the MySQL database + server (www.mysql.com). Due to some complicated rules the + Czech language has for sorting strings, a more complex + solution was needed than the one-to-one conversion table. To + note a few, here is an example of a Czech sorting sequence: + + co < hlaska < hláska < hlava < chlapec < krtek + + It because some of the rules are: double char 'ch' is sorted + between 'h' and 'i'. Accented character 'á' (a with acute) is + sorted after 'a' and before 'b', but only if the word is + otherwise the same. However, because 's' is sorted before 'v' + in hlava, the accentness of 'á' is overridden. There are many + more rules. + + This file defines functions my_strxfrm and my_strcoll for + C-like zero terminated strings and my_strnxfrm and my_strnncoll + for strings where the length comes as an parameter. Also + defined here you will find function my_like_range that returns + index range strings for LIKE expression and the + MY_STRXFRM_MULTIPLY set to value 4 -- this is the ratio the + strings grows during my_strxfrm. The algorithm has four + passes, that's why we need four times more space for expanded + string. + + This file also contains the ISO-Latin-2 definitions of + characters. + + Author: (c) 1997--1998 Jan Pazdziora, adelton@fi.muni.cz + Jan Pazdziora has a shared copyright for this code + + The original of this file can also be found at + http://www.fi.muni.cz/~adelton/l10n/ + + Bug reports and suggestions are always welcome. +*/ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_czech=4 + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_latin2 + +/* + These are four tables for four passes of the algorithm. Please see + below for what are the "special values" +*/ + +static const uchar *CZ_SORT_TABLE[]= +{ + (const uchar*) + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x41\x42\x43\x44\x45\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x47\x58\x5C\x6A\x77\x6B\x69\x5B\x5E\x5F\x66\x6E\x55\x54\x5A\x67" + "\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x57\x56\x71\x72\x73\x59" + "\x65\x82\x83\xFF\x86\x87\x88\x89\x8A\x8C\x8D\x8E\x8F\x90\x91\x92" + "\x94\x95\x96\x98\x9A\x9B\x9D\x9E\x9F\xA0\xA1\x60\x68\x61\x4B\x52" + "\x49\x82\x83\xFF\x86\x87\x88\x89\x8A\x8C\x8D\x8E\x8F\x90\x91\x92" + "\x94\x95\x96\x98\x9A\x9B\x9D\x9E\x9F\xA0\xA1\x62\x74\x63\x75\x00" + "\x00\x00\x00\x00\x00\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x48\x82\x4C\x8F\x76\x8F\x98\x64\x4E\x99\x98\x9A\xA1\x53\xA2\xA1" + "\x6D\x82\x51\x8F\x4A\x8F\x98\x6C\x50\x99\x98\x9A\xA1\x4F\xA2\xA1" + "\x96\x82\x82\x82\x82\x8F\x84\x84\x85\x87\x87\x87\x87\x8C\x8C\x86" + "\x86\x91\x91\x92\x92\x92\x92\x70\x97\x9B\x9B\x9B\x9B\xA0\x9A\x98" + "\x96\x82\x82\x82\x82\x8F\x84\x84\x85\x87\x87\x87\x87\x8C\x8C\x86" + "\x86\x91\x91\x92\x92\x92\x92\x6F\x97\x9B\x9B\x9B\x9B\xA0\x9A\x4D", + + (const uchar*) + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x20\x20\x20\x20\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\xFF\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\xFF\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x00" + "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x20\x2B\x20\x2C\x20\x25\x22\x20\x20\x25\x2A\x25\x22\x20\x25\x29" + "\x20\x2B\x20\x2C\x20\x25\x22\x20\x20\x25\x2A\x25\x22\x20\x25\x29" + "\x22\x22\x24\x23\x27\x22\x22\x2A\x25\x22\x2B\x47\x25\x22\x24\x25" + "\x2C\x22\x25\x22\x24\x28\x27\x20\x25\x26\x22\x28\x27\x22\x2A\x21" + "\x22\x22\x24\x23\x27\x22\x22\x2A\x25\x22\x2B\x47\x25\x22\x24\x25" + "\x2C\x22\x25\x22\x24\x28\x27\x20\x25\x26\x22\x28\x27\x22\x2A\x20", + + + (const uchar*) + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x03\x03\x03\x03\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x05\x05\xFF\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05" + "\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x03\x03\x03\x03\x03" + "\x03\x03\x03\xFF\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x00" + "\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x1B\x05\x03\x05\x03\x05\x05\x03\x03\x05\x05\x05\x05\x03\x05\x05" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05" + "\x05\x05\x05\x05\x05\x05\x05\x03\x05\x05\x05\x05\x05\x05\x05\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + "\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03", + + (const uchar*) + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" + "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F" + "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F" + "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F" + "\x40\x41\x42\xFF\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F" + "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F" + "\x60\x61\x62\xFF\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F" + "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F" + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F" + "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F" + "\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF" + "\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF" + "\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF" + "\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF" + "\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF" + "\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF" +}; + +/* + These define the values for the double chars that need to be + sorted as they were single characters -- in Czech these are + 'ch', 'Ch' and 'CH'. +*/ + +struct wordvalue +{ + const uchar *word; + const uchar *outvalue; +}; + +static struct wordvalue doubles[]= +{ + { "ch", (const uchar*) "\x8B\x20\x03\x63" }, + { "Ch", (const uchar*) "\x8B\x20\x04\x43" }, + { "CH", (const uchar*) "\x8B\x20\x05\x43" }, + { "c", (const uchar*) "\x84\x20\x03\x63" }, + { "C", (const uchar*) "\x84\x20\x05\x43" }, +}; + + +/* + Define "auto" space character, + which is used while processing "PAD SPACE" rule, + when one string is shorter than another string. + "Auto" space character is lower than a real space + character on the third level. +*/ +static const uchar *virtual_space= "\x47\x20\x02\x20"; + +/* + Original comments from the contributor: + + Informal description of the algorithm: + + We walk the string left to right. + + The end of the string is either passed as parameter, or is + *p == 0. This is hidden in the IS_END macro. + + In the first two passes, we compare word by word. So we make + first and second pass on the first word, first and second pass + on the second word, etc. If we come to the end of the string + during the first pass, we need to jump to the last word of the + second pass. + + End of pass is marked with value 1 on the output. + + For each character, we read it's value from the table. + + If the value is ignore (0), we go straight to the next character. + + If the value is space/end of word (2) and we are in the first + or second pass, we skip all characters having value 0 -- 2 and + switch the pass. + + If it's the compose character (255), we check if the double + exists behind it, find its value. + + We append 0 to the end. + + Neformální popis algoritmu: + + procházíme řetězec zleva doprava + konec řetězce poznáme podle *p == 0 + pokud jsme doąli na konec řetězce při průchodu 0, nejdeme na + začátek, ale na uloľenou pozici, protoľe první a druhý + průchod běľí současně + konec vstupu (průchodu) označíme na výstupu hodnotou 1 + + načteme hodnotu z třídící tabulky + jde-li o hodnotu ignorovat (0), skočíme na daląí průchod + jde-li o hodnotu konec slova (2) a je to průchod 0 nebo 1, + přeskočíme vąechny daląí 0 -- 2 a prohodíme + průchody + jde-li o kompozitní znak (255), otestujeme, zda následuje + správný do dvojice, dohledáme správnou hodnotu + + na konci připojíme znak 0 +*/ + +/* + In March 2007 latin2_czech_cs was reworked by Alexander Barkov, + to suite other MySQL collations better, and to be Falcon compatible. + + Changes: + - Discarded word-by-word comparison on the primary and the secondary level. + Comparison is now strictly done level-by-level + (like the Unicode Collation Algorithm (UCA) does). + + - Character weights were derived from Unicode 5.0.0 standard. + This is to make order of punctuation characters and digits + more consistent with all other MySQL collations and UCA. + + The order is now: + + Controls, spaces, punctuations, digits, letters. + + It previously used to be: + + Punctuations, controls, some more punctuations, letters, digits. + + NOTE: + + A minor difference between this implementations and the UCA: + + German "LATIN SMALL LETTER SHARP S" does not expand to "ss". + It is instead considered as secondary greater than "LATIN LETTER S", + and thus sorted between "LATIN LETTER S" and "LATIN LETTER S WITH ACUTE". + This allows to reduce *twice* disk space required for un-indexed + ORDER BY (using the filesort method). + + As neither the original version of latin2_czech_cs + expanded "SHARP S" to "ss", nor "SHARP S" is a part of Czech alphabet, + this behavior should be ok. + + - Collation is now "PAD SPACE" like all other MySQL collations. + It ignores trailing spaces on primary and secondary level. + + - SPACE and TAB characters are not ignorable anymore. + Also, they have different weights on primary level, + like in all other MySQL collations: + + SELECT 'a\t' < 'a ' -- returns true + SELECT 'a\t' < 'a' -- returns true + + - Some other punctuation characters are not ignorable anymore, + for better compatibility with UCA and other MySQL collations. + +*/ + + +#define ADD_TO_RESULT(dest, len, totlen, value) \ +if ((totlen) < (len)) { dest[totlen] = value; } (totlen++); +#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len)) + +/* + src - IN pointer to the beginning of the string + p - IN/OUT pointer to the current character being processed + pass - IN pass number [0..3] + 0 - primary level + 1 - secondary level + 2 - tertiary level + 3 - quarternary level + value - OUT the next weight value. + -1 is returned on end-of-line. + 1 is returned between levels ("level separator"). + Any value greater than 1 is a normal weight. + ml - IN a flag indicating whether to switch automatically + to the secondary level and higher levels, + or stop at the primary level. + ml=0 is used for prefix comparison. +*/ + +#define NEXT_CMP_VALUE(src, p, pass, value, len, ml) \ +while (1) \ +{ \ + if (IS_END(p, src, len)) \ + { \ + /* when we are at the end of string */ \ + /* return either -1 for end of string */ \ + /* or 1 for end of pass */ \ + \ + /* latin2_czech_cs WEIGHT_STRING() returns level */ \ + /* separators even for empty string: 01.01.01.00 */ \ + /* The another Czech collation (cp1250_czech_cs) */ \ + /* returns *empty* WEIGHT_STRING() for empty input.*/\ + /* This is why the below if(){}else{} code block */ \ + /* differs from the similar piece in */ \ + /* ctype-win1250.c */ \ + if (pass != 3 && ml) \ + { \ + p= src; \ + pass++; \ + value= 1; /* Level separator */ \ + } \ + else \ + { \ + value= -1; /* End-of-line marker*/ \ + } \ + break; \ + } \ + /* not at end of string */ \ + value = CZ_SORT_TABLE[pass][*p]; \ + if (value == 0 && pass < 3) \ + { p++; continue; } /* ignore value on levels 0,1,2 */ \ + if (value == 255) \ + { \ + int i; \ + for (i= 0; i < (int) array_elements(doubles); i++) \ + { \ + const char * pattern = doubles[i].word; \ + const char * q = (const char *) p; \ + int j = 0; \ + while (pattern[j]) \ + { \ + if (IS_END(q, src, len) || (*q != pattern[j])) \ + break; \ + j++; q++; \ + } \ + if (!(pattern[j])) \ + { \ + value = (int)(doubles[i].outvalue[pass]); \ + p= (const uchar *) q - 1; \ + break; \ + } \ + } \ + } \ + p++; \ + break; \ +} + +/* + Function strnncoll, actually strcoll, with Czech sorting, which expect + the length of the strings being specified +*/ + +static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s1, size_t len1, + const uchar *s2, size_t len2, + my_bool s2_is_prefix) +{ + int v1, v2; + const uchar * p1, * p2; + int pass1= 0, pass2= 0; + + if (s2_is_prefix && len1 > len2) + len1=len2; + + p1= s1; + p2= s2; + + do + { + int diff; + NEXT_CMP_VALUE(s1, p1, pass1, v1, (int)len1, 1); + NEXT_CMP_VALUE(s2, p2, pass2, v2, (int)len2, 1); + if ((diff = v1 - v2)) + return diff; + } + while (v1 >= 0); + return 0; +} + + + +/* + Compare strings, ignore trailing spaces +*/ + +static int +my_strnncollsp_czech(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + int level; + + for (level= 0; level <= 3; level++) + { + const uchar *s1= s; + const uchar *t1= t; + + for (;;) + { + int sval, tval, diff; + NEXT_CMP_VALUE(s, s1, level, sval, (int) slen, 0); + NEXT_CMP_VALUE(t, t1, level, tval, (int) tlen, 0); + if (sval < 0) + { + sval= virtual_space[level]; + for (; tval >= 0 ;) + { + if ((diff= sval - tval)) + return diff; + NEXT_CMP_VALUE(t, t1, level, tval, (int) tlen, 0); + } + break; + } + else if (tval < 0) + { + tval= virtual_space[level]; + for (; sval >= 0 ;) + { + if ((diff= sval - tval)) + return diff; + NEXT_CMP_VALUE(s, s1, level, sval, (int) slen, 0); + } + break; + } + + if ((diff= sval - tval)) + return diff; + } + } + return 0; +} + + +/* + Returns the number of bytes required for strnxfrm(). +*/ +static size_t +my_strnxfrmlen_czech(CHARSET_INFO *cs __attribute__((unused)), size_t len) +{ + return len * 4 + 4; +} + + +/* + Function strnxfrm, actually strxfrm, with Czech sorting, which expect + the length of the strings being specified +*/ +static size_t +my_strnxfrm_czech(CHARSET_INFO * cs __attribute__((unused)), + uchar *dst, size_t dstlen, uint nweights_arg, + const uchar *src, size_t srclen, uint flags) +{ + uint level; + uchar *dst0= dst; + uchar *de= dst + dstlen; + + if (!(flags & 0x0F)) /* All levels by default */ + flags|= 0x0F; + + for (level= 0; level <= 3; level++) + { + if (flags & (1 << level)) + { + uint nweights= nweights_arg; + const uchar *p= src; + int value; + uchar *dstl= dst; + + for (; dst < de && nweights; nweights--) + { + NEXT_CMP_VALUE(src, p, level, value, (int) srclen, 0); + if (value < 0) + break; + *dst++= value; + } + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint pad_length= de - dst; + set_if_smaller(pad_length, nweights); + /* fill with weight for space character */ + bfill(dst, pad_length, virtual_space[level]); + dst+= pad_length; + } + + my_strxfrm_desc_and_reverse(dstl, dst, flags, level); + + /* Add level delimiter */ + if (dst < de) + *dst++= level < 3 ? 1 : 0; + } + } + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + { + uint fill_length= de - dst; + cs->cset->fill(cs, (char*) dst, fill_length, 0); + dst= de; + } + return dst - dst0; +} + + +#undef IS_END + + +/* + */ + + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +#define min_sort_char 0x00 +#define max_sort_char 0xAE + + +static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr,size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, char *min_str, + char *max_str, + size_t *min_length,size_t *max_length) +{ + uchar value; + const char *end=ptr+ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + + for (; ptr != end && min_str != min_end ; ptr++) + { + if (*ptr == w_one) /* '_' in SQL */ + { break; } + if (*ptr == w_many) /* '%' in SQL */ + { break; } + + if (*ptr == escape && ptr+1 != end) + { ptr++; } /* Skip escape */ + + value = CZ_SORT_TABLE[0][(int) (uchar) *ptr]; + + if (value == 0) /* Ignore in the first pass */ + { continue; } + if (value <= 2) /* End of pass or end of string */ + { break; } + if (value == 255) /* Double char too compicated */ + { break; } + + *min_str++= *max_str++ = *ptr; + } + + if (cs->state & MY_CS_BINSORT) + *min_length= (size_t) (min_str - min_org); + else + { + /* 'a\0\0... is the smallest possible string */ + *min_length= res_length; + } + /* a\ff\ff... is the biggest possible string */ + *max_length= res_length; + + while (min_str != min_end) + { + *min_str++ = min_sort_char; /* Because of key compression */ + *max_str++ = max_sort_char; + } + return 0; +} + + +/* + * File generated by cset + * (C) Abandoned 1997 Zarko Mocnik + * + * definition table reworked by Jaromir Dolecek + */ + +static uchar NEAR ctype_czech[257] = { +0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 72, + 1, 16, 1, 16, 1, 1, 16, 0, 0, 1, 1, 1, 1, 16, 1, 1, + 16, 2, 16, 2, 16, 2, 2, 16, 16, 2, 2, 2, 2, 16, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 16, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 16, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 16, +}; + +static uchar NEAR to_lower_czech[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, +112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, +112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, +128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, +144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, +177,161,179,163,181,182,166,167,168,185,186,187,188,173,190,191, +176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, +224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, +208,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, +224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, +240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, +}; + +static uchar NEAR to_upper_czech[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, +128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, +144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, +160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, +176,160,178,162,180,164,165,183,184,169,170,171,172,189,174,175, +192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, +208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, +192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, +240,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255, +}; + +static uchar NEAR sort_order_czech[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 71, 72, 76, 78, 83, 84, 85, 86, 90, 91, 92, 96, 97,100, +105,106,107,110,114,117,122,123,124,125,127,131,132,133,134,135, +136, 65, 71, 72, 76, 78, 83, 84, 85, 86, 90, 91, 92, 96, 97,100, +105,106,107,110,114,117,122,123,124,125,127,137,138,139,140, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,255, + 66,255, 93,255, 94,111,255,255,255,112,113,115,128,255,129,130, +255, 66,255, 93,255, 94,111,255,255,112,113,115,128,255,129,130, +108, 67, 68, 69, 70, 95, 73, 75, 74, 79, 81, 82, 80, 89, 87, 77, +255, 98, 99,101,102,103,104,255,109,119,118,120,121,126,116,255, +108, 67, 68, 69, 70, 95, 73, 75, 74, 79, 81, 82, 80, 89, 88, 77, +255, 98, 99,101,102,103,104,255,109,119,118,120,121,126,116,255, +}; + +static uint16 tab_8859_2_uni[256]={ + 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, +0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, +0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, +0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + + +/* 0000-00FD , 254 chars */ +static uchar tab_uni_8859_2_plane00[]={ +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0xA0,0x00,0x00,0x00,0xA4,0x00,0x00,0xA7,0xA8,0x00,0x00,0x00,0x00,0xAD,0x00,0x00, +0xB0,0x00,0x00,0x00,0xB4,0x00,0x00,0x00,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0xC1,0xC2,0x00,0xC4,0x00,0x00,0xC7,0x00,0xC9,0x00,0xCB,0x00,0xCD,0xCE,0x00, +0x00,0x00,0x00,0xD3,0xD4,0x00,0xD6,0xD7,0x00,0x00,0xDA,0x00,0xDC,0xDD,0x00,0xDF, +0x00,0xE1,0xE2,0x00,0xE4,0x00,0x00,0xE7,0x00,0xE9,0x00,0xEB,0x00,0xED,0xEE,0x00, +0x00,0x00,0x00,0xF3,0xF4,0x00,0xF6,0xF7,0x00,0x00,0xFA,0x00,0xFC,0xFD}; + +/* 0102-017E , 125 chars */ +static uchar tab_uni_8859_2_plane01[]={ +0xC3,0xE3,0xA1,0xB1,0xC6,0xE6,0x00,0x00,0x00,0x00,0xC8,0xE8,0xCF,0xEF,0xD0,0xF0, +0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC5,0xE5,0x00,0x00,0xA5,0xB5,0x00,0x00,0xA3, +0xB3,0xD1,0xF1,0x00,0x00,0xD2,0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0xF5, +0x00,0x00,0xC0,0xE0,0x00,0x00,0xD8,0xF8,0xA6,0xB6,0x00,0x00,0xAA,0xBA,0xA9,0xB9, +0xDE,0xFE,0xAB,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD9,0xF9,0xDB,0xFB, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xBC,0xAF,0xBF,0xAE,0xBE}; + +/* 02C7-02DD , 23 chars */ +static uchar tab_uni_8859_2_plane02[]={ +0xB7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0xA2,0xFF,0x00,0xB2,0x00,0xBD}; + +static MY_UNI_IDX idx_uni_8859_2[]={ + {0x0000,0x00FD,tab_uni_8859_2_plane00}, + {0x0102,0x017E,tab_uni_8859_2_plane01}, + {0x02C7,0x02DD,tab_uni_8859_2_plane02}, + {0,0,NULL} +}; + + +static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler = +{ + NULL, /* init */ + my_strnncoll_czech, + my_strnncollsp_czech, + my_strnxfrm_czech, + my_strnxfrmlen_czech, + my_like_range_czech, + my_wildcmp_bin, + my_strcasecmp_8bit, + my_instr_simple, + my_hash_sort_simple, + my_propagate_simple +}; + +CHARSET_INFO my_charset_latin2_czech_ci = +{ + 2,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ + "latin2", /* cs name */ + "latin2_czech_cs", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_czech, + to_lower_czech, + to_upper_czech, + sort_order_czech, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + tab_8859_2_uni, /* tab_to_uni */ + idx_uni_8859_2, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 0, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 4, /* levels_for_compare */ + 4, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_latin2_czech_ci_handler +}; + +#endif diff --git a/externals/mysql/strings/ctype-euc_kr.c b/externals/mysql/strings/ctype-euc_kr.c new file mode 100644 index 00000000000..39a5649ac70 --- /dev/null +++ b/externals/mysql/strings/ctype-euc_kr.c @@ -0,0 +1,8810 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + * This file is for Korean EUC charset, and created by powerm90@tinc.co.kr. + * and updated by mrpark@tinc.co.kr. + */ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. mbmaxlen_euc_kr=2 + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_euckr + + +static uchar NEAR ctype_euc_kr[257] = +{ + 0, /* For standard library */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ + 0040, 0050, 0050, 0050, 0050, 0050, 0040, 0040, /* ^H - ^O */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^P - ^W */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^X - ^Z ^[ ^\ ^] ^^ ^_ */ + 0110, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* SPC ! " # $ % ^ ' */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* ( ) * + , - . / */ + 0204, 0204, 0204, 0204, 0204, 0204, 0204, 0204, /* 0 1 2 3 4 5 6 7 */ + 0204, 0204, 0020, 0020, 0020, 0020, 0020, 0020, /* 8 9 : ; < = > ? */ + 0020, 0201, 0201, 0201, 0201, 0201, 0201, 0001, /* @ A B C D E F G */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* H I J K L M N O */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* P Q R S T U V W */ + 0001, 0001, 0001, 0020, 0020, 0020, 0020, 0020, /* X Y Z [ \ ] ^ _ */ + 0020, 0202, 0202, 0202, 0202, 0202, 0202, 0002, /* ` a b c d e f g */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* h i j k l m n o */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* p q r s t u v w */ + 0002, 0002, 0002, 0020, 0020, 0020, 0020, 0040, /* x y z { | } + DEL */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, +}; + +static uchar NEAR to_lower_euc_kr[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR to_upper_euc_kr[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR sort_order_euc_kr[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +/* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */ + +/* + Unicode mapping is done according to: + ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/KSC/KSC5601.TXT + + Valid multi-byte characters: + + [A1..FE][41..5A,61..7A,81..FE] + + Note, 0x5C is not a valid MB tail, + so escape_with_backslash_is_dangerous is not set. +*/ + +#define iseuc_kr_head(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) + +#define iseuc_kr_tail1(c) ((uchar) (c) >= 0x41 && (uchar) (c) <= 0x5A) +#define iseuc_kr_tail2(c) ((uchar) (c) >= 0x61 && (uchar) (c) <= 0x7A) +#define iseuc_kr_tail3(c) ((uchar) (c) >= 0x81 && (uchar) (c) <= 0xFE) + +#define iseuc_kr_tail(c) (iseuc_kr_tail1(c) || \ + iseuc_kr_tail2(c) || \ + iseuc_kr_tail3(c)) + + +static uint ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return ((*(uchar*)(p)<0x80)? 0:\ + iseuc_kr_head(*(p)) && (e)-(p)>1 && iseuc_kr_tail(*((p)+1))? 2:\ + 0); +} + +static uint mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (iseuc_kr_head(c) ? 2 : 1); +} + + +/* page 0 0x8141-0xC8FE */ +static uint16 tab_ksc5601_uni0[]={ +0xAC02,0xAC03,0xAC05,0xAC06,0xAC0B,0xAC0C,0xAC0D,0xAC0E, +0xAC0F,0xAC18,0xAC1E,0xAC1F,0xAC21,0xAC22,0xAC23,0xAC25, +0xAC26,0xAC27,0xAC28,0xAC29,0xAC2A,0xAC2B,0xAC2E,0xAC32, +0xAC33,0xAC34, 0, 0, 0, 0, 0, 0, +0xAC35,0xAC36,0xAC37,0xAC3A,0xAC3B,0xAC3D,0xAC3E,0xAC3F, +0xAC41,0xAC42,0xAC43,0xAC44,0xAC45,0xAC46,0xAC47,0xAC48, +0xAC49,0xAC4A,0xAC4C,0xAC4E,0xAC4F,0xAC50,0xAC51,0xAC52, +0xAC53,0xAC55, 0, 0, 0, 0, 0, 0, +0xAC56,0xAC57,0xAC59,0xAC5A,0xAC5B,0xAC5D,0xAC5E,0xAC5F, +0xAC60,0xAC61,0xAC62,0xAC63,0xAC64,0xAC65,0xAC66,0xAC67, +0xAC68,0xAC69,0xAC6A,0xAC6B,0xAC6C,0xAC6D,0xAC6E,0xAC6F, +0xAC72,0xAC73,0xAC75,0xAC76,0xAC79,0xAC7B,0xAC7C,0xAC7D, +0xAC7E,0xAC7F,0xAC82,0xAC87,0xAC88,0xAC8D,0xAC8E,0xAC8F, +0xAC91,0xAC92,0xAC93,0xAC95,0xAC96,0xAC97,0xAC98,0xAC99, +0xAC9A,0xAC9B,0xAC9E,0xACA2,0xACA3,0xACA4,0xACA5,0xACA6, +0xACA7,0xACAB,0xACAD,0xACAE,0xACB1,0xACB2,0xACB3,0xACB4, +0xACB5,0xACB6,0xACB7,0xACBA,0xACBE,0xACBF,0xACC0,0xACC2, +0xACC3,0xACC5,0xACC6,0xACC7,0xACC9,0xACCA,0xACCB,0xACCD, +0xACCE,0xACCF,0xACD0,0xACD1,0xACD2,0xACD3,0xACD4,0xACD6, +0xACD8,0xACD9,0xACDA,0xACDB,0xACDC,0xACDD,0xACDE,0xACDF, +0xACE2,0xACE3,0xACE5,0xACE6,0xACE9,0xACEB,0xACED,0xACEE, +0xACF2,0xACF4,0xACF7,0xACF8,0xACF9,0xACFA,0xACFB,0xACFE, +0xACFF,0xAD01,0xAD02,0xAD03,0xAD05,0xAD07,0xAD08,0xAD09, +0xAD0A,0xAD0B,0xAD0E,0xAD10,0xAD12,0xAD13, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xAD14,0xAD15,0xAD16,0xAD17,0xAD19,0xAD1A,0xAD1B,0xAD1D, +0xAD1E,0xAD1F,0xAD21,0xAD22,0xAD23,0xAD24,0xAD25,0xAD26, +0xAD27,0xAD28,0xAD2A,0xAD2B,0xAD2E,0xAD2F,0xAD30,0xAD31, +0xAD32,0xAD33, 0, 0, 0, 0, 0, 0, +0xAD36,0xAD37,0xAD39,0xAD3A,0xAD3B,0xAD3D,0xAD3E,0xAD3F, +0xAD40,0xAD41,0xAD42,0xAD43,0xAD46,0xAD48,0xAD4A,0xAD4B, +0xAD4C,0xAD4D,0xAD4E,0xAD4F,0xAD51,0xAD52,0xAD53,0xAD55, +0xAD56,0xAD57, 0, 0, 0, 0, 0, 0, +0xAD59,0xAD5A,0xAD5B,0xAD5C,0xAD5D,0xAD5E,0xAD5F,0xAD60, +0xAD62,0xAD64,0xAD65,0xAD66,0xAD67,0xAD68,0xAD69,0xAD6A, +0xAD6B,0xAD6E,0xAD6F,0xAD71,0xAD72,0xAD77,0xAD78,0xAD79, +0xAD7A,0xAD7E,0xAD80,0xAD83,0xAD84,0xAD85,0xAD86,0xAD87, +0xAD8A,0xAD8B,0xAD8D,0xAD8E,0xAD8F,0xAD91,0xAD92,0xAD93, +0xAD94,0xAD95,0xAD96,0xAD97,0xAD98,0xAD99,0xAD9A,0xAD9B, +0xAD9E,0xAD9F,0xADA0,0xADA1,0xADA2,0xADA3,0xADA5,0xADA6, +0xADA7,0xADA8,0xADA9,0xADAA,0xADAB,0xADAC,0xADAD,0xADAE, +0xADAF,0xADB0,0xADB1,0xADB2,0xADB3,0xADB4,0xADB5,0xADB6, +0xADB8,0xADB9,0xADBA,0xADBB,0xADBC,0xADBD,0xADBE,0xADBF, +0xADC2,0xADC3,0xADC5,0xADC6,0xADC7,0xADC9,0xADCA,0xADCB, +0xADCC,0xADCD,0xADCE,0xADCF,0xADD2,0xADD4,0xADD5,0xADD6, +0xADD7,0xADD8,0xADD9,0xADDA,0xADDB,0xADDD,0xADDE,0xADDF, +0xADE1,0xADE2,0xADE3,0xADE5,0xADE6,0xADE7,0xADE8,0xADE9, +0xADEA,0xADEB,0xADEC,0xADED,0xADEE,0xADEF,0xADF0,0xADF1, +0xADF2,0xADF3,0xADF4,0xADF5,0xADF6,0xADF7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xADFA,0xADFB,0xADFD,0xADFE,0xAE02,0xAE03,0xAE04,0xAE05, +0xAE06,0xAE07,0xAE0A,0xAE0C,0xAE0E,0xAE0F,0xAE10,0xAE11, +0xAE12,0xAE13,0xAE15,0xAE16,0xAE17,0xAE18,0xAE19,0xAE1A, +0xAE1B,0xAE1C, 0, 0, 0, 0, 0, 0, +0xAE1D,0xAE1E,0xAE1F,0xAE20,0xAE21,0xAE22,0xAE23,0xAE24, +0xAE25,0xAE26,0xAE27,0xAE28,0xAE29,0xAE2A,0xAE2B,0xAE2C, +0xAE2D,0xAE2E,0xAE2F,0xAE32,0xAE33,0xAE35,0xAE36,0xAE39, +0xAE3B,0xAE3C, 0, 0, 0, 0, 0, 0, +0xAE3D,0xAE3E,0xAE3F,0xAE42,0xAE44,0xAE47,0xAE48,0xAE49, +0xAE4B,0xAE4F,0xAE51,0xAE52,0xAE53,0xAE55,0xAE57,0xAE58, +0xAE59,0xAE5A,0xAE5B,0xAE5E,0xAE62,0xAE63,0xAE64,0xAE66, +0xAE67,0xAE6A,0xAE6B,0xAE6D,0xAE6E,0xAE6F,0xAE71,0xAE72, +0xAE73,0xAE74,0xAE75,0xAE76,0xAE77,0xAE7A,0xAE7E,0xAE7F, +0xAE80,0xAE81,0xAE82,0xAE83,0xAE86,0xAE87,0xAE88,0xAE89, +0xAE8A,0xAE8B,0xAE8D,0xAE8E,0xAE8F,0xAE90,0xAE91,0xAE92, +0xAE93,0xAE94,0xAE95,0xAE96,0xAE97,0xAE98,0xAE99,0xAE9A, +0xAE9B,0xAE9C,0xAE9D,0xAE9E,0xAE9F,0xAEA0,0xAEA1,0xAEA2, +0xAEA3,0xAEA4,0xAEA5,0xAEA6,0xAEA7,0xAEA8,0xAEA9,0xAEAA, +0xAEAB,0xAEAC,0xAEAD,0xAEAE,0xAEAF,0xAEB0,0xAEB1,0xAEB2, +0xAEB3,0xAEB4,0xAEB5,0xAEB6,0xAEB7,0xAEB8,0xAEB9,0xAEBA, +0xAEBB,0xAEBF,0xAEC1,0xAEC2,0xAEC3,0xAEC5,0xAEC6,0xAEC7, +0xAEC8,0xAEC9,0xAECA,0xAECB,0xAECE,0xAED2,0xAED3,0xAED4, +0xAED5,0xAED6,0xAED7,0xAEDA,0xAEDB,0xAEDD,0xAEDE,0xAEDF, +0xAEE0,0xAEE1,0xAEE2,0xAEE3,0xAEE4,0xAEE5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xAEE6,0xAEE7,0xAEE9,0xAEEA,0xAEEC,0xAEEE,0xAEEF,0xAEF0, +0xAEF1,0xAEF2,0xAEF3,0xAEF5,0xAEF6,0xAEF7,0xAEF9,0xAEFA, +0xAEFB,0xAEFD,0xAEFE,0xAEFF,0xAF00,0xAF01,0xAF02,0xAF03, +0xAF04,0xAF05, 0, 0, 0, 0, 0, 0, +0xAF06,0xAF09,0xAF0A,0xAF0B,0xAF0C,0xAF0E,0xAF0F,0xAF11, +0xAF12,0xAF13,0xAF14,0xAF15,0xAF16,0xAF17,0xAF18,0xAF19, +0xAF1A,0xAF1B,0xAF1C,0xAF1D,0xAF1E,0xAF1F,0xAF20,0xAF21, +0xAF22,0xAF23, 0, 0, 0, 0, 0, 0, +0xAF24,0xAF25,0xAF26,0xAF27,0xAF28,0xAF29,0xAF2A,0xAF2B, +0xAF2E,0xAF2F,0xAF31,0xAF33,0xAF35,0xAF36,0xAF37,0xAF38, +0xAF39,0xAF3A,0xAF3B,0xAF3E,0xAF40,0xAF44,0xAF45,0xAF46, +0xAF47,0xAF4A,0xAF4B,0xAF4C,0xAF4D,0xAF4E,0xAF4F,0xAF51, +0xAF52,0xAF53,0xAF54,0xAF55,0xAF56,0xAF57,0xAF58,0xAF59, +0xAF5A,0xAF5B,0xAF5E,0xAF5F,0xAF60,0xAF61,0xAF62,0xAF63, +0xAF66,0xAF67,0xAF68,0xAF69,0xAF6A,0xAF6B,0xAF6C,0xAF6D, +0xAF6E,0xAF6F,0xAF70,0xAF71,0xAF72,0xAF73,0xAF74,0xAF75, +0xAF76,0xAF77,0xAF78,0xAF7A,0xAF7B,0xAF7C,0xAF7D,0xAF7E, +0xAF7F,0xAF81,0xAF82,0xAF83,0xAF85,0xAF86,0xAF87,0xAF89, +0xAF8A,0xAF8B,0xAF8C,0xAF8D,0xAF8E,0xAF8F,0xAF92,0xAF93, +0xAF94,0xAF96,0xAF97,0xAF98,0xAF99,0xAF9A,0xAF9B,0xAF9D, +0xAF9E,0xAF9F,0xAFA0,0xAFA1,0xAFA2,0xAFA3,0xAFA4,0xAFA5, +0xAFA6,0xAFA7,0xAFA8,0xAFA9,0xAFAA,0xAFAB,0xAFAC,0xAFAD, +0xAFAE,0xAFAF,0xAFB0,0xAFB1,0xAFB2,0xAFB3,0xAFB4,0xAFB5, +0xAFB6,0xAFB7,0xAFBA,0xAFBB,0xAFBD,0xAFBE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xAFBF,0xAFC1,0xAFC2,0xAFC3,0xAFC4,0xAFC5,0xAFC6,0xAFCA, +0xAFCC,0xAFCF,0xAFD0,0xAFD1,0xAFD2,0xAFD3,0xAFD5,0xAFD6, +0xAFD7,0xAFD8,0xAFD9,0xAFDA,0xAFDB,0xAFDD,0xAFDE,0xAFDF, +0xAFE0,0xAFE1, 0, 0, 0, 0, 0, 0, +0xAFE2,0xAFE3,0xAFE4,0xAFE5,0xAFE6,0xAFE7,0xAFEA,0xAFEB, +0xAFEC,0xAFED,0xAFEE,0xAFEF,0xAFF2,0xAFF3,0xAFF5,0xAFF6, +0xAFF7,0xAFF9,0xAFFA,0xAFFB,0xAFFC,0xAFFD,0xAFFE,0xAFFF, +0xB002,0xB003, 0, 0, 0, 0, 0, 0, +0xB005,0xB006,0xB007,0xB008,0xB009,0xB00A,0xB00B,0xB00D, +0xB00E,0xB00F,0xB011,0xB012,0xB013,0xB015,0xB016,0xB017, +0xB018,0xB019,0xB01A,0xB01B,0xB01E,0xB01F,0xB020,0xB021, +0xB022,0xB023,0xB024,0xB025,0xB026,0xB027,0xB029,0xB02A, +0xB02B,0xB02C,0xB02D,0xB02E,0xB02F,0xB030,0xB031,0xB032, +0xB033,0xB034,0xB035,0xB036,0xB037,0xB038,0xB039,0xB03A, +0xB03B,0xB03C,0xB03D,0xB03E,0xB03F,0xB040,0xB041,0xB042, +0xB043,0xB046,0xB047,0xB049,0xB04B,0xB04D,0xB04F,0xB050, +0xB051,0xB052,0xB056,0xB058,0xB05A,0xB05B,0xB05C,0xB05E, +0xB05F,0xB060,0xB061,0xB062,0xB063,0xB064,0xB065,0xB066, +0xB067,0xB068,0xB069,0xB06A,0xB06B,0xB06C,0xB06D,0xB06E, +0xB06F,0xB070,0xB071,0xB072,0xB073,0xB074,0xB075,0xB076, +0xB077,0xB078,0xB079,0xB07A,0xB07B,0xB07E,0xB07F,0xB081, +0xB082,0xB083,0xB085,0xB086,0xB087,0xB088,0xB089,0xB08A, +0xB08B,0xB08E,0xB090,0xB092,0xB093,0xB094,0xB095,0xB096, +0xB097,0xB09B,0xB09D,0xB09E,0xB0A3,0xB0A4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB0A5,0xB0A6,0xB0A7,0xB0AA,0xB0B0,0xB0B2,0xB0B6,0xB0B7, +0xB0B9,0xB0BA,0xB0BB,0xB0BD,0xB0BE,0xB0BF,0xB0C0,0xB0C1, +0xB0C2,0xB0C3,0xB0C6,0xB0CA,0xB0CB,0xB0CC,0xB0CD,0xB0CE, +0xB0CF,0xB0D2, 0, 0, 0, 0, 0, 0, +0xB0D3,0xB0D5,0xB0D6,0xB0D7,0xB0D9,0xB0DA,0xB0DB,0xB0DC, +0xB0DD,0xB0DE,0xB0DF,0xB0E1,0xB0E2,0xB0E3,0xB0E4,0xB0E6, +0xB0E7,0xB0E8,0xB0E9,0xB0EA,0xB0EB,0xB0EC,0xB0ED,0xB0EE, +0xB0EF,0xB0F0, 0, 0, 0, 0, 0, 0, +0xB0F1,0xB0F2,0xB0F3,0xB0F4,0xB0F5,0xB0F6,0xB0F7,0xB0F8, +0xB0F9,0xB0FA,0xB0FB,0xB0FC,0xB0FD,0xB0FE,0xB0FF,0xB100, +0xB101,0xB102,0xB103,0xB104,0xB105,0xB106,0xB107,0xB10A, +0xB10D,0xB10E,0xB10F,0xB111,0xB114,0xB115,0xB116,0xB117, +0xB11A,0xB11E,0xB11F,0xB120,0xB121,0xB122,0xB126,0xB127, +0xB129,0xB12A,0xB12B,0xB12D,0xB12E,0xB12F,0xB130,0xB131, +0xB132,0xB133,0xB136,0xB13A,0xB13B,0xB13C,0xB13D,0xB13E, +0xB13F,0xB142,0xB143,0xB145,0xB146,0xB147,0xB149,0xB14A, +0xB14B,0xB14C,0xB14D,0xB14E,0xB14F,0xB152,0xB153,0xB156, +0xB157,0xB159,0xB15A,0xB15B,0xB15D,0xB15E,0xB15F,0xB161, +0xB162,0xB163,0xB164,0xB165,0xB166,0xB167,0xB168,0xB169, +0xB16A,0xB16B,0xB16C,0xB16D,0xB16E,0xB16F,0xB170,0xB171, +0xB172,0xB173,0xB174,0xB175,0xB176,0xB177,0xB17A,0xB17B, +0xB17D,0xB17E,0xB17F,0xB181,0xB183,0xB184,0xB185,0xB186, +0xB187,0xB18A,0xB18C,0xB18E,0xB18F,0xB190,0xB191,0xB195, +0xB196,0xB197,0xB199,0xB19A,0xB19B,0xB19D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB19E,0xB19F,0xB1A0,0xB1A1,0xB1A2,0xB1A3,0xB1A4,0xB1A5, +0xB1A6,0xB1A7,0xB1A9,0xB1AA,0xB1AB,0xB1AC,0xB1AD,0xB1AE, +0xB1AF,0xB1B0,0xB1B1,0xB1B2,0xB1B3,0xB1B4,0xB1B5,0xB1B6, +0xB1B7,0xB1B8, 0, 0, 0, 0, 0, 0, +0xB1B9,0xB1BA,0xB1BB,0xB1BC,0xB1BD,0xB1BE,0xB1BF,0xB1C0, +0xB1C1,0xB1C2,0xB1C3,0xB1C4,0xB1C5,0xB1C6,0xB1C7,0xB1C8, +0xB1C9,0xB1CA,0xB1CB,0xB1CD,0xB1CE,0xB1CF,0xB1D1,0xB1D2, +0xB1D3,0xB1D5, 0, 0, 0, 0, 0, 0, +0xB1D6,0xB1D7,0xB1D8,0xB1D9,0xB1DA,0xB1DB,0xB1DE,0xB1E0, +0xB1E1,0xB1E2,0xB1E3,0xB1E4,0xB1E5,0xB1E6,0xB1E7,0xB1EA, +0xB1EB,0xB1ED,0xB1EE,0xB1EF,0xB1F1,0xB1F2,0xB1F3,0xB1F4, +0xB1F5,0xB1F6,0xB1F7,0xB1F8,0xB1FA,0xB1FC,0xB1FE,0xB1FF, +0xB200,0xB201,0xB202,0xB203,0xB206,0xB207,0xB209,0xB20A, +0xB20D,0xB20E,0xB20F,0xB210,0xB211,0xB212,0xB213,0xB216, +0xB218,0xB21A,0xB21B,0xB21C,0xB21D,0xB21E,0xB21F,0xB221, +0xB222,0xB223,0xB224,0xB225,0xB226,0xB227,0xB228,0xB229, +0xB22A,0xB22B,0xB22C,0xB22D,0xB22E,0xB22F,0xB230,0xB231, +0xB232,0xB233,0xB235,0xB236,0xB237,0xB238,0xB239,0xB23A, +0xB23B,0xB23D,0xB23E,0xB23F,0xB240,0xB241,0xB242,0xB243, +0xB244,0xB245,0xB246,0xB247,0xB248,0xB249,0xB24A,0xB24B, +0xB24C,0xB24D,0xB24E,0xB24F,0xB250,0xB251,0xB252,0xB253, +0xB254,0xB255,0xB256,0xB257,0xB259,0xB25A,0xB25B,0xB25D, +0xB25E,0xB25F,0xB261,0xB262,0xB263,0xB264,0xB265,0xB266, +0xB267,0xB26A,0xB26B,0xB26C,0xB26D,0xB26E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB26F,0xB270,0xB271,0xB272,0xB273,0xB276,0xB277,0xB278, +0xB279,0xB27A,0xB27B,0xB27D,0xB27E,0xB27F,0xB280,0xB281, +0xB282,0xB283,0xB286,0xB287,0xB288,0xB28A,0xB28B,0xB28C, +0xB28D,0xB28E, 0, 0, 0, 0, 0, 0, +0xB28F,0xB292,0xB293,0xB295,0xB296,0xB297,0xB29B,0xB29C, +0xB29D,0xB29E,0xB29F,0xB2A2,0xB2A4,0xB2A7,0xB2A8,0xB2A9, +0xB2AB,0xB2AD,0xB2AE,0xB2AF,0xB2B1,0xB2B2,0xB2B3,0xB2B5, +0xB2B6,0xB2B7, 0, 0, 0, 0, 0, 0, +0xB2B8,0xB2B9,0xB2BA,0xB2BB,0xB2BC,0xB2BD,0xB2BE,0xB2BF, +0xB2C0,0xB2C1,0xB2C2,0xB2C3,0xB2C4,0xB2C5,0xB2C6,0xB2C7, +0xB2CA,0xB2CB,0xB2CD,0xB2CE,0xB2CF,0xB2D1,0xB2D3,0xB2D4, +0xB2D5,0xB2D6,0xB2D7,0xB2DA,0xB2DC,0xB2DE,0xB2DF,0xB2E0, +0xB2E1,0xB2E3,0xB2E7,0xB2E9,0xB2EA,0xB2F0,0xB2F1,0xB2F2, +0xB2F6,0xB2FC,0xB2FD,0xB2FE,0xB302,0xB303,0xB305,0xB306, +0xB307,0xB309,0xB30A,0xB30B,0xB30C,0xB30D,0xB30E,0xB30F, +0xB312,0xB316,0xB317,0xB318,0xB319,0xB31A,0xB31B,0xB31D, +0xB31E,0xB31F,0xB320,0xB321,0xB322,0xB323,0xB324,0xB325, +0xB326,0xB327,0xB328,0xB329,0xB32A,0xB32B,0xB32C,0xB32D, +0xB32E,0xB32F,0xB330,0xB331,0xB332,0xB333,0xB334,0xB335, +0xB336,0xB337,0xB338,0xB339,0xB33A,0xB33B,0xB33C,0xB33D, +0xB33E,0xB33F,0xB340,0xB341,0xB342,0xB343,0xB344,0xB345, +0xB346,0xB347,0xB348,0xB349,0xB34A,0xB34B,0xB34C,0xB34D, +0xB34E,0xB34F,0xB350,0xB351,0xB352,0xB353,0xB357,0xB359, +0xB35A,0xB35D,0xB360,0xB361,0xB362,0xB363, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB366,0xB368,0xB36A,0xB36C,0xB36D,0xB36F,0xB372,0xB373, +0xB375,0xB376,0xB377,0xB379,0xB37A,0xB37B,0xB37C,0xB37D, +0xB37E,0xB37F,0xB382,0xB386,0xB387,0xB388,0xB389,0xB38A, +0xB38B,0xB38D, 0, 0, 0, 0, 0, 0, +0xB38E,0xB38F,0xB391,0xB392,0xB393,0xB395,0xB396,0xB397, +0xB398,0xB399,0xB39A,0xB39B,0xB39C,0xB39D,0xB39E,0xB39F, +0xB3A2,0xB3A3,0xB3A4,0xB3A5,0xB3A6,0xB3A7,0xB3A9,0xB3AA, +0xB3AB,0xB3AD, 0, 0, 0, 0, 0, 0, +0xB3AE,0xB3AF,0xB3B0,0xB3B1,0xB3B2,0xB3B3,0xB3B4,0xB3B5, +0xB3B6,0xB3B7,0xB3B8,0xB3B9,0xB3BA,0xB3BB,0xB3BC,0xB3BD, +0xB3BE,0xB3BF,0xB3C0,0xB3C1,0xB3C2,0xB3C3,0xB3C6,0xB3C7, +0xB3C9,0xB3CA,0xB3CD,0xB3CF,0xB3D1,0xB3D2,0xB3D3,0xB3D6, +0xB3D8,0xB3DA,0xB3DC,0xB3DE,0xB3DF,0xB3E1,0xB3E2,0xB3E3, +0xB3E5,0xB3E6,0xB3E7,0xB3E9,0xB3EA,0xB3EB,0xB3EC,0xB3ED, +0xB3EE,0xB3EF,0xB3F0,0xB3F1,0xB3F2,0xB3F3,0xB3F4,0xB3F5, +0xB3F6,0xB3F7,0xB3F8,0xB3F9,0xB3FA,0xB3FB,0xB3FD,0xB3FE, +0xB3FF,0xB400,0xB401,0xB402,0xB403,0xB404,0xB405,0xB406, +0xB407,0xB408,0xB409,0xB40A,0xB40B,0xB40C,0xB40D,0xB40E, +0xB40F,0xB411,0xB412,0xB413,0xB414,0xB415,0xB416,0xB417, +0xB419,0xB41A,0xB41B,0xB41D,0xB41E,0xB41F,0xB421,0xB422, +0xB423,0xB424,0xB425,0xB426,0xB427,0xB42A,0xB42C,0xB42D, +0xB42E,0xB42F,0xB430,0xB431,0xB432,0xB433,0xB435,0xB436, +0xB437,0xB438,0xB439,0xB43A,0xB43B,0xB43C,0xB43D,0xB43E, +0xB43F,0xB440,0xB441,0xB442,0xB443,0xB444, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB445,0xB446,0xB447,0xB448,0xB449,0xB44A,0xB44B,0xB44C, +0xB44D,0xB44E,0xB44F,0xB452,0xB453,0xB455,0xB456,0xB457, +0xB459,0xB45A,0xB45B,0xB45C,0xB45D,0xB45E,0xB45F,0xB462, +0xB464,0xB466, 0, 0, 0, 0, 0, 0, +0xB467,0xB468,0xB469,0xB46A,0xB46B,0xB46D,0xB46E,0xB46F, +0xB470,0xB471,0xB472,0xB473,0xB474,0xB475,0xB476,0xB477, +0xB478,0xB479,0xB47A,0xB47B,0xB47C,0xB47D,0xB47E,0xB47F, +0xB481,0xB482, 0, 0, 0, 0, 0, 0, +0xB483,0xB484,0xB485,0xB486,0xB487,0xB489,0xB48A,0xB48B, +0xB48C,0xB48D,0xB48E,0xB48F,0xB490,0xB491,0xB492,0xB493, +0xB494,0xB495,0xB496,0xB497,0xB498,0xB499,0xB49A,0xB49B, +0xB49C,0xB49E,0xB49F,0xB4A0,0xB4A1,0xB4A2,0xB4A3,0xB4A5, +0xB4A6,0xB4A7,0xB4A9,0xB4AA,0xB4AB,0xB4AD,0xB4AE,0xB4AF, +0xB4B0,0xB4B1,0xB4B2,0xB4B3,0xB4B4,0xB4B6,0xB4B8,0xB4BA, +0xB4BB,0xB4BC,0xB4BD,0xB4BE,0xB4BF,0xB4C1,0xB4C2,0xB4C3, +0xB4C5,0xB4C6,0xB4C7,0xB4C9,0xB4CA,0xB4CB,0xB4CC,0xB4CD, +0xB4CE,0xB4CF,0xB4D1,0xB4D2,0xB4D3,0xB4D4,0xB4D6,0xB4D7, +0xB4D8,0xB4D9,0xB4DA,0xB4DB,0xB4DE,0xB4DF,0xB4E1,0xB4E2, +0xB4E5,0xB4E7,0xB4E8,0xB4E9,0xB4EA,0xB4EB,0xB4EE,0xB4F0, +0xB4F2,0xB4F3,0xB4F4,0xB4F5,0xB4F6,0xB4F7,0xB4F9,0xB4FA, +0xB4FB,0xB4FC,0xB4FD,0xB4FE,0xB4FF,0xB500,0xB501,0xB502, +0xB503,0xB504,0xB505,0xB506,0xB507,0xB508,0xB509,0xB50A, +0xB50B,0xB50C,0xB50D,0xB50E,0xB50F,0xB510,0xB511,0xB512, +0xB513,0xB516,0xB517,0xB519,0xB51A,0xB51D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB51E,0xB51F,0xB520,0xB521,0xB522,0xB523,0xB526,0xB52B, +0xB52C,0xB52D,0xB52E,0xB52F,0xB532,0xB533,0xB535,0xB536, +0xB537,0xB539,0xB53A,0xB53B,0xB53C,0xB53D,0xB53E,0xB53F, +0xB542,0xB546, 0, 0, 0, 0, 0, 0, +0xB547,0xB548,0xB549,0xB54A,0xB54E,0xB54F,0xB551,0xB552, +0xB553,0xB555,0xB556,0xB557,0xB558,0xB559,0xB55A,0xB55B, +0xB55E,0xB562,0xB563,0xB564,0xB565,0xB566,0xB567,0xB568, +0xB569,0xB56A, 0, 0, 0, 0, 0, 0, +0xB56B,0xB56C,0xB56D,0xB56E,0xB56F,0xB570,0xB571,0xB572, +0xB573,0xB574,0xB575,0xB576,0xB577,0xB578,0xB579,0xB57A, +0xB57B,0xB57C,0xB57D,0xB57E,0xB57F,0xB580,0xB581,0xB582, +0xB583,0xB584,0xB585,0xB586,0xB587,0xB588,0xB589,0xB58A, +0xB58B,0xB58C,0xB58D,0xB58E,0xB58F,0xB590,0xB591,0xB592, +0xB593,0xB594,0xB595,0xB596,0xB597,0xB598,0xB599,0xB59A, +0xB59B,0xB59C,0xB59D,0xB59E,0xB59F,0xB5A2,0xB5A3,0xB5A5, +0xB5A6,0xB5A7,0xB5A9,0xB5AC,0xB5AD,0xB5AE,0xB5AF,0xB5B2, +0xB5B6,0xB5B7,0xB5B8,0xB5B9,0xB5BA,0xB5BE,0xB5BF,0xB5C1, +0xB5C2,0xB5C3,0xB5C5,0xB5C6,0xB5C7,0xB5C8,0xB5C9,0xB5CA, +0xB5CB,0xB5CE,0xB5D2,0xB5D3,0xB5D4,0xB5D5,0xB5D6,0xB5D7, +0xB5D9,0xB5DA,0xB5DB,0xB5DC,0xB5DD,0xB5DE,0xB5DF,0xB5E0, +0xB5E1,0xB5E2,0xB5E3,0xB5E4,0xB5E5,0xB5E6,0xB5E7,0xB5E8, +0xB5E9,0xB5EA,0xB5EB,0xB5ED,0xB5EE,0xB5EF,0xB5F0,0xB5F1, +0xB5F2,0xB5F3,0xB5F4,0xB5F5,0xB5F6,0xB5F7,0xB5F8,0xB5F9, +0xB5FA,0xB5FB,0xB5FC,0xB5FD,0xB5FE,0xB5FF, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB600,0xB601,0xB602,0xB603,0xB604,0xB605,0xB606,0xB607, +0xB608,0xB609,0xB60A,0xB60B,0xB60C,0xB60D,0xB60E,0xB60F, +0xB612,0xB613,0xB615,0xB616,0xB617,0xB619,0xB61A,0xB61B, +0xB61C,0xB61D, 0, 0, 0, 0, 0, 0, +0xB61E,0xB61F,0xB620,0xB621,0xB622,0xB623,0xB624,0xB626, +0xB627,0xB628,0xB629,0xB62A,0xB62B,0xB62D,0xB62E,0xB62F, +0xB630,0xB631,0xB632,0xB633,0xB635,0xB636,0xB637,0xB638, +0xB639,0xB63A, 0, 0, 0, 0, 0, 0, +0xB63B,0xB63C,0xB63D,0xB63E,0xB63F,0xB640,0xB641,0xB642, +0xB643,0xB644,0xB645,0xB646,0xB647,0xB649,0xB64A,0xB64B, +0xB64C,0xB64D,0xB64E,0xB64F,0xB650,0xB651,0xB652,0xB653, +0xB654,0xB655,0xB656,0xB657,0xB658,0xB659,0xB65A,0xB65B, +0xB65C,0xB65D,0xB65E,0xB65F,0xB660,0xB661,0xB662,0xB663, +0xB665,0xB666,0xB667,0xB669,0xB66A,0xB66B,0xB66C,0xB66D, +0xB66E,0xB66F,0xB670,0xB671,0xB672,0xB673,0xB674,0xB675, +0xB676,0xB677,0xB678,0xB679,0xB67A,0xB67B,0xB67C,0xB67D, +0xB67E,0xB67F,0xB680,0xB681,0xB682,0xB683,0xB684,0xB685, +0xB686,0xB687,0xB688,0xB689,0xB68A,0xB68B,0xB68C,0xB68D, +0xB68E,0xB68F,0xB690,0xB691,0xB692,0xB693,0xB694,0xB695, +0xB696,0xB697,0xB698,0xB699,0xB69A,0xB69B,0xB69E,0xB69F, +0xB6A1,0xB6A2,0xB6A3,0xB6A5,0xB6A6,0xB6A7,0xB6A8,0xB6A9, +0xB6AA,0xB6AD,0xB6AE,0xB6AF,0xB6B0,0xB6B2,0xB6B3,0xB6B4, +0xB6B5,0xB6B6,0xB6B7,0xB6B8,0xB6B9,0xB6BA,0xB6BB,0xB6BC, +0xB6BD,0xB6BE,0xB6BF,0xB6C0,0xB6C1,0xB6C2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB6C3,0xB6C4,0xB6C5,0xB6C6,0xB6C7,0xB6C8,0xB6C9,0xB6CA, +0xB6CB,0xB6CC,0xB6CD,0xB6CE,0xB6CF,0xB6D0,0xB6D1,0xB6D2, +0xB6D3,0xB6D5,0xB6D6,0xB6D7,0xB6D8,0xB6D9,0xB6DA,0xB6DB, +0xB6DC,0xB6DD, 0, 0, 0, 0, 0, 0, +0xB6DE,0xB6DF,0xB6E0,0xB6E1,0xB6E2,0xB6E3,0xB6E4,0xB6E5, +0xB6E6,0xB6E7,0xB6E8,0xB6E9,0xB6EA,0xB6EB,0xB6EC,0xB6ED, +0xB6EE,0xB6EF,0xB6F1,0xB6F2,0xB6F3,0xB6F5,0xB6F6,0xB6F7, +0xB6F9,0xB6FA, 0, 0, 0, 0, 0, 0, +0xB6FB,0xB6FC,0xB6FD,0xB6FE,0xB6FF,0xB702,0xB703,0xB704, +0xB706,0xB707,0xB708,0xB709,0xB70A,0xB70B,0xB70C,0xB70D, +0xB70E,0xB70F,0xB710,0xB711,0xB712,0xB713,0xB714,0xB715, +0xB716,0xB717,0xB718,0xB719,0xB71A,0xB71B,0xB71C,0xB71D, +0xB71E,0xB71F,0xB720,0xB721,0xB722,0xB723,0xB724,0xB725, +0xB726,0xB727,0xB72A,0xB72B,0xB72D,0xB72E,0xB731,0xB732, +0xB733,0xB734,0xB735,0xB736,0xB737,0xB73A,0xB73C,0xB73D, +0xB73E,0xB73F,0xB740,0xB741,0xB742,0xB743,0xB745,0xB746, +0xB747,0xB749,0xB74A,0xB74B,0xB74D,0xB74E,0xB74F,0xB750, +0xB751,0xB752,0xB753,0xB756,0xB757,0xB758,0xB759,0xB75A, +0xB75B,0xB75C,0xB75D,0xB75E,0xB75F,0xB761,0xB762,0xB763, +0xB765,0xB766,0xB767,0xB769,0xB76A,0xB76B,0xB76C,0xB76D, +0xB76E,0xB76F,0xB772,0xB774,0xB776,0xB777,0xB778,0xB779, +0xB77A,0xB77B,0xB77E,0xB77F,0xB781,0xB782,0xB783,0xB785, +0xB786,0xB787,0xB788,0xB789,0xB78A,0xB78B,0xB78E,0xB793, +0xB794,0xB795,0xB79A,0xB79B,0xB79D,0xB79E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB79F,0xB7A1,0xB7A2,0xB7A3,0xB7A4,0xB7A5,0xB7A6,0xB7A7, +0xB7AA,0xB7AE,0xB7AF,0xB7B0,0xB7B1,0xB7B2,0xB7B3,0xB7B6, +0xB7B7,0xB7B9,0xB7BA,0xB7BB,0xB7BC,0xB7BD,0xB7BE,0xB7BF, +0xB7C0,0xB7C1, 0, 0, 0, 0, 0, 0, +0xB7C2,0xB7C3,0xB7C4,0xB7C5,0xB7C6,0xB7C8,0xB7CA,0xB7CB, +0xB7CC,0xB7CD,0xB7CE,0xB7CF,0xB7D0,0xB7D1,0xB7D2,0xB7D3, +0xB7D4,0xB7D5,0xB7D6,0xB7D7,0xB7D8,0xB7D9,0xB7DA,0xB7DB, +0xB7DC,0xB7DD, 0, 0, 0, 0, 0, 0, +0xB7DE,0xB7DF,0xB7E0,0xB7E1,0xB7E2,0xB7E3,0xB7E4,0xB7E5, +0xB7E6,0xB7E7,0xB7E8,0xB7E9,0xB7EA,0xB7EB,0xB7EE,0xB7EF, +0xB7F1,0xB7F2,0xB7F3,0xB7F5,0xB7F6,0xB7F7,0xB7F8,0xB7F9, +0xB7FA,0xB7FB,0xB7FE,0xB802,0xB803,0xB804,0xB805,0xB806, +0xB80A,0xB80B,0xB80D,0xB80E,0xB80F,0xB811,0xB812,0xB813, +0xB814,0xB815,0xB816,0xB817,0xB81A,0xB81C,0xB81E,0xB81F, +0xB820,0xB821,0xB822,0xB823,0xB826,0xB827,0xB829,0xB82A, +0xB82B,0xB82D,0xB82E,0xB82F,0xB830,0xB831,0xB832,0xB833, +0xB836,0xB83A,0xB83B,0xB83C,0xB83D,0xB83E,0xB83F,0xB841, +0xB842,0xB843,0xB845,0xB846,0xB847,0xB848,0xB849,0xB84A, +0xB84B,0xB84C,0xB84D,0xB84E,0xB84F,0xB850,0xB852,0xB854, +0xB855,0xB856,0xB857,0xB858,0xB859,0xB85A,0xB85B,0xB85E, +0xB85F,0xB861,0xB862,0xB863,0xB865,0xB866,0xB867,0xB868, +0xB869,0xB86A,0xB86B,0xB86E,0xB870,0xB872,0xB873,0xB874, +0xB875,0xB876,0xB877,0xB879,0xB87A,0xB87B,0xB87D,0xB87E, +0xB87F,0xB880,0xB881,0xB882,0xB883,0xB884, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB885,0xB886,0xB887,0xB888,0xB889,0xB88A,0xB88B,0xB88C, +0xB88E,0xB88F,0xB890,0xB891,0xB892,0xB893,0xB894,0xB895, +0xB896,0xB897,0xB898,0xB899,0xB89A,0xB89B,0xB89C,0xB89D, +0xB89E,0xB89F, 0, 0, 0, 0, 0, 0, +0xB8A0,0xB8A1,0xB8A2,0xB8A3,0xB8A4,0xB8A5,0xB8A6,0xB8A7, +0xB8A9,0xB8AA,0xB8AB,0xB8AC,0xB8AD,0xB8AE,0xB8AF,0xB8B1, +0xB8B2,0xB8B3,0xB8B5,0xB8B6,0xB8B7,0xB8B9,0xB8BA,0xB8BB, +0xB8BC,0xB8BD, 0, 0, 0, 0, 0, 0, +0xB8BE,0xB8BF,0xB8C2,0xB8C4,0xB8C6,0xB8C7,0xB8C8,0xB8C9, +0xB8CA,0xB8CB,0xB8CD,0xB8CE,0xB8CF,0xB8D1,0xB8D2,0xB8D3, +0xB8D5,0xB8D6,0xB8D7,0xB8D8,0xB8D9,0xB8DA,0xB8DB,0xB8DC, +0xB8DE,0xB8E0,0xB8E2,0xB8E3,0xB8E4,0xB8E5,0xB8E6,0xB8E7, +0xB8EA,0xB8EB,0xB8ED,0xB8EE,0xB8EF,0xB8F1,0xB8F2,0xB8F3, +0xB8F4,0xB8F5,0xB8F6,0xB8F7,0xB8FA,0xB8FC,0xB8FE,0xB8FF, +0xB900,0xB901,0xB902,0xB903,0xB905,0xB906,0xB907,0xB908, +0xB909,0xB90A,0xB90B,0xB90C,0xB90D,0xB90E,0xB90F,0xB910, +0xB911,0xB912,0xB913,0xB914,0xB915,0xB916,0xB917,0xB919, +0xB91A,0xB91B,0xB91C,0xB91D,0xB91E,0xB91F,0xB921,0xB922, +0xB923,0xB924,0xB925,0xB926,0xB927,0xB928,0xB929,0xB92A, +0xB92B,0xB92C,0xB92D,0xB92E,0xB92F,0xB930,0xB931,0xB932, +0xB933,0xB934,0xB935,0xB936,0xB937,0xB938,0xB939,0xB93A, +0xB93B,0xB93E,0xB93F,0xB941,0xB942,0xB943,0xB945,0xB946, +0xB947,0xB948,0xB949,0xB94A,0xB94B,0xB94D,0xB94E,0xB950, +0xB952,0xB953,0xB954,0xB955,0xB956,0xB957, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xB95A,0xB95B,0xB95D,0xB95E,0xB95F,0xB961,0xB962,0xB963, +0xB964,0xB965,0xB966,0xB967,0xB96A,0xB96C,0xB96E,0xB96F, +0xB970,0xB971,0xB972,0xB973,0xB976,0xB977,0xB979,0xB97A, +0xB97B,0xB97D, 0, 0, 0, 0, 0, 0, +0xB97E,0xB97F,0xB980,0xB981,0xB982,0xB983,0xB986,0xB988, +0xB98B,0xB98C,0xB98F,0xB990,0xB991,0xB992,0xB993,0xB994, +0xB995,0xB996,0xB997,0xB998,0xB999,0xB99A,0xB99B,0xB99C, +0xB99D,0xB99E, 0, 0, 0, 0, 0, 0, +0xB99F,0xB9A0,0xB9A1,0xB9A2,0xB9A3,0xB9A4,0xB9A5,0xB9A6, +0xB9A7,0xB9A8,0xB9A9,0xB9AA,0xB9AB,0xB9AE,0xB9AF,0xB9B1, +0xB9B2,0xB9B3,0xB9B5,0xB9B6,0xB9B7,0xB9B8,0xB9B9,0xB9BA, +0xB9BB,0xB9BE,0xB9C0,0xB9C2,0xB9C3,0xB9C4,0xB9C5,0xB9C6, +0xB9C7,0xB9CA,0xB9CB,0xB9CD,0xB9D3,0xB9D4,0xB9D5,0xB9D6, +0xB9D7,0xB9DA,0xB9DC,0xB9DF,0xB9E0,0xB9E2,0xB9E6,0xB9E7, +0xB9E9,0xB9EA,0xB9EB,0xB9ED,0xB9EE,0xB9EF,0xB9F0,0xB9F1, +0xB9F2,0xB9F3,0xB9F6,0xB9FB,0xB9FC,0xB9FD,0xB9FE,0xB9FF, +0xBA02,0xBA03,0xBA04,0xBA05,0xBA06,0xBA07,0xBA09,0xBA0A, +0xBA0B,0xBA0C,0xBA0D,0xBA0E,0xBA0F,0xBA10,0xBA11,0xBA12, +0xBA13,0xBA14,0xBA16,0xBA17,0xBA18,0xBA19,0xBA1A,0xBA1B, +0xBA1C,0xBA1D,0xBA1E,0xBA1F,0xBA20,0xBA21,0xBA22,0xBA23, +0xBA24,0xBA25,0xBA26,0xBA27,0xBA28,0xBA29,0xBA2A,0xBA2B, +0xBA2C,0xBA2D,0xBA2E,0xBA2F,0xBA30,0xBA31,0xBA32,0xBA33, +0xBA34,0xBA35,0xBA36,0xBA37,0xBA3A,0xBA3B,0xBA3D,0xBA3E, +0xBA3F,0xBA41,0xBA43,0xBA44,0xBA45,0xBA46, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBA47,0xBA4A,0xBA4C,0xBA4F,0xBA50,0xBA51,0xBA52,0xBA56, +0xBA57,0xBA59,0xBA5A,0xBA5B,0xBA5D,0xBA5E,0xBA5F,0xBA60, +0xBA61,0xBA62,0xBA63,0xBA66,0xBA6A,0xBA6B,0xBA6C,0xBA6D, +0xBA6E,0xBA6F, 0, 0, 0, 0, 0, 0, +0xBA72,0xBA73,0xBA75,0xBA76,0xBA77,0xBA79,0xBA7A,0xBA7B, +0xBA7C,0xBA7D,0xBA7E,0xBA7F,0xBA80,0xBA81,0xBA82,0xBA86, +0xBA88,0xBA89,0xBA8A,0xBA8B,0xBA8D,0xBA8E,0xBA8F,0xBA90, +0xBA91,0xBA92, 0, 0, 0, 0, 0, 0, +0xBA93,0xBA94,0xBA95,0xBA96,0xBA97,0xBA98,0xBA99,0xBA9A, +0xBA9B,0xBA9C,0xBA9D,0xBA9E,0xBA9F,0xBAA0,0xBAA1,0xBAA2, +0xBAA3,0xBAA4,0xBAA5,0xBAA6,0xBAA7,0xBAAA,0xBAAD,0xBAAE, +0xBAAF,0xBAB1,0xBAB3,0xBAB4,0xBAB5,0xBAB6,0xBAB7,0xBABA, +0xBABC,0xBABE,0xBABF,0xBAC0,0xBAC1,0xBAC2,0xBAC3,0xBAC5, +0xBAC6,0xBAC7,0xBAC9,0xBACA,0xBACB,0xBACC,0xBACD,0xBACE, +0xBACF,0xBAD0,0xBAD1,0xBAD2,0xBAD3,0xBAD4,0xBAD5,0xBAD6, +0xBAD7,0xBADA,0xBADB,0xBADC,0xBADD,0xBADE,0xBADF,0xBAE0, +0xBAE1,0xBAE2,0xBAE3,0xBAE4,0xBAE5,0xBAE6,0xBAE7,0xBAE8, +0xBAE9,0xBAEA,0xBAEB,0xBAEC,0xBAED,0xBAEE,0xBAEF,0xBAF0, +0xBAF1,0xBAF2,0xBAF3,0xBAF4,0xBAF5,0xBAF6,0xBAF7,0xBAF8, +0xBAF9,0xBAFA,0xBAFB,0xBAFD,0xBAFE,0xBAFF,0xBB01,0xBB02, +0xBB03,0xBB05,0xBB06,0xBB07,0xBB08,0xBB09,0xBB0A,0xBB0B, +0xBB0C,0xBB0E,0xBB10,0xBB12,0xBB13,0xBB14,0xBB15,0xBB16, +0xBB17,0xBB19,0xBB1A,0xBB1B,0xBB1D,0xBB1E,0xBB1F,0xBB21, +0xBB22,0xBB23,0xBB24,0xBB25,0xBB26,0xBB27, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBB28,0xBB2A,0xBB2C,0xBB2D,0xBB2E,0xBB2F,0xBB30,0xBB31, +0xBB32,0xBB33,0xBB37,0xBB39,0xBB3A,0xBB3F,0xBB40,0xBB41, +0xBB42,0xBB43,0xBB46,0xBB48,0xBB4A,0xBB4B,0xBB4C,0xBB4E, +0xBB51,0xBB52, 0, 0, 0, 0, 0, 0, +0xBB53,0xBB55,0xBB56,0xBB57,0xBB59,0xBB5A,0xBB5B,0xBB5C, +0xBB5D,0xBB5E,0xBB5F,0xBB60,0xBB62,0xBB64,0xBB65,0xBB66, +0xBB67,0xBB68,0xBB69,0xBB6A,0xBB6B,0xBB6D,0xBB6E,0xBB6F, +0xBB70,0xBB71, 0, 0, 0, 0, 0, 0, +0xBB72,0xBB73,0xBB74,0xBB75,0xBB76,0xBB77,0xBB78,0xBB79, +0xBB7A,0xBB7B,0xBB7C,0xBB7D,0xBB7E,0xBB7F,0xBB80,0xBB81, +0xBB82,0xBB83,0xBB84,0xBB85,0xBB86,0xBB87,0xBB89,0xBB8A, +0xBB8B,0xBB8D,0xBB8E,0xBB8F,0xBB91,0xBB92,0xBB93,0xBB94, +0xBB95,0xBB96,0xBB97,0xBB98,0xBB99,0xBB9A,0xBB9B,0xBB9C, +0xBB9D,0xBB9E,0xBB9F,0xBBA0,0xBBA1,0xBBA2,0xBBA3,0xBBA5, +0xBBA6,0xBBA7,0xBBA9,0xBBAA,0xBBAB,0xBBAD,0xBBAE,0xBBAF, +0xBBB0,0xBBB1,0xBBB2,0xBBB3,0xBBB5,0xBBB6,0xBBB8,0xBBB9, +0xBBBA,0xBBBB,0xBBBC,0xBBBD,0xBBBE,0xBBBF,0xBBC1,0xBBC2, +0xBBC3,0xBBC5,0xBBC6,0xBBC7,0xBBC9,0xBBCA,0xBBCB,0xBBCC, +0xBBCD,0xBBCE,0xBBCF,0xBBD1,0xBBD2,0xBBD4,0xBBD5,0xBBD6, +0xBBD7,0xBBD8,0xBBD9,0xBBDA,0xBBDB,0xBBDC,0xBBDD,0xBBDE, +0xBBDF,0xBBE0,0xBBE1,0xBBE2,0xBBE3,0xBBE4,0xBBE5,0xBBE6, +0xBBE7,0xBBE8,0xBBE9,0xBBEA,0xBBEB,0xBBEC,0xBBED,0xBBEE, +0xBBEF,0xBBF0,0xBBF1,0xBBF2,0xBBF3,0xBBF4,0xBBF5,0xBBF6, +0xBBF7,0xBBFA,0xBBFB,0xBBFD,0xBBFE,0xBC01, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBC03,0xBC04,0xBC05,0xBC06,0xBC07,0xBC0A,0xBC0E,0xBC10, +0xBC12,0xBC13,0xBC19,0xBC1A,0xBC20,0xBC21,0xBC22,0xBC23, +0xBC26,0xBC28,0xBC2A,0xBC2B,0xBC2C,0xBC2E,0xBC2F,0xBC32, +0xBC33,0xBC35, 0, 0, 0, 0, 0, 0, +0xBC36,0xBC37,0xBC39,0xBC3A,0xBC3B,0xBC3C,0xBC3D,0xBC3E, +0xBC3F,0xBC42,0xBC46,0xBC47,0xBC48,0xBC4A,0xBC4B,0xBC4E, +0xBC4F,0xBC51,0xBC52,0xBC53,0xBC54,0xBC55,0xBC56,0xBC57, +0xBC58,0xBC59, 0, 0, 0, 0, 0, 0, +0xBC5A,0xBC5B,0xBC5C,0xBC5E,0xBC5F,0xBC60,0xBC61,0xBC62, +0xBC63,0xBC64,0xBC65,0xBC66,0xBC67,0xBC68,0xBC69,0xBC6A, +0xBC6B,0xBC6C,0xBC6D,0xBC6E,0xBC6F,0xBC70,0xBC71,0xBC72, +0xBC73,0xBC74,0xBC75,0xBC76,0xBC77,0xBC78,0xBC79,0xBC7A, +0xBC7B,0xBC7C,0xBC7D,0xBC7E,0xBC7F,0xBC80,0xBC81,0xBC82, +0xBC83,0xBC86,0xBC87,0xBC89,0xBC8A,0xBC8D,0xBC8F,0xBC90, +0xBC91,0xBC92,0xBC93,0xBC96,0xBC98,0xBC9B,0xBC9C,0xBC9D, +0xBC9E,0xBC9F,0xBCA2,0xBCA3,0xBCA5,0xBCA6,0xBCA9,0xBCAA, +0xBCAB,0xBCAC,0xBCAD,0xBCAE,0xBCAF,0xBCB2,0xBCB6,0xBCB7, +0xBCB8,0xBCB9,0xBCBA,0xBCBB,0xBCBE,0xBCBF,0xBCC1,0xBCC2, +0xBCC3,0xBCC5,0xBCC6,0xBCC7,0xBCC8,0xBCC9,0xBCCA,0xBCCB, +0xBCCC,0xBCCE,0xBCD2,0xBCD3,0xBCD4,0xBCD6,0xBCD7,0xBCD9, +0xBCDA,0xBCDB,0xBCDD,0xBCDE,0xBCDF,0xBCE0,0xBCE1,0xBCE2, +0xBCE3,0xBCE4,0xBCE5,0xBCE6,0xBCE7,0xBCE8,0xBCE9,0xBCEA, +0xBCEB,0xBCEC,0xBCED,0xBCEE,0xBCEF,0xBCF0,0xBCF1,0xBCF2, +0xBCF3,0xBCF7,0xBCF9,0xBCFA,0xBCFB,0xBCFD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBCFE,0xBCFF,0xBD00,0xBD01,0xBD02,0xBD03,0xBD06,0xBD08, +0xBD0A,0xBD0B,0xBD0C,0xBD0D,0xBD0E,0xBD0F,0xBD11,0xBD12, +0xBD13,0xBD15,0xBD16,0xBD17,0xBD18,0xBD19,0xBD1A,0xBD1B, +0xBD1C,0xBD1D, 0, 0, 0, 0, 0, 0, +0xBD1E,0xBD1F,0xBD20,0xBD21,0xBD22,0xBD23,0xBD25,0xBD26, +0xBD27,0xBD28,0xBD29,0xBD2A,0xBD2B,0xBD2D,0xBD2E,0xBD2F, +0xBD30,0xBD31,0xBD32,0xBD33,0xBD34,0xBD35,0xBD36,0xBD37, +0xBD38,0xBD39, 0, 0, 0, 0, 0, 0, +0xBD3A,0xBD3B,0xBD3C,0xBD3D,0xBD3E,0xBD3F,0xBD41,0xBD42, +0xBD43,0xBD44,0xBD45,0xBD46,0xBD47,0xBD4A,0xBD4B,0xBD4D, +0xBD4E,0xBD4F,0xBD51,0xBD52,0xBD53,0xBD54,0xBD55,0xBD56, +0xBD57,0xBD5A,0xBD5B,0xBD5C,0xBD5D,0xBD5E,0xBD5F,0xBD60, +0xBD61,0xBD62,0xBD63,0xBD65,0xBD66,0xBD67,0xBD69,0xBD6A, +0xBD6B,0xBD6C,0xBD6D,0xBD6E,0xBD6F,0xBD70,0xBD71,0xBD72, +0xBD73,0xBD74,0xBD75,0xBD76,0xBD77,0xBD78,0xBD79,0xBD7A, +0xBD7B,0xBD7C,0xBD7D,0xBD7E,0xBD7F,0xBD82,0xBD83,0xBD85, +0xBD86,0xBD8B,0xBD8C,0xBD8D,0xBD8E,0xBD8F,0xBD92,0xBD94, +0xBD96,0xBD97,0xBD98,0xBD9B,0xBD9D,0xBD9E,0xBD9F,0xBDA0, +0xBDA1,0xBDA2,0xBDA3,0xBDA5,0xBDA6,0xBDA7,0xBDA8,0xBDA9, +0xBDAA,0xBDAB,0xBDAC,0xBDAD,0xBDAE,0xBDAF,0xBDB1,0xBDB2, +0xBDB3,0xBDB4,0xBDB5,0xBDB6,0xBDB7,0xBDB9,0xBDBA,0xBDBB, +0xBDBC,0xBDBD,0xBDBE,0xBDBF,0xBDC0,0xBDC1,0xBDC2,0xBDC3, +0xBDC4,0xBDC5,0xBDC6,0xBDC7,0xBDC8,0xBDC9,0xBDCA,0xBDCB, +0xBDCC,0xBDCD,0xBDCE,0xBDCF,0xBDD0,0xBDD1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBDD2,0xBDD3,0xBDD6,0xBDD7,0xBDD9,0xBDDA,0xBDDB,0xBDDD, +0xBDDE,0xBDDF,0xBDE0,0xBDE1,0xBDE2,0xBDE3,0xBDE4,0xBDE5, +0xBDE6,0xBDE7,0xBDE8,0xBDEA,0xBDEB,0xBDEC,0xBDED,0xBDEE, +0xBDEF,0xBDF1, 0, 0, 0, 0, 0, 0, +0xBDF2,0xBDF3,0xBDF5,0xBDF6,0xBDF7,0xBDF9,0xBDFA,0xBDFB, +0xBDFC,0xBDFD,0xBDFE,0xBDFF,0xBE01,0xBE02,0xBE04,0xBE06, +0xBE07,0xBE08,0xBE09,0xBE0A,0xBE0B,0xBE0E,0xBE0F,0xBE11, +0xBE12,0xBE13, 0, 0, 0, 0, 0, 0, +0xBE15,0xBE16,0xBE17,0xBE18,0xBE19,0xBE1A,0xBE1B,0xBE1E, +0xBE20,0xBE21,0xBE22,0xBE23,0xBE24,0xBE25,0xBE26,0xBE27, +0xBE28,0xBE29,0xBE2A,0xBE2B,0xBE2C,0xBE2D,0xBE2E,0xBE2F, +0xBE30,0xBE31,0xBE32,0xBE33,0xBE34,0xBE35,0xBE36,0xBE37, +0xBE38,0xBE39,0xBE3A,0xBE3B,0xBE3C,0xBE3D,0xBE3E,0xBE3F, +0xBE40,0xBE41,0xBE42,0xBE43,0xBE46,0xBE47,0xBE49,0xBE4A, +0xBE4B,0xBE4D,0xBE4F,0xBE50,0xBE51,0xBE52,0xBE53,0xBE56, +0xBE58,0xBE5C,0xBE5D,0xBE5E,0xBE5F,0xBE62,0xBE63,0xBE65, +0xBE66,0xBE67,0xBE69,0xBE6B,0xBE6C,0xBE6D,0xBE6E,0xBE6F, +0xBE72,0xBE76,0xBE77,0xBE78,0xBE79,0xBE7A,0xBE7E,0xBE7F, +0xBE81,0xBE82,0xBE83,0xBE85,0xBE86,0xBE87,0xBE88,0xBE89, +0xBE8A,0xBE8B,0xBE8E,0xBE92,0xBE93,0xBE94,0xBE95,0xBE96, +0xBE97,0xBE9A,0xBE9B,0xBE9C,0xBE9D,0xBE9E,0xBE9F,0xBEA0, +0xBEA1,0xBEA2,0xBEA3,0xBEA4,0xBEA5,0xBEA6,0xBEA7,0xBEA9, +0xBEAA,0xBEAB,0xBEAC,0xBEAD,0xBEAE,0xBEAF,0xBEB0,0xBEB1, +0xBEB2,0xBEB3,0xBEB4,0xBEB5,0xBEB6,0xBEB7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBEB8,0xBEB9,0xBEBA,0xBEBB,0xBEBC,0xBEBD,0xBEBE,0xBEBF, +0xBEC0,0xBEC1,0xBEC2,0xBEC3,0xBEC4,0xBEC5,0xBEC6,0xBEC7, +0xBEC8,0xBEC9,0xBECA,0xBECB,0xBECC,0xBECD,0xBECE,0xBECF, +0xBED2,0xBED3, 0, 0, 0, 0, 0, 0, +0xBED5,0xBED6,0xBED9,0xBEDA,0xBEDB,0xBEDC,0xBEDD,0xBEDE, +0xBEDF,0xBEE1,0xBEE2,0xBEE6,0xBEE7,0xBEE8,0xBEE9,0xBEEA, +0xBEEB,0xBEED,0xBEEE,0xBEEF,0xBEF0,0xBEF1,0xBEF2,0xBEF3, +0xBEF4,0xBEF5, 0, 0, 0, 0, 0, 0, +0xBEF6,0xBEF7,0xBEF8,0xBEF9,0xBEFA,0xBEFB,0xBEFC,0xBEFD, +0xBEFE,0xBEFF,0xBF00,0xBF02,0xBF03,0xBF04,0xBF05,0xBF06, +0xBF07,0xBF0A,0xBF0B,0xBF0C,0xBF0D,0xBF0E,0xBF0F,0xBF10, +0xBF11,0xBF12,0xBF13,0xBF14,0xBF15,0xBF16,0xBF17,0xBF1A, +0xBF1E,0xBF1F,0xBF20,0xBF21,0xBF22,0xBF23,0xBF24,0xBF25, +0xBF26,0xBF27,0xBF28,0xBF29,0xBF2A,0xBF2B,0xBF2C,0xBF2D, +0xBF2E,0xBF2F,0xBF30,0xBF31,0xBF32,0xBF33,0xBF34,0xBF35, +0xBF36,0xBF37,0xBF38,0xBF39,0xBF3A,0xBF3B,0xBF3C,0xBF3D, +0xBF3E,0xBF3F,0xBF42,0xBF43,0xBF45,0xBF46,0xBF47,0xBF49, +0xBF4A,0xBF4B,0xBF4C,0xBF4D,0xBF4E,0xBF4F,0xBF52,0xBF53, +0xBF54,0xBF56,0xBF57,0xBF58,0xBF59,0xBF5A,0xBF5B,0xBF5C, +0xBF5D,0xBF5E,0xBF5F,0xBF60,0xBF61,0xBF62,0xBF63,0xBF64, +0xBF65,0xBF66,0xBF67,0xBF68,0xBF69,0xBF6A,0xBF6B,0xBF6C, +0xBF6D,0xBF6E,0xBF6F,0xBF70,0xBF71,0xBF72,0xBF73,0xBF74, +0xBF75,0xBF76,0xBF77,0xBF78,0xBF79,0xBF7A,0xBF7B,0xBF7C, +0xBF7D,0xBF7E,0xBF7F,0xBF80,0xBF81,0xBF82, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xBF83,0xBF84,0xBF85,0xBF86,0xBF87,0xBF88,0xBF89,0xBF8A, +0xBF8B,0xBF8C,0xBF8D,0xBF8E,0xBF8F,0xBF90,0xBF91,0xBF92, +0xBF93,0xBF95,0xBF96,0xBF97,0xBF98,0xBF99,0xBF9A,0xBF9B, +0xBF9C,0xBF9D, 0, 0, 0, 0, 0, 0, +0xBF9E,0xBF9F,0xBFA0,0xBFA1,0xBFA2,0xBFA3,0xBFA4,0xBFA5, +0xBFA6,0xBFA7,0xBFA8,0xBFA9,0xBFAA,0xBFAB,0xBFAC,0xBFAD, +0xBFAE,0xBFAF,0xBFB1,0xBFB2,0xBFB3,0xBFB4,0xBFB5,0xBFB6, +0xBFB7,0xBFB8, 0, 0, 0, 0, 0, 0, +0xBFB9,0xBFBA,0xBFBB,0xBFBC,0xBFBD,0xBFBE,0xBFBF,0xBFC0, +0xBFC1,0xBFC2,0xBFC3,0xBFC4,0xBFC6,0xBFC7,0xBFC8,0xBFC9, +0xBFCA,0xBFCB,0xBFCE,0xBFCF,0xBFD1,0xBFD2,0xBFD3,0xBFD5, +0xBFD6,0xBFD7,0xBFD8,0xBFD9,0xBFDA,0xBFDB,0xBFDD,0xBFDE, +0xBFE0,0xBFE2,0xBFE3,0xBFE4,0xBFE5,0xBFE6,0xBFE7,0xBFE8, +0xBFE9,0xBFEA,0xBFEB,0xBFEC,0xBFED,0xBFEE,0xBFEF,0xBFF0, +0xBFF1,0xBFF2,0xBFF3,0xBFF4,0xBFF5,0xBFF6,0xBFF7,0xBFF8, +0xBFF9,0xBFFA,0xBFFB,0xBFFC,0xBFFD,0xBFFE,0xBFFF,0xC000, +0xC001,0xC002,0xC003,0xC004,0xC005,0xC006,0xC007,0xC008, +0xC009,0xC00A,0xC00B,0xC00C,0xC00D,0xC00E,0xC00F,0xC010, +0xC011,0xC012,0xC013,0xC014,0xC015,0xC016,0xC017,0xC018, +0xC019,0xC01A,0xC01B,0xC01C,0xC01D,0xC01E,0xC01F,0xC020, +0xC021,0xC022,0xC023,0xC024,0xC025,0xC026,0xC027,0xC028, +0xC029,0xC02A,0xC02B,0xC02C,0xC02D,0xC02E,0xC02F,0xC030, +0xC031,0xC032,0xC033,0xC034,0xC035,0xC036,0xC037,0xC038, +0xC039,0xC03A,0xC03B,0xC03D,0xC03E,0xC03F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC040,0xC041,0xC042,0xC043,0xC044,0xC045,0xC046,0xC047, +0xC048,0xC049,0xC04A,0xC04B,0xC04C,0xC04D,0xC04E,0xC04F, +0xC050,0xC052,0xC053,0xC054,0xC055,0xC056,0xC057,0xC059, +0xC05A,0xC05B, 0, 0, 0, 0, 0, 0, +0xC05D,0xC05E,0xC05F,0xC061,0xC062,0xC063,0xC064,0xC065, +0xC066,0xC067,0xC06A,0xC06B,0xC06C,0xC06D,0xC06E,0xC06F, +0xC070,0xC071,0xC072,0xC073,0xC074,0xC075,0xC076,0xC077, +0xC078,0xC079, 0, 0, 0, 0, 0, 0, +0xC07A,0xC07B,0xC07C,0xC07D,0xC07E,0xC07F,0xC080,0xC081, +0xC082,0xC083,0xC084,0xC085,0xC086,0xC087,0xC088,0xC089, +0xC08A,0xC08B,0xC08C,0xC08D,0xC08E,0xC08F,0xC092,0xC093, +0xC095,0xC096,0xC097,0xC099,0xC09A,0xC09B,0xC09C,0xC09D, +0xC09E,0xC09F,0xC0A2,0xC0A4,0xC0A6,0xC0A7,0xC0A8,0xC0A9, +0xC0AA,0xC0AB,0xC0AE,0xC0B1,0xC0B2,0xC0B7,0xC0B8,0xC0B9, +0xC0BA,0xC0BB,0xC0BE,0xC0C2,0xC0C3,0xC0C4,0xC0C6,0xC0C7, +0xC0CA,0xC0CB,0xC0CD,0xC0CE,0xC0CF,0xC0D1,0xC0D2,0xC0D3, +0xC0D4,0xC0D5,0xC0D6,0xC0D7,0xC0DA,0xC0DE,0xC0DF,0xC0E0, +0xC0E1,0xC0E2,0xC0E3,0xC0E6,0xC0E7,0xC0E9,0xC0EA,0xC0EB, +0xC0ED,0xC0EE,0xC0EF,0xC0F0,0xC0F1,0xC0F2,0xC0F3,0xC0F6, +0xC0F8,0xC0FA,0xC0FB,0xC0FC,0xC0FD,0xC0FE,0xC0FF,0xC101, +0xC102,0xC103,0xC105,0xC106,0xC107,0xC109,0xC10A,0xC10B, +0xC10C,0xC10D,0xC10E,0xC10F,0xC111,0xC112,0xC113,0xC114, +0xC116,0xC117,0xC118,0xC119,0xC11A,0xC11B,0xC121,0xC122, +0xC125,0xC128,0xC129,0xC12A,0xC12B,0xC12E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC132,0xC133,0xC134,0xC135,0xC137,0xC13A,0xC13B,0xC13D, +0xC13E,0xC13F,0xC141,0xC142,0xC143,0xC144,0xC145,0xC146, +0xC147,0xC14A,0xC14E,0xC14F,0xC150,0xC151,0xC152,0xC153, +0xC156,0xC157, 0, 0, 0, 0, 0, 0, +0xC159,0xC15A,0xC15B,0xC15D,0xC15E,0xC15F,0xC160,0xC161, +0xC162,0xC163,0xC166,0xC16A,0xC16B,0xC16C,0xC16D,0xC16E, +0xC16F,0xC171,0xC172,0xC173,0xC175,0xC176,0xC177,0xC179, +0xC17A,0xC17B, 0, 0, 0, 0, 0, 0, +0xC17C,0xC17D,0xC17E,0xC17F,0xC180,0xC181,0xC182,0xC183, +0xC184,0xC186,0xC187,0xC188,0xC189,0xC18A,0xC18B,0xC18F, +0xC191,0xC192,0xC193,0xC195,0xC197,0xC198,0xC199,0xC19A, +0xC19B,0xC19E,0xC1A0,0xC1A2,0xC1A3,0xC1A4,0xC1A6,0xC1A7, +0xC1AA,0xC1AB,0xC1AD,0xC1AE,0xC1AF,0xC1B1,0xC1B2,0xC1B3, +0xC1B4,0xC1B5,0xC1B6,0xC1B7,0xC1B8,0xC1B9,0xC1BA,0xC1BB, +0xC1BC,0xC1BE,0xC1BF,0xC1C0,0xC1C1,0xC1C2,0xC1C3,0xC1C5, +0xC1C6,0xC1C7,0xC1C9,0xC1CA,0xC1CB,0xC1CD,0xC1CE,0xC1CF, +0xC1D0,0xC1D1,0xC1D2,0xC1D3,0xC1D5,0xC1D6,0xC1D9,0xC1DA, +0xC1DB,0xC1DC,0xC1DD,0xC1DE,0xC1DF,0xC1E1,0xC1E2,0xC1E3, +0xC1E5,0xC1E6,0xC1E7,0xC1E9,0xC1EA,0xC1EB,0xC1EC,0xC1ED, +0xC1EE,0xC1EF,0xC1F2,0xC1F4,0xC1F5,0xC1F6,0xC1F7,0xC1F8, +0xC1F9,0xC1FA,0xC1FB,0xC1FE,0xC1FF,0xC201,0xC202,0xC203, +0xC205,0xC206,0xC207,0xC208,0xC209,0xC20A,0xC20B,0xC20E, +0xC210,0xC212,0xC213,0xC214,0xC215,0xC216,0xC217,0xC21A, +0xC21B,0xC21D,0xC21E,0xC221,0xC222,0xC223, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC224,0xC225,0xC226,0xC227,0xC22A,0xC22C,0xC22E,0xC230, +0xC233,0xC235,0xC236,0xC237,0xC238,0xC239,0xC23A,0xC23B, +0xC23C,0xC23D,0xC23E,0xC23F,0xC240,0xC241,0xC242,0xC243, +0xC244,0xC245, 0, 0, 0, 0, 0, 0, +0xC246,0xC247,0xC249,0xC24A,0xC24B,0xC24C,0xC24D,0xC24E, +0xC24F,0xC252,0xC253,0xC255,0xC256,0xC257,0xC259,0xC25A, +0xC25B,0xC25C,0xC25D,0xC25E,0xC25F,0xC261,0xC262,0xC263, +0xC264,0xC266, 0, 0, 0, 0, 0, 0, +0xC267,0xC268,0xC269,0xC26A,0xC26B,0xC26E,0xC26F,0xC271, +0xC272,0xC273,0xC275,0xC276,0xC277,0xC278,0xC279,0xC27A, +0xC27B,0xC27E,0xC280,0xC282,0xC283,0xC284,0xC285,0xC286, +0xC287,0xC28A,0xC28B,0xC28C,0xC28D,0xC28E,0xC28F,0xC291, +0xC292,0xC293,0xC294,0xC295,0xC296,0xC297,0xC299,0xC29A, +0xC29C,0xC29E,0xC29F,0xC2A0,0xC2A1,0xC2A2,0xC2A3,0xC2A6, +0xC2A7,0xC2A9,0xC2AA,0xC2AB,0xC2AE,0xC2AF,0xC2B0,0xC2B1, +0xC2B2,0xC2B3,0xC2B6,0xC2B8,0xC2BA,0xC2BB,0xC2BC,0xC2BD, +0xC2BE,0xC2BF,0xC2C0,0xC2C1,0xC2C2,0xC2C3,0xC2C4,0xC2C5, +0xC2C6,0xC2C7,0xC2C8,0xC2C9,0xC2CA,0xC2CB,0xC2CC,0xC2CD, +0xC2CE,0xC2CF,0xC2D0,0xC2D1,0xC2D2,0xC2D3,0xC2D4,0xC2D5, +0xC2D6,0xC2D7,0xC2D8,0xC2D9,0xC2DA,0xC2DB,0xC2DE,0xC2DF, +0xC2E1,0xC2E2,0xC2E5,0xC2E6,0xC2E7,0xC2E8,0xC2E9,0xC2EA, +0xC2EE,0xC2F0,0xC2F2,0xC2F3,0xC2F4,0xC2F5,0xC2F7,0xC2FA, +0xC2FD,0xC2FE,0xC2FF,0xC301,0xC302,0xC303,0xC304,0xC305, +0xC306,0xC307,0xC30A,0xC30B,0xC30E,0xC30F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC310,0xC311,0xC312,0xC316,0xC317,0xC319,0xC31A,0xC31B, +0xC31D,0xC31E,0xC31F,0xC320,0xC321,0xC322,0xC323,0xC326, +0xC327,0xC32A,0xC32B,0xC32C,0xC32D,0xC32E,0xC32F,0xC330, +0xC331,0xC332, 0, 0, 0, 0, 0, 0, +0xC333,0xC334,0xC335,0xC336,0xC337,0xC338,0xC339,0xC33A, +0xC33B,0xC33C,0xC33D,0xC33E,0xC33F,0xC340,0xC341,0xC342, +0xC343,0xC344,0xC346,0xC347,0xC348,0xC349,0xC34A,0xC34B, +0xC34C,0xC34D, 0, 0, 0, 0, 0, 0, +0xC34E,0xC34F,0xC350,0xC351,0xC352,0xC353,0xC354,0xC355, +0xC356,0xC357,0xC358,0xC359,0xC35A,0xC35B,0xC35C,0xC35D, +0xC35E,0xC35F,0xC360,0xC361,0xC362,0xC363,0xC364,0xC365, +0xC366,0xC367,0xC36A,0xC36B,0xC36D,0xC36E,0xC36F,0xC371, +0xC373,0xC374,0xC375,0xC376,0xC377,0xC37A,0xC37B,0xC37E, +0xC37F,0xC380,0xC381,0xC382,0xC383,0xC385,0xC386,0xC387, +0xC389,0xC38A,0xC38B,0xC38D,0xC38E,0xC38F,0xC390,0xC391, +0xC392,0xC393,0xC394,0xC395,0xC396,0xC397,0xC398,0xC399, +0xC39A,0xC39B,0xC39C,0xC39D,0xC39E,0xC39F,0xC3A0,0xC3A1, +0xC3A2,0xC3A3,0xC3A4,0xC3A5,0xC3A6,0xC3A7,0xC3A8,0xC3A9, +0xC3AA,0xC3AB,0xC3AC,0xC3AD,0xC3AE,0xC3AF,0xC3B0,0xC3B1, +0xC3B2,0xC3B3,0xC3B4,0xC3B5,0xC3B6,0xC3B7,0xC3B8,0xC3B9, +0xC3BA,0xC3BB,0xC3BC,0xC3BD,0xC3BE,0xC3BF,0xC3C1,0xC3C2, +0xC3C3,0xC3C4,0xC3C5,0xC3C6,0xC3C7,0xC3C8,0xC3C9,0xC3CA, +0xC3CB,0xC3CC,0xC3CD,0xC3CE,0xC3CF,0xC3D0,0xC3D1,0xC3D2, +0xC3D3,0xC3D4,0xC3D5,0xC3D6,0xC3D7,0xC3DA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC3DB,0xC3DD,0xC3DE,0xC3E1,0xC3E3,0xC3E4,0xC3E5,0xC3E6, +0xC3E7,0xC3EA,0xC3EB,0xC3EC,0xC3EE,0xC3EF,0xC3F0,0xC3F1, +0xC3F2,0xC3F3,0xC3F6,0xC3F7,0xC3F9,0xC3FA,0xC3FB,0xC3FC, +0xC3FD,0xC3FE, 0, 0, 0, 0, 0, 0, +0xC3FF,0xC400,0xC401,0xC402,0xC403,0xC404,0xC405,0xC406, +0xC407,0xC409,0xC40A,0xC40B,0xC40C,0xC40D,0xC40E,0xC40F, +0xC411,0xC412,0xC413,0xC414,0xC415,0xC416,0xC417,0xC418, +0xC419,0xC41A, 0, 0, 0, 0, 0, 0, +0xC41B,0xC41C,0xC41D,0xC41E,0xC41F,0xC420,0xC421,0xC422, +0xC423,0xC425,0xC426,0xC427,0xC428,0xC429,0xC42A,0xC42B, +0xC42D,0xC42E,0xC42F,0xC431,0xC432,0xC433,0xC435,0xC436, +0xC437,0xC438,0xC439,0xC43A,0xC43B,0xC43E,0xC43F,0xC440, +0xC441,0xC442,0xC443,0xC444,0xC445,0xC446,0xC447,0xC449, +0xC44A,0xC44B,0xC44C,0xC44D,0xC44E,0xC44F,0xC450,0xC451, +0xC452,0xC453,0xC454,0xC455,0xC456,0xC457,0xC458,0xC459, +0xC45A,0xC45B,0xC45C,0xC45D,0xC45E,0xC45F,0xC460,0xC461, +0xC462,0xC463,0xC466,0xC467,0xC469,0xC46A,0xC46B,0xC46D, +0xC46E,0xC46F,0xC470,0xC471,0xC472,0xC473,0xC476,0xC477, +0xC478,0xC47A,0xC47B,0xC47C,0xC47D,0xC47E,0xC47F,0xC481, +0xC482,0xC483,0xC484,0xC485,0xC486,0xC487,0xC488,0xC489, +0xC48A,0xC48B,0xC48C,0xC48D,0xC48E,0xC48F,0xC490,0xC491, +0xC492,0xC493,0xC495,0xC496,0xC497,0xC498,0xC499,0xC49A, +0xC49B,0xC49D,0xC49E,0xC49F,0xC4A0,0xC4A1,0xC4A2,0xC4A3, +0xC4A4,0xC4A5,0xC4A6,0xC4A7,0xC4A8,0xC4A9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC4AA,0xC4AB,0xC4AC,0xC4AD,0xC4AE,0xC4AF,0xC4B0,0xC4B1, +0xC4B2,0xC4B3,0xC4B4,0xC4B5,0xC4B6,0xC4B7,0xC4B9,0xC4BA, +0xC4BB,0xC4BD,0xC4BE,0xC4BF,0xC4C0,0xC4C1,0xC4C2,0xC4C3, +0xC4C4,0xC4C5, 0, 0, 0, 0, 0, 0, +0xC4C6,0xC4C7,0xC4C8,0xC4C9,0xC4CA,0xC4CB,0xC4CC,0xC4CD, +0xC4CE,0xC4CF,0xC4D0,0xC4D1,0xC4D2,0xC4D3,0xC4D4,0xC4D5, +0xC4D6,0xC4D7,0xC4D8,0xC4D9,0xC4DA,0xC4DB,0xC4DC,0xC4DD, +0xC4DE,0xC4DF, 0, 0, 0, 0, 0, 0, +0xC4E0,0xC4E1,0xC4E2,0xC4E3,0xC4E4,0xC4E5,0xC4E6,0xC4E7, +0xC4E8,0xC4EA,0xC4EB,0xC4EC,0xC4ED,0xC4EE,0xC4EF,0xC4F2, +0xC4F3,0xC4F5,0xC4F6,0xC4F7,0xC4F9,0xC4FB,0xC4FC,0xC4FD, +0xC4FE,0xC502,0xC503,0xC504,0xC505,0xC506,0xC507,0xC508, +0xC509,0xC50A,0xC50B,0xC50D,0xC50E,0xC50F,0xC511,0xC512, +0xC513,0xC515,0xC516,0xC517,0xC518,0xC519,0xC51A,0xC51B, +0xC51D,0xC51E,0xC51F,0xC520,0xC521,0xC522,0xC523,0xC524, +0xC525,0xC526,0xC527,0xC52A,0xC52B,0xC52D,0xC52E,0xC52F, +0xC531,0xC532,0xC533,0xC534,0xC535,0xC536,0xC537,0xC53A, +0xC53C,0xC53E,0xC53F,0xC540,0xC541,0xC542,0xC543,0xC546, +0xC547,0xC54B,0xC54F,0xC550,0xC551,0xC552,0xC556,0xC55A, +0xC55B,0xC55C,0xC55F,0xC562,0xC563,0xC565,0xC566,0xC567, +0xC569,0xC56A,0xC56B,0xC56C,0xC56D,0xC56E,0xC56F,0xC572, +0xC576,0xC577,0xC578,0xC579,0xC57A,0xC57B,0xC57E,0xC57F, +0xC581,0xC582,0xC583,0xC585,0xC586,0xC588,0xC589,0xC58A, +0xC58B,0xC58E,0xC590,0xC592,0xC593,0xC594, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC596,0xC599,0xC59A,0xC59B,0xC59D,0xC59E,0xC59F,0xC5A1, +0xC5A2,0xC5A3,0xC5A4,0xC5A5,0xC5A6,0xC5A7,0xC5A8,0xC5AA, +0xC5AB,0xC5AC,0xC5AD,0xC5AE,0xC5AF,0xC5B0,0xC5B1,0xC5B2, +0xC5B3,0xC5B6, 0, 0, 0, 0, 0, 0, +0xC5B7,0xC5BA,0xC5BF,0xC5C0,0xC5C1,0xC5C2,0xC5C3,0xC5CB, +0xC5CD,0xC5CF,0xC5D2,0xC5D3,0xC5D5,0xC5D6,0xC5D7,0xC5D9, +0xC5DA,0xC5DB,0xC5DC,0xC5DD,0xC5DE,0xC5DF,0xC5E2,0xC5E4, +0xC5E6,0xC5E7, 0, 0, 0, 0, 0, 0, +0xC5E8,0xC5E9,0xC5EA,0xC5EB,0xC5EF,0xC5F1,0xC5F2,0xC5F3, +0xC5F5,0xC5F8,0xC5F9,0xC5FA,0xC5FB,0xC602,0xC603,0xC604, +0xC609,0xC60A,0xC60B,0xC60D,0xC60E,0xC60F,0xC611,0xC612, +0xC613,0xC614,0xC615,0xC616,0xC617,0xC61A,0xC61D,0xC61E, +0xC61F,0xC620,0xC621,0xC622,0xC623,0xC626,0xC627,0xC629, +0xC62A,0xC62B,0xC62F,0xC631,0xC632,0xC636,0xC638,0xC63A, +0xC63C,0xC63D,0xC63E,0xC63F,0xC642,0xC643,0xC645,0xC646, +0xC647,0xC649,0xC64A,0xC64B,0xC64C,0xC64D,0xC64E,0xC64F, +0xC652,0xC656,0xC657,0xC658,0xC659,0xC65A,0xC65B,0xC65E, +0xC65F,0xC661,0xC662,0xC663,0xC664,0xC665,0xC666,0xC667, +0xC668,0xC669,0xC66A,0xC66B,0xC66D,0xC66E,0xC670,0xC672, +0xC673,0xC674,0xC675,0xC676,0xC677,0xC67A,0xC67B,0xC67D, +0xC67E,0xC67F,0xC681,0xC682,0xC683,0xC684,0xC685,0xC686, +0xC687,0xC68A,0xC68C,0xC68E,0xC68F,0xC690,0xC691,0xC692, +0xC693,0xC696,0xC697,0xC699,0xC69A,0xC69B,0xC69D,0xC69E, +0xC69F,0xC6A0,0xC6A1,0xC6A2,0xC6A3,0xC6A6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC6A8,0xC6AA,0xC6AB,0xC6AC,0xC6AD,0xC6AE,0xC6AF,0xC6B2, +0xC6B3,0xC6B5,0xC6B6,0xC6B7,0xC6BB,0xC6BC,0xC6BD,0xC6BE, +0xC6BF,0xC6C2,0xC6C4,0xC6C6,0xC6C7,0xC6C8,0xC6C9,0xC6CA, +0xC6CB,0xC6CE, 0, 0, 0, 0, 0, 0, +0xC6CF,0xC6D1,0xC6D2,0xC6D3,0xC6D5,0xC6D6,0xC6D7,0xC6D8, +0xC6D9,0xC6DA,0xC6DB,0xC6DE,0xC6DF,0xC6E2,0xC6E3,0xC6E4, +0xC6E5,0xC6E6,0xC6E7,0xC6EA,0xC6EB,0xC6ED,0xC6EE,0xC6EF, +0xC6F1,0xC6F2, 0, 0, 0, 0, 0, 0, +0xC6F3,0xC6F4,0xC6F5,0xC6F6,0xC6F7,0xC6FA,0xC6FB,0xC6FC, +0xC6FE,0xC6FF,0xC700,0xC701,0xC702,0xC703,0xC706,0xC707, +0xC709,0xC70A,0xC70B,0xC70D,0xC70E,0xC70F,0xC710,0xC711, +0xC712,0xC713,0xC716,0xC718,0xC71A,0xC71B,0xC71C,0xC71D, +0xC71E,0xC71F,0xC722,0xC723,0xC725,0xC726,0xC727,0xC729, +0xC72A,0xC72B,0xC72C,0xC72D,0xC72E,0xC72F,0xC732,0xC734, +0xC736,0xC738,0xC739,0xC73A,0xC73B,0xC73E,0xC73F,0xC741, +0xC742,0xC743,0xC745,0xC746,0xC747,0xC748,0xC749,0xC74B, +0xC74E,0xC750,0xC759,0xC75A,0xC75B,0xC75D,0xC75E,0xC75F, +0xC761,0xC762,0xC763,0xC764,0xC765,0xC766,0xC767,0xC769, +0xC76A,0xC76C,0xC76D,0xC76E,0xC76F,0xC770,0xC771,0xC772, +0xC773,0xC776,0xC777,0xC779,0xC77A,0xC77B,0xC77F,0xC780, +0xC781,0xC782,0xC786,0xC78B,0xC78C,0xC78D,0xC78F,0xC792, +0xC793,0xC795,0xC799,0xC79B,0xC79C,0xC79D,0xC79E,0xC79F, +0xC7A2,0xC7A7,0xC7A8,0xC7A9,0xC7AA,0xC7AB,0xC7AE,0xC7AF, +0xC7B1,0xC7B2,0xC7B3,0xC7B5,0xC7B6,0xC7B7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC7B8,0xC7B9,0xC7BA,0xC7BB,0xC7BE,0xC7C2,0xC7C3,0xC7C4, +0xC7C5,0xC7C6,0xC7C7,0xC7CA,0xC7CB,0xC7CD,0xC7CF,0xC7D1, +0xC7D2,0xC7D3,0xC7D4,0xC7D5,0xC7D6,0xC7D7,0xC7D9,0xC7DA, +0xC7DB,0xC7DC, 0, 0, 0, 0, 0, 0, +0xC7DE,0xC7DF,0xC7E0,0xC7E1,0xC7E2,0xC7E3,0xC7E5,0xC7E6, +0xC7E7,0xC7E9,0xC7EA,0xC7EB,0xC7ED,0xC7EE,0xC7EF,0xC7F0, +0xC7F1,0xC7F2,0xC7F3,0xC7F4,0xC7F5,0xC7F6,0xC7F7,0xC7F8, +0xC7F9,0xC7FA, 0, 0, 0, 0, 0, 0, +0xC7FB,0xC7FC,0xC7FD,0xC7FE,0xC7FF,0xC802,0xC803,0xC805, +0xC806,0xC807,0xC809,0xC80B,0xC80C,0xC80D,0xC80E,0xC80F, +0xC812,0xC814,0xC817,0xC818,0xC819,0xC81A,0xC81B,0xC81E, +0xC81F,0xC821,0xC822,0xC823,0xC825,0xC826,0xC827,0xC828, +0xC829,0xC82A,0xC82B,0xC82E,0xC830,0xC832,0xC833,0xC834, +0xC835,0xC836,0xC837,0xC839,0xC83A,0xC83B,0xC83D,0xC83E, +0xC83F,0xC841,0xC842,0xC843,0xC844,0xC845,0xC846,0xC847, +0xC84A,0xC84B,0xC84E,0xC84F,0xC850,0xC851,0xC852,0xC853, +0xC855,0xC856,0xC857,0xC858,0xC859,0xC85A,0xC85B,0xC85C, +0xC85D,0xC85E,0xC85F,0xC860,0xC861,0xC862,0xC863,0xC864, +0xC865,0xC866,0xC867,0xC868,0xC869,0xC86A,0xC86B,0xC86C, +0xC86D,0xC86E,0xC86F,0xC872,0xC873,0xC875,0xC876,0xC877, +0xC879,0xC87B,0xC87C,0xC87D,0xC87E,0xC87F,0xC882,0xC884, +0xC888,0xC889,0xC88A,0xC88E,0xC88F,0xC890,0xC891,0xC892, +0xC893,0xC895,0xC896,0xC897,0xC898,0xC899,0xC89A,0xC89B, +0xC89C,0xC89E,0xC8A0,0xC8A2,0xC8A3,0xC8A4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC8A5,0xC8A6,0xC8A7,0xC8A9,0xC8AA,0xC8AB,0xC8AC,0xC8AD, +0xC8AE,0xC8AF,0xC8B0,0xC8B1,0xC8B2,0xC8B3,0xC8B4,0xC8B5, +0xC8B6,0xC8B7,0xC8B8,0xC8B9,0xC8BA,0xC8BB,0xC8BE,0xC8BF, +0xC8C0,0xC8C1, 0, 0, 0, 0, 0, 0, +0xC8C2,0xC8C3,0xC8C5,0xC8C6,0xC8C7,0xC8C9,0xC8CA,0xC8CB, +0xC8CD,0xC8CE,0xC8CF,0xC8D0,0xC8D1,0xC8D2,0xC8D3,0xC8D6, +0xC8D8,0xC8DA,0xC8DB,0xC8DC,0xC8DD,0xC8DE,0xC8DF,0xC8E2, +0xC8E3,0xC8E5, 0, 0, 0, 0, 0, 0, +0xC8E6,0xC8E7,0xC8E8,0xC8E9,0xC8EA,0xC8EB,0xC8EC,0xC8ED, +0xC8EE,0xC8EF,0xC8F0,0xC8F1,0xC8F2,0xC8F3,0xC8F4,0xC8F6, +0xC8F7,0xC8F8,0xC8F9,0xC8FA,0xC8FB,0xC8FE,0xC8FF,0xC901, +0xC902,0xC903,0xC907,0xC908,0xC909,0xC90A,0xC90B,0xC90E, +0x3000,0x3001,0x3002,0x00B7,0x2025,0x2026,0x00A8,0x3003, +0x00AD,0x2015,0x2225,0xFF3C,0x223C,0x2018,0x2019,0x201C, +0x201D,0x3014,0x3015,0x3008,0x3009,0x300A,0x300B,0x300C, +0x300D,0x300E,0x300F,0x3010,0x3011,0x00B1,0x00D7,0x00F7, +0x2260,0x2264,0x2265,0x221E,0x2234,0x00B0,0x2032,0x2033, +0x2103,0x212B,0xFFE0,0xFFE1,0xFFE5,0x2642,0x2640,0x2220, +0x22A5,0x2312,0x2202,0x2207,0x2261,0x2252,0x00A7,0x203B, +0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7,0x25C6,0x25A1, +0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x2192,0x2190,0x2191, +0x2193,0x2194,0x3013,0x226A,0x226B,0x221A,0x223D,0x221D, +0x2235,0x222B,0x222C,0x2208,0x220B,0x2286,0x2287,0x2282, +0x2283,0x222A,0x2229,0x2227,0x2228,0xFFE2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC910,0xC912,0xC913,0xC914,0xC915,0xC916,0xC917,0xC919, +0xC91A,0xC91B,0xC91C,0xC91D,0xC91E,0xC91F,0xC920,0xC921, +0xC922,0xC923,0xC924,0xC925,0xC926,0xC927,0xC928,0xC929, +0xC92A,0xC92B, 0, 0, 0, 0, 0, 0, +0xC92D,0xC92E,0xC92F,0xC930,0xC931,0xC932,0xC933,0xC935, +0xC936,0xC937,0xC938,0xC939,0xC93A,0xC93B,0xC93C,0xC93D, +0xC93E,0xC93F,0xC940,0xC941,0xC942,0xC943,0xC944,0xC945, +0xC946,0xC947, 0, 0, 0, 0, 0, 0, +0xC948,0xC949,0xC94A,0xC94B,0xC94C,0xC94D,0xC94E,0xC94F, +0xC952,0xC953,0xC955,0xC956,0xC957,0xC959,0xC95A,0xC95B, +0xC95C,0xC95D,0xC95E,0xC95F,0xC962,0xC964,0xC965,0xC966, +0xC967,0xC968,0xC969,0xC96A,0xC96B,0xC96D,0xC96E,0xC96F, +0x21D2,0x21D4,0x2200,0x2203,0x00B4,0xFF5E,0x02C7,0x02D8, +0x02DD,0x02DA,0x02D9,0x00B8,0x02DB,0x00A1,0x00BF,0x02D0, +0x222E,0x2211,0x220F,0x00A4,0x2109,0x2030,0x25C1,0x25C0, +0x25B7,0x25B6,0x2664,0x2660,0x2661,0x2665,0x2667,0x2663, +0x2299,0x25C8,0x25A3,0x25D0,0x25D1,0x2592,0x25A4,0x25A5, +0x25A8,0x25A7,0x25A6,0x25A9,0x2668,0x260F,0x260E,0x261C, +0x261E,0x00B6,0x2020,0x2021,0x2195,0x2197,0x2199,0x2196, +0x2198,0x266D,0x2669,0x266A,0x266C,0x327F,0x321C,0x2116, +0x33C7,0x2122,0x33C2,0x33D8,0x2121, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC971,0xC972,0xC973,0xC975,0xC976,0xC977,0xC978,0xC979, +0xC97A,0xC97B,0xC97D,0xC97E,0xC97F,0xC980,0xC981,0xC982, +0xC983,0xC984,0xC985,0xC986,0xC987,0xC98A,0xC98B,0xC98D, +0xC98E,0xC98F, 0, 0, 0, 0, 0, 0, +0xC991,0xC992,0xC993,0xC994,0xC995,0xC996,0xC997,0xC99A, +0xC99C,0xC99E,0xC99F,0xC9A0,0xC9A1,0xC9A2,0xC9A3,0xC9A4, +0xC9A5,0xC9A6,0xC9A7,0xC9A8,0xC9A9,0xC9AA,0xC9AB,0xC9AC, +0xC9AD,0xC9AE, 0, 0, 0, 0, 0, 0, +0xC9AF,0xC9B0,0xC9B1,0xC9B2,0xC9B3,0xC9B4,0xC9B5,0xC9B6, +0xC9B7,0xC9B8,0xC9B9,0xC9BA,0xC9BB,0xC9BC,0xC9BD,0xC9BE, +0xC9BF,0xC9C2,0xC9C3,0xC9C5,0xC9C6,0xC9C9,0xC9CB,0xC9CC, +0xC9CD,0xC9CE,0xC9CF,0xC9D2,0xC9D4,0xC9D7,0xC9D8,0xC9DB, +0xFF01,0xFF02,0xFF03,0xFF04,0xFF05,0xFF06,0xFF07,0xFF08, +0xFF09,0xFF0A,0xFF0B,0xFF0C,0xFF0D,0xFF0E,0xFF0F,0xFF10, +0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, +0xFF19,0xFF1A,0xFF1B,0xFF1C,0xFF1D,0xFF1E,0xFF1F,0xFF20, +0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28, +0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30, +0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38, +0xFF39,0xFF3A,0xFF3B,0xFFE6,0xFF3D,0xFF3E,0xFF3F,0xFF40, +0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47,0xFF48, +0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F,0xFF50, +0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57,0xFF58, +0xFF59,0xFF5A,0xFF5B,0xFF5C,0xFF5D,0xFFE3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xC9DE,0xC9DF,0xC9E1,0xC9E3,0xC9E5,0xC9E6,0xC9E8,0xC9E9, +0xC9EA,0xC9EB,0xC9EE,0xC9F2,0xC9F3,0xC9F4,0xC9F5,0xC9F6, +0xC9F7,0xC9FA,0xC9FB,0xC9FD,0xC9FE,0xC9FF,0xCA01,0xCA02, +0xCA03,0xCA04, 0, 0, 0, 0, 0, 0, +0xCA05,0xCA06,0xCA07,0xCA0A,0xCA0E,0xCA0F,0xCA10,0xCA11, +0xCA12,0xCA13,0xCA15,0xCA16,0xCA17,0xCA19,0xCA1A,0xCA1B, +0xCA1C,0xCA1D,0xCA1E,0xCA1F,0xCA20,0xCA21,0xCA22,0xCA23, +0xCA24,0xCA25, 0, 0, 0, 0, 0, 0, +0xCA26,0xCA27,0xCA28,0xCA2A,0xCA2B,0xCA2C,0xCA2D,0xCA2E, +0xCA2F,0xCA30,0xCA31,0xCA32,0xCA33,0xCA34,0xCA35,0xCA36, +0xCA37,0xCA38,0xCA39,0xCA3A,0xCA3B,0xCA3C,0xCA3D,0xCA3E, +0xCA3F,0xCA40,0xCA41,0xCA42,0xCA43,0xCA44,0xCA45,0xCA46, +0x3131,0x3132,0x3133,0x3134,0x3135,0x3136,0x3137,0x3138, +0x3139,0x313A,0x313B,0x313C,0x313D,0x313E,0x313F,0x3140, +0x3141,0x3142,0x3143,0x3144,0x3145,0x3146,0x3147,0x3148, +0x3149,0x314A,0x314B,0x314C,0x314D,0x314E,0x314F,0x3150, +0x3151,0x3152,0x3153,0x3154,0x3155,0x3156,0x3157,0x3158, +0x3159,0x315A,0x315B,0x315C,0x315D,0x315E,0x315F,0x3160, +0x3161,0x3162,0x3163,0x3164,0x3165,0x3166,0x3167,0x3168, +0x3169,0x316A,0x316B,0x316C,0x316D,0x316E,0x316F,0x3170, +0x3171,0x3172,0x3173,0x3174,0x3175,0x3176,0x3177,0x3178, +0x3179,0x317A,0x317B,0x317C,0x317D,0x317E,0x317F,0x3180, +0x3181,0x3182,0x3183,0x3184,0x3185,0x3186,0x3187,0x3188, +0x3189,0x318A,0x318B,0x318C,0x318D,0x318E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCA47,0xCA48,0xCA49,0xCA4A,0xCA4B,0xCA4E,0xCA4F,0xCA51, +0xCA52,0xCA53,0xCA55,0xCA56,0xCA57,0xCA58,0xCA59,0xCA5A, +0xCA5B,0xCA5E,0xCA62,0xCA63,0xCA64,0xCA65,0xCA66,0xCA67, +0xCA69,0xCA6A, 0, 0, 0, 0, 0, 0, +0xCA6B,0xCA6C,0xCA6D,0xCA6E,0xCA6F,0xCA70,0xCA71,0xCA72, +0xCA73,0xCA74,0xCA75,0xCA76,0xCA77,0xCA78,0xCA79,0xCA7A, +0xCA7B,0xCA7C,0xCA7E,0xCA7F,0xCA80,0xCA81,0xCA82,0xCA83, +0xCA85,0xCA86, 0, 0, 0, 0, 0, 0, +0xCA87,0xCA88,0xCA89,0xCA8A,0xCA8B,0xCA8C,0xCA8D,0xCA8E, +0xCA8F,0xCA90,0xCA91,0xCA92,0xCA93,0xCA94,0xCA95,0xCA96, +0xCA97,0xCA99,0xCA9A,0xCA9B,0xCA9C,0xCA9D,0xCA9E,0xCA9F, +0xCAA0,0xCAA1,0xCAA2,0xCAA3,0xCAA4,0xCAA5,0xCAA6,0xCAA7, +0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, +0x2178,0x2179, 0, 0, 0, 0, 0,0x2160, +0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167,0x2168, +0x2169, 0, 0, 0, 0, 0, 0, 0, +0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398, +0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0, +0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, + 0, 0, 0, 0, 0, 0, 0, 0, +0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8, +0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0, +0x03C1,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCAA8,0xCAA9,0xCAAA,0xCAAB,0xCAAC,0xCAAD,0xCAAE,0xCAAF, +0xCAB0,0xCAB1,0xCAB2,0xCAB3,0xCAB4,0xCAB5,0xCAB6,0xCAB7, +0xCAB8,0xCAB9,0xCABA,0xCABB,0xCABE,0xCABF,0xCAC1,0xCAC2, +0xCAC3,0xCAC5, 0, 0, 0, 0, 0, 0, +0xCAC6,0xCAC7,0xCAC8,0xCAC9,0xCACA,0xCACB,0xCACE,0xCAD0, +0xCAD2,0xCAD4,0xCAD5,0xCAD6,0xCAD7,0xCADA,0xCADB,0xCADC, +0xCADD,0xCADE,0xCADF,0xCAE1,0xCAE2,0xCAE3,0xCAE4,0xCAE5, +0xCAE6,0xCAE7, 0, 0, 0, 0, 0, 0, +0xCAE8,0xCAE9,0xCAEA,0xCAEB,0xCAED,0xCAEE,0xCAEF,0xCAF0, +0xCAF1,0xCAF2,0xCAF3,0xCAF5,0xCAF6,0xCAF7,0xCAF8,0xCAF9, +0xCAFA,0xCAFB,0xCAFC,0xCAFD,0xCAFE,0xCAFF,0xCB00,0xCB01, +0xCB02,0xCB03,0xCB04,0xCB05,0xCB06,0xCB07,0xCB09,0xCB0A, +0x2500,0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C, +0x2524,0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B, +0x2517,0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F, +0x2528,0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542, +0x2512,0x2511,0x251A,0x2519,0x2516,0x2515,0x250E,0x250D, +0x251E,0x251F,0x2521,0x2522,0x2526,0x2527,0x2529,0x252A, +0x252D,0x252E,0x2531,0x2532,0x2535,0x2536,0x2539,0x253A, +0x253D,0x253E,0x2540,0x2541,0x2543,0x2544,0x2545,0x2546, +0x2547,0x2548,0x2549,0x254A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCB0B,0xCB0C,0xCB0D,0xCB0E,0xCB0F,0xCB11,0xCB12,0xCB13, +0xCB15,0xCB16,0xCB17,0xCB19,0xCB1A,0xCB1B,0xCB1C,0xCB1D, +0xCB1E,0xCB1F,0xCB22,0xCB23,0xCB24,0xCB25,0xCB26,0xCB27, +0xCB28,0xCB29, 0, 0, 0, 0, 0, 0, +0xCB2A,0xCB2B,0xCB2C,0xCB2D,0xCB2E,0xCB2F,0xCB30,0xCB31, +0xCB32,0xCB33,0xCB34,0xCB35,0xCB36,0xCB37,0xCB38,0xCB39, +0xCB3A,0xCB3B,0xCB3C,0xCB3D,0xCB3E,0xCB3F,0xCB40,0xCB42, +0xCB43,0xCB44, 0, 0, 0, 0, 0, 0, +0xCB45,0xCB46,0xCB47,0xCB4A,0xCB4B,0xCB4D,0xCB4E,0xCB4F, +0xCB51,0xCB52,0xCB53,0xCB54,0xCB55,0xCB56,0xCB57,0xCB5A, +0xCB5B,0xCB5C,0xCB5E,0xCB5F,0xCB60,0xCB61,0xCB62,0xCB63, +0xCB65,0xCB66,0xCB67,0xCB68,0xCB69,0xCB6A,0xCB6B,0xCB6C, +0x3395,0x3396,0x3397,0x2113,0x3398,0x33C4,0x33A3,0x33A4, +0x33A5,0x33A6,0x3399,0x339A,0x339B,0x339C,0x339D,0x339E, +0x339F,0x33A0,0x33A1,0x33A2,0x33CA,0x338D,0x338E,0x338F, +0x33CF,0x3388,0x3389,0x33C8,0x33A7,0x33A8,0x33B0,0x33B1, +0x33B2,0x33B3,0x33B4,0x33B5,0x33B6,0x33B7,0x33B8,0x33B9, +0x3380,0x3381,0x3382,0x3383,0x3384,0x33BA,0x33BB,0x33BC, +0x33BD,0x33BE,0x33BF,0x3390,0x3391,0x3392,0x3393,0x3394, +0x2126,0x33C0,0x33C1,0x338A,0x338B,0x338C,0x33D6,0x33C5, +0x33AD,0x33AE,0x33AF,0x33DB,0x33A9,0x33AA,0x33AB,0x33AC, +0x33DD,0x33D0,0x33D3,0x33C3,0x33C9,0x33DC,0x33C6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCB6D,0xCB6E,0xCB6F,0xCB70,0xCB71,0xCB72,0xCB73,0xCB74, +0xCB75,0xCB76,0xCB77,0xCB7A,0xCB7B,0xCB7C,0xCB7D,0xCB7E, +0xCB7F,0xCB80,0xCB81,0xCB82,0xCB83,0xCB84,0xCB85,0xCB86, +0xCB87,0xCB88, 0, 0, 0, 0, 0, 0, +0xCB89,0xCB8A,0xCB8B,0xCB8C,0xCB8D,0xCB8E,0xCB8F,0xCB90, +0xCB91,0xCB92,0xCB93,0xCB94,0xCB95,0xCB96,0xCB97,0xCB98, +0xCB99,0xCB9A,0xCB9B,0xCB9D,0xCB9E,0xCB9F,0xCBA0,0xCBA1, +0xCBA2,0xCBA3, 0, 0, 0, 0, 0, 0, +0xCBA4,0xCBA5,0xCBA6,0xCBA7,0xCBA8,0xCBA9,0xCBAA,0xCBAB, +0xCBAC,0xCBAD,0xCBAE,0xCBAF,0xCBB0,0xCBB1,0xCBB2,0xCBB3, +0xCBB4,0xCBB5,0xCBB6,0xCBB7,0xCBB9,0xCBBA,0xCBBB,0xCBBC, +0xCBBD,0xCBBE,0xCBBF,0xCBC0,0xCBC1,0xCBC2,0xCBC3,0xCBC4, +0x00C6,0x00D0,0x00AA,0x0126, 0,0x0132, 0,0x013F, +0x0141,0x00D8,0x0152,0x00BA,0x00DE,0x0166,0x014A, 0, +0x3260,0x3261,0x3262,0x3263,0x3264,0x3265,0x3266,0x3267, +0x3268,0x3269,0x326A,0x326B,0x326C,0x326D,0x326E,0x326F, +0x3270,0x3271,0x3272,0x3273,0x3274,0x3275,0x3276,0x3277, +0x3278,0x3279,0x327A,0x327B,0x24D0,0x24D1,0x24D2,0x24D3, +0x24D4,0x24D5,0x24D6,0x24D7,0x24D8,0x24D9,0x24DA,0x24DB, +0x24DC,0x24DD,0x24DE,0x24DF,0x24E0,0x24E1,0x24E2,0x24E3, +0x24E4,0x24E5,0x24E6,0x24E7,0x24E8,0x24E9,0x2460,0x2461, +0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468,0x2469, +0x246A,0x246B,0x246C,0x246D,0x246E,0x00BD,0x2153,0x2154, +0x00BC,0x00BE,0x215B,0x215C,0x215D,0x215E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCBC5,0xCBC6,0xCBC7,0xCBC8,0xCBC9,0xCBCA,0xCBCB,0xCBCC, +0xCBCD,0xCBCE,0xCBCF,0xCBD0,0xCBD1,0xCBD2,0xCBD3,0xCBD5, +0xCBD6,0xCBD7,0xCBD8,0xCBD9,0xCBDA,0xCBDB,0xCBDC,0xCBDD, +0xCBDE,0xCBDF, 0, 0, 0, 0, 0, 0, +0xCBE0,0xCBE1,0xCBE2,0xCBE3,0xCBE5,0xCBE6,0xCBE8,0xCBEA, +0xCBEB,0xCBEC,0xCBED,0xCBEE,0xCBEF,0xCBF0,0xCBF1,0xCBF2, +0xCBF3,0xCBF4,0xCBF5,0xCBF6,0xCBF7,0xCBF8,0xCBF9,0xCBFA, +0xCBFB,0xCBFC, 0, 0, 0, 0, 0, 0, +0xCBFD,0xCBFE,0xCBFF,0xCC00,0xCC01,0xCC02,0xCC03,0xCC04, +0xCC05,0xCC06,0xCC07,0xCC08,0xCC09,0xCC0A,0xCC0B,0xCC0E, +0xCC0F,0xCC11,0xCC12,0xCC13,0xCC15,0xCC16,0xCC17,0xCC18, +0xCC19,0xCC1A,0xCC1B,0xCC1E,0xCC1F,0xCC20,0xCC23,0xCC24, +0x00E6,0x0111,0x00F0,0x0127,0x0131,0x0133,0x0138,0x0140, +0x0142,0x00F8,0x0153,0x00DF,0x00FE,0x0167,0x014B,0x0149, +0x3200,0x3201,0x3202,0x3203,0x3204,0x3205,0x3206,0x3207, +0x3208,0x3209,0x320A,0x320B,0x320C,0x320D,0x320E,0x320F, +0x3210,0x3211,0x3212,0x3213,0x3214,0x3215,0x3216,0x3217, +0x3218,0x3219,0x321A,0x321B,0x249C,0x249D,0x249E,0x249F, +0x24A0,0x24A1,0x24A2,0x24A3,0x24A4,0x24A5,0x24A6,0x24A7, +0x24A8,0x24A9,0x24AA,0x24AB,0x24AC,0x24AD,0x24AE,0x24AF, +0x24B0,0x24B1,0x24B2,0x24B3,0x24B4,0x24B5,0x2474,0x2475, +0x2476,0x2477,0x2478,0x2479,0x247A,0x247B,0x247C,0x247D, +0x247E,0x247F,0x2480,0x2481,0x2482,0x00B9,0x00B2,0x00B3, +0x2074,0x207F,0x2081,0x2082,0x2083,0x2084, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCC25,0xCC26,0xCC2A,0xCC2B,0xCC2D,0xCC2F,0xCC31,0xCC32, +0xCC33,0xCC34,0xCC35,0xCC36,0xCC37,0xCC3A,0xCC3F,0xCC40, +0xCC41,0xCC42,0xCC43,0xCC46,0xCC47,0xCC49,0xCC4A,0xCC4B, +0xCC4D,0xCC4E, 0, 0, 0, 0, 0, 0, +0xCC4F,0xCC50,0xCC51,0xCC52,0xCC53,0xCC56,0xCC5A,0xCC5B, +0xCC5C,0xCC5D,0xCC5E,0xCC5F,0xCC61,0xCC62,0xCC63,0xCC65, +0xCC67,0xCC69,0xCC6A,0xCC6B,0xCC6C,0xCC6D,0xCC6E,0xCC6F, +0xCC71,0xCC72, 0, 0, 0, 0, 0, 0, +0xCC73,0xCC74,0xCC76,0xCC77,0xCC78,0xCC79,0xCC7A,0xCC7B, +0xCC7C,0xCC7D,0xCC7E,0xCC7F,0xCC80,0xCC81,0xCC82,0xCC83, +0xCC84,0xCC85,0xCC86,0xCC87,0xCC88,0xCC89,0xCC8A,0xCC8B, +0xCC8C,0xCC8D,0xCC8E,0xCC8F,0xCC90,0xCC91,0xCC92,0xCC93, +0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048, +0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050, +0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058, +0x3059,0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060, +0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068, +0x3069,0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070, +0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078, +0x3079,0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080, +0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088, +0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090, +0x3091,0x3092,0x3093, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCC94,0xCC95,0xCC96,0xCC97,0xCC9A,0xCC9B,0xCC9D,0xCC9E, +0xCC9F,0xCCA1,0xCCA2,0xCCA3,0xCCA4,0xCCA5,0xCCA6,0xCCA7, +0xCCAA,0xCCAE,0xCCAF,0xCCB0,0xCCB1,0xCCB2,0xCCB3,0xCCB6, +0xCCB7,0xCCB9, 0, 0, 0, 0, 0, 0, +0xCCBA,0xCCBB,0xCCBD,0xCCBE,0xCCBF,0xCCC0,0xCCC1,0xCCC2, +0xCCC3,0xCCC6,0xCCC8,0xCCCA,0xCCCB,0xCCCC,0xCCCD,0xCCCE, +0xCCCF,0xCCD1,0xCCD2,0xCCD3,0xCCD5,0xCCD6,0xCCD7,0xCCD8, +0xCCD9,0xCCDA, 0, 0, 0, 0, 0, 0, +0xCCDB,0xCCDC,0xCCDD,0xCCDE,0xCCDF,0xCCE0,0xCCE1,0xCCE2, +0xCCE3,0xCCE5,0xCCE6,0xCCE7,0xCCE8,0xCCE9,0xCCEA,0xCCEB, +0xCCED,0xCCEE,0xCCEF,0xCCF1,0xCCF2,0xCCF3,0xCCF4,0xCCF5, +0xCCF6,0xCCF7,0xCCF8,0xCCF9,0xCCFA,0xCCFB,0xCCFC,0xCCFD, +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, +0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, +0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, +0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, +0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, +0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, +0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, +0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF,0x30E0, +0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,0x30E8, +0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,0x30F0, +0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCCFE,0xCCFF,0xCD00,0xCD02,0xCD03,0xCD04,0xCD05,0xCD06, +0xCD07,0xCD0A,0xCD0B,0xCD0D,0xCD0E,0xCD0F,0xCD11,0xCD12, +0xCD13,0xCD14,0xCD15,0xCD16,0xCD17,0xCD1A,0xCD1C,0xCD1E, +0xCD1F,0xCD20, 0, 0, 0, 0, 0, 0, +0xCD21,0xCD22,0xCD23,0xCD25,0xCD26,0xCD27,0xCD29,0xCD2A, +0xCD2B,0xCD2D,0xCD2E,0xCD2F,0xCD30,0xCD31,0xCD32,0xCD33, +0xCD34,0xCD35,0xCD36,0xCD37,0xCD38,0xCD3A,0xCD3B,0xCD3C, +0xCD3D,0xCD3E, 0, 0, 0, 0, 0, 0, +0xCD3F,0xCD40,0xCD41,0xCD42,0xCD43,0xCD44,0xCD45,0xCD46, +0xCD47,0xCD48,0xCD49,0xCD4A,0xCD4B,0xCD4C,0xCD4D,0xCD4E, +0xCD4F,0xCD50,0xCD51,0xCD52,0xCD53,0xCD54,0xCD55,0xCD56, +0xCD57,0xCD58,0xCD59,0xCD5A,0xCD5B,0xCD5D,0xCD5E,0xCD5F, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, +0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, +0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, +0x042F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446, +0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E, +0x044F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCD61,0xCD62,0xCD63,0xCD65,0xCD66,0xCD67,0xCD68,0xCD69, +0xCD6A,0xCD6B,0xCD6E,0xCD70,0xCD72,0xCD73,0xCD74,0xCD75, +0xCD76,0xCD77,0xCD79,0xCD7A,0xCD7B,0xCD7C,0xCD7D,0xCD7E, +0xCD7F,0xCD80, 0, 0, 0, 0, 0, 0, +0xCD81,0xCD82,0xCD83,0xCD84,0xCD85,0xCD86,0xCD87,0xCD89, +0xCD8A,0xCD8B,0xCD8C,0xCD8D,0xCD8E,0xCD8F,0xCD90,0xCD91, +0xCD92,0xCD93,0xCD96,0xCD97,0xCD99,0xCD9A,0xCD9B,0xCD9D, +0xCD9E,0xCD9F, 0, 0, 0, 0, 0, 0, +0xCDA0,0xCDA1,0xCDA2,0xCDA3,0xCDA6,0xCDA8,0xCDAA,0xCDAB, +0xCDAC,0xCDAD,0xCDAE,0xCDAF,0xCDB1,0xCDB2,0xCDB3,0xCDB4, +0xCDB5,0xCDB6,0xCDB7,0xCDB8,0xCDB9,0xCDBA,0xCDBB,0xCDBC, +0xCDBD,0xCDBE,0xCDBF,0xCDC0,0xCDC1,0xCDC2,0xCDC3,0xCDC5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCDC6,0xCDC7,0xCDC8,0xCDC9,0xCDCA,0xCDCB,0xCDCD,0xCDCE, +0xCDCF,0xCDD1,0xCDD2,0xCDD3,0xCDD4,0xCDD5,0xCDD6,0xCDD7, +0xCDD8,0xCDD9,0xCDDA,0xCDDB,0xCDDC,0xCDDD,0xCDDE,0xCDDF, +0xCDE0,0xCDE1, 0, 0, 0, 0, 0, 0, +0xCDE2,0xCDE3,0xCDE4,0xCDE5,0xCDE6,0xCDE7,0xCDE9,0xCDEA, +0xCDEB,0xCDED,0xCDEE,0xCDEF,0xCDF1,0xCDF2,0xCDF3,0xCDF4, +0xCDF5,0xCDF6,0xCDF7,0xCDFA,0xCDFC,0xCDFE,0xCDFF,0xCE00, +0xCE01,0xCE02, 0, 0, 0, 0, 0, 0, +0xCE03,0xCE05,0xCE06,0xCE07,0xCE09,0xCE0A,0xCE0B,0xCE0D, +0xCE0E,0xCE0F,0xCE10,0xCE11,0xCE12,0xCE13,0xCE15,0xCE16, +0xCE17,0xCE18,0xCE1A,0xCE1B,0xCE1C,0xCE1D,0xCE1E,0xCE1F, +0xCE22,0xCE23,0xCE25,0xCE26,0xCE27,0xCE29,0xCE2A,0xCE2B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCE2C,0xCE2D,0xCE2E,0xCE2F,0xCE32,0xCE34,0xCE36,0xCE37, +0xCE38,0xCE39,0xCE3A,0xCE3B,0xCE3C,0xCE3D,0xCE3E,0xCE3F, +0xCE40,0xCE41,0xCE42,0xCE43,0xCE44,0xCE45,0xCE46,0xCE47, +0xCE48,0xCE49, 0, 0, 0, 0, 0, 0, +0xCE4A,0xCE4B,0xCE4C,0xCE4D,0xCE4E,0xCE4F,0xCE50,0xCE51, +0xCE52,0xCE53,0xCE54,0xCE55,0xCE56,0xCE57,0xCE5A,0xCE5B, +0xCE5D,0xCE5E,0xCE62,0xCE63,0xCE64,0xCE65,0xCE66,0xCE67, +0xCE6A,0xCE6C, 0, 0, 0, 0, 0, 0, +0xCE6E,0xCE6F,0xCE70,0xCE71,0xCE72,0xCE73,0xCE76,0xCE77, +0xCE79,0xCE7A,0xCE7B,0xCE7D,0xCE7E,0xCE7F,0xCE80,0xCE81, +0xCE82,0xCE83,0xCE86,0xCE88,0xCE8A,0xCE8B,0xCE8C,0xCE8D, +0xCE8E,0xCE8F,0xCE92,0xCE93,0xCE95,0xCE96,0xCE97,0xCE99, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCE9A,0xCE9B,0xCE9C,0xCE9D,0xCE9E,0xCE9F,0xCEA2,0xCEA6, +0xCEA7,0xCEA8,0xCEA9,0xCEAA,0xCEAB,0xCEAE,0xCEAF,0xCEB0, +0xCEB1,0xCEB2,0xCEB3,0xCEB4,0xCEB5,0xCEB6,0xCEB7,0xCEB8, +0xCEB9,0xCEBA, 0, 0, 0, 0, 0, 0, +0xCEBB,0xCEBC,0xCEBD,0xCEBE,0xCEBF,0xCEC0,0xCEC2,0xCEC3, +0xCEC4,0xCEC5,0xCEC6,0xCEC7,0xCEC8,0xCEC9,0xCECA,0xCECB, +0xCECC,0xCECD,0xCECE,0xCECF,0xCED0,0xCED1,0xCED2,0xCED3, +0xCED4,0xCED5, 0, 0, 0, 0, 0, 0, +0xCED6,0xCED7,0xCED8,0xCED9,0xCEDA,0xCEDB,0xCEDC,0xCEDD, +0xCEDE,0xCEDF,0xCEE0,0xCEE1,0xCEE2,0xCEE3,0xCEE6,0xCEE7, +0xCEE9,0xCEEA,0xCEED,0xCEEE,0xCEEF,0xCEF0,0xCEF1,0xCEF2, +0xCEF3,0xCEF6,0xCEFA,0xCEFB,0xCEFC,0xCEFD,0xCEFE,0xCEFF, +0xAC00,0xAC01,0xAC04,0xAC07,0xAC08,0xAC09,0xAC0A,0xAC10, +0xAC11,0xAC12,0xAC13,0xAC14,0xAC15,0xAC16,0xAC17,0xAC19, +0xAC1A,0xAC1B,0xAC1C,0xAC1D,0xAC20,0xAC24,0xAC2C,0xAC2D, +0xAC2F,0xAC30,0xAC31,0xAC38,0xAC39,0xAC3C,0xAC40,0xAC4B, +0xAC4D,0xAC54,0xAC58,0xAC5C,0xAC70,0xAC71,0xAC74,0xAC77, +0xAC78,0xAC7A,0xAC80,0xAC81,0xAC83,0xAC84,0xAC85,0xAC86, +0xAC89,0xAC8A,0xAC8B,0xAC8C,0xAC90,0xAC94,0xAC9C,0xAC9D, +0xAC9F,0xACA0,0xACA1,0xACA8,0xACA9,0xACAA,0xACAC,0xACAF, +0xACB0,0xACB8,0xACB9,0xACBB,0xACBC,0xACBD,0xACC1,0xACC4, +0xACC8,0xACCC,0xACD5,0xACD7,0xACE0,0xACE1,0xACE4,0xACE7, +0xACE8,0xACEA,0xACEC,0xACEF,0xACF0,0xACF1,0xACF3,0xACF5, +0xACF6,0xACFC,0xACFD,0xAD00,0xAD04,0xAD06, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCF02,0xCF03,0xCF05,0xCF06,0xCF07,0xCF09,0xCF0A,0xCF0B, +0xCF0C,0xCF0D,0xCF0E,0xCF0F,0xCF12,0xCF14,0xCF16,0xCF17, +0xCF18,0xCF19,0xCF1A,0xCF1B,0xCF1D,0xCF1E,0xCF1F,0xCF21, +0xCF22,0xCF23, 0, 0, 0, 0, 0, 0, +0xCF25,0xCF26,0xCF27,0xCF28,0xCF29,0xCF2A,0xCF2B,0xCF2E, +0xCF32,0xCF33,0xCF34,0xCF35,0xCF36,0xCF37,0xCF39,0xCF3A, +0xCF3B,0xCF3C,0xCF3D,0xCF3E,0xCF3F,0xCF40,0xCF41,0xCF42, +0xCF43,0xCF44, 0, 0, 0, 0, 0, 0, +0xCF45,0xCF46,0xCF47,0xCF48,0xCF49,0xCF4A,0xCF4B,0xCF4C, +0xCF4D,0xCF4E,0xCF4F,0xCF50,0xCF51,0xCF52,0xCF53,0xCF56, +0xCF57,0xCF59,0xCF5A,0xCF5B,0xCF5D,0xCF5E,0xCF5F,0xCF60, +0xCF61,0xCF62,0xCF63,0xCF66,0xCF68,0xCF6A,0xCF6B,0xCF6C, +0xAD0C,0xAD0D,0xAD0F,0xAD11,0xAD18,0xAD1C,0xAD20,0xAD29, +0xAD2C,0xAD2D,0xAD34,0xAD35,0xAD38,0xAD3C,0xAD44,0xAD45, +0xAD47,0xAD49,0xAD50,0xAD54,0xAD58,0xAD61,0xAD63,0xAD6C, +0xAD6D,0xAD70,0xAD73,0xAD74,0xAD75,0xAD76,0xAD7B,0xAD7C, +0xAD7D,0xAD7F,0xAD81,0xAD82,0xAD88,0xAD89,0xAD8C,0xAD90, +0xAD9C,0xAD9D,0xADA4,0xADB7,0xADC0,0xADC1,0xADC4,0xADC8, +0xADD0,0xADD1,0xADD3,0xADDC,0xADE0,0xADE4,0xADF8,0xADF9, +0xADFC,0xADFF,0xAE00,0xAE01,0xAE08,0xAE09,0xAE0B,0xAE0D, +0xAE14,0xAE30,0xAE31,0xAE34,0xAE37,0xAE38,0xAE3A,0xAE40, +0xAE41,0xAE43,0xAE45,0xAE46,0xAE4A,0xAE4C,0xAE4D,0xAE4E, +0xAE50,0xAE54,0xAE56,0xAE5C,0xAE5D,0xAE5F,0xAE60,0xAE61, +0xAE65,0xAE68,0xAE69,0xAE6C,0xAE70,0xAE78, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCF6D,0xCF6E,0xCF6F,0xCF72,0xCF73,0xCF75,0xCF76,0xCF77, +0xCF79,0xCF7A,0xCF7B,0xCF7C,0xCF7D,0xCF7E,0xCF7F,0xCF81, +0xCF82,0xCF83,0xCF84,0xCF86,0xCF87,0xCF88,0xCF89,0xCF8A, +0xCF8B,0xCF8D, 0, 0, 0, 0, 0, 0, +0xCF8E,0xCF8F,0xCF90,0xCF91,0xCF92,0xCF93,0xCF94,0xCF95, +0xCF96,0xCF97,0xCF98,0xCF99,0xCF9A,0xCF9B,0xCF9C,0xCF9D, +0xCF9E,0xCF9F,0xCFA0,0xCFA2,0xCFA3,0xCFA4,0xCFA5,0xCFA6, +0xCFA7,0xCFA9, 0, 0, 0, 0, 0, 0, +0xCFAA,0xCFAB,0xCFAC,0xCFAD,0xCFAE,0xCFAF,0xCFB1,0xCFB2, +0xCFB3,0xCFB4,0xCFB5,0xCFB6,0xCFB7,0xCFB8,0xCFB9,0xCFBA, +0xCFBB,0xCFBC,0xCFBD,0xCFBE,0xCFBF,0xCFC0,0xCFC1,0xCFC2, +0xCFC3,0xCFC5,0xCFC6,0xCFC7,0xCFC8,0xCFC9,0xCFCA,0xCFCB, +0xAE79,0xAE7B,0xAE7C,0xAE7D,0xAE84,0xAE85,0xAE8C,0xAEBC, +0xAEBD,0xAEBE,0xAEC0,0xAEC4,0xAECC,0xAECD,0xAECF,0xAED0, +0xAED1,0xAED8,0xAED9,0xAEDC,0xAEE8,0xAEEB,0xAEED,0xAEF4, +0xAEF8,0xAEFC,0xAF07,0xAF08,0xAF0D,0xAF10,0xAF2C,0xAF2D, +0xAF30,0xAF32,0xAF34,0xAF3C,0xAF3D,0xAF3F,0xAF41,0xAF42, +0xAF43,0xAF48,0xAF49,0xAF50,0xAF5C,0xAF5D,0xAF64,0xAF65, +0xAF79,0xAF80,0xAF84,0xAF88,0xAF90,0xAF91,0xAF95,0xAF9C, +0xAFB8,0xAFB9,0xAFBC,0xAFC0,0xAFC7,0xAFC8,0xAFC9,0xAFCB, +0xAFCD,0xAFCE,0xAFD4,0xAFDC,0xAFE8,0xAFE9,0xAFF0,0xAFF1, +0xAFF4,0xAFF8,0xB000,0xB001,0xB004,0xB00C,0xB010,0xB014, +0xB01C,0xB01D,0xB028,0xB044,0xB045,0xB048,0xB04A,0xB04C, +0xB04E,0xB053,0xB054,0xB055,0xB057,0xB059, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCFCC,0xCFCD,0xCFCE,0xCFCF,0xCFD0,0xCFD1,0xCFD2,0xCFD3, +0xCFD4,0xCFD5,0xCFD6,0xCFD7,0xCFD8,0xCFD9,0xCFDA,0xCFDB, +0xCFDC,0xCFDD,0xCFDE,0xCFDF,0xCFE2,0xCFE3,0xCFE5,0xCFE6, +0xCFE7,0xCFE9, 0, 0, 0, 0, 0, 0, +0xCFEA,0xCFEB,0xCFEC,0xCFED,0xCFEE,0xCFEF,0xCFF2,0xCFF4, +0xCFF6,0xCFF7,0xCFF8,0xCFF9,0xCFFA,0xCFFB,0xCFFD,0xCFFE, +0xCFFF,0xD001,0xD002,0xD003,0xD005,0xD006,0xD007,0xD008, +0xD009,0xD00A, 0, 0, 0, 0, 0, 0, +0xD00B,0xD00C,0xD00D,0xD00E,0xD00F,0xD010,0xD012,0xD013, +0xD014,0xD015,0xD016,0xD017,0xD019,0xD01A,0xD01B,0xD01C, +0xD01D,0xD01E,0xD01F,0xD020,0xD021,0xD022,0xD023,0xD024, +0xD025,0xD026,0xD027,0xD028,0xD029,0xD02A,0xD02B,0xD02C, +0xB05D,0xB07C,0xB07D,0xB080,0xB084,0xB08C,0xB08D,0xB08F, +0xB091,0xB098,0xB099,0xB09A,0xB09C,0xB09F,0xB0A0,0xB0A1, +0xB0A2,0xB0A8,0xB0A9,0xB0AB,0xB0AC,0xB0AD,0xB0AE,0xB0AF, +0xB0B1,0xB0B3,0xB0B4,0xB0B5,0xB0B8,0xB0BC,0xB0C4,0xB0C5, +0xB0C7,0xB0C8,0xB0C9,0xB0D0,0xB0D1,0xB0D4,0xB0D8,0xB0E0, +0xB0E5,0xB108,0xB109,0xB10B,0xB10C,0xB110,0xB112,0xB113, +0xB118,0xB119,0xB11B,0xB11C,0xB11D,0xB123,0xB124,0xB125, +0xB128,0xB12C,0xB134,0xB135,0xB137,0xB138,0xB139,0xB140, +0xB141,0xB144,0xB148,0xB150,0xB151,0xB154,0xB155,0xB158, +0xB15C,0xB160,0xB178,0xB179,0xB17C,0xB180,0xB182,0xB188, +0xB189,0xB18B,0xB18D,0xB192,0xB193,0xB194,0xB198,0xB19C, +0xB1A8,0xB1CC,0xB1D0,0xB1D4,0xB1DC,0xB1DD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD02E,0xD02F,0xD030,0xD031,0xD032,0xD033,0xD036,0xD037, +0xD039,0xD03A,0xD03B,0xD03D,0xD03E,0xD03F,0xD040,0xD041, +0xD042,0xD043,0xD046,0xD048,0xD04A,0xD04B,0xD04C,0xD04D, +0xD04E,0xD04F, 0, 0, 0, 0, 0, 0, +0xD051,0xD052,0xD053,0xD055,0xD056,0xD057,0xD059,0xD05A, +0xD05B,0xD05C,0xD05D,0xD05E,0xD05F,0xD061,0xD062,0xD063, +0xD064,0xD065,0xD066,0xD067,0xD068,0xD069,0xD06A,0xD06B, +0xD06E,0xD06F, 0, 0, 0, 0, 0, 0, +0xD071,0xD072,0xD073,0xD075,0xD076,0xD077,0xD078,0xD079, +0xD07A,0xD07B,0xD07E,0xD07F,0xD080,0xD082,0xD083,0xD084, +0xD085,0xD086,0xD087,0xD088,0xD089,0xD08A,0xD08B,0xD08C, +0xD08D,0xD08E,0xD08F,0xD090,0xD091,0xD092,0xD093,0xD094, +0xB1DF,0xB1E8,0xB1E9,0xB1EC,0xB1F0,0xB1F9,0xB1FB,0xB1FD, +0xB204,0xB205,0xB208,0xB20B,0xB20C,0xB214,0xB215,0xB217, +0xB219,0xB220,0xB234,0xB23C,0xB258,0xB25C,0xB260,0xB268, +0xB269,0xB274,0xB275,0xB27C,0xB284,0xB285,0xB289,0xB290, +0xB291,0xB294,0xB298,0xB299,0xB29A,0xB2A0,0xB2A1,0xB2A3, +0xB2A5,0xB2A6,0xB2AA,0xB2AC,0xB2B0,0xB2B4,0xB2C8,0xB2C9, +0xB2CC,0xB2D0,0xB2D2,0xB2D8,0xB2D9,0xB2DB,0xB2DD,0xB2E2, +0xB2E4,0xB2E5,0xB2E6,0xB2E8,0xB2EB,0xB2EC,0xB2ED,0xB2EE, +0xB2EF,0xB2F3,0xB2F4,0xB2F5,0xB2F7,0xB2F8,0xB2F9,0xB2FA, +0xB2FB,0xB2FF,0xB300,0xB301,0xB304,0xB308,0xB310,0xB311, +0xB313,0xB314,0xB315,0xB31C,0xB354,0xB355,0xB356,0xB358, +0xB35B,0xB35C,0xB35E,0xB35F,0xB364,0xB365, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD095,0xD096,0xD097,0xD098,0xD099,0xD09A,0xD09B,0xD09C, +0xD09D,0xD09E,0xD09F,0xD0A0,0xD0A1,0xD0A2,0xD0A3,0xD0A6, +0xD0A7,0xD0A9,0xD0AA,0xD0AB,0xD0AD,0xD0AE,0xD0AF,0xD0B0, +0xD0B1,0xD0B2, 0, 0, 0, 0, 0, 0, +0xD0B3,0xD0B6,0xD0B8,0xD0BA,0xD0BB,0xD0BC,0xD0BD,0xD0BE, +0xD0BF,0xD0C2,0xD0C3,0xD0C5,0xD0C6,0xD0C7,0xD0CA,0xD0CB, +0xD0CC,0xD0CD,0xD0CE,0xD0CF,0xD0D2,0xD0D6,0xD0D7,0xD0D8, +0xD0D9,0xD0DA, 0, 0, 0, 0, 0, 0, +0xD0DB,0xD0DE,0xD0DF,0xD0E1,0xD0E2,0xD0E3,0xD0E5,0xD0E6, +0xD0E7,0xD0E8,0xD0E9,0xD0EA,0xD0EB,0xD0EE,0xD0F2,0xD0F3, +0xD0F4,0xD0F5,0xD0F6,0xD0F7,0xD0F9,0xD0FA,0xD0FB,0xD0FC, +0xD0FD,0xD0FE,0xD0FF,0xD100,0xD101,0xD102,0xD103,0xD104, +0xB367,0xB369,0xB36B,0xB36E,0xB370,0xB371,0xB374,0xB378, +0xB380,0xB381,0xB383,0xB384,0xB385,0xB38C,0xB390,0xB394, +0xB3A0,0xB3A1,0xB3A8,0xB3AC,0xB3C4,0xB3C5,0xB3C8,0xB3CB, +0xB3CC,0xB3CE,0xB3D0,0xB3D4,0xB3D5,0xB3D7,0xB3D9,0xB3DB, +0xB3DD,0xB3E0,0xB3E4,0xB3E8,0xB3FC,0xB410,0xB418,0xB41C, +0xB420,0xB428,0xB429,0xB42B,0xB434,0xB450,0xB451,0xB454, +0xB458,0xB460,0xB461,0xB463,0xB465,0xB46C,0xB480,0xB488, +0xB49D,0xB4A4,0xB4A8,0xB4AC,0xB4B5,0xB4B7,0xB4B9,0xB4C0, +0xB4C4,0xB4C8,0xB4D0,0xB4D5,0xB4DC,0xB4DD,0xB4E0,0xB4E3, +0xB4E4,0xB4E6,0xB4EC,0xB4ED,0xB4EF,0xB4F1,0xB4F8,0xB514, +0xB515,0xB518,0xB51B,0xB51C,0xB524,0xB525,0xB527,0xB528, +0xB529,0xB52A,0xB530,0xB531,0xB534,0xB538, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD105,0xD106,0xD107,0xD108,0xD109,0xD10A,0xD10B,0xD10C, +0xD10E,0xD10F,0xD110,0xD111,0xD112,0xD113,0xD114,0xD115, +0xD116,0xD117,0xD118,0xD119,0xD11A,0xD11B,0xD11C,0xD11D, +0xD11E,0xD11F, 0, 0, 0, 0, 0, 0, +0xD120,0xD121,0xD122,0xD123,0xD124,0xD125,0xD126,0xD127, +0xD128,0xD129,0xD12A,0xD12B,0xD12C,0xD12D,0xD12E,0xD12F, +0xD132,0xD133,0xD135,0xD136,0xD137,0xD139,0xD13B,0xD13C, +0xD13D,0xD13E, 0, 0, 0, 0, 0, 0, +0xD13F,0xD142,0xD146,0xD147,0xD148,0xD149,0xD14A,0xD14B, +0xD14E,0xD14F,0xD151,0xD152,0xD153,0xD155,0xD156,0xD157, +0xD158,0xD159,0xD15A,0xD15B,0xD15E,0xD160,0xD162,0xD163, +0xD164,0xD165,0xD166,0xD167,0xD169,0xD16A,0xD16B,0xD16D, +0xB540,0xB541,0xB543,0xB544,0xB545,0xB54B,0xB54C,0xB54D, +0xB550,0xB554,0xB55C,0xB55D,0xB55F,0xB560,0xB561,0xB5A0, +0xB5A1,0xB5A4,0xB5A8,0xB5AA,0xB5AB,0xB5B0,0xB5B1,0xB5B3, +0xB5B4,0xB5B5,0xB5BB,0xB5BC,0xB5BD,0xB5C0,0xB5C4,0xB5CC, +0xB5CD,0xB5CF,0xB5D0,0xB5D1,0xB5D8,0xB5EC,0xB610,0xB611, +0xB614,0xB618,0xB625,0xB62C,0xB634,0xB648,0xB664,0xB668, +0xB69C,0xB69D,0xB6A0,0xB6A4,0xB6AB,0xB6AC,0xB6B1,0xB6D4, +0xB6F0,0xB6F4,0xB6F8,0xB700,0xB701,0xB705,0xB728,0xB729, +0xB72C,0xB72F,0xB730,0xB738,0xB739,0xB73B,0xB744,0xB748, +0xB74C,0xB754,0xB755,0xB760,0xB764,0xB768,0xB770,0xB771, +0xB773,0xB775,0xB77C,0xB77D,0xB780,0xB784,0xB78C,0xB78D, +0xB78F,0xB790,0xB791,0xB792,0xB796,0xB797, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD16E,0xD16F,0xD170,0xD171,0xD172,0xD173,0xD174,0xD175, +0xD176,0xD177,0xD178,0xD179,0xD17A,0xD17B,0xD17D,0xD17E, +0xD17F,0xD180,0xD181,0xD182,0xD183,0xD185,0xD186,0xD187, +0xD189,0xD18A, 0, 0, 0, 0, 0, 0, +0xD18B,0xD18C,0xD18D,0xD18E,0xD18F,0xD190,0xD191,0xD192, +0xD193,0xD194,0xD195,0xD196,0xD197,0xD198,0xD199,0xD19A, +0xD19B,0xD19C,0xD19D,0xD19E,0xD19F,0xD1A2,0xD1A3,0xD1A5, +0xD1A6,0xD1A7, 0, 0, 0, 0, 0, 0, +0xD1A9,0xD1AA,0xD1AB,0xD1AC,0xD1AD,0xD1AE,0xD1AF,0xD1B2, +0xD1B4,0xD1B6,0xD1B7,0xD1B8,0xD1B9,0xD1BB,0xD1BD,0xD1BE, +0xD1BF,0xD1C1,0xD1C2,0xD1C3,0xD1C4,0xD1C5,0xD1C6,0xD1C7, +0xD1C8,0xD1C9,0xD1CA,0xD1CB,0xD1CC,0xD1CD,0xD1CE,0xD1CF, +0xB798,0xB799,0xB79C,0xB7A0,0xB7A8,0xB7A9,0xB7AB,0xB7AC, +0xB7AD,0xB7B4,0xB7B5,0xB7B8,0xB7C7,0xB7C9,0xB7EC,0xB7ED, +0xB7F0,0xB7F4,0xB7FC,0xB7FD,0xB7FF,0xB800,0xB801,0xB807, +0xB808,0xB809,0xB80C,0xB810,0xB818,0xB819,0xB81B,0xB81D, +0xB824,0xB825,0xB828,0xB82C,0xB834,0xB835,0xB837,0xB838, +0xB839,0xB840,0xB844,0xB851,0xB853,0xB85C,0xB85D,0xB860, +0xB864,0xB86C,0xB86D,0xB86F,0xB871,0xB878,0xB87C,0xB88D, +0xB8A8,0xB8B0,0xB8B4,0xB8B8,0xB8C0,0xB8C1,0xB8C3,0xB8C5, +0xB8CC,0xB8D0,0xB8D4,0xB8DD,0xB8DF,0xB8E1,0xB8E8,0xB8E9, +0xB8EC,0xB8F0,0xB8F8,0xB8F9,0xB8FB,0xB8FD,0xB904,0xB918, +0xB920,0xB93C,0xB93D,0xB940,0xB944,0xB94C,0xB94F,0xB951, +0xB958,0xB959,0xB95C,0xB960,0xB968,0xB969, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD1D0,0xD1D1,0xD1D2,0xD1D3,0xD1D4,0xD1D5,0xD1D6,0xD1D7, +0xD1D9,0xD1DA,0xD1DB,0xD1DC,0xD1DD,0xD1DE,0xD1DF,0xD1E0, +0xD1E1,0xD1E2,0xD1E3,0xD1E4,0xD1E5,0xD1E6,0xD1E7,0xD1E8, +0xD1E9,0xD1EA, 0, 0, 0, 0, 0, 0, +0xD1EB,0xD1EC,0xD1ED,0xD1EE,0xD1EF,0xD1F0,0xD1F1,0xD1F2, +0xD1F3,0xD1F5,0xD1F6,0xD1F7,0xD1F9,0xD1FA,0xD1FB,0xD1FC, +0xD1FD,0xD1FE,0xD1FF,0xD200,0xD201,0xD202,0xD203,0xD204, +0xD205,0xD206, 0, 0, 0, 0, 0, 0, +0xD208,0xD20A,0xD20B,0xD20C,0xD20D,0xD20E,0xD20F,0xD211, +0xD212,0xD213,0xD214,0xD215,0xD216,0xD217,0xD218,0xD219, +0xD21A,0xD21B,0xD21C,0xD21D,0xD21E,0xD21F,0xD220,0xD221, +0xD222,0xD223,0xD224,0xD225,0xD226,0xD227,0xD228,0xD229, +0xB96B,0xB96D,0xB974,0xB975,0xB978,0xB97C,0xB984,0xB985, +0xB987,0xB989,0xB98A,0xB98D,0xB98E,0xB9AC,0xB9AD,0xB9B0, +0xB9B4,0xB9BC,0xB9BD,0xB9BF,0xB9C1,0xB9C8,0xB9C9,0xB9CC, +0xB9CE,0xB9CF,0xB9D0,0xB9D1,0xB9D2,0xB9D8,0xB9D9,0xB9DB, +0xB9DD,0xB9DE,0xB9E1,0xB9E3,0xB9E4,0xB9E5,0xB9E8,0xB9EC, +0xB9F4,0xB9F5,0xB9F7,0xB9F8,0xB9F9,0xB9FA,0xBA00,0xBA01, +0xBA08,0xBA15,0xBA38,0xBA39,0xBA3C,0xBA40,0xBA42,0xBA48, +0xBA49,0xBA4B,0xBA4D,0xBA4E,0xBA53,0xBA54,0xBA55,0xBA58, +0xBA5C,0xBA64,0xBA65,0xBA67,0xBA68,0xBA69,0xBA70,0xBA71, +0xBA74,0xBA78,0xBA83,0xBA84,0xBA85,0xBA87,0xBA8C,0xBAA8, +0xBAA9,0xBAAB,0xBAAC,0xBAB0,0xBAB2,0xBAB8,0xBAB9,0xBABB, +0xBABD,0xBAC4,0xBAC8,0xBAD8,0xBAD9,0xBAFC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD22A,0xD22B,0xD22E,0xD22F,0xD231,0xD232,0xD233,0xD235, +0xD236,0xD237,0xD238,0xD239,0xD23A,0xD23B,0xD23E,0xD240, +0xD242,0xD243,0xD244,0xD245,0xD246,0xD247,0xD249,0xD24A, +0xD24B,0xD24C, 0, 0, 0, 0, 0, 0, +0xD24D,0xD24E,0xD24F,0xD250,0xD251,0xD252,0xD253,0xD254, +0xD255,0xD256,0xD257,0xD258,0xD259,0xD25A,0xD25B,0xD25D, +0xD25E,0xD25F,0xD260,0xD261,0xD262,0xD263,0xD265,0xD266, +0xD267,0xD268, 0, 0, 0, 0, 0, 0, +0xD269,0xD26A,0xD26B,0xD26C,0xD26D,0xD26E,0xD26F,0xD270, +0xD271,0xD272,0xD273,0xD274,0xD275,0xD276,0xD277,0xD278, +0xD279,0xD27A,0xD27B,0xD27C,0xD27D,0xD27E,0xD27F,0xD282, +0xD283,0xD285,0xD286,0xD287,0xD289,0xD28A,0xD28B,0xD28C, +0xBB00,0xBB04,0xBB0D,0xBB0F,0xBB11,0xBB18,0xBB1C,0xBB20, +0xBB29,0xBB2B,0xBB34,0xBB35,0xBB36,0xBB38,0xBB3B,0xBB3C, +0xBB3D,0xBB3E,0xBB44,0xBB45,0xBB47,0xBB49,0xBB4D,0xBB4F, +0xBB50,0xBB54,0xBB58,0xBB61,0xBB63,0xBB6C,0xBB88,0xBB8C, +0xBB90,0xBBA4,0xBBA8,0xBBAC,0xBBB4,0xBBB7,0xBBC0,0xBBC4, +0xBBC8,0xBBD0,0xBBD3,0xBBF8,0xBBF9,0xBBFC,0xBBFF,0xBC00, +0xBC02,0xBC08,0xBC09,0xBC0B,0xBC0C,0xBC0D,0xBC0F,0xBC11, +0xBC14,0xBC15,0xBC16,0xBC17,0xBC18,0xBC1B,0xBC1C,0xBC1D, +0xBC1E,0xBC1F,0xBC24,0xBC25,0xBC27,0xBC29,0xBC2D,0xBC30, +0xBC31,0xBC34,0xBC38,0xBC40,0xBC41,0xBC43,0xBC44,0xBC45, +0xBC49,0xBC4C,0xBC4D,0xBC50,0xBC5D,0xBC84,0xBC85,0xBC88, +0xBC8B,0xBC8C,0xBC8E,0xBC94,0xBC95,0xBC97, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD28D,0xD28E,0xD28F,0xD292,0xD293,0xD294,0xD296,0xD297, +0xD298,0xD299,0xD29A,0xD29B,0xD29D,0xD29E,0xD29F,0xD2A1, +0xD2A2,0xD2A3,0xD2A5,0xD2A6,0xD2A7,0xD2A8,0xD2A9,0xD2AA, +0xD2AB,0xD2AD, 0, 0, 0, 0, 0, 0, +0xD2AE,0xD2AF,0xD2B0,0xD2B2,0xD2B3,0xD2B4,0xD2B5,0xD2B6, +0xD2B7,0xD2BA,0xD2BB,0xD2BD,0xD2BE,0xD2C1,0xD2C3,0xD2C4, +0xD2C5,0xD2C6,0xD2C7,0xD2CA,0xD2CC,0xD2CD,0xD2CE,0xD2CF, +0xD2D0,0xD2D1, 0, 0, 0, 0, 0, 0, +0xD2D2,0xD2D3,0xD2D5,0xD2D6,0xD2D7,0xD2D9,0xD2DA,0xD2DB, +0xD2DD,0xD2DE,0xD2DF,0xD2E0,0xD2E1,0xD2E2,0xD2E3,0xD2E6, +0xD2E7,0xD2E8,0xD2E9,0xD2EA,0xD2EB,0xD2EC,0xD2ED,0xD2EE, +0xD2EF,0xD2F2,0xD2F3,0xD2F5,0xD2F6,0xD2F7,0xD2F9,0xD2FA, +0xBC99,0xBC9A,0xBCA0,0xBCA1,0xBCA4,0xBCA7,0xBCA8,0xBCB0, +0xBCB1,0xBCB3,0xBCB4,0xBCB5,0xBCBC,0xBCBD,0xBCC0,0xBCC4, +0xBCCD,0xBCCF,0xBCD0,0xBCD1,0xBCD5,0xBCD8,0xBCDC,0xBCF4, +0xBCF5,0xBCF6,0xBCF8,0xBCFC,0xBD04,0xBD05,0xBD07,0xBD09, +0xBD10,0xBD14,0xBD24,0xBD2C,0xBD40,0xBD48,0xBD49,0xBD4C, +0xBD50,0xBD58,0xBD59,0xBD64,0xBD68,0xBD80,0xBD81,0xBD84, +0xBD87,0xBD88,0xBD89,0xBD8A,0xBD90,0xBD91,0xBD93,0xBD95, +0xBD99,0xBD9A,0xBD9C,0xBDA4,0xBDB0,0xBDB8,0xBDD4,0xBDD5, +0xBDD8,0xBDDC,0xBDE9,0xBDF0,0xBDF4,0xBDF8,0xBE00,0xBE03, +0xBE05,0xBE0C,0xBE0D,0xBE10,0xBE14,0xBE1C,0xBE1D,0xBE1F, +0xBE44,0xBE45,0xBE48,0xBE4C,0xBE4E,0xBE54,0xBE55,0xBE57, +0xBE59,0xBE5A,0xBE5B,0xBE60,0xBE61,0xBE64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD2FB,0xD2FC,0xD2FD,0xD2FE,0xD2FF,0xD302,0xD304,0xD306, +0xD307,0xD308,0xD309,0xD30A,0xD30B,0xD30F,0xD311,0xD312, +0xD313,0xD315,0xD317,0xD318,0xD319,0xD31A,0xD31B,0xD31E, +0xD322,0xD323, 0, 0, 0, 0, 0, 0, +0xD324,0xD326,0xD327,0xD32A,0xD32B,0xD32D,0xD32E,0xD32F, +0xD331,0xD332,0xD333,0xD334,0xD335,0xD336,0xD337,0xD33A, +0xD33E,0xD33F,0xD340,0xD341,0xD342,0xD343,0xD346,0xD347, +0xD348,0xD349, 0, 0, 0, 0, 0, 0, +0xD34A,0xD34B,0xD34C,0xD34D,0xD34E,0xD34F,0xD350,0xD351, +0xD352,0xD353,0xD354,0xD355,0xD356,0xD357,0xD358,0xD359, +0xD35A,0xD35B,0xD35C,0xD35D,0xD35E,0xD35F,0xD360,0xD361, +0xD362,0xD363,0xD364,0xD365,0xD366,0xD367,0xD368,0xD369, +0xBE68,0xBE6A,0xBE70,0xBE71,0xBE73,0xBE74,0xBE75,0xBE7B, +0xBE7C,0xBE7D,0xBE80,0xBE84,0xBE8C,0xBE8D,0xBE8F,0xBE90, +0xBE91,0xBE98,0xBE99,0xBEA8,0xBED0,0xBED1,0xBED4,0xBED7, +0xBED8,0xBEE0,0xBEE3,0xBEE4,0xBEE5,0xBEEC,0xBF01,0xBF08, +0xBF09,0xBF18,0xBF19,0xBF1B,0xBF1C,0xBF1D,0xBF40,0xBF41, +0xBF44,0xBF48,0xBF50,0xBF51,0xBF55,0xBF94,0xBFB0,0xBFC5, +0xBFCC,0xBFCD,0xBFD0,0xBFD4,0xBFDC,0xBFDF,0xBFE1,0xC03C, +0xC051,0xC058,0xC05C,0xC060,0xC068,0xC069,0xC090,0xC091, +0xC094,0xC098,0xC0A0,0xC0A1,0xC0A3,0xC0A5,0xC0AC,0xC0AD, +0xC0AF,0xC0B0,0xC0B3,0xC0B4,0xC0B5,0xC0B6,0xC0BC,0xC0BD, +0xC0BF,0xC0C0,0xC0C1,0xC0C5,0xC0C8,0xC0C9,0xC0CC,0xC0D0, +0xC0D8,0xC0D9,0xC0DB,0xC0DC,0xC0DD,0xC0E4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD36A,0xD36B,0xD36C,0xD36D,0xD36E,0xD36F,0xD370,0xD371, +0xD372,0xD373,0xD374,0xD375,0xD376,0xD377,0xD378,0xD379, +0xD37A,0xD37B,0xD37E,0xD37F,0xD381,0xD382,0xD383,0xD385, +0xD386,0xD387, 0, 0, 0, 0, 0, 0, +0xD388,0xD389,0xD38A,0xD38B,0xD38E,0xD392,0xD393,0xD394, +0xD395,0xD396,0xD397,0xD39A,0xD39B,0xD39D,0xD39E,0xD39F, +0xD3A1,0xD3A2,0xD3A3,0xD3A4,0xD3A5,0xD3A6,0xD3A7,0xD3AA, +0xD3AC,0xD3AE, 0, 0, 0, 0, 0, 0, +0xD3AF,0xD3B0,0xD3B1,0xD3B2,0xD3B3,0xD3B5,0xD3B6,0xD3B7, +0xD3B9,0xD3BA,0xD3BB,0xD3BD,0xD3BE,0xD3BF,0xD3C0,0xD3C1, +0xD3C2,0xD3C3,0xD3C6,0xD3C7,0xD3CA,0xD3CB,0xD3CC,0xD3CD, +0xD3CE,0xD3CF,0xD3D1,0xD3D2,0xD3D3,0xD3D4,0xD3D5,0xD3D6, +0xC0E5,0xC0E8,0xC0EC,0xC0F4,0xC0F5,0xC0F7,0xC0F9,0xC100, +0xC104,0xC108,0xC110,0xC115,0xC11C,0xC11D,0xC11E,0xC11F, +0xC120,0xC123,0xC124,0xC126,0xC127,0xC12C,0xC12D,0xC12F, +0xC130,0xC131,0xC136,0xC138,0xC139,0xC13C,0xC140,0xC148, +0xC149,0xC14B,0xC14C,0xC14D,0xC154,0xC155,0xC158,0xC15C, +0xC164,0xC165,0xC167,0xC168,0xC169,0xC170,0xC174,0xC178, +0xC185,0xC18C,0xC18D,0xC18E,0xC190,0xC194,0xC196,0xC19C, +0xC19D,0xC19F,0xC1A1,0xC1A5,0xC1A8,0xC1A9,0xC1AC,0xC1B0, +0xC1BD,0xC1C4,0xC1C8,0xC1CC,0xC1D4,0xC1D7,0xC1D8,0xC1E0, +0xC1E4,0xC1E8,0xC1F0,0xC1F1,0xC1F3,0xC1FC,0xC1FD,0xC200, +0xC204,0xC20C,0xC20D,0xC20F,0xC211,0xC218,0xC219,0xC21C, +0xC21F,0xC220,0xC228,0xC229,0xC22B,0xC22D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD3D7,0xD3D9,0xD3DA,0xD3DB,0xD3DC,0xD3DD,0xD3DE,0xD3DF, +0xD3E0,0xD3E2,0xD3E4,0xD3E5,0xD3E6,0xD3E7,0xD3E8,0xD3E9, +0xD3EA,0xD3EB,0xD3EE,0xD3EF,0xD3F1,0xD3F2,0xD3F3,0xD3F5, +0xD3F6,0xD3F7, 0, 0, 0, 0, 0, 0, +0xD3F8,0xD3F9,0xD3FA,0xD3FB,0xD3FE,0xD400,0xD402,0xD403, +0xD404,0xD405,0xD406,0xD407,0xD409,0xD40A,0xD40B,0xD40C, +0xD40D,0xD40E,0xD40F,0xD410,0xD411,0xD412,0xD413,0xD414, +0xD415,0xD416, 0, 0, 0, 0, 0, 0, +0xD417,0xD418,0xD419,0xD41A,0xD41B,0xD41C,0xD41E,0xD41F, +0xD420,0xD421,0xD422,0xD423,0xD424,0xD425,0xD426,0xD427, +0xD428,0xD429,0xD42A,0xD42B,0xD42C,0xD42D,0xD42E,0xD42F, +0xD430,0xD431,0xD432,0xD433,0xD434,0xD435,0xD436,0xD437, +0xC22F,0xC231,0xC232,0xC234,0xC248,0xC250,0xC251,0xC254, +0xC258,0xC260,0xC265,0xC26C,0xC26D,0xC270,0xC274,0xC27C, +0xC27D,0xC27F,0xC281,0xC288,0xC289,0xC290,0xC298,0xC29B, +0xC29D,0xC2A4,0xC2A5,0xC2A8,0xC2AC,0xC2AD,0xC2B4,0xC2B5, +0xC2B7,0xC2B9,0xC2DC,0xC2DD,0xC2E0,0xC2E3,0xC2E4,0xC2EB, +0xC2EC,0xC2ED,0xC2EF,0xC2F1,0xC2F6,0xC2F8,0xC2F9,0xC2FB, +0xC2FC,0xC300,0xC308,0xC309,0xC30C,0xC30D,0xC313,0xC314, +0xC315,0xC318,0xC31C,0xC324,0xC325,0xC328,0xC329,0xC345, +0xC368,0xC369,0xC36C,0xC370,0xC372,0xC378,0xC379,0xC37C, +0xC37D,0xC384,0xC388,0xC38C,0xC3C0,0xC3D8,0xC3D9,0xC3DC, +0xC3DF,0xC3E0,0xC3E2,0xC3E8,0xC3E9,0xC3ED,0xC3F4,0xC3F5, +0xC3F8,0xC408,0xC410,0xC424,0xC42C,0xC430, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD438,0xD439,0xD43A,0xD43B,0xD43C,0xD43D,0xD43E,0xD43F, +0xD441,0xD442,0xD443,0xD445,0xD446,0xD447,0xD448,0xD449, +0xD44A,0xD44B,0xD44C,0xD44D,0xD44E,0xD44F,0xD450,0xD451, +0xD452,0xD453, 0, 0, 0, 0, 0, 0, +0xD454,0xD455,0xD456,0xD457,0xD458,0xD459,0xD45A,0xD45B, +0xD45D,0xD45E,0xD45F,0xD461,0xD462,0xD463,0xD465,0xD466, +0xD467,0xD468,0xD469,0xD46A,0xD46B,0xD46C,0xD46E,0xD470, +0xD471,0xD472, 0, 0, 0, 0, 0, 0, +0xD473,0xD474,0xD475,0xD476,0xD477,0xD47A,0xD47B,0xD47D, +0xD47E,0xD481,0xD483,0xD484,0xD485,0xD486,0xD487,0xD48A, +0xD48C,0xD48E,0xD48F,0xD490,0xD491,0xD492,0xD493,0xD495, +0xD496,0xD497,0xD498,0xD499,0xD49A,0xD49B,0xD49C,0xD49D, +0xC434,0xC43C,0xC43D,0xC448,0xC464,0xC465,0xC468,0xC46C, +0xC474,0xC475,0xC479,0xC480,0xC494,0xC49C,0xC4B8,0xC4BC, +0xC4E9,0xC4F0,0xC4F1,0xC4F4,0xC4F8,0xC4FA,0xC4FF,0xC500, +0xC501,0xC50C,0xC510,0xC514,0xC51C,0xC528,0xC529,0xC52C, +0xC530,0xC538,0xC539,0xC53B,0xC53D,0xC544,0xC545,0xC548, +0xC549,0xC54A,0xC54C,0xC54D,0xC54E,0xC553,0xC554,0xC555, +0xC557,0xC558,0xC559,0xC55D,0xC55E,0xC560,0xC561,0xC564, +0xC568,0xC570,0xC571,0xC573,0xC574,0xC575,0xC57C,0xC57D, +0xC580,0xC584,0xC587,0xC58C,0xC58D,0xC58F,0xC591,0xC595, +0xC597,0xC598,0xC59C,0xC5A0,0xC5A9,0xC5B4,0xC5B5,0xC5B8, +0xC5B9,0xC5BB,0xC5BC,0xC5BD,0xC5BE,0xC5C4,0xC5C5,0xC5C6, +0xC5C7,0xC5C8,0xC5C9,0xC5CA,0xC5CC,0xC5CE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD49E,0xD49F,0xD4A0,0xD4A1,0xD4A2,0xD4A3,0xD4A4,0xD4A5, +0xD4A6,0xD4A7,0xD4A8,0xD4AA,0xD4AB,0xD4AC,0xD4AD,0xD4AE, +0xD4AF,0xD4B0,0xD4B1,0xD4B2,0xD4B3,0xD4B4,0xD4B5,0xD4B6, +0xD4B7,0xD4B8, 0, 0, 0, 0, 0, 0, +0xD4B9,0xD4BA,0xD4BB,0xD4BC,0xD4BD,0xD4BE,0xD4BF,0xD4C0, +0xD4C1,0xD4C2,0xD4C3,0xD4C4,0xD4C5,0xD4C6,0xD4C7,0xD4C8, +0xD4C9,0xD4CA,0xD4CB,0xD4CD,0xD4CE,0xD4CF,0xD4D1,0xD4D2, +0xD4D3,0xD4D5, 0, 0, 0, 0, 0, 0, +0xD4D6,0xD4D7,0xD4D8,0xD4D9,0xD4DA,0xD4DB,0xD4DD,0xD4DE, +0xD4E0,0xD4E1,0xD4E2,0xD4E3,0xD4E4,0xD4E5,0xD4E6,0xD4E7, +0xD4E9,0xD4EA,0xD4EB,0xD4ED,0xD4EE,0xD4EF,0xD4F1,0xD4F2, +0xD4F3,0xD4F4,0xD4F5,0xD4F6,0xD4F7,0xD4F9,0xD4FA,0xD4FC, +0xC5D0,0xC5D1,0xC5D4,0xC5D8,0xC5E0,0xC5E1,0xC5E3,0xC5E5, +0xC5EC,0xC5ED,0xC5EE,0xC5F0,0xC5F4,0xC5F6,0xC5F7,0xC5FC, +0xC5FD,0xC5FE,0xC5FF,0xC600,0xC601,0xC605,0xC606,0xC607, +0xC608,0xC60C,0xC610,0xC618,0xC619,0xC61B,0xC61C,0xC624, +0xC625,0xC628,0xC62C,0xC62D,0xC62E,0xC630,0xC633,0xC634, +0xC635,0xC637,0xC639,0xC63B,0xC640,0xC641,0xC644,0xC648, +0xC650,0xC651,0xC653,0xC654,0xC655,0xC65C,0xC65D,0xC660, +0xC66C,0xC66F,0xC671,0xC678,0xC679,0xC67C,0xC680,0xC688, +0xC689,0xC68B,0xC68D,0xC694,0xC695,0xC698,0xC69C,0xC6A4, +0xC6A5,0xC6A7,0xC6A9,0xC6B0,0xC6B1,0xC6B4,0xC6B8,0xC6B9, +0xC6BA,0xC6C0,0xC6C1,0xC6C3,0xC6C5,0xC6CC,0xC6CD,0xC6D0, +0xC6D4,0xC6DC,0xC6DD,0xC6E0,0xC6E1,0xC6E8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD4FE,0xD4FF,0xD500,0xD501,0xD502,0xD503,0xD505,0xD506, +0xD507,0xD509,0xD50A,0xD50B,0xD50D,0xD50E,0xD50F,0xD510, +0xD511,0xD512,0xD513,0xD516,0xD518,0xD519,0xD51A,0xD51B, +0xD51C,0xD51D, 0, 0, 0, 0, 0, 0, +0xD51E,0xD51F,0xD520,0xD521,0xD522,0xD523,0xD524,0xD525, +0xD526,0xD527,0xD528,0xD529,0xD52A,0xD52B,0xD52C,0xD52D, +0xD52E,0xD52F,0xD530,0xD531,0xD532,0xD533,0xD534,0xD535, +0xD536,0xD537, 0, 0, 0, 0, 0, 0, +0xD538,0xD539,0xD53A,0xD53B,0xD53E,0xD53F,0xD541,0xD542, +0xD543,0xD545,0xD546,0xD547,0xD548,0xD549,0xD54A,0xD54B, +0xD54E,0xD550,0xD552,0xD553,0xD554,0xD555,0xD556,0xD557, +0xD55A,0xD55B,0xD55D,0xD55E,0xD55F,0xD561,0xD562,0xD563, +0xC6E9,0xC6EC,0xC6F0,0xC6F8,0xC6F9,0xC6FD,0xC704,0xC705, +0xC708,0xC70C,0xC714,0xC715,0xC717,0xC719,0xC720,0xC721, +0xC724,0xC728,0xC730,0xC731,0xC733,0xC735,0xC737,0xC73C, +0xC73D,0xC740,0xC744,0xC74A,0xC74C,0xC74D,0xC74F,0xC751, +0xC752,0xC753,0xC754,0xC755,0xC756,0xC757,0xC758,0xC75C, +0xC760,0xC768,0xC76B,0xC774,0xC775,0xC778,0xC77C,0xC77D, +0xC77E,0xC783,0xC784,0xC785,0xC787,0xC788,0xC789,0xC78A, +0xC78E,0xC790,0xC791,0xC794,0xC796,0xC797,0xC798,0xC79A, +0xC7A0,0xC7A1,0xC7A3,0xC7A4,0xC7A5,0xC7A6,0xC7AC,0xC7AD, +0xC7B0,0xC7B4,0xC7BC,0xC7BD,0xC7BF,0xC7C0,0xC7C1,0xC7C8, +0xC7C9,0xC7CC,0xC7CE,0xC7D0,0xC7D8,0xC7DD,0xC7E4,0xC7E8, +0xC7EC,0xC800,0xC801,0xC804,0xC808,0xC80A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD564,0xD566,0xD567,0xD56A,0xD56C,0xD56E,0xD56F,0xD570, +0xD571,0xD572,0xD573,0xD576,0xD577,0xD579,0xD57A,0xD57B, +0xD57D,0xD57E,0xD57F,0xD580,0xD581,0xD582,0xD583,0xD586, +0xD58A,0xD58B, 0, 0, 0, 0, 0, 0, +0xD58C,0xD58D,0xD58E,0xD58F,0xD591,0xD592,0xD593,0xD594, +0xD595,0xD596,0xD597,0xD598,0xD599,0xD59A,0xD59B,0xD59C, +0xD59D,0xD59E,0xD59F,0xD5A0,0xD5A1,0xD5A2,0xD5A3,0xD5A4, +0xD5A6,0xD5A7, 0, 0, 0, 0, 0, 0, +0xD5A8,0xD5A9,0xD5AA,0xD5AB,0xD5AC,0xD5AD,0xD5AE,0xD5AF, +0xD5B0,0xD5B1,0xD5B2,0xD5B3,0xD5B4,0xD5B5,0xD5B6,0xD5B7, +0xD5B8,0xD5B9,0xD5BA,0xD5BB,0xD5BC,0xD5BD,0xD5BE,0xD5BF, +0xD5C0,0xD5C1,0xD5C2,0xD5C3,0xD5C4,0xD5C5,0xD5C6,0xD5C7, +0xC810,0xC811,0xC813,0xC815,0xC816,0xC81C,0xC81D,0xC820, +0xC824,0xC82C,0xC82D,0xC82F,0xC831,0xC838,0xC83C,0xC840, +0xC848,0xC849,0xC84C,0xC84D,0xC854,0xC870,0xC871,0xC874, +0xC878,0xC87A,0xC880,0xC881,0xC883,0xC885,0xC886,0xC887, +0xC88B,0xC88C,0xC88D,0xC894,0xC89D,0xC89F,0xC8A1,0xC8A8, +0xC8BC,0xC8BD,0xC8C4,0xC8C8,0xC8CC,0xC8D4,0xC8D5,0xC8D7, +0xC8D9,0xC8E0,0xC8E1,0xC8E4,0xC8F5,0xC8FC,0xC8FD,0xC900, +0xC904,0xC905,0xC906,0xC90C,0xC90D,0xC90F,0xC911,0xC918, +0xC92C,0xC934,0xC950,0xC951,0xC954,0xC958,0xC960,0xC961, +0xC963,0xC96C,0xC970,0xC974,0xC97C,0xC988,0xC989,0xC98C, +0xC990,0xC998,0xC999,0xC99B,0xC99D,0xC9C0,0xC9C1,0xC9C4, +0xC9C7,0xC9C8,0xC9CA,0xC9D0,0xC9D1,0xC9D3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD5CA,0xD5CB,0xD5CD,0xD5CE,0xD5CF,0xD5D1,0xD5D3,0xD5D4, +0xD5D5,0xD5D6,0xD5D7,0xD5DA,0xD5DC,0xD5DE,0xD5DF,0xD5E0, +0xD5E1,0xD5E2,0xD5E3,0xD5E6,0xD5E7,0xD5E9,0xD5EA,0xD5EB, +0xD5ED,0xD5EE, 0, 0, 0, 0, 0, 0, +0xD5EF,0xD5F0,0xD5F1,0xD5F2,0xD5F3,0xD5F6,0xD5F8,0xD5FA, +0xD5FB,0xD5FC,0xD5FD,0xD5FE,0xD5FF,0xD602,0xD603,0xD605, +0xD606,0xD607,0xD609,0xD60A,0xD60B,0xD60C,0xD60D,0xD60E, +0xD60F,0xD612, 0, 0, 0, 0, 0, 0, +0xD616,0xD617,0xD618,0xD619,0xD61A,0xD61B,0xD61D,0xD61E, +0xD61F,0xD621,0xD622,0xD623,0xD625,0xD626,0xD627,0xD628, +0xD629,0xD62A,0xD62B,0xD62C,0xD62E,0xD62F,0xD630,0xD631, +0xD632,0xD633,0xD634,0xD635,0xD636,0xD637,0xD63A,0xD63B, +0xC9D5,0xC9D6,0xC9D9,0xC9DA,0xC9DC,0xC9DD,0xC9E0,0xC9E2, +0xC9E4,0xC9E7,0xC9EC,0xC9ED,0xC9EF,0xC9F0,0xC9F1,0xC9F8, +0xC9F9,0xC9FC,0xCA00,0xCA08,0xCA09,0xCA0B,0xCA0C,0xCA0D, +0xCA14,0xCA18,0xCA29,0xCA4C,0xCA4D,0xCA50,0xCA54,0xCA5C, +0xCA5D,0xCA5F,0xCA60,0xCA61,0xCA68,0xCA7D,0xCA84,0xCA98, +0xCABC,0xCABD,0xCAC0,0xCAC4,0xCACC,0xCACD,0xCACF,0xCAD1, +0xCAD3,0xCAD8,0xCAD9,0xCAE0,0xCAEC,0xCAF4,0xCB08,0xCB10, +0xCB14,0xCB18,0xCB20,0xCB21,0xCB41,0xCB48,0xCB49,0xCB4C, +0xCB50,0xCB58,0xCB59,0xCB5D,0xCB64,0xCB78,0xCB79,0xCB9C, +0xCBB8,0xCBD4,0xCBE4,0xCBE7,0xCBE9,0xCC0C,0xCC0D,0xCC10, +0xCC14,0xCC1C,0xCC1D,0xCC21,0xCC22,0xCC27,0xCC28,0xCC29, +0xCC2C,0xCC2E,0xCC30,0xCC38,0xCC39,0xCC3B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD63D,0xD63E,0xD63F,0xD641,0xD642,0xD643,0xD644,0xD646, +0xD647,0xD64A,0xD64C,0xD64E,0xD64F,0xD650,0xD652,0xD653, +0xD656,0xD657,0xD659,0xD65A,0xD65B,0xD65D,0xD65E,0xD65F, +0xD660,0xD661, 0, 0, 0, 0, 0, 0, +0xD662,0xD663,0xD664,0xD665,0xD666,0xD668,0xD66A,0xD66B, +0xD66C,0xD66D,0xD66E,0xD66F,0xD672,0xD673,0xD675,0xD676, +0xD677,0xD678,0xD679,0xD67A,0xD67B,0xD67C,0xD67D,0xD67E, +0xD67F,0xD680, 0, 0, 0, 0, 0, 0, +0xD681,0xD682,0xD684,0xD686,0xD687,0xD688,0xD689,0xD68A, +0xD68B,0xD68E,0xD68F,0xD691,0xD692,0xD693,0xD695,0xD696, +0xD697,0xD698,0xD699,0xD69A,0xD69B,0xD69C,0xD69E,0xD6A0, +0xD6A2,0xD6A3,0xD6A4,0xD6A5,0xD6A6,0xD6A7,0xD6A9,0xD6AA, +0xCC3C,0xCC3D,0xCC3E,0xCC44,0xCC45,0xCC48,0xCC4C,0xCC54, +0xCC55,0xCC57,0xCC58,0xCC59,0xCC60,0xCC64,0xCC66,0xCC68, +0xCC70,0xCC75,0xCC98,0xCC99,0xCC9C,0xCCA0,0xCCA8,0xCCA9, +0xCCAB,0xCCAC,0xCCAD,0xCCB4,0xCCB5,0xCCB8,0xCCBC,0xCCC4, +0xCCC5,0xCCC7,0xCCC9,0xCCD0,0xCCD4,0xCCE4,0xCCEC,0xCCF0, +0xCD01,0xCD08,0xCD09,0xCD0C,0xCD10,0xCD18,0xCD19,0xCD1B, +0xCD1D,0xCD24,0xCD28,0xCD2C,0xCD39,0xCD5C,0xCD60,0xCD64, +0xCD6C,0xCD6D,0xCD6F,0xCD71,0xCD78,0xCD88,0xCD94,0xCD95, +0xCD98,0xCD9C,0xCDA4,0xCDA5,0xCDA7,0xCDA9,0xCDB0,0xCDC4, +0xCDCC,0xCDD0,0xCDE8,0xCDEC,0xCDF0,0xCDF8,0xCDF9,0xCDFB, +0xCDFD,0xCE04,0xCE08,0xCE0C,0xCE14,0xCE19,0xCE20,0xCE21, +0xCE24,0xCE28,0xCE30,0xCE31,0xCE33,0xCE35, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD6AB,0xD6AD,0xD6AE,0xD6AF,0xD6B1,0xD6B2,0xD6B3,0xD6B4, +0xD6B5,0xD6B6,0xD6B7,0xD6B8,0xD6BA,0xD6BC,0xD6BD,0xD6BE, +0xD6BF,0xD6C0,0xD6C1,0xD6C2,0xD6C3,0xD6C6,0xD6C7,0xD6C9, +0xD6CA,0xD6CB, 0, 0, 0, 0, 0, 0, +0xD6CD,0xD6CE,0xD6CF,0xD6D0,0xD6D2,0xD6D3,0xD6D5,0xD6D6, +0xD6D8,0xD6DA,0xD6DB,0xD6DC,0xD6DD,0xD6DE,0xD6DF,0xD6E1, +0xD6E2,0xD6E3,0xD6E5,0xD6E6,0xD6E7,0xD6E9,0xD6EA,0xD6EB, +0xD6EC,0xD6ED, 0, 0, 0, 0, 0, 0, +0xD6EE,0xD6EF,0xD6F1,0xD6F2,0xD6F3,0xD6F4,0xD6F6,0xD6F7, +0xD6F8,0xD6F9,0xD6FA,0xD6FB,0xD6FE,0xD6FF,0xD701,0xD702, +0xD703,0xD705,0xD706,0xD707,0xD708,0xD709,0xD70A,0xD70B, +0xD70C,0xD70D,0xD70E,0xD70F,0xD710,0xD712,0xD713,0xD714, +0xCE58,0xCE59,0xCE5C,0xCE5F,0xCE60,0xCE61,0xCE68,0xCE69, +0xCE6B,0xCE6D,0xCE74,0xCE75,0xCE78,0xCE7C,0xCE84,0xCE85, +0xCE87,0xCE89,0xCE90,0xCE91,0xCE94,0xCE98,0xCEA0,0xCEA1, +0xCEA3,0xCEA4,0xCEA5,0xCEAC,0xCEAD,0xCEC1,0xCEE4,0xCEE5, +0xCEE8,0xCEEB,0xCEEC,0xCEF4,0xCEF5,0xCEF7,0xCEF8,0xCEF9, +0xCF00,0xCF01,0xCF04,0xCF08,0xCF10,0xCF11,0xCF13,0xCF15, +0xCF1C,0xCF20,0xCF24,0xCF2C,0xCF2D,0xCF2F,0xCF30,0xCF31, +0xCF38,0xCF54,0xCF55,0xCF58,0xCF5C,0xCF64,0xCF65,0xCF67, +0xCF69,0xCF70,0xCF71,0xCF74,0xCF78,0xCF80,0xCF85,0xCF8C, +0xCFA1,0xCFA8,0xCFB0,0xCFC4,0xCFE0,0xCFE1,0xCFE4,0xCFE8, +0xCFF0,0xCFF1,0xCFF3,0xCFF5,0xCFFC,0xD000,0xD004,0xD011, +0xD018,0xD02D,0xD034,0xD035,0xD038,0xD03C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD715,0xD716,0xD717,0xD71A,0xD71B,0xD71D,0xD71E,0xD71F, +0xD721,0xD722,0xD723,0xD724,0xD725,0xD726,0xD727,0xD72A, +0xD72C,0xD72E,0xD72F,0xD730,0xD731,0xD732,0xD733,0xD736, +0xD737,0xD739, 0, 0, 0, 0, 0, 0, +0xD73A,0xD73B,0xD73D,0xD73E,0xD73F,0xD740,0xD741,0xD742, +0xD743,0xD745,0xD746,0xD748,0xD74A,0xD74B,0xD74C,0xD74D, +0xD74E,0xD74F,0xD752,0xD753,0xD755,0xD75A,0xD75B,0xD75C, +0xD75D,0xD75E, 0, 0, 0, 0, 0, 0, +0xD75F,0xD762,0xD764,0xD766,0xD767,0xD768,0xD76A,0xD76B, +0xD76D,0xD76E,0xD76F,0xD771,0xD772,0xD773,0xD775,0xD776, +0xD777,0xD778,0xD779,0xD77A,0xD77B,0xD77E,0xD77F,0xD780, +0xD782,0xD783,0xD784,0xD785,0xD786,0xD787,0xD78A,0xD78B, +0xD044,0xD045,0xD047,0xD049,0xD050,0xD054,0xD058,0xD060, +0xD06C,0xD06D,0xD070,0xD074,0xD07C,0xD07D,0xD081,0xD0A4, +0xD0A5,0xD0A8,0xD0AC,0xD0B4,0xD0B5,0xD0B7,0xD0B9,0xD0C0, +0xD0C1,0xD0C4,0xD0C8,0xD0C9,0xD0D0,0xD0D1,0xD0D3,0xD0D4, +0xD0D5,0xD0DC,0xD0DD,0xD0E0,0xD0E4,0xD0EC,0xD0ED,0xD0EF, +0xD0F0,0xD0F1,0xD0F8,0xD10D,0xD130,0xD131,0xD134,0xD138, +0xD13A,0xD140,0xD141,0xD143,0xD144,0xD145,0xD14C,0xD14D, +0xD150,0xD154,0xD15C,0xD15D,0xD15F,0xD161,0xD168,0xD16C, +0xD17C,0xD184,0xD188,0xD1A0,0xD1A1,0xD1A4,0xD1A8,0xD1B0, +0xD1B1,0xD1B3,0xD1B5,0xD1BA,0xD1BC,0xD1C0,0xD1D8,0xD1F4, +0xD1F8,0xD207,0xD209,0xD210,0xD22C,0xD22D,0xD230,0xD234, +0xD23C,0xD23D,0xD23F,0xD241,0xD248,0xD25C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD78D,0xD78E,0xD78F,0xD791,0xD792,0xD793,0xD794,0xD795, +0xD796,0xD797,0xD79A,0xD79C,0xD79E,0xD79F,0xD7A0,0xD7A1, +0xD7A2,0xD7A3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD264,0xD280,0xD281,0xD284,0xD288,0xD290,0xD291,0xD295, +0xD29C,0xD2A0,0xD2A4,0xD2AC,0xD2B1,0xD2B8,0xD2B9,0xD2BC, +0xD2BF,0xD2C0,0xD2C2,0xD2C8,0xD2C9,0xD2CB,0xD2D4,0xD2D8, +0xD2DC,0xD2E4,0xD2E5,0xD2F0,0xD2F1,0xD2F4,0xD2F8,0xD300, +0xD301,0xD303,0xD305,0xD30C,0xD30D,0xD30E,0xD310,0xD314, +0xD316,0xD31C,0xD31D,0xD31F,0xD320,0xD321,0xD325,0xD328, +0xD329,0xD32C,0xD330,0xD338,0xD339,0xD33B,0xD33C,0xD33D, +0xD344,0xD345,0xD37C,0xD37D,0xD380,0xD384,0xD38C,0xD38D, +0xD38F,0xD390,0xD391,0xD398,0xD399,0xD39C,0xD3A0,0xD3A8, +0xD3A9,0xD3AB,0xD3AD,0xD3B4,0xD3B8,0xD3BC,0xD3C4,0xD3C5, +0xD3C8,0xD3C9,0xD3D0,0xD3D8,0xD3E1,0xD3E3,0xD3EC,0xD3ED, +0xD3F0,0xD3F4,0xD3FC,0xD3FD,0xD3FF,0xD401, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD408,0xD41D,0xD440,0xD444,0xD45C,0xD460,0xD464,0xD46D, +0xD46F,0xD478,0xD479,0xD47C,0xD47F,0xD480,0xD482,0xD488, +0xD489,0xD48B,0xD48D,0xD494,0xD4A9,0xD4CC,0xD4D0,0xD4D4, +0xD4DC,0xD4DF,0xD4E8,0xD4EC,0xD4F0,0xD4F8,0xD4FB,0xD4FD, +0xD504,0xD508,0xD50C,0xD514,0xD515,0xD517,0xD53C,0xD53D, +0xD540,0xD544,0xD54C,0xD54D,0xD54F,0xD551,0xD558,0xD559, +0xD55C,0xD560,0xD565,0xD568,0xD569,0xD56B,0xD56D,0xD574, +0xD575,0xD578,0xD57C,0xD584,0xD585,0xD587,0xD588,0xD589, +0xD590,0xD5A5,0xD5C8,0xD5C9,0xD5CC,0xD5D0,0xD5D2,0xD5D8, +0xD5D9,0xD5DB,0xD5DD,0xD5E4,0xD5E5,0xD5E8,0xD5EC,0xD5F4, +0xD5F5,0xD5F7,0xD5F9,0xD600,0xD601,0xD604,0xD608,0xD610, +0xD611,0xD613,0xD614,0xD615,0xD61C,0xD620, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD624,0xD62D,0xD638,0xD639,0xD63C,0xD640,0xD645,0xD648, +0xD649,0xD64B,0xD64D,0xD651,0xD654,0xD655,0xD658,0xD65C, +0xD667,0xD669,0xD670,0xD671,0xD674,0xD683,0xD685,0xD68C, +0xD68D,0xD690,0xD694,0xD69D,0xD69F,0xD6A1,0xD6A8,0xD6AC, +0xD6B0,0xD6B9,0xD6BB,0xD6C4,0xD6C5,0xD6C8,0xD6CC,0xD6D1, +0xD6D4,0xD6D7,0xD6D9,0xD6E0,0xD6E4,0xD6E8,0xD6F0,0xD6F5, +0xD6FC,0xD6FD,0xD700,0xD704,0xD711,0xD718,0xD719,0xD71C, +0xD720,0xD728,0xD729,0xD72B,0xD72D,0xD734,0xD735,0xD738, +0xD73C,0xD744,0xD747,0xD749,0xD750,0xD751,0xD754,0xD756, +0xD757,0xD758,0xD759,0xD760,0xD761,0xD763,0xD765,0xD769, +0xD76C,0xD770,0xD774,0xD77C,0xD77D,0xD781,0xD788,0xD789, +0xD78C,0xD790,0xD798,0xD799,0xD79B,0xD79D}; + +/* page 1 0xCAA1-0xFDFE */ +static uint16 tab_ksc5601_uni1[]={ +0x4F3D,0x4F73,0x5047,0x50F9,0x52A0,0x53EF,0x5475,0x54E5, +0x5609,0x5AC1,0x5BB6,0x6687,0x67B6,0x67B7,0x67EF,0x6B4C, +0x73C2,0x75C2,0x7A3C,0x82DB,0x8304,0x8857,0x8888,0x8A36, +0x8CC8,0x8DCF,0x8EFB,0x8FE6,0x99D5,0x523B,0x5374,0x5404, +0x606A,0x6164,0x6BBC,0x73CF,0x811A,0x89BA,0x89D2,0x95A3, +0x4F83,0x520A,0x58BE,0x5978,0x59E6,0x5E72,0x5E79,0x61C7, +0x63C0,0x6746,0x67EC,0x687F,0x6F97,0x764E,0x770B,0x78F5, +0x7A08,0x7AFF,0x7C21,0x809D,0x826E,0x8271,0x8AEB,0x9593, +0x4E6B,0x559D,0x66F7,0x6E34,0x78A3,0x7AED,0x845B,0x8910, +0x874E,0x97A8,0x52D8,0x574E,0x582A,0x5D4C,0x611F,0x61BE, +0x6221,0x6562,0x67D1,0x6A44,0x6E1B,0x7518,0x75B3,0x76E3, +0x77B0,0x7D3A,0x90AF,0x9451,0x9452,0x9F95, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5323,0x5CAC,0x7532,0x80DB,0x9240,0x9598,0x525B,0x5808, +0x59DC,0x5CA1,0x5D17,0x5EB7,0x5F3A,0x5F4A,0x6177,0x6C5F, +0x757A,0x7586,0x7CE0,0x7D73,0x7DB1,0x7F8C,0x8154,0x8221, +0x8591,0x8941,0x8B1B,0x92FC,0x964D,0x9C47,0x4ECB,0x4EF7, +0x500B,0x51F1,0x584F,0x6137,0x613E,0x6168,0x6539,0x69EA, +0x6F11,0x75A5,0x7686,0x76D6,0x7B87,0x82A5,0x84CB,0xF900, +0x93A7,0x958B,0x5580,0x5BA2,0x5751,0xF901,0x7CB3,0x7FB9, +0x91B5,0x5028,0x53BB,0x5C45,0x5DE8,0x62D2,0x636E,0x64DA, +0x64E7,0x6E20,0x70AC,0x795B,0x8DDD,0x8E1E,0xF902,0x907D, +0x9245,0x92F8,0x4E7E,0x4EF6,0x5065,0x5DFE,0x5EFA,0x6106, +0x6957,0x8171,0x8654,0x8E47,0x9375,0x9A2B,0x4E5E,0x5091, +0x6770,0x6840,0x5109,0x528D,0x5292,0x6AA2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x77BC,0x9210,0x9ED4,0x52AB,0x602F,0x8FF2,0x5048,0x61A9, +0x63ED,0x64CA,0x683C,0x6A84,0x6FC0,0x8188,0x89A1,0x9694, +0x5805,0x727D,0x72AC,0x7504,0x7D79,0x7E6D,0x80A9,0x898B, +0x8B74,0x9063,0x9D51,0x6289,0x6C7A,0x6F54,0x7D50,0x7F3A, +0x8A23,0x517C,0x614A,0x7B9D,0x8B19,0x9257,0x938C,0x4EAC, +0x4FD3,0x501E,0x50BE,0x5106,0x52C1,0x52CD,0x537F,0x5770, +0x5883,0x5E9A,0x5F91,0x6176,0x61AC,0x64CE,0x656C,0x666F, +0x66BB,0x66F4,0x6897,0x6D87,0x7085,0x70F1,0x749F,0x74A5, +0x74CA,0x75D9,0x786C,0x78EC,0x7ADF,0x7AF6,0x7D45,0x7D93, +0x8015,0x803F,0x811B,0x8396,0x8B66,0x8F15,0x9015,0x93E1, +0x9803,0x9838,0x9A5A,0x9BE8,0x4FC2,0x5553,0x583A,0x5951, +0x5B63,0x5C46,0x60B8,0x6212,0x6842,0x68B0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x68E8,0x6EAA,0x754C,0x7678,0x78CE,0x7A3D,0x7CFB,0x7E6B, +0x7E7C,0x8A08,0x8AA1,0x8C3F,0x968E,0x9DC4,0x53E4,0x53E9, +0x544A,0x5471,0x56FA,0x59D1,0x5B64,0x5C3B,0x5EAB,0x62F7, +0x6537,0x6545,0x6572,0x66A0,0x67AF,0x69C1,0x6CBD,0x75FC, +0x7690,0x777E,0x7A3F,0x7F94,0x8003,0x80A1,0x818F,0x82E6, +0x82FD,0x83F0,0x85C1,0x8831,0x88B4,0x8AA5,0xF903,0x8F9C, +0x932E,0x96C7,0x9867,0x9AD8,0x9F13,0x54ED,0x659B,0x66F2, +0x688F,0x7A40,0x8C37,0x9D60,0x56F0,0x5764,0x5D11,0x6606, +0x68B1,0x68CD,0x6EFE,0x7428,0x889E,0x9BE4,0x6C68,0xF904, +0x9AA8,0x4F9B,0x516C,0x5171,0x529F,0x5B54,0x5DE5,0x6050, +0x606D,0x62F1,0x63A7,0x653B,0x73D9,0x7A7A,0x86A3,0x8CA2, +0x978F,0x4E32,0x5BE1,0x6208,0x679C,0x74DC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x79D1,0x83D3,0x8A87,0x8AB2,0x8DE8,0x904E,0x934B,0x9846, +0x5ED3,0x69E8,0x85FF,0x90ED,0xF905,0x51A0,0x5B98,0x5BEC, +0x6163,0x68FA,0x6B3E,0x704C,0x742F,0x74D8,0x7BA1,0x7F50, +0x83C5,0x89C0,0x8CAB,0x95DC,0x9928,0x522E,0x605D,0x62EC, +0x9002,0x4F8A,0x5149,0x5321,0x58D9,0x5EE3,0x66E0,0x6D38, +0x709A,0x72C2,0x73D6,0x7B50,0x80F1,0x945B,0x5366,0x639B, +0x7F6B,0x4E56,0x5080,0x584A,0x58DE,0x602A,0x6127,0x62D0, +0x69D0,0x9B41,0x5B8F,0x7D18,0x80B1,0x8F5F,0x4EA4,0x50D1, +0x54AC,0x55AC,0x5B0C,0x5DA0,0x5DE7,0x652A,0x654E,0x6821, +0x6A4B,0x72E1,0x768E,0x77EF,0x7D5E,0x7FF9,0x81A0,0x854E, +0x86DF,0x8F03,0x8F4E,0x90CA,0x9903,0x9A55,0x9BAB,0x4E18, +0x4E45,0x4E5D,0x4EC7,0x4FF1,0x5177,0x52FE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5340,0x53E3,0x53E5,0x548E,0x5614,0x5775,0x57A2,0x5BC7, +0x5D87,0x5ED0,0x61FC,0x62D8,0x6551,0x67B8,0x67E9,0x69CB, +0x6B50,0x6BC6,0x6BEC,0x6C42,0x6E9D,0x7078,0x72D7,0x7396, +0x7403,0x77BF,0x77E9,0x7A76,0x7D7F,0x8009,0x81FC,0x8205, +0x820A,0x82DF,0x8862,0x8B33,0x8CFC,0x8EC0,0x9011,0x90B1, +0x9264,0x92B6,0x99D2,0x9A45,0x9CE9,0x9DD7,0x9F9C,0x570B, +0x5C40,0x83CA,0x97A0,0x97AB,0x9EB4,0x541B,0x7A98,0x7FA4, +0x88D9,0x8ECD,0x90E1,0x5800,0x5C48,0x6398,0x7A9F,0x5BAE, +0x5F13,0x7A79,0x7AAE,0x828E,0x8EAC,0x5026,0x5238,0x52F8, +0x5377,0x5708,0x62F3,0x6372,0x6B0A,0x6DC3,0x7737,0x53A5, +0x7357,0x8568,0x8E76,0x95D5,0x673A,0x6AC3,0x6F70,0x8A6D, +0x8ECC,0x994B,0xF906,0x6677,0x6B78,0x8CB4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9B3C,0xF907,0x53EB,0x572D,0x594E,0x63C6,0x69FB,0x73EA, +0x7845,0x7ABA,0x7AC5,0x7CFE,0x8475,0x898F,0x8D73,0x9035, +0x95A8,0x52FB,0x5747,0x7547,0x7B60,0x83CC,0x921E,0xF908, +0x6A58,0x514B,0x524B,0x5287,0x621F,0x68D8,0x6975,0x9699, +0x50C5,0x52A4,0x52E4,0x61C3,0x65A4,0x6839,0x69FF,0x747E, +0x7B4B,0x82B9,0x83EB,0x89B2,0x8B39,0x8FD1,0x9949,0xF909, +0x4ECA,0x5997,0x64D2,0x6611,0x6A8E,0x7434,0x7981,0x79BD, +0x82A9,0x887E,0x887F,0x895F,0xF90A,0x9326,0x4F0B,0x53CA, +0x6025,0x6271,0x6C72,0x7D1A,0x7D66,0x4E98,0x5162,0x77DC, +0x80AF,0x4F01,0x4F0E,0x5176,0x5180,0x55DC,0x5668,0x573B, +0x57FA,0x57FC,0x5914,0x5947,0x5993,0x5BC4,0x5C90,0x5D0E, +0x5DF1,0x5E7E,0x5FCC,0x6280,0x65D7,0x65E3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x671E,0x671F,0x675E,0x68CB,0x68C4,0x6A5F,0x6B3A,0x6C23, +0x6C7D,0x6C82,0x6DC7,0x7398,0x7426,0x742A,0x7482,0x74A3, +0x7578,0x757F,0x7881,0x78EF,0x7941,0x7947,0x7948,0x797A, +0x7B95,0x7D00,0x7DBA,0x7F88,0x8006,0x802D,0x808C,0x8A18, +0x8B4F,0x8C48,0x8D77,0x9321,0x9324,0x98E2,0x9951,0x9A0E, +0x9A0F,0x9A65,0x9E92,0x7DCA,0x4F76,0x5409,0x62EE,0x6854, +0x91D1,0x55AB,0x513A,0xF90B,0xF90C,0x5A1C,0x61E6,0xF90D, +0x62CF,0x62FF,0xF90E,0xF90F,0xF910,0xF911,0xF912,0xF913, +0x90A3,0xF914,0xF915,0xF916,0xF917,0xF918,0x8AFE,0xF919, +0xF91A,0xF91B,0xF91C,0x6696,0xF91D,0x7156,0xF91E,0xF91F, +0x96E3,0xF920,0x634F,0x637A,0x5357,0xF921,0x678F,0x6960, +0x6E73,0xF922,0x7537,0xF923,0xF924,0xF925, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7D0D,0xF926,0xF927,0x8872,0x56CA,0x5A18,0xF928,0xF929, +0xF92A,0xF92B,0xF92C,0x4E43,0xF92D,0x5167,0x5948,0x67F0, +0x8010,0xF92E,0x5973,0x5E74,0x649A,0x79CA,0x5FF5,0x606C, +0x62C8,0x637B,0x5BE7,0x5BD7,0x52AA,0xF92F,0x5974,0x5F29, +0x6012,0xF930,0xF931,0xF932,0x7459,0xF933,0xF934,0xF935, +0xF936,0xF937,0xF938,0x99D1,0xF939,0xF93A,0xF93B,0xF93C, +0xF93D,0xF93E,0xF93F,0xF940,0xF941,0xF942,0xF943,0x6FC3, +0xF944,0xF945,0x81BF,0x8FB2,0x60F1,0xF946,0xF947,0x8166, +0xF948,0xF949,0x5C3F,0xF94A,0xF94B,0xF94C,0xF94D,0xF94E, +0xF94F,0xF950,0xF951,0x5AE9,0x8A25,0x677B,0x7D10,0xF952, +0xF953,0xF954,0xF955,0xF956,0xF957,0x80FD,0xF958,0xF959, +0x5C3C,0x6CE5,0x533F,0x6EBA,0x591A,0x8336, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4E39,0x4EB6,0x4F46,0x55AE,0x5718,0x58C7,0x5F56,0x65B7, +0x65E6,0x6A80,0x6BB5,0x6E4D,0x77ED,0x7AEF,0x7C1E,0x7DDE, +0x86CB,0x8892,0x9132,0x935B,0x64BB,0x6FBE,0x737A,0x75B8, +0x9054,0x5556,0x574D,0x61BA,0x64D4,0x66C7,0x6DE1,0x6E5B, +0x6F6D,0x6FB9,0x75F0,0x8043,0x81BD,0x8541,0x8983,0x8AC7, +0x8B5A,0x931F,0x6C93,0x7553,0x7B54,0x8E0F,0x905D,0x5510, +0x5802,0x5858,0x5E62,0x6207,0x649E,0x68E0,0x7576,0x7CD6, +0x87B3,0x9EE8,0x4EE3,0x5788,0x576E,0x5927,0x5C0D,0x5CB1, +0x5E36,0x5F85,0x6234,0x64E1,0x73B3,0x81FA,0x888B,0x8CB8, +0x968A,0x9EDB,0x5B85,0x5FB7,0x60B3,0x5012,0x5200,0x5230, +0x5716,0x5835,0x5857,0x5C0E,0x5C60,0x5CF6,0x5D8B,0x5EA6, +0x5F92,0x60BC,0x6311,0x6389,0x6417,0x6843, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x68F9,0x6AC2,0x6DD8,0x6E21,0x6ED4,0x6FE4,0x71FE,0x76DC, +0x7779,0x79B1,0x7A3B,0x8404,0x89A9,0x8CED,0x8DF3,0x8E48, +0x9003,0x9014,0x9053,0x90FD,0x934D,0x9676,0x97DC,0x6BD2, +0x7006,0x7258,0x72A2,0x7368,0x7763,0x79BF,0x7BE4,0x7E9B, +0x8B80,0x58A9,0x60C7,0x6566,0x65FD,0x66BE,0x6C8C,0x711E, +0x71C9,0x8C5A,0x9813,0x4E6D,0x7A81,0x4EDD,0x51AC,0x51CD, +0x52D5,0x540C,0x61A7,0x6771,0x6850,0x68DF,0x6D1E,0x6F7C, +0x75BC,0x77B3,0x7AE5,0x80F4,0x8463,0x9285,0x515C,0x6597, +0x675C,0x6793,0x75D8,0x7AC7,0x8373,0xF95A,0x8C46,0x9017, +0x982D,0x5C6F,0x81C0,0x829A,0x9041,0x906F,0x920D,0x5F97, +0x5D9D,0x6A59,0x71C8,0x767B,0x7B49,0x85E4,0x8B04,0x9127, +0x9A30,0x5587,0x61F6,0xF95B,0x7669,0x7F85, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x863F,0x87BA,0x88F8,0x908F,0xF95C,0x6D1B,0x70D9,0x73DE, +0x7D61,0x843D,0xF95D,0x916A,0x99F1,0xF95E,0x4E82,0x5375, +0x6B04,0x6B12,0x703E,0x721B,0x862D,0x9E1E,0x524C,0x8FA3, +0x5D50,0x64E5,0x652C,0x6B16,0x6FEB,0x7C43,0x7E9C,0x85CD, +0x8964,0x89BD,0x62C9,0x81D8,0x881F,0x5ECA,0x6717,0x6D6A, +0x72FC,0x7405,0x746F,0x8782,0x90DE,0x4F86,0x5D0D,0x5FA0, +0x840A,0x51B7,0x63A0,0x7565,0x4EAE,0x5006,0x5169,0x51C9, +0x6881,0x6A11,0x7CAE,0x7CB1,0x7CE7,0x826F,0x8AD2,0x8F1B, +0x91CF,0x4FB6,0x5137,0x52F5,0x5442,0x5EEC,0x616E,0x623E, +0x65C5,0x6ADA,0x6FFE,0x792A,0x85DC,0x8823,0x95AD,0x9A62, +0x9A6A,0x9E97,0x9ECE,0x529B,0x66C6,0x6B77,0x701D,0x792B, +0x8F62,0x9742,0x6190,0x6200,0x6523,0x6F23, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7149,0x7489,0x7DF4,0x806F,0x84EE,0x8F26,0x9023,0x934A, +0x51BD,0x5217,0x52A3,0x6D0C,0x70C8,0x88C2,0x5EC9,0x6582, +0x6BAE,0x6FC2,0x7C3E,0x7375,0x4EE4,0x4F36,0x56F9,0xF95F, +0x5CBA,0x5DBA,0x601C,0x73B2,0x7B2D,0x7F9A,0x7FCE,0x8046, +0x901E,0x9234,0x96F6,0x9748,0x9818,0x9F61,0x4F8B,0x6FA7, +0x79AE,0x91B4,0x96B7,0x52DE,0xF960,0x6488,0x64C4,0x6AD3, +0x6F5E,0x7018,0x7210,0x76E7,0x8001,0x8606,0x865C,0x8DEF, +0x8F05,0x9732,0x9B6F,0x9DFA,0x9E75,0x788C,0x797F,0x7DA0, +0x83C9,0x9304,0x9E7F,0x9E93,0x8AD6,0x58DF,0x5F04,0x6727, +0x7027,0x74CF,0x7C60,0x807E,0x5121,0x7028,0x7262,0x78CA, +0x8CC2,0x8CDA,0x8CF4,0x96F7,0x4E86,0x50DA,0x5BEE,0x5ED6, +0x6599,0x71CE,0x7642,0x77AD,0x804A,0x84FC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x907C,0x9B27,0x9F8D,0x58D8,0x5A41,0x5C62,0x6A13,0x6DDA, +0x6F0F,0x763B,0x7D2F,0x7E37,0x851E,0x8938,0x93E4,0x964B, +0x5289,0x65D2,0x67F3,0x69B4,0x6D41,0x6E9C,0x700F,0x7409, +0x7460,0x7559,0x7624,0x786B,0x8B2C,0x985E,0x516D,0x622E, +0x9678,0x4F96,0x502B,0x5D19,0x6DEA,0x7DB8,0x8F2A,0x5F8B, +0x6144,0x6817,0xF961,0x9686,0x52D2,0x808B,0x51DC,0x51CC, +0x695E,0x7A1C,0x7DBE,0x83F1,0x9675,0x4FDA,0x5229,0x5398, +0x540F,0x550E,0x5C65,0x60A7,0x674E,0x68A8,0x6D6C,0x7281, +0x72F8,0x7406,0x7483,0xF962,0x75E2,0x7C6C,0x7F79,0x7FB8, +0x8389,0x88CF,0x88E1,0x91CC,0x91D0,0x96E2,0x9BC9,0x541D, +0x6F7E,0x71D0,0x7498,0x85FA,0x8EAA,0x96A3,0x9C57,0x9E9F, +0x6797,0x6DCB,0x7433,0x81E8,0x9716,0x782C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7ACB,0x7B20,0x7C92,0x6469,0x746A,0x75F2,0x78BC,0x78E8, +0x99AC,0x9B54,0x9EBB,0x5BDE,0x5E55,0x6F20,0x819C,0x83AB, +0x9088,0x4E07,0x534D,0x5A29,0x5DD2,0x5F4E,0x6162,0x633D, +0x6669,0x66FC,0x6EFF,0x6F2B,0x7063,0x779E,0x842C,0x8513, +0x883B,0x8F13,0x9945,0x9C3B,0x551C,0x62B9,0x672B,0x6CAB, +0x8309,0x896A,0x977A,0x4EA1,0x5984,0x5FD8,0x5FD9,0x671B, +0x7DB2,0x7F54,0x8292,0x832B,0x83BD,0x8F1E,0x9099,0x57CB, +0x59B9,0x5A92,0x5BD0,0x6627,0x679A,0x6885,0x6BCF,0x7164, +0x7F75,0x8CB7,0x8CE3,0x9081,0x9B45,0x8108,0x8C8A,0x964C, +0x9A40,0x9EA5,0x5B5F,0x6C13,0x731B,0x76F2,0x76DF,0x840C, +0x51AA,0x8993,0x514D,0x5195,0x52C9,0x68C9,0x6C94,0x7704, +0x7720,0x7DBF,0x7DEC,0x9762,0x9EB5,0x6EC5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8511,0x51A5,0x540D,0x547D,0x660E,0x669D,0x6927,0x6E9F, +0x76BF,0x7791,0x8317,0x84C2,0x879F,0x9169,0x9298,0x9CF4, +0x8882,0x4FAE,0x5192,0x52DF,0x59C6,0x5E3D,0x6155,0x6478, +0x6479,0x66AE,0x67D0,0x6A21,0x6BCD,0x6BDB,0x725F,0x7261, +0x7441,0x7738,0x77DB,0x8017,0x82BC,0x8305,0x8B00,0x8B28, +0x8C8C,0x6728,0x6C90,0x7267,0x76EE,0x7766,0x7A46,0x9DA9, +0x6B7F,0x6C92,0x5922,0x6726,0x8499,0x536F,0x5893,0x5999, +0x5EDF,0x63CF,0x6634,0x6773,0x6E3A,0x732B,0x7AD7,0x82D7, +0x9328,0x52D9,0x5DEB,0x61AE,0x61CB,0x620A,0x62C7,0x64AB, +0x65E0,0x6959,0x6B66,0x6BCB,0x7121,0x73F7,0x755D,0x7E46, +0x821E,0x8302,0x856A,0x8AA3,0x8CBF,0x9727,0x9D61,0x58A8, +0x9ED8,0x5011,0x520E,0x543B,0x554F,0x6587, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C76,0x7D0A,0x7D0B,0x805E,0x868A,0x9580,0x96EF,0x52FF, +0x6C95,0x7269,0x5473,0x5A9A,0x5C3E,0x5D4B,0x5F4C,0x5FAE, +0x672A,0x68B6,0x6963,0x6E3C,0x6E44,0x7709,0x7C73,0x7F8E, +0x8587,0x8B0E,0x8FF7,0x9761,0x9EF4,0x5CB7,0x60B6,0x610D, +0x61AB,0x654F,0x65FB,0x65FC,0x6C11,0x6CEF,0x739F,0x73C9, +0x7DE1,0x9594,0x5BC6,0x871C,0x8B10,0x525D,0x535A,0x62CD, +0x640F,0x64B2,0x6734,0x6A38,0x6CCA,0x73C0,0x749E,0x7B94, +0x7C95,0x7E1B,0x818A,0x8236,0x8584,0x8FEB,0x96F9,0x99C1, +0x4F34,0x534A,0x53CD,0x53DB,0x62CC,0x642C,0x6500,0x6591, +0x69C3,0x6CEE,0x6F58,0x73ED,0x7554,0x7622,0x76E4,0x76FC, +0x78D0,0x78FB,0x792C,0x7D46,0x822C,0x87E0,0x8FD4,0x9812, +0x98EF,0x52C3,0x62D4,0x64A5,0x6E24,0x6F51, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x767C,0x8DCB,0x91B1,0x9262,0x9AEE,0x9B43,0x5023,0x508D, +0x574A,0x59A8,0x5C28,0x5E47,0x5F77,0x623F,0x653E,0x65B9, +0x65C1,0x6609,0x678B,0x699C,0x6EC2,0x78C5,0x7D21,0x80AA, +0x8180,0x822B,0x82B3,0x84A1,0x868C,0x8A2A,0x8B17,0x90A6, +0x9632,0x9F90,0x500D,0x4FF3,0xF963,0x57F9,0x5F98,0x62DC, +0x6392,0x676F,0x6E43,0x7119,0x76C3,0x80CC,0x80DA,0x88F4, +0x88F5,0x8919,0x8CE0,0x8F29,0x914D,0x966A,0x4F2F,0x4F70, +0x5E1B,0x67CF,0x6822,0x767D,0x767E,0x9B44,0x5E61,0x6A0A, +0x7169,0x71D4,0x756A,0xF964,0x7E41,0x8543,0x85E9,0x98DC, +0x4F10,0x7B4F,0x7F70,0x95A5,0x51E1,0x5E06,0x68B5,0x6C3E, +0x6C4E,0x6CDB,0x72AF,0x7BC4,0x8303,0x6CD5,0x743A,0x50FB, +0x5288,0x58C1,0x64D8,0x6A97,0x74A7,0x7656, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x78A7,0x8617,0x95E2,0x9739,0xF965,0x535E,0x5F01,0x8B8A, +0x8FA8,0x8FAF,0x908A,0x5225,0x77A5,0x9C49,0x9F08,0x4E19, +0x5002,0x5175,0x5C5B,0x5E77,0x661E,0x663A,0x67C4,0x68C5, +0x70B3,0x7501,0x75C5,0x79C9,0x7ADD,0x8F27,0x9920,0x9A08, +0x4FDD,0x5821,0x5831,0x5BF6,0x666E,0x6B65,0x6D11,0x6E7A, +0x6F7D,0x73E4,0x752B,0x83E9,0x88DC,0x8913,0x8B5C,0x8F14, +0x4F0F,0x50D5,0x5310,0x535C,0x5B93,0x5FA9,0x670D,0x798F, +0x8179,0x832F,0x8514,0x8907,0x8986,0x8F39,0x8F3B,0x99A5, +0x9C12,0x672C,0x4E76,0x4FF8,0x5949,0x5C01,0x5CEF,0x5CF0, +0x6367,0x68D2,0x70FD,0x71A2,0x742B,0x7E2B,0x84EC,0x8702, +0x9022,0x92D2,0x9CF3,0x4E0D,0x4ED8,0x4FEF,0x5085,0x5256, +0x526F,0x5426,0x5490,0x57E0,0x592B,0x5A66, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5B5A,0x5B75,0x5BCC,0x5E9C,0xF966,0x6276,0x6577,0x65A7, +0x6D6E,0x6EA5,0x7236,0x7B26,0x7C3F,0x7F36,0x8150,0x8151, +0x819A,0x8240,0x8299,0x83A9,0x8A03,0x8CA0,0x8CE6,0x8CFB, +0x8D74,0x8DBA,0x90E8,0x91DC,0x961C,0x9644,0x99D9,0x9CE7, +0x5317,0x5206,0x5429,0x5674,0x58B3,0x5954,0x596E,0x5FFF, +0x61A4,0x626E,0x6610,0x6C7E,0x711A,0x76C6,0x7C89,0x7CDE, +0x7D1B,0x82AC,0x8CC1,0x96F0,0xF967,0x4F5B,0x5F17,0x5F7F, +0x62C2,0x5D29,0x670B,0x68DA,0x787C,0x7E43,0x9D6C,0x4E15, +0x5099,0x5315,0x532A,0x5351,0x5983,0x5A62,0x5E87,0x60B2, +0x618A,0x6249,0x6279,0x6590,0x6787,0x69A7,0x6BD4,0x6BD6, +0x6BD7,0x6BD8,0x6CB8,0xF968,0x7435,0x75FA,0x7812,0x7891, +0x79D5,0x79D8,0x7C83,0x7DCB,0x7FE1,0x80A5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x813E,0x81C2,0x83F2,0x871A,0x88E8,0x8AB9,0x8B6C,0x8CBB, +0x9119,0x975E,0x98DB,0x9F3B,0x56AC,0x5B2A,0x5F6C,0x658C, +0x6AB3,0x6BAF,0x6D5C,0x6FF1,0x7015,0x725D,0x73AD,0x8CA7, +0x8CD3,0x983B,0x6191,0x6C37,0x8058,0x9A01,0x4E4D,0x4E8B, +0x4E9B,0x4ED5,0x4F3A,0x4F3C,0x4F7F,0x4FDF,0x50FF,0x53F2, +0x53F8,0x5506,0x55E3,0x56DB,0x58EB,0x5962,0x5A11,0x5BEB, +0x5BFA,0x5C04,0x5DF3,0x5E2B,0x5F99,0x601D,0x6368,0x659C, +0x65AF,0x67F6,0x67FB,0x68AD,0x6B7B,0x6C99,0x6CD7,0x6E23, +0x7009,0x7345,0x7802,0x793E,0x7940,0x7960,0x79C1,0x7BE9, +0x7D17,0x7D72,0x8086,0x820D,0x838E,0x84D1,0x86C7,0x88DF, +0x8A50,0x8A5E,0x8B1D,0x8CDC,0x8D66,0x8FAD,0x90AA,0x98FC, +0x99DF,0x9E9D,0x524A,0xF969,0x6714,0xF96A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5098,0x522A,0x5C71,0x6563,0x6C55,0x73CA,0x7523,0x759D, +0x7B97,0x849C,0x9178,0x9730,0x4E77,0x6492,0x6BBA,0x715E, +0x85A9,0x4E09,0xF96B,0x6749,0x68EE,0x6E17,0x829F,0x8518, +0x886B,0x63F7,0x6F81,0x9212,0x98AF,0x4E0A,0x50B7,0x50CF, +0x511F,0x5546,0x55AA,0x5617,0x5B40,0x5C19,0x5CE0,0x5E38, +0x5E8A,0x5EA0,0x5EC2,0x60F3,0x6851,0x6A61,0x6E58,0x723D, +0x7240,0x72C0,0x76F8,0x7965,0x7BB1,0x7FD4,0x88F3,0x89F4, +0x8A73,0x8C61,0x8CDE,0x971C,0x585E,0x74BD,0x8CFD,0x55C7, +0xF96C,0x7A61,0x7D22,0x8272,0x7272,0x751F,0x7525,0xF96D, +0x7B19,0x5885,0x58FB,0x5DBC,0x5E8F,0x5EB6,0x5F90,0x6055, +0x6292,0x637F,0x654D,0x6691,0x66D9,0x66F8,0x6816,0x68F2, +0x7280,0x745E,0x7B6E,0x7D6E,0x7DD6,0x7F72, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x80E5,0x8212,0x85AF,0x897F,0x8A93,0x901D,0x92E4,0x9ECD, +0x9F20,0x5915,0x596D,0x5E2D,0x60DC,0x6614,0x6673,0x6790, +0x6C50,0x6DC5,0x6F5F,0x77F3,0x78A9,0x84C6,0x91CB,0x932B, +0x4ED9,0x50CA,0x5148,0x5584,0x5B0B,0x5BA3,0x6247,0x657E, +0x65CB,0x6E32,0x717D,0x7401,0x7444,0x7487,0x74BF,0x766C, +0x79AA,0x7DDA,0x7E55,0x7FA8,0x817A,0x81B3,0x8239,0x861A, +0x87EC,0x8A75,0x8DE3,0x9078,0x9291,0x9425,0x994D,0x9BAE, +0x5368,0x5C51,0x6954,0x6CC4,0x6D29,0x6E2B,0x820C,0x859B, +0x893B,0x8A2D,0x8AAA,0x96EA,0x9F67,0x5261,0x66B9,0x6BB2, +0x7E96,0x87FE,0x8D0D,0x9583,0x965D,0x651D,0x6D89,0x71EE, +0xF96E,0x57CE,0x59D3,0x5BAC,0x6027,0x60FA,0x6210,0x661F, +0x665F,0x7329,0x73F9,0x76DB,0x7701,0x7B6C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8056,0x8072,0x8165,0x8AA0,0x9192,0x4E16,0x52E2,0x6B72, +0x6D17,0x7A05,0x7B39,0x7D30,0xF96F,0x8CB0,0x53EC,0x562F, +0x5851,0x5BB5,0x5C0F,0x5C11,0x5DE2,0x6240,0x6383,0x6414, +0x662D,0x68B3,0x6CBC,0x6D88,0x6EAF,0x701F,0x70A4,0x71D2, +0x7526,0x758F,0x758E,0x7619,0x7B11,0x7BE0,0x7C2B,0x7D20, +0x7D39,0x852C,0x856D,0x8607,0x8A34,0x900D,0x9061,0x90B5, +0x92B7,0x97F6,0x9A37,0x4FD7,0x5C6C,0x675F,0x6D91,0x7C9F, +0x7E8C,0x8B16,0x8D16,0x901F,0x5B6B,0x5DFD,0x640D,0x84C0, +0x905C,0x98E1,0x7387,0x5B8B,0x609A,0x677E,0x6DDE,0x8A1F, +0x8AA6,0x9001,0x980C,0x5237,0xF970,0x7051,0x788E,0x9396, +0x8870,0x91D7,0x4FEE,0x53D7,0x55FD,0x56DA,0x5782,0x58FD, +0x5AC2,0x5B88,0x5CAB,0x5CC0,0x5E25,0x6101, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x620D,0x624B,0x6388,0x641C,0x6536,0x6578,0x6A39,0x6B8A, +0x6C34,0x6D19,0x6F31,0x71E7,0x72E9,0x7378,0x7407,0x74B2, +0x7626,0x7761,0x79C0,0x7A57,0x7AEA,0x7CB9,0x7D8F,0x7DAC, +0x7E61,0x7F9E,0x8129,0x8331,0x8490,0x84DA,0x85EA,0x8896, +0x8AB0,0x8B90,0x8F38,0x9042,0x9083,0x916C,0x9296,0x92B9, +0x968B,0x96A7,0x96A8,0x96D6,0x9700,0x9808,0x9996,0x9AD3, +0x9B1A,0x53D4,0x587E,0x5919,0x5B70,0x5BBF,0x6DD1,0x6F5A, +0x719F,0x7421,0x74B9,0x8085,0x83FD,0x5DE1,0x5F87,0x5FAA, +0x6042,0x65EC,0x6812,0x696F,0x6A53,0x6B89,0x6D35,0x6DF3, +0x73E3,0x76FE,0x77AC,0x7B4D,0x7D14,0x8123,0x821C,0x8340, +0x84F4,0x8563,0x8A62,0x8AC4,0x9187,0x931E,0x9806,0x99B4, +0x620C,0x8853,0x8FF0,0x9265,0x5D07,0x5D27, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5D69,0x745F,0x819D,0x8768,0x6FD5,0x62FE,0x7FD2,0x8936, +0x8972,0x4E1E,0x4E58,0x50E7,0x52DD,0x5347,0x627F,0x6607, +0x7E69,0x8805,0x965E,0x4F8D,0x5319,0x5636,0x59CB,0x5AA4, +0x5C38,0x5C4E,0x5C4D,0x5E02,0x5F11,0x6043,0x65BD,0x662F, +0x6642,0x67BE,0x67F4,0x731C,0x77E2,0x793A,0x7FC5,0x8494, +0x84CD,0x8996,0x8A66,0x8A69,0x8AE1,0x8C55,0x8C7A,0x57F4, +0x5BD4,0x5F0F,0x606F,0x62ED,0x690D,0x6B96,0x6E5C,0x7184, +0x7BD2,0x8755,0x8B58,0x8EFE,0x98DF,0x98FE,0x4F38,0x4F81, +0x4FE1,0x547B,0x5A20,0x5BB8,0x613C,0x65B0,0x6668,0x71FC, +0x7533,0x795E,0x7D33,0x814E,0x81E3,0x8398,0x85AA,0x85CE, +0x8703,0x8A0A,0x8EAB,0x8F9B,0xF971,0x8FC5,0x5931,0x5BA4, +0x5BE6,0x6089,0x5BE9,0x5C0B,0x5FC3,0x6C81, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF972,0x6DF1,0x700B,0x751A,0x82AF,0x8AF6,0x4EC0,0x5341, +0xF973,0x96D9,0x6C0F,0x4E9E,0x4FC4,0x5152,0x555E,0x5A25, +0x5CE8,0x6211,0x7259,0x82BD,0x83AA,0x86FE,0x8859,0x8A1D, +0x963F,0x96C5,0x9913,0x9D09,0x9D5D,0x580A,0x5CB3,0x5DBD, +0x5E44,0x60E1,0x6115,0x63E1,0x6A02,0x6E25,0x9102,0x9354, +0x984E,0x9C10,0x9F77,0x5B89,0x5CB8,0x6309,0x664F,0x6848, +0x773C,0x96C1,0x978D,0x9854,0x9B9F,0x65A1,0x8B01,0x8ECB, +0x95BC,0x5535,0x5CA9,0x5DD6,0x5EB5,0x6697,0x764C,0x83F4, +0x95C7,0x58D3,0x62BC,0x72CE,0x9D28,0x4EF0,0x592E,0x600F, +0x663B,0x6B83,0x79E7,0x9D26,0x5393,0x54C0,0x57C3,0x5D16, +0x611B,0x66D6,0x6DAF,0x788D,0x827E,0x9698,0x9744,0x5384, +0x627C,0x6396,0x6DB2,0x7E0A,0x814B,0x984D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6AFB,0x7F4C,0x9DAF,0x9E1A,0x4E5F,0x503B,0x51B6,0x591C, +0x60F9,0x63F6,0x6930,0x723A,0x8036,0xF974,0x91CE,0x5F31, +0xF975,0xF976,0x7D04,0x82E5,0x846F,0x84BB,0x85E5,0x8E8D, +0xF977,0x4F6F,0xF978,0xF979,0x58E4,0x5B43,0x6059,0x63DA, +0x6518,0x656D,0x6698,0xF97A,0x694A,0x6A23,0x6D0B,0x7001, +0x716C,0x75D2,0x760D,0x79B3,0x7A70,0xF97B,0x7F8A,0xF97C, +0x8944,0xF97D,0x8B93,0x91C0,0x967D,0xF97E,0x990A,0x5704, +0x5FA1,0x65BC,0x6F01,0x7600,0x79A6,0x8A9E,0x99AD,0x9B5A, +0x9F6C,0x5104,0x61B6,0x6291,0x6A8D,0x81C6,0x5043,0x5830, +0x5F66,0x7109,0x8A00,0x8AFA,0x5B7C,0x8616,0x4FFA,0x513C, +0x56B4,0x5944,0x63A9,0x6DF9,0x5DAA,0x696D,0x5186,0x4E88, +0x4F59,0xF97F,0xF980,0xF981,0x5982,0xF982, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF983,0x6B5F,0x6C5D,0xF984,0x74B5,0x7916,0xF985,0x8207, +0x8245,0x8339,0x8F3F,0x8F5D,0xF986,0x9918,0xF987,0xF988, +0xF989,0x4EA6,0xF98A,0x57DF,0x5F79,0x6613,0xF98B,0xF98C, +0x75AB,0x7E79,0x8B6F,0xF98D,0x9006,0x9A5B,0x56A5,0x5827, +0x59F8,0x5A1F,0x5BB4,0xF98E,0x5EF6,0xF98F,0xF990,0x6350, +0x633B,0xF991,0x693D,0x6C87,0x6CBF,0x6D8E,0x6D93,0x6DF5, +0x6F14,0xF992,0x70DF,0x7136,0x7159,0xF993,0x71C3,0x71D5, +0xF994,0x784F,0x786F,0xF995,0x7B75,0x7DE3,0xF996,0x7E2F, +0xF997,0x884D,0x8EDF,0xF998,0xF999,0xF99A,0x925B,0xF99B, +0x9CF6,0xF99C,0xF99D,0xF99E,0x6085,0x6D85,0xF99F,0x71B1, +0xF9A0,0xF9A1,0x95B1,0x53AD,0xF9A2,0xF9A3,0xF9A4,0x67D3, +0xF9A5,0x708E,0x7130,0x7430,0x8276,0x82D2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF9A6,0x95BB,0x9AE5,0x9E7D,0x66C4,0xF9A7,0x71C1,0x8449, +0xF9A8,0xF9A9,0x584B,0xF9AA,0xF9AB,0x5DB8,0x5F71,0xF9AC, +0x6620,0x668E,0x6979,0x69AE,0x6C38,0x6CF3,0x6E36,0x6F41, +0x6FDA,0x701B,0x702F,0x7150,0x71DF,0x7370,0xF9AD,0x745B, +0xF9AE,0x74D4,0x76C8,0x7A4E,0x7E93,0xF9AF,0xF9B0,0x82F1, +0x8A60,0x8FCE,0xF9B1,0x9348,0xF9B2,0x9719,0xF9B3,0xF9B4, +0x4E42,0x502A,0xF9B5,0x5208,0x53E1,0x66F3,0x6C6D,0x6FCA, +0x730A,0x777F,0x7A62,0x82AE,0x85DD,0x8602,0xF9B6,0x88D4, +0x8A63,0x8B7D,0x8C6B,0xF9B7,0x92B3,0xF9B8,0x9713,0x9810, +0x4E94,0x4F0D,0x4FC9,0x50B2,0x5348,0x543E,0x5433,0x55DA, +0x5862,0x58BA,0x5967,0x5A1B,0x5BE4,0x609F,0xF9B9,0x61CA, +0x6556,0x65FF,0x6664,0x68A7,0x6C5A,0x6FB3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x70CF,0x71AC,0x7352,0x7B7D,0x8708,0x8AA4,0x9C32,0x9F07, +0x5C4B,0x6C83,0x7344,0x7389,0x923A,0x6EAB,0x7465,0x761F, +0x7A69,0x7E15,0x860A,0x5140,0x58C5,0x64C1,0x74EE,0x7515, +0x7670,0x7FC1,0x9095,0x96CD,0x9954,0x6E26,0x74E6,0x7AA9, +0x7AAA,0x81E5,0x86D9,0x8778,0x8A1B,0x5A49,0x5B8C,0x5B9B, +0x68A1,0x6900,0x6D63,0x73A9,0x7413,0x742C,0x7897,0x7DE9, +0x7FEB,0x8118,0x8155,0x839E,0x8C4C,0x962E,0x9811,0x66F0, +0x5F80,0x65FA,0x6789,0x6C6A,0x738B,0x502D,0x5A03,0x6B6A, +0x77EE,0x5916,0x5D6C,0x5DCD,0x7325,0x754F,0xF9BA,0xF9BB, +0x50E5,0x51F9,0x582F,0x592D,0x5996,0x59DA,0x5BE5,0xF9BC, +0xF9BD,0x5DA2,0x62D7,0x6416,0x6493,0x64FE,0xF9BE,0x66DC, +0xF9BF,0x6A48,0xF9C0,0x71FF,0x7464,0xF9C1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7A88,0x7AAF,0x7E47,0x7E5E,0x8000,0x8170,0xF9C2,0x87EF, +0x8981,0x8B20,0x9059,0xF9C3,0x9080,0x9952,0x617E,0x6B32, +0x6D74,0x7E1F,0x8925,0x8FB1,0x4FD1,0x50AD,0x5197,0x52C7, +0x57C7,0x5889,0x5BB9,0x5EB8,0x6142,0x6995,0x6D8C,0x6E67, +0x6EB6,0x7194,0x7462,0x7528,0x752C,0x8073,0x8338,0x84C9, +0x8E0A,0x9394,0x93DE,0xF9C4,0x4E8E,0x4F51,0x5076,0x512A, +0x53C8,0x53CB,0x53F3,0x5B87,0x5BD3,0x5C24,0x611A,0x6182, +0x65F4,0x725B,0x7397,0x7440,0x76C2,0x7950,0x7991,0x79B9, +0x7D06,0x7FBD,0x828B,0x85D5,0x865E,0x8FC2,0x9047,0x90F5, +0x91EA,0x9685,0x96E8,0x96E9,0x52D6,0x5F67,0x65ED,0x6631, +0x682F,0x715C,0x7A36,0x90C1,0x980A,0x4E91,0xF9C5,0x6A52, +0x6B9E,0x6F90,0x7189,0x8018,0x82B8,0x8553, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x904B,0x9695,0x96F2,0x97FB,0x851A,0x9B31,0x4E90,0x718A, +0x96C4,0x5143,0x539F,0x54E1,0x5713,0x5712,0x57A3,0x5A9B, +0x5AC4,0x5BC3,0x6028,0x613F,0x63F4,0x6C85,0x6D39,0x6E72, +0x6E90,0x7230,0x733F,0x7457,0x82D1,0x8881,0x8F45,0x9060, +0xF9C6,0x9662,0x9858,0x9D1B,0x6708,0x8D8A,0x925E,0x4F4D, +0x5049,0x50DE,0x5371,0x570D,0x59D4,0x5A01,0x5C09,0x6170, +0x6690,0x6E2D,0x7232,0x744B,0x7DEF,0x80C3,0x840E,0x8466, +0x853F,0x875F,0x885B,0x8918,0x8B02,0x9055,0x97CB,0x9B4F, +0x4E73,0x4F91,0x5112,0x516A,0xF9C7,0x552F,0x55A9,0x5B7A, +0x5BA5,0x5E7C,0x5E7D,0x5EBE,0x60A0,0x60DF,0x6108,0x6109, +0x63C4,0x6538,0x6709,0xF9C8,0x67D4,0x67DA,0xF9C9,0x6961, +0x6962,0x6CB9,0x6D27,0xF9CA,0x6E38,0xF9CB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6FE1,0x7336,0x7337,0xF9CC,0x745C,0x7531,0xF9CD,0x7652, +0xF9CE,0xF9CF,0x7DAD,0x81FE,0x8438,0x88D5,0x8A98,0x8ADB, +0x8AED,0x8E30,0x8E42,0x904A,0x903E,0x907A,0x9149,0x91C9, +0x936E,0xF9D0,0xF9D1,0x5809,0xF9D2,0x6BD3,0x8089,0x80B2, +0xF9D3,0xF9D4,0x5141,0x596B,0x5C39,0xF9D5,0xF9D6,0x6F64, +0x73A7,0x80E4,0x8D07,0xF9D7,0x9217,0x958F,0xF9D8,0xF9D9, +0xF9DA,0xF9DB,0x807F,0x620E,0x701C,0x7D68,0x878D,0xF9DC, +0x57A0,0x6069,0x6147,0x6BB7,0x8ABE,0x9280,0x96B1,0x4E59, +0x541F,0x6DEB,0x852D,0x9670,0x97F3,0x98EE,0x63D6,0x6CE3, +0x9091,0x51DD,0x61C9,0x81BA,0x9DF9,0x4F9D,0x501A,0x5100, +0x5B9C,0x610F,0x61FF,0x64EC,0x6905,0x6BC5,0x7591,0x77E3, +0x7FA9,0x8264,0x858F,0x87FB,0x8863,0x8ABC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B70,0x91AB,0x4E8C,0x4EE5,0x4F0A,0xF9DD,0xF9DE,0x5937, +0x59E8,0xF9DF,0x5DF2,0x5F1B,0x5F5B,0x6021,0xF9E0,0xF9E1, +0xF9E2,0xF9E3,0x723E,0x73E5,0xF9E4,0x7570,0x75CD,0xF9E5, +0x79FB,0xF9E6,0x800C,0x8033,0x8084,0x82E1,0x8351,0xF9E7, +0xF9E8,0x8CBD,0x8CB3,0x9087,0xF9E9,0xF9EA,0x98F4,0x990C, +0xF9EB,0xF9EC,0x7037,0x76CA,0x7FCA,0x7FCC,0x7FFC,0x8B1A, +0x4EBA,0x4EC1,0x5203,0x5370,0xF9ED,0x54BD,0x56E0,0x59FB, +0x5BC5,0x5F15,0x5FCD,0x6E6E,0xF9EE,0xF9EF,0x7D6A,0x8335, +0xF9F0,0x8693,0x8A8D,0xF9F1,0x976D,0x9777,0xF9F2,0xF9F3, +0x4E00,0x4F5A,0x4F7E,0x58F9,0x65E5,0x6EA2,0x9038,0x93B0, +0x99B9,0x4EFB,0x58EC,0x598A,0x59D9,0x6041,0xF9F4,0xF9F5, +0x7A14,0xF9F6,0x834F,0x8CC3,0x5165,0x5344, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF9F7,0xF9F8,0xF9F9,0x4ECD,0x5269,0x5B55,0x82BF,0x4ED4, +0x523A,0x54A8,0x59C9,0x59FF,0x5B50,0x5B57,0x5B5C,0x6063, +0x6148,0x6ECB,0x7099,0x716E,0x7386,0x74F7,0x75B5,0x78C1, +0x7D2B,0x8005,0x81EA,0x8328,0x8517,0x85C9,0x8AEE,0x8CC7, +0x96CC,0x4F5C,0x52FA,0x56BC,0x65AB,0x6628,0x707C,0x70B8, +0x7235,0x7DBD,0x828D,0x914C,0x96C0,0x9D72,0x5B71,0x68E7, +0x6B98,0x6F7A,0x76DE,0x5C91,0x66AB,0x6F5B,0x7BB4,0x7C2A, +0x8836,0x96DC,0x4E08,0x4ED7,0x5320,0x5834,0x58BB,0x58EF, +0x596C,0x5C07,0x5E33,0x5E84,0x5F35,0x638C,0x66B2,0x6756, +0x6A1F,0x6AA3,0x6B0C,0x6F3F,0x7246,0xF9FA,0x7350,0x748B, +0x7AE0,0x7CA7,0x8178,0x81DF,0x81E7,0x838A,0x846C,0x8523, +0x8594,0x85CF,0x88DD,0x8D13,0x91AC,0x9577, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x969C,0x518D,0x54C9,0x5728,0x5BB0,0x624D,0x6750,0x683D, +0x6893,0x6E3D,0x6ED3,0x707D,0x7E21,0x88C1,0x8CA1,0x8F09, +0x9F4B,0x9F4E,0x722D,0x7B8F,0x8ACD,0x931A,0x4F47,0x4F4E, +0x5132,0x5480,0x59D0,0x5E95,0x62B5,0x6775,0x696E,0x6A17, +0x6CAE,0x6E1A,0x72D9,0x732A,0x75BD,0x7BB8,0x7D35,0x82E7, +0x83F9,0x8457,0x85F7,0x8A5B,0x8CAF,0x8E87,0x9019,0x90B8, +0x96CE,0x9F5F,0x52E3,0x540A,0x5AE1,0x5BC2,0x6458,0x6575, +0x6EF4,0x72C4,0xF9FB,0x7684,0x7A4D,0x7B1B,0x7C4D,0x7E3E, +0x7FDF,0x837B,0x8B2B,0x8CCA,0x8D64,0x8DE1,0x8E5F,0x8FEA, +0x8FF9,0x9069,0x93D1,0x4F43,0x4F7A,0x50B3,0x5168,0x5178, +0x524D,0x526A,0x5861,0x587C,0x5960,0x5C08,0x5C55,0x5EDB, +0x609B,0x6230,0x6813,0x6BBF,0x6C08,0x6FB1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x714E,0x7420,0x7530,0x7538,0x7551,0x7672,0x7B4C,0x7B8B, +0x7BAD,0x7BC6,0x7E8F,0x8A6E,0x8F3E,0x8F49,0x923F,0x9293, +0x9322,0x942B,0x96FB,0x985A,0x986B,0x991E,0x5207,0x622A, +0x6298,0x6D59,0x7664,0x7ACA,0x7BC0,0x7D76,0x5360,0x5CBE, +0x5E97,0x6F38,0x70B9,0x7C98,0x9711,0x9B8E,0x9EDE,0x63A5, +0x647A,0x8776,0x4E01,0x4E95,0x4EAD,0x505C,0x5075,0x5448, +0x59C3,0x5B9A,0x5E40,0x5EAD,0x5EF7,0x5F81,0x60C5,0x633A, +0x653F,0x6574,0x65CC,0x6676,0x6678,0x67FE,0x6968,0x6A89, +0x6B63,0x6C40,0x6DC0,0x6DE8,0x6E1F,0x6E5E,0x701E,0x70A1, +0x738E,0x73FD,0x753A,0x775B,0x7887,0x798E,0x7A0B,0x7A7D, +0x7CBE,0x7D8E,0x8247,0x8A02,0x8AEA,0x8C9E,0x912D,0x914A, +0x91D8,0x9266,0x92CC,0x9320,0x9706,0x9756, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x975C,0x9802,0x9F0E,0x5236,0x5291,0x557C,0x5824,0x5E1D, +0x5F1F,0x608C,0x63D0,0x68AF,0x6FDF,0x796D,0x7B2C,0x81CD, +0x85BA,0x88FD,0x8AF8,0x8E44,0x918D,0x9664,0x969B,0x973D, +0x984C,0x9F4A,0x4FCE,0x5146,0x51CB,0x52A9,0x5632,0x5F14, +0x5F6B,0x63AA,0x64CD,0x65E9,0x6641,0x66FA,0x66F9,0x671D, +0x689D,0x68D7,0x69FD,0x6F15,0x6F6E,0x7167,0x71E5,0x722A, +0x74AA,0x773A,0x7956,0x795A,0x79DF,0x7A20,0x7A95,0x7C97, +0x7CDF,0x7D44,0x7E70,0x8087,0x85FB,0x86A4,0x8A54,0x8ABF, +0x8D99,0x8E81,0x9020,0x906D,0x91E3,0x963B,0x96D5,0x9CE5, +0x65CF,0x7C07,0x8DB3,0x93C3,0x5B58,0x5C0A,0x5352,0x62D9, +0x731D,0x5027,0x5B97,0x5F9E,0x60B0,0x616B,0x68D5,0x6DD9, +0x742E,0x7A2E,0x7D42,0x7D9C,0x7E31,0x816B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E2A,0x8E35,0x937E,0x9418,0x4F50,0x5750,0x5DE6,0x5EA7, +0x632B,0x7F6A,0x4E3B,0x4F4F,0x4F8F,0x505A,0x59DD,0x80C4, +0x546A,0x5468,0x55FE,0x594F,0x5B99,0x5DDE,0x5EDA,0x665D, +0x6731,0x67F1,0x682A,0x6CE8,0x6D32,0x6E4A,0x6F8D,0x70B7, +0x73E0,0x7587,0x7C4C,0x7D02,0x7D2C,0x7DA2,0x821F,0x86DB, +0x8A3B,0x8A85,0x8D70,0x8E8A,0x8F33,0x9031,0x914E,0x9152, +0x9444,0x99D0,0x7AF9,0x7CA5,0x4FCA,0x5101,0x51C6,0x57C8, +0x5BEF,0x5CFB,0x6659,0x6A3D,0x6D5A,0x6E96,0x6FEC,0x710C, +0x756F,0x7AE3,0x8822,0x9021,0x9075,0x96CB,0x99FF,0x8301, +0x4E2D,0x4EF2,0x8846,0x91CD,0x537D,0x6ADB,0x696B,0x6C41, +0x847A,0x589E,0x618E,0x66FE,0x62EF,0x70DD,0x7511,0x75C7, +0x7E52,0x84B8,0x8B49,0x8D08,0x4E4B,0x53EA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x54AB,0x5730,0x5740,0x5FD7,0x6301,0x6307,0x646F,0x652F, +0x65E8,0x667A,0x679D,0x67B3,0x6B62,0x6C60,0x6C9A,0x6F2C, +0x77E5,0x7825,0x7949,0x7957,0x7D19,0x80A2,0x8102,0x81F3, +0x829D,0x82B7,0x8718,0x8A8C,0xF9FC,0x8D04,0x8DBE,0x9072, +0x76F4,0x7A19,0x7A37,0x7E54,0x8077,0x5507,0x55D4,0x5875, +0x632F,0x6422,0x6649,0x664B,0x686D,0x699B,0x6B84,0x6D25, +0x6EB1,0x73CD,0x7468,0x74A1,0x755B,0x75B9,0x76E1,0x771E, +0x778B,0x79E6,0x7E09,0x7E1D,0x81FB,0x852F,0x8897,0x8A3A, +0x8CD1,0x8EEB,0x8FB0,0x9032,0x93AD,0x9663,0x9673,0x9707, +0x4F84,0x53F1,0x59EA,0x5AC9,0x5E19,0x684E,0x74C6,0x75BE, +0x79E9,0x7A92,0x81A3,0x86ED,0x8CEA,0x8DCC,0x8FED,0x659F, +0x6715,0xF9FD,0x57F7,0x6F57,0x7DDD,0x8F2F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x93F6,0x96C6,0x5FB5,0x61F2,0x6F84,0x4E14,0x4F98,0x501F, +0x53C9,0x55DF,0x5D6F,0x5DEE,0x6B21,0x6B64,0x78CB,0x7B9A, +0xF9FE,0x8E49,0x8ECA,0x906E,0x6349,0x643E,0x7740,0x7A84, +0x932F,0x947F,0x9F6A,0x64B0,0x6FAF,0x71E6,0x74A8,0x74DA, +0x7AC4,0x7C12,0x7E82,0x7CB2,0x7E98,0x8B9A,0x8D0A,0x947D, +0x9910,0x994C,0x5239,0x5BDF,0x64E6,0x672D,0x7D2E,0x50ED, +0x53C3,0x5879,0x6158,0x6159,0x61FA,0x65AC,0x7AD9,0x8B92, +0x8B96,0x5009,0x5021,0x5275,0x5531,0x5A3C,0x5EE0,0x5F70, +0x6134,0x655E,0x660C,0x6636,0x66A2,0x69CD,0x6EC4,0x6F32, +0x7316,0x7621,0x7A93,0x8139,0x8259,0x83D6,0x84BC,0x50B5, +0x57F0,0x5BC0,0x5BE8,0x5F69,0x63A1,0x7826,0x7DB5,0x83DC, +0x8521,0x91C7,0x91F5,0x518A,0x67F5,0x7B56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8CAC,0x51C4,0x59BB,0x60BD,0x8655,0x501C,0xF9FF,0x5254, +0x5C3A,0x617D,0x621A,0x62D3,0x64F2,0x65A5,0x6ECC,0x7620, +0x810A,0x8E60,0x965F,0x96BB,0x4EDF,0x5343,0x5598,0x5929, +0x5DDD,0x64C5,0x6CC9,0x6DFA,0x7394,0x7A7F,0x821B,0x85A6, +0x8CE4,0x8E10,0x9077,0x91E7,0x95E1,0x9621,0x97C6,0x51F8, +0x54F2,0x5586,0x5FB9,0x64A4,0x6F88,0x7DB4,0x8F1F,0x8F4D, +0x9435,0x50C9,0x5C16,0x6CBE,0x6DFB,0x751B,0x77BB,0x7C3D, +0x7C64,0x8A79,0x8AC2,0x581E,0x59BE,0x5E16,0x6377,0x7252, +0x758A,0x776B,0x8ADC,0x8CBC,0x8F12,0x5EF3,0x6674,0x6DF8, +0x807D,0x83C1,0x8ACB,0x9751,0x9BD6,0xFA00,0x5243,0x66FF, +0x6D95,0x6EEF,0x7DE0,0x8AE6,0x902E,0x905E,0x9AD4,0x521D, +0x527F,0x54E8,0x6194,0x6284,0x62DB,0x68A2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6912,0x695A,0x6A35,0x7092,0x7126,0x785D,0x7901,0x790E, +0x79D2,0x7A0D,0x8096,0x8278,0x82D5,0x8349,0x8549,0x8C82, +0x8D85,0x9162,0x918B,0x91AE,0x4FC3,0x56D1,0x71ED,0x77D7, +0x8700,0x89F8,0x5BF8,0x5FD6,0x6751,0x90A8,0x53E2,0x585A, +0x5BF5,0x60A4,0x6181,0x6460,0x7E3D,0x8070,0x8525,0x9283, +0x64AE,0x50AC,0x5D14,0x6700,0x589C,0x62BD,0x63A8,0x690E, +0x6978,0x6A1E,0x6E6B,0x76BA,0x79CB,0x82BB,0x8429,0x8ACF, +0x8DA8,0x8FFD,0x9112,0x914B,0x919C,0x9310,0x9318,0x939A, +0x96DB,0x9A36,0x9C0D,0x4E11,0x755C,0x795D,0x7AFA,0x7B51, +0x7BC9,0x7E2E,0x84C4,0x8E59,0x8E74,0x8EF8,0x9010,0x6625, +0x693F,0x7443,0x51FA,0x672E,0x9EDC,0x5145,0x5FE0,0x6C96, +0x87F2,0x885D,0x8877,0x60B4,0x81B5,0x8403, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8D05,0x53D6,0x5439,0x5634,0x5A36,0x5C31,0x708A,0x7FE0, +0x805A,0x8106,0x81ED,0x8DA3,0x9189,0x9A5F,0x9DF2,0x5074, +0x4EC4,0x53A0,0x60FB,0x6E2C,0x5C64,0x4F88,0x5024,0x55E4, +0x5CD9,0x5E5F,0x6065,0x6894,0x6CBB,0x6DC4,0x71BE,0x75D4, +0x75F4,0x7661,0x7A1A,0x7A49,0x7DC7,0x7DFB,0x7F6E,0x81F4, +0x86A9,0x8F1C,0x96C9,0x99B3,0x9F52,0x5247,0x52C5,0x98ED, +0x89AA,0x4E03,0x67D2,0x6F06,0x4FB5,0x5BE2,0x6795,0x6C88, +0x6D78,0x741B,0x7827,0x91DD,0x937C,0x87C4,0x79E4,0x7A31, +0x5FEB,0x4ED6,0x54A4,0x553E,0x58AE,0x59A5,0x60F0,0x6253, +0x62D6,0x6736,0x6955,0x8235,0x9640,0x99B1,0x99DD,0x502C, +0x5353,0x5544,0x577C,0xFA01,0x6258,0xFA02,0x64E2,0x666B, +0x67DD,0x6FC1,0x6FEF,0x7422,0x7438,0x8A17, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9438,0x5451,0x5606,0x5766,0x5F48,0x619A,0x6B4E,0x7058, +0x70AD,0x7DBB,0x8A95,0x596A,0x812B,0x63A2,0x7708,0x803D, +0x8CAA,0x5854,0x642D,0x69BB,0x5B95,0x5E11,0x6E6F,0xFA03, +0x8569,0x514C,0x53F0,0x592A,0x6020,0x614B,0x6B86,0x6C70, +0x6CF0,0x7B1E,0x80CE,0x82D4,0x8DC6,0x90B0,0x98B1,0xFA04, +0x64C7,0x6FA4,0x6491,0x6504,0x514E,0x5410,0x571F,0x8A0E, +0x615F,0x6876,0xFA05,0x75DB,0x7B52,0x7D71,0x901A,0x5806, +0x69CC,0x817F,0x892A,0x9000,0x9839,0x5078,0x5957,0x59AC, +0x6295,0x900F,0x9B2A,0x615D,0x7279,0x95D6,0x5761,0x5A46, +0x5DF4,0x628A,0x64AD,0x64FA,0x6777,0x6CE2,0x6D3E,0x722C, +0x7436,0x7834,0x7F77,0x82AD,0x8DDB,0x9817,0x5224,0x5742, +0x677F,0x7248,0x74E3,0x8CA9,0x8FA6,0x9211, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x962A,0x516B,0x53ED,0x634C,0x4F69,0x5504,0x6096,0x6557, +0x6C9B,0x6D7F,0x724C,0x72FD,0x7A17,0x8987,0x8C9D,0x5F6D, +0x6F8E,0x70F9,0x81A8,0x610E,0x4FBF,0x504F,0x6241,0x7247, +0x7BC7,0x7DE8,0x7FE9,0x904D,0x97AD,0x9A19,0x8CB6,0x576A, +0x5E73,0x67B0,0x840D,0x8A55,0x5420,0x5B16,0x5E63,0x5EE2, +0x5F0A,0x6583,0x80BA,0x853D,0x9589,0x965B,0x4F48,0x5305, +0x530D,0x530F,0x5486,0x54FA,0x5703,0x5E03,0x6016,0x629B, +0x62B1,0x6355,0xFA06,0x6CE1,0x6D66,0x75B1,0x7832,0x80DE, +0x812F,0x82DE,0x8461,0x84B2,0x888D,0x8912,0x900B,0x92EA, +0x98FD,0x9B91,0x5E45,0x66B4,0x66DD,0x7011,0x7206,0xFA07, +0x4FF5,0x527D,0x5F6A,0x6153,0x6753,0x6A19,0x6F02,0x74E2, +0x7968,0x8868,0x8C79,0x98C7,0x98C4,0x9A43, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x54C1,0x7A1F,0x6953,0x8AF7,0x8C4A,0x98A8,0x99AE,0x5F7C, +0x62AB,0x75B2,0x76AE,0x88AB,0x907F,0x9642,0x5339,0x5F3C, +0x5FC5,0x6CCC,0x73CC,0x7562,0x758B,0x7B46,0x82FE,0x999D, +0x4E4F,0x903C,0x4E0B,0x4F55,0x53A6,0x590F,0x5EC8,0x6630, +0x6CB3,0x7455,0x8377,0x8766,0x8CC0,0x9050,0x971E,0x9C15, +0x58D1,0x5B78,0x8650,0x8B14,0x9DB4,0x5BD2,0x6068,0x608D, +0x65F1,0x6C57,0x6F22,0x6FA3,0x701A,0x7F55,0x7FF0,0x9591, +0x9592,0x9650,0x97D3,0x5272,0x8F44,0x51FD,0x542B,0x54B8, +0x5563,0x558A,0x6ABB,0x6DB5,0x7DD8,0x8266,0x929C,0x9677, +0x9E79,0x5408,0x54C8,0x76D2,0x86E4,0x95A4,0x95D4,0x965C, +0x4EA2,0x4F09,0x59EE,0x5AE6,0x5DF7,0x6052,0x6297,0x676D, +0x6841,0x6C86,0x6E2F,0x7F38,0x809B,0x822A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFA08,0xFA09,0x9805,0x4EA5,0x5055,0x54B3,0x5793,0x595A, +0x5B69,0x5BB3,0x61C8,0x6977,0x6D77,0x7023,0x87F9,0x89E3, +0x8A72,0x8AE7,0x9082,0x99ED,0x9AB8,0x52BE,0x6838,0x5016, +0x5E78,0x674F,0x8347,0x884C,0x4EAB,0x5411,0x56AE,0x73E6, +0x9115,0x97FF,0x9909,0x9957,0x9999,0x5653,0x589F,0x865B, +0x8A31,0x61B2,0x6AF6,0x737B,0x8ED2,0x6B47,0x96AA,0x9A57, +0x5955,0x7200,0x8D6B,0x9769,0x4FD4,0x5CF4,0x5F26,0x61F8, +0x665B,0x6CEB,0x70AB,0x7384,0x73B9,0x73FE,0x7729,0x774D, +0x7D43,0x7D62,0x7E23,0x8237,0x8852,0xFA0A,0x8CE2,0x9249, +0x986F,0x5B51,0x7A74,0x8840,0x9801,0x5ACC,0x4FE0,0x5354, +0x593E,0x5CFD,0x633E,0x6D79,0x72F9,0x8105,0x8107,0x83A2, +0x92CF,0x9830,0x4EA8,0x5144,0x5211,0x578B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F62,0x6CC2,0x6ECE,0x7005,0x7050,0x70AF,0x7192,0x73E9, +0x7469,0x834A,0x87A2,0x8861,0x9008,0x90A2,0x93A3,0x99A8, +0x516E,0x5F57,0x60E0,0x6167,0x66B3,0x8559,0x8E4A,0x91AF, +0x978B,0x4E4E,0x4E92,0x547C,0x58D5,0x58FA,0x597D,0x5CB5, +0x5F27,0x6236,0x6248,0x660A,0x6667,0x6BEB,0x6D69,0x6DCF, +0x6E56,0x6EF8,0x6F94,0x6FE0,0x6FE9,0x705D,0x72D0,0x7425, +0x745A,0x74E0,0x7693,0x795C,0x7CCA,0x7E1E,0x80E1,0x82A6, +0x846B,0x84BF,0x864E,0x865F,0x8774,0x8B77,0x8C6A,0x93AC, +0x9800,0x9865,0x60D1,0x6216,0x9177,0x5A5A,0x660F,0x6DF7, +0x6E3E,0x743F,0x9B42,0x5FFD,0x60DA,0x7B0F,0x54C4,0x5F18, +0x6C5E,0x6CD3,0x6D2A,0x70D8,0x7D05,0x8679,0x8A0C,0x9D3B, +0x5316,0x548C,0x5B05,0x6A3A,0x706B,0x7575, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x798D,0x79BE,0x82B1,0x83EF,0x8A71,0x8B41,0x8CA8,0x9774, +0xFA0B,0x64F4,0x652B,0x78BA,0x78BB,0x7A6B,0x4E38,0x559A, +0x5950,0x5BA6,0x5E7B,0x60A3,0x63DB,0x6B61,0x6665,0x6853, +0x6E19,0x7165,0x74B0,0x7D08,0x9084,0x9A69,0x9C25,0x6D3B, +0x6ED1,0x733E,0x8C41,0x95CA,0x51F0,0x5E4C,0x5FA8,0x604D, +0x60F6,0x6130,0x614C,0x6643,0x6644,0x69A5,0x6CC1,0x6E5F, +0x6EC9,0x6F62,0x714C,0x749C,0x7687,0x7BC1,0x7C27,0x8352, +0x8757,0x9051,0x968D,0x9EC3,0x532F,0x56DE,0x5EFB,0x5F8A, +0x6062,0x6094,0x61F7,0x6666,0x6703,0x6A9C,0x6DEE,0x6FAE, +0x7070,0x736A,0x7E6A,0x81BE,0x8334,0x86D4,0x8AA8,0x8CC4, +0x5283,0x7372,0x5B96,0x6A6B,0x9404,0x54EE,0x5686,0x5B5D, +0x6548,0x6585,0x66C9,0x689F,0x6D8D,0x6DC6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x723B,0x80B4,0x9175,0x9A4D,0x4FAF,0x5019,0x539A,0x540E, +0x543C,0x5589,0x55C5,0x5E3F,0x5F8C,0x673D,0x7166,0x73DD, +0x9005,0x52DB,0x52F3,0x5864,0x58CE,0x7104,0x718F,0x71FB, +0x85B0,0x8A13,0x6688,0x85A8,0x55A7,0x6684,0x714A,0x8431, +0x5349,0x5599,0x6BC1,0x5F59,0x5FBD,0x63EE,0x6689,0x7147, +0x8AF1,0x8F1D,0x9EBE,0x4F11,0x643A,0x70CB,0x7566,0x8667, +0x6064,0x8B4E,0x9DF8,0x5147,0x51F6,0x5308,0x6D36,0x80F8, +0x9ED1,0x6615,0x6B23,0x7098,0x75D5,0x5403,0x5C79,0x7D07, +0x8A16,0x6B20,0x6B3D,0x6B46,0x5438,0x6070,0x6D3D,0x7FD5, +0x8208,0x50D6,0x51DE,0x559C,0x566B,0x56CD,0x59EC,0x5B09, +0x5E0C,0x6199,0x6198,0x6231,0x665E,0x66E6,0x7199,0x71B9, +0x71BA,0x72A7,0x79A7,0x7A00,0x7FB2,0x8A70}; + +static int func_ksc5601_uni_onechar(int code){ + if ((code>=0x8141)&&(code<=0xC8FE)) + return(tab_ksc5601_uni0[code-0x8141]); + if ((code>=0xCAA1)&&(code<=0xFDFE)) + return(tab_ksc5601_uni1[code-0xCAA1]); + return(0); +} +/* page 0 0x00A1-0x0167 */ +static uint16 tab_uni_ksc56010[]={ +0xA2AE, 0, 0,0xA2B4, 0, 0,0xA1D7,0xA1A7, + 0,0xA8A3, 0, 0,0xA1A9, 0, 0,0xA1C6, +0xA1BE,0xA9F7,0xA9F8,0xA2A5, 0,0xA2D2,0xA1A4,0xA2AC, +0xA9F6,0xA8AC, 0,0xA8F9,0xA8F6,0xA8FA,0xA2AF, 0, + 0, 0, 0, 0, 0,0xA8A1, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA8A2, + 0, 0, 0, 0, 0, 0,0xA1BF,0xA8AA, + 0, 0, 0, 0, 0,0xA8AD,0xA9AC, 0, + 0, 0, 0, 0, 0,0xA9A1, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA9A3, + 0, 0, 0, 0, 0, 0,0xA1C0,0xA9AA, + 0, 0, 0, 0, 0,0xA9AD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA9A2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA8A4,0xA9A4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA9A5,0xA8A6,0xA9A6, 0, 0, 0, 0,0xA9A7, + 0, 0, 0, 0, 0, 0,0xA8A8,0xA9A8, +0xA8A9,0xA9A9, 0, 0, 0, 0, 0, 0, +0xA9B0,0xA8AF,0xA9AF, 0, 0, 0, 0, 0, + 0,0xA8AB,0xA9AB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA8AE,0xA9AE}; + +/* page 1 0x02C7-0x0451 */ +static uint16 tab_uni_ksc56011[]={ +0xA2A7, 0, 0, 0, 0, 0, 0, 0, + 0,0xA2B0, 0, 0, 0, 0, 0, 0, + 0,0xA2A8,0xA2AB,0xA2AA,0xA2AD, 0,0xA2A9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA5C1,0xA5C2,0xA5C3,0xA5C4,0xA5C5,0xA5C6, +0xA5C7,0xA5C8,0xA5C9,0xA5CA,0xA5CB,0xA5CC,0xA5CD,0xA5CE, +0xA5CF,0xA5D0,0xA5D1, 0,0xA5D2,0xA5D3,0xA5D4,0xA5D5, +0xA5D6,0xA5D7,0xA5D8, 0, 0, 0, 0, 0, + 0, 0,0xA5E1,0xA5E2,0xA5E3,0xA5E4,0xA5E5,0xA5E6, +0xA5E7,0xA5E8,0xA5E9,0xA5EA,0xA5EB,0xA5EC,0xA5ED,0xA5EE, +0xA5EF,0xA5F0,0xA5F1, 0,0xA5F2,0xA5F3,0xA5F4,0xA5F5, +0xA5F6,0xA5F7,0xA5F8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xACA7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xACA1,0xACA2,0xACA3,0xACA4,0xACA5,0xACA6,0xACA8, +0xACA9,0xACAA,0xACAB,0xACAC,0xACAD,0xACAE,0xACAF,0xACB0, +0xACB1,0xACB2,0xACB3,0xACB4,0xACB5,0xACB6,0xACB7,0xACB8, +0xACB9,0xACBA,0xACBB,0xACBC,0xACBD,0xACBE,0xACBF,0xACC0, +0xACC1,0xACD1,0xACD2,0xACD3,0xACD4,0xACD5,0xACD6,0xACD8, +0xACD9,0xACDA,0xACDB,0xACDC,0xACDD,0xACDE,0xACDF,0xACE0, +0xACE1,0xACE2,0xACE3,0xACE4,0xACE5,0xACE6,0xACE7,0xACE8, +0xACE9,0xACEA,0xACEB,0xACEC,0xACED,0xACEE,0xACEF,0xACF0, +0xACF1, 0,0xACD7}; + +/* page 2 0x2015-0x2312 */ +static uint16 tab_uni_ksc56012[]={ +0xA1AA, 0, 0,0xA1AE,0xA1AF, 0, 0,0xA1B0, +0xA1B1, 0, 0,0xA2D3,0xA2D4, 0, 0, 0, +0xA1A5,0xA1A6, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA2B6, 0,0xA1C7,0xA1C8, 0, + 0, 0, 0, 0, 0, 0,0xA1D8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA9F9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA9FA, 0,0xA9FB,0xA9FC,0xA9FD,0xA9FE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA1C9, 0, + 0, 0, 0, 0,0xA2B5, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA7A4, 0, + 0,0xA2E0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA2E5,0xA2E2, 0, 0, + 0,0xA7D9, 0, 0, 0, 0,0xA1CA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA8F7,0xA8F8, + 0, 0, 0, 0, 0, 0,0xA8FB,0xA8FC, +0xA8FD,0xA8FE, 0,0xA5B0,0xA5B1,0xA5B2,0xA5B3,0xA5B4, +0xA5B5,0xA5B6,0xA5B7,0xA5B8,0xA5B9, 0, 0, 0, + 0, 0, 0,0xA5A1,0xA5A2,0xA5A3,0xA5A4,0xA5A5, +0xA5A6,0xA5A7,0xA5A8,0xA5A9,0xA5AA, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA1E7,0xA1E8,0xA1E6,0xA1E9,0xA1EA, +0xA2D5,0xA2D8,0xA2D6,0xA2D9,0xA2D7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA2A1, 0,0xA2A2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA2A3, 0,0xA1D3,0xA2A4, 0, + 0, 0,0xA1D4,0xA1F4, 0, 0,0xA1F5, 0, + 0, 0,0xA2B3, 0,0xA2B2, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1EE, 0, 0, +0xA1F0,0xA1C4, 0,0xA1D0, 0, 0, 0, 0, +0xA1AB, 0,0xA1FC,0xA1FD,0xA1FB,0xA1FA,0xA1F2,0xA1F3, + 0,0xA2B1, 0, 0, 0, 0, 0,0xA1C5, +0xA1F1, 0, 0, 0, 0, 0, 0,0xA1AD, +0xA1EF, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1D6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA1C1,0xA1D5, 0, 0,0xA1C2, +0xA1C3, 0, 0, 0, 0,0xA1EC,0xA1ED, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1F8,0xA1F9, 0, + 0,0xA1F6,0xA1F7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA2C1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1D1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1D2}; + +/* page 3 0x2460-0x266D */ +static uint16 tab_uni_ksc56013[]={ +0xA8E7,0xA8E8,0xA8E9,0xA8EA,0xA8EB,0xA8EC,0xA8ED,0xA8EE, +0xA8EF,0xA8F0,0xA8F1,0xA8F2,0xA8F3,0xA8F4,0xA8F5, 0, + 0, 0, 0, 0,0xA9E7,0xA9E8,0xA9E9,0xA9EA, +0xA9EB,0xA9EC,0xA9ED,0xA9EE,0xA9EF,0xA9F0,0xA9F1,0xA9F2, +0xA9F3,0xA9F4,0xA9F5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA9CD,0xA9CE,0xA9CF,0xA9D0, +0xA9D1,0xA9D2,0xA9D3,0xA9D4,0xA9D5,0xA9D6,0xA9D7,0xA9D8, +0xA9D9,0xA9DA,0xA9DB,0xA9DC,0xA9DD,0xA9DE,0xA9DF,0xA9E0, +0xA9E1,0xA9E2,0xA9E3,0xA9E4,0xA9E5,0xA9E6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA8CD,0xA8CE,0xA8CF,0xA8D0,0xA8D1,0xA8D2,0xA8D3,0xA8D4, +0xA8D5,0xA8D6,0xA8D7,0xA8D8,0xA8D9,0xA8DA,0xA8DB,0xA8DC, +0xA8DD,0xA8DE,0xA8DF,0xA8E0,0xA8E1,0xA8E2,0xA8E3,0xA8E4, +0xA8E5,0xA8E6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA6A1,0xA6AC,0xA6A2,0xA6AD, 0, 0, 0, 0, + 0, 0, 0, 0,0xA6A3,0xA6C8,0xA6C7,0xA6AE, +0xA6A4,0xA6C2,0xA6C1,0xA6AF,0xA6A6,0xA6C6,0xA6C5,0xA6B1, +0xA6A5,0xA6C4,0xA6C3,0xA6B0,0xA6A7,0xA6BC,0xA6C9,0xA6CA, +0xA6B7,0xA6CB,0xA6CC,0xA6B2,0xA6A9,0xA6BE,0xA6CD,0xA6CE, +0xA6B9,0xA6CF,0xA6D0,0xA6B4,0xA6A8,0xA6D1,0xA6D2,0xA6B8, +0xA6BD,0xA6D3,0xA6D4,0xA6B3,0xA6AA,0xA6D5,0xA6D6,0xA6BA, +0xA6BF,0xA6D7,0xA6D8,0xA6B5,0xA6AB,0xA6D9,0xA6DA,0xA6BB, +0xA6DB,0xA6DC,0xA6C0,0xA6DD,0xA6DE,0xA6DF,0xA6E0,0xA6E1, +0xA6E2,0xA6E3,0xA6E4,0xA6B6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA2C6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1E1,0xA1E0, 0,0xA2C3,0xA2C7,0xA2C8,0xA2CB,0xA2CA, +0xA2C9,0xA2CC, 0, 0, 0, 0, 0, 0, + 0, 0,0xA1E3,0xA1E2, 0, 0,0xA2BA,0xA2B9, + 0, 0, 0, 0,0xA1E5,0xA1E4, 0, 0, +0xA2B8,0xA2B7, 0, 0, 0, 0,0xA1DF,0xA1DE, +0xA2C2, 0, 0,0xA1DB, 0, 0,0xA1DD,0xA1DC, +0xA2C4,0xA2C5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1DA,0xA1D9, 0, + 0, 0, 0, 0, 0, 0,0xA2CF,0xA2CE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA2D0, 0,0xA2D1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1CF, 0,0xA1CE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA2BC,0xA2BD, 0,0xA2C0,0xA2BB,0xA2BE, 0,0xA2BF, +0xA2CD,0xA2DB,0xA2DC, 0,0xA2DD,0xA2DA}; + +/* page 4 0x3000-0x327F */ +static uint16 tab_uni_ksc56014[]={ +0xA1A1,0xA1A2,0xA1A3,0xA1A8, 0, 0, 0, 0, +0xA1B4,0xA1B5,0xA1B6,0xA1B7,0xA1B8,0xA1B9,0xA1BA,0xA1BB, +0xA1BC,0xA1BD, 0,0xA1EB,0xA1B2,0xA1B3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xAAA1,0xAAA2,0xAAA3,0xAAA4,0xAAA5,0xAAA6,0xAAA7, +0xAAA8,0xAAA9,0xAAAA,0xAAAB,0xAAAC,0xAAAD,0xAAAE,0xAAAF, +0xAAB0,0xAAB1,0xAAB2,0xAAB3,0xAAB4,0xAAB5,0xAAB6,0xAAB7, +0xAAB8,0xAAB9,0xAABA,0xAABB,0xAABC,0xAABD,0xAABE,0xAABF, +0xAAC0,0xAAC1,0xAAC2,0xAAC3,0xAAC4,0xAAC5,0xAAC6,0xAAC7, +0xAAC8,0xAAC9,0xAACA,0xAACB,0xAACC,0xAACD,0xAACE,0xAACF, +0xAAD0,0xAAD1,0xAAD2,0xAAD3,0xAAD4,0xAAD5,0xAAD6,0xAAD7, +0xAAD8,0xAAD9,0xAADA,0xAADB,0xAADC,0xAADD,0xAADE,0xAADF, +0xAAE0,0xAAE1,0xAAE2,0xAAE3,0xAAE4,0xAAE5,0xAAE6,0xAAE7, +0xAAE8,0xAAE9,0xAAEA,0xAAEB,0xAAEC,0xAAED,0xAAEE,0xAAEF, +0xAAF0,0xAAF1,0xAAF2,0xAAF3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xABA1,0xABA2,0xABA3,0xABA4,0xABA5,0xABA6,0xABA7, +0xABA8,0xABA9,0xABAA,0xABAB,0xABAC,0xABAD,0xABAE,0xABAF, +0xABB0,0xABB1,0xABB2,0xABB3,0xABB4,0xABB5,0xABB6,0xABB7, +0xABB8,0xABB9,0xABBA,0xABBB,0xABBC,0xABBD,0xABBE,0xABBF, +0xABC0,0xABC1,0xABC2,0xABC3,0xABC4,0xABC5,0xABC6,0xABC7, +0xABC8,0xABC9,0xABCA,0xABCB,0xABCC,0xABCD,0xABCE,0xABCF, +0xABD0,0xABD1,0xABD2,0xABD3,0xABD4,0xABD5,0xABD6,0xABD7, +0xABD8,0xABD9,0xABDA,0xABDB,0xABDC,0xABDD,0xABDE,0xABDF, +0xABE0,0xABE1,0xABE2,0xABE3,0xABE4,0xABE5,0xABE6,0xABE7, +0xABE8,0xABE9,0xABEA,0xABEB,0xABEC,0xABED,0xABEE,0xABEF, +0xABF0,0xABF1,0xABF2,0xABF3,0xABF4,0xABF5,0xABF6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA4A1,0xA4A2,0xA4A3,0xA4A4,0xA4A5,0xA4A6,0xA4A7, +0xA4A8,0xA4A9,0xA4AA,0xA4AB,0xA4AC,0xA4AD,0xA4AE,0xA4AF, +0xA4B0,0xA4B1,0xA4B2,0xA4B3,0xA4B4,0xA4B5,0xA4B6,0xA4B7, +0xA4B8,0xA4B9,0xA4BA,0xA4BB,0xA4BC,0xA4BD,0xA4BE,0xA4BF, +0xA4C0,0xA4C1,0xA4C2,0xA4C3,0xA4C4,0xA4C5,0xA4C6,0xA4C7, +0xA4C8,0xA4C9,0xA4CA,0xA4CB,0xA4CC,0xA4CD,0xA4CE,0xA4CF, +0xA4D0,0xA4D1,0xA4D2,0xA4D3,0xA4D4,0xA4D5,0xA4D6,0xA4D7, +0xA4D8,0xA4D9,0xA4DA,0xA4DB,0xA4DC,0xA4DD,0xA4DE,0xA4DF, +0xA4E0,0xA4E1,0xA4E2,0xA4E3,0xA4E4,0xA4E5,0xA4E6,0xA4E7, +0xA4E8,0xA4E9,0xA4EA,0xA4EB,0xA4EC,0xA4ED,0xA4EE,0xA4EF, +0xA4F0,0xA4F1,0xA4F2,0xA4F3,0xA4F4,0xA4F5,0xA4F6,0xA4F7, +0xA4F8,0xA4F9,0xA4FA,0xA4FB,0xA4FC,0xA4FD,0xA4FE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA9B1,0xA9B2,0xA9B3,0xA9B4,0xA9B5,0xA9B6,0xA9B7,0xA9B8, +0xA9B9,0xA9BA,0xA9BB,0xA9BC,0xA9BD,0xA9BE,0xA9BF,0xA9C0, +0xA9C1,0xA9C2,0xA9C3,0xA9C4,0xA9C5,0xA9C6,0xA9C7,0xA9C8, +0xA9C9,0xA9CA,0xA9CB,0xA9CC,0xA2DF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA8B1,0xA8B2,0xA8B3,0xA8B4,0xA8B5,0xA8B6,0xA8B7,0xA8B8, +0xA8B9,0xA8BA,0xA8BB,0xA8BC,0xA8BD,0xA8BE,0xA8BF,0xA8C0, +0xA8C1,0xA8C2,0xA8C3,0xA8C4,0xA8C5,0xA8C6,0xA8C7,0xA8C8, +0xA8C9,0xA8CA,0xA8CB,0xA8CC, 0, 0, 0,0xA2DE +}; + +/* page 5 0x3380-0x33DD */ +static uint16 tab_uni_ksc56015[]={ +0xA7C9,0xA7CA,0xA7CB,0xA7CC,0xA7CD, 0, 0, 0, +0xA7BA,0xA7BB,0xA7DC,0xA7DD,0xA7DE,0xA7B6,0xA7B7,0xA7B8, +0xA7D4,0xA7D5,0xA7D6,0xA7D7,0xA7D8,0xA7A1,0xA7A2,0xA7A3, +0xA7A5,0xA7AB,0xA7AC,0xA7AD,0xA7AE,0xA7AF,0xA7B0,0xA7B1, +0xA7B2,0xA7B3,0xA7B4,0xA7A7,0xA7A8,0xA7A9,0xA7AA,0xA7BD, +0xA7BE,0xA7E5,0xA7E6,0xA7E7,0xA7E8,0xA7E1,0xA7E2,0xA7E3, +0xA7BF,0xA7C0,0xA7C1,0xA7C2,0xA7C3,0xA7C4,0xA7C5,0xA7C6, +0xA7C7,0xA7C8,0xA7CE,0xA7CF,0xA7D0,0xA7D1,0xA7D2,0xA7D3, +0xA7DA,0xA7DB,0xA2E3,0xA7EC,0xA7A6,0xA7E0,0xA7EF,0xA2E1, +0xA7BC,0xA7ED,0xA7B5, 0, 0, 0, 0,0xA7B9, +0xA7EA, 0, 0,0xA7EB, 0, 0,0xA7DF, 0, +0xA2E4, 0, 0,0xA7E4,0xA7EE,0xA7E9}; + +/* page 6 0x4E00-0x947F */ +static uint16 tab_uni_ksc56016[]={ +0xECE9,0xEFCB, 0,0xF6D2, 0, 0, 0,0xD8B2, +0xEDDB,0xDFB2,0xDFBE,0xF9BB, 0,0xDCF4, 0, 0, + 0,0xF5E4, 0, 0,0xF3A6,0xDDE0,0xE1A6, 0, +0xCEF8,0xDCB0, 0, 0, 0, 0,0xE3AA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF1E9, 0, 0, + 0, 0,0xCDFA, 0, 0, 0, 0, 0, +0xFCAF,0xD3A1, 0,0xF1AB, 0, 0, 0, 0, + 0, 0,0xE7D1,0xD2AC, 0,0xCEF9, 0, 0, + 0, 0, 0,0xF1FD, 0,0xDEBF,0xFBBA,0xF9B9, + 0, 0, 0, 0, 0, 0,0xCED2, 0, +0xE3AB,0xEBE0, 0, 0, 0,0xCEFA,0xCBF7,0xE5A5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCAE1, 0,0xD4CC, 0, 0, + 0, 0, 0,0xEAE1, 0, 0,0xDCE3,0xDFAD, + 0, 0, 0, 0, 0, 0,0xCBEB, 0, + 0, 0,0xD5AF, 0, 0, 0,0xD6F5, 0, +0xE5F8, 0, 0,0xDEC0,0xECA3, 0,0xE9CD, 0, +0xEAA7,0xE9F6,0xFBBB, 0,0xE7E9,0xEFCC, 0, 0, +0xD0E6, 0, 0,0xDEC1, 0, 0,0xE4AC, 0, + 0,0xD8CC,0xF9F1, 0,0xCEDF,0xFAA4,0xE6B2, 0, +0xFAFB, 0, 0,0xFABD,0xCCC8,0xEFCD,0xD5D5, 0, + 0, 0, 0, 0, 0, 0,0xD3A2, 0, + 0, 0,0xECD1, 0, 0, 0, 0, 0, +0xE4A7,0xECD2, 0, 0,0xF6B1, 0, 0,0xCEFB, + 0, 0,0xD0D1,0xCBBF, 0,0xEDA4, 0, 0, + 0, 0, 0, 0,0xEDA8,0xDEC2,0xF6E2,0xEDDC, +0xDCF5,0xE0B9, 0, 0, 0,0xD4CE, 0,0xF4B5, + 0, 0, 0,0xD3DB,0xD6B5,0xECA4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE4E6, 0,0xF1EA, 0, 0, 0,0xCBEC,0xCBC0, + 0, 0, 0,0xECF2, 0, 0, 0, 0, + 0,0xD0EA, 0, 0, 0, 0, 0, 0, + 0,0xF9F2,0xECA5,0xD0DF, 0,0xE7EA,0xD0EB,0xDCD1, +0xDBE9,0xFDCC, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDBD7, + 0, 0, 0, 0,0xDAE1, 0,0xD6B6, 0, +0xE3DF, 0,0xDEC3, 0,0xDEC4,0xCAA1, 0, 0, + 0, 0, 0,0xEEEC, 0, 0,0xD3A3,0xEEB7, +0xF8CF, 0, 0, 0, 0,0xEAC8,0xEEB8,0xF1AC, +0xF1A5,0xE9CE, 0, 0, 0,0xF9BC, 0, 0, + 0,0xE5F9,0xECEA,0xDDD6,0xEDC2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF8A5, 0, 0, 0, 0, 0,0xE5BA, +0xDBD8, 0, 0,0xCAA2, 0, 0,0xD1CD, 0, + 0, 0,0xEEED, 0, 0, 0,0xECEB,0xDEC5, + 0,0xE3E0, 0,0xCAC9,0xF2E9, 0,0xD5CE, 0, +0xF6B6, 0,0xCEC2,0xD6C7, 0,0xE3B4, 0,0xF1AD, + 0,0xEAE2, 0, 0, 0, 0,0xD7C2, 0, +0xF3A7, 0, 0,0xCDEA, 0,0xEBEE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD9B2,0xFDA5, + 0, 0, 0, 0, 0,0xF6D5,0xD5E2, 0, + 0, 0, 0, 0, 0, 0, 0,0xF8B5, + 0, 0,0xCCF5,0xF5B5,0xE4AD, 0, 0, 0, + 0,0xE7EB,0xF1D5, 0, 0, 0,0xF0BB, 0, + 0,0xE9B5, 0,0xCCC9,0xFAD5, 0, 0,0xE1D4, + 0, 0,0xD7D6, 0, 0,0xDCC1, 0,0xDEC6, +0xFAEF,0xE3E1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE1F3,0xDCF6, + 0,0xCEFC, 0,0xDBC4, 0,0xF8F1, 0, 0, +0xDCE4, 0,0xE5EF, 0, 0, 0, 0, 0, + 0, 0,0xDCB1, 0, 0, 0,0xD5D6, 0, + 0,0xF3DA, 0,0xCBC1, 0,0xDBC3, 0, 0, + 0,0xD9FA,0xD3EE, 0, 0, 0,0xFAB8, 0, + 0,0xFDA6,0xEBEF, 0,0xF4A6, 0,0xCCCA,0xF3A8, + 0,0xF3DB, 0,0xDBA7,0xF6B7, 0,0xCFE6,0xF0F2, +0xCBDA, 0,0xE7D2,0xD7C3,0xF6F0,0xE8DE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE5A6, 0, 0, 0, 0, + 0, 0, 0,0xE5E7, 0, 0, 0,0xCAA3, +0xCCA7,0xEAC9, 0, 0, 0, 0, 0,0xF8B6, + 0, 0, 0, 0, 0,0xFAA5, 0, 0, + 0, 0,0xF1AE, 0,0xEFCE, 0, 0, 0, + 0, 0, 0, 0, 0,0xCBED, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF6B0,0xEFCF,0xE9CF, 0, +0xF7DE, 0, 0, 0, 0, 0, 0, 0, +0xCED3, 0, 0, 0, 0,0xDCF7, 0, 0, + 0, 0, 0, 0, 0,0xDBA8, 0, 0, + 0,0xCBF8, 0, 0, 0, 0, 0, 0, +0xDFA1,0xDDE1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF5CA,0xE9B6, 0, 0, + 0, 0,0xE7EC,0xEEEE, 0,0xF3F0, 0,0xDFBF, + 0, 0, 0, 0, 0, 0,0xCCCB, 0, + 0, 0, 0, 0, 0,0xD0C1, 0, 0, + 0,0xF4D2,0xE0BA, 0, 0, 0, 0,0xDFC0, + 0,0xCEE0, 0, 0, 0,0xDCD2,0xFDEA, 0, + 0, 0,0xD6F6, 0, 0, 0,0xEACA, 0, + 0, 0, 0, 0, 0,0xE8E9, 0,0xE3AC, + 0, 0, 0, 0, 0,0xF3D0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCAA4, 0,0xDBF8, 0, 0, 0,0xDEC7, +0xEBF0,0xF1D6, 0, 0,0xE5E2, 0,0xCCCC, 0, + 0,0xCBFB, 0, 0, 0, 0, 0, 0, + 0, 0,0xEAE3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDFC1, + 0,0xD6ED, 0, 0, 0, 0, 0, 0, + 0, 0,0xE9D0, 0, 0, 0, 0, 0, + 0, 0,0xEEB9, 0, 0, 0, 0,0xD5E3, + 0, 0,0xD1D3, 0,0xE5F0, 0, 0, 0, +0xE8B4,0xEBC3, 0,0xEAAA,0xFAFC,0xF5F6,0xF0BC,0xFDD4, +0xE0BB,0xCEC3, 0,0xD0BA,0xF7BA,0xD8F3,0xF7CD, 0, + 0, 0,0xE4AE, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xD4DF, 0, 0, 0, + 0, 0,0xD0E7, 0, 0,0xECFD, 0,0xD2AE, +0xEEEF,0xD5D7,0xEAE4,0xF8A2,0xCDEB,0xD7BF,0xFBB1, 0, + 0,0xCDEC, 0, 0, 0,0xDCB2,0xD0EC,0xCEFD, +0xEEF0, 0, 0, 0,0xCCC2, 0, 0, 0, +0xD0ED, 0, 0, 0, 0, 0,0xE5F7, 0, + 0, 0,0xF3FC, 0, 0,0xEEA2, 0, 0, + 0, 0,0xD9B3, 0, 0,0xD8F4, 0,0xE9B7, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCEAE, 0, 0, 0, 0,0xD9A2, 0, 0, + 0, 0,0xD8F1, 0,0xD4CF, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE5A7,0xD5D2, + 0, 0, 0, 0, 0,0xD6A9, 0, 0, + 0, 0, 0, 0,0xF4A2, 0,0xF1D7, 0, + 0,0xD5D8, 0,0xF0BD,0xD7D0,0xD4D0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xD7CF,0xEBEA,0xFDEB, 0, + 0,0xDBED, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFCC5,0xCBC2, 0, 0, 0, 0,0xFDD5, 0, +0xF4C8,0xE8EA,0xF5F3, 0, 0,0xF9DE, 0, 0, +0xD3EF, 0, 0,0xECD3, 0, 0,0xDDC2,0xEFB7, +0xE7D4, 0,0xCACA, 0, 0, 0,0xD9FB, 0, + 0,0xFAFD, 0, 0, 0, 0, 0,0xD6AA, + 0, 0, 0, 0, 0,0xF4F8, 0, 0, + 0, 0, 0, 0,0xF7F7,0xDCAC, 0, 0, + 0,0xD7D7,0xDFA2, 0, 0, 0,0xCEBE, 0, +0xD3F0, 0, 0, 0, 0, 0,0xF0A4,0xE1EC, +0xCFE7,0xF3CB,0xEDA9,0xCABE, 0, 0, 0, 0, + 0, 0, 0,0xF4EF, 0, 0, 0,0xF6CE, + 0, 0,0xDEFB,0xD0BB,0xD5B7,0xEEF1, 0, 0, + 0, 0, 0, 0,0xF4A8, 0,0xDCF8, 0, + 0, 0, 0,0xCBA7, 0,0xDACE, 0, 0, + 0,0xE0E6, 0, 0, 0, 0, 0, 0, + 0,0xEDA5,0xEEF2, 0, 0, 0, 0,0xDCF9, + 0, 0,0xF9DC, 0, 0,0xF3DC, 0, 0, + 0, 0, 0, 0, 0,0xF8F2, 0,0xF4F9, + 0, 0, 0,0xFCF1, 0, 0, 0,0xD0BC, +0xDBF9,0xD7B1, 0, 0, 0,0xCBFC, 0, 0, + 0,0xF0A5,0xCBFD, 0, 0, 0, 0, 0, + 0, 0, 0,0xD5F4, 0, 0, 0,0xCDED, +0xCAA5, 0, 0,0xD6AB,0xD0C2, 0, 0, 0, + 0,0xF0BE,0xD2BD,0xCCA4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFAB6, 0, + 0,0xCCCD, 0,0xDAFA, 0,0xF6CF, 0,0xE9B8, + 0,0xD8F5, 0, 0, 0,0xCCCE, 0, 0, + 0, 0,0xD7CD, 0, 0,0xD4D1,0xE9ED, 0, +0xCAEB,0xD9E2, 0,0xFDB2, 0,0xE3AD,0xD6CC,0xD9B4, + 0, 0,0xE1A7,0xEED3,0xD0C3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFDB3, 0,0xD5E4, 0, 0, +0xCFE8, 0,0xEDC3,0xD0B2, 0, 0,0xCEFE,0xDAA8, + 0, 0, 0, 0, 0,0xF8D0, 0, 0, +0xFDD6, 0, 0, 0, 0,0xF8D1, 0,0xF8D2, +0xDCD3, 0, 0, 0, 0,0xDDE2,0xFBF9,0xDDC1, + 0,0xE3B5, 0, 0, 0, 0, 0, 0, +0xEDDD,0xCEC4, 0,0xCBA1, 0, 0, 0, 0, + 0, 0,0xDDE3, 0, 0, 0, 0,0xFCDD, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF9AF, 0, 0, 0, 0, 0,0xD2FB, +0xCFA1,0xE4A8, 0,0xF4B6,0xECFE, 0, 0,0xE3AE, +0xE7ED,0xFDC1,0xDAE2, 0, 0,0xD8B3, 0, 0, + 0,0xDDE4,0xF0EF,0xF6F1,0xFAF0, 0, 0,0xD1F5, + 0, 0,0xDACF, 0,0xDCD4, 0,0xDCA6, 0, +0xEFBF, 0, 0, 0, 0, 0,0xCECF, 0, +0xE0D9, 0, 0, 0, 0, 0, 0,0xD9D6, +0xECD4,0xEACB, 0, 0,0xCABF,0xD5B0, 0,0xCFE9, + 0, 0, 0, 0, 0,0xF1ED, 0,0xCCCF, + 0, 0, 0, 0,0xE4F8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4ED, 0, 0, 0, 0, +0xD7D8, 0,0xFDA7, 0, 0, 0, 0,0xEAAB, +0xF6B2, 0, 0, 0, 0,0xCFF0,0xF9BD, 0, + 0, 0, 0, 0, 0,0xE6F4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCBDB, 0, 0, 0, 0, + 0, 0, 0,0xF3D1, 0, 0, 0, 0, +0xE9D1,0xF3A9,0xD0E0,0xE9D2, 0,0xDAE3, 0, 0, + 0, 0, 0, 0,0xE2D2, 0,0xF6A2,0xE1F4, + 0, 0, 0,0xDAE4, 0, 0, 0, 0, + 0,0xE7D5,0xF5BF,0xCFA2,0xCDAF,0xCFA3, 0, 0, + 0,0xCDB0,0xF1FE,0xD0A3,0xE1AF,0xF8A3, 0,0xCAA6, +0xF7BB,0xF2EA,0xDEC8,0xE9D3, 0, 0, 0, 0, +0xDEC9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFDDE,0xCAC0, 0, 0, 0, +0xF9EA,0xD1CE,0xEED4, 0,0xD4D2,0xD9A3,0xFDA8,0xD7D9, +0xF7CE,0xFABE, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCFD6, 0,0xD7F0, 0,0xEBE1, +0xF8C5, 0, 0, 0, 0, 0,0xDCFA, 0, + 0,0xDDC3, 0,0xF9DF, 0, 0, 0, 0, + 0, 0, 0,0xE7EF, 0, 0, 0, 0, +0xFDE5,0xF6A3, 0,0xD9FC,0xFDA9, 0,0xE7EE, 0, + 0, 0,0xD5E5, 0, 0, 0, 0, 0, +0xEFD0, 0,0xCDB1, 0, 0, 0, 0, 0, + 0,0xF7A2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF1B2, 0,0xF1B1, 0, 0, 0, 0, 0, + 0,0xCDB2, 0,0xDAAB, 0,0xCAA7, 0, 0, + 0, 0, 0,0xE3E2,0xFBBC,0xD9A4, 0, 0, +0xEEBA, 0, 0, 0, 0, 0,0xF8D3, 0, + 0, 0, 0, 0,0xFBFA, 0,0xCFA4, 0, +0xDCFB, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF6E3, 0, 0, 0, +0xEDAA, 0, 0,0xF2A1,0xCEE1, 0, 0, 0, + 0, 0, 0,0xFAA6, 0, 0, 0, 0, +0xF9E0, 0, 0, 0, 0,0xECD6, 0, 0, +0xE4EE,0xF9A1, 0, 0,0xFBEF, 0, 0, 0, +0xF9EB,0xEEA3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEAAC, 0, 0, 0,0xCAA8, 0, 0, +0xF4FA, 0, 0, 0, 0,0xCDD6,0xFCF6, 0, + 0, 0,0xF4C9, 0, 0, 0, 0, 0, + 0, 0,0xF8D4, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF8A6, 0,0xDECA,0xF2C6, + 0, 0, 0, 0, 0, 0,0xD7DA, 0, +0xD3D0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xD8C5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEAE6, + 0,0xF3DD, 0, 0, 0,0xE4DA, 0, 0, + 0, 0, 0, 0, 0, 0,0xF6E4, 0, + 0, 0, 0, 0,0xF6F2, 0,0xDFC2, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9FD, + 0, 0, 0,0xCCF6, 0, 0,0xD3BA, 0, + 0, 0, 0, 0, 0, 0,0xE4AF, 0, + 0, 0, 0,0xF9E1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF0A6, 0, 0, 0, +0xCBD3, 0, 0, 0,0xE0BC, 0,0xF4CA,0xD4FA, + 0,0xFDAA,0xF9E2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF4B7,0xFDC2,0xFCB0, 0,0xFDEC,0xCAE2, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFDBD, + 0,0xEAE7,0xDFC3,0xD1D2,0xCEE2, 0,0xD3A4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFDAB, 0,0xDFE0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF2C7, 0, 0, 0, + 0, 0,0xE7F0, 0,0xD0EE, 0, 0,0xF3AA, + 0, 0, 0,0xDECB,0xF6B8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE1F5,0xF1B3, 0, + 0, 0, 0, 0, 0, 0,0xF7A3, 0, + 0,0xCAA9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCFA5, 0, 0,0xDFC4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE1B0, + 0, 0,0xF0BF, 0,0xF6A4, 0,0xE3B6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFAC6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD0EF, 0, 0,0xFDED, 0, 0, 0, 0, + 0, 0, 0, 0,0xDDC4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFCF7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE6BF, 0, 0, + 0, 0, 0, 0,0xDEAD, 0,0xFABF, 0, + 0, 0, 0, 0,0xE5F1, 0, 0, 0, + 0, 0, 0, 0,0xEDC4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD2A5, 0, 0,0xFDEE, 0, 0, + 0,0xF5B6, 0, 0, 0, 0, 0, 0, + 0, 0,0xE1F6,0xDECC, 0, 0,0xFCDE, 0, +0xECD7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCDDD, 0, 0, 0, 0, 0, 0, 0, + 0,0xD6B7,0xCDB3, 0, 0, 0, 0, 0, + 0, 0, 0,0xF8D5,0xE5D8, 0, 0, 0, +0xCFEA, 0, 0,0xCFD0, 0,0xEACC, 0, 0, + 0, 0,0xEAAE,0xEAAD, 0, 0,0xD3F1, 0, +0xD3A5, 0, 0, 0, 0, 0, 0,0xF7CF, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEEA4, 0, 0, 0, 0,0xD0A4, 0, 0, +0xF2A2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD0F0, 0, 0, 0, 0, +0xF2A3, 0,0xF7F8, 0, 0, 0, 0,0xD0B3, + 0, 0,0xDBA9, 0, 0,0xD3BB,0xCAEC, 0, +0xF1A6,0xCBD5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF7E7, 0, 0,0xCDDE, 0,0xF7A4, 0, + 0, 0,0xF8C0, 0, 0, 0,0xD3DD, 0, +0xCCD0, 0, 0, 0, 0,0xCFA6, 0, 0, + 0, 0, 0, 0,0xF6F3, 0, 0, 0, + 0, 0,0xE1F7, 0, 0, 0, 0, 0, +0xD3DC, 0, 0,0xFAFE, 0, 0, 0, 0, + 0, 0, 0,0xFAA7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEBD9, 0,0xCFA7,0xEAAF, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4EF, 0, 0, 0,0xE9B9, +0xF1D8, 0, 0,0xD8D8, 0, 0,0xE0F2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE6B4, +0xDCFC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF3F1, 0, 0, 0,0xE3D0, 0, 0,0xF2FB, + 0,0xDBC6,0xD0F1, 0,0xD0F2, 0, 0, 0, +0xCFDC, 0,0xD3D1, 0, 0,0xCCB1,0xF7D8, 0, +0xCBA8,0xEBBC,0xE4BE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF4DC, 0, + 0,0xDCC2, 0, 0,0xF0A7, 0, 0,0xE6C0, + 0, 0,0xCAED, 0, 0, 0, 0,0xE8EB, +0xE5E8,0xDCC3, 0, 0,0xEDDE,0xD3F2, 0, 0, + 0, 0,0xCCF7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xCED4,0xE7AB, 0, 0, 0,0xCBC3, + 0,0xE1B1, 0, 0,0xF7B2, 0, 0,0xD3F3, +0xD3D2, 0,0xF5C0, 0, 0, 0,0xDFDD, 0, + 0,0xEEF3,0xE7F1, 0,0xFDB4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF2C8, 0, 0, + 0,0xF3D2, 0, 0,0xEEF4, 0,0xE2D3, 0, + 0, 0, 0,0xCCD1, 0,0xDFEA, 0, 0, + 0,0xE9BA, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD9D7, 0, 0, 0, 0, + 0, 0, 0, 0,0xF5CD, 0,0xF1F2,0xFAC7, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD9F8,0xD4C2, 0, 0, 0, 0,0xF6E5, 0, + 0, 0, 0,0xDDC5, 0, 0, 0, 0, + 0, 0,0xE7F2,0xEDDF, 0, 0,0xCACB, 0, + 0,0xDBFA, 0, 0, 0,0xE8B5, 0,0xD3A6, + 0, 0, 0, 0, 0, 0,0xFDB5, 0, + 0,0xF9C9, 0,0xE4E2, 0,0xFBBD, 0, 0, +0xD7A4,0xCEC5, 0, 0, 0, 0,0xCED5,0xD6E6, + 0, 0, 0, 0,0xE5BD, 0, 0, 0, + 0, 0, 0,0xDECD,0xECF3, 0, 0,0xEDE0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xECEC,0xFBBE,0xDFEB, 0,0xE1F8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF9BE, + 0, 0, 0, 0,0xD0F3,0xE0AA,0xE8E2, 0, + 0,0xE2D4,0xD2FD, 0,0xE5A8, 0, 0, 0, + 0, 0,0xD9D3, 0, 0, 0, 0,0xD3DE, + 0,0xF4B8,0xF7BC,0xDCFD, 0,0xE8EC,0xE4E7, 0, + 0,0xE3F7, 0, 0, 0, 0, 0,0xECA8, + 0, 0, 0, 0, 0, 0,0xFAF1, 0, + 0, 0, 0, 0,0xE5F2, 0, 0,0xD0F4, +0xD2AF,0xDCE5, 0, 0, 0, 0,0xD0A5,0xF1B4, +0xFCB1,0xCCF8, 0, 0,0xDDC6,0xFAD1, 0,0xF7DF, + 0, 0,0xFAA8, 0, 0, 0, 0, 0, +0xEEF5, 0,0xDECE, 0, 0, 0, 0,0xE7F3, + 0, 0,0xF7AC,0xEBC4,0xEDE1,0xE0AB,0xDDC7, 0, + 0, 0, 0,0xD2B3,0xD2BF, 0, 0, 0, +0xCACC, 0, 0, 0, 0,0xFBBF, 0, 0, + 0, 0,0xE5FD,0xDDE5,0xD8CD, 0, 0, 0, + 0, 0,0xECF4, 0, 0, 0, 0, 0, + 0, 0, 0,0xD0F5, 0, 0,0xE8ED,0xD0D2, + 0,0xD9D8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF6E6, 0, 0, +0xDBAA, 0, 0, 0,0xF7E0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xD8D9, 0,0xF4A3, 0, 0,0xF4DD, 0, + 0, 0, 0,0xEFD1, 0, 0,0xD9B5, 0, + 0,0xEDAB, 0,0xE3B7, 0, 0, 0, 0, +0xEEBB,0xCDB4, 0,0xE0F3,0xEACD, 0, 0, 0, + 0,0xECF5,0xE8EE, 0,0xCBA9,0xF1AF, 0, 0, + 0, 0, 0, 0, 0, 0,0xCACD, 0, +0xECA9, 0,0xF2EB, 0,0xFDEF, 0,0xF9F3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE6C1, 0, 0,0xECD8, 0, 0, 0,0xEDAC, + 0,0xEACE, 0,0xE8DF, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xDECF, 0, 0, 0, 0, 0, 0, +0xD2A6, 0, 0,0xE7F4,0xD1D6, 0, 0,0xE6C2, +0xE3E3, 0, 0, 0, 0,0xE4B0, 0, 0, + 0,0xD8B4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF6A5, 0, + 0, 0, 0, 0,0xF3DE, 0, 0, 0, + 0,0xD7A5, 0, 0, 0, 0,0xF7E8, 0, + 0,0xE8C6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFBE6, 0, 0, 0, 0, 0, + 0, 0,0xDDE6, 0, 0, 0,0xDCFE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD8DA, 0, 0, 0, 0, 0, + 0, 0,0xDAAC,0xEAB0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE3B8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCAAA,0xE1F9, 0,0xEAB1, 0, 0, 0, + 0,0xF2EC, 0, 0,0xFAEE, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEED5, 0, 0, 0, 0,0xF9F4, 0, + 0,0xD2EC, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFBFB, 0, 0, + 0,0xFDF0, 0,0xE0BD,0xCEE3, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF8C6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDEAE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xDFC5, 0, 0,0xE5BE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEDAD,0xFAEA, 0, 0,0xCDEE,0xEDA6, 0,0xEDAE, +0xF0ED, 0,0xDDA1, 0,0xEDAF,0xFCF8, 0,0xD8EB, + 0, 0, 0,0xCCF9,0xCDB5, 0, 0, 0, + 0,0xFAA9, 0,0xE1DD, 0, 0, 0, 0, +0xE2D5,0xEDCF, 0, 0, 0,0xDDA2, 0, 0, +0xF9CA, 0,0xEAE8, 0,0xE5ED, 0, 0, 0, + 0, 0, 0, 0, 0,0xD3EB, 0,0xE9D4, +0xE1FA,0xE4CC, 0,0xE1E4,0xE8C7, 0, 0,0xCEDB, + 0, 0, 0,0xDCD5, 0,0xF7B5,0xFCF3,0xF0F3, +0xCEAF,0xF1B5,0xEFD2,0xE8C8,0xEBF1, 0, 0, 0, + 0, 0,0xCBD4,0xE0BE,0xE3F8,0xEAE9,0xFCB2, 0, + 0, 0, 0, 0,0xE0F4, 0,0xCFE0, 0, +0xEEA5, 0, 0,0xFAAA,0xE6C3,0xE1B2,0xCAAB, 0, +0xE3E4,0xE9BB, 0, 0, 0, 0, 0,0xE2D6, +0xF3F2, 0,0xEED6,0xEAB2,0xD0F6,0xECD9,0xDACB,0xCFA8, + 0, 0, 0, 0,0xDDA3, 0, 0, 0, +0xD8DB, 0,0xF9CE,0xE9D5,0xE3D1, 0, 0,0xD2BC, + 0, 0, 0, 0, 0, 0,0xD8AC,0xF3CC, + 0,0xCDFB,0xF6D6, 0,0xE7F5,0xE8EF,0xE3F9,0xD2BB, +0xF3F3,0xE3FB, 0,0xDED0,0xCEB0, 0,0xD6F7,0xF1D9, + 0, 0, 0, 0, 0,0xF5C1,0xDCC4, 0, +0xF5BB, 0,0xDED1, 0, 0, 0, 0, 0, + 0,0xDCE6, 0, 0,0xDED2, 0, 0,0xEDE2, +0xEEF6,0xEACF,0xF0EE,0xE3FC, 0,0xD3DF,0xD3F4,0xE1B3, + 0,0xE1B4, 0, 0, 0, 0,0xF4D3, 0, + 0,0xDFC6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE9D6, 0, 0, 0, +0xDBAB, 0, 0, 0, 0, 0, 0, 0, + 0,0xF6A6, 0, 0, 0, 0, 0, 0, +0xE3B9,0xEBC5,0xF4A9,0xCDB6,0xD2F9, 0,0xDAAD,0xD2E3, +0xCFD1, 0, 0, 0, 0,0xCBDC,0xCCFA, 0, +0xCFDD, 0, 0,0xE8A9, 0,0xE3BB,0xE3BA, 0, + 0,0xE0DA, 0, 0, 0,0xEEF7, 0, 0, + 0, 0, 0,0xDCB3, 0, 0, 0, 0, +0xD3F5, 0,0xD7A6, 0,0xF6B5,0xD7DB, 0, 0, + 0, 0, 0, 0,0xE1D5, 0, 0,0xD4EA, + 0,0xDFA3, 0, 0, 0, 0, 0, 0, + 0,0xFDDF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD0F7,0xEDD4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCBAA, 0, 0, 0, 0, 0, 0, + 0,0xE4DB, 0,0xE1FB,0xCBA2, 0, 0, 0, + 0,0xD3E0, 0,0xE4BF, 0,0xFBC0, 0,0xDABE, +0xE4CD, 0,0xD6B9, 0, 0, 0,0xEFC0, 0, +0xE1FC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF6B9, 0, 0, 0, 0, 0, 0, +0xDFC7, 0, 0, 0, 0, 0, 0, 0, +0xE4B1, 0, 0, 0, 0, 0, 0,0xDCE7, +0xDCE8, 0, 0, 0,0xFAD6, 0,0xD3F6, 0, + 0, 0, 0,0xF1DA, 0,0xFAF2, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2FD, + 0, 0, 0, 0, 0,0xD5CF,0xD0F8, 0, + 0,0xCDDF, 0, 0,0xF5CB, 0,0xE4F0,0xCBAB, + 0,0xD7C4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2FE, + 0,0xDDDA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xDAAE,0xCAEE, 0, 0, 0, +0xD5B9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE3A1, 0, 0,0xE8E3, 0, 0,0xF3AB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCFA9, + 0, 0, 0,0xD3F7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD4F1, 0, 0, +0xCEE4, 0,0xE8F2, 0, 0, 0, 0, 0, + 0, 0,0xE5F5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE7AE, 0,0xD6BA, 0,0xDFEC,0xE4C0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE8E4, 0, 0, + 0, 0,0xD8B5, 0, 0, 0,0xE4DC, 0, + 0, 0, 0, 0, 0,0xF4B9,0xF1B6, 0, + 0,0xE2DE,0xE1B5, 0, 0,0xCDEF,0xF1A7,0xCEE5, +0xCBDD, 0, 0,0xD9E3, 0, 0,0xF3AC, 0, + 0,0xD0F9,0xECAB,0xDED3,0xF7E9, 0, 0,0xF9F5, + 0, 0, 0, 0, 0,0xE1DE,0xCBEE, 0, + 0, 0,0xE3BC,0xF8D6, 0, 0,0xDBEE, 0, + 0, 0, 0, 0,0xFDF1, 0, 0, 0, + 0,0xF7B6, 0, 0, 0, 0,0xF4DE, 0, + 0,0xF2ED, 0,0xDBD9, 0,0xF0A8, 0, 0, + 0, 0, 0, 0, 0,0xE1FD, 0, 0, + 0, 0, 0,0xDED4, 0,0xE0AC, 0, 0, + 0, 0, 0,0xEDE3, 0, 0,0xD3E1, 0, +0xDFC8, 0, 0, 0, 0,0xD9B6, 0,0xFDAC, +0xEFD3, 0, 0, 0,0xE4C1,0xF8EB, 0,0xDBAC, + 0, 0, 0, 0,0xFCC6, 0, 0, 0, + 0, 0, 0, 0, 0,0xD8AD, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF6BA, + 0,0xDBDF,0xD3D3,0xF8C7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xCACE,0xF8C1,0xD2B4, 0, 0,0xDCB4, +0xFAB9,0xCACF, 0,0xFCB3,0xEAEA,0xEAEB,0xD0FA, 0, + 0, 0, 0, 0,0xEDE4, 0, 0,0xDDE7, + 0, 0,0xDFC9, 0, 0, 0, 0,0xDFED, + 0, 0, 0, 0, 0,0xEEBC, 0,0xEFC1, + 0, 0,0xCCD2, 0,0xDDA4, 0, 0, 0, +0xDFCA, 0, 0, 0, 0, 0,0xD3F8,0xF1A8, + 0, 0, 0,0xCDB7, 0,0xEFD4, 0, 0, + 0, 0, 0, 0, 0,0xE4DD,0xDFEE,0xCBAC, +0xE9BC, 0, 0, 0, 0, 0,0xEAEC, 0, + 0, 0,0xDFCB, 0, 0, 0, 0, 0, +0xF9BF,0xD6AF,0xD5C6, 0, 0, 0, 0, 0, +0xCFAA, 0, 0,0xCEA9, 0, 0,0xD6F8, 0, + 0, 0,0xF1B7,0xEEF8, 0, 0, 0,0xD9D9, +0xF3DF, 0,0xF8C8,0xCEC6, 0, 0, 0, 0, + 0, 0, 0, 0,0xD5E6, 0, 0, 0, + 0, 0, 0,0xF4E6, 0, 0,0xE6C5,0xEFD5, + 0, 0,0xCBEF,0xFCDF, 0, 0, 0, 0, + 0,0xDCA7, 0, 0,0xD6E7, 0, 0, 0, + 0, 0,0xF8C9, 0, 0, 0, 0,0xE3D2, + 0,0xE3BD, 0,0xCFE1,0xF0C0,0xECDA, 0,0xDDD7, +0xFBF0, 0, 0,0xECAC, 0, 0, 0,0xF0A9, + 0, 0, 0, 0, 0, 0,0xFAD7,0xFBC1, + 0,0xD2C0, 0, 0, 0, 0, 0, 0, + 0,0xE5B0, 0, 0, 0,0xEDE5, 0, 0, + 0, 0,0xCBAD, 0,0xF9B0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF7A5, 0,0xCBAE, 0,0xDAAF, 0,0xD8B6, 0, + 0, 0, 0, 0, 0, 0,0xD3A7,0xFBB2, + 0,0xFDC4, 0,0xECAD, 0, 0, 0, 0, + 0, 0,0xFBA1, 0, 0, 0,0xE5E9,0xE9EE, + 0,0xF3F4,0xF8F3,0xF0C1,0xDEAF,0xF8B0, 0, 0, +0xF3E0,0xE7AF, 0, 0, 0, 0, 0,0xDBAD, + 0,0xE6B5, 0, 0,0xF9A8, 0, 0,0xDDD8, +0xE8D9,0xEFD6, 0, 0, 0,0xD3E2, 0,0xE2DF, + 0, 0,0xFCE0,0xD7C8,0xFDAD, 0, 0, 0, +0xDFEF,0xCCD3,0xD3F9, 0, 0, 0, 0,0xD4F0, +0xDBC7,0xDED5, 0, 0, 0, 0,0xF0F4, 0, +0xD5D0,0xE5D9, 0, 0, 0, 0, 0, 0, +0xFCC7,0xDCD6,0xE2E0, 0, 0, 0,0xDAB0, 0, + 0, 0, 0, 0, 0,0xF3A3, 0,0xD3EC, + 0,0xF4CB, 0, 0, 0,0xFDC5, 0, 0, + 0, 0, 0,0xE3FD, 0,0xF9B1, 0, 0, + 0, 0, 0, 0,0xD0FB,0xECDB, 0, 0, + 0, 0, 0, 0, 0, 0,0xF5BC,0xF2A4, +0xD8CE,0xD8CF, 0, 0, 0, 0, 0, 0, +0xF5F7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF6E1, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD2B7, 0, 0, + 0, 0, 0, 0, 0,0xFBEC, 0,0xDDC8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE4E8, + 0, 0,0xD2C1, 0, 0, 0,0xF8D7, 0, + 0, 0, 0, 0,0xD6BB,0xDED6, 0, 0, +0xF7BD,0xECAE, 0, 0, 0,0xD0E1, 0,0xE0F5, +0xEAB3, 0,0xCED6, 0, 0, 0, 0,0xCCA5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xECF6,0xE2E1,0xE3BE, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFCC8, 0, 0, +0xCDF0, 0,0xF9F6, 0, 0,0xDFF0, 0, 0, + 0,0xE5BF, 0, 0, 0,0xCEBF, 0, 0, + 0, 0,0xFCE1,0xEDB0,0xFDD1,0xF6BB, 0, 0, +0xF9CF,0xEBDA,0xCAC1, 0,0xD2B8,0xCDF1, 0,0xE3D3, +0xFDE6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE6ED, 0, 0, + 0,0xE3FA, 0, 0,0xF0AA,0xF9D0, 0, 0, + 0, 0, 0, 0,0xFCE2, 0,0xF8A7, 0, + 0, 0,0xE1E5,0xEEF9, 0, 0, 0,0xE7F6, +0xEAED, 0, 0,0xFCB4,0xF5C2, 0, 0,0xD7DC, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF0F5, 0,0xDDE8,0xD3ED,0xF5FC, 0,0xDABF, 0, +0xCCFB, 0, 0, 0,0xD3FA,0xF4A4, 0, 0, + 0, 0, 0, 0, 0,0xEFD7, 0,0xD4C3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFBE3, 0, 0, 0, 0, 0, 0, + 0, 0,0xFBED, 0,0xE0AD, 0, 0,0xEAEE, +0xFBB3,0xE4C2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF6E7,0xD2DD, 0,0xDFCC, 0, 0,0xFCC9, 0, + 0,0xE5A9,0xE0F6,0xF6B3, 0, 0, 0, 0, + 0,0xE1FE, 0, 0, 0, 0,0xCBF0, 0, +0xEAEF,0xEAF0, 0, 0, 0,0xDAC0,0xF8B4,0xEBF2, + 0, 0, 0, 0, 0,0xE4C3, 0, 0, + 0, 0,0xE9D7,0xE4F1, 0, 0, 0,0xCAEF, + 0, 0, 0, 0, 0, 0, 0,0xCED7, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFCCA, 0, 0, 0,0xF3E1, 0, 0,0xCBC4, + 0, 0, 0, 0,0xE3E5, 0,0xCBC5,0xEAB4, + 0, 0,0xE9BD, 0,0xD7C9, 0, 0,0xEBDB, +0xEDB1, 0,0xCCC3,0xF7BE,0xFCCB, 0, 0, 0, + 0, 0, 0,0xF8F4, 0,0xD9B7, 0, 0, +0xF3D3,0xF3D4, 0, 0, 0,0xF7E4, 0,0xF7D1, + 0, 0,0xD8B7,0xCEB1,0xCAC2, 0, 0,0xFBB4, +0xCBC6, 0, 0,0xF0F6, 0, 0,0xD5E7, 0, +0xEAD0, 0, 0, 0, 0, 0,0xCCD4,0xCBAF, + 0, 0, 0, 0, 0,0xF4AA,0xE9AF, 0, + 0,0xF5C3,0xE9D8, 0, 0, 0, 0, 0, + 0, 0,0xDDE9, 0, 0, 0,0xF1F3, 0, +0xD5FB,0xDEBB, 0, 0,0xF4FB, 0, 0, 0, +0xFDF3,0xFDF2,0xF7A6, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDDC9, 0, 0,0xD4D3, + 0,0xCCA8, 0,0xDAC1,0xCCD5, 0,0xD9E4, 0, + 0, 0,0xFACA, 0, 0, 0,0xE5E3, 0, + 0, 0,0xD3BC, 0, 0, 0,0xCAF0, 0, + 0, 0, 0,0xD0C4, 0, 0, 0,0xCAD0, +0xFAAB,0xEBEB,0xE7F8,0xD9E5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD1D7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF3A4, 0, 0, 0,0xD4FB,0xFCE3, +0xFAD8, 0,0xF3D5, 0,0xCFAB, 0, 0,0xEBF3, +0xD5FC, 0, 0, 0, 0, 0, 0,0xD3D4, +0xCDFC, 0,0xD9E6, 0,0xE2F9,0xE2A1,0xEBD4, 0, +0xE0F7,0xE4B2,0xCCFC, 0, 0, 0,0xFBE4, 0, + 0, 0,0xF4AB, 0, 0, 0, 0,0xD0BD, + 0,0xCAF1, 0, 0, 0, 0, 0, 0, + 0, 0,0xEFB8, 0, 0, 0,0xD7C0, 0, +0xEEFA,0xFDF4, 0, 0,0xD3E3, 0,0xFBC2, 0, + 0, 0, 0, 0, 0, 0,0xD5E8,0xDBAE, +0xE1B6,0xF8B7, 0, 0, 0, 0, 0,0xE0BF, +0xFBC3,0xDDEA, 0,0xE2A2, 0,0xEEA6, 0, 0, + 0, 0, 0,0xF6E8, 0, 0, 0, 0, +0xF6F5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xDDCA, 0, + 0,0xD0E2, 0, 0, 0, 0,0xDDA6, 0, + 0,0xDDEB, 0, 0,0xE4F9, 0, 0,0xE3AF, +0xD0FC, 0, 0, 0,0xF4FC, 0, 0, 0, + 0,0xCCBC,0xF7EA, 0, 0, 0, 0, 0, + 0,0xE5E4,0xDFF1, 0, 0,0xF7E1, 0,0xF9F7, +0xEFB9, 0, 0,0xF8D8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF9A9, 0, 0, 0, 0, + 0,0xF8D9, 0, 0, 0,0xEEBD, 0, 0, + 0,0xD8C6, 0, 0,0xE4E3,0xF5CE, 0, 0, + 0, 0,0xDDD9, 0, 0, 0, 0,0xD9E7, +0xD2B9,0xD5C3, 0, 0,0xDAE5,0xDAD0, 0,0xD1D9, +0xCED8, 0,0xCBDE,0xF4AC,0xDAFB, 0,0xF6E9,0xE8F3, +0xCFAC,0xF0F0, 0,0xF4FD,0xDBC8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCEC0,0xE3D4,0xD1CF,0xF1F5, + 0,0xCDF2, 0,0xCFEB, 0, 0, 0,0xCDB8, + 0, 0, 0, 0, 0, 0,0xE3A6,0xD1DA, + 0,0xF2A5, 0, 0, 0, 0, 0,0xF2A6, + 0,0xE4CE, 0, 0, 0, 0, 0, 0, + 0,0xD3FB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF1A9, 0, 0, 0,0xF2C9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xEFD8,0xE6C9, 0,0xD8B8,0xFAF3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF3B5, 0, 0,0xF8A4, 0, 0,0xD1F3, +0xE6C8, 0, 0, 0, 0,0xF8DA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDCE9, +0xDED7, 0, 0, 0, 0, 0,0xCBDF, 0, + 0, 0,0xCFEC, 0, 0, 0, 0,0xF4DF, + 0, 0,0xD1F4,0xD2BA, 0, 0, 0,0xDFF2, + 0, 0, 0,0xE1B7, 0, 0, 0, 0, +0xE2A3,0xD3FC, 0, 0,0xEDE6, 0, 0, 0, + 0, 0,0xDBC9, 0, 0, 0,0xE4FA, 0, +0xCFDE, 0, 0,0xCED0, 0, 0, 0, 0, +0xD5D3,0xF3F5,0xF7AE, 0, 0,0xEFC8, 0,0xCDF3, +0xF5CF,0xE5F3,0xF0C2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCAD1, 0, 0, 0,0xEAF1, 0,0xD0A6, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9DA, +0xF0AB, 0, 0, 0, 0, 0,0xEBE7, 0, + 0, 0,0xE5C0,0xFCB5, 0, 0, 0, 0, + 0,0xE4C4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xCCA9,0xFDC6, 0, + 0, 0, 0, 0,0xEAB5, 0,0xE5AA,0xDFBA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE1DF, 0,0xDAD1, + 0, 0, 0, 0,0xE1B8, 0,0xE8F4,0xD3FD, + 0, 0, 0, 0,0xE2A4, 0, 0, 0, + 0, 0,0xF2CA, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDAE6,0xF7B3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFDCD, 0, 0, 0,0xF3B6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEED7, 0, 0, 0, 0, 0, 0, 0, +0xF5C4, 0, 0, 0, 0, 0, 0, 0, + 0,0xD8A4, 0, 0, 0, 0, 0,0xF2A7, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD9B8,0xD9B9,0xEFC9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD6CE, 0, 0, 0, 0, 0, 0, 0, + 0,0xF7CB,0xDFAE,0xE8F5, 0, 0, 0, 0, + 0, 0,0xD2B5, 0, 0, 0,0xD3D5, 0, + 0, 0, 0, 0,0xF4CC,0xDAFC, 0, 0, + 0, 0, 0,0xD9E8, 0,0xF7EB,0xF5C9, 0, +0xF3BC, 0,0xDAD2, 0, 0, 0, 0, 0, + 0, 0, 0,0xD3B5, 0, 0, 0, 0, + 0,0xE8B6, 0, 0,0xD6CF,0xF4BA, 0,0xF7C9, + 0, 0,0xCCAA, 0, 0,0xF0C3,0xCCD6, 0, + 0, 0,0xD0D3, 0,0xD3BD, 0, 0, 0, +0xDBFB, 0,0xCBE0, 0, 0, 0, 0, 0, + 0,0xD3E4,0xF6F7, 0, 0,0xD5BA,0xF3CD,0xCBE1, + 0, 0, 0, 0,0xEBF4, 0, 0, 0, + 0, 0,0xF4AD, 0,0xFCAA, 0, 0, 0, + 0, 0,0xF7EC, 0, 0, 0,0xE8F6, 0, +0xDAE7, 0, 0, 0,0xF7CC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE5C1, 0, 0, 0, 0,0xE0EE, 0, 0, + 0, 0, 0,0xD5FD, 0, 0, 0, 0, + 0, 0,0xCEE6,0xFCAB,0xD5BB, 0, 0,0xF2A8, + 0, 0, 0, 0, 0, 0,0xE2A5,0xCDB9, +0xEAF2,0xCBC7, 0,0xCDF4, 0, 0,0xDBAF,0xEFD9, + 0, 0, 0, 0, 0,0xCDBA, 0, 0, +0xFCF9, 0, 0, 0, 0,0xDFF3,0xCEE7,0xDAC2, + 0,0xCFAD, 0, 0, 0, 0,0xE7F9,0xF8A8, + 0, 0, 0, 0, 0, 0,0xF3E2, 0, + 0, 0,0xCAF2,0xDFA4, 0, 0,0xD4C4, 0, + 0, 0, 0, 0,0xCCD7,0xE5C2, 0, 0, + 0, 0,0xCDBB, 0,0xEFDA,0xEED8, 0,0xDDA7, +0xE2A6, 0, 0, 0, 0, 0,0xE0C0, 0, + 0, 0,0xD6B0,0xF8CA, 0,0xFCFA, 0,0xD9FE, + 0, 0, 0, 0,0xDEB0, 0, 0, 0, +0xDDEC,0xDAE8, 0, 0, 0, 0, 0,0xD4E0, + 0,0xD6F9, 0,0xCDD7,0xDED8, 0, 0,0xF2F8, + 0,0xE4D6, 0, 0,0xD0C5,0xF4AE, 0,0xDDA8, + 0, 0, 0,0xEDC5,0xF3D6, 0, 0,0xDED9, +0xE3E6, 0, 0, 0, 0, 0, 0,0xD3A8, + 0,0xDBB0, 0, 0,0xE5DA,0xE3BF, 0, 0, + 0,0xDBB1, 0, 0, 0,0xD5E9, 0, 0, + 0, 0, 0,0xE0C1,0xEFDB, 0, 0,0xF0E9, + 0, 0,0xD7B2, 0, 0, 0, 0,0xD0FD, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD9E9, 0, 0,0xD0FE, 0,0xECED,0xD3A9, 0, +0xF2A9,0xF0C4, 0, 0,0xE2E2,0xE9EF, 0, 0, + 0,0xF9D1, 0, 0,0xE9D9, 0, 0, 0, + 0, 0,0xE8DA,0xDAC3,0xDAC4,0xD4C5, 0,0xE7FA, + 0, 0, 0, 0, 0, 0,0xCDE0,0xE3B0, + 0,0xDBB2,0xFBC4, 0,0xF3E3, 0,0xD9A5,0xFBE7, +0xDDCB,0xD0D4, 0,0xE6B6,0xE0AE,0xFDDA, 0, 0, + 0, 0, 0, 0, 0, 0,0xDCB5,0xE0F8, +0xE7B1, 0, 0, 0, 0,0xF5F0, 0,0xD8DC, +0xEDC6, 0, 0, 0, 0,0xE1B9, 0,0xE3C0, +0xF9C0,0xE9F0, 0, 0,0xD9DB, 0,0xF3E4, 0, + 0, 0,0xDCB6,0xE4E9, 0, 0, 0, 0, + 0,0xF0C5,0xE3C1,0xFCCC,0xFCCD, 0, 0, 0, + 0,0xF2CB, 0,0xF2CC, 0, 0, 0,0xE4CF, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF1DB, 0,0xFAD9, 0,0xF1B8,0xFDF5,0xE0F9, + 0, 0, 0, 0,0xE7FB,0xFCB7,0xFCE4,0xFBC5, +0xE3E7,0xD8B9, 0,0xF6F8, 0, 0,0xDCC5,0xCCD8, + 0, 0, 0,0xE0AF,0xF4E7, 0,0xEFDC,0xCFFC, +0xEFDD, 0,0xF2AA, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFDBE, 0, 0,0xCAAC, +0xFDBB,0xFDC7, 0, 0, 0, 0,0xE7B2, 0, +0xEAD1,0xDFF4, 0, 0, 0, 0,0xD1EC,0xE4DE, +0xE5C3, 0, 0, 0, 0,0xD9A6, 0, 0, +0xCDBC, 0,0xF3E5, 0, 0, 0, 0, 0, + 0, 0, 0,0xEDD5, 0, 0,0xD9BA, 0, + 0, 0,0xEDE7,0xFBB5,0xF8EC, 0, 0, 0, + 0,0xE0E7, 0,0xCCD9, 0, 0,0xD4C6, 0, + 0, 0, 0, 0,0xE7A5, 0,0xD5F5,0xD3BE, + 0,0xFCFB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE4F2, 0, + 0,0xDFF5, 0, 0,0xE8F8,0xF8ED, 0, 0, +0xCEC7, 0, 0, 0, 0, 0,0xFDF6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE8D8, 0,0xCDD8,0xE7D6,0xCCDA, 0, 0,0xCAE3, +0xDFF6,0xF0C7,0xF0C6, 0,0xD8BA, 0,0xF1F4,0xF4F0, +0xF5CC, 0, 0,0xFCE5, 0, 0, 0, 0, +0xEAC5,0xEAF3, 0,0xDDDB, 0,0xDCD7, 0, 0, + 0, 0, 0, 0,0xDEFD,0xF2F9, 0,0xD5C7, + 0, 0, 0,0xD8D0, 0,0xF0C8,0xD1A1,0xD1A2, + 0, 0, 0, 0, 0, 0,0xD9D4,0xD6E8, +0xD9CA, 0,0xDAB1,0xD8C7,0xDCE2,0xF3CE,0xF5F4, 0, + 0,0xF1B9, 0, 0,0xDAD3, 0,0xF6EA, 0, + 0, 0,0xCFF5, 0, 0,0xFDAE, 0, 0, + 0, 0, 0, 0, 0, 0,0xCAD2, 0, + 0,0xDFB4, 0, 0, 0, 0,0xD7DD,0xFABA, +0xEEA7,0xF5BD, 0,0xF8F5, 0, 0,0xEDE8, 0, + 0, 0, 0, 0,0xD4E1, 0,0xD1A3,0xE1D6, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF9F8, 0,0xDBCA, +0xCBF9,0xD4D4, 0,0xD9DC, 0,0xEEBE, 0,0xF7ED, + 0, 0, 0,0xD2EE, 0, 0,0xE1E6,0xF7F9, + 0, 0, 0, 0, 0, 0, 0,0xDDED, + 0,0xE8DB, 0,0xDBB3, 0, 0, 0,0xD1F7, +0xE0B0, 0, 0,0xD4E2, 0,0xF6D7, 0,0xD7F9, + 0, 0,0xD8DD, 0,0xCDFD,0xF2AB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCDBD, +0xF8C2, 0, 0,0xF2AC, 0, 0,0xCAAD,0xCAAE, +0xCFAE, 0, 0, 0, 0, 0,0xE3C2, 0, + 0, 0, 0, 0,0xDCB7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDBDA, +0xD9BB,0xCAF3,0xF6D3,0xE6F8,0xEAF5, 0, 0, 0, + 0, 0,0xEAF6, 0, 0,0xF6F9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCFAF, 0, 0,0xCAD3, 0, 0,0xCAAF, +0xD2B0,0xF1BA, 0,0xD7B3,0xE3C3,0xF3FD,0xDEDA, 0, + 0, 0, 0,0xDEDB, 0, 0,0xEFDE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE2E3,0xEEFB, 0, 0,0xDFF7,0xD7CA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCEE8,0xDBDB, 0, 0, 0, 0, 0, + 0, 0,0xF1BB, 0, 0, 0, 0,0xE9F1, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFAB7,0xD0C6, 0, 0,0xCCAB,0xEEA8, 0, 0, +0xCBFA,0xF9F9,0xCCFD,0xD3FE, 0, 0, 0, 0, +0xE4D0, 0, 0, 0, 0, 0,0xF2EE, 0, +0xD4D5,0xDFCD, 0,0xFCB8,0xD1D0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF2CD, 0, 0, + 0, 0, 0, 0, 0, 0,0xF7D2, 0, + 0, 0, 0, 0, 0, 0, 0,0xCAD4, + 0,0xD5D9, 0, 0, 0,0xD8DE, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCDD9, + 0, 0, 0,0xEEA9,0xF6BC, 0, 0,0xCCDB, + 0, 0, 0, 0, 0,0xF0C9, 0,0xFCFC, + 0,0xE8C9,0xF4FE, 0, 0, 0, 0,0xE7FC, +0xD7DE, 0, 0, 0, 0,0xDEDC, 0,0xF0AC, +0xCCFE,0xCDE1, 0,0xE1BA, 0,0xDBEF,0xDAB2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xD1A5,0xDCB8, 0, 0, + 0,0xD8F6, 0,0xD1A4, 0,0xCDE2, 0, 0, + 0, 0,0xDCEA, 0, 0,0xF0F7, 0,0xF0CA, +0xD0BE, 0,0xDDDC, 0, 0, 0, 0,0xD4D6, +0xD3D6, 0, 0, 0, 0, 0, 0,0xEDD0, +0xCDA1, 0, 0, 0, 0, 0,0xDFB5, 0, + 0, 0,0xDFF8, 0, 0, 0, 0, 0, + 0,0xD4A1,0xCEB2, 0, 0, 0, 0, 0, +0xE8CA, 0, 0, 0, 0,0xEBF5, 0, 0, + 0, 0, 0, 0, 0,0xE3D5,0xF5D0, 0, + 0, 0,0xF5A1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9A7, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE5AB, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE6CB, 0,0xF5F1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE5C5, 0, 0, 0, 0, 0, + 0, 0, 0,0xF9A3,0xE0DB,0xF6EB, 0,0xCBF1, + 0,0xD9EA,0xF5A2, 0, 0, 0,0xD7D1, 0, +0xD1F8,0xEAF8,0xEAF9,0xDAB3, 0, 0, 0, 0, +0xEFDF, 0, 0,0xF1EF, 0,0xE5F6,0xEEBF,0xE2E4, + 0, 0, 0, 0, 0,0xD0BF, 0,0xFAAC, +0xF5D1,0xE7B3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE9BE, 0, 0, + 0, 0, 0,0xF2CE,0xDBB4, 0, 0, 0, + 0, 0, 0, 0, 0,0xFCCE, 0,0xDDEE, + 0, 0, 0, 0, 0, 0,0xE7B4, 0, + 0, 0, 0, 0,0xD7B4, 0, 0, 0, + 0, 0, 0,0xF7B4, 0, 0, 0, 0, + 0,0xCDBE, 0,0xDAE9, 0, 0, 0, 0, + 0, 0, 0,0xCFB0,0xF7D9,0xF3E6, 0, 0, +0xCED9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCEAA, 0,0xCBC8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD0A7, 0,0xF0CB, 0,0xD0C7, + 0, 0,0xE4C5, 0, 0, 0, 0, 0, + 0, 0,0xDBE0, 0, 0, 0, 0, 0, + 0,0xD5DA, 0,0xD7A7, 0, 0, 0,0xEEC0, + 0,0xF8F6, 0, 0, 0, 0,0xF5D2,0xEDE9, + 0,0xD9BC, 0,0xE5C6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF5A3, 0, 0, +0xDAD4,0xE2A7,0xFBFC, 0, 0,0xF1DC, 0, 0, + 0, 0, 0, 0,0xCAF4, 0, 0, 0, +0xE8FA, 0, 0,0xCEE9, 0, 0, 0, 0, + 0, 0,0xE9F8,0xE2E5, 0, 0, 0, 0, +0xD0B9,0xD4F2, 0, 0, 0, 0, 0,0xD1A6, + 0,0xDFCE, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFCF4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD3AA, 0, 0, 0,0xCCAC, 0, 0, 0, + 0,0xEFE0, 0, 0, 0,0xE5E5,0xD0D5, 0, + 0, 0, 0, 0, 0, 0, 0,0xDBFC, + 0, 0, 0, 0,0xFCE6, 0, 0, 0, + 0, 0,0xCBFE,0xEDEA, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xDEB1, 0, 0, 0, 0, + 0, 0, 0,0xF9E3, 0, 0, 0, 0, + 0, 0,0xD4A2,0xCFF6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD6D0, 0, 0, 0, 0, + 0, 0,0xD5EA,0xF1EE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFACB, 0, + 0, 0, 0,0xE5A1, 0, 0, 0, 0, + 0, 0, 0, 0,0xD5B1, 0, 0, 0, + 0, 0,0xCFED, 0,0xEDEB, 0, 0, 0, + 0, 0,0xD5B2, 0, 0, 0,0xD5BC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFDE2,0xF3AD, 0,0xFDDB, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE9B0, 0, 0, 0, 0, 0, + 0, 0,0xD1A7, 0, 0,0xFDE3,0xCEB3, 0, + 0, 0, 0, 0, 0, 0,0xFDE4,0xFACE, + 0, 0, 0, 0,0xCAB0, 0,0xF7A7, 0, +0xCFB1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE6A2, + 0,0xFCB6,0xF2AD,0xEFE1,0xF3AE,0xDCC6,0xD9EB, 0, + 0, 0,0xE8E0, 0, 0, 0, 0, 0, + 0, 0,0xE1A8, 0, 0, 0, 0,0xD5F6, +0xCFFD, 0, 0,0xDEDD, 0, 0, 0,0xD9D1, + 0, 0, 0,0xE4EA,0xF2CF, 0,0xF7BF, 0, + 0,0xE2E6,0xE2A8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE3D6, 0, +0xEDD1, 0, 0, 0, 0, 0,0xE9F9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD6B1,0xDEB2, + 0, 0,0xE0E8, 0, 0,0xD3AB, 0,0xEBDC, + 0, 0,0xDFAF, 0,0xCAC3, 0, 0,0xEEFC, + 0,0xFDC3, 0, 0, 0,0xEBF6,0xCFB2, 0, + 0, 0, 0,0xD9EC, 0,0xD9BD, 0,0xD8DF, + 0, 0,0xD4B8,0xEBBE,0xDDEF, 0,0xDDF0,0xDDF1, +0xDDF2, 0, 0,0xD9BE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFBC6,0xCFB3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEEFD, 0, 0, 0, 0, 0, 0,0xE4AB, + 0,0xDAC5, 0,0xD8EC, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD1A8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2A9, 0, 0,0xDEBC, +0xE7B5, 0, 0, 0, 0, 0,0xDBF0, 0, +0xEFE2,0xF1F0,0xCFB4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xDBF1, 0, +0xE0B1, 0, 0, 0, 0,0xDFA5, 0,0xF9D2, + 0, 0,0xE7FD, 0, 0,0xE6A3,0xFBF1,0xCBB0, +0xF2AE, 0, 0, 0, 0, 0, 0, 0, +0xCDE7, 0,0xE8DC, 0, 0,0xE7D7, 0, 0, +0xF7C0, 0,0xD0E3, 0, 0, 0,0xDAA1, 0, + 0, 0,0xCCBD, 0, 0,0xD1A9,0xDDCC, 0, + 0,0xE3FE,0xD1AA,0xE8AA, 0,0xEAB6,0xF9FA,0xE6CC, +0xF6D8, 0, 0, 0,0xD4C7, 0, 0, 0, +0xD9CB, 0,0xD9D2,0xD3CB,0xD8F7,0xDAA9,0xF5F8, 0, + 0,0xDEDE,0xF2AF,0xF8A9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD8C8, 0, 0,0xEEC1, 0, + 0, 0, 0,0xF9C1, 0, 0, 0, 0, +0xDDF3,0xEAFA, 0,0xF6BD,0xE1BB,0xCDBF,0xF4D4,0xE6CD, + 0,0xFCCF,0xFBA2, 0,0xE0DC, 0, 0, 0, + 0,0xF4BB,0xDAD5, 0,0xF9B2, 0, 0, 0, + 0, 0, 0,0xFBF2, 0,0xDBF6, 0,0xDEDF, + 0, 0, 0,0xDBF2, 0, 0, 0, 0, + 0,0xF8DC,0xF7EE,0xEBE8, 0,0xD2FA, 0, 0, +0xF1BC, 0, 0,0xFADA, 0, 0,0xDAEA,0xDAC6, +0xF7C1, 0, 0,0xE7B6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE5C7,0xD6AC, 0, 0, 0, + 0,0xDCC7, 0, 0, 0, 0, 0,0xE1A9, + 0,0xE2AA, 0,0xD5A6, 0, 0,0xD4D7, 0, + 0, 0, 0, 0, 0,0xF2D0, 0,0xEAFB, + 0,0xE0DD,0xFBF3, 0, 0, 0, 0, 0, + 0, 0,0xF1BD, 0, 0,0xE2E7,0xFDD7, 0, +0xCEC8,0xEAB7, 0,0xFCC0, 0,0xFDE7,0xF7EF, 0, + 0,0xD7B5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEFBA,0xF1DD, 0,0xDEB3, 0, 0, 0, + 0, 0, 0,0xE8CB, 0, 0,0xF8DD, 0, + 0,0xFBC7,0xD5C8, 0,0xD7DF, 0,0xDDA9, 0, + 0, 0, 0, 0,0xE9B1, 0, 0,0xFAAD, +0xF6D9,0xFAF4, 0, 0, 0, 0, 0,0xF8AA, + 0, 0, 0, 0, 0,0xE6EE, 0,0xCCDC, +0xE1BC,0xE0EF, 0, 0,0xE9BF,0xFCFD,0xE6CE, 0, + 0,0xE1D7, 0,0xE6CF, 0,0xF4F1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE4F3, + 0, 0,0xE4FB, 0, 0,0xF9E4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEFE3, 0, 0,0xCFEE,0xF6BE,0xE0B2,0xFCFE,0xD1AB, + 0, 0, 0,0xD7FA, 0, 0, 0,0xFBC8, + 0,0xE2D7, 0, 0, 0, 0, 0, 0, +0xD4A3,0xF0F8,0xD7A8, 0, 0, 0,0xE1E7, 0, + 0,0xD3BF, 0, 0, 0, 0, 0, 0, +0xEFE4, 0,0xD7C5,0xEBE2, 0, 0,0xFCE7, 0, + 0,0xE4A2, 0,0xE2E8, 0,0xE6D0, 0,0xFBE8, +0xF4E8,0xE5F4,0xF4BC,0xF4D5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDFB6, + 0,0xFCB9,0xEEC2,0xCAF5, 0, 0, 0,0xEFE5, +0xCBE2,0xD4A4, 0,0xDEE0,0xDAFD,0xE4C6,0xE8BE, 0, + 0, 0, 0,0xE0DE,0xF6B4,0xEAD2, 0,0xF9FB, + 0, 0,0xE0C2, 0,0xCAE4, 0,0xE7B7, 0, +0xEAFD, 0,0xD9DD, 0,0xDAB4,0xEEAA,0xFBE9, 0, + 0, 0, 0,0xDBCB,0xDAB5, 0, 0, 0, + 0, 0,0xF1BE, 0, 0,0xD3AC, 0, 0, + 0, 0, 0, 0, 0, 0,0xFBC9, 0, +0xDFCF, 0, 0,0xD3C0,0xE3D7, 0,0xEFE6,0xFCD0, + 0, 0, 0, 0, 0, 0, 0,0xE9C0, + 0, 0, 0,0xF5D3, 0, 0,0xECDC,0xF7B7, + 0, 0,0xEAB8,0xD1F9, 0, 0, 0, 0, + 0, 0,0xDCC8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEAB9, 0, 0, 0, 0, 0,0xF1DE, 0, + 0, 0, 0, 0,0xD7B6,0xCFB5, 0,0xD9A8, + 0, 0,0xECEE, 0, 0,0xDDAA, 0, 0, + 0, 0,0xCDA2,0xE8AE, 0, 0, 0,0xE1BD, + 0,0xF2D1, 0, 0, 0, 0,0xE9C1, 0, + 0, 0,0xD2FC, 0, 0, 0, 0, 0, + 0, 0,0xDBB5, 0,0xF3E7,0xD8FE, 0, 0, + 0,0xFCD1, 0,0xEDB2,0xF4AF, 0,0xFBA3, 0, + 0,0xFCC1, 0,0xEEAB,0xD4A5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF4F2, + 0, 0, 0, 0,0xEED9, 0, 0, 0, +0xFBCA, 0, 0, 0, 0, 0,0xCDE3,0xD8BB, + 0,0xE5DB,0xF8F7, 0, 0, 0,0xF6D4, 0, + 0, 0, 0, 0, 0, 0, 0,0xD7A9, + 0,0xCBC9, 0, 0,0xE6D1,0xF0CC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD8AE, 0,0xF9D3,0xD5FE, 0, 0, 0, 0, + 0, 0, 0,0xD8BC,0xF2B0, 0, 0, 0, + 0,0xE2AB,0xF3E8, 0, 0, 0, 0, 0, +0xEFC2, 0, 0, 0, 0, 0, 0,0xEDEC, + 0,0xE7B8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xDAFE, 0, 0,0xCCBE, 0, 0,0xF2FC, +0xDAEB, 0,0xE2D8,0xEDD6, 0, 0,0xD6D1,0xE0B3, + 0, 0,0xFCD2, 0,0xEBC8, 0, 0, 0, + 0, 0, 0, 0, 0,0xD3C1,0xF0CD, 0, +0xCFF7, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xEDD2, 0,0xD4D8,0xDCC9,0xD7F1, 0, + 0,0xDFBB, 0, 0,0xF3A5, 0, 0, 0, +0xF4CD, 0, 0, 0, 0,0xF1BF,0xF8B1, 0, +0xE9FA, 0, 0, 0,0xFBCB, 0, 0,0xCAD5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF9D4,0xF7CA, 0, 0,0xD6C8, + 0, 0, 0, 0, 0, 0,0xFCE8,0xF3BD, + 0,0xEEFE, 0,0xE7FE, 0, 0, 0, 0, + 0,0xD3C2, 0, 0, 0, 0,0xD3B6, 0, +0xCCAD,0xF6FA,0xD6B2,0xD2D8, 0, 0, 0, 0, + 0, 0,0xE7D8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE3A5, 0, 0, + 0, 0,0xE7B9, 0, 0, 0, 0,0xF0AD, +0xFBCC,0xEBA1, 0, 0,0xD4A6, 0, 0, 0, + 0,0xFBCD, 0,0xD5BD,0xF1DF, 0, 0,0xF6FB, + 0,0xDEB4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD5EB, 0, + 0,0xE5C8, 0, 0, 0,0xFBA4,0xD4B9, 0, + 0,0xDEE1, 0,0xE4A3, 0, 0, 0,0xD7B7, + 0,0xF8EE, 0, 0, 0,0xDEB5, 0, 0, +0xD6D2, 0,0xF9D5,0xE7BA,0xEBD5,0xD5F7,0xEFE7,0xE1BE, + 0, 0, 0,0xFAAE, 0, 0, 0,0xD6E9, +0xD6EE, 0, 0, 0, 0, 0, 0,0xE7BB, + 0, 0, 0, 0, 0, 0, 0,0xECCB, + 0, 0, 0, 0, 0, 0,0xD5B3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCEB4, 0, 0, 0, +0xFBA5,0xE1EE, 0, 0, 0, 0, 0, 0, +0xF7A8, 0, 0, 0, 0,0xFBCE, 0, 0, + 0, 0, 0,0xD8BD, 0, 0, 0, 0, + 0, 0, 0,0xFBFD, 0, 0, 0, 0, +0xFCE9, 0, 0, 0, 0, 0, 0, 0, +0xCFB6, 0, 0, 0,0xEDC7,0xEEAC, 0, 0, + 0, 0, 0, 0, 0,0xCCDD, 0, 0, + 0, 0,0xF6A7, 0, 0, 0,0xE6FA, 0, + 0, 0,0xF5A4, 0, 0, 0, 0, 0, +0xFDDC,0xEDB3,0xCEC9, 0, 0, 0, 0, 0, + 0,0xEFE8, 0, 0,0xE1BF, 0, 0, 0, + 0, 0, 0,0xFADB,0xCBE3,0xF7A9, 0,0xFBA6, + 0, 0, 0,0xDCB9, 0, 0, 0,0xF1C0, +0xEDC8,0xEFC3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD6AD, 0, 0,0xFDCE, 0, 0, 0,0xE8A1, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFBF4,0xD5A7, 0, 0, 0,0xF1F6, 0,0xE6D3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCCDE, 0, 0, 0, 0, 0, 0, + 0,0xF8B2, 0, 0, 0,0xDCEB, 0, 0, + 0, 0, 0, 0,0xFDB6, 0, 0, 0, + 0,0xE5EA, 0, 0,0xF1E0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xDBCC,0xDDCD, 0, 0, 0,0xD4C8, 0, + 0,0xD9ED, 0, 0, 0, 0,0xF5A5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE6FB, 0, 0, 0, 0, 0,0xE6D4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFDC8, + 0,0xD6A1,0xFDBF, 0,0xFCD3, 0,0xEFA1, 0, +0xE7BC, 0, 0, 0, 0, 0,0xD1EE, 0, + 0,0xE6D5, 0, 0,0xE9F2, 0,0xDFB0, 0, + 0, 0, 0, 0,0xD8E0,0xFCBA,0xFDAF,0xF0CE, + 0,0xDBE1, 0, 0,0xE5C9, 0,0xEDB4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE0C3, 0, 0, + 0, 0, 0, 0,0xE3D8, 0, 0, 0, + 0,0xE9FB,0xEAA8, 0, 0, 0, 0,0xFDB7, + 0, 0,0xFBA7, 0,0xE9C2, 0, 0, 0, + 0,0xFDF7, 0, 0, 0, 0, 0,0xE2D9, + 0, 0,0xDCEC, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE8A2, 0, 0, 0, + 0,0xE6F0, 0, 0, 0, 0, 0, 0, + 0,0xFDF8,0xFDF9, 0, 0, 0,0xF6BF, 0, + 0,0xE7A7, 0,0xE6D7, 0, 0, 0, 0, +0xD4F3,0xD4C9, 0, 0, 0, 0,0xD6FA, 0, +0xD7F2, 0,0xE1C0, 0,0xDBE2,0xE6D8, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7BD, + 0, 0, 0, 0, 0,0xF0CF,0xF3BE,0xE2AC, + 0, 0, 0, 0, 0,0xF5B7,0xE0F0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFDB8,0xE3E8, 0,0xD4A7,0xE8FC, +0xFAD2, 0, 0, 0, 0, 0,0xF8EF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD6D3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD5B4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF0D0, 0,0xF7F0,0xEEB3, 0, 0, +0xEABA, 0,0xEAD3, 0, 0,0xEDC9,0xDDAB, 0, + 0, 0,0xE5AC,0xFDA1, 0,0xDFD0,0xECB3, 0, +0xDFD1, 0, 0, 0, 0, 0,0xEDED,0xF8B8, +0xF7FA, 0, 0, 0,0xF8AB, 0, 0, 0, + 0, 0,0xF4E0, 0, 0, 0, 0, 0, +0xD4BA,0xE4B3, 0,0xE9DA, 0,0xDEB6, 0,0xD9BF, + 0,0xD9C0,0xD6EF, 0, 0, 0, 0,0xD9CC, + 0,0xDAAA, 0, 0, 0, 0, 0, 0, + 0, 0,0xDFE5, 0, 0, 0, 0, 0, + 0,0xF7E5, 0, 0, 0,0xCCB2, 0, 0, +0xDFF9,0xD7E0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD4BB, 0, 0, 0, 0,0xFDFA, + 0, 0, 0, 0,0xCCB3, 0, 0,0xDBF3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xDFD2, 0,0xCECA, 0,0xEEDA, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE4E4, 0, +0xFBCF, 0, 0, 0, 0, 0, 0,0xCFB7, + 0,0xEEC3, 0, 0, 0, 0, 0, 0, + 0,0xCEEA, 0, 0, 0, 0, 0, 0, + 0,0xE2AD, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD7E1,0xFAF5, 0, 0,0xD5C9,0xF8AC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE7D9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF3E9, 0, + 0, 0, 0,0xD8ED,0xE3C4,0xF0F1, 0, 0, + 0, 0, 0, 0, 0,0xE8E5, 0, 0, + 0,0xE0FA,0xEEC4,0xD9DE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xEBA2,0xEBA3, + 0, 0, 0, 0, 0, 0,0xFCC2,0xEABB, + 0, 0, 0, 0,0xE8AB,0xDEE2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEDEF, 0,0xE8A3, 0, 0, 0, 0,0xCFF1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD4BC, 0,0xFCEA, 0, 0, 0, 0, 0, +0xE7BE, 0,0xFCF2, 0, 0,0xD6B4, 0, 0, +0xE2AE, 0,0xD3B7,0xFACC, 0, 0, 0, 0, + 0, 0, 0, 0,0xFADC, 0,0xEDB5,0xE1E3, + 0,0xE8AC, 0,0xE8DD, 0, 0,0xEFE9, 0, + 0, 0, 0, 0,0xF4BD, 0,0xCFB8,0xE9DB, +0xD1AC, 0, 0, 0, 0, 0, 0,0xDAC7, + 0, 0, 0, 0, 0, 0, 0,0xEBC9, + 0,0xE8CC, 0, 0, 0,0xDEB7, 0, 0, + 0, 0,0xD6BC,0xD3E5, 0, 0, 0, 0, + 0,0xFADD, 0, 0, 0, 0, 0, 0, +0xDAD6, 0,0xCAB1, 0, 0, 0, 0, 0, + 0,0xDAC8,0xDFA6, 0,0xF9B3,0xF2D2, 0,0xCAC4, + 0, 0, 0, 0, 0, 0,0xCECB, 0, + 0,0xCDF5, 0, 0, 0,0xFDB0,0xD5A8, 0, +0xF1C1, 0, 0,0xE2E9,0xDCCA,0xECB4,0xFAC0, 0, + 0,0xFBA8,0xD0A8, 0, 0,0xDAEC, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9EE, + 0,0xE0FB, 0, 0, 0,0xEFEA,0xFADE, 0, + 0,0xE0C4, 0,0xCFB9, 0,0xD5CA,0xD7E2,0xE2AF, + 0,0xD7B8, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE8CD, 0, 0, 0, 0, + 0, 0, 0,0xF6DA, 0, 0, 0, 0, +0xEFA2,0xE2DA,0xF6FC, 0, 0,0xFBD0,0xD1AD, 0, +0xCDE4, 0,0xD1AE,0xDCED,0xE8CE, 0,0xF0F9,0xCEB5, +0xE6FC, 0, 0,0xD7FB,0xD0D6,0xDDF5,0xF7F1, 0, +0xF6FD, 0,0xDBF7, 0, 0, 0, 0,0xFBEA, +0xE9DC,0xD9C1, 0,0xF5F2,0xE0C5, 0, 0, 0, + 0, 0, 0,0xEAD4, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF9C2, 0,0xEABC, + 0,0xD2C5,0xFBD1,0xE7C0,0xEBA5, 0,0xDFFA,0xE3A2, +0xD7B9, 0,0xE9C3, 0,0xE8FD,0xE8AF, 0, 0, +0xF2D3,0xFBA9,0xD8A5, 0, 0, 0, 0,0xD5CB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD0C8, 0, + 0, 0,0xD1AF,0xD7E3, 0, 0, 0,0xE0C6, + 0,0xD6A2, 0,0xEDF0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD7F3, 0, 0, 0,0xFCD4, 0,0xDAD7,0xCCDF, + 0,0xF2D4, 0,0xD1B0, 0,0xCCE0, 0,0xDBFD, +0xF3BF, 0,0xF0D1, 0, 0, 0, 0, 0, +0xFCBB, 0,0xE2B0, 0, 0,0xE6A5, 0, 0, + 0,0xE2DB, 0, 0, 0,0xDFDE, 0,0xE0C7, + 0, 0, 0, 0, 0, 0,0xF2EF, 0, + 0, 0,0xCCE1, 0, 0, 0, 0,0xD6EA, + 0, 0, 0, 0,0xE7C2, 0, 0, 0, +0xCEB6, 0,0xF3C0, 0,0xCDFE, 0, 0, 0, +0xFBD2, 0,0xF8F8,0xF7FB, 0, 0,0xE8BF, 0, + 0, 0, 0, 0, 0, 0,0xE8B7, 0, + 0, 0, 0, 0, 0, 0, 0,0xEDB6, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xDCBA, 0, 0,0xCCB4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF1F7, 0, 0, 0,0xE8B8, 0, 0, +0xCAF6, 0,0xE4A4,0xF4D6, 0, 0, 0,0xDFE6, + 0, 0, 0,0xDFA7, 0,0xDFE7,0xE1C1, 0, +0xE9C4, 0, 0,0xDCCB,0xE9C5, 0, 0, 0, +0xEFA3,0xEBA6,0xCBA3,0xE3E9, 0, 0, 0,0xD1FB, +0xEFA4, 0,0xEFEB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD0B4, + 0, 0, 0, 0,0xCDA3, 0, 0,0xE8E6, + 0,0xEFA5, 0,0xD3CC,0xDAED, 0, 0, 0, + 0,0xD7BA, 0,0xF2D5,0xF5E5,0xD9EF, 0, 0, + 0, 0,0xF9B4, 0, 0,0xD5D4,0xFDCF, 0, + 0, 0,0xDBE3, 0, 0, 0, 0,0xF1E1, +0xECB6, 0, 0, 0, 0,0xFBFE,0xD3D7, 0, +0xD1B1, 0,0xCBB1, 0, 0, 0, 0,0xD1B2, + 0, 0, 0, 0, 0, 0,0xCBB2,0xF1C2, + 0, 0,0xF4E1,0xF9B5, 0, 0,0xE1C3,0xE1C2, + 0,0xEBF7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xDFA8, 0, 0, + 0, 0, 0, 0, 0,0xCBCA, 0, 0, + 0, 0, 0,0xE6B9, 0, 0, 0, 0, + 0,0xF8DE,0xF9AA,0xCAF7, 0,0xEDB7, 0, 0, +0xD3B8,0xF2D6, 0, 0,0xD4D9,0xEEC5,0xF2F0, 0, + 0, 0,0xCAB2, 0, 0,0xDCBB, 0,0xF1F8, + 0, 0, 0, 0, 0,0xECB7, 0, 0, + 0, 0,0xE5CA, 0,0xF6C0,0xFDDD, 0, 0, +0xD4E3,0xCCE2, 0,0xF7D4, 0, 0, 0, 0, + 0, 0,0xD7E5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD3C3, 0,0xD8A6, 0,0xF6C1, 0, 0, 0, + 0, 0,0xDDF6, 0,0xCDC0, 0, 0, 0, +0xE5DC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE5CB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE1C4, 0, 0, 0, 0, 0,0xE8B0, +0xF4B0,0xF3EA,0xDAEE, 0,0xD7BB, 0,0xE2B1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD7AA, 0, 0, 0, 0, + 0, 0,0xD6FB, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE4DF, 0,0xCAD6, 0, + 0, 0,0xEBA8, 0, 0, 0,0xDBFE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF6C2, 0, 0,0xEFBB, 0, 0, 0, + 0,0xD4FD, 0, 0,0xE0C8, 0, 0, 0, +0xE8B9, 0,0xEFA6, 0, 0, 0, 0, 0, +0xCDA4, 0, 0,0xD4F4,0xDBA1,0xDBDC,0xDBDD, 0, + 0, 0, 0, 0,0xEEDC, 0,0xCBCB,0xFCD5, + 0, 0, 0, 0, 0, 0,0xCEEB, 0, +0xCDC1, 0, 0,0xFBD3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF9AB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF5D4, 0, 0, 0, 0,0xD9A9, + 0, 0,0xE9DD,0xDBCD, 0, 0,0xDDCE, 0, +0xE7C3, 0,0xECCC, 0, 0, 0, 0, 0, + 0, 0,0xF9EC, 0, 0, 0,0xCBCC, 0, + 0, 0, 0,0xE0FC,0xD4A8, 0,0xEDD3,0xD8EF, + 0,0xF2D7, 0,0xCAF8,0xDAEF, 0, 0,0xD6D4, + 0, 0, 0, 0, 0, 0,0xD9CD, 0, + 0, 0,0xD8EE, 0,0xF2C1, 0, 0, 0, +0xDFD3, 0, 0, 0,0xDAF0, 0,0xE2EA, 0, + 0,0xE0FD, 0, 0,0xD8F8, 0, 0, 0, +0xF7AF,0xDAB6, 0,0xCAD7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF2D8, 0, +0xD8F9, 0, 0, 0, 0, 0, 0, 0, + 0,0xFADF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCFEF, +0xD9C2, 0,0xF0D2, 0,0xE4D1, 0, 0, 0, +0xF3B7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFAE0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xEFEC, 0, 0, 0, 0, + 0,0xE2B2, 0,0xD4BD, 0, 0,0xD9CE, 0, + 0, 0, 0,0xF4E2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xD4A9, 0, 0, 0, 0,0xCDC2,0xE7DA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF2D9, 0, 0, 0, 0, + 0,0xD9AA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD8BE, 0, + 0, 0, 0, 0, 0,0xDCAD, 0, 0, + 0, 0, 0, 0,0xE2EB,0xD6FC, 0, 0, +0xCAF9, 0, 0,0xD4DA, 0, 0, 0, 0, + 0, 0, 0,0xF4D7,0xCCA1, 0, 0,0xCFBA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF5B8, + 0, 0, 0,0xD9C3,0xD0E8, 0, 0, 0, + 0, 0,0xE3C5,0xEBF8, 0,0xF2B1, 0, 0, + 0,0xCFBB, 0, 0, 0,0xD3AD,0xE8E1,0xCEEC, + 0, 0, 0,0xE0B4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDEE3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDDF7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF2B2,0xF3F6,0xF6DB, + 0, 0, 0, 0,0xD7FE, 0, 0, 0, + 0, 0,0xF8DF, 0,0xF7F2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD0A9, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE6DA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF5A6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD7BC,0xCCE3, 0, 0,0xE6DB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDDDD, 0, 0, 0, + 0,0xD1B3, 0, 0, 0, 0, 0,0xEFED, + 0, 0, 0, 0,0xD6DE,0xE4F4,0xE1EF, 0, + 0,0xDDF8, 0, 0, 0, 0, 0,0xE8CF, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCAE5, 0, 0, 0,0xDCA1, + 0,0xE0B5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFCAC,0xFCAD,0xD8A7, 0, 0, 0, + 0,0xEDB8, 0, 0, 0,0xDBB6, 0, 0, + 0, 0,0xD6F0,0xF3AF, 0, 0,0xCDA5, 0, +0xDAF1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD8A8, 0, 0, 0,0xCCE4, 0, 0,0xD1B4, + 0, 0, 0, 0, 0,0xCAD8, 0, 0, + 0, 0, 0,0xDAF2, 0, 0, 0, 0, + 0,0xF5A7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF5A8, 0, + 0, 0, 0, 0, 0, 0,0xE6A6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD5EC,0xD5F8,0xDAF3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE3C6, 0, 0, 0,0xDEE4, 0, +0xDEE5,0xD1B5, 0, 0, 0, 0, 0,0xD1B6, +0xD1B7,0xF2B3, 0, 0, 0, 0, 0, 0, +0xE9DE, 0, 0, 0, 0, 0,0xF0D3,0xF2B4, + 0, 0,0xF0D4,0xCBE4,0xFBD4,0xF5E6,0xE3EA, 0, +0xDEE6, 0, 0, 0, 0,0xDFD4, 0, 0, +0xF8F9, 0, 0, 0, 0,0xF0AE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD1B8, 0, 0, 0, 0,0xD6DF, + 0,0xD0D7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFCA1,0xEFEE,0xDCD8, + 0,0xE9DF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE5DD,0xFDFB, + 0, 0,0xE0C9, 0, 0, 0,0xD6C9, 0, + 0,0xD4AA, 0,0xE5CC, 0, 0, 0, 0, + 0,0xE9E0, 0, 0, 0,0xD0D8,0xFCA2,0xD4BE, +0xE2B3,0xDEE7, 0, 0, 0, 0, 0, 0, + 0,0xDCBC,0xD2B6,0xF5D5, 0, 0, 0, 0, + 0,0xCEA1,0xF5A9, 0, 0,0xDDF9, 0, 0, +0xDDFA, 0, 0, 0, 0, 0, 0,0xF0D5, + 0, 0, 0, 0,0xF6DF, 0,0xF2DA,0xE4EB, + 0,0xF2F1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xECB9, 0, 0, 0, 0, +0xFDFC, 0, 0, 0, 0,0xE1AA, 0, 0, +0xCAD9, 0, 0,0xEFEF, 0,0xF5AA, 0, 0, + 0, 0, 0, 0,0xECF9, 0, 0,0xF8AD, + 0,0xF2C2,0xF6C3, 0,0xD7D2, 0, 0,0xF9A2, +0xF0D6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF0FA, 0, + 0,0xF6E0, 0, 0, 0, 0,0xE9F3,0xF2C3, + 0, 0, 0,0xD4AB,0xCAB3,0xCDA6, 0,0xCDC3, +0xCDDA, 0, 0, 0, 0, 0,0xD9CF, 0, + 0,0xF6C4, 0, 0, 0,0xEEDD,0xE7C4, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2B4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xDFE2,0xE7DB, 0, 0, 0, 0, 0, + 0,0xE8B1, 0,0xFCAE, 0, 0, 0, 0, +0xE5CD, 0, 0, 0,0xFAEB, 0,0xCFBC, 0, + 0,0xCFE2,0xCDF6, 0, 0,0xEFF0, 0,0xF4BE, + 0,0xD4CD, 0, 0,0xF3B8, 0, 0, 0, +0xE9A1, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF2F2,0xF3EB, 0,0xF0D7, 0, 0, +0xCFD7, 0, 0, 0, 0, 0, 0,0xCFDF, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE8C0,0xE8C1, 0, 0, 0,0xCFE3,0xE9A2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD0AA, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF3C1,0xD0AB, 0,0xD4E4, + 0, 0,0xEFBC,0xD8A1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9DF, + 0,0xF3D7, 0, 0, 0,0xDCBD, 0,0xCCE5, +0xEDF1, 0, 0,0xF1E2, 0,0xD4DB, 0, 0, + 0, 0,0xE2B5, 0, 0,0xCAE6, 0,0xD3AE, + 0, 0, 0, 0, 0, 0,0xCCE6, 0, + 0,0xF1D3,0xF5E7, 0, 0, 0, 0,0xCADA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFBEE, + 0,0xE1C5, 0, 0, 0, 0, 0, 0, + 0,0xDFE9, 0,0xEEDE, 0, 0,0xF7C2, 0, +0xD8A2, 0, 0, 0, 0, 0,0xDDAC, 0, + 0, 0, 0, 0,0xF0AF,0xD6BD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE1AB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF9B6, 0, + 0,0xD4F5, 0,0xD0C9,0xEFA7,0xE2EC, 0,0xDBEA, +0xCECC,0xF5E8,0xF7D5, 0,0xD3CD, 0,0xF3FE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD0B5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE0FE, 0,0xDFFB, 0, + 0, 0, 0, 0, 0,0xE6DD, 0, 0, + 0, 0, 0, 0, 0,0xE8A4, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCBCD, + 0, 0, 0,0xEFA8, 0, 0, 0,0xEEB4, + 0, 0, 0, 0,0xDAD8,0xD1B9, 0,0xDFA9, + 0, 0,0xF3B0, 0, 0,0xCCC4, 0, 0, + 0,0xCEB7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xEFA9, 0, 0, + 0,0xDFD5, 0, 0,0xEDD7, 0, 0, 0, +0xEEC6, 0, 0, 0, 0, 0, 0, 0, +0xEFBD,0xFCD6, 0, 0,0xDBF4, 0,0xEFAA,0xF8B9, + 0,0xF5E9, 0, 0, 0, 0, 0, 0, + 0, 0,0xE3D9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE1C6, 0, 0, 0,0xD4BF, 0, 0, 0, + 0,0xDEE8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF0EA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF3C2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD3AF, 0, + 0,0xCADB, 0, 0, 0, 0, 0,0xFCD7, + 0, 0,0xEDD8,0xE1C7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF4D8,0xD6B3,0xDDAD, + 0, 0, 0,0xD5BE, 0, 0, 0, 0, + 0, 0, 0, 0,0xF1C3,0xEEDF, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD6EB, 0, 0, 0,0xF4D9, 0, 0, 0, + 0, 0, 0, 0,0xD7E6, 0, 0, 0, + 0, 0, 0,0xDAB7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xDDFB, 0, 0, 0, 0, + 0,0xDDCF, 0, 0, 0, 0, 0, 0, + 0, 0,0xD8A3, 0, 0,0xDAD9, 0,0xF0D8, +0xEFC4, 0, 0, 0, 0, 0, 0,0xE1D8, + 0, 0, 0, 0, 0,0xF1D4, 0,0xEDF2, + 0, 0, 0, 0, 0, 0,0xD5DB, 0, + 0,0xD5DC,0xF3C4,0xCBD7, 0, 0, 0, 0, + 0,0xE2B6, 0, 0, 0, 0,0xEFF1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xFBD5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD3D8, 0, + 0, 0, 0, 0, 0, 0,0xDDD0,0xF0D9, +0xCBB3, 0, 0, 0, 0, 0, 0,0xD5DD, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCDA7, 0, 0,0xD0AC, 0, +0xD1BA, 0,0xF1C4, 0,0xE5B3,0xFBF5,0xE9E1,0xFDE0, +0xFCBC, 0,0xDAA2,0xDAA3, 0,0xD2A1, 0, 0, +0xD2EF, 0, 0, 0,0xE2ED, 0, 0,0xDEE9, +0xCEDC,0xF2B5,0xD0E4,0xDDD1, 0, 0, 0, 0, +0xE1C8,0xDBB7,0xDFE3, 0, 0, 0, 0, 0, + 0, 0, 0,0xEDB9,0xF1C5, 0,0xF3CF,0xD7AB, +0xE1AC, 0, 0,0xE3EB, 0,0xEEC7, 0, 0, + 0,0xE1C9,0xCAFA, 0, 0, 0, 0, 0, + 0, 0,0xF0FB,0xFAE1,0xF0DA,0xCCE7,0xDAF4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCCBF, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCEED, 0, + 0,0xD5A9,0xFAE2, 0, 0, 0,0xD0E5, 0, +0xEBD6, 0,0xECDF, 0, 0, 0,0xDFFC, 0, + 0,0xF7D6,0xDEEA,0xCBB4, 0, 0,0xEFBE, 0, + 0,0xCCB5, 0, 0, 0, 0, 0,0xCFBD, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xEFF2,0xE2B7, + 0, 0, 0,0xCCE8, 0, 0, 0, 0, + 0, 0, 0, 0,0xF0FC, 0, 0, 0, +0xD6E0, 0,0xF1C6, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2B8,0xEBAB, 0, 0, + 0,0xCBB5,0xD8D1, 0,0xF4CE,0xF3F7, 0, 0, +0xD7C6, 0,0xD1BB,0xF7AA, 0,0xEDCA,0xD7D3,0xD8FA, + 0, 0, 0, 0, 0, 0, 0,0xF6C5, + 0, 0,0xD1CC,0xDDFC, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xDFFD, 0, +0xF9E5, 0,0xE0CA, 0, 0,0xF2FD,0xD3B0, 0, +0xF4F3,0xDAC9, 0,0xE6DE, 0, 0, 0, 0, +0xF8BA,0xE8D0, 0, 0,0xD8FB, 0, 0,0xEAD5, + 0, 0, 0, 0,0xD6A3, 0, 0, 0, + 0, 0, 0,0xF6C6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF2DB,0xE4FC, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE8B2, 0, 0, + 0, 0, 0,0xDADA, 0,0xF2DC,0xFBD6,0xE9B2, + 0,0xEEAD, 0,0xFAE3, 0, 0, 0, 0, + 0, 0, 0,0xDCEE, 0, 0,0xF5EA,0xE6E0, + 0,0xF0FD, 0, 0, 0, 0, 0,0xD7AC, + 0, 0, 0, 0, 0,0xF5C5,0xEEE0, 0, + 0,0xDBE5, 0,0xDDDE, 0, 0,0xD9F0,0xE9A3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF1F9, 0,0xF2C4,0xE0CB, 0, 0, + 0, 0, 0, 0, 0, 0,0xE9A4, 0, + 0,0xE2B9, 0, 0, 0, 0, 0, 0, + 0,0xE3B1,0xFCEB,0xCDA8, 0,0xCCB6, 0, 0, +0xF0DB, 0, 0, 0, 0, 0, 0, 0, + 0,0xE6BA, 0, 0,0xCDA9, 0, 0, 0, + 0, 0,0xF3C3, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE1D9, 0, 0,0xEFAB, + 0, 0, 0,0xE7C5, 0, 0,0xE0E9, 0, +0xF3C5, 0, 0,0xD4C0,0xD5BF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xDDAE, 0, +0xF9FC, 0,0xCCC0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE5A2, 0, 0, 0, +0xCEB8, 0, 0, 0,0xD8D2,0xF9D6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF1AA,0xCED1, 0, 0,0xF6C7, 0, +0xDBEB, 0,0xDFFE, 0, 0,0xD8E1, 0,0xF7F3, + 0,0xD7E7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD4FE, 0, 0, +0xD1BC, 0,0xE5CF, 0,0xCBB6, 0,0xDAB8, 0, + 0, 0, 0, 0,0xCDC4, 0, 0, 0, + 0, 0,0xD6BE, 0, 0, 0,0xE2BA, 0, + 0, 0, 0, 0,0xCFD8, 0, 0, 0, +0xE0CC,0xEBF9, 0, 0, 0, 0, 0, 0, + 0, 0,0xFDFD, 0, 0, 0, 0, 0, +0xD7E8,0xCBD8, 0, 0, 0,0xE9E2, 0, 0, + 0,0xE8BA, 0, 0, 0,0xE3C7, 0, 0, + 0, 0,0xECCD, 0,0xECCE, 0,0xD6BF, 0, + 0, 0,0xE3A7, 0,0xDFD6,0xFDE8, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEEE1, +0xF6A8,0xDDFD, 0, 0, 0, 0, 0, 0, + 0,0xF8BB, 0,0xE8D1, 0, 0, 0, 0, +0xF9D7, 0, 0, 0, 0, 0, 0, 0, + 0,0xCEEE, 0, 0,0xECCF, 0, 0, 0, +0xE9A5,0xD6D5, 0,0xCDC5, 0,0xEDBA,0xD1BD, 0, + 0,0xCFBE, 0, 0,0xECBB, 0, 0, 0, +0xD2B1, 0, 0, 0, 0,0xCCE9, 0,0xD9C4, +0xE9FC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD1BE, 0, 0, + 0, 0, 0,0xECBC, 0, 0,0xE5AD, 0, + 0, 0, 0, 0, 0,0xF7B0, 0,0xCCEA, + 0, 0, 0,0xD3C4, 0, 0,0xD6C0, 0, + 0, 0,0xD6FD, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE1A1, 0, +0xDEBD, 0,0xF6A9, 0, 0, 0,0xDAA4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD6A4, +0xF5C6, 0,0xE1A2,0xE9C6, 0, 0, 0,0xF2C5, + 0, 0, 0, 0, 0,0xF4E9,0xD6EC,0xEBD3, + 0, 0, 0, 0,0xECBD,0xE2DC,0xDEEB,0xF0DC, + 0,0xEBBF, 0,0xD7CE,0xD1BF, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF5AB, 0, + 0, 0, 0,0xF9FD, 0,0xCADC, 0, 0, + 0,0xCDC6,0xF2B6, 0, 0,0xDDFE, 0, 0, + 0,0xCCB7,0xDBB8, 0, 0, 0, 0,0xD0E9, + 0,0xCEDD,0xEBC0, 0,0xFDA2, 0, 0, 0, + 0, 0,0xF8CB, 0, 0, 0, 0, 0, + 0, 0, 0,0xEAD6,0xF1B0, 0, 0, 0, + 0, 0, 0, 0,0xDBCE, 0,0xF7C3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDBCF,0xCBA4, 0, 0,0xF8E0, 0, + 0,0xFBD7, 0, 0,0xEBCA,0xE0A1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCECD, 0, 0,0xD4DC, 0, 0, 0, +0xFDD8, 0, 0, 0, 0,0xD2F6, 0, 0, + 0, 0,0xF2B7, 0, 0,0xFAF6,0xF6AA,0xFAF7, +0xD8E6, 0,0xF4B1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE8D2, 0,0xCAC5,0xCCEB, 0, 0, 0, 0, + 0, 0, 0,0xE2EE, 0, 0, 0, 0, + 0,0xE2BB, 0,0xF7AD, 0, 0, 0,0xF8E1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF3EC, 0, 0, 0, 0,0xDEA1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4FD, 0, 0,0xE3EC, 0, +0xDDAF,0xDDB0, 0, 0,0xCBB7,0xE8D3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE1A3,0xD2E0, 0, + 0, 0, 0,0xF0FE, 0, 0, 0, 0, +0xE9A6,0xCBF2, 0, 0, 0, 0, 0, 0, +0xEDF3,0xDCD9,0xE0CD, 0, 0, 0, 0,0xF7DA, +0xDBB9, 0, 0, 0, 0, 0, 0, 0, +0xCCAE, 0,0xDADB, 0, 0, 0, 0,0xCDC7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDDB1, 0,0xD8AF,0xE3A3, 0, 0, +0xCEEF, 0, 0,0xF2F3, 0, 0, 0, 0, +0xF8B3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE0CE, 0,0xF5FD, 0, 0, + 0, 0,0xEBEC, 0, 0,0xD3C5,0xFCEC,0xD2DB, +0xD4EB, 0,0xDEA2, 0, 0, 0,0xE5E6, 0, + 0, 0, 0, 0, 0,0xF0B0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD5C4, 0, 0, 0, 0, 0, 0,0xEDF4, + 0, 0, 0,0xE3ED, 0,0xE8C2, 0,0xEDF5, +0xD7FC, 0,0xEDBB, 0, 0,0xF6AB, 0, 0, + 0, 0, 0,0xF2B8,0xF6C8, 0, 0, 0, + 0, 0,0xD3E6,0xF2DD,0xCFBF, 0,0xEBAC, 0, + 0, 0, 0, 0, 0,0xCFC0, 0,0xE6A8, +0xFDE9, 0,0xCFC1, 0,0xE0DF,0xDEEC, 0, 0, + 0, 0,0xE0A2, 0, 0, 0, 0, 0, + 0, 0, 0,0xF4BF,0xE2EF, 0,0xD9F1,0xF1C7, + 0,0xCBB8, 0, 0, 0, 0, 0, 0, + 0, 0,0xF9FE,0xDBBA,0xDAF5, 0, 0, 0, + 0, 0, 0, 0, 0,0xF6EC,0xDADC,0xFAE4, + 0,0xE0CF, 0, 0, 0, 0, 0, 0, +0xDDB2, 0, 0, 0, 0,0xE6A9, 0,0xEFF3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF3ED, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xEBFA, 0,0xF9E6, 0, + 0, 0, 0, 0, 0, 0,0xCADD,0xD5DE, + 0,0xCADE,0xDFE4, 0, 0, 0,0xE6FD, 0, +0xF5AC, 0, 0, 0, 0, 0,0xE4F5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE9E3, 0,0xEDCB,0xCFE4, 0, + 0, 0,0xD8D3, 0, 0, 0, 0, 0, + 0,0xDDB3,0xD4EC, 0, 0,0xF2B9, 0,0xDFB7, + 0, 0, 0, 0, 0,0xCBCE,0xFBD8, 0, + 0,0xD0D9, 0, 0,0xDDD2,0xF7F4,0xE7DC,0xE4A5, + 0,0xFCA3, 0,0xDBBB, 0, 0, 0,0xF2BA, +0xE9FD,0xD0CA, 0,0xF5D6,0xD9C5,0xE4B4, 0,0xEDA7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEABD,0xE6FE, 0,0xF7C4,0xF5AD, 0,0xD9E0, + 0, 0, 0,0xCAB4, 0, 0,0xF8E2,0xCFC2, + 0,0xECBE, 0, 0, 0,0xE5B4,0xCDC8,0xEEC8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE7C8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xCDC9,0xF9B7, 0, + 0,0xF1E8,0xD9F2,0xDBF5,0xCAB5,0xD9C6, 0, 0, + 0,0xD8C9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9AB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEDBC, 0, 0,0xD8D4, 0, 0, 0,0xDCDA, + 0,0xE2BC, 0, 0,0xFCED,0xECE0,0xD2FE, 0, +0xE9C7,0xE6AA, 0, 0, 0, 0, 0, 0, +0xE2F0, 0, 0, 0, 0, 0, 0,0xFABB, + 0,0xF5AE,0xFBAA, 0, 0, 0, 0,0xECFB, + 0,0xECBF,0xFCD8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD4E5, 0, 0, 0,0xF9C3, + 0, 0, 0,0xEEE2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xD7E9,0xEDF6, 0, 0, 0,0xDEED, 0, + 0, 0, 0, 0, 0, 0,0xCCEC, 0, +0xE3EE, 0, 0, 0, 0, 0,0xE8D4, 0, + 0, 0,0xFAF8, 0, 0, 0, 0, 0, + 0,0xDDB4,0xE4B5,0xD8B0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD8D5, 0, 0, + 0,0xF4EA, 0, 0, 0,0xCEB9, 0, 0, + 0,0xD6E1,0xCFD2, 0,0xD0B6, 0, 0, 0, + 0, 0, 0,0xCEA2, 0, 0,0xF3EE, 0, + 0, 0, 0, 0,0xF3F8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xDCCC, 0,0xD0CB, 0, 0, 0,0xFCA4, +0xCDCA,0xD7D4,0xDEA3, 0,0xE4E0, 0, 0, 0, + 0,0xEEC9, 0, 0, 0,0xE2DD, 0, 0, + 0, 0, 0,0xF5FE,0xD4AC, 0, 0, 0, + 0, 0,0xD5D1, 0,0xD8F0,0xF8C3,0xEAD7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF5D7, 0, 0,0xD8BF, 0, 0, 0, + 0,0xFDC0, 0, 0, 0, 0, 0, 0, +0xEBAD, 0, 0, 0, 0,0xD5AA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE7A8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEECA, + 0, 0, 0,0xCAE7, 0, 0, 0, 0, + 0,0xF8E3, 0,0xD4DD, 0, 0,0xEAD8, 0, + 0, 0, 0,0xFBD9,0xEDF7, 0, 0,0xE5B5, + 0, 0, 0, 0, 0,0xD0AD, 0, 0, + 0, 0,0xF1F1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE2BD, 0, 0, 0,0xE3C8, 0, 0, 0, + 0,0xD9D5, 0, 0,0xDFAA, 0, 0, 0, + 0,0xDBBC, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF8E4, 0, 0, 0, 0, 0, +0xF1FA, 0, 0,0xE5B6,0xF3EF, 0, 0,0xFBDA, +0xE1E0, 0,0xD9AC, 0,0xF5EB, 0,0xE0B6, 0, + 0,0xE9C8, 0,0xCBCF, 0,0xE3C9, 0, 0, + 0,0xDEEE, 0, 0, 0, 0, 0, 0, + 0, 0,0xE2BE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDCEF, 0,0xD6A5, 0, + 0, 0, 0, 0,0xE2F1, 0, 0, 0, + 0, 0, 0, 0,0xD6FE, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xD9A1, 0,0xD8C0,0xDCDB, 0, 0,0xEDBD, +0xDFB8, 0,0xEAA5, 0, 0, 0,0xD7AD, 0, + 0,0xF3F9, 0,0xEDF8, 0,0xF5C7, 0, 0, + 0, 0, 0, 0,0xE1CA,0xEBE3, 0,0xF2DE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF8CC, 0,0xEAD9, + 0,0xD3C6, 0,0xDBE6, 0, 0, 0, 0, + 0,0xF5AF, 0, 0, 0, 0,0xCEF0, 0, + 0, 0, 0,0xE9FE, 0, 0, 0, 0, + 0,0xFBB6, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE2F2, 0, 0, 0, 0, +0xCFF2,0xF7B9,0xD9F3, 0, 0,0xE1CB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDADD, 0, 0,0xDAB9, + 0, 0, 0, 0, 0, 0, 0,0xEBFB, + 0,0xCBB9, 0, 0,0xEDF9, 0, 0, 0, + 0, 0, 0,0xE0E0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF4C0, 0, +0xFDBC,0xDFB1,0xE3EF, 0, 0, 0, 0,0xE0A3, +0xFDB9, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF0B1, 0, 0, 0, 0, 0, + 0,0xCDCB, 0, 0, 0, 0, 0, 0, + 0,0xEDBE, 0, 0, 0,0xD5C0,0xE3F0,0xEDFA, + 0, 0, 0, 0, 0,0xE9E4, 0, 0, + 0, 0, 0, 0,0xD5ED,0xE7DD, 0, 0, + 0, 0, 0, 0,0xD4F6,0xE5B7, 0, 0, + 0,0xDBE7,0xE2BF, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEECB, + 0, 0,0xD7F4,0xF0DD, 0, 0, 0,0xCEAB, + 0, 0,0xE7DE, 0, 0, 0,0xD6D6,0xE1CC, + 0, 0,0xE8B3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE5EE,0xDCA2, + 0, 0,0xE0D0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD5B5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD5A1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFBDB, 0, +0xF9CB, 0, 0, 0,0xCBF3,0xF4A5, 0, 0, + 0, 0, 0,0xFAC8,0xD6D7, 0,0xE9E5,0xFBDC, + 0, 0, 0, 0, 0, 0, 0,0xFDD0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFBF6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDAA5, 0,0xDBBD, 0, 0, 0, + 0, 0, 0,0xECE2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xCDF7,0xF0DE, 0, 0, 0, + 0,0xF6C9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDEEF, + 0, 0, 0,0xD3B1, 0, 0, 0, 0, + 0, 0, 0, 0,0xFCEE, 0, 0, 0, + 0,0xE8C3, 0,0xF1C8, 0, 0, 0,0xCEF1, + 0, 0, 0, 0,0xF9ED, 0, 0, 0, + 0, 0, 0, 0, 0,0xF2F4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE4B6, 0, +0xF5B9, 0,0xDCF0,0xE3F1, 0, 0, 0, 0, +0xE8A5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF2BB, 0,0xDEA4, 0,0xDACC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCAE9, 0, + 0, 0, 0, 0, 0,0xE3DA, 0,0xFCD9, + 0, 0, 0, 0, 0, 0, 0,0xEADA, + 0, 0, 0, 0, 0, 0,0xF9C4, 0, +0xE3A4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFBDD, 0,0xEFCA, 0, +0xE8C4, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD5CC, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xEBD7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD9AD, + 0, 0,0xFBAB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD3D9, 0, 0, 0, 0, + 0, 0,0xD5A2, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF6DE, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xDAF6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE0D1, 0, 0,0xE9A8, + 0, 0,0xF5F9, 0, 0, 0, 0, 0, + 0,0xFAAF, 0,0xEBFC, 0, 0,0xE0EA, 0, + 0, 0, 0, 0, 0,0xE3B2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD5C5, + 0, 0,0xF1E3,0xD5EE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCDCC, 0, 0, 0, 0,0xEDD9, 0, + 0, 0, 0,0xD8C1, 0, 0, 0, 0, +0xFAEC, 0, 0, 0, 0, 0,0xF1EB, 0, + 0, 0, 0, 0,0xFABC,0xE6E2, 0, 0, + 0, 0,0xFAE5,0xE2FA, 0, 0, 0,0xCAB6, + 0,0xE4B7, 0,0xEADB, 0,0xF5FA, 0, 0, + 0,0xFBAC,0xCFC3,0xEBFD, 0, 0, 0, 0, +0xF8FA, 0, 0,0xDFB9, 0, 0, 0, 0, +0xE1F1, 0,0xD2A4, 0, 0, 0, 0,0xF5FB, + 0, 0, 0, 0, 0, 0,0xD0DA,0xD0DB, + 0,0xEABE,0xD9B1, 0, 0, 0, 0, 0, +0xCAB7, 0, 0,0xD3E7, 0,0xF8E5, 0, 0, + 0, 0,0xD3B2, 0, 0, 0,0xE2C0,0xF2DF, + 0, 0, 0, 0, 0, 0,0xCDE5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF9AC, 0, 0, 0, 0, + 0, 0, 0, 0,0xCDCD, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEEAE,0xD6AE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD7EA, + 0, 0, 0, 0,0xE7E0,0xEBAE, 0, 0, + 0,0xCFD9, 0, 0,0xDCCD,0xEDFB, 0,0xDEF0, + 0,0xD7EB, 0, 0, 0, 0, 0, 0, +0xDEA5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xDFD7,0xDBD0,0xDBD1, 0, 0, +0xD5A3, 0, 0, 0, 0,0xF0B2, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xDCDC, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCAE8, 0,0xF8E6,0xDCCE, 0, 0, 0, 0, +0xEADC,0xDBD2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE9B3, 0, 0, + 0, 0,0xF7DB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE3A8, 0, +0xD7AE, 0, 0,0xE0E1, 0, 0, 0, 0, + 0,0xCBBA, 0, 0,0xE5D1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD0DC, + 0, 0, 0, 0,0xD5C1, 0, 0, 0, + 0, 0,0xD8CA, 0, 0, 0, 0, 0, + 0, 0,0xE3A9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE0A4, + 0,0xE9A9, 0,0xD3C7, 0, 0,0xDCDD,0xF8AE, + 0, 0, 0,0xCCB8, 0, 0, 0,0xD0AE, + 0, 0, 0,0xD8F2, 0, 0,0xE3CA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCCAF, 0, 0, 0, 0, 0, 0, + 0,0xD4AD,0xF6D1, 0, 0, 0, 0, 0, + 0, 0,0xD0CC, 0, 0, 0, 0, 0, + 0, 0,0xCAC6, 0, 0,0xD5C2, 0, 0, +0xCEBA, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xCAC7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFAB0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDFD8, 0, 0, 0, +0xF5BA, 0, 0, 0, 0, 0, 0, 0, +0xE5EB, 0,0xEFF4,0xDDB5, 0, 0, 0, 0, +0xCDAA, 0,0xE3F2, 0,0xFBF7, 0,0xF7D0, 0, + 0, 0, 0,0xFDBA, 0, 0,0xFDE1,0xF6FE, +0xD1C0, 0, 0,0xE8C5, 0,0xE4B8, 0,0xE1E8, + 0, 0, 0,0xCCC1, 0,0xD2ED, 0, 0, + 0, 0,0xDBBE, 0, 0,0xE0E2, 0, 0, + 0,0xFAC9, 0, 0,0xE1CD, 0,0xCAB8, 0, + 0, 0,0xF2E0,0xF1C9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xDEF1, 0, 0, 0,0xF0DF,0xF8C4, 0, 0, + 0, 0, 0,0xEECC, 0, 0,0xDEF2, 0, +0xE7C9, 0,0xE2F3,0xE7E1, 0, 0,0xE3CB, 0, + 0,0xE3CC, 0, 0, 0,0xCFF8,0xEFAC, 0, +0xFDFE,0xFCA5,0xFAB1,0xDFD9, 0,0xE0D2, 0, 0, + 0,0xF4DA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF1CA, 0,0xCEA3, + 0, 0, 0, 0,0xF2BC,0xECE3, 0, 0, + 0, 0, 0,0xE0A5, 0,0xF7AB, 0, 0, +0xEBAF, 0, 0, 0, 0, 0,0xE5DE, 0, +0xE1A4,0xCDAB, 0,0xD9F4,0xE8A6,0xCDCE,0xE1E9, 0, +0xFCEF, 0,0xE0E3, 0, 0, 0, 0, 0, +0xE2C1, 0,0xCEA4, 0, 0, 0, 0, 0, + 0,0xDEA6, 0, 0,0xEBFE, 0,0xEBDD,0xF0E0, + 0, 0,0xF4DB, 0,0xE2F4, 0, 0,0xD3C8, + 0, 0, 0,0xF4EB, 0,0xEEB5, 0,0xF5D8, + 0, 0,0xD5DF, 0, 0, 0,0xD6E5, 0, + 0, 0, 0,0xEBB0,0xF4E3, 0, 0, 0, + 0,0xE3CD, 0, 0, 0, 0,0xF4F4,0xFAB2, + 0, 0,0xEFF5,0xCADF, 0,0xEBB1,0xEDBF, 0, + 0,0xFDC9, 0, 0, 0, 0,0xE4A6,0xF9A4, +0xF0B3, 0,0xE5EC, 0, 0, 0,0xD1E7, 0, +0xD9C7,0xE4D7,0xEADD, 0,0xD4F7, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xDABA, 0, +0xDACD, 0, 0, 0,0xF9CC, 0,0xE1DA,0xDBBF, + 0,0xCCC5,0xECD0,0xCBBB, 0,0xDEF3, 0, 0, +0xE9AA, 0, 0, 0, 0, 0, 0, 0, +0xD9C8, 0, 0,0xEEE3,0xD7BD, 0, 0, 0, + 0, 0, 0,0xCFC4, 0, 0, 0, 0, + 0,0xD0CD, 0, 0, 0, 0, 0, 0, + 0,0xFCA6, 0, 0, 0, 0, 0, 0, + 0,0xF1FB, 0, 0, 0, 0,0xFDD2,0xD1C1, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE3DB, 0,0xD3C9, 0,0xDCCF, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCCED, 0, + 0, 0, 0, 0,0xDEA7, 0, 0,0xE6BB, +0xECA1, 0, 0, 0,0xCCB9, 0, 0,0xFBDE, + 0, 0, 0, 0, 0,0xE7E2, 0, 0, +0xD4C1, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xDCA8, 0, 0, 0, 0, 0, +0xE2C2, 0,0xF3D8,0xE5D3, 0, 0,0xF3D9, 0, + 0, 0,0xF3C6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCDDB, + 0, 0, 0, 0, 0, 0, 0,0xCDAC, + 0,0xFCC3, 0, 0, 0, 0,0xD4E7, 0, +0xD1C2, 0,0xF9A5, 0,0xE8D5, 0, 0, 0, + 0, 0, 0, 0, 0,0xE3CE, 0, 0, + 0, 0,0xD4CA, 0, 0, 0, 0, 0, + 0,0xDFDA, 0, 0, 0, 0, 0, 0, + 0, 0,0xFBDF,0xE7E3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF8FB,0xE3CF, 0, 0, 0, 0, 0, + 0, 0,0xF5B0, 0, 0, 0, 0, 0, + 0, 0,0xD8E7, 0,0xD9C9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF8AF,0xEFF6, 0, +0xDDB6,0xEEAF,0xCDF8, 0, 0, 0, 0,0xDEB8, +0xFCA7,0xF7FC,0xF7B1,0xCEBB,0xF4A1, 0, 0,0xEECD, +0xE1AE, 0, 0,0xECC3,0xCFFE, 0,0xF8BF,0xD8E2, +0xD3E8, 0, 0,0xDEA8,0xF4E4,0xECC2, 0,0xD9F5, +0xF9C5,0xDDD3,0xD6F1,0xECFC,0xFCF0, 0, 0,0xEDC0, +0xCAB9, 0,0xEEE4, 0, 0, 0, 0, 0, + 0,0xF2E1, 0,0xDEB9, 0, 0, 0, 0, + 0, 0,0xD6F2, 0,0xDEF4, 0,0xDFDB, 0, +0xDBD3, 0,0xFAE7,0xD8E3,0xF4C1, 0,0xDDB7, 0, + 0, 0,0xF2F5, 0, 0,0xD4AE, 0, 0, + 0, 0, 0, 0,0xD6F3, 0, 0, 0, + 0, 0, 0,0xDDB8,0xCFC5,0xDFDF, 0, 0, + 0, 0, 0, 0,0xF2BE,0xF6A1, 0,0xEBCB, +0xF1FC, 0,0xF3C7, 0, 0,0xE0EB, 0, 0, + 0, 0, 0,0xEDFC, 0, 0,0xE1DB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xEEE5, 0,0xDEF5, 0, + 0, 0, 0,0xFAD3, 0, 0, 0, 0, +0xF1CB, 0, 0,0xD0AF,0xDDB9, 0, 0,0xD1C3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF5B1, 0, 0, + 0, 0,0xEAC6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF0E1, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF6AC, 0, 0, 0, 0, +0xF5D9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF0EB, 0, 0, 0, 0, + 0, 0,0xDDBA, 0, 0, 0,0xF2BF, 0, + 0, 0, 0, 0, 0, 0,0xF7C5, 0, + 0, 0, 0,0xDBA2,0xF2F6, 0, 0,0xCABA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF7F5, 0,0xCBE5, 0, 0, + 0,0xEEE6, 0,0xE0D3, 0, 0, 0, 0, +0xCEA5, 0, 0, 0, 0, 0, 0,0xD6D8, + 0, 0, 0,0xD4AF, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE9C9, 0, 0, 0, 0,0xD3CE, +0xF4C2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCBE6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF1A1, 0, 0, 0, 0, 0, +0xEBB2, 0, 0, 0, 0,0xF1A2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xEBB3, 0,0xF0B4, 0, 0,0xCBF4, +0xD4B0,0xF3B2,0xFBB7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF5EC, 0, 0, 0, 0, 0,0xEEE7, +0xF4B2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF5ED, 0,0xCFF3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF0E2, 0, 0, 0, 0, 0,0xEECE, + 0, 0,0xF1CC, 0, 0,0xE5B8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD7F5,0xE3F3,0xCFE5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCFC6, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF3B3,0xE4D8,0xCFF9,0xCFDA, 0, 0, + 0, 0,0xFACD, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE6E3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF2E2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF5EE, 0, 0,0xCABB, 0, 0,0xE3DC, 0, + 0, 0, 0,0xCEF2, 0,0xD6D9, 0, 0, + 0,0xEEB0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF4E5,0xD8C2,0xDCD0,0xCCEE, 0, 0, + 0, 0, 0,0xD5E0,0xF6CA,0xFDCA,0xD8D6,0xF4CF, + 0, 0, 0, 0, 0, 0,0xD6A6,0xDCBE, + 0,0xDBD4,0xD7C7, 0, 0, 0, 0,0xF2FE, + 0, 0, 0,0xF1CD, 0, 0, 0, 0, +0xE2C3,0xDCDE, 0,0xDCDF, 0, 0,0xEFAD,0xE6AB, + 0, 0, 0, 0,0xF9DD,0xEABF, 0, 0, + 0,0xEFAE, 0, 0, 0,0xF4D0,0xCEF3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE6AC, 0,0xCEDE, + 0, 0,0xD5F9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE3F4,0xCDD0, 0, 0, 0, + 0, 0, 0,0xD5B8, 0, 0,0xF7FD, 0, +0xDCA9, 0, 0, 0, 0,0xDEF6, 0,0xDCAA, +0xF2E3,0xE9B4,0xD2DC, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE9E6, 0, 0,0xE3F6, 0, 0, + 0, 0, 0, 0, 0, 0,0xE7CA, 0, + 0,0xD0CE, 0, 0,0xDAF7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xCABC, 0, + 0, 0,0xEEE8,0xDADE, 0,0xF2F7, 0, 0, +0xE2FB, 0,0xCCA6, 0, 0, 0, 0,0xDABB, + 0,0xEEE9, 0, 0, 0,0xF5DA, 0, 0, +0xF7DC,0xE1EA,0xCEC1,0xD4B1, 0,0xFDB1,0xE6BD, 0, +0xFBAD, 0, 0,0xF8E7, 0,0xE1CE, 0,0xF7E2, +0xF5EF,0xCFC7, 0, 0,0xD4B2,0xCCEF, 0,0xD4E8, + 0,0xEECF,0xF7D7, 0, 0,0xE0A6,0xD6C1,0xE1DC, +0xF0E3,0xF1E4,0xDCF1,0xD6A7, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF4F5, 0, + 0,0xF1CE,0xF2E4, 0, 0,0xD0B0, 0, 0, +0xECEF, 0, 0, 0,0xF9BA, 0,0xEBB5, 0, + 0,0xD4ED,0xE2C4, 0, 0, 0, 0,0xE9E7, + 0, 0,0xEBB4,0xEAA1, 0,0xF8BC,0xCEA6, 0, +0xF9C6,0xFCDA, 0,0xD4B3,0xD3B9,0xEADE, 0, 0, + 0,0xE9AB, 0, 0,0xE1E1,0xD3CF,0xF4F6, 0, +0xEAC0,0xE1CF, 0,0xCCBA, 0, 0, 0, 0, + 0,0xEEEA, 0, 0, 0,0xF0E4,0xF3B4,0xD4EE, + 0, 0,0xF2C0, 0, 0,0xF1E5, 0,0xF4C3, +0xE0D4, 0,0xEBB6, 0,0xD7A1,0xCBE8, 0,0xF9AD, +0xE9AD,0xD8E4,0xFAB3,0xE2C5,0xFCBD, 0, 0,0xECC4, +0xD8B1, 0,0xDCAB, 0, 0, 0, 0,0xD5A4, + 0,0xEBE9, 0, 0, 0,0xE8BB, 0, 0, + 0,0xD8D7, 0, 0, 0, 0, 0, 0, + 0, 0,0xFBAE,0xD1E1, 0, 0,0xDBC0, 0, +0xF5BE, 0,0xDEF7, 0, 0, 0, 0,0xCAFB, +0xF7C6,0xCFC8, 0, 0, 0,0xE1D0, 0, 0, +0xEED0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE9F4, 0, 0, 0, 0, 0, 0, + 0, 0,0xCEF4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD5CD, 0, + 0,0xCFDB, 0, 0, 0, 0, 0, 0, +0xDDBB, 0, 0, 0, 0,0xCEAC, 0, 0, + 0, 0, 0, 0, 0,0xE9E8, 0, 0, + 0, 0, 0, 0, 0,0xD4B4, 0, 0, + 0, 0,0xE4C7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF5DB, 0, 0,0xFAC1, 0, 0, + 0,0xDEA9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xD4F8, + 0, 0, 0, 0, 0,0xEFF7, 0, 0, + 0, 0,0xD3B3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEBB7,0xEFF8,0xF5DC,0xEDCC,0xDBD5,0xF1CF, 0, + 0, 0,0xF1D0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF5B2, 0, 0, 0, 0, 0, + 0,0xD9AE,0xD5AC, 0,0xE2C6, 0, 0, 0, + 0, 0, 0, 0, 0,0xFDA3, 0,0xFBE5, +0xDFAB, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2F5, + 0,0xF6AD, 0,0xF5B3, 0,0xF0B5, 0, 0, + 0, 0,0xE1A5, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF5DD, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xECA2,0xEDFD, 0,0xF5B4,0xFBB8, + 0,0xDBA3, 0, 0,0xD6CA,0xCBD9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE5D4, 0, 0, 0, 0, 0, 0,0xF3FA, + 0,0xEBB8, 0,0xE0B7,0xD7EC,0xF1EC,0xE5AF,0xD5E1, +0xD7ED,0xD1D1, 0, 0, 0, 0, 0,0xE1F2, +0xEFF9, 0, 0, 0,0xDDBC,0xF6DC, 0, 0, + 0, 0, 0,0xF0E5, 0, 0, 0,0xF4C4, + 0, 0,0xE9E9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF3FB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD4EF, 0, 0, +0xCCA2,0xF7FE,0xDFBC, 0, 0, 0, 0,0xEBCD, + 0, 0, 0, 0, 0, 0,0xD0B7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xD6C2, 0, 0, 0, + 0, 0,0xE8AD, 0, 0, 0, 0,0xEFAF, +0xCBA5, 0, 0, 0, 0,0xCBE9, 0, 0, + 0,0xFAE8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCCC6, + 0, 0, 0,0xE6E7, 0, 0,0xEAC7, 0, + 0, 0,0xDBA4, 0,0xCFC9,0xE2FC,0xEFFA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEBDE, 0, 0,0xF5C8, 0,0xD4DE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE0D5, 0,0xEFB0, 0, 0,0xE2C7, 0, +0xD9AF, 0, 0, 0,0xF9E7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE7E5, 0, 0,0xCFCA,0xE1D1, + 0,0xE2C8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xEFFB, 0, 0,0xFAF9, + 0, 0,0xDCF2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE0A7, 0, 0, 0, + 0, 0,0xF8E8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCBEA, 0, 0, 0,0xCBBC, 0, 0, 0, + 0, 0, 0, 0,0xD6E2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF5DE, 0, 0, 0, 0, 0, 0, 0, +0xF5DF, 0,0xEEB6, 0, 0, 0,0xE2F6,0xD3CA, +0xEFFC,0xD1C4,0xEFB1, 0,0xD1C5, 0,0xD0DE, 0, +0xD9E1, 0, 0,0xE0B8, 0, 0,0xCDD1,0xF3B9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE7CC, 0,0xD6A8,0xCEA7, 0,0xD4B5, 0, 0, + 0, 0, 0, 0,0xE4C8, 0, 0, 0, + 0, 0, 0,0xD3B4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xEBB9, 0, + 0, 0, 0, 0, 0,0xCBF5, 0, 0, + 0, 0, 0, 0,0xF6DD, 0,0xF1A3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCCC7, 0, 0, 0, + 0, 0, 0, 0,0xE9CA, 0,0xE1F0, 0, + 0, 0,0xF5E0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFBAF, 0, 0, 0,0xCBD1, + 0, 0, 0, 0,0xFBE0,0xF2E5, 0, 0, +0xECF0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF0EC, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEEEB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE9CB, 0, + 0,0xCCF0, 0, 0,0xD7AF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF3A1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFCF5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF1A4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE0D6, 0, 0, + 0, 0, 0,0xEFB2, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF4D1, 0, 0, +0xF7A1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF1D1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCAFC,0xCAFD, 0, 0, 0, 0, 0, + 0, 0, 0,0xCECE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF3C8, 0,0xF3BA +}; + +/* page 7 0x9577-0x9F9C */ +static uint16 tab_uni_ksc56017[]={ +0xEDFE, 0, 0, 0, 0, 0, 0, 0, + 0,0xDAA6, 0, 0,0xE0EC, 0, 0, 0, + 0, 0,0xF8CD, 0,0xCBD2, 0, 0, 0, +0xEBCE, 0,0xF9D8,0xF9D9,0xCAE0,0xDACA, 0, 0, + 0,0xCBA6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCAC8,0xF9EE,0xDBEC, 0, + 0,0xD0B1, 0, 0, 0, 0,0xD5EF, 0, + 0, 0,0xE6F3, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE7A2,0xE4D9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE4E1, 0, 0,0xFCC4, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF9EF,0xCFF4,0xF7E6, + 0, 0, 0, 0, 0,0xCEBC, 0, 0, + 0, 0,0xF4C5,0xDCA3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xDDBD, 0, 0, + 0, 0,0xF4C6, 0, 0, 0, 0, 0, + 0, 0, 0,0xF8A1, 0, 0, 0,0xE8D6, + 0, 0, 0,0xDBC1, 0, 0, 0, 0, + 0, 0, 0, 0,0xF0E6, 0, 0, 0, +0xE4B9,0xF6ED, 0,0xF9AE, 0,0xDDBE, 0, 0, + 0, 0, 0, 0,0xD7B0,0xD8E8,0xCBBD, 0, + 0,0xF9DA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xF8CE,0xF9F0,0xE0ED,0xE3B3, +0xF4B3, 0, 0,0xEAC2,0xF2E6,0xF0B6, 0, 0, + 0, 0, 0,0xDBD6, 0, 0, 0, 0, + 0,0xEBE4, 0, 0,0xF2E7, 0,0xD7D5,0xD4B6, +0xF9E8,0xD7C1, 0, 0, 0, 0,0xE5D5, 0, + 0, 0, 0, 0, 0, 0,0xE9EA,0xD7CC, + 0, 0, 0,0xD3E9,0xE2C9, 0,0xFCDB,0xCDAD, + 0, 0, 0, 0, 0,0xCCB0,0xEAA2, 0, + 0,0xE4F6,0xD0C0, 0,0xF0B7,0xEEA1, 0, 0, + 0, 0, 0, 0,0xD7F6, 0, 0, 0, +0xE2CA,0xE2CB, 0,0xFACF, 0, 0, 0, 0, + 0, 0,0xEBDF, 0, 0, 0, 0, 0, +0xD6CB, 0, 0, 0,0xF4B4, 0, 0, 0, + 0,0xEDCD,0xE4D2, 0, 0,0xEAA9,0xE4BA,0xF3A2, +0xCDD2, 0,0xF6CB, 0,0xF1E6,0xEDC1,0xE8BC,0xEED1, + 0, 0, 0, 0, 0, 0,0xF0E7,0xE2CC, + 0, 0,0xE4AA, 0,0xF5E1,0xEDDA, 0, 0, + 0, 0, 0,0xD7EE,0xD1F1, 0, 0, 0, + 0,0xE9EB,0xE9EC,0xE0E4, 0, 0, 0, 0, +0xDAA7,0xDDD4, 0,0xEAA3, 0, 0, 0,0xD6C3, +0xD6F4, 0,0xDADF, 0,0xEFB3, 0, 0, 0, + 0,0xE2CD, 0, 0, 0, 0, 0,0xEFFD, +0xF2E8, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xEFC5, 0,0xE7E7, 0, 0,0xD7FD, + 0, 0,0xE7CE, 0, 0,0xDFDC, 0,0xF9C7, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD9F6, 0, 0, 0, 0, 0, 0, 0, + 0,0xDFAC, 0,0xD6DA, 0, 0, 0, 0, + 0, 0,0xDCA4, 0, 0, 0,0xF0B8, 0, + 0, 0, 0,0xD5FA, 0,0xE4F7, 0, 0, + 0,0xD6C4, 0, 0, 0, 0, 0, 0, + 0, 0,0xF4EC, 0, 0, 0, 0,0xEFFE, + 0, 0, 0, 0, 0,0xF0A1, 0,0xDEAA, + 0, 0,0xDABC,0xD8FC, 0, 0, 0, 0, + 0, 0,0xFAD4, 0, 0, 0,0xECE5, 0, + 0, 0, 0, 0, 0,0xFCA8, 0, 0, +0xECE6, 0, 0,0xD8CB, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFBB9, 0,0xE4D3, 0, +0xCDF9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCFD3, 0, 0, 0, 0, 0, 0, + 0,0xCAEA, 0, 0,0xCFD4, 0,0xF8BD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF4C7, + 0, 0, 0, 0,0xEADF, 0, 0, 0, + 0, 0, 0, 0,0xF9DB, 0, 0, 0, + 0, 0, 0, 0, 0,0xD4B7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xEBE5, 0, 0,0xE1D2, + 0, 0, 0, 0,0xEAA4, 0, 0, 0, +0xFAC2,0xFBE1,0xFAED,0xF0A2,0xCCF1, 0,0xFAA3,0xE2F7, + 0,0xE2CE, 0,0xE9F5, 0,0xE1EB, 0, 0, + 0,0xE7E8,0xE8D7,0xDAF8,0xD4CB, 0, 0, 0, +0xF7F6,0xD6C5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD4E9, 0, + 0,0xFAFA, 0, 0, 0, 0, 0, 0, + 0,0xCCF2,0xF7DD, 0,0xDEBA, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xCEA8, + 0, 0, 0, 0, 0,0xF0B9,0xE4FE,0xE4C9, + 0, 0, 0, 0, 0,0xE4D4, 0, 0, + 0,0xEAC3, 0,0xEFB4, 0, 0, 0,0xD7BE, + 0, 0, 0, 0, 0, 0,0xFBE2, 0, +0xCDD3, 0, 0, 0,0xEFB5, 0, 0, 0, +0xFAE9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF9A6, 0, 0, 0, 0, 0, 0, +0xDFBD, 0,0xF7C7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xF8FD, 0, 0, +0xF8FC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDEAB,0xDBE8, 0, 0, +0xE3DD, 0,0xE1E2,0xD1C6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF6D0,0xEBE6, +0xDAF9, 0, 0, 0, 0,0xECC7, 0, 0, + 0, 0, 0, 0, 0,0xDEF8,0xF8E9,0xE3DE, + 0, 0, 0, 0,0xCEF5, 0, 0, 0, + 0, 0,0xFAC3,0xE5D7, 0,0xECC8, 0, 0, + 0,0xF3C9, 0, 0,0xE4BB, 0, 0, 0, + 0,0xE6AE, 0, 0, 0, 0, 0,0xEFB6, + 0,0xDCBF, 0, 0, 0, 0, 0, 0, + 0,0xCEBD, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD8C3, 0, + 0, 0,0xD0CF, 0,0xCFFA,0xF3CA,0xE0D7, 0, + 0, 0,0xD1C7,0xE9AE, 0,0xE8BD, 0, 0, +0xFAC4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2CF, + 0, 0,0xFAC5, 0, 0, 0,0xF9B8, 0, + 0, 0, 0, 0, 0, 0,0xDCE0, 0, + 0,0xFBB0, 0, 0, 0,0xD8A9,0xE5DF,0xF9A7, + 0, 0,0xF6EE, 0,0xF6CC,0xE2F8, 0, 0, + 0, 0,0xECF1, 0, 0, 0, 0, 0, + 0, 0,0xDAE0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xF1D2,0xD2CC,0xCFCB, 0, 0,0xCABD, 0, + 0, 0,0xDDBF, 0, 0, 0,0xF6EF, 0, +0xDEF9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFAB4, 0, + 0, 0,0xD5AD, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xF1E7, 0,0xDEBE, 0, 0, 0, 0, 0, + 0,0xDCC0, 0, 0, 0, 0, 0,0xD1C8, +0xD1C9, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xF8BE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCBF6, 0, 0, 0, + 0,0xD4F9, 0, 0, 0, 0, 0,0xF5E2, +0xE1D3, 0, 0, 0, 0, 0, 0, 0, + 0,0xD8E9, 0, 0,0xF8FE, 0,0xCFCC, 0, + 0, 0, 0, 0, 0, 0,0xFDA4, 0, + 0, 0, 0, 0, 0, 0,0xCEF6, 0, +0xFAD0, 0, 0,0xCCF3,0xE6BE, 0, 0, 0, +0xF6AE, 0, 0,0xD5F0, 0, 0,0xD1CA, 0, + 0, 0,0xFCBE,0xD5F1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xCDE9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFAB5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2D0,0xF4F7, 0, 0, + 0,0xCDD4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE7A3, 0, + 0, 0, 0, 0, 0, 0, 0,0xDBA5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE2D1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD7A2, 0, 0,0xF7E3, 0, 0, 0, 0, + 0, 0,0xEAA6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xD0A1, 0, 0, + 0, 0,0xCEDA,0xFBEB,0xDBA6,0xDBDE,0xD8E5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEAE0, 0, 0, 0, 0,0xD8AA, 0, 0, + 0, 0, 0,0xE5E0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD6DB, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEFC6, + 0, 0,0xF8EA, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE4D5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xCEF7, 0, 0,0xE0D8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD7EF, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xF4ED, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xCDE6, 0, 0, + 0,0xCCF4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF5E3, 0, + 0,0xE4CA, 0,0xDCE1, 0, 0,0xF9C8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xFCBF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE8A7, 0, 0, 0, 0, + 0, 0, 0, 0,0xD8C4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCBBE, 0,0xDCAE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xD7F7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xF0E8, 0, +0xDDC0, 0,0xCFCD, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDCF3,0xD9B0, 0,0xE6E9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE4BC, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xEAC4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE4EC, + 0,0xE4E5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xFBF8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xCCBB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE4BD, 0, + 0,0xCDDC,0xD9F7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xDDDF, 0, 0, + 0, 0, 0,0xEDCE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xD9D0, 0, 0, 0, 0, 0, +0xE5A3, 0, 0, 0, 0,0xF9CD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xCDAE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xCFCE, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF6AF, 0, 0, 0, 0, + 0,0xFDD3,0xEBED,0xD6DC, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE5A4, 0, 0, 0,0xD5B6, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD6DD, 0, + 0, 0,0xF9E9, 0, 0, 0,0xE7A4, 0, +0xD6E3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xD1CB,0xD6E4, 0, 0, 0, +0xD5F2, 0, 0, 0, 0, 0,0xDEFA, 0, +0xD7F8, 0, 0, 0, 0, 0,0xD8EA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xCFD5,0xD8FD, 0, + 0, 0, 0, 0,0xD8AB, 0, 0,0xFDCB, + 0, 0, 0, 0,0xFCDC, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0A8,0xD5F3, + 0, 0,0xFDD9, 0, 0,0xCCA3, 0, 0, + 0,0xD9F9, 0, 0,0xD3EA,0xF5F5, 0,0xEFC7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xD3DA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xDABD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE8A8,0xDCAF, 0, 0, 0, 0, 0,0xF0A3, + 0, 0, 0, 0,0xCDD5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE0A9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xDEAC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xF0BA,0xEEB1, 0, 0,0xEEB2, + 0, 0, 0,0xF6CD, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEED2, 0,0xD6C6, 0, 0, 0, 0, 0, +0xE0E5, 0, 0,0xF3BB, 0,0xE5E1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE4CB, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xD7A3, 0, + 0,0xDBC2, 0, 0, 0, 0,0xCAFE, 0, + 0, 0, 0, 0, 0,0xCFCF}; + +/* page 8 0xAC00-0xD7A3 */ +static uint16 tab_uni_ksc56018[]={ +0xB0A1,0xB0A2,0x8141,0x8142,0xB0A3,0x8143,0x8144,0xB0A4, +0xB0A5,0xB0A6,0xB0A7,0x8145,0x8146,0x8147,0x8148,0x8149, +0xB0A8,0xB0A9,0xB0AA,0xB0AB,0xB0AC,0xB0AD,0xB0AE,0xB0AF, +0x814A,0xB0B0,0xB0B1,0xB0B2,0xB0B3,0xB0B4,0x814B,0x814C, +0xB0B5,0x814D,0x814E,0x814F,0xB0B6,0x8150,0x8151,0x8152, +0x8153,0x8154,0x8155,0x8156,0xB0B7,0xB0B8,0x8157,0xB0B9, +0xB0BA,0xB0BB,0x8158,0x8159,0x815A,0x8161,0x8162,0x8163, +0xB0BC,0xB0BD,0x8164,0x8165,0xB0BE,0x8166,0x8167,0x8168, +0xB0BF,0x8169,0x816A,0x816B,0x816C,0x816D,0x816E,0x816F, +0x8170,0x8171,0x8172,0xB0C0,0x8173,0xB0C1,0x8174,0x8175, +0x8176,0x8177,0x8178,0x8179,0xB0C2,0x817A,0x8181,0x8182, +0xB0C3,0x8183,0x8184,0x8185,0xB0C4,0x8186,0x8187,0x8188, +0x8189,0x818A,0x818B,0x818C,0x818D,0x818E,0x818F,0x8190, +0x8191,0x8192,0x8193,0x8194,0x8195,0x8196,0x8197,0x8198, +0xB0C5,0xB0C6,0x8199,0x819A,0xB0C7,0x819B,0x819C,0xB0C8, +0xB0C9,0x819D,0xB0CA,0x819E,0x819F,0x81A0,0x81A1,0x81A2, +0xB0CB,0xB0CC,0x81A3,0xB0CD,0xB0CE,0xB0CF,0xB0D0,0x81A4, +0x81A5,0xB0D1,0xB0D2,0xB0D3,0xB0D4,0x81A6,0x81A7,0x81A8, +0xB0D5,0x81A9,0x81AA,0x81AB,0xB0D6,0x81AC,0x81AD,0x81AE, +0x81AF,0x81B0,0x81B1,0x81B2,0xB0D7,0xB0D8,0x81B3,0xB0D9, +0xB0DA,0xB0DB,0x81B4,0x81B5,0x81B6,0x81B7,0x81B8,0x81B9, +0xB0DC,0xB0DD,0xB0DE,0x81BA,0xB0DF,0x81BB,0x81BC,0xB0E0, +0xB0E1,0x81BD,0x81BE,0x81BF,0x81C0,0x81C1,0x81C2,0x81C3, +0xB0E2,0xB0E3,0x81C4,0xB0E4,0xB0E5,0xB0E6,0x81C5,0x81C6, +0x81C7,0xB0E7,0x81C8,0x81C9,0xB0E8,0x81CA,0x81CB,0x81CC, +0xB0E9,0x81CD,0x81CE,0x81CF,0xB0EA,0x81D0,0x81D1,0x81D2, +0x81D3,0x81D4,0x81D5,0x81D6,0x81D7,0xB0EB,0x81D8,0xB0EC, +0x81D9,0x81DA,0x81DB,0x81DC,0x81DD,0x81DE,0x81DF,0x81E0, +0xB0ED,0xB0EE,0x81E1,0x81E2,0xB0EF,0x81E3,0x81E4,0xB0F0, +0xB0F1,0x81E5,0xB0F2,0x81E6,0xB0F3,0x81E7,0x81E8,0xB0F4, +0xB0F5,0xB0F6,0x81E9,0xB0F7,0x81EA,0xB0F8,0xB0F9,0x81EB, +0x81EC,0x81ED,0x81EE,0x81EF,0xB0FA,0xB0FB,0x81F0,0x81F1, +0xB0FC,0x81F2,0x81F3,0x81F4,0xB0FD,0x81F5,0xB0FE,0x81F6, +0x81F7,0x81F8,0x81F9,0x81FA,0xB1A1,0xB1A2,0x81FB,0xB1A3, +0x81FC,0xB1A4,0x81FD,0x81FE,0x8241,0x8242,0x8243,0x8244, +0xB1A5,0x8245,0x8246,0x8247,0xB1A6,0x8248,0x8249,0x824A, +0xB1A7,0x824B,0x824C,0x824D,0x824E,0x824F,0x8250,0x8251, +0x8252,0xB1A8,0x8253,0x8254,0xB1A9,0xB1AA,0x8255,0x8256, +0x8257,0x8258,0x8259,0x825A,0xB1AB,0xB1AC,0x8261,0x8262, +0xB1AD,0x8263,0x8264,0x8265,0xB1AE,0x8266,0x8267,0x8268, +0x8269,0x826A,0x826B,0x826C,0xB1AF,0xB1B0,0x826D,0xB1B1, +0x826E,0xB1B2,0x826F,0x8270,0x8271,0x8272,0x8273,0x8274, +0xB1B3,0x8275,0x8276,0x8277,0xB1B4,0x8278,0x8279,0x827A, +0xB1B5,0x8281,0x8282,0x8283,0x8284,0x8285,0x8286,0x8287, +0x8288,0xB1B6,0x8289,0xB1B7,0x828A,0x828B,0x828C,0x828D, +0x828E,0x828F,0x8290,0x8291,0xB1B8,0xB1B9,0x8292,0x8293, +0xB1BA,0x8294,0x8295,0xB1BB,0xB1BC,0xB1BD,0xB1BE,0x8296, +0x8297,0x8298,0x8299,0xB1BF,0xB1C0,0xB1C1,0x829A,0xB1C2, +0x829B,0xB1C3,0xB1C4,0x829C,0x829D,0x829E,0x829F,0x82A0, +0xB1C5,0xB1C6,0x82A1,0x82A2,0xB1C7,0x82A3,0x82A4,0x82A5, +0xB1C8,0x82A6,0x82A7,0x82A8,0x82A9,0x82AA,0x82AB,0x82AC, +0x82AD,0x82AE,0x82AF,0x82B0,0xB1C9,0xB1CA,0x82B1,0x82B2, +0x82B3,0x82B4,0x82B5,0x82B6,0xB1CB,0x82B7,0x82B8,0x82B9, +0x82BA,0x82BB,0x82BC,0x82BD,0x82BE,0x82BF,0x82C0,0x82C1, +0x82C2,0x82C3,0x82C4,0x82C5,0x82C6,0x82C7,0x82C8,0xB1CC, +0x82C9,0x82CA,0x82CB,0x82CC,0x82CD,0x82CE,0x82CF,0x82D0, +0xB1CD,0xB1CE,0x82D1,0x82D2,0xB1CF,0x82D3,0x82D4,0x82D5, +0xB1D0,0x82D6,0x82D7,0x82D8,0x82D9,0x82DA,0x82DB,0x82DC, +0xB1D1,0xB1D2,0x82DD,0xB1D3,0x82DE,0x82DF,0x82E0,0x82E1, +0x82E2,0x82E3,0x82E4,0x82E5,0xB1D4,0x82E6,0x82E7,0x82E8, +0xB1D5,0x82E9,0x82EA,0x82EB,0xB1D6,0x82EC,0x82ED,0x82EE, +0x82EF,0x82F0,0x82F1,0x82F2,0x82F3,0x82F4,0x82F5,0x82F6, +0x82F7,0x82F8,0x82F9,0x82FA,0x82FB,0x82FC,0x82FD,0x82FE, +0xB1D7,0xB1D8,0x8341,0x8342,0xB1D9,0x8343,0x8344,0xB1DA, +0xB1DB,0xB1DC,0x8345,0x8346,0x8347,0x8348,0x8349,0x834A, +0xB1DD,0xB1DE,0x834B,0xB1DF,0x834C,0xB1E0,0x834D,0x834E, +0x834F,0x8350,0x8351,0x8352,0xB1E1,0x8353,0x8354,0x8355, +0x8356,0x8357,0x8358,0x8359,0x835A,0x8361,0x8362,0x8363, +0x8364,0x8365,0x8366,0x8367,0x8368,0x8369,0x836A,0x836B, +0x836C,0x836D,0x836E,0x836F,0x8370,0x8371,0x8372,0x8373, +0xB1E2,0xB1E3,0x8374,0x8375,0xB1E4,0x8376,0x8377,0xB1E5, +0xB1E6,0x8378,0xB1E7,0x8379,0x837A,0x8381,0x8382,0x8383, +0xB1E8,0xB1E9,0x8384,0xB1EA,0x8385,0xB1EB,0xB1EC,0x8386, +0x8387,0x8388,0xB1ED,0x8389,0xB1EE,0xB1EF,0xB1F0,0x838A, +0xB1F1,0x838B,0x838C,0x838D,0xB1F2,0x838E,0xB1F3,0x838F, +0x8390,0x8391,0x8392,0x8393,0xB1F4,0xB1F5,0x8394,0xB1F6, +0xB1F7,0xB1F8,0x8395,0x8396,0x8397,0xB1F9,0x8398,0x8399, +0xB1FA,0xB1FB,0x839A,0x839B,0xB1FC,0x839C,0x839D,0x839E, +0xB1FD,0x839F,0x83A0,0x83A1,0x83A2,0x83A3,0x83A4,0x83A5, +0xB1FE,0xB2A1,0x83A6,0xB2A2,0xB2A3,0xB2A4,0x83A7,0x83A8, +0x83A9,0x83AA,0x83AB,0x83AC,0xB2A5,0xB2A6,0x83AD,0x83AE, +0x83AF,0x83B0,0x83B1,0x83B2,0xB2A7,0x83B3,0x83B4,0x83B5, +0x83B6,0x83B7,0x83B8,0x83B9,0x83BA,0x83BB,0x83BC,0x83BD, +0x83BE,0x83BF,0x83C0,0x83C1,0x83C2,0x83C3,0x83C4,0x83C5, +0x83C6,0x83C7,0x83C8,0x83C9,0x83CA,0x83CB,0x83CC,0x83CD, +0x83CE,0x83CF,0x83D0,0x83D1,0x83D2,0x83D3,0x83D4,0x83D5, +0x83D6,0x83D7,0x83D8,0x83D9,0x83DA,0x83DB,0x83DC,0x83DD, +0x83DE,0x83DF,0x83E0,0x83E1,0xB2A8,0xB2A9,0xB2AA,0x83E2, +0xB2AB,0x83E3,0x83E4,0x83E5,0xB2AC,0x83E6,0x83E7,0x83E8, +0x83E9,0x83EA,0x83EB,0x83EC,0xB2AD,0xB2AE,0x83ED,0xB2AF, +0xB2B0,0xB2B1,0x83EE,0x83EF,0x83F0,0x83F1,0x83F2,0x83F3, +0xB2B2,0xB2B3,0x83F4,0x83F5,0xB2B4,0x83F6,0x83F7,0x83F8, +0x83F9,0x83FA,0x83FB,0x83FC,0x83FD,0x83FE,0x8441,0x8442, +0xB2B5,0x8443,0x8444,0xB2B6,0x8445,0xB2B7,0x8446,0x8447, +0x8448,0x8449,0x844A,0x844B,0xB2B8,0x844C,0x844D,0x844E, +0xB2B9,0x844F,0x8450,0x8451,0xB2BA,0x8452,0x8453,0x8454, +0x8455,0x8456,0x8457,0x8458,0x8459,0x845A,0x8461,0xB2BB, +0xB2BC,0x8462,0x8463,0x8464,0x8465,0xB2BD,0x8466,0x8467, +0xB2BE,0x8468,0x8469,0x846A,0x846B,0x846C,0x846D,0x846E, +0x846F,0x8470,0x8471,0x8472,0x8473,0x8474,0x8475,0x8476, +0x8477,0x8478,0x8479,0x847A,0x8481,0x8482,0x8483,0x8484, +0x8485,0x8486,0x8487,0x8488,0xB2BF,0xB2C0,0x8489,0x848A, +0xB2C1,0x848B,0xB2C2,0x848C,0xB2C3,0x848D,0x848E,0x848F, +0x8490,0x8491,0x8492,0x8493,0xB2C4,0xB2C5,0x8494,0xB2C6, +0x8495,0xB2C7,0xB2C8,0xB2C9,0x8496,0x8497,0x8498,0x8499, +0xB2CA,0xB2CB,0x849A,0x849B,0x849C,0x849D,0x849E,0x849F, +0xB2CC,0x84A0,0x84A1,0x84A2,0x84A3,0x84A4,0x84A5,0x84A6, +0x84A7,0x84A8,0x84A9,0x84AA,0xB2CD,0xB2CE,0x84AB,0x84AC, +0x84AD,0x84AE,0x84AF,0x84B0,0xB2CF,0xB2D0,0x84B1,0x84B2, +0x84B3,0x84B4,0x84B5,0x84B6,0x84B7,0x84B8,0x84B9,0x84BA, +0x84BB,0x84BC,0x84BD,0x84BE,0x84BF,0x84C0,0x84C1,0x84C2, +0x84C3,0xB2D1,0x84C4,0x84C5,0x84C6,0x84C7,0x84C8,0x84C9, +0xB2D2,0x84CA,0x84CB,0x84CC,0xB2D3,0x84CD,0x84CE,0x84CF, +0xB2D4,0x84D0,0x84D1,0x84D2,0x84D3,0x84D4,0x84D5,0x84D6, +0xB2D5,0xB2D6,0x84D7,0x84D8,0x84D9,0xB2D7,0x84DA,0x84DB, +0x84DC,0x84DD,0x84DE,0x84DF,0xB2D8,0x84E0,0x84E1,0x84E2, +0x84E3,0x84E4,0x84E5,0x84E6,0x84E7,0x84E8,0x84E9,0x84EA, +0x84EB,0x84EC,0x84ED,0x84EE,0x84EF,0x84F0,0x84F1,0x84F2, +0x84F3,0x84F4,0x84F5,0x84F6,0x84F7,0x84F8,0x84F9,0x84FA, +0xB2D9,0xB2DA,0x84FB,0x84FC,0xB2DB,0x84FD,0x84FE,0x8541, +0xB2DC,0x8542,0x8543,0x8544,0x8545,0x8546,0x8547,0xB2DD, +0xB2DE,0xB2DF,0x8548,0xB2E0,0x8549,0xB2E1,0xB2E2,0x854A, +0x854B,0x854C,0x854D,0x854E,0xB2E3,0x854F,0x8550,0x8551, +0x8552,0x8553,0x8554,0x8555,0xB2E4,0x8556,0x8557,0x8558, +0x8559,0x855A,0x8561,0x8562,0x8563,0x8564,0x8565,0x8566, +0xB2E5,0xB2E6,0x8567,0x8568,0x8569,0x856A,0x856B,0x856C, +0xB2E7,0xB2E8,0x856D,0x856E,0xB2E9,0x856F,0x8570,0x8571, +0xB2EA,0x8572,0x8573,0x8574,0x8575,0x8576,0x8577,0x8578, +0xB2EB,0xB2EC,0x8579,0x857A,0xB2ED,0x8581,0x8582,0x8583, +0x8584,0x8585,0x8586,0x8587,0xB2EE,0x8588,0x8589,0x858A, +0xB2EF,0x858B,0x858C,0x858D,0xB2F0,0x858E,0x858F,0x8590, +0x8591,0x8592,0x8593,0x8594,0xB2F1,0xB2F2,0x8595,0x8596, +0x8597,0x8598,0x8599,0x859A,0x859B,0x859C,0x859D,0x859E, +0xB2F3,0x859F,0x85A0,0x85A1,0x85A2,0x85A3,0x85A4,0x85A5, +0x85A6,0x85A7,0x85A8,0x85A9,0x85AA,0x85AB,0x85AC,0x85AD, +0x85AE,0x85AF,0x85B0,0x85B1,0x85B2,0x85B3,0x85B4,0x85B5, +0x85B6,0x85B7,0x85B8,0x85B9,0xB2F4,0xB2F5,0x85BA,0x85BB, +0xB2F6,0x85BC,0xB2F7,0x85BD,0xB2F8,0x85BE,0xB2F9,0x85BF, +0x85C0,0x85C1,0x85C2,0xB2FA,0xB2FB,0xB2FC,0x85C3,0xB2FD, +0x85C4,0xB2FE,0x85C5,0x85C6,0x85C7,0xB3A1,0x85C8,0x85C9, +0x85CA,0x85CB,0x85CC,0x85CD,0x85CE,0x85CF,0x85D0,0x85D1, +0x85D2,0x85D3,0x85D4,0x85D5,0x85D6,0x85D7,0x85D8,0x85D9, +0x85DA,0x85DB,0x85DC,0x85DD,0x85DE,0x85DF,0x85E0,0x85E1, +0x85E2,0x85E3,0x85E4,0x85E5,0xB3A2,0xB3A3,0x85E6,0x85E7, +0xB3A4,0x85E8,0x85E9,0x85EA,0xB3A5,0x85EB,0x85EC,0x85ED, +0x85EE,0x85EF,0x85F0,0x85F1,0xB3A6,0xB3A7,0x85F2,0xB3A8, +0x85F3,0xB3A9,0x85F4,0x85F5,0x85F6,0x85F7,0x85F8,0x85F9, +0xB3AA,0xB3AB,0xB3AC,0x85FA,0xB3AD,0x85FB,0x85FC,0xB3AE, +0xB3AF,0xB3B0,0xB3B1,0x85FD,0x85FE,0x8641,0x8642,0x8643, +0xB3B2,0xB3B3,0x8644,0xB3B4,0xB3B5,0xB3B6,0xB3B7,0xB3B8, +0x8645,0xB3B9,0x8646,0xB3BA,0xB3BB,0xB3BC,0x8647,0x8648, +0xB3BD,0x8649,0x864A,0x864B,0xB3BE,0x864C,0x864D,0x864E, +0x864F,0x8650,0x8651,0x8652,0xB3BF,0xB3C0,0x8653,0xB3C1, +0xB3C2,0xB3C3,0x8654,0x8655,0x8656,0x8657,0x8658,0x8659, +0xB3C4,0xB3C5,0x865A,0x8661,0xB3C6,0x8662,0x8663,0x8664, +0xB3C7,0x8665,0x8666,0x8667,0x8668,0x8669,0x866A,0x866B, +0xB3C8,0x866C,0x866D,0x866E,0x866F,0xB3C9,0x8670,0x8671, +0x8672,0x8673,0x8674,0x8675,0x8676,0x8677,0x8678,0x8679, +0x867A,0x8681,0x8682,0x8683,0x8684,0x8685,0x8686,0x8687, +0x8688,0x8689,0x868A,0x868B,0x868C,0x868D,0x868E,0x868F, +0x8690,0x8691,0x8692,0x8693,0x8694,0x8695,0x8696,0x8697, +0xB3CA,0xB3CB,0x8698,0xB3CC,0xB3CD,0x8699,0x869A,0x869B, +0xB3CE,0x869C,0xB3CF,0xB3D0,0x869D,0x869E,0x869F,0x86A0, +0xB3D1,0xB3D2,0x86A1,0xB3D3,0xB3D4,0xB3D5,0x86A2,0x86A3, +0x86A4,0x86A5,0x86A6,0xB3D6,0xB3D7,0xB3D8,0x86A7,0x86A8, +0xB3D9,0x86A9,0x86AA,0x86AB,0xB3DA,0x86AC,0x86AD,0x86AE, +0x86AF,0x86B0,0x86B1,0x86B2,0xB3DB,0xB3DC,0x86B3,0xB3DD, +0xB3DE,0xB3DF,0x86B4,0x86B5,0x86B6,0x86B7,0x86B8,0x86B9, +0xB3E0,0xB3E1,0x86BA,0x86BB,0xB3E2,0x86BC,0x86BD,0x86BE, +0xB3E3,0x86BF,0x86C0,0x86C1,0x86C2,0x86C3,0x86C4,0x86C5, +0xB3E4,0xB3E5,0x86C6,0x86C7,0xB3E6,0xB3E7,0x86C8,0x86C9, +0xB3E8,0x86CA,0x86CB,0x86CC,0xB3E9,0x86CD,0x86CE,0x86CF, +0xB3EA,0x86D0,0x86D1,0x86D2,0x86D3,0x86D4,0x86D5,0x86D6, +0x86D7,0x86D8,0x86D9,0x86DA,0x86DB,0x86DC,0x86DD,0x86DE, +0x86DF,0x86E0,0x86E1,0x86E2,0x86E3,0x86E4,0x86E5,0x86E6, +0xB3EB,0xB3EC,0x86E7,0x86E8,0xB3ED,0x86E9,0x86EA,0x86EB, +0xB3EE,0x86EC,0xB3EF,0x86ED,0x86EE,0x86EF,0x86F0,0x86F1, +0xB3F0,0xB3F1,0x86F2,0xB3F2,0x86F3,0xB3F3,0x86F4,0x86F5, +0x86F6,0x86F7,0xB3F4,0xB3F5,0xB3F6,0x86F8,0x86F9,0x86FA, +0xB3F7,0x86FB,0x86FC,0x86FD,0xB3F8,0x86FE,0x8741,0x8742, +0x8743,0x8744,0x8745,0x8746,0x8747,0x8748,0x8749,0x874A, +0xB3F9,0x874B,0x874C,0x874D,0x874E,0x874F,0x8750,0x8751, +0x8752,0x8753,0x8754,0x8755,0x8756,0x8757,0x8758,0x8759, +0x875A,0x8761,0x8762,0x8763,0x8764,0x8765,0x8766,0x8767, +0x8768,0x8769,0x876A,0x876B,0x876C,0x876D,0x876E,0x876F, +0x8770,0x8771,0x8772,0x8773,0xB3FA,0x8774,0x8775,0x8776, +0xB3FB,0x8777,0x8778,0x8779,0xB3FC,0x877A,0x8781,0x8782, +0x8783,0x8784,0x8785,0x8786,0xB3FD,0xB3FE,0x8787,0xB4A1, +0x8788,0x8789,0x878A,0x878B,0x878C,0x878D,0x878E,0x878F, +0xB4A2,0xB4A3,0x8790,0x8791,0xB4A4,0x8792,0x8793,0x8794, +0xB4A5,0x8795,0x8796,0x8797,0x8798,0x8799,0x879A,0x879B, +0x879C,0xB4A6,0x879D,0xB4A7,0x879E,0xB4A8,0x879F,0x87A0, +0x87A1,0x87A2,0x87A3,0x87A4,0xB4A9,0xB4AA,0x87A5,0x87A6, +0xB4AB,0x87A7,0x87A8,0xB4AC,0xB4AD,0x87A9,0x87AA,0x87AB, +0x87AC,0x87AD,0x87AE,0x87AF,0xB4AE,0xB4AF,0x87B0,0xB4B0, +0x87B1,0xB4B1,0x87B2,0x87B3,0x87B4,0x87B5,0x87B6,0x87B7, +0xB4B2,0x87B8,0x87B9,0x87BA,0x87BB,0x87BC,0x87BD,0x87BE, +0x87BF,0x87C0,0x87C1,0x87C2,0x87C3,0x87C4,0x87C5,0x87C6, +0x87C7,0x87C8,0x87C9,0x87CA,0xB4B3,0x87CB,0x87CC,0x87CD, +0x87CE,0x87CF,0x87D0,0x87D1,0xB4B4,0x87D2,0x87D3,0x87D4, +0x87D5,0x87D6,0x87D7,0x87D8,0x87D9,0x87DA,0x87DB,0x87DC, +0x87DD,0x87DE,0x87DF,0x87E0,0x87E1,0x87E2,0x87E3,0x87E4, +0x87E5,0x87E6,0x87E7,0x87E8,0x87E9,0x87EA,0x87EB,0x87EC, +0xB4B5,0x87ED,0x87EE,0x87EF,0xB4B6,0x87F0,0x87F1,0x87F2, +0xB4B7,0x87F3,0x87F4,0x87F5,0x87F6,0x87F7,0x87F8,0x87F9, +0xB4B8,0xB4B9,0x87FA,0x87FB,0x87FC,0x87FD,0x87FE,0x8841, +0x8842,0x8843,0x8844,0x8845,0xB4BA,0xB4BB,0x8846,0x8847, +0x8848,0x8849,0x884A,0x884B,0xB4BC,0x884C,0x884D,0x884E, +0x884F,0x8850,0x8851,0x8852,0xB4BD,0xB4BE,0x8853,0x8854, +0x8855,0xB4BF,0x8856,0x8857,0x8858,0x8859,0x885A,0x8861, +0xB4C0,0xB4C1,0x8862,0x8863,0xB4C2,0x8864,0x8865,0x8866, +0xB4C3,0xB4C4,0xB4C5,0x8867,0x8868,0x8869,0x886A,0x886B, +0xB4C6,0xB4C7,0x886C,0xB4C8,0x886D,0xB4C9,0xB4CA,0x886E, +0x886F,0x8870,0xB4CB,0x8871,0xB4CC,0x8872,0x8873,0x8874, +0xB4CD,0x8875,0x8876,0x8877,0xB4CE,0x8878,0x8879,0x887A, +0x8881,0x8882,0x8883,0x8884,0x8885,0x8886,0x8887,0x8888, +0x8889,0x888A,0x888B,0x888C,0x888D,0x888E,0x888F,0x8890, +0xB4CF,0xB4D0,0x8891,0x8892,0xB4D1,0x8893,0x8894,0x8895, +0xB4D2,0x8896,0xB4D3,0x8897,0x8898,0x8899,0x889A,0x889B, +0xB4D4,0xB4D5,0x889C,0xB4D6,0x889D,0xB4D7,0x889E,0x889F, +0x88A0,0x88A1,0xB4D8,0x88A2,0xB4D9,0xB4DA,0xB4DB,0x88A3, +0xB4DC,0x88A4,0x88A5,0xB4DD,0xB4DE,0xB4DF,0xB4E0,0xB4E1, +0x88A6,0x88A7,0x88A8,0xB4E2,0xB4E3,0xB4E4,0x88A9,0xB4E5, +0xB4E6,0xB4E7,0xB4E8,0xB4E9,0x88AA,0x88AB,0x88AC,0xB4EA, +0xB4EB,0xB4EC,0x88AD,0x88AE,0xB4ED,0x88AF,0x88B0,0x88B1, +0xB4EE,0x88B2,0x88B3,0x88B4,0x88B5,0x88B6,0x88B7,0x88B8, +0xB4EF,0xB4F0,0x88B9,0xB4F1,0xB4F2,0xB4F3,0x88BA,0x88BB, +0x88BC,0x88BD,0x88BE,0x88BF,0xB4F4,0x88C0,0x88C1,0x88C2, +0x88C3,0x88C4,0x88C5,0x88C6,0x88C7,0x88C8,0x88C9,0x88CA, +0x88CB,0x88CC,0x88CD,0x88CE,0x88CF,0x88D0,0x88D1,0x88D2, +0x88D3,0x88D4,0x88D5,0x88D6,0x88D7,0x88D8,0x88D9,0x88DA, +0x88DB,0x88DC,0x88DD,0x88DE,0x88DF,0x88E0,0x88E1,0x88E2, +0x88E3,0x88E4,0x88E5,0x88E6,0x88E7,0x88E8,0x88E9,0x88EA, +0x88EB,0x88EC,0x88ED,0x88EE,0x88EF,0x88F0,0x88F1,0x88F2, +0x88F3,0x88F4,0x88F5,0x88F6,0xB4F5,0xB4F6,0xB4F7,0x88F7, +0xB4F8,0x88F8,0x88F9,0xB4F9,0xB4FA,0x88FA,0xB4FB,0xB4FC, +0x88FB,0x88FC,0x88FD,0x88FE,0xB4FD,0xB4FE,0x8941,0xB5A1, +0x8942,0xB5A2,0x8943,0xB5A3,0x8944,0x8945,0xB5A4,0x8946, +0xB5A5,0xB5A6,0x8947,0x8948,0xB5A7,0x8949,0x894A,0x894B, +0xB5A8,0x894C,0x894D,0x894E,0x894F,0x8950,0x8951,0x8952, +0xB5A9,0xB5AA,0x8953,0xB5AB,0xB5AC,0xB5AD,0x8954,0x8955, +0x8956,0x8957,0x8958,0x8959,0xB5AE,0x895A,0x8961,0x8962, +0xB5AF,0x8963,0x8964,0x8965,0xB5B0,0x8966,0x8967,0x8968, +0x8969,0x896A,0x896B,0x896C,0x896D,0x896E,0x896F,0x8970, +0xB5B1,0xB5B2,0x8971,0x8972,0x8973,0x8974,0x8975,0x8976, +0xB5B3,0x8977,0x8978,0x8979,0xB5B4,0x897A,0x8981,0x8982, +0x8983,0x8984,0x8985,0x8986,0x8987,0x8988,0x8989,0x898A, +0x898B,0x898C,0x898D,0x898E,0x898F,0x8990,0x8991,0x8992, +0x8993,0x8994,0x8995,0x8996,0xB5B5,0xB5B6,0x8997,0x8998, +0xB5B7,0x8999,0x899A,0xB5B8,0xB5B9,0x899B,0xB5BA,0x899C, +0xB5BB,0x899D,0x899E,0x899F,0xB5BC,0xB5BD,0x89A0,0xB5BE, +0x89A1,0xB5BF,0x89A2,0xB5C0,0x89A3,0xB5C1,0x89A4,0x89A5, +0xB5C2,0x89A6,0x89A7,0x89A8,0xB5C3,0x89A9,0x89AA,0x89AB, +0xB5C4,0x89AC,0x89AD,0x89AE,0x89AF,0x89B0,0x89B1,0x89B2, +0x89B3,0x89B4,0x89B5,0x89B6,0x89B7,0x89B8,0x89B9,0x89BA, +0x89BB,0x89BC,0x89BD,0x89BE,0xB5C5,0x89BF,0x89C0,0x89C1, +0x89C2,0x89C3,0x89C4,0x89C5,0x89C6,0x89C7,0x89C8,0x89C9, +0x89CA,0x89CB,0x89CC,0x89CD,0x89CE,0x89CF,0x89D0,0x89D1, +0xB5C6,0x89D2,0x89D3,0x89D4,0x89D5,0x89D6,0x89D7,0x89D8, +0xB5C7,0x89D9,0x89DA,0x89DB,0xB5C8,0x89DC,0x89DD,0x89DE, +0xB5C9,0x89DF,0x89E0,0x89E1,0x89E2,0x89E3,0x89E4,0x89E5, +0xB5CA,0xB5CB,0x89E6,0xB5CC,0x89E7,0x89E8,0x89E9,0x89EA, +0x89EB,0x89EC,0x89ED,0x89EE,0xB5CD,0x89EF,0x89F0,0x89F1, +0x89F2,0x89F3,0x89F4,0x89F5,0x89F6,0x89F7,0x89F8,0x89F9, +0x89FA,0x89FB,0x89FC,0x89FD,0x89FE,0x8A41,0x8A42,0x8A43, +0x8A44,0x8A45,0x8A46,0x8A47,0x8A48,0x8A49,0x8A4A,0x8A4B, +0xB5CE,0xB5CF,0x8A4C,0x8A4D,0xB5D0,0x8A4E,0x8A4F,0x8A50, +0xB5D1,0x8A51,0x8A52,0x8A53,0x8A54,0x8A55,0x8A56,0x8A57, +0xB5D2,0xB5D3,0x8A58,0xB5D4,0x8A59,0xB5D5,0x8A5A,0x8A61, +0x8A62,0x8A63,0x8A64,0x8A65,0xB5D6,0x8A66,0x8A67,0x8A68, +0x8A69,0x8A6A,0x8A6B,0x8A6C,0x8A6D,0x8A6E,0x8A6F,0x8A70, +0x8A71,0x8A72,0x8A73,0x8A74,0x8A75,0x8A76,0x8A77,0x8A78, +0xB5D7,0x8A79,0x8A7A,0x8A81,0x8A82,0x8A83,0x8A84,0x8A85, +0xB5D8,0x8A86,0x8A87,0x8A88,0x8A89,0x8A8A,0x8A8B,0x8A8C, +0x8A8D,0x8A8E,0x8A8F,0x8A90,0x8A91,0x8A92,0x8A93,0x8A94, +0x8A95,0x8A96,0x8A97,0x8A98,0x8A99,0xB5D9,0x8A9A,0x8A9B, +0x8A9C,0x8A9D,0x8A9E,0x8A9F,0xB5DA,0x8AA0,0x8AA1,0x8AA2, +0xB5DB,0x8AA3,0x8AA4,0x8AA5,0xB5DC,0x8AA6,0x8AA7,0x8AA8, +0x8AA9,0x8AAA,0x8AAB,0x8AAC,0x8AAD,0xB5DD,0x8AAE,0xB5DE, +0x8AAF,0xB5DF,0x8AB0,0x8AB1,0x8AB2,0x8AB3,0x8AB4,0x8AB5, +0xB5E0,0x8AB6,0x8AB7,0x8AB8,0xB5E1,0x8AB9,0x8ABA,0x8ABB, +0xB5E2,0x8ABC,0x8ABD,0x8ABE,0x8ABF,0x8AC0,0x8AC1,0x8AC2, +0xB5E3,0x8AC3,0x8AC4,0x8AC5,0x8AC6,0xB5E4,0x8AC7,0x8AC8, +0x8AC9,0x8ACA,0x8ACB,0x8ACC,0xB5E5,0xB5E6,0x8ACD,0x8ACE, +0xB5E7,0x8ACF,0x8AD0,0xB5E8,0xB5E9,0x8AD1,0xB5EA,0x8AD2, +0x8AD3,0x8AD4,0x8AD5,0x8AD6,0xB5EB,0xB5EC,0x8AD7,0xB5ED, +0x8AD8,0xB5EE,0x8AD9,0x8ADA,0x8ADB,0x8ADC,0x8ADD,0x8ADE, +0xB5EF,0x8ADF,0x8AE0,0x8AE1,0x8AE2,0x8AE3,0x8AE4,0x8AE5, +0x8AE6,0x8AE7,0x8AE8,0x8AE9,0x8AEA,0x8AEB,0x8AEC,0x8AED, +0x8AEE,0x8AEF,0x8AF0,0x8AF1,0x8AF2,0x8AF3,0x8AF4,0x8AF5, +0x8AF6,0x8AF7,0x8AF8,0x8AF9,0xB5F0,0xB5F1,0x8AFA,0x8AFB, +0xB5F2,0x8AFC,0x8AFD,0xB5F3,0xB5F4,0x8AFE,0x8B41,0x8B42, +0x8B43,0x8B44,0x8B45,0x8B46,0xB5F5,0xB5F6,0x8B47,0xB5F7, +0xB5F8,0xB5F9,0xB5FA,0x8B48,0x8B49,0x8B4A,0x8B4B,0x8B4C, +0xB5FB,0xB5FC,0x8B4D,0x8B4E,0xB5FD,0x8B4F,0x8B50,0x8B51, +0xB5FE,0x8B52,0x8B53,0x8B54,0x8B55,0x8B56,0x8B57,0x8B58, +0xB6A1,0xB6A2,0x8B59,0xB6A3,0xB6A4,0xB6A5,0x8B5A,0x8B61, +0x8B62,0x8B63,0x8B64,0xB6A6,0xB6A7,0xB6A8,0x8B65,0x8B66, +0xB6A9,0x8B67,0x8B68,0x8B69,0xB6AA,0x8B6A,0x8B6B,0x8B6C, +0x8B6D,0x8B6E,0x8B6F,0x8B70,0xB6AB,0xB6AC,0x8B71,0xB6AD, +0xB6AE,0xB6AF,0x8B72,0x8B73,0x8B74,0x8B75,0x8B76,0x8B77, +0x8B78,0x8B79,0x8B7A,0x8B81,0x8B82,0x8B83,0x8B84,0x8B85, +0x8B86,0x8B87,0x8B88,0x8B89,0x8B8A,0x8B8B,0x8B8C,0x8B8D, +0x8B8E,0x8B8F,0x8B90,0x8B91,0x8B92,0x8B93,0x8B94,0x8B95, +0x8B96,0x8B97,0x8B98,0x8B99,0x8B9A,0x8B9B,0x8B9C,0x8B9D, +0x8B9E,0x8B9F,0x8BA0,0x8BA1,0x8BA2,0x8BA3,0x8BA4,0x8BA5, +0x8BA6,0x8BA7,0x8BA8,0x8BA9,0x8BAA,0x8BAB,0x8BAC,0x8BAD, +0x8BAE,0x8BAF,0x8BB0,0x8BB1,0x8BB2,0x8BB3,0x8BB4,0x8BB5, +0xB6B0,0xB6B1,0x8BB6,0x8BB7,0xB6B2,0x8BB8,0x8BB9,0x8BBA, +0xB6B3,0x8BBB,0xB6B4,0xB6B5,0x8BBC,0x8BBD,0x8BBE,0x8BBF, +0xB6B6,0xB6B7,0x8BC0,0xB6B8,0xB6B9,0xB6BA,0x8BC1,0x8BC2, +0x8BC3,0x8BC4,0x8BC5,0xB6BB,0xB6BC,0xB6BD,0x8BC6,0x8BC7, +0xB6BE,0x8BC8,0x8BC9,0x8BCA,0xB6BF,0x8BCB,0x8BCC,0x8BCD, +0x8BCE,0x8BCF,0x8BD0,0x8BD1,0xB6C0,0xB6C1,0x8BD2,0xB6C2, +0xB6C3,0xB6C4,0x8BD3,0x8BD4,0x8BD5,0x8BD6,0x8BD7,0x8BD8, +0xB6C5,0x8BD9,0x8BDA,0x8BDB,0x8BDC,0x8BDD,0x8BDE,0x8BDF, +0x8BE0,0x8BE1,0x8BE2,0x8BE3,0x8BE4,0x8BE5,0x8BE6,0x8BE7, +0x8BE8,0x8BE9,0x8BEA,0x8BEB,0xB6C6,0x8BEC,0x8BED,0x8BEE, +0x8BEF,0x8BF0,0x8BF1,0x8BF2,0x8BF3,0x8BF4,0x8BF5,0x8BF6, +0x8BF7,0x8BF8,0x8BF9,0x8BFA,0x8BFB,0x8BFC,0x8BFD,0x8BFE, +0x8C41,0x8C42,0x8C43,0x8C44,0x8C45,0x8C46,0x8C47,0x8C48, +0x8C49,0x8C4A,0x8C4B,0x8C4C,0x8C4D,0x8C4E,0x8C4F,0x8C50, +0xB6C7,0xB6C8,0x8C51,0x8C52,0xB6C9,0x8C53,0x8C54,0x8C55, +0xB6CA,0x8C56,0x8C57,0x8C58,0x8C59,0x8C5A,0x8C61,0x8C62, +0x8C63,0x8C64,0x8C65,0x8C66,0x8C67,0xB6CB,0x8C68,0x8C69, +0x8C6A,0x8C6B,0x8C6C,0x8C6D,0xB6CC,0x8C6E,0x8C6F,0x8C70, +0x8C71,0x8C72,0x8C73,0x8C74,0xB6CD,0x8C75,0x8C76,0x8C77, +0x8C78,0x8C79,0x8C7A,0x8C81,0x8C82,0x8C83,0x8C84,0x8C85, +0x8C86,0x8C87,0x8C88,0x8C89,0x8C8A,0x8C8B,0x8C8C,0x8C8D, +0xB6CE,0x8C8E,0x8C8F,0x8C90,0x8C91,0x8C92,0x8C93,0x8C94, +0x8C95,0x8C96,0x8C97,0x8C98,0x8C99,0x8C9A,0x8C9B,0x8C9C, +0x8C9D,0x8C9E,0x8C9F,0x8CA0,0x8CA1,0x8CA2,0x8CA3,0x8CA4, +0x8CA5,0x8CA6,0x8CA7,0x8CA8,0xB6CF,0x8CA9,0x8CAA,0x8CAB, +0xB6D0,0x8CAC,0x8CAD,0x8CAE,0x8CAF,0x8CB0,0x8CB1,0x8CB2, +0x8CB3,0x8CB4,0x8CB5,0x8CB6,0x8CB7,0x8CB8,0x8CB9,0x8CBA, +0x8CBB,0x8CBC,0x8CBD,0x8CBE,0x8CBF,0x8CC0,0x8CC1,0x8CC2, +0x8CC3,0x8CC4,0x8CC5,0x8CC6,0x8CC7,0x8CC8,0x8CC9,0x8CCA, +0x8CCB,0x8CCC,0x8CCD,0x8CCE,0x8CCF,0x8CD0,0x8CD1,0x8CD2, +0x8CD3,0x8CD4,0x8CD5,0x8CD6,0x8CD7,0x8CD8,0x8CD9,0x8CDA, +0x8CDB,0x8CDC,0x8CDD,0x8CDE,0xB6D1,0xB6D2,0x8CDF,0x8CE0, +0xB6D3,0x8CE1,0x8CE2,0x8CE3,0xB6D4,0x8CE4,0x8CE5,0x8CE6, +0x8CE7,0x8CE8,0x8CE9,0xB6D5,0xB6D6,0x8CEA,0x8CEB,0x8CEC, +0x8CED,0xB6D7,0x8CEE,0x8CEF,0x8CF0,0x8CF1,0x8CF2,0x8CF3, +0x8CF4,0x8CF5,0x8CF6,0x8CF7,0x8CF8,0x8CF9,0x8CFA,0x8CFB, +0x8CFC,0x8CFD,0x8CFE,0x8D41,0x8D42,0x8D43,0x8D44,0x8D45, +0x8D46,0x8D47,0x8D48,0x8D49,0x8D4A,0x8D4B,0x8D4C,0x8D4D, +0x8D4E,0x8D4F,0x8D50,0x8D51,0xB6D8,0x8D52,0x8D53,0x8D54, +0x8D55,0x8D56,0x8D57,0x8D58,0x8D59,0x8D5A,0x8D61,0x8D62, +0x8D63,0x8D64,0x8D65,0x8D66,0x8D67,0x8D68,0x8D69,0x8D6A, +0x8D6B,0x8D6C,0x8D6D,0x8D6E,0x8D6F,0x8D70,0x8D71,0x8D72, +0xB6D9,0x8D73,0x8D74,0x8D75,0xB6DA,0x8D76,0x8D77,0x8D78, +0xB6DB,0x8D79,0x8D7A,0x8D81,0x8D82,0x8D83,0x8D84,0x8D85, +0xB6DC,0xB6DD,0x8D86,0x8D87,0x8D88,0xB6DE,0x8D89,0x8D8A, +0x8D8B,0x8D8C,0x8D8D,0x8D8E,0x8D8F,0x8D90,0x8D91,0x8D92, +0x8D93,0x8D94,0x8D95,0x8D96,0x8D97,0x8D98,0x8D99,0x8D9A, +0x8D9B,0x8D9C,0x8D9D,0x8D9E,0x8D9F,0x8DA0,0x8DA1,0x8DA2, +0x8DA3,0x8DA4,0x8DA5,0x8DA6,0x8DA7,0x8DA8,0x8DA9,0x8DAA, +0xB6DF,0xB6E0,0x8DAB,0x8DAC,0xB6E1,0x8DAD,0x8DAE,0xB6E2, +0xB6E3,0x8DAF,0x8DB0,0x8DB1,0x8DB2,0x8DB3,0x8DB4,0x8DB5, +0xB6E4,0xB6E5,0x8DB6,0xB6E6,0x8DB7,0x8DB8,0x8DB9,0x8DBA, +0x8DBB,0x8DBC,0x8DBD,0x8DBE,0xB6E7,0x8DBF,0x8DC0,0x8DC1, +0xB6E8,0x8DC2,0x8DC3,0x8DC4,0xB6E9,0x8DC5,0x8DC6,0x8DC7, +0x8DC8,0x8DC9,0x8DCA,0x8DCB,0xB6EA,0xB6EB,0x8DCC,0x8DCD, +0x8DCE,0x8DCF,0x8DD0,0x8DD1,0x8DD2,0x8DD3,0x8DD4,0x8DD5, +0xB6EC,0x8DD6,0x8DD7,0x8DD8,0xB6ED,0x8DD9,0x8DDA,0x8DDB, +0xB6EE,0x8DDC,0x8DDD,0x8DDE,0x8DDF,0x8DE0,0x8DE1,0x8DE2, +0xB6EF,0xB6F0,0x8DE3,0xB6F1,0x8DE4,0xB6F2,0x8DE5,0x8DE6, +0x8DE7,0x8DE8,0x8DE9,0x8DEA,0xB6F3,0xB6F4,0x8DEB,0x8DEC, +0xB6F5,0x8DED,0x8DEE,0x8DEF,0xB6F6,0x8DF0,0x8DF1,0x8DF2, +0x8DF3,0x8DF4,0x8DF5,0x8DF6,0xB6F7,0xB6F8,0x8DF7,0xB6F9, +0xB6FA,0xB6FB,0xB6FC,0x8DF8,0x8DF9,0x8DFA,0xB6FD,0xB6FE, +0xB7A1,0xB7A2,0x8DFB,0x8DFC,0xB7A3,0x8DFD,0x8DFE,0x8E41, +0xB7A4,0x8E42,0x8E43,0x8E44,0x8E45,0x8E46,0x8E47,0x8E48, +0xB7A5,0xB7A6,0x8E49,0xB7A7,0xB7A8,0xB7A9,0x8E4A,0x8E4B, +0x8E4C,0x8E4D,0x8E4E,0x8E4F,0xB7AA,0xB7AB,0x8E50,0x8E51, +0xB7AC,0x8E52,0x8E53,0x8E54,0x8E55,0x8E56,0x8E57,0x8E58, +0x8E59,0x8E5A,0x8E61,0x8E62,0x8E63,0x8E64,0x8E65,0xB7AD, +0x8E66,0xB7AE,0x8E67,0x8E68,0x8E69,0x8E6A,0x8E6B,0x8E6C, +0x8E6D,0x8E6E,0x8E6F,0x8E70,0x8E71,0x8E72,0x8E73,0x8E74, +0x8E75,0x8E76,0x8E77,0x8E78,0x8E79,0x8E7A,0x8E81,0x8E82, +0x8E83,0x8E84,0x8E85,0x8E86,0x8E87,0x8E88,0x8E89,0x8E8A, +0x8E8B,0x8E8C,0x8E8D,0x8E8E,0xB7AF,0xB7B0,0x8E8F,0x8E90, +0xB7B1,0x8E91,0x8E92,0x8E93,0xB7B2,0x8E94,0x8E95,0x8E96, +0x8E97,0x8E98,0x8E99,0x8E9A,0xB7B3,0xB7B4,0x8E9B,0xB7B5, +0xB7B6,0xB7B7,0x8E9C,0x8E9D,0x8E9E,0x8E9F,0x8EA0,0xB7B8, +0xB7B9,0xB7BA,0x8EA1,0x8EA2,0xB7BB,0x8EA3,0x8EA4,0x8EA5, +0xB7BC,0x8EA6,0x8EA7,0x8EA8,0x8EA9,0x8EAA,0x8EAB,0x8EAC, +0xB7BD,0xB7BE,0x8EAD,0xB7BF,0x8EAE,0xB7C0,0x8EAF,0x8EB0, +0x8EB1,0x8EB2,0x8EB3,0x8EB4,0xB7C1,0xB7C2,0x8EB5,0x8EB6, +0xB7C3,0x8EB7,0x8EB8,0x8EB9,0xB7C4,0x8EBA,0x8EBB,0x8EBC, +0x8EBD,0x8EBE,0x8EBF,0x8EC0,0xB7C5,0xB7C6,0x8EC1,0xB7C7, +0xB7C8,0xB7C9,0x8EC2,0x8EC3,0x8EC4,0x8EC5,0x8EC6,0x8EC7, +0xB7CA,0x8EC8,0x8EC9,0x8ECA,0xB7CB,0x8ECB,0x8ECC,0x8ECD, +0x8ECE,0x8ECF,0x8ED0,0x8ED1,0x8ED2,0x8ED3,0x8ED4,0x8ED5, +0x8ED6,0xB7CC,0x8ED7,0xB7CD,0x8ED8,0x8ED9,0x8EDA,0x8EDB, +0x8EDC,0x8EDD,0x8EDE,0x8EDF,0xB7CE,0xB7CF,0x8EE0,0x8EE1, +0xB7D0,0x8EE2,0x8EE3,0x8EE4,0xB7D1,0x8EE5,0x8EE6,0x8EE7, +0x8EE8,0x8EE9,0x8EEA,0x8EEB,0xB7D2,0xB7D3,0x8EEC,0xB7D4, +0x8EED,0xB7D5,0x8EEE,0x8EEF,0x8EF0,0x8EF1,0x8EF2,0x8EF3, +0xB7D6,0x8EF4,0x8EF5,0x8EF6,0xB7D7,0x8EF7,0x8EF8,0x8EF9, +0x8EFA,0x8EFB,0x8EFC,0x8EFD,0x8EFE,0x8F41,0x8F42,0x8F43, +0x8F44,0x8F45,0x8F46,0x8F47,0x8F48,0xB7D8,0x8F49,0x8F4A, +0x8F4B,0x8F4C,0x8F4D,0x8F4E,0x8F4F,0x8F50,0x8F51,0x8F52, +0x8F53,0x8F54,0x8F55,0x8F56,0x8F57,0x8F58,0x8F59,0x8F5A, +0x8F61,0x8F62,0x8F63,0x8F64,0x8F65,0x8F66,0x8F67,0x8F68, +0xB7D9,0x8F69,0x8F6A,0x8F6B,0x8F6C,0x8F6D,0x8F6E,0x8F6F, +0xB7DA,0x8F70,0x8F71,0x8F72,0xB7DB,0x8F73,0x8F74,0x8F75, +0xB7DC,0x8F76,0x8F77,0x8F78,0x8F79,0x8F7A,0x8F81,0x8F82, +0xB7DD,0xB7DE,0x8F83,0xB7DF,0x8F84,0xB7E0,0x8F85,0x8F86, +0x8F87,0x8F88,0x8F89,0x8F8A,0xB7E1,0x8F8B,0x8F8C,0x8F8D, +0xB7E2,0x8F8E,0x8F8F,0x8F90,0xB7E3,0x8F91,0x8F92,0x8F93, +0x8F94,0x8F95,0x8F96,0x8F97,0x8F98,0xB7E4,0x8F99,0xB7E5, +0x8F9A,0xB7E6,0x8F9B,0x8F9C,0x8F9D,0x8F9E,0x8F9F,0x8FA0, +0xB7E7,0xB7E8,0x8FA1,0x8FA2,0xB7E9,0x8FA3,0x8FA4,0x8FA5, +0xB7EA,0x8FA6,0x8FA7,0x8FA8,0x8FA9,0x8FAA,0x8FAB,0x8FAC, +0xB7EB,0xB7EC,0x8FAD,0xB7ED,0x8FAE,0xB7EE,0x8FAF,0x8FB0, +0x8FB1,0x8FB2,0x8FB3,0x8FB4,0xB7EF,0x8FB5,0x8FB6,0x8FB7, +0x8FB8,0x8FB9,0x8FBA,0x8FBB,0x8FBC,0x8FBD,0x8FBE,0x8FBF, +0x8FC0,0x8FC1,0x8FC2,0x8FC3,0x8FC4,0x8FC5,0x8FC6,0x8FC7, +0xB7F0,0x8FC8,0x8FC9,0x8FCA,0x8FCB,0x8FCC,0x8FCD,0x8FCE, +0xB7F1,0x8FCF,0x8FD0,0x8FD1,0x8FD2,0x8FD3,0x8FD4,0x8FD5, +0x8FD6,0x8FD7,0x8FD8,0x8FD9,0x8FDA,0x8FDB,0x8FDC,0x8FDD, +0x8FDE,0x8FDF,0x8FE0,0x8FE1,0x8FE2,0x8FE3,0x8FE4,0x8FE5, +0x8FE6,0x8FE7,0x8FE8,0x8FE9,0xB7F2,0xB7F3,0x8FEA,0x8FEB, +0xB7F4,0x8FEC,0x8FED,0x8FEE,0xB7F5,0x8FEF,0x8FF0,0x8FF1, +0x8FF2,0x8FF3,0x8FF4,0x8FF5,0xB7F6,0x8FF6,0x8FF7,0xB7F7, +0x8FF8,0xB7F8,0x8FF9,0x8FFA,0x8FFB,0x8FFC,0x8FFD,0x8FFE, +0xB7F9,0xB7FA,0x9041,0x9042,0xB7FB,0x9043,0x9044,0x9045, +0xB7FC,0x9046,0x9047,0x9048,0x9049,0x904A,0x904B,0x904C, +0xB7FD,0xB7FE,0x904D,0xB8A1,0x904E,0xB8A2,0x904F,0x9050, +0x9051,0x9052,0x9053,0x9054,0xB8A3,0xB8A4,0x9055,0x9056, +0xB8A5,0x9057,0x9058,0x9059,0xB8A6,0x905A,0x9061,0x9062, +0x9063,0x9064,0x9065,0x9066,0xB8A7,0xB8A8,0x9067,0xB8A9, +0x9068,0xB8AA,0xB8AB,0x9069,0x906A,0xB8AC,0xB8AD,0x906B, +0x906C,0x906D,0x906E,0x906F,0x9070,0x9071,0x9072,0x9073, +0x9074,0x9075,0x9076,0x9077,0x9078,0x9079,0x907A,0x9081, +0x9082,0x9083,0x9084,0x9085,0x9086,0x9087,0x9088,0x9089, +0x908A,0x908B,0x908C,0x908D,0xB8AE,0xB8AF,0x908E,0x908F, +0xB8B0,0x9090,0x9091,0x9092,0xB8B1,0x9093,0x9094,0x9095, +0x9096,0x9097,0x9098,0x9099,0xB8B2,0xB8B3,0x909A,0xB8B4, +0x909B,0xB8B5,0x909C,0x909D,0x909E,0x909F,0x90A0,0x90A1, +0xB8B6,0xB8B7,0x90A2,0x90A3,0xB8B8,0x90A4,0xB8B9,0xB8BA, +0xB8BB,0xB8BC,0xB8BD,0x90A5,0x90A6,0x90A7,0x90A8,0x90A9, +0xB8BE,0xB8BF,0x90AA,0xB8C0,0x90AB,0xB8C1,0xB8C2,0x90AC, +0x90AD,0xB8C3,0x90AE,0xB8C4,0xB8C5,0xB8C6,0x90AF,0x90B0, +0xB8C7,0x90B1,0x90B2,0x90B3,0xB8C8,0x90B4,0x90B5,0x90B6, +0x90B7,0x90B8,0x90B9,0x90BA,0xB8C9,0xB8CA,0x90BB,0xB8CB, +0xB8CC,0xB8CD,0xB8CE,0x90BC,0x90BD,0x90BE,0x90BF,0x90C0, +0xB8CF,0xB8D0,0x90C1,0x90C2,0x90C3,0x90C4,0x90C5,0x90C6, +0xB8D1,0x90C7,0x90C8,0x90C9,0x90CA,0x90CB,0x90CC,0x90CD, +0x90CE,0x90CF,0x90D0,0x90D1,0x90D2,0xB8D2,0x90D3,0x90D4, +0x90D5,0x90D6,0x90D7,0x90D8,0x90D9,0x90DA,0x90DB,0x90DC, +0x90DD,0x90DE,0x90DF,0x90E0,0x90E1,0x90E2,0x90E3,0x90E4, +0x90E5,0x90E6,0x90E7,0x90E8,0x90E9,0x90EA,0x90EB,0x90EC, +0x90ED,0x90EE,0x90EF,0x90F0,0x90F1,0x90F2,0x90F3,0x90F4, +0xB8D3,0xB8D4,0x90F5,0x90F6,0xB8D5,0x90F7,0x90F8,0x90F9, +0xB8D6,0x90FA,0xB8D7,0x90FB,0x90FC,0x90FD,0x90FE,0x9141, +0xB8D8,0xB8D9,0x9142,0xB8DA,0x9143,0xB8DB,0xB8DC,0x9144, +0x9145,0x9146,0x9147,0xB8DD,0xB8DE,0xB8DF,0x9148,0x9149, +0xB8E0,0x914A,0x914B,0x914C,0xB8E1,0x914D,0x914E,0x914F, +0x9150,0x9151,0x9152,0x9153,0xB8E2,0xB8E3,0x9154,0xB8E4, +0xB8E5,0xB8E6,0x9155,0x9156,0x9157,0x9158,0x9159,0x915A, +0xB8E7,0xB8E8,0x9161,0x9162,0xB8E9,0x9163,0x9164,0x9165, +0xB8EA,0x9166,0x9167,0x9168,0x9169,0x916A,0x916B,0x916C, +0x916D,0x916E,0x916F,0xB8EB,0xB8EC,0xB8ED,0x9170,0xB8EE, +0x9171,0x9172,0x9173,0x9174,0xB8EF,0x9175,0x9176,0x9177, +0x9178,0x9179,0x917A,0x9181,0x9182,0x9183,0x9184,0x9185, +0x9186,0x9187,0x9188,0x9189,0x918A,0x918B,0x918C,0x918D, +0x918E,0x918F,0x9190,0x9191,0x9192,0x9193,0x9194,0x9195, +0xB8F0,0xB8F1,0x9196,0xB8F2,0xB8F3,0x9197,0x9198,0x9199, +0xB8F4,0x919A,0xB8F5,0x919B,0x919C,0x919D,0x919E,0x919F, +0xB8F6,0xB8F7,0x91A0,0xB8F8,0x91A1,0xB8F9,0x91A2,0x91A3, +0x91A4,0x91A5,0x91A6,0x91A7,0xB8FA,0x91A8,0x91A9,0x91AA, +0xB8FB,0x91AB,0x91AC,0x91AD,0x91AE,0x91AF,0x91B0,0x91B1, +0x91B2,0x91B3,0x91B4,0x91B5,0x91B6,0x91B7,0x91B8,0x91B9, +0xB8FC,0xB8FD,0x91BA,0x91BB,0x91BC,0x91BD,0x91BE,0x91BF, +0x91C0,0x91C1,0x91C2,0x91C3,0x91C4,0x91C5,0x91C6,0x91C7, +0x91C8,0x91C9,0x91CA,0x91CB,0x91CC,0x91CD,0x91CE,0x91CF, +0x91D0,0x91D1,0x91D2,0x91D3,0x91D4,0x91D5,0x91D6,0x91D7, +0x91D8,0x91D9,0x91DA,0x91DB,0xB8FE,0x91DC,0x91DD,0x91DE, +0xB9A1,0x91DF,0x91E0,0x91E1,0xB9A2,0x91E2,0x91E3,0x91E4, +0x91E5,0x91E6,0x91E7,0x91E8,0x91E9,0xB9A3,0x91EA,0xB9A4, +0x91EB,0xB9A5,0x91EC,0x91ED,0x91EE,0x91EF,0x91F0,0x91F1, +0xB9A6,0x91F2,0x91F3,0x91F4,0xB9A7,0x91F5,0x91F6,0x91F7, +0xB9A8,0x91F8,0x91F9,0x91FA,0x91FB,0x91FC,0x91FD,0x91FE, +0x9241,0xB9A9,0x9242,0xB9AA,0x9243,0x9244,0x9245,0x9246, +0x9247,0x9248,0x9249,0x924A,0xB9AB,0xB9AC,0xB9AD,0x924B, +0xB9AE,0x924C,0x924D,0xB9AF,0xB9B0,0xB9B1,0xB9B2,0x924E, +0x924F,0x9250,0x9251,0x9252,0xB9B3,0xB9B4,0x9253,0xB9B5, +0x9254,0xB9B6,0x9255,0x9256,0x9257,0xB9B7,0x9258,0xB9B8, +0xB9B9,0x9259,0x925A,0x9261,0xB9BA,0x9262,0x9263,0x9264, +0xB9BB,0x9265,0x9266,0x9267,0x9268,0x9269,0x926A,0x926B, +0x926C,0xB9BC,0x926D,0xB9BD,0x926E,0x926F,0x9270,0x9271, +0x9272,0x9273,0x9274,0x9275,0xB9BE,0x9276,0x9277,0x9278, +0x9279,0x927A,0x9281,0x9282,0x9283,0x9284,0x9285,0x9286, +0x9287,0x9288,0x9289,0x928A,0x928B,0x928C,0x928D,0x928E, +0x928F,0x9290,0x9291,0x9292,0x9293,0x9294,0x9295,0x9296, +0xB9BF,0x9297,0x9298,0x9299,0xB9C0,0x929A,0x929B,0x929C, +0xB9C1,0x929D,0x929E,0x929F,0x92A0,0x92A1,0x92A2,0x92A3, +0x92A4,0x92A5,0x92A6,0x92A7,0x92A8,0x92A9,0x92AA,0x92AB, +0x92AC,0x92AD,0x92AE,0x92AF,0xB9C2,0x92B0,0x92B1,0x92B2, +0xB9C3,0x92B3,0x92B4,0x92B5,0xB9C4,0x92B6,0x92B7,0x92B8, +0x92B9,0x92BA,0x92BB,0x92BC,0xB9C5,0x92BD,0x92BE,0xB9C6, +0x92BF,0x92C0,0x92C1,0x92C2,0x92C3,0x92C4,0x92C5,0x92C6, +0xB9C7,0x92C7,0x92C8,0x92C9,0xB9C8,0x92CA,0x92CB,0x92CC, +0xB9C9,0x92CD,0x92CE,0x92CF,0x92D0,0x92D1,0x92D2,0x92D3, +0xB9CA,0x92D4,0x92D5,0xB9CB,0x92D6,0x92D7,0x92D8,0x92D9, +0x92DA,0x92DB,0x92DC,0x92DD,0x92DE,0x92DF,0x92E0,0x92E1, +0x92E2,0x92E3,0x92E4,0x92E5,0x92E6,0x92E7,0x92E8,0x92E9, +0x92EA,0x92EB,0x92EC,0x92ED,0x92EE,0x92EF,0x92F0,0x92F1, +0x92F2,0x92F3,0x92F4,0x92F5,0x92F6,0x92F7,0x92F8,0x92F9, +0xB9CC,0xB9CD,0x92FA,0x92FB,0xB9CE,0x92FC,0x92FD,0xB9CF, +0xB9D0,0x92FE,0xB9D1,0x9341,0x9342,0x9343,0x9344,0x9345, +0xB9D2,0xB9D3,0x9346,0xB9D4,0xB9D5,0xB9D6,0x9347,0xB9D7, +0x9348,0xB9D8,0x9349,0x934A,0xB9D9,0xB9DA,0xB9DB,0xB9DC, +0xB9DD,0x934B,0x934C,0xB9DE,0xB9DF,0xB9E0,0xB9E1,0xB9E2, +0x934D,0x934E,0x934F,0x9350,0xB9E3,0xB9E4,0x9351,0xB9E5, +0x9352,0xB9E6,0x9353,0x9354,0x9355,0xB9E7,0x9356,0x9357, +0xB9E8,0xB9E9,0x9358,0x9359,0xB9EA,0x935A,0x9361,0x9362, +0xB9EB,0x9363,0x9364,0x9365,0x9366,0x9367,0x9368,0x9369, +0xB9EC,0xB9ED,0x936A,0xB9EE,0xB9EF,0xB9F0,0x936B,0x936C, +0x936D,0xB9F1,0x936E,0x936F,0xB9F2,0xB9F3,0x9370,0x9371, +0xB9F4,0x9372,0x9373,0x9374,0x9375,0x9376,0x9377,0x9378, +0x9379,0x937A,0x9381,0x9382,0x9383,0xB9F5,0x9384,0x9385, +0x9386,0x9387,0x9388,0x9389,0x938A,0x938B,0x938C,0x938D, +0x938E,0x938F,0x9390,0x9391,0x9392,0x9393,0x9394,0x9395, +0x9396,0x9397,0x9398,0x9399,0x939A,0x939B,0x939C,0x939D, +0x939E,0x939F,0x93A0,0x93A1,0x93A2,0x93A3,0x93A4,0x93A5, +0x93A6,0x93A7,0x93A8,0x93A9,0xB9F6,0xB9F7,0x93AA,0x93AB, +0xB9F8,0x93AC,0x93AD,0xB9F9,0xB9FA,0x93AE,0xB9FB,0x93AF, +0x93B0,0x93B1,0x93B2,0x93B3,0xB9FC,0xB9FD,0x93B4,0xB9FE, +0x93B5,0xBAA1,0xBAA2,0x93B6,0x93B7,0x93B8,0x93B9,0x93BA, +0xBAA3,0xBAA4,0x93BB,0x93BC,0xBAA5,0x93BD,0x93BE,0xBAA6, +0xBAA7,0x93BF,0x93C0,0x93C1,0x93C2,0x93C3,0x93C4,0x93C5, +0xBAA8,0xBAA9,0x93C6,0xBAAA,0xBAAB,0xBAAC,0x93C7,0x93C8, +0x93C9,0x93CA,0x93CB,0x93CC,0xBAAD,0xBAAE,0x93CD,0x93CE, +0xBAAF,0x93CF,0x93D0,0x93D1,0xBAB0,0x93D2,0x93D3,0x93D4, +0x93D5,0x93D6,0x93D7,0x93D8,0x93D9,0xBAB1,0x93DA,0xBAB2, +0xBAB3,0xBAB4,0x93DB,0x93DC,0x93DD,0xBAB5,0x93DE,0x93DF, +0xBAB6,0x93E0,0x93E1,0x93E2,0xBAB7,0x93E3,0x93E4,0x93E5, +0x93E6,0x93E7,0x93E8,0x93E9,0x93EA,0x93EB,0x93EC,0x93ED, +0x93EE,0x93EF,0x93F0,0x93F1,0x93F2,0x93F3,0x93F4,0x93F5, +0x93F6,0x93F7,0x93F8,0x93F9,0xBAB8,0xBAB9,0xBABA,0x93FA, +0xBABB,0x93FB,0x93FC,0x93FD,0xBABC,0x93FE,0x9441,0x9442, +0x9443,0x9444,0x9445,0x9446,0xBABD,0xBABE,0x9447,0xBABF, +0x9448,0xBAC0,0x9449,0x944A,0x944B,0x944C,0x944D,0x944E, +0xBAC1,0x944F,0x9450,0x9451,0xBAC2,0x9452,0x9453,0x9454, +0x9455,0x9456,0x9457,0x9458,0x9459,0x945A,0x9461,0x9462, +0x9463,0x9464,0x9465,0x9466,0xBAC3,0x9467,0x9468,0x9469, +0x946A,0x946B,0x946C,0x946D,0xBAC4,0x946E,0x946F,0x9470, +0x9471,0x9472,0x9473,0x9474,0x9475,0x9476,0x9477,0x9478, +0x9479,0x947A,0x9481,0x9482,0x9483,0x9484,0x9485,0x9486, +0xBAC5,0x9487,0x9488,0x9489,0x948A,0x948B,0x948C,0x948D, +0xBAC6,0xBAC7,0x948E,0x948F,0xBAC8,0x9490,0x9491,0x9492, +0xBAC9,0x9493,0x9494,0x9495,0x9496,0x9497,0x9498,0x9499, +0xBACA,0xBACB,0x949A,0x949B,0x949C,0x949D,0x949E,0x949F, +0x94A0,0x94A1,0x94A2,0x94A3,0xBACC,0x94A4,0x94A5,0x94A6, +0xBACD,0x94A7,0x94A8,0x94A9,0x94AA,0x94AB,0x94AC,0x94AD, +0x94AE,0x94AF,0x94B0,0x94B1,0x94B2,0x94B3,0x94B4,0x94B5, +0x94B6,0x94B7,0x94B8,0x94B9,0x94BA,0x94BB,0x94BC,0x94BD, +0xBACE,0xBACF,0x94BE,0x94BF,0xBAD0,0x94C0,0x94C1,0xBAD1, +0xBAD2,0xBAD3,0xBAD4,0x94C2,0x94C3,0x94C4,0x94C5,0x94C6, +0xBAD5,0xBAD6,0x94C7,0xBAD7,0x94C8,0xBAD8,0x94C9,0x94CA, +0x94CB,0xBAD9,0xBADA,0x94CC,0xBADB,0x94CD,0x94CE,0x94CF, +0x94D0,0x94D1,0x94D2,0x94D3,0xBADC,0x94D4,0x94D5,0x94D6, +0x94D7,0x94D8,0x94D9,0x94DA,0x94DB,0x94DC,0x94DD,0x94DE, +0xBADD,0x94DF,0x94E0,0x94E1,0x94E2,0x94E3,0x94E4,0x94E5, +0xBADE,0x94E6,0x94E7,0x94E8,0x94E9,0x94EA,0x94EB,0x94EC, +0x94ED,0x94EE,0x94EF,0x94F0,0x94F1,0x94F2,0x94F3,0x94F4, +0x94F5,0x94F6,0x94F7,0x94F8,0x94F9,0x94FA,0x94FB,0x94FC, +0x94FD,0x94FE,0x9541,0x9542,0xBADF,0xBAE0,0x9543,0x9544, +0xBAE1,0x9545,0x9546,0x9547,0xBAE2,0x9548,0x9549,0x954A, +0x954B,0x954C,0x954D,0x954E,0x954F,0x9550,0x9551,0x9552, +0x9553,0xBAE3,0x9554,0x9555,0x9556,0x9557,0x9558,0x9559, +0xBAE4,0x955A,0x9561,0x9562,0xBAE5,0x9563,0x9564,0x9565, +0xBAE6,0x9566,0x9567,0x9568,0x9569,0x956A,0x956B,0x956C, +0xBAE7,0x956D,0x956E,0xBAE8,0x956F,0xBAE9,0x9570,0x9571, +0x9572,0x9573,0x9574,0x9575,0xBAEA,0xBAEB,0x9576,0x9577, +0xBAEC,0x9578,0x9579,0x957A,0xBAED,0x9581,0x9582,0x9583, +0x9584,0x9585,0x9586,0x9587,0xBAEE,0xBAEF,0x9588,0xBAF0, +0x9589,0x958A,0x958B,0x958C,0x958D,0x958E,0x958F,0x9590, +0x9591,0x9592,0x9593,0x9594,0x9595,0x9596,0x9597,0x9598, +0x9599,0x959A,0x959B,0x959C,0x959D,0x959E,0x959F,0x95A0, +0x95A1,0x95A2,0x95A3,0x95A4,0x95A5,0x95A6,0x95A7,0x95A8, +0x95A9,0x95AA,0x95AB,0x95AC,0xBAF1,0xBAF2,0x95AD,0x95AE, +0xBAF3,0x95AF,0x95B0,0x95B1,0xBAF4,0x95B2,0xBAF5,0x95B3, +0x95B4,0x95B5,0x95B6,0x95B7,0xBAF6,0xBAF7,0x95B8,0xBAF8, +0x95B9,0xBAF9,0xBAFA,0xBAFB,0x95BA,0x95BB,0x95BC,0x95BD, +0xBAFC,0xBAFD,0x95BE,0x95BF,0xBAFE,0x95C0,0x95C1,0x95C2, +0xBBA1,0x95C3,0xBBA2,0x95C4,0x95C5,0x95C6,0x95C7,0x95C8, +0xBBA3,0xBBA4,0x95C9,0xBBA5,0xBBA6,0xBBA7,0x95CA,0x95CB, +0x95CC,0x95CD,0x95CE,0xBBA8,0xBBA9,0xBBAA,0x95CF,0x95D0, +0xBBAB,0x95D1,0x95D2,0x95D3,0xBBAC,0x95D4,0x95D5,0x95D6, +0x95D7,0x95D8,0x95D9,0x95DA,0xBBAD,0xBBAE,0x95DB,0xBBAF, +0xBBB0,0xBBB1,0x95DC,0x95DD,0x95DE,0x95DF,0x95E0,0x95E1, +0xBBB2,0xBBB3,0x95E2,0x95E3,0x95E4,0x95E5,0x95E6,0x95E7, +0x95E8,0x95E9,0x95EA,0x95EB,0x95EC,0x95ED,0x95EE,0x95EF, +0xBBB4,0x95F0,0x95F1,0x95F2,0x95F3,0x95F4,0x95F5,0x95F6, +0x95F7,0x95F8,0x95F9,0x95FA,0x95FB,0x95FC,0x95FD,0x95FE, +0x9641,0x9642,0x9643,0x9644,0x9645,0x9646,0x9647,0x9648, +0x9649,0x964A,0x964B,0x964C,0x964D,0x964E,0x964F,0x9650, +0x9651,0x9652,0x9653,0x9654,0x9655,0x9656,0x9657,0x9658, +0xBBB5,0xBBB6,0x9659,0x965A,0xBBB7,0x9661,0x9662,0xBBB8, +0xBBB9,0x9663,0x9664,0x9665,0x9666,0x9667,0x9668,0x9669, +0xBBBA,0x966A,0x966B,0xBBBB,0xBBBC,0xBBBD,0x966C,0x966D, +0x966E,0x966F,0x9670,0x9671,0xBBBE,0x9672,0x9673,0x9674, +0x9675,0x9676,0x9677,0x9678,0x9679,0x967A,0x9681,0x9682, +0x9683,0x9684,0x9685,0x9686,0x9687,0x9688,0x9689,0x968A, +0x968B,0xBBBF,0x968C,0x968D,0x968E,0x968F,0x9690,0x9691, +0xBBC0,0xBBC1,0x9692,0x9693,0x9694,0x9695,0x9696,0x9697, +0x9698,0x9699,0x969A,0x969B,0x969C,0x969D,0x969E,0x969F, +0xBBC2,0xBBC3,0x96A0,0xBBC4,0xBBC5,0xBBC6,0x96A1,0x96A2, +0x96A3,0x96A4,0x96A5,0x96A6,0x96A7,0x96A8,0x96A9,0x96AA, +0x96AB,0x96AC,0x96AD,0x96AE,0x96AF,0x96B0,0x96B1,0x96B2, +0x96B3,0x96B4,0x96B5,0x96B6,0x96B7,0x96B8,0x96B9,0x96BA, +0x96BB,0x96BC,0x96BD,0x96BE,0x96BF,0x96C0,0x96C1,0x96C2, +0xBBC7,0xBBC8,0x96C3,0x96C4,0xBBC9,0x96C5,0x96C6,0x96C7, +0xBBCA,0x96C8,0x96C9,0x96CA,0x96CB,0x96CC,0x96CD,0x96CE, +0xBBCB,0xBBCC,0x96CF,0x96D0,0x96D1,0xBBCD,0x96D2,0x96D3, +0x96D4,0x96D5,0x96D6,0x96D7,0x96D8,0x96D9,0x96DA,0x96DB, +0x96DC,0x96DD,0x96DE,0x96DF,0x96E0,0x96E1,0x96E2,0x96E3, +0x96E4,0x96E5,0x96E6,0x96E7,0x96E8,0x96E9,0x96EA,0x96EB, +0x96EC,0x96ED,0x96EE,0x96EF,0x96F0,0x96F1,0x96F2,0x96F3, +0x96F4,0x96F5,0x96F6,0x96F7,0x96F8,0x96F9,0x96FA,0x96FB, +0x96FC,0x96FD,0x96FE,0x9741,0x9742,0x9743,0x9744,0x9745, +0x9746,0x9747,0x9748,0x9749,0x974A,0x974B,0x974C,0x974D, +0x974E,0x974F,0x9750,0x9751,0xBBCE,0x9752,0x9753,0x9754, +0x9755,0x9756,0x9757,0x9758,0x9759,0x975A,0x9761,0x9762, +0x9763,0x9764,0x9765,0x9766,0x9767,0x9768,0x9769,0x976A, +0x976B,0x976C,0x976D,0x976E,0x976F,0x9770,0x9771,0x9772, +0xBBCF,0x9773,0x9774,0x9775,0x9776,0x9777,0x9778,0x9779, +0x977A,0x9781,0x9782,0x9783,0x9784,0x9785,0x9786,0x9787, +0x9788,0x9789,0x978A,0x978B,0x978C,0xBBD0,0x978D,0x978E, +0x978F,0x9790,0x9791,0x9792,0xBBD1,0xBBD2,0x9793,0x9794, +0xBBD3,0x9795,0x9796,0x9797,0xBBD4,0x9798,0x9799,0x979A, +0x979B,0x979C,0x979D,0x979E,0xBBD5,0x979F,0x97A0,0xBBD6, +0x97A1,0xBBD7,0x97A2,0x97A3,0x97A4,0x97A5,0x97A6,0x97A7, +0x97A8,0x97A9,0x97AA,0x97AB,0x97AC,0x97AD,0x97AE,0x97AF, +0x97B0,0x97B1,0x97B2,0x97B3,0x97B4,0x97B5,0x97B6,0x97B7, +0x97B8,0x97B9,0x97BA,0x97BB,0x97BC,0x97BD,0x97BE,0x97BF, +0x97C0,0x97C1,0x97C2,0x97C3,0x97C4,0x97C5,0x97C6,0x97C7, +0x97C8,0x97C9,0x97CA,0x97CB,0x97CC,0x97CD,0x97CE,0x97CF, +0x97D0,0x97D1,0x97D2,0x97D3,0x97D4,0x97D5,0x97D6,0x97D7, +0x97D8,0x97D9,0x97DA,0x97DB,0x97DC,0x97DD,0x97DE,0x97DF, +0x97E0,0x97E1,0x97E2,0x97E3,0x97E4,0x97E5,0x97E6,0x97E7, +0x97E8,0x97E9,0x97EA,0x97EB,0x97EC,0x97ED,0x97EE,0x97EF, +0x97F0,0x97F1,0x97F2,0x97F3,0x97F4,0x97F5,0x97F6,0x97F7, +0x97F8,0x97F9,0x97FA,0x97FB,0xBBD8,0x97FC,0x97FD,0x97FE, +0x9841,0x9842,0x9843,0x9844,0x9845,0x9846,0x9847,0x9848, +0x9849,0x984A,0x984B,0x984C,0x984D,0x984E,0x984F,0x9850, +0x9851,0xBBD9,0x9852,0x9853,0x9854,0x9855,0x9856,0x9857, +0xBBDA,0x9858,0x9859,0x985A,0xBBDB,0x9861,0x9862,0x9863, +0xBBDC,0x9864,0x9865,0x9866,0x9867,0x9868,0x9869,0x986A, +0xBBDD,0xBBDE,0x986B,0x986C,0x986D,0x986E,0x986F,0x9870, +0x9871,0x9872,0x9873,0x9874,0x9875,0x9876,0x9877,0x9878, +0x9879,0x987A,0x9881,0x9882,0x9883,0x9884,0x9885,0x9886, +0x9887,0x9888,0x9889,0x988A,0x988B,0x988C,0x988D,0x988E, +0x988F,0x9890,0x9891,0x9892,0x9893,0x9894,0x9895,0x9896, +0xBBDF,0xBBE0,0x9897,0x9898,0xBBE1,0x9899,0x989A,0x989B, +0xBBE2,0x989C,0x989D,0x989E,0x989F,0x98A0,0x98A1,0x98A2, +0xBBE3,0xBBE4,0x98A3,0xBBE5,0x98A4,0xBBE6,0x98A5,0x98A6, +0x98A7,0x98A8,0x98A9,0x98AA,0xBBE7,0xBBE8,0x98AB,0xBBE9, +0xBBEA,0x98AC,0x98AD,0xBBEB,0xBBEC,0xBBED,0xBBEE,0x98AE, +0x98AF,0x98B0,0x98B1,0x98B2,0xBBEF,0xBBF0,0x98B3,0xBBF1, +0xBBF2,0xBBF3,0x98B4,0x98B5,0x98B6,0xBBF4,0x98B7,0x98B8, +0xBBF5,0xBBF6,0x98B9,0x98BA,0xBBF7,0x98BB,0x98BC,0x98BD, +0xBBF8,0x98BE,0x98BF,0x98C0,0x98C1,0x98C2,0x98C3,0x98C4, +0xBBF9,0xBBFA,0x98C5,0xBBFB,0xBBFC,0xBBFD,0x98C6,0x98C7, +0x98C8,0x98C9,0x98CA,0x98CB,0xBBFE,0xBCA1,0x98CC,0x98CD, +0xBCA2,0x98CE,0x98CF,0x98D0,0xBCA3,0x98D1,0x98D2,0x98D3, +0x98D4,0x98D5,0x98D6,0x98D7,0xBCA4,0xBCA5,0x98D8,0xBCA6, +0x98D9,0xBCA7,0x98DA,0x98DB,0x98DC,0x98DD,0x98DE,0x98DF, +0xBCA8,0x98E0,0x98E1,0x98E2,0xBCA9,0x98E3,0x98E4,0x98E5, +0xBCAA,0x98E6,0x98E7,0x98E8,0x98E9,0x98EA,0x98EB,0x98EC, +0xBCAB,0x98ED,0x98EE,0x98EF,0x98F0,0xBCAC,0x98F1,0x98F2, +0x98F3,0x98F4,0x98F5,0x98F6,0xBCAD,0xBCAE,0xBCAF,0xBCB0, +0xBCB1,0x98F7,0x98F8,0xBCB2,0xBCB3,0x98F9,0xBCB4,0xBCB5, +0x98FA,0x98FB,0x98FC,0x98FD,0xBCB6,0xBCB7,0x98FE,0xBCB8, +0xBCB9,0xBCBA,0x9941,0x9942,0x9943,0x9944,0xBCBB,0x9945, +0xBCBC,0xBCBD,0x9946,0x9947,0xBCBE,0x9948,0x9949,0x994A, +0xBCBF,0x994B,0x994C,0x994D,0x994E,0x994F,0x9950,0x9951, +0xBCC0,0xBCC1,0x9952,0xBCC2,0xBCC3,0xBCC4,0x9953,0x9954, +0x9955,0x9956,0x9957,0x9958,0xBCC5,0xBCC6,0x9959,0x995A, +0xBCC7,0x9961,0x9962,0x9963,0xBCC8,0x9964,0x9965,0x9966, +0x9967,0x9968,0x9969,0x996A,0xBCC9,0xBCCA,0x996B,0xBCCB, +0xBCCC,0xBCCD,0x996C,0x996D,0x996E,0x996F,0x9970,0x9971, +0xBCCE,0x9972,0x9973,0x9974,0xBCCF,0x9975,0x9976,0x9977, +0xBCD0,0x9978,0x9979,0x997A,0x9981,0x9982,0x9983,0x9984, +0x9985,0x9986,0x9987,0x9988,0x9989,0xBCD1,0x998A,0x998B, +0x998C,0x998D,0x998E,0x998F,0xBCD2,0xBCD3,0xBCD4,0x9990, +0xBCD5,0x9991,0x9992,0x9993,0xBCD6,0x9994,0xBCD7,0x9995, +0x9996,0x9997,0x9998,0x9999,0xBCD8,0xBCD9,0x999A,0xBCDA, +0x999B,0xBCDB,0x999C,0x999D,0x999E,0xBCDC,0x999F,0x99A0, +0xBCDD,0xBCDE,0x99A1,0x99A2,0xBCDF,0x99A3,0x99A4,0x99A5, +0xBCE0,0x99A6,0x99A7,0x99A8,0x99A9,0x99AA,0x99AB,0x99AC, +0x99AD,0x99AE,0x99AF,0x99B0,0x99B1,0xBCE1,0x99B2,0x99B3, +0x99B4,0x99B5,0x99B6,0x99B7,0xBCE2,0x99B8,0x99B9,0x99BA, +0xBCE3,0x99BB,0x99BC,0x99BD,0xBCE4,0x99BE,0x99BF,0x99C0, +0x99C1,0x99C2,0x99C3,0x99C4,0xBCE5,0x99C5,0x99C6,0xBCE6, +0xBCE7,0x99C7,0x99C8,0x99C9,0x99CA,0x99CB,0x99CC,0x99CD, +0xBCE8,0x99CE,0x99CF,0x99D0,0xBCE9,0x99D1,0x99D2,0x99D3, +0xBCEA,0x99D4,0x99D5,0x99D6,0x99D7,0x99D8,0x99D9,0x99DA, +0xBCEB,0xBCEC,0x99DB,0xBCED,0x99DC,0x99DD,0x99DE,0x99DF, +0x99E0,0x99E1,0x99E2,0x99E3,0xBCEE,0xBCEF,0x99E4,0x99E5, +0xBCF0,0x99E6,0x99E7,0x99E8,0xBCF1,0x99E9,0x99EA,0x99EB, +0x99EC,0x99ED,0x99EE,0x99EF,0xBCF2,0xBCF3,0x99F0,0xBCF4, +0x99F1,0xBCF5,0x99F2,0x99F3,0x99F4,0x99F5,0x99F6,0x99F7, +0xBCF6,0xBCF7,0x99F8,0x99F9,0xBCF8,0x99FA,0x99FB,0xBCF9, +0xBCFA,0x99FC,0x99FD,0x99FE,0x9A41,0x9A42,0x9A43,0x9A44, +0xBCFB,0xBCFC,0x9A45,0xBCFD,0x9A46,0xBCFE,0x9A47,0xBDA1, +0x9A48,0xBDA2,0xBDA3,0x9A49,0xBDA4,0x9A4A,0x9A4B,0x9A4C, +0x9A4D,0x9A4E,0x9A4F,0x9A50,0x9A51,0x9A52,0x9A53,0x9A54, +0x9A55,0x9A56,0x9A57,0x9A58,0x9A59,0x9A5A,0x9A61,0x9A62, +0xBDA5,0x9A63,0x9A64,0x9A65,0x9A66,0x9A67,0x9A68,0x9A69, +0xBDA6,0xBDA7,0x9A6A,0x9A6B,0xBDA8,0x9A6C,0x9A6D,0x9A6E, +0xBDA9,0x9A6F,0x9A70,0x9A71,0x9A72,0x9A73,0x9A74,0x9A75, +0xBDAA,0x9A76,0x9A77,0x9A78,0x9A79,0xBDAB,0x9A7A,0x9A81, +0x9A82,0x9A83,0x9A84,0x9A85,0xBDAC,0xBDAD,0x9A86,0x9A87, +0xBDAE,0x9A88,0x9A89,0x9A8A,0xBDAF,0x9A8B,0x9A8C,0x9A8D, +0x9A8E,0x9A8F,0x9A90,0x9A91,0xBDB0,0xBDB1,0x9A92,0xBDB2, +0x9A93,0xBDB3,0x9A94,0x9A95,0x9A96,0x9A97,0x9A98,0x9A99, +0xBDB4,0xBDB5,0x9A9A,0x9A9B,0x9A9C,0x9A9D,0x9A9E,0x9A9F, +0xBDB6,0x9AA0,0x9AA1,0x9AA2,0x9AA3,0x9AA4,0x9AA5,0x9AA6, +0xBDB7,0x9AA7,0x9AA8,0xBDB8,0x9AA9,0xBDB9,0x9AAA,0x9AAB, +0x9AAC,0x9AAD,0x9AAE,0x9AAF,0xBDBA,0xBDBB,0x9AB0,0x9AB1, +0xBDBC,0x9AB2,0x9AB3,0x9AB4,0xBDBD,0xBDBE,0x9AB5,0x9AB6, +0x9AB7,0x9AB8,0x9AB9,0x9ABA,0xBDBF,0xBDC0,0x9ABB,0xBDC1, +0x9ABC,0xBDC2,0x9ABD,0x9ABE,0x9ABF,0x9AC0,0x9AC1,0x9AC2, +0x9AC3,0x9AC4,0x9AC5,0x9AC6,0x9AC7,0x9AC8,0x9AC9,0x9ACA, +0x9ACB,0x9ACC,0x9ACD,0x9ACE,0x9ACF,0x9AD0,0x9AD1,0x9AD2, +0x9AD3,0x9AD4,0x9AD5,0x9AD6,0x9AD7,0x9AD8,0x9AD9,0x9ADA, +0x9ADB,0x9ADC,0x9ADD,0x9ADE,0xBDC3,0xBDC4,0x9ADF,0x9AE0, +0xBDC5,0x9AE1,0x9AE2,0xBDC6,0xBDC7,0x9AE3,0x9AE4,0x9AE5, +0x9AE6,0x9AE7,0x9AE8,0xBDC8,0xBDC9,0xBDCA,0x9AE9,0xBDCB, +0x9AEA,0xBDCC,0x9AEB,0x9AEC,0x9AED,0x9AEE,0xBDCD,0x9AEF, +0xBDCE,0xBDCF,0x9AF0,0xBDD0,0xBDD1,0x9AF1,0x9AF2,0x9AF3, +0xBDD2,0x9AF4,0x9AF5,0x9AF6,0x9AF7,0x9AF8,0x9AF9,0x9AFA, +0xBDD3,0xBDD4,0x9AFB,0x9AFC,0xBDD5,0xBDD6,0x9AFD,0x9AFE, +0x9B41,0x9B42,0x9B43,0xBDD7,0xBDD8,0xBDD9,0x9B44,0x9B45, +0xBDDA,0x9B46,0x9B47,0x9B48,0xBDDB,0x9B49,0x9B4A,0x9B4B, +0x9B4C,0x9B4D,0x9B4E,0x9B4F,0xBDDC,0xBDDD,0x9B50,0x9B51, +0xBDDE,0xBDDF,0x9B52,0x9B53,0x9B54,0x9B55,0x9B56,0x9B57, +0x9B58,0x9B59,0x9B5A,0x9B61,0x9B62,0x9B63,0x9B64,0x9B65, +0x9B66,0x9B67,0x9B68,0x9B69,0x9B6A,0x9B6B,0x9B6C,0x9B6D, +0x9B6E,0x9B6F,0x9B70,0x9B71,0x9B72,0xBDE0,0x9B73,0x9B74, +0x9B75,0x9B76,0x9B77,0x9B78,0x9B79,0x9B7A,0x9B81,0x9B82, +0x9B83,0x9B84,0x9B85,0x9B86,0x9B87,0x9B88,0x9B89,0x9B8A, +0x9B8B,0x9B8C,0x9B8D,0x9B8E,0x9B8F,0x9B90,0x9B91,0x9B92, +0x9B93,0x9B94,0x9B95,0x9B96,0x9B97,0x9B98,0x9B99,0x9B9A, +0xBDE1,0xBDE2,0x9B9B,0x9B9C,0xBDE3,0x9B9D,0x9B9E,0x9B9F, +0xBDE4,0x9BA0,0xBDE5,0x9BA1,0x9BA2,0x9BA3,0x9BA4,0x9BA5, +0xBDE6,0xBDE7,0x9BA6,0x9BA7,0xBDE8,0xBDE9,0x9BA8,0x9BA9, +0x9BAA,0x9BAB,0x9BAC,0x9BAD,0xBDEA,0x9BAE,0x9BAF,0x9BB0, +0xBDEB,0x9BB1,0x9BB2,0x9BB3,0xBDEC,0x9BB4,0x9BB5,0x9BB6, +0x9BB7,0x9BB8,0x9BB9,0x9BBA,0x9BBB,0x9BBC,0x9BBD,0x9BBE, +0x9BBF,0x9BC0,0x9BC1,0x9BC2,0x9BC3,0x9BC4,0x9BC5,0x9BC6, +0x9BC7,0x9BC8,0x9BC9,0x9BCA,0x9BCB,0x9BCC,0x9BCD,0x9BCE, +0x9BCF,0x9BD0,0x9BD1,0x9BD2,0x9BD3,0x9BD4,0x9BD5,0x9BD6, +0x9BD7,0x9BD8,0x9BD9,0x9BDA,0x9BDB,0x9BDC,0x9BDD,0x9BDE, +0x9BDF,0x9BE0,0x9BE1,0x9BE2,0x9BE3,0x9BE4,0x9BE5,0x9BE6, +0xBDED,0x9BE7,0x9BE8,0x9BE9,0x9BEA,0x9BEB,0x9BEC,0x9BED, +0x9BEE,0x9BEF,0x9BF0,0x9BF1,0x9BF2,0x9BF3,0x9BF4,0x9BF5, +0x9BF6,0x9BF7,0x9BF8,0x9BF9,0x9BFA,0x9BFB,0x9BFC,0x9BFD, +0xBDEE,0xBDEF,0x9BFE,0x9C41,0xBDF0,0x9C42,0x9C43,0xBDF1, +0xBDF2,0x9C44,0xBDF3,0x9C45,0x9C46,0x9C47,0x9C48,0x9C49, +0xBDF4,0xBDF5,0x9C4A,0x9C4B,0x9C4C,0xBDF6,0x9C4D,0x9C4E, +0x9C4F,0x9C50,0x9C51,0x9C52,0xBDF7,0xBDF8,0x9C53,0x9C54, +0xBDF9,0x9C55,0x9C56,0x9C57,0x9C58,0x9C59,0x9C5A,0x9C61, +0x9C62,0x9C63,0x9C64,0x9C65,0x9C66,0x9C67,0x9C68,0x9C69, +0xBDFA,0x9C6A,0x9C6B,0x9C6C,0x9C6D,0x9C6E,0x9C6F,0x9C70, +0xBDFB,0x9C71,0x9C72,0x9C73,0x9C74,0x9C75,0x9C76,0x9C77, +0x9C78,0x9C79,0x9C7A,0x9C81,0x9C82,0x9C83,0x9C84,0x9C85, +0x9C86,0x9C87,0x9C88,0x9C89,0xBDFC,0x9C8A,0x9C8B,0x9C8C, +0x9C8D,0x9C8E,0x9C8F,0x9C90,0xBDFD,0x9C91,0x9C92,0x9C93, +0xBDFE,0x9C94,0x9C95,0x9C96,0xBEA1,0x9C97,0x9C98,0x9C99, +0x9C9A,0x9C9B,0x9C9C,0x9C9D,0xBEA2,0xBEA3,0x9C9E,0x9C9F, +0x9CA0,0x9CA1,0x9CA2,0x9CA3,0x9CA4,0x9CA5,0x9CA6,0x9CA7, +0xBEA4,0x9CA8,0x9CA9,0x9CAA,0x9CAB,0x9CAC,0x9CAD,0x9CAE, +0x9CAF,0x9CB0,0x9CB1,0x9CB2,0x9CB3,0x9CB4,0x9CB5,0x9CB6, +0x9CB7,0x9CB8,0x9CB9,0x9CBA,0x9CBB,0x9CBC,0x9CBD,0x9CBE, +0x9CBF,0x9CC0,0x9CC1,0x9CC2,0xBEA5,0xBEA6,0x9CC3,0x9CC4, +0xBEA7,0x9CC5,0x9CC6,0x9CC7,0xBEA8,0x9CC8,0x9CC9,0x9CCA, +0x9CCB,0x9CCC,0x9CCD,0x9CCE,0xBEA9,0xBEAA,0x9CCF,0x9CD0, +0x9CD1,0xBEAB,0x9CD2,0x9CD3,0x9CD4,0x9CD5,0x9CD6,0x9CD7, +0xBEAC,0x9CD8,0x9CD9,0x9CDA,0x9CDB,0x9CDC,0x9CDD,0x9CDE, +0x9CDF,0x9CE0,0x9CE1,0x9CE2,0x9CE3,0x9CE4,0x9CE5,0x9CE6, +0x9CE7,0x9CE8,0x9CE9,0x9CEA,0xBEAD,0x9CEB,0x9CEC,0x9CED, +0x9CEE,0x9CEF,0x9CF0,0x9CF1,0xBEAE,0x9CF2,0x9CF3,0x9CF4, +0x9CF5,0x9CF6,0x9CF7,0x9CF8,0x9CF9,0x9CFA,0x9CFB,0x9CFC, +0x9CFD,0x9CFE,0x9D41,0x9D42,0x9D43,0x9D44,0x9D45,0x9D46, +0x9D47,0x9D48,0x9D49,0x9D4A,0x9D4B,0x9D4C,0x9D4D,0x9D4E, +0xBEAF,0x9D4F,0x9D50,0x9D51,0xBEB0,0x9D52,0x9D53,0x9D54, +0x9D55,0x9D56,0x9D57,0x9D58,0x9D59,0x9D5A,0x9D61,0x9D62, +0x9D63,0x9D64,0x9D65,0x9D66,0x9D67,0x9D68,0x9D69,0x9D6A, +0x9D6B,0x9D6C,0x9D6D,0x9D6E,0x9D6F,0x9D70,0x9D71,0x9D72, +0x9D73,0x9D74,0x9D75,0x9D76,0x9D77,0x9D78,0x9D79,0x9D7A, +0x9D81,0x9D82,0x9D83,0x9D84,0x9D85,0x9D86,0x9D87,0x9D88, +0x9D89,0xBEB1,0x9D8A,0x9D8B,0x9D8C,0x9D8D,0x9D8E,0x9D8F, +0xBEB2,0xBEB3,0x9D90,0x9D91,0xBEB4,0x9D92,0x9D93,0x9D94, +0xBEB5,0x9D95,0xBEB6,0x9D96,0x9D97,0x9D98,0x9D99,0xBEB7, +0xBEB8,0xBEB9,0x9D9A,0x9D9B,0x9D9C,0x9D9D,0x9D9E,0x9D9F, +0x9DA0,0x9DA1,0x9DA2,0x9DA3,0xBEBA,0x9DA4,0x9DA5,0x9DA6, +0xBEBB,0x9DA7,0x9DA8,0x9DA9,0xBEBC,0x9DAA,0x9DAB,0x9DAC, +0x9DAD,0x9DAE,0x9DAF,0x9DB0,0xBEBD,0x9DB1,0x9DB2,0x9DB3, +0x9DB4,0x9DB5,0x9DB6,0x9DB7,0x9DB8,0x9DB9,0x9DBA,0x9DBB, +0xBEBE,0xBEBF,0x9DBC,0x9DBD,0xBEC0,0x9DBE,0x9DBF,0x9DC0, +0xBEC1,0x9DC1,0x9DC2,0x9DC3,0x9DC4,0x9DC5,0x9DC6,0x9DC7, +0xBEC2,0xBEC3,0x9DC8,0xBEC4,0x9DC9,0xBEC5,0x9DCA,0x9DCB, +0x9DCC,0x9DCD,0x9DCE,0x9DCF,0xBEC6,0xBEC7,0x9DD0,0x9DD1, +0xBEC8,0xBEC9,0xBECA,0x9DD2,0xBECB,0xBECC,0xBECD,0x9DD3, +0x9DD4,0x9DD5,0x9DD6,0xBECE,0xBECF,0xBED0,0x9DD7,0xBED1, +0xBED2,0xBED3,0x9DD8,0x9DD9,0x9DDA,0xBED4,0xBED5,0x9DDB, +0xBED6,0xBED7,0x9DDC,0x9DDD,0xBED8,0x9DDE,0x9DDF,0x9DE0, +0xBED9,0x9DE1,0x9DE2,0x9DE3,0x9DE4,0x9DE5,0x9DE6,0x9DE7, +0xBEDA,0xBEDB,0x9DE8,0xBEDC,0xBEDD,0xBEDE,0x9DE9,0x9DEA, +0x9DEB,0x9DEC,0x9DED,0x9DEE,0xBEDF,0xBEE0,0x9DEF,0x9DF0, +0xBEE1,0x9DF1,0x9DF2,0x9DF3,0xBEE2,0x9DF4,0x9DF5,0xBEE3, +0x9DF6,0x9DF7,0x9DF8,0x9DF9,0xBEE4,0xBEE5,0x9DFA,0xBEE6, +0x9DFB,0xBEE7,0x9DFC,0x9DFD,0x9DFE,0xBEE8,0x9E41,0xBEE9, +0xBEEA,0x9E42,0x9E43,0x9E44,0xBEEB,0x9E45,0x9E46,0x9E47, +0xBEEC,0x9E48,0x9E49,0x9E4A,0x9E4B,0x9E4C,0x9E4D,0x9E4E, +0x9E4F,0xBEED,0x9E50,0x9E51,0x9E52,0x9E53,0x9E54,0x9E55, +0x9E56,0x9E57,0x9E58,0x9E59,0xBEEE,0xBEEF,0x9E5A,0x9E61, +0xBEF0,0xBEF1,0x9E62,0xBEF2,0xBEF3,0xBEF4,0xBEF5,0x9E63, +0x9E64,0x9E65,0x9E66,0x9E67,0xBEF6,0xBEF7,0xBEF8,0xBEF9, +0xBEFA,0xBEFB,0xBEFC,0x9E68,0xBEFD,0x9E69,0xBEFE,0x9E6A, +0xBFA1,0xBFA2,0x9E6B,0x9E6C,0xBFA3,0x9E6D,0x9E6E,0x9E6F, +0xBFA4,0x9E70,0x9E71,0x9E72,0x9E73,0x9E74,0x9E75,0x9E76, +0xBFA5,0xBFA6,0x9E77,0xBFA7,0x9E78,0xBFA8,0x9E79,0x9E7A, +0x9E81,0x9E82,0x9E83,0x9E84,0xBFA9,0xBFAA,0xBFAB,0x9E85, +0xBFAC,0x9E86,0x9E87,0x9E88,0xBFAD,0x9E89,0xBFAE,0xBFAF, +0x9E8A,0x9E8B,0x9E8C,0x9E8D,0xBFB0,0xBFB1,0xBFB2,0xBFB3, +0xBFB4,0xBFB5,0x9E8E,0x9E8F,0x9E90,0xBFB6,0xBFB7,0xBFB8, +0xBFB9,0x9E91,0x9E92,0x9E93,0xBFBA,0x9E94,0x9E95,0x9E96, +0xBFBB,0x9E97,0x9E98,0x9E99,0x9E9A,0x9E9B,0x9E9C,0x9E9D, +0xBFBC,0xBFBD,0x9E9E,0xBFBE,0xBFBF,0x9E9F,0x9EA0,0x9EA1, +0x9EA2,0x9EA3,0x9EA4,0x9EA5,0xBFC0,0xBFC1,0x9EA6,0x9EA7, +0xBFC2,0x9EA8,0x9EA9,0x9EAA,0xBFC3,0xBFC4,0xBFC5,0x9EAB, +0xBFC6,0x9EAC,0x9EAD,0xBFC7,0xBFC8,0xBFC9,0x9EAE,0xBFCA, +0x9EAF,0xBFCB,0x9EB0,0xBFCC,0x9EB1,0x9EB2,0x9EB3,0x9EB4, +0xBFCD,0xBFCE,0x9EB5,0x9EB6,0xBFCF,0x9EB7,0x9EB8,0x9EB9, +0xBFD0,0x9EBA,0x9EBB,0x9EBC,0x9EBD,0x9EBE,0x9EBF,0x9EC0, +0xBFD1,0xBFD2,0x9EC1,0xBFD3,0xBFD4,0xBFD5,0x9EC2,0x9EC3, +0x9EC4,0x9EC5,0x9EC6,0x9EC7,0xBFD6,0xBFD7,0x9EC8,0x9EC9, +0xBFD8,0x9ECA,0x9ECB,0x9ECC,0x9ECD,0x9ECE,0x9ECF,0x9ED0, +0x9ED1,0x9ED2,0x9ED3,0x9ED4,0xBFD9,0x9ED5,0x9ED6,0xBFDA, +0x9ED7,0xBFDB,0x9ED8,0x9ED9,0x9EDA,0x9EDB,0x9EDC,0x9EDD, +0xBFDC,0xBFDD,0x9EDE,0x9EDF,0xBFDE,0x9EE0,0x9EE1,0x9EE2, +0xBFDF,0x9EE3,0x9EE4,0x9EE5,0x9EE6,0x9EE7,0x9EE8,0x9EE9, +0xBFE0,0xBFE1,0x9EEA,0xBFE2,0x9EEB,0xBFE3,0x9EEC,0x9EED, +0x9EEE,0x9EEF,0x9EF0,0x9EF1,0xBFE4,0xBFE5,0x9EF2,0x9EF3, +0xBFE6,0x9EF4,0x9EF5,0x9EF6,0xBFE7,0x9EF7,0x9EF8,0x9EF9, +0x9EFA,0x9EFB,0x9EFC,0x9EFD,0xBFE8,0xBFE9,0x9EFE,0xBFEA, +0x9F41,0xBFEB,0x9F42,0x9F43,0x9F44,0x9F45,0x9F46,0x9F47, +0xBFEC,0xBFED,0x9F48,0x9F49,0xBFEE,0x9F4A,0x9F4B,0x9F4C, +0xBFEF,0xBFF0,0xBFF1,0x9F4D,0x9F4E,0x9F4F,0x9F50,0x9F51, +0xBFF2,0xBFF3,0x9F52,0xBFF4,0x9F53,0xBFF5,0x9F54,0x9F55, +0x9F56,0x9F57,0x9F58,0x9F59,0xBFF6,0xBFF7,0x9F5A,0x9F61, +0xBFF8,0x9F62,0x9F63,0x9F64,0xBFF9,0x9F65,0x9F66,0x9F67, +0x9F68,0x9F69,0x9F6A,0x9F6B,0xBFFA,0xBFFB,0x9F6C,0x9F6D, +0xBFFC,0xBFFD,0x9F6E,0x9F6F,0x9F70,0x9F71,0x9F72,0x9F73, +0xBFFE,0xC0A1,0x9F74,0x9F75,0xC0A2,0x9F76,0x9F77,0x9F78, +0xC0A3,0x9F79,0x9F7A,0x9F81,0x9F82,0x9F83,0x9F84,0x9F85, +0xC0A4,0xC0A5,0x9F86,0x9F87,0x9F88,0xC0A6,0x9F89,0x9F8A, +0x9F8B,0x9F8C,0x9F8D,0x9F8E,0xC0A7,0xC0A8,0x9F8F,0x9F90, +0xC0A9,0x9F91,0x9F92,0x9F93,0xC0AA,0x9F94,0x9F95,0x9F96, +0x9F97,0x9F98,0x9F99,0x9F9A,0xC0AB,0xC0AC,0x9F9B,0xC0AD, +0x9F9C,0xC0AE,0x9F9D,0x9F9E,0x9F9F,0x9FA0,0x9FA1,0x9FA2, +0xC0AF,0xC0B0,0x9FA3,0x9FA4,0xC0B1,0x9FA5,0x9FA6,0x9FA7, +0xC0B2,0x9FA8,0x9FA9,0x9FAA,0x9FAB,0x9FAC,0x9FAD,0x9FAE, +0xC0B3,0xC0B4,0x9FAF,0xC0B5,0x9FB0,0xC0B6,0x9FB1,0xC0B7, +0x9FB2,0x9FB3,0x9FB4,0x9FB5,0xC0B8,0xC0B9,0x9FB6,0x9FB7, +0xC0BA,0x9FB8,0x9FB9,0x9FBA,0xC0BB,0x9FBB,0x9FBC,0x9FBD, +0x9FBE,0x9FBF,0xC0BC,0x9FC0,0xC0BD,0xC0BE,0x9FC1,0xC0BF, +0x9FC2,0xC0C0,0xC0C1,0xC0C2,0xC0C3,0xC0C4,0xC0C5,0xC0C6, +0xC0C7,0x9FC3,0x9FC4,0x9FC5,0xC0C8,0x9FC6,0x9FC7,0x9FC8, +0xC0C9,0x9FC9,0x9FCA,0x9FCB,0x9FCC,0x9FCD,0x9FCE,0x9FCF, +0xC0CA,0x9FD0,0x9FD1,0xC0CB,0x9FD2,0x9FD3,0x9FD4,0x9FD5, +0x9FD6,0x9FD7,0x9FD8,0x9FD9,0xC0CC,0xC0CD,0x9FDA,0x9FDB, +0xC0CE,0x9FDC,0x9FDD,0x9FDE,0xC0CF,0xC0D0,0xC0D1,0x9FDF, +0x9FE0,0x9FE1,0x9FE2,0xC0D2,0xC0D3,0xC0D4,0x9FE3,0xC0D5, +0xC0D6,0xC0D7,0xC0D8,0x9FE4,0x9FE5,0x9FE6,0xC0D9,0x9FE7, +0xC0DA,0xC0DB,0x9FE8,0x9FE9,0xC0DC,0x9FEA,0xC0DD,0xC0DE, +0xC0DF,0x9FEB,0xC0E0,0x9FEC,0x9FED,0x9FEE,0x9FEF,0x9FF0, +0xC0E1,0xC0E2,0x9FF1,0xC0E3,0xC0E4,0xC0E5,0xC0E6,0x9FF2, +0x9FF3,0x9FF4,0x9FF5,0x9FF6,0xC0E7,0xC0E8,0x9FF7,0x9FF8, +0xC0E9,0x9FF9,0x9FFA,0x9FFB,0xC0EA,0x9FFC,0x9FFD,0x9FFE, +0xA041,0xA042,0xA043,0xA044,0xC0EB,0xC0EC,0xA045,0xC0ED, +0xC0EE,0xC0EF,0xA046,0xA047,0xA048,0xA049,0xA04A,0xA04B, +0xC0F0,0xC0F1,0xA04C,0xA04D,0xC0F2,0xA04E,0xC0F3,0xA04F, +0xC0F4,0xA050,0xA051,0xA052,0xA053,0xA054,0xA055,0xA056, +0xC0F5,0xA057,0xA058,0xA059,0xA05A,0xC0F6,0xA061,0xA062, +0xA063,0xA064,0xA065,0xA066,0xC0F7,0xA067,0xA068,0xA069, +0xC0F8,0xA06A,0xA06B,0xA06C,0xC0F9,0xA06D,0xA06E,0xA06F, +0xA070,0xA071,0xA072,0xA073,0xA074,0xA075,0xA076,0xA077, +0xA078,0xA079,0xA07A,0xA081,0xA082,0xA083,0xA084,0xA085, +0xC0FA,0xC0FB,0xA086,0xA087,0xC0FC,0xA088,0xA089,0xA08A, +0xC0FD,0xA08B,0xC0FE,0xA08C,0xA08D,0xA08E,0xA08F,0xA090, +0xC1A1,0xC1A2,0xA091,0xC1A3,0xA092,0xC1A4,0xC1A5,0xA093, +0xA094,0xA095,0xA096,0xA097,0xC1A6,0xC1A7,0xA098,0xA099, +0xC1A8,0xA09A,0xA09B,0xA09C,0xC1A9,0xA09D,0xA09E,0xA09F, +0xA0A0,0xA0A1,0xA0A2,0xA0A3,0xC1AA,0xC1AB,0xA0A4,0xC1AC, +0xA0A5,0xC1AD,0xA0A6,0xA0A7,0xA0A8,0xA0A9,0xA0AA,0xA0AB, +0xC1AE,0xA0AC,0xA0AD,0xA0AE,0xC1AF,0xA0AF,0xA0B0,0xA0B1, +0xC1B0,0xA0B2,0xA0B3,0xA0B4,0xA0B5,0xA0B6,0xA0B7,0xA0B8, +0xC1B1,0xC1B2,0xA0B9,0xA0BA,0xC1B3,0xC1B4,0xA0BB,0xA0BC, +0xA0BD,0xA0BE,0xA0BF,0xA0C0,0xC1B5,0xA0C1,0xA0C2,0xA0C3, +0xA0C4,0xA0C5,0xA0C6,0xA0C7,0xA0C8,0xA0C9,0xA0CA,0xA0CB, +0xA0CC,0xA0CD,0xA0CE,0xA0CF,0xA0D0,0xA0D1,0xA0D2,0xA0D3, +0xA0D4,0xA0D5,0xA0D6,0xA0D7,0xA0D8,0xA0D9,0xA0DA,0xA0DB, +0xC1B6,0xC1B7,0xA0DC,0xA0DD,0xC1B8,0xA0DE,0xA0DF,0xA0E0, +0xC1B9,0xA0E1,0xC1BA,0xA0E2,0xA0E3,0xA0E4,0xA0E5,0xA0E6, +0xC1BB,0xC1BC,0xA0E7,0xC1BD,0xA0E8,0xC1BE,0xC1BF,0xC1C0, +0xA0E9,0xA0EA,0xA0EB,0xC1C1,0xC1C2,0xC1C3,0xA0EC,0xA0ED, +0xA0EE,0xA0EF,0xA0F0,0xA0F1,0xC1C4,0xA0F2,0xA0F3,0xA0F4, +0xA0F5,0xA0F6,0xA0F7,0xA0F8,0xA0F9,0xC1C5,0xA0FA,0xC1C6, +0xA0FB,0xC1C7,0xA0FC,0xA0FD,0xA0FE,0xA141,0xA142,0xA143, +0xC1C8,0xA144,0xA145,0xA146,0xA147,0xA148,0xA149,0xA14A, +0xA14B,0xA14C,0xA14D,0xA14E,0xA14F,0xA150,0xA151,0xA152, +0xA153,0xA154,0xA155,0xA156,0xC1C9,0xC1CA,0xA157,0xA158, +0xA159,0xA15A,0xA161,0xA162,0xC1CB,0xA163,0xA164,0xA165, +0xC1CC,0xA166,0xA167,0xA168,0xC1CD,0xA169,0xA16A,0xA16B, +0xA16C,0xA16D,0xA16E,0xA16F,0xC1CE,0xC1CF,0xA170,0xC1D0, +0xA171,0xC1D1,0xA172,0xA173,0xA174,0xA175,0xA176,0xA177, +0xC1D2,0xC1D3,0xA178,0xA179,0xC1D4,0xA17A,0xA181,0xA182, +0xA183,0xA184,0xA185,0xA186,0xA187,0xA188,0xA189,0xA18A, +0xA18B,0xA18C,0xA18D,0xA18E,0xA18F,0xC1D5,0xA190,0xA191, +0xA192,0xA193,0xA194,0xA195,0xC1D6,0xC1D7,0xA196,0xA197, +0xC1D8,0xA198,0xA199,0xA19A,0xC1D9,0xC1DA,0xC1DB,0xA19B, +0xA19C,0xA19D,0xA19E,0xA19F,0xC1DC,0xC1DD,0xA1A0,0xC1DE, +0xA241,0xC1DF,0xA242,0xA243,0xA244,0xA245,0xA246,0xA247, +0xC1E0,0xA248,0xA249,0xA24A,0xA24B,0xA24C,0xA24D,0xA24E, +0xA24F,0xA250,0xA251,0xA252,0xA253,0xA254,0xA255,0xA256, +0xA257,0xA258,0xA259,0xA25A,0xC1E1,0xA261,0xA262,0xA263, +0xA264,0xA265,0xA266,0xA267,0xC1E2,0xA268,0xA269,0xA26A, +0xA26B,0xA26C,0xA26D,0xA26E,0xA26F,0xA270,0xA271,0xA272, +0xA273,0xA274,0xA275,0xA276,0xA277,0xA278,0xA279,0xA27A, +0xA281,0xA282,0xA283,0xA284,0xA285,0xA286,0xA287,0xA288, +0xC1E3,0xC1E4,0xA289,0xA28A,0xC1E5,0xA28B,0xA28C,0xA28D, +0xC1E6,0xA28E,0xA28F,0xA290,0xA291,0xA292,0xA293,0xA294, +0xC1E7,0xC1E8,0xA295,0xC1E9,0xA296,0xA297,0xA298,0xA299, +0xA29A,0xA29B,0xA29C,0xA29D,0xC1EA,0xA29E,0xA29F,0xA2A0, +0xC1EB,0xA341,0xA342,0xA343,0xC1EC,0xA344,0xA345,0xA346, +0xA347,0xA348,0xA349,0xA34A,0xC1ED,0xA34B,0xA34C,0xA34D, +0xA34E,0xA34F,0xA350,0xA351,0xA352,0xA353,0xA354,0xA355, +0xC1EE,0xC1EF,0xA356,0xA357,0xC1F0,0xA358,0xA359,0xA35A, +0xC1F1,0xA361,0xA362,0xA363,0xA364,0xA365,0xA366,0xA367, +0xC1F2,0xC1F3,0xA368,0xC1F4,0xA369,0xC1F5,0xA36A,0xA36B, +0xA36C,0xA36D,0xA36E,0xA36F,0xA370,0xA371,0xA372,0xA373, +0xA374,0xA375,0xA376,0xA377,0xA378,0xA379,0xA37A,0xA381, +0xA382,0xA383,0xA384,0xA385,0xA386,0xA387,0xA388,0xA389, +0xA38A,0xA38B,0xA38C,0xA38D,0xA38E,0xA38F,0xA390,0xA391, +0xC1F6,0xC1F7,0xA392,0xA393,0xC1F8,0xA394,0xA395,0xC1F9, +0xC1FA,0xA396,0xC1FB,0xA397,0xA398,0xA399,0xA39A,0xA39B, +0xC1FC,0xC1FD,0xA39C,0xC1FE,0xA39D,0xC2A1,0xC2A2,0xA39E, +0xA39F,0xC2A3,0xC2A4,0xA3A0,0xC2A5,0xC2A6,0xA441,0xA442, +0xC2A7,0xA443,0xC2A8,0xA444,0xC2A9,0xA445,0xA446,0xC2AA, +0xA447,0xA448,0xA449,0xA44A,0xC2AB,0xC2AC,0xA44B,0xC2AD, +0xC2AE,0xC2AF,0xA44C,0xA44D,0xA44E,0xA44F,0xA450,0xA451, +0xC2B0,0xC2B1,0xA452,0xA453,0xC2B2,0xA454,0xA455,0xA456, +0xC2B3,0xA457,0xA458,0xA459,0xA45A,0xA461,0xA462,0xA463, +0xC2B4,0xC2B5,0xA464,0xC2B6,0xC2B7,0xC2B8,0xA465,0xA466, +0xA467,0xA468,0xA469,0xA46A,0xC2B9,0xA46B,0xA46C,0xA46D, +0xC2BA,0xA46E,0xA46F,0xA470,0xA471,0xA472,0xA473,0xA474, +0xA475,0xA476,0xA477,0xA478,0xA479,0xA47A,0xA481,0xA482, +0xA483,0xC2BB,0xA484,0xA485,0xA486,0xA487,0xA488,0xA489, +0xA48A,0xA48B,0xA48C,0xA48D,0xA48E,0xA48F,0xA490,0xA491, +0xA492,0xA493,0xA494,0xA495,0xA496,0xA497,0xA498,0xA499, +0xA49A,0xA49B,0xA49C,0xA49D,0xA49E,0xA49F,0xA4A0,0xA541, +0xA542,0xA543,0xA544,0xA545,0xC2BC,0xC2BD,0xA546,0xA547, +0xC2BE,0xA548,0xA549,0xA54A,0xC2BF,0xA54B,0xA54C,0xA54D, +0xA54E,0xA54F,0xA550,0xA551,0xC2C0,0xC2C1,0xA552,0xC2C2, +0xC2C3,0xC2C4,0xA553,0xA554,0xA555,0xA556,0xA557,0xA558, +0xC2C5,0xA559,0xA55A,0xA561,0xA562,0xA563,0xA564,0xA565, +0xA566,0xA567,0xA568,0xA569,0xA56A,0xA56B,0xA56C,0xA56D, +0xA56E,0xA56F,0xA570,0xA571,0xA572,0xC2C6,0xA573,0xA574, +0xA575,0xA576,0xA577,0xA578,0xC2C7,0xA579,0xA57A,0xA581, +0xA582,0xA583,0xA584,0xA585,0xA586,0xA587,0xA588,0xA589, +0xA58A,0xA58B,0xA58C,0xA58D,0xA58E,0xA58F,0xA590,0xA591, +0xC2C8,0xA592,0xA593,0xA594,0xA595,0xA596,0xA597,0xA598, +0xA599,0xA59A,0xA59B,0xA59C,0xA59D,0xA59E,0xA59F,0xA5A0, +0xA641,0xA642,0xA643,0xA644,0xA645,0xA646,0xA647,0xA648, +0xA649,0xA64A,0xA64B,0xA64C,0xA64D,0xA64E,0xA64F,0xA650, +0xA651,0xA652,0xA653,0xA654,0xC2C9,0xC2CA,0xA655,0xA656, +0xC2CB,0xA657,0xA658,0xA659,0xC2CC,0xA65A,0xA661,0xA662, +0xA663,0xA664,0xA665,0xA666,0xC2CD,0xC2CE,0xA667,0xC2CF, +0xA668,0xC2D0,0xA669,0xC2D1,0xA66A,0xA66B,0xA66C,0xA66D, +0xC2D2,0xC2D3,0xA66E,0xA66F,0xA670,0xA671,0xA672,0xA673, +0xC2D4,0xA674,0xA675,0xA676,0xA677,0xA678,0xA679,0xA67A, +0xA681,0xA682,0xA683,0xA684,0xC2D5,0xA685,0xA686,0xA687, +0xA688,0xA689,0xA68A,0xA68B,0xC2D6,0xA68C,0xA68D,0xA68E, +0xA68F,0xA690,0xA691,0xA692,0xA693,0xA694,0xA695,0xA696, +0xA697,0xA698,0xA699,0xA69A,0xA69B,0xA69C,0xA69D,0xA69E, +0xC2D7,0xA69F,0xA6A0,0xA741,0xA742,0xA743,0xA744,0xA745, +0xC2D8,0xA746,0xA747,0xA748,0xC2D9,0xA749,0xA74A,0xA74B, +0xC2DA,0xA74C,0xA74D,0xA74E,0xA74F,0xA750,0xA751,0xA752, +0xC2DB,0xC2DC,0xA753,0xA754,0xA755,0xA756,0xA757,0xA758, +0xA759,0xA75A,0xA761,0xA762,0xA763,0xA764,0xA765,0xA766, +0xA767,0xA768,0xA769,0xA76A,0xA76B,0xA76C,0xA76D,0xA76E, +0xA76F,0xA770,0xA771,0xA772,0xA773,0xA774,0xA775,0xA776, +0xA777,0xC2DD,0xA778,0xA779,0xA77A,0xA781,0xA782,0xA783, +0xC2DE,0xC2DF,0xA784,0xA785,0xC2E0,0xA786,0xA787,0xA788, +0xC2E1,0xA789,0xA78A,0xA78B,0xA78C,0xA78D,0xA78E,0xA78F, +0xC2E2,0xC2E3,0xA790,0xA791,0xA792,0xC2E4,0xA793,0xA794, +0xA795,0xA796,0xA797,0xA798,0xC2E5,0xA799,0xA79A,0xA79B, +0xA79C,0xA79D,0xA79E,0xA79F,0xA7A0,0xA841,0xA842,0xA843, +0xA844,0xA845,0xA846,0xA847,0xA848,0xA849,0xA84A,0xA84B, +0xC2E6,0xC2E7,0xA84C,0xA84D,0xA84E,0xA84F,0xA850,0xA851, +0xA852,0xA853,0xA854,0xA855,0xA856,0xA857,0xA858,0xA859, +0xA85A,0xA861,0xA862,0xA863,0xA864,0xA865,0xA866,0xA867, +0xA868,0xA869,0xA86A,0xA86B,0xA86C,0xA86D,0xA86E,0xA86F, +0xA870,0xA871,0xA872,0xA873,0xC2E8,0xA874,0xA875,0xA876, +0xA877,0xA878,0xA879,0xA87A,0xA881,0xA882,0xA883,0xA884, +0xA885,0xA886,0xA887,0xA888,0xA889,0xA88A,0xA88B,0xA88C, +0xA88D,0xA88E,0xA88F,0xA890,0xA891,0xA892,0xA893,0xA894, +0xC2E9,0xA895,0xA896,0xA897,0xA898,0xA899,0xA89A,0xA89B, +0xA89C,0xA89D,0xA89E,0xA89F,0xA8A0,0xA941,0xA942,0xA943, +0xA944,0xA945,0xA946,0xA947,0xA948,0xA949,0xA94A,0xA94B, +0xA94C,0xA94D,0xA94E,0xA94F,0xC2EA,0xA950,0xA951,0xA952, +0xA953,0xA954,0xA955,0xA956,0xA957,0xA958,0xA959,0xA95A, +0xA961,0xA962,0xA963,0xA964,0xC2EB,0xA965,0xA966,0xC2EC, +0xA967,0xC2ED,0xA968,0xA969,0xA96A,0xA96B,0xA96C,0xA96D, +0xA96E,0xA96F,0xA970,0xA971,0xA972,0xA973,0xA974,0xA975, +0xA976,0xA977,0xA978,0xA979,0xA97A,0xA981,0xA982,0xA983, +0xA984,0xA985,0xA986,0xA987,0xA988,0xA989,0xA98A,0xA98B, +0xA98C,0xA98D,0xA98E,0xA98F,0xC2EE,0xC2EF,0xA990,0xA991, +0xC2F0,0xA992,0xA993,0xA994,0xC2F1,0xA995,0xA996,0xA997, +0xA998,0xA999,0xA99A,0xA99B,0xC2F2,0xC2F3,0xA99C,0xA99D, +0xA99E,0xC2F4,0xC2F5,0xA99F,0xA9A0,0xAA41,0xAA42,0xC2F6, +0xC2F7,0xC2F8,0xAA43,0xAA44,0xC2F9,0xAA45,0xC2FA,0xAA46, +0xC2FB,0xAA47,0xAA48,0xAA49,0xAA4A,0xAA4B,0xAA4C,0xAA4D, +0xC2FC,0xC2FD,0xAA4E,0xC2FE,0xC3A1,0xC3A2,0xC3A3,0xAA4F, +0xAA50,0xAA51,0xAA52,0xAA53,0xC3A4,0xC3A5,0xAA54,0xAA55, +0xC3A6,0xAA56,0xAA57,0xAA58,0xC3A7,0xAA59,0xAA5A,0xAA61, +0xAA62,0xAA63,0xAA64,0xAA65,0xC3A8,0xC3A9,0xAA66,0xC3AA, +0xC3AB,0xC3AC,0xAA67,0xAA68,0xAA69,0xAA6A,0xAA6B,0xAA6C, +0xC3AD,0xAA6D,0xAA6E,0xAA6F,0xC3AE,0xAA70,0xC3AF,0xAA71, +0xC3B0,0xAA72,0xAA73,0xAA74,0xAA75,0xAA76,0xAA77,0xAA78, +0xC3B1,0xAA79,0xAA7A,0xAA81,0xAA82,0xC3B2,0xAA83,0xAA84, +0xAA85,0xAA86,0xAA87,0xAA88,0xAA89,0xAA8A,0xAA8B,0xAA8C, +0xAA8D,0xAA8E,0xAA8F,0xAA90,0xAA91,0xAA92,0xAA93,0xAA94, +0xAA95,0xAA96,0xAA97,0xAA98,0xAA99,0xAA9A,0xAA9B,0xAA9C, +0xAA9D,0xAA9E,0xAA9F,0xAAA0,0xAB41,0xAB42,0xAB43,0xAB44, +0xC3B3,0xC3B4,0xAB45,0xAB46,0xC3B5,0xAB47,0xAB48,0xAB49, +0xC3B6,0xAB4A,0xAB4B,0xAB4C,0xAB4D,0xAB4E,0xAB4F,0xAB50, +0xC3B7,0xC3B8,0xAB51,0xC3B9,0xC3BA,0xC3BB,0xAB52,0xAB53, +0xAB54,0xAB55,0xAB56,0xAB57,0xC3BC,0xC3BD,0xAB58,0xAB59, +0xC3BE,0xAB5A,0xAB61,0xAB62,0xC3BF,0xAB63,0xAB64,0xAB65, +0xAB66,0xAB67,0xAB68,0xAB69,0xC3C0,0xC3C1,0xAB6A,0xC3C2, +0xAB6B,0xC3C3,0xAB6C,0xAB6D,0xAB6E,0xAB6F,0xAB70,0xAB71, +0xC3C4,0xAB72,0xAB73,0xAB74,0xC3C5,0xAB75,0xAB76,0xAB77, +0xAB78,0xAB79,0xAB7A,0xAB81,0xAB82,0xAB83,0xAB84,0xAB85, +0xAB86,0xAB87,0xAB88,0xAB89,0xC3C6,0xAB8A,0xAB8B,0xAB8C, +0xAB8D,0xAB8E,0xAB8F,0xAB90,0xC3C7,0xAB91,0xAB92,0xAB93, +0xC3C8,0xAB94,0xAB95,0xAB96,0xAB97,0xAB98,0xAB99,0xAB9A, +0xAB9B,0xAB9C,0xAB9D,0xAB9E,0xAB9F,0xABA0,0xAC41,0xAC42, +0xAC43,0xC3C9,0xAC44,0xAC45,0xAC46,0xAC47,0xAC48,0xAC49, +0xC3CA,0xC3CB,0xAC4A,0xAC4B,0xC3CC,0xAC4C,0xAC4D,0xAC4E, +0xC3CD,0xAC4F,0xAC50,0xAC51,0xAC52,0xAC53,0xAC54,0xAC55, +0xC3CE,0xC3CF,0xAC56,0xC3D0,0xAC57,0xC3D1,0xAC58,0xAC59, +0xAC5A,0xAC61,0xAC62,0xAC63,0xC3D2,0xAC64,0xAC65,0xAC66, +0xC3D3,0xAC67,0xAC68,0xAC69,0xC3D4,0xAC6A,0xAC6B,0xAC6C, +0xAC6D,0xAC6E,0xAC6F,0xAC70,0xAC71,0xAC72,0xAC73,0xAC74, +0xAC75,0xC3D5,0xAC76,0xAC77,0xAC78,0xAC79,0xAC7A,0xAC81, +0xAC82,0xAC83,0xAC84,0xAC85,0xAC86,0xAC87,0xAC88,0xAC89, +0xAC8A,0xAC8B,0xAC8C,0xAC8D,0xAC8E,0xAC8F,0xAC90,0xAC91, +0xAC92,0xAC93,0xAC94,0xAC95,0xAC96,0xAC97,0xAC98,0xAC99, +0xAC9A,0xAC9B,0xAC9C,0xAC9D,0xC3D6,0xAC9E,0xAC9F,0xACA0, +0xC3D7,0xAD41,0xAD42,0xAD43,0xC3D8,0xAD44,0xAD45,0xAD46, +0xAD47,0xAD48,0xAD49,0xAD4A,0xC3D9,0xC3DA,0xAD4B,0xC3DB, +0xAD4C,0xC3DC,0xAD4D,0xAD4E,0xAD4F,0xAD50,0xAD51,0xAD52, +0xC3DD,0xAD53,0xAD54,0xAD55,0xAD56,0xAD57,0xAD58,0xAD59, +0xAD5A,0xAD61,0xAD62,0xAD63,0xAD64,0xAD65,0xAD66,0xAD67, +0xC3DE,0xAD68,0xAD69,0xAD6A,0xAD6B,0xAD6C,0xAD6D,0xAD6E, +0xAD6F,0xAD70,0xAD71,0xAD72,0xC3DF,0xC3E0,0xAD73,0xAD74, +0xC3E1,0xAD75,0xAD76,0xAD77,0xC3E2,0xAD78,0xAD79,0xAD7A, +0xAD81,0xAD82,0xAD83,0xAD84,0xC3E3,0xC3E4,0xAD85,0xC3E5, +0xAD86,0xC3E6,0xAD87,0xAD88,0xAD89,0xAD8A,0xAD8B,0xAD8C, +0xC3E7,0xAD8D,0xAD8E,0xAD8F,0xAD90,0xAD91,0xAD92,0xAD93, +0xAD94,0xAD95,0xAD96,0xAD97,0xAD98,0xAD99,0xAD9A,0xAD9B, +0xAD9C,0xAD9D,0xAD9E,0xAD9F,0xC3E8,0xADA0,0xAE41,0xAE42, +0xAE43,0xAE44,0xAE45,0xAE46,0xC3E9,0xAE47,0xAE48,0xAE49, +0xC3EA,0xAE4A,0xAE4B,0xAE4C,0xAE4D,0xAE4E,0xAE4F,0xAE50, +0xAE51,0xAE52,0xAE53,0xAE54,0xAE55,0xAE56,0xAE57,0xAE58, +0xAE59,0xAE5A,0xAE61,0xAE62,0xAE63,0xAE64,0xAE65,0xAE66, +0xC3EB,0xAE67,0xAE68,0xAE69,0xC3EC,0xAE6A,0xAE6B,0xAE6C, +0xC3ED,0xAE6D,0xAE6E,0xAE6F,0xAE70,0xAE71,0xAE72,0xAE73, +0xC3EE,0xC3EF,0xAE74,0xC3F0,0xAE75,0xC3F1,0xAE76,0xAE77, +0xAE78,0xAE79,0xAE7A,0xAE81,0xC3F2,0xAE82,0xAE83,0xAE84, +0xC3F3,0xAE85,0xAE86,0xAE87,0xC3F4,0xAE88,0xAE89,0xAE8A, +0xAE8B,0xAE8C,0xAE8D,0xAE8E,0xC3F5,0xAE8F,0xAE90,0xAE91, +0xAE92,0xC3F6,0xAE93,0xAE94,0xAE95,0xAE96,0xAE97,0xAE98, +0xC3F7,0xC3F8,0xAE99,0xAE9A,0xC3F9,0xAE9B,0xAE9C,0xAE9D, +0xC3FA,0xAE9E,0xAE9F,0xAEA0,0xAF41,0xAF42,0xAF43,0xAF44, +0xC3FB,0xC3FC,0xAF45,0xC3FD,0xAF46,0xC3FE,0xAF47,0xAF48, +0xAF49,0xAF4A,0xAF4B,0xAF4C,0xAF4D,0xAF4E,0xAF4F,0xAF50, +0xAF51,0xAF52,0xAF53,0xAF54,0xAF55,0xAF56,0xAF57,0xAF58, +0xAF59,0xAF5A,0xAF61,0xAF62,0xAF63,0xAF64,0xAF65,0xAF66, +0xAF67,0xAF68,0xAF69,0xAF6A,0xAF6B,0xAF6C,0xAF6D,0xAF6E, +0xC4A1,0xC4A2,0xAF6F,0xAF70,0xC4A3,0xAF71,0xAF72,0xC4A4, +0xC4A5,0xC4A6,0xAF73,0xAF74,0xAF75,0xAF76,0xAF77,0xAF78, +0xC4A7,0xC4A8,0xAF79,0xC4A9,0xAF7A,0xC4AA,0xAF81,0xAF82, +0xAF83,0xAF84,0xAF85,0xAF86,0xC4AB,0xC4AC,0xAF87,0xAF88, +0xC4AD,0xAF89,0xAF8A,0xAF8B,0xC4AE,0xAF8C,0xAF8D,0xAF8E, +0xAF8F,0xAF90,0xAF91,0xAF92,0xC4AF,0xC4B0,0xAF93,0xC4B1, +0xAF94,0xC4B2,0xAF95,0xAF96,0xAF97,0xAF98,0xAF99,0xAF9A, +0xC4B3,0xC4B4,0xAF9B,0xAF9C,0xC4B5,0xAF9D,0xAF9E,0xAF9F, +0xC4B6,0xAFA0,0xB041,0xB042,0xB043,0xB044,0xB045,0xB046, +0xC4B7,0xC4B8,0xB047,0xC4B9,0xC4BA,0xC4BB,0xB048,0xB049, +0xB04A,0xB04B,0xB04C,0xB04D,0xC4BC,0xC4BD,0xB04E,0xB04F, +0xB050,0xB051,0xB052,0xB053,0xB054,0xB055,0xB056,0xB057, +0xB058,0xB059,0xB05A,0xB061,0xB062,0xB063,0xB064,0xB065, +0xB066,0xC4BE,0xB067,0xB068,0xB069,0xB06A,0xB06B,0xB06C, +0xB06D,0xB06E,0xB06F,0xB070,0xB071,0xB072,0xB073,0xB074, +0xB075,0xB076,0xB077,0xB078,0xB079,0xB07A,0xB081,0xB082, +0xB083,0xB084,0xB085,0xB086,0xB087,0xB088,0xB089,0xB08A, +0xB08B,0xB08C,0xB08D,0xB08E,0xC4BF,0xC4C0,0xB08F,0xB090, +0xC4C1,0xB091,0xB092,0xC4C2,0xC4C3,0xB093,0xB094,0xB095, +0xB096,0xB097,0xB098,0xB099,0xC4C4,0xC4C5,0xB09A,0xC4C6, +0xC4C7,0xC4C8,0xB09B,0xB09C,0xB09D,0xB09E,0xB09F,0xB0A0, +0xC4C9,0xC4CA,0xB141,0xB142,0xC4CB,0xB143,0xB144,0xB145, +0xC4CC,0xB146,0xB147,0xB148,0xB149,0xB14A,0xB14B,0xB14C, +0xC4CD,0xC4CE,0xB14D,0xC4CF,0xB14E,0xC4D0,0xB14F,0xB150, +0xB151,0xB152,0xB153,0xB154,0xC4D1,0xB155,0xB156,0xB157, +0xC4D2,0xB158,0xB159,0xB15A,0xC4D3,0xB161,0xB162,0xB163, +0xB164,0xB165,0xB166,0xB167,0xC4D4,0xC4D5,0xB168,0xC4D6, +0xC4D7,0xC4D8,0xB169,0xB16A,0xB16B,0xB16C,0xB16D,0xB16E, +0xC4D9,0xB16F,0xB170,0xB171,0xB172,0xB173,0xB174,0xB175, +0xB176,0xB177,0xB178,0xB179,0xB17A,0xB181,0xB182,0xB183, +0xB184,0xB185,0xB186,0xB187,0xB188,0xB189,0xB18A,0xB18B, +0xB18C,0xB18D,0xB18E,0xB18F,0xC4DA,0xC4DB,0xB190,0xB191, +0xC4DC,0xB192,0xB193,0xB194,0xC4DD,0xB195,0xB196,0xB197, +0xB198,0xB199,0xB19A,0xB19B,0xC4DE,0xC4DF,0xB19C,0xC4E0, +0xB19D,0xC4E1,0xB19E,0xB19F,0xB1A0,0xB241,0xB242,0xB243, +0xC4E2,0xC4E3,0xB244,0xB245,0xC4E4,0xB246,0xB247,0xB248, +0xC4E5,0xB249,0xB24A,0xB24B,0xB24C,0xB24D,0xB24E,0xB24F, +0xC4E6,0xB250,0xB251,0xB252,0xB253,0xC4E7,0xB254,0xB255, +0xB256,0xB257,0xB258,0xB259,0xC4E8,0xB25A,0xB261,0xB262, +0xB263,0xB264,0xB265,0xB266,0xB267,0xB268,0xB269,0xB26A, +0xB26B,0xB26C,0xB26D,0xB26E,0xB26F,0xB270,0xB271,0xB272, +0xB273,0xC4E9,0xB274,0xB275,0xB276,0xB277,0xB278,0xB279, +0xC4EA,0xB27A,0xB281,0xB282,0xB283,0xB284,0xB285,0xB286, +0xC4EB,0xB287,0xB288,0xB289,0xB28A,0xB28B,0xB28C,0xB28D, +0xB28E,0xB28F,0xB290,0xB291,0xB292,0xB293,0xB294,0xB295, +0xB296,0xB297,0xB298,0xB299,0xC4EC,0xB29A,0xB29B,0xB29C, +0xB29D,0xB29E,0xB29F,0xB2A0,0xB341,0xB342,0xB343,0xB344, +0xB345,0xB346,0xB347,0xB348,0xB349,0xB34A,0xB34B,0xB34C, +0xB34D,0xB34E,0xB34F,0xB350,0xB351,0xB352,0xB353,0xB354, +0xC4ED,0xC4EE,0xB355,0xB356,0xC4EF,0xB357,0xB358,0xB359, +0xC4F0,0xB35A,0xB361,0xB362,0xB363,0xB364,0xB365,0xB366, +0xC4F1,0xC4F2,0xB367,0xC4F3,0xB368,0xC4F4,0xB369,0xB36A, +0xB36B,0xB36C,0xB36D,0xB36E,0xC4F5,0xB36F,0xB370,0xB371, +0xC4F6,0xB372,0xB373,0xB374,0xC4F7,0xB375,0xB376,0xB377, +0xB378,0xB379,0xB37A,0xB381,0xB382,0xB383,0xB384,0xB385, +0xB386,0xC4F8,0xB387,0xB388,0xB389,0xB38A,0xB38B,0xB38C, +0xC4F9,0xB38D,0xB38E,0xB38F,0xB390,0xB391,0xB392,0xB393, +0xB394,0xB395,0xB396,0xB397,0xB398,0xB399,0xB39A,0xB39B, +0xB39C,0xB39D,0xB39E,0xB39F,0xB3A0,0xC4FA,0xB441,0xB442, +0xB443,0xB444,0xB445,0xB446,0xC4FB,0xC4FC,0xB447,0xB448, +0xC4FD,0xB449,0xB44A,0xB44B,0xC4FE,0xB44C,0xB44D,0xB44E, +0xB44F,0xB450,0xB451,0xB452,0xC5A1,0xC5A2,0xB453,0xC5A3, +0xB454,0xC5A4,0xB455,0xB456,0xB457,0xB458,0xB459,0xB45A, +0xC5A5,0xB461,0xB462,0xB463,0xC5A6,0xB464,0xB465,0xB466, +0xC5A7,0xB467,0xB468,0xB469,0xB46A,0xB46B,0xB46C,0xB46D, +0xC5A8,0xB46E,0xB46F,0xB470,0xB471,0xB472,0xB473,0xB474, +0xB475,0xB476,0xB477,0xB478,0xC5A9,0xC5AA,0xB479,0xB47A, +0xC5AB,0xB481,0xB482,0xB483,0xC5AC,0xB484,0xB485,0xB486, +0xB487,0xB488,0xB489,0xB48A,0xC5AD,0xC5AE,0xB48B,0xB48C, +0xB48D,0xC5AF,0xB48E,0xB48F,0xB490,0xB491,0xB492,0xB493, +0xB494,0xB495,0xB496,0xB497,0xB498,0xB499,0xB49A,0xB49B, +0xB49C,0xB49D,0xB49E,0xB49F,0xB4A0,0xB541,0xB542,0xB543, +0xB544,0xB545,0xB546,0xB547,0xB548,0xB549,0xB54A,0xB54B, +0xB54C,0xB54D,0xB54E,0xB54F,0xC5B0,0xC5B1,0xB550,0xB551, +0xC5B2,0xB552,0xB553,0xB554,0xC5B3,0xB555,0xB556,0xB557, +0xB558,0xB559,0xB55A,0xB561,0xC5B4,0xC5B5,0xB562,0xC5B6, +0xB563,0xC5B7,0xB564,0xB565,0xB566,0xB567,0xB568,0xB569, +0xC5B8,0xC5B9,0xB56A,0xB56B,0xC5BA,0xB56C,0xB56D,0xB56E, +0xC5BB,0xC5BC,0xB56F,0xB570,0xB571,0xB572,0xB573,0xB574, +0xC5BD,0xC5BE,0xB575,0xC5BF,0xC5C0,0xC5C1,0xB576,0xB577, +0xB578,0xB579,0xB57A,0xB581,0xC5C2,0xC5C3,0xB582,0xB583, +0xC5C4,0xB584,0xB585,0xB586,0xC5C5,0xB587,0xB588,0xB589, +0xB58A,0xB58B,0xB58C,0xB58D,0xC5C6,0xC5C7,0xB58E,0xC5C8, +0xC5C9,0xC5CA,0xB58F,0xB590,0xB591,0xB592,0xB593,0xB594, +0xC5CB,0xB595,0xB596,0xB597,0xB598,0xB599,0xB59A,0xB59B, +0xB59C,0xB59D,0xB59E,0xB59F,0xB5A0,0xB641,0xB642,0xB643, +0xB644,0xB645,0xB646,0xB647,0xB648,0xC5CC,0xB649,0xB64A, +0xB64B,0xB64C,0xB64D,0xB64E,0xB64F,0xB650,0xB651,0xB652, +0xB653,0xB654,0xB655,0xB656,0xB657,0xB658,0xB659,0xB65A, +0xB661,0xB662,0xB663,0xB664,0xB665,0xB666,0xB667,0xB668, +0xB669,0xB66A,0xB66B,0xB66C,0xB66D,0xB66E,0xB66F,0xB670, +0xC5CD,0xC5CE,0xB671,0xB672,0xC5CF,0xB673,0xB674,0xB675, +0xC5D0,0xB676,0xC5D1,0xB677,0xB678,0xB679,0xB67A,0xB681, +0xC5D2,0xC5D3,0xB682,0xC5D4,0xC5D5,0xC5D6,0xB683,0xB684, +0xB685,0xB686,0xB687,0xB688,0xC5D7,0xC5D8,0xB689,0xB68A, +0xC5D9,0xB68B,0xB68C,0xB68D,0xC5DA,0xB68E,0xB68F,0xB690, +0xB691,0xB692,0xB693,0xB694,0xC5DB,0xC5DC,0xB695,0xC5DD, +0xB696,0xC5DE,0xB697,0xB698,0xB699,0xB69A,0xB69B,0xB69C, +0xC5DF,0xB69D,0xB69E,0xB69F,0xC5E0,0xB6A0,0xB741,0xB742, +0xB743,0xB744,0xB745,0xB746,0xB747,0xB748,0xB749,0xB74A, +0xB74B,0xB74C,0xB74D,0xB74E,0xC5E1,0xB74F,0xB750,0xB751, +0xB752,0xB753,0xB754,0xB755,0xC5E2,0xB756,0xB757,0xB758, +0xC5E3,0xB759,0xB75A,0xB761,0xB762,0xB763,0xB764,0xB765, +0xB766,0xB767,0xB768,0xB769,0xB76A,0xB76B,0xB76C,0xB76D, +0xB76E,0xB76F,0xB770,0xB771,0xB772,0xB773,0xB774,0xB775, +0xC5E4,0xC5E5,0xB776,0xB777,0xC5E6,0xB778,0xB779,0xB77A, +0xC5E7,0xB781,0xB782,0xB783,0xB784,0xB785,0xB786,0xB787, +0xC5E8,0xC5E9,0xB788,0xC5EA,0xB789,0xC5EB,0xB78A,0xB78B, +0xB78C,0xB78D,0xC5EC,0xB78E,0xC5ED,0xB78F,0xB790,0xB791, +0xC5EE,0xB792,0xB793,0xB794,0xB795,0xB796,0xB797,0xB798, +0xB799,0xB79A,0xB79B,0xB79C,0xB79D,0xB79E,0xB79F,0xB7A0, +0xB841,0xB842,0xB843,0xB844,0xB845,0xB846,0xB847,0xB848, +0xC5EF,0xB849,0xB84A,0xB84B,0xB84C,0xB84D,0xB84E,0xB84F, +0xB850,0xB851,0xB852,0xB853,0xB854,0xB855,0xB856,0xB857, +0xB858,0xB859,0xB85A,0xB861,0xB862,0xB863,0xB864,0xB865, +0xB866,0xB867,0xB868,0xB869,0xC5F0,0xB86A,0xB86B,0xB86C, +0xC5F1,0xB86D,0xB86E,0xB86F,0xB870,0xB871,0xB872,0xB873, +0xB874,0xB875,0xB876,0xB877,0xB878,0xB879,0xB87A,0xC5F2, +0xB881,0xC5F3,0xB882,0xB883,0xB884,0xB885,0xB886,0xB887, +0xC5F4,0xB888,0xB889,0xB88A,0xB88B,0xB88C,0xB88D,0xB88E, +0xB88F,0xB890,0xB891,0xB892,0xB893,0xB894,0xB895,0xB896, +0xB897,0xB898,0xB899,0xB89A,0xB89B,0xB89C,0xB89D,0xB89E, +0xB89F,0xB8A0,0xB941,0xB942,0xC5F5,0xC5F6,0xB943,0xB944, +0xC5F7,0xB945,0xB946,0xB947,0xC5F8,0xB948,0xB949,0xB94A, +0xB94B,0xB94C,0xB94D,0xB94E,0xC5F9,0xC5FA,0xB94F,0xC5FB, +0xB950,0xC5FC,0xB951,0xB952,0xB953,0xB954,0xB955,0xB956, +0xC5FD,0xB957,0xB958,0xB959,0xB95A,0xB961,0xB962,0xB963, +0xB964,0xB965,0xB966,0xB967,0xB968,0xB969,0xB96A,0xB96B, +0xB96C,0xB96D,0xB96E,0xB96F,0xC5FE,0xB970,0xB971,0xB972, +0xB973,0xB974,0xB975,0xB976,0xC6A1,0xB977,0xB978,0xB979, +0xB97A,0xB981,0xB982,0xB983,0xB984,0xB985,0xB986,0xB987, +0xB988,0xB989,0xB98A,0xB98B,0xB98C,0xB98D,0xB98E,0xB98F, +0xB990,0xB991,0xB992,0xB993,0xB994,0xB995,0xB996,0xB997, +0xC6A2,0xC6A3,0xB998,0xB999,0xC6A4,0xB99A,0xB99B,0xB99C, +0xC6A5,0xB99D,0xB99E,0xB99F,0xB9A0,0xBA41,0xBA42,0xBA43, +0xC6A6,0xC6A7,0xBA44,0xBA45,0xBA46,0xC6A8,0xBA47,0xBA48, +0xBA49,0xBA4A,0xBA4B,0xBA4C,0xC6A9,0xBA4D,0xBA4E,0xBA4F, +0xC6AA,0xBA50,0xBA51,0xBA52,0xC6AB,0xBA53,0xBA54,0xBA55, +0xBA56,0xBA57,0xBA58,0xBA59,0xC6AC,0xBA5A,0xBA61,0xBA62, +0xBA63,0xC6AD,0xBA64,0xBA65,0xBA66,0xBA67,0xBA68,0xBA69, +0xC6AE,0xC6AF,0xBA6A,0xBA6B,0xC6B0,0xBA6C,0xBA6D,0xC6B1, +0xC6B2,0xBA6E,0xC6B3,0xBA6F,0xBA70,0xBA71,0xBA72,0xBA73, +0xC6B4,0xC6B5,0xBA74,0xC6B6,0xBA75,0xBA76,0xBA77,0xBA78, +0xBA79,0xBA7A,0xBA81,0xBA82,0xC6B7,0xBA83,0xBA84,0xBA85, +0xC6B8,0xBA86,0xBA87,0xBA88,0xC6B9,0xBA89,0xBA8A,0xBA8B, +0xBA8C,0xBA8D,0xBA8E,0xBA8F,0xC6BA,0xC6BB,0xBA90,0xBA91, +0xBA92,0xBA93,0xBA94,0xBA95,0xBA96,0xBA97,0xBA98,0xBA99, +0xC6BC,0xC6BD,0xBA9A,0xBA9B,0xC6BE,0xBA9C,0xBA9D,0xBA9E, +0xC6BF,0xBA9F,0xBAA0,0xBB41,0xBB42,0xBB43,0xBB44,0xBB45, +0xC6C0,0xC6C1,0xBB46,0xC6C2,0xBB47,0xC6C3,0xBB48,0xBB49, +0xBB4A,0xBB4B,0xBB4C,0xBB4D,0xC6C4,0xC6C5,0xC6C6,0xBB4E, +0xC6C7,0xBB4F,0xBB50,0xBB51,0xC6C8,0xBB52,0xC6C9,0xBB53, +0xBB54,0xBB55,0xBB56,0xBB57,0xC6CA,0xC6CB,0xBB58,0xC6CC, +0xC6CD,0xC6CE,0xBB59,0xBB5A,0xBB61,0xC6CF,0xBB62,0xBB63, +0xC6D0,0xC6D1,0xBB64,0xBB65,0xC6D2,0xBB66,0xBB67,0xBB68, +0xC6D3,0xBB69,0xBB6A,0xBB6B,0xBB6C,0xBB6D,0xBB6E,0xBB6F, +0xC6D4,0xC6D5,0xBB70,0xC6D6,0xC6D7,0xC6D8,0xBB71,0xBB72, +0xBB73,0xBB74,0xBB75,0xBB76,0xC6D9,0xC6DA,0xBB77,0xBB78, +0xBB79,0xBB7A,0xBB81,0xBB82,0xBB83,0xBB84,0xBB85,0xBB86, +0xBB87,0xBB88,0xBB89,0xBB8A,0xBB8B,0xBB8C,0xBB8D,0xBB8E, +0xBB8F,0xBB90,0xBB91,0xBB92,0xBB93,0xBB94,0xBB95,0xBB96, +0xBB97,0xBB98,0xBB99,0xBB9A,0xBB9B,0xBB9C,0xBB9D,0xBB9E, +0xBB9F,0xBBA0,0xBC41,0xBC42,0xBC43,0xBC44,0xBC45,0xBC46, +0xBC47,0xBC48,0xBC49,0xBC4A,0xBC4B,0xBC4C,0xBC4D,0xBC4E, +0xBC4F,0xBC50,0xBC51,0xBC52,0xC6DB,0xC6DC,0xBC53,0xBC54, +0xC6DD,0xBC55,0xBC56,0xBC57,0xC6DE,0xBC58,0xBC59,0xBC5A, +0xBC61,0xBC62,0xBC63,0xBC64,0xC6DF,0xC6E0,0xBC65,0xC6E1, +0xC6E2,0xC6E3,0xBC66,0xBC67,0xBC68,0xBC69,0xBC6A,0xBC6B, +0xC6E4,0xC6E5,0xBC6C,0xBC6D,0xC6E6,0xBC6E,0xBC6F,0xBC70, +0xC6E7,0xBC71,0xBC72,0xBC73,0xBC74,0xBC75,0xBC76,0xBC77, +0xC6E8,0xC6E9,0xBC78,0xC6EA,0xBC79,0xC6EB,0xBC7A,0xBC81, +0xBC82,0xBC83,0xBC84,0xBC85,0xC6EC,0xBC86,0xBC87,0xBC88, +0xC6ED,0xBC89,0xBC8A,0xBC8B,0xC6EE,0xBC8C,0xBC8D,0xBC8E, +0xBC8F,0xBC90,0xBC91,0xBC92,0xC6EF,0xC6F0,0xBC93,0xBC94, +0xC6F1,0xC6F2,0xBC95,0xBC96,0xBC97,0xBC98,0xBC99,0xBC9A, +0xC6F3,0xBC9B,0xBC9C,0xBC9D,0xBC9E,0xBC9F,0xBCA0,0xBD41, +0xC6F4,0xBD42,0xBD43,0xBD44,0xBD45,0xBD46,0xBD47,0xBD48, +0xBD49,0xC6F5,0xBD4A,0xC6F6,0xBD4B,0xBD4C,0xBD4D,0xBD4E, +0xBD4F,0xBD50,0xBD51,0xBD52,0xC6F7,0xC6F8,0xBD53,0xBD54, +0xC6F9,0xBD55,0xBD56,0xBD57,0xC6FA,0xBD58,0xBD59,0xBD5A, +0xBD61,0xBD62,0xBD63,0xBD64,0xC6FB,0xC6FC,0xBD65,0xC6FD, +0xBD66,0xC6FE,0xBD67,0xBD68,0xBD69,0xBD6A,0xBD6B,0xBD6C, +0xC7A1,0xBD6D,0xBD6E,0xBD6F,0xBD70,0xBD71,0xBD72,0xBD73, +0xBD74,0xBD75,0xBD76,0xBD77,0xBD78,0xBD79,0xBD7A,0xBD81, +0xBD82,0xBD83,0xBD84,0xBD85,0xBD86,0xC7A2,0xBD87,0xBD88, +0xBD89,0xBD8A,0xBD8B,0xBD8C,0xBD8D,0xBD8E,0xBD8F,0xBD90, +0xBD91,0xBD92,0xBD93,0xBD94,0xBD95,0xBD96,0xBD97,0xBD98, +0xBD99,0xBD9A,0xBD9B,0xBD9C,0xBD9D,0xBD9E,0xBD9F,0xBDA0, +0xBE41,0xBE42,0xBE43,0xBE44,0xBE45,0xBE46,0xBE47,0xBE48, +0xC7A3,0xBE49,0xBE4A,0xBE4B,0xC7A4,0xBE4C,0xBE4D,0xBE4E, +0xBE4F,0xBE50,0xBE51,0xBE52,0xBE53,0xBE54,0xBE55,0xBE56, +0xBE57,0xBE58,0xBE59,0xBE5A,0xBE61,0xBE62,0xBE63,0xBE64, +0xBE65,0xBE66,0xBE67,0xBE68,0xC7A5,0xBE69,0xBE6A,0xBE6B, +0xC7A6,0xBE6C,0xBE6D,0xBE6E,0xC7A7,0xBE6F,0xBE70,0xBE71, +0xBE72,0xBE73,0xBE74,0xBE75,0xBE76,0xC7A8,0xBE77,0xC7A9, +0xBE78,0xBE79,0xBE7A,0xBE81,0xBE82,0xBE83,0xBE84,0xBE85, +0xC7AA,0xC7AB,0xBE86,0xBE87,0xC7AC,0xBE88,0xBE89,0xC7AD, +0xC7AE,0xBE8A,0xC7AF,0xBE8B,0xBE8C,0xBE8D,0xBE8E,0xBE8F, +0xC7B0,0xC7B1,0xBE90,0xC7B2,0xBE91,0xC7B3,0xBE92,0xBE93, +0xBE94,0xBE95,0xBE96,0xBE97,0xC7B4,0xBE98,0xBE99,0xBE9A, +0xBE9B,0xBE9C,0xBE9D,0xBE9E,0xBE9F,0xBEA0,0xBF41,0xBF42, +0xBF43,0xBF44,0xBF45,0xBF46,0xBF47,0xBF48,0xBF49,0xBF4A, +0xBF4B,0xC7B5,0xBF4C,0xBF4D,0xBF4E,0xBF4F,0xBF50,0xBF51, +0xBF52,0xBF53,0xBF54,0xBF55,0xBF56,0xBF57,0xBF58,0xBF59, +0xBF5A,0xBF61,0xBF62,0xBF63,0xBF64,0xBF65,0xBF66,0xBF67, +0xBF68,0xBF69,0xBF6A,0xBF6B,0xBF6C,0xBF6D,0xBF6E,0xBF6F, +0xBF70,0xBF71,0xBF72,0xBF73,0xC7B6,0xBF74,0xBF75,0xBF76, +0xC7B7,0xBF77,0xBF78,0xBF79,0xC7B8,0xBF7A,0xBF81,0xBF82, +0xBF83,0xBF84,0xBF85,0xBF86,0xC7B9,0xBF87,0xBF88,0xC7BA, +0xBF89,0xBF8A,0xBF8B,0xBF8C,0xBF8D,0xBF8E,0xBF8F,0xBF90, +0xC7BB,0xBF91,0xBF92,0xBF93,0xC7BC,0xBF94,0xBF95,0xBF96, +0xC7BD,0xBF97,0xBF98,0xBF99,0xBF9A,0xBF9B,0xBF9C,0xBF9D, +0xC7BE,0xBF9E,0xBF9F,0xC7BF,0xBFA0,0xC7C0,0xC041,0xC042, +0xC043,0xC044,0xC045,0xC046,0xC7C1,0xC047,0xC048,0xC049, +0xC7C2,0xC04A,0xC04B,0xC04C,0xC7C3,0xC04D,0xC04E,0xC04F, +0xC050,0xC051,0xC052,0xC053,0xC7C4,0xC7C5,0xC054,0xC7C6, +0xC055,0xC056,0xC057,0xC058,0xC059,0xC05A,0xC061,0xC062, +0xC063,0xC064,0xC065,0xC066,0xC067,0xC068,0xC069,0xC06A, +0xC06B,0xC06C,0xC06D,0xC06E,0xC06F,0xC070,0xC071,0xC072, +0xC073,0xC074,0xC075,0xC076,0xC077,0xC078,0xC079,0xC07A, +0xC081,0xC082,0xC083,0xC084,0xC7C7,0xC7C8,0xC085,0xC086, +0xC7C9,0xC087,0xC088,0xC089,0xC7CA,0xC08A,0xC08B,0xC08C, +0xC08D,0xC08E,0xC08F,0xC090,0xC7CB,0xC7CC,0xC091,0xC7CD, +0xC092,0xC7CE,0xC093,0xC094,0xC095,0xC096,0xC097,0xC098, +0xC7CF,0xC7D0,0xC099,0xC09A,0xC7D1,0xC09B,0xC09C,0xC09D, +0xC7D2,0xC09E,0xC09F,0xC0A0,0xC141,0xC7D3,0xC142,0xC143, +0xC7D4,0xC7D5,0xC144,0xC7D6,0xC145,0xC7D7,0xC146,0xC147, +0xC148,0xC149,0xC14A,0xC14B,0xC7D8,0xC7D9,0xC14C,0xC14D, +0xC7DA,0xC14E,0xC14F,0xC150,0xC7DB,0xC151,0xC152,0xC153, +0xC154,0xC155,0xC156,0xC157,0xC7DC,0xC7DD,0xC158,0xC7DE, +0xC7DF,0xC7E0,0xC159,0xC15A,0xC161,0xC162,0xC163,0xC164, +0xC7E1,0xC165,0xC166,0xC167,0xC168,0xC169,0xC16A,0xC16B, +0xC16C,0xC16D,0xC16E,0xC16F,0xC170,0xC171,0xC172,0xC173, +0xC174,0xC175,0xC176,0xC177,0xC178,0xC7E2,0xC179,0xC17A, +0xC181,0xC182,0xC183,0xC184,0xC185,0xC186,0xC187,0xC188, +0xC189,0xC18A,0xC18B,0xC18C,0xC18D,0xC18E,0xC18F,0xC190, +0xC191,0xC192,0xC193,0xC194,0xC195,0xC196,0xC197,0xC198, +0xC199,0xC19A,0xC19B,0xC19C,0xC19D,0xC19E,0xC19F,0xC1A0, +0xC7E3,0xC7E4,0xC241,0xC242,0xC7E5,0xC243,0xC244,0xC245, +0xC7E6,0xC246,0xC7E7,0xC247,0xC248,0xC249,0xC24A,0xC24B, +0xC7E8,0xC7E9,0xC24C,0xC7EA,0xC24D,0xC7EB,0xC24E,0xC24F, +0xC250,0xC251,0xC252,0xC253,0xC7EC,0xC7ED,0xC254,0xC255, +0xC7EE,0xC256,0xC257,0xC258,0xC7EF,0xC259,0xC25A,0xC261, +0xC262,0xC263,0xC264,0xC265,0xC7F0,0xC7F1,0xC266,0xC7F2, +0xC267,0xC7F3,0xC268,0xC269,0xC26A,0xC26B,0xC26C,0xC26D, +0xC7F4,0xC7F5,0xC26E,0xC26F,0xC7F6,0xC270,0xC271,0xC272, +0xC7F7,0xC273,0xC274,0xC275,0xC276,0xC277,0xC278,0xC279, +0xC7F8,0xC7F9,0xC27A,0xC7FA,0xC7FB,0xC7FC,0xC281,0xC282, +0xC283,0xC284,0xC285,0xC286,0xC7FD,0xC287,0xC288,0xC289, +0xC7FE,0xC28A,0xC28B,0xC28C,0xC8A1,0xC28D,0xC28E,0xC28F, +0xC290,0xC291,0xC292,0xC293,0xC294,0xC8A2,0xC295,0xC296, +0xC297,0xC298,0xC299,0xC29A,0xC29B,0xC29C,0xC29D,0xC29E, +0xC8A3,0xC8A4,0xC29F,0xC2A0,0xC8A5,0xC341,0xC342,0xC343, +0xC8A6,0xC344,0xC345,0xC346,0xC347,0xC8A7,0xC348,0xC349, +0xC8A8,0xC8A9,0xC34A,0xC8AA,0xC34B,0xC8AB,0xC34C,0xC34D, +0xC34E,0xC8AC,0xC34F,0xC350,0xC8AD,0xC8AE,0xC351,0xC352, +0xC8AF,0xC353,0xC354,0xC355,0xC8B0,0xC356,0xC357,0xC358, +0xC359,0xC35A,0xC361,0xC362,0xC363,0xC364,0xC365,0xC8B1, +0xC366,0xC8B2,0xC367,0xC368,0xC369,0xC36A,0xC36B,0xC36C, +0xC8B3,0xC8B4,0xC36D,0xC36E,0xC8B5,0xC36F,0xC370,0xC371, +0xC372,0xC373,0xC374,0xC375,0xC376,0xC377,0xC378,0xC379, +0xC37A,0xC381,0xC382,0xC8B6,0xC383,0xC8B7,0xC384,0xC385, +0xC386,0xC387,0xC388,0xC389,0xC8B8,0xC8B9,0xC38A,0xC38B, +0xC8BA,0xC38C,0xC38D,0xC38E,0xC8BB,0xC38F,0xC390,0xC391, +0xC392,0xC393,0xC394,0xC395,0xC396,0xC8BC,0xC397,0xC8BD, +0xC398,0xC8BE,0xC399,0xC39A,0xC39B,0xC39C,0xC39D,0xC39E, +0xC8BF,0xC39F,0xC3A0,0xC441,0xC8C0,0xC442,0xC443,0xC444, +0xC8C1,0xC445,0xC446,0xC447,0xC448,0xC449,0xC44A,0xC44B, +0xC44C,0xC8C2,0xC44D,0xC8C3,0xC44E,0xC44F,0xC450,0xC451, +0xC452,0xC453,0xC454,0xC455,0xC8C4,0xC8C5,0xC456,0xC457, +0xC8C6,0xC458,0xC459,0xC45A,0xC8C7,0xC461,0xC462,0xC463, +0xC464,0xC8C8,0xC465,0xC466,0xC8C9,0xC467,0xC468,0xC8CA, +0xC469,0xC8CB,0xC46A,0xC46B,0xC46C,0xC46D,0xC46E,0xC46F, +0xC8CC,0xC470,0xC471,0xC472,0xC8CD,0xC473,0xC474,0xC475, +0xC8CE,0xC476,0xC477,0xC478,0xC479,0xC47A,0xC481,0xC482, +0xC8CF,0xC483,0xC484,0xC485,0xC486,0xC8D0,0xC487,0xC488, +0xC489,0xC48A,0xC48B,0xC48C,0xC8D1,0xC8D2,0xC48D,0xC48E, +0xC8D3,0xC48F,0xC490,0xC491,0xC8D4,0xC492,0xC493,0xC494, +0xC495,0xC496,0xC497,0xC498,0xC499,0xC49A,0xC49B,0xC49C, +0xC49D,0xC8D5,0xC49E,0xC49F,0xC4A0,0xC541,0xC542,0xC543, +0xC8D6,0xC8D7,0xC544,0xC545,0xC8D8,0xC546,0xC547,0xC548, +0xC8D9,0xC549,0xC54A,0xC54B,0xC54C,0xC54D,0xC54E,0xC54F, +0xC8DA,0xC8DB,0xC550,0xC8DC,0xC551,0xC8DD,0xC552,0xC553, +0xC554,0xC555,0xC556,0xC557,0xC8DE,0xC8DF,0xC558,0xC559, +0xC8E0,0xC55A,0xC561,0xC562,0xC8E1,0xC563,0xC564,0xC565, +0xC566,0xC567,0xC568,0xC569,0xC8E2,0xC56A,0xC56B,0xC8E3, +0xC56C,0xC8E4,0xC56D,0xC56E,0xC56F,0xC570,0xC571,0xC572, +0xC8E5,0xC8E6,0xC573,0xC574,0xC8E7,0xC575,0xC8E8,0xC8E9, +0xC8EA,0xC8EB,0xC576,0xC577,0xC578,0xC579,0xC57A,0xC581, +0xC8EC,0xC8ED,0xC582,0xC8EE,0xC583,0xC8EF,0xC584,0xC585, +0xC586,0xC8F0,0xC587,0xC588,0xC8F1,0xC589,0xC58A,0xC58B, +0xC8F2,0xC58C,0xC58D,0xC58E,0xC8F3,0xC58F,0xC590,0xC591, +0xC592,0xC593,0xC594,0xC595,0xC8F4,0xC8F5,0xC596,0xC597, +0xC598,0xC8F6,0xC599,0xC59A,0xC59B,0xC59C,0xC59D,0xC59E, +0xC8F7,0xC8F8,0xC59F,0xC5A0,0xC8F9,0xC641,0xC642,0xC643, +0xC8FA,0xC644,0xC645,0xC646,0xC647,0xC648,0xC649,0xC64A, +0xC8FB,0xC8FC,0xC64B,0xC8FD,0xC64C,0xC8FE,0xC64D,0xC64E, +0xC64F,0xC650,0xC651,0xC652}; + +/* page 9 0xF900-0xFA0B */ +static uint16 tab_uni_ksc56019[]={ +0xCBD0,0xCBD6,0xCBE7,0xCDCF,0xCDE8,0xCEAD,0xCFFB,0xD0A2, +0xD0B8,0xD0D0,0xD0DD,0xD1D4,0xD1D5,0xD1D8,0xD1DB,0xD1DC, +0xD1DD,0xD1DE,0xD1DF,0xD1E0,0xD1E2,0xD1E3,0xD1E4,0xD1E5, +0xD1E6,0xD1E8,0xD1E9,0xD1EA,0xD1EB,0xD1ED,0xD1EF,0xD1F0, +0xD1F2,0xD1F6,0xD1FA,0xD1FC,0xD1FD,0xD1FE,0xD2A2,0xD2A3, +0xD2A7,0xD2A8,0xD2A9,0xD2AA,0xD2AB,0xD2AD,0xD2B2,0xD2BE, +0xD2C2,0xD2C3,0xD2C4,0xD2C6,0xD2C7,0xD2C8,0xD2C9,0xD2CA, +0xD2CB,0xD2CD,0xD2CE,0xD2CF,0xD2D0,0xD2D1,0xD2D2,0xD2D3, +0xD2D4,0xD2D5,0xD2D6,0xD2D7,0xD2D9,0xD2DA,0xD2DE,0xD2DF, +0xD2E1,0xD2E2,0xD2E4,0xD2E5,0xD2E6,0xD2E7,0xD2E8,0xD2E9, +0xD2EA,0xD2EB,0xD2F0,0xD2F1,0xD2F2,0xD2F3,0xD2F4,0xD2F5, +0xD2F7,0xD2F8,0xD4E6,0xD4FC,0xD5A5,0xD5AB,0xD5AE,0xD6B8, +0xD6CD,0xD7CB,0xD7E4,0xDBC5,0xDBE4,0xDCA5,0xDDA5,0xDDD5, +0xDDF4,0xDEFC,0xDEFE,0xDFB3,0xDFE1,0xDFE8,0xE0F1,0xE1AD, +0xE1ED,0xE3F5,0xE4A1,0xE4A9,0xE5AE,0xE5B1,0xE5B2,0xE5B9, +0xE5BB,0xE5BC,0xE5C4,0xE5CE,0xE5D0,0xE5D2,0xE5D6,0xE5FA, +0xE5FB,0xE5FC,0xE5FE,0xE6A1,0xE6A4,0xE6A7,0xE6AD,0xE6AF, +0xE6B0,0xE6B1,0xE6B3,0xE6B7,0xE6B8,0xE6BC,0xE6C4,0xE6C6, +0xE6C7,0xE6CA,0xE6D2,0xE6D6,0xE6D9,0xE6DC,0xE6DF,0xE6E1, +0xE6E4,0xE6E5,0xE6E6,0xE6E8,0xE6EA,0xE6EB,0xE6EC,0xE6EF, +0xE6F1,0xE6F2,0xE6F5,0xE6F6,0xE6F7,0xE6F9,0xE7A1,0xE7A6, +0xE7A9,0xE7AA,0xE7AC,0xE7AD,0xE7B0,0xE7BF,0xE7C1,0xE7C6, +0xE7C7,0xE7CB,0xE7CD,0xE7CF,0xE7D0,0xE7D3,0xE7DF,0xE7E4, +0xE7E6,0xE7F7,0xE8E7,0xE8E8,0xE8F0,0xE8F1,0xE8F7,0xE8F9, +0xE8FB,0xE8FE,0xE9A7,0xE9AC,0xE9CC,0xE9F7,0xEAC1,0xEAE5, +0xEAF4,0xEAF7,0xEAFC,0xEAFE,0xEBA4,0xEBA7,0xEBA9,0xEBAA, +0xEBBA,0xEBBB,0xEBBD,0xEBC1,0xEBC2,0xEBC6,0xEBC7,0xEBCC, +0xEBCF,0xEBD0,0xEBD1,0xEBD2,0xEBD8,0xECA6,0xECA7,0xECAA, +0xECAF,0xECB0,0xECB1,0xECB2,0xECB5,0xECB8,0xECBA,0xECC0, +0xECC1,0xECC5,0xECC6,0xECC9,0xECCA,0xECD5,0xECDD,0xECDE, +0xECE1,0xECE4,0xECE7,0xECE8,0xECF7,0xECF8,0xECFA,0xEDA1, +0xEDA2,0xEDA3,0xEDEE,0xEEDB,0xF2BD,0xF2FA,0xF3B1,0xF4A7, +0xF4EE,0xF6F4,0xF6F6,0xF7B8,0xF7C8,0xF7D3,0xF8DB,0xF8F0, +0xFAA1,0xFAA2,0xFAE6,0xFCA9}; + +/* page 10 0xFF01-0xFFE6 */ +static uint16 tab_uni_ksc560110[]={ +0xA3A1,0xA3A2,0xA3A3,0xA3A4,0xA3A5,0xA3A6,0xA3A7,0xA3A8, +0xA3A9,0xA3AA,0xA3AB,0xA3AC,0xA3AD,0xA3AE,0xA3AF,0xA3B0, +0xA3B1,0xA3B2,0xA3B3,0xA3B4,0xA3B5,0xA3B6,0xA3B7,0xA3B8, +0xA3B9,0xA3BA,0xA3BB,0xA3BC,0xA3BD,0xA3BE,0xA3BF,0xA3C0, +0xA3C1,0xA3C2,0xA3C3,0xA3C4,0xA3C5,0xA3C6,0xA3C7,0xA3C8, +0xA3C9,0xA3CA,0xA3CB,0xA3CC,0xA3CD,0xA3CE,0xA3CF,0xA3D0, +0xA3D1,0xA3D2,0xA3D3,0xA3D4,0xA3D5,0xA3D6,0xA3D7,0xA3D8, +0xA3D9,0xA3DA,0xA3DB,0xA1AC,0xA3DD,0xA3DE,0xA3DF,0xA3E0, +0xA3E1,0xA3E2,0xA3E3,0xA3E4,0xA3E5,0xA3E6,0xA3E7,0xA3E8, +0xA3E9,0xA3EA,0xA3EB,0xA3EC,0xA3ED,0xA3EE,0xA3EF,0xA3F0, +0xA3F1,0xA3F2,0xA3F3,0xA3F4,0xA3F5,0xA3F6,0xA3F7,0xA3F8, +0xA3F9,0xA3FA,0xA3FB,0xA3FC,0xA3FD,0xA2A6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA1CB, +0xA1CC,0xA1FE,0xA3FE, 0,0xA1CD,0xA3DC}; + +static int func_uni_ksc5601_onechar(int code){ + if ((code>=0x00A1)&&(code<=0x0167)) + return(tab_uni_ksc56010[code-0x00A1]); + if ((code>=0x02C7)&&(code<=0x0451)) + return(tab_uni_ksc56011[code-0x02C7]); + if ((code>=0x2015)&&(code<=0x2312)) + return(tab_uni_ksc56012[code-0x2015]); + if ((code>=0x2460)&&(code<=0x266D)) + return(tab_uni_ksc56013[code-0x2460]); + if ((code>=0x3000)&&(code<=0x327F)) + return(tab_uni_ksc56014[code-0x3000]); + if ((code>=0x3380)&&(code<=0x33DD)) + return(tab_uni_ksc56015[code-0x3380]); + if ((code>=0x4E00)&&(code<=0x947F)) + return(tab_uni_ksc56016[code-0x4E00]); + if ((code>=0x9577)&&(code<=0x9F9C)) + return(tab_uni_ksc56017[code-0x9577]); + if ((code>=0xAC00)&&(code<=0xD7A3)) + return(tab_uni_ksc56018[code-0xAC00]); + if ((code>=0xF900)&&(code<=0xFA0B)) + return(tab_uni_ksc56019[code-0xF900]); + if ((code>=0xFF01)&&(code<=0xFFE6)) + return(tab_uni_ksc560110[code-0xFF01]); + return(0); +} + + +static int +my_wc_mb_euc_kr(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + int code; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((uint) wc < 0x80) + { + s[0]= (uchar) wc; + return 1; + } + + if (!(code=func_uni_ksc5601_onechar(wc))) + return MY_CS_ILUNI; + + if (s+2>e) + return MY_CS_TOOSMALL2; + + s[0]=code>>8; + s[1]=code&0xFF; + + return 2; +} + + +static int +my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e) +{ + + int hi; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((hi= s[0]) < 0x80) + { + pwc[0]=hi; + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + if (!(pwc[0]=func_ksc5601_uni_onechar((hi<<8)+s[1]))) + return -2; + + return 2; +} + + +/* + Returns well formed length of a EUC-KR string. +*/ +static size_t +my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) +{ + const char *b0= b; + const char *emb= e - 1; /* Last possible end of an MB character */ + + *error= 0; + while (pos-- && b < e) + { + if ((uchar) b[0] < 128) + { + /* Single byte ascii character */ + b++; + } + else if (b < emb && iseuc_kr_head(*b) && iseuc_kr_tail(b[1])) + { + /* Double byte character */ + b+= 2; + } + else + { + /* Wrong byte sequence */ + *error= 1; + break; + } + } + return (size_t) (b - b0); +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_simple, /* strnncoll */ + my_strnncollsp_simple, + my_strnxfrm_mb, /* strnxfrm */ + my_strnxfrmlen_simple, + my_like_range_mb, /* like_range */ + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_euc_kr, + mbcharlen_euc_kr, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_euckr, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_euc_kr, /* mb_wc */ + my_wc_mb_euc_kr, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb, + my_casedn_str_mb, + my_caseup_mb, + my_casedn_mb, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_euckr_korean_ci= +{ + 19,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ + "euckr", /* cs name */ + "euckr_korean_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_euc_kr, + to_lower_euc_kr, + to_upper_euc_kr, + sort_order_euc_kr, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + + +CHARSET_INFO my_charset_euckr_bin= +{ + 85,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "euckr", /* cs name */ + "euckr_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_euc_kr, + to_lower_euc_kr, + to_upper_euc_kr, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + +#endif diff --git a/externals/mysql/strings/ctype-eucjpms.c b/externals/mysql/strings/ctype-eucjpms.c new file mode 100644 index 00000000000..dc2329785b5 --- /dev/null +++ b/externals/mysql/strings/ctype-eucjpms.c @@ -0,0 +1,8759 @@ +/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* This file is for Japanese EUC charset, and created based on +ctype-ujis.c file. + */ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. mbmaxlen_eucjpms=3 + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_eucjpms + + +static uchar NEAR ctype_eucjpms[257] = +{ + 0, /* For standard library */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ + 0040, 0050, 0050, 0050, 0050, 0050, 0040, 0040, /* ^H - ^O */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^P - ^W */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^X - ^Z ^[ ^\ ^] ^^ ^_ */ + 0110, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* SPC ! " # $ % ^ ' */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* ( ) * + , - . / */ + 0204, 0204, 0204, 0204, 0204, 0204, 0204, 0204, /* 0 1 2 3 4 5 6 7 */ + 0204, 0204, 0020, 0020, 0020, 0020, 0020, 0020, /* 8 9 : ; < = > ? */ + 0020, 0201, 0201, 0201, 0201, 0201, 0201, 0001, /* @ A B C D E F G */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* H I J K L M N O */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* P Q R S T U V W */ + 0001, 0001, 0001, 0020, 0020, 0020, 0020, 0020, /* X Y Z [ \ ] ^ _ */ + 0020, 0202, 0202, 0202, 0202, 0202, 0202, 0002, /* ` a b c d e f g */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* h i j k l m n o */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* p q r s t u v w */ + 0002, 0002, 0002, 0020, 0020, 0020, 0020, 0040, /* x y z { | } + DEL */ + 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, + 0000, 0000, 0000, 0000, 0000, 0000, 0020, 0020, + 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, + 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, + 0000, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, +}; + +static uchar NEAR to_lower_eucjpms[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR to_upper_eucjpms[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR sort_order_eucjpms[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375', (uchar) (uchar) '\376', (uchar) '\377' +}; + + +#define iseucjpms(c) ((0xa1<=((c)&0xff) && ((c)&0xff)<=0xfe)) +#define iskata(c) ((0xa1<=((c)&0xff) && ((c)&0xff)<=0xdf)) +#define iseucjpms_ss2(c) (((c)&0xff) == 0x8e) +#define iseucjpms_ss3(c) (((c)&0xff) == 0x8f) + + +static uint ismbchar_eucjpms(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return ((*(uchar*)(p)<0x80)? 0:\ + iseucjpms(*(p)) && (e)-(p)>1 && iseucjpms(*((p)+1))? 2:\ + iseucjpms_ss2(*(p)) && (e)-(p)>1 && iskata(*((p)+1))? 2:\ + iseucjpms_ss3(*(p)) && (e)-(p)>2 && iseucjpms(*((p)+1)) && iseucjpms(*((p)+2))? 3:\ + 0); +} + +static uint mbcharlen_eucjpms(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (iseucjpms(c)? 2: iseucjpms_ss2(c)? 2: iseucjpms_ss3(c)? 3: 1); +} + + +static uint16 tab_jisx0201_uni[256]={ + 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67, +0xFF68,0xFF69,0xFF6A,0xFF6B,0xFF6C,0xFF6D,0xFF6E,0xFF6F, +0xFF70,0xFF71,0xFF72,0xFF73,0xFF74,0xFF75,0xFF76,0xFF77, +0xFF78,0xFF79,0xFF7A,0xFF7B,0xFF7C,0xFF7D,0xFF7E,0xFF7F, +0xFF80,0xFF81,0xFF82,0xFF83,0xFF84,0xFF85,0xFF86,0xFF87, +0xFF88,0xFF89,0xFF8A,0xFF8B,0xFF8C,0xFF8D,0xFF8E,0xFF8F, +0xFF90,0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97, +0xFF98,0xFF99,0xFF9A,0xFF9B,0xFF9C,0xFF9D,0xFF9E,0xFF9F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + + +static int +my_mb_wc_jisx0201(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *wc,const uchar *s, + const uchar *e __attribute__((unused))) +{ + wc[0]=tab_jisx0201_uni[*s]; + return (!wc[0] && s[0]) ? -1 : 1; +} + + +static int +my_wc_mb_jisx0201(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, + uchar *e __attribute__((unused))) +{ + + if ((int) wc <= 0x7D) + { + *s = (uchar) wc; + return (wc == 0x5C) ? MY_CS_ILUNI : 1; + } + + if (wc >= 0xFF61 && wc <= 0xFF9F) + { + *s = (uchar) (wc - 0xFEC0); + return 1; + } + + return MY_CS_ILUNI; +} + + +/* page 0 0x2121-0x217E */ +static uint16 tab_jisx0208_uni0[]={ +0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B, +0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E, +0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD, +0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0xFF3C, +0xFF5E,0x2225,0xFF5C,0x2026,0x2025,0x2018,0x2019,0x201C, +0x201D,0xFF08,0xFF09,0x3014,0x3015,0xFF3B,0xFF3D,0xFF5B, +0xFF5D,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E, +0x300F,0x3010,0x3011,0xFF0B,0xFF0D,0x00B1,0x00D7,0x00F7, +0xFF1D,0x2260,0xFF1C,0xFF1E,0x2266,0x2267,0x221E,0x2234, +0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFFE5,0xFF04, +0xFFE0,0xFFE1,0xFF05,0xFF03,0xFF06,0xFF0A,0xFF20,0x00A7, +0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7}; + +/* page 1 0x2221-0x227E */ +static uint16 tab_jisx0208_uni1[]={ +0x25C6,0x25A1,0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x203B, +0x3012,0x2192,0x2190,0x2191,0x2193,0x3013, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2208,0x220B,0x2286,0x2287,0x2282,0x2283,0x222A, +0x2229, 0, 0, 0, 0, 0, 0, 0, + 0,0x2227,0x2228,0xFFE2,0x21D2,0x21D4,0x2200,0x2203, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2220,0x22A5,0x2312,0x2202,0x2207, +0x2261,0x2252,0x226A,0x226B,0x221A,0x223D,0x221D,0x2235, +0x222B,0x222C, 0, 0, 0, 0, 0, 0, + 0,0x212B,0x2030,0x266F,0x266D,0x266A,0x2020,0x2021, +0x00B6, 0, 0, 0, 0,0x25EF}; + +/* page 2 0x2330-0x237A */ +static uint16 tab_jisx0208_uni2[]={ +0xFF10,0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17, +0xFF18,0xFF19, 0, 0, 0, 0, 0, 0, + 0,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, +0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, +0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, +0xFF38,0xFF39,0xFF3A, 0, 0, 0, 0, 0, + 0,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, +0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, +0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57, +0xFF58,0xFF59,0xFF5A}; + +/* page 3 0x2421-0x2473 */ +static uint16 tab_jisx0208_uni3[]={ +0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048, +0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050, +0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058, +0x3059,0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060, +0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068, +0x3069,0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070, +0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078, +0x3079,0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080, +0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088, +0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090, +0x3091,0x3092,0x3093}; + +/* page 4 0x2521-0x2576 */ +static uint16 tab_jisx0208_uni4[]={ +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, +0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, +0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, +0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, +0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, +0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, +0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, +0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF,0x30E0, +0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,0x30E8, +0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,0x30F0, +0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6}; + +/* page 5 0x2621-0x2658 */ +static uint16 tab_jisx0208_uni5[]={ +0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398, +0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0, +0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, + 0, 0, 0, 0, 0, 0, 0, 0, +0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8, +0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0, +0x03C1,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9 +}; + +/* page 6 0x2721-0x2771 */ +static uint16 tab_jisx0208_uni6[]={ +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, +0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, +0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, +0x042F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446, +0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E, +0x044F}; + +/* page 7 0x2821-0x2840 */ +static uint16 tab_jisx0208_uni7[]={ +0x2500,0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C, +0x2524,0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B, +0x2517,0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F, +0x2528,0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542 +}; + +/* page 8 0x3021-0x307E */ +static uint16 tab_jisx0208_uni8[]={ +0x4E9C,0x5516,0x5A03,0x963F,0x54C0,0x611B,0x6328,0x59F6, +0x9022,0x8475,0x831C,0x7A50,0x60AA,0x63E1,0x6E25,0x65ED, +0x8466,0x82A6,0x9BF5,0x6893,0x5727,0x65A1,0x6271,0x5B9B, +0x59D0,0x867B,0x98F4,0x7D62,0x7DBE,0x9B8E,0x6216,0x7C9F, +0x88B7,0x5B89,0x5EB5,0x6309,0x6697,0x6848,0x95C7,0x978D, +0x674F,0x4EE5,0x4F0A,0x4F4D,0x4F9D,0x5049,0x56F2,0x5937, +0x59D4,0x5A01,0x5C09,0x60DF,0x610F,0x6170,0x6613,0x6905, +0x70BA,0x754F,0x7570,0x79FB,0x7DAD,0x7DEF,0x80C3,0x840E, +0x8863,0x8B02,0x9055,0x907A,0x533B,0x4E95,0x4EA5,0x57DF, +0x80B2,0x90C1,0x78EF,0x4E00,0x58F1,0x6EA2,0x9038,0x7A32, +0x8328,0x828B,0x9C2F,0x5141,0x5370,0x54BD,0x54E1,0x56E0, +0x59FB,0x5F15,0x98F2,0x6DEB,0x80E4,0x852D}; + +/* page 9 0x3121-0x317E */ +static uint16 tab_jisx0208_uni9[]={ +0x9662,0x9670,0x96A0,0x97FB,0x540B,0x53F3,0x5B87,0x70CF, +0x7FBD,0x8FC2,0x96E8,0x536F,0x9D5C,0x7ABA,0x4E11,0x7893, +0x81FC,0x6E26,0x5618,0x5504,0x6B1D,0x851A,0x9C3B,0x59E5, +0x53A9,0x6D66,0x74DC,0x958F,0x5642,0x4E91,0x904B,0x96F2, +0x834F,0x990C,0x53E1,0x55B6,0x5B30,0x5F71,0x6620,0x66F3, +0x6804,0x6C38,0x6CF3,0x6D29,0x745B,0x76C8,0x7A4E,0x9834, +0x82F1,0x885B,0x8A60,0x92ED,0x6DB2,0x75AB,0x76CA,0x99C5, +0x60A6,0x8B01,0x8D8A,0x95B2,0x698E,0x53AD,0x5186,0x5712, +0x5830,0x5944,0x5BB4,0x5EF6,0x6028,0x63A9,0x63F4,0x6CBF, +0x6F14,0x708E,0x7114,0x7159,0x71D5,0x733F,0x7E01,0x8276, +0x82D1,0x8597,0x9060,0x925B,0x9D1B,0x5869,0x65BC,0x6C5A, +0x7525,0x51F9,0x592E,0x5965,0x5F80,0x5FDC}; + +/* page 10 0x3221-0x327E */ +static uint16 tab_jisx0208_uni10[]={ +0x62BC,0x65FA,0x6A2A,0x6B27,0x6BB4,0x738B,0x7FC1,0x8956, +0x9D2C,0x9D0E,0x9EC4,0x5CA1,0x6C96,0x837B,0x5104,0x5C4B, +0x61B6,0x81C6,0x6876,0x7261,0x4E59,0x4FFA,0x5378,0x6069, +0x6E29,0x7A4F,0x97F3,0x4E0B,0x5316,0x4EEE,0x4F55,0x4F3D, +0x4FA1,0x4F73,0x52A0,0x53EF,0x5609,0x590F,0x5AC1,0x5BB6, +0x5BE1,0x79D1,0x6687,0x679C,0x67B6,0x6B4C,0x6CB3,0x706B, +0x73C2,0x798D,0x79BE,0x7A3C,0x7B87,0x82B1,0x82DB,0x8304, +0x8377,0x83EF,0x83D3,0x8766,0x8AB2,0x5629,0x8CA8,0x8FE6, +0x904E,0x971E,0x868A,0x4FC4,0x5CE8,0x6211,0x7259,0x753B, +0x81E5,0x82BD,0x86FE,0x8CC0,0x96C5,0x9913,0x99D5,0x4ECB, +0x4F1A,0x89E3,0x56DE,0x584A,0x58CA,0x5EFB,0x5FEB,0x602A, +0x6094,0x6062,0x61D0,0x6212,0x62D0,0x6539}; + +/* page 11 0x3321-0x337E */ +static uint16 tab_jisx0208_uni11[]={ +0x9B41,0x6666,0x68B0,0x6D77,0x7070,0x754C,0x7686,0x7D75, +0x82A5,0x87F9,0x958B,0x968E,0x8C9D,0x51F1,0x52BE,0x5916, +0x54B3,0x5BB3,0x5D16,0x6168,0x6982,0x6DAF,0x788D,0x84CB, +0x8857,0x8A72,0x93A7,0x9AB8,0x6D6C,0x99A8,0x86D9,0x57A3, +0x67FF,0x86CE,0x920E,0x5283,0x5687,0x5404,0x5ED3,0x62E1, +0x64B9,0x683C,0x6838,0x6BBB,0x7372,0x78BA,0x7A6B,0x899A, +0x89D2,0x8D6B,0x8F03,0x90ED,0x95A3,0x9694,0x9769,0x5B66, +0x5CB3,0x697D,0x984D,0x984E,0x639B,0x7B20,0x6A2B,0x6A7F, +0x68B6,0x9C0D,0x6F5F,0x5272,0x559D,0x6070,0x62EC,0x6D3B, +0x6E07,0x6ED1,0x845B,0x8910,0x8F44,0x4E14,0x9C39,0x53F6, +0x691B,0x6A3A,0x9784,0x682A,0x515C,0x7AC3,0x84B2,0x91DC, +0x938C,0x565B,0x9D28,0x6822,0x8305,0x8431}; + +/* page 12 0x3421-0x347E */ +static uint16 tab_jisx0208_uni12[]={ +0x7CA5,0x5208,0x82C5,0x74E6,0x4E7E,0x4F83,0x51A0,0x5BD2, +0x520A,0x52D8,0x52E7,0x5DFB,0x559A,0x582A,0x59E6,0x5B8C, +0x5B98,0x5BDB,0x5E72,0x5E79,0x60A3,0x611F,0x6163,0x61BE, +0x63DB,0x6562,0x67D1,0x6853,0x68FA,0x6B3E,0x6B53,0x6C57, +0x6F22,0x6F97,0x6F45,0x74B0,0x7518,0x76E3,0x770B,0x7AFF, +0x7BA1,0x7C21,0x7DE9,0x7F36,0x7FF0,0x809D,0x8266,0x839E, +0x89B3,0x8ACC,0x8CAB,0x9084,0x9451,0x9593,0x9591,0x95A2, +0x9665,0x97D3,0x9928,0x8218,0x4E38,0x542B,0x5CB8,0x5DCC, +0x73A9,0x764C,0x773C,0x5CA9,0x7FEB,0x8D0B,0x96C1,0x9811, +0x9854,0x9858,0x4F01,0x4F0E,0x5371,0x559C,0x5668,0x57FA, +0x5947,0x5B09,0x5BC4,0x5C90,0x5E0C,0x5E7E,0x5FCC,0x63EE, +0x673A,0x65D7,0x65E2,0x671F,0x68CB,0x68C4}; + +/* page 13 0x3521-0x357E */ +static uint16 tab_jisx0208_uni13[]={ +0x6A5F,0x5E30,0x6BC5,0x6C17,0x6C7D,0x757F,0x7948,0x5B63, +0x7A00,0x7D00,0x5FBD,0x898F,0x8A18,0x8CB4,0x8D77,0x8ECC, +0x8F1D,0x98E2,0x9A0E,0x9B3C,0x4E80,0x507D,0x5100,0x5993, +0x5B9C,0x622F,0x6280,0x64EC,0x6B3A,0x72A0,0x7591,0x7947, +0x7FA9,0x87FB,0x8ABC,0x8B70,0x63AC,0x83CA,0x97A0,0x5409, +0x5403,0x55AB,0x6854,0x6A58,0x8A70,0x7827,0x6775,0x9ECD, +0x5374,0x5BA2,0x811A,0x8650,0x9006,0x4E18,0x4E45,0x4EC7, +0x4F11,0x53CA,0x5438,0x5BAE,0x5F13,0x6025,0x6551,0x673D, +0x6C42,0x6C72,0x6CE3,0x7078,0x7403,0x7A76,0x7AAE,0x7B08, +0x7D1A,0x7CFE,0x7D66,0x65E7,0x725B,0x53BB,0x5C45,0x5DE8, +0x62D2,0x62E0,0x6319,0x6E20,0x865A,0x8A31,0x8DDD,0x92F8, +0x6F01,0x79A6,0x9B5A,0x4EA8,0x4EAB,0x4EAC}; + +/* page 14 0x3621-0x367E */ +static uint16 tab_jisx0208_uni14[]={ +0x4F9B,0x4FA0,0x50D1,0x5147,0x7AF6,0x5171,0x51F6,0x5354, +0x5321,0x537F,0x53EB,0x55AC,0x5883,0x5CE1,0x5F37,0x5F4A, +0x602F,0x6050,0x606D,0x631F,0x6559,0x6A4B,0x6CC1,0x72C2, +0x72ED,0x77EF,0x80F8,0x8105,0x8208,0x854E,0x90F7,0x93E1, +0x97FF,0x9957,0x9A5A,0x4EF0,0x51DD,0x5C2D,0x6681,0x696D, +0x5C40,0x66F2,0x6975,0x7389,0x6850,0x7C81,0x50C5,0x52E4, +0x5747,0x5DFE,0x9326,0x65A4,0x6B23,0x6B3D,0x7434,0x7981, +0x79BD,0x7B4B,0x7DCA,0x82B9,0x83CC,0x887F,0x895F,0x8B39, +0x8FD1,0x91D1,0x541F,0x9280,0x4E5D,0x5036,0x53E5,0x533A, +0x72D7,0x7396,0x77E9,0x82E6,0x8EAF,0x99C6,0x99C8,0x99D2, +0x5177,0x611A,0x865E,0x55B0,0x7A7A,0x5076,0x5BD3,0x9047, +0x9685,0x4E32,0x6ADB,0x91E7,0x5C51,0x5C48}; + +/* page 15 0x3721-0x377E */ +static uint16 tab_jisx0208_uni15[]={ +0x6398,0x7A9F,0x6C93,0x9774,0x8F61,0x7AAA,0x718A,0x9688, +0x7C82,0x6817,0x7E70,0x6851,0x936C,0x52F2,0x541B,0x85AB, +0x8A13,0x7FA4,0x8ECD,0x90E1,0x5366,0x8888,0x7941,0x4FC2, +0x50BE,0x5211,0x5144,0x5553,0x572D,0x73EA,0x578B,0x5951, +0x5F62,0x5F84,0x6075,0x6176,0x6167,0x61A9,0x63B2,0x643A, +0x656C,0x666F,0x6842,0x6E13,0x7566,0x7A3D,0x7CFB,0x7D4C, +0x7D99,0x7E4B,0x7F6B,0x830E,0x834A,0x86CD,0x8A08,0x8A63, +0x8B66,0x8EFD,0x981A,0x9D8F,0x82B8,0x8FCE,0x9BE8,0x5287, +0x621F,0x6483,0x6FC0,0x9699,0x6841,0x5091,0x6B20,0x6C7A, +0x6F54,0x7A74,0x7D50,0x8840,0x8A23,0x6708,0x4EF6,0x5039, +0x5026,0x5065,0x517C,0x5238,0x5263,0x55A7,0x570F,0x5805, +0x5ACC,0x5EFA,0x61B2,0x61F8,0x62F3,0x6372}; + +/* page 16 0x3821-0x387E */ +static uint16 tab_jisx0208_uni16[]={ +0x691C,0x6A29,0x727D,0x72AC,0x732E,0x7814,0x786F,0x7D79, +0x770C,0x80A9,0x898B,0x8B19,0x8CE2,0x8ED2,0x9063,0x9375, +0x967A,0x9855,0x9A13,0x9E78,0x5143,0x539F,0x53B3,0x5E7B, +0x5F26,0x6E1B,0x6E90,0x7384,0x73FE,0x7D43,0x8237,0x8A00, +0x8AFA,0x9650,0x4E4E,0x500B,0x53E4,0x547C,0x56FA,0x59D1, +0x5B64,0x5DF1,0x5EAB,0x5F27,0x6238,0x6545,0x67AF,0x6E56, +0x72D0,0x7CCA,0x88B4,0x80A1,0x80E1,0x83F0,0x864E,0x8A87, +0x8DE8,0x9237,0x96C7,0x9867,0x9F13,0x4E94,0x4E92,0x4F0D, +0x5348,0x5449,0x543E,0x5A2F,0x5F8C,0x5FA1,0x609F,0x68A7, +0x6A8E,0x745A,0x7881,0x8A9E,0x8AA4,0x8B77,0x9190,0x4E5E, +0x9BC9,0x4EA4,0x4F7C,0x4FAF,0x5019,0x5016,0x5149,0x516C, +0x529F,0x52B9,0x52FE,0x539A,0x53E3,0x5411}; + +/* page 17 0x3921-0x397E */ +static uint16 tab_jisx0208_uni17[]={ +0x540E,0x5589,0x5751,0x57A2,0x597D,0x5B54,0x5B5D,0x5B8F, +0x5DE5,0x5DE7,0x5DF7,0x5E78,0x5E83,0x5E9A,0x5EB7,0x5F18, +0x6052,0x614C,0x6297,0x62D8,0x63A7,0x653B,0x6602,0x6643, +0x66F4,0x676D,0x6821,0x6897,0x69CB,0x6C5F,0x6D2A,0x6D69, +0x6E2F,0x6E9D,0x7532,0x7687,0x786C,0x7A3F,0x7CE0,0x7D05, +0x7D18,0x7D5E,0x7DB1,0x8015,0x8003,0x80AF,0x80B1,0x8154, +0x818F,0x822A,0x8352,0x884C,0x8861,0x8B1B,0x8CA2,0x8CFC, +0x90CA,0x9175,0x9271,0x783F,0x92FC,0x95A4,0x964D,0x9805, +0x9999,0x9AD8,0x9D3B,0x525B,0x52AB,0x53F7,0x5408,0x58D5, +0x62F7,0x6FE0,0x8C6A,0x8F5F,0x9EB9,0x514B,0x523B,0x544A, +0x56FD,0x7A40,0x9177,0x9D60,0x9ED2,0x7344,0x6F09,0x8170, +0x7511,0x5FFD,0x60DA,0x9AA8,0x72DB,0x8FBC}; + +/* page 18 0x3A21-0x3A7E */ +static uint16 tab_jisx0208_uni18[]={ +0x6B64,0x9803,0x4ECA,0x56F0,0x5764,0x58BE,0x5A5A,0x6068, +0x61C7,0x660F,0x6606,0x6839,0x68B1,0x6DF7,0x75D5,0x7D3A, +0x826E,0x9B42,0x4E9B,0x4F50,0x53C9,0x5506,0x5D6F,0x5DE6, +0x5DEE,0x67FB,0x6C99,0x7473,0x7802,0x8A50,0x9396,0x88DF, +0x5750,0x5EA7,0x632B,0x50B5,0x50AC,0x518D,0x6700,0x54C9, +0x585E,0x59BB,0x5BB0,0x5F69,0x624D,0x63A1,0x683D,0x6B73, +0x6E08,0x707D,0x91C7,0x7280,0x7815,0x7826,0x796D,0x658E, +0x7D30,0x83DC,0x88C1,0x8F09,0x969B,0x5264,0x5728,0x6750, +0x7F6A,0x8CA1,0x51B4,0x5742,0x962A,0x583A,0x698A,0x80B4, +0x54B2,0x5D0E,0x57FC,0x7895,0x9DFA,0x4F5C,0x524A,0x548B, +0x643E,0x6628,0x6714,0x67F5,0x7A84,0x7B56,0x7D22,0x932F, +0x685C,0x9BAD,0x7B39,0x5319,0x518A,0x5237}; + +/* page 19 0x3B21-0x3B7E */ +static uint16 tab_jisx0208_uni19[]={ +0x5BDF,0x62F6,0x64AE,0x64E6,0x672D,0x6BBA,0x85A9,0x96D1, +0x7690,0x9BD6,0x634C,0x9306,0x9BAB,0x76BF,0x6652,0x4E09, +0x5098,0x53C2,0x5C71,0x60E8,0x6492,0x6563,0x685F,0x71E6, +0x73CA,0x7523,0x7B97,0x7E82,0x8695,0x8B83,0x8CDB,0x9178, +0x9910,0x65AC,0x66AB,0x6B8B,0x4ED5,0x4ED4,0x4F3A,0x4F7F, +0x523A,0x53F8,0x53F2,0x55E3,0x56DB,0x58EB,0x59CB,0x59C9, +0x59FF,0x5B50,0x5C4D,0x5E02,0x5E2B,0x5FD7,0x601D,0x6307, +0x652F,0x5B5C,0x65AF,0x65BD,0x65E8,0x679D,0x6B62,0x6B7B, +0x6C0F,0x7345,0x7949,0x79C1,0x7CF8,0x7D19,0x7D2B,0x80A2, +0x8102,0x81F3,0x8996,0x8A5E,0x8A69,0x8A66,0x8A8C,0x8AEE, +0x8CC7,0x8CDC,0x96CC,0x98FC,0x6B6F,0x4E8B,0x4F3C,0x4F8D, +0x5150,0x5B57,0x5BFA,0x6148,0x6301,0x6642}; + +/* page 20 0x3C21-0x3C7E */ +static uint16 tab_jisx0208_uni20[]={ +0x6B21,0x6ECB,0x6CBB,0x723E,0x74BD,0x75D4,0x78C1,0x793A, +0x800C,0x8033,0x81EA,0x8494,0x8F9E,0x6C50,0x9E7F,0x5F0F, +0x8B58,0x9D2B,0x7AFA,0x8EF8,0x5B8D,0x96EB,0x4E03,0x53F1, +0x57F7,0x5931,0x5AC9,0x5BA4,0x6089,0x6E7F,0x6F06,0x75BE, +0x8CEA,0x5B9F,0x8500,0x7BE0,0x5072,0x67F4,0x829D,0x5C61, +0x854A,0x7E1E,0x820E,0x5199,0x5C04,0x6368,0x8D66,0x659C, +0x716E,0x793E,0x7D17,0x8005,0x8B1D,0x8ECA,0x906E,0x86C7, +0x90AA,0x501F,0x52FA,0x5C3A,0x6753,0x707C,0x7235,0x914C, +0x91C8,0x932B,0x82E5,0x5BC2,0x5F31,0x60F9,0x4E3B,0x53D6, +0x5B88,0x624B,0x6731,0x6B8A,0x72E9,0x73E0,0x7A2E,0x816B, +0x8DA3,0x9152,0x9996,0x5112,0x53D7,0x546A,0x5BFF,0x6388, +0x6A39,0x7DAC,0x9700,0x56DA,0x53CE,0x5468}; + +/* page 21 0x3D21-0x3D7E */ +static uint16 tab_jisx0208_uni21[]={ +0x5B97,0x5C31,0x5DDE,0x4FEE,0x6101,0x62FE,0x6D32,0x79C0, +0x79CB,0x7D42,0x7E4D,0x7FD2,0x81ED,0x821F,0x8490,0x8846, +0x8972,0x8B90,0x8E74,0x8F2F,0x9031,0x914B,0x916C,0x96C6, +0x919C,0x4EC0,0x4F4F,0x5145,0x5341,0x5F93,0x620E,0x67D4, +0x6C41,0x6E0B,0x7363,0x7E26,0x91CD,0x9283,0x53D4,0x5919, +0x5BBF,0x6DD1,0x795D,0x7E2E,0x7C9B,0x587E,0x719F,0x51FA, +0x8853,0x8FF0,0x4FCA,0x5CFB,0x6625,0x77AC,0x7AE3,0x821C, +0x99FF,0x51C6,0x5FAA,0x65EC,0x696F,0x6B89,0x6DF3,0x6E96, +0x6F64,0x76FE,0x7D14,0x5DE1,0x9075,0x9187,0x9806,0x51E6, +0x521D,0x6240,0x6691,0x66D9,0x6E1A,0x5EB6,0x7DD2,0x7F72, +0x66F8,0x85AF,0x85F7,0x8AF8,0x52A9,0x53D9,0x5973,0x5E8F, +0x5F90,0x6055,0x92E4,0x9664,0x50B7,0x511F}; + +/* page 22 0x3E21-0x3E7E */ +static uint16 tab_jisx0208_uni22[]={ +0x52DD,0x5320,0x5347,0x53EC,0x54E8,0x5546,0x5531,0x5617, +0x5968,0x59BE,0x5A3C,0x5BB5,0x5C06,0x5C0F,0x5C11,0x5C1A, +0x5E84,0x5E8A,0x5EE0,0x5F70,0x627F,0x6284,0x62DB,0x638C, +0x6377,0x6607,0x660C,0x662D,0x6676,0x677E,0x68A2,0x6A1F, +0x6A35,0x6CBC,0x6D88,0x6E09,0x6E58,0x713C,0x7126,0x7167, +0x75C7,0x7701,0x785D,0x7901,0x7965,0x79F0,0x7AE0,0x7B11, +0x7CA7,0x7D39,0x8096,0x83D6,0x848B,0x8549,0x885D,0x88F3, +0x8A1F,0x8A3C,0x8A54,0x8A73,0x8C61,0x8CDE,0x91A4,0x9266, +0x937E,0x9418,0x969C,0x9798,0x4E0A,0x4E08,0x4E1E,0x4E57, +0x5197,0x5270,0x57CE,0x5834,0x58CC,0x5B22,0x5E38,0x60C5, +0x64FE,0x6761,0x6756,0x6D44,0x72B6,0x7573,0x7A63,0x84B8, +0x8B72,0x91B8,0x9320,0x5631,0x57F4,0x98FE}; + +/* page 23 0x3F21-0x3F7E */ +static uint16 tab_jisx0208_uni23[]={ +0x62ED,0x690D,0x6B96,0x71ED,0x7E54,0x8077,0x8272,0x89E6, +0x98DF,0x8755,0x8FB1,0x5C3B,0x4F38,0x4FE1,0x4FB5,0x5507, +0x5A20,0x5BDD,0x5BE9,0x5FC3,0x614E,0x632F,0x65B0,0x664B, +0x68EE,0x699B,0x6D78,0x6DF1,0x7533,0x75B9,0x771F,0x795E, +0x79E6,0x7D33,0x81E3,0x82AF,0x85AA,0x89AA,0x8A3A,0x8EAB, +0x8F9B,0x9032,0x91DD,0x9707,0x4EBA,0x4EC1,0x5203,0x5875, +0x58EC,0x5C0B,0x751A,0x5C3D,0x814E,0x8A0A,0x8FC5,0x9663, +0x976D,0x7B25,0x8ACF,0x9808,0x9162,0x56F3,0x53A8,0x9017, +0x5439,0x5782,0x5E25,0x63A8,0x6C34,0x708A,0x7761,0x7C8B, +0x7FE0,0x8870,0x9042,0x9154,0x9310,0x9318,0x968F,0x745E, +0x9AC4,0x5D07,0x5D69,0x6570,0x67A2,0x8DA8,0x96DB,0x636E, +0x6749,0x6919,0x83C5,0x9817,0x96C0,0x88FE}; + +/* page 24 0x4021-0x407E */ +static uint16 tab_jisx0208_uni24[]={ +0x6F84,0x647A,0x5BF8,0x4E16,0x702C,0x755D,0x662F,0x51C4, +0x5236,0x52E2,0x59D3,0x5F81,0x6027,0x6210,0x653F,0x6574, +0x661F,0x6674,0x68F2,0x6816,0x6B63,0x6E05,0x7272,0x751F, +0x76DB,0x7CBE,0x8056,0x58F0,0x88FD,0x897F,0x8AA0,0x8A93, +0x8ACB,0x901D,0x9192,0x9752,0x9759,0x6589,0x7A0E,0x8106, +0x96BB,0x5E2D,0x60DC,0x621A,0x65A5,0x6614,0x6790,0x77F3, +0x7A4D,0x7C4D,0x7E3E,0x810A,0x8CAC,0x8D64,0x8DE1,0x8E5F, +0x78A9,0x5207,0x62D9,0x63A5,0x6442,0x6298,0x8A2D,0x7A83, +0x7BC0,0x8AAC,0x96EA,0x7D76,0x820C,0x8749,0x4ED9,0x5148, +0x5343,0x5360,0x5BA3,0x5C02,0x5C16,0x5DDD,0x6226,0x6247, +0x64B0,0x6813,0x6834,0x6CC9,0x6D45,0x6D17,0x67D3,0x6F5C, +0x714E,0x717D,0x65CB,0x7A7F,0x7BAD,0x7DDA}; + +/* page 25 0x4121-0x417E */ +static uint16 tab_jisx0208_uni25[]={ +0x7E4A,0x7FA8,0x817A,0x821B,0x8239,0x85A6,0x8A6E,0x8CCE, +0x8DF5,0x9078,0x9077,0x92AD,0x9291,0x9583,0x9BAE,0x524D, +0x5584,0x6F38,0x7136,0x5168,0x7985,0x7E55,0x81B3,0x7CCE, +0x564C,0x5851,0x5CA8,0x63AA,0x66FE,0x66FD,0x695A,0x72D9, +0x758F,0x758E,0x790E,0x7956,0x79DF,0x7C97,0x7D20,0x7D44, +0x8607,0x8A34,0x963B,0x9061,0x9F20,0x50E7,0x5275,0x53CC, +0x53E2,0x5009,0x55AA,0x58EE,0x594F,0x723D,0x5B8B,0x5C64, +0x531D,0x60E3,0x60F3,0x635C,0x6383,0x633F,0x63BB,0x64CD, +0x65E9,0x66F9,0x5DE3,0x69CD,0x69FD,0x6F15,0x71E5,0x4E89, +0x75E9,0x76F8,0x7A93,0x7CDF,0x7DCF,0x7D9C,0x8061,0x8349, +0x8358,0x846C,0x84BC,0x85FB,0x88C5,0x8D70,0x9001,0x906D, +0x9397,0x971C,0x9A12,0x50CF,0x5897,0x618E}; + +/* page 26 0x4221-0x427E */ +static uint16 tab_jisx0208_uni26[]={ +0x81D3,0x8535,0x8D08,0x9020,0x4FC3,0x5074,0x5247,0x5373, +0x606F,0x6349,0x675F,0x6E2C,0x8DB3,0x901F,0x4FD7,0x5C5E, +0x8CCA,0x65CF,0x7D9A,0x5352,0x8896,0x5176,0x63C3,0x5B58, +0x5B6B,0x5C0A,0x640D,0x6751,0x905C,0x4ED6,0x591A,0x592A, +0x6C70,0x8A51,0x553E,0x5815,0x59A5,0x60F0,0x6253,0x67C1, +0x8235,0x6955,0x9640,0x99C4,0x9A28,0x4F53,0x5806,0x5BFE, +0x8010,0x5CB1,0x5E2F,0x5F85,0x6020,0x614B,0x6234,0x66FF, +0x6CF0,0x6EDE,0x80CE,0x817F,0x82D4,0x888B,0x8CB8,0x9000, +0x902E,0x968A,0x9EDB,0x9BDB,0x4EE3,0x53F0,0x5927,0x7B2C, +0x918D,0x984C,0x9DF9,0x6EDD,0x7027,0x5353,0x5544,0x5B85, +0x6258,0x629E,0x62D3,0x6CA2,0x6FEF,0x7422,0x8A17,0x9438, +0x6FC1,0x8AFE,0x8338,0x51E7,0x86F8,0x53EA}; + +/* page 27 0x4321-0x437E */ +static uint16 tab_jisx0208_uni27[]={ +0x53E9,0x4F46,0x9054,0x8FB0,0x596A,0x8131,0x5DFD,0x7AEA, +0x8FBF,0x68DA,0x8C37,0x72F8,0x9C48,0x6A3D,0x8AB0,0x4E39, +0x5358,0x5606,0x5766,0x62C5,0x63A2,0x65E6,0x6B4E,0x6DE1, +0x6E5B,0x70AD,0x77ED,0x7AEF,0x7BAA,0x7DBB,0x803D,0x80C6, +0x86CB,0x8A95,0x935B,0x56E3,0x58C7,0x5F3E,0x65AD,0x6696, +0x6A80,0x6BB5,0x7537,0x8AC7,0x5024,0x77E5,0x5730,0x5F1B, +0x6065,0x667A,0x6C60,0x75F4,0x7A1A,0x7F6E,0x81F4,0x8718, +0x9045,0x99B3,0x7BC9,0x755C,0x7AF9,0x7B51,0x84C4,0x9010, +0x79E9,0x7A92,0x8336,0x5AE1,0x7740,0x4E2D,0x4EF2,0x5B99, +0x5FE0,0x62BD,0x663C,0x67F1,0x6CE8,0x866B,0x8877,0x8A3B, +0x914E,0x92F3,0x99D0,0x6A17,0x7026,0x732A,0x82E7,0x8457, +0x8CAF,0x4E01,0x5146,0x51CB,0x558B,0x5BF5}; + +/* page 28 0x4421-0x447E */ +static uint16 tab_jisx0208_uni28[]={ +0x5E16,0x5E33,0x5E81,0x5F14,0x5F35,0x5F6B,0x5FB4,0x61F2, +0x6311,0x66A2,0x671D,0x6F6E,0x7252,0x753A,0x773A,0x8074, +0x8139,0x8178,0x8776,0x8ABF,0x8ADC,0x8D85,0x8DF3,0x929A, +0x9577,0x9802,0x9CE5,0x52C5,0x6357,0x76F4,0x6715,0x6C88, +0x73CD,0x8CC3,0x93AE,0x9673,0x6D25,0x589C,0x690E,0x69CC, +0x8FFD,0x939A,0x75DB,0x901A,0x585A,0x6802,0x63B4,0x69FB, +0x4F43,0x6F2C,0x67D8,0x8FBB,0x8526,0x7DB4,0x9354,0x693F, +0x6F70,0x576A,0x58F7,0x5B2C,0x7D2C,0x722A,0x540A,0x91E3, +0x9DB4,0x4EAD,0x4F4E,0x505C,0x5075,0x5243,0x8C9E,0x5448, +0x5824,0x5B9A,0x5E1D,0x5E95,0x5EAD,0x5EF7,0x5F1F,0x608C, +0x62B5,0x633A,0x63D0,0x68AF,0x6C40,0x7887,0x798E,0x7A0B, +0x7DE0,0x8247,0x8A02,0x8AE6,0x8E44,0x9013}; + +/* page 29 0x4521-0x457E */ +static uint16 tab_jisx0208_uni29[]={ +0x90B8,0x912D,0x91D8,0x9F0E,0x6CE5,0x6458,0x64E2,0x6575, +0x6EF4,0x7684,0x7B1B,0x9069,0x93D1,0x6EBA,0x54F2,0x5FB9, +0x64A4,0x8F4D,0x8FED,0x9244,0x5178,0x586B,0x5929,0x5C55, +0x5E97,0x6DFB,0x7E8F,0x751C,0x8CBC,0x8EE2,0x985B,0x70B9, +0x4F1D,0x6BBF,0x6FB1,0x7530,0x96FB,0x514E,0x5410,0x5835, +0x5857,0x59AC,0x5C60,0x5F92,0x6597,0x675C,0x6E21,0x767B, +0x83DF,0x8CED,0x9014,0x90FD,0x934D,0x7825,0x783A,0x52AA, +0x5EA6,0x571F,0x5974,0x6012,0x5012,0x515A,0x51AC,0x51CD, +0x5200,0x5510,0x5854,0x5858,0x5957,0x5B95,0x5CF6,0x5D8B, +0x60BC,0x6295,0x642D,0x6771,0x6843,0x68BC,0x68DF,0x76D7, +0x6DD8,0x6E6F,0x6D9B,0x706F,0x71C8,0x5F53,0x75D8,0x7977, +0x7B49,0x7B54,0x7B52,0x7CD6,0x7D71,0x5230}; + +/* page 30 0x4621-0x467E */ +static uint16 tab_jisx0208_uni30[]={ +0x8463,0x8569,0x85E4,0x8A0E,0x8B04,0x8C46,0x8E0F,0x9003, +0x900F,0x9419,0x9676,0x982D,0x9A30,0x95D8,0x50CD,0x52D5, +0x540C,0x5802,0x5C0E,0x61A7,0x649E,0x6D1E,0x77B3,0x7AE5, +0x80F4,0x8404,0x9053,0x9285,0x5CE0,0x9D07,0x533F,0x5F97, +0x5FB3,0x6D9C,0x7279,0x7763,0x79BF,0x7BE4,0x6BD2,0x72EC, +0x8AAD,0x6803,0x6A61,0x51F8,0x7A81,0x6934,0x5C4A,0x9CF6, +0x82EB,0x5BC5,0x9149,0x701E,0x5678,0x5C6F,0x60C7,0x6566, +0x6C8C,0x8C5A,0x9041,0x9813,0x5451,0x66C7,0x920D,0x5948, +0x90A3,0x5185,0x4E4D,0x51EA,0x8599,0x8B0E,0x7058,0x637A, +0x934B,0x6962,0x99B4,0x7E04,0x7577,0x5357,0x6960,0x8EDF, +0x96E3,0x6C5D,0x4E8C,0x5C3C,0x5F10,0x8FE9,0x5302,0x8CD1, +0x8089,0x8679,0x5EFF,0x65E5,0x4E73,0x5165}; + +/* page 31 0x4721-0x477E */ +static uint16 tab_jisx0208_uni31[]={ +0x5982,0x5C3F,0x97EE,0x4EFB,0x598A,0x5FCD,0x8A8D,0x6FE1, +0x79B0,0x7962,0x5BE7,0x8471,0x732B,0x71B1,0x5E74,0x5FF5, +0x637B,0x649A,0x71C3,0x7C98,0x4E43,0x5EFC,0x4E4B,0x57DC, +0x56A2,0x60A9,0x6FC3,0x7D0D,0x80FD,0x8133,0x81BF,0x8FB2, +0x8997,0x86A4,0x5DF4,0x628A,0x64AD,0x8987,0x6777,0x6CE2, +0x6D3E,0x7436,0x7834,0x5A46,0x7F75,0x82AD,0x99AC,0x4FF3, +0x5EC3,0x62DD,0x6392,0x6557,0x676F,0x76C3,0x724C,0x80CC, +0x80BA,0x8F29,0x914D,0x500D,0x57F9,0x5A92,0x6885,0x6973, +0x7164,0x72FD,0x8CB7,0x58F2,0x8CE0,0x966A,0x9019,0x877F, +0x79E4,0x77E7,0x8429,0x4F2F,0x5265,0x535A,0x62CD,0x67CF, +0x6CCA,0x767D,0x7B94,0x7C95,0x8236,0x8584,0x8FEB,0x66DD, +0x6F20,0x7206,0x7E1B,0x83AB,0x99C1,0x9EA6}; + +/* page 32 0x4821-0x487E */ +static uint16 tab_jisx0208_uni32[]={ +0x51FD,0x7BB1,0x7872,0x7BB8,0x8087,0x7B48,0x6AE8,0x5E61, +0x808C,0x7551,0x7560,0x516B,0x9262,0x6E8C,0x767A,0x9197, +0x9AEA,0x4F10,0x7F70,0x629C,0x7B4F,0x95A5,0x9CE9,0x567A, +0x5859,0x86E4,0x96BC,0x4F34,0x5224,0x534A,0x53CD,0x53DB, +0x5E06,0x642C,0x6591,0x677F,0x6C3E,0x6C4E,0x7248,0x72AF, +0x73ED,0x7554,0x7E41,0x822C,0x85E9,0x8CA9,0x7BC4,0x91C6, +0x7169,0x9812,0x98EF,0x633D,0x6669,0x756A,0x76E4,0x78D0, +0x8543,0x86EE,0x532A,0x5351,0x5426,0x5983,0x5E87,0x5F7C, +0x60B2,0x6249,0x6279,0x62AB,0x6590,0x6BD4,0x6CCC,0x75B2, +0x76AE,0x7891,0x79D8,0x7DCB,0x7F77,0x80A5,0x88AB,0x8AB9, +0x8CBB,0x907F,0x975E,0x98DB,0x6A0B,0x7C38,0x5099,0x5C3E, +0x5FAE,0x6787,0x6BD8,0x7435,0x7709,0x7F8E}; + +/* page 33 0x4921-0x497E */ +static uint16 tab_jisx0208_uni33[]={ +0x9F3B,0x67CA,0x7A17,0x5339,0x758B,0x9AED,0x5F66,0x819D, +0x83F1,0x8098,0x5F3C,0x5FC5,0x7562,0x7B46,0x903C,0x6867, +0x59EB,0x5A9B,0x7D10,0x767E,0x8B2C,0x4FF5,0x5F6A,0x6A19, +0x6C37,0x6F02,0x74E2,0x7968,0x8868,0x8A55,0x8C79,0x5EDF, +0x63CF,0x75C5,0x79D2,0x82D7,0x9328,0x92F2,0x849C,0x86ED, +0x9C2D,0x54C1,0x5F6C,0x658C,0x6D5C,0x7015,0x8CA7,0x8CD3, +0x983B,0x654F,0x74F6,0x4E0D,0x4ED8,0x57E0,0x592B,0x5A66, +0x5BCC,0x51A8,0x5E03,0x5E9C,0x6016,0x6276,0x6577,0x65A7, +0x666E,0x6D6E,0x7236,0x7B26,0x8150,0x819A,0x8299,0x8B5C, +0x8CA0,0x8CE6,0x8D74,0x961C,0x9644,0x4FAE,0x64AB,0x6B66, +0x821E,0x8461,0x856A,0x90E8,0x5C01,0x6953,0x98A8,0x847A, +0x8557,0x4F0F,0x526F,0x5FA9,0x5E45,0x670D}; + +/* page 34 0x4A21-0x4A7E */ +static uint16 tab_jisx0208_uni34[]={ +0x798F,0x8179,0x8907,0x8986,0x6DF5,0x5F17,0x6255,0x6CB8, +0x4ECF,0x7269,0x9B92,0x5206,0x543B,0x5674,0x58B3,0x61A4, +0x626E,0x711A,0x596E,0x7C89,0x7CDE,0x7D1B,0x96F0,0x6587, +0x805E,0x4E19,0x4F75,0x5175,0x5840,0x5E63,0x5E73,0x5F0A, +0x67C4,0x4E26,0x853D,0x9589,0x965B,0x7C73,0x9801,0x50FB, +0x58C1,0x7656,0x78A7,0x5225,0x77A5,0x8511,0x7B86,0x504F, +0x5909,0x7247,0x7BC7,0x7DE8,0x8FBA,0x8FD4,0x904D,0x4FBF, +0x52C9,0x5A29,0x5F01,0x97AD,0x4FDD,0x8217,0x92EA,0x5703, +0x6355,0x6B69,0x752B,0x88DC,0x8F14,0x7A42,0x52DF,0x5893, +0x6155,0x620A,0x66AE,0x6BCD,0x7C3F,0x83E9,0x5023,0x4FF8, +0x5305,0x5446,0x5831,0x5949,0x5B9D,0x5CF0,0x5CEF,0x5D29, +0x5E96,0x62B1,0x6367,0x653E,0x65B9,0x670B}; + +/* page 35 0x4B21-0x4B7E */ +static uint16 tab_jisx0208_uni35[]={ +0x6CD5,0x6CE1,0x70F9,0x7832,0x7E2B,0x80DE,0x82B3,0x840C, +0x84EC,0x8702,0x8912,0x8A2A,0x8C4A,0x90A6,0x92D2,0x98FD, +0x9CF3,0x9D6C,0x4E4F,0x4EA1,0x508D,0x5256,0x574A,0x59A8, +0x5E3D,0x5FD8,0x5FD9,0x623F,0x66B4,0x671B,0x67D0,0x68D2, +0x5192,0x7D21,0x80AA,0x81A8,0x8B00,0x8C8C,0x8CBF,0x927E, +0x9632,0x5420,0x982C,0x5317,0x50D5,0x535C,0x58A8,0x64B2, +0x6734,0x7267,0x7766,0x7A46,0x91E6,0x52C3,0x6CA1,0x6B86, +0x5800,0x5E4C,0x5954,0x672C,0x7FFB,0x51E1,0x76C6,0x6469, +0x78E8,0x9B54,0x9EBB,0x57CB,0x59B9,0x6627,0x679A,0x6BCE, +0x54E9,0x69D9,0x5E55,0x819C,0x6795,0x9BAA,0x67FE,0x9C52, +0x685D,0x4EA6,0x4FE3,0x53C8,0x62B9,0x672B,0x6CAB,0x8FC4, +0x4FAD,0x7E6D,0x9EBF,0x4E07,0x6162,0x6E80}; + +/* page 36 0x4C21-0x4C7E */ +static uint16 tab_jisx0208_uni36[]={ +0x6F2B,0x8513,0x5473,0x672A,0x9B45,0x5DF3,0x7B95,0x5CAC, +0x5BC6,0x871C,0x6E4A,0x84D1,0x7A14,0x8108,0x5999,0x7C8D, +0x6C11,0x7720,0x52D9,0x5922,0x7121,0x725F,0x77DB,0x9727, +0x9D61,0x690B,0x5A7F,0x5A18,0x51A5,0x540D,0x547D,0x660E, +0x76DF,0x8FF7,0x9298,0x9CF4,0x59EA,0x725D,0x6EC5,0x514D, +0x68C9,0x7DBF,0x7DEC,0x9762,0x9EBA,0x6478,0x6A21,0x8302, +0x5984,0x5B5F,0x6BDB,0x731B,0x76F2,0x7DB2,0x8017,0x8499, +0x5132,0x6728,0x9ED9,0x76EE,0x6762,0x52FF,0x9905,0x5C24, +0x623B,0x7C7E,0x8CB0,0x554F,0x60B6,0x7D0B,0x9580,0x5301, +0x4E5F,0x51B6,0x591C,0x723A,0x8036,0x91CE,0x5F25,0x77E2, +0x5384,0x5F79,0x7D04,0x85AC,0x8A33,0x8E8D,0x9756,0x67F3, +0x85AE,0x9453,0x6109,0x6108,0x6CB9,0x7652}; + +/* page 37 0x4D21-0x4D7E */ +static uint16 tab_jisx0208_uni37[]={ +0x8AED,0x8F38,0x552F,0x4F51,0x512A,0x52C7,0x53CB,0x5BA5, +0x5E7D,0x60A0,0x6182,0x63D6,0x6709,0x67DA,0x6E67,0x6D8C, +0x7336,0x7337,0x7531,0x7950,0x88D5,0x8A98,0x904A,0x9091, +0x90F5,0x96C4,0x878D,0x5915,0x4E88,0x4F59,0x4E0E,0x8A89, +0x8F3F,0x9810,0x50AD,0x5E7C,0x5996,0x5BB9,0x5EB8,0x63DA, +0x63FA,0x64C1,0x66DC,0x694A,0x69D8,0x6D0B,0x6EB6,0x7194, +0x7528,0x7AAF,0x7F8A,0x8000,0x8449,0x84C9,0x8981,0x8B21, +0x8E0A,0x9065,0x967D,0x990A,0x617E,0x6291,0x6B32,0x6C83, +0x6D74,0x7FCC,0x7FFC,0x6DC0,0x7F85,0x87BA,0x88F8,0x6765, +0x83B1,0x983C,0x96F7,0x6D1B,0x7D61,0x843D,0x916A,0x4E71, +0x5375,0x5D50,0x6B04,0x6FEB,0x85CD,0x862D,0x89A7,0x5229, +0x540F,0x5C65,0x674E,0x68A8,0x7406,0x7483}; + +/* page 38 0x4E21-0x4E7E */ +static uint16 tab_jisx0208_uni38[]={ +0x75E2,0x88CF,0x88E1,0x91CC,0x96E2,0x9678,0x5F8B,0x7387, +0x7ACB,0x844E,0x63A0,0x7565,0x5289,0x6D41,0x6E9C,0x7409, +0x7559,0x786B,0x7C92,0x9686,0x7ADC,0x9F8D,0x4FB6,0x616E, +0x65C5,0x865C,0x4E86,0x4EAE,0x50DA,0x4E21,0x51CC,0x5BEE, +0x6599,0x6881,0x6DBC,0x731F,0x7642,0x77AD,0x7A1C,0x7CE7, +0x826F,0x8AD2,0x907C,0x91CF,0x9675,0x9818,0x529B,0x7DD1, +0x502B,0x5398,0x6797,0x6DCB,0x71D0,0x7433,0x81E8,0x8F2A, +0x96A3,0x9C57,0x9E9F,0x7460,0x5841,0x6D99,0x7D2F,0x985E, +0x4EE4,0x4F36,0x4F8B,0x51B7,0x52B1,0x5DBA,0x601C,0x73B2, +0x793C,0x82D3,0x9234,0x96B7,0x96F6,0x970A,0x9E97,0x9F62, +0x66A6,0x6B74,0x5217,0x52A3,0x70C8,0x88C2,0x5EC9,0x604B, +0x6190,0x6F23,0x7149,0x7C3E,0x7DF4,0x806F}; + +/* page 39 0x4F21-0x4F53 */ +static uint16 tab_jisx0208_uni39[]={ +0x84EE,0x9023,0x932C,0x5442,0x9B6F,0x6AD3,0x7089,0x8CC2, +0x8DEF,0x9732,0x52B4,0x5A41,0x5ECA,0x5F04,0x6717,0x697C, +0x6994,0x6D6A,0x6F0F,0x7262,0x72FC,0x7BED,0x8001,0x807E, +0x874B,0x90CE,0x516D,0x9E93,0x7984,0x808B,0x9332,0x8AD6, +0x502D,0x548C,0x8A71,0x6B6A,0x8CC4,0x8107,0x60D1,0x67A0, +0x9DF2,0x4E99,0x4E98,0x9C10,0x8A6B,0x85C1,0x8568,0x6900, +0x6E7E,0x7897,0x8155}; + +/* page 40 0x5021-0x507E */ +static uint16 tab_jisx0208_uni40[]={ +0x5F0C,0x4E10,0x4E15,0x4E2A,0x4E31,0x4E36,0x4E3C,0x4E3F, +0x4E42,0x4E56,0x4E58,0x4E82,0x4E85,0x8C6B,0x4E8A,0x8212, +0x5F0D,0x4E8E,0x4E9E,0x4E9F,0x4EA0,0x4EA2,0x4EB0,0x4EB3, +0x4EB6,0x4ECE,0x4ECD,0x4EC4,0x4EC6,0x4EC2,0x4ED7,0x4EDE, +0x4EED,0x4EDF,0x4EF7,0x4F09,0x4F5A,0x4F30,0x4F5B,0x4F5D, +0x4F57,0x4F47,0x4F76,0x4F88,0x4F8F,0x4F98,0x4F7B,0x4F69, +0x4F70,0x4F91,0x4F6F,0x4F86,0x4F96,0x5118,0x4FD4,0x4FDF, +0x4FCE,0x4FD8,0x4FDB,0x4FD1,0x4FDA,0x4FD0,0x4FE4,0x4FE5, +0x501A,0x5028,0x5014,0x502A,0x5025,0x5005,0x4F1C,0x4FF6, +0x5021,0x5029,0x502C,0x4FFE,0x4FEF,0x5011,0x5006,0x5043, +0x5047,0x6703,0x5055,0x5050,0x5048,0x505A,0x5056,0x506C, +0x5078,0x5080,0x509A,0x5085,0x50B4,0x50B2}; + +/* page 41 0x5121-0x517E */ +static uint16 tab_jisx0208_uni41[]={ +0x50C9,0x50CA,0x50B3,0x50C2,0x50D6,0x50DE,0x50E5,0x50ED, +0x50E3,0x50EE,0x50F9,0x50F5,0x5109,0x5101,0x5102,0x5116, +0x5115,0x5114,0x511A,0x5121,0x513A,0x5137,0x513C,0x513B, +0x513F,0x5140,0x5152,0x514C,0x5154,0x5162,0x7AF8,0x5169, +0x516A,0x516E,0x5180,0x5182,0x56D8,0x518C,0x5189,0x518F, +0x5191,0x5193,0x5195,0x5196,0x51A4,0x51A6,0x51A2,0x51A9, +0x51AA,0x51AB,0x51B3,0x51B1,0x51B2,0x51B0,0x51B5,0x51BD, +0x51C5,0x51C9,0x51DB,0x51E0,0x8655,0x51E9,0x51ED,0x51F0, +0x51F5,0x51FE,0x5204,0x520B,0x5214,0x520E,0x5227,0x522A, +0x522E,0x5233,0x5239,0x524F,0x5244,0x524B,0x524C,0x525E, +0x5254,0x526A,0x5274,0x5269,0x5273,0x527F,0x527D,0x528D, +0x5294,0x5292,0x5271,0x5288,0x5291,0x8FA8}; + +/* page 42 0x5221-0x527E */ +static uint16 tab_jisx0208_uni42[]={ +0x8FA7,0x52AC,0x52AD,0x52BC,0x52B5,0x52C1,0x52CD,0x52D7, +0x52DE,0x52E3,0x52E6,0x98ED,0x52E0,0x52F3,0x52F5,0x52F8, +0x52F9,0x5306,0x5308,0x7538,0x530D,0x5310,0x530F,0x5315, +0x531A,0x5323,0x532F,0x5331,0x5333,0x5338,0x5340,0x5346, +0x5345,0x4E17,0x5349,0x534D,0x51D6,0x535E,0x5369,0x536E, +0x5918,0x537B,0x5377,0x5382,0x5396,0x53A0,0x53A6,0x53A5, +0x53AE,0x53B0,0x53B6,0x53C3,0x7C12,0x96D9,0x53DF,0x66FC, +0x71EE,0x53EE,0x53E8,0x53ED,0x53FA,0x5401,0x543D,0x5440, +0x542C,0x542D,0x543C,0x542E,0x5436,0x5429,0x541D,0x544E, +0x548F,0x5475,0x548E,0x545F,0x5471,0x5477,0x5470,0x5492, +0x547B,0x5480,0x5476,0x5484,0x5490,0x5486,0x54C7,0x54A2, +0x54B8,0x54A5,0x54AC,0x54C4,0x54C8,0x54A8}; + +/* page 43 0x5321-0x537E */ +static uint16 tab_jisx0208_uni43[]={ +0x54AB,0x54C2,0x54A4,0x54BE,0x54BC,0x54D8,0x54E5,0x54E6, +0x550F,0x5514,0x54FD,0x54EE,0x54ED,0x54FA,0x54E2,0x5539, +0x5540,0x5563,0x554C,0x552E,0x555C,0x5545,0x5556,0x5557, +0x5538,0x5533,0x555D,0x5599,0x5580,0x54AF,0x558A,0x559F, +0x557B,0x557E,0x5598,0x559E,0x55AE,0x557C,0x5583,0x55A9, +0x5587,0x55A8,0x55DA,0x55C5,0x55DF,0x55C4,0x55DC,0x55E4, +0x55D4,0x5614,0x55F7,0x5616,0x55FE,0x55FD,0x561B,0x55F9, +0x564E,0x5650,0x71DF,0x5634,0x5636,0x5632,0x5638,0x566B, +0x5664,0x562F,0x566C,0x566A,0x5686,0x5680,0x568A,0x56A0, +0x5694,0x568F,0x56A5,0x56AE,0x56B6,0x56B4,0x56C2,0x56BC, +0x56C1,0x56C3,0x56C0,0x56C8,0x56CE,0x56D1,0x56D3,0x56D7, +0x56EE,0x56F9,0x5700,0x56FF,0x5704,0x5709}; + +/* page 44 0x5421-0x547E */ +static uint16 tab_jisx0208_uni44[]={ +0x5708,0x570B,0x570D,0x5713,0x5718,0x5716,0x55C7,0x571C, +0x5726,0x5737,0x5738,0x574E,0x573B,0x5740,0x574F,0x5769, +0x57C0,0x5788,0x5761,0x577F,0x5789,0x5793,0x57A0,0x57B3, +0x57A4,0x57AA,0x57B0,0x57C3,0x57C6,0x57D4,0x57D2,0x57D3, +0x580A,0x57D6,0x57E3,0x580B,0x5819,0x581D,0x5872,0x5821, +0x5862,0x584B,0x5870,0x6BC0,0x5852,0x583D,0x5879,0x5885, +0x58B9,0x589F,0x58AB,0x58BA,0x58DE,0x58BB,0x58B8,0x58AE, +0x58C5,0x58D3,0x58D1,0x58D7,0x58D9,0x58D8,0x58E5,0x58DC, +0x58E4,0x58DF,0x58EF,0x58FA,0x58F9,0x58FB,0x58FC,0x58FD, +0x5902,0x590A,0x5910,0x591B,0x68A6,0x5925,0x592C,0x592D, +0x5932,0x5938,0x593E,0x7AD2,0x5955,0x5950,0x594E,0x595A, +0x5958,0x5962,0x5960,0x5967,0x596C,0x5969}; + +/* page 45 0x5521-0x557E */ +static uint16 tab_jisx0208_uni45[]={ +0x5978,0x5981,0x599D,0x4F5E,0x4FAB,0x59A3,0x59B2,0x59C6, +0x59E8,0x59DC,0x598D,0x59D9,0x59DA,0x5A25,0x5A1F,0x5A11, +0x5A1C,0x5A09,0x5A1A,0x5A40,0x5A6C,0x5A49,0x5A35,0x5A36, +0x5A62,0x5A6A,0x5A9A,0x5ABC,0x5ABE,0x5ACB,0x5AC2,0x5ABD, +0x5AE3,0x5AD7,0x5AE6,0x5AE9,0x5AD6,0x5AFA,0x5AFB,0x5B0C, +0x5B0B,0x5B16,0x5B32,0x5AD0,0x5B2A,0x5B36,0x5B3E,0x5B43, +0x5B45,0x5B40,0x5B51,0x5B55,0x5B5A,0x5B5B,0x5B65,0x5B69, +0x5B70,0x5B73,0x5B75,0x5B78,0x6588,0x5B7A,0x5B80,0x5B83, +0x5BA6,0x5BB8,0x5BC3,0x5BC7,0x5BC9,0x5BD4,0x5BD0,0x5BE4, +0x5BE6,0x5BE2,0x5BDE,0x5BE5,0x5BEB,0x5BF0,0x5BF6,0x5BF3, +0x5C05,0x5C07,0x5C08,0x5C0D,0x5C13,0x5C20,0x5C22,0x5C28, +0x5C38,0x5C39,0x5C41,0x5C46,0x5C4E,0x5C53}; + +/* page 46 0x5621-0x567E */ +static uint16 tab_jisx0208_uni46[]={ +0x5C50,0x5C4F,0x5B71,0x5C6C,0x5C6E,0x4E62,0x5C76,0x5C79, +0x5C8C,0x5C91,0x5C94,0x599B,0x5CAB,0x5CBB,0x5CB6,0x5CBC, +0x5CB7,0x5CC5,0x5CBE,0x5CC7,0x5CD9,0x5CE9,0x5CFD,0x5CFA, +0x5CED,0x5D8C,0x5CEA,0x5D0B,0x5D15,0x5D17,0x5D5C,0x5D1F, +0x5D1B,0x5D11,0x5D14,0x5D22,0x5D1A,0x5D19,0x5D18,0x5D4C, +0x5D52,0x5D4E,0x5D4B,0x5D6C,0x5D73,0x5D76,0x5D87,0x5D84, +0x5D82,0x5DA2,0x5D9D,0x5DAC,0x5DAE,0x5DBD,0x5D90,0x5DB7, +0x5DBC,0x5DC9,0x5DCD,0x5DD3,0x5DD2,0x5DD6,0x5DDB,0x5DEB, +0x5DF2,0x5DF5,0x5E0B,0x5E1A,0x5E19,0x5E11,0x5E1B,0x5E36, +0x5E37,0x5E44,0x5E43,0x5E40,0x5E4E,0x5E57,0x5E54,0x5E5F, +0x5E62,0x5E64,0x5E47,0x5E75,0x5E76,0x5E7A,0x9EBC,0x5E7F, +0x5EA0,0x5EC1,0x5EC2,0x5EC8,0x5ED0,0x5ECF}; + +/* page 47 0x5721-0x577E */ +static uint16 tab_jisx0208_uni47[]={ +0x5ED6,0x5EE3,0x5EDD,0x5EDA,0x5EDB,0x5EE2,0x5EE1,0x5EE8, +0x5EE9,0x5EEC,0x5EF1,0x5EF3,0x5EF0,0x5EF4,0x5EF8,0x5EFE, +0x5F03,0x5F09,0x5F5D,0x5F5C,0x5F0B,0x5F11,0x5F16,0x5F29, +0x5F2D,0x5F38,0x5F41,0x5F48,0x5F4C,0x5F4E,0x5F2F,0x5F51, +0x5F56,0x5F57,0x5F59,0x5F61,0x5F6D,0x5F73,0x5F77,0x5F83, +0x5F82,0x5F7F,0x5F8A,0x5F88,0x5F91,0x5F87,0x5F9E,0x5F99, +0x5F98,0x5FA0,0x5FA8,0x5FAD,0x5FBC,0x5FD6,0x5FFB,0x5FE4, +0x5FF8,0x5FF1,0x5FDD,0x60B3,0x5FFF,0x6021,0x6060,0x6019, +0x6010,0x6029,0x600E,0x6031,0x601B,0x6015,0x602B,0x6026, +0x600F,0x603A,0x605A,0x6041,0x606A,0x6077,0x605F,0x604A, +0x6046,0x604D,0x6063,0x6043,0x6064,0x6042,0x606C,0x606B, +0x6059,0x6081,0x608D,0x60E7,0x6083,0x609A}; + +/* page 48 0x5821-0x587E */ +static uint16 tab_jisx0208_uni48[]={ +0x6084,0x609B,0x6096,0x6097,0x6092,0x60A7,0x608B,0x60E1, +0x60B8,0x60E0,0x60D3,0x60B4,0x5FF0,0x60BD,0x60C6,0x60B5, +0x60D8,0x614D,0x6115,0x6106,0x60F6,0x60F7,0x6100,0x60F4, +0x60FA,0x6103,0x6121,0x60FB,0x60F1,0x610D,0x610E,0x6147, +0x613E,0x6128,0x6127,0x614A,0x613F,0x613C,0x612C,0x6134, +0x613D,0x6142,0x6144,0x6173,0x6177,0x6158,0x6159,0x615A, +0x616B,0x6174,0x616F,0x6165,0x6171,0x615F,0x615D,0x6153, +0x6175,0x6199,0x6196,0x6187,0x61AC,0x6194,0x619A,0x618A, +0x6191,0x61AB,0x61AE,0x61CC,0x61CA,0x61C9,0x61F7,0x61C8, +0x61C3,0x61C6,0x61BA,0x61CB,0x7F79,0x61CD,0x61E6,0x61E3, +0x61F6,0x61FA,0x61F4,0x61FF,0x61FD,0x61FC,0x61FE,0x6200, +0x6208,0x6209,0x620D,0x620C,0x6214,0x621B}; + +/* page 49 0x5921-0x597E */ +static uint16 tab_jisx0208_uni49[]={ +0x621E,0x6221,0x622A,0x622E,0x6230,0x6232,0x6233,0x6241, +0x624E,0x625E,0x6263,0x625B,0x6260,0x6268,0x627C,0x6282, +0x6289,0x627E,0x6292,0x6293,0x6296,0x62D4,0x6283,0x6294, +0x62D7,0x62D1,0x62BB,0x62CF,0x62FF,0x62C6,0x64D4,0x62C8, +0x62DC,0x62CC,0x62CA,0x62C2,0x62C7,0x629B,0x62C9,0x630C, +0x62EE,0x62F1,0x6327,0x6302,0x6308,0x62EF,0x62F5,0x6350, +0x633E,0x634D,0x641C,0x634F,0x6396,0x638E,0x6380,0x63AB, +0x6376,0x63A3,0x638F,0x6389,0x639F,0x63B5,0x636B,0x6369, +0x63BE,0x63E9,0x63C0,0x63C6,0x63E3,0x63C9,0x63D2,0x63F6, +0x63C4,0x6416,0x6434,0x6406,0x6413,0x6426,0x6436,0x651D, +0x6417,0x6428,0x640F,0x6467,0x646F,0x6476,0x644E,0x652A, +0x6495,0x6493,0x64A5,0x64A9,0x6488,0x64BC}; + +/* page 50 0x5A21-0x5A7E */ +static uint16 tab_jisx0208_uni50[]={ +0x64DA,0x64D2,0x64C5,0x64C7,0x64BB,0x64D8,0x64C2,0x64F1, +0x64E7,0x8209,0x64E0,0x64E1,0x62AC,0x64E3,0x64EF,0x652C, +0x64F6,0x64F4,0x64F2,0x64FA,0x6500,0x64FD,0x6518,0x651C, +0x6505,0x6524,0x6523,0x652B,0x6534,0x6535,0x6537,0x6536, +0x6538,0x754B,0x6548,0x6556,0x6555,0x654D,0x6558,0x655E, +0x655D,0x6572,0x6578,0x6582,0x6583,0x8B8A,0x659B,0x659F, +0x65AB,0x65B7,0x65C3,0x65C6,0x65C1,0x65C4,0x65CC,0x65D2, +0x65DB,0x65D9,0x65E0,0x65E1,0x65F1,0x6772,0x660A,0x6603, +0x65FB,0x6773,0x6635,0x6636,0x6634,0x661C,0x664F,0x6644, +0x6649,0x6641,0x665E,0x665D,0x6664,0x6667,0x6668,0x665F, +0x6662,0x6670,0x6683,0x6688,0x668E,0x6689,0x6684,0x6698, +0x669D,0x66C1,0x66B9,0x66C9,0x66BE,0x66BC}; + +/* page 51 0x5B21-0x5B7E */ +static uint16 tab_jisx0208_uni51[]={ +0x66C4,0x66B8,0x66D6,0x66DA,0x66E0,0x663F,0x66E6,0x66E9, +0x66F0,0x66F5,0x66F7,0x670F,0x6716,0x671E,0x6726,0x6727, +0x9738,0x672E,0x673F,0x6736,0x6741,0x6738,0x6737,0x6746, +0x675E,0x6760,0x6759,0x6763,0x6764,0x6789,0x6770,0x67A9, +0x677C,0x676A,0x678C,0x678B,0x67A6,0x67A1,0x6785,0x67B7, +0x67EF,0x67B4,0x67EC,0x67B3,0x67E9,0x67B8,0x67E4,0x67DE, +0x67DD,0x67E2,0x67EE,0x67B9,0x67CE,0x67C6,0x67E7,0x6A9C, +0x681E,0x6846,0x6829,0x6840,0x684D,0x6832,0x684E,0x68B3, +0x682B,0x6859,0x6863,0x6877,0x687F,0x689F,0x688F,0x68AD, +0x6894,0x689D,0x689B,0x6883,0x6AAE,0x68B9,0x6874,0x68B5, +0x68A0,0x68BA,0x690F,0x688D,0x687E,0x6901,0x68CA,0x6908, +0x68D8,0x6922,0x6926,0x68E1,0x690C,0x68CD}; + +/* page 52 0x5C21-0x5C7E */ +static uint16 tab_jisx0208_uni52[]={ +0x68D4,0x68E7,0x68D5,0x6936,0x6912,0x6904,0x68D7,0x68E3, +0x6925,0x68F9,0x68E0,0x68EF,0x6928,0x692A,0x691A,0x6923, +0x6921,0x68C6,0x6979,0x6977,0x695C,0x6978,0x696B,0x6954, +0x697E,0x696E,0x6939,0x6974,0x693D,0x6959,0x6930,0x6961, +0x695E,0x695D,0x6981,0x696A,0x69B2,0x69AE,0x69D0,0x69BF, +0x69C1,0x69D3,0x69BE,0x69CE,0x5BE8,0x69CA,0x69DD,0x69BB, +0x69C3,0x69A7,0x6A2E,0x6991,0x69A0,0x699C,0x6995,0x69B4, +0x69DE,0x69E8,0x6A02,0x6A1B,0x69FF,0x6B0A,0x69F9,0x69F2, +0x69E7,0x6A05,0x69B1,0x6A1E,0x69ED,0x6A14,0x69EB,0x6A0A, +0x6A12,0x6AC1,0x6A23,0x6A13,0x6A44,0x6A0C,0x6A72,0x6A36, +0x6A78,0x6A47,0x6A62,0x6A59,0x6A66,0x6A48,0x6A38,0x6A22, +0x6A90,0x6A8D,0x6AA0,0x6A84,0x6AA2,0x6AA3}; + +/* page 53 0x5D21-0x5D7E */ +static uint16 tab_jisx0208_uni53[]={ +0x6A97,0x8617,0x6ABB,0x6AC3,0x6AC2,0x6AB8,0x6AB3,0x6AAC, +0x6ADE,0x6AD1,0x6ADF,0x6AAA,0x6ADA,0x6AEA,0x6AFB,0x6B05, +0x8616,0x6AFA,0x6B12,0x6B16,0x9B31,0x6B1F,0x6B38,0x6B37, +0x76DC,0x6B39,0x98EE,0x6B47,0x6B43,0x6B49,0x6B50,0x6B59, +0x6B54,0x6B5B,0x6B5F,0x6B61,0x6B78,0x6B79,0x6B7F,0x6B80, +0x6B84,0x6B83,0x6B8D,0x6B98,0x6B95,0x6B9E,0x6BA4,0x6BAA, +0x6BAB,0x6BAF,0x6BB2,0x6BB1,0x6BB3,0x6BB7,0x6BBC,0x6BC6, +0x6BCB,0x6BD3,0x6BDF,0x6BEC,0x6BEB,0x6BF3,0x6BEF,0x9EBE, +0x6C08,0x6C13,0x6C14,0x6C1B,0x6C24,0x6C23,0x6C5E,0x6C55, +0x6C62,0x6C6A,0x6C82,0x6C8D,0x6C9A,0x6C81,0x6C9B,0x6C7E, +0x6C68,0x6C73,0x6C92,0x6C90,0x6CC4,0x6CF1,0x6CD3,0x6CBD, +0x6CD7,0x6CC5,0x6CDD,0x6CAE,0x6CB1,0x6CBE}; + +/* page 54 0x5E21-0x5E7E */ +static uint16 tab_jisx0208_uni54[]={ +0x6CBA,0x6CDB,0x6CEF,0x6CD9,0x6CEA,0x6D1F,0x884D,0x6D36, +0x6D2B,0x6D3D,0x6D38,0x6D19,0x6D35,0x6D33,0x6D12,0x6D0C, +0x6D63,0x6D93,0x6D64,0x6D5A,0x6D79,0x6D59,0x6D8E,0x6D95, +0x6FE4,0x6D85,0x6DF9,0x6E15,0x6E0A,0x6DB5,0x6DC7,0x6DE6, +0x6DB8,0x6DC6,0x6DEC,0x6DDE,0x6DCC,0x6DE8,0x6DD2,0x6DC5, +0x6DFA,0x6DD9,0x6DE4,0x6DD5,0x6DEA,0x6DEE,0x6E2D,0x6E6E, +0x6E2E,0x6E19,0x6E72,0x6E5F,0x6E3E,0x6E23,0x6E6B,0x6E2B, +0x6E76,0x6E4D,0x6E1F,0x6E43,0x6E3A,0x6E4E,0x6E24,0x6EFF, +0x6E1D,0x6E38,0x6E82,0x6EAA,0x6E98,0x6EC9,0x6EB7,0x6ED3, +0x6EBD,0x6EAF,0x6EC4,0x6EB2,0x6ED4,0x6ED5,0x6E8F,0x6EA5, +0x6EC2,0x6E9F,0x6F41,0x6F11,0x704C,0x6EEC,0x6EF8,0x6EFE, +0x6F3F,0x6EF2,0x6F31,0x6EEF,0x6F32,0x6ECC}; + +/* page 55 0x5F21-0x5F7E */ +static uint16 tab_jisx0208_uni55[]={ +0x6F3E,0x6F13,0x6EF7,0x6F86,0x6F7A,0x6F78,0x6F81,0x6F80, +0x6F6F,0x6F5B,0x6FF3,0x6F6D,0x6F82,0x6F7C,0x6F58,0x6F8E, +0x6F91,0x6FC2,0x6F66,0x6FB3,0x6FA3,0x6FA1,0x6FA4,0x6FB9, +0x6FC6,0x6FAA,0x6FDF,0x6FD5,0x6FEC,0x6FD4,0x6FD8,0x6FF1, +0x6FEE,0x6FDB,0x7009,0x700B,0x6FFA,0x7011,0x7001,0x700F, +0x6FFE,0x701B,0x701A,0x6F74,0x701D,0x7018,0x701F,0x7030, +0x703E,0x7032,0x7051,0x7063,0x7099,0x7092,0x70AF,0x70F1, +0x70AC,0x70B8,0x70B3,0x70AE,0x70DF,0x70CB,0x70DD,0x70D9, +0x7109,0x70FD,0x711C,0x7119,0x7165,0x7155,0x7188,0x7166, +0x7162,0x714C,0x7156,0x716C,0x718F,0x71FB,0x7184,0x7195, +0x71A8,0x71AC,0x71D7,0x71B9,0x71BE,0x71D2,0x71C9,0x71D4, +0x71CE,0x71E0,0x71EC,0x71E7,0x71F5,0x71FC}; + +/* page 56 0x6021-0x607E */ +static uint16 tab_jisx0208_uni56[]={ +0x71F9,0x71FF,0x720D,0x7210,0x721B,0x7228,0x722D,0x722C, +0x7230,0x7232,0x723B,0x723C,0x723F,0x7240,0x7246,0x724B, +0x7258,0x7274,0x727E,0x7282,0x7281,0x7287,0x7292,0x7296, +0x72A2,0x72A7,0x72B9,0x72B2,0x72C3,0x72C6,0x72C4,0x72CE, +0x72D2,0x72E2,0x72E0,0x72E1,0x72F9,0x72F7,0x500F,0x7317, +0x730A,0x731C,0x7316,0x731D,0x7334,0x732F,0x7329,0x7325, +0x733E,0x734E,0x734F,0x9ED8,0x7357,0x736A,0x7368,0x7370, +0x7378,0x7375,0x737B,0x737A,0x73C8,0x73B3,0x73CE,0x73BB, +0x73C0,0x73E5,0x73EE,0x73DE,0x74A2,0x7405,0x746F,0x7425, +0x73F8,0x7432,0x743A,0x7455,0x743F,0x745F,0x7459,0x7441, +0x745C,0x7469,0x7470,0x7463,0x746A,0x7476,0x747E,0x748B, +0x749E,0x74A7,0x74CA,0x74CF,0x74D4,0x73F1}; + +/* page 57 0x6121-0x617E */ +static uint16 tab_jisx0208_uni57[]={ +0x74E0,0x74E3,0x74E7,0x74E9,0x74EE,0x74F2,0x74F0,0x74F1, +0x74F8,0x74F7,0x7504,0x7503,0x7505,0x750C,0x750E,0x750D, +0x7515,0x7513,0x751E,0x7526,0x752C,0x753C,0x7544,0x754D, +0x754A,0x7549,0x755B,0x7546,0x755A,0x7569,0x7564,0x7567, +0x756B,0x756D,0x7578,0x7576,0x7586,0x7587,0x7574,0x758A, +0x7589,0x7582,0x7594,0x759A,0x759D,0x75A5,0x75A3,0x75C2, +0x75B3,0x75C3,0x75B5,0x75BD,0x75B8,0x75BC,0x75B1,0x75CD, +0x75CA,0x75D2,0x75D9,0x75E3,0x75DE,0x75FE,0x75FF,0x75FC, +0x7601,0x75F0,0x75FA,0x75F2,0x75F3,0x760B,0x760D,0x7609, +0x761F,0x7627,0x7620,0x7621,0x7622,0x7624,0x7634,0x7630, +0x763B,0x7647,0x7648,0x7646,0x765C,0x7658,0x7661,0x7662, +0x7668,0x7669,0x766A,0x7667,0x766C,0x7670}; + +/* page 58 0x6221-0x627E */ +static uint16 tab_jisx0208_uni58[]={ +0x7672,0x7676,0x7678,0x767C,0x7680,0x7683,0x7688,0x768B, +0x768E,0x7696,0x7693,0x7699,0x769A,0x76B0,0x76B4,0x76B8, +0x76B9,0x76BA,0x76C2,0x76CD,0x76D6,0x76D2,0x76DE,0x76E1, +0x76E5,0x76E7,0x76EA,0x862F,0x76FB,0x7708,0x7707,0x7704, +0x7729,0x7724,0x771E,0x7725,0x7726,0x771B,0x7737,0x7738, +0x7747,0x775A,0x7768,0x776B,0x775B,0x7765,0x777F,0x777E, +0x7779,0x778E,0x778B,0x7791,0x77A0,0x779E,0x77B0,0x77B6, +0x77B9,0x77BF,0x77BC,0x77BD,0x77BB,0x77C7,0x77CD,0x77D7, +0x77DA,0x77DC,0x77E3,0x77EE,0x77FC,0x780C,0x7812,0x7926, +0x7820,0x792A,0x7845,0x788E,0x7874,0x7886,0x787C,0x789A, +0x788C,0x78A3,0x78B5,0x78AA,0x78AF,0x78D1,0x78C6,0x78CB, +0x78D4,0x78BE,0x78BC,0x78C5,0x78CA,0x78EC}; + +/* page 59 0x6321-0x637E */ +static uint16 tab_jisx0208_uni59[]={ +0x78E7,0x78DA,0x78FD,0x78F4,0x7907,0x7912,0x7911,0x7919, +0x792C,0x792B,0x7940,0x7960,0x7957,0x795F,0x795A,0x7955, +0x7953,0x797A,0x797F,0x798A,0x799D,0x79A7,0x9F4B,0x79AA, +0x79AE,0x79B3,0x79B9,0x79BA,0x79C9,0x79D5,0x79E7,0x79EC, +0x79E1,0x79E3,0x7A08,0x7A0D,0x7A18,0x7A19,0x7A20,0x7A1F, +0x7980,0x7A31,0x7A3B,0x7A3E,0x7A37,0x7A43,0x7A57,0x7A49, +0x7A61,0x7A62,0x7A69,0x9F9D,0x7A70,0x7A79,0x7A7D,0x7A88, +0x7A97,0x7A95,0x7A98,0x7A96,0x7AA9,0x7AC8,0x7AB0,0x7AB6, +0x7AC5,0x7AC4,0x7ABF,0x9083,0x7AC7,0x7ACA,0x7ACD,0x7ACF, +0x7AD5,0x7AD3,0x7AD9,0x7ADA,0x7ADD,0x7AE1,0x7AE2,0x7AE6, +0x7AED,0x7AF0,0x7B02,0x7B0F,0x7B0A,0x7B06,0x7B33,0x7B18, +0x7B19,0x7B1E,0x7B35,0x7B28,0x7B36,0x7B50}; + +/* page 60 0x6421-0x647E */ +static uint16 tab_jisx0208_uni60[]={ +0x7B7A,0x7B04,0x7B4D,0x7B0B,0x7B4C,0x7B45,0x7B75,0x7B65, +0x7B74,0x7B67,0x7B70,0x7B71,0x7B6C,0x7B6E,0x7B9D,0x7B98, +0x7B9F,0x7B8D,0x7B9C,0x7B9A,0x7B8B,0x7B92,0x7B8F,0x7B5D, +0x7B99,0x7BCB,0x7BC1,0x7BCC,0x7BCF,0x7BB4,0x7BC6,0x7BDD, +0x7BE9,0x7C11,0x7C14,0x7BE6,0x7BE5,0x7C60,0x7C00,0x7C07, +0x7C13,0x7BF3,0x7BF7,0x7C17,0x7C0D,0x7BF6,0x7C23,0x7C27, +0x7C2A,0x7C1F,0x7C37,0x7C2B,0x7C3D,0x7C4C,0x7C43,0x7C54, +0x7C4F,0x7C40,0x7C50,0x7C58,0x7C5F,0x7C64,0x7C56,0x7C65, +0x7C6C,0x7C75,0x7C83,0x7C90,0x7CA4,0x7CAD,0x7CA2,0x7CAB, +0x7CA1,0x7CA8,0x7CB3,0x7CB2,0x7CB1,0x7CAE,0x7CB9,0x7CBD, +0x7CC0,0x7CC5,0x7CC2,0x7CD8,0x7CD2,0x7CDC,0x7CE2,0x9B3B, +0x7CEF,0x7CF2,0x7CF4,0x7CF6,0x7CFA,0x7D06}; + +/* page 61 0x6521-0x657E */ +static uint16 tab_jisx0208_uni61[]={ +0x7D02,0x7D1C,0x7D15,0x7D0A,0x7D45,0x7D4B,0x7D2E,0x7D32, +0x7D3F,0x7D35,0x7D46,0x7D73,0x7D56,0x7D4E,0x7D72,0x7D68, +0x7D6E,0x7D4F,0x7D63,0x7D93,0x7D89,0x7D5B,0x7D8F,0x7D7D, +0x7D9B,0x7DBA,0x7DAE,0x7DA3,0x7DB5,0x7DC7,0x7DBD,0x7DAB, +0x7E3D,0x7DA2,0x7DAF,0x7DDC,0x7DB8,0x7D9F,0x7DB0,0x7DD8, +0x7DDD,0x7DE4,0x7DDE,0x7DFB,0x7DF2,0x7DE1,0x7E05,0x7E0A, +0x7E23,0x7E21,0x7E12,0x7E31,0x7E1F,0x7E09,0x7E0B,0x7E22, +0x7E46,0x7E66,0x7E3B,0x7E35,0x7E39,0x7E43,0x7E37,0x7E32, +0x7E3A,0x7E67,0x7E5D,0x7E56,0x7E5E,0x7E59,0x7E5A,0x7E79, +0x7E6A,0x7E69,0x7E7C,0x7E7B,0x7E83,0x7DD5,0x7E7D,0x8FAE, +0x7E7F,0x7E88,0x7E89,0x7E8C,0x7E92,0x7E90,0x7E93,0x7E94, +0x7E96,0x7E8E,0x7E9B,0x7E9C,0x7F38,0x7F3A}; + +/* page 62 0x6621-0x667E */ +static uint16 tab_jisx0208_uni62[]={ +0x7F45,0x7F4C,0x7F4D,0x7F4E,0x7F50,0x7F51,0x7F55,0x7F54, +0x7F58,0x7F5F,0x7F60,0x7F68,0x7F69,0x7F67,0x7F78,0x7F82, +0x7F86,0x7F83,0x7F88,0x7F87,0x7F8C,0x7F94,0x7F9E,0x7F9D, +0x7F9A,0x7FA3,0x7FAF,0x7FB2,0x7FB9,0x7FAE,0x7FB6,0x7FB8, +0x8B71,0x7FC5,0x7FC6,0x7FCA,0x7FD5,0x7FD4,0x7FE1,0x7FE6, +0x7FE9,0x7FF3,0x7FF9,0x98DC,0x8006,0x8004,0x800B,0x8012, +0x8018,0x8019,0x801C,0x8021,0x8028,0x803F,0x803B,0x804A, +0x8046,0x8052,0x8058,0x805A,0x805F,0x8062,0x8068,0x8073, +0x8072,0x8070,0x8076,0x8079,0x807D,0x807F,0x8084,0x8086, +0x8085,0x809B,0x8093,0x809A,0x80AD,0x5190,0x80AC,0x80DB, +0x80E5,0x80D9,0x80DD,0x80C4,0x80DA,0x80D6,0x8109,0x80EF, +0x80F1,0x811B,0x8129,0x8123,0x812F,0x814B}; + +/* page 63 0x6721-0x677E */ +static uint16 tab_jisx0208_uni63[]={ +0x968B,0x8146,0x813E,0x8153,0x8151,0x80FC,0x8171,0x816E, +0x8165,0x8166,0x8174,0x8183,0x8188,0x818A,0x8180,0x8182, +0x81A0,0x8195,0x81A4,0x81A3,0x815F,0x8193,0x81A9,0x81B0, +0x81B5,0x81BE,0x81B8,0x81BD,0x81C0,0x81C2,0x81BA,0x81C9, +0x81CD,0x81D1,0x81D9,0x81D8,0x81C8,0x81DA,0x81DF,0x81E0, +0x81E7,0x81FA,0x81FB,0x81FE,0x8201,0x8202,0x8205,0x8207, +0x820A,0x820D,0x8210,0x8216,0x8229,0x822B,0x8238,0x8233, +0x8240,0x8259,0x8258,0x825D,0x825A,0x825F,0x8264,0x8262, +0x8268,0x826A,0x826B,0x822E,0x8271,0x8277,0x8278,0x827E, +0x828D,0x8292,0x82AB,0x829F,0x82BB,0x82AC,0x82E1,0x82E3, +0x82DF,0x82D2,0x82F4,0x82F3,0x82FA,0x8393,0x8303,0x82FB, +0x82F9,0x82DE,0x8306,0x82DC,0x8309,0x82D9}; + +/* page 64 0x6821-0x687E */ +static uint16 tab_jisx0208_uni64[]={ +0x8335,0x8334,0x8316,0x8332,0x8331,0x8340,0x8339,0x8350, +0x8345,0x832F,0x832B,0x8317,0x8318,0x8385,0x839A,0x83AA, +0x839F,0x83A2,0x8396,0x8323,0x838E,0x8387,0x838A,0x837C, +0x83B5,0x8373,0x8375,0x83A0,0x8389,0x83A8,0x83F4,0x8413, +0x83EB,0x83CE,0x83FD,0x8403,0x83D8,0x840B,0x83C1,0x83F7, +0x8407,0x83E0,0x83F2,0x840D,0x8422,0x8420,0x83BD,0x8438, +0x8506,0x83FB,0x846D,0x842A,0x843C,0x855A,0x8484,0x8477, +0x846B,0x84AD,0x846E,0x8482,0x8469,0x8446,0x842C,0x846F, +0x8479,0x8435,0x84CA,0x8462,0x84B9,0x84BF,0x849F,0x84D9, +0x84CD,0x84BB,0x84DA,0x84D0,0x84C1,0x84C6,0x84D6,0x84A1, +0x8521,0x84FF,0x84F4,0x8517,0x8518,0x852C,0x851F,0x8515, +0x8514,0x84FC,0x8540,0x8563,0x8558,0x8548}; + +/* page 65 0x6921-0x697E */ +static uint16 tab_jisx0208_uni65[]={ +0x8541,0x8602,0x854B,0x8555,0x8580,0x85A4,0x8588,0x8591, +0x858A,0x85A8,0x856D,0x8594,0x859B,0x85EA,0x8587,0x859C, +0x8577,0x857E,0x8590,0x85C9,0x85BA,0x85CF,0x85B9,0x85D0, +0x85D5,0x85DD,0x85E5,0x85DC,0x85F9,0x860A,0x8613,0x860B, +0x85FE,0x85FA,0x8606,0x8622,0x861A,0x8630,0x863F,0x864D, +0x4E55,0x8654,0x865F,0x8667,0x8671,0x8693,0x86A3,0x86A9, +0x86AA,0x868B,0x868C,0x86B6,0x86AF,0x86C4,0x86C6,0x86B0, +0x86C9,0x8823,0x86AB,0x86D4,0x86DE,0x86E9,0x86EC,0x86DF, +0x86DB,0x86EF,0x8712,0x8706,0x8708,0x8700,0x8703,0x86FB, +0x8711,0x8709,0x870D,0x86F9,0x870A,0x8734,0x873F,0x8737, +0x873B,0x8725,0x8729,0x871A,0x8760,0x875F,0x8778,0x874C, +0x874E,0x8774,0x8757,0x8768,0x876E,0x8759}; + +/* page 66 0x6A21-0x6A7E */ +static uint16 tab_jisx0208_uni66[]={ +0x8753,0x8763,0x876A,0x8805,0x87A2,0x879F,0x8782,0x87AF, +0x87CB,0x87BD,0x87C0,0x87D0,0x96D6,0x87AB,0x87C4,0x87B3, +0x87C7,0x87C6,0x87BB,0x87EF,0x87F2,0x87E0,0x880F,0x880D, +0x87FE,0x87F6,0x87F7,0x880E,0x87D2,0x8811,0x8816,0x8815, +0x8822,0x8821,0x8831,0x8836,0x8839,0x8827,0x883B,0x8844, +0x8842,0x8852,0x8859,0x885E,0x8862,0x886B,0x8881,0x887E, +0x889E,0x8875,0x887D,0x88B5,0x8872,0x8882,0x8897,0x8892, +0x88AE,0x8899,0x88A2,0x888D,0x88A4,0x88B0,0x88BF,0x88B1, +0x88C3,0x88C4,0x88D4,0x88D8,0x88D9,0x88DD,0x88F9,0x8902, +0x88FC,0x88F4,0x88E8,0x88F2,0x8904,0x890C,0x890A,0x8913, +0x8943,0x891E,0x8925,0x892A,0x892B,0x8941,0x8944,0x893B, +0x8936,0x8938,0x894C,0x891D,0x8960,0x895E}; + +/* page 67 0x6B21-0x6B7E */ +static uint16 tab_jisx0208_uni67[]={ +0x8966,0x8964,0x896D,0x896A,0x896F,0x8974,0x8977,0x897E, +0x8983,0x8988,0x898A,0x8993,0x8998,0x89A1,0x89A9,0x89A6, +0x89AC,0x89AF,0x89B2,0x89BA,0x89BD,0x89BF,0x89C0,0x89DA, +0x89DC,0x89DD,0x89E7,0x89F4,0x89F8,0x8A03,0x8A16,0x8A10, +0x8A0C,0x8A1B,0x8A1D,0x8A25,0x8A36,0x8A41,0x8A5B,0x8A52, +0x8A46,0x8A48,0x8A7C,0x8A6D,0x8A6C,0x8A62,0x8A85,0x8A82, +0x8A84,0x8AA8,0x8AA1,0x8A91,0x8AA5,0x8AA6,0x8A9A,0x8AA3, +0x8AC4,0x8ACD,0x8AC2,0x8ADA,0x8AEB,0x8AF3,0x8AE7,0x8AE4, +0x8AF1,0x8B14,0x8AE0,0x8AE2,0x8AF7,0x8ADE,0x8ADB,0x8B0C, +0x8B07,0x8B1A,0x8AE1,0x8B16,0x8B10,0x8B17,0x8B20,0x8B33, +0x97AB,0x8B26,0x8B2B,0x8B3E,0x8B28,0x8B41,0x8B4C,0x8B4F, +0x8B4E,0x8B49,0x8B56,0x8B5B,0x8B5A,0x8B6B}; + +/* page 68 0x6C21-0x6C7E */ +static uint16 tab_jisx0208_uni68[]={ +0x8B5F,0x8B6C,0x8B6F,0x8B74,0x8B7D,0x8B80,0x8B8C,0x8B8E, +0x8B92,0x8B93,0x8B96,0x8B99,0x8B9A,0x8C3A,0x8C41,0x8C3F, +0x8C48,0x8C4C,0x8C4E,0x8C50,0x8C55,0x8C62,0x8C6C,0x8C78, +0x8C7A,0x8C82,0x8C89,0x8C85,0x8C8A,0x8C8D,0x8C8E,0x8C94, +0x8C7C,0x8C98,0x621D,0x8CAD,0x8CAA,0x8CBD,0x8CB2,0x8CB3, +0x8CAE,0x8CB6,0x8CC8,0x8CC1,0x8CE4,0x8CE3,0x8CDA,0x8CFD, +0x8CFA,0x8CFB,0x8D04,0x8D05,0x8D0A,0x8D07,0x8D0F,0x8D0D, +0x8D10,0x9F4E,0x8D13,0x8CCD,0x8D14,0x8D16,0x8D67,0x8D6D, +0x8D71,0x8D73,0x8D81,0x8D99,0x8DC2,0x8DBE,0x8DBA,0x8DCF, +0x8DDA,0x8DD6,0x8DCC,0x8DDB,0x8DCB,0x8DEA,0x8DEB,0x8DDF, +0x8DE3,0x8DFC,0x8E08,0x8E09,0x8DFF,0x8E1D,0x8E1E,0x8E10, +0x8E1F,0x8E42,0x8E35,0x8E30,0x8E34,0x8E4A}; + +/* page 69 0x6D21-0x6D7E */ +static uint16 tab_jisx0208_uni69[]={ +0x8E47,0x8E49,0x8E4C,0x8E50,0x8E48,0x8E59,0x8E64,0x8E60, +0x8E2A,0x8E63,0x8E55,0x8E76,0x8E72,0x8E7C,0x8E81,0x8E87, +0x8E85,0x8E84,0x8E8B,0x8E8A,0x8E93,0x8E91,0x8E94,0x8E99, +0x8EAA,0x8EA1,0x8EAC,0x8EB0,0x8EC6,0x8EB1,0x8EBE,0x8EC5, +0x8EC8,0x8ECB,0x8EDB,0x8EE3,0x8EFC,0x8EFB,0x8EEB,0x8EFE, +0x8F0A,0x8F05,0x8F15,0x8F12,0x8F19,0x8F13,0x8F1C,0x8F1F, +0x8F1B,0x8F0C,0x8F26,0x8F33,0x8F3B,0x8F39,0x8F45,0x8F42, +0x8F3E,0x8F4C,0x8F49,0x8F46,0x8F4E,0x8F57,0x8F5C,0x8F62, +0x8F63,0x8F64,0x8F9C,0x8F9F,0x8FA3,0x8FAD,0x8FAF,0x8FB7, +0x8FDA,0x8FE5,0x8FE2,0x8FEA,0x8FEF,0x9087,0x8FF4,0x9005, +0x8FF9,0x8FFA,0x9011,0x9015,0x9021,0x900D,0x901E,0x9016, +0x900B,0x9027,0x9036,0x9035,0x9039,0x8FF8}; + +/* page 70 0x6E21-0x6E7E */ +static uint16 tab_jisx0208_uni70[]={ +0x904F,0x9050,0x9051,0x9052,0x900E,0x9049,0x903E,0x9056, +0x9058,0x905E,0x9068,0x906F,0x9076,0x96A8,0x9072,0x9082, +0x907D,0x9081,0x9080,0x908A,0x9089,0x908F,0x90A8,0x90AF, +0x90B1,0x90B5,0x90E2,0x90E4,0x6248,0x90DB,0x9102,0x9112, +0x9119,0x9132,0x9130,0x914A,0x9156,0x9158,0x9163,0x9165, +0x9169,0x9173,0x9172,0x918B,0x9189,0x9182,0x91A2,0x91AB, +0x91AF,0x91AA,0x91B5,0x91B4,0x91BA,0x91C0,0x91C1,0x91C9, +0x91CB,0x91D0,0x91D6,0x91DF,0x91E1,0x91DB,0x91FC,0x91F5, +0x91F6,0x921E,0x91FF,0x9214,0x922C,0x9215,0x9211,0x925E, +0x9257,0x9245,0x9249,0x9264,0x9248,0x9295,0x923F,0x924B, +0x9250,0x929C,0x9296,0x9293,0x929B,0x925A,0x92CF,0x92B9, +0x92B7,0x92E9,0x930F,0x92FA,0x9344,0x932E}; + +/* page 71 0x6F21-0x6F7E */ +static uint16 tab_jisx0208_uni71[]={ +0x9319,0x9322,0x931A,0x9323,0x933A,0x9335,0x933B,0x935C, +0x9360,0x937C,0x936E,0x9356,0x93B0,0x93AC,0x93AD,0x9394, +0x93B9,0x93D6,0x93D7,0x93E8,0x93E5,0x93D8,0x93C3,0x93DD, +0x93D0,0x93C8,0x93E4,0x941A,0x9414,0x9413,0x9403,0x9407, +0x9410,0x9436,0x942B,0x9435,0x9421,0x943A,0x9441,0x9452, +0x9444,0x945B,0x9460,0x9462,0x945E,0x946A,0x9229,0x9470, +0x9475,0x9477,0x947D,0x945A,0x947C,0x947E,0x9481,0x947F, +0x9582,0x9587,0x958A,0x9594,0x9596,0x9598,0x9599,0x95A0, +0x95A8,0x95A7,0x95AD,0x95BC,0x95BB,0x95B9,0x95BE,0x95CA, +0x6FF6,0x95C3,0x95CD,0x95CC,0x95D5,0x95D4,0x95D6,0x95DC, +0x95E1,0x95E5,0x95E2,0x9621,0x9628,0x962E,0x962F,0x9642, +0x964C,0x964F,0x964B,0x9677,0x965C,0x965E}; + +/* page 72 0x7021-0x707E */ +static uint16 tab_jisx0208_uni72[]={ +0x965D,0x965F,0x9666,0x9672,0x966C,0x968D,0x9698,0x9695, +0x9697,0x96AA,0x96A7,0x96B1,0x96B2,0x96B0,0x96B4,0x96B6, +0x96B8,0x96B9,0x96CE,0x96CB,0x96C9,0x96CD,0x894D,0x96DC, +0x970D,0x96D5,0x96F9,0x9704,0x9706,0x9708,0x9713,0x970E, +0x9711,0x970F,0x9716,0x9719,0x9724,0x972A,0x9730,0x9739, +0x973D,0x973E,0x9744,0x9746,0x9748,0x9742,0x9749,0x975C, +0x9760,0x9764,0x9766,0x9768,0x52D2,0x976B,0x9771,0x9779, +0x9785,0x977C,0x9781,0x977A,0x9786,0x978B,0x978F,0x9790, +0x979C,0x97A8,0x97A6,0x97A3,0x97B3,0x97B4,0x97C3,0x97C6, +0x97C8,0x97CB,0x97DC,0x97ED,0x9F4F,0x97F2,0x7ADF,0x97F6, +0x97F5,0x980F,0x980C,0x9838,0x9824,0x9821,0x9837,0x983D, +0x9846,0x984F,0x984B,0x986B,0x986F,0x9870}; + +/* page 73 0x7121-0x717E */ +static uint16 tab_jisx0208_uni73[]={ +0x9871,0x9874,0x9873,0x98AA,0x98AF,0x98B1,0x98B6,0x98C4, +0x98C3,0x98C6,0x98E9,0x98EB,0x9903,0x9909,0x9912,0x9914, +0x9918,0x9921,0x991D,0x991E,0x9924,0x9920,0x992C,0x992E, +0x993D,0x993E,0x9942,0x9949,0x9945,0x9950,0x994B,0x9951, +0x9952,0x994C,0x9955,0x9997,0x9998,0x99A5,0x99AD,0x99AE, +0x99BC,0x99DF,0x99DB,0x99DD,0x99D8,0x99D1,0x99ED,0x99EE, +0x99F1,0x99F2,0x99FB,0x99F8,0x9A01,0x9A0F,0x9A05,0x99E2, +0x9A19,0x9A2B,0x9A37,0x9A45,0x9A42,0x9A40,0x9A43,0x9A3E, +0x9A55,0x9A4D,0x9A5B,0x9A57,0x9A5F,0x9A62,0x9A65,0x9A64, +0x9A69,0x9A6B,0x9A6A,0x9AAD,0x9AB0,0x9ABC,0x9AC0,0x9ACF, +0x9AD1,0x9AD3,0x9AD4,0x9ADE,0x9ADF,0x9AE2,0x9AE3,0x9AE6, +0x9AEF,0x9AEB,0x9AEE,0x9AF4,0x9AF1,0x9AF7}; + +/* page 74 0x7221-0x727E */ +static uint16 tab_jisx0208_uni74[]={ +0x9AFB,0x9B06,0x9B18,0x9B1A,0x9B1F,0x9B22,0x9B23,0x9B25, +0x9B27,0x9B28,0x9B29,0x9B2A,0x9B2E,0x9B2F,0x9B32,0x9B44, +0x9B43,0x9B4F,0x9B4D,0x9B4E,0x9B51,0x9B58,0x9B74,0x9B93, +0x9B83,0x9B91,0x9B96,0x9B97,0x9B9F,0x9BA0,0x9BA8,0x9BB4, +0x9BC0,0x9BCA,0x9BB9,0x9BC6,0x9BCF,0x9BD1,0x9BD2,0x9BE3, +0x9BE2,0x9BE4,0x9BD4,0x9BE1,0x9C3A,0x9BF2,0x9BF1,0x9BF0, +0x9C15,0x9C14,0x9C09,0x9C13,0x9C0C,0x9C06,0x9C08,0x9C12, +0x9C0A,0x9C04,0x9C2E,0x9C1B,0x9C25,0x9C24,0x9C21,0x9C30, +0x9C47,0x9C32,0x9C46,0x9C3E,0x9C5A,0x9C60,0x9C67,0x9C76, +0x9C78,0x9CE7,0x9CEC,0x9CF0,0x9D09,0x9D08,0x9CEB,0x9D03, +0x9D06,0x9D2A,0x9D26,0x9DAF,0x9D23,0x9D1F,0x9D44,0x9D15, +0x9D12,0x9D41,0x9D3F,0x9D3E,0x9D46,0x9D48}; + +/* page 75 0x7321-0x737E */ +static uint16 tab_jisx0208_uni75[]={ +0x9D5D,0x9D5E,0x9D64,0x9D51,0x9D50,0x9D59,0x9D72,0x9D89, +0x9D87,0x9DAB,0x9D6F,0x9D7A,0x9D9A,0x9DA4,0x9DA9,0x9DB2, +0x9DC4,0x9DC1,0x9DBB,0x9DB8,0x9DBA,0x9DC6,0x9DCF,0x9DC2, +0x9DD9,0x9DD3,0x9DF8,0x9DE6,0x9DED,0x9DEF,0x9DFD,0x9E1A, +0x9E1B,0x9E1E,0x9E75,0x9E79,0x9E7D,0x9E81,0x9E88,0x9E8B, +0x9E8C,0x9E92,0x9E95,0x9E91,0x9E9D,0x9EA5,0x9EA9,0x9EB8, +0x9EAA,0x9EAD,0x9761,0x9ECC,0x9ECE,0x9ECF,0x9ED0,0x9ED4, +0x9EDC,0x9EDE,0x9EDD,0x9EE0,0x9EE5,0x9EE8,0x9EEF,0x9EF4, +0x9EF6,0x9EF7,0x9EF9,0x9EFB,0x9EFC,0x9EFD,0x9F07,0x9F08, +0x76B7,0x9F15,0x9F21,0x9F2C,0x9F3E,0x9F4A,0x9F52,0x9F54, +0x9F63,0x9F5F,0x9F60,0x9F61,0x9F66,0x9F67,0x9F6C,0x9F6A, +0x9F77,0x9F72,0x9F76,0x9F95,0x9F9C,0x9FA0}; + +/* page 76 0x7421-0x7426 */ +static uint16 tab_jisx0208_uni76[]={ +0x582F,0x69C7,0x9059,0x7464,0x51DC,0x7199}; + +/* page 77 0x2D21 - 0x2D7C */ +static uint16 tab_nec13_uni0[]={ +0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, +0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, +0x2470,0x2471,0x2472,0x2473,0x2160,0x2161,0x2162,0x2163, +0x2164,0x2165,0x2166,0x2167,0x2168,0x2169, 0,0x3349, +0x3314,0x3322,0x334D,0x3318,0x3327,0x3303,0x3336,0x3351, +0x3357,0x330D,0x3326,0x3323,0x332B,0x334A,0x333B,0x339C, +0x339D,0x339E,0x338E,0x338F,0x33C4,0x33A1, 0, 0, + 0, 0, 0, 0, 0, 0,0x337B,0x301D, +0x301F,0x2116,0x33CD,0x2121,0x32A4,0x32A5,0x32A6,0x32A7, +0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,0x2252, +0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F, +0x22BF,0x2235,0x2229,0x222A}; + +static int +my_jisx0208_uni_onechar(int code){ + if ((code>=0x2121)&&(code<=0x217E)) + return(tab_jisx0208_uni0[code-0x2121]); + if ((code>=0x2221)&&(code<=0x227E)) + return(tab_jisx0208_uni1[code-0x2221]); + if ((code>=0x2330)&&(code<=0x237A)) + return(tab_jisx0208_uni2[code-0x2330]); + if ((code>=0x2421)&&(code<=0x2473)) + return(tab_jisx0208_uni3[code-0x2421]); + if ((code>=0x2521)&&(code<=0x2576)) + return(tab_jisx0208_uni4[code-0x2521]); + if ((code>=0x2621)&&(code<=0x2658)) + return(tab_jisx0208_uni5[code-0x2621]); + if ((code>=0x2721)&&(code<=0x2771)) + return(tab_jisx0208_uni6[code-0x2721]); + if ((code>=0x2821)&&(code<=0x2840)) + return(tab_jisx0208_uni7[code-0x2821]); + if ((code>=0x3021)&&(code<=0x307E)) + return(tab_jisx0208_uni8[code-0x3021]); + if ((code>=0x3121)&&(code<=0x317E)) + return(tab_jisx0208_uni9[code-0x3121]); + if ((code>=0x3221)&&(code<=0x327E)) + return(tab_jisx0208_uni10[code-0x3221]); + if ((code>=0x3321)&&(code<=0x337E)) + return(tab_jisx0208_uni11[code-0x3321]); + if ((code>=0x3421)&&(code<=0x347E)) + return(tab_jisx0208_uni12[code-0x3421]); + if ((code>=0x3521)&&(code<=0x357E)) + return(tab_jisx0208_uni13[code-0x3521]); + if ((code>=0x3621)&&(code<=0x367E)) + return(tab_jisx0208_uni14[code-0x3621]); + if ((code>=0x3721)&&(code<=0x377E)) + return(tab_jisx0208_uni15[code-0x3721]); + if ((code>=0x3821)&&(code<=0x387E)) + return(tab_jisx0208_uni16[code-0x3821]); + if ((code>=0x3921)&&(code<=0x397E)) + return(tab_jisx0208_uni17[code-0x3921]); + if ((code>=0x3A21)&&(code<=0x3A7E)) + return(tab_jisx0208_uni18[code-0x3A21]); + if ((code>=0x3B21)&&(code<=0x3B7E)) + return(tab_jisx0208_uni19[code-0x3B21]); + if ((code>=0x3C21)&&(code<=0x3C7E)) + return(tab_jisx0208_uni20[code-0x3C21]); + if ((code>=0x3D21)&&(code<=0x3D7E)) + return(tab_jisx0208_uni21[code-0x3D21]); + if ((code>=0x3E21)&&(code<=0x3E7E)) + return(tab_jisx0208_uni22[code-0x3E21]); + if ((code>=0x3F21)&&(code<=0x3F7E)) + return(tab_jisx0208_uni23[code-0x3F21]); + if ((code>=0x4021)&&(code<=0x407E)) + return(tab_jisx0208_uni24[code-0x4021]); + if ((code>=0x4121)&&(code<=0x417E)) + return(tab_jisx0208_uni25[code-0x4121]); + if ((code>=0x4221)&&(code<=0x427E)) + return(tab_jisx0208_uni26[code-0x4221]); + if ((code>=0x4321)&&(code<=0x437E)) + return(tab_jisx0208_uni27[code-0x4321]); + if ((code>=0x4421)&&(code<=0x447E)) + return(tab_jisx0208_uni28[code-0x4421]); + if ((code>=0x4521)&&(code<=0x457E)) + return(tab_jisx0208_uni29[code-0x4521]); + if ((code>=0x4621)&&(code<=0x467E)) + return(tab_jisx0208_uni30[code-0x4621]); + if ((code>=0x4721)&&(code<=0x477E)) + return(tab_jisx0208_uni31[code-0x4721]); + if ((code>=0x4821)&&(code<=0x487E)) + return(tab_jisx0208_uni32[code-0x4821]); + if ((code>=0x4921)&&(code<=0x497E)) + return(tab_jisx0208_uni33[code-0x4921]); + if ((code>=0x4A21)&&(code<=0x4A7E)) + return(tab_jisx0208_uni34[code-0x4A21]); + if ((code>=0x4B21)&&(code<=0x4B7E)) + return(tab_jisx0208_uni35[code-0x4B21]); + if ((code>=0x4C21)&&(code<=0x4C7E)) + return(tab_jisx0208_uni36[code-0x4C21]); + if ((code>=0x4D21)&&(code<=0x4D7E)) + return(tab_jisx0208_uni37[code-0x4D21]); + if ((code>=0x4E21)&&(code<=0x4E7E)) + return(tab_jisx0208_uni38[code-0x4E21]); + if ((code>=0x4F21)&&(code<=0x4F53)) + return(tab_jisx0208_uni39[code-0x4F21]); + if ((code>=0x5021)&&(code<=0x507E)) + return(tab_jisx0208_uni40[code-0x5021]); + if ((code>=0x5121)&&(code<=0x517E)) + return(tab_jisx0208_uni41[code-0x5121]); + if ((code>=0x5221)&&(code<=0x527E)) + return(tab_jisx0208_uni42[code-0x5221]); + if ((code>=0x5321)&&(code<=0x537E)) + return(tab_jisx0208_uni43[code-0x5321]); + if ((code>=0x5421)&&(code<=0x547E)) + return(tab_jisx0208_uni44[code-0x5421]); + if ((code>=0x5521)&&(code<=0x557E)) + return(tab_jisx0208_uni45[code-0x5521]); + if ((code>=0x5621)&&(code<=0x567E)) + return(tab_jisx0208_uni46[code-0x5621]); + if ((code>=0x5721)&&(code<=0x577E)) + return(tab_jisx0208_uni47[code-0x5721]); + if ((code>=0x5821)&&(code<=0x587E)) + return(tab_jisx0208_uni48[code-0x5821]); + if ((code>=0x5921)&&(code<=0x597E)) + return(tab_jisx0208_uni49[code-0x5921]); + if ((code>=0x5A21)&&(code<=0x5A7E)) + return(tab_jisx0208_uni50[code-0x5A21]); + if ((code>=0x5B21)&&(code<=0x5B7E)) + return(tab_jisx0208_uni51[code-0x5B21]); + if ((code>=0x5C21)&&(code<=0x5C7E)) + return(tab_jisx0208_uni52[code-0x5C21]); + if ((code>=0x5D21)&&(code<=0x5D7E)) + return(tab_jisx0208_uni53[code-0x5D21]); + if ((code>=0x5E21)&&(code<=0x5E7E)) + return(tab_jisx0208_uni54[code-0x5E21]); + if ((code>=0x5F21)&&(code<=0x5F7E)) + return(tab_jisx0208_uni55[code-0x5F21]); + if ((code>=0x6021)&&(code<=0x607E)) + return(tab_jisx0208_uni56[code-0x6021]); + if ((code>=0x6121)&&(code<=0x617E)) + return(tab_jisx0208_uni57[code-0x6121]); + if ((code>=0x6221)&&(code<=0x627E)) + return(tab_jisx0208_uni58[code-0x6221]); + if ((code>=0x6321)&&(code<=0x637E)) + return(tab_jisx0208_uni59[code-0x6321]); + if ((code>=0x6421)&&(code<=0x647E)) + return(tab_jisx0208_uni60[code-0x6421]); + if ((code>=0x6521)&&(code<=0x657E)) + return(tab_jisx0208_uni61[code-0x6521]); + if ((code>=0x6621)&&(code<=0x667E)) + return(tab_jisx0208_uni62[code-0x6621]); + if ((code>=0x6721)&&(code<=0x677E)) + return(tab_jisx0208_uni63[code-0x6721]); + if ((code>=0x6821)&&(code<=0x687E)) + return(tab_jisx0208_uni64[code-0x6821]); + if ((code>=0x6921)&&(code<=0x697E)) + return(tab_jisx0208_uni65[code-0x6921]); + if ((code>=0x6A21)&&(code<=0x6A7E)) + return(tab_jisx0208_uni66[code-0x6A21]); + if ((code>=0x6B21)&&(code<=0x6B7E)) + return(tab_jisx0208_uni67[code-0x6B21]); + if ((code>=0x6C21)&&(code<=0x6C7E)) + return(tab_jisx0208_uni68[code-0x6C21]); + if ((code>=0x6D21)&&(code<=0x6D7E)) + return(tab_jisx0208_uni69[code-0x6D21]); + if ((code>=0x6E21)&&(code<=0x6E7E)) + return(tab_jisx0208_uni70[code-0x6E21]); + if ((code>=0x6F21)&&(code<=0x6F7E)) + return(tab_jisx0208_uni71[code-0x6F21]); + if ((code>=0x7021)&&(code<=0x707E)) + return(tab_jisx0208_uni72[code-0x7021]); + if ((code>=0x7121)&&(code<=0x717E)) + return(tab_jisx0208_uni73[code-0x7121]); + if ((code>=0x7221)&&(code<=0x727E)) + return(tab_jisx0208_uni74[code-0x7221]); + if ((code>=0x7321)&&(code<=0x737E)) + return(tab_jisx0208_uni75[code-0x7321]); + if ((code>=0x7421)&&(code<=0x7426)) + return(tab_jisx0208_uni76[code-0x7421]); + if ((code>=0x2D21)&&(code<=0x2D7C)) + return(tab_nec13_uni0[code-0x2D21]); + return(0); +} + +/* page 0 0x005C-0x005C */ +static uint16 tab_uni_jisx02080[]={ +0x5C}; + +/* page 1 0x00A2-0x00B6 */ +static uint16 tab_uni_jisx02081[]={ + 0, 0, 0, 0, 0,0x2178,0x212F, 0, + 0, 0, 0, 0, 0, 0,0x216B,0x215E, + 0, 0,0x212D, 0,0x2279}; + +/* page 2 0x00D7-0x00D7 */ +static uint16 tab_uni_jisx02082[]={ +0x215F}; + +/* page 3 0x00F7-0x00F7 */ +static uint16 tab_uni_jisx02083[]={ +0x2160}; + +/* page 4 0x0391-0x03C9 */ +static uint16 tab_uni_jisx02084[]={ +0x2621,0x2622,0x2623,0x2624,0x2625,0x2626,0x2627,0x2628, +0x2629,0x262A,0x262B,0x262C,0x262D,0x262E,0x262F,0x2630, +0x2631, 0,0x2632,0x2633,0x2634,0x2635,0x2636,0x2637, +0x2638, 0, 0, 0, 0, 0, 0, 0, +0x2641,0x2642,0x2643,0x2644,0x2645,0x2646,0x2647,0x2648, +0x2649,0x264A,0x264B,0x264C,0x264D,0x264E,0x264F,0x2650, +0x2651, 0,0x2652,0x2653,0x2654,0x2655,0x2656,0x2657, +0x2658}; + +/* page 5 0x0401-0x0451 */ +static uint16 tab_uni_jisx02085[]={ +0x2727, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2721, +0x2722,0x2723,0x2724,0x2725,0x2726,0x2728,0x2729,0x272A, +0x272B,0x272C,0x272D,0x272E,0x272F,0x2730,0x2731,0x2732, +0x2733,0x2734,0x2735,0x2736,0x2737,0x2738,0x2739,0x273A, +0x273B,0x273C,0x273D,0x273E,0x273F,0x2740,0x2741,0x2751, +0x2752,0x2753,0x2754,0x2755,0x2756,0x2758,0x2759,0x275A, +0x275B,0x275C,0x275D,0x275E,0x275F,0x2760,0x2761,0x2762, +0x2763,0x2764,0x2765,0x2766,0x2767,0x2768,0x2769,0x276A, +0x276B,0x276C,0x276D,0x276E,0x276F,0x2770,0x2771, 0, +0x2757}; + +/* page 6 0x2010-0x203B */ +static uint16 tab_uni_jisx02086[]={ +0x213E, 0, 0, 0, 0,0x213D, 0, 0, +0x2146,0x2147, 0, 0,0x2148,0x2149, 0, 0, +0x2277,0x2278, 0, 0, 0,0x2145,0x2144, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2273, 0,0x216C,0x216D, 0, 0, 0, 0, + 0, 0, 0,0x2228}; + +/* page 7 0x2100-0x2116 */ +static uint16 tab_uni_jisx02087[]={ + 0, 0, 0,0x216E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2D62}; + +/* page 8 0x2120-0x212B */ +static uint16 tab_uni_jisx02088[]={ + 0,0x2D64, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2272}; + +/* page 9 0x2160-0x2169 */ +static uint16 tab_uni_jisx02089[]={ +0x2D35,0x2D36,0x2D37,0x2D38,0x2D39,0x2D3A,0x2D3B,0x2D3C, +0x2D3D,0x2D3E}; + +/* page 10 0x2190-0x2193 */ +static uint16 tab_uni_jisx020810[]={ +0x222B,0x222C,0x222A,0x222D}; + +/* page 11 0x21D2-0x21D4 */ +static uint16 tab_uni_jisx020811[]={ +0x224D, 0,0x224E}; + +/* page 12 0x2200-0x223D */ +static uint16 tab_uni_jisx020812[]={ +0x224F, 0,0x225F,0x2250, 0, 0, 0,0x2260, +0x223A, 0, 0,0x223B, 0, 0, 0, 0, + 0,0x2D74, 0, 0, 0, 0, 0, 0, + 0, 0,0x2265, 0, 0,0x2267,0x2167,0x2D78, +0x225C, 0, 0, 0, 0,0x2142, 0,0x224A, +0x224B,0x2241,0x2240,0x2269,0x226A, 0,0x2D73, 0, + 0, 0, 0, 0,0x2168,0x2268, 0, 0, + 0, 0, 0, 0, 0,0x2266}; + +/* page 13 0x2252-0x226B */ +static uint16 tab_uni_jisx020813[]={ +0x2262, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2162,0x2261, + 0, 0, 0, 0,0x2165,0x2166, 0, 0, +0x2263,0x2264}; + +/* page 14 0x2282-0x2287 */ +static uint16 tab_uni_jisx020814[]={ +0x223E,0x223F, 0, 0,0x223C,0x223D}; + +/* page 15 0x22A0-0x22BF */ +static uint16 tab_uni_jisx020815[]={ + 0, 0, 0, 0, 0,0x225D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2D79}; + +/* page 16 0x2312-0x2312 */ +static uint16 tab_uni_jisx020816[]={ +0x225E}; + +/* page 17 0x2460-0x2473 */ +static uint16 tab_uni_jisx020817[]={ +0x2D21,0x2D22,0x2D23,0x2D24,0x2D25,0x2D26,0x2D27,0x2D28, +0x2D29,0x2D2A,0x2D2B,0x2D2C,0x2D2D,0x2D2E,0x2D2F,0x2D30, +0x2D31,0x2D32,0x2D33,0x2D34}; + +/* page 18 0x2500-0x254B */ +static uint16 tab_uni_jisx020818[]={ +0x2821,0x282C,0x2822,0x282D, 0, 0, 0, 0, + 0, 0, 0, 0,0x2823, 0, 0,0x282E, +0x2824, 0, 0,0x282F,0x2826, 0, 0,0x2831, +0x2825, 0, 0,0x2830,0x2827,0x283C, 0, 0, +0x2837, 0, 0,0x2832,0x2829,0x283E, 0, 0, +0x2839, 0, 0,0x2834,0x2828, 0, 0,0x2838, +0x283D, 0, 0,0x2833,0x282A, 0, 0,0x283A, +0x283F, 0, 0,0x2835,0x282B, 0, 0,0x283B, + 0, 0,0x2840, 0, 0, 0, 0, 0, + 0, 0, 0,0x2836}; + +/* page 19 0x25A0-0x25CF */ +static uint16 tab_uni_jisx020819[]={ +0x2223,0x2222, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2225,0x2224, 0, 0, 0, 0, + 0, 0, 0, 0,0x2227,0x2226, 0, 0, + 0, 0, 0, 0, 0, 0,0x2221,0x217E, + 0, 0, 0,0x217B, 0, 0,0x217D,0x217C +}; + +/* page 20 0x25EF-0x25EF */ +static uint16 tab_uni_jisx020820[]={ +0x227E}; + +/* page 21 0x2605-0x2606 */ +static uint16 tab_uni_jisx020821[]={ +0x217A,0x2179}; + +/* page 22 0x2640-0x2642 */ +static uint16 tab_uni_jisx020822[]={ +0x216A, 0,0x2169}; + +/* page 23 0x266A-0x266F */ +static uint16 tab_uni_jisx020823[]={ +0x2276, 0, 0,0x2275, 0,0x2274}; + +/* page 24 0x3000-0x301F */ +static uint16 tab_uni_jisx020824[]={ +0x2121,0x2122,0x2123,0x2137, 0,0x2139,0x213A,0x213B, +0x2152,0x2153,0x2154,0x2155,0x2156,0x2157,0x2158,0x2159, +0x215A,0x215B,0x2229,0x222E,0x214C,0x214D, 0, 0, + 0, 0, 0, 0, 0,0x2D60, 0,0x2D61}; + +/* page 25 0x3041-0x30FE */ +static uint16 tab_uni_jisx020825[]={ +0x2421,0x2422,0x2423,0x2424,0x2425,0x2426,0x2427,0x2428, +0x2429,0x242A,0x242B,0x242C,0x242D,0x242E,0x242F,0x2430, +0x2431,0x2432,0x2433,0x2434,0x2435,0x2436,0x2437,0x2438, +0x2439,0x243A,0x243B,0x243C,0x243D,0x243E,0x243F,0x2440, +0x2441,0x2442,0x2443,0x2444,0x2445,0x2446,0x2447,0x2448, +0x2449,0x244A,0x244B,0x244C,0x244D,0x244E,0x244F,0x2450, +0x2451,0x2452,0x2453,0x2454,0x2455,0x2456,0x2457,0x2458, +0x2459,0x245A,0x245B,0x245C,0x245D,0x245E,0x245F,0x2460, +0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468, +0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470, +0x2471,0x2472,0x2473, 0, 0, 0, 0, 0, + 0, 0,0x212B,0x212C,0x2135,0x2136, 0, 0, +0x2521,0x2522,0x2523,0x2524,0x2525,0x2526,0x2527,0x2528, +0x2529,0x252A,0x252B,0x252C,0x252D,0x252E,0x252F,0x2530, +0x2531,0x2532,0x2533,0x2534,0x2535,0x2536,0x2537,0x2538, +0x2539,0x253A,0x253B,0x253C,0x253D,0x253E,0x253F,0x2540, +0x2541,0x2542,0x2543,0x2544,0x2545,0x2546,0x2547,0x2548, +0x2549,0x254A,0x254B,0x254C,0x254D,0x254E,0x254F,0x2550, +0x2551,0x2552,0x2553,0x2554,0x2555,0x2556,0x2557,0x2558, +0x2559,0x255A,0x255B,0x255C,0x255D,0x255E,0x255F,0x2560, +0x2561,0x2562,0x2563,0x2564,0x2565,0x2566,0x2567,0x2568, +0x2569,0x256A,0x256B,0x256C,0x256D,0x256E,0x256F,0x2570, +0x2571,0x2572,0x2573,0x2574,0x2575,0x2576, 0, 0, + 0, 0,0x2126,0x213C,0x2133,0x2134}; + +/* page 26 0x3230-0x3239 */ +static uint16 tab_uni_jisx020826[]={ + 0,0x2D6A,0x2D6B, 0, 0, 0, 0, 0, + 0,0x2D6C}; + +/* page 27 0x32A0-0x32A8 */ +static uint16 tab_uni_jisx020827[]={ + 0, 0, 0, 0,0x2D65,0x2D66,0x2D67,0x2D68, +0x2D69}; + +/* page 28 0x3300-0x33CD */ +static uint16 tab_uni_jisx020828[]={ + 0, 0, 0,0x2D46, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x2D4A, 0, 0, + 0, 0, 0, 0,0x2D41, 0, 0, 0, +0x2D44, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2D42,0x2D4C, 0, 0,0x2D4B,0x2D45, + 0, 0, 0,0x2D4D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2D47, 0, + 0, 0, 0,0x2D4F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2D40,0x2D4E, 0, 0,0x2D43, 0, 0, + 0,0x2D48, 0, 0, 0, 0, 0,0x2D49, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2D5F,0x2D6F,0x2D6E,0x2D6D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2D53,0x2D54, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x2D50,0x2D51,0x2D52, 0, + 0,0x2D56, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x2D55, 0, 0, 0, + 0, 0, 0, 0, 0,0x2D63}; + +/* page 29 0x4E00-0x5516 */ +static uint16 tab_uni_jisx020829[]={ +0x306C,0x437A, 0,0x3C37, 0, 0, 0,0x4B7C, +0x3E66,0x3B30,0x3E65,0x323C, 0,0x4954,0x4D3F, 0, +0x5022,0x312F, 0, 0,0x336E,0x5023,0x4024,0x5242, +0x3556,0x4A3A, 0, 0, 0, 0,0x3E67, 0, + 0,0x4E3E, 0, 0, 0, 0,0x4A42, 0, + 0, 0,0x5024, 0, 0,0x4366, 0, 0, + 0,0x5025,0x367A, 0, 0, 0,0x5026, 0, +0x345D,0x4330, 0,0x3C67,0x5027, 0, 0,0x5028, + 0, 0,0x5029,0x4735, 0,0x3557, 0, 0, + 0, 0, 0,0x4737, 0,0x4663,0x3843,0x4B33, + 0, 0, 0, 0, 0,0x6949,0x502A,0x3E68, +0x502B,0x3235, 0, 0, 0,0x3665,0x3870,0x4C69, + 0, 0,0x5626, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4D70, 0,0x467D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3425, 0, +0x3535, 0,0x502C, 0, 0,0x502D,0x4E3B, 0, +0x4D3D,0x4168,0x502F,0x3B76,0x4673, 0,0x5032, 0, + 0,0x313E,0x385F, 0,0x385E,0x3066, 0, 0, +0x4F4B,0x4F4A, 0,0x3A33,0x3021, 0,0x5033,0x5034, +0x5035,0x4B34,0x5036, 0,0x3872,0x3067,0x4B72, 0, +0x357C, 0, 0,0x357D,0x357E,0x4462,0x4E3C, 0, +0x5037, 0, 0,0x5038, 0, 0,0x5039, 0, + 0, 0,0x3F4D, 0, 0, 0, 0, 0, +0x3D3A,0x3F4E,0x503E, 0,0x503C, 0,0x503D,0x3558, + 0, 0,0x3A23,0x3270, 0,0x503B,0x503A,0x4A29, + 0, 0, 0, 0,0x3B46,0x3B45,0x423E,0x503F, +0x4955,0x4067, 0, 0, 0,0x2138,0x5040,0x5042, + 0, 0, 0,0x4265,0x4E61,0x304A, 0, 0, + 0, 0, 0, 0, 0,0x5041,0x323E, 0, +0x3644, 0,0x4367, 0, 0, 0,0x376F,0x5043, + 0, 0, 0,0x4724, 0, 0, 0, 0, + 0,0x346B, 0, 0, 0, 0, 0, 0, + 0,0x5044,0x304B, 0, 0,0x3860,0x346C,0x497A, +0x4832,0x3559, 0, 0, 0, 0, 0, 0, + 0, 0,0x3271, 0,0x5067,0x4541, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x476C, +0x5046, 0, 0, 0,0x483C, 0,0x4E62, 0, +0x3F2D, 0,0x3B47, 0,0x3B77,0x3240, 0, 0, + 0, 0, 0,0x4451, 0, 0,0x4322,0x504A, + 0, 0, 0, 0, 0,0x304C,0x4463,0x3D3B, +0x3A34,0x4D24, 0,0x424E, 0,0x323F, 0,0x5049, + 0,0x4D3E,0x5045,0x5047,0x3A6E,0x5048,0x5524, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5050, 0, 0, 0, 0, 0,0x5053, +0x5051, 0, 0,0x3242, 0,0x4A3B,0x504B, 0, + 0, 0, 0,0x504F,0x3873, 0, 0,0x3B48, + 0, 0, 0,0x3426, 0, 0,0x5054, 0, +0x504C, 0, 0,0x4E63, 0,0x3B78, 0,0x504D, + 0,0x5052, 0, 0, 0, 0,0x5055, 0, +0x504E, 0, 0,0x3621, 0,0x304D, 0, 0, +0x3622,0x3241, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5525, 0,0x4B79,0x496E,0x3874, + 0, 0, 0, 0, 0,0x3F2F,0x4E37, 0, + 0, 0, 0, 0, 0, 0, 0,0x4A58, + 0, 0,0x3738,0x4225,0x3264, 0, 0, 0, + 0, 0,0x3D53, 0, 0, 0,0x5059, 0, +0x505E,0x505C, 0, 0,0x5057, 0, 0,0x422F, +0x505A, 0,0x505D,0x505B, 0,0x4A5D, 0,0x5058, + 0,0x3F2E, 0,0x4B73,0x505F,0x5060, 0, 0, + 0, 0, 0, 0, 0, 0,0x3D24,0x506D, + 0, 0, 0,0x4750, 0,0x4936,0x5068, 0, +0x4A70, 0,0x3236, 0, 0, 0,0x506C, 0, + 0, 0, 0, 0, 0,0x5066,0x506F, 0, + 0,0x4152, 0,0x3844, 0,0x475C, 0,0x6047, + 0,0x506E,0x455D, 0,0x5063, 0,0x3876, 0, + 0,0x3875,0x5061, 0, 0, 0, 0,0x3C5A, + 0,0x5069, 0,0x4A6F,0x434D,0x5065,0x3771, 0, +0x5062,0x506A,0x5064,0x4E51,0x506B,0x4F41, 0, 0, + 0, 0, 0, 0, 0, 0,0x3666, 0, + 0,0x3770, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5070, 0, 0, 0,0x5071, +0x5075,0x304E, 0, 0, 0, 0, 0,0x4A50, +0x5074, 0, 0, 0, 0,0x5073,0x5077, 0, + 0, 0,0x5076, 0,0x4464, 0, 0, 0, + 0, 0, 0, 0, 0,0x3772, 0, 0, + 0, 0, 0, 0,0x5078, 0, 0, 0, + 0, 0,0x3C45, 0,0x4226,0x4465,0x3676, 0, +0x5079, 0, 0, 0, 0,0x3536, 0, 0, +0x507A, 0, 0, 0, 0,0x507C, 0, 0, + 0, 0, 0, 0, 0,0x4B35, 0, 0, + 0,0x3766, 0, 0, 0, 0, 0, 0, +0x3B31,0x4877,0x507B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3A45,0x4D43, 0, 0, + 0, 0,0x507E,0x5123,0x507D,0x3A44, 0,0x3D7D, + 0, 0, 0, 0, 0, 0,0x3739, 0, + 0, 0,0x5124, 0, 0,0x364F, 0, 0, + 0,0x5121,0x5122, 0, 0,0x462F, 0,0x417C, + 0,0x3623, 0, 0, 0,0x4B4D,0x5125, 0, + 0, 0,0x4E3D, 0, 0, 0,0x5126, 0, + 0, 0, 0,0x5129, 0,0x5127, 0,0x414E, + 0, 0, 0, 0, 0,0x5128,0x512A, 0, + 0, 0, 0, 0, 0,0x512C, 0, 0, + 0,0x512B, 0,0x4A48, 0, 0, 0, 0, +0x3537,0x512E,0x512F, 0,0x322F, 0, 0, 0, + 0,0x512D, 0, 0, 0, 0, 0, 0, + 0, 0,0x3C74, 0,0x5132,0x5131,0x5130, 0, +0x5056, 0,0x5133, 0, 0, 0, 0,0x3D7E, + 0,0x5134, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D25, 0, 0, 0, 0, 0, + 0, 0,0x4C59, 0, 0, 0, 0,0x5136, + 0, 0,0x5135,0x5138,0x5137, 0, 0,0x5139, +0x513A,0x3074, 0,0x3835,0x373B,0x3D3C,0x437B,0x3624, +0x4068,0x3877, 0,0x396E,0x513C,0x4C48,0x4546, 0, +0x3B79, 0,0x513B, 0,0x513D, 0, 0, 0, + 0, 0,0x455E, 0,0x3375, 0, 0, 0, + 0, 0,0x513E, 0, 0,0x467E, 0, 0, +0x4134,0x5140,0x5141,0x482C,0x3878,0x4F3B,0x5142, 0, + 0,0x3626, 0, 0, 0,0x4A3C,0x4236,0x3671, +0x4535, 0, 0, 0,0x3773, 0, 0, 0, +0x5143, 0,0x5144, 0, 0,0x4662,0x315F, 0, + 0,0x5147,0x3A7D, 0,0x5146,0x3A46, 0,0x5148, +0x666E,0x5149,0x4B41,0x514A, 0,0x514B,0x514C,0x3E69, + 0,0x3C4C, 0, 0, 0, 0, 0, 0, +0x3427, 0,0x514F, 0,0x514D,0x4C3D,0x514E, 0, +0x495A,0x5150,0x5151,0x5152,0x455F, 0, 0, 0, +0x5156,0x5154,0x5155,0x5153,0x3A63,0x5157,0x4C6A,0x4E64, + 0, 0, 0, 0, 0,0x5158, 0, 0, + 0, 0, 0, 0,0x4028,0x5159,0x3D5A, 0, + 0,0x515A, 0,0x437C,0x4E3F,0x4560, 0, 0, + 0, 0, 0, 0, 0, 0,0x5245, 0, + 0, 0, 0,0x515B,0x7425,0x3645, 0, 0, +0x515C,0x4B5E, 0, 0, 0, 0,0x3D68,0x427C, + 0,0x515E,0x4664, 0, 0,0x515F, 0, 0, +0x5160,0x332E, 0, 0, 0,0x5161,0x3627, 0, +0x464C,0x317A,0x3D50, 0, 0,0x4821,0x5162, 0, +0x4561, 0, 0,0x3F4F,0x5163, 0,0x4A2C,0x405A, +0x3422, 0,0x3429,0x5164, 0, 0,0x5166, 0, + 0,0x373A, 0, 0,0x5165, 0, 0,0x4E73, + 0, 0, 0, 0, 0,0x3D69, 0, 0, + 0, 0, 0, 0,0x483D,0x4A4C, 0,0x5167, + 0,0x4D78,0x5168, 0, 0, 0,0x5169, 0, +0x457E, 0, 0,0x516A, 0, 0,0x4029,0x3A7E, +0x3774,0x516B,0x3B49,0x396F, 0, 0, 0, 0, + 0, 0, 0,0x4466,0x516D, 0, 0,0x4227, + 0, 0,0x3A6F,0x516E,0x516F,0x4130, 0,0x516C, + 0, 0, 0, 0,0x5171, 0,0x4B36, 0, + 0, 0, 0,0x3964, 0, 0,0x5170, 0, + 0, 0, 0,0x3775,0x3A5E,0x476D, 0, 0, + 0,0x5174,0x5172, 0, 0, 0, 0,0x497B, +0x3E6A,0x517B,0x3364,0x5175,0x5173,0x414F, 0, 0, + 0, 0, 0, 0, 0,0x5177, 0,0x5176, + 0, 0, 0,0x3344, 0, 0, 0,0x3760, +0x517C,0x4E2D, 0, 0, 0,0x5178, 0, 0, + 0,0x517D,0x517A, 0,0x5179, 0, 0, 0, + 0, 0, 0,0x4E4F, 0, 0, 0,0x3879, +0x3243, 0, 0,0x4E74, 0, 0, 0, 0, + 0,0x3D75,0x4558,0x3965,0x5222,0x5223, 0, 0, + 0,0x4E65, 0, 0,0x4F2B,0x5225, 0, 0, + 0,0x387A, 0, 0,0x5224, 0,0x332F, 0, + 0,0x5226, 0,0x4B56, 0,0x443C, 0,0x4D26, + 0,0x4A59, 0, 0, 0,0x5227, 0, 0, + 0, 0,0x7055, 0, 0,0x4630, 0,0x5228, +0x342A,0x4C33, 0, 0, 0,0x3E21,0x5229,0x4A67, +0x522D, 0,0x402A,0x522A,0x3650, 0,0x522B,0x342B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x372E,0x522E, 0,0x522F, 0, 0, +0x5230,0x5231,0x3C5B, 0, 0, 0,0x387B,0x4C5E, + 0,0x4C68,0x4677, 0, 0,0x4A71,0x5232, 0, +0x5233, 0, 0, 0, 0,0x5235, 0,0x5237, +0x5236, 0, 0, 0, 0,0x5238,0x323D,0x4B4C, + 0,0x3A7C,0x5239, 0, 0,0x4159, 0, 0, +0x3E22,0x3629, 0,0x523A, 0, 0, 0, 0, + 0, 0,0x485B, 0, 0, 0, 0,0x523B, + 0,0x523C, 0,0x523D, 0, 0, 0, 0, +0x523E,0x4924,0x3668,0x3065, 0, 0, 0,0x463F, +0x523F,0x3D3D, 0,0x4069, 0,0x5241,0x5240,0x3E23, +0x3861,0x5243,0x483E, 0, 0,0x5244, 0, 0, + 0,0x485C,0x4234,0x426E,0x3628, 0, 0,0x466E, +0x4331, 0,0x476E, 0,0x4B4E, 0,0x5246, 0, +0x406A, 0, 0, 0, 0, 0,0x3735, 0, + 0,0x5247, 0, 0, 0, 0,0x5248,0x312C, +0x3075,0x346D, 0,0x4228,0x3551,0x4D71, 0,0x524B, +0x3237, 0, 0,0x524A, 0, 0, 0,0x362A, + 0, 0,0x524C, 0,0x4C71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x524D, 0, +0x4E52, 0,0x387C, 0, 0, 0, 0,0x3836, +0x524E, 0, 0, 0, 0,0x5250,0x524F, 0, +0x3F5F,0x3139, 0, 0, 0,0x315E,0x5251, 0, +0x5252, 0, 0,0x3837, 0, 0,0x5253, 0, + 0, 0, 0,0x356E, 0, 0, 0, 0, + 0, 0,0x3B32,0x5254, 0, 0, 0, 0, +0x4B74,0x3A35,0x355A,0x4D27,0x4150,0x483F,0x3C7D, 0, + 0, 0, 0, 0,0x3D47, 0,0x3C68,0x3C75, + 0,0x3D76, 0,0x4840, 0, 0, 0,0x5257, + 0,0x3143,0x4151,0x387D,0x3845,0x3667, 0, 0, +0x525B,0x4321,0x427E,0x362B,0x3E24,0x525C,0x525A,0x3244, +0x4266,0x3C38,0x3B4B,0x3126, 0, 0,0x3370,0x3966, +0x3B4A, 0,0x525D, 0, 0, 0, 0, 0, + 0,0x525E, 0,0x3549,0x3346, 0, 0, 0, +0x3967,0x3548,0x445F,0x3125,0x4631,0x4C3E,0x3921,0x4D79, +0x4547,0x387E, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x372F, 0,0x5267, 0,0x3663, +0x4B4A, 0, 0, 0, 0, 0,0x485D, 0, + 0,0x5266, 0,0x345E,0x5261,0x5262,0x5264, 0, + 0, 0, 0, 0, 0, 0,0x5265, 0, +0x355B,0x3F61, 0,0x4A2D,0x5263,0x525F,0x3863, 0, +0x5260, 0,0x4F24, 0, 0, 0,0x4A72, 0, +0x4468,0x3862,0x3970, 0, 0, 0,0x5268, 0, + 0,0x465D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x526C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3C7E, 0,0x3C76, 0, 0, 0, 0, 0, +0x526F,0x526D, 0,0x4C23, 0,0x526A,0x5273,0x526E, + 0, 0, 0,0x5271,0x3846,0x4C3F, 0, 0, +0x5272, 0, 0, 0,0x5274, 0,0x5276, 0, + 0, 0, 0,0x3A70,0x4F42, 0,0x526B,0x5269, +0x5275, 0,0x5270, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5278, 0,0x5323,0x527A, 0, 0, +0x527E, 0, 0,0x5321,0x527B, 0, 0,0x533E, + 0, 0,0x3A69,0x3331, 0, 0, 0, 0, +0x5279, 0, 0, 0,0x5325,0x3076,0x5324, 0, +0x3025,0x494A,0x5322, 0,0x527C, 0, 0,0x5277, +0x527D,0x3A48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5326, 0, 0, 0, 0, 0, 0, 0, + 0,0x3077,0x532F, 0, 0,0x5327,0x5328, 0, +0x3E25,0x4B69, 0, 0, 0,0x532D,0x532C, 0, + 0, 0,0x452F, 0, 0, 0, 0, 0, + 0, 0,0x532E, 0, 0,0x532B, 0, 0, + 0, 0, 0, 0,0x3134, 0,0x3A36,0x3F30, + 0, 0, 0, 0, 0, 0, 0,0x5329, +0x4562, 0, 0, 0,0x532A, 0,0x3022}; + +/* page 30 0x552E-0x5563 */ +static uint16 tab_uni_jisx020830[]={ +0x5334,0x4D23, 0,0x3E27, 0,0x533A, 0, 0, + 0, 0,0x5339,0x5330, 0, 0, 0, 0, +0x4243, 0,0x5331, 0, 0, 0,0x426F,0x5336, +0x3E26, 0, 0, 0, 0, 0,0x5333, 0, + 0,0x4C64, 0, 0, 0,0x373C, 0, 0, +0x5337,0x5338, 0, 0, 0, 0,0x5335,0x533B, + 0, 0, 0, 0, 0,0x5332}; + +/* page 31 0x557B-0x576A */ +static uint16 tab_uni_jisx020831[]={ +0x5341,0x5346, 0,0x5342, 0,0x533D, 0, 0, +0x5347,0x4131, 0, 0,0x5349, 0,0x3922,0x533F, +0x437D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5343,0x533C,0x342D, + 0,0x346E,0x3365,0x5344,0x5340, 0, 0, 0, + 0, 0, 0, 0,0x3776,0x534A,0x5348,0x4153, +0x354A,0x362C, 0,0x5345, 0,0x3674, 0, 0, + 0, 0, 0,0x3144, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x534E,0x534C, 0,0x5427, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5351, 0, 0, 0, 0, 0,0x534B, + 0,0x534F, 0, 0,0x534D, 0, 0, 0, +0x3B4C,0x5350, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5353, 0,0x5358, 0, + 0, 0,0x5356,0x5355, 0, 0, 0, 0, + 0, 0, 0,0x4332, 0, 0,0x3245, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5352, 0,0x5354,0x3E28,0x3133, 0, 0, +0x5357, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x325E, 0, + 0, 0, 0, 0,0x5362, 0,0x3E7C,0x535E, + 0,0x535C, 0,0x535D, 0,0x535F, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x313D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4139, 0,0x5359, 0,0x535A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x337A, 0, 0, 0, 0, 0, 0, 0, + 0,0x5361, 0, 0, 0,0x346F, 0,0x5364, +0x5360,0x5363, 0, 0, 0, 0, 0, 0, + 0,0x4A2E, 0, 0, 0,0x4655, 0,0x4838, + 0, 0, 0, 0, 0,0x5366, 0, 0, + 0, 0, 0,0x5365,0x3345, 0, 0,0x5367, + 0, 0, 0, 0,0x536A, 0, 0, 0, + 0,0x5369, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5368, 0,0x4739, + 0, 0,0x536B, 0, 0, 0, 0, 0, + 0, 0, 0,0x536C, 0, 0, 0, 0, + 0,0x536E, 0,0x536D, 0, 0, 0, 0, + 0,0x5370, 0, 0, 0,0x5373,0x5371,0x536F, +0x5372, 0, 0, 0, 0,0x5374, 0, 0, + 0, 0, 0,0x5375, 0, 0,0x5376, 0, +0x5377, 0, 0, 0,0x5378,0x5145, 0,0x3C7C, +0x3B4D, 0, 0,0x3273, 0,0x3078, 0, 0, +0x4344, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5379, 0,0x3A24, 0,0x304F, +0x3F5E, 0, 0, 0, 0, 0,0x537A,0x3847, + 0, 0,0x3971, 0,0x537C,0x537B, 0, 0, +0x4A60,0x537D, 0, 0, 0,0x5421,0x537E, 0, +0x5422, 0,0x5423, 0,0x3777, 0, 0,0x3160, +0x5424, 0, 0,0x5426, 0,0x5425, 0, 0, + 0,0x5428, 0, 0,0x455A, 0, 0, 0, + 0, 0, 0,0x5429,0x3035,0x3A5F, 0, 0, + 0, 0,0x373D, 0, 0,0x434F, 0, 0, + 0, 0, 0, 0,0x542A,0x542B, 0, 0, +0x542D, 0, 0, 0, 0,0x542E, 0,0x3A64, + 0, 0, 0, 0,0x3651, 0, 0,0x4B37, + 0, 0, 0,0x542C,0x542F,0x3A41,0x3923, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5433, 0, + 0,0x3A25, 0,0x4333, 0, 0,0x5430,0x445A +}; + +/* page 32 0x577F-0x5A9B */ +static uint16 tab_uni_jisx020832[]={ +0x5434, 0, 0,0x3F62, 0, 0, 0, 0, + 0,0x5432,0x5435, 0,0x373F, 0, 0, 0, + 0, 0, 0, 0,0x5436, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5437, 0,0x3924,0x3340,0x5439, 0, 0, + 0, 0, 0,0x543A, 0, 0, 0, 0, + 0,0x543B, 0, 0,0x5438, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5431, 0, 0,0x543C, 0, 0,0x543D, + 0, 0, 0, 0,0x4B64, 0, 0,0x3E6B, + 0, 0, 0,0x543F,0x5440,0x543E, 0,0x5442, + 0, 0, 0, 0, 0,0x4738, 0, 0, +0x3068,0x4956, 0, 0,0x5443, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3E7D, 0, 0, +0x3C39, 0,0x475D,0x3470, 0,0x3A6B, 0, 0, + 0,0x4B59, 0,0x4632, 0, 0,0x3778,0x424F, + 0, 0, 0,0x5441,0x5444, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4244, 0, + 0, 0,0x5445, 0, 0, 0,0x5446, 0, + 0, 0,0x5448, 0, 0,0x4469, 0, 0, + 0, 0, 0,0x342E, 0, 0, 0, 0, +0x7421,0x3161,0x4A73, 0, 0,0x3E6C,0x4548, 0, + 0, 0, 0,0x3A66, 0, 0,0x544E, 0, + 0,0x4A3D,0x4E5D, 0, 0, 0, 0, 0, + 0, 0, 0,0x3274,0x544A, 0, 0, 0, + 0, 0,0x413A,0x544D, 0,0x4563, 0, 0, +0x4549,0x4564,0x4839,0x444D, 0, 0, 0,0x3A49, + 0, 0, 0,0x5449, 0, 0, 0, 0, + 0, 0,0x3176, 0,0x4536, 0, 0, 0, + 0,0x544B, 0,0x5447, 0, 0,0x3F50, 0, + 0, 0,0x544F, 0, 0, 0, 0,0x3D4E, + 0, 0, 0, 0,0x362D, 0,0x5450, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4A68, 0, 0, 0, +0x417D, 0, 0, 0, 0,0x4446, 0, 0, +0x5452, 0, 0, 0, 0, 0, 0, 0, + 0,0x4B4F, 0, 0,0x5453, 0, 0,0x5458, + 0, 0, 0, 0,0x4A2F, 0, 0, 0, + 0,0x5457,0x5451,0x5454,0x5456, 0, 0,0x3A26, + 0, 0,0x4A49, 0, 0, 0,0x5459, 0, +0x4345, 0, 0,0x3275, 0,0x3E6D, 0, 0, + 0, 0,0x545B, 0,0x545A, 0,0x3968, 0, +0x545C,0x545E,0x545D, 0, 0,0x5460, 0,0x5455, +0x5462, 0, 0, 0, 0,0x5461,0x545F, 0, + 0, 0, 0, 0,0x3B4E,0x3F51, 0,0x4154, +0x5463,0x403C,0x306D,0x4764, 0, 0, 0, 0, +0x445B, 0,0x5465,0x5464,0x5466,0x5467,0x5468, 0, + 0, 0, 0,0x5469, 0, 0, 0, 0, + 0, 0,0x4A51,0x546A, 0, 0, 0, 0, +0x3246,0x546B, 0, 0, 0, 0,0x4D3C,0x3330, + 0,0x5249,0x3D48,0x423F,0x546C,0x4C6B, 0, 0, + 0, 0, 0,0x4C34, 0, 0,0x546E, 0, +0x4267, 0,0x4537,0x4240,0x4957,0x546F,0x5470,0x317B, + 0, 0,0x3C3A,0x5471, 0, 0, 0, 0, +0x3050,0x5472, 0, 0, 0, 0, 0,0x5473, + 0, 0, 0, 0, 0,0x3162, 0, 0, +0x3471,0x4660,0x4A74, 0, 0, 0, 0,0x5477, +0x4155,0x5476,0x3740, 0, 0,0x4B5B,0x5475, 0, +0x4565,0x5479, 0,0x5478, 0, 0, 0, 0, + 0,0x547B, 0,0x547A, 0, 0,0x317C, 0, +0x547C,0x3E29,0x547E,0x4325, 0,0x547D, 0,0x4A33, + 0, 0, 0, 0,0x3D77,0x455B, 0, 0, + 0,0x5521, 0, 0, 0, 0,0x3925, 0, + 0, 0,0x5522,0x4721,0x485E,0x4C51, 0, 0, + 0, 0, 0,0x4725, 0, 0,0x552B, 0, + 0, 0, 0, 0,0x3538, 0, 0,0x4D45, + 0, 0,0x4C2F, 0,0x562C, 0,0x5523, 0, + 0, 0, 0, 0,0x5526, 0,0x4245, 0, + 0,0x4B38, 0, 0, 0,0x454A, 0, 0, + 0, 0, 0,0x5527, 0, 0, 0, 0, + 0, 0,0x4B65, 0,0x3A4A, 0, 0,0x3E2A, + 0, 0, 0, 0, 0, 0, 0,0x5528, + 0, 0,0x3B50, 0,0x3B4F, 0, 0, 0, + 0,0x3039,0x3848, 0,0x402B,0x3051, 0, 0, + 0, 0,0x552C,0x552D, 0,0x552A, 0, 0, + 0, 0, 0, 0, 0, 0,0x3138,0x342F, + 0,0x5529, 0,0x4C45,0x4931, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3028, + 0, 0, 0, 0,0x3079, 0, 0, 0, +0x3B51, 0,0x3052, 0,0x3023, 0, 0, 0, + 0, 0,0x5532, 0, 0, 0, 0, 0, + 0, 0,0x5530, 0, 0, 0, 0, 0, + 0,0x4C3C, 0,0x5533, 0,0x5531, 0, 0, +0x552F,0x3F31, 0, 0, 0, 0,0x552E, 0, + 0, 0,0x4A5A, 0, 0, 0, 0, 0, +0x3864, 0, 0, 0, 0, 0,0x5537,0x5538, + 0, 0, 0, 0, 0,0x3E2B, 0, 0, + 0,0x5534,0x4F2C, 0, 0, 0, 0,0x474C, + 0, 0,0x5536, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3A27, 0, 0, 0, 0, + 0, 0, 0,0x5539, 0, 0, 0,0x4958, + 0, 0, 0,0x553A, 0,0x5535, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4C3B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x475E, 0, 0, 0, 0, + 0, 0, 0,0x553B,0x4932}; + +/* page 33 0x5ABC-0x5D29 */ +static uint16 tab_uni_jisx020833[]={ +0x553C,0x5540,0x553D, 0, 0,0x3247,0x553F, 0, + 0, 0, 0, 0, 0,0x3C3B, 0,0x553E, +0x3779, 0, 0, 0,0x554C, 0, 0, 0, + 0, 0,0x5545,0x5542, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4364, 0,0x5541, + 0, 0,0x5543, 0, 0,0x5544, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5546,0x5547, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3472, 0,0x5549, +0x5548, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x554A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3E6E, 0, + 0, 0, 0, 0, 0, 0,0x554D, 0, +0x445C, 0, 0, 0,0x3145, 0,0x554B, 0, + 0, 0,0x554E, 0, 0, 0, 0, 0, + 0, 0,0x554F, 0,0x5552, 0, 0,0x5550, + 0,0x5551, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3B52,0x5553, 0, 0, +0x3926,0x5554, 0,0x3B7A,0x4238, 0,0x5555,0x5556, +0x3B5A,0x3927, 0,0x4C52, 0, 0, 0,0x3528, +0x3849,0x5557,0x3358, 0, 0,0x5558, 0,0x4239, + 0, 0, 0, 0,0x5559,0x5623, 0,0x555A, + 0,0x555B, 0, 0,0x555C, 0,0x555E, 0, + 0, 0, 0, 0,0x555F, 0, 0,0x5560, + 0,0x4270, 0,0x3127,0x3C69,0x3042, 0,0x4157, +0x3430,0x3C35, 0,0x3928, 0, 0, 0, 0, + 0,0x4566, 0,0x3D21,0x3431,0x4368,0x446A,0x3038, +0x3539,0x4A75, 0,0x3C42, 0, 0,0x3552,0x406B, +0x3C3C,0x4D28,0x5561, 0, 0, 0, 0, 0, + 0, 0,0x355C, 0,0x3A4B, 0, 0,0x3332, +0x3163,0x3E2C,0x3248, 0,0x5562,0x4D46, 0, 0, + 0, 0, 0,0x3D49, 0, 0,0x3C64,0x5563, +0x3473,0x4652,0x4C29,0x5564, 0,0x5565, 0, 0, +0x4959, 0, 0, 0,0x5567, 0,0x3428,0x3677, +0x5566, 0, 0, 0, 0, 0, 0,0x3432, + 0,0x3F32,0x556B,0x3B21, 0,0x3249,0x556A, 0, +0x5568,0x556C,0x5569,0x472B,0x5C4D,0x3F33, 0,0x556D, + 0, 0,0x4E40, 0,0x556E, 0, 0,0x5570, + 0,0x437E,0x556F, 0,0x4023, 0,0x3B7B, 0, + 0, 0,0x4250,0x3C77, 0,0x4975,0x406C, 0, +0x3C4D,0x5571,0x3E2D,0x5572,0x5573,0x3053,0x423A,0x3F52, + 0,0x5574,0x4633,0x3E2E, 0,0x3E2F, 0,0x5575, + 0, 0,0x406D, 0, 0, 0,0x3E30, 0, + 0, 0, 0, 0,0x5576, 0,0x5577, 0, +0x4C60, 0, 0, 0,0x5578, 0, 0, 0, + 0,0x3646, 0, 0, 0,0x3D22, 0, 0, + 0, 0, 0, 0,0x5579,0x557A,0x3C5C,0x3F2C, +0x4674,0x3F54,0x4878,0x4722,0x3649,0x557B, 0, 0, + 0,0x356F,0x557C, 0,0x367E, 0,0x464F,0x3230, + 0,0x3B53,0x557D,0x5622,0x5621,0x367D, 0,0x557E, + 0,0x4538, 0, 0, 0, 0, 0, 0, + 0, 0,0x4230, 0,0x454B,0x3C48, 0, 0, +0x4158,0x4D7A, 0, 0, 0, 0, 0, 0, +0x5624, 0,0x5625,0x4656, 0,0x3B33, 0, 0, + 0, 0,0x5627, 0, 0,0x5628, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5629, 0, 0, 0,0x3474,0x562A, 0, 0, +0x562B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x322C, 0, 0, + 0, 0, 0, 0,0x413B,0x3464, 0,0x562D, +0x4C28, 0, 0, 0, 0,0x4252, 0,0x3359, + 0, 0,0x562F,0x5631,0x345F, 0, 0,0x562E, +0x5630, 0,0x5633, 0, 0, 0, 0, 0, + 0,0x5632, 0,0x5634, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5635, 0, 0, + 0, 0, 0, 0,0x463D,0x362E, 0, 0, + 0, 0, 0, 0,0x3265,0x5636,0x563B, 0, + 0,0x5639, 0,0x4A77,0x4A76, 0, 0, 0, + 0, 0,0x4567, 0, 0, 0,0x5638,0x3D54, + 0,0x5637, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F72, 0, 0, 0,0x563C, + 0, 0,0x3A6A, 0, 0,0x5642, 0, 0, +0x5643,0x563D,0x3333,0x563E,0x5647,0x5646,0x5645,0x5641, + 0, 0, 0,0x5640, 0, 0,0x5644, 0, + 0, 0, 0, 0, 0,0x4A78}; + +/* page 34 0x5D4B-0x6BF3 */ +static uint16 tab_uni_jisx020834[]={ +0x564B,0x5648, 0,0x564A, 0,0x4D72, 0,0x5649, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x563F, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3F73, 0, + 0,0x564C, 0, 0,0x3A37, 0, 0, 0, +0x564D, 0, 0,0x564E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5651, + 0,0x5650, 0, 0,0x564F, 0, 0, 0, +0x4568,0x563A, 0, 0, 0,0x5657, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5653, 0, 0, 0, 0,0x5652, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5654, 0,0x5655, 0, 0, 0, 0, + 0, 0, 0, 0,0x5658, 0, 0,0x4E66, + 0,0x5659,0x5656, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x565A, 0, + 0,0x3460,0x565B, 0, 0, 0, 0,0x565D, +0x565C, 0, 0,0x565E, 0, 0, 0, 0, +0x565F, 0,0x406E,0x3D23, 0, 0,0x3D64, 0, +0x4163, 0,0x3929,0x3A38,0x392A,0x3570, 0, 0, +0x5660, 0, 0,0x3A39, 0, 0,0x384A,0x5661, +0x4C26,0x4743,0x5662, 0,0x392B, 0, 0, 0, +0x342C, 0,0x4327,0x3652, 0, 0, 0,0x3B54, +0x495B, 0, 0,0x4841, 0, 0, 0, 0, +0x5663,0x3475, 0, 0, 0, 0,0x5666, 0, + 0, 0, 0,0x4421, 0, 0,0x5665,0x5664, +0x5667, 0,0x446B, 0, 0, 0, 0, 0, + 0, 0,0x3F63, 0, 0, 0, 0, 0, +0x3B55, 0,0x404A, 0,0x4253,0x3522, 0, 0, +0x4422, 0, 0,0x5668,0x5669,0x3E6F, 0, 0, + 0, 0,0x4B39, 0, 0,0x566C, 0, 0, +0x566B,0x566A,0x497D, 0,0x5673, 0, 0, 0, + 0,0x4B5A, 0,0x566D, 0, 0, 0, 0, + 0,0x566F,0x4B6B, 0,0x566E, 0, 0, 0, + 0, 0, 0, 0,0x5670, 0,0x4828,0x5671, +0x4A3E,0x5672, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3433, +0x4A3F,0x472F,0x5674,0x5675, 0,0x392C,0x3434,0x5676, +0x3838,0x4D44,0x4D29,0x3476,0x5678, 0,0x4423, 0, +0x392D,0x3E31, 0, 0,0x485F, 0, 0,0x3E32, + 0, 0, 0, 0,0x3D78, 0, 0, 0, + 0, 0,0x446C,0x4A79,0x4539, 0, 0,0x392E, + 0,0x495C, 0, 0, 0,0x5679, 0, 0, + 0, 0, 0,0x4559,0x3A42, 0, 0, 0, +0x384B, 0,0x446D, 0, 0, 0, 0, 0, + 0, 0,0x3043,0x3D6E,0x392F,0x4D47, 0, 0, + 0, 0, 0, 0, 0, 0,0x567A,0x567B, +0x4751, 0, 0, 0, 0,0x567C,0x4E77,0x4F2D, + 0, 0, 0, 0,0x567E,0x567D, 0, 0, +0x3347, 0, 0,0x5721, 0, 0, 0,0x5724, +0x5725, 0,0x5723, 0,0x4940,0x3E33,0x5727,0x5726, +0x5722, 0, 0, 0, 0,0x5728,0x5729, 0, + 0,0x572A, 0, 0, 0,0x572D,0x572B, 0, +0x572C,0x572E, 0,0x3164,0x446E,0x572F, 0,0x377A, +0x3276,0x4736, 0,0x5730,0x467B, 0,0x4A5B, 0, +0x5731,0x4F2E, 0, 0, 0, 0,0x5732,0x4A40, +0x5735,0x5021,0x5031, 0,0x3C30,0x4675,0x5736, 0, +0x355D,0x4424,0x307A,0x5737,0x4A26,0x3930, 0, 0, +0x4350, 0, 0, 0,0x446F, 0, 0, 0, + 0, 0,0x4C6F,0x3839,0x384C, 0,0x5738, 0, + 0, 0,0x5739, 0,0x573F, 0,0x3C65, 0, + 0, 0,0x4425, 0,0x362F,0x573A, 0, 0, + 0,0x492B, 0,0x4346, 0, 0,0x573B, 0, + 0, 0, 0, 0, 0,0x573C, 0,0x3630, + 0,0x573D, 0,0x573E, 0, 0,0x5740, 0, +0x4576, 0, 0,0x5741,0x5742, 0,0x5743, 0, + 0,0x5734,0x5733, 0, 0, 0,0x5744,0x3741, + 0, 0, 0,0x4927, 0, 0,0x3A4C,0x4937, +0x4426,0x494B,0x5745, 0, 0,0x3E34,0x3146, 0, +0x5746, 0, 0, 0,0x5747, 0,0x4C72, 0, + 0,0x4860, 0, 0,0x574A,0x317D,0x402C,0x5749, +0x5748,0x3742,0x4254, 0,0x574E,0x574C, 0,0x574B, +0x4E27,0x3865, 0, 0, 0,0x3D79,0x574D,0x454C, +0x3D3E, 0, 0, 0,0x4640,0x5751,0x5750, 0, + 0, 0, 0,0x574F, 0,0x5752,0x3866, 0, + 0, 0, 0, 0, 0,0x5753,0x497C,0x3D5B, + 0, 0,0x5754,0x4879, 0, 0, 0, 0, +0x4641,0x4427, 0, 0, 0, 0,0x4530, 0, + 0,0x5755,0x352B, 0, 0, 0, 0, 0, +0x3F34, 0,0x492C, 0, 0, 0, 0, 0, + 0,0x3477,0x4726, 0, 0, 0, 0, 0, + 0, 0, 0,0x5756,0x3B56,0x4B3A,0x4B3B, 0, + 0,0x317E,0x575B, 0, 0,0x4369, 0, 0, + 0,0x5758, 0, 0, 0, 0, 0, 0, +0x3277, 0, 0, 0, 0,0x582D,0x575A, 0, + 0, 0,0x4730, 0, 0,0x5759, 0, 0, +0x5757, 0,0x397A, 0,0x575D, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5763,0x5769,0x5761, 0,0x455C, + 0, 0,0x5766,0x495D, 0, 0,0x5760, 0, +0x5765,0x4E67,0x3B57, 0, 0,0x4255,0x575E, 0, + 0, 0,0x355E,0x5768,0x402D,0x3165,0x5762,0x3278, +0x5767, 0, 0, 0,0x3631, 0,0x5764, 0, + 0, 0, 0, 0, 0, 0, 0,0x576A, + 0, 0, 0, 0, 0, 0,0x576C,0x5776, +0x5774, 0, 0,0x5771, 0, 0, 0,0x5770, +0x4E78, 0,0x5772, 0, 0,0x3632, 0,0x3931, + 0, 0,0x3D7A, 0, 0, 0,0x5779,0x576B, + 0, 0, 0, 0,0x576F,0x575F, 0,0x327A, +0x5773,0x5775,0x4351, 0, 0,0x3A28,0x3238,0x576D, +0x5778,0x5777,0x3633, 0,0x4229,0x3366, 0, 0, + 0, 0,0x3743, 0,0x576E, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x577A, 0, +0x577D,0x5821, 0, 0, 0, 0,0x3C3D, 0, +0x5827,0x4470,0x577B, 0, 0, 0, 0,0x5825, + 0,0x3279, 0,0x5823,0x5824, 0, 0,0x577E, +0x5822, 0, 0, 0,0x3867,0x4D2A, 0, 0, +0x3435, 0, 0,0x3159,0x5826, 0,0x473A,0x302D, + 0, 0, 0, 0, 0, 0, 0,0x4861, +0x575C,0x582C,0x5830,0x4C65, 0,0x5829, 0, 0, + 0,0x4569,0x582E, 0, 0, 0, 0, 0, + 0, 0,0x3E70,0x582F,0x4657, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4F47, 0, +0x582B, 0, 0, 0, 0,0x5831, 0,0x397B, + 0,0x404B, 0, 0,0x3054,0x582A,0x5828, 0, +0x415A, 0, 0, 0,0x577C,0x3B34, 0, 0, + 0, 0, 0, 0, 0,0x4246,0x583D, 0, +0x415B,0x5838, 0,0x5835,0x5836, 0,0x3C66,0x5839, +0x583C, 0, 0, 0, 0,0x5837,0x3D25, 0, +0x583A, 0, 0,0x5834, 0,0x4C7C,0x4C7B, 0, + 0, 0,0x583E,0x583F,0x3055, 0, 0, 0, + 0, 0,0x5833, 0, 0, 0, 0,0x3672, +0x3026, 0, 0, 0,0x3436, 0,0x583B, 0, + 0, 0, 0, 0,0x5843,0x5842, 0, 0, + 0,0x5847, 0, 0, 0, 0, 0, 0, + 0,0x5848, 0, 0, 0, 0, 0, 0, + 0,0x5846,0x5849,0x5841,0x5845, 0, 0,0x584A, + 0,0x584B, 0, 0,0x5840,0x3B7C, 0,0x5844, +0x4256,0x3932,0x5832,0x3F35, 0, 0, 0, 0, +0x5858, 0,0x4A69, 0, 0,0x584E,0x584F,0x5850, + 0, 0,0x5857, 0,0x5856, 0, 0,0x4B7D, +0x3437, 0,0x5854, 0,0x3745,0x3334, 0, 0, +0x5851, 0, 0,0x4E38,0x5853,0x3056,0x5855, 0, +0x584C,0x5852,0x5859,0x3744,0x584D, 0, 0, 0, + 0, 0, 0,0x4D5D, 0, 0, 0,0x4D2B, + 0, 0, 0, 0,0x585C, 0, 0,0x5860, + 0, 0, 0,0x417E, 0,0x4E79,0x5861, 0, + 0,0x585E, 0,0x585B, 0, 0,0x585A,0x585F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4A30, 0, 0,0x4634, 0,0x3746, 0, +0x5862,0x585D, 0,0x5863, 0, 0, 0,0x377B, + 0, 0, 0,0x3231, 0, 0, 0,0x586B, + 0, 0, 0,0x3438, 0, 0, 0, 0, +0x5869, 0, 0,0x586A,0x3A29,0x5868,0x5866,0x5865, +0x586C,0x5864,0x586E, 0, 0,0x327B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5870, 0, 0,0x586F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4428, + 0,0x5873, 0,0x5871,0x5867,0x377C, 0,0x5872, + 0,0x5876,0x5875,0x5877,0x5874,0x5878, 0, 0, + 0, 0, 0, 0, 0,0x5879,0x587A,0x4A6A, + 0,0x587C,0x587B,0x3D3F, 0,0x402E,0x3266,0x327C, + 0,0x587D, 0,0x303F, 0, 0, 0,0x404C, +0x587E, 0,0x6C43,0x5921,0x3761, 0,0x5922, 0, + 0, 0, 0,0x406F, 0, 0, 0,0x5923, + 0, 0, 0,0x5924,0x353A,0x5925, 0,0x5926, +0x5927,0x4257, 0, 0, 0,0x384D, 0, 0, +0x4C61, 0, 0, 0,0x4B3C,0x3D6A,0x5928, 0, + 0, 0, 0, 0,0x4070,0x6E3D,0x4862, 0, +0x3C6A, 0,0x3A4D,0x5929, 0, 0, 0, 0, +0x4247, 0,0x4A27, 0, 0,0x4271, 0, 0, +0x592C, 0, 0,0x592A, 0,0x592D, 0, 0, +0x592B, 0, 0, 0, 0,0x592E, 0, 0, + 0, 0, 0,0x4A31, 0, 0,0x3037, 0, + 0, 0, 0,0x495E, 0, 0,0x4863, 0, + 0,0x592F, 0,0x5932,0x3E35,0x353B, 0,0x5930, +0x5937,0x3E36, 0, 0, 0, 0,0x5931,0x4744, + 0, 0, 0, 0, 0, 0,0x4D5E,0x5933, +0x5934,0x5938,0x456A,0x5935,0x3933,0x405E, 0, 0, +0x5946,0x4834, 0,0x4272, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4864,0x5A2D, 0, 0, 0, 0,0x4A7A, 0, + 0, 0,0x4471, 0, 0, 0,0x4B75, 0, +0x593B,0x3221,0x436A, 0, 0, 0, 0,0x5944, + 0, 0,0x4334,0x593E,0x5945,0x5940,0x5947,0x5943, + 0,0x5942,0x476F, 0,0x593C,0x327D,0x593A,0x3571, +0x4273,0x5936, 0, 0,0x5939,0x3934,0x405B, 0, +0x3E37,0x5941,0x4752, 0, 0,0x3572,0x3348, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3367,0x3F21,0x5949,0x594E, 0,0x594A, 0, +0x377D, 0,0x594F,0x3B22,0x3969, 0, 0, 0, + 0, 0, 0,0x3D26,0x593D, 0,0x3B7D,0x594C, + 0, 0, 0, 0,0x3B58,0x594D,0x3044, 0, + 0,0x5948, 0, 0, 0, 0,0x4429, 0, + 0, 0, 0, 0, 0, 0,0x3573, 0, + 0, 0, 0, 0,0x3634, 0, 0, 0, + 0, 0, 0, 0,0x594B,0x3027, 0, 0, +0x3A43, 0, 0, 0,0x3F36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4472, + 0, 0,0x4854,0x5951,0x415E, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x422A, 0, + 0,0x3B2B,0x5952, 0,0x5954,0x5950, 0, 0, + 0, 0,0x4A61, 0,0x443D, 0, 0, 0, + 0,0x415C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4A7B,0x3C4E,0x5960, 0, +0x595F, 0, 0,0x3F78, 0, 0, 0,0x377E, + 0, 0, 0,0x5959,0x3E39, 0, 0,0x4668, +0x4731, 0, 0, 0, 0,0x5957, 0, 0, +0x415D, 0, 0, 0, 0,0x3C78,0x595C, 0, + 0,0x3E38, 0,0x5956,0x595B, 0, 0,0x4753, + 0, 0, 0,0x5955, 0,0x3721, 0, 0, +0x335D, 0, 0, 0,0x595D,0x4E2B,0x3A4E,0x4335, +0x595A, 0,0x405C, 0,0x3935,0x3F64,0x3166,0x413C, +0x5958,0x3545, 0, 0, 0, 0, 0,0x3747, + 0,0x444F,0x595E, 0, 0, 0, 0, 0, +0x415F, 0, 0,0x5961, 0,0x5963, 0, 0, +0x4237,0x5969, 0,0x5964, 0, 0,0x5966, 0, + 0, 0, 0, 0,0x4941,0x4473, 0,0x5967, + 0, 0, 0,0x4D2C, 0, 0, 0,0x4D48, +0x3439, 0, 0, 0, 0, 0,0x302E, 0, +0x5965, 0, 0, 0, 0, 0,0x5962, 0, + 0, 0, 0,0x3478, 0, 0, 0, 0, + 0,0x3167, 0,0x5968, 0, 0, 0,0x4D49, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x596C, 0, 0, 0, 0, + 0, 0,0x423B, 0,0x5973, 0, 0, 0, +0x596D, 0, 0,0x596A,0x5971, 0, 0, 0, + 0,0x5953, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x596E, 0,0x5972, 0, 0, + 0,0x4842,0x456B, 0, 0, 0, 0, 0, + 0,0x596B, 0,0x596F, 0, 0, 0,0x3748, + 0, 0, 0,0x3A71, 0, 0, 0,0x405D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5977, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4526, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5974, 0,0x4B60, 0, + 0, 0, 0, 0,0x5975, 0, 0, 0, + 0, 0, 0,0x5976, 0,0x4C4E, 0,0x4022, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3762, 0, 0, 0, 0,0x597D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3B35, +0x597A, 0,0x5979, 0, 0, 0, 0,0x4732, + 0, 0, 0,0x4635, 0, 0, 0, 0, + 0,0x4531,0x597B, 0, 0, 0,0x597C, 0, +0x496F, 0,0x4745,0x3B23, 0,0x4071, 0,0x4B50, + 0, 0, 0, 0, 0, 0,0x3349, 0, +0x5A25,0x597E, 0, 0, 0, 0,0x4D4A,0x5A27, + 0, 0,0x5A23, 0,0x5A24, 0, 0, 0, + 0, 0,0x4160, 0, 0, 0, 0,0x5A22, + 0,0x593F, 0, 0, 0,0x5A26, 0,0x5A21, + 0, 0, 0, 0, 0,0x5A2B,0x5A2C,0x4527, +0x5A2E, 0, 0,0x3B24,0x5A29, 0, 0, 0, + 0,0x353C, 0, 0,0x5A2F, 0,0x5A28,0x5A33, + 0,0x5A32, 0,0x5A31, 0, 0, 0,0x5A34, + 0, 0,0x5A36,0x3E71, 0,0x5A35, 0, 0, + 0, 0,0x5A39, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5A37, 0, 0, + 0,0x5A38,0x5970, 0, 0, 0, 0, 0, +0x5A3B,0x5A3A, 0, 0, 0, 0, 0,0x5978, +0x5A3C,0x5A30, 0, 0,0x3B59, 0, 0, 0, + 0,0x5A3D,0x5A3E,0x5A40,0x5A3F,0x5A41,0x327E, 0, +0x3936, 0, 0,0x4A7C,0x402F, 0, 0, 0, + 0, 0,0x384E, 0, 0,0x5A43, 0, 0, + 0, 0,0x5A46, 0,0x4952, 0,0x355F, 0, + 0, 0,0x5A45,0x5A44,0x4754,0x5A47,0x3635, 0, + 0, 0,0x5A49,0x5A48, 0, 0, 0,0x343A, +0x3B36, 0, 0,0x4658, 0, 0, 0, 0, + 0,0x3749, 0, 0, 0,0x3F74, 0,0x5A4A, + 0,0x4030,0x4528, 0,0x495F,0x5A4B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5A4C, +0x5A4D, 0, 0, 0,0x4A38,0x555D,0x4046, 0, + 0,0x494C, 0,0x3A58, 0,0x4865,0x4843, 0, + 0, 0, 0, 0,0x454D, 0,0x4E41, 0, +0x5A4F,0x3C50, 0, 0,0x5A50, 0,0x3036, 0, + 0,0x3654,0x404D, 0,0x4960, 0, 0, 0, +0x5A51,0x3B42,0x4347, 0,0x3B5B,0x3F37, 0, 0, + 0, 0, 0, 0,0x5A52, 0,0x4A7D, 0, + 0,0x3177,0x3B5C, 0, 0, 0,0x5A55, 0, +0x5A53,0x5A56,0x4E39,0x5A54, 0, 0, 0, 0, +0x407B,0x5A57, 0, 0,0x4232, 0, 0,0x5A58, + 0, 0, 0, 0,0x347A, 0,0x5A5A, 0, +0x5A59, 0, 0, 0, 0,0x5A5B,0x5A5C,0x347B, + 0, 0,0x467C,0x4336,0x356C,0x3B5D,0x4161, 0, + 0,0x3D5C,0x3030, 0, 0, 0,0x5A5D, 0, + 0, 0, 0, 0, 0, 0, 0,0x3222, +0x5A61, 0, 0, 0, 0, 0, 0,0x3937, +0x5A60, 0, 0,0x3A2B,0x3E3A, 0, 0,0x5A5F, + 0,0x3E3B, 0,0x4C40,0x3A2A, 0, 0, 0, +0x3057,0x404E, 0, 0, 0, 0, 0, 0, + 0,0x5A66, 0, 0,0x4031,0x3147, 0, 0, + 0, 0,0x3D55, 0,0x4B66,0x3A72, 0, 0, + 0, 0,0x3E3C, 0,0x4027, 0, 0, 0, + 0,0x5A65,0x5A63,0x5A64, 0, 0, 0, 0, + 0,0x436B, 0, 0,0x5B26, 0,0x5A6A,0x3B7E, +0x3938,0x5A68, 0, 0, 0, 0,0x5A69, 0, +0x3F38, 0, 0, 0,0x5A67, 0, 0,0x3B2F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5A6C,0x5A6B,0x5A70, 0, 0,0x5A71, + 0,0x5A6D, 0,0x3322,0x5A6E,0x5A6F,0x4855, 0, + 0, 0, 0,0x4961,0x374A,0x5A72, 0, 0, + 0,0x4032, 0,0x3E3D, 0, 0, 0,0x4352, + 0, 0, 0, 0, 0, 0,0x3647, 0, +0x5A73,0x5A77, 0, 0,0x324B,0x5A74,0x5A76, 0, + 0, 0, 0,0x5A75, 0, 0,0x3D6B, 0, + 0, 0, 0,0x4348,0x3045,0x5A78, 0, 0, + 0, 0,0x5A79, 0, 0, 0, 0,0x442A, + 0, 0, 0,0x4E71, 0, 0, 0, 0, +0x3B43, 0, 0,0x4A6B, 0, 0, 0, 0, + 0,0x4B3D, 0, 0, 0,0x5B22,0x5A7B, 0, + 0,0x5A7E, 0,0x5A7D, 0, 0,0x5A7A, 0, + 0,0x5B21, 0, 0,0x465E, 0,0x5A7C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5B23, 0, 0,0x3D6C,0x5B24, + 0,0x4D4B,0x4778, 0, 0,0x5B25, 0, 0, + 0, 0, 0,0x5B27, 0, 0,0x5B28, 0, + 0, 0, 0, 0, 0,0x5B29, 0,0x364A, +0x3148,0x3939,0x5B2A, 0,0x5B2B,0x3D71,0x4162, 0, + 0,0x5258,0x413E,0x413D,0x4258,0x3A47, 0, 0, +0x5072, 0, 0, 0, 0,0x376E,0x4D2D, 0, +0x4A7E, 0,0x497E, 0,0x5B2C, 0, 0, 0, + 0,0x3A73,0x443F,0x5B2D,0x4F2F, 0, 0, 0, +0x4B3E, 0,0x442B,0x5B2E,0x347C, 0, 0, 0, + 0, 0, 0,0x5B2F,0x5B30,0x4C5A, 0,0x4C24, +0x4B76,0x4B5C,0x3B25,0x5B32, 0, 0,0x3C6B, 0, + 0,0x4B51, 0,0x5B34,0x5B37,0x5B36, 0,0x3479, + 0, 0,0x3560, 0,0x5B33, 0,0x5B35, 0, + 0, 0, 0,0x5B38, 0, 0,0x3F79, 0, + 0, 0, 0,0x4D7B,0x3049,0x3A60,0x423C, 0, +0x3C5D, 0, 0,0x3E73, 0, 0,0x5B3B, 0, + 0,0x454E, 0,0x5B39,0x422B,0x5B3A,0x3E72,0x4C5D, +0x5B3C,0x5B3D,0x4D68, 0, 0, 0, 0,0x5B42, + 0, 0,0x393A, 0,0x4755,0x5B3F,0x456C,0x5A5E, +0x5A62, 0,0x354F, 0,0x4747, 0, 0, 0, + 0,0x5B41, 0,0x3E3E,0x4844, 0, 0, 0, + 0, 0,0x5B47, 0,0x487A, 0,0x5B3E, 0, +0x5B44,0x5B43, 0, 0, 0,0x404F, 0, 0, + 0, 0,0x4B6D, 0,0x4E53, 0, 0,0x4B67, + 0,0x324C,0x3B5E, 0, 0,0x4F48,0x5B46,0x3F75, + 0, 0, 0,0x5B45, 0, 0,0x5B40, 0, + 0, 0, 0, 0,0x384F, 0, 0, 0, +0x5B4C,0x5B4A, 0,0x324D,0x5B48,0x5B4E,0x5B54, 0, + 0, 0, 0, 0, 0, 0,0x4248, 0, + 0,0x4A41, 0,0x5B56, 0, 0, 0,0x4922, + 0, 0, 0,0x5B55,0x4770,0x4B3F,0x343B, 0, +0x4077,0x3D40, 0, 0, 0,0x4453, 0,0x4D2E, + 0, 0,0x5B51,0x5B50, 0, 0, 0,0x5B52, + 0,0x5B4F, 0, 0,0x5B57, 0,0x5B4D, 0, + 0,0x5B4B, 0,0x5B53,0x5B49, 0,0x436C, 0, +0x4C78,0x3C46,0x3A74, 0, 0, 0, 0, 0, +0x3A3A, 0, 0,0x4B6F,0x3341, 0, 0,0x444E, +0x464A,0x3149, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4072, 0, 0,0x4034,0x372A, 0, 0, 0, + 0, 0, 0,0x5B59, 0, 0,0x393B,0x337C, + 0, 0, 0, 0, 0, 0,0x5B5B,0x3374, +0x5B61, 0, 0, 0, 0, 0, 0,0x5B5E, + 0,0x4073, 0, 0, 0,0x334B,0x3A2C, 0, + 0,0x334A,0x3A4F, 0, 0,0x5B5C,0x3765,0x374B, +0x456D, 0, 0,0x5B5A, 0,0x3046, 0, 0, + 0, 0,0x5B5D,0x5B5F, 0,0x364D,0x372C, 0, +0x343C,0x354B, 0, 0, 0, 0,0x5B62, 0, + 0,0x3A79,0x4B71, 0,0x3B37, 0, 0, 0, +0x5B63, 0, 0, 0,0x4930, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B6F, 0,0x3233,0x5B64, 0, 0, 0, + 0, 0, 0,0x5B75,0x5B65, 0,0x4E42, 0, +0x5B6C, 0,0x475F, 0, 0, 0, 0, 0, + 0, 0,0x5B74, 0,0x5B67, 0, 0, 0, +0x3034,0x5B69, 0, 0,0x393C, 0, 0, 0, +0x5B6B, 0,0x5B6A, 0,0x5B66,0x5B71, 0,0x3E3F, + 0, 0, 0,0x546D,0x3868,0x4D7C, 0, 0, + 0, 0,0x5B68, 0,0x4474,0x3323,0x3A2D, 0, +0x5B60, 0,0x5B70,0x3361, 0, 0,0x5B6E,0x5B72, + 0,0x456E, 0, 0, 0, 0, 0, 0, + 0,0x347E, 0,0x5C32, 0, 0,0x4C49,0x5B77, +0x347D, 0,0x5B7E, 0, 0, 0, 0,0x4B40, + 0,0x5C21,0x5C23, 0,0x5C27,0x5B79, 0,0x432A, + 0, 0, 0, 0,0x456F,0x5C2B,0x5B7C, 0, +0x5C28, 0, 0, 0,0x5C22, 0, 0, 0, + 0, 0, 0,0x3F39,0x5C2C, 0, 0,0x4033, + 0, 0, 0, 0, 0, 0,0x5C2A,0x343D, + 0, 0, 0, 0, 0,0x4F50,0x5B76, 0, + 0,0x5C26,0x3058, 0, 0,0x5B78, 0, 0, +0x4C3A,0x5B7D,0x3F22,0x4447,0x5B73, 0, 0,0x5C25, + 0, 0, 0, 0, 0, 0,0x3F7A,0x5C2F, +0x3371,0x3821, 0, 0, 0, 0,0x5C31,0x5B7A, +0x5C30, 0,0x5C29,0x5B7B, 0,0x5C2D, 0,0x5C2E, + 0, 0, 0, 0, 0,0x5C3F, 0, 0, + 0,0x464E, 0,0x5C24, 0, 0,0x5C3B, 0, + 0, 0,0x5C3D, 0,0x4458, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4D4C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4976,0x5C38,0x424A, 0, 0, 0,0x5C3E,0x413F, + 0,0x5C35,0x5C42,0x5C41, 0,0x466F,0x5C40,0x466A, + 0, 0, 0, 0, 0, 0, 0,0x5C44, +0x5C37, 0,0x3648,0x5C3A,0x3D5D, 0, 0, 0, +0x4760,0x5C3C,0x364B, 0,0x5C34,0x5C36,0x5C33, 0, + 0,0x4F30,0x335A,0x5C39, 0, 0,0x5C43,0x3335, + 0, 0, 0, 0, 0, 0, 0,0x3A67, + 0, 0, 0,0x315D, 0, 0,0x5C54, 0, + 0,0x4F31,0x5C57, 0, 0, 0, 0, 0, +0x3F3A,0x5C56, 0, 0, 0,0x5C55, 0, 0, + 0, 0, 0, 0,0x5C52, 0, 0, 0, + 0, 0, 0,0x5C46, 0, 0,0x5C63,0x5C45, + 0,0x5C58, 0, 0, 0, 0, 0, 0, +0x5C50, 0, 0,0x5C4B,0x5C48, 0,0x5C49, 0, +0x5C51, 0, 0, 0,0x7422, 0, 0,0x5C4E, +0x393D,0x4448,0x4164,0x5C4C, 0,0x5C47, 0, 0, +0x5C4A, 0, 0, 0, 0,0x4D4D,0x4B6A, 0, + 0, 0,0x5C4F,0x5C59, 0, 0, 0, 0, + 0, 0, 0, 0,0x5C61,0x5C5A, 0, 0, +0x5C67, 0,0x5C65, 0, 0, 0, 0,0x5C60, + 0, 0, 0, 0, 0, 0,0x5C5F, 0, +0x4450, 0,0x4165, 0,0x5C5D, 0, 0,0x5C5B, + 0, 0,0x5C62, 0, 0, 0, 0,0x5C68, +0x4875,0x5C6E, 0, 0, 0, 0, 0,0x5C69, +0x5C6C,0x5C66, 0, 0,0x4374, 0,0x4938, 0, +0x5C5C, 0, 0,0x5C64,0x3E40, 0,0x4C4F,0x5C78, +0x5C6B, 0, 0, 0, 0, 0,0x3822,0x3223, +0x335F, 0, 0,0x5C53, 0, 0, 0, 0, + 0, 0,0x3E41,0x5C70, 0,0x5C77,0x3C79,0x3372, + 0, 0,0x432E, 0, 0, 0, 0, 0, + 0,0x5C6D, 0, 0,0x5C72,0x5C76, 0, 0, +0x3636, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x354C,0x5C74, 0, + 0, 0, 0, 0,0x3521, 0,0x464B,0x5C73, + 0, 0, 0,0x5C75, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5C6F, + 0, 0, 0, 0, 0,0x5C71, 0, 0, + 0, 0, 0, 0,0x3360,0x4349, 0, 0, + 0,0x5C7C, 0, 0, 0, 0, 0, 0, + 0, 0,0x5C7A,0x3869, 0,0x5C79, 0, 0, + 0, 0, 0, 0,0x5D21, 0, 0, 0, + 0,0x5B58, 0, 0, 0,0x5C7B, 0,0x5C7D, +0x5C7E, 0, 0, 0, 0, 0, 0,0x5D2C, + 0,0x5D28, 0,0x5B6D, 0, 0, 0, 0, +0x5D27, 0, 0, 0, 0,0x5D26, 0, 0, +0x5D23, 0, 0, 0, 0, 0,0x5C6A,0x5D25, +0x5D24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5D2A, 0, +0x4F26, 0, 0, 0, 0, 0, 0,0x5D2D, +0x367B, 0, 0,0x5D29,0x5D2B, 0, 0, 0, + 0, 0, 0, 0, 0,0x4827, 0,0x5D2E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5D32, +0x5D2F, 0, 0, 0, 0, 0, 0, 0, + 0,0x4D73,0x5D30, 0, 0, 0, 0,0x5C5E, + 0, 0, 0, 0, 0, 0, 0,0x5D33, + 0, 0, 0,0x5D34, 0, 0, 0, 0, + 0, 0,0x3135, 0,0x5D36,0x3767,0x3C21, 0, +0x3655, 0, 0, 0,0x3224, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4D5F, + 0, 0, 0, 0,0x5D38,0x5D37,0x5D3A,0x353D, + 0, 0,0x3656,0x343E, 0, 0, 0, 0, +0x5D3D, 0, 0, 0,0x5D3C, 0,0x5D3E, 0, + 0,0x324E, 0,0x4337, 0,0x5D3F, 0, 0, +0x343F,0x5D41, 0, 0, 0, 0,0x5D40, 0, +0x5D42, 0, 0, 0,0x5D43, 0,0x5D44,0x3B5F, +0x4035,0x3A21, 0,0x4970, 0, 0,0x4A62,0x4F44, + 0, 0, 0, 0,0x3B75, 0, 0, 0, +0x3A50,0x4E72, 0, 0, 0,0x5D45,0x5D46, 0, +0x3B60, 0, 0, 0,0x5D47,0x5D48, 0, 0, +0x5D4A,0x5D49, 0,0x4B58, 0, 0,0x3D5E,0x3C6C, +0x3B44, 0,0x5D4B, 0, 0, 0, 0, 0, + 0, 0,0x5D4D,0x3F23, 0,0x5D4C, 0, 0, + 0, 0, 0,0x5D4E, 0, 0, 0, 0, + 0,0x5D4F, 0, 0, 0, 0, 0,0x5D50, +0x5D51, 0, 0, 0,0x5D52, 0,0x5D54,0x5D53, +0x5D55,0x3225,0x434A, 0,0x5D56, 0, 0,0x3B26, +0x334C,0x5D57, 0, 0,0x4542,0x544C, 0, 0, + 0, 0,0x3523,0x5D58, 0, 0, 0, 0, +0x5D59, 0,0x4A6C,0x4B68, 0, 0, 0,0x4647, +0x5D5A,0x4866, 0, 0, 0,0x487B, 0, 0, +0x4C53, 0, 0, 0,0x5D5B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5D5D,0x5D5C, 0, 0,0x5D5F, 0, 0, 0, +0x5D5E}; + +/* page 35 0x6C08-0x6CF3 */ +static uint16 tab_uni_jisx020835[]={ +0x5D61, 0, 0, 0, 0, 0, 0,0x3B61, + 0,0x4C31, 0,0x5D62,0x5D63, 0, 0,0x3524, + 0, 0, 0,0x5D64, 0, 0, 0, 0, + 0, 0, 0,0x5D66,0x5D65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3F65, 0, 0,0x4939, +0x314A, 0, 0, 0, 0, 0,0x4845, 0, +0x4475,0x3D41,0x3561, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4846, 0, +0x3C2E, 0, 0, 0, 0,0x5D68, 0,0x3440, + 0, 0,0x3178, 0, 0,0x4672,0x5D67,0x393E, +0x4353, 0,0x5D69, 0, 0, 0, 0, 0, +0x5D71, 0,0x5D6A, 0, 0, 0, 0, 0, +0x4241, 0,0x3562,0x5D72, 0, 0, 0, 0, + 0, 0,0x3768, 0, 0,0x3525,0x5D70, 0, + 0,0x5D6E,0x5D6B,0x4D60, 0, 0, 0, 0, +0x4440, 0, 0, 0,0x4659,0x5D6C, 0, 0, +0x5D74, 0,0x5D73,0x3723, 0, 0,0x322D, 0, + 0,0x3A3B,0x5D6D,0x5D6F, 0, 0, 0, 0, + 0,0x4B57,0x4274, 0, 0, 0, 0, 0, + 0, 0, 0,0x4B77, 0, 0,0x5D7C, 0, + 0,0x5D7D, 0,0x324F, 0, 0, 0, 0, +0x4A28,0x4C7D,0x5E21,0x3C23,0x3E42,0x5D78,0x5D7E,0x3168, + 0,0x3637, 0, 0,0x5D75,0x5D7A, 0, 0, + 0,0x4074,0x4771, 0,0x4867, 0, 0, 0, + 0, 0, 0,0x5D77, 0,0x4B21, 0,0x5D79, + 0,0x5E24, 0,0x5E22, 0,0x5D7B, 0, 0, + 0,0x4B22,0x4748,0x3563, 0,0x4525, 0, 0, +0x436D, 0,0x5E25, 0, 0, 0, 0,0x5E23, +0x4259,0x5D76, 0,0x314B}; + +/* page 36 0x6D0B-0x7409 */ +static uint16 tab_uni_jisx020836[]={ +0x4D4E,0x5E30, 0, 0, 0, 0, 0,0x5E2F, + 0, 0, 0, 0,0x4076, 0,0x5E2C, 0, +0x4D6C, 0, 0,0x4636,0x5E26, 0, 0, 0, + 0, 0,0x4445, 0, 0, 0,0x314C,0x393F, +0x5E29, 0, 0, 0, 0, 0, 0,0x3D27, +0x5E2E, 0,0x5E2D,0x5E28, 0,0x5E2B, 0, 0, +0x3368, 0,0x5E2A,0x4749, 0, 0,0x4E2E, 0, + 0,0x3E74,0x4075, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5E36,0x5E34, + 0,0x494D, 0, 0, 0, 0, 0, 0, +0x5E31,0x5E33, 0,0x313A, 0, 0,0x3940,0x4F32, + 0,0x333D, 0,0x4962, 0, 0, 0, 0, + 0,0x4D61, 0, 0,0x3324,0x3F3B,0x5E35, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5E3A, 0, 0,0x3E43, 0, 0, + 0,0x4D30, 0,0x5E37, 0, 0, 0, 0, +0x5E32, 0,0x5E38, 0, 0, 0,0x4E5E, 0, +0x4573,0x4642, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3336, 0, 0,0x3155, + 0, 0,0x5E3E, 0, 0,0x5E41, 0, 0, + 0,0x4E43, 0, 0, 0,0x4D64, 0, 0, + 0, 0,0x5E48,0x5E42,0x5E3F, 0, 0, 0, +0x4E54,0x5E45, 0, 0, 0, 0,0x3D4A,0x5E47, + 0, 0,0x5E4C, 0, 0,0x4571,0x5E4A, 0, + 0, 0, 0,0x5E44, 0, 0,0x4338, 0, + 0,0x5E4B, 0,0x5E40, 0,0x5E46, 0,0x5E4D, +0x307C,0x5E43, 0,0x5E4E, 0, 0,0x3F3C, 0, +0x3D5F, 0,0x4A25, 0,0x3A2E, 0,0x5E3B,0x5E49, +0x453A, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4036, 0,0x3369,0x3A51,0x3E44,0x5E3D, +0x3D42, 0, 0, 0, 0, 0, 0, 0, +0x374C, 0,0x5E3C, 0, 0, 0,0x5E52,0x3D6D, +0x383A, 0,0x5E61, 0,0x5E5B,0x3574,0x454F, 0, +0x5E56,0x5E5F,0x302F,0x3132, 0, 0,0x3239, 0, +0x5E58,0x422C,0x5E4F,0x5E51,0x3941, 0, 0, 0, + 0, 0, 0, 0, 0,0x5E62, 0,0x5E5D, + 0, 0, 0,0x5E55, 0, 0, 0, 0, +0x5E5C, 0, 0, 0, 0, 0, 0,0x4C2B, + 0, 0,0x5E5A,0x5E5E, 0, 0, 0, 0, + 0, 0, 0,0x3850, 0,0x3E45, 0, 0, +0x4339, 0, 0, 0,0x5E54, 0, 0, 0, + 0, 0, 0, 0,0x4D2F, 0, 0, 0, +0x5E57, 0, 0,0x5E50,0x4572, 0, 0,0x5E53, + 0, 0, 0,0x5E59, 0, 0, 0, 0, + 0, 0, 0,0x4F51,0x3C3E,0x4B7E, 0,0x5E63, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x482E, 0, 0,0x5E6F,0x383B, 0, 0, + 0, 0, 0,0x3D60, 0,0x5E65, 0, 0, + 0,0x4E2F,0x3942, 0,0x5E72, 0, 0,0x306E, + 0, 0,0x5E70, 0, 0, 0, 0,0x5E64, + 0, 0, 0, 0,0x5E6A, 0, 0,0x5E6C, + 0, 0, 0,0x4D4F,0x5E67, 0, 0,0x452E, + 0, 0,0x5E69, 0, 0, 0, 0,0x5E71, + 0,0x5E6B,0x4C47, 0, 0, 0,0x5E66, 0, +0x3C22,0x5E7E, 0, 0, 0, 0,0x336A, 0, +0x5E68,0x5E6D,0x5E6E, 0, 0, 0, 0, 0, + 0, 0,0x426C,0x425A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E76, 0, 0,0x5E7C, 0, 0,0x5E7A, + 0,0x4529, 0, 0,0x5F23,0x5E77, 0, 0, + 0, 0, 0,0x5E78,0x5E60, 0,0x3579,0x493A, + 0, 0, 0,0x3C3F, 0, 0,0x3977, 0, + 0, 0, 0, 0,0x4F33, 0,0x5E74, 0, +0x5F22,0x3169,0x4166, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4779, 0,0x3441, +0x4E7A, 0, 0, 0, 0, 0, 0, 0, +0x4C21,0x4452, 0, 0, 0, 0,0x5E7B,0x5E7D, + 0, 0, 0, 0, 0,0x4132, 0, 0, + 0, 0, 0,0x5F21,0x5E79, 0,0x5E73, 0, + 0, 0,0x3443, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3769, 0, 0, 0,0x5F2F, 0, 0, +0x5F2A,0x4078, 0, 0,0x3363, 0, 0, 0, + 0,0x3D61, 0,0x5F33, 0, 0, 0, 0, + 0, 0,0x5F2C,0x442C,0x5F29,0x4459, 0, 0, + 0,0x5F4C, 0, 0, 0,0x5F26, 0,0x5F25, + 0,0x5F2E, 0, 0, 0,0x5F28,0x5F27,0x5F2D, + 0,0x4021, 0,0x5F24, 0, 0, 0, 0, + 0, 0, 0,0x5F30, 0, 0,0x5F31, 0, + 0, 0, 0, 0,0x3442, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F36, 0, +0x5F35,0x5F37, 0, 0, 0, 0, 0,0x5F3A, + 0, 0, 0, 0, 0, 0,0x4543, 0, +0x5F34, 0, 0, 0, 0, 0,0x5F38, 0, + 0, 0, 0, 0, 0,0x3763,0x4279,0x5F32, +0x473B, 0, 0,0x5F39, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F3E,0x5F3C, 0, 0,0x5F3F, 0, 0, +0x5F42, 0, 0, 0,0x5F3B,0x396A,0x4728, 0, + 0,0x5E39, 0, 0, 0, 0, 0, 0, +0x4D74,0x5F3D, 0,0x5F41,0x4275, 0,0x5F40, 0, +0x5F2B, 0, 0,0x6F69, 0, 0, 0,0x5F45, + 0, 0, 0,0x5F49, 0, 0,0x5F47, 0, + 0, 0, 0, 0, 0, 0,0x5F43, 0, +0x5F44, 0, 0, 0,0x5F48, 0,0x5F46, 0, + 0, 0,0x494E, 0, 0,0x5F4E, 0,0x5F4B, +0x5F4A, 0,0x5F4D,0x4654,0x5F4F, 0, 0, 0, + 0, 0, 0,0x4375,0x426D, 0, 0, 0, + 0,0x4025, 0, 0, 0,0x5F50, 0,0x5F52, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5F51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E75, 0, 0, 0, 0,0x5F53, 0, + 0, 0, 0, 0, 0,0x4667, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F54, 0, 0, 0, 0, 0, 0, 0, +0x3250, 0, 0, 0,0x4574,0x3325, 0, 0, + 0, 0, 0, 0, 0,0x3564, 0, 0, + 0,0x3C5E,0x3A52, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4F27,0x3F66, + 0, 0, 0,0x316A, 0, 0, 0,0x5F56, + 0, 0, 0, 0, 0, 0,0x5F55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F59,0x433A,0x5F5C,0x5F57, 0, 0, 0, +0x5F5B, 0, 0, 0, 0,0x5F5A,0x4540,0x3059, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4E75, 0, 0, +0x5F5E, 0, 0, 0,0x3128, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F60, 0, + 0, 0,0x5F5F, 0,0x5F5D, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F58, 0, + 0, 0, 0, 0, 0, 0,0x4B23, 0, + 0, 0,0x5F62, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F61, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x316B, 0, 0, 0, 0,0x5F64,0x4A32, + 0,0x5F63, 0, 0, 0, 0,0x4C35, 0, + 0, 0, 0,0x3E47, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4133, 0, 0, 0, 0, + 0,0x3E46, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4E7B, 0, + 0,0x5F6A, 0,0x4079, 0, 0, 0, 0, + 0, 0,0x5F66,0x5F6B, 0, 0,0x316C, 0, + 0, 0, 0, 0, 0, 0, 0,0x5F69, + 0,0x4761,0x5F65,0x5F68,0x3E48, 0,0x4851, 0, + 0,0x5F6C, 0,0x3C51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x407A, 0, 0, 0, 0, 0, + 0,0x5F6F, 0, 0, 0,0x5F67, 0,0x3727, + 0, 0, 0, 0,0x5F6D, 0, 0, 0, + 0,0x4D50,0x5F70, 0, 0, 0,0x7426, 0, + 0, 0, 0, 0,0x3D4F, 0, 0, 0, + 0, 0, 0, 0, 0,0x5F71, 0, 0, + 0,0x5F72, 0, 0, 0, 0,0x472E, 0, + 0, 0, 0, 0, 0, 0,0x5F74, 0, + 0, 0, 0,0x5F75, 0, 0, 0, 0, +0x4733, 0, 0, 0, 0,0x4575,0x5F77, 0, + 0, 0, 0,0x5F79, 0,0x4E55, 0,0x5F76, + 0,0x5F78,0x316D, 0,0x5F73, 0, 0, 0, + 0, 0, 0, 0,0x535B,0x5F7A, 0, 0, + 0, 0,0x4167,0x3B38,0x5F7C, 0, 0, 0, + 0,0x5F7B,0x3F24,0x5259, 0, 0, 0, 0, + 0, 0,0x5F7D, 0, 0, 0,0x6021, 0, +0x5F6E,0x5F7E, 0, 0,0x6022, 0, 0, 0, + 0, 0, 0,0x477A, 0, 0, 0, 0, + 0, 0,0x6023, 0, 0,0x6024, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6025, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6026, 0,0x445E, + 0,0x6028,0x6027, 0, 0,0x6029, 0,0x602A, + 0, 0,0x3C5F,0x4963, 0, 0, 0,0x4C6C, +0x602B,0x602C,0x4156,0x3C24,0x602D,0x602E, 0, 0, + 0, 0, 0,0x602F,0x4A52,0x4847, 0, 0, +0x6030,0x4757, 0, 0, 0, 0, 0,0x442D, + 0, 0, 0, 0, 0,0x6031,0x3267, 0, +0x356D, 0,0x4C46, 0,0x4C36, 0,0x3234,0x4F34, + 0, 0, 0, 0,0x4B52, 0,0x4A2A, 0, + 0, 0, 0, 0, 0, 0, 0,0x4037, + 0,0x6032, 0, 0, 0, 0,0x4643, 0, + 0, 0,0x3823,0x6033, 0,0x3A54,0x6035,0x6034, + 0, 0, 0, 0,0x6036, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6037, + 0, 0, 0,0x6038, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x353E, 0,0x6039, + 0, 0, 0, 0,0x603A, 0, 0, 0, + 0,0x3824, 0, 0,0x4848, 0, 0,0x603C, + 0, 0, 0,0x3E75, 0, 0,0x603B, 0, + 0, 0, 0, 0, 0, 0, 0,0x3638, +0x603D,0x603F, 0,0x603E, 0, 0, 0, 0, + 0, 0, 0,0x6040, 0,0x3851, 0,0x6041, + 0, 0, 0, 0,0x3669, 0,0x4140, 0, +0x397D, 0, 0, 0, 0,0x6043,0x6044,0x6042, + 0, 0, 0, 0, 0, 0,0x3C6D, 0, + 0,0x4648,0x3639, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6046,0x432C,0x6045, 0, + 0,0x4F35,0x4762, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6049, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x604B,0x6048, 0, 0, 0, +0x4C54,0x604A,0x604C, 0,0x4E44, 0, 0, 0, + 0, 0,0x6050, 0, 0, 0,0x604F,0x4376, +0x472D, 0, 0,0x3825,0x604E, 0, 0, 0, + 0,0x604D, 0,0x4D31,0x4D32, 0, 0, 0, + 0, 0, 0,0x6051,0x316E, 0, 0, 0, + 0,0x3976,0x3B62, 0, 0, 0, 0, 0, + 0, 0, 0,0x6052,0x6053, 0, 0, 0, + 0, 0, 0, 0,0x6055, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3D43, 0, 0, 0, 0,0x6057, 0,0x6056, + 0, 0, 0, 0, 0,0x6058, 0,0x334D, + 0, 0,0x605A, 0, 0,0x6059, 0,0x605C, +0x605B, 0, 0, 0, 0, 0, 0, 0, + 0,0x383C, 0, 0,0x4E28, 0,0x364C, 0, +0x3226, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x366A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3461, 0, + 0, 0, 0, 0, 0, 0, 0,0x4E68, +0x605E, 0, 0, 0, 0, 0, 0, 0, +0x6060, 0, 0, 0, 0,0x6061, 0,0x3251, + 0, 0, 0, 0, 0,0x605D, 0,0x3B39, + 0, 0,0x4441,0x605F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6064, 0,0x3C6E, 0, 0, + 0, 0,0x6062, 0, 0, 0, 0,0x373E, + 0, 0,0x4849,0x6063, 0, 0,0x607E, 0, + 0, 0, 0, 0, 0,0x6069, 0, 0, + 0, 0, 0,0x383D, 0, 0, 0, 0, +0x3565, 0,0x6066,0x4D7D, 0, 0,0x4E30}; + +/* page 37 0x7422-0x7845 */ +static uint16 tab_uni_jisx020837[]={ +0x4276, 0, 0,0x6068, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x606A,0x4E56,0x3657,0x487C,0x474A, 0, 0, 0, +0x606B, 0, 0, 0, 0,0x606D, 0,0x6070, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x606C, 0, 0, 0,0x606F, +0x386A,0x314D,0x6071, 0,0x3F70,0x606E,0x4E5C, 0, + 0,0x6074,0x7424, 0, 0, 0, 0,0x6072, +0x6075, 0, 0, 0, 0,0x6067,0x6073, 0, + 0,0x3A3C, 0, 0,0x6076, 0, 0, 0, + 0, 0, 0, 0,0x6077, 0, 0, 0, + 0,0x4D7E, 0, 0, 0, 0, 0, 0, + 0,0x6078, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6079, 0, 0, 0, +0x6065, 0, 0, 0, 0,0x607A, 0, 0, + 0, 0, 0, 0, 0, 0,0x3444, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3C25, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x607B, 0, 0, 0, 0,0x607C, 0, 0, + 0, 0,0x607D, 0, 0, 0, 0, 0, + 0, 0,0x313B, 0, 0, 0,0x6121, 0, +0x493B,0x6122, 0, 0,0x3424,0x6123, 0,0x6124, + 0, 0, 0, 0,0x6125, 0,0x6127,0x6128, +0x6126, 0, 0, 0,0x4953,0x612A,0x6129, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x612C,0x612B,0x612D, 0, 0, 0, 0, + 0, 0,0x612E,0x6130,0x612F, 0, 0,0x3979, + 0,0x6132, 0,0x6131, 0, 0,0x3445, 0, +0x3F53, 0,0x453C, 0,0x6133,0x4038, 0, 0, + 0,0x3B3A, 0,0x3179,0x6134, 0,0x4D51, 0, + 0,0x4A63,0x6135, 0, 0, 0,0x4544,0x4D33, +0x3943,0x3F3D, 0, 0, 0,0x434B,0x5234, 0, +0x442E,0x3268,0x6136, 0, 0, 0, 0, 0, + 0, 0,0x6137, 0,0x613C, 0, 0,0x613A, +0x6139,0x5A42,0x3326,0x6138, 0,0x305A, 0,0x482A, + 0, 0,0x484A, 0, 0, 0, 0,0x4E31, +0x613D,0x613B,0x435C,0x4026, 0, 0,0x482B, 0, +0x492D, 0,0x613F,0x4E2C,0x374D,0x6140, 0,0x613E, +0x4856,0x6141, 0,0x6142, 0, 0,0x305B, 0, + 0,0x3E76,0x6147, 0,0x6144,0x466D,0x6143, 0, + 0, 0, 0, 0, 0,0x3526, 0, 0, +0x614A, 0, 0, 0,0x6145,0x6146, 0,0x6149, +0x6148,0x4925, 0, 0,0x4142,0x4141, 0,0x353F, + 0, 0,0x614B, 0, 0, 0, 0, 0, +0x614C, 0, 0,0x614D, 0, 0, 0, 0, + 0,0x614F, 0,0x614E, 0, 0, 0, 0, + 0,0x3156, 0, 0, 0, 0, 0,0x6157, +0x4868,0x6151, 0,0x6153, 0, 0,0x6155,0x3F3E, + 0, 0,0x6156,0x6154,0x3C40, 0, 0, 0, +0x6150,0x6152, 0,0x4942, 0,0x3E49, 0, 0, +0x6159, 0, 0,0x6158, 0, 0, 0, 0, +0x615A, 0,0x3C26,0x3A2F, 0, 0,0x4577,0x615B, + 0,0x444B, 0, 0,0x615D, 0, 0, 0, +0x4E21,0x615C, 0, 0, 0, 0, 0,0x4169, + 0, 0, 0, 0, 0, 0,0x6162, 0, +0x6164,0x6165,0x4354, 0, 0, 0, 0, 0, +0x6163, 0,0x6160, 0,0x615E,0x615F, 0,0x6161, + 0, 0, 0, 0, 0, 0, 0,0x6168, + 0,0x6166, 0,0x6167, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6169,0x616B,0x616C, +0x616D, 0,0x616E, 0, 0,0x616A, 0, 0, + 0, 0, 0, 0, 0, 0,0x6170, 0, + 0, 0,0x616F, 0, 0, 0, 0, 0, + 0,0x6171, 0, 0, 0, 0, 0, 0, +0x4E45, 0, 0, 0,0x6174,0x6172,0x6173, 0, + 0, 0,0x3462, 0, 0, 0, 0, 0, +0x4C7E, 0, 0, 0,0x4A4A, 0,0x6176, 0, + 0, 0,0x6175, 0, 0, 0, 0,0x6177, +0x6178, 0, 0, 0, 0,0x617C,0x6179,0x617A, +0x617B, 0,0x617D, 0, 0, 0,0x617E, 0, +0x6221, 0, 0, 0,0x6222, 0,0x6223, 0, +0x482F,0x4550,0x6224,0x4772,0x4934, 0,0x6225, 0, + 0,0x6226,0x452A, 0,0x3327,0x3944,0x6227, 0, + 0,0x6228, 0, 0,0x6229, 0,0x3B29, 0, + 0,0x622B, 0, 0,0x622A, 0, 0,0x622C, +0x622D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4869, 0,0x622E, 0, + 0, 0,0x622F, 0, 0,0x7369,0x6230,0x6231, +0x6232, 0, 0, 0, 0,0x3B2E, 0, 0, +0x6233,0x4756, 0, 0,0x4B5F, 0,0x314E, 0, +0x3157, 0, 0,0x6234, 0, 0, 0, 0, +0x6236, 0, 0, 0,0x6235,0x4570, 0, 0, + 0,0x4039,0x5D39, 0,0x6237,0x4C41, 0,0x6238, + 0,0x3446,0x4857,0x6239, 0,0x623A, 0, 0, +0x623B, 0, 0, 0,0x4C5C, 0, 0, 0, +0x4C55, 0,0x443E, 0, 0, 0,0x416A, 0, + 0,0x623D, 0, 0,0x3D62, 0, 0,0x3E4A, + 0, 0,0x6240, 0, 0,0x623F,0x623E,0x487D, + 0,0x3447,0x3829, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6246, 0, 0,0x6243,0x3F3F,0x4C32, 0, + 0, 0,0x6242,0x6244,0x6245, 0, 0,0x6241, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6247,0x6248, 0, +0x442F, 0,0x3463, 0, 0, 0,0x4365, 0, + 0, 0, 0, 0, 0,0x6249, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x624A,0x624D, 0, 0, 0, 0, 0,0x3F67, + 0,0x4644, 0,0x624E,0x4B53, 0,0x624B, 0, + 0,0x624C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6251, + 0, 0, 0, 0,0x6250,0x624F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6253, 0, 0,0x6252, 0, 0,0x6254, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6256, 0,0x6255, 0, + 0, 0, 0,0x4A4D, 0, 0, 0, 0, + 0, 0,0x3D56,0x4E46, 0, 0,0x6257, 0, + 0,0x4637, 0, 0,0x6258, 0, 0,0x6259, + 0,0x625D,0x625B,0x625C, 0,0x625A, 0, 0, + 0, 0, 0, 0, 0,0x625E, 0, 0, + 0, 0, 0,0x625F, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6260, 0, 0, +0x6261,0x4C37,0x6262, 0, 0, 0, 0, 0, +0x4C70,0x6263, 0,0x434E, 0,0x476A, 0,0x366B, + 0, 0, 0,0x433B,0x6264,0x363A, 0, 0, + 0,0x4050, 0, 0, 0, 0, 0, 0, + 0, 0,0x6265, 0, 0, 0, 0, 0, +0x3A3D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6266, 0, 0, 0, 0, 0, +0x6267, 0,0x3826,0x3A55, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6269, 0, + 0, 0, 0,0x4556,0x3A56,0x354E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4B24, 0,0x474B, 0, 0, 0, 0, 0, +0x4557, 0, 0, 0, 0,0x395C, 0, 0, + 0, 0, 0,0x626B}; + +/* page 38 0x785D-0x7E9C */ +static uint16 tab_uni_jisx020838[]={ +0x3E4B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4E32,0x3945, + 0, 0,0x3827, 0, 0,0x4823, 0,0x626D, + 0, 0, 0, 0, 0, 0, 0,0x626F, + 0, 0, 0, 0,0x386B, 0, 0, 0, + 0,0x626E,0x4476, 0, 0, 0, 0,0x6271, +0x3337,0x626C, 0, 0,0x486A, 0,0x3130, 0, +0x3A6C, 0,0x4F52, 0, 0,0x6270, 0, 0, + 0, 0, 0, 0, 0, 0,0x6272, 0, + 0, 0,0x4A4B, 0,0x4059,0x6274, 0, 0, + 0, 0,0x6275, 0, 0, 0, 0, 0, +0x6273, 0, 0, 0, 0,0x334E, 0,0x627B, + 0,0x627A, 0, 0,0x3C27, 0, 0, 0, +0x627C,0x6277, 0, 0, 0,0x627D,0x6278, 0, + 0, 0, 0,0x4858,0x6276, 0, 0,0x6279, + 0, 0, 0, 0, 0,0x6322, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6321,0x4B61, 0, 0, 0,0x627E, + 0, 0,0x306B, 0, 0, 0, 0,0x6324, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6323, 0, 0, 0,0x3E4C, 0, 0, 0, + 0, 0,0x6325, 0, 0, 0, 0, 0, + 0,0x4143, 0, 0,0x6327,0x6326, 0, 0, + 0, 0, 0, 0,0x6328, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6268, 0, 0, 0,0x626A,0x632A,0x6329, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C28, 0,0x4E69, + 0,0x3C52, 0,0x632B,0x3737, 0, 0, 0, + 0, 0,0x3540,0x3527,0x3B63, 0, 0, 0, + 0, 0, 0,0x4D34, 0, 0,0x6331, 0, +0x6330,0x4144,0x632D, 0, 0,0x632F, 0, 0, +0x3D4B,0x3F40,0x632E,0x632C, 0,0x472A, 0, 0, +0x3E4D, 0, 0,0x493C, 0, 0, 0, 0, +0x3A57, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4578, 0, 0,0x6332, 0, 0, + 0, 0,0x6333,0x6349,0x3658, 0, 0,0x4F3D, +0x4135, 0, 0, 0, 0,0x6334, 0, 0, +0x3252,0x4477,0x4A21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6335, 0, 0, 0, 0, 0, 0, 0, + 0,0x357A,0x6336, 0, 0,0x6338, 0, 0, + 0,0x6339, 0,0x4729, 0, 0,0x633A, 0, + 0, 0, 0, 0,0x633B,0x633C, 0, 0, +0x3659,0x3253,0x4645,0x3D28,0x3B64, 0, 0, 0, + 0, 0, 0, 0,0x633D, 0,0x3D29, 0, + 0, 0, 0, 0,0x324A,0x4943, 0, 0, +0x633E, 0, 0,0x486B, 0, 0, 0, 0, + 0, 0,0x4145, 0,0x6341, 0,0x6342,0x4769, + 0,0x3F41,0x633F, 0,0x4361, 0, 0,0x6340, + 0, 0, 0,0x3E4E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x305C, 0, + 0, 0, 0,0x3529, 0, 0, 0, 0, + 0, 0, 0,0x6343, 0, 0,0x4478, 0, +0x6344,0x4047, 0, 0, 0, 0, 0,0x4C2D, + 0, 0,0x4923,0x6345,0x6346,0x4355, 0,0x4E47, + 0, 0,0x6348,0x6347, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3C6F, 0, 0,0x634A,0x3070, 0, 0, + 0, 0,0x634D, 0, 0, 0,0x634B,0x3254, +0x374E,0x634C,0x3946,0x3972, 0,0x4A66,0x634E, 0, + 0,0x4B54, 0, 0,0x6350, 0, 0, 0, +0x4051,0x314F,0x323A,0x302C, 0, 0, 0, 0, + 0, 0,0x634F, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6351,0x6352,0x3E77, 0, + 0, 0, 0, 0,0x6353, 0,0x334F, 0, + 0, 0, 0,0x6355, 0, 0, 0,0x376A, + 0,0x3566, 0, 0,0x6356,0x3675, 0, 0, +0x6357, 0,0x407C, 0,0x464D, 0,0x4060,0x3A75, + 0, 0, 0,0x6358, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4362,0x416B, 0, +0x635A,0x635C,0x6359,0x635B, 0, 0, 0, 0, + 0, 0,0x3722, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x635D,0x3726, 0, 0, + 0,0x3567,0x4D52,0x635F, 0, 0, 0, 0, + 0,0x6360, 0, 0, 0,0x312E, 0, 0, + 0, 0,0x6363, 0, 0, 0,0x3376,0x6362, +0x6361, 0,0x6365,0x635E, 0,0x6366,0x4E29, 0, +0x6367, 0,0x6368, 0, 0,0x5474,0x636A, 0, +0x6369, 0, 0, 0,0x636B,0x636C, 0,0x4E35, +0x636D, 0,0x706F,0x3E4F,0x636E,0x636F,0x3D57, 0, +0x4638,0x6370, 0, 0, 0,0x4328, 0, 0, +0x6371, 0,0x433C,0x6372, 0, 0, 0, 0, + 0,0x3625, 0,0x513F,0x435D,0x3C33, 0, 0, + 0, 0,0x3448, 0, 0,0x6373, 0,0x6422, + 0,0x6376, 0,0x3568, 0,0x6375,0x6424, 0, + 0, 0,0x6374, 0,0x3E50, 0, 0, 0, + 0, 0, 0,0x6378,0x6379, 0,0x452B, 0, + 0,0x637A, 0,0x335E, 0, 0, 0, 0, +0x3F5A,0x4964, 0,0x637C, 0, 0, 0,0x4268, + 0, 0, 0, 0, 0, 0,0x6377, 0, +0x637B,0x637D, 0, 0,0x3A7B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6426,0x492E, 0,0x4826,0x4579, 0,0x365A,0x6425, +0x6423, 0,0x4835,0x637E,0x435E,0x457B, 0,0x457A, + 0,0x3A76, 0, 0, 0, 0, 0, 0, +0x6438, 0, 0, 0, 0, 0, 0, 0, +0x6428, 0,0x642A, 0, 0, 0, 0,0x642D, + 0,0x642E, 0,0x642B,0x642C, 0, 0,0x6429, +0x6427, 0, 0, 0, 0,0x6421, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4A4F,0x3255, 0, 0, 0,0x6435, 0, +0x6432, 0,0x6437, 0, 0,0x6436, 0,0x4773, +0x4C27, 0,0x3B3B,0x6430,0x6439,0x6434, 0,0x6433, +0x642F, 0,0x6431, 0,0x3449, 0, 0, 0, + 0, 0, 0, 0, 0,0x433D, 0, 0, +0x407D, 0, 0, 0,0x4822, 0, 0,0x643E, + 0, 0, 0,0x4824, 0, 0, 0, 0, + 0, 0, 0,0x4061,0x643B, 0, 0,0x484F, + 0,0x643F,0x4A53, 0,0x435B, 0,0x643A,0x643C, + 0, 0,0x643D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6440, 0, 0,0x3C44, 0, 0, 0,0x4646, +0x6445,0x6444, 0, 0,0x6441, 0, 0, 0, +0x4F36, 0, 0, 0, 0, 0,0x644A, 0, + 0,0x644E,0x644B, 0, 0, 0, 0, 0, + 0, 0, 0,0x6447, 0, 0, 0, 0, + 0, 0,0x6448, 0, 0, 0, 0, 0, +0x644D, 0, 0, 0,0x6442,0x5255,0x6449,0x6443, + 0, 0,0x644C, 0, 0, 0, 0, 0, + 0, 0,0x6452, 0,0x344A, 0,0x644F, 0, + 0, 0,0x6450, 0, 0,0x6451,0x6454, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6453,0x4876, 0, 0, 0, 0, +0x6455,0x4E7C,0x4A6D,0x645A, 0, 0,0x6457, 0, + 0, 0, 0, 0, 0, 0, 0,0x6456, +0x4052, 0,0x6459,0x645B, 0, 0, 0,0x6458, + 0,0x645F, 0,0x645C, 0, 0, 0, 0, + 0, 0,0x645D,0x6446, 0, 0, 0,0x645E, +0x6460, 0, 0, 0, 0, 0, 0,0x6461, + 0, 0, 0, 0, 0, 0,0x4A46, 0, +0x6462, 0, 0, 0, 0, 0, 0, 0, + 0,0x4C62, 0, 0,0x364E,0x3729,0x6463, 0, + 0, 0, 0, 0,0x4A34, 0,0x3F68, 0, +0x4C30, 0, 0,0x6464, 0,0x4E33, 0, 0, +0x4774, 0,0x4146,0x4734, 0, 0,0x3D4D, 0, + 0, 0,0x3040, 0,0x6469,0x6467, 0,0x6465, +0x3421, 0,0x3E51,0x646A, 0, 0,0x6468, 0, +0x6466,0x646E, 0, 0,0x646D,0x646C,0x646B, 0, + 0, 0, 0, 0,0x646F, 0, 0, 0, +0x6470,0x403A, 0,0x6471, 0,0x6473, 0, 0, +0x6472, 0, 0, 0, 0,0x3852, 0, 0, + 0,0x4138, 0, 0, 0,0x6475, 0, 0, + 0,0x457C, 0,0x6474, 0, 0, 0,0x6476, + 0,0x4A35,0x416C,0x3947, 0,0x6477, 0, 0, + 0, 0,0x4E48, 0, 0, 0, 0, 0, + 0, 0,0x6479, 0, 0,0x647A, 0,0x647B, + 0,0x647C, 0,0x3B65, 0,0x647D,0x374F, 0, + 0,0x356A, 0,0x352A, 0,0x6521, 0,0x4C73, +0x3948,0x647E, 0, 0, 0,0x6524,0x4C66, 0, +0x473C, 0, 0,0x4933, 0, 0, 0,0x3D63, +0x6523, 0,0x3C53,0x3949,0x3B66,0x3569,0x4A36,0x6522, + 0, 0, 0,0x4147,0x4B42,0x3A77, 0, 0, + 0, 0, 0, 0, 0, 0,0x3B67,0x445D, + 0,0x6527,0x4E5F,0x3A59, 0,0x6528,0x3F42, 0, +0x652A, 0, 0, 0,0x3E52,0x3A30, 0, 0, + 0, 0,0x6529, 0, 0,0x3D2A,0x383E,0x4148, +0x6525,0x652B, 0, 0, 0, 0,0x6526,0x3750, + 0,0x652E,0x6532,0x376B, 0, 0, 0, 0, + 0,0x652D, 0, 0, 0, 0,0x6536, 0, + 0,0x394A, 0, 0,0x4D6D,0x303C,0x6533, 0, + 0,0x356B, 0,0x6530, 0, 0, 0, 0, + 0,0x6531, 0, 0,0x457D,0x652F,0x652C, 0, +0x3328,0x4064, 0, 0,0x3828, 0, 0, 0, +0x6538, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6535, 0, 0, 0, + 0, 0,0x6537, 0, 0, 0,0x6534, 0, + 0, 0, 0, 0,0x3751,0x4233,0x6539,0x416E, + 0, 0,0x6546, 0, 0,0x6542,0x653C, 0, + 0, 0, 0, 0, 0, 0,0x6540,0x3C7A, +0x305D,0x653B,0x6543,0x6547,0x394B,0x4C56, 0,0x4456, +0x653D, 0, 0,0x6545, 0,0x653A,0x433E, 0, +0x653F,0x303D,0x4C4A, 0, 0, 0, 0, 0, + 0, 0,0x653E, 0, 0,0x365B,0x486C, 0, + 0, 0,0x416D, 0,0x4E50,0x3D6F, 0, 0, +0x656E, 0, 0,0x6548, 0,0x407E, 0,0x6544, +0x6549,0x654B, 0,0x4479,0x654E, 0, 0,0x654A, + 0, 0, 0,0x4A54,0x344B, 0, 0,0x4C4B, + 0, 0,0x305E, 0, 0,0x654D, 0,0x4E7D, + 0, 0, 0, 0, 0, 0,0x654C, 0, + 0, 0, 0, 0,0x316F, 0, 0,0x466C, +0x654F, 0, 0, 0,0x6556,0x6550,0x6557, 0, + 0, 0, 0, 0, 0,0x6553, 0, 0, + 0, 0, 0, 0, 0, 0,0x477B, 0, + 0,0x3C4A,0x6555, 0,0x6552,0x6558,0x6551, 0, + 0,0x3D44, 0, 0, 0, 0,0x4B25, 0, + 0,0x3D4C, 0, 0,0x6554,0x6560, 0, 0, +0x655C, 0,0x655F, 0,0x655D,0x6561,0x655B, 0, +0x6541,0x4053, 0, 0,0x484B, 0,0x655E, 0, + 0,0x6559, 0, 0, 0,0x4121,0x3752, 0, +0x3D2B, 0, 0, 0, 0, 0, 0,0x3F25, +0x4136,0x6564, 0, 0,0x6566,0x6567, 0, 0, +0x6563,0x6565, 0, 0, 0, 0, 0, 0, + 0,0x655A,0x6562, 0,0x656A,0x6569, 0, 0, +0x4B7A, 0, 0,0x372B, 0, 0, 0, 0, + 0, 0, 0, 0,0x6568, 0,0x656C,0x656B, +0x656F, 0,0x6571, 0, 0,0x3B3C,0x656D, 0, + 0, 0, 0,0x6572,0x6573, 0, 0,0x6574, + 0,0x657A,0x453B,0x6576, 0,0x6575,0x6577,0x6578, + 0,0x6579, 0, 0, 0, 0,0x657B,0x657C +}; + +/* page 39 0x7F36-0x8358 */ +static uint16 tab_uni_jisx020839[]={ +0x344C, 0,0x657D, 0,0x657E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6621, + 0, 0, 0, 0, 0, 0,0x6622,0x6623, +0x6624, 0,0x6625,0x6626, 0, 0,0x6628,0x6627, + 0, 0,0x6629, 0, 0, 0, 0, 0, + 0,0x662A,0x662B, 0, 0, 0, 0, 0, + 0,0x662E,0x662C,0x662D,0x3A61,0x3753, 0, 0, +0x4356, 0,0x4833, 0,0x3D70, 0, 0,0x474D, + 0,0x486D,0x662F,0x586D, 0, 0, 0, 0, + 0, 0, 0, 0,0x6630,0x6632, 0,0x4D65, +0x6631,0x6634,0x6633, 0,0x4D53, 0,0x6635, 0, +0x487E, 0, 0, 0, 0, 0,0x6636, 0, + 0, 0, 0, 0,0x6639, 0, 0,0x6638, +0x6637, 0, 0, 0, 0,0x663A,0x3732, 0, + 0, 0,0x4122,0x3541, 0, 0, 0, 0, +0x663E,0x663B, 0, 0,0x663C, 0, 0, 0, +0x663F, 0,0x6640,0x663D, 0, 0, 0,0x3129, + 0, 0, 0,0x3227, 0, 0, 0,0x6642, +0x6643, 0, 0, 0,0x6644, 0,0x4D62, 0, + 0, 0, 0, 0,0x3D2C, 0,0x6646,0x6645, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3F69,0x6647, 0, 0, 0, 0, +0x6648, 0, 0,0x6649, 0,0x3465, 0, 0, + 0, 0,0x344D, 0, 0,0x664A, 0, 0, + 0, 0, 0,0x664B, 0,0x4B5D,0x4D63, 0, + 0, 0,0x4D54,0x4F37, 0,0x394D,0x664E,0x3C54, +0x664D, 0, 0, 0, 0,0x664F,0x3C29, 0, + 0, 0,0x4251, 0,0x6650, 0, 0,0x394C, + 0,0x4C57,0x6651,0x6652, 0, 0,0x6653, 0, + 0, 0, 0,0x6654, 0, 0, 0, 0, + 0, 0,0x6655, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C2A, 0, 0, +0x4C6D, 0, 0, 0, 0,0x6657, 0,0x433F, + 0,0x6656, 0, 0, 0, 0, 0, 0, +0x6659, 0, 0, 0,0x6658, 0, 0, 0, + 0, 0, 0, 0,0x665A, 0, 0, 0, +0x403B, 0,0x665B, 0,0x665C, 0, 0, 0, +0x4A39,0x665D, 0,0x416F,0x665E, 0, 0, 0, + 0, 0,0x665F, 0, 0, 0, 0, 0, + 0,0x4E7E,0x6662, 0,0x6661,0x6660,0x4430, 0, +0x6663,0x3F26, 0,0x6664, 0, 0, 0,0x6665, +0x4F38,0x6666, 0, 0, 0, 0,0x6667,0x6669, +0x6668,0x4825, 0,0x4679, 0,0x4F3E,0x4829, 0, + 0, 0, 0, 0, 0,0x666B, 0, 0, +0x3E53, 0,0x492A, 0,0x666C,0x666A, 0,0x344E, + 0, 0, 0,0x3854,0x3B68, 0, 0,0x486E, + 0, 0, 0,0x382A,0x4B43, 0,0x666F,0x666D, + 0,0x394E, 0,0x394F,0x3069, 0,0x3A68, 0, + 0, 0, 0, 0,0x4759, 0, 0, 0, + 0, 0, 0, 0, 0,0x305F,0x6674, 0, +0x4340, 0, 0, 0, 0, 0,0x4758, 0, +0x425B, 0, 0, 0, 0, 0, 0, 0, +0x6676, 0, 0,0x6672,0x6675,0x6670, 0,0x6673, +0x4B26, 0, 0,0x3855, 0, 0,0x307D,0x6671, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6678, 0,0x6679, 0, 0,0x4639, 0, + 0, 0,0x363B, 0, 0, 0,0x6726,0x473D, + 0, 0, 0, 0,0x3B69, 0, 0,0x363C, +0x4048,0x4F46,0x4C2E,0x6677,0x4054, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3553,0x667A, 0, 0, + 0, 0, 0, 0, 0,0x667C, 0, 0, + 0, 0, 0,0x667B, 0, 0, 0, 0, + 0,0x667D, 0,0x4326, 0,0x473E, 0, 0, + 0, 0, 0,0x4431, 0, 0, 0, 0, +0x6723, 0, 0, 0, 0, 0, 0, 0, +0x6722, 0, 0, 0, 0,0x667E, 0, 0, +0x3F55, 0,0x4965,0x6725, 0,0x6724,0x3950,0x4F53, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6735, 0, 0, 0, 0, 0,0x6729, +0x672A, 0, 0, 0, 0,0x3C70, 0, 0, +0x6728, 0,0x3978,0x6727, 0, 0,0x672B, 0, + 0, 0,0x4432,0x4A22,0x4123, 0, 0, 0, + 0,0x425C,0x672F, 0,0x6730,0x672C, 0, 0, + 0, 0,0x672D, 0,0x672E, 0, 0, 0, + 0,0x3951, 0, 0, 0,0x6736, 0,0x6732, + 0, 0, 0, 0,0x4966, 0,0x4B6C,0x4928, + 0, 0,0x6731, 0, 0,0x6734,0x6733, 0, + 0, 0,0x4B44,0x6737, 0, 0, 0, 0, + 0, 0,0x6738, 0, 0,0x4137, 0,0x6739, + 0, 0,0x673B, 0,0x673F, 0, 0,0x673C, +0x673A,0x473F,0x673D, 0,0x673E, 0, 0, 0, +0x3232, 0,0x6745,0x6740, 0, 0, 0,0x6741, + 0, 0, 0,0x6742, 0,0x4221, 0, 0, + 0, 0,0x6744,0x6743,0x6746, 0, 0, 0, + 0,0x6747,0x6748, 0, 0,0x3F43, 0,0x3269, + 0,0x6749,0x4E57, 0,0x3C2B, 0, 0,0x3D2D, + 0, 0, 0, 0, 0,0x3B6A,0x4357, 0, + 0, 0, 0, 0,0x674A,0x674B,0x3131, 0, +0x674C, 0, 0,0x674D,0x674E, 0, 0,0x674F, + 0,0x6750,0x363D,0x5A2A,0x6751, 0,0x4065,0x6752, +0x3C4B, 0,0x6753, 0,0x5030, 0, 0, 0, +0x6754,0x4A5E,0x345C, 0, 0,0x4124,0x3D58, 0, +0x4971,0x3D2E, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6755,0x3952,0x6756,0x484C, 0, +0x6764, 0, 0, 0, 0,0x6758, 0,0x4249, +0x4775,0x383F,0x6757,0x4125, 0, 0, 0, 0, + 0, 0,0x6759, 0, 0, 0, 0, 0, + 0,0x447A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x675B,0x675A,0x675D, 0, 0,0x675C, + 0,0x675E, 0, 0,0x6760, 0,0x675F, 0, +0x344F, 0,0x6761, 0,0x6762,0x6763, 0, 0, +0x3A31,0x4E49, 0,0x6765,0x3F27, 0, 0, 0, +0x3170,0x6766,0x6767, 0, 0, 0, 0, 0, +0x6768, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3072, 0,0x6769, + 0, 0, 0, 0,0x676A, 0, 0, 0, + 0, 0, 0,0x4967, 0, 0, 0,0x3C47, + 0,0x676C, 0, 0, 0, 0, 0,0x3329, +0x3032, 0, 0, 0, 0,0x676B,0x676E,0x474E, + 0,0x3F44, 0,0x3256, 0,0x4B27, 0, 0, + 0, 0,0x375D,0x365C, 0,0x676D, 0,0x326A, + 0, 0, 0, 0, 0, 0, 0,0x3423, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3171,0x6772,0x4E6A,0x425D, 0, + 0,0x4944, 0,0x677E, 0,0x3257,0x677C, 0, +0x677A,0x6771, 0,0x676F, 0,0x6770, 0,0x3C63, +0x366C,0x4377, 0, 0, 0,0x4651, 0, 0, + 0, 0, 0,0x3151, 0,0x6774,0x6773, 0, + 0, 0, 0,0x6779,0x6775,0x6778, 0, 0, + 0, 0, 0, 0,0x4C50,0x6777,0x3258,0x337D, +0x677B, 0, 0,0x677D, 0, 0, 0, 0, +0x3754, 0, 0, 0, 0, 0, 0, 0, +0x6823,0x682C,0x682D, 0, 0, 0,0x302B, 0, + 0, 0, 0, 0, 0,0x6834, 0, 0, + 0, 0,0x3071, 0, 0,0x682B, 0, 0, + 0,0x682A, 0,0x6825,0x6824, 0,0x6822,0x6821, +0x4363, 0,0x427B,0x6827, 0, 0, 0, 0, + 0, 0,0x6826, 0, 0, 0, 0,0x6829, + 0, 0, 0,0x4170,0x3755, 0, 0, 0, + 0,0x3141,0x6828, 0,0x3953, 0, 0, 0, + 0, 0,0x4171}; + +/* page 40 0x8373-0x8B9A */ +static uint16 tab_uni_jisx020840[]={ +0x683A, 0,0x683B, 0,0x3259, 0, 0, 0, +0x322E,0x6838, 0, 0, 0, 0, 0, 0, + 0, 0,0x682E, 0,0x6836, 0,0x683D,0x6837, + 0, 0, 0,0x6835, 0, 0, 0, 0, +0x6776, 0, 0,0x6833, 0, 0, 0,0x682F, + 0, 0, 0,0x3450,0x6831,0x683C, 0,0x6832, + 0, 0, 0, 0, 0,0x683E, 0,0x6830, +0x477C, 0, 0, 0, 0, 0,0x4D69, 0, + 0, 0,0x6839, 0, 0, 0, 0, 0, + 0, 0,0x684F, 0, 0, 0,0x6847, 0, + 0, 0,0x3F7B, 0, 0, 0, 0,0x3546, + 0,0x365D, 0,0x6842, 0, 0, 0, 0, +0x325B, 0, 0,0x3E54, 0,0x6845, 0, 0, + 0,0x3A5A, 0, 0,0x4551,0x684A, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A6E, 0, +0x6841, 0, 0, 0,0x325A,0x3856,0x4929,0x684B, + 0,0x683F, 0, 0,0x6848, 0, 0, 0, +0x6852, 0,0x6843, 0, 0, 0, 0, 0, +0x6844,0x463A, 0, 0,0x6849, 0, 0, 0, +0x6846,0x4B28,0x684C,0x3060, 0, 0, 0, 0, +0x6840, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x684E, 0,0x684D, + 0, 0, 0, 0, 0, 0,0x476B,0x6854, + 0,0x685F, 0, 0, 0, 0,0x337E, 0, + 0, 0,0x6862, 0, 0,0x6850, 0, 0, + 0,0x6855,0x4D6E, 0, 0, 0, 0, 0, + 0, 0, 0,0x685E, 0, 0,0x4D55, 0, + 0, 0, 0,0x4E2A, 0, 0, 0, 0, + 0, 0, 0, 0,0x4378, 0, 0, 0, +0x336B, 0, 0, 0, 0, 0,0x4972,0x6864, +0x4621, 0, 0,0x3031, 0, 0,0x685D, 0, +0x6859,0x4172,0x6853,0x685B,0x6860, 0,0x472C, 0, + 0, 0,0x302A, 0,0x6858, 0,0x6861,0x4978, + 0, 0, 0, 0, 0, 0, 0,0x685C, + 0,0x6857, 0, 0, 0, 0, 0, 0, +0x3E55, 0, 0, 0, 0,0x3D2F, 0, 0, + 0,0x3C2C, 0, 0, 0, 0,0x4C58, 0, + 0,0x4947, 0, 0,0x6867, 0,0x6870, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x685A, 0, 0, 0, 0,0x3377, + 0, 0, 0, 0, 0,0x3E78,0x6865, 0, +0x686A,0x4173, 0, 0,0x6866, 0,0x686D, 0, + 0,0x435F, 0,0x686E, 0, 0,0x4D56,0x6863, +0x3338, 0,0x6869, 0, 0,0x686C,0x4C2C, 0, + 0, 0, 0,0x686F, 0, 0,0x6868,0x686B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4B29, 0,0x4F21, 0, 0, 0, 0, + 0,0x6873, 0, 0, 0, 0, 0, 0, + 0,0x687A, 0, 0,0x6872,0x3C43, 0, 0, + 0, 0, 0,0x6851, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A4E, 0, +0x4C22,0x6879,0x6878, 0,0x6874,0x6875, 0,0x3136, + 0, 0, 0, 0,0x6877, 0,0x6871, 0, + 0, 0, 0,0x4455, 0, 0, 0, 0, + 0,0x6876,0x307E, 0, 0, 0, 0, 0, + 0, 0,0x4222, 0, 0, 0, 0, 0, + 0, 0,0x4A43, 0, 0,0x687B,0x6921, 0, +0x4859, 0, 0, 0, 0,0x687E,0x3E56,0x3C49, +0x6923, 0, 0,0x363E, 0, 0, 0, 0, + 0, 0,0x6924, 0,0x4979,0x687D, 0,0x6856, + 0, 0, 0, 0, 0, 0, 0, 0, +0x687C, 0, 0, 0, 0,0x4F4F,0x4622,0x4973, + 0, 0,0x692B, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6931, 0, 0, 0, + 0, 0, 0,0x6932, 0,0x6925, 0, 0, + 0,0x4776, 0, 0,0x692F,0x6927, 0,0x6929, + 0, 0, 0, 0, 0,0x6933,0x6928, 0, + 0,0x692C, 0, 0,0x3172, 0,0x4665, 0, +0x692D,0x6930, 0, 0, 0, 0, 0, 0, + 0,0x6926, 0,0x4126, 0,0x692A,0x3B27,0x3F45, +0x3730,0x4C74, 0,0x4C79,0x3D72, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6937,0x6935, + 0, 0, 0, 0, 0, 0,0x4F4E, 0, + 0, 0, 0, 0, 0, 0,0x6934, 0, + 0, 0,0x4D75, 0,0x6936,0x6938, 0, 0, + 0, 0,0x6939, 0, 0, 0, 0, 0, + 0,0x693C,0x693A, 0, 0, 0, 0, 0, + 0,0x4623,0x693B, 0, 0, 0,0x484D,0x692E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3D73, 0,0x693D,0x6942, +0x4174, 0, 0,0x6941, 0, 0, 0,0x6922, + 0, 0, 0,0x6943,0x4149, 0, 0,0x693E, +0x6940, 0, 0, 0, 0, 0, 0, 0, +0x693F, 0, 0,0x5D31,0x5D22, 0, 0,0x6945, + 0, 0, 0, 0, 0, 0, 0,0x6944, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D76, 0,0x623C,0x6946, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6947, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6948,0x3857, 0,0x3554, 0, 0, + 0,0x694A,0x515D, 0, 0, 0, 0,0x3575, + 0,0x4E3A, 0,0x3673,0x694B, 0, 0, 0, + 0, 0, 0, 0,0x694C, 0, 0, 0, +0x436E, 0, 0, 0, 0, 0,0x694D, 0, + 0, 0, 0, 0, 0, 0,0x467A, 0, +0x303A, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3263, +0x6952,0x6953, 0, 0, 0, 0, 0, 0, +0x694E, 0,0x3B3D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x694F,0x4742, 0, 0, 0, 0,0x6950,0x6951, +0x695B, 0, 0, 0,0x6955,0x6958, 0, 0, + 0, 0, 0,0x6954, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6956, 0,0x6957,0x3C58, 0,0x6959, 0, +0x4341, 0,0x3756,0x3342, 0, 0, 0, 0, + 0,0x695C, 0, 0, 0, 0,0x333F, 0, +0x6961, 0, 0,0x695D,0x6960, 0, 0, 0, + 0,0x483A, 0, 0, 0, 0,0x695E, 0, + 0,0x695F,0x4948,0x485A,0x6962, 0, 0, 0, + 0, 0, 0, 0, 0,0x427D,0x696C, 0, +0x6968, 0, 0,0x326B, 0,0x6966, 0,0x4B2A, +0x6967, 0, 0,0x6964, 0,0x6965,0x696A,0x696D, + 0, 0,0x696B, 0, 0, 0,0x6969,0x6963, + 0, 0, 0, 0, 0,0x4358, 0,0x6974, + 0,0x4C2A, 0, 0, 0, 0, 0, 0, + 0, 0,0x6972, 0, 0, 0,0x6973, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x696E, 0, 0,0x6970, 0, 0, 0, +0x6971, 0, 0, 0,0x696F, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4066, 0, +0x4F39,0x6978, 0,0x6979, 0, 0, 0, 0, +0x6A21, 0,0x3F2A, 0,0x697B, 0,0x697E, 0, + 0, 0, 0, 0,0x6976,0x6975, 0, 0, +0x6A22, 0, 0,0x325C, 0,0x697C, 0,0x6A23, + 0, 0, 0,0x697D, 0, 0, 0, 0, + 0,0x697A, 0,0x4433, 0,0x6977, 0, 0, + 0, 0, 0, 0,0x4768, 0, 0,0x6A27, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D3B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6A26, 0, 0,0x6A25, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6A2E, 0, 0, 0,0x6A28, 0, 0, 0, +0x6A30, 0, 0, 0, 0, 0, 0,0x4D66, +0x6A33, 0,0x6A2A, 0, 0,0x6A2B, 0, 0, + 0,0x6A2F, 0,0x6A32,0x6A31, 0, 0, 0, +0x6A29, 0, 0, 0, 0,0x6A2C, 0,0x6A3D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6A36, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6A34, 0, 0,0x6A35, + 0, 0, 0,0x6A3A,0x6A3B, 0,0x332A, 0, +0x3542, 0, 0,0x6A39, 0, 0, 0, 0, + 0, 0,0x6A24, 0, 0, 0, 0, 0, + 0, 0,0x6A38,0x6A3C,0x6A37, 0,0x6A3E, 0, + 0, 0,0x6A40,0x6A3F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A42,0x6A41, +0x695A, 0, 0, 0,0x6A46, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A43, 0, + 0, 0, 0,0x6A44, 0, 0,0x6A45, 0, +0x6A47, 0, 0, 0, 0,0x376C, 0,0x6A49, + 0,0x6A48, 0,0x3D30, 0, 0, 0, 0, + 0,0x3954,0x5E27, 0, 0, 0, 0,0x6A4A, +0x3D51, 0, 0, 0,0x3339, 0,0x6A4B, 0, +0x3152, 0,0x3E57,0x6A4C, 0, 0,0x3955,0x6A4D, +0x3061, 0, 0, 0, 0,0x493D, 0, 0, +0x6A4E, 0, 0, 0, 0,0x3F6A, 0,0x6A55, + 0, 0,0x6A52, 0,0x436F, 0, 0, 0, + 0, 0,0x6A53,0x6A50,0x365E, 0,0x6A4F,0x6A56, + 0, 0, 0, 0, 0,0x3736, 0, 0, +0x425E, 0,0x6A5C, 0, 0, 0, 0,0x6A58, + 0, 0, 0,0x4235,0x6A57, 0,0x6A5A, 0, + 0, 0, 0,0x6A51, 0, 0, 0,0x6A5B, + 0,0x6A5D, 0, 0, 0, 0, 0, 0, +0x486F, 0, 0,0x6A59, 0,0x6A5E,0x6A60, 0, + 0,0x3853,0x6A54, 0,0x3041, 0, 0, 0, + 0, 0, 0, 0,0x6A5F, 0,0x3A5B,0x4E76, +0x6A61,0x6A62,0x4175, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4E22, 0, 0, 0, + 0,0x6A63,0x4D35, 0, 0,0x6A64,0x6A65, 0, + 0,0x4A64,0x6A66, 0,0x3A40, 0,0x4E23, 0, + 0, 0, 0, 0, 0,0x6A6B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6A6C, +0x3E58,0x6A6A, 0, 0, 0,0x4D67,0x6A67, 0, + 0,0x6A69,0x403D,0x3F7E, 0, 0, 0,0x6A68, + 0,0x6A6D, 0, 0,0x4A23, 0, 0,0x6A6F, + 0,0x6A6E, 0, 0, 0,0x336C, 0,0x4B2B, +0x6A70, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6A7C,0x6A72, 0, 0, 0, 0, + 0, 0,0x6A73, 0, 0, 0, 0,0x6A74, +0x6A75, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6A79, 0,0x6A7A, 0, 0, +0x6A78, 0, 0, 0, 0, 0,0x6A76, 0, +0x6A71,0x6A77, 0, 0, 0, 0, 0, 0, + 0,0x6A7B,0x7037, 0, 0, 0, 0, 0, + 0, 0, 0,0x3228, 0, 0, 0, 0, + 0, 0, 0,0x6A7E,0x365F,0x6A7D, 0, 0, + 0,0x6B22, 0,0x6B21, 0, 0, 0,0x6B24, + 0, 0,0x6B23, 0,0x6B25, 0, 0,0x3D31, + 0,0x6B26, 0, 0,0x6B27, 0, 0, 0, + 0, 0, 0,0x6B28,0x403E, 0,0x4D57, 0, +0x6B29, 0, 0,0x4A24,0x4746,0x6B2A, 0,0x6B2B, +0x382B, 0, 0, 0,0x352C, 0, 0, 0, +0x6B2C, 0, 0,0x3B6B,0x4741,0x6B2D, 0,0x3350, + 0, 0, 0, 0, 0, 0,0x6B2E, 0, + 0, 0, 0,0x6B30,0x4D77, 0,0x6B2F,0x3F46, + 0,0x6B31, 0, 0,0x6B32, 0, 0,0x6B33, +0x3451, 0, 0, 0, 0, 0, 0,0x6B34, + 0, 0,0x6B35, 0,0x6B36,0x6B37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3351, + 0, 0, 0, 0, 0, 0, 0,0x6B38, + 0,0x6B39,0x6B3A, 0, 0, 0, 0, 0, +0x3272, 0, 0,0x3F28,0x6B3B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B3C, 0, 0, 0,0x6B3D, 0, 0, + 0, 0, 0, 0, 0,0x3840, 0,0x447B, +0x6B3E, 0, 0, 0, 0,0x3757, 0,0x3F56, + 0,0x6B41, 0,0x4624, 0,0x6B40, 0, 0, +0x3731, 0, 0,0x6B3F,0x4277,0x352D, 0, 0, +0x6B42, 0,0x6B43, 0,0x3E59, 0, 0, 0, +0x376D, 0,0x6B44, 0, 0, 0, 0,0x4B2C, + 0, 0,0x405F, 0, 0, 0,0x3576, 0, +0x4C75,0x414A, 0,0x6B45, 0, 0, 0,0x3F47, +0x4370,0x3E5A, 0, 0, 0, 0,0x6B46, 0, + 0, 0, 0,0x6B49, 0,0x6B4A, 0, 0, + 0, 0, 0, 0, 0,0x3A3E,0x4242,0x6B48, + 0,0x3E5B,0x493E, 0, 0, 0, 0, 0, +0x6B47, 0, 0,0x3B6C, 0,0x3153, 0,0x6B4E, +0x3758, 0, 0,0x3B6E, 0, 0,0x3B6D, 0, +0x4F4D,0x6B4D,0x6B4C,0x4127, 0,0x354D,0x4F43,0x333A, +0x3E5C, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B4B, 0, 0, 0, 0, 0,0x6B50, + 0,0x6B51,0x6B4F, 0,0x3858, 0,0x4D40, 0, + 0,0x3B6F,0x4727, 0, 0, 0,0x6B54, 0, +0x4040, 0,0x4342, 0, 0,0x4D36, 0,0x6B57, + 0, 0, 0,0x386C, 0,0x403F,0x6B53, 0, +0x6B58,0x386D,0x6B55,0x6B56, 0,0x6B52, 0, 0, + 0,0x4062,0x4649, 0, 0,0x432F, 0,0x325D, + 0, 0, 0, 0, 0, 0,0x4870, 0, + 0,0x3543, 0, 0,0x4434, 0, 0,0x6B5B, + 0,0x6B59, 0, 0,0x434C, 0, 0, 0, +0x4041,0x3452,0x6B5A, 0,0x3F5B, 0, 0,0x4E4A, + 0, 0, 0,0x4F40, 0, 0, 0,0x6B5C, +0x6B67,0x4435, 0,0x6B66, 0,0x6B63,0x6B6B,0x6B64, + 0,0x6B60, 0,0x447C,0x6B5F, 0, 0, 0, +0x6B5D, 0,0x4D21,0x3B70, 0, 0,0x6B61, 0, +0x6B5E, 0, 0, 0,0x6B65,0x3D74, 0,0x3841, + 0, 0, 0,0x427A, 0,0x4B45,0x315A,0x3062, + 0,0x4625, 0, 0,0x6B69, 0, 0, 0, + 0,0x6B68, 0,0x4666, 0,0x6B6D, 0, 0, + 0,0x6B62, 0,0x6B6C,0x6B6E, 0,0x382C,0x6B6A, +0x3956, 0,0x3C55, 0, 0,0x6B6F,0x4D58, 0, + 0, 0, 0,0x6B72, 0,0x6B75, 0, 0, +0x6B73,0x4935, 0, 0, 0, 0, 0, 0, +0x6B70, 0, 0, 0, 0, 0,0x3660, 0, + 0, 0, 0,0x6B74, 0, 0,0x6B76, 0, + 0, 0, 0, 0, 0, 0,0x6B7A, 0, + 0,0x6B77, 0,0x6B79,0x6B78, 0, 0, 0, + 0, 0, 0,0x6B7B, 0,0x3C31, 0,0x6B7D, +0x6B7C,0x4968, 0, 0,0x6C21, 0, 0, 0, + 0, 0, 0,0x3759, 0, 0, 0, 0, +0x6B7E,0x6C22, 0, 0,0x6C23,0x3544,0x6641,0x3E79, + 0,0x6C24, 0, 0,0x386E, 0, 0, 0, + 0, 0,0x6C25, 0, 0,0x6C26, 0, 0, +0x3B3E, 0, 0, 0, 0, 0, 0,0x5A4E, + 0,0x6C27, 0,0x6C28, 0,0x3D32, 0,0x6C29, +0x6C2A, 0, 0,0x6C2B, 0, 0,0x6C2C,0x6C2D +}; + +/* page 41 0x8C37-0x8D16 */ +static uint16 tab_uni_jisx020841[]={ +0x432B, 0, 0,0x6C2E, 0, 0, 0, 0, +0x6C30, 0,0x6C2F, 0, 0, 0, 0,0x4626, + 0,0x6C31, 0,0x4B2D, 0,0x6C32, 0,0x6C33, + 0,0x6C34, 0, 0, 0, 0,0x6C35, 0, + 0, 0, 0,0x465A, 0, 0, 0, 0, + 0, 0,0x3E5D,0x6C36, 0, 0, 0, 0, + 0, 0, 0,0x396B,0x502E,0x6C37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C38,0x493F,0x6C39, 0,0x6C41, 0, 0, + 0, 0, 0,0x6C3A, 0, 0,0x6C3C, 0, + 0, 0,0x6C3B,0x6C3D, 0,0x4B46,0x6C3E,0x6C3F, + 0, 0, 0, 0, 0,0x6C40, 0, 0, + 0,0x6C42, 0, 0, 0, 0,0x332D,0x4467, + 0,0x4969,0x3A62,0x3957, 0, 0, 0, 0, +0x494F,0x325F,0x484E,0x6C45,0x3453,0x4055,0x6C44,0x6C49, +0x4379,0x4C63, 0,0x6C47,0x6C48,0x352E, 0,0x6C4A, +0x4763,0x425F, 0, 0,0x4871,0x453D,0x6C46, 0, +0x4B47,0x326C,0x6C4C,0x4F28,0x4442,0x4F45, 0, 0, +0x3B71,0x6C4B, 0,0x4231, 0, 0,0x6C5C,0x4128, + 0, 0,0x4678, 0,0x4950, 0, 0, 0, + 0, 0, 0,0x6C4F,0x3B3F,0x3B72, 0,0x3E5E, + 0,0x4765, 0,0x382D,0x6C4E,0x6C4D, 0,0x496A, + 0, 0, 0,0x3C41, 0, 0,0x4552, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C51,0x6C52,0x3958,0x6C50, 0, + 0, 0, 0, 0, 0,0x6C53,0x6C54, 0, +0x6C56,0x4223, 0,0x6C55,0x3466, 0,0x6C58, 0, +0x6C57,0x6C59, 0, 0,0x6C5B,0x6C5D, 0,0x6C5E +}; + +/* page 42 0x8D64-0x8F64 */ +static uint16 tab_uni_jisx020842[]={ +0x4056, 0,0x3C4F,0x6C5F, 0, 0, 0,0x3352, + 0,0x6C60, 0, 0,0x4176,0x6C61, 0,0x6C62, +0x496B, 0, 0,0x352F, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C63, 0, 0, + 0,0x4436, 0, 0, 0, 0,0x315B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C64, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C71, + 0, 0, 0, 0,0x3F76, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x422D, + 0, 0, 0, 0, 0, 0,0x6C67, 0, + 0, 0,0x6C66, 0, 0, 0,0x6C65, 0, + 0, 0, 0, 0, 0, 0, 0,0x6C6D, +0x6C6B, 0, 0,0x6C68, 0, 0, 0, 0, + 0, 0,0x6C6A, 0, 0, 0,0x6C69,0x6C6C, + 0,0x3577, 0,0x6C70, 0,0x4057, 0,0x6C71, + 0, 0, 0, 0,0x3859, 0,0x6C6E,0x6C6F, + 0, 0, 0,0x4F29, 0, 0, 0,0x4437, + 0,0x4129, 0, 0, 0, 0, 0, 0, +0x6C72, 0, 0,0x6C75, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C73,0x6C74,0x4D59, 0, + 0, 0, 0,0x4627,0x6C78, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C76,0x6C77,0x6C79, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D29, 0, + 0, 0, 0, 0,0x6C7C, 0, 0, 0, +0x6C7D,0x6C7B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6C7A, 0, +0x447D, 0, 0,0x6D21,0x6D25,0x6D22,0x6C7E, 0, +0x6D23, 0, 0, 0,0x6D24, 0, 0, 0, + 0,0x6D2B, 0, 0, 0,0x6D26, 0, 0, + 0, 0, 0,0x4058,0x6D28, 0, 0,0x6D2A, +0x6D27, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D2D, 0, +0x3D33, 0,0x6D2C, 0, 0, 0, 0, 0, +0x6D2E, 0, 0, 0, 0,0x6D2F, 0, 0, +0x6D32,0x6D31, 0,0x6D30, 0, 0,0x6D34,0x6D33, + 0,0x4C76, 0, 0, 0,0x6D36, 0,0x6D35, +0x6D37, 0, 0, 0, 0,0x6D38, 0, 0, + 0, 0, 0, 0, 0,0x6D3A, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D39,0x3F48, +0x6D3B, 0, 0,0x366D,0x6D3C,0x6D3E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6D3F, 0, 0, 0, 0, 0, + 0,0x6D40,0x6D3D, 0,0x6D41, 0,0x3C56,0x6D42, +0x3530,0x3733, 0, 0, 0, 0,0x382E, 0, + 0, 0, 0, 0, 0, 0, 0,0x6D43, + 0, 0, 0,0x4670, 0, 0,0x453E,0x6D44, + 0, 0, 0, 0, 0, 0, 0,0x6D47, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3C34, 0, 0,0x6D46, +0x6D45,0x375A,0x6D48, 0, 0, 0, 0,0x3353, + 0,0x6D4A, 0, 0, 0,0x3A5C,0x6D49, 0, +0x6D52, 0, 0, 0, 0, 0,0x6D4C,0x6D4E, +0x4A65,0x6D4B, 0, 0, 0,0x6D4D, 0,0x6D51, +0x6D4F,0x3531, 0,0x6D50, 0, 0, 0, 0, + 0, 0,0x6D53, 0, 0,0x475A,0x4E58, 0, + 0, 0, 0,0x3D34, 0, 0, 0,0x6D54, + 0, 0, 0, 0,0x4D22,0x6D56, 0,0x6D55, + 0, 0,0x6D59,0x4D41, 0, 0,0x6D58, 0, +0x336D,0x6D57,0x6D5C, 0, 0,0x6D5B, 0, 0, +0x6D5A,0x4532,0x6D5D, 0, 0, 0, 0, 0, + 0, 0, 0,0x6D5E, 0, 0, 0, 0, +0x6D5F, 0, 0,0x396C, 0,0x3725,0x6D60,0x6D61, +0x6D62}; + +/* page 43 0x8F9B-0x9132 */ +static uint16 tab_uni_jisx020843[]={ +0x3F49,0x6D63, 0,0x3C2D,0x6D64, 0, 0, 0, +0x6D65, 0, 0, 0,0x5221,0x517E, 0, 0, + 0, 0,0x6D66,0x6570,0x6D67,0x4324,0x3F2B,0x4740, + 0, 0, 0, 0,0x6D68, 0, 0,0x4A55, +0x4454,0x397E, 0, 0,0x4329, 0, 0,0x312A, + 0,0x4B78,0x3F57, 0, 0, 0, 0, 0, + 0, 0, 0,0x375E, 0, 0,0x3661, 0, + 0,0x4A56, 0, 0, 0, 0, 0,0x6D69, + 0, 0, 0, 0, 0, 0, 0,0x6D6B, + 0, 0,0x6D6A,0x3260, 0, 0,0x4676,0x6D6C, +0x4777, 0,0x4533, 0,0x6D6D,0x3D52, 0, 0, + 0,0x6D6F, 0, 0,0x4C42,0x6D7E,0x6D71,0x6D72, + 0, 0,0x4449, 0, 0,0x4260,0x4177, 0, +0x4628, 0,0x6D70,0x3555, 0, 0, 0, 0, +0x6D79, 0,0x6D76,0x6E25,0x4629,0x4360,0x6D73, 0, +0x447E,0x4553,0x6D74,0x6D78,0x3F60, 0,0x4767,0x444C, + 0, 0,0x4042,0x6D77,0x422E,0x4224,0x6D75,0x3029, +0x4F22, 0, 0, 0,0x6D7A, 0, 0, 0, + 0, 0, 0,0x4261, 0, 0,0x3D35,0x3F4A, + 0, 0,0x6D7C,0x6D7B, 0,0x306F,0x6D7D, 0, + 0,0x492F, 0,0x6E27, 0, 0,0x465B,0x3F6B, + 0, 0,0x4359, 0,0x3678, 0,0x6E26,0x4D37, +0x313F, 0,0x4A57,0x3261,0x6E21,0x6E22,0x6E23,0x6E24, +0x463B,0x4323,0x3063,0x6E28, 0,0x6E29,0x7423, 0, + 0,0x423D, 0,0x6E2A, 0,0x3173,0x414C, 0, +0x382F, 0,0x4D5A, 0, 0,0x6E2B,0x452C, 0, + 0, 0,0x4178,0x3C57,0x6E2C, 0, 0,0x6E2F, + 0, 0,0x3D65,0x6E2D,0x412B,0x412A, 0,0x3064, + 0,0x4E4B,0x6E31, 0,0x4872,0x6E33,0x6E32,0x6E30, +0x6364,0x3454, 0, 0,0x6D6E, 0,0x6E35,0x6E34, + 0, 0, 0, 0,0x6E36, 0,0x4D38, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4661, 0, 0,0x4B2E, 0,0x6E37, 0,0x3C59, + 0, 0, 0, 0,0x6E38, 0,0x6E39, 0, + 0, 0,0x6E3A, 0, 0,0x4521, 0, 0, + 0, 0, 0, 0, 0, 0,0x306A, 0, + 0, 0, 0, 0, 0, 0, 0,0x3959, + 0, 0, 0,0x4F3A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E3E, 0, 0, 0, 0, 0,0x3734,0x6E3B, + 0,0x6E3C, 0, 0, 0,0x4974, 0, 0, + 0, 0,0x3354, 0, 0, 0, 0, 0, + 0, 0,0x4D39, 0,0x363F, 0, 0, 0, + 0, 0,0x4554, 0, 0, 0, 0,0x6E3F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6E40, + 0, 0, 0, 0, 0, 0,0x6E41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4522, 0, 0,0x6E43, 0,0x6E42 +}; + +/* page 44 0x9149-0x92B9 */ +static uint16 tab_uni_jisx020844[]={ +0x4653,0x6E44,0x3D36,0x3C60,0x475B,0x4371, 0, 0, + 0,0x3C72, 0,0x3F6C, 0,0x6E45, 0,0x6E46, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3F5D,0x6E47, 0,0x6E48, 0, 0, 0, +0x6E49,0x4D6F, 0,0x3D37, 0, 0, 0, 0, + 0,0x6E4B,0x6E4A, 0,0x395A, 0,0x3973,0x3B40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6E4E, 0, 0, 0, 0,0x3D66, 0, +0x6E4D, 0,0x6E4C, 0,0x4269, 0, 0,0x386F, + 0,0x4043, 0, 0, 0, 0,0x4830, 0, + 0, 0, 0,0x3D39, 0, 0, 0, 0, + 0,0x6E4F, 0,0x3E5F, 0, 0, 0, 0, + 0,0x6E52,0x6E50, 0, 0, 0,0x6E51, 0, + 0, 0, 0,0x6E54,0x6E53, 0, 0,0x3E7A, + 0,0x6E55, 0, 0, 0, 0, 0,0x6E56, +0x6E57, 0, 0, 0, 0,0x4850,0x3A53,0x3C61, +0x6E58, 0,0x6E59,0x4E24,0x3D45,0x4C6E,0x4E4C,0x6E5A, +0x3662, 0, 0, 0, 0,0x6E5B, 0,0x4523, + 0, 0,0x6E5E,0x3378,0x3F4B, 0,0x6E5C, 0, +0x6E5D, 0,0x4460, 0, 0,0x4B55,0x367C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6E60,0x6E61, 0, 0, + 0, 0, 0,0x6E5F, 0, 0,0x6E63, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x465F,0x3343, 0, 0, +0x6E67, 0, 0,0x6E64,0x6E66, 0, 0, 0, + 0, 0, 0, 0, 0,0x6E62, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6F4F, 0, 0,0x6E65, 0, 0, 0, 0, + 0, 0, 0,0x4E6B, 0, 0,0x385A, 0, + 0, 0, 0, 0, 0, 0,0x6E6F, 0, + 0, 0, 0,0x4534,0x6E6A, 0, 0,0x6E6D, +0x6E6B, 0,0x6E70, 0, 0, 0, 0,0x6E71, + 0, 0, 0, 0, 0, 0,0x6E69, 0, + 0,0x6E76,0x3174, 0, 0,0x6E68, 0, 0, + 0,0x482D, 0,0x6E6C, 0,0x3E60, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x395B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4B48, 0,0x3664, + 0, 0,0x3D46, 0,0x463C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x412D, 0,0x6E74, 0,0x6E6E,0x6E73, 0,0x4C43, + 0,0x4438,0x6E75,0x6E72, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x412C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6E79, 0, +0x6E78}; + +/* page 45 0x92CF-0x93E8 */ +static uint16 tab_uni_jisx020845[]={ +0x6E77, 0, 0,0x4B2F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3D7B, 0, 0, + 0, 0,0x6E7A,0x4A5F, 0, 0,0x3154, 0, + 0, 0, 0,0x4946,0x4372, 0, 0, 0, + 0,0x3578, 0,0x6E7C, 0,0x395D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3B2C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E7B,0x3F6D, 0, 0, 0, 0, 0, 0, + 0,0x3F6E,0x6F21,0x6F23, 0, 0, 0, 0, + 0,0x3E7B, 0,0x6F22,0x6F24, 0, 0,0x3653, + 0,0x4945, 0, 0,0x3C62,0x4F23, 0,0x6E7E, +0x3A78, 0, 0,0x4F3F, 0, 0,0x6F26, 0, + 0, 0, 0,0x6F25,0x6F27, 0, 0, 0, + 0, 0, 0, 0, 0,0x6E7D, 0, 0, + 0, 0, 0, 0,0x4669, 0,0x4555, 0, + 0, 0, 0, 0, 0,0x4457, 0,0x6F2C, + 0, 0, 0, 0,0x4343,0x6F28, 0, 0, + 0,0x6F29, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x372D, 0,0x6F2B, + 0, 0, 0, 0, 0, 0,0x3830, 0, + 0, 0, 0, 0, 0,0x6F2A, 0,0x3E61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3379, 0, 0, + 0, 0, 0, 0, 0,0x6F30, 0,0x3A3F, +0x4179, 0, 0,0x444A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x333B, 0, 0, 0, 0,0x6F2E,0x6F2F,0x4443, + 0,0x6F2D, 0, 0, 0, 0, 0, 0, + 0, 0,0x6F31, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6F37, 0, 0, 0, + 0,0x6F3A, 0, 0, 0, 0, 0, 0, + 0,0x6F39,0x452D, 0, 0, 0, 0,0x6F32, +0x6F33,0x6F36, 0, 0, 0, 0,0x6F38, 0, + 0, 0,0x3640, 0, 0,0x6F3B,0x6F35, 0, + 0,0x6F34}; + +/* page 46 0x9403-0x9481 */ +static uint16 tab_uni_jisx020846[]={ +0x6F3F, 0, 0, 0,0x6F40, 0, 0, 0, + 0, 0, 0, 0, 0,0x6F41, 0, 0, +0x6F3E,0x6F3D, 0, 0, 0,0x3E62,0x462A,0x6F3C, + 0, 0, 0, 0, 0, 0,0x6F45, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6F43, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6F44,0x6F42, 0,0x4278, 0,0x6F46, + 0, 0, 0, 0, 0, 0,0x6F47, 0, + 0,0x6F49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3455,0x6F48, +0x4C7A, 0, 0, 0, 0, 0, 0,0x6F54, +0x6F4A, 0, 0,0x6F4D, 0,0x6F4B, 0,0x6F4C, + 0, 0, 0, 0, 0, 0, 0,0x6F4E, + 0, 0, 0, 0, 0,0x6F50, 0, 0, + 0, 0,0x6F51, 0,0x6F52, 0, 0, 0, + 0,0x6F55,0x6F53,0x6F56,0x6F58, 0,0x6F57}; + +/* page 47 0x9577-0x95E5 */ +static uint16 tab_uni_jisx020847[]={ +0x4439, 0, 0, 0, 0, 0, 0, 0, + 0,0x4C67, 0,0x6F59,0x412E, 0, 0, 0, +0x6F5A, 0,0x4A44,0x6F5B,0x332B, 0, 0, 0, +0x313C, 0,0x3457, 0,0x3456,0x6F5C, 0,0x6F5D, + 0,0x6F5E,0x6F5F, 0, 0, 0, 0, 0, + 0,0x6F60, 0,0x3458,0x3355,0x395E,0x4836, 0, +0x6F62,0x6F61, 0, 0, 0, 0,0x6F63, 0, + 0, 0, 0,0x315C, 0, 0, 0, 0, + 0, 0,0x6F66, 0,0x6F65,0x6F64, 0,0x6F67, + 0, 0, 0, 0,0x6F6A, 0, 0, 0, +0x3047, 0, 0,0x6F68, 0,0x6F6C,0x6F6B, 0, + 0, 0, 0, 0, 0,0x6F6E,0x6F6D,0x6F6F, + 0,0x462E, 0, 0, 0,0x6F70, 0, 0, + 0, 0,0x6F71,0x6F73, 0, 0,0x6F72}; + +/* page 48 0x961C-0x9874 */ +static uint16 tab_uni_jisx020848[]={ +0x496C, 0, 0, 0, 0,0x6F74, 0, 0, + 0, 0, 0, 0,0x6F75, 0,0x3A65, 0, + 0, 0,0x6F76,0x6F77, 0, 0,0x4B49, 0, + 0, 0, 0, 0, 0, 0, 0,0x414B, + 0, 0, 0,0x3024,0x424B, 0,0x6F78, 0, +0x496D, 0, 0, 0, 0, 0, 0,0x6F7B, +0x6F79,0x395F, 0,0x6F7A,0x3842, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4A45, +0x6F7D,0x7021,0x6F7E,0x7022, 0, 0,0x3121,0x3F58, +0x3D7C,0x3459,0x7023, 0, 0, 0,0x4766, 0, +0x7025, 0, 0, 0,0x3122, 0,0x7024,0x4444, + 0,0x4E4D,0x462B,0x6F7C,0x4E26, 0,0x3831, 0, + 0,0x4D5B, 0, 0, 0, 0, 0, 0, + 0,0x3679,0x4E34, 0,0x3728, 0,0x4262,0x6721, + 0,0x7026,0x332C,0x3F6F, 0, 0, 0, 0, +0x3356,0x7028, 0,0x7029,0x7027,0x3764, 0,0x3A5D, +0x3E63, 0, 0, 0,0x3123, 0, 0,0x4E59, + 0, 0, 0,0x702B,0x6E2E, 0,0x702A, 0, + 0, 0, 0, 0,0x702E,0x702C,0x702D, 0, +0x702F, 0,0x7030,0x4E6C,0x7031,0x7032, 0,0x4049, +0x483B, 0, 0, 0,0x3F7D,0x3467, 0, 0, +0x4D3A,0x326D,0x3D38,0x385B, 0,0x7035, 0,0x7034, +0x3B73,0x7036,0x7033, 0, 0,0x3B28, 0, 0, + 0,0x703A,0x6A2D, 0, 0,0x5256, 0,0x3F77, +0x7038, 0, 0, 0, 0, 0,0x4E25,0x4671, + 0, 0, 0, 0,0x312B, 0,0x4063,0x3C36, + 0, 0, 0, 0,0x4A37, 0,0x3140, 0, + 0, 0,0x4E6D,0x4D6B, 0,0x703B, 0,0x4545, + 0, 0, 0, 0,0x3C7B, 0, 0, 0, +0x703C, 0,0x703D,0x3F4C,0x703E, 0,0x4E6E, 0, + 0,0x7039,0x7040,0x7042, 0,0x7041, 0,0x703F, + 0, 0,0x7043, 0, 0,0x7044, 0, 0, +0x417A, 0,0x3262, 0, 0, 0, 0, 0, +0x7045, 0, 0,0x4C38, 0, 0,0x7046, 0, + 0, 0, 0, 0,0x7047, 0,0x4F2A, 0, + 0, 0, 0, 0,0x5B31,0x7048, 0, 0, + 0,0x7049,0x704A, 0, 0, 0,0x704E, 0, +0x704B, 0,0x704C, 0,0x704D,0x704F, 0, 0, + 0, 0, 0, 0, 0, 0,0x4044, 0, + 0, 0,0x4C77, 0, 0,0x4045, 0, 0, +0x7050, 0,0x4873, 0,0x7051,0x7353,0x4C4C, 0, +0x7052, 0,0x7053, 0,0x7054,0x3357, 0,0x7056, + 0,0x3F59, 0, 0, 0,0x7057, 0, 0, +0x3724, 0, 0, 0, 0,0x7058,0x705C, 0, +0x705A, 0, 0, 0, 0,0x705B, 0, 0, +0x3373,0x7059,0x705D, 0, 0, 0, 0,0x705E, + 0,0x3048, 0,0x705F,0x7060, 0, 0, 0, + 0, 0, 0, 0,0x3E64, 0, 0, 0, +0x7061, 0, 0, 0,0x3547, 0, 0,0x7064, + 0, 0,0x7063, 0,0x7062, 0, 0,0x6B71, + 0,0x4A5C, 0, 0, 0, 0, 0,0x7065, +0x7066, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7067, + 0, 0,0x7068, 0,0x7069, 0, 0,0x706A, + 0, 0, 0, 0, 0, 0, 0,0x345A, + 0, 0, 0, 0, 0, 0, 0, 0, +0x706B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x706C,0x4723, 0, 0, 0,0x706E,0x323B, + 0,0x7071,0x7070, 0, 0, 0, 0,0x3124, + 0, 0, 0,0x3641, 0,0x4A47,0x443A,0x3A22, + 0,0x3960,0x3D67, 0,0x3F5C, 0, 0, 0, +0x7073, 0, 0,0x7072,0x4D42,0x3468,0x4852,0x465C, + 0, 0, 0,0x3F7C,0x4E4E, 0,0x375B, 0, + 0, 0, 0, 0, 0,0x7076, 0, 0, +0x7075, 0, 0, 0, 0, 0, 0, 0, +0x4B4B,0x462C, 0, 0, 0, 0, 0, 0, +0x3150, 0, 0,0x7077,0x7074, 0, 0,0x4951, +0x4D6A,0x7078, 0, 0, 0, 0, 0, 0, + 0, 0,0x7079, 0, 0, 0, 0,0x707B, +0x426A,0x335B,0x335C,0x707A, 0, 0, 0, 0, +0x3469,0x3832, 0, 0,0x346A, 0, 0,0x453F, + 0, 0,0x4E60, 0, 0, 0, 0, 0, + 0, 0, 0,0x385C, 0, 0, 0,0x707C, + 0, 0, 0,0x707D,0x707E,0x7121, 0,0x7123, +0x7122}; + +/* page 49 0x98A8-0x98C6 */ +static uint16 tab_uni_jisx020849[]={ +0x4977, 0,0x7124, 0, 0, 0, 0,0x7125, + 0,0x7126, 0, 0, 0, 0,0x7127, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x7129,0x7128, 0,0x712A}; + +/* page 50 0x98DB-0x9957 */ +static uint16 tab_uni_jisx020850[]={ +0x4874,0x664C, 0, 0,0x3F29, 0, 0,0x3532, + 0, 0, 0, 0, 0, 0,0x712B, 0, +0x712C, 0,0x522C,0x5D3B,0x4853, 0, 0,0x307B, + 0,0x303B, 0, 0, 0, 0, 0, 0, + 0,0x3B74,0x4B30,0x3E7E, 0, 0, 0, 0, +0x712D, 0,0x4C5F, 0, 0, 0,0x712E,0x4D5C, + 0,0x3142, 0, 0, 0,0x3B41, 0,0x712F, +0x326E,0x7130, 0, 0, 0,0x7131, 0, 0, + 0, 0,0x7133,0x7134, 0,0x7136,0x7132, 0, + 0,0x7135, 0, 0, 0,0x345B, 0, 0, + 0,0x7137, 0,0x7138, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7139,0x713A, 0, 0, 0,0x713B, + 0, 0,0x713D, 0, 0, 0,0x713C, 0, +0x713F,0x7142, 0, 0, 0,0x713E,0x7140,0x7141, + 0, 0,0x7143, 0,0x3642}; + +/* page 51 0x9996-0x9A6B */ +static uint16 tab_uni_jisx020851[]={ +0x3C73,0x7144,0x7145,0x3961, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7146, + 0, 0,0x333E, 0, 0, 0,0x474F,0x7147, +0x7148, 0, 0, 0, 0,0x435A,0x466B, 0, + 0, 0, 0, 0, 0, 0,0x7149, 0, + 0, 0, 0,0x477D, 0, 0,0x424C,0x3158, +0x366E, 0,0x366F, 0, 0, 0, 0, 0, + 0, 0,0x4373,0x714E,0x3670, 0, 0,0x326F, + 0, 0,0x714D, 0, 0,0x714B, 0,0x714C, + 0,0x714A, 0, 0,0x7158, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x714F, +0x7150, 0, 0,0x7151,0x7152, 0, 0, 0, + 0, 0,0x7154, 0, 0,0x7153, 0, 0, + 0,0x3D59, 0,0x7155, 0, 0, 0,0x7157, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3533,0x7156, 0, 0,0x417B,0x3833, 0, 0, + 0, 0, 0,0x7159, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x424D, 0, 0,0x715A, 0, 0, + 0, 0,0x462D, 0, 0, 0, 0, 0, + 0,0x715B, 0, 0, 0, 0, 0, 0, +0x7160, 0,0x715E, 0,0x715D,0x715F, 0,0x715C, + 0, 0, 0, 0, 0, 0, 0,0x7162, + 0, 0, 0, 0, 0, 0, 0,0x7161, + 0,0x7164, 0, 0,0x3643,0x7163, 0, 0, + 0,0x7165, 0, 0,0x7166, 0,0x7168,0x7167, + 0, 0, 0,0x7169,0x716B,0x716A}; + +/* page 52 0x9AA8-0x9B5A */ +static uint16 tab_uni_jisx020852[]={ +0x397C, 0, 0, 0, 0,0x716C, 0, 0, +0x716D, 0, 0, 0, 0, 0, 0, 0, +0x333C, 0, 0, 0,0x716E, 0, 0, 0, +0x716F, 0, 0, 0,0x3F71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7170, + 0,0x7171, 0,0x7172,0x7173, 0, 0, 0, +0x3962, 0, 0, 0, 0, 0,0x7174,0x7175, + 0, 0,0x7176,0x7177, 0, 0,0x7178, 0, + 0, 0,0x4831,0x717A, 0,0x4926,0x717B,0x7179, + 0,0x717D, 0, 0,0x717C, 0, 0,0x717E, + 0, 0, 0,0x7221, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7222, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7223, 0,0x7224, 0, 0, 0, 0,0x7225, + 0, 0,0x7226,0x7227, 0,0x7228, 0,0x7229, +0x722A,0x722B,0x722C, 0, 0, 0,0x722D,0x722E, + 0,0x5D35,0x722F, 0, 0, 0, 0, 0, + 0, 0, 0,0x6478,0x3534, 0, 0, 0, + 0,0x3321,0x3A32,0x7231,0x7230,0x4C25, 0, 0, + 0, 0, 0, 0, 0,0x7233,0x7234,0x7232, + 0,0x7235, 0, 0,0x4B62, 0, 0, 0, +0x7236, 0,0x357B}; + +/* page 53 0x9B6F-0x9C78 */ +static uint16 tab_uni_jisx020853[]={ +0x4F25, 0, 0, 0, 0,0x7237, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x7239, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x303E, + 0, 0,0x723A,0x4A2B,0x7238, 0, 0,0x723B, +0x723C, 0, 0, 0, 0, 0, 0, 0, +0x723D,0x723E, 0, 0, 0, 0, 0, 0, + 0,0x723F, 0,0x4B6E,0x3B2D, 0,0x3A7A,0x412F, + 0, 0, 0, 0, 0,0x7240, 0, 0, + 0, 0,0x7243, 0, 0, 0, 0, 0, + 0,0x7241, 0, 0, 0, 0, 0,0x7244, + 0, 0,0x3871,0x7242, 0, 0, 0, 0, +0x7245, 0,0x7246,0x7247, 0,0x724B, 0,0x3B2A, + 0, 0, 0, 0,0x4264, 0, 0, 0, + 0, 0,0x724C,0x7249,0x7248,0x724A, 0, 0, + 0,0x375F, 0, 0, 0, 0, 0, 0, + 0,0x7250,0x724F,0x724E, 0, 0,0x3033, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x725A, 0,0x7256, + 0,0x7257,0x7253,0x7259, 0,0x7255,0x3362, 0, + 0,0x4F4C, 0,0x7258,0x7254,0x7252,0x7251, 0, + 0, 0, 0, 0,0x725C, 0, 0, 0, + 0, 0,0x725F, 0, 0,0x725E,0x725D, 0, + 0, 0, 0, 0, 0, 0,0x4949,0x725B, +0x3073,0x7260, 0,0x7262, 0, 0, 0, 0, + 0, 0,0x336F,0x724D,0x3137, 0, 0,0x7264, + 0, 0, 0, 0, 0, 0, 0,0x7263, +0x7261,0x432D, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4B70, 0, 0, 0, 0, +0x4E5A, 0, 0,0x7265, 0, 0, 0, 0, + 0,0x7266, 0, 0, 0, 0, 0, 0, +0x7267, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7268, + 0,0x7269}; + +/* page 54 0x9CE5-0x9DFD */ +static uint16 tab_uni_jisx020854[]={ +0x443B, 0,0x726A, 0,0x4837, 0,0x726F,0x726B, + 0, 0, 0,0x726C, 0, 0,0x4B31,0x4C44, + 0,0x4650, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7270, 0, + 0,0x7271,0x463E,0x726E,0x726D, 0, 0, 0, + 0,0x322A, 0, 0, 0,0x7279, 0, 0, +0x7278, 0, 0, 0, 0, 0,0x3175, 0, + 0, 0,0x7276, 0, 0, 0,0x7275, 0, + 0,0x7273, 0,0x337B, 0,0x7272,0x3C32,0x3229, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3963, 0, + 0,0x727C,0x727B, 0,0x727A, 0, 0,0x7277, + 0,0x727D, 0,0x727E, 0, 0, 0, 0, + 0, 0, 0,0x7325,0x7324, 0, 0, 0, + 0, 0, 0, 0,0x7326, 0, 0,0x312D, +0x7321,0x7322, 0,0x3974,0x4C39, 0, 0,0x7323, + 0, 0, 0, 0, 0, 0, 0,0x4B32, + 0, 0,0x732B, 0, 0,0x7327, 0, 0, + 0, 0, 0, 0, 0,0x732C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7329, 0,0x7328, 0, 0, 0, + 0, 0,0x375C, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x732D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x732E, + 0, 0, 0, 0,0x732F, 0,0x732A, 0, + 0, 0,0x7274, 0, 0,0x7330, 0,0x4461, + 0, 0, 0,0x7334, 0,0x7335,0x7333, 0, + 0, 0, 0, 0,0x7332,0x7338, 0,0x7331, + 0,0x7336, 0, 0, 0, 0, 0, 0, + 0, 0,0x7337, 0, 0, 0,0x733A, 0, + 0, 0, 0, 0,0x7339, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x733C, 0, 0, 0, 0, 0, 0, +0x733D, 0,0x733E, 0, 0,0x4F49, 0, 0, + 0, 0, 0,0x733B,0x426B,0x3A6D, 0, 0, +0x733F}; + +/* page 55 0x9E1A-0x9E1E */ +static uint16 tab_uni_jisx020855[]={ +0x7340,0x7341, 0, 0,0x7342}; + +/* page 56 0x9E75-0x9F77 */ +static uint16 tab_uni_jisx020856[]={ +0x7343, 0, 0,0x3834,0x7344, 0, 0, 0, +0x7345, 0,0x3C2F, 0,0x7346, 0, 0, 0, + 0, 0, 0,0x7347, 0, 0,0x7348,0x7349, + 0, 0, 0, 0,0x734C,0x734A,0x4F3C, 0, +0x734B, 0,0x4E6F, 0, 0, 0, 0, 0, +0x734D, 0,0x4E5B, 0, 0, 0, 0, 0, +0x734E,0x477E, 0, 0,0x734F,0x7351, 0, 0, +0x7352, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x7350,0x396D,0x4C4D,0x4B63,0x5677, + 0,0x5D60,0x4B7B, 0, 0, 0, 0,0x322B, + 0, 0, 0, 0, 0, 0, 0,0x7354, +0x3550,0x7355,0x7356,0x7357, 0,0x3975, 0,0x7358, + 0, 0, 0,0x6054,0x4C5B, 0,0x4263,0x7359, +0x735B,0x735A, 0,0x735C, 0, 0, 0, 0, +0x735D, 0, 0,0x735E, 0, 0, 0, 0, + 0, 0,0x735F, 0, 0, 0, 0,0x7360, + 0,0x7361,0x7362, 0,0x7363, 0,0x7364,0x7365, +0x7366, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7367,0x7368, 0, 0, 0, 0, + 0,0x4524, 0, 0, 0, 0,0x385D, 0, +0x736A, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x414D,0x736B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x736C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4921, 0, + 0,0x736D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x736E,0x6337, 0, + 0,0x6C5A,0x706D, 0, 0,0x736F, 0,0x7370, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7372,0x7373,0x7374,0x4E70,0x7371, 0, + 0,0x7375,0x7376, 0, 0,0x7378, 0,0x7377, + 0, 0, 0, 0, 0,0x737A, 0, 0, + 0,0x737B,0x7379}; + +/* page 57 0x9F8D-0x9FA0 */ +static uint16 tab_uni_jisx020857[]={ +0x4E36, 0, 0, 0, 0, 0, 0, 0, +0x737C, 0, 0, 0, 0, 0, 0,0x737D, +0x6354, 0, 0,0x737E}; + +/* page 58 0xFF01-0xFF5E */ +static uint16 tab_uni_jisx020858[]={ +0x212A, 0,0x2174,0x2170,0x2173,0x2175, 0,0x214A, +0x214B,0x2176,0x215C,0x2124,0x215D,0x2125,0x213F,0x2330, +0x2331,0x2332,0x2333,0x2334,0x2335,0x2336,0x2337,0x2338, +0x2339,0x2127,0x2128,0x2163,0x2161,0x2164,0x2129,0x2177, +0x2341,0x2342,0x2343,0x2344,0x2345,0x2346,0x2347,0x2348, +0x2349,0x234A,0x234B,0x234C,0x234D,0x234E,0x234F,0x2350, +0x2351,0x2352,0x2353,0x2354,0x2355,0x2356,0x2357,0x2358, +0x2359,0x235A,0x214E,0x2140,0x214F,0x2130,0x2132,0x212E, +0x2361,0x2362,0x2363,0x2364,0x2365,0x2366,0x2367,0x2368, +0x2369,0x236A,0x236B,0x236C,0x236D,0x236E,0x236F,0x2370, +0x2371,0x2372,0x2373,0x2374,0x2375,0x2376,0x2377,0x2378, +0x2379,0x237A,0x2150,0x2143,0x2151,0x2141}; + +/* page 59 0xFFE0-0xFFE5 */ +static uint16 tab_uni_jisx020859[]={ +0x2171,0x2172,0x224C,0x2131, 0,0x216F}; + +static int +my_uni_jisx0208_onechar(int code){ + if ((code>=0x005C)&&(code<=0x005C)) + return(tab_uni_jisx02080[code-0x005C]); + if ((code>=0x00A2)&&(code<=0x00B6)) + return(tab_uni_jisx02081[code-0x00A2]); + if ((code>=0x00D7)&&(code<=0x00D7)) + return(tab_uni_jisx02082[code-0x00D7]); + if ((code>=0x00F7)&&(code<=0x00F7)) + return(tab_uni_jisx02083[code-0x00F7]); + if ((code>=0x0391)&&(code<=0x03C9)) + return(tab_uni_jisx02084[code-0x0391]); + if ((code>=0x0401)&&(code<=0x0451)) + return(tab_uni_jisx02085[code-0x0401]); + if ((code>=0x2010)&&(code<=0x203B)) + return(tab_uni_jisx02086[code-0x2010]); + if ((code>=0x2100)&&(code<=0x2116)) + return(tab_uni_jisx02087[code-0x2100]); + if ((code>=0x2120)&&(code<=0x212B)) + return(tab_uni_jisx02088[code-0x2120]); + if ((code>=0x2160)&&(code<=0x2169)) + return(tab_uni_jisx02089[code-0x2160]); + if ((code>=0x2190)&&(code<=0x2193)) + return(tab_uni_jisx020810[code-0x2190]); + if ((code>=0x21D2)&&(code<=0x21D4)) + return(tab_uni_jisx020811[code-0x21D2]); + if ((code>=0x2200)&&(code<=0x223D)) + return(tab_uni_jisx020812[code-0x2200]); + if ((code>=0x2252)&&(code<=0x226B)) + return(tab_uni_jisx020813[code-0x2252]); + if ((code>=0x2282)&&(code<=0x2287)) + return(tab_uni_jisx020814[code-0x2282]); + if ((code>=0x22A0)&&(code<=0x22BF)) + return(tab_uni_jisx020815[code-0x22A0]); + if ((code>=0x2312)&&(code<=0x2312)) + return(tab_uni_jisx020816[code-0x2312]); + if ((code>=0x2460)&&(code<=0x2473)) + return(tab_uni_jisx020817[code-0x2460]); + if ((code>=0x2500)&&(code<=0x254B)) + return(tab_uni_jisx020818[code-0x2500]); + if ((code>=0x25A0)&&(code<=0x25CF)) + return(tab_uni_jisx020819[code-0x25A0]); + if ((code>=0x25EF)&&(code<=0x25EF)) + return(tab_uni_jisx020820[code-0x25EF]); + if ((code>=0x2605)&&(code<=0x2606)) + return(tab_uni_jisx020821[code-0x2605]); + if ((code>=0x2640)&&(code<=0x2642)) + return(tab_uni_jisx020822[code-0x2640]); + if ((code>=0x266A)&&(code<=0x266F)) + return(tab_uni_jisx020823[code-0x266A]); + if ((code>=0x3000)&&(code<=0x301F)) + return(tab_uni_jisx020824[code-0x3000]); + if ((code>=0x3041)&&(code<=0x30FE)) + return(tab_uni_jisx020825[code-0x3041]); + if ((code>=0x3230)&&(code<=0x3239)) + return(tab_uni_jisx020826[code-0x3230]); + if ((code>=0x32A0)&&(code<=0x32A8)) + return(tab_uni_jisx020827[code-0x32A0]); + if ((code>=0x3300)&&(code<=0x33CD)) + return(tab_uni_jisx020828[code-0x3300]); + if ((code>=0x4E00)&&(code<=0x5516)) + return(tab_uni_jisx020829[code-0x4E00]); + if ((code>=0x552E)&&(code<=0x5563)) + return(tab_uni_jisx020830[code-0x552E]); + if ((code>=0x557B)&&(code<=0x576A)) + return(tab_uni_jisx020831[code-0x557B]); + if ((code>=0x577F)&&(code<=0x5A9B)) + return(tab_uni_jisx020832[code-0x577F]); + if ((code>=0x5ABC)&&(code<=0x5D29)) + return(tab_uni_jisx020833[code-0x5ABC]); + if ((code>=0x5D4B)&&(code<=0x6BF3)) + return(tab_uni_jisx020834[code-0x5D4B]); + if ((code>=0x6C08)&&(code<=0x6CF3)) + return(tab_uni_jisx020835[code-0x6C08]); + if ((code>=0x6D0B)&&(code<=0x7409)) + return(tab_uni_jisx020836[code-0x6D0B]); + if ((code>=0x7422)&&(code<=0x7845)) + return(tab_uni_jisx020837[code-0x7422]); + if ((code>=0x785D)&&(code<=0x7E9C)) + return(tab_uni_jisx020838[code-0x785D]); + if ((code>=0x7F36)&&(code<=0x8358)) + return(tab_uni_jisx020839[code-0x7F36]); + if ((code>=0x8373)&&(code<=0x8B9A)) + return(tab_uni_jisx020840[code-0x8373]); + if ((code>=0x8C37)&&(code<=0x8D16)) + return(tab_uni_jisx020841[code-0x8C37]); + if ((code>=0x8D64)&&(code<=0x8F64)) + return(tab_uni_jisx020842[code-0x8D64]); + if ((code>=0x8F9B)&&(code<=0x9132)) + return(tab_uni_jisx020843[code-0x8F9B]); + if ((code>=0x9149)&&(code<=0x92B9)) + return(tab_uni_jisx020844[code-0x9149]); + if ((code>=0x92CF)&&(code<=0x93E8)) + return(tab_uni_jisx020845[code-0x92CF]); + if ((code>=0x9403)&&(code<=0x9481)) + return(tab_uni_jisx020846[code-0x9403]); + if ((code>=0x9577)&&(code<=0x95E5)) + return(tab_uni_jisx020847[code-0x9577]); + if ((code>=0x961C)&&(code<=0x9874)) + return(tab_uni_jisx020848[code-0x961C]); + if ((code>=0x98A8)&&(code<=0x98C6)) + return(tab_uni_jisx020849[code-0x98A8]); + if ((code>=0x98DB)&&(code<=0x9957)) + return(tab_uni_jisx020850[code-0x98DB]); + if ((code>=0x9996)&&(code<=0x9A6B)) + return(tab_uni_jisx020851[code-0x9996]); + if ((code>=0x9AA8)&&(code<=0x9B5A)) + return(tab_uni_jisx020852[code-0x9AA8]); + if ((code>=0x9B6F)&&(code<=0x9C78)) + return(tab_uni_jisx020853[code-0x9B6F]); + if ((code>=0x9CE5)&&(code<=0x9DFD)) + return(tab_uni_jisx020854[code-0x9CE5]); + if ((code>=0x9E1A)&&(code<=0x9E1E)) + return(tab_uni_jisx020855[code-0x9E1A]); + if ((code>=0x9E75)&&(code<=0x9F77)) + return(tab_uni_jisx020856[code-0x9E75]); + if ((code>=0x9F8D)&&(code<=0x9FA0)) + return(tab_uni_jisx020857[code-0x9F8D]); + if ((code>=0xFF01)&&(code<=0xFF5E)) + return(tab_uni_jisx020858[code-0xFF01]); + if ((code>=0xFFE0)&&(code<=0xFFE5)) + return(tab_uni_jisx020859[code-0xFFE0]); + return(0); +} + + +/* page 0 0x007E-0x007E */ +static uint16 tab_uni_jisx02120[]={ + 0}; + +/* page 1 0x00A1-0x017E */ +static uint16 tab_uni_jisx02121[]={ +0x2242, 0, 0,0x2270, 0, 0, 0, 0, +0x226D,0x226C, 0, 0, 0,0x226E,0x2234, 0, + 0, 0, 0, 0, 0, 0, 0,0x2231, + 0,0x226B, 0, 0, 0, 0,0x2244,0x2A22, +0x2A21,0x2A24,0x2A2A,0x2A23,0x2A29,0x2921,0x2A2E,0x2A32, +0x2A31,0x2A34,0x2A33,0x2A40,0x2A3F,0x2A42,0x2A41, 0, +0x2A50,0x2A52,0x2A51,0x2A54,0x2A58,0x2A53, 0,0x292C, +0x2A63,0x2A62,0x2A65,0x2A64,0x2A72,0x2930,0x294E,0x2B22, +0x2B21,0x2B24,0x2B2A,0x2B23,0x2B29,0x2941,0x2B2E,0x2B32, +0x2B31,0x2B34,0x2B33,0x2B40,0x2B3F,0x2B42,0x2B41,0x2943, +0x2B50,0x2B52,0x2B51,0x2B54,0x2B58,0x2B53, 0,0x294C, +0x2B63,0x2B62,0x2B65,0x2B64,0x2B72,0x2950,0x2B73,0x2A27, +0x2B27,0x2A25,0x2B25,0x2A28,0x2B28,0x2A2B,0x2B2B,0x2A2C, +0x2B2C,0x2A2F,0x2B2F,0x2A2D,0x2B2D,0x2A30,0x2B30,0x2922, +0x2942,0x2A37,0x2B37, 0, 0,0x2A36,0x2B36,0x2A38, +0x2B38,0x2A35,0x2B35,0x2A3A,0x2B3A,0x2A3B,0x2B3B,0x2A3D, +0x2B3D,0x2A3C, 0,0x2A3E,0x2B3E,0x2924,0x2944,0x2A47, +0x2B47,0x2A45,0x2B45, 0, 0,0x2A46,0x2B46,0x2A44, +0x2945,0x2926,0x2946,0x2A48,0x2B48,0x2A49,0x2B49,0x2947, +0x2A4A,0x2B4A,0x2A4C,0x2B4C,0x2A4B,0x2B4B,0x2929,0x2949, +0x2928,0x2948,0x2A4D,0x2B4D,0x2A4F,0x2B4F,0x2A4E,0x2B4E, +0x294A,0x292B,0x294B,0x2A57,0x2B57, 0, 0,0x2A56, +0x2B56,0x292D,0x294D,0x2A59,0x2B59,0x2A5B,0x2B5B,0x2A5A, +0x2B5A,0x2A5C,0x2B5C,0x2A5D,0x2B5D,0x2A5F,0x2B5F,0x2A5E, +0x2B5E,0x2A61,0x2B61,0x2A60,0x2B60,0x292F,0x294F,0x2A6C, +0x2B6C,0x2A69,0x2B69,0x2A66,0x2B66,0x2A6B,0x2B6B,0x2A68, +0x2B68,0x2A6A,0x2B6A,0x2A71,0x2B71,0x2A74,0x2B74,0x2A73, +0x2A75,0x2B75,0x2A77,0x2B77,0x2A76,0x2B76}; + +/* page 2 0x01CD-0x01DC */ +static uint16 tab_uni_jisx02122[]={ +0x2A26,0x2B26,0x2A43,0x2B43,0x2A55,0x2B55,0x2A67,0x2B67, +0x2A70,0x2B70,0x2A6D,0x2B6D,0x2A6F,0x2B6F,0x2A6E,0x2B6E +}; + +/* page 3 0x01F5-0x01F5 */ +static uint16 tab_uni_jisx02123[]={ +0x2B39}; + +/* page 4 0x02C7-0x02DD */ +static uint16 tab_uni_jisx02124[]={ +0x2230, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x222F,0x2232,0x2236,0x2235, 0,0x2233}; + +/* page 5 0x0384-0x0390 */ +static uint16 tab_uni_jisx02125[]={ +0x2238,0x2239,0x2661, 0,0x2662,0x2663,0x2664, 0, +0x2667, 0,0x2669,0x266C,0x2676}; + +/* page 6 0x03AA-0x03CE */ +static uint16 tab_uni_jisx02126[]={ +0x2665,0x266A,0x2671,0x2672,0x2673,0x2674,0x267B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2678, 0, 0, 0, 0, 0, 0, 0, +0x2675,0x267A,0x2677,0x2679,0x267C}; + +/* page 7 0x0402-0x040F */ +static uint16 tab_uni_jisx02127[]={ +0x2742,0x2743,0x2744,0x2745,0x2746,0x2747,0x2748,0x2749, +0x274A,0x274B,0x274C, 0,0x274D,0x274E}; + +/* page 8 0x0452-0x045F */ +static uint16 tab_uni_jisx02128[]={ +0x2772,0x2773,0x2774,0x2775,0x2776,0x2777,0x2778,0x2779, +0x277A,0x277B,0x277C, 0,0x277D,0x277E}; + +/* page 9 0x2122-0x2122 */ +static uint16 tab_uni_jisx02129[]={ +0x226F}; + +/* page 10 0x2170-0x2179 */ +static uint16 tab_uni_jisx021210[]={ +0x7373,0x7374,0x7375,0x7376,0x7377,0x7378,0x7379,0x737A, +0x737B,0x737C}; + +/* page 11 0x4E02-0x4F19 */ +static uint16 tab_uni_jisx021211[]={ +0x3021, 0,0x3022,0x3023, 0, 0, 0, 0, + 0, 0,0x3024, 0, 0, 0, 0, 0, +0x3025, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3026, 0, 0, + 0,0x3027,0x3028, 0, 0, 0,0x3029, 0, + 0,0x302A, 0, 0,0x302B,0x302C,0x302D, 0, + 0, 0, 0,0x302E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x302F,0x3030, + 0, 0,0x3031, 0, 0,0x3032, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3033, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3034, 0,0x3035, 0, 0, 0, 0, 0, + 0,0x3036, 0, 0, 0, 0,0x3037,0x3038, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3039,0x303A, 0, 0, 0,0x303B, + 0, 0, 0, 0, 0,0x303C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x303D, 0, 0, 0, 0, + 0, 0, 0, 0,0x303E,0x303F, 0, 0, + 0, 0, 0,0x3040, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3041, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3042, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3043, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3044, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3045,0x3046, 0, 0, 0, 0,0x3047,0x3048, +0x3049, 0, 0, 0, 0, 0,0x304A, 0, + 0, 0, 0, 0, 0,0x304B, 0,0x304C, + 0,0x304D, 0,0x304E, 0, 0, 0, 0, + 0, 0,0x742F,0x304F,0x3050,0x3051,0x3052, 0, +0x3053,0x3054, 0, 0, 0, 0,0x3055, 0, + 0,0x3056,0x3057, 0, 0, 0, 0, 0, +0x3058, 0, 0,0x3059,0x305A,0x305B, 0,0x305C +}; + +/* page 12 0x4F2E-0x5166 */ +static uint16 tab_uni_jisx021212[]={ +0x305D, 0, 0,0x305E, 0,0x3060, 0,0x3061, + 0,0x3062, 0,0x3063, 0,0x3064, 0, 0, +0x3065, 0,0x3066, 0,0x3067, 0, 0, 0, + 0, 0,0x3068,0x3069, 0,0x306A,0x306B, 0, + 0, 0, 0, 0,0x306C, 0,0x306D, 0, +0x306E, 0,0x306F, 0, 0, 0, 0, 0, + 0,0x3070,0x305F, 0, 0,0x3071, 0, 0, + 0, 0, 0, 0,0x3072, 0,0x3073, 0, +0x3074, 0, 0,0x3075, 0, 0, 0, 0, + 0,0x3076,0x3077,0x3078,0x3079, 0, 0,0x307A, +0x307B, 0, 0,0x307C,0x307D, 0,0x307E,0x3121, + 0, 0, 0,0x3122,0x3123, 0,0x3124, 0, +0x3125, 0,0x3126, 0,0x3127,0x3128,0x3129, 0, + 0,0x312A, 0,0x312B,0x312C, 0, 0, 0, +0x312D,0x312E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x312F, 0, 0, 0, + 0,0x3130, 0,0x3131, 0,0x3132,0x3133,0x3134, +0x3135, 0,0x3136,0x3137, 0, 0, 0,0x3138, +0x3139, 0,0x313A,0x313B, 0,0x313C,0x313D,0x313E, + 0,0x313F, 0, 0,0x3140, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3141, 0, + 0, 0,0x3142, 0,0x3143, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3144, 0,0x3145, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3146,0x3147, + 0,0x3148,0x3149,0x314A, 0, 0,0x314B, 0, + 0,0x314C, 0, 0,0x314D, 0,0x314E, 0, +0x314F, 0,0x3150, 0, 0,0x3151, 0, 0, + 0,0x3152,0x3153, 0, 0,0x3154,0x3155,0x3156, +0x3157, 0, 0, 0,0x3158, 0, 0, 0, + 0,0x3159, 0, 0, 0, 0, 0, 0, +0x315A, 0,0x315B, 0,0x315C,0x315D, 0,0x315E, + 0, 0, 0, 0, 0,0x3176, 0, 0, + 0, 0,0x315F,0x3160,0x3161, 0, 0,0x3162, +0x3163, 0, 0, 0,0x3164, 0,0x3165, 0, +0x3166, 0, 0,0x3167,0x3168,0x3169, 0, 0, + 0,0x316A, 0,0x316B, 0, 0, 0, 0, + 0,0x316C,0x316D, 0,0x316E,0x316F, 0, 0, +0x3170,0x3171, 0, 0,0x3172, 0, 0,0x3173, + 0, 0,0x3174,0x3175, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3177, 0,0x3178,0x3179, 0, +0x317A, 0, 0, 0,0x317B, 0, 0, 0, +0x317C,0x317D,0x317E, 0,0x3221,0x3222,0x3223, 0, +0x3224, 0, 0, 0, 0,0x3225,0x3226, 0, +0x3227,0x3228,0x3229,0x322A,0x322B, 0, 0, 0, + 0, 0, 0, 0,0x322C, 0, 0, 0, + 0,0x322D,0x322E, 0, 0, 0, 0, 0, + 0, 0, 0,0x322F,0x3230, 0, 0,0x3231, + 0, 0,0x3232, 0, 0,0x3233,0x3234, 0, + 0,0x3235, 0, 0, 0, 0,0x3236, 0, +0x3237, 0,0x3238, 0, 0,0x3239,0x323A, 0, + 0, 0,0x323B, 0, 0, 0,0x323C,0x323D, + 0,0x323E, 0, 0,0x323F, 0,0x3240, 0, +0x3241, 0,0x3242,0x3243, 0, 0, 0, 0, + 0,0x3244, 0,0x3245,0x3251, 0,0x7430, 0, +0x3246, 0, 0, 0,0x3247, 0, 0, 0, +0x3248, 0, 0, 0, 0,0x3249, 0, 0, +0x324A,0x324B,0x324C, 0, 0,0x324D,0x324E,0x324F, +0x3250, 0,0x3252, 0, 0, 0, 0, 0, + 0,0x3253, 0,0x3254, 0,0x3255,0x3256,0x3257, +0x3258, 0, 0, 0, 0,0x3259, 0, 0, + 0,0x325A,0x325B, 0, 0, 0,0x325C,0x325D, + 0,0x325E, 0,0x325F, 0,0x3260,0x3261,0x3262, + 0, 0,0x3263,0x3264, 0, 0, 0, 0, + 0, 0, 0, 0,0x3265, 0, 0, 0, + 0, 0, 0, 0,0x3266, 0, 0, 0, + 0,0x3267, 0, 0, 0,0x3268, 0,0x3269, + 0,0x326A,0x326B, 0, 0, 0, 0, 0, + 0,0x326C, 0, 0, 0, 0,0x326D, 0, +0x326E}; + +/* page 13 0x517E-0x5515 */ +static uint16 tab_uni_jisx021213[]={ +0x326F, 0, 0, 0, 0,0x3270,0x3271, 0, + 0, 0, 0, 0, 0,0x3272, 0, 0, +0x3273, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3274, 0, 0, 0, 0,0x3275, + 0, 0, 0,0x3276, 0,0x3277, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3278, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3279, 0,0x327A, 0,0x327B, 0, +0x327C,0x327D, 0, 0,0x327E, 0, 0, 0, + 0, 0,0x3321, 0, 0, 0, 0, 0, + 0,0x3322, 0,0x3323,0x3324,0x3325, 0,0x3326, + 0, 0,0x3327, 0, 0, 0, 0, 0, +0x3328, 0, 0, 0,0x3329, 0, 0,0x332A, + 0, 0, 0, 0, 0, 0,0x7431, 0, +0x332B, 0, 0, 0,0x332C,0x332D,0x332E, 0, + 0,0x332F, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3330,0x3331, 0, 0,0x3332, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3333,0x3334, 0,0x3335, +0x3336, 0,0x3337, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3338, 0, 0, 0, + 0, 0,0x3339, 0, 0, 0, 0, 0, + 0, 0, 0,0x333A,0x333B, 0, 0,0x333C, + 0, 0, 0, 0, 0, 0,0x333D, 0, + 0, 0, 0, 0, 0, 0, 0,0x333E, + 0, 0, 0,0x333F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3340, + 0,0x3341,0x3342, 0,0x3343, 0,0x3344, 0, + 0,0x3345,0x3346,0x3347, 0, 0, 0, 0, +0x3348, 0, 0, 0, 0, 0, 0, 0, +0x3349, 0, 0, 0, 0, 0, 0, 0, + 0,0x334A,0x334B,0x334C, 0, 0, 0, 0, + 0, 0,0x334D, 0,0x334E, 0, 0,0x334F, + 0, 0, 0, 0,0x3350, 0,0x3351, 0, + 0, 0, 0, 0, 0,0x3352, 0,0x3353, +0x3354,0x3355,0x3356, 0,0x3357, 0,0x3358, 0, + 0, 0, 0, 0, 0, 0,0x3359,0x335A, +0x335B,0x335C, 0, 0, 0, 0, 0, 0, + 0,0x335D,0x335E, 0, 0, 0, 0, 0, +0x335F,0x3360,0x3361, 0,0x3362,0x3363, 0,0x3364, + 0, 0,0x3365, 0, 0, 0,0x3366, 0, +0x3367, 0,0x3368, 0, 0, 0,0x3369, 0, + 0,0x336A, 0,0x336B, 0, 0,0x336C, 0, +0x336D, 0, 0, 0, 0,0x336E,0x336F, 0, + 0, 0, 0,0x3370, 0, 0, 0,0x3371, + 0, 0,0x3372,0x3373,0x3374, 0,0x3375, 0, + 0, 0,0x3376,0x3377, 0, 0,0x3378, 0, +0x3379,0x337A, 0, 0, 0, 0, 0, 0, + 0, 0,0x337B, 0, 0,0x337C, 0, 0, + 0,0x7432, 0, 0,0x337D,0x337E,0x3421, 0, + 0, 0, 0,0x3422, 0,0x3423, 0, 0, + 0, 0,0x3424, 0, 0,0x3425,0x3426, 0, +0x3427,0x3428, 0, 0, 0, 0,0x7433,0x3429, + 0,0x342A,0x342B,0x342C, 0,0x342D,0x342E,0x342F, + 0, 0,0x3430, 0,0x3431, 0, 0,0x3432, + 0, 0, 0, 0, 0, 0,0x3433,0x3434, +0x3435, 0, 0, 0,0x3436, 0, 0, 0, + 0, 0, 0, 0, 0,0x3438,0x3437, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3439, 0,0x343A, 0, 0, + 0, 0, 0,0x343B, 0,0x343C, 0,0x343D, + 0, 0, 0, 0, 0, 0,0x343E,0x343F, + 0, 0, 0, 0,0x3440, 0, 0, 0, + 0, 0, 0,0x3441, 0, 0, 0, 0, +0x3442, 0, 0, 0, 0,0x3443, 0, 0, + 0,0x3444,0x3445, 0, 0, 0, 0, 0, +0x3446, 0, 0, 0, 0,0x3447,0x3448, 0, + 0, 0, 0,0x3449, 0, 0, 0,0x344A, + 0, 0, 0,0x344B, 0, 0,0x344C, 0, + 0, 0, 0, 0,0x344D,0x344E, 0, 0, + 0,0x344F, 0, 0,0x3450, 0,0x3451,0x3452, + 0,0x3453,0x3454, 0,0x3455, 0, 0,0x3456, + 0, 0,0x3457, 0, 0, 0, 0,0x3458, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3459, 0, 0,0x345A,0x345B, 0,0x345C, + 0, 0, 0, 0,0x345D, 0, 0,0x345E, +0x345F, 0,0x3460, 0, 0, 0, 0, 0, +0x3461,0x3462, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3463, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3464, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3465, 0, 0, + 0, 0, 0, 0,0x3466, 0, 0, 0, + 0, 0, 0,0x3467, 0, 0, 0, 0, + 0,0x3468,0x3469, 0,0x346A, 0, 0, 0, + 0,0x346B, 0,0x346C, 0, 0,0x346D,0x346E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x346F,0x3470, 0, + 0,0x3471, 0, 0, 0, 0, 0,0x3472, + 0,0x3473, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3474, 0, 0, 0,0x3475, 0,0x3476, 0, +0x3477,0x3478, 0,0x3479, 0,0x347A, 0,0x347B, +0x347C, 0, 0, 0, 0, 0,0x347D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x347E, 0,0x3521, 0,0x3522, 0,0x3523, + 0, 0,0x3524,0x3525,0x7435, 0, 0,0x3526, + 0, 0, 0,0x3527, 0, 0, 0,0x3528, +0x3529, 0, 0, 0, 0, 0,0x352A, 0, + 0,0x352B, 0,0x352C, 0, 0, 0, 0, +0x352D,0x352E, 0,0x352F,0x3530, 0, 0,0x3531, +0x3532, 0, 0,0x3533, 0, 0, 0, 0, + 0,0x3534, 0,0x3535,0x3536,0x3537, 0, 0, + 0,0x3538, 0, 0, 0, 0, 0, 0, +0x3539, 0, 0, 0,0x353A, 0, 0,0x353B, +0x353C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x353D, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x353E, 0,0x353F, 0, + 0,0x3540, 0, 0, 0, 0, 0, 0, +0x3541, 0, 0, 0, 0, 0,0x3542, 0, +0x3543,0x3544,0x3545,0x3546, 0, 0, 0,0x3547, + 0, 0,0x3548,0x3549, 0, 0,0x354A,0x354B, +0x354C, 0, 0, 0, 0, 0, 0,0x354D +}; + +/* page 14 0x552A-0x5566 */ +static uint16 tab_uni_jisx021214[]={ +0x354E,0x354F, 0, 0, 0, 0, 0, 0, +0x3550, 0, 0,0x3551,0x3552, 0, 0, 0, + 0,0x3553,0x3554,0x3555, 0, 0, 0,0x3556, + 0, 0, 0, 0, 0,0x3557, 0,0x3558, +0x3559, 0, 0,0x355A, 0, 0,0x355B,0x355C, + 0, 0, 0, 0, 0, 0,0x355D, 0, +0x355E,0x355F, 0, 0,0x3560, 0,0x3561,0x3562, + 0, 0,0x3563, 0,0x3564}; + +/* page 15 0x557F-0x5C36 */ +static uint16 tab_uni_jisx021215[]={ +0x3565, 0,0x3566,0x3567, 0, 0, 0,0x3568, + 0,0x3569, 0, 0, 0, 0, 0,0x356A, +0x356B, 0,0x356C,0x356D,0x356E,0x356F, 0, 0, +0x3570, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3571,0x3572, 0, 0, + 0, 0, 0, 0, 0, 0,0x3573, 0, + 0, 0, 0,0x3574, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3575, 0,0x3576, 0,0x3577, 0, 0,0x3578, + 0, 0,0x3579, 0,0x357A,0x357B, 0,0x357C, + 0, 0,0x357D,0x357E,0x3621, 0, 0, 0, +0x3622,0x3623, 0, 0,0x3624, 0, 0,0x3625, + 0, 0, 0,0x3626, 0, 0, 0, 0, + 0, 0,0x3627, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3628, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3629, 0, 0, 0, 0, 0,0x362A, 0, + 0,0x362B, 0,0x362C, 0, 0,0x362D,0x362E, +0x362F,0x3630,0x3631,0x3632, 0, 0, 0, 0, + 0, 0,0x3633, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3634, 0, 0, + 0,0x3635, 0, 0,0x3636, 0,0x3637, 0, +0x3638, 0,0x3639, 0,0x363A,0x363B,0x363C, 0, +0x363D,0x363E,0x363F, 0,0x3640,0x3641, 0,0x3642, + 0, 0,0x3643, 0,0x3644, 0,0x3645, 0, +0x3646, 0, 0, 0, 0,0x3647, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3648, + 0,0x3649,0x364A,0x364B,0x364C, 0, 0,0x364D, + 0, 0,0x364E, 0, 0, 0,0x364F, 0, +0x3650, 0,0x3651,0x3652, 0, 0,0x3653, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3654,0x3655, 0, + 0,0x3656, 0, 0,0x3657,0x3658, 0, 0, + 0, 0, 0, 0, 0, 0,0x3659, 0, + 0, 0,0x365A,0x365B, 0, 0,0x365C,0x365D, +0x365E, 0, 0, 0, 0, 0, 0,0x365F, +0x3660,0x3661,0x3662, 0,0x3663,0x3664,0x3665, 0, + 0, 0,0x3666, 0,0x3667, 0, 0, 0, +0x3668, 0, 0, 0, 0, 0, 0,0x3669, + 0, 0, 0, 0, 0, 0,0x366A, 0, + 0, 0,0x366B,0x366C,0x366D,0x3670,0x3671, 0, +0x366E,0x366F, 0, 0, 0, 0, 0, 0, + 0, 0,0x3672, 0, 0,0x3673,0x3674, 0, +0x3675, 0,0x3676, 0, 0,0x3677,0x3678,0x3679, +0x367A,0x367B, 0, 0,0x367D, 0,0x367E, 0, + 0, 0,0x367C, 0, 0, 0, 0,0x3721, +0x3722, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3723,0x3724, 0, 0, 0, 0, +0x3725, 0, 0,0x3726, 0,0x3727, 0, 0, + 0, 0,0x3728, 0, 0, 0,0x3729, 0, + 0, 0, 0,0x372A,0x372B, 0,0x372C, 0, + 0,0x372D, 0,0x372E,0x372F,0x3730,0x3731, 0, + 0, 0,0x3732,0x3733, 0,0x3734, 0,0x3735, +0x3736, 0, 0, 0,0x3737,0x3738, 0, 0, + 0, 0, 0, 0, 0, 0,0x3739,0x373A, +0x373B, 0, 0, 0, 0, 0,0x373C,0x373D, + 0, 0, 0, 0, 0,0x373E,0x373F, 0, + 0, 0, 0,0x3740, 0, 0, 0, 0, + 0, 0,0x7436, 0, 0, 0, 0, 0, + 0, 0, 0,0x3741, 0, 0,0x3742, 0, +0x3743,0x3744, 0, 0,0x3745, 0,0x3746,0x3747, +0x3748,0x3749,0x374A, 0,0x374B,0x374C,0x374D, 0, +0x374E, 0,0x374F,0x3750,0x3751,0x3752, 0,0x3753, + 0, 0,0x3754, 0,0x3755, 0, 0, 0, + 0, 0, 0, 0, 0,0x3756, 0, 0, + 0, 0, 0, 0, 0,0x3757,0x3760, 0, +0x3758, 0,0x3759,0x375A, 0,0x375B,0x375C,0x375D, +0x375E, 0,0x375F, 0, 0, 0, 0, 0, +0x3761,0x3762,0x3763, 0, 0,0x3764, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3765, 0, 0, 0, 0,0x3766, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3767,0x3768, 0, 0, 0,0x3769, 0, 0, +0x376A, 0, 0, 0, 0, 0,0x376B, 0, + 0, 0, 0, 0, 0, 0,0x376C,0x376D, + 0, 0,0x377E, 0, 0,0x376E, 0,0x376F, +0x3770, 0,0x3771, 0, 0, 0,0x3772, 0, + 0,0x3773, 0, 0, 0, 0,0x3774,0x3775, + 0,0x3776, 0, 0, 0, 0,0x3777,0x3778, +0x3779, 0, 0, 0,0x377A,0x377B, 0, 0, + 0,0x377C,0x377D, 0, 0,0x3821,0x3822, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3823, 0, 0,0x3824, +0x3825,0x3826, 0, 0, 0, 0, 0,0x3827, +0x3828, 0, 0, 0, 0, 0,0x3829, 0, + 0, 0, 0,0x382A, 0, 0, 0, 0, + 0, 0,0x382B, 0, 0, 0, 0, 0, +0x382C, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x382D, 0, 0,0x382E,0x382F, 0, +0x3830,0x3831, 0, 0, 0, 0,0x3832, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3833, 0,0x3834, 0, 0,0x3835, 0, 0, +0x3836,0x3837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3838, 0, 0, 0,0x3839, 0, 0, +0x383A,0x383B,0x383C, 0, 0, 0, 0, 0, +0x383D,0x383E,0x383F,0x3840, 0,0x3841,0x3842, 0, +0x3843,0x3844, 0, 0, 0,0x3845, 0,0x3846, + 0, 0, 0, 0, 0, 0,0x3847,0x7439, + 0,0x3848,0x3849,0x384A, 0, 0, 0,0x384B, + 0, 0,0x384C, 0, 0, 0, 0, 0, + 0, 0,0x384D,0x384E, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3850, 0, 0, + 0, 0, 0,0x3851, 0,0x384F, 0, 0, + 0,0x3852, 0, 0, 0, 0,0x3853,0x3854, + 0,0x3855, 0,0x3856, 0,0x3857, 0,0x3858, + 0, 0, 0,0x3859, 0, 0,0x385A, 0, + 0, 0,0x385B,0x385C, 0, 0, 0, 0, + 0, 0,0x385D, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x385E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x385F,0x3860, + 0, 0, 0, 0,0x3861,0x3862, 0, 0, + 0, 0, 0,0x3863,0x3864,0x3865, 0, 0, + 0, 0, 0, 0, 0, 0,0x3867, 0, + 0, 0,0x3868, 0,0x3869,0x386A, 0, 0, + 0,0x386B, 0, 0, 0, 0, 0, 0, +0x386C,0x386D, 0, 0,0x386E, 0,0x386F,0x3870, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3871, 0, 0, 0,0x3872, 0, 0,0x3873, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3874,0x3875, 0, 0, 0, + 0, 0,0x3876, 0,0x3877, 0,0x3878,0x3879, +0x387A, 0,0x387B, 0,0x387C, 0, 0, 0, + 0, 0, 0, 0,0x387D, 0,0x387E, 0, +0x3921, 0, 0,0x3922, 0, 0,0x3923,0x3924, + 0, 0,0x3925, 0,0x3926,0x3927, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3928,0x3929, 0,0x392A, + 0, 0, 0,0x392B, 0, 0,0x392C, 0, +0x392D, 0, 0, 0, 0, 0, 0, 0, +0x392E, 0, 0, 0, 0,0x392F, 0, 0, +0x3930, 0, 0, 0, 0, 0,0x3931,0x3932, +0x3933,0x3934, 0, 0,0x3935, 0, 0, 0, +0x3936, 0, 0,0x3937, 0,0x3938, 0, 0, + 0, 0,0x3939, 0,0x393A,0x393B, 0, 0, + 0,0x393C, 0,0x393D, 0, 0,0x393E, 0, + 0, 0, 0,0x393F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3940,0x3941, +0x3942, 0, 0, 0,0x3943,0x3944, 0, 0, +0x3945, 0, 0, 0, 0, 0, 0,0x3946, +0x3947, 0,0x3948,0x3949, 0,0x394A, 0, 0, +0x394B, 0, 0, 0, 0, 0, 0, 0, + 0,0x394C, 0, 0, 0,0x394D, 0, 0, + 0, 0, 0, 0, 0,0x394E,0x394F,0x3950, + 0, 0, 0,0x3951,0x3952, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3953, + 0, 0, 0, 0,0x3954,0x3955, 0, 0, +0x3956,0x3957, 0,0x3958, 0, 0,0x3959, 0, + 0,0x395A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x395B,0x395C, 0, +0x395D,0x395E, 0, 0, 0,0x395F, 0, 0, + 0,0x3960, 0, 0, 0, 0,0x3961, 0, + 0, 0, 0, 0, 0, 0, 0,0x3962, + 0, 0, 0, 0,0x3963, 0,0x3964, 0, +0x3965, 0, 0, 0, 0, 0,0x3966, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3967, 0, 0,0x3968,0x3969, 0, 0,0x396A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x396B, 0, 0, 0, + 0,0x396C, 0, 0,0x396D, 0, 0,0x396E, + 0, 0,0x396F, 0, 0,0x3970, 0,0x3971, +0x3972,0x3973, 0,0x3974, 0, 0, 0, 0, +0x3975, 0, 0, 0, 0,0x3976, 0, 0, + 0, 0,0x3977,0x3978,0x3979, 0,0x397A, 0, + 0,0x397B, 0,0x397C,0x397D, 0, 0, 0, +0x397E, 0, 0, 0, 0,0x3A21, 0,0x3A22, + 0,0x3A23, 0, 0, 0, 0, 0, 0, +0x3A24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3A25, 0,0x3A26, 0, 0, + 0,0x3A27, 0, 0, 0, 0,0x3A28, 0, + 0, 0, 0,0x3A29, 0, 0, 0,0x3A2A, + 0, 0, 0, 0, 0, 0,0x3A2B,0x3A2C, + 0, 0, 0, 0, 0, 0,0x3A2D, 0, + 0,0x3A2E,0x3A2F, 0, 0, 0, 0, 0, + 0,0x3A30, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3A31, 0,0x3A33, 0,0x3A34, 0,0x3A35, 0, + 0, 0,0x3A36, 0, 0, 0,0x3A37, 0, + 0, 0, 0, 0, 0, 0,0x3A38, 0, + 0, 0, 0, 0, 0,0x3A32, 0, 0, + 0,0x3A39, 0, 0, 0, 0, 0, 0, + 0, 0,0x3A3A, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3A3B,0x3A3C, 0, 0, + 0, 0, 0,0x3A3D, 0, 0, 0,0x3A3E, + 0, 0, 0, 0, 0, 0, 0,0x3A3F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3A40, 0, 0, 0, 0, 0,0x3A41, +0x3A42, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3A43,0x3A44,0x3A45, +0x3A46, 0,0x3A47, 0, 0,0x3A48, 0,0x3A49, + 0, 0, 0,0x3A4A, 0, 0, 0,0x3A4B, + 0,0x3A4C,0x3A4D, 0,0x3A4E,0x3A4F, 0,0x3A50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3A51,0x3A52, 0, 0,0x3A53,0x3A54, 0, +0x3A55, 0,0x3A56,0x3A57, 0, 0, 0, 0, +0x3A58, 0, 0,0x3A59, 0,0x3A5A, 0, 0, + 0,0x3A5B,0x3A5C, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3A5D, 0, +0x3A5E, 0, 0, 0, 0, 0, 0,0x3A5F, +0x3A60,0x3A61,0x3A62,0x3A63, 0, 0, 0, 0, + 0,0x3A64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x743A, 0, 0, +0x3A65, 0,0x3A66, 0, 0,0x3A67, 0, 0, + 0, 0, 0, 0, 0, 0,0x3A68, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3A69, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3A6A, 0, 0, 0, 0, 0, 0,0x3A6B, +0x3A6C, 0, 0, 0,0x3A6D, 0, 0,0x3A6E, + 0, 0,0x3A6F, 0,0x3A70,0x3A71, 0,0x3A72, + 0,0x3A73, 0,0x3A74, 0, 0,0x3A75,0x3A76 +}; + +/* page 16 0x5C59-0x5EEB */ +static uint16 tab_uni_jisx021216[]={ +0x3A77,0x3A78, 0,0x3A79, 0, 0, 0, 0, + 0,0x3A7A,0x3A7B, 0, 0, 0,0x3A7C,0x3A7D, +0x3A7E, 0, 0, 0,0x3B21, 0, 0,0x3B22, + 0, 0, 0,0x3B23,0x3B24, 0, 0, 0, + 0,0x3B25,0x3B26,0x3B27,0x3B28, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3B29,0x3B2A, + 0,0x3B2B, 0, 0, 0, 0,0x3B2C, 0, + 0,0x3B2D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3B2E, 0,0x3B2F,0x3B30, + 0,0x3B31,0x3B32, 0, 0,0x3B33, 0, 0, + 0,0x3B34, 0, 0, 0, 0, 0, 0, + 0,0x3B35, 0,0x3B36,0x3B37, 0, 0, 0, + 0,0x3B38, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3B39, 0,0x3B3A, 0, 0, 0, 0, 0, + 0,0x3B3B, 0, 0, 0, 0,0x3B3D, 0, + 0, 0, 0, 0,0x3B3C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3B3E, 0, 0, +0x3B3F,0x3B40, 0,0x3B41,0x743B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3B42, 0, 0, 0, 0,0x3B43, 0, 0, + 0, 0, 0, 0,0x3B44, 0, 0, 0, + 0,0x3B45, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3B47,0x3B48, 0,0x3B49,0x3B4A, 0, + 0, 0,0x3B46, 0, 0, 0, 0, 0, +0x3B4B, 0, 0,0x3B4C, 0, 0, 0, 0, +0x3B4D, 0, 0, 0,0x3B4E, 0,0x3B4F, 0, + 0,0x3B50,0x3B51, 0, 0,0x3B52, 0,0x3B53, + 0,0x3B57, 0, 0, 0, 0, 0, 0, +0x3B55, 0,0x743C, 0,0x3B54, 0, 0, 0, +0x3B56, 0, 0, 0, 0, 0,0x3B58,0x3B59, +0x3B5A,0x3B5B, 0,0x3B5C, 0, 0, 0, 0, + 0,0x3B5D, 0, 0,0x3B5E, 0, 0,0x3B5F, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3B60,0x3B61, 0, 0, 0,0x3B62,0x3B63, 0, +0x3B64, 0,0x3B65, 0, 0, 0, 0,0x3B66, + 0,0x3B67, 0, 0, 0, 0, 0, 0, + 0,0x3B68,0x3B69,0x3B6A,0x3B6B, 0, 0, 0, +0x3B6C, 0,0x3B6D, 0, 0, 0,0x3B6E,0x3B6F, + 0, 0, 0, 0, 0, 0,0x3B70, 0, + 0, 0,0x3B71, 0, 0, 0, 0,0x3B72, + 0,0x6674, 0,0x3B73, 0, 0, 0,0x3B74, +0x3B75, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3B76, 0, 0, 0,0x3B77, 0, + 0, 0,0x3B78, 0, 0,0x3B7A, 0,0x3B79, + 0, 0, 0, 0, 0, 0, 0,0x3B7B, +0x3B7C, 0, 0, 0, 0, 0, 0,0x3B7D, + 0, 0, 0,0x3B7E, 0, 0, 0, 0, +0x3C21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C22, +0x3C23, 0, 0, 0, 0, 0, 0,0x3C24, + 0, 0, 0, 0, 0, 0,0x3C25, 0, + 0, 0, 0, 0,0x3C26, 0, 0, 0, + 0,0x3C27, 0,0x3C28,0x3C29, 0, 0,0x3C2A, + 0, 0, 0, 0, 0, 0,0x3C2B,0x3C2C, + 0, 0, 0, 0, 0, 0, 0,0x3C2E, + 0, 0, 0, 0, 0,0x3C2D, 0, 0, + 0,0x3C2F, 0, 0,0x3C30, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C31, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3C34, 0,0x3C32, 0, 0, 0, 0,0x3C33, +0x3C35, 0, 0, 0, 0,0x3C36, 0,0x3C37, + 0, 0,0x3C38,0x3C39, 0,0x3C3A, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C3B, + 0,0x3C3C,0x3C3D,0x3C3E,0x3C3F,0x3C40, 0,0x3C41, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C42, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3C43, 0, 0,0x3C44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3C45, 0,0x3C46,0x3C47, 0, 0,0x3C48, + 0,0x3C49, 0,0x3C4A, 0, 0, 0, 0, +0x3C4B, 0,0x3C4C, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3C4D,0x3C4E,0x3C4F, 0, + 0, 0, 0, 0, 0,0x3C50, 0, 0, + 0, 0,0x3C52,0x3C51, 0,0x3C53, 0, 0, +0x3C54,0x3C55, 0,0x3C56,0x3C57, 0, 0, 0, + 0, 0, 0,0x3C58, 0,0x3C59, 0, 0, + 0, 0, 0, 0,0x3C5A, 0, 0, 0, + 0, 0,0x3C5B}; + +/* page 17 0x5F02-0x6149 */ +static uint16 tab_uni_jisx021217[]={ +0x3C5C, 0, 0, 0,0x3C5D,0x3C5E,0x3C5F, 0, + 0, 0, 0, 0,0x3C60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C61, + 0, 0,0x3C62,0x3C63, 0, 0, 0,0x3C64, +0x3C65,0x3C66,0x3C67, 0, 0, 0,0x3C68, 0, + 0,0x3C69,0x3C6A, 0,0x3C6B, 0,0x3C6C, 0, + 0, 0,0x3C6D, 0,0x3C6E, 0, 0, 0, + 0,0x3C6F, 0,0x3C70, 0,0x3C71,0x3C72, 0, + 0, 0,0x3C73,0x3C74, 0,0x3C75, 0, 0, + 0, 0, 0,0x3C76, 0, 0,0x3C77, 0, + 0, 0,0x3C78, 0, 0, 0,0x3C79, 0, + 0,0x3C7A, 0, 0, 0, 0,0x3C7B, 0, + 0,0x3C7C,0x3C7D, 0, 0,0x3C7E, 0, 0, + 0, 0, 0, 0, 0,0x3D21, 0, 0, +0x3D22, 0,0x3D23,0x3D24, 0, 0,0x3D25, 0, +0x3D26, 0, 0,0x3D27,0x3D28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3D29, + 0, 0, 0,0x3D2A, 0,0x3D2B, 0, 0, + 0, 0, 0, 0,0x3D2C, 0, 0, 0, + 0, 0,0x3D2D,0x3D2E, 0, 0, 0, 0, +0x3D2F, 0,0x3D32, 0, 0,0x3D30, 0, 0, + 0,0x3D31,0x3D33, 0, 0,0x3D34,0x3D35,0x3D36, + 0, 0, 0, 0, 0,0x743E,0x3D37, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3D38, 0, 0,0x3D39,0x3D3A,0x3D3B, + 0,0x3D3C, 0, 0, 0, 0,0x3D3D,0x3D3E, +0x3D3F,0x3D40,0x3D41, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3D42, 0, 0,0x3D43, +0x3D44, 0, 0, 0, 0, 0,0x3D45,0x3D46, +0x3D47, 0,0x3D48,0x3D49,0x3D4A,0x3D4B, 0, 0, +0x3D4C,0x3D4D, 0, 0,0x3D4E, 0, 0, 0, +0x3D4F, 0,0x3D50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3D51, 0, 0, +0x3D52, 0, 0,0x3D53, 0, 0, 0, 0, + 0,0x3D54,0x3D55, 0, 0,0x3D56,0x3D57, 0, +0x3D58, 0, 0, 0, 0,0x3D59, 0, 0, + 0, 0,0x3D5A, 0, 0, 0, 0, 0, + 0, 0, 0,0x3D5B, 0, 0, 0, 0, + 0,0x3D5C, 0,0x3D5D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3D5E, 0, + 0, 0, 0, 0, 0,0x3D5F,0x3D60,0x3D61, + 0, 0,0x3D62, 0, 0, 0, 0,0x3D63, + 0, 0,0x3D64, 0,0x3D65,0x3D66, 0, 0, + 0, 0, 0,0x3D67, 0, 0, 0,0x3D68, + 0, 0, 0, 0, 0,0x3D69, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3D6A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3D6B,0x3D6C, 0, 0, +0x3D6D, 0, 0,0x743F,0x3D6E, 0,0x3D6F, 0, +0x3D70, 0, 0, 0,0x3D71, 0, 0,0x3D72, + 0,0x3D73, 0,0x3D74, 0, 0,0x3D75, 0, + 0, 0, 0,0x3D76,0x3D77, 0, 0, 0, +0x3D78, 0,0x3D79,0x3D7A, 0, 0,0x3D7B, 0, + 0, 0, 0, 0, 0, 0,0x3D7C,0x3D7D, + 0, 0, 0, 0, 0,0x3D7E, 0, 0, + 0,0x3E21, 0, 0,0x3E22, 0, 0, 0, +0x3E23, 0,0x3E24, 0, 0, 0,0x3E25,0x3E26, +0x3E27,0x3E28, 0, 0,0x3E29,0x3E2A, 0, 0, + 0, 0,0x3E2B,0x3E2C, 0, 0, 0,0x3E2D, + 0,0x3E2E, 0,0x3E2F,0x3E30, 0, 0, 0, +0x3E31, 0, 0,0x3E32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3E33, 0, 0,0x3E34, 0, 0,0x3E35, 0, + 0, 0,0x3E36,0x3E37, 0, 0, 0, 0, +0x3E38, 0, 0, 0, 0,0x3E39, 0, 0, +0x3E3A, 0,0x3E3B, 0, 0, 0,0x3E3C,0x3E3D, +0x3E3E,0x3E3F,0x3E40, 0,0x3E41,0x3E42, 0,0x3E43, + 0, 0,0x3E44, 0,0x3E45, 0,0x7440, 0, +0x3E46, 0, 0, 0, 0, 0, 0, 0, +0x3E47,0x3E48, 0, 0, 0, 0,0x3E49,0x3E4A, + 0, 0, 0,0x3E4B,0x3E4C,0x3E4D, 0,0x3E4E, + 0, 0, 0, 0, 0, 0, 0,0x3E4F, + 0, 0, 0,0x3E50,0x3E51, 0, 0,0x3E52 +}; + +/* page 18 0x615E-0x6290 */ +static uint16 tab_uni_jisx021218[]={ +0x3E53, 0,0x3E54, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3E55, 0, + 0, 0, 0, 0,0x3E56, 0, 0, 0, + 0, 0,0x3E57, 0, 0,0x3E58,0x3E59, 0, + 0,0x3E5A,0x3E5B,0x3E5C, 0,0x3E5D,0x3E5E, 0, + 0, 0, 0, 0, 0,0x3E5F, 0,0x3E60, + 0, 0, 0, 0,0x3E61,0x3E62, 0, 0, + 0,0x3E63,0x3E64, 0, 0, 0,0x3E65,0x3E66, + 0,0x3E67,0x3E68, 0, 0, 0, 0,0x3E69, + 0, 0,0x3E6A, 0,0x3E6B, 0, 0,0x3E6C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3E6D,0x3E6E, 0, 0,0x3E6F, 0, + 0, 0,0x3E70,0x3E71,0x3E72, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3E73,0x3E74, 0, 0, 0, 0, 0,0x3E75, + 0, 0, 0, 0, 0, 0,0x3E76,0x3E77, +0x3E78,0x3E79, 0,0x3E7A,0x3E7B, 0, 0,0x3E7E, + 0,0x3E7C, 0,0x3E7D, 0, 0,0x3F21,0x3F22, + 0,0x3F23, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F24, 0,0x3F25,0x3F26, 0, + 0,0x3F27, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3F28, 0,0x3F29, + 0, 0, 0, 0, 0, 0,0x3F2A, 0, + 0, 0,0x3F2B, 0,0x3F2C,0x3F2D, 0, 0, + 0,0x3F2E, 0,0x3F2F, 0,0x3F30, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F31, 0, 0, 0,0x3F32, + 0, 0, 0, 0,0x3F33,0x3F34,0x3F35, 0, +0x3F36, 0, 0, 0, 0, 0,0x3F37, 0, + 0, 0,0x3F38,0x3F39,0x3F3A, 0,0x3F3B, 0, +0x3F3C, 0, 0, 0,0x3F3D, 0,0x3F3E, 0, + 0, 0, 0, 0, 0, 0,0x3F3F, 0, + 0, 0, 0, 0, 0, 0, 0,0x3F40, + 0,0x3F41, 0, 0, 0,0x3F42, 0, 0, + 0, 0, 0, 0,0x3F43, 0, 0,0x3F44, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3F45, +0x3F46,0x3F47,0x3F48}; + +/* page 19 0x62A6-0x679B */ +static uint16 tab_uni_jisx021219[]={ +0x3F49, 0,0x3F4A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3F4B, 0, 0, +0x3F4C,0x3F4D, 0, 0,0x3F4E, 0, 0, 0, +0x3F4F,0x3F50, 0, 0, 0, 0,0x3F51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3F52, 0, 0, 0, 0, 0, 0,0x3F53, +0x3F54, 0, 0, 0,0x3F55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3F56, 0, 0, 0, + 0, 0, 0, 0,0x3F57, 0,0x3F58, 0, + 0, 0, 0, 0, 0, 0,0x3F59,0x3F5A, + 0, 0, 0, 0, 0,0x3F5B,0x3F5C, 0, + 0, 0, 0, 0,0x3F5D,0x3F5E, 0,0x3F5F, + 0, 0,0x3F60, 0, 0,0x3F61, 0, 0, +0x3F62, 0,0x3F63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F64,0x3F65, 0, 0,0x3F66, + 0, 0, 0, 0, 0, 0, 0,0x3F67, +0x3F68, 0, 0,0x3F69, 0, 0,0x3F6A, 0, + 0, 0, 0,0x3F6B,0x3F6C,0x3F6D,0x3F6E, 0, +0x3F6F, 0, 0, 0,0x3F70,0x3F71, 0, 0, +0x3F72, 0, 0, 0,0x3F73,0x3F74,0x3F75, 0, + 0, 0,0x3F76, 0, 0,0x3F77, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3F78, +0x3F79, 0, 0, 0, 0, 0,0x3F7A,0x3F7B, + 0, 0, 0,0x3F7C, 0, 0,0x3F7D,0x3F7E, + 0, 0,0x4021, 0, 0, 0,0x4022,0x4023, + 0,0x4024, 0, 0,0x4025, 0,0x4026, 0, + 0,0x4027, 0, 0,0x4028, 0, 0, 0, + 0, 0,0x4029, 0, 0, 0,0x402A,0x402B, + 0, 0, 0,0x402C,0x402D, 0, 0, 0, +0x402E, 0, 0, 0, 0, 0,0x402F, 0, +0x4030, 0, 0, 0, 0, 0, 0,0x4031, +0x4032,0x4033, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4034, + 0, 0, 0,0x4035, 0, 0, 0,0x4036, + 0, 0,0x4037, 0, 0, 0, 0, 0, +0x4038, 0, 0,0x4039, 0,0x403A,0x403B,0x403C, + 0, 0, 0, 0, 0, 0,0x403D, 0, + 0, 0,0x403E, 0, 0, 0, 0,0x403F, + 0, 0, 0, 0,0x4040, 0,0x4041, 0, + 0, 0, 0, 0,0x4042,0x4043, 0,0x4044, + 0, 0,0x4045,0x4046, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4047,0x4048, 0, 0, 0, + 0, 0,0x4049, 0,0x404A, 0,0x404B, 0, + 0, 0,0x404C, 0, 0, 0, 0, 0, +0x404D, 0,0x404E, 0,0x404F, 0,0x4050,0x4051, + 0, 0, 0,0x4052,0x4053, 0, 0, 0, + 0,0x4054,0x4055, 0, 0, 0, 0,0x4056, + 0, 0, 0, 0, 0, 0, 0,0x4057, + 0,0x4058, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4059, 0, 0, + 0,0x405A, 0,0x405B,0x405C,0x405D,0x405E, 0, + 0, 0, 0, 0,0x405F,0x4060,0x4061,0x4062, + 0,0x4063,0x4064,0x4065, 0,0x4066, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4067, + 0, 0, 0, 0, 0,0x4068,0x4069, 0, + 0, 0, 0, 0, 0,0x406A, 0,0x406B, + 0, 0, 0, 0, 0, 0, 0,0x406C, + 0,0x406D, 0, 0, 0, 0, 0, 0, + 0,0x406E,0x406F,0x4070, 0, 0, 0, 0, + 0, 0,0x4071,0x4072, 0,0x4073, 0,0x4074, + 0,0x4075, 0,0x4076, 0,0x4077, 0, 0, +0x4078, 0,0x4079, 0, 0, 0,0x407A, 0, + 0, 0, 0, 0, 0,0x407B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x407C, +0x407D,0x407E, 0, 0, 0, 0,0x4121, 0, + 0, 0, 0,0x4122,0x4123,0x4124,0x4125, 0, +0x4126, 0,0x4127,0x4128, 0, 0, 0,0x4129, + 0,0x412A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x412B,0x412C, + 0, 0, 0,0x412D,0x412E, 0, 0,0x412F, + 0, 0,0x4130, 0, 0, 0, 0,0x4131, + 0,0x4132, 0, 0, 0,0x4133, 0, 0, + 0,0x4134, 0,0x4135, 0, 0,0x4136, 0, + 0, 0,0x4137,0x4138,0x4139, 0, 0, 0, + 0,0x413A, 0, 0, 0,0x413B,0x413C, 0, +0x413D, 0, 0,0x413E, 0,0x413F, 0, 0, +0x4140,0x4141, 0, 0,0x4142, 0, 0, 0, +0x4143, 0, 0,0x4144, 0, 0, 0, 0, +0x4145, 0, 0,0x4146, 0, 0, 0, 0, + 0, 0, 0, 0,0x4147, 0,0x4148,0x4149, + 0, 0, 0, 0, 0,0x414A, 0, 0, + 0,0x414B, 0,0x414C, 0, 0, 0, 0, +0x7441, 0,0x414D, 0,0x414E, 0,0x414F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4150,0x4151, 0, 0, 0, 0, 0, + 0,0x4152, 0, 0, 0,0x4153, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4154, 0, 0,0x4155, + 0, 0, 0,0x4156, 0, 0, 0,0x4157, + 0, 0, 0, 0,0x4158, 0, 0, 0, + 0, 0, 0, 0,0x4159, 0, 0,0x415A, + 0, 0,0x415B, 0, 0, 0, 0,0x415C, + 0, 0,0x415D, 0, 0,0x415E, 0, 0, +0x415F, 0, 0, 0, 0, 0, 0, 0, +0x4160, 0, 0, 0,0x4161,0x4162,0x4163, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4164, 0, 0,0x4165, 0, 0, 0, + 0, 0,0x4166,0x4167, 0, 0, 0, 0, +0x4168, 0,0x4169, 0, 0, 0,0x416A, 0, +0x416B, 0,0x416C, 0, 0, 0, 0, 0, + 0,0x416D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x416E, 0,0x416F, 0,0x4170,0x4171, + 0, 0, 0,0x4172, 0, 0, 0, 0, +0x4173,0x4174,0x4175, 0, 0, 0,0x4176, 0, + 0, 0,0x4177,0x4178, 0, 0, 0,0x4179, + 0, 0, 0,0x417A,0x417B, 0, 0,0x417C, +0x417D, 0, 0, 0, 0, 0, 0,0x417E, +0x4221, 0, 0,0x4222,0x4223,0x4224,0x4225, 0, +0x4226, 0, 0,0x4227,0x4228,0x4229,0x422A, 0, +0x422B, 0,0x422C,0x422D, 0,0x422E, 0, 0, + 0,0x4230, 0,0x422F, 0,0x7442, 0, 0, + 0, 0,0x4231, 0, 0, 0, 0,0x4232, +0x4233, 0, 0, 0,0x4234, 0,0x4235, 0, +0x4237, 0, 0,0x4236, 0, 0, 0, 0, + 0,0x4238,0x4239,0x423A, 0,0x423B,0x423C, 0, + 0, 0,0x423D,0x423E, 0, 0, 0,0x7443, + 0, 0, 0, 0,0x4240,0x4241,0x4242, 0, + 0, 0, 0, 0, 0,0x4244, 0,0x4245, + 0,0x4247,0x4248,0x4249, 0,0x424A,0x424C, 0, +0x4243,0x4246,0x424B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x424D,0x424E,0x424F, + 0, 0,0x4250, 0,0x4251, 0, 0, 0, + 0, 0, 0,0x4252,0x4253,0x4254,0x4255, 0, + 0,0x4256,0x4257, 0, 0, 0,0x4258, 0, + 0, 0, 0, 0, 0, 0, 0,0x4259, + 0, 0, 0,0x425A,0x425B, 0, 0,0x425C, + 0, 0, 0, 0, 0,0x425D, 0, 0, + 0,0x425E,0x425F, 0,0x4260,0x4261, 0, 0, + 0, 0,0x4262, 0, 0, 0,0x4263, 0, +0x4264,0x4265, 0, 0, 0, 0,0x4266, 0, + 0, 0, 0, 0, 0,0x4267, 0, 0, + 0,0x4268, 0, 0, 0, 0, 0, 0, + 0, 0,0x4269, 0, 0,0x426A,0x426B, 0, +0x426C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x426D,0x423F, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x426E, + 0,0x426F, 0, 0, 0, 0, 0, 0, +0x4270, 0, 0, 0, 0,0x4271, 0, 0, + 0, 0, 0,0x4272, 0, 0,0x4273, 0, + 0, 0,0x4274, 0,0x4275, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4276, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4277, 0, 0, 0, 0, 0, 0,0x4278, + 0,0x4279,0x427A, 0, 0, 0,0x427B, 0, + 0, 0, 0, 0, 0, 0,0x427C,0x427D, + 0, 0, 0, 0, 0, 0, 0,0x427E, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4321, 0, 0, 0, 0, 0,0x4322, 0, +0x4323, 0, 0, 0, 0, 0,0x4324, 0, +0x4325, 0, 0, 0, 0,0x4326, 0, 0, + 0, 0, 0,0x4327, 0, 0,0x4328, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4329,0x432A, 0,0x432B, 0,0x432C, 0, 0, +0x432D, 0,0x432E,0x432F, 0,0x4330}; + +/* page 20 0x67B0-0x6801 */ +static uint16 tab_uni_jisx021220[]={ +0x4331,0x4332,0x4333, 0, 0,0x4334, 0, 0, + 0, 0, 0,0x4335,0x4336,0x4337, 0, 0, +0x4339, 0,0x433A,0x433B, 0,0x433C, 0, 0, +0x433D,0x433E, 0, 0, 0, 0, 0, 0, + 0, 0,0x433F, 0, 0, 0, 0,0x4340, + 0,0x4341, 0, 0,0x4342, 0, 0, 0, + 0,0x4343, 0, 0, 0, 0,0x4344, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4345, 0,0x4346, 0, 0, 0,0x4347,0x4348, + 0,0x4338, 0, 0, 0, 0, 0, 0, + 0,0x7446}; + +/* page 21 0x6814-0x6917 */ +static uint16 tab_uni_jisx021221[]={ +0x434A, 0, 0, 0, 0,0x434B, 0, 0, + 0,0x434C, 0,0x434D, 0, 0, 0, 0, + 0, 0, 0,0x434F,0x434E, 0, 0, 0, +0x4350,0x4351, 0,0x4352,0x4353,0x4354, 0,0x4355, + 0, 0, 0, 0, 0, 0, 0,0x4356, + 0, 0, 0,0x4357, 0, 0, 0, 0, +0x4358,0x4359, 0, 0, 0, 0,0x435A, 0, +0x435B, 0, 0, 0, 0, 0,0x4349, 0, + 0,0x435C, 0,0x435D,0x435E, 0, 0,0x435F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4360, + 0, 0,0x4361,0x4362,0x4363,0x4364,0x4365, 0, + 0,0x4366, 0, 0, 0,0x4367,0x4368,0x4369, +0x436A, 0, 0, 0, 0, 0,0x436B, 0, +0x436C, 0,0x436D, 0,0x436E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x436F, 0,0x4370, 0,0x4371, 0, +0x4372, 0, 0, 0, 0,0x4373, 0,0x4374, + 0,0x4375, 0, 0, 0,0x4376,0x4377, 0, + 0, 0,0x4378, 0, 0, 0,0x4379, 0, + 0, 0, 0, 0, 0, 0, 0,0x437A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x437B, 0, 0,0x437C, 0, 0, 0, +0x437D, 0, 0,0x437E,0x4421,0x4422, 0,0x4423, + 0, 0,0x4424, 0, 0,0x4425, 0, 0, +0x4426,0x4427, 0, 0, 0, 0, 0, 0, + 0,0x4428, 0, 0,0x4429, 0,0x442A,0x442B, +0x442C,0x442D, 0, 0,0x442E,0x442F, 0, 0, + 0,0x4430,0x4431, 0, 0, 0, 0,0x4432, +0x4433,0x4434, 0, 0, 0, 0, 0, 0, + 0, 0,0x4435, 0, 0,0x4436,0x4437, 0, + 0, 0, 0, 0,0x4438,0x4439, 0,0x443A, + 0, 0,0x443B,0x443C}; + +/* page 22 0x6931-0x6D3F */ +static uint16 tab_uni_jisx021222[]={ +0x443D, 0,0x443E, 0,0x443F, 0, 0,0x4440, + 0, 0,0x4441, 0, 0, 0, 0, 0, + 0,0x4442, 0, 0,0x4443, 0, 0, 0, +0x4444, 0, 0, 0, 0,0x4445, 0, 0, + 0, 0, 0, 0, 0, 0,0x4446, 0, + 0, 0,0x4447, 0, 0, 0, 0, 0, + 0, 0,0x4448,0x4449,0x444A,0x444B, 0,0x444C, +0x444D, 0, 0,0x444E, 0, 0, 0,0x444F, +0x4450,0x4451, 0, 0, 0, 0, 0, 0, + 0,0x4452,0x4453, 0, 0, 0,0x4454,0x4455, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4456, 0, 0, 0, + 0,0x4457, 0, 0, 0,0x4458, 0,0x4459, + 0, 0, 0, 0, 0, 0, 0, 0, +0x445A, 0, 0, 0,0x445B,0x445C, 0,0x445D, + 0, 0,0x445E, 0,0x445F, 0,0x4460, 0, + 0, 0, 0, 0, 0, 0,0x4461,0x4462, + 0,0x4463, 0,0x4464, 0, 0, 0, 0, + 0, 0, 0, 0,0x4465, 0, 0,0x4466, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4467, 0, 0, 0, 0,0x4468,0x4469, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x446A, 0, 0,0x446B, 0, 0, 0, + 0, 0, 0, 0, 0,0x446C,0x446D, 0, +0x446E, 0,0x446F, 0,0x4470, 0, 0, 0, + 0, 0, 0, 0, 0,0x4471, 0,0x4472, +0x4473, 0,0x4474, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4475, 0, +0x4476, 0, 0, 0,0x4477, 0, 0, 0, + 0,0x4478, 0, 0,0x4479, 0, 0,0x447A, + 0, 0, 0,0x447B, 0, 0, 0,0x447C, + 0, 0, 0, 0, 0, 0, 0,0x447D, + 0,0x447E, 0,0x4521, 0, 0,0x4522, 0, + 0, 0,0x4523, 0, 0,0x4524,0x4525, 0, + 0, 0, 0, 0,0x4526,0x4527, 0, 0, +0x4528,0x4529, 0, 0, 0,0x452A, 0,0x452B, +0x452C,0x452D, 0, 0,0x452E,0x452F, 0, 0, + 0, 0,0x4530, 0, 0, 0, 0, 0, + 0, 0, 0,0x4531, 0, 0,0x4532, 0, + 0,0x4533,0x7449, 0, 0, 0, 0, 0, +0x4534, 0,0x4535, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4536, 0, 0, +0x4537, 0,0x4538, 0, 0,0x4539,0x453A, 0, +0x453B, 0,0x453C, 0, 0, 0, 0, 0, +0x453D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x453E, 0,0x453F,0x4540,0x4541, 0, + 0, 0, 0, 0,0x4542, 0, 0, 0, + 0, 0,0x4543, 0, 0, 0,0x4544,0x4545, +0x4546, 0, 0,0x4547, 0, 0, 0, 0, + 0, 0, 0, 0,0x4548,0x4549,0x454A, 0, + 0, 0, 0, 0, 0,0x454B, 0,0x454D, +0x454C, 0, 0,0x454E, 0, 0, 0,0x454F, + 0, 0, 0,0x4550,0x4551,0x4552, 0, 0, + 0, 0, 0,0x4553,0x4554, 0, 0, 0, + 0,0x744A, 0,0x4555, 0, 0,0x4556, 0, + 0, 0, 0,0x4557, 0, 0, 0,0x4558, +0x4559,0x455A, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x455B,0x455C, 0, 0, 0, + 0,0x455D,0x455E, 0, 0,0x455F,0x4560, 0, +0x4561, 0, 0, 0, 0, 0,0x4562,0x4563, +0x4564, 0, 0, 0, 0, 0,0x4565, 0, + 0, 0,0x4566, 0, 0,0x4567, 0, 0, + 0, 0, 0,0x4568, 0, 0, 0,0x4569, + 0, 0,0x456A,0x456B, 0, 0,0x456C, 0, + 0, 0, 0, 0,0x456D,0x456E, 0, 0, + 0, 0,0x456F, 0, 0, 0,0x4570, 0, + 0, 0, 0, 0, 0,0x4571, 0, 0, + 0,0x4572, 0, 0,0x4573, 0, 0, 0, + 0,0x4574, 0, 0, 0,0x4575, 0,0x4576, + 0, 0, 0, 0,0x4577, 0, 0,0x4578, + 0, 0, 0, 0, 0, 0,0x4579, 0, + 0, 0,0x457A, 0, 0,0x457B, 0,0x457C, + 0, 0, 0, 0,0x457D, 0, 0, 0, + 0, 0, 0, 0,0x457E,0x4621, 0, 0, + 0,0x4622, 0, 0,0x4623, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4624, 0, + 0, 0,0x4625, 0, 0, 0,0x4626,0x4627, + 0,0x4628,0x4629, 0, 0, 0, 0,0x462A, +0x462B, 0, 0,0x462C,0x462D,0x462E, 0,0x462F, + 0, 0, 0, 0, 0, 0, 0,0x4630, +0x4631, 0, 0, 0,0x4632,0x4633, 0, 0, + 0, 0,0x4634,0x4635, 0, 0, 0, 0, +0x4636, 0, 0,0x4637, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4638, 0, 0, + 0,0x4639, 0, 0, 0, 0, 0, 0, +0x463A, 0,0x463B, 0, 0,0x463C,0x463D, 0, + 0, 0, 0, 0, 0,0x463E, 0, 0, +0x463F, 0, 0, 0, 0, 0,0x4640, 0, +0x4641, 0, 0, 0, 0, 0,0x4642, 0, + 0,0x4643, 0,0x4644,0x4645, 0, 0, 0, +0x4646, 0, 0, 0,0x4647,0x4648, 0,0x4649, + 0,0x464A, 0, 0, 0, 0, 0, 0, +0x464B, 0, 0, 0, 0, 0,0x464C, 0, + 0, 0, 0, 0, 0,0x464D,0x464E,0x464F, + 0, 0, 0,0x4650, 0,0x4651, 0, 0, + 0, 0,0x4652, 0,0x4653,0x4654, 0, 0, + 0,0x4655,0x4656, 0, 0, 0,0x4657, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4658,0x4659, 0,0x465A, 0,0x465B, 0, + 0,0x465C, 0,0x465D, 0, 0, 0, 0, +0x465E, 0,0x465F,0x4660, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4736, 0, + 0, 0,0x4661, 0,0x4662, 0,0x4663, 0, + 0, 0, 0,0x4664, 0,0x4665, 0,0x4666, +0x4667, 0,0x4668, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4669,0x466A,0x466B, 0, +0x466C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x466D,0x466E, 0,0x466F,0x4670, + 0, 0, 0,0x4671, 0, 0,0x4672, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4673, + 0,0x4674, 0,0x4675, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4676, 0, 0, 0,0x4677, 0, 0, + 0, 0, 0, 0,0x4678, 0,0x4679,0x467A, +0x467B,0x467C, 0,0x467D, 0,0x467E, 0, 0, + 0,0x4721, 0,0x4722, 0, 0, 0,0x4723, + 0, 0, 0, 0, 0, 0,0x4724, 0, +0x4725, 0,0x4726,0x4727, 0,0x4728, 0, 0, + 0,0x4729, 0,0x472A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x472B, 0, 0,0x472C, 0, + 0,0x472D, 0, 0, 0,0x472E,0x472F, 0, +0x4730, 0,0x4731, 0, 0, 0, 0, 0, + 0,0x4732, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4733,0x4734,0x4735, + 0, 0, 0, 0, 0,0x4737,0x4738, 0, +0x4739, 0, 0, 0, 0, 0, 0, 0, +0x473A, 0, 0,0x473B, 0, 0,0x473C}; + +/* page 23 0x6D57-0x6E04 */ +static uint16 tab_uni_jisx021223[]={ +0x473D, 0, 0, 0, 0, 0, 0,0x473E, +0x473F, 0,0x4740, 0, 0, 0,0x4741, 0, +0x4742, 0, 0, 0, 0, 0, 0, 0, +0x4743,0x4744, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4745, 0, 0, + 0, 0, 0,0x4746, 0, 0, 0, 0, +0x4747, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4748,0x4749, 0,0x474A, 0,0x474B, +0x474C,0x474D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x474E, 0,0x474F, 0, 0, + 0, 0, 0, 0, 0,0x4750, 0, 0, +0x4751, 0,0x4752, 0, 0, 0,0x4753, 0, +0x4754, 0, 0, 0, 0,0x4755, 0, 0, + 0,0x4756, 0,0x4757, 0, 0, 0,0x4758, +0x4759, 0, 0, 0, 0, 0, 0,0x475A, + 0, 0, 0, 0,0x475B, 0,0x475C, 0, +0x475D,0x475E, 0,0x475F, 0, 0,0x4760, 0, + 0, 0,0x4761, 0, 0, 0, 0, 0, +0x4762,0x4763, 0,0x744C, 0,0x4764, 0,0x4765, + 0,0x744B, 0, 0, 0,0x4766, 0, 0, + 0,0x4767, 0, 0, 0,0x4768}; + +/* page 24 0x6E1E-0x6ECF */ +static uint16 tab_uni_jisx021224[]={ +0x4769, 0, 0, 0,0x476A, 0, 0, 0, + 0,0x476B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x476C, 0, 0, 0, +0x476D, 0, 0,0x476E, 0,0x476F,0x4770, 0, + 0, 0, 0, 0, 0, 0,0x4771,0x4772, + 0, 0,0x4773,0x4774, 0,0x4775, 0, 0, + 0,0x4776, 0,0x4777,0x4778,0x4779,0x477A, 0, + 0,0x477B, 0, 0, 0, 0,0x477C,0x477D, +0x477E, 0, 0, 0,0x4821,0x4822, 0, 0, + 0, 0,0x4823, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4824, 0, 0, + 0, 0, 0, 0, 0,0x4825, 0,0x4826, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4827, + 0, 0, 0, 0, 0,0x4828, 0, 0, + 0, 0, 0,0x4829, 0, 0, 0, 0, + 0, 0,0x482A, 0, 0, 0, 0, 0, + 0,0x482B, 0, 0, 0, 0, 0,0x482C, +0x482D, 0, 0,0x482E, 0,0x482F, 0, 0, + 0, 0, 0, 0, 0,0x4830, 0, 0, + 0,0x4831,0x4832,0x4833, 0,0x4834, 0, 0, + 0,0x4835,0x4836, 0,0x4837, 0, 0,0x4838, +0x4839,0x483A}; + +/* page 25 0x6EEB-0x70E4 */ +static uint16 tab_uni_jisx021225[]={ +0x483B, 0,0x483C,0x483D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x483E, 0, +0x483F, 0,0x4840, 0, 0, 0, 0, 0, + 0,0x4841, 0, 0, 0,0x4842, 0,0x4843, + 0,0x4844,0x4845, 0, 0, 0, 0, 0, + 0, 0, 0,0x4846, 0,0x4847, 0,0x4848, +0x4849, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x484A, 0, 0,0x484B,0x484C, + 0, 0,0x4853, 0,0x484D,0x484E, 0, 0, +0x484F, 0, 0,0x4850, 0, 0, 0, 0, +0x4851,0x4852, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4854, 0,0x4855,0x4856, +0x4857, 0, 0, 0,0x4858, 0,0x4859,0x485A, + 0, 0,0x485B,0x485C, 0, 0,0x485D,0x485E, + 0, 0, 0, 0, 0,0x485F, 0, 0, + 0,0x4860, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4861,0x4862, 0, 0, 0, 0, +0x4863, 0, 0, 0,0x4864,0x4865, 0, 0, +0x4866,0x4867,0x4868, 0, 0,0x4869, 0,0x486A, +0x486B,0x486C, 0,0x486D, 0, 0, 0,0x486E, + 0, 0, 0, 0,0x486F,0x4870, 0, 0, + 0, 0,0x4871,0x4872,0x4873,0x4874, 0, 0, + 0, 0, 0,0x4875,0x4876,0x4877, 0, 0, + 0, 0,0x4878,0x4879, 0, 0, 0, 0, + 0,0x487A, 0, 0, 0, 0, 0, 0, + 0, 0,0x487B, 0,0x487C,0x487D, 0,0x487E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4921, + 0, 0, 0,0x4922, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4923,0x4924, 0, + 0, 0, 0, 0, 0,0x4925, 0, 0, + 0, 0,0x4926, 0, 0, 0,0x4927, 0, + 0,0x4928,0x4929, 0, 0,0x492A, 0, 0, + 0, 0,0x492B,0x492C,0x492D, 0, 0, 0, + 0, 0,0x492E, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x492F, 0, 0, 0, + 0, 0, 0, 0, 0,0x4930, 0, 0, +0x4931, 0, 0, 0, 0,0x744D, 0, 0, + 0, 0, 0, 0,0x4932, 0, 0, 0, + 0,0x4933, 0, 0,0x4934, 0,0x4935, 0, + 0,0x4936, 0, 0, 0, 0, 0, 0, +0x4937,0x4938, 0, 0, 0,0x4939,0x493A,0x493B, +0x493C, 0, 0,0x4941, 0, 0, 0, 0, + 0,0x493D,0x493E, 0, 0, 0, 0, 0, + 0, 0,0x493F,0x4940, 0, 0, 0, 0, + 0,0x4942,0x4943, 0, 0, 0, 0, 0, + 0,0x4944, 0,0x4945, 0, 0, 0, 0, + 0, 0,0x4946,0x4947, 0, 0, 0, 0, + 0, 0, 0,0x4948, 0, 0,0x4949, 0, + 0, 0,0x494A,0x494B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x494C,0x494D,0x494E,0x494F,0x4950, 0, 0, +0x4951, 0, 0, 0, 0, 0, 0, 0, + 0,0x4952, 0, 0, 0, 0, 0, 0, +0x4953, 0, 0, 0, 0,0x4954,0x4955, 0, + 0,0x4956, 0, 0,0x4957, 0, 0, 0, +0x742E, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4958, + 0, 0, 0, 0, 0, 0,0x4959, 0, +0x495A,0x495B,0x495C,0x495D, 0,0x495E, 0, 0, + 0,0x495F, 0, 0, 0, 0, 0, 0, + 0,0x4960}; + +/* page 26 0x70FA-0x71DC */ +static uint16 tab_uni_jisx021226[]={ +0x4961, 0, 0, 0, 0, 0, 0, 0, + 0,0x4962,0x4963,0x4964,0x4965,0x4966, 0, 0, + 0,0x4967,0x4968, 0, 0,0x4969, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x496A, 0,0x496B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x496C, 0,0x496D, 0,0x496E,0x496F,0x4970, + 0, 0, 0, 0, 0, 0,0x4971, 0, + 0, 0, 0, 0, 0, 0, 0,0x4972, + 0, 0, 0,0x4973,0x4974,0x4975, 0, 0, +0x4976,0x4977, 0, 0, 0, 0,0x4978, 0, +0x4979, 0, 0, 0, 0,0x497A, 0, 0, +0x497B, 0,0x497C, 0,0x497D, 0,0x497E, 0, + 0, 0, 0, 0, 0, 0,0x4A21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4A22, + 0, 0, 0, 0, 0, 0,0x4A23, 0, + 0, 0, 0,0x4A24, 0,0x4A25, 0, 0, + 0, 0,0x4A26, 0, 0, 0, 0, 0, +0x4A27, 0, 0, 0, 0, 0, 0, 0, +0x4A28,0x4A29, 0, 0, 0, 0,0x4A2A, 0, +0x4A2B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4A2C,0x4A2D, 0, +0x4A2E,0x4A2F, 0, 0, 0, 0, 0, 0, +0x4A30, 0, 0, 0, 0,0x4A31,0x4A32,0x4A33, + 0, 0,0x4A34, 0, 0, 0, 0, 0, + 0,0x4A35,0x4A36, 0, 0, 0, 0, 0, + 0,0x4A37, 0, 0,0x4A38, 0, 0,0x4A39, +0x4A3A, 0,0x4A3B}; + +/* page 27 0x71F8-0x7E9E */ +static uint16 tab_uni_jisx021227[]={ +0x4A3C, 0, 0, 0, 0, 0,0x4A3D, 0, +0x4A3E, 0, 0, 0, 0, 0, 0,0x4A3F, +0x4A40,0x4A41, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4A42, 0, 0, 0,0x4A43, + 0, 0,0x4A44, 0, 0,0x4A45, 0,0x4A46, + 0, 0, 0, 0,0x4A47, 0, 0, 0, + 0, 0, 0,0x4A48, 0, 0, 0,0x4A49, + 0, 0, 0, 0,0x4A4A, 0, 0, 0, +0x4A4B,0x4A4C, 0, 0, 0, 0, 0, 0, + 0,0x4A4D,0x4A4E,0x4A4F, 0,0x4A50, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A51,0x4A52, +0x4A53, 0, 0,0x4A54, 0,0x4A55,0x4A56, 0, + 0, 0,0x4A57, 0,0x4A58, 0,0x4A59, 0, +0x4A5A, 0, 0,0x4A5B, 0, 0, 0, 0, +0x4A5C, 0, 0,0x4A5D, 0, 0,0x4A5E,0x4A5F, + 0,0x4A60, 0, 0, 0, 0, 0,0x4A61, +0x4A62, 0, 0,0x4A63,0x4A64, 0, 0,0x4A65, + 0, 0, 0, 0,0x4A66, 0, 0, 0, + 0,0x4A67, 0, 0, 0,0x4A68,0x4A69, 0, + 0, 0, 0,0x4A6A, 0, 0, 0, 0, + 0, 0, 0,0x4A6B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4A6C, 0, 0, 0, 0,0x4A6D,0x4A6E, 0, + 0,0x4A6F, 0, 0,0x4A70, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A71, 0, + 0,0x4A72, 0, 0, 0, 0, 0,0x4A73, + 0,0x4A74, 0, 0,0x4A75, 0, 0, 0, + 0, 0, 0, 0, 0,0x4A76,0x4A77, 0, +0x4A78, 0, 0, 0, 0, 0, 0,0x4A79, + 0, 0, 0, 0, 0,0x4A7A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4A7B,0x4A7C, 0, 0, 0, + 0, 0,0x4A7D,0x4A7E, 0, 0,0x4B21, 0, + 0, 0,0x4B22, 0,0x4B23,0x4B24, 0,0x4B25, + 0, 0, 0,0x4B26, 0,0x4B27, 0, 0, + 0, 0,0x4B28,0x4B29, 0, 0, 0, 0, +0x4B2A,0x4B2B, 0, 0, 0, 0,0x4B2C, 0, + 0, 0,0x4B2D, 0,0x4B2E, 0, 0,0x4B2F, +0x4B30, 0, 0, 0,0x4B31, 0, 0, 0, + 0,0x4B32,0x4B33, 0, 0,0x4B34, 0, 0, + 0, 0,0x4B35,0x4B36, 0,0x4B37, 0, 0, + 0, 0, 0,0x4B38, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4B39, 0, 0, +0x4B3A, 0,0x4B3B, 0, 0, 0,0x4B3C, 0, +0x4B3D, 0, 0, 0, 0,0x4B3E,0x4B3F,0x4B40, +0x4B41, 0, 0, 0, 0, 0,0x4B42,0x4B43, + 0,0x4B44, 0,0x4B45,0x4B46, 0,0x4B47,0x4B48, + 0,0x4B49, 0, 0, 0, 0, 0,0x4B4A, + 0,0x4B4B, 0, 0,0x4B4C, 0, 0, 0, +0x4B4D,0x4B4E, 0,0x4B4F, 0,0x4B50,0x4B51, 0, + 0, 0, 0, 0, 0, 0,0x4B52, 0, +0x4B53, 0, 0,0x4B54, 0,0x4B55, 0,0x4B56, +0x4B57, 0, 0, 0,0x4B58, 0,0x4B59,0x4B5A, +0x4B5B, 0,0x4B5C, 0, 0,0x4B5D,0x4B5E, 0, + 0, 0,0x4B5F,0x4B60, 0,0x4B61, 0, 0, + 0, 0, 0, 0, 0,0x4B62, 0,0x4B63, + 0,0x4B64, 0, 0,0x4B65,0x4B66, 0,0x4B67, + 0, 0, 0, 0, 0,0x4B68,0x4B69, 0, + 0,0x4B6A, 0,0x4B6B,0x4B6C, 0, 0,0x4B6D, + 0, 0,0x4B6E,0x4B6F, 0, 0,0x4B70, 0, + 0,0x4B71, 0, 0, 0,0x4B72, 0, 0, + 0,0x4B73, 0,0x4B74, 0, 0,0x4B75,0x4B76, + 0,0x4B77, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4B78,0x4B79, 0,0x4B7A, + 0,0x4B7B,0x4B7C,0x4B7D, 0,0x4B7E, 0,0x4C21, +0x4C22,0x4C23, 0, 0,0x4C24, 0, 0,0x4C25, + 0, 0,0x4C26, 0, 0, 0, 0, 0, + 0,0x4C27, 0, 0, 0, 0, 0, 0, + 0, 0,0x4C28,0x4C29, 0, 0, 0, 0, + 0, 0, 0, 0,0x4C2A, 0,0x4C2B, 0, +0x4C2C,0x4C2D,0x4C2E,0x4C2F,0x4C30,0x4C31,0x4C32,0x4C33, +0x4C34,0x4C35, 0, 0, 0, 0, 0, 0, + 0,0x4C36, 0, 0, 0, 0, 0, 0, +0x4C37, 0, 0,0x4C38,0x4C39, 0,0x4C3A,0x4C3B, + 0, 0, 0,0x4C3C, 0,0x4C3D, 0, 0, + 0,0x4C3E,0x4C3F, 0, 0, 0, 0,0x4C40, + 0, 0, 0, 0, 0,0x4C41, 0, 0, + 0, 0,0x4C42, 0, 0, 0,0x4C43,0x4C44, +0x4C45, 0, 0,0x4C46, 0,0x4C47,0x4C48, 0, + 0,0x4C49,0x4C4A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4C4B,0x4C4C, 0, 0, 0,0x4C4D,0x4C4E,0x4C4F, + 0,0x4C50, 0, 0, 0, 0, 0,0x4C51, +0x4C52,0x4C53,0x4C54, 0, 0, 0, 0, 0, +0x4C55,0x4C56,0x4C57, 0,0x4C58, 0, 0,0x4C59, +0x4C5A,0x4C5B, 0,0x4C5C, 0, 0,0x4C5D, 0, +0x4C5E,0x4C5F,0x4C60,0x4C61, 0, 0,0x4C62,0x4C63, + 0,0x4C64,0x4C65, 0, 0,0x4C66, 0, 0, + 0,0x4C67, 0,0x4C68, 0, 0, 0,0x4C69, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4C6A,0x4C6B, 0, 0,0x4C6C, 0, 0, 0, +0x4C6D, 0, 0,0x4C6E, 0, 0, 0, 0, +0x4C6F, 0,0x4C70,0x4C71, 0, 0,0x4C72,0x4C73, + 0, 0, 0, 0,0x4C74, 0, 0, 0, +0x4C75, 0,0x4C76,0x4C77, 0, 0, 0,0x4C78, + 0, 0, 0, 0,0x4C79, 0, 0, 0, + 0, 0,0x4C7A,0x4C7B,0x4C7C, 0, 0,0x4C7D, + 0,0x7450, 0, 0, 0, 0,0x4C7E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D21, 0, 0, 0,0x4D22,0x4D23, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4D24,0x4D25, 0, 0,0x4D26, 0, 0,0x4D27, + 0,0x4D28,0x4D29, 0, 0, 0, 0,0x4D2A, + 0, 0, 0, 0, 0, 0,0x4D2B, 0, + 0,0x4D2C, 0, 0, 0,0x4D2D,0x4D2E,0x4D2F, +0x4D30, 0, 0,0x4D31, 0, 0, 0,0x4D32, +0x4D33, 0, 0, 0, 0, 0,0x4D34, 0, +0x4D35, 0,0x4D36, 0, 0, 0, 0,0x4D37, + 0, 0, 0, 0, 0, 0,0x4D38,0x4D39, + 0,0x4D3A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4D3B, + 0,0x4D3C, 0, 0, 0, 0, 0, 0, + 0,0x4D3D,0x4D3E,0x4D3F,0x4D40,0x4D41,0x4D42, 0, + 0,0x4D43, 0, 0, 0,0x4D44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4D45, 0,0x4D46,0x4D47, 0,0x4D48, 0, 0, + 0,0x4D49, 0, 0,0x4D4A, 0, 0, 0, + 0, 0,0x4D4B, 0,0x4D4C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4D4D, 0, 0, 0, + 0, 0,0x4D4E, 0, 0, 0, 0,0x4D4F, +0x4D50,0x4D51, 0, 0,0x4D52, 0,0x4D53, 0, + 0, 0, 0, 0,0x4D54, 0,0x4D55,0x4D56, + 0, 0, 0, 0, 0, 0, 0,0x4D57, + 0, 0, 0, 0,0x4D58, 0, 0,0x4D59, +0x4D5A,0x4D5B, 0, 0,0x4D5C, 0, 0,0x4D5D, + 0, 0, 0, 0,0x4D5E, 0,0x4D5F,0x4D60, + 0,0x4D61, 0, 0, 0, 0, 0, 0, + 0,0x4D62, 0, 0, 0, 0, 0, 0, +0x4D63, 0,0x4D64,0x4D65,0x4D66, 0, 0,0x4D67, +0x4D68, 0,0x4D69, 0,0x4D6A, 0, 0,0x4D6B, + 0, 0,0x4D6C,0x4D6D, 0,0x4D6E,0x4D6F, 0, + 0,0x4D70, 0,0x4D71,0x4D72,0x4D73,0x4D74, 0, + 0, 0, 0,0x4D75, 0,0x4D76,0x4D77, 0, + 0,0x4D78, 0, 0, 0,0x4D79, 0, 0, + 0, 0,0x4D7A,0x4D7B, 0,0x4D7C, 0, 0, +0x4D7D,0x4D7E,0x4E21, 0,0x4E22, 0, 0, 0, +0x4E24,0x4E25, 0,0x4E26,0x4E27,0x4E28, 0, 0, + 0,0x4E29,0x4E23,0x4E2A, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4E2B, 0, 0, + 0,0x4E2C, 0, 0, 0, 0, 0,0x4E2D, + 0, 0, 0, 0,0x4E2E,0x4E2F, 0, 0, + 0, 0, 0, 0, 0,0x4E30,0x4E31,0x4E32, + 0,0x4E33, 0, 0,0x4E34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4E35,0x7451, 0, 0,0x4E36, 0, 0, + 0, 0, 0, 0,0x4E37,0x4E38, 0, 0, + 0, 0, 0, 0, 0,0x4E39, 0, 0, + 0, 0, 0,0x4E3A,0x4E3B,0x4E3C,0x7452,0x4E3D, +0x4E3E, 0,0x4E3F,0x4E40,0x4E41,0x4E42,0x4E43,0x4E44, +0x4E45, 0,0x4E46, 0, 0,0x4E47, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4E48, 0, 0, + 0,0x4E49, 0, 0, 0,0x4E4A, 0, 0, + 0,0x4E4B, 0,0x4E4C,0x4E4D, 0,0x4E4E, 0, + 0, 0, 0, 0,0x4E4F, 0, 0, 0, + 0,0x4E50, 0, 0, 0, 0, 0, 0, +0x4E51, 0, 0, 0, 0, 0,0x4E52, 0, +0x4E53, 0, 0, 0,0x4E54, 0, 0, 0, +0x4E55,0x4E56, 0, 0, 0, 0,0x4E57, 0, + 0,0x4E58, 0, 0,0x4E59, 0, 0, 0, +0x4E5A, 0, 0, 0, 0, 0,0x4E5B, 0, + 0, 0,0x4E5C, 0, 0, 0,0x4E5D, 0, + 0, 0,0x4E5E, 0,0x4E5F,0x4E60, 0,0x4E61, + 0,0x4E62,0x4E63, 0,0x4E64, 0, 0, 0, + 0, 0,0x4E65, 0, 0, 0, 0, 0, +0x4E66, 0, 0, 0, 0,0x4E67,0x4E68,0x4E69, + 0, 0, 0, 0,0x4E6A,0x4E6B,0x4E6C, 0, + 0,0x4E6D, 0, 0, 0,0x4E6E,0x4E6F, 0, + 0, 0,0x4E70, 0, 0,0x4E71,0x4E72, 0, + 0, 0,0x4E73, 0, 0,0x4E74,0x4E75,0x4E76, + 0, 0,0x4E77, 0, 0, 0,0x4E78,0x4E79, + 0, 0, 0, 0,0x4E7A, 0,0x4E7B,0x4E7C, +0x4E7D, 0,0x4E7E, 0,0x4F21, 0, 0,0x4F22, + 0, 0,0x4F23, 0,0x4F24, 0, 0, 0, +0x4F25, 0,0x4F26,0x4F27,0x4F28, 0, 0, 0, + 0, 0,0x4F29, 0, 0,0x4F2A, 0, 0, +0x4F2B, 0, 0, 0,0x4F2C, 0, 0, 0, + 0, 0, 0, 0,0x4F2D,0x4F2E, 0, 0, + 0, 0, 0, 0,0x4F2F,0x4F30,0x4F31, 0, + 0, 0,0x4F32, 0, 0, 0, 0,0x4F33, + 0, 0,0x4F34, 0, 0, 0, 0,0x4F35, + 0, 0,0x4F36, 0, 0, 0,0x4F37,0x4F38, + 0,0x4F39, 0, 0, 0,0x4F3A, 0, 0, + 0, 0, 0, 0, 0, 0,0x4F3B, 0, + 0, 0, 0,0x4F3C, 0, 0, 0, 0, + 0,0x4F3D, 0, 0, 0, 0, 0, 0, + 0,0x4F3E,0x4F3F, 0, 0,0x4F40, 0, 0, + 0,0x4F41, 0, 0, 0, 0,0x4F42,0x4F43, +0x4F44, 0, 0, 0,0x4F45, 0,0x4F46, 0, + 0, 0,0x4F47, 0,0x4F48, 0, 0, 0, +0x4F49,0x4F4A, 0, 0,0x4F4B, 0, 0, 0, +0x4F4C, 0, 0,0x4F4D, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4F4E,0x4F4F, 0, + 0,0x4F50, 0, 0, 0,0x4F51,0x4F52, 0, + 0,0x4F53, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4F54, 0, 0, + 0,0x4F55,0x4F56,0x4F57, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4F58,0x4F59, 0, +0x4F5A, 0, 0, 0, 0,0x4F5B, 0,0x4F5C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4F5D,0x4F5E, 0, 0,0x4F5F, +0x4F60, 0, 0, 0,0x4F61, 0,0x4F62, 0, + 0, 0,0x4F63, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4F64, 0,0x4F65, 0, +0x4F66,0x4F67, 0,0x4F68,0x4F69, 0, 0, 0, +0x4F6A, 0,0x4F6B, 0, 0, 0,0x4F6C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4F6D, 0, 0, 0,0x4F6E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4F6F, 0, 0, 0, 0,0x4F70, + 0, 0, 0, 0,0x4F71, 0, 0, 0, +0x4F72, 0, 0, 0, 0,0x4F74,0x4F75,0x4F76, + 0,0x4F73, 0, 0,0x4F77, 0, 0, 0, +0x4F78, 0, 0, 0,0x4F79,0x4F7A, 0, 0, +0x4F7B,0x4F7C,0x4F7D,0x4F7E, 0, 0, 0, 0, + 0, 0, 0,0x5021, 0,0x5022, 0,0x5023, + 0, 0, 0, 0, 0, 0, 0,0x5024, +0x5025,0x5026, 0, 0,0x5027, 0,0x5028, 0, + 0, 0,0x5029,0x502A, 0,0x502B,0x502C, 0, + 0, 0, 0,0x502E, 0, 0, 0,0x502F, +0x5030,0x5031, 0, 0,0x502D, 0,0x5032, 0, + 0, 0,0x5033, 0, 0, 0, 0, 0, + 0, 0,0x5034,0x5035, 0, 0,0x5037,0x5038, + 0, 0,0x5039,0x503A, 0, 0, 0,0x503B, +0x5036, 0, 0, 0, 0, 0,0x503C, 0, + 0, 0, 0, 0,0x503D, 0, 0, 0, +0x503E, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x503F, 0,0x5040, 0,0x5041,0x5042, +0x5043, 0, 0, 0, 0,0x5044, 0,0x5045, + 0,0x5046, 0, 0, 0,0x5047, 0, 0, +0x7454,0x5048, 0, 0,0x5049,0x504A, 0, 0, + 0, 0, 0,0x504B, 0,0x504C, 0,0x504D, + 0, 0, 0, 0,0x504E,0x504F,0x5050, 0, + 0, 0,0x5051,0x5052, 0, 0, 0,0x5053, + 0,0x5054, 0, 0,0x5055, 0, 0, 0, +0x5056, 0, 0,0x5057,0x5058, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5059, + 0,0x505A, 0,0x505B, 0, 0, 0, 0, + 0, 0,0x505C, 0, 0, 0, 0, 0, + 0,0x505D, 0,0x505E,0x505F, 0,0x5060, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5061,0x5062, 0, 0, 0, + 0,0x5063, 0,0x5064,0x5065,0x5066,0x5067, 0, +0x5068, 0, 0,0x5069,0x506A, 0, 0, 0, + 0,0x506B, 0, 0, 0, 0, 0, 0, +0x506C,0x506D, 0,0x506E, 0, 0, 0,0x506F, + 0,0x5070, 0, 0,0x5071, 0, 0, 0, +0x5072, 0, 0,0x5073, 0, 0, 0, 0, + 0, 0,0x5074, 0,0x5075, 0, 0,0x5076, +0x5077, 0,0x5078, 0, 0, 0, 0,0x5079, + 0, 0, 0, 0,0x507A, 0,0x507B, 0, + 0, 0,0x507C, 0, 0,0x507D,0x507E, 0, +0x5121, 0,0x5122, 0, 0,0x5123, 0, 0, + 0, 0,0x5124,0x5125, 0,0x5126, 0, 0, + 0,0x5127, 0, 0, 0, 0, 0, 0, +0x5128, 0, 0, 0,0x5129, 0, 0, 0, + 0, 0,0x512A,0x512B, 0, 0, 0,0x512C, + 0,0x512D,0x512E, 0,0x512F, 0, 0, 0, + 0,0x5130, 0, 0, 0,0x5131, 0, 0, + 0, 0, 0,0x5132, 0, 0,0x5133, 0, + 0,0x5134, 0, 0, 0, 0, 0,0x5135, + 0, 0, 0,0x5136, 0,0x5137, 0,0x5138, +0x5139, 0, 0, 0,0x513A,0x513B, 0, 0, +0x513C,0x513D,0x513E, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x513F,0x5140, 0,0x5141, +0x5142, 0, 0, 0,0x5143, 0, 0, 0, + 0, 0, 0, 0, 0,0x5144,0x5145, 0, + 0,0x5146, 0, 0,0x5147,0x5148, 0,0x5149, +0x514A, 0, 0, 0, 0,0x514B, 0,0x514C, + 0, 0,0x514D, 0, 0,0x514E, 0, 0, + 0, 0, 0, 0, 0,0x514F, 0, 0, +0x5150, 0, 0, 0, 0, 0,0x5151, 0, +0x5152, 0,0x5153, 0, 0,0x5154,0x5155, 0, + 0, 0,0x5156,0x5157, 0, 0, 0, 0, +0x5158,0x5159, 0, 0,0x515A, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x515B, 0, +0x515C, 0, 0,0x515D, 0, 0, 0, 0, + 0, 0, 0, 0,0x515E, 0, 0, 0, + 0, 0, 0,0x515F, 0,0x5160, 0, 0, + 0,0x5161, 0,0x5162,0x5163, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5164, 0, + 0,0x5165, 0, 0,0x5166, 0,0x5167, 0, + 0,0x5168, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5169, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7459, +0x516A,0x516B, 0,0x516C,0x516D, 0, 0, 0, + 0,0x516E, 0, 0,0x516F, 0, 0, 0, + 0, 0, 0,0x5170, 0,0x5171,0x5172, 0, + 0, 0, 0, 0, 0, 0, 0,0x5173, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5174, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5175, + 0, 0, 0,0x5176, 0, 0, 0,0x5177, + 0,0x5178,0x5179,0x517A, 0,0x517B,0x517C,0x517D, +0x517E,0x5221, 0, 0,0x5222, 0, 0, 0, + 0, 0, 0, 0, 0,0x5223, 0,0x5224, +0x5225,0x5226, 0, 0, 0, 0, 0,0x5227, + 0, 0, 0, 0, 0, 0,0x5228, 0, + 0, 0, 0, 0, 0,0x5229, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x522A, 0, 0, 0,0x522B, 0,0x522C, 0, + 0,0x522D,0x522E, 0, 0,0x522F, 0,0x5230, + 0, 0,0x5231,0x5232, 0, 0, 0,0x5233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5234, 0, 0, 0, + 0,0x5235, 0, 0, 0, 0,0x5236, 0, +0x5237,0x5238, 0, 0, 0, 0,0x5239, 0, + 0, 0, 0,0x523A, 0, 0,0x523B, 0, +0x523C, 0, 0, 0, 0,0x523D, 0, 0, + 0, 0, 0, 0,0x523E, 0, 0,0x523F, +0x5240, 0,0x5241, 0, 0,0x5242,0x5243, 0, + 0, 0,0x5244,0x5245,0x5246,0x5247, 0, 0, + 0, 0,0x5248, 0, 0,0x5249, 0, 0, +0x524A, 0,0x524B, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x524C, 0,0x524D,0x524E, + 0,0x524F,0x5250,0x5251, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5252, 0,0x5253, 0, 0, 0, 0, 0, + 0, 0,0x5254, 0,0x5255,0x5256, 0, 0, +0x5257,0x5258,0x5259, 0,0x525A, 0,0x525B, 0, + 0,0x525C,0x525D,0x525E,0x525F, 0,0x5260, 0, + 0,0x5261, 0,0x5262,0x5263, 0,0x5264,0x5265, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5266, 0,0x5267, 0, 0, 0, 0, +0x5268, 0, 0, 0, 0,0x5269,0x526A, 0, +0x526B, 0, 0, 0,0x526C, 0, 0, 0, + 0,0x526D, 0,0x526E,0x526F, 0,0x5270, 0, + 0,0x5271,0x5272, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5273, 0, + 0, 0,0x5274, 0, 0, 0, 0, 0, + 0,0x5276,0x5277,0x5278, 0,0x5275, 0, 0, + 0,0x5279,0x527A,0x527B,0x527C,0x527D,0x527E, 0, + 0,0x5321, 0,0x5322, 0, 0, 0,0x5323, + 0,0x5324, 0, 0, 0,0x5325,0x5326, 0, +0x5327, 0,0x5328, 0, 0, 0, 0, 0, + 0,0x5329, 0, 0,0x532A,0x532B, 0, 0, + 0, 0, 0, 0, 0, 0,0x532C,0x532D, + 0, 0, 0, 0, 0, 0, 0,0x532E, + 0, 0, 0, 0,0x532F, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5330, 0, +0x5331, 0, 0, 0, 0, 0,0x5332, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5333, 0, 0, 0, 0, 0,0x5334,0x5335, + 0, 0,0x5336,0x5337,0x5338, 0, 0,0x5339, + 0, 0, 0, 0,0x533A, 0, 0,0x533B, +0x533C,0x533D, 0, 0, 0,0x533E, 0,0x533F, + 0, 0, 0,0x5340,0x5341,0x5342, 0,0x5343, + 0,0x5344,0x5345, 0, 0,0x5346, 0, 0, + 0, 0, 0, 0, 0, 0,0x5347, 0, + 0,0x5348, 0,0x5349, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x534A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x534B, 0, 0, 0,0x534C, +0x534D,0x534E, 0, 0, 0, 0, 0,0x534F, + 0,0x5350,0x5351,0x5352, 0, 0,0x5353, 0, + 0, 0, 0, 0, 0,0x5354,0x5355, 0, + 0, 0, 0,0x5356, 0, 0,0x5357, 0, + 0, 0,0x5358, 0, 0,0x5359, 0, 0, + 0,0x535A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x535B,0x535C,0x535D, 0, +0x535E,0x535F, 0, 0, 0, 0, 0,0x5360, +0x5361, 0, 0, 0, 0,0x5362, 0, 0, + 0,0x5363, 0,0x5364, 0, 0, 0,0x5365, + 0,0x5366,0x5367, 0,0x5368,0x5369, 0, 0, + 0, 0, 0, 0, 0,0x536A, 0,0x536B, + 0, 0,0x536C, 0, 0, 0, 0, 0, +0x536D, 0, 0, 0, 0, 0, 0, 0, +0x536E, 0,0x536F,0x5370, 0, 0, 0,0x5371, + 0,0x5372,0x5373,0x5374, 0,0x5375,0x5376, 0, +0x5377, 0, 0,0x5378,0x5379,0x537A, 0, 0, + 0,0x537B, 0, 0, 0, 0,0x537C,0x537D, + 0, 0, 0, 0, 0,0x537E,0x5421, 0, +0x745C, 0, 0, 0, 0, 0,0x5422,0x5423, + 0, 0,0x5424, 0, 0, 0, 0, 0, + 0, 0, 0,0x5425, 0, 0,0x5426,0x5427, + 0,0x5428, 0, 0, 0, 0, 0, 0, + 0, 0,0x5429,0x542A,0x542B,0x542C,0x542D, 0, + 0, 0, 0, 0,0x542E,0x542F,0x5430, 0, + 0, 0, 0, 0, 0, 0,0x745D,0x5431, + 0,0x5432, 0, 0, 0, 0, 0, 0, + 0, 0,0x5434, 0, 0,0x5435,0x5436, 0, + 0, 0,0x5437,0x5438, 0,0x5439, 0, 0, + 0,0x543A, 0, 0, 0,0x543B,0x543C, 0, + 0,0x543D,0x543E, 0, 0, 0, 0, 0, +0x5433, 0, 0, 0, 0, 0, 0, 0, +0x543F, 0, 0, 0, 0, 0, 0, 0, +0x5440,0x5441, 0, 0, 0,0x5442, 0,0x5443, + 0, 0, 0, 0,0x5444,0x5445, 0, 0, +0x5446, 0, 0, 0, 0, 0, 0,0x5447, +0x5448, 0, 0, 0,0x5449,0x544A, 0,0x544B, + 0, 0, 0,0x544C, 0, 0,0x544D, 0, + 0, 0, 0, 0, 0, 0, 0,0x544E, + 0, 0, 0, 0,0x544F,0x5450, 0,0x5451, + 0, 0, 0, 0, 0, 0,0x5452, 0, +0x5453, 0,0x5454, 0, 0, 0, 0, 0, +0x5455, 0, 0, 0, 0, 0, 0,0x5456, + 0,0x5457,0x5458, 0, 0,0x5459, 0, 0, + 0, 0, 0,0x545A, 0, 0,0x545B,0x545C, + 0, 0, 0,0x545D, 0, 0, 0, 0, +0x545E, 0, 0, 0, 0, 0,0x545F, 0, + 0,0x5460, 0, 0, 0, 0,0x5461,0x5462, + 0, 0,0x5463, 0, 0,0x5464, 0, 0, + 0,0x5465, 0, 0, 0,0x5466, 0, 0, +0x5467, 0,0x5468, 0, 0,0x5469,0x546A}; + +/* page 28 0x7F3B-0x8044 */ +static uint16 tab_uni_jisx021228[]={ +0x546C,0x546B,0x546D,0x546E,0x546F, 0, 0, 0, +0x5470,0x5471, 0, 0,0x5472, 0, 0, 0, + 0, 0, 0, 0,0x5473, 0, 0,0x5474, +0x5475, 0, 0, 0, 0, 0, 0, 0, +0x5476,0x5477,0x5478, 0, 0, 0,0x5479, 0, +0x547A,0x547B,0x547C,0x547D, 0, 0, 0, 0, + 0, 0,0x547E, 0, 0, 0,0x5521, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5522,0x5523,0x5524,0x5525, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5526, 0,0x5527, 0,0x5528,0x5529,0x552A, 0, + 0, 0, 0,0x552B,0x552C, 0, 0, 0, + 0,0x552D, 0, 0, 0, 0,0x552E,0x552F, + 0, 0, 0,0x5530, 0, 0, 0,0x5531, + 0, 0,0x5532, 0, 0, 0, 0, 0, + 0,0x5533, 0, 0, 0, 0, 0, 0, + 0,0x5534, 0, 0,0x5535,0x5536, 0, 0, +0x5537, 0, 0, 0, 0,0x5538, 0, 0, + 0, 0, 0,0x5539,0x553A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x553B, 0, 0, 0,0x553C, 0, 0, 0, +0x553D, 0,0x553E, 0, 0,0x553F, 0, 0, + 0,0x5540, 0,0x5541,0x5542, 0, 0,0x5543, + 0, 0, 0, 0, 0, 0, 0,0x5544, + 0, 0,0x5545,0x5546,0x5547, 0, 0, 0, + 0, 0, 0, 0,0x5548,0x5549, 0,0x554A, + 0, 0,0x554B,0x554C,0x554D, 0,0x554E, 0, +0x554F,0x5550, 0,0x5551, 0, 0, 0, 0, + 0, 0,0x5552,0x5553,0x5554,0x5555, 0, 0, + 0,0x5556, 0,0x5557, 0, 0, 0, 0, + 0,0x5558, 0,0x5559, 0,0x555A, 0, 0, + 0,0x555B,0x555C, 0,0x555D, 0,0x555E,0x555F, + 0,0x5560, 0,0x5561, 0,0x5562, 0, 0, + 0,0x5563}; + +/* page 29 0x8060-0x8362 */ +static uint16 tab_uni_jisx021229[]={ +0x5564, 0, 0, 0,0x5565, 0,0x5566, 0, + 0, 0, 0, 0, 0,0x5567, 0, 0, + 0,0x5568, 0, 0, 0,0x5569, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x556A, 0, 0, 0, 0, 0, 0, +0x556B, 0, 0, 0, 0, 0,0x556C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x556D, 0,0x556E, 0, + 0, 0, 0, 0, 0, 0,0x556F,0x5570, + 0, 0, 0,0x5571, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5572,0x5573, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5574, 0, 0, 0, 0,0x5575, 0,0x5576, + 0, 0,0x5577, 0,0x5578,0x5579, 0,0x557A, +0x557B, 0, 0, 0, 0, 0, 0, 0, +0x557C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x557D,0x557E, 0, +0x5621, 0,0x5622,0x5623, 0, 0,0x5624, 0, + 0,0x5625,0x5626, 0, 0, 0,0x5627, 0, + 0, 0, 0,0x5628, 0, 0, 0, 0, + 0, 0, 0,0x5629, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x562A,0x562B, +0x562C, 0, 0, 0,0x562D, 0,0x562E, 0, +0x562F, 0, 0, 0,0x5630, 0, 0,0x5631, + 0, 0, 0, 0,0x5632, 0, 0, 0, +0x5633, 0, 0, 0, 0,0x5634, 0, 0, + 0, 0,0x5635, 0,0x5636, 0, 0, 0, + 0, 0, 0, 0, 0,0x5637, 0,0x5638, + 0, 0,0x5639, 0,0x563A, 0, 0, 0, + 0, 0,0x563B, 0, 0, 0, 0,0x563C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x563D,0x563E, 0, 0, 0, 0, 0,0x563F, +0x5640,0x5641, 0, 0, 0,0x5642, 0,0x5643, + 0, 0, 0, 0, 0, 0, 0,0x5644, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5645, 0, 0,0x5647,0x5648,0x5649, 0, + 0, 0, 0,0x564A, 0, 0,0x564B, 0, +0x5646, 0, 0, 0, 0, 0,0x564C, 0, +0x564D, 0, 0,0x564E, 0, 0,0x564F, 0, + 0, 0,0x5650, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5651, 0, + 0, 0,0x5652, 0,0x5653, 0, 0, 0, + 0, 0, 0,0x5654, 0, 0, 0, 0, + 0, 0, 0,0x5656, 0,0x5657, 0, 0, + 0, 0,0x5658,0x5655, 0, 0,0x5659,0x565A, + 0, 0, 0, 0, 0,0x565B, 0,0x565C, + 0, 0, 0,0x565D, 0,0x565E,0x565F, 0, + 0,0x5660, 0, 0,0x5661, 0, 0, 0, + 0, 0, 0,0x5662,0x5663, 0, 0, 0, +0x5664,0x5665,0x5666, 0, 0,0x5667,0x5668, 0, +0x5669,0x566A, 0, 0, 0,0x566B, 0,0x566C, +0x566D, 0, 0,0x566E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x566F, + 0, 0, 0,0x5670,0x5671, 0, 0, 0, + 0,0x5672,0x5673, 0, 0,0x5674, 0, 0, + 0,0x5675,0x5676, 0, 0, 0, 0, 0, +0x5677, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5678, 0,0x5679, 0, 0, 0, + 0, 0,0x567A, 0, 0, 0, 0, 0, + 0, 0, 0,0x567B,0x567C,0x567D,0x567E, 0, + 0, 0, 0,0x5721, 0, 0,0x5722,0x5723, + 0,0x5724, 0, 0, 0, 0,0x5725, 0, + 0, 0, 0, 0,0x5726, 0, 0, 0, +0x5727, 0, 0,0x5728, 0, 0, 0,0x5729, + 0, 0, 0, 0, 0,0x572A, 0, 0, + 0, 0, 0, 0,0x572B, 0, 0, 0, + 0, 0, 0,0x572C, 0,0x572D, 0,0x572E, +0x572F,0x5730, 0,0x5731,0x5732, 0, 0,0x5733, + 0,0x5734,0x5735, 0, 0, 0,0x5736, 0, + 0,0x5737, 0, 0,0x5738, 0,0x5739, 0, +0x573A, 0,0x573B,0x573C, 0, 0, 0, 0, +0x573D,0x573E, 0,0x573F,0x5740, 0, 0,0x5741, +0x5742,0x5743,0x5744, 0, 0, 0,0x5745, 0, +0x5746, 0,0x5747, 0,0x5748, 0, 0,0x5749, + 0, 0,0x574A, 0,0x574B, 0,0x574C,0x574D, + 0, 0, 0, 0, 0, 0,0x574E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x574F, 0, 0, 0, 0,0x5750, 0, 0, + 0, 0,0x5751, 0, 0, 0, 0, 0, +0x5752, 0,0x5753, 0,0x5754, 0, 0, 0, +0x5755, 0,0x5756, 0, 0,0x5757, 0,0x5758, + 0, 0, 0, 0, 0, 0,0x5759,0x575A, + 0, 0, 0, 0, 0,0x575B,0x575C, 0, +0x575D,0x575E, 0, 0, 0, 0, 0,0x575F, +0x5760, 0,0x5761,0x5762, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5764, 0,0x5765,0x5766,0x5767, + 0,0x5768,0x5769, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x576A,0x576B,0x576C, 0, +0x576D, 0, 0,0x576E, 0, 0, 0,0x576F, + 0, 0,0x5770, 0,0x5771,0x5772, 0, 0, + 0, 0,0x5773,0x5774,0x5775, 0, 0,0x5776, + 0, 0, 0, 0, 0,0x5777,0x5778, 0, + 0,0x5779, 0,0x583E,0x5763,0x577A,0x577B,0x577C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x745F}; + +/* page 30 0x8370-0x8419 */ +static uint16 tab_uni_jisx021230[]={ +0x577D, 0, 0, 0, 0, 0, 0, 0, +0x577E, 0, 0, 0, 0,0x5821, 0,0x5822, +0x5823, 0,0x5824, 0,0x5825, 0,0x5826, 0, + 0, 0, 0, 0, 0,0x5827, 0, 0, + 0, 0,0x5828, 0,0x5829,0x582A, 0, 0, +0x582B,0x582C, 0,0x582D,0x582E,0x582F, 0, 0, + 0, 0, 0, 0, 0, 0,0x5830,0x5831, + 0,0x5832, 0, 0,0x5833,0x584C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5834,0x5835, +0x5836, 0, 0, 0, 0, 0, 0,0x5837, + 0,0x5838, 0, 0, 0, 0, 0,0x5839, +0x583A,0x583B, 0, 0,0x583C, 0, 0, 0, + 0, 0, 0, 0, 0,0x583D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x583F, 0,0x5840, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5841, 0, +0x5842,0x5843, 0, 0,0x5844, 0, 0, 0, + 0,0x5845, 0, 0, 0, 0,0x5846, 0, + 0, 0,0x5847, 0, 0, 0, 0,0x5848, + 0,0x5849, 0, 0, 0,0x584A, 0, 0, + 0,0x584B}; + +/* page 31 0x842F-0x8880 */ +static uint16 tab_uni_jisx021231[]={ +0x584D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x584E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x584F, 0, +0x5850,0x5851, 0,0x5852, 0, 0,0x5853, 0, +0x5854, 0,0x5855,0x5856, 0, 0, 0,0x5857, + 0,0x5858,0x5859,0x585A, 0,0x585B, 0, 0, + 0,0x585C, 0, 0, 0,0x585D,0x585E, 0, +0x585F, 0, 0,0x5860, 0, 0, 0, 0, + 0,0x5861, 0, 0,0x5862,0x5863, 0,0x5864, + 0,0x5865, 0, 0, 0,0x5866,0x5867, 0, + 0, 0,0x5868, 0, 0, 0,0x5869, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x586A,0x586B, 0,0x586C, 0, + 0, 0, 0, 0, 0, 0, 0,0x586D, + 0, 0, 0, 0, 0, 0, 0,0x586E, + 0,0x586F,0x5870,0x5871, 0, 0, 0, 0, +0x5872, 0,0x5873, 0, 0,0x5874, 0, 0, + 0, 0, 0,0x5875, 0, 0,0x5876,0x5877, + 0,0x5878, 0,0x5879, 0, 0, 0, 0, +0x587A,0x587B, 0, 0, 0,0x587C, 0, 0, +0x587D, 0, 0, 0,0x587E, 0, 0, 0, + 0, 0, 0, 0, 0,0x5921, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5922, 0, 0,0x5923, 0, 0, 0, 0, +0x5924,0x5925,0x5926,0x5927, 0, 0, 0, 0, +0x5928, 0, 0,0x592A,0x592B, 0,0x592C, 0, + 0, 0, 0,0x592D,0x592E, 0, 0, 0, +0x592F, 0, 0, 0, 0,0x5930, 0,0x5931, + 0,0x5932, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5933, 0,0x5934, + 0, 0, 0,0x5935,0x5936,0x5937,0x5938, 0, +0x5939, 0, 0,0x593A,0x593B, 0, 0, 0, +0x593C, 0, 0,0x5929,0x593D,0x593E, 0,0x593F, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5940, 0, 0, 0, 0, 0, 0,0x5941, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5942,0x5943,0x5944,0x5945,0x5946, 0, 0,0x5947, + 0, 0,0x5948, 0, 0,0x5949,0x594A,0x594B, +0x594C,0x594D,0x594E,0x594F, 0,0x5950, 0, 0, + 0, 0, 0, 0,0x5951, 0, 0, 0, +0x5952, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5953,0x5954,0x5955, 0,0x5956, 0, +0x5957, 0,0x5958, 0, 0, 0,0x5959,0x595A, + 0, 0,0x595B, 0,0x595C,0x595D, 0, 0, +0x595E, 0, 0, 0,0x595F, 0, 0, 0, + 0,0x5960, 0, 0, 0, 0,0x5961, 0, +0x5962,0x5963, 0,0x5964, 0, 0,0x5965, 0, +0x5966, 0, 0, 0, 0, 0,0x5974, 0, + 0,0x7461, 0, 0, 0,0x5967, 0,0x5968, +0x5969,0x596A, 0, 0, 0,0x596B,0x596C,0x596D, +0x596E, 0, 0,0x596F, 0, 0, 0, 0, +0x5970, 0, 0,0x5971,0x5972, 0, 0,0x5973, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5975, 0,0x5976, 0, 0, 0, 0, +0x5977,0x5978, 0, 0, 0, 0, 0,0x5979, + 0,0x597A, 0, 0, 0, 0,0x597B, 0, + 0, 0, 0, 0,0x597C, 0, 0,0x597D, + 0, 0, 0, 0, 0,0x597E, 0, 0, +0x5A21,0x5A22, 0, 0, 0,0x5A23,0x5A24, 0, + 0, 0, 0, 0, 0, 0,0x5A25,0x5A26, + 0,0x5A27,0x5A28,0x5A29, 0, 0, 0, 0, + 0,0x5A2A,0x5A2B, 0,0x5A2C, 0, 0,0x5A2D, + 0, 0,0x5A2E, 0, 0, 0, 0, 0, +0x5A2F, 0,0x5A30, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5A31, + 0,0x5A32, 0,0x5A33, 0,0x5A34,0x5A35, 0, + 0,0x5A36,0x3866,0x5A37, 0, 0, 0,0x5A38, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5A39,0x5A3A, 0, 0,0x5A3B, +0x5A3C,0x5A3D,0x5A3E, 0, 0, 0,0x5A3F, 0, + 0,0x5A40,0x5A41,0x5A42,0x5A43,0x5A44, 0, 0, + 0, 0,0x5A45, 0, 0,0x5A46, 0, 0, +0x5A47, 0, 0, 0, 0, 0,0x5A48,0x5A49, +0x5A4A, 0, 0,0x5A4B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5A6D, 0, 0, 0, 0,0x5A4C, 0, + 0, 0,0x5A4D, 0, 0, 0, 0,0x5A4E, + 0,0x5A4F, 0,0x5A50, 0,0x5A51, 0, 0, + 0, 0,0x5A52, 0, 0, 0, 0,0x5A53, +0x5A54,0x5A55, 0, 0, 0, 0,0x5A56, 0, + 0, 0,0x5A57, 0,0x5A58,0x5A59,0x5A5A, 0, +0x5A5B,0x5A5C,0x5A5D, 0, 0, 0, 0, 0, +0x5A5E,0x5A5F,0x5A60, 0,0x5A61, 0,0x5A62, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5A63,0x5A64, 0, 0,0x5A65, 0, +0x5A66, 0, 0,0x5A67, 0,0x5A68, 0, 0, + 0,0x5A69, 0, 0,0x5A6A, 0,0x5A6B, 0, +0x5A6C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5A6E, 0,0x5A6F,0x5A70, 0, + 0, 0, 0, 0, 0,0x5A71,0x5A72, 0, +0x5A73, 0, 0, 0,0x5A74, 0, 0,0x5A75, +0x5A76,0x5A77, 0, 0,0x5A78,0x5A79, 0, 0, + 0, 0,0x5A7A, 0, 0, 0, 0,0x5A7B, +0x5A7C, 0,0x5A7D, 0,0x5A7E, 0, 0, 0, + 0,0x5B21, 0, 0, 0, 0, 0,0x5B22, +0x5B23, 0,0x5B24,0x5B25, 0, 0, 0, 0, + 0, 0,0x5B26,0x5B27, 0,0x5B28,0x5B29,0x5B2A, + 0,0x5B2B, 0, 0,0x5B2C, 0,0x5B2D, 0, + 0, 0, 0, 0, 0, 0,0x5B2E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B2F, 0, 0, 0, 0,0x5B30, 0, + 0, 0,0x5B31, 0, 0,0x5B32,0x5B33, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5B34, 0,0x5B35,0x5B36, 0, 0, 0, 0, + 0, 0, 0, 0,0x5B37, 0, 0, 0, + 0, 0, 0, 0,0x5B38,0x5B39,0x5B3A,0x5B3B, +0x5B3C,0x5B3D,0x5B3E, 0,0x5B3F,0x5B40, 0, 0, + 0,0x5B41, 0, 0,0x5B42, 0,0x5B43, 0, +0x5B44,0x5B45,0x5B46, 0, 0, 0, 0,0x5B47, + 0,0x5B48, 0, 0,0x5B49, 0, 0, 0, +0x5B4A, 0, 0, 0, 0,0x5B4B,0x5B4C,0x5B4D, + 0, 0,0x5B4E, 0, 0, 0,0x5B4F, 0, + 0, 0, 0, 0, 0, 0, 0,0x5B50, +0x5B51, 0,0x5B52, 0, 0, 0, 0, 0, + 0,0x5B53,0x5B54,0x5B55, 0, 0, 0,0x5B56, + 0, 0, 0, 0, 0, 0,0x5B57,0x5B58, + 0, 0,0x5B59,0x5B5A, 0,0x5B5B, 0, 0, +0x5B5C, 0, 0,0x5B5D,0x5B5E,0x5B5F, 0, 0, + 0, 0, 0,0x5B60,0x5B61, 0,0x5B62, 0, + 0, 0,0x5B63, 0,0x5B64, 0, 0, 0, + 0,0x5B65, 0,0x5B66, 0, 0, 0, 0, +0x5B67, 0,0x5B68, 0,0x5B69, 0, 0,0x5B6A, +0x7464, 0,0x5B6B,0x5B6C,0x5B6D, 0, 0, 0, + 0,0x5B6E, 0,0x5B70,0x5B71,0x5B72, 0, 0, + 0,0x5B73,0x5B6F,0x5B74,0x5B75,0x5B76, 0,0x5B77, +0x5B78, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B79, 0, 0, 0, 0,0x5B7A,0x5B7B, + 0,0x5B7C, 0,0x5B7D, 0, 0,0x5B7E, 0, + 0, 0, 0,0x5C21, 0,0x5C22, 0, 0, + 0, 0,0x5C23, 0,0x5C24, 0,0x5C25, 0, + 0,0x5C26,0x5C27,0x5C28,0x5C29, 0, 0,0x5C2A, + 0, 0,0x5C2B, 0, 0, 0,0x5C2C,0x5C2D, + 0,0x5C2E, 0,0x5C2F, 0,0x5C30, 0, 0, +0x5C31,0x5C32, 0, 0, 0,0x5C33, 0, 0, + 0, 0,0x5C34, 0, 0, 0, 0, 0, + 0, 0,0x5C35, 0, 0, 0, 0, 0, + 0, 0,0x5C36, 0,0x5C37, 0, 0, 0, + 0,0x5C38}; + +/* page 32 0x8898-0x89BC */ +static uint16 tab_uni_jisx021232[]={ +0x5C39, 0,0x5C3A,0x5C3B,0x5C3C, 0, 0,0x5C3D, +0x5C3E, 0, 0, 0, 0, 0, 0, 0, +0x5C3F, 0,0x5C40, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5C41, 0, 0,0x5C42,0x5C43, 0, +0x5C44, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5C45,0x5C46,0x5C47,0x5C48,0x5C49, 0, + 0,0x5C4A,0x5C4B,0x5C4C, 0, 0, 0, 0, + 0, 0, 0,0x5C4D, 0, 0,0x5C4E, 0, + 0, 0, 0, 0, 0, 0, 0,0x5C4F, + 0, 0, 0, 0, 0, 0, 0,0x5C50, +0x5C51,0x5C52, 0, 0, 0,0x5C53, 0,0x5C54, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5C55, 0, 0, 0, 0,0x5C56, 0, + 0, 0, 0, 0, 0,0x5C57,0x5C58,0x5C59, + 0, 0, 0, 0, 0,0x5C5A,0x5C5B, 0, +0x5C5C,0x5C5D,0x5C5E, 0,0x5C5F, 0, 0, 0, +0x5C60, 0, 0, 0, 0, 0,0x5C61,0x5C62, +0x5C63, 0, 0, 0, 0, 0, 0, 0, +0x5C64,0x5C65,0x5C66, 0, 0,0x5C67, 0, 0, + 0,0x5C68,0x5C69, 0, 0, 0,0x5C6A, 0, +0x5C6B, 0,0x5C6C, 0, 0,0x5C6D,0x5C6E, 0, + 0,0x5C6F, 0, 0, 0, 0, 0,0x5C70, + 0, 0,0x5C71, 0, 0, 0, 0,0x5C72, + 0, 0,0x5C73,0x5C74,0x5C75, 0, 0, 0, + 0,0x5C76,0x5C77,0x5C78, 0, 0, 0, 0, + 0, 0, 0,0x5C79, 0, 0,0x5C7A, 0, +0x5C7B, 0, 0,0x5C7C, 0,0x5C7D, 0, 0, + 0, 0,0x5C7E,0x5D21,0x5D22,0x5D23, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D24, 0, 0, 0,0x5D25, 0, 0, +0x5D26, 0, 0, 0,0x5D27,0x5D28, 0, 0, + 0, 0, 0,0x5D29,0x5D2A, 0, 0,0x5D2B, +0x5D2C, 0, 0, 0, 0,0x5D2D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5D2E, 0, 0, 0,0x5D2F,0x5D30,0x5D31,0x5D32, + 0, 0, 0, 0,0x5D33}; + +/* page 33 0x89D4-0x8B9F */ +static uint16 tab_uni_jisx021233[]={ +0x5D34,0x5D35,0x5D36,0x5D37,0x5D38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D39, 0, 0, 0,0x5D3A, 0,0x5D3B, + 0,0x5D3C, 0, 0, 0,0x5D3D, 0,0x5D3E, + 0, 0,0x5D3F, 0, 0,0x5D40, 0, 0, + 0,0x5D41, 0,0x5D42, 0, 0, 0, 0, +0x5D43,0x5D44, 0,0x5D45, 0, 0, 0, 0, + 0, 0, 0,0x5D46, 0,0x5D47,0x5D48, 0, +0x5D49,0x5D4A, 0, 0, 0, 0, 0, 0, + 0, 0,0x5D4B, 0,0x5D4C, 0,0x5D4D, 0, +0x5D4E, 0,0x5D4F, 0, 0, 0, 0,0x5D50, +0x5D51, 0, 0,0x5D52, 0, 0, 0, 0, + 0,0x5D53, 0,0x5D54, 0, 0, 0, 0, + 0,0x5D55,0x5D56, 0,0x5D57, 0, 0,0x5D58, + 0,0x5D59, 0,0x5D5A, 0,0x5D5B, 0, 0, + 0,0x5D5C,0x5D5D, 0, 0, 0, 0,0x5D5E, + 0, 0,0x5D5F,0x5D60,0x5D61, 0, 0, 0, +0x5D62,0x5D63, 0, 0, 0,0x5D64, 0, 0, + 0,0x5D65, 0,0x5D66, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D67,0x5D68,0x5D69, 0,0x5D6A,0x5D6B,0x5D6C, + 0, 0,0x5D6D,0x5D6E,0x5D6F, 0, 0,0x5D70, + 0, 0,0x5D71, 0, 0, 0, 0,0x5D72, + 0, 0, 0,0x5D73,0x5D74, 0,0x5D75, 0, + 0, 0,0x5D76,0x5D77, 0,0x5D78, 0, 0, + 0, 0, 0,0x5D79, 0, 0, 0, 0, + 0, 0, 0,0x5D7A, 0,0x5D7B, 0, 0, + 0, 0,0x5D7C,0x5D7D, 0, 0, 0,0x5D7E, + 0, 0,0x5E21,0x5E22, 0, 0, 0,0x5E23, + 0, 0,0x5E24, 0, 0, 0, 0,0x5E25, + 0, 0,0x5E26, 0,0x5E27,0x5E28,0x5E29, 0, + 0, 0, 0, 0, 0,0x5E2A, 0,0x5E2B, +0x5E2C,0x5E2D, 0,0x5E2E, 0, 0, 0, 0, + 0,0x5E2F, 0,0x5E30, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5E31, 0, 0, 0,0x5E32, 0, 0, 0, +0x5E33,0x5E34,0x5E35, 0, 0, 0, 0, 0, +0x5E36, 0, 0,0x5E37, 0, 0, 0, 0, + 0,0x5E38,0x5E39, 0, 0, 0,0x5E3F,0x5E3A, + 0, 0, 0, 0, 0,0x5E3B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5E3C, 0,0x5E3D,0x5E3E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E40, 0, 0,0x5E41, 0, 0, 0, + 0, 0, 0,0x5E42, 0, 0, 0, 0, +0x5E43, 0, 0, 0, 0, 0,0x5E44,0x5E45, +0x5E46,0x5E47,0x5E48, 0,0x5E49, 0, 0, 0, + 0,0x5E4E, 0, 0, 0, 0,0x5E4A,0x5E4B, +0x5E4C, 0, 0, 0, 0,0x5E4D, 0, 0, + 0, 0,0x5E4F, 0, 0, 0, 0,0x5E50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E51, 0, 0, 0, 0, 0, 0, + 0, 0,0x5E52, 0,0x5E53,0x5E54, 0, 0, +0x5E55, 0,0x5E56,0x7466, 0,0x5E57, 0, 0, +0x5E58,0x5E59, 0, 0, 0, 0, 0,0x5E5A, + 0,0x5E5B, 0,0x5E5C, 0, 0, 0, 0, +0x5E5D,0x5E5E, 0, 0, 0, 0, 0, 0, +0x5E5F, 0,0x5E60,0x5E61}; + +/* page 34 0x8C38-0x8CA4 */ +static uint16 tab_uni_jisx021234[]={ +0x5E62,0x5E63, 0, 0, 0,0x5E64,0x5E65, 0, + 0, 0, 0, 0, 0,0x5E66, 0,0x5E67, + 0,0x5E68, 0,0x5E69, 0, 0, 0,0x5E6A, + 0,0x5E6B, 0,0x5E6C,0x5E6D, 0, 0,0x5E6E, +0x5E6F,0x5E72, 0,0x5E70, 0,0x5E71, 0, 0, + 0, 0, 0,0x5E73,0x5E74, 0,0x5E75, 0, +0x5E76,0x5E77, 0, 0, 0,0x5E78, 0, 0, + 0, 0, 0,0x5E79, 0,0x5E7A,0x5E7B, 0, + 0, 0, 0,0x5E7C, 0, 0,0x5E7D, 0, + 0, 0, 0, 0, 0, 0,0x5E7E,0x5F21, + 0, 0, 0,0x5F22, 0, 0, 0, 0, +0x5F23, 0,0x5F24,0x5F25, 0, 0, 0, 0, + 0,0x5F26, 0,0x5F27,0x5F28, 0, 0, 0, + 0, 0, 0, 0,0x5F29}; + +/* page 35 0x8CB9-0x8D1B */ +static uint16 tab_uni_jisx021235[]={ +0x5F2A,0x5F2B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5F2C,0x5F2D, 0, 0, +0x5F2E, 0,0x5F2F, 0, 0, 0,0x5F30, 0, + 0, 0, 0, 0,0x5F32,0x5F31, 0, 0, +0x5F33, 0, 0, 0,0x5F34, 0, 0, 0, +0x5F35, 0, 0, 0, 0, 0, 0,0x5F36, + 0, 0, 0,0x5F37, 0, 0,0x5F38,0x5F39, + 0,0x5F3A, 0,0x7467,0x5F3B, 0,0x5F3C,0x5F3D, + 0, 0, 0, 0, 0,0x5F3E,0x5F3F, 0, +0x5F40, 0,0x5F41, 0, 0, 0, 0, 0, +0x5F42, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F43, 0, 0, 0, 0,0x5F44, 0, + 0, 0,0x5F45}; + +/* page 36 0x8D65-0x8F65 */ +static uint16 tab_uni_jisx021236[]={ +0x5F46, 0, 0, 0,0x5F47, 0, 0,0x5F48, + 0,0x5F49, 0, 0, 0, 0, 0, 0, + 0,0x7468, 0, 0, 0, 0, 0, 0, + 0, 0,0x5F4A, 0, 0,0x5F4B, 0,0x5F4C, + 0, 0, 0,0x5F4D, 0, 0, 0, 0, +0x5F4E, 0, 0,0x5F4F,0x5F50, 0, 0, 0, +0x5F51, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F52,0x5F53,0x5F54, 0, 0, 0, 0, + 0,0x5F55, 0, 0, 0, 0,0x5F56,0x5F57, + 0, 0,0x5F58, 0, 0,0x5F59, 0, 0, +0x5F5A, 0,0x5F5B, 0,0x5F5C, 0,0x5F5D,0x5F6F, + 0, 0, 0,0x5F5E, 0, 0, 0, 0, +0x5F5F,0x5F60,0x5F61,0x5F62, 0,0x5F63, 0, 0, + 0,0x5F64, 0, 0,0x5F65, 0, 0,0x5F66, +0x5F67, 0,0x5F68, 0,0x5F69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5F6A, +0x5F6B, 0,0x5F6C, 0, 0, 0, 0,0x5F6D, + 0, 0, 0,0x5F6E,0x5F70,0x5F71, 0,0x5F72, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F73, 0, 0, 0,0x5F74, 0, 0,0x5F75, +0x5F76,0x5F77, 0, 0, 0, 0,0x5F78, 0, + 0, 0, 0, 0,0x5F79, 0, 0,0x5F7A, + 0,0x5F7B, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5F7C,0x5F7D,0x5F7E,0x6021, 0, + 0,0x6022,0x6023, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6024, 0,0x6025, 0, + 0,0x6026,0x6027,0x6028,0x6029, 0, 0, 0, +0x602A, 0, 0,0x602B,0x602C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x602D, 0, +0x602E,0x602F,0x6030, 0, 0, 0, 0,0x6031, + 0, 0, 0, 0, 0, 0,0x6032,0x6033, +0x6034,0x6035, 0, 0,0x6036,0x6037, 0, 0, + 0, 0, 0, 0,0x6038, 0, 0,0x6039, +0x603A, 0,0x603B,0x603C,0x603D, 0, 0, 0, + 0, 0, 0, 0,0x603E,0x603F,0x6040, 0, + 0, 0, 0, 0, 0,0x6041,0x6042, 0, + 0, 0, 0, 0,0x6043, 0, 0, 0, + 0, 0, 0,0x6044, 0,0x6045, 0, 0, +0x6046, 0, 0, 0, 0,0x6047,0x6048, 0, +0x6049,0x604A, 0, 0, 0,0x604B, 0, 0, + 0, 0,0x604C, 0,0x604D, 0, 0, 0, +0x604E,0x604F, 0, 0, 0, 0,0x6050, 0, +0x6051, 0, 0, 0, 0,0x6052,0x6053, 0, + 0, 0, 0,0x6054,0x6055, 0,0x6056,0x6057, + 0, 0,0x6058, 0, 0, 0, 0, 0, + 0, 0,0x6059, 0,0x605A, 0, 0,0x605B, + 0, 0, 0, 0, 0, 0, 0,0x605C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x605D, 0, 0, 0, 0, +0x6064,0x605E, 0,0x605F,0x6060, 0, 0, 0, + 0, 0,0x6061, 0,0x6062,0x6063, 0, 0, + 0, 0, 0,0x6065, 0,0x6066, 0, 0, + 0, 0,0x6067,0x6068, 0, 0, 0, 0, + 0, 0,0x6069,0x606A, 0, 0, 0, 0, + 0,0x606B,0x606C,0x606D, 0, 0, 0, 0, + 0,0x606E, 0,0x606F,0x6070, 0,0x6071, 0, +0x6072, 0,0x6073,0x6074, 0, 0, 0,0x6075, +0x6076,0x6077, 0, 0, 0, 0, 0,0x6078, +0x6079,0x607A,0x607B, 0, 0,0x607C, 0, 0, + 0, 0, 0,0x607D,0x607E, 0,0x6121, 0, + 0, 0,0x6122, 0, 0, 0, 0, 0, + 0, 0,0x6123, 0,0x6124,0x6125,0x6126,0x6127, +0x6128, 0, 0,0x6129, 0, 0, 0, 0, +0x612A,0x612B, 0, 0, 0, 0, 0, 0, +0x612C}; + +/* page 37 0x8F9D-0x9484 */ +static uint16 tab_uni_jisx021237[]={ +0x612D, 0, 0,0x612E,0x612F, 0, 0,0x6130, +0x6131,0x6132, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6133,0x6134, 0,0x6135, 0, 0, 0, 0, + 0,0x6136, 0,0x6137,0x6138, 0, 0, 0, + 0,0x6139, 0, 0, 0,0x613A,0x613B, 0, +0x613C, 0, 0,0x613D, 0,0x613E,0x613F, 0, +0x6140, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6141, 0, 0,0x6142,0x6143, + 0, 0, 0,0x6144, 0, 0, 0, 0, + 0,0x6145, 0, 0,0x6146, 0, 0, 0, +0x6147,0x6148, 0, 0, 0, 0,0x6149, 0, + 0,0x614A, 0, 0, 0,0x614B, 0,0x614C, + 0, 0, 0,0x614D, 0, 0, 0,0x614E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x614F, 0, 0,0x6150, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6151,0x6152,0x6154, 0,0x6155, +0x6156, 0,0x6153, 0, 0, 0,0x6157,0x6158, + 0, 0,0x6159, 0, 0, 0, 0, 0, + 0, 0,0x615A, 0, 0, 0,0x615B,0x615C, + 0, 0, 0, 0, 0, 0, 0,0x615D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x615E, 0, +0x615F, 0, 0, 0, 0,0x6160, 0, 0, + 0,0x6161,0x6162, 0, 0, 0, 0,0x6163, + 0, 0, 0,0x6164, 0, 0, 0,0x6165, + 0, 0, 0, 0,0x6166, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6167, 0, 0,0x6168, 0, 0,0x6169,0x616A, + 0,0x616B, 0,0x616C, 0, 0, 0, 0, +0x616D, 0,0x616E,0x616F,0x6170, 0,0x6171, 0, + 0, 0, 0,0x6172,0x6173,0x6174, 0, 0, +0x6175, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6176, 0,0x6177,0x6178,0x6179, + 0,0x617A, 0, 0, 0, 0, 0, 0, +0x617B,0x617D, 0, 0, 0, 0,0x617E,0x6221, +0x6222, 0,0x6223,0x6224, 0, 0, 0,0x617C, + 0, 0, 0, 0, 0,0x622D, 0, 0, +0x6225, 0,0x6226,0x6227,0x6228, 0, 0,0x6229, +0x622A,0x746C,0x622B, 0, 0, 0, 0, 0, +0x622C, 0, 0, 0, 0, 0,0x622F, 0, + 0, 0,0x6230,0x6231, 0, 0, 0,0x6232, + 0,0x622E, 0, 0, 0, 0, 0, 0, + 0,0x6233,0x6234,0x6235, 0, 0, 0,0x6236, +0x6237,0x6238, 0,0x6239, 0, 0, 0, 0, +0x623A, 0, 0,0x623B, 0, 0, 0,0x623C, +0x746E,0x623D,0x623E,0x623F, 0,0x6240, 0,0x6241, + 0,0x6242, 0,0x6243, 0,0x6245,0x6246, 0, +0x6244, 0,0x6247, 0,0x6248, 0, 0, 0, + 0,0x6249,0x624A, 0,0x624B, 0, 0,0x624C, + 0,0x624D,0x624E, 0,0x624F,0x6250, 0,0x6251, +0x6252, 0, 0, 0, 0, 0,0x6253, 0, + 0, 0,0x6254,0x6255, 0, 0, 0, 0, + 0, 0,0x6256, 0, 0, 0,0x6257, 0, + 0, 0,0x6258, 0,0x6259,0x625A,0x625B, 0, + 0, 0, 0, 0,0x625C, 0, 0,0x625D, + 0, 0,0x625E, 0, 0, 0, 0, 0, +0x625F, 0, 0, 0, 0, 0, 0,0x6260, + 0, 0, 0, 0,0x6261,0x6262,0x6263, 0, + 0, 0, 0, 0,0x6264, 0,0x6265, 0, +0x6266,0x6267, 0, 0, 0,0x6268, 0, 0, + 0,0x6269, 0, 0,0x626A, 0,0x626B,0x626C, +0x626D, 0, 0,0x626E, 0, 0, 0, 0, + 0,0x626F, 0, 0,0x6270, 0, 0, 0, + 0,0x6271, 0,0x6272, 0, 0, 0,0x6273, +0x6274,0x6275, 0,0x6276,0x6277,0x6278,0x6279, 0, + 0,0x627A, 0, 0, 0, 0,0x627B,0x627C, +0x627D, 0,0x627E, 0, 0,0x6321,0x6322, 0, +0x6323, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6324,0x6325, + 0, 0,0x6326, 0,0x6327,0x6328, 0, 0, + 0,0x6329, 0, 0, 0, 0, 0,0x632A, +0x632B, 0, 0, 0,0x632C,0x632D, 0,0x632E, +0x632F,0x6330,0x6331,0x6332,0x6333, 0, 0, 0, + 0, 0,0x6334, 0,0x6335, 0,0x6336, 0, +0x6337, 0, 0,0x6338,0x6339, 0, 0,0x633A, +0x633B,0x633C,0x633D, 0,0x633E,0x633F, 0,0x6340, + 0, 0, 0,0x6341, 0,0x6342,0x6343, 0, + 0,0x6344, 0,0x6345, 0, 0, 0,0x6346, +0x6347, 0, 0, 0, 0, 0,0x6348,0x6349, +0x634A,0x634B, 0,0x634C, 0, 0, 0, 0, + 0,0x634D,0x634E,0x634F, 0, 0,0x6350, 0, +0x6351,0x6352, 0,0x6353,0x6354,0x6355, 0,0x6356, + 0,0x6357, 0,0x6358, 0,0x6359,0x635A, 0, + 0,0x635B,0x635C, 0, 0,0x635D, 0, 0, +0x635E,0x635F,0x6360, 0,0x6361, 0, 0, 0, + 0, 0, 0,0x6362,0x6363, 0, 0,0x6364, +0x6365, 0, 0,0x6366,0x6367, 0, 0, 0, +0x6368, 0,0x6369,0x636A,0x636B, 0, 0, 0, + 0,0x636C,0x636D,0x636E, 0, 0, 0, 0, +0x636F,0x6370,0x6371,0x6372,0x6373, 0,0x6374,0x6375, +0x6376, 0,0x6377, 0, 0, 0, 0, 0, + 0, 0, 0,0x6378,0x6379,0x637A, 0, 0, +0x637B,0x637C, 0, 0, 0,0x637D, 0, 0, + 0, 0,0x637E, 0,0x6421, 0, 0, 0, + 0, 0,0x6422,0x6423, 0, 0, 0,0x6424, +0x6425, 0,0x6426,0x6427, 0, 0,0x6428, 0, + 0, 0,0x6429, 0, 0,0x642A, 0, 0, + 0,0x642B, 0,0x642C, 0,0x642D,0x642E,0x642F, +0x6430, 0,0x6431,0x6432,0x6433,0x6434,0x6435, 0, +0x6436,0x6437,0x6438,0x6439, 0, 0,0x643A,0x643B, +0x643C,0x643D, 0,0x643E, 0, 0,0x643F, 0, +0x6440, 0,0x6441,0x6442,0x6443, 0, 0,0x6444, +0x6445, 0,0x6446,0x6447,0x6448, 0,0x6449, 0, +0x644A, 0,0x644B,0x644C, 0, 0, 0,0x644D, + 0,0x644E, 0,0x644F, 0, 0, 0, 0, + 0, 0, 0, 0,0x6450, 0,0x6451, 0, + 0, 0,0x6452,0x6453, 0,0x6454, 0, 0, + 0, 0, 0,0x6455, 0, 0, 0, 0, +0x6456, 0, 0, 0,0x6457, 0, 0,0x6458, +0x6459, 0, 0, 0, 0, 0, 0,0x645A, +0x645B,0x645C,0x645D, 0,0x645E, 0, 0,0x645F, +0x6460, 0,0x6461, 0,0x6462,0x6463, 0, 0, + 0, 0, 0, 0, 0, 0,0x6464,0x6465, + 0,0x6466,0x6467, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6468,0x6469,0x646A, 0, 0, 0, + 0, 0, 0,0x646B,0x646C,0x646D, 0, 0, +0x646E, 0,0x646F,0x6470, 0,0x6471, 0, 0, + 0,0x6472, 0, 0, 0, 0, 0,0x6473, +0x6474, 0,0x6475, 0,0x6476,0x6477, 0, 0, +0x6478, 0,0x6479,0x647A,0x647B, 0,0x647C,0x647D, + 0,0x647E, 0, 0, 0,0x6521, 0, 0, +0x6522, 0,0x6523,0x6524,0x6525,0x6526, 0, 0, + 0, 0, 0,0x6527, 0,0x6528,0x6529, 0, +0x652A, 0,0x652B, 0, 0,0x652C, 0, 0, +0x652D, 0, 0,0x652E, 0, 0,0x652F, 0, + 0,0x6530, 0, 0,0x6531, 0,0x6532,0x6533, + 0,0x6534, 0,0x6535,0x653B, 0,0x6536, 0, + 0, 0, 0, 0, 0, 0, 0,0x6537, +0x6538,0x6539, 0, 0, 0,0x653A, 0, 0, + 0, 0, 0, 0,0x653C, 0, 0,0x653D, +0x653E,0x653F,0x6540, 0,0x6541,0x6542,0x6543,0x6544, +0x6545, 0, 0, 0, 0, 0,0x6546, 0, + 0, 0, 0, 0,0x6547, 0, 0,0x6548, + 0,0x6549,0x654A, 0, 0,0x654B, 0, 0, + 0,0x654C,0x654D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x654F,0x6550,0x654E,0x6551,0x6552, 0, +0x6553, 0, 0, 0,0x6554,0x6555, 0,0x6556, + 0, 0, 0,0x6557,0x6558, 0, 0, 0, +0x6559,0x655A,0x655B, 0, 0, 0, 0, 0, +0x655C,0x655D,0x655E, 0, 0, 0, 0, 0, + 0, 0,0x655F, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6560,0x6561, 0,0x6562,0x6563,0x6564,0x6565, + 0, 0, 0, 0, 0, 0,0x6566, 0, +0x6568, 0,0x6567, 0, 0, 0,0x6569, 0, +0x656A, 0, 0,0x656B, 0,0x656C, 0,0x656D, + 0, 0, 0, 0, 0, 0, 0, 0, +0x656E, 0, 0, 0,0x656F, 0, 0,0x6570, + 0, 0,0x6571, 0,0x6572, 0,0x6573, 0, + 0, 0, 0,0x6574, 0, 0,0x6575, 0, +0x6576,0x6577,0x6578, 0,0x6579,0x657A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x657C,0x657B +}; + +/* page 38 0x9578-0x95E6 */ +static uint16 tab_uni_jisx021238[]={ +0x657D,0x657E, 0, 0, 0, 0,0x6621, 0, + 0, 0, 0, 0,0x6622, 0, 0, 0, +0x6623, 0, 0, 0,0x6624,0x6625,0x6626, 0, + 0, 0,0x7471, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6627,0x6628,0x6629, + 0,0x662A, 0, 0, 0, 0,0x662B, 0, + 0,0x662C, 0,0x662D,0x662E, 0, 0, 0, + 0, 0, 0, 0,0x662F, 0,0x6630, 0, + 0, 0,0x6631, 0, 0,0x6632, 0,0x6633, + 0, 0, 0, 0, 0, 0,0x6634, 0, +0x6635,0x6636, 0,0x6637, 0, 0, 0, 0, +0x6638,0x6639,0x663A,0x663B, 0, 0, 0, 0, + 0,0x663C,0x663D, 0, 0,0x663E,0x663F,0x6640, +0x6641, 0, 0, 0,0x6642, 0,0x6643}; + +/* page 39 0x961D-0x986C */ +static uint16 tab_uni_jisx021239[]={ +0x6644,0x6645, 0, 0, 0,0x6646, 0,0x6647, +0x6648,0x6649, 0, 0, 0, 0, 0,0x664A, + 0, 0, 0, 0,0x664B, 0,0x664C, 0, + 0, 0,0x664D,0x664E,0x664F,0x6650, 0,0x6651, +0x6652, 0, 0, 0,0x6653, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6654, 0,0x6655, + 0,0x6656,0x6657,0x6658, 0, 0, 0, 0, + 0, 0, 0, 0,0x6659, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x665A, 0, 0, 0, 0, 0,0x665B, + 0, 0, 0, 0, 0, 0,0x665C,0x665D, + 0,0x665E,0x665F, 0,0x6660,0x6661,0x6662,0x6663, + 0, 0, 0, 0,0x6664, 0, 0, 0, + 0, 0, 0, 0,0x6665, 0, 0, 0, + 0,0x6666, 0, 0, 0,0x6667, 0, 0, +0x6668, 0,0x6669, 0, 0, 0, 0,0x666A, +0x666B,0x666C, 0, 0,0x666D, 0, 0, 0, + 0,0x666E,0x666F, 0, 0, 0,0x6670, 0, + 0, 0, 0, 0, 0,0x6671, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6672, 0, 0, + 0, 0, 0, 0, 0,0x6673, 0, 0, + 0, 0, 0,0x6675, 0,0x6676, 0, 0, +0x6677,0x6678,0x6679, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x667A, 0, 0, 0, + 0, 0,0x667B, 0,0x667C, 0, 0, 0, + 0, 0, 0, 0, 0,0x667D, 0, 0, + 0, 0, 0, 0, 0,0x667E,0x6721, 0, +0x6722, 0, 0, 0,0x6723, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6724,0x6725, 0, +0x6726, 0, 0, 0,0x6727,0x6728,0x6729, 0, + 0, 0, 0,0x672A, 0, 0, 0, 0, + 0, 0, 0, 0,0x672B, 0,0x672C, 0, + 0, 0, 0, 0, 0, 0,0x7474, 0, + 0, 0, 0, 0,0x672D, 0,0x672E, 0, + 0, 0, 0, 0, 0,0x672F, 0, 0, +0x7475,0x6730,0x6731, 0,0x7476, 0, 0, 0, +0x6732, 0,0x6733,0x6734, 0,0x6735,0x6736, 0, + 0, 0, 0, 0, 0, 0,0x6737, 0, + 0, 0,0x6738, 0, 0,0x6739, 0, 0, + 0,0x673A, 0, 0, 0, 0,0x673B, 0, + 0,0x673C,0x673D,0x673E, 0, 0,0x673F, 0, +0x6740, 0,0x6741,0x6742, 0, 0, 0, 0, + 0, 0, 0, 0,0x6743, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6744,0x6745,0x6746, 0,0x6747,0x6748, 0, 0, + 0,0x6749,0x674A, 0, 0,0x674B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x674C, + 0,0x674D, 0, 0,0x674E,0x674F, 0, 0, +0x6750,0x6751, 0,0x6752,0x6753,0x6754, 0,0x6755, + 0,0x6756,0x6757, 0,0x6758, 0, 0,0x6759, +0x675A, 0,0x675B, 0,0x675C,0x675D, 0,0x675E, +0x675F,0x6760, 0,0x6761,0x6762, 0, 0,0x6763, + 0, 0,0x6764,0x6765,0x6766, 0,0x676A, 0, +0x6767,0x6768, 0,0x6769,0x676B, 0, 0,0x676C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x676D, 0,0x676E, 0, 0,0x676F, + 0, 0,0x6770,0x6771, 0,0x6772, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6773, 0, 0,0x6774, 0, 0, +0x6776,0x6777, 0, 0, 0, 0, 0,0x6778, + 0,0x6779, 0, 0,0x6775, 0, 0,0x677A, + 0,0x677B, 0,0x677C, 0, 0,0x677D, 0, +0x6828,0x677E, 0, 0, 0, 0,0x6821, 0, + 0,0x6822,0x6823,0x6824, 0,0x6825,0x6826, 0, +0x6827, 0, 0, 0, 0, 0, 0, 0, + 0,0x6829, 0, 0, 0, 0, 0,0x682A, + 0, 0,0x682B, 0, 0,0x682C, 0, 0, + 0, 0, 0, 0,0x682D,0x682E,0x682F, 0, + 0,0x6830,0x6831, 0,0x6832,0x6833, 0, 0, + 0, 0, 0, 0, 0,0x6834,0x6835, 0, +0x6836,0x6837, 0, 0, 0,0x6838, 0,0x6839 +}; + +/* page 40 0x98AB-0x98CC */ +static uint16 tab_uni_jisx021240[]={ +0x683A, 0,0x683B,0x683C, 0,0x683D, 0, 0, + 0,0x683E, 0, 0,0x683F,0x6840, 0,0x6841, +0x6842, 0, 0, 0,0x6843, 0, 0,0x6844, + 0, 0,0x6845, 0, 0,0x6846, 0, 0, + 0,0x6847}; + +/* page 41 0x98E1-0x9960 */ +static uint16 tab_uni_jisx021241[]={ +0x6848, 0,0x6849, 0,0x684A,0x684B,0x684C, 0, + 0,0x684D, 0, 0, 0, 0, 0, 0, + 0, 0,0x684E, 0, 0,0x684F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6850, 0, 0, 0, 0,0x6851,0x6852, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6853, 0, 0, 0,0x6854,0x6855,0x6856, 0, + 0,0x6857,0x6858,0x6859, 0, 0,0x685A, 0, + 0,0x685B, 0, 0, 0,0x685C,0x685D, 0, + 0, 0,0x685E, 0, 0, 0, 0, 0, +0x685F,0x6860,0x6861,0x6862,0x6863, 0, 0, 0, +0x6864,0x6865,0x6866,0x6867, 0, 0, 0,0x6868, +0x6869, 0, 0, 0, 0,0x686A,0x686B,0x686C, + 0, 0, 0, 0,0x686D,0x686E, 0, 0, + 0, 0, 0,0x686F, 0, 0, 0,0x6870, +0x6871, 0,0x6872,0x6873, 0,0x6874,0x6875,0x6876 +}; + +/* page 42 0x999B-0x9A5D */ +static uint16 tab_uni_jisx021242[]={ +0x6877, 0,0x6878,0x747A,0x6879, 0, 0, 0, + 0, 0, 0,0x687A, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x687B,0x687C,0x687D, + 0, 0,0x687E, 0, 0, 0,0x6921,0x6922, + 0, 0,0x6923, 0,0x6924, 0, 0, 0, +0x6925, 0, 0, 0, 0, 0,0x6926, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6927,0x6928, 0, 0, 0, 0,0x6929,0x692A, + 0,0x692B, 0,0x692C, 0, 0, 0, 0, + 0, 0, 0, 0,0x692D, 0, 0,0x692E, +0x692F,0x6930, 0, 0, 0,0x6931, 0, 0, + 0,0x6932,0x6933, 0, 0, 0,0x6934, 0, + 0, 0,0x6935,0x6936, 0, 0, 0,0x6937, +0x6938,0x6939, 0, 0, 0, 0, 0, 0, +0x693A,0x693B, 0, 0, 0,0x693C,0x693D, 0, + 0, 0, 0,0x693E, 0, 0, 0, 0, + 0, 0, 0,0x693F, 0,0x6940, 0,0x6941, +0x6942,0x6943, 0, 0,0x6944, 0, 0, 0, + 0, 0,0x6945,0x6946, 0, 0, 0, 0, +0x6947, 0,0x6948,0x6949, 0,0x694A, 0, 0, + 0, 0, 0, 0, 0, 0,0x694C, 0, + 0,0x694D, 0, 0,0x694B, 0, 0,0x694E, +0x694F,0x6950, 0,0x6951, 0, 0,0x6952, 0, + 0,0x6953, 0,0x6954, 0, 0, 0, 0, + 0, 0,0x6955}; + +/* page 43 0x9AAA-0x9C7B */ +static uint16 tab_uni_jisx021243[]={ +0x6956, 0,0x6957, 0,0x6958,0x6959, 0, 0, +0x695A, 0,0x695B,0x695C,0x695D, 0, 0,0x695E, + 0,0x695F, 0, 0,0x6960,0x6961, 0,0x6962, + 0,0x6963, 0, 0,0x6964, 0,0x6965, 0, + 0, 0, 0, 0,0x6966, 0,0x6967, 0, +0x6968, 0, 0,0x6969,0x696A,0x696B, 0,0x747B, + 0,0x696C,0x696D, 0, 0, 0,0x696E, 0, + 0, 0,0x696F,0x6970, 0,0x6971, 0,0x6972, + 0, 0,0x6973, 0, 0, 0, 0, 0, +0x6974,0x6975, 0,0x6976, 0, 0, 0,0x6977, +0x6978, 0, 0,0x6979, 0,0x697A,0x697B,0x697C, +0x697D,0x697E,0x6A21,0x6A22, 0, 0,0x6A23,0x6A24, + 0,0x6A25,0x6A26,0x6A27,0x6A28, 0,0x6A29, 0, +0x6A2A, 0, 0, 0,0x6A2B, 0, 0,0x6A2C, + 0,0x6A2D,0x6A2E, 0, 0, 0,0x6A2F, 0, + 0, 0, 0, 0,0x6A30, 0, 0, 0, + 0,0x6A31, 0,0x6A32, 0, 0, 0, 0, + 0,0x6A33,0x6A34,0x6A35, 0,0x6A36, 0,0x6A37, +0x6A38, 0, 0,0x6A39, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A3A, 0, + 0,0x6A3B,0x6A3C, 0, 0, 0, 0, 0, + 0, 0, 0,0x6A3D,0x6A3E,0x6A3F, 0, 0, + 0,0x6A40, 0, 0,0x6A41, 0, 0,0x6A42, + 0,0x6A43, 0,0x6A44,0x6A45, 0,0x6A46, 0, +0x6A47,0x6A48,0x6A49,0x6A4A,0x6A4B, 0, 0, 0, +0x747C,0x6A4C, 0,0x6A4D, 0,0x6A4E,0x6A4F,0x6A50, + 0, 0, 0, 0, 0,0x6A51,0x6A52, 0, + 0, 0,0x6A53,0x6A54,0x6A55,0x6A56, 0,0x6A57, +0x6A58,0x6A59, 0,0x6A5A, 0,0x6A5B,0x6A5C, 0, + 0, 0,0x6A5D, 0, 0, 0, 0, 0, +0x6A5E, 0, 0,0x6A5F,0x6A60, 0, 0, 0, + 0, 0, 0, 0,0x6A61,0x6A62, 0,0x6A63, + 0, 0,0x6A64, 0, 0, 0,0x6A65,0x6A66, +0x6A67, 0, 0, 0, 0,0x6A68,0x6A69, 0, + 0,0x6A6A,0x6A6B, 0,0x6A6C,0x6A6D, 0,0x6A6E, + 0, 0, 0, 0, 0,0x6A6F,0x6A70, 0, + 0, 0, 0, 0,0x6A71, 0,0x6A72, 0, + 0, 0, 0, 0, 0,0x6A73,0x6A74, 0, + 0, 0, 0,0x6A75, 0,0x6A76, 0, 0, + 0, 0, 0,0x6A77, 0,0x6A78, 0, 0, +0x6A79,0x6A7A, 0, 0, 0,0x6A7B, 0, 0, + 0,0x6A7C, 0, 0, 0,0x6A7D,0x6A7E,0x6B21, +0x6B22, 0, 0,0x6B23, 0,0x6B24,0x6B25, 0, +0x6B26, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B27, 0, 0, 0,0x6B28, 0,0x6B29, + 0, 0, 0, 0,0x6B2A, 0,0x6B2B,0x6B2C, +0x6B2D, 0,0x6B2E, 0,0x6B2F, 0, 0, 0, +0x6B30,0x6B31, 0, 0,0x6B32,0x6B33,0x6B34,0x6B35, +0x6B36, 0, 0, 0, 0, 0, 0,0x6B37, + 0, 0, 0,0x6B38,0x6B39,0x6B3A, 0, 0, + 0, 0, 0,0x6B3B, 0, 0, 0,0x6B3C, + 0,0x6B3D,0x6B3E,0x6B3F, 0, 0, 0,0x6B40, +0x6B41, 0, 0, 0,0x6B42,0x6B43,0x6B44, 0, + 0,0x6B45,0x6B46, 0,0x6B47, 0,0x6B48, 0, + 0,0x6B49,0x6B50,0x6B4A,0x6B4B,0x6B4C, 0, 0, + 0,0x6B4D, 0, 0, 0, 0,0x6B52,0x6B4E, +0x6B4F,0x6B51, 0, 0,0x6B53, 0,0x6B54, 0, +0x6B55, 0, 0,0x6B56, 0,0x6B57, 0, 0, + 0,0x6B58}; + +/* page 44 0x9CE6-0x9E1D */ +static uint16 tab_uni_jisx021244[]={ +0x6B59, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6B5A, 0, 0, 0, + 0,0x6B5B, 0,0x6B5C, 0, 0, 0, 0, + 0, 0, 0, 0,0x6B5E, 0, 0, 0, + 0, 0, 0, 0, 0,0x6B5D, 0, 0, + 0, 0, 0,0x6B5F, 0, 0, 0, 0, + 0,0x6B60,0x6B61, 0, 0, 0,0x6B62,0x6B63, +0x6B64, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B65,0x6B66, 0,0x6B67,0x6B68,0x6B69, 0, + 0, 0, 0, 0,0x6B6A, 0,0x6B6B,0x6B6D, + 0, 0, 0, 0,0x6B6E,0x6B6F, 0,0x6B6C, + 0,0x6B70, 0, 0,0x6B71, 0, 0, 0, + 0, 0, 0, 0, 0,0x6B72,0x6B73, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B74, 0, 0,0x6B76,0x6B75, 0,0x6B77, + 0, 0, 0,0x6B78,0x6B79,0x6B7A, 0, 0, + 0, 0,0x6B7B, 0, 0, 0, 0, 0, +0x6B7C,0x6B7D, 0, 0, 0,0x6B7E,0x6C21, 0, +0x6C22, 0, 0, 0, 0,0x6C23,0x6C24, 0, +0x6C25, 0, 0, 0,0x6C26, 0, 0,0x6C27, +0x6C28, 0, 0, 0,0x6C29,0x6C2A, 0,0x6C2B, +0x6C2C,0x6C2D,0x6C2E, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C2F, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C30, 0,0x6C31, 0, +0x6C32, 0, 0,0x6C33, 0, 0, 0,0x6C34, + 0, 0, 0,0x6C35, 0, 0,0x6C36, 0, + 0,0x6C37, 0, 0, 0,0x6C38, 0, 0, + 0,0x6C39, 0,0x6C3A,0x6C3B, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6C3C,0x6C3D, +0x6C3E,0x6C3F, 0, 0,0x6C40, 0, 0, 0, +0x6C41,0x6C42,0x6C43, 0, 0, 0, 0,0x6C44, + 0,0x6C45, 0,0x6C46, 0,0x6C47, 0, 0, +0x6C48, 0,0x6C49, 0, 0,0x6C4A,0x6C4B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C4C, 0, 0, 0,0x6C4E, 0, 0, 0, + 0,0x6C4F, 0, 0,0x6C4D, 0, 0, 0, +0x6C50, 0,0x6C51,0x6C52,0x6C53, 0, 0,0x6C54, +0x6C55, 0, 0,0x6C56, 0, 0,0x6C57,0x6C58 +}; + +/* page 45 0x9E7A-0x9FA5 */ +static uint16 tab_uni_jisx021245[]={ +0x6C59,0x6C5A,0x6C5B, 0, 0, 0,0x6C5C, 0, +0x6C5D,0x6C5E,0x6C5F,0x6C60, 0,0x6C61, 0, 0, + 0, 0, 0, 0,0x6C62,0x6C63, 0, 0, + 0, 0, 0, 0,0x6C64, 0,0x6C65, 0, + 0,0x6C66, 0, 0,0x6C67, 0, 0, 0, + 0, 0,0x6C68, 0, 0, 0,0x6C69, 0, + 0, 0,0x6C6A, 0,0x6C6B,0x6C6C,0x6C6D, 0, + 0,0x6C6E,0x6C6F,0x6C70, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C71, 0,0x6C72, 0, + 0,0x6C73, 0, 0, 0, 0, 0,0x747E, + 0, 0, 0,0x6C74, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C75, 0, 0, + 0, 0,0x6C76, 0, 0,0x6C77, 0, 0, + 0, 0,0x6C78,0x6C79,0x6C7A, 0,0x6C7B,0x6C7C, +0x6C7D, 0, 0,0x6C7E, 0, 0,0x6D21, 0, + 0, 0, 0, 0, 0,0x6D22, 0, 0, +0x6D23,0x6D24, 0, 0, 0, 0, 0,0x6D25, + 0, 0, 0, 0, 0,0x6D26,0x6D27,0x6D28, +0x6D29, 0,0x6D2A, 0,0x6D2B,0x6D2C, 0,0x6D2D, +0x6D2E,0x6D2F, 0, 0, 0,0x6D30, 0, 0, +0x6D31, 0, 0, 0,0x6D32, 0, 0, 0, +0x6D33,0x6D34, 0, 0, 0,0x6D35, 0,0x6D36, +0x6D37, 0,0x6D38, 0, 0,0x6D39, 0,0x6D3A, +0x6D3B, 0,0x6D3C,0x6D3D, 0,0x6D3E, 0,0x6D3F, + 0,0x6D40,0x6D41,0x6D42,0x6D43,0x6D44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6D45, 0,0x6D46,0x6D47,0x6D48,0x6D49, 0, +0x6D4A, 0, 0,0x6D4B,0x6D4C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D4D,0x6D4E, + 0, 0, 0,0x6D4F,0x6D50,0x6D51,0x6D52,0x6D53, + 0,0x6D54, 0,0x6D55, 0, 0, 0, 0, +0x6D56, 0, 0,0x6D57, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6D58,0x6D59,0x6D5A, +0x6D5B, 0,0x6D5C, 0,0x6D5D,0x6D5E, 0, 0, + 0, 0, 0, 0,0x6D5F, 0, 0,0x6D60, +0x6D61,0x6D62, 0,0x6D63}; + +/* page 46 0xF929-0xF929 */ +static uint16 tab_uni_jisx021246[]={ +0x7445}; + +/* page 47 0xF9DC-0xF9DC */ +static uint16 tab_uni_jisx021247[]={ +0x7472}; + +/* page 48 0xFA00-0xFA2D */ +static uint16 tab_uni_jisx021248[]={ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7434,0x7437, +0x7438,0x743D,0x7444,0x7447,0x7448,0x744E,0x744F,0x7453, +0x7455,0x7456,0x7457,0x7458,0x745A,0x745B,0x745E,0x7460, +0x7462,0x7463,0x7465,0x7469,0x746A,0x746B,0x746D,0x746F, +0x7470,0x7473,0x7477,0x7478,0x7479,0x747D}; + +/* page 49 0xFF00-0XFF07 */ +static uint16 tab_uni_jisx021249[]={ + 0, 0,0x742A, 0, 0, 0, 0,0x7429}; + +/* page 50 0xFFE4-0xFFE4 */ +static uint16 tab_uni_jisx021250[]={ +0x2243}; + +static int +my_uni_jisx0212_onechar(int code){ + if ((code>=0x007E)&&(code<=0x007E)) + return(tab_uni_jisx02120[code-0x007E]); + if ((code>=0x00A1)&&(code<=0x017E)) + return(tab_uni_jisx02121[code-0x00A1]); + if ((code>=0x01CD)&&(code<=0x01DC)) + return(tab_uni_jisx02122[code-0x01CD]); + if ((code>=0x01F5)&&(code<=0x01F5)) + return(tab_uni_jisx02123[code-0x01F5]); + if ((code>=0x02C7)&&(code<=0x02DD)) + return(tab_uni_jisx02124[code-0x02C7]); + if ((code>=0x0384)&&(code<=0x0390)) + return(tab_uni_jisx02125[code-0x0384]); + if ((code>=0x03AA)&&(code<=0x03CE)) + return(tab_uni_jisx02126[code-0x03AA]); + if ((code>=0x0402)&&(code<=0x040F)) + return(tab_uni_jisx02127[code-0x0402]); + if ((code>=0x0452)&&(code<=0x045F)) + return(tab_uni_jisx02128[code-0x0452]); + if ((code>=0x2122)&&(code<=0x2122)) + return(tab_uni_jisx02129[code-0x2122]); + if ((code>=0x2170)&&(code<=0x2179)) + return(tab_uni_jisx021210[code-0x2170]); + if ((code>=0x4E02)&&(code<=0x4F19)) + return(tab_uni_jisx021211[code-0x4E02]); + if ((code>=0x4F2E)&&(code<=0x5166)) + return(tab_uni_jisx021212[code-0x4F2E]); + if ((code>=0x517E)&&(code<=0x5515)) + return(tab_uni_jisx021213[code-0x517E]); + if ((code>=0x552A)&&(code<=0x5566)) + return(tab_uni_jisx021214[code-0x552A]); + if ((code>=0x557F)&&(code<=0x5C36)) + return(tab_uni_jisx021215[code-0x557F]); + if ((code>=0x5C59)&&(code<=0x5EEB)) + return(tab_uni_jisx021216[code-0x5C59]); + if ((code>=0x5F02)&&(code<=0x6149)) + return(tab_uni_jisx021217[code-0x5F02]); + if ((code>=0x615E)&&(code<=0x6290)) + return(tab_uni_jisx021218[code-0x615E]); + if ((code>=0x62A6)&&(code<=0x679B)) + return(tab_uni_jisx021219[code-0x62A6]); + if ((code>=0x67B0)&&(code<=0x6801)) + return(tab_uni_jisx021220[code-0x67B0]); + if ((code>=0x6814)&&(code<=0x6917)) + return(tab_uni_jisx021221[code-0x6814]); + if ((code>=0x6931)&&(code<=0x6D3F)) + return(tab_uni_jisx021222[code-0x6931]); + if ((code>=0x6D57)&&(code<=0x6E04)) + return(tab_uni_jisx021223[code-0x6D57]); + if ((code>=0x6E1E)&&(code<=0x6ECF)) + return(tab_uni_jisx021224[code-0x6E1E]); + if ((code>=0x6EEB)&&(code<=0x70E4)) + return(tab_uni_jisx021225[code-0x6EEB]); + if ((code>=0x70FA)&&(code<=0x71DC)) + return(tab_uni_jisx021226[code-0x70FA]); + if ((code>=0x71F8)&&(code<=0x7E9E)) + return(tab_uni_jisx021227[code-0x71F8]); + if ((code>=0x7F3B)&&(code<=0x8044)) + return(tab_uni_jisx021228[code-0x7F3B]); + if ((code>=0x8060)&&(code<=0x8362)) + return(tab_uni_jisx021229[code-0x8060]); + if ((code>=0x8370)&&(code<=0x8419)) + return(tab_uni_jisx021230[code-0x8370]); + if ((code>=0x842F)&&(code<=0x8880)) + return(tab_uni_jisx021231[code-0x842F]); + if ((code>=0x8898)&&(code<=0x89BC)) + return(tab_uni_jisx021232[code-0x8898]); + if ((code>=0x89D4)&&(code<=0x8B9F)) + return(tab_uni_jisx021233[code-0x89D4]); + if ((code>=0x8C38)&&(code<=0x8CA4)) + return(tab_uni_jisx021234[code-0x8C38]); + if ((code>=0x8CB9)&&(code<=0x8D1B)) + return(tab_uni_jisx021235[code-0x8CB9]); + if ((code>=0x8D65)&&(code<=0x8F65)) + return(tab_uni_jisx021236[code-0x8D65]); + if ((code>=0x8F9D)&&(code<=0x9484)) + return(tab_uni_jisx021237[code-0x8F9D]); + if ((code>=0x9578)&&(code<=0x95E6)) + return(tab_uni_jisx021238[code-0x9578]); + if ((code>=0x961D)&&(code<=0x986C)) + return(tab_uni_jisx021239[code-0x961D]); + if ((code>=0x98AB)&&(code<=0x98CC)) + return(tab_uni_jisx021240[code-0x98AB]); + if ((code>=0x98E1)&&(code<=0x9960)) + return(tab_uni_jisx021241[code-0x98E1]); + if ((code>=0x999B)&&(code<=0x9A5D)) + return(tab_uni_jisx021242[code-0x999B]); + if ((code>=0x9AAA)&&(code<=0x9C7B)) + return(tab_uni_jisx021243[code-0x9AAA]); + if ((code>=0x9CE6)&&(code<=0x9E1D)) + return(tab_uni_jisx021244[code-0x9CE6]); + if ((code>=0x9E7A)&&(code<=0x9FA5)) + return(tab_uni_jisx021245[code-0x9E7A]); + if ((code>=0xF929)&&(code<=0xF929)) + return(tab_uni_jisx021246[code-0xF929]); + if ((code>=0xF9DC)&&(code<=0xF9DC)) + return(tab_uni_jisx021247[code-0xF9DC]); + if ((code>=0xFA00)&&(code<=0xFA2D)) + return(tab_uni_jisx021248[code-0xFA00]); + if ((code>=0xFF00)&&(code<=0xFF07)) + return(tab_uni_jisx021249[code-0xFF00]); + if ((code>=0xFFE4)&&(code<=0xFFE4)) + return(tab_uni_jisx021250[code-0xFFE4]); + return(0); +} + +/* page 0 0x222F-0x2244 */ +static uint16 tab_jisx0212_uni0[]={ +0x02D8,0x02C7,0x00B8,0x02D9,0x02DD,0x00AF,0x02DB,0x02DA, +0xFF5E,0x0384,0x0385, 0, 0, 0, 0, 0, + 0, 0, 0,0x00A1,0xFFE4,0x00BF}; + +/* page 1 0x226B-0x2271 */ +static uint16 tab_jisx0212_uni1[]={ +0x00BA,0x00AA,0x00A9,0x00AE,0x2122,0x00A4,0x2116}; + +/* page 2 0x2661-0x267C */ +static uint16 tab_jisx0212_uni2[]={ +0x0386,0x0388,0x0389,0x038A,0x03AA, 0,0x038C, 0, +0x038E,0x03AB, 0,0x038F, 0, 0, 0, 0, +0x03AC,0x03AD,0x03AE,0x03AF,0x03CA,0x0390,0x03CC,0x03C2, +0x03CD,0x03CB,0x03B0,0x03CE}; + +/* page 3 0x2742-0x274E */ +static uint16 tab_jisx0212_uni3[]={ +0x0402,0x0403,0x0404,0x0405,0x0406,0x0407,0x0408,0x0409, +0x040A,0x040B,0x040C,0x040E,0x040F}; + +/* page 4 0x2772-0x277E */ +static uint16 tab_jisx0212_uni4[]={ +0x0452,0x0453,0x0454,0x0455,0x0456,0x0457,0x0458,0x0459, +0x045A,0x045B,0x045C,0x045E,0x045F}; + +/* page 5 0x2921-0x2950 */ +static uint16 tab_jisx0212_uni5[]={ +0x00C6,0x0110, 0,0x0126, 0,0x0132, 0,0x0141, +0x013F, 0,0x014A,0x00D8,0x0152, 0,0x0166,0x00DE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x00E6,0x0111,0x00F0,0x0127,0x0131,0x0133,0x0138,0x0142, +0x0140,0x0149,0x014B,0x00F8,0x0153,0x00DF,0x0167,0x00FE +}; + +/* page 6 0x2A21-0x2A77 */ +static uint16 tab_jisx0212_uni6[]={ +0x00C1,0x00C0,0x00C4,0x00C2,0x0102,0x01CD,0x0100,0x0104, +0x00C5,0x00C3,0x0106,0x0108,0x010C,0x00C7,0x010A,0x010E, +0x00C9,0x00C8,0x00CB,0x00CA,0x011A,0x0116,0x0112,0x0118, + 0,0x011C,0x011E,0x0122,0x0120,0x0124,0x00CD,0x00CC, +0x00CF,0x00CE,0x01CF,0x0130,0x012A,0x012E,0x0128,0x0134, +0x0136,0x0139,0x013D,0x013B,0x0143,0x0147,0x0145,0x00D1, +0x00D3,0x00D2,0x00D6,0x00D4,0x01D1,0x0150,0x014C,0x00D5, +0x0154,0x0158,0x0156,0x015A,0x015C,0x0160,0x015E,0x0164, +0x0162,0x00DA,0x00D9,0x00DC,0x00DB,0x016C,0x01D3,0x0170, +0x016A,0x0172,0x016E,0x0168,0x01D7,0x01DB,0x01D9,0x01D5, +0x0174,0x00DD,0x0178,0x0176,0x0179,0x017D,0x017B}; + +/* page 7 0x2B21-0x2B77 */ +static uint16 tab_jisx0212_uni7[]={ +0x00E1,0x00E0,0x00E4,0x00E2,0x0103,0x01CE,0x0101,0x0105, +0x00E5,0x00E3,0x0107,0x0109,0x010D,0x00E7,0x010B,0x010F, +0x00E9,0x00E8,0x00EB,0x00EA,0x011B,0x0117,0x0113,0x0119, +0x01F5,0x011D,0x011F, 0,0x0121,0x0125,0x00ED,0x00EC, +0x00EF,0x00EE,0x01D0, 0,0x012B,0x012F,0x0129,0x0135, +0x0137,0x013A,0x013E,0x013C,0x0144,0x0148,0x0146,0x00F1, +0x00F3,0x00F2,0x00F6,0x00F4,0x01D2,0x0151,0x014D,0x00F5, +0x0155,0x0159,0x0157,0x015B,0x015D,0x0161,0x015F,0x0165, +0x0163,0x00FA,0x00F9,0x00FC,0x00FB,0x016D,0x01D4,0x0171, +0x016B,0x0173,0x016F,0x0169,0x01D8,0x01DC,0x01DA,0x01D6, +0x0175,0x00FD,0x00FF,0x0177,0x017A,0x017E,0x017C}; + +/* page 8 0x3021-0x307E */ +static uint16 tab_jisx0212_uni8[]={ +0x4E02,0x4E04,0x4E05,0x4E0C,0x4E12,0x4E1F,0x4E23,0x4E24, +0x4E28,0x4E2B,0x4E2E,0x4E2F,0x4E30,0x4E35,0x4E40,0x4E41, +0x4E44,0x4E47,0x4E51,0x4E5A,0x4E5C,0x4E63,0x4E68,0x4E69, +0x4E74,0x4E75,0x4E79,0x4E7F,0x4E8D,0x4E96,0x4E97,0x4E9D, +0x4EAF,0x4EB9,0x4EC3,0x4ED0,0x4EDA,0x4EDB,0x4EE0,0x4EE1, +0x4EE2,0x4EE8,0x4EEF,0x4EF1,0x4EF3,0x4EF5,0x4EFD,0x4EFE, +0x4EFF,0x4F00,0x4F02,0x4F03,0x4F08,0x4F0B,0x4F0C,0x4F12, +0x4F15,0x4F16,0x4F17,0x4F19,0x4F2E,0x4F31,0x4F60,0x4F33, +0x4F35,0x4F37,0x4F39,0x4F3B,0x4F3E,0x4F40,0x4F42,0x4F48, +0x4F49,0x4F4B,0x4F4C,0x4F52,0x4F54,0x4F56,0x4F58,0x4F5F, +0x4F63,0x4F6A,0x4F6C,0x4F6E,0x4F71,0x4F77,0x4F78,0x4F79, +0x4F7A,0x4F7D,0x4F7E,0x4F81,0x4F82,0x4F84}; + +/* page 9 0x3121-0x317E */ +static uint16 tab_jisx0212_uni9[]={ +0x4F85,0x4F89,0x4F8A,0x4F8C,0x4F8E,0x4F90,0x4F92,0x4F93, +0x4F94,0x4F97,0x4F99,0x4F9A,0x4F9E,0x4F9F,0x4FB2,0x4FB7, +0x4FB9,0x4FBB,0x4FBC,0x4FBD,0x4FBE,0x4FC0,0x4FC1,0x4FC5, +0x4FC6,0x4FC8,0x4FC9,0x4FCB,0x4FCC,0x4FCD,0x4FCF,0x4FD2, +0x4FDC,0x4FE0,0x4FE2,0x4FF0,0x4FF2,0x4FFC,0x4FFD,0x4FFF, +0x5000,0x5001,0x5004,0x5007,0x500A,0x500C,0x500E,0x5010, +0x5013,0x5017,0x5018,0x501B,0x501C,0x501D,0x501E,0x5022, +0x5027,0x502E,0x5030,0x5032,0x5033,0x5035,0x5040,0x5041, +0x5042,0x5045,0x5046,0x504A,0x504C,0x504E,0x5051,0x5052, +0x5053,0x5057,0x5059,0x505F,0x5060,0x5062,0x5063,0x5066, +0x5067,0x506A,0x506D,0x5070,0x5071,0x503B,0x5081,0x5083, +0x5084,0x5086,0x508A,0x508E,0x508F,0x5090}; + +/* page 10 0x3221-0x327E */ +static uint16 tab_jisx0212_uni10[]={ +0x5092,0x5093,0x5094,0x5096,0x509B,0x509C,0x509E,0x509F, +0x50A0,0x50A1,0x50A2,0x50AA,0x50AF,0x50B0,0x50B9,0x50BA, +0x50BD,0x50C0,0x50C3,0x50C4,0x50C7,0x50CC,0x50CE,0x50D0, +0x50D3,0x50D4,0x50D8,0x50DC,0x50DD,0x50DF,0x50E2,0x50E4, +0x50E6,0x50E8,0x50E9,0x50EF,0x50F1,0x50F6,0x50FA,0x50FE, +0x5103,0x5106,0x5107,0x5108,0x510B,0x510C,0x510D,0x510E, +0x50F2,0x5110,0x5117,0x5119,0x511B,0x511C,0x511D,0x511E, +0x5123,0x5127,0x5128,0x512C,0x512D,0x512F,0x5131,0x5133, +0x5134,0x5135,0x5138,0x5139,0x5142,0x514A,0x514F,0x5153, +0x5155,0x5157,0x5158,0x515F,0x5164,0x5166,0x517E,0x5183, +0x5184,0x518B,0x518E,0x5198,0x519D,0x51A1,0x51A3,0x51AD, +0x51B8,0x51BA,0x51BC,0x51BE,0x51BF,0x51C2}; + +/* page 11 0x3321-0x337E */ +static uint16 tab_jisx0212_uni11[]={ +0x51C8,0x51CF,0x51D1,0x51D2,0x51D3,0x51D5,0x51D8,0x51DE, +0x51E2,0x51E5,0x51EE,0x51F2,0x51F3,0x51F4,0x51F7,0x5201, +0x5202,0x5205,0x5212,0x5213,0x5215,0x5216,0x5218,0x5222, +0x5228,0x5231,0x5232,0x5235,0x523C,0x5245,0x5249,0x5255, +0x5257,0x5258,0x525A,0x525C,0x525F,0x5260,0x5261,0x5266, +0x526E,0x5277,0x5278,0x5279,0x5280,0x5282,0x5285,0x528A, +0x528C,0x5293,0x5295,0x5296,0x5297,0x5298,0x529A,0x529C, +0x52A4,0x52A5,0x52A6,0x52A7,0x52AF,0x52B0,0x52B6,0x52B7, +0x52B8,0x52BA,0x52BB,0x52BD,0x52C0,0x52C4,0x52C6,0x52C8, +0x52CC,0x52CF,0x52D1,0x52D4,0x52D6,0x52DB,0x52DC,0x52E1, +0x52E5,0x52E8,0x52E9,0x52EA,0x52EC,0x52F0,0x52F1,0x52F4, +0x52F6,0x52F7,0x5300,0x5303,0x530A,0x530B}; + +/* page 12 0x3421-0x347E */ +static uint16 tab_jisx0212_uni12[]={ +0x530C,0x5311,0x5313,0x5318,0x531B,0x531C,0x531E,0x531F, +0x5325,0x5327,0x5328,0x5329,0x532B,0x532C,0x532D,0x5330, +0x5332,0x5335,0x533C,0x533D,0x533E,0x5342,0x534C,0x534B, +0x5359,0x535B,0x5361,0x5363,0x5365,0x536C,0x536D,0x5372, +0x5379,0x537E,0x5383,0x5387,0x5388,0x538E,0x5393,0x5394, +0x5399,0x539D,0x53A1,0x53A4,0x53AA,0x53AB,0x53AF,0x53B2, +0x53B4,0x53B5,0x53B7,0x53B8,0x53BA,0x53BD,0x53C0,0x53C5, +0x53CF,0x53D2,0x53D3,0x53D5,0x53DA,0x53DD,0x53DE,0x53E0, +0x53E6,0x53E7,0x53F5,0x5402,0x5413,0x541A,0x5421,0x5427, +0x5428,0x542A,0x542F,0x5431,0x5434,0x5435,0x5443,0x5444, +0x5447,0x544D,0x544F,0x545E,0x5462,0x5464,0x5466,0x5467, +0x5469,0x546B,0x546D,0x546E,0x5474,0x547F}; + +/* page 13 0x3521-0x357E */ +static uint16 tab_jisx0212_uni13[]={ +0x5481,0x5483,0x5485,0x5488,0x5489,0x548D,0x5491,0x5495, +0x5496,0x549C,0x549F,0x54A1,0x54A6,0x54A7,0x54A9,0x54AA, +0x54AD,0x54AE,0x54B1,0x54B7,0x54B9,0x54BA,0x54BB,0x54BF, +0x54C6,0x54CA,0x54CD,0x54CE,0x54E0,0x54EA,0x54EC,0x54EF, +0x54F6,0x54FC,0x54FE,0x54FF,0x5500,0x5501,0x5505,0x5508, +0x5509,0x550C,0x550D,0x550E,0x5515,0x552A,0x552B,0x5532, +0x5535,0x5536,0x553B,0x553C,0x553D,0x5541,0x5547,0x5549, +0x554A,0x554D,0x5550,0x5551,0x5558,0x555A,0x555B,0x555E, +0x5560,0x5561,0x5564,0x5566,0x557F,0x5581,0x5582,0x5586, +0x5588,0x558E,0x558F,0x5591,0x5592,0x5593,0x5594,0x5597, +0x55A3,0x55A4,0x55AD,0x55B2,0x55BF,0x55C1,0x55C3,0x55C6, +0x55C9,0x55CB,0x55CC,0x55CE,0x55D1,0x55D2}; + +/* page 14 0x3621-0x367E */ +static uint16 tab_jisx0212_uni14[]={ +0x55D3,0x55D7,0x55D8,0x55DB,0x55DE,0x55E2,0x55E9,0x55F6, +0x55FF,0x5605,0x5608,0x560A,0x560D,0x560E,0x560F,0x5610, +0x5611,0x5612,0x5619,0x562C,0x5630,0x5633,0x5635,0x5637, +0x5639,0x563B,0x563C,0x563D,0x563F,0x5640,0x5641,0x5643, +0x5644,0x5646,0x5649,0x564B,0x564D,0x564F,0x5654,0x565E, +0x5660,0x5661,0x5662,0x5663,0x5666,0x5669,0x566D,0x566F, +0x5671,0x5672,0x5675,0x5684,0x5685,0x5688,0x568B,0x568C, +0x5695,0x5699,0x569A,0x569D,0x569E,0x569F,0x56A6,0x56A7, +0x56A8,0x56A9,0x56AB,0x56AC,0x56AD,0x56B1,0x56B3,0x56B7, +0x56BE,0x56C5,0x56C9,0x56CA,0x56CB,0x56CF,0x56D0,0x56CC, +0x56CD,0x56D9,0x56DC,0x56DD,0x56DF,0x56E1,0x56E4,0x56E5, +0x56E6,0x56E7,0x56E8,0x56F1,0x56EB,0x56ED}; + +/* page 15 0x3721-0x377E */ +static uint16 tab_jisx0212_uni15[]={ +0x56F6,0x56F7,0x5701,0x5702,0x5707,0x570A,0x570C,0x5711, +0x5715,0x571A,0x571B,0x571D,0x5720,0x5722,0x5723,0x5724, +0x5725,0x5729,0x572A,0x572C,0x572E,0x572F,0x5733,0x5734, +0x573D,0x573E,0x573F,0x5745,0x5746,0x574C,0x574D,0x5752, +0x5762,0x5765,0x5767,0x5768,0x576B,0x576D,0x576E,0x576F, +0x5770,0x5771,0x5773,0x5774,0x5775,0x5777,0x5779,0x577A, +0x577B,0x577C,0x577E,0x5781,0x5783,0x578C,0x5794,0x5797, +0x5799,0x579A,0x579C,0x579D,0x579E,0x579F,0x57A1,0x5795, +0x57A7,0x57A8,0x57A9,0x57AC,0x57B8,0x57BD,0x57C7,0x57C8, +0x57CC,0x57CF,0x57D5,0x57DD,0x57DE,0x57E4,0x57E6,0x57E7, +0x57E9,0x57ED,0x57F0,0x57F5,0x57F6,0x57F8,0x57FD,0x57FE, +0x57FF,0x5803,0x5804,0x5808,0x5809,0x57E1}; + +/* page 16 0x3821-0x387E */ +static uint16 tab_jisx0212_uni16[]={ +0x580C,0x580D,0x581B,0x581E,0x581F,0x5820,0x5826,0x5827, +0x582D,0x5832,0x5839,0x583F,0x5849,0x584C,0x584D,0x584F, +0x5850,0x5855,0x585F,0x5861,0x5864,0x5867,0x5868,0x5878, +0x587C,0x587F,0x5880,0x5881,0x5887,0x5888,0x5889,0x588A, +0x588C,0x588D,0x588F,0x5890,0x5894,0x5896,0x589D,0x58A0, +0x58A1,0x58A2,0x58A6,0x58A9,0x58B1,0x58B2,0x58C4,0x58BC, +0x58C2,0x58C8,0x58CD,0x58CE,0x58D0,0x58D2,0x58D4,0x58D6, +0x58DA,0x58DD,0x58E1,0x58E2,0x58E9,0x58F3,0x5905,0x5906, +0x590B,0x590C,0x5912,0x5913,0x5914,0x8641,0x591D,0x5921, +0x5923,0x5924,0x5928,0x592F,0x5930,0x5933,0x5935,0x5936, +0x593F,0x5943,0x5946,0x5952,0x5953,0x5959,0x595B,0x595D, +0x595E,0x595F,0x5961,0x5963,0x596B,0x596D}; + +/* page 17 0x3921-0x397E */ +static uint16 tab_jisx0212_uni17[]={ +0x596F,0x5972,0x5975,0x5976,0x5979,0x597B,0x597C,0x598B, +0x598C,0x598E,0x5992,0x5995,0x5997,0x599F,0x59A4,0x59A7, +0x59AD,0x59AE,0x59AF,0x59B0,0x59B3,0x59B7,0x59BA,0x59BC, +0x59C1,0x59C3,0x59C4,0x59C8,0x59CA,0x59CD,0x59D2,0x59DD, +0x59DE,0x59DF,0x59E3,0x59E4,0x59E7,0x59EE,0x59EF,0x59F1, +0x59F2,0x59F4,0x59F7,0x5A00,0x5A04,0x5A0C,0x5A0D,0x5A0E, +0x5A12,0x5A13,0x5A1E,0x5A23,0x5A24,0x5A27,0x5A28,0x5A2A, +0x5A2D,0x5A30,0x5A44,0x5A45,0x5A47,0x5A48,0x5A4C,0x5A50, +0x5A55,0x5A5E,0x5A63,0x5A65,0x5A67,0x5A6D,0x5A77,0x5A7A, +0x5A7B,0x5A7E,0x5A8B,0x5A90,0x5A93,0x5A96,0x5A99,0x5A9C, +0x5A9E,0x5A9F,0x5AA0,0x5AA2,0x5AA7,0x5AAC,0x5AB1,0x5AB2, +0x5AB3,0x5AB5,0x5AB8,0x5ABA,0x5ABB,0x5ABF}; + +/* page 18 0x3A21-0x3A7E */ +static uint16 tab_jisx0212_uni18[]={ +0x5AC4,0x5AC6,0x5AC8,0x5ACF,0x5ADA,0x5ADC,0x5AE0,0x5AE5, +0x5AEA,0x5AEE,0x5AF5,0x5AF6,0x5AFD,0x5B00,0x5B01,0x5B08, +0x5B17,0x5B34,0x5B19,0x5B1B,0x5B1D,0x5B21,0x5B25,0x5B2D, +0x5B38,0x5B41,0x5B4B,0x5B4C,0x5B52,0x5B56,0x5B5E,0x5B68, +0x5B6E,0x5B6F,0x5B7C,0x5B7D,0x5B7E,0x5B7F,0x5B81,0x5B84, +0x5B86,0x5B8A,0x5B8E,0x5B90,0x5B91,0x5B93,0x5B94,0x5B96, +0x5BA8,0x5BA9,0x5BAC,0x5BAD,0x5BAF,0x5BB1,0x5BB2,0x5BB7, +0x5BBA,0x5BBC,0x5BC0,0x5BC1,0x5BCD,0x5BCF,0x5BD6,0x5BD7, +0x5BD8,0x5BD9,0x5BDA,0x5BE0,0x5BEF,0x5BF1,0x5BF4,0x5BFD, +0x5C0C,0x5C17,0x5C1E,0x5C1F,0x5C23,0x5C26,0x5C29,0x5C2B, +0x5C2C,0x5C2E,0x5C30,0x5C32,0x5C35,0x5C36,0x5C59,0x5C5A, +0x5C5C,0x5C62,0x5C63,0x5C67,0x5C68,0x5C69}; + +/* page 19 0x3B21-0x3B7E */ +static uint16 tab_jisx0212_uni19[]={ +0x5C6D,0x5C70,0x5C74,0x5C75,0x5C7A,0x5C7B,0x5C7C,0x5C7D, +0x5C87,0x5C88,0x5C8A,0x5C8F,0x5C92,0x5C9D,0x5C9F,0x5CA0, +0x5CA2,0x5CA3,0x5CA6,0x5CAA,0x5CB2,0x5CB4,0x5CB5,0x5CBA, +0x5CC9,0x5CCB,0x5CD2,0x5CDD,0x5CD7,0x5CEE,0x5CF1,0x5CF2, +0x5CF4,0x5D01,0x5D06,0x5D0D,0x5D12,0x5D2B,0x5D23,0x5D24, +0x5D26,0x5D27,0x5D31,0x5D34,0x5D39,0x5D3D,0x5D3F,0x5D42, +0x5D43,0x5D46,0x5D48,0x5D55,0x5D51,0x5D59,0x5D4A,0x5D5F, +0x5D60,0x5D61,0x5D62,0x5D64,0x5D6A,0x5D6D,0x5D70,0x5D79, +0x5D7A,0x5D7E,0x5D7F,0x5D81,0x5D83,0x5D88,0x5D8A,0x5D92, +0x5D93,0x5D94,0x5D95,0x5D99,0x5D9B,0x5D9F,0x5DA0,0x5DA7, +0x5DAB,0x5DB0,0x5DB4,0x5DB8,0x5DB9,0x5DC3,0x5DC7,0x5DCB, +0x5DD0,0x5DCE,0x5DD8,0x5DD9,0x5DE0,0x5DE4}; + +/* page 20 0x3C21-0x3C7E */ +static uint16 tab_jisx0212_uni20[]={ +0x5DE9,0x5DF8,0x5DF9,0x5E00,0x5E07,0x5E0D,0x5E12,0x5E14, +0x5E15,0x5E18,0x5E1F,0x5E20,0x5E2E,0x5E28,0x5E32,0x5E35, +0x5E3E,0x5E4B,0x5E50,0x5E49,0x5E51,0x5E56,0x5E58,0x5E5B, +0x5E5C,0x5E5E,0x5E68,0x5E6A,0x5E6B,0x5E6C,0x5E6D,0x5E6E, +0x5E70,0x5E80,0x5E8B,0x5E8E,0x5EA2,0x5EA4,0x5EA5,0x5EA8, +0x5EAA,0x5EAC,0x5EB1,0x5EB3,0x5EBD,0x5EBE,0x5EBF,0x5EC6, +0x5ECC,0x5ECB,0x5ECE,0x5ED1,0x5ED2,0x5ED4,0x5ED5,0x5EDC, +0x5EDE,0x5EE5,0x5EEB,0x5F02,0x5F06,0x5F07,0x5F08,0x5F0E, +0x5F19,0x5F1C,0x5F1D,0x5F21,0x5F22,0x5F23,0x5F24,0x5F28, +0x5F2B,0x5F2C,0x5F2E,0x5F30,0x5F34,0x5F36,0x5F3B,0x5F3D, +0x5F3F,0x5F40,0x5F44,0x5F45,0x5F47,0x5F4D,0x5F50,0x5F54, +0x5F58,0x5F5B,0x5F60,0x5F63,0x5F64,0x5F67}; + +/* page 21 0x3D21-0x3D7E */ +static uint16 tab_jisx0212_uni21[]={ +0x5F6F,0x5F72,0x5F74,0x5F75,0x5F78,0x5F7A,0x5F7D,0x5F7E, +0x5F89,0x5F8D,0x5F8F,0x5F96,0x5F9C,0x5F9D,0x5FA2,0x5FA7, +0x5FAB,0x5FA4,0x5FAC,0x5FAF,0x5FB0,0x5FB1,0x5FB8,0x5FC4, +0x5FC7,0x5FC8,0x5FC9,0x5FCB,0x5FD0,0x5FD1,0x5FD2,0x5FD3, +0x5FD4,0x5FDE,0x5FE1,0x5FE2,0x5FE8,0x5FE9,0x5FEA,0x5FEC, +0x5FED,0x5FEE,0x5FEF,0x5FF2,0x5FF3,0x5FF6,0x5FFA,0x5FFC, +0x6007,0x600A,0x600D,0x6013,0x6014,0x6017,0x6018,0x601A, +0x601F,0x6024,0x602D,0x6033,0x6035,0x6040,0x6047,0x6048, +0x6049,0x604C,0x6051,0x6054,0x6056,0x6057,0x605D,0x6061, +0x6067,0x6071,0x607E,0x607F,0x6082,0x6086,0x6088,0x608A, +0x608E,0x6091,0x6093,0x6095,0x6098,0x609D,0x609E,0x60A2, +0x60A4,0x60A5,0x60A8,0x60B0,0x60B1,0x60B7}; + +/* page 22 0x3E21-0x3E7E */ +static uint16 tab_jisx0212_uni22[]={ +0x60BB,0x60BE,0x60C2,0x60C4,0x60C8,0x60C9,0x60CA,0x60CB, +0x60CE,0x60CF,0x60D4,0x60D5,0x60D9,0x60DB,0x60DD,0x60DE, +0x60E2,0x60E5,0x60F2,0x60F5,0x60F8,0x60FC,0x60FD,0x6102, +0x6107,0x610A,0x610C,0x6110,0x6111,0x6112,0x6113,0x6114, +0x6116,0x6117,0x6119,0x611C,0x611E,0x6122,0x612A,0x612B, +0x6130,0x6131,0x6135,0x6136,0x6137,0x6139,0x6141,0x6145, +0x6146,0x6149,0x615E,0x6160,0x616C,0x6172,0x6178,0x617B, +0x617C,0x617F,0x6180,0x6181,0x6183,0x6184,0x618B,0x618D, +0x6192,0x6193,0x6197,0x6198,0x619C,0x619D,0x619F,0x61A0, +0x61A5,0x61A8,0x61AA,0x61AD,0x61B8,0x61B9,0x61BC,0x61C0, +0x61C1,0x61C2,0x61CE,0x61CF,0x61D5,0x61DC,0x61DD,0x61DE, +0x61DF,0x61E1,0x61E2,0x61E7,0x61E9,0x61E5}; + +/* page 23 0x3F21-0x3F7E */ +static uint16 tab_jisx0212_uni23[]={ +0x61EC,0x61ED,0x61EF,0x6201,0x6203,0x6204,0x6207,0x6213, +0x6215,0x621C,0x6220,0x6222,0x6223,0x6227,0x6229,0x622B, +0x6239,0x623D,0x6242,0x6243,0x6244,0x6246,0x624C,0x6250, +0x6251,0x6252,0x6254,0x6256,0x625A,0x625C,0x6264,0x626D, +0x626F,0x6273,0x627A,0x627D,0x628D,0x628E,0x628F,0x6290, +0x62A6,0x62A8,0x62B3,0x62B6,0x62B7,0x62BA,0x62BE,0x62BF, +0x62C4,0x62CE,0x62D5,0x62D6,0x62DA,0x62EA,0x62F2,0x62F4, +0x62FC,0x62FD,0x6303,0x6304,0x630A,0x630B,0x630D,0x6310, +0x6313,0x6316,0x6318,0x6329,0x632A,0x632D,0x6335,0x6336, +0x6339,0x633C,0x6341,0x6342,0x6343,0x6344,0x6346,0x634A, +0x634B,0x634E,0x6352,0x6353,0x6354,0x6358,0x635B,0x6365, +0x6366,0x636C,0x636D,0x6371,0x6374,0x6375}; + +/* page 24 0x4021-0x407E */ +static uint16 tab_jisx0212_uni24[]={ +0x6378,0x637C,0x637D,0x637F,0x6382,0x6384,0x6387,0x638A, +0x6390,0x6394,0x6395,0x6399,0x639A,0x639E,0x63A4,0x63A6, +0x63AD,0x63AE,0x63AF,0x63BD,0x63C1,0x63C5,0x63C8,0x63CE, +0x63D1,0x63D3,0x63D4,0x63D5,0x63DC,0x63E0,0x63E5,0x63EA, +0x63EC,0x63F2,0x63F3,0x63F5,0x63F8,0x63F9,0x6409,0x640A, +0x6410,0x6412,0x6414,0x6418,0x641E,0x6420,0x6422,0x6424, +0x6425,0x6429,0x642A,0x642F,0x6430,0x6435,0x643D,0x643F, +0x644B,0x644F,0x6451,0x6452,0x6453,0x6454,0x645A,0x645B, +0x645C,0x645D,0x645F,0x6460,0x6461,0x6463,0x646D,0x6473, +0x6474,0x647B,0x647D,0x6485,0x6487,0x648F,0x6490,0x6491, +0x6498,0x6499,0x649B,0x649D,0x649F,0x64A1,0x64A3,0x64A6, +0x64A8,0x64AC,0x64B3,0x64BD,0x64BE,0x64BF}; + +/* page 25 0x4121-0x417E */ +static uint16 tab_jisx0212_uni25[]={ +0x64C4,0x64C9,0x64CA,0x64CB,0x64CC,0x64CE,0x64D0,0x64D1, +0x64D5,0x64D7,0x64E4,0x64E5,0x64E9,0x64EA,0x64ED,0x64F0, +0x64F5,0x64F7,0x64FB,0x64FF,0x6501,0x6504,0x6508,0x6509, +0x650A,0x650F,0x6513,0x6514,0x6516,0x6519,0x651B,0x651E, +0x651F,0x6522,0x6526,0x6529,0x652E,0x6531,0x653A,0x653C, +0x653D,0x6543,0x6547,0x6549,0x6550,0x6552,0x6554,0x655F, +0x6560,0x6567,0x656B,0x657A,0x657D,0x6581,0x6585,0x658A, +0x6592,0x6595,0x6598,0x659D,0x65A0,0x65A3,0x65A6,0x65AE, +0x65B2,0x65B3,0x65B4,0x65BF,0x65C2,0x65C8,0x65C9,0x65CE, +0x65D0,0x65D4,0x65D6,0x65D8,0x65DF,0x65F0,0x65F2,0x65F4, +0x65F5,0x65F9,0x65FE,0x65FF,0x6600,0x6604,0x6608,0x6609, +0x660D,0x6611,0x6612,0x6615,0x6616,0x661D}; + +/* page 26 0x4221-0x427E */ +static uint16 tab_jisx0212_uni26[]={ +0x661E,0x6621,0x6622,0x6623,0x6624,0x6626,0x6629,0x662A, +0x662B,0x662C,0x662E,0x6630,0x6631,0x6633,0x6639,0x6637, +0x6640,0x6645,0x6646,0x664A,0x664C,0x6651,0x664E,0x6657, +0x6658,0x6659,0x665B,0x665C,0x6660,0x6661,0x66FB,0x666A, +0x666B,0x666C,0x667E,0x6673,0x6675,0x667F,0x6677,0x6678, +0x6679,0x667B,0x6680,0x667C,0x668B,0x668C,0x668D,0x6690, +0x6692,0x6699,0x669A,0x669B,0x669C,0x669F,0x66A0,0x66A4, +0x66AD,0x66B1,0x66B2,0x66B5,0x66BB,0x66BF,0x66C0,0x66C2, +0x66C3,0x66C8,0x66CC,0x66CE,0x66CF,0x66D4,0x66DB,0x66DF, +0x66E8,0x66EB,0x66EC,0x66EE,0x66FA,0x6705,0x6707,0x670E, +0x6713,0x6719,0x671C,0x6720,0x6722,0x6733,0x673E,0x6745, +0x6747,0x6748,0x674C,0x6754,0x6755,0x675D}; + +/* page 27 0x4321-0x437E */ +static uint16 tab_jisx0212_uni27[]={ +0x6766,0x676C,0x676E,0x6774,0x6776,0x677B,0x6781,0x6784, +0x678E,0x678F,0x6791,0x6793,0x6796,0x6798,0x6799,0x679B, +0x67B0,0x67B1,0x67B2,0x67B5,0x67BB,0x67BC,0x67BD,0x67F9, +0x67C0,0x67C2,0x67C3,0x67C5,0x67C8,0x67C9,0x67D2,0x67D7, +0x67D9,0x67DC,0x67E1,0x67E6,0x67F0,0x67F2,0x67F6,0x67F7, +0x6852,0x6814,0x6819,0x681D,0x681F,0x6828,0x6827,0x682C, +0x682D,0x682F,0x6830,0x6831,0x6833,0x683B,0x683F,0x6844, +0x6845,0x684A,0x684C,0x6855,0x6857,0x6858,0x685B,0x686B, +0x686E,0x686F,0x6870,0x6871,0x6872,0x6875,0x6879,0x687A, +0x687B,0x687C,0x6882,0x6884,0x6886,0x6888,0x6896,0x6898, +0x689A,0x689C,0x68A1,0x68A3,0x68A5,0x68A9,0x68AA,0x68AE, +0x68B2,0x68BB,0x68C5,0x68C8,0x68CC,0x68CF}; + +/* page 28 0x4421-0x447E */ +static uint16 tab_jisx0212_uni28[]={ +0x68D0,0x68D1,0x68D3,0x68D6,0x68D9,0x68DC,0x68DD,0x68E5, +0x68E8,0x68EA,0x68EB,0x68EC,0x68ED,0x68F0,0x68F1,0x68F5, +0x68F6,0x68FB,0x68FC,0x68FD,0x6906,0x6909,0x690A,0x6910, +0x6911,0x6913,0x6916,0x6917,0x6931,0x6933,0x6935,0x6938, +0x693B,0x6942,0x6945,0x6949,0x694E,0x6957,0x695B,0x6963, +0x6964,0x6965,0x6966,0x6968,0x6969,0x696C,0x6970,0x6971, +0x6972,0x697A,0x697B,0x697F,0x6980,0x698D,0x6992,0x6996, +0x6998,0x69A1,0x69A5,0x69A6,0x69A8,0x69AB,0x69AD,0x69AF, +0x69B7,0x69B8,0x69BA,0x69BC,0x69C5,0x69C8,0x69D1,0x69D6, +0x69D7,0x69E2,0x69E5,0x69EE,0x69EF,0x69F1,0x69F3,0x69F5, +0x69FE,0x6A00,0x6A01,0x6A03,0x6A0F,0x6A11,0x6A15,0x6A1A, +0x6A1D,0x6A20,0x6A24,0x6A28,0x6A30,0x6A32}; + +/* page 29 0x4521-0x457E */ +static uint16 tab_jisx0212_uni29[]={ +0x6A34,0x6A37,0x6A3B,0x6A3E,0x6A3F,0x6A45,0x6A46,0x6A49, +0x6A4A,0x6A4E,0x6A50,0x6A51,0x6A52,0x6A55,0x6A56,0x6A5B, +0x6A64,0x6A67,0x6A6A,0x6A71,0x6A73,0x6A7E,0x6A81,0x6A83, +0x6A86,0x6A87,0x6A89,0x6A8B,0x6A91,0x6A9B,0x6A9D,0x6A9E, +0x6A9F,0x6AA5,0x6AAB,0x6AAF,0x6AB0,0x6AB1,0x6AB4,0x6ABD, +0x6ABE,0x6ABF,0x6AC6,0x6AC9,0x6AC8,0x6ACC,0x6AD0,0x6AD4, +0x6AD5,0x6AD6,0x6ADC,0x6ADD,0x6AE4,0x6AE7,0x6AEC,0x6AF0, +0x6AF1,0x6AF2,0x6AFC,0x6AFD,0x6B02,0x6B03,0x6B06,0x6B07, +0x6B09,0x6B0F,0x6B10,0x6B11,0x6B17,0x6B1B,0x6B1E,0x6B24, +0x6B28,0x6B2B,0x6B2C,0x6B2F,0x6B35,0x6B36,0x6B3B,0x6B3F, +0x6B46,0x6B4A,0x6B4D,0x6B52,0x6B56,0x6B58,0x6B5D,0x6B60, +0x6B67,0x6B6B,0x6B6E,0x6B70,0x6B75,0x6B7D}; + +/* page 30 0x4621-0x467E */ +static uint16 tab_jisx0212_uni30[]={ +0x6B7E,0x6B82,0x6B85,0x6B97,0x6B9B,0x6B9F,0x6BA0,0x6BA2, +0x6BA3,0x6BA8,0x6BA9,0x6BAC,0x6BAD,0x6BAE,0x6BB0,0x6BB8, +0x6BB9,0x6BBD,0x6BBE,0x6BC3,0x6BC4,0x6BC9,0x6BCC,0x6BD6, +0x6BDA,0x6BE1,0x6BE3,0x6BE6,0x6BE7,0x6BEE,0x6BF1,0x6BF7, +0x6BF9,0x6BFF,0x6C02,0x6C04,0x6C05,0x6C09,0x6C0D,0x6C0E, +0x6C10,0x6C12,0x6C19,0x6C1F,0x6C26,0x6C27,0x6C28,0x6C2C, +0x6C2E,0x6C33,0x6C35,0x6C36,0x6C3A,0x6C3B,0x6C3F,0x6C4A, +0x6C4B,0x6C4D,0x6C4F,0x6C52,0x6C54,0x6C59,0x6C5B,0x6C5C, +0x6C6B,0x6C6D,0x6C6F,0x6C74,0x6C76,0x6C78,0x6C79,0x6C7B, +0x6C85,0x6C86,0x6C87,0x6C89,0x6C94,0x6C95,0x6C97,0x6C98, +0x6C9C,0x6C9F,0x6CB0,0x6CB2,0x6CB4,0x6CC2,0x6CC6,0x6CCD, +0x6CCF,0x6CD0,0x6CD1,0x6CD2,0x6CD4,0x6CD6}; + +/* page 31 0x4721-0x477E */ +static uint16 tab_jisx0212_uni31[]={ +0x6CDA,0x6CDC,0x6CE0,0x6CE7,0x6CE9,0x6CEB,0x6CEC,0x6CEE, +0x6CF2,0x6CF4,0x6D04,0x6D07,0x6D0A,0x6D0E,0x6D0F,0x6D11, +0x6D13,0x6D1A,0x6D26,0x6D27,0x6D28,0x6C67,0x6D2E,0x6D2F, +0x6D31,0x6D39,0x6D3C,0x6D3F,0x6D57,0x6D5E,0x6D5F,0x6D61, +0x6D65,0x6D67,0x6D6F,0x6D70,0x6D7C,0x6D82,0x6D87,0x6D91, +0x6D92,0x6D94,0x6D96,0x6D97,0x6D98,0x6DAA,0x6DAC,0x6DB4, +0x6DB7,0x6DB9,0x6DBD,0x6DBF,0x6DC4,0x6DC8,0x6DCA,0x6DCE, +0x6DCF,0x6DD6,0x6DDB,0x6DDD,0x6DDF,0x6DE0,0x6DE2,0x6DE5, +0x6DE9,0x6DEF,0x6DF0,0x6DF4,0x6DF6,0x6DFC,0x6E00,0x6E04, +0x6E1E,0x6E22,0x6E27,0x6E32,0x6E36,0x6E39,0x6E3B,0x6E3C, +0x6E44,0x6E45,0x6E48,0x6E49,0x6E4B,0x6E4F,0x6E51,0x6E52, +0x6E53,0x6E54,0x6E57,0x6E5C,0x6E5D,0x6E5E}; + +/* page 32 0x4821-0x487E */ +static uint16 tab_jisx0212_uni32[]={ +0x6E62,0x6E63,0x6E68,0x6E73,0x6E7B,0x6E7D,0x6E8D,0x6E93, +0x6E99,0x6EA0,0x6EA7,0x6EAD,0x6EAE,0x6EB1,0x6EB3,0x6EBB, +0x6EBF,0x6EC0,0x6EC1,0x6EC3,0x6EC7,0x6EC8,0x6ECA,0x6ECD, +0x6ECE,0x6ECF,0x6EEB,0x6EED,0x6EEE,0x6EF9,0x6EFB,0x6EFD, +0x6F04,0x6F08,0x6F0A,0x6F0C,0x6F0D,0x6F16,0x6F18,0x6F1A, +0x6F1B,0x6F26,0x6F29,0x6F2A,0x6F2F,0x6F30,0x6F33,0x6F36, +0x6F3B,0x6F3C,0x6F2D,0x6F4F,0x6F51,0x6F52,0x6F53,0x6F57, +0x6F59,0x6F5A,0x6F5D,0x6F5E,0x6F61,0x6F62,0x6F68,0x6F6C, +0x6F7D,0x6F7E,0x6F83,0x6F87,0x6F88,0x6F8B,0x6F8C,0x6F8D, +0x6F90,0x6F92,0x6F93,0x6F94,0x6F96,0x6F9A,0x6F9F,0x6FA0, +0x6FA5,0x6FA6,0x6FA7,0x6FA8,0x6FAE,0x6FAF,0x6FB0,0x6FB5, +0x6FB6,0x6FBC,0x6FC5,0x6FC7,0x6FC8,0x6FCA}; + +/* page 33 0x4921-0x497E */ +static uint16 tab_jisx0212_uni33[]={ +0x6FDA,0x6FDE,0x6FE8,0x6FE9,0x6FF0,0x6FF5,0x6FF9,0x6FFC, +0x6FFD,0x7000,0x7005,0x7006,0x7007,0x700D,0x7017,0x7020, +0x7023,0x702F,0x7034,0x7037,0x7039,0x703C,0x7043,0x7044, +0x7048,0x7049,0x704A,0x704B,0x7054,0x7055,0x705D,0x705E, +0x704E,0x7064,0x7065,0x706C,0x706E,0x7075,0x7076,0x707E, +0x7081,0x7085,0x7086,0x7094,0x7095,0x7096,0x7097,0x7098, +0x709B,0x70A4,0x70AB,0x70B0,0x70B1,0x70B4,0x70B7,0x70CA, +0x70D1,0x70D3,0x70D4,0x70D5,0x70D6,0x70D8,0x70DC,0x70E4, +0x70FA,0x7103,0x7104,0x7105,0x7106,0x7107,0x710B,0x710C, +0x710F,0x711E,0x7120,0x712B,0x712D,0x712F,0x7130,0x7131, +0x7138,0x7141,0x7145,0x7146,0x7147,0x714A,0x714B,0x7150, +0x7152,0x7157,0x715A,0x715C,0x715E,0x7160}; + +/* page 34 0x4A21-0x4A7E */ +static uint16 tab_jisx0212_uni34[]={ +0x7168,0x7179,0x7180,0x7185,0x7187,0x718C,0x7192,0x719A, +0x719B,0x71A0,0x71A2,0x71AF,0x71B0,0x71B2,0x71B3,0x71BA, +0x71BF,0x71C0,0x71C1,0x71C4,0x71CB,0x71CC,0x71D3,0x71D6, +0x71D9,0x71DA,0x71DC,0x71F8,0x71FE,0x7200,0x7207,0x7208, +0x7209,0x7213,0x7217,0x721A,0x721D,0x721F,0x7224,0x722B, +0x722F,0x7234,0x7238,0x7239,0x7241,0x7242,0x7243,0x7245, +0x724E,0x724F,0x7250,0x7253,0x7255,0x7256,0x725A,0x725C, +0x725E,0x7260,0x7263,0x7268,0x726B,0x726E,0x726F,0x7271, +0x7277,0x7278,0x727B,0x727C,0x727F,0x7284,0x7289,0x728D, +0x728E,0x7293,0x729B,0x72A8,0x72AD,0x72AE,0x72B1,0x72B4, +0x72BE,0x72C1,0x72C7,0x72C9,0x72CC,0x72D5,0x72D6,0x72D8, +0x72DF,0x72E5,0x72F3,0x72F4,0x72FA,0x72FB}; + +/* page 35 0x4B21-0x4B7E */ +static uint16 tab_jisx0212_uni35[]={ +0x72FE,0x7302,0x7304,0x7305,0x7307,0x730B,0x730D,0x7312, +0x7313,0x7318,0x7319,0x731E,0x7322,0x7324,0x7327,0x7328, +0x732C,0x7331,0x7332,0x7335,0x733A,0x733B,0x733D,0x7343, +0x734D,0x7350,0x7352,0x7356,0x7358,0x735D,0x735E,0x735F, +0x7360,0x7366,0x7367,0x7369,0x736B,0x736C,0x736E,0x736F, +0x7371,0x7377,0x7379,0x737C,0x7380,0x7381,0x7383,0x7385, +0x7386,0x738E,0x7390,0x7393,0x7395,0x7397,0x7398,0x739C, +0x739E,0x739F,0x73A0,0x73A2,0x73A5,0x73A6,0x73AA,0x73AB, +0x73AD,0x73B5,0x73B7,0x73B9,0x73BC,0x73BD,0x73BF,0x73C5, +0x73C6,0x73C9,0x73CB,0x73CC,0x73CF,0x73D2,0x73D3,0x73D6, +0x73D9,0x73DD,0x73E1,0x73E3,0x73E6,0x73E7,0x73E9,0x73F4, +0x73F5,0x73F7,0x73F9,0x73FA,0x73FB,0x73FD}; + +/* page 36 0x4C21-0x4C7E */ +static uint16 tab_jisx0212_uni36[]={ +0x73FF,0x7400,0x7401,0x7404,0x7407,0x740A,0x7411,0x741A, +0x741B,0x7424,0x7426,0x7428,0x7429,0x742A,0x742B,0x742C, +0x742D,0x742E,0x742F,0x7430,0x7431,0x7439,0x7440,0x7443, +0x7444,0x7446,0x7447,0x744B,0x744D,0x7451,0x7452,0x7457, +0x745D,0x7462,0x7466,0x7467,0x7468,0x746B,0x746D,0x746E, +0x7471,0x7472,0x7480,0x7481,0x7485,0x7486,0x7487,0x7489, +0x748F,0x7490,0x7491,0x7492,0x7498,0x7499,0x749A,0x749C, +0x749F,0x74A0,0x74A1,0x74A3,0x74A6,0x74A8,0x74A9,0x74AA, +0x74AB,0x74AE,0x74AF,0x74B1,0x74B2,0x74B5,0x74B9,0x74BB, +0x74BF,0x74C8,0x74C9,0x74CC,0x74D0,0x74D3,0x74D8,0x74DA, +0x74DB,0x74DE,0x74DF,0x74E4,0x74E8,0x74EA,0x74EB,0x74EF, +0x74F4,0x74FA,0x74FB,0x74FC,0x74FF,0x7506}; + +/* page 37 0x4D21-0x4D7E */ +static uint16 tab_jisx0212_uni37[]={ +0x7512,0x7516,0x7517,0x7520,0x7521,0x7524,0x7527,0x7529, +0x752A,0x752F,0x7536,0x7539,0x753D,0x753E,0x753F,0x7540, +0x7543,0x7547,0x7548,0x754E,0x7550,0x7552,0x7557,0x755E, +0x755F,0x7561,0x756F,0x7571,0x7579,0x757A,0x757B,0x757C, +0x757D,0x757E,0x7581,0x7585,0x7590,0x7592,0x7593,0x7595, +0x7599,0x759C,0x75A2,0x75A4,0x75B4,0x75BA,0x75BF,0x75C0, +0x75C1,0x75C4,0x75C6,0x75CC,0x75CE,0x75CF,0x75D7,0x75DC, +0x75DF,0x75E0,0x75E1,0x75E4,0x75E7,0x75EC,0x75EE,0x75EF, +0x75F1,0x75F9,0x7600,0x7602,0x7603,0x7604,0x7607,0x7608, +0x760A,0x760C,0x760F,0x7612,0x7613,0x7615,0x7616,0x7619, +0x761B,0x761C,0x761D,0x761E,0x7623,0x7625,0x7626,0x7629, +0x762D,0x7632,0x7633,0x7635,0x7638,0x7639}; + +/* page 38 0x4E21-0x4E7E */ +static uint16 tab_jisx0212_uni38[]={ +0x763A,0x763C,0x764A,0x7640,0x7641,0x7643,0x7644,0x7645, +0x7649,0x764B,0x7655,0x7659,0x765F,0x7664,0x7665,0x766D, +0x766E,0x766F,0x7671,0x7674,0x7681,0x7685,0x768C,0x768D, +0x7695,0x769B,0x769C,0x769D,0x769F,0x76A0,0x76A2,0x76A3, +0x76A4,0x76A5,0x76A6,0x76A7,0x76A8,0x76AA,0x76AD,0x76BD, +0x76C1,0x76C5,0x76C9,0x76CB,0x76CC,0x76CE,0x76D4,0x76D9, +0x76E0,0x76E6,0x76E8,0x76EC,0x76F0,0x76F1,0x76F6,0x76F9, +0x76FC,0x7700,0x7706,0x770A,0x770E,0x7712,0x7714,0x7715, +0x7717,0x7719,0x771A,0x771C,0x7722,0x7728,0x772D,0x772E, +0x772F,0x7734,0x7735,0x7736,0x7739,0x773D,0x773E,0x7742, +0x7745,0x7746,0x774A,0x774D,0x774E,0x774F,0x7752,0x7756, +0x7757,0x775C,0x775E,0x775F,0x7760,0x7762}; + +/* page 39 0x4F21-0x4F7E */ +static uint16 tab_jisx0212_uni39[]={ +0x7764,0x7767,0x776A,0x776C,0x7770,0x7772,0x7773,0x7774, +0x777A,0x777D,0x7780,0x7784,0x778C,0x778D,0x7794,0x7795, +0x7796,0x779A,0x779F,0x77A2,0x77A7,0x77AA,0x77AE,0x77AF, +0x77B1,0x77B5,0x77BE,0x77C3,0x77C9,0x77D1,0x77D2,0x77D5, +0x77D9,0x77DE,0x77DF,0x77E0,0x77E4,0x77E6,0x77EA,0x77EC, +0x77F0,0x77F1,0x77F4,0x77F8,0x77FB,0x7805,0x7806,0x7809, +0x780D,0x780E,0x7811,0x781D,0x7821,0x7822,0x7823,0x782D, +0x782E,0x7830,0x7835,0x7837,0x7843,0x7844,0x7847,0x7848, +0x784C,0x784E,0x7852,0x785C,0x785E,0x7860,0x7861,0x7863, +0x7864,0x7868,0x786A,0x786E,0x787A,0x787E,0x788A,0x788F, +0x7894,0x7898,0x78A1,0x789D,0x789E,0x789F,0x78A4,0x78A8, +0x78AC,0x78AD,0x78B0,0x78B1,0x78B2,0x78B3}; + +/* page 40 0x5021-0x507E */ +static uint16 tab_jisx0212_uni40[]={ +0x78BB,0x78BD,0x78BF,0x78C7,0x78C8,0x78C9,0x78CC,0x78CE, +0x78D2,0x78D3,0x78D5,0x78D6,0x78E4,0x78DB,0x78DF,0x78E0, +0x78E1,0x78E6,0x78EA,0x78F2,0x78F3,0x7900,0x78F6,0x78F7, +0x78FA,0x78FB,0x78FF,0x7906,0x790C,0x7910,0x791A,0x791C, +0x791E,0x791F,0x7920,0x7925,0x7927,0x7929,0x792D,0x7931, +0x7934,0x7935,0x793B,0x793D,0x793F,0x7944,0x7945,0x7946, +0x794A,0x794B,0x794F,0x7951,0x7954,0x7958,0x795B,0x795C, +0x7967,0x7969,0x796B,0x7972,0x7979,0x797B,0x797C,0x797E, +0x798B,0x798C,0x7991,0x7993,0x7994,0x7995,0x7996,0x7998, +0x799B,0x799C,0x79A1,0x79A8,0x79A9,0x79AB,0x79AF,0x79B1, +0x79B4,0x79B8,0x79BB,0x79C2,0x79C4,0x79C7,0x79C8,0x79CA, +0x79CF,0x79D4,0x79D6,0x79DA,0x79DD,0x79DE}; + +/* page 41 0x5121-0x517E */ +static uint16 tab_jisx0212_uni41[]={ +0x79E0,0x79E2,0x79E5,0x79EA,0x79EB,0x79ED,0x79F1,0x79F8, +0x79FC,0x7A02,0x7A03,0x7A07,0x7A09,0x7A0A,0x7A0C,0x7A11, +0x7A15,0x7A1B,0x7A1E,0x7A21,0x7A27,0x7A2B,0x7A2D,0x7A2F, +0x7A30,0x7A34,0x7A35,0x7A38,0x7A39,0x7A3A,0x7A44,0x7A45, +0x7A47,0x7A48,0x7A4C,0x7A55,0x7A56,0x7A59,0x7A5C,0x7A5D, +0x7A5F,0x7A60,0x7A65,0x7A67,0x7A6A,0x7A6D,0x7A75,0x7A78, +0x7A7E,0x7A80,0x7A82,0x7A85,0x7A86,0x7A8A,0x7A8B,0x7A90, +0x7A91,0x7A94,0x7A9E,0x7AA0,0x7AA3,0x7AAC,0x7AB3,0x7AB5, +0x7AB9,0x7ABB,0x7ABC,0x7AC6,0x7AC9,0x7ACC,0x7ACE,0x7AD1, +0x7ADB,0x7AE8,0x7AE9,0x7AEB,0x7AEC,0x7AF1,0x7AF4,0x7AFB, +0x7AFD,0x7AFE,0x7B07,0x7B14,0x7B1F,0x7B23,0x7B27,0x7B29, +0x7B2A,0x7B2B,0x7B2D,0x7B2E,0x7B2F,0x7B30}; + +/* page 42 0x5221-0x527E */ +static uint16 tab_jisx0212_uni42[]={ +0x7B31,0x7B34,0x7B3D,0x7B3F,0x7B40,0x7B41,0x7B47,0x7B4E, +0x7B55,0x7B60,0x7B64,0x7B66,0x7B69,0x7B6A,0x7B6D,0x7B6F, +0x7B72,0x7B73,0x7B77,0x7B84,0x7B89,0x7B8E,0x7B90,0x7B91, +0x7B96,0x7B9B,0x7B9E,0x7BA0,0x7BA5,0x7BAC,0x7BAF,0x7BB0, +0x7BB2,0x7BB5,0x7BB6,0x7BBA,0x7BBB,0x7BBC,0x7BBD,0x7BC2, +0x7BC5,0x7BC8,0x7BCA,0x7BD4,0x7BD6,0x7BD7,0x7BD9,0x7BDA, +0x7BDB,0x7BE8,0x7BEA,0x7BF2,0x7BF4,0x7BF5,0x7BF8,0x7BF9, +0x7BFA,0x7BFC,0x7BFE,0x7C01,0x7C02,0x7C03,0x7C04,0x7C06, +0x7C09,0x7C0B,0x7C0C,0x7C0E,0x7C0F,0x7C19,0x7C1B,0x7C20, +0x7C25,0x7C26,0x7C28,0x7C2C,0x7C31,0x7C33,0x7C34,0x7C36, +0x7C39,0x7C3A,0x7C46,0x7C4A,0x7C55,0x7C51,0x7C52,0x7C53, +0x7C59,0x7C5A,0x7C5B,0x7C5C,0x7C5D,0x7C5E}; + +/* page 43 0x5321-0x537E */ +static uint16 tab_jisx0212_uni43[]={ +0x7C61,0x7C63,0x7C67,0x7C69,0x7C6D,0x7C6E,0x7C70,0x7C72, +0x7C79,0x7C7C,0x7C7D,0x7C86,0x7C87,0x7C8F,0x7C94,0x7C9E, +0x7CA0,0x7CA6,0x7CB0,0x7CB6,0x7CB7,0x7CBA,0x7CBB,0x7CBC, +0x7CBF,0x7CC4,0x7CC7,0x7CC8,0x7CC9,0x7CCD,0x7CCF,0x7CD3, +0x7CD4,0x7CD5,0x7CD7,0x7CD9,0x7CDA,0x7CDD,0x7CE6,0x7CE9, +0x7CEB,0x7CF5,0x7D03,0x7D07,0x7D08,0x7D09,0x7D0F,0x7D11, +0x7D12,0x7D13,0x7D16,0x7D1D,0x7D1E,0x7D23,0x7D26,0x7D2A, +0x7D2D,0x7D31,0x7D3C,0x7D3D,0x7D3E,0x7D40,0x7D41,0x7D47, +0x7D48,0x7D4D,0x7D51,0x7D53,0x7D57,0x7D59,0x7D5A,0x7D5C, +0x7D5D,0x7D65,0x7D67,0x7D6A,0x7D70,0x7D78,0x7D7A,0x7D7B, +0x7D7F,0x7D81,0x7D82,0x7D83,0x7D85,0x7D86,0x7D88,0x7D8B, +0x7D8C,0x7D8D,0x7D91,0x7D96,0x7D97,0x7D9D}; + +/* page 44 0x5421-0x547E */ +static uint16 tab_jisx0212_uni44[]={ +0x7D9E,0x7DA6,0x7DA7,0x7DAA,0x7DB3,0x7DB6,0x7DB7,0x7DB9, +0x7DC2,0x7DC3,0x7DC4,0x7DC5,0x7DC6,0x7DCC,0x7DCD,0x7DCE, +0x7DD7,0x7DD9,0x7E00,0x7DE2,0x7DE5,0x7DE6,0x7DEA,0x7DEB, +0x7DED,0x7DF1,0x7DF5,0x7DF6,0x7DF9,0x7DFA,0x7E08,0x7E10, +0x7E11,0x7E15,0x7E17,0x7E1C,0x7E1D,0x7E20,0x7E27,0x7E28, +0x7E2C,0x7E2D,0x7E2F,0x7E33,0x7E36,0x7E3F,0x7E44,0x7E45, +0x7E47,0x7E4E,0x7E50,0x7E52,0x7E58,0x7E5F,0x7E61,0x7E62, +0x7E65,0x7E6B,0x7E6E,0x7E6F,0x7E73,0x7E78,0x7E7E,0x7E81, +0x7E86,0x7E87,0x7E8A,0x7E8D,0x7E91,0x7E95,0x7E98,0x7E9A, +0x7E9D,0x7E9E,0x7F3C,0x7F3B,0x7F3D,0x7F3E,0x7F3F,0x7F43, +0x7F44,0x7F47,0x7F4F,0x7F52,0x7F53,0x7F5B,0x7F5C,0x7F5D, +0x7F61,0x7F63,0x7F64,0x7F65,0x7F66,0x7F6D}; + +/* page 45 0x5521-0x557E */ +static uint16 tab_jisx0212_uni45[]={ +0x7F71,0x7F7D,0x7F7E,0x7F7F,0x7F80,0x7F8B,0x7F8D,0x7F8F, +0x7F90,0x7F91,0x7F96,0x7F97,0x7F9C,0x7FA1,0x7FA2,0x7FA6, +0x7FAA,0x7FAD,0x7FB4,0x7FBC,0x7FBF,0x7FC0,0x7FC3,0x7FC8, +0x7FCE,0x7FCF,0x7FDB,0x7FDF,0x7FE3,0x7FE5,0x7FE8,0x7FEC, +0x7FEE,0x7FEF,0x7FF2,0x7FFA,0x7FFD,0x7FFE,0x7FFF,0x8007, +0x8008,0x800A,0x800D,0x800E,0x800F,0x8011,0x8013,0x8014, +0x8016,0x801D,0x801E,0x801F,0x8020,0x8024,0x8026,0x802C, +0x802E,0x8030,0x8034,0x8035,0x8037,0x8039,0x803A,0x803C, +0x803E,0x8040,0x8044,0x8060,0x8064,0x8066,0x806D,0x8071, +0x8075,0x8081,0x8088,0x808E,0x809C,0x809E,0x80A6,0x80A7, +0x80AB,0x80B8,0x80B9,0x80C8,0x80CD,0x80CF,0x80D2,0x80D4, +0x80D5,0x80D7,0x80D8,0x80E0,0x80ED,0x80EE}; + +/* page 46 0x5621-0x567E */ +static uint16 tab_jisx0212_uni46[]={ +0x80F0,0x80F2,0x80F3,0x80F6,0x80F9,0x80FA,0x80FE,0x8103, +0x810B,0x8116,0x8117,0x8118,0x811C,0x811E,0x8120,0x8124, +0x8127,0x812C,0x8130,0x8135,0x813A,0x813C,0x8145,0x8147, +0x814A,0x814C,0x8152,0x8157,0x8160,0x8161,0x8167,0x8168, +0x8169,0x816D,0x816F,0x8177,0x8181,0x8190,0x8184,0x8185, +0x8186,0x818B,0x818E,0x8196,0x8198,0x819B,0x819E,0x81A2, +0x81AE,0x81B2,0x81B4,0x81BB,0x81CB,0x81C3,0x81C5,0x81CA, +0x81CE,0x81CF,0x81D5,0x81D7,0x81DB,0x81DD,0x81DE,0x81E1, +0x81E4,0x81EB,0x81EC,0x81F0,0x81F1,0x81F2,0x81F5,0x81F6, +0x81F8,0x81F9,0x81FD,0x81FF,0x8200,0x8203,0x820F,0x8213, +0x8214,0x8219,0x821A,0x821D,0x8221,0x8222,0x8228,0x8232, +0x8234,0x823A,0x8243,0x8244,0x8245,0x8246}; + +/* page 47 0x5721-0x577E */ +static uint16 tab_jisx0212_uni47[]={ +0x824B,0x824E,0x824F,0x8251,0x8256,0x825C,0x8260,0x8263, +0x8267,0x826D,0x8274,0x827B,0x827D,0x827F,0x8280,0x8281, +0x8283,0x8284,0x8287,0x8289,0x828A,0x828E,0x8291,0x8294, +0x8296,0x8298,0x829A,0x829B,0x82A0,0x82A1,0x82A3,0x82A4, +0x82A7,0x82A8,0x82A9,0x82AA,0x82AE,0x82B0,0x82B2,0x82B4, +0x82B7,0x82BA,0x82BC,0x82BE,0x82BF,0x82C6,0x82D0,0x82D5, +0x82DA,0x82E0,0x82E2,0x82E4,0x82E8,0x82EA,0x82ED,0x82EF, +0x82F6,0x82F7,0x82FD,0x82FE,0x8300,0x8301,0x8307,0x8308, +0x830A,0x830B,0x8354,0x831B,0x831D,0x831E,0x831F,0x8321, +0x8322,0x832C,0x832D,0x832E,0x8330,0x8333,0x8337,0x833A, +0x833C,0x833D,0x8342,0x8343,0x8344,0x8347,0x834D,0x834E, +0x8351,0x8355,0x8356,0x8357,0x8370,0x8378}; + +/* page 48 0x5821-0x587E */ +static uint16 tab_jisx0212_uni48[]={ +0x837D,0x837F,0x8380,0x8382,0x8384,0x8386,0x838D,0x8392, +0x8394,0x8395,0x8398,0x8399,0x839B,0x839C,0x839D,0x83A6, +0x83A7,0x83A9,0x83AC,0x83BE,0x83BF,0x83C0,0x83C7,0x83C9, +0x83CF,0x83D0,0x83D1,0x83D4,0x83DD,0x8353,0x83E8,0x83EA, +0x83F6,0x83F8,0x83F9,0x83FC,0x8401,0x8406,0x840A,0x840F, +0x8411,0x8415,0x8419,0x83AD,0x842F,0x8439,0x8445,0x8447, +0x8448,0x844A,0x844D,0x844F,0x8451,0x8452,0x8456,0x8458, +0x8459,0x845A,0x845C,0x8460,0x8464,0x8465,0x8467,0x846A, +0x8470,0x8473,0x8474,0x8476,0x8478,0x847C,0x847D,0x8481, +0x8485,0x8492,0x8493,0x8495,0x849E,0x84A6,0x84A8,0x84A9, +0x84AA,0x84AF,0x84B1,0x84B4,0x84BA,0x84BD,0x84BE,0x84C0, +0x84C2,0x84C7,0x84C8,0x84CC,0x84CF,0x84D3}; + +/* page 49 0x5921-0x597E */ +static uint16 tab_jisx0212_uni49[]={ +0x84DC,0x84E7,0x84EA,0x84EF,0x84F0,0x84F1,0x84F2,0x84F7, +0x8532,0x84FA,0x84FB,0x84FD,0x8502,0x8503,0x8507,0x850C, +0x850E,0x8510,0x851C,0x851E,0x8522,0x8523,0x8524,0x8525, +0x8527,0x852A,0x852B,0x852F,0x8533,0x8534,0x8536,0x853F, +0x8546,0x854F,0x8550,0x8551,0x8552,0x8553,0x8556,0x8559, +0x855C,0x855D,0x855E,0x855F,0x8560,0x8561,0x8562,0x8564, +0x856B,0x856F,0x8579,0x857A,0x857B,0x857D,0x857F,0x8581, +0x8585,0x8586,0x8589,0x858B,0x858C,0x858F,0x8593,0x8598, +0x859D,0x859F,0x85A0,0x85A2,0x85A5,0x85A7,0x85B4,0x85B6, +0x85B7,0x85B8,0x85BC,0x85BD,0x85BE,0x85BF,0x85C2,0x85C7, +0x85CA,0x85CB,0x85CE,0x85AD,0x85D8,0x85DA,0x85DF,0x85E0, +0x85E6,0x85E8,0x85ED,0x85F3,0x85F6,0x85FC}; + +/* page 50 0x5A21-0x5A7E */ +static uint16 tab_jisx0212_uni50[]={ +0x85FF,0x8600,0x8604,0x8605,0x860D,0x860E,0x8610,0x8611, +0x8612,0x8618,0x8619,0x861B,0x861E,0x8621,0x8627,0x8629, +0x8636,0x8638,0x863A,0x863C,0x863D,0x8640,0x8642,0x8646, +0x8652,0x8653,0x8656,0x8657,0x8658,0x8659,0x865D,0x8660, +0x8661,0x8662,0x8663,0x8664,0x8669,0x866C,0x866F,0x8675, +0x8676,0x8677,0x867A,0x868D,0x8691,0x8696,0x8698,0x869A, +0x869C,0x86A1,0x86A6,0x86A7,0x86A8,0x86AD,0x86B1,0x86B3, +0x86B4,0x86B5,0x86B7,0x86B8,0x86B9,0x86BF,0x86C0,0x86C1, +0x86C3,0x86C5,0x86D1,0x86D2,0x86D5,0x86D7,0x86DA,0x86DC, +0x86E0,0x86E3,0x86E5,0x86E7,0x8688,0x86FA,0x86FC,0x86FD, +0x8704,0x8705,0x8707,0x870B,0x870E,0x870F,0x8710,0x8713, +0x8714,0x8719,0x871E,0x871F,0x8721,0x8723}; + +/* page 51 0x5B21-0x5B7E */ +static uint16 tab_jisx0212_uni51[]={ +0x8728,0x872E,0x872F,0x8731,0x8732,0x8739,0x873A,0x873C, +0x873D,0x873E,0x8740,0x8743,0x8745,0x874D,0x8758,0x875D, +0x8761,0x8764,0x8765,0x876F,0x8771,0x8772,0x877B,0x8783, +0x8784,0x8785,0x8786,0x8787,0x8788,0x8789,0x878B,0x878C, +0x8790,0x8793,0x8795,0x8797,0x8798,0x8799,0x879E,0x87A0, +0x87A3,0x87A7,0x87AC,0x87AD,0x87AE,0x87B1,0x87B5,0x87BE, +0x87BF,0x87C1,0x87C8,0x87C9,0x87CA,0x87CE,0x87D5,0x87D6, +0x87D9,0x87DA,0x87DC,0x87DF,0x87E2,0x87E3,0x87E4,0x87EA, +0x87EB,0x87ED,0x87F1,0x87F3,0x87F8,0x87FA,0x87FF,0x8801, +0x8803,0x8806,0x8809,0x880A,0x880B,0x8810,0x8819,0x8812, +0x8813,0x8814,0x8818,0x881A,0x881B,0x881C,0x881E,0x881F, +0x8828,0x882D,0x882E,0x8830,0x8832,0x8835}; + +/* page 52 0x5C21-0x5C7E */ +static uint16 tab_jisx0212_uni52[]={ +0x883A,0x883C,0x8841,0x8843,0x8845,0x8848,0x8849,0x884A, +0x884B,0x884E,0x8851,0x8855,0x8856,0x8858,0x885A,0x885C, +0x885F,0x8860,0x8864,0x8869,0x8871,0x8879,0x887B,0x8880, +0x8898,0x889A,0x889B,0x889C,0x889F,0x88A0,0x88A8,0x88AA, +0x88BA,0x88BD,0x88BE,0x88C0,0x88CA,0x88CB,0x88CC,0x88CD, +0x88CE,0x88D1,0x88D2,0x88D3,0x88DB,0x88DE,0x88E7,0x88EF, +0x88F0,0x88F1,0x88F5,0x88F7,0x8901,0x8906,0x890D,0x890E, +0x890F,0x8915,0x8916,0x8918,0x8919,0x891A,0x891C,0x8920, +0x8926,0x8927,0x8928,0x8930,0x8931,0x8932,0x8935,0x8939, +0x893A,0x893E,0x8940,0x8942,0x8945,0x8946,0x8949,0x894F, +0x8952,0x8957,0x895A,0x895B,0x895C,0x8961,0x8962,0x8963, +0x896B,0x896E,0x8970,0x8973,0x8975,0x897A}; + +/* page 53 0x5D21-0x5D7E */ +static uint16 tab_jisx0212_uni53[]={ +0x897B,0x897C,0x897D,0x8989,0x898D,0x8990,0x8994,0x8995, +0x899B,0x899C,0x899F,0x89A0,0x89A5,0x89B0,0x89B4,0x89B5, +0x89B6,0x89B7,0x89BC,0x89D4,0x89D5,0x89D6,0x89D7,0x89D8, +0x89E5,0x89E9,0x89EB,0x89ED,0x89F1,0x89F3,0x89F6,0x89F9, +0x89FD,0x89FF,0x8A04,0x8A05,0x8A07,0x8A0F,0x8A11,0x8A12, +0x8A14,0x8A15,0x8A1E,0x8A20,0x8A22,0x8A24,0x8A26,0x8A2B, +0x8A2C,0x8A2F,0x8A35,0x8A37,0x8A3D,0x8A3E,0x8A40,0x8A43, +0x8A45,0x8A47,0x8A49,0x8A4D,0x8A4E,0x8A53,0x8A56,0x8A57, +0x8A58,0x8A5C,0x8A5D,0x8A61,0x8A65,0x8A67,0x8A75,0x8A76, +0x8A77,0x8A79,0x8A7A,0x8A7B,0x8A7E,0x8A7F,0x8A80,0x8A83, +0x8A86,0x8A8B,0x8A8F,0x8A90,0x8A92,0x8A96,0x8A97,0x8A99, +0x8A9F,0x8AA7,0x8AA9,0x8AAE,0x8AAF,0x8AB3}; + +/* page 54 0x5E21-0x5E7E */ +static uint16 tab_jisx0212_uni54[]={ +0x8AB6,0x8AB7,0x8ABB,0x8ABE,0x8AC3,0x8AC6,0x8AC8,0x8AC9, +0x8ACA,0x8AD1,0x8AD3,0x8AD4,0x8AD5,0x8AD7,0x8ADD,0x8ADF, +0x8AEC,0x8AF0,0x8AF4,0x8AF5,0x8AF6,0x8AFC,0x8AFF,0x8B05, +0x8B06,0x8B0B,0x8B11,0x8B1C,0x8B1E,0x8B1F,0x8B0A,0x8B2D, +0x8B30,0x8B37,0x8B3C,0x8B42,0x8B43,0x8B44,0x8B45,0x8B46, +0x8B48,0x8B52,0x8B53,0x8B54,0x8B59,0x8B4D,0x8B5E,0x8B63, +0x8B6D,0x8B76,0x8B78,0x8B79,0x8B7C,0x8B7E,0x8B81,0x8B84, +0x8B85,0x8B8B,0x8B8D,0x8B8F,0x8B94,0x8B95,0x8B9C,0x8B9E, +0x8B9F,0x8C38,0x8C39,0x8C3D,0x8C3E,0x8C45,0x8C47,0x8C49, +0x8C4B,0x8C4F,0x8C51,0x8C53,0x8C54,0x8C57,0x8C58,0x8C5B, +0x8C5D,0x8C59,0x8C63,0x8C64,0x8C66,0x8C68,0x8C69,0x8C6D, +0x8C73,0x8C75,0x8C76,0x8C7B,0x8C7E,0x8C86}; + +/* page 55 0x5F21-0x5F7E */ +static uint16 tab_jisx0212_uni55[]={ +0x8C87,0x8C8B,0x8C90,0x8C92,0x8C93,0x8C99,0x8C9B,0x8C9C, +0x8CA4,0x8CB9,0x8CBA,0x8CC5,0x8CC6,0x8CC9,0x8CCB,0x8CCF, +0x8CD6,0x8CD5,0x8CD9,0x8CDD,0x8CE1,0x8CE8,0x8CEC,0x8CEF, +0x8CF0,0x8CF2,0x8CF5,0x8CF7,0x8CF8,0x8CFE,0x8CFF,0x8D01, +0x8D03,0x8D09,0x8D12,0x8D17,0x8D1B,0x8D65,0x8D69,0x8D6C, +0x8D6E,0x8D7F,0x8D82,0x8D84,0x8D88,0x8D8D,0x8D90,0x8D91, +0x8D95,0x8D9E,0x8D9F,0x8DA0,0x8DA6,0x8DAB,0x8DAC,0x8DAF, +0x8DB2,0x8DB5,0x8DB7,0x8DB9,0x8DBB,0x8DC0,0x8DC5,0x8DC6, +0x8DC7,0x8DC8,0x8DCA,0x8DCE,0x8DD1,0x8DD4,0x8DD5,0x8DD7, +0x8DD9,0x8DE4,0x8DE5,0x8DE7,0x8DEC,0x8DF0,0x8DBC,0x8DF1, +0x8DF2,0x8DF4,0x8DFD,0x8E01,0x8E04,0x8E05,0x8E06,0x8E0B, +0x8E11,0x8E14,0x8E16,0x8E20,0x8E21,0x8E22}; + +/* page 56 0x6021-0x607E */ +static uint16 tab_jisx0212_uni56[]={ +0x8E23,0x8E26,0x8E27,0x8E31,0x8E33,0x8E36,0x8E37,0x8E38, +0x8E39,0x8E3D,0x8E40,0x8E41,0x8E4B,0x8E4D,0x8E4E,0x8E4F, +0x8E54,0x8E5B,0x8E5C,0x8E5D,0x8E5E,0x8E61,0x8E62,0x8E69, +0x8E6C,0x8E6D,0x8E6F,0x8E70,0x8E71,0x8E79,0x8E7A,0x8E7B, +0x8E82,0x8E83,0x8E89,0x8E90,0x8E92,0x8E95,0x8E9A,0x8E9B, +0x8E9D,0x8E9E,0x8EA2,0x8EA7,0x8EA9,0x8EAD,0x8EAE,0x8EB3, +0x8EB5,0x8EBA,0x8EBB,0x8EC0,0x8EC1,0x8EC3,0x8EC4,0x8EC7, +0x8ECF,0x8ED1,0x8ED4,0x8EDC,0x8EE8,0x8EEE,0x8EF0,0x8EF1, +0x8EF7,0x8EF9,0x8EFA,0x8EED,0x8F00,0x8F02,0x8F07,0x8F08, +0x8F0F,0x8F10,0x8F16,0x8F17,0x8F18,0x8F1E,0x8F20,0x8F21, +0x8F23,0x8F25,0x8F27,0x8F28,0x8F2C,0x8F2D,0x8F2E,0x8F34, +0x8F35,0x8F36,0x8F37,0x8F3A,0x8F40,0x8F41}; + +/* page 57 0x6121-0x617E */ +static uint16 tab_jisx0212_uni57[]={ +0x8F43,0x8F47,0x8F4F,0x8F51,0x8F52,0x8F53,0x8F54,0x8F55, +0x8F58,0x8F5D,0x8F5E,0x8F65,0x8F9D,0x8FA0,0x8FA1,0x8FA4, +0x8FA5,0x8FA6,0x8FB5,0x8FB6,0x8FB8,0x8FBE,0x8FC0,0x8FC1, +0x8FC6,0x8FCA,0x8FCB,0x8FCD,0x8FD0,0x8FD2,0x8FD3,0x8FD5, +0x8FE0,0x8FE3,0x8FE4,0x8FE8,0x8FEE,0x8FF1,0x8FF5,0x8FF6, +0x8FFB,0x8FFE,0x9002,0x9004,0x9008,0x900C,0x9018,0x901B, +0x9028,0x9029,0x902F,0x902A,0x902C,0x902D,0x9033,0x9034, +0x9037,0x903F,0x9043,0x9044,0x904C,0x905B,0x905D,0x9062, +0x9066,0x9067,0x906C,0x9070,0x9074,0x9079,0x9085,0x9088, +0x908B,0x908C,0x908E,0x9090,0x9095,0x9097,0x9098,0x9099, +0x909B,0x90A0,0x90A1,0x90A2,0x90A5,0x90B0,0x90B2,0x90B3, +0x90B4,0x90B6,0x90BD,0x90CC,0x90BE,0x90C3}; + +/* page 58 0x6221-0x627E */ +static uint16 tab_jisx0212_uni58[]={ +0x90C4,0x90C5,0x90C7,0x90C8,0x90D5,0x90D7,0x90D8,0x90D9, +0x90DC,0x90DD,0x90DF,0x90E5,0x90D2,0x90F6,0x90EB,0x90EF, +0x90F0,0x90F4,0x90FE,0x90FF,0x9100,0x9104,0x9105,0x9106, +0x9108,0x910D,0x9110,0x9114,0x9116,0x9117,0x9118,0x911A, +0x911C,0x911E,0x9120,0x9125,0x9122,0x9123,0x9127,0x9129, +0x912E,0x912F,0x9131,0x9134,0x9136,0x9137,0x9139,0x913A, +0x913C,0x913D,0x9143,0x9147,0x9148,0x914F,0x9153,0x9157, +0x9159,0x915A,0x915B,0x9161,0x9164,0x9167,0x916D,0x9174, +0x9179,0x917A,0x917B,0x9181,0x9183,0x9185,0x9186,0x918A, +0x918E,0x9191,0x9193,0x9194,0x9195,0x9198,0x919E,0x91A1, +0x91A6,0x91A8,0x91AC,0x91AD,0x91AE,0x91B0,0x91B1,0x91B2, +0x91B3,0x91B6,0x91BB,0x91BC,0x91BD,0x91BF}; + +/* page 59 0x6321-0x637E */ +static uint16 tab_jisx0212_uni59[]={ +0x91C2,0x91C3,0x91C5,0x91D3,0x91D4,0x91D7,0x91D9,0x91DA, +0x91DE,0x91E4,0x91E5,0x91E9,0x91EA,0x91EC,0x91ED,0x91EE, +0x91EF,0x91F0,0x91F1,0x91F7,0x91F9,0x91FB,0x91FD,0x9200, +0x9201,0x9204,0x9205,0x9206,0x9207,0x9209,0x920A,0x920C, +0x9210,0x9212,0x9213,0x9216,0x9218,0x921C,0x921D,0x9223, +0x9224,0x9225,0x9226,0x9228,0x922E,0x922F,0x9230,0x9233, +0x9235,0x9236,0x9238,0x9239,0x923A,0x923C,0x923E,0x9240, +0x9242,0x9243,0x9246,0x9247,0x924A,0x924D,0x924E,0x924F, +0x9251,0x9258,0x9259,0x925C,0x925D,0x9260,0x9261,0x9265, +0x9267,0x9268,0x9269,0x926E,0x926F,0x9270,0x9275,0x9276, +0x9277,0x9278,0x9279,0x927B,0x927C,0x927D,0x927F,0x9288, +0x9289,0x928A,0x928D,0x928E,0x9292,0x9297}; + +/* page 60 0x6421-0x647E */ +static uint16 tab_jisx0212_uni60[]={ +0x9299,0x929F,0x92A0,0x92A4,0x92A5,0x92A7,0x92A8,0x92AB, +0x92AF,0x92B2,0x92B6,0x92B8,0x92BA,0x92BB,0x92BC,0x92BD, +0x92BF,0x92C0,0x92C1,0x92C2,0x92C3,0x92C5,0x92C6,0x92C7, +0x92C8,0x92CB,0x92CC,0x92CD,0x92CE,0x92D0,0x92D3,0x92D5, +0x92D7,0x92D8,0x92D9,0x92DC,0x92DD,0x92DF,0x92E0,0x92E1, +0x92E3,0x92E5,0x92E7,0x92E8,0x92EC,0x92EE,0x92F0,0x92F9, +0x92FB,0x92FF,0x9300,0x9302,0x9308,0x930D,0x9311,0x9314, +0x9315,0x931C,0x931D,0x931E,0x931F,0x9321,0x9324,0x9325, +0x9327,0x9329,0x932A,0x9333,0x9334,0x9336,0x9337,0x9347, +0x9348,0x9349,0x9350,0x9351,0x9352,0x9355,0x9357,0x9358, +0x935A,0x935E,0x9364,0x9365,0x9367,0x9369,0x936A,0x936D, +0x936F,0x9370,0x9371,0x9373,0x9374,0x9376}; + +/* page 61 0x6521-0x657E */ +static uint16 tab_jisx0212_uni61[]={ +0x937A,0x937D,0x937F,0x9380,0x9381,0x9382,0x9388,0x938A, +0x938B,0x938D,0x938F,0x9392,0x9395,0x9398,0x939B,0x939E, +0x93A1,0x93A3,0x93A4,0x93A6,0x93A8,0x93AB,0x93B4,0x93B5, +0x93B6,0x93BA,0x93A9,0x93C1,0x93C4,0x93C5,0x93C6,0x93C7, +0x93C9,0x93CA,0x93CB,0x93CC,0x93CD,0x93D3,0x93D9,0x93DC, +0x93DE,0x93DF,0x93E2,0x93E6,0x93E7,0x93F9,0x93F7,0x93F8, +0x93FA,0x93FB,0x93FD,0x9401,0x9402,0x9404,0x9408,0x9409, +0x940D,0x940E,0x940F,0x9415,0x9416,0x9417,0x941F,0x942E, +0x942F,0x9431,0x9432,0x9433,0x9434,0x943B,0x943F,0x943D, +0x9443,0x9445,0x9448,0x944A,0x944C,0x9455,0x9459,0x945C, +0x945F,0x9461,0x9463,0x9468,0x946B,0x946D,0x946E,0x946F, +0x9471,0x9472,0x9484,0x9483,0x9578,0x9579}; + +/* page 62 0x6621-0x667E */ +static uint16 tab_jisx0212_uni62[]={ +0x957E,0x9584,0x9588,0x958C,0x958D,0x958E,0x959D,0x959E, +0x959F,0x95A1,0x95A6,0x95A9,0x95AB,0x95AC,0x95B4,0x95B6, +0x95BA,0x95BD,0x95BF,0x95C6,0x95C8,0x95C9,0x95CB,0x95D0, +0x95D1,0x95D2,0x95D3,0x95D9,0x95DA,0x95DD,0x95DE,0x95DF, +0x95E0,0x95E4,0x95E6,0x961D,0x961E,0x9622,0x9624,0x9625, +0x9626,0x962C,0x9631,0x9633,0x9637,0x9638,0x9639,0x963A, +0x963C,0x963D,0x9641,0x9652,0x9654,0x9656,0x9657,0x9658, +0x9661,0x966E,0x9674,0x967B,0x967C,0x967E,0x967F,0x9681, +0x9682,0x9683,0x9684,0x9689,0x9691,0x9696,0x969A,0x969D, +0x969F,0x96A4,0x96A5,0x96A6,0x96A9,0x96AE,0x96AF,0x96B3, +0x96BA,0x96CA,0x96D2,0x5DB2,0x96D8,0x96DA,0x96DD,0x96DE, +0x96DF,0x96E9,0x96EF,0x96F1,0x96FA,0x9702}; + +/* page 63 0x6721-0x677E */ +static uint16 tab_jisx0212_uni63[]={ +0x9703,0x9705,0x9709,0x971A,0x971B,0x971D,0x9721,0x9722, +0x9723,0x9728,0x9731,0x9733,0x9741,0x9743,0x974A,0x974E, +0x974F,0x9755,0x9757,0x9758,0x975A,0x975B,0x9763,0x9767, +0x976A,0x976E,0x9773,0x9776,0x9777,0x9778,0x977B,0x977D, +0x977F,0x9780,0x9789,0x9795,0x9796,0x9797,0x9799,0x979A, +0x979E,0x979F,0x97A2,0x97AC,0x97AE,0x97B1,0x97B2,0x97B5, +0x97B6,0x97B8,0x97B9,0x97BA,0x97BC,0x97BE,0x97BF,0x97C1, +0x97C4,0x97C5,0x97C7,0x97C9,0x97CA,0x97CC,0x97CD,0x97CE, +0x97D0,0x97D1,0x97D4,0x97D7,0x97D8,0x97D9,0x97DD,0x97DE, +0x97E0,0x97DB,0x97E1,0x97E4,0x97EF,0x97F1,0x97F4,0x97F7, +0x97F8,0x97FA,0x9807,0x980A,0x9819,0x980D,0x980E,0x9814, +0x9816,0x981C,0x981E,0x9820,0x9823,0x9826}; + +/* page 64 0x6821-0x687E */ +static uint16 tab_jisx0212_uni64[]={ +0x982B,0x982E,0x982F,0x9830,0x9832,0x9833,0x9835,0x9825, +0x983E,0x9844,0x9847,0x984A,0x9851,0x9852,0x9853,0x9856, +0x9857,0x9859,0x985A,0x9862,0x9863,0x9865,0x9866,0x986A, +0x986C,0x98AB,0x98AD,0x98AE,0x98B0,0x98B4,0x98B7,0x98B8, +0x98BA,0x98BB,0x98BF,0x98C2,0x98C5,0x98C8,0x98CC,0x98E1, +0x98E3,0x98E5,0x98E6,0x98E7,0x98EA,0x98F3,0x98F6,0x9902, +0x9907,0x9908,0x9911,0x9915,0x9916,0x9917,0x991A,0x991B, +0x991C,0x991F,0x9922,0x9926,0x9927,0x992B,0x9931,0x9932, +0x9933,0x9934,0x9935,0x9939,0x993A,0x993B,0x993C,0x9940, +0x9941,0x9946,0x9947,0x9948,0x994D,0x994E,0x9954,0x9958, +0x9959,0x995B,0x995C,0x995E,0x995F,0x9960,0x999B,0x999D, +0x999F,0x99A6,0x99B0,0x99B1,0x99B2,0x99B5}; + +/* page 65 0x6921-0x697E */ +static uint16 tab_jisx0212_uni65[]={ +0x99B9,0x99BA,0x99BD,0x99BF,0x99C3,0x99C9,0x99D3,0x99D4, +0x99D9,0x99DA,0x99DC,0x99DE,0x99E7,0x99EA,0x99EB,0x99EC, +0x99F0,0x99F4,0x99F5,0x99F9,0x99FD,0x99FE,0x9A02,0x9A03, +0x9A04,0x9A0B,0x9A0C,0x9A10,0x9A11,0x9A16,0x9A1E,0x9A20, +0x9A22,0x9A23,0x9A24,0x9A27,0x9A2D,0x9A2E,0x9A33,0x9A35, +0x9A36,0x9A38,0x9A47,0x9A41,0x9A44,0x9A4A,0x9A4B,0x9A4C, +0x9A4E,0x9A51,0x9A54,0x9A56,0x9A5D,0x9AAA,0x9AAC,0x9AAE, +0x9AAF,0x9AB2,0x9AB4,0x9AB5,0x9AB6,0x9AB9,0x9ABB,0x9ABE, +0x9ABF,0x9AC1,0x9AC3,0x9AC6,0x9AC8,0x9ACE,0x9AD0,0x9AD2, +0x9AD5,0x9AD6,0x9AD7,0x9ADB,0x9ADC,0x9AE0,0x9AE4,0x9AE5, +0x9AE7,0x9AE9,0x9AEC,0x9AF2,0x9AF3,0x9AF5,0x9AF9,0x9AFA, +0x9AFD,0x9AFF,0x9B00,0x9B01,0x9B02,0x9B03}; + +/* page 66 0x6A21-0x6A7E */ +static uint16 tab_jisx0212_uni66[]={ +0x9B04,0x9B05,0x9B08,0x9B09,0x9B0B,0x9B0C,0x9B0D,0x9B0E, +0x9B10,0x9B12,0x9B16,0x9B19,0x9B1B,0x9B1C,0x9B20,0x9B26, +0x9B2B,0x9B2D,0x9B33,0x9B34,0x9B35,0x9B37,0x9B39,0x9B3A, +0x9B3D,0x9B48,0x9B4B,0x9B4C,0x9B55,0x9B56,0x9B57,0x9B5B, +0x9B5E,0x9B61,0x9B63,0x9B65,0x9B66,0x9B68,0x9B6A,0x9B6B, +0x9B6C,0x9B6D,0x9B6E,0x9B73,0x9B75,0x9B77,0x9B78,0x9B79, +0x9B7F,0x9B80,0x9B84,0x9B85,0x9B86,0x9B87,0x9B89,0x9B8A, +0x9B8B,0x9B8D,0x9B8F,0x9B90,0x9B94,0x9B9A,0x9B9D,0x9B9E, +0x9BA6,0x9BA7,0x9BA9,0x9BAC,0x9BB0,0x9BB1,0x9BB2,0x9BB7, +0x9BB8,0x9BBB,0x9BBC,0x9BBE,0x9BBF,0x9BC1,0x9BC7,0x9BC8, +0x9BCE,0x9BD0,0x9BD7,0x9BD8,0x9BDD,0x9BDF,0x9BE5,0x9BE7, +0x9BEA,0x9BEB,0x9BEF,0x9BF3,0x9BF7,0x9BF8}; + +/* page 67 0x6B21-0x6B7E */ +static uint16 tab_jisx0212_uni67[]={ +0x9BF9,0x9BFA,0x9BFD,0x9BFF,0x9C00,0x9C02,0x9C0B,0x9C0F, +0x9C11,0x9C16,0x9C18,0x9C19,0x9C1A,0x9C1C,0x9C1E,0x9C22, +0x9C23,0x9C26,0x9C27,0x9C28,0x9C29,0x9C2A,0x9C31,0x9C35, +0x9C36,0x9C37,0x9C3D,0x9C41,0x9C43,0x9C44,0x9C45,0x9C49, +0x9C4A,0x9C4E,0x9C4F,0x9C50,0x9C53,0x9C54,0x9C56,0x9C58, +0x9C5B,0x9C5D,0x9C5E,0x9C5F,0x9C63,0x9C69,0x9C6A,0x9C5C, +0x9C6B,0x9C68,0x9C6E,0x9C70,0x9C72,0x9C75,0x9C77,0x9C7B, +0x9CE6,0x9CF2,0x9CF7,0x9CF9,0x9D0B,0x9D02,0x9D11,0x9D17, +0x9D18,0x9D1C,0x9D1D,0x9D1E,0x9D2F,0x9D30,0x9D32,0x9D33, +0x9D34,0x9D3A,0x9D3C,0x9D45,0x9D3D,0x9D42,0x9D43,0x9D47, +0x9D4A,0x9D53,0x9D54,0x9D5F,0x9D63,0x9D62,0x9D65,0x9D69, +0x9D6A,0x9D6B,0x9D70,0x9D76,0x9D77,0x9D7B}; + +/* page 68 0x6C21-0x6C7E */ +static uint16 tab_jisx0212_uni68[]={ +0x9D7C,0x9D7E,0x9D83,0x9D84,0x9D86,0x9D8A,0x9D8D,0x9D8E, +0x9D92,0x9D93,0x9D95,0x9D96,0x9D97,0x9D98,0x9DA1,0x9DAA, +0x9DAC,0x9DAE,0x9DB1,0x9DB5,0x9DB9,0x9DBC,0x9DBF,0x9DC3, +0x9DC7,0x9DC9,0x9DCA,0x9DD4,0x9DD5,0x9DD6,0x9DD7,0x9DDA, +0x9DDE,0x9DDF,0x9DE0,0x9DE5,0x9DE7,0x9DE9,0x9DEB,0x9DEE, +0x9DF0,0x9DF3,0x9DF4,0x9DFE,0x9E0A,0x9E02,0x9E07,0x9E0E, +0x9E10,0x9E11,0x9E12,0x9E15,0x9E16,0x9E19,0x9E1C,0x9E1D, +0x9E7A,0x9E7B,0x9E7C,0x9E80,0x9E82,0x9E83,0x9E84,0x9E85, +0x9E87,0x9E8E,0x9E8F,0x9E96,0x9E98,0x9E9B,0x9E9E,0x9EA4, +0x9EA8,0x9EAC,0x9EAE,0x9EAF,0x9EB0,0x9EB3,0x9EB4,0x9EB5, +0x9EC6,0x9EC8,0x9ECB,0x9ED5,0x9EDF,0x9EE4,0x9EE7,0x9EEC, +0x9EED,0x9EEE,0x9EF0,0x9EF1,0x9EF2,0x9EF5}; + +/* page 69 0x6D21-0x6D63 */ +static uint16 tab_jisx0212_uni69[]={ +0x9EF8,0x9EFF,0x9F02,0x9F03,0x9F09,0x9F0F,0x9F10,0x9F11, +0x9F12,0x9F14,0x9F16,0x9F17,0x9F19,0x9F1A,0x9F1B,0x9F1F, +0x9F22,0x9F26,0x9F2A,0x9F2B,0x9F2F,0x9F31,0x9F32,0x9F34, +0x9F37,0x9F39,0x9F3A,0x9F3C,0x9F3D,0x9F3F,0x9F41,0x9F43, +0x9F44,0x9F45,0x9F46,0x9F47,0x9F53,0x9F55,0x9F56,0x9F57, +0x9F58,0x9F5A,0x9F5D,0x9F5E,0x9F68,0x9F69,0x9F6D,0x9F6E, +0x9F6F,0x9F70,0x9F71,0x9F73,0x9F75,0x9F7A,0x9F7D,0x9F8F, +0x9F90,0x9F91,0x9F92,0x9F94,0x9F96,0x9F97,0x9F9E,0x9FA1, +0x9FA2,0x9FA3,0x9FA5}; + +/* page 70 0x7371-0x737E IBM Kanji and Nonkanji */ +static uint16 tab_jisx0212_uni70[]={ + 0, 0,0x2170,0x2171,0x2172,0x2173,0x2174,0x2175, +0x2176,0x2177,0x2178,0x2179,0x2160,0x2161}; + +/* page 71 0x7421-0x747E IBM Kanji and Nonkanji*/ +static uint16 tab_jisx0212_uni71[]={ +0x2162,0x2163,0x2164,0x2165,0x2166,0x2167,0x2168,0x2169, +0xFF07,0xFF02,0x3231,0x2116,0x2121,0x70BB,0x4EFC,0x50F4, +0x51EC,0x5307,0x5324,0xFA0E,0x548A,0x5759,0xFA0F,0xFA10, +0x589E,0x5BEC,0x5CF5,0x5D53,0xFA11,0x5FB7,0x6085,0x6120, +0x654E,0x663B,0x6665,0xFA12,0xF929,0x6801,0xFA13,0xFA14, +0x6A6B,0x6AE2,0x6DF8,0x6DF2,0x7028,0xFA15,0xFA16,0x7501, +0x7682,0x769E,0xFA17,0x7930,0xFA18,0xFA19,0xFA1A,0xFA1B, +0x7AE7,0xFA1C,0xFA1D,0x7DA0,0x7DD6,0xFA1E,0x8362,0xFA1F, +0x85B0,0xFA20,0xFA21,0x8807,0xFA22,0x8B7F,0x8CF4,0x8D76, +0xFA23,0xFA24,0xFA25,0x90DE,0xFA26,0x9115,0xFA27,0xFA28, +0x9592,0xF9DC,0xFA29,0x973B,0x974D,0x9751,0xFA2A,0xFA2B, +0xFA2C,0x999E,0x9AD9,0x9B72,0xFA2D,0x9ED1}; + +static int +my_jisx0212_uni_onechar(int code){ + if ((code>=0x222F)&&(code<=0x2244)) + return(tab_jisx0212_uni0[code-0x222F]); + if ((code>=0x226B)&&(code<=0x2271)) + return(tab_jisx0212_uni1[code-0x226B]); + if ((code>=0x2661)&&(code<=0x267C)) + return(tab_jisx0212_uni2[code-0x2661]); + if ((code>=0x2742)&&(code<=0x274E)) + return(tab_jisx0212_uni3[code-0x2742]); + if ((code>=0x2772)&&(code<=0x277E)) + return(tab_jisx0212_uni4[code-0x2772]); + if ((code>=0x2921)&&(code<=0x2950)) + return(tab_jisx0212_uni5[code-0x2921]); + if ((code>=0x2A21)&&(code<=0x2A77)) + return(tab_jisx0212_uni6[code-0x2A21]); + if ((code>=0x2B21)&&(code<=0x2B77)) + return(tab_jisx0212_uni7[code-0x2B21]); + if ((code>=0x3021)&&(code<=0x307E)) + return(tab_jisx0212_uni8[code-0x3021]); + if ((code>=0x3121)&&(code<=0x317E)) + return(tab_jisx0212_uni9[code-0x3121]); + if ((code>=0x3221)&&(code<=0x327E)) + return(tab_jisx0212_uni10[code-0x3221]); + if ((code>=0x3321)&&(code<=0x337E)) + return(tab_jisx0212_uni11[code-0x3321]); + if ((code>=0x3421)&&(code<=0x347E)) + return(tab_jisx0212_uni12[code-0x3421]); + if ((code>=0x3521)&&(code<=0x357E)) + return(tab_jisx0212_uni13[code-0x3521]); + if ((code>=0x3621)&&(code<=0x367E)) + return(tab_jisx0212_uni14[code-0x3621]); + if ((code>=0x3721)&&(code<=0x377E)) + return(tab_jisx0212_uni15[code-0x3721]); + if ((code>=0x3821)&&(code<=0x387E)) + return(tab_jisx0212_uni16[code-0x3821]); + if ((code>=0x3921)&&(code<=0x397E)) + return(tab_jisx0212_uni17[code-0x3921]); + if ((code>=0x3A21)&&(code<=0x3A7E)) + return(tab_jisx0212_uni18[code-0x3A21]); + if ((code>=0x3B21)&&(code<=0x3B7E)) + return(tab_jisx0212_uni19[code-0x3B21]); + if ((code>=0x3C21)&&(code<=0x3C7E)) + return(tab_jisx0212_uni20[code-0x3C21]); + if ((code>=0x3D21)&&(code<=0x3D7E)) + return(tab_jisx0212_uni21[code-0x3D21]); + if ((code>=0x3E21)&&(code<=0x3E7E)) + return(tab_jisx0212_uni22[code-0x3E21]); + if ((code>=0x3F21)&&(code<=0x3F7E)) + return(tab_jisx0212_uni23[code-0x3F21]); + if ((code>=0x4021)&&(code<=0x407E)) + return(tab_jisx0212_uni24[code-0x4021]); + if ((code>=0x4121)&&(code<=0x417E)) + return(tab_jisx0212_uni25[code-0x4121]); + if ((code>=0x4221)&&(code<=0x427E)) + return(tab_jisx0212_uni26[code-0x4221]); + if ((code>=0x4321)&&(code<=0x437E)) + return(tab_jisx0212_uni27[code-0x4321]); + if ((code>=0x4421)&&(code<=0x447E)) + return(tab_jisx0212_uni28[code-0x4421]); + if ((code>=0x4521)&&(code<=0x457E)) + return(tab_jisx0212_uni29[code-0x4521]); + if ((code>=0x4621)&&(code<=0x467E)) + return(tab_jisx0212_uni30[code-0x4621]); + if ((code>=0x4721)&&(code<=0x477E)) + return(tab_jisx0212_uni31[code-0x4721]); + if ((code>=0x4821)&&(code<=0x487E)) + return(tab_jisx0212_uni32[code-0x4821]); + if ((code>=0x4921)&&(code<=0x497E)) + return(tab_jisx0212_uni33[code-0x4921]); + if ((code>=0x4A21)&&(code<=0x4A7E)) + return(tab_jisx0212_uni34[code-0x4A21]); + if ((code>=0x4B21)&&(code<=0x4B7E)) + return(tab_jisx0212_uni35[code-0x4B21]); + if ((code>=0x4C21)&&(code<=0x4C7E)) + return(tab_jisx0212_uni36[code-0x4C21]); + if ((code>=0x4D21)&&(code<=0x4D7E)) + return(tab_jisx0212_uni37[code-0x4D21]); + if ((code>=0x4E21)&&(code<=0x4E7E)) + return(tab_jisx0212_uni38[code-0x4E21]); + if ((code>=0x4F21)&&(code<=0x4F7E)) + return(tab_jisx0212_uni39[code-0x4F21]); + if ((code>=0x5021)&&(code<=0x507E)) + return(tab_jisx0212_uni40[code-0x5021]); + if ((code>=0x5121)&&(code<=0x517E)) + return(tab_jisx0212_uni41[code-0x5121]); + if ((code>=0x5221)&&(code<=0x527E)) + return(tab_jisx0212_uni42[code-0x5221]); + if ((code>=0x5321)&&(code<=0x537E)) + return(tab_jisx0212_uni43[code-0x5321]); + if ((code>=0x5421)&&(code<=0x547E)) + return(tab_jisx0212_uni44[code-0x5421]); + if ((code>=0x5521)&&(code<=0x557E)) + return(tab_jisx0212_uni45[code-0x5521]); + if ((code>=0x5621)&&(code<=0x567E)) + return(tab_jisx0212_uni46[code-0x5621]); + if ((code>=0x5721)&&(code<=0x577E)) + return(tab_jisx0212_uni47[code-0x5721]); + if ((code>=0x5821)&&(code<=0x587E)) + return(tab_jisx0212_uni48[code-0x5821]); + if ((code>=0x5921)&&(code<=0x597E)) + return(tab_jisx0212_uni49[code-0x5921]); + if ((code>=0x5A21)&&(code<=0x5A7E)) + return(tab_jisx0212_uni50[code-0x5A21]); + if ((code>=0x5B21)&&(code<=0x5B7E)) + return(tab_jisx0212_uni51[code-0x5B21]); + if ((code>=0x5C21)&&(code<=0x5C7E)) + return(tab_jisx0212_uni52[code-0x5C21]); + if ((code>=0x5D21)&&(code<=0x5D7E)) + return(tab_jisx0212_uni53[code-0x5D21]); + if ((code>=0x5E21)&&(code<=0x5E7E)) + return(tab_jisx0212_uni54[code-0x5E21]); + if ((code>=0x5F21)&&(code<=0x5F7E)) + return(tab_jisx0212_uni55[code-0x5F21]); + if ((code>=0x6021)&&(code<=0x607E)) + return(tab_jisx0212_uni56[code-0x6021]); + if ((code>=0x6121)&&(code<=0x617E)) + return(tab_jisx0212_uni57[code-0x6121]); + if ((code>=0x6221)&&(code<=0x627E)) + return(tab_jisx0212_uni58[code-0x6221]); + if ((code>=0x6321)&&(code<=0x637E)) + return(tab_jisx0212_uni59[code-0x6321]); + if ((code>=0x6421)&&(code<=0x647E)) + return(tab_jisx0212_uni60[code-0x6421]); + if ((code>=0x6521)&&(code<=0x657E)) + return(tab_jisx0212_uni61[code-0x6521]); + if ((code>=0x6621)&&(code<=0x667E)) + return(tab_jisx0212_uni62[code-0x6621]); + if ((code>=0x6721)&&(code<=0x677E)) + return(tab_jisx0212_uni63[code-0x6721]); + if ((code>=0x6821)&&(code<=0x687E)) + return(tab_jisx0212_uni64[code-0x6821]); + if ((code>=0x6921)&&(code<=0x697E)) + return(tab_jisx0212_uni65[code-0x6921]); + if ((code>=0x6A21)&&(code<=0x6A7E)) + return(tab_jisx0212_uni66[code-0x6A21]); + if ((code>=0x6B21)&&(code<=0x6B7E)) + return(tab_jisx0212_uni67[code-0x6B21]); + if ((code>=0x6C21)&&(code<=0x6C7E)) + return(tab_jisx0212_uni68[code-0x6C21]); + if ((code>=0x6D21)&&(code<=0x6D63)) + return(tab_jisx0212_uni69[code-0x6D21]); + if ((code>=0x7371)&&(code<=0x737E)) + return(tab_jisx0212_uni70[code-0x7371]); + if ((code>=0x7421)&&(code<=0x747E)) + return(tab_jisx0212_uni71[code-0x7421]); + return(0); +} + +/* + EUC-JP encoding subcomponents: + [x00-x7F] # ASCII/JIS-Roman (one-byte/character) + [x8E][xA0-xDF] # half-width katakana (two bytes/char) + [x8F][xA1-xFE][xA1-xFE] # JIS X 0212-1990 (three bytes/char) + [xA1-xFE][xA1-xFE] # JIS X 0208:1997 (two bytes/char) +*/ + +static +size_t my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)), + const char *beg, const char *end, size_t pos, + int *error) +{ + const uchar *b= (uchar *) beg; + *error=0; + + for ( ; pos && b < (uchar*) end; pos--, b++) + { + char *chbeg; + uint ch= *b; + + if (ch <= 0x7F) /* one byte */ + continue; + + chbeg= (char *) b++; + if (b >= (uchar *) end) /* need more bytes */ + return (uint) (chbeg - beg); /* unexpected EOL */ + + if (ch == 0x8E) /* [x8E][xA0-xDF] */ + { + if (*b >= 0xA0 && *b <= 0xDF) + continue; + *error=1; + return (uint) (chbeg - beg); /* invalid sequence */ + } + + if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ + { + ch= *b++; + if (b >= (uchar*) end) + { + *error= 1; + return (uint)(chbeg - beg); /* unexpected EOL */ + } + } + + if (ch >= 0xA1 && ch <= 0xFE && + *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ + continue; + *error=1; + return (size_t) (chbeg - beg); /* invalid sequence */ + } + return (size_t) (b - (uchar *) beg); +} + + +static +size_t my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *str_end) +{ + size_t clen; + const uchar *b= (const uchar *) str; + const uchar *e= (const uchar *) str_end; + + for (clen= 0; b < e; ) + { + if (*b == 0x8E) + { + clen++; + b+= 2; + } + else if (*b == 0x8F) + { + clen+= 2; + b+= 3; + } + else if (*b & 0x80) + { + clen+= 2; + b+= 2; + } + else + { + clen++; + b++; + } + } + return clen; +} + +static int +my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e) +{ + int c1,c2,c3; + + if (s >= e) + return MY_CS_TOOSMALL; + + c1=s[0]; + + /* Ascii code set */ + if (c1<=0x7F) + { + *pwc=c1; + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + c2=s[1]; + + + /* JIS X 0208 code set */ + if (c1>=0xA1 && c1<=0xFE) + { + if (c2 < 0xA1 || c2 >0xFE) + return MY_CS_ILSEQ; + + if (c1 < 0xF5) + { + pwc[0]=my_jisx0208_uni_onechar( ((c1-0x80) << 8) + (c2-0x80)); + if (!pwc[0]) + return -2; + } + else + { + /* User defined range */ + pwc[0]=0xE000 + 94*(c1-0xF5) +(c2-0xA1); + } + return 2; + } + + /* JIS X 0201 code set (Half Width Tatakana) */ + if (c1==0x8E) + { + int ret; + + if (c2<0xA1 || c2>0xDF) + return MY_CS_ILSEQ; + + ret = my_mb_wc_jisx0201(cs,pwc,s+1,e); + if (ret!=1) + return -2; + return 2; + } + + /* JIS X 0212 code set */ + if (c1==0x8F) + { + if (c2<0xA1 || c2>=0xFF) + return MY_CS_ILSEQ; + + if (s+3>e) + return MY_CS_TOOSMALL3; + + c3=s[2]; + if (c3 < 0xA1 || c3>=0xFF) + return MY_CS_ILSEQ; + + if (c2<0xF5) + { + pwc[0]=my_jisx0212_uni_onechar((c2-0x80)*256 + (c3-0x80)); + if (!pwc[0]) + return -3; + } + else + { + /* User defined range */ + pwc[0]= 0xE3AC + 94*(c2-0xF5) + (c3-0xA1); + } + return 3; + } + + return MY_CS_ILSEQ; +} + +static int +my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, uchar *s, uchar *e) +{ + uchar c1; + int jp; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((int) wc < 0x80) + { + *s= (uchar) wc; + return 1; + } + + if ((jp=my_uni_jisx0208_onechar(wc))) + { + if (s+2>e) + return MY_CS_TOOSMALL2; + + jp+=0x8080; + s[0]=jp>>8; + s[1]=jp&0xFF; + return 2; + } + + /* Half width Katakana */ + if (my_wc_mb_jisx0201(c,wc,s,e) == 1) + { + if (s+2>e) + return MY_CS_TOOSMALL2; + s[1]= s[0]; + s[0]= 0x8E; + return 2; + } + + + if ((jp=my_uni_jisx0212_onechar(wc))) + { + if (s+3>e) + return MY_CS_TOOSMALL3; + + jp+=0x8080; + s[0]=0x8F; + s[1]=jp>>8; + s[2]=jp&0xFF; + return 3; + } + + + /* User defined range */ + if (wc>=0xE000 && wc<0xE3AC) + { + if (s+2>e) + return MY_CS_TOOSMALL2; + + c1=((unsigned)(wc-0xE000)/94)+0xF5; + s[0]=c1; + c1=((unsigned)(wc-0xE000)%94)+0xa1; + s[1]=c1; + return 2; + } + + + /* User defined range */ + if (wc>=0xE3AC && wc<0xE758) + { + if (s+3>e) + return MY_CS_TOOSMALL3; + + s[0]=0x8F; + c1=((unsigned)(wc-0xE3AC)/94)+0xF5; + s[1]=c1; + c1=((unsigned)(wc-0xE3AC)%94)+0xa1; + s[2]=c1; + return 3; + } + + return MY_CS_ILUNI; +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_simple,/* strnncoll */ + my_strnncollsp_simple, + my_strnxfrm_mb, /* strnxfrm */ + my_strnxfrmlen_simple, + my_like_range_mb, /* like_range */ + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_eucjpms, + mbcharlen_eucjpms, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_eucjpms, + my_lengthsp_8bit, + my_numcells_eucjp, + my_mb_wc_euc_jp, /* mb_wc */ + my_wc_mb_euc_jp, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb, + my_casedn_str_mb, + my_caseup_mb, + my_casedn_mb, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + + +CHARSET_INFO my_charset_eucjpms_japanese_ci= +{ + 97,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ + "eucjpms", /* cs name */ + "eucjpms_japanese_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_eucjpms, + to_lower_eucjpms, + to_upper_eucjpms, + sort_order_eucjpms, + NULL, /* sort_order_big*/ + NULL, /* contractions */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + + +CHARSET_INFO my_charset_eucjpms_bin= +{ + 98,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "eucjpms", /* cs name */ + "eucjpms_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_eucjpms, + to_lower_eucjpms, + to_upper_eucjpms, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + + +#endif diff --git a/externals/mysql/strings/ctype-extra.c b/externals/mysql/strings/ctype-extra.c new file mode 100644 index 00000000000..ae7af0d50b1 --- /dev/null +++ b/externals/mysql/strings/ctype-extra.c @@ -0,0 +1,8773 @@ +/* + This file was generated by the conf_to_src utility. Do not edit it directly, + edit the XML definitions in sql/share/charsets/ instead. + + To re-generate, run the following in the strings/ directory: + ./conf_to_src ../sql/share/charsets/ > FILE +*/ + +/* Copyright (C) 2000-2007 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include + +#ifdef HAVE_CHARSET_dec8 +uchar ctype_dec8_swedish_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_dec8_swedish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_dec8_swedish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_dec8_swedish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0x41,0x41,0x41,0x41,0x5C,0x5B,0x5C,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49, +0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5D,0xD7,0xD8,0x55,0x55,0x55,0x59,0x59,0xDE,0xDF, +0x41,0x41,0x41,0x41,0x5C,0x5B,0x5C,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49, +0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5D,0xF7,0xD8,0x55,0x55,0x55,0x59,0x59,0xDE,0xFF +}; + +uint16 to_uni_dec8_swedish_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x00A1,0x00A2,0x00A3,0x0000,0x00A5,0x0000,0x00A7, +0x00A4,0x00A9,0x00AA,0x00AB,0x0000,0x0000,0x0000,0x0000, +0x00B0,0x00B1,0x00B2,0x00B3,0x0000,0x00B5,0x00B6,0x00B7, +0x0000,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x0000,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x0000,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x0152, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0178,0x0000,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x0000,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x0153, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FF,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_cp850 +uchar ctype_cp850_general_ci[] = { +0x00, +0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30, +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x30, +0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, +0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x10,0x01,0x10,0x10, +0x02,0x02,0x02,0x02,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10, +0x01,0x02,0x01,0x01,0x02,0x01,0x10,0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 +}; + +uchar to_lower_cp850_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x84,0x86, +0x82,0x91,0x91,0x93,0x94,0x95,0x96,0x97,0x98,0x94,0x81,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp850_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F, +0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_cp850_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x51,0x53,0x55,0x59,0x63,0x65,0x67,0x69,0x74,0x76,0x78,0x7A,0x7C,0x80, +0x8E,0x90,0x92,0x94,0x97,0x99,0xA3,0xA5,0xA7,0xA9,0xAE,0xB1,0xB2,0xB3,0xB4,0xB5, +0xB6,0x41,0x51,0x53,0x55,0x59,0x63,0x65,0x67,0x69,0x74,0x76,0x78,0x7A,0x7C,0x80, +0x8E,0x90,0x92,0x94,0x97,0x99,0xA3,0xA5,0xA7,0xA9,0xAE,0xB7,0xB8,0xB9,0xBA,0xBB, +0x54,0xA1,0x5D,0x47,0x4B,0x43,0x4D,0x54,0x5F,0x61,0x5B,0x71,0x6F,0x6B,0x4B,0x4D, +0x5D,0x4F,0x4F,0x86,0x8A,0x82,0x9F,0x9B,0xAD,0x8A,0xA1,0x8C,0xE3,0x8C,0xBD,0xBE, +0x45,0x6D,0x84,0x9D,0x7E,0x7E,0xEA,0xFA,0xFF,0xEE,0xEC,0xFD,0xFC,0xCE,0xEB,0xFB, +0xDC,0xDD,0xDE,0xC3,0xC9,0x45,0x47,0x43,0xE9,0xD5,0xCF,0xD1,0xD3,0xE2,0xE5,0xC5, +0xC6,0xCB,0xCA,0xC8,0xC2,0xCC,0x49,0x49,0xD2,0xD0,0xD7,0xD6,0xD4,0xCD,0xD8,0xE4, +0x57,0x57,0x5F,0x61,0x5B,0x73,0x6D,0x6F,0x71,0xC7,0xC4,0xDB,0xDA,0xE6,0x6B,0xD9, +0x84,0x96,0x86,0x82,0x88,0x88,0xF5,0xB0,0xB0,0x9D,0x9F,0x9B,0xAB,0xAB,0xEF,0xF4, +0xED,0xF1,0xC1,0xFE,0xF6,0xE7,0xBF,0xBC,0xF0,0xE8,0xF7,0xF9,0xF3,0xF2,0xDF,0xE0 +}; + +uint16 to_uni_cp850_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7, +0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5, +0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9, +0x00FF,0x00D6,0x00DC,0x00F8,0x00A3,0x00D8,0x00D7,0x0192, +0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA, +0x00BF,0x00AE,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB, +0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x00C0, +0x00A9,0x2563,0x2551,0x2557,0x255D,0x00A2,0x00A5,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x00E3,0x00C3, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4, +0x00F0,0x00D0,0x00CA,0x00CB,0x00C8,0x0131,0x00CD,0x00CE, +0x00CF,0x2518,0x250C,0x2588,0x2584,0x00A6,0x00CC,0x2580, +0x00D3,0x00DF,0x00D4,0x00D2,0x00F5,0x00D5,0x00B5,0x00FE, +0x00DE,0x00DA,0x00DB,0x00D9,0x00FD,0x00DD,0x00AF,0x00B4, +0x00AD,0x00B1,0x2017,0x00BE,0x00B6,0x00A7,0x00F7,0x00B8, +0x00B0,0x00A8,0x00B7,0x00B9,0x00B3,0x00B2,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_latin1 +uchar ctype_latin1_german1_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin1_german1_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin1_german1_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin1_german1_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49, +0xD0,0x4E,0x4F,0x4F,0x4F,0x4F,0x4F,0xD7,0x4F,0x55,0x55,0x55,0x55,0x59,0xDE,0x53, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49, +0xD0,0x4E,0x4F,0x4F,0x4F,0x4F,0x4F,0xF7,0x4F,0x55,0x55,0x55,0x55,0x59,0xDE,0xFF +}; + +uint16 to_uni_latin1_german1_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F, +0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_hp8 +uchar ctype_hp8_english_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x02, +0x01,0x10,0x10,0x01,0x02,0x10,0x10,0x02,0x01,0x10,0x01,0x01,0x01,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 +}; + +uchar to_lower_hp8_english_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xC8,0xC0,0xC9,0xC1,0xCD,0xD1,0xDD,0xA8,0xA9,0xAA,0xAB,0xAC,0xCB,0xC3,0xAF, +0xB0,0xB2,0xB2,0xB3,0xB5,0xB5,0xB7,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD4,0xD1,0xD6,0xD7,0xD4,0xD5,0xD6,0xD7,0xCC,0xD9,0xCE,0xCF,0xC5,0xDD,0xDE,0xC2, +0xC4,0xE2,0xE2,0xE4,0xE4,0xD5,0xD9,0xC6,0xCA,0xEA,0xEA,0xEC,0xEC,0xC7,0xEF,0xEF, +0xF1,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_hp8_english_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB1,0xB3,0xB4,0xB4,0xB6,0xB6,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xA2,0xA4,0xDF,0xAE,0xE0,0xDC,0xE7,0xED,0xA1,0xA3,0xE8,0xAD,0xD8,0xA5,0xDA,0xDB, +0xD0,0xA6,0xD2,0xD3,0xD0,0xE5,0xD2,0xD3,0xD8,0xE6,0xDA,0xDB,0xDC,0xA7,0xDE,0xDF, +0xE0,0xE1,0xE1,0xE3,0xE3,0xE5,0xE6,0xE7,0xE8,0xE9,0xE9,0xEB,0xEB,0xED,0xEE,0xEE, +0xF0,0xF0,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_hp8_english_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_hp8_english_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x00C0,0x00C2,0x00C8,0x00CA,0x00CB,0x00CE,0x00CF, +0x00B4,0x02CB,0x02C6,0x00A8,0x02DC,0x00D9,0x00DB,0x20A4, +0x00AF,0x00DD,0x00FD,0x00B0,0x00C7,0x00E7,0x00D1,0x00F1, +0x00A1,0x00BF,0x00A4,0x00A3,0x00A5,0x00A7,0x0192,0x00A2, +0x00E2,0x00EA,0x00F4,0x00FB,0x00E1,0x00E9,0x00F3,0x00FA, +0x00E0,0x00E8,0x00F2,0x00F9,0x00E4,0x00EB,0x00F6,0x00FC, +0x00C5,0x00EE,0x00D8,0x00C6,0x00E5,0x00ED,0x00F8,0x00E6, +0x00C4,0x00EC,0x00D6,0x00DC,0x00C9,0x00EF,0x00DF,0x00D4, +0x00C1,0x00C3,0x00E3,0x00D0,0x00F0,0x00CD,0x00CC,0x00D3, +0x00D2,0x00D5,0x00F5,0x0160,0x0161,0x00DA,0x0178,0x00FF, +0x00DE,0x00FE,0x00B7,0x00B5,0x00B6,0x00BE,0x2014,0x00BC, +0x00BD,0x00AA,0x00BA,0x00AB,0x25A0,0x00BB,0x00B1,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_koi8r +uchar ctype_koi8r_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 +}; + +uchar to_lower_koi8r_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar to_upper_koi8r_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xB3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_koi8r_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xE5,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE, +0xAF,0xB0,0xB1,0xE5,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD, +0xFE,0xDF,0xE0,0xF6,0xE3,0xE4,0xF4,0xE2,0xF5,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE, +0xEF,0xFF,0xF0,0xF1,0xF2,0xF3,0xE6,0xE1,0xFC,0xFB,0xE7,0xF8,0xFD,0xF9,0xF7,0xFA, +0xFE,0xDF,0xE0,0xF6,0xE3,0xE4,0xF4,0xE2,0xF5,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE, +0xEF,0xFF,0xF0,0xF1,0xF2,0xF3,0xE6,0xE1,0xFC,0xFB,0xE7,0xF8,0xFD,0xF9,0xF7,0xFA +}; + +uint16 to_uni_koi8r_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, +0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, +0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248, +0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, +0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556, +0x2557,0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E, +0x255F,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565, +0x2566,0x2567,0x2568,0x2569,0x256A,0x256B,0x256C,0x00A9, +0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, +0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, +0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, +0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, +0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, +0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A +}; + +#endif + +#ifdef HAVE_CHARSET_latin2 +uchar ctype_latin2_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, +0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin2_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin2_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin2_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x44,0x45,0x48,0x49,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x53,0x54,0x56, +0x58,0x59,0x5A,0x5B,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x68,0x69,0x6A,0x6B,0x6C, +0x6D,0x41,0x44,0x45,0x48,0x49,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x53,0x54,0x56, +0x58,0x59,0x5A,0x5B,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x6E,0x6F,0x70,0x71,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0x42,0xFF,0x52,0xFF,0x51,0x5C,0xFF,0xFF,0x5D,0x5B,0x5E,0x65,0xFF,0x67,0x66, +0xFF,0x42,0xFF,0x52,0xFF,0x51,0x5C,0xFF,0xFF,0x5D,0x5B,0x5E,0x65,0xFF,0x67,0x66, +0x5A,0x43,0x43,0x43,0x43,0x51,0x46,0x45,0x47,0x49,0x4A,0x49,0x49,0x4E,0x4E,0x48, +0xFF,0x55,0x54,0x57,0x56,0x56,0x56,0xFF,0x5A,0x5F,0x5F,0x5F,0x5F,0x63,0x5E,0xFF, +0x5A,0x43,0x43,0x43,0x43,0x51,0x46,0x45,0x47,0x49,0x4A,0x49,0x49,0x4E,0x4E,0x48, +0xFF,0x55,0x54,0x57,0x56,0x56,0x56,0xFF,0x5A,0x5F,0x5F,0x5F,0x5F,0x63,0x5E,0xFF +}; + +uint16 to_uni_latin2_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, +0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, +0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, +0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_swe7 +uchar ctype_swe7_swedish_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, +0x01,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_swe7_swedish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_swe7_swedish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_swe7_swedish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x45,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x59,0x5F, +0x45,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x59,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_swe7_swedish_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x00C9,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x00C4,0x00D6,0x00C5,0x00DC,0x005F, +0x00E9,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x00E4,0x00F6,0x00E5,0x00FC,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_ascii +uchar ctype_ascii_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_ascii_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_ascii_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_ascii_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_ascii_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1251 +uchar ctype_cp1251_bulgarian_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, +0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, +0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_cp1251_bulgarian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1251_bulgarian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, +0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar sort_order_cp1251_bulgarian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7C,0x7D,0x7E,0x7F,0x80, +0x81,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x82,0x83,0x84,0x85,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x61,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x61,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B, +0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B, +0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B, +0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B +}; + +uint16 to_uni_cp1251_bulgarian_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, +0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, +0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, +0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, +0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, +0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F +}; + +#endif + +#ifdef HAVE_CHARSET_latin1 +uchar ctype_latin1_danish_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin1_danish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin1_danish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin1_danish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0x41,0x41,0x41,0x41,0x5B,0x5D,0x5B,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49, +0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5C,0xD7,0x5C,0x55,0x55,0x55,0x59,0x59,0xDE,0xDF, +0x41,0x41,0x41,0x41,0x5B,0x5D,0x5B,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49, +0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5C,0xF7,0x5C,0x55,0x55,0x55,0x59,0x59,0xDE,0xFF +}; + +uint16 to_uni_latin1_danish_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F, +0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_hebrew +uchar ctype_hebrew_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x20,0x20,0x00 +}; + +uchar to_lower_hebrew_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_hebrew_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_hebrew_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_hebrew_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x203E, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2017, +0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7, +0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF, +0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7, +0x05E8,0x05E9,0x05EA,0x0000,0x0000,0x200E,0x200F,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_latin7 +uchar ctype_latin7_estonian_cs[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, +0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin7_estonian_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin7_estonian_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin7_estonian_cs[] = { +0x00,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x2E,0x2F,0x30,0x31,0x32,0x0A,0x0B, +0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, +0x2C,0x33,0x34,0x35,0x36,0x37,0x38,0x27,0x39,0x3A,0x3B,0x5D,0x3C,0x28,0x3D,0x3E, +0x76,0x7A,0x7C,0x7E,0x80,0x81,0x82,0x83,0x84,0x85,0x3F,0x40,0x5E,0x5F,0x60,0x41, +0x42,0x86,0x90,0x92,0x98,0x9A,0xA4,0xA6,0xAA,0xAC,0xB2,0xB4,0xB8,0xBE,0xC0,0xC6, +0xCE,0xD0,0xD2,0xD6,0xE5,0xE8,0xEE,0xF0,0xFA,0xFC,0xDD,0x43,0x44,0x45,0x46,0x47, +0x48,0x87,0x91,0x93,0x99,0x9B,0xA5,0xA7,0xAB,0xAD,0xB3,0xB5,0xB9,0xBF,0xC1,0xC7, +0xCF,0xD1,0xD3,0xD7,0xE6,0xE9,0xEF,0xF1,0xFB,0xFD,0xDE,0x49,0x4A,0x4B,0x4C,0x1C, +0x01,0x1D,0x57,0x1E,0x5A,0x74,0x71,0x72,0x1F,0x75,0x20,0x5B,0x21,0x4E,0x52,0x51, +0x22,0x55,0x56,0x58,0x59,0x73,0x2A,0x2B,0x23,0xE7,0x24,0x5C,0x25,0x4F,0x54,0x26, +0x2D,0xFE,0x66,0x67,0x68,0xFF,0x4D,0x69,0xCC,0x6A,0xD4,0x62,0x6B,0x29,0x6C,0x8E, +0x6D,0x61,0x7D,0x7F,0x50,0x6E,0x6F,0x70,0xCD,0x7B,0xD5,0x63,0x77,0x78,0x79,0x8F, +0x8C,0xB0,0x88,0x94,0xF4,0x8A,0xA2,0xA0,0x96,0x9C,0xDF,0x9E,0xA8,0xB6,0xAE,0xBA, +0xDB,0xC2,0xC4,0xC8,0xCA,0xF2,0xF6,0x64,0xEC,0xBC,0xD8,0xEA,0xF8,0xE1,0xE3,0xDA, +0x8D,0xB1,0x89,0x95,0xF5,0x8B,0xA3,0xA1,0x97,0x9D,0xE0,0x9F,0xA9,0xB7,0xAF,0xBB, +0xDC,0xC3,0xC5,0xC9,0xCB,0xF3,0xF7,0x65,0xED,0xBD,0xD9,0xEB,0xF9,0xE2,0xE4,0x53 +}; + +uint16 to_uni_latin7_estonian_cs[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 +}; + +#endif + +#ifdef HAVE_CHARSET_latin2 +uchar ctype_latin2_hungarian_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, +0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin2_hungarian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin2_hungarian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin2_hungarian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x47,0x48,0x4C,0x4E,0x53,0x54,0x55,0x56,0x5A,0x5B,0x5C,0x60,0x61,0x64, +0x69,0x6A,0x6B,0x6E,0x72,0x75,0x7A,0x7B,0x7C,0x7D,0x7F,0x83,0x84,0x85,0x86,0x87, +0x88,0x41,0x47,0x48,0x4C,0x4E,0x53,0x54,0x55,0x56,0x5A,0x5B,0x5C,0x60,0x61,0x64, +0x69,0x6A,0x6B,0x6E,0x72,0x75,0x7A,0x7B,0x7C,0x7D,0x7F,0x89,0x8A,0x8B,0x8C,0x00, +0x01,0x78,0x4E,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x67,0x67,0x56,0x56,0x0F,0x41, +0x4E,0x12,0x13,0x67,0x67,0x64,0x78,0x75,0x78,0x67,0x78,0x1C,0x1D,0x1E,0x1F,0xFF, +0x41,0x56,0x64,0x75,0x5E,0x6F,0xFF,0x67,0xFF,0x70,0x71,0x73,0x80,0xFF,0x81,0x82, +0xFF,0x42,0xFF,0x5D,0xFF,0x41,0x6F,0xFF,0xFF,0x70,0x71,0x73,0x80,0xFF,0x81,0x82, +0x6C,0x41,0x44,0x45,0x46,0x5F,0x49,0x4B,0x4A,0x4E,0x51,0x52,0x50,0x56,0x57,0x4D, +0xFF,0x62,0x63,0x64,0x66,0x67,0x67,0xFF,0x6D,0x77,0x75,0x78,0x78,0x7E,0x74,0xFF, +0x64,0x41,0x44,0x45,0x46,0x5F,0x49,0x4B,0x4A,0x4E,0x51,0x78,0x50,0x56,0x58,0x4D, +0xFF,0x62,0x63,0x64,0x66,0x67,0x67,0xFF,0x6D,0x77,0x75,0x78,0x78,0x7E,0x74,0xFF +}; + +uint16 to_uni_latin2_hungarian_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, +0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, +0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, +0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_koi8u +uchar ctype_koi8u_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x02,0x02,0x10,0x02,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10, +0x10,0x10,0x10,0x01,0x01,0x10,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 +}; + +uchar to_lower_koi8u_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x20,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20, +0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar to_upper_koi8u_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20, +0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_koi8u_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4, +0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4, +0xC5,0xC6,0xC7,0x88,0x87,0xC8,0x8C,0x8D,0xC9,0xCA,0xCB,0xCC,0xCD,0x84,0xCE,0xCF, +0xD0,0xD1,0xD2,0x88,0x87,0xD3,0x8C,0x8D,0xD4,0xD5,0xD6,0xD7,0xD8,0x84,0xD9,0xDA, +0xA3,0x80,0x81,0x9B,0x85,0x86,0x99,0x83,0x9A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93, +0x94,0xA4,0x95,0x96,0x97,0x98,0x89,0x82,0xA1,0xA0,0x8A,0x9D,0xA2,0x9E,0x9C,0x9F, +0xA3,0x80,0x81,0x9B,0x85,0x86,0x99,0x83,0x9A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93, +0x94,0xA4,0x95,0x96,0x97,0x98,0x89,0x82,0xA1,0xA0,0x8A,0x9D,0xA2,0x9E,0x9C,0x9F +}; + +uint16 to_uni_koi8u_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, +0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, +0x2591,0x2592,0x2593,0x2320,0x25A0,0x2022,0x221A,0x2248, +0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, +0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457, +0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E, +0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407, +0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9, +0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, +0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, +0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, +0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, +0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, +0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A +}; + +#endif + +#ifdef HAVE_CHARSET_cp1251 +uchar ctype_cp1251_ukrainian_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, +0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, +0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_cp1251_ukrainian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1251_ukrainian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, +0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar sort_order_cp1251_ukrainian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4, +0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4, +0xC5,0xC6,0xC7,0xC8,0xC9,0x84,0xCA,0xCB,0x88,0xCC,0x87,0xCD,0xCE,0xCF,0xD0,0x8D, +0xD1,0xD2,0x8C,0x8C,0x84,0xD3,0xD4,0xD5,0x88,0xD6,0x87,0xD7,0xD8,0xD9,0xDA,0x8D, +0x80,0x81,0x82,0x83,0x85,0x86,0x89,0x8A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94, +0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4, +0x80,0x81,0x82,0x83,0x85,0x86,0x89,0x8A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94, +0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4 +}; + +uint16 to_uni_cp1251_ukrainian_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, +0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, +0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, +0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, +0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, +0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F +}; + +#endif + +#ifdef HAVE_CHARSET_greek +uchar ctype_greek_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x00,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x01,0x01,0x10,0x01,0x10,0x01,0x01, +0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 +}; + +uchar to_lower_greek_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xDC,0xB7,0xDD,0xDE,0xDF,0xBB,0xFC,0xBD,0xFD,0xFE, +0xC0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xD2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_greek_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xDA,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xC1,0xC5,0xC7,0xC9, +0xDB,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xCF,0xD5,0xD9,0xFF +}; + +uchar sort_order_greek_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xC1,0xB7,0xC5,0xC7,0xC9,0xBB,0xCF,0xBD,0xD5,0xD9, +0xC9,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xC9,0xD5,0xC1,0xC5,0xC7,0xC9, +0xD5,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xC9,0xD5,0xCF,0xD5,0xD9,0xFF +}; + +uint16 to_uni_greek_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x02BD,0x02BC,0x00A3,0x0000,0x0000,0x00A6,0x00A7, +0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x0000,0x2015, +0x00B0,0x00B1,0x00B2,0x00B3,0x0384,0x0385,0x0386,0x00B7, +0x0388,0x0389,0x038A,0x00BB,0x038C,0x00BD,0x038E,0x038F, +0x0390,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, +0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, +0x03A0,0x03A1,0x0000,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, +0x03A8,0x03A9,0x03AA,0x03AB,0x03AC,0x03AD,0x03AE,0x03AF, +0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7, +0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF, +0x03C0,0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7, +0x03C8,0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1250 +uchar ctype_cp1250_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, +0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_cp1250_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1250_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_cp1250_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x46,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x55, +0x56,0x57,0x58,0x59,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x63,0x64,0x65,0x66,0x67, +0x68,0x41,0x42,0x43,0x46,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x55, +0x56,0x57,0x58,0x59,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x5A,0x8B,0x5A,0x5B,0x62,0x62, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x5A,0x9B,0x5A,0x5B,0x62,0x62, +0x20,0xA1,0xA2,0x50,0xA4,0x41,0xA6,0x59,0xA8,0xA9,0x59,0xAB,0xAC,0xAD,0xAE,0x62, +0xB0,0xB1,0xB2,0x50,0xB4,0xB5,0xB6,0xB7,0xB8,0x41,0x59,0xBB,0x50,0xBD,0x50,0x62, +0x58,0x41,0x41,0x41,0x41,0x50,0x45,0x43,0x44,0x49,0x49,0x49,0x49,0x4D,0x4D,0x46, +0x47,0x53,0x53,0x55,0x55,0x55,0x55,0xD7,0x58,0x5C,0x5C,0x5C,0x5C,0x60,0x5B,0x59, +0x58,0x41,0x41,0x41,0x41,0x50,0x45,0x43,0x44,0x49,0x49,0x49,0x49,0x4D,0x4D,0x46, +0x47,0x53,0x53,0x55,0x55,0x55,0x55,0xF7,0x58,0x5C,0x5C,0x5C,0x5C,0x60,0x5B,0xFF +}; + +uint16 to_uni_cp1250_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, +0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, +0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, +0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_latin2 +uchar ctype_latin2_croatian_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, +0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin2_croatian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin2_croatian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin2_croatian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59, +0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0xC6,0xC7,0xC8,0xC9,0xCA, +0xCB,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59, +0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0xCC,0xCD,0xCE,0xCF,0xD0, +0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0, +0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0, +0xF1,0x41,0xF2,0x54,0xF3,0x54,0x5F,0xF4,0xF5,0x61,0x5F,0x62,0x6B,0xF6,0x8E,0x6B, +0xF7,0x41,0xF8,0x54,0xF9,0x54,0x5F,0xFA,0xFB,0x61,0x5F,0x62,0x6B,0xFC,0x8E,0x6B, +0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48, +0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xFD,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0x5F, +0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48, +0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xFE,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF +}; + +uint16 to_uni_latin2_croatian_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, +0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, +0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, +0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1257 +uchar ctype_cp1257_lithuanian_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 +}; + +uchar to_lower_cp1257_lithuanian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1257_lithuanian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_cp1257_lithuanian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x44,0x46,0x47,0x4A,0x4B,0x4C,0x4D,0x50,0x51,0x52,0x53,0x54,0x55, +0x56,0x57,0x58,0x59,0x5B,0x5C,0x5F,0x60,0x61,0x4E,0xFF,0x62,0x63,0x64,0x65,0x66, +0x67,0x41,0x43,0x44,0x46,0x47,0x4A,0x4B,0x4C,0x4D,0x50,0x51,0x52,0x53,0x54,0x55, +0x56,0x57,0x58,0x59,0x5B,0x5C,0x5F,0x60,0x61,0x4E,0xFF,0x68,0x69,0x6A,0x6B,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, +0x42,0x4F,0xFF,0xFF,0xFF,0xFF,0x48,0xFF,0x45,0xFF,0xFF,0x49,0xFF,0xFF,0xFF,0xFF, +0x5A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x5D,0xFF,0xFF,0xFF,0xFF, +0xFF,0x4F,0xFF,0xFF,0xFF,0xFF,0x48,0xFF,0x45,0xFF,0xFF,0x49,0xFF,0xFF,0xFF,0xFF, +0x5A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x5D,0xFF,0xFF,0xFF,0xFF +}; + +uint16 to_uni_cp1257_lithuanian_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000, +0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_latin5 +uchar ctype_latin5_turkish_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin5_turkish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0xFD,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0x69,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin5_turkish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0xDD,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF +}; + +uchar sort_order_latin5_turkish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x45,0x46,0x47,0x48,0x4A,0x4B,0x4D,0x4E,0x4F,0x50,0x51,0x52, +0x54,0x55,0x56,0x57,0x59,0x5A,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x65, +0x66,0x41,0x42,0x43,0x45,0x46,0x47,0x48,0x4A,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52, +0x54,0x55,0x56,0x57,0x59,0x5A,0x5C,0x5D,0x5E,0x5F,0x60,0x87,0x88,0x89,0x8A,0x8B, +0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B, +0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB, +0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB, +0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x44,0x46,0x46,0x46,0x46,0x4C,0x4C,0x4C,0x4C, +0x49,0x51,0x52,0x52,0x52,0x52,0x53,0xE0,0x52,0x5A,0x5A,0x5A,0x5B,0x4C,0x58,0x57, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x44,0x46,0x46,0x46,0x46,0x4C,0x4C,0x4C,0x4C, +0x49,0x51,0x52,0x52,0x52,0x52,0x53,0xFA,0x52,0x5A,0x5A,0x5A,0x5B,0x4B,0x58,0x5F +}; + +uint16 to_uni_latin5_turkish_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_armscii8 +uchar ctype_armscii8_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10 +}; + +uchar to_lower_armscii8_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB3,0xB3,0xB5,0xB5,0xB7,0xB7,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF,0xBF, +0xC1,0xC1,0xC3,0xC3,0xC5,0xC5,0xC7,0xC7,0xC9,0xC9,0xCB,0xCB,0xCD,0xCD,0xCF,0xCF, +0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xD9,0xD9,0xDB,0xDB,0xDD,0xDD,0xDF,0xDF, +0xE1,0xE1,0xE3,0xE3,0xE5,0xE5,0xE7,0xE7,0xE9,0xE9,0xEB,0xEB,0xED,0xED,0xEF,0xEF, +0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFB,0xFB,0xFD,0xFD,0xFE,0xFF +}; + +uchar to_upper_armscii8_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xB4,0xB4,0xB6,0xB6,0xB8,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE, +0xC0,0xC0,0xC2,0xC2,0xC4,0xC4,0xC6,0xC6,0xC8,0xC8,0xCA,0xCA,0xCC,0xCC,0xCE,0xCE, +0xD0,0xD0,0xD2,0xD2,0xD4,0xD4,0xD6,0xD6,0xD8,0xD8,0xDA,0xDA,0xDC,0xDC,0xDE,0xDE, +0xE0,0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE, +0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF +}; + +uchar sort_order_armscii8_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_armscii8_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x2741,0x00A7,0x0589,0x0029,0x0028,0x00BB,0x00AB, +0x2014,0x002E,0x055D,0x002C,0x002D,0x055F,0x2026,0x055C, +0x055B,0x055E,0x0531,0x0561,0x0532,0x0562,0x0533,0x0563, +0x0534,0x0564,0x0535,0x0565,0x0536,0x0566,0x0537,0x0567, +0x0538,0x0568,0x0539,0x0569,0x053A,0x056A,0x053B,0x056B, +0x053C,0x056C,0x053D,0x056D,0x053E,0x056E,0x053F,0x056F, +0x0540,0x0570,0x0541,0x0571,0x0542,0x0572,0x0543,0x0573, +0x0544,0x0574,0x0545,0x0575,0x0546,0x0576,0x0547,0x0577, +0x0548,0x0578,0x0549,0x0579,0x054A,0x057A,0x054B,0x057B, +0x054C,0x057C,0x054D,0x057D,0x054E,0x057E,0x054F,0x057F, +0x0550,0x0580,0x0551,0x0581,0x0552,0x0582,0x0553,0x0583, +0x0554,0x0584,0x0555,0x0585,0x0556,0x0586,0x2019,0x0027 +}; + +#endif + +#ifdef HAVE_CHARSET_cp866 +uchar ctype_cp866_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 +}; + +uchar to_lower_cp866_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp866_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_cp866_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D, +0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xBD,0xBE,0xBF,0xC0,0xC1, +0xC2,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D, +0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xC3,0xC4,0xC5,0xC6,0xC7, +0x75,0x77,0x79,0x7B,0x7D,0x7F,0x85,0x87,0x89,0x8D,0x8F,0x91,0x93,0x95,0x97,0x99, +0x9B,0x9D,0x9F,0xA1,0xA5,0xA7,0xA9,0xAB,0xAD,0xAF,0xB1,0xB3,0xB5,0xB7,0xB9,0xBB, +0x75,0x77,0x79,0x7B,0x7D,0x7F,0x85,0x87,0x89,0x8D,0x8F,0x91,0x93,0x95,0x97,0x99, +0xC8,0xC9,0xCA,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0x9B,0x9D,0x9F,0xA1,0xA5,0xA7,0xA9,0xAB,0xAD,0xAF,0xB1,0xB3,0xB5,0xB7,0xB9,0xBB, +0x81,0x81,0x83,0x83,0x8B,0x8B,0xA3,0xA3,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2 +}; + +uint16 to_uni_cp866_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556, +0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567, +0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B, +0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F, +0x0401,0x0451,0x0404,0x0454,0x0407,0x0457,0x040E,0x045E, +0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_keybcs2 +uchar ctype_keybcs2_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x02,0x82,0x02,0x02,0x01,0x01,0x02,0x82,0x81,0x01,0x01,0x02,0x02,0x01,0x01, +0x81,0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x01,0x02,0x00,0x02,0x02,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 +}; + +uchar to_lower_keybcs2_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x81,0x82,0x83,0x84,0x83,0x86,0x87,0x88,0x88,0x8D,0xA1,0x8C,0x8D,0x84,0xA0, +0x82,0x91,0x91,0x93,0x94,0xA2,0x96,0xA3,0x98,0x94,0x81,0x9B,0x8C,0x98,0xA9,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0x96,0x93,0x9B,0xA9,0xAA,0xAA,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xED,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_keybcs2_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x68,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x9A,0x90,0x85,0x8E,0x85,0x86,0x80,0x89,0x89,0x8A,0x8B,0x9C,0x8A,0x8E,0x8F, +0x90,0x92,0x92,0xA7,0x99,0x95,0xA6,0x97,0x9D,0x99,0x9A,0xA8,0x9C,0x9D,0x9E,0x9F, +0x8F,0x8B,0x95,0x97,0xA5,0xA5,0xA6,0xA7,0xA8,0x9E,0xAB,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xE8,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_keybcs2_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x44,0x45,0x47,0x49,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x5A, +0x5E,0x5F,0x60,0x63,0x66,0x68,0x6C,0x6D,0x6E,0x6F,0x72,0x90,0x91,0x92,0x93,0x94, +0x95,0x41,0x44,0x45,0x47,0x49,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x5A, +0x5E,0x5F,0x60,0x63,0x66,0x68,0x6C,0x6D,0x6E,0x6F,0x72,0x96,0x97,0x98,0x99,0x9A, +0x45,0x68,0x49,0x47,0x41,0x47,0x66,0x45,0x49,0x49,0x56,0x53,0x56,0x56,0x41,0x41, +0x49,0x72,0x72,0x5A,0x5A,0x5A,0x68,0x68,0x6F,0x5A,0x68,0x63,0x56,0x6F,0x60,0x66, +0x41,0x53,0x5A,0x68,0x58,0x58,0x68,0x5A,0x63,0x60,0x60,0x60,0xA0,0xA1,0xA2,0xA3, +0xA4,0xA5,0xA6,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC, +0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC, +0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC, +0x80,0x65,0x83,0x87,0x88,0x89,0xDD,0x8A,0x85,0x8B,0x84,0x81,0xDE,0x85,0x82,0xDF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_keybcs2_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x010C,0x00FC,0x00E9,0x010F,0x00E4,0x010E,0x0164,0x010D, +0x011B,0x011A,0x0139,0x00CD,0x013E,0x013A,0x00C4,0x00C1, +0x00C9,0x017E,0x017D,0x00F4,0x00F6,0x00D3,0x016F,0x00DA, +0x00FD,0x00D6,0x00DC,0x0160,0x013D,0x00DD,0x0158,0x0165, +0x00E1,0x00ED,0x00F3,0x00FA,0x0148,0x0147,0x016E,0x00D4, +0x0161,0x0159,0x0155,0x0154,0x00BC,0x00A1,0x00AB,0x00BB, +0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556, +0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567, +0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B, +0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580, +0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4, +0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229, +0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248, +0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_macce +uchar ctype_macce_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x02,0x02,0x01,0x02,0x02,0x01, +0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02, +0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x01, +0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01, +0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x02,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x01,0x00,0x00,0x02,0x01, +0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x01, +0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00 +}; + +uchar to_lower_macce_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x8A,0x82,0x82,0x8E,0x88,0x9A,0x9F,0x87,0x88,0x8B,0x8A,0x8B,0x8D,0x8D,0x8E,0x90, +0x90,0x93,0x92,0x93,0x95,0x95,0x98,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9E,0x9E,0x9F, +0xA0,0xA1,0xAB,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xB0, +0xB0,0xB4,0xB2,0xB3,0xB4,0xFA,0xB6,0xB7,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE,0xC0, +0xC0,0xC4,0xC2,0xC3,0xC4,0xCB,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCE,0x9B,0xCE,0xD8, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xDA,0xDA,0xDE,0xDC,0xDD,0xDE,0xE0, +0xE0,0xE4,0xE2,0xE3,0xE4,0xE6,0xE6,0x87,0xE9,0xE9,0x92,0xEC,0xEC,0xF0,0x97,0x99, +0xF0,0xF3,0x9C,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFA,0xFD,0xB8,0xFD,0xAE,0xFF +}; + +uchar to_upper_macce_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x81,0x83,0x84,0x85,0x86,0xE7,0x84,0x89,0x80,0x89,0x8C,0x8C,0x83,0x8F, +0x8F,0x91,0xEA,0x91,0x94,0x94,0x96,0xEE,0x96,0xEF,0x85,0xCD,0xF2,0x9D,0x9D,0x86, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xA2,0xAC,0xAD,0xFE,0xAF, +0xAF,0xB1,0xB2,0xB3,0xB1,0xB5,0xB6,0xB7,0xFC,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF, +0xBF,0xC1,0xC2,0xC3,0xC1,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xC5,0xCC,0xCD,0xCC,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xCF,0xD9,0xD9,0xDB,0xDC,0xDD,0xDB,0xDF, +0xDF,0xE1,0xE2,0xE3,0xE1,0xE5,0xE5,0xE7,0xE8,0xE8,0xEA,0xEB,0xEB,0xED,0xEE,0xEF, +0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF +}; + +uchar sort_order_macce_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x46,0x47,0x4A,0x4C,0x52,0x53,0x55,0x56,0x5A,0x5B,0x5D,0x62,0x62,0x67, +0x6F,0x70,0x71,0x75,0x79,0x81,0x88,0x89,0x8A,0x8B,0x8D,0x90,0x91,0x92,0x93,0x94, +0x95,0x41,0x46,0x47,0x4A,0x4C,0x52,0x53,0x55,0x56,0x5A,0x5B,0x5D,0x62,0x62,0x67, +0x6F,0x70,0x71,0x75,0x79,0x81,0x88,0x89,0x8A,0x8B,0x8D,0x96,0x97,0x98,0x99,0x9A, +0x41,0x41,0x41,0x4C,0x41,0x67,0x81,0x41,0x41,0x47,0x41,0x47,0x47,0x47,0x4C,0x8D, +0x8D,0x4A,0x56,0x4A,0x4C,0x4C,0x4C,0x67,0x4C,0x67,0x67,0x67,0x81,0x4C,0x4C,0x81, +0xA0,0xA1,0x4C,0xA3,0xA4,0xA5,0xA6,0x75,0xA8,0xA9,0xAA,0x4C,0xAC,0xAD,0x53,0x56, +0x56,0x56,0xB2,0xB3,0x56,0x5B,0xB6,0xB7,0x5D,0x5D,0x5D,0x5D,0x5D,0x5D,0x5D,0x62, +0x62,0x62,0xC2,0xC3,0x62,0x62,0xC6,0xC7,0xC8,0xC9,0xCA,0x62,0x67,0x67,0x67,0x67, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0x67,0x71,0x71,0x71,0xDC,0xDD,0x71,0x71, +0x71,0x75,0xE2,0xE3,0x75,0x75,0x75,0x41,0x79,0x79,0x56,0x8D,0x8D,0x81,0x67,0x67, +0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x8B,0x8B,0x5B,0x8D,0x5D,0x8D,0x53,0xFF +}; + +uint16 to_uni_macce_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C4,0x0100,0x0101,0x00C9,0x0104,0x00D6,0x00DC,0x00E1, +0x0105,0x010C,0x00E4,0x010D,0x0106,0x0107,0x00E9,0x0179, +0x017A,0x010E,0x00ED,0x010F,0x0112,0x0113,0x0116,0x00F3, +0x0117,0x00F4,0x00F6,0x00F5,0x00FA,0x011A,0x011B,0x00FC, +0x2020,0x00B0,0x0118,0x00A3,0x00A7,0x2022,0x00B6,0x00DF, +0x00AE,0x00A9,0x2122,0x0119,0x00A8,0x2260,0x0123,0x012E, +0x012F,0x012A,0x2264,0x2265,0x012B,0x0136,0x2202,0x2211, +0x0142,0x013B,0x013C,0x013D,0x013E,0x0139,0x013A,0x0145, +0x0146,0x0143,0x00AC,0x221A,0x0144,0x0147,0x2206,0x00AB, +0x00BB,0x2026,0x00A0,0x0148,0x0150,0x00D5,0x0151,0x014C, +0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA, +0x014D,0x0154,0x0155,0x0158,0x2039,0x203A,0x0159,0x0156, +0x0157,0x0160,0x201A,0x201E,0x0161,0x015A,0x015B,0x00C1, +0x0164,0x0165,0x00CD,0x017D,0x017E,0x016A,0x00D3,0x00D4, +0x016B,0x016E,0x00DA,0x016F,0x0170,0x0171,0x0172,0x0173, +0x00DD,0x00FD,0x0137,0x017B,0x0141,0x017C,0x0122,0x02C7 +}; + +#endif + +#ifdef HAVE_CHARSET_macroman +uchar ctype_macroman_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x10, +0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, +0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_macroman_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x8A,0x8C,0x8D,0x8E,0x96,0x9A,0x9F,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xBE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0x88,0x8B,0x9B,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD8,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0x89,0x90,0x87,0x91,0x8F,0x92,0x94,0x95,0x93,0x97,0x99, +0xF0,0x98,0x9C,0x9E,0x9D,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_macroman_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0xE7,0xCB,0xE5,0x80,0xCC,0x81,0x82,0x83,0xE9, +0xE6,0xE8,0xEA,0xED,0xEB,0xEC,0x84,0xEE,0xF1,0xEF,0x85,0xCD,0xF2,0xF4,0xF3,0x86, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xAE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD9,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_macroman_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x49,0x50,0x52,0x53,0x57,0x59,0x60,0x61,0x67,0x68,0x69,0x70,0x71,0x72, +0x79,0x80,0x81,0x82,0x84,0x85,0x90,0x91,0x92,0x93,0x95,0xA0,0xA1,0xA2,0xA3,0xA4, +0xA5,0x41,0x49,0x50,0x52,0x53,0x57,0x59,0x60,0x61,0x67,0x68,0x69,0x70,0x71,0x72, +0x79,0x80,0x81,0x82,0x84,0x85,0x90,0x91,0x92,0x93,0x95,0xA6,0xA7,0xA8,0xA9,0xAA, +0x41,0x41,0x50,0x53,0x71,0x72,0x85,0x41,0x41,0x41,0x41,0x41,0x41,0x50,0x53,0x53, +0x53,0x53,0x61,0x61,0x61,0x61,0x71,0x72,0x72,0x72,0x72,0x72,0x85,0x85,0x85,0x85, +0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0x82,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0x48,0x72, +0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0x48,0x72, +0xC6,0xC7,0xC8,0xC9,0x57,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0x41,0x41,0x72,0xD0,0xD1, +0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0x93,0x93,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0x41,0x53,0x41,0x53,0x53,0x61,0x61,0x61,0x61,0x72,0x72, +0xF0,0x72,0x85,0x85,0x85,0x61,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_macroman_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1, +0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8, +0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3, +0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC, +0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF, +0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8, +0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211, +0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8, +0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB, +0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153, +0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA, +0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02, +0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1, +0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4, +0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC, +0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7 +}; + +#endif + +#ifdef HAVE_CHARSET_cp852 +uchar ctype_cp852_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,0x01,0x01,0x01, +0x01,0x01,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x02,0x01,0x00,0x02, +0x02,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x02,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x01,0x00, +0x01,0x02,0x01,0x01,0x02,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48 +}; + +uchar to_lower_cp852_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8B,0x8B,0x8C,0xAB,0x84,0x86, +0x82,0x92,0x92,0x93,0x94,0x96,0x96,0x98,0x98,0x94,0x81,0x9C,0x9C,0x88,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAA,0xAB,0x9F,0xB8,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xA0,0x83,0xD8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD0,0xD4,0x89,0xD4,0xE5,0xA1,0x8C,0xD8,0xD9,0xDA,0xDB,0xDC,0xEE,0x85,0xDF, +0xA2,0xE1,0x93,0xE4,0xE4,0xE5,0xE7,0xE7,0xEA,0xA3,0xE8,0xFB,0xEC,0xEC,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp852_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F, +0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0xAC, +0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xAD,0xB9,0xBA,0xBB,0xBC,0xBE,0xBD,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF +}; + +uchar sort_order_cp852_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x47,0x48,0x4C,0x4F,0x54,0x55,0x56,0x57,0x5A,0x5B,0x5C,0x5E,0x5F,0x62, +0x67,0x68,0x69,0x6C,0x71,0x74,0x75,0x76,0x77,0x78,0x7B,0x90,0x91,0x92,0x93,0x94, +0x95,0x41,0x47,0x48,0x4C,0x4F,0x54,0x55,0x56,0x57,0x5A,0x5B,0x5C,0x5E,0x5F,0x62, +0x67,0x68,0x69,0x6C,0x71,0x74,0x75,0x76,0x77,0x78,0x7B,0x96,0x97,0x98,0x99,0x9A, +0x48,0x74,0x4F,0x41,0x41,0x74,0x48,0x48,0x5C,0x4F,0x62,0x62,0x57,0x7B,0x41,0x48, +0x4F,0x5C,0x5C,0x62,0x62,0x5C,0x5C,0x6C,0x6C,0x62,0x74,0x71,0x71,0x5C,0x9E,0x48, +0x41,0x57,0x62,0x74,0x41,0x41,0x7B,0x7B,0x4F,0x4F,0xAA,0x7B,0x48,0x6C,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0x41,0x41,0x4F,0x6C,0xB5,0xBA,0xBB,0xBC,0x7B,0x7B,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0x41,0x41,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0x4C,0x4C,0x4C,0x4F,0x4C,0x60,0x57,0x57,0x4F,0xD9,0xDA,0xDB,0xDC,0x71,0x74,0xDF, +0x62,0x70,0x62,0x60,0x60,0x60,0x6C,0x6C,0x69,0x74,0x69,0x74,0x78,0x78,0x71,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0x74,0x69,0x69,0xFE,0xFF +}; + +uint16 to_uni_cp852_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x016F,0x0107,0x00E7, +0x0142,0x00EB,0x0150,0x0151,0x00EE,0x0179,0x00C4,0x0106, +0x00C9,0x0139,0x013A,0x00F4,0x00F6,0x013D,0x013E,0x015A, +0x015B,0x00D6,0x00DC,0x0164,0x0165,0x0141,0x00D7,0x010D, +0x00E1,0x00ED,0x00F3,0x00FA,0x0104,0x0105,0x017D,0x017E, +0x0118,0x0119,0x00AC,0x017A,0x010C,0x015F,0x00AB,0x00BB, +0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x011A, +0x015E,0x2563,0x2551,0x2557,0x255D,0x017B,0x017C,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x0102,0x0103, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4, +0x0111,0x0110,0x010E,0x00CB,0x010F,0x0147,0x00CD,0x00CE, +0x011B,0x2518,0x250C,0x2588,0x2584,0x0162,0x016E,0x2580, +0x00D3,0x00DF,0x00D4,0x0143,0x0144,0x0148,0x0160,0x0161, +0x0154,0x00DA,0x0155,0x0170,0x00FD,0x00DD,0x0163,0x00B4, +0x00AD,0x02DD,0x02DB,0x02C7,0x02D8,0x00A7,0x00F7,0x00B8, +0x00B0,0x00A8,0x02D9,0x0171,0x0158,0x0159,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_latin7 +uchar ctype_latin7_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, +0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin7_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin7_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin7_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x30,0x32,0x33,0x34,0x35,0x36,0x37,0x2B,0x38,0x39,0x3A,0x5C,0x3B,0x2C,0x3C,0x3D, +0x76,0x7A,0x7C,0x7E,0x80,0x81,0x82,0x83,0x84,0x85,0x3E,0x3F,0x5D,0x5E,0x5F,0x40, +0x41,0x86,0x92,0x94,0x9A,0x9C,0xA6,0xA8,0xAC,0xAE,0xB4,0xB6,0xBA,0xC0,0xC2,0xC8, +0xD4,0xD6,0xD8,0xDC,0xE3,0xE6,0xEE,0xF0,0xF2,0xF4,0xF6,0x42,0x43,0x44,0x45,0x46, +0x47,0x86,0x92,0x94,0x9A,0x9C,0xA6,0xA8,0xAC,0xAE,0xB4,0xB6,0xBA,0xC0,0xC2,0xC8, +0xD4,0xD6,0xD8,0xDC,0xE2,0xE6,0xEE,0xF0,0xF2,0xF4,0xF6,0x48,0x49,0x4A,0x4B,0x20, +0x75,0x21,0x56,0x22,0x59,0x73,0x70,0x71,0x23,0x74,0x24,0x5A,0x25,0x4D,0x51,0x50, +0x26,0x54,0x55,0x57,0x58,0x72,0x2E,0x2F,0x27,0xE5,0x28,0x5B,0x29,0x4E,0x53,0x2A, +0x31,0xFE,0x65,0x66,0x67,0xFF,0x4C,0x68,0x2D,0x69,0xDA,0x61,0x6A,0x2D,0x6B,0x90, +0x6C,0x60,0x7D,0x7F,0x4F,0x6D,0x6E,0x6F,0xD3,0x7B,0xDB,0x62,0x77,0x78,0x79,0x90, +0x8E,0xB2,0x8A,0x96,0x88,0x8C,0xA4,0xA2,0x98,0x9E,0xF8,0xA0,0xAA,0xB8,0xB0,0xBE, +0xE1,0xC4,0xC6,0xCA,0xCE,0xD0,0xCC,0x63,0xEC,0xBC,0xDE,0xEA,0xE8,0xFA,0xFC,0xE0, +0x8E,0xB2,0x8A,0x96,0x88,0x8C,0xA4,0xA2,0x98,0x9E,0xF8,0xA0,0xAA,0xB8,0xB0,0xBE, +0xE1,0xC4,0xC6,0xCA,0xCE,0xD0,0xCC,0x64,0xEC,0xBC,0xDE,0xEA,0xE8,0xFA,0xFC,0x52 +}; + +uint16 to_uni_latin7_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 +}; + +#endif + +#ifdef HAVE_CHARSET_latin7 +uchar ctype_latin7_general_cs[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, +0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin7_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin7_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin7_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x30,0x32,0x33,0x34,0x35,0x36,0x37,0x2B,0x38,0x39,0x3A,0x5C,0x3B,0x2C,0x3C,0x3D, +0x76,0x7A,0x7C,0x7E,0x80,0x81,0x82,0x83,0x84,0x85,0x3E,0x3F,0x5D,0x5E,0x5F,0x40, +0x41,0x86,0x92,0x94,0x9A,0x9C,0xA6,0xA8,0xAC,0xAE,0xB4,0xB6,0xBA,0xC0,0xC2,0xC8, +0xD4,0xD6,0xD8,0xDC,0xE3,0xE6,0xEE,0xF0,0xF2,0xF4,0xF6,0x42,0x43,0x44,0x45,0x46, +0x47,0x87,0x93,0x95,0x9B,0x9D,0xA7,0xA9,0xAD,0xAF,0xB5,0xB7,0xBB,0xC1,0xC3,0xC9, +0xD5,0xD7,0xD9,0xDD,0xE4,0xE7,0xEF,0xF1,0xF3,0xF5,0xF7,0x48,0x49,0x4A,0x4B,0x20, +0x75,0x21,0x56,0x22,0x59,0x73,0x70,0x71,0x23,0x74,0x24,0x5A,0x25,0x4D,0x51,0x50, +0x26,0x54,0x55,0x57,0x58,0x72,0x2E,0x2F,0x27,0xE5,0x28,0x5B,0x29,0x4E,0x53,0x2A, +0x31,0xFE,0x65,0x66,0x67,0xFF,0x4C,0x68,0xD3,0x69,0xDA,0x61,0x6A,0x2D,0x6B,0x90, +0x6C,0x60,0x7D,0x7F,0x4F,0x6D,0x6E,0x6F,0xD2,0x7B,0xDB,0x62,0x77,0x78,0x79,0x91, +0x8E,0xB2,0x8A,0x96,0x88,0x8C,0xA4,0xA2,0x98,0x9E,0xF8,0xA0,0xAA,0xB8,0xB0,0xBE, +0xE1,0xC4,0xC6,0xCA,0xCE,0xD0,0xCC,0x63,0xEC,0xBC,0xDE,0xEA,0xE8,0xFA,0xFC,0xE0, +0x8F,0xB3,0x8B,0x97,0x89,0x8D,0xA5,0xA3,0x99,0x9F,0xF9,0xA1,0xAB,0xB9,0xB1,0xBF, +0xE2,0xC5,0xC7,0xCB,0xCF,0xD1,0xCD,0x64,0xED,0xBD,0xDF,0xEB,0xE9,0xFB,0xFD,0x52 +}; + +uint16 to_uni_latin7_general_cs[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 +}; + +#endif + +#ifdef HAVE_CHARSET_macce +uchar ctype_macce_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x02,0x02,0x01,0x02,0x02,0x01, +0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02, +0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x01, +0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01, +0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x02,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x01,0x00,0x00,0x02,0x01, +0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x01, +0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00 +}; + +uchar to_lower_macce_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x8A,0x82,0x82,0x8E,0x88,0x9A,0x9F,0x87,0x88,0x8B,0x8A,0x8B,0x8D,0x8D,0x8E,0x90, +0x90,0x93,0x92,0x93,0x95,0x95,0x98,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9E,0x9E,0x9F, +0xA0,0xA1,0xAB,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xB0, +0xB0,0xB4,0xB2,0xB3,0xB4,0xFA,0xB6,0xB7,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE,0xC0, +0xC0,0xC4,0xC2,0xC3,0xC4,0xCB,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCE,0x9B,0xCE,0xD8, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xDA,0xDA,0xDE,0xDC,0xDD,0xDE,0xE0, +0xE0,0xE4,0xE2,0xE3,0xE4,0xE6,0xE6,0x87,0xE9,0xE9,0x92,0xEC,0xEC,0xF0,0x97,0x99, +0xF0,0xF3,0x9C,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFA,0xFD,0xB8,0xFD,0xAE,0xFF +}; + +uchar to_upper_macce_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x81,0x83,0x84,0x85,0x86,0xE7,0x84,0x89,0x80,0x89,0x8C,0x8C,0x83,0x8F, +0x8F,0x91,0xEA,0x91,0x94,0x94,0x96,0xEE,0x96,0xEF,0x85,0xCD,0xF2,0x9D,0x9D,0x86, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xA2,0xAC,0xAD,0xFE,0xAF, +0xAF,0xB1,0xB2,0xB3,0xB1,0xB5,0xB6,0xB7,0xFC,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF, +0xBF,0xC1,0xC2,0xC3,0xC1,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xC5,0xCC,0xCD,0xCC,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xCF,0xD9,0xD9,0xDB,0xDC,0xDD,0xDB,0xDF, +0xDF,0xE1,0xE2,0xE3,0xE1,0xE5,0xE5,0xE7,0xE8,0xE8,0xEA,0xEB,0xEB,0xED,0xEE,0xEF, +0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF +}; + +uint16 to_uni_macce_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C4,0x0100,0x0101,0x00C9,0x0104,0x00D6,0x00DC,0x00E1, +0x0105,0x010C,0x00E4,0x010D,0x0106,0x0107,0x00E9,0x0179, +0x017A,0x010E,0x00ED,0x010F,0x0112,0x0113,0x0116,0x00F3, +0x0117,0x00F4,0x00F6,0x00F5,0x00FA,0x011A,0x011B,0x00FC, +0x2020,0x00B0,0x0118,0x00A3,0x00A7,0x2022,0x00B6,0x00DF, +0x00AE,0x00A9,0x2122,0x0119,0x00A8,0x2260,0x0123,0x012E, +0x012F,0x012A,0x2264,0x2265,0x012B,0x0136,0x2202,0x2211, +0x0142,0x013B,0x013C,0x013D,0x013E,0x0139,0x013A,0x0145, +0x0146,0x0143,0x00AC,0x221A,0x0144,0x0147,0x2206,0x00AB, +0x00BB,0x2026,0x00A0,0x0148,0x0150,0x00D5,0x0151,0x014C, +0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA, +0x014D,0x0154,0x0155,0x0158,0x2039,0x203A,0x0159,0x0156, +0x0157,0x0160,0x201A,0x201E,0x0161,0x015A,0x015B,0x00C1, +0x0164,0x0165,0x00CD,0x017D,0x017E,0x016A,0x00D3,0x00D4, +0x016B,0x016E,0x00DA,0x016F,0x0170,0x0171,0x0172,0x0173, +0x00DD,0x00FD,0x0137,0x017B,0x0141,0x017C,0x0122,0x02C7 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1250 +uchar ctype_cp1250_croatian_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, +0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_cp1250_croatian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1250_croatian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_cp1250_croatian_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59, +0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x90,0x91,0x92,0x93,0x94, +0x95,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59, +0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x96,0x97,0x98,0x99,0x9A, +0x9B,0x9C,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x60,0xA6,0x5F,0x62,0x6C,0x6B, +0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0x60,0xB1,0x5F,0x62,0x6C,0x6B, +0xB2,0xB3,0xB4,0x54,0xB5,0x41,0xB6,0xB7,0xB8,0xB9,0x5F,0xBA,0xBB,0xBC,0xBD,0x6B, +0xBE,0xBF,0xC0,0x54,0xC1,0xC2,0xC3,0xC4,0xC5,0x41,0x5F,0xC6,0x54,0xC7,0x54,0x6B, +0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48, +0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xC8,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0x5F, +0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48, +0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF +}; + +uint16 to_uni_cp1250_croatian_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, +0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, +0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, +0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_latin1 +uchar ctype_latin1_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin1_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin1_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin1_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x51,0x53,0x57,0x5B,0x65,0x67,0x69,0x6B,0x75,0x77,0x79,0x7B,0x7D,0x81, +0x8F,0x91,0x93,0x95,0x98,0x9A,0xA4,0xA6,0xA8,0xAA,0xAF,0xB3,0xB4,0xB5,0xB6,0xB7, +0xB8,0x41,0x51,0x53,0x57,0x5B,0x65,0x67,0x69,0x6B,0x75,0x77,0x79,0x7B,0x7D,0x81, +0x8F,0x91,0x93,0x95,0x98,0x9A,0xA4,0xA6,0xA8,0xAA,0xAF,0xB9,0xBA,0xBB,0xBC,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x55,0x5D,0x5F,0x61,0x63,0x6D,0x6F,0x71,0x73, +0x59,0x7F,0x83,0x85,0x87,0x89,0x8B,0xBD,0x8D,0x9C,0x9E,0xA0,0xA2,0xAC,0xB1,0x97, +0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x55,0x5D,0x5F,0x61,0x63,0x6D,0x6F,0x71,0x73, +0x59,0x7F,0x83,0x85,0x87,0x89,0x8B,0xBE,0x8D,0x9C,0x9E,0xA0,0xA2,0xAC,0xB1,0xAE +}; + +uint16 to_uni_latin1_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F, +0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_latin1 +uchar ctype_latin1_general_cs[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin1_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin1_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin1_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x51,0x53,0x57,0x5B,0x65,0x67,0x69,0x6B,0x75,0x77,0x79,0x7B,0x7D,0x81, +0x8F,0x91,0x93,0x95,0x98,0x9A,0xA4,0xA6,0xA8,0xAA,0xAF,0xB3,0xB4,0xB5,0xB6,0xB7, +0xB8,0x42,0x52,0x54,0x58,0x5C,0x66,0x68,0x6A,0x6C,0x76,0x78,0x7A,0x7C,0x7E,0x82, +0x90,0x92,0x94,0x96,0x99,0x9B,0xA5,0xA7,0xA9,0xAB,0xB0,0xB9,0xBA,0xBB,0xBC,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x55,0x5D,0x5F,0x61,0x63,0x6D,0x6F,0x71,0x73, +0x59,0x7F,0x83,0x85,0x87,0x89,0x8B,0xBD,0x8D,0x9C,0x9E,0xA0,0xA2,0xAC,0xB1,0x97, +0x44,0x46,0x48,0x4A,0x4C,0x4E,0x50,0x56,0x5E,0x60,0x62,0x64,0x6E,0x70,0x72,0x74, +0x5A,0x80,0x84,0x86,0x88,0x8A,0x8C,0xBE,0x8E,0x9D,0x9F,0xA1,0xA3,0xAD,0xB2,0xAE +}; + +uint16 to_uni_latin1_general_cs[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F, +0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_cp1251 +uchar ctype_cp1251_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, +0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, +0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_cp1251_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1251_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, +0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uint16 to_uni_cp1251_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, +0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, +0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, +0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, +0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, +0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F +}; + +#endif + +#ifdef HAVE_CHARSET_cp1251 +uchar ctype_cp1251_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, +0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, +0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_cp1251_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1251_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, +0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar sort_order_cp1251_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D, +0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xD3,0xD4,0xD5,0xD6,0xD7, +0xD8,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D, +0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xD9,0xDA,0xDB,0xDC,0xDD, +0x81,0x83,0xDE,0x83,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xA1,0xE5,0xA7,0x9D,0xB3,0xC1, +0x81,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xA1,0xEF,0xA7,0x9D,0xB3,0xC1, +0xF0,0xB7,0xB7,0x99,0xF1,0x7D,0xF2,0xF3,0x87,0xF4,0x89,0xF5,0xF6,0xF7,0xF8,0x95, +0xF9,0xFA,0x93,0x93,0x7D,0xFB,0xFC,0xFD,0x87,0xFE,0x89,0xFF,0x99,0x8F,0x8F,0x95, +0x75,0x77,0x79,0x7B,0x7F,0x85,0x8B,0x8D,0x91,0x97,0x9B,0x9F,0xA3,0xA5,0xA9,0xAB, +0xAD,0xAF,0xB1,0xB5,0xB9,0xBB,0xBD,0xBF,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1, +0x75,0x77,0x79,0x7B,0x7F,0x85,0x8B,0x8D,0x91,0x97,0x9B,0x9F,0xA3,0xA5,0xA9,0xAB, +0xAD,0xAF,0xB1,0xB5,0xB9,0xBB,0xBD,0xBF,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1 +}; + +uint16 to_uni_cp1251_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, +0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, +0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, +0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, +0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, +0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F +}; + +#endif + +#ifdef HAVE_CHARSET_cp1251 +uchar ctype_cp1251_general_cs[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01, +0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02, +0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_cp1251_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA2,0xA2,0xBC,0xA4,0xB4,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB3,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1251_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F, +0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar sort_order_cp1251_general_cs[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D, +0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xD3,0xD4,0xD5,0xD6,0xD7, +0xD8,0x42,0x44,0x46,0x48,0x4A,0x4C,0x4E,0x50,0x52,0x54,0x56,0x58,0x5A,0x5C,0x5E, +0x60,0x62,0x64,0x66,0x68,0x6A,0x6C,0x6E,0x70,0x72,0x74,0xD9,0xDA,0xDB,0xDC,0xDD, +0x81,0x83,0xDE,0x84,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xA1,0xE5,0xA7,0x9D,0xB3,0xC1, +0x82,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xA2,0xEF,0xA8,0x9E,0xB4,0xC2, +0xF0,0xB7,0xB8,0x99,0xF1,0x7D,0xF2,0xF3,0x87,0xF4,0x89,0xF5,0xF6,0xF7,0xF8,0x95, +0xF9,0xFA,0x93,0x94,0x7E,0xFB,0xFC,0xFD,0x88,0xFE,0x8A,0xFF,0x9A,0x8F,0x90,0x96, +0x75,0x77,0x79,0x7B,0x7F,0x85,0x8B,0x8D,0x91,0x97,0x9B,0x9F,0xA3,0xA5,0xA9,0xAB, +0xAD,0xAF,0xB1,0xB5,0xB9,0xBB,0xBD,0xBF,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1, +0x76,0x78,0x7A,0x7C,0x80,0x86,0x8C,0x8E,0x92,0x98,0x9C,0xA0,0xA4,0xA6,0xAA,0xAC, +0xAE,0xB0,0xB2,0xB6,0xBA,0xBC,0xBE,0xC0,0xC4,0xC6,0xC8,0xCA,0xCC,0xCE,0xD0,0xD2 +}; + +uint16 to_uni_cp1251_general_cs[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, +0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, +0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, +0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, +0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, +0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F +}; + +#endif + +#ifdef HAVE_CHARSET_macroman +uchar ctype_macroman_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x10, +0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, +0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_macroman_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x8A,0x8C,0x8D,0x8E,0x96,0x9A,0x9F,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xBE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0x88,0x8B,0x9B,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD8,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0x89,0x90,0x87,0x91,0x8F,0x92,0x94,0x95,0x93,0x97,0x99, +0xF0,0x98,0x9C,0x9E,0x9D,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_macroman_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0xE7,0xCB,0xE5,0x80,0xCC,0x81,0x82,0x83,0xE9, +0xE6,0xE8,0xEA,0xED,0xEB,0xEC,0x84,0xEE,0xF1,0xEF,0x85,0xCD,0xF2,0xF4,0xF3,0x86, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xAE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD9,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_macroman_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1, +0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8, +0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3, +0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC, +0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF, +0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8, +0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211, +0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8, +0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB, +0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153, +0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA, +0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02, +0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1, +0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4, +0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC, +0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1256 +uchar ctype_cp1256_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x00,0x00, +0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x00, +0x03,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, +0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x00,0x00, +0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10, +0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x02,0x03,0x02,0x03,0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02, +0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00 +}; + +uchar to_lower_cp1256_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x9C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1256_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5F,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7F,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_cp1256_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x45,0x47,0x4A,0x4C,0x52,0x55,0x57,0x59,0x5D,0x5F,0x61,0x63,0x65,0x67, +0x6C,0x6E,0x70,0x72,0x74,0x76,0x7B,0x7D,0x7F,0x81,0x83,0xB9,0xBA,0xBB,0xBC,0xBD, +0xBE,0x41,0x45,0x47,0x4A,0x4C,0x52,0x55,0x57,0x59,0x5D,0x5F,0x61,0x63,0x65,0x67, +0x6C,0x6E,0x70,0x72,0x74,0x76,0x7B,0x7D,0x7F,0x81,0x83,0xBF,0xC0,0xC1,0xC2,0xC3, +0xC4,0x8E,0xC5,0x54,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0x6A,0x92,0x99,0xCE, +0xA5,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0x6A,0xDA,0xDB,0xDC, +0xDD,0xB6,0xDE,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB, +0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xB7,0xF6,0xF7,0xF8,0xF9,0xB8, +0xFA,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x9F,0x90,0x91,0x93,0x94,0x95, +0x96,0x97,0x98,0x9A,0x9B,0x9C,0x9D,0xFB,0x9E,0x9F,0xA0,0xA1,0xAD,0xA2,0xA3,0xA4, +0x43,0xA6,0x44,0xA7,0xA8,0xA9,0xAA,0x49,0x4E,0x4F,0x50,0x51,0xAB,0xAC,0x5B,0x5C, +0xAE,0xAF,0xB0,0xB1,0x69,0xB2,0xB3,0xFC,0xB4,0x78,0xB5,0x79,0x7A,0xFD,0xFE,0xFF +}; + +uint16 to_uni_cp1256_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x067E,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0000,0x2039,0x0152,0x0686,0x0698,0x0000, +0x06AF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0000,0x203A,0x0153,0x200C,0x200D,0x0000, +0x00A0,0x060C,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x061B,0x00BB,0x00BC,0x00BD,0x00BE,0x061F, +0x0000,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627, +0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F, +0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x00D7, +0x0637,0x0638,0x0639,0x063A,0x0640,0x0641,0x0642,0x0643, +0x00E0,0x0644,0x00E2,0x0645,0x0646,0x0647,0x0648,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x0649,0x064A,0x00EE,0x00EF, +0x064B,0x064C,0x064D,0x064E,0x00F4,0x064F,0x0650,0x00F7, +0x0651,0x00F9,0x0652,0x00FB,0x00FC,0x200E,0x200F,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1257 +uchar ctype_cp1257_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 +}; + +uchar to_lower_cp1257_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1257_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uint16 to_uni_cp1257_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000, +0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1257 +uchar ctype_cp1257_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 +}; + +uchar to_lower_cp1257_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1257_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_cp1257_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x4D,0x4F,0x55,0x57,0x61,0x63,0x67,0x69,0x6F,0x71,0x75,0x7B,0x7D,0x83, +0x8F,0x91,0x93,0x97,0x9E,0xA0,0xA8,0xAA,0xAC,0xAE,0xB0,0xB8,0xB9,0xBA,0xBB,0xBC, +0xBD,0x41,0x4D,0x4F,0x55,0x57,0x61,0x63,0x67,0x69,0x6F,0x71,0x75,0x7B,0x7D,0x83, +0x8F,0x91,0x93,0x97,0x9E,0xA0,0xA8,0xAA,0xAC,0xAE,0xB0,0xBE,0xBF,0xC0,0xC1,0xC4, +0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4, +0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4, +0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0x83,0xED,0x93,0xEE,0xEF,0xF0,0xF1,0x41, +0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0x83,0xFA,0x93,0xFB,0xFC,0xFD,0xFE,0x41, +0x41,0x69,0x41,0x4F,0x41,0x41,0x57,0x57,0x4F,0x57,0xB0,0x57,0x63,0x71,0x69,0x75, +0x97,0x7D,0x7D,0x83,0x83,0x83,0x83,0xC2,0xA0,0x75,0x97,0xA0,0xA0,0xB0,0xB0,0x97, +0x41,0x69,0x41,0x4F,0x41,0x41,0x57,0x57,0x4F,0x57,0xB0,0x57,0x63,0x71,0x69,0x75, +0x97,0x7D,0x7D,0x83,0x83,0x83,0x83,0xC3,0xA0,0x75,0x97,0xA0,0xA0,0xB0,0xB0,0xFF +}; + +uint16 to_uni_cp1257_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000, +0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_armscii8 +uchar ctype_armscii8_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10 +}; + +uchar to_lower_armscii8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB3,0xB3,0xB5,0xB5,0xB7,0xB7,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF,0xBF, +0xC1,0xC1,0xC3,0xC3,0xC5,0xC5,0xC7,0xC7,0xC9,0xC9,0xCB,0xCB,0xCD,0xCD,0xCF,0xCF, +0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xD9,0xD9,0xDB,0xDB,0xDD,0xDD,0xDF,0xDF, +0xE1,0xE1,0xE3,0xE3,0xE5,0xE5,0xE7,0xE7,0xE9,0xE9,0xEB,0xEB,0xED,0xED,0xEF,0xEF, +0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFB,0xFB,0xFD,0xFD,0xFE,0xFF +}; + +uchar to_upper_armscii8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB2,0xB4,0xB4,0xB6,0xB6,0xB8,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE, +0xC0,0xC0,0xC2,0xC2,0xC4,0xC4,0xC6,0xC6,0xC8,0xC8,0xCA,0xCA,0xCC,0xCC,0xCE,0xCE, +0xD0,0xD0,0xD2,0xD2,0xD4,0xD4,0xD6,0xD6,0xD8,0xD8,0xDA,0xDA,0xDC,0xDC,0xDE,0xDE, +0xE0,0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE, +0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF +}; + +uint16 to_uni_armscii8_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x2741,0x00A7,0x0589,0x0029,0x0028,0x00BB,0x00AB, +0x2014,0x002E,0x055D,0x002C,0x002D,0x055F,0x2026,0x055C, +0x055B,0x055E,0x0531,0x0561,0x0532,0x0562,0x0533,0x0563, +0x0534,0x0564,0x0535,0x0565,0x0536,0x0566,0x0537,0x0567, +0x0538,0x0568,0x0539,0x0569,0x053A,0x056A,0x053B,0x056B, +0x053C,0x056C,0x053D,0x056D,0x053E,0x056E,0x053F,0x056F, +0x0540,0x0570,0x0541,0x0571,0x0542,0x0572,0x0543,0x0573, +0x0544,0x0574,0x0545,0x0575,0x0546,0x0576,0x0547,0x0577, +0x0548,0x0578,0x0549,0x0579,0x054A,0x057A,0x054B,0x057B, +0x054C,0x057C,0x054D,0x057D,0x054E,0x057E,0x054F,0x057F, +0x0550,0x0580,0x0551,0x0581,0x0552,0x0582,0x0553,0x0583, +0x0554,0x0584,0x0555,0x0585,0x0556,0x0586,0x2019,0x0027 +}; + +#endif + +#ifdef HAVE_CHARSET_ascii +uchar ctype_ascii_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_ascii_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_ascii_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_ascii_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1250 +uchar ctype_cp1250_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, +0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_cp1250_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1250_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uint16 to_uni_cp1250_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, +0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, +0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, +0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_cp1256 +uchar ctype_cp1256_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x00,0x00, +0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x00, +0x03,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, +0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x00,0x00, +0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10, +0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x02,0x03,0x02,0x03,0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02, +0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00 +}; + +uchar to_lower_cp1256_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x9C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1256_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5F,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7F,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_cp1256_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x067E,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0000,0x2039,0x0152,0x0686,0x0698,0x0000, +0x06AF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0000,0x203A,0x0153,0x200C,0x200D,0x0000, +0x00A0,0x060C,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x061B,0x00BB,0x00BC,0x00BD,0x00BE,0x061F, +0x0000,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627, +0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F, +0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x00D7, +0x0637,0x0638,0x0639,0x063A,0x0640,0x0641,0x0642,0x0643, +0x00E0,0x0644,0x00E2,0x0645,0x0646,0x0647,0x0648,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x0649,0x064A,0x00EE,0x00EF, +0x064B,0x064C,0x064D,0x064E,0x00F4,0x064F,0x0650,0x00F7, +0x0651,0x00F9,0x0652,0x00FB,0x00FC,0x200E,0x200F,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_cp866 +uchar ctype_cp866_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 +}; + +uchar to_lower_cp866_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp866_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_cp866_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, +0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, +0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, +0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, +0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, +0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556, +0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567, +0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B, +0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580, +0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, +0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F, +0x0401,0x0451,0x0404,0x0454,0x0407,0x0457,0x040E,0x045E, +0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_dec8 +uchar ctype_dec8_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_dec8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_dec8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uint16 to_uni_dec8_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x00A1,0x00A2,0x00A3,0x0000,0x00A5,0x0000,0x00A7, +0x00A4,0x00A9,0x00AA,0x00AB,0x0000,0x0000,0x0000,0x0000, +0x00B0,0x00B1,0x00B2,0x00B3,0x0000,0x00B5,0x00B6,0x00B7, +0x0000,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x0000,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x0000,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x0152, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0178,0x0000,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x0000,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x0153, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FF,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_greek +uchar ctype_greek_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x00,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x01,0x01,0x10,0x01,0x10,0x01,0x01, +0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 +}; + +uchar to_lower_greek_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xDC,0xB7,0xDD,0xDE,0xDF,0xBB,0xFC,0xBD,0xFD,0xFE, +0xC0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xD2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_greek_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xDA,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xC1,0xC5,0xC7,0xC9, +0xDB,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xCF,0xD5,0xD9,0xFF +}; + +uint16 to_uni_greek_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x02BD,0x02BC,0x00A3,0x0000,0x0000,0x00A6,0x00A7, +0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x0000,0x2015, +0x00B0,0x00B1,0x00B2,0x00B3,0x0384,0x0385,0x0386,0x00B7, +0x0388,0x0389,0x038A,0x00BB,0x038C,0x00BD,0x038E,0x038F, +0x0390,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, +0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, +0x03A0,0x03A1,0x0000,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, +0x03A8,0x03A9,0x03AA,0x03AB,0x03AC,0x03AD,0x03AE,0x03AF, +0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7, +0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF, +0x03C0,0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7, +0x03C8,0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_hebrew +uchar ctype_hebrew_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x20,0x20,0x00 +}; + +uchar to_lower_hebrew_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_hebrew_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_hebrew_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x203E, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2017, +0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7, +0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF, +0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7, +0x05E8,0x05E9,0x05EA,0x0000,0x0000,0x200E,0x200F,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_hp8 +uchar ctype_hp8_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x02, +0x01,0x10,0x10,0x01,0x02,0x10,0x10,0x02,0x01,0x10,0x01,0x01,0x01,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 +}; + +uchar to_lower_hp8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xC8,0xC0,0xC9,0xC1,0xCD,0xD1,0xDD,0xA8,0xA9,0xAA,0xAB,0xAC,0xCB,0xC3,0xAF, +0xB0,0xB2,0xB2,0xB3,0xB5,0xB5,0xB7,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD4,0xD1,0xD6,0xD7,0xD4,0xD5,0xD6,0xD7,0xCC,0xD9,0xCE,0xCF,0xC5,0xDD,0xDE,0xC2, +0xC4,0xE2,0xE2,0xE4,0xE4,0xD5,0xD9,0xC6,0xCA,0xEA,0xEA,0xEC,0xEC,0xC7,0xEF,0xEF, +0xF1,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_hp8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB1,0xB3,0xB4,0xB4,0xB6,0xB6,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xA2,0xA4,0xDF,0xAE,0xE0,0xDC,0xE7,0xED,0xA1,0xA3,0xE8,0xAD,0xD8,0xA5,0xDA,0xDB, +0xD0,0xA6,0xD2,0xD3,0xD0,0xE5,0xD2,0xD3,0xD8,0xE6,0xDA,0xDB,0xDC,0xA7,0xDE,0xDF, +0xE0,0xE1,0xE1,0xE3,0xE3,0xE5,0xE6,0xE7,0xE8,0xE9,0xE9,0xEB,0xEB,0xED,0xEE,0xEE, +0xF0,0xF0,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_hp8_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x00C0,0x00C2,0x00C8,0x00CA,0x00CB,0x00CE,0x00CF, +0x00B4,0x02CB,0x02C6,0x00A8,0x02DC,0x00D9,0x00DB,0x20A4, +0x00AF,0x00DD,0x00FD,0x00B0,0x00C7,0x00E7,0x00D1,0x00F1, +0x00A1,0x00BF,0x00A4,0x00A3,0x00A5,0x00A7,0x0192,0x00A2, +0x00E2,0x00EA,0x00F4,0x00FB,0x00E1,0x00E9,0x00F3,0x00FA, +0x00E0,0x00E8,0x00F2,0x00F9,0x00E4,0x00EB,0x00F6,0x00FC, +0x00C5,0x00EE,0x00D8,0x00C6,0x00E5,0x00ED,0x00F8,0x00E6, +0x00C4,0x00EC,0x00D6,0x00DC,0x00C9,0x00EF,0x00DF,0x00D4, +0x00C1,0x00C3,0x00E3,0x00D0,0x00F0,0x00CD,0x00CC,0x00D3, +0x00D2,0x00D5,0x00F5,0x0160,0x0161,0x00DA,0x0178,0x00FF, +0x00DE,0x00FE,0x00B7,0x00B5,0x00B6,0x00BE,0x2014,0x00BC, +0x00BD,0x00AA,0x00BA,0x00AB,0x25A0,0x00BB,0x00B1,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_keybcs2 +uchar ctype_keybcs2_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x02,0x82,0x02,0x02,0x01,0x01,0x02,0x82,0x81,0x01,0x01,0x02,0x02,0x01,0x01, +0x81,0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x01,0x02,0x00,0x02,0x02,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 +}; + +uchar to_lower_keybcs2_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x81,0x82,0x83,0x84,0x83,0x86,0x87,0x88,0x88,0x8D,0xA1,0x8C,0x8D,0x84,0xA0, +0x82,0x91,0x91,0x93,0x94,0xA2,0x96,0xA3,0x98,0x94,0x81,0x9B,0x8C,0x98,0xA9,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0x96,0x93,0x9B,0xA9,0xAA,0xAA,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xED,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_keybcs2_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x68,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x9A,0x90,0x85,0x8E,0x85,0x86,0x80,0x89,0x89,0x8A,0x8B,0x9C,0x8A,0x8E,0x8F, +0x90,0x92,0x92,0xA7,0x99,0x95,0xA6,0x97,0x9D,0x99,0x9A,0xA8,0x9C,0x9D,0x9E,0x9F, +0x8F,0x8B,0x95,0x97,0xA5,0xA5,0xA6,0xA7,0xA8,0x9E,0xAB,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xE8,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_keybcs2_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x010C,0x00FC,0x00E9,0x010F,0x00E4,0x010E,0x0164,0x010D, +0x011B,0x011A,0x0139,0x00CD,0x013E,0x013A,0x00C4,0x00C1, +0x00C9,0x017E,0x017D,0x00F4,0x00F6,0x00D3,0x016F,0x00DA, +0x00FD,0x00D6,0x00DC,0x0160,0x013D,0x00DD,0x0158,0x0165, +0x00E1,0x00ED,0x00F3,0x00FA,0x0148,0x0147,0x016E,0x00D4, +0x0161,0x0159,0x0155,0x0154,0x00BC,0x00A1,0x00AB,0x00BB, +0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556, +0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567, +0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B, +0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580, +0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4, +0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229, +0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248, +0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_koi8r +uchar ctype_koi8r_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 +}; + +uchar to_lower_koi8r_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar to_upper_koi8r_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xB3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_koi8r_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, +0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, +0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248, +0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, +0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556, +0x2557,0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E, +0x255F,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565, +0x2566,0x2567,0x2568,0x2569,0x256A,0x256B,0x256C,0x00A9, +0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, +0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, +0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, +0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, +0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, +0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A +}; + +#endif + +#ifdef HAVE_CHARSET_koi8u +uchar ctype_koi8u_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x02,0x02,0x10,0x02,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10, +0x10,0x10,0x10,0x01,0x01,0x10,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 +}; + +uchar to_lower_koi8u_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x20,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20, +0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF +}; + +uchar to_upper_koi8u_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20, +0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_koi8u_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, +0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, +0x2591,0x2592,0x2593,0x2320,0x25A0,0x2022,0x221A,0x2248, +0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, +0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457, +0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E, +0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407, +0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9, +0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, +0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, +0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, +0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, +0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, +0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A +}; + +#endif + +#ifdef HAVE_CHARSET_latin2 +uchar ctype_latin2_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01, +0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin2_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin2_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uint16 to_uni_latin2_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, +0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, +0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, +0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +#ifdef HAVE_CHARSET_latin5 +uchar ctype_latin5_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin5_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0xFD,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0x69,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin5_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0xDD,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF +}; + +uint16 to_uni_latin5_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_latin7 +uchar ctype_latin7_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20, +0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_latin7_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin7_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uint16 to_uni_latin7_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7, +0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, +0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7, +0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, +0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, +0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, +0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, +0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, +0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, +0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, +0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, +0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019 +}; + +#endif + +#ifdef HAVE_CHARSET_cp850 +uchar ctype_cp850_bin[] = { +0x00, +0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30, +0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x30, +0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01, +0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x10,0x01,0x10,0x10, +0x02,0x02,0x02,0x02,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10, +0x01,0x02,0x01,0x01,0x02,0x01,0x10,0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 +}; + +uchar to_lower_cp850_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x84,0x86, +0x82,0x91,0x91,0x93,0x94,0x95,0x96,0x97,0x98,0x94,0x81,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp850_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F, +0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_cp850_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7, +0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5, +0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9, +0x00FF,0x00D6,0x00DC,0x00F8,0x00A3,0x00D8,0x00D7,0x0192, +0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA, +0x00BF,0x00AE,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB, +0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x00C0, +0x00A9,0x2563,0x2551,0x2557,0x255D,0x00A2,0x00A5,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x00E3,0x00C3, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4, +0x00F0,0x00D0,0x00CA,0x00CB,0x00C8,0x0131,0x00CD,0x00CE, +0x00CF,0x2518,0x250C,0x2588,0x2584,0x00A6,0x00CC,0x2580, +0x00D3,0x00DF,0x00D4,0x00D2,0x00F5,0x00D5,0x00B5,0x00FE, +0x00DE,0x00DA,0x00DB,0x00D9,0x00FD,0x00DD,0x00AF,0x00B4, +0x00AD,0x00B1,0x2017,0x00BE,0x00B6,0x00A7,0x00F7,0x00B8, +0x00B0,0x00A8,0x00B7,0x00B9,0x00B3,0x00B2,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_cp852 +uchar ctype_cp852_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00, +0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,0x01,0x01,0x01, +0x01,0x01,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x02,0x01,0x00,0x02, +0x02,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x02,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x01,0x00, +0x01,0x02,0x01,0x01,0x02,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48 +}; + +uchar to_lower_cp852_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8B,0x8B,0x8C,0xAB,0x84,0x86, +0x82,0x92,0x92,0x93,0x94,0x96,0x96,0x98,0x98,0x94,0x81,0x9C,0x9C,0x88,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAA,0xAB,0x9F,0xB8,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xA0,0x83,0xD8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD0,0xD4,0x89,0xD4,0xE5,0xA1,0x8C,0xD8,0xD9,0xDA,0xDB,0xDC,0xEE,0x85,0xDF, +0xA2,0xE1,0x93,0xE4,0xE4,0xE5,0xE7,0xE7,0xEA,0xA3,0xE8,0xFB,0xEC,0xEC,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp852_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F, +0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0xAC, +0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xAD,0xB9,0xBA,0xBB,0xBC,0xBE,0xBD,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF +}; + +uint16 to_uni_cp852_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x016F,0x0107,0x00E7, +0x0142,0x00EB,0x0150,0x0151,0x00EE,0x0179,0x00C4,0x0106, +0x00C9,0x0139,0x013A,0x00F4,0x00F6,0x013D,0x013E,0x015A, +0x015B,0x00D6,0x00DC,0x0164,0x0165,0x0141,0x00D7,0x010D, +0x00E1,0x00ED,0x00F3,0x00FA,0x0104,0x0105,0x017D,0x017E, +0x0118,0x0119,0x00AC,0x017A,0x010C,0x015F,0x00AB,0x00BB, +0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x011A, +0x015E,0x2563,0x2551,0x2557,0x255D,0x017B,0x017C,0x2510, +0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x0102,0x0103, +0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4, +0x0111,0x0110,0x010E,0x00CB,0x010F,0x0147,0x00CD,0x00CE, +0x011B,0x2518,0x250C,0x2588,0x2584,0x0162,0x016E,0x2580, +0x00D3,0x00DF,0x00D4,0x0143,0x0144,0x0148,0x0160,0x0161, +0x0154,0x00DA,0x0155,0x0170,0x00FD,0x00DD,0x0163,0x00B4, +0x00AD,0x02DD,0x02DB,0x02C7,0x02D8,0x00A7,0x00F7,0x00B8, +0x00B0,0x00A8,0x02D9,0x0171,0x0158,0x0159,0x25A0,0x00A0 +}; + +#endif + +#ifdef HAVE_CHARSET_swe7 +uchar ctype_swe7_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10, +0x01,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x20, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_swe7_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_swe7_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_swe7_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x00C9,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x00C4,0x00D6,0x00C5,0x00DC,0x005F, +0x00E9,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x00E4,0x00F6,0x00E5,0x00FC,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_geostd8 +uchar ctype_geostd8_general_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, +0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_geostd8_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_geostd8_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar sort_order_geostd8_general_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_geostd8_general_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0000,0x2039,0x0000,0x0000,0x0000,0x0000, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x0000,0x0000,0x203A,0x0000,0x0000,0x0000,0x0000, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10F1, +0x10D7,0x10D8,0x10D9,0x10DA,0x10DB,0x10DC,0x10F2,0x10DD, +0x10DE,0x10DF,0x10E0,0x10E1,0x10E2,0x10F3,0x10E3,0x10E4, +0x10E5,0x10E6,0x10E7,0x10E8,0x10E9,0x10EA,0x10EB,0x10EC, +0x10ED,0x10EE,0x10F4,0x10EF,0x10F0,0x10F5,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x2116,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_geostd8 +uchar ctype_geostd8_bin[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x00,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x10,0x00,0x00,0x00,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00, +0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +uchar to_lower_geostd8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_geostd8_bin[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uint16 to_uni_geostd8_bin[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0000,0x2039,0x0000,0x0000,0x0000,0x0000, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x0000,0x0000,0x203A,0x0000,0x0000,0x0000,0x0000, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10F1, +0x10D7,0x10D8,0x10D9,0x10DA,0x10DB,0x10DC,0x10F2,0x10DD, +0x10DE,0x10DF,0x10E0,0x10E1,0x10E2,0x10F3,0x10E3,0x10E4, +0x10E5,0x10E6,0x10E7,0x10E8,0x10E9,0x10EA,0x10EB,0x10EC, +0x10ED,0x10EE,0x10F4,0x10EF,0x10F0,0x10F5,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x2116,0x0000,0x0000 +}; + +#endif + +#ifdef HAVE_CHARSET_latin1 +uchar ctype_latin1_spanish_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 +}; + +uchar to_lower_latin1_spanish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_latin1_spanish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_latin1_spanish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x51,0x53,0x57,0x5B,0x65,0x67,0x69,0x6B,0x75,0x77,0x79,0x7B,0x7D,0x81, +0x8F,0x91,0x93,0x95,0x98,0x9A,0xA4,0xA6,0xA8,0xAA,0xAF,0xB3,0xB4,0xB5,0xB6,0xB7, +0xB8,0x41,0x51,0x53,0x57,0x5B,0x65,0x67,0x69,0x6B,0x75,0x77,0x79,0x7B,0x7D,0x81, +0x8F,0x91,0x93,0x95,0x98,0x9A,0xA4,0xA6,0xA8,0xAA,0xAF,0xB9,0xBA,0xBB,0xBC,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x53,0x5B,0x5B,0x5B,0x5B,0x6B,0x6B,0x6B,0x6B, +0x57,0x7F,0x81,0x81,0x81,0x81,0x81,0xBD,0x81,0x9A,0x9A,0x9A,0x9A,0xAA,0xB1,0x97, +0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x53,0x5B,0x5B,0x5B,0x5B,0x6B,0x6B,0x6B,0x6B, +0x57,0x7F,0x81,0x81,0x81,0x81,0x81,0xBE,0x81,0x9A,0x9A,0x9A,0x9A,0xAA,0xB1,0xAA +}; + +uint16 to_uni_latin1_spanish_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F, +0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; + +#endif + +#ifdef HAVE_CHARSET_cp1250 +uchar ctype_cp1250_polish_ci[] = { +0x00, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, +0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, +0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10, +0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10, +0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20, +0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01, +0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02, +0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01, +0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 +}; + +uchar to_lower_cp1250_polish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, +0xA0,0xA1,0xA2,0xB3,0xA4,0xB9,0xA6,0xA7,0xA8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBE,0xBD,0xBE,0xBF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +uchar to_upper_cp1250_polish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF +}; + +uchar sort_order_cp1250_polish_ci[] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59, +0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x90,0x91,0x92,0x93,0x94, +0x95,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59, +0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x96,0x97,0x98,0x99,0x9A, +0x9B,0x9C,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x5F,0xA6,0x60,0x62,0x6B,0x6C, +0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0x5F,0xB1,0x60,0x62,0x6B,0x6C, +0xB2,0xB3,0xB4,0x55,0xB5,0x42,0xB6,0xB7,0xB8,0xB9,0x5F,0xBA,0xBB,0xBC,0xBD,0x6D, +0xBE,0xBF,0xC0,0x55,0xC1,0xC2,0xC3,0xC4,0xC5,0x42,0x5F,0xC6,0x54,0xC7,0x54,0x6D, +0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x44,0x4B,0x4C,0x4B,0x4B,0x50,0x50,0x48, +0x48,0x58,0x57,0x5A,0x59,0x59,0x59,0xC8,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0x5F, +0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x44,0x4B,0x4C,0x4B,0x4B,0x50,0x50,0x48, +0x48,0x58,0x57,0x5A,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF +}; + +uint16 to_uni_cp1250_polish_ci[] = { +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021, +0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, +0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, +0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, +0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, +0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + +#endif + +CHARSET_INFO compiled_charsets[] = { +#ifdef HAVE_CHARSET_dec8 +{ + 3,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "dec8", /* cset name */ + "dec8_swedish_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_dec8_swedish_ci, /* ctype */ + to_lower_dec8_swedish_ci, /* lower */ + to_upper_dec8_swedish_ci, /* upper */ + sort_order_dec8_swedish_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_dec8_swedish_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp850 +{ + 4,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp850", /* cset name */ + "cp850_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp850_general_ci, /* ctype */ + to_lower_cp850_general_ci, /* lower */ + to_upper_cp850_general_ci, /* upper */ + sort_order_cp850_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp850_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin1 +{ + 5,0,0, + MY_CS_COMPILED, + "latin1", /* cset name */ + "latin1_german1_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1_german1_ci, /* ctype */ + to_lower_latin1_german1_ci, /* lower */ + to_upper_latin1_german1_ci, /* upper */ + sort_order_latin1_german1_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin1_german1_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hp8 +{ + 6,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "hp8", /* cset name */ + "hp8_english_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_hp8_english_ci, /* ctype */ + to_lower_hp8_english_ci, /* lower */ + to_upper_hp8_english_ci, /* upper */ + sort_order_hp8_english_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_hp8_english_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8r +{ + 7,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "koi8r", /* cset name */ + "koi8r_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_koi8r_general_ci, /* ctype */ + to_lower_koi8r_general_ci, /* lower */ + to_upper_koi8r_general_ci, /* upper */ + sort_order_koi8r_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_koi8r_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin2 +{ + 9,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "latin2", /* cset name */ + "latin2_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin2_general_ci, /* ctype */ + to_lower_latin2_general_ci, /* lower */ + to_upper_latin2_general_ci, /* upper */ + sort_order_latin2_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin2_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_swe7 +{ + 10,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_NONASCII, + "swe7", /* cset name */ + "swe7_swedish_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_swe7_swedish_ci, /* ctype */ + to_lower_swe7_swedish_ci, /* lower */ + to_upper_swe7_swedish_ci, /* upper */ + sort_order_swe7_swedish_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_swe7_swedish_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_ascii +{ + 11,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_PUREASCII, + "ascii", /* cset name */ + "ascii_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ascii_general_ci, /* ctype */ + to_lower_ascii_general_ci, /* lower */ + to_upper_ascii_general_ci, /* upper */ + sort_order_ascii_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_ascii_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 14,0,0, + MY_CS_COMPILED, + "cp1251", /* cset name */ + "cp1251_bulgarian_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1251_bulgarian_ci, /* ctype */ + to_lower_cp1251_bulgarian_ci, /* lower */ + to_upper_cp1251_bulgarian_ci, /* upper */ + sort_order_cp1251_bulgarian_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1251_bulgarian_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin1 +{ + 15,0,0, + MY_CS_COMPILED, + "latin1", /* cset name */ + "latin1_danish_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1_danish_ci, /* ctype */ + to_lower_latin1_danish_ci, /* lower */ + to_upper_latin1_danish_ci, /* upper */ + sort_order_latin1_danish_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin1_danish_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hebrew +{ + 16,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "hebrew", /* cset name */ + "hebrew_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_hebrew_general_ci, /* ctype */ + to_lower_hebrew_general_ci, /* lower */ + to_upper_hebrew_general_ci, /* upper */ + sort_order_hebrew_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_hebrew_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin7 +{ + 20,0,0, + MY_CS_COMPILED|MY_CS_CSSORT, + "latin7", /* cset name */ + "latin7_estonian_cs", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin7_estonian_cs, /* ctype */ + to_lower_latin7_estonian_cs, /* lower */ + to_upper_latin7_estonian_cs, /* upper */ + sort_order_latin7_estonian_cs, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin7_estonian_cs, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin2 +{ + 21,0,0, + MY_CS_COMPILED, + "latin2", /* cset name */ + "latin2_hungarian_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin2_hungarian_ci, /* ctype */ + to_lower_latin2_hungarian_ci, /* lower */ + to_upper_latin2_hungarian_ci, /* upper */ + sort_order_latin2_hungarian_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin2_hungarian_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8u +{ + 22,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "koi8u", /* cset name */ + "koi8u_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_koi8u_general_ci, /* ctype */ + to_lower_koi8u_general_ci, /* lower */ + to_upper_koi8u_general_ci, /* upper */ + sort_order_koi8u_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_koi8u_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 23,0,0, + MY_CS_COMPILED, + "cp1251", /* cset name */ + "cp1251_ukrainian_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1251_ukrainian_ci, /* ctype */ + to_lower_cp1251_ukrainian_ci, /* lower */ + to_upper_cp1251_ukrainian_ci, /* upper */ + sort_order_cp1251_ukrainian_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1251_ukrainian_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_greek +{ + 25,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "greek", /* cset name */ + "greek_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_greek_general_ci, /* ctype */ + to_lower_greek_general_ci, /* lower */ + to_upper_greek_general_ci, /* upper */ + sort_order_greek_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_greek_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1250 +{ + 26,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp1250", /* cset name */ + "cp1250_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1250_general_ci, /* ctype */ + to_lower_cp1250_general_ci, /* lower */ + to_upper_cp1250_general_ci, /* upper */ + sort_order_cp1250_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1250_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin2 +{ + 27,0,0, + MY_CS_COMPILED, + "latin2", /* cset name */ + "latin2_croatian_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin2_croatian_ci, /* ctype */ + to_lower_latin2_croatian_ci, /* lower */ + to_upper_latin2_croatian_ci, /* upper */ + sort_order_latin2_croatian_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin2_croatian_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1257 +{ + 29,0,0, + MY_CS_COMPILED, + "cp1257", /* cset name */ + "cp1257_lithuanian_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1257_lithuanian_ci, /* ctype */ + to_lower_cp1257_lithuanian_ci, /* lower */ + to_upper_cp1257_lithuanian_ci, /* upper */ + sort_order_cp1257_lithuanian_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1257_lithuanian_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin5 +{ + 30,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "latin5", /* cset name */ + "latin5_turkish_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin5_turkish_ci, /* ctype */ + to_lower_latin5_turkish_ci, /* lower */ + to_upper_latin5_turkish_ci, /* upper */ + sort_order_latin5_turkish_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin5_turkish_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_armscii8 +{ + 32,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "armscii8", /* cset name */ + "armscii8_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_armscii8_general_ci, /* ctype */ + to_lower_armscii8_general_ci, /* lower */ + to_upper_armscii8_general_ci, /* upper */ + sort_order_armscii8_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_armscii8_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp866 +{ + 36,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp866", /* cset name */ + "cp866_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp866_general_ci, /* ctype */ + to_lower_cp866_general_ci, /* lower */ + to_upper_cp866_general_ci, /* upper */ + sort_order_cp866_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp866_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_keybcs2 +{ + 37,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "keybcs2", /* cset name */ + "keybcs2_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_keybcs2_general_ci, /* ctype */ + to_lower_keybcs2_general_ci, /* lower */ + to_upper_keybcs2_general_ci, /* upper */ + sort_order_keybcs2_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_keybcs2_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macce +{ + 38,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "macce", /* cset name */ + "macce_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_macce_general_ci, /* ctype */ + to_lower_macce_general_ci, /* lower */ + to_upper_macce_general_ci, /* upper */ + sort_order_macce_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_macce_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macroman +{ + 39,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "macroman", /* cset name */ + "macroman_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_macroman_general_ci, /* ctype */ + to_lower_macroman_general_ci, /* lower */ + to_upper_macroman_general_ci, /* upper */ + sort_order_macroman_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_macroman_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp852 +{ + 40,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp852", /* cset name */ + "cp852_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp852_general_ci, /* ctype */ + to_lower_cp852_general_ci, /* lower */ + to_upper_cp852_general_ci, /* upper */ + sort_order_cp852_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp852_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin7 +{ + 41,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "latin7", /* cset name */ + "latin7_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin7_general_ci, /* ctype */ + to_lower_latin7_general_ci, /* lower */ + to_upper_latin7_general_ci, /* upper */ + sort_order_latin7_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin7_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin7 +{ + 42,0,0, + MY_CS_COMPILED|MY_CS_CSSORT, + "latin7", /* cset name */ + "latin7_general_cs", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin7_general_cs, /* ctype */ + to_lower_latin7_general_cs, /* lower */ + to_upper_latin7_general_cs, /* upper */ + sort_order_latin7_general_cs, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin7_general_cs, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macce +{ + 43,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "macce", /* cset name */ + "macce_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_macce_bin, /* ctype */ + to_lower_macce_bin, /* lower */ + to_upper_macce_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_macce_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1250 +{ + 44,0,0, + MY_CS_COMPILED, + "cp1250", /* cset name */ + "cp1250_croatian_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1250_croatian_ci, /* ctype */ + to_lower_cp1250_croatian_ci, /* lower */ + to_upper_cp1250_croatian_ci, /* upper */ + sort_order_cp1250_croatian_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1250_croatian_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin1 +{ + 48,0,0, + MY_CS_COMPILED, + "latin1", /* cset name */ + "latin1_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1_general_ci, /* ctype */ + to_lower_latin1_general_ci, /* lower */ + to_upper_latin1_general_ci, /* upper */ + sort_order_latin1_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin1_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin1 +{ + 49,0,0, + MY_CS_COMPILED|MY_CS_CSSORT, + "latin1", /* cset name */ + "latin1_general_cs", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1_general_cs, /* ctype */ + to_lower_latin1_general_cs, /* lower */ + to_upper_latin1_general_cs, /* upper */ + sort_order_latin1_general_cs, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin1_general_cs, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 50,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp1251", /* cset name */ + "cp1251_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1251_bin, /* ctype */ + to_lower_cp1251_bin, /* lower */ + to_upper_cp1251_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1251_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 51,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp1251", /* cset name */ + "cp1251_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1251_general_ci, /* ctype */ + to_lower_cp1251_general_ci, /* lower */ + to_upper_cp1251_general_ci, /* upper */ + sort_order_cp1251_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1251_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1251 +{ + 52,0,0, + MY_CS_COMPILED|MY_CS_CSSORT, + "cp1251", /* cset name */ + "cp1251_general_cs", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1251_general_cs, /* ctype */ + to_lower_cp1251_general_cs, /* lower */ + to_upper_cp1251_general_cs, /* upper */ + sort_order_cp1251_general_cs, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1251_general_cs, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_macroman +{ + 53,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "macroman", /* cset name */ + "macroman_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_macroman_bin, /* ctype */ + to_lower_macroman_bin, /* lower */ + to_upper_macroman_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_macroman_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1256 +{ + 57,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp1256", /* cset name */ + "cp1256_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1256_general_ci, /* ctype */ + to_lower_cp1256_general_ci, /* lower */ + to_upper_cp1256_general_ci, /* upper */ + sort_order_cp1256_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1256_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1257 +{ + 58,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp1257", /* cset name */ + "cp1257_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1257_bin, /* ctype */ + to_lower_cp1257_bin, /* lower */ + to_upper_cp1257_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1257_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1257 +{ + 59,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "cp1257", /* cset name */ + "cp1257_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1257_general_ci, /* ctype */ + to_lower_cp1257_general_ci, /* lower */ + to_upper_cp1257_general_ci, /* upper */ + sort_order_cp1257_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1257_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_armscii8 +{ + 64,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "armscii8", /* cset name */ + "armscii8_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_armscii8_bin, /* ctype */ + to_lower_armscii8_bin, /* lower */ + to_upper_armscii8_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_armscii8_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_ascii +{ + 65,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PUREASCII, + "ascii", /* cset name */ + "ascii_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ascii_bin, /* ctype */ + to_lower_ascii_bin, /* lower */ + to_upper_ascii_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_ascii_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1250 +{ + 66,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp1250", /* cset name */ + "cp1250_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1250_bin, /* ctype */ + to_lower_cp1250_bin, /* lower */ + to_upper_cp1250_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1250_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1256 +{ + 67,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp1256", /* cset name */ + "cp1256_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1256_bin, /* ctype */ + to_lower_cp1256_bin, /* lower */ + to_upper_cp1256_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1256_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp866 +{ + 68,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp866", /* cset name */ + "cp866_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp866_bin, /* ctype */ + to_lower_cp866_bin, /* lower */ + to_upper_cp866_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp866_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_dec8 +{ + 69,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "dec8", /* cset name */ + "dec8_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_dec8_bin, /* ctype */ + to_lower_dec8_bin, /* lower */ + to_upper_dec8_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_dec8_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_greek +{ + 70,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "greek", /* cset name */ + "greek_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_greek_bin, /* ctype */ + to_lower_greek_bin, /* lower */ + to_upper_greek_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_greek_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hebrew +{ + 71,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "hebrew", /* cset name */ + "hebrew_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_hebrew_bin, /* ctype */ + to_lower_hebrew_bin, /* lower */ + to_upper_hebrew_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_hebrew_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_hp8 +{ + 72,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "hp8", /* cset name */ + "hp8_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_hp8_bin, /* ctype */ + to_lower_hp8_bin, /* lower */ + to_upper_hp8_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_hp8_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_keybcs2 +{ + 73,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "keybcs2", /* cset name */ + "keybcs2_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_keybcs2_bin, /* ctype */ + to_lower_keybcs2_bin, /* lower */ + to_upper_keybcs2_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_keybcs2_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8r +{ + 74,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "koi8r", /* cset name */ + "koi8r_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_koi8r_bin, /* ctype */ + to_lower_koi8r_bin, /* lower */ + to_upper_koi8r_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_koi8r_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_koi8u +{ + 75,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "koi8u", /* cset name */ + "koi8u_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_koi8u_bin, /* ctype */ + to_lower_koi8u_bin, /* lower */ + to_upper_koi8u_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_koi8u_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin2 +{ + 77,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "latin2", /* cset name */ + "latin2_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin2_bin, /* ctype */ + to_lower_latin2_bin, /* lower */ + to_upper_latin2_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin2_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin5 +{ + 78,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "latin5", /* cset name */ + "latin5_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin5_bin, /* ctype */ + to_lower_latin5_bin, /* lower */ + to_upper_latin5_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin5_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin7 +{ + 79,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "latin7", /* cset name */ + "latin7_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin7_bin, /* ctype */ + to_lower_latin7_bin, /* lower */ + to_upper_latin7_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin7_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp850 +{ + 80,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp850", /* cset name */ + "cp850_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp850_bin, /* ctype */ + to_lower_cp850_bin, /* lower */ + to_upper_cp850_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp850_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp852 +{ + 81,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "cp852", /* cset name */ + "cp852_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp852_bin, /* ctype */ + to_lower_cp852_bin, /* lower */ + to_upper_cp852_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp852_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_swe7 +{ + 82,0,0, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII, + "swe7", /* cset name */ + "swe7_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_swe7_bin, /* ctype */ + to_lower_swe7_bin, /* lower */ + to_upper_swe7_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_swe7_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_geostd8 +{ + 92,0,0, + MY_CS_COMPILED|MY_CS_PRIMARY, + "geostd8", /* cset name */ + "geostd8_general_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_geostd8_general_ci, /* ctype */ + to_lower_geostd8_general_ci, /* lower */ + to_upper_geostd8_general_ci, /* upper */ + sort_order_geostd8_general_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_geostd8_general_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_geostd8 +{ + 93,0,0, + MY_CS_COMPILED|MY_CS_BINSORT, + "geostd8", /* cset name */ + "geostd8_bin", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_geostd8_bin, /* ctype */ + to_lower_geostd8_bin, /* lower */ + to_upper_geostd8_bin, /* upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_geostd8_bin, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_bin_handler, +} +, +#endif +#ifdef HAVE_CHARSET_latin1 +{ + 94,0,0, + MY_CS_COMPILED, + "latin1", /* cset name */ + "latin1_spanish_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1_spanish_ci, /* ctype */ + to_lower_latin1_spanish_ci, /* lower */ + to_upper_latin1_spanish_ci, /* upper */ + sort_order_latin1_spanish_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_latin1_spanish_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +#ifdef HAVE_CHARSET_cp1250 +{ + 99,0,0, + MY_CS_COMPILED, + "cp1250", /* cset name */ + "cp1250_polish_ci", /* coll name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_cp1250_polish_ci, /* ctype */ + to_lower_cp1250_polish_ci, /* lower */ + to_upper_cp1250_polish_ci, /* upper */ + sort_order_cp1250_polish_ci, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + to_uni_cp1250_polish_ci, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +, +#endif +{ + 0,0,0, + MY_CS_COMPILED, + NULL, /* cset name */ + NULL, /* coll name */ + NULL, /* comment */ + NULL, /* tailoging */ + NULL, /* ctype */ + NULL, /* lower */ + NULL, /* upper */ + NULL, /* sort order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* to_uni */ + NULL, /* from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state map */ + NULL, /* ident map */ + 1, /* strxfrm_multiply*/ + 1, /* caseup_multiply*/ + 1, /* casedn_multiply*/ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad_char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_8bit_simple_ci_handler, +} +}; diff --git a/externals/mysql/strings/ctype-gb2312.c b/externals/mysql/strings/ctype-gb2312.c new file mode 100644 index 00000000000..1d2c96243af --- /dev/null +++ b/externals/mysql/strings/ctype-gb2312.c @@ -0,0 +1,5837 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is for Chinese EUC character sets (GB2312), and created by Miles Tsai (net-bull@126.com). + */ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. mbmaxlen_gb2312=2 + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_gb2312 + +static uchar NEAR ctype_gb2312[257] = +{ + 0, /* For standard library */ + 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 132,132,132,132,132,132,132,132,132,132,16,16,16,16,16,16, + 16,129,129,129,129,129,129,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,16,16,16,16,16, + 16,130,130,130,130,130,130,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,16,16,16,16,32, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0, +}; + +static uchar NEAR to_lower_gb2312[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR to_upper_gb2312[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR sort_order_gb2312[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '\\', ']', '[', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', 0x7E, '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +/* Support for Chinese(GB2312) characters, by Miles Tsai (net-bull@126.com) + modified by Wei He (hewei@mail.ied.ac.cn) */ + +#define isgb2312head(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xf7) +#define isgb2312tail(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xfe) + + +static uint ismbchar_gb2312(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0); +} + +static uint mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (isgb2312head(c)? 2 : 1); +} + + +/* page 0 0x2121-0x2658 */ +static uint16 tab_gb2312_uni0[]={ +0x3000,0x3001,0x3002,0x30FB,0x02C9,0x02C7,0x00A8,0x3003, +0x3005,0x2015,0xFF5E,0x2016,0x2026,0x2018,0x2019,0x201C, +0x201D,0x3014,0x3015,0x3008,0x3009,0x300A,0x300B,0x300C, +0x300D,0x300E,0x300F,0x3016,0x3017,0x3010,0x3011,0x00B1, +0x00D7,0x00F7,0x2236,0x2227,0x2228,0x2211,0x220F,0x222A, +0x2229,0x2208,0x2237,0x221A,0x22A5,0x2225,0x2220,0x2312, +0x2299,0x222B,0x222E,0x2261,0x224C,0x2248,0x223D,0x221D, +0x2260,0x226E,0x226F,0x2264,0x2265,0x221E,0x2235,0x2234, +0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFF04,0x00A4, +0xFFE0,0xFFE1,0x2030,0x00A7,0x2116,0x2606,0x2605,0x25CB, +0x25CF,0x25CE,0x25C7,0x25C6,0x25A1,0x25A0,0x25B3,0x25B2, +0x203B,0x2192,0x2190,0x2191,0x2193,0x3013, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2488,0x2489,0x248A,0x248B,0x248C,0x248D,0x248E,0x248F, +0x2490,0x2491,0x2492,0x2493,0x2494,0x2495,0x2496,0x2497, +0x2498,0x2499,0x249A,0x249B,0x2474,0x2475,0x2476,0x2477, +0x2478,0x2479,0x247A,0x247B,0x247C,0x247D,0x247E,0x247F, +0x2480,0x2481,0x2482,0x2483,0x2484,0x2485,0x2486,0x2487, +0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, +0x2468,0x2469, 0, 0,0x3220,0x3221,0x3222,0x3223, +0x3224,0x3225,0x3226,0x3227,0x3228,0x3229, 0, 0, +0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167, +0x2168,0x2169,0x216A,0x216B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFF01,0xFF02,0xFF03,0xFFE5,0xFF05,0xFF06,0xFF07,0xFF08, +0xFF09,0xFF0A,0xFF0B,0xFF0C,0xFF0D,0xFF0E,0xFF0F,0xFF10, +0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, +0xFF19,0xFF1A,0xFF1B,0xFF1C,0xFF1D,0xFF1E,0xFF1F,0xFF20, +0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28, +0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30, +0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38, +0xFF39,0xFF3A,0xFF3B,0xFF3C,0xFF3D,0xFF3E,0xFF3F,0xFF40, +0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47,0xFF48, +0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F,0xFF50, +0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57,0xFF58, +0xFF59,0xFF5A,0xFF5B,0xFF5C,0xFF5D,0xFFE3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048, +0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050, +0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058, +0x3059,0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060, +0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068, +0x3069,0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070, +0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078, +0x3079,0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080, +0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088, +0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090, +0x3091,0x3092,0x3093, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, +0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, +0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, +0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, +0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, +0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, +0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, +0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF,0x30E0, +0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,0x30E8, +0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,0x30F0, +0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398, +0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0, +0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, + 0, 0, 0, 0, 0, 0, 0, 0, +0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8, +0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0, +0x03C1,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9 +}; + +/* page 1 0x2721-0x296F */ +static uint16 tab_gb2312_uni1[]={ +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, +0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, +0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, +0x042F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446, +0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E, +0x044F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0101,0x00E1,0x01CE,0x00E0,0x0113,0x00E9,0x011B,0x00E8, +0x012B,0x00ED,0x01D0,0x00EC,0x014D,0x00F3,0x01D2,0x00F2, +0x016B,0x00FA,0x01D4,0x00F9,0x01D6,0x01D8,0x01DA,0x01DC, +0x00FC,0x00EA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3105,0x3106,0x3107,0x3108, +0x3109,0x310A,0x310B,0x310C,0x310D,0x310E,0x310F,0x3110, +0x3111,0x3112,0x3113,0x3114,0x3115,0x3116,0x3117,0x3118, +0x3119,0x311A,0x311B,0x311C,0x311D,0x311E,0x311F,0x3120, +0x3121,0x3122,0x3123,0x3124,0x3125,0x3126,0x3127,0x3128, +0x3129, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2500,0x2501,0x2502,0x2503,0x2504, +0x2505,0x2506,0x2507,0x2508,0x2509,0x250A,0x250B,0x250C, +0x250D,0x250E,0x250F,0x2510,0x2511,0x2512,0x2513,0x2514, +0x2515,0x2516,0x2517,0x2518,0x2519,0x251A,0x251B,0x251C, +0x251D,0x251E,0x251F,0x2520,0x2521,0x2522,0x2523,0x2524, +0x2525,0x2526,0x2527,0x2528,0x2529,0x252A,0x252B,0x252C, +0x252D,0x252E,0x252F,0x2530,0x2531,0x2532,0x2533,0x2534, +0x2535,0x2536,0x2537,0x2538,0x2539,0x253A,0x253B,0x253C, +0x253D,0x253E,0x253F,0x2540,0x2541,0x2542,0x2543,0x2544, +0x2545,0x2546,0x2547,0x2548,0x2549,0x254A,0x254B}; + +/* page 2 0x3021-0x777E */ +static uint16 tab_gb2312_uni2[]={ +0x554A,0x963F,0x57C3,0x6328,0x54CE,0x5509,0x54C0,0x7691, +0x764C,0x853C,0x77EE,0x827E,0x788D,0x7231,0x9698,0x978D, +0x6C28,0x5B89,0x4FFA,0x6309,0x6697,0x5CB8,0x80FA,0x6848, +0x80AE,0x6602,0x76CE,0x51F9,0x6556,0x71AC,0x7FF1,0x8884, +0x50B2,0x5965,0x61CA,0x6FB3,0x82AD,0x634C,0x6252,0x53ED, +0x5427,0x7B06,0x516B,0x75A4,0x5DF4,0x62D4,0x8DCB,0x9776, +0x628A,0x8019,0x575D,0x9738,0x7F62,0x7238,0x767D,0x67CF, +0x767E,0x6446,0x4F70,0x8D25,0x62DC,0x7A17,0x6591,0x73ED, +0x642C,0x6273,0x822C,0x9881,0x677F,0x7248,0x626E,0x62CC, +0x4F34,0x74E3,0x534A,0x529E,0x7ECA,0x90A6,0x5E2E,0x6886, +0x699C,0x8180,0x7ED1,0x68D2,0x78C5,0x868C,0x9551,0x508D, +0x8C24,0x82DE,0x80DE,0x5305,0x8912,0x5265, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8584,0x96F9,0x4FDD,0x5821,0x9971,0x5B9D,0x62B1,0x62A5, +0x66B4,0x8C79,0x9C8D,0x7206,0x676F,0x7891,0x60B2,0x5351, +0x5317,0x8F88,0x80CC,0x8D1D,0x94A1,0x500D,0x72C8,0x5907, +0x60EB,0x7119,0x88AB,0x5954,0x82EF,0x672C,0x7B28,0x5D29, +0x7EF7,0x752D,0x6CF5,0x8E66,0x8FF8,0x903C,0x9F3B,0x6BD4, +0x9119,0x7B14,0x5F7C,0x78A7,0x84D6,0x853D,0x6BD5,0x6BD9, +0x6BD6,0x5E01,0x5E87,0x75F9,0x95ED,0x655D,0x5F0A,0x5FC5, +0x8F9F,0x58C1,0x81C2,0x907F,0x965B,0x97AD,0x8FB9,0x7F16, +0x8D2C,0x6241,0x4FBF,0x53D8,0x535E,0x8FA8,0x8FA9,0x8FAB, +0x904D,0x6807,0x5F6A,0x8198,0x8868,0x9CD6,0x618B,0x522B, +0x762A,0x5F6C,0x658C,0x6FD2,0x6EE8,0x5BBE,0x6448,0x5175, +0x51B0,0x67C4,0x4E19,0x79C9,0x997C,0x70B3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x75C5,0x5E76,0x73BB,0x83E0,0x64AD,0x62E8,0x94B5,0x6CE2, +0x535A,0x52C3,0x640F,0x94C2,0x7B94,0x4F2F,0x5E1B,0x8236, +0x8116,0x818A,0x6E24,0x6CCA,0x9A73,0x6355,0x535C,0x54FA, +0x8865,0x57E0,0x4E0D,0x5E03,0x6B65,0x7C3F,0x90E8,0x6016, +0x64E6,0x731C,0x88C1,0x6750,0x624D,0x8D22,0x776C,0x8E29, +0x91C7,0x5F69,0x83DC,0x8521,0x9910,0x53C2,0x8695,0x6B8B, +0x60ED,0x60E8,0x707F,0x82CD,0x8231,0x4ED3,0x6CA7,0x85CF, +0x64CD,0x7CD9,0x69FD,0x66F9,0x8349,0x5395,0x7B56,0x4FA7, +0x518C,0x6D4B,0x5C42,0x8E6D,0x63D2,0x53C9,0x832C,0x8336, +0x67E5,0x78B4,0x643D,0x5BDF,0x5C94,0x5DEE,0x8BE7,0x62C6, +0x67F4,0x8C7A,0x6400,0x63BA,0x8749,0x998B,0x8C17,0x7F20, +0x94F2,0x4EA7,0x9610,0x98A4,0x660C,0x7316, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x573A,0x5C1D,0x5E38,0x957F,0x507F,0x80A0,0x5382,0x655E, +0x7545,0x5531,0x5021,0x8D85,0x6284,0x949E,0x671D,0x5632, +0x6F6E,0x5DE2,0x5435,0x7092,0x8F66,0x626F,0x64A4,0x63A3, +0x5F7B,0x6F88,0x90F4,0x81E3,0x8FB0,0x5C18,0x6668,0x5FF1, +0x6C89,0x9648,0x8D81,0x886C,0x6491,0x79F0,0x57CE,0x6A59, +0x6210,0x5448,0x4E58,0x7A0B,0x60E9,0x6F84,0x8BDA,0x627F, +0x901E,0x9A8B,0x79E4,0x5403,0x75F4,0x6301,0x5319,0x6C60, +0x8FDF,0x5F1B,0x9A70,0x803B,0x9F7F,0x4F88,0x5C3A,0x8D64, +0x7FC5,0x65A5,0x70BD,0x5145,0x51B2,0x866B,0x5D07,0x5BA0, +0x62BD,0x916C,0x7574,0x8E0C,0x7A20,0x6101,0x7B79,0x4EC7, +0x7EF8,0x7785,0x4E11,0x81ED,0x521D,0x51FA,0x6A71,0x53A8, +0x8E87,0x9504,0x96CF,0x6EC1,0x9664,0x695A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7840,0x50A8,0x77D7,0x6410,0x89E6,0x5904,0x63E3,0x5DDD, +0x7A7F,0x693D,0x4F20,0x8239,0x5598,0x4E32,0x75AE,0x7A97, +0x5E62,0x5E8A,0x95EF,0x521B,0x5439,0x708A,0x6376,0x9524, +0x5782,0x6625,0x693F,0x9187,0x5507,0x6DF3,0x7EAF,0x8822, +0x6233,0x7EF0,0x75B5,0x8328,0x78C1,0x96CC,0x8F9E,0x6148, +0x74F7,0x8BCD,0x6B64,0x523A,0x8D50,0x6B21,0x806A,0x8471, +0x56F1,0x5306,0x4ECE,0x4E1B,0x51D1,0x7C97,0x918B,0x7C07, +0x4FC3,0x8E7F,0x7BE1,0x7A9C,0x6467,0x5D14,0x50AC,0x8106, +0x7601,0x7CB9,0x6DEC,0x7FE0,0x6751,0x5B58,0x5BF8,0x78CB, +0x64AE,0x6413,0x63AA,0x632B,0x9519,0x642D,0x8FBE,0x7B54, +0x7629,0x6253,0x5927,0x5446,0x6B79,0x50A3,0x6234,0x5E26, +0x6B86,0x4EE3,0x8D37,0x888B,0x5F85,0x902E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6020,0x803D,0x62C5,0x4E39,0x5355,0x90F8,0x63B8,0x80C6, +0x65E6,0x6C2E,0x4F46,0x60EE,0x6DE1,0x8BDE,0x5F39,0x86CB, +0x5F53,0x6321,0x515A,0x8361,0x6863,0x5200,0x6363,0x8E48, +0x5012,0x5C9B,0x7977,0x5BFC,0x5230,0x7A3B,0x60BC,0x9053, +0x76D7,0x5FB7,0x5F97,0x7684,0x8E6C,0x706F,0x767B,0x7B49, +0x77AA,0x51F3,0x9093,0x5824,0x4F4E,0x6EF4,0x8FEA,0x654C, +0x7B1B,0x72C4,0x6DA4,0x7FDF,0x5AE1,0x62B5,0x5E95,0x5730, +0x8482,0x7B2C,0x5E1D,0x5F1F,0x9012,0x7F14,0x98A0,0x6382, +0x6EC7,0x7898,0x70B9,0x5178,0x975B,0x57AB,0x7535,0x4F43, +0x7538,0x5E97,0x60E6,0x5960,0x6DC0,0x6BBF,0x7889,0x53FC, +0x96D5,0x51CB,0x5201,0x6389,0x540A,0x9493,0x8C03,0x8DCC, +0x7239,0x789F,0x8776,0x8FED,0x8C0D,0x53E0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4E01,0x76EF,0x53EE,0x9489,0x9876,0x9F0E,0x952D,0x5B9A, +0x8BA2,0x4E22,0x4E1C,0x51AC,0x8463,0x61C2,0x52A8,0x680B, +0x4F97,0x606B,0x51BB,0x6D1E,0x515C,0x6296,0x6597,0x9661, +0x8C46,0x9017,0x75D8,0x90FD,0x7763,0x6BD2,0x728A,0x72EC, +0x8BFB,0x5835,0x7779,0x8D4C,0x675C,0x9540,0x809A,0x5EA6, +0x6E21,0x5992,0x7AEF,0x77ED,0x953B,0x6BB5,0x65AD,0x7F0E, +0x5806,0x5151,0x961F,0x5BF9,0x58A9,0x5428,0x8E72,0x6566, +0x987F,0x56E4,0x949D,0x76FE,0x9041,0x6387,0x54C6,0x591A, +0x593A,0x579B,0x8EB2,0x6735,0x8DFA,0x8235,0x5241,0x60F0, +0x5815,0x86FE,0x5CE8,0x9E45,0x4FC4,0x989D,0x8BB9,0x5A25, +0x6076,0x5384,0x627C,0x904F,0x9102,0x997F,0x6069,0x800C, +0x513F,0x8033,0x5C14,0x9975,0x6D31,0x4E8C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8D30,0x53D1,0x7F5A,0x7B4F,0x4F10,0x4E4F,0x9600,0x6CD5, +0x73D0,0x85E9,0x5E06,0x756A,0x7FFB,0x6A0A,0x77FE,0x9492, +0x7E41,0x51E1,0x70E6,0x53CD,0x8FD4,0x8303,0x8D29,0x72AF, +0x996D,0x6CDB,0x574A,0x82B3,0x65B9,0x80AA,0x623F,0x9632, +0x59A8,0x4EFF,0x8BBF,0x7EBA,0x653E,0x83F2,0x975E,0x5561, +0x98DE,0x80A5,0x532A,0x8BFD,0x5420,0x80BA,0x5E9F,0x6CB8, +0x8D39,0x82AC,0x915A,0x5429,0x6C1B,0x5206,0x7EB7,0x575F, +0x711A,0x6C7E,0x7C89,0x594B,0x4EFD,0x5FFF,0x6124,0x7CAA, +0x4E30,0x5C01,0x67AB,0x8702,0x5CF0,0x950B,0x98CE,0x75AF, +0x70FD,0x9022,0x51AF,0x7F1D,0x8BBD,0x5949,0x51E4,0x4F5B, +0x5426,0x592B,0x6577,0x80A4,0x5B75,0x6276,0x62C2,0x8F90, +0x5E45,0x6C1F,0x7B26,0x4F0F,0x4FD8,0x670D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6D6E,0x6DAA,0x798F,0x88B1,0x5F17,0x752B,0x629A,0x8F85, +0x4FEF,0x91DC,0x65A7,0x812F,0x8151,0x5E9C,0x8150,0x8D74, +0x526F,0x8986,0x8D4B,0x590D,0x5085,0x4ED8,0x961C,0x7236, +0x8179,0x8D1F,0x5BCC,0x8BA3,0x9644,0x5987,0x7F1A,0x5490, +0x5676,0x560E,0x8BE5,0x6539,0x6982,0x9499,0x76D6,0x6E89, +0x5E72,0x7518,0x6746,0x67D1,0x7AFF,0x809D,0x8D76,0x611F, +0x79C6,0x6562,0x8D63,0x5188,0x521A,0x94A2,0x7F38,0x809B, +0x7EB2,0x5C97,0x6E2F,0x6760,0x7BD9,0x768B,0x9AD8,0x818F, +0x7F94,0x7CD5,0x641E,0x9550,0x7A3F,0x544A,0x54E5,0x6B4C, +0x6401,0x6208,0x9E3D,0x80F3,0x7599,0x5272,0x9769,0x845B, +0x683C,0x86E4,0x9601,0x9694,0x94EC,0x4E2A,0x5404,0x7ED9, +0x6839,0x8DDF,0x8015,0x66F4,0x5E9A,0x7FB9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x57C2,0x803F,0x6897,0x5DE5,0x653B,0x529F,0x606D,0x9F9A, +0x4F9B,0x8EAC,0x516C,0x5BAB,0x5F13,0x5DE9,0x6C5E,0x62F1, +0x8D21,0x5171,0x94A9,0x52FE,0x6C9F,0x82DF,0x72D7,0x57A2, +0x6784,0x8D2D,0x591F,0x8F9C,0x83C7,0x5495,0x7B8D,0x4F30, +0x6CBD,0x5B64,0x59D1,0x9F13,0x53E4,0x86CA,0x9AA8,0x8C37, +0x80A1,0x6545,0x987E,0x56FA,0x96C7,0x522E,0x74DC,0x5250, +0x5BE1,0x6302,0x8902,0x4E56,0x62D0,0x602A,0x68FA,0x5173, +0x5B98,0x51A0,0x89C2,0x7BA1,0x9986,0x7F50,0x60EF,0x704C, +0x8D2F,0x5149,0x5E7F,0x901B,0x7470,0x89C4,0x572D,0x7845, +0x5F52,0x9F9F,0x95FA,0x8F68,0x9B3C,0x8BE1,0x7678,0x6842, +0x67DC,0x8DEA,0x8D35,0x523D,0x8F8A,0x6EDA,0x68CD,0x9505, +0x90ED,0x56FD,0x679C,0x88F9,0x8FC7,0x54C8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9AB8,0x5B69,0x6D77,0x6C26,0x4EA5,0x5BB3,0x9A87,0x9163, +0x61A8,0x90AF,0x97E9,0x542B,0x6DB5,0x5BD2,0x51FD,0x558A, +0x7F55,0x7FF0,0x64BC,0x634D,0x65F1,0x61BE,0x608D,0x710A, +0x6C57,0x6C49,0x592F,0x676D,0x822A,0x58D5,0x568E,0x8C6A, +0x6BEB,0x90DD,0x597D,0x8017,0x53F7,0x6D69,0x5475,0x559D, +0x8377,0x83CF,0x6838,0x79BE,0x548C,0x4F55,0x5408,0x76D2, +0x8C89,0x9602,0x6CB3,0x6DB8,0x8D6B,0x8910,0x9E64,0x8D3A, +0x563F,0x9ED1,0x75D5,0x5F88,0x72E0,0x6068,0x54FC,0x4EA8, +0x6A2A,0x8861,0x6052,0x8F70,0x54C4,0x70D8,0x8679,0x9E3F, +0x6D2A,0x5B8F,0x5F18,0x7EA2,0x5589,0x4FAF,0x7334,0x543C, +0x539A,0x5019,0x540E,0x547C,0x4E4E,0x5FFD,0x745A,0x58F6, +0x846B,0x80E1,0x8774,0x72D0,0x7CCA,0x6E56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F27,0x864E,0x552C,0x62A4,0x4E92,0x6CAA,0x6237,0x82B1, +0x54D7,0x534E,0x733E,0x6ED1,0x753B,0x5212,0x5316,0x8BDD, +0x69D0,0x5F8A,0x6000,0x6DEE,0x574F,0x6B22,0x73AF,0x6853, +0x8FD8,0x7F13,0x6362,0x60A3,0x5524,0x75EA,0x8C62,0x7115, +0x6DA3,0x5BA6,0x5E7B,0x8352,0x614C,0x9EC4,0x78FA,0x8757, +0x7C27,0x7687,0x51F0,0x60F6,0x714C,0x6643,0x5E4C,0x604D, +0x8C0E,0x7070,0x6325,0x8F89,0x5FBD,0x6062,0x86D4,0x56DE, +0x6BC1,0x6094,0x6167,0x5349,0x60E0,0x6666,0x8D3F,0x79FD, +0x4F1A,0x70E9,0x6C47,0x8BB3,0x8BF2,0x7ED8,0x8364,0x660F, +0x5A5A,0x9B42,0x6D51,0x6DF7,0x8C41,0x6D3B,0x4F19,0x706B, +0x83B7,0x6216,0x60D1,0x970D,0x8D27,0x7978,0x51FB,0x573E, +0x57FA,0x673A,0x7578,0x7A3D,0x79EF,0x7B95, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x808C,0x9965,0x8FF9,0x6FC0,0x8BA5,0x9E21,0x59EC,0x7EE9, +0x7F09,0x5409,0x6781,0x68D8,0x8F91,0x7C4D,0x96C6,0x53CA, +0x6025,0x75BE,0x6C72,0x5373,0x5AC9,0x7EA7,0x6324,0x51E0, +0x810A,0x5DF1,0x84DF,0x6280,0x5180,0x5B63,0x4F0E,0x796D, +0x5242,0x60B8,0x6D4E,0x5BC4,0x5BC2,0x8BA1,0x8BB0,0x65E2, +0x5FCC,0x9645,0x5993,0x7EE7,0x7EAA,0x5609,0x67B7,0x5939, +0x4F73,0x5BB6,0x52A0,0x835A,0x988A,0x8D3E,0x7532,0x94BE, +0x5047,0x7A3C,0x4EF7,0x67B6,0x9A7E,0x5AC1,0x6B7C,0x76D1, +0x575A,0x5C16,0x7B3A,0x95F4,0x714E,0x517C,0x80A9,0x8270, +0x5978,0x7F04,0x8327,0x68C0,0x67EC,0x78B1,0x7877,0x62E3, +0x6361,0x7B80,0x4FED,0x526A,0x51CF,0x8350,0x69DB,0x9274, +0x8DF5,0x8D31,0x89C1,0x952E,0x7BAD,0x4EF6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5065,0x8230,0x5251,0x996F,0x6E10,0x6E85,0x6DA7,0x5EFA, +0x50F5,0x59DC,0x5C06,0x6D46,0x6C5F,0x7586,0x848B,0x6868, +0x5956,0x8BB2,0x5320,0x9171,0x964D,0x8549,0x6912,0x7901, +0x7126,0x80F6,0x4EA4,0x90CA,0x6D47,0x9A84,0x5A07,0x56BC, +0x6405,0x94F0,0x77EB,0x4FA5,0x811A,0x72E1,0x89D2,0x997A, +0x7F34,0x7EDE,0x527F,0x6559,0x9175,0x8F7F,0x8F83,0x53EB, +0x7A96,0x63ED,0x63A5,0x7686,0x79F8,0x8857,0x9636,0x622A, +0x52AB,0x8282,0x6854,0x6770,0x6377,0x776B,0x7AED,0x6D01, +0x7ED3,0x89E3,0x59D0,0x6212,0x85C9,0x82A5,0x754C,0x501F, +0x4ECB,0x75A5,0x8BEB,0x5C4A,0x5DFE,0x7B4B,0x65A4,0x91D1, +0x4ECA,0x6D25,0x895F,0x7D27,0x9526,0x4EC5,0x8C28,0x8FDB, +0x9773,0x664B,0x7981,0x8FD1,0x70EC,0x6D78, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5C3D,0x52B2,0x8346,0x5162,0x830E,0x775B,0x6676,0x9CB8, +0x4EAC,0x60CA,0x7CBE,0x7CB3,0x7ECF,0x4E95,0x8B66,0x666F, +0x9888,0x9759,0x5883,0x656C,0x955C,0x5F84,0x75C9,0x9756, +0x7ADF,0x7ADE,0x51C0,0x70AF,0x7A98,0x63EA,0x7A76,0x7EA0, +0x7396,0x97ED,0x4E45,0x7078,0x4E5D,0x9152,0x53A9,0x6551, +0x65E7,0x81FC,0x8205,0x548E,0x5C31,0x759A,0x97A0,0x62D8, +0x72D9,0x75BD,0x5C45,0x9A79,0x83CA,0x5C40,0x5480,0x77E9, +0x4E3E,0x6CAE,0x805A,0x62D2,0x636E,0x5DE8,0x5177,0x8DDD, +0x8E1E,0x952F,0x4FF1,0x53E5,0x60E7,0x70AC,0x5267,0x6350, +0x9E43,0x5A1F,0x5026,0x7737,0x5377,0x7EE2,0x6485,0x652B, +0x6289,0x6398,0x5014,0x7235,0x89C9,0x51B3,0x8BC0,0x7EDD, +0x5747,0x83CC,0x94A7,0x519B,0x541B,0x5CFB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4FCA,0x7AE3,0x6D5A,0x90E1,0x9A8F,0x5580,0x5496,0x5361, +0x54AF,0x5F00,0x63E9,0x6977,0x51EF,0x6168,0x520A,0x582A, +0x52D8,0x574E,0x780D,0x770B,0x5EB7,0x6177,0x7CE0,0x625B, +0x6297,0x4EA2,0x7095,0x8003,0x62F7,0x70E4,0x9760,0x5777, +0x82DB,0x67EF,0x68F5,0x78D5,0x9897,0x79D1,0x58F3,0x54B3, +0x53EF,0x6E34,0x514B,0x523B,0x5BA2,0x8BFE,0x80AF,0x5543, +0x57A6,0x6073,0x5751,0x542D,0x7A7A,0x6050,0x5B54,0x63A7, +0x62A0,0x53E3,0x6263,0x5BC7,0x67AF,0x54ED,0x7A9F,0x82E6, +0x9177,0x5E93,0x88E4,0x5938,0x57AE,0x630E,0x8DE8,0x80EF, +0x5757,0x7B77,0x4FA9,0x5FEB,0x5BBD,0x6B3E,0x5321,0x7B50, +0x72C2,0x6846,0x77FF,0x7736,0x65F7,0x51B5,0x4E8F,0x76D4, +0x5CBF,0x7AA5,0x8475,0x594E,0x9B41,0x5080, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9988,0x6127,0x6E83,0x5764,0x6606,0x6346,0x56F0,0x62EC, +0x6269,0x5ED3,0x9614,0x5783,0x62C9,0x5587,0x8721,0x814A, +0x8FA3,0x5566,0x83B1,0x6765,0x8D56,0x84DD,0x5A6A,0x680F, +0x62E6,0x7BEE,0x9611,0x5170,0x6F9C,0x8C30,0x63FD,0x89C8, +0x61D2,0x7F06,0x70C2,0x6EE5,0x7405,0x6994,0x72FC,0x5ECA, +0x90CE,0x6717,0x6D6A,0x635E,0x52B3,0x7262,0x8001,0x4F6C, +0x59E5,0x916A,0x70D9,0x6D9D,0x52D2,0x4E50,0x96F7,0x956D, +0x857E,0x78CA,0x7D2F,0x5121,0x5792,0x64C2,0x808B,0x7C7B, +0x6CEA,0x68F1,0x695E,0x51B7,0x5398,0x68A8,0x7281,0x9ECE, +0x7BF1,0x72F8,0x79BB,0x6F13,0x7406,0x674E,0x91CC,0x9CA4, +0x793C,0x8389,0x8354,0x540F,0x6817,0x4E3D,0x5389,0x52B1, +0x783E,0x5386,0x5229,0x5088,0x4F8B,0x4FD0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x75E2,0x7ACB,0x7C92,0x6CA5,0x96B6,0x529B,0x7483,0x54E9, +0x4FE9,0x8054,0x83B2,0x8FDE,0x9570,0x5EC9,0x601C,0x6D9F, +0x5E18,0x655B,0x8138,0x94FE,0x604B,0x70BC,0x7EC3,0x7CAE, +0x51C9,0x6881,0x7CB1,0x826F,0x4E24,0x8F86,0x91CF,0x667E, +0x4EAE,0x8C05,0x64A9,0x804A,0x50DA,0x7597,0x71CE,0x5BE5, +0x8FBD,0x6F66,0x4E86,0x6482,0x9563,0x5ED6,0x6599,0x5217, +0x88C2,0x70C8,0x52A3,0x730E,0x7433,0x6797,0x78F7,0x9716, +0x4E34,0x90BB,0x9CDE,0x6DCB,0x51DB,0x8D41,0x541D,0x62CE, +0x73B2,0x83F1,0x96F6,0x9F84,0x94C3,0x4F36,0x7F9A,0x51CC, +0x7075,0x9675,0x5CAD,0x9886,0x53E6,0x4EE4,0x6E9C,0x7409, +0x69B4,0x786B,0x998F,0x7559,0x5218,0x7624,0x6D41,0x67F3, +0x516D,0x9F99,0x804B,0x5499,0x7B3C,0x7ABF, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9686,0x5784,0x62E2,0x9647,0x697C,0x5A04,0x6402,0x7BD3, +0x6F0F,0x964B,0x82A6,0x5362,0x9885,0x5E90,0x7089,0x63B3, +0x5364,0x864F,0x9C81,0x9E93,0x788C,0x9732,0x8DEF,0x8D42, +0x9E7F,0x6F5E,0x7984,0x5F55,0x9646,0x622E,0x9A74,0x5415, +0x94DD,0x4FA3,0x65C5,0x5C65,0x5C61,0x7F15,0x8651,0x6C2F, +0x5F8B,0x7387,0x6EE4,0x7EFF,0x5CE6,0x631B,0x5B6A,0x6EE6, +0x5375,0x4E71,0x63A0,0x7565,0x62A1,0x8F6E,0x4F26,0x4ED1, +0x6CA6,0x7EB6,0x8BBA,0x841D,0x87BA,0x7F57,0x903B,0x9523, +0x7BA9,0x9AA1,0x88F8,0x843D,0x6D1B,0x9A86,0x7EDC,0x5988, +0x9EBB,0x739B,0x7801,0x8682,0x9A6C,0x9A82,0x561B,0x5417, +0x57CB,0x4E70,0x9EA6,0x5356,0x8FC8,0x8109,0x7792,0x9992, +0x86EE,0x6EE1,0x8513,0x66FC,0x6162,0x6F2B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8C29,0x8292,0x832B,0x76F2,0x6C13,0x5FD9,0x83BD,0x732B, +0x8305,0x951A,0x6BDB,0x77DB,0x94C6,0x536F,0x8302,0x5192, +0x5E3D,0x8C8C,0x8D38,0x4E48,0x73AB,0x679A,0x6885,0x9176, +0x9709,0x7164,0x6CA1,0x7709,0x5A92,0x9541,0x6BCF,0x7F8E, +0x6627,0x5BD0,0x59B9,0x5A9A,0x95E8,0x95F7,0x4EEC,0x840C, +0x8499,0x6AAC,0x76DF,0x9530,0x731B,0x68A6,0x5B5F,0x772F, +0x919A,0x9761,0x7CDC,0x8FF7,0x8C1C,0x5F25,0x7C73,0x79D8, +0x89C5,0x6CCC,0x871C,0x5BC6,0x5E42,0x68C9,0x7720,0x7EF5, +0x5195,0x514D,0x52C9,0x5A29,0x7F05,0x9762,0x82D7,0x63CF, +0x7784,0x85D0,0x79D2,0x6E3A,0x5E99,0x5999,0x8511,0x706D, +0x6C11,0x62BF,0x76BF,0x654F,0x60AF,0x95FD,0x660E,0x879F, +0x9E23,0x94ED,0x540D,0x547D,0x8C2C,0x6478, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6479,0x8611,0x6A21,0x819C,0x78E8,0x6469,0x9B54,0x62B9, +0x672B,0x83AB,0x58A8,0x9ED8,0x6CAB,0x6F20,0x5BDE,0x964C, +0x8C0B,0x725F,0x67D0,0x62C7,0x7261,0x4EA9,0x59C6,0x6BCD, +0x5893,0x66AE,0x5E55,0x52DF,0x6155,0x6728,0x76EE,0x7766, +0x7267,0x7A46,0x62FF,0x54EA,0x5450,0x94A0,0x90A3,0x5A1C, +0x7EB3,0x6C16,0x4E43,0x5976,0x8010,0x5948,0x5357,0x7537, +0x96BE,0x56CA,0x6320,0x8111,0x607C,0x95F9,0x6DD6,0x5462, +0x9981,0x5185,0x5AE9,0x80FD,0x59AE,0x9713,0x502A,0x6CE5, +0x5C3C,0x62DF,0x4F60,0x533F,0x817B,0x9006,0x6EBA,0x852B, +0x62C8,0x5E74,0x78BE,0x64B5,0x637B,0x5FF5,0x5A18,0x917F, +0x9E1F,0x5C3F,0x634F,0x8042,0x5B7D,0x556E,0x954A,0x954D, +0x6D85,0x60A8,0x67E0,0x72DE,0x51DD,0x5B81, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x62E7,0x6CDE,0x725B,0x626D,0x94AE,0x7EBD,0x8113,0x6D53, +0x519C,0x5F04,0x5974,0x52AA,0x6012,0x5973,0x6696,0x8650, +0x759F,0x632A,0x61E6,0x7CEF,0x8BFA,0x54E6,0x6B27,0x9E25, +0x6BB4,0x85D5,0x5455,0x5076,0x6CA4,0x556A,0x8DB4,0x722C, +0x5E15,0x6015,0x7436,0x62CD,0x6392,0x724C,0x5F98,0x6E43, +0x6D3E,0x6500,0x6F58,0x76D8,0x78D0,0x76FC,0x7554,0x5224, +0x53DB,0x4E53,0x5E9E,0x65C1,0x802A,0x80D6,0x629B,0x5486, +0x5228,0x70AE,0x888D,0x8DD1,0x6CE1,0x5478,0x80DA,0x57F9, +0x88F4,0x8D54,0x966A,0x914D,0x4F69,0x6C9B,0x55B7,0x76C6, +0x7830,0x62A8,0x70F9,0x6F8E,0x5F6D,0x84EC,0x68DA,0x787C, +0x7BF7,0x81A8,0x670B,0x9E4F,0x6367,0x78B0,0x576F,0x7812, +0x9739,0x6279,0x62AB,0x5288,0x7435,0x6BD7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5564,0x813E,0x75B2,0x76AE,0x5339,0x75DE,0x50FB,0x5C41, +0x8B6C,0x7BC7,0x504F,0x7247,0x9A97,0x98D8,0x6F02,0x74E2, +0x7968,0x6487,0x77A5,0x62FC,0x9891,0x8D2B,0x54C1,0x8058, +0x4E52,0x576A,0x82F9,0x840D,0x5E73,0x51ED,0x74F6,0x8BC4, +0x5C4F,0x5761,0x6CFC,0x9887,0x5A46,0x7834,0x9B44,0x8FEB, +0x7C95,0x5256,0x6251,0x94FA,0x4EC6,0x8386,0x8461,0x83E9, +0x84B2,0x57D4,0x6734,0x5703,0x666E,0x6D66,0x8C31,0x66DD, +0x7011,0x671F,0x6B3A,0x6816,0x621A,0x59BB,0x4E03,0x51C4, +0x6F06,0x67D2,0x6C8F,0x5176,0x68CB,0x5947,0x6B67,0x7566, +0x5D0E,0x8110,0x9F50,0x65D7,0x7948,0x7941,0x9A91,0x8D77, +0x5C82,0x4E5E,0x4F01,0x542F,0x5951,0x780C,0x5668,0x6C14, +0x8FC4,0x5F03,0x6C7D,0x6CE3,0x8BAB,0x6390, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6070,0x6D3D,0x7275,0x6266,0x948E,0x94C5,0x5343,0x8FC1, +0x7B7E,0x4EDF,0x8C26,0x4E7E,0x9ED4,0x94B1,0x94B3,0x524D, +0x6F5C,0x9063,0x6D45,0x8C34,0x5811,0x5D4C,0x6B20,0x6B49, +0x67AA,0x545B,0x8154,0x7F8C,0x5899,0x8537,0x5F3A,0x62A2, +0x6A47,0x9539,0x6572,0x6084,0x6865,0x77A7,0x4E54,0x4FA8, +0x5DE7,0x9798,0x64AC,0x7FD8,0x5CED,0x4FCF,0x7A8D,0x5207, +0x8304,0x4E14,0x602F,0x7A83,0x94A6,0x4FB5,0x4EB2,0x79E6, +0x7434,0x52E4,0x82B9,0x64D2,0x79BD,0x5BDD,0x6C81,0x9752, +0x8F7B,0x6C22,0x503E,0x537F,0x6E05,0x64CE,0x6674,0x6C30, +0x60C5,0x9877,0x8BF7,0x5E86,0x743C,0x7A77,0x79CB,0x4E18, +0x90B1,0x7403,0x6C42,0x56DA,0x914B,0x6CC5,0x8D8B,0x533A, +0x86C6,0x66F2,0x8EAF,0x5C48,0x9A71,0x6E20, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x53D6,0x5A36,0x9F8B,0x8DA3,0x53BB,0x5708,0x98A7,0x6743, +0x919B,0x6CC9,0x5168,0x75CA,0x62F3,0x72AC,0x5238,0x529D, +0x7F3A,0x7094,0x7638,0x5374,0x9E4A,0x69B7,0x786E,0x96C0, +0x88D9,0x7FA4,0x7136,0x71C3,0x5189,0x67D3,0x74E4,0x58E4, +0x6518,0x56B7,0x8BA9,0x9976,0x6270,0x7ED5,0x60F9,0x70ED, +0x58EC,0x4EC1,0x4EBA,0x5FCD,0x97E7,0x4EFB,0x8BA4,0x5203, +0x598A,0x7EAB,0x6254,0x4ECD,0x65E5,0x620E,0x8338,0x84C9, +0x8363,0x878D,0x7194,0x6EB6,0x5BB9,0x7ED2,0x5197,0x63C9, +0x67D4,0x8089,0x8339,0x8815,0x5112,0x5B7A,0x5982,0x8FB1, +0x4E73,0x6C5D,0x5165,0x8925,0x8F6F,0x962E,0x854A,0x745E, +0x9510,0x95F0,0x6DA6,0x82E5,0x5F31,0x6492,0x6D12,0x8428, +0x816E,0x9CC3,0x585E,0x8D5B,0x4E09,0x53C1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4F1E,0x6563,0x6851,0x55D3,0x4E27,0x6414,0x9A9A,0x626B, +0x5AC2,0x745F,0x8272,0x6DA9,0x68EE,0x50E7,0x838E,0x7802, +0x6740,0x5239,0x6C99,0x7EB1,0x50BB,0x5565,0x715E,0x7B5B, +0x6652,0x73CA,0x82EB,0x6749,0x5C71,0x5220,0x717D,0x886B, +0x95EA,0x9655,0x64C5,0x8D61,0x81B3,0x5584,0x6C55,0x6247, +0x7F2E,0x5892,0x4F24,0x5546,0x8D4F,0x664C,0x4E0A,0x5C1A, +0x88F3,0x68A2,0x634E,0x7A0D,0x70E7,0x828D,0x52FA,0x97F6, +0x5C11,0x54E8,0x90B5,0x7ECD,0x5962,0x8D4A,0x86C7,0x820C, +0x820D,0x8D66,0x6444,0x5C04,0x6151,0x6D89,0x793E,0x8BBE, +0x7837,0x7533,0x547B,0x4F38,0x8EAB,0x6DF1,0x5A20,0x7EC5, +0x795E,0x6C88,0x5BA1,0x5A76,0x751A,0x80BE,0x614E,0x6E17, +0x58F0,0x751F,0x7525,0x7272,0x5347,0x7EF3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7701,0x76DB,0x5269,0x80DC,0x5723,0x5E08,0x5931,0x72EE, +0x65BD,0x6E7F,0x8BD7,0x5C38,0x8671,0x5341,0x77F3,0x62FE, +0x65F6,0x4EC0,0x98DF,0x8680,0x5B9E,0x8BC6,0x53F2,0x77E2, +0x4F7F,0x5C4E,0x9A76,0x59CB,0x5F0F,0x793A,0x58EB,0x4E16, +0x67FF,0x4E8B,0x62ED,0x8A93,0x901D,0x52BF,0x662F,0x55DC, +0x566C,0x9002,0x4ED5,0x4F8D,0x91CA,0x9970,0x6C0F,0x5E02, +0x6043,0x5BA4,0x89C6,0x8BD5,0x6536,0x624B,0x9996,0x5B88, +0x5BFF,0x6388,0x552E,0x53D7,0x7626,0x517D,0x852C,0x67A2, +0x68B3,0x6B8A,0x6292,0x8F93,0x53D4,0x8212,0x6DD1,0x758F, +0x4E66,0x8D4E,0x5B70,0x719F,0x85AF,0x6691,0x66D9,0x7F72, +0x8700,0x9ECD,0x9F20,0x5C5E,0x672F,0x8FF0,0x6811,0x675F, +0x620D,0x7AD6,0x5885,0x5EB6,0x6570,0x6F31, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6055,0x5237,0x800D,0x6454,0x8870,0x7529,0x5E05,0x6813, +0x62F4,0x971C,0x53CC,0x723D,0x8C01,0x6C34,0x7761,0x7A0E, +0x542E,0x77AC,0x987A,0x821C,0x8BF4,0x7855,0x6714,0x70C1, +0x65AF,0x6495,0x5636,0x601D,0x79C1,0x53F8,0x4E1D,0x6B7B, +0x8086,0x5BFA,0x55E3,0x56DB,0x4F3A,0x4F3C,0x9972,0x5DF3, +0x677E,0x8038,0x6002,0x9882,0x9001,0x5B8B,0x8BBC,0x8BF5, +0x641C,0x8258,0x64DE,0x55FD,0x82CF,0x9165,0x4FD7,0x7D20, +0x901F,0x7C9F,0x50F3,0x5851,0x6EAF,0x5BBF,0x8BC9,0x8083, +0x9178,0x849C,0x7B97,0x867D,0x968B,0x968F,0x7EE5,0x9AD3, +0x788E,0x5C81,0x7A57,0x9042,0x96A7,0x795F,0x5B59,0x635F, +0x7B0B,0x84D1,0x68AD,0x5506,0x7F29,0x7410,0x7D22,0x9501, +0x6240,0x584C,0x4ED6,0x5B83,0x5979,0x5854, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x736D,0x631E,0x8E4B,0x8E0F,0x80CE,0x82D4,0x62AC,0x53F0, +0x6CF0,0x915E,0x592A,0x6001,0x6C70,0x574D,0x644A,0x8D2A, +0x762B,0x6EE9,0x575B,0x6A80,0x75F0,0x6F6D,0x8C2D,0x8C08, +0x5766,0x6BEF,0x8892,0x78B3,0x63A2,0x53F9,0x70AD,0x6C64, +0x5858,0x642A,0x5802,0x68E0,0x819B,0x5510,0x7CD6,0x5018, +0x8EBA,0x6DCC,0x8D9F,0x70EB,0x638F,0x6D9B,0x6ED4,0x7EE6, +0x8404,0x6843,0x9003,0x6DD8,0x9676,0x8BA8,0x5957,0x7279, +0x85E4,0x817E,0x75BC,0x8A8A,0x68AF,0x5254,0x8E22,0x9511, +0x63D0,0x9898,0x8E44,0x557C,0x4F53,0x66FF,0x568F,0x60D5, +0x6D95,0x5243,0x5C49,0x5929,0x6DFB,0x586B,0x7530,0x751C, +0x606C,0x8214,0x8146,0x6311,0x6761,0x8FE2,0x773A,0x8DF3, +0x8D34,0x94C1,0x5E16,0x5385,0x542C,0x70C3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C40,0x5EF7,0x505C,0x4EAD,0x5EAD,0x633A,0x8247,0x901A, +0x6850,0x916E,0x77B3,0x540C,0x94DC,0x5F64,0x7AE5,0x6876, +0x6345,0x7B52,0x7EDF,0x75DB,0x5077,0x6295,0x5934,0x900F, +0x51F8,0x79C3,0x7A81,0x56FE,0x5F92,0x9014,0x6D82,0x5C60, +0x571F,0x5410,0x5154,0x6E4D,0x56E2,0x63A8,0x9893,0x817F, +0x8715,0x892A,0x9000,0x541E,0x5C6F,0x81C0,0x62D6,0x6258, +0x8131,0x9E35,0x9640,0x9A6E,0x9A7C,0x692D,0x59A5,0x62D3, +0x553E,0x6316,0x54C7,0x86D9,0x6D3C,0x5A03,0x74E6,0x889C, +0x6B6A,0x5916,0x8C4C,0x5F2F,0x6E7E,0x73A9,0x987D,0x4E38, +0x70F7,0x5B8C,0x7897,0x633D,0x665A,0x7696,0x60CB,0x5B9B, +0x5A49,0x4E07,0x8155,0x6C6A,0x738B,0x4EA1,0x6789,0x7F51, +0x5F80,0x65FA,0x671B,0x5FD8,0x5984,0x5A01, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5DCD,0x5FAE,0x5371,0x97E6,0x8FDD,0x6845,0x56F4,0x552F, +0x60DF,0x4E3A,0x6F4D,0x7EF4,0x82C7,0x840E,0x59D4,0x4F1F, +0x4F2A,0x5C3E,0x7EAC,0x672A,0x851A,0x5473,0x754F,0x80C3, +0x5582,0x9B4F,0x4F4D,0x6E2D,0x8C13,0x5C09,0x6170,0x536B, +0x761F,0x6E29,0x868A,0x6587,0x95FB,0x7EB9,0x543B,0x7A33, +0x7D0A,0x95EE,0x55E1,0x7FC1,0x74EE,0x631D,0x8717,0x6DA1, +0x7A9D,0x6211,0x65A1,0x5367,0x63E1,0x6C83,0x5DEB,0x545C, +0x94A8,0x4E4C,0x6C61,0x8BEC,0x5C4B,0x65E0,0x829C,0x68A7, +0x543E,0x5434,0x6BCB,0x6B66,0x4E94,0x6342,0x5348,0x821E, +0x4F0D,0x4FAE,0x575E,0x620A,0x96FE,0x6664,0x7269,0x52FF, +0x52A1,0x609F,0x8BEF,0x6614,0x7199,0x6790,0x897F,0x7852, +0x77FD,0x6670,0x563B,0x5438,0x9521,0x727A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7A00,0x606F,0x5E0C,0x6089,0x819D,0x5915,0x60DC,0x7184, +0x70EF,0x6EAA,0x6C50,0x7280,0x6A84,0x88AD,0x5E2D,0x4E60, +0x5AB3,0x559C,0x94E3,0x6D17,0x7CFB,0x9699,0x620F,0x7EC6, +0x778E,0x867E,0x5323,0x971E,0x8F96,0x6687,0x5CE1,0x4FA0, +0x72ED,0x4E0B,0x53A6,0x590F,0x5413,0x6380,0x9528,0x5148, +0x4ED9,0x9C9C,0x7EA4,0x54B8,0x8D24,0x8854,0x8237,0x95F2, +0x6D8E,0x5F26,0x5ACC,0x663E,0x9669,0x73B0,0x732E,0x53BF, +0x817A,0x9985,0x7FA1,0x5BAA,0x9677,0x9650,0x7EBF,0x76F8, +0x53A2,0x9576,0x9999,0x7BB1,0x8944,0x6E58,0x4E61,0x7FD4, +0x7965,0x8BE6,0x60F3,0x54CD,0x4EAB,0x9879,0x5DF7,0x6A61, +0x50CF,0x5411,0x8C61,0x8427,0x785D,0x9704,0x524A,0x54EE, +0x56A3,0x9500,0x6D88,0x5BB5,0x6DC6,0x6653, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5C0F,0x5B5D,0x6821,0x8096,0x5578,0x7B11,0x6548,0x6954, +0x4E9B,0x6B47,0x874E,0x978B,0x534F,0x631F,0x643A,0x90AA, +0x659C,0x80C1,0x8C10,0x5199,0x68B0,0x5378,0x87F9,0x61C8, +0x6CC4,0x6CFB,0x8C22,0x5C51,0x85AA,0x82AF,0x950C,0x6B23, +0x8F9B,0x65B0,0x5FFB,0x5FC3,0x4FE1,0x8845,0x661F,0x8165, +0x7329,0x60FA,0x5174,0x5211,0x578B,0x5F62,0x90A2,0x884C, +0x9192,0x5E78,0x674F,0x6027,0x59D3,0x5144,0x51F6,0x80F8, +0x5308,0x6C79,0x96C4,0x718A,0x4F11,0x4FEE,0x7F9E,0x673D, +0x55C5,0x9508,0x79C0,0x8896,0x7EE3,0x589F,0x620C,0x9700, +0x865A,0x5618,0x987B,0x5F90,0x8BB8,0x84C4,0x9157,0x53D9, +0x65ED,0x5E8F,0x755C,0x6064,0x7D6E,0x5A7F,0x7EEA,0x7EED, +0x8F69,0x55A7,0x5BA3,0x60AC,0x65CB,0x7384, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9009,0x7663,0x7729,0x7EDA,0x9774,0x859B,0x5B66,0x7A74, +0x96EA,0x8840,0x52CB,0x718F,0x5FAA,0x65EC,0x8BE2,0x5BFB, +0x9A6F,0x5DE1,0x6B89,0x6C5B,0x8BAD,0x8BAF,0x900A,0x8FC5, +0x538B,0x62BC,0x9E26,0x9E2D,0x5440,0x4E2B,0x82BD,0x7259, +0x869C,0x5D16,0x8859,0x6DAF,0x96C5,0x54D1,0x4E9A,0x8BB6, +0x7109,0x54BD,0x9609,0x70DF,0x6DF9,0x76D0,0x4E25,0x7814, +0x8712,0x5CA9,0x5EF6,0x8A00,0x989C,0x960E,0x708E,0x6CBF, +0x5944,0x63A9,0x773C,0x884D,0x6F14,0x8273,0x5830,0x71D5, +0x538C,0x781A,0x96C1,0x5501,0x5F66,0x7130,0x5BB4,0x8C1A, +0x9A8C,0x6B83,0x592E,0x9E2F,0x79E7,0x6768,0x626C,0x4F6F, +0x75A1,0x7F8A,0x6D0B,0x9633,0x6C27,0x4EF0,0x75D2,0x517B, +0x6837,0x6F3E,0x9080,0x8170,0x5996,0x7476, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6447,0x5C27,0x9065,0x7A91,0x8C23,0x59DA,0x54AC,0x8200, +0x836F,0x8981,0x8000,0x6930,0x564E,0x8036,0x7237,0x91CE, +0x51B6,0x4E5F,0x9875,0x6396,0x4E1A,0x53F6,0x66F3,0x814B, +0x591C,0x6DB2,0x4E00,0x58F9,0x533B,0x63D6,0x94F1,0x4F9D, +0x4F0A,0x8863,0x9890,0x5937,0x9057,0x79FB,0x4EEA,0x80F0, +0x7591,0x6C82,0x5B9C,0x59E8,0x5F5D,0x6905,0x8681,0x501A, +0x5DF2,0x4E59,0x77E3,0x4EE5,0x827A,0x6291,0x6613,0x9091, +0x5C79,0x4EBF,0x5F79,0x81C6,0x9038,0x8084,0x75AB,0x4EA6, +0x88D4,0x610F,0x6BC5,0x5FC6,0x4E49,0x76CA,0x6EA2,0x8BE3, +0x8BAE,0x8C0A,0x8BD1,0x5F02,0x7FFC,0x7FCC,0x7ECE,0x8335, +0x836B,0x56E0,0x6BB7,0x97F3,0x9634,0x59FB,0x541F,0x94F6, +0x6DEB,0x5BC5,0x996E,0x5C39,0x5F15,0x9690, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5370,0x82F1,0x6A31,0x5A74,0x9E70,0x5E94,0x7F28,0x83B9, +0x8424,0x8425,0x8367,0x8747,0x8FCE,0x8D62,0x76C8,0x5F71, +0x9896,0x786C,0x6620,0x54DF,0x62E5,0x4F63,0x81C3,0x75C8, +0x5EB8,0x96CD,0x8E0A,0x86F9,0x548F,0x6CF3,0x6D8C,0x6C38, +0x607F,0x52C7,0x7528,0x5E7D,0x4F18,0x60A0,0x5FE7,0x5C24, +0x7531,0x90AE,0x94C0,0x72B9,0x6CB9,0x6E38,0x9149,0x6709, +0x53CB,0x53F3,0x4F51,0x91C9,0x8BF1,0x53C8,0x5E7C,0x8FC2, +0x6DE4,0x4E8E,0x76C2,0x6986,0x865E,0x611A,0x8206,0x4F59, +0x4FDE,0x903E,0x9C7C,0x6109,0x6E1D,0x6E14,0x9685,0x4E88, +0x5A31,0x96E8,0x4E0E,0x5C7F,0x79B9,0x5B87,0x8BED,0x7FBD, +0x7389,0x57DF,0x828B,0x90C1,0x5401,0x9047,0x55BB,0x5CEA, +0x5FA1,0x6108,0x6B32,0x72F1,0x80B2,0x8A89, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6D74,0x5BD3,0x88D5,0x9884,0x8C6B,0x9A6D,0x9E33,0x6E0A, +0x51A4,0x5143,0x57A3,0x8881,0x539F,0x63F4,0x8F95,0x56ED, +0x5458,0x5706,0x733F,0x6E90,0x7F18,0x8FDC,0x82D1,0x613F, +0x6028,0x9662,0x66F0,0x7EA6,0x8D8A,0x8DC3,0x94A5,0x5CB3, +0x7CA4,0x6708,0x60A6,0x9605,0x8018,0x4E91,0x90E7,0x5300, +0x9668,0x5141,0x8FD0,0x8574,0x915D,0x6655,0x97F5,0x5B55, +0x531D,0x7838,0x6742,0x683D,0x54C9,0x707E,0x5BB0,0x8F7D, +0x518D,0x5728,0x54B1,0x6512,0x6682,0x8D5E,0x8D43,0x810F, +0x846C,0x906D,0x7CDF,0x51FF,0x85FB,0x67A3,0x65E9,0x6FA1, +0x86A4,0x8E81,0x566A,0x9020,0x7682,0x7076,0x71E5,0x8D23, +0x62E9,0x5219,0x6CFD,0x8D3C,0x600E,0x589E,0x618E,0x66FE, +0x8D60,0x624E,0x55B3,0x6E23,0x672D,0x8F67, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x94E1,0x95F8,0x7728,0x6805,0x69A8,0x548B,0x4E4D,0x70B8, +0x8BC8,0x6458,0x658B,0x5B85,0x7A84,0x503A,0x5BE8,0x77BB, +0x6BE1,0x8A79,0x7C98,0x6CBE,0x76CF,0x65A9,0x8F97,0x5D2D, +0x5C55,0x8638,0x6808,0x5360,0x6218,0x7AD9,0x6E5B,0x7EFD, +0x6A1F,0x7AE0,0x5F70,0x6F33,0x5F20,0x638C,0x6DA8,0x6756, +0x4E08,0x5E10,0x8D26,0x4ED7,0x80C0,0x7634,0x969C,0x62DB, +0x662D,0x627E,0x6CBC,0x8D75,0x7167,0x7F69,0x5146,0x8087, +0x53EC,0x906E,0x6298,0x54F2,0x86F0,0x8F99,0x8005,0x9517, +0x8517,0x8FD9,0x6D59,0x73CD,0x659F,0x771F,0x7504,0x7827, +0x81FB,0x8D1E,0x9488,0x4FA6,0x6795,0x75B9,0x8BCA,0x9707, +0x632F,0x9547,0x9635,0x84B8,0x6323,0x7741,0x5F81,0x72F0, +0x4E89,0x6014,0x6574,0x62EF,0x6B63,0x653F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5E27,0x75C7,0x90D1,0x8BC1,0x829D,0x679D,0x652F,0x5431, +0x8718,0x77E5,0x80A2,0x8102,0x6C41,0x4E4B,0x7EC7,0x804C, +0x76F4,0x690D,0x6B96,0x6267,0x503C,0x4F84,0x5740,0x6307, +0x6B62,0x8DBE,0x53EA,0x65E8,0x7EB8,0x5FD7,0x631A,0x63B7, +0x81F3,0x81F4,0x7F6E,0x5E1C,0x5CD9,0x5236,0x667A,0x79E9, +0x7A1A,0x8D28,0x7099,0x75D4,0x6EDE,0x6CBB,0x7A92,0x4E2D, +0x76C5,0x5FE0,0x949F,0x8877,0x7EC8,0x79CD,0x80BF,0x91CD, +0x4EF2,0x4F17,0x821F,0x5468,0x5DDE,0x6D32,0x8BCC,0x7CA5, +0x8F74,0x8098,0x5E1A,0x5492,0x76B1,0x5B99,0x663C,0x9AA4, +0x73E0,0x682A,0x86DB,0x6731,0x732A,0x8BF8,0x8BDB,0x9010, +0x7AF9,0x70DB,0x716E,0x62C4,0x77A9,0x5631,0x4E3B,0x8457, +0x67F1,0x52A9,0x86C0,0x8D2E,0x94F8,0x7B51, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4F4F,0x6CE8,0x795D,0x9A7B,0x6293,0x722A,0x62FD,0x4E13, +0x7816,0x8F6C,0x64B0,0x8D5A,0x7BC6,0x6869,0x5E84,0x88C5, +0x5986,0x649E,0x58EE,0x72B6,0x690E,0x9525,0x8FFD,0x8D58, +0x5760,0x7F00,0x8C06,0x51C6,0x6349,0x62D9,0x5353,0x684C, +0x7422,0x8301,0x914C,0x5544,0x7740,0x707C,0x6D4A,0x5179, +0x54A8,0x8D44,0x59FF,0x6ECB,0x6DC4,0x5B5C,0x7D2B,0x4ED4, +0x7C7D,0x6ED3,0x5B50,0x81EA,0x6E0D,0x5B57,0x9B03,0x68D5, +0x8E2A,0x5B97,0x7EFC,0x603B,0x7EB5,0x90B9,0x8D70,0x594F, +0x63CD,0x79DF,0x8DB3,0x5352,0x65CF,0x7956,0x8BC5,0x963B, +0x7EC4,0x94BB,0x7E82,0x5634,0x9189,0x6700,0x7F6A,0x5C0A, +0x9075,0x6628,0x5DE6,0x4F50,0x67DE,0x505A,0x4F5C,0x5750, +0x5EA7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4E8D,0x4E0C,0x5140,0x4E10,0x5EFF,0x5345,0x4E15,0x4E98, +0x4E1E,0x9B32,0x5B6C,0x5669,0x4E28,0x79BA,0x4E3F,0x5315, +0x4E47,0x592D,0x723B,0x536E,0x6C10,0x56DF,0x80E4,0x9997, +0x6BD3,0x777E,0x9F17,0x4E36,0x4E9F,0x9F10,0x4E5C,0x4E69, +0x4E93,0x8288,0x5B5B,0x556C,0x560F,0x4EC4,0x538D,0x539D, +0x53A3,0x53A5,0x53AE,0x9765,0x8D5D,0x531A,0x53F5,0x5326, +0x532E,0x533E,0x8D5C,0x5366,0x5363,0x5202,0x5208,0x520E, +0x522D,0x5233,0x523F,0x5240,0x524C,0x525E,0x5261,0x525C, +0x84AF,0x527D,0x5282,0x5281,0x5290,0x5293,0x5182,0x7F54, +0x4EBB,0x4EC3,0x4EC9,0x4EC2,0x4EE8,0x4EE1,0x4EEB,0x4EDE, +0x4F1B,0x4EF3,0x4F22,0x4F64,0x4EF5,0x4F25,0x4F27,0x4F09, +0x4F2B,0x4F5E,0x4F67,0x6538,0x4F5A,0x4F5D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4F5F,0x4F57,0x4F32,0x4F3D,0x4F76,0x4F74,0x4F91,0x4F89, +0x4F83,0x4F8F,0x4F7E,0x4F7B,0x4FAA,0x4F7C,0x4FAC,0x4F94, +0x4FE6,0x4FE8,0x4FEA,0x4FC5,0x4FDA,0x4FE3,0x4FDC,0x4FD1, +0x4FDF,0x4FF8,0x5029,0x504C,0x4FF3,0x502C,0x500F,0x502E, +0x502D,0x4FFE,0x501C,0x500C,0x5025,0x5028,0x507E,0x5043, +0x5055,0x5048,0x504E,0x506C,0x507B,0x50A5,0x50A7,0x50A9, +0x50BA,0x50D6,0x5106,0x50ED,0x50EC,0x50E6,0x50EE,0x5107, +0x510B,0x4EDD,0x6C3D,0x4F58,0x4F65,0x4FCE,0x9FA0,0x6C46, +0x7C74,0x516E,0x5DFD,0x9EC9,0x9998,0x5181,0x5914,0x52F9, +0x530D,0x8A07,0x5310,0x51EB,0x5919,0x5155,0x4EA0,0x5156, +0x4EB3,0x886E,0x88A4,0x4EB5,0x8114,0x88D2,0x7980,0x5B34, +0x8803,0x7FB8,0x51AB,0x51B1,0x51BD,0x51BC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x51C7,0x5196,0x51A2,0x51A5,0x8BA0,0x8BA6,0x8BA7,0x8BAA, +0x8BB4,0x8BB5,0x8BB7,0x8BC2,0x8BC3,0x8BCB,0x8BCF,0x8BCE, +0x8BD2,0x8BD3,0x8BD4,0x8BD6,0x8BD8,0x8BD9,0x8BDC,0x8BDF, +0x8BE0,0x8BE4,0x8BE8,0x8BE9,0x8BEE,0x8BF0,0x8BF3,0x8BF6, +0x8BF9,0x8BFC,0x8BFF,0x8C00,0x8C02,0x8C04,0x8C07,0x8C0C, +0x8C0F,0x8C11,0x8C12,0x8C14,0x8C15,0x8C16,0x8C19,0x8C1B, +0x8C18,0x8C1D,0x8C1F,0x8C20,0x8C21,0x8C25,0x8C27,0x8C2A, +0x8C2B,0x8C2E,0x8C2F,0x8C32,0x8C33,0x8C35,0x8C36,0x5369, +0x537A,0x961D,0x9622,0x9621,0x9631,0x962A,0x963D,0x963C, +0x9642,0x9649,0x9654,0x965F,0x9667,0x966C,0x9672,0x9674, +0x9688,0x968D,0x9697,0x96B0,0x9097,0x909B,0x909D,0x9099, +0x90AC,0x90A1,0x90B4,0x90B3,0x90B6,0x90BA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x90B8,0x90B0,0x90CF,0x90C5,0x90BE,0x90D0,0x90C4,0x90C7, +0x90D3,0x90E6,0x90E2,0x90DC,0x90D7,0x90DB,0x90EB,0x90EF, +0x90FE,0x9104,0x9122,0x911E,0x9123,0x9131,0x912F,0x9139, +0x9143,0x9146,0x520D,0x5942,0x52A2,0x52AC,0x52AD,0x52BE, +0x54FF,0x52D0,0x52D6,0x52F0,0x53DF,0x71EE,0x77CD,0x5EF4, +0x51F5,0x51FC,0x9B2F,0x53B6,0x5F01,0x755A,0x5DEF,0x574C, +0x57A9,0x57A1,0x587E,0x58BC,0x58C5,0x58D1,0x5729,0x572C, +0x572A,0x5733,0x5739,0x572E,0x572F,0x575C,0x573B,0x5742, +0x5769,0x5785,0x576B,0x5786,0x577C,0x577B,0x5768,0x576D, +0x5776,0x5773,0x57AD,0x57A4,0x578C,0x57B2,0x57CF,0x57A7, +0x57B4,0x5793,0x57A0,0x57D5,0x57D8,0x57DA,0x57D9,0x57D2, +0x57B8,0x57F4,0x57EF,0x57F8,0x57E4,0x57DD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x580B,0x580D,0x57FD,0x57ED,0x5800,0x581E,0x5819,0x5844, +0x5820,0x5865,0x586C,0x5881,0x5889,0x589A,0x5880,0x99A8, +0x9F19,0x61FF,0x8279,0x827D,0x827F,0x828F,0x828A,0x82A8, +0x8284,0x828E,0x8291,0x8297,0x8299,0x82AB,0x82B8,0x82BE, +0x82B0,0x82C8,0x82CA,0x82E3,0x8298,0x82B7,0x82AE,0x82CB, +0x82CC,0x82C1,0x82A9,0x82B4,0x82A1,0x82AA,0x829F,0x82C4, +0x82CE,0x82A4,0x82E1,0x8309,0x82F7,0x82E4,0x830F,0x8307, +0x82DC,0x82F4,0x82D2,0x82D8,0x830C,0x82FB,0x82D3,0x8311, +0x831A,0x8306,0x8314,0x8315,0x82E0,0x82D5,0x831C,0x8351, +0x835B,0x835C,0x8308,0x8392,0x833C,0x8334,0x8331,0x839B, +0x835E,0x832F,0x834F,0x8347,0x8343,0x835F,0x8340,0x8317, +0x8360,0x832D,0x833A,0x8333,0x8366,0x8365, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8368,0x831B,0x8369,0x836C,0x836A,0x836D,0x836E,0x83B0, +0x8378,0x83B3,0x83B4,0x83A0,0x83AA,0x8393,0x839C,0x8385, +0x837C,0x83B6,0x83A9,0x837D,0x83B8,0x837B,0x8398,0x839E, +0x83A8,0x83BA,0x83BC,0x83C1,0x8401,0x83E5,0x83D8,0x5807, +0x8418,0x840B,0x83DD,0x83FD,0x83D6,0x841C,0x8438,0x8411, +0x8406,0x83D4,0x83DF,0x840F,0x8403,0x83F8,0x83F9,0x83EA, +0x83C5,0x83C0,0x8426,0x83F0,0x83E1,0x845C,0x8451,0x845A, +0x8459,0x8473,0x8487,0x8488,0x847A,0x8489,0x8478,0x843C, +0x8446,0x8469,0x8476,0x848C,0x848E,0x8431,0x846D,0x84C1, +0x84CD,0x84D0,0x84E6,0x84BD,0x84D3,0x84CA,0x84BF,0x84BA, +0x84E0,0x84A1,0x84B9,0x84B4,0x8497,0x84E5,0x84E3,0x850C, +0x750D,0x8538,0x84F0,0x8539,0x851F,0x853A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8556,0x853B,0x84FF,0x84FC,0x8559,0x8548,0x8568,0x8564, +0x855E,0x857A,0x77A2,0x8543,0x8572,0x857B,0x85A4,0x85A8, +0x8587,0x858F,0x8579,0x85AE,0x859C,0x8585,0x85B9,0x85B7, +0x85B0,0x85D3,0x85C1,0x85DC,0x85FF,0x8627,0x8605,0x8629, +0x8616,0x863C,0x5EFE,0x5F08,0x593C,0x5941,0x8037,0x5955, +0x595A,0x5958,0x530F,0x5C22,0x5C25,0x5C2C,0x5C34,0x624C, +0x626A,0x629F,0x62BB,0x62CA,0x62DA,0x62D7,0x62EE,0x6322, +0x62F6,0x6339,0x634B,0x6343,0x63AD,0x63F6,0x6371,0x637A, +0x638E,0x63B4,0x636D,0x63AC,0x638A,0x6369,0x63AE,0x63BC, +0x63F2,0x63F8,0x63E0,0x63FF,0x63C4,0x63DE,0x63CE,0x6452, +0x63C6,0x63BE,0x6445,0x6441,0x640B,0x641B,0x6420,0x640C, +0x6426,0x6421,0x645E,0x6484,0x646D,0x6496, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x647A,0x64B7,0x64B8,0x6499,0x64BA,0x64C0,0x64D0,0x64D7, +0x64E4,0x64E2,0x6509,0x6525,0x652E,0x5F0B,0x5FD2,0x7519, +0x5F11,0x535F,0x53F1,0x53FD,0x53E9,0x53E8,0x53FB,0x5412, +0x5416,0x5406,0x544B,0x5452,0x5453,0x5454,0x5456,0x5443, +0x5421,0x5457,0x5459,0x5423,0x5432,0x5482,0x5494,0x5477, +0x5471,0x5464,0x549A,0x549B,0x5484,0x5476,0x5466,0x549D, +0x54D0,0x54AD,0x54C2,0x54B4,0x54D2,0x54A7,0x54A6,0x54D3, +0x54D4,0x5472,0x54A3,0x54D5,0x54BB,0x54BF,0x54CC,0x54D9, +0x54DA,0x54DC,0x54A9,0x54AA,0x54A4,0x54DD,0x54CF,0x54DE, +0x551B,0x54E7,0x5520,0x54FD,0x5514,0x54F3,0x5522,0x5523, +0x550F,0x5511,0x5527,0x552A,0x5567,0x558F,0x55B5,0x5549, +0x556D,0x5541,0x5555,0x553F,0x5550,0x553C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5537,0x5556,0x5575,0x5576,0x5577,0x5533,0x5530,0x555C, +0x558B,0x55D2,0x5583,0x55B1,0x55B9,0x5588,0x5581,0x559F, +0x557E,0x55D6,0x5591,0x557B,0x55DF,0x55BD,0x55BE,0x5594, +0x5599,0x55EA,0x55F7,0x55C9,0x561F,0x55D1,0x55EB,0x55EC, +0x55D4,0x55E6,0x55DD,0x55C4,0x55EF,0x55E5,0x55F2,0x55F3, +0x55CC,0x55CD,0x55E8,0x55F5,0x55E4,0x8F94,0x561E,0x5608, +0x560C,0x5601,0x5624,0x5623,0x55FE,0x5600,0x5627,0x562D, +0x5658,0x5639,0x5657,0x562C,0x564D,0x5662,0x5659,0x565C, +0x564C,0x5654,0x5686,0x5664,0x5671,0x566B,0x567B,0x567C, +0x5685,0x5693,0x56AF,0x56D4,0x56D7,0x56DD,0x56E1,0x56F5, +0x56EB,0x56F9,0x56FF,0x5704,0x570A,0x5709,0x571C,0x5E0F, +0x5E19,0x5E14,0x5E11,0x5E31,0x5E3B,0x5E3C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5E37,0x5E44,0x5E54,0x5E5B,0x5E5E,0x5E61,0x5C8C,0x5C7A, +0x5C8D,0x5C90,0x5C96,0x5C88,0x5C98,0x5C99,0x5C91,0x5C9A, +0x5C9C,0x5CB5,0x5CA2,0x5CBD,0x5CAC,0x5CAB,0x5CB1,0x5CA3, +0x5CC1,0x5CB7,0x5CC4,0x5CD2,0x5CE4,0x5CCB,0x5CE5,0x5D02, +0x5D03,0x5D27,0x5D26,0x5D2E,0x5D24,0x5D1E,0x5D06,0x5D1B, +0x5D58,0x5D3E,0x5D34,0x5D3D,0x5D6C,0x5D5B,0x5D6F,0x5D5D, +0x5D6B,0x5D4B,0x5D4A,0x5D69,0x5D74,0x5D82,0x5D99,0x5D9D, +0x8C73,0x5DB7,0x5DC5,0x5F73,0x5F77,0x5F82,0x5F87,0x5F89, +0x5F8C,0x5F95,0x5F99,0x5F9C,0x5FA8,0x5FAD,0x5FB5,0x5FBC, +0x8862,0x5F61,0x72AD,0x72B0,0x72B4,0x72B7,0x72B8,0x72C3, +0x72C1,0x72CE,0x72CD,0x72D2,0x72E8,0x72EF,0x72E9,0x72F2, +0x72F4,0x72F7,0x7301,0x72F3,0x7303,0x72FA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x72FB,0x7317,0x7313,0x7321,0x730A,0x731E,0x731D,0x7315, +0x7322,0x7339,0x7325,0x732C,0x7338,0x7331,0x7350,0x734D, +0x7357,0x7360,0x736C,0x736F,0x737E,0x821B,0x5925,0x98E7, +0x5924,0x5902,0x9963,0x9967,0x9968,0x9969,0x996A,0x996B, +0x996C,0x9974,0x9977,0x997D,0x9980,0x9984,0x9987,0x998A, +0x998D,0x9990,0x9991,0x9993,0x9994,0x9995,0x5E80,0x5E91, +0x5E8B,0x5E96,0x5EA5,0x5EA0,0x5EB9,0x5EB5,0x5EBE,0x5EB3, +0x8D53,0x5ED2,0x5ED1,0x5EDB,0x5EE8,0x5EEA,0x81BA,0x5FC4, +0x5FC9,0x5FD6,0x5FCF,0x6003,0x5FEE,0x6004,0x5FE1,0x5FE4, +0x5FFE,0x6005,0x6006,0x5FEA,0x5FED,0x5FF8,0x6019,0x6035, +0x6026,0x601B,0x600F,0x600D,0x6029,0x602B,0x600A,0x603F, +0x6021,0x6078,0x6079,0x607B,0x607A,0x6042, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x606A,0x607D,0x6096,0x609A,0x60AD,0x609D,0x6083,0x6092, +0x608C,0x609B,0x60EC,0x60BB,0x60B1,0x60DD,0x60D8,0x60C6, +0x60DA,0x60B4,0x6120,0x6126,0x6115,0x6123,0x60F4,0x6100, +0x610E,0x612B,0x614A,0x6175,0x61AC,0x6194,0x61A7,0x61B7, +0x61D4,0x61F5,0x5FDD,0x96B3,0x95E9,0x95EB,0x95F1,0x95F3, +0x95F5,0x95F6,0x95FC,0x95FE,0x9603,0x9604,0x9606,0x9608, +0x960A,0x960B,0x960C,0x960D,0x960F,0x9612,0x9615,0x9616, +0x9617,0x9619,0x961A,0x4E2C,0x723F,0x6215,0x6C35,0x6C54, +0x6C5C,0x6C4A,0x6CA3,0x6C85,0x6C90,0x6C94,0x6C8C,0x6C68, +0x6C69,0x6C74,0x6C76,0x6C86,0x6CA9,0x6CD0,0x6CD4,0x6CAD, +0x6CF7,0x6CF8,0x6CF1,0x6CD7,0x6CB2,0x6CE0,0x6CD6,0x6CFA, +0x6CEB,0x6CEE,0x6CB1,0x6CD3,0x6CEF,0x6CFE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6D39,0x6D27,0x6D0C,0x6D43,0x6D48,0x6D07,0x6D04,0x6D19, +0x6D0E,0x6D2B,0x6D4D,0x6D2E,0x6D35,0x6D1A,0x6D4F,0x6D52, +0x6D54,0x6D33,0x6D91,0x6D6F,0x6D9E,0x6DA0,0x6D5E,0x6D93, +0x6D94,0x6D5C,0x6D60,0x6D7C,0x6D63,0x6E1A,0x6DC7,0x6DC5, +0x6DDE,0x6E0E,0x6DBF,0x6DE0,0x6E11,0x6DE6,0x6DDD,0x6DD9, +0x6E16,0x6DAB,0x6E0C,0x6DAE,0x6E2B,0x6E6E,0x6E4E,0x6E6B, +0x6EB2,0x6E5F,0x6E86,0x6E53,0x6E54,0x6E32,0x6E25,0x6E44, +0x6EDF,0x6EB1,0x6E98,0x6EE0,0x6F2D,0x6EE2,0x6EA5,0x6EA7, +0x6EBD,0x6EBB,0x6EB7,0x6ED7,0x6EB4,0x6ECF,0x6E8F,0x6EC2, +0x6E9F,0x6F62,0x6F46,0x6F47,0x6F24,0x6F15,0x6EF9,0x6F2F, +0x6F36,0x6F4B,0x6F74,0x6F2A,0x6F09,0x6F29,0x6F89,0x6F8D, +0x6F8C,0x6F78,0x6F72,0x6F7C,0x6F7A,0x6FD1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6FC9,0x6FA7,0x6FB9,0x6FB6,0x6FC2,0x6FE1,0x6FEE,0x6FDE, +0x6FE0,0x6FEF,0x701A,0x7023,0x701B,0x7039,0x7035,0x704F, +0x705E,0x5B80,0x5B84,0x5B95,0x5B93,0x5BA5,0x5BB8,0x752F, +0x9A9E,0x6434,0x5BE4,0x5BEE,0x8930,0x5BF0,0x8E47,0x8B07, +0x8FB6,0x8FD3,0x8FD5,0x8FE5,0x8FEE,0x8FE4,0x8FE9,0x8FE6, +0x8FF3,0x8FE8,0x9005,0x9004,0x900B,0x9026,0x9011,0x900D, +0x9016,0x9021,0x9035,0x9036,0x902D,0x902F,0x9044,0x9051, +0x9052,0x9050,0x9068,0x9058,0x9062,0x905B,0x66B9,0x9074, +0x907D,0x9082,0x9088,0x9083,0x908B,0x5F50,0x5F57,0x5F56, +0x5F58,0x5C3B,0x54AB,0x5C50,0x5C59,0x5B71,0x5C63,0x5C66, +0x7FBC,0x5F2A,0x5F29,0x5F2D,0x8274,0x5F3C,0x9B3B,0x5C6E, +0x5981,0x5983,0x598D,0x59A9,0x59AA,0x59A3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5997,0x59CA,0x59AB,0x599E,0x59A4,0x59D2,0x59B2,0x59AF, +0x59D7,0x59BE,0x5A05,0x5A06,0x59DD,0x5A08,0x59E3,0x59D8, +0x59F9,0x5A0C,0x5A09,0x5A32,0x5A34,0x5A11,0x5A23,0x5A13, +0x5A40,0x5A67,0x5A4A,0x5A55,0x5A3C,0x5A62,0x5A75,0x80EC, +0x5AAA,0x5A9B,0x5A77,0x5A7A,0x5ABE,0x5AEB,0x5AB2,0x5AD2, +0x5AD4,0x5AB8,0x5AE0,0x5AE3,0x5AF1,0x5AD6,0x5AE6,0x5AD8, +0x5ADC,0x5B09,0x5B17,0x5B16,0x5B32,0x5B37,0x5B40,0x5C15, +0x5C1C,0x5B5A,0x5B65,0x5B73,0x5B51,0x5B53,0x5B62,0x9A75, +0x9A77,0x9A78,0x9A7A,0x9A7F,0x9A7D,0x9A80,0x9A81,0x9A85, +0x9A88,0x9A8A,0x9A90,0x9A92,0x9A93,0x9A96,0x9A98,0x9A9B, +0x9A9C,0x9A9D,0x9A9F,0x9AA0,0x9AA2,0x9AA3,0x9AA5,0x9AA7, +0x7E9F,0x7EA1,0x7EA3,0x7EA5,0x7EA8,0x7EA9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7EAD,0x7EB0,0x7EBE,0x7EC0,0x7EC1,0x7EC2,0x7EC9,0x7ECB, +0x7ECC,0x7ED0,0x7ED4,0x7ED7,0x7EDB,0x7EE0,0x7EE1,0x7EE8, +0x7EEB,0x7EEE,0x7EEF,0x7EF1,0x7EF2,0x7F0D,0x7EF6,0x7EFA, +0x7EFB,0x7EFE,0x7F01,0x7F02,0x7F03,0x7F07,0x7F08,0x7F0B, +0x7F0C,0x7F0F,0x7F11,0x7F12,0x7F17,0x7F19,0x7F1C,0x7F1B, +0x7F1F,0x7F21,0x7F22,0x7F23,0x7F24,0x7F25,0x7F26,0x7F27, +0x7F2A,0x7F2B,0x7F2C,0x7F2D,0x7F2F,0x7F30,0x7F31,0x7F32, +0x7F33,0x7F35,0x5E7A,0x757F,0x5DDB,0x753E,0x9095,0x738E, +0x7391,0x73AE,0x73A2,0x739F,0x73CF,0x73C2,0x73D1,0x73B7, +0x73B3,0x73C0,0x73C9,0x73C8,0x73E5,0x73D9,0x987C,0x740A, +0x73E9,0x73E7,0x73DE,0x73BA,0x73F2,0x740F,0x742A,0x745B, +0x7426,0x7425,0x7428,0x7430,0x742E,0x742C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x741B,0x741A,0x7441,0x745C,0x7457,0x7455,0x7459,0x7477, +0x746D,0x747E,0x749C,0x748E,0x7480,0x7481,0x7487,0x748B, +0x749E,0x74A8,0x74A9,0x7490,0x74A7,0x74D2,0x74BA,0x97EA, +0x97EB,0x97EC,0x674C,0x6753,0x675E,0x6748,0x6769,0x67A5, +0x6787,0x676A,0x6773,0x6798,0x67A7,0x6775,0x67A8,0x679E, +0x67AD,0x678B,0x6777,0x677C,0x67F0,0x6809,0x67D8,0x680A, +0x67E9,0x67B0,0x680C,0x67D9,0x67B5,0x67DA,0x67B3,0x67DD, +0x6800,0x67C3,0x67B8,0x67E2,0x680E,0x67C1,0x67FD,0x6832, +0x6833,0x6860,0x6861,0x684E,0x6862,0x6844,0x6864,0x6883, +0x681D,0x6855,0x6866,0x6841,0x6867,0x6840,0x683E,0x684A, +0x6849,0x6829,0x68B5,0x688F,0x6874,0x6877,0x6893,0x686B, +0x68C2,0x696E,0x68FC,0x691F,0x6920,0x68F9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6924,0x68F0,0x690B,0x6901,0x6957,0x68E3,0x6910,0x6971, +0x6939,0x6960,0x6942,0x695D,0x6984,0x696B,0x6980,0x6998, +0x6978,0x6934,0x69CC,0x6987,0x6988,0x69CE,0x6989,0x6966, +0x6963,0x6979,0x699B,0x69A7,0x69BB,0x69AB,0x69AD,0x69D4, +0x69B1,0x69C1,0x69CA,0x69DF,0x6995,0x69E0,0x698D,0x69FF, +0x6A2F,0x69ED,0x6A17,0x6A18,0x6A65,0x69F2,0x6A44,0x6A3E, +0x6AA0,0x6A50,0x6A5B,0x6A35,0x6A8E,0x6A79,0x6A3D,0x6A28, +0x6A58,0x6A7C,0x6A91,0x6A90,0x6AA9,0x6A97,0x6AAB,0x7337, +0x7352,0x6B81,0x6B82,0x6B87,0x6B84,0x6B92,0x6B93,0x6B8D, +0x6B9A,0x6B9B,0x6BA1,0x6BAA,0x8F6B,0x8F6D,0x8F71,0x8F72, +0x8F73,0x8F75,0x8F76,0x8F78,0x8F77,0x8F79,0x8F7A,0x8F7C, +0x8F7E,0x8F81,0x8F82,0x8F84,0x8F87,0x8F8B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8F8D,0x8F8E,0x8F8F,0x8F98,0x8F9A,0x8ECE,0x620B,0x6217, +0x621B,0x621F,0x6222,0x6221,0x6225,0x6224,0x622C,0x81E7, +0x74EF,0x74F4,0x74FF,0x750F,0x7511,0x7513,0x6534,0x65EE, +0x65EF,0x65F0,0x660A,0x6619,0x6772,0x6603,0x6615,0x6600, +0x7085,0x66F7,0x661D,0x6634,0x6631,0x6636,0x6635,0x8006, +0x665F,0x6654,0x6641,0x664F,0x6656,0x6661,0x6657,0x6677, +0x6684,0x668C,0x66A7,0x669D,0x66BE,0x66DB,0x66DC,0x66E6, +0x66E9,0x8D32,0x8D33,0x8D36,0x8D3B,0x8D3D,0x8D40,0x8D45, +0x8D46,0x8D48,0x8D49,0x8D47,0x8D4D,0x8D55,0x8D59,0x89C7, +0x89CA,0x89CB,0x89CC,0x89CE,0x89CF,0x89D0,0x89D1,0x726E, +0x729F,0x725D,0x7266,0x726F,0x727E,0x727F,0x7284,0x728B, +0x728D,0x728F,0x7292,0x6308,0x6332,0x63B0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x643F,0x64D8,0x8004,0x6BEA,0x6BF3,0x6BFD,0x6BF5,0x6BF9, +0x6C05,0x6C07,0x6C06,0x6C0D,0x6C15,0x6C18,0x6C19,0x6C1A, +0x6C21,0x6C29,0x6C24,0x6C2A,0x6C32,0x6535,0x6555,0x656B, +0x724D,0x7252,0x7256,0x7230,0x8662,0x5216,0x809F,0x809C, +0x8093,0x80BC,0x670A,0x80BD,0x80B1,0x80AB,0x80AD,0x80B4, +0x80B7,0x80E7,0x80E8,0x80E9,0x80EA,0x80DB,0x80C2,0x80C4, +0x80D9,0x80CD,0x80D7,0x6710,0x80DD,0x80EB,0x80F1,0x80F4, +0x80ED,0x810D,0x810E,0x80F2,0x80FC,0x6715,0x8112,0x8C5A, +0x8136,0x811E,0x812C,0x8118,0x8132,0x8148,0x814C,0x8153, +0x8174,0x8159,0x815A,0x8171,0x8160,0x8169,0x817C,0x817D, +0x816D,0x8167,0x584D,0x5AB5,0x8188,0x8182,0x8191,0x6ED5, +0x81A3,0x81AA,0x81CC,0x6726,0x81CA,0x81BB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81C1,0x81A6,0x6B24,0x6B37,0x6B39,0x6B43,0x6B46,0x6B59, +0x98D1,0x98D2,0x98D3,0x98D5,0x98D9,0x98DA,0x6BB3,0x5F40, +0x6BC2,0x89F3,0x6590,0x9F51,0x6593,0x65BC,0x65C6,0x65C4, +0x65C3,0x65CC,0x65CE,0x65D2,0x65D6,0x7080,0x709C,0x7096, +0x709D,0x70BB,0x70C0,0x70B7,0x70AB,0x70B1,0x70E8,0x70CA, +0x7110,0x7113,0x7116,0x712F,0x7131,0x7173,0x715C,0x7168, +0x7145,0x7172,0x714A,0x7178,0x717A,0x7198,0x71B3,0x71B5, +0x71A8,0x71A0,0x71E0,0x71D4,0x71E7,0x71F9,0x721D,0x7228, +0x706C,0x7118,0x7166,0x71B9,0x623E,0x623D,0x6243,0x6248, +0x6249,0x793B,0x7940,0x7946,0x7949,0x795B,0x795C,0x7953, +0x795A,0x7962,0x7957,0x7960,0x796F,0x7967,0x797A,0x7985, +0x798A,0x799A,0x79A7,0x79B3,0x5FD1,0x5FD0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x603C,0x605D,0x605A,0x6067,0x6041,0x6059,0x6063,0x60AB, +0x6106,0x610D,0x615D,0x61A9,0x619D,0x61CB,0x61D1,0x6206, +0x8080,0x807F,0x6C93,0x6CF6,0x6DFC,0x77F6,0x77F8,0x7800, +0x7809,0x7817,0x7818,0x7811,0x65AB,0x782D,0x781C,0x781D, +0x7839,0x783A,0x783B,0x781F,0x783C,0x7825,0x782C,0x7823, +0x7829,0x784E,0x786D,0x7856,0x7857,0x7826,0x7850,0x7847, +0x784C,0x786A,0x789B,0x7893,0x789A,0x7887,0x789C,0x78A1, +0x78A3,0x78B2,0x78B9,0x78A5,0x78D4,0x78D9,0x78C9,0x78EC, +0x78F2,0x7905,0x78F4,0x7913,0x7924,0x791E,0x7934,0x9F9B, +0x9EF9,0x9EFB,0x9EFC,0x76F1,0x7704,0x770D,0x76F9,0x7707, +0x7708,0x771A,0x7722,0x7719,0x772D,0x7726,0x7735,0x7738, +0x7750,0x7751,0x7747,0x7743,0x775A,0x7768, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7762,0x7765,0x777F,0x778D,0x777D,0x7780,0x778C,0x7791, +0x779F,0x77A0,0x77B0,0x77B5,0x77BD,0x753A,0x7540,0x754E, +0x754B,0x7548,0x755B,0x7572,0x7579,0x7583,0x7F58,0x7F61, +0x7F5F,0x8A48,0x7F68,0x7F74,0x7F71,0x7F79,0x7F81,0x7F7E, +0x76CD,0x76E5,0x8832,0x9485,0x9486,0x9487,0x948B,0x948A, +0x948C,0x948D,0x948F,0x9490,0x9494,0x9497,0x9495,0x949A, +0x949B,0x949C,0x94A3,0x94A4,0x94AB,0x94AA,0x94AD,0x94AC, +0x94AF,0x94B0,0x94B2,0x94B4,0x94B6,0x94B7,0x94B8,0x94B9, +0x94BA,0x94BC,0x94BD,0x94BF,0x94C4,0x94C8,0x94C9,0x94CA, +0x94CB,0x94CC,0x94CD,0x94CE,0x94D0,0x94D1,0x94D2,0x94D5, +0x94D6,0x94D7,0x94D9,0x94D8,0x94DB,0x94DE,0x94DF,0x94E0, +0x94E2,0x94E4,0x94E5,0x94E7,0x94E8,0x94EA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x94E9,0x94EB,0x94EE,0x94EF,0x94F3,0x94F4,0x94F5,0x94F7, +0x94F9,0x94FC,0x94FD,0x94FF,0x9503,0x9502,0x9506,0x9507, +0x9509,0x950A,0x950D,0x950E,0x950F,0x9512,0x9513,0x9514, +0x9515,0x9516,0x9518,0x951B,0x951D,0x951E,0x951F,0x9522, +0x952A,0x952B,0x9529,0x952C,0x9531,0x9532,0x9534,0x9536, +0x9537,0x9538,0x953C,0x953E,0x953F,0x9542,0x9535,0x9544, +0x9545,0x9546,0x9549,0x954C,0x954E,0x954F,0x9552,0x9553, +0x9554,0x9556,0x9557,0x9558,0x9559,0x955B,0x955E,0x955F, +0x955D,0x9561,0x9562,0x9564,0x9565,0x9566,0x9567,0x9568, +0x9569,0x956A,0x956B,0x956C,0x956F,0x9571,0x9572,0x9573, +0x953A,0x77E7,0x77EC,0x96C9,0x79D5,0x79ED,0x79E3,0x79EB, +0x7A06,0x5D47,0x7A03,0x7A02,0x7A1E,0x7A14, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7A39,0x7A37,0x7A51,0x9ECF,0x99A5,0x7A70,0x7688,0x768E, +0x7693,0x7699,0x76A4,0x74DE,0x74E0,0x752C,0x9E20,0x9E22, +0x9E28,0x9E29,0x9E2A,0x9E2B,0x9E2C,0x9E32,0x9E31,0x9E36, +0x9E38,0x9E37,0x9E39,0x9E3A,0x9E3E,0x9E41,0x9E42,0x9E44, +0x9E46,0x9E47,0x9E48,0x9E49,0x9E4B,0x9E4C,0x9E4E,0x9E51, +0x9E55,0x9E57,0x9E5A,0x9E5B,0x9E5C,0x9E5E,0x9E63,0x9E66, +0x9E67,0x9E68,0x9E69,0x9E6A,0x9E6B,0x9E6C,0x9E71,0x9E6D, +0x9E73,0x7592,0x7594,0x7596,0x75A0,0x759D,0x75AC,0x75A3, +0x75B3,0x75B4,0x75B8,0x75C4,0x75B1,0x75B0,0x75C3,0x75C2, +0x75D6,0x75CD,0x75E3,0x75E8,0x75E6,0x75E4,0x75EB,0x75E7, +0x7603,0x75F1,0x75FC,0x75FF,0x7610,0x7600,0x7605,0x760C, +0x7617,0x760A,0x7625,0x7618,0x7615,0x7619, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x761B,0x763C,0x7622,0x7620,0x7640,0x762D,0x7630,0x763F, +0x7635,0x7643,0x763E,0x7633,0x764D,0x765E,0x7654,0x765C, +0x7656,0x766B,0x766F,0x7FCA,0x7AE6,0x7A78,0x7A79,0x7A80, +0x7A86,0x7A88,0x7A95,0x7AA6,0x7AA0,0x7AAC,0x7AA8,0x7AAD, +0x7AB3,0x8864,0x8869,0x8872,0x887D,0x887F,0x8882,0x88A2, +0x88C6,0x88B7,0x88BC,0x88C9,0x88E2,0x88CE,0x88E3,0x88E5, +0x88F1,0x891A,0x88FC,0x88E8,0x88FE,0x88F0,0x8921,0x8919, +0x8913,0x891B,0x890A,0x8934,0x892B,0x8936,0x8941,0x8966, +0x897B,0x758B,0x80E5,0x76B2,0x76B4,0x77DC,0x8012,0x8014, +0x8016,0x801C,0x8020,0x8022,0x8025,0x8026,0x8027,0x8029, +0x8028,0x8031,0x800B,0x8035,0x8043,0x8046,0x804D,0x8052, +0x8069,0x8071,0x8983,0x9878,0x9880,0x9883, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9889,0x988C,0x988D,0x988F,0x9894,0x989A,0x989B,0x989E, +0x989F,0x98A1,0x98A2,0x98A5,0x98A6,0x864D,0x8654,0x866C, +0x866E,0x867F,0x867A,0x867C,0x867B,0x86A8,0x868D,0x868B, +0x86AC,0x869D,0x86A7,0x86A3,0x86AA,0x8693,0x86A9,0x86B6, +0x86C4,0x86B5,0x86CE,0x86B0,0x86BA,0x86B1,0x86AF,0x86C9, +0x86CF,0x86B4,0x86E9,0x86F1,0x86F2,0x86ED,0x86F3,0x86D0, +0x8713,0x86DE,0x86F4,0x86DF,0x86D8,0x86D1,0x8703,0x8707, +0x86F8,0x8708,0x870A,0x870D,0x8709,0x8723,0x873B,0x871E, +0x8725,0x872E,0x871A,0x873E,0x8748,0x8734,0x8731,0x8729, +0x8737,0x873F,0x8782,0x8722,0x877D,0x877E,0x877B,0x8760, +0x8770,0x874C,0x876E,0x878B,0x8753,0x8763,0x877C,0x8764, +0x8759,0x8765,0x8793,0x87AF,0x87A8,0x87D2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x87C6,0x8788,0x8785,0x87AD,0x8797,0x8783,0x87AB,0x87E5, +0x87AC,0x87B5,0x87B3,0x87CB,0x87D3,0x87BD,0x87D1,0x87C0, +0x87CA,0x87DB,0x87EA,0x87E0,0x87EE,0x8816,0x8813,0x87FE, +0x880A,0x881B,0x8821,0x8839,0x883C,0x7F36,0x7F42,0x7F44, +0x7F45,0x8210,0x7AFA,0x7AFD,0x7B08,0x7B03,0x7B04,0x7B15, +0x7B0A,0x7B2B,0x7B0F,0x7B47,0x7B38,0x7B2A,0x7B19,0x7B2E, +0x7B31,0x7B20,0x7B25,0x7B24,0x7B33,0x7B3E,0x7B1E,0x7B58, +0x7B5A,0x7B45,0x7B75,0x7B4C,0x7B5D,0x7B60,0x7B6E,0x7B7B, +0x7B62,0x7B72,0x7B71,0x7B90,0x7BA6,0x7BA7,0x7BB8,0x7BAC, +0x7B9D,0x7BA8,0x7B85,0x7BAA,0x7B9C,0x7BA2,0x7BAB,0x7BB4, +0x7BD1,0x7BC1,0x7BCC,0x7BDD,0x7BDA,0x7BE5,0x7BE6,0x7BEA, +0x7C0C,0x7BFE,0x7BFC,0x7C0F,0x7C16,0x7C0B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7C1F,0x7C2A,0x7C26,0x7C38,0x7C41,0x7C40,0x81FE,0x8201, +0x8202,0x8204,0x81EC,0x8844,0x8221,0x8222,0x8223,0x822D, +0x822F,0x8228,0x822B,0x8238,0x823B,0x8233,0x8234,0x823E, +0x8244,0x8249,0x824B,0x824F,0x825A,0x825F,0x8268,0x887E, +0x8885,0x8888,0x88D8,0x88DF,0x895E,0x7F9D,0x7F9F,0x7FA7, +0x7FAF,0x7FB0,0x7FB2,0x7C7C,0x6549,0x7C91,0x7C9D,0x7C9C, +0x7C9E,0x7CA2,0x7CB2,0x7CBC,0x7CBD,0x7CC1,0x7CC7,0x7CCC, +0x7CCD,0x7CC8,0x7CC5,0x7CD7,0x7CE8,0x826E,0x66A8,0x7FBF, +0x7FCE,0x7FD5,0x7FE5,0x7FE1,0x7FE6,0x7FE9,0x7FEE,0x7FF3, +0x7CF8,0x7D77,0x7DA6,0x7DAE,0x7E47,0x7E9B,0x9EB8,0x9EB4, +0x8D73,0x8D84,0x8D94,0x8D91,0x8DB1,0x8D67,0x8D6D,0x8C47, +0x8C49,0x914A,0x9150,0x914E,0x914F,0x9164, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9162,0x9161,0x9170,0x9169,0x916F,0x917D,0x917E,0x9172, +0x9174,0x9179,0x918C,0x9185,0x9190,0x918D,0x9191,0x91A2, +0x91A3,0x91AA,0x91AD,0x91AE,0x91AF,0x91B5,0x91B4,0x91BA, +0x8C55,0x9E7E,0x8DB8,0x8DEB,0x8E05,0x8E59,0x8E69,0x8DB5, +0x8DBF,0x8DBC,0x8DBA,0x8DC4,0x8DD6,0x8DD7,0x8DDA,0x8DDE, +0x8DCE,0x8DCF,0x8DDB,0x8DC6,0x8DEC,0x8DF7,0x8DF8,0x8DE3, +0x8DF9,0x8DFB,0x8DE4,0x8E09,0x8DFD,0x8E14,0x8E1D,0x8E1F, +0x8E2C,0x8E2E,0x8E23,0x8E2F,0x8E3A,0x8E40,0x8E39,0x8E35, +0x8E3D,0x8E31,0x8E49,0x8E41,0x8E42,0x8E51,0x8E52,0x8E4A, +0x8E70,0x8E76,0x8E7C,0x8E6F,0x8E74,0x8E85,0x8E8F,0x8E94, +0x8E90,0x8E9C,0x8E9E,0x8C78,0x8C82,0x8C8A,0x8C85,0x8C98, +0x8C94,0x659B,0x89D6,0x89DE,0x89DA,0x89DC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x89E5,0x89EB,0x89EF,0x8A3E,0x8B26,0x9753,0x96E9,0x96F3, +0x96EF,0x9706,0x9701,0x9708,0x970F,0x970E,0x972A,0x972D, +0x9730,0x973E,0x9F80,0x9F83,0x9F85,0x9F86,0x9F87,0x9F88, +0x9F89,0x9F8A,0x9F8C,0x9EFE,0x9F0B,0x9F0D,0x96B9,0x96BC, +0x96BD,0x96CE,0x96D2,0x77BF,0x96E0,0x928E,0x92AE,0x92C8, +0x933E,0x936A,0x93CA,0x938F,0x943E,0x946B,0x9C7F,0x9C82, +0x9C85,0x9C86,0x9C87,0x9C88,0x7A23,0x9C8B,0x9C8E,0x9C90, +0x9C91,0x9C92,0x9C94,0x9C95,0x9C9A,0x9C9B,0x9C9E,0x9C9F, +0x9CA0,0x9CA1,0x9CA2,0x9CA3,0x9CA5,0x9CA6,0x9CA7,0x9CA8, +0x9CA9,0x9CAB,0x9CAD,0x9CAE,0x9CB0,0x9CB1,0x9CB2,0x9CB3, +0x9CB4,0x9CB5,0x9CB6,0x9CB7,0x9CBA,0x9CBB,0x9CBC,0x9CBD, +0x9CC4,0x9CC5,0x9CC6,0x9CC7,0x9CCA,0x9CCB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9CCC,0x9CCD,0x9CCE,0x9CCF,0x9CD0,0x9CD3,0x9CD4,0x9CD5, +0x9CD7,0x9CD8,0x9CD9,0x9CDC,0x9CDD,0x9CDF,0x9CE2,0x977C, +0x9785,0x9791,0x9792,0x9794,0x97AF,0x97AB,0x97A3,0x97B2, +0x97B4,0x9AB1,0x9AB0,0x9AB7,0x9E58,0x9AB6,0x9ABA,0x9ABC, +0x9AC1,0x9AC0,0x9AC5,0x9AC2,0x9ACB,0x9ACC,0x9AD1,0x9B45, +0x9B43,0x9B47,0x9B49,0x9B48,0x9B4D,0x9B51,0x98E8,0x990D, +0x992E,0x9955,0x9954,0x9ADF,0x9AE1,0x9AE6,0x9AEF,0x9AEB, +0x9AFB,0x9AED,0x9AF9,0x9B08,0x9B0F,0x9B13,0x9B1F,0x9B23, +0x9EBD,0x9EBE,0x7E3B,0x9E82,0x9E87,0x9E88,0x9E8B,0x9E92, +0x93D6,0x9E9D,0x9E9F,0x9EDB,0x9EDC,0x9EDD,0x9EE0,0x9EDF, +0x9EE2,0x9EE9,0x9EE7,0x9EE5,0x9EEA,0x9EEF,0x9F22,0x9F2C, +0x9F2F,0x9F39,0x9F37,0x9F3D,0x9F3E,0x9F44}; + +static int func_gb2312_uni_onechar(int code){ + if ((code>=0x2121)&&(code<=0x2658)) + return(tab_gb2312_uni0[code-0x2121]); + if ((code>=0x2721)&&(code<=0x296F)) + return(tab_gb2312_uni1[code-0x2721]); + if ((code>=0x3021)&&(code<=0x777E)) + return(tab_gb2312_uni2[code-0x3021]); + return(0); +} + + +/* page 0 0x00A4-0x01DC */ +static uint16 tab_uni_gb23120[]={ +0x2168, 0, 0,0x216C,0x2127, 0, 0, 0, + 0, 0, 0, 0,0x2163,0x2140, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2141, 0, 0, 0, 0, + 0, 0, 0, 0,0x2824,0x2822, 0, 0, + 0, 0, 0, 0,0x2828,0x2826,0x283A, 0, +0x282C,0x282A, 0, 0, 0, 0,0x2830,0x282E, + 0, 0, 0,0x2142, 0,0x2834,0x2832, 0, +0x2839, 0, 0, 0, 0,0x2821, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2825, + 0, 0, 0, 0, 0, 0, 0,0x2827, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2829, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x282D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2831, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2823, 0,0x282B, 0,0x282F, 0, +0x2833, 0,0x2835, 0,0x2836, 0,0x2837, 0, +0x2838}; + +/* page 1 0x02C7-0x0451 */ +static uint16 tab_uni_gb23121[]={ +0x2126, 0,0x2125, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2621,0x2622,0x2623,0x2624,0x2625,0x2626, +0x2627,0x2628,0x2629,0x262A,0x262B,0x262C,0x262D,0x262E, +0x262F,0x2630,0x2631, 0,0x2632,0x2633,0x2634,0x2635, +0x2636,0x2637,0x2638, 0, 0, 0, 0, 0, + 0, 0,0x2641,0x2642,0x2643,0x2644,0x2645,0x2646, +0x2647,0x2648,0x2649,0x264A,0x264B,0x264C,0x264D,0x264E, +0x264F,0x2650,0x2651, 0,0x2652,0x2653,0x2654,0x2655, +0x2656,0x2657,0x2658, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2727, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2721,0x2722,0x2723,0x2724,0x2725,0x2726,0x2728, +0x2729,0x272A,0x272B,0x272C,0x272D,0x272E,0x272F,0x2730, +0x2731,0x2732,0x2733,0x2734,0x2735,0x2736,0x2737,0x2738, +0x2739,0x273A,0x273B,0x273C,0x273D,0x273E,0x273F,0x2740, +0x2741,0x2751,0x2752,0x2753,0x2754,0x2755,0x2756,0x2758, +0x2759,0x275A,0x275B,0x275C,0x275D,0x275E,0x275F,0x2760, +0x2761,0x2762,0x2763,0x2764,0x2765,0x2766,0x2767,0x2768, +0x2769,0x276A,0x276B,0x276C,0x276D,0x276E,0x276F,0x2770, +0x2771, 0,0x2757}; + +/* page 2 0x2015-0x2312 */ +static uint16 tab_uni_gb23122[]={ +0x212A,0x212C, 0,0x212E,0x212F, 0, 0,0x2130, +0x2131, 0, 0, 0, 0, 0, 0, 0, + 0,0x212D, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x216B, 0,0x2164,0x2165, 0, + 0, 0, 0, 0, 0, 0,0x2179, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2166, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x216D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2271,0x2272,0x2273,0x2274,0x2275, +0x2276,0x2277,0x2278,0x2279,0x227A,0x227B,0x227C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x217B,0x217C,0x217A,0x217D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x214A, 0, 0, 0, 0, + 0, 0,0x2147, 0,0x2146, 0, 0, 0, + 0, 0, 0, 0, 0,0x214C, 0, 0, +0x2158,0x215E, 0,0x214F, 0, 0, 0, 0, +0x214E, 0,0x2144,0x2145,0x2149,0x2148,0x2152, 0, + 0,0x2153, 0, 0, 0, 0, 0,0x2160, +0x215F,0x2143,0x214B, 0, 0, 0, 0, 0, +0x2157, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2156, 0, 0, 0,0x2155, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2159,0x2154, 0, 0,0x215C, +0x215D, 0, 0, 0, 0, 0, 0, 0, + 0,0x215A,0x215B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x2151, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x214D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x2150}; + +/* page 3 0x2460-0x2642 */ +static uint16 tab_uni_gb23123[]={ +0x2259,0x225A,0x225B,0x225C,0x225D,0x225E,0x225F,0x2260, +0x2261,0x2262, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x2245,0x2246,0x2247,0x2248, +0x2249,0x224A,0x224B,0x224C,0x224D,0x224E,0x224F,0x2250, +0x2251,0x2252,0x2253,0x2254,0x2255,0x2256,0x2257,0x2258, +0x2231,0x2232,0x2233,0x2234,0x2235,0x2236,0x2237,0x2238, +0x2239,0x223A,0x223B,0x223C,0x223D,0x223E,0x223F,0x2240, +0x2241,0x2242,0x2243,0x2244, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2924,0x2925,0x2926,0x2927,0x2928,0x2929,0x292A,0x292B, +0x292C,0x292D,0x292E,0x292F,0x2930,0x2931,0x2932,0x2933, +0x2934,0x2935,0x2936,0x2937,0x2938,0x2939,0x293A,0x293B, +0x293C,0x293D,0x293E,0x293F,0x2940,0x2941,0x2942,0x2943, +0x2944,0x2945,0x2946,0x2947,0x2948,0x2949,0x294A,0x294B, +0x294C,0x294D,0x294E,0x294F,0x2950,0x2951,0x2952,0x2953, +0x2954,0x2955,0x2956,0x2957,0x2958,0x2959,0x295A,0x295B, +0x295C,0x295D,0x295E,0x295F,0x2960,0x2961,0x2962,0x2963, +0x2964,0x2965,0x2966,0x2967,0x2968,0x2969,0x296A,0x296B, +0x296C,0x296D,0x296E,0x296F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2176,0x2175, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2178,0x2177, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2174,0x2173, + 0, 0, 0,0x2170, 0, 0,0x2172,0x2171, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x216F,0x216E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2162, 0,0x2161}; + +/* page 4 0x3000-0x3129 */ +static uint16 tab_uni_gb23124[]={ +0x2121,0x2122,0x2123,0x2128, 0,0x2129, 0, 0, +0x2134,0x2135,0x2136,0x2137,0x2138,0x2139,0x213A,0x213B, +0x213E,0x213F, 0,0x217E,0x2132,0x2133,0x213C,0x213D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2421,0x2422,0x2423,0x2424,0x2425,0x2426,0x2427, +0x2428,0x2429,0x242A,0x242B,0x242C,0x242D,0x242E,0x242F, +0x2430,0x2431,0x2432,0x2433,0x2434,0x2435,0x2436,0x2437, +0x2438,0x2439,0x243A,0x243B,0x243C,0x243D,0x243E,0x243F, +0x2440,0x2441,0x2442,0x2443,0x2444,0x2445,0x2446,0x2447, +0x2448,0x2449,0x244A,0x244B,0x244C,0x244D,0x244E,0x244F, +0x2450,0x2451,0x2452,0x2453,0x2454,0x2455,0x2456,0x2457, +0x2458,0x2459,0x245A,0x245B,0x245C,0x245D,0x245E,0x245F, +0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, +0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, +0x2470,0x2471,0x2472,0x2473, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2521,0x2522,0x2523,0x2524,0x2525,0x2526,0x2527, +0x2528,0x2529,0x252A,0x252B,0x252C,0x252D,0x252E,0x252F, +0x2530,0x2531,0x2532,0x2533,0x2534,0x2535,0x2536,0x2537, +0x2538,0x2539,0x253A,0x253B,0x253C,0x253D,0x253E,0x253F, +0x2540,0x2541,0x2542,0x2543,0x2544,0x2545,0x2546,0x2547, +0x2548,0x2549,0x254A,0x254B,0x254C,0x254D,0x254E,0x254F, +0x2550,0x2551,0x2552,0x2553,0x2554,0x2555,0x2556,0x2557, +0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E,0x255F, +0x2560,0x2561,0x2562,0x2563,0x2564,0x2565,0x2566,0x2567, +0x2568,0x2569,0x256A,0x256B,0x256C,0x256D,0x256E,0x256F, +0x2570,0x2571,0x2572,0x2573,0x2574,0x2575,0x2576, 0, + 0, 0, 0,0x2124, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x2845,0x2846,0x2847, +0x2848,0x2849,0x284A,0x284B,0x284C,0x284D,0x284E,0x284F, +0x2850,0x2851,0x2852,0x2853,0x2854,0x2855,0x2856,0x2857, +0x2858,0x2859,0x285A,0x285B,0x285C,0x285D,0x285E,0x285F, +0x2860,0x2861,0x2862,0x2863,0x2864,0x2865,0x2866,0x2867, +0x2868,0x2869}; + +/* page 5 0x3220-0x3229 */ +static uint16 tab_uni_gb23125[]={ +0x2265,0x2266,0x2267,0x2268,0x2269,0x226A,0x226B,0x226C, +0x226D,0x226E}; + +/* page 6 0x4E00-0x9B54 */ +static uint16 tab_uni_gb23126[]={ +0x523B,0x3621, 0,0x465F, 0, 0, 0,0x4D72, +0x5549,0x487D,0x494F,0x4F42,0x5822,0x323B,0x536B, 0, +0x5824,0x3373, 0,0x5728,0x4752,0x5827,0x4A40, 0, +0x4770,0x317B,0x5235,0x3454,0x362B,0x4B3F,0x5829, 0, + 0, 0,0x362A, 0,0x413D,0x514F, 0,0x4925, +0x582D, 0,0x3876,0x513E,0x635C,0x5650, 0, 0, +0x3761, 0,0x342E, 0,0x4159, 0,0x583C, 0, +0x4D68,0x3524,0x4E2A,0x5677, 0,0x4076,0x3E59,0x582F, + 0, 0, 0,0x444B, 0,0x3E43, 0,0x5831, +0x4334,0x5265, 0,0x562E,0x4E5A,0x5527,0x3A75,0x3726, +0x4056, 0,0x4639,0x4552,0x4747, 0,0x3954, 0, +0x334B,0x5252, 0, 0,0x583F,0x3E45,0x4672,0x5232, +0x4F30,0x4F67, 0, 0, 0, 0,0x4A69, 0, + 0,0x5840, 0, 0, 0, 0, 0, 0, +0x4272,0x4252, 0,0x4869, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x472C, 0, + 0, 0, 0, 0, 0, 0,0x414B, 0, +0x5368,0x5579, 0,0x4A42,0x367E,0x5821,0x535A,0x3F77, + 0,0x5446,0x3B25,0x5841,0x4E65,0x3E2E, 0, 0, +0x5828, 0,0x5147,0x5029, 0, 0, 0,0x583D, +0x596F,0x4D76,0x3F3A, 0,0x3D3B,0x3A25,0x5260,0x327A, +0x3A60,0x4436, 0,0x4F6D,0x3E29,0x4D24,0x4141, 0, + 0, 0,0x4757,0x5971, 0,0x5974, 0, 0, + 0, 0,0x484B,0x5869, 0, 0, 0,0x525A, +0x4A32,0x484A,0x586C,0x586A,0x5846,0x3D76,0x464D,0x3370, + 0,0x586B,0x3D71,0x3D69, 0,0x4854,0x3453, 0, + 0,0x4258, 0,0x3256,0x5750,0x4A4B,0x4B7B,0x554C, +0x3836,0x4F49, 0, 0, 0,0x595A,0x5870,0x472A, + 0,0x586E, 0,0x347A,0x416E,0x5254, 0, 0, +0x586D, 0,0x5247,0x586F,0x4347, 0, 0, 0, +0x5176, 0,0x5659,0x5872, 0,0x5875,0x3C7E,0x3C5B, + 0, 0, 0,0x484E, 0,0x375D, 0,0x3742, + 0,0x4673, 0, 0, 0, 0, 0, 0, + 0,0x5878,0x5241, 0, 0,0x4E69,0x3C3F,0x377C, +0x3725,0x505D, 0, 0, 0, 0, 0,0x565A, +0x5345,0x3B6F,0x3B61,0x5871, 0, 0,0x4921,0x4E30, +0x342B, 0,0x5873, 0,0x494B,0x5876,0x4257,0x5877, + 0, 0,0x4E31,0x5879, 0, 0, 0,0x322E, +0x3940, 0,0x5923, 0,0x3069, 0,0x4166, 0, +0x496C, 0,0x4B45, 0,0x4B46,0x5924, 0, 0, + 0, 0, 0,0x3568, 0, 0,0x352B, 0, + 0, 0, 0, 0, 0,0x4E3B,0x354D,0x5721, +0x5774,0x5353, 0,0x4C65, 0,0x3A4E, 0,0x5922, +0x595C,0x5360,0x587D,0x3770,0x5777,0x587E,0x587A,0x5921, +0x4463, 0, 0,0x5336,0x5874,0x595D, 0,0x587B, + 0,0x4565, 0, 0,0x4050, 0, 0,0x5170, +0x305B, 0, 0,0x3C51,0x5926, 0,0x5925, 0, + 0, 0, 0,0x592C,0x592E, 0,0x592B,0x4A39, + 0, 0, 0,0x5929,0x5636, 0, 0, 0, +0x335E,0x5928, 0,0x407D, 0,0x4A4C, 0,0x592A, + 0,0x5927, 0, 0,0x5930, 0, 0,0x3631, + 0, 0, 0,0x3929, 0,0x5240, 0, 0, +0x4F40, 0, 0,0x4242, 0,0x3D44,0x556C,0x3260, +0x4748,0x3F6B,0x592D, 0,0x592F, 0,0x4E6A,0x3A6E, + 0, 0, 0, 0, 0,0x4756, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3163, + 0, 0, 0,0x3459,0x366D,0x5934, 0, 0, + 0, 0,0x3F21, 0, 0, 0,0x595E,0x474E, +0x407E,0x5938, 0, 0, 0, 0, 0,0x4B57, +0x377D, 0,0x5935, 0,0x5937,0x3123,0x5361,0x5939, + 0,0x5045, 0,0x5936, 0, 0,0x5931, 0, +0x5932,0x4129,0x5933, 0, 0,0x3C73,0x505E,0x3829, + 0,0x3E63, 0,0x593D, 0, 0, 0, 0, +0x593A, 0,0x3033, 0, 0, 0,0x5942, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5944,0x3136, 0,0x593F, + 0, 0,0x3539, 0,0x3E73, 0, 0, 0, +0x4C48,0x3A72,0x5250, 0,0x5943, 0, 0,0x3D68, + 0,0x332B, 0, 0, 0,0x5945,0x3E6B, 0, +0x5946,0x593B,0x445F, 0,0x593E,0x5941,0x5940, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x552E, 0,0x5635, 0,0x4763, 0, + 0, 0, 0,0x5948, 0, 0, 0,0x3C59, +0x594A, 0, 0, 0,0x593C, 0,0x594B,0x462B, + 0, 0, 0, 0, 0,0x5949, 0, 0, + 0, 0,0x5776, 0,0x4D23, 0, 0, 0, + 0, 0, 0, 0, 0,0x3D21, 0, 0, + 0, 0, 0, 0,0x594C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x453C,0x4D35, + 0, 0, 0,0x594D, 0, 0,0x5947,0x3325, +0x3F7E, 0, 0, 0, 0,0x3835, 0, 0, +0x407C, 0, 0, 0, 0,0x3078, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3476, 0,0x594E, 0,0x594F, +0x3422,0x5950, 0, 0,0x345F, 0, 0, 0, + 0, 0,0x3041, 0, 0, 0, 0, 0, + 0, 0,0x5951,0x4935, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4F71, + 0, 0, 0, 0, 0, 0,0x5952, 0, + 0, 0,0x4145, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5956,0x492E, + 0, 0, 0, 0,0x5955,0x5954,0x5957, 0, + 0, 0, 0,0x4B5B, 0,0x3D29, 0, 0, + 0, 0, 0,0x4627, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5953,0x5958, + 0, 0, 0,0x5959, 0, 0, 0, 0, + 0, 0,0x4865, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x405C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3679, +0x5823,0x544A, 0,0x542A,0x5056,0x3364,0x5557, 0, +0x4F48,0x3962, 0,0x3F4B, 0,0x4362, 0, 0, + 0,0x3652, 0, 0,0x4D43,0x596E,0x5970, 0, + 0, 0,0x3533, 0,0x3635, 0, 0, 0, + 0, 0,0x3E24, 0, 0,0x486B, 0, 0, +0x482B, 0, 0,0x304B,0x392B,0x4179,0x5962, 0, +0x403C,0x3932, 0,0x3958,0x504B,0x3178,0x4664,0x3E5F, +0x3564,0x5748, 0,0x5178,0x3C66,0x4A5E, 0, 0, +0x3C3D,0x5966,0x5867, 0, 0,0x445A, 0, 0, +0x3854,0x483D, 0, 0,0x3261,0x5459, 0, 0, + 0, 0,0x4330, 0, 0,0x4361,0x5A22,0x485F, + 0,0x5034, 0,0x3E7C,0x4529, 0, 0, 0, +0x395A, 0,0x5A23, 0,0x5429,0x5A24, 0, 0, + 0, 0, 0,0x597B,0x362C, 0, 0,0x376B, +0x3179,0x597C,0x3365,0x3E76, 0,0x3F76,0x5231,0x4064, + 0, 0, 0,0x3633,0x597E,0x597D, 0, 0, +0x3E3B, 0, 0, 0,0x4660, 0,0x573C,0x5A21, + 0,0x4139, 0,0x3572,0x4168, 0, 0,0x3C75, + 0,0x3455, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x415D, 0,0x447D, 0, 0, +0x3C38,0x3732, 0, 0,0x376F, 0, 0, 0, + 0, 0, 0,0x596C, 0,0x463E, 0,0x3F2D, +0x3B4B, 0, 0,0x354A, 0,0x5B49,0x5057, 0, +0x4D39,0x303C,0x3376,0x3B77,0x5B4A,0x3A2F, 0,0x5464, +0x3536,0x3573,0x5856,0x4850, 0, 0,0x3756,0x4750, +0x5857, 0,0x3F2F, 0, 0,0x5B3B,0x5858, 0, + 0,0x504C,0x3B2E, 0, 0, 0,0x6B3E,0x4150, +0x4175,0x5472,0x3855,0x3434, 0,0x3375, 0, 0, +0x493E, 0, 0, 0,0x4550, 0, 0, 0, +0x4559,0x407B, 0,0x3170, 0,0x5859,0x394E, 0, +0x353D, 0, 0,0x585A, 0, 0,0x5646,0x4B22, +0x482F,0x4932,0x344C,0x3F4C, 0,0x3974, 0,0x585B, +0x585C,0x3667,0x3C41,0x4C6A, 0, 0, 0, 0, + 0, 0,0x4F77, 0,0x585D,0x4730, 0, 0, +0x3950,0x3D23, 0, 0,0x4C5E, 0,0x464A, 0, + 0, 0, 0, 0,0x5860, 0,0x585E, 0, + 0,0x585F, 0, 0, 0,0x307E, 0,0x3E67, + 0,0x4A23,0x3C74, 0, 0, 0, 0,0x3831, + 0, 0,0x386E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5862, 0,0x3D4B, + 0,0x5864,0x5863, 0, 0, 0, 0, 0, +0x457C, 0, 0, 0, 0, 0, 0, 0, +0x5865, 0, 0,0x5866, 0, 0, 0, 0, + 0, 0, 0,0x4126, 0,0x4830,0x306C,0x3926, +0x3C53,0x4E71,0x5B3D,0x4153, 0, 0, 0, 0, +0x362F,0x567A,0x452C,0x3D59,0x5B3E,0x5B3F, 0, 0, + 0,0x4078,0x3E22,0x404D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5B40,0x4A46, + 0, 0, 0,0x322A, 0, 0, 0,0x5342, + 0,0x4363, 0,0x512B, 0, 0, 0, 0, +0x5B42, 0,0x4055, 0, 0, 0,0x5B43, 0, +0x3F31, 0, 0, 0, 0, 0, 0,0x443C, + 0, 0, 0, 0,0x475A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5B44, 0, 0, 0, 0, 0, 0, 0, + 0,0x5968,0x4957, 0, 0, 0,0x3934,0x4E70, +0x5448, 0, 0, 0, 0,0x307C,0x3452, 0, +0x5059, 0, 0, 0, 0,0x5969, 0,0x5E4B, +0x596B, 0, 0, 0, 0,0x5830,0x3B2F,0x3131, + 0,0x3357,0x584E, 0, 0,0x5451, 0, 0, +0x3D33,0x3F6F, 0,0x4F3B, 0, 0,0x5850, 0, + 0, 0,0x374B, 0, 0, 0,0x5851, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4625,0x4778,0x523D, 0, 0,0x5852,0x4464, + 0,0x4A2E, 0,0x4727, 0,0x5826, 0,0x497D, +0x4E67,0x3B5C,0x306B, 0, 0, 0,0x3B2A,0x502D, + 0,0x3130,0x5764,0x573F, 0,0x3525,0x4274,0x444F, + 0, 0,0x3229, 0,0x3237, 0,0x3165,0x5F32, +0x553C,0x3F28,0x422C,0x5855,0x4231, 0,0x5854,0x4E54, + 0,0x5A60, 0,0x4E40, 0, 0,0x5834,0x432E, +0x5321,0x4E23, 0,0x3C34,0x4834,0x4251, 0,0x3E6D, +0x5036, 0,0x5A61, 0, 0, 0, 0,0x4764, + 0, 0,0x3327, 0,0x3672,0x4C7C,0x407A, 0, + 0,0x4077, 0,0x5139,0x5161,0x5847, 0, 0, + 0, 0, 0, 0, 0,0x325E, 0, 0, +0x4065, 0,0x3A71, 0, 0,0x5848, 0,0x542D, + 0, 0,0x4F61,0x5849, 0,0x584A,0x4F43, 0, +0x3378,0x3E47, 0, 0, 0, 0,0x584B, 0, + 0, 0, 0, 0, 0, 0,0x5B4C, 0, + 0, 0, 0,0x4825, 0, 0, 0,0x4F58, + 0,0x487E,0x324E, 0, 0, 0, 0, 0, +0x5356,0x3266,0x3C30,0x5351,0x4B2B,0x3734, 0, 0, + 0,0x3722, 0, 0,0x4A65, 0,0x4821,0x4A5C, +0x3164,0x5070, 0,0x4551, 0, 0, 0,0x5B45, +0x357E, 0, 0,0x3F5A,0x3945,0x3E64,0x416D, 0, +0x5F36,0x5F35,0x563B,0x3D50,0x5559,0x3048,0x3623,0x3F49, +0x4C28,0x5F33,0x4A37,0x5352, 0,0x584F,0x5236,0x3A45, +0x4B3E,0x4C3E, 0,0x5F37,0x3570,0x5F34, 0, 0, + 0,0x5375, 0,0x3354,0x3877, 0,0x5F3A, 0, +0x3A4F,0x3C2A,0x3575, 0,0x4D2C,0x437B,0x3A73,0x4074, +0x4D42,0x4F72,0x5F38,0x4F45, 0,0x4240,0x5F39,0x4270, + 0, 0, 0,0x3E7D, 0,0x415F,0x4D4C,0x5277, +0x374D,0x5F41, 0,0x5F44, 0, 0,0x3771,0x3049, +0x3656,0x3754, 0,0x3A2C,0x4C7D,0x3F54,0x4B31,0x4674, + 0,0x5628,0x5F45, 0,0x4E62,0x3333, 0, 0, +0x4E7C,0x3435, 0,0x4E47,0x3A70, 0,0x4E61, 0, +0x513D, 0, 0,0x5F40, 0, 0,0x3474, 0, +0x334A, 0,0x3866,0x5F3B, 0, 0, 0, 0, +0x4445, 0,0x5F3C,0x5F3D,0x5F3E,0x453B,0x5F3F,0x5F42, +0x5431,0x5F43, 0,0x473A,0x4E58, 0, 0, 0, + 0, 0,0x4458, 0,0x5F4A, 0,0x5F4F, 0, +0x565C, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F49,0x5F5A,0x4E36, 0,0x3A47,0x5F4E,0x5F48, +0x455E, 0, 0,0x496B,0x3A74,0x437C, 0, 0, +0x3E57, 0,0x5F46, 0,0x5F4D, 0,0x4558, 0, + 0, 0, 0,0x5526,0x3A4D, 0,0x3E4C,0x533D, +0x3840, 0,0x5664, 0,0x5F47,0x393E,0x3F27, 0, + 0,0x417C,0x5F4B,0x5F4C, 0,0x5F50, 0, 0, + 0, 0, 0,0x5F5B,0x5F65, 0,0x5F57,0x5F56, +0x5749,0x5F63,0x5F64,0x656B,0x5227,0x5F52, 0,0x3F29, + 0,0x545B, 0,0x3F48,0x5F54, 0, 0, 0, +0x4F4C, 0, 0,0x5F5D, 0,0x514A, 0,0x5F5E, +0x3027,0x4637,0x5F53, 0,0x3A65, 0,0x365F,0x4D5B, +0x397E,0x5455, 0, 0,0x5F5F,0x4F6C,0x3025,0x5F67, +0x5F51,0x5146,0x5F55,0x5F58,0x5F59,0x5F5C, 0,0x3B29, + 0,0x5F60,0x5F61, 0,0x5F62,0x5F66,0x5F68,0x5334, + 0, 0, 0, 0, 0,0x3867,0x4536,0x5F6A, +0x495A,0x4128,0x4444, 0, 0,0x3F5E,0x4F78, 0, + 0, 0,0x555C,0x5F6E, 0, 0, 0, 0, + 0, 0,0x3238, 0,0x3A5F,0x5F6C, 0,0x5B41, + 0,0x5164, 0, 0, 0, 0,0x4B74,0x343D, + 0,0x3026, 0, 0, 0, 0, 0,0x5F71, +0x4C46,0x5F72, 0, 0,0x5F6D, 0, 0, 0, + 0, 0, 0,0x5F69, 0, 0, 0, 0, +0x5F6B, 0,0x5F6F,0x5F70,0x3B3D, 0, 0,0x5F73, + 0, 0,0x5F74, 0,0x3B23, 0,0x4A5B,0x4E28, +0x6027,0x332A, 0,0x6026, 0, 0, 0,0x6021, + 0, 0, 0, 0,0x5F7E, 0,0x4D59,0x5F7C, + 0,0x5F7A, 0,0x3F50,0x5744, 0,0x494C, 0, + 0,0x5F78,0x3021, 0, 0, 0, 0, 0, +0x5F7D, 0, 0, 0, 0,0x5F7B,0x6022, 0, + 0, 0, 0, 0,0x6028, 0, 0, 0, + 0,0x3748, 0, 0,0x4621,0x4936,0x4032,0x5F75, + 0, 0,0x453E, 0,0x5844,0x5F79,0x4476, 0, + 0, 0, 0, 0, 0,0x6023,0x6024,0x6025, +0x5025, 0, 0,0x6034,0x4C64, 0,0x6031, 0, +0x3F26,0x602F,0x4E39,0x602B,0x4946, 0, 0,0x402E, +0x602E,0x3A6D,0x3A30,0x6029, 0, 0, 0,0x5F76, + 0,0x6033, 0, 0,0x6038, 0, 0, 0, +0x342D,0x6039, 0, 0,0x4F32,0x3A48, 0,0x6030, + 0, 0, 0, 0, 0, 0, 0,0x507A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x602C, 0,0x547B, 0,0x5F77, 0,0x4567, + 0,0x602D, 0,0x5377, 0,0x6036,0x6037, 0, + 0, 0, 0, 0,0x6044,0x5061, 0, 0, + 0,0x603C, 0, 0,0x6049,0x604A, 0, 0, + 0,0x603E,0x602A,0x4924,0x6041, 0,0x6032, 0, + 0, 0, 0, 0,0x4A48,0x6043, 0,0x6035, + 0,0x4E4B, 0,0x4B43,0x604D,0x6046,0x6042, 0, +0x604B, 0,0x603A,0x603F,0x6040, 0, 0,0x6045, + 0, 0,0x6047,0x6048, 0,0x604C, 0,0x603B, + 0, 0, 0, 0, 0,0x4B54,0x6055, 0, +0x6056,0x6052, 0, 0, 0, 0, 0, 0, +0x6050,0x3C4E, 0, 0,0x6051, 0,0x3842,0x5845, + 0, 0, 0, 0, 0, 0, 0, 0, +0x506A, 0, 0,0x426F, 0, 0,0x604F,0x603D, + 0, 0, 0,0x6054,0x6053, 0, 0,0x6057, + 0, 0, 0, 0,0x605C,0x6058, 0, 0, + 0,0x5676,0x3330, 0,0x576C, 0,0x4B3B, 0, + 0,0x605A, 0,0x4E7B, 0, 0, 0,0x3A59, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6061,0x605D,0x522D, 0, + 0, 0, 0, 0,0x6062, 0, 0,0x605B, +0x6059,0x605F, 0, 0,0x6060, 0, 0, 0, + 0, 0,0x605E, 0,0x6064, 0, 0, 0, +0x4677,0x582C,0x546B,0x6066,0x4A49, 0, 0, 0, + 0,0x6065, 0, 0, 0, 0,0x3841, 0, + 0, 0, 0,0x6067,0x6068, 0, 0, 0, + 0, 0, 0, 0, 0,0x6069,0x6063, 0, + 0, 0, 0, 0, 0, 0,0x3A3F,0x4C67, + 0, 0, 0,0x606A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4F79, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x606B, + 0, 0, 0, 0, 0, 0, 0,0x4842, + 0, 0, 0, 0,0x3D40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4452, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x606C, 0, 0,0x606D, + 0, 0,0x4774,0x4B44, 0,0x606E,0x3B58,0x5836, +0x5272,0x606F,0x4D45, 0,0x365A, 0, 0, 0, + 0, 0, 0,0x6071, 0,0x5430, 0, 0, +0x4027,0x3451, 0, 0,0x4E27,0x6070, 0, 0, + 0,0x6072,0x394C, 0, 0,0x397A,0x4D3C,0x6073, + 0, 0, 0,0x4654,0x6074, 0,0x5432, 0, +0x4826,0x6076,0x6075, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6077, 0, 0,0x4D41, + 0, 0, 0,0x4A25, 0, 0, 0, 0, +0x545A,0x5B57,0x5B59, 0,0x5B58,0x3967,0x5B5C,0x5B5D, +0x3558, 0, 0,0x5B5A, 0, 0, 0, 0, + 0,0x5B5B,0x3321,0x5B5F, 0, 0,0x3B78, 0, +0x5637, 0,0x5B60, 0, 0, 0, 0,0x3E79, + 0, 0,0x373B, 0,0x5B50,0x4C2E,0x3F32,0x3B35, +0x5778,0x3F53, 0, 0, 0, 0, 0,0x3F69, + 0, 0,0x3C61,0x4C33,0x5B5E,0x3053,0x4E6B,0x3758, +0x5739,0x4642, 0, 0,0x4024, 0,0x4C39, 0, +0x5B67,0x5B61,0x463A,0x5B63, 0,0x5B68, 0,0x4577, + 0, 0, 0,0x5B6A, 0, 0,0x5B69,0x3F40, + 0, 0, 0,0x5B66,0x5B65, 0, 0, 0, + 0, 0,0x3439,0x402C,0x4222,0x5B62,0x5B64, 0, + 0, 0, 0,0x504D,0x5B6D, 0, 0, 0, + 0, 0,0x405D,0x5B72, 0, 0, 0, 0, + 0, 0, 0,0x3662, 0, 0, 0, 0, +0x5B73,0x5B52,0x3938,0x542B,0x5B6C, 0,0x3F51,0x5B70, + 0,0x5B51, 0,0x3566, 0,0x5B6B,0x3F65, 0, + 0, 0,0x5B6E, 0,0x5B71, 0, 0, 0, +0x5B79, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3921,0x3023, 0, 0, 0, 0, + 0, 0, 0,0x4271, 0, 0,0x3347,0x5B6F, + 0, 0,0x5B78, 0,0x4652,0x5B74, 0, 0, +0x5B75,0x5B77,0x5B76, 0, 0,0x5B7E, 0,0x5372, +0x323A, 0, 0, 0,0x5B7D, 0, 0, 0, + 0, 0, 0, 0, 0,0x5C24, 0,0x5B7B, + 0, 0, 0, 0,0x5B7A, 0, 0, 0, +0x5B7C,0x4560,0x3B79, 0, 0,0x5C23, 0, 0, +0x5C25, 0,0x4C43, 0, 0, 0,0x3651,0x5D40, + 0, 0, 0,0x5C21, 0,0x5C22, 0, 0, + 0,0x4735, 0, 0, 0,0x3669, 0, 0, + 0,0x5C27, 0, 0, 0, 0,0x5C26, 0, +0x5C29,0x3124, 0, 0,0x354C, 0, 0, 0, + 0, 0,0x3F30, 0, 0, 0, 0, 0, +0x515F, 0, 0, 0, 0,0x3642, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5C28, 0, 0, 0, + 0, 0, 0, 0,0x4B7A,0x6B73, 0, 0, + 0,0x4B5C, 0, 0,0x4B7E, 0, 0, 0, +0x4C41, 0, 0, 0, 0, 0,0x487B, 0, + 0, 0, 0, 0, 0,0x5C2A, 0, 0, + 0, 0, 0,0x4C6E,0x5C2B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5B53, 0, +0x5C2F,0x5C2C, 0,0x3E33, 0,0x4A7B, 0, 0, + 0,0x5C2D, 0, 0, 0, 0, 0, 0, + 0, 0,0x494A,0x4439, 0, 0, 0, 0, + 0,0x473D,0x5C2E, 0, 0, 0,0x5476,0x5066, + 0, 0, 0, 0, 0, 0, 0, 0, +0x442B,0x3655, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5B54, 0, 0, 0, + 0,0x315A, 0, 0, 0,0x5B55, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B56, 0, 0, 0,0x3A3E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4840, 0, 0, 0, + 0, 0, 0,0x4A3F,0x4849, 0,0x5733, 0, +0x4979, 0, 0,0x3F47, 0, 0,0x3A78, 0, + 0,0x523C, 0, 0, 0, 0, 0, 0, + 0, 0,0x623A, 0,0x3426, 0, 0,0x3138, + 0, 0, 0, 0, 0,0x3834, 0,0x4F44, + 0, 0, 0, 0,0x5967,0x4F26,0x4D62, 0, + 0,0x596D,0x3660, 0,0x5239, 0, 0,0x393B, + 0, 0, 0, 0,0x6239,0x6237, 0,0x3473, + 0,0x4C6C,0x4C2B,0x3772, 0,0x5832,0x516B,0x3A3B, + 0,0x4A27, 0, 0,0x4D37, 0, 0,0x5244, +0x3F64,0x3C50,0x3661, 0,0x5E45, 0, 0, 0, + 0,0x5E46,0x5B3C, 0,0x5159, 0, 0,0x4666, +0x444E,0x376E, 0,0x375C, 0, 0,0x3F7C,0x5760, + 0,0x4675, 0, 0,0x313C,0x5E48,0x3D31,0x4C57, +0x5E4A, 0,0x5E49, 0, 0, 0, 0, 0, +0x356C, 0,0x495D, 0, 0,0x3042, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x452E,0x452B, 0,0x444C, 0, +0x3C69,0x4B7D, 0, 0, 0,0x3A43, 0, 0, + 0,0x6579,0x4867,0x657A,0x4D7D, 0,0x5731,0x383E, +0x4268, 0,0x4851, 0, 0,0x657B, 0, 0, + 0, 0,0x364A,0x3C4B, 0, 0,0x517D,0x6621, + 0,0x436E, 0, 0, 0, 0,0x6624, 0, + 0, 0, 0,0x657E,0x6625,0x4D57, 0, 0, +0x3741,0x657C,0x657D,0x6623, 0, 0,0x445D,0x6628, + 0, 0,0x6627, 0, 0, 0, 0, 0, + 0,0x4343, 0,0x465E, 0, 0,0x662A, 0, + 0, 0, 0, 0, 0, 0,0x4437, 0, + 0, 0,0x6622,0x4A3C, 0, 0, 0, 0, +0x3D63,0x3943,0x6626,0x5055,0x4E2F, 0, 0,0x6629, +0x6630, 0,0x5226, 0,0x3D2A,0x662D, 0, 0, + 0, 0, 0,0x662F, 0,0x4051, 0, 0, +0x524C, 0, 0, 0,0x3C27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6631, 0,0x5276, 0, 0, 0,0x574B, + 0,0x4D7E, 0,0x4D5E,0x4226,0x662B,0x662C,0x3D3F, +0x662E,0x6633, 0, 0,0x6632, 0, 0, 0, + 0,0x6636, 0,0x6638, 0, 0, 0, 0, +0x446F, 0, 0, 0,0x4448, 0, 0,0x3E6A, +0x496F, 0, 0,0x6637, 0,0x3670, 0, 0, + 0,0x4364, 0, 0, 0, 0, 0, 0, + 0,0x5369,0x6634, 0,0x6635, 0,0x4822, 0, + 0, 0, 0, 0,0x663D, 0, 0, 0, +0x6639, 0, 0, 0, 0, 0,0x4645, 0, + 0,0x4D71,0x663B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x663C, 0, 0, + 0, 0,0x3B69, 0, 0, 0, 0, 0, + 0, 0,0x663E, 0, 0, 0, 0,0x663A, + 0, 0,0x4037, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5324,0x663F,0x4974,0x6643, + 0, 0,0x6644, 0, 0, 0, 0,0x5076, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x433D, 0, 0, 0, 0, 0, + 0, 0,0x4344,0x6642, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6641, 0, 0, 0, 0, 0, + 0, 0,0x6647,0x4F31, 0,0x6B74, 0, 0, +0x664A, 0, 0, 0, 0, 0,0x6645, 0, + 0,0x3C5E,0x4929, 0, 0, 0, 0, 0, + 0,0x3C35, 0, 0,0x4F53, 0, 0, 0, + 0, 0,0x6648, 0,0x6649, 0,0x664E, 0, +0x6650, 0, 0, 0,0x6651, 0, 0, 0, +0x664B,0x3555, 0,0x664C, 0, 0,0x664F, 0, + 0,0x445B, 0,0x6646, 0, 0, 0, 0, + 0,0x664D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6652, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6654,0x6653, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6655, 0,0x5978, 0, 0,0x6656, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6657, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5753,0x665D, 0,0x665E,0x3F57,0x5450, 0,0x5756, +0x3466,0x4B6F,0x665A,0x5843,0x574E,0x5022, 0,0x434F, + 0, 0,0x665F,0x3C3E,0x3942,0x665B,0x5127, 0, + 0,0x3A22,0x424F, 0,0x582B, 0, 0, 0, +0x4A6B,0x656E, 0,0x665C, 0,0x3775, 0, 0, + 0, 0,0x4866, 0, 0,0x4475, 0, 0, +0x6532,0x447E, 0,0x4B7C,0x6533,0x552C, 0,0x536E, +0x4A58,0x3032, 0,0x4B4E,0x4D6A, 0, 0,0x3A6A, + 0, 0, 0,0x6535, 0,0x6534, 0,0x575A, +0x3959,0x5666,0x3628,0x4D70,0x524B,0x3126,0x4A35, 0, +0x3368,0x4973,0x3F4D,0x507B,0x4A52,0x6536,0x3B42, 0, + 0, 0,0x4F5C,0x392C, 0, 0, 0, 0, +0x5457, 0, 0,0x3A26,0x5167,0x4F7C,0x3C52, 0, +0x6537,0x485D, 0, 0, 0,0x3F6D,0x3176,0x4B5E, + 0, 0,0x3C45, 0,0x3C44,0x527A,0x435C,0x3F5C, + 0, 0, 0, 0,0x383B, 0, 0, 0, +0x4342, 0,0x3A2E,0x5422, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x475E,0x442F,0x326C, + 0,0x3951, 0, 0,0x653B,0x4148, 0, 0, +0x552F, 0, 0, 0, 0, 0,0x653C, 0, +0x653E, 0, 0, 0, 0, 0, 0, 0, +0x3467,0x3654,0x4B42,0x5130,0x353C, 0, 0,0x4A59, + 0,0x3762, 0, 0,0x4964, 0,0x3D2B, 0, + 0,0x4E3E,0x5770, 0, 0, 0, 0,0x5021, + 0,0x4959, 0, 0,0x367B,0x6658,0x3C62, 0, +0x333E, 0,0x4950, 0,0x6659,0x3322, 0, 0, + 0, 0,0x5E4C, 0,0x5348,0x5E4D, 0,0x5222, + 0, 0, 0, 0,0x5E4E, 0, 0, 0, + 0,0x3E4D, 0, 0,0x5E4F, 0, 0, 0, +0x4A2C,0x527C,0x335F,0x656A,0x4461,0x3E21,0x4E32,0x4472, +0x3E56,0x4628,0x3263, 0, 0,0x3E53, 0, 0, +0x477C,0x4C6B,0x3D6C,0x4E5D, 0, 0,0x4A3A,0x4641, +0x656C,0x503C, 0, 0, 0,0x5539, 0, 0, + 0,0x656D, 0, 0, 0, 0,0x4A74, 0, +0x4D40,0x4245, 0,0x656F, 0,0x4244,0x6570, 0, + 0, 0, 0, 0, 0, 0,0x6578,0x4D4D, + 0,0x493D, 0, 0, 0, 0, 0, 0, + 0,0x5259,0x6128, 0, 0, 0, 0,0x536C, + 0,0x4B6A,0x4671, 0, 0, 0, 0, 0, +0x612C, 0, 0, 0,0x6127,0x6129, 0, 0, +0x612A,0x612F, 0, 0,0x326D, 0,0x612B,0x385A, +0x612D,0x612E,0x6130,0x353A,0x6131, 0, 0, 0, + 0, 0,0x6133,0x6138, 0, 0, 0, 0, + 0,0x5152, 0,0x6136,0x6135,0x416B, 0, 0, + 0,0x6137, 0,0x5440, 0,0x6132, 0,0x613A, +0x3036, 0, 0, 0, 0,0x6134, 0,0x3F79, + 0,0x6139, 0, 0,0x613B, 0, 0, 0, + 0, 0, 0,0x613E, 0, 0, 0, 0, + 0, 0,0x613C, 0, 0, 0, 0, 0, + 0,0x5645, 0, 0, 0, 0, 0, 0, + 0,0x4F3F, 0, 0,0x613D,0x613F,0x424D, 0, +0x366B, 0,0x5378, 0, 0,0x474D, 0, 0, +0x3765, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3E7E, 0, 0, 0, 0, + 0, 0,0x6140,0x6141, 0, 0,0x6147,0x3367, + 0, 0, 0, 0, 0, 0,0x4669, 0, + 0, 0, 0, 0,0x345E, 0,0x5142, 0, + 0, 0, 0,0x6148, 0, 0,0x6146, 0, + 0, 0, 0, 0,0x6145, 0,0x6143,0x6142, + 0,0x3140, 0, 0, 0,0x5538,0x6144, 0, + 0, 0, 0, 0,0x614B, 0, 0, 0, + 0, 0, 0, 0, 0,0x614C,0x614A, 0, + 0, 0, 0, 0, 0, 0, 0,0x6F7A, + 0, 0,0x6153,0x6152,0x4736, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6149, 0, 0,0x614E, 0,0x6150, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6154, 0,0x6151,0x614D, 0, 0,0x614F, + 0, 0, 0, 0,0x6155, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6156, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6157, 0, 0, 0,0x6158, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x615A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x615B, 0, 0, + 0, 0, 0, 0, 0,0x4E21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x675D, 0,0x3428,0x565D, 0, + 0,0x5132,0x3332, 0, 0,0x3924,0x5773,0x4749, +0x3E5E,0x392E, 0,0x4E57, 0, 0,0x326E,0x5B4F, + 0,0x3C3A,0x5251,0x4B48,0x304D, 0, 0,0x4F6F, + 0, 0, 0, 0, 0,0x5963,0x3D6D, 0, + 0,0x3152,0x4A50,0x323C, 0,0x4B27,0x372B, 0, +0x4A26, 0, 0, 0,0x4F23, 0, 0,0x6078, +0x554A,0x607B, 0, 0,0x607A,0x4541,0x4C7B, 0, +0x4131,0x6079,0x5663,0x322F,0x5644,0x355B, 0, 0, + 0, 0, 0, 0, 0, 0,0x3478,0x5621, + 0, 0, 0, 0, 0,0x4F2F,0x306F, 0, + 0,0x607C, 0, 0, 0, 0, 0,0x6121, +0x3323, 0, 0,0x607D,0x607E,0x4331, 0, 0, + 0, 0,0x435D, 0,0x6122,0x3779, 0, 0, + 0, 0, 0, 0,0x3B4F, 0, 0, 0, + 0, 0, 0, 0,0x6123,0x443B, 0, 0, + 0, 0, 0,0x6124, 0, 0,0x6125, 0, + 0,0x6126,0x3431, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3849,0x463D,0x446A, 0,0x3222, 0, +0x5052, 0,0x675B,0x3B43,0x5357,0x5344, 0,0x3963, +0x624F, 0, 0, 0,0x572F, 0,0x476C,0x3153, + 0, 0,0x3432,0x6251, 0, 0, 0,0x5072, +0x422E,0x6250, 0,0x3F62,0x5326,0x3557,0x6252,0x356A, + 0,0x436D,0x387D, 0,0x382E, 0,0x4553,0x374F, +0x6254, 0, 0, 0, 0,0x6253,0x3648,0x5779, + 0, 0, 0, 0, 0,0x4D25, 0, 0, + 0, 0, 0,0x6258, 0,0x6256,0x4A7C,0x3F35, +0x5339,0x6255, 0, 0, 0, 0,0x6257, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x412E,0x4048, 0, 0, 0, 0, 0, + 0,0x625B,0x625A,0x402A, 0, 0,0x414E, 0, + 0, 0, 0,0x625C, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x625D, 0,0x625E, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5B48, 0,0x5153,0x4D22, + 0, 0,0x3D28, 0, 0, 0,0x5E43,0x5825, +0x3F2A,0x5B4D,0x526C,0x467A,0x452A, 0, 0, 0, +0x5E44, 0,0x3157,0x5F2E, 0, 0, 0,0x4A3D, + 0,0x5F31, 0,0x392D, 0,0x527D, 0,0x3825, +0x3A6B, 0, 0,0x335A, 0, 0, 0,0x355C, +0x5545, 0, 0, 0, 0,0x4356,0x4F52,0x3B21, + 0,0x6573,0x6572, 0, 0,0x6574, 0,0x4D64, + 0,0x4875, 0, 0, 0, 0, 0, 0, + 0,0x352F,0x473F, 0,0x6576, 0, 0, 0, +0x6C30, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6566, 0,0x3969,0x3531, 0,0x423C,0x6568,0x6567, +0x6569, 0, 0, 0, 0,0x524D, 0, 0, + 0,0x616A,0x504E, 0,0x4D2E, 0,0x5165, 0, + 0,0x324A,0x316B, 0,0x3172,0x456D, 0, 0, +0x5543,0x5330, 0,0x615C, 0, 0, 0,0x615D, + 0,0x525B, 0,0x3339,0x314B, 0, 0, 0, +0x4D79,0x5577,0x615E, 0,0x3E36,0x347D, 0,0x615F, +0x3A5C,0x6160,0x3B32,0x4249,0x6161, 0, 0, 0, +0x506C, 0,0x4D3D, 0, 0,0x6162, 0,0x3543, +0x4547,0x6163, 0, 0,0x6164, 0, 0, 0, + 0,0x5379, 0, 0, 0, 0, 0, 0, +0x6165, 0,0x512D, 0, 0,0x6166,0x4E22, 0, + 0, 0, 0, 0, 0,0x6167, 0,0x3542, + 0, 0, 0, 0,0x6168,0x3B55, 0, 0, + 0, 0, 0,0x5044,0x6260,0x3158,0x5264, 0, + 0,0x6261, 0, 0,0x3C49,0x484C, 0,0x6263, +0x6C7E,0x6C7D,0x5F2F, 0, 0, 0,0x6262,0x563E, +0x4D7C,0x4326, 0, 0, 0,0x6343, 0, 0, +0x5652,0x6267, 0, 0,0x6268, 0, 0,0x5347, + 0, 0,0x626C,0x3F6C, 0,0x626D,0x6265, 0, + 0,0x3340, 0, 0, 0,0x446E, 0, 0, +0x626E, 0, 0,0x5043, 0,0x3A76,0x6269,0x375E, +0x3B33,0x4C2C,0x4B4B,0x6264,0x6266,0x626A,0x626B, 0, + 0, 0,0x6277, 0, 0,0x6274,0x5475,0x6273, + 0, 0,0x452D, 0,0x557A,0x4542,0x3240, 0, + 0,0x626F, 0,0x6272,0x412F,0x4B3C, 0, 0, +0x3521,0x6279, 0, 0, 0,0x3C31,0x6271,0x5054, +0x5439,0x6275,0x3956,0x6276, 0, 0, 0,0x4753, + 0, 0, 0, 0, 0,0x6270, 0, 0, + 0, 0, 0,0x575C,0x6D21, 0, 0,0x6278, + 0,0x6D25,0x627E,0x4A51, 0, 0, 0, 0, + 0, 0, 0,0x4135, 0,0x3B50, 0, 0, +0x3F56, 0,0x3A63, 0, 0,0x4B21, 0, 0, + 0,0x6D26,0x6D23, 0, 0,0x6D22, 0, 0, + 0, 0,0x3B56,0x6D27,0x5074, 0, 0,0x6D24, +0x3A5E,0x3677,0x6321,0x3632,0x4C71,0x3927, 0,0x4F22, +0x4721, 0, 0,0x3F52, 0, 0,0x3671, 0, +0x627A,0x627B,0x627D,0x627C,0x4455,0x6322, 0,0x5341, + 0, 0, 0,0x6327,0x4744, 0, 0, 0, + 0,0x4F24, 0, 0,0x6329,0x3A37, 0, 0, + 0, 0,0x6328, 0,0x3B5A, 0,0x6323, 0, + 0, 0,0x6324,0x632A, 0,0x6326, 0,0x4E72, +0x5346, 0, 0,0x3B3C, 0, 0,0x5443, 0, +0x447A, 0, 0,0x6D28,0x507C,0x6325, 0,0x4375, + 0,0x632D,0x312F, 0,0x6332, 0, 0, 0, +0x3C42, 0, 0,0x632C,0x353F, 0, 0, 0, + 0, 0, 0, 0, 0,0x4769,0x6330, 0, + 0, 0,0x3E2A,0x4D6F, 0, 0, 0, 0, + 0,0x3B73, 0, 0, 0,0x4C68, 0, 0, +0x632F, 0,0x6331, 0,0x4F27,0x632E, 0,0x4E29, +0x3B5D, 0, 0, 0, 0, 0,0x356B,0x3E65, +0x3252,0x334D, 0,0x3139,0x632B,0x3251,0x352C,0x395F, +0x3668, 0, 0,0x4F6B,0x6337, 0,0x3B4C, 0, + 0,0x4847,0x504A, 0, 0, 0, 0, 0, +0x6338,0x336E, 0, 0, 0, 0,0x6D29, 0, +0x537A,0x5364, 0, 0, 0,0x6D2A,0x6339,0x5262, + 0, 0, 0, 0, 0,0x6335, 0, 0, + 0, 0,0x535E, 0, 0, 0, 0,0x3850, +0x6333, 0, 0,0x6336,0x375F, 0,0x6334,0x4022, + 0, 0, 0,0x633A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5438, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3448, 0,0x633B, 0,0x3B45, 0,0x4977, 0, + 0,0x4965, 0, 0, 0,0x443D, 0, 0, + 0, 0, 0, 0, 0,0x6D2B, 0, 0, + 0, 0,0x427D, 0, 0, 0, 0,0x3B5B, +0x3F2E, 0, 0, 0, 0, 0, 0, 0, +0x4E3F, 0, 0, 0, 0,0x633C, 0,0x3F36, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x316F, 0, 0,0x5477, 0, + 0, 0, 0, 0,0x633E, 0, 0, 0, + 0, 0, 0, 0, 0,0x6D2D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x633F, +0x3A29,0x6D2C, 0, 0,0x633D, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6340, + 0, 0, 0, 0, 0, 0,0x3A36, 0, + 0, 0,0x362E, 0, 0, 0, 0, 0, +0x5038, 0,0x3043,0x6D2E, 0, 0, 0, 0, + 0,0x6D2F,0x4041, 0,0x6341, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4533, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6342, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5C32, + 0, 0, 0, 0, 0, 0,0x6D30, 0, +0x386A, 0,0x4E6C,0x6A27,0x5067,0x4A79,0x4856,0x4F37, +0x3349,0x4E52,0x3D64, 0, 0,0x635E,0x3B72,0x6A28, +0x553D, 0,0x465D,0x6A29, 0, 0, 0,0x6A2A, + 0,0x6A2C,0x6A2B, 0,0x6A2E,0x6A2D, 0, 0, + 0, 0,0x3D58, 0,0x6A2F, 0,0x423E, 0, + 0, 0, 0,0x3441,0x3477, 0, 0,0x3B27, + 0, 0, 0, 0, 0,0x6C66,0x6C65,0x373F, +0x4B79,0x3162, 0,0x6C67, 0, 0, 0,0x4948, +0x6C68,0x6C69, 0,0x4A56,0x5E50,0x3245,0x547A, 0, + 0,0x464B,0x3047,0x3472,0x4853, 0, 0, 0, +0x4D50, 0, 0,0x3F38, 0, 0, 0, 0, + 0, 0, 0,0x3F5B, 0, 0,0x4724,0x5634, + 0,0x4029,0x5E51,0x4928,0x516F,0x4524,0x3067,0x3336, +0x4845, 0, 0,0x3062, 0, 0,0x3776, 0, + 0,0x457A, 0, 0,0x3673, 0,0x5552,0x3350, +0x3C3C, 0, 0, 0,0x332D, 0, 0, 0, + 0,0x3E71,0x3051, 0, 0, 0, 0, 0, + 0,0x5256,0x4A63,0x5725, 0,0x4D36,0x3636,0x3F39, +0x555B, 0,0x3827,0x4557, 0, 0, 0,0x5E52, +0x3F59,0x4255,0x4740, 0,0x3B24,0x3128, 0, 0, +0x456A, 0, 0,0x457B,0x4C27, 0, 0, 0, + 0,0x3127, 0, 0, 0,0x3556, 0, 0, + 0,0x4428, 0,0x5E53,0x513A,0x3369, 0,0x4372, + 0, 0,0x3777, 0,0x5674,0x3523,0x3270,0x4434, +0x4469,0x402D,0x5E54, 0,0x3068,0x4544,0x4160, 0, +0x3955, 0,0x3E5C,0x4D58,0x304E, 0,0x4D4F,0x5E56, +0x3E50,0x573E,0x5E55,0x5550,0x305D, 0, 0,0x4462, + 0, 0,0x4223,0x3C70, 0,0x5335,0x4039,0x4521, +0x3226,0x5471, 0, 0,0x4028,0x4A43,0x5E57,0x557C, + 0,0x3930, 0,0x482D,0x4B29, 0,0x5E59,0x3F3D, + 0, 0, 0, 0,0x4634,0x5727,0x4A30,0x4443, + 0,0x3356,0x3952, 0, 0, 0, 0,0x5638, +0x6A7C,0x3034, 0, 0, 0, 0,0x3F66, 0, + 0,0x4C74, 0, 0, 0, 0,0x4D5A, 0, + 0, 0,0x563F,0x424E, 0,0x4E4E,0x4C22,0x502E, +0x4453,0x3532,0x5E58,0x5575,0x3C37,0x3B53, 0, 0, +0x3024, 0,0x4532,0x346C, 0, 0, 0,0x5571, + 0, 0,0x6A7D, 0, 0, 0, 0, 0, + 0,0x5E5A,0x4D26, 0, 0,0x4D6C, 0, 0, + 0, 0,0x4E66,0x5E5C, 0,0x4D31,0x4026, 0, + 0,0x573D, 0,0x5E5B,0x3046,0x3A34,0x4953,0x4473, +0x3E68, 0, 0, 0, 0,0x3236, 0, 0, + 0, 0, 0, 0, 0, 0,0x404C,0x4B70, + 0,0x3C71,0x3B3B,0x3537, 0, 0, 0,0x4575, + 0,0x5E66, 0, 0, 0,0x5E63,0x3E5D, 0, + 0,0x5E5F, 0, 0, 0, 0,0x3437,0x3D5D, + 0, 0,0x5E60,0x446D, 0, 0, 0, 0, +0x4F46, 0,0x3560, 0, 0, 0, 0,0x365E, +0x4A5A,0x3574,0x5E65, 0,0x5546, 0,0x5E61,0x4C4D, +0x467E, 0,0x4545, 0, 0, 0,0x5234, 0, +0x3E72, 0, 0, 0, 0, 0, 0, 0, +0x4253, 0,0x4C3D,0x3338, 0,0x3D53, 0,0x3F58, +0x4D46,0x515A,0x346B, 0,0x5E64,0x5E5D,0x5E67, 0, +0x6A7E, 0, 0,0x4230,0x5E62, 0, 0,0x5640, +0x3527, 0,0x3274, 0,0x5E68, 0,0x5E72, 0, + 0, 0, 0, 0,0x5E6D, 0,0x5E71, 0, + 0,0x4860, 0, 0, 0,0x5761,0x5E6F,0x4368, +0x4C61, 0,0x3265, 0, 0, 0,0x523E, 0, + 0, 0, 0, 0, 0, 0,0x5E6E, 0, +0x5E6B,0x4E55, 0,0x3427, 0, 0, 0, 0, + 0,0x3F2B,0x3E3E, 0, 0,0x3D52, 0, 0, + 0, 0,0x5E69, 0,0x542E, 0,0x5E5E, 0, +0x5E6A, 0, 0, 0, 0,0x403F, 0,0x5E6C, +0x3273,0x3869,0x4227, 0, 0,0x3D41, 0, 0, + 0, 0, 0,0x5E75,0x5E78, 0, 0,0x322B, +0x3424, 0, 0,0x346A,0x4926, 0, 0, 0, + 0, 0, 0,0x5E76,0x4B51, 0,0x3863, 0, +0x5E77,0x5E7A, 0, 0, 0, 0,0x5E79, 0, + 0, 0,0x4C42, 0,0x3061,0x346E, 0, 0, + 0, 0, 0, 0,0x653A, 0, 0, 0, + 0, 0,0x502F, 0, 0,0x326B, 0,0x6B21, + 0,0x5E74, 0, 0,0x4963,0x5E73,0x305A,0x5221, +0x3177, 0,0x4C2F, 0, 0, 0, 0, 0, + 0, 0,0x5E70, 0,0x4B24, 0, 0, 0, +0x552A, 0, 0, 0, 0, 0,0x5E7B, 0, + 0, 0, 0, 0, 0, 0, 0,0x345D, + 0,0x4426, 0, 0, 0,0x5E7D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x437E,0x4421,0x5F21, 0, 0, 0, 0, 0, + 0, 0,0x414C, 0,0x5E7C,0x3E6F, 0,0x4632, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3345,0x4876, 0, 0,0x4B3A,0x5E7E, 0, + 0,0x5F24, 0, 0, 0, 0,0x5732, 0, + 0, 0, 0, 0,0x3337, 0, 0, 0, + 0,0x4143, 0, 0,0x474B,0x3225,0x3469, 0, +0x572B, 0, 0, 0, 0,0x446C, 0,0x5F22, +0x5F23, 0,0x5F25, 0,0x3A33, 0, 0, 0, +0x5F26, 0,0x405E, 0, 0,0x4943, 0, 0, + 0, 0, 0, 0, 0,0x3259,0x4766, 0, +0x5F27, 0,0x475C, 0, 0, 0, 0,0x5F28, +0x6B22, 0, 0, 0, 0, 0,0x4B53, 0, + 0, 0,0x5F2A, 0,0x5F29, 0,0x3241, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x454A, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F2B, 0, 0, 0, 0, 0, 0, + 0, 0,0x545C, 0, 0, 0, 0, 0, +0x4841, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5F2C, 0, 0, + 0, 0, 0,0x3E70, 0, 0,0x5F2D,0x5627, + 0, 0, 0, 0,0x6A37,0x6B36,0x4A55, 0, +0x587C,0x3844, 0,0x3925, 0, 0,0x3745,0x557E, + 0, 0, 0, 0, 0,0x394A, 0, 0, +0x5027,0x744D, 0, 0,0x3550, 0, 0,0x4374, + 0,0x3E48, 0, 0, 0,0x6B37,0x303D, 0, + 0,0x3D4C, 0,0x4132, 0,0x3156,0x3328, 0, + 0, 0,0x3852,0x4922, 0, 0,0x3658, 0, + 0, 0, 0,0x6B38,0x3E34, 0, 0, 0, +0x4A7D, 0,0x4743, 0,0x557B, 0, 0,0x3773, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4E44, + 0, 0, 0,0x552B,0x3173, 0, 0, 0, +0x6C33,0x305F, 0,0x6C35, 0, 0, 0,0x3637, + 0,0x414F, 0,0x757A,0x5031, 0, 0,0x5565, + 0,0x4E53, 0, 0,0x3D6F,0x3362, 0,0x382B, + 0,0x5536, 0,0x6D3D, 0,0x364F, 0,0x4B39, +0x5042, 0, 0, 0, 0, 0, 0, 0, + 0,0x373D, 0, 0,0x6C36,0x4A29, 0, 0, + 0,0x4554, 0,0x6C39,0x6C38,0x4243,0x6C37, 0, + 0, 0, 0,0x507D,0x6C3A, 0,0x6C3B,0x5765, + 0, 0,0x6C3C, 0, 0, 0,0x6C3D,0x466C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4E5E, 0,0x3C48, 0, 0,0x4855,0x3529,0x3E49, +0x563C,0x5467, 0, 0,0x512E,0x5071,0x6A38,0x6A39, +0x6A3A,0x3A35, 0, 0, 0, 0,0x4A31,0x3F75, + 0, 0,0x4D7A, 0, 0, 0, 0, 0, +0x6A40, 0,0x303A,0x6A3E, 0, 0,0x4025, 0, + 0, 0,0x6A3B, 0,0x327D, 0,0x4377,0x3B68, + 0, 0, 0,0x5257,0x4E74,0x6A3F, 0, 0, + 0,0x6A3C, 0, 0, 0,0x6A43, 0,0x5047, +0x5333, 0, 0, 0, 0,0x343A, 0,0x4341, +0x5772, 0, 0, 0, 0,0x5551, 0,0x4A47, + 0,0x6A45, 0, 0,0x6A44,0x6A47,0x6A46, 0, + 0, 0, 0, 0,0x5667, 0,0x4F54, 0, + 0,0x6A4B, 0,0x3B4E, 0, 0, 0, 0, + 0, 0, 0,0x3D7A,0x494E, 0, 0,0x6A4C, + 0, 0,0x4939,0x4F7E,0x6A4A,0x544E,0x6A4D,0x6A4F, + 0, 0,0x4D6D, 0, 0, 0, 0,0x6A49, + 0,0x6A4E, 0, 0,0x4E6E, 0,0x3B5E, 0, +0x333F, 0, 0, 0, 0, 0,0x4655,0x3E30, +0x4E7A, 0, 0, 0,0x4767, 0,0x3E27,0x6A50, + 0, 0,0x5647, 0, 0, 0,0x4140, 0, + 0, 0,0x545D, 0,0x6A51, 0, 0,0x4F3E, + 0, 0, 0, 0,0x6A52, 0, 0, 0, + 0,0x4A6E, 0, 0, 0, 0,0x452F,0x3035, + 0, 0, 0, 0, 0,0x6A54, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6A53, +0x745F, 0, 0, 0, 0, 0,0x443A, 0, + 0, 0, 0, 0,0x3129, 0, 0, 0, + 0,0x655F, 0, 0, 0, 0,0x6A55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4A6F, 0,0x6A56,0x6A57,0x4658, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A58, 0, + 0,0x6A59, 0, 0, 0, 0, 0, 0, +0x543B, 0,0x477A,0x5237,0x387C, 0, 0,0x6A42, + 0,0x325C, 0, 0,0x427C, 0,0x5478,0x4C66, +0x576E, 0, 0, 0, 0, 0, 0, 0, +0x5442,0x5350,0x6B43,0x4573, 0,0x377E, 0, 0, +0x6B54, 0, 0, 0,0x4B37,0x6B5E, 0,0x404A, + 0, 0, 0,0x4D7B, 0,0x332F, 0,0x465A, + 0, 0, 0, 0, 0, 0,0x6B7C, 0, +0x443E, 0,0x4E34,0x4429,0x313E,0x547D, 0,0x4A75, + 0,0x566C, 0, 0,0x4653,0x3664, 0, 0, + 0, 0,0x3B7A, 0, 0,0x5060, 0, 0, +0x4931, 0,0x5453,0x4828, 0, 0,0x384B, 0, +0x683E,0x493C, 0, 0,0x683B, 0,0x406E,0x5053, +0x3244,0x3465, 0,0x683C, 0, 0,0x5548, 0, + 0, 0, 0, 0,0x3645, 0,0x683D,0x4A78, +0x385C,0x4C75, 0, 0, 0,0x4034, 0, 0, +0x516E,0x683F,0x6842, 0, 0,0x3A3C, 0,0x312D, +0x3D5C, 0,0x6A3D,0x6843, 0,0x6846, 0,0x684B, + 0, 0, 0, 0,0x684C, 0,0x4B49,0x3065, + 0,0x3C2B, 0, 0,0x3939, 0, 0,0x6841, + 0,0x4D77, 0,0x684A, 0, 0, 0, 0, +0x4E76, 0, 0, 0, 0,0x556D, 0,0x4156, +0x6844, 0,0x4336, 0,0x397B,0x5626,0x6848, 0, + 0, 0,0x4A60,0x5466, 0,0x6840, 0,0x6845, +0x6847, 0,0x4739,0x3763, 0,0x6849, 0,0x3F5D, +0x6852, 0, 0,0x6857, 0,0x6855,0x3C5C,0x3C4F, +0x685B, 0, 0, 0, 0, 0, 0, 0, + 0,0x685E, 0,0x685A,0x317A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3058, +0x4433,0x384C,0x4662,0x483E,0x4861, 0, 0, 0, +0x684F,0x6854,0x6856, 0,0x3971,0x6858,0x5775, 0, +0x447B, 0,0x685C, 0, 0,0x3269, 0, 0, + 0,0x6851, 0, 0,0x3C6D, 0, 0,0x3F42, +0x684D,0x5679, 0,0x4178,0x3271, 0, 0, 0, + 0, 0, 0, 0, 0,0x685F, 0,0x4A41, +0x6859, 0, 0, 0, 0,0x5524, 0,0x316A, +0x553B,0x684E,0x6850,0x3630,0x6853, 0,0x685D,0x4038, + 0,0x4A77, 0,0x4B28, 0, 0,0x465C,0x4075, + 0, 0, 0, 0, 0,0x6869, 0, 0, + 0,0x5023, 0, 0, 0, 0, 0, 0, + 0,0x6872,0x566A, 0, 0, 0, 0, 0, + 0, 0,0x6860,0x6861, 0, 0, 0,0x5179, +0x3A4B,0x3879, 0, 0,0x3871,0x5454,0x686F, 0, +0x686E,0x686C,0x3970,0x4C52,0x6866,0x4E26,0x3F72, 0, +0x3038,0x6871,0x6870, 0,0x5740, 0,0x6864, 0, +0x4D29,0x4923, 0,0x3B38,0x3D5B,0x686A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6862,0x6863,0x6865,0x3535,0x6867,0x4745,0x686B,0x686D, +0x3D30,0x572E, 0,0x6878, 0, 0, 0, 0, + 0, 0, 0, 0,0x6875, 0,0x4D30,0x6876, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x413A, 0,0x6868, 0,0x4337,0x3070, 0, + 0, 0, 0, 0, 0, 0, 0,0x6874, + 0, 0, 0,0x6877, 0, 0, 0,0x3923, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4952, 0, 0, 0,0x434E,0x4E60, +0x4066, 0, 0, 0, 0,0x4B73, 0,0x4C5D, +0x5035, 0, 0,0x4A61, 0,0x6873, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3C6C, 0,0x6879, 0, 0, 0, 0, 0, + 0,0x435E, 0,0x4665, 0,0x3977, 0, 0, + 0, 0,0x3074, 0, 0,0x5758, 0, 0, +0x3C2C, 0,0x456F, 0, 0, 0, 0, 0, +0x4C44, 0, 0,0x6926, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x492D, 0, +0x6922,0x4062, 0, 0, 0,0x3F43, 0, 0, + 0,0x687E,0x3957, 0,0x687B, 0, 0, 0, + 0,0x6924, 0, 0, 0,0x524E, 0, 0, + 0, 0, 0,0x6923, 0,0x5632,0x5735, 0, +0x6927, 0,0x3D37, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x687C, +0x687D, 0, 0, 0,0x6921, 0, 0, 0, + 0, 0, 0, 0, 0,0x4D56, 0, 0, +0x522C, 0, 0, 0,0x6932, 0, 0, 0, + 0,0x6929, 0, 0, 0,0x342A, 0,0x343B, + 0, 0,0x692B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5028, 0, 0,0x6925, + 0, 0,0x337E, 0, 0,0x692C,0x4063, 0, +0x692A, 0, 0,0x6939, 0, 0,0x6938, 0, + 0, 0, 0,0x692E, 0, 0,0x687A, 0, + 0,0x6928, 0, 0, 0, 0, 0,0x3F2C, +0x6931,0x693A, 0, 0,0x4225, 0, 0, 0, +0x692F, 0,0x3845, 0,0x692D, 0,0x535C,0x6934, +0x6935,0x6937, 0, 0, 0,0x6947, 0, 0, + 0, 0, 0, 0,0x4046,0x6945, 0, 0, +0x6930, 0, 0,0x693B,0x3071, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x693C, +0x5525, 0, 0,0x693E, 0,0x693F, 0, 0, + 0,0x6941, 0, 0,0x4171, 0, 0,0x4836, + 0, 0, 0,0x693D, 0, 0, 0, 0, + 0,0x6942, 0, 0, 0, 0, 0, 0, + 0, 0,0x6943, 0,0x6933, 0,0x6936, 0, +0x3B31, 0, 0, 0,0x6940, 0, 0, 0, + 0, 0, 0,0x3C77, 0, 0, 0,0x6944, +0x6946, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x694A, 0, 0, + 0, 0,0x694E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x325B, 0,0x6948, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x372E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x694B, +0x694C, 0, 0, 0, 0, 0, 0,0x5541, + 0,0x4423, 0, 0, 0, 0, 0, 0, +0x6958, 0,0x3A61, 0, 0, 0, 0,0x6949, + 0,0x5323, 0, 0, 0,0x6954, 0, 0, + 0, 0, 0, 0, 0,0x6957,0x6950, 0, + 0, 0, 0, 0,0x694F, 0, 0,0x4741, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6952, 0, 0, 0, 0, 0, 0, 0, +0x6959,0x3348, 0,0x6953, 0, 0, 0, 0, + 0,0x4F70, 0, 0, 0,0x694D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3377, 0, 0, 0, 0, 0, 0, + 0,0x6956, 0, 0,0x695A, 0, 0, 0, +0x4C34, 0, 0, 0,0x4F2D, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6955, 0, +0x695C,0x695B, 0, 0, 0, 0, 0,0x695E, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6951, 0, 0, 0, 0, 0, 0, 0, + 0,0x695D, 0,0x695F,0x434A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4737,0x344E,0x3B36,0x5040,0x6C23, 0, 0,0x4537, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x537B, 0, 0, 0, 0,0x6C24, + 0,0x6C25,0x465B, 0, 0, 0,0x3F6E, 0, + 0, 0, 0,0x6C26, 0, 0,0x6C27,0x502A, + 0,0x4738, 0, 0,0x3868, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C28, 0, 0, 0, 0, 0, 0, + 0, 0,0x5639,0x557D,0x344B,0x323D,0x4E64,0x4667, + 0, 0,0x4D61, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3475, 0,0x4B40,0x3C5F, 0, 0, 0, + 0,0x6962,0x6963,0x516A,0x6965, 0,0x3479,0x6964, + 0,0x5133,0x4A62,0x3250, 0,0x6968, 0, 0, + 0, 0,0x6966,0x6967, 0, 0,0x5633, 0, + 0, 0,0x6969,0x696A, 0, 0, 0, 0, + 0,0x696B, 0, 0, 0, 0, 0, 0, + 0, 0,0x696C, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C2F,0x4539,0x364E, 0,0x5273, + 0, 0, 0, 0, 0, 0, 0,0x356E, + 0,0x3B59,0x6C31, 0, 0,0x5263, 0, 0, + 0, 0, 0,0x4E63, 0,0x4438, 0,0x433F, + 0, 0,0x363E,0x5839,0x3148,0x314F,0x3151,0x457E, + 0,0x3150, 0,0x432B, 0, 0, 0, 0, + 0,0x5531, 0, 0, 0, 0, 0, 0, + 0, 0,0x6B24,0x3A41, 0, 0, 0,0x4C3A, + 0, 0, 0,0x6B25, 0,0x6B27, 0, 0, + 0,0x6B28, 0, 0, 0,0x6B26, 0, 0, + 0, 0, 0, 0, 0,0x6B29,0x6B2B,0x6B2A, + 0, 0, 0, 0, 0,0x6B2C, 0,0x4A4F, +0x5835,0x4371, 0,0x4325,0x4678,0x6B2D,0x444A, 0, +0x6B2E,0x6B2F,0x6B30,0x3755, 0, 0, 0,0x377A, + 0,0x6B31,0x4762, 0,0x6B33, 0,0x3A24,0x5175, +0x3031,0x6B32,0x6B34, 0, 0, 0,0x352A,0x4248, +0x4768, 0,0x6B35, 0,0x4B2E,0x635F, 0, 0, +0x5340, 0, 0, 0, 0,0x595B, 0, 0, +0x4D21,0x562D,0x4773, 0, 0, 0,0x5960,0x3B63, + 0,0x3A3A,0x6362, 0, 0, 0, 0, 0, +0x4F2B, 0, 0, 0,0x6360,0x4947, 0,0x3A39, + 0, 0, 0,0x5134,0x6361,0x486A,0x392F,0x3D2D, +0x3358,0x4E5B, 0, 0,0x4C40, 0, 0, 0, +0x6368,0x6369,0x4D74, 0, 0, 0, 0, 0, +0x4C2D, 0,0x3C33, 0,0x636A, 0,0x636B, 0, + 0,0x505A, 0, 0, 0,0x467B,0x375A, 0, + 0,0x475F,0x524A,0x4E56, 0,0x6364,0x636C, 0, +0x4972,0x3341, 0, 0,0x6367, 0, 0,0x4663, +0x6365, 0, 0,0x6D33,0x6366, 0, 0, 0, + 0,0x4933, 0,0x4566, 0, 0, 0,0x3935, + 0,0x433B, 0,0x6363,0x453D,0x4124,0x4259,0x3257, + 0,0x636D,0x3B26,0x442D, 0,0x6370,0x3E5A, 0, + 0,0x637B,0x6375,0x3A53, 0, 0, 0, 0, +0x3750,0x534D, 0,0x564E,0x5553,0x3941,0x5534,0x5158, + 0, 0, 0, 0,0x5039,0x4776, 0, 0, + 0,0x482A,0x3234, 0,0x435A, 0, 0, 0, +0x636E, 0, 0,0x637C,0x636F,0x3728,0x6377,0x6374, + 0, 0, 0,0x373A, 0, 0,0x4522, 0, +0x6376,0x455D,0x3228,0x467C, 0,0x4460, 0, 0, +0x5722, 0,0x4061,0x6379, 0, 0,0x637A,0x637D, +0x4C29,0x6373, 0,0x533E, 0,0x3143,0x6D34,0x6371, +0x6372, 0,0x6378,0x503A,0x4643,0x5473,0x637E, 0, + 0,0x3D60, 0, 0,0x6427, 0, 0,0x6426, + 0, 0, 0,0x5173,0x6423, 0,0x6429, 0, + 0, 0,0x4877, 0, 0, 0, 0,0x4F34, + 0,0x6428,0x642E,0x4265, 0, 0,0x3634, 0, + 0, 0, 0, 0, 0,0x3D72, 0,0x6422, + 0, 0,0x3A69,0x642A, 0, 0,0x642C, 0, + 0,0x367D,0x565E,0x6432, 0,0x642D, 0, 0, + 0,0x6421, 0,0x3B6E,0x4D5D,0x4722,0x4549, 0, + 0,0x4177, 0,0x6424, 0,0x4733,0x3D2C,0x3D3D, +0x6425, 0,0x5747,0x3262, 0,0x642B,0x3C43,0x642F, + 0,0x3B6B,0x6430,0x4528,0x6431, 0, 0, 0, + 0,0x5563,0x3F23, 0,0x643A, 0,0x6437, 0, +0x643B, 0, 0,0x643D, 0, 0,0x4656, 0, + 0,0x3A46,0x404B, 0, 0, 0,0x3821,0x6434, + 0, 0, 0, 0,0x5421, 0, 0,0x3A23, +0x3D7E, 0, 0, 0,0x643C, 0, 0, 0, + 0, 0,0x4D3F, 0, 0,0x4479, 0, 0, +0x4F7B,0x4966, 0, 0,0x533F, 0,0x4F51, 0, + 0,0x6433, 0,0x6438,0x6439,0x4C69, 0, 0, + 0, 0, 0,0x4C4E, 0,0x4054,0x6435,0x4130, +0x6436,0x4E50, 0,0x3B41,0x3553, 0,0x4873,0x3D27, +0x5547,0x492C,0x3822,0x644A, 0, 0,0x644C,0x5144, + 0, 0,0x523A, 0, 0,0x3A2D, 0, 0, +0x3A54, 0, 0, 0, 0, 0, 0,0x6443, +0x356D, 0, 0, 0,0x574D,0x6440,0x4F7D,0x643F, + 0, 0, 0,0x415C,0x4C4A, 0, 0, 0, + 0,0x4A67, 0, 0, 0, 0,0x4457, 0, +0x4C54,0x6448, 0, 0, 0,0x6447,0x6441, 0, +0x6444,0x352D, 0, 0,0x5359, 0,0x6446, 0, + 0, 0, 0,0x5279,0x3463, 0,0x3B34, 0, + 0,0x496E, 0,0x343E, 0, 0, 0,0x3B6C, + 0,0x514D, 0,0x4C6D,0x6D35, 0, 0, 0, + 0, 0, 0, 0, 0,0x4765, 0, 0, + 0, 0,0x5428, 0,0x644B,0x5755,0x6442, 0, +0x3D25,0x6445, 0, 0,0x5366, 0,0x6449,0x4978, + 0, 0,0x643E, 0, 0,0x5365, 0, 0, +0x477E,0x3649, 0,0x547C,0x3233,0x6457, 0, 0, + 0,0x4E42, 0,0x644D, 0,0x4E3C, 0,0x385B, + 0, 0,0x6456, 0,0x3F4A, 0, 0, 0, +0x534E, 0,0x436C, 0, 0, 0, 0, 0, + 0, 0, 0,0x4548,0x6458, 0, 0, 0, + 0, 0, 0, 0, 0,0x4D44,0x644F, 0, + 0, 0, 0,0x6454,0x6455, 0,0x3A7E, 0, +0x4F66, 0, 0,0x553F, 0, 0, 0,0x6452, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6450, 0, 0,0x644E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4D65,0x4A2A, + 0, 0, 0,0x4023, 0,0x3D26,0x6453, 0, + 0,0x3848, 0, 0, 0, 0, 0,0x6467, +0x5434, 0, 0, 0, 0, 0, 0, 0, +0x645B, 0, 0, 0,0x416F, 0, 0,0x6469, + 0, 0,0x5267, 0, 0,0x645F, 0,0x6460, + 0, 0,0x4F2A, 0, 0, 0, 0,0x4B5D, + 0,0x645A,0x6451, 0,0x6465, 0,0x485C,0x6463, + 0, 0,0x4467,0x6462, 0,0x6461, 0, 0, + 0,0x337C,0x6468, 0, 0, 0, 0,0x3561, + 0, 0, 0,0x574C, 0, 0, 0,0x6466, + 0,0x3B2C, 0,0x5752,0x4C4F,0x6B78, 0,0x6464, + 0, 0,0x3976, 0, 0, 0,0x564D,0x6459, +0x645C,0x427A,0x645E, 0,0x424B,0x4044,0x4250, 0, +0x3175,0x4C32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x354E, 0, 0, 0, + 0,0x646F, 0, 0, 0, 0, 0, 0, + 0, 0,0x462F, 0, 0, 0,0x4661, 0, + 0,0x6475, 0, 0, 0, 0, 0,0x4229, + 0, 0, 0,0x406C,0x515D,0x646E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x442E, 0, 0, 0,0x646D, 0, 0, 0, + 0,0x6476,0x6474,0x427E, 0,0x645D, 0,0x6470, + 0,0x4A7E, 0,0x5544, 0, 0,0x6471, 0, + 0, 0, 0, 0, 0, 0,0x517A, 0, + 0, 0, 0, 0, 0, 0,0x646B,0x646C, + 0, 0, 0,0x6472, 0,0x4E2B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x454B, 0, 0, 0,0x4731, 0,0x423A, 0, + 0, 0,0x646A, 0, 0, 0,0x414A, 0, + 0, 0, 0, 0, 0,0x4C36,0x3331, 0, + 0, 0,0x647B, 0,0x6473, 0, 0, 0, +0x647A, 0,0x647D, 0,0x647C, 0, 0, 0, + 0, 0, 0, 0,0x334E, 0, 0, 0, +0x333A,0x6477, 0, 0,0x6479,0x6478,0x456C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x403D, 0, 0, 0, + 0,0x5468, 0, 0, 0, 0, 0,0x6522, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3044, 0, 0,0x6524, 0, + 0,0x6523, 0, 0, 0, 0, 0, 0, +0x3C24, 0,0x6525, 0, 0, 0, 0, 0, + 0,0x6521, 0, 0, 0, 0, 0, 0, + 0,0x647E,0x3174, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6528, 0, +0x6529,0x6526, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6527,0x652A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4659, 0, 0, 0, 0, 0, 0, + 0, 0,0x652B,0x652D, 0, 0, 0, 0, + 0, 0, 0,0x652C, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x652F, 0, 0, + 0,0x652E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3960, 0, 0,0x6530, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6531, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3B70,0x6C61,0x4370, 0,0x3546, +0x3B52, 0, 0, 0, 0,0x4169,0x546E, 0, +0x3E44, 0, 0, 0,0x5746, 0,0x5456,0x3253, +0x6C3E, 0, 0, 0, 0,0x6A41, 0, 0, + 0,0x422F,0x3436, 0, 0, 0,0x5157, 0, + 0, 0,0x3334, 0,0x4832,0x3F3B,0x6C40, 0, + 0,0x564B, 0, 0,0x6C3F,0x6C41, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C45,0x3E66,0x4C3F,0x455A,0x3E3C, + 0,0x6C46, 0,0x317E, 0, 0, 0,0x6C44, +0x5528,0x3563, 0,0x6C42,0x4136,0x3363, 0, 0, +0x6C43,0x4B38,0x4043,0x4C7E, 0, 0, 0, 0, +0x4152, 0,0x6C48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3A66,0x4053, 0,0x5672, 0, 0, 0,0x514C, + 0, 0, 0, 0,0x3F3E, 0,0x3733,0x4955, +0x6C47,0x3B62, 0,0x4C4C,0x3D7D,0x4848, 0,0x4F29, + 0, 0, 0, 0, 0, 0, 0,0x4D69, + 0,0x456B, 0, 0, 0,0x3769, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5149,0x3A38, 0, 0, 0, 0, 0, +0x6C49, 0, 0,0x6C4A, 0,0x3B40,0x6C4B, 0, +0x6C62,0x313A,0x3759, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3D39, 0, + 0, 0, 0, 0, 0, 0, 0,0x6C4C, +0x5166,0x6C4D, 0, 0, 0, 0,0x483B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C51, 0, 0, + 0, 0,0x6C53, 0,0x3B4D, 0,0x3C65, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C4F, 0,0x4937, 0, + 0, 0, 0, 0,0x433A, 0,0x6C63,0x5555, +0x6C50, 0, 0, 0, 0, 0,0x5673, 0, + 0, 0,0x6C52,0x6C4E, 0, 0, 0, 0, +0x6C54, 0,0x6C55, 0, 0,0x493F, 0, 0, + 0, 0, 0, 0,0x4F28, 0, 0, 0, + 0, 0,0x505C, 0, 0, 0, 0,0x512C, + 0, 0, 0, 0,0x485B, 0, 0, 0, +0x6C56,0x4E75, 0, 0, 0, 0, 0,0x4A6C, +0x6C5A, 0, 0, 0, 0, 0, 0, 0, +0x6C59, 0, 0, 0,0x303E, 0, 0, 0, + 0, 0, 0,0x6C57, 0,0x6C58, 0, 0, + 0,0x6C64, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x483C, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4147, 0, + 0, 0, 0, 0,0x6C5C,0x5160, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C5B, 0, 0, 0, 0,0x546F, 0,0x6C5D, + 0, 0, 0, 0, 0, 0,0x5B46, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C5E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x312C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C5F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C60, 0,0x5726, 0,0x4540, 0, 0, 0, +0x6B3C,0x302E, 0, 0, 0,0x3E74,0x3838,0x522F, +0x3056,0x3579, 0,0x5833, 0,0x4B2C, 0,0x635D, + 0, 0, 0, 0, 0, 0, 0,0x462C, +0x3066, 0, 0, 0,0x4546,0x6B39, 0, 0, + 0, 0,0x6B3A, 0, 0, 0,0x6B3B, 0, + 0,0x5140, 0,0x4523, 0,0x6A72, 0,0x4432, + 0,0x4435,0x404E, 0, 0, 0,0x6A73,0x4441, + 0,0x4E6F, 0, 0, 0, 0,0x6A70,0x6A74, + 0, 0,0x497C, 0, 0,0x4723, 0, 0, + 0,0x4C58,0x4E7E, 0, 0, 0,0x6A75,0x6A76, +0x4F2C,0x4067, 0, 0,0x6A77, 0, 0, 0, + 0, 0,0x363F,0x6A78, 0,0x6A79, 0,0x6A7A, + 0, 0,0x6A7B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6A71, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x482E,0x616B, 0,0x3738, +0x616C, 0, 0, 0,0x616D, 0,0x5734,0x616E, +0x616F,0x534C, 0, 0, 0, 0, 0, 0, + 0,0x6171,0x3F71,0x6170,0x3552, 0, 0, 0, +0x3137, 0, 0, 0, 0,0x6173,0x6172, 0, +0x3A7C, 0,0x6174, 0, 0, 0, 0,0x3937, + 0,0x3E51, 0, 0, 0, 0,0x447C, 0, +0x3A5D,0x3D46, 0, 0, 0, 0, 0, 0, +0x6175,0x6177, 0, 0,0x3640,0x4F41,0x4A28,0x6176, +0x5578,0x537C,0x6178,0x617C,0x6179, 0, 0,0x617A, +0x406A, 0,0x617E,0x6221,0x4047, 0, 0, 0, + 0,0x617B, 0,0x617D, 0, 0, 0, 0, + 0, 0,0x6225, 0, 0, 0,0x4154, 0, + 0, 0, 0,0x6223, 0,0x6228,0x327E,0x6222, + 0, 0, 0,0x434D,0x3242,0x6227,0x6226, 0, + 0,0x6224,0x6229, 0, 0,0x622B, 0, 0, + 0,0x5049,0x566D,0x4328,0x622C, 0,0x4F57, 0, + 0,0x622E, 0, 0,0x3A6F, 0, 0,0x6960, +0x622D,0x622A, 0, 0, 0, 0,0x3B2B,0x5433, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6230, 0, 0, +0x622F, 0,0x6961, 0, 0, 0, 0,0x6231, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6232, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6233,0x4C21, 0,0x6234, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6235, 0, + 0, 0, 0, 0,0x507E, 0, 0,0x424A, + 0,0x5371, 0,0x4D75, 0, 0,0x6760, 0, + 0,0x6761, 0, 0, 0, 0,0x3E41, 0, + 0, 0, 0,0x426A, 0, 0, 0,0x6764, + 0, 0,0x6763, 0, 0, 0, 0, 0, + 0,0x4D66, 0,0x4335, 0, 0,0x6762,0x3B37, +0x4F56, 0,0x4161,0x6769, 0, 0, 0,0x6768, + 0, 0,0x6774,0x3223, 0, 0, 0, 0, +0x676A, 0,0x6766, 0, 0, 0, 0, 0, +0x676C,0x676B,0x493A, 0, 0,0x5564, 0,0x6765, +0x3729,0x6767, 0, 0, 0, 0, 0, 0, + 0,0x676E, 0, 0, 0, 0,0x6773, 0, +0x5669, 0, 0, 0, 0,0x676D, 0,0x6772, + 0,0x6771, 0, 0, 0,0x3060, 0, 0, + 0, 0,0x6775, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4772, 0,0x4045,0x406D, 0, + 0,0x4170,0x6770, 0, 0, 0, 0,0x6776, +0x4B76, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6822,0x6821, 0, 0, 0, 0, + 0, 0,0x5741, 0, 0,0x677A,0x6779, 0, +0x677B, 0,0x6777, 0,0x677E, 0,0x677D, 0, +0x677C, 0, 0,0x4155,0x4759,0x457D,0x4543, 0, + 0, 0, 0, 0,0x476D, 0, 0, 0, + 0,0x6823, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6826, 0,0x6825, + 0,0x6827,0x3A77,0x6778,0x6824, 0,0x4870,0x492A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6829, 0, 0, +0x3965, 0, 0, 0, 0, 0,0x517E,0x6828, + 0, 0, 0, 0, 0, 0,0x682A, 0, +0x682D,0x682E, 0,0x4127, 0, 0, 0,0x682F, + 0, 0, 0,0x6830, 0, 0,0x682C, 0, +0x6834, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x682B, 0,0x6831, 0, + 0, 0, 0, 0, 0, 0, 0,0x6835, +0x6832,0x6833, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6836, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x394F, 0,0x702C, 0, +0x702D, 0,0x4630,0x306A,0x483F, 0,0x4D5F, 0, + 0, 0, 0, 0, 0, 0,0x4E4D,0x6A31, + 0, 0, 0, 0,0x6A32, 0,0x463F,0x3449, + 0, 0, 0, 0, 0, 0, 0,0x6A33, + 0, 0, 0, 0,0x5567, 0, 0, 0, + 0, 0, 0, 0, 0,0x5D79, 0,0x6A34, + 0,0x6A35, 0,0x6A36, 0, 0, 0, 0, +0x384A,0x5F30,0x4975, 0,0x4C70, 0, 0,0x497A, + 0, 0, 0, 0, 0,0x497B, 0, 0, +0x5343,0x4B26, 0,0x3826,0x702E,0x3142, 0,0x6538, +0x4C6F,0x5349,0x3C57,0x496A, 0,0x3567, 0,0x4450, +0x3569, 0,0x6E2E,0x3B2D, 0, 0,0x675E, 0, +0x6E2F, 0, 0, 0, 0,0x3329, 0, 0, +0x6E32, 0, 0,0x6E31,0x3D67, 0,0x6E30,0x4E37, + 0, 0, 0, 0,0x454F, 0, 0, 0, + 0,0x4174,0x5B4E,0x6E33,0x5073, 0, 0, 0, + 0, 0, 0, 0, 0,0x4254,0x4668, 0, + 0, 0,0x372C, 0, 0, 0, 0, 0, + 0, 0,0x6E34, 0,0x336B, 0, 0, 0, +0x3B7B,0x6E35, 0, 0, 0, 0, 0,0x675C, + 0, 0, 0,0x6E36, 0, 0,0x3D2E, 0, + 0, 0, 0,0x7162, 0, 0, 0,0x4A68, + 0,0x5249,0x705A, 0,0x705B, 0,0x705C,0x4146, + 0,0x386D,0x3E4E, 0, 0,0x705E, 0,0x4531, +0x705D,0x5171, 0,0x7060,0x304C,0x3D6A, 0, 0, + 0, 0, 0,0x525F,0x705F, 0,0x342F,0x3768, +0x7066,0x7065,0x4623,0x7061,0x7062,0x3443, 0, 0, +0x7063,0x556E, 0, 0,0x4C5B,0x3E52,0x3C32, 0, + 0, 0,0x7068,0x7067,0x7064,0x3221, 0,0x5622, +0x5338,0x3E37,0x482C, 0, 0,0x706A, 0, 0, + 0, 0,0x5177, 0,0x564C,0x3A5B,0x7069, 0, +0x363B, 0, 0,0x4D34, 0, 0,0x4626, 0, + 0, 0,0x4121,0x706B,0x706E, 0,0x706D,0x7070, +0x706C, 0,0x3B3E,0x706F, 0, 0, 0, 0, +0x4C35,0x7072, 0, 0,0x3355, 0, 0, 0, + 0,0x3154, 0, 0,0x7073, 0, 0,0x7074, +0x7076,0x3461, 0,0x7071, 0,0x7077, 0, 0, + 0, 0,0x707A, 0,0x7078, 0, 0, 0, +0x7075, 0, 0, 0, 0,0x707D, 0,0x7079, +0x707C,0x707E, 0,0x7121, 0, 0, 0,0x4E41, +0x7124, 0,0x7123, 0,0x4176,0x707B,0x4A5D, 0, + 0,0x3471,0x3171,0x4C31, 0,0x7126, 0, 0, +0x7127, 0, 0,0x712C,0x554E,0x7129, 0, 0, +0x4833, 0, 0, 0,0x7122, 0,0x712B,0x7128, +0x7125, 0, 0,0x712A, 0, 0, 0, 0, + 0, 0, 0, 0,0x3029,0x712D, 0, 0, + 0, 0, 0, 0,0x712F, 0,0x7131, 0, + 0, 0, 0, 0,0x7130, 0,0x712E, 0, + 0, 0, 0,0x5122, 0, 0, 0, 0, + 0, 0, 0,0x7132, 0, 0, 0,0x7133, + 0, 0, 0, 0, 0, 0, 0, 0, +0x396F, 0, 0,0x3547, 0,0x3057,0x3059, 0, + 0, 0,0x546D, 0,0x3544, 0,0x3D54,0x3B4A, +0x7027, 0, 0,0x385E, 0, 0,0x7028, 0, + 0,0x3028, 0,0x7029, 0, 0,0x4D6E, 0, + 0,0x702A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x702B, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4624, 0, + 0,0x5665,0x7164, 0,0x7165, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4373, + 0, 0,0x535B, 0, 0,0x5651,0x4568, 0, +0x532F, 0,0x5266, 0, 0,0x6E41,0x303B,0x5535, +0x514E,0x3C60,0x3A50, 0,0x3F78, 0,0x3847,0x3541, +0x454C, 0, 0,0x4A22, 0, 0, 0,0x434B, + 0, 0, 0, 0, 0,0x6E42, 0, 0, + 0, 0, 0, 0, 0, 0,0x443F,0x3622, + 0,0x6D6C,0x4324, 0,0x5631, 0, 0, 0, +0x4F60,0x6D6F, 0, 0,0x454E, 0,0x365C, 0, + 0,0x4A21, 0, 0,0x6D6D, 0, 0,0x6D70, +0x6D71,0x433C, 0,0x3F34, 0,0x6D6E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6D74,0x6D72, 0, 0, 0, 0,0x5566, +0x435F, 0,0x6D73, 0, 0, 0,0x6D76, 0, +0x5523,0x5123, 0, 0, 0,0x6D75, 0,0x4350, + 0, 0, 0, 0, 0,0x6D77,0x3F74,0x3E6C, +0x6D78, 0,0x4C77, 0,0x515B, 0, 0, 0, +0x5745,0x5576, 0,0x6D7C, 0, 0, 0,0x6D7B, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6D79,0x6D7A, 0, 0, 0, 0, 0, 0, + 0, 0,0x6D7D,0x3E26, 0, 0, 0, 0, + 0,0x4B2F,0x6E21,0x363D, 0,0x6E22,0x4440, 0, +0x6D7E, 0, 0,0x3D5E,0x3247, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3643, 0, 0, 0,0x6E25,0x583A,0x6E23, +0x6E26, 0, 0, 0,0x4369,0x3372, 0, 0, + 0, 0, 0, 0,0x6E27,0x6E24,0x4F39, 0, + 0,0x6E28,0x4277, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6E29, +0x6E2A, 0,0x5E2B, 0, 0,0x4633, 0,0x4746, + 0,0x5675,0x3549, 0,0x4B32, 0, 0, 0, +0x6E2B, 0, 0,0x4D2B, 0,0x6E2C, 0, 0, + 0, 0, 0,0x5530, 0,0x6E2D, 0,0x7644, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5B47, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3423, + 0, 0, 0,0x432C,0x7166, 0, 0, 0, + 0, 0,0x4A38,0x5253, 0,0x562A, 0,0x6F72, + 0,0x3E58, 0,0x3D43,0x6F73,0x364C,0x302B, 0, + 0, 0, 0,0x4A2F, 0, 0,0x6D36, 0, +0x6D37, 0, 0, 0, 0,0x4E79,0x372F,0x3F73, +0x6D38,0x426B,0x4930, 0, 0, 0, 0, 0, + 0,0x6D39, 0, 0,0x4676,0x3F33, 0, 0, + 0,0x6D3C,0x4578, 0,0x5150, 0,0x5729,0x6D3A, +0x6D3B, 0,0x5162, 0,0x6D3F,0x6D40, 0,0x6D44, + 0, 0, 0,0x6D48, 0,0x6D46,0x6D4E,0x5568, + 0,0x6D49, 0, 0,0x6D47,0x6D3E, 0, 0, +0x4569, 0, 0, 0,0x4646, 0, 0,0x4969, +0x5452,0x6D41,0x6D42,0x6D43,0x6D45, 0,0x4079, 0, +0x3421, 0, 0, 0, 0,0x3968, 0,0x6D50, + 0, 0, 0, 0,0x6D51, 0,0x6D4A, 0, +0x6D4F, 0,0x4E78, 0, 0,0x4B36,0x6D4C,0x6D4D, + 0, 0, 0, 0, 0,0x4F75, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6D52,0x4172,0x5332,0x6D4B,0x4837, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C6F, + 0, 0, 0, 0,0x4570, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6D56, + 0,0x356F, 0, 0,0x4235,0x302D,0x4B69, 0, + 0,0x312E, 0,0x6D54, 0, 0, 0,0x4D6B, +0x3562, 0,0x6D55,0x6D53,0x6D57, 0, 0,0x357A, + 0,0x6D58, 0,0x6D59, 0,0x6D5C, 0,0x314C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4576,0x3C6E,0x6D5A,0x4C3C,0x326A, 0, 0, 0, + 0,0x6D5B, 0, 0, 0, 0,0x446B, 0, + 0,0x3445, 0, 0, 0,0x3075, 0, 0, + 0,0x6D5F,0x405A,0x3468, 0, 0, 0, 0, +0x454D, 0, 0, 0,0x6D5D,0x3F44, 0, 0, + 0,0x6D5E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4425, 0, 0, 0,0x6D60, 0, 0, 0, + 0, 0,0x6D61, 0,0x6D63, 0, 0,0x4157, + 0, 0,0x3B47, 0, 0, 0, 0, 0, + 0,0x3D38, 0, 0, 0,0x6D62, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6D64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D66, 0, + 0, 0, 0, 0,0x6D65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6D67, 0, 0, 0, + 0, 0,0x4A3E,0x6C6A,0x4071, 0,0x4967, 0, +0x6C6B,0x466E, 0, 0, 0, 0,0x6C6C, 0, +0x466D,0x6C6D, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C70, 0, 0,0x5766,0x6C73, + 0, 0,0x6C71,0x6C6E,0x6C6F,0x5723,0x4971,0x4B6E, +0x6C74, 0,0x6C72, 0, 0,0x4F69, 0,0x6C76, +0x4631, 0, 0, 0, 0,0x3C40, 0,0x6C75, + 0, 0, 0, 0, 0, 0, 0,0x353B, +0x3B76, 0,0x6C77, 0, 0, 0, 0, 0, +0x5977,0x3D7B, 0, 0,0x423B,0x6C78, 0, 0, + 0, 0,0x6C79, 0, 0, 0, 0,0x3823, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6C7A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6C7B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C7C, 0, 0, 0, 0, + 0,0x536D,0x582E,0x406B, 0,0x475D,0x3A4C, 0, +0x5063,0x4B3D, 0,0x4D3A, 0, 0,0x3851, 0, + 0,0x317C, 0,0x476F, 0,0x5656, 0, 0, + 0,0x3F46,0x436B, 0, 0,0x6F75, 0, 0, +0x4358, 0, 0, 0, 0, 0, 0,0x5762, + 0, 0, 0,0x6F77,0x3353, 0,0x4758,0x516D, + 0,0x5648, 0,0x6F78, 0,0x6F76, 0,0x3B7D, +0x3346, 0, 0, 0, 0, 0, 0, 0, +0x3D55, 0, 0,0x5246, 0,0x3B60, 0, 0, +0x4F21, 0,0x6F7C,0x6F7B, 0, 0,0x6F79, 0, + 0, 0, 0,0x334C, 0,0x4954,0x4B30, 0, + 0, 0, 0, 0,0x6F7E, 0, 0,0x305E, + 0, 0,0x5649, 0, 0, 0,0x6F7D, 0, +0x336D, 0, 0,0x7655, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4E48, 0, 0, 0,0x7022, + 0,0x7021, 0,0x353E,0x3C5A,0x3B7C, 0,0x3865, + 0, 0, 0, 0, 0, 0,0x4442, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7023, 0, 0, 0, 0, 0,0x4B6B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7026, 0, 0, 0,0x5128, 0,0x3E3F,0x476E, +0x7136,0x7137,0x3F55, 0, 0, 0, 0,0x3429, +0x7138,0x4D3B, 0,0x4754,0x552D, 0,0x7139, 0, +0x713A, 0, 0, 0, 0,0x474F, 0, 0, + 0,0x5224,0x564F, 0, 0,0x713B,0x3D51,0x3430, +0x3E3D, 0, 0, 0,0x345C,0x4E51, 0,0x3F5F, +0x713D, 0, 0, 0, 0,0x3F7A,0x713C, 0, +0x713F, 0, 0, 0,0x713E,0x7140, 0, 0, + 0, 0, 0,0x7141, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x417E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4122, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A7A, 0, + 0,0x553E, 0, 0, 0, 0,0x3E3A,0x3E39, +0x5542, 0, 0,0x3F22, 0,0x4D2F,0x7135, 0, + 0, 0, 0, 0, 0,0x3D5F, 0,0x364B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5671,0x7343, 0, 0,0x7344, 0,0x384D, + 0, 0, 0,0x7346,0x7347, 0,0x304A, 0, +0x7345, 0,0x7349,0x4B71, 0, 0, 0,0x734B, + 0,0x5026, 0, 0,0x314A,0x7348, 0, 0, + 0,0x734F, 0,0x3551, 0, 0,0x7357, 0, +0x7352, 0, 0, 0,0x7354,0x7353,0x377B, 0, +0x313F, 0,0x734E,0x734A,0x355A, 0,0x7350, 0, + 0,0x7351, 0,0x7355, 0, 0, 0, 0, +0x734D, 0,0x3C63, 0,0x417D, 0,0x7356, 0, + 0, 0, 0, 0, 0,0x735A, 0,0x734C, + 0,0x3548, 0,0x3D6E,0x735C, 0, 0,0x3724, +0x3F70,0x567E,0x4D32, 0,0x3470, 0,0x325F, 0, +0x7358, 0,0x7359,0x4938, 0,0x735D, 0, 0, +0x735E, 0,0x7361, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x735F, 0, + 0,0x7363,0x7362, 0, 0,0x735B, 0,0x3F6A, + 0,0x336F, 0,0x7360, 0, 0,0x4729, 0, +0x3C72, 0, 0, 0, 0,0x736B, 0, 0, + 0, 0, 0, 0, 0,0x393F, 0, 0, +0x7364, 0, 0, 0,0x322D,0x3B7E, 0,0x4B63, + 0, 0, 0, 0,0x736D,0x7369, 0, 0, + 0,0x395C,0x736E, 0, 0, 0,0x7365,0x7366, +0x736A,0x4261,0x736C,0x736F,0x7368,0x3C7D, 0, 0, + 0,0x4F64, 0, 0,0x7370, 0, 0, 0, +0x7367, 0, 0, 0, 0, 0, 0, 0, + 0,0x7372, 0, 0, 0, 0,0x572D,0x462A, + 0, 0, 0, 0,0x7373, 0, 0, 0, + 0,0x7371, 0,0x4228, 0, 0, 0, 0, + 0,0x385D,0x7375, 0, 0,0x7374, 0, 0, + 0,0x345B, 0, 0, 0,0x7376,0x7377, 0, + 0, 0,0x7378, 0, 0, 0,0x403A, 0, + 0,0x4069, 0, 0, 0, 0, 0,0x4571, + 0, 0, 0, 0,0x737B, 0,0x737A, 0, + 0, 0, 0, 0, 0, 0, 0,0x3458, + 0, 0, 0,0x737E,0x7379, 0, 0,0x737C, + 0, 0, 0, 0, 0, 0,0x737D, 0, + 0, 0, 0, 0, 0, 0, 0,0x7421, + 0, 0, 0, 0, 0, 0,0x7423,0x3B49, + 0, 0,0x7422, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7424, 0, 0, 0, 0, 0, 0,0x323E, +0x7426,0x7425, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C2E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4357,0x5961, 0, 0, 0, + 0, 0, 0,0x4060,0x744C,0x5751, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x375B, 0, 0, 0, 0, 0, 0, + 0,0x744E,0x4123, 0, 0,0x4649, 0,0x3456, +0x5533, 0, 0, 0,0x7450,0x744F,0x7451,0x4B5A, + 0, 0,0x7452, 0,0x5441,0x5660, 0, 0, + 0, 0,0x3760, 0, 0, 0,0x4138, 0, + 0,0x413B,0x7453,0x3E2C, 0, 0, 0, 0, + 0,0x3462, 0, 0,0x7454,0x7455,0x3E2B, 0, + 0,0x7456, 0, 0, 0,0x745B, 0,0x7457, +0x745A, 0,0x3A7D, 0,0x7458,0x7459, 0, 0, + 0, 0, 0, 0, 0,0x3862,0x4C47,0x745C, + 0,0x325A, 0, 0,0x4353, 0, 0,0x5463, +0x3F37, 0, 0, 0, 0, 0, 0, 0, +0x745D, 0, 0, 0, 0, 0, 0,0x4534, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7469, 0, 0,0x4F35, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4E49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4B58, 0,0x4B77, 0, 0, 0, 0,0x3D74, + 0, 0, 0,0x574F, 0, 0, 0,0x405B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5075, 0, + 0, 0, 0, 0, 0, 0, 0,0x746A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x746B, 0, + 0, 0, 0, 0, 0, 0,0x746C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x7763, 0, 0, 0, 0, + 0,0x3731, 0, 0, 0, 0, 0,0x746D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x576B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x746E, 0, 0, 0,0x6679, +0x3E40,0x667A,0x3A6C,0x667B,0x4F4B,0x667C,0x543C,0x3C36, +0x667D,0x667E,0x3C4D,0x4852,0x4E33,0x6721, 0,0x343F, +0x6722,0x4934,0x3859,0x4449, 0,0x575D,0x425A,0x3757, +0x563D,0x4E46,0x3744, 0, 0,0x4526,0x6723,0x4F5F, +0x6724,0x6725,0x6726,0x4137,0x5769,0x4970,0x4F38,0x562F, +0x5655,0x6727,0x306D,0x6728,0x6729,0x495C,0x526F,0x3E2D, +0x672A,0x3073,0x485E,0x3D61,0x672B,0x4846, 0,0x672C, +0x3B66,0x3878,0x5124,0x672D,0x4267,0x3E78,0x3D4A,0x4D33, +0x672E,0x672F,0x3E6E,0x5065, 0,0x4B67,0x4C50,0x3C4C, +0x6730,0x3C28,0x5077,0x6731, 0,0x5078,0x6732,0x6733, +0x3442,0x6734,0x6735,0x497E,0x4E2C,0x4360,0x6737,0x3141, +0x3371, 0,0x6738,0x6739,0x575B,0x5540,0x673A,0x424C, +0x573A,0x673B,0x673C,0x673D,0x3C6A,0x4365,0x4042,0x673E, +0x673F,0x3C29, 0,0x6740,0x6741,0x6736,0x3650,0x6742, + 0,0x6743,0x6744,0x3B3A,0x355E,0x4246,0x3160,0x6745, +0x5435,0x6746,0x383F,0x6748,0x6747,0x376C, 0,0x6749, +0x3278,0x674A,0x674B,0x674C,0x674D,0x674E,0x674F,0x6750, +0x5327,0x4B75,0x6751,0x6752,0x6753,0x6754,0x4949,0x6755, +0x6756,0x6757,0x6758,0x6759,0x3D49,0x675A,0x733E, 0, +0x3857, 0,0x4831, 0, 0, 0, 0, 0, + 0, 0,0x733F, 0,0x7340,0x7341, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x395E,0x4D78, 0, 0,0x5868,0x3A31, 0,0x425E, +0x6E37, 0,0x3723, 0, 0, 0, 0,0x6E39, + 0,0x6E38,0x3055, 0, 0, 0, 0, 0, +0x6E3B,0x5556,0x576F, 0, 0, 0,0x5643, 0, + 0,0x6E3D,0x4A70, 0,0x6E3C, 0, 0, 0, + 0,0x6E3E, 0, 0, 0, 0,0x6E40, 0, + 0,0x6E3F, 0, 0, 0, 0, 0, 0, + 0, 0,0x5172, 0,0x473C, 0,0x4340, 0, + 0, 0, 0, 0,0x3861, 0, 0, 0, + 0, 0,0x4167, 0, 0,0x7446,0x505F,0x7447, + 0,0x4F5B, 0, 0,0x483A, 0, 0,0x7448, + 0, 0, 0, 0, 0, 0, 0,0x7449, +0x744A, 0,0x744B, 0, 0, 0, 0, 0, +0x597A,0x387E, 0, 0,0x6571,0x5370, 0,0x7460, + 0,0x4E4C, 0, 0, 0,0x3361, 0, 0, + 0, 0,0x7134, 0,0x526E, 0,0x7461, 0, + 0, 0, 0, 0,0x4F68,0x7462, 0, 0, +0x474C, 0, 0, 0, 0, 0, 0,0x3554, +0x3464,0x7464, 0, 0, 0,0x7463,0x7465, 0, + 0,0x7466, 0, 0, 0, 0,0x7467, 0, +0x3A32,0x303F, 0,0x7468, 0, 0, 0, 0, + 0, 0, 0,0x372D,0x526D, 0, 0, 0, +0x522B,0x404F, 0,0x3F3C,0x6B23,0x555F,0x6A48, 0, + 0, 0, 0,0x7173,0x3678,0x4B23, 0, 0, +0x444D, 0,0x7167, 0,0x7168,0x387B,0x7169,0x3A44, +0x5445,0x3052, 0, 0,0x716A, 0, 0, 0, +0x716B, 0,0x716C, 0, 0,0x716D,0x716E,0x716F, +0x7171,0x7170,0x4555, 0, 0, 0, 0, 0, + 0,0x7172, 0,0x367A, 0,0x7174,0x522E,0x5E47, +0x4B4A, 0, 0,0x335C, 0,0x3522, 0,0x3922, + 0, 0,0x4474,0x7175, 0, 0,0x7176, 0, + 0, 0,0x4144,0x417B,0x5630,0x7177, 0, 0, + 0, 0,0x7178, 0,0x412A, 0, 0, 0, +0x4638, 0,0x3E5B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7179,0x344F, 0, 0, 0, 0, 0, + 0,0x717A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6D32, +0x6D31, 0, 0,0x4B60,0x525E, 0,0x4B41,0x5558, + 0,0x4862, 0,0x405F,0x3C21, 0, 0, 0, + 0, 0, 0,0x6B41, 0, 0,0x5024, 0, +0x5662, 0,0x3647,0x3858,0x6B40,0x384E, 0,0x6B3F, +0x3326,0x3949,0x562B, 0,0x3774,0x374A, 0, 0, + 0,0x3C67,0x373E,0x6B46, 0,0x6B47,0x3039,0x3F4F, + 0,0x6B45,0x537D, 0,0x6B48, 0, 0,0x6B49, + 0, 0,0x374E, 0,0x6B42,0x6B44,0x4976,0x5657, +0x554D,0x5032,0x6B4F,0x4E38,0x6B50, 0,0x3528, 0, + 0, 0, 0, 0,0x3133,0x6B52,0x4C25, 0, + 0, 0, 0, 0, 0, 0,0x4556,0x6B53, + 0,0x6B51,0x455F,0x6B4E,0x4A24,0x6B55,0x307B, 0, + 0,0x3A7A, 0, 0,0x5837,0x7163, 0,0x6B4A, +0x6B4B,0x6B4C,0x6B4D,0x6B56,0x6640,0x6B59, 0,0x3F68, +0x5248,0x6B57,0x6B5C,0x386C,0x6B58, 0,0x3D3A, 0, +0x5058, 0,0x3037, 0,0x6B5D,0x445C, 0, 0, + 0, 0,0x562C, 0, 0, 0,0x3460, 0, + 0,0x4276,0x3C39, 0, 0,0x6B5A,0x6B5B,0x5460, +0x466A,0x4454,0x6B5F,0x4527,0x5975, 0,0x3231, 0, +0x6B64, 0,0x3D45, 0, 0, 0,0x6B62, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6B63, 0, 0,0x382C, + 0,0x4D51,0x6B65, 0, 0, 0,0x6B61, 0, +0x4133, 0, 0, 0, 0, 0,0x4622, 0, + 0, 0, 0, 0, 0, 0,0x4C73, 0, +0x6B66, 0,0x4030,0x5238,0x6B67, 0, 0, 0, +0x382F,0x382D, 0,0x6B68,0x473B,0x4D73, 0, 0, + 0,0x6B6A,0x6B6B, 0, 0, 0, 0, 0, +0x6B6D, 0, 0, 0, 0,0x5048, 0,0x6B72, + 0,0x6B6E, 0, 0, 0,0x6B71,0x4879, 0, +0x517C,0x6B6C, 0, 0,0x6B69, 0, 0, 0, + 0,0x3839,0x4F59,0x4465,0x6B6F,0x6B70,0x4C5A,0x4D48, +0x3072, 0,0x6B76, 0, 0, 0, 0, 0, +0x6B75, 0,0x3232, 0, 0, 0, 0,0x3860, + 0,0x6B77, 0, 0, 0, 0, 0, 0, +0x316C, 0, 0,0x4C45,0x4424,0x4F25, 0, 0, + 0, 0, 0,0x6B79, 0, 0,0x6C22, 0, +0x4572, 0,0x6B7A, 0, 0, 0, 0, 0, + 0, 0, 0,0x4945, 0, 0, 0, 0, + 0, 0,0x625F,0x6B7E, 0, 0, 0, 0, +0x4D4E,0x6C21,0x315B,0x5337, 0, 0,0x525C, 0, + 0, 0,0x6B7D, 0,0x6B7B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x333C, 0, 0, 0,0x6A30, + 0, 0,0x5754, 0,0x742B,0x3374, 0, 0, + 0, 0, 0,0x5641,0x5642, 0, 0, 0, + 0, 0, 0,0x5569,0x3E4A, 0,0x7427, 0, +0x5228,0x7428,0x7429, 0,0x742A,0x3E4B,0x535F, 0, + 0, 0, 0, 0,0x4960,0x4961, 0, 0, +0x7342, 0,0x4A66, 0,0x4C72, 0, 0, 0, + 0, 0, 0,0x6236,0x4B34, 0,0x4E68,0x565B, + 0,0x742D,0x742E,0x742F, 0, 0, 0, 0, +0x7432, 0,0x3A3D,0x7433,0x3063,0x7430, 0,0x7431, +0x3D22,0x3255, 0,0x7436,0x7437,0x3666,0x3230,0x4F4F, +0x7434,0x342C, 0,0x7435, 0, 0,0x7438, 0, + 0, 0, 0, 0,0x7439, 0, 0,0x4D27, + 0,0x743A, 0,0x743B, 0, 0, 0,0x743C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4B52, 0,0x743D, 0, 0, 0, 0,0x743E, + 0, 0, 0, 0, 0, 0, 0, 0, +0x743F, 0, 0, 0, 0, 0,0x745E,0x413C, +0x3C68, 0,0x492B,0x515E,0x6575, 0, 0, 0, + 0,0x5C33,0x5255, 0, 0,0x5C34,0x302C,0x5C35, + 0, 0,0x3D5A, 0,0x5C39, 0, 0, 0, +0x5842, 0,0x5C37,0x5373, 0,0x4956,0x5C3A,0x5C36, + 0,0x5C3B,0x4322, 0, 0, 0, 0,0x5C3C, +0x5C45,0x5C3D, 0, 0,0x4E5F,0x5625, 0,0x5C4F, + 0,0x5C4D, 0, 0,0x5C52,0x3D66,0x422B, 0, +0x5C38,0x5C4B,0x5C4E,0x5C3E,0x3752,0x3045,0x5C47,0x503E, +0x5C41,0x3B28, 0,0x373C,0x5C4C, 0, 0,0x5C46, +0x5C3F,0x475B, 0, 0, 0,0x513F,0x5C40, 0, + 0,0x5C4A, 0, 0,0x5C50, 0, 0,0x4E2D, +0x5C42, 0,0x5C43,0x5C48,0x5C49,0x3254,0x5C51,0x4B55, + 0,0x5437,0x5C5B,0x5C5F,0x4C26,0x5C66, 0,0x4367, +0x5C5C, 0, 0,0x3F41,0x5C59, 0,0x307A,0x3936, +0x5C65,0x5C53, 0,0x5C44,0x5C56,0x4874,0x3F60, 0, + 0, 0, 0,0x493B, 0, 0, 0,0x313D, + 0,0x5322, 0, 0,0x5C5A, 0, 0,0x5C55, + 0,0x463B, 0,0x5C5E, 0, 0, 0, 0, + 0,0x5742,0x432F,0x3736,0x4751,0x4329,0x5C62,0x5C58, +0x5C6B,0x5C54, 0, 0,0x5C5D, 0,0x3E25,0x5C57, + 0,0x5C60, 0, 0,0x5C63,0x5C64, 0,0x5C78, + 0, 0,0x5C61,0x5D22,0x5C67, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C6B, +0x3444, 0, 0,0x4323,0x3267,0x5C7A, 0,0x5C72, + 0,0x5C6F, 0,0x5C7C,0x5C6E,0x5270,0x3268, 0, +0x4857,0x4863,0x5C7B, 0,0x5C6D, 0, 0, 0, +0x5C77, 0, 0,0x5C75, 0, 0,0x3E23,0x5C74, + 0,0x325D, 0, 0, 0, 0, 0,0x5C73, +0x3C76,0x5C68,0x3B44, 0,0x4073, 0, 0, 0, + 0, 0,0x3C54,0x5C69,0x5C6A, 0,0x5C71,0x5C76, +0x5C79,0x3534, 0,0x4859,0x3B67,0x5C7E,0x5C7D,0x532B, +0x5D21,0x5D23,0x5D25,0x5271,0x5D24,0x5D26,0x5D27,0x5229, + 0, 0, 0, 0, 0, 0, 0,0x3A49, +0x5D29, 0, 0,0x5D36,0x5D31,0x5D34, 0, 0, + 0, 0, 0, 0, 0,0x5D30,0x464E, 0, + 0,0x4072, 0, 0, 0, 0,0x492F, 0, + 0, 0,0x5C6C,0x5D2E, 0, 0, 0, 0, +0x5D37, 0, 0,0x5C70,0x5D2F, 0,0x5D38, 0, +0x5D2C, 0, 0, 0, 0, 0, 0, 0, +0x5D39,0x5D33,0x5D2D,0x442A, 0, 0, 0, 0, +0x5D28,0x4033,0x412B,0x5D2A,0x5D2B, 0,0x5D32,0x3B71, +0x5D35,0x5328,0x5D3A, 0,0x5D3B,0x4327, 0, 0, +0x5D52,0x5D3C, 0, 0, 0,0x5D51, 0,0x393D, + 0, 0,0x3E55, 0,0x3E7A, 0, 0,0x3A4A, + 0, 0, 0, 0,0x5D4A, 0,0x5D45, 0, +0x5D3F, 0, 0, 0,0x324B,0x5D43, 0,0x5D4B, +0x3224,0x5D55, 0, 0, 0,0x5D3E, 0, 0, + 0,0x4650,0x5D50, 0, 0, 0, 0, 0, +0x5D54,0x4162,0x3746, 0, 0, 0, 0, 0, +0x5D4E,0x5D4F, 0, 0, 0,0x5D44, 0, 0, + 0,0x5D3D, 0,0x5D4D,0x4C51, 0,0x5D49, 0, + 0, 0, 0,0x5D42,0x4348,0x463C,0x4E2E,0x5D4C, + 0,0x5D48, 0, 0, 0, 0, 0, 0, +0x5D41, 0, 0, 0,0x5D46,0x425C, 0, 0, + 0, 0, 0, 0,0x5329,0x532A,0x5D53,0x4F74, +0x4878, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D66, 0, 0, 0, 0, 0, 0, +0x5D47, 0, 0, 0,0x5D60,0x4264, 0, 0, + 0, 0, 0, 0, 0, 0,0x5D61, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D57, 0, 0, 0, 0, 0,0x5678, + 0,0x5D59,0x5D58,0x3870,0x5D56, 0, 0, 0, + 0,0x464F, 0,0x362D, 0, 0, 0, 0, + 0,0x5D62, 0,0x3A79,0x5461,0x5D67, 0, 0, + 0,0x3450, 0,0x5D5A, 0,0x3F7B,0x5D63, 0, +0x5D5F, 0,0x5D5D, 0, 0, 0, 0, 0, + 0, 0,0x3559, 0, 0, 0, 0,0x5D5B, +0x5D5C,0x5D5E, 0,0x3D2F,0x5D64, 0,0x5D65, 0, + 0, 0, 0, 0, 0, 0, 0,0x5D75, + 0,0x4349, 0, 0,0x4B62, 0, 0, 0, + 0,0x5D72, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5861, + 0, 0,0x4651, 0,0x5D74, 0, 0, 0, +0x5574,0x5D73,0x5D70, 0, 0,0x5D6C, 0,0x5D6F, + 0,0x5D68, 0, 0,0x506E, 0, 0, 0, + 0,0x4858,0x5D6E, 0, 0,0x5D69, 0, 0, +0x5D6A,0x4B72, 0,0x5D6D, 0, 0,0x314D, 0, + 0, 0, 0, 0, 0,0x4036, 0,0x3C3B, +0x5D71, 0, 0,0x5D77, 0,0x5D76,0x5D6B, 0, + 0, 0, 0, 0,0x456E, 0, 0, 0, +0x5D7B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5E24, 0, 0,0x5E23, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5D78, 0, 0, 0, + 0,0x436F, 0,0x427B, 0, 0, 0,0x5561, + 0, 0,0x4E35, 0, 0, 0, 0,0x5D7D, + 0,0x324C, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4468,0x4A5F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x473E, +0x5D7A,0x5D7C,0x5D7E,0x5E22,0x302A,0x314E, 0, 0, + 0, 0, 0,0x5E2C, 0, 0, 0, 0, +0x5E26,0x3D36,0x486F, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5E21, 0, + 0,0x5E25, 0, 0, 0, 0,0x5E29, 0, + 0, 0, 0, 0,0x5E28, 0, 0, 0, +0x5E27, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5E2D, 0,0x544C, 0, 0, 0, + 0,0x5E33,0x5E2A,0x5E2E, 0, 0,0x4059, 0, + 0, 0, 0, 0,0x3121,0x5E36, 0,0x5E31, + 0, 0, 0, 0, 0, 0, 0,0x5E32, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5126,0x5E35, 0, 0, 0, + 0, 0, 0, 0,0x5E2F, 0, 0, 0, +0x5E30, 0,0x503D, 0, 0, 0,0x5E34,0x4A6D, +0x5E39, 0, 0, 0, 0, 0, 0,0x5E38, + 0,0x5E37, 0, 0, 0, 0, 0, 0, + 0,0x5E3B, 0, 0, 0, 0, 0, 0, + 0,0x3D65, 0, 0, 0, 0, 0,0x3258, +0x436A, 0, 0,0x5E3A, 0,0x453A, 0, 0, + 0, 0, 0, 0,0x5E3C, 0, 0, 0, + 0, 0, 0, 0,0x4C59, 0, 0, 0, + 0,0x372A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5465, 0, 0, 0,0x5E3D, + 0, 0, 0, 0, 0,0x5E3F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4422, 0, 0, 0, 0,0x5E41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5E3E, + 0,0x5E40, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x553A, 0, 0, 0,0x5E42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x722E,0x3B22,0x4232, +0x4530,0x4247, 0, 0,0x722F, 0, 0, 0, + 0, 0,0x5069, 0, 0, 0,0x535D, 0, + 0, 0,0x6B3D, 0, 0, 0, 0, 0, + 0, 0, 0,0x3366,0x7230, 0,0x7231, 0, + 0,0x4A2D, 0, 0, 0, 0, 0, 0, + 0,0x3A67,0x7233,0x7235,0x7234,0x4B64,0x4F3A,0x7232, +0x4A34,0x524F,0x426C, 0, 0, 0, 0, 0, + 0, 0,0x4E43,0x7238,0x3076,0x7237, 0, 0, + 0, 0, 0,0x723E, 0,0x324F, 0, 0, + 0, 0, 0, 0,0x5141,0x723A, 0, 0, + 0, 0, 0,0x723C,0x5469, 0, 0,0x723B, +0x7236,0x723F,0x723D, 0,0x7239, 0, 0,0x7247, +0x7244,0x7246, 0, 0,0x724A,0x7242,0x7240, 0, + 0, 0,0x7245, 0, 0, 0, 0, 0, +0x567B, 0, 0, 0,0x7241, 0,0x4779,0x495F, + 0,0x7248,0x3946,0x3530, 0, 0,0x7243,0x7249, +0x7250,0x7256, 0, 0,0x3B57, 0, 0, 0, +0x7255,0x4D5C, 0,0x566B, 0, 0,0x7252,0x7254, + 0, 0, 0, 0,0x3872, 0, 0, 0, + 0,0x724B, 0, 0, 0,0x724E,0x4279, 0, +0x555D,0x724C,0x724D,0x724F,0x7253, 0, 0, 0, +0x7259,0x533C, 0, 0, 0, 0,0x366A, 0, +0x4A71, 0,0x3764,0x7257, 0, 0, 0,0x7258, +0x725A,0x725D,0x725B, 0, 0,0x725C, 0, 0, + 0, 0,0x5151,0x7251, 0,0x4D49, 0,0x4E4F, +0x5629, 0,0x7263, 0,0x435B, 0,0x7260, 0, + 0,0x402F,0x726C,0x725E, 0,0x7261, 0, 0, + 0,0x7268, 0, 0, 0, 0,0x7262, 0, + 0,0x7267, 0, 0,0x7266, 0, 0,0x7269, + 0, 0, 0,0x725F, 0, 0,0x7264,0x726A, + 0, 0, 0, 0, 0, 0, 0,0x532C, +0x7265,0x3275, 0, 0,0x7272, 0,0x502B, 0, + 0, 0, 0,0x7275, 0, 0, 0,0x3B48, + 0,0x7279, 0, 0, 0, 0, 0, 0, +0x7270, 0, 0,0x7276,0x7278,0x727A, 0, 0, + 0, 0, 0, 0, 0, 0,0x7273, 0, +0x7271, 0, 0, 0,0x3A7B, 0,0x357B, 0, + 0, 0, 0,0x726F,0x7277,0x726D,0x726E, 0, + 0, 0,0x726B,0x7326, 0,0x7323, 0, 0, +0x7322, 0, 0,0x7274, 0,0x485A, 0, 0, + 0, 0, 0,0x727B, 0, 0, 0,0x7325, + 0, 0, 0, 0, 0, 0, 0,0x4378, + 0, 0, 0, 0, 0, 0, 0, 0, +0x727D, 0, 0,0x7327,0x7329,0x7324, 0,0x727C, + 0, 0, 0,0x732B, 0,0x732A, 0, 0, + 0, 0,0x425D, 0, 0,0x732E, 0, 0, +0x7330, 0, 0, 0, 0, 0,0x7321, 0, + 0, 0,0x7331,0x732C, 0, 0, 0, 0, + 0,0x732F,0x727E,0x732D, 0, 0, 0, 0, + 0, 0, 0,0x7332, 0, 0, 0, 0, +0x7334, 0, 0, 0, 0,0x7328, 0, 0, + 0, 0,0x7333, 0, 0, 0,0x7335, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5037, 0, 0, 0, 0,0x7338, 0, + 0, 0, 0,0x5979, 0, 0, 0, 0, + 0, 0,0x7339, 0, 0, 0, 0, 0, + 0, 0, 0,0x7337, 0,0x4864,0x7336, 0, + 0, 0, 0,0x733A, 0, 0, 0, 0, + 0,0x733B,0x3440, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6E43, 0, 0, 0, 0, 0, + 0,0x733C, 0, 0,0x733D, 0, 0, 0, +0x512A, 0, 0, 0,0x742C,0x5046, 0, 0, + 0, 0, 0, 0,0x5050,0x515C, 0, 0, + 0, 0, 0, 0,0x4F4E, 0, 0,0x3D56, + 0,0x5143, 0, 0, 0, 0, 0, 0, + 0,0x3A62,0x6169,0x5242,0x7142,0x3239, 0, 0, +0x316D,0x7143, 0,0x4940,0x3344, 0,0x5972, 0, +0x4B25, 0,0x7144, 0, 0, 0, 0,0x5654, + 0, 0, 0, 0, 0,0x7145,0x7440,0x7146, + 0,0x542C,0x7147, 0,0x3040,0x7441, 0, 0, +0x7442, 0, 0,0x347C, 0,0x455B, 0, 0, + 0, 0,0x4C3B, 0, 0, 0,0x5064, 0, + 0, 0, 0, 0,0x4D60, 0, 0, 0, + 0, 0,0x7148, 0,0x5973, 0, 0, 0, + 0, 0, 0,0x313B, 0,0x4F2E, 0, 0, + 0,0x3824, 0, 0, 0, 0, 0,0x714A, + 0, 0, 0, 0,0x714B, 0, 0, 0, + 0,0x3243,0x4151, 0, 0,0x5730,0x7149, 0, + 0,0x714C, 0, 0, 0, 0,0x714E, 0, + 0, 0,0x5976, 0,0x5261,0x5423, 0, 0, +0x7443,0x4839, 0, 0, 0, 0, 0,0x7444, + 0, 0,0x714D,0x714F,0x3F63,0x7150, 0, 0, +0x7154, 0, 0, 0, 0, 0, 0, 0, +0x7156,0x7151, 0,0x4951,0x4561, 0, 0, 0, +0x4263,0x397C, 0, 0,0x7153, 0,0x7155, 0, + 0, 0,0x3953, 0, 0, 0, 0, 0, + 0, 0,0x715B, 0, 0, 0, 0, 0, +0x3A56, 0,0x307D,0x7159, 0, 0, 0, 0, + 0,0x7158,0x7152,0x715A, 0, 0, 0, 0, + 0,0x7157, 0, 0, 0,0x486C, 0, 0, + 0, 0,0x4D4A,0x715D, 0, 0, 0, 0, +0x653D, 0, 0, 0,0x715C, 0,0x715E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x715F, 0, 0,0x4F65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7445,0x3D73, + 0, 0, 0, 0, 0, 0,0x7160, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x7161, 0, 0, 0,0x4E77, + 0,0x522A, 0,0x717B, 0, 0,0x3832, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3C7B,0x395B, 0,0x3966,0x4359,0x4A53,0x6A68, +0x4040,0x3E75,0x6A69,0x6A6A,0x6A6B, 0,0x6A6C,0x6A6D, +0x6A6E,0x6A6F,0x3D47, 0, 0, 0,0x757B, 0, + 0, 0,0x757D, 0,0x757E, 0,0x757C, 0, + 0, 0, 0,0x3D62, 0,0x7621,0x3425, 0, + 0, 0, 0,0x7622, 0, 0, 0,0x7623, + 0, 0, 0,0x6C32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5154, 0, 0, 0, 0, 0, 0,0x596A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7624, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E3A, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5532, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x537E,0x4C5C, 0, 0, 0, 0, 0, + 0, 0, 0,0x4A44, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6540, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7625, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3E2F, 0, + 0, 0, 0, 0,0x4629, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5A25,0x3C46,0x3629,0x383C,0x484F,0x3C25,0x5A26,0x5A27, +0x4C56,0x4843,0x5A28,0x467D, 0,0x5135,0x5269,0x5136, +0x3C47, 0,0x3D32,0x3B64,0x5A29,0x5A2A,0x5148,0x5A2B, +0x506D,0x366F,0x425B, 0,0x4B4F,0x376D,0x4968,0x3743, +0x3E77,0x5624,0x5A2C,0x5A2D,0x4640,0x5767,0x4A36, 0, +0x5529,0x4B5F,0x556F,0x5A2E,0x565F,0x344A,0x5A30,0x5A2F, + 0,0x526B,0x5A31,0x5A32,0x5A33,0x4A54,0x5A34,0x4A2B, +0x5A35,0x5A36,0x334F,0x566F,0x5A37,0x3B30,0x352E,0x5A38, +0x5A39,0x396E,0x512F,0x5268,0x5A3A,0x3843,0x4F6A,0x326F, +0x5A3B,0x5A3C, 0,0x3D6B,0x4E5C,0x536F,0x5A3D,0x4E73, +0x5A3E,0x5355,0x3B65,0x5A3F,0x4B35,0x4B50,0x5A40,0x476B, +0x566E,0x5A41,0x4535,0x3641,0x5A42,0x374C,0x3F4E,0x5A43, +0x5A44,0x4B2D,0x5A45,0x3577,0x5A46,0x4142,0x573B,0x5A47, +0x4C38, 0,0x526A,0x4431,0x5A48,0x357D,0x3B51,0x5A49, +0x5033,0x5A4A,0x5A4B,0x4E3D,0x5A4C,0x5A4D,0x5A4E,0x3277, +0x5A51,0x5A4F,0x5168,0x5A50,0x4355,0x5A52, 0,0x5A53, +0x5A54,0x5A55,0x503B,0x5225,0x3079,0x5A56,0x472B,0x5A57, +0x3D77,0x4321,0x5A58,0x5A59,0x437D,0x4C37,0x5A5A,0x5A5B, +0x403E,0x4657,0x5A5C,0x5A5D,0x4734,0x5A5E,0x5A5F,0x3948, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3B6D, 0, 0, 0, 0,0x3639,0x7478, + 0,0x7479, 0, 0,0x4D63, 0, 0, 0, + 0, 0, 0, 0, 0,0x7539, 0, 0, + 0, 0,0x6B60, 0, 0, 0, 0, 0, + 0,0x4F73,0x3B3F, 0, 0, 0, 0, 0, + 0, 0,0x3A40,0x5425, 0, 0, 0, 0, + 0, 0, 0,0x6159, 0, 0, 0, 0, +0x7574,0x312A,0x3272, 0, 0, 0, 0, 0, + 0, 0,0x7575, 0, 0,0x7577, 0, 0, + 0,0x3A51,0x7576, 0,0x4332, 0, 0, 0, + 0, 0, 0, 0,0x7579, 0, 0, 0, +0x7578, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3134,0x556A,0x383A, + 0,0x3931,0x3246,0x5470,0x4F4D,0x305C,0x554B,0x3B75, +0x564A,0x3737,0x4C30,0x4636,0x3161,0x393A,0x567C,0x3961, +0x3721,0x3C7A,0x6A5A,0x6A5B,0x4C79,0x3973,0x6A5C,0x347B, +0x4333,0x3751,0x3A58,0x6A5D,0x5474,0x6A5E,0x3C56,0x3B5F, +0x6A5F,0x415E,0x4238,0x545F,0x574A,0x6A60,0x6A61,0x6A64, +0x6A62,0x6A63,0x495E,0x3833,0x3644,0x6A65,0x4A6A,0x494D, +0x344D, 0, 0,0x6259,0x4562,0x6A66,0x4035, 0, +0x5738,0x6A67,0x572C,0x487C,0x5853,0x584D,0x545E, 0, +0x5479,0x4944,0x532E,0x3853,0x3360, 0,0x4962,0x7476, + 0, 0, 0,0x3A55, 0,0x7477, 0, 0, +0x575F, 0, 0,0x7471,0x3830,0x5554,0x384F,0x4670, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3343, 0, 0,0x7472,0x332C, 0, 0, + 0, 0,0x543D,0x4777, 0, 0, 0, 0, + 0,0x7474, 0, 0,0x7473, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4C4B, + 0, 0, 0,0x4824, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7475, 0,0x5763,0x453F,0x7540, 0, 0, +0x753B, 0,0x7543, 0,0x7542, 0,0x563A,0x7541, + 0, 0, 0,0x543E,0x7544, 0,0x754C, 0, + 0, 0, 0,0x304F,0x3578, 0,0x7549,0x754A, + 0,0x455C, 0, 0, 0, 0,0x7545,0x7546, + 0, 0,0x7547,0x754B, 0,0x3E60,0x7548,0x387A, + 0, 0, 0,0x7550,0x7553, 0, 0, 0, +0x3F67, 0,0x3972,0x753C,0x754D, 0, 0,0x4237, + 0, 0, 0,0x4C78, 0,0x3C79, 0,0x754E, +0x754F,0x7551,0x3665,0x7552, 0,0x7555, 0, 0, + 0, 0, 0, 0, 0,0x753D, 0, 0, + 0,0x7554,0x533B, 0,0x336C, 0, 0,0x4C24, + 0, 0, 0, 0,0x7556, 0, 0, 0, + 0, 0, 0, 0, 0,0x7557,0x3E61,0x7558, + 0, 0,0x4C5F,0x755B, 0, 0, 0, 0, + 0,0x3248,0x5759, 0,0x7559, 0,0x755A,0x755C, + 0,0x7562, 0, 0, 0,0x7560, 0, 0, + 0,0x755F,0x755D, 0, 0,0x7561, 0, 0, +0x755E,0x7564,0x7565, 0,0x4C63, 0, 0,0x653F, +0x3538,0x7563,0x7568,0x4C23, 0, 0, 0, 0, + 0,0x7566,0x7567, 0, 0, 0, 0, 0, + 0,0x753E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3144, 0, + 0,0x753F, 0, 0,0x3545,0x3264, 0,0x756C, +0x7569, 0,0x3657, 0,0x756D, 0,0x756A, 0, + 0, 0, 0, 0,0x756B, 0, 0,0x345A, + 0,0x546A, 0, 0, 0,0x756E, 0,0x3379, + 0, 0, 0, 0, 0, 0, 0,0x756F, +0x7571, 0, 0, 0,0x7570, 0, 0, 0, + 0, 0, 0, 0,0x7572, 0,0x7573, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x496D,0x392A, 0, 0,0x477B, + 0, 0,0x3663, 0, 0, 0, 0, 0, + 0, 0,0x4C49, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3335,0x547E, +0x396C,0x5079, 0,0x696D,0x572A,0x696E,0x4256,0x486D, +0x3A64,0x696F,0x6970,0x6971,0x5661,0x6972,0x6973,0x6975, +0x6974,0x6976,0x6977,0x4761,0x6978,0x5458,0x6979,0x3D4E, + 0,0x697A,0x697B,0x3D4F,0x697C,0x3828,0x413E,0x697D, +0x3132,0x3B54,0x3975,0x697E, 0,0x6A21,0x6A22,0x6A23, +0x3778,0x3C2D, 0,0x4A64,0x604E,0x542F,0x4F3D,0x5537, +0x6A24,0x555E,0x6A25,0x5041,0x393C, 0,0x3447,0x3159, + 0, 0, 0,0x4031, 0, 0, 0, 0, +0x3166,0x3167, 0,0x3168, 0, 0, 0, 0, +0x333D,0x4868, 0, 0, 0, 0,0x6541, 0, + 0,0x315F, 0, 0, 0,0x4149,0x346F, 0, + 0,0x4728,0x5358, 0,0x4679,0x5138, 0,0x397D, +0x4275, 0, 0, 0, 0, 0,0x532D, 0, +0x544B,0x3D7C, 0,0x6542,0x3735,0x6543, 0, 0, +0x3B39,0x5562, 0,0x3D78,0x5436,0x4E25,0x412C,0x3359, + 0, 0,0x4C76, 0,0x6546,0x6544,0x6548, 0, +0x654A,0x6547,0x354F,0x4648, 0,0x357C,0x6545, 0, +0x4A76, 0, 0,0x6549, 0, 0, 0,0x4354, +0x3145,0x3C23, 0, 0, 0,0x5737, 0, 0, +0x4D4B,0x4B4D,0x4A4A,0x4C53,0x654C,0x654B,0x4466, 0, + 0,0x5121,0x5137,0x654D, 0,0x6550, 0,0x4D38, +0x5670,0x654F,0x355D, 0,0x4D3E, 0,0x6551,0x363A, + 0, 0,0x4D28,0x3964, 0,0x4A45,0x3351,0x4B59, +0x546C,0x6552,0x376A, 0, 0, 0,0x654E, 0, + 0, 0, 0, 0, 0,0x6555,0x347E,0x6556, + 0, 0, 0, 0, 0,0x6553,0x6554, 0, +0x525D, 0, 0,0x425F,0x3146, 0,0x5362, 0, + 0,0x365D,0x4B6C, 0,0x6557, 0, 0,0x5376, + 0, 0, 0, 0, 0,0x3169, 0,0x3674, +0x655A,0x6558,0x6559,0x3540, 0, 0, 0,0x5245, +0x655C, 0, 0,0x655E, 0, 0, 0, 0, + 0, 0,0x655D,0x4732, 0,0x5223, 0, 0, +0x655B, 0, 0, 0, 0,0x5462,0x555A, 0, + 0, 0, 0, 0,0x6560,0x5771, 0, 0, + 0, 0, 0, 0, 0,0x6561, 0,0x315C, +0x517B, 0,0x6562,0x6564, 0, 0, 0, 0, +0x6563, 0, 0,0x6565, 0, 0, 0, 0, + 0,0x5258, 0,0x354B, 0,0x675F, 0,0x5A75, + 0,0x5A78, 0,0x5A76, 0,0x5A77, 0, 0, + 0,0x5A7A,0x504F,0x4447, 0, 0,0x306E, 0, + 0, 0,0x5030, 0,0x5A79, 0,0x534A,0x3A2A, +0x5B22,0x4771, 0,0x5A7C,0x5A7B,0x495B,0x5A7D, 0, +0x5B21,0x575E,0x5A7E,0x415A, 0, 0,0x5B25, 0, + 0,0x5374, 0, 0,0x5B27,0x5B24, 0,0x5B28, + 0, 0,0x3D3C, 0, 0, 0,0x4049,0x5B23, +0x5B26,0x5623, 0,0x5B29, 0, 0, 0,0x5B2D, + 0, 0, 0,0x5B2E,0x5B2C,0x3A42, 0, 0, + 0,0x3F24,0x5B2B, 0, 0, 0,0x5B2A,0x5447, +0x323F, 0, 0,0x5B2F, 0,0x3979, 0,0x5B30, + 0, 0, 0, 0,0x333B, 0, 0, 0, +0x3526, 0, 0, 0, 0,0x363C,0x5B31, 0, + 0, 0,0x3675, 0,0x5B32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3149, 0, 0, 0, 0,0x5B34, 0, + 0, 0,0x5B33,0x5B35, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5B37, + 0,0x5B36, 0, 0, 0, 0, 0, 0, + 0,0x5B38, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5B39, 0, 0,0x5B3A, 0, + 0,0x534F,0x747A,0x4775,0x5743,0x4564,0x747C,0x747D, +0x747B, 0,0x3E46, 0, 0, 0, 0,0x506F, + 0, 0,0x3753, 0, 0,0x544D,0x4C2A, 0, + 0,0x7522,0x7521,0x3A28,0x747E,0x4B56, 0, 0, + 0,0x7524,0x4052, 0,0x336A, 0,0x4D2A,0x7525, +0x7523,0x3D34,0x7528, 0,0x7529,0x3D4D,0x4338,0x3F61, +0x4B61,0x752A, 0, 0, 0,0x7526,0x7527,0x4470, + 0, 0, 0, 0, 0,0x752C, 0,0x343C, + 0,0x576D, 0,0x3457,0x752B,0x752E, 0, 0, +0x752D,0x752F,0x5051, 0, 0, 0, 0, 0, + 0, 0,0x4351,0x4829, 0, 0, 0, 0, + 0, 0,0x7530,0x7531, 0, 0, 0, 0, + 0, 0,0x7532, 0, 0,0x7533,0x7534,0x7535, + 0, 0, 0, 0,0x7537,0x7536, 0, 0, + 0, 0,0x7538, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3249, + 0,0x5354,0x4A4D, 0,0x406F,0x5658,0x5230,0x413F, + 0,0x3D70, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x382A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3C78, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7646, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7647, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7648, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7649, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x764A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x764C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x764B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7769, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x764D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x764E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6E44,0x6E45,0x6E46, +0x556B,0x3624,0x6E48,0x6E47,0x6E49,0x6E4A,0x4725,0x6E4B, +0x6E4C, 0,0x3730,0x3576,0x6E4D,0x6E4F, 0,0x6E4E, + 0,0x3846,0x6E50,0x6E51,0x6E52,0x365B,0x332E,0x5653, +0x4446,0x3135,0x3856,0x6E53,0x6E54,0x543F,0x4755,0x3E7B, +0x4E59,0x3933,0x6E56,0x6E55,0x6E58,0x6E57,0x4525,0x6E59, +0x6E5A,0x472E,0x6E5B,0x472F,0x6E5C,0x3227,0x6E5D,0x6E5E, +0x6E5F,0x6E60,0x6E61,0x576A,0x6E62,0x6E63,0x3C58,0x6E64, +0x534B,0x4C7A,0x322C,0x4165,0x6E65,0x4726,0x432D, 0, +0x6E66,0x6E67,0x6E68,0x6E69,0x6E6A,0x6E6B,0x6E6C, 0, +0x6E6D,0x6E6E,0x6E6F, 0, 0,0x6E70,0x6E71,0x6E72, +0x6E74,0x6E73, 0,0x6E75,0x4D2D,0x4241,0x6E76,0x6E77, +0x6E78,0x5521,0x6E79,0x4F33,0x6E7A,0x6E7B, 0,0x6E7C, +0x6E7D,0x6F21,0x6E7E,0x6F22,0x3875,0x437A,0x6F23,0x6F24, +0x3D42,0x523F,0x3279,0x6F25,0x6F26,0x6F27,0x5278,0x6F28, +0x567D,0x6F29,0x464C, 0,0x6F2A,0x6F2B,0x4134,0x6F2C, +0x4F7A,0x4B78,0x6F2E,0x6F2D,0x337A,0x3978,0x6F2F,0x6F30, +0x5062,0x6F31,0x6F32,0x3766,0x503F,0x6F33,0x6F34,0x6F35, +0x4871,0x4C60,0x6F36,0x6F37,0x6F38,0x6F39,0x6F3A,0x5560, +0x6F3B,0x346D,0x432A,0x6F3C, 0,0x6F3D,0x6F3E,0x6F3F, + 0,0x4E7D,0x6F40,0x4260,0x3438,0x5736,0x3D75, 0, +0x4F47,0x6F43,0x6F41,0x6F42,0x6F44,0x3627,0x3C7C,0x3E62, +0x434C,0x6F45,0x6F46, 0,0x6F47,0x6F4F,0x6F48,0x6F49, +0x6F4A,0x4742,0x6F71,0x364D,0x6F4B, 0,0x6F4C,0x6F4D, +0x3646,0x433E,0x6F4E, 0,0x6F50,0x6F51,0x6F52,0x5572, + 0,0x6F53,0x4477, 0,0x6F54,0x4478,0x6F55,0x6F56, +0x3864,0x3077,0x6F57,0x6F58,0x6F59, 0,0x6F5A,0x6F5B, +0x6F5C,0x6F5D, 0,0x6F5E,0x3E35,0x6F61,0x6F5F,0x6F60, + 0,0x6F62,0x6F63,0x414D,0x6F64,0x6F65,0x6F66,0x6F67, +0x6F68,0x6F69,0x6F6A,0x6F6B,0x6F6C,0x4058, 0,0x6F6D, +0x412D,0x6F6E,0x6F6F,0x6F70, 0, 0,0x4F62, 0, + 0, 0, 0, 0, 0, 0, 0,0x3324, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4345,0x6345,0x4941,0x6346, 0,0x3155,0x4E4A,0x3433, +0x4872,0x6347,0x4F50,0x6348,0x3C64,0x6349,0x634A,0x4346, +0x5522,0x4456,0x396B,0x4E45,0x634B,0x4376,0x634C, 0, +0x3727,0x3873,0x3A52,0x634D,0x634E,0x5444,0x634F, 0, +0x6350,0x514B,0x6351,0x6352,0x6353,0x6354,0x5156,0x6355, +0x327B,0x403B,0x6356, 0,0x402B,0x6357,0x6358,0x6359, + 0,0x635A,0x635B, 0,0x3837,0x5A62, 0,0x3653, + 0,0x5A64,0x5A63, 0, 0, 0, 0, 0, + 0, 0,0x5A66, 0, 0, 0,0x486E, 0, + 0,0x5A65,0x3740,0x5174,0x5275,0x5573,0x3D57, 0, + 0, 0, 0,0x5768,0x5A68,0x5A67, 0,0x3022, +0x4D53, 0,0x5A69, 0,0x383D,0x3C4A,0x423D,0x4224, +0x3342,0x5A6A, 0,0x422A,0x4430,0x3D35, 0, 0, +0x4F5E, 0, 0, 0,0x5A6B,0x4942, 0, 0, + 0, 0, 0,0x315D, 0, 0, 0,0x5A6C, + 0,0x3638,0x543A, 0,0x337D, 0, 0,0x5A6D, +0x5449,0x4F55,0x4563, 0,0x5A6E, 0, 0, 0, + 0, 0,0x5A6F, 0,0x5A70,0x416A,0x4C55,0x4F5D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5367,0x4221, 0, +0x5A71, 0, 0,0x4B65, 0,0x5A72, 0,0x4B66, +0x527E, 0, 0, 0,0x3874, 0, 0,0x5A73, +0x302F,0x4F36, 0, 0,0x554F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4B6D, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5A74, 0, 0,0x6344, 0, 0,0x4125, 0, + 0,0x763F, 0, 0,0x7640,0x7641,0x4451, 0, +0x4838,0x5163, 0, 0,0x505B,0x5145,0x3C2F,0x394D, + 0,0x6F74, 0, 0,0x3446,0x533A,0x7642,0x337B, + 0, 0,0x7643, 0, 0,0x3571, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7645, 0, 0, 0, 0, 0, 0, 0, +0x536A,0x7627,0x5129, 0, 0, 0, 0,0x7629, + 0, 0, 0,0x7628, 0, 0,0x4163,0x4057, + 0,0x3122, 0, 0, 0, 0,0x4E6D, 0, +0x5068,0x762B, 0, 0,0x4F76, 0,0x762A,0x5570, +0x762C,0x4339, 0, 0, 0,0x3B74,0x762E,0x762D, + 0, 0, 0,0x445E, 0, 0,0x4158, 0, + 0, 0, 0, 0,0x4B2A, 0,0x4F3C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x762F, 0, 0,0x7630, 0, 0, +0x7631, 0,0x4236, 0, 0, 0, 0, 0, +0x3054,0x4579, 0, 0, 0, 0,0x7632, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4760,0x7626, 0, 0,0x3E38, 0, + 0,0x3E32, 0,0x3565, 0, 0,0x3747, 0, +0x3F3F,0x4352,0x4366, 0, 0,0x584C, 0, 0, + 0,0x386F, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3D79,0x5125, 0,0x3050, 0, + 0, 0, 0, 0,0x7730, 0, 0, 0, + 0, 0, 0, 0, 0,0x7731, 0, 0, + 0, 0, 0,0x502C, 0,0x3030, 0, 0, + 0,0x7732,0x7733, 0,0x7734, 0, 0, 0, +0x474A, 0, 0, 0, 0, 0, 0, 0, +0x3E4F, 0, 0,0x7737, 0, 0, 0, 0, + 0, 0, 0,0x7736, 0,0x315E, 0,0x7735, + 0, 0,0x7738, 0,0x7739, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4E24,0x484D, + 0,0x3A2B,0x6838,0x6839,0x683A,0x3E42, 0, 0, + 0, 0, 0,0x5274, 0,0x544F,0x4958, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5233,0x3625,0x476A, +0x717C,0x4F6E,0x4B33,0x506B,0x676F,0x4D67,0x394B,0x3659, +0x717D,0x3064,0x4B4C,0x717E,0x5424,0x422D,0x416C,0x4644, +0x3E31,0x7221,0x3C55, 0,0x7222,0x7223, 0,0x7224, +0x5243,0x4635, 0,0x4D47,0x7225, 0,0x5331,0x3F45, +0x4C62, 0,0x7226,0x7227,0x5155,0x366E,0x7228,0x7229, +0x355F,0x722A,0x722B, 0,0x327C,0x722C,0x722D,0x4827, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3767, 0, + 0,0x6C29,0x6C2A,0x6C2B, 0,0x6C2C, 0, 0, +0x462E,0x6C2D,0x6C2E, 0, 0, 0,0x3749,0x4A33, + 0, 0, 0, 0, 0, 0, 0,0x6238, +0x774F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x7750, 0, 0, +0x324D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7751, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x7753,0x7752, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x623B, 0,0x3C22, 0,0x623C, +0x623D,0x623E,0x623F,0x6240,0x6241,0x3739,0x527B,0x3D24, +0x4A4E,0x3125,0x4B47, 0,0x6242,0x367C,0x4844,0x6243, + 0, 0,0x3D48, 0,0x317D,0x6244, 0,0x3676, +0x6245,0x4459, 0, 0,0x6246,0x4F5A,0x395D,0x6247, +0x4021, 0,0x6248,0x3276, 0,0x6249, 0,0x4173, +0x624A,0x624B,0x4278,0x624C,0x624D,0x624E,0x4A57,0x5838, +0x5965,0x4F63, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x7025, 0, 0, +0x5C30, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x426D,0x5426,0x4D54,0x5131, +0x335B,0x477D, 0,0x3235,0x423F,0x6660,0x4A3B,0x6661, +0x6662,0x3E54,0x6663,0x5724,0x4D55,0x6665,0x3C5D,0x6664, +0x6666,0x6667,0x426E, 0,0x3D3E,0x6668,0x4266,0x3A27, +0x6669, 0,0x666A,0x3352,0x5169, 0, 0,0x3F25, +0x666B,0x466F,0x666C,0x666D, 0, 0,0x666E,0x462D, +0x666F, 0,0x4927,0x6670,0x6671,0x6672,0x6539,0x6673, +0x6674,0x4262,0x6675,0x6676,0x5668,0x6677, 0,0x6678, +0x3947, 0, 0, 0, 0, 0, 0, 0, +0x773B,0x773A, 0, 0, 0, 0,0x773E,0x773C, +0x3A21, 0,0x773F, 0,0x7740, 0, 0, 0, +0x7742,0x7741,0x7744, 0, 0,0x7743, 0, 0, + 0, 0, 0,0x7745,0x7746, 0, 0, 0, + 0,0x7747, 0,0x4B68, 0, 0, 0, 0, +0x385F, 0, 0, 0, 0, 0, 0,0x7754, + 0,0x7755, 0, 0, 0, 0,0x7756, 0, + 0, 0, 0,0x7758, 0,0x775A, 0,0x7757, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x775B, 0,0x7759, 0, 0, 0, 0, + 0, 0, 0,0x5757, 0, 0, 0, 0, +0x775C, 0, 0, 0, 0, 0, 0,0x775D, + 0, 0, 0,0x775E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x775F, + 0, 0, 0,0x7760, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5B4B, + 0, 0,0x582A, 0, 0, 0, 0, 0, + 0, 0, 0,0x6577,0x396D, 0, 0, 0, + 0,0x3F7D,0x3B6A,0x7749,0x4647,0x7748, 0,0x774A, +0x774C,0x774B, 0, 0, 0,0x774D, 0,0x4E3A, + 0,0x774E, 0, 0,0x4427}; + +/* page 7 0x9C7C-0x9CE2 */ +static uint16 tab_uni_gb23127[]={ +0x5363, 0, 0,0x764F, 0,0x4233,0x7650, 0, + 0,0x7651,0x7652,0x7653,0x7654, 0, 0,0x7656, + 0,0x312B,0x7657, 0,0x7658,0x7659,0x765A, 0, +0x765B,0x765C, 0, 0, 0, 0,0x765D,0x765E, +0x4F4A, 0,0x765F,0x7660,0x7661,0x7662,0x7663,0x7664, +0x4070,0x7665,0x7666,0x7667,0x7668,0x7669, 0,0x766A, + 0,0x766B,0x766C, 0,0x766D,0x766E,0x766F,0x7670, +0x7671,0x7672,0x7673,0x7674,0x3E28, 0,0x7675,0x7676, +0x7677,0x7678, 0, 0, 0, 0, 0,0x487A, +0x7679,0x767A,0x767B,0x767C, 0, 0,0x767D,0x767E, +0x7721,0x7722,0x7723,0x7724,0x7725, 0, 0,0x7726, +0x7727,0x7728,0x316E,0x7729,0x772A,0x772B, 0, 0, +0x772C,0x772D,0x415B,0x772E, 0, 0,0x772F}; + +/* page 8 0x9E1F-0x9FA0 */ +static uint16 tab_uni_gb23128[]={ +0x4471,0x702F,0x3C26,0x7030,0x4379, 0,0x4538,0x513B, + 0,0x7031,0x7032,0x7033,0x7034,0x7035,0x513C, 0, +0x516C, 0,0x7037,0x7036,0x5427, 0,0x4D52,0x7038, +0x703A,0x7039,0x703B,0x703C, 0, 0,0x386B,0x703D, +0x3A68, 0,0x703E,0x703F,0x3E69,0x7040,0x366C,0x7041, +0x7042,0x7043,0x7044,0x4835,0x7045,0x7046, 0,0x7047, +0x4574, 0,0x7048, 0, 0, 0,0x7049, 0, +0x704A,0x773D, 0,0x704B,0x704C,0x704D, 0,0x704E, + 0, 0, 0, 0,0x704F,0x3A57, 0,0x7050, +0x7051,0x7052,0x7053,0x7054,0x7055,0x7056,0x7058, 0, + 0,0x5325,0x7057, 0,0x7059, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x753A, +0x4239, 0, 0,0x7764, 0, 0, 0, 0, +0x7765,0x7766, 0, 0,0x7767, 0, 0, 0, + 0, 0, 0,0x7768,0x4234, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x776A, 0, +0x776B, 0, 0, 0, 0, 0, 0,0x4273, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x7470, 0, 0, + 0,0x746F, 0, 0,0x4269, 0,0x7761,0x7762, + 0, 0, 0, 0, 0,0x3B46, 0, 0, + 0, 0,0x5964, 0, 0, 0,0x4A72,0x4068, +0x7024, 0,0x3A5A, 0, 0,0x472D, 0, 0, + 0,0x442C, 0, 0,0x776C,0x776D,0x776E, 0, +0x7770,0x776F, 0,0x7771, 0, 0,0x7774, 0, +0x7773, 0,0x7772,0x7775, 0, 0, 0, 0, +0x7776, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6D69, 0,0x6D6A,0x6D6B, 0,0x763C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x763D, 0,0x763E,0x3626, + 0,0x583E, 0, 0,0x3944, 0, 0, 0, +0x583B, 0,0x5C31, 0, 0, 0, 0, 0, + 0,0x4A73, 0,0x7777, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x7778, 0, 0, +0x7779, 0, 0, 0, 0, 0, 0, 0, +0x777B, 0,0x777A, 0,0x3147, 0,0x777C,0x777D, + 0, 0, 0, 0, 0,0x777E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x466B,0x6C34, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x335D,0x7633, 0, 0,0x7634,0x4164,0x7635,0x7636, +0x7637,0x7638,0x7639,0x763A,0x4823,0x763B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x417A,0x3928,0x6D68, 0, 0, 0, +0x396A,0x595F}; + +/* page 9 0xFF01-0xFFE5 */ +static uint16 tab_uni_gb23129[]={ +0x2321,0x2322,0x2323,0x2167,0x2325,0x2326,0x2327,0x2328, +0x2329,0x232A,0x232B,0x232C,0x232D,0x232E,0x232F,0x2330, +0x2331,0x2332,0x2333,0x2334,0x2335,0x2336,0x2337,0x2338, +0x2339,0x233A,0x233B,0x233C,0x233D,0x233E,0x233F,0x2340, +0x2341,0x2342,0x2343,0x2344,0x2345,0x2346,0x2347,0x2348, +0x2349,0x234A,0x234B,0x234C,0x234D,0x234E,0x234F,0x2350, +0x2351,0x2352,0x2353,0x2354,0x2355,0x2356,0x2357,0x2358, +0x2359,0x235A,0x235B,0x235C,0x235D,0x235E,0x235F,0x2360, +0x2361,0x2362,0x2363,0x2364,0x2365,0x2366,0x2367,0x2368, +0x2369,0x236A,0x236B,0x236C,0x236D,0x236E,0x236F,0x2370, +0x2371,0x2372,0x2373,0x2374,0x2375,0x2376,0x2377,0x2378, +0x2379,0x237A,0x237B,0x237C,0x237D,0x212B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2169, +0x216A, 0,0x237E, 0,0x2324}; + +static int func_uni_gb2312_onechar(int code){ + if ((code>=0x00A4)&&(code<=0x01DC)) + return(tab_uni_gb23120[code-0x00A4]); + if ((code>=0x02C7)&&(code<=0x0451)) + return(tab_uni_gb23121[code-0x02C7]); + if ((code>=0x2015)&&(code<=0x2312)) + return(tab_uni_gb23122[code-0x2015]); + if ((code>=0x2460)&&(code<=0x2642)) + return(tab_uni_gb23123[code-0x2460]); + if ((code>=0x3000)&&(code<=0x3129)) + return(tab_uni_gb23124[code-0x3000]); + if ((code>=0x3220)&&(code<=0x3229)) + return(tab_uni_gb23125[code-0x3220]); + if ((code>=0x4E00)&&(code<=0x9B54)) + return(tab_uni_gb23126[code-0x4E00]); + if ((code>=0x9C7C)&&(code<=0x9CE2)) + return(tab_uni_gb23127[code-0x9C7C]); + if ((code>=0x9E1F)&&(code<=0x9FA0)) + return(tab_uni_gb23128[code-0x9E1F]); + if ((code>=0xFF01)&&(code<=0xFFE5)) + return(tab_uni_gb23129[code-0xFF01]); + return(0); +} + + +static int +my_wc_mb_gb2312(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + int code; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((uint) wc < 0x80) + { + s[0]= (uchar) wc; + return 1; + } + + if (!(code=func_uni_gb2312_onechar(wc))) + return MY_CS_ILUNI; + + if (s+2>e) + return MY_CS_TOOSMALL2; + + code|=0x8080; + s[0]=code>>8; + s[1]=code&0xFF; + return 2; +} + + +static int +my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e){ + int hi; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((hi= s[0]) < 0x80) + { + pwc[0]=hi; + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + if (!(pwc[0]=func_gb2312_uni_onechar(((hi<<8)+s[1])&0x7F7F))) + return -2; + + return 2; +} + + +/* + Returns well formed length of a EUC-KR string. +*/ +static size_t +my_well_formed_len_gb2312(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) +{ + const char *b0= b; + const char *emb= e - 1; /* Last possible end of an MB character */ + + *error= 0; + while (pos-- && b < e) + { + if ((uchar) b[0] < 128) + { + /* Single byte ascii character */ + b++; + } + else if (b < emb && isgb2312head(*b) && isgb2312tail(b[1])) + { + /* Double byte character */ + b+= 2; + } + else + { + /* Wrong byte sequence */ + *error= 1; + break; + } + } + return (size_t) (b - b0); +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_simple, /* strnncoll */ + my_strnncollsp_simple, + my_strnxfrm_mb, /* strnxfrm */ + my_strnxfrmlen_simple, + my_like_range_mb, /* like_range */ + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_mb, /* instr */ + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_gb2312, + mbcharlen_gb2312, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_gb2312, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_gb2312, /* mb_wc */ + my_wc_mb_gb2312, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb, + my_casedn_str_mb, + my_caseup_mb, + my_casedn_mb, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_gb2312_chinese_ci= +{ + 24,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ + "gb2312", /* cs name */ + "gb2312_chinese_ci",/* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gb2312, + to_lower_gb2312, + to_upper_gb2312, + sort_order_gb2312, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + +CHARSET_INFO my_charset_gb2312_bin= +{ + 86,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "gb2312", /* cs name */ + "gb2312_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gb2312, + to_lower_gb2312, + to_upper_gb2312, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + +#endif diff --git a/externals/mysql/strings/ctype-gbk.c b/externals/mysql/strings/ctype-gbk.c new file mode 100644 index 00000000000..6fa8ca8be68 --- /dev/null +++ b/externals/mysql/strings/ctype-gbk.c @@ -0,0 +1,10100 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is for Chinese character sets GBK, created by Wei He + (hewei@mail.ied.ac.cn) +*/ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_gbk=1 + * .configure. mbmaxlen_gbk=2 + */ + + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_gbk + + +/* Support for Chinese(GBK) characters, by hewei@mail.ied.ac.cn */ + +#define isgbkhead(c) (0x81<=(uchar)(c) && (uchar)(c)<=0xfe) +#define isgbktail(c) ((0x40<=(uchar)(c) && (uchar)(c)<=0x7e) || \ + (0x80<=(uchar)(c) && (uchar)(c)<=0xfe)) + +#define isgbkcode(c,d) (isgbkhead(c) && isgbktail(d)) +#define gbkcode(c,d) ((((uint) (uchar) (c)) <<8) | (uchar)(d)) +#define gbkhead(e) ((uchar)(e>>8)) +#define gbktail(e) ((uchar)(e&0xff)) + +static uchar NEAR ctype_gbk[257] = +{ + 0, /* For standard library */ + 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 132,132,132,132,132,132,132,132,132,132,16,16,16,16,16,16, + 16,129,129,129,129,129,129,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,16,16,16,16,16, + 16,130,130,130,130,130,130,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,16,16,16,16,32, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0, +}; + +static uchar NEAR to_lower_gbk[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR to_upper_gbk[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR sort_order_gbk[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '\\', ']', '[', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', 0x7E, '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uint16 NEAR gbk_order[]= +{ +8653,14277,17116,11482,11160,2751,14613,3913,13337,9827, +19496,1759,8105,7103,7836,5638,2223,21433,5878,8006, +4851,18766,18879,16728,8129,6200,19133,6389,2500,19084, +16228,5074,8130,5900,6201,3985,14597,11566,8588,8769, +15885,11411,11965,1961,18012,18303,12242,14118,11490,12911, +15015,4367,3184,2093,20937,5710,5108,10560,9993,18982, +8393,10697,14620,19558,14970,15193,5359,18189,12666,18192, +3310,18659,17358,7973,18673,19537,3404,9723,4221,16486, +7023,13648,16310,1049,1726,4799,15534,4366,17133,4192, +6219,5118,1804,2360,2279,14279,13740,4511,2361,12906, +16650,18590,4723,2001,16313,3594,21026,12146,19561,3800, +4161,16774,18892,17657,7025,892,7917,12245,3394,4813, +11902,3189,20002,2365,12964,18115,17660,20227,17182,11907, +11671,17562,17864,21131,13423,1361,12246,18897,14978,18848, +20727,5902,10726,21241,1906,13424,1408,20519,3038,18495, +20446,1431,17138,13464,14558,1221,6720,6137,17348,5268, +4448,11313,1760,6172,6870,5744,13541,3044,17701,14368, +16114,5051,9142,18776,5669,19089,11088,17867,925,10395, +4372,10578,2138,2554,18118,21087,13862,7461,14983,3322, +15305,11844,7924,8087,2542,20701,21772,2754,10490,8218, +14800,15869,14436,16119,1814,11543,17398,16069,19659,17020, +17844,5694,8833,16744,18925,4957,9812,6852,8036,12966, +14038,12145,16833,11165,17076,17756,3673,2367,20916,9143, +14927,6885,17486,7469,1661,2827,4627,18198,1307,19711, +17637,2595,2262,20807,1764,8150,18547,3192,9711,16262, +9144,2006,21629,5311,15743,14733,10991,15402,2916,17724, +12195,12622,5141,8039,15169,7780,4568,20835,21575,10580, +15022,9470,6853,3926,21563,1342,16745,8181,11526,1947, +7402,18641,14145,13149,19222,2468,12920,13916,21077,2968, +16438,19667,1768,15632,18374,4738,15517,16655,4309,2374, +14492,8602,3679,2103,1312,18681,6613,18604,20451,2755, +18218,19473,17854,20316,3003,4998,1391,20938,11169,7049, +18861,17577,18091,1937,4085,2059,20633,15948,1313,20138, +7785,16439,15081,20955,15117,17065,19924,13831,11913,20062, +7568,10703,3717,15480,6047,7790,16867,14223,12971,8429, +2008,2833,14026,1317,17493,19411,18551,15452,15257,18504, +4441,1769,7249,20128,5509,1970,9420,19365,20190,21617, +12202,15041,2871,19676,20388,21674,14258,2901,8058,5970, +20472,13257,18226,3694,17591,10279,1318,12409,7901,9794, +10416,10769,12876,17154,15455,19298,3970,21327,14228,13095, +8096,16072,21748,12581,9326,2311,5683,12641,3583,2184, +16464,6969,1795,6778,2880,15819,3433,7674,4713,17297, +8231,4333,9995,1841,5558,17155,17298,11283,18694,7946, +7311,13129,4753,21149,905,14010,18821,8532,11873,2190, +19006,3456,8874,7433,2841,7680,14143,20130,1993,1699, +976,15361,2736,2154,9202,11685,7951,12982,11008,16763, +11829,13327,11686,2299,9940,10507,8917,1277,19790,1636, +20143,21002,15011,19443,6026,13299,2455,9667,15612,16477, +10261,2811,2202,13674,14760,6818,9691,10624,20145,11940, +15524,18349,9437,11578,20132,17736,4121,4122,16023,2280, +4371,4373,7873,18307,14602,14695,13054,5410,6065,14389, +3979,1137,5411,6672,16311,11632,9829,19575,5901,15708, +12553,7165,18983,10860,13664,18242,10848,2049,8075,5579, +8083,10863,21136,5445,17851,19132,8597,18771,11054,14631, +10997,8292,8803,11246,4999,17559,11134,15369,5155,6407, +12054,4857,11265,12834,7322,15057,10937,15984,5544,8040, +13291,3961,5142,19101,869,9631,2009,11315,21404,3172, +14941,4204,7947,9997,16906,4035,4476,4477,8171,2818, +20725,4724,11453,20868,4725,4729,8565,5109,12490,8862, +5920,13737,2888,6930,12963,3223,6934,3395,16243,8397, +9475,4858,13515,3777,11266,10029,21028,1671,7765,7766, +14169,2221,5328,2907,8951,4225,4416,7770,3046,8014, +3975,10636,20236,19825,3248,8717,2140,2908,3249,9477, +4628,2225,12676,2909,21564,5167,1225,4186,13266,4017, +7471,7146,18214,6890,4195,16037,16688,5583,14497,7476, +3286,8566,2910,2862,2232,16038,10417,9492,12234,14190, +8793,5573,6486,20322,21455,9734,8317,10143,5781,7681, +5782,7500,7501,15466,7188,7511,7512,21003,2203,21693, +11350,9540,21212,18183,7918,8754,17511,20869,18899,21160, +11356,9315,8364,8798,18460,16189,17483,11415,8897,7771, +9917,8718,7926,5228,11270,2644,9269,19404,8719,8367, +13267,10400,1914,2157,8584,11171,3964,17881,16785,18951, +18052,16616,14500,9323,10418,12410,14661,6963,7570,7668, +13601,17386,18995,8437,4460,8346,15920,8318,3387,10734, +18057,18058,10525,9654,2390,13675,13603,20000,8106,1260, +10824,1426,5075,5076,18887,12175,8174,15558,5269,4304, +5380,3287,8156,5386,11605,8142,18768,7580,8641,6319, +13425,4478,13147,2019,8900,6331,19668,5756,6769,3381, +9009,9730,9735,15160,4036,8167,13489,17009,8667,18308, +13439,18112,11735,21667,14617,17010,16290,16291,17515,3368, +7050,14841,5636,16826,17573,7760,18493,13306,14312,2619, +17868,13609,8991,7038,4310,16881,14020,16422,20565,5941, +18174,3642,20346,12080,856,13144,18158,20908,10800,15630, +14340,15837,21707,4629,2060,19870,9632,3718,7902,994, +5762,18391,9647,2312,9199,9648,18281,18342,19911,5367, +9950,13834,13513,8771,9414,4057,21302,1963,1964,1967, +902,3349,14697,5602,1071,13959,14621,21428,7288,15079, +7039,16495,13949,3111,5580,13365,2615,4109,6202,11213, +10792,17918,21538,3226,18658,11985,6862,18734,2752,13232, +7838,1907,4252,6223,16703,11495,18037,3974,6301,5226, +8514,10487,5267,10892,12763,16706,7702,20003,2616,14457, +16083,16587,4296,14513,8355,12171,16590,10670,13651,3646, +14626,21132,15826,17015,18911,12792,12461,21545,17848,18912, +17396,3277,13516,5918,16115,12548,1673,4864,18438,6078, +5880,3263,16211,21784,1909,15296,17183,6884,12796,4417, +4299,17021,21137,14801,17484,8852,6512,15560,4300,17921, +5819,9342,15900,17742,19525,3869,11715,17703,12554,6040, +19865,10267,12549,10804,21670,6091,17277,9319,12531,9840, +1060,11215,10514,15170,4892,5904,14898,19534,5469,5470, +1128,5922,18937,7270,15971,17189,16263,9474,13382,2369, +20210,18177,3976,12767,3618,13236,10885,5397,15621,8770, +9830,9310,14121,21573,16634,19148,12803,4381,13051,956, +20237,3755,19551,15744,9169,16852,866,11893,21439,3680, +6197,17412,17324,16086,16747,16602,3834,5510,12770,12771, +3420,16198,21552,1421,3198,6097,18178,12772,20576,9831, +17200,19226,5584,20226,5822,10609,11641,3599,13550,15387, +5361,15481,952,3426,19731,20581,21103,2153,16223,19719, +20139,18533,11172,6356,20044,6584,6585,6954,21058,16397, +14150,17888,6618,4199,11775,9843,19732,14051,2564,13093, +18379,3377,12174,1968,19359,16350,19294,12243,1294,5362, +20214,6898,15645,18557,6146,13005,14084,19366,6272,17534, +10713,2104,5894,13900,16200,6964,12093,16692,12975,21496, +9358,16216,7314,15280,3056,14008,5363,11510,13001,1474, +997,9724,21709,20612,11383,15441,7715,2684,7622,8585, +15456,14192,872,17497,10281,17428,6338,6779,5831,11989, +17156,20245,2293,12512,3560,10705,6367,5040,15465,18663, +14003,7716,17498,6462,10721,13660,9327,17501,6973,9010, +17433,6024,10669,13098,2842,15393,3436,18133,4283,21749, +4461,2571,6707,1986,2900,3138,3434,19771,9090,16900, +12816,6022,9736,17830,6708,19167,18099,11781,14950,18337, +19249,3270,20404,21152,11875,6791,17596,7723,19933,884, +19376,8877,19687,12164,3544,17647,4150,3457,17648,12338, +19127,21715,11831,3635,9259,15329,6901,17127,18710,4191, +12352,21112,7195,7956,2300,18061,10887,15701,10319,6808, +1859,19445,11794,19170,6436,10969,6216,20594,9522,10157, +5898,11567,11326,18410,9674,10340,10229,11345,3447,2456, +12439,12340,17368,10889,17057,4224,8845,18285,2207,19263, +3872,9117,15331,17456,2995,6523,6919,21337,11803,17457, +1936,9533,2248,2161,9697,19072,10607,20163,15100,6199, +20287,7392,20107,21238,9225,11809,13650,10203,6717,19085, +11816,16035,8643,19823,8084,12359,20004,3059,6719,4253, +5838,15886,15982,5839,13638,13780,5840,15341,5842,19140, +6854,5923,10582,5843,2868,16398,19872,13534,8824,12598, +19879,19880,18208,16051,16004,16005,16039,10567,6783,19020, +10539,10550,18184,16018,15868,12573,10392,8863,8172,19697, +12845,12846,21424,3476,12833,17119,14167,11764,11357,7264, +20873,18048,18901,13220,4667,8756,16106,4705,1432,8009, +3665,7966,7128,2587,7967,12053,15477,13430,20832,5587, +15350,8076,18496,4801,10396,13339,5438,18013,1074,10032, +21247,4985,6322,20909,989,3323,12104,11235,7138,6138, +10512,3008,2621,19090,6306,4110,20541,4877,5674,18543, +4231,5748,2116,18465,17517,14702,1762,6233,3281,8548, +3479,6000,954,17677,17278,1186,4803,1097,18938,19207, +5954,17874,2917,13191,1374,4557,13610,19406,8518,7240, +3675,9306,8357,7882,20573,9913,6446,1915,8078,18661, +3600,18200,13551,15199,13252,16268,8298,10602,20739,8775, +2704,3928,15450,1948,2829,1375,8603,4214,18952,20841, +21403,12685,8299,11653,8726,9031,11701,7331,5169,19721, +4311,5546,9471,4548,18163,9032,972,14386,11607,15974, +2517,6540,1462,9789,5823,21324,1244,19595,10838,7744, +13909,18685,5360,21578,19596,6619,4318,18552,1268,3013, +10906,2309,16148,12551,4773,21079,7858,7887,6198,5174, +2935,8605,12479,9418,17729,6610,4093,16233,17928,17030, +7062,8871,19299,19417,8569,15122,14579,11123,16618,2526, +15997,13618,21060,9639,12203,1209,20185,4112,15728,16751, +20767,18053,20711,898,5381,18272,8607,16540,17592,10190, +5887,9300,2294,12204,1384,2426,10427,10374,11972,12978, +10920,11384,16040,14865,10301,1622,2072,20975,20512,8617, +3765,2439,20849,7172,5829,13045,7943,3700,3174,18392, +15307,20290,12928,16506,21383,13068,14230,14231,1088,12583, +8875,3942,4462,13626,4146,3217,3701,14505,4242,4245, +15413,3587,11432,4684,6631,15414,3271,18690,21282,7502, +1039,13032,13072,8748,19021,12316,3766,7551,18665,1852, +15419,9243,8322,6513,3492,13684,12987,18062,9260,16999, +906,18151,3529,13911,7957,9427,8940,10341,18286,15427, +16481,6514,10263,10264,13950,9675,9985,2208,18070,18291, +9406,1106,16240,14024,21355,18735,10727,21254,21358,6353, +9064,6357,17889,9070,14715,10820,4147,14718,18755,5496, +7582,4769,20373,1592,15166,13637,10033,3251,17753,17613, +11596,17130,19916,10850,4182,13264,11964,5447,12805,11003, +11047,2440,20269,5601,5209,15535,15370,18300,1406,6926, +20037,7229,1056,4359,3596,12118,8363,17518,3735,18497, +6573,8553,20360,1351,6662,4610,3780,18127,1363,1032, +16617,12536,16800,1037,7571,9731,4203,19993,7572,14677, +4715,6902,1527,10540,2376,3886,12847,8131,11926,2135, +17136,4517,7104,6221,3365,4816,8031,5875,16599,21029, +11997,5995,21069,20005,4807,2552,8400,21341,18361,11496, +17629,4669,4726,16292,4072,1075,21429,20521,11523,19918, +15958,17185,18913,4247,11358,1436,14370,4248,6080,17849, +4434,20728,11236,1173,4817,10034,21539,13666,14173,18439, +10741,21482,8275,13754,3952,7040,5056,17377,6456,8339, +5443,7327,7328,11738,20834,20673,17273,6182,5675,8491, +8847,18364,11314,9918,12150,4302,19527,18255,14375,14566, +5749,13543,15020,6234,17279,14316,2502,17574,10805,4827, +11443,8723,2979,2980,15870,17708,11546,19581,12503,11626, +20926,5924,21344,12472,16076,17280,16710,18256,16748,16841, +18260,19582,14989,9609,8190,21375,12628,17194,21440,3929, +10404,879,4249,10275,11146,3095,12550,8191,1949,10054, +17413,14766,12773,6692,5001,16647,16648,15405,4581,4582, +15709,11654,13552,8046,7979,12868,3756,17726,6421,16231, +9150,19109,21097,11614,5002,10583,973,9033,19149,18201, +8192,9622,3737,17195,6447,6480,3483,18605,11564,13964, +7294,15949,19734,16351,3689,13838,10941,3378,13918,13178, +6693,16657,12924,2936,11189,5005,7831,4086,18806,21080, +6620,11148,932,19228,17929,7745,16352,20747,13345,15635, +17584,16171,9790,10871,13670,14932,12361,16502,16199,3132, +6358,7791,1245,17817,15950,5715,21662,18558,19882,13796, +13901,10132,10944,12039,1026,10672,9002,13206,20689,19883, +7746,13800,11302,19235,15124,11752,15542,12085,9276,11609, +1235,12346,18996,19759,17966,10773,18749,8627,19370,11703, +5719,7905,21307,20246,5908,9361,20563,6426,6427,1034, +13922,10677,12423,5487,16758,13099,16174,20438,11193,17210, +17211,11392,9864,9712,6490,5723,3572,20852,17832,18753, +6482,16901,9011,13705,18396,2181,7625,10946,4534,4463, +17161,19022,6168,7724,4536,14680,15209,13033,9774,17945, +17649,11755,3943,19023,1971,907,11742,11832,10673,15800, +2738,7958,3028,19632,12437,13822,13876,11528,18236,15363, +19255,12988,19972,11154,1403,14431,17732,11711,4037,10186, +19849,9247,18411,10100,7696,11743,9249,17172,19264,14855, +6822,13579,11104,9538,10541,18292,21213,9251,8394,21477, +17662,14984,15342,19522,21318,15232,11216,3096,12869,18145, +11682,21506,9501,18022,1877,11517,11798,19265,10542,13830, +13303,7230,13858,18591,18772,8010,21395,21223,6229,14563, +18794,15793,14603,2503,13642,5375,17403,20364,3516,14419, +6659,11115,8804,1950,20141,19831,13343,6142,20637,7482, +11825,1770,6541,13226,14576,11826,7938,11847,20963,19677, +1247,8885,11827,8312,13229,6339,14584,11828,14425,16469, +17560,8886,6784,8533,19039,18830,1257,13187,2705,1258, +4762,10511,4124,12519,21303,4828,8724,7588,21305,18092, +14812,4131,3527,7762,4393,4394,14764,14280,11327,9907, +17242,17243,9046,16304,9904,10796,16305,16306,16307,18541, +4232,8998,21059,5110,5515,16061,5115,5116,17012,1390, +7844,15716,3798,14519,20669,17576,11649,16842,16843,10758, +10309,12474,15684,4631,17585,10500,2084,17597,8329,8391, +9883,8392,21237,17624,11692,16188,17134,9579,4288,3503, +6742,10206,13743,16775,5949,14364,2765,18725,19947,1157, +18592,981,16777,7768,4290,4670,16248,12907,12663,7839, +21769,21770,18498,8276,5161,18015,12501,9591,15773,13432, +4865,16137,12288,1030,8924,13433,12525,15774,10036,2589, +12463,2091,1185,15898,18016,1588,6083,8721,10649,4303, +4990,3826,10399,4363,4375,5057,13530,18786,11438,14567, +926,16386,6533,11113,9552,7139,3954,16387,19529,5502, +9919,18545,7610,4258,17519,1884,13639,4736,11585,9555, +19464,17281,13793,3517,14382,2504,15985,5349,5231,17082, +19141,19665,9307,8616,17234,13611,2695,15316,9955,6478, +8193,9151,11248,9034,9035,21671,5547,18164,5179,10584, +10585,10055,4187,20740,19151,3965,5926,20741,16440,12301, +7787,21672,8823,3930,19152,21490,20275,6621,19597,18474, +4742,13395,18475,15636,18862,20956,14654,4319,21271,8594, +10518,18318,10942,5932,6955,6586,15855,16795,19598,21579, +9193,8712,18267,18268,16447,21580,2121,15200,8679,13179, +12699,15998,4113,16882,16619,2010,15485,13801,7795,870, +10133,16801,13060,1368,3719,12950,19418,11778,3238,14580, +13968,15043,21588,7596,9858,8628,2233,3853,2076,3890, +15978,10302,20433,20434,998,2031,13447,13009,3175,21713, +3524,3525,16958,19760,12160,10221,17387,2085,1796,13182, +7626,18232,9328,20458,9866,9867,7890,4243,21738,7721, +8441,18574,7627,18575,8442,20405,19024,18023,11593,18705, +18706,18824,11788,17251,7074,17601,8707,5724,3710,1040, +21730,16369,13823,3530,10114,7818,19688,19975,19196,13859, +7823,9660,5732,10230,10231,19319,16937,8244,2209,19345, +8961,18287,11599,13580,2359,3159,10543,3729,3730,11805, +18293,18294,18354,8989,18295,8861,6605,7968,2341,9938, +8768,12561,12562,13406,20792,20522,18795,7897,15252,13598, +12240,4852,20087,3876,11763,4648,12010,20874,6409,3412, +3325,11359,4866,11367,18927,18928,12467,12835,8356,13863, +14839,14878,13123,20625,14523,13643,3336,5707,12475,20508, +7408,16232,3339,14148,12687,4061,6287,20780,17818,16400, +18969,1192,12480,3839,5382,12040,15543,11124,7309,15602, +6704,21044,14193,1623,5847,20247,11469,1193,8019,2236, +20985,6342,1492,1504,20496,11136,13073,2171,4685,11015, +1195,2739,11224,2793,7816,17258,9214,7318,1761,5147, +7112,15831,20270,5689,10886,13188,4163,18175,1124,7840, +21342,18140,3047,15899,18853,20918,15766,20919,17405,15986, +5754,8835,10998,19501,1885,1763,2547,9152,7051,15026, +14808,13284,19736,11210,15061,2064,17327,4633,8155,4327, +16448,10191,17124,15062,20964,1923,13258,8159,8160,10282, +19210,3348,10428,18997,2788,16006,14951,17645,11211,2313, +16759,4637,5691,8789,8878,1513,13034,9999,9884,10342, +7208,19346,17173,15845,19387,9539,15847,18074,3612,12524, +6721,11524,6722,4706,8251,18309,20183,18728,4413,14016, +4414,14663,3799,6402,16674,3664,7583,1095,14412,20469, +15536,4954,3649,2329,20674,18787,8365,14285,19827,8041, +3781,20470,7589,13024,12198,1463,14347,15407,7422,5256, +4428,1475,8794,7429,1682,17439,3437,5832,7552,6264, +11065,5836,16239,8476,7122,10397,6770,6771,18825,18826, +18836,19941,19942,16558,18365,19706,2556,3782,19419,12386, +2582,21425,16167,7028,21030,16314,3597,10037,4867,16320, +16834,16192,2543,20927,8042,3094,20798,3097,16984,7154, +20939,3065,21098,9153,17578,7857,7477,14656,7295,1595, +5007,16449,1210,16883,20750,12413,15649,3561,20754,1676, +2686,2387,18576,6792,10927,10271,17338,1280,13490,9371, +13717,3895,5069,13719,5093,18895,14619,16819,4457,19220, +11238,16588,16780,7029,17016,7841,16249,3061,19702,12664, +3190,15371,16092,12908,6842,17740,16318,17139,8623,8277, +18915,1238,11239,12128,8801,1174,11583,15810,5542,8283, +19457,3670,15969,19460,4821,17017,1437,19436,17979,3064, +1738,6656,18038,12251,14802,16835,15386,19400,11360,8772, +14633,17022,9344,6183,8902,11416,20884,17520,15767,3827, +6041,5750,12620,17485,14929,6328,13340,6723,2645,18788, +17743,5604,10010,2624,14282,13531,19953,12179,3554,6754, +17406,10801,19407,19828,12258,19955,19722,15988,7855,20577, +10011,6042,13150,15685,1916,12969,16845,10742,18954,6179, +2544,16786,9484,9295,3066,18955,9610,11603,4312,16788, +3098,3557,2322,10985,9623,5646,5641,12629,8777,15745, +10586,16868,8604,5796,11702,4142,5857,20398,19836,7885, +7161,9956,19723,6106,13553,15406,15689,11772,2981,6832, +17639,4282,15278,21613,7332,19412,3558,11608,20063,3840, +2970,13315,2065,1573,6835,21581,15637,1324,17930,16353, +5277,16450,1465,17931,6587,11173,19413,12806,14256,19110, +2421,10875,12840,8731,900,13156,18319,13919,21614,13998, +19229,13624,5383,20021,15132,12707,18560,15042,6665,7064, +5516,8313,2911,11704,17535,8570,20769,19420,2042,18131, +14446,1834,8586,17035,6859,19422,18507,9640,14053,15544, +19118,17896,15382,20067,11316,5407,3101,12414,11470,5848, +2665,1985,1980,1978,3176,11284,20476,15945,1035,14866, +5648,13627,20215,8161,9726,11995,15044,7944,19212,10523, +14260,16041,10744,12882,14352,13297,3707,20853,10283,8383, +12648,12643,19772,12491,9860,3115,19442,2687,20986,15946, +2474,12817,13449,12214,1335,13328,7628,2661,9737,12494, +9012,6786,2533,19214,19215,16992,16993,3438,15415,4244, +4177,15139,8454,2074,17434,4465,4714,9329,9362,17212, +11285,9868,16760,1987,8443,3139,17304,15442,14485,12280, +19025,17162,11876,3439,15443,8022,15032,6985,16515,6520, +13218,13213,8323,2043,8750,19256,19026,10001,14089,8534, +6504,908,18238,9098,17128,2669,19633,19217,3316,11048, +910,11016,4136,12731,11353,9205,10989,2740,21004,11955, +2792,18512,1860,21010,8942,8918,19446,4850,10158,11225, +2540,6809,2254,9248,6506,17972,13691,2256,7209,8336, +6524,14358,9808,11563,11076,15525,8477,21363,5186,19944, +5244,7323,3962,3835,1943,7276,20814,8973,20456,13010, +5259,7430,19761,18334,17044,20461,17050,17052,13492,6403, +6405,4289,14622,15676,10851,3752,14272,18796,18858,18320, +13367,9372,4512,13896,20126,20502,3797,19543,8815,5950, +14365,2095,16110,5497,16776,3566,13744,2096,12909,7265, +19564,1029,16825,20875,20905,3567,18301,8908,1583,8173, +16589,6347,19948,13234,14413,20763,20038,16250,11622,12542, +12543,1073,1020,20229,20006,1739,20880,11540,12559,18593, +20671,20312,18440,6068,11675,18672,2642,12253,7231,10952, +13434,2822,7233,20423,12100,11484,12910,16116,1125,3651, +8284,9079,12829,12861,6169,11818,5398,3221,2622,17521, +2054,6683,1109,20920,9081,4212,4213,11887,20702,5270, +7704,3956,11486,9920,20313,10367,3828,8407,9912,8256, +18196,17190,19661,16120,1820,5350,15671,2509,14122,8758, +10939,11888,8182,12193,7403,14178,13957,17523,2101,4770, +7655,8183,6886,15989,12544,20274,15038,18649,8414,16254, +1917,21752,18677,20375,10368,15058,16121,1188,16434,16294, +13198,14335,11249,10977,4962,3511,16649,8358,19962,21612, +15746,15973,1355,13958,21757,16656,12631,2512,14067,10572, +13292,5170,3655,6855,12688,14737,12872,10056,18202,20742, +9832,5590,11679,6891,18375,20766,1952,1731,15687,21643, +8751,12006,7737,11319,5333,10992,14052,12235,11944,7413, +20748,8118,7414,18273,11558,6209,12344,16354,13999,11761, +14657,21615,20712,18094,6624,1596,18476,6588,18321,21705, +17819,8705,7046,15690,9113,9121,2422,8120,15995,6694, +5325,2707,17426,17586,12922,2106,1289,18553,16355,3565, +16605,21616,5326,5451,13240,13802,13619,2711,15246,15234, +13803,12205,8685,18561,3522,20817,11914,9109,13419,17244, +7939,11219,4328,2922,14191,15318,20350,12042,9641,15545, +6359,20965,16202,17095,16606,13043,15730,20641,4329,11939, +13563,20368,16752,14349,8638,13804,13990,2234,15265,8122, +2685,2894,5849,4775,3702,12812,15070,9770,2475,2568, +5649,10429,10303,21619,5080,6428,20369,13046,15531,6487, +11516,7546,5720,19339,1004,20987,11782,10745,2253,8795, +2767,14353,16042,7675,2169,12884,1662,7594,18566,5458, +12885,6974,12417,9313,4151,17301,13910,5783,20142,19007, +17213,2477,11592,6276,5697,3272,11727,9998,20770,6709, +7682,7117,2025,15459,3406,1797,2375,8390,17435,1358, +4973,21451,16175,12569,13241,4148,6463,7683,15325,13131, +16643,7435,19378,11574,10380,21452,20254,12571,2992,6993, +3467,14090,13276,7756,8860,3388,17543,18699,1043,8324, +18700,4343,10993,11066,7118,15364,3531,9246,8267,18656, +13908,18715,18711,11688,6903,7819,1717,11833,5263,21005, +7817,9093,11343,7524,17550,9943,15396,1121,15086,10320, +10570,13706,21006,18513,9453,1932,14761,3157,11732,17259, +8542,9676,9130,6569,19320,10343,10265,12893,12894,12899, +9215,17174,19266,10930,2173,19321,3154,17554,14359,10645, +10933,11077,2580,20146,10544,15397,9698,3731,16207,3470, +7698,9252,9704,5767,5771,6957,18101,8654,18849,5096, +1140,12527,3715,8802,11271,16783,6092,2057,2828,5274, +17882,7710,2416,20634,4197,19671,1129,17883,4198,11776, +3738,4188,18970,8713,18381,6958,15960,17494,4200,18478, +17067,11280,873,874,3633,20715,14821,9870,13450,17754, +18870,7685,14235,7686,21462,19040,9775,1521,9528,17504, +17505,18011,12669,12677,8419,20377,20378,1147,19690,9221, +16487,14459,7291,7296,19678,7717,15962,4011,19137,12994, +13466,20429,21443,21447,21453,13211,9972,21463,2846,4106, +21215,7846,5998,12151,19461,11481,12678,12263,10127,4830, +4569,7982,20546,18863,14293,7483,4368,20996,4466,12391, +4467,20414,8881,15223,19646,7123,7156,6895,17513,15764, +15348,3667,17805,2222,18456,14564,11240,11241,16084,2931, +16740,1302,1158,7769,14460,6416,4564,5768,17920,4651, +13221,6324,18251,20273,4565,14437,8285,18467,1742,17981, +12528,20675,10041,6038,11368,1593,17872,6829,21627,14637, +4625,3870,16539,3924,878,1743,983,10210,8927,15794, +14574,6661,17923,8964,8848,7656,7929,20929,15903,6271, +5059,17362,5957,8521,17282,9030,21142,16846,14496,20578, +20579,5961,6045,16271,15748,21444,21722,21126,14210,11681, +16870,12775,20768,18971,961,16277,9958,2268,16325,17473, +4602,17975,18813,20068,6698,17857,11253,18643,19350,14773, +16456,13275,10876,11552,7423,18479,2937,18567,15281,12600, +7676,8573,5236,16622,2324,12813,6052,18393,9649,7183, +10986,20150,17598,6053,11393,3076,11708,20482,6787,5977, +17968,2874,9874,15444,8023,12418,9973,16994,19027,7189, +6675,3350,18695,18696,9655,15420,15927,17477,4639,14429, +20556,6027,19041,17388,17691,14198,7688,1278,8067,18405, +911,18712,13881,11019,9668,2434,8943,3863,3864,18635, +6920,10483,13827,10236,10646,10545,14163,15526,18355,21216, +19936,18904,6325,14734,2028,14470,20288,1984,17891,6772, +19191,13158,4664,12324,1141,10042,4606,13468,11921,15795, +9298,21708,11298,6609,16087,12635,19232,21586,16342,15928, +9305,9330,10237,12445,14794,15622,13718,1053,4209,3505, +9582,13370,8108,1407,2494,3042,13898,12854,19565,16680, +18079,4479,21541,13747,16113,3668,10797,2553,18905,5077, +5370,18773,7584,14171,16293,8133,10798,16977,19860,4621, +3922,17141,2932,14727,6475,17634,11859,2753,15018,19951, +7925,6942,10831,1438,984,4672,18918,4818,11541,6417, +18159,3988,17654,18530,4279,20540,20056,21718,14461,3671, +10325,15019,11542,17145,14990,16978,5598,4878,11369,18930, +18674,18679,14638,11766,1414,18789,11678,9105,6085,12036, +4480,21036,3332,3009,18518,4822,14731,14306,15021,14376, +11545,19408,20921,20314,3416,5467,12563,990,4879,1816, +4233,1400,20361,14991,21256,12130,14627,5599,2118,18599, +8149,10174,10898,9600,13786,20199,13996,19405,18087,12800, +20626,18797,17351,20707,9612,14076,8590,1730,13728,1115, +13729,1765,21485,2719,18941,3049,7472,21719,4379,4400, +19713,4440,5399,20394,9613,19097,18942,14643,4893,13865, +18798,8821,13311,14040,18042,4234,2918,11418,20093,11959, +19223,7782,10175,20449,18088,13977,20635,1287,15839,9083, +8048,1826,1356,13929,16855,9278,10177,4739,12632,16593, +8497,5125,15113,13389,19504,10268,12182,21359,3681,17925, +15994,20213,19535,1457,3622,5928,20813,13761,1314,7409, +6581,16272,11937,7244,15777,7157,17414,10492,8890,2079, +4675,15024,14993,4001,13223,19335,8195,9065,21441,2164, +16441,8049,9485,1732,17122,4802,15566,20941,9154,9720, +21415,9489,12807,1750,10589,3067,12973,12700,1958,2177, +20582,4613,12019,1206,6836,2519,20201,9633,19738,19739, +5551,5813,3967,5172,16326,3257,4489,2466,20454,12776, +19839,18322,19740,13535,18972,13732,12637,21417,4914,9159, +21645,21646,4658,2395,13272,11658,16278,10412,6019,7748, +2723,8257,8226,2520,21758,13002,18147,12304,21445,21499, +1690,12201,3903,2804,2269,10970,6448,7415,5716,17031, +3539,5774,3739,20815,13600,11483,4965,5335,12236,14225, +18807,14390,4216,5014,16457,16361,7297,21587,7347,18814, +16955,18388,18328,7348,19679,6110,16663,12369,1476,18535, +5825,17823,13967,18480,9122,18274,1353,6699,8975,7859, +8976,14937,4748,16173,7052,11471,10877,8831,6364,15860, +19611,19481,3070,17992,18505,20643,12370,18691,7796,18692, +14887,19602,16362,10915,15692,7058,7797,13854,6628,9380, +13564,17332,14606,15409,16542,14408,2779,12309,7300,18998, +20435,4929,11948,11127,5527,7497,15300,18609,14133,19889, +21557,11307,15133,7310,18568,7806,6674,5148,12929,10706, +19890,13809,14585,20820,16547,15861,13805,15490,20380,14943, +14506,8690,16890,5522,12644,5215,15238,12043,15547,5289, +2939,20652,11894,7070,5455,13011,12953,10921,17901,5184, +21420,16154,13096,18523,3721,7301,20976,3526,10222,14042, +16962,6975,9771,6788,19373,12983,5864,5087,5088,16043, +6488,14108,3179,12211,19513,7574,6431,6596,5784,11783, +19008,5199,8631,5725,5726,10747,20588,21351,9382,9302, +2427,3077,9502,17769,13277,14867,15892,5652,20250,15140, +9392,10377,9824,11135,10286,2347,15141,8693,1628,10435, +8123,20614,20325,14755,10748,11476,18525,15782,12212,21285, +14134,13572,7358,3078,6976,18233,18030,4423,18102,20856, +21710,3109,12603,14824,6489,9018,20659,14236,16908,2943, +3767,4430,11338,16764,13698,10016,10150,13104,17305,13956, +4494,20440,9353,20031,14892,4152,2480,15500,11009,15148, +8456,15421,6793,6986,11941,16176,11841,13935,15929,20295, +4689,13329,13672,6191,12935,5489,10184,9364,5200,16995, +14508,21558,14031,7083,3981,7995,7513,2845,3312,14758, +7555,10004,11581,19193,6801,14199,21731,17970,2484,5149, +8239,21734,19042,12606,4757,6738,3493,7196,15214,12496, +2537,2812,21294,6802,7084,7835,7303,14686,7436,13036, +3547,18872,1660,15033,14328,9661,19171,15580,15366,11155, +12734,16046,1734,6907,7202,12892,11690,11836,18759,5223, +7525,19218,11897,13288,18340,12735,11140,20559,5788,2945, +7000,8981,12517,3592,2794,5299,11156,19448,21012,6670, +12895,9430,9397,13995,10385,9669,3158,10527,11228,6814, +11979,10481,21007,5204,4039,19906,9677,4643,21465,15088, +9750,7602,2798,13302,21190,10348,18289,9683,21191,2458, +7824,4352,15099,6508,11800,19802,10238,9134,7646,17260, +5738,8268,17458,10103,19270,7384,19200,19492,19326,17341, +11884,1869,2211,9222,8270,14857,14362,21736,3113,13582, +13493,2022,8170,19809,10630,9701,3160,10546,3472,8481, +18296,9253,9228,21217,9411,9575,1108,11572,19816,10106, +5687,6517,12857,17808,2331,2825,12804,8582,18943,8415, +17025,17875,6069,9000,9273,8891,14905,862,17820,2629, +13239,8606,8893,8608,2873,5568,19113,19613,17429,18697, +16694,15460,7948,11973,6343,15695,6518,17833,12166,16996, +17502,17837,16910,9776,2847,19043,4350,19637,2994,6526, +1911,1912,8286,12915,2596,14082,2630,14086,21061,15203, +15204,9650,20251,19624,9656,5733,4287,20567,11361,11362, +18595,14464,17876,8421,12838,13390,15114,13269,18973,15961, +18686,1977,6837,3849,20653,20047,16543,2763,15696,7949, +14264,19168,3788,8162,9019,3165,3389,4080,7556,9803, +1719,4040,7378,7385,21257,13293,18956,14123,8704,13125, +18554,18129,6773,13628,6970,11974,6737,4103,18760,17463, +5637,10935,877,7830,12293,2197,10829,10830,12290,9911, +7237,13997,11460,16169,18089,4401,13794,17235,8221,13391, +4002,11963,12138,8227,4189,1392,14019,10878,14001,14749, +16184,6111,15323,14021,10479,11433,9507,15930,13816,20410, +14071,20411,11022,10386,3868,8398,12785,18461,11633,1712, +14377,12801,16847,13253,18205,3934,18508,20026,20762,1727, +3474,14876,9373,11693,4515,5741,1683,20271,11161,3776, +19946,2881,16244,4518,3320,16111,10794,13371,12447,12849, +16675,16676,16020,8132,20793,20876,12855,8011,8012,13939, +8490,6225,13589,1584,5137,21027,12072,8402,6390,11853, +17866,17869,20007,18302,3413,19454,6411,6881,11856,10893, +11109,2678,12073,1411,20877,12056,21372,20089,10122,20230, +4728,10953,20092,16118,9594,11089,18779,4425,15717,14926, +8925,8085,8177,18919,7234,21033,6746,1340,20232,21196, +19437,5466,6326,12178,3039,2590,15105,2462,14981,8217, +18039,14462,8404,4871,7106,5640,3414,19139,21089,18675, +6685,20127,2505,16388,6308,7465,14994,4376,17705,4881, +14075,20887,19205,16712,8657,10654,967,15679,11417,9442, +18739,11091,13545,12529,17465,17570,15107,8903,13152,8279, +12469,17744,20923,5676,11294,16683,13435,18931,8037,14521, +12239,2224,7927,9925,13383,16435,5925,10806,19465,1821, +3996,6240,18944,19334,9236,5943,9556,5331,9787,2951, +4771,18945,15905,9322,7242,2680,8090,15171,2467,12153, +17283,14440,9076,12453,5958,7977,11723,15972,17490,15872, +4259,16085,9614,14879,14995,9444,14880,4024,20015,6180, +17728,14711,2982,20493,8778,16273,16125,3931,16635,8196, +14343,9816,6833,15317,13154,3556,8372,5511,5858,5962, +21099,12232,6046,2264,12633,4546,2598,10405,8222,9445, +20611,12476,15747,19725,11655,10406,11118,8050,10058,10587, +13473,19726,11725,1619,6334,19837,9155,13254,12949,20890, +19184,1827,1343,19832,16603,13965,4583,19833,8711,7158, +14344,14079,12690,12343,16858,19835,13840,6589,7416,11927, +13397,15856,4743,16636,15639,16356,13868,2066,6099,18323, +6248,11097,10835,19230,18324,6210,14493,10943,20116,6845, +11533,5758,2653,4321,9791,12808,12809,10910,15727,3118, +16401,1969,6764,1831,17856,7060,7411,4788,18974,19208, +14577,7749,20638,15453,19603,1467,11277,14526,15975,14474, +19414,8228,3968,16054,7670,13398,15464,10220,6896,19874, +11559,1178,19508,13557,21347,9845,2178,17201,2956,6144, +21500,10759,19295,9119,4744,10277,16402,17092,19296,12506, +7940,5777,15282,19885,9727,18607,11004,21405,2527,15381, +3290,16203,5419,14055,20320,14581,10603,10688,16363,20117, +16802,16544,13006,20243,14529,871,20023,19114,15127,15290, +14530,863,12065,2837,16620,2011,11220,5286,6049,6673, +17036,3626,20966,19240,7798,5258,15176,7713,6775,19158, +5194,14849,2958,17495,19750,17782,6429,1478,1624,20977, +7595,8809,14451,14261,11128,1000,10375,6397,19441,2235, +4533,19372,5803,10762,13286,19619,7174,18171,2345,16989, +7175,10304,10223,7907,5850,3102,20854,5089,13030,7718, +3071,2961,16044,11996,15605,18664,16959,11129,15491,14262, +5975,9728,16204,2609,5113,12206,21572,8630,12187,20495, +2697,17902,6879,7499,18230,2902,9861,3185,15650,7549, +3103,19341,6258,17658,14820,5650,3104,9047,17903,20978, +12349,8444,7722,12508,3487,6789,7811,16761,12009,7075, +16410,15146,12956,17045,17046,15253,4178,11286,13955,15142, +20657,3105,18999,20988,16237,15394,18100,9013,18645,16007, +13982,6167,1505,2192,14780,12602,9969,16411,14095,14088, +2534,8099,6491,7629,9363,3218,6277,5938,20028,10192, +6278,4935,6054,6122,17214,7503,14197,17047,1038,10378, +11848,19634,10003,14486,3458,6599,20255,17604,19780,14681, +18024,10085,10782,21520,19379,6794,1994,9801,3768,18707, +6550,20660,10783,3407,19029,15210,12351,8325,15326,13215, +21459,11877,5833,7953,12165,14091,7085,16516,2810,15332, +15034,15884,14092,21234,9744,11102,14544,14825,11137,11849, +19312,19313,11017,7959,12732,7197,21716,16667,15553,19197, +19128,4133,3029,6904,13300,9261,8537,885,16413,1701, +5533,12941,19314,1702,9094,4642,2014,10888,7526,16478, +10666,20155,10454,9662,19447,18514,10384,15013,20997,19355, +4038,16334,6715,17614,12048,14432,1638,2200,11226,10159, +7375,14097,2539,5536,1706,6914,17311,10344,13242,13826, +9678,8070,17452,19323,15190,16484,6507,18047,21188,10232, +9181,4137,4537,6383,9182,14762,10097,19324,11103,7217, +9806,7528,19267,9986,19065,7382,2210,3359,13676,7450, +9216,4504,14870,19851,21470,4763,14360,9433,9217,3112, +13491,19388,12943,4452,8473,18429,19327,13983,20164,10547, +18419,9534,11105,14250,15398,3471,7699,2249,19329,6064, +21214,9266,9226,11577,16241,10551,18111,17265,18432,5152, +18436,19820,5668,17394,17395,6679,6203,21322,20357,17563, +2639,20109,12794,21034,4673,11860,16561,12560,18920,12254, +8580,12058,8581,12097,11457,9905,5670,17663,5671,5672, +1567,3282,17079,20734,21198,8710,20525,4882,1078,17571, +17572,10118,21411,12108,15354,18500,15887,14207,16389,6658, +21091,7657,17877,6186,13592,6579,17760,17761,17236,19142, +16686,21093,18548,14644,16345,15906,18043,20114,8583,17083, +17974,20736,12532,6727,5679,2381,6689,2412,6757,9927, +4902,8091,2382,12596,15840,21435,15874,5886,9299,14182, +17884,2650,13795,6355,16860,14740,6143,18051,8837,8422, +17415,16861,21360,8525,3682,17580,7053,16793,10493,18376, +8223,10013,9039,6857,16088,16871,3203,16719,6211,8304, +4966,16661,3068,4789,12481,13316,13966,16872,13317,17669, +18975,7618,19741,5182,12305,5517,16327,14475,5569,14290, +14291,11634,5336,16357,2424,6147,8993,21062,17068,6700, +4790,9796,17681,7671,1479,19233,21230,16458,16032,14211, +16885,11929,11930,2182,18227,8092,8097,10963,16505,20340, +7936,13322,13855,6591,4490,13402,15205,18481,9934,7752, +20216,5570,19990,11554,14664,9847,5456,15492,2357,4362, +1842,6667,17539,17041,16805,19992,6118,6149,16892,20027, +11515,14213,13323,18623,11130,9732,19304,16753,5408,18394, +13052,1494,1629,3079,10436,7359,10287,12213,15178,19011, +15893,8445,21592,6432,18822,20989,16509,10181,5978,11975, +13712,8098,9051,3163,20296,7366,16912,16913,19012,17503, +2668,6635,2240,18698,18103,18400,18104,13075,8536,3573, +4179,14399,7632,4690,14958,19781,9974,8100,14299,4691, +18105,9258,10947,15533,19030,8101,10987,8024,8025,19309, +19044,18025,9206,15383,1996,16919,13631,21622,9751,6739, +21208,10093,16371,19045,17549,20557,6803,3299,11934,1757, +13882,6156,18066,7961,2742,3549,18631,6157,9262,1641, +13824,9670,11406,13972,10528,9131,992,18071,8944,14917, +9891,9684,10349,8463,9900,18415,16939,17617,10239,18716, +1999,13688,19981,9263,3114,2702,5658,8338,2392,11075, +15527,9264,21218,9254,10107,19822,20533,20731,12109,2465, +16403,5936,8446,18652,21685,4404,2899,8671,20171,3850, +13012,19374,13037,12060,2338,7339,2893,19614,20341,1553, +1200,1843,2895,19515,4041,2471,11852,8109,15294,13748, +10790,4544,5162,18363,5246,1303,14992,19530,5248,11439, +3653,13599,13548,21566,10808,8760,12870,9490,12552,5173, +15593,1345,13558,2957,7254,4749,8686,8229,2786,17042, +1329,10661,7863,10679,14022,16510,9508,4153,15931,13105, +16920,9671,4042,9945,12024,12395,1866,16940,2714,16419, +13701,2715,1072,7105,2148,21426,5242,8645,1807,6302, +18190,19135,4458,21357,8910,21070,11455,12255,8219,18780, +17675,16139,10039,12256,11676,18596,19523,18040,3396,1811, +23007,23008,23009,23010,23011,23012,23013,23014,23015,23016, +23017,23018,23019,23020,23021,23022,23023,23024,23025,23026, +23027,23028,23029,23030,23031,23032,23033,23034,23035,23036, +23037,23038,23039,23040,23041,23042,23043,23044,23045,23046, +23047,23048,23049,23050,23051,23052,23053,23054,23055,23056, +23057,23058,23059,23060,23061,23062,23063,23064,23065,23066, +23067,23068,23069,23070,23071,23072,23073,23074,23075,23076, +23077,23078,23079,23080,23081,23082,23083,23084,23085,23086, +23087,23088,23089,23090,23091,23092,23093,23094,23095,23096, +23097,23098,23099,23100,23101,23102,11,34,37,328, +70,72,68,118,23934,6,66,74,330,75, +76,77,78,109,112,88,90,92,94,96, +98,100,102,114,115,104,106,131,132,133, +151,143,144,136,135,146,145,134,152,137, +165,142,140,167,124,147,148,158,155,154, +153,138,157,163,164,159,160,431,150,149, +339,338,327,79,80,443,18,323,321,322, +331,325,491,335,336,176,178,177,175,174, +169,168,171,170,332,185,189,183,187,334, +23103,23104,23105,23106,23107,23108,23109,23110,23111,23112, +23113,23114,23115,23116,23117,23118,23119,23120,23121,23122, +23123,23124,23125,23126,23127,23128,23129,23130,23131,23132, +23133,23134,23135,23136,23137,23138,23139,23140,23141,23142, +23143,23144,23145,23146,23147,23148,23149,23150,23151,23152, +23153,23154,23155,23156,23157,23158,23159,23160,23161,23162, +23163,23164,23165,23166,23167,23168,23169,23170,23171,23172, +23173,23174,23175,23176,23177,23178,23179,23180,23181,23182, +23183,23184,23185,23186,23187,23188,23189,23190,23191,23192, +23193,23194,23195,23196,23197,23198,345,352,359,366, +373,380,387,394,401,407,23679,23680,23681,23682, +23683,23684,344,351,358,365,372,379,386,393, +400,406,410,413,416,418,420,422,424,426, +428,430,343,350,357,364,371,378,385,392, +399,405,409,412,415,417,419,421,423,425, +427,429,342,349,356,363,370,377,384,391, +398,404,23685,23686,18727,4412,14015,14972,16730,10188, +12616,1048,8127,14553,23687,23688,346,353,360,367, +374,381,388,395,402,408,411,414,23689,23690, +23199,23200,23201,23202,23203,23204,23205,23206,23207,23208, +23209,23210,23211,23212,23213,23214,23215,23216,23217,23218, +23219,23220,23221,23222,23223,23224,23225,23226,23227,23228, +23229,23230,23231,23232,23233,23234,23235,23236,23237,23238, +23239,23240,23241,23242,23243,23244,23245,23246,23247,23248, +23249,23250,23251,23252,23253,23254,23255,23256,23257,23258, +23259,23260,23261,23262,23263,23264,23265,23266,23267,23268, +23269,23270,23271,23272,23273,23274,23275,23276,23277,23278, +23279,23280,23281,23282,23283,23284,23285,23286,23287,23288, +23289,23290,23291,23292,23293,23294,13,14,16,324, +20,22,1,24,27,30,121,32,3,36, +38,340,341,348,355,362,369,376,383,390, +397,40,43,126,128,130,45,47,432,439, +441,447,449,456,459,462,464,470,472,477, +481,487,492,498,500,502,504,506,509,520, +522,524,526,528,48,50,51,52,53,57, +433,440,442,448,450,457,460,463,465,471, +473,478,482,488,493,499,501,503,505,507, +510,521,523,525,527,529,60,62,64,69, +23295,23296,23297,23298,23299,23300,23301,23302,23303,23304, +23305,23306,23307,23308,23309,23310,23311,23312,23313,23314, +23315,23316,23317,23318,23319,23320,23321,23322,23323,23324, +23325,23326,23327,23328,23329,23330,23331,23332,23333,23334, +23335,23336,23337,23338,23339,23340,23341,23342,23343,23344, +23345,23346,23347,23348,23349,23350,23351,23352,23353,23354, +23355,23356,23357,23358,23359,23360,23361,23362,23363,23364, +23365,23366,23367,23368,23369,23370,23371,23372,23373,23374, +23375,23376,23377,23378,23379,23380,23381,23382,23383,23384, +23385,23386,23387,23388,23389,23390,645,647,649,651, +653,655,658,660,662,664,667,669,671,673, +675,677,680,682,684,686,688,690,692,694, +696,698,700,702,704,706,708,710,712,714, +716,718,720,722,724,726,728,730,732,734, +736,738,740,742,744,746,748,750,752,754, +756,758,760,762,764,766,768,770,772,774, +776,778,780,782,784,786,788,790,792,794, +796,798,800,802,804,806,808,810,812,23691, +23692,23693,23694,23695,23696,23697,23698,23699,23700,23701, +23391,23392,23393,23394,23395,23396,23397,23398,23399,23400, +23401,23402,23403,23404,23405,23406,23407,23408,23409,23410, +23411,23412,23413,23414,23415,23416,23417,23418,23419,23420, +23421,23422,23423,23424,23425,23426,23427,23428,23429,23430, +23431,23432,23433,23434,23435,23436,23437,23438,23439,23440, +23441,23442,23443,23444,23445,23446,23447,23448,23449,23450, +23451,23452,23453,23454,23455,23456,23457,23458,23459,23460, +23461,23462,23463,23464,23465,23466,23467,23468,23469,23470, +23471,23472,23473,23474,23475,23476,23477,23478,23479,23480, +23481,23482,23483,23484,23485,23486,644,646,648,650, +652,654,657,659,661,663,666,668,670,672, +674,676,679,681,683,685,687,689,691,693, +695,697,699,701,703,705,707,709,711,713, +715,717,719,721,723,725,727,729,731,733, +735,737,739,741,743,745,747,749,751,753, +755,757,759,761,763,765,767,769,771,773, +775,777,779,781,783,785,787,789,791,793, +795,797,799,801,803,805,807,809,811,656, +665,678,23702,23703,23704,23705,23706,23707,23708,23709, +23487,23488,23489,23490,23491,23492,23493,23494,23495,23496, +23497,23498,23499,23500,23501,23502,23503,23504,23505,23506, +23507,23508,23509,23510,23511,23512,23513,23514,23515,23516, +23517,23518,23519,23520,23521,23522,23523,23524,23525,23526, +23527,23528,23529,23530,23531,23532,23533,23534,23535,23536, +23537,23538,23539,23540,23541,23542,23543,23544,23545,23546, +23547,23548,23549,23550,23551,23552,23553,23554,23555,23556, +23557,23558,23559,23560,23561,23562,23563,23564,23565,23566, +23567,23568,23569,23570,23571,23572,23573,23574,23575,23576, +23577,23578,23579,23580,23581,23582,530,532,534,536, +538,540,542,544,546,548,550,552,554,556, +558,560,562,564,566,568,570,572,574,576, +23710,23711,23712,23713,23714,23715,23716,23717,531,533, +535,537,539,541,543,545,547,549,551,553, +555,557,559,561,563,565,567,569,571,573, +575,577,23718,23719,23720,23721,23722,23723,23724,25, +28,110,113,89,91,93,95,97,99,101, +103,23725,23726,105,107,61,65,8,23727,82, +87,23728,23729,23730,23731,23732,23733,23734,23735,23736, +23583,23584,23585,23586,23587,23588,23589,23590,23591,23592, +23593,23594,23595,23596,23597,23598,23599,23600,23601,23602, +23603,23604,23605,23606,23607,23608,23609,23610,23611,23612, +23613,23614,23615,23616,23617,23618,23619,23620,23621,23622, +23623,23624,23625,23626,23627,23628,23629,23630,23631,23632, +23633,23634,23635,23636,23637,23638,23639,23640,23641,23642, +23643,23644,23645,23646,23647,23648,23649,23650,23651,23652, +23653,23654,23655,23656,23657,23658,23659,23660,23661,23662, +23663,23664,23665,23666,23667,23668,23669,23670,23671,23672, +23673,23674,23675,23676,23677,23678,578,580,582,584, +586,588,590,592,594,596,598,600,602,604, +606,608,610,612,614,616,618,620,622,624, +626,628,630,632,634,636,638,640,642,23737, +23738,23739,23740,23741,23742,23743,23744,23745,23746,23747, +23748,23749,23750,23751,579,581,583,585,587,589, +591,593,595,597,599,601,603,605,607,609, +611,613,615,617,619,621,623,625,627,629, +631,633,635,637,639,641,643,23752,23753,23754, +23755,23756,23757,23758,23759,23760,23761,23762,23763,23764, +71,58,73,5,7,329,81,446,458,190, +184,186,188,123,139,141,156,161,162,166, +197,204,209,210,211,217,218,219,225,226, +227,233,234,235,245,246,247,256,257,258, +267,268,269,278,279,280,297,298,299,212, +220,236,228,300,301,302,303,307,309,311, +313,315,317,319,318,316,314,312,310,308, +304,320,305,306,172,173,179,180,181,182, +337,122,333,116,117,23765,23766,23767,23768,23769, +23770,23771,23772,23773,23774,23775,437,434,436,435, +455,451,454,452,469,466,468,467,497,494, +496,495,515,511,514,512,519,516,518,517, +513,453,438,23776,489,490,23777,461,23778,23779, +23780,23781,813,814,815,816,817,818,819,820, +821,822,823,824,825,826,827,828,829,830, +831,832,833,834,835,836,837,838,839,840, +841,842,843,844,845,846,847,848,849,23782, +23783,23784,23785,23786,23787,23788,23789,23790,23791,23792, +23793,23794,23795,23796,23797,23798,23799,23800,23801,23802, +347,354,361,368,375,382,389,396,403,20773, +484,474,486,445,475,483,444,476,479,480, +485,41,326,67,23803,508,21167,23804,4,23805, +23806,23807,23935,9,10,23936,23937,119,23938,23939, +83,84,85,86,54,55,56,31,33,35, +42,39,44,12,23,26,59,63,108,111, +15,21,29,120,2,125,129,127,49,17, +19,46,23808,23809,23810,23811,23812,23813,23814,23815, +23816,23817,23818,23819,23820,0,23821,23822,23823,23824, +23825,23826,23827,23828,23829,23830,23831,23832,23833,191, +192,198,199,193,194,200,201,195,196,202, +203,205,206,207,208,213,214,215,216,221, +222,223,224,229,230,231,232,237,238,239, +240,241,242,243,244,248,249,250,251,252, +253,254,255,259,260,261,262,263,264,265, +266,270,271,272,273,274,275,276,277,281, +282,283,284,285,286,287,288,289,290,291, +292,293,294,295,296,23834,23835,23836,23837,23838, +23839,23840,23841,23842,23843,23844,23845,23846,23847,23848, +8829,17231,6535,6086,20542,7042,18120,14179,15314,15901, +9317,10807,16850,17084,1310,20931,18257,14124,5959,7983, +12018,4587,17416,1130,12691,1620,19209,9156,7333,12998, +9036,18384,21630,20942,20743,18167,9930,2092,21583,5037, +4745,16637,19875,2869,16031,18206,17531,7250,1549,19478, +18563,15235,1836,11304,15065,10689,19887,3315,19763,14531, +6021,13003,18986,20644,2012,6025,10777,7575,11431,2185, +1002,5217,3180,1359,1506,1495,6633,1901,9970,17909, +15926,18626,14914,17436,14719,4149,7725,5316,8386,4033, +6795,8879,17252,17253,11834,1558,21785,21786,21787,21788, +21789,21790,21791,21792,21793,21794,21795,21796,21797,21798, +21799,21800,21801,21802,21803,21804,21805,21806,21807,21808, +21809,21810,21811,21812,21813,21814,21815,21816,21817,21818, +21819,21820,21821,21822,21823,21824,21825,21826,21827,21828, +21829,21830,21831,21832,21833,21834,21835,21836,21837,21838, +21839,21840,21841,21842,21843,21844,21845,21846,21847,21848, +21849,21850,21851,21852,21853,21854,21855,21856,21857,21858, +21859,21860,21861,21862,21863,21864,21865,21866,21867,21868, +21869,21870,21871,21872,21873,21874,21875,21876,21877,21878, +6905,11896,11018,9944,11594,5692,14720,10345,15311,17313, +11073,13677,11600,10627,17262,12754,8479,11208,21486,10333, +15102,13369,5048,9375,1054,6226,3669,2883,5098,19567, +12765,19568,2317,6231,16742,4819,7847,18193,10973,1202, +19952,8405,20040,8406,7324,3397,12430,12996,18932,951, +12470,4883,17960,3000,5431,7289,14307,3007,13669,14466, +14378,15344,21686,10176,1444,20623,7883,7706,7474,9616, +5680,17147,21094,18216,17786,18471,17853,15109,13192,19144, +18090,1242,17380,17085,5708,2681,17878,12154,9347,3452, +19224,16567,4261,2513,15633,16750,21879,21880,21881,21882, +21883,21884,21885,21886,21887,21888,21889,21890,21891,21892, +21893,21894,21895,21896,21897,21898,21899,21900,21901,21902, +21903,21904,21905,21906,21907,21908,21909,21910,21911,21912, +21913,21914,21915,21916,21917,21918,21919,21920,21921,21922, +21923,21924,21925,21926,21927,21928,21929,21930,21931,21932, +21933,21934,21935,21936,21937,21938,21939,21940,21941,21942, +21943,21944,21945,21946,21947,21948,21949,21950,21951,21952, +21953,21954,21955,21956,21957,21958,21959,21960,21961,21962, +21963,21964,21965,21966,21967,21968,21969,21970,21971,21972, +16716,2510,8526,10903,1315,15875,17286,2830,5964,17964, +18262,17987,17789,4903,16862,10059,9624,7886,15277,4741, +16257,3760,12433,20430,14083,11250,19742,9160,11251,14501, +16404,15749,2834,1377,2472,4330,2270,1378,10413,5626, +3784,1321,12999,21418,13200,4454,7888,4062,7860,6701, +19680,10917,2940,17937,15646,17682,3347,13842,11254,7350, +16459,13920,6592,17537,2863,7424,21326,2323,9797,13565, +4098,18168,6630,10141,14536,13811,15283,18569,16545,16756, +20654,7945,19306,10691,15548,10144,9651,9282,15761,13013, +3229,8438,20536,1694,14752,2296,21973,21974,21975,21976, +21977,21978,21979,21980,21981,21982,21983,21984,21985,21986, +21987,21988,21989,21990,21991,21992,21993,21994,21995,21996, +21997,21998,21999,22000,22001,22002,22003,22004,22005,22006, +22007,22008,22009,22010,22011,22012,22013,22014,22015,22016, +22017,22018,22019,22020,22021,22022,22023,22024,22025,22026, +22027,22028,22029,22030,22031,22032,22033,22034,22035,22036, +22037,22038,22039,22040,22041,22042,22043,22044,22045,22046, +22047,22048,22049,22050,22051,22052,22053,22054,22055,22056, +22057,22058,22059,22060,22061,22062,22063,22064,22065,22066, +9052,21308,3080,18756,12724,8021,20202,13409,1006,9772, +10979,19169,6464,16517,16723,3574,17793,20297,18106,13480, +3494,9975,9876,13330,15149,5727,8026,4496,7891,10151, +6988,6796,8027,912,20204,3459,7689,5816,15446,6804, +6553,14096,15216,15737,2813,19638,7962,10346,1705,14771, +21717,9211,17004,7203,17971,13927,16668,5090,9398,4043, +9679,21013,13850,9709,20158,13332,15702,5736,15188,9135, +10240,10350,9685,9265,19271,11078,17342,13335,5659,3552, +20166,6564,1812,1822,20848,9705,14696,17347,13055,1161, +12167,4566,3398,4797,11233,16212,22067,22068,22069,22070, +22071,22072,22073,22074,22075,22076,22077,22078,22079,22080, +22081,22082,22083,22084,22085,22086,22087,22088,22089,22090, +22091,22092,22093,22094,22095,22096,22097,22098,22099,22100, +22101,22102,22103,22104,22105,22106,22107,22108,22109,22110, +22111,22112,22113,22114,22115,22116,22117,22118,22119,22120, +22121,22122,22123,22124,22125,22126,22127,22128,22129,22130, +22131,22132,22133,22134,22135,22136,22137,22138,22139,22140, +22141,22142,22143,22144,22145,22146,22147,22148,22149,22150, +22151,22152,22153,22154,22155,22156,22157,22158,22159,22160, +6350,18790,1138,8373,2289,2560,10201,3484,11035,21378, +12482,1554,21148,10202,3018,19241,12814,17208,10305,3708, +11976,21309,10017,16765,3445,16627,19259,18343,15724,5934, +2291,13265,14383,2227,2228,13930,15091,14397,10393,4786, +20334,4856,12451,3878,13590,10995,1440,8146,15241,10123, +11440,20011,4884,5330,7849,4885,15720,11441,15587,7543, +16196,4895,11547,11444,11445,2058,15723,5061,1451,3266, +20943,10563,12032,18741,6481,19604,19605,11447,8527,18957, +10129,3842,6483,3455,21380,7592,2530,2325,16105,9393, +2111,10152,3859,10020,7559,2744,22161,22162,22163,22164, +22165,22166,22167,22168,22169,22170,22171,22172,22173,22174, +22175,22176,22177,22178,22179,22180,22181,22182,22183,22184, +22185,22186,22187,22188,22189,22190,22191,22192,22193,22194, +22195,22196,22197,22198,22199,22200,22201,22202,22203,22204, +22205,22206,22207,22208,22209,22210,22211,22212,22213,22214, +22215,22216,22217,22218,22219,22220,22221,22222,22223,22224, +22225,22226,22227,22228,22229,22230,22231,22232,22233,22234, +22235,22236,22237,22238,22239,22240,22241,22242,22243,22244, +22245,22246,22247,22248,22249,22250,22251,22252,22253,22254, +12354,3866,3867,7773,3417,14744,20979,11522,1412,5163, +21124,17120,17806,2446,18041,12674,17062,3191,1445,21628, +18004,20808,4436,20891,4630,8185,14183,11699,15601,15889, +7738,16442,6730,15388,2651,10960,8055,17418,15976,10812, +17419,15158,12565,4201,14713,18987,1369,20510,5627,10676, +9961,7166,15752,935,2656,1481,11255,4114,8681,18181, +3134,14449,21064,20980,19764,4751,18483,2428,15999,5830, +16571,6595,8842,19119,8448,16903,5616,19013,2896,6780, +11925,3722,20516,14453,3142,19031,21634,15089,14093,3815, +10313,10314,13216,4943,9879,13106,22255,22256,22257,22258, +22259,22260,22261,22262,22263,22264,22265,22266,22267,22268, +22269,22270,22271,22272,22273,22274,22275,22276,22277,22278, +22279,22280,22281,22282,22283,22284,22285,22286,22287,22288, +22289,22290,22291,22292,22293,22294,22295,22296,22297,22298, +22299,22300,22301,22302,22303,22304,22305,22306,22307,22308, +22309,22310,22311,22312,22313,22314,22315,22316,22317,22318, +22319,22320,22321,22322,22323,22324,22325,22326,22327,22328, +22329,22330,22331,22332,22333,22334,22335,22336,22337,22338, +22339,22340,22341,22342,22343,22344,22345,22346,22347,22348, +10154,9331,17220,4640,3390,19213,6155,17221,5617,16373, +11889,19795,16417,19383,9428,9663,14784,3446,10006,10007, +1681,7210,2577,18515,7757,20761,10891,9692,6922,9185, +7009,17978,19348,19201,19392,15399,3732,10647,10554,10555, +1775,1778,1079,4426,4427,13140,1389,20208,10861,11998, +3040,10047,11370,7043,12233,5191,4263,5968,1468,2727, +12976,875,17476,6055,6676,6056,20256,3188,6057,17480, +18701,6059,7691,916,17694,6671,9686,12406,6134,7731, +5119,12121,13399,13620,20323,5528,8503,8504,21150,20327, +20328,20443,4044,12766,19283,1286,852,851,860,861, +857,859,858,868,876,882,881,891,901,893, +896,941,928,924,955,966,974,965,970,969, +979,982,985,987,993,1005,1009,1023,1031,1033, +1042,1041,1058,1061,1052,1051,1055,1062,1047,1059, +1050,1076,1084,1093,1090,12005,1094,1105,1098,1096, +1111,1114,1112,1120,1113,1126,1127,1131,1145,1142, +1146,1139,1143,1144,1159,1160,1172,1175,1171,1183, +1170,1169,1176,1184,1187,1189,1199,1201,1197,1205, +1214,1203,1215,1204,1208,1223,1224,1220,1230,1780, +20526,6087,6094,1781,16266,19553,4527,4967,13400,3540, +10420,20432,9504,7908,17904,7356,12044,942,10339,17862, +21113,3495,947,5537,9687,5138,16340,12795,19913,15721, +17636,17023,4733,11245,11295,14640,20012,12031,4567,10866, +17275,14645,18444,20737,18600,14384,6887,3311,20680,8930, +8186,14441,10957,11371,21261,20628,14646,3832,11700,21568, +2356,1747,11093,10214,15909,3871,3683,11623,11299,17988, +20709,18472,11377,21078,11372,10912,13094,5969,6565,2548, +3240,8376,4264,10760,17289,16874,9077,14212,15753,5814, +16235,9473,14665,13324,9935,20751,1853,1236,1240,1243, +1239,1237,1262,1261,1273,1263,1270,1279,1285,1290, +1288,1284,1295,1323,1305,1297,1306,1308,1298,1301, +1319,1320,1311,1339,1350,1349,1357,1364,1365,1373, +1380,1387,1381,1393,1402,1405,1423,1417,1413,1496, +1483,1501,1429,1449,1443,1427,1433,1480,1430,1456, +1493,1428,1488,1511,1523,1519,1448,1563,1546,1550, +1568,1569,1590,1591,1580,1605,1606,1608,1598,1615, +1614,1630,1654,1666,1665,1672,1680,1687,1689,1700, +1691,1686,1713,1729,1728,1744,1735,1740,1746,1745, +9494,9172,15206,8380,12347,6839,10421,5195,21127,19620, +6840,10704,17125,17716,6705,5815,20118,2971,7351,10964, +6291,17939,15762,17905,4443,16666,5780,11053,16623,8812, +3489,2399,13325,11395,4702,20257,20518,19032,3789,8796, +11396,14893,3085,10290,2572,10750,5728,6600,14894,16921, +12586,14430,9909,2391,7518,18702,17913,11423,5785,7519, +18713,917,6810,7442,20560,10929,2758,14072,11842,18068, +18634,6910,11023,11157,12440,11158,9431,8945,17951,11159, +6923,10352,11028,10241,5660,10767,17006,15528,8622,21239, +13193,19743,14907,20244,8482,14416,1766,1758,1779,1791, +1798,1776,1785,1777,1829,1815,1835,1825,1844,1805, +1809,1828,1790,1845,1830,1810,1808,1898,1894,1897, +1896,1920,1904,1905,1908,1929,1919,1910,1931,1938, +1944,1940,1939,1941,1953,1956,1946,1951,1957,1959, +1972,1962,1975,1974,1976,1983,1991,2004,2007,2000, +2003,2021,2026,2027,2034,2029,2041,2052,2067,2051, +2050,2055,2083,2088,2105,2094,2119,2120,2117,2128, +2122,2127,2137,2142,2139,2145,2150,2152,2166,2165, +2186,2180,2175,2183,2229,2220,2230,2255,2261,2265, +6285,19332,21100,7690,20298,19940,1104,3897,12790,21542, +16782,20568,8817,5164,3370,8409,9603,4823,16562,4280, +8624,20888,7851,1685,4297,20569,15195,16213,7878,11373, +8187,19715,10638,16144,4306,11446,21225,11910,12454,10048, +12122,9378,1782,12534,19430,8931,8759,13555,21171,5682, +4313,12839,10408,16443,895,17287,18263,12184,9348,6244, +13270,16498,13091,2089,8761,13614,2252,9283,6212,19606, +17421,17093,1207,10269,19415,2371,2385,18385,14130,9067, +5518,2090,6449,10371,2437,11932,15030,21448,8763,18329, +21381,8779,2528,12708,21631,13294,2306,2285,2287,2278, +2286,2281,2305,2310,2318,2321,2319,2335,2328,2332, +2342,2346,2348,2340,2354,2355,2364,2373,2388,2384, +2378,2389,2394,2404,2407,2403,2417,2405,2406,2408, +2449,2445,2478,2447,2501,2536,2493,2495,2507,2521, +2518,2535,2498,2496,2545,2546,2550,2551,2569,2592, +2597,2585,2588,2584,2586,2625,2620,2618,2614,2640, +2648,2638,2646,2675,2676,2693,2694,2703,2709,2733, +2724,2735,2728,2726,2729,2716,2721,2756,2750,2760, +2766,2764,2791,2774,2796,2778,2785,2775,2772,2808, +9962,8501,1793,11256,7352,6148,13621,9465,19159,16754, +12709,10591,11591,13923,18276,3907,16152,19236,8734,16465, +14913,20655,4100,17099,3488,15648,11612,15732,12815,4175, +4752,13629,13069,10692,5387,15143,4269,10146,14954,15497, +6465,12273,8996,15734,17102,12649,9738,16511,20050,4115, +9114,12030,18577,21312,2195,12820,1008,12190,10193,10382, +8620,2903,2441,19121,9424,12390,12821,12822,3181,21599, +2993,10596,6994,14238,9332,20299,7520,17053,3911,3770, +1800,20104,13077,3608,9664,7521,16922,20497,13108,7443, +19791,21391,6128,8738,20260,9454,2803,2805,2851,2836, +2838,2819,2854,2859,2861,2872,2864,2867,2879,2882, +2890,2892,21361,2898,2444,2905,2912,2913,2920,2926, +2915,2933,2938,2963,2950,2954,2948,2974,2976,2983, +3001,3012,3021,3022,3019,3017,3014,3006,3037,3045, +3053,3043,3084,3069,2889,3058,3057,3093,3117,3123, +3141,3143,3130,3153,3164,3162,3177,3170,3171,3196, +3204,3205,3200,3207,3215,3220,3225,3231,3232,3228, +3255,3252,3260,3267,3274,3291,3295,3308,3309,3313, +3317,3318,3354,3329,3333,3319,3335,3342,3330,3344, +7820,2814,18717,13633,3496,18873,12281,12282,19642,12426, +12824,919,8701,7379,19796,13928,12125,3032,1861,18516, +10710,17224,8946,9400,9432,21017,9680,9688,4505,13636, +12126,19272,9693,10242,10243,11408,14858,5661,9223,1934, +18297,13775,19949,15295,10699,17566,18531,12671,1362,4125, +21071,21072,18737,14570,19531,20924,15776,4991,11114,15161, +10955,2151,10494,19666,16717,21262,5755,17086,20809,5232, +5233,14881,7934,14443,5062,9066,3684,15570,5552,5647, +21724,10070,10414,3520,20845,1469,2807,6702,19510,19115, +21507,6897,20646,19928,16720,17245,3331,3372,3367,3364, +3366,3373,3403,3399,3410,3427,3411,3422,3423,3415, +3421,3425,3451,3464,3465,3480,3481,3500,3518,3532, +3515,3513,3519,3512,3534,3545,3535,3541,3537,3562, +3555,3564,3579,3568,3569,3580,3589,3584,3582,3603, +3595,3606,3617,3619,3623,3613,3620,20383,3628,3650, +3648,3663,3693,3685,3674,3666,3677,3692,3723,3716, +3720,3740,3736,3734,3769,3751,3745,3746,3747,3750, +3757,3759,3758,3761,3786,3775,3790,3779,3774,3806, +3801,3802,3805,3821,3820,3854,3858,3824,3836,3848, +18482,20818,18748,10918,14938,3695,1326,20656,19424,7176, +5237,15494,14944,10707,15324,5018,17941,12725,19792,6989, +15008,2196,3441,5786,15217,9568,11879,11071,3533,9672, +19982,20829,20167,9459,13835,17581,15967,13720,21543,2115, +18921,17143,11714,13342,4709,6039,20013,20801,7974,20802, +19709,8836,1177,12259,11650,9619,19466,12260,1823,10049, +11716,21755,20810,8288,6872,15910,20945,6873,6101,19102, +21492,20946,13731,4075,21265,11871,5008,5212,20276,14882, +9068,5127,7987,15640,15996,18209,10599,10423,5555,21760, +21408,1211,6966,20967,9071,9466,3873,3880,3875,3881, +3887,3889,3906,3898,3894,3914,3918,3919,3941,3944, +3948,3957,3950,3955,3949,3958,3978,3987,3984,3990, +3994,3998,4005,3977,4020,4023,4029,4058,4025,4060, +4064,4063,4070,4078,4071,4073,4076,4069,4087,4090, +4101,4091,4092,4094,4111,4123,4119,4120,4145,4141, +4155,4143,4170,4162,4169,4166,4171,4196,4184,4181, +4193,4211,4219,4208,4240,4236,4226,4237,4235,4268, +4257,4267,4255,4273,4251,4256,4305,4286,4293,4326, +4316,4308,4360,4370,4369,4396,4395,4399,4398,4411, +12208,9994,21675,19752,10565,10566,18751,17043,1575,7177, +4930,1497,11949,7753,21065,21589,17827,2452,3542,9799, +21513,19773,17910,20990,5218,5529,13812,15211,13833,7190, +8632,1988,10980,21008,7178,10445,15095,6990,19343,16596, +13353,9102,19033,6642,13165,7119,17444,12587,7635,21421, +15934,21735,10508,15219,11881,14098,6811,13673,11957,19797, +12427,7211,16066,16597,2486,6911,8947,10510,1645,14100, +21422,9542,3161,18186,19547,14379,8015,18615,9318,18601, +1234,1748,16197,21202,7707,3803,16689,5712,2891,18619, +17422,2514,8807,3431,21449,17824,4418,4424,4437,4442, +4433,4432,4439,4449,4453,4469,4456,4459,4468,4492, +4481,4483,4499,4475,4485,4510,4514,4521,4522,4516, +4520,4519,4541,4542,4539,4556,4555,4553,4554,4560, +4561,4563,4575,4585,4578,4580,4576,4600,4608,4609, +4619,4624,4620,4622,4626,4650,4661,4647,4652,4646, +4649,4668,4680,4671,4701,4707,4704,4708,4711,4712, +4721,4731,4730,4750,4737,4747,4722,4732,4740,4772, +4768,4777,4780,4785,4784,4800,4806,4812,4843,4820, +4841,4860,4869,4924,4913,4880,4904,4854,4876,4870, +15094,5614,21419,16641,16205,18210,13326,18578,18579,15799, +2349,15735,3816,8326,9877,16914,16809,8957,2897,20531, +8894,8895,2485,3210,9880,20221,3168,13134,13333,4013, +20225,10266,13170,2820,14560,4986,12858,2826,6236,12675, +6016,14467,4654,11209,13505,21263,10050,10216,1767,1117, +15001,6249,8056,3810,18988,14815,8052,13509,12456,9505, +21320,2086,3575,3219,16224,8072,8612,8073,9377,12194, +2593,10802,21199,16252,7658,15162,13222,18161,21374,19867, +6002,2081,12295,18859,3932,14186,17088,21204,11505,5473, +13155,11275,1226,2061,12156,10060,4894,4901,4919,4912, +4853,4952,4951,4964,4959,4960,4956,4963,4968,4953, +4971,4994,5000,5034,5013,4989,5004,4980,4987,4978, +5016,4982,5006,4979,4983,4981,5015,4984,5045,5044, +5052,5070,5085,5078,5079,5081,5091,5092,5097,5103, +5104,5099,5123,5128,5120,5124,5150,5153,5156,5166, +5165,5160,5159,5158,5180,5181,5201,5187,5190,5198, +5188,5202,5213,5220,5219,5227,5250,5257,5255,5240, +5253,5251,5247,5254,5273,5279,5275,5281,5272,5283, +5313,5308,5309,5317,5319,5320,5332,5327,5329,5344, +11905,4905,4487,5126,4528,14605,10857,14651,13312,11276, +10656,5775,13442,2602,19111,18620,1422,9084,7665,15245, +13869,6960,6007,21081,9161,3454,2069,4838,16000,9495, +9286,8258,5628,7425,5935,15941,17098,20969,2522,15163, +21278,21761,15857,2070,5235,5112,8905,20024,11962,17475, +12547,9163,21648,12021,1499,5314,15358,5600,19556,7357, +20552,6398,20755,14154,21128,10431,9963,8529,4931,20324, +5486,12886,8530,2927,2073,21676,1875,17942,1555,15248, +17248,12492,17686,6371,14539,19939,2941,10524,16696,3945, +14915,7077,7800,17687,10967,4535,5348,5352,5354,5364, +5369,5368,5376,5379,5371,5378,5366,5374,5365,5394, +5395,5396,5404,5403,5415,5412,5414,5429,5428,5442, +5439,5441,5446,5481,5474,5462,5485,5461,5465,5464, +5463,5524,5495,5513,5504,5500,5501,5543,5545,5541, +5553,5564,5563,5582,5585,5589,5594,5596,5597,5603, +5612,5605,5607,5608,5606,5629,5625,5663,5642,5657, +5639,5667,5688,5695,5717,5702,5699,5711,5698,5701, +5706,5742,5753,5746,5751,5773,5769,5779,5772,5765, +5799,5800,5812,5828,5821,5841,5856,5868,5872,5879, +2875,4754,21288,6262,13163,13350,11202,12984,5488,14588, +20032,6124,15501,19974,2713,13971,20758,11789,12986,17478, +5388,12086,4067,21460,2789,14159,21289,13016,10227,7367, +1927,6805,1515,3634,3086,18237,14110,3166,12318,12404, +19798,16045,20258,14160,5787,18832,6434,2241,8813,12497, +20219,6995,10307,2075,11731,15268,3167,3793,15269,9383, +9810,17445,1862,11141,14161,3497,9885,3392,4975,7444, +11287,9022,3357,7639,15249,9333,17453,10460,14689,20135, +12781,12023,12736,12321,5133,8333,10461,10455,18288,3461, +14012,21296,5424,12896,9758,14690,5883,5882,5884,5893, +5890,5892,5891,5906,5910,5916,5933,5915,5929,5931, +5917,5944,5942,5983,5982,5956,5953,5981,5955,5963, +5951,5948,5993,5999,6003,6029,6028,6023,6018,6035, +6034,6044,6036,6043,6067,6070,6096,6102,6093,6074, +6079,6076,6075,6100,6114,6089,6081,6098,6151,6150, +6152,6139,6166,6165,6170,6173,6174,6176,6178,6177, +6190,6192,6184,6204,6205,6207,6239,6247,6235,6224, +6220,6222,6286,6284,6288,6300,6305,6310,6303,6321, +6318,6323,6366,6352,6363,6351,6373,6349,6372,6360, +9218,9024,19647,19977,6031,20667,15367,15704,11801,2745, +18839,12746,15615,21338,21157,4472,14789,21156,12944,21473, +15617,10469,10353,7389,16187,19328,19812,9187,10246,13171, +9764,9227,12904,19984,21054,13495,9765,1566,4108,21702, +9543,14550,10632,19331,19986,21475,19821,4482,14371,20570, +14380,11917,6088,11647,3227,20507,12863,20374,1418,1163, +16789,14125,8625,13837,1419,15197,19145,20574,11094,15377, +6420,5107,8294,11378,21145,2563,15115,6250,15913,2062, +9960,21348,1118,9312,4384,13443,6107,17294,4920,9561, +19968,10432,8232,12716,1132,20479,6348,6391,6393,6410, +6401,6412,6404,6444,6455,6454,6461,6460,6476,6474, +6473,6477,6501,6499,6498,6500,6511,6516,6531,6537, +6530,6566,6576,6580,6575,6590,6593,6582,6578,6574, +6570,6607,6611,6617,6641,6639,6644,6612,6614,6623, +6629,6660,6664,6657,6663,6678,6684,6696,6713,6682, +6731,6718,6774,6735,6785,6741,6763,6760,6758,6761, +6744,6756,6743,6745,6752,6749,6830,6828,6831,6846, +6843,6856,6867,6871,6875,6874,6888,6882,6894,6906, +6883,6892,6929,6935,6952,6936,6965,6978,6949,6971, +5865,6450,14029,15498,1577,11182,21633,7505,9509,17606, +4847,11952,1336,5531,17783,7259,21352,15505,14032,4717, +7598,11340,14033,14034,11956,2670,9826,8882,1880,6558, +14787,7212,17314,16048,11806,9689,21783,3638,11807,15809, +9267,14923,8111,5372,20764,8113,19524,7143,2143,21139, +18085,19938,6237,19549,5249,16253,13755,16564,13384,11502, +21487,15959,11862,4804,7147,14736,2952,12261,20708,14126, +6241,20892,7045,4656,20016,13758,3402,7884,4570,3193, +8138,20094,1064,4831,20948,12639,2710,6245,20095,17027, +4906,17582,14388,1788,21266,13507,6938,6932,6944,6987, +6928,6941,6947,6953,6961,7026,7033,7057,7069,7092, +7061,7024,7041,7047,7030,7032,7063,7031,7108,7101, +7109,7102,7168,7131,7187,7136,7126,7159,7135,7155, +7142,7153,7152,7124,7125,7140,7130,7134,7129,7148, +7127,7257,7236,7228,7232,7241,7227,7268,7278,7292, +7287,7293,7307,7312,7304,7306,7305,7308,7320,7330, +7319,7317,7334,7321,7349,7329,7325,7326,7316,7341, +7401,7410,7400,7432,7418,7397,7404,7426,7399,7407, +7406,7467,7498,7494,7491,7468,7458,7495,7504,7459, +10061,21267,14318,5144,18503,4907,16147,20682,3340,2831, +14524,21042,17196,21688,8079,1179,13475,11379,14809,21720, +8933,7984,13763,6008,17588,7792,21174,2725,5592,1119, +8431,8934,6362,3051,6542,5337,15540,17532,8840,7666, +13560,5071,10657,17991,1366,17290,4915,5318,15914,13798, +15804,19112,9419,17589,8377,5063,3843,15940,14934,7591, +17353,6765,8432,7427,8381,2570,16607,20713,10498,2523, +13403,14750,1198,15942,17427,6544,13180,5355,17781,15647, +17792,17538,6255,17038,4921,15841,15186,4130,9072,4839, +7991,6424,20819,18270,8095,4776,7470,7475,7464,7463, +7478,7486,7473,7462,7548,7539,7540,7542,7538,7561, +7569,7567,7566,7565,7581,7593,7585,7631,7616,7634, +7617,7615,7606,7607,7611,7614,7609,8468,7663,7662, +7660,7650,7661,7652,7648,7654,7687,7653,7667,7711, +7719,7708,7709,7701,7712,7747,7736,7735,7739,7751, +7733,7805,7767,7763,8220,7772,7788,7799,7808,7777, +7778,7832,7829,7842,7867,7843,7848,7854,7837,7850, +7853,7845,7869,7889,7871,7874,7870,7876,7894,7898, +7904,7895,7903,7923,7942,7930,7941,7922,7932,7931, +7167,17898,13734,21590,2398,4220,9652,10521,9822,2734, +13594,14319,12717,21406,12719,16283,12980,17299,14717,16407, +15572,16284,5175,16330,1371,21384,1955,5866,3206,10592, +10180,12779,20457,1500,2988,10080,11150,12647,13160,15733, +21591,5804,21649,16894,21514,17730,9835,7909,4590,13931, +11258,19765,21620,4491,10522,17906,19242,14284,12720,17911, +17335,7360,8735,17302,13924,11151,6979,4102,2699,3709, +11259,10841,19892,17599,1253,14955,13351,1556,6568,5340, +3082,11178,16512,5021,16470,15956,5421,11203,17544,9800, +21593,1601,5807,19122,15651,5574,7919,7920,7975,7992, +7972,7989,7986,7996,7969,7980,7993,7990,7971,8005, +8030,8017,8016,8064,8060,8054,8068,8034,8043,8059, +8051,8044,8032,8088,8093,8119,8110,8107,8135,8137, +8128,8134,8126,8139,8152,8153,8143,8144,8157,8145, +8154,8147,8213,8176,8178,8184,8175,8180,8224,8216, +8250,8254,8253,8252,8315,8278,8301,8273,8282,8303, +8320,8311,8290,8272,8300,8287,8293,8341,8345,8340, +8366,8374,8354,8370,8389,8478,8401,8418,8413,8458, +8412,8396,8399,8410,8489,8499,8494,8487,8488,8519, +20998,20073,2479,2194,3351,17103,19893,21621,17834,14484, +16366,5341,14114,19310,7954,19034,21386,11709,1194,5530, +12046,21153,7368,3004,13574,14868,20076,17105,3182,7191, +13817,15551,5027,20033,20693,5221,13907,6376,20131,15608, +17306,15147,20694,21635,15552,6668,1960,1516,4779,3144, +9516,15270,18339,17000,21637,9395,21332,12989,10785,20858, +10509,11400,12392,9745,18000,21623,6996,14200,15220,10526, +1372,18758,14058,11323,13047,6848,17166,7198,14144,17799, +13663,18001,15224,13080,20301,21765,20826,14241,14035,9981, +19799,4501,9886,2337,21741,7527,8515,8528,8522,8516, +8524,8545,8544,8546,10204,8552,8554,8571,8559,8567, +8589,8593,8591,8598,8600,8614,8626,8629,8633,8637, +8644,8639,8647,8655,8656,8659,8664,8668,8669,8670, +8680,8695,8692,8673,8702,8703,8708,8714,8715,8716, +8720,8725,8741,8745,8743,8744,8757,8755,8773,8786, +8785,8787,8790,8797,8800,8805,8819,8820,8826,8830, +8843,8832,8841,8846,8853,8855,8857,8856,8864,8872, +8866,8865,8884,8892,8896,8904,8909,8929,8926,8932, +8923,8922,8950,8954,8952,8955,8971,8963,8977,8992, +13709,2243,13936,17800,6812,6495,21698,16928,13049,20034, +3300,14487,6815,7213,14099,7445,7562,6559,13081,3089, +7868,7694,1531,2204,19057,11885,15225,19058,14141,13884, +7218,1708,12959,9219,12590,18072,12747,12225,18637,11409, +9457,17555,21701,8948,19449,17915,9401,17176,2212,7697, +10354,2213,19276,1945,13689,17180,21712,21703,10667,17007, +9255,9412,9809,6227,13749,21244,20700,3829,17026,19231, +15568,20065,17291,3173,17568,4808,4809,12626,1789,12483, +17382,20548,5176,19250,5654,21742,15425,2017,12825,16628, +19268,9402,15432,10355,14973,5154,9008,9004,9005,9028, +9029,9062,9075,9080,9078,9089,9088,9103,9104,9115, +9124,9120,9127,9106,9148,9141,9173,9196,9192,9191, +9190,9204,9195,9188,9200,9198,9237,9235,9244,9238, +9256,9257,9279,9281,9274,9277,9270,9296,9308,9311, +9314,9316,9340,9341,9343,9360,9357,9356,9379,9369, +9388,9396,9425,9422,9446,9426,9417,9451,9440,9443, +9441,9463,9464,9469,9476,9478,9486,9514,9515,9479, +9480,9493,9558,9549,9550,9566,9547,9482,9605,9581, +9611,9583,9578,9585,9618,9577,9584,9630,9590,9598, +13649,14373,5471,21226,8188,10999,11247,5591,15642,8378, +4916,14394,5593,21450,19753,962,4444,14945,10708,10182, +1101,4446,2350,16518,1507,7199,2690,10185,8387,11142, +20561,10621,12322,7014,7020,10548,11086,3283,18469,19502, +19500,4676,1065,18521,5506,12997,20172,5189,18958,21268, +18808,13799,13645,13044,6545,17295,18990,18509,13014,12933, +19625,5342,19899,4502,14203,4694,14204,9780,11891,13053, +5405,2682,4657,6242,2647,3194,4908,17089,12172,9107, +12264,10189,20949,13476,16951,17533,16878,8706,6767,6695, +17423,14153,6256,7547,3543,14155,9634,9580,9626,9588, +9597,9576,9503,9553,9710,9721,9718,9714,9757,9725, +9716,9717,9715,9766,9768,9793,9786,9785,9783,9819, +9813,9815,9820,9811,9828,9842,9846,9844,9839,9841, +9869,9855,9856,9854,9875,9857,9853,9352,9902,9908, +9881,9859,9906,9914,9933,9926,9915,9929,9959,9952, +9979,9977,9953,9951,9988,9957,9996,10012,10009,10027, +10044,10067,10078,10079,10051,10028,10063,10046,10030,10052, +10035,10112,10116,10115,10119,10128,10140,10130,10138,10126, +10121,10145,10125,10173,10187,10205,10218,10207,10217,10226, +2662,17943,2667,21594,16297,6710,6295,6153,12393,9746, +13485,1012,9982,12173,13135,1014,6816,17952,3550,9339, +5432,5435,5433,3833,13915,4377,4084,15836,12265,2599, +13519,7246,8295,2780,10600,7071,20259,10291,7001,9365, +6915,19450,6509,18906,13195,20018,3371,6243,20837,20838, +20683,2383,20745,19505,16215,15770,4385,18207,15813,14106, +6050,14504,9936,7994,1424,3660,5851,16572,17907,12484, +3072,3908,3909,15864,8264,3083,8956,9739,9740,16624, +9016,9747,9752,3087,14478,15045,15843,9023,11795,20859, +3393,11837,13142,7531,15844,15846,10219,10258,10260,10257, +10280,10273,10300,10306,10310,10308,10323,10321,10335,10322, +10327,10369,10365,10366,10372,10466,10422,10316,10425,10401, +10411,10444,10415,10398,10394,10434,10474,10486,10496,10488, +10491,10505,10497,10499,10515,10519,10513,10516,10419,10517, +10531,10532,10530,10536,10557,10558,10561,10562,10571,10579, +10574,10573,10576,10577,10601,10612,10620,10608,10613,10616, +10617,10618,10640,10658,10650,10653,10651,10671,10675,10684, +10685,10686,10682,10701,10714,10712,10715,10718,10728,10729, +10725,10730,10749,10746,10743,10761,10780,10768,10775,10776, +10247,20545,14996,15128,20554,18888,13372,8740,2045,5245, +3614,6572,2617,13750,13891,19917,2099,5919,4674,12129, +12074,19459,13652,16591,12673,12291,16831,16832,8742,3830, +1446,1080,1817,13469,15722,21544,4607,20803,11696,12180, +21570,4824,17192,11442,13437,8674,2623,18443,12075,2557, +17745,4380,6188,21571,5709,2511,15796,3195,10900,17524, +17525,10731,17526,11815,16604,16594,17764,8053,19506,6181, +9931,14184,15876,10904,2955,14444,7274,15592,8343,7054, +17763,17666,16126,2515,16070,4003,11606,12332,5512,9461, +20509,15201,7750,9833,14872,1621,10770,10795,10803,10799, +10994,10793,10817,10825,10833,10840,10827,10828,10856,10849, +10864,10865,10872,10881,10867,10890,10896,10895,10902,10922, +10926,10916,10894,10899,10907,10945,10936,10938,10954,10959, +10951,10958,10971,10983,10990,11001,11036,11021,11005,11037, +11034,11046,11045,11096,11064,11072,11067,11057,11060,11055, +11085,11116,11112,11111,11132,11117,11121,11149,11145,11147, +11170,11162,11166,11168,11175,11181,11188,11190,11191,11204, +11198,11200,11207,11206,11221,11217,11234,11268,11264,11274, +11273,11272,11292,11311,11293,11300,11291,11318,11321,11325, +10590,12368,5874,13561,2924,3428,11628,11514,13764,14445, +2985,8199,3969,12308,5846,16664,10919,13921,4173,2657, +10615,11988,3696,936,11611,14847,20069,21063,13843,16001, +16461,7672,7255,4099,1482,2292,12954,16218,14714,15495, +15134,21382,19001,9862,7072,12312,17540,10502,11977,2297, +10437,5853,12078,2853,7577,4844,21310,10438,7630,19353, +10480,18031,2077,15932,11710,9878,3209,5729,17440,15598, +4497,20857,7633,6344,3208,18724,17336,15189,4716,21295, +3409,8880,11880,8459,2848,8361,9129,9777,16103,12737, +3213,1720,18067,11618,16669,20188,11331,11346,11332,11333, +11339,11336,11349,11352,11355,11376,11391,11401,11364,11386, +11385,11366,11420,11413,11428,11437,11435,11434,11436,11429, +11467,11475,11468,11464,11474,11450,11452,11472,11458,11479, +11485,11491,11621,11501,11494,11499,11497,11521,11518,11519, +11531,11529,11544,11539,11549,11568,11584,11604,11602,11613, +11615,11625,11627,11493,11635,11636,11642,11665,11648,11646, +11643,11674,11673,11698,11707,11697,11705,18231,11712,11713, +11729,11728,11724,11737,11741,11744,11747,11758,11760,11769, +11799,11771,11786,11787,11768,11817,11823,11822,11830,11819, +17312,1642,17733,9056,9132,18239,10351,6921,20098,10644, +13496,20189,10549,11670,20099,12859,16654,5696,9980,5693, +7647,7162,5193,2761,11152,11790,5278,7488,3845,20816, +17766,15359,17271,2100,13616,19682,17688,8265,8163,17671, +14339,8136,15389,14673,15458,12611,12612,5631,6496,15763, +17100,3507,4484,12000,15378,4486,2866,10331,10066,17090, +13319,12084,8849,4922,20217,4778,9497,19616,9287,15880, +1846,11740,8205,6638,21595,1602,11477,3857,3983,1216, +2110,19035,2015,10292,3355,18032,18632,3577,3462,13039, +10387,18874,7091,7532,6916,12748,11821,11845,11851,11855, +11861,11858,11870,11869,11866,11886,11901,11908,11912,11915, +11928,11924,11923,11936,11954,11958,11942,11961,11968,11971, +11969,11992,11986,11987,11994,12001,11999,12004,12011,12012, +12007,12014,12017,12020,12016,12027,12026,12034,12033,12037, +12045,12061,12062,12055,12059,12071,12081,12083,12094,12098, +12099,12103,12102,12107,12110,12117,12119,12127,12131,12137, +12141,12139,12135,12155,12148,12147,12163,12168,12181,12177, +12183,12215,12199,12209,12200,12207,12217,12218,12192,12210, +12231,12237,12250,12257,12284,12247,12252,12272,12306,12292, +10389,10356,2216,14861,7370,12455,18412,18428,2040,9374, +15833,15771,7605,12191,18896,2097,11144,5094,19700,6408, +21561,6750,15167,20902,16093,16427,12791,16560,13721,4862, +21245,6445,8403,7133,1021,2773,10862,13776,5996,19136, +19498,18907,13139,12331,3672,3616,9596,19429,1304,18852, +21250,11677,1813,1741,17779,18597,17144,6232,20347,3923, +3823,11765,6327,10897,14463,5565,1441,16492,4875,21479, +20882,7144,3063,11749,18017,5271,9604,13789,2155,2410, +19710,6011,21562,9922,16714,4185,5705,3048,5444,5677, +7613,19579,21484,4438,10819,21073,12299,12307,12294,12285, +12327,12333,12350,12341,12355,12363,12360,12358,12381,12389, +12387,12399,12408,12416,12419,12425,12435,12431,12443,12449, +12450,12462,12464,12477,12458,12460,12473,12459,12466,12500, +12502,12505,12511,12533,12539,12526,12535,12540,12558,12566, +12555,12575,12578,12576,12580,12594,12592,12593,12597,12595, +12601,12614,12613,12636,12638,12624,12630,12619,12615,12623, +12646,12621,12618,12667,12701,12668,12670,12692,12686,12680, +12660,12715,12672,12659,12698,12769,12760,12756,12758,12762, +12797,12798,12818,12783,12787,12788,12789,12793,12784,12827, +12856,21200,6536,4825,5058,3284,2878,7976,4378,968, +13088,2594,12471,7879,9345,14805,21343,3285,2056,19580, +4074,16436,9481,3997,4829,13730,19146,1918,20042,15173, +2506,2413,16715,1674,16851,5353,21264,11375,21346,21756, +16122,13385,15256,2414,12196,11000,17725,7978,2370,8495, +18259,3253,5960,3254,7272,16315,19468,11863,14289,17284, +16601,7783,11548,11461,16026,11637,10818,3050,3686,13470, +3933,21644,9108,10409,16499,11773,9037,12577,20115,5211, +5860,10588,2722,2921,20453,10978,9487,1266,13237,8359, +13196,3656,7740,7900,13092,15355,12836,12837,12862,12848, +12860,12867,12842,12851,12878,12843,12873,12919,12937,12917, +12918,12912,12932,12952,12947,12957,12970,12972,12962,12979, +12995,12990,13004,12991,13026,13028,13025,13041,13074,13067, +13065,13056,13090,13107,13086,13087,13115,13132,13130,13126, +13122,13119,13124,13138,13141,13143,13146,13148,13174,13173, +13172,13194,13199,13204,13190,13210,13201,13228,13235,13245, +13247,13246,13248,13249,13255,13278,13271,13273,13268,13282, +13283,13290,13318,13308,13341,13336,13338,13392,13373,13366, +13381,13375,13446,13421,13440,13422,13441,13431,13429,13474, +5334,6458,13177,930,16324,1376,21125,7336,9992,15438, +15726,3538,6394,6103,2934,2290,6538,4632,9157,14149, +18315,18805,14308,7160,5611,2063,20684,16182,8116,1459, +18961,11002,1282,12123,3902,13346,8682,17383,16296,19673, +19674,5009,9792,17934,11560,2068,16638,2969,17424,1551, +11465,933,19297,9085,9086,7545,11176,21759,21780,21665, +13841,16985,18688,934,13477,7342,4917,10520,7343,12170, +6251,6252,6289,18386,15977,21503,13274,11098,6626,14391, +5082,21146,7489,16452,1832,16358,7163,4095,18621,15175, +13562,20639,6838,14528,9194,21585,13504,13506,13511,13522, +13514,13533,13585,13540,13575,13544,13539,13554,13547,13588, +13597,13596,13605,13604,13607,13608,13623,13625,13615,13613, +13644,13646,13658,13662,13665,13668,13680,13686,13687,13685, +13690,13695,13702,13707,13710,13711,13716,13715,13713,13726, +13752,13742,13738,13736,13746,13745,13772,13773,13778,13784, +13790,13807,13791,13818,13810,13806,13792,13788,13829,13839, +13836,13857,13864,13885,13873,13877,13861,13893,13892,13890, +13895,13906,13914,13912,13933,13944,13943,13951,13952,13960, +13962,13978,13979,13988,14002,14005,14000,14009,14014,14017, +18534,19838,10913,19989,14810,21325,5613,13671,18005,9007, +16453,19509,15066,19116,14532,2959,14582,19991,20647,13870, +9643,13606,19888,9644,8261,16887,2776,17846,16002,10135, +6899,3741,12977,21666,12537,3242,19840,2781,19754,12041, +12579,11511,16956,4681,20025,13969,2013,11061,15236,11305, +15067,10136,16957,5477,9280,5086,3259,15488,10639,17938, +18608,5778,21618,5801,21781,15779,2071,12157,9197,14395, +9301,10074,3811,15780,10858,15891,21207,938,9729,3073, +12485,13348,7910,2962,7809,16408,16057,2033,19774,19002, +8233,1484,10376,1924,20480,9391,14025,14027,14041,14043, +14050,14054,14056,14066,14068,14085,14074,14077,14107,14111, +14127,14120,14115,14119,14116,14117,14142,14147,14152,14158, +14162,14180,14218,14170,14164,14168,14194,14175,14205,14206, +14234,14240,14237,14224,14216,14220,14232,14259,14253,14255, +14274,14273,14278,14281,14270,14287,14286,14292,14288,14304, +14303,14309,14310,14315,14313,14314,14321,14323,14332,14329, +14334,14346,14350,14341,14348,14342,14338,14337,14385,14363, +14369,14366,14367,14387,14381,14372,14407,14414,14415,14422, +14438,14435,14447,14442,14458,14455,14476,14465,14454,14483, +13031,10779,18277,10081,7164,1625,5805,5945,3629,10433, +14354,14263,3630,18056,1883,3704,3243,14398,17996,6368, +1007,11100,10284,21045,12513,7573,11131,3074,11754,6781, +8384,19162,14195,19117,5852,2425,6430,14131,8810,12981, +10678,2020,20249,9510,16471,7078,12934,14507,11011,11991, +2237,3742,13934,9423,19626,13101,2787,6466,7361,10722, +20029,1229,19487,10446,13697,4337,15652,4616,8449,4638, +13872,4686,9017,14891,18182,17835,5022,3490,16722,3946, +14956,17441,17048,10224,20074,14298,7362,15239,10086,19783, +17104,15010,11878,17946,20077,19775,14490,14498,14499,14468, +14494,14512,14511,14522,14520,14527,14516,14510,14514,14552, +14556,14568,14559,14555,14572,14571,14562,14561,14595,14596, +14599,14604,14601,14600,14618,14616,14609,14612,14639,14623, +14635,14675,14649,14625,14636,14662,14679,14642,14614,14624, +14660,14630,14610,14615,14634,14632,14628,14629,14698,14699, +14703,14701,14705,14710,14709,14706,14716,14708,14756,14728, +14738,14735,14724,14751,14726,14746,14739,14745,14722,14768, +14767,14770,14782,14774,14783,14776,14779,14775,14777,21229, +14795,14799,14803,14797,14796,14804,14818,14807,14814,14819, +16964,6058,909,6797,6798,7192,3030,17333,16299,11222, +9468,7554,1995,14400,13035,9748,8691,19900,3297,15698, +15469,20407,15240,17163,4498,3892,17607,5532,14781,7514, +6015,13994,18059,18628,1134,4134,12438,16476,11835,2741, +10716,12400,12823,20205,2432,20662,4408,11689,19315,3110, +17446,12733,4447,7437,17912,8982,1579,3818,11138,9207, +7960,13331,13166,17249,17222,15151,10482,19052,17914,17561, +19053,9116,9429,7726,3636,20898,1292,18633,11403,6601, +1639,15087,15426,16058,13334,13109,16528,10160,6806,11980, +5224,20082,1256,9681,14785,21189,14806,14831,14833,14836, +14835,14837,14838,14845,14843,14851,14848,14864,14871,14875, +14885,14883,14886,14895,14888,14889,14897,14906,14903,14902, +14933,14952,14949,14928,14924,14922,14921,14968,15004,14974, +15003,14971,14976,14977,14986,14969,15017,15039,15036,15051, +15050,15048,15047,15049,15063,15072,15084,14911,15090,15092, +15101,15110,15111,15118,15131,15123,15126,15112,15104,15106, +15159,15164,15165,15168,15183,15184,15182,15192,15207,15194, +15218,15202,15208,15196,15229,15242,15243,15264,15260,15254, +15266,15276,15275,15279,15273,15299,15292,15293,7828,15306, +887,10021,17953,13243,9184,16186,16814,13937,13938,12741, +10347,15097,16067,10816,20085,12498,19692,18069,7214,8082, +17954,13359,15098,8104,4796,1882,13678,19066,17261,19804, +8245,9781,9782,19199,13040,19269,10233,15964,6453,19979, +10101,18587,10931,5991,8962,9220,7219,3498,10789,9458, +9403,6497,4764,20827,16533,8987,6510,9535,7221,9435, +6515,10628,7015,8988,10471,7393,14013,15618,9409,13595, +17464,19080,10552,10982,1669,14930,17409,2832,6335,17814, +3236,4911,17821,10373,6396,6051,7623,8309,1275,18279, +20462,20463,8958,1703,17054,14830,15308,15313,15333,15328, +15345,15352,15351,15347,15376,15379,15368,15373,15372,15384, +15391,15385,15395,15392,15400,15423,15410,15416,15412,15403, +15435,15439,15436,15457,15451,15448,15449,15462,15484,15486, +15479,15482,15499,15478,15502,15516,15521,15518,15532,15530, +15539,15537,15546,15538,15569,15563,15562,15567,15564,15584, +15585,15590,15613,15603,15600,15604,15624,15623,15626,15625, +15638,15654,15656,15634,15670,15691,15699,15686,15682,15678, +15677,15707,15710,15729,15715,15725,15718,15754,15750,15768, +15772,15775,15801,15807,15811,15816,15827,15830,15834,15838, +3778,13376,2463,14515,8411,20571,14331,19550,5921,21548, +17360,4547,4307,1066,2626,12865,16565,19957,19958,8496, +12681,15908,12682,19868,8416,6728,13197,12683,21076,11462, +16316,4677,4678,6004,4995,13655,12112,11657,3341,12478, +2600,8296,9628,5003,20338,5436,12302,1873,17198,3783, +1675,1749,20396,15817,5514,19293,5280,3052,6732,10813, +5010,9932,18747,17203,9635,18976,12486,7793,14333,18809, +16328,11381,13157,5759,13321,9350,17684,7861,13404,7279, +16078,2372,1328,5971,17965,20714,4970,17246,9288,1485, +19841,19511,7801,3429,3762,6733,15832,15849,15853,15850, +15851,15871,15878,15888,15904,15917,15933,15895,15911,15897, +15912,15938,15937,15939,15936,15944,15947,15954,15953,15965, +15966,15968,15970,15983,15987,15992,15990,15993,16017,16019, +16025,16030,16034,16056,16059,16071,16079,16080,16075,16082, +16091,16102,16117,16109,16127,16146,16134,16132,16141,16172, +16168,16179,16181,16193,16190,16201,16194,16191,16208,16214, +16222,16226,16238,16229,16234,16251,16255,16242,16256,16247, +16282,16264,16265,16280,16270,16261,16269,16289,16295,16308, +16312,16309,16321,16317,16319,16339,16341,16337,16336,16344, +15031,8206,12721,19766,8531,14946,10593,9653,3855,15573, +9048,5937,5976,1213,4604,16466,4144,19845,15291,12955, +13945,11661,16467,9836,3935,4334,1166,3705,16331,1979, +11099,2187,9125,7067,15865,10883,17836,11153,7755,14586, +17944,18335,13845,16367,5023,19894,10968,16513,13925,17546, +17071,19245,14540,2700,15468,21180,21596,15653,19895,11012, +9128,4032,13352,16963,16644,19994,13510,19307,7550,1150, +14959,3054,16917,16613,9749,1151,13819,7086,16697,17798, +5984,18827,1395,6467,18871,4079,11536,6126,6377,6736, +10693,19037,16577,19311,15609,21047,16374,16360,16343,16379, +16384,16391,16381,16393,16395,16378,16406,16396,16428,16444, +16429,16423,16424,16425,16426,16489,16507,16491,16493,16494, +16501,16527,16490,16503,16500,16497,16508,16488,16548,16541, +16566,16557,16563,16559,16586,16595,16592,16598,16611,16610, +16625,16630,16642,16632,16640,16646,16665,16653,16659,16651, +16681,16679,16685,16672,16677,16684,16682,16701,16707,16711, +16705,16704,16702,16741,16729,16746,16731,16757,16733,16743, +16734,16772,16803,16791,16781,16770,16771,16787,16784,16827, +16893,16828,16821,16863,16829,16869,16899,16823,16888,16849, +2016,15014,12728,15788,14266,3713,10452,16524,21009,2430, +13482,12319,19639,7522,10293,13231,19198,7557,16580,17447, +10786,20593,20616,10681,5837,10155,3088,9519,10765,17448, +2301,11404,21711,14961,13356,15597,20860,12222,7692,13486, +1678,9887,5764,17002,7120,21314,4605,9334,8461,8462, +19172,2201,7640,11595,17454,11427,2701,18108,14962,2795, +2487,3463,9570,14243,18875,8029,3301,12826,3033,17369, +14355,13219,19325,2160,9673,20280,17955,21209,20264,17510, +10823,17619,12749,13828,7451,6032,21471,7826,1709,6073, +4508,9434,7825,9138,11289,9690,16875,16844,16824,16853, +16904,16817,16854,16891,16859,16884,16820,16873,16966,16952, +16950,16948,16954,16983,16982,16979,17013,17034,17011,17018, +17070,17063,17073,17110,17101,17096,17077,17074,17080,17117, +17123,17121,17118,17149,17153,17135,17132,17158,17137,17188, +17187,17199,17197,17184,17191,17186,17206,17232,17233,17269, +17293,17266,17296,17288,17292,17274,17285,17272,17270,17320, +17323,17343,17321,17334,17337,17328,17318,17354,17352,17349, +17364,17359,17357,17379,17378,17389,17385,17376,17381,17417, +17420,17438,17399,17487,17451,17425,17407,17404,17468,17472, +13417,11808,10357,4082,17461,21194,10248,9537,10249,12092, +18646,12326,11569,5540,19277,14790,16944,1981,13498,13584, +1982,10757,7827,21219,21423,6608,11919,12132,21082,10733, +4420,8555,11230,17060,8615,19923,13471,10069,17989,14811, +15915,10270,17207,6374,16514,3546,2689,16519,3548,21401, +5121,19572,18781,4826,4655,7774,21038,3400,18935,21074, +7852,20805,17527,13653,20806,8492,2158,6687,13654,16145, +10111,1267,18618,21778,1452,14317,8297,6140,18019,20681, +18801,12013,1783,3598,4996,5798,20934,20950,13656,18947, +16123,11503,5416,17985,20575,13438,17471,17481,17489,17482, +17492,17491,17488,17507,17506,17508,17509,17547,17512,17522, +17536,17514,17529,17516,17530,17558,17579,17569,17618,17603, +17564,17565,17590,17575,17650,17631,17642,17635,17632,17643, +17630,17627,17664,17667,17676,17683,17680,17679,17674,17696, +17704,17699,17698,17697,17717,17721,17719,17722,17720,17735, +17734,17746,17737,17741,17749,17750,17755,17757,17762,17780, +17895,17790,17784,17788,17787,17831,17804,17828,17815,17826, +17811,17845,17847,17899,17887,17870,17863,17865,17879,17871, +17893,17890,17885,17886,17919,17927,17922,17962,17963,17959, +19727,11058,1784,1792,2631,2627,8838,13762,7590,7479, +11380,7789,4382,13866,21172,5713,19103,8550,17710,14105, +9038,11753,14813,7252,9069,9562,8344,14392,5282,20685, +10131,7169,18993,1899,21350,14884,13647,9559,17794,2168, +9042,15571,19930,10075,2632,2271,2730,9834,12142,4589, +5802,18331,4030,20981,12777,12710,5863,8753,12640,15694, +14674,4932,2698,17595,3856,9049,4088,17795,17796,19931, +5019,19623,16055,18333,6706,12115,3383,20048,15303,5422, +6502,13814,19932,11535,8102,2129,1152,14046,11756,19251, +7865,6505,8844,9741,9511,14542,17973,17977,17984,17983, +18006,18007,18014,18010,18029,18036,18049,18054,18093,18077, +18080,18075,18078,18076,18123,18116,18113,18114,18122,18117, +18138,18141,18142,18144,18139,18137,18157,18154,18162,18165, +18170,18166,18180,18176,18185,18188,18221,18212,18223,18215, +18220,18261,18245,18258,18271,18250,18243,18248,18278,18266, +18253,18252,18305,18313,18314,18310,18332,18371,18380,18401, +18360,18367,18387,18368,18366,18382,18369,18377,18373,18442, +18437,18446,18445,18457,18452,18459,18462,18453,18468,18455, +18501,18494,18502,18499,18520,18524,18538,18536,18529,18570, +10506,19038,3822,17611,17167,16525,1658,2035,7193,14109, +1232,1508,4944,7438,21333,7439,3211,7088,3391,20105, +4500,1857,17390,18107,1677,13699,10764,9208,1027,20261, +5789,2047,15221,11882,2172,9779,3460,14786,15447,1533, +9212,4947,20899,15340,14788,16219,14691,1122,17552,1870, +2459,9186,10244,16974,17178,9224,20600,3361,8271,20168, +14549,7456,19077,9231,18187,16822,4781,5011,4798,1103, +6132,7017,7022,7460,5609,1594,18372,5714,8423,12377, +10870,11119,11120,11218,14652,15002,2167,20686,8433,11125, +15805,9733,18624,20982,8505,16960,18562,18540,18565,18550, +18555,18544,18598,18603,18616,18617,18636,18642,18644,18648, +18647,18662,18660,18657,18669,18682,18666,18667,18668,18687, +18671,18683,18726,18744,18733,18745,18743,18736,18731,18732, +18818,18770,18812,18804,18767,18800,18820,18774,18777,18785, +18835,18864,18855,18857,18844,18843,18850,18845,18885,18903, +18917,18909,18893,18881,18902,19048,18966,18991,18933,18891, +18992,18984,19009,18884,18880,18946,18985,18923,18889,18948, +18908,18894,19047,18960,18922,19093,19094,19086,19098,19095, +19088,19091,19134,19155,19153,19150,19181,19178,19179,19183, +14214,16368,17049,15756,19635,9245,4344,4065,13183,12095, +7200,11312,19316,5459,13526,20464,7963,5618,3578,7529, +10622,13527,7380,16418,8470,13529,10625,9250,14433,3639, +5623,18362,15751,13378,7881,3124,20951,2363,7048,3430, +3657,6484,13566,5287,14667,5760,7833,6860,13407,17685, +11662,6980,10439,20326,1518,17692,14267,5390,21014,18026, +2850,16932,18840,10470,8475,16942,18422,16946,18249,3899, +4992,13379,13380,7705,7145,4524,18124,3804,6274,2102, +15586,17812,7784,3418,13759,18125,19147,14221,12802,16124, +7150,18126,19163,4262,4659,18203,19203,19221,19247,19227, +19261,19219,19243,19289,19290,19291,19288,19305,19284,19318, +19286,19340,19338,19351,19349,19357,19361,19360,19382,19362, +19364,19368,19423,19421,19399,19401,19409,19397,19410,19403, +19428,19438,19432,19439,19433,19452,19453,19456,19472,19455, +19458,19477,19499,19495,19494,19518,19520,19539,19532,19517, +19519,19545,19552,19557,19570,19612,19617,19610,19622,19562, +19574,19608,19573,19600,19554,19588,19592,19559,19583,19658, +19653,19656,19662,19655,19663,19657,19694,19720,19699,19705, +19696,19745,19733,19712,19737,19749,19724,19708,19704,19756, +18532,15052,14424,19154,17640,8425,17469,11624,2418,19475, +20893,17747,4572,17668,2333,14345,18264,13980,21407,17855, +18962,18963,15119,2565,6071,14393,6108,17894,20687,21273, +20781,5448,21556,20399,5519,5012,7420,3846,10071,3658, +18522,11590,12064,21147,5145,18977,8302,18622,20367,16149, +18810,13508,20549,12487,1471,17752,13445,1083,3292,21689, +15541,21232,3015,20584,19416,17858,18095,18994,6666,6112, +14668,2126,17496,14534,6175,2144,5452,5761,13567,6776, +7802,6485,5065,17355,16365,14396,2731,3971,11062,11320, +4332,6703,18275,17748,5595,4422,19714,19735,19744,19717, +19776,19695,19830,19834,19826,19854,19861,19869,19864,19873, +19891,19858,19857,19866,19886,19884,19876,19912,19919,19929, +19920,19921,19935,19937,19966,19964,19954,19950,19965,19943, +19956,19961,20017,19999,20014,20001,20041,20035,20055,20075, +20061,20059,20071,20054,20088,20101,20100,20113,20112,20110, +20120,20121,20124,20125,20137,20144,20149,20152,20173,20184, +20186,20191,20192,20195,20206,20198,20197,20203,20200,20224, +20218,20212,20209,20207,20220,20234,20231,20228,20233,20277, +20283,20292,20293,20289,20307,20332,20317,20319,20333,20335, +1772,15798,18815,9421,21176,8906,8850,16693,7179,20983, +13770,3136,9303,4270,8914,16896,15881,3432,1331,2188, +19541,8764,13127,13181,14834,939,19683,17499,2529,7864, +17300,16695,16806,5238,15054,1890,6782,8062,14899,20716, +14900,4031,6451,2326,14873,7813,8736,13451,3106,17470, +15212,16332,17215,4617,2573,15327,19014,11487,19164,3814, +12335,21456,2238,2400,21400,7185,12650,15417,21387,16472, +8207,13287,3947,20783,20252,21650,12887,21457,9849,7506, +2843,17126,10604,14426,1657,6492,12372,19628,3860,17838, +12380,14682,17947,14683,6861,6493,20339,20337,20348,20362, +20370,20311,20356,20363,20358,20379,20376,20382,20384,20386, +20389,20412,20392,20401,20395,20391,20427,20424,20436,20428, +20426,20466,20448,20445,20447,20450,20455,20452,20483,20471, +20475,20477,20468,20494,20492,20504,20500,20503,20506,20501, +20505,20517,20511,20523,20524,20534,20535,20543,20550,20551, +20538,20553,20537,20564,20566,20572,20583,20592,20602,20603, +20613,20607,20609,20622,20642,20629,20645,20630,20661,20618, +20619,20620,20672,20679,20670,20720,20705,20719,20699,20752, +20733,20744,20729,20735,20726,20730,20771,20765,20772,20778, +4345,21083,3711,17548,4939,12605,15866,7515,12780,19784, +21521,21313,16998,6799,19124,943,17217,11555,2431,4783, +21183,18484,18402,6643,17948,5296,11950,12652,11422,18708, +16520,17689,15611,21114,14239,12516,9020,6669,6908,5264, +19317,11063,17479,11139,17001,13038,2402,18046,15658,15152, +1217,2613,12890,14688,7578,19902,17612,17449,15554,18582, +18583,20824,19643,1640,3116,9520,11341,11342,14268,20595, +11324,7446,20262,21692,9755,10294,1998,11981,5817,16967, +21466,1013,1044,7915,20596,18837,6345,7603,10787,2353, +5988,6469,2245,17839,20302,14103,20777,20779,20776,20774, +20790,20794,20787,20791,20821,20795,20797,20811,20789,20786, +20796,20842,20833,20843,20844,20830,20836,20831,20872,20885, +20866,20894,20867,20870,20878,20903,20928,20940,20901,20933, +20970,20911,20917,20907,20958,20932,20968,20914,20913,20944, +20959,20912,20947,21025,21037,21032,21039,21041,21035,21056, +21055,21075,21067,21068,21085,21088,21084,21090,21086,21104, +21119,21122,21123,21133,21143,21134,21138,21154,21168,21166, +21175,21159,21170,21169,21162,21203,21195,21201,21231,21224, +21236,21233,21222,21269,21255,21243,21270,21251,21277,21272, +16933,20329,4138,20785,11597,9213,4278,19356,8464,7003, +21751,7695,1881,6817,21335,11347,20285,20345,14592,13110, +15428,20286,12608,14488,17956,20222,15431,3468,15227,17175, +7006,7730,9760,11892,18763,888,20415,6740,6819,19067, +19068,14244,13692,11900,12960,4140,15338,6438,21117,6033, +920,19273,7386,19805,7455,6826,4047,20599,17958,20165, +9436,14434,16535,2250,9702,18841,1611,20601,18423,4355, +2748,16537,2749,18639,2217,13693,19202,9229,2460,17556, +11810,6528,20169,19082,3473,20422,18433,4056,16108,13741, +17739,17751,1434,21092,14421,17816,21242,21249,21259,21253, +21293,21298,21299,21301,21304,21317,21329,21328,21330,21345, +21340,21349,21339,21362,21354,21356,21367,21368,21365,21385, +21373,21376,21399,21402,21413,21410,21409,21414,21446,21430, +21437,21438,21442,21427,21432,21480,21481,21489,21483,21501, +21491,21478,21553,21476,21536,21554,21537,21560,21567,21559, +21603,21582,21598,21574,21576,21610,21626,21638,21658,21660, +21661,21663,21668,21669,21673,21687,21681,21682,21683,21704, +21700,21714,21729,21723,21725,21737,21739,21754,21763,21764, +21773,21779,21766,21767,21777,23849,23850,23851,23852,23853, +12866,6246,17064,7055,6257,5909,6213,16924,16925,9888, +5946,4048,10251,12768,9563,3570,1394,14823,17309,4758, +21018,21024,18434,18435,2824,6691,16095,18964,18965,7337, +1068,6313,4323,2777,7355,8746,5066,8310,4842,16897, +1695,21184,7260,4692,16926,1858,16549,6554,3637,21600, +4696,19059,971,12303,11506,12266,5437,11508,19538,11382, +15005,6546,8747,6113,975,9506,11663,1425,19689,7261, +16033,10826,16927,19049,8332,2769,15429,6527,8484,1299, +20624,19863,4993,1942,5406,15591,18949,6006,16258,12432, +6893,4529,15390,5645,20242,20952,2817,6927,16768,5073, +11736,13984,12244,5322,2492,5276,11580,4342,5794,19576, +12420,1404,16107,18527,18539,20788,3641,17661,19206,8968, +19762,5197,15583,21221,7034,11534,11212,6933,12658,11087, +1806,14078,5526,20268,14336,3250,18312,8430,14942,18704, +18403,4538,12518,5745,8999,1571,20253,5586,19497,3501, +18883,16585,8008,8816,5766,8560,9118,6945,14219,16230, +8859,12385,8436,13064,6865,19019,8074,16322,13714,3874, +20491,9367,13976,18886,11451,13739,19654,12329,18155,16209, +16732,2260,2002,8640,21240,11843,8547,19434,18898,5413, +4419,21274,14659,1472,21509,4421,5776,12379,1572,10720, +3345,14502,8935,4634,15814,18811,2603,10873,6145,1346, +10424,10014,6777,5067,12371,21510,7298,17900,20278,7673, +5068,20174,7493,19246,18132,20717,14326,1696,1697,13408, +14327,2886,20176,21108,9174,20151,3055,2401,14275,15757, +12143,5343,17216,10735,7507,15213,5025,15461,3107,3108, +20993,6981,20515,4066,7955,11260,2972,20078,1255,20119, +9176,4795,2024,6998,14509,913,21334,5030,5460,14011, +20263,9889,19054,1135,2443,16301,21011,21392,1643,19998, +20308,3448,20159,18413,12589,14245,15896,16133,11672,5039, +7035,4415,19521,8851,8599,21161,18910,15765,2149,7649, +11867,11414,2717,18306,9599,13377,9551,19660,12452,19402, +14988,4787,12968,13961,12015,21412,14732,10637,16631,1416, +15680,5610,8774,8291,4710,18311,17528,7151,16346,21611, +10274,15519,1688,11938,2655,16889,8018,7496,7621,8158, +15919,17940,3386,15894,16104,14330,12852,21684,19976,3150, +3615,16818,18128,6267,5855,2242,8986,1219,12574,6206, +4899,4855,15103,14979,15952,18304,1819,5795,10869,17583, +10535,12546,1751,19308,10643,9399,1725,6406,9916,17230, +16303,19330,7964,5409,17225,20177,1540,4049,14772,18420, +18421,18003,10272,5151,20179,19855,1473,21105,4791,19995, +16865,15916,17039,2473,2482,17106,15507,21657,9606,14222, +13314,13224,17240,21495,8426,13225,2601,3002,2450,3847, +3604,17033,20400,8434,7068,2605,2783,5572,18045,15806, +4217,5130,15267,3137,16961,20555,15137,19192,8235,7508, +13630,2989,3187,10440,3491,13354,21522,15655,13456,2671, +6649,13111,13082,7727,20223,15706,4410,20148,16687,8677, +8427,2436,4549,19963,1099,12694,16183,18978,7490,10072, +10961,8825,3041,12830,21275,8201,15023,11106,21057,11297, +18241,7764,6273,14215,11967,8274,11620,5499,6066,3643, +20539,13427,18775,8898,9416,5588,7775,6680,14374,5440, +13542,20775,6851,17850,13120,5229,8911,16836,21640,21436, +16437,19585,14420,2226,15198,2419,7480,18044,18684,4314, +19728,17926,931,3687,21494,12378,11328,3466,15120,14658, +11122,20585,7428,20284,13097,8439,18397,20403,2457,7759, +7896,4977,16773,12844,8007,1155,3748,21768,1283,17700, +5054,20925,11767,21642,2919,12298,16349,6615,16445,16965, +5914,13307,8919,10791,16678,4540,1736,12249,1300,18670, +15815,12038,8306,11659,18816,7170,4238,4239,21177,13568, +21300,17356,2658,1383,20971,7280,1954,3294,8234,14753, +16008,2839,8063,11780,17432,1925,3222,11449,14754,7677, +13066,11051,7509,12727,16645,16473,7814,7080,11784,8208, +11785,10594,10441,9467,16286,13573,21677,13164,12651,3140, +21597,12238,20757,19636,4180,2973,19426,3712,20353,2442, +16156,15504,4940,21678,11951,2132,16073,13018,20441,3724, +15659,7089,10195,20156,1524,2692,10456,9890,15471,3358, +15153,17003,8997,7204,20861,13020,20862,12050,21601,9754, +20193,11733,16068,8242,17171,21052,3644,15349,7267,20915, +21163,8867,17019,6532,20057,9608,19333,5230,16837,4889, +12297,15404,18316,8375,18228,19160,20473,12514,14229,21651, +10098,4761,2771,6571,10724,13465,14311,6077,5306,11033, +17880,17541,15080,17610,8469,19177,12946,3475,2320,14919, +1581,1352,13396,1354,4301,4435,14769,6984,19377,6154, +16380,16673,5241,20698,8920,12330,18769,9587,12661,1156, +5100,10259,3749,10324,2379,3647,16136,11644,11456,988, +18194,3825,3951,8561,14177,14271,11601,5055,19138,2508, +14573,5820,18050,9924,19922,20840,957,18953,12300,11739, +1801,3148,8466,10022,15304,13083,13084,9852,4156,5634, +3303,1537,1538,8334,13137,4160,2746,7010,16767,19983, +11734,20864,9699,21021,2801,4107,16536,10252,10024,17179, +16538,9230,13682,17623,11811,15339,13500,7098,3155,21696, +17008,8990,8485,10025,3375,4660,15672,4218,5385,9291, +13735,10641,883,6982,8236,8781,8782,18338,10948,8634, +13458,10295,9366,4222,20863,18414,15674,3551,19279,19817, +2366,20336,5752,8493,19959,17665,3337,17924,4525,13760, +14185,8912,14742,16097,2420,3343,4315,11507,12695,10836, +13917,8913,12923,21319,6208,6336,12197,16027,14069,3338, +8822,3838,19108,9462,6312,5285,19881,10772,19369,9821, +2608,17651,12325,19076,2039,7604,11520,4068,12850,6939, +16246,17738,12761,17319,4861,18247,20009,4863,7132,9589, +4294,8280,12287,20879,13940,17268,2282,3060,13189,16779, +12965,12665,14172,1586,21246,8791,18851,11365,5102,12421, +10209,1077,11459,8179,13667,13281,2591,4874,10040,11748, +19204,10854,19285,13310,11243,14305,12967,18791,13694,1447, +3011,8255,15902,6725,21165,15852,13089,4888,13727,17723, +13546,6751,18086,11296,12799,7612,2679,7541,10652,19287, +13478,8936,3659,10073,3346,991,20688,4530,8907,18506, +12185,1322,5479,5480,12113,21276,13832,4324,1085,21120, +20895,18556,8683,18979,13256,14669,12488,4386,5401,8230, +7714,5684,10426,8572,13569,21106,20123,20972,14325,9848, +19768,14297,19485,6567,13641,20587,16285,4972,13260,21109, +11664,10082,20590,20459,9850,21518,6711,16333,2990,5869, +8609,18869,12216,12985,5808,11730,12493,5630,1333,10595, +12022,9825,13926,13847,7087,18485,17218,2876,3122,2944, +5297,19490,6215,14757,5028,21523,4941,16550,1360,20442, +19640,16551,8610,5492,20664,17108,12913,5324,7928,10719, +15231,6238,21141,8601,1401,14575,16633,19503,4260,10901, +19467,9620,15991,17148,4897,15172,19469,3621,17638,16267, +9275,19225,2953,7985,12693,16864,15028,7899,11532,12634, +1082,14741,2266,15812,19589,6539,1458,4910,16028,3424, +3201,18222,21664,3482,7335,16276,19292,5475,5965,12828, +4746,13765,17330,16359,2231,8568,12810,9006,16986,4322, +1246,12002,15858,10278,12028,17933,7251,20648,14533,13904, +11387,4361,1327,16621,6012,7066,9498,1212,7354,14910, +9309,19302,19755,15135,11007,3980,16990,9773,3135,10015, +19903,10457,7641,2351,21321,16529,6849,18033,20598,7728, +20465,1892,9355,4697,4470,9984,5302,14101,8613,6560, +18877,7093,21393,4392,19806,7533,6218,9405,12162,9700, +9703,10358,10026,3321,21095,9818,16546,3016,21726,1600, +9126,3025,18008,1182,1604,1607,1154,3034,1609,1610, +11872,11874,20695,2978,18729,13774,4513,14557,13897,2162, +5095,19546,18846,12617,20310,16338,16024,21396,3275,5997, +3276,4254,21031,2380,11694,2643,2409,21252,15559,16140, +13517,6726,3960,19533,11525,18793,7779,9923,18121,4168, +8089,19470,13386,3678,8045,18860,13479,8811,17917,9899, +6790,18134,8450,13932,21728,7079,11010,4493,12726,6265, +17608,6214,16370,19036,16626,15085,1517,6014,15365,13879, +18064,17254,5222,9523,6917,13488,6195,4506,11802,11079, +5393,18929,8916,9713,3265,18926,16840,20182,12111,19451, +9903,5049,5111,14700,10972,16036,2393,4955,1589,1022, +7776,7651,20091,18940,10605,8520,15760,18650,867,11504, +7110,5845,1116,8194,12545,9928,12921,5643,3841,20318, +18204,13238,19601,960,17932,1771,8970,19926,14747,4364, +2852,7346,14909,20431,11946,14044,10659,19239,20850,5974, +20610,16790,9719,15289,6729,5507,9158,1344,3256,8428, +1382,19476,21101,7935,19729,2984,15688,3289,19914,11945, +3485,15185,18326,2604,15643,14578,20640,19479,20066,4325, +5873,3293,16405,11551,18564,2762,18130,15319,3697,2606, +19915,15129,10690,5651,20481,14676,1935,2663,15138,4176, +3706,10285,2611,3230,13708,12888,17976,19777,18823,4338, +9873,14684,10736,6552,20408,15607,4409,1559,1562,9524, +19907,19493,10629,9573,15848,12757,14166,19560,13860,16260, +4814,8642,1684,17628,14411,19856,3214,6876,1191,8281, +1435,16210,8899,5703,14517,8818,20586,17542,10318,21750, +3151,5132,6598,12337,17718,21461,6868,21706,11576,18882, +15589,3326,14655,1895,2637,6931,8799,3502,9370,20309, +850,18528,4815,4950,18900,3314,9586,4292,1409,1123, +5818,13233,19180,20090,8543,17061,5581,10117,3920,11820, +4183,11582,19435,14925,8901,6943,14417,6681,3264,9910, +18784,17400,1442,2999,5673,6747,17758,18738,12025,8868, +4210,7137,11214,11052,20359,11868,5321,11412,10702,2555, +9320,5347,16709,20315,15274,20211,16839,21776,6946,4782, +20238,11943,11187,9954,21323,20528,15565,6332,3197,14146, +5053,6082,7036,6304,17702,16949,5718,11935,9289,18254, +2499,3995,10489,4958,16708,9272,7269,5346,1818,17024, +13518,17466,12627,13250,21096,21641,12465,9149,11651,19471, +1926,17322,8225,19380,13058,18742,10905,13963,1316,14743, +19672,20060,6311,8966,17325,17326,15059,15483,11301,16880, +13894,2835,21505,21647,18689,16691,17331,20019,13059,19367, +10874,2343,4840,9898,21306,6425,13062,10771,13063,17859, +3585,1529,18097,1502,20291,16409,20782,10882,9965,3384, +11013,18703,2046,8876,4755,11014,8939,9778,20154,2198, +19444,6999,18407,2206,20157,6522,19358,3419,1787,3901, +9268,9621,14832,2855,3837,3268,11550,9488,8969,7742, +19393,9001,8117,15060,19107,2652,7743,10276,8839,16639, +6762,13205,996,15121,4019,8730,11777,6072,2397,15262, +5284,855,11638,6020,3714,880,897,14908,5881,15890, +2566,12158,9460,2030,12411,12642,19238,1370,15082,3605, +11126,12188,8388,9863,12568,2856,7720,11960,13209,10317, +2082,3571,6013,7952,8453,18754,14004,12276,13875,1930, +6913,11565,16377,7396,11538,10575,6346,10031,19526,19664, +13251,19669,19897,16382,20910,12149,15515,2718,20239,5844, +16941,20162,9694,19586,18317,21721,10837,3376,4004,20636, +19871,4833,15711,12831,12507,2732,20129,2987,19540,19211, +12582,21727,5888,16412,10443,9242,18234,15575,20439,15418, +21388,17219,4021,15445,13412,2964,20079,4431,8698,15074, +2757,3234,20080,19431,986,20372,7599,12405,2244,19800, +9521,20194,18761,7601,15430,12509,11883,19069,18416,19070, +11745,13887,2747,18424,10104,11081,11082,11746,17673,7732, +14551,11084,18430,1587,14653,14692,9525,7875,5043,18856, +9897,3508,20527,3884,12504,13388,1081,20632,20839,1067, +10559,4961,11527,3807,14187,13116,16394,16658,10774,20514, +4934,4464,7027,12759,12853,12662,13426,18156,17267,1028, +2078,9189,1057,6413,8709,3921,7266,17785,3324,5427, +10852,11237,18914,3953,7703,18081,20732,9321,9145,15025, +18219,5548,17467,5824,8776,8417,13797,18606,16225,20122, +16399,19599,3237,10299,21498,10908,14503,15029,7114,20513, +9968,3588,1704,18831,3725,2636,4562,3128,18119,18466, +6307,9146,16981,2288,6622,18559,20756,7684,13499,14165, +13587,13368,964,5690,10683,11857,20039,17075,12106,4623, +13787,8869,14707,15230,1450,8369,9615,19584,17237,19143, +8806,2885,21551,4488,19590,16690,5966,5171,12696,10810, +13781,3688,15000,17028,18967,2147,14525,16022,16866,11918, +12871,13394,7481,12267,18653,19185,1092,4550,2423,17712, +3993,19967,12874,4837,1922,11509,17641,4265,8435,4172, +5418,19186,12925,1165,13989,13722,2336,11864,4662,20045, +18865,13202,12268,5827,6253,19156,8500,3809,18980,21043, +16987,5083,13782,6878,15380,8649,19877,10336,11639,16569, +4202,21515,11660,16003,14670,11257,5484,8689,10076,1752, +3020,5523,1837,12269,19757,15006,21762,1889,19483,3763, +7299,20649,14607,14671,15818,8307,15157,18740,5859,10610, +11656,14322,3131,11059,6361,2123,16451,16504,10911,11588, +20478,8061,8447,9871,17605,18063,6525,2877,6880,15233, +19161,20865,14554,15476,16094,17014,13753,19703,2641,18783, +17361,1786,19587,6844,2107,15068,11330,17768,7911,14030, +21331,11571,12328,16736,5743,12105,17759,17350,16170,929, +19670,1455,5338,999,7906,2191,17602,10000,19257,17626, +3504,3224,2251,16738,20904,11993,2677,16737,8579,2316, +2906,15016,1582,11854,6414,2821,12176,3279,18517,21771, +11645,4868,2330,18916,18778,15943,18213,2053,8562,18082, +12926,14535,15302,17994,20529,1269,6115,1489,14477,2784, +14583,1838,21279,2659,20096,12522,15918,12927,4925,20385, +10859,12879,4926,9645,19969,12270,18447,1180,1794,7803, +5420,14817,20753,11448,11683,11779,3698,7256,11473,15440, +14409,18866,14939,8937,8551,1296,15921,17713,6259,7678, +2633,4405,5315,1753,14587,11421,5877,19165,8506,21107, +2708,17365,15922,11389,9448,6972,19769,17908,13724,21753, +20984,14226,2664,16991,17714,13571,12271,15820,21181,6292, +11308,8854,18571,17157,17209,17770,8507,2108,9351,7073, +12334,13871,11101,18752,19120,5685,8722,20058,1309,15037, +12864,8953,9061,18939,15681,13532,13153,17727,4611,2308, +16323,2720,6333,3199,20064,9003,4320,9472,21377,13117, +1466,15125,12951,19371,8020,13100,2688,2844,10002,11041, +15741,6714,14842,18244,16385,6228,11267,8646,15315,10475, +9063,8115,9297,19730,2267,17029,16568,6834,4317,13520, +13617,6116,15731,13622,8618,21353,12035,12992,14874,12786, +14975,2136,4727,19859,11454,11163,4164,11108,5498,1585, +16600,6010,16383,9376,5101,14798,10208,10326,18441,14985, +4227,10038,10853,10648,17980,12057,16138,6230,11269,7970, +963,3917,19512,14087,8662,12931,14947,11640,3812,5979, +13947,14678,8765,13411,17437,20591,17797,20187,15627,3261, +5575,6279,19375,4009,10504,10925,9292,16298,17646,20030, +1334,15144,19778,2189,15882,1850,5980,7282,6263,8347, +4756,2170,16287,20995,14957,8348,6468,19685,15784,8938, +21458,10568,17715,13230,14452,5939,10569,18654,2790,20305, +8209,17303,4271,10814,12570,9512,12067,13948,2532,5239, +9565,15596,1733,21286,20718,15979,10183,21732,8328,2315, +19847,7369,5177,3817,15577,2298,10597,8737,10087,12277, +10447,9518,13017,12144,8362,11261,6534,16432,9921,7238, +20621,19092,6724,21164,7141,17873,6748,15561,18083,7586, +10124,6392,18084,13899,15108,16713,9147,16392,21434,8342, +2080,1190,16848,10940,6577,21228,12689,16857,15027,4026, +21416,12342,14482,5143,4601,3099,14423,5644,10407,14846, +17587,18224,11174,7664,15064,6625,17892,12169,7338,17990, +16660,10909,18389,13207,8732,14351,10821,19301,12599,9642, +13902,15301,6858,1477,17791,4969,15487,12077,11303,6632, +19303,17430,9240,2032,6340,10660,6594,9798,21179,18750, +10430,17967,5129,14822,14953,14196,14320,15925,2193,9175, +21733,12219,977,12278,17307,18149,21369,9452,854,8783, +15330,9054,4034,16521,2928,21524,20759,1348,11791,21636, +2965,15422,3910,12729,12936,21389,6991,19785,7914,5632, +10845,2273,15758,16918,9802,15578,5559,3262,14826,20663, +10448,11040,10449,6452,1659,5046,9164,8749,4551,16762, +11537,16300,6399,3563,17164,17165,6866,9851,4451,10981, +8575,18450,3609,9804,5835,17255,4081,16011,16414,16288, +5031,13848,7090,4348,8510,20665,15660,20344,6435,18486, +4105,17109,19641,8766,14479,6646,16479,5032,20532,2112, +13167,14545,6217,8983,11953,13078,15179,9567,3440,20406, +9743,13878,12585,1522,6030,21464,5990,17616,19322,19978, +4719,6061,1107,11143,5740,3477,11110,19528,2411,11846, +12880,12883,16804,9865,12889,6549,7441,7440,2977,18191, +16739,8086,20235,18782,4397,7235,8035,3328,6309,12082, +1886,9557,13387,17410,15683,13640,8965,16347,6583,10410, +2870,6627,13401,17094,1003,5453,15320,10137,17159,9971, +8327,17609,11205,15222,9110,7121,6759,16053,20957,8651, +20883,6948,4250,2176,16988,8319,2257,8033,11909,11090, +4909,1464,19811,2377,14901,4577,18246,16735,19701,1410, +13079,6297,15951,21624,6555,18714,11263,7523,4089,7516, +14960,8984,6381,17949,20606,7821,20666,1560,21050,21527, +17773,18655,10949,12029,865,5072,12938,10928,2113,3302, +1218,17111,9756,15284,8587,18584,18718,11898,16614,13825, +15510,15285,13021,5300,14916,2929,1863,12051,3273,1397, +14048,5178,21528,16699,19260,6677,15790,10162,8576,15250, +14138,15075,16302,5225,20722,20723,9293,19055,19905,15523, +11796,16968,7262,5266,10694,8350,15056,21691,15286,15287, +4759,16553,11489,10388,15288,11982,21680,16047,17777,5656, +18002,9805,14721,10766,11405,10623,7921,21540,5700,11850, +19563,14980,3278,21118,14174,13145,18195,13703,14730,9784, +7608,12424,2141,9554,12448,16195,17193,15255,3676,16433, +4281,8047,1655,7786,2263,1454,2174,11911,1024,19925, +15854,16794,5449,11329,12345,899,12434,2567,9500,18229, +13027,12412,2295,9389,20474,16902,14233,1512,11757,10674, +14853,5047,5042,4859,11903,21497,7761,8395,1222,20180, +14987,4988,21639,18924,11904,15343,17402,6457,12366,9483, +12697,8728,21366,1966,20962,16799,1036,10139,14227,1627, +3075,20460,7215,17339,14920,19544,21130,5243,16245,8921, +1534,16530,10165,3611,14036,21625,18838,10462,8767,13022, +3183,12656,2303,15472,10788,19385,2246,4760,8071,1644, +14827,10315,17801,3090,10234,20160,7530,2038,9529,17131, +16935,8635,14869,1388,20487,12897,2488,10467,6470,7094, +12591,6820,13023,12510,9987,14102,17802,17315,2489,9025, +14965,10167,11598,6651,12422,15226,4507,13112,13538,18489, +15473,17392,8471,7642,21744,9892,13169,9336,4139,17656, +20136,7007,7452,21053,3593,18153,19347,4118,8472,11899, +15705,12610,15822,15823,20499,3893,14246,8558,7453,4644, +15228,10390,8352,6823,19807,9762,20008,12248,14725,5140, +17567,4872,21135,4873,2823,3327,8834,6001,7587,5351, +17408,15631,10062,12774,4584,14283,5797,4215,14712,10178, +13593,16274,21493,8729,17329,15641,11201,6766,14935,1597, +5417,21379,11252,7937,20690,13903,5214,9496,18989,7353, +1692,12388,10778,9390,11322,14057,17545,9872,20294,7553, +12958,13076,6551,21699,18526,6977,2858,20111,19363,3877, +6937,16431,4653,11242,8408,8672,10212,3753,3334,12530, +11244,7239,4402,5400,17813,18160,6187,18549,10655,16980, +6690,9767,12703,19234,12702,6395,9040,18325,3100,16279, +21468,13085,12901,21472,9404,1541,15824,6562,17553,4207, +5871,2491,8337,4698,3304,19073,921,21609,18136,3819, +21292,6196,21394,7016,11691,6135,6924,13263,1710,19275, +9027,11838,17842,7534,7535,12961,2134,21023,11231,9541, +9407,7018,21695,8949,14276,12230,9139,4052,14918,2997, +10529,1652,1281,10391,17226,8888,10253,4356,10359,7536, +9232,1872,7394,18640,2218,17345,7537,16947,5664,2023, +11812,9438,3156,13502,12070,10633,21697,10553,20196,11814, +8486,15529,21220,9233,13985,18463,17706,1265,17711,10811, +18146,20953,17150,19675,12711,2272,2396,8198,10879,19615, +19927,17097,11610,904,15493,7913,6636,19248,3186,3081, +17969,20484,12584,1997,13484,10450,1528,20161,16609,16463, +20070,15549,16778,1613,12764,2098,10698,9593,12289,11196, +18594,13941,7398,2802,2497,3062,17397,4543,12003,21248, +11530,20922,20608,10211,8148,12468,10328,17078,17401,19462, +20886,16180,20799,10043,5430,3652,9601,16142,2464,8658, +9346,18143,13696,20930,20627,5678,12625,15873,9082,8151, +6479,6185,6755,7781,10533,8368,927,17852,4526,5549, +4900,8420,21550,15259,10057,2806,4679,4027,12974,20547, +20973,19237,6634,21516,1851,15522,13815,1386,10153,6556, +9136,2215,2283,2284,8140,1025,3852,8457,9901,11080, +10975,10700,14844,14209,6889,10976,18265,1460,5967,1461, +14188,8557,8650,1367,6254,13953,14039,17204,7492,7344, +11278,17066,14877,4006,20342,11616,20402,12186,17115,10077, +1599,1490,13954,6119,5615,5291,5260,4445,2840,6275, +5721,11282,14113,9073,9304,10477,15862,14156,8237,19970, +19971,2239,13523,10019,2274,14137,9074,18235,16578,18280, +4346,6841,19786,16579,6280,1231,6281,13525,18611,16581, +1168,944,16415,19129,9095,13632,10614,2923,9817,5862, +7484,3690,8197,3119,14448,11553,20321,9795,9239,7065, +12444,8260,13347,4096,2925,2451,10476,2125,8259,17993, +10914,19300,20651,4614,15322,15247,17594,5196,3178,5216, +14912,1693,13808,21178,17593,7912,13029,12645,2768,15496, +21182,6370,5131,19973,13279,16159,8455,13103,13214,10381, +21740,16907,8238,19898,9394,18282,10005,1879,2130,19482, +1001,11363,3129,14254,15742,20043,9788,12402,3379,7059, +1714,19028,13751,4298,5468,8675,10330,20889,18936,20677, +6330,9607,18546,14648,20936,13549,10402,20580,11726,16329, +9210,4022,13576,12241,15738,11797,15335,8577,6129,13634, +2904,5619,4012,12782,8959,15512,5621,12401,8621,17058, +6821,2247,12283,3499,6561,15337,16583,16584,5952,8563, +4018,6768,15321,6548,9368,17659,18890,20900,19087,18454, +3986,4291,14456,12134,5157,20036,20871,12286,2461,4295, +13428,3645,10110,16135,1737,4228,14729,4229,4374,5747, +19548,8517,13121,17707,2949,4997,17081,14208,14469,12564, +20703,17276,3514,12136,18950,4127,10581,19100,8189,2415, +10403,14471,17239,19105,21227,18473,13777,17091,2696,18378, +19106,19591,3602,16348,11774,4128,2986,21504,3121,10442, +9976,16496,7315,12993,7273,7113,7056,8595,3581,5084, +7431,20175,11970,10045,1921,1385,20306,12353,12556,5038, +9111,5136,6037,15401,5210,20272,17633,20010,5770,6084, +20140,10855,19707,2307,11695,12679,14495,18678,2339,18370, +6688,1888,5927,5757,17935,8974,903,11306,16089,18065, +18630,16938,11575,1341,14641,8928,18792,20935,21488,5060, +7933,20710,9170,13393,6962,15454,5020,2163,7149,16953, +3624,19618,5457,7950,13521,7466,7597,12446,10832,5503, +16749,5550,6959,8305,7340,12362,8661,13151,15258,1110, +959,7741,5064,18327,6697,20046,16797,15489,7171,3523, +995,17040,19188,13991,13704,9966,16060,3586,12314,15187, +19770,17250,4683,11687,4388,6992,3528,19195,20999,10262, +16936,9658,9665,6141,20812,18968,13203,12875,6543,5454, +8379,6341,20103,19629,2737,15181,5989,6909,14852,5655, +2797,20106,19384,7002,16929,10197,9526,11556,18027,20108, +7099,7100,11492,4810,14081,11466,4663,12076,20020,2660, +18448,953,11006,3764,3486,6337,3813,11478,2429,20343, +10083,12653,21110,6266,20409,19125,21290,16101,10088,3973, +19252,16810,10094,10095,6268,19130,5288,1878,10868,11430, +3202,7485,14018,14748,2314,10473,12604,13494,12415,3506, +17140,2860,3925,18199,19099,8727,20022,12557,2649,7669, +4028,3851,19514,19862,5854,19945,16652,13785,6606,8013, +13913,15374,5373,21397,11498,18542,12948,10213,3959,8549, +10329,7290,14439,21140,21775,5566,20676,13467,20804,8038, +5681,3963,18217,8870,13987,5885,12367,20706,11095,16096, +10611,3247,12101,16275,11759,7988,18225,4603,19607,21584, +3904,7487,3120,11561,11177,16217,4331,14816,2525,19352, +5290,10501,1715,15606,20991,20371,5534,11020,14059,14201, +10737,10738,20051,10196,11049,1707,16812,16531,9099,16969, +19060,3449,15620,19808,10235,3360,7095,12079,18491,16420, +16421,17059,7222,11050,11029,9408,9706,6925,890,4645, +3363,10254,10105,923,4765,9708,1259,6160,6161,6163, +1774,13244,15712,20650,2476,13296,8066,8069,15714,4588, +11180,1271,15759,6824,18721,3885,2124,7345,13766,3625, +4077,16798,13767,13208,11865,19189,13981,11512,11390,21690, +1181,19004,18625,15574,1133,7754,6260,12114,1754,19123, +5293,15576,7081,940,6171,5402,12832,15842,19354,15180, +15785,17998,8788,1379,15334,20498,9753,10018,19566,16856, +18746,14151,17644,16909,1616,13986,8308,15069,1634,1635, +14723,5450,5483,6380,4612,6983,9203,19569,12152,10834, +20393,7981,11680,10134,18868,18458,16430,4165,13050,14569, +6329,21258,17982,15353,18680,18470,16792,5930,10984,2334, +18383,6365,19751,16364,4097,1227,17936,1552,16077,10120, +10781,14265,20072,19010,19782,4495,15215,17256,8474,3169, +1612,3536,17897,16911,9592,6415,8077,6422,4586,14611, +14982,17142,20881,13436,6418,4886,21774,11056,20800,3010, +20631,15769,12704,2179,17037,21454,16997,13679,15588,15434, +1525,9096,9140,17615,1196,4365,13357,13358,6130,13136, +11480,7371,3610,11966,15555,15336,17551,12052,5303,1535, +9100,15474,10297,5791,13113,18009,7011,7390,7563,2258, +3305,6440,17263,12905,4053,16220,7395,9234,16390,13768, +4933,10965,13602,5294,16474,13133,5940,2327,9097,13856, +20083,14356,16482,5301,1136,15556,5426,20084,5205,1536, +16485,6825,4050,16221,4054,4890,8141,17160,17600,17168, +7004,20102,9381,12220,6650,19258,20086,12226,949,19131, +17372,6441,18676,3888,13285,8967,17384,14890,5907,17822, +18817,17825,5557,15053,8995,12712,4126,7271,6753,11920, +13757,18519,21565,13612,12877,11279,15595,12819,4132,10884, +10988,5185,11762,19698,3280,18018,11199,6940,5139,3478, +17809,2368,4167,18197,21431,1547,4734,4450,894,9617, +10215,20349,15907,3654,9112,16143,4896,17709,10809,17087, +13057,20387,3966,11586,5312,16662,12811,4129,1325,3905, +2438,21121,7807,3703,17995,1574,20589,5806,14045,13298, +13481,4154,3590,7560,1933,11024,1871,8592,20896,4946, +4976,17807,11167,8792,4158,11197,3369,14491,19829,18799, +15174,21569,2561,11419,9171,7417,3691,15261,18169,11706, +6009,19758,16259,1148,4174,3631,3385,12066,12538,10113, +2386,8065,9449,6123,13070,4339,4272,16475,7815,9091, +14427,18828,18829,8697,4116,1603,12457,9450,15808,7283, +15957,6800,8980,7284,10606,15883,2483,19344,19996,6379, +5985,8028,16062,16063,12436,9177,16064,21529,21530,2930, +3912,9178,15424,5986,12891,8699,3212,8103,13184,18833, +14006,15663,4275,4351,18283,16608,8611,19395,21315,18284, +17257,17672,18876,19934,14049,3726,3727,7579,8960,9456, +9337,12407,16227,10740,3149,18588,6062,13114,5562,18135, +18352,6827,2259,13888,11031,1711,15177,12348,13946,15083, +8978,10880,8694,11310,12403,2481,8619,9978,5538,15835, +1439,13591,15719,4523,20678,14324,16281,16052,4887,5168, +5505,9636,18330,12311,9241,9517,6997,20300,6095,5653, +8353,7872,5041,18847,12499,20520,9896,16021,2884,14176, +10974,2146,11916,1913,15375,8289,1162,12914,4545,8648, +3989,6877,1091,19716,20738,5508,8678,12520,1887,1824, +19960,11463,15437,3754,14904,14650,17986,15298,1453,11652, +12262,4194,8660,9349,4403,19507,2516,7275,11587,18651, +2470,3808,19104,8564,21173,15877,3915,6459,13556,5876, +17264,12442,10360,10008,11813,13586,15879,8094,12541,19337, +19394,9455,4735,3916,5571,4927,17069,20437,1626,13993, +1086,15360,9939,5576,17999,14300,8330,1637,14963,16483, +18488,18586,15077,8578,14061,4471,10166,16971,10198,12396, +12397,10169,1647,1648,1649,9894,1650,14104,4766,17778, +18464,20425,14940,18572,10142,4579,4473,4599,14565,1965, +6951,3900,14997,16128,20397,16098,13769,19746,8382,2654, +19190,4531,4532,15237,19187,21280,18819,21782,1491,7834, +15550,1248,3026,15828,15007,1249,14672,4241,5895,13771, +15755,7679,7281,1755,18573,15923,14128,15803,20746,14080, +2706,15463,958,13867,9325,9162,15594,8762,20304,9560, +5234,4266,3258,10564,10179,8556,7421,9285,13227,8202, +853,13008,11947,1347,3559,8733,9043,5556,6864,12140, +8360,15411,21512,13161,8574,14948,4335,2109,15071,6547, +864,10312,13015,4636,10923,11397,5292,8349,11488,10147, +19015,7258,1698,1633,15470,10784,10619,19381,21679,17997, +3607,2199,8460,12588,10383,4135,9209,12607,3152,13019, +3591,6912,21467,19056,2133,1646,21046,14418,3241,20974, +1415,21546,11374,14765,10495,6956,4835,9284,8687,13733, +3027,17366,18510,8385,4406,9387,16898,1799,11629,4341, +1891,8535,4010,15145,19630,16905,18580,6847,5870,14685, +7517,21390,1756,17308,1928,18709,3442,4594,20485,16522, +5633,4347,11931,20081,6382,6647,6807,7372,6298,914, +15509,4665,16526,5535,2114,15055,15511,1864,5203,17055, +9021,10163,15076,15581,18719,16554,11344,15513,10752,1530, +19803,17776,7916,14037,9026,21336,14247,2672,3450,19071, +7008,13700,2490,16534,17373,20416,4666,5899,11030,18425, +11351,2219,17374,10634,20170,11573,3896,16112,4230,6090, +9386,16838,3999,8523,5861,5520,20691,7184,14094,11721, +5035,13681,5704,7659,6048,16886,12515,3831,6423,19398, +8112,19824,1241,20704,5472,3927,10332,13472,2559,14931, +4383,20954,5567,17765,10534,1833,9491,5521,19748,17205, +15644,16755,11192,937,1291,2960,6369,4336,3023,10924, +16807,18627,7365,19254,20615,10194,9882,7638,8164,19794, +6437,10459,5662,11619,3879,7734,9595,14217,9602,19463, +5105,8676,3401,20365,12120,21260,17961,7243,18179,18803, +20960,9324,16796,3239,17202,14129,21206,4635,5554,16460, +19681,19555,3380,9123,19000,6290,2159,10311,7302,14070, +18693,1839,4682,1847,11684,1503,1854,16010,5911,4595, +7373,945,918,17170,19997,4699,12428,17653,10687,19747, +4774,5973,3699,16153,16129,2607,18096,21281,20822,12159, +17670,13783,13992,20049,16573,20851,3405,10478,19486,1848, +1251,8440,16155,19005,13448,12567,13452,8080,12523,20530, +19846,12189,21151,8316,21287,11906,8210,12274,20181,7313, +10084,20692,15346,5026,18511,14608,1509,16157,16158,15009, +10148,10709,12375,15579,21000,13820,15610,3972,18060,13536, +14401,8081,4407,5896,1855,21185,19126,10663,21111,3443, +5897,10156,8240,15046,13185,10815,2666,11394,1149,7076, +6640,1632,10642,19342,20390,10225,19194,2712,1153,9179, +19051,3771,12339,3728,13497,18959,15040,16830,13309,21398, +1570,18602,15797,4007,8688,19621,18055,8314,19684,18730, +2131,11500,13756,7880,10956,12063,3453,7248,5252,8752, +9722,2524,9769,7419,1656,2809,15693,1486,8203,4190, +3269,1330,1250,10503,1576,9201,2634,20605,13048,13883, +12069,18173,17810,8498,3216,7877,9415,21547,2362,14999, +6863,9359,15520,11990,10288,7576,11895,11410,3844,3882, +3374,10065,11824,5826,9015,1010,15408,5903,12684,6005, +9294,5987,16012,17950,16081,8538,4284,2549,17693,15012, +10458,21370,21116,14357,12376,9057,15582,9165,21602,8739, +12738,12739,18408,4596,14062,18409,5304,18612,16815,12383, +3091,12384,12942,4597,6652,12940,6869,19648,15666,13537, +17113,21604,8985,13851,14964,5578,16163,5735,15078,12900, +2541,21015,10168,12228,15614,16972,2044,4045,18417,19908, +21655,14063,14248,12751,21019,14856,10468,16973,10626,20488, +11407,1046,1973,1651,3092,13461,1542,21020,19810,17841, +6471,1802,15154,17462,9989,20467,4157,10172,16165,2087, +3773,7643,15825,18426,10635,20418,7794,6109,19336,8684, +5972,4340,21311,11792,10739,14047,6060,13886,12441,6320, +12916,13374,7107,2156,6686,5310,10996,4898,12296,13942, +17238,6017,7856,5377,3991,19182,2558,5905,5476,6104, +9629,19474,13657,20366,13344,10068,2469,19536,13320,7277, +11589,20961,14936,13444,15859,9087,12705,7619,18477,10839, +14450,20562,14296,16721,9499,2782,4923,13007,13259,12722, +16895,19767,4591,5867,5834,19003,12313,15783,13570,16236, +9290,11039,2942,13813,11562,4936,8979,8696,5024,15073, +19627,19488,10289,13410,1557,10843,13217,1011,10763,10822, +8003,19078,18722,16131,12429,21158,18431,10255,10485,15619, +17346,7226,14862,8249,16976,6529,9544,1653,13779,19096, +1617,17678,13176,21577,15116,8972,14854,16446,16454,16455, +19609,5146,18981,980,1272,1332,3005,15673,13071,8858, +16074,5357,12373,19644,15191,1867,17455,12096,1868,3235, +11348,9893,10298,17459,20178,15675,1723,8889,10361,5192, +13128,8652,13118,9338,14073,9041,3627,4573,17771,13659, +3435,9050,1716,4429,12275,4455,15697,1274,1510,10844, +4937,4389,13821,13454,5389,9092,12221,21297,14301,15271, +15700,9666,1718,15703,12224,15035,10680,19901,16916,2574, +15503,12087,14687,6645,2037,12394,15506,16923,17391,21049, +20486,14840,10846,12223,6813,12049,14242,6918,11042,2205, +9759,11229,9536,4083,13501,4805,19244,13301,17129,14647, +21197,19577,7044,4059,6950,7405,20544,21549,6419,13313, +12521,3288,14472,20240,5434,9625,14998,15778,7245,1548, +2562,8808,1470,17241,18269,13559,20749,8502,14666,5183, +12008,14294,17474,13295,20248,13159,21283,13970,12930,16185, +1498,3382,8780,19843,17431,20658,9014,6637,6293,5423, +4618,9657,1514,2612,15150,11227,3982,10451,4104,5763, +20760,21605,14896,7447,4223,6384,9133,12750,9761,20696, +12229,10711,14023,10754,10755,14112,17843,9947,12902,12903, +11570,9101,11839,1724,13683,4000,4008,11617,6282,17056, +4014,5947,4015,4016,8125,19818,19819,18404,4974,17655, +5734,21606,10199,5737,14269,10962,12713,12714,5050,17829, +19793,16065,12655,9838,5117,12398,1539,12752,17840,2759, +18356,20419,19594,3510,13723,7804,1070,6261,16130,3632, +7116,19631,4274,13162,14135,5994,16100,11398,7866,14428, +1167,19896,12315,10379,16574,6375,10338,20097,4559,4687, +11513,19489,12382,11337,6127,17107,3772,20134,3576,1876, +9183,21155,19571,19578,2683,17032,11770,11922,2865,14181, +18854,1420,21040,1164,4571,5307,10334,21205,20241,16879, +14295,16462,11038,14704,2036,2691,11026,13175,11750,7247, +13405,14132,1532,3601,13042,15263,7812,15467,16915,17146, +11092,1063,9627,15802,16876,21502,1992,9964,21632,14028, +6294,20133,3024,17860,13844,13420,7600,5323,7173,18934, +10064,16877,21284,4615,7434,12364,6125,19046,11107,20846, +12718,12778,18581,3553,4834,13459,8114,8200,9937,21511, +20147,11557,20604,7544,2628,3883,5106,21144,18802,5482, +13455,5912,12279,10089,16160,1102,13413,12495,4942,1520, +7201,16523,8211,3791,1856,19491,5810,12317,11718,17690, +15362,1276,5029,20354,8321,5490,14590,3936,3352,15309, +7822,14759,6316,17370,4390,946,16416,20558,21186,19216, +9941,10664,15935,18834,19050,1773,16480,7636,8828,5730, +17169,5298,6734,9354,4945,8665,17774,4206,8511,15664, +11179,14302,20355,15272,13186,19645,11630,20597,5811,5358, +15096,16725,13415,14202,12572,6602,15789,9569,14139,14140, +8666,11025,2538,9527,21659,16930,19427,14403,21531,12742, +13262,17371,11631,2966,7216,3795,3133,16151,17152,11317, +20897,18395,14537,2531,16009,9447,9053,12133,6378,15657, +17861,5889,15508,9335,1893,7729,16934,8335,9571,18073, +14598,3244,4159,13304,18021,3145,1679,1264,15297,7412, +4832,13000,20847,4836,14189,9637,16150,7253,1874,15356, +8994,13061,1487,17247,17151,6967,7620,9823,7180,2975, +6503,2610,20994,3743,1849,20855,7510,3861,2857,21066, +8266,4205,3233,12374,13846,11793,12047,12654,2799,8465, +12609,4503,3147,21210,10023,2214,9946,21694,17625,20906, +3785,11388,17767,11402,12320,6354,8424,14257,5478,21508, +13168,5561,21129,3938,9166,4598,11667,19061,9058,10463, +8165,2276,7998,10598,10099,21653,9530,11043,21607,21016, +11722,6400,19649,3662,14546,14405,6603,15667,6299,17695, +21193,9137,21608,7205,1564,1565,6604,13581,20281,16375, +16376,19650,2946,13852,3865,6653,9807,18344,13360,13361, +7448,1399,4353,18490,5036,14007,7383,17072,16178,6385, +14693,13973,17957,16555,7387,6063,16700,12091,14064,10170, +10696,14594,14547,5622,21534,15616,15312,18589,5305,19396, +12945,12753,16556,13974,14410,9763,1017,9385,6716,11290, +7223,15792,13462,7391,14406,10756,5384,15136,20992,21555, +13289,8057,19593,9638,16570,15863,7181,12161,4592,14157, +19173,889,17316,10717,2448,8262,1228,15781,21517,19166, +19686,2991,16670,11164,19878,16164,21364,15244,8371,8204, +10662,8331,2743,13305,10537,16808,20153,11424,1045,10161, +1338,17652,19480,4558,1100,12489,11717,10337,15093,5017, +6314,15357,5722,7810,16468,4387,7182,7624,17367,18098, +5356,9513,9742,7363,14589,15787,5809,14136,6597,7186, +13261,10090,21652,4593,9055,2275,5560,11666,11719,3792, +14543,21526,4718,3862,4349,13355,5033,6648,1561,14060, +16975,13418,1664,7224,7220,21211,7564,13363,21316,19390, +20489,8636,18035,1667,19813,13463,17393,1803,7700,18109, +15155,6654,21746,14251,14252,4474,5792,9991,18110,11195, +17005,20303,17344,4720,5624,6317,8883,20282,14065,20420, +5135,5793,14489,9574,2304,9410,14791,922,13889,7225, +17916,6442,14793,9707,9949,10668,11232,20668,17375,4358, +10362,5666,9545,17181,3509,7111,16099,1069,6117,19484, +20351,1840,12310,8663,15924,20279,6315,8873,20352,8508, +19425,12730,14402,1396,2302,15661,16552,16372,13577,7558, +12088,7377,16532,16970,6439,5134,1015,12740,15310,5620, +18585,9384,1663,18034,10753,11288,19386,5790,14249,21745, +9572,3296,18449,3298,13102,10751,7376,8214,13849,5425, +1337,7862,15955,8827,5493,3661,6296,5295,8700,1526, +10296,12841,8887,1721,4051,10966,1087,18336,9837,17442, +16335,2578,17363,18398,15829,15557,19389,1618,9044,10842, +13661,15786,7194,21525,17772,13578,8124,1722,6563,9948, +11335,6712,11068,7115,8509,21235,11070,12745,1016,14361, +9990,3356,2849,19516,17112,18762,13460,4046,9532,13280, +1989,978,4693,19542,16726,18357,16943,13414,5913,20330, +20417,5635,11751,18867,4928,9646,8121,1900,18390,4891, +3787,6968,4792,13905,5114,14538,4793,11309,1252,19844, +20823,6433,13212,4845,4688,16575,7364,14541,19779,4811, +18537,8451,8452,12336,6519,20721,1254,18399,18148,20784, +4552,4794,16576,11978,3353,5261,13874,10091,11223,4938, +16161,11262,9659,1578,21001,5262,19848,3031,13483,17443, +2575,3444,8212,18610,5491,21048,19787,18451,19788,18150, +15821,19789,15736,19253,4117,16698,4391,5577,915,20825, +18406,6193,17450,7285,9942,21187,18487,15662,6269,10453, +13880,11425,5265,13725,7637,17775,22349,22350,22351,22352, +22353,22354,22355,22356,22357,22358,22359,22360,22361,22362, +22363,22364,22365,22366,22367,22368,22369,22370,22371,22372, +22373,22374,22375,22376,22377,22378,22379,22380,22381,22382, +22383,22384,22385,22386,22387,22388,22389,22390,22391,22392, +22393,22394,22395,22396,22397,22398,22399,22400,22401,22402, +22403,22404,22405,22406,22407,22408,22409,22410,22411,22412, +22413,22414,22415,22416,22417,22418,22419,22420,22421,22422, +22423,22424,22425,22426,22427,22428,22429,22430,22431,22432, +22433,22434,22435,22436,22437,22438,22439,22440,22441,22442, +21115,2576,10665,6194,11720,4285,10538,7286,7206,16013, +6521,16177,1902,16724,8351,19801,1865,8539,8540,1398, +16931,8541,8241,15980,7997,15665,4276,4277,8915,5539, +16766,14404,9180,7693,12068,10464,12323,14763,4948,948, +21469,12227,13416,12898,1293,3796,10465,13635,7381,8243, +16029,18152,19850,12743,9531,18720,21371,8784,4246,9059, +14481,12744,7999,19062,19063,8000,21532,9167,3939,12657, +2967,5345,8215,8467,19064,21743,7005,14828,14829,2673, +11194,13853,950,13362,15668,6386,15669,4354,7758,10847, +4949,2947,16014,18345,6133,19909,22443,22444,22445,22446, +22447,22448,22449,22450,22451,22452,22453,22454,22455,22456, +22457,22458,22459,22460,22461,22462,22463,22464,22465,22466, +22467,22468,22469,22470,22471,22472,22473,22474,22475,22476, +22477,22478,22479,22480,22481,22482,22483,22484,22485,22486, +22487,22488,22489,22490,22491,22492,22493,22494,22495,22496, +22497,22498,22499,22500,22501,22502,22503,22504,22505,22506, +22507,22508,22509,22510,22511,22512,22513,22514,22515,22516, +22517,22518,22519,22520,22521,22522,22523,22524,22525,22526, +22527,22528,22529,22530,22531,22532,22533,22534,22535,22536, +12365,9060,10932,6387,19262,2887,16816,8246,3940,2018, +4574,6388,19274,19910,17177,16615,14548,6158,2800,15514, +17114,13975,10171,7096,5494,7388,15251,5992,3035,3036, +19074,18638,18418,7012,9695,15739,8814,15628,15629,19075, +16015,10695,17460,5206,15740,2435,7097,16049,20617,1018, +18614,18764,11983,2674,21022,10200,19391,10484,1543,14859, +21474,19651,16727,8480,19176,15433,14966,7644,19079,6472, +1544,19278,15156,6655,4509,7645,9895,18427,5208,8169, +17227,17228,16016,10723,21747,19814,19280,10472,16050,17229, +18028,19081,12356,14792,10631,16945,22537,22538,22539,22540, +22541,22542,22543,22544,22545,22546,22547,22548,22549,22550, +22551,22552,22553,22554,22555,22556,22557,22558,22559,22560, +22561,22562,22563,22564,22565,22566,22567,22568,22569,22570, +22571,22572,22573,22574,22575,22576,22577,22578,22579,22580, +22581,22582,22583,22584,22585,22586,22587,22588,22589,22590, +22591,22592,22593,22594,22595,22596,22597,22598,22599,22600, +22601,22602,22603,22604,22605,22606,22607,22608,22609,22610, +22611,22612,22613,22614,22615,22616,22617,22618,22619,22620, +22621,22622,22623,22624,22625,22626,22627,22628,22629,22630, +18842,7021,20267,19652,20421,18723,18492,12357,11840,6443, +11083,19281,11032,3640,19985,19815,9439,1903,10363,6162, +10256,14863,19988,19282,5665,13503,9546,10556,14518,2005, +17411,10053,18020,6189,21102,16718,9045,12881,5339,19842, +15130,6120,13349,19016,16612,10149,7082,19017,18757,6557, +20413,11027,14860,10370,7892,10092,7449,17223,3245,7454, +7457,18298,19440,3125,1631,3126,12116,21291,7374,11069, +19691,10164,2433,8512,9983,11668,8166,8513,8001,9682, +17340,18290,7263,11074,9696,20490,8004,12755,10108,18299, +3127,10732,6121,2358,4846,11183,22631,22632,22633,22634, +22635,22636,22637,22638,22639,22640,22641,22642,22643,22644, +22645,22646,22647,22648,22649,22650,22651,22652,22653,22654, +22655,22656,22657,22658,22659,22660,22661,22662,22663,22664, +22665,22666,22667,22668,22669,22670,22671,22672,22673,22674, +22675,22676,22677,22678,22679,22680,22681,22682,22683,22684, +22685,22686,22687,22688,22689,22690,22691,22692,22693,22694, +22695,22696,22697,22698,22699,22700,22701,22702,22703,22704, +22705,22706,22707,22708,22709,22710,22711,22712,22713,22714, +22715,22716,22717,22718,22719,22720,22721,22722,22723,22724, +11184,4848,12124,13524,13457,11426,4849,17310,9168,11186, +2581,4767,13453,11185,11334,11354,21654,11933,4700,6616, +7893,5686,15713,15963,6494,8941,6270,2583,6164,19018, +3408,17051,16090,11399,12939,3744,18341,10950,18346,19980, +3469,18240,18350,18351,20724,20697,3362,1990,18765,10934, +20444,18359,4055,10364,4703,11281,19904,3146,13528,2352, +16206,21192,20828,11044,1019,1668,16166,1545,2344,11133, +3891,21519,5525,3937,4695,19852,2277,5207,2048,19853, +15475,15599,14778,4641,16582,1089,3794,16162,21051,13487, +14480,14591,14593,15867,8247,8002,22725,22726,22727,22728, +22729,22730,22731,22732,22733,22734,22735,22736,22737,22738, +22739,22740,22741,22742,22743,22744,22745,22746,22747,22748, +22749,22750,22751,22752,22753,22754,22755,22756,22757,22758, +22759,22760,22761,22762,22763,22764,22765,22766,22767,22768, +22769,22770,22771,22772,22773,22774,22775,22776,22777,22778, +22779,22780,22781,22782,22783,22784,22785,22786,22787,22788, +22789,22790,22791,22792,22793,22794,22795,22796,22797,22798, +22799,22800,22801,22802,22803,22804,22805,22806,22807,22808, +22809,22810,22811,22812,22813,22814,22815,22816,22817,22818, +6850,8248,18353,15981,14967,17317,9413,18629,16811,16813, +6283,17622,6159,17803,16629,20331,11890,11579,12723,20381, +7207,21533,7013,7019,2635,2453,2454,6131,18172,19174, +17620,1233,20265,14694,21535,2579,18347,8269,15791,10102, +10096,2770,13583,17621,19175,11804,8168,18613,2996,20052, +19693,2815,18878,11669,20266,2998,13512,20053,18358,11984, +4357,16671,19083,3246,21656,3733,2816,7965,18211,6105, +19157,10228,12089,5391,12090,18348,10245,10250,5392,8596, +3306,10109,3307,5731,13364,1670,2914,6136,8483,17557, +19987,9271,9814,5122,9564,9967,22819,22820,22821,22822, +22823,22824,22825,22826,22827,22828,22829,22830,22831,22832, +22833,22834,22835,22836,22837,22838,22839,22840,22841,22842, +22843,22844,22845,22846,22847,22848,22849,22850,22851,22852, +22853,22854,22855,22856,22857,22858,22859,22860,22861,22862, +22863,22864,22865,22866,22867,22868,22869,22870,22871,22872, +22873,22874,22875,22876,22877,22878,22879,22880,22881,22882, +22883,22884,22885,22886,22887,22888,22889,22890,22891,22892, +22893,22894,22895,22896,22897,22898,22899,22900,22901,22902, +22903,22904,22905,22906,22907,22908,22909,22910,22911,22912, +16769,6900,14850,19718,12706,4918,8263,9548,886,5739, +14473,3992,7037,17500,17731,3521,23854,23855,23856,23857, +23858,23859,23860,23861,23862,23863,23864,23865,23866,23867, +23868,23869,23870,23871,23872,23873,23874,23875,23876,23877, +23878,23879,23880,23881,23882,23883,23884,23885,23886,23887, +23888,23889,23890,23891,23892,23893,23894,23895,23896,23897, +23898,23899,23900,23901,23902,23903,23904,23905,23906,23907, +23908,23909,23910,23911,23912,23913,23914,23915,23916,23917, +23918,23919,23920,23921,23922,23923,23924,23925,23926,23927, +23928,23929,23930,23931,23932,23933,22913,22914,22915,22916, +22917,22918,22919,22920,22921,22922,22923,22924,22925,22926, +22927,22928,22929,22930,22931,22932,22933,22934,22935,22936, +22937,22938,22939,22940,22941,22942,22943,22944,22945,22946, +22947,22948,22949,22950,22951,22952,22953,22954,22955,22956, +22957,22958,22959,22960,22961,22962,22963,22964,22965,22966, +22967,22968,22969,22970,22971,22972,22973,22974,22975,22976, +22977,22978,22979,22980,22981,22982,22983,22984,22985,22986, +22987,22988,22989,22990,22991,22992,22993,22994,22995,22996, +22997,22998,22999,23000,23001,23002,23003,23004,23005,23006 +}; + +static uint16 gbksortorder(uint16 i) +{ + uint idx=gbktail(i); + if (idx>0x7f) idx-=0x41; + else idx-=0x40; + idx+=(gbkhead(i)-0x81)*0xbe; + return 0x8100+gbk_order[idx]; +} + + +int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res, + size_t length) +{ + const uchar *a= *a_res, *b= *b_res; + uint a_char,b_char; + + while (length--) + { + if ((length > 0) && isgbkcode(*a,*(a+1)) && isgbkcode(*b, *(b+1))) + { + a_char= gbkcode(*a,*(a+1)); + b_char= gbkcode(*b,*(b+1)); + if (a_char != b_char) + return ((int) gbksortorder((uint16) a_char) - + (int) gbksortorder((uint16) b_char)); + a+= 2; + b+= 2; + length--; + } + else if (sort_order_gbk[*a++] != sort_order_gbk[*b++]) + return ((int) sort_order_gbk[a[-1]] - + (int) sort_order_gbk[b[-1]]); + } + *a_res= a; + *b_res= b; + return 0; +} + + + +int my_strnncoll_gbk(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool b_is_prefix) +{ + size_t length= min(a_length, b_length); + int res= my_strnncoll_gbk_internal(&a, &b, length); + return res ? res : (int) ((b_is_prefix ? length : a_length) - b_length); +} + + +static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + size_t length= min(a_length, b_length); + int res= my_strnncoll_gbk_internal(&a, &b, length); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + if (!res && a_length != b_length) + { + const uchar *end; + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a_length < b_length) + { + /* put shorter key in a */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (end= a + a_length-length; a < end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + } + return res; +} + + +static size_t +my_strnxfrm_gbk(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + uchar *de= dst + dstlen; + const uchar *se= src + srclen; + const uchar *sort_order= cs->sort_order; + + for (; dst < de && src < se && nweights; nweights--) + { + if (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) + { + /* + Note, it is safe not to check (src < se) + in the code below, because ismbchar() would + not return TRUE if src was too short + */ + uint16 e= gbksortorder((uint16) gbkcode(*src, *(src + 1))); + *dst++= gbkhead(e); + if (dst < de) + *dst++= gbktail(e); + src+= 2; + } + else + *dst++= sort_order ? sort_order[*src++] : *src++; + } + return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); +} + + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +#define max_sort_char ((uchar) 255) + +static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr,size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) +{ + const char *end= ptr + ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + size_t charlen= res_length / cs->mbmaxlen; + + for (; ptr != end && min_str != min_end && charlen > 0; ptr++, charlen--) + { + if (ptr+1 != end && isgbkcode(ptr[0],ptr[1])) + { + *min_str++= *max_str++ = *ptr++; + *min_str++= *max_str++ = *ptr; + continue; + } + if (*ptr == escape && ptr+1 != end) + { + ptr++; /* Skip escape */ + if (isgbkcode(ptr[0], ptr[1])) + *min_str++= *max_str++ = *ptr; + if (min_str < min_end) + *min_str++= *max_str++= *ptr; + continue; + } + if (*ptr == w_one) /* '_' in SQL */ + { + *min_str++='\0'; /* This should be min char */ + *max_str++=max_sort_char; + continue; + } + if (*ptr == w_many) /* '%' in SQL */ + { + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + do { + *min_str++= 0; + *max_str++= max_sort_char; + } while (min_str != min_end); + return 0; + } + *min_str++= *max_str++ = *ptr; + } + + *min_length= *max_length = (size_t) (min_str - min_org); + while (min_str != min_end) + *min_str++= *max_str++= ' '; /* Because if key compression */ + return 0; +} + + +static uint ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0); +} + +static uint mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (isgbkhead(c)? 2 : 1); +} + +/* page 0 0x8140-0xFE4F */ +static uint16 tab_gbk_uni0[]={ +0x4E02,0x4E04,0x4E05,0x4E06,0x4E0F,0x4E12,0x4E17,0x4E1F, +0x4E20,0x4E21,0x4E23,0x4E26,0x4E29,0x4E2E,0x4E2F,0x4E31, +0x4E33,0x4E35,0x4E37,0x4E3C,0x4E40,0x4E41,0x4E42,0x4E44, +0x4E46,0x4E4A,0x4E51,0x4E55,0x4E57,0x4E5A,0x4E5B,0x4E62, +0x4E63,0x4E64,0x4E65,0x4E67,0x4E68,0x4E6A,0x4E6B,0x4E6C, +0x4E6D,0x4E6E,0x4E6F,0x4E72,0x4E74,0x4E75,0x4E76,0x4E77, +0x4E78,0x4E79,0x4E7A,0x4E7B,0x4E7C,0x4E7D,0x4E7F,0x4E80, +0x4E81,0x4E82,0x4E83,0x4E84,0x4E85,0x4E87,0x4E8A, 0, +0x4E90,0x4E96,0x4E97,0x4E99,0x4E9C,0x4E9D,0x4E9E,0x4EA3, +0x4EAA,0x4EAF,0x4EB0,0x4EB1,0x4EB4,0x4EB6,0x4EB7,0x4EB8, +0x4EB9,0x4EBC,0x4EBD,0x4EBE,0x4EC8,0x4ECC,0x4ECF,0x4ED0, +0x4ED2,0x4EDA,0x4EDB,0x4EDC,0x4EE0,0x4EE2,0x4EE6,0x4EE7, +0x4EE9,0x4EED,0x4EEE,0x4EEF,0x4EF1,0x4EF4,0x4EF8,0x4EF9, +0x4EFA,0x4EFC,0x4EFE,0x4F00,0x4F02,0x4F03,0x4F04,0x4F05, +0x4F06,0x4F07,0x4F08,0x4F0B,0x4F0C,0x4F12,0x4F13,0x4F14, +0x4F15,0x4F16,0x4F1C,0x4F1D,0x4F21,0x4F23,0x4F28,0x4F29, +0x4F2C,0x4F2D,0x4F2E,0x4F31,0x4F33,0x4F35,0x4F37,0x4F39, +0x4F3B,0x4F3E,0x4F3F,0x4F40,0x4F41,0x4F42,0x4F44,0x4F45, +0x4F47,0x4F48,0x4F49,0x4F4A,0x4F4B,0x4F4C,0x4F52,0x4F54, +0x4F56,0x4F61,0x4F62,0x4F66,0x4F68,0x4F6A,0x4F6B,0x4F6D, +0x4F6E,0x4F71,0x4F72,0x4F75,0x4F77,0x4F78,0x4F79,0x4F7A, +0x4F7D,0x4F80,0x4F81,0x4F82,0x4F85,0x4F86,0x4F87,0x4F8A, +0x4F8C,0x4F8E,0x4F90,0x4F92,0x4F93,0x4F95,0x4F96,0x4F98, +0x4F99,0x4F9A,0x4F9C,0x4F9E,0x4F9F,0x4FA1,0x4FA2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4FA4,0x4FAB,0x4FAD,0x4FB0,0x4FB1,0x4FB2,0x4FB3,0x4FB4, +0x4FB6,0x4FB7,0x4FB8,0x4FB9,0x4FBA,0x4FBB,0x4FBC,0x4FBD, +0x4FBE,0x4FC0,0x4FC1,0x4FC2,0x4FC6,0x4FC7,0x4FC8,0x4FC9, +0x4FCB,0x4FCC,0x4FCD,0x4FD2,0x4FD3,0x4FD4,0x4FD5,0x4FD6, +0x4FD9,0x4FDB,0x4FE0,0x4FE2,0x4FE4,0x4FE5,0x4FE7,0x4FEB, +0x4FEC,0x4FF0,0x4FF2,0x4FF4,0x4FF5,0x4FF6,0x4FF7,0x4FF9, +0x4FFB,0x4FFC,0x4FFD,0x4FFF,0x5000,0x5001,0x5002,0x5003, +0x5004,0x5005,0x5006,0x5007,0x5008,0x5009,0x500A, 0, +0x500B,0x500E,0x5010,0x5011,0x5013,0x5015,0x5016,0x5017, +0x501B,0x501D,0x501E,0x5020,0x5022,0x5023,0x5024,0x5027, +0x502B,0x502F,0x5030,0x5031,0x5032,0x5033,0x5034,0x5035, +0x5036,0x5037,0x5038,0x5039,0x503B,0x503D,0x503F,0x5040, +0x5041,0x5042,0x5044,0x5045,0x5046,0x5049,0x504A,0x504B, +0x504D,0x5050,0x5051,0x5052,0x5053,0x5054,0x5056,0x5057, +0x5058,0x5059,0x505B,0x505D,0x505E,0x505F,0x5060,0x5061, +0x5062,0x5063,0x5064,0x5066,0x5067,0x5068,0x5069,0x506A, +0x506B,0x506D,0x506E,0x506F,0x5070,0x5071,0x5072,0x5073, +0x5074,0x5075,0x5078,0x5079,0x507A,0x507C,0x507D,0x5081, +0x5082,0x5083,0x5084,0x5086,0x5087,0x5089,0x508A,0x508B, +0x508C,0x508E,0x508F,0x5090,0x5091,0x5092,0x5093,0x5094, +0x5095,0x5096,0x5097,0x5098,0x5099,0x509A,0x509B,0x509C, +0x509D,0x509E,0x509F,0x50A0,0x50A1,0x50A2,0x50A4,0x50A6, +0x50AA,0x50AB,0x50AD,0x50AE,0x50AF,0x50B0,0x50B1,0x50B3, +0x50B4,0x50B5,0x50B6,0x50B7,0x50B8,0x50B9,0x50BC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x50BD,0x50BE,0x50BF,0x50C0,0x50C1,0x50C2,0x50C3,0x50C4, +0x50C5,0x50C6,0x50C7,0x50C8,0x50C9,0x50CA,0x50CB,0x50CC, +0x50CD,0x50CE,0x50D0,0x50D1,0x50D2,0x50D3,0x50D4,0x50D5, +0x50D7,0x50D8,0x50D9,0x50DB,0x50DC,0x50DD,0x50DE,0x50DF, +0x50E0,0x50E1,0x50E2,0x50E3,0x50E4,0x50E5,0x50E8,0x50E9, +0x50EA,0x50EB,0x50EF,0x50F0,0x50F1,0x50F2,0x50F4,0x50F6, +0x50F7,0x50F8,0x50F9,0x50FA,0x50FC,0x50FD,0x50FE,0x50FF, +0x5100,0x5101,0x5102,0x5103,0x5104,0x5105,0x5108, 0, +0x5109,0x510A,0x510C,0x510D,0x510E,0x510F,0x5110,0x5111, +0x5113,0x5114,0x5115,0x5116,0x5117,0x5118,0x5119,0x511A, +0x511B,0x511C,0x511D,0x511E,0x511F,0x5120,0x5122,0x5123, +0x5124,0x5125,0x5126,0x5127,0x5128,0x5129,0x512A,0x512B, +0x512C,0x512D,0x512E,0x512F,0x5130,0x5131,0x5132,0x5133, +0x5134,0x5135,0x5136,0x5137,0x5138,0x5139,0x513A,0x513B, +0x513C,0x513D,0x513E,0x5142,0x5147,0x514A,0x514C,0x514E, +0x514F,0x5150,0x5152,0x5153,0x5157,0x5158,0x5159,0x515B, +0x515D,0x515E,0x515F,0x5160,0x5161,0x5163,0x5164,0x5166, +0x5167,0x5169,0x516A,0x516F,0x5172,0x517A,0x517E,0x517F, +0x5183,0x5184,0x5186,0x5187,0x518A,0x518B,0x518E,0x518F, +0x5190,0x5191,0x5193,0x5194,0x5198,0x519A,0x519D,0x519E, +0x519F,0x51A1,0x51A3,0x51A6,0x51A7,0x51A8,0x51A9,0x51AA, +0x51AD,0x51AE,0x51B4,0x51B8,0x51B9,0x51BA,0x51BE,0x51BF, +0x51C1,0x51C2,0x51C3,0x51C5,0x51C8,0x51CA,0x51CD,0x51CE, +0x51D0,0x51D2,0x51D3,0x51D4,0x51D5,0x51D6,0x51D7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x51D8,0x51D9,0x51DA,0x51DC,0x51DE,0x51DF,0x51E2,0x51E3, +0x51E5,0x51E6,0x51E7,0x51E8,0x51E9,0x51EA,0x51EC,0x51EE, +0x51F1,0x51F2,0x51F4,0x51F7,0x51FE,0x5204,0x5205,0x5209, +0x520B,0x520C,0x520F,0x5210,0x5213,0x5214,0x5215,0x521C, +0x521E,0x521F,0x5221,0x5222,0x5223,0x5225,0x5226,0x5227, +0x522A,0x522C,0x522F,0x5231,0x5232,0x5234,0x5235,0x523C, +0x523E,0x5244,0x5245,0x5246,0x5247,0x5248,0x5249,0x524B, +0x524E,0x524F,0x5252,0x5253,0x5255,0x5257,0x5258, 0, +0x5259,0x525A,0x525B,0x525D,0x525F,0x5260,0x5262,0x5263, +0x5264,0x5266,0x5268,0x526B,0x526C,0x526D,0x526E,0x5270, +0x5271,0x5273,0x5274,0x5275,0x5276,0x5277,0x5278,0x5279, +0x527A,0x527B,0x527C,0x527E,0x5280,0x5283,0x5284,0x5285, +0x5286,0x5287,0x5289,0x528A,0x528B,0x528C,0x528D,0x528E, +0x528F,0x5291,0x5292,0x5294,0x5295,0x5296,0x5297,0x5298, +0x5299,0x529A,0x529C,0x52A4,0x52A5,0x52A6,0x52A7,0x52AE, +0x52AF,0x52B0,0x52B4,0x52B5,0x52B6,0x52B7,0x52B8,0x52B9, +0x52BA,0x52BB,0x52BC,0x52BD,0x52C0,0x52C1,0x52C2,0x52C4, +0x52C5,0x52C6,0x52C8,0x52CA,0x52CC,0x52CD,0x52CE,0x52CF, +0x52D1,0x52D3,0x52D4,0x52D5,0x52D7,0x52D9,0x52DA,0x52DB, +0x52DC,0x52DD,0x52DE,0x52E0,0x52E1,0x52E2,0x52E3,0x52E5, +0x52E6,0x52E7,0x52E8,0x52E9,0x52EA,0x52EB,0x52EC,0x52ED, +0x52EE,0x52EF,0x52F1,0x52F2,0x52F3,0x52F4,0x52F5,0x52F6, +0x52F7,0x52F8,0x52FB,0x52FC,0x52FD,0x5301,0x5302,0x5303, +0x5304,0x5307,0x5309,0x530A,0x530B,0x530C,0x530E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5311,0x5312,0x5313,0x5314,0x5318,0x531B,0x531C,0x531E, +0x531F,0x5322,0x5324,0x5325,0x5327,0x5328,0x5329,0x532B, +0x532C,0x532D,0x532F,0x5330,0x5331,0x5332,0x5333,0x5334, +0x5335,0x5336,0x5337,0x5338,0x533C,0x533D,0x5340,0x5342, +0x5344,0x5346,0x534B,0x534C,0x534D,0x5350,0x5354,0x5358, +0x5359,0x535B,0x535D,0x5365,0x5368,0x536A,0x536C,0x536D, +0x5372,0x5376,0x5379,0x537B,0x537C,0x537D,0x537E,0x5380, +0x5381,0x5383,0x5387,0x5388,0x538A,0x538E,0x538F, 0, +0x5390,0x5391,0x5392,0x5393,0x5394,0x5396,0x5397,0x5399, +0x539B,0x539C,0x539E,0x53A0,0x53A1,0x53A4,0x53A7,0x53AA, +0x53AB,0x53AC,0x53AD,0x53AF,0x53B0,0x53B1,0x53B2,0x53B3, +0x53B4,0x53B5,0x53B7,0x53B8,0x53B9,0x53BA,0x53BC,0x53BD, +0x53BE,0x53C0,0x53C3,0x53C4,0x53C5,0x53C6,0x53C7,0x53CE, +0x53CF,0x53D0,0x53D2,0x53D3,0x53D5,0x53DA,0x53DC,0x53DD, +0x53DE,0x53E1,0x53E2,0x53E7,0x53F4,0x53FA,0x53FE,0x53FF, +0x5400,0x5402,0x5405,0x5407,0x540B,0x5414,0x5418,0x5419, +0x541A,0x541C,0x5422,0x5424,0x5425,0x542A,0x5430,0x5433, +0x5436,0x5437,0x543A,0x543D,0x543F,0x5441,0x5442,0x5444, +0x5445,0x5447,0x5449,0x544C,0x544D,0x544E,0x544F,0x5451, +0x545A,0x545D,0x545E,0x545F,0x5460,0x5461,0x5463,0x5465, +0x5467,0x5469,0x546A,0x546B,0x546C,0x546D,0x546E,0x546F, +0x5470,0x5474,0x5479,0x547A,0x547E,0x547F,0x5481,0x5483, +0x5485,0x5487,0x5488,0x5489,0x548A,0x548D,0x5491,0x5493, +0x5497,0x5498,0x549C,0x549E,0x549F,0x54A0,0x54A1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x54A2,0x54A5,0x54AE,0x54B0,0x54B2,0x54B5,0x54B6,0x54B7, +0x54B9,0x54BA,0x54BC,0x54BE,0x54C3,0x54C5,0x54CA,0x54CB, +0x54D6,0x54D8,0x54DB,0x54E0,0x54E1,0x54E2,0x54E3,0x54E4, +0x54EB,0x54EC,0x54EF,0x54F0,0x54F1,0x54F4,0x54F5,0x54F6, +0x54F7,0x54F8,0x54F9,0x54FB,0x54FE,0x5500,0x5502,0x5503, +0x5504,0x5505,0x5508,0x550A,0x550B,0x550C,0x550D,0x550E, +0x5512,0x5513,0x5515,0x5516,0x5517,0x5518,0x5519,0x551A, +0x551C,0x551D,0x551E,0x551F,0x5521,0x5525,0x5526, 0, +0x5528,0x5529,0x552B,0x552D,0x5532,0x5534,0x5535,0x5536, +0x5538,0x5539,0x553A,0x553B,0x553D,0x5540,0x5542,0x5545, +0x5547,0x5548,0x554B,0x554C,0x554D,0x554E,0x554F,0x5551, +0x5552,0x5553,0x5554,0x5557,0x5558,0x5559,0x555A,0x555B, +0x555D,0x555E,0x555F,0x5560,0x5562,0x5563,0x5568,0x5569, +0x556B,0x556F,0x5570,0x5571,0x5572,0x5573,0x5574,0x5579, +0x557A,0x557D,0x557F,0x5585,0x5586,0x558C,0x558D,0x558E, +0x5590,0x5592,0x5593,0x5595,0x5596,0x5597,0x559A,0x559B, +0x559E,0x55A0,0x55A1,0x55A2,0x55A3,0x55A4,0x55A5,0x55A6, +0x55A8,0x55A9,0x55AA,0x55AB,0x55AC,0x55AD,0x55AE,0x55AF, +0x55B0,0x55B2,0x55B4,0x55B6,0x55B8,0x55BA,0x55BC,0x55BF, +0x55C0,0x55C1,0x55C2,0x55C3,0x55C6,0x55C7,0x55C8,0x55CA, +0x55CB,0x55CE,0x55CF,0x55D0,0x55D5,0x55D7,0x55D8,0x55D9, +0x55DA,0x55DB,0x55DE,0x55E0,0x55E2,0x55E7,0x55E9,0x55ED, +0x55EE,0x55F0,0x55F1,0x55F4,0x55F6,0x55F8,0x55F9,0x55FA, +0x55FB,0x55FC,0x55FF,0x5602,0x5603,0x5604,0x5605, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5606,0x5607,0x560A,0x560B,0x560D,0x5610,0x5611,0x5612, +0x5613,0x5614,0x5615,0x5616,0x5617,0x5619,0x561A,0x561C, +0x561D,0x5620,0x5621,0x5622,0x5625,0x5626,0x5628,0x5629, +0x562A,0x562B,0x562E,0x562F,0x5630,0x5633,0x5635,0x5637, +0x5638,0x563A,0x563C,0x563D,0x563E,0x5640,0x5641,0x5642, +0x5643,0x5644,0x5645,0x5646,0x5647,0x5648,0x5649,0x564A, +0x564B,0x564F,0x5650,0x5651,0x5652,0x5653,0x5655,0x5656, +0x565A,0x565B,0x565D,0x565E,0x565F,0x5660,0x5661, 0, +0x5663,0x5665,0x5666,0x5667,0x566D,0x566E,0x566F,0x5670, +0x5672,0x5673,0x5674,0x5675,0x5677,0x5678,0x5679,0x567A, +0x567D,0x567E,0x567F,0x5680,0x5681,0x5682,0x5683,0x5684, +0x5687,0x5688,0x5689,0x568A,0x568B,0x568C,0x568D,0x5690, +0x5691,0x5692,0x5694,0x5695,0x5696,0x5697,0x5698,0x5699, +0x569A,0x569B,0x569C,0x569D,0x569E,0x569F,0x56A0,0x56A1, +0x56A2,0x56A4,0x56A5,0x56A6,0x56A7,0x56A8,0x56A9,0x56AA, +0x56AB,0x56AC,0x56AD,0x56AE,0x56B0,0x56B1,0x56B2,0x56B3, +0x56B4,0x56B5,0x56B6,0x56B8,0x56B9,0x56BA,0x56BB,0x56BD, +0x56BE,0x56BF,0x56C0,0x56C1,0x56C2,0x56C3,0x56C4,0x56C5, +0x56C6,0x56C7,0x56C8,0x56C9,0x56CB,0x56CC,0x56CD,0x56CE, +0x56CF,0x56D0,0x56D1,0x56D2,0x56D3,0x56D5,0x56D6,0x56D8, +0x56D9,0x56DC,0x56E3,0x56E5,0x56E6,0x56E7,0x56E8,0x56E9, +0x56EA,0x56EC,0x56EE,0x56EF,0x56F2,0x56F3,0x56F6,0x56F7, +0x56F8,0x56FB,0x56FC,0x5700,0x5701,0x5702,0x5705,0x5707, +0x570B,0x570C,0x570D,0x570E,0x570F,0x5710,0x5711, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5712,0x5713,0x5714,0x5715,0x5716,0x5717,0x5718,0x5719, +0x571A,0x571B,0x571D,0x571E,0x5720,0x5721,0x5722,0x5724, +0x5725,0x5726,0x5727,0x572B,0x5731,0x5732,0x5734,0x5735, +0x5736,0x5737,0x5738,0x573C,0x573D,0x573F,0x5741,0x5743, +0x5744,0x5745,0x5746,0x5748,0x5749,0x574B,0x5752,0x5753, +0x5754,0x5755,0x5756,0x5758,0x5759,0x5762,0x5763,0x5765, +0x5767,0x576C,0x576E,0x5770,0x5771,0x5772,0x5774,0x5775, +0x5778,0x5779,0x577A,0x577D,0x577E,0x577F,0x5780, 0, +0x5781,0x5787,0x5788,0x5789,0x578A,0x578D,0x578E,0x578F, +0x5790,0x5791,0x5794,0x5795,0x5796,0x5797,0x5798,0x5799, +0x579A,0x579C,0x579D,0x579E,0x579F,0x57A5,0x57A8,0x57AA, +0x57AC,0x57AF,0x57B0,0x57B1,0x57B3,0x57B5,0x57B6,0x57B7, +0x57B9,0x57BA,0x57BB,0x57BC,0x57BD,0x57BE,0x57BF,0x57C0, +0x57C1,0x57C4,0x57C5,0x57C6,0x57C7,0x57C8,0x57C9,0x57CA, +0x57CC,0x57CD,0x57D0,0x57D1,0x57D3,0x57D6,0x57D7,0x57DB, +0x57DC,0x57DE,0x57E1,0x57E2,0x57E3,0x57E5,0x57E6,0x57E7, +0x57E8,0x57E9,0x57EA,0x57EB,0x57EC,0x57EE,0x57F0,0x57F1, +0x57F2,0x57F3,0x57F5,0x57F6,0x57F7,0x57FB,0x57FC,0x57FE, +0x57FF,0x5801,0x5803,0x5804,0x5805,0x5808,0x5809,0x580A, +0x580C,0x580E,0x580F,0x5810,0x5812,0x5813,0x5814,0x5816, +0x5817,0x5818,0x581A,0x581B,0x581C,0x581D,0x581F,0x5822, +0x5823,0x5825,0x5826,0x5827,0x5828,0x5829,0x582B,0x582C, +0x582D,0x582E,0x582F,0x5831,0x5832,0x5833,0x5834,0x5836, +0x5837,0x5838,0x5839,0x583A,0x583B,0x583C,0x583D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x583E,0x583F,0x5840,0x5841,0x5842,0x5843,0x5845,0x5846, +0x5847,0x5848,0x5849,0x584A,0x584B,0x584E,0x584F,0x5850, +0x5852,0x5853,0x5855,0x5856,0x5857,0x5859,0x585A,0x585B, +0x585C,0x585D,0x585F,0x5860,0x5861,0x5862,0x5863,0x5864, +0x5866,0x5867,0x5868,0x5869,0x586A,0x586D,0x586E,0x586F, +0x5870,0x5871,0x5872,0x5873,0x5874,0x5875,0x5876,0x5877, +0x5878,0x5879,0x587A,0x587B,0x587C,0x587D,0x587F,0x5882, +0x5884,0x5886,0x5887,0x5888,0x588A,0x588B,0x588C, 0, +0x588D,0x588E,0x588F,0x5890,0x5891,0x5894,0x5895,0x5896, +0x5897,0x5898,0x589B,0x589C,0x589D,0x58A0,0x58A1,0x58A2, +0x58A3,0x58A4,0x58A5,0x58A6,0x58A7,0x58AA,0x58AB,0x58AC, +0x58AD,0x58AE,0x58AF,0x58B0,0x58B1,0x58B2,0x58B3,0x58B4, +0x58B5,0x58B6,0x58B7,0x58B8,0x58B9,0x58BA,0x58BB,0x58BD, +0x58BE,0x58BF,0x58C0,0x58C2,0x58C3,0x58C4,0x58C6,0x58C7, +0x58C8,0x58C9,0x58CA,0x58CB,0x58CC,0x58CD,0x58CE,0x58CF, +0x58D0,0x58D2,0x58D3,0x58D4,0x58D6,0x58D7,0x58D8,0x58D9, +0x58DA,0x58DB,0x58DC,0x58DD,0x58DE,0x58DF,0x58E0,0x58E1, +0x58E2,0x58E3,0x58E5,0x58E6,0x58E7,0x58E8,0x58E9,0x58EA, +0x58ED,0x58EF,0x58F1,0x58F2,0x58F4,0x58F5,0x58F7,0x58F8, +0x58FA,0x58FB,0x58FC,0x58FD,0x58FE,0x58FF,0x5900,0x5901, +0x5903,0x5905,0x5906,0x5908,0x5909,0x590A,0x590B,0x590C, +0x590E,0x5910,0x5911,0x5912,0x5913,0x5917,0x5918,0x591B, +0x591D,0x591E,0x5920,0x5921,0x5922,0x5923,0x5926,0x5928, +0x592C,0x5930,0x5932,0x5933,0x5935,0x5936,0x593B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x593D,0x593E,0x593F,0x5940,0x5943,0x5945,0x5946,0x594A, +0x594C,0x594D,0x5950,0x5952,0x5953,0x5959,0x595B,0x595C, +0x595D,0x595E,0x595F,0x5961,0x5963,0x5964,0x5966,0x5967, +0x5968,0x5969,0x596A,0x596B,0x596C,0x596D,0x596E,0x596F, +0x5970,0x5971,0x5972,0x5975,0x5977,0x597A,0x597B,0x597C, +0x597E,0x597F,0x5980,0x5985,0x5989,0x598B,0x598C,0x598E, +0x598F,0x5990,0x5991,0x5994,0x5995,0x5998,0x599A,0x599B, +0x599C,0x599D,0x599F,0x59A0,0x59A1,0x59A2,0x59A6, 0, +0x59A7,0x59AC,0x59AD,0x59B0,0x59B1,0x59B3,0x59B4,0x59B5, +0x59B6,0x59B7,0x59B8,0x59BA,0x59BC,0x59BD,0x59BF,0x59C0, +0x59C1,0x59C2,0x59C3,0x59C4,0x59C5,0x59C7,0x59C8,0x59C9, +0x59CC,0x59CD,0x59CE,0x59CF,0x59D5,0x59D6,0x59D9,0x59DB, +0x59DE,0x59DF,0x59E0,0x59E1,0x59E2,0x59E4,0x59E6,0x59E7, +0x59E9,0x59EA,0x59EB,0x59ED,0x59EE,0x59EF,0x59F0,0x59F1, +0x59F2,0x59F3,0x59F4,0x59F5,0x59F6,0x59F7,0x59F8,0x59FA, +0x59FC,0x59FD,0x59FE,0x5A00,0x5A02,0x5A0A,0x5A0B,0x5A0D, +0x5A0E,0x5A0F,0x5A10,0x5A12,0x5A14,0x5A15,0x5A16,0x5A17, +0x5A19,0x5A1A,0x5A1B,0x5A1D,0x5A1E,0x5A21,0x5A22,0x5A24, +0x5A26,0x5A27,0x5A28,0x5A2A,0x5A2B,0x5A2C,0x5A2D,0x5A2E, +0x5A2F,0x5A30,0x5A33,0x5A35,0x5A37,0x5A38,0x5A39,0x5A3A, +0x5A3B,0x5A3D,0x5A3E,0x5A3F,0x5A41,0x5A42,0x5A43,0x5A44, +0x5A45,0x5A47,0x5A48,0x5A4B,0x5A4C,0x5A4D,0x5A4E,0x5A4F, +0x5A50,0x5A51,0x5A52,0x5A53,0x5A54,0x5A56,0x5A57,0x5A58, +0x5A59,0x5A5B,0x5A5C,0x5A5D,0x5A5E,0x5A5F,0x5A60, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5A61,0x5A63,0x5A64,0x5A65,0x5A66,0x5A68,0x5A69,0x5A6B, +0x5A6C,0x5A6D,0x5A6E,0x5A6F,0x5A70,0x5A71,0x5A72,0x5A73, +0x5A78,0x5A79,0x5A7B,0x5A7C,0x5A7D,0x5A7E,0x5A80,0x5A81, +0x5A82,0x5A83,0x5A84,0x5A85,0x5A86,0x5A87,0x5A88,0x5A89, +0x5A8A,0x5A8B,0x5A8C,0x5A8D,0x5A8E,0x5A8F,0x5A90,0x5A91, +0x5A93,0x5A94,0x5A95,0x5A96,0x5A97,0x5A98,0x5A99,0x5A9C, +0x5A9D,0x5A9E,0x5A9F,0x5AA0,0x5AA1,0x5AA2,0x5AA3,0x5AA4, +0x5AA5,0x5AA6,0x5AA7,0x5AA8,0x5AA9,0x5AAB,0x5AAC, 0, +0x5AAD,0x5AAE,0x5AAF,0x5AB0,0x5AB1,0x5AB4,0x5AB6,0x5AB7, +0x5AB9,0x5ABA,0x5ABB,0x5ABC,0x5ABD,0x5ABF,0x5AC0,0x5AC3, +0x5AC4,0x5AC5,0x5AC6,0x5AC7,0x5AC8,0x5ACA,0x5ACB,0x5ACD, +0x5ACE,0x5ACF,0x5AD0,0x5AD1,0x5AD3,0x5AD5,0x5AD7,0x5AD9, +0x5ADA,0x5ADB,0x5ADD,0x5ADE,0x5ADF,0x5AE2,0x5AE4,0x5AE5, +0x5AE7,0x5AE8,0x5AEA,0x5AEC,0x5AED,0x5AEE,0x5AEF,0x5AF0, +0x5AF2,0x5AF3,0x5AF4,0x5AF5,0x5AF6,0x5AF7,0x5AF8,0x5AF9, +0x5AFA,0x5AFB,0x5AFC,0x5AFD,0x5AFE,0x5AFF,0x5B00,0x5B01, +0x5B02,0x5B03,0x5B04,0x5B05,0x5B06,0x5B07,0x5B08,0x5B0A, +0x5B0B,0x5B0C,0x5B0D,0x5B0E,0x5B0F,0x5B10,0x5B11,0x5B12, +0x5B13,0x5B14,0x5B15,0x5B18,0x5B19,0x5B1A,0x5B1B,0x5B1C, +0x5B1D,0x5B1E,0x5B1F,0x5B20,0x5B21,0x5B22,0x5B23,0x5B24, +0x5B25,0x5B26,0x5B27,0x5B28,0x5B29,0x5B2A,0x5B2B,0x5B2C, +0x5B2D,0x5B2E,0x5B2F,0x5B30,0x5B31,0x5B33,0x5B35,0x5B36, +0x5B38,0x5B39,0x5B3A,0x5B3B,0x5B3C,0x5B3D,0x5B3E,0x5B3F, +0x5B41,0x5B42,0x5B43,0x5B44,0x5B45,0x5B46,0x5B47, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5B48,0x5B49,0x5B4A,0x5B4B,0x5B4C,0x5B4D,0x5B4E,0x5B4F, +0x5B52,0x5B56,0x5B5E,0x5B60,0x5B61,0x5B67,0x5B68,0x5B6B, +0x5B6D,0x5B6E,0x5B6F,0x5B72,0x5B74,0x5B76,0x5B77,0x5B78, +0x5B79,0x5B7B,0x5B7C,0x5B7E,0x5B7F,0x5B82,0x5B86,0x5B8A, +0x5B8D,0x5B8E,0x5B90,0x5B91,0x5B92,0x5B94,0x5B96,0x5B9F, +0x5BA7,0x5BA8,0x5BA9,0x5BAC,0x5BAD,0x5BAE,0x5BAF,0x5BB1, +0x5BB2,0x5BB7,0x5BBA,0x5BBB,0x5BBC,0x5BC0,0x5BC1,0x5BC3, +0x5BC8,0x5BC9,0x5BCA,0x5BCB,0x5BCD,0x5BCE,0x5BCF, 0, +0x5BD1,0x5BD4,0x5BD5,0x5BD6,0x5BD7,0x5BD8,0x5BD9,0x5BDA, +0x5BDB,0x5BDC,0x5BE0,0x5BE2,0x5BE3,0x5BE6,0x5BE7,0x5BE9, +0x5BEA,0x5BEB,0x5BEC,0x5BED,0x5BEF,0x5BF1,0x5BF2,0x5BF3, +0x5BF4,0x5BF5,0x5BF6,0x5BF7,0x5BFD,0x5BFE,0x5C00,0x5C02, +0x5C03,0x5C05,0x5C07,0x5C08,0x5C0B,0x5C0C,0x5C0D,0x5C0E, +0x5C10,0x5C12,0x5C13,0x5C17,0x5C19,0x5C1B,0x5C1E,0x5C1F, +0x5C20,0x5C21,0x5C23,0x5C26,0x5C28,0x5C29,0x5C2A,0x5C2B, +0x5C2D,0x5C2E,0x5C2F,0x5C30,0x5C32,0x5C33,0x5C35,0x5C36, +0x5C37,0x5C43,0x5C44,0x5C46,0x5C47,0x5C4C,0x5C4D,0x5C52, +0x5C53,0x5C54,0x5C56,0x5C57,0x5C58,0x5C5A,0x5C5B,0x5C5C, +0x5C5D,0x5C5F,0x5C62,0x5C64,0x5C67,0x5C68,0x5C69,0x5C6A, +0x5C6B,0x5C6C,0x5C6D,0x5C70,0x5C72,0x5C73,0x5C74,0x5C75, +0x5C76,0x5C77,0x5C78,0x5C7B,0x5C7C,0x5C7D,0x5C7E,0x5C80, +0x5C83,0x5C84,0x5C85,0x5C86,0x5C87,0x5C89,0x5C8A,0x5C8B, +0x5C8E,0x5C8F,0x5C92,0x5C93,0x5C95,0x5C9D,0x5C9E,0x5C9F, +0x5CA0,0x5CA1,0x5CA4,0x5CA5,0x5CA6,0x5CA7,0x5CA8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5CAA,0x5CAE,0x5CAF,0x5CB0,0x5CB2,0x5CB4,0x5CB6,0x5CB9, +0x5CBA,0x5CBB,0x5CBC,0x5CBE,0x5CC0,0x5CC2,0x5CC3,0x5CC5, +0x5CC6,0x5CC7,0x5CC8,0x5CC9,0x5CCA,0x5CCC,0x5CCD,0x5CCE, +0x5CCF,0x5CD0,0x5CD1,0x5CD3,0x5CD4,0x5CD5,0x5CD6,0x5CD7, +0x5CD8,0x5CDA,0x5CDB,0x5CDC,0x5CDD,0x5CDE,0x5CDF,0x5CE0, +0x5CE2,0x5CE3,0x5CE7,0x5CE9,0x5CEB,0x5CEC,0x5CEE,0x5CEF, +0x5CF1,0x5CF2,0x5CF3,0x5CF4,0x5CF5,0x5CF6,0x5CF7,0x5CF8, +0x5CF9,0x5CFA,0x5CFC,0x5CFD,0x5CFE,0x5CFF,0x5D00, 0, +0x5D01,0x5D04,0x5D05,0x5D08,0x5D09,0x5D0A,0x5D0B,0x5D0C, +0x5D0D,0x5D0F,0x5D10,0x5D11,0x5D12,0x5D13,0x5D15,0x5D17, +0x5D18,0x5D19,0x5D1A,0x5D1C,0x5D1D,0x5D1F,0x5D20,0x5D21, +0x5D22,0x5D23,0x5D25,0x5D28,0x5D2A,0x5D2B,0x5D2C,0x5D2F, +0x5D30,0x5D31,0x5D32,0x5D33,0x5D35,0x5D36,0x5D37,0x5D38, +0x5D39,0x5D3A,0x5D3B,0x5D3C,0x5D3F,0x5D40,0x5D41,0x5D42, +0x5D43,0x5D44,0x5D45,0x5D46,0x5D48,0x5D49,0x5D4D,0x5D4E, +0x5D4F,0x5D50,0x5D51,0x5D52,0x5D53,0x5D54,0x5D55,0x5D56, +0x5D57,0x5D59,0x5D5A,0x5D5C,0x5D5E,0x5D5F,0x5D60,0x5D61, +0x5D62,0x5D63,0x5D64,0x5D65,0x5D66,0x5D67,0x5D68,0x5D6A, +0x5D6D,0x5D6E,0x5D70,0x5D71,0x5D72,0x5D73,0x5D75,0x5D76, +0x5D77,0x5D78,0x5D79,0x5D7A,0x5D7B,0x5D7C,0x5D7D,0x5D7E, +0x5D7F,0x5D80,0x5D81,0x5D83,0x5D84,0x5D85,0x5D86,0x5D87, +0x5D88,0x5D89,0x5D8A,0x5D8B,0x5D8C,0x5D8D,0x5D8E,0x5D8F, +0x5D90,0x5D91,0x5D92,0x5D93,0x5D94,0x5D95,0x5D96,0x5D97, +0x5D98,0x5D9A,0x5D9B,0x5D9C,0x5D9E,0x5D9F,0x5DA0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5DA1,0x5DA2,0x5DA3,0x5DA4,0x5DA5,0x5DA6,0x5DA7,0x5DA8, +0x5DA9,0x5DAA,0x5DAB,0x5DAC,0x5DAD,0x5DAE,0x5DAF,0x5DB0, +0x5DB1,0x5DB2,0x5DB3,0x5DB4,0x5DB5,0x5DB6,0x5DB8,0x5DB9, +0x5DBA,0x5DBB,0x5DBC,0x5DBD,0x5DBE,0x5DBF,0x5DC0,0x5DC1, +0x5DC2,0x5DC3,0x5DC4,0x5DC6,0x5DC7,0x5DC8,0x5DC9,0x5DCA, +0x5DCB,0x5DCC,0x5DCE,0x5DCF,0x5DD0,0x5DD1,0x5DD2,0x5DD3, +0x5DD4,0x5DD5,0x5DD6,0x5DD7,0x5DD8,0x5DD9,0x5DDA,0x5DDC, +0x5DDF,0x5DE0,0x5DE3,0x5DE4,0x5DEA,0x5DEC,0x5DED, 0, +0x5DF0,0x5DF5,0x5DF6,0x5DF8,0x5DF9,0x5DFA,0x5DFB,0x5DFC, +0x5DFF,0x5E00,0x5E04,0x5E07,0x5E09,0x5E0A,0x5E0B,0x5E0D, +0x5E0E,0x5E12,0x5E13,0x5E17,0x5E1E,0x5E1F,0x5E20,0x5E21, +0x5E22,0x5E23,0x5E24,0x5E25,0x5E28,0x5E29,0x5E2A,0x5E2B, +0x5E2C,0x5E2F,0x5E30,0x5E32,0x5E33,0x5E34,0x5E35,0x5E36, +0x5E39,0x5E3A,0x5E3E,0x5E3F,0x5E40,0x5E41,0x5E43,0x5E46, +0x5E47,0x5E48,0x5E49,0x5E4A,0x5E4B,0x5E4D,0x5E4E,0x5E4F, +0x5E50,0x5E51,0x5E52,0x5E53,0x5E56,0x5E57,0x5E58,0x5E59, +0x5E5A,0x5E5C,0x5E5D,0x5E5F,0x5E60,0x5E63,0x5E64,0x5E65, +0x5E66,0x5E67,0x5E68,0x5E69,0x5E6A,0x5E6B,0x5E6C,0x5E6D, +0x5E6E,0x5E6F,0x5E70,0x5E71,0x5E75,0x5E77,0x5E79,0x5E7E, +0x5E81,0x5E82,0x5E83,0x5E85,0x5E88,0x5E89,0x5E8C,0x5E8D, +0x5E8E,0x5E92,0x5E98,0x5E9B,0x5E9D,0x5EA1,0x5EA2,0x5EA3, +0x5EA4,0x5EA8,0x5EA9,0x5EAA,0x5EAB,0x5EAC,0x5EAE,0x5EAF, +0x5EB0,0x5EB1,0x5EB2,0x5EB4,0x5EBA,0x5EBB,0x5EBC,0x5EBD, +0x5EBF,0x5EC0,0x5EC1,0x5EC2,0x5EC3,0x5EC4,0x5EC5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5EC6,0x5EC7,0x5EC8,0x5ECB,0x5ECC,0x5ECD,0x5ECE,0x5ECF, +0x5ED0,0x5ED4,0x5ED5,0x5ED7,0x5ED8,0x5ED9,0x5EDA,0x5EDC, +0x5EDD,0x5EDE,0x5EDF,0x5EE0,0x5EE1,0x5EE2,0x5EE3,0x5EE4, +0x5EE5,0x5EE6,0x5EE7,0x5EE9,0x5EEB,0x5EEC,0x5EED,0x5EEE, +0x5EEF,0x5EF0,0x5EF1,0x5EF2,0x5EF3,0x5EF5,0x5EF8,0x5EF9, +0x5EFB,0x5EFC,0x5EFD,0x5F05,0x5F06,0x5F07,0x5F09,0x5F0C, +0x5F0D,0x5F0E,0x5F10,0x5F12,0x5F14,0x5F16,0x5F19,0x5F1A, +0x5F1C,0x5F1D,0x5F1E,0x5F21,0x5F22,0x5F23,0x5F24, 0, +0x5F28,0x5F2B,0x5F2C,0x5F2E,0x5F30,0x5F32,0x5F33,0x5F34, +0x5F35,0x5F36,0x5F37,0x5F38,0x5F3B,0x5F3D,0x5F3E,0x5F3F, +0x5F41,0x5F42,0x5F43,0x5F44,0x5F45,0x5F46,0x5F47,0x5F48, +0x5F49,0x5F4A,0x5F4B,0x5F4C,0x5F4D,0x5F4E,0x5F4F,0x5F51, +0x5F54,0x5F59,0x5F5A,0x5F5B,0x5F5C,0x5F5E,0x5F5F,0x5F60, +0x5F63,0x5F65,0x5F67,0x5F68,0x5F6B,0x5F6E,0x5F6F,0x5F72, +0x5F74,0x5F75,0x5F76,0x5F78,0x5F7A,0x5F7D,0x5F7E,0x5F7F, +0x5F83,0x5F86,0x5F8D,0x5F8E,0x5F8F,0x5F91,0x5F93,0x5F94, +0x5F96,0x5F9A,0x5F9B,0x5F9D,0x5F9E,0x5F9F,0x5FA0,0x5FA2, +0x5FA3,0x5FA4,0x5FA5,0x5FA6,0x5FA7,0x5FA9,0x5FAB,0x5FAC, +0x5FAF,0x5FB0,0x5FB1,0x5FB2,0x5FB3,0x5FB4,0x5FB6,0x5FB8, +0x5FB9,0x5FBA,0x5FBB,0x5FBE,0x5FBF,0x5FC0,0x5FC1,0x5FC2, +0x5FC7,0x5FC8,0x5FCA,0x5FCB,0x5FCE,0x5FD3,0x5FD4,0x5FD5, +0x5FDA,0x5FDB,0x5FDC,0x5FDE,0x5FDF,0x5FE2,0x5FE3,0x5FE5, +0x5FE6,0x5FE8,0x5FE9,0x5FEC,0x5FEF,0x5FF0,0x5FF2,0x5FF3, +0x5FF4,0x5FF6,0x5FF7,0x5FF9,0x5FFA,0x5FFC,0x6007, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6008,0x6009,0x600B,0x600C,0x6010,0x6011,0x6013,0x6017, +0x6018,0x601A,0x601E,0x601F,0x6022,0x6023,0x6024,0x602C, +0x602D,0x602E,0x6030,0x6031,0x6032,0x6033,0x6034,0x6036, +0x6037,0x6038,0x6039,0x603A,0x603D,0x603E,0x6040,0x6044, +0x6045,0x6046,0x6047,0x6048,0x6049,0x604A,0x604C,0x604E, +0x604F,0x6051,0x6053,0x6054,0x6056,0x6057,0x6058,0x605B, +0x605C,0x605E,0x605F,0x6060,0x6061,0x6065,0x6066,0x606E, +0x6071,0x6072,0x6074,0x6075,0x6077,0x607E,0x6080, 0, +0x6081,0x6082,0x6085,0x6086,0x6087,0x6088,0x608A,0x608B, +0x608E,0x608F,0x6090,0x6091,0x6093,0x6095,0x6097,0x6098, +0x6099,0x609C,0x609E,0x60A1,0x60A2,0x60A4,0x60A5,0x60A7, +0x60A9,0x60AA,0x60AE,0x60B0,0x60B3,0x60B5,0x60B6,0x60B7, +0x60B9,0x60BA,0x60BD,0x60BE,0x60BF,0x60C0,0x60C1,0x60C2, +0x60C3,0x60C4,0x60C7,0x60C8,0x60C9,0x60CC,0x60CD,0x60CE, +0x60CF,0x60D0,0x60D2,0x60D3,0x60D4,0x60D6,0x60D7,0x60D9, +0x60DB,0x60DE,0x60E1,0x60E2,0x60E3,0x60E4,0x60E5,0x60EA, +0x60F1,0x60F2,0x60F5,0x60F7,0x60F8,0x60FB,0x60FC,0x60FD, +0x60FE,0x60FF,0x6102,0x6103,0x6104,0x6105,0x6107,0x610A, +0x610B,0x610C,0x6110,0x6111,0x6112,0x6113,0x6114,0x6116, +0x6117,0x6118,0x6119,0x611B,0x611C,0x611D,0x611E,0x6121, +0x6122,0x6125,0x6128,0x6129,0x612A,0x612C,0x612D,0x612E, +0x612F,0x6130,0x6131,0x6132,0x6133,0x6134,0x6135,0x6136, +0x6137,0x6138,0x6139,0x613A,0x613B,0x613C,0x613D,0x613E, +0x6140,0x6141,0x6142,0x6143,0x6144,0x6145,0x6146, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6147,0x6149,0x614B,0x614D,0x614F,0x6150,0x6152,0x6153, +0x6154,0x6156,0x6157,0x6158,0x6159,0x615A,0x615B,0x615C, +0x615E,0x615F,0x6160,0x6161,0x6163,0x6164,0x6165,0x6166, +0x6169,0x616A,0x616B,0x616C,0x616D,0x616E,0x616F,0x6171, +0x6172,0x6173,0x6174,0x6176,0x6178,0x6179,0x617A,0x617B, +0x617C,0x617D,0x617E,0x617F,0x6180,0x6181,0x6182,0x6183, +0x6184,0x6185,0x6186,0x6187,0x6188,0x6189,0x618A,0x618C, +0x618D,0x618F,0x6190,0x6191,0x6192,0x6193,0x6195, 0, +0x6196,0x6197,0x6198,0x6199,0x619A,0x619B,0x619C,0x619E, +0x619F,0x61A0,0x61A1,0x61A2,0x61A3,0x61A4,0x61A5,0x61A6, +0x61AA,0x61AB,0x61AD,0x61AE,0x61AF,0x61B0,0x61B1,0x61B2, +0x61B3,0x61B4,0x61B5,0x61B6,0x61B8,0x61B9,0x61BA,0x61BB, +0x61BC,0x61BD,0x61BF,0x61C0,0x61C1,0x61C3,0x61C4,0x61C5, +0x61C6,0x61C7,0x61C9,0x61CC,0x61CD,0x61CE,0x61CF,0x61D0, +0x61D3,0x61D5,0x61D6,0x61D7,0x61D8,0x61D9,0x61DA,0x61DB, +0x61DC,0x61DD,0x61DE,0x61DF,0x61E0,0x61E1,0x61E2,0x61E3, +0x61E4,0x61E5,0x61E7,0x61E8,0x61E9,0x61EA,0x61EB,0x61EC, +0x61ED,0x61EE,0x61EF,0x61F0,0x61F1,0x61F2,0x61F3,0x61F4, +0x61F6,0x61F7,0x61F8,0x61F9,0x61FA,0x61FB,0x61FC,0x61FD, +0x61FE,0x6200,0x6201,0x6202,0x6203,0x6204,0x6205,0x6207, +0x6209,0x6213,0x6214,0x6219,0x621C,0x621D,0x621E,0x6220, +0x6223,0x6226,0x6227,0x6228,0x6229,0x622B,0x622D,0x622F, +0x6230,0x6231,0x6232,0x6235,0x6236,0x6238,0x6239,0x623A, +0x623B,0x623C,0x6242,0x6244,0x6245,0x6246,0x624A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x624F,0x6250,0x6255,0x6256,0x6257,0x6259,0x625A,0x625C, +0x625D,0x625E,0x625F,0x6260,0x6261,0x6262,0x6264,0x6265, +0x6268,0x6271,0x6272,0x6274,0x6275,0x6277,0x6278,0x627A, +0x627B,0x627D,0x6281,0x6282,0x6283,0x6285,0x6286,0x6287, +0x6288,0x628B,0x628C,0x628D,0x628E,0x628F,0x6290,0x6294, +0x6299,0x629C,0x629D,0x629E,0x62A3,0x62A6,0x62A7,0x62A9, +0x62AA,0x62AD,0x62AE,0x62AF,0x62B0,0x62B2,0x62B3,0x62B4, +0x62B6,0x62B7,0x62B8,0x62BA,0x62BE,0x62C0,0x62C1, 0, +0x62C3,0x62CB,0x62CF,0x62D1,0x62D5,0x62DD,0x62DE,0x62E0, +0x62E1,0x62E4,0x62EA,0x62EB,0x62F0,0x62F2,0x62F5,0x62F8, +0x62F9,0x62FA,0x62FB,0x6300,0x6303,0x6304,0x6305,0x6306, +0x630A,0x630B,0x630C,0x630D,0x630F,0x6310,0x6312,0x6313, +0x6314,0x6315,0x6317,0x6318,0x6319,0x631C,0x6326,0x6327, +0x6329,0x632C,0x632D,0x632E,0x6330,0x6331,0x6333,0x6334, +0x6335,0x6336,0x6337,0x6338,0x633B,0x633C,0x633E,0x633F, +0x6340,0x6341,0x6344,0x6347,0x6348,0x634A,0x6351,0x6352, +0x6353,0x6354,0x6356,0x6357,0x6358,0x6359,0x635A,0x635B, +0x635C,0x635D,0x6360,0x6364,0x6365,0x6366,0x6368,0x636A, +0x636B,0x636C,0x636F,0x6370,0x6372,0x6373,0x6374,0x6375, +0x6378,0x6379,0x637C,0x637D,0x637E,0x637F,0x6381,0x6383, +0x6384,0x6385,0x6386,0x638B,0x638D,0x6391,0x6393,0x6394, +0x6395,0x6397,0x6399,0x639A,0x639B,0x639C,0x639D,0x639E, +0x639F,0x63A1,0x63A4,0x63A6,0x63AB,0x63AF,0x63B1,0x63B2, +0x63B5,0x63B6,0x63B9,0x63BB,0x63BD,0x63BF,0x63C0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x63C1,0x63C2,0x63C3,0x63C5,0x63C7,0x63C8,0x63CA,0x63CB, +0x63CC,0x63D1,0x63D3,0x63D4,0x63D5,0x63D7,0x63D8,0x63D9, +0x63DA,0x63DB,0x63DC,0x63DD,0x63DF,0x63E2,0x63E4,0x63E5, +0x63E6,0x63E7,0x63E8,0x63EB,0x63EC,0x63EE,0x63EF,0x63F0, +0x63F1,0x63F3,0x63F5,0x63F7,0x63F9,0x63FA,0x63FB,0x63FC, +0x63FE,0x6403,0x6404,0x6406,0x6407,0x6408,0x6409,0x640A, +0x640D,0x640E,0x6411,0x6412,0x6415,0x6416,0x6417,0x6418, +0x6419,0x641A,0x641D,0x641F,0x6422,0x6423,0x6424, 0, +0x6425,0x6427,0x6428,0x6429,0x642B,0x642E,0x642F,0x6430, +0x6431,0x6432,0x6433,0x6435,0x6436,0x6437,0x6438,0x6439, +0x643B,0x643C,0x643E,0x6440,0x6442,0x6443,0x6449,0x644B, +0x644C,0x644D,0x644E,0x644F,0x6450,0x6451,0x6453,0x6455, +0x6456,0x6457,0x6459,0x645A,0x645B,0x645C,0x645D,0x645F, +0x6460,0x6461,0x6462,0x6463,0x6464,0x6465,0x6466,0x6468, +0x646A,0x646B,0x646C,0x646E,0x646F,0x6470,0x6471,0x6472, +0x6473,0x6474,0x6475,0x6476,0x6477,0x647B,0x647C,0x647D, +0x647E,0x647F,0x6480,0x6481,0x6483,0x6486,0x6488,0x6489, +0x648A,0x648B,0x648C,0x648D,0x648E,0x648F,0x6490,0x6493, +0x6494,0x6497,0x6498,0x649A,0x649B,0x649C,0x649D,0x649F, +0x64A0,0x64A1,0x64A2,0x64A3,0x64A5,0x64A6,0x64A7,0x64A8, +0x64AA,0x64AB,0x64AF,0x64B1,0x64B2,0x64B3,0x64B4,0x64B6, +0x64B9,0x64BB,0x64BD,0x64BE,0x64BF,0x64C1,0x64C3,0x64C4, +0x64C6,0x64C7,0x64C8,0x64C9,0x64CA,0x64CB,0x64CC,0x64CF, +0x64D1,0x64D3,0x64D4,0x64D5,0x64D6,0x64D9,0x64DA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x64DB,0x64DC,0x64DD,0x64DF,0x64E0,0x64E1,0x64E3,0x64E5, +0x64E7,0x64E8,0x64E9,0x64EA,0x64EB,0x64EC,0x64ED,0x64EE, +0x64EF,0x64F0,0x64F1,0x64F2,0x64F3,0x64F4,0x64F5,0x64F6, +0x64F7,0x64F8,0x64F9,0x64FA,0x64FB,0x64FC,0x64FD,0x64FE, +0x64FF,0x6501,0x6502,0x6503,0x6504,0x6505,0x6506,0x6507, +0x6508,0x650A,0x650B,0x650C,0x650D,0x650E,0x650F,0x6510, +0x6511,0x6513,0x6514,0x6515,0x6516,0x6517,0x6519,0x651A, +0x651B,0x651C,0x651D,0x651E,0x651F,0x6520,0x6521, 0, +0x6522,0x6523,0x6524,0x6526,0x6527,0x6528,0x6529,0x652A, +0x652C,0x652D,0x6530,0x6531,0x6532,0x6533,0x6537,0x653A, +0x653C,0x653D,0x6540,0x6541,0x6542,0x6543,0x6544,0x6546, +0x6547,0x654A,0x654B,0x654D,0x654E,0x6550,0x6552,0x6553, +0x6554,0x6557,0x6558,0x655A,0x655C,0x655F,0x6560,0x6561, +0x6564,0x6565,0x6567,0x6568,0x6569,0x656A,0x656D,0x656E, +0x656F,0x6571,0x6573,0x6575,0x6576,0x6578,0x6579,0x657A, +0x657B,0x657C,0x657D,0x657E,0x657F,0x6580,0x6581,0x6582, +0x6583,0x6584,0x6585,0x6586,0x6588,0x6589,0x658A,0x658D, +0x658E,0x658F,0x6592,0x6594,0x6595,0x6596,0x6598,0x659A, +0x659D,0x659E,0x65A0,0x65A2,0x65A3,0x65A6,0x65A8,0x65AA, +0x65AC,0x65AE,0x65B1,0x65B2,0x65B3,0x65B4,0x65B5,0x65B6, +0x65B7,0x65B8,0x65BA,0x65BB,0x65BE,0x65BF,0x65C0,0x65C2, +0x65C7,0x65C8,0x65C9,0x65CA,0x65CD,0x65D0,0x65D1,0x65D3, +0x65D4,0x65D5,0x65D8,0x65D9,0x65DA,0x65DB,0x65DC,0x65DD, +0x65DE,0x65DF,0x65E1,0x65E3,0x65E4,0x65EA,0x65EB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x65F2,0x65F3,0x65F4,0x65F5,0x65F8,0x65F9,0x65FB,0x65FC, +0x65FD,0x65FE,0x65FF,0x6601,0x6604,0x6605,0x6607,0x6608, +0x6609,0x660B,0x660D,0x6610,0x6611,0x6612,0x6616,0x6617, +0x6618,0x661A,0x661B,0x661C,0x661E,0x6621,0x6622,0x6623, +0x6624,0x6626,0x6629,0x662A,0x662B,0x662C,0x662E,0x6630, +0x6632,0x6633,0x6637,0x6638,0x6639,0x663A,0x663B,0x663D, +0x663F,0x6640,0x6642,0x6644,0x6645,0x6646,0x6647,0x6648, +0x6649,0x664A,0x664D,0x664E,0x6650,0x6651,0x6658, 0, +0x6659,0x665B,0x665C,0x665D,0x665E,0x6660,0x6662,0x6663, +0x6665,0x6667,0x6669,0x666A,0x666B,0x666C,0x666D,0x6671, +0x6672,0x6673,0x6675,0x6678,0x6679,0x667B,0x667C,0x667D, +0x667F,0x6680,0x6681,0x6683,0x6685,0x6686,0x6688,0x6689, +0x668A,0x668B,0x668D,0x668E,0x668F,0x6690,0x6692,0x6693, +0x6694,0x6695,0x6698,0x6699,0x669A,0x669B,0x669C,0x669E, +0x669F,0x66A0,0x66A1,0x66A2,0x66A3,0x66A4,0x66A5,0x66A6, +0x66A9,0x66AA,0x66AB,0x66AC,0x66AD,0x66AF,0x66B0,0x66B1, +0x66B2,0x66B3,0x66B5,0x66B6,0x66B7,0x66B8,0x66BA,0x66BB, +0x66BC,0x66BD,0x66BF,0x66C0,0x66C1,0x66C2,0x66C3,0x66C4, +0x66C5,0x66C6,0x66C7,0x66C8,0x66C9,0x66CA,0x66CB,0x66CC, +0x66CD,0x66CE,0x66CF,0x66D0,0x66D1,0x66D2,0x66D3,0x66D4, +0x66D5,0x66D6,0x66D7,0x66D8,0x66DA,0x66DE,0x66DF,0x66E0, +0x66E1,0x66E2,0x66E3,0x66E4,0x66E5,0x66E7,0x66E8,0x66EA, +0x66EB,0x66EC,0x66ED,0x66EE,0x66EF,0x66F1,0x66F5,0x66F6, +0x66F8,0x66FA,0x66FB,0x66FD,0x6701,0x6702,0x6703, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6704,0x6705,0x6706,0x6707,0x670C,0x670E,0x670F,0x6711, +0x6712,0x6713,0x6716,0x6718,0x6719,0x671A,0x671C,0x671E, +0x6720,0x6721,0x6722,0x6723,0x6724,0x6725,0x6727,0x6729, +0x672E,0x6730,0x6732,0x6733,0x6736,0x6737,0x6738,0x6739, +0x673B,0x673C,0x673E,0x673F,0x6741,0x6744,0x6745,0x6747, +0x674A,0x674B,0x674D,0x6752,0x6754,0x6755,0x6757,0x6758, +0x6759,0x675A,0x675B,0x675D,0x6762,0x6763,0x6764,0x6766, +0x6767,0x676B,0x676C,0x676E,0x6771,0x6774,0x6776, 0, +0x6778,0x6779,0x677A,0x677B,0x677D,0x6780,0x6782,0x6783, +0x6785,0x6786,0x6788,0x678A,0x678C,0x678D,0x678E,0x678F, +0x6791,0x6792,0x6793,0x6794,0x6796,0x6799,0x679B,0x679F, +0x67A0,0x67A1,0x67A4,0x67A6,0x67A9,0x67AC,0x67AE,0x67B1, +0x67B2,0x67B4,0x67B9,0x67BA,0x67BB,0x67BC,0x67BD,0x67BE, +0x67BF,0x67C0,0x67C2,0x67C5,0x67C6,0x67C7,0x67C8,0x67C9, +0x67CA,0x67CB,0x67CC,0x67CD,0x67CE,0x67D5,0x67D6,0x67D7, +0x67DB,0x67DF,0x67E1,0x67E3,0x67E4,0x67E6,0x67E7,0x67E8, +0x67EA,0x67EB,0x67ED,0x67EE,0x67F2,0x67F5,0x67F6,0x67F7, +0x67F8,0x67F9,0x67FA,0x67FB,0x67FC,0x67FE,0x6801,0x6802, +0x6803,0x6804,0x6806,0x680D,0x6810,0x6812,0x6814,0x6815, +0x6818,0x6819,0x681A,0x681B,0x681C,0x681E,0x681F,0x6820, +0x6822,0x6823,0x6824,0x6825,0x6826,0x6827,0x6828,0x682B, +0x682C,0x682D,0x682E,0x682F,0x6830,0x6831,0x6834,0x6835, +0x6836,0x683A,0x683B,0x683F,0x6847,0x684B,0x684D,0x684F, +0x6852,0x6856,0x6857,0x6858,0x6859,0x685A,0x685B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x685C,0x685D,0x685E,0x685F,0x686A,0x686C,0x686D,0x686E, +0x686F,0x6870,0x6871,0x6872,0x6873,0x6875,0x6878,0x6879, +0x687A,0x687B,0x687C,0x687D,0x687E,0x687F,0x6880,0x6882, +0x6884,0x6887,0x6888,0x6889,0x688A,0x688B,0x688C,0x688D, +0x688E,0x6890,0x6891,0x6892,0x6894,0x6895,0x6896,0x6898, +0x6899,0x689A,0x689B,0x689C,0x689D,0x689E,0x689F,0x68A0, +0x68A1,0x68A3,0x68A4,0x68A5,0x68A9,0x68AA,0x68AB,0x68AC, +0x68AE,0x68B1,0x68B2,0x68B4,0x68B6,0x68B7,0x68B8, 0, +0x68B9,0x68BA,0x68BB,0x68BC,0x68BD,0x68BE,0x68BF,0x68C1, +0x68C3,0x68C4,0x68C5,0x68C6,0x68C7,0x68C8,0x68CA,0x68CC, +0x68CE,0x68CF,0x68D0,0x68D1,0x68D3,0x68D4,0x68D6,0x68D7, +0x68D9,0x68DB,0x68DC,0x68DD,0x68DE,0x68DF,0x68E1,0x68E2, +0x68E4,0x68E5,0x68E6,0x68E7,0x68E8,0x68E9,0x68EA,0x68EB, +0x68EC,0x68ED,0x68EF,0x68F2,0x68F3,0x68F4,0x68F6,0x68F7, +0x68F8,0x68FB,0x68FD,0x68FE,0x68FF,0x6900,0x6902,0x6903, +0x6904,0x6906,0x6907,0x6908,0x6909,0x690A,0x690C,0x690F, +0x6911,0x6913,0x6914,0x6915,0x6916,0x6917,0x6918,0x6919, +0x691A,0x691B,0x691C,0x691D,0x691E,0x6921,0x6922,0x6923, +0x6925,0x6926,0x6927,0x6928,0x6929,0x692A,0x692B,0x692C, +0x692E,0x692F,0x6931,0x6932,0x6933,0x6935,0x6936,0x6937, +0x6938,0x693A,0x693B,0x693C,0x693E,0x6940,0x6941,0x6943, +0x6944,0x6945,0x6946,0x6947,0x6948,0x6949,0x694A,0x694B, +0x694C,0x694D,0x694E,0x694F,0x6950,0x6951,0x6952,0x6953, +0x6955,0x6956,0x6958,0x6959,0x695B,0x695C,0x695F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6961,0x6962,0x6964,0x6965,0x6967,0x6968,0x6969,0x696A, +0x696C,0x696D,0x696F,0x6970,0x6972,0x6973,0x6974,0x6975, +0x6976,0x697A,0x697B,0x697D,0x697E,0x697F,0x6981,0x6983, +0x6985,0x698A,0x698B,0x698C,0x698E,0x698F,0x6990,0x6991, +0x6992,0x6993,0x6996,0x6997,0x6999,0x699A,0x699D,0x699E, +0x699F,0x69A0,0x69A1,0x69A2,0x69A3,0x69A4,0x69A5,0x69A6, +0x69A9,0x69AA,0x69AC,0x69AE,0x69AF,0x69B0,0x69B2,0x69B3, +0x69B5,0x69B6,0x69B8,0x69B9,0x69BA,0x69BC,0x69BD, 0, +0x69BE,0x69BF,0x69C0,0x69C2,0x69C3,0x69C4,0x69C5,0x69C6, +0x69C7,0x69C8,0x69C9,0x69CB,0x69CD,0x69CF,0x69D1,0x69D2, +0x69D3,0x69D5,0x69D6,0x69D7,0x69D8,0x69D9,0x69DA,0x69DC, +0x69DD,0x69DE,0x69E1,0x69E2,0x69E3,0x69E4,0x69E5,0x69E6, +0x69E7,0x69E8,0x69E9,0x69EA,0x69EB,0x69EC,0x69EE,0x69EF, +0x69F0,0x69F1,0x69F3,0x69F4,0x69F5,0x69F6,0x69F7,0x69F8, +0x69F9,0x69FA,0x69FB,0x69FC,0x69FE,0x6A00,0x6A01,0x6A02, +0x6A03,0x6A04,0x6A05,0x6A06,0x6A07,0x6A08,0x6A09,0x6A0B, +0x6A0C,0x6A0D,0x6A0E,0x6A0F,0x6A10,0x6A11,0x6A12,0x6A13, +0x6A14,0x6A15,0x6A16,0x6A19,0x6A1A,0x6A1B,0x6A1C,0x6A1D, +0x6A1E,0x6A20,0x6A22,0x6A23,0x6A24,0x6A25,0x6A26,0x6A27, +0x6A29,0x6A2B,0x6A2C,0x6A2D,0x6A2E,0x6A30,0x6A32,0x6A33, +0x6A34,0x6A36,0x6A37,0x6A38,0x6A39,0x6A3A,0x6A3B,0x6A3C, +0x6A3F,0x6A40,0x6A41,0x6A42,0x6A43,0x6A45,0x6A46,0x6A48, +0x6A49,0x6A4A,0x6A4B,0x6A4C,0x6A4D,0x6A4E,0x6A4F,0x6A51, +0x6A52,0x6A53,0x6A54,0x6A55,0x6A56,0x6A57,0x6A5A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6A5C,0x6A5D,0x6A5E,0x6A5F,0x6A60,0x6A62,0x6A63,0x6A64, +0x6A66,0x6A67,0x6A68,0x6A69,0x6A6A,0x6A6B,0x6A6C,0x6A6D, +0x6A6E,0x6A6F,0x6A70,0x6A72,0x6A73,0x6A74,0x6A75,0x6A76, +0x6A77,0x6A78,0x6A7A,0x6A7B,0x6A7D,0x6A7E,0x6A7F,0x6A81, +0x6A82,0x6A83,0x6A85,0x6A86,0x6A87,0x6A88,0x6A89,0x6A8A, +0x6A8B,0x6A8C,0x6A8D,0x6A8F,0x6A92,0x6A93,0x6A94,0x6A95, +0x6A96,0x6A98,0x6A99,0x6A9A,0x6A9B,0x6A9C,0x6A9D,0x6A9E, +0x6A9F,0x6AA1,0x6AA2,0x6AA3,0x6AA4,0x6AA5,0x6AA6, 0, +0x6AA7,0x6AA8,0x6AAA,0x6AAD,0x6AAE,0x6AAF,0x6AB0,0x6AB1, +0x6AB2,0x6AB3,0x6AB4,0x6AB5,0x6AB6,0x6AB7,0x6AB8,0x6AB9, +0x6ABA,0x6ABB,0x6ABC,0x6ABD,0x6ABE,0x6ABF,0x6AC0,0x6AC1, +0x6AC2,0x6AC3,0x6AC4,0x6AC5,0x6AC6,0x6AC7,0x6AC8,0x6AC9, +0x6ACA,0x6ACB,0x6ACC,0x6ACD,0x6ACE,0x6ACF,0x6AD0,0x6AD1, +0x6AD2,0x6AD3,0x6AD4,0x6AD5,0x6AD6,0x6AD7,0x6AD8,0x6AD9, +0x6ADA,0x6ADB,0x6ADC,0x6ADD,0x6ADE,0x6ADF,0x6AE0,0x6AE1, +0x6AE2,0x6AE3,0x6AE4,0x6AE5,0x6AE6,0x6AE7,0x6AE8,0x6AE9, +0x6AEA,0x6AEB,0x6AEC,0x6AED,0x6AEE,0x6AEF,0x6AF0,0x6AF1, +0x6AF2,0x6AF3,0x6AF4,0x6AF5,0x6AF6,0x6AF7,0x6AF8,0x6AF9, +0x6AFA,0x6AFB,0x6AFC,0x6AFD,0x6AFE,0x6AFF,0x6B00,0x6B01, +0x6B02,0x6B03,0x6B04,0x6B05,0x6B06,0x6B07,0x6B08,0x6B09, +0x6B0A,0x6B0B,0x6B0C,0x6B0D,0x6B0E,0x6B0F,0x6B10,0x6B11, +0x6B12,0x6B13,0x6B14,0x6B15,0x6B16,0x6B17,0x6B18,0x6B19, +0x6B1A,0x6B1B,0x6B1C,0x6B1D,0x6B1E,0x6B1F,0x6B25,0x6B26, +0x6B28,0x6B29,0x6B2A,0x6B2B,0x6B2C,0x6B2D,0x6B2E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6B2F,0x6B30,0x6B31,0x6B33,0x6B34,0x6B35,0x6B36,0x6B38, +0x6B3B,0x6B3C,0x6B3D,0x6B3F,0x6B40,0x6B41,0x6B42,0x6B44, +0x6B45,0x6B48,0x6B4A,0x6B4B,0x6B4D,0x6B4E,0x6B4F,0x6B50, +0x6B51,0x6B52,0x6B53,0x6B54,0x6B55,0x6B56,0x6B57,0x6B58, +0x6B5A,0x6B5B,0x6B5C,0x6B5D,0x6B5E,0x6B5F,0x6B60,0x6B61, +0x6B68,0x6B69,0x6B6B,0x6B6C,0x6B6D,0x6B6E,0x6B6F,0x6B70, +0x6B71,0x6B72,0x6B73,0x6B74,0x6B75,0x6B76,0x6B77,0x6B78, +0x6B7A,0x6B7D,0x6B7E,0x6B7F,0x6B80,0x6B85,0x6B88, 0, +0x6B8C,0x6B8E,0x6B8F,0x6B90,0x6B91,0x6B94,0x6B95,0x6B97, +0x6B98,0x6B99,0x6B9C,0x6B9D,0x6B9E,0x6B9F,0x6BA0,0x6BA2, +0x6BA3,0x6BA4,0x6BA5,0x6BA6,0x6BA7,0x6BA8,0x6BA9,0x6BAB, +0x6BAC,0x6BAD,0x6BAE,0x6BAF,0x6BB0,0x6BB1,0x6BB2,0x6BB6, +0x6BB8,0x6BB9,0x6BBA,0x6BBB,0x6BBC,0x6BBD,0x6BBE,0x6BC0, +0x6BC3,0x6BC4,0x6BC6,0x6BC7,0x6BC8,0x6BC9,0x6BCA,0x6BCC, +0x6BCE,0x6BD0,0x6BD1,0x6BD8,0x6BDA,0x6BDC,0x6BDD,0x6BDE, +0x6BDF,0x6BE0,0x6BE2,0x6BE3,0x6BE4,0x6BE5,0x6BE6,0x6BE7, +0x6BE8,0x6BE9,0x6BEC,0x6BED,0x6BEE,0x6BF0,0x6BF1,0x6BF2, +0x6BF4,0x6BF6,0x6BF7,0x6BF8,0x6BFA,0x6BFB,0x6BFC,0x6BFE, +0x6BFF,0x6C00,0x6C01,0x6C02,0x6C03,0x6C04,0x6C08,0x6C09, +0x6C0A,0x6C0B,0x6C0C,0x6C0E,0x6C12,0x6C17,0x6C1C,0x6C1D, +0x6C1E,0x6C20,0x6C23,0x6C25,0x6C2B,0x6C2C,0x6C2D,0x6C31, +0x6C33,0x6C36,0x6C37,0x6C39,0x6C3A,0x6C3B,0x6C3C,0x6C3E, +0x6C3F,0x6C43,0x6C44,0x6C45,0x6C48,0x6C4B,0x6C4C,0x6C4D, +0x6C4E,0x6C4F,0x6C51,0x6C52,0x6C53,0x6C56,0x6C58, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C59,0x6C5A,0x6C62,0x6C63,0x6C65,0x6C66,0x6C67,0x6C6B, +0x6C6C,0x6C6D,0x6C6E,0x6C6F,0x6C71,0x6C73,0x6C75,0x6C77, +0x6C78,0x6C7A,0x6C7B,0x6C7C,0x6C7F,0x6C80,0x6C84,0x6C87, +0x6C8A,0x6C8B,0x6C8D,0x6C8E,0x6C91,0x6C92,0x6C95,0x6C96, +0x6C97,0x6C98,0x6C9A,0x6C9C,0x6C9D,0x6C9E,0x6CA0,0x6CA2, +0x6CA8,0x6CAC,0x6CAF,0x6CB0,0x6CB4,0x6CB5,0x6CB6,0x6CB7, +0x6CBA,0x6CC0,0x6CC1,0x6CC2,0x6CC3,0x6CC6,0x6CC7,0x6CC8, +0x6CCB,0x6CCD,0x6CCE,0x6CCF,0x6CD1,0x6CD2,0x6CD8, 0, +0x6CD9,0x6CDA,0x6CDC,0x6CDD,0x6CDF,0x6CE4,0x6CE6,0x6CE7, +0x6CE9,0x6CEC,0x6CED,0x6CF2,0x6CF4,0x6CF9,0x6CFF,0x6D00, +0x6D02,0x6D03,0x6D05,0x6D06,0x6D08,0x6D09,0x6D0A,0x6D0D, +0x6D0F,0x6D10,0x6D11,0x6D13,0x6D14,0x6D15,0x6D16,0x6D18, +0x6D1C,0x6D1D,0x6D1F,0x6D20,0x6D21,0x6D22,0x6D23,0x6D24, +0x6D26,0x6D28,0x6D29,0x6D2C,0x6D2D,0x6D2F,0x6D30,0x6D34, +0x6D36,0x6D37,0x6D38,0x6D3A,0x6D3F,0x6D40,0x6D42,0x6D44, +0x6D49,0x6D4C,0x6D50,0x6D55,0x6D56,0x6D57,0x6D58,0x6D5B, +0x6D5D,0x6D5F,0x6D61,0x6D62,0x6D64,0x6D65,0x6D67,0x6D68, +0x6D6B,0x6D6C,0x6D6D,0x6D70,0x6D71,0x6D72,0x6D73,0x6D75, +0x6D76,0x6D79,0x6D7A,0x6D7B,0x6D7D,0x6D7E,0x6D7F,0x6D80, +0x6D81,0x6D83,0x6D84,0x6D86,0x6D87,0x6D8A,0x6D8B,0x6D8D, +0x6D8F,0x6D90,0x6D92,0x6D96,0x6D97,0x6D98,0x6D99,0x6D9A, +0x6D9C,0x6DA2,0x6DA5,0x6DAC,0x6DAD,0x6DB0,0x6DB1,0x6DB3, +0x6DB4,0x6DB6,0x6DB7,0x6DB9,0x6DBA,0x6DBB,0x6DBC,0x6DBD, +0x6DBE,0x6DC1,0x6DC2,0x6DC3,0x6DC8,0x6DC9,0x6DCA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6DCD,0x6DCE,0x6DCF,0x6DD0,0x6DD2,0x6DD3,0x6DD4,0x6DD5, +0x6DD7,0x6DDA,0x6DDB,0x6DDC,0x6DDF,0x6DE2,0x6DE3,0x6DE5, +0x6DE7,0x6DE8,0x6DE9,0x6DEA,0x6DED,0x6DEF,0x6DF0,0x6DF2, +0x6DF4,0x6DF5,0x6DF6,0x6DF8,0x6DFA,0x6DFD,0x6DFE,0x6DFF, +0x6E00,0x6E01,0x6E02,0x6E03,0x6E04,0x6E06,0x6E07,0x6E08, +0x6E09,0x6E0B,0x6E0F,0x6E12,0x6E13,0x6E15,0x6E18,0x6E19, +0x6E1B,0x6E1C,0x6E1E,0x6E1F,0x6E22,0x6E26,0x6E27,0x6E28, +0x6E2A,0x6E2C,0x6E2E,0x6E30,0x6E31,0x6E33,0x6E35, 0, +0x6E36,0x6E37,0x6E39,0x6E3B,0x6E3C,0x6E3D,0x6E3E,0x6E3F, +0x6E40,0x6E41,0x6E42,0x6E45,0x6E46,0x6E47,0x6E48,0x6E49, +0x6E4A,0x6E4B,0x6E4C,0x6E4F,0x6E50,0x6E51,0x6E52,0x6E55, +0x6E57,0x6E59,0x6E5A,0x6E5C,0x6E5D,0x6E5E,0x6E60,0x6E61, +0x6E62,0x6E63,0x6E64,0x6E65,0x6E66,0x6E67,0x6E68,0x6E69, +0x6E6A,0x6E6C,0x6E6D,0x6E6F,0x6E70,0x6E71,0x6E72,0x6E73, +0x6E74,0x6E75,0x6E76,0x6E77,0x6E78,0x6E79,0x6E7A,0x6E7B, +0x6E7C,0x6E7D,0x6E80,0x6E81,0x6E82,0x6E84,0x6E87,0x6E88, +0x6E8A,0x6E8B,0x6E8C,0x6E8D,0x6E8E,0x6E91,0x6E92,0x6E93, +0x6E94,0x6E95,0x6E96,0x6E97,0x6E99,0x6E9A,0x6E9B,0x6E9D, +0x6E9E,0x6EA0,0x6EA1,0x6EA3,0x6EA4,0x6EA6,0x6EA8,0x6EA9, +0x6EAB,0x6EAC,0x6EAD,0x6EAE,0x6EB0,0x6EB3,0x6EB5,0x6EB8, +0x6EB9,0x6EBC,0x6EBE,0x6EBF,0x6EC0,0x6EC3,0x6EC4,0x6EC5, +0x6EC6,0x6EC8,0x6EC9,0x6ECA,0x6ECC,0x6ECD,0x6ECE,0x6ED0, +0x6ED2,0x6ED6,0x6ED8,0x6ED9,0x6EDB,0x6EDC,0x6EDD,0x6EE3, +0x6EE7,0x6EEA,0x6EEB,0x6EEC,0x6EED,0x6EEE,0x6EEF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6EF0,0x6EF1,0x6EF2,0x6EF3,0x6EF5,0x6EF6,0x6EF7,0x6EF8, +0x6EFA,0x6EFB,0x6EFC,0x6EFD,0x6EFE,0x6EFF,0x6F00,0x6F01, +0x6F03,0x6F04,0x6F05,0x6F07,0x6F08,0x6F0A,0x6F0B,0x6F0C, +0x6F0D,0x6F0E,0x6F10,0x6F11,0x6F12,0x6F16,0x6F17,0x6F18, +0x6F19,0x6F1A,0x6F1B,0x6F1C,0x6F1D,0x6F1E,0x6F1F,0x6F21, +0x6F22,0x6F23,0x6F25,0x6F26,0x6F27,0x6F28,0x6F2C,0x6F2E, +0x6F30,0x6F32,0x6F34,0x6F35,0x6F37,0x6F38,0x6F39,0x6F3A, +0x6F3B,0x6F3C,0x6F3D,0x6F3F,0x6F40,0x6F41,0x6F42, 0, +0x6F43,0x6F44,0x6F45,0x6F48,0x6F49,0x6F4A,0x6F4C,0x6F4E, +0x6F4F,0x6F50,0x6F51,0x6F52,0x6F53,0x6F54,0x6F55,0x6F56, +0x6F57,0x6F59,0x6F5A,0x6F5B,0x6F5D,0x6F5F,0x6F60,0x6F61, +0x6F63,0x6F64,0x6F65,0x6F67,0x6F68,0x6F69,0x6F6A,0x6F6B, +0x6F6C,0x6F6F,0x6F70,0x6F71,0x6F73,0x6F75,0x6F76,0x6F77, +0x6F79,0x6F7B,0x6F7D,0x6F7E,0x6F7F,0x6F80,0x6F81,0x6F82, +0x6F83,0x6F85,0x6F86,0x6F87,0x6F8A,0x6F8B,0x6F8F,0x6F90, +0x6F91,0x6F92,0x6F93,0x6F94,0x6F95,0x6F96,0x6F97,0x6F98, +0x6F99,0x6F9A,0x6F9B,0x6F9D,0x6F9E,0x6F9F,0x6FA0,0x6FA2, +0x6FA3,0x6FA4,0x6FA5,0x6FA6,0x6FA8,0x6FA9,0x6FAA,0x6FAB, +0x6FAC,0x6FAD,0x6FAE,0x6FAF,0x6FB0,0x6FB1,0x6FB2,0x6FB4, +0x6FB5,0x6FB7,0x6FB8,0x6FBA,0x6FBB,0x6FBC,0x6FBD,0x6FBE, +0x6FBF,0x6FC1,0x6FC3,0x6FC4,0x6FC5,0x6FC6,0x6FC7,0x6FC8, +0x6FCA,0x6FCB,0x6FCC,0x6FCD,0x6FCE,0x6FCF,0x6FD0,0x6FD3, +0x6FD4,0x6FD5,0x6FD6,0x6FD7,0x6FD8,0x6FD9,0x6FDA,0x6FDB, +0x6FDC,0x6FDD,0x6FDF,0x6FE2,0x6FE3,0x6FE4,0x6FE5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6FE6,0x6FE7,0x6FE8,0x6FE9,0x6FEA,0x6FEB,0x6FEC,0x6FED, +0x6FF0,0x6FF1,0x6FF2,0x6FF3,0x6FF4,0x6FF5,0x6FF6,0x6FF7, +0x6FF8,0x6FF9,0x6FFA,0x6FFB,0x6FFC,0x6FFD,0x6FFE,0x6FFF, +0x7000,0x7001,0x7002,0x7003,0x7004,0x7005,0x7006,0x7007, +0x7008,0x7009,0x700A,0x700B,0x700C,0x700D,0x700E,0x700F, +0x7010,0x7012,0x7013,0x7014,0x7015,0x7016,0x7017,0x7018, +0x7019,0x701C,0x701D,0x701E,0x701F,0x7020,0x7021,0x7022, +0x7024,0x7025,0x7026,0x7027,0x7028,0x7029,0x702A, 0, +0x702B,0x702C,0x702D,0x702E,0x702F,0x7030,0x7031,0x7032, +0x7033,0x7034,0x7036,0x7037,0x7038,0x703A,0x703B,0x703C, +0x703D,0x703E,0x703F,0x7040,0x7041,0x7042,0x7043,0x7044, +0x7045,0x7046,0x7047,0x7048,0x7049,0x704A,0x704B,0x704D, +0x704E,0x7050,0x7051,0x7052,0x7053,0x7054,0x7055,0x7056, +0x7057,0x7058,0x7059,0x705A,0x705B,0x705C,0x705D,0x705F, +0x7060,0x7061,0x7062,0x7063,0x7064,0x7065,0x7066,0x7067, +0x7068,0x7069,0x706A,0x706E,0x7071,0x7072,0x7073,0x7074, +0x7077,0x7079,0x707A,0x707B,0x707D,0x7081,0x7082,0x7083, +0x7084,0x7086,0x7087,0x7088,0x708B,0x708C,0x708D,0x708F, +0x7090,0x7091,0x7093,0x7097,0x7098,0x709A,0x709B,0x709E, +0x709F,0x70A0,0x70A1,0x70A2,0x70A3,0x70A4,0x70A5,0x70A6, +0x70A7,0x70A8,0x70A9,0x70AA,0x70B0,0x70B2,0x70B4,0x70B5, +0x70B6,0x70BA,0x70BE,0x70BF,0x70C4,0x70C5,0x70C6,0x70C7, +0x70C9,0x70CB,0x70CC,0x70CD,0x70CE,0x70CF,0x70D0,0x70D1, +0x70D2,0x70D3,0x70D4,0x70D5,0x70D6,0x70D7,0x70DA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x70DC,0x70DD,0x70DE,0x70E0,0x70E1,0x70E2,0x70E3,0x70E5, +0x70EA,0x70EE,0x70F0,0x70F1,0x70F2,0x70F3,0x70F4,0x70F5, +0x70F6,0x70F8,0x70FA,0x70FB,0x70FC,0x70FE,0x70FF,0x7100, +0x7101,0x7102,0x7103,0x7104,0x7105,0x7106,0x7107,0x7108, +0x710B,0x710C,0x710D,0x710E,0x710F,0x7111,0x7112,0x7114, +0x7117,0x711B,0x711C,0x711D,0x711E,0x711F,0x7120,0x7121, +0x7122,0x7123,0x7124,0x7125,0x7127,0x7128,0x7129,0x712A, +0x712B,0x712C,0x712D,0x712E,0x7132,0x7133,0x7134, 0, +0x7135,0x7137,0x7138,0x7139,0x713A,0x713B,0x713C,0x713D, +0x713E,0x713F,0x7140,0x7141,0x7142,0x7143,0x7144,0x7146, +0x7147,0x7148,0x7149,0x714B,0x714D,0x714F,0x7150,0x7151, +0x7152,0x7153,0x7154,0x7155,0x7156,0x7157,0x7158,0x7159, +0x715A,0x715B,0x715D,0x715F,0x7160,0x7161,0x7162,0x7163, +0x7165,0x7169,0x716A,0x716B,0x716C,0x716D,0x716F,0x7170, +0x7171,0x7174,0x7175,0x7176,0x7177,0x7179,0x717B,0x717C, +0x717E,0x717F,0x7180,0x7181,0x7182,0x7183,0x7185,0x7186, +0x7187,0x7188,0x7189,0x718B,0x718C,0x718D,0x718E,0x7190, +0x7191,0x7192,0x7193,0x7195,0x7196,0x7197,0x719A,0x719B, +0x719C,0x719D,0x719E,0x71A1,0x71A2,0x71A3,0x71A4,0x71A5, +0x71A6,0x71A7,0x71A9,0x71AA,0x71AB,0x71AD,0x71AE,0x71AF, +0x71B0,0x71B1,0x71B2,0x71B4,0x71B6,0x71B7,0x71B8,0x71BA, +0x71BB,0x71BC,0x71BD,0x71BE,0x71BF,0x71C0,0x71C1,0x71C2, +0x71C4,0x71C5,0x71C6,0x71C7,0x71C8,0x71C9,0x71CA,0x71CB, +0x71CC,0x71CD,0x71CF,0x71D0,0x71D1,0x71D2,0x71D3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x71D6,0x71D7,0x71D8,0x71D9,0x71DA,0x71DB,0x71DC,0x71DD, +0x71DE,0x71DF,0x71E1,0x71E2,0x71E3,0x71E4,0x71E6,0x71E8, +0x71E9,0x71EA,0x71EB,0x71EC,0x71ED,0x71EF,0x71F0,0x71F1, +0x71F2,0x71F3,0x71F4,0x71F5,0x71F6,0x71F7,0x71F8,0x71FA, +0x71FB,0x71FC,0x71FD,0x71FE,0x71FF,0x7200,0x7201,0x7202, +0x7203,0x7204,0x7205,0x7207,0x7208,0x7209,0x720A,0x720B, +0x720C,0x720D,0x720E,0x720F,0x7210,0x7211,0x7212,0x7213, +0x7214,0x7215,0x7216,0x7217,0x7218,0x7219,0x721A, 0, +0x721B,0x721C,0x721E,0x721F,0x7220,0x7221,0x7222,0x7223, +0x7224,0x7225,0x7226,0x7227,0x7229,0x722B,0x722D,0x722E, +0x722F,0x7232,0x7233,0x7234,0x723A,0x723C,0x723E,0x7240, +0x7241,0x7242,0x7243,0x7244,0x7245,0x7246,0x7249,0x724A, +0x724B,0x724E,0x724F,0x7250,0x7251,0x7253,0x7254,0x7255, +0x7257,0x7258,0x725A,0x725C,0x725E,0x7260,0x7263,0x7264, +0x7265,0x7268,0x726A,0x726B,0x726C,0x726D,0x7270,0x7271, +0x7273,0x7274,0x7276,0x7277,0x7278,0x727B,0x727C,0x727D, +0x7282,0x7283,0x7285,0x7286,0x7287,0x7288,0x7289,0x728C, +0x728E,0x7290,0x7291,0x7293,0x7294,0x7295,0x7296,0x7297, +0x7298,0x7299,0x729A,0x729B,0x729C,0x729D,0x729E,0x72A0, +0x72A1,0x72A2,0x72A3,0x72A4,0x72A5,0x72A6,0x72A7,0x72A8, +0x72A9,0x72AA,0x72AB,0x72AE,0x72B1,0x72B2,0x72B3,0x72B5, +0x72BA,0x72BB,0x72BC,0x72BD,0x72BE,0x72BF,0x72C0,0x72C5, +0x72C6,0x72C7,0x72C9,0x72CA,0x72CB,0x72CC,0x72CF,0x72D1, +0x72D3,0x72D4,0x72D5,0x72D6,0x72D8,0x72DA,0x72DB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3000,0x3001,0x3002,0x00B7,0x02C9,0x02C7,0x00A8, +0x3003,0x3005,0x2014,0xFF5E,0x2016,0x2026,0x2018,0x2019, +0x201C,0x201D,0x3014,0x3015,0x3008,0x3009,0x300A,0x300B, +0x300C,0x300D,0x300E,0x300F,0x3016,0x3017,0x3010,0x3011, +0x00B1,0x00D7,0x00F7,0x2236,0x2227,0x2228,0x2211,0x220F, +0x222A,0x2229,0x2208,0x2237,0x221A,0x22A5,0x2225,0x2220, +0x2312,0x2299,0x222B,0x222E,0x2261,0x224C,0x2248,0x223D, +0x221D,0x2260,0x226E,0x226F,0x2264,0x2265,0x221E,0x2235, +0x2234,0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFF04, +0x00A4,0xFFE0,0xFFE1,0x2030,0x00A7,0x2116,0x2606,0x2605, +0x25CB,0x25CF,0x25CE,0x25C7,0x25C6,0x25A1,0x25A0,0x25B3, +0x25B2,0x203B,0x2192,0x2190,0x2191,0x2193,0x3013, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176, +0x2177,0x2178,0x2179, 0, 0, 0, 0, 0, + 0,0x2488,0x2489,0x248A,0x248B,0x248C,0x248D,0x248E, +0x248F,0x2490,0x2491,0x2492,0x2493,0x2494,0x2495,0x2496, +0x2497,0x2498,0x2499,0x249A,0x249B,0x2474,0x2475,0x2476, +0x2477,0x2478,0x2479,0x247A,0x247B,0x247C,0x247D,0x247E, +0x247F,0x2480,0x2481,0x2482,0x2483,0x2484,0x2485,0x2486, +0x2487,0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466, +0x2467,0x2468,0x2469, 0, 0,0x3220,0x3221,0x3222, +0x3223,0x3224,0x3225,0x3226,0x3227,0x3228,0x3229, 0, + 0,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166, +0x2167,0x2168,0x2169,0x216A,0x216B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFF01,0xFF02,0xFF03,0xFFE5,0xFF05,0xFF06,0xFF07, +0xFF08,0xFF09,0xFF0A,0xFF0B,0xFF0C,0xFF0D,0xFF0E,0xFF0F, +0xFF10,0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17, +0xFF18,0xFF19,0xFF1A,0xFF1B,0xFF1C,0xFF1D,0xFF1E,0xFF1F, +0xFF20,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, +0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, +0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, +0xFF38,0xFF39,0xFF3A,0xFF3B,0xFF3C,0xFF3D,0xFF3E,0xFF3F, +0xFF40,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, +0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, +0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57, +0xFF58,0xFF59,0xFF5A,0xFF5B,0xFF5C,0xFF5D,0xFFE3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047, +0x3048,0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F, +0x3050,0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057, +0x3058,0x3059,0x305A,0x305B,0x305C,0x305D,0x305E,0x305F, +0x3060,0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067, +0x3068,0x3069,0x306A,0x306B,0x306C,0x306D,0x306E,0x306F, +0x3070,0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077, +0x3078,0x3079,0x307A,0x307B,0x307C,0x307D,0x307E,0x307F, +0x3080,0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087, +0x3088,0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F, +0x3090,0x3091,0x3092,0x3093, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7, +0x30A8,0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF, +0x30B0,0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7, +0x30B8,0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF, +0x30C0,0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7, +0x30C8,0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF, +0x30D0,0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7, +0x30D8,0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF, +0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7, +0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF, +0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, +0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, +0x03A0,0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8, +0x03A9, 0, 0, 0, 0, 0, 0, 0, + 0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7, +0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF, +0x03C0,0x03C1,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8, +0x03C9, 0, 0, 0, 0, 0, 0, 0, +0xFE35,0xFE36,0xFE39,0xFE3A,0xFE3F,0xFE40,0xFE3D,0xFE3E, +0xFE41,0xFE42,0xFE43,0xFE44, 0, 0,0xFE3B,0xFE3C, +0xFE37,0xFE38,0xFE31, 0,0xFE33,0xFE34, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401, +0x0416,0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D, +0x041E,0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425, +0x0426,0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D, +0x042E,0x042F, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451, +0x0436,0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D, +0x043E,0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445, +0x0446,0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D, +0x044E,0x044F, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x02CA,0x02CB,0x02D9,0x2013,0x2015,0x2025,0x2035,0x2105, +0x2109,0x2196,0x2197,0x2198,0x2199,0x2215,0x221F,0x2223, +0x2252,0x2266,0x2267,0x22BF,0x2550,0x2551,0x2552,0x2553, +0x2554,0x2555,0x2556,0x2557,0x2558,0x2559,0x255A,0x255B, +0x255C,0x255D,0x255E,0x255F,0x2560,0x2561,0x2562,0x2563, +0x2564,0x2565,0x2566,0x2567,0x2568,0x2569,0x256A,0x256B, +0x256C,0x256D,0x256E,0x256F,0x2570,0x2571,0x2572,0x2573, +0x2581,0x2582,0x2583,0x2584,0x2585,0x2586,0x2587, 0, +0x2588,0x2589,0x258A,0x258B,0x258C,0x258D,0x258E,0x258F, +0x2593,0x2594,0x2595,0x25BC,0x25BD,0x25E2,0x25E3,0x25E4, +0x25E5,0x2609,0x2295,0x3012,0x301D,0x301E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x0101,0x00E1,0x01CE,0x00E0,0x0113,0x00E9,0x011B, +0x00E8,0x012B,0x00ED,0x01D0,0x00EC,0x014D,0x00F3,0x01D2, +0x00F2,0x016B,0x00FA,0x01D4,0x00F9,0x01D6,0x01D8,0x01DA, +0x01DC,0x00FC,0x00EA,0x0251, 0,0x0144,0x0148, 0, +0x0261, 0, 0, 0, 0,0x3105,0x3106,0x3107, +0x3108,0x3109,0x310A,0x310B,0x310C,0x310D,0x310E,0x310F, +0x3110,0x3111,0x3112,0x3113,0x3114,0x3115,0x3116,0x3117, +0x3118,0x3119,0x311A,0x311B,0x311C,0x311D,0x311E,0x311F, +0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126,0x3127, +0x3128,0x3129, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3021,0x3022,0x3023,0x3024,0x3025,0x3026,0x3027,0x3028, +0x3029,0x32A3,0x338E,0x338F,0x339C,0x339D,0x339E,0x33A1, +0x33C4,0x33CE,0x33D1,0x33D2,0x33D5,0xFE30,0xFFE2,0xFFE4, + 0,0x2121,0x3231, 0,0x2010, 0, 0, 0, +0x30FC,0x309B,0x309C,0x30FD,0x30FE,0x3006,0x309D,0x309E, +0xFE49,0xFE4A,0xFE4B,0xFE4C,0xFE4D,0xFE4E,0xFE4F,0xFE50, +0xFE51,0xFE52,0xFE54,0xFE55,0xFE56,0xFE57,0xFE59,0xFE5A, +0xFE5B,0xFE5C,0xFE5D,0xFE5E,0xFE5F,0xFE60,0xFE61, 0, +0xFE62,0xFE63,0xFE64,0xFE65,0xFE66,0xFE68,0xFE69,0xFE6A, +0xFE6B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3007, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x2500,0x2501,0x2502,0x2503, +0x2504,0x2505,0x2506,0x2507,0x2508,0x2509,0x250A,0x250B, +0x250C,0x250D,0x250E,0x250F,0x2510,0x2511,0x2512,0x2513, +0x2514,0x2515,0x2516,0x2517,0x2518,0x2519,0x251A,0x251B, +0x251C,0x251D,0x251E,0x251F,0x2520,0x2521,0x2522,0x2523, +0x2524,0x2525,0x2526,0x2527,0x2528,0x2529,0x252A,0x252B, +0x252C,0x252D,0x252E,0x252F,0x2530,0x2531,0x2532,0x2533, +0x2534,0x2535,0x2536,0x2537,0x2538,0x2539,0x253A,0x253B, +0x253C,0x253D,0x253E,0x253F,0x2540,0x2541,0x2542,0x2543, +0x2544,0x2545,0x2546,0x2547,0x2548,0x2549,0x254A,0x254B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x72DC,0x72DD,0x72DF,0x72E2,0x72E3,0x72E4,0x72E5,0x72E6, +0x72E7,0x72EA,0x72EB,0x72F5,0x72F6,0x72F9,0x72FD,0x72FE, +0x72FF,0x7300,0x7302,0x7304,0x7305,0x7306,0x7307,0x7308, +0x7309,0x730B,0x730C,0x730D,0x730F,0x7310,0x7311,0x7312, +0x7314,0x7318,0x7319,0x731A,0x731F,0x7320,0x7323,0x7324, +0x7326,0x7327,0x7328,0x732D,0x732F,0x7330,0x7332,0x7333, +0x7335,0x7336,0x733A,0x733B,0x733C,0x733D,0x7340,0x7341, +0x7342,0x7343,0x7344,0x7345,0x7346,0x7347,0x7348, 0, +0x7349,0x734A,0x734B,0x734C,0x734E,0x734F,0x7351,0x7353, +0x7354,0x7355,0x7356,0x7358,0x7359,0x735A,0x735B,0x735C, +0x735D,0x735E,0x735F,0x7361,0x7362,0x7363,0x7364,0x7365, +0x7366,0x7367,0x7368,0x7369,0x736A,0x736B,0x736E,0x7370, +0x7371, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7372,0x7373,0x7374,0x7375,0x7376,0x7377,0x7378,0x7379, +0x737A,0x737B,0x737C,0x737D,0x737F,0x7380,0x7381,0x7382, +0x7383,0x7385,0x7386,0x7388,0x738A,0x738C,0x738D,0x738F, +0x7390,0x7392,0x7393,0x7394,0x7395,0x7397,0x7398,0x7399, +0x739A,0x739C,0x739D,0x739E,0x73A0,0x73A1,0x73A3,0x73A4, +0x73A5,0x73A6,0x73A7,0x73A8,0x73AA,0x73AC,0x73AD,0x73B1, +0x73B4,0x73B5,0x73B6,0x73B8,0x73B9,0x73BC,0x73BD,0x73BE, +0x73BF,0x73C1,0x73C3,0x73C4,0x73C5,0x73C6,0x73C7, 0, +0x73CB,0x73CC,0x73CE,0x73D2,0x73D3,0x73D4,0x73D5,0x73D6, +0x73D7,0x73D8,0x73DA,0x73DB,0x73DC,0x73DD,0x73DF,0x73E1, +0x73E2,0x73E3,0x73E4,0x73E6,0x73E8,0x73EA,0x73EB,0x73EC, +0x73EE,0x73EF,0x73F0,0x73F1,0x73F3,0x73F4,0x73F5,0x73F6, +0x73F7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x73F8,0x73F9,0x73FA,0x73FB,0x73FC,0x73FD,0x73FE,0x73FF, +0x7400,0x7401,0x7402,0x7404,0x7407,0x7408,0x740B,0x740C, +0x740D,0x740E,0x7411,0x7412,0x7413,0x7414,0x7415,0x7416, +0x7417,0x7418,0x7419,0x741C,0x741D,0x741E,0x741F,0x7420, +0x7421,0x7423,0x7424,0x7427,0x7429,0x742B,0x742D,0x742F, +0x7431,0x7432,0x7437,0x7438,0x7439,0x743A,0x743B,0x743D, +0x743E,0x743F,0x7440,0x7442,0x7443,0x7444,0x7445,0x7446, +0x7447,0x7448,0x7449,0x744A,0x744B,0x744C,0x744D, 0, +0x744E,0x744F,0x7450,0x7451,0x7452,0x7453,0x7454,0x7456, +0x7458,0x745D,0x7460,0x7461,0x7462,0x7463,0x7464,0x7465, +0x7466,0x7467,0x7468,0x7469,0x746A,0x746B,0x746C,0x746E, +0x746F,0x7471,0x7472,0x7473,0x7474,0x7475,0x7478,0x7479, +0x747A, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x747B,0x747C,0x747D,0x747F,0x7482,0x7484,0x7485,0x7486, +0x7488,0x7489,0x748A,0x748C,0x748D,0x748F,0x7491,0x7492, +0x7493,0x7494,0x7495,0x7496,0x7497,0x7498,0x7499,0x749A, +0x749B,0x749D,0x749F,0x74A0,0x74A1,0x74A2,0x74A3,0x74A4, +0x74A5,0x74A6,0x74AA,0x74AB,0x74AC,0x74AD,0x74AE,0x74AF, +0x74B0,0x74B1,0x74B2,0x74B3,0x74B4,0x74B5,0x74B6,0x74B7, +0x74B8,0x74B9,0x74BB,0x74BC,0x74BD,0x74BE,0x74BF,0x74C0, +0x74C1,0x74C2,0x74C3,0x74C4,0x74C5,0x74C6,0x74C7, 0, +0x74C8,0x74C9,0x74CA,0x74CB,0x74CC,0x74CD,0x74CE,0x74CF, +0x74D0,0x74D1,0x74D3,0x74D4,0x74D5,0x74D6,0x74D7,0x74D8, +0x74D9,0x74DA,0x74DB,0x74DD,0x74DF,0x74E1,0x74E5,0x74E7, +0x74E8,0x74E9,0x74EA,0x74EB,0x74EC,0x74ED,0x74F0,0x74F1, +0x74F2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x74F3,0x74F5,0x74F8,0x74F9,0x74FA,0x74FB,0x74FC,0x74FD, +0x74FE,0x7500,0x7501,0x7502,0x7503,0x7505,0x7506,0x7507, +0x7508,0x7509,0x750A,0x750B,0x750C,0x750E,0x7510,0x7512, +0x7514,0x7515,0x7516,0x7517,0x751B,0x751D,0x751E,0x7520, +0x7521,0x7522,0x7523,0x7524,0x7526,0x7527,0x752A,0x752E, +0x7534,0x7536,0x7539,0x753C,0x753D,0x753F,0x7541,0x7542, +0x7543,0x7544,0x7546,0x7547,0x7549,0x754A,0x754D,0x7550, +0x7551,0x7552,0x7553,0x7555,0x7556,0x7557,0x7558, 0, +0x755D,0x755E,0x755F,0x7560,0x7561,0x7562,0x7563,0x7564, +0x7567,0x7568,0x7569,0x756B,0x756C,0x756D,0x756E,0x756F, +0x7570,0x7571,0x7573,0x7575,0x7576,0x7577,0x757A,0x757B, +0x757C,0x757D,0x757E,0x7580,0x7581,0x7582,0x7584,0x7585, +0x7587, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7588,0x7589,0x758A,0x758C,0x758D,0x758E,0x7590,0x7593, +0x7595,0x7598,0x759B,0x759C,0x759E,0x75A2,0x75A6,0x75A7, +0x75A8,0x75A9,0x75AA,0x75AD,0x75B6,0x75B7,0x75BA,0x75BB, +0x75BF,0x75C0,0x75C1,0x75C6,0x75CB,0x75CC,0x75CE,0x75CF, +0x75D0,0x75D1,0x75D3,0x75D7,0x75D9,0x75DA,0x75DC,0x75DD, +0x75DF,0x75E0,0x75E1,0x75E5,0x75E9,0x75EC,0x75ED,0x75EE, +0x75EF,0x75F2,0x75F3,0x75F5,0x75F6,0x75F7,0x75F8,0x75FA, +0x75FB,0x75FD,0x75FE,0x7602,0x7604,0x7606,0x7607, 0, +0x7608,0x7609,0x760B,0x760D,0x760E,0x760F,0x7611,0x7612, +0x7613,0x7614,0x7616,0x761A,0x761C,0x761D,0x761E,0x7621, +0x7623,0x7627,0x7628,0x762C,0x762E,0x762F,0x7631,0x7632, +0x7636,0x7637,0x7639,0x763A,0x763B,0x763D,0x7641,0x7642, +0x7644, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7645,0x7646,0x7647,0x7648,0x7649,0x764A,0x764B,0x764E, +0x764F,0x7650,0x7651,0x7652,0x7653,0x7655,0x7657,0x7658, +0x7659,0x765A,0x765B,0x765D,0x765F,0x7660,0x7661,0x7662, +0x7664,0x7665,0x7666,0x7667,0x7668,0x7669,0x766A,0x766C, +0x766D,0x766E,0x7670,0x7671,0x7672,0x7673,0x7674,0x7675, +0x7676,0x7677,0x7679,0x767A,0x767C,0x767F,0x7680,0x7681, +0x7683,0x7685,0x7689,0x768A,0x768C,0x768D,0x768F,0x7690, +0x7692,0x7694,0x7695,0x7697,0x7698,0x769A,0x769B, 0, +0x769C,0x769D,0x769E,0x769F,0x76A0,0x76A1,0x76A2,0x76A3, +0x76A5,0x76A6,0x76A7,0x76A8,0x76A9,0x76AA,0x76AB,0x76AC, +0x76AD,0x76AF,0x76B0,0x76B3,0x76B5,0x76B6,0x76B7,0x76B8, +0x76B9,0x76BA,0x76BB,0x76BC,0x76BD,0x76BE,0x76C0,0x76C1, +0x76C3,0x554A,0x963F,0x57C3,0x6328,0x54CE,0x5509,0x54C0, +0x7691,0x764C,0x853C,0x77EE,0x827E,0x788D,0x7231,0x9698, +0x978D,0x6C28,0x5B89,0x4FFA,0x6309,0x6697,0x5CB8,0x80FA, +0x6848,0x80AE,0x6602,0x76CE,0x51F9,0x6556,0x71AC,0x7FF1, +0x8884,0x50B2,0x5965,0x61CA,0x6FB3,0x82AD,0x634C,0x6252, +0x53ED,0x5427,0x7B06,0x516B,0x75A4,0x5DF4,0x62D4,0x8DCB, +0x9776,0x628A,0x8019,0x575D,0x9738,0x7F62,0x7238,0x767D, +0x67CF,0x767E,0x6446,0x4F70,0x8D25,0x62DC,0x7A17,0x6591, +0x73ED,0x642C,0x6273,0x822C,0x9881,0x677F,0x7248,0x626E, +0x62CC,0x4F34,0x74E3,0x534A,0x529E,0x7ECA,0x90A6,0x5E2E, +0x6886,0x699C,0x8180,0x7ED1,0x68D2,0x78C5,0x868C,0x9551, +0x508D,0x8C24,0x82DE,0x80DE,0x5305,0x8912,0x5265, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x76C4,0x76C7,0x76C9,0x76CB,0x76CC,0x76D3,0x76D5,0x76D9, +0x76DA,0x76DC,0x76DD,0x76DE,0x76E0,0x76E1,0x76E2,0x76E3, +0x76E4,0x76E6,0x76E7,0x76E8,0x76E9,0x76EA,0x76EB,0x76EC, +0x76ED,0x76F0,0x76F3,0x76F5,0x76F6,0x76F7,0x76FA,0x76FB, +0x76FD,0x76FF,0x7700,0x7702,0x7703,0x7705,0x7706,0x770A, +0x770C,0x770E,0x770F,0x7710,0x7711,0x7712,0x7713,0x7714, +0x7715,0x7716,0x7717,0x7718,0x771B,0x771C,0x771D,0x771E, +0x7721,0x7723,0x7724,0x7725,0x7727,0x772A,0x772B, 0, +0x772C,0x772E,0x7730,0x7731,0x7732,0x7733,0x7734,0x7739, +0x773B,0x773D,0x773E,0x773F,0x7742,0x7744,0x7745,0x7746, +0x7748,0x7749,0x774A,0x774B,0x774C,0x774D,0x774E,0x774F, +0x7752,0x7753,0x7754,0x7755,0x7756,0x7757,0x7758,0x7759, +0x775C,0x8584,0x96F9,0x4FDD,0x5821,0x9971,0x5B9D,0x62B1, +0x62A5,0x66B4,0x8C79,0x9C8D,0x7206,0x676F,0x7891,0x60B2, +0x5351,0x5317,0x8F88,0x80CC,0x8D1D,0x94A1,0x500D,0x72C8, +0x5907,0x60EB,0x7119,0x88AB,0x5954,0x82EF,0x672C,0x7B28, +0x5D29,0x7EF7,0x752D,0x6CF5,0x8E66,0x8FF8,0x903C,0x9F3B, +0x6BD4,0x9119,0x7B14,0x5F7C,0x78A7,0x84D6,0x853D,0x6BD5, +0x6BD9,0x6BD6,0x5E01,0x5E87,0x75F9,0x95ED,0x655D,0x5F0A, +0x5FC5,0x8F9F,0x58C1,0x81C2,0x907F,0x965B,0x97AD,0x8FB9, +0x7F16,0x8D2C,0x6241,0x4FBF,0x53D8,0x535E,0x8FA8,0x8FA9, +0x8FAB,0x904D,0x6807,0x5F6A,0x8198,0x8868,0x9CD6,0x618B, +0x522B,0x762A,0x5F6C,0x658C,0x6FD2,0x6EE8,0x5BBE,0x6448, +0x5175,0x51B0,0x67C4,0x4E19,0x79C9,0x997C,0x70B3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x775D,0x775E,0x775F,0x7760,0x7764,0x7767,0x7769,0x776A, +0x776D,0x776E,0x776F,0x7770,0x7771,0x7772,0x7773,0x7774, +0x7775,0x7776,0x7777,0x7778,0x777A,0x777B,0x777C,0x7781, +0x7782,0x7783,0x7786,0x7787,0x7788,0x7789,0x778A,0x778B, +0x778F,0x7790,0x7793,0x7794,0x7795,0x7796,0x7797,0x7798, +0x7799,0x779A,0x779B,0x779C,0x779D,0x779E,0x77A1,0x77A3, +0x77A4,0x77A6,0x77A8,0x77AB,0x77AD,0x77AE,0x77AF,0x77B1, +0x77B2,0x77B4,0x77B6,0x77B7,0x77B8,0x77B9,0x77BA, 0, +0x77BC,0x77BE,0x77C0,0x77C1,0x77C2,0x77C3,0x77C4,0x77C5, +0x77C6,0x77C7,0x77C8,0x77C9,0x77CA,0x77CB,0x77CC,0x77CE, +0x77CF,0x77D0,0x77D1,0x77D2,0x77D3,0x77D4,0x77D5,0x77D6, +0x77D8,0x77D9,0x77DA,0x77DD,0x77DE,0x77DF,0x77E0,0x77E1, +0x77E4,0x75C5,0x5E76,0x73BB,0x83E0,0x64AD,0x62E8,0x94B5, +0x6CE2,0x535A,0x52C3,0x640F,0x94C2,0x7B94,0x4F2F,0x5E1B, +0x8236,0x8116,0x818A,0x6E24,0x6CCA,0x9A73,0x6355,0x535C, +0x54FA,0x8865,0x57E0,0x4E0D,0x5E03,0x6B65,0x7C3F,0x90E8, +0x6016,0x64E6,0x731C,0x88C1,0x6750,0x624D,0x8D22,0x776C, +0x8E29,0x91C7,0x5F69,0x83DC,0x8521,0x9910,0x53C2,0x8695, +0x6B8B,0x60ED,0x60E8,0x707F,0x82CD,0x8231,0x4ED3,0x6CA7, +0x85CF,0x64CD,0x7CD9,0x69FD,0x66F9,0x8349,0x5395,0x7B56, +0x4FA7,0x518C,0x6D4B,0x5C42,0x8E6D,0x63D2,0x53C9,0x832C, +0x8336,0x67E5,0x78B4,0x643D,0x5BDF,0x5C94,0x5DEE,0x8BE7, +0x62C6,0x67F4,0x8C7A,0x6400,0x63BA,0x8749,0x998B,0x8C17, +0x7F20,0x94F2,0x4EA7,0x9610,0x98A4,0x660C,0x7316, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x77E6,0x77E8,0x77EA,0x77EF,0x77F0,0x77F1,0x77F2,0x77F4, +0x77F5,0x77F7,0x77F9,0x77FA,0x77FB,0x77FC,0x7803,0x7804, +0x7805,0x7806,0x7807,0x7808,0x780A,0x780B,0x780E,0x780F, +0x7810,0x7813,0x7815,0x7819,0x781B,0x781E,0x7820,0x7821, +0x7822,0x7824,0x7828,0x782A,0x782B,0x782E,0x782F,0x7831, +0x7832,0x7833,0x7835,0x7836,0x783D,0x783F,0x7841,0x7842, +0x7843,0x7844,0x7846,0x7848,0x7849,0x784A,0x784B,0x784D, +0x784F,0x7851,0x7853,0x7854,0x7858,0x7859,0x785A, 0, +0x785B,0x785C,0x785E,0x785F,0x7860,0x7861,0x7862,0x7863, +0x7864,0x7865,0x7866,0x7867,0x7868,0x7869,0x786F,0x7870, +0x7871,0x7872,0x7873,0x7874,0x7875,0x7876,0x7878,0x7879, +0x787A,0x787B,0x787D,0x787E,0x787F,0x7880,0x7881,0x7882, +0x7883,0x573A,0x5C1D,0x5E38,0x957F,0x507F,0x80A0,0x5382, +0x655E,0x7545,0x5531,0x5021,0x8D85,0x6284,0x949E,0x671D, +0x5632,0x6F6E,0x5DE2,0x5435,0x7092,0x8F66,0x626F,0x64A4, +0x63A3,0x5F7B,0x6F88,0x90F4,0x81E3,0x8FB0,0x5C18,0x6668, +0x5FF1,0x6C89,0x9648,0x8D81,0x886C,0x6491,0x79F0,0x57CE, +0x6A59,0x6210,0x5448,0x4E58,0x7A0B,0x60E9,0x6F84,0x8BDA, +0x627F,0x901E,0x9A8B,0x79E4,0x5403,0x75F4,0x6301,0x5319, +0x6C60,0x8FDF,0x5F1B,0x9A70,0x803B,0x9F7F,0x4F88,0x5C3A, +0x8D64,0x7FC5,0x65A5,0x70BD,0x5145,0x51B2,0x866B,0x5D07, +0x5BA0,0x62BD,0x916C,0x7574,0x8E0C,0x7A20,0x6101,0x7B79, +0x4EC7,0x7EF8,0x7785,0x4E11,0x81ED,0x521D,0x51FA,0x6A71, +0x53A8,0x8E87,0x9504,0x96CF,0x6EC1,0x9664,0x695A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7884,0x7885,0x7886,0x7888,0x788A,0x788B,0x788F,0x7890, +0x7892,0x7894,0x7895,0x7896,0x7899,0x789D,0x789E,0x78A0, +0x78A2,0x78A4,0x78A6,0x78A8,0x78A9,0x78AA,0x78AB,0x78AC, +0x78AD,0x78AE,0x78AF,0x78B5,0x78B6,0x78B7,0x78B8,0x78BA, +0x78BB,0x78BC,0x78BD,0x78BF,0x78C0,0x78C2,0x78C3,0x78C4, +0x78C6,0x78C7,0x78C8,0x78CC,0x78CD,0x78CE,0x78CF,0x78D1, +0x78D2,0x78D3,0x78D6,0x78D7,0x78D8,0x78DA,0x78DB,0x78DC, +0x78DD,0x78DE,0x78DF,0x78E0,0x78E1,0x78E2,0x78E3, 0, +0x78E4,0x78E5,0x78E6,0x78E7,0x78E9,0x78EA,0x78EB,0x78ED, +0x78EE,0x78EF,0x78F0,0x78F1,0x78F3,0x78F5,0x78F6,0x78F8, +0x78F9,0x78FB,0x78FC,0x78FD,0x78FE,0x78FF,0x7900,0x7902, +0x7903,0x7904,0x7906,0x7907,0x7908,0x7909,0x790A,0x790B, +0x790C,0x7840,0x50A8,0x77D7,0x6410,0x89E6,0x5904,0x63E3, +0x5DDD,0x7A7F,0x693D,0x4F20,0x8239,0x5598,0x4E32,0x75AE, +0x7A97,0x5E62,0x5E8A,0x95EF,0x521B,0x5439,0x708A,0x6376, +0x9524,0x5782,0x6625,0x693F,0x9187,0x5507,0x6DF3,0x7EAF, +0x8822,0x6233,0x7EF0,0x75B5,0x8328,0x78C1,0x96CC,0x8F9E, +0x6148,0x74F7,0x8BCD,0x6B64,0x523A,0x8D50,0x6B21,0x806A, +0x8471,0x56F1,0x5306,0x4ECE,0x4E1B,0x51D1,0x7C97,0x918B, +0x7C07,0x4FC3,0x8E7F,0x7BE1,0x7A9C,0x6467,0x5D14,0x50AC, +0x8106,0x7601,0x7CB9,0x6DEC,0x7FE0,0x6751,0x5B58,0x5BF8, +0x78CB,0x64AE,0x6413,0x63AA,0x632B,0x9519,0x642D,0x8FBE, +0x7B54,0x7629,0x6253,0x5927,0x5446,0x6B79,0x50A3,0x6234, +0x5E26,0x6B86,0x4EE3,0x8D37,0x888B,0x5F85,0x902E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x790D,0x790E,0x790F,0x7910,0x7911,0x7912,0x7914,0x7915, +0x7916,0x7917,0x7918,0x7919,0x791A,0x791B,0x791C,0x791D, +0x791F,0x7920,0x7921,0x7922,0x7923,0x7925,0x7926,0x7927, +0x7928,0x7929,0x792A,0x792B,0x792C,0x792D,0x792E,0x792F, +0x7930,0x7931,0x7932,0x7933,0x7935,0x7936,0x7937,0x7938, +0x7939,0x793D,0x793F,0x7942,0x7943,0x7944,0x7945,0x7947, +0x794A,0x794B,0x794C,0x794D,0x794E,0x794F,0x7950,0x7951, +0x7952,0x7954,0x7955,0x7958,0x7959,0x7961,0x7963, 0, +0x7964,0x7966,0x7969,0x796A,0x796B,0x796C,0x796E,0x7970, +0x7971,0x7972,0x7973,0x7974,0x7975,0x7976,0x7979,0x797B, +0x797C,0x797D,0x797E,0x797F,0x7982,0x7983,0x7986,0x7987, +0x7988,0x7989,0x798B,0x798C,0x798D,0x798E,0x7990,0x7991, +0x7992,0x6020,0x803D,0x62C5,0x4E39,0x5355,0x90F8,0x63B8, +0x80C6,0x65E6,0x6C2E,0x4F46,0x60EE,0x6DE1,0x8BDE,0x5F39, +0x86CB,0x5F53,0x6321,0x515A,0x8361,0x6863,0x5200,0x6363, +0x8E48,0x5012,0x5C9B,0x7977,0x5BFC,0x5230,0x7A3B,0x60BC, +0x9053,0x76D7,0x5FB7,0x5F97,0x7684,0x8E6C,0x706F,0x767B, +0x7B49,0x77AA,0x51F3,0x9093,0x5824,0x4F4E,0x6EF4,0x8FEA, +0x654C,0x7B1B,0x72C4,0x6DA4,0x7FDF,0x5AE1,0x62B5,0x5E95, +0x5730,0x8482,0x7B2C,0x5E1D,0x5F1F,0x9012,0x7F14,0x98A0, +0x6382,0x6EC7,0x7898,0x70B9,0x5178,0x975B,0x57AB,0x7535, +0x4F43,0x7538,0x5E97,0x60E6,0x5960,0x6DC0,0x6BBF,0x7889, +0x53FC,0x96D5,0x51CB,0x5201,0x6389,0x540A,0x9493,0x8C03, +0x8DCC,0x7239,0x789F,0x8776,0x8FED,0x8C0D,0x53E0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7993,0x7994,0x7995,0x7996,0x7997,0x7998,0x7999,0x799B, +0x799C,0x799D,0x799E,0x799F,0x79A0,0x79A1,0x79A2,0x79A3, +0x79A4,0x79A5,0x79A6,0x79A8,0x79A9,0x79AA,0x79AB,0x79AC, +0x79AD,0x79AE,0x79AF,0x79B0,0x79B1,0x79B2,0x79B4,0x79B5, +0x79B6,0x79B7,0x79B8,0x79BC,0x79BF,0x79C2,0x79C4,0x79C5, +0x79C7,0x79C8,0x79CA,0x79CC,0x79CE,0x79CF,0x79D0,0x79D3, +0x79D4,0x79D6,0x79D7,0x79D9,0x79DA,0x79DB,0x79DC,0x79DD, +0x79DE,0x79E0,0x79E1,0x79E2,0x79E5,0x79E8,0x79EA, 0, +0x79EC,0x79EE,0x79F1,0x79F2,0x79F3,0x79F4,0x79F5,0x79F6, +0x79F7,0x79F9,0x79FA,0x79FC,0x79FE,0x79FF,0x7A01,0x7A04, +0x7A05,0x7A07,0x7A08,0x7A09,0x7A0A,0x7A0C,0x7A0F,0x7A10, +0x7A11,0x7A12,0x7A13,0x7A15,0x7A16,0x7A18,0x7A19,0x7A1B, +0x7A1C,0x4E01,0x76EF,0x53EE,0x9489,0x9876,0x9F0E,0x952D, +0x5B9A,0x8BA2,0x4E22,0x4E1C,0x51AC,0x8463,0x61C2,0x52A8, +0x680B,0x4F97,0x606B,0x51BB,0x6D1E,0x515C,0x6296,0x6597, +0x9661,0x8C46,0x9017,0x75D8,0x90FD,0x7763,0x6BD2,0x728A, +0x72EC,0x8BFB,0x5835,0x7779,0x8D4C,0x675C,0x9540,0x809A, +0x5EA6,0x6E21,0x5992,0x7AEF,0x77ED,0x953B,0x6BB5,0x65AD, +0x7F0E,0x5806,0x5151,0x961F,0x5BF9,0x58A9,0x5428,0x8E72, +0x6566,0x987F,0x56E4,0x949D,0x76FE,0x9041,0x6387,0x54C6, +0x591A,0x593A,0x579B,0x8EB2,0x6735,0x8DFA,0x8235,0x5241, +0x60F0,0x5815,0x86FE,0x5CE8,0x9E45,0x4FC4,0x989D,0x8BB9, +0x5A25,0x6076,0x5384,0x627C,0x904F,0x9102,0x997F,0x6069, +0x800C,0x513F,0x8033,0x5C14,0x9975,0x6D31,0x4E8C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7A1D,0x7A1F,0x7A21,0x7A22,0x7A24,0x7A25,0x7A26,0x7A27, +0x7A28,0x7A29,0x7A2A,0x7A2B,0x7A2C,0x7A2D,0x7A2E,0x7A2F, +0x7A30,0x7A31,0x7A32,0x7A34,0x7A35,0x7A36,0x7A38,0x7A3A, +0x7A3E,0x7A40,0x7A41,0x7A42,0x7A43,0x7A44,0x7A45,0x7A47, +0x7A48,0x7A49,0x7A4A,0x7A4B,0x7A4C,0x7A4D,0x7A4E,0x7A4F, +0x7A50,0x7A52,0x7A53,0x7A54,0x7A55,0x7A56,0x7A58,0x7A59, +0x7A5A,0x7A5B,0x7A5C,0x7A5D,0x7A5E,0x7A5F,0x7A60,0x7A61, +0x7A62,0x7A63,0x7A64,0x7A65,0x7A66,0x7A67,0x7A68, 0, +0x7A69,0x7A6A,0x7A6B,0x7A6C,0x7A6D,0x7A6E,0x7A6F,0x7A71, +0x7A72,0x7A73,0x7A75,0x7A7B,0x7A7C,0x7A7D,0x7A7E,0x7A82, +0x7A85,0x7A87,0x7A89,0x7A8A,0x7A8B,0x7A8C,0x7A8E,0x7A8F, +0x7A90,0x7A93,0x7A94,0x7A99,0x7A9A,0x7A9B,0x7A9E,0x7AA1, +0x7AA2,0x8D30,0x53D1,0x7F5A,0x7B4F,0x4F10,0x4E4F,0x9600, +0x6CD5,0x73D0,0x85E9,0x5E06,0x756A,0x7FFB,0x6A0A,0x77FE, +0x9492,0x7E41,0x51E1,0x70E6,0x53CD,0x8FD4,0x8303,0x8D29, +0x72AF,0x996D,0x6CDB,0x574A,0x82B3,0x65B9,0x80AA,0x623F, +0x9632,0x59A8,0x4EFF,0x8BBF,0x7EBA,0x653E,0x83F2,0x975E, +0x5561,0x98DE,0x80A5,0x532A,0x8BFD,0x5420,0x80BA,0x5E9F, +0x6CB8,0x8D39,0x82AC,0x915A,0x5429,0x6C1B,0x5206,0x7EB7, +0x575F,0x711A,0x6C7E,0x7C89,0x594B,0x4EFD,0x5FFF,0x6124, +0x7CAA,0x4E30,0x5C01,0x67AB,0x8702,0x5CF0,0x950B,0x98CE, +0x75AF,0x70FD,0x9022,0x51AF,0x7F1D,0x8BBD,0x5949,0x51E4, +0x4F5B,0x5426,0x592B,0x6577,0x80A4,0x5B75,0x6276,0x62C2, +0x8F90,0x5E45,0x6C1F,0x7B26,0x4F0F,0x4FD8,0x670D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7AA3,0x7AA4,0x7AA7,0x7AA9,0x7AAA,0x7AAB,0x7AAE,0x7AAF, +0x7AB0,0x7AB1,0x7AB2,0x7AB4,0x7AB5,0x7AB6,0x7AB7,0x7AB8, +0x7AB9,0x7ABA,0x7ABB,0x7ABC,0x7ABD,0x7ABE,0x7AC0,0x7AC1, +0x7AC2,0x7AC3,0x7AC4,0x7AC5,0x7AC6,0x7AC7,0x7AC8,0x7AC9, +0x7ACA,0x7ACC,0x7ACD,0x7ACE,0x7ACF,0x7AD0,0x7AD1,0x7AD2, +0x7AD3,0x7AD4,0x7AD5,0x7AD7,0x7AD8,0x7ADA,0x7ADB,0x7ADC, +0x7ADD,0x7AE1,0x7AE2,0x7AE4,0x7AE7,0x7AE8,0x7AE9,0x7AEA, +0x7AEB,0x7AEC,0x7AEE,0x7AF0,0x7AF1,0x7AF2,0x7AF3, 0, +0x7AF4,0x7AF5,0x7AF6,0x7AF7,0x7AF8,0x7AFB,0x7AFC,0x7AFE, +0x7B00,0x7B01,0x7B02,0x7B05,0x7B07,0x7B09,0x7B0C,0x7B0D, +0x7B0E,0x7B10,0x7B12,0x7B13,0x7B16,0x7B17,0x7B18,0x7B1A, +0x7B1C,0x7B1D,0x7B1F,0x7B21,0x7B22,0x7B23,0x7B27,0x7B29, +0x7B2D,0x6D6E,0x6DAA,0x798F,0x88B1,0x5F17,0x752B,0x629A, +0x8F85,0x4FEF,0x91DC,0x65A7,0x812F,0x8151,0x5E9C,0x8150, +0x8D74,0x526F,0x8986,0x8D4B,0x590D,0x5085,0x4ED8,0x961C, +0x7236,0x8179,0x8D1F,0x5BCC,0x8BA3,0x9644,0x5987,0x7F1A, +0x5490,0x5676,0x560E,0x8BE5,0x6539,0x6982,0x9499,0x76D6, +0x6E89,0x5E72,0x7518,0x6746,0x67D1,0x7AFF,0x809D,0x8D76, +0x611F,0x79C6,0x6562,0x8D63,0x5188,0x521A,0x94A2,0x7F38, +0x809B,0x7EB2,0x5C97,0x6E2F,0x6760,0x7BD9,0x768B,0x9AD8, +0x818F,0x7F94,0x7CD5,0x641E,0x9550,0x7A3F,0x544A,0x54E5, +0x6B4C,0x6401,0x6208,0x9E3D,0x80F3,0x7599,0x5272,0x9769, +0x845B,0x683C,0x86E4,0x9601,0x9694,0x94EC,0x4E2A,0x5404, +0x7ED9,0x6839,0x8DDF,0x8015,0x66F4,0x5E9A,0x7FB9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7B2F,0x7B30,0x7B32,0x7B34,0x7B35,0x7B36,0x7B37,0x7B39, +0x7B3B,0x7B3D,0x7B3F,0x7B40,0x7B41,0x7B42,0x7B43,0x7B44, +0x7B46,0x7B48,0x7B4A,0x7B4D,0x7B4E,0x7B53,0x7B55,0x7B57, +0x7B59,0x7B5C,0x7B5E,0x7B5F,0x7B61,0x7B63,0x7B64,0x7B65, +0x7B66,0x7B67,0x7B68,0x7B69,0x7B6A,0x7B6B,0x7B6C,0x7B6D, +0x7B6F,0x7B70,0x7B73,0x7B74,0x7B76,0x7B78,0x7B7A,0x7B7C, +0x7B7D,0x7B7F,0x7B81,0x7B82,0x7B83,0x7B84,0x7B86,0x7B87, +0x7B88,0x7B89,0x7B8A,0x7B8B,0x7B8C,0x7B8E,0x7B8F, 0, +0x7B91,0x7B92,0x7B93,0x7B96,0x7B98,0x7B99,0x7B9A,0x7B9B, +0x7B9E,0x7B9F,0x7BA0,0x7BA3,0x7BA4,0x7BA5,0x7BAE,0x7BAF, +0x7BB0,0x7BB2,0x7BB3,0x7BB5,0x7BB6,0x7BB7,0x7BB9,0x7BBA, +0x7BBB,0x7BBC,0x7BBD,0x7BBE,0x7BBF,0x7BC0,0x7BC2,0x7BC3, +0x7BC4,0x57C2,0x803F,0x6897,0x5DE5,0x653B,0x529F,0x606D, +0x9F9A,0x4F9B,0x8EAC,0x516C,0x5BAB,0x5F13,0x5DE9,0x6C5E, +0x62F1,0x8D21,0x5171,0x94A9,0x52FE,0x6C9F,0x82DF,0x72D7, +0x57A2,0x6784,0x8D2D,0x591F,0x8F9C,0x83C7,0x5495,0x7B8D, +0x4F30,0x6CBD,0x5B64,0x59D1,0x9F13,0x53E4,0x86CA,0x9AA8, +0x8C37,0x80A1,0x6545,0x987E,0x56FA,0x96C7,0x522E,0x74DC, +0x5250,0x5BE1,0x6302,0x8902,0x4E56,0x62D0,0x602A,0x68FA, +0x5173,0x5B98,0x51A0,0x89C2,0x7BA1,0x9986,0x7F50,0x60EF, +0x704C,0x8D2F,0x5149,0x5E7F,0x901B,0x7470,0x89C4,0x572D, +0x7845,0x5F52,0x9F9F,0x95FA,0x8F68,0x9B3C,0x8BE1,0x7678, +0x6842,0x67DC,0x8DEA,0x8D35,0x523D,0x8F8A,0x6EDA,0x68CD, +0x9505,0x90ED,0x56FD,0x679C,0x88F9,0x8FC7,0x54C8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7BC5,0x7BC8,0x7BC9,0x7BCA,0x7BCB,0x7BCD,0x7BCE,0x7BCF, +0x7BD0,0x7BD2,0x7BD4,0x7BD5,0x7BD6,0x7BD7,0x7BD8,0x7BDB, +0x7BDC,0x7BDE,0x7BDF,0x7BE0,0x7BE2,0x7BE3,0x7BE4,0x7BE7, +0x7BE8,0x7BE9,0x7BEB,0x7BEC,0x7BED,0x7BEF,0x7BF0,0x7BF2, +0x7BF3,0x7BF4,0x7BF5,0x7BF6,0x7BF8,0x7BF9,0x7BFA,0x7BFB, +0x7BFD,0x7BFF,0x7C00,0x7C01,0x7C02,0x7C03,0x7C04,0x7C05, +0x7C06,0x7C08,0x7C09,0x7C0A,0x7C0D,0x7C0E,0x7C10,0x7C11, +0x7C12,0x7C13,0x7C14,0x7C15,0x7C17,0x7C18,0x7C19, 0, +0x7C1A,0x7C1B,0x7C1C,0x7C1D,0x7C1E,0x7C20,0x7C21,0x7C22, +0x7C23,0x7C24,0x7C25,0x7C28,0x7C29,0x7C2B,0x7C2C,0x7C2D, +0x7C2E,0x7C2F,0x7C30,0x7C31,0x7C32,0x7C33,0x7C34,0x7C35, +0x7C36,0x7C37,0x7C39,0x7C3A,0x7C3B,0x7C3C,0x7C3D,0x7C3E, +0x7C42,0x9AB8,0x5B69,0x6D77,0x6C26,0x4EA5,0x5BB3,0x9A87, +0x9163,0x61A8,0x90AF,0x97E9,0x542B,0x6DB5,0x5BD2,0x51FD, +0x558A,0x7F55,0x7FF0,0x64BC,0x634D,0x65F1,0x61BE,0x608D, +0x710A,0x6C57,0x6C49,0x592F,0x676D,0x822A,0x58D5,0x568E, +0x8C6A,0x6BEB,0x90DD,0x597D,0x8017,0x53F7,0x6D69,0x5475, +0x559D,0x8377,0x83CF,0x6838,0x79BE,0x548C,0x4F55,0x5408, +0x76D2,0x8C89,0x9602,0x6CB3,0x6DB8,0x8D6B,0x8910,0x9E64, +0x8D3A,0x563F,0x9ED1,0x75D5,0x5F88,0x72E0,0x6068,0x54FC, +0x4EA8,0x6A2A,0x8861,0x6052,0x8F70,0x54C4,0x70D8,0x8679, +0x9E3F,0x6D2A,0x5B8F,0x5F18,0x7EA2,0x5589,0x4FAF,0x7334, +0x543C,0x539A,0x5019,0x540E,0x547C,0x4E4E,0x5FFD,0x745A, +0x58F6,0x846B,0x80E1,0x8774,0x72D0,0x7CCA,0x6E56, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7C43,0x7C44,0x7C45,0x7C46,0x7C47,0x7C48,0x7C49,0x7C4A, +0x7C4B,0x7C4C,0x7C4E,0x7C4F,0x7C50,0x7C51,0x7C52,0x7C53, +0x7C54,0x7C55,0x7C56,0x7C57,0x7C58,0x7C59,0x7C5A,0x7C5B, +0x7C5C,0x7C5D,0x7C5E,0x7C5F,0x7C60,0x7C61,0x7C62,0x7C63, +0x7C64,0x7C65,0x7C66,0x7C67,0x7C68,0x7C69,0x7C6A,0x7C6B, +0x7C6C,0x7C6D,0x7C6E,0x7C6F,0x7C70,0x7C71,0x7C72,0x7C75, +0x7C76,0x7C77,0x7C78,0x7C79,0x7C7A,0x7C7E,0x7C7F,0x7C80, +0x7C81,0x7C82,0x7C83,0x7C84,0x7C85,0x7C86,0x7C87, 0, +0x7C88,0x7C8A,0x7C8B,0x7C8C,0x7C8D,0x7C8E,0x7C8F,0x7C90, +0x7C93,0x7C94,0x7C96,0x7C99,0x7C9A,0x7C9B,0x7CA0,0x7CA1, +0x7CA3,0x7CA6,0x7CA7,0x7CA8,0x7CA9,0x7CAB,0x7CAC,0x7CAD, +0x7CAF,0x7CB0,0x7CB4,0x7CB5,0x7CB6,0x7CB7,0x7CB8,0x7CBA, +0x7CBB,0x5F27,0x864E,0x552C,0x62A4,0x4E92,0x6CAA,0x6237, +0x82B1,0x54D7,0x534E,0x733E,0x6ED1,0x753B,0x5212,0x5316, +0x8BDD,0x69D0,0x5F8A,0x6000,0x6DEE,0x574F,0x6B22,0x73AF, +0x6853,0x8FD8,0x7F13,0x6362,0x60A3,0x5524,0x75EA,0x8C62, +0x7115,0x6DA3,0x5BA6,0x5E7B,0x8352,0x614C,0x9EC4,0x78FA, +0x8757,0x7C27,0x7687,0x51F0,0x60F6,0x714C,0x6643,0x5E4C, +0x604D,0x8C0E,0x7070,0x6325,0x8F89,0x5FBD,0x6062,0x86D4, +0x56DE,0x6BC1,0x6094,0x6167,0x5349,0x60E0,0x6666,0x8D3F, +0x79FD,0x4F1A,0x70E9,0x6C47,0x8BB3,0x8BF2,0x7ED8,0x8364, +0x660F,0x5A5A,0x9B42,0x6D51,0x6DF7,0x8C41,0x6D3B,0x4F19, +0x706B,0x83B7,0x6216,0x60D1,0x970D,0x8D27,0x7978,0x51FB, +0x573E,0x57FA,0x673A,0x7578,0x7A3D,0x79EF,0x7B95, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7CBF,0x7CC0,0x7CC2,0x7CC3,0x7CC4,0x7CC6,0x7CC9,0x7CCB, +0x7CCE,0x7CCF,0x7CD0,0x7CD1,0x7CD2,0x7CD3,0x7CD4,0x7CD8, +0x7CDA,0x7CDB,0x7CDD,0x7CDE,0x7CE1,0x7CE2,0x7CE3,0x7CE4, +0x7CE5,0x7CE6,0x7CE7,0x7CE9,0x7CEA,0x7CEB,0x7CEC,0x7CED, +0x7CEE,0x7CF0,0x7CF1,0x7CF2,0x7CF3,0x7CF4,0x7CF5,0x7CF6, +0x7CF7,0x7CF9,0x7CFA,0x7CFC,0x7CFD,0x7CFE,0x7CFF,0x7D00, +0x7D01,0x7D02,0x7D03,0x7D04,0x7D05,0x7D06,0x7D07,0x7D08, +0x7D09,0x7D0B,0x7D0C,0x7D0D,0x7D0E,0x7D0F,0x7D10, 0, +0x7D11,0x7D12,0x7D13,0x7D14,0x7D15,0x7D16,0x7D17,0x7D18, +0x7D19,0x7D1A,0x7D1B,0x7D1C,0x7D1D,0x7D1E,0x7D1F,0x7D21, +0x7D23,0x7D24,0x7D25,0x7D26,0x7D28,0x7D29,0x7D2A,0x7D2C, +0x7D2D,0x7D2E,0x7D30,0x7D31,0x7D32,0x7D33,0x7D34,0x7D35, +0x7D36,0x808C,0x9965,0x8FF9,0x6FC0,0x8BA5,0x9E21,0x59EC, +0x7EE9,0x7F09,0x5409,0x6781,0x68D8,0x8F91,0x7C4D,0x96C6, +0x53CA,0x6025,0x75BE,0x6C72,0x5373,0x5AC9,0x7EA7,0x6324, +0x51E0,0x810A,0x5DF1,0x84DF,0x6280,0x5180,0x5B63,0x4F0E, +0x796D,0x5242,0x60B8,0x6D4E,0x5BC4,0x5BC2,0x8BA1,0x8BB0, +0x65E2,0x5FCC,0x9645,0x5993,0x7EE7,0x7EAA,0x5609,0x67B7, +0x5939,0x4F73,0x5BB6,0x52A0,0x835A,0x988A,0x8D3E,0x7532, +0x94BE,0x5047,0x7A3C,0x4EF7,0x67B6,0x9A7E,0x5AC1,0x6B7C, +0x76D1,0x575A,0x5C16,0x7B3A,0x95F4,0x714E,0x517C,0x80A9, +0x8270,0x5978,0x7F04,0x8327,0x68C0,0x67EC,0x78B1,0x7877, +0x62E3,0x6361,0x7B80,0x4FED,0x526A,0x51CF,0x8350,0x69DB, +0x9274,0x8DF5,0x8D31,0x89C1,0x952E,0x7BAD,0x4EF6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7D37,0x7D38,0x7D39,0x7D3A,0x7D3B,0x7D3C,0x7D3D,0x7D3E, +0x7D3F,0x7D40,0x7D41,0x7D42,0x7D43,0x7D44,0x7D45,0x7D46, +0x7D47,0x7D48,0x7D49,0x7D4A,0x7D4B,0x7D4C,0x7D4D,0x7D4E, +0x7D4F,0x7D50,0x7D51,0x7D52,0x7D53,0x7D54,0x7D55,0x7D56, +0x7D57,0x7D58,0x7D59,0x7D5A,0x7D5B,0x7D5C,0x7D5D,0x7D5E, +0x7D5F,0x7D60,0x7D61,0x7D62,0x7D63,0x7D64,0x7D65,0x7D66, +0x7D67,0x7D68,0x7D69,0x7D6A,0x7D6B,0x7D6C,0x7D6D,0x7D6F, +0x7D70,0x7D71,0x7D72,0x7D73,0x7D74,0x7D75,0x7D76, 0, +0x7D78,0x7D79,0x7D7A,0x7D7B,0x7D7C,0x7D7D,0x7D7E,0x7D7F, +0x7D80,0x7D81,0x7D82,0x7D83,0x7D84,0x7D85,0x7D86,0x7D87, +0x7D88,0x7D89,0x7D8A,0x7D8B,0x7D8C,0x7D8D,0x7D8E,0x7D8F, +0x7D90,0x7D91,0x7D92,0x7D93,0x7D94,0x7D95,0x7D96,0x7D97, +0x7D98,0x5065,0x8230,0x5251,0x996F,0x6E10,0x6E85,0x6DA7, +0x5EFA,0x50F5,0x59DC,0x5C06,0x6D46,0x6C5F,0x7586,0x848B, +0x6868,0x5956,0x8BB2,0x5320,0x9171,0x964D,0x8549,0x6912, +0x7901,0x7126,0x80F6,0x4EA4,0x90CA,0x6D47,0x9A84,0x5A07, +0x56BC,0x6405,0x94F0,0x77EB,0x4FA5,0x811A,0x72E1,0x89D2, +0x997A,0x7F34,0x7EDE,0x527F,0x6559,0x9175,0x8F7F,0x8F83, +0x53EB,0x7A96,0x63ED,0x63A5,0x7686,0x79F8,0x8857,0x9636, +0x622A,0x52AB,0x8282,0x6854,0x6770,0x6377,0x776B,0x7AED, +0x6D01,0x7ED3,0x89E3,0x59D0,0x6212,0x85C9,0x82A5,0x754C, +0x501F,0x4ECB,0x75A5,0x8BEB,0x5C4A,0x5DFE,0x7B4B,0x65A4, +0x91D1,0x4ECA,0x6D25,0x895F,0x7D27,0x9526,0x4EC5,0x8C28, +0x8FDB,0x9773,0x664B,0x7981,0x8FD1,0x70EC,0x6D78, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7D99,0x7D9A,0x7D9B,0x7D9C,0x7D9D,0x7D9E,0x7D9F,0x7DA0, +0x7DA1,0x7DA2,0x7DA3,0x7DA4,0x7DA5,0x7DA7,0x7DA8,0x7DA9, +0x7DAA,0x7DAB,0x7DAC,0x7DAD,0x7DAF,0x7DB0,0x7DB1,0x7DB2, +0x7DB3,0x7DB4,0x7DB5,0x7DB6,0x7DB7,0x7DB8,0x7DB9,0x7DBA, +0x7DBB,0x7DBC,0x7DBD,0x7DBE,0x7DBF,0x7DC0,0x7DC1,0x7DC2, +0x7DC3,0x7DC4,0x7DC5,0x7DC6,0x7DC7,0x7DC8,0x7DC9,0x7DCA, +0x7DCB,0x7DCC,0x7DCD,0x7DCE,0x7DCF,0x7DD0,0x7DD1,0x7DD2, +0x7DD3,0x7DD4,0x7DD5,0x7DD6,0x7DD7,0x7DD8,0x7DD9, 0, +0x7DDA,0x7DDB,0x7DDC,0x7DDD,0x7DDE,0x7DDF,0x7DE0,0x7DE1, +0x7DE2,0x7DE3,0x7DE4,0x7DE5,0x7DE6,0x7DE7,0x7DE8,0x7DE9, +0x7DEA,0x7DEB,0x7DEC,0x7DED,0x7DEE,0x7DEF,0x7DF0,0x7DF1, +0x7DF2,0x7DF3,0x7DF4,0x7DF5,0x7DF6,0x7DF7,0x7DF8,0x7DF9, +0x7DFA,0x5C3D,0x52B2,0x8346,0x5162,0x830E,0x775B,0x6676, +0x9CB8,0x4EAC,0x60CA,0x7CBE,0x7CB3,0x7ECF,0x4E95,0x8B66, +0x666F,0x9888,0x9759,0x5883,0x656C,0x955C,0x5F84,0x75C9, +0x9756,0x7ADF,0x7ADE,0x51C0,0x70AF,0x7A98,0x63EA,0x7A76, +0x7EA0,0x7396,0x97ED,0x4E45,0x7078,0x4E5D,0x9152,0x53A9, +0x6551,0x65E7,0x81FC,0x8205,0x548E,0x5C31,0x759A,0x97A0, +0x62D8,0x72D9,0x75BD,0x5C45,0x9A79,0x83CA,0x5C40,0x5480, +0x77E9,0x4E3E,0x6CAE,0x805A,0x62D2,0x636E,0x5DE8,0x5177, +0x8DDD,0x8E1E,0x952F,0x4FF1,0x53E5,0x60E7,0x70AC,0x5267, +0x6350,0x9E43,0x5A1F,0x5026,0x7737,0x5377,0x7EE2,0x6485, +0x652B,0x6289,0x6398,0x5014,0x7235,0x89C9,0x51B3,0x8BC0, +0x7EDD,0x5747,0x83CC,0x94A7,0x519B,0x541B,0x5CFB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7DFB,0x7DFC,0x7DFD,0x7DFE,0x7DFF,0x7E00,0x7E01,0x7E02, +0x7E03,0x7E04,0x7E05,0x7E06,0x7E07,0x7E08,0x7E09,0x7E0A, +0x7E0B,0x7E0C,0x7E0D,0x7E0E,0x7E0F,0x7E10,0x7E11,0x7E12, +0x7E13,0x7E14,0x7E15,0x7E16,0x7E17,0x7E18,0x7E19,0x7E1A, +0x7E1B,0x7E1C,0x7E1D,0x7E1E,0x7E1F,0x7E20,0x7E21,0x7E22, +0x7E23,0x7E24,0x7E25,0x7E26,0x7E27,0x7E28,0x7E29,0x7E2A, +0x7E2B,0x7E2C,0x7E2D,0x7E2E,0x7E2F,0x7E30,0x7E31,0x7E32, +0x7E33,0x7E34,0x7E35,0x7E36,0x7E37,0x7E38,0x7E39, 0, +0x7E3A,0x7E3C,0x7E3D,0x7E3E,0x7E3F,0x7E40,0x7E42,0x7E43, +0x7E44,0x7E45,0x7E46,0x7E48,0x7E49,0x7E4A,0x7E4B,0x7E4C, +0x7E4D,0x7E4E,0x7E4F,0x7E50,0x7E51,0x7E52,0x7E53,0x7E54, +0x7E55,0x7E56,0x7E57,0x7E58,0x7E59,0x7E5A,0x7E5B,0x7E5C, +0x7E5D,0x4FCA,0x7AE3,0x6D5A,0x90E1,0x9A8F,0x5580,0x5496, +0x5361,0x54AF,0x5F00,0x63E9,0x6977,0x51EF,0x6168,0x520A, +0x582A,0x52D8,0x574E,0x780D,0x770B,0x5EB7,0x6177,0x7CE0, +0x625B,0x6297,0x4EA2,0x7095,0x8003,0x62F7,0x70E4,0x9760, +0x5777,0x82DB,0x67EF,0x68F5,0x78D5,0x9897,0x79D1,0x58F3, +0x54B3,0x53EF,0x6E34,0x514B,0x523B,0x5BA2,0x8BFE,0x80AF, +0x5543,0x57A6,0x6073,0x5751,0x542D,0x7A7A,0x6050,0x5B54, +0x63A7,0x62A0,0x53E3,0x6263,0x5BC7,0x67AF,0x54ED,0x7A9F, +0x82E6,0x9177,0x5E93,0x88E4,0x5938,0x57AE,0x630E,0x8DE8, +0x80EF,0x5757,0x7B77,0x4FA9,0x5FEB,0x5BBD,0x6B3E,0x5321, +0x7B50,0x72C2,0x6846,0x77FF,0x7736,0x65F7,0x51B5,0x4E8F, +0x76D4,0x5CBF,0x7AA5,0x8475,0x594E,0x9B41,0x5080, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7E5E,0x7E5F,0x7E60,0x7E61,0x7E62,0x7E63,0x7E64,0x7E65, +0x7E66,0x7E67,0x7E68,0x7E69,0x7E6A,0x7E6B,0x7E6C,0x7E6D, +0x7E6E,0x7E6F,0x7E70,0x7E71,0x7E72,0x7E73,0x7E74,0x7E75, +0x7E76,0x7E77,0x7E78,0x7E79,0x7E7A,0x7E7B,0x7E7C,0x7E7D, +0x7E7E,0x7E7F,0x7E80,0x7E81,0x7E83,0x7E84,0x7E85,0x7E86, +0x7E87,0x7E88,0x7E89,0x7E8A,0x7E8B,0x7E8C,0x7E8D,0x7E8E, +0x7E8F,0x7E90,0x7E91,0x7E92,0x7E93,0x7E94,0x7E95,0x7E96, +0x7E97,0x7E98,0x7E99,0x7E9A,0x7E9C,0x7E9D,0x7E9E, 0, +0x7EAE,0x7EB4,0x7EBB,0x7EBC,0x7ED6,0x7EE4,0x7EEC,0x7EF9, +0x7F0A,0x7F10,0x7F1E,0x7F37,0x7F39,0x7F3B,0x7F3C,0x7F3D, +0x7F3E,0x7F3F,0x7F40,0x7F41,0x7F43,0x7F46,0x7F47,0x7F48, +0x7F49,0x7F4A,0x7F4B,0x7F4C,0x7F4D,0x7F4E,0x7F4F,0x7F52, +0x7F53,0x9988,0x6127,0x6E83,0x5764,0x6606,0x6346,0x56F0, +0x62EC,0x6269,0x5ED3,0x9614,0x5783,0x62C9,0x5587,0x8721, +0x814A,0x8FA3,0x5566,0x83B1,0x6765,0x8D56,0x84DD,0x5A6A, +0x680F,0x62E6,0x7BEE,0x9611,0x5170,0x6F9C,0x8C30,0x63FD, +0x89C8,0x61D2,0x7F06,0x70C2,0x6EE5,0x7405,0x6994,0x72FC, +0x5ECA,0x90CE,0x6717,0x6D6A,0x635E,0x52B3,0x7262,0x8001, +0x4F6C,0x59E5,0x916A,0x70D9,0x6D9D,0x52D2,0x4E50,0x96F7, +0x956D,0x857E,0x78CA,0x7D2F,0x5121,0x5792,0x64C2,0x808B, +0x7C7B,0x6CEA,0x68F1,0x695E,0x51B7,0x5398,0x68A8,0x7281, +0x9ECE,0x7BF1,0x72F8,0x79BB,0x6F13,0x7406,0x674E,0x91CC, +0x9CA4,0x793C,0x8389,0x8354,0x540F,0x6817,0x4E3D,0x5389, +0x52B1,0x783E,0x5386,0x5229,0x5088,0x4F8B,0x4FD0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7F56,0x7F59,0x7F5B,0x7F5C,0x7F5D,0x7F5E,0x7F60,0x7F63, +0x7F64,0x7F65,0x7F66,0x7F67,0x7F6B,0x7F6C,0x7F6D,0x7F6F, +0x7F70,0x7F73,0x7F75,0x7F76,0x7F77,0x7F78,0x7F7A,0x7F7B, +0x7F7C,0x7F7D,0x7F7F,0x7F80,0x7F82,0x7F83,0x7F84,0x7F85, +0x7F86,0x7F87,0x7F88,0x7F89,0x7F8B,0x7F8D,0x7F8F,0x7F90, +0x7F91,0x7F92,0x7F93,0x7F95,0x7F96,0x7F97,0x7F98,0x7F99, +0x7F9B,0x7F9C,0x7FA0,0x7FA2,0x7FA3,0x7FA5,0x7FA6,0x7FA8, +0x7FA9,0x7FAA,0x7FAB,0x7FAC,0x7FAD,0x7FAE,0x7FB1, 0, +0x7FB3,0x7FB4,0x7FB5,0x7FB6,0x7FB7,0x7FBA,0x7FBB,0x7FBE, +0x7FC0,0x7FC2,0x7FC3,0x7FC4,0x7FC6,0x7FC7,0x7FC8,0x7FC9, +0x7FCB,0x7FCD,0x7FCF,0x7FD0,0x7FD1,0x7FD2,0x7FD3,0x7FD6, +0x7FD7,0x7FD9,0x7FDA,0x7FDB,0x7FDC,0x7FDD,0x7FDE,0x7FE2, +0x7FE3,0x75E2,0x7ACB,0x7C92,0x6CA5,0x96B6,0x529B,0x7483, +0x54E9,0x4FE9,0x8054,0x83B2,0x8FDE,0x9570,0x5EC9,0x601C, +0x6D9F,0x5E18,0x655B,0x8138,0x94FE,0x604B,0x70BC,0x7EC3, +0x7CAE,0x51C9,0x6881,0x7CB1,0x826F,0x4E24,0x8F86,0x91CF, +0x667E,0x4EAE,0x8C05,0x64A9,0x804A,0x50DA,0x7597,0x71CE, +0x5BE5,0x8FBD,0x6F66,0x4E86,0x6482,0x9563,0x5ED6,0x6599, +0x5217,0x88C2,0x70C8,0x52A3,0x730E,0x7433,0x6797,0x78F7, +0x9716,0x4E34,0x90BB,0x9CDE,0x6DCB,0x51DB,0x8D41,0x541D, +0x62CE,0x73B2,0x83F1,0x96F6,0x9F84,0x94C3,0x4F36,0x7F9A, +0x51CC,0x7075,0x9675,0x5CAD,0x9886,0x53E6,0x4EE4,0x6E9C, +0x7409,0x69B4,0x786B,0x998F,0x7559,0x5218,0x7624,0x6D41, +0x67F3,0x516D,0x9F99,0x804B,0x5499,0x7B3C,0x7ABF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7FE4,0x7FE7,0x7FE8,0x7FEA,0x7FEB,0x7FEC,0x7FED,0x7FEF, +0x7FF2,0x7FF4,0x7FF5,0x7FF6,0x7FF7,0x7FF8,0x7FF9,0x7FFA, +0x7FFD,0x7FFE,0x7FFF,0x8002,0x8007,0x8008,0x8009,0x800A, +0x800E,0x800F,0x8011,0x8013,0x801A,0x801B,0x801D,0x801E, +0x801F,0x8021,0x8023,0x8024,0x802B,0x802C,0x802D,0x802E, +0x802F,0x8030,0x8032,0x8034,0x8039,0x803A,0x803C,0x803E, +0x8040,0x8041,0x8044,0x8045,0x8047,0x8048,0x8049,0x804E, +0x804F,0x8050,0x8051,0x8053,0x8055,0x8056,0x8057, 0, +0x8059,0x805B,0x805C,0x805D,0x805E,0x805F,0x8060,0x8061, +0x8062,0x8063,0x8064,0x8065,0x8066,0x8067,0x8068,0x806B, +0x806C,0x806D,0x806E,0x806F,0x8070,0x8072,0x8073,0x8074, +0x8075,0x8076,0x8077,0x8078,0x8079,0x807A,0x807B,0x807C, +0x807D,0x9686,0x5784,0x62E2,0x9647,0x697C,0x5A04,0x6402, +0x7BD3,0x6F0F,0x964B,0x82A6,0x5362,0x9885,0x5E90,0x7089, +0x63B3,0x5364,0x864F,0x9C81,0x9E93,0x788C,0x9732,0x8DEF, +0x8D42,0x9E7F,0x6F5E,0x7984,0x5F55,0x9646,0x622E,0x9A74, +0x5415,0x94DD,0x4FA3,0x65C5,0x5C65,0x5C61,0x7F15,0x8651, +0x6C2F,0x5F8B,0x7387,0x6EE4,0x7EFF,0x5CE6,0x631B,0x5B6A, +0x6EE6,0x5375,0x4E71,0x63A0,0x7565,0x62A1,0x8F6E,0x4F26, +0x4ED1,0x6CA6,0x7EB6,0x8BBA,0x841D,0x87BA,0x7F57,0x903B, +0x9523,0x7BA9,0x9AA1,0x88F8,0x843D,0x6D1B,0x9A86,0x7EDC, +0x5988,0x9EBB,0x739B,0x7801,0x8682,0x9A6C,0x9A82,0x561B, +0x5417,0x57CB,0x4E70,0x9EA6,0x5356,0x8FC8,0x8109,0x7792, +0x9992,0x86EE,0x6EE1,0x8513,0x66FC,0x6162,0x6F2B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x807E,0x8081,0x8082,0x8085,0x8088,0x808A,0x808D,0x808E, +0x808F,0x8090,0x8091,0x8092,0x8094,0x8095,0x8097,0x8099, +0x809E,0x80A3,0x80A6,0x80A7,0x80A8,0x80AC,0x80B0,0x80B3, +0x80B5,0x80B6,0x80B8,0x80B9,0x80BB,0x80C5,0x80C7,0x80C8, +0x80C9,0x80CA,0x80CB,0x80CF,0x80D0,0x80D1,0x80D2,0x80D3, +0x80D4,0x80D5,0x80D8,0x80DF,0x80E0,0x80E2,0x80E3,0x80E6, +0x80EE,0x80F5,0x80F7,0x80F9,0x80FB,0x80FE,0x80FF,0x8100, +0x8101,0x8103,0x8104,0x8105,0x8107,0x8108,0x810B, 0, +0x810C,0x8115,0x8117,0x8119,0x811B,0x811C,0x811D,0x811F, +0x8120,0x8121,0x8122,0x8123,0x8124,0x8125,0x8126,0x8127, +0x8128,0x8129,0x812A,0x812B,0x812D,0x812E,0x8130,0x8133, +0x8134,0x8135,0x8137,0x8139,0x813A,0x813B,0x813C,0x813D, +0x813F,0x8C29,0x8292,0x832B,0x76F2,0x6C13,0x5FD9,0x83BD, +0x732B,0x8305,0x951A,0x6BDB,0x77DB,0x94C6,0x536F,0x8302, +0x5192,0x5E3D,0x8C8C,0x8D38,0x4E48,0x73AB,0x679A,0x6885, +0x9176,0x9709,0x7164,0x6CA1,0x7709,0x5A92,0x9541,0x6BCF, +0x7F8E,0x6627,0x5BD0,0x59B9,0x5A9A,0x95E8,0x95F7,0x4EEC, +0x840C,0x8499,0x6AAC,0x76DF,0x9530,0x731B,0x68A6,0x5B5F, +0x772F,0x919A,0x9761,0x7CDC,0x8FF7,0x8C1C,0x5F25,0x7C73, +0x79D8,0x89C5,0x6CCC,0x871C,0x5BC6,0x5E42,0x68C9,0x7720, +0x7EF5,0x5195,0x514D,0x52C9,0x5A29,0x7F05,0x9762,0x82D7, +0x63CF,0x7784,0x85D0,0x79D2,0x6E3A,0x5E99,0x5999,0x8511, +0x706D,0x6C11,0x62BF,0x76BF,0x654F,0x60AF,0x95FD,0x660E, +0x879F,0x9E23,0x94ED,0x540D,0x547D,0x8C2C,0x6478, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8140,0x8141,0x8142,0x8143,0x8144,0x8145,0x8147,0x8149, +0x814D,0x814E,0x814F,0x8152,0x8156,0x8157,0x8158,0x815B, +0x815C,0x815D,0x815E,0x815F,0x8161,0x8162,0x8163,0x8164, +0x8166,0x8168,0x816A,0x816B,0x816C,0x816F,0x8172,0x8173, +0x8175,0x8176,0x8177,0x8178,0x8181,0x8183,0x8184,0x8185, +0x8186,0x8187,0x8189,0x818B,0x818C,0x818D,0x818E,0x8190, +0x8192,0x8193,0x8194,0x8195,0x8196,0x8197,0x8199,0x819A, +0x819E,0x819F,0x81A0,0x81A1,0x81A2,0x81A4,0x81A5, 0, +0x81A7,0x81A9,0x81AB,0x81AC,0x81AD,0x81AE,0x81AF,0x81B0, +0x81B1,0x81B2,0x81B4,0x81B5,0x81B6,0x81B7,0x81B8,0x81B9, +0x81BC,0x81BD,0x81BE,0x81BF,0x81C4,0x81C5,0x81C7,0x81C8, +0x81C9,0x81CB,0x81CD,0x81CE,0x81CF,0x81D0,0x81D1,0x81D2, +0x81D3,0x6479,0x8611,0x6A21,0x819C,0x78E8,0x6469,0x9B54, +0x62B9,0x672B,0x83AB,0x58A8,0x9ED8,0x6CAB,0x6F20,0x5BDE, +0x964C,0x8C0B,0x725F,0x67D0,0x62C7,0x7261,0x4EA9,0x59C6, +0x6BCD,0x5893,0x66AE,0x5E55,0x52DF,0x6155,0x6728,0x76EE, +0x7766,0x7267,0x7A46,0x62FF,0x54EA,0x5450,0x94A0,0x90A3, +0x5A1C,0x7EB3,0x6C16,0x4E43,0x5976,0x8010,0x5948,0x5357, +0x7537,0x96BE,0x56CA,0x6320,0x8111,0x607C,0x95F9,0x6DD6, +0x5462,0x9981,0x5185,0x5AE9,0x80FD,0x59AE,0x9713,0x502A, +0x6CE5,0x5C3C,0x62DF,0x4F60,0x533F,0x817B,0x9006,0x6EBA, +0x852B,0x62C8,0x5E74,0x78BE,0x64B5,0x637B,0x5FF5,0x5A18, +0x917F,0x9E1F,0x5C3F,0x634F,0x8042,0x5B7D,0x556E,0x954A, +0x954D,0x6D85,0x60A8,0x67E0,0x72DE,0x51DD,0x5B81, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81D4,0x81D5,0x81D6,0x81D7,0x81D8,0x81D9,0x81DA,0x81DB, +0x81DC,0x81DD,0x81DE,0x81DF,0x81E0,0x81E1,0x81E2,0x81E4, +0x81E5,0x81E6,0x81E8,0x81E9,0x81EB,0x81EE,0x81EF,0x81F0, +0x81F1,0x81F2,0x81F5,0x81F6,0x81F7,0x81F8,0x81F9,0x81FA, +0x81FD,0x81FF,0x8203,0x8207,0x8208,0x8209,0x820A,0x820B, +0x820E,0x820F,0x8211,0x8213,0x8215,0x8216,0x8217,0x8218, +0x8219,0x821A,0x821D,0x8220,0x8224,0x8225,0x8226,0x8227, +0x8229,0x822E,0x8232,0x823A,0x823C,0x823D,0x823F, 0, +0x8240,0x8241,0x8242,0x8243,0x8245,0x8246,0x8248,0x824A, +0x824C,0x824D,0x824E,0x8250,0x8251,0x8252,0x8253,0x8254, +0x8255,0x8256,0x8257,0x8259,0x825B,0x825C,0x825D,0x825E, +0x8260,0x8261,0x8262,0x8263,0x8264,0x8265,0x8266,0x8267, +0x8269,0x62E7,0x6CDE,0x725B,0x626D,0x94AE,0x7EBD,0x8113, +0x6D53,0x519C,0x5F04,0x5974,0x52AA,0x6012,0x5973,0x6696, +0x8650,0x759F,0x632A,0x61E6,0x7CEF,0x8BFA,0x54E6,0x6B27, +0x9E25,0x6BB4,0x85D5,0x5455,0x5076,0x6CA4,0x556A,0x8DB4, +0x722C,0x5E15,0x6015,0x7436,0x62CD,0x6392,0x724C,0x5F98, +0x6E43,0x6D3E,0x6500,0x6F58,0x76D8,0x78D0,0x76FC,0x7554, +0x5224,0x53DB,0x4E53,0x5E9E,0x65C1,0x802A,0x80D6,0x629B, +0x5486,0x5228,0x70AE,0x888D,0x8DD1,0x6CE1,0x5478,0x80DA, +0x57F9,0x88F4,0x8D54,0x966A,0x914D,0x4F69,0x6C9B,0x55B7, +0x76C6,0x7830,0x62A8,0x70F9,0x6F8E,0x5F6D,0x84EC,0x68DA, +0x787C,0x7BF7,0x81A8,0x670B,0x9E4F,0x6367,0x78B0,0x576F, +0x7812,0x9739,0x6279,0x62AB,0x5288,0x7435,0x6BD7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x826A,0x826B,0x826C,0x826D,0x8271,0x8275,0x8276,0x8277, +0x8278,0x827B,0x827C,0x8280,0x8281,0x8283,0x8285,0x8286, +0x8287,0x8289,0x828C,0x8290,0x8293,0x8294,0x8295,0x8296, +0x829A,0x829B,0x829E,0x82A0,0x82A2,0x82A3,0x82A7,0x82B2, +0x82B5,0x82B6,0x82BA,0x82BB,0x82BC,0x82BF,0x82C0,0x82C2, +0x82C3,0x82C5,0x82C6,0x82C9,0x82D0,0x82D6,0x82D9,0x82DA, +0x82DD,0x82E2,0x82E7,0x82E8,0x82E9,0x82EA,0x82EC,0x82ED, +0x82EE,0x82F0,0x82F2,0x82F3,0x82F5,0x82F6,0x82F8, 0, +0x82FA,0x82FC,0x82FD,0x82FE,0x82FF,0x8300,0x830A,0x830B, +0x830D,0x8310,0x8312,0x8313,0x8316,0x8318,0x8319,0x831D, +0x831E,0x831F,0x8320,0x8321,0x8322,0x8323,0x8324,0x8325, +0x8326,0x8329,0x832A,0x832E,0x8330,0x8332,0x8337,0x833B, +0x833D,0x5564,0x813E,0x75B2,0x76AE,0x5339,0x75DE,0x50FB, +0x5C41,0x8B6C,0x7BC7,0x504F,0x7247,0x9A97,0x98D8,0x6F02, +0x74E2,0x7968,0x6487,0x77A5,0x62FC,0x9891,0x8D2B,0x54C1, +0x8058,0x4E52,0x576A,0x82F9,0x840D,0x5E73,0x51ED,0x74F6, +0x8BC4,0x5C4F,0x5761,0x6CFC,0x9887,0x5A46,0x7834,0x9B44, +0x8FEB,0x7C95,0x5256,0x6251,0x94FA,0x4EC6,0x8386,0x8461, +0x83E9,0x84B2,0x57D4,0x6734,0x5703,0x666E,0x6D66,0x8C31, +0x66DD,0x7011,0x671F,0x6B3A,0x6816,0x621A,0x59BB,0x4E03, +0x51C4,0x6F06,0x67D2,0x6C8F,0x5176,0x68CB,0x5947,0x6B67, +0x7566,0x5D0E,0x8110,0x9F50,0x65D7,0x7948,0x7941,0x9A91, +0x8D77,0x5C82,0x4E5E,0x4F01,0x542F,0x5951,0x780C,0x5668, +0x6C14,0x8FC4,0x5F03,0x6C7D,0x6CE3,0x8BAB,0x6390, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x833E,0x833F,0x8341,0x8342,0x8344,0x8345,0x8348,0x834A, +0x834B,0x834C,0x834D,0x834E,0x8353,0x8355,0x8356,0x8357, +0x8358,0x8359,0x835D,0x8362,0x8370,0x8371,0x8372,0x8373, +0x8374,0x8375,0x8376,0x8379,0x837A,0x837E,0x837F,0x8380, +0x8381,0x8382,0x8383,0x8384,0x8387,0x8388,0x838A,0x838B, +0x838C,0x838D,0x838F,0x8390,0x8391,0x8394,0x8395,0x8396, +0x8397,0x8399,0x839A,0x839D,0x839F,0x83A1,0x83A2,0x83A3, +0x83A4,0x83A5,0x83A6,0x83A7,0x83AC,0x83AD,0x83AE, 0, +0x83AF,0x83B5,0x83BB,0x83BE,0x83BF,0x83C2,0x83C3,0x83C4, +0x83C6,0x83C8,0x83C9,0x83CB,0x83CD,0x83CE,0x83D0,0x83D1, +0x83D2,0x83D3,0x83D5,0x83D7,0x83D9,0x83DA,0x83DB,0x83DE, +0x83E2,0x83E3,0x83E4,0x83E6,0x83E7,0x83E8,0x83EB,0x83EC, +0x83ED,0x6070,0x6D3D,0x7275,0x6266,0x948E,0x94C5,0x5343, +0x8FC1,0x7B7E,0x4EDF,0x8C26,0x4E7E,0x9ED4,0x94B1,0x94B3, +0x524D,0x6F5C,0x9063,0x6D45,0x8C34,0x5811,0x5D4C,0x6B20, +0x6B49,0x67AA,0x545B,0x8154,0x7F8C,0x5899,0x8537,0x5F3A, +0x62A2,0x6A47,0x9539,0x6572,0x6084,0x6865,0x77A7,0x4E54, +0x4FA8,0x5DE7,0x9798,0x64AC,0x7FD8,0x5CED,0x4FCF,0x7A8D, +0x5207,0x8304,0x4E14,0x602F,0x7A83,0x94A6,0x4FB5,0x4EB2, +0x79E6,0x7434,0x52E4,0x82B9,0x64D2,0x79BD,0x5BDD,0x6C81, +0x9752,0x8F7B,0x6C22,0x503E,0x537F,0x6E05,0x64CE,0x6674, +0x6C30,0x60C5,0x9877,0x8BF7,0x5E86,0x743C,0x7A77,0x79CB, +0x4E18,0x90B1,0x7403,0x6C42,0x56DA,0x914B,0x6CC5,0x8D8B, +0x533A,0x86C6,0x66F2,0x8EAF,0x5C48,0x9A71,0x6E20, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x83EE,0x83EF,0x83F3,0x83F4,0x83F5,0x83F6,0x83F7,0x83FA, +0x83FB,0x83FC,0x83FE,0x83FF,0x8400,0x8402,0x8405,0x8407, +0x8408,0x8409,0x840A,0x8410,0x8412,0x8413,0x8414,0x8415, +0x8416,0x8417,0x8419,0x841A,0x841B,0x841E,0x841F,0x8420, +0x8421,0x8422,0x8423,0x8429,0x842A,0x842B,0x842C,0x842D, +0x842E,0x842F,0x8430,0x8432,0x8433,0x8434,0x8435,0x8436, +0x8437,0x8439,0x843A,0x843B,0x843E,0x843F,0x8440,0x8441, +0x8442,0x8443,0x8444,0x8445,0x8447,0x8448,0x8449, 0, +0x844A,0x844B,0x844C,0x844D,0x844E,0x844F,0x8450,0x8452, +0x8453,0x8454,0x8455,0x8456,0x8458,0x845D,0x845E,0x845F, +0x8460,0x8462,0x8464,0x8465,0x8466,0x8467,0x8468,0x846A, +0x846E,0x846F,0x8470,0x8472,0x8474,0x8477,0x8479,0x847B, +0x847C,0x53D6,0x5A36,0x9F8B,0x8DA3,0x53BB,0x5708,0x98A7, +0x6743,0x919B,0x6CC9,0x5168,0x75CA,0x62F3,0x72AC,0x5238, +0x529D,0x7F3A,0x7094,0x7638,0x5374,0x9E4A,0x69B7,0x786E, +0x96C0,0x88D9,0x7FA4,0x7136,0x71C3,0x5189,0x67D3,0x74E4, +0x58E4,0x6518,0x56B7,0x8BA9,0x9976,0x6270,0x7ED5,0x60F9, +0x70ED,0x58EC,0x4EC1,0x4EBA,0x5FCD,0x97E7,0x4EFB,0x8BA4, +0x5203,0x598A,0x7EAB,0x6254,0x4ECD,0x65E5,0x620E,0x8338, +0x84C9,0x8363,0x878D,0x7194,0x6EB6,0x5BB9,0x7ED2,0x5197, +0x63C9,0x67D4,0x8089,0x8339,0x8815,0x5112,0x5B7A,0x5982, +0x8FB1,0x4E73,0x6C5D,0x5165,0x8925,0x8F6F,0x962E,0x854A, +0x745E,0x9510,0x95F0,0x6DA6,0x82E5,0x5F31,0x6492,0x6D12, +0x8428,0x816E,0x9CC3,0x585E,0x8D5B,0x4E09,0x53C1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x847D,0x847E,0x847F,0x8480,0x8481,0x8483,0x8484,0x8485, +0x8486,0x848A,0x848D,0x848F,0x8490,0x8491,0x8492,0x8493, +0x8494,0x8495,0x8496,0x8498,0x849A,0x849B,0x849D,0x849E, +0x849F,0x84A0,0x84A2,0x84A3,0x84A4,0x84A5,0x84A6,0x84A7, +0x84A8,0x84A9,0x84AA,0x84AB,0x84AC,0x84AD,0x84AE,0x84B0, +0x84B1,0x84B3,0x84B5,0x84B6,0x84B7,0x84BB,0x84BC,0x84BE, +0x84C0,0x84C2,0x84C3,0x84C5,0x84C6,0x84C7,0x84C8,0x84CB, +0x84CC,0x84CE,0x84CF,0x84D2,0x84D4,0x84D5,0x84D7, 0, +0x84D8,0x84D9,0x84DA,0x84DB,0x84DC,0x84DE,0x84E1,0x84E2, +0x84E4,0x84E7,0x84E8,0x84E9,0x84EA,0x84EB,0x84ED,0x84EE, +0x84EF,0x84F1,0x84F2,0x84F3,0x84F4,0x84F5,0x84F6,0x84F7, +0x84F8,0x84F9,0x84FA,0x84FB,0x84FD,0x84FE,0x8500,0x8501, +0x8502,0x4F1E,0x6563,0x6851,0x55D3,0x4E27,0x6414,0x9A9A, +0x626B,0x5AC2,0x745F,0x8272,0x6DA9,0x68EE,0x50E7,0x838E, +0x7802,0x6740,0x5239,0x6C99,0x7EB1,0x50BB,0x5565,0x715E, +0x7B5B,0x6652,0x73CA,0x82EB,0x6749,0x5C71,0x5220,0x717D, +0x886B,0x95EA,0x9655,0x64C5,0x8D61,0x81B3,0x5584,0x6C55, +0x6247,0x7F2E,0x5892,0x4F24,0x5546,0x8D4F,0x664C,0x4E0A, +0x5C1A,0x88F3,0x68A2,0x634E,0x7A0D,0x70E7,0x828D,0x52FA, +0x97F6,0x5C11,0x54E8,0x90B5,0x7ECD,0x5962,0x8D4A,0x86C7, +0x820C,0x820D,0x8D66,0x6444,0x5C04,0x6151,0x6D89,0x793E, +0x8BBE,0x7837,0x7533,0x547B,0x4F38,0x8EAB,0x6DF1,0x5A20, +0x7EC5,0x795E,0x6C88,0x5BA1,0x5A76,0x751A,0x80BE,0x614E, +0x6E17,0x58F0,0x751F,0x7525,0x7272,0x5347,0x7EF3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8503,0x8504,0x8505,0x8506,0x8507,0x8508,0x8509,0x850A, +0x850B,0x850D,0x850E,0x850F,0x8510,0x8512,0x8514,0x8515, +0x8516,0x8518,0x8519,0x851B,0x851C,0x851D,0x851E,0x8520, +0x8522,0x8523,0x8524,0x8525,0x8526,0x8527,0x8528,0x8529, +0x852A,0x852D,0x852E,0x852F,0x8530,0x8531,0x8532,0x8533, +0x8534,0x8535,0x8536,0x853E,0x853F,0x8540,0x8541,0x8542, +0x8544,0x8545,0x8546,0x8547,0x854B,0x854C,0x854D,0x854E, +0x854F,0x8550,0x8551,0x8552,0x8553,0x8554,0x8555, 0, +0x8557,0x8558,0x855A,0x855B,0x855C,0x855D,0x855F,0x8560, +0x8561,0x8562,0x8563,0x8565,0x8566,0x8567,0x8569,0x856A, +0x856B,0x856C,0x856D,0x856E,0x856F,0x8570,0x8571,0x8573, +0x8575,0x8576,0x8577,0x8578,0x857C,0x857D,0x857F,0x8580, +0x8581,0x7701,0x76DB,0x5269,0x80DC,0x5723,0x5E08,0x5931, +0x72EE,0x65BD,0x6E7F,0x8BD7,0x5C38,0x8671,0x5341,0x77F3, +0x62FE,0x65F6,0x4EC0,0x98DF,0x8680,0x5B9E,0x8BC6,0x53F2, +0x77E2,0x4F7F,0x5C4E,0x9A76,0x59CB,0x5F0F,0x793A,0x58EB, +0x4E16,0x67FF,0x4E8B,0x62ED,0x8A93,0x901D,0x52BF,0x662F, +0x55DC,0x566C,0x9002,0x4ED5,0x4F8D,0x91CA,0x9970,0x6C0F, +0x5E02,0x6043,0x5BA4,0x89C6,0x8BD5,0x6536,0x624B,0x9996, +0x5B88,0x5BFF,0x6388,0x552E,0x53D7,0x7626,0x517D,0x852C, +0x67A2,0x68B3,0x6B8A,0x6292,0x8F93,0x53D4,0x8212,0x6DD1, +0x758F,0x4E66,0x8D4E,0x5B70,0x719F,0x85AF,0x6691,0x66D9, +0x7F72,0x8700,0x9ECD,0x9F20,0x5C5E,0x672F,0x8FF0,0x6811, +0x675F,0x620D,0x7AD6,0x5885,0x5EB6,0x6570,0x6F31, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8582,0x8583,0x8586,0x8588,0x8589,0x858A,0x858B,0x858C, +0x858D,0x858E,0x8590,0x8591,0x8592,0x8593,0x8594,0x8595, +0x8596,0x8597,0x8598,0x8599,0x859A,0x859D,0x859E,0x859F, +0x85A0,0x85A1,0x85A2,0x85A3,0x85A5,0x85A6,0x85A7,0x85A9, +0x85AB,0x85AC,0x85AD,0x85B1,0x85B2,0x85B3,0x85B4,0x85B5, +0x85B6,0x85B8,0x85BA,0x85BB,0x85BC,0x85BD,0x85BE,0x85BF, +0x85C0,0x85C2,0x85C3,0x85C4,0x85C5,0x85C6,0x85C7,0x85C8, +0x85CA,0x85CB,0x85CC,0x85CD,0x85CE,0x85D1,0x85D2, 0, +0x85D4,0x85D6,0x85D7,0x85D8,0x85D9,0x85DA,0x85DB,0x85DD, +0x85DE,0x85DF,0x85E0,0x85E1,0x85E2,0x85E3,0x85E5,0x85E6, +0x85E7,0x85E8,0x85EA,0x85EB,0x85EC,0x85ED,0x85EE,0x85EF, +0x85F0,0x85F1,0x85F2,0x85F3,0x85F4,0x85F5,0x85F6,0x85F7, +0x85F8,0x6055,0x5237,0x800D,0x6454,0x8870,0x7529,0x5E05, +0x6813,0x62F4,0x971C,0x53CC,0x723D,0x8C01,0x6C34,0x7761, +0x7A0E,0x542E,0x77AC,0x987A,0x821C,0x8BF4,0x7855,0x6714, +0x70C1,0x65AF,0x6495,0x5636,0x601D,0x79C1,0x53F8,0x4E1D, +0x6B7B,0x8086,0x5BFA,0x55E3,0x56DB,0x4F3A,0x4F3C,0x9972, +0x5DF3,0x677E,0x8038,0x6002,0x9882,0x9001,0x5B8B,0x8BBC, +0x8BF5,0x641C,0x8258,0x64DE,0x55FD,0x82CF,0x9165,0x4FD7, +0x7D20,0x901F,0x7C9F,0x50F3,0x5851,0x6EAF,0x5BBF,0x8BC9, +0x8083,0x9178,0x849C,0x7B97,0x867D,0x968B,0x968F,0x7EE5, +0x9AD3,0x788E,0x5C81,0x7A57,0x9042,0x96A7,0x795F,0x5B59, +0x635F,0x7B0B,0x84D1,0x68AD,0x5506,0x7F29,0x7410,0x7D22, +0x9501,0x6240,0x584C,0x4ED6,0x5B83,0x5979,0x5854, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x85F9,0x85FA,0x85FC,0x85FD,0x85FE,0x8600,0x8601,0x8602, +0x8603,0x8604,0x8606,0x8607,0x8608,0x8609,0x860A,0x860B, +0x860C,0x860D,0x860E,0x860F,0x8610,0x8612,0x8613,0x8614, +0x8615,0x8617,0x8618,0x8619,0x861A,0x861B,0x861C,0x861D, +0x861E,0x861F,0x8620,0x8621,0x8622,0x8623,0x8624,0x8625, +0x8626,0x8628,0x862A,0x862B,0x862C,0x862D,0x862E,0x862F, +0x8630,0x8631,0x8632,0x8633,0x8634,0x8635,0x8636,0x8637, +0x8639,0x863A,0x863B,0x863D,0x863E,0x863F,0x8640, 0, +0x8641,0x8642,0x8643,0x8644,0x8645,0x8646,0x8647,0x8648, +0x8649,0x864A,0x864B,0x864C,0x8652,0x8653,0x8655,0x8656, +0x8657,0x8658,0x8659,0x865B,0x865C,0x865D,0x865F,0x8660, +0x8661,0x8663,0x8664,0x8665,0x8666,0x8667,0x8668,0x8669, +0x866A,0x736D,0x631E,0x8E4B,0x8E0F,0x80CE,0x82D4,0x62AC, +0x53F0,0x6CF0,0x915E,0x592A,0x6001,0x6C70,0x574D,0x644A, +0x8D2A,0x762B,0x6EE9,0x575B,0x6A80,0x75F0,0x6F6D,0x8C2D, +0x8C08,0x5766,0x6BEF,0x8892,0x78B3,0x63A2,0x53F9,0x70AD, +0x6C64,0x5858,0x642A,0x5802,0x68E0,0x819B,0x5510,0x7CD6, +0x5018,0x8EBA,0x6DCC,0x8D9F,0x70EB,0x638F,0x6D9B,0x6ED4, +0x7EE6,0x8404,0x6843,0x9003,0x6DD8,0x9676,0x8BA8,0x5957, +0x7279,0x85E4,0x817E,0x75BC,0x8A8A,0x68AF,0x5254,0x8E22, +0x9511,0x63D0,0x9898,0x8E44,0x557C,0x4F53,0x66FF,0x568F, +0x60D5,0x6D95,0x5243,0x5C49,0x5929,0x6DFB,0x586B,0x7530, +0x751C,0x606C,0x8214,0x8146,0x6311,0x6761,0x8FE2,0x773A, +0x8DF3,0x8D34,0x94C1,0x5E16,0x5385,0x542C,0x70C3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x866D,0x866F,0x8670,0x8672,0x8673,0x8674,0x8675,0x8676, +0x8677,0x8678,0x8683,0x8684,0x8685,0x8686,0x8687,0x8688, +0x8689,0x868E,0x868F,0x8690,0x8691,0x8692,0x8694,0x8696, +0x8697,0x8698,0x8699,0x869A,0x869B,0x869E,0x869F,0x86A0, +0x86A1,0x86A2,0x86A5,0x86A6,0x86AB,0x86AD,0x86AE,0x86B2, +0x86B3,0x86B7,0x86B8,0x86B9,0x86BB,0x86BC,0x86BD,0x86BE, +0x86BF,0x86C1,0x86C2,0x86C3,0x86C5,0x86C8,0x86CC,0x86CD, +0x86D2,0x86D3,0x86D5,0x86D6,0x86D7,0x86DA,0x86DC, 0, +0x86DD,0x86E0,0x86E1,0x86E2,0x86E3,0x86E5,0x86E6,0x86E7, +0x86E8,0x86EA,0x86EB,0x86EC,0x86EF,0x86F5,0x86F6,0x86F7, +0x86FA,0x86FB,0x86FC,0x86FD,0x86FF,0x8701,0x8704,0x8705, +0x8706,0x870B,0x870C,0x870E,0x870F,0x8710,0x8711,0x8714, +0x8716,0x6C40,0x5EF7,0x505C,0x4EAD,0x5EAD,0x633A,0x8247, +0x901A,0x6850,0x916E,0x77B3,0x540C,0x94DC,0x5F64,0x7AE5, +0x6876,0x6345,0x7B52,0x7EDF,0x75DB,0x5077,0x6295,0x5934, +0x900F,0x51F8,0x79C3,0x7A81,0x56FE,0x5F92,0x9014,0x6D82, +0x5C60,0x571F,0x5410,0x5154,0x6E4D,0x56E2,0x63A8,0x9893, +0x817F,0x8715,0x892A,0x9000,0x541E,0x5C6F,0x81C0,0x62D6, +0x6258,0x8131,0x9E35,0x9640,0x9A6E,0x9A7C,0x692D,0x59A5, +0x62D3,0x553E,0x6316,0x54C7,0x86D9,0x6D3C,0x5A03,0x74E6, +0x889C,0x6B6A,0x5916,0x8C4C,0x5F2F,0x6E7E,0x73A9,0x987D, +0x4E38,0x70F7,0x5B8C,0x7897,0x633D,0x665A,0x7696,0x60CB, +0x5B9B,0x5A49,0x4E07,0x8155,0x6C6A,0x738B,0x4EA1,0x6789, +0x7F51,0x5F80,0x65FA,0x671B,0x5FD8,0x5984,0x5A01, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8719,0x871B,0x871D,0x871F,0x8720,0x8724,0x8726,0x8727, +0x8728,0x872A,0x872B,0x872C,0x872D,0x872F,0x8730,0x8732, +0x8733,0x8735,0x8736,0x8738,0x8739,0x873A,0x873C,0x873D, +0x8740,0x8741,0x8742,0x8743,0x8744,0x8745,0x8746,0x874A, +0x874B,0x874D,0x874F,0x8750,0x8751,0x8752,0x8754,0x8755, +0x8756,0x8758,0x875A,0x875B,0x875C,0x875D,0x875E,0x875F, +0x8761,0x8762,0x8766,0x8767,0x8768,0x8769,0x876A,0x876B, +0x876C,0x876D,0x876F,0x8771,0x8772,0x8773,0x8775, 0, +0x8777,0x8778,0x8779,0x877A,0x877F,0x8780,0x8781,0x8784, +0x8786,0x8787,0x8789,0x878A,0x878C,0x878E,0x878F,0x8790, +0x8791,0x8792,0x8794,0x8795,0x8796,0x8798,0x8799,0x879A, +0x879B,0x879C,0x879D,0x879E,0x87A0,0x87A1,0x87A2,0x87A3, +0x87A4,0x5DCD,0x5FAE,0x5371,0x97E6,0x8FDD,0x6845,0x56F4, +0x552F,0x60DF,0x4E3A,0x6F4D,0x7EF4,0x82C7,0x840E,0x59D4, +0x4F1F,0x4F2A,0x5C3E,0x7EAC,0x672A,0x851A,0x5473,0x754F, +0x80C3,0x5582,0x9B4F,0x4F4D,0x6E2D,0x8C13,0x5C09,0x6170, +0x536B,0x761F,0x6E29,0x868A,0x6587,0x95FB,0x7EB9,0x543B, +0x7A33,0x7D0A,0x95EE,0x55E1,0x7FC1,0x74EE,0x631D,0x8717, +0x6DA1,0x7A9D,0x6211,0x65A1,0x5367,0x63E1,0x6C83,0x5DEB, +0x545C,0x94A8,0x4E4C,0x6C61,0x8BEC,0x5C4B,0x65E0,0x829C, +0x68A7,0x543E,0x5434,0x6BCB,0x6B66,0x4E94,0x6342,0x5348, +0x821E,0x4F0D,0x4FAE,0x575E,0x620A,0x96FE,0x6664,0x7269, +0x52FF,0x52A1,0x609F,0x8BEF,0x6614,0x7199,0x6790,0x897F, +0x7852,0x77FD,0x6670,0x563B,0x5438,0x9521,0x727A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x87A5,0x87A6,0x87A7,0x87A9,0x87AA,0x87AE,0x87B0,0x87B1, +0x87B2,0x87B4,0x87B6,0x87B7,0x87B8,0x87B9,0x87BB,0x87BC, +0x87BE,0x87BF,0x87C1,0x87C2,0x87C3,0x87C4,0x87C5,0x87C7, +0x87C8,0x87C9,0x87CC,0x87CD,0x87CE,0x87CF,0x87D0,0x87D4, +0x87D5,0x87D6,0x87D7,0x87D8,0x87D9,0x87DA,0x87DC,0x87DD, +0x87DE,0x87DF,0x87E1,0x87E2,0x87E3,0x87E4,0x87E6,0x87E7, +0x87E8,0x87E9,0x87EB,0x87EC,0x87ED,0x87EF,0x87F0,0x87F1, +0x87F2,0x87F3,0x87F4,0x87F5,0x87F6,0x87F7,0x87F8, 0, +0x87FA,0x87FB,0x87FC,0x87FD,0x87FF,0x8800,0x8801,0x8802, +0x8804,0x8805,0x8806,0x8807,0x8808,0x8809,0x880B,0x880C, +0x880D,0x880E,0x880F,0x8810,0x8811,0x8812,0x8814,0x8817, +0x8818,0x8819,0x881A,0x881C,0x881D,0x881E,0x881F,0x8820, +0x8823,0x7A00,0x606F,0x5E0C,0x6089,0x819D,0x5915,0x60DC, +0x7184,0x70EF,0x6EAA,0x6C50,0x7280,0x6A84,0x88AD,0x5E2D, +0x4E60,0x5AB3,0x559C,0x94E3,0x6D17,0x7CFB,0x9699,0x620F, +0x7EC6,0x778E,0x867E,0x5323,0x971E,0x8F96,0x6687,0x5CE1, +0x4FA0,0x72ED,0x4E0B,0x53A6,0x590F,0x5413,0x6380,0x9528, +0x5148,0x4ED9,0x9C9C,0x7EA4,0x54B8,0x8D24,0x8854,0x8237, +0x95F2,0x6D8E,0x5F26,0x5ACC,0x663E,0x9669,0x73B0,0x732E, +0x53BF,0x817A,0x9985,0x7FA1,0x5BAA,0x9677,0x9650,0x7EBF, +0x76F8,0x53A2,0x9576,0x9999,0x7BB1,0x8944,0x6E58,0x4E61, +0x7FD4,0x7965,0x8BE6,0x60F3,0x54CD,0x4EAB,0x9879,0x5DF7, +0x6A61,0x50CF,0x5411,0x8C61,0x8427,0x785D,0x9704,0x524A, +0x54EE,0x56A3,0x9500,0x6D88,0x5BB5,0x6DC6,0x6653, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8824,0x8825,0x8826,0x8827,0x8828,0x8829,0x882A,0x882B, +0x882C,0x882D,0x882E,0x882F,0x8830,0x8831,0x8833,0x8834, +0x8835,0x8836,0x8837,0x8838,0x883A,0x883B,0x883D,0x883E, +0x883F,0x8841,0x8842,0x8843,0x8846,0x8847,0x8848,0x8849, +0x884A,0x884B,0x884E,0x884F,0x8850,0x8851,0x8852,0x8853, +0x8855,0x8856,0x8858,0x885A,0x885B,0x885C,0x885D,0x885E, +0x885F,0x8860,0x8866,0x8867,0x886A,0x886D,0x886F,0x8871, +0x8873,0x8874,0x8875,0x8876,0x8878,0x8879,0x887A, 0, +0x887B,0x887C,0x8880,0x8883,0x8886,0x8887,0x8889,0x888A, +0x888C,0x888E,0x888F,0x8890,0x8891,0x8893,0x8894,0x8895, +0x8897,0x8898,0x8899,0x889A,0x889B,0x889D,0x889E,0x889F, +0x88A0,0x88A1,0x88A3,0x88A5,0x88A6,0x88A7,0x88A8,0x88A9, +0x88AA,0x5C0F,0x5B5D,0x6821,0x8096,0x5578,0x7B11,0x6548, +0x6954,0x4E9B,0x6B47,0x874E,0x978B,0x534F,0x631F,0x643A, +0x90AA,0x659C,0x80C1,0x8C10,0x5199,0x68B0,0x5378,0x87F9, +0x61C8,0x6CC4,0x6CFB,0x8C22,0x5C51,0x85AA,0x82AF,0x950C, +0x6B23,0x8F9B,0x65B0,0x5FFB,0x5FC3,0x4FE1,0x8845,0x661F, +0x8165,0x7329,0x60FA,0x5174,0x5211,0x578B,0x5F62,0x90A2, +0x884C,0x9192,0x5E78,0x674F,0x6027,0x59D3,0x5144,0x51F6, +0x80F8,0x5308,0x6C79,0x96C4,0x718A,0x4F11,0x4FEE,0x7F9E, +0x673D,0x55C5,0x9508,0x79C0,0x8896,0x7EE3,0x589F,0x620C, +0x9700,0x865A,0x5618,0x987B,0x5F90,0x8BB8,0x84C4,0x9157, +0x53D9,0x65ED,0x5E8F,0x755C,0x6064,0x7D6E,0x5A7F,0x7EEA, +0x7EED,0x8F69,0x55A7,0x5BA3,0x60AC,0x65CB,0x7384, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x88AC,0x88AE,0x88AF,0x88B0,0x88B2,0x88B3,0x88B4,0x88B5, +0x88B6,0x88B8,0x88B9,0x88BA,0x88BB,0x88BD,0x88BE,0x88BF, +0x88C0,0x88C3,0x88C4,0x88C7,0x88C8,0x88CA,0x88CB,0x88CC, +0x88CD,0x88CF,0x88D0,0x88D1,0x88D3,0x88D6,0x88D7,0x88DA, +0x88DB,0x88DC,0x88DD,0x88DE,0x88E0,0x88E1,0x88E6,0x88E7, +0x88E9,0x88EA,0x88EB,0x88EC,0x88ED,0x88EE,0x88EF,0x88F2, +0x88F5,0x88F6,0x88F7,0x88FA,0x88FB,0x88FD,0x88FF,0x8900, +0x8901,0x8903,0x8904,0x8905,0x8906,0x8907,0x8908, 0, +0x8909,0x890B,0x890C,0x890D,0x890E,0x890F,0x8911,0x8914, +0x8915,0x8916,0x8917,0x8918,0x891C,0x891D,0x891E,0x891F, +0x8920,0x8922,0x8923,0x8924,0x8926,0x8927,0x8928,0x8929, +0x892C,0x892D,0x892E,0x892F,0x8931,0x8932,0x8933,0x8935, +0x8937,0x9009,0x7663,0x7729,0x7EDA,0x9774,0x859B,0x5B66, +0x7A74,0x96EA,0x8840,0x52CB,0x718F,0x5FAA,0x65EC,0x8BE2, +0x5BFB,0x9A6F,0x5DE1,0x6B89,0x6C5B,0x8BAD,0x8BAF,0x900A, +0x8FC5,0x538B,0x62BC,0x9E26,0x9E2D,0x5440,0x4E2B,0x82BD, +0x7259,0x869C,0x5D16,0x8859,0x6DAF,0x96C5,0x54D1,0x4E9A, +0x8BB6,0x7109,0x54BD,0x9609,0x70DF,0x6DF9,0x76D0,0x4E25, +0x7814,0x8712,0x5CA9,0x5EF6,0x8A00,0x989C,0x960E,0x708E, +0x6CBF,0x5944,0x63A9,0x773C,0x884D,0x6F14,0x8273,0x5830, +0x71D5,0x538C,0x781A,0x96C1,0x5501,0x5F66,0x7130,0x5BB4, +0x8C1A,0x9A8C,0x6B83,0x592E,0x9E2F,0x79E7,0x6768,0x626C, +0x4F6F,0x75A1,0x7F8A,0x6D0B,0x9633,0x6C27,0x4EF0,0x75D2, +0x517B,0x6837,0x6F3E,0x9080,0x8170,0x5996,0x7476, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8938,0x8939,0x893A,0x893B,0x893C,0x893D,0x893E,0x893F, +0x8940,0x8942,0x8943,0x8945,0x8946,0x8947,0x8948,0x8949, +0x894A,0x894B,0x894C,0x894D,0x894E,0x894F,0x8950,0x8951, +0x8952,0x8953,0x8954,0x8955,0x8956,0x8957,0x8958,0x8959, +0x895A,0x895B,0x895C,0x895D,0x8960,0x8961,0x8962,0x8963, +0x8964,0x8965,0x8967,0x8968,0x8969,0x896A,0x896B,0x896C, +0x896D,0x896E,0x896F,0x8970,0x8971,0x8972,0x8973,0x8974, +0x8975,0x8976,0x8977,0x8978,0x8979,0x897A,0x897C, 0, +0x897D,0x897E,0x8980,0x8982,0x8984,0x8985,0x8987,0x8988, +0x8989,0x898A,0x898B,0x898C,0x898D,0x898E,0x898F,0x8990, +0x8991,0x8992,0x8993,0x8994,0x8995,0x8996,0x8997,0x8998, +0x8999,0x899A,0x899B,0x899C,0x899D,0x899E,0x899F,0x89A0, +0x89A1,0x6447,0x5C27,0x9065,0x7A91,0x8C23,0x59DA,0x54AC, +0x8200,0x836F,0x8981,0x8000,0x6930,0x564E,0x8036,0x7237, +0x91CE,0x51B6,0x4E5F,0x9875,0x6396,0x4E1A,0x53F6,0x66F3, +0x814B,0x591C,0x6DB2,0x4E00,0x58F9,0x533B,0x63D6,0x94F1, +0x4F9D,0x4F0A,0x8863,0x9890,0x5937,0x9057,0x79FB,0x4EEA, +0x80F0,0x7591,0x6C82,0x5B9C,0x59E8,0x5F5D,0x6905,0x8681, +0x501A,0x5DF2,0x4E59,0x77E3,0x4EE5,0x827A,0x6291,0x6613, +0x9091,0x5C79,0x4EBF,0x5F79,0x81C6,0x9038,0x8084,0x75AB, +0x4EA6,0x88D4,0x610F,0x6BC5,0x5FC6,0x4E49,0x76CA,0x6EA2, +0x8BE3,0x8BAE,0x8C0A,0x8BD1,0x5F02,0x7FFC,0x7FCC,0x7ECE, +0x8335,0x836B,0x56E0,0x6BB7,0x97F3,0x9634,0x59FB,0x541F, +0x94F6,0x6DEB,0x5BC5,0x996E,0x5C39,0x5F15,0x9690, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x89A2,0x89A3,0x89A4,0x89A5,0x89A6,0x89A7,0x89A8,0x89A9, +0x89AA,0x89AB,0x89AC,0x89AD,0x89AE,0x89AF,0x89B0,0x89B1, +0x89B2,0x89B3,0x89B4,0x89B5,0x89B6,0x89B7,0x89B8,0x89B9, +0x89BA,0x89BB,0x89BC,0x89BD,0x89BE,0x89BF,0x89C0,0x89C3, +0x89CD,0x89D3,0x89D4,0x89D5,0x89D7,0x89D8,0x89D9,0x89DB, +0x89DD,0x89DF,0x89E0,0x89E1,0x89E2,0x89E4,0x89E7,0x89E8, +0x89E9,0x89EA,0x89EC,0x89ED,0x89EE,0x89F0,0x89F1,0x89F2, +0x89F4,0x89F5,0x89F6,0x89F7,0x89F8,0x89F9,0x89FA, 0, +0x89FB,0x89FC,0x89FD,0x89FE,0x89FF,0x8A01,0x8A02,0x8A03, +0x8A04,0x8A05,0x8A06,0x8A08,0x8A09,0x8A0A,0x8A0B,0x8A0C, +0x8A0D,0x8A0E,0x8A0F,0x8A10,0x8A11,0x8A12,0x8A13,0x8A14, +0x8A15,0x8A16,0x8A17,0x8A18,0x8A19,0x8A1A,0x8A1B,0x8A1C, +0x8A1D,0x5370,0x82F1,0x6A31,0x5A74,0x9E70,0x5E94,0x7F28, +0x83B9,0x8424,0x8425,0x8367,0x8747,0x8FCE,0x8D62,0x76C8, +0x5F71,0x9896,0x786C,0x6620,0x54DF,0x62E5,0x4F63,0x81C3, +0x75C8,0x5EB8,0x96CD,0x8E0A,0x86F9,0x548F,0x6CF3,0x6D8C, +0x6C38,0x607F,0x52C7,0x7528,0x5E7D,0x4F18,0x60A0,0x5FE7, +0x5C24,0x7531,0x90AE,0x94C0,0x72B9,0x6CB9,0x6E38,0x9149, +0x6709,0x53CB,0x53F3,0x4F51,0x91C9,0x8BF1,0x53C8,0x5E7C, +0x8FC2,0x6DE4,0x4E8E,0x76C2,0x6986,0x865E,0x611A,0x8206, +0x4F59,0x4FDE,0x903E,0x9C7C,0x6109,0x6E1D,0x6E14,0x9685, +0x4E88,0x5A31,0x96E8,0x4E0E,0x5C7F,0x79B9,0x5B87,0x8BED, +0x7FBD,0x7389,0x57DF,0x828B,0x90C1,0x5401,0x9047,0x55BB, +0x5CEA,0x5FA1,0x6108,0x6B32,0x72F1,0x80B2,0x8A89, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8A1E,0x8A1F,0x8A20,0x8A21,0x8A22,0x8A23,0x8A24,0x8A25, +0x8A26,0x8A27,0x8A28,0x8A29,0x8A2A,0x8A2B,0x8A2C,0x8A2D, +0x8A2E,0x8A2F,0x8A30,0x8A31,0x8A32,0x8A33,0x8A34,0x8A35, +0x8A36,0x8A37,0x8A38,0x8A39,0x8A3A,0x8A3B,0x8A3C,0x8A3D, +0x8A3F,0x8A40,0x8A41,0x8A42,0x8A43,0x8A44,0x8A45,0x8A46, +0x8A47,0x8A49,0x8A4A,0x8A4B,0x8A4C,0x8A4D,0x8A4E,0x8A4F, +0x8A50,0x8A51,0x8A52,0x8A53,0x8A54,0x8A55,0x8A56,0x8A57, +0x8A58,0x8A59,0x8A5A,0x8A5B,0x8A5C,0x8A5D,0x8A5E, 0, +0x8A5F,0x8A60,0x8A61,0x8A62,0x8A63,0x8A64,0x8A65,0x8A66, +0x8A67,0x8A68,0x8A69,0x8A6A,0x8A6B,0x8A6C,0x8A6D,0x8A6E, +0x8A6F,0x8A70,0x8A71,0x8A72,0x8A73,0x8A74,0x8A75,0x8A76, +0x8A77,0x8A78,0x8A7A,0x8A7B,0x8A7C,0x8A7D,0x8A7E,0x8A7F, +0x8A80,0x6D74,0x5BD3,0x88D5,0x9884,0x8C6B,0x9A6D,0x9E33, +0x6E0A,0x51A4,0x5143,0x57A3,0x8881,0x539F,0x63F4,0x8F95, +0x56ED,0x5458,0x5706,0x733F,0x6E90,0x7F18,0x8FDC,0x82D1, +0x613F,0x6028,0x9662,0x66F0,0x7EA6,0x8D8A,0x8DC3,0x94A5, +0x5CB3,0x7CA4,0x6708,0x60A6,0x9605,0x8018,0x4E91,0x90E7, +0x5300,0x9668,0x5141,0x8FD0,0x8574,0x915D,0x6655,0x97F5, +0x5B55,0x531D,0x7838,0x6742,0x683D,0x54C9,0x707E,0x5BB0, +0x8F7D,0x518D,0x5728,0x54B1,0x6512,0x6682,0x8D5E,0x8D43, +0x810F,0x846C,0x906D,0x7CDF,0x51FF,0x85FB,0x67A3,0x65E9, +0x6FA1,0x86A4,0x8E81,0x566A,0x9020,0x7682,0x7076,0x71E5, +0x8D23,0x62E9,0x5219,0x6CFD,0x8D3C,0x600E,0x589E,0x618E, +0x66FE,0x8D60,0x624E,0x55B3,0x6E23,0x672D,0x8F67, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8A81,0x8A82,0x8A83,0x8A84,0x8A85,0x8A86,0x8A87,0x8A88, +0x8A8B,0x8A8C,0x8A8D,0x8A8E,0x8A8F,0x8A90,0x8A91,0x8A92, +0x8A94,0x8A95,0x8A96,0x8A97,0x8A98,0x8A99,0x8A9A,0x8A9B, +0x8A9C,0x8A9D,0x8A9E,0x8A9F,0x8AA0,0x8AA1,0x8AA2,0x8AA3, +0x8AA4,0x8AA5,0x8AA6,0x8AA7,0x8AA8,0x8AA9,0x8AAA,0x8AAB, +0x8AAC,0x8AAD,0x8AAE,0x8AAF,0x8AB0,0x8AB1,0x8AB2,0x8AB3, +0x8AB4,0x8AB5,0x8AB6,0x8AB7,0x8AB8,0x8AB9,0x8ABA,0x8ABB, +0x8ABC,0x8ABD,0x8ABE,0x8ABF,0x8AC0,0x8AC1,0x8AC2, 0, +0x8AC3,0x8AC4,0x8AC5,0x8AC6,0x8AC7,0x8AC8,0x8AC9,0x8ACA, +0x8ACB,0x8ACC,0x8ACD,0x8ACE,0x8ACF,0x8AD0,0x8AD1,0x8AD2, +0x8AD3,0x8AD4,0x8AD5,0x8AD6,0x8AD7,0x8AD8,0x8AD9,0x8ADA, +0x8ADB,0x8ADC,0x8ADD,0x8ADE,0x8ADF,0x8AE0,0x8AE1,0x8AE2, +0x8AE3,0x94E1,0x95F8,0x7728,0x6805,0x69A8,0x548B,0x4E4D, +0x70B8,0x8BC8,0x6458,0x658B,0x5B85,0x7A84,0x503A,0x5BE8, +0x77BB,0x6BE1,0x8A79,0x7C98,0x6CBE,0x76CF,0x65A9,0x8F97, +0x5D2D,0x5C55,0x8638,0x6808,0x5360,0x6218,0x7AD9,0x6E5B, +0x7EFD,0x6A1F,0x7AE0,0x5F70,0x6F33,0x5F20,0x638C,0x6DA8, +0x6756,0x4E08,0x5E10,0x8D26,0x4ED7,0x80C0,0x7634,0x969C, +0x62DB,0x662D,0x627E,0x6CBC,0x8D75,0x7167,0x7F69,0x5146, +0x8087,0x53EC,0x906E,0x6298,0x54F2,0x86F0,0x8F99,0x8005, +0x9517,0x8517,0x8FD9,0x6D59,0x73CD,0x659F,0x771F,0x7504, +0x7827,0x81FB,0x8D1E,0x9488,0x4FA6,0x6795,0x75B9,0x8BCA, +0x9707,0x632F,0x9547,0x9635,0x84B8,0x6323,0x7741,0x5F81, +0x72F0,0x4E89,0x6014,0x6574,0x62EF,0x6B63,0x653F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8AE4,0x8AE5,0x8AE6,0x8AE7,0x8AE8,0x8AE9,0x8AEA,0x8AEB, +0x8AEC,0x8AED,0x8AEE,0x8AEF,0x8AF0,0x8AF1,0x8AF2,0x8AF3, +0x8AF4,0x8AF5,0x8AF6,0x8AF7,0x8AF8,0x8AF9,0x8AFA,0x8AFB, +0x8AFC,0x8AFD,0x8AFE,0x8AFF,0x8B00,0x8B01,0x8B02,0x8B03, +0x8B04,0x8B05,0x8B06,0x8B08,0x8B09,0x8B0A,0x8B0B,0x8B0C, +0x8B0D,0x8B0E,0x8B0F,0x8B10,0x8B11,0x8B12,0x8B13,0x8B14, +0x8B15,0x8B16,0x8B17,0x8B18,0x8B19,0x8B1A,0x8B1B,0x8B1C, +0x8B1D,0x8B1E,0x8B1F,0x8B20,0x8B21,0x8B22,0x8B23, 0, +0x8B24,0x8B25,0x8B27,0x8B28,0x8B29,0x8B2A,0x8B2B,0x8B2C, +0x8B2D,0x8B2E,0x8B2F,0x8B30,0x8B31,0x8B32,0x8B33,0x8B34, +0x8B35,0x8B36,0x8B37,0x8B38,0x8B39,0x8B3A,0x8B3B,0x8B3C, +0x8B3D,0x8B3E,0x8B3F,0x8B40,0x8B41,0x8B42,0x8B43,0x8B44, +0x8B45,0x5E27,0x75C7,0x90D1,0x8BC1,0x829D,0x679D,0x652F, +0x5431,0x8718,0x77E5,0x80A2,0x8102,0x6C41,0x4E4B,0x7EC7, +0x804C,0x76F4,0x690D,0x6B96,0x6267,0x503C,0x4F84,0x5740, +0x6307,0x6B62,0x8DBE,0x53EA,0x65E8,0x7EB8,0x5FD7,0x631A, +0x63B7,0x81F3,0x81F4,0x7F6E,0x5E1C,0x5CD9,0x5236,0x667A, +0x79E9,0x7A1A,0x8D28,0x7099,0x75D4,0x6EDE,0x6CBB,0x7A92, +0x4E2D,0x76C5,0x5FE0,0x949F,0x8877,0x7EC8,0x79CD,0x80BF, +0x91CD,0x4EF2,0x4F17,0x821F,0x5468,0x5DDE,0x6D32,0x8BCC, +0x7CA5,0x8F74,0x8098,0x5E1A,0x5492,0x76B1,0x5B99,0x663C, +0x9AA4,0x73E0,0x682A,0x86DB,0x6731,0x732A,0x8BF8,0x8BDB, +0x9010,0x7AF9,0x70DB,0x716E,0x62C4,0x77A9,0x5631,0x4E3B, +0x8457,0x67F1,0x52A9,0x86C0,0x8D2E,0x94F8,0x7B51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B46,0x8B47,0x8B48,0x8B49,0x8B4A,0x8B4B,0x8B4C,0x8B4D, +0x8B4E,0x8B4F,0x8B50,0x8B51,0x8B52,0x8B53,0x8B54,0x8B55, +0x8B56,0x8B57,0x8B58,0x8B59,0x8B5A,0x8B5B,0x8B5C,0x8B5D, +0x8B5E,0x8B5F,0x8B60,0x8B61,0x8B62,0x8B63,0x8B64,0x8B65, +0x8B67,0x8B68,0x8B69,0x8B6A,0x8B6B,0x8B6D,0x8B6E,0x8B6F, +0x8B70,0x8B71,0x8B72,0x8B73,0x8B74,0x8B75,0x8B76,0x8B77, +0x8B78,0x8B79,0x8B7A,0x8B7B,0x8B7C,0x8B7D,0x8B7E,0x8B7F, +0x8B80,0x8B81,0x8B82,0x8B83,0x8B84,0x8B85,0x8B86, 0, +0x8B87,0x8B88,0x8B89,0x8B8A,0x8B8B,0x8B8C,0x8B8D,0x8B8E, +0x8B8F,0x8B90,0x8B91,0x8B92,0x8B93,0x8B94,0x8B95,0x8B96, +0x8B97,0x8B98,0x8B99,0x8B9A,0x8B9B,0x8B9C,0x8B9D,0x8B9E, +0x8B9F,0x8BAC,0x8BB1,0x8BBB,0x8BC7,0x8BD0,0x8BEA,0x8C09, +0x8C1E,0x4F4F,0x6CE8,0x795D,0x9A7B,0x6293,0x722A,0x62FD, +0x4E13,0x7816,0x8F6C,0x64B0,0x8D5A,0x7BC6,0x6869,0x5E84, +0x88C5,0x5986,0x649E,0x58EE,0x72B6,0x690E,0x9525,0x8FFD, +0x8D58,0x5760,0x7F00,0x8C06,0x51C6,0x6349,0x62D9,0x5353, +0x684C,0x7422,0x8301,0x914C,0x5544,0x7740,0x707C,0x6D4A, +0x5179,0x54A8,0x8D44,0x59FF,0x6ECB,0x6DC4,0x5B5C,0x7D2B, +0x4ED4,0x7C7D,0x6ED3,0x5B50,0x81EA,0x6E0D,0x5B57,0x9B03, +0x68D5,0x8E2A,0x5B97,0x7EFC,0x603B,0x7EB5,0x90B9,0x8D70, +0x594F,0x63CD,0x79DF,0x8DB3,0x5352,0x65CF,0x7956,0x8BC5, +0x963B,0x7EC4,0x94BB,0x7E82,0x5634,0x9189,0x6700,0x7F6A, +0x5C0A,0x9075,0x6628,0x5DE6,0x4F50,0x67DE,0x505A,0x4F5C, +0x5750,0x5EA7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8C38,0x8C39,0x8C3A,0x8C3B,0x8C3C,0x8C3D,0x8C3E,0x8C3F, +0x8C40,0x8C42,0x8C43,0x8C44,0x8C45,0x8C48,0x8C4A,0x8C4B, +0x8C4D,0x8C4E,0x8C4F,0x8C50,0x8C51,0x8C52,0x8C53,0x8C54, +0x8C56,0x8C57,0x8C58,0x8C59,0x8C5B,0x8C5C,0x8C5D,0x8C5E, +0x8C5F,0x8C60,0x8C63,0x8C64,0x8C65,0x8C66,0x8C67,0x8C68, +0x8C69,0x8C6C,0x8C6D,0x8C6E,0x8C6F,0x8C70,0x8C71,0x8C72, +0x8C74,0x8C75,0x8C76,0x8C77,0x8C7B,0x8C7C,0x8C7D,0x8C7E, +0x8C7F,0x8C80,0x8C81,0x8C83,0x8C84,0x8C86,0x8C87, 0, +0x8C88,0x8C8B,0x8C8D,0x8C8E,0x8C8F,0x8C90,0x8C91,0x8C92, +0x8C93,0x8C95,0x8C96,0x8C97,0x8C99,0x8C9A,0x8C9B,0x8C9C, +0x8C9D,0x8C9E,0x8C9F,0x8CA0,0x8CA1,0x8CA2,0x8CA3,0x8CA4, +0x8CA5,0x8CA6,0x8CA7,0x8CA8,0x8CA9,0x8CAA,0x8CAB,0x8CAC, +0x8CAD,0x4E8D,0x4E0C,0x5140,0x4E10,0x5EFF,0x5345,0x4E15, +0x4E98,0x4E1E,0x9B32,0x5B6C,0x5669,0x4E28,0x79BA,0x4E3F, +0x5315,0x4E47,0x592D,0x723B,0x536E,0x6C10,0x56DF,0x80E4, +0x9997,0x6BD3,0x777E,0x9F17,0x4E36,0x4E9F,0x9F10,0x4E5C, +0x4E69,0x4E93,0x8288,0x5B5B,0x556C,0x560F,0x4EC4,0x538D, +0x539D,0x53A3,0x53A5,0x53AE,0x9765,0x8D5D,0x531A,0x53F5, +0x5326,0x532E,0x533E,0x8D5C,0x5366,0x5363,0x5202,0x5208, +0x520E,0x522D,0x5233,0x523F,0x5240,0x524C,0x525E,0x5261, +0x525C,0x84AF,0x527D,0x5282,0x5281,0x5290,0x5293,0x5182, +0x7F54,0x4EBB,0x4EC3,0x4EC9,0x4EC2,0x4EE8,0x4EE1,0x4EEB, +0x4EDE,0x4F1B,0x4EF3,0x4F22,0x4F64,0x4EF5,0x4F25,0x4F27, +0x4F09,0x4F2B,0x4F5E,0x4F67,0x6538,0x4F5A,0x4F5D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8CAE,0x8CAF,0x8CB0,0x8CB1,0x8CB2,0x8CB3,0x8CB4,0x8CB5, +0x8CB6,0x8CB7,0x8CB8,0x8CB9,0x8CBA,0x8CBB,0x8CBC,0x8CBD, +0x8CBE,0x8CBF,0x8CC0,0x8CC1,0x8CC2,0x8CC3,0x8CC4,0x8CC5, +0x8CC6,0x8CC7,0x8CC8,0x8CC9,0x8CCA,0x8CCB,0x8CCC,0x8CCD, +0x8CCE,0x8CCF,0x8CD0,0x8CD1,0x8CD2,0x8CD3,0x8CD4,0x8CD5, +0x8CD6,0x8CD7,0x8CD8,0x8CD9,0x8CDA,0x8CDB,0x8CDC,0x8CDD, +0x8CDE,0x8CDF,0x8CE0,0x8CE1,0x8CE2,0x8CE3,0x8CE4,0x8CE5, +0x8CE6,0x8CE7,0x8CE8,0x8CE9,0x8CEA,0x8CEB,0x8CEC, 0, +0x8CED,0x8CEE,0x8CEF,0x8CF0,0x8CF1,0x8CF2,0x8CF3,0x8CF4, +0x8CF5,0x8CF6,0x8CF7,0x8CF8,0x8CF9,0x8CFA,0x8CFB,0x8CFC, +0x8CFD,0x8CFE,0x8CFF,0x8D00,0x8D01,0x8D02,0x8D03,0x8D04, +0x8D05,0x8D06,0x8D07,0x8D08,0x8D09,0x8D0A,0x8D0B,0x8D0C, +0x8D0D,0x4F5F,0x4F57,0x4F32,0x4F3D,0x4F76,0x4F74,0x4F91, +0x4F89,0x4F83,0x4F8F,0x4F7E,0x4F7B,0x4FAA,0x4F7C,0x4FAC, +0x4F94,0x4FE6,0x4FE8,0x4FEA,0x4FC5,0x4FDA,0x4FE3,0x4FDC, +0x4FD1,0x4FDF,0x4FF8,0x5029,0x504C,0x4FF3,0x502C,0x500F, +0x502E,0x502D,0x4FFE,0x501C,0x500C,0x5025,0x5028,0x507E, +0x5043,0x5055,0x5048,0x504E,0x506C,0x507B,0x50A5,0x50A7, +0x50A9,0x50BA,0x50D6,0x5106,0x50ED,0x50EC,0x50E6,0x50EE, +0x5107,0x510B,0x4EDD,0x6C3D,0x4F58,0x4F65,0x4FCE,0x9FA0, +0x6C46,0x7C74,0x516E,0x5DFD,0x9EC9,0x9998,0x5181,0x5914, +0x52F9,0x530D,0x8A07,0x5310,0x51EB,0x5919,0x5155,0x4EA0, +0x5156,0x4EB3,0x886E,0x88A4,0x4EB5,0x8114,0x88D2,0x7980, +0x5B34,0x8803,0x7FB8,0x51AB,0x51B1,0x51BD,0x51BC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8D0E,0x8D0F,0x8D10,0x8D11,0x8D12,0x8D13,0x8D14,0x8D15, +0x8D16,0x8D17,0x8D18,0x8D19,0x8D1A,0x8D1B,0x8D1C,0x8D20, +0x8D51,0x8D52,0x8D57,0x8D5F,0x8D65,0x8D68,0x8D69,0x8D6A, +0x8D6C,0x8D6E,0x8D6F,0x8D71,0x8D72,0x8D78,0x8D79,0x8D7A, +0x8D7B,0x8D7C,0x8D7D,0x8D7E,0x8D7F,0x8D80,0x8D82,0x8D83, +0x8D86,0x8D87,0x8D88,0x8D89,0x8D8C,0x8D8D,0x8D8E,0x8D8F, +0x8D90,0x8D92,0x8D93,0x8D95,0x8D96,0x8D97,0x8D98,0x8D99, +0x8D9A,0x8D9B,0x8D9C,0x8D9D,0x8D9E,0x8DA0,0x8DA1, 0, +0x8DA2,0x8DA4,0x8DA5,0x8DA6,0x8DA7,0x8DA8,0x8DA9,0x8DAA, +0x8DAB,0x8DAC,0x8DAD,0x8DAE,0x8DAF,0x8DB0,0x8DB2,0x8DB6, +0x8DB7,0x8DB9,0x8DBB,0x8DBD,0x8DC0,0x8DC1,0x8DC2,0x8DC5, +0x8DC7,0x8DC8,0x8DC9,0x8DCA,0x8DCD,0x8DD0,0x8DD2,0x8DD3, +0x8DD4,0x51C7,0x5196,0x51A2,0x51A5,0x8BA0,0x8BA6,0x8BA7, +0x8BAA,0x8BB4,0x8BB5,0x8BB7,0x8BC2,0x8BC3,0x8BCB,0x8BCF, +0x8BCE,0x8BD2,0x8BD3,0x8BD4,0x8BD6,0x8BD8,0x8BD9,0x8BDC, +0x8BDF,0x8BE0,0x8BE4,0x8BE8,0x8BE9,0x8BEE,0x8BF0,0x8BF3, +0x8BF6,0x8BF9,0x8BFC,0x8BFF,0x8C00,0x8C02,0x8C04,0x8C07, +0x8C0C,0x8C0F,0x8C11,0x8C12,0x8C14,0x8C15,0x8C16,0x8C19, +0x8C1B,0x8C18,0x8C1D,0x8C1F,0x8C20,0x8C21,0x8C25,0x8C27, +0x8C2A,0x8C2B,0x8C2E,0x8C2F,0x8C32,0x8C33,0x8C35,0x8C36, +0x5369,0x537A,0x961D,0x9622,0x9621,0x9631,0x962A,0x963D, +0x963C,0x9642,0x9649,0x9654,0x965F,0x9667,0x966C,0x9672, +0x9674,0x9688,0x968D,0x9697,0x96B0,0x9097,0x909B,0x909D, +0x9099,0x90AC,0x90A1,0x90B4,0x90B3,0x90B6,0x90BA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8DD5,0x8DD8,0x8DD9,0x8DDC,0x8DE0,0x8DE1,0x8DE2,0x8DE5, +0x8DE6,0x8DE7,0x8DE9,0x8DED,0x8DEE,0x8DF0,0x8DF1,0x8DF2, +0x8DF4,0x8DF6,0x8DFC,0x8DFE,0x8DFF,0x8E00,0x8E01,0x8E02, +0x8E03,0x8E04,0x8E06,0x8E07,0x8E08,0x8E0B,0x8E0D,0x8E0E, +0x8E10,0x8E11,0x8E12,0x8E13,0x8E15,0x8E16,0x8E17,0x8E18, +0x8E19,0x8E1A,0x8E1B,0x8E1C,0x8E20,0x8E21,0x8E24,0x8E25, +0x8E26,0x8E27,0x8E28,0x8E2B,0x8E2D,0x8E30,0x8E32,0x8E33, +0x8E34,0x8E36,0x8E37,0x8E38,0x8E3B,0x8E3C,0x8E3E, 0, +0x8E3F,0x8E43,0x8E45,0x8E46,0x8E4C,0x8E4D,0x8E4E,0x8E4F, +0x8E50,0x8E53,0x8E54,0x8E55,0x8E56,0x8E57,0x8E58,0x8E5A, +0x8E5B,0x8E5C,0x8E5D,0x8E5E,0x8E5F,0x8E60,0x8E61,0x8E62, +0x8E63,0x8E64,0x8E65,0x8E67,0x8E68,0x8E6A,0x8E6B,0x8E6E, +0x8E71,0x90B8,0x90B0,0x90CF,0x90C5,0x90BE,0x90D0,0x90C4, +0x90C7,0x90D3,0x90E6,0x90E2,0x90DC,0x90D7,0x90DB,0x90EB, +0x90EF,0x90FE,0x9104,0x9122,0x911E,0x9123,0x9131,0x912F, +0x9139,0x9143,0x9146,0x520D,0x5942,0x52A2,0x52AC,0x52AD, +0x52BE,0x54FF,0x52D0,0x52D6,0x52F0,0x53DF,0x71EE,0x77CD, +0x5EF4,0x51F5,0x51FC,0x9B2F,0x53B6,0x5F01,0x755A,0x5DEF, +0x574C,0x57A9,0x57A1,0x587E,0x58BC,0x58C5,0x58D1,0x5729, +0x572C,0x572A,0x5733,0x5739,0x572E,0x572F,0x575C,0x573B, +0x5742,0x5769,0x5785,0x576B,0x5786,0x577C,0x577B,0x5768, +0x576D,0x5776,0x5773,0x57AD,0x57A4,0x578C,0x57B2,0x57CF, +0x57A7,0x57B4,0x5793,0x57A0,0x57D5,0x57D8,0x57DA,0x57D9, +0x57D2,0x57B8,0x57F4,0x57EF,0x57F8,0x57E4,0x57DD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E73,0x8E75,0x8E77,0x8E78,0x8E79,0x8E7A,0x8E7B,0x8E7D, +0x8E7E,0x8E80,0x8E82,0x8E83,0x8E84,0x8E86,0x8E88,0x8E89, +0x8E8A,0x8E8B,0x8E8C,0x8E8D,0x8E8E,0x8E91,0x8E92,0x8E93, +0x8E95,0x8E96,0x8E97,0x8E98,0x8E99,0x8E9A,0x8E9B,0x8E9D, +0x8E9F,0x8EA0,0x8EA1,0x8EA2,0x8EA3,0x8EA4,0x8EA5,0x8EA6, +0x8EA7,0x8EA8,0x8EA9,0x8EAA,0x8EAD,0x8EAE,0x8EB0,0x8EB1, +0x8EB3,0x8EB4,0x8EB5,0x8EB6,0x8EB7,0x8EB8,0x8EB9,0x8EBB, +0x8EBC,0x8EBD,0x8EBE,0x8EBF,0x8EC0,0x8EC1,0x8EC2, 0, +0x8EC3,0x8EC4,0x8EC5,0x8EC6,0x8EC7,0x8EC8,0x8EC9,0x8ECA, +0x8ECB,0x8ECC,0x8ECD,0x8ECF,0x8ED0,0x8ED1,0x8ED2,0x8ED3, +0x8ED4,0x8ED5,0x8ED6,0x8ED7,0x8ED8,0x8ED9,0x8EDA,0x8EDB, +0x8EDC,0x8EDD,0x8EDE,0x8EDF,0x8EE0,0x8EE1,0x8EE2,0x8EE3, +0x8EE4,0x580B,0x580D,0x57FD,0x57ED,0x5800,0x581E,0x5819, +0x5844,0x5820,0x5865,0x586C,0x5881,0x5889,0x589A,0x5880, +0x99A8,0x9F19,0x61FF,0x8279,0x827D,0x827F,0x828F,0x828A, +0x82A8,0x8284,0x828E,0x8291,0x8297,0x8299,0x82AB,0x82B8, +0x82BE,0x82B0,0x82C8,0x82CA,0x82E3,0x8298,0x82B7,0x82AE, +0x82CB,0x82CC,0x82C1,0x82A9,0x82B4,0x82A1,0x82AA,0x829F, +0x82C4,0x82CE,0x82A4,0x82E1,0x8309,0x82F7,0x82E4,0x830F, +0x8307,0x82DC,0x82F4,0x82D2,0x82D8,0x830C,0x82FB,0x82D3, +0x8311,0x831A,0x8306,0x8314,0x8315,0x82E0,0x82D5,0x831C, +0x8351,0x835B,0x835C,0x8308,0x8392,0x833C,0x8334,0x8331, +0x839B,0x835E,0x832F,0x834F,0x8347,0x8343,0x835F,0x8340, +0x8317,0x8360,0x832D,0x833A,0x8333,0x8366,0x8365, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8EE5,0x8EE6,0x8EE7,0x8EE8,0x8EE9,0x8EEA,0x8EEB,0x8EEC, +0x8EED,0x8EEE,0x8EEF,0x8EF0,0x8EF1,0x8EF2,0x8EF3,0x8EF4, +0x8EF5,0x8EF6,0x8EF7,0x8EF8,0x8EF9,0x8EFA,0x8EFB,0x8EFC, +0x8EFD,0x8EFE,0x8EFF,0x8F00,0x8F01,0x8F02,0x8F03,0x8F04, +0x8F05,0x8F06,0x8F07,0x8F08,0x8F09,0x8F0A,0x8F0B,0x8F0C, +0x8F0D,0x8F0E,0x8F0F,0x8F10,0x8F11,0x8F12,0x8F13,0x8F14, +0x8F15,0x8F16,0x8F17,0x8F18,0x8F19,0x8F1A,0x8F1B,0x8F1C, +0x8F1D,0x8F1E,0x8F1F,0x8F20,0x8F21,0x8F22,0x8F23, 0, +0x8F24,0x8F25,0x8F26,0x8F27,0x8F28,0x8F29,0x8F2A,0x8F2B, +0x8F2C,0x8F2D,0x8F2E,0x8F2F,0x8F30,0x8F31,0x8F32,0x8F33, +0x8F34,0x8F35,0x8F36,0x8F37,0x8F38,0x8F39,0x8F3A,0x8F3B, +0x8F3C,0x8F3D,0x8F3E,0x8F3F,0x8F40,0x8F41,0x8F42,0x8F43, +0x8F44,0x8368,0x831B,0x8369,0x836C,0x836A,0x836D,0x836E, +0x83B0,0x8378,0x83B3,0x83B4,0x83A0,0x83AA,0x8393,0x839C, +0x8385,0x837C,0x83B6,0x83A9,0x837D,0x83B8,0x837B,0x8398, +0x839E,0x83A8,0x83BA,0x83BC,0x83C1,0x8401,0x83E5,0x83D8, +0x5807,0x8418,0x840B,0x83DD,0x83FD,0x83D6,0x841C,0x8438, +0x8411,0x8406,0x83D4,0x83DF,0x840F,0x8403,0x83F8,0x83F9, +0x83EA,0x83C5,0x83C0,0x8426,0x83F0,0x83E1,0x845C,0x8451, +0x845A,0x8459,0x8473,0x8487,0x8488,0x847A,0x8489,0x8478, +0x843C,0x8446,0x8469,0x8476,0x848C,0x848E,0x8431,0x846D, +0x84C1,0x84CD,0x84D0,0x84E6,0x84BD,0x84D3,0x84CA,0x84BF, +0x84BA,0x84E0,0x84A1,0x84B9,0x84B4,0x8497,0x84E5,0x84E3, +0x850C,0x750D,0x8538,0x84F0,0x8539,0x851F,0x853A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8F45,0x8F46,0x8F47,0x8F48,0x8F49,0x8F4A,0x8F4B,0x8F4C, +0x8F4D,0x8F4E,0x8F4F,0x8F50,0x8F51,0x8F52,0x8F53,0x8F54, +0x8F55,0x8F56,0x8F57,0x8F58,0x8F59,0x8F5A,0x8F5B,0x8F5C, +0x8F5D,0x8F5E,0x8F5F,0x8F60,0x8F61,0x8F62,0x8F63,0x8F64, +0x8F65,0x8F6A,0x8F80,0x8F8C,0x8F92,0x8F9D,0x8FA0,0x8FA1, +0x8FA2,0x8FA4,0x8FA5,0x8FA6,0x8FA7,0x8FAA,0x8FAC,0x8FAD, +0x8FAE,0x8FAF,0x8FB2,0x8FB3,0x8FB4,0x8FB5,0x8FB7,0x8FB8, +0x8FBA,0x8FBB,0x8FBC,0x8FBF,0x8FC0,0x8FC3,0x8FC6, 0, +0x8FC9,0x8FCA,0x8FCB,0x8FCC,0x8FCD,0x8FCF,0x8FD2,0x8FD6, +0x8FD7,0x8FDA,0x8FE0,0x8FE1,0x8FE3,0x8FE7,0x8FEC,0x8FEF, +0x8FF1,0x8FF2,0x8FF4,0x8FF5,0x8FF6,0x8FFA,0x8FFB,0x8FFC, +0x8FFE,0x8FFF,0x9007,0x9008,0x900C,0x900E,0x9013,0x9015, +0x9018,0x8556,0x853B,0x84FF,0x84FC,0x8559,0x8548,0x8568, +0x8564,0x855E,0x857A,0x77A2,0x8543,0x8572,0x857B,0x85A4, +0x85A8,0x8587,0x858F,0x8579,0x85AE,0x859C,0x8585,0x85B9, +0x85B7,0x85B0,0x85D3,0x85C1,0x85DC,0x85FF,0x8627,0x8605, +0x8629,0x8616,0x863C,0x5EFE,0x5F08,0x593C,0x5941,0x8037, +0x5955,0x595A,0x5958,0x530F,0x5C22,0x5C25,0x5C2C,0x5C34, +0x624C,0x626A,0x629F,0x62BB,0x62CA,0x62DA,0x62D7,0x62EE, +0x6322,0x62F6,0x6339,0x634B,0x6343,0x63AD,0x63F6,0x6371, +0x637A,0x638E,0x63B4,0x636D,0x63AC,0x638A,0x6369,0x63AE, +0x63BC,0x63F2,0x63F8,0x63E0,0x63FF,0x63C4,0x63DE,0x63CE, +0x6452,0x63C6,0x63BE,0x6445,0x6441,0x640B,0x641B,0x6420, +0x640C,0x6426,0x6421,0x645E,0x6484,0x646D,0x6496, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9019,0x901C,0x9023,0x9024,0x9025,0x9027,0x9028,0x9029, +0x902A,0x902B,0x902C,0x9030,0x9031,0x9032,0x9033,0x9034, +0x9037,0x9039,0x903A,0x903D,0x903F,0x9040,0x9043,0x9045, +0x9046,0x9048,0x9049,0x904A,0x904B,0x904C,0x904E,0x9054, +0x9055,0x9056,0x9059,0x905A,0x905C,0x905D,0x905E,0x905F, +0x9060,0x9061,0x9064,0x9066,0x9067,0x9069,0x906A,0x906B, +0x906C,0x906F,0x9070,0x9071,0x9072,0x9073,0x9076,0x9077, +0x9078,0x9079,0x907A,0x907B,0x907C,0x907E,0x9081, 0, +0x9084,0x9085,0x9086,0x9087,0x9089,0x908A,0x908C,0x908D, +0x908E,0x908F,0x9090,0x9092,0x9094,0x9096,0x9098,0x909A, +0x909C,0x909E,0x909F,0x90A0,0x90A4,0x90A5,0x90A7,0x90A8, +0x90A9,0x90AB,0x90AD,0x90B2,0x90B7,0x90BC,0x90BD,0x90BF, +0x90C0,0x647A,0x64B7,0x64B8,0x6499,0x64BA,0x64C0,0x64D0, +0x64D7,0x64E4,0x64E2,0x6509,0x6525,0x652E,0x5F0B,0x5FD2, +0x7519,0x5F11,0x535F,0x53F1,0x53FD,0x53E9,0x53E8,0x53FB, +0x5412,0x5416,0x5406,0x544B,0x5452,0x5453,0x5454,0x5456, +0x5443,0x5421,0x5457,0x5459,0x5423,0x5432,0x5482,0x5494, +0x5477,0x5471,0x5464,0x549A,0x549B,0x5484,0x5476,0x5466, +0x549D,0x54D0,0x54AD,0x54C2,0x54B4,0x54D2,0x54A7,0x54A6, +0x54D3,0x54D4,0x5472,0x54A3,0x54D5,0x54BB,0x54BF,0x54CC, +0x54D9,0x54DA,0x54DC,0x54A9,0x54AA,0x54A4,0x54DD,0x54CF, +0x54DE,0x551B,0x54E7,0x5520,0x54FD,0x5514,0x54F3,0x5522, +0x5523,0x550F,0x5511,0x5527,0x552A,0x5567,0x558F,0x55B5, +0x5549,0x556D,0x5541,0x5555,0x553F,0x5550,0x553C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x90C2,0x90C3,0x90C6,0x90C8,0x90C9,0x90CB,0x90CC,0x90CD, +0x90D2,0x90D4,0x90D5,0x90D6,0x90D8,0x90D9,0x90DA,0x90DE, +0x90DF,0x90E0,0x90E3,0x90E4,0x90E5,0x90E9,0x90EA,0x90EC, +0x90EE,0x90F0,0x90F1,0x90F2,0x90F3,0x90F5,0x90F6,0x90F7, +0x90F9,0x90FA,0x90FB,0x90FC,0x90FF,0x9100,0x9101,0x9103, +0x9105,0x9106,0x9107,0x9108,0x9109,0x910A,0x910B,0x910C, +0x910D,0x910E,0x910F,0x9110,0x9111,0x9112,0x9113,0x9114, +0x9115,0x9116,0x9117,0x9118,0x911A,0x911B,0x911C, 0, +0x911D,0x911F,0x9120,0x9121,0x9124,0x9125,0x9126,0x9127, +0x9128,0x9129,0x912A,0x912B,0x912C,0x912D,0x912E,0x9130, +0x9132,0x9133,0x9134,0x9135,0x9136,0x9137,0x9138,0x913A, +0x913B,0x913C,0x913D,0x913E,0x913F,0x9140,0x9141,0x9142, +0x9144,0x5537,0x5556,0x5575,0x5576,0x5577,0x5533,0x5530, +0x555C,0x558B,0x55D2,0x5583,0x55B1,0x55B9,0x5588,0x5581, +0x559F,0x557E,0x55D6,0x5591,0x557B,0x55DF,0x55BD,0x55BE, +0x5594,0x5599,0x55EA,0x55F7,0x55C9,0x561F,0x55D1,0x55EB, +0x55EC,0x55D4,0x55E6,0x55DD,0x55C4,0x55EF,0x55E5,0x55F2, +0x55F3,0x55CC,0x55CD,0x55E8,0x55F5,0x55E4,0x8F94,0x561E, +0x5608,0x560C,0x5601,0x5624,0x5623,0x55FE,0x5600,0x5627, +0x562D,0x5658,0x5639,0x5657,0x562C,0x564D,0x5662,0x5659, +0x565C,0x564C,0x5654,0x5686,0x5664,0x5671,0x566B,0x567B, +0x567C,0x5685,0x5693,0x56AF,0x56D4,0x56D7,0x56DD,0x56E1, +0x56F5,0x56EB,0x56F9,0x56FF,0x5704,0x570A,0x5709,0x571C, +0x5E0F,0x5E19,0x5E14,0x5E11,0x5E31,0x5E3B,0x5E3C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9145,0x9147,0x9148,0x9151,0x9153,0x9154,0x9155,0x9156, +0x9158,0x9159,0x915B,0x915C,0x915F,0x9160,0x9166,0x9167, +0x9168,0x916B,0x916D,0x9173,0x917A,0x917B,0x917C,0x9180, +0x9181,0x9182,0x9183,0x9184,0x9186,0x9188,0x918A,0x918E, +0x918F,0x9193,0x9194,0x9195,0x9196,0x9197,0x9198,0x9199, +0x919C,0x919D,0x919E,0x919F,0x91A0,0x91A1,0x91A4,0x91A5, +0x91A6,0x91A7,0x91A8,0x91A9,0x91AB,0x91AC,0x91B0,0x91B1, +0x91B2,0x91B3,0x91B6,0x91B7,0x91B8,0x91B9,0x91BB, 0, +0x91BC,0x91BD,0x91BE,0x91BF,0x91C0,0x91C1,0x91C2,0x91C3, +0x91C4,0x91C5,0x91C6,0x91C8,0x91CB,0x91D0,0x91D2,0x91D3, +0x91D4,0x91D5,0x91D6,0x91D7,0x91D8,0x91D9,0x91DA,0x91DB, +0x91DD,0x91DE,0x91DF,0x91E0,0x91E1,0x91E2,0x91E3,0x91E4, +0x91E5,0x5E37,0x5E44,0x5E54,0x5E5B,0x5E5E,0x5E61,0x5C8C, +0x5C7A,0x5C8D,0x5C90,0x5C96,0x5C88,0x5C98,0x5C99,0x5C91, +0x5C9A,0x5C9C,0x5CB5,0x5CA2,0x5CBD,0x5CAC,0x5CAB,0x5CB1, +0x5CA3,0x5CC1,0x5CB7,0x5CC4,0x5CD2,0x5CE4,0x5CCB,0x5CE5, +0x5D02,0x5D03,0x5D27,0x5D26,0x5D2E,0x5D24,0x5D1E,0x5D06, +0x5D1B,0x5D58,0x5D3E,0x5D34,0x5D3D,0x5D6C,0x5D5B,0x5D6F, +0x5D5D,0x5D6B,0x5D4B,0x5D4A,0x5D69,0x5D74,0x5D82,0x5D99, +0x5D9D,0x8C73,0x5DB7,0x5DC5,0x5F73,0x5F77,0x5F82,0x5F87, +0x5F89,0x5F8C,0x5F95,0x5F99,0x5F9C,0x5FA8,0x5FAD,0x5FB5, +0x5FBC,0x8862,0x5F61,0x72AD,0x72B0,0x72B4,0x72B7,0x72B8, +0x72C3,0x72C1,0x72CE,0x72CD,0x72D2,0x72E8,0x72EF,0x72E9, +0x72F2,0x72F4,0x72F7,0x7301,0x72F3,0x7303,0x72FA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x91E6,0x91E7,0x91E8,0x91E9,0x91EA,0x91EB,0x91EC,0x91ED, +0x91EE,0x91EF,0x91F0,0x91F1,0x91F2,0x91F3,0x91F4,0x91F5, +0x91F6,0x91F7,0x91F8,0x91F9,0x91FA,0x91FB,0x91FC,0x91FD, +0x91FE,0x91FF,0x9200,0x9201,0x9202,0x9203,0x9204,0x9205, +0x9206,0x9207,0x9208,0x9209,0x920A,0x920B,0x920C,0x920D, +0x920E,0x920F,0x9210,0x9211,0x9212,0x9213,0x9214,0x9215, +0x9216,0x9217,0x9218,0x9219,0x921A,0x921B,0x921C,0x921D, +0x921E,0x921F,0x9220,0x9221,0x9222,0x9223,0x9224, 0, +0x9225,0x9226,0x9227,0x9228,0x9229,0x922A,0x922B,0x922C, +0x922D,0x922E,0x922F,0x9230,0x9231,0x9232,0x9233,0x9234, +0x9235,0x9236,0x9237,0x9238,0x9239,0x923A,0x923B,0x923C, +0x923D,0x923E,0x923F,0x9240,0x9241,0x9242,0x9243,0x9244, +0x9245,0x72FB,0x7317,0x7313,0x7321,0x730A,0x731E,0x731D, +0x7315,0x7322,0x7339,0x7325,0x732C,0x7338,0x7331,0x7350, +0x734D,0x7357,0x7360,0x736C,0x736F,0x737E,0x821B,0x5925, +0x98E7,0x5924,0x5902,0x9963,0x9967,0x9968,0x9969,0x996A, +0x996B,0x996C,0x9974,0x9977,0x997D,0x9980,0x9984,0x9987, +0x998A,0x998D,0x9990,0x9991,0x9993,0x9994,0x9995,0x5E80, +0x5E91,0x5E8B,0x5E96,0x5EA5,0x5EA0,0x5EB9,0x5EB5,0x5EBE, +0x5EB3,0x8D53,0x5ED2,0x5ED1,0x5EDB,0x5EE8,0x5EEA,0x81BA, +0x5FC4,0x5FC9,0x5FD6,0x5FCF,0x6003,0x5FEE,0x6004,0x5FE1, +0x5FE4,0x5FFE,0x6005,0x6006,0x5FEA,0x5FED,0x5FF8,0x6019, +0x6035,0x6026,0x601B,0x600F,0x600D,0x6029,0x602B,0x600A, +0x603F,0x6021,0x6078,0x6079,0x607B,0x607A,0x6042, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9246,0x9247,0x9248,0x9249,0x924A,0x924B,0x924C,0x924D, +0x924E,0x924F,0x9250,0x9251,0x9252,0x9253,0x9254,0x9255, +0x9256,0x9257,0x9258,0x9259,0x925A,0x925B,0x925C,0x925D, +0x925E,0x925F,0x9260,0x9261,0x9262,0x9263,0x9264,0x9265, +0x9266,0x9267,0x9268,0x9269,0x926A,0x926B,0x926C,0x926D, +0x926E,0x926F,0x9270,0x9271,0x9272,0x9273,0x9275,0x9276, +0x9277,0x9278,0x9279,0x927A,0x927B,0x927C,0x927D,0x927E, +0x927F,0x9280,0x9281,0x9282,0x9283,0x9284,0x9285, 0, +0x9286,0x9287,0x9288,0x9289,0x928A,0x928B,0x928C,0x928D, +0x928F,0x9290,0x9291,0x9292,0x9293,0x9294,0x9295,0x9296, +0x9297,0x9298,0x9299,0x929A,0x929B,0x929C,0x929D,0x929E, +0x929F,0x92A0,0x92A1,0x92A2,0x92A3,0x92A4,0x92A5,0x92A6, +0x92A7,0x606A,0x607D,0x6096,0x609A,0x60AD,0x609D,0x6083, +0x6092,0x608C,0x609B,0x60EC,0x60BB,0x60B1,0x60DD,0x60D8, +0x60C6,0x60DA,0x60B4,0x6120,0x6126,0x6115,0x6123,0x60F4, +0x6100,0x610E,0x612B,0x614A,0x6175,0x61AC,0x6194,0x61A7, +0x61B7,0x61D4,0x61F5,0x5FDD,0x96B3,0x95E9,0x95EB,0x95F1, +0x95F3,0x95F5,0x95F6,0x95FC,0x95FE,0x9603,0x9604,0x9606, +0x9608,0x960A,0x960B,0x960C,0x960D,0x960F,0x9612,0x9615, +0x9616,0x9617,0x9619,0x961A,0x4E2C,0x723F,0x6215,0x6C35, +0x6C54,0x6C5C,0x6C4A,0x6CA3,0x6C85,0x6C90,0x6C94,0x6C8C, +0x6C68,0x6C69,0x6C74,0x6C76,0x6C86,0x6CA9,0x6CD0,0x6CD4, +0x6CAD,0x6CF7,0x6CF8,0x6CF1,0x6CD7,0x6CB2,0x6CE0,0x6CD6, +0x6CFA,0x6CEB,0x6CEE,0x6CB1,0x6CD3,0x6CEF,0x6CFE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x92A8,0x92A9,0x92AA,0x92AB,0x92AC,0x92AD,0x92AF,0x92B0, +0x92B1,0x92B2,0x92B3,0x92B4,0x92B5,0x92B6,0x92B7,0x92B8, +0x92B9,0x92BA,0x92BB,0x92BC,0x92BD,0x92BE,0x92BF,0x92C0, +0x92C1,0x92C2,0x92C3,0x92C4,0x92C5,0x92C6,0x92C7,0x92C9, +0x92CA,0x92CB,0x92CC,0x92CD,0x92CE,0x92CF,0x92D0,0x92D1, +0x92D2,0x92D3,0x92D4,0x92D5,0x92D6,0x92D7,0x92D8,0x92D9, +0x92DA,0x92DB,0x92DC,0x92DD,0x92DE,0x92DF,0x92E0,0x92E1, +0x92E2,0x92E3,0x92E4,0x92E5,0x92E6,0x92E7,0x92E8, 0, +0x92E9,0x92EA,0x92EB,0x92EC,0x92ED,0x92EE,0x92EF,0x92F0, +0x92F1,0x92F2,0x92F3,0x92F4,0x92F5,0x92F6,0x92F7,0x92F8, +0x92F9,0x92FA,0x92FB,0x92FC,0x92FD,0x92FE,0x92FF,0x9300, +0x9301,0x9302,0x9303,0x9304,0x9305,0x9306,0x9307,0x9308, +0x9309,0x6D39,0x6D27,0x6D0C,0x6D43,0x6D48,0x6D07,0x6D04, +0x6D19,0x6D0E,0x6D2B,0x6D4D,0x6D2E,0x6D35,0x6D1A,0x6D4F, +0x6D52,0x6D54,0x6D33,0x6D91,0x6D6F,0x6D9E,0x6DA0,0x6D5E, +0x6D93,0x6D94,0x6D5C,0x6D60,0x6D7C,0x6D63,0x6E1A,0x6DC7, +0x6DC5,0x6DDE,0x6E0E,0x6DBF,0x6DE0,0x6E11,0x6DE6,0x6DDD, +0x6DD9,0x6E16,0x6DAB,0x6E0C,0x6DAE,0x6E2B,0x6E6E,0x6E4E, +0x6E6B,0x6EB2,0x6E5F,0x6E86,0x6E53,0x6E54,0x6E32,0x6E25, +0x6E44,0x6EDF,0x6EB1,0x6E98,0x6EE0,0x6F2D,0x6EE2,0x6EA5, +0x6EA7,0x6EBD,0x6EBB,0x6EB7,0x6ED7,0x6EB4,0x6ECF,0x6E8F, +0x6EC2,0x6E9F,0x6F62,0x6F46,0x6F47,0x6F24,0x6F15,0x6EF9, +0x6F2F,0x6F36,0x6F4B,0x6F74,0x6F2A,0x6F09,0x6F29,0x6F89, +0x6F8D,0x6F8C,0x6F78,0x6F72,0x6F7C,0x6F7A,0x6FD1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x930A,0x930B,0x930C,0x930D,0x930E,0x930F,0x9310,0x9311, +0x9312,0x9313,0x9314,0x9315,0x9316,0x9317,0x9318,0x9319, +0x931A,0x931B,0x931C,0x931D,0x931E,0x931F,0x9320,0x9321, +0x9322,0x9323,0x9324,0x9325,0x9326,0x9327,0x9328,0x9329, +0x932A,0x932B,0x932C,0x932D,0x932E,0x932F,0x9330,0x9331, +0x9332,0x9333,0x9334,0x9335,0x9336,0x9337,0x9338,0x9339, +0x933A,0x933B,0x933C,0x933D,0x933F,0x9340,0x9341,0x9342, +0x9343,0x9344,0x9345,0x9346,0x9347,0x9348,0x9349, 0, +0x934A,0x934B,0x934C,0x934D,0x934E,0x934F,0x9350,0x9351, +0x9352,0x9353,0x9354,0x9355,0x9356,0x9357,0x9358,0x9359, +0x935A,0x935B,0x935C,0x935D,0x935E,0x935F,0x9360,0x9361, +0x9362,0x9363,0x9364,0x9365,0x9366,0x9367,0x9368,0x9369, +0x936B,0x6FC9,0x6FA7,0x6FB9,0x6FB6,0x6FC2,0x6FE1,0x6FEE, +0x6FDE,0x6FE0,0x6FEF,0x701A,0x7023,0x701B,0x7039,0x7035, +0x704F,0x705E,0x5B80,0x5B84,0x5B95,0x5B93,0x5BA5,0x5BB8, +0x752F,0x9A9E,0x6434,0x5BE4,0x5BEE,0x8930,0x5BF0,0x8E47, +0x8B07,0x8FB6,0x8FD3,0x8FD5,0x8FE5,0x8FEE,0x8FE4,0x8FE9, +0x8FE6,0x8FF3,0x8FE8,0x9005,0x9004,0x900B,0x9026,0x9011, +0x900D,0x9016,0x9021,0x9035,0x9036,0x902D,0x902F,0x9044, +0x9051,0x9052,0x9050,0x9068,0x9058,0x9062,0x905B,0x66B9, +0x9074,0x907D,0x9082,0x9088,0x9083,0x908B,0x5F50,0x5F57, +0x5F56,0x5F58,0x5C3B,0x54AB,0x5C50,0x5C59,0x5B71,0x5C63, +0x5C66,0x7FBC,0x5F2A,0x5F29,0x5F2D,0x8274,0x5F3C,0x9B3B, +0x5C6E,0x5981,0x5983,0x598D,0x59A9,0x59AA,0x59A3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x936C,0x936D,0x936E,0x936F,0x9370,0x9371,0x9372,0x9373, +0x9374,0x9375,0x9376,0x9377,0x9378,0x9379,0x937A,0x937B, +0x937C,0x937D,0x937E,0x937F,0x9380,0x9381,0x9382,0x9383, +0x9384,0x9385,0x9386,0x9387,0x9388,0x9389,0x938A,0x938B, +0x938C,0x938D,0x938E,0x9390,0x9391,0x9392,0x9393,0x9394, +0x9395,0x9396,0x9397,0x9398,0x9399,0x939A,0x939B,0x939C, +0x939D,0x939E,0x939F,0x93A0,0x93A1,0x93A2,0x93A3,0x93A4, +0x93A5,0x93A6,0x93A7,0x93A8,0x93A9,0x93AA,0x93AB, 0, +0x93AC,0x93AD,0x93AE,0x93AF,0x93B0,0x93B1,0x93B2,0x93B3, +0x93B4,0x93B5,0x93B6,0x93B7,0x93B8,0x93B9,0x93BA,0x93BB, +0x93BC,0x93BD,0x93BE,0x93BF,0x93C0,0x93C1,0x93C2,0x93C3, +0x93C4,0x93C5,0x93C6,0x93C7,0x93C8,0x93C9,0x93CB,0x93CC, +0x93CD,0x5997,0x59CA,0x59AB,0x599E,0x59A4,0x59D2,0x59B2, +0x59AF,0x59D7,0x59BE,0x5A05,0x5A06,0x59DD,0x5A08,0x59E3, +0x59D8,0x59F9,0x5A0C,0x5A09,0x5A32,0x5A34,0x5A11,0x5A23, +0x5A13,0x5A40,0x5A67,0x5A4A,0x5A55,0x5A3C,0x5A62,0x5A75, +0x80EC,0x5AAA,0x5A9B,0x5A77,0x5A7A,0x5ABE,0x5AEB,0x5AB2, +0x5AD2,0x5AD4,0x5AB8,0x5AE0,0x5AE3,0x5AF1,0x5AD6,0x5AE6, +0x5AD8,0x5ADC,0x5B09,0x5B17,0x5B16,0x5B32,0x5B37,0x5B40, +0x5C15,0x5C1C,0x5B5A,0x5B65,0x5B73,0x5B51,0x5B53,0x5B62, +0x9A75,0x9A77,0x9A78,0x9A7A,0x9A7F,0x9A7D,0x9A80,0x9A81, +0x9A85,0x9A88,0x9A8A,0x9A90,0x9A92,0x9A93,0x9A96,0x9A98, +0x9A9B,0x9A9C,0x9A9D,0x9A9F,0x9AA0,0x9AA2,0x9AA3,0x9AA5, +0x9AA7,0x7E9F,0x7EA1,0x7EA3,0x7EA5,0x7EA8,0x7EA9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x93CE,0x93CF,0x93D0,0x93D1,0x93D2,0x93D3,0x93D4,0x93D5, +0x93D7,0x93D8,0x93D9,0x93DA,0x93DB,0x93DC,0x93DD,0x93DE, +0x93DF,0x93E0,0x93E1,0x93E2,0x93E3,0x93E4,0x93E5,0x93E6, +0x93E7,0x93E8,0x93E9,0x93EA,0x93EB,0x93EC,0x93ED,0x93EE, +0x93EF,0x93F0,0x93F1,0x93F2,0x93F3,0x93F4,0x93F5,0x93F6, +0x93F7,0x93F8,0x93F9,0x93FA,0x93FB,0x93FC,0x93FD,0x93FE, +0x93FF,0x9400,0x9401,0x9402,0x9403,0x9404,0x9405,0x9406, +0x9407,0x9408,0x9409,0x940A,0x940B,0x940C,0x940D, 0, +0x940E,0x940F,0x9410,0x9411,0x9412,0x9413,0x9414,0x9415, +0x9416,0x9417,0x9418,0x9419,0x941A,0x941B,0x941C,0x941D, +0x941E,0x941F,0x9420,0x9421,0x9422,0x9423,0x9424,0x9425, +0x9426,0x9427,0x9428,0x9429,0x942A,0x942B,0x942C,0x942D, +0x942E,0x7EAD,0x7EB0,0x7EBE,0x7EC0,0x7EC1,0x7EC2,0x7EC9, +0x7ECB,0x7ECC,0x7ED0,0x7ED4,0x7ED7,0x7EDB,0x7EE0,0x7EE1, +0x7EE8,0x7EEB,0x7EEE,0x7EEF,0x7EF1,0x7EF2,0x7F0D,0x7EF6, +0x7EFA,0x7EFB,0x7EFE,0x7F01,0x7F02,0x7F03,0x7F07,0x7F08, +0x7F0B,0x7F0C,0x7F0F,0x7F11,0x7F12,0x7F17,0x7F19,0x7F1C, +0x7F1B,0x7F1F,0x7F21,0x7F22,0x7F23,0x7F24,0x7F25,0x7F26, +0x7F27,0x7F2A,0x7F2B,0x7F2C,0x7F2D,0x7F2F,0x7F30,0x7F31, +0x7F32,0x7F33,0x7F35,0x5E7A,0x757F,0x5DDB,0x753E,0x9095, +0x738E,0x7391,0x73AE,0x73A2,0x739F,0x73CF,0x73C2,0x73D1, +0x73B7,0x73B3,0x73C0,0x73C9,0x73C8,0x73E5,0x73D9,0x987C, +0x740A,0x73E9,0x73E7,0x73DE,0x73BA,0x73F2,0x740F,0x742A, +0x745B,0x7426,0x7425,0x7428,0x7430,0x742E,0x742C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x942F,0x9430,0x9431,0x9432,0x9433,0x9434,0x9435,0x9436, +0x9437,0x9438,0x9439,0x943A,0x943B,0x943C,0x943D,0x943F, +0x9440,0x9441,0x9442,0x9443,0x9444,0x9445,0x9446,0x9447, +0x9448,0x9449,0x944A,0x944B,0x944C,0x944D,0x944E,0x944F, +0x9450,0x9451,0x9452,0x9453,0x9454,0x9455,0x9456,0x9457, +0x9458,0x9459,0x945A,0x945B,0x945C,0x945D,0x945E,0x945F, +0x9460,0x9461,0x9462,0x9463,0x9464,0x9465,0x9466,0x9467, +0x9468,0x9469,0x946A,0x946C,0x946D,0x946E,0x946F, 0, +0x9470,0x9471,0x9472,0x9473,0x9474,0x9475,0x9476,0x9477, +0x9478,0x9479,0x947A,0x947B,0x947C,0x947D,0x947E,0x947F, +0x9480,0x9481,0x9482,0x9483,0x9484,0x9491,0x9496,0x9498, +0x94C7,0x94CF,0x94D3,0x94D4,0x94DA,0x94E6,0x94FB,0x951C, +0x9520,0x741B,0x741A,0x7441,0x745C,0x7457,0x7455,0x7459, +0x7477,0x746D,0x747E,0x749C,0x748E,0x7480,0x7481,0x7487, +0x748B,0x749E,0x74A8,0x74A9,0x7490,0x74A7,0x74D2,0x74BA, +0x97EA,0x97EB,0x97EC,0x674C,0x6753,0x675E,0x6748,0x6769, +0x67A5,0x6787,0x676A,0x6773,0x6798,0x67A7,0x6775,0x67A8, +0x679E,0x67AD,0x678B,0x6777,0x677C,0x67F0,0x6809,0x67D8, +0x680A,0x67E9,0x67B0,0x680C,0x67D9,0x67B5,0x67DA,0x67B3, +0x67DD,0x6800,0x67C3,0x67B8,0x67E2,0x680E,0x67C1,0x67FD, +0x6832,0x6833,0x6860,0x6861,0x684E,0x6862,0x6844,0x6864, +0x6883,0x681D,0x6855,0x6866,0x6841,0x6867,0x6840,0x683E, +0x684A,0x6849,0x6829,0x68B5,0x688F,0x6874,0x6877,0x6893, +0x686B,0x68C2,0x696E,0x68FC,0x691F,0x6920,0x68F9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9527,0x9533,0x953D,0x9543,0x9548,0x954B,0x9555,0x955A, +0x9560,0x956E,0x9574,0x9575,0x9577,0x9578,0x9579,0x957A, +0x957B,0x957C,0x957D,0x957E,0x9580,0x9581,0x9582,0x9583, +0x9584,0x9585,0x9586,0x9587,0x9588,0x9589,0x958A,0x958B, +0x958C,0x958D,0x958E,0x958F,0x9590,0x9591,0x9592,0x9593, +0x9594,0x9595,0x9596,0x9597,0x9598,0x9599,0x959A,0x959B, +0x959C,0x959D,0x959E,0x959F,0x95A0,0x95A1,0x95A2,0x95A3, +0x95A4,0x95A5,0x95A6,0x95A7,0x95A8,0x95A9,0x95AA, 0, +0x95AB,0x95AC,0x95AD,0x95AE,0x95AF,0x95B0,0x95B1,0x95B2, +0x95B3,0x95B4,0x95B5,0x95B6,0x95B7,0x95B8,0x95B9,0x95BA, +0x95BB,0x95BC,0x95BD,0x95BE,0x95BF,0x95C0,0x95C1,0x95C2, +0x95C3,0x95C4,0x95C5,0x95C6,0x95C7,0x95C8,0x95C9,0x95CA, +0x95CB,0x6924,0x68F0,0x690B,0x6901,0x6957,0x68E3,0x6910, +0x6971,0x6939,0x6960,0x6942,0x695D,0x6984,0x696B,0x6980, +0x6998,0x6978,0x6934,0x69CC,0x6987,0x6988,0x69CE,0x6989, +0x6966,0x6963,0x6979,0x699B,0x69A7,0x69BB,0x69AB,0x69AD, +0x69D4,0x69B1,0x69C1,0x69CA,0x69DF,0x6995,0x69E0,0x698D, +0x69FF,0x6A2F,0x69ED,0x6A17,0x6A18,0x6A65,0x69F2,0x6A44, +0x6A3E,0x6AA0,0x6A50,0x6A5B,0x6A35,0x6A8E,0x6A79,0x6A3D, +0x6A28,0x6A58,0x6A7C,0x6A91,0x6A90,0x6AA9,0x6A97,0x6AAB, +0x7337,0x7352,0x6B81,0x6B82,0x6B87,0x6B84,0x6B92,0x6B93, +0x6B8D,0x6B9A,0x6B9B,0x6BA1,0x6BAA,0x8F6B,0x8F6D,0x8F71, +0x8F72,0x8F73,0x8F75,0x8F76,0x8F78,0x8F77,0x8F79,0x8F7A, +0x8F7C,0x8F7E,0x8F81,0x8F82,0x8F84,0x8F87,0x8F8B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x95CC,0x95CD,0x95CE,0x95CF,0x95D0,0x95D1,0x95D2,0x95D3, +0x95D4,0x95D5,0x95D6,0x95D7,0x95D8,0x95D9,0x95DA,0x95DB, +0x95DC,0x95DD,0x95DE,0x95DF,0x95E0,0x95E1,0x95E2,0x95E3, +0x95E4,0x95E5,0x95E6,0x95E7,0x95EC,0x95FF,0x9607,0x9613, +0x9618,0x961B,0x961E,0x9620,0x9623,0x9624,0x9625,0x9626, +0x9627,0x9628,0x9629,0x962B,0x962C,0x962D,0x962F,0x9630, +0x9637,0x9638,0x9639,0x963A,0x963E,0x9641,0x9643,0x964A, +0x964E,0x964F,0x9651,0x9652,0x9653,0x9656,0x9657, 0, +0x9658,0x9659,0x965A,0x965C,0x965D,0x965E,0x9660,0x9663, +0x9665,0x9666,0x966B,0x966D,0x966E,0x966F,0x9670,0x9671, +0x9673,0x9678,0x9679,0x967A,0x967B,0x967C,0x967D,0x967E, +0x967F,0x9680,0x9681,0x9682,0x9683,0x9684,0x9687,0x9689, +0x968A,0x8F8D,0x8F8E,0x8F8F,0x8F98,0x8F9A,0x8ECE,0x620B, +0x6217,0x621B,0x621F,0x6222,0x6221,0x6225,0x6224,0x622C, +0x81E7,0x74EF,0x74F4,0x74FF,0x750F,0x7511,0x7513,0x6534, +0x65EE,0x65EF,0x65F0,0x660A,0x6619,0x6772,0x6603,0x6615, +0x6600,0x7085,0x66F7,0x661D,0x6634,0x6631,0x6636,0x6635, +0x8006,0x665F,0x6654,0x6641,0x664F,0x6656,0x6661,0x6657, +0x6677,0x6684,0x668C,0x66A7,0x669D,0x66BE,0x66DB,0x66DC, +0x66E6,0x66E9,0x8D32,0x8D33,0x8D36,0x8D3B,0x8D3D,0x8D40, +0x8D45,0x8D46,0x8D48,0x8D49,0x8D47,0x8D4D,0x8D55,0x8D59, +0x89C7,0x89CA,0x89CB,0x89CC,0x89CE,0x89CF,0x89D0,0x89D1, +0x726E,0x729F,0x725D,0x7266,0x726F,0x727E,0x727F,0x7284, +0x728B,0x728D,0x728F,0x7292,0x6308,0x6332,0x63B0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x968C,0x968E,0x9691,0x9692,0x9693,0x9695,0x9696,0x969A, +0x969B,0x969D,0x969E,0x969F,0x96A0,0x96A1,0x96A2,0x96A3, +0x96A4,0x96A5,0x96A6,0x96A8,0x96A9,0x96AA,0x96AB,0x96AC, +0x96AD,0x96AE,0x96AF,0x96B1,0x96B2,0x96B4,0x96B5,0x96B7, +0x96B8,0x96BA,0x96BB,0x96BF,0x96C2,0x96C3,0x96C8,0x96CA, +0x96CB,0x96D0,0x96D1,0x96D3,0x96D4,0x96D6,0x96D7,0x96D8, +0x96D9,0x96DA,0x96DB,0x96DC,0x96DD,0x96DE,0x96DF,0x96E1, +0x96E2,0x96E3,0x96E4,0x96E5,0x96E6,0x96E7,0x96EB, 0, +0x96EC,0x96ED,0x96EE,0x96F0,0x96F1,0x96F2,0x96F4,0x96F5, +0x96F8,0x96FA,0x96FB,0x96FC,0x96FD,0x96FF,0x9702,0x9703, +0x9705,0x970A,0x970B,0x970C,0x9710,0x9711,0x9712,0x9714, +0x9715,0x9717,0x9718,0x9719,0x971A,0x971B,0x971D,0x971F, +0x9720,0x643F,0x64D8,0x8004,0x6BEA,0x6BF3,0x6BFD,0x6BF5, +0x6BF9,0x6C05,0x6C07,0x6C06,0x6C0D,0x6C15,0x6C18,0x6C19, +0x6C1A,0x6C21,0x6C29,0x6C24,0x6C2A,0x6C32,0x6535,0x6555, +0x656B,0x724D,0x7252,0x7256,0x7230,0x8662,0x5216,0x809F, +0x809C,0x8093,0x80BC,0x670A,0x80BD,0x80B1,0x80AB,0x80AD, +0x80B4,0x80B7,0x80E7,0x80E8,0x80E9,0x80EA,0x80DB,0x80C2, +0x80C4,0x80D9,0x80CD,0x80D7,0x6710,0x80DD,0x80EB,0x80F1, +0x80F4,0x80ED,0x810D,0x810E,0x80F2,0x80FC,0x6715,0x8112, +0x8C5A,0x8136,0x811E,0x812C,0x8118,0x8132,0x8148,0x814C, +0x8153,0x8174,0x8159,0x815A,0x8171,0x8160,0x8169,0x817C, +0x817D,0x816D,0x8167,0x584D,0x5AB5,0x8188,0x8182,0x8191, +0x6ED5,0x81A3,0x81AA,0x81CC,0x6726,0x81CA,0x81BB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9721,0x9722,0x9723,0x9724,0x9725,0x9726,0x9727,0x9728, +0x9729,0x972B,0x972C,0x972E,0x972F,0x9731,0x9733,0x9734, +0x9735,0x9736,0x9737,0x973A,0x973B,0x973C,0x973D,0x973F, +0x9740,0x9741,0x9742,0x9743,0x9744,0x9745,0x9746,0x9747, +0x9748,0x9749,0x974A,0x974B,0x974C,0x974D,0x974E,0x974F, +0x9750,0x9751,0x9754,0x9755,0x9757,0x9758,0x975A,0x975C, +0x975D,0x975F,0x9763,0x9764,0x9766,0x9767,0x9768,0x976A, +0x976B,0x976C,0x976D,0x976E,0x976F,0x9770,0x9771, 0, +0x9772,0x9775,0x9777,0x9778,0x9779,0x977A,0x977B,0x977D, +0x977E,0x977F,0x9780,0x9781,0x9782,0x9783,0x9784,0x9786, +0x9787,0x9788,0x9789,0x978A,0x978C,0x978E,0x978F,0x9790, +0x9793,0x9795,0x9796,0x9797,0x9799,0x979A,0x979B,0x979C, +0x979D,0x81C1,0x81A6,0x6B24,0x6B37,0x6B39,0x6B43,0x6B46, +0x6B59,0x98D1,0x98D2,0x98D3,0x98D5,0x98D9,0x98DA,0x6BB3, +0x5F40,0x6BC2,0x89F3,0x6590,0x9F51,0x6593,0x65BC,0x65C6, +0x65C4,0x65C3,0x65CC,0x65CE,0x65D2,0x65D6,0x7080,0x709C, +0x7096,0x709D,0x70BB,0x70C0,0x70B7,0x70AB,0x70B1,0x70E8, +0x70CA,0x7110,0x7113,0x7116,0x712F,0x7131,0x7173,0x715C, +0x7168,0x7145,0x7172,0x714A,0x7178,0x717A,0x7198,0x71B3, +0x71B5,0x71A8,0x71A0,0x71E0,0x71D4,0x71E7,0x71F9,0x721D, +0x7228,0x706C,0x7118,0x7166,0x71B9,0x623E,0x623D,0x6243, +0x6248,0x6249,0x793B,0x7940,0x7946,0x7949,0x795B,0x795C, +0x7953,0x795A,0x7962,0x7957,0x7960,0x796F,0x7967,0x797A, +0x7985,0x798A,0x799A,0x79A7,0x79B3,0x5FD1,0x5FD0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x979E,0x979F,0x97A1,0x97A2,0x97A4,0x97A5,0x97A6,0x97A7, +0x97A8,0x97A9,0x97AA,0x97AC,0x97AE,0x97B0,0x97B1,0x97B3, +0x97B5,0x97B6,0x97B7,0x97B8,0x97B9,0x97BA,0x97BB,0x97BC, +0x97BD,0x97BE,0x97BF,0x97C0,0x97C1,0x97C2,0x97C3,0x97C4, +0x97C5,0x97C6,0x97C7,0x97C8,0x97C9,0x97CA,0x97CB,0x97CC, +0x97CD,0x97CE,0x97CF,0x97D0,0x97D1,0x97D2,0x97D3,0x97D4, +0x97D5,0x97D6,0x97D7,0x97D8,0x97D9,0x97DA,0x97DB,0x97DC, +0x97DD,0x97DE,0x97DF,0x97E0,0x97E1,0x97E2,0x97E3, 0, +0x97E4,0x97E5,0x97E8,0x97EE,0x97EF,0x97F0,0x97F1,0x97F2, +0x97F4,0x97F7,0x97F8,0x97F9,0x97FA,0x97FB,0x97FC,0x97FD, +0x97FE,0x97FF,0x9800,0x9801,0x9802,0x9803,0x9804,0x9805, +0x9806,0x9807,0x9808,0x9809,0x980A,0x980B,0x980C,0x980D, +0x980E,0x603C,0x605D,0x605A,0x6067,0x6041,0x6059,0x6063, +0x60AB,0x6106,0x610D,0x615D,0x61A9,0x619D,0x61CB,0x61D1, +0x6206,0x8080,0x807F,0x6C93,0x6CF6,0x6DFC,0x77F6,0x77F8, +0x7800,0x7809,0x7817,0x7818,0x7811,0x65AB,0x782D,0x781C, +0x781D,0x7839,0x783A,0x783B,0x781F,0x783C,0x7825,0x782C, +0x7823,0x7829,0x784E,0x786D,0x7856,0x7857,0x7826,0x7850, +0x7847,0x784C,0x786A,0x789B,0x7893,0x789A,0x7887,0x789C, +0x78A1,0x78A3,0x78B2,0x78B9,0x78A5,0x78D4,0x78D9,0x78C9, +0x78EC,0x78F2,0x7905,0x78F4,0x7913,0x7924,0x791E,0x7934, +0x9F9B,0x9EF9,0x9EFB,0x9EFC,0x76F1,0x7704,0x770D,0x76F9, +0x7707,0x7708,0x771A,0x7722,0x7719,0x772D,0x7726,0x7735, +0x7738,0x7750,0x7751,0x7747,0x7743,0x775A,0x7768, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x980F,0x9810,0x9811,0x9812,0x9813,0x9814,0x9815,0x9816, +0x9817,0x9818,0x9819,0x981A,0x981B,0x981C,0x981D,0x981E, +0x981F,0x9820,0x9821,0x9822,0x9823,0x9824,0x9825,0x9826, +0x9827,0x9828,0x9829,0x982A,0x982B,0x982C,0x982D,0x982E, +0x982F,0x9830,0x9831,0x9832,0x9833,0x9834,0x9835,0x9836, +0x9837,0x9838,0x9839,0x983A,0x983B,0x983C,0x983D,0x983E, +0x983F,0x9840,0x9841,0x9842,0x9843,0x9844,0x9845,0x9846, +0x9847,0x9848,0x9849,0x984A,0x984B,0x984C,0x984D, 0, +0x984E,0x984F,0x9850,0x9851,0x9852,0x9853,0x9854,0x9855, +0x9856,0x9857,0x9858,0x9859,0x985A,0x985B,0x985C,0x985D, +0x985E,0x985F,0x9860,0x9861,0x9862,0x9863,0x9864,0x9865, +0x9866,0x9867,0x9868,0x9869,0x986A,0x986B,0x986C,0x986D, +0x986E,0x7762,0x7765,0x777F,0x778D,0x777D,0x7780,0x778C, +0x7791,0x779F,0x77A0,0x77B0,0x77B5,0x77BD,0x753A,0x7540, +0x754E,0x754B,0x7548,0x755B,0x7572,0x7579,0x7583,0x7F58, +0x7F61,0x7F5F,0x8A48,0x7F68,0x7F74,0x7F71,0x7F79,0x7F81, +0x7F7E,0x76CD,0x76E5,0x8832,0x9485,0x9486,0x9487,0x948B, +0x948A,0x948C,0x948D,0x948F,0x9490,0x9494,0x9497,0x9495, +0x949A,0x949B,0x949C,0x94A3,0x94A4,0x94AB,0x94AA,0x94AD, +0x94AC,0x94AF,0x94B0,0x94B2,0x94B4,0x94B6,0x94B7,0x94B8, +0x94B9,0x94BA,0x94BC,0x94BD,0x94BF,0x94C4,0x94C8,0x94C9, +0x94CA,0x94CB,0x94CC,0x94CD,0x94CE,0x94D0,0x94D1,0x94D2, +0x94D5,0x94D6,0x94D7,0x94D9,0x94D8,0x94DB,0x94DE,0x94DF, +0x94E0,0x94E2,0x94E4,0x94E5,0x94E7,0x94E8,0x94EA, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x986F,0x9870,0x9871,0x9872,0x9873,0x9874,0x988B,0x988E, +0x9892,0x9895,0x9899,0x98A3,0x98A8,0x98A9,0x98AA,0x98AB, +0x98AC,0x98AD,0x98AE,0x98AF,0x98B0,0x98B1,0x98B2,0x98B3, +0x98B4,0x98B5,0x98B6,0x98B7,0x98B8,0x98B9,0x98BA,0x98BB, +0x98BC,0x98BD,0x98BE,0x98BF,0x98C0,0x98C1,0x98C2,0x98C3, +0x98C4,0x98C5,0x98C6,0x98C7,0x98C8,0x98C9,0x98CA,0x98CB, +0x98CC,0x98CD,0x98CF,0x98D0,0x98D4,0x98D6,0x98D7,0x98DB, +0x98DC,0x98DD,0x98E0,0x98E1,0x98E2,0x98E3,0x98E4, 0, +0x98E5,0x98E6,0x98E9,0x98EA,0x98EB,0x98EC,0x98ED,0x98EE, +0x98EF,0x98F0,0x98F1,0x98F2,0x98F3,0x98F4,0x98F5,0x98F6, +0x98F7,0x98F8,0x98F9,0x98FA,0x98FB,0x98FC,0x98FD,0x98FE, +0x98FF,0x9900,0x9901,0x9902,0x9903,0x9904,0x9905,0x9906, +0x9907,0x94E9,0x94EB,0x94EE,0x94EF,0x94F3,0x94F4,0x94F5, +0x94F7,0x94F9,0x94FC,0x94FD,0x94FF,0x9503,0x9502,0x9506, +0x9507,0x9509,0x950A,0x950D,0x950E,0x950F,0x9512,0x9513, +0x9514,0x9515,0x9516,0x9518,0x951B,0x951D,0x951E,0x951F, +0x9522,0x952A,0x952B,0x9529,0x952C,0x9531,0x9532,0x9534, +0x9536,0x9537,0x9538,0x953C,0x953E,0x953F,0x9542,0x9535, +0x9544,0x9545,0x9546,0x9549,0x954C,0x954E,0x954F,0x9552, +0x9553,0x9554,0x9556,0x9557,0x9558,0x9559,0x955B,0x955E, +0x955F,0x955D,0x9561,0x9562,0x9564,0x9565,0x9566,0x9567, +0x9568,0x9569,0x956A,0x956B,0x956C,0x956F,0x9571,0x9572, +0x9573,0x953A,0x77E7,0x77EC,0x96C9,0x79D5,0x79ED,0x79E3, +0x79EB,0x7A06,0x5D47,0x7A03,0x7A02,0x7A1E,0x7A14, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9908,0x9909,0x990A,0x990B,0x990C,0x990E,0x990F,0x9911, +0x9912,0x9913,0x9914,0x9915,0x9916,0x9917,0x9918,0x9919, +0x991A,0x991B,0x991C,0x991D,0x991E,0x991F,0x9920,0x9921, +0x9922,0x9923,0x9924,0x9925,0x9926,0x9927,0x9928,0x9929, +0x992A,0x992B,0x992C,0x992D,0x992F,0x9930,0x9931,0x9932, +0x9933,0x9934,0x9935,0x9936,0x9937,0x9938,0x9939,0x993A, +0x993B,0x993C,0x993D,0x993E,0x993F,0x9940,0x9941,0x9942, +0x9943,0x9944,0x9945,0x9946,0x9947,0x9948,0x9949, 0, +0x994A,0x994B,0x994C,0x994D,0x994E,0x994F,0x9950,0x9951, +0x9952,0x9953,0x9956,0x9957,0x9958,0x9959,0x995A,0x995B, +0x995C,0x995D,0x995E,0x995F,0x9960,0x9961,0x9962,0x9964, +0x9966,0x9973,0x9978,0x9979,0x997B,0x997E,0x9982,0x9983, +0x9989,0x7A39,0x7A37,0x7A51,0x9ECF,0x99A5,0x7A70,0x7688, +0x768E,0x7693,0x7699,0x76A4,0x74DE,0x74E0,0x752C,0x9E20, +0x9E22,0x9E28,0x9E29,0x9E2A,0x9E2B,0x9E2C,0x9E32,0x9E31, +0x9E36,0x9E38,0x9E37,0x9E39,0x9E3A,0x9E3E,0x9E41,0x9E42, +0x9E44,0x9E46,0x9E47,0x9E48,0x9E49,0x9E4B,0x9E4C,0x9E4E, +0x9E51,0x9E55,0x9E57,0x9E5A,0x9E5B,0x9E5C,0x9E5E,0x9E63, +0x9E66,0x9E67,0x9E68,0x9E69,0x9E6A,0x9E6B,0x9E6C,0x9E71, +0x9E6D,0x9E73,0x7592,0x7594,0x7596,0x75A0,0x759D,0x75AC, +0x75A3,0x75B3,0x75B4,0x75B8,0x75C4,0x75B1,0x75B0,0x75C3, +0x75C2,0x75D6,0x75CD,0x75E3,0x75E8,0x75E6,0x75E4,0x75EB, +0x75E7,0x7603,0x75F1,0x75FC,0x75FF,0x7610,0x7600,0x7605, +0x760C,0x7617,0x760A,0x7625,0x7618,0x7615,0x7619, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x998C,0x998E,0x999A,0x999B,0x999C,0x999D,0x999E,0x999F, +0x99A0,0x99A1,0x99A2,0x99A3,0x99A4,0x99A6,0x99A7,0x99A9, +0x99AA,0x99AB,0x99AC,0x99AD,0x99AE,0x99AF,0x99B0,0x99B1, +0x99B2,0x99B3,0x99B4,0x99B5,0x99B6,0x99B7,0x99B8,0x99B9, +0x99BA,0x99BB,0x99BC,0x99BD,0x99BE,0x99BF,0x99C0,0x99C1, +0x99C2,0x99C3,0x99C4,0x99C5,0x99C6,0x99C7,0x99C8,0x99C9, +0x99CA,0x99CB,0x99CC,0x99CD,0x99CE,0x99CF,0x99D0,0x99D1, +0x99D2,0x99D3,0x99D4,0x99D5,0x99D6,0x99D7,0x99D8, 0, +0x99D9,0x99DA,0x99DB,0x99DC,0x99DD,0x99DE,0x99DF,0x99E0, +0x99E1,0x99E2,0x99E3,0x99E4,0x99E5,0x99E6,0x99E7,0x99E8, +0x99E9,0x99EA,0x99EB,0x99EC,0x99ED,0x99EE,0x99EF,0x99F0, +0x99F1,0x99F2,0x99F3,0x99F4,0x99F5,0x99F6,0x99F7,0x99F8, +0x99F9,0x761B,0x763C,0x7622,0x7620,0x7640,0x762D,0x7630, +0x763F,0x7635,0x7643,0x763E,0x7633,0x764D,0x765E,0x7654, +0x765C,0x7656,0x766B,0x766F,0x7FCA,0x7AE6,0x7A78,0x7A79, +0x7A80,0x7A86,0x7A88,0x7A95,0x7AA6,0x7AA0,0x7AAC,0x7AA8, +0x7AAD,0x7AB3,0x8864,0x8869,0x8872,0x887D,0x887F,0x8882, +0x88A2,0x88C6,0x88B7,0x88BC,0x88C9,0x88E2,0x88CE,0x88E3, +0x88E5,0x88F1,0x891A,0x88FC,0x88E8,0x88FE,0x88F0,0x8921, +0x8919,0x8913,0x891B,0x890A,0x8934,0x892B,0x8936,0x8941, +0x8966,0x897B,0x758B,0x80E5,0x76B2,0x76B4,0x77DC,0x8012, +0x8014,0x8016,0x801C,0x8020,0x8022,0x8025,0x8026,0x8027, +0x8029,0x8028,0x8031,0x800B,0x8035,0x8043,0x8046,0x804D, +0x8052,0x8069,0x8071,0x8983,0x9878,0x9880,0x9883, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x99FA,0x99FB,0x99FC,0x99FD,0x99FE,0x99FF,0x9A00,0x9A01, +0x9A02,0x9A03,0x9A04,0x9A05,0x9A06,0x9A07,0x9A08,0x9A09, +0x9A0A,0x9A0B,0x9A0C,0x9A0D,0x9A0E,0x9A0F,0x9A10,0x9A11, +0x9A12,0x9A13,0x9A14,0x9A15,0x9A16,0x9A17,0x9A18,0x9A19, +0x9A1A,0x9A1B,0x9A1C,0x9A1D,0x9A1E,0x9A1F,0x9A20,0x9A21, +0x9A22,0x9A23,0x9A24,0x9A25,0x9A26,0x9A27,0x9A28,0x9A29, +0x9A2A,0x9A2B,0x9A2C,0x9A2D,0x9A2E,0x9A2F,0x9A30,0x9A31, +0x9A32,0x9A33,0x9A34,0x9A35,0x9A36,0x9A37,0x9A38, 0, +0x9A39,0x9A3A,0x9A3B,0x9A3C,0x9A3D,0x9A3E,0x9A3F,0x9A40, +0x9A41,0x9A42,0x9A43,0x9A44,0x9A45,0x9A46,0x9A47,0x9A48, +0x9A49,0x9A4A,0x9A4B,0x9A4C,0x9A4D,0x9A4E,0x9A4F,0x9A50, +0x9A51,0x9A52,0x9A53,0x9A54,0x9A55,0x9A56,0x9A57,0x9A58, +0x9A59,0x9889,0x988C,0x988D,0x988F,0x9894,0x989A,0x989B, +0x989E,0x989F,0x98A1,0x98A2,0x98A5,0x98A6,0x864D,0x8654, +0x866C,0x866E,0x867F,0x867A,0x867C,0x867B,0x86A8,0x868D, +0x868B,0x86AC,0x869D,0x86A7,0x86A3,0x86AA,0x8693,0x86A9, +0x86B6,0x86C4,0x86B5,0x86CE,0x86B0,0x86BA,0x86B1,0x86AF, +0x86C9,0x86CF,0x86B4,0x86E9,0x86F1,0x86F2,0x86ED,0x86F3, +0x86D0,0x8713,0x86DE,0x86F4,0x86DF,0x86D8,0x86D1,0x8703, +0x8707,0x86F8,0x8708,0x870A,0x870D,0x8709,0x8723,0x873B, +0x871E,0x8725,0x872E,0x871A,0x873E,0x8748,0x8734,0x8731, +0x8729,0x8737,0x873F,0x8782,0x8722,0x877D,0x877E,0x877B, +0x8760,0x8770,0x874C,0x876E,0x878B,0x8753,0x8763,0x877C, +0x8764,0x8759,0x8765,0x8793,0x87AF,0x87A8,0x87D2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A5A,0x9A5B,0x9A5C,0x9A5D,0x9A5E,0x9A5F,0x9A60,0x9A61, +0x9A62,0x9A63,0x9A64,0x9A65,0x9A66,0x9A67,0x9A68,0x9A69, +0x9A6A,0x9A6B,0x9A72,0x9A83,0x9A89,0x9A8D,0x9A8E,0x9A94, +0x9A95,0x9A99,0x9AA6,0x9AA9,0x9AAA,0x9AAB,0x9AAC,0x9AAD, +0x9AAE,0x9AAF,0x9AB2,0x9AB3,0x9AB4,0x9AB5,0x9AB9,0x9ABB, +0x9ABD,0x9ABE,0x9ABF,0x9AC3,0x9AC4,0x9AC6,0x9AC7,0x9AC8, +0x9AC9,0x9ACA,0x9ACD,0x9ACE,0x9ACF,0x9AD0,0x9AD2,0x9AD4, +0x9AD5,0x9AD6,0x9AD7,0x9AD9,0x9ADA,0x9ADB,0x9ADC, 0, +0x9ADD,0x9ADE,0x9AE0,0x9AE2,0x9AE3,0x9AE4,0x9AE5,0x9AE7, +0x9AE8,0x9AE9,0x9AEA,0x9AEC,0x9AEE,0x9AF0,0x9AF1,0x9AF2, +0x9AF3,0x9AF4,0x9AF5,0x9AF6,0x9AF7,0x9AF8,0x9AFA,0x9AFC, +0x9AFD,0x9AFE,0x9AFF,0x9B00,0x9B01,0x9B02,0x9B04,0x9B05, +0x9B06,0x87C6,0x8788,0x8785,0x87AD,0x8797,0x8783,0x87AB, +0x87E5,0x87AC,0x87B5,0x87B3,0x87CB,0x87D3,0x87BD,0x87D1, +0x87C0,0x87CA,0x87DB,0x87EA,0x87E0,0x87EE,0x8816,0x8813, +0x87FE,0x880A,0x881B,0x8821,0x8839,0x883C,0x7F36,0x7F42, +0x7F44,0x7F45,0x8210,0x7AFA,0x7AFD,0x7B08,0x7B03,0x7B04, +0x7B15,0x7B0A,0x7B2B,0x7B0F,0x7B47,0x7B38,0x7B2A,0x7B19, +0x7B2E,0x7B31,0x7B20,0x7B25,0x7B24,0x7B33,0x7B3E,0x7B1E, +0x7B58,0x7B5A,0x7B45,0x7B75,0x7B4C,0x7B5D,0x7B60,0x7B6E, +0x7B7B,0x7B62,0x7B72,0x7B71,0x7B90,0x7BA6,0x7BA7,0x7BB8, +0x7BAC,0x7B9D,0x7BA8,0x7B85,0x7BAA,0x7B9C,0x7BA2,0x7BAB, +0x7BB4,0x7BD1,0x7BC1,0x7BCC,0x7BDD,0x7BDA,0x7BE5,0x7BE6, +0x7BEA,0x7C0C,0x7BFE,0x7BFC,0x7C0F,0x7C16,0x7C0B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9B07,0x9B09,0x9B0A,0x9B0B,0x9B0C,0x9B0D,0x9B0E,0x9B10, +0x9B11,0x9B12,0x9B14,0x9B15,0x9B16,0x9B17,0x9B18,0x9B19, +0x9B1A,0x9B1B,0x9B1C,0x9B1D,0x9B1E,0x9B20,0x9B21,0x9B22, +0x9B24,0x9B25,0x9B26,0x9B27,0x9B28,0x9B29,0x9B2A,0x9B2B, +0x9B2C,0x9B2D,0x9B2E,0x9B30,0x9B31,0x9B33,0x9B34,0x9B35, +0x9B36,0x9B37,0x9B38,0x9B39,0x9B3A,0x9B3D,0x9B3E,0x9B3F, +0x9B40,0x9B46,0x9B4A,0x9B4B,0x9B4C,0x9B4E,0x9B50,0x9B52, +0x9B53,0x9B55,0x9B56,0x9B57,0x9B58,0x9B59,0x9B5A, 0, +0x9B5B,0x9B5C,0x9B5D,0x9B5E,0x9B5F,0x9B60,0x9B61,0x9B62, +0x9B63,0x9B64,0x9B65,0x9B66,0x9B67,0x9B68,0x9B69,0x9B6A, +0x9B6B,0x9B6C,0x9B6D,0x9B6E,0x9B6F,0x9B70,0x9B71,0x9B72, +0x9B73,0x9B74,0x9B75,0x9B76,0x9B77,0x9B78,0x9B79,0x9B7A, +0x9B7B,0x7C1F,0x7C2A,0x7C26,0x7C38,0x7C41,0x7C40,0x81FE, +0x8201,0x8202,0x8204,0x81EC,0x8844,0x8221,0x8222,0x8223, +0x822D,0x822F,0x8228,0x822B,0x8238,0x823B,0x8233,0x8234, +0x823E,0x8244,0x8249,0x824B,0x824F,0x825A,0x825F,0x8268, +0x887E,0x8885,0x8888,0x88D8,0x88DF,0x895E,0x7F9D,0x7F9F, +0x7FA7,0x7FAF,0x7FB0,0x7FB2,0x7C7C,0x6549,0x7C91,0x7C9D, +0x7C9C,0x7C9E,0x7CA2,0x7CB2,0x7CBC,0x7CBD,0x7CC1,0x7CC7, +0x7CCC,0x7CCD,0x7CC8,0x7CC5,0x7CD7,0x7CE8,0x826E,0x66A8, +0x7FBF,0x7FCE,0x7FD5,0x7FE5,0x7FE1,0x7FE6,0x7FE9,0x7FEE, +0x7FF3,0x7CF8,0x7D77,0x7DA6,0x7DAE,0x7E47,0x7E9B,0x9EB8, +0x9EB4,0x8D73,0x8D84,0x8D94,0x8D91,0x8DB1,0x8D67,0x8D6D, +0x8C47,0x8C49,0x914A,0x9150,0x914E,0x914F,0x9164, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9B7C,0x9B7D,0x9B7E,0x9B7F,0x9B80,0x9B81,0x9B82,0x9B83, +0x9B84,0x9B85,0x9B86,0x9B87,0x9B88,0x9B89,0x9B8A,0x9B8B, +0x9B8C,0x9B8D,0x9B8E,0x9B8F,0x9B90,0x9B91,0x9B92,0x9B93, +0x9B94,0x9B95,0x9B96,0x9B97,0x9B98,0x9B99,0x9B9A,0x9B9B, +0x9B9C,0x9B9D,0x9B9E,0x9B9F,0x9BA0,0x9BA1,0x9BA2,0x9BA3, +0x9BA4,0x9BA5,0x9BA6,0x9BA7,0x9BA8,0x9BA9,0x9BAA,0x9BAB, +0x9BAC,0x9BAD,0x9BAE,0x9BAF,0x9BB0,0x9BB1,0x9BB2,0x9BB3, +0x9BB4,0x9BB5,0x9BB6,0x9BB7,0x9BB8,0x9BB9,0x9BBA, 0, +0x9BBB,0x9BBC,0x9BBD,0x9BBE,0x9BBF,0x9BC0,0x9BC1,0x9BC2, +0x9BC3,0x9BC4,0x9BC5,0x9BC6,0x9BC7,0x9BC8,0x9BC9,0x9BCA, +0x9BCB,0x9BCC,0x9BCD,0x9BCE,0x9BCF,0x9BD0,0x9BD1,0x9BD2, +0x9BD3,0x9BD4,0x9BD5,0x9BD6,0x9BD7,0x9BD8,0x9BD9,0x9BDA, +0x9BDB,0x9162,0x9161,0x9170,0x9169,0x916F,0x917D,0x917E, +0x9172,0x9174,0x9179,0x918C,0x9185,0x9190,0x918D,0x9191, +0x91A2,0x91A3,0x91AA,0x91AD,0x91AE,0x91AF,0x91B5,0x91B4, +0x91BA,0x8C55,0x9E7E,0x8DB8,0x8DEB,0x8E05,0x8E59,0x8E69, +0x8DB5,0x8DBF,0x8DBC,0x8DBA,0x8DC4,0x8DD6,0x8DD7,0x8DDA, +0x8DDE,0x8DCE,0x8DCF,0x8DDB,0x8DC6,0x8DEC,0x8DF7,0x8DF8, +0x8DE3,0x8DF9,0x8DFB,0x8DE4,0x8E09,0x8DFD,0x8E14,0x8E1D, +0x8E1F,0x8E2C,0x8E2E,0x8E23,0x8E2F,0x8E3A,0x8E40,0x8E39, +0x8E35,0x8E3D,0x8E31,0x8E49,0x8E41,0x8E42,0x8E51,0x8E52, +0x8E4A,0x8E70,0x8E76,0x8E7C,0x8E6F,0x8E74,0x8E85,0x8E8F, +0x8E94,0x8E90,0x8E9C,0x8E9E,0x8C78,0x8C82,0x8C8A,0x8C85, +0x8C98,0x8C94,0x659B,0x89D6,0x89DE,0x89DA,0x89DC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9BDC,0x9BDD,0x9BDE,0x9BDF,0x9BE0,0x9BE1,0x9BE2,0x9BE3, +0x9BE4,0x9BE5,0x9BE6,0x9BE7,0x9BE8,0x9BE9,0x9BEA,0x9BEB, +0x9BEC,0x9BED,0x9BEE,0x9BEF,0x9BF0,0x9BF1,0x9BF2,0x9BF3, +0x9BF4,0x9BF5,0x9BF6,0x9BF7,0x9BF8,0x9BF9,0x9BFA,0x9BFB, +0x9BFC,0x9BFD,0x9BFE,0x9BFF,0x9C00,0x9C01,0x9C02,0x9C03, +0x9C04,0x9C05,0x9C06,0x9C07,0x9C08,0x9C09,0x9C0A,0x9C0B, +0x9C0C,0x9C0D,0x9C0E,0x9C0F,0x9C10,0x9C11,0x9C12,0x9C13, +0x9C14,0x9C15,0x9C16,0x9C17,0x9C18,0x9C19,0x9C1A, 0, +0x9C1B,0x9C1C,0x9C1D,0x9C1E,0x9C1F,0x9C20,0x9C21,0x9C22, +0x9C23,0x9C24,0x9C25,0x9C26,0x9C27,0x9C28,0x9C29,0x9C2A, +0x9C2B,0x9C2C,0x9C2D,0x9C2E,0x9C2F,0x9C30,0x9C31,0x9C32, +0x9C33,0x9C34,0x9C35,0x9C36,0x9C37,0x9C38,0x9C39,0x9C3A, +0x9C3B,0x89E5,0x89EB,0x89EF,0x8A3E,0x8B26,0x9753,0x96E9, +0x96F3,0x96EF,0x9706,0x9701,0x9708,0x970F,0x970E,0x972A, +0x972D,0x9730,0x973E,0x9F80,0x9F83,0x9F85,0x9F86,0x9F87, +0x9F88,0x9F89,0x9F8A,0x9F8C,0x9EFE,0x9F0B,0x9F0D,0x96B9, +0x96BC,0x96BD,0x96CE,0x96D2,0x77BF,0x96E0,0x928E,0x92AE, +0x92C8,0x933E,0x936A,0x93CA,0x938F,0x943E,0x946B,0x9C7F, +0x9C82,0x9C85,0x9C86,0x9C87,0x9C88,0x7A23,0x9C8B,0x9C8E, +0x9C90,0x9C91,0x9C92,0x9C94,0x9C95,0x9C9A,0x9C9B,0x9C9E, +0x9C9F,0x9CA0,0x9CA1,0x9CA2,0x9CA3,0x9CA5,0x9CA6,0x9CA7, +0x9CA8,0x9CA9,0x9CAB,0x9CAD,0x9CAE,0x9CB0,0x9CB1,0x9CB2, +0x9CB3,0x9CB4,0x9CB5,0x9CB6,0x9CB7,0x9CBA,0x9CBB,0x9CBC, +0x9CBD,0x9CC4,0x9CC5,0x9CC6,0x9CC7,0x9CCA,0x9CCB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9C3C,0x9C3D,0x9C3E,0x9C3F,0x9C40,0x9C41,0x9C42,0x9C43, +0x9C44,0x9C45,0x9C46,0x9C47,0x9C48,0x9C49,0x9C4A,0x9C4B, +0x9C4C,0x9C4D,0x9C4E,0x9C4F,0x9C50,0x9C51,0x9C52,0x9C53, +0x9C54,0x9C55,0x9C56,0x9C57,0x9C58,0x9C59,0x9C5A,0x9C5B, +0x9C5C,0x9C5D,0x9C5E,0x9C5F,0x9C60,0x9C61,0x9C62,0x9C63, +0x9C64,0x9C65,0x9C66,0x9C67,0x9C68,0x9C69,0x9C6A,0x9C6B, +0x9C6C,0x9C6D,0x9C6E,0x9C6F,0x9C70,0x9C71,0x9C72,0x9C73, +0x9C74,0x9C75,0x9C76,0x9C77,0x9C78,0x9C79,0x9C7A, 0, +0x9C7B,0x9C7D,0x9C7E,0x9C80,0x9C83,0x9C84,0x9C89,0x9C8A, +0x9C8C,0x9C8F,0x9C93,0x9C96,0x9C97,0x9C98,0x9C99,0x9C9D, +0x9CAA,0x9CAC,0x9CAF,0x9CB9,0x9CBE,0x9CBF,0x9CC0,0x9CC1, +0x9CC2,0x9CC8,0x9CC9,0x9CD1,0x9CD2,0x9CDA,0x9CDB,0x9CE0, +0x9CE1,0x9CCC,0x9CCD,0x9CCE,0x9CCF,0x9CD0,0x9CD3,0x9CD4, +0x9CD5,0x9CD7,0x9CD8,0x9CD9,0x9CDC,0x9CDD,0x9CDF,0x9CE2, +0x977C,0x9785,0x9791,0x9792,0x9794,0x97AF,0x97AB,0x97A3, +0x97B2,0x97B4,0x9AB1,0x9AB0,0x9AB7,0x9E58,0x9AB6,0x9ABA, +0x9ABC,0x9AC1,0x9AC0,0x9AC5,0x9AC2,0x9ACB,0x9ACC,0x9AD1, +0x9B45,0x9B43,0x9B47,0x9B49,0x9B48,0x9B4D,0x9B51,0x98E8, +0x990D,0x992E,0x9955,0x9954,0x9ADF,0x9AE1,0x9AE6,0x9AEF, +0x9AEB,0x9AFB,0x9AED,0x9AF9,0x9B08,0x9B0F,0x9B13,0x9B1F, +0x9B23,0x9EBD,0x9EBE,0x7E3B,0x9E82,0x9E87,0x9E88,0x9E8B, +0x9E92,0x93D6,0x9E9D,0x9E9F,0x9EDB,0x9EDC,0x9EDD,0x9EE0, +0x9EDF,0x9EE2,0x9EE9,0x9EE7,0x9EE5,0x9EEA,0x9EEF,0x9F22, +0x9F2C,0x9F2F,0x9F39,0x9F37,0x9F3D,0x9F3E,0x9F44, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9CE3,0x9CE4,0x9CE5,0x9CE6,0x9CE7,0x9CE8,0x9CE9,0x9CEA, +0x9CEB,0x9CEC,0x9CED,0x9CEE,0x9CEF,0x9CF0,0x9CF1,0x9CF2, +0x9CF3,0x9CF4,0x9CF5,0x9CF6,0x9CF7,0x9CF8,0x9CF9,0x9CFA, +0x9CFB,0x9CFC,0x9CFD,0x9CFE,0x9CFF,0x9D00,0x9D01,0x9D02, +0x9D03,0x9D04,0x9D05,0x9D06,0x9D07,0x9D08,0x9D09,0x9D0A, +0x9D0B,0x9D0C,0x9D0D,0x9D0E,0x9D0F,0x9D10,0x9D11,0x9D12, +0x9D13,0x9D14,0x9D15,0x9D16,0x9D17,0x9D18,0x9D19,0x9D1A, +0x9D1B,0x9D1C,0x9D1D,0x9D1E,0x9D1F,0x9D20,0x9D21, 0, +0x9D22,0x9D23,0x9D24,0x9D25,0x9D26,0x9D27,0x9D28,0x9D29, +0x9D2A,0x9D2B,0x9D2C,0x9D2D,0x9D2E,0x9D2F,0x9D30,0x9D31, +0x9D32,0x9D33,0x9D34,0x9D35,0x9D36,0x9D37,0x9D38,0x9D39, +0x9D3A,0x9D3B,0x9D3C,0x9D3D,0x9D3E,0x9D3F,0x9D40,0x9D41, +0x9D42, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9D43,0x9D44,0x9D45,0x9D46,0x9D47,0x9D48,0x9D49,0x9D4A, +0x9D4B,0x9D4C,0x9D4D,0x9D4E,0x9D4F,0x9D50,0x9D51,0x9D52, +0x9D53,0x9D54,0x9D55,0x9D56,0x9D57,0x9D58,0x9D59,0x9D5A, +0x9D5B,0x9D5C,0x9D5D,0x9D5E,0x9D5F,0x9D60,0x9D61,0x9D62, +0x9D63,0x9D64,0x9D65,0x9D66,0x9D67,0x9D68,0x9D69,0x9D6A, +0x9D6B,0x9D6C,0x9D6D,0x9D6E,0x9D6F,0x9D70,0x9D71,0x9D72, +0x9D73,0x9D74,0x9D75,0x9D76,0x9D77,0x9D78,0x9D79,0x9D7A, +0x9D7B,0x9D7C,0x9D7D,0x9D7E,0x9D7F,0x9D80,0x9D81, 0, +0x9D82,0x9D83,0x9D84,0x9D85,0x9D86,0x9D87,0x9D88,0x9D89, +0x9D8A,0x9D8B,0x9D8C,0x9D8D,0x9D8E,0x9D8F,0x9D90,0x9D91, +0x9D92,0x9D93,0x9D94,0x9D95,0x9D96,0x9D97,0x9D98,0x9D99, +0x9D9A,0x9D9B,0x9D9C,0x9D9D,0x9D9E,0x9D9F,0x9DA0,0x9DA1, +0x9DA2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9DA3,0x9DA4,0x9DA5,0x9DA6,0x9DA7,0x9DA8,0x9DA9,0x9DAA, +0x9DAB,0x9DAC,0x9DAD,0x9DAE,0x9DAF,0x9DB0,0x9DB1,0x9DB2, +0x9DB3,0x9DB4,0x9DB5,0x9DB6,0x9DB7,0x9DB8,0x9DB9,0x9DBA, +0x9DBB,0x9DBC,0x9DBD,0x9DBE,0x9DBF,0x9DC0,0x9DC1,0x9DC2, +0x9DC3,0x9DC4,0x9DC5,0x9DC6,0x9DC7,0x9DC8,0x9DC9,0x9DCA, +0x9DCB,0x9DCC,0x9DCD,0x9DCE,0x9DCF,0x9DD0,0x9DD1,0x9DD2, +0x9DD3,0x9DD4,0x9DD5,0x9DD6,0x9DD7,0x9DD8,0x9DD9,0x9DDA, +0x9DDB,0x9DDC,0x9DDD,0x9DDE,0x9DDF,0x9DE0,0x9DE1, 0, +0x9DE2,0x9DE3,0x9DE4,0x9DE5,0x9DE6,0x9DE7,0x9DE8,0x9DE9, +0x9DEA,0x9DEB,0x9DEC,0x9DED,0x9DEE,0x9DEF,0x9DF0,0x9DF1, +0x9DF2,0x9DF3,0x9DF4,0x9DF5,0x9DF6,0x9DF7,0x9DF8,0x9DF9, +0x9DFA,0x9DFB,0x9DFC,0x9DFD,0x9DFE,0x9DFF,0x9E00,0x9E01, +0x9E02, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9E03,0x9E04,0x9E05,0x9E06,0x9E07,0x9E08,0x9E09,0x9E0A, +0x9E0B,0x9E0C,0x9E0D,0x9E0E,0x9E0F,0x9E10,0x9E11,0x9E12, +0x9E13,0x9E14,0x9E15,0x9E16,0x9E17,0x9E18,0x9E19,0x9E1A, +0x9E1B,0x9E1C,0x9E1D,0x9E1E,0x9E24,0x9E27,0x9E2E,0x9E30, +0x9E34,0x9E3B,0x9E3C,0x9E40,0x9E4D,0x9E50,0x9E52,0x9E53, +0x9E54,0x9E56,0x9E59,0x9E5D,0x9E5F,0x9E60,0x9E61,0x9E62, +0x9E65,0x9E6E,0x9E6F,0x9E72,0x9E74,0x9E75,0x9E76,0x9E77, +0x9E78,0x9E79,0x9E7A,0x9E7B,0x9E7C,0x9E7D,0x9E80, 0, +0x9E81,0x9E83,0x9E84,0x9E85,0x9E86,0x9E89,0x9E8A,0x9E8C, +0x9E8D,0x9E8E,0x9E8F,0x9E90,0x9E91,0x9E94,0x9E95,0x9E96, +0x9E97,0x9E98,0x9E99,0x9E9A,0x9E9B,0x9E9C,0x9E9E,0x9EA0, +0x9EA1,0x9EA2,0x9EA3,0x9EA4,0x9EA5,0x9EA7,0x9EA8,0x9EA9, +0x9EAA, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9EAB,0x9EAC,0x9EAD,0x9EAE,0x9EAF,0x9EB0,0x9EB1,0x9EB2, +0x9EB3,0x9EB5,0x9EB6,0x9EB7,0x9EB9,0x9EBA,0x9EBC,0x9EBF, +0x9EC0,0x9EC1,0x9EC2,0x9EC3,0x9EC5,0x9EC6,0x9EC7,0x9EC8, +0x9ECA,0x9ECB,0x9ECC,0x9ED0,0x9ED2,0x9ED3,0x9ED5,0x9ED6, +0x9ED7,0x9ED9,0x9EDA,0x9EDE,0x9EE1,0x9EE3,0x9EE4,0x9EE6, +0x9EE8,0x9EEB,0x9EEC,0x9EED,0x9EEE,0x9EF0,0x9EF1,0x9EF2, +0x9EF3,0x9EF4,0x9EF5,0x9EF6,0x9EF7,0x9EF8,0x9EFA,0x9EFD, +0x9EFF,0x9F00,0x9F01,0x9F02,0x9F03,0x9F04,0x9F05, 0, +0x9F06,0x9F07,0x9F08,0x9F09,0x9F0A,0x9F0C,0x9F0F,0x9F11, +0x9F12,0x9F14,0x9F15,0x9F16,0x9F18,0x9F1A,0x9F1B,0x9F1C, +0x9F1D,0x9F1E,0x9F1F,0x9F21,0x9F23,0x9F24,0x9F25,0x9F26, +0x9F27,0x9F28,0x9F29,0x9F2A,0x9F2B,0x9F2D,0x9F2E,0x9F30, +0x9F31, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9F32,0x9F33,0x9F34,0x9F35,0x9F36,0x9F38,0x9F3A,0x9F3C, +0x9F3F,0x9F40,0x9F41,0x9F42,0x9F43,0x9F45,0x9F46,0x9F47, +0x9F48,0x9F49,0x9F4A,0x9F4B,0x9F4C,0x9F4D,0x9F4E,0x9F4F, +0x9F52,0x9F53,0x9F54,0x9F55,0x9F56,0x9F57,0x9F58,0x9F59, +0x9F5A,0x9F5B,0x9F5C,0x9F5D,0x9F5E,0x9F5F,0x9F60,0x9F61, +0x9F62,0x9F63,0x9F64,0x9F65,0x9F66,0x9F67,0x9F68,0x9F69, +0x9F6A,0x9F6B,0x9F6C,0x9F6D,0x9F6E,0x9F6F,0x9F70,0x9F71, +0x9F72,0x9F73,0x9F74,0x9F75,0x9F76,0x9F77,0x9F78, 0, +0x9F79,0x9F7A,0x9F7B,0x9F7C,0x9F7D,0x9F7E,0x9F81,0x9F82, +0x9F8D,0x9F8E,0x9F8F,0x9F90,0x9F91,0x9F92,0x9F93,0x9F94, +0x9F95,0x9F96,0x9F97,0x9F98,0x9F9C,0x9F9D,0x9F9E,0x9FA1, +0x9FA2,0x9FA3,0x9FA4,0x9FA5,0xF92C,0xF979,0xF995,0xF9E7, +0xF9F1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFA0C,0xFA0D,0xFA0E,0xFA0F,0xFA11,0xFA13,0xFA14,0xFA18, +0xFA1F,0xFA20,0xFA21,0xFA23,0xFA24,0xFA27,0xFA28,0xFA29 +}; + +static int func_gbk_uni_onechar(int code){ + if ((code>=0x8140)&&(code<=0xFE4F)) + return(tab_gbk_uni0[code-0x8140]); + return(0); +} + + + +/* page 0 0x00A4-0x0451 */ +static uint16 tab_uni_gbk0[]={ +0xA1E8, 0, 0,0xA1EC,0xA1A7, 0, 0, 0, + 0, 0, 0, 0,0xA1E3,0xA1C0, 0, 0, + 0, 0, 0,0xA1A4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA1C1, 0, 0, 0, 0, + 0, 0, 0, 0,0xA8A4,0xA8A2, 0, 0, + 0, 0, 0, 0,0xA8A8,0xA8A6,0xA8BA, 0, +0xA8AC,0xA8AA, 0, 0, 0, 0,0xA8B0,0xA8AE, + 0, 0, 0,0xA1C2, 0,0xA8B4,0xA8B2, 0, +0xA8B9, 0, 0, 0, 0,0xA8A1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA8A5, + 0, 0, 0, 0, 0, 0, 0,0xA8A7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA8A9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA8BD, 0, 0, 0,0xA8BE, 0, 0, 0, + 0,0xA8AD, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA8B1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA8A3, 0,0xA8AB, 0,0xA8AF, 0, +0xA8B3, 0,0xA8B5, 0,0xA8B6, 0,0xA8B7, 0, +0xA8B8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA8BB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA8C0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA1A6, 0,0xA1A5,0xA840,0xA841, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA842, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA6A1,0xA6A2,0xA6A3, +0xA6A4,0xA6A5,0xA6A6,0xA6A7,0xA6A8,0xA6A9,0xA6AA,0xA6AB, +0xA6AC,0xA6AD,0xA6AE,0xA6AF,0xA6B0,0xA6B1, 0,0xA6B2, +0xA6B3,0xA6B4,0xA6B5,0xA6B6,0xA6B7,0xA6B8, 0, 0, + 0, 0, 0, 0, 0,0xA6C1,0xA6C2,0xA6C3, +0xA6C4,0xA6C5,0xA6C6,0xA6C7,0xA6C8,0xA6C9,0xA6CA,0xA6CB, +0xA6CC,0xA6CD,0xA6CE,0xA6CF,0xA6D0,0xA6D1, 0,0xA6D2, +0xA6D3,0xA6D4,0xA6D5,0xA6D6,0xA6D7,0xA6D8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA7A7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA7A1,0xA7A2,0xA7A3,0xA7A4, +0xA7A5,0xA7A6,0xA7A8,0xA7A9,0xA7AA,0xA7AB,0xA7AC,0xA7AD, +0xA7AE,0xA7AF,0xA7B0,0xA7B1,0xA7B2,0xA7B3,0xA7B4,0xA7B5, +0xA7B6,0xA7B7,0xA7B8,0xA7B9,0xA7BA,0xA7BB,0xA7BC,0xA7BD, +0xA7BE,0xA7BF,0xA7C0,0xA7C1,0xA7D1,0xA7D2,0xA7D3,0xA7D4, +0xA7D5,0xA7D6,0xA7D8,0xA7D9,0xA7DA,0xA7DB,0xA7DC,0xA7DD, +0xA7DE,0xA7DF,0xA7E0,0xA7E1,0xA7E2,0xA7E3,0xA7E4,0xA7E5, +0xA7E6,0xA7E7,0xA7E8,0xA7E9,0xA7EA,0xA7EB,0xA7EC,0xA7ED, +0xA7EE,0xA7EF,0xA7F0,0xA7F1, 0,0xA7D7}; + +/* page 1 0x2010-0x2312 */ +static uint16 tab_uni_gbk1[]={ +0xA95C, 0, 0,0xA843,0xA1AA,0xA844,0xA1AC, 0, +0xA1AE,0xA1AF, 0, 0,0xA1B0,0xA1B1, 0, 0, + 0, 0, 0, 0, 0,0xA845,0xA1AD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1EB, 0,0xA1E4,0xA1E5, 0,0xA846, 0, 0, + 0, 0, 0,0xA1F9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA1E6, 0,0xA847, 0, 0, + 0,0xA848, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA1ED, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA959, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA2F1,0xA2F2,0xA2F3,0xA2F4,0xA2F5,0xA2F6,0xA2F7,0xA2F8, +0xA2F9,0xA2FA,0xA2FB,0xA2FC, 0, 0, 0, 0, +0xA2A1,0xA2A2,0xA2A3,0xA2A4,0xA2A5,0xA2A6,0xA2A7,0xA2A8, +0xA2A9,0xA2AA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1FB,0xA1FC,0xA1FA,0xA1FD, 0, 0,0xA849,0xA84A, +0xA84B,0xA84C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1CA, 0, 0, 0, 0, 0, 0,0xA1C7, + 0,0xA1C6, 0, 0, 0,0xA84D, 0, 0, + 0, 0,0xA1CC, 0, 0,0xA1D8,0xA1DE,0xA84E, +0xA1CF, 0, 0,0xA84F, 0,0xA1CE, 0,0xA1C4, +0xA1C5,0xA1C9,0xA1C8,0xA1D2, 0, 0,0xA1D3, 0, + 0, 0, 0, 0,0xA1E0,0xA1DF,0xA1C3,0xA1CB, + 0, 0, 0, 0, 0,0xA1D7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1D6, 0, 0, 0,0xA1D5, 0, 0, 0, + 0, 0,0xA850, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1D9,0xA1D4, 0, 0,0xA1DC,0xA1DD,0xA851,0xA852, + 0, 0, 0, 0, 0, 0,0xA1DA,0xA1DB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA892, 0, 0, + 0,0xA1D1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1CD, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xA853, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA1D0}; + +/* page 2 0x2460-0x2642 */ +static uint16 tab_uni_gbk2[]={ +0xA2D9,0xA2DA,0xA2DB,0xA2DC,0xA2DD,0xA2DE,0xA2DF,0xA2E0, +0xA2E1,0xA2E2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xA2C5,0xA2C6,0xA2C7,0xA2C8, +0xA2C9,0xA2CA,0xA2CB,0xA2CC,0xA2CD,0xA2CE,0xA2CF,0xA2D0, +0xA2D1,0xA2D2,0xA2D3,0xA2D4,0xA2D5,0xA2D6,0xA2D7,0xA2D8, +0xA2B1,0xA2B2,0xA2B3,0xA2B4,0xA2B5,0xA2B6,0xA2B7,0xA2B8, +0xA2B9,0xA2BA,0xA2BB,0xA2BC,0xA2BD,0xA2BE,0xA2BF,0xA2C0, +0xA2C1,0xA2C2,0xA2C3,0xA2C4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA9A4,0xA9A5,0xA9A6,0xA9A7,0xA9A8,0xA9A9,0xA9AA,0xA9AB, +0xA9AC,0xA9AD,0xA9AE,0xA9AF,0xA9B0,0xA9B1,0xA9B2,0xA9B3, +0xA9B4,0xA9B5,0xA9B6,0xA9B7,0xA9B8,0xA9B9,0xA9BA,0xA9BB, +0xA9BC,0xA9BD,0xA9BE,0xA9BF,0xA9C0,0xA9C1,0xA9C2,0xA9C3, +0xA9C4,0xA9C5,0xA9C6,0xA9C7,0xA9C8,0xA9C9,0xA9CA,0xA9CB, +0xA9CC,0xA9CD,0xA9CE,0xA9CF,0xA9D0,0xA9D1,0xA9D2,0xA9D3, +0xA9D4,0xA9D5,0xA9D6,0xA9D7,0xA9D8,0xA9D9,0xA9DA,0xA9DB, +0xA9DC,0xA9DD,0xA9DE,0xA9DF,0xA9E0,0xA9E1,0xA9E2,0xA9E3, +0xA9E4,0xA9E5,0xA9E6,0xA9E7,0xA9E8,0xA9E9,0xA9EA,0xA9EB, +0xA9EC,0xA9ED,0xA9EE,0xA9EF, 0, 0, 0, 0, +0xA854,0xA855,0xA856,0xA857,0xA858,0xA859,0xA85A,0xA85B, +0xA85C,0xA85D,0xA85E,0xA85F,0xA860,0xA861,0xA862,0xA863, +0xA864,0xA865,0xA866,0xA867,0xA868,0xA869,0xA86A,0xA86B, +0xA86C,0xA86D,0xA86E,0xA86F,0xA870,0xA871,0xA872,0xA873, +0xA874,0xA875,0xA876,0xA877, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA878,0xA879,0xA87A,0xA87B,0xA87C,0xA87D,0xA87E, +0xA880,0xA881,0xA882,0xA883,0xA884,0xA885,0xA886,0xA887, + 0, 0, 0,0xA888,0xA889,0xA88A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1F6,0xA1F5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA1F8,0xA1F7, 0, 0, 0, 0, + 0, 0, 0, 0,0xA88B,0xA88C, 0, 0, + 0, 0, 0, 0, 0, 0,0xA1F4,0xA1F3, + 0, 0, 0,0xA1F0, 0, 0,0xA1F2,0xA1F1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xA88D,0xA88E,0xA88F,0xA890, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xA1EF,0xA1EE, 0, + 0,0xA891, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1E2, 0,0xA1E1}; + +/* page 3 0x3000-0x3129 */ +static uint16 tab_uni_gbk3[]={ +0xA1A1,0xA1A2,0xA1A3,0xA1A8, 0,0xA1A9,0xA965,0xA996, +0xA1B4,0xA1B5,0xA1B6,0xA1B7,0xA1B8,0xA1B9,0xA1BA,0xA1BB, +0xA1BE,0xA1BF,0xA893,0xA1FE,0xA1B2,0xA1B3,0xA1BC,0xA1BD, + 0, 0, 0, 0, 0,0xA894,0xA895, 0, + 0,0xA940,0xA941,0xA942,0xA943,0xA944,0xA945,0xA946, +0xA947,0xA948, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA4A1,0xA4A2,0xA4A3,0xA4A4,0xA4A5,0xA4A6,0xA4A7, +0xA4A8,0xA4A9,0xA4AA,0xA4AB,0xA4AC,0xA4AD,0xA4AE,0xA4AF, +0xA4B0,0xA4B1,0xA4B2,0xA4B3,0xA4B4,0xA4B5,0xA4B6,0xA4B7, +0xA4B8,0xA4B9,0xA4BA,0xA4BB,0xA4BC,0xA4BD,0xA4BE,0xA4BF, +0xA4C0,0xA4C1,0xA4C2,0xA4C3,0xA4C4,0xA4C5,0xA4C6,0xA4C7, +0xA4C8,0xA4C9,0xA4CA,0xA4CB,0xA4CC,0xA4CD,0xA4CE,0xA4CF, +0xA4D0,0xA4D1,0xA4D2,0xA4D3,0xA4D4,0xA4D5,0xA4D6,0xA4D7, +0xA4D8,0xA4D9,0xA4DA,0xA4DB,0xA4DC,0xA4DD,0xA4DE,0xA4DF, +0xA4E0,0xA4E1,0xA4E2,0xA4E3,0xA4E4,0xA4E5,0xA4E6,0xA4E7, +0xA4E8,0xA4E9,0xA4EA,0xA4EB,0xA4EC,0xA4ED,0xA4EE,0xA4EF, +0xA4F0,0xA4F1,0xA4F2,0xA4F3, 0, 0, 0, 0, + 0, 0, 0,0xA961,0xA962,0xA966,0xA967, 0, + 0,0xA5A1,0xA5A2,0xA5A3,0xA5A4,0xA5A5,0xA5A6,0xA5A7, +0xA5A8,0xA5A9,0xA5AA,0xA5AB,0xA5AC,0xA5AD,0xA5AE,0xA5AF, +0xA5B0,0xA5B1,0xA5B2,0xA5B3,0xA5B4,0xA5B5,0xA5B6,0xA5B7, +0xA5B8,0xA5B9,0xA5BA,0xA5BB,0xA5BC,0xA5BD,0xA5BE,0xA5BF, +0xA5C0,0xA5C1,0xA5C2,0xA5C3,0xA5C4,0xA5C5,0xA5C6,0xA5C7, +0xA5C8,0xA5C9,0xA5CA,0xA5CB,0xA5CC,0xA5CD,0xA5CE,0xA5CF, +0xA5D0,0xA5D1,0xA5D2,0xA5D3,0xA5D4,0xA5D5,0xA5D6,0xA5D7, +0xA5D8,0xA5D9,0xA5DA,0xA5DB,0xA5DC,0xA5DD,0xA5DE,0xA5DF, +0xA5E0,0xA5E1,0xA5E2,0xA5E3,0xA5E4,0xA5E5,0xA5E6,0xA5E7, +0xA5E8,0xA5E9,0xA5EA,0xA5EB,0xA5EC,0xA5ED,0xA5EE,0xA5EF, +0xA5F0,0xA5F1,0xA5F2,0xA5F3,0xA5F4,0xA5F5,0xA5F6, 0, + 0, 0, 0, 0,0xA960,0xA963,0xA964, 0, + 0, 0, 0, 0, 0,0xA8C5,0xA8C6,0xA8C7, +0xA8C8,0xA8C9,0xA8CA,0xA8CB,0xA8CC,0xA8CD,0xA8CE,0xA8CF, +0xA8D0,0xA8D1,0xA8D2,0xA8D3,0xA8D4,0xA8D5,0xA8D6,0xA8D7, +0xA8D8,0xA8D9,0xA8DA,0xA8DB,0xA8DC,0xA8DD,0xA8DE,0xA8DF, +0xA8E0,0xA8E1,0xA8E2,0xA8E3,0xA8E4,0xA8E5,0xA8E6,0xA8E7, +0xA8E8,0xA8E9}; + +/* page 4 0x3220-0x32A3 */ +static uint16 tab_uni_gbk4[]={ +0xA2E5,0xA2E6,0xA2E7,0xA2E8,0xA2E9,0xA2EA,0xA2EB,0xA2EC, +0xA2ED,0xA2EE, 0, 0, 0, 0, 0, 0, + 0,0xA95A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xA949}; + +/* page 5 0x338E-0x33D5 */ +static uint16 tab_uni_gbk5[]={ +0xA94A,0xA94B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA94C,0xA94D, +0xA94E, 0, 0,0xA94F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xA950, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA951, 0, 0,0xA952,0xA953, 0, 0,0xA954 +}; + +/* page 6 0x4E00-0x9FA5 */ +static uint16 tab_uni_gbk6[]={ +0xD2BB,0xB6A1,0x8140,0xC6DF,0x8141,0x8142,0x8143,0xCDF2, +0xD5C9,0xC8FD,0xC9CF,0xCFC2,0xD8A2,0xB2BB,0xD3EB,0x8144, +0xD8A4,0xB3F3,0x8145,0xD7A8,0xC7D2,0xD8A7,0xCAC0,0x8146, +0xC7F0,0xB1FB,0xD2B5,0xB4D4,0xB6AB,0xCBBF,0xD8A9,0x8147, +0x8148,0x8149,0xB6AA,0x814A,0xC1BD,0xD1CF,0x814B,0xC9A5, +0xD8AD,0x814C,0xB8F6,0xD1BE,0xE3DC,0xD6D0,0x814D,0x814E, +0xB7E1,0x814F,0xB4AE,0x8150,0xC1D9,0x8151,0xD8BC,0x8152, +0xCDE8,0xB5A4,0xCEAA,0xD6F7,0x8153,0xC0F6,0xBED9,0xD8AF, +0x8154,0x8155,0x8156,0xC4CB,0x8157,0xBEC3,0x8158,0xD8B1, +0xC3B4,0xD2E5,0x8159,0xD6AE,0xCEDA,0xD5A7,0xBAF5,0xB7A6, +0xC0D6,0x815A,0xC6B9,0xC5D2,0xC7C7,0x815B,0xB9D4,0x815C, +0xB3CB,0xD2D2,0x815D,0x815E,0xD8BF,0xBEC5,0xC6F2,0xD2B2, +0xCFB0,0xCFE7,0x815F,0x8160,0x8161,0x8162,0xCAE9,0x8163, +0x8164,0xD8C0,0x8165,0x8166,0x8167,0x8168,0x8169,0x816A, +0xC2F2,0xC2D2,0x816B,0xC8E9,0x816C,0x816D,0x816E,0x816F, +0x8170,0x8171,0x8172,0x8173,0x8174,0x8175,0xC7AC,0x8176, +0x8177,0x8178,0x8179,0x817A,0x817B,0x817C,0xC1CB,0x817D, +0xD3E8,0xD5F9,0x817E,0xCAC2,0xB6FE,0xD8A1,0xD3DA,0xBFF7, +0x8180,0xD4C6,0xBBA5,0xD8C1,0xCEE5,0xBEAE,0x8181,0x8182, +0xD8A8,0x8183,0xD1C7,0xD0A9,0x8184,0x8185,0x8186,0xD8BD, +0xD9EF,0xCDF6,0xBFBA,0x8187,0xBDBB,0xBAA5,0xD2E0,0xB2FA, +0xBAE0,0xC4B6,0x8188,0xCFED,0xBEA9,0xCDA4,0xC1C1,0x8189, +0x818A,0x818B,0xC7D7,0xD9F1,0x818C,0xD9F4,0x818D,0x818E, +0x818F,0x8190,0xC8CB,0xD8E9,0x8191,0x8192,0x8193,0xD2DA, +0xCAB2,0xC8CA,0xD8EC,0xD8EA,0xD8C6,0xBDF6,0xC6CD,0xB3F0, +0x8194,0xD8EB,0xBDF1,0xBDE9,0x8195,0xC8D4,0xB4D3,0x8196, +0x8197,0xC2D8,0x8198,0xB2D6,0xD7D0,0xCACB,0xCBFB,0xD5CC, +0xB8B6,0xCFC9,0x8199,0x819A,0x819B,0xD9DA,0xD8F0,0xC7AA, +0x819C,0xD8EE,0x819D,0xB4FA,0xC1EE,0xD2D4,0x819E,0x819F, +0xD8ED,0x81A0,0xD2C7,0xD8EF,0xC3C7,0x81A1,0x81A2,0x81A3, +0xD1F6,0x81A4,0xD6D9,0xD8F2,0x81A5,0xD8F5,0xBCFE,0xBCDB, +0x81A6,0x81A7,0x81A8,0xC8CE,0x81A9,0xB7DD,0x81AA,0xB7C2, +0x81AB,0xC6F3,0x81AC,0x81AD,0x81AE,0x81AF,0x81B0,0x81B1, +0x81B2,0xD8F8,0xD2C1,0x81B3,0x81B4,0xCEE9,0xBCBF,0xB7FC, +0xB7A5,0xD0DD,0x81B5,0x81B6,0x81B7,0x81B8,0x81B9,0xD6DA, +0xD3C5,0xBBEF,0xBBE1,0xD8F1,0x81BA,0x81BB,0xC9A1,0xCEB0, +0xB4AB,0x81BC,0xD8F3,0x81BD,0xC9CB,0xD8F6,0xC2D7,0xD8F7, +0x81BE,0x81BF,0xCEB1,0xD8F9,0x81C0,0x81C1,0x81C2,0xB2AE, +0xB9C0,0x81C3,0xD9A3,0x81C4,0xB0E9,0x81C5,0xC1E6,0x81C6, +0xC9EC,0x81C7,0xCBC5,0x81C8,0xCBC6,0xD9A4,0x81C9,0x81CA, +0x81CB,0x81CC,0x81CD,0xB5E8,0x81CE,0x81CF,0xB5AB,0x81D0, +0x81D1,0x81D2,0x81D3,0x81D4,0x81D5,0xCEBB,0xB5CD,0xD7A1, +0xD7F4,0xD3D3,0x81D6,0xCCE5,0x81D7,0xBACE,0x81D8,0xD9A2, +0xD9DC,0xD3E0,0xD8FD,0xB7F0,0xD7F7,0xD8FE,0xD8FA,0xD9A1, +0xC4E3,0x81D9,0x81DA,0xD3B6,0xD8F4,0xD9DD,0x81DB,0xD8FB, +0x81DC,0xC5E5,0x81DD,0x81DE,0xC0D0,0x81DF,0x81E0,0xD1F0, +0xB0DB,0x81E1,0x81E2,0xBCD1,0xD9A6,0x81E3,0xD9A5,0x81E4, +0x81E5,0x81E6,0x81E7,0xD9AC,0xD9AE,0x81E8,0xD9AB,0xCAB9, +0x81E9,0x81EA,0x81EB,0xD9A9,0xD6B6,0x81EC,0x81ED,0x81EE, +0xB3DE,0xD9A8,0x81EF,0xC0FD,0x81F0,0xCACC,0x81F1,0xD9AA, +0x81F2,0xD9A7,0x81F3,0x81F4,0xD9B0,0x81F5,0x81F6,0xB6B1, +0x81F7,0x81F8,0x81F9,0xB9A9,0x81FA,0xD2C0,0x81FB,0x81FC, +0xCFC0,0x81FD,0x81FE,0xC2C2,0x8240,0xBDC4,0xD5EC,0xB2E0, +0xC7C8,0xBFEB,0xD9AD,0x8241,0xD9AF,0x8242,0xCEEA,0xBAEE, +0x8243,0x8244,0x8245,0x8246,0x8247,0xC7D6,0x8248,0x8249, +0x824A,0x824B,0x824C,0x824D,0x824E,0x824F,0x8250,0xB1E3, +0x8251,0x8252,0x8253,0xB4D9,0xB6ED,0xD9B4,0x8254,0x8255, +0x8256,0x8257,0xBFA1,0x8258,0x8259,0x825A,0xD9DE,0xC7CE, +0xC0FE,0xD9B8,0x825B,0x825C,0x825D,0x825E,0x825F,0xCBD7, +0xB7FD,0x8260,0xD9B5,0x8261,0xD9B7,0xB1A3,0xD3E1,0xD9B9, +0x8262,0xD0C5,0x8263,0xD9B6,0x8264,0x8265,0xD9B1,0x8266, +0xD9B2,0xC1A9,0xD9B3,0x8267,0x8268,0xBCF3,0xD0DE,0xB8A9, +0x8269,0xBEE3,0x826A,0xD9BD,0x826B,0x826C,0x826D,0x826E, +0xD9BA,0x826F,0xB0B3,0x8270,0x8271,0x8272,0xD9C2,0x8273, +0x8274,0x8275,0x8276,0x8277,0x8278,0x8279,0x827A,0x827B, +0x827C,0x827D,0x827E,0x8280,0xD9C4,0xB1B6,0x8281,0xD9BF, +0x8282,0x8283,0xB5B9,0x8284,0xBEF3,0x8285,0x8286,0x8287, +0xCCC8,0xBAF2,0xD2D0,0x8288,0xD9C3,0x8289,0x828A,0xBDE8, +0x828B,0xB3AB,0x828C,0x828D,0x828E,0xD9C5,0xBEEB,0x828F, +0xD9C6,0xD9BB,0xC4DF,0x8290,0xD9BE,0xD9C1,0xD9C0,0x8291, +0x8292,0x8293,0x8294,0x8295,0x8296,0x8297,0x8298,0x8299, +0x829A,0x829B,0xD5AE,0x829C,0xD6B5,0x829D,0xC7E3,0x829E, +0x829F,0x82A0,0x82A1,0xD9C8,0x82A2,0x82A3,0x82A4,0xBCD9, +0xD9CA,0x82A5,0x82A6,0x82A7,0xD9BC,0x82A8,0xD9CB,0xC6AB, +0x82A9,0x82AA,0x82AB,0x82AC,0x82AD,0xD9C9,0x82AE,0x82AF, +0x82B0,0x82B1,0xD7F6,0x82B2,0xCDA3,0x82B3,0x82B4,0x82B5, +0x82B6,0x82B7,0x82B8,0x82B9,0x82BA,0xBDA1,0x82BB,0x82BC, +0x82BD,0x82BE,0x82BF,0x82C0,0xD9CC,0x82C1,0x82C2,0x82C3, +0x82C4,0x82C5,0x82C6,0x82C7,0x82C8,0x82C9,0xC5BC,0xCDB5, +0x82CA,0x82CB,0x82CC,0xD9CD,0x82CD,0x82CE,0xD9C7,0xB3A5, +0xBFFE,0x82CF,0x82D0,0x82D1,0x82D2,0xB8B5,0x82D3,0x82D4, +0xC0FC,0x82D5,0x82D6,0x82D7,0x82D8,0xB0F8,0x82D9,0x82DA, +0x82DB,0x82DC,0x82DD,0x82DE,0x82DF,0x82E0,0x82E1,0x82E2, +0x82E3,0x82E4,0x82E5,0x82E6,0x82E7,0x82E8,0x82E9,0x82EA, +0x82EB,0x82EC,0x82ED,0xB4F6,0x82EE,0xD9CE,0x82EF,0xD9CF, +0xB4A2,0xD9D0,0x82F0,0x82F1,0xB4DF,0x82F2,0x82F3,0x82F4, +0x82F5,0x82F6,0xB0C1,0x82F7,0x82F8,0x82F9,0x82FA,0x82FB, +0x82FC,0x82FD,0xD9D1,0xC9B5,0x82FE,0x8340,0x8341,0x8342, +0x8343,0x8344,0x8345,0x8346,0x8347,0x8348,0x8349,0x834A, +0x834B,0x834C,0x834D,0x834E,0x834F,0x8350,0x8351,0xCFF1, +0x8352,0x8353,0x8354,0x8355,0x8356,0x8357,0xD9D2,0x8358, +0x8359,0x835A,0xC1C5,0x835B,0x835C,0x835D,0x835E,0x835F, +0x8360,0x8361,0x8362,0x8363,0x8364,0x8365,0xD9D6,0xC9AE, +0x8366,0x8367,0x8368,0x8369,0xD9D5,0xD9D4,0xD9D7,0x836A, +0x836B,0x836C,0x836D,0xCBDB,0x836E,0xBDA9,0x836F,0x8370, +0x8371,0x8372,0x8373,0xC6A7,0x8374,0x8375,0x8376,0x8377, +0x8378,0x8379,0x837A,0x837B,0x837C,0x837D,0xD9D3,0xD9D8, +0x837E,0x8380,0x8381,0xD9D9,0x8382,0x8383,0x8384,0x8385, +0x8386,0x8387,0xC8E5,0x8388,0x8389,0x838A,0x838B,0x838C, +0x838D,0x838E,0x838F,0x8390,0x8391,0x8392,0x8393,0x8394, +0x8395,0xC0DC,0x8396,0x8397,0x8398,0x8399,0x839A,0x839B, +0x839C,0x839D,0x839E,0x839F,0x83A0,0x83A1,0x83A2,0x83A3, +0x83A4,0x83A5,0x83A6,0x83A7,0x83A8,0x83A9,0x83AA,0x83AB, +0x83AC,0x83AD,0x83AE,0x83AF,0x83B0,0x83B1,0x83B2,0xB6F9, +0xD8A3,0xD4CA,0x83B3,0xD4AA,0xD0D6,0xB3E4,0xD5D7,0x83B4, +0xCFC8,0xB9E2,0x83B5,0xBFCB,0x83B6,0xC3E2,0x83B7,0x83B8, +0x83B9,0xB6D2,0x83BA,0x83BB,0xCDC3,0xD9EE,0xD9F0,0x83BC, +0x83BD,0x83BE,0xB5B3,0x83BF,0xB6B5,0x83C0,0x83C1,0x83C2, +0x83C3,0x83C4,0xBEA4,0x83C5,0x83C6,0xC8EB,0x83C7,0x83C8, +0xC8AB,0x83C9,0x83CA,0xB0CB,0xB9AB,0xC1F9,0xD9E2,0x83CB, +0xC0BC,0xB9B2,0x83CC,0xB9D8,0xD0CB,0xB1F8,0xC6E4,0xBEDF, +0xB5E4,0xD7C8,0x83CD,0xD1F8,0xBCE6,0xCADE,0x83CE,0x83CF, +0xBCBD,0xD9E6,0xD8E7,0x83D0,0x83D1,0xC4DA,0x83D2,0x83D3, +0xB8D4,0xC8BD,0x83D4,0x83D5,0xB2E1,0xD4D9,0x83D6,0x83D7, +0x83D8,0x83D9,0xC3B0,0x83DA,0x83DB,0xC3E1,0xDAA2,0xC8DF, +0x83DC,0xD0B4,0x83DD,0xBEFC,0xC5A9,0x83DE,0x83DF,0x83E0, +0xB9DA,0x83E1,0xDAA3,0x83E2,0xD4A9,0xDAA4,0x83E3,0x83E4, +0x83E5,0x83E6,0x83E7,0xD9FB,0xB6AC,0x83E8,0x83E9,0xB7EB, +0xB1F9,0xD9FC,0xB3E5,0xBEF6,0x83EA,0xBFF6,0xD2B1,0xC0E4, +0x83EB,0x83EC,0x83ED,0xB6B3,0xD9FE,0xD9FD,0x83EE,0x83EF, +0xBEBB,0x83F0,0x83F1,0x83F2,0xC6E0,0x83F3,0xD7BC,0xDAA1, +0x83F4,0xC1B9,0x83F5,0xB5F2,0xC1E8,0x83F6,0x83F7,0xBCF5, +0x83F8,0xB4D5,0x83F9,0x83FA,0x83FB,0x83FC,0x83FD,0x83FE, +0x8440,0x8441,0x8442,0xC1DD,0x8443,0xC4FD,0x8444,0x8445, +0xBCB8,0xB7B2,0x8446,0x8447,0xB7EF,0x8448,0x8449,0x844A, +0x844B,0x844C,0x844D,0xD9EC,0x844E,0xC6BE,0x844F,0xBFAD, +0xBBCB,0x8450,0x8451,0xB5CA,0x8452,0xDBC9,0xD0D7,0x8453, +0xCDB9,0xB0BC,0xB3F6,0xBBF7,0xDBCA,0xBAAF,0x8454,0xD4E4, +0xB5B6,0xB5F3,0xD8D6,0xC8D0,0x8455,0x8456,0xB7D6,0xC7D0, +0xD8D7,0x8457,0xBFAF,0x8458,0x8459,0xDBBB,0xD8D8,0x845A, +0x845B,0xD0CC,0xBBAE,0x845C,0x845D,0x845E,0xEBBE,0xC1D0, +0xC1F5,0xD4F2,0xB8D5,0xB4B4,0x845F,0xB3F5,0x8460,0x8461, +0xC9BE,0x8462,0x8463,0x8464,0xC5D0,0x8465,0x8466,0x8467, +0xC5D9,0xC0FB,0x8468,0xB1F0,0x8469,0xD8D9,0xB9CE,0x846A, +0xB5BD,0x846B,0x846C,0xD8DA,0x846D,0x846E,0xD6C6,0xCBA2, +0xC8AF,0xC9B2,0xB4CC,0xBFCC,0x846F,0xB9F4,0x8470,0xD8DB, +0xD8DC,0xB6E7,0xBCC1,0xCCEA,0x8471,0x8472,0x8473,0x8474, +0x8475,0x8476,0xCFF7,0x8477,0xD8DD,0xC7B0,0x8478,0x8479, +0xB9D0,0xBDA3,0x847A,0x847B,0xCCDE,0x847C,0xC6CA,0x847D, +0x847E,0x8480,0x8481,0x8482,0xD8E0,0x8483,0xD8DE,0x8484, +0x8485,0xD8DF,0x8486,0x8487,0x8488,0xB0FE,0x8489,0xBEE7, +0x848A,0xCAA3,0xBCF4,0x848B,0x848C,0x848D,0x848E,0xB8B1, +0x848F,0x8490,0xB8EE,0x8491,0x8492,0x8493,0x8494,0x8495, +0x8496,0x8497,0x8498,0x8499,0x849A,0xD8E2,0x849B,0xBDCB, +0x849C,0xD8E4,0xD8E3,0x849D,0x849E,0x849F,0x84A0,0x84A1, +0xC5FC,0x84A2,0x84A3,0x84A4,0x84A5,0x84A6,0x84A7,0x84A8, +0xD8E5,0x84A9,0x84AA,0xD8E6,0x84AB,0x84AC,0x84AD,0x84AE, +0x84AF,0x84B0,0x84B1,0xC1A6,0x84B2,0xC8B0,0xB0EC,0xB9A6, +0xBCD3,0xCEF1,0xDBBD,0xC1D3,0x84B3,0x84B4,0x84B5,0x84B6, +0xB6AF,0xD6FA,0xC5AC,0xBDD9,0xDBBE,0xDBBF,0x84B7,0x84B8, +0x84B9,0xC0F8,0xBEA2,0xC0CD,0x84BA,0x84BB,0x84BC,0x84BD, +0x84BE,0x84BF,0x84C0,0x84C1,0x84C2,0x84C3,0xDBC0,0xCAC6, +0x84C4,0x84C5,0x84C6,0xB2AA,0x84C7,0x84C8,0x84C9,0xD3C2, +0x84CA,0xC3E3,0x84CB,0xD1AB,0x84CC,0x84CD,0x84CE,0x84CF, +0xDBC2,0x84D0,0xC0D5,0x84D1,0x84D2,0x84D3,0xDBC3,0x84D4, +0xBFB1,0x84D5,0x84D6,0x84D7,0x84D8,0x84D9,0x84DA,0xC4BC, +0x84DB,0x84DC,0x84DD,0x84DE,0xC7DA,0x84DF,0x84E0,0x84E1, +0x84E2,0x84E3,0x84E4,0x84E5,0x84E6,0x84E7,0x84E8,0x84E9, +0xDBC4,0x84EA,0x84EB,0x84EC,0x84ED,0x84EE,0x84EF,0x84F0, +0x84F1,0xD9E8,0xC9D7,0x84F2,0x84F3,0x84F4,0xB9B4,0xCEF0, +0xD4C8,0x84F5,0x84F6,0x84F7,0x84F8,0xB0FC,0xB4D2,0x84F9, +0xD0D9,0x84FA,0x84FB,0x84FC,0x84FD,0xD9E9,0x84FE,0xDECB, +0xD9EB,0x8540,0x8541,0x8542,0x8543,0xD8B0,0xBBAF,0xB1B1, +0x8544,0xB3D7,0xD8CE,0x8545,0x8546,0xD4D1,0x8547,0x8548, +0xBDB3,0xBFEF,0x8549,0xCFBB,0x854A,0x854B,0xD8D0,0x854C, +0x854D,0x854E,0xB7CB,0x854F,0x8550,0x8551,0xD8D1,0x8552, +0x8553,0x8554,0x8555,0x8556,0x8557,0x8558,0x8559,0x855A, +0x855B,0xC6A5,0xC7F8,0xD2BD,0x855C,0x855D,0xD8D2,0xC4E4, +0x855E,0xCAAE,0x855F,0xC7A7,0x8560,0xD8A6,0x8561,0xC9FD, +0xCEE7,0xBBDC,0xB0EB,0x8562,0x8563,0x8564,0xBBAA,0xD0AD, +0x8565,0xB1B0,0xD7E4,0xD7BF,0x8566,0xB5A5,0xC2F4,0xC4CF, +0x8567,0x8568,0xB2A9,0x8569,0xB2B7,0x856A,0xB1E5,0xDFB2, +0xD5BC,0xBFA8,0xC2AC,0xD8D5,0xC2B1,0x856B,0xD8D4,0xCED4, +0x856C,0xDAE0,0x856D,0xCEC0,0x856E,0x856F,0xD8B4,0xC3AE, +0xD3A1,0xCEA3,0x8570,0xBCB4,0xC8B4,0xC2D1,0x8571,0xBEED, +0xD0B6,0x8572,0xDAE1,0x8573,0x8574,0x8575,0x8576,0xC7E4, +0x8577,0x8578,0xB3A7,0x8579,0xB6F2,0xCCFC,0xC0FA,0x857A, +0x857B,0xC0F7,0x857C,0xD1B9,0xD1E1,0xD8C7,0x857D,0x857E, +0x8580,0x8581,0x8582,0x8583,0x8584,0xB2DE,0x8585,0x8586, +0xC0E5,0x8587,0xBAF1,0x8588,0x8589,0xD8C8,0x858A,0xD4AD, +0x858B,0x858C,0xCFE1,0xD8C9,0x858D,0xD8CA,0xCFC3,0x858E, +0xB3F8,0xBEC7,0x858F,0x8590,0x8591,0x8592,0xD8CB,0x8593, +0x8594,0x8595,0x8596,0x8597,0x8598,0x8599,0xDBCC,0x859A, +0x859B,0x859C,0x859D,0xC8A5,0x859E,0x859F,0x85A0,0xCFD8, +0x85A1,0xC8FE,0xB2CE,0x85A2,0x85A3,0x85A4,0x85A5,0x85A6, +0xD3D6,0xB2E6,0xBCB0,0xD3D1,0xCBAB,0xB7B4,0x85A7,0x85A8, +0x85A9,0xB7A2,0x85AA,0x85AB,0xCAE5,0x85AC,0xC8A1,0xCADC, +0xB1E4,0xD0F0,0x85AD,0xC5D1,0x85AE,0x85AF,0x85B0,0xDBC5, +0xB5FE,0x85B1,0x85B2,0xBFDA,0xB9C5,0xBEE4,0xC1ED,0x85B3, +0xDFB6,0xDFB5,0xD6BB,0xBDD0,0xD5D9,0xB0C8,0xB6A3,0xBFC9, +0xCCA8,0xDFB3,0xCAB7,0xD3D2,0x85B4,0xD8CF,0xD2B6,0xBAC5, +0xCBBE,0xCCBE,0x85B5,0xDFB7,0xB5F0,0xDFB4,0x85B6,0x85B7, +0x85B8,0xD3F5,0x85B9,0xB3D4,0xB8F7,0x85BA,0xDFBA,0x85BB, +0xBACF,0xBCAA,0xB5F5,0x85BC,0xCDAC,0xC3FB,0xBAF3,0xC0F4, +0xCDC2,0xCFF2,0xDFB8,0xCFC5,0x85BD,0xC2C0,0xDFB9,0xC2F0, +0x85BE,0x85BF,0x85C0,0xBEFD,0x85C1,0xC1DF,0xCDCC,0xD2F7, +0xB7CD,0xDFC1,0x85C2,0xDFC4,0x85C3,0x85C4,0xB7F1,0xB0C9, +0xB6D6,0xB7D4,0x85C5,0xBAAC,0xCCFD,0xBFD4,0xCBB1,0xC6F4, +0x85C6,0xD6A8,0xDFC5,0x85C7,0xCEE2,0xB3B3,0x85C8,0x85C9, +0xCEFC,0xB4B5,0x85CA,0xCEC7,0xBAF0,0x85CB,0xCEE1,0x85CC, +0xD1BD,0x85CD,0x85CE,0xDFC0,0x85CF,0x85D0,0xB4F4,0x85D1, +0xB3CA,0x85D2,0xB8E6,0xDFBB,0x85D3,0x85D4,0x85D5,0x85D6, +0xC4C5,0x85D7,0xDFBC,0xDFBD,0xDFBE,0xC5BB,0xDFBF,0xDFC2, +0xD4B1,0xDFC3,0x85D8,0xC7BA,0xCED8,0x85D9,0x85DA,0x85DB, +0x85DC,0x85DD,0xC4D8,0x85DE,0xDFCA,0x85DF,0xDFCF,0x85E0, +0xD6DC,0x85E1,0x85E2,0x85E3,0x85E4,0x85E5,0x85E6,0x85E7, +0x85E8,0xDFC9,0xDFDA,0xCEB6,0x85E9,0xBAC7,0xDFCE,0xDFC8, +0xC5DE,0x85EA,0x85EB,0xC9EB,0xBAF4,0xC3FC,0x85EC,0x85ED, +0xBED7,0x85EE,0xDFC6,0x85EF,0xDFCD,0x85F0,0xC5D8,0x85F1, +0x85F2,0x85F3,0x85F4,0xD5A6,0xBACD,0x85F5,0xBECC,0xD3BD, +0xB8C0,0x85F6,0xD6E4,0x85F7,0xDFC7,0xB9BE,0xBFA7,0x85F8, +0x85F9,0xC1FC,0xDFCB,0xDFCC,0x85FA,0xDFD0,0x85FB,0x85FC, +0x85FD,0x85FE,0x8640,0xDFDB,0xDFE5,0x8641,0xDFD7,0xDFD6, +0xD7C9,0xDFE3,0xDFE4,0xE5EB,0xD2A7,0xDFD2,0x8642,0xBFA9, +0x8643,0xD4DB,0x8644,0xBFC8,0xDFD4,0x8645,0x8646,0x8647, +0xCFCC,0x8648,0x8649,0xDFDD,0x864A,0xD1CA,0x864B,0xDFDE, +0xB0A7,0xC6B7,0xDFD3,0x864C,0xBAE5,0x864D,0xB6DF,0xCDDB, +0xB9FE,0xD4D5,0x864E,0x864F,0xDFDF,0xCFEC,0xB0A5,0xDFE7, +0xDFD1,0xD1C6,0xDFD5,0xDFD8,0xDFD9,0xDFDC,0x8650,0xBBA9, +0x8651,0xDFE0,0xDFE1,0x8652,0xDFE2,0xDFE6,0xDFE8,0xD3B4, +0x8653,0x8654,0x8655,0x8656,0x8657,0xB8E7,0xC5B6,0xDFEA, +0xC9DA,0xC1A8,0xC4C4,0x8658,0x8659,0xBFDE,0xCFF8,0x865A, +0x865B,0x865C,0xD5DC,0xDFEE,0x865D,0x865E,0x865F,0x8660, +0x8661,0x8662,0xB2B8,0x8663,0xBADF,0xDFEC,0x8664,0xDBC1, +0x8665,0xD1E4,0x8666,0x8667,0x8668,0x8669,0xCBF4,0xB4BD, +0x866A,0xB0A6,0x866B,0x866C,0x866D,0x866E,0x866F,0xDFF1, +0xCCC6,0xDFF2,0x8670,0x8671,0xDFED,0x8672,0x8673,0x8674, +0x8675,0x8676,0x8677,0xDFE9,0x8678,0x8679,0x867A,0x867B, +0xDFEB,0x867C,0xDFEF,0xDFF0,0xBBBD,0x867D,0x867E,0xDFF3, +0x8680,0x8681,0xDFF4,0x8682,0xBBA3,0x8683,0xCADB,0xCEA8, +0xE0A7,0xB3AA,0x8684,0xE0A6,0x8685,0x8686,0x8687,0xE0A1, +0x8688,0x8689,0x868A,0x868B,0xDFFE,0x868C,0xCDD9,0xDFFC, +0x868D,0xDFFA,0x868E,0xBFD0,0xD7C4,0x868F,0xC9CC,0x8690, +0x8691,0xDFF8,0xB0A1,0x8692,0x8693,0x8694,0x8695,0x8696, +0xDFFD,0x8697,0x8698,0x8699,0x869A,0xDFFB,0xE0A2,0x869B, +0x869C,0x869D,0x869E,0x869F,0xE0A8,0x86A0,0x86A1,0x86A2, +0x86A3,0xB7C8,0x86A4,0x86A5,0xC6A1,0xC9B6,0xC0B2,0xDFF5, +0x86A6,0x86A7,0xC5BE,0x86A8,0xD8C4,0xDFF9,0xC4F6,0x86A9, +0x86AA,0x86AB,0x86AC,0x86AD,0x86AE,0xE0A3,0xE0A4,0xE0A5, +0xD0A5,0x86AF,0x86B0,0xE0B4,0xCCE4,0x86B1,0xE0B1,0x86B2, +0xBFA6,0xE0AF,0xCEB9,0xE0AB,0xC9C6,0x86B3,0x86B4,0xC0AE, +0xE0AE,0xBAED,0xBAB0,0xE0A9,0x86B5,0x86B6,0x86B7,0xDFF6, +0x86B8,0xE0B3,0x86B9,0x86BA,0xE0B8,0x86BB,0x86BC,0x86BD, +0xB4AD,0xE0B9,0x86BE,0x86BF,0xCFB2,0xBAC8,0x86C0,0xE0B0, +0x86C1,0x86C2,0x86C3,0x86C4,0x86C5,0x86C6,0x86C7,0xD0FA, +0x86C8,0x86C9,0x86CA,0x86CB,0x86CC,0x86CD,0x86CE,0x86CF, +0x86D0,0xE0AC,0x86D1,0xD4FB,0x86D2,0xDFF7,0x86D3,0xC5E7, +0x86D4,0xE0AD,0x86D5,0xD3F7,0x86D6,0xE0B6,0xE0B7,0x86D7, +0x86D8,0x86D9,0x86DA,0x86DB,0xE0C4,0xD0E1,0x86DC,0x86DD, +0x86DE,0xE0BC,0x86DF,0x86E0,0xE0C9,0xE0CA,0x86E1,0x86E2, +0x86E3,0xE0BE,0xE0AA,0xC9A4,0xE0C1,0x86E4,0xE0B2,0x86E5, +0x86E6,0x86E7,0x86E8,0x86E9,0xCAC8,0xE0C3,0x86EA,0xE0B5, +0x86EB,0xCECB,0x86EC,0xCBC3,0xE0CD,0xE0C6,0xE0C2,0x86ED, +0xE0CB,0x86EE,0xE0BA,0xE0BF,0xE0C0,0x86EF,0x86F0,0xE0C5, +0x86F1,0x86F2,0xE0C7,0xE0C8,0x86F3,0xE0CC,0x86F4,0xE0BB, +0x86F5,0x86F6,0x86F7,0x86F8,0x86F9,0xCBD4,0xE0D5,0x86FA, +0xE0D6,0xE0D2,0x86FB,0x86FC,0x86FD,0x86FE,0x8740,0x8741, +0xE0D0,0xBCCE,0x8742,0x8743,0xE0D1,0x8744,0xB8C2,0xD8C5, +0x8745,0x8746,0x8747,0x8748,0x8749,0x874A,0x874B,0x874C, +0xD0EA,0x874D,0x874E,0xC2EF,0x874F,0x8750,0xE0CF,0xE0BD, +0x8751,0x8752,0x8753,0xE0D4,0xE0D3,0x8754,0x8755,0xE0D7, +0x8756,0x8757,0x8758,0x8759,0xE0DC,0xE0D8,0x875A,0x875B, +0x875C,0xD6F6,0xB3B0,0x875D,0xD7EC,0x875E,0xCBBB,0x875F, +0x8760,0xE0DA,0x8761,0xCEFB,0x8762,0x8763,0x8764,0xBAD9, +0x8765,0x8766,0x8767,0x8768,0x8769,0x876A,0x876B,0x876C, +0x876D,0x876E,0x876F,0x8770,0xE0E1,0xE0DD,0xD2AD,0x8771, +0x8772,0x8773,0x8774,0x8775,0xE0E2,0x8776,0x8777,0xE0DB, +0xE0D9,0xE0DF,0x8778,0x8779,0xE0E0,0x877A,0x877B,0x877C, +0x877D,0x877E,0xE0DE,0x8780,0xE0E4,0x8781,0x8782,0x8783, +0xC6F7,0xD8AC,0xD4EB,0xE0E6,0xCAC9,0x8784,0x8785,0x8786, +0x8787,0xE0E5,0x8788,0x8789,0x878A,0x878B,0xB8C1,0x878C, +0x878D,0x878E,0x878F,0xE0E7,0xE0E8,0x8790,0x8791,0x8792, +0x8793,0x8794,0x8795,0x8796,0x8797,0xE0E9,0xE0E3,0x8798, +0x8799,0x879A,0x879B,0x879C,0x879D,0x879E,0xBABF,0xCCE7, +0x879F,0x87A0,0x87A1,0xE0EA,0x87A2,0x87A3,0x87A4,0x87A5, +0x87A6,0x87A7,0x87A8,0x87A9,0x87AA,0x87AB,0x87AC,0x87AD, +0x87AE,0x87AF,0x87B0,0xCFF9,0x87B1,0x87B2,0x87B3,0x87B4, +0x87B5,0x87B6,0x87B7,0x87B8,0x87B9,0x87BA,0x87BB,0xE0EB, +0x87BC,0x87BD,0x87BE,0x87BF,0x87C0,0x87C1,0x87C2,0xC8C2, +0x87C3,0x87C4,0x87C5,0x87C6,0xBDC0,0x87C7,0x87C8,0x87C9, +0x87CA,0x87CB,0x87CC,0x87CD,0x87CE,0x87CF,0x87D0,0x87D1, +0x87D2,0x87D3,0xC4D2,0x87D4,0x87D5,0x87D6,0x87D7,0x87D8, +0x87D9,0x87DA,0x87DB,0x87DC,0xE0EC,0x87DD,0x87DE,0xE0ED, +0x87DF,0x87E0,0xC7F4,0xCBC4,0x87E1,0xE0EE,0xBBD8,0xD8B6, +0xD2F2,0xE0EF,0xCDC5,0x87E2,0xB6DA,0x87E3,0x87E4,0x87E5, +0x87E6,0x87E7,0x87E8,0xE0F1,0x87E9,0xD4B0,0x87EA,0x87EB, +0xC0A7,0xB4D1,0x87EC,0x87ED,0xCEA7,0xE0F0,0x87EE,0x87EF, +0x87F0,0xE0F2,0xB9CC,0x87F1,0x87F2,0xB9FA,0xCDBC,0xE0F3, +0x87F3,0x87F4,0x87F5,0xC6D4,0xE0F4,0x87F6,0xD4B2,0x87F7, +0xC8A6,0xE0F6,0xE0F5,0x87F8,0x87F9,0x87FA,0x87FB,0x87FC, +0x87FD,0x87FE,0x8840,0x8841,0x8842,0x8843,0x8844,0x8845, +0x8846,0x8847,0x8848,0x8849,0xE0F7,0x884A,0x884B,0xCDC1, +0x884C,0x884D,0x884E,0xCAA5,0x884F,0x8850,0x8851,0x8852, +0xD4DA,0xDBD7,0xDBD9,0x8853,0xDBD8,0xB9E7,0xDBDC,0xDBDD, +0xB5D8,0x8854,0x8855,0xDBDA,0x8856,0x8857,0x8858,0x8859, +0x885A,0xDBDB,0xB3A1,0xDBDF,0x885B,0x885C,0xBBF8,0x885D, +0xD6B7,0x885E,0xDBE0,0x885F,0x8860,0x8861,0x8862,0xBEF9, +0x8863,0x8864,0xB7BB,0x8865,0xDBD0,0xCCAE,0xBFB2,0xBBB5, +0xD7F8,0xBFD3,0x8866,0x8867,0x8868,0x8869,0x886A,0xBFE9, +0x886B,0x886C,0xBCE1,0xCCB3,0xDBDE,0xB0D3,0xCEEB,0xB7D8, +0xD7B9,0xC6C2,0x886D,0x886E,0xC0A4,0x886F,0xCCB9,0x8870, +0xDBE7,0xDBE1,0xC6BA,0xDBE3,0x8871,0xDBE8,0x8872,0xC5F7, +0x8873,0x8874,0x8875,0xDBEA,0x8876,0x8877,0xDBE9,0xBFC0, +0x8878,0x8879,0x887A,0xDBE6,0xDBE5,0x887B,0x887C,0x887D, +0x887E,0x8880,0xB4B9,0xC0AC,0xC2A2,0xDBE2,0xDBE4,0x8881, +0x8882,0x8883,0x8884,0xD0CD,0xDBED,0x8885,0x8886,0x8887, +0x8888,0x8889,0xC0DD,0xDBF2,0x888A,0x888B,0x888C,0x888D, +0x888E,0x888F,0x8890,0xB6E2,0x8891,0x8892,0x8893,0x8894, +0xDBF3,0xDBD2,0xB9B8,0xD4AB,0xDBEC,0x8895,0xBFD1,0xDBF0, +0x8896,0xDBD1,0x8897,0xB5E6,0x8898,0xDBEB,0xBFE5,0x8899, +0x889A,0x889B,0xDBEE,0x889C,0xDBF1,0x889D,0x889E,0x889F, +0xDBF9,0x88A0,0x88A1,0x88A2,0x88A3,0x88A4,0x88A5,0x88A6, +0x88A7,0x88A8,0xB9A1,0xB0A3,0x88A9,0x88AA,0x88AB,0x88AC, +0x88AD,0x88AE,0x88AF,0xC2F1,0x88B0,0x88B1,0xB3C7,0xDBEF, +0x88B2,0x88B3,0xDBF8,0x88B4,0xC6D2,0xDBF4,0x88B5,0x88B6, +0xDBF5,0xDBF7,0xDBF6,0x88B7,0x88B8,0xDBFE,0x88B9,0xD3F2, +0xB2BA,0x88BA,0x88BB,0x88BC,0xDBFD,0x88BD,0x88BE,0x88BF, +0x88C0,0x88C1,0x88C2,0x88C3,0x88C4,0xDCA4,0x88C5,0xDBFB, +0x88C6,0x88C7,0x88C8,0x88C9,0xDBFA,0x88CA,0x88CB,0x88CC, +0xDBFC,0xC5E0,0xBBF9,0x88CD,0x88CE,0xDCA3,0x88CF,0x88D0, +0xDCA5,0x88D1,0xCCC3,0x88D2,0x88D3,0x88D4,0xB6D1,0xDDC0, +0x88D5,0x88D6,0x88D7,0xDCA1,0x88D8,0xDCA2,0x88D9,0x88DA, +0x88DB,0xC7B5,0x88DC,0x88DD,0x88DE,0xB6E9,0x88DF,0x88E0, +0x88E1,0xDCA7,0x88E2,0x88E3,0x88E4,0x88E5,0xDCA6,0x88E6, +0xDCA9,0xB1A4,0x88E7,0x88E8,0xB5CC,0x88E9,0x88EA,0x88EB, +0x88EC,0x88ED,0xBFB0,0x88EE,0x88EF,0x88F0,0x88F1,0x88F2, +0xD1DF,0x88F3,0x88F4,0x88F5,0x88F6,0xB6C2,0x88F7,0x88F8, +0x88F9,0x88FA,0x88FB,0x88FC,0x88FD,0x88FE,0x8940,0x8941, +0x8942,0x8943,0x8944,0x8945,0xDCA8,0x8946,0x8947,0x8948, +0x8949,0x894A,0x894B,0x894C,0xCBFA,0xEBF3,0x894D,0x894E, +0x894F,0xCBDC,0x8950,0x8951,0xCBFE,0x8952,0x8953,0x8954, +0xCCC1,0x8955,0x8956,0x8957,0x8958,0x8959,0xC8FB,0x895A, +0x895B,0x895C,0x895D,0x895E,0x895F,0xDCAA,0x8960,0x8961, +0x8962,0x8963,0x8964,0xCCEE,0xDCAB,0x8965,0x8966,0x8967, +0x8968,0x8969,0x896A,0x896B,0x896C,0x896D,0x896E,0x896F, +0x8970,0x8971,0x8972,0x8973,0x8974,0x8975,0xDBD3,0x8976, +0xDCAF,0xDCAC,0x8977,0xBEB3,0x8978,0xCAFB,0x8979,0x897A, +0x897B,0xDCAD,0x897C,0x897D,0x897E,0x8980,0x8981,0x8982, +0x8983,0x8984,0xC9CA,0xC4B9,0x8985,0x8986,0x8987,0x8988, +0x8989,0xC7BD,0xDCAE,0x898A,0x898B,0x898C,0xD4F6,0xD0E6, +0x898D,0x898E,0x898F,0x8990,0x8991,0x8992,0x8993,0x8994, +0xC4AB,0xB6D5,0x8995,0x8996,0x8997,0x8998,0x8999,0x899A, +0x899B,0x899C,0x899D,0x899E,0x899F,0x89A0,0x89A1,0x89A2, +0x89A3,0x89A4,0x89A5,0x89A6,0xDBD4,0x89A7,0x89A8,0x89A9, +0x89AA,0xB1DA,0x89AB,0x89AC,0x89AD,0xDBD5,0x89AE,0x89AF, +0x89B0,0x89B1,0x89B2,0x89B3,0x89B4,0x89B5,0x89B6,0x89B7, +0x89B8,0xDBD6,0x89B9,0x89BA,0x89BB,0xBABE,0x89BC,0x89BD, +0x89BE,0x89BF,0x89C0,0x89C1,0x89C2,0x89C3,0x89C4,0x89C5, +0x89C6,0x89C7,0x89C8,0x89C9,0xC8C0,0x89CA,0x89CB,0x89CC, +0x89CD,0x89CE,0x89CF,0xCABF,0xC8C9,0x89D0,0xD7B3,0x89D1, +0xC9F9,0x89D2,0x89D3,0xBFC7,0x89D4,0x89D5,0xBAF8,0x89D6, +0x89D7,0xD2BC,0x89D8,0x89D9,0x89DA,0x89DB,0x89DC,0x89DD, +0x89DE,0x89DF,0xE2BA,0x89E0,0xB4A6,0x89E1,0x89E2,0xB1B8, +0x89E3,0x89E4,0x89E5,0x89E6,0x89E7,0xB8B4,0x89E8,0xCFC4, +0x89E9,0x89EA,0x89EB,0x89EC,0xD9E7,0xCFA6,0xCDE2,0x89ED, +0x89EE,0xD9ED,0xB6E0,0x89EF,0xD2B9,0x89F0,0x89F1,0xB9BB, +0x89F2,0x89F3,0x89F4,0x89F5,0xE2B9,0xE2B7,0x89F6,0xB4F3, +0x89F7,0xCCEC,0xCCAB,0xB7F2,0x89F8,0xD8B2,0xD1EB,0xBABB, +0x89F9,0xCAA7,0x89FA,0x89FB,0xCDB7,0x89FC,0x89FD,0xD2C4, +0xBFE4,0xBCD0,0xB6E1,0x89FE,0xDEC5,0x8A40,0x8A41,0x8A42, +0x8A43,0xDEC6,0xDBBC,0x8A44,0xD1D9,0x8A45,0x8A46,0xC6E6, +0xC4CE,0xB7EE,0x8A47,0xB7DC,0x8A48,0x8A49,0xBFFC,0xD7E0, +0x8A4A,0xC6F5,0x8A4B,0x8A4C,0xB1BC,0xDEC8,0xBDB1,0xCCD7, +0xDECA,0x8A4D,0xDEC9,0x8A4E,0x8A4F,0x8A50,0x8A51,0x8A52, +0xB5EC,0x8A53,0xC9DD,0x8A54,0x8A55,0xB0C2,0x8A56,0x8A57, +0x8A58,0x8A59,0x8A5A,0x8A5B,0x8A5C,0x8A5D,0x8A5E,0x8A5F, +0x8A60,0x8A61,0x8A62,0xC5AE,0xC5AB,0x8A63,0xC4CC,0x8A64, +0xBCE9,0xCBFD,0x8A65,0x8A66,0x8A67,0xBAC3,0x8A68,0x8A69, +0x8A6A,0xE5F9,0xC8E7,0xE5FA,0xCDFD,0x8A6B,0xD7B1,0xB8BE, +0xC2E8,0x8A6C,0xC8D1,0x8A6D,0x8A6E,0xE5FB,0x8A6F,0x8A70, +0x8A71,0x8A72,0xB6CA,0xBCCB,0x8A73,0x8A74,0xD1FD,0xE6A1, +0x8A75,0xC3EE,0x8A76,0x8A77,0x8A78,0x8A79,0xE6A4,0x8A7A, +0x8A7B,0x8A7C,0x8A7D,0xE5FE,0xE6A5,0xCDD7,0x8A7E,0x8A80, +0xB7C1,0xE5FC,0xE5FD,0xE6A3,0x8A81,0x8A82,0xC4DD,0xE6A8, +0x8A83,0x8A84,0xE6A7,0x8A85,0x8A86,0x8A87,0x8A88,0x8A89, +0x8A8A,0xC3C3,0x8A8B,0xC6DE,0x8A8C,0x8A8D,0xE6AA,0x8A8E, +0x8A8F,0x8A90,0x8A91,0x8A92,0x8A93,0x8A94,0xC4B7,0x8A95, +0x8A96,0x8A97,0xE6A2,0xCABC,0x8A98,0x8A99,0x8A9A,0x8A9B, +0xBDE3,0xB9C3,0xE6A6,0xD0D5,0xCEAF,0x8A9C,0x8A9D,0xE6A9, +0xE6B0,0x8A9E,0xD2A6,0x8A9F,0xBDAA,0xE6AD,0x8AA0,0x8AA1, +0x8AA2,0x8AA3,0x8AA4,0xE6AF,0x8AA5,0xC0D1,0x8AA6,0x8AA7, +0xD2CC,0x8AA8,0x8AA9,0x8AAA,0xBCA7,0x8AAB,0x8AAC,0x8AAD, +0x8AAE,0x8AAF,0x8AB0,0x8AB1,0x8AB2,0x8AB3,0x8AB4,0x8AB5, +0x8AB6,0xE6B1,0x8AB7,0xD2F6,0x8AB8,0x8AB9,0x8ABA,0xD7CB, +0x8ABB,0xCDFE,0x8ABC,0xCDDE,0xC2A6,0xE6AB,0xE6AC,0xBDBF, +0xE6AE,0xE6B3,0x8ABD,0x8ABE,0xE6B2,0x8ABF,0x8AC0,0x8AC1, +0x8AC2,0xE6B6,0x8AC3,0xE6B8,0x8AC4,0x8AC5,0x8AC6,0x8AC7, +0xC4EF,0x8AC8,0x8AC9,0x8ACA,0xC4C8,0x8ACB,0x8ACC,0xBEEA, +0xC9EF,0x8ACD,0x8ACE,0xE6B7,0x8ACF,0xB6F0,0x8AD0,0x8AD1, +0x8AD2,0xC3E4,0x8AD3,0x8AD4,0x8AD5,0x8AD6,0x8AD7,0x8AD8, +0x8AD9,0xD3E9,0xE6B4,0x8ADA,0xE6B5,0x8ADB,0xC8A2,0x8ADC, +0x8ADD,0x8ADE,0x8ADF,0x8AE0,0xE6BD,0x8AE1,0x8AE2,0x8AE3, +0xE6B9,0x8AE4,0x8AE5,0x8AE6,0x8AE7,0x8AE8,0xC6C5,0x8AE9, +0x8AEA,0xCDF1,0xE6BB,0x8AEB,0x8AEC,0x8AED,0x8AEE,0x8AEF, +0x8AF0,0x8AF1,0x8AF2,0x8AF3,0x8AF4,0xE6BC,0x8AF5,0x8AF6, +0x8AF7,0x8AF8,0xBBE9,0x8AF9,0x8AFA,0x8AFB,0x8AFC,0x8AFD, +0x8AFE,0x8B40,0xE6BE,0x8B41,0x8B42,0x8B43,0x8B44,0xE6BA, +0x8B45,0x8B46,0xC0B7,0x8B47,0x8B48,0x8B49,0x8B4A,0x8B4B, +0x8B4C,0x8B4D,0x8B4E,0x8B4F,0xD3A4,0xE6BF,0xC9F4,0xE6C3, +0x8B50,0x8B51,0xE6C4,0x8B52,0x8B53,0x8B54,0x8B55,0xD0F6, +0x8B56,0x8B57,0x8B58,0x8B59,0x8B5A,0x8B5B,0x8B5C,0x8B5D, +0x8B5E,0x8B5F,0x8B60,0x8B61,0x8B62,0x8B63,0x8B64,0x8B65, +0x8B66,0x8B67,0xC3BD,0x8B68,0x8B69,0x8B6A,0x8B6B,0x8B6C, +0x8B6D,0x8B6E,0xC3C4,0xE6C2,0x8B6F,0x8B70,0x8B71,0x8B72, +0x8B73,0x8B74,0x8B75,0x8B76,0x8B77,0x8B78,0x8B79,0x8B7A, +0x8B7B,0x8B7C,0xE6C1,0x8B7D,0x8B7E,0x8B80,0x8B81,0x8B82, +0x8B83,0x8B84,0xE6C7,0xCFB1,0x8B85,0xEBF4,0x8B86,0x8B87, +0xE6CA,0x8B88,0x8B89,0x8B8A,0x8B8B,0x8B8C,0xE6C5,0x8B8D, +0x8B8E,0xBCDE,0xC9A9,0x8B8F,0x8B90,0x8B91,0x8B92,0x8B93, +0x8B94,0xBCB5,0x8B95,0x8B96,0xCFD3,0x8B97,0x8B98,0x8B99, +0x8B9A,0x8B9B,0xE6C8,0x8B9C,0xE6C9,0x8B9D,0xE6CE,0x8B9E, +0xE6D0,0x8B9F,0x8BA0,0x8BA1,0xE6D1,0x8BA2,0x8BA3,0x8BA4, +0xE6CB,0xB5D5,0x8BA5,0xE6CC,0x8BA6,0x8BA7,0xE6CF,0x8BA8, +0x8BA9,0xC4DB,0x8BAA,0xE6C6,0x8BAB,0x8BAC,0x8BAD,0x8BAE, +0x8BAF,0xE6CD,0x8BB0,0x8BB1,0x8BB2,0x8BB3,0x8BB4,0x8BB5, +0x8BB6,0x8BB7,0x8BB8,0x8BB9,0x8BBA,0x8BBB,0x8BBC,0x8BBD, +0x8BBE,0x8BBF,0x8BC0,0x8BC1,0x8BC2,0x8BC3,0x8BC4,0x8BC5, +0x8BC6,0xE6D2,0x8BC7,0x8BC8,0x8BC9,0x8BCA,0x8BCB,0x8BCC, +0x8BCD,0x8BCE,0x8BCF,0x8BD0,0x8BD1,0x8BD2,0xE6D4,0xE6D3, +0x8BD3,0x8BD4,0x8BD5,0x8BD6,0x8BD7,0x8BD8,0x8BD9,0x8BDA, +0x8BDB,0x8BDC,0x8BDD,0x8BDE,0x8BDF,0x8BE0,0x8BE1,0x8BE2, +0x8BE3,0x8BE4,0x8BE5,0x8BE6,0x8BE7,0x8BE8,0x8BE9,0x8BEA, +0x8BEB,0x8BEC,0xE6D5,0x8BED,0xD9F8,0x8BEE,0x8BEF,0xE6D6, +0x8BF0,0x8BF1,0x8BF2,0x8BF3,0x8BF4,0x8BF5,0x8BF6,0x8BF7, +0xE6D7,0x8BF8,0x8BF9,0x8BFA,0x8BFB,0x8BFC,0x8BFD,0x8BFE, +0x8C40,0x8C41,0x8C42,0x8C43,0x8C44,0x8C45,0x8C46,0x8C47, +0xD7D3,0xE6DD,0x8C48,0xE6DE,0xBFD7,0xD4D0,0x8C49,0xD7D6, +0xB4E6,0xCBEF,0xE6DA,0xD8C3,0xD7CE,0xD0A2,0x8C4A,0xC3CF, +0x8C4B,0x8C4C,0xE6DF,0xBCBE,0xB9C2,0xE6DB,0xD1A7,0x8C4D, +0x8C4E,0xBAA2,0xC2CF,0x8C4F,0xD8AB,0x8C50,0x8C51,0x8C52, +0xCAEB,0xE5EE,0x8C53,0xE6DC,0x8C54,0xB7F5,0x8C55,0x8C56, +0x8C57,0x8C58,0xC8E6,0x8C59,0x8C5A,0xC4F5,0x8C5B,0x8C5C, +0xE5B2,0xC4FE,0x8C5D,0xCBFC,0xE5B3,0xD5AC,0x8C5E,0xD3EE, +0xCAD8,0xB0B2,0x8C5F,0xCBCE,0xCDEA,0x8C60,0x8C61,0xBAEA, +0x8C62,0x8C63,0x8C64,0xE5B5,0x8C65,0xE5B4,0x8C66,0xD7DA, +0xB9D9,0xD6E6,0xB6A8,0xCDF0,0xD2CB,0xB1A6,0xCAB5,0x8C67, +0xB3E8,0xC9F3,0xBFCD,0xD0FB,0xCAD2,0xE5B6,0xBBC2,0x8C68, +0x8C69,0x8C6A,0xCFDC,0xB9AC,0x8C6B,0x8C6C,0x8C6D,0x8C6E, +0xD4D7,0x8C6F,0x8C70,0xBAA6,0xD1E7,0xCFFC,0xBCD2,0x8C71, +0xE5B7,0xC8DD,0x8C72,0x8C73,0x8C74,0xBFED,0xB1F6,0xCBDE, +0x8C75,0x8C76,0xBCC5,0x8C77,0xBCC4,0xD2FA,0xC3DC,0xBFDC, +0x8C78,0x8C79,0x8C7A,0x8C7B,0xB8BB,0x8C7C,0x8C7D,0x8C7E, +0xC3C2,0x8C80,0xBAAE,0xD4A2,0x8C81,0x8C82,0x8C83,0x8C84, +0x8C85,0x8C86,0x8C87,0x8C88,0x8C89,0xC7DE,0xC4AF,0xB2EC, +0x8C8A,0xB9D1,0x8C8B,0x8C8C,0xE5BB,0xC1C8,0x8C8D,0x8C8E, +0xD5AF,0x8C8F,0x8C90,0x8C91,0x8C92,0x8C93,0xE5BC,0x8C94, +0xE5BE,0x8C95,0x8C96,0x8C97,0x8C98,0x8C99,0x8C9A,0x8C9B, +0xB4E7,0xB6D4,0xCBC2,0xD1B0,0xB5BC,0x8C9C,0x8C9D,0xCAD9, +0x8C9E,0xB7E2,0x8C9F,0x8CA0,0xC9E4,0x8CA1,0xBDAB,0x8CA2, +0x8CA3,0xCEBE,0xD7F0,0x8CA4,0x8CA5,0x8CA6,0x8CA7,0xD0A1, +0x8CA8,0xC9D9,0x8CA9,0x8CAA,0xB6FB,0xE6D8,0xBCE2,0x8CAB, +0xB3BE,0x8CAC,0xC9D0,0x8CAD,0xE6D9,0xB3A2,0x8CAE,0x8CAF, +0x8CB0,0x8CB1,0xDECC,0x8CB2,0xD3C8,0xDECD,0x8CB3,0xD2A2, +0x8CB4,0x8CB5,0x8CB6,0x8CB7,0xDECE,0x8CB8,0x8CB9,0x8CBA, +0x8CBB,0xBECD,0x8CBC,0x8CBD,0xDECF,0x8CBE,0x8CBF,0x8CC0, +0xCAAC,0xD2FC,0xB3DF,0xE5EA,0xC4E1,0xBEA1,0xCEB2,0xC4F2, +0xBED6,0xC6A8,0xB2E3,0x8CC1,0x8CC2,0xBED3,0x8CC3,0x8CC4, +0xC7FC,0xCCEB,0xBDEC,0xCEDD,0x8CC5,0x8CC6,0xCABA,0xC6C1, +0xE5EC,0xD0BC,0x8CC7,0x8CC8,0x8CC9,0xD5B9,0x8CCA,0x8CCB, +0x8CCC,0xE5ED,0x8CCD,0x8CCE,0x8CCF,0x8CD0,0xCAF4,0x8CD1, +0xCDC0,0xC2C5,0x8CD2,0xE5EF,0x8CD3,0xC2C4,0xE5F0,0x8CD4, +0x8CD5,0x8CD6,0x8CD7,0x8CD8,0x8CD9,0x8CDA,0xE5F8,0xCDCD, +0x8CDB,0xC9BD,0x8CDC,0x8CDD,0x8CDE,0x8CDF,0x8CE0,0x8CE1, +0x8CE2,0xD2D9,0xE1A8,0x8CE3,0x8CE4,0x8CE5,0x8CE6,0xD3EC, +0x8CE7,0xCBEA,0xC6F1,0x8CE8,0x8CE9,0x8CEA,0x8CEB,0x8CEC, +0xE1AC,0x8CED,0x8CEE,0x8CEF,0xE1A7,0xE1A9,0x8CF0,0x8CF1, +0xE1AA,0xE1AF,0x8CF2,0x8CF3,0xB2ED,0x8CF4,0xE1AB,0xB8DA, +0xE1AD,0xE1AE,0xE1B0,0xB5BA,0xE1B1,0x8CF5,0x8CF6,0x8CF7, +0x8CF8,0x8CF9,0xE1B3,0xE1B8,0x8CFA,0x8CFB,0x8CFC,0x8CFD, +0x8CFE,0xD1D2,0x8D40,0xE1B6,0xE1B5,0xC1EB,0x8D41,0x8D42, +0x8D43,0xE1B7,0x8D44,0xD4C0,0x8D45,0xE1B2,0x8D46,0xE1BA, +0xB0B6,0x8D47,0x8D48,0x8D49,0x8D4A,0xE1B4,0x8D4B,0xBFF9, +0x8D4C,0xE1B9,0x8D4D,0x8D4E,0xE1BB,0x8D4F,0x8D50,0x8D51, +0x8D52,0x8D53,0x8D54,0xE1BE,0x8D55,0x8D56,0x8D57,0x8D58, +0x8D59,0x8D5A,0xE1BC,0x8D5B,0x8D5C,0x8D5D,0x8D5E,0x8D5F, +0x8D60,0xD6C5,0x8D61,0x8D62,0x8D63,0x8D64,0x8D65,0x8D66, +0x8D67,0xCFBF,0x8D68,0x8D69,0xE1BD,0xE1BF,0xC2CD,0x8D6A, +0xB6EB,0x8D6B,0xD3F8,0x8D6C,0x8D6D,0xC7CD,0x8D6E,0x8D6F, +0xB7E5,0x8D70,0x8D71,0x8D72,0x8D73,0x8D74,0x8D75,0x8D76, +0x8D77,0x8D78,0x8D79,0xBEFE,0x8D7A,0x8D7B,0x8D7C,0x8D7D, +0x8D7E,0x8D80,0xE1C0,0xE1C1,0x8D81,0x8D82,0xE1C7,0xB3E7, +0x8D83,0x8D84,0x8D85,0x8D86,0x8D87,0x8D88,0xC6E9,0x8D89, +0x8D8A,0x8D8B,0x8D8C,0x8D8D,0xB4DE,0x8D8E,0xD1C2,0x8D8F, +0x8D90,0x8D91,0x8D92,0xE1C8,0x8D93,0x8D94,0xE1C6,0x8D95, +0x8D96,0x8D97,0x8D98,0x8D99,0xE1C5,0x8D9A,0xE1C3,0xE1C2, +0x8D9B,0xB1C0,0x8D9C,0x8D9D,0x8D9E,0xD5B8,0xE1C4,0x8D9F, +0x8DA0,0x8DA1,0x8DA2,0x8DA3,0xE1CB,0x8DA4,0x8DA5,0x8DA6, +0x8DA7,0x8DA8,0x8DA9,0x8DAA,0x8DAB,0xE1CC,0xE1CA,0x8DAC, +0x8DAD,0x8DAE,0x8DAF,0x8DB0,0x8DB1,0x8DB2,0x8DB3,0xEFFA, +0x8DB4,0x8DB5,0xE1D3,0xE1D2,0xC7B6,0x8DB6,0x8DB7,0x8DB8, +0x8DB9,0x8DBA,0x8DBB,0x8DBC,0x8DBD,0x8DBE,0x8DBF,0x8DC0, +0xE1C9,0x8DC1,0x8DC2,0xE1CE,0x8DC3,0xE1D0,0x8DC4,0x8DC5, +0x8DC6,0x8DC7,0x8DC8,0x8DC9,0x8DCA,0x8DCB,0x8DCC,0x8DCD, +0x8DCE,0xE1D4,0x8DCF,0xE1D1,0xE1CD,0x8DD0,0x8DD1,0xE1CF, +0x8DD2,0x8DD3,0x8DD4,0x8DD5,0xE1D5,0x8DD6,0x8DD7,0x8DD8, +0x8DD9,0x8DDA,0x8DDB,0x8DDC,0x8DDD,0x8DDE,0x8DDF,0x8DE0, +0x8DE1,0x8DE2,0xE1D6,0x8DE3,0x8DE4,0x8DE5,0x8DE6,0x8DE7, +0x8DE8,0x8DE9,0x8DEA,0x8DEB,0x8DEC,0x8DED,0x8DEE,0x8DEF, +0x8DF0,0x8DF1,0x8DF2,0x8DF3,0x8DF4,0x8DF5,0x8DF6,0x8DF7, +0x8DF8,0xE1D7,0x8DF9,0x8DFA,0x8DFB,0xE1D8,0x8DFC,0x8DFD, +0x8DFE,0x8E40,0x8E41,0x8E42,0x8E43,0x8E44,0x8E45,0x8E46, +0x8E47,0x8E48,0x8E49,0x8E4A,0x8E4B,0x8E4C,0x8E4D,0x8E4E, +0x8E4F,0x8E50,0x8E51,0x8E52,0x8E53,0x8E54,0x8E55,0xE1DA, +0x8E56,0x8E57,0x8E58,0x8E59,0x8E5A,0x8E5B,0x8E5C,0x8E5D, +0x8E5E,0x8E5F,0x8E60,0x8E61,0x8E62,0xE1DB,0x8E63,0x8E64, +0x8E65,0x8E66,0x8E67,0x8E68,0x8E69,0xCEA1,0x8E6A,0x8E6B, +0x8E6C,0x8E6D,0x8E6E,0x8E6F,0x8E70,0x8E71,0x8E72,0x8E73, +0x8E74,0x8E75,0x8E76,0xE7DD,0x8E77,0xB4A8,0xD6DD,0x8E78, +0x8E79,0xD1B2,0xB3B2,0x8E7A,0x8E7B,0xB9A4,0xD7F3,0xC7C9, +0xBEDE,0xB9AE,0x8E7C,0xCED7,0x8E7D,0x8E7E,0xB2EE,0xDBCF, +0x8E80,0xBCBA,0xD2D1,0xCBC8,0xB0CD,0x8E81,0x8E82,0xCFEF, +0x8E83,0x8E84,0x8E85,0x8E86,0x8E87,0xD9E3,0xBDED,0x8E88, +0x8E89,0xB1D2,0xCAD0,0xB2BC,0x8E8A,0xCBA7,0xB7AB,0x8E8B, +0xCAA6,0x8E8C,0x8E8D,0x8E8E,0xCFA3,0x8E8F,0x8E90,0xE0F8, +0xD5CA,0xE0FB,0x8E91,0x8E92,0xE0FA,0xC5C1,0xCCFB,0x8E93, +0xC1B1,0xE0F9,0xD6E3,0xB2AF,0xD6C4,0xB5DB,0x8E94,0x8E95, +0x8E96,0x8E97,0x8E98,0x8E99,0x8E9A,0x8E9B,0xB4F8,0xD6A1, +0x8E9C,0x8E9D,0x8E9E,0x8E9F,0x8EA0,0xCFAF,0xB0EF,0x8EA1, +0x8EA2,0xE0FC,0x8EA3,0x8EA4,0x8EA5,0x8EA6,0x8EA7,0xE1A1, +0xB3A3,0x8EA8,0x8EA9,0xE0FD,0xE0FE,0xC3B1,0x8EAA,0x8EAB, +0x8EAC,0x8EAD,0xC3DD,0x8EAE,0xE1A2,0xB7F9,0x8EAF,0x8EB0, +0x8EB1,0x8EB2,0x8EB3,0x8EB4,0xBBCF,0x8EB5,0x8EB6,0x8EB7, +0x8EB8,0x8EB9,0x8EBA,0x8EBB,0xE1A3,0xC4BB,0x8EBC,0x8EBD, +0x8EBE,0x8EBF,0x8EC0,0xE1A4,0x8EC1,0x8EC2,0xE1A5,0x8EC3, +0x8EC4,0xE1A6,0xB4B1,0x8EC5,0x8EC6,0x8EC7,0x8EC8,0x8EC9, +0x8ECA,0x8ECB,0x8ECC,0x8ECD,0x8ECE,0x8ECF,0x8ED0,0x8ED1, +0x8ED2,0x8ED3,0xB8C9,0xC6BD,0xC4EA,0x8ED4,0xB2A2,0x8ED5, +0xD0D2,0x8ED6,0xE7DB,0xBBC3,0xD3D7,0xD3C4,0x8ED7,0xB9E3, +0xE2CF,0x8ED8,0x8ED9,0x8EDA,0xD7AF,0x8EDB,0xC7EC,0xB1D3, +0x8EDC,0x8EDD,0xB4B2,0xE2D1,0x8EDE,0x8EDF,0x8EE0,0xD0F2, +0xC2AE,0xE2D0,0x8EE1,0xBFE2,0xD3A6,0xB5D7,0xE2D2,0xB5EA, +0x8EE2,0xC3ED,0xB8FD,0x8EE3,0xB8AE,0x8EE4,0xC5D3,0xB7CF, +0xE2D4,0x8EE5,0x8EE6,0x8EE7,0x8EE8,0xE2D3,0xB6C8,0xD7F9, +0x8EE9,0x8EEA,0x8EEB,0x8EEC,0x8EED,0xCDA5,0x8EEE,0x8EEF, +0x8EF0,0x8EF1,0x8EF2,0xE2D8,0x8EF3,0xE2D6,0xCAFC,0xBFB5, +0xD3B9,0xE2D5,0x8EF4,0x8EF5,0x8EF6,0x8EF7,0xE2D7,0x8EF8, +0x8EF9,0x8EFA,0x8EFB,0x8EFC,0x8EFD,0x8EFE,0x8F40,0x8F41, +0x8F42,0xC1AE,0xC0C8,0x8F43,0x8F44,0x8F45,0x8F46,0x8F47, +0x8F48,0xE2DB,0xE2DA,0xC0AA,0x8F49,0x8F4A,0xC1CE,0x8F4B, +0x8F4C,0x8F4D,0x8F4E,0xE2DC,0x8F4F,0x8F50,0x8F51,0x8F52, +0x8F53,0x8F54,0x8F55,0x8F56,0x8F57,0x8F58,0x8F59,0x8F5A, +0xE2DD,0x8F5B,0xE2DE,0x8F5C,0x8F5D,0x8F5E,0x8F5F,0x8F60, +0x8F61,0x8F62,0x8F63,0x8F64,0xDBC8,0x8F65,0xD1D3,0xCDA2, +0x8F66,0x8F67,0xBDA8,0x8F68,0x8F69,0x8F6A,0xDEC3,0xD8A5, +0xBFAA,0xDBCD,0xD2EC,0xC6FA,0xC5AA,0x8F6B,0x8F6C,0x8F6D, +0xDEC4,0x8F6E,0xB1D7,0xDFAE,0x8F6F,0x8F70,0x8F71,0xCABD, +0x8F72,0xDFB1,0x8F73,0xB9AD,0x8F74,0xD2FD,0x8F75,0xB8A5, +0xBAEB,0x8F76,0x8F77,0xB3DA,0x8F78,0x8F79,0x8F7A,0xB5DC, +0xD5C5,0x8F7B,0x8F7C,0x8F7D,0x8F7E,0xC3D6,0xCFD2,0xBBA1, +0x8F80,0xE5F3,0xE5F2,0x8F81,0x8F82,0xE5F4,0x8F83,0xCDE4, +0x8F84,0xC8F5,0x8F85,0x8F86,0x8F87,0x8F88,0x8F89,0x8F8A, +0x8F8B,0xB5AF,0xC7BF,0x8F8C,0xE5F6,0x8F8D,0x8F8E,0x8F8F, +0xECB0,0x8F90,0x8F91,0x8F92,0x8F93,0x8F94,0x8F95,0x8F96, +0x8F97,0x8F98,0x8F99,0x8F9A,0x8F9B,0x8F9C,0x8F9D,0x8F9E, +0xE5E6,0x8F9F,0xB9E9,0xB5B1,0x8FA0,0xC2BC,0xE5E8,0xE5E7, +0xE5E9,0x8FA1,0x8FA2,0x8FA3,0x8FA4,0xD2CD,0x8FA5,0x8FA6, +0x8FA7,0xE1EA,0xD0CE,0x8FA8,0xCDAE,0x8FA9,0xD1E5,0x8FAA, +0x8FAB,0xB2CA,0xB1EB,0x8FAC,0xB1F2,0xC5ED,0x8FAD,0x8FAE, +0xD5C3,0xD3B0,0x8FAF,0xE1DC,0x8FB0,0x8FB1,0x8FB2,0xE1DD, +0x8FB3,0xD2DB,0x8FB4,0xB3B9,0xB1CB,0x8FB5,0x8FB6,0x8FB7, +0xCDF9,0xD5F7,0xE1DE,0x8FB8,0xBEB6,0xB4FD,0x8FB9,0xE1DF, +0xBADC,0xE1E0,0xBBB2,0xC2C9,0xE1E1,0x8FBA,0x8FBB,0x8FBC, +0xD0EC,0x8FBD,0xCDBD,0x8FBE,0x8FBF,0xE1E2,0x8FC0,0xB5C3, +0xC5C7,0xE1E3,0x8FC1,0x8FC2,0xE1E4,0x8FC3,0x8FC4,0x8FC5, +0x8FC6,0xD3F9,0x8FC7,0x8FC8,0x8FC9,0x8FCA,0x8FCB,0x8FCC, +0xE1E5,0x8FCD,0xD1AD,0x8FCE,0x8FCF,0xE1E6,0xCEA2,0x8FD0, +0x8FD1,0x8FD2,0x8FD3,0x8FD4,0x8FD5,0xE1E7,0x8FD6,0xB5C2, +0x8FD7,0x8FD8,0x8FD9,0x8FDA,0xE1E8,0xBBD5,0x8FDB,0x8FDC, +0x8FDD,0x8FDE,0x8FDF,0xD0C4,0xE2E0,0xB1D8,0xD2E4,0x8FE0, +0x8FE1,0xE2E1,0x8FE2,0x8FE3,0xBCC9,0xC8CC,0x8FE4,0xE2E3, +0xECFE,0xECFD,0xDFAF,0x8FE5,0x8FE6,0x8FE7,0xE2E2,0xD6BE, +0xCDFC,0xC3A6,0x8FE8,0x8FE9,0x8FEA,0xE3C3,0x8FEB,0x8FEC, +0xD6D2,0xE2E7,0x8FED,0x8FEE,0xE2E8,0x8FEF,0x8FF0,0xD3C7, +0x8FF1,0x8FF2,0xE2EC,0xBFEC,0x8FF3,0xE2ED,0xE2E5,0x8FF4, +0x8FF5,0xB3C0,0x8FF6,0x8FF7,0x8FF8,0xC4EE,0x8FF9,0x8FFA, +0xE2EE,0x8FFB,0x8FFC,0xD0C3,0x8FFD,0xBAF6,0xE2E9,0xB7DE, +0xBBB3,0xCCAC,0xCBCB,0xE2E4,0xE2E6,0xE2EA,0xE2EB,0x8FFE, +0x9040,0x9041,0xE2F7,0x9042,0x9043,0xE2F4,0xD4F5,0xE2F3, +0x9044,0x9045,0xC5AD,0x9046,0xD5FA,0xC5C2,0xB2C0,0x9047, +0x9048,0xE2EF,0x9049,0xE2F2,0xC1AF,0xCBBC,0x904A,0x904B, +0xB5A1,0xE2F9,0x904C,0x904D,0x904E,0xBCB1,0xE2F1,0xD0D4, +0xD4B9,0xE2F5,0xB9D6,0xE2F6,0x904F,0x9050,0x9051,0xC7D3, +0x9052,0x9053,0x9054,0x9055,0x9056,0xE2F0,0x9057,0x9058, +0x9059,0x905A,0x905B,0xD7DC,0xEDA1,0x905C,0x905D,0xE2F8, +0x905E,0xEDA5,0xE2FE,0xCAD1,0x905F,0x9060,0x9061,0x9062, +0x9063,0x9064,0x9065,0xC1B5,0x9066,0xBBD0,0x9067,0x9068, +0xBFD6,0x9069,0xBAE3,0x906A,0x906B,0xCBA1,0x906C,0x906D, +0x906E,0xEDA6,0xEDA3,0x906F,0x9070,0xEDA2,0x9071,0x9072, +0x9073,0x9074,0xBBD6,0xEDA7,0xD0F4,0x9075,0x9076,0xEDA4, +0xBADE,0xB6F7,0xE3A1,0xB6B2,0xCCF1,0xB9A7,0x9077,0xCFA2, +0xC7A1,0x9078,0x9079,0xBFD2,0x907A,0x907B,0xB6F1,0x907C, +0xE2FA,0xE2FB,0xE2FD,0xE2FC,0xC4D5,0xE3A2,0x907D,0xD3C1, +0x907E,0x9080,0x9081,0xE3A7,0xC7C4,0x9082,0x9083,0x9084, +0x9085,0xCFA4,0x9086,0x9087,0xE3A9,0xBAB7,0x9088,0x9089, +0x908A,0x908B,0xE3A8,0x908C,0xBBDA,0x908D,0xE3A3,0x908E, +0x908F,0x9090,0xE3A4,0xE3AA,0x9091,0xE3A6,0x9092,0xCEF2, +0xD3C6,0x9093,0x9094,0xBBBC,0x9095,0x9096,0xD4C3,0x9097, +0xC4FA,0x9098,0x9099,0xEDA8,0xD0FC,0xE3A5,0x909A,0xC3F5, +0x909B,0xE3AD,0xB1AF,0x909C,0xE3B2,0x909D,0x909E,0x909F, +0xBCC2,0x90A0,0x90A1,0xE3AC,0xB5BF,0x90A2,0x90A3,0x90A4, +0x90A5,0x90A6,0x90A7,0x90A8,0x90A9,0xC7E9,0xE3B0,0x90AA, +0x90AB,0x90AC,0xBEAA,0xCDEF,0x90AD,0x90AE,0x90AF,0x90B0, +0x90B1,0xBBF3,0x90B2,0x90B3,0x90B4,0xCCE8,0x90B5,0x90B6, +0xE3AF,0x90B7,0xE3B1,0x90B8,0xCFA7,0xE3AE,0x90B9,0xCEA9, +0xBBDD,0x90BA,0x90BB,0x90BC,0x90BD,0x90BE,0xB5EB,0xBEE5, +0xB2D2,0xB3CD,0x90BF,0xB1B9,0xE3AB,0xB2D1,0xB5AC,0xB9DF, +0xB6E8,0x90C0,0x90C1,0xCFEB,0xE3B7,0x90C2,0xBBCC,0x90C3, +0x90C4,0xC8C7,0xD0CA,0x90C5,0x90C6,0x90C7,0x90C8,0x90C9, +0xE3B8,0xB3EE,0x90CA,0x90CB,0x90CC,0x90CD,0xEDA9,0x90CE, +0xD3FA,0xD3E4,0x90CF,0x90D0,0x90D1,0xEDAA,0xE3B9,0xD2E2, +0x90D2,0x90D3,0x90D4,0x90D5,0x90D6,0xE3B5,0x90D7,0x90D8, +0x90D9,0x90DA,0xD3DE,0x90DB,0x90DC,0x90DD,0x90DE,0xB8D0, +0xE3B3,0x90DF,0x90E0,0xE3B6,0xB7DF,0x90E1,0xE3B4,0xC0A2, +0x90E2,0x90E3,0x90E4,0xE3BA,0x90E5,0x90E6,0x90E7,0x90E8, +0x90E9,0x90EA,0x90EB,0x90EC,0x90ED,0x90EE,0x90EF,0x90F0, +0x90F1,0x90F2,0x90F3,0x90F4,0x90F5,0x90F6,0x90F7,0xD4B8, +0x90F8,0x90F9,0x90FA,0x90FB,0x90FC,0x90FD,0x90FE,0x9140, +0xB4C8,0x9141,0xE3BB,0x9142,0xBBC5,0x9143,0xC9F7,0x9144, +0x9145,0xC9E5,0x9146,0x9147,0x9148,0xC4BD,0x9149,0x914A, +0x914B,0x914C,0x914D,0x914E,0x914F,0xEDAB,0x9150,0x9151, +0x9152,0x9153,0xC2FD,0x9154,0x9155,0x9156,0x9157,0xBBDB, +0xBFAE,0x9158,0x9159,0x915A,0x915B,0x915C,0x915D,0x915E, +0xCEBF,0x915F,0x9160,0x9161,0x9162,0xE3BC,0x9163,0xBFB6, +0x9164,0x9165,0x9166,0x9167,0x9168,0x9169,0x916A,0x916B, +0x916C,0x916D,0x916E,0x916F,0x9170,0x9171,0x9172,0x9173, +0x9174,0x9175,0x9176,0xB1EF,0x9177,0x9178,0xD4F7,0x9179, +0x917A,0x917B,0x917C,0x917D,0xE3BE,0x917E,0x9180,0x9181, +0x9182,0x9183,0x9184,0x9185,0x9186,0xEDAD,0x9187,0x9188, +0x9189,0x918A,0x918B,0x918C,0x918D,0x918E,0x918F,0xE3BF, +0xBAA9,0xEDAC,0x9190,0x9191,0xE3BD,0x9192,0x9193,0x9194, +0x9195,0x9196,0x9197,0x9198,0x9199,0x919A,0x919B,0xE3C0, +0x919C,0x919D,0x919E,0x919F,0x91A0,0x91A1,0xBAB6,0x91A2, +0x91A3,0x91A4,0xB6AE,0x91A5,0x91A6,0x91A7,0x91A8,0x91A9, +0xD0B8,0x91AA,0xB0C3,0xEDAE,0x91AB,0x91AC,0x91AD,0x91AE, +0x91AF,0xEDAF,0xC0C1,0x91B0,0xE3C1,0x91B1,0x91B2,0x91B3, +0x91B4,0x91B5,0x91B6,0x91B7,0x91B8,0x91B9,0x91BA,0x91BB, +0x91BC,0x91BD,0x91BE,0x91BF,0x91C0,0x91C1,0xC5B3,0x91C2, +0x91C3,0x91C4,0x91C5,0x91C6,0x91C7,0x91C8,0x91C9,0x91CA, +0x91CB,0x91CC,0x91CD,0x91CE,0x91CF,0xE3C2,0x91D0,0x91D1, +0x91D2,0x91D3,0x91D4,0x91D5,0x91D6,0x91D7,0x91D8,0xDCB2, +0x91D9,0x91DA,0x91DB,0x91DC,0x91DD,0x91DE,0xEDB0,0x91DF, +0xB8EA,0x91E0,0xCEEC,0xEAA7,0xD0E7,0xCAF9,0xC8D6,0xCFB7, +0xB3C9,0xCED2,0xBDE4,0x91E1,0x91E2,0xE3DE,0xBBF2,0xEAA8, +0xD5BD,0x91E3,0xC6DD,0xEAA9,0x91E4,0x91E5,0x91E6,0xEAAA, +0x91E7,0xEAAC,0xEAAB,0x91E8,0xEAAE,0xEAAD,0x91E9,0x91EA, +0x91EB,0x91EC,0xBDD8,0x91ED,0xEAAF,0x91EE,0xC2BE,0x91EF, +0x91F0,0x91F1,0x91F2,0xB4C1,0xB4F7,0x91F3,0x91F4,0xBBA7, +0x91F5,0x91F6,0x91F7,0x91F8,0x91F9,0xECE6,0xECE5,0xB7BF, +0xCBF9,0xB1E2,0x91FA,0xECE7,0x91FB,0x91FC,0x91FD,0xC9C8, +0xECE8,0xECE9,0x91FE,0xCAD6,0xDED0,0xB2C5,0xD4FA,0x9240, +0x9241,0xC6CB,0xB0C7,0xB4F2,0xC8D3,0x9242,0x9243,0x9244, +0xCDD0,0x9245,0x9246,0xBFB8,0x9247,0x9248,0x9249,0x924A, +0x924B,0x924C,0x924D,0xBFDB,0x924E,0x924F,0xC7A4,0xD6B4, +0x9250,0xC0A9,0xDED1,0xC9A8,0xD1EF,0xC5A4,0xB0E7,0xB3B6, +0xC8C5,0x9251,0x9252,0xB0E2,0x9253,0x9254,0xB7F6,0x9255, +0x9256,0xC5FA,0x9257,0x9258,0xB6F3,0x9259,0xD5D2,0xB3D0, +0xBCBC,0x925A,0x925B,0x925C,0xB3AD,0x925D,0x925E,0x925F, +0x9260,0xBEF1,0xB0D1,0x9261,0x9262,0x9263,0x9264,0x9265, +0x9266,0xD2D6,0xCAE3,0xD7A5,0x9267,0xCDB6,0xB6B6,0xBFB9, +0xD5DB,0x9268,0xB8A7,0xC5D7,0x9269,0x926A,0x926B,0xDED2, +0xBFD9,0xC2D5,0xC7C0,0x926C,0xBBA4,0xB1A8,0x926D,0x926E, +0xC5EA,0x926F,0x9270,0xC5FB,0xCCA7,0x9271,0x9272,0x9273, +0x9274,0xB1A7,0x9275,0x9276,0x9277,0xB5D6,0x9278,0x9279, +0x927A,0xC4A8,0x927B,0xDED3,0xD1BA,0xB3E9,0x927C,0xC3F2, +0x927D,0x927E,0xB7F7,0x9280,0xD6F4,0xB5A3,0xB2F0,0xC4B4, +0xC4E9,0xC0AD,0xDED4,0x9281,0xB0E8,0xC5C4,0xC1E0,0x9282, +0xB9D5,0x9283,0xBEDC,0xCDD8,0xB0CE,0x9284,0xCDCF,0xDED6, +0xBED0,0xD7BE,0xDED5,0xD5D0,0xB0DD,0x9285,0x9286,0xC4E2, +0x9287,0x9288,0xC2A3,0xBCF0,0x9289,0xD3B5,0xC0B9,0xC5A1, +0xB2A6,0xD4F1,0x928A,0x928B,0xC0A8,0xCAC3,0xDED7,0xD5FC, +0x928C,0xB9B0,0x928D,0xC8AD,0xCBA9,0x928E,0xDED9,0xBFBD, +0x928F,0x9290,0x9291,0x9292,0xC6B4,0xD7A7,0xCAB0,0xC4C3, +0x9293,0xB3D6,0xB9D2,0x9294,0x9295,0x9296,0x9297,0xD6B8, +0xEAFC,0xB0B4,0x9298,0x9299,0x929A,0x929B,0xBFE6,0x929C, +0x929D,0xCCF4,0x929E,0x929F,0x92A0,0x92A1,0xCDDA,0x92A2, +0x92A3,0x92A4,0xD6BF,0xC2CE,0x92A5,0xCECE,0xCCA2,0xD0AE, +0xC4D3,0xB5B2,0xDED8,0xD5F5,0xBCB7,0xBBD3,0x92A6,0x92A7, +0xB0A4,0x92A8,0xC5B2,0xB4EC,0x92A9,0x92AA,0x92AB,0xD5F1, +0x92AC,0x92AD,0xEAFD,0x92AE,0x92AF,0x92B0,0x92B1,0x92B2, +0x92B3,0xDEDA,0xCDA6,0x92B4,0x92B5,0xCDEC,0x92B6,0x92B7, +0x92B8,0x92B9,0xCEE6,0xDEDC,0x92BA,0xCDB1,0xC0A6,0x92BB, +0x92BC,0xD7BD,0x92BD,0xDEDB,0xB0C6,0xBAB4,0xC9D3,0xC4F3, +0xBEE8,0x92BE,0x92BF,0x92C0,0x92C1,0xB2B6,0x92C2,0x92C3, +0x92C4,0x92C5,0x92C6,0x92C7,0x92C8,0x92C9,0xC0CC,0xCBF0, +0x92CA,0xBCF1,0xBBBB,0xB5B7,0x92CB,0x92CC,0x92CD,0xC5F5, +0x92CE,0xDEE6,0x92CF,0x92D0,0x92D1,0xDEE3,0xBEDD,0x92D2, +0x92D3,0xDEDF,0x92D4,0x92D5,0x92D6,0x92D7,0xB4B7,0xBDDD, +0x92D8,0x92D9,0xDEE0,0xC4ED,0x92DA,0x92DB,0x92DC,0x92DD, +0xCFC6,0x92DE,0xB5E0,0x92DF,0x92E0,0x92E1,0x92E2,0xB6DE, +0xCADA,0xB5F4,0xDEE5,0x92E3,0xD5C6,0x92E4,0xDEE1,0xCCCD, +0xC6FE,0x92E5,0xC5C5,0x92E6,0x92E7,0x92E8,0xD2B4,0x92E9, +0xBEF2,0x92EA,0x92EB,0x92EC,0x92ED,0x92EE,0x92EF,0x92F0, +0xC2D3,0x92F1,0xCCBD,0xB3B8,0x92F2,0xBDD3,0x92F3,0xBFD8, +0xCDC6,0xD1DA,0xB4EB,0x92F4,0xDEE4,0xDEDD,0xDEE7,0x92F5, +0xEAFE,0x92F6,0x92F7,0xC2B0,0xDEE2,0x92F8,0x92F9,0xD6C0, +0xB5A7,0x92FA,0xB2F4,0x92FB,0xDEE8,0x92FC,0xDEF2,0x92FD, +0x92FE,0x9340,0x9341,0x9342,0xDEED,0x9343,0xDEF1,0x9344, +0x9345,0xC8E0,0x9346,0x9347,0x9348,0xD7E1,0xDEEF,0xC3E8, +0xCCE1,0x9349,0xB2E5,0x934A,0x934B,0x934C,0xD2BE,0x934D, +0x934E,0x934F,0x9350,0x9351,0x9352,0x9353,0xDEEE,0x9354, +0xDEEB,0xCED5,0x9355,0xB4A7,0x9356,0x9357,0x9358,0x9359, +0x935A,0xBFAB,0xBEBE,0x935B,0x935C,0xBDD2,0x935D,0x935E, +0x935F,0x9360,0xDEE9,0x9361,0xD4AE,0x9362,0xDEDE,0x9363, +0xDEEA,0x9364,0x9365,0x9366,0x9367,0xC0BF,0x9368,0xDEEC, +0xB2F3,0xB8E9,0xC2A7,0x9369,0x936A,0xBDC1,0x936B,0x936C, +0x936D,0x936E,0x936F,0xDEF5,0xDEF8,0x9370,0x9371,0xB2AB, +0xB4A4,0x9372,0x9373,0xB4EA,0xC9A6,0x9374,0x9375,0x9376, +0x9377,0x9378,0x9379,0xDEF6,0xCBD1,0x937A,0xB8E3,0x937B, +0xDEF7,0xDEFA,0x937C,0x937D,0x937E,0x9380,0xDEF9,0x9381, +0x9382,0x9383,0xCCC2,0x9384,0xB0E1,0xB4EE,0x9385,0x9386, +0x9387,0x9388,0x9389,0x938A,0xE5BA,0x938B,0x938C,0x938D, +0x938E,0x938F,0xD0AF,0x9390,0x9391,0xB2EB,0x9392,0xEBA1, +0x9393,0xDEF4,0x9394,0x9395,0xC9E3,0xDEF3,0xB0DA,0xD2A1, +0xB1F7,0x9396,0xCCAF,0x9397,0x9398,0x9399,0x939A,0x939B, +0x939C,0x939D,0xDEF0,0x939E,0xCBA4,0x939F,0x93A0,0x93A1, +0xD5AA,0x93A2,0x93A3,0x93A4,0x93A5,0x93A6,0xDEFB,0x93A7, +0x93A8,0x93A9,0x93AA,0x93AB,0x93AC,0x93AD,0x93AE,0xB4DD, +0x93AF,0xC4A6,0x93B0,0x93B1,0x93B2,0xDEFD,0x93B3,0x93B4, +0x93B5,0x93B6,0x93B7,0x93B8,0x93B9,0x93BA,0x93BB,0x93BC, +0xC3FE,0xC4A1,0xDFA1,0x93BD,0x93BE,0x93BF,0x93C0,0x93C1, +0x93C2,0x93C3,0xC1CC,0x93C4,0xDEFC,0xBEEF,0x93C5,0xC6B2, +0x93C6,0x93C7,0x93C8,0x93C9,0x93CA,0x93CB,0x93CC,0x93CD, +0x93CE,0xB3C5,0xC8F6,0x93CF,0x93D0,0xCBBA,0xDEFE,0x93D1, +0x93D2,0xDFA4,0x93D3,0x93D4,0x93D5,0x93D6,0xD7B2,0x93D7, +0x93D8,0x93D9,0x93DA,0x93DB,0xB3B7,0x93DC,0x93DD,0x93DE, +0x93DF,0xC1C3,0x93E0,0x93E1,0xC7CB,0xB2A5,0xB4E9,0x93E2, +0xD7AB,0x93E3,0x93E4,0x93E5,0x93E6,0xC4EC,0x93E7,0xDFA2, +0xDFA3,0x93E8,0xDFA5,0x93E9,0xBAB3,0x93EA,0x93EB,0x93EC, +0xDFA6,0x93ED,0xC0DE,0x93EE,0x93EF,0xC9C3,0x93F0,0x93F1, +0x93F2,0x93F3,0x93F4,0x93F5,0x93F6,0xB2D9,0xC7E6,0x93F7, +0xDFA7,0x93F8,0xC7DC,0x93F9,0x93FA,0x93FB,0x93FC,0xDFA8, +0xEBA2,0x93FD,0x93FE,0x9440,0x9441,0x9442,0xCBD3,0x9443, +0x9444,0x9445,0xDFAA,0x9446,0xDFA9,0x9447,0xB2C1,0x9448, +0x9449,0x944A,0x944B,0x944C,0x944D,0x944E,0x944F,0x9450, +0x9451,0x9452,0x9453,0x9454,0x9455,0x9456,0x9457,0x9458, +0x9459,0x945A,0x945B,0x945C,0x945D,0x945E,0x945F,0x9460, +0xC5CA,0x9461,0x9462,0x9463,0x9464,0x9465,0x9466,0x9467, +0x9468,0xDFAB,0x9469,0x946A,0x946B,0x946C,0x946D,0x946E, +0x946F,0x9470,0xD4DC,0x9471,0x9472,0x9473,0x9474,0x9475, +0xC8C1,0x9476,0x9477,0x9478,0x9479,0x947A,0x947B,0x947C, +0x947D,0x947E,0x9480,0x9481,0x9482,0xDFAC,0x9483,0x9484, +0x9485,0x9486,0x9487,0xBEF0,0x9488,0x9489,0xDFAD,0xD6A7, +0x948A,0x948B,0x948C,0x948D,0xEAB7,0xEBB6,0xCAD5,0x948E, +0xD8FC,0xB8C4,0x948F,0xB9A5,0x9490,0x9491,0xB7C5,0xD5FE, +0x9492,0x9493,0x9494,0x9495,0x9496,0xB9CA,0x9497,0x9498, +0xD0A7,0xF4CD,0x9499,0x949A,0xB5D0,0x949B,0x949C,0xC3F4, +0x949D,0xBEC8,0x949E,0x949F,0x94A0,0xEBB7,0xB0BD,0x94A1, +0x94A2,0xBDCC,0x94A3,0xC1B2,0x94A4,0xB1D6,0xB3A8,0x94A5, +0x94A6,0x94A7,0xB8D2,0xC9A2,0x94A8,0x94A9,0xB6D8,0x94AA, +0x94AB,0x94AC,0x94AD,0xEBB8,0xBEB4,0x94AE,0x94AF,0x94B0, +0xCAFD,0x94B1,0xC7C3,0x94B2,0xD5FB,0x94B3,0x94B4,0xB7F3, +0x94B5,0x94B6,0x94B7,0x94B8,0x94B9,0x94BA,0x94BB,0x94BC, +0x94BD,0x94BE,0x94BF,0x94C0,0x94C1,0x94C2,0x94C3,0xCEC4, +0x94C4,0x94C5,0x94C6,0xD5AB,0xB1F3,0x94C7,0x94C8,0x94C9, +0xECB3,0xB0DF,0x94CA,0xECB5,0x94CB,0x94CC,0x94CD,0xB6B7, +0x94CE,0xC1CF,0x94CF,0xF5FA,0xD0B1,0x94D0,0x94D1,0xD5E5, +0x94D2,0xCED3,0x94D3,0x94D4,0xBDEF,0xB3E2,0x94D5,0xB8AB, +0x94D6,0xD5B6,0x94D7,0xEDBD,0x94D8,0xB6CF,0x94D9,0xCBB9, +0xD0C2,0x94DA,0x94DB,0x94DC,0x94DD,0x94DE,0x94DF,0x94E0, +0x94E1,0xB7BD,0x94E2,0x94E3,0xECB6,0xCAA9,0x94E4,0x94E5, +0x94E6,0xC5D4,0x94E7,0xECB9,0xECB8,0xC2C3,0xECB7,0x94E8, +0x94E9,0x94EA,0x94EB,0xD0FD,0xECBA,0x94EC,0xECBB,0xD7E5, +0x94ED,0x94EE,0xECBC,0x94EF,0x94F0,0x94F1,0xECBD,0xC6EC, +0x94F2,0x94F3,0x94F4,0x94F5,0x94F6,0x94F7,0x94F8,0x94F9, +0xCEDE,0x94FA,0xBCC8,0x94FB,0x94FC,0xC8D5,0xB5A9,0xBEC9, +0xD6BC,0xD4E7,0x94FD,0x94FE,0xD1AE,0xD0F1,0xEAB8,0xEAB9, +0xEABA,0xBAB5,0x9540,0x9541,0x9542,0x9543,0xCAB1,0xBFF5, +0x9544,0x9545,0xCDFA,0x9546,0x9547,0x9548,0x9549,0x954A, +0xEAC0,0x954B,0xB0BA,0xEABE,0x954C,0x954D,0xC0A5,0x954E, +0x954F,0x9550,0xEABB,0x9551,0xB2FD,0x9552,0xC3F7,0xBBE8, +0x9553,0x9554,0x9555,0xD2D7,0xCEF4,0xEABF,0x9556,0x9557, +0x9558,0xEABC,0x9559,0x955A,0x955B,0xEAC3,0x955C,0xD0C7, +0xD3B3,0x955D,0x955E,0x955F,0x9560,0xB4BA,0x9561,0xC3C1, +0xD7F2,0x9562,0x9563,0x9564,0x9565,0xD5D1,0x9566,0xCAC7, +0x9567,0xEAC5,0x9568,0x9569,0xEAC4,0xEAC7,0xEAC6,0x956A, +0x956B,0x956C,0x956D,0x956E,0xD6E7,0x956F,0xCFD4,0x9570, +0x9571,0xEACB,0x9572,0xBBCE,0x9573,0x9574,0x9575,0x9576, +0x9577,0x9578,0x9579,0xBDFA,0xC9CE,0x957A,0x957B,0xEACC, +0x957C,0x957D,0xC9B9,0xCFFE,0xEACA,0xD4CE,0xEACD,0xEACF, +0x957E,0x9580,0xCDED,0x9581,0x9582,0x9583,0x9584,0xEAC9, +0x9585,0xEACE,0x9586,0x9587,0xCEEE,0x9588,0xBBDE,0x9589, +0xB3BF,0x958A,0x958B,0x958C,0x958D,0x958E,0xC6D5,0xBEB0, +0xCEFA,0x958F,0x9590,0x9591,0xC7E7,0x9592,0xBEA7,0xEAD0, +0x9593,0x9594,0xD6C7,0x9595,0x9596,0x9597,0xC1C0,0x9598, +0x9599,0x959A,0xD4DD,0x959B,0xEAD1,0x959C,0x959D,0xCFBE, +0x959E,0x959F,0x95A0,0x95A1,0xEAD2,0x95A2,0x95A3,0x95A4, +0x95A5,0xCAEE,0x95A6,0x95A7,0x95A8,0x95A9,0xC5AF,0xB0B5, +0x95AA,0x95AB,0x95AC,0x95AD,0x95AE,0xEAD4,0x95AF,0x95B0, +0x95B1,0x95B2,0x95B3,0x95B4,0x95B5,0x95B6,0x95B7,0xEAD3, +0xF4DF,0x95B8,0x95B9,0x95BA,0x95BB,0x95BC,0xC4BA,0x95BD, +0x95BE,0x95BF,0x95C0,0x95C1,0xB1A9,0x95C2,0x95C3,0x95C4, +0x95C5,0xE5DF,0x95C6,0x95C7,0x95C8,0x95C9,0xEAD5,0x95CA, +0x95CB,0x95CC,0x95CD,0x95CE,0x95CF,0x95D0,0x95D1,0x95D2, +0x95D3,0x95D4,0x95D5,0x95D6,0x95D7,0x95D8,0x95D9,0x95DA, +0x95DB,0x95DC,0x95DD,0x95DE,0x95DF,0x95E0,0x95E1,0x95E2, +0x95E3,0xCAEF,0x95E4,0xEAD6,0xEAD7,0xC6D8,0x95E5,0x95E6, +0x95E7,0x95E8,0x95E9,0x95EA,0x95EB,0x95EC,0xEAD8,0x95ED, +0x95EE,0xEAD9,0x95EF,0x95F0,0x95F1,0x95F2,0x95F3,0x95F4, +0xD4BB,0x95F5,0xC7FA,0xD2B7,0xB8FC,0x95F6,0x95F7,0xEAC2, +0x95F8,0xB2DC,0x95F9,0x95FA,0xC2FC,0x95FB,0xD4F8,0xCCE6, +0xD7EE,0x95FC,0x95FD,0x95FE,0x9640,0x9641,0x9642,0x9643, +0xD4C2,0xD3D0,0xEBC3,0xC5F3,0x9644,0xB7FE,0x9645,0x9646, +0xEBD4,0x9647,0x9648,0x9649,0xCBB7,0xEBDE,0x964A,0xC0CA, +0x964B,0x964C,0x964D,0xCDFB,0x964E,0xB3AF,0x964F,0xC6DA, +0x9650,0x9651,0x9652,0x9653,0x9654,0x9655,0xEBFC,0x9656, +0xC4BE,0x9657,0xCEB4,0xC4A9,0xB1BE,0xD4FD,0x9658,0xCAF5, +0x9659,0xD6EC,0x965A,0x965B,0xC6D3,0xB6E4,0x965C,0x965D, +0x965E,0x965F,0xBBFA,0x9660,0x9661,0xD0E0,0x9662,0x9663, +0xC9B1,0x9664,0xD4D3,0xC8A8,0x9665,0x9666,0xB8CB,0x9667, +0xE8BE,0xC9BC,0x9668,0x9669,0xE8BB,0x966A,0xC0EE,0xD0D3, +0xB2C4,0xB4E5,0x966B,0xE8BC,0x966C,0x966D,0xD5C8,0x966E, +0x966F,0x9670,0x9671,0x9672,0xB6C5,0x9673,0xE8BD,0xCAF8, +0xB8DC,0xCCF5,0x9674,0x9675,0x9676,0xC0B4,0x9677,0x9678, +0xD1EE,0xE8BF,0xE8C2,0x9679,0x967A,0xBABC,0x967B,0xB1AD, +0xBDDC,0x967C,0xEABD,0xE8C3,0x967D,0xE8C6,0x967E,0xE8CB, +0x9680,0x9681,0x9682,0x9683,0xE8CC,0x9684,0xCBC9,0xB0E5, +0x9685,0xBCAB,0x9686,0x9687,0xB9B9,0x9688,0x9689,0xE8C1, +0x968A,0xCDF7,0x968B,0xE8CA,0x968C,0x968D,0x968E,0x968F, +0xCEF6,0x9690,0x9691,0x9692,0x9693,0xD5ED,0x9694,0xC1D6, +0xE8C4,0x9695,0xC3B6,0x9696,0xB9FB,0xD6A6,0xE8C8,0x9697, +0x9698,0x9699,0xCAE0,0xD4E6,0x969A,0xE8C0,0x969B,0xE8C5, +0xE8C7,0x969C,0xC7B9,0xB7E3,0x969D,0xE8C9,0x969E,0xBFDD, +0xE8D2,0x969F,0x96A0,0xE8D7,0x96A1,0xE8D5,0xBCDC,0xBCCF, +0xE8DB,0x96A2,0x96A3,0x96A4,0x96A5,0x96A6,0x96A7,0x96A8, +0x96A9,0xE8DE,0x96AA,0xE8DA,0xB1FA,0x96AB,0x96AC,0x96AD, +0x96AE,0x96AF,0x96B0,0x96B1,0x96B2,0x96B3,0x96B4,0xB0D8, +0xC4B3,0xB8CC,0xC6E2,0xC8BE,0xC8E1,0x96B5,0x96B6,0x96B7, +0xE8CF,0xE8D4,0xE8D6,0x96B8,0xB9F1,0xE8D8,0xD7F5,0x96B9, +0xC4FB,0x96BA,0xE8DC,0x96BB,0x96BC,0xB2E9,0x96BD,0x96BE, +0x96BF,0xE8D1,0x96C0,0x96C1,0xBCED,0x96C2,0x96C3,0xBFC2, +0xE8CD,0xD6F9,0x96C4,0xC1F8,0xB2F1,0x96C5,0x96C6,0x96C7, +0x96C8,0x96C9,0x96CA,0x96CB,0x96CC,0xE8DF,0x96CD,0xCAC1, +0xE8D9,0x96CE,0x96CF,0x96D0,0x96D1,0xD5A4,0x96D2,0xB1EA, +0xD5BB,0xE8CE,0xE8D0,0xB6B0,0xE8D3,0x96D3,0xE8DD,0xC0B8, +0x96D4,0xCAF7,0x96D5,0xCBA8,0x96D6,0x96D7,0xC6DC,0xC0F5, +0x96D8,0x96D9,0x96DA,0x96DB,0x96DC,0xE8E9,0x96DD,0x96DE, +0x96DF,0xD0A3,0x96E0,0x96E1,0x96E2,0x96E3,0x96E4,0x96E5, +0x96E6,0xE8F2,0xD6EA,0x96E7,0x96E8,0x96E9,0x96EA,0x96EB, +0x96EC,0x96ED,0xE8E0,0xE8E1,0x96EE,0x96EF,0x96F0,0xD1F9, +0xBACB,0xB8F9,0x96F1,0x96F2,0xB8F1,0xD4D4,0xE8EF,0x96F3, +0xE8EE,0xE8EC,0xB9F0,0xCCD2,0xE8E6,0xCEA6,0xBFF2,0x96F4, +0xB0B8,0xE8F1,0xE8F0,0x96F5,0xD7C0,0x96F6,0xE8E4,0x96F7, +0xCDA9,0xC9A3,0x96F8,0xBBB8,0xBDDB,0xE8EA,0x96F9,0x96FA, +0x96FB,0x96FC,0x96FD,0x96FE,0x9740,0x9741,0x9742,0x9743, +0xE8E2,0xE8E3,0xE8E5,0xB5B5,0xE8E7,0xC7C5,0xE8EB,0xE8ED, +0xBDB0,0xD7AE,0x9744,0xE8F8,0x9745,0x9746,0x9747,0x9748, +0x9749,0x974A,0x974B,0x974C,0xE8F5,0x974D,0xCDB0,0xE8F6, +0x974E,0x974F,0x9750,0x9751,0x9752,0x9753,0x9754,0x9755, +0x9756,0xC1BA,0x9757,0xE8E8,0x9758,0xC3B7,0xB0F0,0x9759, +0x975A,0x975B,0x975C,0x975D,0x975E,0x975F,0x9760,0xE8F4, +0x9761,0x9762,0x9763,0xE8F7,0x9764,0x9765,0x9766,0xB9A3, +0x9767,0x9768,0x9769,0x976A,0x976B,0x976C,0x976D,0x976E, +0x976F,0x9770,0xC9D2,0x9771,0x9772,0x9773,0xC3CE,0xCEE0, +0xC0E6,0x9774,0x9775,0x9776,0x9777,0xCBF3,0x9778,0xCCDD, +0xD0B5,0x9779,0x977A,0xCAE1,0x977B,0xE8F3,0x977C,0x977D, +0x977E,0x9780,0x9781,0x9782,0x9783,0x9784,0x9785,0x9786, +0xBCEC,0x9787,0xE8F9,0x9788,0x9789,0x978A,0x978B,0x978C, +0x978D,0xC3DE,0x978E,0xC6E5,0x978F,0xB9F7,0x9790,0x9791, +0x9792,0x9793,0xB0F4,0x9794,0x9795,0xD7D8,0x9796,0x9797, +0xBCAC,0x9798,0xC5EF,0x9799,0x979A,0x979B,0x979C,0x979D, +0xCCC4,0x979E,0x979F,0xE9A6,0x97A0,0x97A1,0x97A2,0x97A3, +0x97A4,0x97A5,0x97A6,0x97A7,0x97A8,0x97A9,0xC9AD,0x97AA, +0xE9A2,0xC0E2,0x97AB,0x97AC,0x97AD,0xBFC3,0x97AE,0x97AF, +0x97B0,0xE8FE,0xB9D7,0x97B1,0xE8FB,0x97B2,0x97B3,0x97B4, +0x97B5,0xE9A4,0x97B6,0x97B7,0x97B8,0xD2CE,0x97B9,0x97BA, +0x97BB,0x97BC,0x97BD,0xE9A3,0x97BE,0xD6B2,0xD7B5,0x97BF, +0xE9A7,0x97C0,0xBDB7,0x97C1,0x97C2,0x97C3,0x97C4,0x97C5, +0x97C6,0x97C7,0x97C8,0x97C9,0x97CA,0x97CB,0x97CC,0xE8FC, +0xE8FD,0x97CD,0x97CE,0x97CF,0xE9A1,0x97D0,0x97D1,0x97D2, +0x97D3,0x97D4,0x97D5,0x97D6,0x97D7,0xCDD6,0x97D8,0x97D9, +0xD2AC,0x97DA,0x97DB,0x97DC,0xE9B2,0x97DD,0x97DE,0x97DF, +0x97E0,0xE9A9,0x97E1,0x97E2,0x97E3,0xB4AA,0x97E4,0xB4BB, +0x97E5,0x97E6,0xE9AB,0x97E7,0x97E8,0x97E9,0x97EA,0x97EB, +0x97EC,0x97ED,0x97EE,0x97EF,0x97F0,0x97F1,0x97F2,0x97F3, +0x97F4,0x97F5,0x97F6,0x97F7,0xD0A8,0x97F8,0x97F9,0xE9A5, +0x97FA,0x97FB,0xB3FE,0x97FC,0x97FD,0xE9AC,0xC0E3,0x97FE, +0xE9AA,0x9840,0x9841,0xE9B9,0x9842,0x9843,0xE9B8,0x9844, +0x9845,0x9846,0x9847,0xE9AE,0x9848,0x9849,0xE8FA,0x984A, +0x984B,0xE9A8,0x984C,0x984D,0x984E,0x984F,0x9850,0xBFAC, +0xE9B1,0xE9BA,0x9851,0x9852,0xC2A5,0x9853,0x9854,0x9855, +0xE9AF,0x9856,0xB8C5,0x9857,0xE9AD,0x9858,0xD3DC,0xE9B4, +0xE9B5,0xE9B7,0x9859,0x985A,0x985B,0xE9C7,0x985C,0x985D, +0x985E,0x985F,0x9860,0x9861,0xC0C6,0xE9C5,0x9862,0x9863, +0xE9B0,0x9864,0x9865,0xE9BB,0xB0F1,0x9866,0x9867,0x9868, +0x9869,0x986A,0x986B,0x986C,0x986D,0x986E,0x986F,0xE9BC, +0xD5A5,0x9870,0x9871,0xE9BE,0x9872,0xE9BF,0x9873,0x9874, +0x9875,0xE9C1,0x9876,0x9877,0xC1F1,0x9878,0x9879,0xC8B6, +0x987A,0x987B,0x987C,0xE9BD,0x987D,0x987E,0x9880,0x9881, +0x9882,0xE9C2,0x9883,0x9884,0x9885,0x9886,0x9887,0x9888, +0x9889,0x988A,0xE9C3,0x988B,0xE9B3,0x988C,0xE9B6,0x988D, +0xBBB1,0x988E,0x988F,0x9890,0xE9C0,0x9891,0x9892,0x9893, +0x9894,0x9895,0x9896,0xBCF7,0x9897,0x9898,0x9899,0xE9C4, +0xE9C6,0x989A,0x989B,0x989C,0x989D,0x989E,0x989F,0x98A0, +0x98A1,0x98A2,0x98A3,0x98A4,0x98A5,0xE9CA,0x98A6,0x98A7, +0x98A8,0x98A9,0xE9CE,0x98AA,0x98AB,0x98AC,0x98AD,0x98AE, +0x98AF,0x98B0,0x98B1,0x98B2,0x98B3,0xB2DB,0x98B4,0xE9C8, +0x98B5,0x98B6,0x98B7,0x98B8,0x98B9,0x98BA,0x98BB,0x98BC, +0x98BD,0x98BE,0xB7AE,0x98BF,0x98C0,0x98C1,0x98C2,0x98C3, +0x98C4,0x98C5,0x98C6,0x98C7,0x98C8,0x98C9,0x98CA,0xE9CB, +0xE9CC,0x98CB,0x98CC,0x98CD,0x98CE,0x98CF,0x98D0,0xD5C1, +0x98D1,0xC4A3,0x98D2,0x98D3,0x98D4,0x98D5,0x98D6,0x98D7, +0xE9D8,0x98D8,0xBAE1,0x98D9,0x98DA,0x98DB,0x98DC,0xE9C9, +0x98DD,0xD3A3,0x98DE,0x98DF,0x98E0,0xE9D4,0x98E1,0x98E2, +0x98E3,0x98E4,0x98E5,0x98E6,0x98E7,0xE9D7,0xE9D0,0x98E8, +0x98E9,0x98EA,0x98EB,0x98EC,0xE9CF,0x98ED,0x98EE,0xC7C1, +0x98EF,0x98F0,0x98F1,0x98F2,0x98F3,0x98F4,0x98F5,0x98F6, +0xE9D2,0x98F7,0x98F8,0x98F9,0x98FA,0x98FB,0x98FC,0x98FD, +0xE9D9,0xB3C8,0x98FE,0xE9D3,0x9940,0x9941,0x9942,0x9943, +0x9944,0xCFF0,0x9945,0x9946,0x9947,0xE9CD,0x9948,0x9949, +0x994A,0x994B,0x994C,0x994D,0x994E,0x994F,0x9950,0x9951, +0x9952,0xB3F7,0x9953,0x9954,0x9955,0x9956,0x9957,0x9958, +0x9959,0xE9D6,0x995A,0x995B,0xE9DA,0x995C,0x995D,0x995E, +0xCCB4,0x995F,0x9960,0x9961,0xCFAD,0x9962,0x9963,0x9964, +0x9965,0x9966,0x9967,0x9968,0x9969,0x996A,0xE9D5,0x996B, +0xE9DC,0xE9DB,0x996C,0x996D,0x996E,0x996F,0x9970,0xE9DE, +0x9971,0x9972,0x9973,0x9974,0x9975,0x9976,0x9977,0x9978, +0xE9D1,0x9979,0x997A,0x997B,0x997C,0x997D,0x997E,0x9980, +0x9981,0xE9DD,0x9982,0xE9DF,0xC3CA,0x9983,0x9984,0x9985, +0x9986,0x9987,0x9988,0x9989,0x998A,0x998B,0x998C,0x998D, +0x998E,0x998F,0x9990,0x9991,0x9992,0x9993,0x9994,0x9995, +0x9996,0x9997,0x9998,0x9999,0x999A,0x999B,0x999C,0x999D, +0x999E,0x999F,0x99A0,0x99A1,0x99A2,0x99A3,0x99A4,0x99A5, +0x99A6,0x99A7,0x99A8,0x99A9,0x99AA,0x99AB,0x99AC,0x99AD, +0x99AE,0x99AF,0x99B0,0x99B1,0x99B2,0x99B3,0x99B4,0x99B5, +0x99B6,0x99B7,0x99B8,0x99B9,0x99BA,0x99BB,0x99BC,0x99BD, +0x99BE,0x99BF,0x99C0,0x99C1,0x99C2,0x99C3,0x99C4,0x99C5, +0x99C6,0x99C7,0x99C8,0x99C9,0x99CA,0x99CB,0x99CC,0x99CD, +0x99CE,0x99CF,0x99D0,0x99D1,0x99D2,0x99D3,0x99D4,0x99D5, +0x99D6,0x99D7,0x99D8,0x99D9,0x99DA,0x99DB,0x99DC,0x99DD, +0x99DE,0x99DF,0x99E0,0x99E1,0x99E2,0x99E3,0x99E4,0x99E5, +0x99E6,0x99E7,0x99E8,0x99E9,0x99EA,0x99EB,0x99EC,0x99ED, +0x99EE,0x99EF,0x99F0,0x99F1,0x99F2,0x99F3,0x99F4,0x99F5, +0xC7B7,0xB4CE,0xBBB6,0xD0C0,0xECA3,0x99F6,0x99F7,0xC5B7, +0x99F8,0x99F9,0x99FA,0x99FB,0x99FC,0x99FD,0x99FE,0x9A40, +0x9A41,0x9A42,0xD3FB,0x9A43,0x9A44,0x9A45,0x9A46,0xECA4, +0x9A47,0xECA5,0xC6DB,0x9A48,0x9A49,0x9A4A,0xBFEE,0x9A4B, +0x9A4C,0x9A4D,0x9A4E,0xECA6,0x9A4F,0x9A50,0xECA7,0xD0AA, +0x9A51,0xC7B8,0x9A52,0x9A53,0xB8E8,0x9A54,0x9A55,0x9A56, +0x9A57,0x9A58,0x9A59,0x9A5A,0x9A5B,0x9A5C,0x9A5D,0x9A5E, +0x9A5F,0xECA8,0x9A60,0x9A61,0x9A62,0x9A63,0x9A64,0x9A65, +0x9A66,0x9A67,0xD6B9,0xD5FD,0xB4CB,0xB2BD,0xCEE4,0xC6E7, +0x9A68,0x9A69,0xCDE1,0x9A6A,0x9A6B,0x9A6C,0x9A6D,0x9A6E, +0x9A6F,0x9A70,0x9A71,0x9A72,0x9A73,0x9A74,0x9A75,0x9A76, +0x9A77,0xB4F5,0x9A78,0xCBC0,0xBCDF,0x9A79,0x9A7A,0x9A7B, +0x9A7C,0xE9E2,0xE9E3,0xD1EA,0xE9E5,0x9A7D,0xB4F9,0xE9E4, +0x9A7E,0xD1B3,0xCAE2,0xB2D0,0x9A80,0xE9E8,0x9A81,0x9A82, +0x9A83,0x9A84,0xE9E6,0xE9E7,0x9A85,0x9A86,0xD6B3,0x9A87, +0x9A88,0x9A89,0xE9E9,0xE9EA,0x9A8A,0x9A8B,0x9A8C,0x9A8D, +0x9A8E,0xE9EB,0x9A8F,0x9A90,0x9A91,0x9A92,0x9A93,0x9A94, +0x9A95,0x9A96,0xE9EC,0x9A97,0x9A98,0x9A99,0x9A9A,0x9A9B, +0x9A9C,0x9A9D,0x9A9E,0xECAF,0xC5B9,0xB6CE,0x9A9F,0xD2F3, +0x9AA0,0x9AA1,0x9AA2,0x9AA3,0x9AA4,0x9AA5,0x9AA6,0xB5EE, +0x9AA7,0xBBD9,0xECB1,0x9AA8,0x9AA9,0xD2E3,0x9AAA,0x9AAB, +0x9AAC,0x9AAD,0x9AAE,0xCEE3,0x9AAF,0xC4B8,0x9AB0,0xC3BF, +0x9AB1,0x9AB2,0xB6BE,0xD8B9,0xB1C8,0xB1CF,0xB1D1,0xC5FE, +0x9AB3,0xB1D0,0x9AB4,0xC3AB,0x9AB5,0x9AB6,0x9AB7,0x9AB8, +0x9AB9,0xD5B1,0x9ABA,0x9ABB,0x9ABC,0x9ABD,0x9ABE,0x9ABF, +0x9AC0,0x9AC1,0xEBA4,0xBAC1,0x9AC2,0x9AC3,0x9AC4,0xCCBA, +0x9AC5,0x9AC6,0x9AC7,0xEBA5,0x9AC8,0xEBA7,0x9AC9,0x9ACA, +0x9ACB,0xEBA8,0x9ACC,0x9ACD,0x9ACE,0xEBA6,0x9ACF,0x9AD0, +0x9AD1,0x9AD2,0x9AD3,0x9AD4,0x9AD5,0xEBA9,0xEBAB,0xEBAA, +0x9AD6,0x9AD7,0x9AD8,0x9AD9,0x9ADA,0xEBAC,0x9ADB,0xCACF, +0xD8B5,0xC3F1,0x9ADC,0xC3A5,0xC6F8,0xEBAD,0xC4CA,0x9ADD, +0xEBAE,0xEBAF,0xEBB0,0xB7D5,0x9ADE,0x9ADF,0x9AE0,0xB7FA, +0x9AE1,0xEBB1,0xC7E2,0x9AE2,0xEBB3,0x9AE3,0xBAA4,0xD1F5, +0xB0B1,0xEBB2,0xEBB4,0x9AE4,0x9AE5,0x9AE6,0xB5AA,0xC2C8, +0xC7E8,0x9AE7,0xEBB5,0x9AE8,0xCBAE,0xE3DF,0x9AE9,0x9AEA, +0xD3C0,0x9AEB,0x9AEC,0x9AED,0x9AEE,0xD9DB,0x9AEF,0x9AF0, +0xCDA1,0xD6AD,0xC7F3,0x9AF1,0x9AF2,0x9AF3,0xD9E0,0xBBE3, +0x9AF4,0xBABA,0xE3E2,0x9AF5,0x9AF6,0x9AF7,0x9AF8,0x9AF9, +0xCFAB,0x9AFA,0x9AFB,0x9AFC,0xE3E0,0xC9C7,0x9AFD,0xBAB9, +0x9AFE,0x9B40,0x9B41,0xD1B4,0xE3E1,0xC8EA,0xB9AF,0xBDAD, +0xB3D8,0xCEDB,0x9B42,0x9B43,0xCCC0,0x9B44,0x9B45,0x9B46, +0xE3E8,0xE3E9,0xCDF4,0x9B47,0x9B48,0x9B49,0x9B4A,0x9B4B, +0xCCAD,0x9B4C,0xBCB3,0x9B4D,0xE3EA,0x9B4E,0xE3EB,0x9B4F, +0x9B50,0xD0DA,0x9B51,0x9B52,0x9B53,0xC6FB,0xB7DA,0x9B54, +0x9B55,0xC7DF,0xD2CA,0xCED6,0x9B56,0xE3E4,0xE3EC,0x9B57, +0xC9F2,0xB3C1,0x9B58,0x9B59,0xE3E7,0x9B5A,0x9B5B,0xC6E3, +0xE3E5,0x9B5C,0x9B5D,0xEDB3,0xE3E6,0x9B5E,0x9B5F,0x9B60, +0x9B61,0xC9B3,0x9B62,0xC5E6,0x9B63,0x9B64,0x9B65,0xB9B5, +0x9B66,0xC3BB,0x9B67,0xE3E3,0xC5BD,0xC1A4,0xC2D9,0xB2D7, +0x9B68,0xE3ED,0xBBA6,0xC4AD,0x9B69,0xE3F0,0xBEDA,0x9B6A, +0x9B6B,0xE3FB,0xE3F5,0xBAD3,0x9B6C,0x9B6D,0x9B6E,0x9B6F, +0xB7D0,0xD3CD,0x9B70,0xD6CE,0xD5D3,0xB9C1,0xD5B4,0xD1D8, +0x9B71,0x9B72,0x9B73,0x9B74,0xD0B9,0xC7F6,0x9B75,0x9B76, +0x9B77,0xC8AA,0xB2B4,0x9B78,0xC3DA,0x9B79,0x9B7A,0x9B7B, +0xE3EE,0x9B7C,0x9B7D,0xE3FC,0xE3EF,0xB7A8,0xE3F7,0xE3F4, +0x9B7E,0x9B80,0x9B81,0xB7BA,0x9B82,0x9B83,0xC5A2,0x9B84, +0xE3F6,0xC5DD,0xB2A8,0xC6FC,0x9B85,0xC4E0,0x9B86,0x9B87, +0xD7A2,0x9B88,0xC0E1,0xE3F9,0x9B89,0x9B8A,0xE3FA,0xE3FD, +0xCCA9,0xE3F3,0x9B8B,0xD3BE,0x9B8C,0xB1C3,0xEDB4,0xE3F1, +0xE3F2,0x9B8D,0xE3F8,0xD0BA,0xC6C3,0xD4F3,0xE3FE,0x9B8E, +0x9B8F,0xBDE0,0x9B90,0x9B91,0xE4A7,0x9B92,0x9B93,0xE4A6, +0x9B94,0x9B95,0x9B96,0xD1F3,0xE4A3,0x9B97,0xE4A9,0x9B98, +0x9B99,0x9B9A,0xC8F7,0x9B9B,0x9B9C,0x9B9D,0x9B9E,0xCFB4, +0x9B9F,0xE4A8,0xE4AE,0xC2E5,0x9BA0,0x9BA1,0xB6B4,0x9BA2, +0x9BA3,0x9BA4,0x9BA5,0x9BA6,0x9BA7,0xBDF2,0x9BA8,0xE4A2, +0x9BA9,0x9BAA,0xBAE9,0xE4AA,0x9BAB,0x9BAC,0xE4AC,0x9BAD, +0x9BAE,0xB6FD,0xD6DE,0xE4B2,0x9BAF,0xE4AD,0x9BB0,0x9BB1, +0x9BB2,0xE4A1,0x9BB3,0xBBEE,0xCDDD,0xC7A2,0xC5C9,0x9BB4, +0x9BB5,0xC1F7,0x9BB6,0xE4A4,0x9BB7,0xC7B3,0xBDAC,0xBDBD, +0xE4A5,0x9BB8,0xD7C7,0xB2E2,0x9BB9,0xE4AB,0xBCC3,0xE4AF, +0x9BBA,0xBBEB,0xE4B0,0xC5A8,0xE4B1,0x9BBB,0x9BBC,0x9BBD, +0x9BBE,0xD5E3,0xBFA3,0x9BBF,0xE4BA,0x9BC0,0xE4B7,0x9BC1, +0xE4BB,0x9BC2,0x9BC3,0xE4BD,0x9BC4,0x9BC5,0xC6D6,0x9BC6, +0x9BC7,0xBAC6,0xC0CB,0x9BC8,0x9BC9,0x9BCA,0xB8A1,0xE4B4, +0x9BCB,0x9BCC,0x9BCD,0x9BCE,0xD4A1,0x9BCF,0x9BD0,0xBAA3, +0xBDFE,0x9BD1,0x9BD2,0x9BD3,0xE4BC,0x9BD4,0x9BD5,0x9BD6, +0x9BD7,0x9BD8,0xCDBF,0x9BD9,0x9BDA,0xC4F9,0x9BDB,0x9BDC, +0xCFFB,0xC9E6,0x9BDD,0x9BDE,0xD3BF,0x9BDF,0xCFD1,0x9BE0, +0x9BE1,0xE4B3,0x9BE2,0xE4B8,0xE4B9,0xCCE9,0x9BE3,0x9BE4, +0x9BE5,0x9BE6,0x9BE7,0xCCCE,0x9BE8,0xC0D4,0xE4B5,0xC1B0, +0xE4B6,0xCED0,0x9BE9,0xBBC1,0xB5D3,0x9BEA,0xC8F3,0xBDA7, +0xD5C7,0xC9AC,0xB8A2,0xE4CA,0x9BEB,0x9BEC,0xE4CC,0xD1C4, +0x9BED,0x9BEE,0xD2BA,0x9BEF,0x9BF0,0xBAAD,0x9BF1,0x9BF2, +0xBAD4,0x9BF3,0x9BF4,0x9BF5,0x9BF6,0x9BF7,0x9BF8,0xE4C3, +0xB5ED,0x9BF9,0x9BFA,0x9BFB,0xD7CD,0xE4C0,0xCFFD,0xE4BF, +0x9BFC,0x9BFD,0x9BFE,0xC1DC,0xCCCA,0x9C40,0x9C41,0x9C42, +0x9C43,0xCAE7,0x9C44,0x9C45,0x9C46,0x9C47,0xC4D7,0x9C48, +0xCCD4,0xE4C8,0x9C49,0x9C4A,0x9C4B,0xE4C7,0xE4C1,0x9C4C, +0xE4C4,0xB5AD,0x9C4D,0x9C4E,0xD3D9,0x9C4F,0xE4C6,0x9C50, +0x9C51,0x9C52,0x9C53,0xD2F9,0xB4E3,0x9C54,0xBBB4,0x9C55, +0x9C56,0xC9EE,0x9C57,0xB4BE,0x9C58,0x9C59,0x9C5A,0xBBEC, +0x9C5B,0xD1CD,0x9C5C,0xCCED,0xEDB5,0x9C5D,0x9C5E,0x9C5F, +0x9C60,0x9C61,0x9C62,0x9C63,0x9C64,0xC7E5,0x9C65,0x9C66, +0x9C67,0x9C68,0xD4A8,0x9C69,0xE4CB,0xD7D5,0xE4C2,0x9C6A, +0xBDA5,0xE4C5,0x9C6B,0x9C6C,0xD3E6,0x9C6D,0xE4C9,0xC9F8, +0x9C6E,0x9C6F,0xE4BE,0x9C70,0x9C71,0xD3E5,0x9C72,0x9C73, +0xC7FE,0xB6C9,0x9C74,0xD4FC,0xB2B3,0xE4D7,0x9C75,0x9C76, +0x9C77,0xCEC2,0x9C78,0xE4CD,0x9C79,0xCEBC,0x9C7A,0xB8DB, +0x9C7B,0x9C7C,0xE4D6,0x9C7D,0xBFCA,0x9C7E,0x9C80,0x9C81, +0xD3CE,0x9C82,0xC3EC,0x9C83,0x9C84,0x9C85,0x9C86,0x9C87, +0x9C88,0x9C89,0x9C8A,0xC5C8,0xE4D8,0x9C8B,0x9C8C,0x9C8D, +0x9C8E,0x9C8F,0x9C90,0x9C91,0x9C92,0xCDC4,0xE4CF,0x9C93, +0x9C94,0x9C95,0x9C96,0xE4D4,0xE4D5,0x9C97,0xBAFE,0x9C98, +0xCFE6,0x9C99,0x9C9A,0xD5BF,0x9C9B,0x9C9C,0x9C9D,0xE4D2, +0x9C9E,0x9C9F,0x9CA0,0x9CA1,0x9CA2,0x9CA3,0x9CA4,0x9CA5, +0x9CA6,0x9CA7,0x9CA8,0xE4D0,0x9CA9,0x9CAA,0xE4CE,0x9CAB, +0x9CAC,0x9CAD,0x9CAE,0x9CAF,0x9CB0,0x9CB1,0x9CB2,0x9CB3, +0x9CB4,0x9CB5,0x9CB6,0x9CB7,0x9CB8,0x9CB9,0xCDE5,0xCAAA, +0x9CBA,0x9CBB,0x9CBC,0xC0A3,0x9CBD,0xBDA6,0xE4D3,0x9CBE, +0x9CBF,0xB8C8,0x9CC0,0x9CC1,0x9CC2,0x9CC3,0x9CC4,0xE4E7, +0xD4B4,0x9CC5,0x9CC6,0x9CC7,0x9CC8,0x9CC9,0x9CCA,0x9CCB, +0xE4DB,0x9CCC,0x9CCD,0x9CCE,0xC1EF,0x9CCF,0x9CD0,0xE4E9, +0x9CD1,0x9CD2,0xD2E7,0x9CD3,0x9CD4,0xE4DF,0x9CD5,0xE4E0, +0x9CD6,0x9CD7,0xCFAA,0x9CD8,0x9CD9,0x9CDA,0x9CDB,0xCBDD, +0x9CDC,0xE4DA,0xE4D1,0x9CDD,0xE4E5,0x9CDE,0xC8DC,0xE4E3, +0x9CDF,0x9CE0,0xC4E7,0xE4E2,0x9CE1,0xE4E1,0x9CE2,0x9CE3, +0x9CE4,0xB3FC,0xE4E8,0x9CE5,0x9CE6,0x9CE7,0x9CE8,0xB5E1, +0x9CE9,0x9CEA,0x9CEB,0xD7CC,0x9CEC,0x9CED,0x9CEE,0xE4E6, +0x9CEF,0xBBAC,0x9CF0,0xD7D2,0xCCCF,0xEBF8,0x9CF1,0xE4E4, +0x9CF2,0x9CF3,0xB9F6,0x9CF4,0x9CF5,0x9CF6,0xD6CD,0xE4D9, +0xE4DC,0xC2FA,0xE4DE,0x9CF7,0xC2CB,0xC0C4,0xC2D0,0x9CF8, +0xB1F5,0xCCB2,0x9CF9,0x9CFA,0x9CFB,0x9CFC,0x9CFD,0x9CFE, +0x9D40,0x9D41,0x9D42,0x9D43,0xB5CE,0x9D44,0x9D45,0x9D46, +0x9D47,0xE4EF,0x9D48,0x9D49,0x9D4A,0x9D4B,0x9D4C,0x9D4D, +0x9D4E,0x9D4F,0xC6AF,0x9D50,0x9D51,0x9D52,0xC6E1,0x9D53, +0x9D54,0xE4F5,0x9D55,0x9D56,0x9D57,0x9D58,0x9D59,0xC2A9, +0x9D5A,0x9D5B,0x9D5C,0xC0EC,0xD1DD,0xE4EE,0x9D5D,0x9D5E, +0x9D5F,0x9D60,0x9D61,0x9D62,0x9D63,0x9D64,0x9D65,0x9D66, +0xC4AE,0x9D67,0x9D68,0x9D69,0xE4ED,0x9D6A,0x9D6B,0x9D6C, +0x9D6D,0xE4F6,0xE4F4,0xC2FE,0x9D6E,0xE4DD,0x9D6F,0xE4F0, +0x9D70,0xCAFE,0x9D71,0xD5C4,0x9D72,0x9D73,0xE4F1,0x9D74, +0x9D75,0x9D76,0x9D77,0x9D78,0x9D79,0x9D7A,0xD1FA,0x9D7B, +0x9D7C,0x9D7D,0x9D7E,0x9D80,0x9D81,0x9D82,0xE4EB,0xE4EC, +0x9D83,0x9D84,0x9D85,0xE4F2,0x9D86,0xCEAB,0x9D87,0x9D88, +0x9D89,0x9D8A,0x9D8B,0x9D8C,0x9D8D,0x9D8E,0x9D8F,0x9D90, +0xC5CB,0x9D91,0x9D92,0x9D93,0xC7B1,0x9D94,0xC2BA,0x9D95, +0x9D96,0x9D97,0xE4EA,0x9D98,0x9D99,0x9D9A,0xC1CA,0x9D9B, +0x9D9C,0x9D9D,0x9D9E,0x9D9F,0x9DA0,0xCCB6,0xB3B1,0x9DA1, +0x9DA2,0x9DA3,0xE4FB,0x9DA4,0xE4F3,0x9DA5,0x9DA6,0x9DA7, +0xE4FA,0x9DA8,0xE4FD,0x9DA9,0xE4FC,0x9DAA,0x9DAB,0x9DAC, +0x9DAD,0x9DAE,0x9DAF,0x9DB0,0xB3CE,0x9DB1,0x9DB2,0x9DB3, +0xB3BA,0xE4F7,0x9DB4,0x9DB5,0xE4F9,0xE4F8,0xC5EC,0x9DB6, +0x9DB7,0x9DB8,0x9DB9,0x9DBA,0x9DBB,0x9DBC,0x9DBD,0x9DBE, +0x9DBF,0x9DC0,0x9DC1,0x9DC2,0xC0BD,0x9DC3,0x9DC4,0x9DC5, +0x9DC6,0xD4E8,0x9DC7,0x9DC8,0x9DC9,0x9DCA,0x9DCB,0xE5A2, +0x9DCC,0x9DCD,0x9DCE,0x9DCF,0x9DD0,0x9DD1,0x9DD2,0x9DD3, +0x9DD4,0x9DD5,0x9DD6,0xB0C4,0x9DD7,0x9DD8,0xE5A4,0x9DD9, +0x9DDA,0xE5A3,0x9DDB,0x9DDC,0x9DDD,0x9DDE,0x9DDF,0x9DE0, +0xBCA4,0x9DE1,0xE5A5,0x9DE2,0x9DE3,0x9DE4,0x9DE5,0x9DE6, +0x9DE7,0xE5A1,0x9DE8,0x9DE9,0x9DEA,0x9DEB,0x9DEC,0x9DED, +0x9DEE,0xE4FE,0xB1F4,0x9DEF,0x9DF0,0x9DF1,0x9DF2,0x9DF3, +0x9DF4,0x9DF5,0x9DF6,0x9DF7,0x9DF8,0x9DF9,0xE5A8,0x9DFA, +0xE5A9,0xE5A6,0x9DFB,0x9DFC,0x9DFD,0x9DFE,0x9E40,0x9E41, +0x9E42,0x9E43,0x9E44,0x9E45,0x9E46,0x9E47,0xE5A7,0xE5AA, +0x9E48,0x9E49,0x9E4A,0x9E4B,0x9E4C,0x9E4D,0x9E4E,0x9E4F, +0x9E50,0x9E51,0x9E52,0x9E53,0x9E54,0x9E55,0x9E56,0x9E57, +0x9E58,0x9E59,0x9E5A,0x9E5B,0x9E5C,0x9E5D,0x9E5E,0x9E5F, +0x9E60,0x9E61,0x9E62,0x9E63,0x9E64,0x9E65,0x9E66,0x9E67, +0x9E68,0xC6D9,0x9E69,0x9E6A,0x9E6B,0x9E6C,0x9E6D,0x9E6E, +0x9E6F,0x9E70,0xE5AB,0xE5AD,0x9E71,0x9E72,0x9E73,0x9E74, +0x9E75,0x9E76,0x9E77,0xE5AC,0x9E78,0x9E79,0x9E7A,0x9E7B, +0x9E7C,0x9E7D,0x9E7E,0x9E80,0x9E81,0x9E82,0x9E83,0x9E84, +0x9E85,0x9E86,0x9E87,0x9E88,0x9E89,0xE5AF,0x9E8A,0x9E8B, +0x9E8C,0xE5AE,0x9E8D,0x9E8E,0x9E8F,0x9E90,0x9E91,0x9E92, +0x9E93,0x9E94,0x9E95,0x9E96,0x9E97,0x9E98,0x9E99,0x9E9A, +0x9E9B,0x9E9C,0x9E9D,0x9E9E,0xB9E0,0x9E9F,0x9EA0,0xE5B0, +0x9EA1,0x9EA2,0x9EA3,0x9EA4,0x9EA5,0x9EA6,0x9EA7,0x9EA8, +0x9EA9,0x9EAA,0x9EAB,0x9EAC,0x9EAD,0x9EAE,0xE5B1,0x9EAF, +0x9EB0,0x9EB1,0x9EB2,0x9EB3,0x9EB4,0x9EB5,0x9EB6,0x9EB7, +0x9EB8,0x9EB9,0x9EBA,0xBBF0,0xECE1,0xC3F0,0x9EBB,0xB5C6, +0xBBD2,0x9EBC,0x9EBD,0x9EBE,0x9EBF,0xC1E9,0xD4EE,0x9EC0, +0xBEC4,0x9EC1,0x9EC2,0x9EC3,0xD7C6,0x9EC4,0xD4D6,0xB2D3, +0xECBE,0x9EC5,0x9EC6,0x9EC7,0x9EC8,0xEAC1,0x9EC9,0x9ECA, +0x9ECB,0xC2AF,0xB4B6,0x9ECC,0x9ECD,0x9ECE,0xD1D7,0x9ECF, +0x9ED0,0x9ED1,0xB3B4,0x9ED2,0xC8B2,0xBFBB,0xECC0,0x9ED3, +0x9ED4,0xD6CB,0x9ED5,0x9ED6,0xECBF,0xECC1,0x9ED7,0x9ED8, +0x9ED9,0x9EDA,0x9EDB,0x9EDC,0x9EDD,0x9EDE,0x9EDF,0x9EE0, +0x9EE1,0x9EE2,0x9EE3,0xECC5,0xBEE6,0xCCBF,0xC5DA,0xBEBC, +0x9EE4,0xECC6,0x9EE5,0xB1FE,0x9EE6,0x9EE7,0x9EE8,0xECC4, +0xD5A8,0xB5E3,0x9EE9,0xECC2,0xC1B6,0xB3E3,0x9EEA,0x9EEB, +0xECC3,0xCBB8,0xC0C3,0xCCFE,0x9EEC,0x9EED,0x9EEE,0x9EEF, +0xC1D2,0x9EF0,0xECC8,0x9EF1,0x9EF2,0x9EF3,0x9EF4,0x9EF5, +0x9EF6,0x9EF7,0x9EF8,0x9EF9,0x9EFA,0x9EFB,0x9EFC,0x9EFD, +0xBAE6,0xC0D3,0x9EFE,0xD6F2,0x9F40,0x9F41,0x9F42,0xD1CC, +0x9F43,0x9F44,0x9F45,0x9F46,0xBFBE,0x9F47,0xB7B3,0xC9D5, +0xECC7,0xBBE2,0x9F48,0xCCCC,0xBDFD,0xC8C8,0x9F49,0xCFA9, +0x9F4A,0x9F4B,0x9F4C,0x9F4D,0x9F4E,0x9F4F,0x9F50,0xCDE9, +0x9F51,0xC5EB,0x9F52,0x9F53,0x9F54,0xB7E9,0x9F55,0x9F56, +0x9F57,0x9F58,0x9F59,0x9F5A,0x9F5B,0x9F5C,0x9F5D,0x9F5E, +0x9F5F,0xD1C9,0xBAB8,0x9F60,0x9F61,0x9F62,0x9F63,0x9F64, +0xECC9,0x9F65,0x9F66,0xECCA,0x9F67,0xBBC0,0xECCB,0x9F68, +0xECE2,0xB1BA,0xB7D9,0x9F69,0x9F6A,0x9F6B,0x9F6C,0x9F6D, +0x9F6E,0x9F6F,0x9F70,0x9F71,0x9F72,0x9F73,0xBDB9,0x9F74, +0x9F75,0x9F76,0x9F77,0x9F78,0x9F79,0x9F7A,0x9F7B,0xECCC, +0xD1E6,0xECCD,0x9F7C,0x9F7D,0x9F7E,0x9F80,0xC8BB,0x9F81, +0x9F82,0x9F83,0x9F84,0x9F85,0x9F86,0x9F87,0x9F88,0x9F89, +0x9F8A,0x9F8B,0x9F8C,0x9F8D,0x9F8E,0xECD1,0x9F8F,0x9F90, +0x9F91,0x9F92,0xECD3,0x9F93,0xBBCD,0x9F94,0xBCE5,0x9F95, +0x9F96,0x9F97,0x9F98,0x9F99,0x9F9A,0x9F9B,0x9F9C,0x9F9D, +0x9F9E,0x9F9F,0x9FA0,0x9FA1,0xECCF,0x9FA2,0xC9B7,0x9FA3, +0x9FA4,0x9FA5,0x9FA6,0x9FA7,0xC3BA,0x9FA8,0xECE3,0xD5D5, +0xECD0,0x9FA9,0x9FAA,0x9FAB,0x9FAC,0x9FAD,0xD6F3,0x9FAE, +0x9FAF,0x9FB0,0xECD2,0xECCE,0x9FB1,0x9FB2,0x9FB3,0x9FB4, +0xECD4,0x9FB5,0xECD5,0x9FB6,0x9FB7,0xC9BF,0x9FB8,0x9FB9, +0x9FBA,0x9FBB,0x9FBC,0x9FBD,0xCFA8,0x9FBE,0x9FBF,0x9FC0, +0x9FC1,0x9FC2,0xD0DC,0x9FC3,0x9FC4,0x9FC5,0x9FC6,0xD1AC, +0x9FC7,0x9FC8,0x9FC9,0x9FCA,0xC8DB,0x9FCB,0x9FCC,0x9FCD, +0xECD6,0xCEF5,0x9FCE,0x9FCF,0x9FD0,0x9FD1,0x9FD2,0xCAEC, +0xECDA,0x9FD3,0x9FD4,0x9FD5,0x9FD6,0x9FD7,0x9FD8,0x9FD9, +0xECD9,0x9FDA,0x9FDB,0x9FDC,0xB0BE,0x9FDD,0x9FDE,0x9FDF, +0x9FE0,0x9FE1,0x9FE2,0xECD7,0x9FE3,0xECD8,0x9FE4,0x9FE5, +0x9FE6,0xECE4,0x9FE7,0x9FE8,0x9FE9,0x9FEA,0x9FEB,0x9FEC, +0x9FED,0x9FEE,0x9FEF,0xC8BC,0x9FF0,0x9FF1,0x9FF2,0x9FF3, +0x9FF4,0x9FF5,0x9FF6,0x9FF7,0x9FF8,0x9FF9,0xC1C7,0x9FFA, +0x9FFB,0x9FFC,0x9FFD,0x9FFE,0xECDC,0xD1E0,0xA040,0xA041, +0xA042,0xA043,0xA044,0xA045,0xA046,0xA047,0xA048,0xA049, +0xECDB,0xA04A,0xA04B,0xA04C,0xA04D,0xD4EF,0xA04E,0xECDD, +0xA04F,0xA050,0xA051,0xA052,0xA053,0xA054,0xDBC6,0xA055, +0xA056,0xA057,0xA058,0xA059,0xA05A,0xA05B,0xA05C,0xA05D, +0xA05E,0xECDE,0xA05F,0xA060,0xA061,0xA062,0xA063,0xA064, +0xA065,0xA066,0xA067,0xA068,0xA069,0xA06A,0xB1AC,0xA06B, +0xA06C,0xA06D,0xA06E,0xA06F,0xA070,0xA071,0xA072,0xA073, +0xA074,0xA075,0xA076,0xA077,0xA078,0xA079,0xA07A,0xA07B, +0xA07C,0xA07D,0xA07E,0xA080,0xA081,0xECDF,0xA082,0xA083, +0xA084,0xA085,0xA086,0xA087,0xA088,0xA089,0xA08A,0xA08B, +0xECE0,0xA08C,0xD7A6,0xA08D,0xC5C0,0xA08E,0xA08F,0xA090, +0xEBBC,0xB0AE,0xA091,0xA092,0xA093,0xBEF4,0xB8B8,0xD2AF, +0xB0D6,0xB5F9,0xA094,0xD8B3,0xA095,0xCBAC,0xA096,0xE3DD, +0xA097,0xA098,0xA099,0xA09A,0xA09B,0xA09C,0xA09D,0xC6AC, +0xB0E6,0xA09E,0xA09F,0xA0A0,0xC5C6,0xEBB9,0xA0A1,0xA0A2, +0xA0A3,0xA0A4,0xEBBA,0xA0A5,0xA0A6,0xA0A7,0xEBBB,0xA0A8, +0xA0A9,0xD1C0,0xA0AA,0xC5A3,0xA0AB,0xEAF2,0xA0AC,0xC4B2, +0xA0AD,0xC4B5,0xC0CE,0xA0AE,0xA0AF,0xA0B0,0xEAF3,0xC4C1, +0xA0B1,0xCEEF,0xA0B2,0xA0B3,0xA0B4,0xA0B5,0xEAF0,0xEAF4, +0xA0B6,0xA0B7,0xC9FC,0xA0B8,0xA0B9,0xC7A3,0xA0BA,0xA0BB, +0xA0BC,0xCCD8,0xCEFE,0xA0BD,0xA0BE,0xA0BF,0xEAF5,0xEAF6, +0xCFAC,0xC0E7,0xA0C0,0xA0C1,0xEAF7,0xA0C2,0xA0C3,0xA0C4, +0xA0C5,0xA0C6,0xB6BF,0xEAF8,0xA0C7,0xEAF9,0xA0C8,0xEAFA, +0xA0C9,0xA0CA,0xEAFB,0xA0CB,0xA0CC,0xA0CD,0xA0CE,0xA0CF, +0xA0D0,0xA0D1,0xA0D2,0xA0D3,0xA0D4,0xA0D5,0xA0D6,0xEAF1, +0xA0D7,0xA0D8,0xA0D9,0xA0DA,0xA0DB,0xA0DC,0xA0DD,0xA0DE, +0xA0DF,0xA0E0,0xA0E1,0xA0E2,0xC8AE,0xE1EB,0xA0E3,0xB7B8, +0xE1EC,0xA0E4,0xA0E5,0xA0E6,0xE1ED,0xA0E7,0xD7B4,0xE1EE, +0xE1EF,0xD3CC,0xA0E8,0xA0E9,0xA0EA,0xA0EB,0xA0EC,0xA0ED, +0xA0EE,0xE1F1,0xBFF1,0xE1F0,0xB5D2,0xA0EF,0xA0F0,0xA0F1, +0xB1B7,0xA0F2,0xA0F3,0xA0F4,0xA0F5,0xE1F3,0xE1F2,0xA0F6, +0xBAFC,0xA0F7,0xE1F4,0xA0F8,0xA0F9,0xA0FA,0xA0FB,0xB9B7, +0xA0FC,0xBED1,0xA0FD,0xA0FE,0xAA40,0xAA41,0xC4FC,0xAA42, +0xBADD,0xBDC6,0xAA43,0xAA44,0xAA45,0xAA46,0xAA47,0xAA48, +0xE1F5,0xE1F7,0xAA49,0xAA4A,0xB6C0,0xCFC1,0xCAA8,0xE1F6, +0xD5F8,0xD3FC,0xE1F8,0xE1FC,0xE1F9,0xAA4B,0xAA4C,0xE1FA, +0xC0EA,0xAA4D,0xE1FE,0xE2A1,0xC0C7,0xAA4E,0xAA4F,0xAA50, +0xAA51,0xE1FB,0xAA52,0xE1FD,0xAA53,0xAA54,0xAA55,0xAA56, +0xAA57,0xAA58,0xE2A5,0xAA59,0xAA5A,0xAA5B,0xC1D4,0xAA5C, +0xAA5D,0xAA5E,0xAA5F,0xE2A3,0xAA60,0xE2A8,0xB2FE,0xE2A2, +0xAA61,0xAA62,0xAA63,0xC3CD,0xB2C2,0xE2A7,0xE2A6,0xAA64, +0xAA65,0xE2A4,0xE2A9,0xAA66,0xAA67,0xE2AB,0xAA68,0xAA69, +0xAA6A,0xD0C9,0xD6ED,0xC3A8,0xE2AC,0xAA6B,0xCFD7,0xAA6C, +0xAA6D,0xE2AE,0xAA6E,0xAA6F,0xBAEF,0xAA70,0xAA71,0xE9E0, +0xE2AD,0xE2AA,0xAA72,0xAA73,0xAA74,0xAA75,0xBBAB,0xD4B3, +0xAA76,0xAA77,0xAA78,0xAA79,0xAA7A,0xAA7B,0xAA7C,0xAA7D, +0xAA7E,0xAA80,0xAA81,0xAA82,0xAA83,0xE2B0,0xAA84,0xAA85, +0xE2AF,0xAA86,0xE9E1,0xAA87,0xAA88,0xAA89,0xAA8A,0xE2B1, +0xAA8B,0xAA8C,0xAA8D,0xAA8E,0xAA8F,0xAA90,0xAA91,0xAA92, +0xE2B2,0xAA93,0xAA94,0xAA95,0xAA96,0xAA97,0xAA98,0xAA99, +0xAA9A,0xAA9B,0xAA9C,0xAA9D,0xE2B3,0xCCA1,0xAA9E,0xE2B4, +0xAA9F,0xAAA0,0xAB40,0xAB41,0xAB42,0xAB43,0xAB44,0xAB45, +0xAB46,0xAB47,0xAB48,0xAB49,0xAB4A,0xAB4B,0xE2B5,0xAB4C, +0xAB4D,0xAB4E,0xAB4F,0xAB50,0xD0FE,0xAB51,0xAB52,0xC2CA, +0xAB53,0xD3F1,0xAB54,0xCDF5,0xAB55,0xAB56,0xE7E0,0xAB57, +0xAB58,0xE7E1,0xAB59,0xAB5A,0xAB5B,0xAB5C,0xBEC1,0xAB5D, +0xAB5E,0xAB5F,0xAB60,0xC2EA,0xAB61,0xAB62,0xAB63,0xE7E4, +0xAB64,0xAB65,0xE7E3,0xAB66,0xAB67,0xAB68,0xAB69,0xAB6A, +0xAB6B,0xCDE6,0xAB6C,0xC3B5,0xAB6D,0xAB6E,0xE7E2,0xBBB7, +0xCFD6,0xAB6F,0xC1E1,0xE7E9,0xAB70,0xAB71,0xAB72,0xE7E8, +0xAB73,0xAB74,0xE7F4,0xB2A3,0xAB75,0xAB76,0xAB77,0xAB78, +0xE7EA,0xAB79,0xE7E6,0xAB7A,0xAB7B,0xAB7C,0xAB7D,0xAB7E, +0xE7EC,0xE7EB,0xC9BA,0xAB80,0xAB81,0xD5E4,0xAB82,0xE7E5, +0xB7A9,0xE7E7,0xAB83,0xAB84,0xAB85,0xAB86,0xAB87,0xAB88, +0xAB89,0xE7EE,0xAB8A,0xAB8B,0xAB8C,0xAB8D,0xE7F3,0xAB8E, +0xD6E9,0xAB8F,0xAB90,0xAB91,0xAB92,0xE7ED,0xAB93,0xE7F2, +0xAB94,0xE7F1,0xAB95,0xAB96,0xAB97,0xB0E0,0xAB98,0xAB99, +0xAB9A,0xAB9B,0xE7F5,0xAB9C,0xAB9D,0xAB9E,0xAB9F,0xABA0, +0xAC40,0xAC41,0xAC42,0xAC43,0xAC44,0xAC45,0xAC46,0xAC47, +0xAC48,0xAC49,0xAC4A,0xC7F2,0xAC4B,0xC0C5,0xC0ED,0xAC4C, +0xAC4D,0xC1F0,0xE7F0,0xAC4E,0xAC4F,0xAC50,0xAC51,0xE7F6, +0xCBF6,0xAC52,0xAC53,0xAC54,0xAC55,0xAC56,0xAC57,0xAC58, +0xAC59,0xAC5A,0xE8A2,0xE8A1,0xAC5B,0xAC5C,0xAC5D,0xAC5E, +0xAC5F,0xAC60,0xD7C1,0xAC61,0xAC62,0xE7FA,0xE7F9,0xAC63, +0xE7FB,0xAC64,0xE7F7,0xAC65,0xE7FE,0xAC66,0xE7FD,0xAC67, +0xE7FC,0xAC68,0xAC69,0xC1D5,0xC7D9,0xC5FD,0xC5C3,0xAC6A, +0xAC6B,0xAC6C,0xAC6D,0xAC6E,0xC7ED,0xAC6F,0xAC70,0xAC71, +0xAC72,0xE8A3,0xAC73,0xAC74,0xAC75,0xAC76,0xAC77,0xAC78, +0xAC79,0xAC7A,0xAC7B,0xAC7C,0xAC7D,0xAC7E,0xAC80,0xAC81, +0xAC82,0xAC83,0xAC84,0xAC85,0xAC86,0xE8A6,0xAC87,0xE8A5, +0xAC88,0xE8A7,0xBAF7,0xE7F8,0xE8A4,0xAC89,0xC8F0,0xC9AA, +0xAC8A,0xAC8B,0xAC8C,0xAC8D,0xAC8E,0xAC8F,0xAC90,0xAC91, +0xAC92,0xAC93,0xAC94,0xAC95,0xAC96,0xE8A9,0xAC97,0xAC98, +0xB9E5,0xAC99,0xAC9A,0xAC9B,0xAC9C,0xAC9D,0xD1FE,0xE8A8, +0xAC9E,0xAC9F,0xACA0,0xAD40,0xAD41,0xAD42,0xE8AA,0xAD43, +0xE8AD,0xE8AE,0xAD44,0xC1A7,0xAD45,0xAD46,0xAD47,0xE8AF, +0xAD48,0xAD49,0xAD4A,0xE8B0,0xAD4B,0xAD4C,0xE8AC,0xAD4D, +0xE8B4,0xAD4E,0xAD4F,0xAD50,0xAD51,0xAD52,0xAD53,0xAD54, +0xAD55,0xAD56,0xAD57,0xAD58,0xE8AB,0xAD59,0xE8B1,0xAD5A, +0xAD5B,0xAD5C,0xAD5D,0xAD5E,0xAD5F,0xAD60,0xAD61,0xE8B5, +0xE8B2,0xE8B3,0xAD62,0xAD63,0xAD64,0xAD65,0xAD66,0xAD67, +0xAD68,0xAD69,0xAD6A,0xAD6B,0xAD6C,0xAD6D,0xAD6E,0xAD6F, +0xAD70,0xAD71,0xE8B7,0xAD72,0xAD73,0xAD74,0xAD75,0xAD76, +0xAD77,0xAD78,0xAD79,0xAD7A,0xAD7B,0xAD7C,0xAD7D,0xAD7E, +0xAD80,0xAD81,0xAD82,0xAD83,0xAD84,0xAD85,0xAD86,0xAD87, +0xAD88,0xAD89,0xE8B6,0xAD8A,0xAD8B,0xAD8C,0xAD8D,0xAD8E, +0xAD8F,0xAD90,0xAD91,0xAD92,0xB9CF,0xAD93,0xF0AC,0xAD94, +0xF0AD,0xAD95,0xC6B0,0xB0EA,0xC8BF,0xAD96,0xCDDF,0xAD97, +0xAD98,0xAD99,0xAD9A,0xAD9B,0xAD9C,0xAD9D,0xCECD,0xEAB1, +0xAD9E,0xAD9F,0xADA0,0xAE40,0xEAB2,0xAE41,0xC6BF,0xB4C9, +0xAE42,0xAE43,0xAE44,0xAE45,0xAE46,0xAE47,0xAE48,0xEAB3, +0xAE49,0xAE4A,0xAE4B,0xAE4C,0xD5E7,0xAE4D,0xAE4E,0xAE4F, +0xAE50,0xAE51,0xAE52,0xAE53,0xAE54,0xDDF9,0xAE55,0xEAB4, +0xAE56,0xEAB5,0xAE57,0xEAB6,0xAE58,0xAE59,0xAE5A,0xAE5B, +0xB8CA,0xDFB0,0xC9F5,0xAE5C,0xCCF0,0xAE5D,0xAE5E,0xC9FA, +0xAE5F,0xAE60,0xAE61,0xAE62,0xAE63,0xC9FB,0xAE64,0xAE65, +0xD3C3,0xCBA6,0xAE66,0xB8A6,0xF0AE,0xB1C2,0xAE67,0xE5B8, +0xCCEF,0xD3C9,0xBCD7,0xC9EA,0xAE68,0xB5E7,0xAE69,0xC4D0, +0xB5E9,0xAE6A,0xEEAE,0xBBAD,0xAE6B,0xAE6C,0xE7DE,0xAE6D, +0xEEAF,0xAE6E,0xAE6F,0xAE70,0xAE71,0xB3A9,0xAE72,0xAE73, +0xEEB2,0xAE74,0xAE75,0xEEB1,0xBDE7,0xAE76,0xEEB0,0xCEB7, +0xAE77,0xAE78,0xAE79,0xAE7A,0xC5CF,0xAE7B,0xAE7C,0xAE7D, +0xAE7E,0xC1F4,0xDBCE,0xEEB3,0xD0F3,0xAE80,0xAE81,0xAE82, +0xAE83,0xAE84,0xAE85,0xAE86,0xAE87,0xC2D4,0xC6E8,0xAE88, +0xAE89,0xAE8A,0xB7AC,0xAE8B,0xAE8C,0xAE8D,0xAE8E,0xAE8F, +0xAE90,0xAE91,0xEEB4,0xAE92,0xB3EB,0xAE93,0xAE94,0xAE95, +0xBBFB,0xEEB5,0xAE96,0xAE97,0xAE98,0xAE99,0xAE9A,0xE7DC, +0xAE9B,0xAE9C,0xAE9D,0xEEB6,0xAE9E,0xAE9F,0xBDAE,0xAEA0, +0xAF40,0xAF41,0xAF42,0xF1E2,0xAF43,0xAF44,0xAF45,0xCAE8, +0xAF46,0xD2C9,0xF0DA,0xAF47,0xF0DB,0xAF48,0xF0DC,0xC1C6, +0xAF49,0xB8ED,0xBECE,0xAF4A,0xAF4B,0xF0DE,0xAF4C,0xC5B1, +0xF0DD,0xD1F1,0xAF4D,0xF0E0,0xB0CC,0xBDEA,0xAF4E,0xAF4F, +0xAF50,0xAF51,0xAF52,0xD2DF,0xF0DF,0xAF53,0xB4AF,0xB7E8, +0xF0E6,0xF0E5,0xC6A3,0xF0E1,0xF0E2,0xB4C3,0xAF54,0xAF55, +0xF0E3,0xD5EE,0xAF56,0xAF57,0xCCDB,0xBED2,0xBCB2,0xAF58, +0xAF59,0xAF5A,0xF0E8,0xF0E7,0xF0E4,0xB2A1,0xAF5B,0xD6A2, +0xD3B8,0xBEB7,0xC8AC,0xAF5C,0xAF5D,0xF0EA,0xAF5E,0xAF5F, +0xAF60,0xAF61,0xD1F7,0xAF62,0xD6CC,0xBADB,0xF0E9,0xAF63, +0xB6BB,0xAF64,0xAF65,0xCDB4,0xAF66,0xAF67,0xC6A6,0xAF68, +0xAF69,0xAF6A,0xC1A1,0xF0EB,0xF0EE,0xAF6B,0xF0ED,0xF0F0, +0xF0EC,0xAF6C,0xBBBE,0xF0EF,0xAF6D,0xAF6E,0xAF6F,0xAF70, +0xCCB5,0xF0F2,0xAF71,0xAF72,0xB3D5,0xAF73,0xAF74,0xAF75, +0xAF76,0xB1D4,0xAF77,0xAF78,0xF0F3,0xAF79,0xAF7A,0xF0F4, +0xF0F6,0xB4E1,0xAF7B,0xF0F1,0xAF7C,0xF0F7,0xAF7D,0xAF7E, +0xAF80,0xAF81,0xF0FA,0xAF82,0xF0F8,0xAF83,0xAF84,0xAF85, +0xF0F5,0xAF86,0xAF87,0xAF88,0xAF89,0xF0FD,0xAF8A,0xF0F9, +0xF0FC,0xF0FE,0xAF8B,0xF1A1,0xAF8C,0xAF8D,0xAF8E,0xCEC1, +0xF1A4,0xAF8F,0xF1A3,0xAF90,0xC1F6,0xF0FB,0xCADD,0xAF91, +0xAF92,0xB4F1,0xB1F1,0xCCB1,0xAF93,0xF1A6,0xAF94,0xAF95, +0xF1A7,0xAF96,0xAF97,0xF1AC,0xD5CE,0xF1A9,0xAF98,0xAF99, +0xC8B3,0xAF9A,0xAF9B,0xAF9C,0xF1A2,0xAF9D,0xF1AB,0xF1A8, +0xF1A5,0xAF9E,0xAF9F,0xF1AA,0xAFA0,0xB040,0xB041,0xB042, +0xB043,0xB044,0xB045,0xB046,0xB0A9,0xF1AD,0xB047,0xB048, +0xB049,0xB04A,0xB04B,0xB04C,0xF1AF,0xB04D,0xF1B1,0xB04E, +0xB04F,0xB050,0xB051,0xB052,0xF1B0,0xB053,0xF1AE,0xB054, +0xB055,0xB056,0xB057,0xD1A2,0xB058,0xB059,0xB05A,0xB05B, +0xB05C,0xB05D,0xB05E,0xF1B2,0xB05F,0xB060,0xB061,0xF1B3, +0xB062,0xB063,0xB064,0xB065,0xB066,0xB067,0xB068,0xB069, +0xB9EF,0xB06A,0xB06B,0xB5C7,0xB06C,0xB0D7,0xB0D9,0xB06D, +0xB06E,0xB06F,0xD4ED,0xB070,0xB5C4,0xB071,0xBDD4,0xBBCA, +0xF0A7,0xB072,0xB073,0xB8DE,0xB074,0xB075,0xF0A8,0xB076, +0xB077,0xB0A8,0xB078,0xF0A9,0xB079,0xB07A,0xCDEE,0xB07B, +0xB07C,0xF0AA,0xB07D,0xB07E,0xB080,0xB081,0xB082,0xB083, +0xB084,0xB085,0xB086,0xB087,0xF0AB,0xB088,0xB089,0xB08A, +0xB08B,0xB08C,0xB08D,0xB08E,0xB08F,0xB090,0xC6A4,0xB091, +0xB092,0xD6E5,0xF1E4,0xB093,0xF1E5,0xB094,0xB095,0xB096, +0xB097,0xB098,0xB099,0xB09A,0xB09B,0xB09C,0xB09D,0xC3F3, +0xB09E,0xB09F,0xD3DB,0xB0A0,0xB140,0xD6D1,0xC5E8,0xB141, +0xD3AF,0xB142,0xD2E6,0xB143,0xB144,0xEEC1,0xB0BB,0xD5B5, +0xD1CE,0xBCE0,0xBAD0,0xB145,0xBFF8,0xB146,0xB8C7,0xB5C1, +0xC5CC,0xB147,0xB148,0xCAA2,0xB149,0xB14A,0xB14B,0xC3CB, +0xB14C,0xB14D,0xB14E,0xB14F,0xB150,0xEEC2,0xB151,0xB152, +0xB153,0xB154,0xB155,0xB156,0xB157,0xB158,0xC4BF,0xB6A2, +0xB159,0xEDEC,0xC3A4,0xB15A,0xD6B1,0xB15B,0xB15C,0xB15D, +0xCFE0,0xEDEF,0xB15E,0xB15F,0xC5CE,0xB160,0xB6DC,0xB161, +0xB162,0xCAA1,0xB163,0xB164,0xEDED,0xB165,0xB166,0xEDF0, +0xEDF1,0xC3BC,0xB167,0xBFB4,0xB168,0xEDEE,0xB169,0xB16A, +0xB16B,0xB16C,0xB16D,0xB16E,0xB16F,0xB170,0xB171,0xB172, +0xB173,0xEDF4,0xEDF2,0xB174,0xB175,0xB176,0xB177,0xD5E6, +0xC3DF,0xB178,0xEDF3,0xB179,0xB17A,0xB17B,0xEDF6,0xB17C, +0xD5A3,0xD1A3,0xB17D,0xB17E,0xB180,0xEDF5,0xB181,0xC3D0, +0xB182,0xB183,0xB184,0xB185,0xB186,0xEDF7,0xBFF4,0xBEEC, +0xEDF8,0xB187,0xCCF7,0xB188,0xD1DB,0xB189,0xB18A,0xB18B, +0xD7C5,0xD5F6,0xB18C,0xEDFC,0xB18D,0xB18E,0xB18F,0xEDFB, +0xB190,0xB191,0xB192,0xB193,0xB194,0xB195,0xB196,0xB197, +0xEDF9,0xEDFA,0xB198,0xB199,0xB19A,0xB19B,0xB19C,0xB19D, +0xB19E,0xB19F,0xEDFD,0xBEA6,0xB1A0,0xB240,0xB241,0xB242, +0xB243,0xCBAF,0xEEA1,0xB6BD,0xB244,0xEEA2,0xC4C0,0xB245, +0xEDFE,0xB246,0xB247,0xBDDE,0xB2C7,0xB248,0xB249,0xB24A, +0xB24B,0xB24C,0xB24D,0xB24E,0xB24F,0xB250,0xB251,0xB252, +0xB253,0xB6C3,0xB254,0xB255,0xB256,0xEEA5,0xD8BA,0xEEA3, +0xEEA6,0xB257,0xB258,0xB259,0xC3E9,0xB3F2,0xB25A,0xB25B, +0xB25C,0xB25D,0xB25E,0xB25F,0xEEA7,0xEEA4,0xCFB9,0xB260, +0xB261,0xEEA8,0xC2F7,0xB262,0xB263,0xB264,0xB265,0xB266, +0xB267,0xB268,0xB269,0xB26A,0xB26B,0xB26C,0xB26D,0xEEA9, +0xEEAA,0xB26E,0xDEAB,0xB26F,0xB270,0xC6B3,0xB271,0xC7C6, +0xB272,0xD6F5,0xB5C9,0xB273,0xCBB2,0xB274,0xB275,0xB276, +0xEEAB,0xB277,0xB278,0xCDAB,0xB279,0xEEAC,0xB27A,0xB27B, +0xB27C,0xB27D,0xB27E,0xD5B0,0xB280,0xEEAD,0xB281,0xF6C4, +0xB282,0xB283,0xB284,0xB285,0xB286,0xB287,0xB288,0xB289, +0xB28A,0xB28B,0xB28C,0xB28D,0xB28E,0xDBC7,0xB28F,0xB290, +0xB291,0xB292,0xB293,0xB294,0xB295,0xB296,0xB297,0xB4A3, +0xB298,0xB299,0xB29A,0xC3AC,0xF1E6,0xB29B,0xB29C,0xB29D, +0xB29E,0xB29F,0xCAB8,0xD2D3,0xB2A0,0xD6AA,0xB340,0xEFF2, +0xB341,0xBED8,0xB342,0xBDC3,0xEFF3,0xB6CC,0xB0AB,0xB343, +0xB344,0xB345,0xB346,0xCAAF,0xB347,0xB348,0xEDB6,0xB349, +0xEDB7,0xB34A,0xB34B,0xB34C,0xB34D,0xCEF9,0xB7AF,0xBFF3, +0xEDB8,0xC2EB,0xC9B0,0xB34E,0xB34F,0xB350,0xB351,0xB352, +0xB353,0xEDB9,0xB354,0xB355,0xC6F6,0xBFB3,0xB356,0xB357, +0xB358,0xEDBC,0xC5F8,0xB359,0xD1D0,0xB35A,0xD7A9,0xEDBA, +0xEDBB,0xB35B,0xD1E2,0xB35C,0xEDBF,0xEDC0,0xB35D,0xEDC4, +0xB35E,0xB35F,0xB360,0xEDC8,0xB361,0xEDC6,0xEDCE,0xD5E8, +0xB362,0xEDC9,0xB363,0xB364,0xEDC7,0xEDBE,0xB365,0xB366, +0xC5E9,0xB367,0xB368,0xB369,0xC6C6,0xB36A,0xB36B,0xC9E9, +0xD4D2,0xEDC1,0xEDC2,0xEDC3,0xEDC5,0xB36C,0xC0F9,0xB36D, +0xB4A1,0xB36E,0xB36F,0xB370,0xB371,0xB9E8,0xB372,0xEDD0, +0xB373,0xB374,0xB375,0xB376,0xEDD1,0xB377,0xEDCA,0xB378, +0xEDCF,0xB379,0xCEF8,0xB37A,0xB37B,0xCBB6,0xEDCC,0xEDCD, +0xB37C,0xB37D,0xB37E,0xB380,0xB381,0xCFF5,0xB382,0xB383, +0xB384,0xB385,0xB386,0xB387,0xB388,0xB389,0xB38A,0xB38B, +0xB38C,0xB38D,0xEDD2,0xC1F2,0xD3B2,0xEDCB,0xC8B7,0xB38E, +0xB38F,0xB390,0xB391,0xB392,0xB393,0xB394,0xB395,0xBCEF, +0xB396,0xB397,0xB398,0xB399,0xC5F0,0xB39A,0xB39B,0xB39C, +0xB39D,0xB39E,0xB39F,0xB3A0,0xB440,0xB441,0xB442,0xEDD6, +0xB443,0xB5EF,0xB444,0xB445,0xC2B5,0xB0AD,0xCBE9,0xB446, +0xB447,0xB1AE,0xB448,0xEDD4,0xB449,0xB44A,0xB44B,0xCDEB, +0xB5E2,0xB44C,0xEDD5,0xEDD3,0xEDD7,0xB44D,0xB44E,0xB5FA, +0xB44F,0xEDD8,0xB450,0xEDD9,0xB451,0xEDDC,0xB452,0xB1CC, +0xB453,0xB454,0xB455,0xB456,0xB457,0xB458,0xB459,0xB45A, +0xC5F6,0xBCEE,0xEDDA,0xCCBC,0xB2EA,0xB45B,0xB45C,0xB45D, +0xB45E,0xEDDB,0xB45F,0xB460,0xB461,0xB462,0xC4EB,0xB463, +0xB464,0xB4C5,0xB465,0xB466,0xB467,0xB0F5,0xB468,0xB469, +0xB46A,0xEDDF,0xC0DA,0xB4E8,0xB46B,0xB46C,0xB46D,0xB46E, +0xC5CD,0xB46F,0xB470,0xB471,0xEDDD,0xBFC4,0xB472,0xB473, +0xB474,0xEDDE,0xB475,0xB476,0xB477,0xB478,0xB479,0xB47A, +0xB47B,0xB47C,0xB47D,0xB47E,0xB480,0xB481,0xB482,0xB483, +0xC4A5,0xB484,0xB485,0xB486,0xEDE0,0xB487,0xB488,0xB489, +0xB48A,0xB48B,0xEDE1,0xB48C,0xEDE3,0xB48D,0xB48E,0xC1D7, +0xB48F,0xB490,0xBBC7,0xB491,0xB492,0xB493,0xB494,0xB495, +0xB496,0xBDB8,0xB497,0xB498,0xB499,0xEDE2,0xB49A,0xB49B, +0xB49C,0xB49D,0xB49E,0xB49F,0xB4A0,0xB540,0xB541,0xB542, +0xB543,0xB544,0xB545,0xEDE4,0xB546,0xB547,0xB548,0xB549, +0xB54A,0xB54B,0xB54C,0xB54D,0xB54E,0xB54F,0xEDE6,0xB550, +0xB551,0xB552,0xB553,0xB554,0xEDE5,0xB555,0xB556,0xB557, +0xB558,0xB559,0xB55A,0xB55B,0xB55C,0xB55D,0xB55E,0xB55F, +0xB560,0xB561,0xB562,0xB563,0xEDE7,0xB564,0xB565,0xB566, +0xB567,0xB568,0xCABE,0xECEA,0xC0F1,0xB569,0xC9E7,0xB56A, +0xECEB,0xC6EE,0xB56B,0xB56C,0xB56D,0xB56E,0xECEC,0xB56F, +0xC6ED,0xECED,0xB570,0xB571,0xB572,0xB573,0xB574,0xB575, +0xB576,0xB577,0xB578,0xECF0,0xB579,0xB57A,0xD7E6,0xECF3, +0xB57B,0xB57C,0xECF1,0xECEE,0xECEF,0xD7A3,0xC9F1,0xCBEE, +0xECF4,0xB57D,0xECF2,0xB57E,0xB580,0xCFE9,0xB581,0xECF6, +0xC6B1,0xB582,0xB583,0xB584,0xB585,0xBCC0,0xB586,0xECF5, +0xB587,0xB588,0xB589,0xB58A,0xB58B,0xB58C,0xB58D,0xB5BB, +0xBBF6,0xB58E,0xECF7,0xB58F,0xB590,0xB591,0xB592,0xB593, +0xD9F7,0xBDFB,0xB594,0xB595,0xC2BB,0xECF8,0xB596,0xB597, +0xB598,0xB599,0xECF9,0xB59A,0xB59B,0xB59C,0xB59D,0xB8A3, +0xB59E,0xB59F,0xB5A0,0xB640,0xB641,0xB642,0xB643,0xB644, +0xB645,0xB646,0xECFA,0xB647,0xB648,0xB649,0xB64A,0xB64B, +0xB64C,0xB64D,0xB64E,0xB64F,0xB650,0xB651,0xB652,0xECFB, +0xB653,0xB654,0xB655,0xB656,0xB657,0xB658,0xB659,0xB65A, +0xB65B,0xB65C,0xB65D,0xECFC,0xB65E,0xB65F,0xB660,0xB661, +0xB662,0xD3ED,0xD8AE,0xC0EB,0xB663,0xC7DD,0xBACC,0xB664, +0xD0E3,0xCBBD,0xB665,0xCDBA,0xB666,0xB667,0xB8D1,0xB668, +0xB669,0xB1FC,0xB66A,0xC7EF,0xB66B,0xD6D6,0xB66C,0xB66D, +0xB66E,0xBFC6,0xC3EB,0xB66F,0xB670,0xEFF5,0xB671,0xB672, +0xC3D8,0xB673,0xB674,0xB675,0xB676,0xB677,0xB678,0xD7E2, +0xB679,0xB67A,0xB67B,0xEFF7,0xB3D3,0xB67C,0xC7D8,0xD1ED, +0xB67D,0xD6C8,0xB67E,0xEFF8,0xB680,0xEFF6,0xB681,0xBBFD, +0xB3C6,0xB682,0xB683,0xB684,0xB685,0xB686,0xB687,0xB688, +0xBDD5,0xB689,0xB68A,0xD2C6,0xB68B,0xBBE0,0xB68C,0xB68D, +0xCFA1,0xB68E,0xEFFC,0xEFFB,0xB68F,0xB690,0xEFF9,0xB691, +0xB692,0xB693,0xB694,0xB3CC,0xB695,0xC9D4,0xCBB0,0xB696, +0xB697,0xB698,0xB699,0xB69A,0xEFFE,0xB69B,0xB69C,0xB0DE, +0xB69D,0xB69E,0xD6C9,0xB69F,0xB6A0,0xB740,0xEFFD,0xB741, +0xB3ED,0xB742,0xB743,0xF6D5,0xB744,0xB745,0xB746,0xB747, +0xB748,0xB749,0xB74A,0xB74B,0xB74C,0xB74D,0xB74E,0xB74F, +0xB750,0xB751,0xB752,0xCEC8,0xB753,0xB754,0xB755,0xF0A2, +0xB756,0xF0A1,0xB757,0xB5BE,0xBCDA,0xBBFC,0xB758,0xB8E5, +0xB759,0xB75A,0xB75B,0xB75C,0xB75D,0xB75E,0xC4C2,0xB75F, +0xB760,0xB761,0xB762,0xB763,0xB764,0xB765,0xB766,0xB767, +0xB768,0xF0A3,0xB769,0xB76A,0xB76B,0xB76C,0xB76D,0xCBEB, +0xB76E,0xB76F,0xB770,0xB771,0xB772,0xB773,0xB774,0xB775, +0xB776,0xB777,0xB778,0xB779,0xB77A,0xB77B,0xB77C,0xB77D, +0xB77E,0xB780,0xB781,0xB782,0xB783,0xB784,0xB785,0xB786, +0xF0A6,0xB787,0xB788,0xB789,0xD1A8,0xB78A,0xBEBF,0xC7EE, +0xF1B6,0xF1B7,0xBFD5,0xB78B,0xB78C,0xB78D,0xB78E,0xB4A9, +0xF1B8,0xCDBB,0xB78F,0xC7D4,0xD5AD,0xB790,0xF1B9,0xB791, +0xF1BA,0xB792,0xB793,0xB794,0xB795,0xC7CF,0xB796,0xB797, +0xB798,0xD2A4,0xD6CF,0xB799,0xB79A,0xF1BB,0xBDD1,0xB4B0, +0xBEBD,0xB79B,0xB79C,0xB79D,0xB4DC,0xCED1,0xB79E,0xBFDF, +0xF1BD,0xB79F,0xB7A0,0xB840,0xB841,0xBFFA,0xF1BC,0xB842, +0xF1BF,0xB843,0xB844,0xB845,0xF1BE,0xF1C0,0xB846,0xB847, +0xB848,0xB849,0xB84A,0xF1C1,0xB84B,0xB84C,0xB84D,0xB84E, +0xB84F,0xB850,0xB851,0xB852,0xB853,0xB854,0xB855,0xC1FE, +0xB856,0xB857,0xB858,0xB859,0xB85A,0xB85B,0xB85C,0xB85D, +0xB85E,0xB85F,0xB860,0xC1A2,0xB861,0xB862,0xB863,0xB864, +0xB865,0xB866,0xB867,0xB868,0xB869,0xB86A,0xCAFA,0xB86B, +0xB86C,0xD5BE,0xB86D,0xB86E,0xB86F,0xB870,0xBEBA,0xBEB9, +0xD5C2,0xB871,0xB872,0xBFA2,0xB873,0xCDAF,0xF1B5,0xB874, +0xB875,0xB876,0xB877,0xB878,0xB879,0xBDDF,0xB87A,0xB6CB, +0xB87B,0xB87C,0xB87D,0xB87E,0xB880,0xB881,0xB882,0xB883, +0xB884,0xD6F1,0xF3C3,0xB885,0xB886,0xF3C4,0xB887,0xB8CD, +0xB888,0xB889,0xB88A,0xF3C6,0xF3C7,0xB88B,0xB0CA,0xB88C, +0xF3C5,0xB88D,0xF3C9,0xCBF1,0xB88E,0xB88F,0xB890,0xF3CB, +0xB891,0xD0A6,0xB892,0xB893,0xB1CA,0xF3C8,0xB894,0xB895, +0xB896,0xF3CF,0xB897,0xB5D1,0xB898,0xB899,0xF3D7,0xB89A, +0xF3D2,0xB89B,0xB89C,0xB89D,0xF3D4,0xF3D3,0xB7FB,0xB89E, +0xB1BF,0xB89F,0xF3CE,0xF3CA,0xB5DA,0xB8A0,0xF3D0,0xB940, +0xB941,0xF3D1,0xB942,0xF3D5,0xB943,0xB944,0xB945,0xB946, +0xF3CD,0xB947,0xBCE3,0xB948,0xC1FD,0xB949,0xF3D6,0xB94A, +0xB94B,0xB94C,0xB94D,0xB94E,0xB94F,0xF3DA,0xB950,0xF3CC, +0xB951,0xB5C8,0xB952,0xBDEE,0xF3DC,0xB953,0xB954,0xB7A4, +0xBFF0,0xD6FE,0xCDB2,0xB955,0xB4F0,0xB956,0xB2DF,0xB957, +0xF3D8,0xB958,0xF3D9,0xC9B8,0xB959,0xF3DD,0xB95A,0xB95B, +0xF3DE,0xB95C,0xF3E1,0xB95D,0xB95E,0xB95F,0xB960,0xB961, +0xB962,0xB963,0xB964,0xB965,0xB966,0xB967,0xF3DF,0xB968, +0xB969,0xF3E3,0xF3E2,0xB96A,0xB96B,0xF3DB,0xB96C,0xBFEA, +0xB96D,0xB3EF,0xB96E,0xF3E0,0xB96F,0xB970,0xC7A9,0xB971, +0xBCF2,0xB972,0xB973,0xB974,0xB975,0xF3EB,0xB976,0xB977, +0xB978,0xB979,0xB97A,0xB97B,0xB97C,0xB9BF,0xB97D,0xB97E, +0xF3E4,0xB980,0xB981,0xB982,0xB2AD,0xBBFE,0xB983,0xCBE3, +0xB984,0xB985,0xB986,0xB987,0xF3ED,0xF3E9,0xB988,0xB989, +0xB98A,0xB9DC,0xF3EE,0xB98B,0xB98C,0xB98D,0xF3E5,0xF3E6, +0xF3EA,0xC2E1,0xF3EC,0xF3EF,0xF3E8,0xBCFD,0xB98E,0xB98F, +0xB990,0xCFE4,0xB991,0xB992,0xF3F0,0xB993,0xB994,0xB995, +0xF3E7,0xB996,0xB997,0xB998,0xB999,0xB99A,0xB99B,0xB99C, +0xB99D,0xF3F2,0xB99E,0xB99F,0xB9A0,0xBA40,0xD7AD,0xC6AA, +0xBA41,0xBA42,0xBA43,0xBA44,0xF3F3,0xBA45,0xBA46,0xBA47, +0xBA48,0xF3F1,0xBA49,0xC2A8,0xBA4A,0xBA4B,0xBA4C,0xBA4D, +0xBA4E,0xB8DD,0xF3F5,0xBA4F,0xBA50,0xF3F4,0xBA51,0xBA52, +0xBA53,0xB4DB,0xBA54,0xBA55,0xBA56,0xF3F6,0xF3F7,0xBA57, +0xBA58,0xBA59,0xF3F8,0xBA5A,0xBA5B,0xBA5C,0xC0BA,0xBA5D, +0xBA5E,0xC0E9,0xBA5F,0xBA60,0xBA61,0xBA62,0xBA63,0xC5F1, +0xBA64,0xBA65,0xBA66,0xBA67,0xF3FB,0xBA68,0xF3FA,0xBA69, +0xBA6A,0xBA6B,0xBA6C,0xBA6D,0xBA6E,0xBA6F,0xBA70,0xB4D8, +0xBA71,0xBA72,0xBA73,0xF3FE,0xF3F9,0xBA74,0xBA75,0xF3FC, +0xBA76,0xBA77,0xBA78,0xBA79,0xBA7A,0xBA7B,0xF3FD,0xBA7C, +0xBA7D,0xBA7E,0xBA80,0xBA81,0xBA82,0xBA83,0xBA84,0xF4A1, +0xBA85,0xBA86,0xBA87,0xBA88,0xBA89,0xBA8A,0xF4A3,0xBBC9, +0xBA8B,0xBA8C,0xF4A2,0xBA8D,0xBA8E,0xBA8F,0xBA90,0xBA91, +0xBA92,0xBA93,0xBA94,0xBA95,0xBA96,0xBA97,0xBA98,0xBA99, +0xF4A4,0xBA9A,0xBA9B,0xBA9C,0xBA9D,0xBA9E,0xBA9F,0xB2BE, +0xF4A6,0xF4A5,0xBAA0,0xBB40,0xBB41,0xBB42,0xBB43,0xBB44, +0xBB45,0xBB46,0xBB47,0xBB48,0xBB49,0xBCAE,0xBB4A,0xBB4B, +0xBB4C,0xBB4D,0xBB4E,0xBB4F,0xBB50,0xBB51,0xBB52,0xBB53, +0xBB54,0xBB55,0xBB56,0xBB57,0xBB58,0xBB59,0xBB5A,0xBB5B, +0xBB5C,0xBB5D,0xBB5E,0xBB5F,0xBB60,0xBB61,0xBB62,0xBB63, +0xBB64,0xBB65,0xBB66,0xBB67,0xBB68,0xBB69,0xBB6A,0xBB6B, +0xBB6C,0xBB6D,0xBB6E,0xC3D7,0xD9E1,0xBB6F,0xBB70,0xBB71, +0xBB72,0xBB73,0xBB74,0xC0E0,0xF4CC,0xD7D1,0xBB75,0xBB76, +0xBB77,0xBB78,0xBB79,0xBB7A,0xBB7B,0xBB7C,0xBB7D,0xBB7E, +0xBB80,0xB7DB,0xBB81,0xBB82,0xBB83,0xBB84,0xBB85,0xBB86, +0xBB87,0xF4CE,0xC1A3,0xBB88,0xBB89,0xC6C9,0xBB8A,0xB4D6, +0xD5B3,0xBB8B,0xBB8C,0xBB8D,0xF4D0,0xF4CF,0xF4D1,0xCBDA, +0xBB8E,0xBB8F,0xF4D2,0xBB90,0xD4C1,0xD6E0,0xBB91,0xBB92, +0xBB93,0xBB94,0xB7E0,0xBB95,0xBB96,0xBB97,0xC1B8,0xBB98, +0xBB99,0xC1BB,0xF4D3,0xBEAC,0xBB9A,0xBB9B,0xBB9C,0xBB9D, +0xBB9E,0xB4E2,0xBB9F,0xBBA0,0xF4D4,0xF4D5,0xBEAB,0xBC40, +0xBC41,0xF4D6,0xBC42,0xBC43,0xBC44,0xF4DB,0xBC45,0xF4D7, +0xF4DA,0xBC46,0xBAFD,0xBC47,0xF4D8,0xF4D9,0xBC48,0xBC49, +0xBC4A,0xBC4B,0xBC4C,0xBC4D,0xBC4E,0xB8E2,0xCCC7,0xF4DC, +0xBC4F,0xB2DA,0xBC50,0xBC51,0xC3D3,0xBC52,0xBC53,0xD4E3, +0xBFB7,0xBC54,0xBC55,0xBC56,0xBC57,0xBC58,0xBC59,0xBC5A, +0xF4DD,0xBC5B,0xBC5C,0xBC5D,0xBC5E,0xBC5F,0xBC60,0xC5B4, +0xBC61,0xBC62,0xBC63,0xBC64,0xBC65,0xBC66,0xBC67,0xBC68, +0xF4E9,0xBC69,0xBC6A,0xCFB5,0xBC6B,0xBC6C,0xBC6D,0xBC6E, +0xBC6F,0xBC70,0xBC71,0xBC72,0xBC73,0xBC74,0xBC75,0xBC76, +0xBC77,0xBC78,0xCEC9,0xBC79,0xBC7A,0xBC7B,0xBC7C,0xBC7D, +0xBC7E,0xBC80,0xBC81,0xBC82,0xBC83,0xBC84,0xBC85,0xBC86, +0xBC87,0xBC88,0xBC89,0xBC8A,0xBC8B,0xBC8C,0xBC8D,0xBC8E, +0xCBD8,0xBC8F,0xCBF7,0xBC90,0xBC91,0xBC92,0xBC93,0xBDF4, +0xBC94,0xBC95,0xBC96,0xD7CF,0xBC97,0xBC98,0xBC99,0xC0DB, +0xBC9A,0xBC9B,0xBC9C,0xBC9D,0xBC9E,0xBC9F,0xBCA0,0xBD40, +0xBD41,0xBD42,0xBD43,0xBD44,0xBD45,0xBD46,0xBD47,0xBD48, +0xBD49,0xBD4A,0xBD4B,0xBD4C,0xBD4D,0xBD4E,0xBD4F,0xBD50, +0xBD51,0xBD52,0xBD53,0xBD54,0xBD55,0xBD56,0xBD57,0xBD58, +0xBD59,0xBD5A,0xBD5B,0xBD5C,0xBD5D,0xBD5E,0xBD5F,0xBD60, +0xBD61,0xBD62,0xBD63,0xBD64,0xBD65,0xBD66,0xBD67,0xBD68, +0xBD69,0xBD6A,0xBD6B,0xBD6C,0xBD6D,0xBD6E,0xBD6F,0xBD70, +0xBD71,0xBD72,0xBD73,0xBD74,0xBD75,0xBD76,0xD0F5,0xBD77, +0xBD78,0xBD79,0xBD7A,0xBD7B,0xBD7C,0xBD7D,0xBD7E,0xF4EA, +0xBD80,0xBD81,0xBD82,0xBD83,0xBD84,0xBD85,0xBD86,0xBD87, +0xBD88,0xBD89,0xBD8A,0xBD8B,0xBD8C,0xBD8D,0xBD8E,0xBD8F, +0xBD90,0xBD91,0xBD92,0xBD93,0xBD94,0xBD95,0xBD96,0xBD97, +0xBD98,0xBD99,0xBD9A,0xBD9B,0xBD9C,0xBD9D,0xBD9E,0xBD9F, +0xBDA0,0xBE40,0xBE41,0xBE42,0xBE43,0xBE44,0xBE45,0xBE46, +0xBE47,0xBE48,0xBE49,0xBE4A,0xBE4B,0xBE4C,0xF4EB,0xBE4D, +0xBE4E,0xBE4F,0xBE50,0xBE51,0xBE52,0xBE53,0xF4EC,0xBE54, +0xBE55,0xBE56,0xBE57,0xBE58,0xBE59,0xBE5A,0xBE5B,0xBE5C, +0xBE5D,0xBE5E,0xBE5F,0xBE60,0xBE61,0xBE62,0xBE63,0xBE64, +0xBE65,0xBE66,0xBE67,0xBE68,0xBE69,0xBE6A,0xBE6B,0xBE6C, +0xBE6D,0xBE6E,0xBE6F,0xBE70,0xBE71,0xBE72,0xBE73,0xBE74, +0xBE75,0xBE76,0xBE77,0xBE78,0xBE79,0xBE7A,0xBE7B,0xBE7C, +0xBE7D,0xBE7E,0xBE80,0xBE81,0xBE82,0xBE83,0xBE84,0xBE85, +0xBE86,0xBE87,0xBE88,0xBE89,0xBE8A,0xBE8B,0xBE8C,0xBE8D, +0xBE8E,0xBE8F,0xBE90,0xBE91,0xBE92,0xBE93,0xBE94,0xBE95, +0xBE96,0xBE97,0xBE98,0xBE99,0xBE9A,0xBE9B,0xBE9C,0xBE9D, +0xBE9E,0xBE9F,0xBEA0,0xBF40,0xBF41,0xBF42,0xBF43,0xBF44, +0xBF45,0xBF46,0xBF47,0xBF48,0xBF49,0xBF4A,0xBF4B,0xBF4C, +0xBF4D,0xBF4E,0xBF4F,0xBF50,0xBF51,0xBF52,0xBF53,0xBF54, +0xBF55,0xBF56,0xBF57,0xBF58,0xBF59,0xBF5A,0xBF5B,0xBF5C, +0xBF5D,0xBF5E,0xBF5F,0xBF60,0xBF61,0xBF62,0xBF63,0xBF64, +0xBF65,0xBF66,0xBF67,0xBF68,0xBF69,0xBF6A,0xBF6B,0xBF6C, +0xBF6D,0xBF6E,0xBF6F,0xBF70,0xBF71,0xBF72,0xBF73,0xBF74, +0xBF75,0xBF76,0xBF77,0xBF78,0xBF79,0xBF7A,0xBF7B,0xBF7C, +0xBF7D,0xBF7E,0xBF80,0xF7E3,0xBF81,0xBF82,0xBF83,0xBF84, +0xBF85,0xB7B1,0xBF86,0xBF87,0xBF88,0xBF89,0xBF8A,0xF4ED, +0xBF8B,0xBF8C,0xBF8D,0xBF8E,0xBF8F,0xBF90,0xBF91,0xBF92, +0xBF93,0xBF94,0xBF95,0xBF96,0xBF97,0xBF98,0xBF99,0xBF9A, +0xBF9B,0xBF9C,0xBF9D,0xBF9E,0xBF9F,0xBFA0,0xC040,0xC041, +0xC042,0xC043,0xC044,0xC045,0xC046,0xC047,0xC048,0xC049, +0xC04A,0xC04B,0xC04C,0xC04D,0xC04E,0xC04F,0xC050,0xC051, +0xC052,0xC053,0xC054,0xC055,0xC056,0xC057,0xC058,0xC059, +0xC05A,0xC05B,0xC05C,0xC05D,0xC05E,0xC05F,0xC060,0xC061, +0xC062,0xC063,0xD7EB,0xC064,0xC065,0xC066,0xC067,0xC068, +0xC069,0xC06A,0xC06B,0xC06C,0xC06D,0xC06E,0xC06F,0xC070, +0xC071,0xC072,0xC073,0xC074,0xC075,0xC076,0xC077,0xC078, +0xC079,0xC07A,0xC07B,0xF4EE,0xC07C,0xC07D,0xC07E,0xE6F9, +0xBEC0,0xE6FA,0xBAEC,0xE6FB,0xCFCB,0xE6FC,0xD4BC,0xBCB6, +0xE6FD,0xE6FE,0xBCCD,0xC8D2,0xCEB3,0xE7A1,0xC080,0xB4BF, +0xE7A2,0xC9B4,0xB8D9,0xC4C9,0xC081,0xD7DD,0xC2DA,0xB7D7, +0xD6BD,0xCEC6,0xB7C4,0xC082,0xC083,0xC5A6,0xE7A3,0xCFDF, +0xE7A4,0xE7A5,0xE7A6,0xC1B7,0xD7E9,0xC9F0,0xCFB8,0xD6AF, +0xD6D5,0xE7A7,0xB0ED,0xE7A8,0xE7A9,0xC9DC,0xD2EF,0xBEAD, +0xE7AA,0xB0F3,0xC8DE,0xBDE1,0xE7AB,0xC8C6,0xC084,0xE7AC, +0xBBE6,0xB8F8,0xD1A4,0xE7AD,0xC2E7,0xBEF8,0xBDCA,0xCDB3, +0xE7AE,0xE7AF,0xBEEE,0xD0E5,0xC085,0xCBE7,0xCCD0,0xBCCC, +0xE7B0,0xBCA8,0xD0F7,0xE7B1,0xC086,0xD0F8,0xE7B2,0xE7B3, +0xB4C2,0xE7B4,0xE7B5,0xC9FE,0xCEAC,0xC3E0,0xE7B7,0xB1C1, +0xB3F1,0xC087,0xE7B8,0xE7B9,0xD7DB,0xD5C0,0xE7BA,0xC2CC, +0xD7BA,0xE7BB,0xE7BC,0xE7BD,0xBCEA,0xC3E5,0xC0C2,0xE7BE, +0xE7BF,0xBCA9,0xC088,0xE7C0,0xE7C1,0xE7B6,0xB6D0,0xE7C2, +0xC089,0xE7C3,0xE7C4,0xBBBA,0xB5DE,0xC2C6,0xB1E0,0xE7C5, +0xD4B5,0xE7C6,0xB8BF,0xE7C8,0xE7C7,0xB7EC,0xC08A,0xE7C9, +0xB2F8,0xE7CA,0xE7CB,0xE7CC,0xE7CD,0xE7CE,0xE7CF,0xE7D0, +0xD3A7,0xCBF5,0xE7D1,0xE7D2,0xE7D3,0xE7D4,0xC9C9,0xE7D5, +0xE7D6,0xE7D7,0xE7D8,0xE7D9,0xBDC9,0xE7DA,0xF3BE,0xC08B, +0xB8D7,0xC08C,0xC8B1,0xC08D,0xC08E,0xC08F,0xC090,0xC091, +0xC092,0xC093,0xF3BF,0xC094,0xF3C0,0xF3C1,0xC095,0xC096, +0xC097,0xC098,0xC099,0xC09A,0xC09B,0xC09C,0xC09D,0xC09E, +0xB9DE,0xCDF8,0xC09F,0xC0A0,0xD8E8,0xBAB1,0xC140,0xC2DE, +0xEEB7,0xC141,0xB7A3,0xC142,0xC143,0xC144,0xC145,0xEEB9, +0xC146,0xEEB8,0xB0D5,0xC147,0xC148,0xC149,0xC14A,0xC14B, +0xEEBB,0xD5D6,0xD7EF,0xC14C,0xC14D,0xC14E,0xD6C3,0xC14F, +0xC150,0xEEBD,0xCAF0,0xC151,0xEEBC,0xC152,0xC153,0xC154, +0xC155,0xEEBE,0xC156,0xC157,0xC158,0xC159,0xEEC0,0xC15A, +0xC15B,0xEEBF,0xC15C,0xC15D,0xC15E,0xC15F,0xC160,0xC161, +0xC162,0xC163,0xD1F2,0xC164,0xC7BC,0xC165,0xC3C0,0xC166, +0xC167,0xC168,0xC169,0xC16A,0xB8E1,0xC16B,0xC16C,0xC16D, +0xC16E,0xC16F,0xC1E7,0xC170,0xC171,0xF4C6,0xD0DF,0xF4C7, +0xC172,0xCFDB,0xC173,0xC174,0xC8BA,0xC175,0xC176,0xF4C8, +0xC177,0xC178,0xC179,0xC17A,0xC17B,0xC17C,0xC17D,0xF4C9, +0xF4CA,0xC17E,0xF4CB,0xC180,0xC181,0xC182,0xC183,0xC184, +0xD9FA,0xB8FE,0xC185,0xC186,0xE5F1,0xD3F0,0xC187,0xF4E0, +0xC188,0xCECC,0xC189,0xC18A,0xC18B,0xB3E1,0xC18C,0xC18D, +0xC18E,0xC18F,0xF1B4,0xC190,0xD2EE,0xC191,0xF4E1,0xC192, +0xC193,0xC194,0xC195,0xC196,0xCFE8,0xF4E2,0xC197,0xC198, +0xC7CC,0xC199,0xC19A,0xC19B,0xC19C,0xC19D,0xC19E,0xB5D4, +0xB4E4,0xF4E4,0xC19F,0xC1A0,0xC240,0xF4E3,0xF4E5,0xC241, +0xC242,0xF4E6,0xC243,0xC244,0xC245,0xC246,0xF4E7,0xC247, +0xBAB2,0xB0BF,0xC248,0xF4E8,0xC249,0xC24A,0xC24B,0xC24C, +0xC24D,0xC24E,0xC24F,0xB7AD,0xD2ED,0xC250,0xC251,0xC252, +0xD2AB,0xC0CF,0xC253,0xBFBC,0xEBA3,0xD5DF,0xEAC8,0xC254, +0xC255,0xC256,0xC257,0xF1F3,0xB6F8,0xCBA3,0xC258,0xC259, +0xC4CD,0xC25A,0xF1E7,0xC25B,0xF1E8,0xB8FB,0xF1E9,0xBAC4, +0xD4C5,0xB0D2,0xC25C,0xC25D,0xF1EA,0xC25E,0xC25F,0xC260, +0xF1EB,0xC261,0xF1EC,0xC262,0xC263,0xF1ED,0xF1EE,0xF1EF, +0xF1F1,0xF1F0,0xC5D5,0xC264,0xC265,0xC266,0xC267,0xC268, +0xC269,0xF1F2,0xC26A,0xB6FA,0xC26B,0xF1F4,0xD2AE,0xDEC7, +0xCBCA,0xC26C,0xC26D,0xB3DC,0xC26E,0xB5A2,0xC26F,0xB9A2, +0xC270,0xC271,0xC4F4,0xF1F5,0xC272,0xC273,0xF1F6,0xC274, +0xC275,0xC276,0xC1C4,0xC1FB,0xD6B0,0xF1F7,0xC277,0xC278, +0xC279,0xC27A,0xF1F8,0xC27B,0xC1AA,0xC27C,0xC27D,0xC27E, +0xC6B8,0xC280,0xBEDB,0xC281,0xC282,0xC283,0xC284,0xC285, +0xC286,0xC287,0xC288,0xC289,0xC28A,0xC28B,0xC28C,0xC28D, +0xC28E,0xF1F9,0xB4CF,0xC28F,0xC290,0xC291,0xC292,0xC293, +0xC294,0xF1FA,0xC295,0xC296,0xC297,0xC298,0xC299,0xC29A, +0xC29B,0xC29C,0xC29D,0xC29E,0xC29F,0xC2A0,0xC340,0xEDB2, +0xEDB1,0xC341,0xC342,0xCBE0,0xD2DE,0xC343,0xCBC1,0xD5D8, +0xC344,0xC8E2,0xC345,0xC0DF,0xBCA1,0xC346,0xC347,0xC348, +0xC349,0xC34A,0xC34B,0xEBC1,0xC34C,0xC34D,0xD0A4,0xC34E, +0xD6E2,0xC34F,0xB6C7,0xB8D8,0xEBC0,0xB8CE,0xC350,0xEBBF, +0xB3A6,0xB9C9,0xD6AB,0xC351,0xB7F4,0xB7CA,0xC352,0xC353, +0xC354,0xBCE7,0xB7BE,0xEBC6,0xC355,0xEBC7,0xB0B9,0xBFCF, +0xC356,0xEBC5,0xD3FD,0xC357,0xEBC8,0xC358,0xC359,0xEBC9, +0xC35A,0xC35B,0xB7CE,0xC35C,0xEBC2,0xEBC4,0xC9F6,0xD6D7, +0xD5CD,0xD0B2,0xEBCF,0xCEB8,0xEBD0,0xC35D,0xB5A8,0xC35E, +0xC35F,0xC360,0xC361,0xC362,0xB1B3,0xEBD2,0xCCA5,0xC363, +0xC364,0xC365,0xC366,0xC367,0xC368,0xC369,0xC5D6,0xEBD3, +0xC36A,0xEBD1,0xC5DF,0xEBCE,0xCAA4,0xEBD5,0xB0FB,0xC36B, +0xC36C,0xBAFA,0xC36D,0xC36E,0xD8B7,0xF1E3,0xC36F,0xEBCA, +0xEBCB,0xEBCC,0xEBCD,0xEBD6,0xE6C0,0xEBD9,0xC370,0xBFE8, +0xD2C8,0xEBD7,0xEBDC,0xB8EC,0xEBD8,0xC371,0xBDBA,0xC372, +0xD0D8,0xC373,0xB0B7,0xC374,0xEBDD,0xC4DC,0xC375,0xC376, +0xC377,0xC378,0xD6AC,0xC379,0xC37A,0xC37B,0xB4E0,0xC37C, +0xC37D,0xC2F6,0xBCB9,0xC37E,0xC380,0xEBDA,0xEBDB,0xD4E0, +0xC6EA,0xC4D4,0xEBDF,0xC5A7,0xD9F5,0xC381,0xB2B1,0xC382, +0xEBE4,0xC383,0xBDC5,0xC384,0xC385,0xC386,0xEBE2,0xC387, +0xC388,0xC389,0xC38A,0xC38B,0xC38C,0xC38D,0xC38E,0xC38F, +0xC390,0xC391,0xC392,0xC393,0xEBE3,0xC394,0xC395,0xB8AC, +0xC396,0xCDD1,0xEBE5,0xC397,0xC398,0xC399,0xEBE1,0xC39A, +0xC1B3,0xC39B,0xC39C,0xC39D,0xC39E,0xC39F,0xC6A2,0xC3A0, +0xC440,0xC441,0xC442,0xC443,0xC444,0xC445,0xCCF3,0xC446, +0xEBE6,0xC447,0xC0B0,0xD2B8,0xEBE7,0xC448,0xC449,0xC44A, +0xB8AF,0xB8AD,0xC44B,0xEBE8,0xC7BB,0xCDF3,0xC44C,0xC44D, +0xC44E,0xEBEA,0xEBEB,0xC44F,0xC450,0xC451,0xC452,0xC453, +0xEBED,0xC454,0xC455,0xC456,0xC457,0xD0C8,0xC458,0xEBF2, +0xC459,0xEBEE,0xC45A,0xC45B,0xC45C,0xEBF1,0xC8F9,0xC45D, +0xD1FC,0xEBEC,0xC45E,0xC45F,0xEBE9,0xC460,0xC461,0xC462, +0xC463,0xB8B9,0xCFD9,0xC4E5,0xEBEF,0xEBF0,0xCCDA,0xCDC8, +0xB0F2,0xC464,0xEBF6,0xC465,0xC466,0xC467,0xC468,0xC469, +0xEBF5,0xC46A,0xB2B2,0xC46B,0xC46C,0xC46D,0xC46E,0xB8E0, +0xC46F,0xEBF7,0xC470,0xC471,0xC472,0xC473,0xC474,0xC475, +0xB1EC,0xC476,0xC477,0xCCC5,0xC4A4,0xCFA5,0xC478,0xC479, +0xC47A,0xC47B,0xC47C,0xEBF9,0xC47D,0xC47E,0xECA2,0xC480, +0xC5F2,0xC481,0xEBFA,0xC482,0xC483,0xC484,0xC485,0xC486, +0xC487,0xC488,0xC489,0xC9C5,0xC48A,0xC48B,0xC48C,0xC48D, +0xC48E,0xC48F,0xE2DF,0xEBFE,0xC490,0xC491,0xC492,0xC493, +0xCDCE,0xECA1,0xB1DB,0xD3B7,0xC494,0xC495,0xD2DC,0xC496, +0xC497,0xC498,0xEBFD,0xC499,0xEBFB,0xC49A,0xC49B,0xC49C, +0xC49D,0xC49E,0xC49F,0xC4A0,0xC540,0xC541,0xC542,0xC543, +0xC544,0xC545,0xC546,0xC547,0xC548,0xC549,0xC54A,0xC54B, +0xC54C,0xC54D,0xC54E,0xB3BC,0xC54F,0xC550,0xC551,0xEAB0, +0xC552,0xC553,0xD7D4,0xC554,0xF4AB,0xB3F4,0xC555,0xC556, +0xC557,0xC558,0xC559,0xD6C1,0xD6C2,0xC55A,0xC55B,0xC55C, +0xC55D,0xC55E,0xC55F,0xD5E9,0xBECA,0xC560,0xF4A7,0xC561, +0xD2A8,0xF4A8,0xF4A9,0xC562,0xF4AA,0xBECB,0xD3DF,0xC563, +0xC564,0xC565,0xC566,0xC567,0xC9E0,0xC9E1,0xC568,0xC569, +0xF3C2,0xC56A,0xCAE6,0xC56B,0xCCF2,0xC56C,0xC56D,0xC56E, +0xC56F,0xC570,0xC571,0xE2B6,0xCBB4,0xC572,0xCEE8,0xD6DB, +0xC573,0xF4AD,0xF4AE,0xF4AF,0xC574,0xC575,0xC576,0xC577, +0xF4B2,0xC578,0xBABD,0xF4B3,0xB0E3,0xF4B0,0xC579,0xF4B1, +0xBDA2,0xB2D5,0xC57A,0xF4B6,0xF4B7,0xB6E6,0xB2B0,0xCFCF, +0xF4B4,0xB4AC,0xC57B,0xF4B5,0xC57C,0xC57D,0xF4B8,0xC57E, +0xC580,0xC581,0xC582,0xC583,0xF4B9,0xC584,0xC585,0xCDA7, +0xC586,0xF4BA,0xC587,0xF4BB,0xC588,0xC589,0xC58A,0xF4BC, +0xC58B,0xC58C,0xC58D,0xC58E,0xC58F,0xC590,0xC591,0xC592, +0xCBD2,0xC593,0xF4BD,0xC594,0xC595,0xC596,0xC597,0xF4BE, +0xC598,0xC599,0xC59A,0xC59B,0xC59C,0xC59D,0xC59E,0xC59F, +0xF4BF,0xC5A0,0xC640,0xC641,0xC642,0xC643,0xF4DE,0xC1BC, +0xBCE8,0xC644,0xC9AB,0xD1DE,0xE5F5,0xC645,0xC646,0xC647, +0xC648,0xDCB3,0xD2D5,0xC649,0xC64A,0xDCB4,0xB0AC,0xDCB5, +0xC64B,0xC64C,0xBDDA,0xC64D,0xDCB9,0xC64E,0xC64F,0xC650, +0xD8C2,0xC651,0xDCB7,0xD3F3,0xC652,0xC9D6,0xDCBA,0xDCB6, +0xC653,0xDCBB,0xC3A2,0xC654,0xC655,0xC656,0xC657,0xDCBC, +0xDCC5,0xDCBD,0xC658,0xC659,0xCEDF,0xD6A5,0xC65A,0xDCCF, +0xC65B,0xDCCD,0xC65C,0xC65D,0xDCD2,0xBDE6,0xC2AB,0xC65E, +0xDCB8,0xDCCB,0xDCCE,0xDCBE,0xB7D2,0xB0C5,0xDCC7,0xD0BE, +0xDCC1,0xBBA8,0xC65F,0xB7BC,0xDCCC,0xC660,0xC661,0xDCC6, +0xDCBF,0xC7DB,0xC662,0xC663,0xC664,0xD1BF,0xDCC0,0xC665, +0xC666,0xDCCA,0xC667,0xC668,0xDCD0,0xC669,0xC66A,0xCEAD, +0xDCC2,0xC66B,0xDCC3,0xDCC8,0xDCC9,0xB2D4,0xDCD1,0xCBD5, +0xC66C,0xD4B7,0xDCDB,0xDCDF,0xCCA6,0xDCE6,0xC66D,0xC3E7, +0xDCDC,0xC66E,0xC66F,0xBFC1,0xDCD9,0xC670,0xB0FA,0xB9B6, +0xDCE5,0xDCD3,0xC671,0xDCC4,0xDCD6,0xC8F4,0xBFE0,0xC672, +0xC673,0xC674,0xC675,0xC9BB,0xC676,0xC677,0xC678,0xB1BD, +0xC679,0xD3A2,0xC67A,0xC67B,0xDCDA,0xC67C,0xC67D,0xDCD5, +0xC67E,0xC6BB,0xC680,0xDCDE,0xC681,0xC682,0xC683,0xC684, +0xC685,0xD7C2,0xC3AF,0xB7B6,0xC7D1,0xC3A9,0xDCE2,0xDCD8, +0xDCEB,0xDCD4,0xC686,0xC687,0xDCDD,0xC688,0xBEA5,0xDCD7, +0xC689,0xDCE0,0xC68A,0xC68B,0xDCE3,0xDCE4,0xC68C,0xDCF8, +0xC68D,0xC68E,0xDCE1,0xDDA2,0xDCE7,0xC68F,0xC690,0xC691, +0xC692,0xC693,0xC694,0xC695,0xC696,0xC697,0xC698,0xBCEB, +0xB4C4,0xC699,0xC69A,0xC3A3,0xB2E7,0xDCFA,0xC69B,0xDCF2, +0xC69C,0xDCEF,0xC69D,0xDCFC,0xDCEE,0xD2F0,0xB2E8,0xC69E, +0xC8D7,0xC8E3,0xDCFB,0xC69F,0xDCED,0xC6A0,0xC740,0xC741, +0xDCF7,0xC742,0xC743,0xDCF5,0xC744,0xC745,0xBEA3,0xDCF4, +0xC746,0xB2DD,0xC747,0xC748,0xC749,0xC74A,0xC74B,0xDCF3, +0xBCF6,0xDCE8,0xBBC4,0xC74C,0xC0F3,0xC74D,0xC74E,0xC74F, +0xC750,0xC751,0xBCD4,0xDCE9,0xDCEA,0xC752,0xDCF1,0xDCF6, +0xDCF9,0xB5B4,0xC753,0xC8D9,0xBBE7,0xDCFE,0xDCFD,0xD3AB, +0xDDA1,0xDDA3,0xDDA5,0xD2F1,0xDDA4,0xDDA6,0xDDA7,0xD2A9, +0xC754,0xC755,0xC756,0xC757,0xC758,0xC759,0xC75A,0xBAC9, +0xDDA9,0xC75B,0xC75C,0xDDB6,0xDDB1,0xDDB4,0xC75D,0xC75E, +0xC75F,0xC760,0xC761,0xC762,0xC763,0xDDB0,0xC6CE,0xC764, +0xC765,0xC0F2,0xC766,0xC767,0xC768,0xC769,0xC9AF,0xC76A, +0xC76B,0xC76C,0xDCEC,0xDDAE,0xC76D,0xC76E,0xC76F,0xC770, +0xDDB7,0xC771,0xC772,0xDCF0,0xDDAF,0xC773,0xDDB8,0xC774, +0xDDAC,0xC775,0xC776,0xC777,0xC778,0xC779,0xC77A,0xC77B, +0xDDB9,0xDDB3,0xDDAD,0xC4AA,0xC77C,0xC77D,0xC77E,0xC780, +0xDDA8,0xC0B3,0xC1AB,0xDDAA,0xDDAB,0xC781,0xDDB2,0xBBF1, +0xDDB5,0xD3A8,0xDDBA,0xC782,0xDDBB,0xC3A7,0xC783,0xC784, +0xDDD2,0xDDBC,0xC785,0xC786,0xC787,0xDDD1,0xC788,0xB9BD, +0xC789,0xC78A,0xBED5,0xC78B,0xBEFA,0xC78C,0xC78D,0xBACA, +0xC78E,0xC78F,0xC790,0xC791,0xDDCA,0xC792,0xDDC5,0xC793, +0xDDBF,0xC794,0xC795,0xC796,0xB2CB,0xDDC3,0xC797,0xDDCB, +0xB2A4,0xDDD5,0xC798,0xC799,0xC79A,0xDDBE,0xC79B,0xC79C, +0xC79D,0xC6D0,0xDDD0,0xC79E,0xC79F,0xC7A0,0xC840,0xC841, +0xDDD4,0xC1E2,0xB7C6,0xC842,0xC843,0xC844,0xC845,0xC846, +0xDDCE,0xDDCF,0xC847,0xC848,0xC849,0xDDC4,0xC84A,0xC84B, +0xC84C,0xDDBD,0xC84D,0xDDCD,0xCCD1,0xC84E,0xDDC9,0xC84F, +0xC850,0xC851,0xC852,0xDDC2,0xC3C8,0xC6BC,0xCEAE,0xDDCC, +0xC853,0xDDC8,0xC854,0xC855,0xC856,0xC857,0xC858,0xC859, +0xDDC1,0xC85A,0xC85B,0xC85C,0xDDC6,0xC2DC,0xC85D,0xC85E, +0xC85F,0xC860,0xC861,0xC862,0xD3A9,0xD3AA,0xDDD3,0xCFF4, +0xC8F8,0xC863,0xC864,0xC865,0xC866,0xC867,0xC868,0xC869, +0xC86A,0xDDE6,0xC86B,0xC86C,0xC86D,0xC86E,0xC86F,0xC870, +0xDDC7,0xC871,0xC872,0xC873,0xDDE0,0xC2E4,0xC874,0xC875, +0xC876,0xC877,0xC878,0xC879,0xC87A,0xC87B,0xDDE1,0xC87C, +0xC87D,0xC87E,0xC880,0xC881,0xC882,0xC883,0xC884,0xC885, +0xC886,0xDDD7,0xC887,0xC888,0xC889,0xC88A,0xC88B,0xD6F8, +0xC88C,0xDDD9,0xDDD8,0xB8F0,0xDDD6,0xC88D,0xC88E,0xC88F, +0xC890,0xC6CF,0xC891,0xB6AD,0xC892,0xC893,0xC894,0xC895, +0xC896,0xDDE2,0xC897,0xBAF9,0xD4E1,0xDDE7,0xC898,0xC899, +0xC89A,0xB4D0,0xC89B,0xDDDA,0xC89C,0xBFFB,0xDDE3,0xC89D, +0xDDDF,0xC89E,0xDDDD,0xC89F,0xC8A0,0xC940,0xC941,0xC942, +0xC943,0xC944,0xB5D9,0xC945,0xC946,0xC947,0xC948,0xDDDB, +0xDDDC,0xDDDE,0xC949,0xBDAF,0xDDE4,0xC94A,0xDDE5,0xC94B, +0xC94C,0xC94D,0xC94E,0xC94F,0xC950,0xC951,0xC952,0xDDF5, +0xC953,0xC3C9,0xC954,0xC955,0xCBE2,0xC956,0xC957,0xC958, +0xC959,0xDDF2,0xC95A,0xC95B,0xC95C,0xC95D,0xC95E,0xC95F, +0xC960,0xC961,0xC962,0xC963,0xC964,0xC965,0xC966,0xD8E1, +0xC967,0xC968,0xC6D1,0xC969,0xDDF4,0xC96A,0xC96B,0xC96C, +0xD5F4,0xDDF3,0xDDF0,0xC96D,0xC96E,0xDDEC,0xC96F,0xDDEF, +0xC970,0xDDE8,0xC971,0xC972,0xD0EE,0xC973,0xC974,0xC975, +0xC976,0xC8D8,0xDDEE,0xC977,0xC978,0xDDE9,0xC979,0xC97A, +0xDDEA,0xCBF2,0xC97B,0xDDED,0xC97C,0xC97D,0xB1CD,0xC97E, +0xC980,0xC981,0xC982,0xC983,0xC984,0xC0B6,0xC985,0xBCBB, +0xDDF1,0xC986,0xC987,0xDDF7,0xC988,0xDDF6,0xDDEB,0xC989, +0xC98A,0xC98B,0xC98C,0xC98D,0xC5EE,0xC98E,0xC98F,0xC990, +0xDDFB,0xC991,0xC992,0xC993,0xC994,0xC995,0xC996,0xC997, +0xC998,0xC999,0xC99A,0xC99B,0xDEA4,0xC99C,0xC99D,0xDEA3, +0xC99E,0xC99F,0xC9A0,0xCA40,0xCA41,0xCA42,0xCA43,0xCA44, +0xCA45,0xCA46,0xCA47,0xCA48,0xDDF8,0xCA49,0xCA4A,0xCA4B, +0xCA4C,0xC3EF,0xCA4D,0xC2FB,0xCA4E,0xCA4F,0xCA50,0xD5E1, +0xCA51,0xCA52,0xCEB5,0xCA53,0xCA54,0xCA55,0xCA56,0xDDFD, +0xCA57,0xB2CC,0xCA58,0xCA59,0xCA5A,0xCA5B,0xCA5C,0xCA5D, +0xCA5E,0xCA5F,0xCA60,0xC4E8,0xCADF,0xCA61,0xCA62,0xCA63, +0xCA64,0xCA65,0xCA66,0xCA67,0xCA68,0xCA69,0xCA6A,0xC7BE, +0xDDFA,0xDDFC,0xDDFE,0xDEA2,0xB0AA,0xB1CE,0xCA6B,0xCA6C, +0xCA6D,0xCA6E,0xCA6F,0xDEAC,0xCA70,0xCA71,0xCA72,0xCA73, +0xDEA6,0xBDB6,0xC8EF,0xCA74,0xCA75,0xCA76,0xCA77,0xCA78, +0xCA79,0xCA7A,0xCA7B,0xCA7C,0xCA7D,0xCA7E,0xDEA1,0xCA80, +0xCA81,0xDEA5,0xCA82,0xCA83,0xCA84,0xCA85,0xDEA9,0xCA86, +0xCA87,0xCA88,0xCA89,0xCA8A,0xDEA8,0xCA8B,0xCA8C,0xCA8D, +0xDEA7,0xCA8E,0xCA8F,0xCA90,0xCA91,0xCA92,0xCA93,0xCA94, +0xCA95,0xCA96,0xDEAD,0xCA97,0xD4CC,0xCA98,0xCA99,0xCA9A, +0xCA9B,0xDEB3,0xDEAA,0xDEAE,0xCA9C,0xCA9D,0xC0D9,0xCA9E, +0xCA9F,0xCAA0,0xCB40,0xCB41,0xB1A1,0xDEB6,0xCB42,0xDEB1, +0xCB43,0xCB44,0xCB45,0xCB46,0xCB47,0xCB48,0xCB49,0xDEB2, +0xCB4A,0xCB4B,0xCB4C,0xCB4D,0xCB4E,0xCB4F,0xCB50,0xCB51, +0xCB52,0xCB53,0xCB54,0xD1A6,0xDEB5,0xCB55,0xCB56,0xCB57, +0xCB58,0xCB59,0xCB5A,0xCB5B,0xDEAF,0xCB5C,0xCB5D,0xCB5E, +0xDEB0,0xCB5F,0xD0BD,0xCB60,0xCB61,0xCB62,0xDEB4,0xCAED, +0xDEB9,0xCB63,0xCB64,0xCB65,0xCB66,0xCB67,0xCB68,0xDEB8, +0xCB69,0xDEB7,0xCB6A,0xCB6B,0xCB6C,0xCB6D,0xCB6E,0xCB6F, +0xCB70,0xDEBB,0xCB71,0xCB72,0xCB73,0xCB74,0xCB75,0xCB76, +0xCB77,0xBDE5,0xCB78,0xCB79,0xCB7A,0xCB7B,0xCB7C,0xB2D8, +0xC3EA,0xCB7D,0xCB7E,0xDEBA,0xCB80,0xC5BA,0xCB81,0xCB82, +0xCB83,0xCB84,0xCB85,0xCB86,0xDEBC,0xCB87,0xCB88,0xCB89, +0xCB8A,0xCB8B,0xCB8C,0xCB8D,0xCCD9,0xCB8E,0xCB8F,0xCB90, +0xCB91,0xB7AA,0xCB92,0xCB93,0xCB94,0xCB95,0xCB96,0xCB97, +0xCB98,0xCB99,0xCB9A,0xCB9B,0xCB9C,0xCB9D,0xCB9E,0xCB9F, +0xCBA0,0xCC40,0xCC41,0xD4E5,0xCC42,0xCC43,0xCC44,0xDEBD, +0xCC45,0xCC46,0xCC47,0xCC48,0xCC49,0xDEBF,0xCC4A,0xCC4B, +0xCC4C,0xCC4D,0xCC4E,0xCC4F,0xCC50,0xCC51,0xCC52,0xCC53, +0xCC54,0xC4A2,0xCC55,0xCC56,0xCC57,0xCC58,0xDEC1,0xCC59, +0xCC5A,0xCC5B,0xCC5C,0xCC5D,0xCC5E,0xCC5F,0xCC60,0xCC61, +0xCC62,0xCC63,0xCC64,0xCC65,0xCC66,0xCC67,0xCC68,0xDEBE, +0xCC69,0xDEC0,0xCC6A,0xCC6B,0xCC6C,0xCC6D,0xCC6E,0xCC6F, +0xCC70,0xCC71,0xCC72,0xCC73,0xCC74,0xCC75,0xCC76,0xCC77, +0xD5BA,0xCC78,0xCC79,0xCC7A,0xDEC2,0xCC7B,0xCC7C,0xCC7D, +0xCC7E,0xCC80,0xCC81,0xCC82,0xCC83,0xCC84,0xCC85,0xCC86, +0xCC87,0xCC88,0xCC89,0xCC8A,0xCC8B,0xF2AE,0xBBA2,0xC2B2, +0xC5B0,0xC2C7,0xCC8C,0xCC8D,0xF2AF,0xCC8E,0xCC8F,0xCC90, +0xCC91,0xCC92,0xD0E9,0xCC93,0xCC94,0xCC95,0xD3DD,0xCC96, +0xCC97,0xCC98,0xEBBD,0xCC99,0xCC9A,0xCC9B,0xCC9C,0xCC9D, +0xCC9E,0xCC9F,0xCCA0,0xB3E6,0xF2B0,0xCD40,0xF2B1,0xCD41, +0xCD42,0xCAAD,0xCD43,0xCD44,0xCD45,0xCD46,0xCD47,0xCD48, +0xCD49,0xBAE7,0xF2B3,0xF2B5,0xF2B4,0xCBE4,0xCFBA,0xF2B2, +0xCAB4,0xD2CF,0xC2EC,0xCD4A,0xCD4B,0xCD4C,0xCD4D,0xCD4E, +0xCD4F,0xCD50,0xCEC3,0xF2B8,0xB0F6,0xF2B7,0xCD51,0xCD52, +0xCD53,0xCD54,0xCD55,0xF2BE,0xCD56,0xB2CF,0xCD57,0xCD58, +0xCD59,0xCD5A,0xCD5B,0xCD5C,0xD1C1,0xF2BA,0xCD5D,0xCD5E, +0xCD5F,0xCD60,0xCD61,0xF2BC,0xD4E9,0xCD62,0xCD63,0xF2BB, +0xF2B6,0xF2BF,0xF2BD,0xCD64,0xF2B9,0xCD65,0xCD66,0xF2C7, +0xF2C4,0xF2C6,0xCD67,0xCD68,0xF2CA,0xF2C2,0xF2C0,0xCD69, +0xCD6A,0xCD6B,0xF2C5,0xCD6C,0xCD6D,0xCD6E,0xCD6F,0xCD70, +0xD6FB,0xCD71,0xCD72,0xCD73,0xF2C1,0xCD74,0xC7F9,0xC9DF, +0xCD75,0xF2C8,0xB9C6,0xB5B0,0xCD76,0xCD77,0xF2C3,0xF2C9, +0xF2D0,0xF2D6,0xCD78,0xCD79,0xBBD7,0xCD7A,0xCD7B,0xCD7C, +0xF2D5,0xCDDC,0xCD7D,0xD6EB,0xCD7E,0xCD80,0xF2D2,0xF2D4, +0xCD81,0xCD82,0xCD83,0xCD84,0xB8F2,0xCD85,0xCD86,0xCD87, +0xCD88,0xF2CB,0xCD89,0xCD8A,0xCD8B,0xF2CE,0xC2F9,0xCD8C, +0xD5DD,0xF2CC,0xF2CD,0xF2CF,0xF2D3,0xCD8D,0xCD8E,0xCD8F, +0xF2D9,0xD3BC,0xCD90,0xCD91,0xCD92,0xCD93,0xB6EA,0xCD94, +0xCAF1,0xCD95,0xB7E4,0xF2D7,0xCD96,0xCD97,0xCD98,0xF2D8, +0xF2DA,0xF2DD,0xF2DB,0xCD99,0xCD9A,0xF2DC,0xCD9B,0xCD9C, +0xCD9D,0xCD9E,0xD1D1,0xF2D1,0xCD9F,0xCDC9,0xCDA0,0xCECF, +0xD6A9,0xCE40,0xF2E3,0xCE41,0xC3DB,0xCE42,0xF2E0,0xCE43, +0xCE44,0xC0AF,0xF2EC,0xF2DE,0xCE45,0xF2E1,0xCE46,0xCE47, +0xCE48,0xF2E8,0xCE49,0xCE4A,0xCE4B,0xCE4C,0xF2E2,0xCE4D, +0xCE4E,0xF2E7,0xCE4F,0xCE50,0xF2E6,0xCE51,0xCE52,0xF2E9, +0xCE53,0xCE54,0xCE55,0xF2DF,0xCE56,0xCE57,0xF2E4,0xF2EA, +0xCE58,0xCE59,0xCE5A,0xCE5B,0xCE5C,0xCE5D,0xCE5E,0xD3AC, +0xF2E5,0xB2F5,0xCE5F,0xCE60,0xF2F2,0xCE61,0xD0AB,0xCE62, +0xCE63,0xCE64,0xCE65,0xF2F5,0xCE66,0xCE67,0xCE68,0xBBC8, +0xCE69,0xF2F9,0xCE6A,0xCE6B,0xCE6C,0xCE6D,0xCE6E,0xCE6F, +0xF2F0,0xCE70,0xCE71,0xF2F6,0xF2F8,0xF2FA,0xCE72,0xCE73, +0xCE74,0xCE75,0xCE76,0xCE77,0xCE78,0xCE79,0xF2F3,0xCE7A, +0xF2F1,0xCE7B,0xCE7C,0xCE7D,0xBAFB,0xCE7E,0xB5FB,0xCE80, +0xCE81,0xCE82,0xCE83,0xF2EF,0xF2F7,0xF2ED,0xF2EE,0xCE84, +0xCE85,0xCE86,0xF2EB,0xF3A6,0xCE87,0xF3A3,0xCE88,0xCE89, +0xF3A2,0xCE8A,0xCE8B,0xF2F4,0xCE8C,0xC8DA,0xCE8D,0xCE8E, +0xCE8F,0xCE90,0xCE91,0xF2FB,0xCE92,0xCE93,0xCE94,0xF3A5, +0xCE95,0xCE96,0xCE97,0xCE98,0xCE99,0xCE9A,0xCE9B,0xC3F8, +0xCE9C,0xCE9D,0xCE9E,0xCE9F,0xCEA0,0xCF40,0xCF41,0xCF42, +0xF2FD,0xCF43,0xCF44,0xF3A7,0xF3A9,0xF3A4,0xCF45,0xF2FC, +0xCF46,0xCF47,0xCF48,0xF3AB,0xCF49,0xF3AA,0xCF4A,0xCF4B, +0xCF4C,0xCF4D,0xC2DD,0xCF4E,0xCF4F,0xF3AE,0xCF50,0xCF51, +0xF3B0,0xCF52,0xCF53,0xCF54,0xCF55,0xCF56,0xF3A1,0xCF57, +0xCF58,0xCF59,0xF3B1,0xF3AC,0xCF5A,0xCF5B,0xCF5C,0xCF5D, +0xCF5E,0xF3AF,0xF2FE,0xF3AD,0xCF5F,0xCF60,0xCF61,0xCF62, +0xCF63,0xCF64,0xCF65,0xF3B2,0xCF66,0xCF67,0xCF68,0xCF69, +0xF3B4,0xCF6A,0xCF6B,0xCF6C,0xCF6D,0xF3A8,0xCF6E,0xCF6F, +0xCF70,0xCF71,0xF3B3,0xCF72,0xCF73,0xCF74,0xF3B5,0xCF75, +0xCF76,0xCF77,0xCF78,0xCF79,0xCF7A,0xCF7B,0xCF7C,0xCF7D, +0xCF7E,0xD0B7,0xCF80,0xCF81,0xCF82,0xCF83,0xF3B8,0xCF84, +0xCF85,0xCF86,0xCF87,0xD9F9,0xCF88,0xCF89,0xCF8A,0xCF8B, +0xCF8C,0xCF8D,0xF3B9,0xCF8E,0xCF8F,0xCF90,0xCF91,0xCF92, +0xCF93,0xCF94,0xCF95,0xF3B7,0xCF96,0xC8E4,0xF3B6,0xCF97, +0xCF98,0xCF99,0xCF9A,0xF3BA,0xCF9B,0xCF9C,0xCF9D,0xCF9E, +0xCF9F,0xF3BB,0xB4C0,0xCFA0,0xD040,0xD041,0xD042,0xD043, +0xD044,0xD045,0xD046,0xD047,0xD048,0xD049,0xD04A,0xD04B, +0xD04C,0xD04D,0xEEC3,0xD04E,0xD04F,0xD050,0xD051,0xD052, +0xD053,0xF3BC,0xD054,0xD055,0xF3BD,0xD056,0xD057,0xD058, +0xD1AA,0xD059,0xD05A,0xD05B,0xF4AC,0xD0C6,0xD05C,0xD05D, +0xD05E,0xD05F,0xD060,0xD061,0xD0D0,0xD1DC,0xD062,0xD063, +0xD064,0xD065,0xD066,0xD067,0xCFCE,0xD068,0xD069,0xBDD6, +0xD06A,0xD1C3,0xD06B,0xD06C,0xD06D,0xD06E,0xD06F,0xD070, +0xD071,0xBAE2,0xE1E9,0xD2C2,0xF1C2,0xB2B9,0xD072,0xD073, +0xB1ED,0xF1C3,0xD074,0xC9C0,0xB3C4,0xD075,0xD9F2,0xD076, +0xCBA5,0xD077,0xF1C4,0xD078,0xD079,0xD07A,0xD07B,0xD6D4, +0xD07C,0xD07D,0xD07E,0xD080,0xD081,0xF1C5,0xF4C0,0xF1C6, +0xD082,0xD4AC,0xF1C7,0xD083,0xB0C0,0xF4C1,0xD084,0xD085, +0xF4C2,0xD086,0xD087,0xB4FC,0xD088,0xC5DB,0xD089,0xD08A, +0xD08B,0xD08C,0xCCBB,0xD08D,0xD08E,0xD08F,0xD0E4,0xD090, +0xD091,0xD092,0xD093,0xD094,0xCDE0,0xD095,0xD096,0xD097, +0xD098,0xD099,0xF1C8,0xD09A,0xD9F3,0xD09B,0xD09C,0xD09D, +0xD09E,0xD09F,0xD0A0,0xB1BB,0xD140,0xCFAE,0xD141,0xD142, +0xD143,0xB8A4,0xD144,0xD145,0xD146,0xD147,0xD148,0xF1CA, +0xD149,0xD14A,0xD14B,0xD14C,0xF1CB,0xD14D,0xD14E,0xD14F, +0xD150,0xB2C3,0xC1D1,0xD151,0xD152,0xD7B0,0xF1C9,0xD153, +0xD154,0xF1CC,0xD155,0xD156,0xD157,0xD158,0xF1CE,0xD159, +0xD15A,0xD15B,0xD9F6,0xD15C,0xD2E1,0xD4A3,0xD15D,0xD15E, +0xF4C3,0xC8B9,0xD15F,0xD160,0xD161,0xD162,0xD163,0xF4C4, +0xD164,0xD165,0xF1CD,0xF1CF,0xBFE3,0xF1D0,0xD166,0xD167, +0xF1D4,0xD168,0xD169,0xD16A,0xD16B,0xD16C,0xD16D,0xD16E, +0xF1D6,0xF1D1,0xD16F,0xC9D1,0xC5E1,0xD170,0xD171,0xD172, +0xC2E3,0xB9FC,0xD173,0xD174,0xF1D3,0xD175,0xF1D5,0xD176, +0xD177,0xD178,0xB9D3,0xD179,0xD17A,0xD17B,0xD17C,0xD17D, +0xD17E,0xD180,0xF1DB,0xD181,0xD182,0xD183,0xD184,0xD185, +0xBAD6,0xD186,0xB0FD,0xF1D9,0xD187,0xD188,0xD189,0xD18A, +0xD18B,0xF1D8,0xF1D2,0xF1DA,0xD18C,0xD18D,0xD18E,0xD18F, +0xD190,0xF1D7,0xD191,0xD192,0xD193,0xC8EC,0xD194,0xD195, +0xD196,0xD197,0xCDCA,0xF1DD,0xD198,0xD199,0xD19A,0xD19B, +0xE5BD,0xD19C,0xD19D,0xD19E,0xF1DC,0xD19F,0xF1DE,0xD1A0, +0xD240,0xD241,0xD242,0xD243,0xD244,0xD245,0xD246,0xD247, +0xD248,0xF1DF,0xD249,0xD24A,0xCFE5,0xD24B,0xD24C,0xD24D, +0xD24E,0xD24F,0xD250,0xD251,0xD252,0xD253,0xD254,0xD255, +0xD256,0xD257,0xD258,0xD259,0xD25A,0xD25B,0xD25C,0xD25D, +0xD25E,0xD25F,0xD260,0xD261,0xD262,0xD263,0xF4C5,0xBDF3, +0xD264,0xD265,0xD266,0xD267,0xD268,0xD269,0xF1E0,0xD26A, +0xD26B,0xD26C,0xD26D,0xD26E,0xD26F,0xD270,0xD271,0xD272, +0xD273,0xD274,0xD275,0xD276,0xD277,0xD278,0xD279,0xD27A, +0xD27B,0xD27C,0xD27D,0xF1E1,0xD27E,0xD280,0xD281,0xCEF7, +0xD282,0xD2AA,0xD283,0xF1FB,0xD284,0xD285,0xB8B2,0xD286, +0xD287,0xD288,0xD289,0xD28A,0xD28B,0xD28C,0xD28D,0xD28E, +0xD28F,0xD290,0xD291,0xD292,0xD293,0xD294,0xD295,0xD296, +0xD297,0xD298,0xD299,0xD29A,0xD29B,0xD29C,0xD29D,0xD29E, +0xD29F,0xD2A0,0xD340,0xD341,0xD342,0xD343,0xD344,0xD345, +0xD346,0xD347,0xD348,0xD349,0xD34A,0xD34B,0xD34C,0xD34D, +0xD34E,0xD34F,0xD350,0xD351,0xD352,0xD353,0xD354,0xD355, +0xD356,0xD357,0xD358,0xD359,0xD35A,0xD35B,0xD35C,0xD35D, +0xD35E,0xBCFB,0xB9DB,0xD35F,0xB9E6,0xC3D9,0xCAD3,0xEAE8, +0xC0C0,0xBEF5,0xEAE9,0xEAEA,0xEAEB,0xD360,0xEAEC,0xEAED, +0xEAEE,0xEAEF,0xBDC7,0xD361,0xD362,0xD363,0xF5FB,0xD364, +0xD365,0xD366,0xF5FD,0xD367,0xF5FE,0xD368,0xF5FC,0xD369, +0xD36A,0xD36B,0xD36C,0xBDE2,0xD36D,0xF6A1,0xB4A5,0xD36E, +0xD36F,0xD370,0xD371,0xF6A2,0xD372,0xD373,0xD374,0xF6A3, +0xD375,0xD376,0xD377,0xECB2,0xD378,0xD379,0xD37A,0xD37B, +0xD37C,0xD37D,0xD37E,0xD380,0xD381,0xD382,0xD383,0xD384, +0xD1D4,0xD385,0xD386,0xD387,0xD388,0xD389,0xD38A,0xD9EA, +0xD38B,0xD38C,0xD38D,0xD38E,0xD38F,0xD390,0xD391,0xD392, +0xD393,0xD394,0xD395,0xD396,0xD397,0xD398,0xD399,0xD39A, +0xD39B,0xD39C,0xD39D,0xD39E,0xD39F,0xD3A0,0xD440,0xD441, +0xD442,0xD443,0xD444,0xD445,0xD446,0xD447,0xD448,0xD449, +0xD44A,0xD44B,0xD44C,0xD44D,0xD44E,0xD44F,0xD450,0xD451, +0xD452,0xD453,0xD454,0xD455,0xD456,0xD457,0xD458,0xD459, +0xD45A,0xD45B,0xD45C,0xD45D,0xD45E,0xD45F,0xF6A4,0xD460, +0xD461,0xD462,0xD463,0xD464,0xD465,0xD466,0xD467,0xD468, +0xEEBA,0xD469,0xD46A,0xD46B,0xD46C,0xD46D,0xD46E,0xD46F, +0xD470,0xD471,0xD472,0xD473,0xD474,0xD475,0xD476,0xD477, +0xD478,0xD479,0xD47A,0xD47B,0xD47C,0xD47D,0xD47E,0xD480, +0xD481,0xD482,0xD483,0xD484,0xD485,0xD486,0xD487,0xD488, +0xD489,0xD48A,0xD48B,0xD48C,0xD48D,0xD48E,0xD48F,0xD490, +0xD491,0xD492,0xD493,0xD494,0xD495,0xD496,0xD497,0xD498, +0xD499,0xD5B2,0xD49A,0xD49B,0xD49C,0xD49D,0xD49E,0xD49F, +0xD4A0,0xD540,0xD541,0xD542,0xD543,0xD544,0xD545,0xD546, +0xD547,0xD3FE,0xCCDC,0xD548,0xD549,0xD54A,0xD54B,0xD54C, +0xD54D,0xD54E,0xD54F,0xCAC4,0xD550,0xD551,0xD552,0xD553, +0xD554,0xD555,0xD556,0xD557,0xD558,0xD559,0xD55A,0xD55B, +0xD55C,0xD55D,0xD55E,0xD55F,0xD560,0xD561,0xD562,0xD563, +0xD564,0xD565,0xD566,0xD567,0xD568,0xD569,0xD56A,0xD56B, +0xD56C,0xD56D,0xD56E,0xD56F,0xD570,0xD571,0xD572,0xD573, +0xD574,0xD575,0xD576,0xD577,0xD578,0xD579,0xD57A,0xD57B, +0xD57C,0xD57D,0xD57E,0xD580,0xD581,0xD582,0xD583,0xD584, +0xD585,0xD586,0xD587,0xD588,0xD589,0xD58A,0xD58B,0xD58C, +0xD58D,0xD58E,0xD58F,0xD590,0xD591,0xD592,0xD593,0xD594, +0xD595,0xD596,0xD597,0xD598,0xD599,0xD59A,0xD59B,0xD59C, +0xD59D,0xD59E,0xD59F,0xD5A0,0xD640,0xD641,0xD642,0xD643, +0xD644,0xD645,0xD646,0xD647,0xD648,0xD649,0xD64A,0xD64B, +0xD64C,0xD64D,0xD64E,0xD64F,0xD650,0xD651,0xD652,0xD653, +0xD654,0xD655,0xD656,0xD657,0xD658,0xD659,0xD65A,0xD65B, +0xD65C,0xD65D,0xD65E,0xD65F,0xD660,0xD661,0xD662,0xE5C0, +0xD663,0xD664,0xD665,0xD666,0xD667,0xD668,0xD669,0xD66A, +0xD66B,0xD66C,0xD66D,0xD66E,0xD66F,0xD670,0xD671,0xD672, +0xD673,0xD674,0xD675,0xD676,0xD677,0xD678,0xD679,0xD67A, +0xD67B,0xD67C,0xD67D,0xD67E,0xD680,0xD681,0xF6A5,0xD682, +0xD683,0xD684,0xD685,0xD686,0xD687,0xD688,0xD689,0xD68A, +0xD68B,0xD68C,0xD68D,0xD68E,0xD68F,0xD690,0xD691,0xD692, +0xD693,0xD694,0xD695,0xD696,0xD697,0xD698,0xD699,0xD69A, +0xD69B,0xD69C,0xD69D,0xD69E,0xD69F,0xD6A0,0xD740,0xD741, +0xD742,0xD743,0xD744,0xD745,0xD746,0xD747,0xD748,0xD749, +0xD74A,0xD74B,0xD74C,0xD74D,0xD74E,0xD74F,0xD750,0xD751, +0xD752,0xD753,0xD754,0xD755,0xD756,0xD757,0xD758,0xD759, +0xD75A,0xD75B,0xD75C,0xD75D,0xD75E,0xD75F,0xBEAF,0xD760, +0xD761,0xD762,0xD763,0xD764,0xC6A9,0xD765,0xD766,0xD767, +0xD768,0xD769,0xD76A,0xD76B,0xD76C,0xD76D,0xD76E,0xD76F, +0xD770,0xD771,0xD772,0xD773,0xD774,0xD775,0xD776,0xD777, +0xD778,0xD779,0xD77A,0xD77B,0xD77C,0xD77D,0xD77E,0xD780, +0xD781,0xD782,0xD783,0xD784,0xD785,0xD786,0xD787,0xD788, +0xD789,0xD78A,0xD78B,0xD78C,0xD78D,0xD78E,0xD78F,0xD790, +0xD791,0xD792,0xD793,0xD794,0xD795,0xD796,0xD797,0xD798, +0xDAA5,0xBCC6,0xB6A9,0xB8BC,0xC8CF,0xBCA5,0xDAA6,0xDAA7, +0xCCD6,0xC8C3,0xDAA8,0xC6FD,0xD799,0xD1B5,0xD2E9,0xD1B6, +0xBCC7,0xD79A,0xBDB2,0xBBE4,0xDAA9,0xDAAA,0xD1C8,0xDAAB, +0xD0ED,0xB6EF,0xC2DB,0xD79B,0xCBCF,0xB7ED,0xC9E8,0xB7C3, +0xBEF7,0xD6A4,0xDAAC,0xDAAD,0xC6C0,0xD7E7,0xCAB6,0xD79C, +0xD5A9,0xCBDF,0xD5EF,0xDAAE,0xD6DF,0xB4CA,0xDAB0,0xDAAF, +0xD79D,0xD2EB,0xDAB1,0xDAB2,0xDAB3,0xCAD4,0xDAB4,0xCAAB, +0xDAB5,0xDAB6,0xB3CF,0xD6EF,0xDAB7,0xBBB0,0xB5AE,0xDAB8, +0xDAB9,0xB9EE,0xD1AF,0xD2E8,0xDABA,0xB8C3,0xCFEA,0xB2EF, +0xDABB,0xDABC,0xD79E,0xBDEB,0xCEDC,0xD3EF,0xDABD,0xCEF3, +0xDABE,0xD3D5,0xBBE5,0xDABF,0xCBB5,0xCBD0,0xDAC0,0xC7EB, +0xD6EE,0xDAC1,0xC5B5,0xB6C1,0xDAC2,0xB7CC,0xBFCE,0xDAC3, +0xDAC4,0xCBAD,0xDAC5,0xB5F7,0xDAC6,0xC1C2,0xD7BB,0xDAC7, +0xCCB8,0xD79F,0xD2EA,0xC4B1,0xDAC8,0xB5FD,0xBBD1,0xDAC9, +0xD0B3,0xDACA,0xDACB,0xCEBD,0xDACC,0xDACD,0xDACE,0xB2F7, +0xDAD1,0xDACF,0xD1E8,0xDAD0,0xC3D5,0xDAD2,0xD7A0,0xDAD3, +0xDAD4,0xDAD5,0xD0BB,0xD2A5,0xB0F9,0xDAD6,0xC7AB,0xDAD7, +0xBDF7,0xC3A1,0xDAD8,0xDAD9,0xC3FD,0xCCB7,0xDADA,0xDADB, +0xC0BE,0xC6D7,0xDADC,0xDADD,0xC7B4,0xDADE,0xDADF,0xB9C8, +0xD840,0xD841,0xD842,0xD843,0xD844,0xD845,0xD846,0xD847, +0xD848,0xBBED,0xD849,0xD84A,0xD84B,0xD84C,0xB6B9,0xF4F8, +0xD84D,0xF4F9,0xD84E,0xD84F,0xCDE3,0xD850,0xD851,0xD852, +0xD853,0xD854,0xD855,0xD856,0xD857,0xF5B9,0xD858,0xD859, +0xD85A,0xD85B,0xEBE0,0xD85C,0xD85D,0xD85E,0xD85F,0xD860, +0xD861,0xCFF3,0xBBBF,0xD862,0xD863,0xD864,0xD865,0xD866, +0xD867,0xD868,0xBAC0,0xD4A5,0xD869,0xD86A,0xD86B,0xD86C, +0xD86D,0xD86E,0xD86F,0xE1D9,0xD870,0xD871,0xD872,0xD873, +0xF5F4,0xB1AA,0xB2F2,0xD874,0xD875,0xD876,0xD877,0xD878, +0xD879,0xD87A,0xF5F5,0xD87B,0xD87C,0xF5F7,0xD87D,0xD87E, +0xD880,0xBAD1,0xF5F6,0xD881,0xC3B2,0xD882,0xD883,0xD884, +0xD885,0xD886,0xD887,0xD888,0xF5F9,0xD889,0xD88A,0xD88B, +0xF5F8,0xD88C,0xD88D,0xD88E,0xD88F,0xD890,0xD891,0xD892, +0xD893,0xD894,0xD895,0xD896,0xD897,0xD898,0xD899,0xD89A, +0xD89B,0xD89C,0xD89D,0xD89E,0xD89F,0xD8A0,0xD940,0xD941, +0xD942,0xD943,0xD944,0xD945,0xD946,0xD947,0xD948,0xD949, +0xD94A,0xD94B,0xD94C,0xD94D,0xD94E,0xD94F,0xD950,0xD951, +0xD952,0xD953,0xD954,0xD955,0xD956,0xD957,0xD958,0xD959, +0xD95A,0xD95B,0xD95C,0xD95D,0xD95E,0xD95F,0xD960,0xD961, +0xD962,0xD963,0xD964,0xD965,0xD966,0xD967,0xD968,0xD969, +0xD96A,0xD96B,0xD96C,0xD96D,0xD96E,0xD96F,0xD970,0xD971, +0xD972,0xD973,0xD974,0xD975,0xD976,0xD977,0xD978,0xD979, +0xD97A,0xD97B,0xD97C,0xD97D,0xD97E,0xD980,0xD981,0xD982, +0xD983,0xD984,0xD985,0xD986,0xD987,0xD988,0xD989,0xD98A, +0xD98B,0xD98C,0xD98D,0xD98E,0xD98F,0xD990,0xD991,0xD992, +0xD993,0xD994,0xD995,0xD996,0xD997,0xD998,0xD999,0xD99A, +0xD99B,0xD99C,0xD99D,0xD99E,0xD99F,0xD9A0,0xDA40,0xDA41, +0xDA42,0xDA43,0xDA44,0xDA45,0xDA46,0xDA47,0xDA48,0xDA49, +0xDA4A,0xDA4B,0xDA4C,0xDA4D,0xDA4E,0xB1B4,0xD5EA,0xB8BA, +0xDA4F,0xB9B1,0xB2C6,0xD4F0,0xCFCD,0xB0DC,0xD5CB,0xBBF5, +0xD6CA,0xB7B7,0xCCB0,0xC6B6,0xB1E1,0xB9BA,0xD6FC,0xB9E1, +0xB7A1,0xBCFA,0xEADA,0xEADB,0xCCF9,0xB9F3,0xEADC,0xB4FB, +0xC3B3,0xB7D1,0xBAD8,0xEADD,0xD4F4,0xEADE,0xBCD6,0xBBDF, +0xEADF,0xC1DE,0xC2B8,0xD4DF,0xD7CA,0xEAE0,0xEAE1,0xEAE4, +0xEAE2,0xEAE3,0xC9DE,0xB8B3,0xB6C4,0xEAE5,0xCAEA,0xC9CD, +0xB4CD,0xDA50,0xDA51,0xE2D9,0xC5E2,0xEAE6,0xC0B5,0xDA52, +0xD7B8,0xEAE7,0xD7AC,0xC8FC,0xD8D3,0xD8CD,0xD4DE,0xDA53, +0xD4F9,0xC9C4,0xD3AE,0xB8D3,0xB3E0,0xDA54,0xC9E2,0xF4F6, +0xDA55,0xDA56,0xDA57,0xBAD5,0xDA58,0xF4F7,0xDA59,0xDA5A, +0xD7DF,0xDA5B,0xDA5C,0xF4F1,0xB8B0,0xD5D4,0xB8CF,0xC6F0, +0xDA5D,0xDA5E,0xDA5F,0xDA60,0xDA61,0xDA62,0xDA63,0xDA64, +0xDA65,0xB3C3,0xDA66,0xDA67,0xF4F2,0xB3AC,0xDA68,0xDA69, +0xDA6A,0xDA6B,0xD4BD,0xC7F7,0xDA6C,0xDA6D,0xDA6E,0xDA6F, +0xDA70,0xF4F4,0xDA71,0xDA72,0xF4F3,0xDA73,0xDA74,0xDA75, +0xDA76,0xDA77,0xDA78,0xDA79,0xDA7A,0xDA7B,0xDA7C,0xCCCB, +0xDA7D,0xDA7E,0xDA80,0xC8A4,0xDA81,0xDA82,0xDA83,0xDA84, +0xDA85,0xDA86,0xDA87,0xDA88,0xDA89,0xDA8A,0xDA8B,0xDA8C, +0xDA8D,0xF4F5,0xDA8E,0xD7E3,0xC5BF,0xF5C0,0xDA8F,0xDA90, +0xF5BB,0xDA91,0xF5C3,0xDA92,0xF5C2,0xDA93,0xD6BA,0xF5C1, +0xDA94,0xDA95,0xDA96,0xD4BE,0xF5C4,0xDA97,0xF5CC,0xDA98, +0xDA99,0xDA9A,0xDA9B,0xB0CF,0xB5F8,0xDA9C,0xF5C9,0xF5CA, +0xDA9D,0xC5DC,0xDA9E,0xDA9F,0xDAA0,0xDB40,0xF5C5,0xF5C6, +0xDB41,0xDB42,0xF5C7,0xF5CB,0xDB43,0xBEE0,0xF5C8,0xB8FA, +0xDB44,0xDB45,0xDB46,0xF5D0,0xF5D3,0xDB47,0xDB48,0xDB49, +0xBFE7,0xDB4A,0xB9F2,0xF5BC,0xF5CD,0xDB4B,0xDB4C,0xC2B7, +0xDB4D,0xDB4E,0xDB4F,0xCCF8,0xDB50,0xBCF9,0xDB51,0xF5CE, +0xF5CF,0xF5D1,0xB6E5,0xF5D2,0xDB52,0xF5D5,0xDB53,0xDB54, +0xDB55,0xDB56,0xDB57,0xDB58,0xDB59,0xF5BD,0xDB5A,0xDB5B, +0xDB5C,0xF5D4,0xD3BB,0xDB5D,0xB3EC,0xDB5E,0xDB5F,0xCCA4, +0xDB60,0xDB61,0xDB62,0xDB63,0xF5D6,0xDB64,0xDB65,0xDB66, +0xDB67,0xDB68,0xDB69,0xDB6A,0xDB6B,0xF5D7,0xBEE1,0xF5D8, +0xDB6C,0xDB6D,0xCCDF,0xF5DB,0xDB6E,0xDB6F,0xDB70,0xDB71, +0xDB72,0xB2C8,0xD7D9,0xDB73,0xF5D9,0xDB74,0xF5DA,0xF5DC, +0xDB75,0xF5E2,0xDB76,0xDB77,0xDB78,0xF5E0,0xDB79,0xDB7A, +0xDB7B,0xF5DF,0xF5DD,0xDB7C,0xDB7D,0xF5E1,0xDB7E,0xDB80, +0xF5DE,0xF5E4,0xF5E5,0xDB81,0xCCE3,0xDB82,0xDB83,0xE5BF, +0xB5B8,0xF5E3,0xF5E8,0xCCA3,0xDB84,0xDB85,0xDB86,0xDB87, +0xDB88,0xF5E6,0xF5E7,0xDB89,0xDB8A,0xDB8B,0xDB8C,0xDB8D, +0xDB8E,0xF5BE,0xDB8F,0xDB90,0xDB91,0xDB92,0xDB93,0xDB94, +0xDB95,0xDB96,0xDB97,0xDB98,0xDB99,0xDB9A,0xB1C4,0xDB9B, +0xDB9C,0xF5BF,0xDB9D,0xDB9E,0xB5C5,0xB2E4,0xDB9F,0xF5EC, +0xF5E9,0xDBA0,0xB6D7,0xDC40,0xF5ED,0xDC41,0xF5EA,0xDC42, +0xDC43,0xDC44,0xDC45,0xDC46,0xF5EB,0xDC47,0xDC48,0xB4DA, +0xDC49,0xD4EA,0xDC4A,0xDC4B,0xDC4C,0xF5EE,0xDC4D,0xB3F9, +0xDC4E,0xDC4F,0xDC50,0xDC51,0xDC52,0xDC53,0xDC54,0xF5EF, +0xF5F1,0xDC55,0xDC56,0xDC57,0xF5F0,0xDC58,0xDC59,0xDC5A, +0xDC5B,0xDC5C,0xDC5D,0xDC5E,0xF5F2,0xDC5F,0xF5F3,0xDC60, +0xDC61,0xDC62,0xDC63,0xDC64,0xDC65,0xDC66,0xDC67,0xDC68, +0xDC69,0xDC6A,0xDC6B,0xC9ED,0xB9AA,0xDC6C,0xDC6D,0xC7FB, +0xDC6E,0xDC6F,0xB6E3,0xDC70,0xDC71,0xDC72,0xDC73,0xDC74, +0xDC75,0xDC76,0xCCC9,0xDC77,0xDC78,0xDC79,0xDC7A,0xDC7B, +0xDC7C,0xDC7D,0xDC7E,0xDC80,0xDC81,0xDC82,0xDC83,0xDC84, +0xDC85,0xDC86,0xDC87,0xDC88,0xDC89,0xDC8A,0xEAA6,0xDC8B, +0xDC8C,0xDC8D,0xDC8E,0xDC8F,0xDC90,0xDC91,0xDC92,0xDC93, +0xDC94,0xDC95,0xDC96,0xDC97,0xDC98,0xDC99,0xDC9A,0xDC9B, +0xDC9C,0xDC9D,0xDC9E,0xDC9F,0xDCA0,0xDD40,0xDD41,0xDD42, +0xDD43,0xDD44,0xDD45,0xDD46,0xDD47,0xDD48,0xDD49,0xDD4A, +0xDD4B,0xDD4C,0xDD4D,0xDD4E,0xDD4F,0xDD50,0xDD51,0xDD52, +0xDD53,0xDD54,0xDD55,0xDD56,0xDD57,0xDD58,0xDD59,0xDD5A, +0xDD5B,0xDD5C,0xDD5D,0xDD5E,0xDD5F,0xDD60,0xDD61,0xDD62, +0xDD63,0xDD64,0xDD65,0xDD66,0xDD67,0xDD68,0xDD69,0xDD6A, +0xDD6B,0xDD6C,0xDD6D,0xDD6E,0xDD6F,0xDD70,0xDD71,0xDD72, +0xDD73,0xDD74,0xDD75,0xDD76,0xDD77,0xDD78,0xDD79,0xDD7A, +0xDD7B,0xDD7C,0xDD7D,0xDD7E,0xDD80,0xDD81,0xDD82,0xDD83, +0xDD84,0xDD85,0xDD86,0xDD87,0xDD88,0xDD89,0xDD8A,0xDD8B, +0xDD8C,0xDD8D,0xDD8E,0xDD8F,0xDD90,0xDD91,0xDD92,0xDD93, +0xDD94,0xDD95,0xDD96,0xDD97,0xDD98,0xDD99,0xDD9A,0xDD9B, +0xDD9C,0xDD9D,0xDD9E,0xDD9F,0xDDA0,0xDE40,0xDE41,0xDE42, +0xDE43,0xDE44,0xDE45,0xDE46,0xDE47,0xDE48,0xDE49,0xDE4A, +0xDE4B,0xDE4C,0xDE4D,0xDE4E,0xDE4F,0xDE50,0xDE51,0xDE52, +0xDE53,0xDE54,0xDE55,0xDE56,0xDE57,0xDE58,0xDE59,0xDE5A, +0xDE5B,0xDE5C,0xDE5D,0xDE5E,0xDE5F,0xDE60,0xB3B5,0xD4FE, +0xB9EC,0xD0F9,0xDE61,0xE9ED,0xD7AA,0xE9EE,0xC2D6,0xC8ED, +0xBAE4,0xE9EF,0xE9F0,0xE9F1,0xD6E1,0xE9F2,0xE9F3,0xE9F5, +0xE9F4,0xE9F6,0xE9F7,0xC7E1,0xE9F8,0xD4D8,0xE9F9,0xBDCE, +0xDE62,0xE9FA,0xE9FB,0xBDCF,0xE9FC,0xB8A8,0xC1BE,0xE9FD, +0xB1B2,0xBBD4,0xB9F5,0xE9FE,0xDE63,0xEAA1,0xEAA2,0xEAA3, +0xB7F8,0xBCAD,0xDE64,0xCAE4,0xE0CE,0xD4AF,0xCFBD,0xD5B7, +0xEAA4,0xD5DE,0xEAA5,0xD0C1,0xB9BC,0xDE65,0xB4C7,0xB1D9, +0xDE66,0xDE67,0xDE68,0xC0B1,0xDE69,0xDE6A,0xDE6B,0xDE6C, +0xB1E6,0xB1E7,0xDE6D,0xB1E8,0xDE6E,0xDE6F,0xDE70,0xDE71, +0xB3BD,0xC8E8,0xDE72,0xDE73,0xDE74,0xDE75,0xE5C1,0xDE76, +0xDE77,0xB1DF,0xDE78,0xDE79,0xDE7A,0xC1C9,0xB4EF,0xDE7B, +0xDE7C,0xC7A8,0xD3D8,0xDE7D,0xC6F9,0xD1B8,0xDE7E,0xB9FD, +0xC2F5,0xDE80,0xDE81,0xDE82,0xDE83,0xDE84,0xD3AD,0xDE85, +0xD4CB,0xBDFC,0xDE86,0xE5C2,0xB7B5,0xE5C3,0xDE87,0xDE88, +0xBBB9,0xD5E2,0xDE89,0xBDF8,0xD4B6,0xCEA5,0xC1AC,0xB3D9, +0xDE8A,0xDE8B,0xCCF6,0xDE8C,0xE5C6,0xE5C4,0xE5C8,0xDE8D, +0xE5CA,0xE5C7,0xB5CF,0xC6C8,0xDE8E,0xB5FC,0xE5C5,0xDE8F, +0xCAF6,0xDE90,0xDE91,0xE5C9,0xDE92,0xDE93,0xDE94,0xC3D4, +0xB1C5,0xBCA3,0xDE95,0xDE96,0xDE97,0xD7B7,0xDE98,0xDE99, +0xCDCB,0xCBCD,0xCACA,0xCCD3,0xE5CC,0xE5CB,0xC4E6,0xDE9A, +0xDE9B,0xD1A1,0xD1B7,0xE5CD,0xDE9C,0xE5D0,0xDE9D,0xCDB8, +0xD6F0,0xE5CF,0xB5DD,0xDE9E,0xCDBE,0xDE9F,0xE5D1,0xB6BA, +0xDEA0,0xDF40,0xCDA8,0xB9E4,0xDF41,0xCAC5,0xB3D1,0xCBD9, +0xD4EC,0xE5D2,0xB7EA,0xDF42,0xDF43,0xDF44,0xE5CE,0xDF45, +0xDF46,0xDF47,0xDF48,0xDF49,0xDF4A,0xE5D5,0xB4FE,0xE5D6, +0xDF4B,0xDF4C,0xDF4D,0xDF4E,0xDF4F,0xE5D3,0xE5D4,0xDF50, +0xD2DD,0xDF51,0xDF52,0xC2DF,0xB1C6,0xDF53,0xD3E2,0xDF54, +0xDF55,0xB6DD,0xCBEC,0xDF56,0xE5D7,0xDF57,0xDF58,0xD3F6, +0xDF59,0xDF5A,0xDF5B,0xDF5C,0xDF5D,0xB1E9,0xDF5E,0xB6F4, +0xE5DA,0xE5D8,0xE5D9,0xB5C0,0xDF5F,0xDF60,0xDF61,0xD2C5, +0xE5DC,0xDF62,0xDF63,0xE5DE,0xDF64,0xDF65,0xDF66,0xDF67, +0xDF68,0xDF69,0xE5DD,0xC7B2,0xDF6A,0xD2A3,0xDF6B,0xDF6C, +0xE5DB,0xDF6D,0xDF6E,0xDF6F,0xDF70,0xD4E2,0xD5DA,0xDF71, +0xDF72,0xDF73,0xDF74,0xDF75,0xE5E0,0xD7F1,0xDF76,0xDF77, +0xDF78,0xDF79,0xDF7A,0xDF7B,0xDF7C,0xE5E1,0xDF7D,0xB1DC, +0xD1FB,0xDF7E,0xE5E2,0xE5E4,0xDF80,0xDF81,0xDF82,0xDF83, +0xE5E3,0xDF84,0xDF85,0xE5E5,0xDF86,0xDF87,0xDF88,0xDF89, +0xDF8A,0xD2D8,0xDF8B,0xB5CB,0xDF8C,0xE7DF,0xDF8D,0xDAF5, +0xDF8E,0xDAF8,0xDF8F,0xDAF6,0xDF90,0xDAF7,0xDF91,0xDF92, +0xDF93,0xDAFA,0xD0CF,0xC4C7,0xDF94,0xDF95,0xB0EE,0xDF96, +0xDF97,0xDF98,0xD0B0,0xDF99,0xDAF9,0xDF9A,0xD3CA,0xBAAA, +0xDBA2,0xC7F1,0xDF9B,0xDAFC,0xDAFB,0xC9DB,0xDAFD,0xDF9C, +0xDBA1,0xD7DE,0xDAFE,0xC1DA,0xDF9D,0xDF9E,0xDBA5,0xDF9F, +0xDFA0,0xD3F4,0xE040,0xE041,0xDBA7,0xDBA4,0xE042,0xDBA8, +0xE043,0xE044,0xBDBC,0xE045,0xE046,0xE047,0xC0C9,0xDBA3, +0xDBA6,0xD6A3,0xE048,0xDBA9,0xE049,0xE04A,0xE04B,0xDBAD, +0xE04C,0xE04D,0xE04E,0xDBAE,0xDBAC,0xBAC2,0xE04F,0xE050, +0xE051,0xBFA4,0xDBAB,0xE052,0xE053,0xE054,0xDBAA,0xD4C7, +0xB2BF,0xE055,0xE056,0xDBAF,0xE057,0xB9F9,0xE058,0xDBB0, +0xE059,0xE05A,0xE05B,0xE05C,0xB3BB,0xE05D,0xE05E,0xE05F, +0xB5A6,0xE060,0xE061,0xE062,0xE063,0xB6BC,0xDBB1,0xE064, +0xE065,0xE066,0xB6F5,0xE067,0xDBB2,0xE068,0xE069,0xE06A, +0xE06B,0xE06C,0xE06D,0xE06E,0xE06F,0xE070,0xE071,0xE072, +0xE073,0xE074,0xE075,0xE076,0xE077,0xE078,0xE079,0xE07A, +0xE07B,0xB1C9,0xE07C,0xE07D,0xE07E,0xE080,0xDBB4,0xE081, +0xE082,0xE083,0xDBB3,0xDBB5,0xE084,0xE085,0xE086,0xE087, +0xE088,0xE089,0xE08A,0xE08B,0xE08C,0xE08D,0xE08E,0xDBB7, +0xE08F,0xDBB6,0xE090,0xE091,0xE092,0xE093,0xE094,0xE095, +0xE096,0xDBB8,0xE097,0xE098,0xE099,0xE09A,0xE09B,0xE09C, +0xE09D,0xE09E,0xE09F,0xDBB9,0xE0A0,0xE140,0xDBBA,0xE141, +0xE142,0xD3CF,0xF4FA,0xC7F5,0xD7C3,0xC5E4,0xF4FC,0xF4FD, +0xF4FB,0xE143,0xBEC6,0xE144,0xE145,0xE146,0xE147,0xD0EF, +0xE148,0xE149,0xB7D3,0xE14A,0xE14B,0xD4CD,0xCCAA,0xE14C, +0xE14D,0xF5A2,0xF5A1,0xBAA8,0xF4FE,0xCBD6,0xE14E,0xE14F, +0xE150,0xF5A4,0xC0D2,0xE151,0xB3EA,0xE152,0xCDAA,0xF5A5, +0xF5A3,0xBDB4,0xF5A8,0xE153,0xF5A9,0xBDCD,0xC3B8,0xBFE1, +0xCBE1,0xF5AA,0xE154,0xE155,0xE156,0xF5A6,0xF5A7,0xC4F0, +0xE157,0xE158,0xE159,0xE15A,0xE15B,0xF5AC,0xE15C,0xB4BC, +0xE15D,0xD7ED,0xE15E,0xB4D7,0xF5AB,0xF5AE,0xE15F,0xE160, +0xF5AD,0xF5AF,0xD0D1,0xE161,0xE162,0xE163,0xE164,0xE165, +0xE166,0xE167,0xC3D1,0xC8A9,0xE168,0xE169,0xE16A,0xE16B, +0xE16C,0xE16D,0xF5B0,0xF5B1,0xE16E,0xE16F,0xE170,0xE171, +0xE172,0xE173,0xF5B2,0xE174,0xE175,0xF5B3,0xF5B4,0xF5B5, +0xE176,0xE177,0xE178,0xE179,0xF5B7,0xF5B6,0xE17A,0xE17B, +0xE17C,0xE17D,0xF5B8,0xE17E,0xE180,0xE181,0xE182,0xE183, +0xE184,0xE185,0xE186,0xE187,0xE188,0xE189,0xE18A,0xB2C9, +0xE18B,0xD3D4,0xCACD,0xE18C,0xC0EF,0xD6D8,0xD2B0,0xC1BF, +0xE18D,0xBDF0,0xE18E,0xE18F,0xE190,0xE191,0xE192,0xE193, +0xE194,0xE195,0xE196,0xE197,0xB8AA,0xE198,0xE199,0xE19A, +0xE19B,0xE19C,0xE19D,0xE19E,0xE19F,0xE1A0,0xE240,0xE241, +0xE242,0xE243,0xE244,0xE245,0xE246,0xE247,0xE248,0xE249, +0xE24A,0xE24B,0xE24C,0xE24D,0xE24E,0xE24F,0xE250,0xE251, +0xE252,0xE253,0xE254,0xE255,0xE256,0xE257,0xE258,0xE259, +0xE25A,0xE25B,0xE25C,0xE25D,0xE25E,0xE25F,0xE260,0xE261, +0xE262,0xE263,0xE264,0xE265,0xE266,0xE267,0xE268,0xE269, +0xE26A,0xE26B,0xE26C,0xE26D,0xE26E,0xE26F,0xE270,0xE271, +0xE272,0xE273,0xE274,0xE275,0xE276,0xE277,0xE278,0xE279, +0xE27A,0xE27B,0xE27C,0xE27D,0xE27E,0xE280,0xE281,0xE282, +0xE283,0xE284,0xE285,0xE286,0xE287,0xE288,0xE289,0xE28A, +0xE28B,0xE28C,0xE28D,0xE28E,0xE28F,0xE290,0xE291,0xE292, +0xE293,0xE294,0xE295,0xE296,0xE297,0xE298,0xE299,0xE29A, +0xE29B,0xE29C,0xE29D,0xE29E,0xE29F,0xE2A0,0xE340,0xE341, +0xE342,0xE343,0xE344,0xE345,0xE346,0xE347,0xE348,0xE349, +0xE34A,0xE34B,0xE34C,0xE34D,0xE34E,0xE34F,0xE350,0xE351, +0xE352,0xE353,0xE354,0xE355,0xE356,0xE357,0xE358,0xE359, +0xE35A,0xE35B,0xE35C,0xE35D,0xE35E,0xE35F,0xE360,0xE361, +0xE362,0xE363,0xE364,0xE365,0xE366,0xE367,0xE368,0xE369, +0xE36A,0xE36B,0xE36C,0xE36D,0xBCF8,0xE36E,0xE36F,0xE370, +0xE371,0xE372,0xE373,0xE374,0xE375,0xE376,0xE377,0xE378, +0xE379,0xE37A,0xE37B,0xE37C,0xE37D,0xE37E,0xE380,0xE381, +0xE382,0xE383,0xE384,0xE385,0xE386,0xE387,0xF6C6,0xE388, +0xE389,0xE38A,0xE38B,0xE38C,0xE38D,0xE38E,0xE38F,0xE390, +0xE391,0xE392,0xE393,0xE394,0xE395,0xE396,0xE397,0xE398, +0xE399,0xE39A,0xE39B,0xE39C,0xE39D,0xE39E,0xE39F,0xE3A0, +0xE440,0xE441,0xE442,0xE443,0xE444,0xE445,0xF6C7,0xE446, +0xE447,0xE448,0xE449,0xE44A,0xE44B,0xE44C,0xE44D,0xE44E, +0xE44F,0xE450,0xE451,0xE452,0xE453,0xE454,0xE455,0xE456, +0xE457,0xE458,0xE459,0xE45A,0xE45B,0xE45C,0xE45D,0xE45E, +0xF6C8,0xE45F,0xE460,0xE461,0xE462,0xE463,0xE464,0xE465, +0xE466,0xE467,0xE468,0xE469,0xE46A,0xE46B,0xE46C,0xE46D, +0xE46E,0xE46F,0xE470,0xE471,0xE472,0xE473,0xE474,0xE475, +0xE476,0xE477,0xE478,0xE479,0xE47A,0xE47B,0xE47C,0xE47D, +0xE47E,0xE480,0xE481,0xE482,0xE483,0xE484,0xE485,0xE486, +0xE487,0xE488,0xE489,0xE48A,0xE48B,0xE48C,0xE48D,0xE48E, +0xE48F,0xE490,0xE491,0xE492,0xE493,0xE494,0xE495,0xE496, +0xE497,0xE498,0xE499,0xE49A,0xE49B,0xE49C,0xE49D,0xE49E, +0xE49F,0xE4A0,0xE540,0xE541,0xE542,0xE543,0xE544,0xE545, +0xE546,0xE547,0xE548,0xE549,0xE54A,0xE54B,0xE54C,0xE54D, +0xE54E,0xE54F,0xE550,0xE551,0xE552,0xE553,0xE554,0xE555, +0xE556,0xE557,0xE558,0xE559,0xE55A,0xE55B,0xE55C,0xE55D, +0xE55E,0xE55F,0xE560,0xE561,0xE562,0xE563,0xE564,0xE565, +0xE566,0xE567,0xE568,0xE569,0xE56A,0xE56B,0xE56C,0xE56D, +0xE56E,0xE56F,0xE570,0xE571,0xE572,0xE573,0xF6C9,0xE574, +0xE575,0xE576,0xE577,0xE578,0xE579,0xE57A,0xE57B,0xE57C, +0xE57D,0xE57E,0xE580,0xE581,0xE582,0xE583,0xE584,0xE585, +0xE586,0xE587,0xE588,0xE589,0xE58A,0xE58B,0xE58C,0xE58D, +0xE58E,0xE58F,0xE590,0xE591,0xE592,0xE593,0xE594,0xE595, +0xE596,0xE597,0xE598,0xE599,0xE59A,0xE59B,0xE59C,0xE59D, +0xE59E,0xE59F,0xF6CA,0xE5A0,0xE640,0xE641,0xE642,0xE643, +0xE644,0xE645,0xE646,0xE647,0xE648,0xE649,0xE64A,0xE64B, +0xE64C,0xE64D,0xE64E,0xE64F,0xE650,0xE651,0xE652,0xE653, +0xE654,0xE655,0xE656,0xE657,0xE658,0xE659,0xE65A,0xE65B, +0xE65C,0xE65D,0xE65E,0xE65F,0xE660,0xE661,0xE662,0xF6CC, +0xE663,0xE664,0xE665,0xE666,0xE667,0xE668,0xE669,0xE66A, +0xE66B,0xE66C,0xE66D,0xE66E,0xE66F,0xE670,0xE671,0xE672, +0xE673,0xE674,0xE675,0xE676,0xE677,0xE678,0xE679,0xE67A, +0xE67B,0xE67C,0xE67D,0xE67E,0xE680,0xE681,0xE682,0xE683, +0xE684,0xE685,0xE686,0xE687,0xE688,0xE689,0xE68A,0xE68B, +0xE68C,0xE68D,0xE68E,0xE68F,0xE690,0xE691,0xE692,0xE693, +0xE694,0xE695,0xE696,0xE697,0xE698,0xE699,0xE69A,0xE69B, +0xE69C,0xE69D,0xF6CB,0xE69E,0xE69F,0xE6A0,0xE740,0xE741, +0xE742,0xE743,0xE744,0xE745,0xE746,0xE747,0xF7E9,0xE748, +0xE749,0xE74A,0xE74B,0xE74C,0xE74D,0xE74E,0xE74F,0xE750, +0xE751,0xE752,0xE753,0xE754,0xE755,0xE756,0xE757,0xE758, +0xE759,0xE75A,0xE75B,0xE75C,0xE75D,0xE75E,0xE75F,0xE760, +0xE761,0xE762,0xE763,0xE764,0xE765,0xE766,0xE767,0xE768, +0xE769,0xE76A,0xE76B,0xE76C,0xE76D,0xE76E,0xE76F,0xE770, +0xE771,0xE772,0xE773,0xE774,0xE775,0xE776,0xE777,0xE778, +0xE779,0xE77A,0xE77B,0xE77C,0xE77D,0xE77E,0xE780,0xE781, +0xE782,0xE783,0xE784,0xE785,0xE786,0xE787,0xE788,0xE789, +0xE78A,0xE78B,0xE78C,0xE78D,0xE78E,0xE78F,0xE790,0xE791, +0xE792,0xE793,0xE794,0xE795,0xE796,0xE797,0xE798,0xE799, +0xE79A,0xE79B,0xE79C,0xE79D,0xE79E,0xE79F,0xE7A0,0xE840, +0xE841,0xE842,0xE843,0xE844,0xE845,0xE846,0xE847,0xE848, +0xE849,0xE84A,0xE84B,0xE84C,0xE84D,0xE84E,0xF6CD,0xE84F, +0xE850,0xE851,0xE852,0xE853,0xE854,0xE855,0xE856,0xE857, +0xE858,0xE859,0xE85A,0xE85B,0xE85C,0xE85D,0xE85E,0xE85F, +0xE860,0xE861,0xE862,0xE863,0xE864,0xE865,0xE866,0xE867, +0xE868,0xE869,0xE86A,0xE86B,0xE86C,0xE86D,0xE86E,0xE86F, +0xE870,0xE871,0xE872,0xE873,0xE874,0xE875,0xE876,0xE877, +0xE878,0xE879,0xE87A,0xF6CE,0xE87B,0xE87C,0xE87D,0xE87E, +0xE880,0xE881,0xE882,0xE883,0xE884,0xE885,0xE886,0xE887, +0xE888,0xE889,0xE88A,0xE88B,0xE88C,0xE88D,0xE88E,0xE88F, +0xE890,0xE891,0xE892,0xE893,0xE894,0xEEC4,0xEEC5,0xEEC6, +0xD5EB,0xB6A4,0xEEC8,0xEEC7,0xEEC9,0xEECA,0xC7A5,0xEECB, +0xEECC,0xE895,0xB7B0,0xB5F6,0xEECD,0xEECF,0xE896,0xEECE, +0xE897,0xB8C6,0xEED0,0xEED1,0xEED2,0xB6DB,0xB3AE,0xD6D3, +0xC4C6,0xB1B5,0xB8D6,0xEED3,0xEED4,0xD4BF,0xC7D5,0xBEFB, +0xCED9,0xB9B3,0xEED6,0xEED5,0xEED8,0xEED7,0xC5A5,0xEED9, +0xEEDA,0xC7AE,0xEEDB,0xC7AF,0xEEDC,0xB2A7,0xEEDD,0xEEDE, +0xEEDF,0xEEE0,0xEEE1,0xD7EA,0xEEE2,0xEEE3,0xBCD8,0xEEE4, +0xD3CB,0xCCFA,0xB2AC,0xC1E5,0xEEE5,0xC7A6,0xC3AD,0xE898, +0xEEE6,0xEEE7,0xEEE8,0xEEE9,0xEEEA,0xEEEB,0xEEEC,0xE899, +0xEEED,0xEEEE,0xEEEF,0xE89A,0xE89B,0xEEF0,0xEEF1,0xEEF2, +0xEEF4,0xEEF3,0xE89C,0xEEF5,0xCDAD,0xC2C1,0xEEF6,0xEEF7, +0xEEF8,0xD5A1,0xEEF9,0xCFB3,0xEEFA,0xEEFB,0xE89D,0xEEFC, +0xEEFD,0xEFA1,0xEEFE,0xEFA2,0xB8F5,0xC3FA,0xEFA3,0xEFA4, +0xBDC2,0xD2BF,0xB2F9,0xEFA5,0xEFA6,0xEFA7,0xD2F8,0xEFA8, +0xD6FD,0xEFA9,0xC6CC,0xE89E,0xEFAA,0xEFAB,0xC1B4,0xEFAC, +0xCFFA,0xCBF8,0xEFAE,0xEFAD,0xB3FA,0xB9F8,0xEFAF,0xEFB0, +0xD0E2,0xEFB1,0xEFB2,0xB7E6,0xD0BF,0xEFB3,0xEFB4,0xEFB5, +0xC8F1,0xCCE0,0xEFB6,0xEFB7,0xEFB8,0xEFB9,0xEFBA,0xD5E0, +0xEFBB,0xB4ED,0xC3AA,0xEFBC,0xE89F,0xEFBD,0xEFBE,0xEFBF, +0xE8A0,0xCEFD,0xEFC0,0xC2E0,0xB4B8,0xD7B6,0xBDF5,0xE940, +0xCFC7,0xEFC3,0xEFC1,0xEFC2,0xEFC4,0xB6A7,0xBCFC,0xBEE2, +0xC3CC,0xEFC5,0xEFC6,0xE941,0xEFC7,0xEFCF,0xEFC8,0xEFC9, +0xEFCA,0xC7C2,0xEFF1,0xB6CD,0xEFCB,0xE942,0xEFCC,0xEFCD, +0xB6C6,0xC3BE,0xEFCE,0xE943,0xEFD0,0xEFD1,0xEFD2,0xD5F2, +0xE944,0xEFD3,0xC4F7,0xE945,0xEFD4,0xC4F8,0xEFD5,0xEFD6, +0xB8E4,0xB0F7,0xEFD7,0xEFD8,0xEFD9,0xE946,0xEFDA,0xEFDB, +0xEFDC,0xEFDD,0xE947,0xEFDE,0xBEB5,0xEFE1,0xEFDF,0xEFE0, +0xE948,0xEFE2,0xEFE3,0xC1CD,0xEFE4,0xEFE5,0xEFE6,0xEFE7, +0xEFE8,0xEFE9,0xEFEA,0xEFEB,0xEFEC,0xC0D8,0xE949,0xEFED, +0xC1AD,0xEFEE,0xEFEF,0xEFF0,0xE94A,0xE94B,0xCFE2,0xE94C, +0xE94D,0xE94E,0xE94F,0xE950,0xE951,0xE952,0xE953,0xB3A4, +0xE954,0xE955,0xE956,0xE957,0xE958,0xE959,0xE95A,0xE95B, +0xE95C,0xE95D,0xE95E,0xE95F,0xE960,0xE961,0xE962,0xE963, +0xE964,0xE965,0xE966,0xE967,0xE968,0xE969,0xE96A,0xE96B, +0xE96C,0xE96D,0xE96E,0xE96F,0xE970,0xE971,0xE972,0xE973, +0xE974,0xE975,0xE976,0xE977,0xE978,0xE979,0xE97A,0xE97B, +0xE97C,0xE97D,0xE97E,0xE980,0xE981,0xE982,0xE983,0xE984, +0xE985,0xE986,0xE987,0xE988,0xE989,0xE98A,0xE98B,0xE98C, +0xE98D,0xE98E,0xE98F,0xE990,0xE991,0xE992,0xE993,0xE994, +0xE995,0xE996,0xE997,0xE998,0xE999,0xE99A,0xE99B,0xE99C, +0xE99D,0xE99E,0xE99F,0xE9A0,0xEA40,0xEA41,0xEA42,0xEA43, +0xEA44,0xEA45,0xEA46,0xEA47,0xEA48,0xEA49,0xEA4A,0xEA4B, +0xEA4C,0xEA4D,0xEA4E,0xEA4F,0xEA50,0xEA51,0xEA52,0xEA53, +0xEA54,0xEA55,0xEA56,0xEA57,0xEA58,0xEA59,0xEA5A,0xEA5B, +0xC3C5,0xE3C5,0xC9C1,0xE3C6,0xEA5C,0xB1D5,0xCECA,0xB4B3, +0xC8F2,0xE3C7,0xCFD0,0xE3C8,0xBCE4,0xE3C9,0xE3CA,0xC3C6, +0xD5A2,0xC4D6,0xB9EB,0xCEC5,0xE3CB,0xC3F6,0xE3CC,0xEA5D, +0xB7A7,0xB8F3,0xBAD2,0xE3CD,0xE3CE,0xD4C4,0xE3CF,0xEA5E, +0xE3D0,0xD1CB,0xE3D1,0xE3D2,0xE3D3,0xE3D4,0xD1D6,0xE3D5, +0xB2FB,0xC0BB,0xE3D6,0xEA5F,0xC0AB,0xE3D7,0xE3D8,0xE3D9, +0xEA60,0xE3DA,0xE3DB,0xEA61,0xB8B7,0xDAE2,0xEA62,0xB6D3, +0xEA63,0xDAE4,0xDAE3,0xEA64,0xEA65,0xEA66,0xEA67,0xEA68, +0xEA69,0xEA6A,0xDAE6,0xEA6B,0xEA6C,0xEA6D,0xC8EE,0xEA6E, +0xEA6F,0xDAE5,0xB7C0,0xD1F4,0xD2F5,0xD5F3,0xBDD7,0xEA70, +0xEA71,0xEA72,0xEA73,0xD7E8,0xDAE8,0xDAE7,0xEA74,0xB0A2, +0xCDD3,0xEA75,0xDAE9,0xEA76,0xB8BD,0xBCCA,0xC2BD,0xC2A4, +0xB3C2,0xDAEA,0xEA77,0xC2AA,0xC4B0,0xBDB5,0xEA78,0xEA79, +0xCFDE,0xEA7A,0xEA7B,0xEA7C,0xDAEB,0xC9C2,0xEA7D,0xEA7E, +0xEA80,0xEA81,0xEA82,0xB1DD,0xEA83,0xEA84,0xEA85,0xDAEC, +0xEA86,0xB6B8,0xD4BA,0xEA87,0xB3FD,0xEA88,0xEA89,0xDAED, +0xD4C9,0xCFD5,0xC5E3,0xEA8A,0xDAEE,0xEA8B,0xEA8C,0xEA8D, +0xEA8E,0xEA8F,0xDAEF,0xEA90,0xDAF0,0xC1EA,0xCCD5,0xCFDD, +0xEA91,0xEA92,0xEA93,0xEA94,0xEA95,0xEA96,0xEA97,0xEA98, +0xEA99,0xEA9A,0xEA9B,0xEA9C,0xEA9D,0xD3E7,0xC2A1,0xEA9E, +0xDAF1,0xEA9F,0xEAA0,0xCBE5,0xEB40,0xDAF2,0xEB41,0xCBE6, +0xD2FE,0xEB42,0xEB43,0xEB44,0xB8F4,0xEB45,0xEB46,0xDAF3, +0xB0AF,0xCFB6,0xEB47,0xEB48,0xD5CF,0xEB49,0xEB4A,0xEB4B, +0xEB4C,0xEB4D,0xEB4E,0xEB4F,0xEB50,0xEB51,0xEB52,0xCBED, +0xEB53,0xEB54,0xEB55,0xEB56,0xEB57,0xEB58,0xEB59,0xEB5A, +0xDAF4,0xEB5B,0xEB5C,0xE3C4,0xEB5D,0xEB5E,0xC1A5,0xEB5F, +0xEB60,0xF6BF,0xEB61,0xEB62,0xF6C0,0xF6C1,0xC4D1,0xEB63, +0xC8B8,0xD1E3,0xEB64,0xEB65,0xD0DB,0xD1C5,0xBCAF,0xB9CD, +0xEB66,0xEFF4,0xEB67,0xEB68,0xB4C6,0xD3BA,0xF6C2,0xB3FB, +0xEB69,0xEB6A,0xF6C3,0xEB6B,0xEB6C,0xB5F1,0xEB6D,0xEB6E, +0xEB6F,0xEB70,0xEB71,0xEB72,0xEB73,0xEB74,0xEB75,0xEB76, +0xF6C5,0xEB77,0xEB78,0xEB79,0xEB7A,0xEB7B,0xEB7C,0xEB7D, +0xD3EA,0xF6A7,0xD1A9,0xEB7E,0xEB80,0xEB81,0xEB82,0xF6A9, +0xEB83,0xEB84,0xEB85,0xF6A8,0xEB86,0xEB87,0xC1E3,0xC0D7, +0xEB88,0xB1A2,0xEB89,0xEB8A,0xEB8B,0xEB8C,0xCEED,0xEB8D, +0xD0E8,0xF6AB,0xEB8E,0xEB8F,0xCFF6,0xEB90,0xF6AA,0xD5F0, +0xF6AC,0xC3B9,0xEB91,0xEB92,0xEB93,0xBBF4,0xF6AE,0xF6AD, +0xEB94,0xEB95,0xEB96,0xC4DE,0xEB97,0xEB98,0xC1D8,0xEB99, +0xEB9A,0xEB9B,0xEB9C,0xEB9D,0xCBAA,0xEB9E,0xCFBC,0xEB9F, +0xEBA0,0xEC40,0xEC41,0xEC42,0xEC43,0xEC44,0xEC45,0xEC46, +0xEC47,0xEC48,0xF6AF,0xEC49,0xEC4A,0xF6B0,0xEC4B,0xEC4C, +0xF6B1,0xEC4D,0xC2B6,0xEC4E,0xEC4F,0xEC50,0xEC51,0xEC52, +0xB0D4,0xC5F9,0xEC53,0xEC54,0xEC55,0xEC56,0xF6B2,0xEC57, +0xEC58,0xEC59,0xEC5A,0xEC5B,0xEC5C,0xEC5D,0xEC5E,0xEC5F, +0xEC60,0xEC61,0xEC62,0xEC63,0xEC64,0xEC65,0xEC66,0xEC67, +0xEC68,0xEC69,0xC7E0,0xF6A6,0xEC6A,0xEC6B,0xBEB8,0xEC6C, +0xEC6D,0xBEB2,0xEC6E,0xB5E5,0xEC6F,0xEC70,0xB7C7,0xEC71, +0xBFBF,0xC3D2,0xC3E6,0xEC72,0xEC73,0xD8CC,0xEC74,0xEC75, +0xEC76,0xB8EF,0xEC77,0xEC78,0xEC79,0xEC7A,0xEC7B,0xEC7C, +0xEC7D,0xEC7E,0xEC80,0xBDF9,0xD1A5,0xEC81,0xB0D0,0xEC82, +0xEC83,0xEC84,0xEC85,0xEC86,0xF7B0,0xEC87,0xEC88,0xEC89, +0xEC8A,0xEC8B,0xEC8C,0xEC8D,0xEC8E,0xF7B1,0xEC8F,0xEC90, +0xEC91,0xEC92,0xEC93,0xD0AC,0xEC94,0xB0B0,0xEC95,0xEC96, +0xEC97,0xF7B2,0xF7B3,0xEC98,0xF7B4,0xEC99,0xEC9A,0xEC9B, +0xC7CA,0xEC9C,0xEC9D,0xEC9E,0xEC9F,0xECA0,0xED40,0xED41, +0xBECF,0xED42,0xED43,0xF7B7,0xED44,0xED45,0xED46,0xED47, +0xED48,0xED49,0xED4A,0xF7B6,0xED4B,0xB1DE,0xED4C,0xF7B5, +0xED4D,0xED4E,0xF7B8,0xED4F,0xF7B9,0xED50,0xED51,0xED52, +0xED53,0xED54,0xED55,0xED56,0xED57,0xED58,0xED59,0xED5A, +0xED5B,0xED5C,0xED5D,0xED5E,0xED5F,0xED60,0xED61,0xED62, +0xED63,0xED64,0xED65,0xED66,0xED67,0xED68,0xED69,0xED6A, +0xED6B,0xED6C,0xED6D,0xED6E,0xED6F,0xED70,0xED71,0xED72, +0xED73,0xED74,0xED75,0xED76,0xED77,0xED78,0xED79,0xED7A, +0xED7B,0xED7C,0xED7D,0xED7E,0xED80,0xED81,0xCEA4,0xC8CD, +0xED82,0xBAAB,0xE8B8,0xE8B9,0xE8BA,0xBEC2,0xED83,0xED84, +0xED85,0xED86,0xED87,0xD2F4,0xED88,0xD4CF,0xC9D8,0xED89, +0xED8A,0xED8B,0xED8C,0xED8D,0xED8E,0xED8F,0xED90,0xED91, +0xED92,0xED93,0xED94,0xED95,0xED96,0xED97,0xED98,0xED99, +0xED9A,0xED9B,0xED9C,0xED9D,0xED9E,0xED9F,0xEDA0,0xEE40, +0xEE41,0xEE42,0xEE43,0xEE44,0xEE45,0xEE46,0xEE47,0xEE48, +0xEE49,0xEE4A,0xEE4B,0xEE4C,0xEE4D,0xEE4E,0xEE4F,0xEE50, +0xEE51,0xEE52,0xEE53,0xEE54,0xEE55,0xEE56,0xEE57,0xEE58, +0xEE59,0xEE5A,0xEE5B,0xEE5C,0xEE5D,0xEE5E,0xEE5F,0xEE60, +0xEE61,0xEE62,0xEE63,0xEE64,0xEE65,0xEE66,0xEE67,0xEE68, +0xEE69,0xEE6A,0xEE6B,0xEE6C,0xEE6D,0xEE6E,0xEE6F,0xEE70, +0xEE71,0xEE72,0xEE73,0xEE74,0xEE75,0xEE76,0xEE77,0xEE78, +0xEE79,0xEE7A,0xEE7B,0xEE7C,0xEE7D,0xEE7E,0xEE80,0xEE81, +0xEE82,0xEE83,0xEE84,0xEE85,0xEE86,0xEE87,0xEE88,0xEE89, +0xEE8A,0xEE8B,0xEE8C,0xEE8D,0xEE8E,0xEE8F,0xEE90,0xEE91, +0xEE92,0xEE93,0xEE94,0xEE95,0xEE96,0xEE97,0xEE98,0xEE99, +0xEE9A,0xEE9B,0xEE9C,0xEE9D,0xEE9E,0xEE9F,0xEEA0,0xEF40, +0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xD2B3,0xB6A5,0xC7EA, +0xF1FC,0xCFEE,0xCBB3,0xD0EB,0xE7EF,0xCDE7,0xB9CB,0xB6D9, +0xF1FD,0xB0E4,0xCBCC,0xF1FE,0xD4A4,0xC2AD,0xC1EC,0xC6C4, +0xBEB1,0xF2A1,0xBCD5,0xEF46,0xF2A2,0xF2A3,0xEF47,0xF2A4, +0xD2C3,0xC6B5,0xEF48,0xCDC7,0xF2A5,0xEF49,0xD3B1,0xBFC5, +0xCCE2,0xEF4A,0xF2A6,0xF2A7,0xD1D5,0xB6EE,0xF2A8,0xF2A9, +0xB5DF,0xF2AA,0xF2AB,0xEF4B,0xB2FC,0xF2AC,0xF2AD,0xC8A7, +0xEF4C,0xEF4D,0xEF4E,0xEF4F,0xEF50,0xEF51,0xEF52,0xEF53, +0xEF54,0xEF55,0xEF56,0xEF57,0xEF58,0xEF59,0xEF5A,0xEF5B, +0xEF5C,0xEF5D,0xEF5E,0xEF5F,0xEF60,0xEF61,0xEF62,0xEF63, +0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0xEF6B, +0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0xB7E7,0xEF72, +0xEF73,0xECA9,0xECAA,0xECAB,0xEF74,0xECAC,0xEF75,0xEF76, +0xC6AE,0xECAD,0xECAE,0xEF77,0xEF78,0xEF79,0xB7C9,0xCAB3, +0xEF7A,0xEF7B,0xEF7C,0xEF7D,0xEF7E,0xEF80,0xEF81,0xE2B8, +0xF7CF,0xEF82,0xEF83,0xEF84,0xEF85,0xEF86,0xEF87,0xEF88, +0xEF89,0xEF8A,0xEF8B,0xEF8C,0xEF8D,0xEF8E,0xEF8F,0xEF90, +0xEF91,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0xEF97,0xEF98, +0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0xEF9F,0xEFA0, +0xF040,0xF041,0xF042,0xF043,0xF044,0xF7D0,0xF045,0xF046, +0xB2CD,0xF047,0xF048,0xF049,0xF04A,0xF04B,0xF04C,0xF04D, +0xF04E,0xF04F,0xF050,0xF051,0xF052,0xF053,0xF054,0xF055, +0xF056,0xF057,0xF058,0xF059,0xF05A,0xF05B,0xF05C,0xF05D, +0xF05E,0xF05F,0xF060,0xF061,0xF062,0xF063,0xF7D1,0xF064, +0xF065,0xF066,0xF067,0xF068,0xF069,0xF06A,0xF06B,0xF06C, +0xF06D,0xF06E,0xF06F,0xF070,0xF071,0xF072,0xF073,0xF074, +0xF075,0xF076,0xF077,0xF078,0xF079,0xF07A,0xF07B,0xF07C, +0xF07D,0xF07E,0xF080,0xF081,0xF082,0xF083,0xF084,0xF085, +0xF086,0xF087,0xF088,0xF089,0xF7D3,0xF7D2,0xF08A,0xF08B, +0xF08C,0xF08D,0xF08E,0xF08F,0xF090,0xF091,0xF092,0xF093, +0xF094,0xF095,0xF096,0xE2BB,0xF097,0xBCA2,0xF098,0xE2BC, +0xE2BD,0xE2BE,0xE2BF,0xE2C0,0xE2C1,0xB7B9,0xD2FB,0xBDA4, +0xCACE,0xB1A5,0xCBC7,0xF099,0xE2C2,0xB6FC,0xC8C4,0xE2C3, +0xF09A,0xF09B,0xBDC8,0xF09C,0xB1FD,0xE2C4,0xF09D,0xB6F6, +0xE2C5,0xC4D9,0xF09E,0xF09F,0xE2C6,0xCFDA,0xB9DD,0xE2C7, +0xC0A1,0xF0A0,0xE2C8,0xB2F6,0xF140,0xE2C9,0xF141,0xC1F3, +0xE2CA,0xE2CB,0xC2F8,0xE2CC,0xE2CD,0xE2CE,0xCAD7,0xD8B8, +0xD9E5,0xCFE3,0xF142,0xF143,0xF144,0xF145,0xF146,0xF147, +0xF148,0xF149,0xF14A,0xF14B,0xF14C,0xF0A5,0xF14D,0xF14E, +0xDCB0,0xF14F,0xF150,0xF151,0xF152,0xF153,0xF154,0xF155, +0xF156,0xF157,0xF158,0xF159,0xF15A,0xF15B,0xF15C,0xF15D, +0xF15E,0xF15F,0xF160,0xF161,0xF162,0xF163,0xF164,0xF165, +0xF166,0xF167,0xF168,0xF169,0xF16A,0xF16B,0xF16C,0xF16D, +0xF16E,0xF16F,0xF170,0xF171,0xF172,0xF173,0xF174,0xF175, +0xF176,0xF177,0xF178,0xF179,0xF17A,0xF17B,0xF17C,0xF17D, +0xF17E,0xF180,0xF181,0xF182,0xF183,0xF184,0xF185,0xF186, +0xF187,0xF188,0xF189,0xF18A,0xF18B,0xF18C,0xF18D,0xF18E, +0xF18F,0xF190,0xF191,0xF192,0xF193,0xF194,0xF195,0xF196, +0xF197,0xF198,0xF199,0xF19A,0xF19B,0xF19C,0xF19D,0xF19E, +0xF19F,0xF1A0,0xF240,0xF241,0xF242,0xF243,0xF244,0xF245, +0xF246,0xF247,0xF248,0xF249,0xF24A,0xF24B,0xF24C,0xF24D, +0xF24E,0xF24F,0xF250,0xF251,0xF252,0xF253,0xF254,0xF255, +0xF256,0xF257,0xF258,0xF259,0xF25A,0xF25B,0xF25C,0xF25D, +0xF25E,0xF25F,0xF260,0xF261,0xF262,0xF263,0xF264,0xF265, +0xF266,0xF267,0xF268,0xF269,0xF26A,0xF26B,0xF26C,0xF26D, +0xF26E,0xF26F,0xF270,0xF271,0xF272,0xF273,0xF274,0xF275, +0xF276,0xF277,0xF278,0xF279,0xF27A,0xF27B,0xF27C,0xF27D, +0xF27E,0xF280,0xF281,0xF282,0xF283,0xF284,0xF285,0xF286, +0xF287,0xF288,0xF289,0xF28A,0xF28B,0xF28C,0xF28D,0xF28E, +0xF28F,0xF290,0xF291,0xF292,0xF293,0xF294,0xF295,0xF296, +0xF297,0xF298,0xF299,0xF29A,0xF29B,0xF29C,0xF29D,0xF29E, +0xF29F,0xF2A0,0xF340,0xF341,0xF342,0xF343,0xF344,0xF345, +0xF346,0xF347,0xF348,0xF349,0xF34A,0xF34B,0xF34C,0xF34D, +0xF34E,0xF34F,0xF350,0xF351,0xC2ED,0xD4A6,0xCDD4,0xD1B1, +0xB3DB,0xC7FD,0xF352,0xB2B5,0xC2BF,0xE6E0,0xCABB,0xE6E1, +0xE6E2,0xBED4,0xE6E3,0xD7A4,0xCDD5,0xE6E5,0xBCDD,0xE6E4, +0xE6E6,0xE6E7,0xC2EE,0xF353,0xBDBE,0xE6E8,0xC2E6,0xBAA7, +0xE6E9,0xF354,0xE6EA,0xB3D2,0xD1E9,0xF355,0xF356,0xBFA5, +0xE6EB,0xC6EF,0xE6EC,0xE6ED,0xF357,0xF358,0xE6EE,0xC6AD, +0xE6EF,0xF359,0xC9A7,0xE6F0,0xE6F1,0xE6F2,0xE5B9,0xE6F3, +0xE6F4,0xC2E2,0xE6F5,0xE6F6,0xD6E8,0xE6F7,0xF35A,0xE6F8, +0xB9C7,0xF35B,0xF35C,0xF35D,0xF35E,0xF35F,0xF360,0xF361, +0xF7BB,0xF7BA,0xF362,0xF363,0xF364,0xF365,0xF7BE,0xF7BC, +0xBAA1,0xF366,0xF7BF,0xF367,0xF7C0,0xF368,0xF369,0xF36A, +0xF7C2,0xF7C1,0xF7C4,0xF36B,0xF36C,0xF7C3,0xF36D,0xF36E, +0xF36F,0xF370,0xF371,0xF7C5,0xF7C6,0xF372,0xF373,0xF374, +0xF375,0xF7C7,0xF376,0xCBE8,0xF377,0xF378,0xF379,0xF37A, +0xB8DF,0xF37B,0xF37C,0xF37D,0xF37E,0xF380,0xF381,0xF7D4, +0xF382,0xF7D5,0xF383,0xF384,0xF385,0xF386,0xF7D6,0xF387, +0xF388,0xF389,0xF38A,0xF7D8,0xF38B,0xF7DA,0xF38C,0xF7D7, +0xF38D,0xF38E,0xF38F,0xF390,0xF391,0xF392,0xF393,0xF394, +0xF395,0xF7DB,0xF396,0xF7D9,0xF397,0xF398,0xF399,0xF39A, +0xF39B,0xF39C,0xF39D,0xD7D7,0xF39E,0xF39F,0xF3A0,0xF440, +0xF7DC,0xF441,0xF442,0xF443,0xF444,0xF445,0xF446,0xF7DD, +0xF447,0xF448,0xF449,0xF7DE,0xF44A,0xF44B,0xF44C,0xF44D, +0xF44E,0xF44F,0xF450,0xF451,0xF452,0xF453,0xF454,0xF7DF, +0xF455,0xF456,0xF457,0xF7E0,0xF458,0xF459,0xF45A,0xF45B, +0xF45C,0xF45D,0xF45E,0xF45F,0xF460,0xF461,0xF462,0xDBCB, +0xF463,0xF464,0xD8AA,0xF465,0xF466,0xF467,0xF468,0xF469, +0xF46A,0xF46B,0xF46C,0xE5F7,0xB9ED,0xF46D,0xF46E,0xF46F, +0xF470,0xBFFD,0xBBEA,0xF7C9,0xC6C7,0xF7C8,0xF471,0xF7CA, +0xF7CC,0xF7CB,0xF472,0xF473,0xF474,0xF7CD,0xF475,0xCEBA, +0xF476,0xF7CE,0xF477,0xF478,0xC4A7,0xF479,0xF47A,0xF47B, +0xF47C,0xF47D,0xF47E,0xF480,0xF481,0xF482,0xF483,0xF484, +0xF485,0xF486,0xF487,0xF488,0xF489,0xF48A,0xF48B,0xF48C, +0xF48D,0xF48E,0xF48F,0xF490,0xF491,0xF492,0xF493,0xF494, +0xF495,0xF496,0xF497,0xF498,0xF499,0xF49A,0xF49B,0xF49C, +0xF49D,0xF49E,0xF49F,0xF4A0,0xF540,0xF541,0xF542,0xF543, +0xF544,0xF545,0xF546,0xF547,0xF548,0xF549,0xF54A,0xF54B, +0xF54C,0xF54D,0xF54E,0xF54F,0xF550,0xF551,0xF552,0xF553, +0xF554,0xF555,0xF556,0xF557,0xF558,0xF559,0xF55A,0xF55B, +0xF55C,0xF55D,0xF55E,0xF55F,0xF560,0xF561,0xF562,0xF563, +0xF564,0xF565,0xF566,0xF567,0xF568,0xF569,0xF56A,0xF56B, +0xF56C,0xF56D,0xF56E,0xF56F,0xF570,0xF571,0xF572,0xF573, +0xF574,0xF575,0xF576,0xF577,0xF578,0xF579,0xF57A,0xF57B, +0xF57C,0xF57D,0xF57E,0xF580,0xF581,0xF582,0xF583,0xF584, +0xF585,0xF586,0xF587,0xF588,0xF589,0xF58A,0xF58B,0xF58C, +0xF58D,0xF58E,0xF58F,0xF590,0xF591,0xF592,0xF593,0xF594, +0xF595,0xF596,0xF597,0xF598,0xF599,0xF59A,0xF59B,0xF59C, +0xF59D,0xF59E,0xF59F,0xF5A0,0xF640,0xF641,0xF642,0xF643, +0xF644,0xF645,0xF646,0xF647,0xF648,0xF649,0xF64A,0xF64B, +0xF64C,0xF64D,0xF64E,0xF64F,0xF650,0xF651,0xF652,0xF653, +0xF654,0xF655,0xF656,0xF657,0xF658,0xF659,0xF65A,0xF65B, +0xF65C,0xF65D,0xF65E,0xF65F,0xF660,0xF661,0xF662,0xF663, +0xF664,0xF665,0xF666,0xF667,0xF668,0xF669,0xF66A,0xF66B, +0xF66C,0xF66D,0xF66E,0xF66F,0xF670,0xF671,0xF672,0xF673, +0xF674,0xF675,0xF676,0xF677,0xF678,0xF679,0xF67A,0xF67B, +0xF67C,0xF67D,0xF67E,0xF680,0xF681,0xF682,0xF683,0xF684, +0xF685,0xF686,0xF687,0xF688,0xF689,0xF68A,0xF68B,0xF68C, +0xF68D,0xF68E,0xF68F,0xF690,0xF691,0xF692,0xF693,0xF694, +0xF695,0xF696,0xF697,0xF698,0xF699,0xF69A,0xF69B,0xF69C, +0xF69D,0xF69E,0xF69F,0xF6A0,0xF740,0xF741,0xF742,0xF743, +0xF744,0xF745,0xF746,0xF747,0xF748,0xF749,0xF74A,0xF74B, +0xF74C,0xF74D,0xF74E,0xF74F,0xF750,0xF751,0xF752,0xF753, +0xF754,0xF755,0xF756,0xF757,0xF758,0xF759,0xF75A,0xF75B, +0xF75C,0xF75D,0xF75E,0xF75F,0xF760,0xF761,0xF762,0xF763, +0xF764,0xF765,0xF766,0xF767,0xF768,0xF769,0xF76A,0xF76B, +0xF76C,0xF76D,0xF76E,0xF76F,0xF770,0xF771,0xF772,0xF773, +0xF774,0xF775,0xF776,0xF777,0xF778,0xF779,0xF77A,0xF77B, +0xF77C,0xF77D,0xF77E,0xF780,0xD3E3,0xF781,0xF782,0xF6CF, +0xF783,0xC2B3,0xF6D0,0xF784,0xF785,0xF6D1,0xF6D2,0xF6D3, +0xF6D4,0xF786,0xF787,0xF6D6,0xF788,0xB1AB,0xF6D7,0xF789, +0xF6D8,0xF6D9,0xF6DA,0xF78A,0xF6DB,0xF6DC,0xF78B,0xF78C, +0xF78D,0xF78E,0xF6DD,0xF6DE,0xCFCA,0xF78F,0xF6DF,0xF6E0, +0xF6E1,0xF6E2,0xF6E3,0xF6E4,0xC0F0,0xF6E5,0xF6E6,0xF6E7, +0xF6E8,0xF6E9,0xF790,0xF6EA,0xF791,0xF6EB,0xF6EC,0xF792, +0xF6ED,0xF6EE,0xF6EF,0xF6F0,0xF6F1,0xF6F2,0xF6F3,0xF6F4, +0xBEA8,0xF793,0xF6F5,0xF6F6,0xF6F7,0xF6F8,0xF794,0xF795, +0xF796,0xF797,0xF798,0xC8FA,0xF6F9,0xF6FA,0xF6FB,0xF6FC, +0xF799,0xF79A,0xF6FD,0xF6FE,0xF7A1,0xF7A2,0xF7A3,0xF7A4, +0xF7A5,0xF79B,0xF79C,0xF7A6,0xF7A7,0xF7A8,0xB1EE,0xF7A9, +0xF7AA,0xF7AB,0xF79D,0xF79E,0xF7AC,0xF7AD,0xC1DB,0xF7AE, +0xF79F,0xF7A0,0xF7AF,0xF840,0xF841,0xF842,0xF843,0xF844, +0xF845,0xF846,0xF847,0xF848,0xF849,0xF84A,0xF84B,0xF84C, +0xF84D,0xF84E,0xF84F,0xF850,0xF851,0xF852,0xF853,0xF854, +0xF855,0xF856,0xF857,0xF858,0xF859,0xF85A,0xF85B,0xF85C, +0xF85D,0xF85E,0xF85F,0xF860,0xF861,0xF862,0xF863,0xF864, +0xF865,0xF866,0xF867,0xF868,0xF869,0xF86A,0xF86B,0xF86C, +0xF86D,0xF86E,0xF86F,0xF870,0xF871,0xF872,0xF873,0xF874, +0xF875,0xF876,0xF877,0xF878,0xF879,0xF87A,0xF87B,0xF87C, +0xF87D,0xF87E,0xF880,0xF881,0xF882,0xF883,0xF884,0xF885, +0xF886,0xF887,0xF888,0xF889,0xF88A,0xF88B,0xF88C,0xF88D, +0xF88E,0xF88F,0xF890,0xF891,0xF892,0xF893,0xF894,0xF895, +0xF896,0xF897,0xF898,0xF899,0xF89A,0xF89B,0xF89C,0xF89D, +0xF89E,0xF89F,0xF8A0,0xF940,0xF941,0xF942,0xF943,0xF944, +0xF945,0xF946,0xF947,0xF948,0xF949,0xF94A,0xF94B,0xF94C, +0xF94D,0xF94E,0xF94F,0xF950,0xF951,0xF952,0xF953,0xF954, +0xF955,0xF956,0xF957,0xF958,0xF959,0xF95A,0xF95B,0xF95C, +0xF95D,0xF95E,0xF95F,0xF960,0xF961,0xF962,0xF963,0xF964, +0xF965,0xF966,0xF967,0xF968,0xF969,0xF96A,0xF96B,0xF96C, +0xF96D,0xF96E,0xF96F,0xF970,0xF971,0xF972,0xF973,0xF974, +0xF975,0xF976,0xF977,0xF978,0xF979,0xF97A,0xF97B,0xF97C, +0xF97D,0xF97E,0xF980,0xF981,0xF982,0xF983,0xF984,0xF985, +0xF986,0xF987,0xF988,0xF989,0xF98A,0xF98B,0xF98C,0xF98D, +0xF98E,0xF98F,0xF990,0xF991,0xF992,0xF993,0xF994,0xF995, +0xF996,0xF997,0xF998,0xF999,0xF99A,0xF99B,0xF99C,0xF99D, +0xF99E,0xF99F,0xF9A0,0xFA40,0xFA41,0xFA42,0xFA43,0xFA44, +0xFA45,0xFA46,0xFA47,0xFA48,0xFA49,0xFA4A,0xFA4B,0xFA4C, +0xFA4D,0xFA4E,0xFA4F,0xFA50,0xFA51,0xFA52,0xFA53,0xFA54, +0xFA55,0xFA56,0xFA57,0xFA58,0xFA59,0xFA5A,0xFA5B,0xFA5C, +0xFA5D,0xFA5E,0xFA5F,0xFA60,0xFA61,0xFA62,0xFA63,0xFA64, +0xFA65,0xFA66,0xFA67,0xFA68,0xFA69,0xFA6A,0xFA6B,0xFA6C, +0xFA6D,0xFA6E,0xFA6F,0xFA70,0xFA71,0xFA72,0xFA73,0xFA74, +0xFA75,0xFA76,0xFA77,0xFA78,0xFA79,0xFA7A,0xFA7B,0xFA7C, +0xFA7D,0xFA7E,0xFA80,0xFA81,0xFA82,0xFA83,0xFA84,0xFA85, +0xFA86,0xFA87,0xFA88,0xFA89,0xFA8A,0xFA8B,0xFA8C,0xFA8D, +0xFA8E,0xFA8F,0xFA90,0xFA91,0xFA92,0xFA93,0xFA94,0xFA95, +0xFA96,0xFA97,0xFA98,0xFA99,0xFA9A,0xFA9B,0xFA9C,0xFA9D, +0xFA9E,0xFA9F,0xFAA0,0xFB40,0xFB41,0xFB42,0xFB43,0xFB44, +0xFB45,0xFB46,0xFB47,0xFB48,0xFB49,0xFB4A,0xFB4B,0xFB4C, +0xFB4D,0xFB4E,0xFB4F,0xFB50,0xFB51,0xFB52,0xFB53,0xFB54, +0xFB55,0xFB56,0xFB57,0xFB58,0xFB59,0xFB5A,0xFB5B,0xC4F1, +0xF0AF,0xBCA6,0xF0B0,0xC3F9,0xFB5C,0xC5B8,0xD1BB,0xFB5D, +0xF0B1,0xF0B2,0xF0B3,0xF0B4,0xF0B5,0xD1BC,0xFB5E,0xD1EC, +0xFB5F,0xF0B7,0xF0B6,0xD4A7,0xFB60,0xCDD2,0xF0B8,0xF0BA, +0xF0B9,0xF0BB,0xF0BC,0xFB61,0xFB62,0xB8EB,0xF0BD,0xBAE8, +0xFB63,0xF0BE,0xF0BF,0xBEE9,0xF0C0,0xB6EC,0xF0C1,0xF0C2, +0xF0C3,0xF0C4,0xC8B5,0xF0C5,0xF0C6,0xFB64,0xF0C7,0xC5F4, +0xFB65,0xF0C8,0xFB66,0xFB67,0xFB68,0xF0C9,0xFB69,0xF0CA, +0xF7BD,0xFB6A,0xF0CB,0xF0CC,0xF0CD,0xFB6B,0xF0CE,0xFB6C, +0xFB6D,0xFB6E,0xFB6F,0xF0CF,0xBAD7,0xFB70,0xF0D0,0xF0D1, +0xF0D2,0xF0D3,0xF0D4,0xF0D5,0xF0D6,0xF0D8,0xFB71,0xFB72, +0xD3A5,0xF0D7,0xFB73,0xF0D9,0xFB74,0xFB75,0xFB76,0xFB77, +0xFB78,0xFB79,0xFB7A,0xFB7B,0xFB7C,0xFB7D,0xF5BA,0xC2B9, +0xFB7E,0xFB80,0xF7E4,0xFB81,0xFB82,0xFB83,0xFB84,0xF7E5, +0xF7E6,0xFB85,0xFB86,0xF7E7,0xFB87,0xFB88,0xFB89,0xFB8A, +0xFB8B,0xFB8C,0xF7E8,0xC2B4,0xFB8D,0xFB8E,0xFB8F,0xFB90, +0xFB91,0xFB92,0xFB93,0xFB94,0xFB95,0xF7EA,0xFB96,0xF7EB, +0xFB97,0xFB98,0xFB99,0xFB9A,0xFB9B,0xFB9C,0xC2F3,0xFB9D, +0xFB9E,0xFB9F,0xFBA0,0xFC40,0xFC41,0xFC42,0xFC43,0xFC44, +0xFC45,0xFC46,0xFC47,0xFC48,0xF4F0,0xFC49,0xFC4A,0xFC4B, +0xF4EF,0xFC4C,0xFC4D,0xC2E9,0xFC4E,0xF7E1,0xF7E2,0xFC4F, +0xFC50,0xFC51,0xFC52,0xFC53,0xBBC6,0xFC54,0xFC55,0xFC56, +0xFC57,0xD9E4,0xFC58,0xFC59,0xFC5A,0xCAF2,0xC0E8,0xF0A4, +0xFC5B,0xBADA,0xFC5C,0xFC5D,0xC7AD,0xFC5E,0xFC5F,0xFC60, +0xC4AC,0xFC61,0xFC62,0xF7EC,0xF7ED,0xF7EE,0xFC63,0xF7F0, +0xF7EF,0xFC64,0xF7F1,0xFC65,0xFC66,0xF7F4,0xFC67,0xF7F3, +0xFC68,0xF7F2,0xF7F5,0xFC69,0xFC6A,0xFC6B,0xFC6C,0xF7F6, +0xFC6D,0xFC6E,0xFC6F,0xFC70,0xFC71,0xFC72,0xFC73,0xFC74, +0xFC75,0xEDE9,0xFC76,0xEDEA,0xEDEB,0xFC77,0xF6BC,0xFC78, +0xFC79,0xFC7A,0xFC7B,0xFC7C,0xFC7D,0xFC7E,0xFC80,0xFC81, +0xFC82,0xFC83,0xFC84,0xF6BD,0xFC85,0xF6BE,0xB6A6,0xFC86, +0xD8BE,0xFC87,0xFC88,0xB9C4,0xFC89,0xFC8A,0xFC8B,0xD8BB, +0xFC8C,0xDCB1,0xFC8D,0xFC8E,0xFC8F,0xFC90,0xFC91,0xFC92, +0xCAF3,0xFC93,0xF7F7,0xFC94,0xFC95,0xFC96,0xFC97,0xFC98, +0xFC99,0xFC9A,0xFC9B,0xFC9C,0xF7F8,0xFC9D,0xFC9E,0xF7F9, +0xFC9F,0xFCA0,0xFD40,0xFD41,0xFD42,0xFD43,0xFD44,0xF7FB, +0xFD45,0xF7FA,0xFD46,0xB1C7,0xFD47,0xF7FC,0xF7FD,0xFD48, +0xFD49,0xFD4A,0xFD4B,0xFD4C,0xF7FE,0xFD4D,0xFD4E,0xFD4F, +0xFD50,0xFD51,0xFD52,0xFD53,0xFD54,0xFD55,0xFD56,0xFD57, +0xC6EB,0xECB4,0xFD58,0xFD59,0xFD5A,0xFD5B,0xFD5C,0xFD5D, +0xFD5E,0xFD5F,0xFD60,0xFD61,0xFD62,0xFD63,0xFD64,0xFD65, +0xFD66,0xFD67,0xFD68,0xFD69,0xFD6A,0xFD6B,0xFD6C,0xFD6D, +0xFD6E,0xFD6F,0xFD70,0xFD71,0xFD72,0xFD73,0xFD74,0xFD75, +0xFD76,0xFD77,0xFD78,0xFD79,0xFD7A,0xFD7B,0xFD7C,0xFD7D, +0xFD7E,0xFD80,0xFD81,0xFD82,0xFD83,0xFD84,0xFD85,0xB3DD, +0xF6B3,0xFD86,0xFD87,0xF6B4,0xC1E4,0xF6B5,0xF6B6,0xF6B7, +0xF6B8,0xF6B9,0xF6BA,0xC8A3,0xF6BB,0xFD88,0xFD89,0xFD8A, +0xFD8B,0xFD8C,0xFD8D,0xFD8E,0xFD8F,0xFD90,0xFD91,0xFD92, +0xFD93,0xC1FA,0xB9A8,0xEDE8,0xFD94,0xFD95,0xFD96,0xB9EA, +0xD9DF,0xFD97,0xFD98,0xFD99,0xFD9A,0xFD9B}; + +/* page 7 0xF92C-0xFA29 */ +static uint16 tab_uni_gbk7[]={ +0xFD9C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFD9D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFD9E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xFD9F, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xFDA0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xFE40,0xFE41,0xFE42,0xFE43, 0,0xFE44, 0,0xFE45, +0xFE46, 0, 0, 0,0xFE47, 0, 0, 0, + 0, 0, 0,0xFE48,0xFE49,0xFE4A, 0,0xFE4B, +0xFE4C, 0, 0,0xFE4D,0xFE4E,0xFE4F}; + +/* page 8 0xFE30-0xFFE5 */ +static uint16 tab_uni_gbk8[]={ +0xA955,0xA6F2, 0,0xA6F4,0xA6F5,0xA6E0,0xA6E1,0xA6F0, +0xA6F1,0xA6E2,0xA6E3,0xA6EE,0xA6EF,0xA6E6,0xA6E7,0xA6E4, +0xA6E5,0xA6E8,0xA6E9,0xA6EA,0xA6EB, 0, 0, 0, + 0,0xA968,0xA969,0xA96A,0xA96B,0xA96C,0xA96D,0xA96E, +0xA96F,0xA970,0xA971, 0,0xA972,0xA973,0xA974,0xA975, + 0,0xA976,0xA977,0xA978,0xA979,0xA97A,0xA97B,0xA97C, +0xA97D,0xA97E,0xA980,0xA981,0xA982,0xA983,0xA984, 0, +0xA985,0xA986,0xA987,0xA988, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xA3A1,0xA3A2,0xA3A3,0xA1E7,0xA3A5,0xA3A6,0xA3A7, +0xA3A8,0xA3A9,0xA3AA,0xA3AB,0xA3AC,0xA3AD,0xA3AE,0xA3AF, +0xA3B0,0xA3B1,0xA3B2,0xA3B3,0xA3B4,0xA3B5,0xA3B6,0xA3B7, +0xA3B8,0xA3B9,0xA3BA,0xA3BB,0xA3BC,0xA3BD,0xA3BE,0xA3BF, +0xA3C0,0xA3C1,0xA3C2,0xA3C3,0xA3C4,0xA3C5,0xA3C6,0xA3C7, +0xA3C8,0xA3C9,0xA3CA,0xA3CB,0xA3CC,0xA3CD,0xA3CE,0xA3CF, +0xA3D0,0xA3D1,0xA3D2,0xA3D3,0xA3D4,0xA3D5,0xA3D6,0xA3D7, +0xA3D8,0xA3D9,0xA3DA,0xA3DB,0xA3DC,0xA3DD,0xA3DE,0xA3DF, +0xA3E0,0xA3E1,0xA3E2,0xA3E3,0xA3E4,0xA3E5,0xA3E6,0xA3E7, +0xA3E8,0xA3E9,0xA3EA,0xA3EB,0xA3EC,0xA3ED,0xA3EE,0xA3EF, +0xA3F0,0xA3F1,0xA3F2,0xA3F3,0xA3F4,0xA3F5,0xA3F6,0xA3F7, +0xA3F8,0xA3F9,0xA3FA,0xA3FB,0xA3FC,0xA3FD,0xA1AB, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xA1E9,0xA1EA,0xA956,0xA3FE,0xA957,0xA3A4}; + +static int func_uni_gbk_onechar(int code){ + if ((code>=0x00A4)&&(code<=0x0451)) + return(tab_uni_gbk0[code-0x00A4]); + if ((code>=0x2010)&&(code<=0x2312)) + return(tab_uni_gbk1[code-0x2010]); + if ((code>=0x2460)&&(code<=0x2642)) + return(tab_uni_gbk2[code-0x2460]); + if ((code>=0x3000)&&(code<=0x3129)) + return(tab_uni_gbk3[code-0x3000]); + if ((code>=0x3220)&&(code<=0x32A3)) + return(tab_uni_gbk4[code-0x3220]); + if ((code>=0x338E)&&(code<=0x33D5)) + return(tab_uni_gbk5[code-0x338E]); + if ((code>=0x4E00)&&(code<=0x9FA5)) + return(tab_uni_gbk6[code-0x4E00]); + if ((code>=0xF92C)&&(code<=0xFA29)) + return(tab_uni_gbk7[code-0xF92C]); + if ((code>=0xFE30)&&(code<=0xFFE5)) + return(tab_uni_gbk8[code-0xFE30]); + return(0); +} + +static int +my_wc_mb_gbk(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + int code; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((uint) wc < 0x80) + { + s[0]= (uchar) wc; + return 1; + } + + if (!(code=func_uni_gbk_onechar(wc))) + return MY_CS_ILUNI; + + if (s+2>e) + return MY_CS_TOOSMALL2; + + s[0]=code>>8; + s[1]=code&0xFF; + return 2; +} + +static int +my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e) +{ + int hi; + + if (s >= e) + return MY_CS_TOOSMALL; + + hi=s[0]; + + if (hi<0x80) + { + pwc[0]=hi; + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + if (!(pwc[0]=func_gbk_uni_onechar( (hi<<8) + s[1]))) + return -2; + + return 2; + +} + + +/* + Returns well formed length of a GBK string. +*/ +static +size_t my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) +{ + const char *b0= b; + const char *emb= e - 1; /* Last possible end of an MB character */ + + *error= 0; + while (pos-- && b < e) + { + if ((uchar) b[0] < 128) + { + /* Single byte ascii character */ + b++; + } + else if ((b < emb) && isgbkcode((uchar)*b, (uchar)b[1])) + { + /* Double byte character */ + b+= 2; + } + else + { + /* Wrong byte sequence */ + *error= 1; + break; + } + } + return (size_t) (b - b0); +} + + + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_gbk, + my_strnncollsp_gbk, + my_strnxfrm_gbk, + my_strnxfrmlen_simple, + my_like_range_gbk, + my_wildcmp_mb, + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_gbk, + mbcharlen_gbk, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_gbk, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_gbk, + my_wc_mb_gbk, + my_mb_ctype_mb, + my_caseup_str_mb, + my_casedn_str_mb, + my_caseup_mb, + my_casedn_mb, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_gbk_chinese_ci= +{ + 28,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ + "gbk", /* cs name */ + "gbk_chinese_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gbk, + to_lower_gbk, + to_upper_gbk, + sort_order_gbk, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + +CHARSET_INFO my_charset_gbk_bin= +{ + 87,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "gbk", /* cs name */ + "gbk_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_gbk, + to_lower_gbk, + to_upper_gbk, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + + +#endif diff --git a/externals/mysql/strings/ctype-latin1.c b/externals/mysql/strings/ctype-latin1.c new file mode 100644 index 00000000000..e2a52b51d31 --- /dev/null +++ b/externals/mysql/strings/ctype-latin1.c @@ -0,0 +1,791 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +static uchar ctype_latin1[] = { + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 16, 0, 16, 2, 16, 16, 16, 16, 16, 16, 1, 16, 1, 0, 1, 0, + 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 2, 0, 2, 1, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static uchar to_lower_latin1[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + +static uchar to_upper_latin1[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 +}; + +static uchar sort_order_latin1[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 65, 65, 65, 65, 92, 91, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79, 93,215,216, 85, 85, 85, 89, 89,222,223, + 65, 65, 65, 65, 92, 91, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79, 93,247,216, 85, 85, 85, 89, 89,222,255 +}; + +/* + WL#1494 notes: + + We'll use cp1252 instead of iso-8859-1. + cp1252 contains printable characters in the range 0x80-0x9F. + In ISO 8859-1, these code points have no associated printable + characters. Therefore, by converting from CP1252 to ISO 8859-1, + one would lose the euro (for instance). Since most people are + unaware of the difference, and since we don't really want a + "Windows ANSI" to differ from a "Unix ANSI", we will: + + - continue to pretend the latin1 character set is ISO 8859-1 + - actually allow the storage of euro etc. so it's actually cp1252 + + Also we'll map these five undefined cp1252 character: + 0x81, 0x8D, 0x8F, 0x90, 0x9D + into corresponding control characters: + U+0081, U+008D, U+008F, U+0090, U+009D. + like ISO-8859-1 does. Otherwise, loading "mysqldump" + output doesn't reproduce these undefined characters. +*/ + +unsigned short cs_to_uni[256]={ +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021, +0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F, +0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, +0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178, +0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF +}; +uchar pl00[256]={ +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, +0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, +0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, +0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, +0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, +0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, +0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, +0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, +0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x8D,0x00,0x8F, +0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x9D,0x00,0x00, +0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7, +0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, +0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7, +0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, +0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7, +0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, +0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, +0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, +0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7, +0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, +0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, +0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; +uchar pl01[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x8C,0x9C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x8A,0x9A,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x9F,0x00,0x00,0x00,0x00,0x8E,0x9E,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x83,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +uchar pl02[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x98,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +uchar pl20[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x96,0x97,0x00,0x00,0x00, +0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00, +0x86,0x87,0x95,0x00,0x00,0x00,0x85,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +uchar pl21[256]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x99,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; +uchar *uni_to_cs[256]={ +pl00,pl01,pl02,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +pl20,pl21,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL +}; + +static +int my_mb_wc_latin1(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *wc, + const uchar *str, + const uchar *end __attribute__((unused))) +{ + if (str >= end) + return MY_CS_TOOSMALL; + + *wc=cs_to_uni[*str]; + return (!wc[0] && str[0]) ? -1 : 1; +} + +static +int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, + uchar *str, + uchar *end __attribute__((unused))) +{ + uchar *pl; + + if (str >= end) + return MY_CS_TOOSMALL; + + pl= uni_to_cs[(wc>>8) & 0xFF]; + str[0]= pl ? pl[wc & 0xFF] : '\0'; + return (!str[0] && wc) ? MY_CS_ILUNI : 1; +} + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + NULL, + my_mbcharlen_8bit, + my_numchars_8bit, + my_charpos_8bit, + my_well_formed_len_8bit, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_latin1, + my_wc_mb_latin1, + my_mb_ctype_8bit, + my_caseup_str_8bit, + my_casedn_str_8bit, + my_caseup_8bit, + my_casedn_8bit, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_latin1= +{ + 8,0,0, /* number */ + MY_CS_COMPILED | MY_CS_PRIMARY, /* state */ + "latin1", /* cs name */ + "latin1_swedish_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1, + to_lower_latin1, + to_upper_latin1, + sort_order_latin1, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + cs_to_uni, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_8bit_simple_ci_handler +}; + + + + +/* + * This file is the latin1 character set with German sorting + * + * The modern sort order is used, where: + * + * 'ä' -> "ae" + * 'ö' -> "oe" + * 'ü' -> "ue" + * 'ß' -> "ss" + */ + + +/* + * This is a simple latin1 mapping table, which maps all accented + * characters to their non-accented equivalents. Note: in this + * table, 'ä' is mapped to 'A', '˙' is mapped to 'Y', etc. - all + * accented characters except the following are treated the same way. + * Ü, ü, Ö, ö, Ä, ä + */ + +static uchar sort_order_latin1_de[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79,214,215,216, 85, 85, 85,220, 89,222,223, + 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89 +}; + + +/* + same as sort_order_latin_de, but maps ALL accented chars to unaccented ones +*/ + +uchar combo1map[]={ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 65, 65, 65, 65, 65, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79, 79,215,216, 85, 85, 85, 85, 89,222, 83, + 65, 65, 65, 65, 65, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79, 79,247,216, 85, 85, 85, 85, 89,222, 89 +}; + +uchar combo2map[]={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,69, 0, 0, 0, 0, 0,69, 0, 0,83, 0, 0, 0, 0,69, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,69, 0, 0, 0, 0, 0,69, 0, 0, 0, 0 +}; + + +/* + Some notes about the following comparison rules: + By definition, my_strnncoll_latin_de must works exactly as if had called + my_strnxfrm_latin_de() on both strings and compared the result strings. + + This means that: + Ä must also matches ÁE and Ač, because my_strxn_frm_latin_de() will convert + both to AE. + + The other option would be to not do any accent removal in + sort_order_latin_de[] at all +*/ + + +static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool b_is_prefix) +{ + const uchar *a_end= a + a_length; + const uchar *b_end= b + b_length; + uchar a_char, a_extend= 0, b_char, b_extend= 0; + + while ((a < a_end || a_extend) && (b < b_end || b_extend)) + { + if (a_extend) + { + a_char=a_extend; a_extend=0; + } + else + { + a_extend=combo2map[*a]; + a_char=combo1map[*a++]; + } + if (b_extend) + { + b_char=b_extend; b_extend=0; + } + else + { + b_extend=combo2map[*b]; + b_char=combo1map[*b++]; + } + if (a_char != b_char) + return (int) a_char - (int) b_char; + } + /* + A simple test of string lengths won't work -- we test to see + which string ran out first + */ + return ((a < a_end || a_extend) ? (b_is_prefix ? 0 : 1) : + (b < b_end || b_extend) ? -1 : 0); +} + + +static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + const uchar *a_end= a + a_length, *b_end= b + b_length; + uchar a_char, a_extend= 0, b_char, b_extend= 0; + int res; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + while ((a < a_end || a_extend) && (b < b_end || b_extend)) + { + if (a_extend) + { + a_char=a_extend; + a_extend= 0; + } + else + { + a_extend= combo2map[*a]; + a_char= combo1map[*a++]; + } + if (b_extend) + { + b_char= b_extend; + b_extend= 0; + } + else + { + b_extend= combo2map[*b]; + b_char= combo1map[*b++]; + } + if (a_char != b_char) + return (int) a_char - (int) b_char; + } + /* Check if double character last */ + if (a_extend) + return 1; + if (b_extend) + return -1; + + res= 0; + if (a != a_end || b != b_end) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a == a_end) + { + /* put shorter key in a */ + a_end= b_end; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for ( ; a < a_end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + } + return res; +} + + +static size_t +my_strnxfrm_latin1_de(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar* src, size_t srclen, uint flags) +{ + uchar *de= dst + dstlen; + const uchar *se= src + srclen; + uchar *d0= dst; + for (; src < se && dst < de && nweights; src++, nweights--) + { + uchar chr= combo1map[*src]; + *dst++= chr; + if ((chr= combo2map[*src]) && dst < de && nweights > 1) + { + *dst++= chr; + nweights--; + } + } + return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); +} + + +void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) +{ + const uchar *end; + /* + Remove end space. We have to do this to be able to compare + 'AE' and 'Ä' as identical + */ + end= skip_trailing_space(key, len); + + for (; key < end ; key++) + { + uint X= (uint) combo1map[(uint) *key]; + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * X) + (nr1[0] << 8); + nr2[0]+=3; + if ((X= combo2map[*key])) + { + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * X) + (nr1[0] << 8); + nr2[0]+=3; + } + } +} + + +static MY_COLLATION_HANDLER my_collation_german2_ci_handler= +{ + NULL, /* init */ + my_strnncoll_latin1_de, + my_strnncollsp_latin1_de, + my_strnxfrm_latin1_de, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_8bit, + my_strcasecmp_8bit, + my_instr_simple, + my_hash_sort_latin1_de, + my_propagate_complex +}; + + +CHARSET_INFO my_charset_latin1_german2_ci= +{ + 31,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ + "latin1", /* cs name */ + "latin1_german2_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1, + to_lower_latin1, + to_upper_latin1, + sort_order_latin1_de, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + cs_to_uni, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 2, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 247, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_german2_ci_handler +}; + + +CHARSET_INFO my_charset_latin1_bin= +{ + 47,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "latin1", /* cs name */ + "latin1_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_latin1, + to_lower_latin1, + to_upper_latin1, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + cs_to_uni, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_8bit_bin_handler +}; + diff --git a/externals/mysql/strings/ctype-mb.c b/externals/mysql/strings/ctype-mb.c new file mode 100644 index 00000000000..d041542730f --- /dev/null +++ b/externals/mysql/strings/ctype-mb.c @@ -0,0 +1,1150 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include "m_ctype.h" +#include "m_string.h" + +#ifdef USE_MB + + +size_t my_caseup_str_mb(CHARSET_INFO * cs, char *str) +{ + register uint32 l; + register uchar *map= cs->to_upper; + char *str_orig= str; + + while (*str) + { + /* Pointing after the '\0' is safe here. */ + if ((l= my_ismbchar(cs, str, str + cs->mbmaxlen))) + str+= l; + else + { + *str= (char) map[(uchar)*str]; + str++; + } + } + return (size_t) (str - str_orig); +} + + +size_t my_casedn_str_mb(CHARSET_INFO * cs, char *str) +{ + register uint32 l; + register uchar *map= cs->to_lower; + char *str_orig= str; + + while (*str) + { + /* Pointing after the '\0' is safe here. */ + if ((l= my_ismbchar(cs, str, str + cs->mbmaxlen))) + str+= l; + else + { + *str= (char) map[(uchar)*str]; + str++; + } + } + return (size_t) (str - str_orig); +} + + +size_t my_caseup_mb(CHARSET_INFO * cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + register uint32 l; + register char *srcend= src + srclen; + register uchar *map= cs->to_upper; + + DBUG_ASSERT(src == dst && srclen == dstlen); + while (src < srcend) + { + if ((l=my_ismbchar(cs, src, srcend))) + src+= l; + else + { + *src=(char) map[(uchar) *src]; + src++; + } + } + return srclen; +} + + +size_t my_casedn_mb(CHARSET_INFO * cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + register uint32 l; + register char *srcend= src + srclen; + register uchar *map=cs->to_lower; + + DBUG_ASSERT(src == dst && srclen == dstlen); + while (src < srcend) + { + if ((l= my_ismbchar(cs, src, srcend))) + src+= l; + else + { + *src= (char) map[(uchar)*src]; + src++; + } + } + return srclen; +} + + +/* + my_strcasecmp_mb() returns 0 if strings are equal, non-zero otherwise. + */ + +int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t) +{ + register uint32 l; + register uchar *map=cs->to_upper; + + while (*s && *t) + { + /* Pointing after the '\0' is safe here. */ + if ((l=my_ismbchar(cs, s, s + cs->mbmaxlen))) + { + while (l--) + if (*s++ != *t++) + return 1; + } + else if (my_mbcharlen(cs, *t) > 1) + return 1; + else if (map[(uchar) *s++] != map[(uchar) *t++]) + return 1; + } + /* At least one of '*s' and '*t' is zero here. */ + return (*t != *s); +} + + +/* +** Compare string against string with wildcard +** 0 if matched +** -1 if not matched with wildcard +** 1 if matched with wildcard +*/ + +#define INC_PTR(cs,A,B) A+=(my_ismbchar(cs,A,B) ? my_ismbchar(cs,A,B) : 1) + +#define likeconv(s,A) (uchar) (s)->sort_order[(uchar) (A)] + +int my_wildcmp_mb(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + int result= -1; /* Not found, using wildcards */ + + while (wildstr != wildend) + { + while (*wildstr != w_many && *wildstr != w_one) + { + int l; + if (*wildstr == escape && wildstr+1 != wildend) + wildstr++; + if ((l = my_ismbchar(cs, wildstr, wildend))) + { + if (str+l > str_end || memcmp(str, wildstr, l) != 0) + return 1; + str += l; + wildstr += l; + } + else + if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++)) + return(1); /* No match */ + if (wildstr == wildend) + return (str != str_end); /* Match if both are at end */ + result=1; /* Found an anchor char */ + } + if (*wildstr == w_one) + { + do + { + if (str == str_end) /* Skip one char if possible */ + return (result); + INC_PTR(cs,str,str_end); + } while (++wildstr < wildend && *wildstr == w_one); + if (wildstr == wildend) + break; + } + if (*wildstr == w_many) + { /* Found w_many */ + uchar cmp; + const char* mb = wildstr; + int mb_len=0; + + wildstr++; + /* Remove any '%' and '_' from the wild search string */ + for (; wildstr != wildend ; wildstr++) + { + if (*wildstr == w_many) + continue; + if (*wildstr == w_one) + { + if (str == str_end) + return (-1); + INC_PTR(cs,str,str_end); + continue; + } + break; /* Not a wild character */ + } + if (wildstr == wildend) + return(0); /* Ok if w_many is last */ + if (str == str_end) + return -1; + + if ((cmp= *wildstr) == escape && wildstr+1 != wildend) + cmp= *++wildstr; + + mb=wildstr; + mb_len= my_ismbchar(cs, wildstr, wildend); + INC_PTR(cs,wildstr,wildend); /* This is compared trough cmp */ + cmp=likeconv(cs,cmp); + do + { + for (;;) + { + if (str >= str_end) + return -1; + if (mb_len) + { + if (str+mb_len <= str_end && memcmp(str, mb, mb_len) == 0) + { + str += mb_len; + break; + } + } + else if (!my_ismbchar(cs, str, str_end) && + likeconv(cs,*str) == cmp) + { + str++; + break; + } + INC_PTR(cs,str, str_end); + } + { + int tmp=my_wildcmp_mb(cs,str,str_end,wildstr,wildend,escape,w_one, + w_many); + if (tmp <= 0) + return (tmp); + } + } while (str != str_end && wildstr[0] != w_many); + return(-1); + } + } + return (str != str_end ? 1 : 0); +} + + +size_t my_numchars_mb(CHARSET_INFO *cs __attribute__((unused)), + const char *pos, const char *end) +{ + register size_t count= 0; + while (pos < end) + { + uint mb_len; + pos+= (mb_len= my_ismbchar(cs,pos,end)) ? mb_len : 1; + count++; + } + return count; +} + + +size_t my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)), + const char *pos, const char *end, size_t length) +{ + const char *start= pos; + while (length && pos < end) + { + uint mb_len; + pos+= (mb_len= my_ismbchar(cs, pos, end)) ? mb_len : 1; + length--; + } + return (size_t) (length ? end+2-start : pos-start); +} + + +size_t my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e, + size_t pos, int *error) +{ + const char *b_start= b; + *error= 0; + while (pos) + { + my_wc_t wc; + int mb_len; + + if ((mb_len= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0) + { + *error= b < e ? 1 : 0; + break; + } + b+= mb_len; + pos--; + } + return (size_t) (b - b_start); +} + + +uint my_instr_mb(CHARSET_INFO *cs, + const char *b, size_t b_length, + const char *s, size_t s_length, + my_match_t *match, uint nmatch) +{ + register const char *end, *b0; + int res= 0; + + if (s_length <= b_length) + { + if (!s_length) + { + if (nmatch) + { + match->beg= 0; + match->end= 0; + match->mb_len= 0; + } + return 1; /* Empty string is always found */ + } + + b0= b; + end= b+b_length-s_length+1; + + while (b < end) + { + int mb_len; + + if (!cs->coll->strnncoll(cs, (uchar*) b, s_length, + (uchar*) s, s_length, 0)) + { + if (nmatch) + { + match[0].beg= 0; + match[0].end= (size_t) (b-b0); + match[0].mb_len= res; + if (nmatch > 1) + { + match[1].beg= match[0].end; + match[1].end= match[0].end+s_length; + match[1].mb_len= 0; /* Not computed */ + } + } + return 2; + } + mb_len= (mb_len= my_ismbchar(cs, b, end)) ? mb_len : 1; + b+= mb_len; + b_length-= mb_len; + res++; + } + } + return 0; +} + + +/* BINARY collations handlers for MB charsets */ + +int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + size_t len=min(slen,tlen); + int cmp= memcmp(s,t,len); + return cmp ? cmp : (int) ((t_is_prefix ? len : slen) - tlen); +} + + +/* + Compare two strings. + + SYNOPSIS + my_strnncollsp_mb_bin() + cs Chararacter set + s String to compare + slen Length of 's' + t String to compare + tlen Length of 't' + diff_if_only_endspace_difference + Set to 1 if the strings should be regarded as different + if they only difference in end space + + NOTE + This function is used for character strings with binary collations. + The shorter string is extended with end space to be as long as the longer + one. + + RETURN + A negative number if s < t + A positive number if s > t + 0 if strings are equal +*/ + +int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + const uchar *end; + size_t length; + int res; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + end= a + (length= min(a_length, b_length)); + while (a < end) + { + if (*a++ != *b++) + return ((int) a[-1] - (int) b[-1]); + } + res= 0; + if (a_length != b_length) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a_length < b_length) + { + /* put shorter key in s */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (end= a + a_length-length; a < end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + } + return res; +} + + +/* + Copy one non-ascii character. + "dst" must have enough room for the character. + Note, we don't use sort_order[] in this macros. + This is correct even for case insensitive collations: + - basic Latin letters are processed outside this macros; + - for other characters sort_order[x] is equal to x. +*/ +#define my_strnxfrm_mb_non_ascii_char(cs, dst, src, se) \ +{ \ + switch (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) { \ + case 4: \ + *dst++= *src++; \ + /* fall through */ \ + case 3: \ + *dst++= *src++; \ + /* fall through */ \ + case 2: \ + *dst++= *src++; \ + /* fall through */ \ + case 0: \ + *dst++= *src++; /* byte in range 0x80..0xFF which is not MB head */ \ + } \ +} + + +/* + For character sets with two or three byte multi-byte + characters having multibyte weights *equal* to their codes: + cp932, euckr, gb2312, sjis, eucjpms, ujis. +*/ +size_t +my_strnxfrm_mb(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + uchar *de= dst + dstlen; + const uchar *se= src + srclen; + const uchar *sort_order= cs->sort_order; + + DBUG_ASSERT(cs->mbmaxlen <= 4); + + /* + If "srclen" is smaller than both "dstlen" and "nweights" + then we can run a simplified loop - + without checking "nweights" and "de". + */ + if (dstlen >= srclen && nweights >= srclen) + { + if (sort_order) + { + /* Optimized version for a case insensitive collation */ + for (; src < se; nweights--) + { + if (*src < 128) /* quickly catch ASCII characters */ + *dst++= sort_order[*src++]; + else + my_strnxfrm_mb_non_ascii_char(cs, dst, src, se); + } + } + else + { + /* Optimized version for a case sensitive collation (no sort_order) */ + for (; src < se; nweights--) + { + if (*src < 128) /* quickly catch ASCII characters */ + *dst++= *src++; + else + my_strnxfrm_mb_non_ascii_char(cs, dst, src, se); + } + } + goto pad; + } + + /* + A thourough loop, checking all possible limits: + "se", "nweights" and "de". + */ + for (; src < se && nweights && dst < de; nweights--) + { + int chlen; + if (*src < 128 || + !(chlen= cs->cset->ismbchar(cs, (const char*) src, (const char*) se))) + { + /* Single byte character */ + *dst++= sort_order ? sort_order[*src++] : *src++; + } + else + { + /* Multi-byte character */ + int len= (dst + chlen <= de) ? chlen : de - dst; + memcpy(dst, src, len); + dst+= len; + src+= len; + } + } + +pad: + return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, de, nweights, flags, 0); +} + + +int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), + const char *s, const char *t) +{ + return strcmp(s,t); +} + + +void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) +{ + const uchar *pos = key; + + /* + Remove trailing spaces. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + key= skip_trailing_space(key, len); + + for (; pos < (uchar*) key ; pos++) + { + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * + ((uint)*pos)) + (nr1[0] << 8); + nr2[0]+=3; + } +} + + +/* + Fill the given buffer with 'maximum character' for given charset + SYNOPSIS + pad_max_char() + cs Character set + str Start of buffer to fill + end End of buffer to fill + + DESCRIPTION + Write max key: + - for non-Unicode character sets: + just set to 255. + - for Unicode character set (utf-8): + create a buffer with multibyte representation of the max_sort_char + character, and copy it into max_str in a loop. +*/ +static void pad_max_char(CHARSET_INFO *cs, char *str, char *end) +{ + char buf[10]; + char buflen; + + if (!(cs->state & MY_CS_UNICODE)) + { + bfill(str, end - str, 255); + return; + } + + buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf, + (uchar*) buf + sizeof(buf)); + + DBUG_ASSERT(buflen > 0); + do + { + if ((str + buflen) < end) + { + /* Enough space for the characer */ + memcpy(str, buf, buflen); + str+= buflen; + } + else + { + /* + There is no space for whole multibyte + character, then add trailing spaces. + */ + *str++= ' '; + } + } while (str < end); +} + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +my_bool my_like_range_mb(CHARSET_INFO *cs, + const char *ptr,size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) +{ + uint mb_len; + const char *end= ptr + ptr_length; + char *min_org= min_str; + char *min_end= min_str + res_length; + char *max_end= max_str + res_length; + size_t maxcharlen= res_length / cs->mbmaxlen; + const char *contraction_flags= cs->contractions ? + ((const char*) cs->contractions) + 0x40*0x40 : NULL; + + for (; ptr != end && min_str != min_end && maxcharlen ; maxcharlen--) + { + /* We assume here that escape, w_any, w_namy are one-byte characters */ + if (*ptr == escape && ptr+1 != end) + ptr++; /* Skip escape */ + else if (*ptr == w_one || *ptr == w_many) /* '_' and '%' in SQL */ + { +fill_max_and_min: + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + /* Create min key */ + do + { + *min_str++= (char) cs->min_sort_char; + } while (min_str != min_end); + + /* + Write max key: create a buffer with multibyte + representation of the max_sort_char character, + and copy it into max_str in a loop. + */ + *max_length= res_length; + pad_max_char(cs, max_str, max_end); + return 0; + } + if ((mb_len= my_ismbchar(cs, ptr, end)) > 1) + { + if (ptr+mb_len > end || min_str+mb_len > min_end) + break; + while (mb_len--) + *min_str++= *max_str++= *ptr++; + } + else + { + /* + Special case for collations with contractions. + For example, in Chezh, 'ch' is a separate letter + which is sorted between 'h' and 'i'. + If the pattern 'abc%', 'c' at the end can mean: + - letter 'c' itself, + - beginning of the contraction 'ch'. + + If we simply return this LIKE range: + + 'abc\min\min\min' and 'abc\max\max\max' + + then this query: SELECT * FROM t1 WHERE a LIKE 'abc%' + will only find values starting from 'abc[^h]', + but won't find values starting from 'abch'. + + We must ignore contraction heads followed by w_one or w_many. + ('Contraction head' means any letter which can be the first + letter in a contraction) + + For example, for Czech 'abc%', we will return LIKE range, + which is equal to LIKE range for 'ab%': + + 'ab\min\min\min\min' and 'ab\max\max\max\max'. + + */ + if (contraction_flags && ptr + 1 < end && + contraction_flags[(uchar) *ptr]) + { + /* Ptr[0] is a contraction head. */ + + if (ptr[1] == w_one || ptr[1] == w_many) + { + /* Contraction head followed by a wildcard, quit. */ + goto fill_max_and_min; + } + + /* + Some letters can be both contraction heads and contraction tails. + For example, in Danish 'aa' is a separate single letter which + is sorted after 'z'. So 'a' can be both head and tail. + + If ptr[0]+ptr[1] is a contraction, + then put both letters together. + + If ptr[1] can be a contraction part, but ptr[0]+ptr[1] + is not a contraction, then we put only ptr[0], + and continue with ptr[1] on the next loop. + */ + if (contraction_flags[(uchar) ptr[1]] && + cs->contractions[(*ptr-0x40)*0x40 + ptr[1] - 0x40]) + { + /* Contraction found */ + if (maxcharlen == 1 || min_str + 1 >= min_end) + { + /* Both contraction parts don't fit, quit */ + goto fill_max_and_min; + } + + /* Put contraction head */ + *min_str++= *max_str++= *ptr++; + maxcharlen--; + } + } + /* Put contraction tail, or a single character */ + *min_str++= *max_str++= *ptr++; + } + } + + *min_length= *max_length = (size_t) (min_str - min_org); + while (min_str != min_end) + *min_str++= *max_str++= ' '; /* Because if key compression */ + return 0; +} + + +int my_wildcmp_mb_bin(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + int result= -1; /* Not found, using wildcards */ + + while (wildstr != wildend) + { + while (*wildstr != w_many && *wildstr != w_one) + { + int l; + if (*wildstr == escape && wildstr+1 != wildend) + wildstr++; + if ((l = my_ismbchar(cs, wildstr, wildend))) + { + if (str+l > str_end || memcmp(str, wildstr, l) != 0) + return 1; + str += l; + wildstr += l; + } + else + if (str == str_end || *wildstr++ != *str++) + return(1); /* No match */ + if (wildstr == wildend) + return (str != str_end); /* Match if both are at end */ + result=1; /* Found an anchor char */ + } + if (*wildstr == w_one) + { + do + { + if (str == str_end) /* Skip one char if possible */ + return (result); + INC_PTR(cs,str,str_end); + } while (++wildstr < wildend && *wildstr == w_one); + if (wildstr == wildend) + break; + } + if (*wildstr == w_many) + { /* Found w_many */ + uchar cmp; + const char* mb = wildstr; + int mb_len=0; + + wildstr++; + /* Remove any '%' and '_' from the wild search string */ + for (; wildstr != wildend ; wildstr++) + { + if (*wildstr == w_many) + continue; + if (*wildstr == w_one) + { + if (str == str_end) + return (-1); + INC_PTR(cs,str,str_end); + continue; + } + break; /* Not a wild character */ + } + if (wildstr == wildend) + return(0); /* Ok if w_many is last */ + if (str == str_end) + return -1; + + if ((cmp= *wildstr) == escape && wildstr+1 != wildend) + cmp= *++wildstr; + + mb=wildstr; + mb_len= my_ismbchar(cs, wildstr, wildend); + INC_PTR(cs,wildstr,wildend); /* This is compared trough cmp */ + do + { + for (;;) + { + if (str >= str_end) + return -1; + if (mb_len) + { + if (str+mb_len <= str_end && memcmp(str, mb, mb_len) == 0) + { + str += mb_len; + break; + } + } + else if (!my_ismbchar(cs, str, str_end) && *str == cmp) + { + str++; + break; + } + INC_PTR(cs,str, str_end); + } + { + int tmp=my_wildcmp_mb_bin(cs,str,str_end,wildstr,wildend,escape,w_one,w_many); + if (tmp <= 0) + return (tmp); + } + } while (str != str_end && wildstr[0] != w_many); + return(-1); + } + } + return (str != str_end ? 1 : 0); +} + + +/* + Data was produced from EastAsianWidth.txt + using utt11-dump utility. +*/ +static char pg11[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pg23[256]= +{ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pg2E[256]= +{ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pg2F[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0 +}; + +static char pg30[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, +0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +}; + +static char pg31[256]= +{ +0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +}; + +static char pg32[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 +}; + +static char pg4D[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pg9F[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pgA4[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pgD7[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pgFA[256]= +{ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pgFE[256]= +{ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static char pgFF[256]= +{ +0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; + +static struct {int page; char *p;} utr11_data[256]= +{ +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,pg11},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,pg23},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,pg2E},{0,pg2F}, +{0,pg30},{0,pg31},{0,pg32},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pg4D},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pg9F}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pgA4},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL}, +{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pgD7}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, +{0,NULL},{1,NULL},{0,pgFA},{0,NULL},{0,NULL},{0,NULL},{0,pgFE},{0,pgFF} +}; + + +size_t my_numcells_mb(CHARSET_INFO *cs, const char *b, const char *e) +{ + my_wc_t wc; + size_t clen= 0; + + while (b < e) + { + int mb_len; + uint pg; + if ((mb_len= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0 || + wc > 0xFFFF) + { + /* + Let's think a wrong sequence takes 1 dysplay cell. + Also, consider supplementary characters as taking one cell. + */ + mb_len= 1; + b++; + continue; + } + b+= mb_len; + pg= (wc >> 8) & 0xFF; + clen+= utr11_data[pg].p ? utr11_data[pg].p[wc & 0xFF] : utr11_data[pg].page; + clen++; + } + return clen; +} + + +int my_mb_ctype_mb(CHARSET_INFO *cs, int *ctype, + const uchar *s, const uchar *e) +{ + my_wc_t wc; + int res= cs->cset->mb_wc(cs, &wc, s, e); + if (res <= 0 || wc > 0xFFFF) + *ctype= 0; + else + *ctype= my_uni_ctype[wc>>8].ctype ? + my_uni_ctype[wc>>8].ctype[wc&0xFF] : + my_uni_ctype[wc>>8].pctype; + return res; +} + + +MY_COLLATION_HANDLER my_collation_mb_bin_handler = +{ + NULL, /* init */ + my_strnncoll_mb_bin, + my_strnncollsp_mb_bin, + my_strnxfrm_mb, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_bin, + my_propagate_simple +}; + +#endif diff --git a/externals/mysql/strings/ctype-simple.c b/externals/mysql/strings/ctype-simple.c new file mode 100644 index 00000000000..e041a2789d6 --- /dev/null +++ b/externals/mysql/strings/ctype-simple.c @@ -0,0 +1,1969 @@ +/* Copyright (C) 2002 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include "m_string.h" +#include "m_ctype.h" +#include "my_sys.h" /* Needed for MY_ERRNO_ERANGE */ +#include + +#include "stdarg.h" + +/* + Returns the number of bytes required for strnxfrm(). +*/ + +size_t my_strnxfrmlen_simple(CHARSET_INFO *cs, size_t len) +{ + return len * (cs->strxfrm_multiply ? cs->strxfrm_multiply : 1); +} + + +/* + Converts a string into its sort key. + + SYNOPSIS + my_strnxfrm_xxx() + + IMPLEMENTATION + + The my_strxfrm_xxx() function transforms a string pointed to by + 'src' with length 'srclen' according to the charset+collation + pair 'cs' and copies the result key into 'dest'. + + Comparing two strings using memcmp() after my_strnxfrm_xxx() + is equal to comparing two original strings with my_strnncollsp_xxx(). + + Not more than 'dstlen' bytes are written into 'dst'. + To garantee that the whole string is transformed, 'dstlen' must be + at least srclen*cs->strnxfrm_multiply bytes long. Otherwise, + consequent memcmp() may return a non-accurate result. + + If the source string is too short to fill whole 'dstlen' bytes, + then the 'dest' string is padded up to 'dstlen', ensuring that: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + my_strnxfrm_simple() is implemented for 8bit charsets and + simple collations with one-to-one string->key transformation. + + See also implementations for various charsets/collations in + other ctype-xxx.c files. + + RETURN + + Target len 'dstlen'. + +*/ + + +size_t my_strnxfrm_simple(CHARSET_INFO * cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *map= cs->sort_order; + uchar *d0= dst; + uint frmlen; + if ((frmlen= min(dstlen, nweights)) > srclen) + frmlen= srclen; + if (dst != src) + { + const uchar *end; + for (end= src + frmlen; src < end;) + *dst++= map[*src++]; + } + else + { + const uchar *end; + for (end= dst + frmlen; dst < end; dst++) + *dst= map[(uchar) *dst]; + } + return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, d0 + dstlen, + nweights - frmlen, flags, 0); +} + + +int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + size_t len = ( slen > tlen ) ? tlen : slen; + uchar *map= cs->sort_order; + if (t_is_prefix && slen > tlen) + slen=tlen; + while (len--) + { + if (map[*s++] != map[*t++]) + return ((int) map[s[-1]] - (int) map[t[-1]]); + } + /* + We can't use (slen - tlen) here as the result may be outside of the + precision of a signed int + */ + return slen > tlen ? 1 : slen < tlen ? -1 : 0 ; +} + + +/* + Compare strings, discarding end space + + SYNOPSIS + my_strnncollsp_simple() + cs character set handler + a First string to compare + a_length Length of 'a' + b Second string to compare + b_length Length of 'b' + diff_if_only_endspace_difference + Set to 1 if the strings should be regarded as different + if they only difference in end space + + IMPLEMENTATION + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + RETURN + < 0 a < b + = 0 a == b + > 0 a > b +*/ + +int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + const uchar *map= cs->sort_order, *end; + size_t length; + int res; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + end= a + (length= min(a_length, b_length)); + while (a < end) + { + if (map[*a++] != map[*b++]) + return ((int) map[a[-1]] - (int) map[b[-1]]); + } + res= 0; + if (a_length != b_length) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a_length < b_length) + { + /* put shorter key in s */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (end= a + a_length-length; a < end ; a++) + { + if (map[*a] != ' ') + return (map[*a] < ' ') ? -swap : swap; + } + } + return res; +} + + +size_t my_caseup_str_8bit(CHARSET_INFO * cs,char *str) +{ + register uchar *map= cs->to_upper; + char *str_orig= str; + while ((*str= (char) map[(uchar) *str]) != 0) + str++; + return (size_t) (str - str_orig); +} + + +size_t my_casedn_str_8bit(CHARSET_INFO * cs,char *str) +{ + register uchar *map= cs->to_lower; + char *str_orig= str; + while ((*str= (char) map[(uchar) *str]) != 0) + str++; + return (size_t) (str - str_orig); +} + + +size_t my_caseup_8bit(CHARSET_INFO * cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + char *end= src + srclen; + register uchar *map= cs->to_upper; + DBUG_ASSERT(src == dst && srclen == dstlen); + for ( ; src != end ; src++) + *src= (char) map[(uchar) *src]; + return srclen; +} + + +size_t my_casedn_8bit(CHARSET_INFO * cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + char *end= src + srclen; + register uchar *map=cs->to_lower; + DBUG_ASSERT(src == dst && srclen == dstlen); + for ( ; src != end ; src++) + *src= (char) map[(uchar) *src]; + return srclen; +} + +int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t) +{ + register uchar *map=cs->to_upper; + while (map[(uchar) *s] == map[(uchar) *t++]) + if (!*s++) return 0; + return ((int) map[(uchar) s[0]] - (int) map[(uchar) t[-1]]); +} + + +int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, + const uchar *str, + const uchar *end __attribute__((unused))) +{ + if (str >= end) + return MY_CS_TOOSMALL; + + *wc=cs->tab_to_uni[*str]; + return (!wc[0] && str[0]) ? -1 : 1; +} + +int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, + uchar *str, + uchar *end) +{ + MY_UNI_IDX *idx; + + if (str >= end) + return MY_CS_TOOSMALL; + + for (idx=cs->tab_from_uni; idx->tab ; idx++) + { + if (idx->from <= wc && idx->to >= wc) + { + str[0]= idx->tab[wc - idx->from]; + return (!str[0] && wc) ? MY_CS_ILUNI : 1; + } + } + return MY_CS_ILUNI; +} + + +/* + We can't use vsprintf here as it's not guaranteed to return + the length on all operating systems. + This function is also not called in a safe environment, so the + end buffer must be checked. +*/ + +size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)), + char* to, size_t n __attribute__((unused)), + const char* fmt, ...) +{ + va_list args; + int result; + va_start(args,fmt); + result= my_vsnprintf(to, n, fmt, args); + va_end(args); + return result; +} + + +void my_hash_sort_simple(CHARSET_INFO *cs, + const uchar *key, size_t len, + ulong *nr1, ulong *nr2) +{ + register uchar *sort_order=cs->sort_order; + const uchar *end; + + /* + Remove end space. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + end= skip_trailing_space(key, len); + + for (; key < (uchar*) end ; key++) + { + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * + ((uint) sort_order[(uint) *key])) + (nr1[0] << 8); + nr2[0]+=3; + } +} + + +long my_strntol_8bit(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative; + register uint32 cutoff; + register uint cutlim; + register uint32 i; + register const char *s; + register uchar c; + const char *save, *e; + int overflow; + + *err= 0; /* Initialize error indicator */ +#ifdef NOT_USED + if (base < 0 || base == 1 || base > 36) + base = 10; +#endif + + s = nptr; + e = nptr+l; + + for ( ; s='0' && c<='9') + c -= '0'; + else if (c>='A' && c<='Z') + c = c - 'A' + 10; + else if (c>='a' && c<='z') + c = c - 'a' + 10; + else + break; + if (c >= base) + break; + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (uint32) base; + i += c; + } + } + + if (s == save) + goto noconv; + + if (endptr != NULL) + *endptr = (char *) s; + + if (negative) + { + if (i > (uint32) INT_MIN32) + overflow = 1; + } + else if (i > INT_MAX32) + overflow = 1; + + if (overflow) + { + err[0]= ERANGE; + return negative ? INT_MIN32 : INT_MAX32; + } + + return (negative ? -((long) i) : (long) i); + +noconv: + err[0]= EDOM; + if (endptr != NULL) + *endptr = (char *) nptr; + return 0L; +} + + +ulong my_strntoul_8bit(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative; + register uint32 cutoff; + register uint cutlim; + register uint32 i; + register const char *s; + register uchar c; + const char *save, *e; + int overflow; + + *err= 0; /* Initialize error indicator */ +#ifdef NOT_USED + if (base < 0 || base == 1 || base > 36) + base = 10; +#endif + + s = nptr; + e = nptr+l; + + for( ; s='0' && c<='9') + c -= '0'; + else if (c>='A' && c<='Z') + c = c - 'A' + 10; + else if (c>='a' && c<='z') + c = c - 'a' + 10; + else + break; + if (c >= base) + break; + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (uint32) base; + i += c; + } + } + + if (s == save) + goto noconv; + + if (endptr != NULL) + *endptr = (char *) s; + + if (overflow) + { + err[0]= ERANGE; + return (~(uint32) 0); + } + + return (negative ? -((long) i) : (long) i); + +noconv: + err[0]= EDOM; + if (endptr != NULL) + *endptr = (char *) nptr; + return 0L; +} + + +longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *nptr, size_t l, int base, + char **endptr,int *err) +{ + int negative; + register ulonglong cutoff; + register uint cutlim; + register ulonglong i; + register const char *s, *e; + const char *save; + int overflow; + + *err= 0; /* Initialize error indicator */ +#ifdef NOT_USED + if (base < 0 || base == 1 || base > 36) + base = 10; +#endif + + s = nptr; + e = nptr+l; + + for(; s='0' && c<='9') + c -= '0'; + else if (c>='A' && c<='Z') + c = c - 'A' + 10; + else if (c>='a' && c<='z') + c = c - 'a' + 10; + else + break; + if (c >= base) + break; + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (ulonglong) base; + i += c; + } + } + + if (s == save) + goto noconv; + + if (endptr != NULL) + *endptr = (char *) s; + + if (negative) + { + if (i > (ulonglong) LONGLONG_MIN) + overflow = 1; + } + else if (i > (ulonglong) LONGLONG_MAX) + overflow = 1; + + if (overflow) + { + err[0]= ERANGE; + return negative ? LONGLONG_MIN : LONGLONG_MAX; + } + + return (negative ? -((longlong) i) : (longlong) i); + +noconv: + err[0]= EDOM; + if (endptr != NULL) + *endptr = (char *) nptr; + return 0L; +} + + +ulonglong my_strntoull_8bit(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative; + register ulonglong cutoff; + register uint cutlim; + register ulonglong i; + register const char *s, *e; + const char *save; + int overflow; + + *err= 0; /* Initialize error indicator */ +#ifdef NOT_USED + if (base < 0 || base == 1 || base > 36) + base = 10; +#endif + + s = nptr; + e = nptr+l; + + for(; s='0' && c<='9') + c -= '0'; + else if (c>='A' && c<='Z') + c = c - 'A' + 10; + else if (c>='a' && c<='z') + c = c - 'a' + 10; + else + break; + if (c >= base) + break; + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (ulonglong) base; + i += c; + } + } + + if (s == save) + goto noconv; + + if (endptr != NULL) + *endptr = (char *) s; + + if (overflow) + { + err[0]= ERANGE; + return (~(ulonglong) 0); + } + + return (negative ? -((longlong) i) : (longlong) i); + +noconv: + err[0]= EDOM; + if (endptr != NULL) + *endptr = (char *) nptr; + return 0L; +} + + +/* + Read double from string + + SYNOPSIS: + my_strntod_8bit() + cs Character set information + str String to convert to double + length Optional length for string. + end result pointer to end of converted string + err Error number if failed conversion + + NOTES: + If length is not INT_MAX32 or str[length] != 0 then the given str must + be writeable + If length == INT_MAX32 the str must be \0 terminated. + + It's implemented this way to save a buffer allocation and a memory copy. + + RETURN + Value of number in string +*/ + + +double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)), + char *str, size_t length, + char **end, int *err) +{ + if (length == INT_MAX32) + length= 65535; /* Should be big enough */ + *end= str + length; + return my_strtod(str, end, err); +} + + +/* + This is a fast version optimized for the case of radix 10 / -10 + + Assume len >= 1 +*/ + +size_t my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), + char *dst, size_t len, int radix, long int val) +{ + char buffer[66]; + register char *p, *e; + long int new_val; + uint sign=0; + unsigned long int uval = (unsigned long int) val; + + e = p = &buffer[sizeof(buffer)-1]; + *p= 0; + + if (radix < 0) + { + if (val < 0) + { + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval= (unsigned long int)0 - uval; + *dst++= '-'; + len--; + sign= 1; + } + } + + new_val = (long) (uval / 10); + *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); + val = new_val; + + while (val != 0) + { + new_val=val/10; + *--p = '0' + (char) (val-new_val*10); + val= new_val; + } + + len= min(len, (size_t) (e-p)); + memcpy(dst, p, len); + return len+sign; +} + + +size_t my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), + char *dst, size_t len, int radix, + longlong val) +{ + char buffer[65]; + register char *p, *e; + long long_val; + uint sign= 0; + ulonglong uval = (ulonglong)val; + + if (radix < 0) + { + if (val < 0) + { + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; + *dst++= '-'; + len--; + sign= 1; + } + } + + e = p = &buffer[sizeof(buffer)-1]; + *p= 0; + + if (uval == 0) + { + *--p= '0'; + len= 1; + goto cnv; + } + + while (uval > (ulonglong) LONG_MAX) + { + ulonglong quo= uval/(uint) 10; + uint rem= (uint) (uval- quo* (uint) 10); + *--p = '0' + rem; + uval= quo; + } + + long_val= (long) uval; + while (long_val != 0) + { + long quo= long_val/10; + *--p = (char) ('0' + (long_val - quo*10)); + long_val= quo; + } + + len= min(len, (size_t) (e-p)); +cnv: + memcpy(dst, p, len); + return len+sign; +} + + +/* +** Compare string against string with wildcard +** 0 if matched +** -1 if not matched with wildcard +** 1 if matched with wildcard +*/ + +#ifdef LIKE_CMP_TOUPPER +#define likeconv(s,A) (uchar) my_toupper(s,A) +#else +#define likeconv(s,A) (uchar) (s)->sort_order[(uchar) (A)] +#endif + +#define INC_PTR(cs,A,B) (A)++ + + +int my_wildcmp_8bit(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + int result= -1; /* Not found, using wildcards */ + + while (wildstr != wildend) + { + while (*wildstr != w_many && *wildstr != w_one) + { + if (*wildstr == escape && wildstr+1 != wildend) + wildstr++; + + if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++)) + return(1); /* No match */ + if (wildstr == wildend) + return(str != str_end); /* Match if both are at end */ + result=1; /* Found an anchor char */ + } + if (*wildstr == w_one) + { + do + { + if (str == str_end) /* Skip one char if possible */ + return(result); + INC_PTR(cs,str,str_end); + } while (++wildstr < wildend && *wildstr == w_one); + if (wildstr == wildend) + break; + } + if (*wildstr == w_many) + { /* Found w_many */ + uchar cmp; + + wildstr++; + /* Remove any '%' and '_' from the wild search string */ + for (; wildstr != wildend ; wildstr++) + { + if (*wildstr == w_many) + continue; + if (*wildstr == w_one) + { + if (str == str_end) + return(-1); + INC_PTR(cs,str,str_end); + continue; + } + break; /* Not a wild character */ + } + if (wildstr == wildend) + return(0); /* Ok if w_many is last */ + if (str == str_end) + return(-1); + + if ((cmp= *wildstr) == escape && wildstr+1 != wildend) + cmp= *++wildstr; + + INC_PTR(cs,wildstr,wildend); /* This is compared trough cmp */ + cmp=likeconv(cs,cmp); + do + { + while (str != str_end && (uchar) likeconv(cs,*str) != cmp) + str++; + if (str++ == str_end) return(-1); + { + int tmp=my_wildcmp_8bit(cs,str,str_end,wildstr,wildend,escape,w_one, + w_many); + if (tmp <= 0) + return(tmp); + } + } while (str != str_end && wildstr[0] != w_many); + return(-1); + } + } + return(str != str_end ? 1 : 0); +} + + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +my_bool my_like_range_simple(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length, size_t *max_length) +{ + const char *end= ptr + ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + size_t charlen= res_length / cs->mbmaxlen; + + for (; ptr != end && min_str != min_end && charlen > 0 ; ptr++, charlen--) + { + if (*ptr == escape && ptr+1 != end) + { + ptr++; /* Skip escape */ + *min_str++= *max_str++ = *ptr; + continue; + } + if (*ptr == w_one) /* '_' in SQL */ + { + *min_str++='\0'; /* This should be min char */ + *max_str++= (char) cs->max_sort_char; + continue; + } + if (*ptr == w_many) /* '%' in SQL */ + { + /* Calculate length of keys */ + *min_length= ((cs->state & MY_CS_BINSORT) ? + (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + do + { + *min_str++= 0; + *max_str++= (char) cs->max_sort_char; + } while (min_str != min_end); + return 0; + } + *min_str++= *max_str++ = *ptr; + } + + *min_length= *max_length = (size_t) (min_str - min_org); + while (min_str != min_end) + *min_str++= *max_str++ = ' '; /* Because if key compression */ + return 0; +} + + +size_t my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq) +{ + const char *str0= str; + switch (sq) + { + case MY_SEQ_INTTAIL: + if (*str == '.') + { + for(str++ ; str != end && *str == '0' ; str++); + return (size_t) (str - str0); + } + return 0; + + case MY_SEQ_SPACES: + for ( ; str < end ; str++) + { + if (!my_isspace(cs,*str)) + break; + } + return (size_t) (str - str0); + default: + return 0; + } +} + + +void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)), + char *s, size_t l, int fill) +{ + bfill((uchar*) s,l,fill); +} + + +size_t my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e) +{ + return (size_t) (e - b); +} + + +size_t my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e) +{ + return (size_t) (e - b); +} + + +size_t my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *b __attribute__((unused)), + const char *e __attribute__((unused)), + size_t pos) +{ + return pos; +} + + +size_t my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *start, const char *end, + size_t nchars, int *error) +{ + size_t nbytes= (size_t) (end-start); + *error= 0; + return min(nbytes, nchars); +} + + +size_t my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr, size_t length) +{ + const char *end; + end= (const char *) skip_trailing_space((const uchar *)ptr, length); + return (size_t) (end-ptr); +} + + +uint my_instr_simple(CHARSET_INFO *cs, + const char *b, size_t b_length, + const char *s, size_t s_length, + my_match_t *match, uint nmatch) +{ + register const uchar *str, *search, *end, *search_end; + + if (s_length <= b_length) + { + if (!s_length) + { + if (nmatch) + { + match->beg= 0; + match->end= 0; + match->mb_len= 0; + } + return 1; /* Empty string is always found */ + } + + str= (const uchar*) b; + search= (const uchar*) s; + end= (const uchar*) b+b_length-s_length+1; + search_end= (const uchar*) s + s_length; + +skip: + while (str != end) + { + if (cs->sort_order[*str++] == cs->sort_order[*search]) + { + register const uchar *i,*j; + + i= str; + j= search+1; + + while (j != search_end) + if (cs->sort_order[*i++] != cs->sort_order[*j++]) + goto skip; + + if (nmatch > 0) + { + match[0].beg= 0; + match[0].end= (size_t) (str- (const uchar*)b-1); + match[0].mb_len= match[0].end; + + if (nmatch > 1) + { + match[1].beg= match[0].end; + match[1].end= match[0].end+s_length; + match[1].mb_len= match[1].end-match[1].beg; + } + } + return 2; + } + } + } + return 0; +} + + +typedef struct +{ + int nchars; + MY_UNI_IDX uidx; +} uni_idx; + +#define PLANE_SIZE 0x100 +#define PLANE_NUM 0x100 +#define PLANE_NUMBER(x) (((x)>>8) % PLANE_NUM) + +static int pcmp(const void * f, const void * s) +{ + const uni_idx *F= (const uni_idx*) f; + const uni_idx *S= (const uni_idx*) s; + int res; + + if (!(res=((S->nchars)-(F->nchars)))) + res=((F->uidx.from)-(S->uidx.to)); + return res; +} + +static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(size_t)) +{ + uni_idx idx[PLANE_NUM]; + int i,n; + + /* + Check that Unicode map is loaded. + It can be not loaded when the collation is + listed in Index.xml but not specified + in the character set specific XML file. + */ + if (!cs->tab_to_uni) + return TRUE; + + /* Clear plane statistics */ + bzero(idx,sizeof(idx)); + + /* Count number of characters in each plane */ + for (i=0; i< 0x100; i++) + { + uint16 wc=cs->tab_to_uni[i]; + int pl= PLANE_NUMBER(wc); + + if (wc || !i) + { + if (!idx[pl].nchars) + { + idx[pl].uidx.from=wc; + idx[pl].uidx.to=wc; + }else + { + idx[pl].uidx.from=wcidx[pl].uidx.to?wc:idx[pl].uidx.to; + } + idx[pl].nchars++; + } + } + + /* Sort planes in descending order */ + qsort(&idx,PLANE_NUM,sizeof(uni_idx),&pcmp); + + for (i=0; i < PLANE_NUM; i++) + { + int ch,numchars; + + /* Skip empty plane */ + if (!idx[i].nchars) + break; + + numchars=idx[i].uidx.to-idx[i].uidx.from+1; + if (!(idx[i].uidx.tab=(uchar*) alloc(numchars * sizeof(*idx[i].uidx.tab)))) + return TRUE; + + bzero(idx[i].uidx.tab,numchars*sizeof(*idx[i].uidx.tab)); + + for (ch=1; ch < PLANE_SIZE; ch++) + { + uint16 wc=cs->tab_to_uni[ch]; + if (wc >= idx[i].uidx.from && wc <= idx[i].uidx.to && wc) + { + int ofs= wc - idx[i].uidx.from; + idx[i].uidx.tab[ofs]= ch; + } + } + } + + /* Allocate and fill reverse table for each plane */ + n=i; + if (!(cs->tab_from_uni= (MY_UNI_IDX*) alloc(sizeof(MY_UNI_IDX)*(n+1)))) + return TRUE; + + for (i=0; i< n; i++) + cs->tab_from_uni[i]= idx[i].uidx; + + /* Set end-of-list marker */ + bzero(&cs->tab_from_uni[i],sizeof(MY_UNI_IDX)); + return FALSE; +} + +static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(size_t)) +{ + cs->caseup_multiply= 1; + cs->casedn_multiply= 1; + cs->pad_char= ' '; + return create_fromuni(cs, alloc); +} + +static void set_max_sort_char(CHARSET_INFO *cs) +{ + uchar max_char; + uint i; + + if (!cs->sort_order) + return; + + max_char=cs->sort_order[(uchar) cs->max_sort_char]; + for (i= 0; i < 256; i++) + { + if ((uchar) cs->sort_order[i] > max_char) + { + max_char=(uchar) cs->sort_order[i]; + cs->max_sort_char= i; + } + } +} + +static my_bool my_coll_init_simple(CHARSET_INFO *cs, + void *(*alloc)(size_t) __attribute__((unused))) +{ + set_max_sort_char(cs); + return FALSE; +} + + +longlong my_strtoll10_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *nptr, char **endptr, int *error) +{ + return my_strtoll10(nptr, endptr, error); +} + + +int my_mb_ctype_8bit(CHARSET_INFO *cs, int *ctype, + const uchar *s, const uchar *e) +{ + if (s >= e) + { + *ctype= 0; + return MY_CS_TOOSMALL; + } + *ctype= cs->ctype[*s + 1]; + return 1; +} + + +#undef ULONGLONG_MAX +/* + Needed under MetroWerks Compiler, since MetroWerks compiler does not + properly handle a constant expression containing a mod operator +*/ +#if defined(__NETWARE__) && defined(__MWERKS__) +static ulonglong ulonglong_max= ~(ulonglong) 0; +#define ULONGLONG_MAX ulonglong_max +#else +#define ULONGLONG_MAX (~(ulonglong) 0) +#endif /* __NETWARE__ && __MWERKS__ */ + + +#define CUTOFF (ULONGLONG_MAX / 10) +#define CUTLIM (ULONGLONG_MAX % 10) +#define DIGITS_IN_ULONGLONG 20 + +static ulonglong d10[DIGITS_IN_ULONGLONG]= +{ + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000, + 1000000000, + 10000000000ULL, + 100000000000ULL, + 1000000000000ULL, + 10000000000000ULL, + 100000000000000ULL, + 1000000000000000ULL, + 10000000000000000ULL, + 100000000000000000ULL, + 1000000000000000000ULL, + 10000000000000000000ULL +}; + + +/* + + Convert a string to unsigned long long integer value + with rounding. + + SYNOPSYS + my_strntoull10_8bit() + cs in pointer to character set + str in pointer to the string to be converted + length in string length + unsigned_flag in whether the number is unsigned + endptr out pointer to the stop character + error out returned error code + + DESCRIPTION + This function takes the decimal representation of integer number + from string str and converts it to an signed or unsigned + long long integer value. + Space characters and tab are ignored. + A sign character might precede the digit characters. + The number may have any number of pre-zero digits. + The number may have decimal point and exponent. + Rounding is always done in "away from zero" style: + 0.5 -> 1 + -0.5 -> -1 + + The function stops reading the string str after "length" bytes + or at the first character that is not a part of correct number syntax: + + ::= + [ ] [ E [ ] ] + + ::= + [ [ ] ] + | + ::= ... + + RETURN VALUES + Value of string as a signed/unsigned longlong integer + + endptr cannot be NULL. The function will store the end pointer + to the stop character here. + + The error parameter contains information how things went: + 0 ok + ERANGE If the the value of the converted number is out of range + In this case the return value is: + - ULONGLONG_MAX if unsigned_flag and the number was too big + - 0 if unsigned_flag and the number was negative + - LONGLONG_MAX if no unsigned_flag and the number is too big + - LONGLONG_MIN if no unsigned_flag and the number it too big negative + + EDOM If the string didn't contain any digits. + In this case the return value is 0. +*/ + +ulonglong +my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), + const char *str, size_t length, int unsigned_flag, + char **endptr, int *error) +{ + const char *dot, *end9, *beg, *end= str + length; + ulonglong ull; + ulong ul; + uchar ch; + int shift= 0, digits= 0, negative, addon; + + /* Skip leading spaces and tabs */ + for ( ; str < end && (*str == ' ' || *str == '\t') ; str++); + + if (str >= end) + goto ret_edom; + + if ((negative= (*str == '-')) || *str=='+') /* optional sign */ + { + if (++str == end) + goto ret_edom; + } + + beg= str; + end9= (str + 9) > end ? end : (str + 9); + /* Accumulate small number into ulong, for performance purposes */ + for (ul= 0 ; str < end9 && (ch= (uchar) (*str - '0')) < 10; str++) + { + ul= ul * 10 + ch; + } + + if (str >= end) /* Small number without dots and expanents */ + { + *endptr= (char*) str; + if (negative) + { + if (unsigned_flag) + { + *error= ul ? MY_ERRNO_ERANGE : 0; + return 0; + } + else + { + *error= 0; + return (ulonglong) (longlong) -(long) ul; + } + } + else + { + *error=0; + return (ulonglong) ul; + } + } + + digits= str - beg; + + /* Continue to accumulate into ulonglong */ + for (dot= NULL, ull= ul; str < end; str++) + { + if ((ch= (uchar) (*str - '0')) < 10) + { + if (ull < CUTOFF || (ull == CUTOFF && ch <= CUTLIM)) + { + ull= ull * 10 + ch; + digits++; + continue; + } + /* + Adding the next digit would overflow. + Remember the next digit in "addon", for rounding. + Scan all digits with an optional single dot. + */ + if (ull == CUTOFF) + { + ull= ULONGLONG_MAX; + addon= 1; + str++; + } + else + addon= (*str >= '5'); + if (!dot) + { + for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; shift++, str++); + if (str < end && *str == '.') + { + str++; + for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); + } + } + else + { + shift= dot - str; + for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); + } + goto exp; + } + + if (*str == '.') + { + if (dot) + { + /* The second dot character */ + addon= 0; + goto exp; + } + else + { + dot= str + 1; + } + continue; + } + + /* Unknown character, exit the loop */ + break; + } + shift= dot ? dot - str : 0; /* Right shift */ + addon= 0; + +exp: /* [ E [ ] ] */ + + if (!digits) + { + str= beg; + goto ret_edom; + } + + if (str < end && (*str == 'e' || *str == 'E')) + { + str++; + if (str < end) + { + int negative_exp, exponent; + if ((negative_exp= (*str == '-')) || *str=='+') + { + if (++str == end) + goto ret_sign; + } + for (exponent= 0 ; + str < end && (ch= (uchar) (*str - '0')) < 10; + str++) + { + exponent= exponent * 10 + ch; + } + shift+= negative_exp ? -exponent : exponent; + } + } + + if (shift == 0) /* No shift, check addon digit */ + { + if (addon) + { + if (ull == ULONGLONG_MAX) + goto ret_too_big; + ull++; + } + goto ret_sign; + } + + if (shift < 0) /* Right shift */ + { + ulonglong d, r; + + if (-shift >= DIGITS_IN_ULONGLONG) + goto ret_zero; /* Exponent is a big negative number, return 0 */ + + d= d10[-shift]; + r= (ull % d) * 2; + ull /= d; + if (r >= d) + ull++; + goto ret_sign; + } + + if (shift > DIGITS_IN_ULONGLONG) /* Huge left shift */ + { + if (!ull) + goto ret_sign; + goto ret_too_big; + } + + for ( ; shift > 0; shift--, ull*= 10) /* Left shift */ + { + if (ull > CUTOFF) + goto ret_too_big; /* Overflow, number too big */ + } + +ret_sign: + *endptr= (char*) str; + + if (!unsigned_flag) + { + if (negative) + { + if (ull > (ulonglong) LONGLONG_MIN) + { + *error= MY_ERRNO_ERANGE; + return (ulonglong) LONGLONG_MIN; + } + *error= 0; + return (ulonglong) -(longlong) ull; + } + else + { + if (ull > (ulonglong) LONGLONG_MAX) + { + *error= MY_ERRNO_ERANGE; + return (ulonglong) LONGLONG_MAX; + } + *error= 0; + return ull; + } + } + + /* Unsigned number */ + if (negative && ull) + { + *error= MY_ERRNO_ERANGE; + return 0; + } + *error= 0; + return ull; + +ret_zero: + *endptr= (char*) str; + *error= 0; + return 0; + +ret_edom: + *endptr= (char*) str; + *error= MY_ERRNO_EDOM; + return 0; + +ret_too_big: + *endptr= (char*) str; + *error= MY_ERRNO_ERANGE; + return unsigned_flag ? + ULONGLONG_MAX : + negative ? (ulonglong) LONGLONG_MIN : (ulonglong) LONGLONG_MAX; +} + + +/* + Check if a constant can be propagated + + SYNOPSIS: + my_propagate_simple() + cs Character set information + str String to convert to double + length Optional length for string. + + NOTES: + Takes the string in the given charset and check + if it can be safely propagated in the optimizer. + + create table t1 ( + s char(5) character set latin1 collate latin1_german2_ci); + insert into t1 values (0xf6); -- o-umlaut + select * from t1 where length(s)=1 and s='oe'; + + The above query should return one row. + We cannot convert this query into: + select * from t1 where length('oe')=1 and s='oe'; + + Currently we don't check the constant itself, + and decide not to propagate a constant + just if the collation itself allows tricky things + like expansions and contractions. In the future + we can write a more sophisticated functions to + check the constants. For example, 'oa' can always + be safety propagated in German2 because unlike + 'oe' it does not have any special meaning. + + RETURN + 1 if constant can be safely propagated + 0 if it is not safe to propagate the constant +*/ + + + +my_bool my_propagate_simple(CHARSET_INFO *cs __attribute__((unused)), + const uchar *str __attribute__((unused)), + size_t length __attribute__((unused))) +{ + return 1; +} + + +my_bool my_propagate_complex(CHARSET_INFO *cs __attribute__((unused)), + const uchar *str __attribute__((unused)), + size_t length __attribute__((unused))) +{ + return 0; +} + + + +/* + Normalize strxfrm flags + + SYNOPSIS: + my_strxfrm_flag_normalize() + flags - non-normalized flags + nlevels - number of levels + + NOTES: + If levels are omitted, then 1-maximum is assumed. + If any level number is greater than the maximum, + it is treated as the maximum. + + RETURN + normalized flags +*/ + +uint my_strxfrm_flag_normalize(uint flags, uint maximum) +{ + DBUG_ASSERT(maximum >= 1 && maximum <= MY_STRXFRM_NLEVELS); + + /* If levels are omitted, then 1-maximum is assumed*/ + if (!(flags & MY_STRXFRM_LEVEL_ALL)) + { + static uint def_level_flags[]= {0, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F }; + uint flag_pad= flags & + (MY_STRXFRM_PAD_WITH_SPACE | MY_STRXFRM_PAD_TO_MAXLEN); + flags= def_level_flags[maximum] | flag_pad; + } + else + { + uint i; + uint flag_lev= flags & MY_STRXFRM_LEVEL_ALL; + uint flag_dsc= (flags >> MY_STRXFRM_DESC_SHIFT) & MY_STRXFRM_LEVEL_ALL; + uint flag_rev= (flags >> MY_STRXFRM_REVERSE_SHIFT) & MY_STRXFRM_LEVEL_ALL; + uint flag_pad= flags & + (MY_STRXFRM_PAD_WITH_SPACE | MY_STRXFRM_PAD_TO_MAXLEN); + + /* + If any level number is greater than the maximum, + it is treated as the maximum. + */ + for (maximum--, flags= 0, i= 0; i < MY_STRXFRM_NLEVELS; i++) + { + uint src_bit= 1 << i; + if (flag_lev & src_bit) + { + uint dst_bit= 1 << min(i, maximum); + flags|= dst_bit; + flags|= (flag_dsc & dst_bit) << MY_STRXFRM_DESC_SHIFT; + flags|= (flag_rev & dst_bit) << MY_STRXFRM_REVERSE_SHIFT; + } + else + { + /* Check that there are no DESC or REVERSE flag for skipped level */ + DBUG_ASSERT(!(flag_dsc & src_bit) && !(flag_rev & src_bit)); + } + } + flags|= flag_pad; + } + + return flags; +} + +/* + Apply DESC and REVERSE collation rules. + + SYNOPSIS: + my_strxfrm_desc_and_reverse() + str - pointer to string + strend - end of string + flags - flags + level - which level, starting from 0. + + NOTES: + Apply DESC or REVERSE or both flags. + + If DESC flag is given, then the weights + come out NOTed or negated for that level. + + If REVERSE flags is given, then the weights come out in + reverse order for that level, that is, starting with + the last character and ending with the first character. + + If nether DESC nor REVERSE flags are give, + the string is not changed. + +*/ +void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend, + uint flags, uint level) +{ + if (flags & (MY_STRXFRM_DESC_LEVEL1 << level)) + { + if (flags & (MY_STRXFRM_REVERSE_LEVEL1 << level)) + { + for (strend--; str <= strend;) + { + uchar tmp= *str; + *str++= ~*strend; + *strend--= ~tmp; + } + } + else + { + for (; str < strend; str++) + *str= ~*str; + } + } + else if (flags & (MY_STRXFRM_REVERSE_LEVEL1 << level)) + { + for (strend--; str < strend;) + { + uchar tmp= *str; + *str++= *strend; + *strend--= tmp; + } + } +} + + +size_t +my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs, + uchar *str, uchar *frmend, uchar *strend, + uint nweights, uint flags, uint level) +{ + if (nweights && frmend < strend && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint fill_length= min((uint) (strend - frmend), nweights * cs->mbminlen); + cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char); + frmend+= fill_length; + } + my_strxfrm_desc_and_reverse(str, frmend, flags, level); + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend) + { + uint fill_length= strend - frmend; + cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char); + frmend= strend; + } + return frmend - str; +} + + +MY_CHARSET_HANDLER my_charset_8bit_handler= +{ + my_cset_init_8bit, + NULL, /* ismbchar */ + my_mbcharlen_8bit, /* mbcharlen */ + my_numchars_8bit, + my_charpos_8bit, + my_well_formed_len_8bit, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_8bit, + my_wc_mb_8bit, + my_mb_ctype_8bit, + my_caseup_str_8bit, + my_casedn_str_8bit, + my_caseup_8bit, + my_casedn_8bit, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + +MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler = +{ + my_coll_init_simple, /* init */ + my_strnncoll_simple, + my_strnncollsp_simple, + my_strnxfrm_simple, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_8bit, + my_strcasecmp_8bit, + my_instr_simple, + my_hash_sort_simple, + my_propagate_simple +}; diff --git a/externals/mysql/strings/ctype-sjis.c b/externals/mysql/strings/ctype-sjis.c new file mode 100644 index 00000000000..762379c6ffe --- /dev/null +++ b/externals/mysql/strings/ctype-sjis.c @@ -0,0 +1,4716 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is for Shift JIS charset, and created by tommy@valley.ne.jp. + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_sjis + + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_sjis=1 + * .configure. mbmaxlen_sjis=2 + */ + +static uchar NEAR ctype_sjis[257] = +{ + 0, /* For standard library */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ + 0040, 0050, 0050, 0050, 0050, 0050, 0040, 0040, /* ^H - ^O */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^P - ^W */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^X - ^Z ^[ ^\ ^] ^^ ^_ */ + 0110, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* SPC ! " # $ % ^ ' */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* ( ) * + , - . / */ + 0204, 0204, 0204, 0204, 0204, 0204, 0204, 0204, /* 0 1 2 3 4 5 6 7 */ + 0204, 0204, 0020, 0020, 0020, 0020, 0020, 0020, /* 8 9 : ; < = > ? */ + 0020, 0201, 0201, 0201, 0201, 0201, 0201, 0001, /* @ A B C D E F G */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* H I J K L M N O */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* P Q R S T U V W */ + 0001, 0001, 0001, 0020, 0020, 0020, 0020, 0020, /* X Y Z [ \ ] ^ _ */ + 0020, 0202, 0202, 0202, 0202, 0202, 0202, 0002, /* ` a b c d e f g */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* h i j k l m n o */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* p q r s t u v w */ + 0002, 0002, 0002, 0020, 0020, 0020, 0020, 0040, /* x y z { | } + DEL */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0000, 0000, 0000 +}; + +static uchar NEAR to_lower_sjis[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR to_upper_sjis[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR sort_order_sjis[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +#define issjishead(c) ((0x81<=(c) && (c)<=0x9f) || \ + ((0xe0<=(c)) && (c)<=0xfc)) +#define issjistail(c) ((0x40<=(c) && (c)<=0x7e) || \ + (0x80<=(c) && (c)<=0xfc)) + + +static uint ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0); +} + +static uint mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (issjishead((uchar) c) ? 2 : 1); +} + + +#define sjiscode(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) + + +static int my_strnncoll_sjis_internal(CHARSET_INFO *cs, + const uchar **a_res, size_t a_length, + const uchar **b_res, size_t b_length) +{ + const uchar *a= *a_res, *b= *b_res; + const uchar *a_end= a + a_length; + const uchar *b_end= b + b_length; + while (a < a_end && b < b_end) + { + if (ismbchar_sjis(cs,(char*) a, (char*) a_end) && + ismbchar_sjis(cs,(char*) b, (char*) b_end)) + { + uint a_char= sjiscode(*a, *(a+1)); + uint b_char= sjiscode(*b, *(b+1)); + if (a_char != b_char) + return (int) a_char - (int) b_char; + a += 2; + b += 2; + } else + { + if (sort_order_sjis[(uchar)*a] != sort_order_sjis[(uchar)*b]) + return sort_order_sjis[(uchar)*a] - sort_order_sjis[(uchar)*b]; + a++; + b++; + } + } + *a_res= a; + *b_res= b; + return 0; +} + + +static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool b_is_prefix) +{ + int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length); + if (b_is_prefix && a_length > b_length) + a_length= b_length; + return res ? res : (int) (a_length - b_length); +} + + +static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), + const uchar *a, size_t a_length, + const uchar *b, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + const uchar *a_end= a + a_length, *b_end= b + b_length; + int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + if (!res && (a != a_end || b != b_end)) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a == a_end) + { + /* put shorter key in a */ + a_end= b_end; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (; a < a_end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + } + return res; +} + + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +#define max_sort_char ((char) 255) + +static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr,size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) +{ + const char *end= ptr + ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + size_t charlen= res_length / cs->mbmaxlen; + + for ( ; ptr < end && min_str < min_end && charlen > 0 ; charlen--) + { + if (ismbchar_sjis(cs, ptr, end)) { + *min_str++ = *max_str++ = *ptr++; + if (min_str < min_end) + *min_str++ = *max_str++ = *ptr++; + continue; + } + if (*ptr == escape && ptr+1 < end) { + ptr++; /* Skip escape */ + if (ismbchar_sjis(cs, ptr, end)) + *min_str++ = *max_str++ = *ptr++; + if (min_str < min_end) + *min_str++ = *max_str++ = *ptr++; + continue; + } + if (*ptr == w_one) { /* '_' in SQL */ + *min_str++ = '\0'; /* This should be min char */ + *max_str++ = max_sort_char; + ptr++; + continue; + } + if (*ptr == w_many) + { /* '%' in SQL */ + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + do + { + *min_str++= 0; + *max_str++= max_sort_char; + } while (min_str < min_end); + return 0; + } + *min_str++ = *max_str++ = *ptr++; + } + + *min_length= *max_length= (size_t) (min_str - min_org); + while (min_str != min_end) + *min_str++= *max_str++= ' '; /* Because if key compression */ + return 0; +} + +/* page 0 0x00A1-0x00DF */ +static uint16 tab_sjis_uni0[]={ +0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67,0xFF68, +0xFF69,0xFF6A,0xFF6B,0xFF6C,0xFF6D,0xFF6E,0xFF6F,0xFF70, +0xFF71,0xFF72,0xFF73,0xFF74,0xFF75,0xFF76,0xFF77,0xFF78, +0xFF79,0xFF7A,0xFF7B,0xFF7C,0xFF7D,0xFF7E,0xFF7F,0xFF80, +0xFF81,0xFF82,0xFF83,0xFF84,0xFF85,0xFF86,0xFF87,0xFF88, +0xFF89,0xFF8A,0xFF8B,0xFF8C,0xFF8D,0xFF8E,0xFF8F,0xFF90, +0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97,0xFF98, +0xFF99,0xFF9A,0xFF9B,0xFF9C,0xFF9D,0xFF9E,0xFF9F}; + +/* page 1 0x8140-0x84BE */ +static uint16 tab_sjis_uni1[]={ +0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B, +0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E, +0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD, +0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0x005C, +0x301C,0x2016,0xFF5C,0x2026,0x2025,0x2018,0x2019,0x201C, +0x201D,0xFF08,0xFF09,0x3014,0x3015,0xFF3B,0xFF3D,0xFF5B, +0xFF5D,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E, +0x300F,0x3010,0x3011,0xFF0B,0x2212,0x00B1,0x00D7, 0, +0x00F7,0xFF1D,0x2260,0xFF1C,0xFF1E,0x2266,0x2267,0x221E, +0x2234,0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFFE5, +0xFF04,0x00A2,0x00A3,0xFF05,0xFF03,0xFF06,0xFF0A,0xFF20, +0x00A7,0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7,0x25C6, +0x25A1,0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x203B,0x3012, +0x2192,0x2190,0x2191,0x2193,0x3013, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2208,0x220B,0x2286,0x2287,0x2282,0x2283,0x222A,0x2229, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2227,0x2228,0x00AC,0x21D2,0x21D4,0x2200,0x2203, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2220,0x22A5,0x2312,0x2202,0x2207,0x2261, +0x2252,0x226A,0x226B,0x221A,0x223D,0x221D,0x2235,0x222B, +0x222C, 0, 0, 0, 0, 0, 0, 0, +0x212B,0x2030,0x266F,0x266D,0x266A,0x2020,0x2021,0x00B6, + 0, 0, 0, 0,0x25EF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xFF10, +0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18, +0xFF19, 0, 0, 0, 0, 0, 0, 0, +0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28, +0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30, +0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38, +0xFF39,0xFF3A, 0, 0, 0, 0, 0, 0, + 0,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, +0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, +0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57, +0xFF58,0xFF59,0xFF5A, 0, 0, 0, 0,0x3041, +0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048,0x3049, +0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050,0x3051, +0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058,0x3059, +0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060,0x3061, +0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068,0x3069, +0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070,0x3071, +0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078,0x3079, +0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080,0x3081, +0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088,0x3089, +0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090,0x3091, +0x3092,0x3093, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, +0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, +0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, +0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, +0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, +0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, +0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, +0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF, 0, +0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7, +0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF, +0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6, 0, + 0, 0, 0, 0, 0, 0, 0,0x0391, +0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398,0x0399, +0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0,0x03A1, +0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, 0, + 0, 0, 0, 0, 0, 0, 0,0x03B1, +0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8,0x03B9, +0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0,0x03C1, +0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, +0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, +0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, +0x042F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D, 0, +0x043E,0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445, +0x0446,0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D, +0x044E,0x044F, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2500, +0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C,0x2524, +0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B,0x2517, +0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F,0x2528, +0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542}; + +/* page 2 0x889F-0x9FFC */ +static uint16 tab_sjis_uni2[]={ +0x4E9C,0x5516,0x5A03,0x963F,0x54C0,0x611B,0x6328,0x59F6, +0x9022,0x8475,0x831C,0x7A50,0x60AA,0x63E1,0x6E25,0x65ED, +0x8466,0x82A6,0x9BF5,0x6893,0x5727,0x65A1,0x6271,0x5B9B, +0x59D0,0x867B,0x98F4,0x7D62,0x7DBE,0x9B8E,0x6216,0x7C9F, +0x88B7,0x5B89,0x5EB5,0x6309,0x6697,0x6848,0x95C7,0x978D, +0x674F,0x4EE5,0x4F0A,0x4F4D,0x4F9D,0x5049,0x56F2,0x5937, +0x59D4,0x5A01,0x5C09,0x60DF,0x610F,0x6170,0x6613,0x6905, +0x70BA,0x754F,0x7570,0x79FB,0x7DAD,0x7DEF,0x80C3,0x840E, +0x8863,0x8B02,0x9055,0x907A,0x533B,0x4E95,0x4EA5,0x57DF, +0x80B2,0x90C1,0x78EF,0x4E00,0x58F1,0x6EA2,0x9038,0x7A32, +0x8328,0x828B,0x9C2F,0x5141,0x5370,0x54BD,0x54E1,0x56E0, +0x59FB,0x5F15,0x98F2,0x6DEB,0x80E4,0x852D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9662,0x9670,0x96A0,0x97FB,0x540B,0x53F3,0x5B87, +0x70CF,0x7FBD,0x8FC2,0x96E8,0x536F,0x9D5C,0x7ABA,0x4E11, +0x7893,0x81FC,0x6E26,0x5618,0x5504,0x6B1D,0x851A,0x9C3B, +0x59E5,0x53A9,0x6D66,0x74DC,0x958F,0x5642,0x4E91,0x904B, +0x96F2,0x834F,0x990C,0x53E1,0x55B6,0x5B30,0x5F71,0x6620, +0x66F3,0x6804,0x6C38,0x6CF3,0x6D29,0x745B,0x76C8,0x7A4E, +0x9834,0x82F1,0x885B,0x8A60,0x92ED,0x6DB2,0x75AB,0x76CA, +0x99C5,0x60A6,0x8B01,0x8D8A,0x95B2,0x698E,0x53AD,0x5186, + 0,0x5712,0x5830,0x5944,0x5BB4,0x5EF6,0x6028,0x63A9, +0x63F4,0x6CBF,0x6F14,0x708E,0x7114,0x7159,0x71D5,0x733F, +0x7E01,0x8276,0x82D1,0x8597,0x9060,0x925B,0x9D1B,0x5869, +0x65BC,0x6C5A,0x7525,0x51F9,0x592E,0x5965,0x5F80,0x5FDC, +0x62BC,0x65FA,0x6A2A,0x6B27,0x6BB4,0x738B,0x7FC1,0x8956, +0x9D2C,0x9D0E,0x9EC4,0x5CA1,0x6C96,0x837B,0x5104,0x5C4B, +0x61B6,0x81C6,0x6876,0x7261,0x4E59,0x4FFA,0x5378,0x6069, +0x6E29,0x7A4F,0x97F3,0x4E0B,0x5316,0x4EEE,0x4F55,0x4F3D, +0x4FA1,0x4F73,0x52A0,0x53EF,0x5609,0x590F,0x5AC1,0x5BB6, +0x5BE1,0x79D1,0x6687,0x679C,0x67B6,0x6B4C,0x6CB3,0x706B, +0x73C2,0x798D,0x79BE,0x7A3C,0x7B87,0x82B1,0x82DB,0x8304, +0x8377,0x83EF,0x83D3,0x8766,0x8AB2,0x5629,0x8CA8,0x8FE6, +0x904E,0x971E,0x868A,0x4FC4,0x5CE8,0x6211,0x7259,0x753B, +0x81E5,0x82BD,0x86FE,0x8CC0,0x96C5,0x9913,0x99D5,0x4ECB, +0x4F1A,0x89E3,0x56DE,0x584A,0x58CA,0x5EFB,0x5FEB,0x602A, +0x6094,0x6062,0x61D0,0x6212,0x62D0,0x6539, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9B41,0x6666,0x68B0,0x6D77,0x7070,0x754C,0x7686, +0x7D75,0x82A5,0x87F9,0x958B,0x968E,0x8C9D,0x51F1,0x52BE, +0x5916,0x54B3,0x5BB3,0x5D16,0x6168,0x6982,0x6DAF,0x788D, +0x84CB,0x8857,0x8A72,0x93A7,0x9AB8,0x6D6C,0x99A8,0x86D9, +0x57A3,0x67FF,0x86CE,0x920E,0x5283,0x5687,0x5404,0x5ED3, +0x62E1,0x64B9,0x683C,0x6838,0x6BBB,0x7372,0x78BA,0x7A6B, +0x899A,0x89D2,0x8D6B,0x8F03,0x90ED,0x95A3,0x9694,0x9769, +0x5B66,0x5CB3,0x697D,0x984D,0x984E,0x639B,0x7B20,0x6A2B, + 0,0x6A7F,0x68B6,0x9C0D,0x6F5F,0x5272,0x559D,0x6070, +0x62EC,0x6D3B,0x6E07,0x6ED1,0x845B,0x8910,0x8F44,0x4E14, +0x9C39,0x53F6,0x691B,0x6A3A,0x9784,0x682A,0x515C,0x7AC3, +0x84B2,0x91DC,0x938C,0x565B,0x9D28,0x6822,0x8305,0x8431, +0x7CA5,0x5208,0x82C5,0x74E6,0x4E7E,0x4F83,0x51A0,0x5BD2, +0x520A,0x52D8,0x52E7,0x5DFB,0x559A,0x582A,0x59E6,0x5B8C, +0x5B98,0x5BDB,0x5E72,0x5E79,0x60A3,0x611F,0x6163,0x61BE, +0x63DB,0x6562,0x67D1,0x6853,0x68FA,0x6B3E,0x6B53,0x6C57, +0x6F22,0x6F97,0x6F45,0x74B0,0x7518,0x76E3,0x770B,0x7AFF, +0x7BA1,0x7C21,0x7DE9,0x7F36,0x7FF0,0x809D,0x8266,0x839E, +0x89B3,0x8ACC,0x8CAB,0x9084,0x9451,0x9593,0x9591,0x95A2, +0x9665,0x97D3,0x9928,0x8218,0x4E38,0x542B,0x5CB8,0x5DCC, +0x73A9,0x764C,0x773C,0x5CA9,0x7FEB,0x8D0B,0x96C1,0x9811, +0x9854,0x9858,0x4F01,0x4F0E,0x5371,0x559C,0x5668,0x57FA, +0x5947,0x5B09,0x5BC4,0x5C90,0x5E0C,0x5E7E,0x5FCC,0x63EE, +0x673A,0x65D7,0x65E2,0x671F,0x68CB,0x68C4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6A5F,0x5E30,0x6BC5,0x6C17,0x6C7D,0x757F,0x7948, +0x5B63,0x7A00,0x7D00,0x5FBD,0x898F,0x8A18,0x8CB4,0x8D77, +0x8ECC,0x8F1D,0x98E2,0x9A0E,0x9B3C,0x4E80,0x507D,0x5100, +0x5993,0x5B9C,0x622F,0x6280,0x64EC,0x6B3A,0x72A0,0x7591, +0x7947,0x7FA9,0x87FB,0x8ABC,0x8B70,0x63AC,0x83CA,0x97A0, +0x5409,0x5403,0x55AB,0x6854,0x6A58,0x8A70,0x7827,0x6775, +0x9ECD,0x5374,0x5BA2,0x811A,0x8650,0x9006,0x4E18,0x4E45, +0x4EC7,0x4F11,0x53CA,0x5438,0x5BAE,0x5F13,0x6025,0x6551, + 0,0x673D,0x6C42,0x6C72,0x6CE3,0x7078,0x7403,0x7A76, +0x7AAE,0x7B08,0x7D1A,0x7CFE,0x7D66,0x65E7,0x725B,0x53BB, +0x5C45,0x5DE8,0x62D2,0x62E0,0x6319,0x6E20,0x865A,0x8A31, +0x8DDD,0x92F8,0x6F01,0x79A6,0x9B5A,0x4EA8,0x4EAB,0x4EAC, +0x4F9B,0x4FA0,0x50D1,0x5147,0x7AF6,0x5171,0x51F6,0x5354, +0x5321,0x537F,0x53EB,0x55AC,0x5883,0x5CE1,0x5F37,0x5F4A, +0x602F,0x6050,0x606D,0x631F,0x6559,0x6A4B,0x6CC1,0x72C2, +0x72ED,0x77EF,0x80F8,0x8105,0x8208,0x854E,0x90F7,0x93E1, +0x97FF,0x9957,0x9A5A,0x4EF0,0x51DD,0x5C2D,0x6681,0x696D, +0x5C40,0x66F2,0x6975,0x7389,0x6850,0x7C81,0x50C5,0x52E4, +0x5747,0x5DFE,0x9326,0x65A4,0x6B23,0x6B3D,0x7434,0x7981, +0x79BD,0x7B4B,0x7DCA,0x82B9,0x83CC,0x887F,0x895F,0x8B39, +0x8FD1,0x91D1,0x541F,0x9280,0x4E5D,0x5036,0x53E5,0x533A, +0x72D7,0x7396,0x77E9,0x82E6,0x8EAF,0x99C6,0x99C8,0x99D2, +0x5177,0x611A,0x865E,0x55B0,0x7A7A,0x5076,0x5BD3,0x9047, +0x9685,0x4E32,0x6ADB,0x91E7,0x5C51,0x5C48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6398,0x7A9F,0x6C93,0x9774,0x8F61,0x7AAA,0x718A, +0x9688,0x7C82,0x6817,0x7E70,0x6851,0x936C,0x52F2,0x541B, +0x85AB,0x8A13,0x7FA4,0x8ECD,0x90E1,0x5366,0x8888,0x7941, +0x4FC2,0x50BE,0x5211,0x5144,0x5553,0x572D,0x73EA,0x578B, +0x5951,0x5F62,0x5F84,0x6075,0x6176,0x6167,0x61A9,0x63B2, +0x643A,0x656C,0x666F,0x6842,0x6E13,0x7566,0x7A3D,0x7CFB, +0x7D4C,0x7D99,0x7E4B,0x7F6B,0x830E,0x834A,0x86CD,0x8A08, +0x8A63,0x8B66,0x8EFD,0x981A,0x9D8F,0x82B8,0x8FCE,0x9BE8, + 0,0x5287,0x621F,0x6483,0x6FC0,0x9699,0x6841,0x5091, +0x6B20,0x6C7A,0x6F54,0x7A74,0x7D50,0x8840,0x8A23,0x6708, +0x4EF6,0x5039,0x5026,0x5065,0x517C,0x5238,0x5263,0x55A7, +0x570F,0x5805,0x5ACC,0x5EFA,0x61B2,0x61F8,0x62F3,0x6372, +0x691C,0x6A29,0x727D,0x72AC,0x732E,0x7814,0x786F,0x7D79, +0x770C,0x80A9,0x898B,0x8B19,0x8CE2,0x8ED2,0x9063,0x9375, +0x967A,0x9855,0x9A13,0x9E78,0x5143,0x539F,0x53B3,0x5E7B, +0x5F26,0x6E1B,0x6E90,0x7384,0x73FE,0x7D43,0x8237,0x8A00, +0x8AFA,0x9650,0x4E4E,0x500B,0x53E4,0x547C,0x56FA,0x59D1, +0x5B64,0x5DF1,0x5EAB,0x5F27,0x6238,0x6545,0x67AF,0x6E56, +0x72D0,0x7CCA,0x88B4,0x80A1,0x80E1,0x83F0,0x864E,0x8A87, +0x8DE8,0x9237,0x96C7,0x9867,0x9F13,0x4E94,0x4E92,0x4F0D, +0x5348,0x5449,0x543E,0x5A2F,0x5F8C,0x5FA1,0x609F,0x68A7, +0x6A8E,0x745A,0x7881,0x8A9E,0x8AA4,0x8B77,0x9190,0x4E5E, +0x9BC9,0x4EA4,0x4F7C,0x4FAF,0x5019,0x5016,0x5149,0x516C, +0x529F,0x52B9,0x52FE,0x539A,0x53E3,0x5411, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x540E,0x5589,0x5751,0x57A2,0x597D,0x5B54,0x5B5D, +0x5B8F,0x5DE5,0x5DE7,0x5DF7,0x5E78,0x5E83,0x5E9A,0x5EB7, +0x5F18,0x6052,0x614C,0x6297,0x62D8,0x63A7,0x653B,0x6602, +0x6643,0x66F4,0x676D,0x6821,0x6897,0x69CB,0x6C5F,0x6D2A, +0x6D69,0x6E2F,0x6E9D,0x7532,0x7687,0x786C,0x7A3F,0x7CE0, +0x7D05,0x7D18,0x7D5E,0x7DB1,0x8015,0x8003,0x80AF,0x80B1, +0x8154,0x818F,0x822A,0x8352,0x884C,0x8861,0x8B1B,0x8CA2, +0x8CFC,0x90CA,0x9175,0x9271,0x783F,0x92FC,0x95A4,0x964D, + 0,0x9805,0x9999,0x9AD8,0x9D3B,0x525B,0x52AB,0x53F7, +0x5408,0x58D5,0x62F7,0x6FE0,0x8C6A,0x8F5F,0x9EB9,0x514B, +0x523B,0x544A,0x56FD,0x7A40,0x9177,0x9D60,0x9ED2,0x7344, +0x6F09,0x8170,0x7511,0x5FFD,0x60DA,0x9AA8,0x72DB,0x8FBC, +0x6B64,0x9803,0x4ECA,0x56F0,0x5764,0x58BE,0x5A5A,0x6068, +0x61C7,0x660F,0x6606,0x6839,0x68B1,0x6DF7,0x75D5,0x7D3A, +0x826E,0x9B42,0x4E9B,0x4F50,0x53C9,0x5506,0x5D6F,0x5DE6, +0x5DEE,0x67FB,0x6C99,0x7473,0x7802,0x8A50,0x9396,0x88DF, +0x5750,0x5EA7,0x632B,0x50B5,0x50AC,0x518D,0x6700,0x54C9, +0x585E,0x59BB,0x5BB0,0x5F69,0x624D,0x63A1,0x683D,0x6B73, +0x6E08,0x707D,0x91C7,0x7280,0x7815,0x7826,0x796D,0x658E, +0x7D30,0x83DC,0x88C1,0x8F09,0x969B,0x5264,0x5728,0x6750, +0x7F6A,0x8CA1,0x51B4,0x5742,0x962A,0x583A,0x698A,0x80B4, +0x54B2,0x5D0E,0x57FC,0x7895,0x9DFA,0x4F5C,0x524A,0x548B, +0x643E,0x6628,0x6714,0x67F5,0x7A84,0x7B56,0x7D22,0x932F, +0x685C,0x9BAD,0x7B39,0x5319,0x518A,0x5237, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5BDF,0x62F6,0x64AE,0x64E6,0x672D,0x6BBA,0x85A9, +0x96D1,0x7690,0x9BD6,0x634C,0x9306,0x9BAB,0x76BF,0x6652, +0x4E09,0x5098,0x53C2,0x5C71,0x60E8,0x6492,0x6563,0x685F, +0x71E6,0x73CA,0x7523,0x7B97,0x7E82,0x8695,0x8B83,0x8CDB, +0x9178,0x9910,0x65AC,0x66AB,0x6B8B,0x4ED5,0x4ED4,0x4F3A, +0x4F7F,0x523A,0x53F8,0x53F2,0x55E3,0x56DB,0x58EB,0x59CB, +0x59C9,0x59FF,0x5B50,0x5C4D,0x5E02,0x5E2B,0x5FD7,0x601D, +0x6307,0x652F,0x5B5C,0x65AF,0x65BD,0x65E8,0x679D,0x6B62, + 0,0x6B7B,0x6C0F,0x7345,0x7949,0x79C1,0x7CF8,0x7D19, +0x7D2B,0x80A2,0x8102,0x81F3,0x8996,0x8A5E,0x8A69,0x8A66, +0x8A8C,0x8AEE,0x8CC7,0x8CDC,0x96CC,0x98FC,0x6B6F,0x4E8B, +0x4F3C,0x4F8D,0x5150,0x5B57,0x5BFA,0x6148,0x6301,0x6642, +0x6B21,0x6ECB,0x6CBB,0x723E,0x74BD,0x75D4,0x78C1,0x793A, +0x800C,0x8033,0x81EA,0x8494,0x8F9E,0x6C50,0x9E7F,0x5F0F, +0x8B58,0x9D2B,0x7AFA,0x8EF8,0x5B8D,0x96EB,0x4E03,0x53F1, +0x57F7,0x5931,0x5AC9,0x5BA4,0x6089,0x6E7F,0x6F06,0x75BE, +0x8CEA,0x5B9F,0x8500,0x7BE0,0x5072,0x67F4,0x829D,0x5C61, +0x854A,0x7E1E,0x820E,0x5199,0x5C04,0x6368,0x8D66,0x659C, +0x716E,0x793E,0x7D17,0x8005,0x8B1D,0x8ECA,0x906E,0x86C7, +0x90AA,0x501F,0x52FA,0x5C3A,0x6753,0x707C,0x7235,0x914C, +0x91C8,0x932B,0x82E5,0x5BC2,0x5F31,0x60F9,0x4E3B,0x53D6, +0x5B88,0x624B,0x6731,0x6B8A,0x72E9,0x73E0,0x7A2E,0x816B, +0x8DA3,0x9152,0x9996,0x5112,0x53D7,0x546A,0x5BFF,0x6388, +0x6A39,0x7DAC,0x9700,0x56DA,0x53CE,0x5468, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B97,0x5C31,0x5DDE,0x4FEE,0x6101,0x62FE,0x6D32, +0x79C0,0x79CB,0x7D42,0x7E4D,0x7FD2,0x81ED,0x821F,0x8490, +0x8846,0x8972,0x8B90,0x8E74,0x8F2F,0x9031,0x914B,0x916C, +0x96C6,0x919C,0x4EC0,0x4F4F,0x5145,0x5341,0x5F93,0x620E, +0x67D4,0x6C41,0x6E0B,0x7363,0x7E26,0x91CD,0x9283,0x53D4, +0x5919,0x5BBF,0x6DD1,0x795D,0x7E2E,0x7C9B,0x587E,0x719F, +0x51FA,0x8853,0x8FF0,0x4FCA,0x5CFB,0x6625,0x77AC,0x7AE3, +0x821C,0x99FF,0x51C6,0x5FAA,0x65EC,0x696F,0x6B89,0x6DF3, + 0,0x6E96,0x6F64,0x76FE,0x7D14,0x5DE1,0x9075,0x9187, +0x9806,0x51E6,0x521D,0x6240,0x6691,0x66D9,0x6E1A,0x5EB6, +0x7DD2,0x7F72,0x66F8,0x85AF,0x85F7,0x8AF8,0x52A9,0x53D9, +0x5973,0x5E8F,0x5F90,0x6055,0x92E4,0x9664,0x50B7,0x511F, +0x52DD,0x5320,0x5347,0x53EC,0x54E8,0x5546,0x5531,0x5617, +0x5968,0x59BE,0x5A3C,0x5BB5,0x5C06,0x5C0F,0x5C11,0x5C1A, +0x5E84,0x5E8A,0x5EE0,0x5F70,0x627F,0x6284,0x62DB,0x638C, +0x6377,0x6607,0x660C,0x662D,0x6676,0x677E,0x68A2,0x6A1F, +0x6A35,0x6CBC,0x6D88,0x6E09,0x6E58,0x713C,0x7126,0x7167, +0x75C7,0x7701,0x785D,0x7901,0x7965,0x79F0,0x7AE0,0x7B11, +0x7CA7,0x7D39,0x8096,0x83D6,0x848B,0x8549,0x885D,0x88F3, +0x8A1F,0x8A3C,0x8A54,0x8A73,0x8C61,0x8CDE,0x91A4,0x9266, +0x937E,0x9418,0x969C,0x9798,0x4E0A,0x4E08,0x4E1E,0x4E57, +0x5197,0x5270,0x57CE,0x5834,0x58CC,0x5B22,0x5E38,0x60C5, +0x64FE,0x6761,0x6756,0x6D44,0x72B6,0x7573,0x7A63,0x84B8, +0x8B72,0x91B8,0x9320,0x5631,0x57F4,0x98FE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x62ED,0x690D,0x6B96,0x71ED,0x7E54,0x8077,0x8272, +0x89E6,0x98DF,0x8755,0x8FB1,0x5C3B,0x4F38,0x4FE1,0x4FB5, +0x5507,0x5A20,0x5BDD,0x5BE9,0x5FC3,0x614E,0x632F,0x65B0, +0x664B,0x68EE,0x699B,0x6D78,0x6DF1,0x7533,0x75B9,0x771F, +0x795E,0x79E6,0x7D33,0x81E3,0x82AF,0x85AA,0x89AA,0x8A3A, +0x8EAB,0x8F9B,0x9032,0x91DD,0x9707,0x4EBA,0x4EC1,0x5203, +0x5875,0x58EC,0x5C0B,0x751A,0x5C3D,0x814E,0x8A0A,0x8FC5, +0x9663,0x976D,0x7B25,0x8ACF,0x9808,0x9162,0x56F3,0x53A8, + 0,0x9017,0x5439,0x5782,0x5E25,0x63A8,0x6C34,0x708A, +0x7761,0x7C8B,0x7FE0,0x8870,0x9042,0x9154,0x9310,0x9318, +0x968F,0x745E,0x9AC4,0x5D07,0x5D69,0x6570,0x67A2,0x8DA8, +0x96DB,0x636E,0x6749,0x6919,0x83C5,0x9817,0x96C0,0x88FE, +0x6F84,0x647A,0x5BF8,0x4E16,0x702C,0x755D,0x662F,0x51C4, +0x5236,0x52E2,0x59D3,0x5F81,0x6027,0x6210,0x653F,0x6574, +0x661F,0x6674,0x68F2,0x6816,0x6B63,0x6E05,0x7272,0x751F, +0x76DB,0x7CBE,0x8056,0x58F0,0x88FD,0x897F,0x8AA0,0x8A93, +0x8ACB,0x901D,0x9192,0x9752,0x9759,0x6589,0x7A0E,0x8106, +0x96BB,0x5E2D,0x60DC,0x621A,0x65A5,0x6614,0x6790,0x77F3, +0x7A4D,0x7C4D,0x7E3E,0x810A,0x8CAC,0x8D64,0x8DE1,0x8E5F, +0x78A9,0x5207,0x62D9,0x63A5,0x6442,0x6298,0x8A2D,0x7A83, +0x7BC0,0x8AAC,0x96EA,0x7D76,0x820C,0x8749,0x4ED9,0x5148, +0x5343,0x5360,0x5BA3,0x5C02,0x5C16,0x5DDD,0x6226,0x6247, +0x64B0,0x6813,0x6834,0x6CC9,0x6D45,0x6D17,0x67D3,0x6F5C, +0x714E,0x717D,0x65CB,0x7A7F,0x7BAD,0x7DDA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x7E4A,0x7FA8,0x817A,0x821B,0x8239,0x85A6,0x8A6E, +0x8CCE,0x8DF5,0x9078,0x9077,0x92AD,0x9291,0x9583,0x9BAE, +0x524D,0x5584,0x6F38,0x7136,0x5168,0x7985,0x7E55,0x81B3, +0x7CCE,0x564C,0x5851,0x5CA8,0x63AA,0x66FE,0x66FD,0x695A, +0x72D9,0x758F,0x758E,0x790E,0x7956,0x79DF,0x7C97,0x7D20, +0x7D44,0x8607,0x8A34,0x963B,0x9061,0x9F20,0x50E7,0x5275, +0x53CC,0x53E2,0x5009,0x55AA,0x58EE,0x594F,0x723D,0x5B8B, +0x5C64,0x531D,0x60E3,0x60F3,0x635C,0x6383,0x633F,0x63BB, + 0,0x64CD,0x65E9,0x66F9,0x5DE3,0x69CD,0x69FD,0x6F15, +0x71E5,0x4E89,0x75E9,0x76F8,0x7A93,0x7CDF,0x7DCF,0x7D9C, +0x8061,0x8349,0x8358,0x846C,0x84BC,0x85FB,0x88C5,0x8D70, +0x9001,0x906D,0x9397,0x971C,0x9A12,0x50CF,0x5897,0x618E, +0x81D3,0x8535,0x8D08,0x9020,0x4FC3,0x5074,0x5247,0x5373, +0x606F,0x6349,0x675F,0x6E2C,0x8DB3,0x901F,0x4FD7,0x5C5E, +0x8CCA,0x65CF,0x7D9A,0x5352,0x8896,0x5176,0x63C3,0x5B58, +0x5B6B,0x5C0A,0x640D,0x6751,0x905C,0x4ED6,0x591A,0x592A, +0x6C70,0x8A51,0x553E,0x5815,0x59A5,0x60F0,0x6253,0x67C1, +0x8235,0x6955,0x9640,0x99C4,0x9A28,0x4F53,0x5806,0x5BFE, +0x8010,0x5CB1,0x5E2F,0x5F85,0x6020,0x614B,0x6234,0x66FF, +0x6CF0,0x6EDE,0x80CE,0x817F,0x82D4,0x888B,0x8CB8,0x9000, +0x902E,0x968A,0x9EDB,0x9BDB,0x4EE3,0x53F0,0x5927,0x7B2C, +0x918D,0x984C,0x9DF9,0x6EDD,0x7027,0x5353,0x5544,0x5B85, +0x6258,0x629E,0x62D3,0x6CA2,0x6FEF,0x7422,0x8A17,0x9438, +0x6FC1,0x8AFE,0x8338,0x51E7,0x86F8,0x53EA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x53E9,0x4F46,0x9054,0x8FB0,0x596A,0x8131,0x5DFD, +0x7AEA,0x8FBF,0x68DA,0x8C37,0x72F8,0x9C48,0x6A3D,0x8AB0, +0x4E39,0x5358,0x5606,0x5766,0x62C5,0x63A2,0x65E6,0x6B4E, +0x6DE1,0x6E5B,0x70AD,0x77ED,0x7AEF,0x7BAA,0x7DBB,0x803D, +0x80C6,0x86CB,0x8A95,0x935B,0x56E3,0x58C7,0x5F3E,0x65AD, +0x6696,0x6A80,0x6BB5,0x7537,0x8AC7,0x5024,0x77E5,0x5730, +0x5F1B,0x6065,0x667A,0x6C60,0x75F4,0x7A1A,0x7F6E,0x81F4, +0x8718,0x9045,0x99B3,0x7BC9,0x755C,0x7AF9,0x7B51,0x84C4, + 0,0x9010,0x79E9,0x7A92,0x8336,0x5AE1,0x7740,0x4E2D, +0x4EF2,0x5B99,0x5FE0,0x62BD,0x663C,0x67F1,0x6CE8,0x866B, +0x8877,0x8A3B,0x914E,0x92F3,0x99D0,0x6A17,0x7026,0x732A, +0x82E7,0x8457,0x8CAF,0x4E01,0x5146,0x51CB,0x558B,0x5BF5, +0x5E16,0x5E33,0x5E81,0x5F14,0x5F35,0x5F6B,0x5FB4,0x61F2, +0x6311,0x66A2,0x671D,0x6F6E,0x7252,0x753A,0x773A,0x8074, +0x8139,0x8178,0x8776,0x8ABF,0x8ADC,0x8D85,0x8DF3,0x929A, +0x9577,0x9802,0x9CE5,0x52C5,0x6357,0x76F4,0x6715,0x6C88, +0x73CD,0x8CC3,0x93AE,0x9673,0x6D25,0x589C,0x690E,0x69CC, +0x8FFD,0x939A,0x75DB,0x901A,0x585A,0x6802,0x63B4,0x69FB, +0x4F43,0x6F2C,0x67D8,0x8FBB,0x8526,0x7DB4,0x9354,0x693F, +0x6F70,0x576A,0x58F7,0x5B2C,0x7D2C,0x722A,0x540A,0x91E3, +0x9DB4,0x4EAD,0x4F4E,0x505C,0x5075,0x5243,0x8C9E,0x5448, +0x5824,0x5B9A,0x5E1D,0x5E95,0x5EAD,0x5EF7,0x5F1F,0x608C, +0x62B5,0x633A,0x63D0,0x68AF,0x6C40,0x7887,0x798E,0x7A0B, +0x7DE0,0x8247,0x8A02,0x8AE6,0x8E44,0x9013, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x90B8,0x912D,0x91D8,0x9F0E,0x6CE5,0x6458,0x64E2, +0x6575,0x6EF4,0x7684,0x7B1B,0x9069,0x93D1,0x6EBA,0x54F2, +0x5FB9,0x64A4,0x8F4D,0x8FED,0x9244,0x5178,0x586B,0x5929, +0x5C55,0x5E97,0x6DFB,0x7E8F,0x751C,0x8CBC,0x8EE2,0x985B, +0x70B9,0x4F1D,0x6BBF,0x6FB1,0x7530,0x96FB,0x514E,0x5410, +0x5835,0x5857,0x59AC,0x5C60,0x5F92,0x6597,0x675C,0x6E21, +0x767B,0x83DF,0x8CED,0x9014,0x90FD,0x934D,0x7825,0x783A, +0x52AA,0x5EA6,0x571F,0x5974,0x6012,0x5012,0x515A,0x51AC, + 0,0x51CD,0x5200,0x5510,0x5854,0x5858,0x5957,0x5B95, +0x5CF6,0x5D8B,0x60BC,0x6295,0x642D,0x6771,0x6843,0x68BC, +0x68DF,0x76D7,0x6DD8,0x6E6F,0x6D9B,0x706F,0x71C8,0x5F53, +0x75D8,0x7977,0x7B49,0x7B54,0x7B52,0x7CD6,0x7D71,0x5230, +0x8463,0x8569,0x85E4,0x8A0E,0x8B04,0x8C46,0x8E0F,0x9003, +0x900F,0x9419,0x9676,0x982D,0x9A30,0x95D8,0x50CD,0x52D5, +0x540C,0x5802,0x5C0E,0x61A7,0x649E,0x6D1E,0x77B3,0x7AE5, +0x80F4,0x8404,0x9053,0x9285,0x5CE0,0x9D07,0x533F,0x5F97, +0x5FB3,0x6D9C,0x7279,0x7763,0x79BF,0x7BE4,0x6BD2,0x72EC, +0x8AAD,0x6803,0x6A61,0x51F8,0x7A81,0x6934,0x5C4A,0x9CF6, +0x82EB,0x5BC5,0x9149,0x701E,0x5678,0x5C6F,0x60C7,0x6566, +0x6C8C,0x8C5A,0x9041,0x9813,0x5451,0x66C7,0x920D,0x5948, +0x90A3,0x5185,0x4E4D,0x51EA,0x8599,0x8B0E,0x7058,0x637A, +0x934B,0x6962,0x99B4,0x7E04,0x7577,0x5357,0x6960,0x8EDF, +0x96E3,0x6C5D,0x4E8C,0x5C3C,0x5F10,0x8FE9,0x5302,0x8CD1, +0x8089,0x8679,0x5EFF,0x65E5,0x4E73,0x5165, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5982,0x5C3F,0x97EE,0x4EFB,0x598A,0x5FCD,0x8A8D, +0x6FE1,0x79B0,0x7962,0x5BE7,0x8471,0x732B,0x71B1,0x5E74, +0x5FF5,0x637B,0x649A,0x71C3,0x7C98,0x4E43,0x5EFC,0x4E4B, +0x57DC,0x56A2,0x60A9,0x6FC3,0x7D0D,0x80FD,0x8133,0x81BF, +0x8FB2,0x8997,0x86A4,0x5DF4,0x628A,0x64AD,0x8987,0x6777, +0x6CE2,0x6D3E,0x7436,0x7834,0x5A46,0x7F75,0x82AD,0x99AC, +0x4FF3,0x5EC3,0x62DD,0x6392,0x6557,0x676F,0x76C3,0x724C, +0x80CC,0x80BA,0x8F29,0x914D,0x500D,0x57F9,0x5A92,0x6885, + 0,0x6973,0x7164,0x72FD,0x8CB7,0x58F2,0x8CE0,0x966A, +0x9019,0x877F,0x79E4,0x77E7,0x8429,0x4F2F,0x5265,0x535A, +0x62CD,0x67CF,0x6CCA,0x767D,0x7B94,0x7C95,0x8236,0x8584, +0x8FEB,0x66DD,0x6F20,0x7206,0x7E1B,0x83AB,0x99C1,0x9EA6, +0x51FD,0x7BB1,0x7872,0x7BB8,0x8087,0x7B48,0x6AE8,0x5E61, +0x808C,0x7551,0x7560,0x516B,0x9262,0x6E8C,0x767A,0x9197, +0x9AEA,0x4F10,0x7F70,0x629C,0x7B4F,0x95A5,0x9CE9,0x567A, +0x5859,0x86E4,0x96BC,0x4F34,0x5224,0x534A,0x53CD,0x53DB, +0x5E06,0x642C,0x6591,0x677F,0x6C3E,0x6C4E,0x7248,0x72AF, +0x73ED,0x7554,0x7E41,0x822C,0x85E9,0x8CA9,0x7BC4,0x91C6, +0x7169,0x9812,0x98EF,0x633D,0x6669,0x756A,0x76E4,0x78D0, +0x8543,0x86EE,0x532A,0x5351,0x5426,0x5983,0x5E87,0x5F7C, +0x60B2,0x6249,0x6279,0x62AB,0x6590,0x6BD4,0x6CCC,0x75B2, +0x76AE,0x7891,0x79D8,0x7DCB,0x7F77,0x80A5,0x88AB,0x8AB9, +0x8CBB,0x907F,0x975E,0x98DB,0x6A0B,0x7C38,0x5099,0x5C3E, +0x5FAE,0x6787,0x6BD8,0x7435,0x7709,0x7F8E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9F3B,0x67CA,0x7A17,0x5339,0x758B,0x9AED,0x5F66, +0x819D,0x83F1,0x8098,0x5F3C,0x5FC5,0x7562,0x7B46,0x903C, +0x6867,0x59EB,0x5A9B,0x7D10,0x767E,0x8B2C,0x4FF5,0x5F6A, +0x6A19,0x6C37,0x6F02,0x74E2,0x7968,0x8868,0x8A55,0x8C79, +0x5EDF,0x63CF,0x75C5,0x79D2,0x82D7,0x9328,0x92F2,0x849C, +0x86ED,0x9C2D,0x54C1,0x5F6C,0x658C,0x6D5C,0x7015,0x8CA7, +0x8CD3,0x983B,0x654F,0x74F6,0x4E0D,0x4ED8,0x57E0,0x592B, +0x5A66,0x5BCC,0x51A8,0x5E03,0x5E9C,0x6016,0x6276,0x6577, + 0,0x65A7,0x666E,0x6D6E,0x7236,0x7B26,0x8150,0x819A, +0x8299,0x8B5C,0x8CA0,0x8CE6,0x8D74,0x961C,0x9644,0x4FAE, +0x64AB,0x6B66,0x821E,0x8461,0x856A,0x90E8,0x5C01,0x6953, +0x98A8,0x847A,0x8557,0x4F0F,0x526F,0x5FA9,0x5E45,0x670D, +0x798F,0x8179,0x8907,0x8986,0x6DF5,0x5F17,0x6255,0x6CB8, +0x4ECF,0x7269,0x9B92,0x5206,0x543B,0x5674,0x58B3,0x61A4, +0x626E,0x711A,0x596E,0x7C89,0x7CDE,0x7D1B,0x96F0,0x6587, +0x805E,0x4E19,0x4F75,0x5175,0x5840,0x5E63,0x5E73,0x5F0A, +0x67C4,0x4E26,0x853D,0x9589,0x965B,0x7C73,0x9801,0x50FB, +0x58C1,0x7656,0x78A7,0x5225,0x77A5,0x8511,0x7B86,0x504F, +0x5909,0x7247,0x7BC7,0x7DE8,0x8FBA,0x8FD4,0x904D,0x4FBF, +0x52C9,0x5A29,0x5F01,0x97AD,0x4FDD,0x8217,0x92EA,0x5703, +0x6355,0x6B69,0x752B,0x88DC,0x8F14,0x7A42,0x52DF,0x5893, +0x6155,0x620A,0x66AE,0x6BCD,0x7C3F,0x83E9,0x5023,0x4FF8, +0x5305,0x5446,0x5831,0x5949,0x5B9D,0x5CF0,0x5CEF,0x5D29, +0x5E96,0x62B1,0x6367,0x653E,0x65B9,0x670B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6CD5,0x6CE1,0x70F9,0x7832,0x7E2B,0x80DE,0x82B3, +0x840C,0x84EC,0x8702,0x8912,0x8A2A,0x8C4A,0x90A6,0x92D2, +0x98FD,0x9CF3,0x9D6C,0x4E4F,0x4EA1,0x508D,0x5256,0x574A, +0x59A8,0x5E3D,0x5FD8,0x5FD9,0x623F,0x66B4,0x671B,0x67D0, +0x68D2,0x5192,0x7D21,0x80AA,0x81A8,0x8B00,0x8C8C,0x8CBF, +0x927E,0x9632,0x5420,0x982C,0x5317,0x50D5,0x535C,0x58A8, +0x64B2,0x6734,0x7267,0x7766,0x7A46,0x91E6,0x52C3,0x6CA1, +0x6B86,0x5800,0x5E4C,0x5954,0x672C,0x7FFB,0x51E1,0x76C6, + 0,0x6469,0x78E8,0x9B54,0x9EBB,0x57CB,0x59B9,0x6627, +0x679A,0x6BCE,0x54E9,0x69D9,0x5E55,0x819C,0x6795,0x9BAA, +0x67FE,0x9C52,0x685D,0x4EA6,0x4FE3,0x53C8,0x62B9,0x672B, +0x6CAB,0x8FC4,0x4FAD,0x7E6D,0x9EBF,0x4E07,0x6162,0x6E80, +0x6F2B,0x8513,0x5473,0x672A,0x9B45,0x5DF3,0x7B95,0x5CAC, +0x5BC6,0x871C,0x6E4A,0x84D1,0x7A14,0x8108,0x5999,0x7C8D, +0x6C11,0x7720,0x52D9,0x5922,0x7121,0x725F,0x77DB,0x9727, +0x9D61,0x690B,0x5A7F,0x5A18,0x51A5,0x540D,0x547D,0x660E, +0x76DF,0x8FF7,0x9298,0x9CF4,0x59EA,0x725D,0x6EC5,0x514D, +0x68C9,0x7DBF,0x7DEC,0x9762,0x9EBA,0x6478,0x6A21,0x8302, +0x5984,0x5B5F,0x6BDB,0x731B,0x76F2,0x7DB2,0x8017,0x8499, +0x5132,0x6728,0x9ED9,0x76EE,0x6762,0x52FF,0x9905,0x5C24, +0x623B,0x7C7E,0x8CB0,0x554F,0x60B6,0x7D0B,0x9580,0x5301, +0x4E5F,0x51B6,0x591C,0x723A,0x8036,0x91CE,0x5F25,0x77E2, +0x5384,0x5F79,0x7D04,0x85AC,0x8A33,0x8E8D,0x9756,0x67F3, +0x85AE,0x9453,0x6109,0x6108,0x6CB9,0x7652, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AED,0x8F38,0x552F,0x4F51,0x512A,0x52C7,0x53CB, +0x5BA5,0x5E7D,0x60A0,0x6182,0x63D6,0x6709,0x67DA,0x6E67, +0x6D8C,0x7336,0x7337,0x7531,0x7950,0x88D5,0x8A98,0x904A, +0x9091,0x90F5,0x96C4,0x878D,0x5915,0x4E88,0x4F59,0x4E0E, +0x8A89,0x8F3F,0x9810,0x50AD,0x5E7C,0x5996,0x5BB9,0x5EB8, +0x63DA,0x63FA,0x64C1,0x66DC,0x694A,0x69D8,0x6D0B,0x6EB6, +0x7194,0x7528,0x7AAF,0x7F8A,0x8000,0x8449,0x84C9,0x8981, +0x8B21,0x8E0A,0x9065,0x967D,0x990A,0x617E,0x6291,0x6B32, + 0,0x6C83,0x6D74,0x7FCC,0x7FFC,0x6DC0,0x7F85,0x87BA, +0x88F8,0x6765,0x83B1,0x983C,0x96F7,0x6D1B,0x7D61,0x843D, +0x916A,0x4E71,0x5375,0x5D50,0x6B04,0x6FEB,0x85CD,0x862D, +0x89A7,0x5229,0x540F,0x5C65,0x674E,0x68A8,0x7406,0x7483, +0x75E2,0x88CF,0x88E1,0x91CC,0x96E2,0x9678,0x5F8B,0x7387, +0x7ACB,0x844E,0x63A0,0x7565,0x5289,0x6D41,0x6E9C,0x7409, +0x7559,0x786B,0x7C92,0x9686,0x7ADC,0x9F8D,0x4FB6,0x616E, +0x65C5,0x865C,0x4E86,0x4EAE,0x50DA,0x4E21,0x51CC,0x5BEE, +0x6599,0x6881,0x6DBC,0x731F,0x7642,0x77AD,0x7A1C,0x7CE7, +0x826F,0x8AD2,0x907C,0x91CF,0x9675,0x9818,0x529B,0x7DD1, +0x502B,0x5398,0x6797,0x6DCB,0x71D0,0x7433,0x81E8,0x8F2A, +0x96A3,0x9C57,0x9E9F,0x7460,0x5841,0x6D99,0x7D2F,0x985E, +0x4EE4,0x4F36,0x4F8B,0x51B7,0x52B1,0x5DBA,0x601C,0x73B2, +0x793C,0x82D3,0x9234,0x96B7,0x96F6,0x970A,0x9E97,0x9F62, +0x66A6,0x6B74,0x5217,0x52A3,0x70C8,0x88C2,0x5EC9,0x604B, +0x6190,0x6F23,0x7149,0x7C3E,0x7DF4,0x806F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x84EE,0x9023,0x932C,0x5442,0x9B6F,0x6AD3,0x7089, +0x8CC2,0x8DEF,0x9732,0x52B4,0x5A41,0x5ECA,0x5F04,0x6717, +0x697C,0x6994,0x6D6A,0x6F0F,0x7262,0x72FC,0x7BED,0x8001, +0x807E,0x874B,0x90CE,0x516D,0x9E93,0x7984,0x808B,0x9332, +0x8AD6,0x502D,0x548C,0x8A71,0x6B6A,0x8CC4,0x8107,0x60D1, +0x67A0,0x9DF2,0x4E99,0x4E98,0x9C10,0x8A6B,0x85C1,0x8568, +0x6900,0x6E7E,0x7897,0x8155, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F0C,0x4E10,0x4E15,0x4E2A,0x4E31,0x4E36,0x4E3C,0x4E3F, +0x4E42,0x4E56,0x4E58,0x4E82,0x4E85,0x8C6B,0x4E8A,0x8212, +0x5F0D,0x4E8E,0x4E9E,0x4E9F,0x4EA0,0x4EA2,0x4EB0,0x4EB3, +0x4EB6,0x4ECE,0x4ECD,0x4EC4,0x4EC6,0x4EC2,0x4ED7,0x4EDE, +0x4EED,0x4EDF,0x4EF7,0x4F09,0x4F5A,0x4F30,0x4F5B,0x4F5D, +0x4F57,0x4F47,0x4F76,0x4F88,0x4F8F,0x4F98,0x4F7B,0x4F69, +0x4F70,0x4F91,0x4F6F,0x4F86,0x4F96,0x5118,0x4FD4,0x4FDF, +0x4FCE,0x4FD8,0x4FDB,0x4FD1,0x4FDA,0x4FD0,0x4FE4,0x4FE5, +0x501A,0x5028,0x5014,0x502A,0x5025,0x5005,0x4F1C,0x4FF6, +0x5021,0x5029,0x502C,0x4FFE,0x4FEF,0x5011,0x5006,0x5043, +0x5047,0x6703,0x5055,0x5050,0x5048,0x505A,0x5056,0x506C, +0x5078,0x5080,0x509A,0x5085,0x50B4,0x50B2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x50C9,0x50CA,0x50B3,0x50C2,0x50D6,0x50DE,0x50E5, +0x50ED,0x50E3,0x50EE,0x50F9,0x50F5,0x5109,0x5101,0x5102, +0x5116,0x5115,0x5114,0x511A,0x5121,0x513A,0x5137,0x513C, +0x513B,0x513F,0x5140,0x5152,0x514C,0x5154,0x5162,0x7AF8, +0x5169,0x516A,0x516E,0x5180,0x5182,0x56D8,0x518C,0x5189, +0x518F,0x5191,0x5193,0x5195,0x5196,0x51A4,0x51A6,0x51A2, +0x51A9,0x51AA,0x51AB,0x51B3,0x51B1,0x51B2,0x51B0,0x51B5, +0x51BD,0x51C5,0x51C9,0x51DB,0x51E0,0x8655,0x51E9,0x51ED, + 0,0x51F0,0x51F5,0x51FE,0x5204,0x520B,0x5214,0x520E, +0x5227,0x522A,0x522E,0x5233,0x5239,0x524F,0x5244,0x524B, +0x524C,0x525E,0x5254,0x526A,0x5274,0x5269,0x5273,0x527F, +0x527D,0x528D,0x5294,0x5292,0x5271,0x5288,0x5291,0x8FA8, +0x8FA7,0x52AC,0x52AD,0x52BC,0x52B5,0x52C1,0x52CD,0x52D7, +0x52DE,0x52E3,0x52E6,0x98ED,0x52E0,0x52F3,0x52F5,0x52F8, +0x52F9,0x5306,0x5308,0x7538,0x530D,0x5310,0x530F,0x5315, +0x531A,0x5323,0x532F,0x5331,0x5333,0x5338,0x5340,0x5346, +0x5345,0x4E17,0x5349,0x534D,0x51D6,0x535E,0x5369,0x536E, +0x5918,0x537B,0x5377,0x5382,0x5396,0x53A0,0x53A6,0x53A5, +0x53AE,0x53B0,0x53B6,0x53C3,0x7C12,0x96D9,0x53DF,0x66FC, +0x71EE,0x53EE,0x53E8,0x53ED,0x53FA,0x5401,0x543D,0x5440, +0x542C,0x542D,0x543C,0x542E,0x5436,0x5429,0x541D,0x544E, +0x548F,0x5475,0x548E,0x545F,0x5471,0x5477,0x5470,0x5492, +0x547B,0x5480,0x5476,0x5484,0x5490,0x5486,0x54C7,0x54A2, +0x54B8,0x54A5,0x54AC,0x54C4,0x54C8,0x54A8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x54AB,0x54C2,0x54A4,0x54BE,0x54BC,0x54D8,0x54E5, +0x54E6,0x550F,0x5514,0x54FD,0x54EE,0x54ED,0x54FA,0x54E2, +0x5539,0x5540,0x5563,0x554C,0x552E,0x555C,0x5545,0x5556, +0x5557,0x5538,0x5533,0x555D,0x5599,0x5580,0x54AF,0x558A, +0x559F,0x557B,0x557E,0x5598,0x559E,0x55AE,0x557C,0x5583, +0x55A9,0x5587,0x55A8,0x55DA,0x55C5,0x55DF,0x55C4,0x55DC, +0x55E4,0x55D4,0x5614,0x55F7,0x5616,0x55FE,0x55FD,0x561B, +0x55F9,0x564E,0x5650,0x71DF,0x5634,0x5636,0x5632,0x5638, + 0,0x566B,0x5664,0x562F,0x566C,0x566A,0x5686,0x5680, +0x568A,0x56A0,0x5694,0x568F,0x56A5,0x56AE,0x56B6,0x56B4, +0x56C2,0x56BC,0x56C1,0x56C3,0x56C0,0x56C8,0x56CE,0x56D1, +0x56D3,0x56D7,0x56EE,0x56F9,0x5700,0x56FF,0x5704,0x5709, +0x5708,0x570B,0x570D,0x5713,0x5718,0x5716,0x55C7,0x571C, +0x5726,0x5737,0x5738,0x574E,0x573B,0x5740,0x574F,0x5769, +0x57C0,0x5788,0x5761,0x577F,0x5789,0x5793,0x57A0,0x57B3, +0x57A4,0x57AA,0x57B0,0x57C3,0x57C6,0x57D4,0x57D2,0x57D3, +0x580A,0x57D6,0x57E3,0x580B,0x5819,0x581D,0x5872,0x5821, +0x5862,0x584B,0x5870,0x6BC0,0x5852,0x583D,0x5879,0x5885, +0x58B9,0x589F,0x58AB,0x58BA,0x58DE,0x58BB,0x58B8,0x58AE, +0x58C5,0x58D3,0x58D1,0x58D7,0x58D9,0x58D8,0x58E5,0x58DC, +0x58E4,0x58DF,0x58EF,0x58FA,0x58F9,0x58FB,0x58FC,0x58FD, +0x5902,0x590A,0x5910,0x591B,0x68A6,0x5925,0x592C,0x592D, +0x5932,0x5938,0x593E,0x7AD2,0x5955,0x5950,0x594E,0x595A, +0x5958,0x5962,0x5960,0x5967,0x596C,0x5969, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5978,0x5981,0x599D,0x4F5E,0x4FAB,0x59A3,0x59B2, +0x59C6,0x59E8,0x59DC,0x598D,0x59D9,0x59DA,0x5A25,0x5A1F, +0x5A11,0x5A1C,0x5A09,0x5A1A,0x5A40,0x5A6C,0x5A49,0x5A35, +0x5A36,0x5A62,0x5A6A,0x5A9A,0x5ABC,0x5ABE,0x5ACB,0x5AC2, +0x5ABD,0x5AE3,0x5AD7,0x5AE6,0x5AE9,0x5AD6,0x5AFA,0x5AFB, +0x5B0C,0x5B0B,0x5B16,0x5B32,0x5AD0,0x5B2A,0x5B36,0x5B3E, +0x5B43,0x5B45,0x5B40,0x5B51,0x5B55,0x5B5A,0x5B5B,0x5B65, +0x5B69,0x5B70,0x5B73,0x5B75,0x5B78,0x6588,0x5B7A,0x5B80, + 0,0x5B83,0x5BA6,0x5BB8,0x5BC3,0x5BC7,0x5BC9,0x5BD4, +0x5BD0,0x5BE4,0x5BE6,0x5BE2,0x5BDE,0x5BE5,0x5BEB,0x5BF0, +0x5BF6,0x5BF3,0x5C05,0x5C07,0x5C08,0x5C0D,0x5C13,0x5C20, +0x5C22,0x5C28,0x5C38,0x5C39,0x5C41,0x5C46,0x5C4E,0x5C53, +0x5C50,0x5C4F,0x5B71,0x5C6C,0x5C6E,0x4E62,0x5C76,0x5C79, +0x5C8C,0x5C91,0x5C94,0x599B,0x5CAB,0x5CBB,0x5CB6,0x5CBC, +0x5CB7,0x5CC5,0x5CBE,0x5CC7,0x5CD9,0x5CE9,0x5CFD,0x5CFA, +0x5CED,0x5D8C,0x5CEA,0x5D0B,0x5D15,0x5D17,0x5D5C,0x5D1F, +0x5D1B,0x5D11,0x5D14,0x5D22,0x5D1A,0x5D19,0x5D18,0x5D4C, +0x5D52,0x5D4E,0x5D4B,0x5D6C,0x5D73,0x5D76,0x5D87,0x5D84, +0x5D82,0x5DA2,0x5D9D,0x5DAC,0x5DAE,0x5DBD,0x5D90,0x5DB7, +0x5DBC,0x5DC9,0x5DCD,0x5DD3,0x5DD2,0x5DD6,0x5DDB,0x5DEB, +0x5DF2,0x5DF5,0x5E0B,0x5E1A,0x5E19,0x5E11,0x5E1B,0x5E36, +0x5E37,0x5E44,0x5E43,0x5E40,0x5E4E,0x5E57,0x5E54,0x5E5F, +0x5E62,0x5E64,0x5E47,0x5E75,0x5E76,0x5E7A,0x9EBC,0x5E7F, +0x5EA0,0x5EC1,0x5EC2,0x5EC8,0x5ED0,0x5ECF, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5ED6,0x5EE3,0x5EDD,0x5EDA,0x5EDB,0x5EE2,0x5EE1, +0x5EE8,0x5EE9,0x5EEC,0x5EF1,0x5EF3,0x5EF0,0x5EF4,0x5EF8, +0x5EFE,0x5F03,0x5F09,0x5F5D,0x5F5C,0x5F0B,0x5F11,0x5F16, +0x5F29,0x5F2D,0x5F38,0x5F41,0x5F48,0x5F4C,0x5F4E,0x5F2F, +0x5F51,0x5F56,0x5F57,0x5F59,0x5F61,0x5F6D,0x5F73,0x5F77, +0x5F83,0x5F82,0x5F7F,0x5F8A,0x5F88,0x5F91,0x5F87,0x5F9E, +0x5F99,0x5F98,0x5FA0,0x5FA8,0x5FAD,0x5FBC,0x5FD6,0x5FFB, +0x5FE4,0x5FF8,0x5FF1,0x5FDD,0x60B3,0x5FFF,0x6021,0x6060, + 0,0x6019,0x6010,0x6029,0x600E,0x6031,0x601B,0x6015, +0x602B,0x6026,0x600F,0x603A,0x605A,0x6041,0x606A,0x6077, +0x605F,0x604A,0x6046,0x604D,0x6063,0x6043,0x6064,0x6042, +0x606C,0x606B,0x6059,0x6081,0x608D,0x60E7,0x6083,0x609A, +0x6084,0x609B,0x6096,0x6097,0x6092,0x60A7,0x608B,0x60E1, +0x60B8,0x60E0,0x60D3,0x60B4,0x5FF0,0x60BD,0x60C6,0x60B5, +0x60D8,0x614D,0x6115,0x6106,0x60F6,0x60F7,0x6100,0x60F4, +0x60FA,0x6103,0x6121,0x60FB,0x60F1,0x610D,0x610E,0x6147, +0x613E,0x6128,0x6127,0x614A,0x613F,0x613C,0x612C,0x6134, +0x613D,0x6142,0x6144,0x6173,0x6177,0x6158,0x6159,0x615A, +0x616B,0x6174,0x616F,0x6165,0x6171,0x615F,0x615D,0x6153, +0x6175,0x6199,0x6196,0x6187,0x61AC,0x6194,0x619A,0x618A, +0x6191,0x61AB,0x61AE,0x61CC,0x61CA,0x61C9,0x61F7,0x61C8, +0x61C3,0x61C6,0x61BA,0x61CB,0x7F79,0x61CD,0x61E6,0x61E3, +0x61F6,0x61FA,0x61F4,0x61FF,0x61FD,0x61FC,0x61FE,0x6200, +0x6208,0x6209,0x620D,0x620C,0x6214,0x621B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x621E,0x6221,0x622A,0x622E,0x6230,0x6232,0x6233, +0x6241,0x624E,0x625E,0x6263,0x625B,0x6260,0x6268,0x627C, +0x6282,0x6289,0x627E,0x6292,0x6293,0x6296,0x62D4,0x6283, +0x6294,0x62D7,0x62D1,0x62BB,0x62CF,0x62FF,0x62C6,0x64D4, +0x62C8,0x62DC,0x62CC,0x62CA,0x62C2,0x62C7,0x629B,0x62C9, +0x630C,0x62EE,0x62F1,0x6327,0x6302,0x6308,0x62EF,0x62F5, +0x6350,0x633E,0x634D,0x641C,0x634F,0x6396,0x638E,0x6380, +0x63AB,0x6376,0x63A3,0x638F,0x6389,0x639F,0x63B5,0x636B, + 0,0x6369,0x63BE,0x63E9,0x63C0,0x63C6,0x63E3,0x63C9, +0x63D2,0x63F6,0x63C4,0x6416,0x6434,0x6406,0x6413,0x6426, +0x6436,0x651D,0x6417,0x6428,0x640F,0x6467,0x646F,0x6476, +0x644E,0x652A,0x6495,0x6493,0x64A5,0x64A9,0x6488,0x64BC, +0x64DA,0x64D2,0x64C5,0x64C7,0x64BB,0x64D8,0x64C2,0x64F1, +0x64E7,0x8209,0x64E0,0x64E1,0x62AC,0x64E3,0x64EF,0x652C, +0x64F6,0x64F4,0x64F2,0x64FA,0x6500,0x64FD,0x6518,0x651C, +0x6505,0x6524,0x6523,0x652B,0x6534,0x6535,0x6537,0x6536, +0x6538,0x754B,0x6548,0x6556,0x6555,0x654D,0x6558,0x655E, +0x655D,0x6572,0x6578,0x6582,0x6583,0x8B8A,0x659B,0x659F, +0x65AB,0x65B7,0x65C3,0x65C6,0x65C1,0x65C4,0x65CC,0x65D2, +0x65DB,0x65D9,0x65E0,0x65E1,0x65F1,0x6772,0x660A,0x6603, +0x65FB,0x6773,0x6635,0x6636,0x6634,0x661C,0x664F,0x6644, +0x6649,0x6641,0x665E,0x665D,0x6664,0x6667,0x6668,0x665F, +0x6662,0x6670,0x6683,0x6688,0x668E,0x6689,0x6684,0x6698, +0x669D,0x66C1,0x66B9,0x66C9,0x66BE,0x66BC, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x66C4,0x66B8,0x66D6,0x66DA,0x66E0,0x663F,0x66E6, +0x66E9,0x66F0,0x66F5,0x66F7,0x670F,0x6716,0x671E,0x6726, +0x6727,0x9738,0x672E,0x673F,0x6736,0x6741,0x6738,0x6737, +0x6746,0x675E,0x6760,0x6759,0x6763,0x6764,0x6789,0x6770, +0x67A9,0x677C,0x676A,0x678C,0x678B,0x67A6,0x67A1,0x6785, +0x67B7,0x67EF,0x67B4,0x67EC,0x67B3,0x67E9,0x67B8,0x67E4, +0x67DE,0x67DD,0x67E2,0x67EE,0x67B9,0x67CE,0x67C6,0x67E7, +0x6A9C,0x681E,0x6846,0x6829,0x6840,0x684D,0x6832,0x684E, + 0,0x68B3,0x682B,0x6859,0x6863,0x6877,0x687F,0x689F, +0x688F,0x68AD,0x6894,0x689D,0x689B,0x6883,0x6AAE,0x68B9, +0x6874,0x68B5,0x68A0,0x68BA,0x690F,0x688D,0x687E,0x6901, +0x68CA,0x6908,0x68D8,0x6922,0x6926,0x68E1,0x690C,0x68CD, +0x68D4,0x68E7,0x68D5,0x6936,0x6912,0x6904,0x68D7,0x68E3, +0x6925,0x68F9,0x68E0,0x68EF,0x6928,0x692A,0x691A,0x6923, +0x6921,0x68C6,0x6979,0x6977,0x695C,0x6978,0x696B,0x6954, +0x697E,0x696E,0x6939,0x6974,0x693D,0x6959,0x6930,0x6961, +0x695E,0x695D,0x6981,0x696A,0x69B2,0x69AE,0x69D0,0x69BF, +0x69C1,0x69D3,0x69BE,0x69CE,0x5BE8,0x69CA,0x69DD,0x69BB, +0x69C3,0x69A7,0x6A2E,0x6991,0x69A0,0x699C,0x6995,0x69B4, +0x69DE,0x69E8,0x6A02,0x6A1B,0x69FF,0x6B0A,0x69F9,0x69F2, +0x69E7,0x6A05,0x69B1,0x6A1E,0x69ED,0x6A14,0x69EB,0x6A0A, +0x6A12,0x6AC1,0x6A23,0x6A13,0x6A44,0x6A0C,0x6A72,0x6A36, +0x6A78,0x6A47,0x6A62,0x6A59,0x6A66,0x6A48,0x6A38,0x6A22, +0x6A90,0x6A8D,0x6AA0,0x6A84,0x6AA2,0x6AA3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6A97,0x8617,0x6ABB,0x6AC3,0x6AC2,0x6AB8,0x6AB3, +0x6AAC,0x6ADE,0x6AD1,0x6ADF,0x6AAA,0x6ADA,0x6AEA,0x6AFB, +0x6B05,0x8616,0x6AFA,0x6B12,0x6B16,0x9B31,0x6B1F,0x6B38, +0x6B37,0x76DC,0x6B39,0x98EE,0x6B47,0x6B43,0x6B49,0x6B50, +0x6B59,0x6B54,0x6B5B,0x6B5F,0x6B61,0x6B78,0x6B79,0x6B7F, +0x6B80,0x6B84,0x6B83,0x6B8D,0x6B98,0x6B95,0x6B9E,0x6BA4, +0x6BAA,0x6BAB,0x6BAF,0x6BB2,0x6BB1,0x6BB3,0x6BB7,0x6BBC, +0x6BC6,0x6BCB,0x6BD3,0x6BDF,0x6BEC,0x6BEB,0x6BF3,0x6BEF, + 0,0x9EBE,0x6C08,0x6C13,0x6C14,0x6C1B,0x6C24,0x6C23, +0x6C5E,0x6C55,0x6C62,0x6C6A,0x6C82,0x6C8D,0x6C9A,0x6C81, +0x6C9B,0x6C7E,0x6C68,0x6C73,0x6C92,0x6C90,0x6CC4,0x6CF1, +0x6CD3,0x6CBD,0x6CD7,0x6CC5,0x6CDD,0x6CAE,0x6CB1,0x6CBE, +0x6CBA,0x6CDB,0x6CEF,0x6CD9,0x6CEA,0x6D1F,0x884D,0x6D36, +0x6D2B,0x6D3D,0x6D38,0x6D19,0x6D35,0x6D33,0x6D12,0x6D0C, +0x6D63,0x6D93,0x6D64,0x6D5A,0x6D79,0x6D59,0x6D8E,0x6D95, +0x6FE4,0x6D85,0x6DF9,0x6E15,0x6E0A,0x6DB5,0x6DC7,0x6DE6, +0x6DB8,0x6DC6,0x6DEC,0x6DDE,0x6DCC,0x6DE8,0x6DD2,0x6DC5, +0x6DFA,0x6DD9,0x6DE4,0x6DD5,0x6DEA,0x6DEE,0x6E2D,0x6E6E, +0x6E2E,0x6E19,0x6E72,0x6E5F,0x6E3E,0x6E23,0x6E6B,0x6E2B, +0x6E76,0x6E4D,0x6E1F,0x6E43,0x6E3A,0x6E4E,0x6E24,0x6EFF, +0x6E1D,0x6E38,0x6E82,0x6EAA,0x6E98,0x6EC9,0x6EB7,0x6ED3, +0x6EBD,0x6EAF,0x6EC4,0x6EB2,0x6ED4,0x6ED5,0x6E8F,0x6EA5, +0x6EC2,0x6E9F,0x6F41,0x6F11,0x704C,0x6EEC,0x6EF8,0x6EFE, +0x6F3F,0x6EF2,0x6F31,0x6EEF,0x6F32,0x6ECC}; + +/* page 3 0xE040-0xEAA4 */ +static uint16 tab_sjis_uni3[]={ +0x6F3E,0x6F13,0x6EF7,0x6F86,0x6F7A,0x6F78,0x6F81,0x6F80, +0x6F6F,0x6F5B,0x6FF3,0x6F6D,0x6F82,0x6F7C,0x6F58,0x6F8E, +0x6F91,0x6FC2,0x6F66,0x6FB3,0x6FA3,0x6FA1,0x6FA4,0x6FB9, +0x6FC6,0x6FAA,0x6FDF,0x6FD5,0x6FEC,0x6FD4,0x6FD8,0x6FF1, +0x6FEE,0x6FDB,0x7009,0x700B,0x6FFA,0x7011,0x7001,0x700F, +0x6FFE,0x701B,0x701A,0x6F74,0x701D,0x7018,0x701F,0x7030, +0x703E,0x7032,0x7051,0x7063,0x7099,0x7092,0x70AF,0x70F1, +0x70AC,0x70B8,0x70B3,0x70AE,0x70DF,0x70CB,0x70DD, 0, +0x70D9,0x7109,0x70FD,0x711C,0x7119,0x7165,0x7155,0x7188, +0x7166,0x7162,0x714C,0x7156,0x716C,0x718F,0x71FB,0x7184, +0x7195,0x71A8,0x71AC,0x71D7,0x71B9,0x71BE,0x71D2,0x71C9, +0x71D4,0x71CE,0x71E0,0x71EC,0x71E7,0x71F5,0x71FC,0x71F9, +0x71FF,0x720D,0x7210,0x721B,0x7228,0x722D,0x722C,0x7230, +0x7232,0x723B,0x723C,0x723F,0x7240,0x7246,0x724B,0x7258, +0x7274,0x727E,0x7282,0x7281,0x7287,0x7292,0x7296,0x72A2, +0x72A7,0x72B9,0x72B2,0x72C3,0x72C6,0x72C4,0x72CE,0x72D2, +0x72E2,0x72E0,0x72E1,0x72F9,0x72F7,0x500F,0x7317,0x730A, +0x731C,0x7316,0x731D,0x7334,0x732F,0x7329,0x7325,0x733E, +0x734E,0x734F,0x9ED8,0x7357,0x736A,0x7368,0x7370,0x7378, +0x7375,0x737B,0x737A,0x73C8,0x73B3,0x73CE,0x73BB,0x73C0, +0x73E5,0x73EE,0x73DE,0x74A2,0x7405,0x746F,0x7425,0x73F8, +0x7432,0x743A,0x7455,0x743F,0x745F,0x7459,0x7441,0x745C, +0x7469,0x7470,0x7463,0x746A,0x7476,0x747E,0x748B,0x749E, +0x74A7,0x74CA,0x74CF,0x74D4,0x73F1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x74E0,0x74E3,0x74E7,0x74E9,0x74EE,0x74F2,0x74F0,0x74F1, +0x74F8,0x74F7,0x7504,0x7503,0x7505,0x750C,0x750E,0x750D, +0x7515,0x7513,0x751E,0x7526,0x752C,0x753C,0x7544,0x754D, +0x754A,0x7549,0x755B,0x7546,0x755A,0x7569,0x7564,0x7567, +0x756B,0x756D,0x7578,0x7576,0x7586,0x7587,0x7574,0x758A, +0x7589,0x7582,0x7594,0x759A,0x759D,0x75A5,0x75A3,0x75C2, +0x75B3,0x75C3,0x75B5,0x75BD,0x75B8,0x75BC,0x75B1,0x75CD, +0x75CA,0x75D2,0x75D9,0x75E3,0x75DE,0x75FE,0x75FF, 0, +0x75FC,0x7601,0x75F0,0x75FA,0x75F2,0x75F3,0x760B,0x760D, +0x7609,0x761F,0x7627,0x7620,0x7621,0x7622,0x7624,0x7634, +0x7630,0x763B,0x7647,0x7648,0x7646,0x765C,0x7658,0x7661, +0x7662,0x7668,0x7669,0x766A,0x7667,0x766C,0x7670,0x7672, +0x7676,0x7678,0x767C,0x7680,0x7683,0x7688,0x768B,0x768E, +0x7696,0x7693,0x7699,0x769A,0x76B0,0x76B4,0x76B8,0x76B9, +0x76BA,0x76C2,0x76CD,0x76D6,0x76D2,0x76DE,0x76E1,0x76E5, +0x76E7,0x76EA,0x862F,0x76FB,0x7708,0x7707,0x7704,0x7729, +0x7724,0x771E,0x7725,0x7726,0x771B,0x7737,0x7738,0x7747, +0x775A,0x7768,0x776B,0x775B,0x7765,0x777F,0x777E,0x7779, +0x778E,0x778B,0x7791,0x77A0,0x779E,0x77B0,0x77B6,0x77B9, +0x77BF,0x77BC,0x77BD,0x77BB,0x77C7,0x77CD,0x77D7,0x77DA, +0x77DC,0x77E3,0x77EE,0x77FC,0x780C,0x7812,0x7926,0x7820, +0x792A,0x7845,0x788E,0x7874,0x7886,0x787C,0x789A,0x788C, +0x78A3,0x78B5,0x78AA,0x78AF,0x78D1,0x78C6,0x78CB,0x78D4, +0x78BE,0x78BC,0x78C5,0x78CA,0x78EC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x78E7,0x78DA,0x78FD,0x78F4,0x7907,0x7912,0x7911,0x7919, +0x792C,0x792B,0x7940,0x7960,0x7957,0x795F,0x795A,0x7955, +0x7953,0x797A,0x797F,0x798A,0x799D,0x79A7,0x9F4B,0x79AA, +0x79AE,0x79B3,0x79B9,0x79BA,0x79C9,0x79D5,0x79E7,0x79EC, +0x79E1,0x79E3,0x7A08,0x7A0D,0x7A18,0x7A19,0x7A20,0x7A1F, +0x7980,0x7A31,0x7A3B,0x7A3E,0x7A37,0x7A43,0x7A57,0x7A49, +0x7A61,0x7A62,0x7A69,0x9F9D,0x7A70,0x7A79,0x7A7D,0x7A88, +0x7A97,0x7A95,0x7A98,0x7A96,0x7AA9,0x7AC8,0x7AB0, 0, +0x7AB6,0x7AC5,0x7AC4,0x7ABF,0x9083,0x7AC7,0x7ACA,0x7ACD, +0x7ACF,0x7AD5,0x7AD3,0x7AD9,0x7ADA,0x7ADD,0x7AE1,0x7AE2, +0x7AE6,0x7AED,0x7AF0,0x7B02,0x7B0F,0x7B0A,0x7B06,0x7B33, +0x7B18,0x7B19,0x7B1E,0x7B35,0x7B28,0x7B36,0x7B50,0x7B7A, +0x7B04,0x7B4D,0x7B0B,0x7B4C,0x7B45,0x7B75,0x7B65,0x7B74, +0x7B67,0x7B70,0x7B71,0x7B6C,0x7B6E,0x7B9D,0x7B98,0x7B9F, +0x7B8D,0x7B9C,0x7B9A,0x7B8B,0x7B92,0x7B8F,0x7B5D,0x7B99, +0x7BCB,0x7BC1,0x7BCC,0x7BCF,0x7BB4,0x7BC6,0x7BDD,0x7BE9, +0x7C11,0x7C14,0x7BE6,0x7BE5,0x7C60,0x7C00,0x7C07,0x7C13, +0x7BF3,0x7BF7,0x7C17,0x7C0D,0x7BF6,0x7C23,0x7C27,0x7C2A, +0x7C1F,0x7C37,0x7C2B,0x7C3D,0x7C4C,0x7C43,0x7C54,0x7C4F, +0x7C40,0x7C50,0x7C58,0x7C5F,0x7C64,0x7C56,0x7C65,0x7C6C, +0x7C75,0x7C83,0x7C90,0x7CA4,0x7CAD,0x7CA2,0x7CAB,0x7CA1, +0x7CA8,0x7CB3,0x7CB2,0x7CB1,0x7CAE,0x7CB9,0x7CBD,0x7CC0, +0x7CC5,0x7CC2,0x7CD8,0x7CD2,0x7CDC,0x7CE2,0x9B3B,0x7CEF, +0x7CF2,0x7CF4,0x7CF6,0x7CFA,0x7D06, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7D02,0x7D1C,0x7D15,0x7D0A,0x7D45,0x7D4B,0x7D2E,0x7D32, +0x7D3F,0x7D35,0x7D46,0x7D73,0x7D56,0x7D4E,0x7D72,0x7D68, +0x7D6E,0x7D4F,0x7D63,0x7D93,0x7D89,0x7D5B,0x7D8F,0x7D7D, +0x7D9B,0x7DBA,0x7DAE,0x7DA3,0x7DB5,0x7DC7,0x7DBD,0x7DAB, +0x7E3D,0x7DA2,0x7DAF,0x7DDC,0x7DB8,0x7D9F,0x7DB0,0x7DD8, +0x7DDD,0x7DE4,0x7DDE,0x7DFB,0x7DF2,0x7DE1,0x7E05,0x7E0A, +0x7E23,0x7E21,0x7E12,0x7E31,0x7E1F,0x7E09,0x7E0B,0x7E22, +0x7E46,0x7E66,0x7E3B,0x7E35,0x7E39,0x7E43,0x7E37, 0, +0x7E32,0x7E3A,0x7E67,0x7E5D,0x7E56,0x7E5E,0x7E59,0x7E5A, +0x7E79,0x7E6A,0x7E69,0x7E7C,0x7E7B,0x7E83,0x7DD5,0x7E7D, +0x8FAE,0x7E7F,0x7E88,0x7E89,0x7E8C,0x7E92,0x7E90,0x7E93, +0x7E94,0x7E96,0x7E8E,0x7E9B,0x7E9C,0x7F38,0x7F3A,0x7F45, +0x7F4C,0x7F4D,0x7F4E,0x7F50,0x7F51,0x7F55,0x7F54,0x7F58, +0x7F5F,0x7F60,0x7F68,0x7F69,0x7F67,0x7F78,0x7F82,0x7F86, +0x7F83,0x7F88,0x7F87,0x7F8C,0x7F94,0x7F9E,0x7F9D,0x7F9A, +0x7FA3,0x7FAF,0x7FB2,0x7FB9,0x7FAE,0x7FB6,0x7FB8,0x8B71, +0x7FC5,0x7FC6,0x7FCA,0x7FD5,0x7FD4,0x7FE1,0x7FE6,0x7FE9, +0x7FF3,0x7FF9,0x98DC,0x8006,0x8004,0x800B,0x8012,0x8018, +0x8019,0x801C,0x8021,0x8028,0x803F,0x803B,0x804A,0x8046, +0x8052,0x8058,0x805A,0x805F,0x8062,0x8068,0x8073,0x8072, +0x8070,0x8076,0x8079,0x807D,0x807F,0x8084,0x8086,0x8085, +0x809B,0x8093,0x809A,0x80AD,0x5190,0x80AC,0x80DB,0x80E5, +0x80D9,0x80DD,0x80C4,0x80DA,0x80D6,0x8109,0x80EF,0x80F1, +0x811B,0x8129,0x8123,0x812F,0x814B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x968B,0x8146,0x813E,0x8153,0x8151,0x80FC,0x8171,0x816E, +0x8165,0x8166,0x8174,0x8183,0x8188,0x818A,0x8180,0x8182, +0x81A0,0x8195,0x81A4,0x81A3,0x815F,0x8193,0x81A9,0x81B0, +0x81B5,0x81BE,0x81B8,0x81BD,0x81C0,0x81C2,0x81BA,0x81C9, +0x81CD,0x81D1,0x81D9,0x81D8,0x81C8,0x81DA,0x81DF,0x81E0, +0x81E7,0x81FA,0x81FB,0x81FE,0x8201,0x8202,0x8205,0x8207, +0x820A,0x820D,0x8210,0x8216,0x8229,0x822B,0x8238,0x8233, +0x8240,0x8259,0x8258,0x825D,0x825A,0x825F,0x8264, 0, +0x8262,0x8268,0x826A,0x826B,0x822E,0x8271,0x8277,0x8278, +0x827E,0x828D,0x8292,0x82AB,0x829F,0x82BB,0x82AC,0x82E1, +0x82E3,0x82DF,0x82D2,0x82F4,0x82F3,0x82FA,0x8393,0x8303, +0x82FB,0x82F9,0x82DE,0x8306,0x82DC,0x8309,0x82D9,0x8335, +0x8334,0x8316,0x8332,0x8331,0x8340,0x8339,0x8350,0x8345, +0x832F,0x832B,0x8317,0x8318,0x8385,0x839A,0x83AA,0x839F, +0x83A2,0x8396,0x8323,0x838E,0x8387,0x838A,0x837C,0x83B5, +0x8373,0x8375,0x83A0,0x8389,0x83A8,0x83F4,0x8413,0x83EB, +0x83CE,0x83FD,0x8403,0x83D8,0x840B,0x83C1,0x83F7,0x8407, +0x83E0,0x83F2,0x840D,0x8422,0x8420,0x83BD,0x8438,0x8506, +0x83FB,0x846D,0x842A,0x843C,0x855A,0x8484,0x8477,0x846B, +0x84AD,0x846E,0x8482,0x8469,0x8446,0x842C,0x846F,0x8479, +0x8435,0x84CA,0x8462,0x84B9,0x84BF,0x849F,0x84D9,0x84CD, +0x84BB,0x84DA,0x84D0,0x84C1,0x84C6,0x84D6,0x84A1,0x8521, +0x84FF,0x84F4,0x8517,0x8518,0x852C,0x851F,0x8515,0x8514, +0x84FC,0x8540,0x8563,0x8558,0x8548, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8541,0x8602,0x854B,0x8555,0x8580,0x85A4,0x8588,0x8591, +0x858A,0x85A8,0x856D,0x8594,0x859B,0x85EA,0x8587,0x859C, +0x8577,0x857E,0x8590,0x85C9,0x85BA,0x85CF,0x85B9,0x85D0, +0x85D5,0x85DD,0x85E5,0x85DC,0x85F9,0x860A,0x8613,0x860B, +0x85FE,0x85FA,0x8606,0x8622,0x861A,0x8630,0x863F,0x864D, +0x4E55,0x8654,0x865F,0x8667,0x8671,0x8693,0x86A3,0x86A9, +0x86AA,0x868B,0x868C,0x86B6,0x86AF,0x86C4,0x86C6,0x86B0, +0x86C9,0x8823,0x86AB,0x86D4,0x86DE,0x86E9,0x86EC, 0, +0x86DF,0x86DB,0x86EF,0x8712,0x8706,0x8708,0x8700,0x8703, +0x86FB,0x8711,0x8709,0x870D,0x86F9,0x870A,0x8734,0x873F, +0x8737,0x873B,0x8725,0x8729,0x871A,0x8760,0x875F,0x8778, +0x874C,0x874E,0x8774,0x8757,0x8768,0x876E,0x8759,0x8753, +0x8763,0x876A,0x8805,0x87A2,0x879F,0x8782,0x87AF,0x87CB, +0x87BD,0x87C0,0x87D0,0x96D6,0x87AB,0x87C4,0x87B3,0x87C7, +0x87C6,0x87BB,0x87EF,0x87F2,0x87E0,0x880F,0x880D,0x87FE, +0x87F6,0x87F7,0x880E,0x87D2,0x8811,0x8816,0x8815,0x8822, +0x8821,0x8831,0x8836,0x8839,0x8827,0x883B,0x8844,0x8842, +0x8852,0x8859,0x885E,0x8862,0x886B,0x8881,0x887E,0x889E, +0x8875,0x887D,0x88B5,0x8872,0x8882,0x8897,0x8892,0x88AE, +0x8899,0x88A2,0x888D,0x88A4,0x88B0,0x88BF,0x88B1,0x88C3, +0x88C4,0x88D4,0x88D8,0x88D9,0x88DD,0x88F9,0x8902,0x88FC, +0x88F4,0x88E8,0x88F2,0x8904,0x890C,0x890A,0x8913,0x8943, +0x891E,0x8925,0x892A,0x892B,0x8941,0x8944,0x893B,0x8936, +0x8938,0x894C,0x891D,0x8960,0x895E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8966,0x8964,0x896D,0x896A,0x896F,0x8974,0x8977,0x897E, +0x8983,0x8988,0x898A,0x8993,0x8998,0x89A1,0x89A9,0x89A6, +0x89AC,0x89AF,0x89B2,0x89BA,0x89BD,0x89BF,0x89C0,0x89DA, +0x89DC,0x89DD,0x89E7,0x89F4,0x89F8,0x8A03,0x8A16,0x8A10, +0x8A0C,0x8A1B,0x8A1D,0x8A25,0x8A36,0x8A41,0x8A5B,0x8A52, +0x8A46,0x8A48,0x8A7C,0x8A6D,0x8A6C,0x8A62,0x8A85,0x8A82, +0x8A84,0x8AA8,0x8AA1,0x8A91,0x8AA5,0x8AA6,0x8A9A,0x8AA3, +0x8AC4,0x8ACD,0x8AC2,0x8ADA,0x8AEB,0x8AF3,0x8AE7, 0, +0x8AE4,0x8AF1,0x8B14,0x8AE0,0x8AE2,0x8AF7,0x8ADE,0x8ADB, +0x8B0C,0x8B07,0x8B1A,0x8AE1,0x8B16,0x8B10,0x8B17,0x8B20, +0x8B33,0x97AB,0x8B26,0x8B2B,0x8B3E,0x8B28,0x8B41,0x8B4C, +0x8B4F,0x8B4E,0x8B49,0x8B56,0x8B5B,0x8B5A,0x8B6B,0x8B5F, +0x8B6C,0x8B6F,0x8B74,0x8B7D,0x8B80,0x8B8C,0x8B8E,0x8B92, +0x8B93,0x8B96,0x8B99,0x8B9A,0x8C3A,0x8C41,0x8C3F,0x8C48, +0x8C4C,0x8C4E,0x8C50,0x8C55,0x8C62,0x8C6C,0x8C78,0x8C7A, +0x8C82,0x8C89,0x8C85,0x8C8A,0x8C8D,0x8C8E,0x8C94,0x8C7C, +0x8C98,0x621D,0x8CAD,0x8CAA,0x8CBD,0x8CB2,0x8CB3,0x8CAE, +0x8CB6,0x8CC8,0x8CC1,0x8CE4,0x8CE3,0x8CDA,0x8CFD,0x8CFA, +0x8CFB,0x8D04,0x8D05,0x8D0A,0x8D07,0x8D0F,0x8D0D,0x8D10, +0x9F4E,0x8D13,0x8CCD,0x8D14,0x8D16,0x8D67,0x8D6D,0x8D71, +0x8D73,0x8D81,0x8D99,0x8DC2,0x8DBE,0x8DBA,0x8DCF,0x8DDA, +0x8DD6,0x8DCC,0x8DDB,0x8DCB,0x8DEA,0x8DEB,0x8DDF,0x8DE3, +0x8DFC,0x8E08,0x8E09,0x8DFF,0x8E1D,0x8E1E,0x8E10,0x8E1F, +0x8E42,0x8E35,0x8E30,0x8E34,0x8E4A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E47,0x8E49,0x8E4C,0x8E50,0x8E48,0x8E59,0x8E64,0x8E60, +0x8E2A,0x8E63,0x8E55,0x8E76,0x8E72,0x8E7C,0x8E81,0x8E87, +0x8E85,0x8E84,0x8E8B,0x8E8A,0x8E93,0x8E91,0x8E94,0x8E99, +0x8EAA,0x8EA1,0x8EAC,0x8EB0,0x8EC6,0x8EB1,0x8EBE,0x8EC5, +0x8EC8,0x8ECB,0x8EDB,0x8EE3,0x8EFC,0x8EFB,0x8EEB,0x8EFE, +0x8F0A,0x8F05,0x8F15,0x8F12,0x8F19,0x8F13,0x8F1C,0x8F1F, +0x8F1B,0x8F0C,0x8F26,0x8F33,0x8F3B,0x8F39,0x8F45,0x8F42, +0x8F3E,0x8F4C,0x8F49,0x8F46,0x8F4E,0x8F57,0x8F5C, 0, +0x8F62,0x8F63,0x8F64,0x8F9C,0x8F9F,0x8FA3,0x8FAD,0x8FAF, +0x8FB7,0x8FDA,0x8FE5,0x8FE2,0x8FEA,0x8FEF,0x9087,0x8FF4, +0x9005,0x8FF9,0x8FFA,0x9011,0x9015,0x9021,0x900D,0x901E, +0x9016,0x900B,0x9027,0x9036,0x9035,0x9039,0x8FF8,0x904F, +0x9050,0x9051,0x9052,0x900E,0x9049,0x903E,0x9056,0x9058, +0x905E,0x9068,0x906F,0x9076,0x96A8,0x9072,0x9082,0x907D, +0x9081,0x9080,0x908A,0x9089,0x908F,0x90A8,0x90AF,0x90B1, +0x90B5,0x90E2,0x90E4,0x6248,0x90DB,0x9102,0x9112,0x9119, +0x9132,0x9130,0x914A,0x9156,0x9158,0x9163,0x9165,0x9169, +0x9173,0x9172,0x918B,0x9189,0x9182,0x91A2,0x91AB,0x91AF, +0x91AA,0x91B5,0x91B4,0x91BA,0x91C0,0x91C1,0x91C9,0x91CB, +0x91D0,0x91D6,0x91DF,0x91E1,0x91DB,0x91FC,0x91F5,0x91F6, +0x921E,0x91FF,0x9214,0x922C,0x9215,0x9211,0x925E,0x9257, +0x9245,0x9249,0x9264,0x9248,0x9295,0x923F,0x924B,0x9250, +0x929C,0x9296,0x9293,0x929B,0x925A,0x92CF,0x92B9,0x92B7, +0x92E9,0x930F,0x92FA,0x9344,0x932E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9319,0x9322,0x931A,0x9323,0x933A,0x9335,0x933B,0x935C, +0x9360,0x937C,0x936E,0x9356,0x93B0,0x93AC,0x93AD,0x9394, +0x93B9,0x93D6,0x93D7,0x93E8,0x93E5,0x93D8,0x93C3,0x93DD, +0x93D0,0x93C8,0x93E4,0x941A,0x9414,0x9413,0x9403,0x9407, +0x9410,0x9436,0x942B,0x9435,0x9421,0x943A,0x9441,0x9452, +0x9444,0x945B,0x9460,0x9462,0x945E,0x946A,0x9229,0x9470, +0x9475,0x9477,0x947D,0x945A,0x947C,0x947E,0x9481,0x947F, +0x9582,0x9587,0x958A,0x9594,0x9596,0x9598,0x9599, 0, +0x95A0,0x95A8,0x95A7,0x95AD,0x95BC,0x95BB,0x95B9,0x95BE, +0x95CA,0x6FF6,0x95C3,0x95CD,0x95CC,0x95D5,0x95D4,0x95D6, +0x95DC,0x95E1,0x95E5,0x95E2,0x9621,0x9628,0x962E,0x962F, +0x9642,0x964C,0x964F,0x964B,0x9677,0x965C,0x965E,0x965D, +0x965F,0x9666,0x9672,0x966C,0x968D,0x9698,0x9695,0x9697, +0x96AA,0x96A7,0x96B1,0x96B2,0x96B0,0x96B4,0x96B6,0x96B8, +0x96B9,0x96CE,0x96CB,0x96C9,0x96CD,0x894D,0x96DC,0x970D, +0x96D5,0x96F9,0x9704,0x9706,0x9708,0x9713,0x970E,0x9711, +0x970F,0x9716,0x9719,0x9724,0x972A,0x9730,0x9739,0x973D, +0x973E,0x9744,0x9746,0x9748,0x9742,0x9749,0x975C,0x9760, +0x9764,0x9766,0x9768,0x52D2,0x976B,0x9771,0x9779,0x9785, +0x977C,0x9781,0x977A,0x9786,0x978B,0x978F,0x9790,0x979C, +0x97A8,0x97A6,0x97A3,0x97B3,0x97B4,0x97C3,0x97C6,0x97C8, +0x97CB,0x97DC,0x97ED,0x9F4F,0x97F2,0x7ADF,0x97F6,0x97F5, +0x980F,0x980C,0x9838,0x9824,0x9821,0x9837,0x983D,0x9846, +0x984F,0x984B,0x986B,0x986F,0x9870, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9871,0x9874,0x9873,0x98AA,0x98AF,0x98B1,0x98B6,0x98C4, +0x98C3,0x98C6,0x98E9,0x98EB,0x9903,0x9909,0x9912,0x9914, +0x9918,0x9921,0x991D,0x991E,0x9924,0x9920,0x992C,0x992E, +0x993D,0x993E,0x9942,0x9949,0x9945,0x9950,0x994B,0x9951, +0x9952,0x994C,0x9955,0x9997,0x9998,0x99A5,0x99AD,0x99AE, +0x99BC,0x99DF,0x99DB,0x99DD,0x99D8,0x99D1,0x99ED,0x99EE, +0x99F1,0x99F2,0x99FB,0x99F8,0x9A01,0x9A0F,0x9A05,0x99E2, +0x9A19,0x9A2B,0x9A37,0x9A45,0x9A42,0x9A40,0x9A43, 0, +0x9A3E,0x9A55,0x9A4D,0x9A5B,0x9A57,0x9A5F,0x9A62,0x9A65, +0x9A64,0x9A69,0x9A6B,0x9A6A,0x9AAD,0x9AB0,0x9ABC,0x9AC0, +0x9ACF,0x9AD1,0x9AD3,0x9AD4,0x9ADE,0x9ADF,0x9AE2,0x9AE3, +0x9AE6,0x9AEF,0x9AEB,0x9AEE,0x9AF4,0x9AF1,0x9AF7,0x9AFB, +0x9B06,0x9B18,0x9B1A,0x9B1F,0x9B22,0x9B23,0x9B25,0x9B27, +0x9B28,0x9B29,0x9B2A,0x9B2E,0x9B2F,0x9B32,0x9B44,0x9B43, +0x9B4F,0x9B4D,0x9B4E,0x9B51,0x9B58,0x9B74,0x9B93,0x9B83, +0x9B91,0x9B96,0x9B97,0x9B9F,0x9BA0,0x9BA8,0x9BB4,0x9BC0, +0x9BCA,0x9BB9,0x9BC6,0x9BCF,0x9BD1,0x9BD2,0x9BE3,0x9BE2, +0x9BE4,0x9BD4,0x9BE1,0x9C3A,0x9BF2,0x9BF1,0x9BF0,0x9C15, +0x9C14,0x9C09,0x9C13,0x9C0C,0x9C06,0x9C08,0x9C12,0x9C0A, +0x9C04,0x9C2E,0x9C1B,0x9C25,0x9C24,0x9C21,0x9C30,0x9C47, +0x9C32,0x9C46,0x9C3E,0x9C5A,0x9C60,0x9C67,0x9C76,0x9C78, +0x9CE7,0x9CEC,0x9CF0,0x9D09,0x9D08,0x9CEB,0x9D03,0x9D06, +0x9D2A,0x9D26,0x9DAF,0x9D23,0x9D1F,0x9D44,0x9D15,0x9D12, +0x9D41,0x9D3F,0x9D3E,0x9D46,0x9D48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9D5D,0x9D5E,0x9D64,0x9D51,0x9D50,0x9D59,0x9D72,0x9D89, +0x9D87,0x9DAB,0x9D6F,0x9D7A,0x9D9A,0x9DA4,0x9DA9,0x9DB2, +0x9DC4,0x9DC1,0x9DBB,0x9DB8,0x9DBA,0x9DC6,0x9DCF,0x9DC2, +0x9DD9,0x9DD3,0x9DF8,0x9DE6,0x9DED,0x9DEF,0x9DFD,0x9E1A, +0x9E1B,0x9E1E,0x9E75,0x9E79,0x9E7D,0x9E81,0x9E88,0x9E8B, +0x9E8C,0x9E92,0x9E95,0x9E91,0x9E9D,0x9EA5,0x9EA9,0x9EB8, +0x9EAA,0x9EAD,0x9761,0x9ECC,0x9ECE,0x9ECF,0x9ED0,0x9ED4, +0x9EDC,0x9EDE,0x9EDD,0x9EE0,0x9EE5,0x9EE8,0x9EEF, 0, +0x9EF4,0x9EF6,0x9EF7,0x9EF9,0x9EFB,0x9EFC,0x9EFD,0x9F07, +0x9F08,0x76B7,0x9F15,0x9F21,0x9F2C,0x9F3E,0x9F4A,0x9F52, +0x9F54,0x9F63,0x9F5F,0x9F60,0x9F61,0x9F66,0x9F67,0x9F6C, +0x9F6A,0x9F77,0x9F72,0x9F76,0x9F95,0x9F9C,0x9FA0,0x582F, +0x69C7,0x9059,0x7464,0x51DC,0x7199}; + +static int func_sjis_uni_onechar(int code){ + if ((code>=0x00A1)&&(code<=0x00DF)) + return(tab_sjis_uni0[code-0x00A1]); + if ((code>=0x8140)&&(code<=0x84BE)) + return(tab_sjis_uni1[code-0x8140]); + if ((code>=0x889F)&&(code<=0x9FFC)) + return(tab_sjis_uni2[code-0x889F]); + if ((code>=0xE040)&&(code<=0xEAA4)) + return(tab_sjis_uni3[code-0xE040]); + return(0); +} +/* page 0 0x005C-0x00F7 */ +static uint16 tab_uni_sjis0[]={ +0x815F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8191,0x8192, + 0, 0, 0,0x8198,0x814E, 0, 0, 0, +0x81CA, 0, 0, 0,0x818B,0x817D, 0, 0, +0x814C, 0,0x81F7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x817E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8180}; + +/* page 1 0x0391-0x0451 */ +static uint16 tab_uni_sjis1[]={ +0x839F,0x83A0,0x83A1,0x83A2,0x83A3,0x83A4,0x83A5,0x83A6, +0x83A7,0x83A8,0x83A9,0x83AA,0x83AB,0x83AC,0x83AD,0x83AE, +0x83AF, 0,0x83B0,0x83B1,0x83B2,0x83B3,0x83B4,0x83B5, +0x83B6, 0, 0, 0, 0, 0, 0, 0, +0x83BF,0x83C0,0x83C1,0x83C2,0x83C3,0x83C4,0x83C5,0x83C6, +0x83C7,0x83C8,0x83C9,0x83CA,0x83CB,0x83CC,0x83CD,0x83CE, +0x83CF, 0,0x83D0,0x83D1,0x83D2,0x83D3,0x83D4,0x83D5, +0x83D6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8446, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8440, +0x8441,0x8442,0x8443,0x8444,0x8445,0x8447,0x8448,0x8449, +0x844A,0x844B,0x844C,0x844D,0x844E,0x844F,0x8450,0x8451, +0x8452,0x8453,0x8454,0x8455,0x8456,0x8457,0x8458,0x8459, +0x845A,0x845B,0x845C,0x845D,0x845E,0x845F,0x8460,0x8470, +0x8471,0x8472,0x8473,0x8474,0x8475,0x8477,0x8478,0x8479, +0x847A,0x847B,0x847C,0x847D,0x847E,0x8480,0x8481,0x8482, +0x8483,0x8484,0x8485,0x8486,0x8487,0x8488,0x8489,0x848A, +0x848B,0x848C,0x848D,0x848E,0x848F,0x8490,0x8491, 0, +0x8476}; + +/* page 2 0x2010-0x2312 */ +static uint16 tab_uni_sjis2[]={ +0x815D, 0, 0, 0, 0,0x815C,0x8161, 0, +0x8165,0x8166, 0, 0,0x8167,0x8168, 0, 0, +0x81F5,0x81F6, 0, 0, 0,0x8164,0x8163, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81F1, 0,0x818C,0x818D, 0, 0, 0, 0, + 0, 0, 0,0x81A6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x818E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x81F0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81A9,0x81AA,0x81A8,0x81AB, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81CB, 0,0x81CC, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81CD, 0,0x81DD,0x81CE, 0, 0, 0,0x81DE, +0x81B8, 0, 0,0x81B9, 0, 0, 0, 0, + 0, 0,0x817C, 0, 0, 0, 0, 0, + 0, 0,0x81E3, 0, 0,0x81E5,0x8187, 0, +0x81DA, 0, 0, 0, 0, 0, 0,0x81C8, +0x81C9,0x81BF,0x81BE,0x81E7,0x81E8, 0, 0, 0, + 0, 0, 0, 0,0x8188,0x81E6, 0, 0, + 0, 0, 0, 0, 0,0x81E4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81E0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8182,0x81DF, 0, 0, 0, 0,0x8185,0x8186, + 0, 0,0x81E1,0x81E2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81BC,0x81BD, 0, 0,0x81BA,0x81BB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x81DB, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81DC}; + +/* page 3 0x2500-0x266F */ +static uint16 tab_uni_sjis3[]={ +0x849F,0x84AA,0x84A0,0x84AB, 0, 0, 0, 0, + 0, 0, 0, 0,0x84A1, 0, 0,0x84AC, +0x84A2, 0, 0,0x84AD,0x84A4, 0, 0,0x84AF, +0x84A3, 0, 0,0x84AE,0x84A5,0x84BA, 0, 0, +0x84B5, 0, 0,0x84B0,0x84A7,0x84BC, 0, 0, +0x84B7, 0, 0,0x84B2,0x84A6, 0, 0,0x84B6, +0x84BB, 0, 0,0x84B1,0x84A8, 0, 0,0x84B8, +0x84BD, 0, 0,0x84B3,0x84A9, 0, 0,0x84B9, + 0, 0,0x84BE, 0, 0, 0, 0, 0, + 0, 0, 0,0x84B4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x81A1,0x81A0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81A3,0x81A2, 0, 0, 0, 0, + 0, 0, 0, 0,0x81A5,0x81A4, 0, 0, + 0, 0, 0, 0, 0, 0,0x819F,0x819E, + 0, 0, 0,0x819B, 0, 0,0x819D,0x819C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x81FC, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x819A,0x8199, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x818A, 0,0x8189, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x81F4, 0, 0,0x81F3, 0,0x81F2 +}; + +/* page 4 0x3000-0x30FE */ +static uint16 tab_uni_sjis4[]={ +0x8140,0x8141,0x8142,0x8156, 0,0x8158,0x8159,0x815A, +0x8171,0x8172,0x8173,0x8174,0x8175,0x8176,0x8177,0x8178, +0x8179,0x817A,0x81A7,0x81AC,0x816B,0x816C, 0, 0, + 0, 0, 0, 0,0x8160, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x829F,0x82A0,0x82A1,0x82A2,0x82A3,0x82A4,0x82A5, +0x82A6,0x82A7,0x82A8,0x82A9,0x82AA,0x82AB,0x82AC,0x82AD, +0x82AE,0x82AF,0x82B0,0x82B1,0x82B2,0x82B3,0x82B4,0x82B5, +0x82B6,0x82B7,0x82B8,0x82B9,0x82BA,0x82BB,0x82BC,0x82BD, +0x82BE,0x82BF,0x82C0,0x82C1,0x82C2,0x82C3,0x82C4,0x82C5, +0x82C6,0x82C7,0x82C8,0x82C9,0x82CA,0x82CB,0x82CC,0x82CD, +0x82CE,0x82CF,0x82D0,0x82D1,0x82D2,0x82D3,0x82D4,0x82D5, +0x82D6,0x82D7,0x82D8,0x82D9,0x82DA,0x82DB,0x82DC,0x82DD, +0x82DE,0x82DF,0x82E0,0x82E1,0x82E2,0x82E3,0x82E4,0x82E5, +0x82E6,0x82E7,0x82E8,0x82E9,0x82EA,0x82EB,0x82EC,0x82ED, +0x82EE,0x82EF,0x82F0,0x82F1, 0, 0, 0, 0, + 0, 0, 0,0x814A,0x814B,0x8154,0x8155, 0, + 0,0x8340,0x8341,0x8342,0x8343,0x8344,0x8345,0x8346, +0x8347,0x8348,0x8349,0x834A,0x834B,0x834C,0x834D,0x834E, +0x834F,0x8350,0x8351,0x8352,0x8353,0x8354,0x8355,0x8356, +0x8357,0x8358,0x8359,0x835A,0x835B,0x835C,0x835D,0x835E, +0x835F,0x8360,0x8361,0x8362,0x8363,0x8364,0x8365,0x8366, +0x8367,0x8368,0x8369,0x836A,0x836B,0x836C,0x836D,0x836E, +0x836F,0x8370,0x8371,0x8372,0x8373,0x8374,0x8375,0x8376, +0x8377,0x8378,0x8379,0x837A,0x837B,0x837C,0x837D,0x837E, +0x8380,0x8381,0x8382,0x8383,0x8384,0x8385,0x8386,0x8387, +0x8388,0x8389,0x838A,0x838B,0x838C,0x838D,0x838E,0x838F, +0x8390,0x8391,0x8392,0x8393,0x8394,0x8395,0x8396, 0, + 0, 0, 0,0x8145,0x815B,0x8152,0x8153}; + +/* page 5 0x4E00-0x9481 */ +static uint16 tab_uni_sjis5[]={ +0x88EA,0x929A, 0,0x8EB5, 0, 0, 0,0x969C, +0x8FE4,0x8E4F,0x8FE3,0x89BA, 0,0x9573,0x975E, 0, +0x98A0,0x894E, 0, 0,0x8A8E,0x98A1,0x90A2,0x99C0, +0x8B75,0x95B8, 0, 0, 0, 0,0x8FE5, 0, + 0,0x97BC, 0, 0, 0, 0,0x95C0, 0, + 0, 0,0x98A2, 0, 0,0x9286, 0, 0, + 0,0x98A3,0x8BF8, 0, 0, 0,0x98A4, 0, +0x8ADB,0x924F, 0,0x8EE5,0x98A5, 0, 0,0x98A6, + 0, 0,0x98A7,0x9454, 0,0x8B76, 0, 0, + 0, 0, 0,0x9456, 0,0x93E1,0x8CC1,0x9652, + 0, 0, 0, 0, 0,0xE568,0x98A8,0x8FE6, +0x98A9,0x89B3, 0, 0, 0,0x8BE3,0x8CEE,0x96E7, + 0, 0,0x9BA4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9790, 0,0x93FB, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8AA3, 0, +0x8B54, 0,0x98AA, 0, 0,0x98AB,0x97B9, 0, +0x975C,0x9188,0x98AD,0x8E96,0x93F1, 0,0x98B0, 0, + 0,0x895D,0x8CDD, 0,0x8CDC,0x88E4, 0, 0, +0x986A,0x9869, 0,0x8DB1,0x889F, 0,0x98B1,0x98B2, +0x98B3,0x9653,0x98B4, 0,0x8CF0,0x88E5,0x9692, 0, +0x8B9C, 0, 0,0x8B9D,0x8B9E,0x92E0,0x97BA, 0, +0x98B5, 0, 0,0x98B6, 0, 0,0x98B7, 0, + 0, 0,0x906C, 0, 0, 0, 0, 0, +0x8F59,0x906D,0x98BC, 0,0x98BA, 0,0x98BB,0x8B77, + 0, 0,0x8DA1,0x89EE, 0,0x98B9,0x98B8,0x95A7, + 0, 0, 0, 0,0x8E65,0x8E64,0x91BC,0x98BD, +0x9574,0x90E5, 0, 0, 0,0x8157,0x98BE,0x98C0, + 0, 0, 0,0x91E3,0x97DF,0x88C8, 0, 0, + 0, 0, 0, 0, 0,0x98BF,0x89BC, 0, +0x8BC2, 0,0x9287, 0, 0, 0,0x8C8F,0x98C1, + 0, 0, 0,0x9443, 0, 0, 0, 0, + 0,0x8AE9, 0, 0, 0, 0, 0, 0, + 0,0x98C2,0x88C9, 0, 0,0x8CDE,0x8AEA,0x959A, +0x94B0,0x8B78, 0, 0, 0, 0, 0, 0, + 0, 0,0x89EF, 0,0x98E5,0x9360, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x948C, +0x98C4, 0, 0, 0,0x94BA, 0,0x97E0, 0, +0x904C, 0,0x8E66, 0,0x8E97,0x89BE, 0, 0, + 0, 0, 0,0x92CF, 0, 0,0x9241,0x98C8, + 0, 0, 0, 0, 0,0x88CA,0x92E1,0x8F5A, +0x8DB2,0x9743, 0,0x91CC, 0,0x89BD, 0,0x98C7, + 0,0x975D,0x98C3,0x98C5,0x8DEC,0x98C6,0x9B43, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x98CE, 0, 0, 0, 0, 0,0x98D1, +0x98CF, 0, 0,0x89C0, 0,0x95B9,0x98C9, 0, + 0, 0, 0,0x98CD,0x8CF1, 0, 0,0x8E67, + 0, 0, 0,0x8AA4, 0, 0,0x98D2, 0, +0x98CA, 0, 0,0x97E1, 0,0x8E98, 0,0x98CB, + 0,0x98D0, 0, 0, 0, 0,0x98D3, 0, +0x98CC, 0, 0,0x8B9F, 0,0x88CB, 0, 0, +0x8BA0,0x89BF, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9B44, 0,0x9699,0x958E,0x8CF2, + 0, 0, 0, 0, 0,0x904E,0x97B5, 0, + 0, 0, 0, 0, 0, 0, 0,0x95D6, + 0, 0,0x8C57,0x91A3,0x89E2, 0, 0, 0, + 0, 0,0x8F72, 0, 0, 0,0x98D7, 0, +0x98DC,0x98DA, 0, 0,0x98D5, 0, 0,0x91AD, +0x98D8, 0,0x98DB,0x98D9, 0,0x95DB, 0,0x98D6, + 0,0x904D, 0,0x9693,0x98DD,0x98DE, 0, 0, + 0, 0, 0, 0, 0, 0,0x8F43,0x98EB, + 0, 0, 0,0x946F, 0,0x9555,0x98E6, 0, +0x95EE, 0,0x89B4, 0, 0, 0,0x98EA, 0, + 0, 0, 0, 0, 0,0x98E4,0x98ED, 0, + 0,0x9171, 0,0x8CC2, 0,0x947B, 0,0xE0C5, + 0,0x98EC,0x937C, 0,0x98E1, 0,0x8CF4, 0, + 0,0x8CF3,0x98DF, 0, 0, 0, 0,0x8ED8, + 0,0x98E7, 0,0x95ED,0x926C,0x98E3,0x8C91, 0, +0x98E0,0x98E8,0x98E2,0x97CF,0x98E9,0x9860, 0, 0, + 0, 0, 0, 0, 0, 0,0x8BE4, 0, + 0,0x8C90, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x98EE, 0, 0, 0,0x98EF, +0x98F3,0x88CC, 0, 0, 0, 0, 0,0x95CE, +0x98F2, 0, 0, 0, 0,0x98F1,0x98F5, 0, + 0, 0,0x98F4, 0,0x92E2, 0, 0, 0, + 0, 0, 0, 0, 0,0x8C92, 0, 0, + 0, 0, 0, 0,0x98F6, 0, 0, 0, + 0, 0,0x8EC3, 0,0x91A4,0x92E3,0x8BF4, 0, +0x98F7, 0, 0, 0, 0,0x8B55, 0, 0, +0x98F8, 0, 0, 0, 0,0x98FA, 0, 0, + 0, 0, 0, 0, 0,0x9654, 0, 0, + 0,0x8C86, 0, 0, 0, 0, 0, 0, +0x8E50,0x94F5,0x98F9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8DC3,0x9762, 0, 0, + 0, 0,0x98FC,0x9942,0x98FB,0x8DC2, 0,0x8F9D, + 0, 0, 0, 0, 0, 0,0x8C58, 0, + 0, 0,0x9943, 0, 0,0x8BCD, 0, 0, + 0,0x9940,0x9941, 0, 0,0x93AD, 0,0x919C, + 0,0x8BA1, 0, 0, 0,0x966C,0x9944, 0, + 0, 0,0x97BB, 0, 0, 0,0x9945, 0, + 0, 0, 0,0x9948, 0,0x9946, 0,0x916D, + 0, 0, 0, 0, 0,0x9947,0x9949, 0, + 0, 0, 0, 0, 0,0x994B, 0, 0, + 0,0x994A, 0,0x95C6, 0, 0, 0, 0, +0x8B56,0x994D,0x994E, 0,0x89AD, 0, 0, 0, + 0,0x994C, 0, 0, 0, 0, 0, 0, + 0, 0,0x8EF2, 0,0x9951,0x9950,0x994F, 0, +0x98D4, 0,0x9952, 0, 0, 0, 0,0x8F9E, + 0,0x9953, 0, 0, 0, 0, 0, 0, + 0, 0,0x9744, 0, 0, 0, 0, 0, + 0, 0,0x96D7, 0, 0, 0, 0,0x9955, + 0, 0,0x9954,0x9957,0x9956, 0, 0,0x9958, +0x9959,0x88F2, 0,0x8CB3,0x8C5A,0x8F5B,0x929B,0x8BA2, +0x90E6,0x8CF5, 0,0x8D8E,0x995B,0x96C6,0x9365, 0, +0x8E99, 0,0x995A, 0,0x995C, 0, 0, 0, + 0, 0,0x937D, 0,0x8A95, 0, 0, 0, + 0, 0,0x995D, 0, 0,0x93FC, 0, 0, +0x9153,0x995F,0x9960,0x94AA,0x8CF6,0x985A,0x9961, 0, + 0,0x8BA4, 0, 0, 0,0x95BA,0x91B4,0x8BEF, +0x9354, 0, 0, 0,0x8C93, 0, 0, 0, +0x9962, 0,0x9963, 0, 0,0x93E0,0x897E, 0, + 0,0x9966,0x8DFB, 0,0x9965,0x8DC4, 0,0x9967, +0xE3EC,0x9968,0x9660,0x9969, 0,0x996A,0x996B,0x8FE7, + 0,0x8ECA, 0, 0, 0, 0, 0, 0, +0x8AA5, 0,0x996E, 0,0x996C,0x96BB,0x996D, 0, +0x9579,0x996F,0x9970,0x9971,0x937E, 0, 0, 0, +0x9975,0x9973,0x9974,0x9972,0x8DE1,0x9976,0x96E8,0x97E2, + 0, 0, 0, 0, 0,0x9977, 0, 0, + 0, 0, 0, 0,0x90A6,0x9978,0x8F79, 0, + 0,0x9979, 0,0x929C,0x97BD,0x9380, 0, 0, + 0, 0, 0, 0, 0, 0,0x99C3, 0, + 0, 0, 0,0x997A,0xEAA3,0x8BC3, 0, 0, +0x997B,0x967D, 0, 0, 0, 0,0x8F88,0x91FA, + 0,0x997D,0x93E2, 0, 0,0x997E, 0, 0, +0x9980,0x8A4D, 0, 0, 0,0x9981,0x8BA5, 0, +0x93CA,0x899A,0x8F6F, 0, 0,0x949F,0x9982, 0, +0x9381, 0, 0,0x906E,0x9983, 0,0x95AA,0x90D8, +0x8AA0, 0,0x8AA7,0x9984, 0, 0,0x9986, 0, + 0,0x8C59, 0, 0,0x9985, 0, 0,0x97F1, + 0, 0, 0, 0, 0,0x8F89, 0, 0, + 0, 0, 0, 0,0x94BB,0x95CA, 0,0x9987, + 0,0x9798,0x9988, 0, 0, 0,0x9989, 0, +0x939E, 0, 0,0x998A, 0, 0,0x90A7,0x8DFC, +0x8C94,0x998B,0x8E68,0x8D8F, 0, 0, 0, 0, + 0, 0, 0,0x92E4,0x998D, 0, 0,0x91A5, + 0, 0,0x8DED,0x998E,0x998F,0x914F, 0,0x998C, + 0, 0, 0, 0,0x9991, 0,0x9655, 0, + 0, 0, 0,0x8D84, 0, 0,0x9990, 0, + 0, 0, 0,0x8C95,0x8DDC,0x948D, 0, 0, + 0,0x9994,0x9992, 0, 0, 0, 0,0x959B, +0x8FE8,0x999B,0x8A84,0x9995,0x9993,0x916E, 0, 0, + 0, 0, 0, 0, 0,0x9997, 0,0x9996, + 0, 0, 0,0x8A63, 0, 0, 0,0x8C80, +0x999C,0x97AB, 0, 0, 0,0x9998, 0, 0, + 0,0x999D,0x999A, 0,0x9999, 0, 0, 0, + 0, 0, 0,0x97CD, 0, 0, 0,0x8CF7, +0x89C1, 0, 0,0x97F2, 0, 0, 0, 0, + 0,0x8F95,0x9377,0x8D85,0x99A0,0x99A1, 0, 0, + 0,0x97E3, 0, 0,0x984A,0x99A3, 0, 0, + 0,0x8CF8, 0, 0,0x99A2, 0,0x8A4E, 0, + 0,0x99A4, 0,0x9675, 0,0x92BA, 0,0x9745, + 0,0x95D7, 0, 0, 0,0x99A5, 0, 0, + 0, 0,0xE8D3, 0, 0,0x93AE, 0,0x99A6, +0x8AA8,0x96B1, 0, 0, 0,0x8F9F,0x99A7,0x95E5, +0x99AB, 0,0x90A8,0x99A8,0x8BCE, 0,0x99A9,0x8AA9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8C4D,0x99AC, 0,0x99AD, 0, 0, +0x99AE,0x99AF,0x8ED9, 0, 0, 0,0x8CF9,0x96DC, + 0,0x96E6,0x93F5, 0, 0,0x95EF,0x99B0, 0, +0x99B1, 0, 0, 0, 0,0x99B3, 0,0x99B5, +0x99B4, 0, 0, 0, 0,0x99B6,0x89BB,0x966B, + 0,0x8DFA,0x99B7, 0, 0,0x9178, 0, 0, +0x8FA0,0x8BA7, 0,0x99B8, 0, 0, 0, 0, + 0, 0,0x94D9, 0, 0, 0, 0,0x99B9, + 0,0x99BA, 0,0x99BB, 0, 0, 0, 0, +0x99BC,0x9543,0x8BE6,0x88E3, 0, 0, 0,0x93BD, +0x99BD,0x8F5C, 0,0x90E7, 0,0x99BF,0x99BE,0x8FA1, +0x8CDF,0x99C1,0x94BC, 0, 0,0x99C2, 0, 0, + 0,0x94DA,0x91B2,0x91EC,0x8BA6, 0, 0,0x93EC, +0x9250, 0,0x948E, 0,0x966D, 0,0x99C4, 0, +0x90E8, 0, 0, 0, 0, 0,0x8C54, 0, + 0,0x99C5, 0, 0, 0, 0,0x99C6,0x894B, +0x88F3,0x8AEB, 0,0x91A6,0x8B70,0x9791, 0,0x99C9, +0x89B5, 0, 0,0x99C8, 0, 0, 0,0x8BA8, + 0, 0,0x99CA, 0,0x96EF, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x99CB, 0, +0x97D0, 0,0x8CFA, 0, 0, 0, 0,0x8CB4, +0x99CC, 0, 0, 0, 0,0x99CE,0x99CD, 0, +0x907E,0x8958, 0, 0, 0,0x897D,0x99CF, 0, +0x99D0, 0, 0,0x8CB5, 0, 0,0x99D1, 0, + 0, 0, 0,0x8B8E, 0, 0, 0, 0, + 0, 0,0x8E51,0x99D2, 0, 0, 0, 0, +0x9694,0x8DB3,0x8B79,0x9746,0x916F,0x94BD,0x8EFB, 0, + 0, 0, 0, 0,0x8F66, 0,0x8EE6,0x8EF3, + 0,0x8F96, 0,0x94BE, 0, 0, 0,0x99D5, + 0,0x8962,0x9170,0x8CFB,0x8CC3,0x8BE5, 0, 0, +0x99D9,0x9240,0x91FC,0x8BA9,0x8FA2,0x99DA,0x99D8,0x89C2, +0x91E4,0x8EB6,0x8E6A,0x8945, 0, 0,0x8A90,0x8D86, +0x8E69, 0,0x99DB, 0, 0, 0, 0, 0, + 0,0x99DC, 0,0x8B68,0x8A65, 0, 0, 0, +0x8D87,0x8B67,0x92DD,0x8944,0x93AF,0x96BC,0x8D40,0x9799, +0x9366,0x8CFC, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8C4E, 0,0x99E5, 0,0x8BE1, +0x9669, 0, 0, 0, 0, 0,0x94DB, 0, + 0,0x99E4, 0,0x8ADC,0x99DF,0x99E0,0x99E2, 0, + 0, 0, 0, 0, 0, 0,0x99E3, 0, +0x8B7A,0x9081, 0,0x95AB,0x99E1,0x99DD,0x8CE1, 0, +0x99DE, 0,0x9843, 0, 0, 0,0x95F0, 0, +0x92E6,0x8CE0,0x8D90, 0, 0, 0,0x99E6, 0, + 0,0x93DB, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x99EA, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8EFC, 0,0x8EF4, 0, 0, 0, 0, 0, +0x99ED,0x99EB, 0,0x96A1, 0,0x99E8,0x99F1,0x99EC, + 0, 0, 0,0x99EF,0x8CC4,0x96BD, 0, 0, +0x99F0, 0, 0, 0,0x99F2, 0,0x99F4, 0, + 0, 0, 0,0x8DEE,0x9861, 0,0x99E9,0x99E7, +0x99F3, 0,0x99EE, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x99F6, 0,0x9A42,0x99F8, 0, 0, +0x99FC, 0, 0,0x9A40,0x99F9, 0, 0,0x9A5D, + 0, 0,0x8DE7,0x8A50, 0, 0, 0, 0, +0x99F7, 0, 0, 0,0x9A44,0x88F4,0x9A43, 0, +0x88A3,0x9569,0x9A41, 0,0x99FA, 0, 0,0x99F5, +0x99FB,0x8DC6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A45, 0, 0, 0, 0, 0, 0, 0, + 0,0x88F5,0x9A4E, 0, 0,0x9A46,0x9A47, 0, +0x8FA3,0x9689, 0, 0, 0,0x9A4C,0x9A4B, 0, + 0, 0,0x934E, 0, 0, 0, 0, 0, + 0, 0,0x9A4D, 0, 0,0x9A4A, 0, 0, + 0, 0, 0, 0,0x8953, 0,0x8DB4,0x904F, + 0, 0, 0, 0, 0, 0, 0,0x9A48, +0x9382, 0, 0, 0,0x9A49, 0,0x88A0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9A53,0x9742, + 0,0x8FA5, 0,0x9A59, 0, 0, 0, 0, +0x9A58,0x9A4F, 0, 0, 0, 0,0x91C1, 0, +0x9A50, 0, 0, 0,0x91ED,0x9A55,0x8FA4, 0, + 0, 0, 0, 0,0x9A52, 0, 0,0x96E2, + 0, 0, 0,0x8C5B, 0, 0,0x9A56,0x9A57, + 0, 0, 0, 0,0x9A54,0x9A5A, 0, 0, + 0, 0, 0,0x9A51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9A60,0x9A65, 0,0x9A61, 0, +0x9A5C, 0, 0,0x9A66,0x9150, 0, 0,0x9A68, + 0,0x8D41,0x9A5E,0x929D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A62,0x9A5B,0x8AAB, 0,0x8AEC,0x8A85,0x9A63,0x9A5F, + 0, 0, 0, 0, 0, 0, 0,0x8C96, +0x9A69,0x9A67,0x9172,0x8B69,0x8BAA, 0,0x9A64, 0, +0x8BF2, 0, 0, 0, 0, 0,0x8963, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A6D,0x9A6B, 0,0x9AA5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A70, 0, 0, 0, + 0, 0,0x9A6A, 0,0x9A6E, 0, 0,0x9A6C, + 0, 0, 0,0x8E6B,0x9A6F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9A72, + 0,0x9A77, 0, 0, 0,0x9A75,0x9A74, 0, + 0, 0, 0, 0, 0, 0,0x9251, 0, + 0,0x89C3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A71, 0,0x9A73,0x8FA6, +0x8952, 0, 0,0x9A76, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x89DC, 0, 0, 0, 0, 0,0x9A82, + 0,0x8FFA,0x9A7D, 0,0x9A7B, 0,0x9A7C, 0, +0x9A7E, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x895C, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9158, 0,0x9A78, 0, +0x9A79, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8A9A, 0, 0, 0, 0, + 0, 0, 0, 0,0x9A81, 0, 0, 0, +0x8AED, 0,0x9A84,0x9A80,0x9A83, 0, 0, 0, + 0, 0, 0, 0,0x95AC, 0, 0, 0, +0x93D3, 0,0x94B6, 0, 0, 0, 0, 0, +0x9A86, 0, 0, 0, 0, 0,0x9A85,0x8A64, + 0, 0,0x9A87, 0, 0, 0, 0,0x9A8A, + 0, 0, 0, 0,0x9A89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9A88, 0,0x9458, 0, 0,0x9A8B, 0, 0, + 0, 0, 0, 0, 0, 0,0x9A8C, 0, + 0, 0, 0, 0,0x9A8E, 0,0x9A8D, 0, + 0, 0, 0, 0,0x9A90, 0, 0, 0, +0x9A93,0x9A91,0x9A8F,0x9A92, 0, 0, 0, 0, +0x9A94, 0, 0, 0, 0, 0,0x9A95, 0, + 0,0x9A96, 0,0x9A97, 0, 0, 0,0x9A98, +0x9964, 0,0x8EFA,0x8E6C, 0, 0,0x89F1, 0, +0x88F6, 0, 0,0x9263, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9A99, 0, +0x8DA2, 0,0x88CD,0x907D, 0, 0, 0, 0, + 0,0x9A9A,0x8CC5, 0, 0,0x8D91, 0,0x9A9C, +0x9A9B, 0, 0,0x95DE,0x9A9D, 0, 0, 0, +0x9A9F,0x9A9E, 0,0x9AA0, 0,0x9AA1, 0,0x8C97, + 0, 0,0x8980,0x9AA2, 0, 0,0x9AA4, 0, +0x9AA3, 0, 0, 0,0x9AA6, 0, 0,0x9379, + 0, 0, 0, 0, 0, 0,0x9AA7,0x88B3, +0x8DDD, 0, 0, 0, 0,0x8C5C, 0, 0, +0x926E, 0, 0, 0, 0, 0, 0,0x9AA8, +0x9AA9, 0, 0,0x9AAB, 0, 0, 0, 0, +0x9AAC, 0,0x8DE2, 0, 0, 0, 0,0x8BCF, + 0, 0,0x9656, 0, 0, 0,0x9AAA,0x9AAD, +0x8DBF,0x8D42, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9AB1, 0, 0,0x8DA3, 0,0x9252, 0, + 0,0x9AAE,0x92D8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9AB2, + 0, 0,0x9082, 0, 0, 0, 0, 0, +0x9AB0,0x9AB3, 0,0x8C5E, 0, 0, 0, 0, + 0, 0, 0,0x9AB4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9AB5, 0,0x8D43,0x8A5F,0x9AB7, 0, 0, 0, + 0, 0,0x9AB8, 0, 0, 0, 0, 0, +0x9AB9, 0, 0,0x9AB6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9AAF, 0, 0,0x9ABA, 0, 0,0x9ABB, 0, + 0, 0, 0,0x9684, 0, 0,0x8FE9, 0, + 0, 0,0x9ABD,0x9ABE,0x9ABC, 0,0x9AC0, 0, + 0, 0, 0, 0,0x9457, 0, 0,0x88E6, +0x9575, 0, 0,0x9AC1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8FFB, 0, 0,0x8EB7, + 0,0x947C,0x8AEE, 0,0x8DE9, 0, 0, 0, +0x9678, 0,0x93B0, 0, 0,0x8C98,0x91CD, 0, + 0, 0,0x9ABF,0x9AC2, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x91C2, 0, 0, + 0,0x9AC3, 0, 0, 0,0x9AC4, 0, 0, + 0,0x9AC6, 0, 0,0x92E7, 0, 0, 0, + 0, 0,0x8AAC, 0, 0, 0, 0,0xEA9F, +0x8981,0x95F1, 0, 0,0x8FEA,0x9367, 0, 0, + 0, 0,0x8DE4, 0, 0,0x9ACC, 0, 0, +0x95BB,0x97DB, 0, 0, 0, 0, 0, 0, + 0, 0,0x89F2,0x9AC8, 0, 0, 0, 0, + 0,0x9159,0x9ACB, 0,0x9383, 0, 0,0x9368, +0x9384,0x94B7,0x92CB, 0, 0, 0,0x8DC7, 0, + 0, 0,0x9AC7, 0, 0, 0, 0, 0, + 0,0x8996, 0,0x9355, 0, 0, 0, 0, +0x9AC9, 0,0x9AC5, 0, 0,0x906F, 0, 0, + 0,0x9ACD, 0, 0, 0, 0,0x8F6D, 0, + 0, 0, 0,0x8BAB, 0,0x9ACE, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x95E6, 0, 0, 0,0x919D, + 0, 0, 0, 0,0x92C4, 0, 0,0x9AD0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x966E, 0, 0,0x9AD1, 0, 0,0x9AD6, 0, + 0, 0, 0,0x95AD, 0, 0, 0, 0, +0x9AD5,0x9ACF,0x9AD2,0x9AD4, 0, 0,0x8DA4, 0, + 0,0x95C7, 0, 0, 0,0x9AD7, 0,0x9264, + 0, 0,0x89F3, 0,0x8FEB, 0, 0, 0, + 0,0x9AD9, 0,0x9AD8, 0,0x8D88, 0,0x9ADA, +0x9ADC,0x9ADB, 0, 0,0x9ADE, 0,0x9AD3,0x9AE0, + 0, 0, 0, 0,0x9ADF,0x9ADD, 0, 0, + 0, 0, 0,0x8E6D,0x9070, 0,0x9173,0x9AE1, +0x90BA,0x88EB,0x9484, 0, 0, 0, 0,0x92D9, + 0,0x9AE3,0x9AE2,0x9AE4,0x9AE5,0x9AE6, 0, 0, + 0, 0,0x9AE7, 0, 0, 0, 0, 0, + 0,0x95CF,0x9AE8, 0, 0, 0, 0,0x89C4, +0x9AE9, 0, 0, 0, 0,0x975B,0x8A4F, 0, +0x99C7,0x8F67,0x91BD,0x9AEA,0x96E9, 0, 0, 0, + 0, 0,0x96B2, 0, 0,0x9AEC, 0,0x91E5, + 0,0x9356,0x91BE,0x9576,0x9AED,0x9AEE,0x899B, 0, + 0,0x8EB8,0x9AEF, 0, 0, 0, 0,0x88CE, +0x9AF0, 0, 0, 0, 0, 0,0x9AF1, 0, + 0, 0, 0, 0,0x8982, 0, 0,0x8AEF, +0x93DE,0x95F2, 0, 0, 0, 0,0x9AF5,0x9174, +0x9AF4,0x8C5F, 0, 0,0x967A,0x9AF3, 0,0x9385, +0x9AF7, 0,0x9AF6, 0, 0, 0, 0, 0, +0x9AF9, 0,0x9AF8, 0, 0,0x899C, 0,0x9AFA, +0x8FA7,0x9AFC,0x9244, 0,0x9AFB, 0,0x95B1, 0, + 0, 0, 0,0x8F97,0x937A, 0, 0, 0, +0x9B40, 0, 0, 0, 0,0x8D44, 0, 0, + 0,0x9B41,0x9440,0x94DC,0x96CF, 0, 0, 0, + 0, 0,0x9444, 0, 0,0x9B4A, 0, 0, + 0, 0, 0,0x8B57, 0, 0,0x9764, 0, + 0,0x96AD, 0,0x9BAA, 0,0x9B42, 0, 0, + 0, 0, 0,0x9B45, 0,0x91C3, 0, 0, +0x9657, 0, 0, 0,0x9369, 0, 0, 0, + 0, 0,0x9B46, 0, 0, 0, 0, 0, + 0,0x9685, 0,0x8DC8, 0, 0,0x8FA8, 0, + 0, 0, 0, 0, 0, 0,0x9B47, 0, + 0,0x8E6F, 0,0x8E6E, 0, 0, 0, 0, +0x88B7,0x8CC6, 0,0x90A9,0x88CF, 0, 0, 0, + 0,0x9B4B,0x9B4C, 0,0x9B49, 0, 0, 0, + 0, 0, 0, 0, 0,0x8957,0x8AAD, 0, +0x9B48, 0,0x96C3,0x9550, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x88A6, 0, + 0, 0, 0,0x88F7, 0, 0, 0,0x8E70, + 0,0x88D0, 0,0x88A1, 0, 0, 0, 0, + 0,0x9B51, 0, 0, 0, 0, 0, 0, + 0,0x9B4F, 0, 0, 0, 0, 0, 0, +0x96BA, 0,0x9B52, 0,0x9B50, 0, 0,0x9B4E, +0x9050, 0, 0, 0, 0,0x9B4D, 0, 0, + 0,0x95D8, 0, 0, 0, 0, 0,0x8CE2, + 0, 0, 0, 0, 0,0x9B56,0x9B57, 0, + 0, 0, 0, 0,0x8FA9, 0, 0, 0, +0x9B53,0x984B, 0, 0, 0, 0,0x946B, 0, + 0,0x9B55, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8DA5, 0, 0, 0, 0, 0, + 0, 0,0x9B58, 0, 0, 0,0x9577, 0, + 0, 0,0x9B59, 0,0x9B54, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x96B9, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x947D, 0, 0, 0, 0, 0, + 0, 0,0x9B5A,0x9551, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9B5B,0x9B5F,0x9B5C, 0, + 0,0x89C5,0x9B5E, 0, 0, 0, 0, 0, + 0,0x8EB9, 0,0x9B5D,0x8C99, 0, 0, 0, +0x9B6B, 0, 0, 0, 0, 0,0x9B64,0x9B61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9284, 0,0x9B60, 0, 0,0x9B62, 0, + 0,0x9B63, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9B65,0x9B66, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AF0, 0,0x9B68,0x9B67, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9B69, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8FEC, 0, 0, 0, 0, 0, + 0, 0,0x9B6C, 0,0x92DA, 0, 0, 0, +0x8964, 0,0x9B6A, 0, 0, 0,0x9B6D, 0, + 0, 0, 0, 0, 0, 0,0x9B6E, 0, +0x9B71, 0, 0,0x9B6F, 0,0x9B70, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8E71,0x9B72, 0, 0,0x8D45,0x9B73, 0,0x8E9A, +0x91B6, 0,0x9B74,0x9B75,0x8E79,0x8D46, 0,0x96D0, + 0, 0, 0,0x8B47,0x8CC7,0x9B76,0x8A77, 0, + 0,0x9B77, 0,0x91B7, 0, 0, 0, 0, +0x9B78,0x9BA1, 0,0x9B79, 0,0x9B7A, 0, 0, +0x9B7B, 0,0x9B7D, 0, 0, 0, 0, 0, +0x9B7E, 0, 0,0x9B80, 0,0x91EE, 0,0x8946, +0x8EE7,0x88C0, 0,0x9176,0x8AAE,0x8EB3, 0,0x8D47, + 0, 0, 0, 0, 0,0x9386, 0,0x8F40, +0x8AAF,0x9288,0x92E8,0x88B6,0x8B58,0x95F3, 0,0x8EC0, + 0, 0,0x8B71,0x90E9,0x8EBA,0x9747,0x9B81, 0, + 0, 0, 0, 0, 0, 0,0x8B7B, 0, +0x8DC9, 0, 0,0x8A51,0x8983,0x8FAA,0x89C6, 0, +0x9B82,0x9765, 0, 0, 0, 0, 0,0x8F68, + 0, 0,0x8EE2,0x9B83,0x8AF1,0x93D0,0x96A7,0x9B84, + 0,0x9B85, 0, 0,0x9578, 0, 0, 0, +0x9B87, 0,0x8AA6,0x8BF5,0x9B86, 0, 0, 0, + 0, 0, 0,0x8AB0, 0,0x9051,0x9B8B,0x8E40, + 0,0x89C7,0x9B8A, 0,0x9B88,0x9B8C,0x9B89,0x944A, +0x9ECB,0x9052, 0,0x9B8D, 0, 0,0x97BE, 0, +0x9B8E, 0, 0,0x9B90, 0,0x929E,0x9B8F, 0, +0x90A1, 0,0x8E9B, 0, 0, 0,0x91CE,0x8EF5, + 0,0x9595,0x90EA, 0,0x8ECB,0x9B91,0x8FAB,0x9B92, +0x9B93,0x88D1,0x91B8,0x9071, 0,0x9B94,0x93B1,0x8FAC, + 0,0x8FAD, 0,0x9B95, 0, 0,0x90EB, 0, + 0, 0,0x8FAE, 0, 0, 0, 0, 0, +0x9B96, 0,0x9B97, 0,0x96DE, 0, 0, 0, +0x9B98, 0, 0, 0, 0,0x8BC4, 0, 0, + 0,0x8F41, 0, 0, 0, 0, 0, 0, +0x9B99,0x9B9A,0x8EDA,0x904B,0x93F2,0x9073,0x94F6,0x9441, +0x8BC7,0x9B9B, 0, 0, 0,0x8B8F,0x9B9C, 0, +0x8BFC, 0,0x93CD,0x89AE, 0,0x8E72,0x9B9D,0x9BA0, +0x9B9F,0x8BFB, 0,0x9B9E, 0,0x9357, 0, 0, + 0, 0, 0, 0, 0, 0,0x91AE, 0, +0x936A,0x8EC6, 0, 0,0x9177,0x979A, 0, 0, + 0, 0, 0, 0,0x9BA2, 0,0x9BA3,0x93D4, + 0,0x8E52, 0, 0, 0, 0,0x9BA5, 0, + 0,0x9BA6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9BA7, 0, 0, 0, +0x8AF2,0x9BA8, 0, 0,0x9BA9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x89AA, 0, 0, 0, 0, 0, 0, +0x915A,0x8AE2, 0,0x9BAB,0x96A6, 0, 0, 0, + 0,0x91D0, 0,0x8A78, 0, 0,0x9BAD,0x9BAF, +0x8ADD, 0, 0,0x9BAC,0x9BAE, 0,0x9BB1, 0, + 0, 0, 0, 0, 0,0x9BB0, 0,0x9BB2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9BB3, 0, 0, 0, 0, 0, 0, +0x93BB,0x8BAC, 0, 0, 0, 0, 0, 0, +0x89E3,0x9BB4,0x9BB9, 0, 0,0x9BB7, 0,0x95F5, +0x95F4, 0, 0, 0, 0, 0,0x9387, 0, + 0, 0,0x9BB6,0x8F73, 0,0x9BB5, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9092, + 0, 0, 0,0x9BBA, 0, 0,0x8DE8, 0, + 0,0x9BC0, 0, 0,0x9BC1,0x9BBB,0x8A52,0x9BBC, +0x9BC5,0x9BC4,0x9BC3,0x9BBF, 0, 0, 0,0x9BBE, + 0, 0,0x9BC2, 0, 0, 0, 0, 0, + 0,0x95F6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9BC9,0x9BC6, 0,0x9BC8, 0, +0x9792, 0,0x9BC7, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9BBD, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9093, 0, 0,0x9BCA, 0, 0,0x8DB5, + 0, 0, 0,0x9BCB, 0, 0,0x9BCC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9BCF, 0,0x9BCE, 0, 0,0x9BCD, + 0, 0, 0,0x9388,0x9BB8, 0, 0, 0, +0x9BD5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9BD1, 0, 0, + 0, 0,0x9BD0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9BD2, 0,0x9BD3, 0, + 0, 0, 0, 0, 0, 0, 0,0x9BD6, + 0, 0,0x97E4, 0,0x9BD7,0x9BD4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9BD8, 0, 0,0x8ADE,0x9BD9, 0, 0, + 0, 0,0x9BDB,0x9BDA, 0, 0,0x9BDC, 0, + 0, 0, 0,0x9BDD, 0,0x90EC,0x8F42, 0, + 0,0x8F84, 0,0x9183, 0,0x8D48,0x8DB6,0x8D49, +0x8B90, 0, 0,0x9BDE, 0, 0,0x8DB7, 0, + 0,0x8CC8,0x9BDF,0x96A4,0x9462,0x9BE0, 0,0x8D4A, + 0, 0, 0,0x8AAA, 0,0x9246,0x8BD0, 0, + 0, 0,0x8E73,0x957A, 0, 0,0x94BF, 0, + 0, 0, 0,0x9BE1,0x8AF3, 0, 0, 0, + 0,0x9BE4, 0, 0, 0, 0,0x929F, 0, + 0,0x9BE3,0x9BE2,0x9BE5, 0,0x92E9, 0, 0, + 0, 0, 0, 0, 0,0x9083, 0, 0, + 0, 0, 0,0x8E74, 0,0x90C8, 0,0x91D1, +0x8B41, 0, 0,0x92A0, 0, 0,0x9BE6,0x9BE7, +0x8FED, 0, 0, 0, 0,0x9658, 0, 0, +0x9BEA, 0, 0,0x9BE9,0x9BE8,0x959D, 0,0x9BF1, + 0, 0, 0, 0,0x9679, 0,0x9BEB, 0, + 0, 0, 0, 0,0x9BED,0x968B, 0,0x9BEC, + 0, 0, 0, 0, 0, 0, 0,0x9BEE, + 0,0x94A6,0x9BEF,0x95BC,0x9BF0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8AB1,0x95BD,0x944E,0x9BF2,0x9BF3, 0, +0x8D4B,0x8AB2,0x9BF4,0x8CB6,0x9763,0x9748,0x8AF4,0x9BF6, + 0,0x92A1, 0,0x8D4C,0x8FAF, 0, 0,0x94DD, + 0, 0,0x8FB0, 0, 0, 0, 0,0x8F98, + 0, 0, 0, 0, 0,0x92EA,0x95F7,0x9358, + 0, 0,0x8D4D, 0,0x957B, 0, 0, 0, +0x9BF7, 0, 0, 0, 0, 0,0x9378,0x8DC0, + 0, 0, 0,0x8CC9, 0,0x92EB, 0, 0, + 0, 0, 0, 0, 0,0x88C1,0x8F8E,0x8D4E, +0x9766, 0, 0, 0, 0, 0, 0, 0, + 0,0x9BF8,0x9BF9,0x9470, 0, 0, 0, 0, +0x9BFA,0x97F5,0x984C, 0, 0, 0, 0,0x9BFC, +0x9BFB, 0, 0,0x8A66, 0, 0,0x9C40, 0, + 0, 0,0x9C43,0x9C44, 0,0x9C42, 0,0x955F, +0x8FB1,0x9C46,0x9C45,0x9C41, 0, 0, 0, 0, +0x9C47,0x9C48, 0, 0,0x9C49, 0, 0, 0, +0x9C4C,0x9C4A, 0,0x9C4B,0x9C4D, 0,0x8984,0x92EC, +0x9C4E, 0,0x8C9A,0x89F4,0x9455, 0,0x9C4F,0x93F9, + 0,0x95D9, 0,0x9C50,0x984D, 0, 0, 0, + 0,0x9C51,0x95BE,0x9C54,0x989F,0x98AF, 0,0x8EAE, +0x93F3,0x9C55, 0,0x8B7C,0x92A2,0x88F8,0x9C56,0x95A4, +0x8D4F, 0, 0,0x926F, 0, 0, 0,0x92ED, + 0, 0, 0, 0, 0,0x96ED,0x8CB7,0x8CCA, + 0,0x9C57, 0, 0, 0,0x9C58, 0,0x9C5E, + 0,0x8EE3, 0, 0, 0,0x92A3, 0,0x8BAD, +0x9C59, 0, 0, 0,0x954A, 0,0x9265, 0, + 0,0x9C5A, 0, 0, 0, 0, 0, 0, +0x9C5B, 0,0x8BAE, 0,0x9C5C, 0,0x9C5D, 0, + 0,0x9C5F, 0,0x9396, 0, 0,0x9C60,0x9C61, + 0,0x9C62, 0, 0,0x9C53,0x9C52, 0, 0, + 0,0x9C63,0x8C60, 0, 0, 0,0x9546, 0, + 0,0x8DCA,0x9556,0x92A4,0x956A,0x9C64, 0, 0, +0x8FB2,0x8965, 0,0x9C65, 0, 0, 0,0x9C66, + 0,0x96F0, 0, 0,0x94DE, 0, 0,0x9C69, +0x899D,0x90AA,0x9C68,0x9C67,0x8C61,0x91D2, 0,0x9C6D, +0x9C6B, 0,0x9C6A,0x97A5,0x8CE3, 0, 0, 0, +0x8F99,0x9C6C,0x936B,0x8F5D, 0, 0, 0,0x93BE, +0x9C70,0x9C6F, 0, 0, 0, 0,0x9C6E, 0, +0x9C71,0x8CE4, 0, 0, 0, 0, 0, 0, +0x9C72,0x959C,0x8F7A, 0, 0,0x9C73,0x94F7, 0, + 0, 0, 0,0x93BF,0x92A5, 0, 0, 0, + 0,0x934F, 0, 0,0x9C74,0x8B4A, 0, 0, + 0, 0, 0,0x9053, 0,0x954B, 0, 0, + 0, 0, 0, 0,0x8AF5,0x9445, 0, 0, + 0, 0, 0, 0, 0, 0,0x9C75,0x8E75, +0x9659,0x965A, 0, 0,0x899E,0x9C7A, 0, 0, +0x9289, 0, 0, 0,0x9C77, 0, 0, 0, + 0, 0, 0,0x89F5, 0, 0, 0, 0, +0x9CAB,0x9C79, 0, 0, 0,0x944F, 0, 0, +0x9C78, 0, 0,0x9C76, 0,0x8D9A, 0,0x9C7C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9C83,0x9C89, +0x9C81, 0,0x937B, 0, 0,0x9C86,0x957C, 0, + 0,0x9C80, 0,0x9C85,0x97E5,0x8E76, 0, 0, +0x91D3,0x9C7D, 0, 0, 0,0x8B7D,0x9C88,0x90AB, +0x8985,0x9C82,0x89F6,0x9C87, 0, 0, 0,0x8BAF, + 0,0x9C84, 0, 0, 0, 0, 0, 0, + 0, 0,0x9C8A, 0, 0, 0, 0, 0, + 0,0x9C8C,0x9C96,0x9C94, 0, 0,0x9C91, 0, + 0, 0,0x9C90,0x97F6, 0,0x9C92, 0, 0, +0x8BB0, 0,0x8D50, 0, 0,0x8F9A, 0, 0, + 0,0x9C99,0x9C8B, 0, 0, 0, 0,0x9C8F, +0x9C7E, 0,0x89F8,0x9C93,0x9C95,0x9270, 0, 0, +0x8DA6,0x89B6,0x9C8D,0x9C98,0x9C97,0x8BB1, 0,0x91A7, +0x8A86, 0, 0, 0, 0,0x8C62, 0,0x9C8E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9C9A, 0,0x9C9D,0x9C9F, 0, 0, 0, + 0,0x8EBB, 0,0x9CA5,0x92EE,0x9C9B, 0, 0, + 0, 0,0x9CA3, 0,0x89F7, 0,0x9CA1,0x9CA2, + 0, 0,0x9C9E,0x9CA0, 0, 0, 0,0x8CE5, +0x9749, 0, 0,0x8AB3, 0, 0,0x8978,0x9CA4, + 0,0x9459,0x88AB, 0, 0, 0, 0, 0, + 0, 0,0x94DF,0x9C7B,0x9CAA,0x9CAE,0x96E3, 0, +0x9CA7, 0, 0, 0,0x9389,0x9CAC, 0, 0, + 0, 0, 0, 0, 0,0x8FEE,0x9CAD,0x93D5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9866, 0,0x9CA9, 0, 0, 0, 0, +0x9CAF, 0,0x8D9B, 0,0x90C9, 0, 0,0x88D2, +0x9CA8,0x9CA6, 0,0x9179, 0, 0, 0,0x9C9C, +0x8E53, 0, 0, 0, 0, 0, 0, 0, +0x91C4,0x9CBB, 0,0x917A,0x9CB6, 0,0x9CB3,0x9CB4, + 0,0x8EE4,0x9CB7,0x9CBA, 0, 0, 0, 0, +0x9CB5,0x8F44, 0,0x9CB8, 0, 0,0x9CB2, 0, +0x96FA,0x96F9, 0, 0, 0,0x9CBC,0x9CBD,0x88D3, + 0, 0, 0, 0, 0,0x9CB1, 0, 0, + 0, 0,0x8BF0,0x88A4, 0, 0, 0,0x8AB4, + 0,0x9CB9, 0, 0, 0, 0, 0,0x9CC1, +0x9CC0, 0, 0, 0,0x9CC5, 0, 0, 0, + 0, 0, 0, 0,0x9CC6, 0, 0, 0, + 0, 0, 0, 0,0x9CC4,0x9CC7,0x9CBF,0x9CC3, + 0, 0,0x9CC8, 0,0x9CC9, 0, 0,0x9CBE, +0x8E9C, 0,0x9CC2,0x91D4,0x8D51,0x9CB0,0x9054, 0, + 0, 0, 0,0x9CD6, 0,0x95E7, 0, 0, +0x9CCC,0x9CCD,0x9CCE, 0, 0,0x9CD5, 0,0x9CD4, + 0, 0,0x969D,0x8AB5, 0,0x9CD2, 0,0x8C64, +0x8A53, 0, 0,0x9CCF, 0, 0,0x97B6,0x9CD1, +0x88D4,0x9CD3, 0,0x9CCA,0x9CD0,0x9CD7,0x8C63,0x9CCB, + 0, 0, 0, 0, 0, 0,0x977C, 0, + 0, 0,0x974A, 0, 0, 0, 0,0x9CDA, + 0, 0,0x9CDE, 0, 0, 0,0x919E, 0, +0x97F7,0x9CDF, 0, 0,0x9CDC, 0,0x9CD9, 0, + 0,0x9CD8,0x9CDD, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x95AE, 0, 0,0x93B2, + 0,0x8C65, 0,0x9CE0,0x9CDB, 0,0x9CE1, 0, + 0, 0,0x8C9B, 0, 0, 0,0x89AF, 0, + 0, 0,0x9CE9, 0, 0, 0,0x8AB6, 0, + 0, 0, 0,0x9CE7, 0, 0,0x9CE8,0x8DA7, +0x9CE6,0x9CE4,0x9CE3,0x9CEA,0x9CE2,0x9CEC, 0, 0, +0x89F9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9CEE, 0, 0,0x9CED, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x92A6, 0,0x9CF1, 0,0x9CEF,0x9CE5, +0x8C9C, 0,0x9CF0, 0,0x9CF4,0x9CF3,0x9CF5,0x9CF2, +0x9CF6, 0, 0, 0, 0, 0, 0, 0, +0x9CF7,0x9CF8,0x95E8, 0,0x9CFA,0x9CF9,0x8F5E, 0, +0x90AC,0x89E4,0x89FA, 0,0x9CFB, 0,0x88BD, 0, + 0, 0,0x90CA,0x9CFC, 0,0xE6C1,0x9D40,0x8C81, + 0,0x9D41, 0, 0, 0, 0,0x90ED, 0, + 0, 0,0x9D42, 0, 0, 0,0x9D43,0x8B59, +0x9D44, 0,0x9D45,0x9D46,0x91D5, 0, 0, 0, +0x8CCB, 0, 0,0x96DF, 0, 0, 0,0x965B, +0x8F8A,0x9D47, 0, 0, 0, 0, 0,0x90EE, +0xE7BB,0x94E0, 0,0x8EE8, 0,0x8DCB,0x9D48, 0, + 0, 0, 0,0x91C5, 0,0x95A5, 0, 0, +0x91EF, 0, 0,0x9D4B, 0, 0,0x9D49, 0, +0x9D4C, 0, 0,0x9D4A, 0, 0, 0, 0, +0x9D4D, 0, 0, 0, 0, 0,0x95AF, 0, + 0,0x88B5, 0, 0, 0, 0,0x957D, 0, + 0,0x94E1, 0, 0,0x9D4E, 0,0x9D51,0x8FB3, +0x8B5A, 0,0x9D4F,0x9D56,0x8FB4, 0, 0, 0, + 0,0x9D50,0x9463, 0, 0, 0, 0, 0, + 0,0x977D,0x9D52,0x9D53,0x9D57,0x938A,0x9D54,0x8D52, +0x90DC, 0, 0,0x9D65,0x94B2, 0,0x91F0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x94E2,0x9DAB, 0, 0, 0, + 0,0x95F8, 0, 0, 0,0x92EF, 0, 0, + 0,0x9695, 0,0x9D5A,0x899F,0x928A, 0, 0, + 0, 0,0x9D63, 0, 0,0x9253,0x9D5D,0x9D64, +0x9D5F,0x9D66,0x9D62, 0,0x9D61,0x948F, 0,0x9D5B, +0x89FB,0x9D59,0x8B91,0x91F1,0x9D55, 0, 0,0x9D58, +0x8D53,0x90D9, 0,0x8FB5,0x9D60,0x9471, 0, 0, +0x8B92,0x8A67, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8A87,0x9040,0x9D68,0x9D6D, + 0,0x9D69, 0,0x8C9D, 0,0x9D6E,0x8E41,0x8D89, + 0, 0, 0, 0, 0, 0,0x8F45,0x9D5C, + 0,0x8E9D,0x9D6B, 0, 0, 0, 0,0x8E77, +0x9D6C,0x88C2, 0, 0,0x9D67, 0, 0, 0, + 0,0x92A7, 0, 0, 0, 0, 0, 0, + 0,0x8B93, 0, 0, 0, 0, 0,0x8BB2, + 0, 0, 0, 0, 0, 0, 0,0x9D6A, +0x88A5, 0, 0,0x8DC1, 0, 0, 0,0x9055, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x92F0, 0, 0,0x94D2,0x9D70,0x917D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x91A8, 0, 0,0x8E4A,0x9D71, 0,0x9D73, +0x9D6F, 0, 0, 0, 0,0x95DF, 0,0x92BB, + 0, 0, 0, 0,0x917B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x95F9, +0x8ECC,0x9D80, 0,0x9D7E, 0, 0,0x9098, 0, + 0, 0,0x8C9E, 0, 0, 0,0x9D78,0x8FB7, + 0, 0,0x93E6,0x9450, 0, 0, 0, 0, +0x9D76, 0, 0,0x917C, 0, 0, 0, 0, +0x8EF6,0x9D7B, 0, 0,0x8FB6, 0,0x9D75,0x9D7A, + 0, 0,0x9472, 0, 0, 0,0x9D74, 0, +0x8C40, 0, 0,0x8A7C, 0, 0, 0,0x9D7C, +0x97A9,0x8DCC,0x9254,0x9D79, 0,0x90DA, 0,0x8D54, +0x9084,0x8986,0x915B,0x9D77,0x8B64, 0, 0, 0, + 0, 0,0x8C66, 0,0x92CD,0x9D7D, 0, 0, + 0, 0, 0,0x917E, 0, 0,0x9D81, 0, +0x9D83, 0, 0,0x91B5,0x9D89, 0,0x9D84, 0, + 0,0x9D86, 0, 0, 0, 0, 0,0x9560, +0x92F1, 0,0x9D87, 0, 0, 0,0x974B, 0, + 0, 0,0x9767,0x8AB7, 0, 0, 0, 0, + 0,0x88AC, 0,0x9D85, 0, 0, 0, 0, + 0,0x9D82, 0, 0, 0, 0,0x8AF6, 0, + 0, 0, 0, 0,0x8987, 0,0x9D88, 0, + 0, 0,0x9768, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9D8C, 0, + 0, 0, 0, 0, 0,0x91B9, 0,0x9D93, + 0, 0, 0,0x9D8D, 0, 0,0x9D8A,0x9D91, + 0, 0, 0, 0,0x9D72, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9D8E, 0, +0x9D92, 0, 0, 0,0x94C0,0x938B, 0, 0, + 0, 0, 0, 0,0x9D8B, 0,0x9D8F, 0, + 0, 0,0x8C67, 0, 0, 0,0x8DEF, 0, + 0, 0,0x90DB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9D97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9345, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9D94, + 0,0x9680, 0, 0, 0, 0, 0,0x9D95, + 0, 0, 0, 0, 0, 0,0x9D96, 0, +0x96CC, 0,0x90A0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8C82, 0, 0, 0, 0, +0x9D9D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8E54,0x9D9A, 0,0x9D99, 0, 0, + 0, 0,0x9451, 0, 0, 0,0x93B3, 0, + 0, 0, 0, 0,0x9350,0x9D9B, 0, 0, + 0,0x9D9C, 0,0x958F, 0,0x9464,0x8E42, 0, +0x90EF, 0,0x966F, 0, 0, 0, 0, 0, + 0,0x8A68, 0,0x9DA3,0x9D9E, 0, 0, 0, + 0,0x9769,0x9DA5, 0, 0,0x9DA1, 0,0x9DA2, + 0, 0, 0, 0, 0,0x9180, 0, 0, + 0, 0,0x9DA0, 0,0x9D5E, 0, 0, 0, +0x9DA4, 0,0x9D9F, 0, 0, 0, 0, 0, +0x9DA9,0x9DAA,0x9346,0x9DAC, 0, 0,0x8E43,0x9DA7, + 0, 0, 0, 0,0x8B5B, 0, 0,0x9DAD, + 0,0x9DA6,0x9DB1, 0,0x9DB0, 0,0x9DAF, 0, + 0, 0,0x9DB2, 0, 0,0x9DB4,0x8FEF, 0, +0x9DB3, 0, 0, 0, 0,0x9DB7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9DB5, 0, 0, 0,0x9DB6,0x9D90, 0, 0, + 0, 0, 0,0x9DB9,0x9DB8, 0, 0, 0, + 0, 0,0x9D98,0x9DBA,0x9DAE, 0, 0,0x8E78, + 0, 0, 0, 0,0x9DBB,0x9DBC,0x9DBE,0x9DBD, +0x9DBF,0x89FC, 0,0x8D55, 0, 0,0x95FA,0x90AD, + 0, 0, 0, 0, 0,0x8CCC, 0, 0, +0x9DC1, 0, 0, 0, 0,0x9DC4, 0,0x9571, + 0,0x8B7E, 0, 0, 0,0x9DC3,0x9DC2,0x9473, +0x9DC5,0x8BB3, 0, 0, 0,0x9DC7,0x9DC6, 0, + 0, 0,0x8AB8,0x8E55, 0, 0,0x93D6, 0, + 0, 0, 0, 0,0x8C68, 0, 0, 0, +0x9094, 0,0x9DC8, 0,0x90AE,0x9347, 0,0x957E, +0x9DC9, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9DCA,0x9DCB, 0, 0, 0,0x95B6, +0x9B7C,0x90C4, 0, 0,0x956B, 0,0x8DD6, 0, +0x94E3,0x94C1, 0, 0, 0, 0, 0,0x936C, + 0,0x97BF, 0,0x9DCD,0x8ECE, 0, 0,0x9DCE, + 0,0x88B4, 0, 0,0x8BD2,0x90CB, 0,0x9580, + 0, 0, 0,0x9DCF,0x8E61,0x9266, 0,0x8E7A, +0x9056, 0, 0, 0, 0, 0, 0,0x9DD0, + 0,0x95FB, 0, 0,0x8997,0x8E7B, 0, 0, + 0,0x9DD3, 0,0x9DD1,0x9DD4,0x97B7,0x9DD2, 0, + 0, 0, 0,0x90F9,0x9DD5, 0, 0,0x91B0, + 0, 0,0x9DD6, 0, 0, 0, 0,0x8AF8, + 0,0x9DD8, 0,0x9DD7, 0, 0, 0, 0, +0x9DD9,0x9DDA,0x8AF9, 0, 0,0x93FA,0x9255,0x8B8C, +0x8E7C,0x9181, 0, 0,0x8F7B,0x88AE, 0, 0, + 0,0x9DDB, 0, 0, 0, 0, 0, 0, + 0, 0,0x89A0,0x9DDF, 0, 0, 0, 0, + 0, 0,0x8D56,0x9DDE, 0, 0,0x8DA9,0x8FB8, + 0, 0,0x9DDD, 0,0x8FB9, 0,0x96BE,0x8DA8, + 0, 0, 0,0x88D5,0x90CC, 0, 0, 0, + 0, 0, 0, 0,0x9DE4, 0, 0,0x90AF, +0x8966, 0, 0, 0, 0,0x8F74, 0,0x9686, +0x8DF0, 0, 0, 0, 0,0x8FBA, 0,0x90A5, + 0, 0, 0, 0,0x9DE3,0x9DE1,0x9DE2, 0, + 0, 0, 0, 0,0x928B, 0, 0,0x9E45, + 0,0x9DE8,0x8E9E,0x8D57,0x9DE6, 0, 0, 0, + 0,0x9DE7, 0,0x9057, 0, 0, 0,0x9DE5, + 0, 0,0x8E4E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9DEA,0x9DE9,0x9DEE, + 0, 0,0x9DEF, 0,0x9DEB, 0,0x8A41,0x9DEC, +0x9DED,0x94D3, 0, 0, 0, 0,0x9581,0x8C69, +0x9DF0, 0, 0, 0,0x90B0, 0,0x8FBB, 0, + 0, 0,0x9271, 0, 0, 0, 0, 0, + 0,0x8BC5, 0,0x9DF1,0x9DF5, 0, 0,0x89C9, +0x9DF2,0x9DF4, 0, 0, 0, 0,0x9DF3, 0, + 0,0x8F8B, 0, 0, 0, 0,0x9267,0x88C3, +0x9DF6, 0, 0, 0, 0,0x9DF7, 0, 0, + 0, 0,0x92A8, 0, 0, 0,0x97EF, 0, + 0, 0, 0,0x8E62, 0, 0,0x95E9, 0, + 0, 0, 0, 0,0x965C, 0, 0, 0, +0x9E41,0x9DF9, 0, 0,0x9DFC, 0,0x9DFB, 0, + 0,0x9DF8, 0, 0,0x9E40, 0, 0,0x93DC, + 0,0x9DFA, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9E42, 0, + 0,0x8F8C,0x9E43, 0,0x976A,0x9498, 0, 0, +0x9E44, 0, 0, 0, 0, 0,0x9E46, 0, + 0,0x9E47, 0, 0, 0, 0, 0, 0, +0x9E48, 0,0x8BC8,0x8967,0x8D58,0x9E49, 0,0x9E4A, +0x8F91,0x9182, 0, 0,0x99D6,0x915D,0x915C,0x91D6, +0x8DC5, 0, 0,0x98F0, 0, 0, 0, 0, +0x8C8E,0x974C, 0,0x95FC, 0,0x959E, 0,0x9E4B, + 0, 0, 0, 0,0x8DF1,0x92BD,0x9E4C,0x984E, + 0, 0, 0,0x965D, 0,0x92A9,0x9E4D,0x8AFA, + 0, 0, 0, 0, 0, 0,0x9E4E,0x9E4F, +0x96D8, 0,0x96A2,0x9696,0x967B,0x8E44,0x9E51, 0, + 0,0x8EE9, 0, 0,0x9670, 0,0x9E53,0x9E56, +0x9E55, 0,0x8AF7, 0, 0,0x8B80, 0,0x9E52, + 0,0x9E54, 0, 0, 0, 0,0x9E57, 0, + 0,0x9099, 0, 0, 0, 0,0x979B,0x88C7, +0x8DDE,0x91BA, 0,0x8EDB, 0, 0,0x8FF1, 0, + 0,0x9E5A, 0, 0,0x936D, 0,0x9E58,0x91A9, +0x9E59,0x8FF0,0x96DB,0x9E5B,0x9E5C,0x9788, 0, 0, + 0, 0,0x9E61, 0, 0,0x8D59, 0,0x9474, +0x9E5E,0x938C,0x9DDC,0x9DE0, 0,0x8B6E, 0,0x9466, + 0, 0, 0, 0,0x9E60, 0,0x8FBC,0x94C2, + 0, 0, 0, 0, 0,0x9E66, 0,0x94F8, + 0,0x9E5D, 0,0x9E63,0x9E62, 0, 0, 0, +0x90CD, 0, 0, 0, 0,0x968D, 0,0x97D1, + 0, 0,0x9687, 0,0x89CA,0x8E7D, 0, 0, +0x9867,0x9E65,0x9095, 0, 0, 0,0x9E64, 0, + 0,0x9E5F, 0, 0, 0, 0, 0,0x8CCD, + 0, 0, 0,0x9E6B,0x9E69, 0,0x89CB,0x9E67, +0x9E6D,0x9E73, 0, 0, 0, 0, 0, 0, + 0,0x91C6, 0, 0,0x95BF, 0,0x9E75, 0, + 0, 0,0x9541, 0, 0, 0,0x9E74,0x9490, +0x965E,0x8AB9, 0,0x90F5,0x8F5F, 0, 0, 0, +0x92D1, 0,0x974D, 0, 0,0x9E70,0x9E6F, 0, + 0, 0,0x9E71, 0,0x9E6E, 0, 0,0x9E76, + 0,0x9E6C, 0, 0,0x9E6A, 0,0x9E72,0x9E68, + 0,0x928C, 0,0x96F6,0x8EC4,0x8DF2, 0, 0, + 0, 0, 0,0x8DB8, 0, 0,0x968F,0x8A60, + 0, 0,0x92CC,0x93C8,0x8968, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x90F0, 0, 0,0x90B2,0x8C49, + 0, 0, 0, 0, 0, 0,0x9E78, 0, + 0,0x8D5A,0x8A9C, 0, 0, 0, 0, 0, + 0,0x9E7A,0x8A94,0x9E81, 0, 0, 0, 0, + 0, 0,0x9E7D, 0,0x90F1, 0, 0, 0, +0x8A6A,0x8DAA, 0, 0,0x8A69,0x8DCD, 0, 0, +0x9E7B,0x8C85,0x8C6A,0x938D, 0, 0,0x9E79, 0, +0x88C4, 0, 0, 0, 0,0x9E7C,0x9E7E, 0, +0x8BCB,0x8C4B, 0,0x8ABA,0x8B6A, 0, 0, 0, + 0,0x9E82, 0, 0,0x8DF7,0x9691, 0,0x8E56, + 0, 0, 0,0x9E83, 0, 0, 0,0x954F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9E8F, 0,0x89B1,0x9E84, + 0, 0, 0, 0, 0, 0,0x9E95,0x9E85, + 0,0x97C0, 0,0x9E8C, 0,0x947E, 0, 0, + 0, 0, 0, 0, 0,0x9E94, 0,0x9E87, + 0, 0, 0,0x88B2,0x9E89, 0, 0,0x8D5B, + 0, 0, 0,0x9E8B, 0,0x9E8A, 0,0x9E86, +0x9E91, 0,0x8FBD, 0, 0, 0,0x9AEB,0x8CE6, +0x979C, 0, 0, 0, 0,0x9E88, 0,0x92F2, +0x8A42,0x8DAB, 0,0x9E80, 0,0x9E90,0x8A81, 0, + 0,0x9E8E,0x9E92, 0,0x938E, 0, 0, 0, + 0, 0, 0, 0,0x8AFC, 0,0x9EB0, 0, + 0,0x96C7,0x9E97,0x8AFB, 0,0x9E9E, 0, 0, + 0, 0,0x965F, 0,0x9E9F,0x9EA1, 0,0x9EA5, +0x9E99, 0,0x9249, 0, 0, 0, 0,0x938F, +0x9EA9,0x9E9C, 0,0x9EA6, 0, 0, 0,0x9EA0, + 0, 0, 0, 0, 0, 0,0x9058,0x9EAA, + 0, 0,0x90B1, 0, 0, 0, 0, 0, + 0,0x9EA8,0x8ABB, 0, 0, 0, 0, 0, +0x986F,0x9E96, 0, 0,0x9EA4,0x88D6, 0, 0, +0x9E98, 0, 0,0x96B8,0x9E9D,0x9041,0x92C5,0x9E93, + 0, 0,0x9EA3, 0, 0, 0, 0, 0, + 0,0x909A,0x9EAD,0x8A91,0x8C9F, 0, 0, 0, + 0,0x9EAF,0x9E9A,0x9EAE, 0,0x9EA7,0x9E9B, 0, +0x9EAB, 0,0x9EAC, 0, 0, 0, 0, 0, +0x9EBD, 0, 0, 0,0x93CC, 0,0x9EA2, 0, + 0,0x9EB9, 0, 0, 0,0x9EBB, 0,0x92D6, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x976B, 0, 0, 0, 0, 0, + 0, 0, 0,0x9596,0x9EB6,0x91C8, 0, 0, + 0,0x9EBC,0x915E, 0,0x9EB3,0x9EC0,0x9EBF, 0, +0x93ED,0x9EBE,0x93E8, 0, 0, 0, 0, 0, + 0, 0,0x9EC2,0x9EB5, 0,0x8BC6,0x9EB8,0x8F7C, + 0, 0, 0,0x9480,0x9EBA,0x8BC9, 0,0x9EB2, +0x9EB4,0x9EB1, 0, 0,0x984F,0x8A79,0x9EB7, 0, + 0,0x9EC1,0x8A54, 0, 0, 0, 0, 0, + 0, 0,0x8DE5, 0, 0, 0,0x897C, 0, + 0,0x9ED2, 0, 0,0x9850,0x9ED5, 0, 0, + 0, 0, 0,0x9059,0x9ED4, 0, 0, 0, +0x9ED3, 0, 0, 0, 0, 0, 0,0x9ED0, + 0, 0, 0, 0, 0, 0,0x9EC4, 0, + 0,0x9EE1,0x9EC3, 0,0x9ED6, 0, 0, 0, + 0, 0, 0,0x9ECE, 0, 0,0x9EC9,0x9EC6, + 0,0x9EC7, 0,0x9ECF, 0, 0, 0,0xEAA0, + 0, 0,0x9ECC,0x8D5C,0x92C6,0x9184,0x9ECA, 0, +0x9EC5, 0, 0,0x9EC8, 0, 0, 0, 0, +0x976C,0x968A, 0, 0, 0,0x9ECD,0x9ED7, 0, + 0, 0, 0, 0, 0, 0, 0,0x9EDF, +0x9ED8, 0, 0,0x9EE5, 0,0x9EE3, 0, 0, + 0, 0,0x9EDE, 0, 0, 0, 0, 0, + 0,0x9EDD, 0,0x92CE, 0,0x9185, 0,0x9EDB, + 0, 0,0x9ED9, 0, 0,0x9EE0, 0, 0, + 0, 0,0x9EE6,0x94F3,0x9EEC, 0, 0, 0, + 0, 0,0x9EE7,0x9EEA,0x9EE4, 0, 0,0x9294, + 0,0x9557, 0,0x9EDA, 0, 0,0x9EE2,0x8FBE, + 0,0x96CD,0x9EF6,0x9EE9, 0, 0, 0, 0, + 0,0x8CA0,0x89A1,0x8A7E, 0, 0,0x9ED1, 0, + 0, 0, 0, 0, 0,0x8FBF,0x9EEE, 0, +0x9EF5,0x8EF7,0x8A92, 0, 0,0x924D, 0, 0, + 0, 0, 0, 0,0x9EEB, 0, 0,0x9EF0, +0x9EF4, 0, 0,0x8BB4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B6B,0x9EF2, 0, 0, 0, 0, 0,0x8B40, + 0,0x93C9,0x9EF1, 0, 0, 0,0x9EF3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9EED, 0, 0, 0, 0, 0, +0x9EEF, 0, 0, 0, 0, 0, 0,0x8A80, +0x9268, 0, 0, 0,0x9EFA, 0, 0, 0, + 0, 0, 0, 0, 0,0x9EF8,0x8CE7, 0, +0x9EF7, 0, 0, 0, 0, 0, 0,0x9F40, + 0, 0, 0, 0,0x9E77, 0, 0, 0, +0x9EF9, 0,0x9EFB,0x9EFC, 0, 0, 0, 0, + 0, 0,0x9F4B, 0,0x9F47, 0,0x9E8D, 0, + 0, 0, 0,0x9F46, 0, 0, 0, 0, +0x9F45, 0, 0,0x9F42, 0, 0, 0, 0, + 0,0x9EE8,0x9F44,0x9F43, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9F49, 0,0x9845, 0, 0, 0, 0, + 0, 0,0x9F4C,0x8BF9, 0, 0,0x9F48,0x9F4A, + 0, 0, 0, 0, 0, 0, 0, 0, +0x94A5, 0,0x9F4D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9F51,0x9F4E, 0, 0, 0, 0, + 0, 0, 0, 0,0x9793,0x9F4F, 0, 0, + 0, 0,0x9EDC, 0, 0, 0, 0, 0, + 0, 0,0x9F52, 0, 0, 0,0x9F53, 0, + 0, 0, 0, 0, 0,0x8954, 0,0x9F55, +0x8C87,0x8E9F, 0,0x8BD3, 0, 0, 0,0x89A2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x977E, 0, 0, 0, 0,0x9F57, +0x9F56,0x9F59,0x8B5C, 0, 0,0x8BD4,0x8ABC, 0, + 0, 0, 0,0x9F5C, 0, 0, 0,0x9F5B, + 0,0x9F5D, 0, 0,0x89CC, 0,0x9256, 0, +0x9F5E, 0, 0,0x8ABD,0x9F60, 0, 0, 0, + 0,0x9F5F, 0,0x9F61, 0, 0, 0,0x9F62, + 0,0x9F63,0x8E7E,0x90B3,0x8D9F, 0,0x9590, 0, + 0,0x95E0,0x9863, 0, 0, 0, 0,0x8E95, + 0, 0, 0,0x8DCE,0x97F0, 0, 0, 0, +0x9F64,0x9F65, 0,0x8E80, 0, 0, 0,0x9F66, +0x9F67, 0, 0,0x9F69,0x9F68, 0,0x9677, 0, + 0,0x8F7D,0x8EEA,0x8E63, 0,0x9F6A, 0, 0, + 0, 0, 0, 0, 0,0x9F6C,0x9042, 0, +0x9F6B, 0, 0, 0, 0, 0,0x9F6D, 0, + 0, 0, 0, 0,0x9F6E, 0, 0, 0, + 0, 0,0x9F6F,0x9F70, 0, 0, 0,0x9F71, + 0,0x9F73,0x9F72,0x9F74,0x89A3,0x9269, 0,0x9F75, + 0, 0,0x8E45,0x8A6B,0x9F76, 0, 0,0x9361, +0x9ACA, 0, 0, 0, 0,0x8B42,0x9F77, 0, + 0, 0, 0,0x9F78, 0,0x95EA,0x9688, 0, + 0, 0,0x93C5,0x9F79,0x94E4, 0, 0, 0, +0x94F9, 0, 0,0x96D1, 0, 0, 0,0x9F7A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9F7C,0x9F7B, 0, 0,0x9F7E, + 0, 0, 0,0x9F7D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9F81, 0, 0, 0, 0, 0, 0,0x8E81, + 0,0x96AF, 0,0x9F82,0x9F83, 0, 0,0x8B43, + 0, 0, 0,0x9F84, 0, 0, 0, 0, + 0, 0, 0,0x9F86,0x9F85, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9085, 0, 0,0x9558, +0x8969, 0, 0, 0, 0, 0,0x94C3, 0, +0x92F3,0x8F60,0x8B81, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x94C4, 0, +0x8EAC, 0, 0, 0, 0,0x9F88, 0,0x8ABE, + 0, 0,0x8998, 0, 0,0x93F0,0x9F87,0x8D5D, +0x9272, 0,0x9F89, 0, 0, 0, 0, 0, +0x9F91, 0,0x9F8A, 0, 0, 0, 0, 0, +0x91BF, 0,0x8B82,0x9F92, 0, 0, 0, 0, + 0, 0,0x8C88, 0, 0,0x8B44,0x9F90, 0, + 0,0x9F8E,0x9F8B,0x9780, 0, 0, 0, 0, +0x92BE, 0, 0, 0,0x93D7,0x9F8C, 0, 0, +0x9F94, 0,0x9F93,0x8C42, 0, 0,0x89AB, 0, + 0,0x8DB9,0x9F8D,0x9F8F, 0, 0, 0, 0, + 0,0x9676,0x91F2, 0, 0, 0, 0, 0, + 0, 0, 0,0x9697, 0, 0,0x9F9C, 0, + 0,0x9F9D, 0,0x89CD, 0, 0, 0, 0, +0x95A6,0x96FB,0x9F9F,0x8EA1,0x8FC0,0x9F98,0x9F9E,0x8988, + 0,0x8BB5, 0, 0,0x9F95,0x9F9A, 0, 0, + 0,0x90F2,0x9491, 0,0x94E5, 0, 0, 0, + 0, 0, 0,0x9F97, 0,0x9640, 0,0x9F99, + 0,0x9FA2, 0,0x9FA0, 0,0x9F9B, 0, 0, + 0,0x9641,0x9467,0x8B83, 0,0x9344, 0, 0, +0x928D, 0,0x9FA3, 0, 0, 0, 0,0x9FA1, +0x91D7,0x9F96, 0,0x896A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x976D,0x9FAE, 0, 0, 0, + 0, 0,0x9FAD, 0, 0, 0, 0,0x90F4, + 0,0x9FAA, 0,0x978C, 0, 0,0x93B4,0x9FA4, + 0, 0, 0, 0, 0,0x92C3, 0, 0, + 0,0x896B,0x8D5E,0x9FA7, 0, 0, 0, 0, + 0, 0,0x8F46,0x9FAC, 0,0x9FAB,0x9FA6, 0, +0x9FA9, 0, 0,0x8A88, 0,0x9FA8,0x9468, 0, + 0,0x97AC, 0, 0,0x8FF2,0x90F3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9FB4,0x9FB2, 0,0x956C, 0, 0, 0, + 0, 0, 0,0x9FAF,0x9FB1, 0,0x8959, 0, + 0,0x8D5F,0x9851, 0,0x8A5C, 0,0x9582, 0, + 0, 0, 0, 0,0x9781, 0, 0,0x8A43, +0x905A,0x9FB3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9FB8, 0, 0, +0x8FC1, 0, 0, 0,0x974F, 0,0x9FB5, 0, + 0, 0, 0,0x9FB0, 0,0x9FB6, 0, 0, + 0,0x97DC, 0,0x9393,0x93C0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8A55, + 0, 0,0x8974, 0, 0,0x9FBC, 0, 0, +0x9FBF, 0, 0, 0,0x97C1, 0, 0, 0, +0x9784, 0, 0, 0, 0,0x9FC6,0x9FC0,0x9FBD, + 0, 0, 0,0x97D2,0x9FC3, 0, 0, 0, + 0,0x8F69,0x9FC5, 0, 0,0x9FCA, 0, 0, +0x9391,0x9FC8, 0, 0, 0, 0,0x9FC2, 0, + 0,0x9257, 0, 0,0x9FC9, 0,0x9FBE, 0, +0x9FC4, 0,0x9FCB,0x88FA,0x9FC1, 0,0x9FCC, 0, + 0,0x905B, 0,0x8F7E, 0,0x95A3, 0,0x8DAC, + 0,0x9FB9,0x9FC7,0x9359, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x90B4, 0,0x8A89, +0x8DCF,0x8FC2,0x9FBB,0x8F61, 0, 0, 0, 0, + 0, 0, 0,0x8C6B, 0,0x9FBA, 0, 0, + 0,0x9FD0,0x8F8D,0x8CB8, 0,0x9FDF, 0,0x9FD9, +0x8B94,0x936E, 0,0x9FD4,0x9FDD,0x88AD,0x8951, 0, + 0,0x89B7, 0,0x9FD6,0x91AA,0x9FCD,0x9FCF,0x8D60, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9FE0, 0,0x9FDB, 0, 0, 0,0x9FD3, 0, + 0, 0, 0,0x9FDA, 0, 0, 0, 0, + 0, 0,0x96A9, 0, 0,0x9FD8,0x9FDC, 0, + 0, 0, 0, 0, 0, 0,0x8CCE, 0, +0x8FC3, 0, 0,0x9258, 0, 0, 0,0x9FD2, + 0, 0, 0, 0, 0, 0, 0,0x974E, + 0, 0, 0,0x9FD5, 0, 0,0x9FCE,0x9392, + 0, 0,0x9FD1, 0, 0, 0,0x9FD7, 0, + 0, 0, 0, 0, 0, 0,0x9870,0x8EBC, +0x969E, 0,0x9FE1, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x94AC, 0, 0,0x9FED, +0x8CB9, 0, 0, 0, 0, 0,0x8F80, 0, +0x9FE3, 0, 0, 0,0x97AD,0x8D61, 0,0x9FF0, + 0, 0,0x88EC, 0, 0,0x9FEE, 0, 0, + 0, 0,0x9FE2, 0, 0, 0, 0,0x9FE8, + 0, 0,0x9FEA, 0, 0, 0,0x976E,0x9FE5, + 0, 0,0x934D, 0, 0,0x9FE7, 0, 0, + 0, 0,0x9FEF, 0,0x9FE9,0x96C5, 0, 0, + 0,0x9FE4, 0,0x8EA0,0x9FFC, 0, 0, 0, + 0,0x8A8A, 0,0x9FE6,0x9FEB,0x9FEC, 0, 0, + 0, 0, 0, 0, 0,0x91EA,0x91D8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9FF4, 0, 0,0x9FFA, + 0, 0,0x9FF8, 0,0x9348, 0, 0,0xE042, +0x9FF5, 0, 0, 0, 0, 0,0x9FF6,0x9FDE, + 0,0x8B99,0x9559, 0, 0, 0,0x8EBD, 0, + 0,0x8D97, 0, 0, 0, 0, 0,0x9852, + 0,0x9FF2, 0,0xE041,0x8989,0x9186, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9499, 0,0x8ABF,0x97F8, 0, 0, 0, 0, + 0, 0, 0,0x969F,0x92D0, 0, 0, 0, + 0,0x9FF9,0x9FFB, 0, 0, 0, 0, 0, +0x9151, 0, 0, 0, 0, 0,0xE040,0x9FF7, + 0,0x9FF1, 0, 0, 0,0x8AC1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8C89, 0, 0, 0, +0xE04E, 0, 0,0xE049,0x90F6, 0, 0,0x8A83, + 0, 0, 0, 0,0x8F81, 0,0xE052, 0, + 0, 0, 0, 0, 0,0xE04B,0x92AA,0xE048, +0x92D7, 0, 0, 0,0xE06B, 0, 0, 0, +0xE045, 0,0xE044, 0,0xE04D, 0, 0, 0, +0xE047,0xE046,0xE04C, 0,0x909F, 0,0xE043, 0, + 0, 0, 0, 0, 0, 0,0xE04F, 0, + 0,0xE050, 0, 0, 0, 0, 0,0x8AC0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE055, 0,0xE054,0xE056, 0, 0, 0, + 0, 0,0xE059, 0, 0, 0, 0, 0, + 0,0x9362, 0,0xE053, 0, 0, 0, 0, + 0,0xE057, 0, 0, 0, 0, 0, 0, +0x8C83,0x91F7,0xE051,0x945A, 0, 0,0xE058, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE05D,0xE05B, 0, 0, +0xE05E, 0, 0,0xE061, 0, 0, 0,0xE05A, +0x8D8A,0x9447, 0, 0,0x9FB7, 0, 0, 0, + 0, 0, 0,0x9794,0xE05C, 0,0xE060,0x91F3, + 0,0xE05F, 0,0xE04A, 0, 0,0xE889, 0, + 0, 0,0xE064, 0, 0, 0,0xE068, 0, + 0,0xE066, 0, 0, 0, 0, 0, 0, + 0,0xE062, 0,0xE063, 0, 0, 0,0xE067, + 0,0xE065, 0, 0, 0,0x956D, 0, 0, +0xE06D, 0,0xE06A,0xE069, 0,0xE06C,0x93D2,0xE06E, + 0, 0, 0, 0, 0, 0,0x9295,0x91EB, + 0, 0, 0, 0,0x90A3, 0, 0, 0, +0xE06F, 0,0xE071, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE070, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9FF3, 0, 0, 0, + 0,0xE072, 0, 0, 0, 0, 0, 0, +0x93E5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE073, 0, 0, 0, 0, + 0, 0, 0,0x89CE, 0, 0, 0,0x9394, +0x8A44, 0, 0, 0, 0, 0, 0, 0, +0x8B84, 0, 0, 0,0x8EDC,0x8DD0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9846,0x9086, 0, 0, 0,0x898A, 0, + 0, 0,0xE075, 0, 0, 0, 0, 0, + 0,0xE074, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE078,0x9259,0xE07B,0xE076, + 0, 0, 0,0xE07A, 0, 0, 0, 0, +0xE079,0x935F,0x88D7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x97F3, 0, 0,0xE07D, 0, 0, 0,0x8947, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE080, 0, 0, 0,0xE07E, 0,0xE07C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE077, 0, 0, 0, 0, 0, 0, + 0,0x9642, 0, 0, 0,0xE082, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE081, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x898B, 0, 0, 0, + 0,0xE084,0x95B0, 0,0xE083, 0, 0, 0, + 0,0x96B3, 0, 0, 0, 0,0x8FC5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9152, 0, + 0, 0, 0, 0,0x8FC4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x97F9, 0, 0,0xE08A, 0,0x90F7, 0, + 0, 0, 0, 0, 0,0xE086,0xE08B, 0, + 0,0x898C, 0, 0, 0, 0, 0, 0, + 0, 0,0xE089, 0,0x9481,0xE085,0xE088,0x8FC6, + 0,0x94CF, 0, 0,0xE08C, 0,0x8ECF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x90F8, 0, 0, + 0, 0, 0, 0,0xE08F, 0, 0, 0, +0xE087, 0,0x8C46, 0, 0, 0, 0,0xE08D, + 0, 0, 0, 0,0x976F,0xE090, 0, 0, + 0,0xEAA4, 0, 0, 0, 0, 0,0x8F6E, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE091, 0, 0, 0,0xE092, 0, 0, 0, + 0,0x944D, 0, 0, 0, 0, 0, 0, + 0,0xE094, 0, 0, 0, 0,0xE095, 0, + 0, 0, 0,0x9452, 0, 0, 0, 0, +0x9395,0xE097, 0, 0, 0, 0,0xE099, 0, +0x97D3, 0,0xE096, 0,0xE098,0x898D, 0,0xE093, + 0, 0, 0, 0, 0, 0, 0,0x9A7A, +0xE09A, 0, 0, 0, 0,0x9187,0x8E57,0xE09C, + 0, 0, 0, 0,0xE09B,0x9043,0x99D7, 0, + 0, 0, 0, 0, 0,0xE09D, 0, 0, + 0,0xE09F, 0,0xE08E,0xE09E, 0, 0,0xE0A0, + 0, 0, 0, 0, 0, 0,0x949A, 0, + 0, 0, 0, 0, 0,0xE0A1, 0, 0, +0xE0A2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE0A3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE0A4, 0,0x92DC, 0,0xE0A6,0xE0A5, 0, 0, +0xE0A7, 0,0xE0A8, 0, 0,0x8EDD,0x9583, 0, + 0, 0,0x96EA,0xE0A9,0xE0AA,0x9175,0x8EA2,0xE0AB, +0xE0AC, 0, 0, 0, 0, 0,0xE0AD,0x95D0, +0x94C5, 0, 0,0xE0AE,0x9476, 0, 0, 0, + 0, 0,0x92AB, 0, 0, 0, 0, 0, +0xE0AF,0x89E5, 0,0x8B8D, 0,0x96C4, 0,0x96B4, + 0,0x89B2,0x9853, 0, 0, 0, 0,0x9671, + 0,0x95A8, 0, 0, 0, 0, 0, 0, + 0, 0,0x90B5, 0,0xE0B0, 0, 0, 0, + 0,0x93C1, 0, 0, 0,0x8CA1,0xE0B1, 0, +0x8DD2,0xE0B3,0xE0B2, 0, 0, 0, 0,0xE0B4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0B5, 0, 0, 0,0xE0B6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8B5D, 0,0xE0B7, 0, 0, 0, 0,0xE0B8, + 0, 0, 0, 0,0x8CA2, 0, 0,0x94C6, + 0, 0,0xE0BA, 0, 0, 0,0x8FF3, 0, + 0,0xE0B9, 0, 0, 0, 0, 0, 0, + 0, 0,0x8BB6,0xE0BB,0xE0BD, 0,0xE0BC, 0, + 0, 0, 0, 0, 0, 0,0xE0BE, 0, +0x8CCF, 0,0xE0BF, 0, 0, 0, 0,0x8BE7, + 0,0x915F, 0,0x8D9D, 0, 0, 0, 0, +0xE0C1,0xE0C2,0xE0C0, 0, 0, 0, 0, 0, + 0,0x8EEB, 0, 0,0x93C6,0x8BB7, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE0C4, +0x924B,0xE0C3, 0, 0,0x9854,0x9482, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0C7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0C9,0xE0C6, + 0, 0, 0,0x96D2,0xE0C8,0xE0CA, 0,0x97C2, + 0, 0, 0, 0, 0,0xE0CE, 0, 0, + 0,0xE0CD,0x9296,0x944C, 0, 0,0x8CA3,0xE0CC, + 0, 0, 0, 0,0xE0CB, 0,0x9750,0x9751, + 0, 0, 0, 0, 0, 0,0xE0CF,0x898E, + 0, 0, 0, 0,0x8D96,0x8E82, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0D0,0xE0D1, + 0, 0, 0, 0, 0, 0, 0,0xE0D3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8F62, 0, 0, 0, 0, +0xE0D5, 0,0xE0D4, 0, 0, 0, 0, 0, +0xE0D6, 0,0x8A6C, 0, 0,0xE0D8, 0, 0, +0xE0D7, 0,0xE0DA,0xE0D9, 0, 0, 0, 0, + 0, 0, 0, 0,0x8CBA, 0, 0,0x97A6, + 0,0x8BCA, 0,0x89A4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8BE8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8ADF, 0, 0, 0, 0, 0, 0, + 0, 0,0x97E6,0xE0DC, 0, 0, 0, 0, + 0, 0, 0,0xE0DE, 0, 0, 0, 0, +0xE0DF, 0,0x89CF, 0, 0, 0, 0, 0, +0xE0DB, 0,0x8E58, 0, 0,0x92BF,0xE0DD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0E2, 0, +0x8EEC, 0, 0, 0, 0,0xE0E0, 0, 0, + 0, 0,0x8C5D, 0, 0,0x94C7,0xE0E1, 0, + 0,0xE0FC, 0, 0, 0, 0, 0, 0, +0xE0E7, 0, 0, 0, 0, 0,0x8CBB, 0, + 0, 0, 0,0x8B85, 0,0xE0E4,0x979D, 0, + 0,0x97AE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x91F4, 0, 0,0xE0E6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0E8,0x97D4,0x8BD5,0x94FA,0x9469, 0, + 0, 0,0xE0E9, 0, 0, 0, 0,0xE0EB, + 0,0xE0EE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE0EA, 0, 0, + 0,0xE0ED,0x8CE8,0x896C,0xE0EF, 0,0x9090,0xE0EC, +0x97DA, 0, 0,0xE0F2,0xEAA2, 0, 0, 0, + 0,0xE0F0,0xE0F3, 0, 0, 0, 0,0xE0E5, +0xE0F1, 0, 0,0x8DBA, 0, 0,0xE0F4, 0, + 0, 0, 0, 0, 0, 0,0xE0F5, 0, + 0, 0, 0,0x979E, 0, 0, 0, 0, + 0, 0, 0,0xE0F6, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE0F7, 0, + 0, 0,0xE0E3, 0, 0, 0, 0,0xE0F8, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8AC2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x8EA3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE0F9, 0, 0, 0, 0,0xE0FA, + 0, 0, 0, 0,0xE0FB, 0, 0, 0, + 0, 0, 0, 0,0x895A, 0, 0, 0, +0xE140, 0,0x955A,0xE141, 0, 0,0x8AA2,0xE142, + 0,0xE143, 0, 0, 0, 0,0xE144, 0, +0xE146,0xE147,0xE145, 0, 0, 0,0x9572,0xE149, +0xE148, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE14B,0xE14A,0xE14C, 0, 0, + 0, 0, 0, 0,0xE14D,0xE14F,0xE14E, 0, + 0,0x8D99, 0,0xE151, 0,0xE150, 0, 0, +0x8AC3, 0,0x9072, 0,0x935B, 0,0xE152,0x90B6, + 0, 0, 0,0x8E59, 0,0x8999,0xE153, 0, +0x9770, 0, 0,0x95E1,0xE154, 0, 0, 0, +0x9363,0x9752,0x8D62,0x905C, 0, 0, 0,0x926A, +0x99B2, 0,0x92AC,0x89E6,0xE155, 0, 0, 0, + 0, 0, 0, 0,0xE156, 0,0xE15B, 0, + 0,0xE159,0xE158,0x9DC0,0x8A45,0xE157, 0,0x88D8, + 0,0x94A8, 0, 0,0x94C8, 0, 0, 0, + 0,0x97AF,0xE15C,0xE15A,0x927B,0x90A4, 0, 0, +0x94A9, 0,0x954C, 0,0xE15E,0x97AA,0x8C6C,0xE15F, + 0,0xE15D,0x94D4,0xE160, 0,0xE161, 0, 0, +0x88D9, 0, 0,0x8FF4,0xE166, 0,0xE163,0x93EB, +0xE162, 0, 0, 0, 0, 0, 0,0x8B45, + 0, 0,0xE169, 0, 0, 0,0xE164,0xE165, + 0,0xE168,0xE167,0x9544, 0, 0,0x9161,0x9160, + 0,0x8B5E, 0, 0,0xE16A, 0, 0, 0, + 0, 0,0xE16B, 0, 0,0xE16C, 0, 0, + 0, 0, 0,0xE16E, 0,0xE16D, 0, 0, + 0, 0, 0,0x8975, 0, 0, 0, 0, + 0,0xE176,0x94E6,0xE170, 0,0xE172, 0, 0, +0xE174,0x905D, 0, 0,0xE175,0xE173,0x8EBE, 0, + 0, 0,0xE16F,0xE171, 0,0x9561, 0,0x8FC7, + 0, 0,0xE178, 0, 0,0xE177, 0, 0, + 0, 0,0xE179, 0,0x8EA4,0x8DAD, 0, 0, +0x9397,0xE17A, 0,0x92C9, 0, 0,0xE17C, 0, + 0, 0,0x979F,0xE17B, 0, 0, 0, 0, + 0,0x9189, 0, 0, 0, 0, 0, 0, +0xE182, 0,0xE184,0xE185,0x9273, 0, 0, 0, + 0, 0,0xE183, 0,0xE180, 0,0xE17D,0xE17E, + 0,0xE181, 0, 0, 0, 0, 0, 0, + 0,0xE188, 0,0xE186, 0,0xE187, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE189, +0xE18B,0xE18C,0xE18D, 0,0xE18E, 0, 0,0xE18A, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE190, 0, 0, 0,0xE18F, 0, 0, 0, + 0, 0, 0,0xE191, 0, 0, 0, 0, + 0, 0,0x97C3, 0, 0, 0,0xE194,0xE192, +0xE193, 0, 0, 0,0x8AE0, 0, 0, 0, + 0, 0,0x96FC, 0, 0, 0,0x95C8, 0, +0xE196, 0, 0, 0,0xE195, 0, 0, 0, + 0,0xE197,0xE198, 0, 0, 0, 0,0xE19C, +0xE199,0xE19A,0xE19B, 0,0xE19D, 0, 0, 0, +0xE19E, 0,0xE19F, 0, 0, 0,0xE1A0, 0, +0xE1A1, 0,0x94AD,0x936F,0xE1A2,0x9492,0x9553, 0, +0xE1A3, 0, 0,0xE1A4,0x9349, 0,0x8A46,0x8D63, +0xE1A5, 0, 0,0xE1A6, 0, 0,0xE1A7, 0, +0x8E48, 0, 0,0xE1A9, 0, 0,0xE1A8, 0, + 0,0xE1AA,0xE1AB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x94E7, 0, +0xE1AC, 0, 0, 0,0xE1AD, 0, 0,0xEA89, +0xE1AE,0xE1AF,0xE1B0, 0, 0, 0, 0,0x8E4D, + 0, 0,0xE1B1,0x9475, 0, 0,0x967E, 0, +0x896D, 0,0x8976, 0, 0,0xE1B2, 0, 0, + 0, 0,0xE1B4, 0, 0, 0,0xE1B3,0x9390, + 0, 0, 0,0x90B7,0x9F58, 0,0xE1B5,0x96BF, + 0,0xE1B6, 0,0x8AC4,0x94D5,0xE1B7, 0,0xE1B8, + 0, 0,0xE1B9, 0, 0, 0,0x96DA, 0, + 0, 0,0x96D3, 0,0x92BC, 0, 0, 0, +0x918A, 0, 0,0xE1BB, 0, 0,0x8F82, 0, + 0,0x8FC8, 0, 0,0xE1BE, 0, 0,0xE1BD, +0xE1BC,0x94FB, 0,0x8AC5,0x8CA7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE1C4, 0, 0,0xE1C1,0x905E, +0x96B0, 0, 0, 0,0xE1C0,0xE1C2,0xE1C3, 0, + 0,0xE1BF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE1C5, +0xE1C6, 0,0x92AD, 0,0x8AE1, 0, 0, 0, +0x9285, 0, 0, 0, 0, 0, 0,0xE1C7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE1C8,0xE1CB, 0, 0, 0, 0, + 0,0x9087, 0,0x93C2, 0,0xE1CC,0x9672, 0, +0xE1C9, 0, 0,0xE1CA, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE1CF, 0, 0, 0, 0,0xE1CE,0xE1CD, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE1D1, 0, 0,0xE1D0, 0, + 0,0xE1D2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE1D4, 0, +0xE1D3, 0, 0, 0, 0,0x95CB, 0, 0, + 0, 0, 0, 0,0x8F75,0x97C4, 0, 0, +0xE1D5, 0, 0,0x93B5, 0, 0,0xE1D6, 0, + 0,0xE1D7, 0,0xE1DB,0xE1D9,0xE1DA, 0,0xE1D8, + 0, 0, 0, 0, 0, 0, 0,0xE1DC, + 0, 0, 0, 0, 0,0xE1DD, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE1DE, + 0, 0,0xE1DF,0x96B5,0xE1E0, 0, 0, 0, + 0, 0,0x96EE,0xE1E1, 0,0x926D, 0,0x948A, + 0,0x8BE9, 0, 0, 0,0x925A,0xE1E2,0x8BB8, + 0, 0, 0,0x90CE, 0, 0, 0, 0, + 0, 0, 0, 0,0xE1E3, 0, 0, 0, + 0, 0,0x8DBB, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE1E4, 0, 0, 0, + 0, 0,0xE1E5, 0,0x8CA4,0x8DD3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE1E7, 0, 0, 0, 0,0x9375,0x8DD4,0x8B6D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9643, 0,0x946A, 0, 0, 0, + 0, 0,0x9376, 0, 0, 0, 0,0x8D7B, + 0, 0, 0, 0, 0,0xE1E9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x8FC9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x97B0,0x8D64, 0, 0,0x8CA5, + 0, 0,0x94A1, 0,0xE1EB, 0, 0, 0, + 0, 0, 0, 0,0xE1ED, 0, 0, 0, + 0,0x8CE9, 0, 0, 0, 0,0xE1EC,0x92F4, + 0, 0, 0, 0,0xE1EF,0x8A56,0xE1EA, 0, + 0,0x94E8, 0,0x894F, 0,0x8DEA, 0,0x9871, + 0, 0,0xE1EE, 0, 0, 0, 0, 0, + 0, 0, 0,0xE1F0, 0, 0, 0,0x95C9, + 0,0x90D7,0xE1F2, 0, 0, 0, 0,0xE1F3, + 0, 0, 0, 0, 0,0xE1F1, 0, 0, + 0, 0,0x8A6D, 0,0xE1F9, 0,0xE1F8, 0, + 0,0x8EA5, 0, 0, 0,0xE1FA,0xE1F5, 0, + 0, 0,0xE1FB,0xE1F6, 0, 0, 0, 0, +0x94D6,0xE1F4, 0, 0,0xE1F7, 0, 0, 0, + 0, 0,0xE241, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE240, +0x9681, 0, 0, 0,0xE1FC, 0, 0,0x88E9, + 0, 0, 0, 0,0xE243, 0, 0, 0, + 0, 0, 0, 0, 0,0xE242, 0, 0, + 0,0x8FCA, 0, 0, 0, 0, 0,0xE244, + 0, 0, 0, 0, 0, 0,0x9162, 0, + 0,0xE246,0xE245, 0, 0, 0, 0, 0, + 0,0xE247, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE1E6, 0, + 0, 0,0xE1E8,0xE249,0xE248, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8EA6, 0,0x97E7, 0,0x8ED0, 0, +0xE24A,0x8C56, 0, 0, 0, 0, 0,0x8B5F, +0x8B46,0x8E83, 0, 0, 0, 0, 0, 0, +0x9753, 0, 0,0xE250, 0,0xE24F,0x9163,0xE24C, + 0, 0,0xE24E, 0, 0,0x8F6A,0x905F,0xE24D, +0xE24B, 0,0x9449, 0, 0,0x8FCB, 0, 0, +0x955B, 0, 0, 0, 0,0x8DD5, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x9398, + 0, 0,0xE251, 0, 0, 0, 0,0xE252, +0xE268,0x8BD6, 0, 0,0x985C,0x9154, 0, 0, + 0, 0,0xE253, 0, 0,0x89D0,0x92F5,0x959F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE254, 0, 0, + 0, 0, 0, 0, 0, 0,0x8B9A,0xE255, + 0, 0,0xE257, 0, 0, 0,0xE258, 0, +0x9448, 0, 0,0xE259, 0, 0, 0, 0, + 0,0xE25A,0xE25B, 0, 0,0x8BD7,0x89D1,0x93C3, +0x8F47,0x8E84, 0, 0, 0, 0, 0, 0, + 0,0xE25C, 0,0x8F48, 0, 0, 0, 0, + 0,0x89C8,0x9562, 0, 0,0xE25D, 0, 0, +0x94E9, 0, 0, 0, 0, 0, 0,0x9164, + 0,0xE260, 0,0xE261,0x9489, 0,0x9060,0xE25E, + 0,0x9281, 0, 0,0xE25F, 0, 0, 0, +0x8FCC, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x88DA, 0, 0, 0, 0, +0x8B48, 0, 0, 0, 0, 0, 0, 0, +0xE262, 0, 0,0x92F6, 0,0xE263,0x90C5, 0, + 0, 0, 0, 0,0x96AB, 0, 0,0x9542, +0xE264,0xE265,0x9274, 0,0x97C5, 0, 0,0xE267, +0xE266, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8EED, 0, + 0,0xE269,0x88EE, 0, 0, 0, 0,0xE26C, + 0, 0, 0,0xE26A,0x89D2,0x8C6D,0xE26B,0x8D65, +0x8D92, 0,0x95E4,0xE26D, 0, 0,0x9673, 0, + 0,0xE26F, 0, 0, 0,0x90CF,0x896E,0x89B8, +0x88AA, 0, 0, 0, 0, 0, 0,0xE26E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE270,0xE271,0x8FF5, 0, 0, 0, 0, + 0,0xE272, 0,0x8A6E, 0, 0, 0, 0, +0xE274, 0, 0, 0,0x8C8A, 0,0x8B86, 0, + 0,0xE275,0x8BF3, 0, 0,0xE276, 0,0x90FA, + 0,0x93CB, 0,0x90DE,0x8DF3, 0, 0, 0, +0xE277, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x9282,0x918B, 0,0xE279,0xE27B,0xE278, +0xE27A, 0, 0, 0, 0, 0, 0,0x8C41, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE27C,0x8C45, 0, 0, 0,0x8B87,0x9771, +0xE27E, 0, 0, 0, 0, 0,0xE280, 0, + 0, 0,0x894D, 0, 0, 0, 0,0xE283, + 0, 0, 0,0x8A96,0xE282,0xE281, 0,0xE285, +0xE27D, 0,0xE286,0x97A7, 0,0xE287, 0,0xE288, + 0, 0,0x9AF2,0xE28A, 0,0xE289, 0, 0, + 0,0xE28B,0xE28C, 0,0x97B3,0xE28D, 0,0xE8ED, +0x8FCD,0xE28E,0xE28F,0x8F76, 0,0x93B6,0xE290, 0, + 0, 0,0x9247, 0, 0,0xE291, 0,0x925B, +0xE292, 0, 0, 0, 0, 0,0x8BA3, 0, +0x995E,0x927C,0x8EB1, 0, 0, 0, 0,0x8AC6, + 0, 0,0xE293, 0,0xE2A0, 0,0xE296, 0, +0x8B88, 0,0xE295,0xE2A2, 0, 0, 0,0xE294, + 0,0x8FCE, 0, 0, 0, 0, 0, 0, +0xE298,0xE299, 0,0x934A, 0, 0,0xE29A, 0, +0x8A7D, 0, 0, 0, 0,0x9079,0x9584, 0, +0xE29C, 0, 0, 0,0x91E6, 0, 0, 0, + 0, 0, 0,0xE297, 0,0xE29B,0xE29D, 0, + 0,0x8DF9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE2A4,0x954D, 0, +0x94A4,0x9399, 0,0x8BD8,0xE2A3,0xE2A1, 0,0x94B3, +0xE29E,0x927D,0x939B, 0,0x939A, 0,0x8DF4, 0, + 0, 0, 0, 0, 0,0xE2B6, 0, 0, + 0, 0, 0, 0, 0,0xE2A6, 0,0xE2A8, + 0, 0, 0, 0,0xE2AB, 0,0xE2AC, 0, +0xE2A9,0xE2AA, 0, 0,0xE2A7,0xE2A5, 0, 0, + 0, 0,0xE29F, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x95CD,0x89D3, + 0, 0, 0,0xE2B3, 0,0xE2B0, 0,0xE2B5, + 0, 0,0xE2B4, 0,0x9493,0x96A5, 0,0x8E5A, +0xE2AE,0xE2B7,0xE2B2, 0,0xE2B1,0xE2AD, 0,0xE2AF, + 0,0x8AC7, 0, 0, 0, 0, 0, 0, + 0, 0,0x925C, 0, 0,0x90FB, 0, 0, + 0,0x94A0, 0, 0,0xE2BC, 0, 0, 0, +0x94A2, 0, 0, 0, 0, 0, 0, 0, +0x90DF,0xE2B9, 0, 0,0x94CD, 0,0xE2BD,0x95D1, + 0,0x927A, 0,0xE2B8,0xE2BA, 0, 0,0xE2BB, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE2BE, 0, 0, +0x8EC2, 0, 0, 0,0x93C4,0xE2C3,0xE2C2, 0, + 0,0xE2BF, 0, 0, 0,0x9855, 0, 0, + 0, 0, 0,0xE2C8, 0, 0,0xE2CC,0xE2C9, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE2C5, 0, 0, 0, 0, 0, 0,0xE2C6, + 0, 0, 0, 0, 0,0xE2CB, 0, 0, + 0,0xE2C0,0x99D3,0xE2C7,0xE2C1, 0, 0,0xE2CA, + 0, 0, 0, 0, 0, 0, 0,0xE2D0, + 0,0x8AC8, 0,0xE2CD, 0, 0, 0,0xE2CE, + 0, 0,0xE2CF,0xE2D2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE2D1, +0x94F4, 0, 0, 0, 0,0xE2D3,0x97FA,0x95EB, +0xE2D8, 0, 0,0xE2D5, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2D4,0x90D0, 0,0xE2D7, +0xE2D9, 0, 0, 0,0xE2D6, 0,0xE2DD, 0, +0xE2DA, 0, 0, 0, 0, 0, 0,0xE2DB, +0xE2C4, 0, 0, 0,0xE2DC,0xE2DE, 0, 0, + 0, 0, 0, 0,0xE2DF, 0, 0, 0, + 0, 0, 0,0x95C4, 0,0xE2E0, 0, 0, + 0, 0, 0, 0, 0, 0,0x96E0, 0, + 0,0x8BCC,0x8C48,0xE2E1, 0, 0, 0, 0, + 0,0x95B2, 0,0x9088, 0,0x96AE, 0, 0, +0xE2E2, 0,0x97B1, 0, 0,0x9494, 0,0x9165, +0x9453, 0, 0,0x8F6C, 0, 0, 0,0x88BE, + 0,0xE2E7,0xE2E5, 0,0xE2E3,0x8A9F, 0,0x8FCF, +0xE2E8, 0, 0,0xE2E6, 0,0xE2E4,0xE2EC, 0, + 0,0xE2EB,0xE2EA,0xE2E9, 0, 0, 0, 0, + 0,0xE2ED, 0, 0, 0,0xE2EE,0x90B8, 0, +0xE2EF, 0,0xE2F1, 0, 0,0xE2F0, 0, 0, + 0, 0,0x8CD0, 0, 0, 0,0x9157, 0, + 0, 0,0xE2F3, 0, 0, 0,0x939C, 0, +0xE2F2, 0, 0, 0,0xE2F4, 0,0x95B3,0x918C, +0x8D66, 0,0xE2F5, 0, 0, 0, 0,0x97C6, + 0, 0, 0, 0, 0, 0, 0,0xE2F7, + 0, 0,0xE2F8, 0,0xE2F9, 0,0xE2FA, 0, +0x8E85, 0,0xE2FB,0x8C6E, 0, 0,0x8B8A, 0, +0x8B49, 0,0xE340, 0,0x96F1,0x8D67,0xE2FC, 0, + 0, 0,0xE343,0x96E4, 0,0x945B, 0, 0, +0x9552, 0, 0, 0,0x8F83,0xE342, 0,0x8ED1, +0x8D68,0x8E86,0x8B89,0x95B4,0xE341, 0, 0, 0, +0x9166,0x9661,0x8DF5, 0, 0, 0, 0, 0, + 0, 0, 0,0x8E87,0x92DB, 0,0xE346,0x97DD, +0x8DD7, 0,0xE347,0x9061, 0,0xE349, 0, 0, + 0,0x8FD0,0x8DAE, 0, 0, 0, 0,0xE348, + 0, 0,0x8F49,0x8CBC,0x9167,0xE344,0xE34A, 0, + 0, 0, 0,0xE345,0x8C6F, 0,0xE34D,0xE351, +0x8C8B, 0, 0, 0, 0, 0,0xE34C, 0, + 0, 0, 0,0xE355, 0, 0,0x8D69, 0, + 0,0x978D,0x88BA,0xE352, 0, 0,0x8B8B, 0, +0xE34F, 0, 0, 0, 0, 0,0xE350, 0, + 0,0x939D,0xE34E,0xE34B, 0,0x8A47,0x90E2, 0, + 0,0x8CA6, 0, 0, 0,0xE357, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE354, 0, 0, 0, 0, 0,0xE356, + 0, 0, 0,0xE353, 0, 0, 0, 0, + 0,0x8C70,0x91B1,0xE358,0x918E, 0, 0,0xE365, + 0, 0,0xE361,0xE35B, 0, 0, 0, 0, + 0, 0, 0,0xE35F,0x8EF8,0x88DB,0xE35A,0xE362, +0xE366,0x8D6A,0x96D4, 0,0x92D4,0xE35C, 0, 0, +0xE364, 0,0xE359,0x925D, 0,0xE35E,0x88BB,0x96C8, + 0, 0, 0, 0, 0, 0, 0,0xE35D, + 0, 0,0x8BD9,0x94EA, 0, 0, 0,0x918D, + 0,0x97CE,0x8F8F, 0, 0,0xE38E, 0, 0, +0xE367, 0,0x90FC, 0,0xE363,0xE368,0xE36A, 0, +0x92F7,0xE36D, 0, 0,0xE369, 0, 0, 0, +0x95D2,0x8AC9, 0, 0,0x96C9, 0, 0,0x88DC, + 0, 0,0xE36C, 0,0x97FB, 0, 0, 0, + 0, 0, 0,0xE36B, 0, 0, 0, 0, + 0,0x898F, 0, 0,0x93EA,0xE36E, 0, 0, + 0,0xE375,0xE36F,0xE376, 0, 0, 0, 0, + 0, 0,0xE372, 0, 0, 0, 0, 0, + 0, 0, 0,0x949B, 0, 0,0x8EC8,0xE374, + 0,0xE371,0xE377,0xE370, 0, 0,0x8F63, 0, + 0, 0, 0,0x9644, 0, 0,0x8F6B, 0, + 0,0xE373,0xE380, 0, 0,0xE37B, 0,0xE37E, + 0,0xE37C,0xE381,0xE37A, 0,0xE360,0x90D1, 0, + 0,0x94C9, 0,0xE37D, 0, 0,0xE378, 0, + 0, 0,0x9140,0x8C71, 0,0x8F4A, 0, 0, + 0, 0, 0, 0,0x9044,0x9155,0xE384, 0, + 0,0xE386,0xE387, 0, 0,0xE383,0xE385, 0, + 0, 0, 0, 0, 0, 0,0xE379,0xE382, + 0,0xE38A,0xE389, 0, 0,0x969A, 0, 0, +0x8C4A, 0, 0, 0, 0, 0, 0, 0, + 0,0xE388, 0,0xE38C,0xE38B,0xE38F, 0,0xE391, + 0, 0,0x8E5B,0xE38D, 0, 0, 0, 0, +0xE392,0xE393, 0, 0,0xE394, 0,0xE39A,0x935A, +0xE396, 0,0xE395,0xE397,0xE398, 0,0xE399, 0, + 0, 0, 0,0xE39B,0xE39C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8ACA, 0, +0xE39D, 0,0xE39E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE39F, 0, 0, + 0, 0, 0, 0,0xE3A0,0xE3A1,0xE3A2, 0, +0xE3A3,0xE3A4, 0, 0,0xE3A6,0xE3A5, 0, 0, +0xE3A7, 0, 0, 0, 0, 0, 0,0xE3A8, +0xE3A9, 0, 0, 0, 0, 0, 0,0xE3AC, +0xE3AA,0xE3AB,0x8DDF,0x8C72, 0, 0,0x9275, 0, +0x94B1, 0,0x8F90, 0, 0,0x946C, 0,0x94EB, +0xE3AD,0x9CEB, 0, 0, 0, 0, 0, 0, + 0, 0,0xE3AE,0xE3B0, 0,0x9785,0xE3AF,0xE3B2, +0xE3B1, 0,0x9772, 0,0xE3B3, 0,0x94FC, 0, + 0, 0, 0, 0,0xE3B4, 0, 0, 0, + 0, 0,0xE3B7, 0, 0,0xE3B6,0xE3B5, 0, + 0, 0, 0,0xE3B8,0x8C51, 0, 0, 0, +0x9141,0x8B60, 0, 0, 0, 0,0xE3BC,0xE3B9, + 0, 0,0xE3BA, 0, 0, 0,0xE3BD, 0, +0xE3BE,0xE3BB, 0, 0, 0,0x8948, 0, 0, + 0,0x89A5, 0, 0, 0,0xE3C0,0xE3C1, 0, + 0, 0,0xE3C2, 0,0x9782, 0, 0, 0, + 0, 0,0x8F4B, 0,0xE3C4,0xE3C3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9089,0xE3C5, 0, 0, 0, 0,0xE3C6, 0, + 0,0xE3C7, 0,0x8AE3, 0, 0, 0, 0, +0x8ACB, 0, 0,0xE3C8, 0, 0, 0, 0, + 0,0xE3C9, 0,0x967C,0x9783, 0, 0, 0, +0x9773,0x9856, 0,0x8D6C,0xE3CC,0x8ED2,0xE3CB, 0, + 0, 0, 0,0xE3CD,0x8EA7, 0, 0, 0, +0x91CF, 0,0xE3CE, 0, 0,0x8D6B, 0,0x96D5, +0xE3CF,0xE3D0, 0, 0,0xE3D1, 0, 0, 0, + 0,0xE3D2, 0, 0, 0, 0, 0, 0, +0xE3D3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8EA8, 0, 0,0x96EB, 0, + 0, 0, 0,0xE3D5, 0,0x925E, 0,0xE3D4, + 0, 0, 0, 0, 0, 0,0xE3D7, 0, + 0, 0,0xE3D6, 0, 0, 0, 0, 0, + 0, 0,0xE3D8, 0, 0, 0,0x90B9, 0, +0xE3D9, 0,0xE3DA, 0, 0, 0,0x95B7,0xE3DB, + 0,0x918F,0xE3DC, 0, 0, 0, 0, 0, +0xE3DD, 0, 0, 0, 0, 0, 0,0x97FC, +0xE3E0, 0,0xE3DF,0xE3DE,0x92AE, 0,0xE3E1,0x9045, + 0,0xE3E2, 0, 0, 0,0xE3E3,0x9857,0xE3E4, + 0, 0, 0, 0,0xE3E5,0xE3E7,0xE3E6,0x94A3, + 0,0x93F7, 0,0x985D,0x94A7, 0, 0, 0, + 0, 0, 0,0xE3E9, 0, 0,0x8FD1, 0, +0x9549, 0,0xE3EA,0xE3E8, 0,0x8ACC, 0, 0, + 0,0x8CD2,0x8E88, 0, 0,0x94EC, 0, 0, + 0,0x8CA8,0x9662, 0,0xE3ED,0xE3EB, 0,0x8D6D, + 0,0x8D6E,0x88E7, 0,0x8DE6, 0, 0, 0, + 0, 0,0x9478, 0, 0, 0, 0, 0, + 0, 0, 0,0x88DD,0xE3F2, 0,0x925F, 0, + 0, 0, 0, 0,0x9477, 0,0x91D9, 0, + 0, 0, 0, 0, 0, 0,0xE3F4, 0, + 0,0xE3F0,0xE3F3,0xE3EE, 0,0xE3F1,0x9645, 0, + 0,0x8CD3, 0, 0,0x88FB,0xE3EF, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE3F6, + 0,0xE3F7, 0, 0,0x93B7, 0, 0, 0, +0x8BB9, 0, 0, 0,0xE445,0x945C, 0, 0, + 0, 0,0x8E89, 0, 0,0x8BBA,0x90C6,0x9865, +0x96AC,0xE3F5,0x90D2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8B72,0xE3F8, 0, 0, 0, 0, + 0, 0, 0,0xE3FA, 0, 0, 0, 0, + 0,0xE3F9, 0, 0, 0, 0, 0,0xE3FB, + 0,0x9245, 0,0x945D, 0, 0, 0, 0, + 0,0x92AF, 0, 0, 0, 0,0xE442, 0, + 0, 0, 0, 0, 0, 0,0xE441, 0, + 0, 0, 0,0xE3FC, 0, 0,0x9074, 0, +0x9585,0xE444, 0,0xE443,0x8D6F,0x9872, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE454, + 0, 0, 0, 0, 0,0xE448,0xE449, 0, + 0, 0, 0,0x8EEE, 0, 0,0xE447, 0, +0x8D98,0xE446, 0, 0,0xE44A, 0, 0, 0, +0x92B0,0x95A0,0x9142, 0, 0, 0, 0,0x91DA, +0xE44E, 0,0xE44F,0xE44B, 0, 0, 0, 0, +0xE44C, 0,0xE44D, 0, 0, 0, 0,0x8D70, + 0, 0, 0,0xE455, 0,0xE451, 0, 0, + 0, 0,0x9586, 0,0x968C,0x9547, 0, 0, +0xE450, 0, 0,0xE453,0xE452, 0, 0, 0, +0x9663,0xE456, 0, 0, 0, 0, 0, 0, +0xE457, 0, 0,0x9156, 0,0xE458, 0, 0, +0xE45A, 0,0xE45E, 0, 0,0xE45B,0xE459,0x945E, +0xE45C, 0,0xE45D, 0, 0, 0,0x89B0, 0, +0xE464,0xE45F, 0, 0, 0,0xE460, 0, 0, + 0,0xE461, 0,0x919F, 0, 0, 0, 0, +0xE463,0xE462,0xE465, 0, 0, 0, 0,0xE466, +0xE467, 0, 0,0x9062, 0,0x89E7, 0,0xE468, +0x97D5, 0,0x8EA9, 0, 0,0x8F4C, 0, 0, + 0, 0, 0,0x8E8A,0x9276, 0, 0, 0, + 0, 0,0xE469,0xE46A,0x8950, 0,0xE46B, 0, + 0,0xE46C,0xE46D, 0, 0,0xE46E, 0,0xE46F, +0x8BBB,0x9DA8,0xE470, 0,0x90E3,0xE471,0x8EC9, 0, +0xE472, 0,0x98AE, 0, 0, 0,0xE473,0x95DC, +0x8ADA, 0, 0,0x9143,0x8F77, 0,0x9591,0x8F4D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE474,0x8D71,0xE475,0x94CA, 0,0xE484, 0, + 0, 0, 0,0xE477, 0,0x91C7,0x9495,0x8CBD, +0xE476,0x9144, 0, 0, 0, 0, 0, 0, +0xE478, 0, 0, 0, 0, 0, 0,0x92F8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE47A,0xE479,0xE47C, 0, 0,0xE47B, 0,0xE47D, + 0, 0,0xE480, 0,0xE47E, 0,0x8ACD, 0, +0xE481, 0,0xE482,0xE483, 0, 0,0x8DAF,0x97C7, + 0,0xE485,0x9046, 0, 0, 0,0x8990,0xE486, +0xE487, 0, 0, 0, 0, 0,0xE488, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x88F0, 0,0xE489, 0, 0, + 0, 0,0xE48A, 0, 0, 0, 0, 0, + 0,0x9587, 0, 0, 0,0x8EC5, 0,0xE48C, + 0, 0, 0, 0, 0,0x8A48,0x88B0, 0, + 0, 0, 0,0xE48B,0xE48E,0x946D, 0,0x9063, + 0,0x89D4, 0,0x9646, 0, 0, 0, 0, +0x8C7C,0x8BDA, 0,0xE48D, 0,0x89E8, 0, 0, + 0, 0, 0, 0, 0,0x8AA1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8991,0xE492,0x97E8,0x91DB, 0, 0,0x9563, + 0,0xE49E, 0,0x89D5,0xE49C, 0,0xE49A,0xE491, + 0,0xE48F, 0,0xE490, 0,0x8EE1,0x8BEA,0x9297, + 0, 0, 0,0x93CF, 0, 0, 0, 0, + 0,0x8970, 0,0xE494,0xE493, 0, 0, 0, + 0,0xE499,0xE495,0xE498, 0, 0, 0, 0, + 0, 0,0x96CE,0xE497,0x89D6,0x8A9D,0xE49B, 0, + 0,0xE49D, 0, 0, 0, 0,0x8C73, 0, + 0, 0, 0, 0, 0, 0,0xE4A1,0xE4AA, +0xE4AB, 0, 0, 0,0x88A9, 0, 0, 0, + 0, 0, 0,0xE4B2, 0, 0, 0, 0, +0x88EF, 0, 0,0xE4A9, 0, 0, 0,0xE4A8, + 0,0xE4A3,0xE4A2, 0,0xE4A0,0xE49F,0x9283, 0, +0x91F9,0xE4A5, 0, 0, 0, 0, 0, 0, +0xE4A4, 0, 0, 0, 0,0xE4A7, 0, 0, + 0,0x9190,0x8C74, 0, 0, 0, 0,0x8960, +0xE4A6, 0,0x8D72, 0, 0, 0, 0, 0, +0x9191, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4B8, 0,0xE4B9, 0,0x89D7, + 0, 0, 0,0x89AC,0xE4B6, 0, 0, 0, + 0, 0, 0, 0, 0,0xE4AC, 0,0xE4B4, + 0,0xE4BB,0xE4B5, 0, 0, 0,0xE4B3, 0, + 0, 0, 0,0xE496, 0, 0,0xE4B1, 0, + 0, 0,0xE4AD, 0, 0, 0,0x8ACE,0xE4AF, +0xE4BA, 0,0xE4B0, 0, 0, 0, 0, 0, +0xE4BC, 0,0xE4AE,0x949C, 0, 0, 0, 0, + 0,0x9789, 0, 0, 0,0xE4B7, 0, 0, + 0, 0, 0, 0, 0,0xE4CD, 0, 0, + 0,0xE4C5, 0, 0, 0,0x909B, 0, 0, + 0, 0,0x8B65, 0,0x8BDB, 0,0xE4C0, 0, + 0, 0, 0,0x89D9, 0, 0,0x8FD2, 0, +0xE4C3, 0, 0, 0,0x8DD8, 0, 0,0x9370, +0xE4C8, 0, 0, 0, 0, 0, 0, 0, + 0,0x95EC, 0,0xE4BF, 0, 0, 0,0x89D8, +0x8CD4,0x9548,0xE4C9, 0,0xE4BD, 0, 0,0xE4C6, + 0, 0, 0,0xE4D0, 0,0xE4C1, 0, 0, + 0, 0, 0,0xE4C2,0x93B8, 0, 0,0xE4C7, + 0, 0, 0,0xE4C4,0x9647,0xE4CA,0x88DE, 0, + 0, 0, 0,0xE4BE, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE4CC, 0,0xE4CB, 0, 0, 0, 0, 0, + 0,0x948B,0xE4D2, 0,0xE4DD, 0, 0, 0, + 0,0x8A9E, 0, 0, 0,0xE4E0, 0, 0, +0xE4CE, 0, 0, 0,0xE4D3,0x978E, 0, 0, + 0, 0, 0, 0, 0, 0,0xE4DC, 0, + 0,0x9774, 0, 0, 0, 0,0x97A8, 0, + 0, 0, 0, 0, 0, 0, 0,0x9298, + 0, 0, 0,0x8A8B, 0, 0, 0, 0, + 0,0x9592,0xE4E2,0x939F, 0, 0,0x88AF, 0, + 0,0xE4DB, 0,0xE4D7,0x9192,0xE4D1,0xE4D9,0xE4DE, + 0,0x944B, 0, 0, 0,0x88A8, 0,0xE4D6, + 0,0xE4DF,0x9598, 0, 0, 0, 0, 0, + 0, 0,0xE4DA, 0,0xE4D5, 0, 0, 0, + 0, 0, 0,0x8FD3, 0, 0, 0, 0, +0x8F4E, 0, 0, 0,0x8EAA, 0, 0, 0, + 0,0x96D6, 0, 0,0x9566, 0, 0,0xE4E5, + 0,0xE4EE, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE4D8, 0, 0, + 0, 0,0x8A97, 0, 0, 0, 0, 0, +0x8FF6,0xE4E3, 0,0xE4E8,0x9193, 0, 0,0xE4E4, + 0,0xE4EB, 0, 0,0x927E, 0,0xE4EC, 0, + 0,0x9775,0xE4E1,0x8A57, 0,0xE4E7, 0, 0, +0xE4EA,0x96AA, 0, 0, 0, 0,0xE4ED, 0, + 0,0xE4E6,0xE4E9, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9648, 0,0x9840, 0, + 0, 0, 0, 0,0xE4F1, 0, 0, 0, + 0, 0, 0, 0,0xE4F8, 0, 0,0xE4F0, +0x8EC1, 0, 0, 0, 0, 0,0xE4CF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x95CC, 0,0x96A0,0xE4F7,0xE4F6, 0,0xE4F2, +0xE4F3, 0,0x8955, 0, 0, 0, 0,0xE4F5, + 0,0xE4EF, 0, 0, 0, 0,0x92D3, 0, + 0, 0, 0, 0,0xE4F4,0x88FC, 0, 0, + 0, 0, 0, 0, 0,0x91A0, 0, 0, + 0, 0, 0, 0, 0,0x95C1, 0, 0, +0xE4F9,0xE540, 0,0x94D7, 0, 0, 0, 0, +0xE4FC,0x8FD4,0x8EC7,0xE542, 0, 0,0x8BBC, 0, + 0, 0, 0, 0, 0,0xE543, 0,0x9599, +0xE4FB, 0,0xE4D4, 0, 0, 0, 0, 0, + 0, 0, 0,0xE4FA, 0, 0, 0, 0, +0x986E,0x93A0,0x9593, 0, 0,0xE54A, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE550, + 0, 0, 0, 0, 0, 0,0xE551, 0, +0xE544, 0, 0, 0,0x9496, 0, 0,0xE54E, +0xE546, 0,0xE548, 0, 0, 0, 0, 0, +0xE552,0xE547, 0, 0,0xE54B, 0, 0,0x8992, + 0,0x93E3, 0,0xE54C,0xE54F, 0, 0, 0, + 0, 0, 0, 0,0xE545, 0,0x9145, 0, +0xE549,0x8E46,0x9064,0x8C4F,0x96F2, 0,0x96F7,0x8F92, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE556,0xE554, 0, 0, 0, 0, 0, + 0,0x986D, 0, 0, 0, 0, 0, 0, + 0,0xE553, 0, 0, 0,0x9795, 0,0xE555, +0xE557, 0, 0, 0, 0,0xE558, 0, 0, + 0, 0, 0, 0,0xE55B,0xE559, 0, 0, + 0, 0, 0, 0,0x93A1,0xE55A, 0, 0, + 0,0x94CB,0xE54D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8F93, + 0,0xE55C,0xE561,0x9194, 0, 0,0xE560, 0, + 0, 0,0xE541, 0, 0, 0,0xE562,0x9168, + 0, 0,0xE55D,0xE55F, 0, 0, 0, 0, + 0, 0, 0,0xE55E, 0, 0,0x9F50,0x9F41, + 0, 0,0xE564, 0, 0, 0, 0, 0, + 0, 0,0xE563, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9796, 0,0xE1BA, +0xE565, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE566, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE567,0x8CD5, 0, +0x8B73, 0, 0, 0,0xE569,0x997C, 0, 0, + 0, 0,0x8B95, 0,0x97B8, 0,0x8BF1,0xE56A, + 0, 0, 0, 0, 0, 0, 0,0xE56B, + 0, 0, 0,0x928E, 0, 0, 0, 0, + 0,0xE56C, 0, 0, 0, 0, 0, 0, + 0,0x93F8, 0,0x88B8, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x89E1,0xE571,0xE572, 0, 0, 0, + 0, 0, 0,0xE56D, 0,0x8E5C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE56E,0x9461, 0, 0, 0, + 0,0xE56F,0xE570,0xE57A, 0, 0, 0,0xE574, +0xE577, 0, 0, 0, 0, 0,0xE573, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE575, 0,0xE576,0x8ED6, + 0,0xE578, 0,0x9260, 0,0x8C75,0x8A61, 0, + 0, 0, 0, 0,0xE57B, 0, 0, 0, + 0,0x8A5E, 0,0xE581, 0, 0,0xE57C,0xE580, + 0, 0, 0, 0,0x94B8, 0, 0, 0, + 0,0xE57D, 0, 0,0xE57E,0x9567,0x94D8,0xE582, + 0, 0, 0, 0, 0, 0, 0, 0, +0x91FB,0xE58C, 0,0xE588, 0, 0,0x89E9, 0, +0xE586, 0,0x9649,0xE587, 0, 0,0xE584, 0, +0xE585,0xE58A,0xE58D, 0, 0,0xE58B, 0, 0, + 0,0xE589,0xE583, 0, 0, 0, 0, 0, +0x9277, 0,0xE594, 0,0x96A8, 0, 0, 0, + 0, 0, 0, 0, 0,0xE592, 0, 0, + 0,0xE593, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE58E, 0, 0,0xE590, + 0, 0, 0,0xE591, 0, 0, 0,0xE58F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x90E4, 0,0x9858,0xE598, 0,0xE599, 0, + 0, 0, 0,0xE59F, 0,0x9049, 0,0xE59B, + 0,0xE59E, 0, 0, 0, 0, 0,0xE596, +0xE595, 0, 0,0xE5A0, 0, 0,0x89DA, 0, +0xE59C, 0,0xE5A1, 0, 0, 0,0xE59D, 0, + 0, 0, 0, 0,0xE59A, 0,0x92B1, 0, +0xE597, 0, 0, 0, 0, 0, 0,0x9488, + 0, 0,0xE5A5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x975A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE5A4, + 0, 0,0xE5A3, 0, 0, 0, 0, 0, + 0, 0, 0,0xE5AC, 0, 0, 0,0xE5A6, + 0, 0, 0,0xE5AE, 0, 0, 0, 0, + 0, 0,0x9786,0xE5B1, 0,0xE5A8, 0, 0, +0xE5A9, 0, 0, 0,0xE5AD, 0,0xE5B0,0xE5AF, + 0, 0, 0,0xE5A7, 0, 0, 0, 0, +0xE5AA, 0,0xE5BB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE5B4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE5B2, + 0, 0,0xE5B3, 0, 0, 0,0xE5B8,0xE5B9, + 0,0x8A49, 0,0x8B61, 0, 0,0xE5B7, 0, + 0, 0, 0, 0, 0,0xE5A2, 0, 0, + 0, 0, 0, 0, 0,0xE5B6,0xE5BA,0xE5B5, + 0,0xE5BC, 0, 0, 0,0xE5BE,0xE5BD, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE5C0,0xE5BF,0xE579, 0, 0, 0,0xE5C4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE5C1, 0, 0, 0, 0,0xE5C2, 0, + 0,0xE5C3, 0,0xE5C5, 0, 0, 0, 0, +0x8C8C, 0,0xE5C7, 0,0xE5C6, 0,0x8F4F, 0, + 0, 0, 0, 0,0x8D73,0x9FA5, 0, 0, + 0, 0,0xE5C8,0x8F70, 0, 0, 0,0x8A58, + 0,0xE5C9, 0,0x8971, 0,0x8FD5,0xE5CA, 0, + 0,0x8D74,0xE5CB,0x88DF, 0, 0, 0, 0, +0x955C, 0, 0,0xE5CC, 0, 0, 0, 0, +0x908A, 0,0xE5D3, 0, 0,0xE5D0, 0,0x928F, + 0, 0, 0, 0, 0,0xE5D1,0xE5CE,0x8BDC, + 0,0xE5CD,0xE5D4, 0, 0, 0, 0, 0, +0x8C55, 0, 0,0x91DC, 0,0xE5DA, 0, 0, + 0, 0,0xE5D6, 0, 0, 0,0x91B3,0xE5D5, + 0,0xE5D8, 0, 0, 0, 0,0xE5CF, 0, + 0, 0,0xE5D9, 0,0xE5DB, 0, 0, 0, + 0, 0, 0,0x94ED, 0, 0,0xE5D7, 0, +0xE5DC,0xE5DE, 0, 0,0x8CD1,0xE5D2, 0,0x88BF, + 0, 0, 0, 0, 0, 0, 0,0xE5DD, + 0,0x8DD9,0x97F4,0xE5DF,0xE5E0,0x9195, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x97A0, + 0, 0, 0, 0,0xE5E1,0x9754, 0, 0, +0xE5E2,0xE5E3, 0, 0,0x95E2,0xE5E4, 0,0x8DBE, + 0,0x97A1, 0, 0, 0, 0, 0, 0, +0xE5E9, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE5EA,0x8FD6,0xE5E8, 0, 0, 0, +0x9787,0xE5E5, 0, 0,0xE5E7,0x90BB,0x909E, 0, + 0, 0,0xE5E6, 0,0xE5EB, 0, 0,0x95A1, + 0, 0,0xE5ED, 0,0xE5EC, 0, 0, 0, +0x8A8C, 0,0x964A,0xE5EE, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE5FA,0xE5F0, 0, + 0, 0, 0, 0, 0,0xE5F1, 0, 0, + 0, 0,0xE5F2,0xE5F3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE5F7, 0, +0xE5F8, 0, 0,0xE5F6, 0, 0, 0, 0, + 0,0xE5F4, 0,0xE5EF,0xE5F5, 0, 0, 0, + 0, 0, 0, 0,0xE5F9,0xE8B5, 0, 0, + 0, 0, 0, 0, 0, 0,0x89A6, 0, + 0, 0, 0, 0, 0, 0,0xE5FC,0x8BDD, +0xE5FB, 0, 0, 0,0xE641, 0,0xE640, 0, + 0, 0,0xE643, 0, 0,0xE642, 0,0xE644, + 0, 0,0x8F50, 0,0xE645, 0, 0,0xE646, + 0, 0, 0, 0, 0, 0,0xE647,0x90BC, + 0,0x9776, 0,0xE648, 0, 0,0x95A2,0x9465, +0xE649, 0,0xE64A,0x8CA9, 0, 0, 0,0x8B4B, + 0, 0, 0,0xE64B, 0, 0,0x8E8B,0x9460, +0xE64C, 0,0x8A6F, 0, 0, 0, 0, 0, + 0,0xE64D, 0, 0, 0, 0,0xE64F,0x9797, + 0,0xE64E,0x9065, 0,0xE650, 0, 0,0xE651, + 0, 0,0xE652,0x8ACF, 0, 0, 0, 0, + 0, 0,0xE653, 0, 0,0xE654, 0,0xE655, +0xE656, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8A70, 0, 0, 0, 0, 0, + 0, 0,0xE657, 0,0xE658,0xE659, 0, 0, + 0, 0, 0,0x89F0, 0, 0,0x9047,0xE65A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE65B, 0, 0, 0, +0xE65C, 0, 0, 0, 0, 0, 0, 0, +0x8CBE, 0,0x92F9,0xE65D, 0, 0, 0, 0, +0x8C76, 0,0x9075, 0,0xE660, 0,0x93A2, 0, +0xE65F, 0, 0,0x8C50, 0, 0,0xE65E,0x91F5, +0x8B4C, 0, 0,0xE661, 0,0xE662, 0,0x8FD7, + 0, 0, 0,0x8C8D, 0,0xE663, 0, 0, + 0, 0,0x964B, 0, 0,0x90DD, 0, 0, + 0,0x8B96, 0,0x96F3,0x9169, 0,0xE664, 0, + 0, 0,0x9066,0x9290,0x8FD8, 0, 0, 0, + 0,0xE665, 0, 0, 0, 0,0xE668, 0, +0xE669, 0, 0, 0, 0, 0, 0, 0, +0x8DBC,0x91C0,0xE667, 0,0x8FD9,0x955D, 0, 0, + 0, 0, 0,0xE666, 0, 0,0x8E8C, 0, +0x8972, 0,0xE66D,0x8C77, 0, 0,0x8E8E, 0, + 0,0x8E8D, 0,0x986C,0xE66C,0xE66B,0x9146, 0, +0x8B6C,0x9862,0x8A59,0x8FDA, 0, 0, 0, 0, + 0, 0, 0, 0,0xE66A, 0, 0, 0, + 0, 0,0xE66F, 0,0xE670,0xE66E, 0,0x8CD6, + 0,0x975F, 0, 0,0x8E8F,0x9446, 0, 0, + 0,0xE673, 0,0x90BE, 0,0x9261, 0, 0, +0x9755, 0,0xE676, 0, 0, 0,0x8CEA, 0, +0x90BD,0xE672, 0,0xE677,0x8CEB,0xE674,0xE675, 0, +0xE671, 0, 0, 0,0x90E0,0x93C7, 0, 0, +0x924E, 0,0x89DB, 0, 0, 0, 0, 0, + 0,0x94EE, 0, 0,0x8B62, 0, 0,0x92B2, + 0, 0,0xE67A, 0,0xE678, 0, 0,0x926B, + 0, 0, 0,0x90BF,0x8AD0,0xE679, 0,0x907A, + 0, 0,0x97C8, 0, 0, 0,0x985F, 0, + 0, 0,0xE67B,0xE687,0x92B3, 0,0xE686, 0, +0xE683,0xE68B,0xE684, 0,0xE680, 0,0x92FA,0xE67E, + 0, 0, 0,0xE67C, 0,0x9740,0x8E90, 0, + 0,0xE681, 0,0xE67D, 0, 0, 0,0xE685, +0x8F94, 0,0x8CBF, 0, 0, 0,0x91F8, 0, +0x9664,0x8979,0x88E0, 0,0x93A3, 0, 0,0xE689, + 0, 0, 0, 0,0xE688, 0,0x93E4, 0, +0xE68D, 0, 0, 0,0xE682, 0,0xE68C,0xE68E, + 0,0x8CAA,0xE68A,0x8D75, 0,0x8ED3, 0, 0, +0xE68F,0x9777, 0, 0, 0, 0,0xE692, 0, +0xE695, 0, 0,0xE693,0x9554, 0, 0, 0, + 0, 0, 0,0xE690, 0, 0, 0, 0, + 0,0x8BDE, 0, 0, 0, 0,0xE694, 0, + 0,0xE696, 0, 0, 0, 0, 0, 0, + 0,0xE69A, 0, 0,0xE697, 0,0xE699,0xE698, + 0, 0, 0, 0, 0, 0,0xE69B, 0, +0x8EAF, 0,0xE69D,0xE69C,0x9588, 0, 0,0xE69F, + 0, 0, 0, 0, 0, 0,0x8C78, 0, + 0, 0, 0,0xE69E,0xE6A0, 0, 0,0xE6A1, +0x8B63,0xE3BF,0x8FF7, 0,0xE6A2, 0, 0,0x8CEC, + 0, 0, 0, 0, 0,0xE6A3, 0, 0, +0xE6A4, 0, 0,0x8E5D, 0, 0, 0, 0, + 0, 0,0x9DCC, 0,0xE6A5, 0,0xE6A6, 0, +0x8F51, 0,0xE6A7,0xE6A8, 0, 0,0xE6A9, 0, + 0,0xE6AA,0xE6AB, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x924A, + 0, 0,0xE6AC, 0, 0, 0, 0,0xE6AE, + 0,0xE6AD, 0, 0, 0, 0,0x93A4, 0, +0xE6AF, 0,0x964C, 0,0xE6B0, 0,0xE6B1, 0, +0xE6B2, 0, 0, 0, 0,0xE6B3, 0, 0, + 0, 0,0x93D8, 0, 0, 0, 0, 0, + 0,0x8FDB,0xE6B4, 0, 0, 0, 0, 0, + 0, 0,0x8D8B,0x98AC,0xE6B5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE6B6,0x955E,0xE6B7, 0,0xE6BF, 0, 0, 0, + 0, 0,0xE6B8, 0, 0,0xE6BA, 0, 0, + 0,0xE6B9,0xE6BB, 0,0x9665,0xE6BC,0xE6BD, 0, + 0, 0, 0, 0,0xE6BE, 0, 0, 0, +0xE6C0, 0, 0, 0, 0,0x8A4C,0x92E5, 0, +0x9589,0x8DE0,0x8D76, 0, 0, 0, 0,0x956E, +0x89DD,0x94CC,0xE6C3,0x8AD1,0x90D3,0xE6C2,0xE6C7,0x9299, +0x96E1, 0,0xE6C5,0xE6C6,0x8B4D, 0,0xE6C8,0x9483, +0x91DD, 0, 0,0x94EF,0x935C,0xE6C4, 0,0x9666, +0x89EA,0xE6CA,0x9847,0x92C0,0x9864, 0, 0,0x8E91, +0xE6C9, 0,0x91AF, 0, 0,0xE6DA,0x9147, 0, + 0,0x93F6, 0,0x956F, 0, 0, 0, 0, + 0, 0,0xE6CD,0x8E5E,0x8E92, 0,0x8FDC, 0, +0x9485, 0,0x8CAB,0xE6CC,0xE6CB, 0,0x958A, 0, + 0, 0,0x8EBF, 0, 0,0x9371, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE6CF,0xE6D0,0x8D77,0xE6CE, 0, 0, + 0, 0, 0, 0,0xE6D1,0xE6D2, 0,0xE6D4, +0x91A1, 0,0xE6D3,0x8AE4, 0,0xE6D6, 0,0xE6D5, +0xE6D7, 0, 0,0xE6D9,0xE6DB, 0,0xE6DC, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x90D4, 0,0x8ECD,0xE6DD, + 0, 0, 0,0x8A71, 0,0xE6DE, 0, 0, +0x9196,0xE6DF, 0,0xE6E0,0x958B, 0, 0,0x8B4E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE6E1, 0, 0, 0,0x92B4, 0, 0, + 0, 0,0x897A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE6E2, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x8EEF, 0, 0, 0, 0, +0x9096, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x91AB, 0, 0, 0, 0, + 0, 0,0xE6E5, 0, 0, 0,0xE6E4, 0, + 0, 0,0xE6E3, 0, 0, 0, 0, 0, + 0, 0, 0,0xE6EB,0xE6E9, 0, 0,0xE6E6, + 0, 0, 0, 0, 0, 0,0xE6E8, 0, + 0, 0,0xE6E7,0xE6EA, 0,0x8B97, 0,0xE6EE, + 0,0x90D5, 0,0xE6EF, 0, 0, 0, 0, +0x8CD7, 0,0xE6EC,0xE6ED, 0, 0, 0,0x9848, + 0, 0, 0,0x92B5, 0,0x9148, 0, 0, + 0, 0, 0, 0,0xE6F0, 0, 0,0xE6F3, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE6F1,0xE6F2,0x9778, 0, 0, 0, 0,0x93A5, +0xE6F6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE6F4,0xE6F5,0xE6F7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE748, 0, 0, 0, 0, 0, +0xE6FA, 0, 0, 0,0xE6FB,0xE6F9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE6F8, 0,0x92FB, 0, 0,0xE740, +0xE744,0xE741,0xE6FC, 0,0xE742, 0, 0, 0, +0xE743, 0, 0, 0, 0,0xE74A, 0, 0, + 0,0xE745, 0, 0, 0, 0, 0,0x90D6, +0xE747, 0, 0,0xE749,0xE746, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE74C, 0,0x8F52, 0,0xE74B, 0, + 0, 0, 0, 0,0xE74D, 0, 0, 0, + 0,0xE74E, 0, 0,0xE751,0xE750, 0,0xE74F, + 0, 0,0xE753,0xE752, 0,0x96F4, 0, 0, + 0,0xE755, 0,0xE754,0xE756, 0, 0, 0, + 0,0xE757, 0, 0, 0, 0, 0, 0, + 0,0xE759, 0, 0, 0, 0, 0, 0, + 0, 0,0xE758,0x9067,0xE75A, 0, 0,0x8BEB, +0xE75B,0xE75D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE75E, 0, + 0, 0, 0, 0, 0,0xE75F,0xE75C, 0, +0xE760, 0,0x8ED4,0xE761,0x8B4F,0x8C52, 0, 0, + 0, 0,0x8CAC, 0, 0, 0, 0, 0, + 0, 0, 0,0xE762, 0, 0, 0,0x93EE, + 0, 0,0x935D,0xE763, 0, 0, 0, 0, + 0, 0, 0,0xE766, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8EB2, 0, 0,0xE765,0xE764,0x8C79,0xE767, 0, + 0, 0, 0,0x8A72, 0,0xE769, 0, 0, + 0,0x8DDA,0xE768, 0,0xE771, 0, 0, 0, + 0, 0,0xE76B,0xE76D,0x95E3,0xE76A, 0, 0, + 0,0xE76C, 0,0xE770,0xE76E,0x8B50, 0,0xE76F, + 0, 0, 0, 0, 0, 0,0xE772, 0, + 0,0x9479,0x97D6, 0, 0, 0, 0,0x8F53, + 0, 0, 0,0xE773, 0, 0, 0, 0, +0x9741,0xE775, 0,0xE774, 0, 0,0xE778,0x9760, + 0, 0,0xE777, 0,0x8A8D,0xE776,0xE77B, 0, + 0,0xE77A, 0, 0,0xE779,0x9351,0xE77C, 0, + 0, 0, 0, 0, 0, 0, 0,0xE77D, + 0, 0, 0, 0,0xE77E, 0, 0,0x8D8C, + 0,0x8C44,0xE780,0xE781,0xE782, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9068,0xE783, 0,0x8EAB,0xE784, + 0, 0, 0,0xE785, 0, 0, 0,0x999F, +0x999E, 0, 0, 0, 0,0xE786,0xE390,0xE787, +0x9243,0x904A,0x945F, 0, 0, 0, 0,0xE788, + 0, 0,0x95D3,0x92D2,0x8D9E, 0, 0,0x9248, + 0, 0,0x8949, 0,0x9698,0x9076, 0, 0, + 0, 0, 0, 0, 0, 0,0x8C7D, 0, + 0,0x8BDF, 0, 0,0x95D4, 0, 0, 0, + 0, 0,0xE789, 0, 0, 0, 0, 0, + 0, 0,0xE78B, 0, 0,0xE78A,0x89DE, 0, + 0,0x93F4,0xE78C,0x9497, 0,0x9352, 0,0xE78D, +0x8F71, 0, 0, 0,0xE78F, 0, 0,0x96C0, +0xE79E,0xE791,0xE792, 0, 0,0x92C7, 0, 0, +0x91DE,0x9197, 0,0x93A6, 0,0xE790,0x8B74, 0, + 0, 0, 0,0xE799, 0,0xE796,0xE7A3,0x93A7, +0x9280,0xE793, 0,0x92FC,0x9372,0xE794,0xE798,0x9080, + 0,0x9487,0x92CA, 0, 0,0x90C0,0xE797,0x91AC, +0x91A2,0xE795,0x88A7,0x9841, 0, 0, 0,0xE79A, + 0, 0, 0, 0, 0, 0,0x91DF, 0, + 0,0x8F54,0x9069, 0, 0,0xE79C,0xE79B, 0, +0x88ED,0xE79D, 0, 0,0x954E, 0,0xE7A5, 0, + 0,0x93D9,0x908B, 0, 0,0x9278, 0,0x8BF6, + 0,0xE7A4,0x9756,0x895E, 0,0x95D5,0x89DF,0xE79F, +0xE7A0,0xE7A1,0xE7A2,0x93B9,0x9242,0x88E1,0xE7A6, 0, +0xE7A7,0xEAA1, 0, 0,0x91BB, 0,0xE7A8, 0, +0x8993,0x916B, 0,0x8CAD, 0,0x9779, 0, 0, +0xE7A9,0x934B, 0, 0, 0,0x9198,0x8ED5,0xE7AA, + 0, 0,0xE7AD, 0, 0,0x8F85,0xE7AB,0x914A, +0x9149, 0,0x88E2, 0,0x97C9,0xE7AF, 0,0x94F0, +0xE7B1,0xE7B0,0xE7AE,0xE284,0x8AD2, 0, 0,0xE78E, + 0,0xE7B3,0xE7B2, 0, 0, 0, 0,0xE7B4, + 0,0x9757, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x93DF, 0, 0,0x964D, 0, +0xE7B5, 0,0x8ED7, 0, 0, 0, 0,0xE7B6, + 0,0xE7B7, 0, 0, 0,0xE7B8, 0, 0, +0x9340, 0, 0, 0, 0, 0, 0, 0, + 0,0x88E8, 0, 0, 0, 0, 0, 0, + 0, 0,0x8D78, 0, 0, 0,0x9859, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE7BC, 0, 0, 0, 0, + 0,0x8C53,0xE7B9, 0,0xE7BA, 0, 0, 0, +0x9594, 0, 0, 0, 0,0x8A73, 0, 0, + 0, 0, 0, 0, 0,0x9758, 0,0x8BBD, + 0, 0, 0, 0, 0,0x9373, 0, 0, + 0, 0,0xE7BD, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE7BE, 0, 0, 0, 0, 0, + 0,0xE7BF, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x9341, 0, 0, +0xE7C1, 0,0xE7C0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x93D1,0xE7C2,0x8F55,0x8EDE,0x947A,0x9291, 0, + 0, 0,0x8EF0, 0,0x908C, 0,0xE7C3, 0, +0xE7C4, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x907C,0xE7C5, 0,0xE7C6, 0, 0, + 0,0xE7C7,0x978F, 0,0x8F56, 0, 0, 0, + 0, 0,0xE7C9,0xE7C8, 0,0x8D79, 0,0x8D93, +0x8E5F, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0xE7CC, 0, 0, 0, 0,0x8F86, + 0,0xE7CB, 0,0xE7CA, 0,0x91E7, 0, 0, +0x8CED, 0,0x90C1, 0, 0, 0, 0,0x94AE, + 0, 0, 0, 0,0x8F58, 0, 0, 0, + 0, 0,0xE7CD, 0,0x8FDD, 0, 0, 0, + 0, 0,0xE7D0,0xE7CE, 0, 0, 0,0xE7CF, + 0, 0, 0, 0,0xE7D2,0xE7D1, 0, 0, +0x8FF8, 0,0xE7D3, 0, 0, 0, 0, 0, +0xE7D4,0xE7D5, 0, 0, 0, 0,0x94CE,0x8DD1, +0x8EDF,0xE7D6, 0,0xE7D7,0x97A2,0x8F64,0x96EC,0x97CA, +0xE7D8,0x8BE0, 0, 0, 0, 0,0xE7D9, 0, +0x9342, 0, 0,0xE7DC,0x8A98,0x906A, 0,0xE7DA, + 0,0xE7DB, 0,0x92DE, 0, 0,0x9674,0x8BFA, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE7DE,0xE7DF, 0, + 0, 0, 0, 0,0xE7DD, 0, 0,0xE7E1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x93DD,0x8A62, 0, + 0,0xE7E5, 0, 0,0xE7E2,0xE7E4, 0, 0, + 0, 0, 0, 0, 0, 0,0xE7E0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE86E, 0, 0,0xE7E3, 0, 0, 0, + 0, 0, 0, 0,0x97E9, 0, 0,0x8CD8, + 0, 0, 0, 0, 0, 0, 0,0xE7ED, + 0, 0, 0, 0,0x9353,0xE7E8, 0, 0, +0xE7EB,0xE7E9, 0,0xE7EE, 0, 0, 0, 0, +0xE7EF, 0, 0, 0, 0, 0, 0,0xE7E7, + 0, 0,0xE7F4,0x8994, 0, 0,0xE7E6, 0, + 0, 0,0x94AB, 0,0xE7EA, 0,0x8FDE, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8D7A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x9667, 0, +0x8BE2, 0, 0,0x8F65, 0,0x93BA, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x914C, 0,0xE7F2, 0,0xE7EC,0xE7F1, 0, +0x96C1, 0,0x92B6,0xE7F3,0xE7F0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x914B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7F7, + 0,0xE7F6, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7F5, + 0, 0,0x964E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8F9B, 0, 0, 0, + 0,0xE7F8,0x95DD, 0, 0,0x8973, 0, 0, + 0, 0,0x9565,0x9292, 0, 0, 0, 0, +0x8B98, 0,0xE7FA, 0,0x8D7C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x8E4B, 0, + 0, 0, 0, 0, 0, 0, 0,0xE7F9, +0x908D, 0, 0, 0, 0, 0, 0, 0, +0x908E,0xE840,0xE842, 0, 0, 0, 0, 0, +0x8FF9, 0,0xE841,0xE843, 0, 0,0x8BD1, 0, +0x9564, 0, 0,0x8EE0,0x9842, 0,0xE7FC,0x8DF6, + 0, 0,0x985E, 0, 0,0xE845, 0, 0, + 0, 0,0xE844,0xE846, 0, 0, 0, 0, + 0, 0, 0, 0,0xE7FB, 0, 0, 0, + 0, 0, 0,0x93E7, 0,0x9374, 0, 0, + 0, 0, 0, 0,0x92D5, 0,0xE84B, 0, + 0, 0, 0,0x9262,0xE847, 0, 0, 0, +0xE848, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8C4C, 0,0xE84A, 0, + 0, 0, 0, 0, 0,0x8CAE, 0, 0, + 0, 0, 0, 0,0xE849, 0,0x8FDF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8A99, 0, 0, 0, + 0, 0, 0, 0,0xE84F, 0,0x8DBD,0x9199, + 0, 0,0x92C8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8A5A, + 0, 0, 0, 0,0xE84D,0xE84E,0x92C1, 0, +0xE84C, 0, 0, 0, 0, 0, 0, 0, + 0,0xE850, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE856, 0, 0, 0, 0, +0xE859, 0, 0, 0, 0, 0, 0, 0, +0xE858,0x934C, 0, 0, 0, 0,0xE851,0xE852, +0xE855, 0, 0, 0, 0,0xE857, 0, 0, + 0,0x8BBE, 0, 0,0xE85A,0xE854, 0, 0, +0xE853, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE85E, 0, 0, 0,0xE85F, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE860, 0, 0,0xE85D,0xE85C, 0, 0, 0, +0x8FE0,0x93A8,0xE85B, 0, 0, 0, 0, 0, + 0,0xE864, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xE862, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE863,0xE861, 0, +0x91F6, 0,0xE865, 0, 0, 0, 0, 0, + 0,0xE866, 0, 0,0xE868, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8AD3,0xE867,0x96F8, 0, 0, 0, 0, + 0, 0,0xE873,0xE869, 0, 0,0xE86C, 0, +0xE86A, 0,0xE86B, 0, 0, 0, 0, 0, + 0, 0,0xE86D, 0, 0, 0, 0, 0, +0xE86F, 0, 0, 0, 0,0xE870, 0,0xE871, + 0, 0, 0, 0,0xE874,0xE872,0xE875,0xE877, + 0,0xE876}; + +/* page 6 0x9577-0x9FA0 */ +static uint16 tab_uni_sjis6[]={ +0x92B7, 0, 0, 0, 0, 0, 0, 0, + 0,0x96E5, 0,0xE878,0x914D, 0, 0, 0, +0xE879, 0,0x95C2,0xE87A,0x8A4A, 0, 0, 0, +0x895B, 0,0x8AD5, 0,0x8AD4,0xE87B, 0,0xE87C, + 0,0xE87D,0xE87E, 0, 0, 0, 0, 0, + 0,0xE880, 0,0x8AD6,0x8A74,0x8D7D,0x94B4, 0, +0xE882,0xE881, 0, 0, 0, 0,0xE883, 0, + 0, 0, 0,0x897B, 0, 0, 0, 0, + 0, 0,0xE886, 0,0xE885,0xE884, 0,0xE887, + 0, 0, 0, 0,0xE88A, 0, 0, 0, +0x88C5, 0, 0,0xE888, 0,0xE88C,0xE88B, 0, + 0, 0, 0, 0, 0,0xE88E,0xE88D,0xE88F, + 0,0x93AC, 0, 0, 0,0xE890, 0, 0, + 0, 0,0xE891,0xE893, 0, 0,0xE892, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x958C, 0, 0, + 0, 0,0xE894, 0, 0, 0, 0, 0, + 0,0xE895, 0,0x8DE3, 0, 0, 0,0xE896, +0xE897, 0, 0,0x9668, 0, 0, 0, 0, + 0, 0, 0, 0,0x916A, 0, 0, 0, +0x88A2,0x91C9, 0,0xE898, 0,0x958D, 0, 0, + 0, 0, 0, 0,0xE89B,0xE899,0x8D7E, 0, +0xE89A,0x8CC0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x95C3,0xE89D,0xE89F,0xE89E, +0xE8A0, 0, 0,0x8940,0x9077,0x8F9C,0x8AD7,0xE8A1, + 0, 0, 0,0x9486, 0,0xE8A3, 0, 0, + 0,0x8941, 0,0xE8A2,0x92C2, 0,0x97CB,0x93A9, +0xE89C,0x97A4, 0,0x8CAF, 0, 0,0x977A, 0, + 0, 0, 0, 0, 0, 0,0x8BF7,0x97B2, + 0,0x8C47, 0,0x91E0,0xE440, 0,0xE8A4,0x8A4B, +0x908F, 0, 0, 0, 0,0x8A75,0xE8A6, 0, +0xE8A7,0xE8A5,0x8C84, 0,0x8DDB,0x8FE1, 0, 0, + 0,0x8942, 0, 0,0x97D7, 0, 0, 0, +0xE8A9,0xE7AC, 0,0xE8A8, 0, 0, 0, 0, + 0,0xE8AC,0xE8AA,0xE8AB, 0,0xE8AD, 0,0xE8AE, +0x97EA,0xE8AF,0xE8B0, 0,0x90C7,0x94B9, 0, 0, + 0,0x909D,0x8AE5, 0, 0,0x9759,0x89EB,0x8F57, +0x8CD9, 0,0xE8B3, 0,0xE8B2,0x8E93,0xE8B4,0xE8B1, + 0, 0,0x8E47, 0, 0, 0,0xE8B8,0xE5AB, + 0, 0,0x99D4, 0,0x9097,0xE8B6, 0, 0, + 0, 0, 0,0x97A3,0x93EF, 0, 0, 0, + 0,0x894A, 0,0x90E1,0x8EB4, 0, 0, 0, + 0,0x95B5, 0,0x895F, 0, 0, 0,0x97EB, +0x978B, 0,0xE8B9, 0,0x9364, 0, 0, 0, + 0,0x8EF9, 0, 0, 0,0xE8BA, 0,0xE8BB, +0x906B,0xE8BC, 0,0x97EC, 0, 0,0xE8B7,0xE8BE, +0xE8C0, 0,0xE8BF, 0,0xE8BD, 0, 0,0xE8C1, + 0, 0,0xE8C2, 0, 0,0x919A, 0,0x89E0, + 0, 0, 0, 0, 0,0xE8C3, 0, 0, +0x96B6, 0, 0,0xE8C4, 0, 0, 0, 0, + 0,0xE8C5, 0,0x9849, 0, 0, 0, 0, + 0,0x9E50,0xE8C6, 0, 0, 0,0xE8C7,0xE8C8, + 0, 0, 0,0xE8CC, 0,0xE8C9, 0,0xE8CA, + 0,0xE8CB,0xE8CD, 0, 0, 0, 0, 0, + 0, 0, 0,0x90C2, 0, 0, 0,0x96F5, + 0, 0,0x90C3, 0, 0,0xE8CE, 0,0x94F1, + 0,0xE8CF,0xEA72,0x96CA, 0,0xE8D0, 0,0xE8D1, + 0,0xE8D2,0x8A76, 0,0xE8D4, 0,0x9078, 0, + 0, 0,0xE8D5, 0, 0,0x8C43, 0, 0, + 0, 0,0xE8D6,0xE8DA, 0,0xE8D8, 0, 0, + 0, 0,0xE8D9, 0, 0,0x8A93,0xE8D7,0xE8DB, + 0, 0, 0, 0,0xE8DC, 0,0x88C6, 0, +0xE8DD,0xE8DE, 0, 0, 0, 0, 0, 0, + 0,0x8FE2, 0, 0, 0,0xE8DF, 0, 0, + 0,0x8B66, 0, 0,0xE8E2, 0, 0,0xE8E1, + 0,0xE8E0, 0, 0,0xE691, 0,0x95DA, 0, + 0, 0, 0, 0,0xE8E3,0xE8E4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE8E5, 0, 0,0xE8E6, + 0,0xE8E7, 0, 0,0xE8E8, 0, 0, 0, + 0, 0, 0, 0,0x8AD8, 0, 0, 0, + 0, 0, 0, 0, 0,0xE8E9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE8EA,0x9442, + 0, 0, 0,0xE8EC,0x89B9, 0,0xE8EF,0xE8EE, + 0, 0, 0, 0,0x8943, 0, 0, 0, +0x8BBF, 0,0x95C5,0x92B8,0x8DA0, 0,0x8D80,0x8F87, + 0,0x907B, 0, 0, 0,0xE8F1, 0, 0, +0xE8F0,0x9761,0x8AE6,0x94D0,0x93DA, 0, 0, 0, +0x909C,0x97CC, 0,0x8C7A, 0, 0, 0, 0, + 0, 0,0xE8F4, 0, 0,0xE8F3, 0, 0, + 0, 0, 0, 0, 0,0x966A,0x93AA, 0, + 0, 0, 0, 0, 0,0x896F, 0, 0, +0xE8F5,0xE8F2, 0, 0,0x9570,0x978A,0xE8F6, 0, + 0, 0, 0, 0, 0, 0, 0,0xE8F7, + 0, 0, 0, 0,0xE8F9,0x91E8,0x8A7A,0x8A7B, +0xE8F8, 0, 0, 0, 0,0x8AE7,0x8CB0, 0, + 0,0x8AE8, 0, 0,0x935E, 0, 0,0x97DE, + 0, 0, 0, 0, 0, 0, 0, 0, +0x8CDA, 0, 0, 0,0xE8FA, 0, 0, 0, +0xE8FB,0xE8FC,0xE940, 0,0xE942,0xE941, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x9597, 0,0xE943, 0, 0, 0, 0, +0xE944, 0,0xE945, 0, 0, 0, 0,0xE946, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE948,0xE947, 0,0xE949, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x94F2,0xE3CA, 0, 0, +0x9048, 0, 0,0x8B51, 0, 0, 0, 0, + 0, 0,0xE94A, 0,0xE94B, 0,0x99AA,0x9F5A, +0x94D1, 0, 0,0x88F9, 0,0x88B9, 0, 0, + 0, 0, 0, 0, 0,0x8E94,0x964F,0x8FFC, + 0, 0, 0, 0,0xE94C, 0,0x96DD, 0, + 0, 0,0xE94D,0x977B, 0,0x8961, 0, 0, + 0,0x8E60, 0,0xE94E,0x89EC,0xE94F, 0, 0, + 0,0xE950, 0, 0, 0, 0,0xE952,0xE953, + 0,0xE955,0xE951, 0, 0,0xE954, 0, 0, + 0,0x8AD9, 0, 0, 0,0xE956, 0,0xE957, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE958,0xE959, + 0, 0, 0,0xE95A, 0, 0,0xE95C, 0, + 0, 0,0xE95B, 0,0xE95E,0xE961, 0, 0, + 0,0xE95D,0xE95F,0xE960, 0, 0,0xE962, 0, +0x8BC0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x8EF1, +0xE963,0xE964,0x8D81, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE965, 0, + 0,0x8A5D, 0, 0, 0,0x946E,0xE966,0xE967, + 0, 0, 0, 0,0x9279,0x93E9, 0, 0, + 0, 0, 0, 0, 0,0xE968, 0, 0, + 0, 0,0x949D, 0, 0,0x91CA,0x8977,0x8BEC, + 0,0x8BED, 0, 0, 0, 0, 0, 0, + 0,0x9293,0xE96D,0x8BEE, 0, 0,0x89ED, 0, + 0,0xE96C, 0, 0,0xE96A, 0,0xE96B, 0, +0xE969, 0, 0,0xE977, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xE96E,0xE96F, + 0, 0,0xE970,0xE971, 0, 0, 0, 0, + 0,0xE973, 0, 0,0xE972, 0, 0, 0, +0x8F78, 0,0xE974, 0, 0, 0,0xE976, 0, + 0, 0, 0, 0, 0, 0, 0,0x8B52, +0xE975, 0, 0,0x919B,0x8CB1, 0, 0, 0, + 0, 0,0xE978, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x91CB, 0, 0,0xE979, 0, 0, 0, + 0,0x93AB, 0, 0, 0, 0, 0, 0, +0xE97A, 0, 0, 0, 0, 0, 0,0xE980, + 0,0xE97D, 0,0xE97C,0xE97E, 0,0xE97B, 0, + 0, 0, 0, 0, 0, 0,0xE982, 0, + 0, 0, 0, 0, 0, 0,0xE981, 0, +0xE984, 0, 0,0x8BC1,0xE983, 0, 0, 0, +0xE985, 0, 0,0xE986, 0,0xE988,0xE987, 0, + 0, 0,0xE989,0xE98B,0xE98A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x8D9C, 0, 0, 0, 0,0xE98C, 0, + 0,0xE98D, 0, 0, 0, 0, 0, 0, + 0,0x8A5B, 0, 0, 0,0xE98E, 0, 0, + 0,0xE98F, 0, 0, 0,0x9091, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xE990, 0,0xE991, 0,0xE992,0xE993, 0, 0, + 0,0x8D82, 0, 0, 0, 0, 0,0xE994, +0xE995, 0, 0,0xE996,0xE997, 0, 0,0xE998, + 0, 0, 0,0x94AF,0xE99A, 0,0x9545,0xE99B, +0xE999, 0,0xE99D, 0, 0,0xE99C, 0, 0, +0xE99E, 0, 0, 0,0xE99F, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE9A0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xE9A1, 0,0xE9A2, 0, 0, 0, 0, +0xE9A3, 0, 0,0xE9A4,0xE9A5, 0,0xE9A6, 0, +0xE9A7,0xE9A8,0xE9A9,0xE9AA, 0, 0, 0,0xE9AB, +0xE9AC, 0,0x9F54,0xE9AD, 0, 0, 0, 0, + 0, 0, 0, 0,0xE2F6,0x8B53, 0, 0, + 0, 0,0x8A40,0x8DB0,0xE9AF,0xE9AE,0x96A3, 0, + 0, 0, 0, 0, 0, 0,0xE9B1,0xE9B2, +0xE9B0, 0,0xE9B3, 0, 0,0x9682, 0, 0, + 0,0xE9B4, 0,0x8B9B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x9844, 0, 0, 0, 0,0xE9B5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE9B7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x88BC, + 0, 0,0xE9B8,0x95A9,0xE9B6, 0, 0,0xE9B9, +0xE9BA, 0, 0, 0, 0, 0, 0, 0, +0xE9BB,0xE9BC, 0, 0, 0, 0, 0, 0, + 0,0xE9BD, 0,0x968E,0x8E4C, 0,0x8DF8,0x914E, + 0, 0, 0, 0, 0,0xE9BE, 0, 0, + 0, 0,0xE9C1, 0, 0, 0, 0, 0, + 0,0xE9BF, 0, 0, 0, 0, 0,0xE9C2, + 0, 0,0x8CEF,0xE9C0, 0, 0, 0, 0, +0xE9C3, 0,0xE9C4,0xE9C5, 0,0xE9C9, 0,0x8E49, + 0, 0, 0, 0,0x91E2, 0, 0, 0, + 0, 0,0xE9CA,0xE9C7,0xE9C6,0xE9C8, 0, 0, + 0,0x8C7E, 0, 0, 0, 0, 0, 0, + 0,0xE9CE,0xE9CD,0xE9CC, 0, 0,0x88B1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xE9D8, 0,0xE9D4, + 0,0xE9D5,0xE9D1,0xE9D7, 0,0xE9D3,0x8A82, 0, + 0,0x986B, 0,0xE9D6,0xE9D2,0xE9D0,0xE9CF, 0, + 0, 0, 0, 0,0xE9DA, 0, 0, 0, + 0, 0,0xE9DD, 0, 0,0xE9DC,0xE9DB, 0, + 0, 0, 0, 0, 0, 0,0x9568,0xE9D9, +0x88F1,0xE9DE, 0,0xE9E0, 0, 0, 0, 0, + 0, 0,0x8A8F,0xE9CB,0x8956, 0, 0,0xE9E2, + 0, 0, 0, 0, 0, 0, 0,0xE9E1, +0xE9DF,0x924C, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x9690, 0, 0, 0, 0, +0x97D8, 0, 0,0xE9E3, 0, 0, 0, 0, + 0,0xE9E4, 0, 0, 0, 0, 0, 0, +0xE9E5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xE9E6, + 0,0xE9E7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x92B9, 0, +0xE9E8, 0,0x94B5, 0,0xE9ED,0xE9E9, 0, 0, + 0,0xE9EA, 0, 0,0x9650,0x96C2, 0,0x93CE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0xE9EE, 0, 0,0xE9EF, +0x93BC,0xE9EC,0xE9EB, 0, 0, 0, 0,0x89A8, + 0, 0, 0,0xE9F7, 0, 0,0xE9F6, 0, + 0, 0, 0, 0,0x8995, 0, 0, 0, +0xE9F4, 0, 0, 0,0xE9F3, 0, 0,0xE9F1, + 0,0x8A9B, 0,0xE9F0,0x8EB0,0x89A7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x8D83, 0, 0,0xE9FA, +0xE9F9, 0,0xE9F8, 0, 0,0xE9F5, 0,0xE9FB, + 0,0xE9FC, 0, 0, 0, 0, 0, 0, + 0,0xEA44,0xEA43, 0, 0, 0, 0, 0, + 0, 0,0xEA45, 0, 0,0x894C,0xEA40,0xEA41, + 0,0x8D94,0x96B7, 0, 0,0xEA42, 0, 0, + 0, 0, 0, 0, 0,0x9651, 0, 0, +0xEA4A, 0, 0,0xEA46, 0, 0, 0, 0, + 0, 0, 0,0xEA4B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA48, 0,0xEA47, 0, 0, 0, 0, 0, +0x8C7B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xEA4C, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xEA4D, 0, 0, + 0, 0,0xEA4E, 0,0xEA49, 0, 0, 0, +0xE9F2, 0, 0,0xEA4F, 0,0x92DF, 0, 0, + 0,0xEA53, 0,0xEA54,0xEA52, 0, 0, 0, + 0, 0,0xEA51,0xEA57, 0,0xEA50, 0,0xEA55, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA56, 0, 0, 0,0xEA59, 0, 0, 0, + 0, 0,0xEA58, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0xEA5B, + 0, 0, 0, 0, 0, 0,0xEA5C, 0, +0xEA5D, 0, 0,0x9868, 0, 0, 0, 0, + 0,0xEA5A,0x91E9,0x8DEB, 0, 0,0xEA5E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xEA5F,0xEA60, 0, 0,0xEA61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0xEA62, 0, + 0,0x8CB2,0xEA63, 0, 0, 0,0xEA64, 0, +0x8EAD, 0,0xEA65, 0, 0, 0, 0, 0, + 0,0xEA66, 0, 0,0xEA67,0xEA68, 0, 0, + 0, 0,0xEA6B,0xEA69,0x985B, 0,0xEA6A, 0, +0x97ED, 0, 0, 0, 0, 0,0xEA6C, 0, +0x97D9, 0, 0, 0, 0, 0,0xEA6D,0x949E, + 0, 0,0xEA6E,0xEA70, 0, 0,0xEA71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xEA6F,0x8D8D,0x96CB,0x9683,0x9BF5, 0,0x9F80, +0x969B, 0, 0, 0, 0,0x89A9, 0, 0, + 0, 0, 0, 0, 0,0xEA73,0x8B6F,0xEA74, +0xEA75,0xEA76, 0,0x8D95, 0,0xEA77, 0, 0, + 0,0xE0D2,0x96D9, 0,0x91E1,0xEA78,0xEA7A,0xEA79, + 0,0xEA7B, 0, 0, 0, 0,0xEA7C, 0, + 0,0xEA7D, 0, 0, 0, 0, 0, 0, +0xEA7E, 0, 0, 0, 0,0xEA80, 0,0xEA81, +0xEA82, 0,0xEA83, 0,0xEA84,0xEA85,0xEA86, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA87,0xEA88, 0, 0, 0, 0, 0,0x9343, + 0, 0, 0, 0,0x8CDB, 0,0xEA8A, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x916C,0xEA8B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0xEA8C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x9540, 0, 0,0xEA8D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0xEA8E,0xE256, 0, 0,0xE6D8, +0xE8EB, 0, 0,0xEA8F, 0,0xEA90, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0xEA92,0xEA93,0xEA94,0x97EE,0xEA91, 0, 0,0xEA95, +0xEA96, 0, 0,0xEA98, 0,0xEA97, 0, 0, + 0, 0, 0,0xEA9A, 0, 0, 0,0xEA9B, +0xEA99, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x97B4, 0, + 0, 0, 0, 0, 0, 0,0xEA9C, 0, + 0, 0, 0, 0, 0,0xEA9D,0xE273, 0, + 0,0xEA9E}; + +/* page 7 0xFF01-0xFFE5 */ +static uint16 tab_uni_sjis7[]={ +0x8149, 0,0x8194,0x8190,0x8193,0x8195, 0,0x8169, +0x816A,0x8196,0x817B,0x8143, 0,0x8144,0x815E,0x824F, +0x8250,0x8251,0x8252,0x8253,0x8254,0x8255,0x8256,0x8257, +0x8258,0x8146,0x8147,0x8183,0x8181,0x8184,0x8148,0x8197, +0x8260,0x8261,0x8262,0x8263,0x8264,0x8265,0x8266,0x8267, +0x8268,0x8269,0x826A,0x826B,0x826C,0x826D,0x826E,0x826F, +0x8270,0x8271,0x8272,0x8273,0x8274,0x8275,0x8276,0x8277, +0x8278,0x8279,0x816D, 0,0x816E,0x814F,0x8151,0x814D, +0x8281,0x8282,0x8283,0x8284,0x8285,0x8286,0x8287,0x8288, +0x8289,0x828A,0x828B,0x828C,0x828D,0x828E,0x828F,0x8290, +0x8291,0x8292,0x8293,0x8294,0x8295,0x8296,0x8297,0x8298, +0x8299,0x829A,0x816F,0x8162,0x8170, 0, 0, 0, +0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,0x00A8, +0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,0x00B0, +0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,0x00B8, +0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,0x00C0, +0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,0x00C8, +0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,0x00D0, +0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,0x00D8, +0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x8150, 0,0x818F}; + +static int func_uni_sjis_onechar(int code){ + if ((code>=0x005C)&&(code<=0x00F7)) + return(tab_uni_sjis0[code-0x005C]); + if ((code>=0x0391)&&(code<=0x0451)) + return(tab_uni_sjis1[code-0x0391]); + if ((code>=0x2010)&&(code<=0x2312)) + return(tab_uni_sjis2[code-0x2010]); + if ((code>=0x2500)&&(code<=0x266F)) + return(tab_uni_sjis3[code-0x2500]); + if ((code>=0x3000)&&(code<=0x30FE)) + return(tab_uni_sjis4[code-0x3000]); + if ((code>=0x4E00)&&(code<=0x9481)) + return(tab_uni_sjis5[code-0x4E00]); + if ((code>=0x9577)&&(code<=0x9FA0)) + return(tab_uni_sjis6[code-0x9577]); + if ((code>=0xFF01)&&(code<=0xFFE5)) + return(tab_uni_sjis7[code-0xFF01]); + return(0); +} + + +static int +my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + int code; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((int) wc < 0x80) + { + if (wc == 0x5c) + { + code= 0x815f; + goto mb; + } + s[0]= (uchar) wc; + return 1; + } + + if (!(code=func_uni_sjis_onechar(wc))) + return MY_CS_ILUNI; + + if (code>=0xA1 && code <= 0xDF) + { + s[0]= code; + return 1; + } + +mb: + if (s+2>e) + return MY_CS_TOOSMALL2; + + s[0]=code>>8; + s[1]=code&0xFF; + return 2; +} + + +static int +my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e){ + int hi; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((hi= s[0]) < 0x80) + { + pwc[0]=hi; + return 1; + } + + if (hi >= 0xA1 && hi <= 0xDF) + { + pwc[0]= func_sjis_uni_onechar(hi); + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + if (!(pwc[0]=func_sjis_uni_onechar((hi<<8)+s[1]))) + return -2; + + return 2; +} + +static +size_t my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *str_end) +{ + size_t clen; + const uchar *b= (const uchar *) str; + const uchar *e= (const uchar *) str_end; + + for (clen= 0; b < e; ) + { + if (*b >= 0xA1 && *b <= 0xDF) + { + clen++; + b++; + } + else if (*b > 0x7F) + { + clen+= 2; + b+= 2; + } + else + { + clen++; + b++; + } + } + return clen; +} + +/* + Returns a well formed length of a SJIS string. + CP932 additional characters are also accepted. +*/ +static +size_t my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t pos, int *error) +{ + const char *b0= b; + *error= 0; + while (pos-- && b < e) + { + if ((uchar) b[0] < 128) + { + /* Single byte ascii character */ + b++; + } + else if (issjishead((uchar)*b) && (e-b)>1 && issjistail((uchar)b[1])) + { + /* Double byte character */ + b+= 2; + } + else if (((uchar)*b) >= 0xA1 && ((uchar)*b) <= 0xDF) + { + /* Half width kana */ + b++; + } + else + { + /* Wrong byte sequence */ + *error= 1; + break; + } + } + return (size_t) (b - b0); +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_sjis, + my_strnncollsp_sjis, + my_strnxfrm_mb, + my_strnxfrmlen_simple, + my_like_range_sjis, + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_8bit, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_sjis, + mbcharlen_sjis, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_sjis, + my_lengthsp_8bit, + my_numcells_sjis, + my_mb_wc_sjis, /* mb_wc */ + my_wc_mb_sjis, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_8bit, + my_casedn_str_8bit, + my_caseup_8bit, + my_casedn_8bit, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + +CHARSET_INFO my_charset_sjis_japanese_ci= +{ + 13,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_NONASCII, /* state */ + "sjis", /* cs name */ + "sjis_japanese_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_sjis, + to_lower_sjis, + to_upper_sjis, + sort_order_sjis, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + +CHARSET_INFO my_charset_sjis_bin= +{ + 88,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII, /* state */ + "sjis", /* cs name */ + "sjis_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_sjis, + to_lower_sjis, + to_upper_sjis, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 1, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + +#endif diff --git a/externals/mysql/strings/ctype-tis620.c b/externals/mysql/strings/ctype-tis620.c new file mode 100644 index 00000000000..a151053dda3 --- /dev/null +++ b/externals/mysql/strings/ctype-tis620.c @@ -0,0 +1,977 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Copyright (C) 2003 by Sathit Jittanupat + + * solving bug crash with long text field string + * sorting with different number of space or sign char. within string + + Copyright (C) 2001 by Korakot Chaovavanich and + Apisilp Trunganont + Copyright (C) 1998, 1999 by Pruet Boonma + Copyright (C) 1998 by Theppitak Karoonboonyanan + Copyright (C) 1989, 1991 by Samphan Raruenrom + + Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that the above copyright notice appear in all copies. + Samphan Raruenrom , Theppitak Karoonboonyanan , Pruet Boonma , + Korakot Chaovavanich and Apisilp Trunganont makes no representations + about the suitability of this software for any purpose. It is provided + "as is" without express or implied warranty. +*/ + + +/* + This file is basicly tis620 character sets with some extra functions + for tis-620 handling +*/ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_tis620=4 + */ + +#include +#include +#include "m_string.h" +#include "m_ctype.h" +#include "t_ctype.h" + +#ifdef HAVE_CHARSET_tis620 + +#define BUFFER_MULTIPLY 4 +#define M L_MIDDLE +#define U L_UPPER +#define L L_LOWER +#define UU L_UPRUPR +#define X L_MIDDLE + + +static int t_ctype[][TOT_LEVELS] = { + /*0x00*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x01*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x02*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x03*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x04*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x05*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x06*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x07*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x08*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x09*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x0A*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x0B*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x0C*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x0D*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x0E*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x0F*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x10*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x11*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x12*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x13*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x14*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x15*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x16*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x17*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x18*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x19*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x1A*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x1B*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x1C*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x1D*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x1E*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x1F*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x20*/ { IGNORE, IGNORE, L3_SPACE, IGNORE, M}, + /*0x21*/ { IGNORE, IGNORE, L3_EXCLAMATION, IGNORE, M }, + /*0x22*/ { IGNORE, IGNORE, L3_QUOTATION, IGNORE, M }, + /*0x23*/ { IGNORE, IGNORE, L3_NUMBER, IGNORE, M }, + /*0x24*/ { IGNORE, IGNORE, L3_DOLLAR, IGNORE, M }, + /*0x25*/ { IGNORE, IGNORE, L3_PERCENT, IGNORE, M }, + /*0x26*/ { IGNORE, IGNORE, L3_AMPERSAND, IGNORE, M }, + /*0x27*/ { IGNORE, IGNORE, L3_APOSTROPHE, IGNORE, M }, + /*0x28*/ { IGNORE, IGNORE, L3_L_PARANTHESIS, IGNORE, M }, + /*0x29*/ { IGNORE, IGNORE, L3_R_PARENTHESIS, IGNORE, M }, + /*0x2A*/ { IGNORE, IGNORE, L3_ASTERISK, IGNORE, M }, + /*0x2B*/ { IGNORE, IGNORE, L3_PLUS, IGNORE, M }, + /*0x2C*/ { IGNORE, IGNORE, L3_COMMA, IGNORE, M }, + /*0x2D*/ { IGNORE, IGNORE, L3_HYPHEN, IGNORE, M }, + /*0x2E*/ { IGNORE, IGNORE, L3_FULL_STOP, IGNORE, M }, + /*0x2F*/ { IGNORE, IGNORE, L3_SOLIDUS, IGNORE, M }, + /*0x30*/ { L1_08, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x31*/ { L1_18, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x32*/ { L1_28, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x33*/ { L1_38, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x34*/ { L1_48, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x35*/ { L1_58, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x36*/ { L1_68, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x37*/ { L1_78, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x38*/ { L1_88, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x39*/ { L1_98, L2_BLANK, L3_BLANK, L4_BLANK, M }, + /*0x3A*/ { IGNORE, IGNORE, L3_COLON, IGNORE, M }, + /*0x3B*/ { IGNORE, IGNORE, L3_SEMICOLON, IGNORE, M }, + /*0x3C*/ { IGNORE, IGNORE, L3_LESS_THAN, IGNORE, M }, + /*0x3D*/ { IGNORE, IGNORE, L3_EQUAL, IGNORE, M }, + /*0x3E*/ { IGNORE, IGNORE, L3_GREATER_THAN, IGNORE, M }, + /*0x3F*/ { IGNORE, IGNORE, L3_QUESTION, IGNORE, M }, + /*0x40*/ { IGNORE, IGNORE, L3_AT, IGNORE, M }, + /*0x41*/ { L1_A8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x42*/ { L1_B8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x43*/ { L1_C8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x44*/ { L1_D8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x45*/ { L1_E8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x46*/ { L1_F8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x47*/ { L1_G8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x48*/ { L1_H8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x49*/ { L1_I8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x4A*/ { L1_J8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x4B*/ { L1_K8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x4C*/ { L1_L8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x4D*/ { L1_M8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x4E*/ { L1_N8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x4F*/ { L1_O8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x50*/ { L1_P8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x51*/ { L1_Q8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x52*/ { L1_R8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x53*/ { L1_S8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x54*/ { L1_T8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x55*/ { L1_U8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x56*/ { L1_V8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x57*/ { L1_W8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x58*/ { L1_X8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x59*/ { L1_Y8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x5A*/ { L1_Z8, L2_BLANK, L3_BLANK, L4_CAP, M }, + /*0x5B*/ { IGNORE, IGNORE, L3_L_BRACKET, IGNORE, M }, + /*0x5C*/ { IGNORE, IGNORE, L3_BK_SOLIDUS, IGNORE, M }, + /*0x5D*/ { IGNORE, IGNORE, L3_R_BRACKET, IGNORE, M }, + /*0x5E*/ { IGNORE, IGNORE, L3_CIRCUMFLEX, IGNORE, M }, + /*0x5F*/ { IGNORE, IGNORE, L3_LOW_LINE, IGNORE, M }, + /*0x60*/ { IGNORE, IGNORE, L3_GRAVE, IGNORE, M }, + /*0x61*/ { L1_A8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x62*/ { L1_B8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x63*/ { L1_C8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x64*/ { L1_D8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x65*/ { L1_E8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x66*/ { L1_F8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x67*/ { L1_G8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x68*/ { L1_H8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x69*/ { L1_I8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x6A*/ { L1_J8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x6B*/ { L1_K8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x6C*/ { L1_L8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x6D*/ { L1_M8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x6E*/ { L1_N8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x6F*/ { L1_O8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x70*/ { L1_P8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x71*/ { L1_Q8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x72*/ { L1_R8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x73*/ { L1_S8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x74*/ { L1_T8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x75*/ { L1_U8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x76*/ { L1_V8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x77*/ { L1_W8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x78*/ { L1_X8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x79*/ { L1_Y8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x7A*/ { L1_Z8, L2_BLANK, L3_BLANK, L4_MIN, M }, + /*0x7B*/ { IGNORE, IGNORE, L3_L_BRACE, IGNORE, M }, + /*0x7C*/ { IGNORE, IGNORE, L3_V_LINE, IGNORE, M }, + /*0x7D*/ { IGNORE, IGNORE, L3_R_BRACE, IGNORE, M }, + /*0x7E*/ { IGNORE, IGNORE, L3_TILDE, IGNORE, M }, + /*0x7F*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x80*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x81*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x82*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x83*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x84*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x85*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x86*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x87*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x88*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x89*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x8A*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x8B*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x8C*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x8D*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x8E*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x8F*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x90*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x91*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x92*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x93*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x94*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x95*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x96*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x97*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x98*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x99*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x9A*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x9B*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x9C*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x9D*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x9E*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0x9F*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xA0*/ { IGNORE, IGNORE, L3_NB_SACE, IGNORE, X }, + /*0xA1*/ { L1_KO_KAI, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA2*/ { L1_KHO_KHAI, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA3*/ { L1_KHO_KHUAT, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA4*/ { L1_KHO_KHWAI, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA5*/ { L1_KHO_KHON, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA6*/ { L1_KHO_RAKHANG, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA7*/ { L1_NGO_NGU, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA8*/ { L1_CHO_CHAN, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xA9*/ { L1_CHO_CHING, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xAA*/ { L1_CHO_CHANG, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xAB*/ { L1_SO_SO, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xAC*/ { L1_CHO_CHOE, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xAD*/ { L1_YO_YING, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xAE*/ { L1_DO_CHADA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xAF*/ { L1_TO_PATAK, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB0*/ { L1_THO_THAN, L2_BLANK,L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB1*/ { L1_THO_NANGMONTHO, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB2*/ { L1_THO_PHUTHAO, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB3*/ { L1_NO_NEN, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB4*/ { L1_DO_DEK, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB5*/ { L1_TO_TAO, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB6*/ { L1_THO_THUNG, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB7*/ { L1_THO_THAHAN, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB8*/ { L1_THO_THONG, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xB9*/ { L1_NO_NU, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xBA*/ { L1_BO_BAIMAI, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xBB*/ { L1_PO_PLA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xBC*/ { L1_PHO_PHUNG, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xBD*/ { L1_FO_FA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xBE*/ { L1_PHO_PHAN, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xBF*/ { L1_FO_FAN, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC0*/ { L1_PHO_SAMPHAO, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC1*/ { L1_MO_MA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC2*/ { L1_YO_YAK, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC3*/ { L1_RO_RUA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC4*/ { L1_RU, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC5*/ { L1_LO_LING, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC6*/ { L1_LU, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC7*/ { L1_WO_WAEN, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC8*/ { L1_SO_SALA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xC9*/ { L1_SO_RUSI, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xCA*/ { L1_SO_SUA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xCB*/ { L1_HO_HIP, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xCC*/ { L1_LO_CHULA, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xCD*/ { L1_O_ANG, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xCE*/ { L1_HO_NOKHUK, L2_BLANK, L3_BLANK, L4_BLANK, M | _consnt}, + /*0xCF*/ { IGNORE, IGNORE, L3_PAIYAN_NOI, IGNORE, M}, + /*0xD0*/ { L1_SARA_A, L2_BLANK, L3_BLANK, L4_BLANK, M | _fllwvowel}, + /*0xD1*/ { L1_MAI_HAN_AKAT, L2_BLANK, L3_BLANK, L4_BLANK, U | _uprvowel}, + /*0xD2*/ { L1_SARA_AA, L2_BLANK, L3_BLANK, L4_BLANK, M | _fllwvowel}, + /*0xD3*/ { L1_SARA_AM, L2_BLANK, L3_BLANK, L4_BLANK, M | _fllwvowel}, + /*0xD4*/ { L1_SARA_I, L2_BLANK, L3_BLANK, L4_BLANK, U | _uprvowel}, + /*0xD5*/ { L1_SARA_II, L2_BLANK, L3_BLANK, L4_BLANK, U | _uprvowel}, + /*0xD6*/ { L1_SARA_UE, L2_BLANK, L3_BLANK, L4_BLANK, U | _uprvowel}, + /*0xD7*/ { L1_SARA_UEE, L2_BLANK, L3_BLANK, L4_BLANK, U | _uprvowel}, + /*0xD8*/ { L1_SARA_U, L2_BLANK, L3_BLANK, L4_BLANK, L | _lwrvowel}, + /*0xD9*/ { L1_SARA_UU, L2_BLANK, L3_BLANK, L4_BLANK, L | _lwrvowel}, + /*0xDA*/ { IGNORE, L2_PINTHU, L3_BLANK, L4_BLANK, L }, + /*0xDB*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xDC*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xDD*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xDE*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xDF*/ { IGNORE, IGNORE, L3_BAHT, IGNORE, M}, + /*0xE0*/ { L1_SARA_E, L2_BLANK, L3_BLANK, L4_BLANK, M | _ldvowel }, + /*0xE1*/ { L1_SARA_AE, L2_BLANK, L3_BLANK, L4_BLANK, M | _ldvowel }, + /*0xE2*/ { L1_SARA_O, L2_BLANK, L3_BLANK, L4_BLANK, M | _ldvowel }, + /*0xE3*/ { L1_SARA_AI_MAIMUAN, L2_BLANK, L3_BLANK, L4_BLANK, M | _ldvowel }, + /*0xE4*/ { L1_SARA_AI_MAIMALAI, L2_BLANK, L3_BLANK, L4_BLANK, M | _ldvowel }, + /*0xE5*/ { L1_SARA_AA, L2_BLANK, L3_BLANK, L4_EXT, M | _fllwvowel }, + /*0xE6*/ { IGNORE, IGNORE, L3_MAI_YAMOK, IGNORE, M | _stone }, + /*0xE7*/ { IGNORE, L2_TYKHU, L3_BLANK, L4_BLANK, U | _diacrt1 | _stone }, + /*0xE8*/ { IGNORE, L2_TONE1, L3_BLANK, L4_BLANK, UU | _tone | _combine | _stone }, + /*0xE9*/ { IGNORE, L2_TONE2, L3_BLANK, L4_BLANK, UU | _tone | _combine | _stone }, + /*0xEA*/ { IGNORE, L2_TONE3, L3_BLANK, L4_BLANK, UU | _tone | _combine | _stone }, + /*0xEB*/ { IGNORE, L2_TONE4, L3_BLANK, L4_BLANK, UU | _tone | _combine | _stone }, + /*0xEC*/ { IGNORE, L2_GARAN, L3_BLANK, L4_BLANK, UU | _diacrt2 | _combine | _stone }, + /*0xED*/ { L1_NKHIT, L2_BLANK, L3_BLANK, L4_BLANK, U | _diacrt1 }, + /*0xEE*/ { IGNORE, L2_YAMAK, L3_BLANK, L4_BLANK, U | _diacrt1 }, + /*0xEF*/ { IGNORE, IGNORE, L3_FONGMAN, IGNORE, M }, + /*0xF0*/ { L1_08, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF1*/ { L1_18, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF2*/ { L1_28, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF3*/ { L1_38, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF4*/ { L1_48, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF5*/ { L1_58, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF6*/ { L1_68, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF7*/ { L1_78, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF8*/ { L1_88, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xF9*/ { L1_98, L2_THAII, L3_BLANK, L4_BLANK, M | _tdig }, + /*0xFA*/ { IGNORE, IGNORE, L3_ANGKHANKHU, IGNORE, X }, + /*0xFB*/ { IGNORE, IGNORE, L3_KHOMUT, IGNORE, X }, + /*0xFC*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xFD*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /*0xFE*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, + /* Utilize 0xFF for max_sort_chr in my_like_range_tis620 */ + /*0xFF*/ { 255 /*IGNORE*/, IGNORE, IGNORE, IGNORE, X }, +}; + +static uchar NEAR ctype_tis620[257] = +{ + 0, /* For standard library */ + 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, + 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, + 72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 132,132,132,132,132,132,132,132,132,132,16,16,16,16,16,16, + 16,129,129,129,129,129,129,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,16,16,16,16,16, + 16,130,130,130,130,130,130,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,16,16,16,16,32, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +static uchar NEAR to_lower_tis620[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR to_upper_tis620[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + +static uchar NEAR sort_order_tis620[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '\\', ']', '[', '^', '_', + 'E', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', 'Y', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', +}; + + +/* + Convert thai string to "Standard C String Function" sortable string + + SYNOPSIS + thai2sortable() + tstr String to convert. Does not have to end with \0 + len Length of tstr +*/ + +static size_t thai2sortable(uchar *tstr, size_t len) +{ + uchar *p; + int tlen; + uchar l2bias; + + tlen= len; + l2bias= 256 - 8; + for (p= tstr; tlen > 0; p++, tlen--) + { + uchar c= *p; + + if (isthai(c)) + { + int *t_ctype0= t_ctype[c]; + + if (isconsnt(c)) + l2bias -= 8; + if (isldvowel(c) && tlen != 1 && isconsnt(p[1])) + { + /* simply swap between leading-vowel and consonant */ + *p= p[1]; + p[1]= c; + tlen--; + p++; + continue; + } + + /* if found level 2 char (L2_GARAN,L2_TONE*,L2_TYKHU) move to last */ + if (t_ctype0[1] >= L2_GARAN) + { + /* + l2bias use to control position weight of l2char + example (*=l2char) XX*X must come before X*XX + */ + memmove((char*) p, (char*) (p+1), tlen-1); + tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1; + p--; + continue; + } + } + else + { + l2bias-= 8; + *p= to_lower_tis620[c]; + } + } + return len; +} + + +/* + strncoll() replacement, compare 2 string, both are converted to sortable + string + + NOTE: + We can't cut strings at end \0 as this would break comparision with + LIKE characters, where the min range is stored as end \0 + + Arg: 2 Strings and it compare length + Ret: strcmp result +*/ + +static +int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s1, size_t len1, + const uchar *s2, size_t len2, + my_bool s2_is_prefix) +{ + uchar buf[80] ; + uchar *tc1, *tc2; + int i; + + if (s2_is_prefix && len1 > len2) + len1= len2; + + tc1= buf; + if ((len1 + len2 +2) > (int) sizeof(buf)) + tc1= (uchar*) my_str_malloc(len1+len2+2); + tc2= tc1 + len1+1; + memcpy((char*) tc1, (char*) s1, len1); + tc1[len1]= 0; /* if length(s1)> len1, need to put 'end of string' */ + memcpy((char *)tc2, (char *)s2, len2); + tc2[len2]= 0; /* put end of string */ + thai2sortable(tc1, len1); + thai2sortable(tc2, len2); + i= strcmp((char*)tc1, (char*)tc2); + if (tc1 != buf) + my_str_free(tc1); + return i; +} + + +static +int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), + const uchar *a0, size_t a_length, + const uchar *b0, size_t b_length, + my_bool diff_if_only_endspace_difference) +{ + uchar buf[80], *end, *a, *b, *alloced= NULL; + size_t length; + int res= 0; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + a= buf; + if ((a_length + b_length +2) > (int) sizeof(buf)) + alloced= a= (uchar*) my_str_malloc(a_length+b_length+2); + + b= a + a_length+1; + memcpy((char*) a, (char*) a0, a_length); + a[a_length]= 0; /* if length(a0)> len1, need to put 'end of string' */ + memcpy((char *)b, (char *)b0, b_length); + b[b_length]= 0; /* put end of string */ + a_length= thai2sortable(a, a_length); + b_length= thai2sortable(b, b_length); + + end= a + (length= min(a_length, b_length)); + while (a < end) + { + if (*a++ != *b++) + { + res= ((int) a[-1] - (int) b[-1]); + goto ret; + } + } + if (a_length != b_length) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + /* + Check the next not space character of the longer key. If it's < ' ', + then it's smaller than the other key. + */ + if (a_length < b_length) + { + /* put shorter key in s */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + res= -res; + } + for (end= a + a_length-length; a < end ; a++) + { + if (*a != ' ') + { + res= (*a < ' ') ? -swap : swap; + goto ret; + } + } + } + +ret: + + if (alloced) + my_str_free(alloced); + return res; +} + + +/* + strnxfrm replacment, convert Thai string to sortable string + + Arg: Destination buffer, source string, dest length and source length + Ret: Conveted string size +*/ + +static +size_t my_strnxfrm_tis620(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + size_t len, dstlen0= dstlen; + len= (uint) (strmake((char*) dst, (char*) src, min(dstlen, srclen)) - + (char*) dst); + len= thai2sortable(dst, len); + set_if_smaller(dstlen, nweights); + set_if_smaller(len, dstlen); + len= my_strxfrm_pad_desc_and_reverse(cs, dst, dst + len, dst + dstlen, + dstlen - len, flags, 0); + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len < dstlen0) + { + uint fill_length= dstlen0 - len; + cs->cset->fill(cs, (char*) dst + len, fill_length, cs->pad_char); + len= dstlen0; + } + return len; +} + + +static unsigned short cs_to_uni[256]={ +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0xFFFD,0x0E01,0x0E02,0x0E03,0x0E04,0x0E05,0x0E06,0x0E07, +0x0E08,0x0E09,0x0E0A,0x0E0B,0x0E0C,0x0E0D,0x0E0E,0x0E0F, +0x0E10,0x0E11,0x0E12,0x0E13,0x0E14,0x0E15,0x0E16,0x0E17, +0x0E18,0x0E19,0x0E1A,0x0E1B,0x0E1C,0x0E1D,0x0E1E,0x0E1F, +0x0E20,0x0E21,0x0E22,0x0E23,0x0E24,0x0E25,0x0E26,0x0E27, +0x0E28,0x0E29,0x0E2A,0x0E2B,0x0E2C,0x0E2D,0x0E2E,0x0E2F, +0x0E30,0x0E31,0x0E32,0x0E33,0x0E34,0x0E35,0x0E36,0x0E37, +0x0E38,0x0E39,0x0E3A,0xFFFD,0xFFFD,0xFFFD,0xFFFD,0x0E3F, +0x0E40,0x0E41,0x0E42,0x0E43,0x0E44,0x0E45,0x0E46,0x0E47, +0x0E48,0x0E49,0x0E4A,0x0E4B,0x0E4C,0x0E4D,0x0E4E,0x0E4F, +0x0E50,0x0E51,0x0E52,0x0E53,0x0E54,0x0E55,0x0E56,0x0E57, +0x0E58,0x0E59,0x0E5A,0x0E5B,0xFFFD,0xFFFD,0xFFFD,0xFFFD +}; +static uchar pl00[256]={ +0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, +0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, +0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, +0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; +static uchar pl0E[256]={ +0x0000,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, +0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, +0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, +0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, +0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, +0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, +0x00D8,0x00D9,0x00DA,0x0000,0x0000,0x0000,0x0000,0x00DF, +0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, +0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, +0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, +0x00F8,0x00F9,0x00FA,0x00FB,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; +static uchar plFF[256]={ +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000,0x00FF,0x0000,0x0000 +}; +static uchar *uni_to_cs[256]={ +pl00,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,pl0E,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +NULL,NULL,NULL,NULL,NULL,NULL,NULL,plFF +}; + + +static +int my_mb_wc_tis620(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *wc, + const uchar *str, + const uchar *end __attribute__((unused))) +{ + if (str >= end) + return MY_CS_TOOSMALL; + + *wc=cs_to_uni[*str]; + return (!wc[0] && str[0]) ? -1 : 1; +} + +static +int my_wc_mb_tis620(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, + uchar *str, + uchar *end __attribute__((unused))) +{ + uchar *pl; + + if (str >= end) + return MY_CS_TOOSMALL; + + pl= uni_to_cs[(wc>>8) & 0xFF]; + str[0]= pl ? pl[wc & 0xFF] : '\0'; + return (!str[0] && wc) ? MY_CS_ILUNI : 1; +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_tis620, + my_strnncollsp_tis620, + my_strnxfrm_tis620, + my_strnxfrmlen_simple, + my_like_range_simple, + my_wildcmp_8bit, /* wildcmp */ + my_strcasecmp_8bit, + my_instr_simple, /* QQ: To be fixed */ + my_hash_sort_simple, + my_propagate_simple +}; + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + NULL, /* ismbchar */ + my_mbcharlen_8bit, /* mbcharlen */ + my_numchars_8bit, + my_charpos_8bit, + my_well_formed_len_8bit, + my_lengthsp_8bit, + my_numcells_8bit, + my_mb_wc_tis620, /* mb_wc */ + my_wc_mb_tis620, /* wc_mb */ + my_mb_ctype_8bit, + my_caseup_str_8bit, + my_casedn_str_8bit, + my_caseup_8bit, + my_casedn_8bit, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + + +CHARSET_INFO my_charset_tis620_thai_ci= +{ + 18,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ + "tis620", /* cs name */ + "tis620_thai_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_tis620, + to_lower_tis620, + to_upper_tis620, + sort_order_tis620, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 4, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + +CHARSET_INFO my_charset_tis620_bin= +{ + 89,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "tis620", /* cs name */ + "tis620_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_tis620, + to_lower_tis620, + to_upper_tis620, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_8bit_bin_handler +}; + + +#endif diff --git a/externals/mysql/strings/ctype-uca.c b/externals/mysql/strings/ctype-uca.c new file mode 100644 index 00000000000..48a43fa1eef --- /dev/null +++ b/externals/mysql/strings/ctype-uca.c @@ -0,0 +1,11672 @@ +/* Copyright (C) 2004 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* + UCA (Unicode Collation Algorithm) support. + Written by Alexander Barkov + + Currently supports only subset of the full UCA: + - Only Primary level key comparison + - Basic Latin letters contraction is implemented + - Variable weighting is done for Non-ignorable option + + Features that are not implemented yet: + - No Normalization From D is done + + No decomposition is done + + No Thai/Lao orderding is done + - No combining marks processing is done +*/ + + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_UCA_COLLATIONS + +#define MY_UCA_NPAGES 256 +#define MY_UCA_NCHARS 256 +#define MY_UCA_CMASK 255 +#define MY_UCA_PSHIFT 8 + +uint16 page000data[]= { /* 0000 (4 weights per char) */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0201,0x0000,0x0000,0x0000, +0x0202,0x0000,0x0000,0x0000, 0x0203,0x0000,0x0000,0x0000, +0x0204,0x0000,0x0000,0x0000, 0x0205,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000, 0x0251,0x0000,0x0000,0x0000, +0x027E,0x0000,0x0000,0x0000, 0x02D2,0x0000,0x0000,0x0000, +0x0E0F,0x0000,0x0000,0x0000, 0x02D3,0x0000,0x0000,0x0000, +0x02CF,0x0000,0x0000,0x0000, 0x0277,0x0000,0x0000,0x0000, +0x0288,0x0000,0x0000,0x0000, 0x0289,0x0000,0x0000,0x0000, +0x02C8,0x0000,0x0000,0x0000, 0x0428,0x0000,0x0000,0x0000, +0x022F,0x0000,0x0000,0x0000, 0x0221,0x0000,0x0000,0x0000, +0x025D,0x0000,0x0000,0x0000, 0x02CC,0x0000,0x0000,0x0000, +0x0E29,0x0000,0x0000,0x0000, 0x0E2A,0x0000,0x0000,0x0000, +0x0E2B,0x0000,0x0000,0x0000, 0x0E2C,0x0000,0x0000,0x0000, +0x0E2D,0x0000,0x0000,0x0000, 0x0E2E,0x0000,0x0000,0x0000, +0x0E2F,0x0000,0x0000,0x0000, 0x0E30,0x0000,0x0000,0x0000, +0x0E31,0x0000,0x0000,0x0000, 0x0E32,0x0000,0x0000,0x0000, +0x023D,0x0000,0x0000,0x0000, 0x023A,0x0000,0x0000,0x0000, +0x042C,0x0000,0x0000,0x0000, 0x042D,0x0000,0x0000,0x0000, +0x042E,0x0000,0x0000,0x0000, 0x0255,0x0000,0x0000,0x0000, +0x02C7,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E4A,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000, +0x0EB9,0x0000,0x0000,0x0000, 0x0EC1,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0F10,0x0000,0x0000,0x0000, 0x0F21,0x0000,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000, +0x0F64,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000, +0x0FA7,0x0000,0x0000,0x0000, 0x0FB4,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000, 0x0FEA,0x0000,0x0000,0x0000, +0x1002,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000, 0x1051,0x0000,0x0000,0x0000, +0x105A,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000, +0x106A,0x0000,0x0000,0x0000, 0x028A,0x0000,0x0000,0x0000, +0x02CE,0x0000,0x0000,0x0000, 0x028B,0x0000,0x0000,0x0000, +0x020F,0x0000,0x0000,0x0000, 0x021B,0x0000,0x0000,0x0000, +0x020C,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E4A,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000, +0x0EB9,0x0000,0x0000,0x0000, 0x0EC1,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0F10,0x0000,0x0000,0x0000, 0x0F21,0x0000,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000, +0x0F64,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000, +0x0FA7,0x0000,0x0000,0x0000, 0x0FB4,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000, 0x0FEA,0x0000,0x0000,0x0000, +0x1002,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000, 0x1051,0x0000,0x0000,0x0000, +0x105A,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000, +0x106A,0x0000,0x0000,0x0000, 0x028C,0x0000,0x0000,0x0000, +0x0430,0x0000,0x0000,0x0000, 0x028D,0x0000,0x0000,0x0000, +0x0433,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0206,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000, 0x0252,0x0000,0x0000,0x0000, +0x0E0E,0x0000,0x0000,0x0000, 0x0E10,0x0000,0x0000,0x0000, +0x0E0D,0x0000,0x0000,0x0000, 0x0E11,0x0000,0x0000,0x0000, +0x0431,0x0000,0x0000,0x0000, 0x02C2,0x0000,0x0000,0x0000, +0x0214,0x0000,0x0000,0x0000, 0x02C5,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0286,0x0000,0x0000,0x0000, +0x042F,0x0000,0x0000,0x0000, 0x0220,0x0000,0x0000,0x0000, +0x02C6,0x0000,0x0000,0x0000, 0x0210,0x0000,0x0000,0x0000, +0x034A,0x0000,0x0000,0x0000, 0x0429,0x0000,0x0000,0x0000, +0x0E2B,0x0000,0x0000,0x0000, 0x0E2C,0x0000,0x0000,0x0000, +0x020D,0x0000,0x0000,0x0000, 0x10F8,0x0000,0x0000,0x0000, +0x02C3,0x0000,0x0000,0x0000, 0x0267,0x0000,0x0000,0x0000, +0x0219,0x0000,0x0000,0x0000, 0x0E2A,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x0287,0x0000,0x0000,0x0000, +0x0E2A,0x02CD,0x0E2D,0x0000, 0x0E2A,0x02CD,0x0E2B,0x0000, +0x0E2C,0x02CD,0x0E2D,0x0000, 0x0256,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E38,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0E86,0x0000,0x0000,0x0000, 0x0F64,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x042B,0x0000,0x0000,0x0000, +0x0F8D,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x101F,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x101F,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000, +0x1094,0x0000,0x0000,0x0000, 0x0FEA,0x0FEA,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E38,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0E86,0x0000,0x0000,0x0000, 0x0F64,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x042A,0x0000,0x0000,0x0000, +0x0F8D,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x101F,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x101F,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000, +0x1094,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000 +}; + +uint16 page001data[]= { /* 0100 (3 weights per char) */ +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, +0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, +0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E72,0x0000,0x0000, 0x0E72,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EED,0x0000,0x0000, +0x0EED,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFF,0x0000,0x0000, 0x0EFB,0x0F10,0x0000, +0x0EFB,0x0F10,0x0000, 0x0F10,0x0000,0x0000, 0x0F10,0x0000,0x0000, +0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0FBC,0x0000,0x0000, +0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, +0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, +0x0F2E,0x0267,0x0000, 0x0F2E,0x0267,0x0000, 0x0F36,0x0000,0x0000, +0x0F36,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x10B1,0x0F64,0x0000, 0x0F7E,0x0000,0x0000, +0x0F7E,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0E8B,0x0000, 0x0F82,0x0E8B,0x0000, +0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, +0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, +0x1007,0x0000,0x0000, 0x1007,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1051,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x105E,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, +0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, +0x106A,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0E52,0x0000,0x0000, +0x0E58,0x0000,0x0000, 0x0E5C,0x0000,0x0000, 0x0E5C,0x0000,0x0000, +0x10A8,0x0000,0x0000, 0x10A8,0x0000,0x0000, 0x0F92,0x0000,0x0000, +0x0E65,0x0000,0x0000, 0x0E65,0x0000,0x0000, 0x0E76,0x0000,0x0000, +0x0E7A,0x0000,0x0000, 0x0E7E,0x0000,0x0000, 0x0E7E,0x0000,0x0000, +0x106A,0x1051,0x0000, 0x0E90,0x0000,0x0000, 0x0E94,0x0000,0x0000, +0x0E98,0x0000,0x0000, 0x0EBD,0x0000,0x0000, 0x0EBD,0x0000,0x0000, +0x0ED1,0x0000,0x0000, 0x0ED9,0x0000,0x0000, 0x0EE9,0x0000,0x0000, +0x0F0C,0x0000,0x0000, 0x0F08,0x0000,0x0000, 0x0F26,0x0000,0x0000, +0x0F26,0x0000,0x0000, 0x0F3B,0x0000,0x0000, 0x0F53,0x0000,0x0000, +0x1037,0x0000,0x0000, 0x0F6E,0x0000,0x0000, 0x0F72,0x0000,0x0000, +0x0F9A,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0EDD,0x0000,0x0000, 0x0EDD,0x0000,0x0000, 0x0FAC,0x0000,0x0000, +0x0FAC,0x0000,0x0000, 0x0FC4,0x0000,0x0000, 0x10A0,0x0000,0x0000, +0x10A0,0x0000,0x0000, 0x0FF2,0x0000,0x0000, 0x0FF6,0x0000,0x0000, +0x100B,0x0000,0x0000, 0x100F,0x0000,0x0000, 0x100F,0x0000,0x0000, +0x1013,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x1040,0x0000,0x0000, 0x1049,0x0000,0x0000, 0x1066,0x0000,0x0000, +0x1066,0x0000,0x0000, 0x106F,0x0000,0x0000, 0x106F,0x0000,0x0000, +0x107F,0x0000,0x0000, 0x1084,0x0000,0x0000, 0x1084,0x0000,0x0000, +0x1088,0x0000,0x0000, 0x109C,0x0000,0x0000, 0x10A4,0x0000,0x0000, +0x10A4,0x0000,0x0000, 0x1002,0x0FEA,0x0000, 0x1098,0x0000,0x0000, +0x10C8,0x0000,0x0000, 0x10CC,0x0000,0x0000, 0x10D0,0x0000,0x0000, +0x10D4,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x106A,0x0000, +0x0E6D,0x106A,0x0000, 0x0F2E,0x0F10,0x0000, 0x0F2E,0x0F10,0x0000, +0x0F2E,0x0F10,0x0000, 0x0F64,0x0F10,0x0000, 0x0F64,0x0F10,0x0000, +0x0F64,0x0F10,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x0E90,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000, +0x0ECD,0x0000,0x0000, 0x0ECD,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EC1,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x107F,0x0000,0x0000, 0x107F,0x0000,0x0000, +0x0F10,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x106A,0x0000, +0x0E6D,0x106A,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EE9,0x0000,0x0000, 0x1098,0x0000,0x0000, 0x0F64,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0F8D,0x0000,0x0000, +0x0F8D,0x0000,0x0000 }; + +uint16 page002data[]= { /* 0200 (3 weights per char) */ +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, +0x1002,0x0000,0x0000, 0x1090,0x0000,0x0000, 0x1090,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0F72,0x0000,0x0000, +0x0E82,0x0000,0x0000, 0x0FA2,0x0000,0x0000, 0x0FA2,0x0000,0x0000, +0x1073,0x0000,0x0000, 0x1073,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x105E,0x0000,0x0000, 0x0F4B,0x0000,0x0000, 0x0F7A,0x0000,0x0000, +0x1017,0x0000,0x0000, 0xFBC0,0x8237,0x0000, 0xFBC0,0x8238,0x0000, +0xFBC0,0x8239,0x0000, 0xFBC0,0x823A,0x0000, 0xFBC0,0x823B,0x0000, +0xFBC0,0x823C,0x0000, 0xFBC0,0x823D,0x0000, 0xFBC0,0x823E,0x0000, +0xFBC0,0x823F,0x0000, 0xFBC0,0x8240,0x0000, 0xFBC0,0x8241,0x0000, +0xFBC0,0x8242,0x0000, 0xFBC0,0x8243,0x0000, 0xFBC0,0x8244,0x0000, +0xFBC0,0x8245,0x0000, 0xFBC0,0x8246,0x0000, 0xFBC0,0x8247,0x0000, +0xFBC0,0x8248,0x0000, 0xFBC0,0x8249,0x0000, 0xFBC0,0x824A,0x0000, +0xFBC0,0x824B,0x0000, 0xFBC0,0x824C,0x0000, 0xFBC0,0x824D,0x0000, +0xFBC0,0x824E,0x0000, 0xFBC0,0x824F,0x0000, 0x0E3E,0x0000,0x0000, +0x0E42,0x0000,0x0000, 0x0E46,0x0000,0x0000, 0x0E58,0x0000,0x0000, +0x0F92,0x0000,0x0000, 0x0E69,0x0000,0x0000, 0x0E76,0x0000,0x0000, +0x0E7A,0x0000,0x0000, 0x0E9C,0x0000,0x0000, 0x0E94,0x0000,0x0000, +0x0EA0,0x0000,0x0000, 0x0E98,0x0000,0x0000, 0x0EA4,0x0000,0x0000, +0x0EA9,0x0000,0x0000, 0x0EAD,0x0000,0x0000, 0x0F19,0x0000,0x0000, +0x0ED1,0x0000,0x0000, 0x0EC5,0x0000,0x0000, 0x0EC9,0x0000,0x0000, +0x0ED9,0x0000,0x0000, 0x0EB5,0x0000,0x0000, 0x102B,0x0000,0x0000, +0x0EF1,0x0000,0x0000, 0x0EF5,0x0000,0x0000, 0x0F08,0x0000,0x0000, +0x0F0C,0x0000,0x0000, 0x0F03,0x0000,0x0000, 0x0F3F,0x0000,0x0000, +0x0F43,0x0000,0x0000, 0x0F47,0x0000,0x0000, 0x0F4F,0x0000,0x0000, +0x1037,0x0000,0x0000, 0x103C,0x0000,0x0000, 0x0F60,0x0000,0x0000, +0x0F6E,0x0000,0x0000, 0x0F76,0x0000,0x0000, 0x0F68,0x0000,0x0000, +0x0F9A,0x0000,0x0000, 0x0F88,0x0000,0x0000, 0x0F9E,0x0000,0x0000, +0x0FB0,0x0000,0x0000, 0x0FC9,0x0000,0x0000, 0x0FCE,0x0000,0x0000, +0x0FD2,0x0000,0x0000, 0x0FD6,0x0000,0x0000, 0x0FDA,0x0000,0x0000, +0x0FDE,0x0000,0x0000, 0x0FE2,0x0000,0x0000, 0x0FC4,0x0000,0x0000, +0x0FE6,0x0000,0x0000, 0x0FEE,0x0000,0x0000, 0x0FF2,0x0000,0x0000, +0x0F1D,0x0000,0x0000, 0x0FFA,0x0000,0x0000, 0x0FFE,0x0000,0x0000, +0x101B,0x0000,0x0000, 0x1013,0x0000,0x0000, 0x1027,0x0000,0x0000, +0x1040,0x0000,0x0000, 0x1049,0x0000,0x0000, 0x104D,0x0000,0x0000, +0x1056,0x0000,0x0000, 0x0F57,0x0000,0x0000, 0x1062,0x0000,0x0000, +0x1077,0x0000,0x0000, 0x107B,0x0000,0x0000, 0x107F,0x0000,0x0000, +0x108C,0x0000,0x0000, 0x10AC,0x0000,0x0000, 0x10B4,0x0000,0x0000, +0x10C4,0x0000,0x0000, 0x10D8,0x0000,0x0000, 0x10DC,0x0000,0x0000, +0x0E4E,0x0000,0x0000, 0x0EB1,0x0000,0x0000, 0x0ED5,0x0000,0x0000, +0x0EE5,0x0000,0x0000, 0x0F15,0x0000,0x0000, 0x0F2A,0x0000,0x0000, +0x0F32,0x0000,0x0000, 0x0FB8,0x0000,0x0000, 0x10BC,0x0000,0x0000, +0x10C0,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x107F,0x0000, +0x0E6D,0x107B,0x0000, 0x1002,0x0FEA,0x0000, 0x1002,0x0FF2,0x0000, +0x1002,0x0E69,0x0000, 0x0EB9,0x0F7E,0x0000, 0x0F2E,0x0FEA,0x0000, +0x0F2E,0x106A,0x0000, 0x10E0,0x0000,0x0000, 0x10E4,0x0000,0x0000, +0x102F,0x0000,0x0000, 0x1033,0x0000,0x0000, 0x0EE1,0x0000,0x0000, +0x0EF1,0x0000,0x0000, 0x0F10,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FC9,0x0000,0x0000, 0x0FD2,0x0000,0x0000, 0x0FE6,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x0317,0x0000,0x0000, +0x0319,0x0000,0x0000, 0x0EF9,0x0000,0x0000, 0x10B1,0x0000,0x0000, +0x0EFA,0x0000,0x0000, 0x10B3,0x0000,0x0000, 0x10B8,0x0000,0x0000, +0x10B0,0x0000,0x0000, 0x10B9,0x0000,0x0000, 0x031A,0x0000,0x0000, +0x031B,0x0000,0x0000, 0x031C,0x0000,0x0000, 0x031D,0x0000,0x0000, +0x031E,0x0000,0x0000, 0x031F,0x0000,0x0000, 0x0320,0x0000,0x0000, +0x0321,0x0000,0x0000, 0x0322,0x0000,0x0000, 0x0323,0x0000,0x0000, +0x0324,0x0000,0x0000, 0x0325,0x0000,0x0000, 0x0326,0x0000,0x0000, +0x0327,0x0000,0x0000, 0x0E01,0x0000,0x0000, 0x0E02,0x0000,0x0000, +0x0328,0x0000,0x0000, 0x0329,0x0000,0x0000, 0x032A,0x0000,0x0000, +0x032B,0x0000,0x0000, 0x032C,0x0000,0x0000, 0x032D,0x0000,0x0000, +0x0212,0x0000,0x0000, 0x0213,0x0000,0x0000, 0x0215,0x0000,0x0000, +0x021A,0x0000,0x0000, 0x020E,0x0000,0x0000, 0x0216,0x0000,0x0000, +0x032E,0x0000,0x0000, 0x032F,0x0000,0x0000, 0x0ED9,0x0000,0x0000, +0x0F2E,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x105A,0x0000,0x0000, +0x10B4,0x0000,0x0000, 0x0330,0x0000,0x0000, 0x0331,0x0000,0x0000, +0x0332,0x0000,0x0000, 0x0333,0x0000,0x0000, 0x0334,0x0000,0x0000, +0x0335,0x0000,0x0000, 0x0336,0x0000,0x0000, 0x0337,0x0000,0x0000, +0x0338,0x0000,0x0000, 0x10B2,0x0000,0x0000, 0x0339,0x0000,0x0000, +0x033A,0x0000,0x0000, 0x033B,0x0000,0x0000, 0x033C,0x0000,0x0000, +0x033D,0x0000,0x0000, 0x033E,0x0000,0x0000, 0x033F,0x0000,0x0000, +0x0340,0x0000,0x0000, 0x0341,0x0000,0x0000, 0x0342,0x0000,0x0000, +0x0343,0x0000,0x0000, 0x0344,0x0000,0x0000, 0x0345,0x0000,0x0000, +0x0346,0x0000,0x0000, 0x0347,0x0000,0x0000, 0x0348,0x0000,0x0000, +0x0349,0x0000,0x0000 }; + +uint16 page003data[]= { /* 0300 (4 weights per char) */ +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0xFBC0,0x8358,0x0000,0x0000, 0xFBC0,0x8359,0x0000,0x0000, +0xFBC0,0x835A,0x0000,0x0000, 0xFBC0,0x835B,0x0000,0x0000, +0xFBC0,0x835C,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000, 0x0E6D,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000, 0x1002,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000, 0x105A,0x0000,0x0000,0x0000, +0xFBC0,0x8370,0x0000,0x0000, 0xFBC0,0x8371,0x0000,0x0000, +0xFBC0,0x8372,0x0000,0x0000, 0xFBC0,0x8373,0x0000,0x0000, +0x0317,0x0000,0x0000,0x0000, 0x0318,0x0000,0x0000,0x0000, +0xFBC0,0x8376,0x0000,0x0000, 0xFBC0,0x8377,0x0000,0x0000, +0xFBC0,0x8378,0x0000,0x0000, 0xFBC0,0x8379,0x0000,0x0000, +0x10F3,0x0000,0x0000,0x0000, 0xFBC0,0x837B,0x0000,0x0000, +0xFBC0,0x837C,0x0000,0x0000, 0xFBC0,0x837D,0x0000,0x0000, +0x023A,0x0000,0x0000,0x0000, 0xFBC0,0x837F,0x0000,0x0000, +0xFBC0,0x8380,0x0000,0x0000, 0xFBC0,0x8381,0x0000,0x0000, +0xFBC0,0x8382,0x0000,0x0000, 0xFBC0,0x8383,0x0000,0x0000, +0x020D,0x0000,0x0000,0x0000, 0x0214,0x0000,0x0000,0x0000, +0x10E8,0x0000,0x0000,0x0000, 0x0267,0x0000,0x0000,0x0000, +0x10ED,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000, +0x10F3,0x0000,0x0000,0x0000, 0xFBC0,0x838B,0x0000,0x0000, +0x10FB,0x0000,0x0000,0x0000, 0xFBC0,0x838D,0x0000,0x0000, +0x1104,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000, +0x10F3,0x0000,0x0000,0x0000, 0x10E8,0x0000,0x0000,0x0000, +0x10E9,0x0000,0x0000,0x0000, 0x10EA,0x0000,0x0000,0x0000, +0x10EC,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000, +0x10F0,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000, +0x10F2,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000, +0x10F5,0x0000,0x0000,0x0000, 0x10F6,0x0000,0x0000,0x0000, +0x10F8,0x0000,0x0000,0x0000, 0x10F9,0x0000,0x0000,0x0000, +0x10FA,0x0000,0x0000,0x0000, 0x10FB,0x0000,0x0000,0x0000, +0x10FC,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000, +0xFBC0,0x83A2,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000, +0x1103,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000, +0x1105,0x0000,0x0000,0x0000, 0x1106,0x0000,0x0000,0x0000, +0x1107,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000, +0x10F3,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000, +0x10E8,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000, +0x10F1,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000, +0x1104,0x0000,0x0000,0x0000, 0x10E8,0x0000,0x0000,0x0000, +0x10E9,0x0000,0x0000,0x0000, 0x10EA,0x0000,0x0000,0x0000, +0x10EC,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000, +0x10F0,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000, +0x10F2,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000, +0x10F5,0x0000,0x0000,0x0000, 0x10F6,0x0000,0x0000,0x0000, +0x10F8,0x0000,0x0000,0x0000, 0x10F9,0x0000,0x0000,0x0000, +0x10FA,0x0000,0x0000,0x0000, 0x10FB,0x0000,0x0000,0x0000, +0x10FC,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000, +0x1102,0x0000,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000, +0x1103,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000, +0x1105,0x0000,0x0000,0x0000, 0x1106,0x0000,0x0000,0x0000, +0x1107,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000, +0x10F3,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000, +0x10FB,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000, +0x1109,0x0000,0x0000,0x0000, 0xFBC0,0x83CF,0x0000,0x0000, +0x10E9,0x0000,0x0000,0x0000, 0x10F2,0x0000,0x0000,0x0000, +0x1104,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000, +0x1104,0x0000,0x0000,0x0000, 0x1105,0x0000,0x0000,0x0000, +0x10FC,0x0000,0x0000,0x0000, 0x10F5,0x10E8,0x10F3,0x0000, +0x10FF,0x0000,0x0000,0x0000, 0x10FF,0x0000,0x0000,0x0000, +0x10EF,0x0000,0x0000,0x0000, 0x10EF,0x0000,0x0000,0x0000, +0x10EE,0x0000,0x0000,0x0000, 0x10EE,0x0000,0x0000,0x0000, +0x10FE,0x0000,0x0000,0x0000, 0x10FE,0x0000,0x0000,0x0000, +0x110A,0x0000,0x0000,0x0000, 0x110A,0x0000,0x0000,0x0000, +0x110D,0x0000,0x0000,0x0000, 0x110D,0x0000,0x0000,0x0000, +0x110E,0x0000,0x0000,0x0000, 0x110E,0x0000,0x0000,0x0000, +0x110F,0x0000,0x0000,0x0000, 0x110F,0x0000,0x0000,0x0000, +0x1110,0x0000,0x0000,0x0000, 0x1110,0x0000,0x0000,0x0000, +0x1111,0x0000,0x0000,0x0000, 0x1111,0x0000,0x0000,0x0000, +0x1112,0x0000,0x0000,0x0000, 0x1112,0x0000,0x0000,0x0000, +0x1113,0x0000,0x0000,0x0000, 0x1113,0x0000,0x0000,0x0000, +0x10F5,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000, +0x1102,0x0000,0x0000,0x0000, 0x10F4,0x0000,0x0000,0x0000, +0x10F2,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000, +0x0423,0x0000,0x0000,0x0000, 0x110B,0x0000,0x0000,0x0000, +0x110B,0x0000,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000, +0x110C,0x0000,0x0000,0x0000, 0x110C,0x0000,0x0000,0x0000, +0xFBC0,0x83FC,0x0000,0x0000, 0xFBC0,0x83FD,0x0000,0x0000, +0xFBC0,0x83FE,0x0000,0x0000, 0xFBC0,0x83FF,0x0000,0x0000 +}; + +uint16 page004data[]= { /* 0400 (3 weights per char) */ +0x1152,0x0000,0x0000, 0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000, +0x114A,0x0000,0x0000, 0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000, +0x1188,0x0000,0x0000, 0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000, +0x11B9,0x0000,0x0000, 0x11DA,0x0000,0x0000, 0x1215,0x0000,0x0000, +0x1219,0x0000,0x0000, 0x117C,0x0000,0x0000, 0x1221,0x0000,0x0000, +0x127D,0x0000,0x0000, 0x1114,0x0000,0x0000, 0x112C,0x0000,0x0000, +0x1130,0x0000,0x0000, 0x1134,0x0000,0x0000, 0x1140,0x0000,0x0000, +0x1152,0x0000,0x0000, 0x115E,0x0000,0x0000, 0x116A,0x0000,0x0000, +0x117C,0x0000,0x0000, 0x1190,0x0000,0x0000, 0x1198,0x0000,0x0000, +0x11B0,0x0000,0x0000, 0x11BE,0x0000,0x0000, 0x11C6,0x0000,0x0000, +0x11DF,0x0000,0x0000, 0x11EF,0x0000,0x0000, 0x11FB,0x0000,0x0000, +0x1203,0x0000,0x0000, 0x120C,0x0000,0x0000, 0x121D,0x0000,0x0000, +0x1239,0x0000,0x0000, 0x123D,0x0000,0x0000, 0x1259,0x0000,0x0000, +0x1261,0x0000,0x0000, 0x1281,0x0000,0x0000, 0x1285,0x0000,0x0000, +0x1289,0x0000,0x0000, 0x128D,0x0000,0x0000, 0x1295,0x0000,0x0000, +0x12A1,0x0000,0x0000, 0x12A9,0x0000,0x0000, 0x12AD,0x0000,0x0000, +0x1114,0x0000,0x0000, 0x112C,0x0000,0x0000, 0x1130,0x0000,0x0000, +0x1134,0x0000,0x0000, 0x1140,0x0000,0x0000, 0x1152,0x0000,0x0000, +0x115E,0x0000,0x0000, 0x116A,0x0000,0x0000, 0x117C,0x0000,0x0000, +0x1190,0x0000,0x0000, 0x1198,0x0000,0x0000, 0x11B0,0x0000,0x0000, +0x11BE,0x0000,0x0000, 0x11C6,0x0000,0x0000, 0x11DF,0x0000,0x0000, +0x11EF,0x0000,0x0000, 0x11FB,0x0000,0x0000, 0x1203,0x0000,0x0000, +0x120C,0x0000,0x0000, 0x121D,0x0000,0x0000, 0x1239,0x0000,0x0000, +0x123D,0x0000,0x0000, 0x1259,0x0000,0x0000, 0x1261,0x0000,0x0000, +0x1281,0x0000,0x0000, 0x1285,0x0000,0x0000, 0x1289,0x0000,0x0000, +0x128D,0x0000,0x0000, 0x1295,0x0000,0x0000, 0x12A1,0x0000,0x0000, +0x12A9,0x0000,0x0000, 0x12AD,0x0000,0x0000, 0x1152,0x0000,0x0000, +0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000, 0x114A,0x0000,0x0000, +0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000, 0x1188,0x0000,0x0000, +0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000, 0x11B9,0x0000,0x0000, +0x11DA,0x0000,0x0000, 0x1215,0x0000,0x0000, 0x1219,0x0000,0x0000, +0x117C,0x0000,0x0000, 0x1221,0x0000,0x0000, 0x127D,0x0000,0x0000, +0x1249,0x0000,0x0000, 0x1249,0x0000,0x0000, 0x129D,0x0000,0x0000, +0x129D,0x0000,0x0000, 0x12B1,0x0000,0x0000, 0x12B1,0x0000,0x0000, +0x12B5,0x0000,0x0000, 0x12B5,0x0000,0x0000, 0x12BD,0x0000,0x0000, +0x12BD,0x0000,0x0000, 0x12B9,0x0000,0x0000, 0x12B9,0x0000,0x0000, +0x12C1,0x0000,0x0000, 0x12C1,0x0000,0x0000, 0x12C5,0x0000,0x0000, +0x12C5,0x0000,0x0000, 0x12C9,0x0000,0x0000, 0x12C9,0x0000,0x0000, +0x12CD,0x0000,0x0000, 0x12CD,0x0000,0x0000, 0x12D1,0x0000,0x0000, +0x12D1,0x0000,0x0000, 0x12D5,0x0000,0x0000, 0x12D5,0x0000,0x0000, +0x1235,0x0000,0x0000, 0x1235,0x0000,0x0000, 0x1255,0x0000,0x0000, +0x1255,0x0000,0x0000, 0x1251,0x0000,0x0000, 0x1251,0x0000,0x0000, +0x124D,0x0000,0x0000, 0x124D,0x0000,0x0000, 0x11F7,0x0000,0x0000, +0x11F7,0x0000,0x0000, 0x034B,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x8487,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x1180,0x0000,0x0000, 0x1180,0x0000,0x0000, 0x1299,0x0000,0x0000, +0x1299,0x0000,0x0000, 0x11FF,0x0000,0x0000, 0x11FF,0x0000,0x0000, +0x1134,0x0000,0x0000, 0x1134,0x0000,0x0000, 0x1138,0x0000,0x0000, +0x1138,0x0000,0x0000, 0x113C,0x0000,0x0000, 0x113C,0x0000,0x0000, +0x1166,0x0000,0x0000, 0x1166,0x0000,0x0000, 0x114E,0x0000,0x0000, +0x114E,0x0000,0x0000, 0x119C,0x0000,0x0000, 0x119C,0x0000,0x0000, +0x11AC,0x0000,0x0000, 0x11AC,0x0000,0x0000, 0x11A8,0x0000,0x0000, +0x11A8,0x0000,0x0000, 0x11A4,0x0000,0x0000, 0x11A4,0x0000,0x0000, +0x11CE,0x0000,0x0000, 0x11CE,0x0000,0x0000, 0x11D6,0x0000,0x0000, +0x11D6,0x0000,0x0000, 0x11F3,0x0000,0x0000, 0x11F3,0x0000,0x0000, +0x12D9,0x0000,0x0000, 0x12D9,0x0000,0x0000, 0x1208,0x0000,0x0000, +0x1208,0x0000,0x0000, 0x1211,0x0000,0x0000, 0x1211,0x0000,0x0000, +0x122D,0x0000,0x0000, 0x122D,0x0000,0x0000, 0x1231,0x0000,0x0000, +0x1231,0x0000,0x0000, 0x1241,0x0000,0x0000, 0x1241,0x0000,0x0000, +0x125D,0x0000,0x0000, 0x125D,0x0000,0x0000, 0x1269,0x0000,0x0000, +0x1269,0x0000,0x0000, 0x1271,0x0000,0x0000, 0x1271,0x0000,0x0000, +0x1245,0x0000,0x0000, 0x1245,0x0000,0x0000, 0x1275,0x0000,0x0000, +0x1275,0x0000,0x0000, 0x1279,0x0000,0x0000, 0x1279,0x0000,0x0000, +0x12DD,0x0000,0x0000, 0x115E,0x0000,0x0000, 0x115E,0x0000,0x0000, +0x11A0,0x0000,0x0000, 0x11A0,0x0000,0x0000, 0x11B5,0x0000,0x0000, +0x11B5,0x0000,0x0000, 0x11D2,0x0000,0x0000, 0x11D2,0x0000,0x0000, +0x11CA,0x0000,0x0000, 0x11CA,0x0000,0x0000, 0x126D,0x0000,0x0000, +0x126D,0x0000,0x0000, 0x11C2,0x0000,0x0000, 0x11C2,0x0000,0x0000, +0xFBC0,0x84CF,0x0000, 0x1118,0x0000,0x0000, 0x1118,0x0000,0x0000, +0x111C,0x0000,0x0000, 0x111C,0x0000,0x0000, 0x1128,0x0000,0x0000, +0x1128,0x0000,0x0000, 0x1156,0x0000,0x0000, 0x1156,0x0000,0x0000, +0x1120,0x0000,0x0000, 0x1120,0x0000,0x0000, 0x1124,0x0000,0x0000, +0x1124,0x0000,0x0000, 0x1162,0x0000,0x0000, 0x1162,0x0000,0x0000, +0x116F,0x0000,0x0000, 0x116F,0x0000,0x0000, 0x1177,0x0000,0x0000, +0x1177,0x0000,0x0000, 0x117C,0x0000,0x0000, 0x117C,0x0000,0x0000, +0x1184,0x0000,0x0000, 0x1184,0x0000,0x0000, 0x11E3,0x0000,0x0000, +0x11E3,0x0000,0x0000, 0x11E7,0x0000,0x0000, 0x11E7,0x0000,0x0000, +0x11EB,0x0000,0x0000, 0x11EB,0x0000,0x0000, 0x12A5,0x0000,0x0000, +0x12A5,0x0000,0x0000, 0x121D,0x0000,0x0000, 0x121D,0x0000,0x0000, +0x1225,0x0000,0x0000, 0x1225,0x0000,0x0000, 0x1229,0x0000,0x0000, +0x1229,0x0000,0x0000, 0x1265,0x0000,0x0000, 0x1265,0x0000,0x0000, +0xFBC0,0x84F6,0x0000, 0xFBC0,0x84F7,0x0000, 0x1291,0x0000,0x0000, +0x1291,0x0000,0x0000, 0xFBC0,0x84FA,0x0000, 0xFBC0,0x84FB,0x0000, +0xFBC0,0x84FC,0x0000, 0xFBC0,0x84FD,0x0000, 0xFBC0,0x84FE,0x0000, +0xFBC0,0x84FF,0x0000 }; + +uint16 page005data[]= { /* 0500 (3 weights per char) */ +0x1144,0x0000,0x0000, 0x1144,0x0000,0x0000, 0x1149,0x0000,0x0000, +0x1149,0x0000,0x0000, 0x116E,0x0000,0x0000, 0x116E,0x0000,0x0000, +0x117B,0x0000,0x0000, 0x117B,0x0000,0x0000, 0x11BD,0x0000,0x0000, +0x11BD,0x0000,0x0000, 0x11DE,0x0000,0x0000, 0x11DE,0x0000,0x0000, +0x1207,0x0000,0x0000, 0x1207,0x0000,0x0000, 0x1210,0x0000,0x0000, +0x1210,0x0000,0x0000, 0xFBC0,0x8510,0x0000, 0xFBC0,0x8511,0x0000, +0xFBC0,0x8512,0x0000, 0xFBC0,0x8513,0x0000, 0xFBC0,0x8514,0x0000, +0xFBC0,0x8515,0x0000, 0xFBC0,0x8516,0x0000, 0xFBC0,0x8517,0x0000, +0xFBC0,0x8518,0x0000, 0xFBC0,0x8519,0x0000, 0xFBC0,0x851A,0x0000, +0xFBC0,0x851B,0x0000, 0xFBC0,0x851C,0x0000, 0xFBC0,0x851D,0x0000, +0xFBC0,0x851E,0x0000, 0xFBC0,0x851F,0x0000, 0xFBC0,0x8520,0x0000, +0xFBC0,0x8521,0x0000, 0xFBC0,0x8522,0x0000, 0xFBC0,0x8523,0x0000, +0xFBC0,0x8524,0x0000, 0xFBC0,0x8525,0x0000, 0xFBC0,0x8526,0x0000, +0xFBC0,0x8527,0x0000, 0xFBC0,0x8528,0x0000, 0xFBC0,0x8529,0x0000, +0xFBC0,0x852A,0x0000, 0xFBC0,0x852B,0x0000, 0xFBC0,0x852C,0x0000, +0xFBC0,0x852D,0x0000, 0xFBC0,0x852E,0x0000, 0xFBC0,0x852F,0x0000, +0xFBC0,0x8530,0x0000, 0x130A,0x0000,0x0000, 0x130B,0x0000,0x0000, +0x130C,0x0000,0x0000, 0x130D,0x0000,0x0000, 0x130E,0x0000,0x0000, +0x130F,0x0000,0x0000, 0x1310,0x0000,0x0000, 0x1311,0x0000,0x0000, +0x1312,0x0000,0x0000, 0x1313,0x0000,0x0000, 0x1314,0x0000,0x0000, +0x1315,0x0000,0x0000, 0x1316,0x0000,0x0000, 0x1317,0x0000,0x0000, +0x1318,0x0000,0x0000, 0x1319,0x0000,0x0000, 0x131A,0x0000,0x0000, +0x131B,0x0000,0x0000, 0x131C,0x0000,0x0000, 0x131D,0x0000,0x0000, +0x131E,0x0000,0x0000, 0x131F,0x0000,0x0000, 0x1320,0x0000,0x0000, +0x1321,0x0000,0x0000, 0x1322,0x0000,0x0000, 0x1323,0x0000,0x0000, +0x1324,0x0000,0x0000, 0x1325,0x0000,0x0000, 0x1326,0x0000,0x0000, +0x1327,0x0000,0x0000, 0x1328,0x0000,0x0000, 0x1329,0x0000,0x0000, +0x132A,0x0000,0x0000, 0x132B,0x0000,0x0000, 0x132C,0x0000,0x0000, +0x132D,0x0000,0x0000, 0x132E,0x0000,0x0000, 0x132F,0x0000,0x0000, +0xFBC0,0x8557,0x0000, 0xFBC0,0x8558,0x0000, 0x1330,0x0000,0x0000, +0x02EC,0x0000,0x0000, 0x02ED,0x0000,0x0000, 0x0253,0x0000,0x0000, +0x0230,0x0000,0x0000, 0x0257,0x0000,0x0000, 0x02EE,0x0000,0x0000, +0xFBC0,0x8560,0x0000, 0x130A,0x0000,0x0000, 0x130B,0x0000,0x0000, +0x130C,0x0000,0x0000, 0x130D,0x0000,0x0000, 0x130E,0x0000,0x0000, +0x130F,0x0000,0x0000, 0x1310,0x0000,0x0000, 0x1311,0x0000,0x0000, +0x1312,0x0000,0x0000, 0x1313,0x0000,0x0000, 0x1314,0x0000,0x0000, +0x1315,0x0000,0x0000, 0x1316,0x0000,0x0000, 0x1317,0x0000,0x0000, +0x1318,0x0000,0x0000, 0x1319,0x0000,0x0000, 0x131A,0x0000,0x0000, +0x131B,0x0000,0x0000, 0x131C,0x0000,0x0000, 0x131D,0x0000,0x0000, +0x131E,0x0000,0x0000, 0x131F,0x0000,0x0000, 0x1320,0x0000,0x0000, +0x1321,0x0000,0x0000, 0x1322,0x0000,0x0000, 0x1323,0x0000,0x0000, +0x1324,0x0000,0x0000, 0x1325,0x0000,0x0000, 0x1326,0x0000,0x0000, +0x1327,0x0000,0x0000, 0x1328,0x0000,0x0000, 0x1329,0x0000,0x0000, +0x132A,0x0000,0x0000, 0x132B,0x0000,0x0000, 0x132C,0x0000,0x0000, +0x132D,0x0000,0x0000, 0x132E,0x0000,0x0000, 0x132F,0x0000,0x0000, +0x130E,0x132B,0x0000, 0xFBC0,0x8588,0x0000, 0x023E,0x0000,0x0000, +0x0222,0x0000,0x0000, 0xFBC0,0x858B,0x0000, 0xFBC0,0x858C,0x0000, +0xFBC0,0x858D,0x0000, 0xFBC0,0x858E,0x0000, 0xFBC0,0x858F,0x0000, +0xFBC0,0x8590,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x85A2,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x85BA,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x02EF,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x02F0,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x02F1,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x85C5,0x0000, +0xFBC0,0x85C6,0x0000, 0xFBC0,0x85C7,0x0000, 0xFBC0,0x85C8,0x0000, +0xFBC0,0x85C9,0x0000, 0xFBC0,0x85CA,0x0000, 0xFBC0,0x85CB,0x0000, +0xFBC0,0x85CC,0x0000, 0xFBC0,0x85CD,0x0000, 0xFBC0,0x85CE,0x0000, +0xFBC0,0x85CF,0x0000, 0x1331,0x0000,0x0000, 0x1332,0x0000,0x0000, +0x1333,0x0000,0x0000, 0x1334,0x0000,0x0000, 0x1335,0x0000,0x0000, +0x1336,0x0000,0x0000, 0x1337,0x0000,0x0000, 0x1338,0x0000,0x0000, +0x1339,0x0000,0x0000, 0x133A,0x0000,0x0000, 0x133B,0x0000,0x0000, +0x133B,0x0000,0x0000, 0x133C,0x0000,0x0000, 0x133D,0x0000,0x0000, +0x133D,0x0000,0x0000, 0x133E,0x0000,0x0000, 0x133E,0x0000,0x0000, +0x133F,0x0000,0x0000, 0x1340,0x0000,0x0000, 0x1341,0x0000,0x0000, +0x1341,0x0000,0x0000, 0x1342,0x0000,0x0000, 0x1342,0x0000,0x0000, +0x1343,0x0000,0x0000, 0x1344,0x0000,0x0000, 0x1345,0x0000,0x0000, +0x1346,0x0000,0x0000, 0xFBC0,0x85EB,0x0000, 0xFBC0,0x85EC,0x0000, +0xFBC0,0x85ED,0x0000, 0xFBC0,0x85EE,0x0000, 0xFBC0,0x85EF,0x0000, +0x1336,0x1336,0x0000, 0x1336,0x133A,0x0000, 0x133A,0x133A,0x0000, +0x02F2,0x0000,0x0000, 0x02F3,0x0000,0x0000, 0xFBC0,0x85F5,0x0000, +0xFBC0,0x85F6,0x0000, 0xFBC0,0x85F7,0x0000, 0xFBC0,0x85F8,0x0000, +0xFBC0,0x85F9,0x0000, 0xFBC0,0x85FA,0x0000, 0xFBC0,0x85FB,0x0000, +0xFBC0,0x85FC,0x0000, 0xFBC0,0x85FD,0x0000, 0xFBC0,0x85FE,0x0000, +0xFBC0,0x85FF,0x0000 }; + +uint16 page006data[]= { /* 0600 (3 weights per char) */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8604,0x0000, 0xFBC0,0x8605,0x0000, +0xFBC0,0x8606,0x0000, 0xFBC0,0x8607,0x0000, 0xFBC0,0x8608,0x0000, +0xFBC0,0x8609,0x0000, 0xFBC0,0x860A,0x0000, 0xFBC0,0x860B,0x0000, +0x0231,0x0000,0x0000, 0x0232,0x0000,0x0000, 0x034C,0x0000,0x0000, +0x034D,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8616,0x0000, 0xFBC0,0x8617,0x0000, +0xFBC0,0x8618,0x0000, 0xFBC0,0x8619,0x0000, 0xFBC0,0x861A,0x0000, +0x023B,0x0000,0x0000, 0xFBC0,0x861C,0x0000, 0xFBC0,0x861D,0x0000, +0xFBC0,0x861E,0x0000, 0x0258,0x0000,0x0000, 0xFBC0,0x8620,0x0000, +0x1347,0x0000,0x0000, 0x1348,0x0000,0x0000, 0x1349,0x0000,0x0000, +0x134C,0x0000,0x0000, 0x134D,0x0000,0x0000, 0x134F,0x0000,0x0000, +0x1350,0x0000,0x0000, 0x1352,0x0000,0x0000, 0x1356,0x0000,0x0000, +0x1357,0x0000,0x0000, 0x1358,0x0000,0x0000, 0x135E,0x0000,0x0000, +0x1364,0x0000,0x0000, 0x1365,0x0000,0x0000, 0x1369,0x0000,0x0000, +0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000, 0x1376,0x0000,0x0000, +0x1381,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1387,0x0000,0x0000, +0x1388,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138D,0x0000,0x0000, +0x138F,0x0000,0x0000, 0x1390,0x0000,0x0000, 0xFBC0,0x863B,0x0000, +0xFBC0,0x863C,0x0000, 0xFBC0,0x863D,0x0000, 0xFBC0,0x863E,0x0000, +0xFBC0,0x863F,0x0000, 0x020B,0x0000,0x0000, 0x1393,0x0000,0x0000, +0x139B,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x13AB,0x0000,0x0000, +0x13B0,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B7,0x0000,0x0000, +0x13BD,0x0000,0x0000, 0x13C7,0x0000,0x0000, 0x13C8,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8659,0x0000, +0xFBC0,0x865A,0x0000, 0xFBC0,0x865B,0x0000, 0xFBC0,0x865C,0x0000, +0xFBC0,0x865D,0x0000, 0xFBC0,0x865E,0x0000, 0xFBC0,0x865F,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0x02D4,0x0000,0x0000, 0x0233,0x0000,0x0000, +0x0234,0x0000,0x0000, 0x02CB,0x0000,0x0000, 0x1351,0x0000,0x0000, +0x139A,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x134B,0x0000,0x0000, +0x134A,0x0000,0x0000, 0x134E,0x0000,0x0000, 0x1347,0x0000,0x0000, +0x1350,0x1347,0x0000, 0x13BD,0x1347,0x0000, 0x13C1,0x1347,0x0000, +0x13C8,0x1347,0x0000, 0x1359,0x0000,0x0000, 0x135A,0x0000,0x0000, +0x1353,0x0000,0x0000, 0x135B,0x0000,0x0000, 0x135C,0x0000,0x0000, +0x1354,0x0000,0x0000, 0x135D,0x0000,0x0000, 0x1355,0x0000,0x0000, +0x1366,0x0000,0x0000, 0x1367,0x0000,0x0000, 0x135F,0x0000,0x0000, +0x1360,0x0000,0x0000, 0x1368,0x0000,0x0000, 0x1361,0x0000,0x0000, +0x1363,0x0000,0x0000, 0x136B,0x0000,0x0000, 0x136C,0x0000,0x0000, +0x136D,0x0000,0x0000, 0x136E,0x0000,0x0000, 0x136F,0x0000,0x0000, +0x1370,0x0000,0x0000, 0x1371,0x0000,0x0000, 0x1372,0x0000,0x0000, +0x1373,0x0000,0x0000, 0x1377,0x0000,0x0000, 0x1378,0x0000,0x0000, +0x1379,0x0000,0x0000, 0x137A,0x0000,0x0000, 0x137B,0x0000,0x0000, +0x137C,0x0000,0x0000, 0x137D,0x0000,0x0000, 0x137E,0x0000,0x0000, +0x137F,0x0000,0x0000, 0x1383,0x0000,0x0000, 0x1384,0x0000,0x0000, +0x1385,0x0000,0x0000, 0x1389,0x0000,0x0000, 0x138A,0x0000,0x0000, +0x138E,0x0000,0x0000, 0x1391,0x0000,0x0000, 0x1394,0x0000,0x0000, +0x1395,0x0000,0x0000, 0x1396,0x0000,0x0000, 0x1397,0x0000,0x0000, +0x1398,0x0000,0x0000, 0x1399,0x0000,0x0000, 0x139C,0x0000,0x0000, +0x139D,0x0000,0x0000, 0x139F,0x0000,0x0000, 0x13A0,0x0000,0x0000, +0x13A1,0x0000,0x0000, 0x13A2,0x0000,0x0000, 0x13A3,0x0000,0x0000, +0x13A4,0x0000,0x0000, 0x13A5,0x0000,0x0000, 0x13A6,0x0000,0x0000, +0x13A7,0x0000,0x0000, 0x13A8,0x0000,0x0000, 0x13A9,0x0000,0x0000, +0x13AA,0x0000,0x0000, 0x13AC,0x0000,0x0000, 0x13AD,0x0000,0x0000, +0x13AE,0x0000,0x0000, 0x13AF,0x0000,0x0000, 0x13B6,0x0000,0x0000, +0x13B2,0x0000,0x0000, 0x13B3,0x0000,0x0000, 0x13B4,0x0000,0x0000, +0x13B5,0x0000,0x0000, 0x13B8,0x0000,0x0000, 0x1362,0x0000,0x0000, +0x13BC,0x0000,0x0000, 0x13B9,0x0000,0x0000, 0x13B9,0x0000,0x0000, +0x13BA,0x0000,0x0000, 0x13BE,0x0000,0x0000, 0x13BF,0x0000,0x0000, +0x13C0,0x0000,0x0000, 0x13C1,0x0000,0x0000, 0x13C2,0x0000,0x0000, +0x13C3,0x0000,0x0000, 0x13C4,0x0000,0x0000, 0x13C5,0x0000,0x0000, +0x13C9,0x0000,0x0000, 0x13CA,0x0000,0x0000, 0x13CB,0x0000,0x0000, +0x13C6,0x0000,0x0000, 0x13CC,0x0000,0x0000, 0x13CD,0x0000,0x0000, +0x13CE,0x0000,0x0000, 0x13CE,0x0000,0x0000, 0x025F,0x0000,0x0000, +0x13BC,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x13BD,0x0000,0x0000, 0x13C8,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x034E,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x1374,0x0000,0x0000, 0x1380,0x0000,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0x1386,0x0000,0x0000, 0x138B,0x0000,0x0000, +0x1392,0x0000,0x0000, 0x1347,0x0000,0x0000, 0x13B0,0x0000,0x0000, +0x13BB,0x0000,0x0000 }; + +uint16 page007data[]= { /* 0700 (3 weights per char) */ +0x0270,0x0000,0x0000, 0x0260,0x0000,0x0000, 0x0261,0x0000,0x0000, +0x023F,0x0000,0x0000, 0x0240,0x0000,0x0000, 0x0241,0x0000,0x0000, +0x0242,0x0000,0x0000, 0x0243,0x0000,0x0000, 0x0244,0x0000,0x0000, +0x0259,0x0000,0x0000, 0x02F4,0x0000,0x0000, 0x02F5,0x0000,0x0000, +0x02F6,0x0000,0x0000, 0x02F7,0x0000,0x0000, 0xFBC0,0x870E,0x0000, +0x0000,0x0000,0x0000, 0x13CF,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x13D0,0x0000,0x0000, 0x13D1,0x0000,0x0000, 0x13D1,0x0000,0x0000, +0x13D3,0x0000,0x0000, 0x13D2,0x0000,0x0000, 0x13D4,0x0000,0x0000, +0x13D5,0x0000,0x0000, 0x13D6,0x0000,0x0000, 0x13D8,0x0000,0x0000, +0x13D9,0x0000,0x0000, 0x13D9,0x0000,0x0000, 0x13DA,0x0000,0x0000, +0x13DB,0x0000,0x0000, 0x13DC,0x0000,0x0000, 0x13DE,0x0000,0x0000, +0x13DF,0x0000,0x0000, 0x13E0,0x0000,0x0000, 0x13E1,0x0000,0x0000, +0x13E1,0x0000,0x0000, 0x13E2,0x0000,0x0000, 0x13E3,0x0000,0x0000, +0x13E3,0x0000,0x0000, 0x13E5,0x0000,0x0000, 0x13E6,0x0000,0x0000, +0x13E7,0x0000,0x0000, 0x13E8,0x0000,0x0000, 0x13E9,0x0000,0x0000, +0x13D0,0x0000,0x0000, 0x13D1,0x0000,0x0000, 0x13D3,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x874B,0x0000, 0xFBC0,0x874C,0x0000, 0x13D7,0x0000,0x0000, +0x13DD,0x0000,0x0000, 0x13E4,0x0000,0x0000, 0xFBC0,0x8750,0x0000, +0xFBC0,0x8751,0x0000, 0xFBC0,0x8752,0x0000, 0xFBC0,0x8753,0x0000, +0xFBC0,0x8754,0x0000, 0xFBC0,0x8755,0x0000, 0xFBC0,0x8756,0x0000, +0xFBC0,0x8757,0x0000, 0xFBC0,0x8758,0x0000, 0xFBC0,0x8759,0x0000, +0xFBC0,0x875A,0x0000, 0xFBC0,0x875B,0x0000, 0xFBC0,0x875C,0x0000, +0xFBC0,0x875D,0x0000, 0xFBC0,0x875E,0x0000, 0xFBC0,0x875F,0x0000, +0xFBC0,0x8760,0x0000, 0xFBC0,0x8761,0x0000, 0xFBC0,0x8762,0x0000, +0xFBC0,0x8763,0x0000, 0xFBC0,0x8764,0x0000, 0xFBC0,0x8765,0x0000, +0xFBC0,0x8766,0x0000, 0xFBC0,0x8767,0x0000, 0xFBC0,0x8768,0x0000, +0xFBC0,0x8769,0x0000, 0xFBC0,0x876A,0x0000, 0xFBC0,0x876B,0x0000, +0xFBC0,0x876C,0x0000, 0xFBC0,0x876D,0x0000, 0xFBC0,0x876E,0x0000, +0xFBC0,0x876F,0x0000, 0xFBC0,0x8770,0x0000, 0xFBC0,0x8771,0x0000, +0xFBC0,0x8772,0x0000, 0xFBC0,0x8773,0x0000, 0xFBC0,0x8774,0x0000, +0xFBC0,0x8775,0x0000, 0xFBC0,0x8776,0x0000, 0xFBC0,0x8777,0x0000, +0xFBC0,0x8778,0x0000, 0xFBC0,0x8779,0x0000, 0xFBC0,0x877A,0x0000, +0xFBC0,0x877B,0x0000, 0xFBC0,0x877C,0x0000, 0xFBC0,0x877D,0x0000, +0xFBC0,0x877E,0x0000, 0xFBC0,0x877F,0x0000, 0x13EA,0x0000,0x0000, +0x13ED,0x0000,0x0000, 0x13EE,0x0000,0x0000, 0x13EF,0x0000,0x0000, +0x13F1,0x0000,0x0000, 0x13F2,0x0000,0x0000, 0x13F3,0x0000,0x0000, +0x13F4,0x0000,0x0000, 0x13F7,0x0000,0x0000, 0x13F9,0x0000,0x0000, +0x13FA,0x0000,0x0000, 0x13FB,0x0000,0x0000, 0x13FD,0x0000,0x0000, +0x1401,0x0000,0x0000, 0x1402,0x0000,0x0000, 0x1404,0x0000,0x0000, +0x1405,0x0000,0x0000, 0x1409,0x0000,0x0000, 0x140A,0x0000,0x0000, +0x140B,0x0000,0x0000, 0x140C,0x0000,0x0000, 0x140D,0x0000,0x0000, +0x140E,0x0000,0x0000, 0x140F,0x0000,0x0000, 0x13FE,0x0000,0x0000, +0x13EB,0x0000,0x0000, 0x13EC,0x0000,0x0000, 0x13FC,0x0000,0x0000, +0x13F0,0x0000,0x0000, 0x1406,0x0000,0x0000, 0x1407,0x0000,0x0000, +0x1408,0x0000,0x0000, 0x13FF,0x0000,0x0000, 0x1400,0x0000,0x0000, +0x13F5,0x0000,0x0000, 0x13F6,0x0000,0x0000, 0x1403,0x0000,0x0000, +0x13F8,0x0000,0x0000, 0x1411,0x0000,0x0000, 0x1412,0x0000,0x0000, +0x1413,0x0000,0x0000, 0x1414,0x0000,0x0000, 0x1415,0x0000,0x0000, +0x1416,0x0000,0x0000, 0x1417,0x0000,0x0000, 0x1418,0x0000,0x0000, +0x1419,0x0000,0x0000, 0x141A,0x0000,0x0000, 0x141B,0x0000,0x0000, +0x1410,0x0000,0x0000, 0xFBC0,0x87B2,0x0000, 0xFBC0,0x87B3,0x0000, +0xFBC0,0x87B4,0x0000, 0xFBC0,0x87B5,0x0000, 0xFBC0,0x87B6,0x0000, +0xFBC0,0x87B7,0x0000, 0xFBC0,0x87B8,0x0000, 0xFBC0,0x87B9,0x0000, +0xFBC0,0x87BA,0x0000, 0xFBC0,0x87BB,0x0000, 0xFBC0,0x87BC,0x0000, +0xFBC0,0x87BD,0x0000, 0xFBC0,0x87BE,0x0000, 0xFBC0,0x87BF,0x0000, +0xFBC0,0x87C0,0x0000, 0xFBC0,0x87C1,0x0000, 0xFBC0,0x87C2,0x0000, +0xFBC0,0x87C3,0x0000, 0xFBC0,0x87C4,0x0000, 0xFBC0,0x87C5,0x0000, +0xFBC0,0x87C6,0x0000, 0xFBC0,0x87C7,0x0000, 0xFBC0,0x87C8,0x0000, +0xFBC0,0x87C9,0x0000, 0xFBC0,0x87CA,0x0000, 0xFBC0,0x87CB,0x0000, +0xFBC0,0x87CC,0x0000, 0xFBC0,0x87CD,0x0000, 0xFBC0,0x87CE,0x0000, +0xFBC0,0x87CF,0x0000, 0xFBC0,0x87D0,0x0000, 0xFBC0,0x87D1,0x0000, +0xFBC0,0x87D2,0x0000, 0xFBC0,0x87D3,0x0000, 0xFBC0,0x87D4,0x0000, +0xFBC0,0x87D5,0x0000, 0xFBC0,0x87D6,0x0000, 0xFBC0,0x87D7,0x0000, +0xFBC0,0x87D8,0x0000, 0xFBC0,0x87D9,0x0000, 0xFBC0,0x87DA,0x0000, +0xFBC0,0x87DB,0x0000, 0xFBC0,0x87DC,0x0000, 0xFBC0,0x87DD,0x0000, +0xFBC0,0x87DE,0x0000, 0xFBC0,0x87DF,0x0000, 0xFBC0,0x87E0,0x0000, +0xFBC0,0x87E1,0x0000, 0xFBC0,0x87E2,0x0000, 0xFBC0,0x87E3,0x0000, +0xFBC0,0x87E4,0x0000, 0xFBC0,0x87E5,0x0000, 0xFBC0,0x87E6,0x0000, +0xFBC0,0x87E7,0x0000, 0xFBC0,0x87E8,0x0000, 0xFBC0,0x87E9,0x0000, +0xFBC0,0x87EA,0x0000, 0xFBC0,0x87EB,0x0000, 0xFBC0,0x87EC,0x0000, +0xFBC0,0x87ED,0x0000, 0xFBC0,0x87EE,0x0000, 0xFBC0,0x87EF,0x0000, +0xFBC0,0x87F0,0x0000, 0xFBC0,0x87F1,0x0000, 0xFBC0,0x87F2,0x0000, +0xFBC0,0x87F3,0x0000, 0xFBC0,0x87F4,0x0000, 0xFBC0,0x87F5,0x0000, +0xFBC0,0x87F6,0x0000, 0xFBC0,0x87F7,0x0000, 0xFBC0,0x87F8,0x0000, +0xFBC0,0x87F9,0x0000, 0xFBC0,0x87FA,0x0000, 0xFBC0,0x87FB,0x0000, +0xFBC0,0x87FC,0x0000, 0xFBC0,0x87FD,0x0000, 0xFBC0,0x87FE,0x0000, +0xFBC0,0x87FF,0x0000 }; + +uint16 page009data[]= { /* 0900 (3 weights per char) */ +0xFBC0,0x8900,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x155A,0x0000,0x0000, 0x155B,0x0000,0x0000, +0x155C,0x0000,0x0000, 0x155D,0x0000,0x0000, 0x155E,0x0000,0x0000, +0x155F,0x0000,0x0000, 0x1560,0x0000,0x0000, 0x1561,0x0000,0x0000, +0x1563,0x0000,0x0000, 0x1565,0x0000,0x0000, 0x1566,0x0000,0x0000, +0x1567,0x0000,0x0000, 0x1568,0x0000,0x0000, 0x1569,0x0000,0x0000, +0x156A,0x0000,0x0000, 0x156B,0x0000,0x0000, 0x156C,0x0000,0x0000, +0x156D,0x0000,0x0000, 0x156E,0x0000,0x0000, 0x156F,0x0000,0x0000, +0x1570,0x0000,0x0000, 0x1571,0x0000,0x0000, 0x1572,0x0000,0x0000, +0x1573,0x0000,0x0000, 0x1574,0x0000,0x0000, 0x1575,0x0000,0x0000, +0x1576,0x0000,0x0000, 0x1577,0x0000,0x0000, 0x1578,0x0000,0x0000, +0x1579,0x0000,0x0000, 0x157A,0x0000,0x0000, 0x157B,0x0000,0x0000, +0x157C,0x0000,0x0000, 0x157D,0x0000,0x0000, 0x157E,0x0000,0x0000, +0x157F,0x0000,0x0000, 0x1580,0x0000,0x0000, 0x1580,0x0000,0x0000, +0x1581,0x0000,0x0000, 0x1582,0x0000,0x0000, 0x1583,0x0000,0x0000, +0x1584,0x0000,0x0000, 0x1585,0x0000,0x0000, 0x1586,0x0000,0x0000, +0x1587,0x0000,0x0000, 0x1587,0x0000,0x0000, 0x1588,0x0000,0x0000, +0x1589,0x0000,0x0000, 0x1589,0x0000,0x0000, 0x158A,0x0000,0x0000, +0x158B,0x0000,0x0000, 0x158C,0x0000,0x0000, 0x158D,0x0000,0x0000, +0x158E,0x0000,0x0000, 0xFBC0,0x893A,0x0000, 0xFBC0,0x893B,0x0000, +0x0000,0x0000,0x0000, 0x158F,0x0000,0x0000, 0x1590,0x0000,0x0000, +0x1591,0x0000,0x0000, 0x1592,0x0000,0x0000, 0x1593,0x0000,0x0000, +0x1594,0x0000,0x0000, 0x1595,0x0000,0x0000, 0x1596,0x0000,0x0000, +0x1599,0x0000,0x0000, 0x159A,0x0000,0x0000, 0x159B,0x0000,0x0000, +0x159C,0x0000,0x0000, 0x159D,0x0000,0x0000, 0x159E,0x0000,0x0000, +0x159F,0x0000,0x0000, 0x15A0,0x0000,0x0000, 0x15A1,0x0000,0x0000, +0xFBC0,0x894E,0x0000, 0xFBC0,0x894F,0x0000, 0x1559,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8955,0x0000, 0xFBC0,0x8956,0x0000, +0xFBC0,0x8957,0x0000, 0x156D,0x0000,0x0000, 0x156E,0x0000,0x0000, +0x156F,0x0000,0x0000, 0x1574,0x0000,0x0000, 0x1579,0x0000,0x0000, +0x157A,0x0000,0x0000, 0x1582,0x0000,0x0000, 0x1586,0x0000,0x0000, +0x1562,0x0000,0x0000, 0x1564,0x0000,0x0000, 0x1597,0x0000,0x0000, +0x1598,0x0000,0x0000, 0x0268,0x0000,0x0000, 0x0269,0x0000,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0x02FA,0x0000,0x0000, 0xFBC0,0x8971,0x0000, +0xFBC0,0x8972,0x0000, 0xFBC0,0x8973,0x0000, 0xFBC0,0x8974,0x0000, +0xFBC0,0x8975,0x0000, 0xFBC0,0x8976,0x0000, 0xFBC0,0x8977,0x0000, +0xFBC0,0x8978,0x0000, 0xFBC0,0x8979,0x0000, 0xFBC0,0x897A,0x0000, +0xFBC0,0x897B,0x0000, 0xFBC0,0x897C,0x0000, 0xFBC0,0x897D,0x0000, +0xFBC0,0x897E,0x0000, 0xFBC0,0x897F,0x0000, 0xFBC0,0x8980,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x8984,0x0000, 0x15A2,0x0000,0x0000, 0x15A3,0x0000,0x0000, +0x15A4,0x0000,0x0000, 0x15A5,0x0000,0x0000, 0x15A6,0x0000,0x0000, +0x15A7,0x0000,0x0000, 0x15A8,0x0000,0x0000, 0x15AA,0x0000,0x0000, +0xFBC0,0x898D,0x0000, 0xFBC0,0x898E,0x0000, 0x15AC,0x0000,0x0000, +0x15AD,0x0000,0x0000, 0xFBC0,0x8991,0x0000, 0xFBC0,0x8992,0x0000, +0x15AE,0x0000,0x0000, 0x15AF,0x0000,0x0000, 0x15B0,0x0000,0x0000, +0x15B1,0x0000,0x0000, 0x15B2,0x0000,0x0000, 0x15B3,0x0000,0x0000, +0x15B4,0x0000,0x0000, 0x15B5,0x0000,0x0000, 0x15B6,0x0000,0x0000, +0x15B7,0x0000,0x0000, 0x15B8,0x0000,0x0000, 0x15B9,0x0000,0x0000, +0x15BA,0x0000,0x0000, 0x15BB,0x0000,0x0000, 0x15BC,0x0000,0x0000, +0x15BD,0x0000,0x0000, 0x15BE,0x0000,0x0000, 0x15BF,0x0000,0x0000, +0x15C0,0x0000,0x0000, 0x15C1,0x0000,0x0000, 0x15C2,0x0000,0x0000, +0x15C3,0x0000,0x0000, 0xFBC0,0x89A9,0x0000, 0x15C4,0x0000,0x0000, +0x15C5,0x0000,0x0000, 0x15C6,0x0000,0x0000, 0x15C7,0x0000,0x0000, +0x15C8,0x0000,0x0000, 0x15C9,0x0000,0x0000, 0x15CA,0x0000,0x0000, +0xFBC0,0x89B1,0x0000, 0x15CC,0x0000,0x0000, 0xFBC0,0x89B3,0x0000, +0xFBC0,0x89B4,0x0000, 0xFBC0,0x89B5,0x0000, 0x15CE,0x0000,0x0000, +0x15CF,0x0000,0x0000, 0x15D0,0x0000,0x0000, 0x15D1,0x0000,0x0000, +0xFBC0,0x89BA,0x0000, 0xFBC0,0x89BB,0x0000, 0x0000,0x0000,0x0000, +0x15D2,0x0000,0x0000, 0x15D3,0x0000,0x0000, 0x15D4,0x0000,0x0000, +0x15D5,0x0000,0x0000, 0x15D6,0x0000,0x0000, 0x15D7,0x0000,0x0000, +0x15D8,0x0000,0x0000, 0x15D9,0x0000,0x0000, 0xFBC0,0x89C5,0x0000, +0xFBC0,0x89C6,0x0000, 0x15DC,0x0000,0x0000, 0x15DD,0x0000,0x0000, +0xFBC0,0x89C9,0x0000, 0xFBC0,0x89CA,0x0000, 0x15DE,0x0000,0x0000, +0x15DF,0x0000,0x0000, 0x15E0,0x0000,0x0000, 0xFBC0,0x89CE,0x0000, +0xFBC0,0x89CF,0x0000, 0xFBC0,0x89D0,0x0000, 0xFBC0,0x89D1,0x0000, +0xFBC0,0x89D2,0x0000, 0xFBC0,0x89D3,0x0000, 0xFBC0,0x89D4,0x0000, +0xFBC0,0x89D5,0x0000, 0xFBC0,0x89D6,0x0000, 0x15E1,0x0000,0x0000, +0xFBC0,0x89D8,0x0000, 0xFBC0,0x89D9,0x0000, 0xFBC0,0x89DA,0x0000, +0xFBC0,0x89DB,0x0000, 0x15BC,0x0000,0x0000, 0x15BD,0x0000,0x0000, +0xFBC0,0x89DE,0x0000, 0x15C9,0x0000,0x0000, 0x15A9,0x0000,0x0000, +0x15AB,0x0000,0x0000, 0x15DA,0x0000,0x0000, 0x15DB,0x0000,0x0000, +0xFBC0,0x89E4,0x0000, 0xFBC0,0x89E5,0x0000, 0x0E29,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x15CB,0x0000,0x0000, 0x15CD,0x0000,0x0000, 0x0E12,0x0000,0x0000, +0x0E13,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0DC7,0x0000,0x0000, +0x0DC8,0x0000,0x0000, 0x0350,0x0000,0x0000, 0xFBC0,0x89FB,0x0000, +0xFBC0,0x89FC,0x0000, 0xFBC0,0x89FD,0x0000, 0xFBC0,0x89FE,0x0000, +0xFBC0,0x89FF,0x0000 }; + +uint16 page00Adata[]= { /* 0A00 (3 weights per char) */ +0xFBC0,0x8A00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8A04,0x0000, 0x15E7,0x0000,0x0000, +0x15E8,0x0000,0x0000, 0x15EC,0x0000,0x0000, 0x15ED,0x0000,0x0000, +0x15E4,0x0000,0x0000, 0x15E5,0x0000,0x0000, 0xFBC0,0x8A0B,0x0000, +0xFBC0,0x8A0C,0x0000, 0xFBC0,0x8A0D,0x0000, 0xFBC0,0x8A0E,0x0000, +0x15EE,0x0000,0x0000, 0x15E9,0x0000,0x0000, 0xFBC0,0x8A11,0x0000, +0xFBC0,0x8A12,0x0000, 0x15E6,0x0000,0x0000, 0x15EA,0x0000,0x0000, +0x15F1,0x0000,0x0000, 0x15F2,0x0000,0x0000, 0x15F3,0x0000,0x0000, +0x15F4,0x0000,0x0000, 0x15F5,0x0000,0x0000, 0x15F6,0x0000,0x0000, +0x15F7,0x0000,0x0000, 0x15F8,0x0000,0x0000, 0x15F9,0x0000,0x0000, +0x15FA,0x0000,0x0000, 0x15FB,0x0000,0x0000, 0x15FC,0x0000,0x0000, +0x15FD,0x0000,0x0000, 0x15FE,0x0000,0x0000, 0x15FF,0x0000,0x0000, +0x1600,0x0000,0x0000, 0x1601,0x0000,0x0000, 0x1602,0x0000,0x0000, +0x1603,0x0000,0x0000, 0x1604,0x0000,0x0000, 0xFBC0,0x8A29,0x0000, +0x1605,0x0000,0x0000, 0x1606,0x0000,0x0000, 0x1607,0x0000,0x0000, +0x1608,0x0000,0x0000, 0x1609,0x0000,0x0000, 0x160A,0x0000,0x0000, +0x160B,0x0000,0x0000, 0xFBC0,0x8A31,0x0000, 0x160C,0x0000,0x0000, +0x160C,0x0000,0x0000, 0xFBC0,0x8A34,0x0000, 0x160D,0x0000,0x0000, +0x15EF,0x0000,0x0000, 0xFBC0,0x8A37,0x0000, 0x15EF,0x0000,0x0000, +0x15F0,0x0000,0x0000, 0xFBC0,0x8A3A,0x0000, 0xFBC0,0x8A3B,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8A3D,0x0000, 0x160F,0x0000,0x0000, +0x1610,0x0000,0x0000, 0x1611,0x0000,0x0000, 0x1612,0x0000,0x0000, +0x1613,0x0000,0x0000, 0xFBC0,0x8A43,0x0000, 0xFBC0,0x8A44,0x0000, +0xFBC0,0x8A45,0x0000, 0xFBC0,0x8A46,0x0000, 0x1614,0x0000,0x0000, +0x1615,0x0000,0x0000, 0xFBC0,0x8A49,0x0000, 0xFBC0,0x8A4A,0x0000, +0x1616,0x0000,0x0000, 0x1617,0x0000,0x0000, 0x1618,0x0000,0x0000, +0xFBC0,0x8A4E,0x0000, 0xFBC0,0x8A4F,0x0000, 0xFBC0,0x8A50,0x0000, +0xFBC0,0x8A51,0x0000, 0xFBC0,0x8A52,0x0000, 0xFBC0,0x8A53,0x0000, +0xFBC0,0x8A54,0x0000, 0xFBC0,0x8A55,0x0000, 0xFBC0,0x8A56,0x0000, +0xFBC0,0x8A57,0x0000, 0xFBC0,0x8A58,0x0000, 0x15F2,0x0000,0x0000, +0x15F3,0x0000,0x0000, 0x15F8,0x0000,0x0000, 0x160E,0x0000,0x0000, +0xFBC0,0x8A5D,0x0000, 0x1606,0x0000,0x0000, 0xFBC0,0x8A5F,0x0000, +0xFBC0,0x8A60,0x0000, 0xFBC0,0x8A61,0x0000, 0xFBC0,0x8A62,0x0000, +0xFBC0,0x8A63,0x0000, 0xFBC0,0x8A64,0x0000, 0xFBC0,0x8A65,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x15EB,0x0000,0x0000, 0x15E3,0x0000,0x0000, 0x15E2,0x0000,0x0000, +0xFBC0,0x8A75,0x0000, 0xFBC0,0x8A76,0x0000, 0xFBC0,0x8A77,0x0000, +0xFBC0,0x8A78,0x0000, 0xFBC0,0x8A79,0x0000, 0xFBC0,0x8A7A,0x0000, +0xFBC0,0x8A7B,0x0000, 0xFBC0,0x8A7C,0x0000, 0xFBC0,0x8A7D,0x0000, +0xFBC0,0x8A7E,0x0000, 0xFBC0,0x8A7F,0x0000, 0xFBC0,0x8A80,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x8A84,0x0000, 0x161A,0x0000,0x0000, 0x161B,0x0000,0x0000, +0x161C,0x0000,0x0000, 0x161D,0x0000,0x0000, 0x161E,0x0000,0x0000, +0x161F,0x0000,0x0000, 0x1620,0x0000,0x0000, 0x1622,0x0000,0x0000, +0x1624,0x0000,0x0000, 0xFBC0,0x8A8E,0x0000, 0x1625,0x0000,0x0000, +0x1626,0x0000,0x0000, 0x1627,0x0000,0x0000, 0xFBC0,0x8A92,0x0000, +0x1628,0x0000,0x0000, 0x1629,0x0000,0x0000, 0x162A,0x0000,0x0000, +0x162B,0x0000,0x0000, 0x162C,0x0000,0x0000, 0x162D,0x0000,0x0000, +0x162E,0x0000,0x0000, 0x162F,0x0000,0x0000, 0x1630,0x0000,0x0000, +0x1631,0x0000,0x0000, 0x1632,0x0000,0x0000, 0x1633,0x0000,0x0000, +0x1634,0x0000,0x0000, 0x1635,0x0000,0x0000, 0x1636,0x0000,0x0000, +0x1637,0x0000,0x0000, 0x1638,0x0000,0x0000, 0x1639,0x0000,0x0000, +0x163A,0x0000,0x0000, 0x163B,0x0000,0x0000, 0x163C,0x0000,0x0000, +0x163D,0x0000,0x0000, 0xFBC0,0x8AA9,0x0000, 0x163E,0x0000,0x0000, +0x163F,0x0000,0x0000, 0x1640,0x0000,0x0000, 0x1641,0x0000,0x0000, +0x1642,0x0000,0x0000, 0x1643,0x0000,0x0000, 0x1644,0x0000,0x0000, +0xFBC0,0x8AB1,0x0000, 0x1645,0x0000,0x0000, 0x1646,0x0000,0x0000, +0xFBC0,0x8AB4,0x0000, 0x1647,0x0000,0x0000, 0x1648,0x0000,0x0000, +0x1649,0x0000,0x0000, 0x164A,0x0000,0x0000, 0x164B,0x0000,0x0000, +0xFBC0,0x8ABA,0x0000, 0xFBC0,0x8ABB,0x0000, 0x0000,0x0000,0x0000, +0x164C,0x0000,0x0000, 0x164D,0x0000,0x0000, 0x164E,0x0000,0x0000, +0x164F,0x0000,0x0000, 0x1650,0x0000,0x0000, 0x1651,0x0000,0x0000, +0x1652,0x0000,0x0000, 0x1653,0x0000,0x0000, 0x1656,0x0000,0x0000, +0xFBC0,0x8AC6,0x0000, 0x1657,0x0000,0x0000, 0x1658,0x0000,0x0000, +0x1659,0x0000,0x0000, 0xFBC0,0x8ACA,0x0000, 0x165A,0x0000,0x0000, +0x165B,0x0000,0x0000, 0x165C,0x0000,0x0000, 0xFBC0,0x8ACE,0x0000, +0xFBC0,0x8ACF,0x0000, 0x1619,0x0000,0x0000, 0xFBC0,0x8AD1,0x0000, +0xFBC0,0x8AD2,0x0000, 0xFBC0,0x8AD3,0x0000, 0xFBC0,0x8AD4,0x0000, +0xFBC0,0x8AD5,0x0000, 0xFBC0,0x8AD6,0x0000, 0xFBC0,0x8AD7,0x0000, +0xFBC0,0x8AD8,0x0000, 0xFBC0,0x8AD9,0x0000, 0xFBC0,0x8ADA,0x0000, +0xFBC0,0x8ADB,0x0000, 0xFBC0,0x8ADC,0x0000, 0xFBC0,0x8ADD,0x0000, +0xFBC0,0x8ADE,0x0000, 0xFBC0,0x8ADF,0x0000, 0x1621,0x0000,0x0000, +0x1623,0x0000,0x0000, 0x1654,0x0000,0x0000, 0x1655,0x0000,0x0000, +0xFBC0,0x8AE4,0x0000, 0xFBC0,0x8AE5,0x0000, 0x0E29,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0xFBC0,0x8AF0,0x0000, 0x0E14,0x0000,0x0000, 0xFBC0,0x8AF2,0x0000, +0xFBC0,0x8AF3,0x0000, 0xFBC0,0x8AF4,0x0000, 0xFBC0,0x8AF5,0x0000, +0xFBC0,0x8AF6,0x0000, 0xFBC0,0x8AF7,0x0000, 0xFBC0,0x8AF8,0x0000, +0xFBC0,0x8AF9,0x0000, 0xFBC0,0x8AFA,0x0000, 0xFBC0,0x8AFB,0x0000, +0xFBC0,0x8AFC,0x0000, 0xFBC0,0x8AFD,0x0000, 0xFBC0,0x8AFE,0x0000, +0xFBC0,0x8AFF,0x0000 }; + +uint16 page00Bdata[]= { /* 0B00 (3 weights per char) */ +0xFBC0,0x8B00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8B04,0x0000, 0x165D,0x0000,0x0000, +0x165E,0x0000,0x0000, 0x165F,0x0000,0x0000, 0x1660,0x0000,0x0000, +0x1661,0x0000,0x0000, 0x1662,0x0000,0x0000, 0x1663,0x0000,0x0000, +0x1665,0x0000,0x0000, 0xFBC0,0x8B0D,0x0000, 0xFBC0,0x8B0E,0x0000, +0x1667,0x0000,0x0000, 0x1668,0x0000,0x0000, 0xFBC0,0x8B11,0x0000, +0xFBC0,0x8B12,0x0000, 0x1669,0x0000,0x0000, 0x166A,0x0000,0x0000, +0x166B,0x0000,0x0000, 0x166C,0x0000,0x0000, 0x166D,0x0000,0x0000, +0x166E,0x0000,0x0000, 0x166F,0x0000,0x0000, 0x1670,0x0000,0x0000, +0x1671,0x0000,0x0000, 0x1672,0x0000,0x0000, 0x1673,0x0000,0x0000, +0x1674,0x0000,0x0000, 0x1675,0x0000,0x0000, 0x1676,0x0000,0x0000, +0x1677,0x0000,0x0000, 0x1678,0x0000,0x0000, 0x1679,0x0000,0x0000, +0x167A,0x0000,0x0000, 0x167B,0x0000,0x0000, 0x167C,0x0000,0x0000, +0x167D,0x0000,0x0000, 0x167E,0x0000,0x0000, 0xFBC0,0x8B29,0x0000, +0x167F,0x0000,0x0000, 0x1680,0x0000,0x0000, 0x1681,0x0000,0x0000, +0x1682,0x0000,0x0000, 0x1683,0x0000,0x0000, 0x1684,0x0000,0x0000, +0x1686,0x0000,0x0000, 0xFBC0,0x8B31,0x0000, 0x1687,0x0000,0x0000, +0x1688,0x0000,0x0000, 0xFBC0,0x8B34,0x0000, 0x1689,0x0000,0x0000, +0x168B,0x0000,0x0000, 0x168C,0x0000,0x0000, 0x168D,0x0000,0x0000, +0x168E,0x0000,0x0000, 0xFBC0,0x8B3A,0x0000, 0xFBC0,0x8B3B,0x0000, +0x0000,0x0000,0x0000, 0x168F,0x0000,0x0000, 0x1690,0x0000,0x0000, +0x1691,0x0000,0x0000, 0x1692,0x0000,0x0000, 0x1693,0x0000,0x0000, +0x1694,0x0000,0x0000, 0x1695,0x0000,0x0000, 0xFBC0,0x8B44,0x0000, +0xFBC0,0x8B45,0x0000, 0xFBC0,0x8B46,0x0000, 0x1696,0x0000,0x0000, +0x1697,0x0000,0x0000, 0xFBC0,0x8B49,0x0000, 0xFBC0,0x8B4A,0x0000, +0x1698,0x0000,0x0000, 0x1699,0x0000,0x0000, 0x169A,0x0000,0x0000, +0xFBC0,0x8B4E,0x0000, 0xFBC0,0x8B4F,0x0000, 0xFBC0,0x8B50,0x0000, +0xFBC0,0x8B51,0x0000, 0xFBC0,0x8B52,0x0000, 0xFBC0,0x8B53,0x0000, +0xFBC0,0x8B54,0x0000, 0xFBC0,0x8B55,0x0000, 0x169B,0x0000,0x0000, +0x169C,0x0000,0x0000, 0xFBC0,0x8B58,0x0000, 0xFBC0,0x8B59,0x0000, +0xFBC0,0x8B5A,0x0000, 0xFBC0,0x8B5B,0x0000, 0x1677,0x0000,0x0000, +0x1678,0x0000,0x0000, 0xFBC0,0x8B5E,0x0000, 0x1685,0x0000,0x0000, +0x1664,0x0000,0x0000, 0x1666,0x0000,0x0000, 0xFBC0,0x8B62,0x0000, +0xFBC0,0x8B63,0x0000, 0xFBC0,0x8B64,0x0000, 0xFBC0,0x8B65,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0x0351,0x0000,0x0000, 0x168A,0x0000,0x0000, +0xFBC0,0x8B72,0x0000, 0xFBC0,0x8B73,0x0000, 0xFBC0,0x8B74,0x0000, +0xFBC0,0x8B75,0x0000, 0xFBC0,0x8B76,0x0000, 0xFBC0,0x8B77,0x0000, +0xFBC0,0x8B78,0x0000, 0xFBC0,0x8B79,0x0000, 0xFBC0,0x8B7A,0x0000, +0xFBC0,0x8B7B,0x0000, 0xFBC0,0x8B7C,0x0000, 0xFBC0,0x8B7D,0x0000, +0xFBC0,0x8B7E,0x0000, 0xFBC0,0x8B7F,0x0000, 0xFBC0,0x8B80,0x0000, +0xFBC0,0x8B81,0x0000, 0x0000,0x0000,0x0000, 0x169D,0x0000,0x0000, +0xFBC0,0x8B84,0x0000, 0x169E,0x0000,0x0000, 0x169F,0x0000,0x0000, +0x16A0,0x0000,0x0000, 0x16A1,0x0000,0x0000, 0x16A2,0x0000,0x0000, +0x16A3,0x0000,0x0000, 0xFBC0,0x8B8B,0x0000, 0xFBC0,0x8B8C,0x0000, +0xFBC0,0x8B8D,0x0000, 0x16A4,0x0000,0x0000, 0x16A5,0x0000,0x0000, +0x16A6,0x0000,0x0000, 0xFBC0,0x8B91,0x0000, 0x16A7,0x0000,0x0000, +0x16A8,0x0000,0x0000, 0x16A9,0x0000,0x0000, 0x16AA,0x0000,0x0000, +0xFBC0,0x8B96,0x0000, 0xFBC0,0x8B97,0x0000, 0xFBC0,0x8B98,0x0000, +0x16AB,0x0000,0x0000, 0x16AC,0x0000,0x0000, 0xFBC0,0x8B9B,0x0000, +0x16AD,0x0000,0x0000, 0xFBC0,0x8B9D,0x0000, 0x16AE,0x0000,0x0000, +0x16AF,0x0000,0x0000, 0xFBC0,0x8BA0,0x0000, 0xFBC0,0x8BA1,0x0000, +0xFBC0,0x8BA2,0x0000, 0x16B0,0x0000,0x0000, 0x16B1,0x0000,0x0000, +0xFBC0,0x8BA5,0x0000, 0xFBC0,0x8BA6,0x0000, 0xFBC0,0x8BA7,0x0000, +0x16B2,0x0000,0x0000, 0x16B3,0x0000,0x0000, 0x16B4,0x0000,0x0000, +0xFBC0,0x8BAB,0x0000, 0xFBC0,0x8BAC,0x0000, 0xFBC0,0x8BAD,0x0000, +0x16B5,0x0000,0x0000, 0x16B6,0x0000,0x0000, 0x16B7,0x0000,0x0000, +0x16B8,0x0000,0x0000, 0x16B9,0x0000,0x0000, 0x16BA,0x0000,0x0000, +0x16BB,0x0000,0x0000, 0x16BC,0x0000,0x0000, 0xFBC0,0x8BB6,0x0000, +0x16BD,0x0000,0x0000, 0x16BE,0x0000,0x0000, 0x16BF,0x0000,0x0000, +0xFBC0,0x8BBA,0x0000, 0xFBC0,0x8BBB,0x0000, 0xFBC0,0x8BBC,0x0000, +0xFBC0,0x8BBD,0x0000, 0x16C0,0x0000,0x0000, 0x16C1,0x0000,0x0000, +0x16C2,0x0000,0x0000, 0x16C3,0x0000,0x0000, 0x16C4,0x0000,0x0000, +0xFBC0,0x8BC3,0x0000, 0xFBC0,0x8BC4,0x0000, 0xFBC0,0x8BC5,0x0000, +0x16C5,0x0000,0x0000, 0x16C6,0x0000,0x0000, 0x16C7,0x0000,0x0000, +0xFBC0,0x8BC9,0x0000, 0x16C8,0x0000,0x0000, 0x16C9,0x0000,0x0000, +0x16CA,0x0000,0x0000, 0x16CB,0x0000,0x0000, 0xFBC0,0x8BCE,0x0000, +0xFBC0,0x8BCF,0x0000, 0xFBC0,0x8BD0,0x0000, 0xFBC0,0x8BD1,0x0000, +0xFBC0,0x8BD2,0x0000, 0xFBC0,0x8BD3,0x0000, 0xFBC0,0x8BD4,0x0000, +0xFBC0,0x8BD5,0x0000, 0xFBC0,0x8BD6,0x0000, 0x16CC,0x0000,0x0000, +0xFBC0,0x8BD8,0x0000, 0xFBC0,0x8BD9,0x0000, 0xFBC0,0x8BDA,0x0000, +0xFBC0,0x8BDB,0x0000, 0xFBC0,0x8BDC,0x0000, 0xFBC0,0x8BDD,0x0000, +0xFBC0,0x8BDE,0x0000, 0xFBC0,0x8BDF,0x0000, 0xFBC0,0x8BE0,0x0000, +0xFBC0,0x8BE1,0x0000, 0xFBC0,0x8BE2,0x0000, 0xFBC0,0x8BE3,0x0000, +0xFBC0,0x8BE4,0x0000, 0xFBC0,0x8BE5,0x0000, 0xFBC0,0x8BE6,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x0DC9,0x0000,0x0000, 0x0DCA,0x0000,0x0000, 0x0DCB,0x0000,0x0000, +0x0352,0x0000,0x0000, 0x0353,0x0000,0x0000, 0x0354,0x0000,0x0000, +0x0355,0x0000,0x0000, 0x0356,0x0000,0x0000, 0x0357,0x0000,0x0000, +0x0E15,0x0000,0x0000, 0x0358,0x0000,0x0000, 0xFBC0,0x8BFB,0x0000, +0xFBC0,0x8BFC,0x0000, 0xFBC0,0x8BFD,0x0000, 0xFBC0,0x8BFE,0x0000, +0xFBC0,0x8BFF,0x0000 }; + +uint16 page00Cdata[]= { /* 0C00 (3 weights per char) */ +0xFBC0,0x8C00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8C04,0x0000, 0x16CD,0x0000,0x0000, +0x16CE,0x0000,0x0000, 0x16CF,0x0000,0x0000, 0x16D0,0x0000,0x0000, +0x16D1,0x0000,0x0000, 0x16D2,0x0000,0x0000, 0x16D3,0x0000,0x0000, +0x16D5,0x0000,0x0000, 0xFBC0,0x8C0D,0x0000, 0x16D7,0x0000,0x0000, +0x16D8,0x0000,0x0000, 0x16D9,0x0000,0x0000, 0xFBC0,0x8C11,0x0000, +0x16DA,0x0000,0x0000, 0x16DB,0x0000,0x0000, 0x16DC,0x0000,0x0000, +0x16DD,0x0000,0x0000, 0x16DE,0x0000,0x0000, 0x16DF,0x0000,0x0000, +0x16E0,0x0000,0x0000, 0x16E1,0x0000,0x0000, 0x16E2,0x0000,0x0000, +0x16E3,0x0000,0x0000, 0x16E4,0x0000,0x0000, 0x16E5,0x0000,0x0000, +0x16E6,0x0000,0x0000, 0x16E7,0x0000,0x0000, 0x16E8,0x0000,0x0000, +0x16E9,0x0000,0x0000, 0x16EA,0x0000,0x0000, 0x16EB,0x0000,0x0000, +0x16EC,0x0000,0x0000, 0x16ED,0x0000,0x0000, 0x16EE,0x0000,0x0000, +0x16EF,0x0000,0x0000, 0x16F0,0x0000,0x0000, 0xFBC0,0x8C29,0x0000, +0x16F1,0x0000,0x0000, 0x16F2,0x0000,0x0000, 0x16F3,0x0000,0x0000, +0x16F4,0x0000,0x0000, 0x16F5,0x0000,0x0000, 0x16F6,0x0000,0x0000, +0x16F7,0x0000,0x0000, 0x16F8,0x0000,0x0000, 0x16F9,0x0000,0x0000, +0x16FA,0x0000,0x0000, 0xFBC0,0x8C34,0x0000, 0x16FB,0x0000,0x0000, +0x16FC,0x0000,0x0000, 0x16FD,0x0000,0x0000, 0x16FE,0x0000,0x0000, +0x16FF,0x0000,0x0000, 0xFBC0,0x8C3A,0x0000, 0xFBC0,0x8C3B,0x0000, +0xFBC0,0x8C3C,0x0000, 0xFBC0,0x8C3D,0x0000, 0x1700,0x0000,0x0000, +0x1701,0x0000,0x0000, 0x1702,0x0000,0x0000, 0x1703,0x0000,0x0000, +0x1704,0x0000,0x0000, 0x1705,0x0000,0x0000, 0x1706,0x0000,0x0000, +0xFBC0,0x8C45,0x0000, 0x1707,0x0000,0x0000, 0x1708,0x0000,0x0000, +0x1709,0x0000,0x0000, 0xFBC0,0x8C49,0x0000, 0x170A,0x0000,0x0000, +0x170B,0x0000,0x0000, 0x170C,0x0000,0x0000, 0x170D,0x0000,0x0000, +0xFBC0,0x8C4E,0x0000, 0xFBC0,0x8C4F,0x0000, 0xFBC0,0x8C50,0x0000, +0xFBC0,0x8C51,0x0000, 0xFBC0,0x8C52,0x0000, 0xFBC0,0x8C53,0x0000, +0xFBC0,0x8C54,0x0000, 0x170E,0x0000,0x0000, 0x170F,0x0000,0x0000, +0xFBC0,0x8C57,0x0000, 0xFBC0,0x8C58,0x0000, 0xFBC0,0x8C59,0x0000, +0xFBC0,0x8C5A,0x0000, 0xFBC0,0x8C5B,0x0000, 0xFBC0,0x8C5C,0x0000, +0xFBC0,0x8C5D,0x0000, 0xFBC0,0x8C5E,0x0000, 0xFBC0,0x8C5F,0x0000, +0x16D4,0x0000,0x0000, 0x16D6,0x0000,0x0000, 0xFBC0,0x8C62,0x0000, +0xFBC0,0x8C63,0x0000, 0xFBC0,0x8C64,0x0000, 0xFBC0,0x8C65,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0xFBC0,0x8C70,0x0000, 0xFBC0,0x8C71,0x0000, +0xFBC0,0x8C72,0x0000, 0xFBC0,0x8C73,0x0000, 0xFBC0,0x8C74,0x0000, +0xFBC0,0x8C75,0x0000, 0xFBC0,0x8C76,0x0000, 0xFBC0,0x8C77,0x0000, +0xFBC0,0x8C78,0x0000, 0xFBC0,0x8C79,0x0000, 0xFBC0,0x8C7A,0x0000, +0xFBC0,0x8C7B,0x0000, 0xFBC0,0x8C7C,0x0000, 0xFBC0,0x8C7D,0x0000, +0xFBC0,0x8C7E,0x0000, 0xFBC0,0x8C7F,0x0000, 0xFBC0,0x8C80,0x0000, +0xFBC0,0x8C81,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x8C84,0x0000, 0x1710,0x0000,0x0000, 0x1711,0x0000,0x0000, +0x1712,0x0000,0x0000, 0x1713,0x0000,0x0000, 0x1714,0x0000,0x0000, +0x1715,0x0000,0x0000, 0x1716,0x0000,0x0000, 0x1718,0x0000,0x0000, +0xFBC0,0x8C8D,0x0000, 0x171A,0x0000,0x0000, 0x171B,0x0000,0x0000, +0x171C,0x0000,0x0000, 0xFBC0,0x8C91,0x0000, 0x171D,0x0000,0x0000, +0x171E,0x0000,0x0000, 0x171F,0x0000,0x0000, 0x1720,0x0000,0x0000, +0x1721,0x0000,0x0000, 0x1722,0x0000,0x0000, 0x1723,0x0000,0x0000, +0x1724,0x0000,0x0000, 0x1725,0x0000,0x0000, 0x1726,0x0000,0x0000, +0x1727,0x0000,0x0000, 0x1728,0x0000,0x0000, 0x1729,0x0000,0x0000, +0x172A,0x0000,0x0000, 0x172B,0x0000,0x0000, 0x172C,0x0000,0x0000, +0x172D,0x0000,0x0000, 0x172E,0x0000,0x0000, 0x172F,0x0000,0x0000, +0x1730,0x0000,0x0000, 0x1731,0x0000,0x0000, 0x1732,0x0000,0x0000, +0x1733,0x0000,0x0000, 0xFBC0,0x8CA9,0x0000, 0x1734,0x0000,0x0000, +0x1735,0x0000,0x0000, 0x1736,0x0000,0x0000, 0x1737,0x0000,0x0000, +0x1738,0x0000,0x0000, 0x1739,0x0000,0x0000, 0x173A,0x0000,0x0000, +0x173B,0x0000,0x0000, 0x173C,0x0000,0x0000, 0x1743,0x0000,0x0000, +0xFBC0,0x8CB4,0x0000, 0x173D,0x0000,0x0000, 0x173E,0x0000,0x0000, +0x173F,0x0000,0x0000, 0x1740,0x0000,0x0000, 0x1741,0x0000,0x0000, +0xFBC0,0x8CBA,0x0000, 0xFBC0,0x8CBB,0x0000, 0x0000,0x0000,0x0000, +0x1742,0x0000,0x0000, 0x1745,0x0000,0x0000, 0x1746,0x0000,0x0000, +0x1747,0x0000,0x0000, 0x1748,0x0000,0x0000, 0x1749,0x0000,0x0000, +0x174A,0x0000,0x0000, 0x174B,0x0000,0x0000, 0xFBC0,0x8CC5,0x0000, +0x174C,0x0000,0x0000, 0x174D,0x0000,0x0000, 0x174E,0x0000,0x0000, +0xFBC0,0x8CC9,0x0000, 0x174F,0x0000,0x0000, 0x1750,0x0000,0x0000, +0x1751,0x0000,0x0000, 0x1752,0x0000,0x0000, 0xFBC0,0x8CCE,0x0000, +0xFBC0,0x8CCF,0x0000, 0xFBC0,0x8CD0,0x0000, 0xFBC0,0x8CD1,0x0000, +0xFBC0,0x8CD2,0x0000, 0xFBC0,0x8CD3,0x0000, 0xFBC0,0x8CD4,0x0000, +0x1753,0x0000,0x0000, 0x1754,0x0000,0x0000, 0xFBC0,0x8CD7,0x0000, +0xFBC0,0x8CD8,0x0000, 0xFBC0,0x8CD9,0x0000, 0xFBC0,0x8CDA,0x0000, +0xFBC0,0x8CDB,0x0000, 0xFBC0,0x8CDC,0x0000, 0xFBC0,0x8CDD,0x0000, +0x1744,0x0000,0x0000, 0xFBC0,0x8CDF,0x0000, 0x1717,0x0000,0x0000, +0x1719,0x0000,0x0000, 0xFBC0,0x8CE2,0x0000, 0xFBC0,0x8CE3,0x0000, +0xFBC0,0x8CE4,0x0000, 0xFBC0,0x8CE5,0x0000, 0x0E29,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0xFBC0,0x8CF0,0x0000, 0xFBC0,0x8CF1,0x0000, 0xFBC0,0x8CF2,0x0000, +0xFBC0,0x8CF3,0x0000, 0xFBC0,0x8CF4,0x0000, 0xFBC0,0x8CF5,0x0000, +0xFBC0,0x8CF6,0x0000, 0xFBC0,0x8CF7,0x0000, 0xFBC0,0x8CF8,0x0000, +0xFBC0,0x8CF9,0x0000, 0xFBC0,0x8CFA,0x0000, 0xFBC0,0x8CFB,0x0000, +0xFBC0,0x8CFC,0x0000, 0xFBC0,0x8CFD,0x0000, 0xFBC0,0x8CFE,0x0000, +0xFBC0,0x8CFF,0x0000 }; + +uint16 page00Ddata[]= { /* 0D00 (3 weights per char) */ +0xFBC0,0x8D00,0x0000, 0xFBC0,0x8D01,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC0,0x8D04,0x0000, 0x1755,0x0000,0x0000, +0x1756,0x0000,0x0000, 0x1757,0x0000,0x0000, 0x1758,0x0000,0x0000, +0x1759,0x0000,0x0000, 0x175A,0x0000,0x0000, 0x175B,0x0000,0x0000, +0x175D,0x0000,0x0000, 0xFBC0,0x8D0D,0x0000, 0x175F,0x0000,0x0000, +0x1760,0x0000,0x0000, 0x1761,0x0000,0x0000, 0xFBC0,0x8D11,0x0000, +0x1762,0x0000,0x0000, 0x1763,0x0000,0x0000, 0x1764,0x0000,0x0000, +0x1765,0x0000,0x0000, 0x1766,0x0000,0x0000, 0x1767,0x0000,0x0000, +0x1768,0x0000,0x0000, 0x1769,0x0000,0x0000, 0x176A,0x0000,0x0000, +0x176B,0x0000,0x0000, 0x176C,0x0000,0x0000, 0x176D,0x0000,0x0000, +0x176E,0x0000,0x0000, 0x176F,0x0000,0x0000, 0x1770,0x0000,0x0000, +0x1771,0x0000,0x0000, 0x1772,0x0000,0x0000, 0x1773,0x0000,0x0000, +0x1774,0x0000,0x0000, 0x1775,0x0000,0x0000, 0x1776,0x0000,0x0000, +0x1777,0x0000,0x0000, 0x1778,0x0000,0x0000, 0xFBC0,0x8D29,0x0000, +0x1779,0x0000,0x0000, 0x177A,0x0000,0x0000, 0x177B,0x0000,0x0000, +0x177C,0x0000,0x0000, 0x177D,0x0000,0x0000, 0x177E,0x0000,0x0000, +0x177F,0x0000,0x0000, 0x1780,0x0000,0x0000, 0x1781,0x0000,0x0000, +0x1782,0x0000,0x0000, 0x1783,0x0000,0x0000, 0x1784,0x0000,0x0000, +0x1785,0x0000,0x0000, 0x1786,0x0000,0x0000, 0x1787,0x0000,0x0000, +0x1788,0x0000,0x0000, 0xFBC0,0x8D3A,0x0000, 0xFBC0,0x8D3B,0x0000, +0xFBC0,0x8D3C,0x0000, 0xFBC0,0x8D3D,0x0000, 0x1789,0x0000,0x0000, +0x178A,0x0000,0x0000, 0x178B,0x0000,0x0000, 0x178C,0x0000,0x0000, +0x178D,0x0000,0x0000, 0x178E,0x0000,0x0000, 0xFBC0,0x8D44,0x0000, +0xFBC0,0x8D45,0x0000, 0x178F,0x0000,0x0000, 0x1790,0x0000,0x0000, +0x1791,0x0000,0x0000, 0xFBC0,0x8D49,0x0000, 0x1792,0x0000,0x0000, +0x1793,0x0000,0x0000, 0x1794,0x0000,0x0000, 0x1795,0x0000,0x0000, +0xFBC0,0x8D4E,0x0000, 0xFBC0,0x8D4F,0x0000, 0xFBC0,0x8D50,0x0000, +0xFBC0,0x8D51,0x0000, 0xFBC0,0x8D52,0x0000, 0xFBC0,0x8D53,0x0000, +0xFBC0,0x8D54,0x0000, 0xFBC0,0x8D55,0x0000, 0xFBC0,0x8D56,0x0000, +0x1796,0x0000,0x0000, 0xFBC0,0x8D58,0x0000, 0xFBC0,0x8D59,0x0000, +0xFBC0,0x8D5A,0x0000, 0xFBC0,0x8D5B,0x0000, 0xFBC0,0x8D5C,0x0000, +0xFBC0,0x8D5D,0x0000, 0xFBC0,0x8D5E,0x0000, 0xFBC0,0x8D5F,0x0000, +0x175C,0x0000,0x0000, 0x175E,0x0000,0x0000, 0xFBC0,0x8D62,0x0000, +0xFBC0,0x8D63,0x0000, 0xFBC0,0x8D64,0x0000, 0xFBC0,0x8D65,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0xFBC0,0x8D70,0x0000, 0xFBC0,0x8D71,0x0000, +0xFBC0,0x8D72,0x0000, 0xFBC0,0x8D73,0x0000, 0xFBC0,0x8D74,0x0000, +0xFBC0,0x8D75,0x0000, 0xFBC0,0x8D76,0x0000, 0xFBC0,0x8D77,0x0000, +0xFBC0,0x8D78,0x0000, 0xFBC0,0x8D79,0x0000, 0xFBC0,0x8D7A,0x0000, +0xFBC0,0x8D7B,0x0000, 0xFBC0,0x8D7C,0x0000, 0xFBC0,0x8D7D,0x0000, +0xFBC0,0x8D7E,0x0000, 0xFBC0,0x8D7F,0x0000, 0xFBC0,0x8D80,0x0000, +0xFBC0,0x8D81,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x8D84,0x0000, 0x1797,0x0000,0x0000, 0x1798,0x0000,0x0000, +0x1799,0x0000,0x0000, 0x179A,0x0000,0x0000, 0x179B,0x0000,0x0000, +0x179C,0x0000,0x0000, 0x179D,0x0000,0x0000, 0x179E,0x0000,0x0000, +0x179F,0x0000,0x0000, 0x17A0,0x0000,0x0000, 0x17A1,0x0000,0x0000, +0x17A2,0x0000,0x0000, 0x17A3,0x0000,0x0000, 0x17A4,0x0000,0x0000, +0x17A5,0x0000,0x0000, 0x17A6,0x0000,0x0000, 0x17A7,0x0000,0x0000, +0x17A8,0x0000,0x0000, 0xFBC0,0x8D97,0x0000, 0xFBC0,0x8D98,0x0000, +0xFBC0,0x8D99,0x0000, 0x17A9,0x0000,0x0000, 0x17AA,0x0000,0x0000, +0x17AB,0x0000,0x0000, 0x17AC,0x0000,0x0000, 0x17AD,0x0000,0x0000, +0x17AE,0x0000,0x0000, 0x17AF,0x0000,0x0000, 0x17B0,0x0000,0x0000, +0x17B1,0x0000,0x0000, 0x17B2,0x0000,0x0000, 0x17B3,0x0000,0x0000, +0x17B4,0x0000,0x0000, 0x17B5,0x0000,0x0000, 0x17B6,0x0000,0x0000, +0x17B7,0x0000,0x0000, 0x17B8,0x0000,0x0000, 0x17B9,0x0000,0x0000, +0x17BA,0x0000,0x0000, 0x17BB,0x0000,0x0000, 0x17BC,0x0000,0x0000, +0x17BD,0x0000,0x0000, 0x17BE,0x0000,0x0000, 0x17BF,0x0000,0x0000, +0x17C0,0x0000,0x0000, 0xFBC0,0x8DB2,0x0000, 0x17C1,0x0000,0x0000, +0x17C2,0x0000,0x0000, 0x17C3,0x0000,0x0000, 0x17C4,0x0000,0x0000, +0x17C5,0x0000,0x0000, 0x17C6,0x0000,0x0000, 0x17C7,0x0000,0x0000, +0x17C8,0x0000,0x0000, 0x17C9,0x0000,0x0000, 0xFBC0,0x8DBC,0x0000, +0x17CA,0x0000,0x0000, 0xFBC0,0x8DBE,0x0000, 0xFBC0,0x8DBF,0x0000, +0x17CB,0x0000,0x0000, 0x17CC,0x0000,0x0000, 0x17CD,0x0000,0x0000, +0x17CE,0x0000,0x0000, 0x17CF,0x0000,0x0000, 0x17D0,0x0000,0x0000, +0x17D1,0x0000,0x0000, 0xFBC0,0x8DC7,0x0000, 0xFBC0,0x8DC8,0x0000, +0xFBC0,0x8DC9,0x0000, 0x17D2,0x0000,0x0000, 0xFBC0,0x8DCB,0x0000, +0xFBC0,0x8DCC,0x0000, 0xFBC0,0x8DCD,0x0000, 0xFBC0,0x8DCE,0x0000, +0x17D3,0x0000,0x0000, 0x17D4,0x0000,0x0000, 0x17D5,0x0000,0x0000, +0x17D6,0x0000,0x0000, 0x17D7,0x0000,0x0000, 0x17D8,0x0000,0x0000, +0xFBC0,0x8DD5,0x0000, 0x17D9,0x0000,0x0000, 0xFBC0,0x8DD7,0x0000, +0x17DA,0x0000,0x0000, 0x17DB,0x0000,0x0000, 0x17DC,0x0000,0x0000, +0x17DD,0x0000,0x0000, 0x17DE,0x0000,0x0000, 0x17DF,0x0000,0x0000, +0x17E0,0x0000,0x0000, 0x17E1,0x0000,0x0000, 0xFBC0,0x8DE0,0x0000, +0xFBC0,0x8DE1,0x0000, 0xFBC0,0x8DE2,0x0000, 0xFBC0,0x8DE3,0x0000, +0xFBC0,0x8DE4,0x0000, 0xFBC0,0x8DE5,0x0000, 0xFBC0,0x8DE6,0x0000, +0xFBC0,0x8DE7,0x0000, 0xFBC0,0x8DE8,0x0000, 0xFBC0,0x8DE9,0x0000, +0xFBC0,0x8DEA,0x0000, 0xFBC0,0x8DEB,0x0000, 0xFBC0,0x8DEC,0x0000, +0xFBC0,0x8DED,0x0000, 0xFBC0,0x8DEE,0x0000, 0xFBC0,0x8DEF,0x0000, +0xFBC0,0x8DF0,0x0000, 0xFBC0,0x8DF1,0x0000, 0x17E2,0x0000,0x0000, +0x17E3,0x0000,0x0000, 0x02FB,0x0000,0x0000, 0xFBC0,0x8DF5,0x0000, +0xFBC0,0x8DF6,0x0000, 0xFBC0,0x8DF7,0x0000, 0xFBC0,0x8DF8,0x0000, +0xFBC0,0x8DF9,0x0000, 0xFBC0,0x8DFA,0x0000, 0xFBC0,0x8DFB,0x0000, +0xFBC0,0x8DFC,0x0000, 0xFBC0,0x8DFD,0x0000, 0xFBC0,0x8DFE,0x0000, +0xFBC0,0x8DFF,0x0000 }; + +uint16 page00Edata[]= { /* 0E00 (3 weights per char) */ +0xFBC0,0x8E00,0x0000, 0x17E4,0x0000,0x0000, 0x17E5,0x0000,0x0000, +0x17E6,0x0000,0x0000, 0x17E7,0x0000,0x0000, 0x17E8,0x0000,0x0000, +0x17E9,0x0000,0x0000, 0x17EA,0x0000,0x0000, 0x17EB,0x0000,0x0000, +0x17EC,0x0000,0x0000, 0x17ED,0x0000,0x0000, 0x17EE,0x0000,0x0000, +0x17EF,0x0000,0x0000, 0x17F0,0x0000,0x0000, 0x17F1,0x0000,0x0000, +0x17F2,0x0000,0x0000, 0x17F3,0x0000,0x0000, 0x17F4,0x0000,0x0000, +0x17F5,0x0000,0x0000, 0x17F6,0x0000,0x0000, 0x17F7,0x0000,0x0000, +0x17F8,0x0000,0x0000, 0x17F9,0x0000,0x0000, 0x17FA,0x0000,0x0000, +0x17FB,0x0000,0x0000, 0x17FC,0x0000,0x0000, 0x17FD,0x0000,0x0000, +0x17FE,0x0000,0x0000, 0x17FF,0x0000,0x0000, 0x1800,0x0000,0x0000, +0x1801,0x0000,0x0000, 0x1802,0x0000,0x0000, 0x1803,0x0000,0x0000, +0x1804,0x0000,0x0000, 0x1805,0x0000,0x0000, 0x1806,0x0000,0x0000, +0x1807,0x0000,0x0000, 0x1808,0x0000,0x0000, 0x1809,0x0000,0x0000, +0x180A,0x0000,0x0000, 0x180B,0x0000,0x0000, 0x180C,0x0000,0x0000, +0x180D,0x0000,0x0000, 0x180E,0x0000,0x0000, 0x180F,0x0000,0x0000, +0x1810,0x0000,0x0000, 0x1811,0x0000,0x0000, 0x1812,0x0000,0x0000, +0x1813,0x0000,0x0000, 0x1814,0x0000,0x0000, 0x1815,0x0000,0x0000, +0x1816,0x0000,0x0000, 0x1817,0x0000,0x0000, 0x1818,0x0000,0x0000, +0x1819,0x0000,0x0000, 0x181A,0x0000,0x0000, 0x181B,0x0000,0x0000, +0x181C,0x0000,0x0000, 0x181D,0x0000,0x0000, 0xFBC0,0x8E3B,0x0000, +0xFBC0,0x8E3C,0x0000, 0xFBC0,0x8E3D,0x0000, 0xFBC0,0x8E3E,0x0000, +0x0E16,0x0000,0x0000, 0x181E,0x0000,0x0000, 0x181F,0x0000,0x0000, +0x1820,0x0000,0x0000, 0x1821,0x0000,0x0000, 0x1822,0x0000,0x0000, +0x1823,0x0000,0x0000, 0x0E03,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x1824,0x0000,0x0000, 0x1825,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0359,0x0000,0x0000, 0x0E29,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x02FC,0x0000,0x0000, 0x02FD,0x0000,0x0000, 0xFBC0,0x8E5C,0x0000, +0xFBC0,0x8E5D,0x0000, 0xFBC0,0x8E5E,0x0000, 0xFBC0,0x8E5F,0x0000, +0xFBC0,0x8E60,0x0000, 0xFBC0,0x8E61,0x0000, 0xFBC0,0x8E62,0x0000, +0xFBC0,0x8E63,0x0000, 0xFBC0,0x8E64,0x0000, 0xFBC0,0x8E65,0x0000, +0xFBC0,0x8E66,0x0000, 0xFBC0,0x8E67,0x0000, 0xFBC0,0x8E68,0x0000, +0xFBC0,0x8E69,0x0000, 0xFBC0,0x8E6A,0x0000, 0xFBC0,0x8E6B,0x0000, +0xFBC0,0x8E6C,0x0000, 0xFBC0,0x8E6D,0x0000, 0xFBC0,0x8E6E,0x0000, +0xFBC0,0x8E6F,0x0000, 0xFBC0,0x8E70,0x0000, 0xFBC0,0x8E71,0x0000, +0xFBC0,0x8E72,0x0000, 0xFBC0,0x8E73,0x0000, 0xFBC0,0x8E74,0x0000, +0xFBC0,0x8E75,0x0000, 0xFBC0,0x8E76,0x0000, 0xFBC0,0x8E77,0x0000, +0xFBC0,0x8E78,0x0000, 0xFBC0,0x8E79,0x0000, 0xFBC0,0x8E7A,0x0000, +0xFBC0,0x8E7B,0x0000, 0xFBC0,0x8E7C,0x0000, 0xFBC0,0x8E7D,0x0000, +0xFBC0,0x8E7E,0x0000, 0xFBC0,0x8E7F,0x0000, 0xFBC0,0x8E80,0x0000, +0x1826,0x0000,0x0000, 0x1827,0x0000,0x0000, 0xFBC0,0x8E83,0x0000, +0x1828,0x0000,0x0000, 0xFBC0,0x8E85,0x0000, 0xFBC0,0x8E86,0x0000, +0x1829,0x0000,0x0000, 0x182A,0x0000,0x0000, 0xFBC0,0x8E89,0x0000, +0x182B,0x0000,0x0000, 0xFBC0,0x8E8B,0x0000, 0xFBC0,0x8E8C,0x0000, +0x182C,0x0000,0x0000, 0xFBC0,0x8E8E,0x0000, 0xFBC0,0x8E8F,0x0000, +0xFBC0,0x8E90,0x0000, 0xFBC0,0x8E91,0x0000, 0xFBC0,0x8E92,0x0000, +0xFBC0,0x8E93,0x0000, 0x182D,0x0000,0x0000, 0x182E,0x0000,0x0000, +0x182F,0x0000,0x0000, 0x1830,0x0000,0x0000, 0xFBC0,0x8E98,0x0000, +0x1831,0x0000,0x0000, 0x1832,0x0000,0x0000, 0x1833,0x0000,0x0000, +0x1834,0x0000,0x0000, 0x1835,0x0000,0x0000, 0x1836,0x0000,0x0000, +0x1837,0x0000,0x0000, 0xFBC0,0x8EA0,0x0000, 0x1838,0x0000,0x0000, +0x1839,0x0000,0x0000, 0x183A,0x0000,0x0000, 0xFBC0,0x8EA4,0x0000, +0x183B,0x0000,0x0000, 0xFBC0,0x8EA6,0x0000, 0x183C,0x0000,0x0000, +0xFBC0,0x8EA8,0x0000, 0xFBC0,0x8EA9,0x0000, 0x183D,0x0000,0x0000, +0x183E,0x0000,0x0000, 0xFBC0,0x8EAC,0x0000, 0x183F,0x0000,0x0000, +0x1840,0x0000,0x0000, 0x1841,0x0000,0x0000, 0x1842,0x0000,0x0000, +0x1843,0x0000,0x0000, 0x1844,0x0000,0x0000, 0x1845,0x0000,0x0000, +0x1846,0x0000,0x0000, 0x1847,0x0000,0x0000, 0x1848,0x0000,0x0000, +0x1849,0x0000,0x0000, 0x184A,0x0000,0x0000, 0x184B,0x0000,0x0000, +0xFBC0,0x8EBA,0x0000, 0x184C,0x0000,0x0000, 0x184D,0x0000,0x0000, +0x184E,0x0000,0x0000, 0xFBC0,0x8EBE,0x0000, 0xFBC0,0x8EBF,0x0000, +0x184F,0x0000,0x0000, 0x1850,0x0000,0x0000, 0x1851,0x0000,0x0000, +0x1852,0x0000,0x0000, 0x1853,0x0000,0x0000, 0xFBC0,0x8EC5,0x0000, +0x0E04,0x0000,0x0000, 0xFBC0,0x8EC7,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x1854,0x0000,0x0000, 0x1855,0x0000,0x0000, 0xFBC0,0x8ECE,0x0000, +0xFBC0,0x8ECF,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, +0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, +0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, +0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0xFBC0,0x8EDA,0x0000, +0xFBC0,0x8EDB,0x0000, 0x183E,0x1831,0x0000, 0x183E,0x1838,0x0000, +0xFBC0,0x8EDE,0x0000, 0xFBC0,0x8EDF,0x0000, 0xFBC0,0x8EE0,0x0000, +0xFBC0,0x8EE1,0x0000, 0xFBC0,0x8EE2,0x0000, 0xFBC0,0x8EE3,0x0000, +0xFBC0,0x8EE4,0x0000, 0xFBC0,0x8EE5,0x0000, 0xFBC0,0x8EE6,0x0000, +0xFBC0,0x8EE7,0x0000, 0xFBC0,0x8EE8,0x0000, 0xFBC0,0x8EE9,0x0000, +0xFBC0,0x8EEA,0x0000, 0xFBC0,0x8EEB,0x0000, 0xFBC0,0x8EEC,0x0000, +0xFBC0,0x8EED,0x0000, 0xFBC0,0x8EEE,0x0000, 0xFBC0,0x8EEF,0x0000, +0xFBC0,0x8EF0,0x0000, 0xFBC0,0x8EF1,0x0000, 0xFBC0,0x8EF2,0x0000, +0xFBC0,0x8EF3,0x0000, 0xFBC0,0x8EF4,0x0000, 0xFBC0,0x8EF5,0x0000, +0xFBC0,0x8EF6,0x0000, 0xFBC0,0x8EF7,0x0000, 0xFBC0,0x8EF8,0x0000, +0xFBC0,0x8EF9,0x0000, 0xFBC0,0x8EFA,0x0000, 0xFBC0,0x8EFB,0x0000, +0xFBC0,0x8EFC,0x0000, 0xFBC0,0x8EFD,0x0000, 0xFBC0,0x8EFE,0x0000, +0xFBC0,0x8EFF,0x0000 }; + +uint16 page00Fdata[]= { /* 0F00 (3 weights per char) */ +0x189A,0x18AD,0x0000, 0x035A,0x0000,0x0000, 0x035B,0x0000,0x0000, +0x035C,0x0000,0x0000, 0x02FE,0x0000,0x0000, 0x02FF,0x0000,0x0000, +0x0300,0x0000,0x0000, 0x0301,0x0000,0x0000, 0x0302,0x0000,0x0000, +0x0303,0x0000,0x0000, 0x0304,0x0000,0x0000, 0x0305,0x0000,0x0000, +0x0305,0x0000,0x0000, 0x0306,0x0000,0x0000, 0x0307,0x0000,0x0000, +0x0308,0x0000,0x0000, 0x0309,0x0000,0x0000, 0x030A,0x0000,0x0000, +0x030B,0x0000,0x0000, 0x035D,0x0000,0x0000, 0x024C,0x0000,0x0000, +0x035E,0x0000,0x0000, 0x035F,0x0000,0x0000, 0x0360,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0361,0x0000,0x0000, +0x0362,0x0000,0x0000, 0x0363,0x0000,0x0000, 0x0364,0x0000,0x0000, +0x0365,0x0000,0x0000, 0x0366,0x0000,0x0000, 0x0E29,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x0E29,0x0000,0x0000, 0x0367,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0368,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0369,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x028E,0x0000,0x0000, 0x028F,0x0000,0x0000, +0x0290,0x0000,0x0000, 0x0291,0x0000,0x0000, 0x036A,0x0000,0x0000, +0x036B,0x0000,0x0000, 0x1856,0x0000,0x0000, 0x1858,0x0000,0x0000, +0x185A,0x0000,0x0000, 0x185A,0x1899,0x0000, 0x185C,0x0000,0x0000, +0x185E,0x0000,0x0000, 0x1860,0x0000,0x0000, 0x1862,0x0000,0x0000, +0xFBC0,0x8F48,0x0000, 0x1864,0x0000,0x0000, 0x1866,0x0000,0x0000, +0x1868,0x0000,0x0000, 0x186A,0x0000,0x0000, 0x186A,0x1899,0x0000, +0x186C,0x0000,0x0000, 0x186E,0x0000,0x0000, 0x1870,0x0000,0x0000, +0x1872,0x0000,0x0000, 0x1872,0x1899,0x0000, 0x1874,0x0000,0x0000, +0x1876,0x0000,0x0000, 0x1878,0x0000,0x0000, 0x187A,0x0000,0x0000, +0x187A,0x1899,0x0000, 0x187C,0x0000,0x0000, 0x187E,0x0000,0x0000, +0x1880,0x0000,0x0000, 0x1882,0x0000,0x0000, 0x1882,0x1899,0x0000, +0x1884,0x0000,0x0000, 0x1886,0x0000,0x0000, 0x1888,0x0000,0x0000, +0x188A,0x0000,0x0000, 0x188C,0x0000,0x0000, 0x188E,0x0000,0x0000, +0x1890,0x0000,0x0000, 0x1892,0x0000,0x0000, 0x1894,0x0000,0x0000, +0x1896,0x0000,0x0000, 0x1898,0x0000,0x0000, 0x189A,0x0000,0x0000, +0x1856,0x1895,0x0000, 0x188E,0x0000,0x0000, 0xFBC0,0x8F6B,0x0000, +0xFBC0,0x8F6C,0x0000, 0xFBC0,0x8F6D,0x0000, 0xFBC0,0x8F6E,0x0000, +0xFBC0,0x8F6F,0x0000, 0xFBC0,0x8F70,0x0000, 0x18A0,0x0000,0x0000, +0x18A1,0x0000,0x0000, 0x18A2,0x0000,0x0000, 0x18A5,0x0000,0x0000, +0x18A6,0x0000,0x0000, 0x18A7,0x0000,0x0000, 0x18A8,0x0000,0x0000, +0x18A9,0x0000,0x0000, 0x18AA,0x0000,0x0000, 0x18AB,0x0000,0x0000, +0x18AC,0x0000,0x0000, 0x18AD,0x0000,0x0000, 0x18AE,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x18A3,0x0000,0x0000, +0x18A4,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x18AF,0x0000,0x0000, 0x030C,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x189C,0x0000,0x0000, 0x189D,0x0000,0x0000, +0x189E,0x0000,0x0000, 0x189F,0x0000,0x0000, 0xFBC0,0x8F8C,0x0000, +0xFBC0,0x8F8D,0x0000, 0xFBC0,0x8F8E,0x0000, 0xFBC0,0x8F8F,0x0000, +0x1857,0x0000,0x0000, 0x1859,0x0000,0x0000, 0x185B,0x0000,0x0000, +0x185B,0x1899,0x0000, 0x185D,0x0000,0x0000, 0x185F,0x0000,0x0000, +0x1861,0x0000,0x0000, 0x1863,0x0000,0x0000, 0xFBC0,0x8F98,0x0000, +0x1865,0x0000,0x0000, 0x1867,0x0000,0x0000, 0x1869,0x0000,0x0000, +0x186B,0x0000,0x0000, 0x186B,0x1899,0x0000, 0x186D,0x0000,0x0000, +0x186F,0x0000,0x0000, 0x1871,0x0000,0x0000, 0x1873,0x0000,0x0000, +0x1873,0x1899,0x0000, 0x1875,0x0000,0x0000, 0x1877,0x0000,0x0000, +0x1879,0x0000,0x0000, 0x187B,0x0000,0x0000, 0x187B,0x1899,0x0000, +0x187D,0x0000,0x0000, 0x187F,0x0000,0x0000, 0x1881,0x0000,0x0000, +0x1883,0x0000,0x0000, 0x1883,0x1899,0x0000, 0x1885,0x0000,0x0000, +0x1887,0x0000,0x0000, 0x1889,0x0000,0x0000, 0x188B,0x0000,0x0000, +0x188D,0x0000,0x0000, 0x188F,0x0000,0x0000, 0x1891,0x0000,0x0000, +0x1893,0x0000,0x0000, 0x1895,0x0000,0x0000, 0x1897,0x0000,0x0000, +0x1899,0x0000,0x0000, 0x189B,0x0000,0x0000, 0x1857,0x1895,0x0000, +0x1885,0x0000,0x0000, 0x188D,0x0000,0x0000, 0x188F,0x0000,0x0000, +0xFBC0,0x8FBD,0x0000, 0x036C,0x0000,0x0000, 0x036D,0x0000,0x0000, +0x036E,0x0000,0x0000, 0x036F,0x0000,0x0000, 0x0370,0x0000,0x0000, +0x0371,0x0000,0x0000, 0x0372,0x0000,0x0000, 0x0373,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0374,0x0000,0x0000, 0x0375,0x0000,0x0000, +0x0376,0x0000,0x0000, 0x0377,0x0000,0x0000, 0x0378,0x0000,0x0000, +0x0379,0x0000,0x0000, 0xFBC0,0x8FCD,0x0000, 0xFBC0,0x8FCE,0x0000, +0x037A,0x0000,0x0000, 0xFBC0,0x8FD0,0x0000, 0xFBC0,0x8FD1,0x0000, +0xFBC0,0x8FD2,0x0000, 0xFBC0,0x8FD3,0x0000, 0xFBC0,0x8FD4,0x0000, +0xFBC0,0x8FD5,0x0000, 0xFBC0,0x8FD6,0x0000, 0xFBC0,0x8FD7,0x0000, +0xFBC0,0x8FD8,0x0000, 0xFBC0,0x8FD9,0x0000, 0xFBC0,0x8FDA,0x0000, +0xFBC0,0x8FDB,0x0000, 0xFBC0,0x8FDC,0x0000, 0xFBC0,0x8FDD,0x0000, +0xFBC0,0x8FDE,0x0000, 0xFBC0,0x8FDF,0x0000, 0xFBC0,0x8FE0,0x0000, +0xFBC0,0x8FE1,0x0000, 0xFBC0,0x8FE2,0x0000, 0xFBC0,0x8FE3,0x0000, +0xFBC0,0x8FE4,0x0000, 0xFBC0,0x8FE5,0x0000, 0xFBC0,0x8FE6,0x0000, +0xFBC0,0x8FE7,0x0000, 0xFBC0,0x8FE8,0x0000, 0xFBC0,0x8FE9,0x0000, +0xFBC0,0x8FEA,0x0000, 0xFBC0,0x8FEB,0x0000, 0xFBC0,0x8FEC,0x0000, +0xFBC0,0x8FED,0x0000, 0xFBC0,0x8FEE,0x0000, 0xFBC0,0x8FEF,0x0000, +0xFBC0,0x8FF0,0x0000, 0xFBC0,0x8FF1,0x0000, 0xFBC0,0x8FF2,0x0000, +0xFBC0,0x8FF3,0x0000, 0xFBC0,0x8FF4,0x0000, 0xFBC0,0x8FF5,0x0000, +0xFBC0,0x8FF6,0x0000, 0xFBC0,0x8FF7,0x0000, 0xFBC0,0x8FF8,0x0000, +0xFBC0,0x8FF9,0x0000, 0xFBC0,0x8FFA,0x0000, 0xFBC0,0x8FFB,0x0000, +0xFBC0,0x8FFC,0x0000, 0xFBC0,0x8FFD,0x0000, 0xFBC0,0x8FFE,0x0000, +0xFBC0,0x8FFF,0x0000 }; + +uint16 page010data[]= { /* 1000 (3 weights per char) */ +0x1931,0x0000,0x0000, 0x1932,0x0000,0x0000, 0x1933,0x0000,0x0000, +0x1934,0x0000,0x0000, 0x1935,0x0000,0x0000, 0x1936,0x0000,0x0000, +0x1937,0x0000,0x0000, 0x1938,0x0000,0x0000, 0x1939,0x0000,0x0000, +0x193A,0x0000,0x0000, 0x193B,0x0000,0x0000, 0x193C,0x0000,0x0000, +0x193D,0x0000,0x0000, 0x193E,0x0000,0x0000, 0x193F,0x0000,0x0000, +0x1940,0x0000,0x0000, 0x1941,0x0000,0x0000, 0x1942,0x0000,0x0000, +0x1943,0x0000,0x0000, 0x1944,0x0000,0x0000, 0x1945,0x0000,0x0000, +0x1946,0x0000,0x0000, 0x1947,0x0000,0x0000, 0x1948,0x0000,0x0000, +0x1949,0x0000,0x0000, 0x194A,0x0000,0x0000, 0x194B,0x0000,0x0000, +0x194C,0x0000,0x0000, 0x194D,0x0000,0x0000, 0x194E,0x0000,0x0000, +0x1951,0x0000,0x0000, 0x1952,0x0000,0x0000, 0x1953,0x0000,0x0000, +0x1954,0x0000,0x0000, 0xFBC0,0x9022,0x0000, 0x1955,0x0000,0x0000, +0x1956,0x0000,0x0000, 0x1957,0x0000,0x0000, 0x1958,0x0000,0x0000, +0x1959,0x0000,0x0000, 0xFBC0,0x9028,0x0000, 0x195A,0x0000,0x0000, +0x195B,0x0000,0x0000, 0xFBC0,0x902B,0x0000, 0x1960,0x0000,0x0000, +0x1961,0x0000,0x0000, 0x1962,0x0000,0x0000, 0x1963,0x0000,0x0000, +0x1964,0x0000,0x0000, 0x1965,0x0000,0x0000, 0x1966,0x0000,0x0000, +0xFBC0,0x9033,0x0000, 0xFBC0,0x9034,0x0000, 0xFBC0,0x9035,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x196B,0x0000,0x0000, 0xFBC0,0x903A,0x0000, 0xFBC0,0x903B,0x0000, +0xFBC0,0x903C,0x0000, 0xFBC0,0x903D,0x0000, 0xFBC0,0x903E,0x0000, +0xFBC0,0x903F,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, +0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, +0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, +0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x026C,0x0000,0x0000, +0x026D,0x0000,0x0000, 0x030E,0x0000,0x0000, 0x030F,0x0000,0x0000, +0x0310,0x0000,0x0000, 0x0311,0x0000,0x0000, 0x194F,0x0000,0x0000, +0x1950,0x0000,0x0000, 0x195C,0x0000,0x0000, 0x195D,0x0000,0x0000, +0x195E,0x0000,0x0000, 0x195F,0x0000,0x0000, 0x1967,0x0000,0x0000, +0x1968,0x0000,0x0000, 0x1969,0x0000,0x0000, 0x196A,0x0000,0x0000, +0xFBC0,0x905A,0x0000, 0xFBC0,0x905B,0x0000, 0xFBC0,0x905C,0x0000, +0xFBC0,0x905D,0x0000, 0xFBC0,0x905E,0x0000, 0xFBC0,0x905F,0x0000, +0xFBC0,0x9060,0x0000, 0xFBC0,0x9061,0x0000, 0xFBC0,0x9062,0x0000, +0xFBC0,0x9063,0x0000, 0xFBC0,0x9064,0x0000, 0xFBC0,0x9065,0x0000, +0xFBC0,0x9066,0x0000, 0xFBC0,0x9067,0x0000, 0xFBC0,0x9068,0x0000, +0xFBC0,0x9069,0x0000, 0xFBC0,0x906A,0x0000, 0xFBC0,0x906B,0x0000, +0xFBC0,0x906C,0x0000, 0xFBC0,0x906D,0x0000, 0xFBC0,0x906E,0x0000, +0xFBC0,0x906F,0x0000, 0xFBC0,0x9070,0x0000, 0xFBC0,0x9071,0x0000, +0xFBC0,0x9072,0x0000, 0xFBC0,0x9073,0x0000, 0xFBC0,0x9074,0x0000, +0xFBC0,0x9075,0x0000, 0xFBC0,0x9076,0x0000, 0xFBC0,0x9077,0x0000, +0xFBC0,0x9078,0x0000, 0xFBC0,0x9079,0x0000, 0xFBC0,0x907A,0x0000, +0xFBC0,0x907B,0x0000, 0xFBC0,0x907C,0x0000, 0xFBC0,0x907D,0x0000, +0xFBC0,0x907E,0x0000, 0xFBC0,0x907F,0x0000, 0xFBC0,0x9080,0x0000, +0xFBC0,0x9081,0x0000, 0xFBC0,0x9082,0x0000, 0xFBC0,0x9083,0x0000, +0xFBC0,0x9084,0x0000, 0xFBC0,0x9085,0x0000, 0xFBC0,0x9086,0x0000, +0xFBC0,0x9087,0x0000, 0xFBC0,0x9088,0x0000, 0xFBC0,0x9089,0x0000, +0xFBC0,0x908A,0x0000, 0xFBC0,0x908B,0x0000, 0xFBC0,0x908C,0x0000, +0xFBC0,0x908D,0x0000, 0xFBC0,0x908E,0x0000, 0xFBC0,0x908F,0x0000, +0xFBC0,0x9090,0x0000, 0xFBC0,0x9091,0x0000, 0xFBC0,0x9092,0x0000, +0xFBC0,0x9093,0x0000, 0xFBC0,0x9094,0x0000, 0xFBC0,0x9095,0x0000, +0xFBC0,0x9096,0x0000, 0xFBC0,0x9097,0x0000, 0xFBC0,0x9098,0x0000, +0xFBC0,0x9099,0x0000, 0xFBC0,0x909A,0x0000, 0xFBC0,0x909B,0x0000, +0xFBC0,0x909C,0x0000, 0xFBC0,0x909D,0x0000, 0xFBC0,0x909E,0x0000, +0xFBC0,0x909F,0x0000, 0x12E1,0x0000,0x0000, 0x12E2,0x0000,0x0000, +0x12E3,0x0000,0x0000, 0x12E4,0x0000,0x0000, 0x12E5,0x0000,0x0000, +0x12E6,0x0000,0x0000, 0x12E7,0x0000,0x0000, 0x12E9,0x0000,0x0000, +0x12EA,0x0000,0x0000, 0x12EB,0x0000,0x0000, 0x12EC,0x0000,0x0000, +0x12ED,0x0000,0x0000, 0x12EE,0x0000,0x0000, 0x12F0,0x0000,0x0000, +0x12F1,0x0000,0x0000, 0x12F2,0x0000,0x0000, 0x12F3,0x0000,0x0000, +0x12F4,0x0000,0x0000, 0x12F5,0x0000,0x0000, 0x12F7,0x0000,0x0000, +0x12F8,0x0000,0x0000, 0x12F9,0x0000,0x0000, 0x12FA,0x0000,0x0000, +0x12FB,0x0000,0x0000, 0x12FC,0x0000,0x0000, 0x12FD,0x0000,0x0000, +0x12FE,0x0000,0x0000, 0x12FF,0x0000,0x0000, 0x1300,0x0000,0x0000, +0x1301,0x0000,0x0000, 0x1302,0x0000,0x0000, 0x1304,0x0000,0x0000, +0x1305,0x0000,0x0000, 0x12E8,0x0000,0x0000, 0x12EF,0x0000,0x0000, +0x12F6,0x0000,0x0000, 0x1303,0x0000,0x0000, 0x1306,0x0000,0x0000, +0xFBC0,0x90C6,0x0000, 0xFBC0,0x90C7,0x0000, 0xFBC0,0x90C8,0x0000, +0xFBC0,0x90C9,0x0000, 0xFBC0,0x90CA,0x0000, 0xFBC0,0x90CB,0x0000, +0xFBC0,0x90CC,0x0000, 0xFBC0,0x90CD,0x0000, 0xFBC0,0x90CE,0x0000, +0xFBC0,0x90CF,0x0000, 0x12E1,0x0000,0x0000, 0x12E2,0x0000,0x0000, +0x12E3,0x0000,0x0000, 0x12E4,0x0000,0x0000, 0x12E5,0x0000,0x0000, +0x12E6,0x0000,0x0000, 0x12E7,0x0000,0x0000, 0x12E9,0x0000,0x0000, +0x12EA,0x0000,0x0000, 0x12EB,0x0000,0x0000, 0x12EC,0x0000,0x0000, +0x12ED,0x0000,0x0000, 0x12EE,0x0000,0x0000, 0x12F0,0x0000,0x0000, +0x12F1,0x0000,0x0000, 0x12F2,0x0000,0x0000, 0x12F3,0x0000,0x0000, +0x12F4,0x0000,0x0000, 0x12F5,0x0000,0x0000, 0x12F7,0x0000,0x0000, +0x12F8,0x0000,0x0000, 0x12F9,0x0000,0x0000, 0x12FA,0x0000,0x0000, +0x12FB,0x0000,0x0000, 0x12FC,0x0000,0x0000, 0x12FD,0x0000,0x0000, +0x12FE,0x0000,0x0000, 0x12FF,0x0000,0x0000, 0x1300,0x0000,0x0000, +0x1301,0x0000,0x0000, 0x1302,0x0000,0x0000, 0x1304,0x0000,0x0000, +0x1305,0x0000,0x0000, 0x12E8,0x0000,0x0000, 0x12EF,0x0000,0x0000, +0x12F6,0x0000,0x0000, 0x1303,0x0000,0x0000, 0x1306,0x0000,0x0000, +0x1307,0x0000,0x0000, 0x1308,0x0000,0x0000, 0x1309,0x0000,0x0000, +0xFBC0,0x90F9,0x0000, 0xFBC0,0x90FA,0x0000, 0x0271,0x0000,0x0000, +0xFBC0,0x90FC,0x0000, 0xFBC0,0x90FD,0x0000, 0xFBC0,0x90FE,0x0000, +0xFBC0,0x90FF,0x0000 }; + +uint16 page011data[]= { /* 1100 (3 weights per char) */ +0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000, 0x1D64,0x0000,0x0000, +0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000, +0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000, +0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, 0x1D6D,0x0000,0x0000, +0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, 0x1D70,0x0000,0x0000, +0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, 0x1D73,0x0000,0x0000, +0x1D74,0x0000,0x0000, 0x1D75,0x0000,0x0000, 0x1D76,0x0000,0x0000, +0x1D77,0x0000,0x0000, 0x1D78,0x0000,0x0000, 0x1D79,0x0000,0x0000, +0x1D7A,0x0000,0x0000, 0x1D7B,0x0000,0x0000, 0x1D7C,0x0000,0x0000, +0x1D7D,0x0000,0x0000, 0x1D7E,0x0000,0x0000, 0x1D7F,0x0000,0x0000, +0x1D80,0x0000,0x0000, 0x1D81,0x0000,0x0000, 0x1D82,0x0000,0x0000, +0x1D83,0x0000,0x0000, 0x1D84,0x0000,0x0000, 0x1D85,0x0000,0x0000, +0x1D86,0x0000,0x0000, 0x1D87,0x0000,0x0000, 0x1D88,0x0000,0x0000, +0x1D89,0x0000,0x0000, 0x1D8A,0x0000,0x0000, 0x1D8B,0x0000,0x0000, +0x1D8C,0x0000,0x0000, 0x1D8D,0x0000,0x0000, 0x1D8E,0x0000,0x0000, +0x1D8F,0x0000,0x0000, 0x1D90,0x0000,0x0000, 0x1D91,0x0000,0x0000, +0x1D92,0x0000,0x0000, 0x1D93,0x0000,0x0000, 0x1D94,0x0000,0x0000, +0x1D95,0x0000,0x0000, 0x1D96,0x0000,0x0000, 0x1D97,0x0000,0x0000, +0x1D98,0x0000,0x0000, 0x1D99,0x0000,0x0000, 0x1D9A,0x0000,0x0000, +0x1D9B,0x0000,0x0000, 0x1D9C,0x0000,0x0000, 0x1D9D,0x0000,0x0000, +0x1D9E,0x0000,0x0000, 0x1D9F,0x0000,0x0000, 0x1DA0,0x0000,0x0000, +0x1DA1,0x0000,0x0000, 0x1DA2,0x0000,0x0000, 0x1DA3,0x0000,0x0000, +0x1DA4,0x0000,0x0000, 0x1DA5,0x0000,0x0000, 0x1DA6,0x0000,0x0000, +0x1DA7,0x0000,0x0000, 0x1DA8,0x0000,0x0000, 0x1DA9,0x0000,0x0000, +0x1DAA,0x0000,0x0000, 0x1DAB,0x0000,0x0000, 0x1DAC,0x0000,0x0000, +0x1DAD,0x0000,0x0000, 0x1DAE,0x0000,0x0000, 0x1DAF,0x0000,0x0000, +0x1DB0,0x0000,0x0000, 0x1DB1,0x0000,0x0000, 0x1DB2,0x0000,0x0000, +0x1DB3,0x0000,0x0000, 0x1DB4,0x0000,0x0000, 0x1DB5,0x0000,0x0000, +0x1DB6,0x0000,0x0000, 0x1DB7,0x0000,0x0000, 0x1DB8,0x0000,0x0000, +0x1DB9,0x0000,0x0000, 0x1DBA,0x0000,0x0000, 0x1DBB,0x0000,0x0000, +0xFBC0,0x915A,0x0000, 0xFBC0,0x915B,0x0000, 0xFBC0,0x915C,0x0000, +0xFBC0,0x915D,0x0000, 0xFBC0,0x915E,0x0000, 0x1DBC,0x0000,0x0000, +0x1DBD,0x0000,0x0000, 0x1DBE,0x0000,0x0000, 0x1DBF,0x0000,0x0000, +0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, 0x1DC2,0x0000,0x0000, +0x1DC3,0x0000,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000, +0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000, +0x1DC9,0x0000,0x0000, 0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000, +0x1DCC,0x0000,0x0000, 0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000, +0x1DCF,0x0000,0x0000, 0x1DD0,0x0000,0x0000, 0x1DD1,0x0000,0x0000, +0x1DD2,0x0000,0x0000, 0x1DD3,0x0000,0x0000, 0x1DD4,0x0000,0x0000, +0x1DD5,0x0000,0x0000, 0x1DD6,0x0000,0x0000, 0x1DD7,0x0000,0x0000, +0x1DD8,0x0000,0x0000, 0x1DD9,0x0000,0x0000, 0x1DDA,0x0000,0x0000, +0x1DDB,0x0000,0x0000, 0x1DDC,0x0000,0x0000, 0x1DDD,0x0000,0x0000, +0x1DDE,0x0000,0x0000, 0x1DDF,0x0000,0x0000, 0x1DE0,0x0000,0x0000, +0x1DE1,0x0000,0x0000, 0x1DE2,0x0000,0x0000, 0x1DE3,0x0000,0x0000, +0x1DE4,0x0000,0x0000, 0x1DE5,0x0000,0x0000, 0x1DE6,0x0000,0x0000, +0x1DE7,0x0000,0x0000, 0x1DE8,0x0000,0x0000, 0x1DE9,0x0000,0x0000, +0x1DEA,0x0000,0x0000, 0x1DEB,0x0000,0x0000, 0x1DEC,0x0000,0x0000, +0x1DED,0x0000,0x0000, 0x1DEE,0x0000,0x0000, 0x1DEF,0x0000,0x0000, +0x1DF0,0x0000,0x0000, 0x1DF1,0x0000,0x0000, 0x1DF2,0x0000,0x0000, +0x1DF3,0x0000,0x0000, 0x1DF4,0x0000,0x0000, 0x1DF5,0x0000,0x0000, +0x1DF6,0x0000,0x0000, 0x1DF7,0x0000,0x0000, 0x1DF8,0x0000,0x0000, +0x1DF9,0x0000,0x0000, 0x1DFA,0x0000,0x0000, 0x1DFB,0x0000,0x0000, +0x1DFC,0x0000,0x0000, 0x1DFD,0x0000,0x0000, 0x1DFE,0x0000,0x0000, +0x1DFF,0x0000,0x0000, 0xFBC0,0x91A3,0x0000, 0xFBC0,0x91A4,0x0000, +0xFBC0,0x91A5,0x0000, 0xFBC0,0x91A6,0x0000, 0xFBC0,0x91A7,0x0000, +0x1E00,0x0000,0x0000, 0x1E01,0x0000,0x0000, 0x1E02,0x0000,0x0000, +0x1E03,0x0000,0x0000, 0x1E04,0x0000,0x0000, 0x1E05,0x0000,0x0000, +0x1E06,0x0000,0x0000, 0x1E07,0x0000,0x0000, 0x1E08,0x0000,0x0000, +0x1E09,0x0000,0x0000, 0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000, +0x1E0C,0x0000,0x0000, 0x1E0D,0x0000,0x0000, 0x1E0E,0x0000,0x0000, +0x1E0F,0x0000,0x0000, 0x1E10,0x0000,0x0000, 0x1E11,0x0000,0x0000, +0x1E12,0x0000,0x0000, 0x1E13,0x0000,0x0000, 0x1E14,0x0000,0x0000, +0x1E15,0x0000,0x0000, 0x1E16,0x0000,0x0000, 0x1E17,0x0000,0x0000, +0x1E18,0x0000,0x0000, 0x1E19,0x0000,0x0000, 0x1E1A,0x0000,0x0000, +0x1E1B,0x0000,0x0000, 0x1E1C,0x0000,0x0000, 0x1E1D,0x0000,0x0000, +0x1E1E,0x0000,0x0000, 0x1E1F,0x0000,0x0000, 0x1E20,0x0000,0x0000, +0x1E21,0x0000,0x0000, 0x1E22,0x0000,0x0000, 0x1E23,0x0000,0x0000, +0x1E24,0x0000,0x0000, 0x1E25,0x0000,0x0000, 0x1E26,0x0000,0x0000, +0x1E27,0x0000,0x0000, 0x1E28,0x0000,0x0000, 0x1E29,0x0000,0x0000, +0x1E2A,0x0000,0x0000, 0x1E2B,0x0000,0x0000, 0x1E2C,0x0000,0x0000, +0x1E2D,0x0000,0x0000, 0x1E2E,0x0000,0x0000, 0x1E2F,0x0000,0x0000, +0x1E30,0x0000,0x0000, 0x1E31,0x0000,0x0000, 0x1E32,0x0000,0x0000, +0x1E33,0x0000,0x0000, 0x1E34,0x0000,0x0000, 0x1E35,0x0000,0x0000, +0x1E36,0x0000,0x0000, 0x1E37,0x0000,0x0000, 0x1E38,0x0000,0x0000, +0x1E39,0x0000,0x0000, 0x1E3A,0x0000,0x0000, 0x1E3B,0x0000,0x0000, +0x1E3C,0x0000,0x0000, 0x1E3D,0x0000,0x0000, 0x1E3E,0x0000,0x0000, +0x1E3F,0x0000,0x0000, 0x1E40,0x0000,0x0000, 0x1E41,0x0000,0x0000, +0x1E42,0x0000,0x0000, 0x1E43,0x0000,0x0000, 0x1E44,0x0000,0x0000, +0x1E45,0x0000,0x0000, 0x1E46,0x0000,0x0000, 0x1E47,0x0000,0x0000, +0x1E48,0x0000,0x0000, 0x1E49,0x0000,0x0000, 0x1E4A,0x0000,0x0000, +0x1E4B,0x0000,0x0000, 0x1E4C,0x0000,0x0000, 0x1E4D,0x0000,0x0000, +0x1E4E,0x0000,0x0000, 0x1E4F,0x0000,0x0000, 0x1E50,0x0000,0x0000, +0x1E51,0x0000,0x0000, 0xFBC0,0x91FA,0x0000, 0xFBC0,0x91FB,0x0000, +0xFBC0,0x91FC,0x0000, 0xFBC0,0x91FD,0x0000, 0xFBC0,0x91FE,0x0000, +0xFBC0,0x91FF,0x0000 }; + +uint16 page012data[]= { /* 1200 (3 weights per char) */ +0x141C,0x0000,0x0000, 0x141D,0x0000,0x0000, 0x141E,0x0000,0x0000, +0x141F,0x0000,0x0000, 0x1420,0x0000,0x0000, 0x1421,0x0000,0x0000, +0x1422,0x0000,0x0000, 0xFBC0,0x9207,0x0000, 0x1423,0x0000,0x0000, +0x1424,0x0000,0x0000, 0x1425,0x0000,0x0000, 0x1426,0x0000,0x0000, +0x1427,0x0000,0x0000, 0x1428,0x0000,0x0000, 0x1429,0x0000,0x0000, +0x142A,0x0000,0x0000, 0x142B,0x0000,0x0000, 0x142C,0x0000,0x0000, +0x142D,0x0000,0x0000, 0x142E,0x0000,0x0000, 0x142F,0x0000,0x0000, +0x1430,0x0000,0x0000, 0x1431,0x0000,0x0000, 0x1432,0x0000,0x0000, +0x1433,0x0000,0x0000, 0x1434,0x0000,0x0000, 0x1435,0x0000,0x0000, +0x1436,0x0000,0x0000, 0x1437,0x0000,0x0000, 0x1438,0x0000,0x0000, +0x1439,0x0000,0x0000, 0x143A,0x0000,0x0000, 0x143B,0x0000,0x0000, +0x143C,0x0000,0x0000, 0x143D,0x0000,0x0000, 0x143E,0x0000,0x0000, +0x143F,0x0000,0x0000, 0x1440,0x0000,0x0000, 0x1441,0x0000,0x0000, +0x1442,0x0000,0x0000, 0x1443,0x0000,0x0000, 0x1444,0x0000,0x0000, +0x1445,0x0000,0x0000, 0x1446,0x0000,0x0000, 0x1447,0x0000,0x0000, +0x1448,0x0000,0x0000, 0x1449,0x0000,0x0000, 0x144A,0x0000,0x0000, +0x144B,0x0000,0x0000, 0x144C,0x0000,0x0000, 0x144D,0x0000,0x0000, +0x144E,0x0000,0x0000, 0x144F,0x0000,0x0000, 0x1450,0x0000,0x0000, +0x1451,0x0000,0x0000, 0x1452,0x0000,0x0000, 0x1453,0x0000,0x0000, +0x1454,0x0000,0x0000, 0x1455,0x0000,0x0000, 0x1456,0x0000,0x0000, +0x1457,0x0000,0x0000, 0x1458,0x0000,0x0000, 0x1459,0x0000,0x0000, +0x145A,0x0000,0x0000, 0x145B,0x0000,0x0000, 0x145C,0x0000,0x0000, +0x145D,0x0000,0x0000, 0x145E,0x0000,0x0000, 0x145F,0x0000,0x0000, +0x1460,0x0000,0x0000, 0x1461,0x0000,0x0000, 0xFBC0,0x9247,0x0000, +0x1462,0x0000,0x0000, 0xFBC0,0x9249,0x0000, 0x1463,0x0000,0x0000, +0x1464,0x0000,0x0000, 0x1465,0x0000,0x0000, 0x1466,0x0000,0x0000, +0xFBC0,0x924E,0x0000, 0xFBC0,0x924F,0x0000, 0x1467,0x0000,0x0000, +0x1468,0x0000,0x0000, 0x1469,0x0000,0x0000, 0x146A,0x0000,0x0000, +0x146B,0x0000,0x0000, 0x146C,0x0000,0x0000, 0x146D,0x0000,0x0000, +0xFBC0,0x9257,0x0000, 0x146E,0x0000,0x0000, 0xFBC0,0x9259,0x0000, +0x146F,0x0000,0x0000, 0x1470,0x0000,0x0000, 0x1471,0x0000,0x0000, +0x1472,0x0000,0x0000, 0xFBC0,0x925E,0x0000, 0xFBC0,0x925F,0x0000, +0x1473,0x0000,0x0000, 0x1474,0x0000,0x0000, 0x1475,0x0000,0x0000, +0x1476,0x0000,0x0000, 0x1477,0x0000,0x0000, 0x1478,0x0000,0x0000, +0x1479,0x0000,0x0000, 0x147A,0x0000,0x0000, 0x147B,0x0000,0x0000, +0x147C,0x0000,0x0000, 0x147D,0x0000,0x0000, 0x147E,0x0000,0x0000, +0x147F,0x0000,0x0000, 0x1480,0x0000,0x0000, 0x1481,0x0000,0x0000, +0x1482,0x0000,0x0000, 0x1483,0x0000,0x0000, 0x1484,0x0000,0x0000, +0x1485,0x0000,0x0000, 0x1486,0x0000,0x0000, 0x1487,0x0000,0x0000, +0x1488,0x0000,0x0000, 0x1489,0x0000,0x0000, 0x148A,0x0000,0x0000, +0x148B,0x0000,0x0000, 0x148C,0x0000,0x0000, 0x148D,0x0000,0x0000, +0x148E,0x0000,0x0000, 0x148F,0x0000,0x0000, 0x1490,0x0000,0x0000, +0x1491,0x0000,0x0000, 0x1492,0x0000,0x0000, 0x1493,0x0000,0x0000, +0x1494,0x0000,0x0000, 0x1495,0x0000,0x0000, 0x1496,0x0000,0x0000, +0x1497,0x0000,0x0000, 0x1498,0x0000,0x0000, 0x1499,0x0000,0x0000, +0xFBC0,0x9287,0x0000, 0x149A,0x0000,0x0000, 0xFBC0,0x9289,0x0000, +0x149B,0x0000,0x0000, 0x149C,0x0000,0x0000, 0x149D,0x0000,0x0000, +0x149E,0x0000,0x0000, 0xFBC0,0x928E,0x0000, 0xFBC0,0x928F,0x0000, +0x149F,0x0000,0x0000, 0x14A0,0x0000,0x0000, 0x14A1,0x0000,0x0000, +0x14A2,0x0000,0x0000, 0x14A3,0x0000,0x0000, 0x14A4,0x0000,0x0000, +0x14A5,0x0000,0x0000, 0x14A6,0x0000,0x0000, 0x14A7,0x0000,0x0000, +0x14A8,0x0000,0x0000, 0x14A9,0x0000,0x0000, 0x14AA,0x0000,0x0000, +0x14AB,0x0000,0x0000, 0x14AC,0x0000,0x0000, 0x14AD,0x0000,0x0000, +0x14AE,0x0000,0x0000, 0x14AF,0x0000,0x0000, 0x14B0,0x0000,0x0000, +0x14B1,0x0000,0x0000, 0x14B2,0x0000,0x0000, 0x14B3,0x0000,0x0000, +0x14B4,0x0000,0x0000, 0x14B5,0x0000,0x0000, 0x14B6,0x0000,0x0000, +0x14B7,0x0000,0x0000, 0x14B8,0x0000,0x0000, 0x14B9,0x0000,0x0000, +0x14BA,0x0000,0x0000, 0x14BB,0x0000,0x0000, 0x14BC,0x0000,0x0000, +0x14BD,0x0000,0x0000, 0xFBC0,0x92AF,0x0000, 0x14BE,0x0000,0x0000, +0xFBC0,0x92B1,0x0000, 0x14BF,0x0000,0x0000, 0x14C0,0x0000,0x0000, +0x14C1,0x0000,0x0000, 0x14C2,0x0000,0x0000, 0xFBC0,0x92B6,0x0000, +0xFBC0,0x92B7,0x0000, 0x14C3,0x0000,0x0000, 0x14C4,0x0000,0x0000, +0x14C5,0x0000,0x0000, 0x14C6,0x0000,0x0000, 0x14C7,0x0000,0x0000, +0x14C8,0x0000,0x0000, 0x14C9,0x0000,0x0000, 0xFBC0,0x92BF,0x0000, +0x14CA,0x0000,0x0000, 0xFBC0,0x92C1,0x0000, 0x14CB,0x0000,0x0000, +0x14CC,0x0000,0x0000, 0x14CD,0x0000,0x0000, 0x14CE,0x0000,0x0000, +0xFBC0,0x92C6,0x0000, 0xFBC0,0x92C7,0x0000, 0x14CF,0x0000,0x0000, +0x14D0,0x0000,0x0000, 0x14D1,0x0000,0x0000, 0x14D2,0x0000,0x0000, +0x14D3,0x0000,0x0000, 0x14D4,0x0000,0x0000, 0x14D5,0x0000,0x0000, +0xFBC0,0x92CF,0x0000, 0x14D6,0x0000,0x0000, 0x14D7,0x0000,0x0000, +0x14D8,0x0000,0x0000, 0x14D9,0x0000,0x0000, 0x14DA,0x0000,0x0000, +0x14DB,0x0000,0x0000, 0x14DC,0x0000,0x0000, 0xFBC0,0x92D7,0x0000, +0x14DD,0x0000,0x0000, 0x14DE,0x0000,0x0000, 0x14DF,0x0000,0x0000, +0x14E0,0x0000,0x0000, 0x14E1,0x0000,0x0000, 0x14E2,0x0000,0x0000, +0x14E3,0x0000,0x0000, 0x14E4,0x0000,0x0000, 0x14E5,0x0000,0x0000, +0x14E6,0x0000,0x0000, 0x14E7,0x0000,0x0000, 0x14E8,0x0000,0x0000, +0x14E9,0x0000,0x0000, 0x14EA,0x0000,0x0000, 0x14EB,0x0000,0x0000, +0x14EC,0x0000,0x0000, 0x14ED,0x0000,0x0000, 0x14EE,0x0000,0x0000, +0x14EF,0x0000,0x0000, 0x14F0,0x0000,0x0000, 0x14F1,0x0000,0x0000, +0x14F2,0x0000,0x0000, 0x14F3,0x0000,0x0000, 0xFBC0,0x92EF,0x0000, +0x14F4,0x0000,0x0000, 0x14F5,0x0000,0x0000, 0x14F6,0x0000,0x0000, +0x14F7,0x0000,0x0000, 0x14F8,0x0000,0x0000, 0x14F9,0x0000,0x0000, +0x14FA,0x0000,0x0000, 0x14FB,0x0000,0x0000, 0x14FC,0x0000,0x0000, +0x14FD,0x0000,0x0000, 0x14FE,0x0000,0x0000, 0x14FF,0x0000,0x0000, +0x1500,0x0000,0x0000, 0x1501,0x0000,0x0000, 0x1502,0x0000,0x0000, +0x1503,0x0000,0x0000 }; + +uint16 page013data[]= { /* 1300 (3 weights per char) */ +0x1504,0x0000,0x0000, 0x1505,0x0000,0x0000, 0x1506,0x0000,0x0000, +0x1507,0x0000,0x0000, 0x1508,0x0000,0x0000, 0x1509,0x0000,0x0000, +0x150A,0x0000,0x0000, 0x150B,0x0000,0x0000, 0x150C,0x0000,0x0000, +0x150D,0x0000,0x0000, 0x150E,0x0000,0x0000, 0x150F,0x0000,0x0000, +0x1510,0x0000,0x0000, 0x1511,0x0000,0x0000, 0x1512,0x0000,0x0000, +0xFBC0,0x930F,0x0000, 0x1513,0x0000,0x0000, 0xFBC0,0x9311,0x0000, +0x1514,0x0000,0x0000, 0x1515,0x0000,0x0000, 0x1516,0x0000,0x0000, +0x1517,0x0000,0x0000, 0xFBC0,0x9316,0x0000, 0xFBC0,0x9317,0x0000, +0x1518,0x0000,0x0000, 0x1519,0x0000,0x0000, 0x151A,0x0000,0x0000, +0x151B,0x0000,0x0000, 0x151C,0x0000,0x0000, 0x151D,0x0000,0x0000, +0x151E,0x0000,0x0000, 0xFBC0,0x931F,0x0000, 0x151F,0x0000,0x0000, +0x1520,0x0000,0x0000, 0x1521,0x0000,0x0000, 0x1522,0x0000,0x0000, +0x1523,0x0000,0x0000, 0x1524,0x0000,0x0000, 0x1525,0x0000,0x0000, +0x1526,0x0000,0x0000, 0x1527,0x0000,0x0000, 0x1528,0x0000,0x0000, +0x1529,0x0000,0x0000, 0x152A,0x0000,0x0000, 0x152B,0x0000,0x0000, +0x152C,0x0000,0x0000, 0x152D,0x0000,0x0000, 0x152E,0x0000,0x0000, +0x152F,0x0000,0x0000, 0x1530,0x0000,0x0000, 0x1531,0x0000,0x0000, +0x1532,0x0000,0x0000, 0x1533,0x0000,0x0000, 0x1534,0x0000,0x0000, +0x1535,0x0000,0x0000, 0x1536,0x0000,0x0000, 0x1537,0x0000,0x0000, +0x1538,0x0000,0x0000, 0x1539,0x0000,0x0000, 0x153A,0x0000,0x0000, +0x153B,0x0000,0x0000, 0x153C,0x0000,0x0000, 0x153D,0x0000,0x0000, +0x153E,0x0000,0x0000, 0x153F,0x0000,0x0000, 0x1540,0x0000,0x0000, +0x1541,0x0000,0x0000, 0x1542,0x0000,0x0000, 0x1543,0x0000,0x0000, +0x1544,0x0000,0x0000, 0x1545,0x0000,0x0000, 0xFBC0,0x9347,0x0000, +0x1546,0x0000,0x0000, 0x1547,0x0000,0x0000, 0x1548,0x0000,0x0000, +0x1549,0x0000,0x0000, 0x154A,0x0000,0x0000, 0x154B,0x0000,0x0000, +0x154C,0x0000,0x0000, 0x154D,0x0000,0x0000, 0x154E,0x0000,0x0000, +0x154F,0x0000,0x0000, 0x1550,0x0000,0x0000, 0x1551,0x0000,0x0000, +0x1552,0x0000,0x0000, 0x1553,0x0000,0x0000, 0x1554,0x0000,0x0000, +0x1555,0x0000,0x0000, 0x1556,0x0000,0x0000, 0x1557,0x0000,0x0000, +0x1558,0x0000,0x0000, 0xFBC0,0x935B,0x0000, 0xFBC0,0x935C,0x0000, +0xFBC0,0x935D,0x0000, 0xFBC0,0x935E,0x0000, 0xFBC0,0x935F,0x0000, +0xFBC0,0x9360,0x0000, 0x0245,0x0000,0x0000, 0x0262,0x0000,0x0000, +0x0246,0x0000,0x0000, 0x0247,0x0000,0x0000, 0x0248,0x0000,0x0000, +0x0249,0x0000,0x0000, 0x025A,0x0000,0x0000, 0x0272,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x0DCC,0x0000,0x0000, 0x0DCD,0x0000,0x0000, 0x0DCE,0x0000,0x0000, +0x0DCF,0x0000,0x0000, 0x0DD0,0x0000,0x0000, 0x0DD1,0x0000,0x0000, +0x0DD2,0x0000,0x0000, 0x0DD3,0x0000,0x0000, 0x0DD4,0x0000,0x0000, +0x0DD5,0x0000,0x0000, 0x0DD6,0x0000,0x0000, 0xFBC0,0x937D,0x0000, +0xFBC0,0x937E,0x0000, 0xFBC0,0x937F,0x0000, 0xFBC0,0x9380,0x0000, +0xFBC0,0x9381,0x0000, 0xFBC0,0x9382,0x0000, 0xFBC0,0x9383,0x0000, +0xFBC0,0x9384,0x0000, 0xFBC0,0x9385,0x0000, 0xFBC0,0x9386,0x0000, +0xFBC0,0x9387,0x0000, 0xFBC0,0x9388,0x0000, 0xFBC0,0x9389,0x0000, +0xFBC0,0x938A,0x0000, 0xFBC0,0x938B,0x0000, 0xFBC0,0x938C,0x0000, +0xFBC0,0x938D,0x0000, 0xFBC0,0x938E,0x0000, 0xFBC0,0x938F,0x0000, +0xFBC0,0x9390,0x0000, 0xFBC0,0x9391,0x0000, 0xFBC0,0x9392,0x0000, +0xFBC0,0x9393,0x0000, 0xFBC0,0x9394,0x0000, 0xFBC0,0x9395,0x0000, +0xFBC0,0x9396,0x0000, 0xFBC0,0x9397,0x0000, 0xFBC0,0x9398,0x0000, +0xFBC0,0x9399,0x0000, 0xFBC0,0x939A,0x0000, 0xFBC0,0x939B,0x0000, +0xFBC0,0x939C,0x0000, 0xFBC0,0x939D,0x0000, 0xFBC0,0x939E,0x0000, +0xFBC0,0x939F,0x0000, 0x1A59,0x0000,0x0000, 0x1A5A,0x0000,0x0000, +0x1A5B,0x0000,0x0000, 0x1A5C,0x0000,0x0000, 0x1A5D,0x0000,0x0000, +0x1A5E,0x0000,0x0000, 0x1A5F,0x0000,0x0000, 0x1A60,0x0000,0x0000, +0x1A61,0x0000,0x0000, 0x1A62,0x0000,0x0000, 0x1A63,0x0000,0x0000, +0x1A64,0x0000,0x0000, 0x1A65,0x0000,0x0000, 0x1A66,0x0000,0x0000, +0x1A67,0x0000,0x0000, 0x1A68,0x0000,0x0000, 0x1A69,0x0000,0x0000, +0x1A6A,0x0000,0x0000, 0x1A6B,0x0000,0x0000, 0x1A6C,0x0000,0x0000, +0x1A6D,0x0000,0x0000, 0x1A6E,0x0000,0x0000, 0x1A6F,0x0000,0x0000, +0x1A70,0x0000,0x0000, 0x1A71,0x0000,0x0000, 0x1A72,0x0000,0x0000, +0x1A73,0x0000,0x0000, 0x1A74,0x0000,0x0000, 0x1A75,0x0000,0x0000, +0x1A76,0x0000,0x0000, 0x1A77,0x0000,0x0000, 0x1A78,0x0000,0x0000, +0x1A79,0x0000,0x0000, 0x1A7A,0x0000,0x0000, 0x1A7B,0x0000,0x0000, +0x1A7C,0x0000,0x0000, 0x1A7D,0x0000,0x0000, 0x1A7E,0x0000,0x0000, +0x1A7F,0x0000,0x0000, 0x1A80,0x0000,0x0000, 0x1A81,0x0000,0x0000, +0x1A82,0x0000,0x0000, 0x1A83,0x0000,0x0000, 0x1A84,0x0000,0x0000, +0x1A85,0x0000,0x0000, 0x1A86,0x0000,0x0000, 0x1A87,0x0000,0x0000, +0x1A88,0x0000,0x0000, 0x1A89,0x0000,0x0000, 0x1A8A,0x0000,0x0000, +0x1A8B,0x0000,0x0000, 0x1A8C,0x0000,0x0000, 0x1A8D,0x0000,0x0000, +0x1A8E,0x0000,0x0000, 0x1A8F,0x0000,0x0000, 0x1A90,0x0000,0x0000, +0x1A91,0x0000,0x0000, 0x1A92,0x0000,0x0000, 0x1A93,0x0000,0x0000, +0x1A94,0x0000,0x0000, 0x1A95,0x0000,0x0000, 0x1A96,0x0000,0x0000, +0x1A97,0x0000,0x0000, 0x1A98,0x0000,0x0000, 0x1A99,0x0000,0x0000, +0x1A9A,0x0000,0x0000, 0x1A9B,0x0000,0x0000, 0x1A9C,0x0000,0x0000, +0x1A9D,0x0000,0x0000, 0x1A9E,0x0000,0x0000, 0x1A9F,0x0000,0x0000, +0x1AA0,0x0000,0x0000, 0x1AA1,0x0000,0x0000, 0x1AA2,0x0000,0x0000, +0x1AA3,0x0000,0x0000, 0x1AA4,0x0000,0x0000, 0x1AA5,0x0000,0x0000, +0x1AA6,0x0000,0x0000, 0x1AA7,0x0000,0x0000, 0x1AA8,0x0000,0x0000, +0x1AA9,0x0000,0x0000, 0x1AAA,0x0000,0x0000, 0x1AAB,0x0000,0x0000, +0x1AAC,0x0000,0x0000, 0x1AAD,0x0000,0x0000, 0xFBC0,0x93F5,0x0000, +0xFBC0,0x93F6,0x0000, 0xFBC0,0x93F7,0x0000, 0xFBC0,0x93F8,0x0000, +0xFBC0,0x93F9,0x0000, 0xFBC0,0x93FA,0x0000, 0xFBC0,0x93FB,0x0000, +0xFBC0,0x93FC,0x0000, 0xFBC0,0x93FD,0x0000, 0xFBC0,0x93FE,0x0000, +0xFBC0,0x93FF,0x0000 }; + +uint16 page014data[]= { /* 1400 (3 weights per char) */ +0xFBC0,0x9400,0x0000, 0x1AAE,0x0000,0x0000, 0x1AAF,0x0000,0x0000, +0x1AB0,0x0000,0x0000, 0x1AB1,0x0000,0x0000, 0x1AB2,0x0000,0x0000, +0x1AB3,0x0000,0x0000, 0x1AB4,0x0000,0x0000, 0x1AB5,0x0000,0x0000, +0x1AB6,0x0000,0x0000, 0x1AB7,0x0000,0x0000, 0x1AB8,0x0000,0x0000, +0x1AB9,0x0000,0x0000, 0x1ABA,0x0000,0x0000, 0x1ABB,0x0000,0x0000, +0x1ABC,0x0000,0x0000, 0x1ABD,0x0000,0x0000, 0x1ABE,0x0000,0x0000, +0x1ABF,0x0000,0x0000, 0x1AC0,0x0000,0x0000, 0x1AC1,0x0000,0x0000, +0x1AC2,0x0000,0x0000, 0x1AC3,0x0000,0x0000, 0x1AC4,0x0000,0x0000, +0x1AC5,0x0000,0x0000, 0x1AC6,0x0000,0x0000, 0x1AC7,0x0000,0x0000, +0x1AC8,0x0000,0x0000, 0x1AC9,0x0000,0x0000, 0x1ACA,0x0000,0x0000, +0x1ACB,0x0000,0x0000, 0x1ACC,0x0000,0x0000, 0x1ACD,0x0000,0x0000, +0x1ACE,0x0000,0x0000, 0x1ACF,0x0000,0x0000, 0x1AD0,0x0000,0x0000, +0x1AD1,0x0000,0x0000, 0x1AD2,0x0000,0x0000, 0x1AD3,0x0000,0x0000, +0x1AD4,0x0000,0x0000, 0x1AD5,0x0000,0x0000, 0x1AD6,0x0000,0x0000, +0x1AD7,0x0000,0x0000, 0x1AD8,0x0000,0x0000, 0x1AD9,0x0000,0x0000, +0x1ADA,0x0000,0x0000, 0x1ADB,0x0000,0x0000, 0x1ADC,0x0000,0x0000, +0x1ADD,0x0000,0x0000, 0x1ADE,0x0000,0x0000, 0x1ADF,0x0000,0x0000, +0x1AE0,0x0000,0x0000, 0x1AE1,0x0000,0x0000, 0x1AE2,0x0000,0x0000, +0x1AE3,0x0000,0x0000, 0x1AE4,0x0000,0x0000, 0x1AE5,0x0000,0x0000, +0x1AE6,0x0000,0x0000, 0x1AE7,0x0000,0x0000, 0x1AE8,0x0000,0x0000, +0x1AE9,0x0000,0x0000, 0x1AEA,0x0000,0x0000, 0x1AEB,0x0000,0x0000, +0x1AEC,0x0000,0x0000, 0x1AED,0x0000,0x0000, 0x1AEE,0x0000,0x0000, +0x1AEF,0x0000,0x0000, 0x1AF0,0x0000,0x0000, 0x1AF1,0x0000,0x0000, +0x1AF2,0x0000,0x0000, 0x1AF3,0x0000,0x0000, 0x1AF4,0x0000,0x0000, +0x1AF5,0x0000,0x0000, 0x1AF6,0x0000,0x0000, 0x1AF7,0x0000,0x0000, +0x1AF8,0x0000,0x0000, 0x1AF9,0x0000,0x0000, 0x1AFA,0x0000,0x0000, +0x1AFB,0x0000,0x0000, 0x1AFC,0x0000,0x0000, 0x1AFD,0x0000,0x0000, +0x1AFE,0x0000,0x0000, 0x1AFF,0x0000,0x0000, 0x1B00,0x0000,0x0000, +0x1B01,0x0000,0x0000, 0x1B02,0x0000,0x0000, 0x1B03,0x0000,0x0000, +0x1B04,0x0000,0x0000, 0x1B05,0x0000,0x0000, 0x1B06,0x0000,0x0000, +0x1B07,0x0000,0x0000, 0x1B08,0x0000,0x0000, 0x1B09,0x0000,0x0000, +0x1B0A,0x0000,0x0000, 0x1B0B,0x0000,0x0000, 0x1B0C,0x0000,0x0000, +0x1B0D,0x0000,0x0000, 0x1B0E,0x0000,0x0000, 0x1B0F,0x0000,0x0000, +0x1B10,0x0000,0x0000, 0x1B11,0x0000,0x0000, 0x1B12,0x0000,0x0000, +0x1B13,0x0000,0x0000, 0x1B14,0x0000,0x0000, 0x1B15,0x0000,0x0000, +0x1B16,0x0000,0x0000, 0x1B17,0x0000,0x0000, 0x1B18,0x0000,0x0000, +0x1B19,0x0000,0x0000, 0x1B1A,0x0000,0x0000, 0x1B1B,0x0000,0x0000, +0x1B1C,0x0000,0x0000, 0x1B1D,0x0000,0x0000, 0x1B1E,0x0000,0x0000, +0x1B1F,0x0000,0x0000, 0x1B20,0x0000,0x0000, 0x1B21,0x0000,0x0000, +0x1B22,0x0000,0x0000, 0x1B23,0x0000,0x0000, 0x1B24,0x0000,0x0000, +0x1B25,0x0000,0x0000, 0x1B26,0x0000,0x0000, 0x1B27,0x0000,0x0000, +0x1B28,0x0000,0x0000, 0x1B29,0x0000,0x0000, 0x1B2A,0x0000,0x0000, +0x1B2B,0x0000,0x0000, 0x1B2C,0x0000,0x0000, 0x1B2D,0x0000,0x0000, +0x1B2E,0x0000,0x0000, 0x1B2F,0x0000,0x0000, 0x1B30,0x0000,0x0000, +0x1B31,0x0000,0x0000, 0x1B32,0x0000,0x0000, 0x1B33,0x0000,0x0000, +0x1B34,0x0000,0x0000, 0x1B35,0x0000,0x0000, 0x1B36,0x0000,0x0000, +0x1B37,0x0000,0x0000, 0x1B38,0x0000,0x0000, 0x1B39,0x0000,0x0000, +0x1B3A,0x0000,0x0000, 0x1B3B,0x0000,0x0000, 0x1B3C,0x0000,0x0000, +0x1B3D,0x0000,0x0000, 0x1B3E,0x0000,0x0000, 0x1B3F,0x0000,0x0000, +0x1B40,0x0000,0x0000, 0x1B41,0x0000,0x0000, 0x1B42,0x0000,0x0000, +0x1B43,0x0000,0x0000, 0x1B44,0x0000,0x0000, 0x1B45,0x0000,0x0000, +0x1B46,0x0000,0x0000, 0x1B47,0x0000,0x0000, 0x1B48,0x0000,0x0000, +0x1B49,0x0000,0x0000, 0x1B4A,0x0000,0x0000, 0x1B4B,0x0000,0x0000, +0x1B4C,0x0000,0x0000, 0x1B4D,0x0000,0x0000, 0x1B4E,0x0000,0x0000, +0x1B4F,0x0000,0x0000, 0x1B50,0x0000,0x0000, 0x1B51,0x0000,0x0000, +0x1B52,0x0000,0x0000, 0x1B53,0x0000,0x0000, 0x1B54,0x0000,0x0000, +0x1B55,0x0000,0x0000, 0x1B56,0x0000,0x0000, 0x1B57,0x0000,0x0000, +0x1B58,0x0000,0x0000, 0x1B59,0x0000,0x0000, 0x1B5A,0x0000,0x0000, +0x1B5B,0x0000,0x0000, 0x1B5C,0x0000,0x0000, 0x1B5D,0x0000,0x0000, +0x1B5E,0x0000,0x0000, 0x1B5F,0x0000,0x0000, 0x1B60,0x0000,0x0000, +0x1B61,0x0000,0x0000, 0x1B62,0x0000,0x0000, 0x1B63,0x0000,0x0000, +0x1B64,0x0000,0x0000, 0x1B65,0x0000,0x0000, 0x1B66,0x0000,0x0000, +0x1B67,0x0000,0x0000, 0x1B68,0x0000,0x0000, 0x1B69,0x0000,0x0000, +0x1B6A,0x0000,0x0000, 0x1B6B,0x0000,0x0000, 0x1B6C,0x0000,0x0000, +0x1B6D,0x0000,0x0000, 0x1B6E,0x0000,0x0000, 0x1B6F,0x0000,0x0000, +0x1B70,0x0000,0x0000, 0x1B71,0x0000,0x0000, 0x1B72,0x0000,0x0000, +0x1B73,0x0000,0x0000, 0x1B74,0x0000,0x0000, 0x1B75,0x0000,0x0000, +0x1B76,0x0000,0x0000, 0x1B77,0x0000,0x0000, 0x1B78,0x0000,0x0000, +0x1B79,0x0000,0x0000, 0x1B7A,0x0000,0x0000, 0x1B7B,0x0000,0x0000, +0x1B7C,0x0000,0x0000, 0x1B7D,0x0000,0x0000, 0x1B7E,0x0000,0x0000, +0x1B7F,0x0000,0x0000, 0x1B80,0x0000,0x0000, 0x1B81,0x0000,0x0000, +0x1B82,0x0000,0x0000, 0x1B83,0x0000,0x0000, 0x1B84,0x0000,0x0000, +0x1B85,0x0000,0x0000, 0x1B86,0x0000,0x0000, 0x1B87,0x0000,0x0000, +0x1B88,0x0000,0x0000, 0x1B89,0x0000,0x0000, 0x1B8A,0x0000,0x0000, +0x1B8B,0x0000,0x0000, 0x1B8C,0x0000,0x0000, 0x1B8D,0x0000,0x0000, +0x1B8E,0x0000,0x0000, 0x1B8F,0x0000,0x0000, 0x1B90,0x0000,0x0000, +0x1B91,0x0000,0x0000, 0x1B92,0x0000,0x0000, 0x1B93,0x0000,0x0000, +0x1B94,0x0000,0x0000, 0x1B95,0x0000,0x0000, 0x1B96,0x0000,0x0000, +0x1B97,0x0000,0x0000, 0x1B98,0x0000,0x0000, 0x1B99,0x0000,0x0000, +0x1B9A,0x0000,0x0000, 0x1B9B,0x0000,0x0000, 0x1B9C,0x0000,0x0000, +0x1B9D,0x0000,0x0000, 0x1B9E,0x0000,0x0000, 0x1B9F,0x0000,0x0000, +0x1BA0,0x0000,0x0000, 0x1BA1,0x0000,0x0000, 0x1BA2,0x0000,0x0000, +0x1BA3,0x0000,0x0000, 0x1BA4,0x0000,0x0000, 0x1BA5,0x0000,0x0000, +0x1BA6,0x0000,0x0000, 0x1BA7,0x0000,0x0000, 0x1BA8,0x0000,0x0000, +0x1BA9,0x0000,0x0000, 0x1BAA,0x0000,0x0000, 0x1BAB,0x0000,0x0000, +0x1BAC,0x0000,0x0000 }; + +uint16 page015data[]= { /* 1500 (2 weights per char) */ +0x1BAD,0x0000, 0x1BAE,0x0000, 0x1BAF,0x0000, 0x1BB0,0x0000, +0x1BB1,0x0000, 0x1BB2,0x0000, 0x1BB3,0x0000, 0x1BB4,0x0000, +0x1BB5,0x0000, 0x1BB6,0x0000, 0x1BB7,0x0000, 0x1BB8,0x0000, +0x1BB9,0x0000, 0x1BBA,0x0000, 0x1BBB,0x0000, 0x1BBC,0x0000, +0x1BBD,0x0000, 0x1BBE,0x0000, 0x1BBF,0x0000, 0x1BC0,0x0000, +0x1BC1,0x0000, 0x1BC2,0x0000, 0x1BC3,0x0000, 0x1BC4,0x0000, +0x1BC5,0x0000, 0x1BC6,0x0000, 0x1BC7,0x0000, 0x1BC8,0x0000, +0x1BC9,0x0000, 0x1BCA,0x0000, 0x1BCB,0x0000, 0x1BCC,0x0000, +0x1BCD,0x0000, 0x1BCE,0x0000, 0x1BCF,0x0000, 0x1BD0,0x0000, +0x1BD1,0x0000, 0x1BD2,0x0000, 0x1BD3,0x0000, 0x1BD4,0x0000, +0x1BD5,0x0000, 0x1BD6,0x0000, 0x1BD7,0x0000, 0x1BD8,0x0000, +0x1BD9,0x0000, 0x1BDA,0x0000, 0x1BDB,0x0000, 0x1BDC,0x0000, +0x1BDD,0x0000, 0x1BDE,0x0000, 0x1BDF,0x0000, 0x1BE0,0x0000, +0x1BE1,0x0000, 0x1BE2,0x0000, 0x1BE3,0x0000, 0x1BE4,0x0000, +0x1BE5,0x0000, 0x1BE6,0x0000, 0x1BE7,0x0000, 0x1BE8,0x0000, +0x1BE9,0x0000, 0x1BEA,0x0000, 0x1BEB,0x0000, 0x1BEC,0x0000, +0x1BED,0x0000, 0x1BEE,0x0000, 0x1BEF,0x0000, 0x1BF0,0x0000, +0x1BF1,0x0000, 0x1BF2,0x0000, 0x1BF3,0x0000, 0x1BF4,0x0000, +0x1BF5,0x0000, 0x1BF6,0x0000, 0x1BF7,0x0000, 0x1BF8,0x0000, +0x1BF9,0x0000, 0x1BFA,0x0000, 0x1BFB,0x0000, 0x1BFC,0x0000, +0x1BFD,0x0000, 0x1BFE,0x0000, 0x1BFF,0x0000, 0x1C00,0x0000, +0x1C01,0x0000, 0x1C02,0x0000, 0x1C03,0x0000, 0x1C04,0x0000, +0x1C05,0x0000, 0x1C06,0x0000, 0x1C07,0x0000, 0x1C08,0x0000, +0x1C09,0x0000, 0x1C0A,0x0000, 0x1C0B,0x0000, 0x1C0C,0x0000, +0x1C0D,0x0000, 0x1C0E,0x0000, 0x1C0F,0x0000, 0x1C10,0x0000, +0x1C11,0x0000, 0x1C12,0x0000, 0x1C13,0x0000, 0x1C14,0x0000, +0x1C15,0x0000, 0x1C16,0x0000, 0x1C17,0x0000, 0x1C18,0x0000, +0x1C19,0x0000, 0x1C1A,0x0000, 0x1C1B,0x0000, 0x1C1C,0x0000, +0x1C1D,0x0000, 0x1C1E,0x0000, 0x1C1F,0x0000, 0x1C20,0x0000, +0x1C21,0x0000, 0x1C22,0x0000, 0x1C23,0x0000, 0x1C24,0x0000, +0x1C25,0x0000, 0x1C26,0x0000, 0x1C27,0x0000, 0x1C28,0x0000, +0x1C5B,0x0000, 0x1C29,0x0000, 0x1C2B,0x0000, 0x1C2C,0x0000, +0x1C2D,0x0000, 0x1C2E,0x0000, 0x1C2F,0x0000, 0x1C30,0x0000, +0x1C31,0x0000, 0x1C32,0x0000, 0x1C33,0x0000, 0x1C34,0x0000, +0x1C35,0x0000, 0x1C36,0x0000, 0x1C37,0x0000, 0x1C38,0x0000, +0x1C39,0x0000, 0x1C3A,0x0000, 0x1C3C,0x0000, 0x1C3D,0x0000, +0x1C3E,0x0000, 0x1C3F,0x0000, 0x1C40,0x0000, 0x1C41,0x0000, +0x1C42,0x0000, 0x1C43,0x0000, 0x1C4A,0x0000, 0x1C4B,0x0000, +0x1C4C,0x0000, 0x1C4D,0x0000, 0x1C4E,0x0000, 0x1C4F,0x0000, +0x1C50,0x0000, 0x1C51,0x0000, 0x1C52,0x0000, 0x1C53,0x0000, +0x1C54,0x0000, 0x1C55,0x0000, 0x1C56,0x0000, 0x1C57,0x0000, +0x1C58,0x0000, 0x1C59,0x0000, 0x1C5A,0x0000, 0x1C5C,0x0000, +0x1C5D,0x0000, 0x1C5E,0x0000, 0x1C5F,0x0000, 0x1C60,0x0000, +0x1C61,0x0000, 0x1C62,0x0000, 0x1C63,0x0000, 0x1C64,0x0000, +0x1C65,0x0000, 0x1C66,0x0000, 0x1C67,0x0000, 0x1C68,0x0000, +0x1C69,0x0000, 0x1C6A,0x0000, 0x1C6B,0x0000, 0x1C6C,0x0000, +0x1C6D,0x0000, 0x1C6E,0x0000, 0x1C6F,0x0000, 0x1C70,0x0000, +0x1C71,0x0000, 0x1C72,0x0000, 0x1C73,0x0000, 0x1C74,0x0000, +0x1C75,0x0000, 0x1C76,0x0000, 0x1C77,0x0000, 0x1C78,0x0000, +0x1C79,0x0000, 0x1C7A,0x0000, 0x1C7B,0x0000, 0x1C7C,0x0000, +0x1C7D,0x0000, 0x1C7E,0x0000, 0x1C7F,0x0000, 0x1C80,0x0000, +0x1C81,0x0000, 0x1C82,0x0000, 0x1C83,0x0000, 0x1C84,0x0000, +0x1C85,0x0000, 0x1C86,0x0000, 0x1C87,0x0000, 0x1C88,0x0000, +0x1C89,0x0000, 0x1C8A,0x0000, 0x1C8B,0x0000, 0x1C8C,0x0000, +0x1C8D,0x0000, 0x1C8E,0x0000, 0x1C8F,0x0000, 0x1C90,0x0000, +0x1C91,0x0000, 0x1C92,0x0000, 0x1C93,0x0000, 0x1C94,0x0000, +0x1C95,0x0000, 0x1C96,0x0000, 0x1C97,0x0000, 0x1C98,0x0000, +0x1C99,0x0000, 0x1C9A,0x0000, 0x1C9B,0x0000, 0x1C9C,0x0000, +0x1C9D,0x0000, 0x1C9E,0x0000, 0x1C9F,0x0000, 0x1CA0,0x0000, +0x1CA1,0x0000, 0x1CA2,0x0000, 0x1CA3,0x0000, 0x1CA4,0x0000, +0x1CA5,0x0000, 0x1CA6,0x0000, 0x1CA7,0x0000, 0x1CA8,0x0000, +0x1CA9,0x0000, 0x1CAA,0x0000, 0x1CAB,0x0000, 0x1CAC,0x0000, +0x1CAD,0x0000, 0x1CAE,0x0000, 0x1CAF,0x0000, 0x1CB0,0x0000, +0x1CB1,0x0000, 0x1CB2,0x0000, 0x1CB3,0x0000, 0x1CB4,0x0000 +}; + +uint16 page016data[]= { /* 1600 (3 weights per char) */ +0x1CB5,0x0000,0x0000, 0x1CB6,0x0000,0x0000, 0x1CB7,0x0000,0x0000, +0x1CB8,0x0000,0x0000, 0x1CB9,0x0000,0x0000, 0x1CBA,0x0000,0x0000, +0x1CBB,0x0000,0x0000, 0x1CBC,0x0000,0x0000, 0x1CBD,0x0000,0x0000, +0x1CBE,0x0000,0x0000, 0x1CBF,0x0000,0x0000, 0x1CC0,0x0000,0x0000, +0x1CC1,0x0000,0x0000, 0x1CC2,0x0000,0x0000, 0x1CC3,0x0000,0x0000, +0x1CC4,0x0000,0x0000, 0x1CC5,0x0000,0x0000, 0x1CC6,0x0000,0x0000, +0x1CC7,0x0000,0x0000, 0x1CC8,0x0000,0x0000, 0x1CC9,0x0000,0x0000, +0x1CCA,0x0000,0x0000, 0x1CCB,0x0000,0x0000, 0x1CCC,0x0000,0x0000, +0x1CCD,0x0000,0x0000, 0x1CCE,0x0000,0x0000, 0x1CCF,0x0000,0x0000, +0x1CD0,0x0000,0x0000, 0x1CD1,0x0000,0x0000, 0x1CD2,0x0000,0x0000, +0x1CD3,0x0000,0x0000, 0x1CD4,0x0000,0x0000, 0x1CD5,0x0000,0x0000, +0x1CD6,0x0000,0x0000, 0x1CD7,0x0000,0x0000, 0x1CD8,0x0000,0x0000, +0x1CD9,0x0000,0x0000, 0x1CDA,0x0000,0x0000, 0x1CDB,0x0000,0x0000, +0x1CDC,0x0000,0x0000, 0x1CDD,0x0000,0x0000, 0x1CDE,0x0000,0x0000, +0x1CDF,0x0000,0x0000, 0x1CE0,0x0000,0x0000, 0x1CE1,0x0000,0x0000, +0x1CE2,0x0000,0x0000, 0x1CE3,0x0000,0x0000, 0x1CE4,0x0000,0x0000, +0x1CE5,0x0000,0x0000, 0x1CE6,0x0000,0x0000, 0x1CE7,0x0000,0x0000, +0x1CE8,0x0000,0x0000, 0x1CE9,0x0000,0x0000, 0x1CEA,0x0000,0x0000, +0x1CEB,0x0000,0x0000, 0x1CEC,0x0000,0x0000, 0x1CED,0x0000,0x0000, +0x1CEE,0x0000,0x0000, 0x1CEF,0x0000,0x0000, 0x1CF0,0x0000,0x0000, +0x1CF1,0x0000,0x0000, 0x1CF2,0x0000,0x0000, 0x1CF3,0x0000,0x0000, +0x1CF4,0x0000,0x0000, 0x1CF5,0x0000,0x0000, 0x1CF6,0x0000,0x0000, +0x1CF7,0x0000,0x0000, 0x1CF8,0x0000,0x0000, 0x1CF9,0x0000,0x0000, +0x1CFA,0x0000,0x0000, 0x1CFB,0x0000,0x0000, 0x1CFC,0x0000,0x0000, +0x1CFD,0x0000,0x0000, 0x1CFE,0x0000,0x0000, 0x1CFF,0x0000,0x0000, +0x1D00,0x0000,0x0000, 0x1D01,0x0000,0x0000, 0x1D02,0x0000,0x0000, +0x1D03,0x0000,0x0000, 0x1D04,0x0000,0x0000, 0x1D05,0x0000,0x0000, +0x1D06,0x0000,0x0000, 0x1D07,0x0000,0x0000, 0x1D08,0x0000,0x0000, +0x1D09,0x0000,0x0000, 0x1D0A,0x0000,0x0000, 0x1D0B,0x0000,0x0000, +0x1D0C,0x0000,0x0000, 0x1D0D,0x0000,0x0000, 0x1D0E,0x0000,0x0000, +0x1D0F,0x0000,0x0000, 0x1D10,0x0000,0x0000, 0x1D11,0x0000,0x0000, +0x1D12,0x0000,0x0000, 0x1D13,0x0000,0x0000, 0x1D14,0x0000,0x0000, +0x1D15,0x0000,0x0000, 0x1D16,0x0000,0x0000, 0x1D17,0x0000,0x0000, +0x1D18,0x0000,0x0000, 0x1D19,0x0000,0x0000, 0x1D1A,0x0000,0x0000, +0x1D1B,0x0000,0x0000, 0x1D1C,0x0000,0x0000, 0x1D1D,0x0000,0x0000, +0x1D1E,0x0000,0x0000, 0x1D1F,0x0000,0x0000, 0x1D20,0x0000,0x0000, +0x1D21,0x0000,0x0000, 0x0316,0x0000,0x0000, 0x0265,0x0000,0x0000, +0x1C2A,0x0000,0x0000, 0x1C3B,0x0000,0x0000, 0x1C44,0x0000,0x0000, +0x1C45,0x0000,0x0000, 0x1C46,0x0000,0x0000, 0x1C47,0x0000,0x0000, +0x1C48,0x0000,0x0000, 0x1C49,0x0000,0x0000, 0xFBC0,0x9677,0x0000, +0xFBC0,0x9678,0x0000, 0xFBC0,0x9679,0x0000, 0xFBC0,0x967A,0x0000, +0xFBC0,0x967B,0x0000, 0xFBC0,0x967C,0x0000, 0xFBC0,0x967D,0x0000, +0xFBC0,0x967E,0x0000, 0xFBC0,0x967F,0x0000, 0x020A,0x0000,0x0000, +0x1D22,0x0000,0x0000, 0x1D23,0x0000,0x0000, 0x1D24,0x0000,0x0000, +0x1D25,0x0000,0x0000, 0x1D26,0x0000,0x0000, 0x1D27,0x0000,0x0000, +0x1D28,0x0000,0x0000, 0x1D29,0x0000,0x0000, 0x1D2A,0x0000,0x0000, +0x1D2B,0x0000,0x0000, 0x1D2C,0x0000,0x0000, 0x1D2D,0x0000,0x0000, +0x1D2E,0x0000,0x0000, 0x1D2F,0x0000,0x0000, 0x1D30,0x0000,0x0000, +0x1D31,0x0000,0x0000, 0x1D32,0x0000,0x0000, 0x1D33,0x0000,0x0000, +0x1D34,0x0000,0x0000, 0x1D35,0x0000,0x0000, 0x1D36,0x0000,0x0000, +0x1D37,0x0000,0x0000, 0x1D38,0x0000,0x0000, 0x1D39,0x0000,0x0000, +0x1D3A,0x0000,0x0000, 0x1D3B,0x0000,0x0000, 0x0292,0x0000,0x0000, +0x0293,0x0000,0x0000, 0xFBC0,0x969D,0x0000, 0xFBC0,0x969E,0x0000, +0xFBC0,0x969F,0x0000, 0x1D3C,0x0000,0x0000, 0x1D3C,0x0000,0x0000, +0x1D3D,0x0000,0x0000, 0x1D59,0x0000,0x0000, 0x1D3D,0x0000,0x0000, +0x1D3D,0x0000,0x0000, 0x1D3E,0x0000,0x0000, 0x1D3E,0x0000,0x0000, +0x1D3F,0x0000,0x0000, 0x1D3F,0x0000,0x0000, 0x1D57,0x0000,0x0000, +0x1D58,0x0000,0x0000, 0x1D3F,0x0000,0x0000, 0x1D3F,0x0000,0x0000, +0x1D3F,0x0000,0x0000, 0x1D40,0x0000,0x0000, 0x1D41,0x0000,0x0000, +0x1D42,0x0000,0x0000, 0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000, +0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000, +0x1D44,0x0000,0x0000, 0x1D5C,0x0000,0x0000, 0x1D45,0x0000,0x0000, +0x1D46,0x0000,0x0000, 0x1D46,0x0000,0x0000, 0x1D46,0x0000,0x0000, +0x1D46,0x0000,0x0000, 0x1D47,0x0000,0x0000, 0x1D47,0x0000,0x0000, +0x1D47,0x0000,0x0000, 0x1D48,0x0000,0x0000, 0x1D48,0x0000,0x0000, +0x1D49,0x0000,0x0000, 0x1D49,0x0000,0x0000, 0x1D4A,0x0000,0x0000, +0x1D4A,0x0000,0x0000, 0x1D4B,0x0000,0x0000, 0x1D4C,0x0000,0x0000, +0x1D4D,0x0000,0x0000, 0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000, +0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000, +0x1D4F,0x0000,0x0000, 0x1D4F,0x0000,0x0000, 0x1D4F,0x0000,0x0000, +0x1D50,0x0000,0x0000, 0x1D50,0x0000,0x0000, 0x1D50,0x0000,0x0000, +0x1D4C,0x0000,0x0000, 0x1D51,0x0000,0x0000, 0x1D52,0x0000,0x0000, +0x1D52,0x0000,0x0000, 0x1D52,0x0000,0x0000, 0x1D53,0x0000,0x0000, +0x1D53,0x0000,0x0000, 0x1D54,0x0000,0x0000, 0x1D54,0x0000,0x0000, +0x1D55,0x0000,0x0000, 0x1D56,0x0000,0x0000, 0x1D5A,0x0000,0x0000, +0x1D5E,0x0000,0x0000, 0x1D5F,0x0000,0x0000, 0x1D5B,0x0000,0x0000, +0x1D5D,0x0000,0x0000, 0x1D60,0x0000,0x0000, 0x1D61,0x0000,0x0000, +0x1D61,0x0000,0x0000, 0x1D61,0x0000,0x0000, 0x1D45,0x0000,0x0000, +0x1D4E,0x0000,0x0000, 0x024E,0x0000,0x0000, 0x024F,0x0000,0x0000, +0x0250,0x0000,0x0000, 0x1D4A,0x1D53,0x0000, 0x1D52,0x1D52,0x0000, +0x1D3E,0x1D3E,0x0000, 0xFBC0,0x96F1,0x0000, 0xFBC0,0x96F2,0x0000, +0xFBC0,0x96F3,0x0000, 0xFBC0,0x96F4,0x0000, 0xFBC0,0x96F5,0x0000, +0xFBC0,0x96F6,0x0000, 0xFBC0,0x96F7,0x0000, 0xFBC0,0x96F8,0x0000, +0xFBC0,0x96F9,0x0000, 0xFBC0,0x96FA,0x0000, 0xFBC0,0x96FB,0x0000, +0xFBC0,0x96FC,0x0000, 0xFBC0,0x96FD,0x0000, 0xFBC0,0x96FE,0x0000, +0xFBC0,0x96FF,0x0000 }; + +uint16 page017data[]= { /* 1700 (3 weights per char) */ +0x18E2,0x0000,0x0000, 0x18E3,0x0000,0x0000, 0x18E4,0x0000,0x0000, +0x18E5,0x0000,0x0000, 0x18E6,0x0000,0x0000, 0x18E7,0x0000,0x0000, +0x18E8,0x0000,0x0000, 0x18E9,0x0000,0x0000, 0x18EA,0x0000,0x0000, +0x18EB,0x0000,0x0000, 0x18EC,0x0000,0x0000, 0x18ED,0x0000,0x0000, +0x18EE,0x0000,0x0000, 0xFBC0,0x970D,0x0000, 0x18EF,0x0000,0x0000, +0x18F0,0x0000,0x0000, 0x18F1,0x0000,0x0000, 0x18F2,0x0000,0x0000, +0x18F3,0x0000,0x0000, 0x18F4,0x0000,0x0000, 0x18F5,0x0000,0x0000, +0xFBC0,0x9715,0x0000, 0xFBC0,0x9716,0x0000, 0xFBC0,0x9717,0x0000, +0xFBC0,0x9718,0x0000, 0xFBC0,0x9719,0x0000, 0xFBC0,0x971A,0x0000, +0xFBC0,0x971B,0x0000, 0xFBC0,0x971C,0x0000, 0xFBC0,0x971D,0x0000, +0xFBC0,0x971E,0x0000, 0xFBC0,0x971F,0x0000, 0x18F6,0x0000,0x0000, +0x18F7,0x0000,0x0000, 0x18F8,0x0000,0x0000, 0x18F9,0x0000,0x0000, +0x18FA,0x0000,0x0000, 0x18FB,0x0000,0x0000, 0x18FC,0x0000,0x0000, +0x18FD,0x0000,0x0000, 0x18FE,0x0000,0x0000, 0x18FF,0x0000,0x0000, +0x1900,0x0000,0x0000, 0x1901,0x0000,0x0000, 0x1902,0x0000,0x0000, +0x1903,0x0000,0x0000, 0x1904,0x0000,0x0000, 0x1905,0x0000,0x0000, +0x1906,0x0000,0x0000, 0x1907,0x0000,0x0000, 0x1908,0x0000,0x0000, +0x1909,0x0000,0x0000, 0x190A,0x0000,0x0000, 0x026A,0x0000,0x0000, +0x026B,0x0000,0x0000, 0xFBC0,0x9737,0x0000, 0xFBC0,0x9738,0x0000, +0xFBC0,0x9739,0x0000, 0xFBC0,0x973A,0x0000, 0xFBC0,0x973B,0x0000, +0xFBC0,0x973C,0x0000, 0xFBC0,0x973D,0x0000, 0xFBC0,0x973E,0x0000, +0xFBC0,0x973F,0x0000, 0x190B,0x0000,0x0000, 0x190C,0x0000,0x0000, +0x190D,0x0000,0x0000, 0x190E,0x0000,0x0000, 0x190F,0x0000,0x0000, +0x1910,0x0000,0x0000, 0x1911,0x0000,0x0000, 0x1912,0x0000,0x0000, +0x1913,0x0000,0x0000, 0x1914,0x0000,0x0000, 0x1915,0x0000,0x0000, +0x1916,0x0000,0x0000, 0x1917,0x0000,0x0000, 0x1918,0x0000,0x0000, +0x1919,0x0000,0x0000, 0x191A,0x0000,0x0000, 0x191B,0x0000,0x0000, +0x191C,0x0000,0x0000, 0x191D,0x0000,0x0000, 0x191E,0x0000,0x0000, +0xFBC0,0x9754,0x0000, 0xFBC0,0x9755,0x0000, 0xFBC0,0x9756,0x0000, +0xFBC0,0x9757,0x0000, 0xFBC0,0x9758,0x0000, 0xFBC0,0x9759,0x0000, +0xFBC0,0x975A,0x0000, 0xFBC0,0x975B,0x0000, 0xFBC0,0x975C,0x0000, +0xFBC0,0x975D,0x0000, 0xFBC0,0x975E,0x0000, 0xFBC0,0x975F,0x0000, +0x191F,0x0000,0x0000, 0x1920,0x0000,0x0000, 0x1921,0x0000,0x0000, +0x1922,0x0000,0x0000, 0x1923,0x0000,0x0000, 0x1924,0x0000,0x0000, +0x1925,0x0000,0x0000, 0x1926,0x0000,0x0000, 0x1927,0x0000,0x0000, +0x1928,0x0000,0x0000, 0x1929,0x0000,0x0000, 0x192A,0x0000,0x0000, +0x192B,0x0000,0x0000, 0xFBC0,0x976D,0x0000, 0x192C,0x0000,0x0000, +0x192D,0x0000,0x0000, 0x192E,0x0000,0x0000, 0xFBC0,0x9771,0x0000, +0x192F,0x0000,0x0000, 0x1930,0x0000,0x0000, 0xFBC0,0x9774,0x0000, +0xFBC0,0x9775,0x0000, 0xFBC0,0x9776,0x0000, 0xFBC0,0x9777,0x0000, +0xFBC0,0x9778,0x0000, 0xFBC0,0x9779,0x0000, 0xFBC0,0x977A,0x0000, +0xFBC0,0x977B,0x0000, 0xFBC0,0x977C,0x0000, 0xFBC0,0x977D,0x0000, +0xFBC0,0x977E,0x0000, 0xFBC0,0x977F,0x0000, 0x196C,0x0000,0x0000, +0x196D,0x0000,0x0000, 0x196E,0x0000,0x0000, 0x196F,0x0000,0x0000, +0x1970,0x0000,0x0000, 0x1971,0x0000,0x0000, 0x1972,0x0000,0x0000, +0x1973,0x0000,0x0000, 0x1974,0x0000,0x0000, 0x1975,0x0000,0x0000, +0x1976,0x0000,0x0000, 0x1977,0x0000,0x0000, 0x1978,0x0000,0x0000, +0x1979,0x0000,0x0000, 0x197A,0x0000,0x0000, 0x197B,0x0000,0x0000, +0x197C,0x0000,0x0000, 0x197D,0x0000,0x0000, 0x197E,0x0000,0x0000, +0x197F,0x0000,0x0000, 0x1980,0x0000,0x0000, 0x1981,0x0000,0x0000, +0x1982,0x0000,0x0000, 0x1983,0x0000,0x0000, 0x1984,0x0000,0x0000, +0x1985,0x0000,0x0000, 0x1986,0x0000,0x0000, 0x1987,0x0000,0x0000, +0x1988,0x0000,0x0000, 0x1989,0x0000,0x0000, 0x198A,0x0000,0x0000, +0x198B,0x0000,0x0000, 0x198C,0x0000,0x0000, 0x198D,0x0000,0x0000, +0x198E,0x0000,0x0000, 0x1990,0x0000,0x0000, 0x1991,0x0000,0x0000, +0x1992,0x0000,0x0000, 0x1993,0x0000,0x0000, 0x1994,0x0000,0x0000, +0x1995,0x0000,0x0000, 0x1996,0x0000,0x0000, 0x1997,0x0000,0x0000, +0x1998,0x0000,0x0000, 0x1999,0x0000,0x0000, 0x199A,0x0000,0x0000, +0x199B,0x0000,0x0000, 0x199C,0x0000,0x0000, 0x199D,0x0000,0x0000, +0x199E,0x0000,0x0000, 0x199F,0x0000,0x0000, 0x19A0,0x0000,0x0000, +0x19A1,0x0000,0x0000, 0x19A2,0x0000,0x0000, 0x19A3,0x0000,0x0000, +0x19A4,0x0000,0x0000, 0x19A5,0x0000,0x0000, 0x19A6,0x0000,0x0000, +0x19A7,0x0000,0x0000, 0x19A8,0x0000,0x0000, 0x19A9,0x0000,0x0000, +0x19AA,0x0000,0x0000, 0x19AB,0x0000,0x0000, 0x19AC,0x0000,0x0000, +0x19AD,0x0000,0x0000, 0x19AE,0x0000,0x0000, 0x19AF,0x0000,0x0000, +0x19B0,0x0000,0x0000, 0x19B1,0x0000,0x0000, 0x19B2,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x19B3,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x026E,0x0000,0x0000, +0x026F,0x0000,0x0000, 0x024D,0x0000,0x0000, 0x0312,0x0000,0x0000, +0x0313,0x0000,0x0000, 0x0314,0x0000,0x0000, 0x0315,0x0000,0x0000, +0x0E17,0x0000,0x0000, 0x198F,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x97DE,0x0000, 0xFBC0,0x97DF,0x0000, 0x0E29,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0xFBC0,0x97EA,0x0000, 0xFBC0,0x97EB,0x0000, 0xFBC0,0x97EC,0x0000, +0xFBC0,0x97ED,0x0000, 0xFBC0,0x97EE,0x0000, 0xFBC0,0x97EF,0x0000, +0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0xFBC0,0x97FA,0x0000, 0xFBC0,0x97FB,0x0000, +0xFBC0,0x97FC,0x0000, 0xFBC0,0x97FD,0x0000, 0xFBC0,0x97FE,0x0000, +0xFBC0,0x97FF,0x0000 }; + +uint16 page018data[]= { /* 1800 (3 weights per char) */ +0x02F8,0x0000,0x0000, 0x025E,0x0000,0x0000, 0x0235,0x0000,0x0000, +0x0263,0x0000,0x0000, 0x024A,0x0000,0x0000, 0x024B,0x0000,0x0000, +0x0223,0x0000,0x0000, 0x0224,0x0000,0x0000, 0x0236,0x0000,0x0000, +0x0264,0x0000,0x0000, 0x02F9,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x980F,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, +0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, +0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, +0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0xFBC0,0x981A,0x0000, +0xFBC0,0x981B,0x0000, 0xFBC0,0x981C,0x0000, 0xFBC0,0x981D,0x0000, +0xFBC0,0x981E,0x0000, 0xFBC0,0x981F,0x0000, 0x19DF,0x0000,0x0000, +0x19E1,0x0000,0x0000, 0x19E4,0x0000,0x0000, 0x19EA,0x0000,0x0000, +0x19EC,0x0000,0x0000, 0x19EF,0x0000,0x0000, 0x19F1,0x0000,0x0000, +0x19F4,0x0000,0x0000, 0x19F5,0x0000,0x0000, 0x19F6,0x0000,0x0000, +0x19FB,0x0000,0x0000, 0x19FD,0x0000,0x0000, 0x1A00,0x0000,0x0000, +0x1A02,0x0000,0x0000, 0x1A07,0x0000,0x0000, 0x1A09,0x0000,0x0000, +0x1A0A,0x0000,0x0000, 0x1A0B,0x0000,0x0000, 0x1A12,0x0000,0x0000, +0x1A15,0x0000,0x0000, 0x1A18,0x0000,0x0000, 0x1A1D,0x0000,0x0000, +0x1A21,0x0000,0x0000, 0x1A24,0x0000,0x0000, 0x1A26,0x0000,0x0000, +0x1A28,0x0000,0x0000, 0x1A2B,0x0000,0x0000, 0x1A30,0x0000,0x0000, +0x1A31,0x0000,0x0000, 0x1A34,0x0000,0x0000, 0x1A38,0x0000,0x0000, +0x1A3B,0x0000,0x0000, 0x1A3C,0x0000,0x0000, 0x1A3D,0x0000,0x0000, +0x1A3E,0x0000,0x0000, 0x19DE,0x0000,0x0000, 0x19E2,0x0000,0x0000, +0x19E5,0x0000,0x0000, 0x19EB,0x0000,0x0000, 0x19ED,0x0000,0x0000, +0x19F0,0x0000,0x0000, 0x19F2,0x0000,0x0000, 0x19F7,0x0000,0x0000, +0x19FC,0x0000,0x0000, 0x19FE,0x0000,0x0000, 0x1A01,0x0000,0x0000, +0x1A03,0x0000,0x0000, 0x1A08,0x0000,0x0000, 0x1A13,0x0000,0x0000, +0x1A16,0x0000,0x0000, 0x1A19,0x0000,0x0000, 0x1A1E,0x0000,0x0000, +0x1A32,0x0000,0x0000, 0x1A22,0x0000,0x0000, 0x1A27,0x0000,0x0000, +0x1A2C,0x0000,0x0000, 0x1A36,0x0000,0x0000, 0x1A39,0x0000,0x0000, +0x1A3F,0x0000,0x0000, 0x1A40,0x0000,0x0000, 0x1A1B,0x0000,0x0000, +0x19E3,0x0000,0x0000, 0x19E6,0x0000,0x0000, 0x19E9,0x0000,0x0000, +0x19F3,0x0000,0x0000, 0x19EE,0x0000,0x0000, 0x19F8,0x0000,0x0000, +0x1A2D,0x0000,0x0000, 0x1A04,0x0000,0x0000, 0x1A06,0x0000,0x0000, +0x19FF,0x0000,0x0000, 0x1A0C,0x0000,0x0000, 0x1A14,0x0000,0x0000, +0x1A17,0x0000,0x0000, 0x1A1F,0x0000,0x0000, 0x1A29,0x0000,0x0000, +0x1A37,0x0000,0x0000, 0x1A3A,0x0000,0x0000, 0x1A33,0x0000,0x0000, +0x1A35,0x0000,0x0000, 0x1A41,0x0000,0x0000, 0x1A1A,0x0000,0x0000, +0x1A23,0x0000,0x0000, 0x19E7,0x0000,0x0000, 0x1A2E,0x0000,0x0000, +0x1A25,0x0000,0x0000, 0x1A2A,0x0000,0x0000, 0x1A20,0x0000,0x0000, +0xFBC0,0x9878,0x0000, 0xFBC0,0x9879,0x0000, 0xFBC0,0x987A,0x0000, +0xFBC0,0x987B,0x0000, 0xFBC0,0x987C,0x0000, 0xFBC0,0x987D,0x0000, +0xFBC0,0x987E,0x0000, 0xFBC0,0x987F,0x0000, 0x19D7,0x0000,0x0000, +0x19D8,0x0000,0x0000, 0x19D9,0x0000,0x0000, 0x19DA,0x0000,0x0000, +0x19DB,0x0000,0x0000, 0x19DC,0x0000,0x0000, 0x19DD,0x0000,0x0000, +0x19E0,0x0000,0x0000, 0x19E8,0x0000,0x0000, 0x1A2F,0x0000,0x0000, +0x19F9,0x0000,0x0000, 0x1A1C,0x0000,0x0000, 0x1A42,0x0000,0x0000, +0x1A44,0x0000,0x0000, 0x1A45,0x0000,0x0000, 0x1A47,0x0000,0x0000, +0x1A48,0x0000,0x0000, 0x1A4B,0x0000,0x0000, 0x1A4D,0x0000,0x0000, +0x1A4E,0x0000,0x0000, 0x1A50,0x0000,0x0000, 0x1A52,0x0000,0x0000, +0x1A54,0x0000,0x0000, 0x1A55,0x0000,0x0000, 0x1A49,0x0000,0x0000, +0x1A53,0x0000,0x0000, 0x1A05,0x0000,0x0000, 0x19FA,0x0000,0x0000, +0x1A0D,0x0000,0x0000, 0x1A0E,0x0000,0x0000, 0x1A43,0x0000,0x0000, +0x1A46,0x0000,0x0000, 0x1A4A,0x0000,0x0000, 0x1A4C,0x0000,0x0000, +0x1A0F,0x0000,0x0000, 0x1A51,0x0000,0x0000, 0x1A10,0x0000,0x0000, +0x1A11,0x0000,0x0000, 0x1A56,0x0000,0x0000, 0x1A57,0x0000,0x0000, +0x1A4F,0x0000,0x0000, 0x1A58,0x0000,0x0000, 0xFBC0,0x98AA,0x0000, +0xFBC0,0x98AB,0x0000, 0xFBC0,0x98AC,0x0000, 0xFBC0,0x98AD,0x0000, +0xFBC0,0x98AE,0x0000, 0xFBC0,0x98AF,0x0000, 0xFBC0,0x98B0,0x0000, +0xFBC0,0x98B1,0x0000, 0xFBC0,0x98B2,0x0000, 0xFBC0,0x98B3,0x0000, +0xFBC0,0x98B4,0x0000, 0xFBC0,0x98B5,0x0000, 0xFBC0,0x98B6,0x0000, +0xFBC0,0x98B7,0x0000, 0xFBC0,0x98B8,0x0000, 0xFBC0,0x98B9,0x0000, +0xFBC0,0x98BA,0x0000, 0xFBC0,0x98BB,0x0000, 0xFBC0,0x98BC,0x0000, +0xFBC0,0x98BD,0x0000, 0xFBC0,0x98BE,0x0000, 0xFBC0,0x98BF,0x0000, +0xFBC0,0x98C0,0x0000, 0xFBC0,0x98C1,0x0000, 0xFBC0,0x98C2,0x0000, +0xFBC0,0x98C3,0x0000, 0xFBC0,0x98C4,0x0000, 0xFBC0,0x98C5,0x0000, +0xFBC0,0x98C6,0x0000, 0xFBC0,0x98C7,0x0000, 0xFBC0,0x98C8,0x0000, +0xFBC0,0x98C9,0x0000, 0xFBC0,0x98CA,0x0000, 0xFBC0,0x98CB,0x0000, +0xFBC0,0x98CC,0x0000, 0xFBC0,0x98CD,0x0000, 0xFBC0,0x98CE,0x0000, +0xFBC0,0x98CF,0x0000, 0xFBC0,0x98D0,0x0000, 0xFBC0,0x98D1,0x0000, +0xFBC0,0x98D2,0x0000, 0xFBC0,0x98D3,0x0000, 0xFBC0,0x98D4,0x0000, +0xFBC0,0x98D5,0x0000, 0xFBC0,0x98D6,0x0000, 0xFBC0,0x98D7,0x0000, +0xFBC0,0x98D8,0x0000, 0xFBC0,0x98D9,0x0000, 0xFBC0,0x98DA,0x0000, +0xFBC0,0x98DB,0x0000, 0xFBC0,0x98DC,0x0000, 0xFBC0,0x98DD,0x0000, +0xFBC0,0x98DE,0x0000, 0xFBC0,0x98DF,0x0000, 0xFBC0,0x98E0,0x0000, +0xFBC0,0x98E1,0x0000, 0xFBC0,0x98E2,0x0000, 0xFBC0,0x98E3,0x0000, +0xFBC0,0x98E4,0x0000, 0xFBC0,0x98E5,0x0000, 0xFBC0,0x98E6,0x0000, +0xFBC0,0x98E7,0x0000, 0xFBC0,0x98E8,0x0000, 0xFBC0,0x98E9,0x0000, +0xFBC0,0x98EA,0x0000, 0xFBC0,0x98EB,0x0000, 0xFBC0,0x98EC,0x0000, +0xFBC0,0x98ED,0x0000, 0xFBC0,0x98EE,0x0000, 0xFBC0,0x98EF,0x0000, +0xFBC0,0x98F0,0x0000, 0xFBC0,0x98F1,0x0000, 0xFBC0,0x98F2,0x0000, +0xFBC0,0x98F3,0x0000, 0xFBC0,0x98F4,0x0000, 0xFBC0,0x98F5,0x0000, +0xFBC0,0x98F6,0x0000, 0xFBC0,0x98F7,0x0000, 0xFBC0,0x98F8,0x0000, +0xFBC0,0x98F9,0x0000, 0xFBC0,0x98FA,0x0000, 0xFBC0,0x98FB,0x0000, +0xFBC0,0x98FC,0x0000, 0xFBC0,0x98FD,0x0000, 0xFBC0,0x98FE,0x0000, +0xFBC0,0x98FF,0x0000 }; + +uint16 page019data[]= { /* 1900 (3 weights per char) */ +0x18B0,0x0000,0x0000, 0x18B1,0x0000,0x0000, 0x18B2,0x0000,0x0000, +0x18B3,0x0000,0x0000, 0x18B4,0x0000,0x0000, 0x18B5,0x0000,0x0000, +0x18B6,0x0000,0x0000, 0x18B7,0x0000,0x0000, 0x18B8,0x0000,0x0000, +0x18B9,0x0000,0x0000, 0x18BA,0x0000,0x0000, 0x18BB,0x0000,0x0000, +0x18BC,0x0000,0x0000, 0x18BD,0x0000,0x0000, 0x18BE,0x0000,0x0000, +0x18BF,0x0000,0x0000, 0x18C0,0x0000,0x0000, 0x18C1,0x0000,0x0000, +0x18C2,0x0000,0x0000, 0x18C3,0x0000,0x0000, 0x18C4,0x0000,0x0000, +0x18C5,0x0000,0x0000, 0x18C6,0x0000,0x0000, 0x18C7,0x0000,0x0000, +0x18C8,0x0000,0x0000, 0x18C9,0x0000,0x0000, 0x18CA,0x0000,0x0000, +0x18CB,0x0000,0x0000, 0x18CC,0x0000,0x0000, 0xFBC0,0x991D,0x0000, +0xFBC0,0x991E,0x0000, 0xFBC0,0x991F,0x0000, 0x18CD,0x0000,0x0000, +0x18CE,0x0000,0x0000, 0x18CF,0x0000,0x0000, 0x18D0,0x0000,0x0000, +0x18D1,0x0000,0x0000, 0x18D2,0x0000,0x0000, 0x18D3,0x0000,0x0000, +0x18D4,0x0000,0x0000, 0x18D5,0x0000,0x0000, 0x18D6,0x0000,0x0000, +0x18D7,0x0000,0x0000, 0x18D8,0x0000,0x0000, 0xFBC0,0x992C,0x0000, +0xFBC0,0x992D,0x0000, 0xFBC0,0x992E,0x0000, 0xFBC0,0x992F,0x0000, +0x18D9,0x0000,0x0000, 0x18DA,0x0000,0x0000, 0x18DB,0x0000,0x0000, +0x18DC,0x0000,0x0000, 0x18DD,0x0000,0x0000, 0x18DE,0x0000,0x0000, +0x18DF,0x0000,0x0000, 0x18E0,0x0000,0x0000, 0x18E1,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC0,0x993C,0x0000, 0xFBC0,0x993D,0x0000, 0xFBC0,0x993E,0x0000, +0xFBC0,0x993F,0x0000, 0x030D,0x0000,0x0000, 0xFBC0,0x9941,0x0000, +0xFBC0,0x9942,0x0000, 0xFBC0,0x9943,0x0000, 0x0254,0x0000,0x0000, +0x025B,0x0000,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, +0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, +0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, +0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x19B4,0x0000,0x0000, +0x19B5,0x0000,0x0000, 0x19B6,0x0000,0x0000, 0x19B7,0x0000,0x0000, +0x19B8,0x0000,0x0000, 0x19B9,0x0000,0x0000, 0x19BA,0x0000,0x0000, +0x19BB,0x0000,0x0000, 0x19BC,0x0000,0x0000, 0x19BD,0x0000,0x0000, +0x19BE,0x0000,0x0000, 0x19BF,0x0000,0x0000, 0x19C0,0x0000,0x0000, +0x19C1,0x0000,0x0000, 0x19C2,0x0000,0x0000, 0x19C3,0x0000,0x0000, +0x19C4,0x0000,0x0000, 0x19C5,0x0000,0x0000, 0x19C6,0x0000,0x0000, +0x19C7,0x0000,0x0000, 0x19C8,0x0000,0x0000, 0x19C9,0x0000,0x0000, +0x19CA,0x0000,0x0000, 0x19CB,0x0000,0x0000, 0x19CC,0x0000,0x0000, +0x19CD,0x0000,0x0000, 0x19CE,0x0000,0x0000, 0x19CF,0x0000,0x0000, +0x19D0,0x0000,0x0000, 0x19D1,0x0000,0x0000, 0xFBC0,0x996E,0x0000, +0xFBC0,0x996F,0x0000, 0x19D2,0x0000,0x0000, 0x19D3,0x0000,0x0000, +0x19D4,0x0000,0x0000, 0x19D5,0x0000,0x0000, 0x19D6,0x0000,0x0000, +0xFBC0,0x9975,0x0000, 0xFBC0,0x9976,0x0000, 0xFBC0,0x9977,0x0000, +0xFBC0,0x9978,0x0000, 0xFBC0,0x9979,0x0000, 0xFBC0,0x997A,0x0000, +0xFBC0,0x997B,0x0000, 0xFBC0,0x997C,0x0000, 0xFBC0,0x997D,0x0000, +0xFBC0,0x997E,0x0000, 0xFBC0,0x997F,0x0000, 0xFBC0,0x9980,0x0000, +0xFBC0,0x9981,0x0000, 0xFBC0,0x9982,0x0000, 0xFBC0,0x9983,0x0000, +0xFBC0,0x9984,0x0000, 0xFBC0,0x9985,0x0000, 0xFBC0,0x9986,0x0000, +0xFBC0,0x9987,0x0000, 0xFBC0,0x9988,0x0000, 0xFBC0,0x9989,0x0000, +0xFBC0,0x998A,0x0000, 0xFBC0,0x998B,0x0000, 0xFBC0,0x998C,0x0000, +0xFBC0,0x998D,0x0000, 0xFBC0,0x998E,0x0000, 0xFBC0,0x998F,0x0000, +0xFBC0,0x9990,0x0000, 0xFBC0,0x9991,0x0000, 0xFBC0,0x9992,0x0000, +0xFBC0,0x9993,0x0000, 0xFBC0,0x9994,0x0000, 0xFBC0,0x9995,0x0000, +0xFBC0,0x9996,0x0000, 0xFBC0,0x9997,0x0000, 0xFBC0,0x9998,0x0000, +0xFBC0,0x9999,0x0000, 0xFBC0,0x999A,0x0000, 0xFBC0,0x999B,0x0000, +0xFBC0,0x999C,0x0000, 0xFBC0,0x999D,0x0000, 0xFBC0,0x999E,0x0000, +0xFBC0,0x999F,0x0000, 0xFBC0,0x99A0,0x0000, 0xFBC0,0x99A1,0x0000, +0xFBC0,0x99A2,0x0000, 0xFBC0,0x99A3,0x0000, 0xFBC0,0x99A4,0x0000, +0xFBC0,0x99A5,0x0000, 0xFBC0,0x99A6,0x0000, 0xFBC0,0x99A7,0x0000, +0xFBC0,0x99A8,0x0000, 0xFBC0,0x99A9,0x0000, 0xFBC0,0x99AA,0x0000, +0xFBC0,0x99AB,0x0000, 0xFBC0,0x99AC,0x0000, 0xFBC0,0x99AD,0x0000, +0xFBC0,0x99AE,0x0000, 0xFBC0,0x99AF,0x0000, 0xFBC0,0x99B0,0x0000, +0xFBC0,0x99B1,0x0000, 0xFBC0,0x99B2,0x0000, 0xFBC0,0x99B3,0x0000, +0xFBC0,0x99B4,0x0000, 0xFBC0,0x99B5,0x0000, 0xFBC0,0x99B6,0x0000, +0xFBC0,0x99B7,0x0000, 0xFBC0,0x99B8,0x0000, 0xFBC0,0x99B9,0x0000, +0xFBC0,0x99BA,0x0000, 0xFBC0,0x99BB,0x0000, 0xFBC0,0x99BC,0x0000, +0xFBC0,0x99BD,0x0000, 0xFBC0,0x99BE,0x0000, 0xFBC0,0x99BF,0x0000, +0xFBC0,0x99C0,0x0000, 0xFBC0,0x99C1,0x0000, 0xFBC0,0x99C2,0x0000, +0xFBC0,0x99C3,0x0000, 0xFBC0,0x99C4,0x0000, 0xFBC0,0x99C5,0x0000, +0xFBC0,0x99C6,0x0000, 0xFBC0,0x99C7,0x0000, 0xFBC0,0x99C8,0x0000, +0xFBC0,0x99C9,0x0000, 0xFBC0,0x99CA,0x0000, 0xFBC0,0x99CB,0x0000, +0xFBC0,0x99CC,0x0000, 0xFBC0,0x99CD,0x0000, 0xFBC0,0x99CE,0x0000, +0xFBC0,0x99CF,0x0000, 0xFBC0,0x99D0,0x0000, 0xFBC0,0x99D1,0x0000, +0xFBC0,0x99D2,0x0000, 0xFBC0,0x99D3,0x0000, 0xFBC0,0x99D4,0x0000, +0xFBC0,0x99D5,0x0000, 0xFBC0,0x99D6,0x0000, 0xFBC0,0x99D7,0x0000, +0xFBC0,0x99D8,0x0000, 0xFBC0,0x99D9,0x0000, 0xFBC0,0x99DA,0x0000, +0xFBC0,0x99DB,0x0000, 0xFBC0,0x99DC,0x0000, 0xFBC0,0x99DD,0x0000, +0xFBC0,0x99DE,0x0000, 0xFBC0,0x99DF,0x0000, 0x037B,0x0000,0x0000, +0x037C,0x0000,0x0000, 0x037D,0x0000,0x0000, 0x037E,0x0000,0x0000, +0x037F,0x0000,0x0000, 0x0380,0x0000,0x0000, 0x0381,0x0000,0x0000, +0x0382,0x0000,0x0000, 0x0383,0x0000,0x0000, 0x0384,0x0000,0x0000, +0x0385,0x0000,0x0000, 0x0386,0x0000,0x0000, 0x0387,0x0000,0x0000, +0x0388,0x0000,0x0000, 0x0389,0x0000,0x0000, 0x038A,0x0000,0x0000, +0x038B,0x0000,0x0000, 0x038C,0x0000,0x0000, 0x038D,0x0000,0x0000, +0x038E,0x0000,0x0000, 0x038F,0x0000,0x0000, 0x0390,0x0000,0x0000, +0x0391,0x0000,0x0000, 0x0392,0x0000,0x0000, 0x0393,0x0000,0x0000, +0x0394,0x0000,0x0000, 0x0395,0x0000,0x0000, 0x0396,0x0000,0x0000, +0x0397,0x0000,0x0000, 0x0398,0x0000,0x0000, 0x0399,0x0000,0x0000, +0x039A,0x0000,0x0000 }; + +uint16 page01Ddata[]= { /* 1D00 (3 weights per char) */ +0x0E37,0x0000,0x0000, 0x0E3C,0x0000,0x0000, 0x0E3D,0x0000,0x0000, +0x0E57,0x0000,0x0000, 0x0E64,0x0000,0x0000, 0x0E71,0x0000,0x0000, +0x0E8A,0x0000,0x0000, 0x0E8F,0x0000,0x0000, 0x0EA8,0x0000,0x0000, +0x0F07,0x0000,0x0000, 0x0F14,0x0000,0x0000, 0x0F25,0x0000,0x0000, +0x0F3A,0x0000,0x0000, 0x0F5F,0x0000,0x0000, 0x0F6D,0x0000,0x0000, +0x0F86,0x0000,0x0000, 0x0F96,0x0000,0x0000, 0x0F87,0x0000,0x0000, +0x0F97,0x0000,0x0000, 0x0F91,0x0000,0x0000, 0x0F8C,0x0000,0x0000, +0x0FA6,0x0000,0x0000, 0x0F98,0x0000,0x0000, 0x0F99,0x0000,0x0000, +0x0FAB,0x0000,0x0000, 0x0FC8,0x0000,0x0000, 0x0FCD,0x0000,0x0000, +0x1006,0x0000,0x0000, 0x1023,0x0000,0x0000, 0x1024,0x0000,0x0000, +0x1025,0x0000,0x0000, 0x103B,0x0000,0x0000, 0x1048,0x0000,0x0000, +0x1055,0x0000,0x0000, 0x106E,0x0000,0x0000, 0x1083,0x0000,0x0000, +0x10BA,0x0000,0x0000, 0x10BB,0x0000,0x0000, 0x10EB,0x0000,0x0000, +0x10F7,0x0000,0x0000, 0x10FD,0x0000,0x0000, 0x1101,0x0000,0x0000, +0x1108,0x0000,0x0000, 0x11B4,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E38,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E56,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E90,0x0000,0x0000, +0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0F10,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000, +0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F6C,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0FA2,0x0000,0x0000, 0x0FA7,0x0000,0x0000, +0x0FC0,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E3E,0x0000,0x0000, +0x0E42,0x0000,0x0000, 0x0E3D,0x0000,0x0000, 0x0E4A,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E94,0x0000,0x0000, +0x0E98,0x0000,0x0000, 0x0EA8,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0F07,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F5B,0x0000,0x0000, +0x0F7E,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F92,0x0000,0x0000, +0x0F98,0x0000,0x0000, 0x0F99,0x0000,0x0000, 0x0FA7,0x0000,0x0000, +0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1024,0x0000,0x0000, +0x1037,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x10BB,0x0000,0x0000, +0x10E9,0x0000,0x0000, 0x10EA,0x0000,0x0000, 0x10EC,0x0000,0x0000, +0x1105,0x0000,0x0000, 0x1106,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0FC0,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000, +0x10E9,0x0000,0x0000, 0x10EA,0x0000,0x0000, 0x1100,0x0000,0x0000, +0x1105,0x0000,0x0000, 0x1106,0x0000,0x0000, 0x1026,0x0000,0x0000, +0xFBC0,0x9D6C,0x0000, 0xFBC0,0x9D6D,0x0000, 0xFBC0,0x9D6E,0x0000, +0xFBC0,0x9D6F,0x0000, 0xFBC0,0x9D70,0x0000, 0xFBC0,0x9D71,0x0000, +0xFBC0,0x9D72,0x0000, 0xFBC0,0x9D73,0x0000, 0xFBC0,0x9D74,0x0000, +0xFBC0,0x9D75,0x0000, 0xFBC0,0x9D76,0x0000, 0xFBC0,0x9D77,0x0000, +0xFBC0,0x9D78,0x0000, 0xFBC0,0x9D79,0x0000, 0xFBC0,0x9D7A,0x0000, +0xFBC0,0x9D7B,0x0000, 0xFBC0,0x9D7C,0x0000, 0xFBC0,0x9D7D,0x0000, +0xFBC0,0x9D7E,0x0000, 0xFBC0,0x9D7F,0x0000, 0xFBC0,0x9D80,0x0000, +0xFBC0,0x9D81,0x0000, 0xFBC0,0x9D82,0x0000, 0xFBC0,0x9D83,0x0000, +0xFBC0,0x9D84,0x0000, 0xFBC0,0x9D85,0x0000, 0xFBC0,0x9D86,0x0000, +0xFBC0,0x9D87,0x0000, 0xFBC0,0x9D88,0x0000, 0xFBC0,0x9D89,0x0000, +0xFBC0,0x9D8A,0x0000, 0xFBC0,0x9D8B,0x0000, 0xFBC0,0x9D8C,0x0000, +0xFBC0,0x9D8D,0x0000, 0xFBC0,0x9D8E,0x0000, 0xFBC0,0x9D8F,0x0000, +0xFBC0,0x9D90,0x0000, 0xFBC0,0x9D91,0x0000, 0xFBC0,0x9D92,0x0000, +0xFBC0,0x9D93,0x0000, 0xFBC0,0x9D94,0x0000, 0xFBC0,0x9D95,0x0000, +0xFBC0,0x9D96,0x0000, 0xFBC0,0x9D97,0x0000, 0xFBC0,0x9D98,0x0000, +0xFBC0,0x9D99,0x0000, 0xFBC0,0x9D9A,0x0000, 0xFBC0,0x9D9B,0x0000, +0xFBC0,0x9D9C,0x0000, 0xFBC0,0x9D9D,0x0000, 0xFBC0,0x9D9E,0x0000, +0xFBC0,0x9D9F,0x0000, 0xFBC0,0x9DA0,0x0000, 0xFBC0,0x9DA1,0x0000, +0xFBC0,0x9DA2,0x0000, 0xFBC0,0x9DA3,0x0000, 0xFBC0,0x9DA4,0x0000, +0xFBC0,0x9DA5,0x0000, 0xFBC0,0x9DA6,0x0000, 0xFBC0,0x9DA7,0x0000, +0xFBC0,0x9DA8,0x0000, 0xFBC0,0x9DA9,0x0000, 0xFBC0,0x9DAA,0x0000, +0xFBC0,0x9DAB,0x0000, 0xFBC0,0x9DAC,0x0000, 0xFBC0,0x9DAD,0x0000, +0xFBC0,0x9DAE,0x0000, 0xFBC0,0x9DAF,0x0000, 0xFBC0,0x9DB0,0x0000, +0xFBC0,0x9DB1,0x0000, 0xFBC0,0x9DB2,0x0000, 0xFBC0,0x9DB3,0x0000, +0xFBC0,0x9DB4,0x0000, 0xFBC0,0x9DB5,0x0000, 0xFBC0,0x9DB6,0x0000, +0xFBC0,0x9DB7,0x0000, 0xFBC0,0x9DB8,0x0000, 0xFBC0,0x9DB9,0x0000, +0xFBC0,0x9DBA,0x0000, 0xFBC0,0x9DBB,0x0000, 0xFBC0,0x9DBC,0x0000, +0xFBC0,0x9DBD,0x0000, 0xFBC0,0x9DBE,0x0000, 0xFBC0,0x9DBF,0x0000, +0xFBC0,0x9DC0,0x0000, 0xFBC0,0x9DC1,0x0000, 0xFBC0,0x9DC2,0x0000, +0xFBC0,0x9DC3,0x0000, 0xFBC0,0x9DC4,0x0000, 0xFBC0,0x9DC5,0x0000, +0xFBC0,0x9DC6,0x0000, 0xFBC0,0x9DC7,0x0000, 0xFBC0,0x9DC8,0x0000, +0xFBC0,0x9DC9,0x0000, 0xFBC0,0x9DCA,0x0000, 0xFBC0,0x9DCB,0x0000, +0xFBC0,0x9DCC,0x0000, 0xFBC0,0x9DCD,0x0000, 0xFBC0,0x9DCE,0x0000, +0xFBC0,0x9DCF,0x0000, 0xFBC0,0x9DD0,0x0000, 0xFBC0,0x9DD1,0x0000, +0xFBC0,0x9DD2,0x0000, 0xFBC0,0x9DD3,0x0000, 0xFBC0,0x9DD4,0x0000, +0xFBC0,0x9DD5,0x0000, 0xFBC0,0x9DD6,0x0000, 0xFBC0,0x9DD7,0x0000, +0xFBC0,0x9DD8,0x0000, 0xFBC0,0x9DD9,0x0000, 0xFBC0,0x9DDA,0x0000, +0xFBC0,0x9DDB,0x0000, 0xFBC0,0x9DDC,0x0000, 0xFBC0,0x9DDD,0x0000, +0xFBC0,0x9DDE,0x0000, 0xFBC0,0x9DDF,0x0000, 0xFBC0,0x9DE0,0x0000, +0xFBC0,0x9DE1,0x0000, 0xFBC0,0x9DE2,0x0000, 0xFBC0,0x9DE3,0x0000, +0xFBC0,0x9DE4,0x0000, 0xFBC0,0x9DE5,0x0000, 0xFBC0,0x9DE6,0x0000, +0xFBC0,0x9DE7,0x0000, 0xFBC0,0x9DE8,0x0000, 0xFBC0,0x9DE9,0x0000, +0xFBC0,0x9DEA,0x0000, 0xFBC0,0x9DEB,0x0000, 0xFBC0,0x9DEC,0x0000, +0xFBC0,0x9DED,0x0000, 0xFBC0,0x9DEE,0x0000, 0xFBC0,0x9DEF,0x0000, +0xFBC0,0x9DF0,0x0000, 0xFBC0,0x9DF1,0x0000, 0xFBC0,0x9DF2,0x0000, +0xFBC0,0x9DF3,0x0000, 0xFBC0,0x9DF4,0x0000, 0xFBC0,0x9DF5,0x0000, +0xFBC0,0x9DF6,0x0000, 0xFBC0,0x9DF7,0x0000, 0xFBC0,0x9DF8,0x0000, +0xFBC0,0x9DF9,0x0000, 0xFBC0,0x9DFA,0x0000, 0xFBC0,0x9DFB,0x0000, +0xFBC0,0x9DFC,0x0000, 0xFBC0,0x9DFD,0x0000, 0xFBC0,0x9DFE,0x0000, +0xFBC0,0x9DFF,0x0000 }; + +uint16 page01Edata[]= { /* 1E00 (3 weights per char) */ +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000, +0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, +0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000, +0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0EB9,0x0000,0x0000, 0x0EB9,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, +0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, +0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, +0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, +0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F5B,0x0000,0x0000, +0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, +0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0FA7,0x0000,0x0000, 0x0FA7,0x0000,0x0000, 0x0FA7,0x0000,0x0000, +0x0FA7,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, +0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, +0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x1044,0x0000,0x0000, +0x1044,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x1051,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, +0x105A,0x0000,0x0000, 0x105A,0x0000,0x0000, 0x105A,0x0000,0x0000, +0x105A,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, +0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1051,0x0000,0x0000, +0x105E,0x0000,0x0000, 0x0E33,0x10B3,0x0000, 0x0FEA,0x0000,0x0000, +0xFBC0,0x9E9C,0x0000, 0xFBC0,0x9E9D,0x0000, 0xFBC0,0x9E9E,0x0000, +0xFBC0,0x9E9F,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x105E,0x0000,0x0000, 0xFBC0,0x9EFA,0x0000, 0xFBC0,0x9EFB,0x0000, +0xFBC0,0x9EFC,0x0000, 0xFBC0,0x9EFD,0x0000, 0xFBC0,0x9EFE,0x0000, +0xFBC0,0x9EFF,0x0000 }; + +uint16 page01Fdata[]= { /* 1F00 (3 weights per char) */ +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, +0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, +0x10ED,0x0000,0x0000, 0xFBC0,0x9F16,0x0000, 0xFBC0,0x9F17,0x0000, +0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, +0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, +0xFBC0,0x9F1E,0x0000, 0xFBC0,0x9F1F,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, +0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, +0x10FB,0x0000,0x0000, 0xFBC0,0x9F46,0x0000, 0xFBC0,0x9F47,0x0000, +0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, +0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, +0xFBC0,0x9F4E,0x0000, 0xFBC0,0x9F4F,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0xFBC0,0x9F58,0x0000, 0x1104,0x0000,0x0000, +0xFBC0,0x9F5A,0x0000, 0x1104,0x0000,0x0000, 0xFBC0,0x9F5C,0x0000, +0x1104,0x0000,0x0000, 0xFBC0,0x9F5E,0x0000, 0x1104,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0xFBC0,0x9F7E,0x0000, 0xFBC0,0x9F7F,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0xFBC0,0x9FB5,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, +0x0217,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x0217,0x0000,0x0000, +0x021D,0x0000,0x0000, 0x0214,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0xFBC0,0x9FC5,0x0000, +0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10ED,0x0000,0x0000, +0x10ED,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, +0x10F1,0x0000,0x0000, 0x0217,0x0000,0x0000, 0x0217,0x0000,0x0000, +0x0217,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0xFBC0,0x9FD4,0x0000, +0xFBC0,0x9FD5,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, +0x10F3,0x0000,0x0000, 0xFBC0,0x9FDC,0x0000, 0x0218,0x0000,0x0000, +0x0218,0x0000,0x0000, 0x0218,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1100,0x0000,0x0000, 0x1100,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, +0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1100,0x0000,0x0000, +0x0214,0x0000,0x0000, 0x0214,0x0000,0x0000, 0x020C,0x0000,0x0000, +0xFBC0,0x9FF0,0x0000, 0xFBC0,0x9FF1,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0xFBC0,0x9FF5,0x0000, +0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x10FB,0x0000,0x0000, +0x10FB,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, +0x1109,0x0000,0x0000, 0x020D,0x0000,0x0000, 0x0218,0x0000,0x0000, +0xFBC0,0x9FFF,0x0000 }; + +uint16 page020data[]= { /* 2000 (5 weights per char) */ +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0225,0x0000,0x0000,0x0000,0x0000, +0x0225,0x0000,0x0000,0x0000,0x0000, +0x0226,0x0000,0x0000,0x0000,0x0000, +0x0227,0x0000,0x0000,0x0000,0x0000, +0x0228,0x0000,0x0000,0x0000,0x0000, +0x0229,0x0000,0x0000,0x0000,0x0000, +0x0432,0x0000,0x0000,0x0000,0x0000, +0x021C,0x0000,0x0000,0x0000,0x0000, +0x0278,0x0000,0x0000,0x0000,0x0000, +0x0279,0x0000,0x0000,0x0000,0x0000, +0x027A,0x0000,0x0000,0x0000,0x0000, +0x027B,0x0000,0x0000,0x0000,0x0000, +0x027F,0x0000,0x0000,0x0000,0x0000, +0x0280,0x0000,0x0000,0x0000,0x0000, +0x0281,0x0000,0x0000,0x0000,0x0000, +0x0282,0x0000,0x0000,0x0000,0x0000, +0x02D8,0x0000,0x0000,0x0000,0x0000, +0x02D9,0x0000,0x0000,0x0000,0x0000, +0x02DA,0x0000,0x0000,0x0000,0x0000, +0x02DB,0x0000,0x0000,0x0000,0x0000, +0x025D,0x0000,0x0000,0x0000,0x0000, +0x025D,0x025D,0x0000,0x0000,0x0000, +0x025D,0x025D,0x025D,0x0000,0x0000, +0x02DC,0x0000,0x0000,0x0000,0x0000, +0x0207,0x0000,0x0000,0x0000,0x0000, +0x0208,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x02D5,0x0000,0x0000,0x0000,0x0000, +0x02D6,0x0000,0x0000,0x0000,0x0000, +0x02E0,0x0000,0x0000,0x0000,0x0000, +0x02E0,0x02E0,0x0000,0x0000,0x0000, +0x02E0,0x02E0,0x02E0,0x0000,0x0000, +0x02E1,0x0000,0x0000,0x0000,0x0000, +0x02E1,0x02E1,0x0000,0x0000,0x0000, +0x02E1,0x02E1,0x02E1,0x0000,0x0000, +0x02E4,0x0000,0x0000,0x0000,0x0000, +0x027C,0x0000,0x0000,0x0000,0x0000, +0x027D,0x0000,0x0000,0x0000,0x0000, +0x02E5,0x0000,0x0000,0x0000,0x0000, +0x0251,0x0251,0x0000,0x0000,0x0000, +0x025C,0x0000,0x0000,0x0000,0x0000, +0x0211,0x0000,0x0000,0x0000,0x0000, +0x02E6,0x0000,0x0000,0x0000,0x0000, +0x02E8,0x0000,0x0000,0x0000,0x0000, +0x02EA,0x0000,0x0000,0x0000,0x0000, +0x02EB,0x0000,0x0000,0x0000,0x0000, +0x02DD,0x0000,0x0000,0x0000,0x0000, +0x02CD,0x0000,0x0000,0x0000,0x0000, +0x0294,0x0000,0x0000,0x0000,0x0000, +0x0295,0x0000,0x0000,0x0000,0x0000, +0x0255,0x0255,0x0000,0x0000,0x0000, +0x0255,0x0251,0x0000,0x0000,0x0000, +0x0251,0x0255,0x0000,0x0000,0x0000, +0x02D1,0x0000,0x0000,0x0000,0x0000, +0x02C4,0x0000,0x0000,0x0000,0x0000, +0x02DE,0x0000,0x0000,0x0000,0x0000, +0x02DF,0x0000,0x0000,0x0000,0x0000, +0x02C9,0x0000,0x0000,0x0000,0x0000, +0x023C,0x0000,0x0000,0x0000,0x0000, +0x02E9,0x0000,0x0000,0x0000,0x0000, +0x02CA,0x0000,0x0000,0x0000,0x0000, +0x02D7,0x0000,0x0000,0x0000,0x0000, +0x022A,0x0000,0x0000,0x0000,0x0000, +0x02E7,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA055,0x0000,0x0000,0x0000, +0xFBC0,0xA056,0x0000,0x0000,0x0000, +0x02E0,0x02E0,0x02E0,0x02E0,0x0000, +0xFBC0,0xA058,0x0000,0x0000,0x0000, +0xFBC0,0xA059,0x0000,0x0000,0x0000, +0xFBC0,0xA05A,0x0000,0x0000,0x0000, +0xFBC0,0xA05B,0x0000,0x0000,0x0000, +0xFBC0,0xA05C,0x0000,0x0000,0x0000, +0xFBC0,0xA05D,0x0000,0x0000,0x0000, +0xFBC0,0xA05E,0x0000,0x0000,0x0000, +0x0209,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA064,0x0000,0x0000,0x0000, +0xFBC0,0xA065,0x0000,0x0000,0x0000, +0xFBC0,0xA066,0x0000,0x0000,0x0000, +0xFBC0,0xA067,0x0000,0x0000,0x0000, +0xFBC0,0xA068,0x0000,0x0000,0x0000, +0xFBC0,0xA069,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E29,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA072,0x0000,0x0000,0x0000, +0xFBC0,0xA073,0x0000,0x0000,0x0000, +0x0E2D,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0x0000,0x0000,0x0000,0x0000, +0x0E30,0x0000,0x0000,0x0000,0x0000, +0x0E31,0x0000,0x0000,0x0000,0x0000, +0x0E32,0x0000,0x0000,0x0000,0x0000, +0x0428,0x0000,0x0000,0x0000,0x0000, +0x0434,0x0000,0x0000,0x0000,0x0000, +0x042D,0x0000,0x0000,0x0000,0x0000, +0x0288,0x0000,0x0000,0x0000,0x0000, +0x0289,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0000,0x0000,0x0000,0x0000, +0x0E29,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0x0000,0x0000,0x0000,0x0000, +0x0E30,0x0000,0x0000,0x0000,0x0000, +0x0E31,0x0000,0x0000,0x0000,0x0000, +0x0E32,0x0000,0x0000,0x0000,0x0000, +0x0428,0x0000,0x0000,0x0000,0x0000, +0x0434,0x0000,0x0000,0x0000,0x0000, +0x042D,0x0000,0x0000,0x0000,0x0000, +0x0288,0x0000,0x0000,0x0000,0x0000, +0x0289,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA08F,0x0000,0x0000,0x0000, +0xFBC0,0xA090,0x0000,0x0000,0x0000, +0xFBC0,0xA091,0x0000,0x0000,0x0000, +0xFBC0,0xA092,0x0000,0x0000,0x0000, +0xFBC0,0xA093,0x0000,0x0000,0x0000, +0xFBC0,0xA094,0x0000,0x0000,0x0000, +0xFBC0,0xA095,0x0000,0x0000,0x0000, +0xFBC0,0xA096,0x0000,0x0000,0x0000, +0xFBC0,0xA097,0x0000,0x0000,0x0000, +0xFBC0,0xA098,0x0000,0x0000,0x0000, +0xFBC0,0xA099,0x0000,0x0000,0x0000, +0xFBC0,0xA09A,0x0000,0x0000,0x0000, +0xFBC0,0xA09B,0x0000,0x0000,0x0000, +0xFBC0,0xA09C,0x0000,0x0000,0x0000, +0xFBC0,0xA09D,0x0000,0x0000,0x0000, +0xFBC0,0xA09E,0x0000,0x0000,0x0000, +0xFBC0,0xA09F,0x0000,0x0000,0x0000, +0x0E18,0x0000,0x0000,0x0000,0x0000, +0x0E19,0x0000,0x0000,0x0000,0x0000, +0x0E1A,0x0000,0x0000,0x0000,0x0000, +0x0E1B,0x0000,0x0000,0x0000,0x0000, +0x0E1C,0x0000,0x0000,0x0000,0x0000, +0x0E1D,0x0000,0x0000,0x0000,0x0000, +0x0E1E,0x0000,0x0000,0x0000,0x0000, +0x0E1F,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0FEA,0x0000,0x0000,0x0000, +0x0E20,0x0000,0x0000,0x0000,0x0000, +0x0E21,0x0000,0x0000,0x0000,0x0000, +0x0E22,0x0000,0x0000,0x0000,0x0000, +0x0E23,0x0000,0x0000,0x0000,0x0000, +0x0E24,0x0000,0x0000,0x0000,0x0000, +0x0E25,0x0000,0x0000,0x0000,0x0000, +0x0E26,0x0000,0x0000,0x0000,0x0000, +0x0E27,0x0000,0x0000,0x0000,0x0000, +0x0E28,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA0B2,0x0000,0x0000,0x0000, +0xFBC0,0xA0B3,0x0000,0x0000,0x0000, +0xFBC0,0xA0B4,0x0000,0x0000,0x0000, +0xFBC0,0xA0B5,0x0000,0x0000,0x0000, +0xFBC0,0xA0B6,0x0000,0x0000,0x0000, +0xFBC0,0xA0B7,0x0000,0x0000,0x0000, +0xFBC0,0xA0B8,0x0000,0x0000,0x0000, +0xFBC0,0xA0B9,0x0000,0x0000,0x0000, +0xFBC0,0xA0BA,0x0000,0x0000,0x0000, +0xFBC0,0xA0BB,0x0000,0x0000,0x0000, +0xFBC0,0xA0BC,0x0000,0x0000,0x0000, +0xFBC0,0xA0BD,0x0000,0x0000,0x0000, +0xFBC0,0xA0BE,0x0000,0x0000,0x0000, +0xFBC0,0xA0BF,0x0000,0x0000,0x0000, +0xFBC0,0xA0C0,0x0000,0x0000,0x0000, +0xFBC0,0xA0C1,0x0000,0x0000,0x0000, +0xFBC0,0xA0C2,0x0000,0x0000,0x0000, +0xFBC0,0xA0C3,0x0000,0x0000,0x0000, +0xFBC0,0xA0C4,0x0000,0x0000,0x0000, +0xFBC0,0xA0C5,0x0000,0x0000,0x0000, +0xFBC0,0xA0C6,0x0000,0x0000,0x0000, +0xFBC0,0xA0C7,0x0000,0x0000,0x0000, +0xFBC0,0xA0C8,0x0000,0x0000,0x0000, +0xFBC0,0xA0C9,0x0000,0x0000,0x0000, +0xFBC0,0xA0CA,0x0000,0x0000,0x0000, +0xFBC0,0xA0CB,0x0000,0x0000,0x0000, +0xFBC0,0xA0CC,0x0000,0x0000,0x0000, +0xFBC0,0xA0CD,0x0000,0x0000,0x0000, +0xFBC0,0xA0CE,0x0000,0x0000,0x0000, +0xFBC0,0xA0CF,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA0EB,0x0000,0x0000,0x0000, +0xFBC0,0xA0EC,0x0000,0x0000,0x0000, +0xFBC0,0xA0ED,0x0000,0x0000,0x0000, +0xFBC0,0xA0EE,0x0000,0x0000,0x0000, +0xFBC0,0xA0EF,0x0000,0x0000,0x0000, +0xFBC0,0xA0F0,0x0000,0x0000,0x0000, +0xFBC0,0xA0F1,0x0000,0x0000,0x0000, +0xFBC0,0xA0F2,0x0000,0x0000,0x0000, +0xFBC0,0xA0F3,0x0000,0x0000,0x0000, +0xFBC0,0xA0F4,0x0000,0x0000,0x0000, +0xFBC0,0xA0F5,0x0000,0x0000,0x0000, +0xFBC0,0xA0F6,0x0000,0x0000,0x0000, +0xFBC0,0xA0F7,0x0000,0x0000,0x0000, +0xFBC0,0xA0F8,0x0000,0x0000,0x0000, +0xFBC0,0xA0F9,0x0000,0x0000,0x0000, +0xFBC0,0xA0FA,0x0000,0x0000,0x0000, +0xFBC0,0xA0FB,0x0000,0x0000,0x0000, +0xFBC0,0xA0FC,0x0000,0x0000,0x0000, +0xFBC0,0xA0FD,0x0000,0x0000,0x0000, +0xFBC0,0xA0FE,0x0000,0x0000,0x0000, +0xFBC0,0xA0FF,0x0000,0x0000,0x0000 +}; + +uint16 page021data[]= { /* 2100 (5 weights per char) */ +0x0E33,0x02CC,0x0E60,0x0000,0x0000, +0x0E33,0x02CC,0x0FEA,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000,0x0000, +0x034A,0x0E60,0x0000,0x0000,0x0000, +0x039B,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x02CC,0x0F82,0x0000,0x0000, +0x0E60,0x02CC,0x101F,0x0000,0x0000, +0x0E98,0x0000,0x0000,0x0000,0x0000, +0x039C,0x0000,0x0000,0x0000,0x0000, +0x034A,0x0EB9,0x0000,0x0000,0x0000, +0x0EC1,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000,0x0000, +0x0EED,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000,0x0000, +0x039D,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0F82,0x0000,0x0000,0x0000, +0x039E,0x0000,0x0000,0x0000,0x0000, +0x039F,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0000,0x0000,0x0000,0x0000, +0x0FB4,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000,0x0000, +0x03A0,0x0000,0x0000,0x0000,0x0000, +0x03A1,0x0000,0x0000,0x0000,0x0000, +0x0FEA,0x0F5B,0x0000,0x0000,0x0000, +0x1002,0x0E8B,0x0F2E,0x0000,0x0000, +0x1002,0x0F5B,0x0000,0x0000,0x0000, +0x03A2,0x0000,0x0000,0x0000,0x0000, +0x106A,0x0000,0x0000,0x0000,0x0000, +0x03A3,0x0000,0x0000,0x0000,0x0000, +0x1109,0x0000,0x0000,0x0000,0x0000, +0x03A4,0x0000,0x0000,0x0000,0x0000, +0x106A,0x0000,0x0000,0x0000,0x0000, +0x03A5,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0000,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000,0x0000, +0x0E4A,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000,0x0000, +0x03A6,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000,0x0000, +0x0EB9,0x0000,0x0000,0x0000,0x0000, +0x03A7,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0000,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000,0x0000, +0x1331,0x0000,0x0000,0x0000,0x0000, +0x1332,0x0000,0x0000,0x0000,0x0000, +0x1333,0x0000,0x0000,0x0000,0x0000, +0x1334,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x03A8,0x0000,0x0000,0x0000,0x0000, +0x0EB9,0x0E33,0x105A,0x0000,0x0000, +0xFBC0,0xA13C,0x0000,0x0000,0x0000, +0x10EA,0x0000,0x0000,0x0000,0x0000, +0x10EA,0x0000,0x0000,0x0000,0x0000, +0x10FC,0x0000,0x0000,0x0000,0x0000, +0x0427,0x0000,0x0000,0x0000,0x0000, +0x03A9,0x0000,0x0000,0x0000,0x0000, +0x03AA,0x0000,0x0000,0x0000,0x0000, +0x03AB,0x0000,0x0000,0x0000,0x0000, +0x03AC,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0F10,0x0000,0x0000,0x0000,0x0000, +0x03AD,0x0000,0x0000,0x0000,0x0000, +0x02D0,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA14C,0x0000,0x0000,0x0000, +0xFBC0,0xA14D,0x0000,0x0000,0x0000, +0xFBC0,0xA14E,0x0000,0x0000,0x0000, +0xFBC0,0xA14F,0x0000,0x0000,0x0000, +0xFBC0,0xA150,0x0000,0x0000,0x0000, +0xFBC0,0xA151,0x0000,0x0000,0x0000, +0xFBC0,0xA152,0x0000,0x0000,0x0000, +0x0E2A,0x02CD,0x0E2C,0x0000,0x0000, +0x0E2B,0x02CD,0x0E2C,0x0000,0x0000, +0x0E2A,0x02CD,0x0E2E,0x0000,0x0000, +0x0E2B,0x02CD,0x0E2E,0x0000,0x0000, +0x0E2C,0x02CD,0x0E2E,0x0000,0x0000, +0x0E2D,0x02CD,0x0E2E,0x0000,0x0000, +0x0E2A,0x02CD,0x0E2F,0x0000,0x0000, +0x0E2E,0x02CD,0x0E2F,0x0000,0x0000, +0x0E2A,0x02CD,0x0E31,0x0000,0x0000, +0x0E2C,0x02CD,0x0E31,0x0000,0x0000, +0x0E2E,0x02CD,0x0E31,0x0000,0x0000, +0x0E30,0x02CD,0x0E31,0x0000,0x0000, +0x0E2A,0x02CD,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0EFB,0x0000,0x0000,0x0000, +0x0EFB,0x0EFB,0x0EFB,0x0000,0x0000, +0x0EFB,0x1044,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000,0x0000, +0x1044,0x0EFB,0x0000,0x0000,0x0000, +0x1044,0x0EFB,0x0EFB,0x0000,0x0000, +0x1044,0x0EFB,0x0EFB,0x0EFB,0x0000, +0x0EFB,0x105A,0x0000,0x0000,0x0000, +0x105A,0x0000,0x0000,0x0000,0x0000, +0x105A,0x0EFB,0x0000,0x0000,0x0000, +0x105A,0x0EFB,0x0EFB,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0EFB,0x0000,0x0000,0x0000, +0x0EFB,0x0EFB,0x0EFB,0x0000,0x0000, +0x0EFB,0x1044,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000,0x0000, +0x1044,0x0EFB,0x0000,0x0000,0x0000, +0x1044,0x0EFB,0x0EFB,0x0000,0x0000, +0x1044,0x0EFB,0x0EFB,0x0EFB,0x0000, +0x0EFB,0x105A,0x0000,0x0000,0x0000, +0x105A,0x0000,0x0000,0x0000,0x0000, +0x105A,0x0EFB,0x0000,0x0000,0x0000, +0x105A,0x0EFB,0x0EFB,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0000,0x0000,0x0000,0x0000, +0x0DD7,0x0000,0x0000,0x0000,0x0000, +0x0DD8,0x0000,0x0000,0x0000,0x0000, +0x0DD9,0x0000,0x0000,0x0000,0x0000, +0x0DDA,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA184,0x0000,0x0000,0x0000, +0xFBC0,0xA185,0x0000,0x0000,0x0000, +0xFBC0,0xA186,0x0000,0x0000,0x0000, +0xFBC0,0xA187,0x0000,0x0000,0x0000, +0xFBC0,0xA188,0x0000,0x0000,0x0000, +0xFBC0,0xA189,0x0000,0x0000,0x0000, +0xFBC0,0xA18A,0x0000,0x0000,0x0000, +0xFBC0,0xA18B,0x0000,0x0000,0x0000, +0xFBC0,0xA18C,0x0000,0x0000,0x0000, +0xFBC0,0xA18D,0x0000,0x0000,0x0000, +0xFBC0,0xA18E,0x0000,0x0000,0x0000, +0xFBC0,0xA18F,0x0000,0x0000,0x0000, +0x03AE,0x0000,0x0000,0x0000,0x0000, +0x03B0,0x0000,0x0000,0x0000,0x0000, +0x03AF,0x0000,0x0000,0x0000,0x0000, +0x03B1,0x0000,0x0000,0x0000,0x0000, +0x03B2,0x0000,0x0000,0x0000,0x0000, +0x03B3,0x0000,0x0000,0x0000,0x0000, +0x03B4,0x0000,0x0000,0x0000,0x0000, +0x03B5,0x0000,0x0000,0x0000,0x0000, +0x03B6,0x0000,0x0000,0x0000,0x0000, +0x03B7,0x0000,0x0000,0x0000,0x0000, +0x03AE,0x0000,0x0000,0x0000,0x0000, +0x03AF,0x0000,0x0000,0x0000,0x0000, +0x03B8,0x0000,0x0000,0x0000,0x0000, +0x03B9,0x0000,0x0000,0x0000,0x0000, +0x03BA,0x0000,0x0000,0x0000,0x0000, +0x03BB,0x0000,0x0000,0x0000,0x0000, +0x03BC,0x0000,0x0000,0x0000,0x0000, +0x03BD,0x0000,0x0000,0x0000,0x0000, +0x03BE,0x0000,0x0000,0x0000,0x0000, +0x03BF,0x0000,0x0000,0x0000,0x0000, +0x03C0,0x0000,0x0000,0x0000,0x0000, +0x03C1,0x0000,0x0000,0x0000,0x0000, +0x03C2,0x0000,0x0000,0x0000,0x0000, +0x03C3,0x0000,0x0000,0x0000,0x0000, +0x03C4,0x0000,0x0000,0x0000,0x0000, +0x03C5,0x0000,0x0000,0x0000,0x0000, +0x03C6,0x0000,0x0000,0x0000,0x0000, +0x03C7,0x0000,0x0000,0x0000,0x0000, +0x03C8,0x0000,0x0000,0x0000,0x0000, +0x03C9,0x0000,0x0000,0x0000,0x0000, +0x03B2,0x0000,0x0000,0x0000,0x0000, +0x03CA,0x0000,0x0000,0x0000,0x0000, +0x03CB,0x0000,0x0000,0x0000,0x0000, +0x03CC,0x0000,0x0000,0x0000,0x0000, +0x03CD,0x0000,0x0000,0x0000,0x0000, +0x03CE,0x0000,0x0000,0x0000,0x0000, +0x03CF,0x0000,0x0000,0x0000,0x0000, +0x03D0,0x0000,0x0000,0x0000,0x0000, +0x03D1,0x0000,0x0000,0x0000,0x0000, +0x03D2,0x0000,0x0000,0x0000,0x0000, +0x03D3,0x0000,0x0000,0x0000,0x0000, +0x03D4,0x0000,0x0000,0x0000,0x0000, +0x03D5,0x0000,0x0000,0x0000,0x0000, +0x03D6,0x0000,0x0000,0x0000,0x0000, +0x03D7,0x0000,0x0000,0x0000,0x0000, +0x03D8,0x0000,0x0000,0x0000,0x0000, +0x03D9,0x0000,0x0000,0x0000,0x0000, +0x03DA,0x0000,0x0000,0x0000,0x0000, +0x03DB,0x0000,0x0000,0x0000,0x0000, +0x03DC,0x0000,0x0000,0x0000,0x0000, +0x03DD,0x0000,0x0000,0x0000,0x0000, +0x03DE,0x0000,0x0000,0x0000,0x0000, +0x03DF,0x0000,0x0000,0x0000,0x0000, +0x03E0,0x0000,0x0000,0x0000,0x0000, +0x03E1,0x0000,0x0000,0x0000,0x0000, +0x03E2,0x0000,0x0000,0x0000,0x0000, +0x03E3,0x0000,0x0000,0x0000,0x0000, +0x03E4,0x0000,0x0000,0x0000,0x0000, +0x03E5,0x0000,0x0000,0x0000,0x0000, +0x03E6,0x0000,0x0000,0x0000,0x0000, +0x03E7,0x0000,0x0000,0x0000,0x0000, +0x03E8,0x0000,0x0000,0x0000,0x0000, +0x03EC,0x0000,0x0000,0x0000,0x0000, +0x03EA,0x0000,0x0000,0x0000,0x0000, +0x03E8,0x0000,0x0000,0x0000,0x0000, +0x03E9,0x0000,0x0000,0x0000,0x0000, +0x03EA,0x0000,0x0000,0x0000,0x0000, +0x03EB,0x0000,0x0000,0x0000,0x0000, +0x03EC,0x0000,0x0000,0x0000,0x0000, +0x03ED,0x0000,0x0000,0x0000,0x0000, +0x03EE,0x0000,0x0000,0x0000,0x0000, +0x03EF,0x0000,0x0000,0x0000,0x0000, +0x03F0,0x0000,0x0000,0x0000,0x0000, +0x03F1,0x0000,0x0000,0x0000,0x0000, +0x03F2,0x0000,0x0000,0x0000,0x0000, +0x03F3,0x0000,0x0000,0x0000,0x0000, +0x03F4,0x0000,0x0000,0x0000,0x0000, +0x03F5,0x0000,0x0000,0x0000,0x0000, +0x03F6,0x0000,0x0000,0x0000,0x0000, +0x03F7,0x0000,0x0000,0x0000,0x0000, +0x03F8,0x0000,0x0000,0x0000,0x0000, +0x03F9,0x0000,0x0000,0x0000,0x0000, +0x03FA,0x0000,0x0000,0x0000,0x0000, +0x03FB,0x0000,0x0000,0x0000,0x0000, +0x03FC,0x0000,0x0000,0x0000,0x0000, +0x03FD,0x0000,0x0000,0x0000,0x0000, +0x03FE,0x0000,0x0000,0x0000,0x0000, +0x03FF,0x0000,0x0000,0x0000,0x0000, +0x0400,0x0000,0x0000,0x0000,0x0000, +0x0401,0x0000,0x0000,0x0000,0x0000, +0x0402,0x0000,0x0000,0x0000,0x0000, +0x0403,0x0000,0x0000,0x0000,0x0000, +0x0404,0x0000,0x0000,0x0000,0x0000, +0x0405,0x0000,0x0000,0x0000,0x0000, +0x0406,0x0000,0x0000,0x0000,0x0000, +0x0407,0x0000,0x0000,0x0000,0x0000, +0x0408,0x0000,0x0000,0x0000,0x0000, +0x0409,0x0000,0x0000,0x0000,0x0000, +0x040A,0x0000,0x0000,0x0000,0x0000, +0x040B,0x0000,0x0000,0x0000,0x0000, +0x040C,0x0000,0x0000,0x0000,0x0000, +0x040D,0x0000,0x0000,0x0000,0x0000, +0x040E,0x0000,0x0000,0x0000,0x0000, +0x040F,0x0000,0x0000,0x0000,0x0000, +0x0410,0x0000,0x0000,0x0000,0x0000, +0x0411,0x0000,0x0000,0x0000,0x0000, +0x0412,0x0000,0x0000,0x0000,0x0000, +0x0413,0x0000,0x0000,0x0000,0x0000, +0x0414,0x0000,0x0000,0x0000,0x0000, +0x0415,0x0000,0x0000,0x0000,0x0000, +0x0416,0x0000,0x0000,0x0000,0x0000, +0x0417,0x0000,0x0000,0x0000,0x0000 +}; + +uint16 page022data[]= { /* 2200 (4 weights per char) */ +0x0418,0x0000,0x0000,0x0000, 0x0419,0x0000,0x0000,0x0000, +0x041A,0x0000,0x0000,0x0000, 0x041B,0x0000,0x0000,0x0000, +0x041B,0x0000,0x0000,0x0000, 0x041C,0x0000,0x0000,0x0000, +0x041D,0x0000,0x0000,0x0000, 0x041E,0x0000,0x0000,0x0000, +0x041F,0x0000,0x0000,0x0000, 0x041F,0x0000,0x0000,0x0000, +0x0420,0x0000,0x0000,0x0000, 0x0421,0x0000,0x0000,0x0000, +0x0421,0x0000,0x0000,0x0000, 0x0422,0x0000,0x0000,0x0000, +0x0424,0x0000,0x0000,0x0000, 0x0425,0x0000,0x0000,0x0000, +0x0426,0x0000,0x0000,0x0000, 0x0427,0x0000,0x0000,0x0000, +0x0434,0x0000,0x0000,0x0000, 0x0435,0x0000,0x0000,0x0000, +0x0436,0x0000,0x0000,0x0000, 0x0437,0x0000,0x0000,0x0000, +0x0438,0x0000,0x0000,0x0000, 0x0439,0x0000,0x0000,0x0000, +0x043A,0x0000,0x0000,0x0000, 0x043B,0x0000,0x0000,0x0000, +0x043C,0x0000,0x0000,0x0000, 0x043D,0x0000,0x0000,0x0000, +0x043E,0x0000,0x0000,0x0000, 0x043F,0x0000,0x0000,0x0000, +0x0440,0x0000,0x0000,0x0000, 0x0441,0x0000,0x0000,0x0000, +0x0442,0x0000,0x0000,0x0000, 0x0443,0x0000,0x0000,0x0000, +0x0444,0x0000,0x0000,0x0000, 0x0445,0x0000,0x0000,0x0000, +0x0445,0x0000,0x0000,0x0000, 0x0446,0x0000,0x0000,0x0000, +0x0446,0x0000,0x0000,0x0000, 0x0447,0x0000,0x0000,0x0000, +0x0448,0x0000,0x0000,0x0000, 0x0449,0x0000,0x0000,0x0000, +0x044A,0x0000,0x0000,0x0000, 0x044B,0x0000,0x0000,0x0000, +0x044B,0x044B,0x0000,0x0000, 0x044B,0x044B,0x044B,0x0000, +0x044C,0x0000,0x0000,0x0000, 0x044C,0x044C,0x0000,0x0000, +0x044C,0x044C,0x044C,0x0000, 0x044D,0x0000,0x0000,0x0000, +0x044E,0x0000,0x0000,0x0000, 0x044F,0x0000,0x0000,0x0000, +0x0450,0x0000,0x0000,0x0000, 0x0451,0x0000,0x0000,0x0000, +0x0452,0x0000,0x0000,0x0000, 0x0453,0x0000,0x0000,0x0000, +0x0454,0x0000,0x0000,0x0000, 0x0455,0x0000,0x0000,0x0000, +0x0456,0x0000,0x0000,0x0000, 0x0457,0x0000,0x0000,0x0000, +0x0458,0x0000,0x0000,0x0000, 0x0459,0x0000,0x0000,0x0000, +0x045A,0x0000,0x0000,0x0000, 0x045B,0x0000,0x0000,0x0000, +0x045C,0x0000,0x0000,0x0000, 0x0458,0x0000,0x0000,0x0000, +0x045D,0x0000,0x0000,0x0000, 0x045E,0x0000,0x0000,0x0000, +0x045E,0x0000,0x0000,0x0000, 0x045F,0x0000,0x0000,0x0000, +0x0460,0x0000,0x0000,0x0000, 0x045F,0x0000,0x0000,0x0000, +0x0461,0x0000,0x0000,0x0000, 0x0461,0x0000,0x0000,0x0000, +0x0462,0x0000,0x0000,0x0000, 0x0463,0x0000,0x0000,0x0000, +0x0464,0x0000,0x0000,0x0000, 0x0465,0x0000,0x0000,0x0000, +0x0466,0x0000,0x0000,0x0000, 0x0467,0x0000,0x0000,0x0000, +0x0468,0x0000,0x0000,0x0000, 0x0469,0x0000,0x0000,0x0000, +0x046A,0x0000,0x0000,0x0000, 0x046B,0x0000,0x0000,0x0000, +0x046C,0x0000,0x0000,0x0000, 0x046D,0x0000,0x0000,0x0000, +0x046E,0x0000,0x0000,0x0000, 0x046F,0x0000,0x0000,0x0000, +0x0470,0x0000,0x0000,0x0000, 0x0471,0x0000,0x0000,0x0000, +0x0472,0x0000,0x0000,0x0000, 0x0473,0x0000,0x0000,0x0000, +0x0474,0x0000,0x0000,0x0000, 0x0475,0x0000,0x0000,0x0000, +0x0476,0x0000,0x0000,0x0000, 0x0477,0x0000,0x0000,0x0000, +0x042D,0x0000,0x0000,0x0000, 0x0478,0x0000,0x0000,0x0000, +0x0478,0x0000,0x0000,0x0000, 0x0479,0x0000,0x0000,0x0000, +0x047A,0x0000,0x0000,0x0000, 0x047B,0x0000,0x0000,0x0000, +0x047C,0x0000,0x0000,0x0000, 0x047D,0x0000,0x0000,0x0000, +0x047E,0x0000,0x0000,0x0000, 0x047F,0x0000,0x0000,0x0000, +0x0480,0x0000,0x0000,0x0000, 0x0481,0x0000,0x0000,0x0000, +0x0482,0x0000,0x0000,0x0000, 0x0465,0x0000,0x0000,0x0000, +0x042C,0x0000,0x0000,0x0000, 0x042E,0x0000,0x0000,0x0000, +0x047A,0x0000,0x0000,0x0000, 0x047B,0x0000,0x0000,0x0000, +0x0483,0x0000,0x0000,0x0000, 0x0484,0x0000,0x0000,0x0000, +0x0483,0x0000,0x0000,0x0000, 0x0484,0x0000,0x0000,0x0000, +0x0485,0x0000,0x0000,0x0000, 0x0486,0x0000,0x0000,0x0000, +0x0485,0x0000,0x0000,0x0000, 0x0486,0x0000,0x0000,0x0000, +0x0487,0x0000,0x0000,0x0000, 0x0488,0x0000,0x0000,0x0000, +0x0489,0x0000,0x0000,0x0000, 0x048A,0x0000,0x0000,0x0000, +0x048B,0x0000,0x0000,0x0000, 0x048C,0x0000,0x0000,0x0000, +0x0487,0x0000,0x0000,0x0000, 0x0488,0x0000,0x0000,0x0000, +0x048D,0x0000,0x0000,0x0000, 0x048E,0x0000,0x0000,0x0000, +0x048D,0x0000,0x0000,0x0000, 0x048E,0x0000,0x0000,0x0000, +0x048F,0x0000,0x0000,0x0000, 0x0490,0x0000,0x0000,0x0000, +0x048F,0x0000,0x0000,0x0000, 0x0490,0x0000,0x0000,0x0000, +0x0491,0x0000,0x0000,0x0000, 0x0492,0x0000,0x0000,0x0000, +0x0493,0x0000,0x0000,0x0000, 0x0494,0x0000,0x0000,0x0000, +0x0495,0x0000,0x0000,0x0000, 0x0496,0x0000,0x0000,0x0000, +0x0497,0x0000,0x0000,0x0000, 0x0498,0x0000,0x0000,0x0000, +0x0499,0x0000,0x0000,0x0000, 0x049A,0x0000,0x0000,0x0000, +0x049B,0x0000,0x0000,0x0000, 0x049C,0x0000,0x0000,0x0000, +0x049D,0x0000,0x0000,0x0000, 0x049E,0x0000,0x0000,0x0000, +0x049F,0x0000,0x0000,0x0000, 0x04A0,0x0000,0x0000,0x0000, +0x04A1,0x0000,0x0000,0x0000, 0x04A2,0x0000,0x0000,0x0000, +0x04A3,0x0000,0x0000,0x0000, 0x04A4,0x0000,0x0000,0x0000, +0x04A5,0x0000,0x0000,0x0000, 0x04A6,0x0000,0x0000,0x0000, +0x04A7,0x0000,0x0000,0x0000, 0x04A8,0x0000,0x0000,0x0000, +0x04A9,0x0000,0x0000,0x0000, 0x04AA,0x0000,0x0000,0x0000, +0x04AB,0x0000,0x0000,0x0000, 0x04AC,0x0000,0x0000,0x0000, +0x04AD,0x0000,0x0000,0x0000, 0x04AE,0x0000,0x0000,0x0000, +0x04AF,0x0000,0x0000,0x0000, 0x04B0,0x0000,0x0000,0x0000, +0x04B1,0x0000,0x0000,0x0000, 0x04B2,0x0000,0x0000,0x0000, +0x04A9,0x0000,0x0000,0x0000, 0x04AF,0x0000,0x0000,0x0000, +0x04B0,0x0000,0x0000,0x0000, 0x04B2,0x0000,0x0000,0x0000, +0x04B3,0x0000,0x0000,0x0000, 0x04B4,0x0000,0x0000,0x0000, +0x04B5,0x0000,0x0000,0x0000, 0x04B6,0x0000,0x0000,0x0000, +0x04B7,0x0000,0x0000,0x0000, 0x04B8,0x0000,0x0000,0x0000, +0x04B9,0x0000,0x0000,0x0000, 0x04BA,0x0000,0x0000,0x0000, +0x04BB,0x0000,0x0000,0x0000, 0x04BC,0x0000,0x0000,0x0000, +0x04BD,0x0000,0x0000,0x0000, 0x04BE,0x0000,0x0000,0x0000, +0x04BF,0x0000,0x0000,0x0000, 0x04C0,0x0000,0x0000,0x0000, +0x04C1,0x0000,0x0000,0x0000, 0x04C2,0x0000,0x0000,0x0000, +0x04C3,0x0000,0x0000,0x0000, 0x04C4,0x0000,0x0000,0x0000, +0x04C5,0x0000,0x0000,0x0000, 0x04C6,0x0000,0x0000,0x0000, +0x04C7,0x0000,0x0000,0x0000, 0x04C8,0x0000,0x0000,0x0000, +0x04C9,0x0000,0x0000,0x0000, 0x04CA,0x0000,0x0000,0x0000, +0x04CB,0x0000,0x0000,0x0000, 0x04CC,0x0000,0x0000,0x0000, +0x04CD,0x0000,0x0000,0x0000, 0x04CE,0x0000,0x0000,0x0000, +0x04CF,0x0000,0x0000,0x0000, 0x04D0,0x0000,0x0000,0x0000, +0x04D1,0x0000,0x0000,0x0000, 0x04D2,0x0000,0x0000,0x0000, +0x04D3,0x0000,0x0000,0x0000, 0x04D4,0x0000,0x0000,0x0000, +0x04D5,0x0000,0x0000,0x0000, 0x04D6,0x0000,0x0000,0x0000, +0x04D7,0x0000,0x0000,0x0000, 0x04D8,0x0000,0x0000,0x0000, +0x04D9,0x0000,0x0000,0x0000, 0x04DA,0x0000,0x0000,0x0000, +0x04DB,0x0000,0x0000,0x0000, 0x04DC,0x0000,0x0000,0x0000, +0x04DD,0x0000,0x0000,0x0000, 0x04DE,0x0000,0x0000,0x0000, +0x04DF,0x0000,0x0000,0x0000, 0x04E0,0x0000,0x0000,0x0000, +0x04E1,0x0000,0x0000,0x0000, 0x04E2,0x0000,0x0000,0x0000, +0x0489,0x0000,0x0000,0x0000, 0x048A,0x0000,0x0000,0x0000, +0x0498,0x0000,0x0000,0x0000, 0x0499,0x0000,0x0000,0x0000, +0x04E3,0x0000,0x0000,0x0000, 0x04E4,0x0000,0x0000,0x0000, +0x04E5,0x0000,0x0000,0x0000, 0x04E6,0x0000,0x0000,0x0000, +0x04E7,0x0000,0x0000,0x0000, 0x04E8,0x0000,0x0000,0x0000, +0x04B5,0x0000,0x0000,0x0000, 0x04B6,0x0000,0x0000,0x0000, +0x04B7,0x0000,0x0000,0x0000, 0x04B8,0x0000,0x0000,0x0000, +0x04E9,0x0000,0x0000,0x0000, 0x04EA,0x0000,0x0000,0x0000, +0x04EB,0x0000,0x0000,0x0000, 0x04EC,0x0000,0x0000,0x0000, +0x04ED,0x0000,0x0000,0x0000, 0x04EE,0x0000,0x0000,0x0000, +0x04EF,0x0000,0x0000,0x0000, 0x04F0,0x0000,0x0000,0x0000, +0x04F1,0x0000,0x0000,0x0000, 0x04F2,0x0000,0x0000,0x0000, +0x04F3,0x0000,0x0000,0x0000, 0x04F4,0x0000,0x0000,0x0000, +0x04F5,0x0000,0x0000,0x0000, 0x04F6,0x0000,0x0000,0x0000, +0x04F7,0x0000,0x0000,0x0000, 0x04F8,0x0000,0x0000,0x0000, +0x04F9,0x0000,0x0000,0x0000, 0x04FA,0x0000,0x0000,0x0000 +}; + +uint16 page023data[]= { /* 2300 (3 weights per char) */ +0x04FB,0x0000,0x0000, 0x04FC,0x0000,0x0000, 0x04FD,0x0000,0x0000, +0x04FE,0x0000,0x0000, 0x04FF,0x0000,0x0000, 0x0500,0x0000,0x0000, +0x0501,0x0000,0x0000, 0x0502,0x0000,0x0000, 0x0503,0x0000,0x0000, +0x0504,0x0000,0x0000, 0x0505,0x0000,0x0000, 0x0506,0x0000,0x0000, +0x0507,0x0000,0x0000, 0x0508,0x0000,0x0000, 0x0509,0x0000,0x0000, +0x050A,0x0000,0x0000, 0x050B,0x0000,0x0000, 0x050C,0x0000,0x0000, +0x050D,0x0000,0x0000, 0x050E,0x0000,0x0000, 0x050F,0x0000,0x0000, +0x0510,0x0000,0x0000, 0x0511,0x0000,0x0000, 0x0512,0x0000,0x0000, +0x0513,0x0000,0x0000, 0x0514,0x0000,0x0000, 0x0515,0x0000,0x0000, +0x0516,0x0000,0x0000, 0x0517,0x0000,0x0000, 0x0518,0x0000,0x0000, +0x0519,0x0000,0x0000, 0x051A,0x0000,0x0000, 0x051B,0x0000,0x0000, +0x051C,0x0000,0x0000, 0x051D,0x0000,0x0000, 0x051E,0x0000,0x0000, +0x051F,0x0000,0x0000, 0x0520,0x0000,0x0000, 0x0521,0x0000,0x0000, +0x0522,0x0000,0x0000, 0x0523,0x0000,0x0000, 0x02AE,0x0000,0x0000, +0x02AF,0x0000,0x0000, 0x0524,0x0000,0x0000, 0x0525,0x0000,0x0000, +0x0526,0x0000,0x0000, 0x0527,0x0000,0x0000, 0x0528,0x0000,0x0000, +0x0529,0x0000,0x0000, 0x052A,0x0000,0x0000, 0x052B,0x0000,0x0000, +0x052C,0x0000,0x0000, 0x052D,0x0000,0x0000, 0x052E,0x0000,0x0000, +0x052F,0x0000,0x0000, 0x0530,0x0000,0x0000, 0x0531,0x0000,0x0000, +0x0532,0x0000,0x0000, 0x0533,0x0000,0x0000, 0x0534,0x0000,0x0000, +0x0535,0x0000,0x0000, 0x0536,0x0000,0x0000, 0x0537,0x0000,0x0000, +0x0538,0x0000,0x0000, 0x0539,0x0000,0x0000, 0x053A,0x0000,0x0000, +0x053B,0x0000,0x0000, 0x053C,0x0000,0x0000, 0x053D,0x0000,0x0000, +0x053E,0x0000,0x0000, 0x053F,0x0000,0x0000, 0x0540,0x0000,0x0000, +0x0541,0x0000,0x0000, 0x0542,0x0000,0x0000, 0x0543,0x0000,0x0000, +0x0544,0x0000,0x0000, 0x0545,0x0000,0x0000, 0x0546,0x0000,0x0000, +0x0547,0x0000,0x0000, 0x0548,0x0000,0x0000, 0x0549,0x0000,0x0000, +0x054A,0x0000,0x0000, 0x054B,0x0000,0x0000, 0x054C,0x0000,0x0000, +0x054D,0x0000,0x0000, 0x054E,0x0000,0x0000, 0x054F,0x0000,0x0000, +0x0550,0x0000,0x0000, 0x0551,0x0000,0x0000, 0x0552,0x0000,0x0000, +0x0553,0x0000,0x0000, 0x0554,0x0000,0x0000, 0x0555,0x0000,0x0000, +0x0556,0x0000,0x0000, 0x0557,0x0000,0x0000, 0x0558,0x0000,0x0000, +0x0559,0x0000,0x0000, 0x055A,0x0000,0x0000, 0x055B,0x0000,0x0000, +0x055C,0x0000,0x0000, 0x055D,0x0000,0x0000, 0x055E,0x0000,0x0000, +0x055F,0x0000,0x0000, 0x0560,0x0000,0x0000, 0x0561,0x0000,0x0000, +0x0562,0x0000,0x0000, 0x0563,0x0000,0x0000, 0x0564,0x0000,0x0000, +0x0565,0x0000,0x0000, 0x0566,0x0000,0x0000, 0x0567,0x0000,0x0000, +0x0568,0x0000,0x0000, 0x0569,0x0000,0x0000, 0x056A,0x0000,0x0000, +0x056B,0x0000,0x0000, 0x056C,0x0000,0x0000, 0x056D,0x0000,0x0000, +0x056E,0x0000,0x0000, 0x056F,0x0000,0x0000, 0x0570,0x0000,0x0000, +0x0571,0x0000,0x0000, 0x0572,0x0000,0x0000, 0x0573,0x0000,0x0000, +0x0574,0x0000,0x0000, 0x0575,0x0000,0x0000, 0x0576,0x0000,0x0000, +0x0577,0x0000,0x0000, 0x0578,0x0000,0x0000, 0x0579,0x0000,0x0000, +0x057A,0x0000,0x0000, 0x057B,0x0000,0x0000, 0x057C,0x0000,0x0000, +0x057D,0x0000,0x0000, 0x057E,0x0000,0x0000, 0x057F,0x0000,0x0000, +0x0580,0x0000,0x0000, 0x0581,0x0000,0x0000, 0x0582,0x0000,0x0000, +0x0583,0x0000,0x0000, 0x0584,0x0000,0x0000, 0x0585,0x0000,0x0000, +0x0586,0x0000,0x0000, 0x0587,0x0000,0x0000, 0x0588,0x0000,0x0000, +0x0589,0x0000,0x0000, 0x058A,0x0000,0x0000, 0x058B,0x0000,0x0000, +0x058C,0x0000,0x0000, 0x058D,0x0000,0x0000, 0x058E,0x0000,0x0000, +0x058F,0x0000,0x0000, 0x0590,0x0000,0x0000, 0x0591,0x0000,0x0000, +0x0592,0x0000,0x0000, 0x0593,0x0000,0x0000, 0x0594,0x0000,0x0000, +0x0595,0x0000,0x0000, 0x0596,0x0000,0x0000, 0x0597,0x0000,0x0000, +0x0598,0x0000,0x0000, 0x0599,0x0000,0x0000, 0x059A,0x0000,0x0000, +0x059B,0x0000,0x0000, 0x059C,0x0000,0x0000, 0x059D,0x0000,0x0000, +0x059E,0x0000,0x0000, 0x059F,0x0000,0x0000, 0x05A0,0x0000,0x0000, +0x05A1,0x0000,0x0000, 0x05A2,0x0000,0x0000, 0x05A3,0x0000,0x0000, +0x05A4,0x0000,0x0000, 0x05A5,0x0000,0x0000, 0x05A6,0x0000,0x0000, +0x05A7,0x0000,0x0000, 0x05A8,0x0000,0x0000, 0x05A9,0x0000,0x0000, +0x05AA,0x0000,0x0000, 0x05AB,0x0000,0x0000, 0x05AC,0x0000,0x0000, +0x05AD,0x0000,0x0000, 0x05AE,0x0000,0x0000, 0x05AF,0x0000,0x0000, +0x05B0,0x0000,0x0000, 0x05B1,0x0000,0x0000, 0x05B2,0x0000,0x0000, +0x05B3,0x0000,0x0000, 0x05B4,0x0000,0x0000, 0x05B5,0x0000,0x0000, +0x05B6,0x0000,0x0000, 0x05B7,0x0000,0x0000, 0x05B8,0x0000,0x0000, +0x05B9,0x0000,0x0000, 0x05BA,0x0000,0x0000, 0x05BB,0x0000,0x0000, +0x05BC,0x0000,0x0000, 0x05BD,0x0000,0x0000, 0x05BE,0x0000,0x0000, +0x05BF,0x0000,0x0000, 0x05C0,0x0000,0x0000, 0x05C1,0x0000,0x0000, +0x05C2,0x0000,0x0000, 0x05C3,0x0000,0x0000, 0x05C4,0x0000,0x0000, +0x05C5,0x0000,0x0000, 0x05C6,0x0000,0x0000, 0x05C7,0x0000,0x0000, +0x05C8,0x0000,0x0000, 0x05C9,0x0000,0x0000, 0xFBC0,0xA3D1,0x0000, +0xFBC0,0xA3D2,0x0000, 0xFBC0,0xA3D3,0x0000, 0xFBC0,0xA3D4,0x0000, +0xFBC0,0xA3D5,0x0000, 0xFBC0,0xA3D6,0x0000, 0xFBC0,0xA3D7,0x0000, +0xFBC0,0xA3D8,0x0000, 0xFBC0,0xA3D9,0x0000, 0xFBC0,0xA3DA,0x0000, +0xFBC0,0xA3DB,0x0000, 0xFBC0,0xA3DC,0x0000, 0xFBC0,0xA3DD,0x0000, +0xFBC0,0xA3DE,0x0000, 0xFBC0,0xA3DF,0x0000, 0xFBC0,0xA3E0,0x0000, +0xFBC0,0xA3E1,0x0000, 0xFBC0,0xA3E2,0x0000, 0xFBC0,0xA3E3,0x0000, +0xFBC0,0xA3E4,0x0000, 0xFBC0,0xA3E5,0x0000, 0xFBC0,0xA3E6,0x0000, +0xFBC0,0xA3E7,0x0000, 0xFBC0,0xA3E8,0x0000, 0xFBC0,0xA3E9,0x0000, +0xFBC0,0xA3EA,0x0000, 0xFBC0,0xA3EB,0x0000, 0xFBC0,0xA3EC,0x0000, +0xFBC0,0xA3ED,0x0000, 0xFBC0,0xA3EE,0x0000, 0xFBC0,0xA3EF,0x0000, +0xFBC0,0xA3F0,0x0000, 0xFBC0,0xA3F1,0x0000, 0xFBC0,0xA3F2,0x0000, +0xFBC0,0xA3F3,0x0000, 0xFBC0,0xA3F4,0x0000, 0xFBC0,0xA3F5,0x0000, +0xFBC0,0xA3F6,0x0000, 0xFBC0,0xA3F7,0x0000, 0xFBC0,0xA3F8,0x0000, +0xFBC0,0xA3F9,0x0000, 0xFBC0,0xA3FA,0x0000, 0xFBC0,0xA3FB,0x0000, +0xFBC0,0xA3FC,0x0000, 0xFBC0,0xA3FD,0x0000, 0xFBC0,0xA3FE,0x0000, +0xFBC0,0xA3FF,0x0000 }; + +uint16 page024data[]= { /* 2400 (5 weights per char) */ +0x05CA,0x0000,0x0000,0x0000,0x0000, +0x05CB,0x0000,0x0000,0x0000,0x0000, +0x05CC,0x0000,0x0000,0x0000,0x0000, +0x05CD,0x0000,0x0000,0x0000,0x0000, +0x05CE,0x0000,0x0000,0x0000,0x0000, +0x05CF,0x0000,0x0000,0x0000,0x0000, +0x05D0,0x0000,0x0000,0x0000,0x0000, +0x05D1,0x0000,0x0000,0x0000,0x0000, +0x05D2,0x0000,0x0000,0x0000,0x0000, +0x05D3,0x0000,0x0000,0x0000,0x0000, +0x05D4,0x0000,0x0000,0x0000,0x0000, +0x05D5,0x0000,0x0000,0x0000,0x0000, +0x05D6,0x0000,0x0000,0x0000,0x0000, +0x05D7,0x0000,0x0000,0x0000,0x0000, +0x05D8,0x0000,0x0000,0x0000,0x0000, +0x05D9,0x0000,0x0000,0x0000,0x0000, +0x05DA,0x0000,0x0000,0x0000,0x0000, +0x05DB,0x0000,0x0000,0x0000,0x0000, +0x05DC,0x0000,0x0000,0x0000,0x0000, +0x05DD,0x0000,0x0000,0x0000,0x0000, +0x05DE,0x0000,0x0000,0x0000,0x0000, +0x05DF,0x0000,0x0000,0x0000,0x0000, +0x05E0,0x0000,0x0000,0x0000,0x0000, +0x05E1,0x0000,0x0000,0x0000,0x0000, +0x05E2,0x0000,0x0000,0x0000,0x0000, +0x05E3,0x0000,0x0000,0x0000,0x0000, +0x05E4,0x0000,0x0000,0x0000,0x0000, +0x05E5,0x0000,0x0000,0x0000,0x0000, +0x05E6,0x0000,0x0000,0x0000,0x0000, +0x05E7,0x0000,0x0000,0x0000,0x0000, +0x05E8,0x0000,0x0000,0x0000,0x0000, +0x05E9,0x0000,0x0000,0x0000,0x0000, +0x05EA,0x0000,0x0000,0x0000,0x0000, +0x05EB,0x0000,0x0000,0x0000,0x0000, +0x05EC,0x0000,0x0000,0x0000,0x0000, +0x05ED,0x0000,0x0000,0x0000,0x0000, +0x05EE,0x0000,0x0000,0x0000,0x0000, +0x05EF,0x0000,0x0000,0x0000,0x0000, +0x05F0,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA427,0x0000,0x0000,0x0000, +0xFBC0,0xA428,0x0000,0x0000,0x0000, +0xFBC0,0xA429,0x0000,0x0000,0x0000, +0xFBC0,0xA42A,0x0000,0x0000,0x0000, +0xFBC0,0xA42B,0x0000,0x0000,0x0000, +0xFBC0,0xA42C,0x0000,0x0000,0x0000, +0xFBC0,0xA42D,0x0000,0x0000,0x0000, +0xFBC0,0xA42E,0x0000,0x0000,0x0000, +0xFBC0,0xA42F,0x0000,0x0000,0x0000, +0xFBC0,0xA430,0x0000,0x0000,0x0000, +0xFBC0,0xA431,0x0000,0x0000,0x0000, +0xFBC0,0xA432,0x0000,0x0000,0x0000, +0xFBC0,0xA433,0x0000,0x0000,0x0000, +0xFBC0,0xA434,0x0000,0x0000,0x0000, +0xFBC0,0xA435,0x0000,0x0000,0x0000, +0xFBC0,0xA436,0x0000,0x0000,0x0000, +0xFBC0,0xA437,0x0000,0x0000,0x0000, +0xFBC0,0xA438,0x0000,0x0000,0x0000, +0xFBC0,0xA439,0x0000,0x0000,0x0000, +0xFBC0,0xA43A,0x0000,0x0000,0x0000, +0xFBC0,0xA43B,0x0000,0x0000,0x0000, +0xFBC0,0xA43C,0x0000,0x0000,0x0000, +0xFBC0,0xA43D,0x0000,0x0000,0x0000, +0xFBC0,0xA43E,0x0000,0x0000,0x0000, +0xFBC0,0xA43F,0x0000,0x0000,0x0000, +0x05F1,0x0000,0x0000,0x0000,0x0000, +0x05F2,0x0000,0x0000,0x0000,0x0000, +0x05F3,0x0000,0x0000,0x0000,0x0000, +0x05F4,0x0000,0x0000,0x0000,0x0000, +0x05F5,0x0000,0x0000,0x0000,0x0000, +0x05F6,0x0000,0x0000,0x0000,0x0000, +0x05F7,0x0000,0x0000,0x0000,0x0000, +0x05F8,0x0000,0x0000,0x0000,0x0000, +0x05F9,0x0000,0x0000,0x0000,0x0000, +0x05FA,0x0000,0x0000,0x0000,0x0000, +0x05FB,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xA44B,0x0000,0x0000,0x0000, +0xFBC0,0xA44C,0x0000,0x0000,0x0000, +0xFBC0,0xA44D,0x0000,0x0000,0x0000, +0xFBC0,0xA44E,0x0000,0x0000,0x0000, +0xFBC0,0xA44F,0x0000,0x0000,0x0000, +0xFBC0,0xA450,0x0000,0x0000,0x0000, +0xFBC0,0xA451,0x0000,0x0000,0x0000, +0xFBC0,0xA452,0x0000,0x0000,0x0000, +0xFBC0,0xA453,0x0000,0x0000,0x0000, +0xFBC0,0xA454,0x0000,0x0000,0x0000, +0xFBC0,0xA455,0x0000,0x0000,0x0000, +0xFBC0,0xA456,0x0000,0x0000,0x0000, +0xFBC0,0xA457,0x0000,0x0000,0x0000, +0xFBC0,0xA458,0x0000,0x0000,0x0000, +0xFBC0,0xA459,0x0000,0x0000,0x0000, +0xFBC0,0xA45A,0x0000,0x0000,0x0000, +0xFBC0,0xA45B,0x0000,0x0000,0x0000, +0xFBC0,0xA45C,0x0000,0x0000,0x0000, +0xFBC0,0xA45D,0x0000,0x0000,0x0000, +0xFBC0,0xA45E,0x0000,0x0000,0x0000, +0xFBC0,0xA45F,0x0000,0x0000,0x0000, +0x0E2A,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0x0000,0x0000,0x0000,0x0000, +0x0E30,0x0000,0x0000,0x0000,0x0000, +0x0E31,0x0000,0x0000,0x0000,0x0000, +0x0E32,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E29,0x0000,0x0000,0x0000, +0x0E2A,0x0E2A,0x0000,0x0000,0x0000, +0x0E2A,0x0E2B,0x0000,0x0000,0x0000, +0x0E2A,0x0E2C,0x0000,0x0000,0x0000, +0x0E2A,0x0E2D,0x0000,0x0000,0x0000, +0x0E2A,0x0E2E,0x0000,0x0000,0x0000, +0x0E2A,0x0E2F,0x0000,0x0000,0x0000, +0x0E2A,0x0E30,0x0000,0x0000,0x0000, +0x0E2A,0x0E31,0x0000,0x0000,0x0000, +0x0E2A,0x0E32,0x0000,0x0000,0x0000, +0x0E2B,0x0E29,0x0000,0x0000,0x0000, +0x0288,0x0E2A,0x0289,0x0000,0x0000, +0x0288,0x0E2B,0x0289,0x0000,0x0000, +0x0288,0x0E2C,0x0289,0x0000,0x0000, +0x0288,0x0E2D,0x0289,0x0000,0x0000, +0x0288,0x0E2E,0x0289,0x0000,0x0000, +0x0288,0x0E2F,0x0289,0x0000,0x0000, +0x0288,0x0E30,0x0289,0x0000,0x0000, +0x0288,0x0E31,0x0289,0x0000,0x0000, +0x0288,0x0E32,0x0289,0x0000,0x0000, +0x0288,0x0E2A,0x0E29,0x0289,0x0000, +0x0288,0x0E2A,0x0E2A,0x0289,0x0000, +0x0288,0x0E2A,0x0E2B,0x0289,0x0000, +0x0288,0x0E2A,0x0E2C,0x0289,0x0000, +0x0288,0x0E2A,0x0E2D,0x0289,0x0000, +0x0288,0x0E2A,0x0E2E,0x0289,0x0000, +0x0288,0x0E2A,0x0E2F,0x0289,0x0000, +0x0288,0x0E2A,0x0E30,0x0289,0x0000, +0x0288,0x0E2A,0x0E31,0x0289,0x0000, +0x0288,0x0E2A,0x0E32,0x0289,0x0000, +0x0288,0x0E2B,0x0E29,0x0289,0x0000, +0x0E2A,0x025D,0x0000,0x0000,0x0000, +0x0E2B,0x025D,0x0000,0x0000,0x0000, +0x0E2C,0x025D,0x0000,0x0000,0x0000, +0x0E2D,0x025D,0x0000,0x0000,0x0000, +0x0E2E,0x025D,0x0000,0x0000,0x0000, +0x0E2F,0x025D,0x0000,0x0000,0x0000, +0x0E30,0x025D,0x0000,0x0000,0x0000, +0x0E31,0x025D,0x0000,0x0000,0x0000, +0x0E32,0x025D,0x0000,0x0000,0x0000, +0x0E2A,0x0E29,0x025D,0x0000,0x0000, +0x0E2A,0x0E2A,0x025D,0x0000,0x0000, +0x0E2A,0x0E2B,0x025D,0x0000,0x0000, +0x0E2A,0x0E2C,0x025D,0x0000,0x0000, +0x0E2A,0x0E2D,0x025D,0x0000,0x0000, +0x0E2A,0x0E2E,0x025D,0x0000,0x0000, +0x0E2A,0x0E2F,0x025D,0x0000,0x0000, +0x0E2A,0x0E30,0x025D,0x0000,0x0000, +0x0E2A,0x0E31,0x025D,0x0000,0x0000, +0x0E2A,0x0E32,0x025D,0x0000,0x0000, +0x0E2B,0x0E29,0x025D,0x0000,0x0000, +0x0288,0x0E33,0x0289,0x0000,0x0000, +0x0288,0x0E4A,0x0289,0x0000,0x0000, +0x0288,0x0E60,0x0289,0x0000,0x0000, +0x0288,0x0E6D,0x0289,0x0000,0x0000, +0x0288,0x0E8B,0x0289,0x0000,0x0000, +0x0288,0x0EB9,0x0289,0x0000,0x0000, +0x0288,0x0EC1,0x0289,0x0000,0x0000, +0x0288,0x0EE1,0x0289,0x0000,0x0000, +0x0288,0x0EFB,0x0289,0x0000,0x0000, +0x0288,0x0F10,0x0289,0x0000,0x0000, +0x0288,0x0F21,0x0289,0x0000,0x0000, +0x0288,0x0F2E,0x0289,0x0000,0x0000, +0x0288,0x0F5B,0x0289,0x0000,0x0000, +0x0288,0x0F64,0x0289,0x0000,0x0000, +0x0288,0x0F82,0x0289,0x0000,0x0000, +0x0288,0x0FA7,0x0289,0x0000,0x0000, +0x0288,0x0FB4,0x0289,0x0000,0x0000, +0x0288,0x0FC0,0x0289,0x0000,0x0000, +0x0288,0x0FEA,0x0289,0x0000,0x0000, +0x0288,0x1002,0x0289,0x0000,0x0000, +0x0288,0x101F,0x0289,0x0000,0x0000, +0x0288,0x1044,0x0289,0x0000,0x0000, +0x0288,0x1051,0x0289,0x0000,0x0000, +0x0288,0x105A,0x0289,0x0000,0x0000, +0x0288,0x105E,0x0289,0x0000,0x0000, +0x0288,0x106A,0x0289,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000,0x0000, +0x0E4A,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000,0x0000, +0x0EB9,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0F10,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0000,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0000,0x0000,0x0000,0x0000, +0x0FB4,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000,0x0000, +0x0FEA,0x0000,0x0000,0x0000,0x0000, +0x1002,0x0000,0x0000,0x0000,0x0000, +0x101F,0x0000,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000,0x0000, +0x1051,0x0000,0x0000,0x0000,0x0000, +0x105A,0x0000,0x0000,0x0000,0x0000, +0x105E,0x0000,0x0000,0x0000,0x0000, +0x106A,0x0000,0x0000,0x0000,0x0000, +0x0E33,0x0000,0x0000,0x0000,0x0000, +0x0E4A,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x0000,0x0000,0x0000,0x0000, +0x0EB9,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0000,0x0000,0x0000,0x0000, +0x0F10,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0000,0x0000,0x0000,0x0000, +0x0F82,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0000,0x0000,0x0000,0x0000, +0x0FB4,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0000,0x0000,0x0000,0x0000, +0x0FEA,0x0000,0x0000,0x0000,0x0000, +0x1002,0x0000,0x0000,0x0000,0x0000, +0x101F,0x0000,0x0000,0x0000,0x0000, +0x1044,0x0000,0x0000,0x0000,0x0000, +0x1051,0x0000,0x0000,0x0000,0x0000, +0x105A,0x0000,0x0000,0x0000,0x0000, +0x105E,0x0000,0x0000,0x0000,0x0000, +0x106A,0x0000,0x0000,0x0000,0x0000, +0x0E29,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2A,0x0000,0x0000,0x0000, +0x0E2A,0x0E2B,0x0000,0x0000,0x0000, +0x0E2A,0x0E2C,0x0000,0x0000,0x0000, +0x0E2A,0x0E2D,0x0000,0x0000,0x0000, +0x0E2A,0x0E2E,0x0000,0x0000,0x0000, +0x0E2A,0x0E2F,0x0000,0x0000,0x0000, +0x0E2A,0x0E30,0x0000,0x0000,0x0000, +0x0E2A,0x0E31,0x0000,0x0000,0x0000, +0x0E2A,0x0E32,0x0000,0x0000,0x0000, +0x0E2B,0x0E29,0x0000,0x0000,0x0000, +0x0E2A,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0x0000,0x0000,0x0000,0x0000, +0x0E30,0x0000,0x0000,0x0000,0x0000, +0x0E31,0x0000,0x0000,0x0000,0x0000, +0x0E32,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E29,0x0000,0x0000,0x0000, +0x0E29,0x0000,0x0000,0x0000,0x0000 +}; + +uint16 page025data[]= { /* 2500 (2 weights per char) */ +0x05FC,0x0000, 0x05FD,0x0000, 0x05FE,0x0000, 0x05FF,0x0000, +0x0600,0x0000, 0x0601,0x0000, 0x0602,0x0000, 0x0603,0x0000, +0x0604,0x0000, 0x0605,0x0000, 0x0606,0x0000, 0x0607,0x0000, +0x0608,0x0000, 0x0609,0x0000, 0x060A,0x0000, 0x060B,0x0000, +0x060C,0x0000, 0x060D,0x0000, 0x060E,0x0000, 0x060F,0x0000, +0x0610,0x0000, 0x0611,0x0000, 0x0612,0x0000, 0x0613,0x0000, +0x0614,0x0000, 0x0615,0x0000, 0x0616,0x0000, 0x0617,0x0000, +0x0618,0x0000, 0x0619,0x0000, 0x061A,0x0000, 0x061B,0x0000, +0x061C,0x0000, 0x061D,0x0000, 0x061E,0x0000, 0x061F,0x0000, +0x0620,0x0000, 0x0621,0x0000, 0x0622,0x0000, 0x0623,0x0000, +0x0624,0x0000, 0x0625,0x0000, 0x0626,0x0000, 0x0627,0x0000, +0x0628,0x0000, 0x0629,0x0000, 0x062A,0x0000, 0x062B,0x0000, +0x062C,0x0000, 0x062D,0x0000, 0x062E,0x0000, 0x062F,0x0000, +0x0630,0x0000, 0x0631,0x0000, 0x0632,0x0000, 0x0633,0x0000, +0x0634,0x0000, 0x0635,0x0000, 0x0636,0x0000, 0x0637,0x0000, +0x0638,0x0000, 0x0639,0x0000, 0x063A,0x0000, 0x063B,0x0000, +0x063C,0x0000, 0x063D,0x0000, 0x063E,0x0000, 0x063F,0x0000, +0x0640,0x0000, 0x0641,0x0000, 0x0642,0x0000, 0x0643,0x0000, +0x0644,0x0000, 0x0645,0x0000, 0x0646,0x0000, 0x0647,0x0000, +0x0648,0x0000, 0x0649,0x0000, 0x064A,0x0000, 0x064B,0x0000, +0x064C,0x0000, 0x064D,0x0000, 0x064E,0x0000, 0x064F,0x0000, +0x0650,0x0000, 0x0651,0x0000, 0x0652,0x0000, 0x0653,0x0000, +0x0654,0x0000, 0x0655,0x0000, 0x0656,0x0000, 0x0657,0x0000, +0x0658,0x0000, 0x0659,0x0000, 0x065A,0x0000, 0x065B,0x0000, +0x065C,0x0000, 0x065D,0x0000, 0x065E,0x0000, 0x065F,0x0000, +0x0660,0x0000, 0x0661,0x0000, 0x0662,0x0000, 0x0663,0x0000, +0x0664,0x0000, 0x0665,0x0000, 0x0666,0x0000, 0x0667,0x0000, +0x0668,0x0000, 0x0669,0x0000, 0x066A,0x0000, 0x066B,0x0000, +0x066C,0x0000, 0x066D,0x0000, 0x066E,0x0000, 0x066F,0x0000, +0x0670,0x0000, 0x0671,0x0000, 0x0672,0x0000, 0x0673,0x0000, +0x0674,0x0000, 0x0675,0x0000, 0x0676,0x0000, 0x0677,0x0000, +0x0678,0x0000, 0x0679,0x0000, 0x067A,0x0000, 0x067B,0x0000, +0x067C,0x0000, 0x067D,0x0000, 0x067E,0x0000, 0x067F,0x0000, +0x0680,0x0000, 0x0681,0x0000, 0x0682,0x0000, 0x0683,0x0000, +0x0684,0x0000, 0x0685,0x0000, 0x0686,0x0000, 0x0687,0x0000, +0x0688,0x0000, 0x0689,0x0000, 0x068A,0x0000, 0x068B,0x0000, +0x068C,0x0000, 0x068D,0x0000, 0x068E,0x0000, 0x068F,0x0000, +0x0690,0x0000, 0x0691,0x0000, 0x0692,0x0000, 0x0693,0x0000, +0x0694,0x0000, 0x0695,0x0000, 0x0696,0x0000, 0x0697,0x0000, +0x0698,0x0000, 0x0699,0x0000, 0x069A,0x0000, 0x069B,0x0000, +0x069C,0x0000, 0x069D,0x0000, 0x069E,0x0000, 0x069F,0x0000, +0x06A0,0x0000, 0x06A1,0x0000, 0x06A2,0x0000, 0x06A3,0x0000, +0x06A4,0x0000, 0x06A5,0x0000, 0x06A6,0x0000, 0x06A7,0x0000, +0x06A8,0x0000, 0x06A9,0x0000, 0x06AA,0x0000, 0x06AB,0x0000, +0x06AC,0x0000, 0x06AD,0x0000, 0x06AE,0x0000, 0x06AF,0x0000, +0x06B0,0x0000, 0x06B1,0x0000, 0x06B2,0x0000, 0x06B3,0x0000, +0x06B4,0x0000, 0x06B5,0x0000, 0x06B6,0x0000, 0x06B7,0x0000, +0x06B8,0x0000, 0x06B9,0x0000, 0x06BA,0x0000, 0x06BB,0x0000, +0x06BC,0x0000, 0x06BD,0x0000, 0x06BE,0x0000, 0x06BF,0x0000, +0x06C0,0x0000, 0x06C1,0x0000, 0x06C2,0x0000, 0x06C3,0x0000, +0x06C4,0x0000, 0x06C5,0x0000, 0x06C6,0x0000, 0x06C7,0x0000, +0x06C8,0x0000, 0x06C9,0x0000, 0x06CA,0x0000, 0x06CB,0x0000, +0x06CC,0x0000, 0x06CD,0x0000, 0x06CE,0x0000, 0x06CF,0x0000, +0x06D0,0x0000, 0x06D1,0x0000, 0x06D2,0x0000, 0x06D3,0x0000, +0x06D4,0x0000, 0x06D5,0x0000, 0x06D6,0x0000, 0x06D7,0x0000, +0x06D8,0x0000, 0x06D9,0x0000, 0x06DA,0x0000, 0x06DB,0x0000, +0x06DC,0x0000, 0x06DD,0x0000, 0x06DE,0x0000, 0x06DF,0x0000, +0x06E0,0x0000, 0x06E1,0x0000, 0x06E2,0x0000, 0x06E3,0x0000, +0x06E4,0x0000, 0x06E5,0x0000, 0x06E6,0x0000, 0x06E7,0x0000, +0x06E8,0x0000, 0x06E9,0x0000, 0x06EA,0x0000, 0x06EB,0x0000, +0x06EC,0x0000, 0x06ED,0x0000, 0x06EE,0x0000, 0x06EF,0x0000, +0x06F0,0x0000, 0x06F1,0x0000, 0x06F2,0x0000, 0x06F3,0x0000, +0x06F4,0x0000, 0x06F5,0x0000, 0x06F6,0x0000, 0x06F7,0x0000, +0x06F8,0x0000, 0x06F9,0x0000, 0x06FA,0x0000, 0x06FB,0x0000 +}; + +uint16 page026data[]= { /* 2600 (3 weights per char) */ +0x06FC,0x0000,0x0000, 0x06FD,0x0000,0x0000, 0x06FE,0x0000,0x0000, +0x06FF,0x0000,0x0000, 0x0700,0x0000,0x0000, 0x0701,0x0000,0x0000, +0x0702,0x0000,0x0000, 0x0703,0x0000,0x0000, 0x0704,0x0000,0x0000, +0x0705,0x0000,0x0000, 0x0706,0x0000,0x0000, 0x0707,0x0000,0x0000, +0x0708,0x0000,0x0000, 0x0709,0x0000,0x0000, 0x070A,0x0000,0x0000, +0x070B,0x0000,0x0000, 0x070C,0x0000,0x0000, 0x070D,0x0000,0x0000, +0x070E,0x0000,0x0000, 0x070F,0x0000,0x0000, 0x0710,0x0000,0x0000, +0x0711,0x0000,0x0000, 0x0712,0x0000,0x0000, 0x0713,0x0000,0x0000, +0xFBC0,0xA618,0x0000, 0x0714,0x0000,0x0000, 0x0715,0x0000,0x0000, +0x0716,0x0000,0x0000, 0x0717,0x0000,0x0000, 0x0718,0x0000,0x0000, +0x0719,0x0000,0x0000, 0x071A,0x0000,0x0000, 0x071B,0x0000,0x0000, +0x071C,0x0000,0x0000, 0x071D,0x0000,0x0000, 0x071E,0x0000,0x0000, +0x071F,0x0000,0x0000, 0x0720,0x0000,0x0000, 0x0721,0x0000,0x0000, +0x0722,0x0000,0x0000, 0x0723,0x0000,0x0000, 0x0724,0x0000,0x0000, +0x0725,0x0000,0x0000, 0x0726,0x0000,0x0000, 0x0727,0x0000,0x0000, +0x0728,0x0000,0x0000, 0x0729,0x0000,0x0000, 0x072A,0x0000,0x0000, +0x0B2F,0x0000,0x0000, 0x0B30,0x0000,0x0000, 0x0B31,0x0000,0x0000, +0x0B32,0x0000,0x0000, 0x0B33,0x0000,0x0000, 0x0B34,0x0000,0x0000, +0x0B35,0x0000,0x0000, 0x0B36,0x0000,0x0000, 0x072B,0x0000,0x0000, +0x072C,0x0000,0x0000, 0x072D,0x0000,0x0000, 0x072E,0x0000,0x0000, +0x072F,0x0000,0x0000, 0x0730,0x0000,0x0000, 0x0731,0x0000,0x0000, +0x0732,0x0000,0x0000, 0x0733,0x0000,0x0000, 0x0734,0x0000,0x0000, +0x0735,0x0000,0x0000, 0x0736,0x0000,0x0000, 0x0737,0x0000,0x0000, +0x0738,0x0000,0x0000, 0x0739,0x0000,0x0000, 0x073A,0x0000,0x0000, +0x073B,0x0000,0x0000, 0x073C,0x0000,0x0000, 0x073D,0x0000,0x0000, +0x073E,0x0000,0x0000, 0x073F,0x0000,0x0000, 0x0740,0x0000,0x0000, +0x0741,0x0000,0x0000, 0x0742,0x0000,0x0000, 0x0743,0x0000,0x0000, +0x0744,0x0000,0x0000, 0x0745,0x0000,0x0000, 0x0746,0x0000,0x0000, +0x0747,0x0000,0x0000, 0x0748,0x0000,0x0000, 0x0749,0x0000,0x0000, +0x074A,0x0000,0x0000, 0x074B,0x0000,0x0000, 0x074C,0x0000,0x0000, +0x074D,0x0000,0x0000, 0x074E,0x0000,0x0000, 0x074F,0x0000,0x0000, +0x0750,0x0000,0x0000, 0x0751,0x0000,0x0000, 0x0752,0x0000,0x0000, +0x0753,0x0000,0x0000, 0x0754,0x0000,0x0000, 0x0755,0x0000,0x0000, +0x0756,0x0000,0x0000, 0x0757,0x0000,0x0000, 0x0758,0x0000,0x0000, +0x0759,0x0000,0x0000, 0x075A,0x0000,0x0000, 0x075B,0x0000,0x0000, +0x075C,0x0000,0x0000, 0x075D,0x0000,0x0000, 0x075E,0x0000,0x0000, +0x075F,0x0000,0x0000, 0x0D2B,0x0000,0x0000, 0x0D2C,0x0000,0x0000, +0x0D2D,0x0000,0x0000, 0x0760,0x0000,0x0000, 0x0761,0x0000,0x0000, +0x0762,0x0000,0x0000, 0x0763,0x0000,0x0000, 0x0764,0x0000,0x0000, +0x0765,0x0000,0x0000, 0x0766,0x0000,0x0000, 0x0767,0x0000,0x0000, +0x0768,0x0000,0x0000, 0x0769,0x0000,0x0000, 0x076A,0x0000,0x0000, +0x076B,0x0000,0x0000, 0x076C,0x0000,0x0000, 0x076D,0x0000,0x0000, +0xFBC0,0xA67E,0x0000, 0xFBC0,0xA67F,0x0000, 0x076E,0x0000,0x0000, +0x076F,0x0000,0x0000, 0x0770,0x0000,0x0000, 0x0771,0x0000,0x0000, +0x0772,0x0000,0x0000, 0x0773,0x0000,0x0000, 0x0774,0x0000,0x0000, +0x0775,0x0000,0x0000, 0x0776,0x0000,0x0000, 0x0777,0x0000,0x0000, +0x0B29,0x0000,0x0000, 0x0B2A,0x0000,0x0000, 0x0B2B,0x0000,0x0000, +0x0B2C,0x0000,0x0000, 0x0B2D,0x0000,0x0000, 0x0B2E,0x0000,0x0000, +0x0778,0x0000,0x0000, 0x0779,0x0000,0x0000, 0xFBC0,0xA692,0x0000, +0xFBC0,0xA693,0x0000, 0xFBC0,0xA694,0x0000, 0xFBC0,0xA695,0x0000, +0xFBC0,0xA696,0x0000, 0xFBC0,0xA697,0x0000, 0xFBC0,0xA698,0x0000, +0xFBC0,0xA699,0x0000, 0xFBC0,0xA69A,0x0000, 0xFBC0,0xA69B,0x0000, +0xFBC0,0xA69C,0x0000, 0xFBC0,0xA69D,0x0000, 0xFBC0,0xA69E,0x0000, +0xFBC0,0xA69F,0x0000, 0x077A,0x0000,0x0000, 0x077B,0x0000,0x0000, +0xFBC0,0xA6A2,0x0000, 0xFBC0,0xA6A3,0x0000, 0xFBC0,0xA6A4,0x0000, +0xFBC0,0xA6A5,0x0000, 0xFBC0,0xA6A6,0x0000, 0xFBC0,0xA6A7,0x0000, +0xFBC0,0xA6A8,0x0000, 0xFBC0,0xA6A9,0x0000, 0xFBC0,0xA6AA,0x0000, +0xFBC0,0xA6AB,0x0000, 0xFBC0,0xA6AC,0x0000, 0xFBC0,0xA6AD,0x0000, +0xFBC0,0xA6AE,0x0000, 0xFBC0,0xA6AF,0x0000, 0xFBC0,0xA6B0,0x0000, +0xFBC0,0xA6B1,0x0000, 0xFBC0,0xA6B2,0x0000, 0xFBC0,0xA6B3,0x0000, +0xFBC0,0xA6B4,0x0000, 0xFBC0,0xA6B5,0x0000, 0xFBC0,0xA6B6,0x0000, +0xFBC0,0xA6B7,0x0000, 0xFBC0,0xA6B8,0x0000, 0xFBC0,0xA6B9,0x0000, +0xFBC0,0xA6BA,0x0000, 0xFBC0,0xA6BB,0x0000, 0xFBC0,0xA6BC,0x0000, +0xFBC0,0xA6BD,0x0000, 0xFBC0,0xA6BE,0x0000, 0xFBC0,0xA6BF,0x0000, +0xFBC0,0xA6C0,0x0000, 0xFBC0,0xA6C1,0x0000, 0xFBC0,0xA6C2,0x0000, +0xFBC0,0xA6C3,0x0000, 0xFBC0,0xA6C4,0x0000, 0xFBC0,0xA6C5,0x0000, +0xFBC0,0xA6C6,0x0000, 0xFBC0,0xA6C7,0x0000, 0xFBC0,0xA6C8,0x0000, +0xFBC0,0xA6C9,0x0000, 0xFBC0,0xA6CA,0x0000, 0xFBC0,0xA6CB,0x0000, +0xFBC0,0xA6CC,0x0000, 0xFBC0,0xA6CD,0x0000, 0xFBC0,0xA6CE,0x0000, +0xFBC0,0xA6CF,0x0000, 0xFBC0,0xA6D0,0x0000, 0xFBC0,0xA6D1,0x0000, +0xFBC0,0xA6D2,0x0000, 0xFBC0,0xA6D3,0x0000, 0xFBC0,0xA6D4,0x0000, +0xFBC0,0xA6D5,0x0000, 0xFBC0,0xA6D6,0x0000, 0xFBC0,0xA6D7,0x0000, +0xFBC0,0xA6D8,0x0000, 0xFBC0,0xA6D9,0x0000, 0xFBC0,0xA6DA,0x0000, +0xFBC0,0xA6DB,0x0000, 0xFBC0,0xA6DC,0x0000, 0xFBC0,0xA6DD,0x0000, +0xFBC0,0xA6DE,0x0000, 0xFBC0,0xA6DF,0x0000, 0xFBC0,0xA6E0,0x0000, +0xFBC0,0xA6E1,0x0000, 0xFBC0,0xA6E2,0x0000, 0xFBC0,0xA6E3,0x0000, +0xFBC0,0xA6E4,0x0000, 0xFBC0,0xA6E5,0x0000, 0xFBC0,0xA6E6,0x0000, +0xFBC0,0xA6E7,0x0000, 0xFBC0,0xA6E8,0x0000, 0xFBC0,0xA6E9,0x0000, +0xFBC0,0xA6EA,0x0000, 0xFBC0,0xA6EB,0x0000, 0xFBC0,0xA6EC,0x0000, +0xFBC0,0xA6ED,0x0000, 0xFBC0,0xA6EE,0x0000, 0xFBC0,0xA6EF,0x0000, +0xFBC0,0xA6F0,0x0000, 0xFBC0,0xA6F1,0x0000, 0xFBC0,0xA6F2,0x0000, +0xFBC0,0xA6F3,0x0000, 0xFBC0,0xA6F4,0x0000, 0xFBC0,0xA6F5,0x0000, +0xFBC0,0xA6F6,0x0000, 0xFBC0,0xA6F7,0x0000, 0xFBC0,0xA6F8,0x0000, +0xFBC0,0xA6F9,0x0000, 0xFBC0,0xA6FA,0x0000, 0xFBC0,0xA6FB,0x0000, +0xFBC0,0xA6FC,0x0000, 0xFBC0,0xA6FD,0x0000, 0xFBC0,0xA6FE,0x0000, +0xFBC0,0xA6FF,0x0000 }; + +uint16 page027data[]= { /* 2700 (3 weights per char) */ +0xFBC0,0xA700,0x0000, 0x077C,0x0000,0x0000, 0x077D,0x0000,0x0000, +0x077E,0x0000,0x0000, 0x077F,0x0000,0x0000, 0xFBC0,0xA705,0x0000, +0x0780,0x0000,0x0000, 0x0781,0x0000,0x0000, 0x0782,0x0000,0x0000, +0x0783,0x0000,0x0000, 0xFBC0,0xA70A,0x0000, 0xFBC0,0xA70B,0x0000, +0x0784,0x0000,0x0000, 0x0785,0x0000,0x0000, 0x0786,0x0000,0x0000, +0x0787,0x0000,0x0000, 0x0788,0x0000,0x0000, 0x0789,0x0000,0x0000, +0x078A,0x0000,0x0000, 0x078B,0x0000,0x0000, 0x078C,0x0000,0x0000, +0x078D,0x0000,0x0000, 0x078E,0x0000,0x0000, 0x078F,0x0000,0x0000, +0x0790,0x0000,0x0000, 0x0791,0x0000,0x0000, 0x0792,0x0000,0x0000, +0x0793,0x0000,0x0000, 0x0794,0x0000,0x0000, 0x0795,0x0000,0x0000, +0x0796,0x0000,0x0000, 0x0797,0x0000,0x0000, 0x0798,0x0000,0x0000, +0x0799,0x0000,0x0000, 0x079A,0x0000,0x0000, 0x079B,0x0000,0x0000, +0x079C,0x0000,0x0000, 0x079D,0x0000,0x0000, 0x079E,0x0000,0x0000, +0x079F,0x0000,0x0000, 0xFBC0,0xA728,0x0000, 0x07A0,0x0000,0x0000, +0x07A1,0x0000,0x0000, 0x07A2,0x0000,0x0000, 0x07A3,0x0000,0x0000, +0x07A4,0x0000,0x0000, 0x07A5,0x0000,0x0000, 0x07A6,0x0000,0x0000, +0x07A7,0x0000,0x0000, 0x07A8,0x0000,0x0000, 0x07A9,0x0000,0x0000, +0x07AA,0x0000,0x0000, 0x07AB,0x0000,0x0000, 0x07AC,0x0000,0x0000, +0x07AD,0x0000,0x0000, 0x07AE,0x0000,0x0000, 0x07AF,0x0000,0x0000, +0x07B0,0x0000,0x0000, 0x07B1,0x0000,0x0000, 0x07B2,0x0000,0x0000, +0x07B3,0x0000,0x0000, 0x07B4,0x0000,0x0000, 0x07B5,0x0000,0x0000, +0x07B6,0x0000,0x0000, 0x07B7,0x0000,0x0000, 0x07B8,0x0000,0x0000, +0x07B9,0x0000,0x0000, 0x07BA,0x0000,0x0000, 0x07BB,0x0000,0x0000, +0x07BC,0x0000,0x0000, 0x07BD,0x0000,0x0000, 0x07BE,0x0000,0x0000, +0x07BF,0x0000,0x0000, 0x07C0,0x0000,0x0000, 0x07C1,0x0000,0x0000, +0x07C2,0x0000,0x0000, 0xFBC0,0xA74C,0x0000, 0x07C3,0x0000,0x0000, +0xFBC0,0xA74E,0x0000, 0x07C4,0x0000,0x0000, 0x07C5,0x0000,0x0000, +0x07C6,0x0000,0x0000, 0x07C7,0x0000,0x0000, 0xFBC0,0xA753,0x0000, +0xFBC0,0xA754,0x0000, 0xFBC0,0xA755,0x0000, 0x07C8,0x0000,0x0000, +0xFBC0,0xA757,0x0000, 0x07C9,0x0000,0x0000, 0x07CA,0x0000,0x0000, +0x07CB,0x0000,0x0000, 0x07CC,0x0000,0x0000, 0x07CD,0x0000,0x0000, +0x07CE,0x0000,0x0000, 0x07CF,0x0000,0x0000, 0xFBC0,0xA75F,0x0000, +0xFBC0,0xA760,0x0000, 0x07D0,0x0000,0x0000, 0x07D1,0x0000,0x0000, +0x07D2,0x0000,0x0000, 0x07D3,0x0000,0x0000, 0x07D4,0x0000,0x0000, +0x07D5,0x0000,0x0000, 0x07D6,0x0000,0x0000, 0x07D7,0x0000,0x0000, +0x07D8,0x0000,0x0000, 0x07D9,0x0000,0x0000, 0x07DA,0x0000,0x0000, +0x07DB,0x0000,0x0000, 0x07DC,0x0000,0x0000, 0x07DD,0x0000,0x0000, +0x07DE,0x0000,0x0000, 0x07DF,0x0000,0x0000, 0x07E0,0x0000,0x0000, +0x07E1,0x0000,0x0000, 0x07E2,0x0000,0x0000, 0x07E3,0x0000,0x0000, +0x07E4,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, +0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, +0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, +0x0E32,0x0000,0x0000, 0x0E2A,0x0E29,0x0000, 0x0E2A,0x0000,0x0000, +0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, +0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, +0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x0E2A,0x0E29,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x0E2A,0x0E29,0x0000, 0x07E5,0x0000,0x0000, 0xFBC0,0xA795,0x0000, +0xFBC0,0xA796,0x0000, 0xFBC0,0xA797,0x0000, 0x07E6,0x0000,0x0000, +0x07E7,0x0000,0x0000, 0x07E8,0x0000,0x0000, 0x07E9,0x0000,0x0000, +0x07EA,0x0000,0x0000, 0x07EB,0x0000,0x0000, 0x07EC,0x0000,0x0000, +0x07ED,0x0000,0x0000, 0x07EE,0x0000,0x0000, 0x07EF,0x0000,0x0000, +0x07F0,0x0000,0x0000, 0x07F1,0x0000,0x0000, 0x07F2,0x0000,0x0000, +0x07F3,0x0000,0x0000, 0x07F4,0x0000,0x0000, 0x07F5,0x0000,0x0000, +0x07F6,0x0000,0x0000, 0x07F7,0x0000,0x0000, 0x07F8,0x0000,0x0000, +0x07F9,0x0000,0x0000, 0x07FA,0x0000,0x0000, 0x07FB,0x0000,0x0000, +0x07FC,0x0000,0x0000, 0x07FD,0x0000,0x0000, 0xFBC0,0xA7B0,0x0000, +0x07FE,0x0000,0x0000, 0x07FF,0x0000,0x0000, 0x0800,0x0000,0x0000, +0x0801,0x0000,0x0000, 0x0802,0x0000,0x0000, 0x0803,0x0000,0x0000, +0x0804,0x0000,0x0000, 0x0805,0x0000,0x0000, 0x0806,0x0000,0x0000, +0x0807,0x0000,0x0000, 0x0808,0x0000,0x0000, 0x0809,0x0000,0x0000, +0x080A,0x0000,0x0000, 0x080B,0x0000,0x0000, 0xFBC0,0xA7BF,0x0000, +0xFBC0,0xA7C0,0x0000, 0xFBC0,0xA7C1,0x0000, 0xFBC0,0xA7C2,0x0000, +0xFBC0,0xA7C3,0x0000, 0xFBC0,0xA7C4,0x0000, 0xFBC0,0xA7C5,0x0000, +0xFBC0,0xA7C6,0x0000, 0xFBC0,0xA7C7,0x0000, 0xFBC0,0xA7C8,0x0000, +0xFBC0,0xA7C9,0x0000, 0xFBC0,0xA7CA,0x0000, 0xFBC0,0xA7CB,0x0000, +0xFBC0,0xA7CC,0x0000, 0xFBC0,0xA7CD,0x0000, 0xFBC0,0xA7CE,0x0000, +0xFBC0,0xA7CF,0x0000, 0x080C,0x0000,0x0000, 0x080D,0x0000,0x0000, +0x080E,0x0000,0x0000, 0x080F,0x0000,0x0000, 0x0810,0x0000,0x0000, +0x0811,0x0000,0x0000, 0x0812,0x0000,0x0000, 0x0813,0x0000,0x0000, +0x0814,0x0000,0x0000, 0x0815,0x0000,0x0000, 0x0816,0x0000,0x0000, +0x0817,0x0000,0x0000, 0x0818,0x0000,0x0000, 0x0819,0x0000,0x0000, +0x081A,0x0000,0x0000, 0x081B,0x0000,0x0000, 0x081C,0x0000,0x0000, +0x081D,0x0000,0x0000, 0x081E,0x0000,0x0000, 0x081F,0x0000,0x0000, +0x0820,0x0000,0x0000, 0x0821,0x0000,0x0000, 0x0822,0x0000,0x0000, +0x0823,0x0000,0x0000, 0x0824,0x0000,0x0000, 0x0825,0x0000,0x0000, +0x0826,0x0000,0x0000, 0x0827,0x0000,0x0000, 0xFBC0,0xA7EC,0x0000, +0xFBC0,0xA7ED,0x0000, 0xFBC0,0xA7EE,0x0000, 0xFBC0,0xA7EF,0x0000, +0x0828,0x0000,0x0000, 0x0829,0x0000,0x0000, 0x082A,0x0000,0x0000, +0x082B,0x0000,0x0000, 0x082C,0x0000,0x0000, 0x082D,0x0000,0x0000, +0x082E,0x0000,0x0000, 0x082F,0x0000,0x0000, 0x0830,0x0000,0x0000, +0x0831,0x0000,0x0000, 0x0832,0x0000,0x0000, 0x0833,0x0000,0x0000, +0x0834,0x0000,0x0000, 0x0835,0x0000,0x0000, 0x0836,0x0000,0x0000, +0x0837,0x0000,0x0000 }; + +uint16 page028data[]= { /* 2800 (2 weights per char) */ +0x0A29,0x0000, 0x0A2A,0x0000, 0x0A2B,0x0000, 0x0A2C,0x0000, +0x0A2D,0x0000, 0x0A2E,0x0000, 0x0A2F,0x0000, 0x0A30,0x0000, +0x0A31,0x0000, 0x0A32,0x0000, 0x0A33,0x0000, 0x0A34,0x0000, +0x0A35,0x0000, 0x0A36,0x0000, 0x0A37,0x0000, 0x0A38,0x0000, +0x0A39,0x0000, 0x0A3A,0x0000, 0x0A3B,0x0000, 0x0A3C,0x0000, +0x0A3D,0x0000, 0x0A3E,0x0000, 0x0A3F,0x0000, 0x0A40,0x0000, +0x0A41,0x0000, 0x0A42,0x0000, 0x0A43,0x0000, 0x0A44,0x0000, +0x0A45,0x0000, 0x0A46,0x0000, 0x0A47,0x0000, 0x0A48,0x0000, +0x0A49,0x0000, 0x0A4A,0x0000, 0x0A4B,0x0000, 0x0A4C,0x0000, +0x0A4D,0x0000, 0x0A4E,0x0000, 0x0A4F,0x0000, 0x0A50,0x0000, +0x0A51,0x0000, 0x0A52,0x0000, 0x0A53,0x0000, 0x0A54,0x0000, +0x0A55,0x0000, 0x0A56,0x0000, 0x0A57,0x0000, 0x0A58,0x0000, +0x0A59,0x0000, 0x0A5A,0x0000, 0x0A5B,0x0000, 0x0A5C,0x0000, +0x0A5D,0x0000, 0x0A5E,0x0000, 0x0A5F,0x0000, 0x0A60,0x0000, +0x0A61,0x0000, 0x0A62,0x0000, 0x0A63,0x0000, 0x0A64,0x0000, +0x0A65,0x0000, 0x0A66,0x0000, 0x0A67,0x0000, 0x0A68,0x0000, +0x0A69,0x0000, 0x0A6A,0x0000, 0x0A6B,0x0000, 0x0A6C,0x0000, +0x0A6D,0x0000, 0x0A6E,0x0000, 0x0A6F,0x0000, 0x0A70,0x0000, +0x0A71,0x0000, 0x0A72,0x0000, 0x0A73,0x0000, 0x0A74,0x0000, +0x0A75,0x0000, 0x0A76,0x0000, 0x0A77,0x0000, 0x0A78,0x0000, +0x0A79,0x0000, 0x0A7A,0x0000, 0x0A7B,0x0000, 0x0A7C,0x0000, +0x0A7D,0x0000, 0x0A7E,0x0000, 0x0A7F,0x0000, 0x0A80,0x0000, +0x0A81,0x0000, 0x0A82,0x0000, 0x0A83,0x0000, 0x0A84,0x0000, +0x0A85,0x0000, 0x0A86,0x0000, 0x0A87,0x0000, 0x0A88,0x0000, +0x0A89,0x0000, 0x0A8A,0x0000, 0x0A8B,0x0000, 0x0A8C,0x0000, +0x0A8D,0x0000, 0x0A8E,0x0000, 0x0A8F,0x0000, 0x0A90,0x0000, +0x0A91,0x0000, 0x0A92,0x0000, 0x0A93,0x0000, 0x0A94,0x0000, +0x0A95,0x0000, 0x0A96,0x0000, 0x0A97,0x0000, 0x0A98,0x0000, +0x0A99,0x0000, 0x0A9A,0x0000, 0x0A9B,0x0000, 0x0A9C,0x0000, +0x0A9D,0x0000, 0x0A9E,0x0000, 0x0A9F,0x0000, 0x0AA0,0x0000, +0x0AA1,0x0000, 0x0AA2,0x0000, 0x0AA3,0x0000, 0x0AA4,0x0000, +0x0AA5,0x0000, 0x0AA6,0x0000, 0x0AA7,0x0000, 0x0AA8,0x0000, +0x0AA9,0x0000, 0x0AAA,0x0000, 0x0AAB,0x0000, 0x0AAC,0x0000, +0x0AAD,0x0000, 0x0AAE,0x0000, 0x0AAF,0x0000, 0x0AB0,0x0000, +0x0AB1,0x0000, 0x0AB2,0x0000, 0x0AB3,0x0000, 0x0AB4,0x0000, +0x0AB5,0x0000, 0x0AB6,0x0000, 0x0AB7,0x0000, 0x0AB8,0x0000, +0x0AB9,0x0000, 0x0ABA,0x0000, 0x0ABB,0x0000, 0x0ABC,0x0000, +0x0ABD,0x0000, 0x0ABE,0x0000, 0x0ABF,0x0000, 0x0AC0,0x0000, +0x0AC1,0x0000, 0x0AC2,0x0000, 0x0AC3,0x0000, 0x0AC4,0x0000, +0x0AC5,0x0000, 0x0AC6,0x0000, 0x0AC7,0x0000, 0x0AC8,0x0000, +0x0AC9,0x0000, 0x0ACA,0x0000, 0x0ACB,0x0000, 0x0ACC,0x0000, +0x0ACD,0x0000, 0x0ACE,0x0000, 0x0ACF,0x0000, 0x0AD0,0x0000, +0x0AD1,0x0000, 0x0AD2,0x0000, 0x0AD3,0x0000, 0x0AD4,0x0000, +0x0AD5,0x0000, 0x0AD6,0x0000, 0x0AD7,0x0000, 0x0AD8,0x0000, +0x0AD9,0x0000, 0x0ADA,0x0000, 0x0ADB,0x0000, 0x0ADC,0x0000, +0x0ADD,0x0000, 0x0ADE,0x0000, 0x0ADF,0x0000, 0x0AE0,0x0000, +0x0AE1,0x0000, 0x0AE2,0x0000, 0x0AE3,0x0000, 0x0AE4,0x0000, +0x0AE5,0x0000, 0x0AE6,0x0000, 0x0AE7,0x0000, 0x0AE8,0x0000, +0x0AE9,0x0000, 0x0AEA,0x0000, 0x0AEB,0x0000, 0x0AEC,0x0000, +0x0AED,0x0000, 0x0AEE,0x0000, 0x0AEF,0x0000, 0x0AF0,0x0000, +0x0AF1,0x0000, 0x0AF2,0x0000, 0x0AF3,0x0000, 0x0AF4,0x0000, +0x0AF5,0x0000, 0x0AF6,0x0000, 0x0AF7,0x0000, 0x0AF8,0x0000, +0x0AF9,0x0000, 0x0AFA,0x0000, 0x0AFB,0x0000, 0x0AFC,0x0000, +0x0AFD,0x0000, 0x0AFE,0x0000, 0x0AFF,0x0000, 0x0B00,0x0000, +0x0B01,0x0000, 0x0B02,0x0000, 0x0B03,0x0000, 0x0B04,0x0000, +0x0B05,0x0000, 0x0B06,0x0000, 0x0B07,0x0000, 0x0B08,0x0000, +0x0B09,0x0000, 0x0B0A,0x0000, 0x0B0B,0x0000, 0x0B0C,0x0000, +0x0B0D,0x0000, 0x0B0E,0x0000, 0x0B0F,0x0000, 0x0B10,0x0000, +0x0B11,0x0000, 0x0B12,0x0000, 0x0B13,0x0000, 0x0B14,0x0000, +0x0B15,0x0000, 0x0B16,0x0000, 0x0B17,0x0000, 0x0B18,0x0000, +0x0B19,0x0000, 0x0B1A,0x0000, 0x0B1B,0x0000, 0x0B1C,0x0000, +0x0B1D,0x0000, 0x0B1E,0x0000, 0x0B1F,0x0000, 0x0B20,0x0000, +0x0B21,0x0000, 0x0B22,0x0000, 0x0B23,0x0000, 0x0B24,0x0000, +0x0B25,0x0000, 0x0B26,0x0000, 0x0B27,0x0000, 0x0B28,0x0000 +}; + +uint16 page029data[]= { /* 2900 (2 weights per char) */ +0x0838,0x0000, 0x0839,0x0000, 0x083A,0x0000, 0x083B,0x0000, +0x083C,0x0000, 0x083D,0x0000, 0x083E,0x0000, 0x083F,0x0000, +0x0840,0x0000, 0x0841,0x0000, 0x0842,0x0000, 0x0843,0x0000, +0x0844,0x0000, 0x0845,0x0000, 0x0846,0x0000, 0x0847,0x0000, +0x0848,0x0000, 0x0849,0x0000, 0x084A,0x0000, 0x084B,0x0000, +0x084C,0x0000, 0x084D,0x0000, 0x084E,0x0000, 0x084F,0x0000, +0x0850,0x0000, 0x0851,0x0000, 0x0852,0x0000, 0x0853,0x0000, +0x0854,0x0000, 0x0855,0x0000, 0x0856,0x0000, 0x0857,0x0000, +0x0858,0x0000, 0x0859,0x0000, 0x085A,0x0000, 0x085B,0x0000, +0x085C,0x0000, 0x085D,0x0000, 0x085E,0x0000, 0x085F,0x0000, +0x0860,0x0000, 0x0861,0x0000, 0x0862,0x0000, 0x0863,0x0000, +0x0864,0x0000, 0x0865,0x0000, 0x0866,0x0000, 0x0867,0x0000, +0x0868,0x0000, 0x0869,0x0000, 0x086A,0x0000, 0x086B,0x0000, +0x086C,0x0000, 0x086D,0x0000, 0x086E,0x0000, 0x086F,0x0000, +0x0870,0x0000, 0x0871,0x0000, 0x0872,0x0000, 0x0873,0x0000, +0x0874,0x0000, 0x0875,0x0000, 0x0876,0x0000, 0x0877,0x0000, +0x0878,0x0000, 0x0879,0x0000, 0x087A,0x0000, 0x087B,0x0000, +0x087C,0x0000, 0x087D,0x0000, 0x087E,0x0000, 0x087F,0x0000, +0x0880,0x0000, 0x0881,0x0000, 0x0882,0x0000, 0x0883,0x0000, +0x0884,0x0000, 0x0885,0x0000, 0x0886,0x0000, 0x0887,0x0000, +0x0888,0x0000, 0x0889,0x0000, 0x088A,0x0000, 0x088B,0x0000, +0x088C,0x0000, 0x088D,0x0000, 0x088E,0x0000, 0x088F,0x0000, +0x0890,0x0000, 0x0891,0x0000, 0x0892,0x0000, 0x0893,0x0000, +0x0894,0x0000, 0x0895,0x0000, 0x0896,0x0000, 0x0897,0x0000, +0x0898,0x0000, 0x0899,0x0000, 0x089A,0x0000, 0x089B,0x0000, +0x089C,0x0000, 0x089D,0x0000, 0x089E,0x0000, 0x089F,0x0000, +0x08A0,0x0000, 0x08A1,0x0000, 0x08A2,0x0000, 0x08A3,0x0000, +0x08A4,0x0000, 0x08A5,0x0000, 0x08A6,0x0000, 0x08A7,0x0000, +0x08A8,0x0000, 0x08A9,0x0000, 0x08AA,0x0000, 0x08AB,0x0000, +0x08AC,0x0000, 0x08AD,0x0000, 0x08AE,0x0000, 0x08AF,0x0000, +0x08B0,0x0000, 0x08B1,0x0000, 0x08B2,0x0000, 0x08B3,0x0000, +0x08B4,0x0000, 0x08B5,0x0000, 0x08B6,0x0000, 0x08B7,0x0000, +0x08B8,0x0000, 0x08B9,0x0000, 0x08BA,0x0000, 0x0298,0x0000, +0x0299,0x0000, 0x029A,0x0000, 0x029B,0x0000, 0x029C,0x0000, +0x029D,0x0000, 0x029E,0x0000, 0x029F,0x0000, 0x02A0,0x0000, +0x02A1,0x0000, 0x02A2,0x0000, 0x02A3,0x0000, 0x02A4,0x0000, +0x02A5,0x0000, 0x02A6,0x0000, 0x02A7,0x0000, 0x02A8,0x0000, +0x02A9,0x0000, 0x02AA,0x0000, 0x02AB,0x0000, 0x02AC,0x0000, +0x02AD,0x0000, 0x08BB,0x0000, 0x08BC,0x0000, 0x08BD,0x0000, +0x08BE,0x0000, 0x08BF,0x0000, 0x08C0,0x0000, 0x08C1,0x0000, +0x08C2,0x0000, 0x08C3,0x0000, 0x08C4,0x0000, 0x08C5,0x0000, +0x08C6,0x0000, 0x08C7,0x0000, 0x08C8,0x0000, 0x08C9,0x0000, +0x08CA,0x0000, 0x08CB,0x0000, 0x08CC,0x0000, 0x08CD,0x0000, +0x08CE,0x0000, 0x08CF,0x0000, 0x08D0,0x0000, 0x08D1,0x0000, +0x08D2,0x0000, 0x08D3,0x0000, 0x08D4,0x0000, 0x08D5,0x0000, +0x08D6,0x0000, 0x08D7,0x0000, 0x08D8,0x0000, 0x08D9,0x0000, +0x08DA,0x0000, 0x08DB,0x0000, 0x08DC,0x0000, 0x08DD,0x0000, +0x08DE,0x0000, 0x08DF,0x0000, 0x08E0,0x0000, 0x08E1,0x0000, +0x08E2,0x0000, 0x08E3,0x0000, 0x08E4,0x0000, 0x08E5,0x0000, +0x08E6,0x0000, 0x08E7,0x0000, 0x08E8,0x0000, 0x08E9,0x0000, +0x08EA,0x0000, 0x08EB,0x0000, 0x08EC,0x0000, 0x08ED,0x0000, +0x08EE,0x0000, 0x08EF,0x0000, 0x08F0,0x0000, 0x08F1,0x0000, +0x08F2,0x0000, 0x08F3,0x0000, 0x08F4,0x0000, 0x08F5,0x0000, +0x08F6,0x0000, 0x08F7,0x0000, 0x08F8,0x0000, 0x08F9,0x0000, +0x08FA,0x0000, 0x08FB,0x0000, 0x08FC,0x0000, 0x08FD,0x0000, +0x08FE,0x0000, 0x08FF,0x0000, 0x0900,0x0000, 0x0901,0x0000, +0x0902,0x0000, 0x0903,0x0000, 0x0904,0x0000, 0x0905,0x0000, +0x0906,0x0000, 0x0907,0x0000, 0x0908,0x0000, 0x0909,0x0000, +0x090A,0x0000, 0x090B,0x0000, 0x090C,0x0000, 0x090D,0x0000, +0x090E,0x0000, 0x090F,0x0000, 0x0910,0x0000, 0x0911,0x0000, +0x0912,0x0000, 0x0913,0x0000, 0x0914,0x0000, 0x0915,0x0000, +0x0916,0x0000, 0x0917,0x0000, 0x0918,0x0000, 0x0919,0x0000, +0x091A,0x0000, 0x091B,0x0000, 0x091C,0x0000, 0x091D,0x0000, +0x0296,0x0000, 0x0297,0x0000, 0x091E,0x0000, 0x091F,0x0000 +}; + +uint16 page02Adata[]= { /* 2A00 (5 weights per char) */ +0x0920,0x0000,0x0000,0x0000,0x0000, +0x0921,0x0000,0x0000,0x0000,0x0000, +0x0922,0x0000,0x0000,0x0000,0x0000, +0x0923,0x0000,0x0000,0x0000,0x0000, +0x0924,0x0000,0x0000,0x0000,0x0000, +0x0925,0x0000,0x0000,0x0000,0x0000, +0x0926,0x0000,0x0000,0x0000,0x0000, +0x0927,0x0000,0x0000,0x0000,0x0000, +0x0928,0x0000,0x0000,0x0000,0x0000, +0x0929,0x0000,0x0000,0x0000,0x0000, +0x092A,0x0000,0x0000,0x0000,0x0000, +0x092B,0x0000,0x0000,0x0000,0x0000, +0x044B,0x044B,0x044B,0x044B,0x0000, +0x092C,0x0000,0x0000,0x0000,0x0000, +0x092D,0x0000,0x0000,0x0000,0x0000, +0x092E,0x0000,0x0000,0x0000,0x0000, +0x092F,0x0000,0x0000,0x0000,0x0000, +0x0930,0x0000,0x0000,0x0000,0x0000, +0x0931,0x0000,0x0000,0x0000,0x0000, +0x0932,0x0000,0x0000,0x0000,0x0000, +0x0933,0x0000,0x0000,0x0000,0x0000, +0x0934,0x0000,0x0000,0x0000,0x0000, +0x0935,0x0000,0x0000,0x0000,0x0000, +0x0936,0x0000,0x0000,0x0000,0x0000, +0x0937,0x0000,0x0000,0x0000,0x0000, +0x0938,0x0000,0x0000,0x0000,0x0000, +0x0939,0x0000,0x0000,0x0000,0x0000, +0x093A,0x0000,0x0000,0x0000,0x0000, +0x093B,0x0000,0x0000,0x0000,0x0000, +0x093C,0x0000,0x0000,0x0000,0x0000, +0x093D,0x0000,0x0000,0x0000,0x0000, +0x093E,0x0000,0x0000,0x0000,0x0000, +0x093F,0x0000,0x0000,0x0000,0x0000, +0x0940,0x0000,0x0000,0x0000,0x0000, +0x0941,0x0000,0x0000,0x0000,0x0000, +0x0942,0x0000,0x0000,0x0000,0x0000, +0x0943,0x0000,0x0000,0x0000,0x0000, +0x0944,0x0000,0x0000,0x0000,0x0000, +0x0945,0x0000,0x0000,0x0000,0x0000, +0x0946,0x0000,0x0000,0x0000,0x0000, +0x0947,0x0000,0x0000,0x0000,0x0000, +0x0948,0x0000,0x0000,0x0000,0x0000, +0x0949,0x0000,0x0000,0x0000,0x0000, +0x094A,0x0000,0x0000,0x0000,0x0000, +0x094B,0x0000,0x0000,0x0000,0x0000, +0x094C,0x0000,0x0000,0x0000,0x0000, +0x094D,0x0000,0x0000,0x0000,0x0000, +0x094E,0x0000,0x0000,0x0000,0x0000, +0x094F,0x0000,0x0000,0x0000,0x0000, +0x0950,0x0000,0x0000,0x0000,0x0000, +0x0951,0x0000,0x0000,0x0000,0x0000, +0x0952,0x0000,0x0000,0x0000,0x0000, +0x0953,0x0000,0x0000,0x0000,0x0000, +0x0954,0x0000,0x0000,0x0000,0x0000, +0x0955,0x0000,0x0000,0x0000,0x0000, +0x0956,0x0000,0x0000,0x0000,0x0000, +0x0957,0x0000,0x0000,0x0000,0x0000, +0x0958,0x0000,0x0000,0x0000,0x0000, +0x0959,0x0000,0x0000,0x0000,0x0000, +0x095A,0x0000,0x0000,0x0000,0x0000, +0x095B,0x0000,0x0000,0x0000,0x0000, +0x095C,0x0000,0x0000,0x0000,0x0000, +0x095D,0x0000,0x0000,0x0000,0x0000, +0x095E,0x0000,0x0000,0x0000,0x0000, +0x095F,0x0000,0x0000,0x0000,0x0000, +0x0960,0x0000,0x0000,0x0000,0x0000, +0x0961,0x0000,0x0000,0x0000,0x0000, +0x0962,0x0000,0x0000,0x0000,0x0000, +0x0963,0x0000,0x0000,0x0000,0x0000, +0x0964,0x0000,0x0000,0x0000,0x0000, +0x0965,0x0000,0x0000,0x0000,0x0000, +0x0966,0x0000,0x0000,0x0000,0x0000, +0x0967,0x0000,0x0000,0x0000,0x0000, +0x0968,0x0000,0x0000,0x0000,0x0000, +0x0969,0x0000,0x0000,0x0000,0x0000, +0x096A,0x0000,0x0000,0x0000,0x0000, +0x096B,0x0000,0x0000,0x0000,0x0000, +0x096C,0x0000,0x0000,0x0000,0x0000, +0x096D,0x0000,0x0000,0x0000,0x0000, +0x096E,0x0000,0x0000,0x0000,0x0000, +0x096F,0x0000,0x0000,0x0000,0x0000, +0x0970,0x0000,0x0000,0x0000,0x0000, +0x0971,0x0000,0x0000,0x0000,0x0000, +0x0972,0x0000,0x0000,0x0000,0x0000, +0x0973,0x0000,0x0000,0x0000,0x0000, +0x0974,0x0000,0x0000,0x0000,0x0000, +0x0975,0x0000,0x0000,0x0000,0x0000, +0x0976,0x0000,0x0000,0x0000,0x0000, +0x0977,0x0000,0x0000,0x0000,0x0000, +0x0978,0x0000,0x0000,0x0000,0x0000, +0x0979,0x0000,0x0000,0x0000,0x0000, +0x097A,0x0000,0x0000,0x0000,0x0000, +0x097B,0x0000,0x0000,0x0000,0x0000, +0x097C,0x0000,0x0000,0x0000,0x0000, +0x097D,0x0000,0x0000,0x0000,0x0000, +0x097E,0x0000,0x0000,0x0000,0x0000, +0x097F,0x0000,0x0000,0x0000,0x0000, +0x0980,0x0000,0x0000,0x0000,0x0000, +0x0981,0x0000,0x0000,0x0000,0x0000, +0x0982,0x0000,0x0000,0x0000,0x0000, +0x0983,0x0000,0x0000,0x0000,0x0000, +0x0984,0x0000,0x0000,0x0000,0x0000, +0x0985,0x0000,0x0000,0x0000,0x0000, +0x0986,0x0000,0x0000,0x0000,0x0000, +0x0987,0x0000,0x0000,0x0000,0x0000, +0x0988,0x0000,0x0000,0x0000,0x0000, +0x0989,0x0000,0x0000,0x0000,0x0000, +0x098A,0x0000,0x0000,0x0000,0x0000, +0x098B,0x0000,0x0000,0x0000,0x0000, +0x098C,0x0000,0x0000,0x0000,0x0000, +0x098D,0x0000,0x0000,0x0000,0x0000, +0x098E,0x0000,0x0000,0x0000,0x0000, +0x098F,0x0000,0x0000,0x0000,0x0000, +0x0990,0x0000,0x0000,0x0000,0x0000, +0x0991,0x0000,0x0000,0x0000,0x0000, +0x0992,0x0000,0x0000,0x0000,0x0000, +0x023D,0x023D,0x042D,0x0000,0x0000, +0x042D,0x042D,0x0000,0x0000,0x0000, +0x042D,0x042D,0x042D,0x0000,0x0000, +0x0993,0x0000,0x0000,0x0000,0x0000, +0x0994,0x0000,0x0000,0x0000,0x0000, +0x0995,0x0000,0x0000,0x0000,0x0000, +0x0996,0x0000,0x0000,0x0000,0x0000, +0x0997,0x0000,0x0000,0x0000,0x0000, +0x0998,0x0000,0x0000,0x0000,0x0000, +0x0999,0x0000,0x0000,0x0000,0x0000, +0x099A,0x0000,0x0000,0x0000,0x0000, +0x099B,0x0000,0x0000,0x0000,0x0000, +0x099C,0x0000,0x0000,0x0000,0x0000, +0x099D,0x0000,0x0000,0x0000,0x0000, +0x099E,0x0000,0x0000,0x0000,0x0000, +0x099F,0x0000,0x0000,0x0000,0x0000, +0x09A0,0x0000,0x0000,0x0000,0x0000, +0x09A1,0x0000,0x0000,0x0000,0x0000, +0x09A2,0x0000,0x0000,0x0000,0x0000, +0x09A3,0x0000,0x0000,0x0000,0x0000, +0x09A4,0x0000,0x0000,0x0000,0x0000, +0x09A5,0x0000,0x0000,0x0000,0x0000, +0x09A6,0x0000,0x0000,0x0000,0x0000, +0x09A7,0x0000,0x0000,0x0000,0x0000, +0x09A8,0x0000,0x0000,0x0000,0x0000, +0x09A9,0x0000,0x0000,0x0000,0x0000, +0x09AA,0x0000,0x0000,0x0000,0x0000, +0x09AB,0x0000,0x0000,0x0000,0x0000, +0x09AC,0x0000,0x0000,0x0000,0x0000, +0x09AD,0x0000,0x0000,0x0000,0x0000, +0x09AE,0x0000,0x0000,0x0000,0x0000, +0x09AF,0x0000,0x0000,0x0000,0x0000, +0x09B0,0x0000,0x0000,0x0000,0x0000, +0x09B1,0x0000,0x0000,0x0000,0x0000, +0x09B2,0x0000,0x0000,0x0000,0x0000, +0x09B3,0x0000,0x0000,0x0000,0x0000, +0x09B4,0x0000,0x0000,0x0000,0x0000, +0x09B5,0x0000,0x0000,0x0000,0x0000, +0x09B6,0x0000,0x0000,0x0000,0x0000, +0x09B7,0x0000,0x0000,0x0000,0x0000, +0x09B8,0x0000,0x0000,0x0000,0x0000, +0x09B9,0x0000,0x0000,0x0000,0x0000, +0x09BA,0x0000,0x0000,0x0000,0x0000, +0x09BB,0x0000,0x0000,0x0000,0x0000, +0x09BC,0x0000,0x0000,0x0000,0x0000, +0x09BD,0x0000,0x0000,0x0000,0x0000, +0x09BE,0x0000,0x0000,0x0000,0x0000, +0x09BF,0x0000,0x0000,0x0000,0x0000, +0x09C0,0x0000,0x0000,0x0000,0x0000, +0x09C1,0x0000,0x0000,0x0000,0x0000, +0x09C2,0x0000,0x0000,0x0000,0x0000, +0x09C3,0x0000,0x0000,0x0000,0x0000, +0x09C4,0x0000,0x0000,0x0000,0x0000, +0x09C5,0x0000,0x0000,0x0000,0x0000, +0x09C6,0x0000,0x0000,0x0000,0x0000, +0x09C7,0x0000,0x0000,0x0000,0x0000, +0x09C8,0x0000,0x0000,0x0000,0x0000, +0x09C9,0x0000,0x0000,0x0000,0x0000, +0x09CA,0x0000,0x0000,0x0000,0x0000, +0x09CB,0x0000,0x0000,0x0000,0x0000, +0x09CC,0x0000,0x0000,0x0000,0x0000, +0x09CD,0x0000,0x0000,0x0000,0x0000, +0x09CE,0x0000,0x0000,0x0000,0x0000, +0x09CF,0x0000,0x0000,0x0000,0x0000, +0x09D0,0x0000,0x0000,0x0000,0x0000, +0x09D1,0x0000,0x0000,0x0000,0x0000, +0x09D2,0x0000,0x0000,0x0000,0x0000, +0x09D3,0x0000,0x0000,0x0000,0x0000, +0x09D4,0x0000,0x0000,0x0000,0x0000, +0x09D5,0x0000,0x0000,0x0000,0x0000, +0x09D6,0x0000,0x0000,0x0000,0x0000, +0x09D7,0x0000,0x0000,0x0000,0x0000, +0x09D8,0x0000,0x0000,0x0000,0x0000, +0x09D9,0x0000,0x0000,0x0000,0x0000, +0x09DA,0x0000,0x0000,0x0000,0x0000, +0x09DB,0x0000,0x0000,0x0000,0x0000, +0x09DC,0x0000,0x0000,0x0000,0x0000, +0x09DD,0x0000,0x0000,0x0000,0x0000, +0x09DE,0x0000,0x0000,0x0000,0x0000, +0x09DF,0x0000,0x0000,0x0000,0x0000, +0x09E0,0x0000,0x0000,0x0000,0x0000, +0x09E1,0x0000,0x0000,0x0000,0x0000, +0x09E2,0x0000,0x0000,0x0000,0x0000, +0x09E3,0x0000,0x0000,0x0000,0x0000, +0x09E4,0x0000,0x0000,0x0000,0x0000, +0x09E5,0x0000,0x0000,0x0000,0x0000, +0x09E6,0x0000,0x0000,0x0000,0x0000, +0x09E7,0x0000,0x0000,0x0000,0x0000, +0x09E8,0x0000,0x0000,0x0000,0x0000, +0x09E9,0x0000,0x0000,0x0000,0x0000, +0x09EA,0x0000,0x0000,0x0000,0x0000, +0x09EB,0x0000,0x0000,0x0000,0x0000, +0x09EC,0x0000,0x0000,0x0000,0x0000, +0x09ED,0x0000,0x0000,0x0000,0x0000, +0x09EE,0x0000,0x0000,0x0000,0x0000, +0x09EF,0x0000,0x0000,0x0000,0x0000, +0x09F0,0x0000,0x0000,0x0000,0x0000, +0x09F1,0x0000,0x0000,0x0000,0x0000, +0x09F2,0x0000,0x0000,0x0000,0x0000, +0x09F3,0x0000,0x0000,0x0000,0x0000, +0x09F4,0x0000,0x0000,0x0000,0x0000, +0x09F5,0x0000,0x0000,0x0000,0x0000, +0x09F6,0x0000,0x0000,0x0000,0x0000, +0x09F7,0x0000,0x0000,0x0000,0x0000, +0x09F8,0x0000,0x0000,0x0000,0x0000, +0x09F8,0x0000,0x0000,0x0000,0x0000, +0x09F9,0x0000,0x0000,0x0000,0x0000, +0x09FA,0x0000,0x0000,0x0000,0x0000, +0x09FB,0x0000,0x0000,0x0000,0x0000, +0x09FC,0x0000,0x0000,0x0000,0x0000, +0x09FD,0x0000,0x0000,0x0000,0x0000, +0x09FE,0x0000,0x0000,0x0000,0x0000, +0x09FF,0x0000,0x0000,0x0000,0x0000, +0x0A00,0x0000,0x0000,0x0000,0x0000, +0x0A01,0x0000,0x0000,0x0000,0x0000, +0x0A02,0x0000,0x0000,0x0000,0x0000, +0x0A03,0x0000,0x0000,0x0000,0x0000, +0x0A04,0x0000,0x0000,0x0000,0x0000, +0x0A05,0x0000,0x0000,0x0000,0x0000, +0x0A06,0x0000,0x0000,0x0000,0x0000, +0x0A07,0x0000,0x0000,0x0000,0x0000, +0x0A08,0x0000,0x0000,0x0000,0x0000, +0x0A09,0x0000,0x0000,0x0000,0x0000, +0x0A0A,0x0000,0x0000,0x0000,0x0000, +0x0A0B,0x0000,0x0000,0x0000,0x0000, +0x0A0C,0x0000,0x0000,0x0000,0x0000, +0x0A0D,0x0000,0x0000,0x0000,0x0000, +0x0A0E,0x0000,0x0000,0x0000,0x0000, +0x0A0F,0x0000,0x0000,0x0000,0x0000, +0x0A10,0x0000,0x0000,0x0000,0x0000, +0x0A11,0x0000,0x0000,0x0000,0x0000, +0x0A12,0x0000,0x0000,0x0000,0x0000, +0x0A13,0x0000,0x0000,0x0000,0x0000, +0x0A14,0x0000,0x0000,0x0000,0x0000, +0x0A15,0x0000,0x0000,0x0000,0x0000, +0x0A16,0x0000,0x0000,0x0000,0x0000, +0x0A17,0x0000,0x0000,0x0000,0x0000, +0x0A18,0x0000,0x0000,0x0000,0x0000, +0x0A19,0x0000,0x0000,0x0000,0x0000, +0x0A1A,0x0000,0x0000,0x0000,0x0000 +}; + +uint16 page02Bdata[]= { /* 2B00 (3 weights per char) */ +0x0A1B,0x0000,0x0000, 0x0A1C,0x0000,0x0000, 0x0A1D,0x0000,0x0000, +0x0A1E,0x0000,0x0000, 0x0A1F,0x0000,0x0000, 0x0A20,0x0000,0x0000, +0x0A21,0x0000,0x0000, 0x0A22,0x0000,0x0000, 0x0A23,0x0000,0x0000, +0x0A24,0x0000,0x0000, 0x0A25,0x0000,0x0000, 0x0A26,0x0000,0x0000, +0x0A27,0x0000,0x0000, 0x0A28,0x0000,0x0000, 0xFBC0,0xAB0E,0x0000, +0xFBC0,0xAB0F,0x0000, 0xFBC0,0xAB10,0x0000, 0xFBC0,0xAB11,0x0000, +0xFBC0,0xAB12,0x0000, 0xFBC0,0xAB13,0x0000, 0xFBC0,0xAB14,0x0000, +0xFBC0,0xAB15,0x0000, 0xFBC0,0xAB16,0x0000, 0xFBC0,0xAB17,0x0000, +0xFBC0,0xAB18,0x0000, 0xFBC0,0xAB19,0x0000, 0xFBC0,0xAB1A,0x0000, +0xFBC0,0xAB1B,0x0000, 0xFBC0,0xAB1C,0x0000, 0xFBC0,0xAB1D,0x0000, +0xFBC0,0xAB1E,0x0000, 0xFBC0,0xAB1F,0x0000, 0xFBC0,0xAB20,0x0000, +0xFBC0,0xAB21,0x0000, 0xFBC0,0xAB22,0x0000, 0xFBC0,0xAB23,0x0000, +0xFBC0,0xAB24,0x0000, 0xFBC0,0xAB25,0x0000, 0xFBC0,0xAB26,0x0000, +0xFBC0,0xAB27,0x0000, 0xFBC0,0xAB28,0x0000, 0xFBC0,0xAB29,0x0000, +0xFBC0,0xAB2A,0x0000, 0xFBC0,0xAB2B,0x0000, 0xFBC0,0xAB2C,0x0000, +0xFBC0,0xAB2D,0x0000, 0xFBC0,0xAB2E,0x0000, 0xFBC0,0xAB2F,0x0000, +0xFBC0,0xAB30,0x0000, 0xFBC0,0xAB31,0x0000, 0xFBC0,0xAB32,0x0000, +0xFBC0,0xAB33,0x0000, 0xFBC0,0xAB34,0x0000, 0xFBC0,0xAB35,0x0000, +0xFBC0,0xAB36,0x0000, 0xFBC0,0xAB37,0x0000, 0xFBC0,0xAB38,0x0000, +0xFBC0,0xAB39,0x0000, 0xFBC0,0xAB3A,0x0000, 0xFBC0,0xAB3B,0x0000, +0xFBC0,0xAB3C,0x0000, 0xFBC0,0xAB3D,0x0000, 0xFBC0,0xAB3E,0x0000, +0xFBC0,0xAB3F,0x0000, 0xFBC0,0xAB40,0x0000, 0xFBC0,0xAB41,0x0000, +0xFBC0,0xAB42,0x0000, 0xFBC0,0xAB43,0x0000, 0xFBC0,0xAB44,0x0000, +0xFBC0,0xAB45,0x0000, 0xFBC0,0xAB46,0x0000, 0xFBC0,0xAB47,0x0000, +0xFBC0,0xAB48,0x0000, 0xFBC0,0xAB49,0x0000, 0xFBC0,0xAB4A,0x0000, +0xFBC0,0xAB4B,0x0000, 0xFBC0,0xAB4C,0x0000, 0xFBC0,0xAB4D,0x0000, +0xFBC0,0xAB4E,0x0000, 0xFBC0,0xAB4F,0x0000, 0xFBC0,0xAB50,0x0000, +0xFBC0,0xAB51,0x0000, 0xFBC0,0xAB52,0x0000, 0xFBC0,0xAB53,0x0000, +0xFBC0,0xAB54,0x0000, 0xFBC0,0xAB55,0x0000, 0xFBC0,0xAB56,0x0000, +0xFBC0,0xAB57,0x0000, 0xFBC0,0xAB58,0x0000, 0xFBC0,0xAB59,0x0000, +0xFBC0,0xAB5A,0x0000, 0xFBC0,0xAB5B,0x0000, 0xFBC0,0xAB5C,0x0000, +0xFBC0,0xAB5D,0x0000, 0xFBC0,0xAB5E,0x0000, 0xFBC0,0xAB5F,0x0000, +0xFBC0,0xAB60,0x0000, 0xFBC0,0xAB61,0x0000, 0xFBC0,0xAB62,0x0000, +0xFBC0,0xAB63,0x0000, 0xFBC0,0xAB64,0x0000, 0xFBC0,0xAB65,0x0000, +0xFBC0,0xAB66,0x0000, 0xFBC0,0xAB67,0x0000, 0xFBC0,0xAB68,0x0000, +0xFBC0,0xAB69,0x0000, 0xFBC0,0xAB6A,0x0000, 0xFBC0,0xAB6B,0x0000, +0xFBC0,0xAB6C,0x0000, 0xFBC0,0xAB6D,0x0000, 0xFBC0,0xAB6E,0x0000, +0xFBC0,0xAB6F,0x0000, 0xFBC0,0xAB70,0x0000, 0xFBC0,0xAB71,0x0000, +0xFBC0,0xAB72,0x0000, 0xFBC0,0xAB73,0x0000, 0xFBC0,0xAB74,0x0000, +0xFBC0,0xAB75,0x0000, 0xFBC0,0xAB76,0x0000, 0xFBC0,0xAB77,0x0000, +0xFBC0,0xAB78,0x0000, 0xFBC0,0xAB79,0x0000, 0xFBC0,0xAB7A,0x0000, +0xFBC0,0xAB7B,0x0000, 0xFBC0,0xAB7C,0x0000, 0xFBC0,0xAB7D,0x0000, +0xFBC0,0xAB7E,0x0000, 0xFBC0,0xAB7F,0x0000, 0xFBC0,0xAB80,0x0000, +0xFBC0,0xAB81,0x0000, 0xFBC0,0xAB82,0x0000, 0xFBC0,0xAB83,0x0000, +0xFBC0,0xAB84,0x0000, 0xFBC0,0xAB85,0x0000, 0xFBC0,0xAB86,0x0000, +0xFBC0,0xAB87,0x0000, 0xFBC0,0xAB88,0x0000, 0xFBC0,0xAB89,0x0000, +0xFBC0,0xAB8A,0x0000, 0xFBC0,0xAB8B,0x0000, 0xFBC0,0xAB8C,0x0000, +0xFBC0,0xAB8D,0x0000, 0xFBC0,0xAB8E,0x0000, 0xFBC0,0xAB8F,0x0000, +0xFBC0,0xAB90,0x0000, 0xFBC0,0xAB91,0x0000, 0xFBC0,0xAB92,0x0000, +0xFBC0,0xAB93,0x0000, 0xFBC0,0xAB94,0x0000, 0xFBC0,0xAB95,0x0000, +0xFBC0,0xAB96,0x0000, 0xFBC0,0xAB97,0x0000, 0xFBC0,0xAB98,0x0000, +0xFBC0,0xAB99,0x0000, 0xFBC0,0xAB9A,0x0000, 0xFBC0,0xAB9B,0x0000, +0xFBC0,0xAB9C,0x0000, 0xFBC0,0xAB9D,0x0000, 0xFBC0,0xAB9E,0x0000, +0xFBC0,0xAB9F,0x0000, 0xFBC0,0xABA0,0x0000, 0xFBC0,0xABA1,0x0000, +0xFBC0,0xABA2,0x0000, 0xFBC0,0xABA3,0x0000, 0xFBC0,0xABA4,0x0000, +0xFBC0,0xABA5,0x0000, 0xFBC0,0xABA6,0x0000, 0xFBC0,0xABA7,0x0000, +0xFBC0,0xABA8,0x0000, 0xFBC0,0xABA9,0x0000, 0xFBC0,0xABAA,0x0000, +0xFBC0,0xABAB,0x0000, 0xFBC0,0xABAC,0x0000, 0xFBC0,0xABAD,0x0000, +0xFBC0,0xABAE,0x0000, 0xFBC0,0xABAF,0x0000, 0xFBC0,0xABB0,0x0000, +0xFBC0,0xABB1,0x0000, 0xFBC0,0xABB2,0x0000, 0xFBC0,0xABB3,0x0000, +0xFBC0,0xABB4,0x0000, 0xFBC0,0xABB5,0x0000, 0xFBC0,0xABB6,0x0000, +0xFBC0,0xABB7,0x0000, 0xFBC0,0xABB8,0x0000, 0xFBC0,0xABB9,0x0000, +0xFBC0,0xABBA,0x0000, 0xFBC0,0xABBB,0x0000, 0xFBC0,0xABBC,0x0000, +0xFBC0,0xABBD,0x0000, 0xFBC0,0xABBE,0x0000, 0xFBC0,0xABBF,0x0000, +0xFBC0,0xABC0,0x0000, 0xFBC0,0xABC1,0x0000, 0xFBC0,0xABC2,0x0000, +0xFBC0,0xABC3,0x0000, 0xFBC0,0xABC4,0x0000, 0xFBC0,0xABC5,0x0000, +0xFBC0,0xABC6,0x0000, 0xFBC0,0xABC7,0x0000, 0xFBC0,0xABC8,0x0000, +0xFBC0,0xABC9,0x0000, 0xFBC0,0xABCA,0x0000, 0xFBC0,0xABCB,0x0000, +0xFBC0,0xABCC,0x0000, 0xFBC0,0xABCD,0x0000, 0xFBC0,0xABCE,0x0000, +0xFBC0,0xABCF,0x0000, 0xFBC0,0xABD0,0x0000, 0xFBC0,0xABD1,0x0000, +0xFBC0,0xABD2,0x0000, 0xFBC0,0xABD3,0x0000, 0xFBC0,0xABD4,0x0000, +0xFBC0,0xABD5,0x0000, 0xFBC0,0xABD6,0x0000, 0xFBC0,0xABD7,0x0000, +0xFBC0,0xABD8,0x0000, 0xFBC0,0xABD9,0x0000, 0xFBC0,0xABDA,0x0000, +0xFBC0,0xABDB,0x0000, 0xFBC0,0xABDC,0x0000, 0xFBC0,0xABDD,0x0000, +0xFBC0,0xABDE,0x0000, 0xFBC0,0xABDF,0x0000, 0xFBC0,0xABE0,0x0000, +0xFBC0,0xABE1,0x0000, 0xFBC0,0xABE2,0x0000, 0xFBC0,0xABE3,0x0000, +0xFBC0,0xABE4,0x0000, 0xFBC0,0xABE5,0x0000, 0xFBC0,0xABE6,0x0000, +0xFBC0,0xABE7,0x0000, 0xFBC0,0xABE8,0x0000, 0xFBC0,0xABE9,0x0000, +0xFBC0,0xABEA,0x0000, 0xFBC0,0xABEB,0x0000, 0xFBC0,0xABEC,0x0000, +0xFBC0,0xABED,0x0000, 0xFBC0,0xABEE,0x0000, 0xFBC0,0xABEF,0x0000, +0xFBC0,0xABF0,0x0000, 0xFBC0,0xABF1,0x0000, 0xFBC0,0xABF2,0x0000, +0xFBC0,0xABF3,0x0000, 0xFBC0,0xABF4,0x0000, 0xFBC0,0xABF5,0x0000, +0xFBC0,0xABF6,0x0000, 0xFBC0,0xABF7,0x0000, 0xFBC0,0xABF8,0x0000, +0xFBC0,0xABF9,0x0000, 0xFBC0,0xABFA,0x0000, 0xFBC0,0xABFB,0x0000, +0xFBC0,0xABFC,0x0000, 0xFBC0,0xABFD,0x0000, 0xFBC0,0xABFE,0x0000, +0xFBC0,0xABFF,0x0000 }; + +uint16 page02Edata[]= { /* 2E00 (3 weights per char) */ +0xFBC0,0xAE00,0x0000, 0xFBC0,0xAE01,0x0000, 0xFBC0,0xAE02,0x0000, +0xFBC0,0xAE03,0x0000, 0xFBC0,0xAE04,0x0000, 0xFBC0,0xAE05,0x0000, +0xFBC0,0xAE06,0x0000, 0xFBC0,0xAE07,0x0000, 0xFBC0,0xAE08,0x0000, +0xFBC0,0xAE09,0x0000, 0xFBC0,0xAE0A,0x0000, 0xFBC0,0xAE0B,0x0000, +0xFBC0,0xAE0C,0x0000, 0xFBC0,0xAE0D,0x0000, 0xFBC0,0xAE0E,0x0000, +0xFBC0,0xAE0F,0x0000, 0xFBC0,0xAE10,0x0000, 0xFBC0,0xAE11,0x0000, +0xFBC0,0xAE12,0x0000, 0xFBC0,0xAE13,0x0000, 0xFBC0,0xAE14,0x0000, +0xFBC0,0xAE15,0x0000, 0xFBC0,0xAE16,0x0000, 0xFBC0,0xAE17,0x0000, +0xFBC0,0xAE18,0x0000, 0xFBC0,0xAE19,0x0000, 0xFBC0,0xAE1A,0x0000, +0xFBC0,0xAE1B,0x0000, 0xFBC0,0xAE1C,0x0000, 0xFBC0,0xAE1D,0x0000, +0xFBC0,0xAE1E,0x0000, 0xFBC0,0xAE1F,0x0000, 0xFBC0,0xAE20,0x0000, +0xFBC0,0xAE21,0x0000, 0xFBC0,0xAE22,0x0000, 0xFBC0,0xAE23,0x0000, +0xFBC0,0xAE24,0x0000, 0xFBC0,0xAE25,0x0000, 0xFBC0,0xAE26,0x0000, +0xFBC0,0xAE27,0x0000, 0xFBC0,0xAE28,0x0000, 0xFBC0,0xAE29,0x0000, +0xFBC0,0xAE2A,0x0000, 0xFBC0,0xAE2B,0x0000, 0xFBC0,0xAE2C,0x0000, +0xFBC0,0xAE2D,0x0000, 0xFBC0,0xAE2E,0x0000, 0xFBC0,0xAE2F,0x0000, +0xFBC0,0xAE30,0x0000, 0xFBC0,0xAE31,0x0000, 0xFBC0,0xAE32,0x0000, +0xFBC0,0xAE33,0x0000, 0xFBC0,0xAE34,0x0000, 0xFBC0,0xAE35,0x0000, +0xFBC0,0xAE36,0x0000, 0xFBC0,0xAE37,0x0000, 0xFBC0,0xAE38,0x0000, +0xFBC0,0xAE39,0x0000, 0xFBC0,0xAE3A,0x0000, 0xFBC0,0xAE3B,0x0000, +0xFBC0,0xAE3C,0x0000, 0xFBC0,0xAE3D,0x0000, 0xFBC0,0xAE3E,0x0000, +0xFBC0,0xAE3F,0x0000, 0xFBC0,0xAE40,0x0000, 0xFBC0,0xAE41,0x0000, +0xFBC0,0xAE42,0x0000, 0xFBC0,0xAE43,0x0000, 0xFBC0,0xAE44,0x0000, +0xFBC0,0xAE45,0x0000, 0xFBC0,0xAE46,0x0000, 0xFBC0,0xAE47,0x0000, +0xFBC0,0xAE48,0x0000, 0xFBC0,0xAE49,0x0000, 0xFBC0,0xAE4A,0x0000, +0xFBC0,0xAE4B,0x0000, 0xFBC0,0xAE4C,0x0000, 0xFBC0,0xAE4D,0x0000, +0xFBC0,0xAE4E,0x0000, 0xFBC0,0xAE4F,0x0000, 0xFBC0,0xAE50,0x0000, +0xFBC0,0xAE51,0x0000, 0xFBC0,0xAE52,0x0000, 0xFBC0,0xAE53,0x0000, +0xFBC0,0xAE54,0x0000, 0xFBC0,0xAE55,0x0000, 0xFBC0,0xAE56,0x0000, +0xFBC0,0xAE57,0x0000, 0xFBC0,0xAE58,0x0000, 0xFBC0,0xAE59,0x0000, +0xFBC0,0xAE5A,0x0000, 0xFBC0,0xAE5B,0x0000, 0xFBC0,0xAE5C,0x0000, +0xFBC0,0xAE5D,0x0000, 0xFBC0,0xAE5E,0x0000, 0xFBC0,0xAE5F,0x0000, +0xFBC0,0xAE60,0x0000, 0xFBC0,0xAE61,0x0000, 0xFBC0,0xAE62,0x0000, +0xFBC0,0xAE63,0x0000, 0xFBC0,0xAE64,0x0000, 0xFBC0,0xAE65,0x0000, +0xFBC0,0xAE66,0x0000, 0xFBC0,0xAE67,0x0000, 0xFBC0,0xAE68,0x0000, +0xFBC0,0xAE69,0x0000, 0xFBC0,0xAE6A,0x0000, 0xFBC0,0xAE6B,0x0000, +0xFBC0,0xAE6C,0x0000, 0xFBC0,0xAE6D,0x0000, 0xFBC0,0xAE6E,0x0000, +0xFBC0,0xAE6F,0x0000, 0xFBC0,0xAE70,0x0000, 0xFBC0,0xAE71,0x0000, +0xFBC0,0xAE72,0x0000, 0xFBC0,0xAE73,0x0000, 0xFBC0,0xAE74,0x0000, +0xFBC0,0xAE75,0x0000, 0xFBC0,0xAE76,0x0000, 0xFBC0,0xAE77,0x0000, +0xFBC0,0xAE78,0x0000, 0xFBC0,0xAE79,0x0000, 0xFBC0,0xAE7A,0x0000, +0xFBC0,0xAE7B,0x0000, 0xFBC0,0xAE7C,0x0000, 0xFBC0,0xAE7D,0x0000, +0xFBC0,0xAE7E,0x0000, 0xFBC0,0xAE7F,0x0000, 0xFB40,0xCE36,0x0000, +0xFB40,0xD382,0x0000, 0xFB40,0xCE5B,0x0000, 0xFB40,0xCE5A,0x0000, +0xFB40,0xCE59,0x0000, 0xFB40,0xCEBB,0x0000, 0xFB40,0xD182,0x0000, +0xFB40,0xD1E0,0x0000, 0xFB40,0xD200,0x0000, 0xFB40,0xD202,0x0000, +0xFB40,0xD35C,0x0000, 0xFB40,0xD369,0x0000, 0xFB40,0xDC0F,0x0000, +0xFB40,0xDC0F,0x0000, 0xFB40,0xDC22,0x0000, 0xFB40,0xDC23,0x0000, +0xFB40,0xDC22,0x0000, 0xFB40,0xDC23,0x0000, 0xFB40,0xDDF3,0x0000, +0xFB40,0xDE7A,0x0000, 0xFB40,0xDF51,0x0000, 0xFB40,0xDF50,0x0000, +0xFB40,0xDFC4,0x0000, 0xFB40,0xDFC3,0x0000, 0xFB40,0xE24C,0x0000, +0xFB40,0xE535,0x0000, 0xFBC0,0xAE9A,0x0000, 0xFB40,0xE5E1,0x0000, +0xFB40,0xE5E5,0x0000, 0xFB40,0xE708,0x0000, 0xFB40,0xEB7A,0x0000, +0xFB40,0xEBCD,0x0000, 0xFB40,0xEC11,0x0000, 0xFB40,0xEC35,0x0000, +0xFB40,0xEC3A,0x0000, 0xFB40,0xF06C,0x0000, 0xFB40,0xF22B,0x0000, +0xFB40,0xF22B,0x0000, 0xFB40,0xCE2C,0x0000, 0xFB40,0xF25B,0x0000, +0xFB40,0xF2AD,0x0000, 0xFB40,0xF38B,0x0000, 0xFB40,0xF58B,0x0000, +0xFB40,0xF6EE,0x0000, 0xFB40,0xF93A,0x0000, 0xFB40,0xF93B,0x0000, +0xFB40,0xFAF9,0x0000, 0xFB40,0xFCF9,0x0000, 0xFB40,0xFE9F,0x0000, +0xFB40,0xFF53,0x0000, 0xFB40,0xFF52,0x0000, 0xFB40,0xFF53,0x0000, +0xFB40,0xFF53,0x0000, 0xFB40,0xFF52,0x0000, 0xFB40,0xFF8A,0x0000, +0xFB40,0xFF8A,0x0000, 0xFB40,0xFF8B,0x0000, 0xFB41,0x8002,0x0000, +0xFB41,0x8080,0x0000, 0xFB41,0x807F,0x0000, 0xFB41,0x8089,0x0000, +0xFB41,0x81FC,0x0000, 0xFB41,0x8279,0x0000, 0xFB41,0x8279,0x0000, +0xFB41,0x8279,0x0000, 0xFB41,0x864E,0x0000, 0xFB41,0x8864,0x0000, +0xFB41,0x8980,0x0000, 0xFB41,0x897F,0x0000, 0xFB41,0x89C1,0x0000, +0xFB41,0x89D2,0x0000, 0xFB41,0x89D2,0x0000, 0xFB41,0x8BA0,0x0000, +0xFB41,0x8D1D,0x0000, 0xFB41,0x8DB3,0x0000, 0xFB41,0x8F66,0x0000, +0xFB41,0x8FB6,0x0000, 0xFB41,0x8FB6,0x0000, 0xFB41,0x8FB6,0x0000, +0xFB41,0x9091,0x0000, 0xFB41,0x9485,0x0000, 0xFB41,0x9577,0x0000, +0xFB41,0x9578,0x0000, 0xFB41,0x957F,0x0000, 0xFB41,0x95E8,0x0000, +0xFB41,0x961C,0x0000, 0xFB41,0x961D,0x0000, 0xFB41,0x96E8,0x0000, +0xFB41,0x9752,0x0000, 0xFB41,0x97E6,0x0000, 0xFB41,0x9875,0x0000, +0xFB41,0x98CE,0x0000, 0xFB41,0x98DE,0x0000, 0xFB41,0x98DF,0x0000, +0xFB41,0x98E0,0x0000, 0xFB41,0x98E0,0x0000, 0xFB41,0x9963,0x0000, +0xFB41,0x9996,0x0000, 0xFB41,0x9A6C,0x0000, 0xFB41,0x9AA8,0x0000, +0xFB41,0x9B3C,0x0000, 0xFB41,0x9C7C,0x0000, 0xFB41,0x9E1F,0x0000, +0xFB41,0x9E75,0x0000, 0xFB41,0x9EA6,0x0000, 0xFB41,0x9EC4,0x0000, +0xFB41,0x9EFE,0x0000, 0xFB41,0x9F4A,0x0000, 0xFB41,0x9F50,0x0000, +0xFB41,0x9F52,0x0000, 0xFB41,0x9F7F,0x0000, 0xFB41,0x9F8D,0x0000, +0xFB41,0x9F99,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000, +0xFB41,0x9F9F,0x0000, 0xFBC0,0xAEF4,0x0000, 0xFBC0,0xAEF5,0x0000, +0xFBC0,0xAEF6,0x0000, 0xFBC0,0xAEF7,0x0000, 0xFBC0,0xAEF8,0x0000, +0xFBC0,0xAEF9,0x0000, 0xFBC0,0xAEFA,0x0000, 0xFBC0,0xAEFB,0x0000, +0xFBC0,0xAEFC,0x0000, 0xFBC0,0xAEFD,0x0000, 0xFBC0,0xAEFE,0x0000, +0xFBC0,0xAEFF,0x0000 }; + +uint16 page02Fdata[]= { /* 2F00 (3 weights per char) */ +0xFB40,0xCE00,0x0000, 0xFB40,0xCE28,0x0000, 0xFB40,0xCE36,0x0000, +0xFB40,0xCE3F,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE85,0x0000, +0xFB40,0xCE8C,0x0000, 0xFB40,0xCEA0,0x0000, 0xFB40,0xCEBA,0x0000, +0xFB40,0xD13F,0x0000, 0xFB40,0xD165,0x0000, 0xFB40,0xD16B,0x0000, +0xFB40,0xD182,0x0000, 0xFB40,0xD196,0x0000, 0xFB40,0xD1AB,0x0000, +0xFB40,0xD1E0,0x0000, 0xFB40,0xD1F5,0x0000, 0xFB40,0xD200,0x0000, +0xFB40,0xD29B,0x0000, 0xFB40,0xD2F9,0x0000, 0xFB40,0xD315,0x0000, +0xFB40,0xD31A,0x0000, 0xFB40,0xD338,0x0000, 0xFB40,0xD341,0x0000, +0xFB40,0xD35C,0x0000, 0xFB40,0xD369,0x0000, 0xFB40,0xD382,0x0000, +0xFB40,0xD3B6,0x0000, 0xFB40,0xD3C8,0x0000, 0xFB40,0xD3E3,0x0000, +0xFB40,0xD6D7,0x0000, 0xFB40,0xD71F,0x0000, 0xFB40,0xD8EB,0x0000, +0xFB40,0xD902,0x0000, 0xFB40,0xD90A,0x0000, 0xFB40,0xD915,0x0000, +0xFB40,0xD927,0x0000, 0xFB40,0xD973,0x0000, 0xFB40,0xDB50,0x0000, +0xFB40,0xDB80,0x0000, 0xFB40,0xDBF8,0x0000, 0xFB40,0xDC0F,0x0000, +0xFB40,0xDC22,0x0000, 0xFB40,0xDC38,0x0000, 0xFB40,0xDC6E,0x0000, +0xFB40,0xDC71,0x0000, 0xFB40,0xDDDB,0x0000, 0xFB40,0xDDE5,0x0000, +0xFB40,0xDDF1,0x0000, 0xFB40,0xDDFE,0x0000, 0xFB40,0xDE72,0x0000, +0xFB40,0xDE7A,0x0000, 0xFB40,0xDE7F,0x0000, 0xFB40,0xDEF4,0x0000, +0xFB40,0xDEFE,0x0000, 0xFB40,0xDF0B,0x0000, 0xFB40,0xDF13,0x0000, +0xFB40,0xDF50,0x0000, 0xFB40,0xDF61,0x0000, 0xFB40,0xDF73,0x0000, +0xFB40,0xDFC3,0x0000, 0xFB40,0xE208,0x0000, 0xFB40,0xE236,0x0000, +0xFB40,0xE24B,0x0000, 0xFB40,0xE52F,0x0000, 0xFB40,0xE534,0x0000, +0xFB40,0xE587,0x0000, 0xFB40,0xE597,0x0000, 0xFB40,0xE5A4,0x0000, +0xFB40,0xE5B9,0x0000, 0xFB40,0xE5E0,0x0000, 0xFB40,0xE5E5,0x0000, +0xFB40,0xE6F0,0x0000, 0xFB40,0xE708,0x0000, 0xFB40,0xE728,0x0000, +0xFB40,0xEB20,0x0000, 0xFB40,0xEB62,0x0000, 0xFB40,0xEB79,0x0000, +0xFB40,0xEBB3,0x0000, 0xFB40,0xEBCB,0x0000, 0xFB40,0xEBD4,0x0000, +0xFB40,0xEBDB,0x0000, 0xFB40,0xEC0F,0x0000, 0xFB40,0xEC14,0x0000, +0xFB40,0xEC34,0x0000, 0xFB40,0xF06B,0x0000, 0xFB40,0xF22A,0x0000, +0xFB40,0xF236,0x0000, 0xFB40,0xF23B,0x0000, 0xFB40,0xF23F,0x0000, +0xFB40,0xF247,0x0000, 0xFB40,0xF259,0x0000, 0xFB40,0xF25B,0x0000, +0xFB40,0xF2AC,0x0000, 0xFB40,0xF384,0x0000, 0xFB40,0xF389,0x0000, +0xFB40,0xF4DC,0x0000, 0xFB40,0xF4E6,0x0000, 0xFB40,0xF518,0x0000, +0xFB40,0xF51F,0x0000, 0xFB40,0xF528,0x0000, 0xFB40,0xF530,0x0000, +0xFB40,0xF58B,0x0000, 0xFB40,0xF592,0x0000, 0xFB40,0xF676,0x0000, +0xFB40,0xF67D,0x0000, 0xFB40,0xF6AE,0x0000, 0xFB40,0xF6BF,0x0000, +0xFB40,0xF6EE,0x0000, 0xFB40,0xF7DB,0x0000, 0xFB40,0xF7E2,0x0000, +0xFB40,0xF7F3,0x0000, 0xFB40,0xF93A,0x0000, 0xFB40,0xF9B8,0x0000, +0xFB40,0xF9BE,0x0000, 0xFB40,0xFA74,0x0000, 0xFB40,0xFACB,0x0000, +0xFB40,0xFAF9,0x0000, 0xFB40,0xFC73,0x0000, 0xFB40,0xFCF8,0x0000, +0xFB40,0xFF36,0x0000, 0xFB40,0xFF51,0x0000, 0xFB40,0xFF8A,0x0000, +0xFB40,0xFFBD,0x0000, 0xFB41,0x8001,0x0000, 0xFB41,0x800C,0x0000, +0xFB41,0x8012,0x0000, 0xFB41,0x8033,0x0000, 0xFB41,0x807F,0x0000, +0xFB41,0x8089,0x0000, 0xFB41,0x81E3,0x0000, 0xFB41,0x81EA,0x0000, +0xFB41,0x81F3,0x0000, 0xFB41,0x81FC,0x0000, 0xFB41,0x820C,0x0000, +0xFB41,0x821B,0x0000, 0xFB41,0x821F,0x0000, 0xFB41,0x826E,0x0000, +0xFB41,0x8272,0x0000, 0xFB41,0x8278,0x0000, 0xFB41,0x864D,0x0000, +0xFB41,0x866B,0x0000, 0xFB41,0x8840,0x0000, 0xFB41,0x884C,0x0000, +0xFB41,0x8863,0x0000, 0xFB41,0x897E,0x0000, 0xFB41,0x898B,0x0000, +0xFB41,0x89D2,0x0000, 0xFB41,0x8A00,0x0000, 0xFB41,0x8C37,0x0000, +0xFB41,0x8C46,0x0000, 0xFB41,0x8C55,0x0000, 0xFB41,0x8C78,0x0000, +0xFB41,0x8C9D,0x0000, 0xFB41,0x8D64,0x0000, 0xFB41,0x8D70,0x0000, +0xFB41,0x8DB3,0x0000, 0xFB41,0x8EAB,0x0000, 0xFB41,0x8ECA,0x0000, +0xFB41,0x8F9B,0x0000, 0xFB41,0x8FB0,0x0000, 0xFB41,0x8FB5,0x0000, +0xFB41,0x9091,0x0000, 0xFB41,0x9149,0x0000, 0xFB41,0x91C6,0x0000, +0xFB41,0x91CC,0x0000, 0xFB41,0x91D1,0x0000, 0xFB41,0x9577,0x0000, +0xFB41,0x9580,0x0000, 0xFB41,0x961C,0x0000, 0xFB41,0x96B6,0x0000, +0xFB41,0x96B9,0x0000, 0xFB41,0x96E8,0x0000, 0xFB41,0x9751,0x0000, +0xFB41,0x975E,0x0000, 0xFB41,0x9762,0x0000, 0xFB41,0x9769,0x0000, +0xFB41,0x97CB,0x0000, 0xFB41,0x97ED,0x0000, 0xFB41,0x97F3,0x0000, +0xFB41,0x9801,0x0000, 0xFB41,0x98A8,0x0000, 0xFB41,0x98DB,0x0000, +0xFB41,0x98DF,0x0000, 0xFB41,0x9996,0x0000, 0xFB41,0x9999,0x0000, +0xFB41,0x99AC,0x0000, 0xFB41,0x9AA8,0x0000, 0xFB41,0x9AD8,0x0000, +0xFB41,0x9ADF,0x0000, 0xFB41,0x9B25,0x0000, 0xFB41,0x9B2F,0x0000, +0xFB41,0x9B32,0x0000, 0xFB41,0x9B3C,0x0000, 0xFB41,0x9B5A,0x0000, +0xFB41,0x9CE5,0x0000, 0xFB41,0x9E75,0x0000, 0xFB41,0x9E7F,0x0000, +0xFB41,0x9EA5,0x0000, 0xFB41,0x9EBB,0x0000, 0xFB41,0x9EC3,0x0000, +0xFB41,0x9ECD,0x0000, 0xFB41,0x9ED1,0x0000, 0xFB41,0x9EF9,0x0000, +0xFB41,0x9EFD,0x0000, 0xFB41,0x9F0E,0x0000, 0xFB41,0x9F13,0x0000, +0xFB41,0x9F20,0x0000, 0xFB41,0x9F3B,0x0000, 0xFB41,0x9F4A,0x0000, +0xFB41,0x9F52,0x0000, 0xFB41,0x9F8D,0x0000, 0xFB41,0x9F9C,0x0000, +0xFB41,0x9FA0,0x0000, 0xFBC0,0xAFD6,0x0000, 0xFBC0,0xAFD7,0x0000, +0xFBC0,0xAFD8,0x0000, 0xFBC0,0xAFD9,0x0000, 0xFBC0,0xAFDA,0x0000, +0xFBC0,0xAFDB,0x0000, 0xFBC0,0xAFDC,0x0000, 0xFBC0,0xAFDD,0x0000, +0xFBC0,0xAFDE,0x0000, 0xFBC0,0xAFDF,0x0000, 0xFBC0,0xAFE0,0x0000, +0xFBC0,0xAFE1,0x0000, 0xFBC0,0xAFE2,0x0000, 0xFBC0,0xAFE3,0x0000, +0xFBC0,0xAFE4,0x0000, 0xFBC0,0xAFE5,0x0000, 0xFBC0,0xAFE6,0x0000, +0xFBC0,0xAFE7,0x0000, 0xFBC0,0xAFE8,0x0000, 0xFBC0,0xAFE9,0x0000, +0xFBC0,0xAFEA,0x0000, 0xFBC0,0xAFEB,0x0000, 0xFBC0,0xAFEC,0x0000, +0xFBC0,0xAFED,0x0000, 0xFBC0,0xAFEE,0x0000, 0xFBC0,0xAFEF,0x0000, +0x0DAF,0x0000,0x0000, 0x0DB0,0x0000,0x0000, 0x0DB1,0x0000,0x0000, +0x0DB2,0x0000,0x0000, 0x0DB3,0x0000,0x0000, 0x0DB4,0x0000,0x0000, +0x0DB5,0x0000,0x0000, 0x0DB6,0x0000,0x0000, 0x0DB7,0x0000,0x0000, +0x0DB8,0x0000,0x0000, 0x0DB9,0x0000,0x0000, 0x0DBA,0x0000,0x0000, +0xFBC0,0xAFFC,0x0000, 0xFBC0,0xAFFD,0x0000, 0xFBC0,0xAFFE,0x0000, +0xFBC0,0xAFFF,0x0000 }; + +uint16 page030data[]= { /* 3000 (3 weights per char) */ +0x0209,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x0266,0x0000,0x0000, +0x02E2,0x0000,0x0000, 0x0DBB,0x0000,0x0000, 0x0E05,0x0000,0x0000, +0x1E5D,0x1E73,0x0000, 0x0E29,0x0000,0x0000, 0x02AE,0x0000,0x0000, +0x02AF,0x0000,0x0000, 0x02B0,0x0000,0x0000, 0x02B1,0x0000,0x0000, +0x02B2,0x0000,0x0000, 0x02B3,0x0000,0x0000, 0x02B4,0x0000,0x0000, +0x02B5,0x0000,0x0000, 0x02B6,0x0000,0x0000, 0x02B7,0x0000,0x0000, +0x0DBC,0x0000,0x0000, 0x0DBD,0x0000,0x0000, 0x02B8,0x0000,0x0000, +0x02B9,0x0000,0x0000, 0x02BA,0x0000,0x0000, 0x02BB,0x0000,0x0000, +0x02BC,0x0000,0x0000, 0x02BD,0x0000,0x0000, 0x02BE,0x0000,0x0000, +0x02BF,0x0000,0x0000, 0x022B,0x0000,0x0000, 0x0283,0x0000,0x0000, +0x0284,0x0000,0x0000, 0x0285,0x0000,0x0000, 0x0DBE,0x0000,0x0000, +0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, +0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, +0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x022C,0x0000,0x0000, 0x0E07,0x0000,0x0000, 0x0E07,0x0000,0x0000, +0x0E08,0x0000,0x0000, 0x0E08,0x0000,0x0000, 0x0E09,0x0000,0x0000, +0x0DBC,0x0000,0x0000, 0x0DBF,0x0000,0x0000, 0xFB40,0xD341,0x0000, +0xFB40,0xD344,0x0000, 0xFB40,0xD345,0x0000, 0x0E06,0x0000,0x0000, +0x1E70,0x1E5E,0x0000, 0x02E3,0x0000,0x0000, 0x0DC0,0x0000,0x0000, +0x0DC1,0x0000,0x0000, 0xFBC0,0xB040,0x0000, 0x1E52,0x0000,0x0000, +0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, 0x1E53,0x0000,0x0000, +0x1E54,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000, +0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, 0x1E56,0x0000,0x0000, +0x1E57,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000, +0x1E58,0x0000,0x0000, 0x1E59,0x0000,0x0000, 0x1E59,0x0000,0x0000, +0x1E5A,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000, +0x1E5B,0x0000,0x0000, 0x1E5C,0x0000,0x0000, 0x1E5C,0x0000,0x0000, +0x1E5D,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000, +0x1E5E,0x0000,0x0000, 0x1E5F,0x0000,0x0000, 0x1E5F,0x0000,0x0000, +0x1E60,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000, +0x1E61,0x0000,0x0000, 0x1E62,0x0000,0x0000, 0x1E62,0x0000,0x0000, +0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, +0x1E64,0x0000,0x0000, 0x1E64,0x0000,0x0000, 0x1E65,0x0000,0x0000, +0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000, +0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000, +0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, +0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, +0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, +0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, +0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, +0x1E70,0x0000,0x0000, 0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000, +0x1E73,0x0000,0x0000, 0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000, +0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E76,0x0000,0x0000, +0x1E77,0x0000,0x0000, 0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000, +0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, +0x1E7C,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7D,0x0000,0x0000, +0x1E7E,0x0000,0x0000, 0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000, +0x1E81,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E57,0x0000,0x0000, +0x1E5A,0x0000,0x0000, 0xFBC0,0xB097,0x0000, 0xFBC0,0xB098,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x021E,0x0000,0x0000, +0x021F,0x0000,0x0000, 0x0E0A,0x0000,0x0000, 0x0E0A,0x0000,0x0000, +0x1E77,0x1E79,0x0000, 0x022D,0x0000,0x0000, 0x1E52,0x0000,0x0000, +0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, 0x1E53,0x0000,0x0000, +0x1E54,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000, +0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, 0x1E56,0x0000,0x0000, +0x1E57,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000, +0x1E58,0x0000,0x0000, 0x1E59,0x0000,0x0000, 0x1E59,0x0000,0x0000, +0x1E5A,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000, +0x1E5B,0x0000,0x0000, 0x1E5C,0x0000,0x0000, 0x1E5C,0x0000,0x0000, +0x1E5D,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000, +0x1E5E,0x0000,0x0000, 0x1E5F,0x0000,0x0000, 0x1E5F,0x0000,0x0000, +0x1E60,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000, +0x1E61,0x0000,0x0000, 0x1E62,0x0000,0x0000, 0x1E62,0x0000,0x0000, +0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, +0x1E64,0x0000,0x0000, 0x1E64,0x0000,0x0000, 0x1E65,0x0000,0x0000, +0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000, +0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000, +0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, +0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, +0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, +0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, +0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, +0x1E70,0x0000,0x0000, 0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000, +0x1E73,0x0000,0x0000, 0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000, +0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E76,0x0000,0x0000, +0x1E77,0x0000,0x0000, 0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000, +0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, +0x1E7C,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7D,0x0000,0x0000, +0x1E7E,0x0000,0x0000, 0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000, +0x1E81,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E57,0x0000,0x0000, +0x1E5A,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7E,0x0000,0x0000, +0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000, 0x022E,0x0000,0x0000, +0x0E0B,0x0000,0x0000, 0x0E0C,0x0000,0x0000, 0x0E0C,0x0000,0x0000, +0x1E5B,0x1E65,0x0000 }; + +uint16 page031data[]= { /* 3100 (3 weights per char) */ +0xFBC0,0xB100,0x0000, 0xFBC0,0xB101,0x0000, 0xFBC0,0xB102,0x0000, +0xFBC0,0xB103,0x0000, 0xFBC0,0xB104,0x0000, 0x1E82,0x0000,0x0000, +0x1E83,0x0000,0x0000, 0x1E84,0x0000,0x0000, 0x1E85,0x0000,0x0000, +0x1E87,0x0000,0x0000, 0x1E88,0x0000,0x0000, 0x1E89,0x0000,0x0000, +0x1E8A,0x0000,0x0000, 0x1E8B,0x0000,0x0000, 0x1E8C,0x0000,0x0000, +0x1E8F,0x0000,0x0000, 0x1E90,0x0000,0x0000, 0x1E91,0x0000,0x0000, +0x1E92,0x0000,0x0000, 0x1E94,0x0000,0x0000, 0x1E95,0x0000,0x0000, +0x1E96,0x0000,0x0000, 0x1E97,0x0000,0x0000, 0x1E98,0x0000,0x0000, +0x1E99,0x0000,0x0000, 0x1E9A,0x0000,0x0000, 0x1E9B,0x0000,0x0000, +0x1E9C,0x0000,0x0000, 0x1E9E,0x0000,0x0000, 0x1E9F,0x0000,0x0000, +0x1EA1,0x0000,0x0000, 0x1EA2,0x0000,0x0000, 0x1EA3,0x0000,0x0000, +0x1EA4,0x0000,0x0000, 0x1EA5,0x0000,0x0000, 0x1EA6,0x0000,0x0000, +0x1EA7,0x0000,0x0000, 0x1EA9,0x0000,0x0000, 0x1EAD,0x0000,0x0000, +0x1EAE,0x0000,0x0000, 0x1EAF,0x0000,0x0000, 0x1EB0,0x0000,0x0000, +0x1E86,0x0000,0x0000, 0x1E8D,0x0000,0x0000, 0x1E93,0x0000,0x0000, +0xFBC0,0xB12D,0x0000, 0xFBC0,0xB12E,0x0000, 0xFBC0,0xB12F,0x0000, +0xFBC0,0xB130,0x0000, 0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000, +0x1E02,0x0000,0x0000, 0x1D64,0x0000,0x0000, 0x1E04,0x0000,0x0000, +0x1E05,0x0000,0x0000, 0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000, +0x1D67,0x0000,0x0000, 0x1E08,0x0000,0x0000, 0x1E09,0x0000,0x0000, +0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000, 0x1E0C,0x0000,0x0000, +0x1E0D,0x0000,0x0000, 0x1D7C,0x0000,0x0000, 0x1D68,0x0000,0x0000, +0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000, 0x1D83,0x0000,0x0000, +0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, 0x1D6D,0x0000,0x0000, +0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, 0x1D70,0x0000,0x0000, +0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, 0x1D73,0x0000,0x0000, +0x1D74,0x0000,0x0000, 0x1DBE,0x0000,0x0000, 0x1DBF,0x0000,0x0000, +0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, 0x1DC2,0x0000,0x0000, +0x1DC3,0x0000,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000, +0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000, +0x1DC9,0x0000,0x0000, 0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000, +0x1DCC,0x0000,0x0000, 0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000, +0x1DCF,0x0000,0x0000, 0x1DD0,0x0000,0x0000, 0x1DD1,0x0000,0x0000, +0x1DD2,0x0000,0x0000, 0x1DBD,0x0000,0x0000, 0x1D76,0x0000,0x0000, +0x1D77,0x0000,0x0000, 0x1E1F,0x0000,0x0000, 0x1E20,0x0000,0x0000, +0x1E24,0x0000,0x0000, 0x1E26,0x0000,0x0000, 0x1E2B,0x0000,0x0000, +0x1E2F,0x0000,0x0000, 0x1E31,0x0000,0x0000, 0x1D7E,0x0000,0x0000, +0x1E35,0x0000,0x0000, 0x1E37,0x0000,0x0000, 0x1D7F,0x0000,0x0000, +0x1D80,0x0000,0x0000, 0x1D82,0x0000,0x0000, 0x1D84,0x0000,0x0000, +0x1D85,0x0000,0x0000, 0x1D89,0x0000,0x0000, 0x1D8B,0x0000,0x0000, +0x1D8D,0x0000,0x0000, 0x1D8E,0x0000,0x0000, 0x1D8F,0x0000,0x0000, +0x1D90,0x0000,0x0000, 0x1D91,0x0000,0x0000, 0x1D94,0x0000,0x0000, +0x1D98,0x0000,0x0000, 0x1DA2,0x0000,0x0000, 0x1DA9,0x0000,0x0000, +0x1DAE,0x0000,0x0000, 0x1E49,0x0000,0x0000, 0x1E4A,0x0000,0x0000, +0x1DB9,0x0000,0x0000, 0x1DBA,0x0000,0x0000, 0x1DBB,0x0000,0x0000, +0x1DE1,0x0000,0x0000, 0x1DE2,0x0000,0x0000, 0x1DE5,0x0000,0x0000, +0x1DEE,0x0000,0x0000, 0x1DEF,0x0000,0x0000, 0x1DF1,0x0000,0x0000, +0x1DFB,0x0000,0x0000, 0x1DFE,0x0000,0x0000, 0xFBC0,0xB18F,0x0000, +0x0DC2,0x0000,0x0000, 0x0DC3,0x0000,0x0000, 0xFB40,0xCE00,0x0000, +0xFB40,0xCE8C,0x0000, 0xFB40,0xCE09,0x0000, 0xFB40,0xD6DB,0x0000, +0xFB40,0xCE0A,0x0000, 0xFB40,0xCE2D,0x0000, 0xFB40,0xCE0B,0x0000, +0xFB40,0xF532,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE19,0x0000, +0xFB40,0xCE01,0x0000, 0xFB40,0xD929,0x0000, 0xFB40,0xD730,0x0000, +0xFB40,0xCEBA,0x0000, 0x1E82,0x0000,0x0000, 0x1E98,0x0000,0x0000, +0x1E90,0x0000,0x0000, 0x1E8B,0x0000,0x0000, 0x1EA0,0x0000,0x0000, +0x1EA0,0x0000,0x0000, 0x1E9D,0x0000,0x0000, 0x1E9C,0x0000,0x0000, +0x1EAF,0x0000,0x0000, 0x1E9B,0x0000,0x0000, 0x1EAE,0x0000,0x0000, +0x1EAF,0x0000,0x0000, 0x1EAC,0x0000,0x0000, 0x1E8E,0x0000,0x0000, +0x1EA1,0x0000,0x0000, 0x1EA3,0x0000,0x0000, 0x1EAA,0x0000,0x0000, +0x1EAB,0x0000,0x0000, 0x1EA8,0x0000,0x0000, 0x1EAE,0x0000,0x0000, +0x1E83,0x0000,0x0000, 0x1E88,0x0000,0x0000, 0x1E8C,0x0000,0x0000, +0x1E8F,0x0000,0x0000, 0xFBC0,0xB1B8,0x0000, 0xFBC0,0xB1B9,0x0000, +0xFBC0,0xB1BA,0x0000, 0xFBC0,0xB1BB,0x0000, 0xFBC0,0xB1BC,0x0000, +0xFBC0,0xB1BD,0x0000, 0xFBC0,0xB1BE,0x0000, 0xFBC0,0xB1BF,0x0000, +0xFBC0,0xB1C0,0x0000, 0xFBC0,0xB1C1,0x0000, 0xFBC0,0xB1C2,0x0000, +0xFBC0,0xB1C3,0x0000, 0xFBC0,0xB1C4,0x0000, 0xFBC0,0xB1C5,0x0000, +0xFBC0,0xB1C6,0x0000, 0xFBC0,0xB1C7,0x0000, 0xFBC0,0xB1C8,0x0000, +0xFBC0,0xB1C9,0x0000, 0xFBC0,0xB1CA,0x0000, 0xFBC0,0xB1CB,0x0000, +0xFBC0,0xB1CC,0x0000, 0xFBC0,0xB1CD,0x0000, 0xFBC0,0xB1CE,0x0000, +0xFBC0,0xB1CF,0x0000, 0xFBC0,0xB1D0,0x0000, 0xFBC0,0xB1D1,0x0000, +0xFBC0,0xB1D2,0x0000, 0xFBC0,0xB1D3,0x0000, 0xFBC0,0xB1D4,0x0000, +0xFBC0,0xB1D5,0x0000, 0xFBC0,0xB1D6,0x0000, 0xFBC0,0xB1D7,0x0000, +0xFBC0,0xB1D8,0x0000, 0xFBC0,0xB1D9,0x0000, 0xFBC0,0xB1DA,0x0000, +0xFBC0,0xB1DB,0x0000, 0xFBC0,0xB1DC,0x0000, 0xFBC0,0xB1DD,0x0000, +0xFBC0,0xB1DE,0x0000, 0xFBC0,0xB1DF,0x0000, 0xFBC0,0xB1E0,0x0000, +0xFBC0,0xB1E1,0x0000, 0xFBC0,0xB1E2,0x0000, 0xFBC0,0xB1E3,0x0000, +0xFBC0,0xB1E4,0x0000, 0xFBC0,0xB1E5,0x0000, 0xFBC0,0xB1E6,0x0000, +0xFBC0,0xB1E7,0x0000, 0xFBC0,0xB1E8,0x0000, 0xFBC0,0xB1E9,0x0000, +0xFBC0,0xB1EA,0x0000, 0xFBC0,0xB1EB,0x0000, 0xFBC0,0xB1EC,0x0000, +0xFBC0,0xB1ED,0x0000, 0xFBC0,0xB1EE,0x0000, 0xFBC0,0xB1EF,0x0000, +0x1E59,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000, +0x1E65,0x0000,0x0000, 0x1E68,0x0000,0x0000, 0x1E6B,0x0000,0x0000, +0x1E6C,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6E,0x0000,0x0000, +0x1E6F,0x0000,0x0000, 0x1E72,0x0000,0x0000, 0x1E78,0x0000,0x0000, +0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, +0x1E7C,0x0000,0x0000 }; + +uint16 page032data[]= { /* 3200 (8 weights per char) */ +0x0288,0x1D62,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D64,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D65,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D67,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D68,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D69,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6B,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6D,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6E,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D70,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D71,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D72,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D73,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D74,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D62,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D64,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D65,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D67,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D68,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D69,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6B,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6D,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6E,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D70,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D71,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D72,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D73,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D74,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6E,0x1DCB,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0x1D6D,0x1DC6,0x1D6E,0x1DC2,0x1E03,0x0289,0x0000, +0x0288,0x1D6D,0x1DC6,0x1D74,0x1DCB,0x0289,0x0000,0x0000, +0xFBC0,0xB21F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCE00,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCE8C,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCE09,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD6DB,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCE94,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD16D,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCE03,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD16B,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCE5D,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD341,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xE708,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xF06B,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xEC34,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xE728,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB41,0x91D1,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD71F,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xE5E5,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xE82A,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xE709,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xF93E,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD40D,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xF279,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB41,0x8CA1,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xF95D,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD2B4,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCEE3,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD47C,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xDB66,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xF6E3,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCF01,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB41,0x8CC7,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xD354,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xF96D,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB40,0xCF11,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB41,0x81EA,0x0289,0x0000,0x0000,0x0000,0x0000, +0x0288,0xFB41,0x81F3,0x0289,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB244,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB245,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB246,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB247,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB248,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB249,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB24A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB24B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB24C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB24D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB24E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB24F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x1002,0x0E8B,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D67,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D68,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D69,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D6E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D73,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D74,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D62,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D64,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D65,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D67,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D68,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D69,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D6B,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D6D,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D6E,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D70,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D71,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D72,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D73,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D74,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1D70,0x1DBE,0x1E0F,0x1D62,0x1DC6,0x0000,0x0000,0x0000, +0x1D6E,0x1DCB,0x1D6D,0x1DD1,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB27E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0DC4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE8C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE09,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD6DB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE94,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD16D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE03,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD16B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD341,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF06B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xEC34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE728,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB41,0x91D1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD71F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE82A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE709,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF93E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD40D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF279,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB41,0x8CA1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF95D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD2B4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF9D8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF537,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD973,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB41,0x9069,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD12A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD370,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xECE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB41,0x9805,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCF11,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD199,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xEB63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE0A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCE0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xDDE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD3F3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD33B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xDB97,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xDB66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xF6E3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xCF01,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB41,0x8CC7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD354,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD91C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E30,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E31,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E32,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E29,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2A,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2B,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x0FC0,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E8B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x1002,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E53,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E54,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E55,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E56,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E61,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E67,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E68,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E69,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E73,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E74,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E75,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E76,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E77,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E78,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E80,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC0,0xB2FF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +uint16 page033data[]= { /* 3300 (9 weights per char) */ +0x1E52,0x1E6B,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E52,0x1E7A,0x1E6D,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E52,0x1E81,0x1E6E,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E52,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E53,0x1E67,0x1E81,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E53,0x1E81,0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E54,0x1E56,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E55,0x1E5E,0x1E59,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000, +0x1E55,0x0E0B,0x1E57,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E56,0x1E81,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E56,0x0E0B,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E57,0x1E53,0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E57,0x1E78,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E57,0x1E7C,0x1E79,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E57,0x1E7C,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E57,0x1E81,0x1E70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E67,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E76,0x1E79,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E7A,0x1E61,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E7C,0x1E59,0x1E78,0x1E72,0x0000,0x0000,0x0000,0x0000, +0x1E58,0x1E7C,0x1E73,0x0E0B,0x1E65,0x1E7A,0x0000,0x0000,0x0000, +0x1E58,0x1E7C,0x1E7D,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000, +0x1E59,0x1E78,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E59,0x1E78,0x1E72,0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000, +0x1E59,0x1E7A,0x1E5F,0x1E53,0x1E7C,0x0000,0x0000,0x0000,0x0000, +0x1E59,0x1E7C,0x0E0B,0x1E69,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5A,0x0E0B,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5B,0x1E7A,0x1E66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5B,0x0E0B,0x1E6F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5C,0x1E53,0x1E59,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5C,0x1E81,0x1E62,0x0E0B,0x1E72,0x0000,0x0000,0x0000,0x0000, +0x1E5D,0x1E79,0x1E81,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5F,0x1E81,0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E5F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E61,0x0E0B,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E64,0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E66,0x1E6A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6A,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6B,0x1E53,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6B,0x0E0B,0x1E5F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000, +0x1E6B,0x0E0B,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6B,0x0E0B,0x1E7B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6C,0x1E52,0x1E5E,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000, +0x1E6C,0x1E59,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6C,0x1E5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6C,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6D,0x1E52,0x1E78,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000, +0x1E6D,0x1E53,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6D,0x1E63,0x1E5D,0x1E55,0x1E7A,0x0000,0x0000,0x0000,0x0000, +0x1E6D,0x1E78,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x1E59,0x1E61,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x1E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x1E67,0x1E6C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x1E7A,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x1E81,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x0E0B,0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6E,0x0E0B,0x1E61,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x1E53,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x1E7A,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E6F,0x0E0B,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E70,0x1E53,0x1E59,0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E70,0x1E53,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E70,0x1E63,0x1E6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E70,0x1E7A,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E70,0x1E81,0x1E5D,0x1E77,0x1E81,0x0000,0x0000,0x0000,0x0000, +0x1E71,0x1E59,0x1E7C,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E71,0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E71,0x1E79,0x1E6B,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000, +0x1E73,0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E73,0x1E57,0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E73,0x0E0B,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E75,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E75,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E76,0x1E52,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E79,0x1E63,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E79,0x1E78,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7A,0x1E6C,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7A,0x0E0B,0x1E6D,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7B,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1E7B,0x1E81,0x1E65,0x1E5A,0x1E81,0x0000,0x0000,0x0000,0x0000, +0x1E7D,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E30,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E31,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E32,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2E,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2F,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E30,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E31,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E32,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E33,0x101F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E4A,0x0E33,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F82,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x101F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xDE73,0xFB40,0xE210,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE62D,0xFB40,0xD48C,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xD927,0xFB40,0xEB63,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE60E,0xFB40,0xECBB,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFB40,0xE82A,0xFB40,0xDF0F,0xFB40,0xCF1A,0xFB40,0xF93E,0x0000, +0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0E60,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1002,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EB9,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0437,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0437,0x0FEA,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0E33,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0E33,0x0E6D,0x0437,0x0FEA,0x0000,0x0000,0x0000,0x0000, +0x0FC0,0x0E33,0x0E6D,0x0437,0x0FEA,0x0E2B,0x0000,0x0000,0x0000, +0x0FA7,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F64,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x10F8,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x1109,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x1109,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E33,0x025D,0x0F5B,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E4A,0x0FB4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0437,0x0F21,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E60,0x0F82,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E6D,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x105E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EE1,0x0FA7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EFB,0x0F64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0F21,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F21,0x1002,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0F64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x0F82,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F2E,0x105A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0EFB,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0F5B,0x0F82,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0EE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x025D,0x0F5B,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0FA7,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FA7,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FEA,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0FEA,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1051,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1044,0x0437,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E33,0x0437,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2A,0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2B,0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0E2C,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000, +0x0EC1,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +uint16 page04Ddata[]= { /* 4D00 (3 weights per char) */ +0xFB80,0xCD00,0x0000, 0xFB80,0xCD01,0x0000, 0xFB80,0xCD02,0x0000, +0xFB80,0xCD03,0x0000, 0xFB80,0xCD04,0x0000, 0xFB80,0xCD05,0x0000, +0xFB80,0xCD06,0x0000, 0xFB80,0xCD07,0x0000, 0xFB80,0xCD08,0x0000, +0xFB80,0xCD09,0x0000, 0xFB80,0xCD0A,0x0000, 0xFB80,0xCD0B,0x0000, +0xFB80,0xCD0C,0x0000, 0xFB80,0xCD0D,0x0000, 0xFB80,0xCD0E,0x0000, +0xFB80,0xCD0F,0x0000, 0xFB80,0xCD10,0x0000, 0xFB80,0xCD11,0x0000, +0xFB80,0xCD12,0x0000, 0xFB80,0xCD13,0x0000, 0xFB80,0xCD14,0x0000, +0xFB80,0xCD15,0x0000, 0xFB80,0xCD16,0x0000, 0xFB80,0xCD17,0x0000, +0xFB80,0xCD18,0x0000, 0xFB80,0xCD19,0x0000, 0xFB80,0xCD1A,0x0000, +0xFB80,0xCD1B,0x0000, 0xFB80,0xCD1C,0x0000, 0xFB80,0xCD1D,0x0000, +0xFB80,0xCD1E,0x0000, 0xFB80,0xCD1F,0x0000, 0xFB80,0xCD20,0x0000, +0xFB80,0xCD21,0x0000, 0xFB80,0xCD22,0x0000, 0xFB80,0xCD23,0x0000, +0xFB80,0xCD24,0x0000, 0xFB80,0xCD25,0x0000, 0xFB80,0xCD26,0x0000, +0xFB80,0xCD27,0x0000, 0xFB80,0xCD28,0x0000, 0xFB80,0xCD29,0x0000, +0xFB80,0xCD2A,0x0000, 0xFB80,0xCD2B,0x0000, 0xFB80,0xCD2C,0x0000, +0xFB80,0xCD2D,0x0000, 0xFB80,0xCD2E,0x0000, 0xFB80,0xCD2F,0x0000, +0xFB80,0xCD30,0x0000, 0xFB80,0xCD31,0x0000, 0xFB80,0xCD32,0x0000, +0xFB80,0xCD33,0x0000, 0xFB80,0xCD34,0x0000, 0xFB80,0xCD35,0x0000, +0xFB80,0xCD36,0x0000, 0xFB80,0xCD37,0x0000, 0xFB80,0xCD38,0x0000, +0xFB80,0xCD39,0x0000, 0xFB80,0xCD3A,0x0000, 0xFB80,0xCD3B,0x0000, +0xFB80,0xCD3C,0x0000, 0xFB80,0xCD3D,0x0000, 0xFB80,0xCD3E,0x0000, +0xFB80,0xCD3F,0x0000, 0xFB80,0xCD40,0x0000, 0xFB80,0xCD41,0x0000, +0xFB80,0xCD42,0x0000, 0xFB80,0xCD43,0x0000, 0xFB80,0xCD44,0x0000, +0xFB80,0xCD45,0x0000, 0xFB80,0xCD46,0x0000, 0xFB80,0xCD47,0x0000, +0xFB80,0xCD48,0x0000, 0xFB80,0xCD49,0x0000, 0xFB80,0xCD4A,0x0000, +0xFB80,0xCD4B,0x0000, 0xFB80,0xCD4C,0x0000, 0xFB80,0xCD4D,0x0000, +0xFB80,0xCD4E,0x0000, 0xFB80,0xCD4F,0x0000, 0xFB80,0xCD50,0x0000, +0xFB80,0xCD51,0x0000, 0xFB80,0xCD52,0x0000, 0xFB80,0xCD53,0x0000, +0xFB80,0xCD54,0x0000, 0xFB80,0xCD55,0x0000, 0xFB80,0xCD56,0x0000, +0xFB80,0xCD57,0x0000, 0xFB80,0xCD58,0x0000, 0xFB80,0xCD59,0x0000, +0xFB80,0xCD5A,0x0000, 0xFB80,0xCD5B,0x0000, 0xFB80,0xCD5C,0x0000, +0xFB80,0xCD5D,0x0000, 0xFB80,0xCD5E,0x0000, 0xFB80,0xCD5F,0x0000, +0xFB80,0xCD60,0x0000, 0xFB80,0xCD61,0x0000, 0xFB80,0xCD62,0x0000, +0xFB80,0xCD63,0x0000, 0xFB80,0xCD64,0x0000, 0xFB80,0xCD65,0x0000, +0xFB80,0xCD66,0x0000, 0xFB80,0xCD67,0x0000, 0xFB80,0xCD68,0x0000, +0xFB80,0xCD69,0x0000, 0xFB80,0xCD6A,0x0000, 0xFB80,0xCD6B,0x0000, +0xFB80,0xCD6C,0x0000, 0xFB80,0xCD6D,0x0000, 0xFB80,0xCD6E,0x0000, +0xFB80,0xCD6F,0x0000, 0xFB80,0xCD70,0x0000, 0xFB80,0xCD71,0x0000, +0xFB80,0xCD72,0x0000, 0xFB80,0xCD73,0x0000, 0xFB80,0xCD74,0x0000, +0xFB80,0xCD75,0x0000, 0xFB80,0xCD76,0x0000, 0xFB80,0xCD77,0x0000, +0xFB80,0xCD78,0x0000, 0xFB80,0xCD79,0x0000, 0xFB80,0xCD7A,0x0000, +0xFB80,0xCD7B,0x0000, 0xFB80,0xCD7C,0x0000, 0xFB80,0xCD7D,0x0000, +0xFB80,0xCD7E,0x0000, 0xFB80,0xCD7F,0x0000, 0xFB80,0xCD80,0x0000, +0xFB80,0xCD81,0x0000, 0xFB80,0xCD82,0x0000, 0xFB80,0xCD83,0x0000, +0xFB80,0xCD84,0x0000, 0xFB80,0xCD85,0x0000, 0xFB80,0xCD86,0x0000, +0xFB80,0xCD87,0x0000, 0xFB80,0xCD88,0x0000, 0xFB80,0xCD89,0x0000, +0xFB80,0xCD8A,0x0000, 0xFB80,0xCD8B,0x0000, 0xFB80,0xCD8C,0x0000, +0xFB80,0xCD8D,0x0000, 0xFB80,0xCD8E,0x0000, 0xFB80,0xCD8F,0x0000, +0xFB80,0xCD90,0x0000, 0xFB80,0xCD91,0x0000, 0xFB80,0xCD92,0x0000, +0xFB80,0xCD93,0x0000, 0xFB80,0xCD94,0x0000, 0xFB80,0xCD95,0x0000, +0xFB80,0xCD96,0x0000, 0xFB80,0xCD97,0x0000, 0xFB80,0xCD98,0x0000, +0xFB80,0xCD99,0x0000, 0xFB80,0xCD9A,0x0000, 0xFB80,0xCD9B,0x0000, +0xFB80,0xCD9C,0x0000, 0xFB80,0xCD9D,0x0000, 0xFB80,0xCD9E,0x0000, +0xFB80,0xCD9F,0x0000, 0xFB80,0xCDA0,0x0000, 0xFB80,0xCDA1,0x0000, +0xFB80,0xCDA2,0x0000, 0xFB80,0xCDA3,0x0000, 0xFB80,0xCDA4,0x0000, +0xFB80,0xCDA5,0x0000, 0xFB80,0xCDA6,0x0000, 0xFB80,0xCDA7,0x0000, +0xFB80,0xCDA8,0x0000, 0xFB80,0xCDA9,0x0000, 0xFB80,0xCDAA,0x0000, +0xFB80,0xCDAB,0x0000, 0xFB80,0xCDAC,0x0000, 0xFB80,0xCDAD,0x0000, +0xFB80,0xCDAE,0x0000, 0xFB80,0xCDAF,0x0000, 0xFB80,0xCDB0,0x0000, +0xFB80,0xCDB1,0x0000, 0xFB80,0xCDB2,0x0000, 0xFB80,0xCDB3,0x0000, +0xFB80,0xCDB4,0x0000, 0xFB80,0xCDB5,0x0000, 0xFBC0,0xCDB6,0x0000, +0xFBC0,0xCDB7,0x0000, 0xFBC0,0xCDB8,0x0000, 0xFBC0,0xCDB9,0x0000, +0xFBC0,0xCDBA,0x0000, 0xFBC0,0xCDBB,0x0000, 0xFBC0,0xCDBC,0x0000, +0xFBC0,0xCDBD,0x0000, 0xFBC0,0xCDBE,0x0000, 0xFBC0,0xCDBF,0x0000, +0x0B37,0x0000,0x0000, 0x0B38,0x0000,0x0000, 0x0B39,0x0000,0x0000, +0x0B3A,0x0000,0x0000, 0x0B3B,0x0000,0x0000, 0x0B3C,0x0000,0x0000, +0x0B3D,0x0000,0x0000, 0x0B3E,0x0000,0x0000, 0x0B3F,0x0000,0x0000, +0x0B40,0x0000,0x0000, 0x0B41,0x0000,0x0000, 0x0B42,0x0000,0x0000, +0x0B43,0x0000,0x0000, 0x0B44,0x0000,0x0000, 0x0B45,0x0000,0x0000, +0x0B46,0x0000,0x0000, 0x0B47,0x0000,0x0000, 0x0B48,0x0000,0x0000, +0x0B49,0x0000,0x0000, 0x0B4A,0x0000,0x0000, 0x0B4B,0x0000,0x0000, +0x0B4C,0x0000,0x0000, 0x0B4D,0x0000,0x0000, 0x0B4E,0x0000,0x0000, +0x0B4F,0x0000,0x0000, 0x0B50,0x0000,0x0000, 0x0B51,0x0000,0x0000, +0x0B52,0x0000,0x0000, 0x0B53,0x0000,0x0000, 0x0B54,0x0000,0x0000, +0x0B55,0x0000,0x0000, 0x0B56,0x0000,0x0000, 0x0B57,0x0000,0x0000, +0x0B58,0x0000,0x0000, 0x0B59,0x0000,0x0000, 0x0B5A,0x0000,0x0000, +0x0B5B,0x0000,0x0000, 0x0B5C,0x0000,0x0000, 0x0B5D,0x0000,0x0000, +0x0B5E,0x0000,0x0000, 0x0B5F,0x0000,0x0000, 0x0B60,0x0000,0x0000, +0x0B61,0x0000,0x0000, 0x0B62,0x0000,0x0000, 0x0B63,0x0000,0x0000, +0x0B64,0x0000,0x0000, 0x0B65,0x0000,0x0000, 0x0B66,0x0000,0x0000, +0x0B67,0x0000,0x0000, 0x0B68,0x0000,0x0000, 0x0B69,0x0000,0x0000, +0x0B6A,0x0000,0x0000, 0x0B6B,0x0000,0x0000, 0x0B6C,0x0000,0x0000, +0x0B6D,0x0000,0x0000, 0x0B6E,0x0000,0x0000, 0x0B6F,0x0000,0x0000, +0x0B70,0x0000,0x0000, 0x0B71,0x0000,0x0000, 0x0B72,0x0000,0x0000, +0x0B73,0x0000,0x0000, 0x0B74,0x0000,0x0000, 0x0B75,0x0000,0x0000, +0x0B76,0x0000,0x0000 }; + +uint16 page0A0data[]= { /* A000 (2 weights per char) */ +0x1EB1,0x0000, 0x1EB2,0x0000, 0x1EB3,0x0000, 0x1EB4,0x0000, +0x1EB5,0x0000, 0x1EB6,0x0000, 0x1EB7,0x0000, 0x1EB8,0x0000, +0x1EB9,0x0000, 0x1EBA,0x0000, 0x1EBB,0x0000, 0x1EBC,0x0000, +0x1EBD,0x0000, 0x1EBE,0x0000, 0x1EBF,0x0000, 0x1EC0,0x0000, +0x1EC1,0x0000, 0x1EC2,0x0000, 0x1EC3,0x0000, 0x1EC4,0x0000, +0x1EC5,0x0000, 0x1EC6,0x0000, 0x1EC7,0x0000, 0x1EC8,0x0000, +0x1EC9,0x0000, 0x1ECA,0x0000, 0x1ECB,0x0000, 0x1ECC,0x0000, +0x1ECD,0x0000, 0x1ECE,0x0000, 0x1ECF,0x0000, 0x1ED0,0x0000, +0x1ED1,0x0000, 0x1ED2,0x0000, 0x1ED3,0x0000, 0x1ED4,0x0000, +0x1ED5,0x0000, 0x1ED6,0x0000, 0x1ED7,0x0000, 0x1ED8,0x0000, +0x1ED9,0x0000, 0x1EDA,0x0000, 0x1EDB,0x0000, 0x1EDC,0x0000, +0x1EDD,0x0000, 0x1EDE,0x0000, 0x1EDF,0x0000, 0x1EE0,0x0000, +0x1EE1,0x0000, 0x1EE2,0x0000, 0x1EE3,0x0000, 0x1EE4,0x0000, +0x1EE5,0x0000, 0x1EE6,0x0000, 0x1EE7,0x0000, 0x1EE8,0x0000, +0x1EE9,0x0000, 0x1EEA,0x0000, 0x1EEB,0x0000, 0x1EEC,0x0000, +0x1EED,0x0000, 0x1EEE,0x0000, 0x1EEF,0x0000, 0x1EF0,0x0000, +0x1EF1,0x0000, 0x1EF2,0x0000, 0x1EF3,0x0000, 0x1EF4,0x0000, +0x1EF5,0x0000, 0x1EF6,0x0000, 0x1EF7,0x0000, 0x1EF8,0x0000, +0x1EF9,0x0000, 0x1EFA,0x0000, 0x1EFB,0x0000, 0x1EFC,0x0000, +0x1EFD,0x0000, 0x1EFE,0x0000, 0x1EFF,0x0000, 0x1F00,0x0000, +0x1F01,0x0000, 0x1F02,0x0000, 0x1F03,0x0000, 0x1F04,0x0000, +0x1F05,0x0000, 0x1F06,0x0000, 0x1F07,0x0000, 0x1F08,0x0000, +0x1F09,0x0000, 0x1F0A,0x0000, 0x1F0B,0x0000, 0x1F0C,0x0000, +0x1F0D,0x0000, 0x1F0E,0x0000, 0x1F0F,0x0000, 0x1F10,0x0000, +0x1F11,0x0000, 0x1F12,0x0000, 0x1F13,0x0000, 0x1F14,0x0000, +0x1F15,0x0000, 0x1F16,0x0000, 0x1F17,0x0000, 0x1F18,0x0000, +0x1F19,0x0000, 0x1F1A,0x0000, 0x1F1B,0x0000, 0x1F1C,0x0000, +0x1F1D,0x0000, 0x1F1E,0x0000, 0x1F1F,0x0000, 0x1F20,0x0000, +0x1F21,0x0000, 0x1F22,0x0000, 0x1F23,0x0000, 0x1F24,0x0000, +0x1F25,0x0000, 0x1F26,0x0000, 0x1F27,0x0000, 0x1F28,0x0000, +0x1F29,0x0000, 0x1F2A,0x0000, 0x1F2B,0x0000, 0x1F2C,0x0000, +0x1F2D,0x0000, 0x1F2E,0x0000, 0x1F2F,0x0000, 0x1F30,0x0000, +0x1F31,0x0000, 0x1F32,0x0000, 0x1F33,0x0000, 0x1F34,0x0000, +0x1F35,0x0000, 0x1F36,0x0000, 0x1F37,0x0000, 0x1F38,0x0000, +0x1F39,0x0000, 0x1F3A,0x0000, 0x1F3B,0x0000, 0x1F3C,0x0000, +0x1F3D,0x0000, 0x1F3E,0x0000, 0x1F3F,0x0000, 0x1F40,0x0000, +0x1F41,0x0000, 0x1F42,0x0000, 0x1F43,0x0000, 0x1F44,0x0000, +0x1F45,0x0000, 0x1F46,0x0000, 0x1F47,0x0000, 0x1F48,0x0000, +0x1F49,0x0000, 0x1F4A,0x0000, 0x1F4B,0x0000, 0x1F4C,0x0000, +0x1F4D,0x0000, 0x1F4E,0x0000, 0x1F4F,0x0000, 0x1F50,0x0000, +0x1F51,0x0000, 0x1F52,0x0000, 0x1F53,0x0000, 0x1F54,0x0000, +0x1F55,0x0000, 0x1F56,0x0000, 0x1F57,0x0000, 0x1F58,0x0000, +0x1F59,0x0000, 0x1F5A,0x0000, 0x1F5B,0x0000, 0x1F5C,0x0000, +0x1F5D,0x0000, 0x1F5E,0x0000, 0x1F5F,0x0000, 0x1F60,0x0000, +0x1F61,0x0000, 0x1F62,0x0000, 0x1F63,0x0000, 0x1F64,0x0000, +0x1F65,0x0000, 0x1F66,0x0000, 0x1F67,0x0000, 0x1F68,0x0000, +0x1F69,0x0000, 0x1F6A,0x0000, 0x1F6B,0x0000, 0x1F6C,0x0000, +0x1F6D,0x0000, 0x1F6E,0x0000, 0x1F6F,0x0000, 0x1F70,0x0000, +0x1F71,0x0000, 0x1F72,0x0000, 0x1F73,0x0000, 0x1F74,0x0000, +0x1F75,0x0000, 0x1F76,0x0000, 0x1F77,0x0000, 0x1F78,0x0000, +0x1F79,0x0000, 0x1F7A,0x0000, 0x1F7B,0x0000, 0x1F7C,0x0000, +0x1F7D,0x0000, 0x1F7E,0x0000, 0x1F7F,0x0000, 0x1F80,0x0000, +0x1F81,0x0000, 0x1F82,0x0000, 0x1F83,0x0000, 0x1F84,0x0000, +0x1F85,0x0000, 0x1F86,0x0000, 0x1F87,0x0000, 0x1F88,0x0000, +0x1F89,0x0000, 0x1F8A,0x0000, 0x1F8B,0x0000, 0x1F8C,0x0000, +0x1F8D,0x0000, 0x1F8E,0x0000, 0x1F8F,0x0000, 0x1F90,0x0000, +0x1F91,0x0000, 0x1F92,0x0000, 0x1F93,0x0000, 0x1F94,0x0000, +0x1F95,0x0000, 0x1F96,0x0000, 0x1F97,0x0000, 0x1F98,0x0000, +0x1F99,0x0000, 0x1F9A,0x0000, 0x1F9B,0x0000, 0x1F9C,0x0000, +0x1F9D,0x0000, 0x1F9E,0x0000, 0x1F9F,0x0000, 0x1FA0,0x0000, +0x1FA1,0x0000, 0x1FA2,0x0000, 0x1FA3,0x0000, 0x1FA4,0x0000, +0x1FA5,0x0000, 0x1FA6,0x0000, 0x1FA7,0x0000, 0x1FA8,0x0000, +0x1FA9,0x0000, 0x1FAA,0x0000, 0x1FAB,0x0000, 0x1FAC,0x0000, +0x1FAD,0x0000, 0x1FAE,0x0000, 0x1FAF,0x0000, 0x1FB0,0x0000 +}; + +uint16 page0A1data[]= { /* A100 (2 weights per char) */ +0x1FB1,0x0000, 0x1FB2,0x0000, 0x1FB3,0x0000, 0x1FB4,0x0000, +0x1FB5,0x0000, 0x1FB6,0x0000, 0x1FB7,0x0000, 0x1FB8,0x0000, +0x1FB9,0x0000, 0x1FBA,0x0000, 0x1FBB,0x0000, 0x1FBC,0x0000, +0x1FBD,0x0000, 0x1FBE,0x0000, 0x1FBF,0x0000, 0x1FC0,0x0000, +0x1FC1,0x0000, 0x1FC2,0x0000, 0x1FC3,0x0000, 0x1FC4,0x0000, +0x1FC5,0x0000, 0x1FC6,0x0000, 0x1FC7,0x0000, 0x1FC8,0x0000, +0x1FC9,0x0000, 0x1FCA,0x0000, 0x1FCB,0x0000, 0x1FCC,0x0000, +0x1FCD,0x0000, 0x1FCE,0x0000, 0x1FCF,0x0000, 0x1FD0,0x0000, +0x1FD1,0x0000, 0x1FD2,0x0000, 0x1FD3,0x0000, 0x1FD4,0x0000, +0x1FD5,0x0000, 0x1FD6,0x0000, 0x1FD7,0x0000, 0x1FD8,0x0000, +0x1FD9,0x0000, 0x1FDA,0x0000, 0x1FDB,0x0000, 0x1FDC,0x0000, +0x1FDD,0x0000, 0x1FDE,0x0000, 0x1FDF,0x0000, 0x1FE0,0x0000, +0x1FE1,0x0000, 0x1FE2,0x0000, 0x1FE3,0x0000, 0x1FE4,0x0000, +0x1FE5,0x0000, 0x1FE6,0x0000, 0x1FE7,0x0000, 0x1FE8,0x0000, +0x1FE9,0x0000, 0x1FEA,0x0000, 0x1FEB,0x0000, 0x1FEC,0x0000, +0x1FED,0x0000, 0x1FEE,0x0000, 0x1FEF,0x0000, 0x1FF0,0x0000, +0x1FF1,0x0000, 0x1FF2,0x0000, 0x1FF3,0x0000, 0x1FF4,0x0000, +0x1FF5,0x0000, 0x1FF6,0x0000, 0x1FF7,0x0000, 0x1FF8,0x0000, +0x1FF9,0x0000, 0x1FFA,0x0000, 0x1FFB,0x0000, 0x1FFC,0x0000, +0x1FFD,0x0000, 0x1FFE,0x0000, 0x1FFF,0x0000, 0x2000,0x0000, +0x2001,0x0000, 0x2002,0x0000, 0x2003,0x0000, 0x2004,0x0000, +0x2005,0x0000, 0x2006,0x0000, 0x2007,0x0000, 0x2008,0x0000, +0x2009,0x0000, 0x200A,0x0000, 0x200B,0x0000, 0x200C,0x0000, +0x200D,0x0000, 0x200E,0x0000, 0x200F,0x0000, 0x2010,0x0000, +0x2011,0x0000, 0x2012,0x0000, 0x2013,0x0000, 0x2014,0x0000, +0x2015,0x0000, 0x2016,0x0000, 0x2017,0x0000, 0x2018,0x0000, +0x2019,0x0000, 0x201A,0x0000, 0x201B,0x0000, 0x201C,0x0000, +0x201D,0x0000, 0x201E,0x0000, 0x201F,0x0000, 0x2020,0x0000, +0x2021,0x0000, 0x2022,0x0000, 0x2023,0x0000, 0x2024,0x0000, +0x2025,0x0000, 0x2026,0x0000, 0x2027,0x0000, 0x2028,0x0000, +0x2029,0x0000, 0x202A,0x0000, 0x202B,0x0000, 0x202C,0x0000, +0x202D,0x0000, 0x202E,0x0000, 0x202F,0x0000, 0x2030,0x0000, +0x2031,0x0000, 0x2032,0x0000, 0x2033,0x0000, 0x2034,0x0000, +0x2035,0x0000, 0x2036,0x0000, 0x2037,0x0000, 0x2038,0x0000, +0x2039,0x0000, 0x203A,0x0000, 0x203B,0x0000, 0x203C,0x0000, +0x203D,0x0000, 0x203E,0x0000, 0x203F,0x0000, 0x2040,0x0000, +0x2041,0x0000, 0x2042,0x0000, 0x2043,0x0000, 0x2044,0x0000, +0x2045,0x0000, 0x2046,0x0000, 0x2047,0x0000, 0x2048,0x0000, +0x2049,0x0000, 0x204A,0x0000, 0x204B,0x0000, 0x204C,0x0000, +0x204D,0x0000, 0x204E,0x0000, 0x204F,0x0000, 0x2050,0x0000, +0x2051,0x0000, 0x2052,0x0000, 0x2053,0x0000, 0x2054,0x0000, +0x2055,0x0000, 0x2056,0x0000, 0x2057,0x0000, 0x2058,0x0000, +0x2059,0x0000, 0x205A,0x0000, 0x205B,0x0000, 0x205C,0x0000, +0x205D,0x0000, 0x205E,0x0000, 0x205F,0x0000, 0x2060,0x0000, +0x2061,0x0000, 0x2062,0x0000, 0x2063,0x0000, 0x2064,0x0000, +0x2065,0x0000, 0x2066,0x0000, 0x2067,0x0000, 0x2068,0x0000, +0x2069,0x0000, 0x206A,0x0000, 0x206B,0x0000, 0x206C,0x0000, +0x206D,0x0000, 0x206E,0x0000, 0x206F,0x0000, 0x2070,0x0000, +0x2071,0x0000, 0x2072,0x0000, 0x2073,0x0000, 0x2074,0x0000, +0x2075,0x0000, 0x2076,0x0000, 0x2077,0x0000, 0x2078,0x0000, +0x2079,0x0000, 0x207A,0x0000, 0x207B,0x0000, 0x207C,0x0000, +0x207D,0x0000, 0x207E,0x0000, 0x207F,0x0000, 0x2080,0x0000, +0x2081,0x0000, 0x2082,0x0000, 0x2083,0x0000, 0x2084,0x0000, +0x2085,0x0000, 0x2086,0x0000, 0x2087,0x0000, 0x2088,0x0000, +0x2089,0x0000, 0x208A,0x0000, 0x208B,0x0000, 0x208C,0x0000, +0x208D,0x0000, 0x208E,0x0000, 0x208F,0x0000, 0x2090,0x0000, +0x2091,0x0000, 0x2092,0x0000, 0x2093,0x0000, 0x2094,0x0000, +0x2095,0x0000, 0x2096,0x0000, 0x2097,0x0000, 0x2098,0x0000, +0x2099,0x0000, 0x209A,0x0000, 0x209B,0x0000, 0x209C,0x0000, +0x209D,0x0000, 0x209E,0x0000, 0x209F,0x0000, 0x20A0,0x0000, +0x20A1,0x0000, 0x20A2,0x0000, 0x20A3,0x0000, 0x20A4,0x0000, +0x20A5,0x0000, 0x20A6,0x0000, 0x20A7,0x0000, 0x20A8,0x0000, +0x20A9,0x0000, 0x20AA,0x0000, 0x20AB,0x0000, 0x20AC,0x0000, +0x20AD,0x0000, 0x20AE,0x0000, 0x20AF,0x0000, 0x20B0,0x0000 +}; + +uint16 page0A2data[]= { /* A200 (2 weights per char) */ +0x20B1,0x0000, 0x20B2,0x0000, 0x20B3,0x0000, 0x20B4,0x0000, +0x20B5,0x0000, 0x20B6,0x0000, 0x20B7,0x0000, 0x20B8,0x0000, +0x20B9,0x0000, 0x20BA,0x0000, 0x20BB,0x0000, 0x20BC,0x0000, +0x20BD,0x0000, 0x20BE,0x0000, 0x20BF,0x0000, 0x20C0,0x0000, +0x20C1,0x0000, 0x20C2,0x0000, 0x20C3,0x0000, 0x20C4,0x0000, +0x20C5,0x0000, 0x20C6,0x0000, 0x20C7,0x0000, 0x20C8,0x0000, +0x20C9,0x0000, 0x20CA,0x0000, 0x20CB,0x0000, 0x20CC,0x0000, +0x20CD,0x0000, 0x20CE,0x0000, 0x20CF,0x0000, 0x20D0,0x0000, +0x20D1,0x0000, 0x20D2,0x0000, 0x20D3,0x0000, 0x20D4,0x0000, +0x20D5,0x0000, 0x20D6,0x0000, 0x20D7,0x0000, 0x20D8,0x0000, +0x20D9,0x0000, 0x20DA,0x0000, 0x20DB,0x0000, 0x20DC,0x0000, +0x20DD,0x0000, 0x20DE,0x0000, 0x20DF,0x0000, 0x20E0,0x0000, +0x20E1,0x0000, 0x20E2,0x0000, 0x20E3,0x0000, 0x20E4,0x0000, +0x20E5,0x0000, 0x20E6,0x0000, 0x20E7,0x0000, 0x20E8,0x0000, +0x20E9,0x0000, 0x20EA,0x0000, 0x20EB,0x0000, 0x20EC,0x0000, +0x20ED,0x0000, 0x20EE,0x0000, 0x20EF,0x0000, 0x20F0,0x0000, +0x20F1,0x0000, 0x20F2,0x0000, 0x20F3,0x0000, 0x20F4,0x0000, +0x20F5,0x0000, 0x20F6,0x0000, 0x20F7,0x0000, 0x20F8,0x0000, +0x20F9,0x0000, 0x20FA,0x0000, 0x20FB,0x0000, 0x20FC,0x0000, +0x20FD,0x0000, 0x20FE,0x0000, 0x20FF,0x0000, 0x2100,0x0000, +0x2101,0x0000, 0x2102,0x0000, 0x2103,0x0000, 0x2104,0x0000, +0x2105,0x0000, 0x2106,0x0000, 0x2107,0x0000, 0x2108,0x0000, +0x2109,0x0000, 0x210A,0x0000, 0x210B,0x0000, 0x210C,0x0000, +0x210D,0x0000, 0x210E,0x0000, 0x210F,0x0000, 0x2110,0x0000, +0x2111,0x0000, 0x2112,0x0000, 0x2113,0x0000, 0x2114,0x0000, +0x2115,0x0000, 0x2116,0x0000, 0x2117,0x0000, 0x2118,0x0000, +0x2119,0x0000, 0x211A,0x0000, 0x211B,0x0000, 0x211C,0x0000, +0x211D,0x0000, 0x211E,0x0000, 0x211F,0x0000, 0x2120,0x0000, +0x2121,0x0000, 0x2122,0x0000, 0x2123,0x0000, 0x2124,0x0000, +0x2125,0x0000, 0x2126,0x0000, 0x2127,0x0000, 0x2128,0x0000, +0x2129,0x0000, 0x212A,0x0000, 0x212B,0x0000, 0x212C,0x0000, +0x212D,0x0000, 0x212E,0x0000, 0x212F,0x0000, 0x2130,0x0000, +0x2131,0x0000, 0x2132,0x0000, 0x2133,0x0000, 0x2134,0x0000, +0x2135,0x0000, 0x2136,0x0000, 0x2137,0x0000, 0x2138,0x0000, +0x2139,0x0000, 0x213A,0x0000, 0x213B,0x0000, 0x213C,0x0000, +0x213D,0x0000, 0x213E,0x0000, 0x213F,0x0000, 0x2140,0x0000, +0x2141,0x0000, 0x2142,0x0000, 0x2143,0x0000, 0x2144,0x0000, +0x2145,0x0000, 0x2146,0x0000, 0x2147,0x0000, 0x2148,0x0000, +0x2149,0x0000, 0x214A,0x0000, 0x214B,0x0000, 0x214C,0x0000, +0x214D,0x0000, 0x214E,0x0000, 0x214F,0x0000, 0x2150,0x0000, +0x2151,0x0000, 0x2152,0x0000, 0x2153,0x0000, 0x2154,0x0000, +0x2155,0x0000, 0x2156,0x0000, 0x2157,0x0000, 0x2158,0x0000, +0x2159,0x0000, 0x215A,0x0000, 0x215B,0x0000, 0x215C,0x0000, +0x215D,0x0000, 0x215E,0x0000, 0x215F,0x0000, 0x2160,0x0000, +0x2161,0x0000, 0x2162,0x0000, 0x2163,0x0000, 0x2164,0x0000, +0x2165,0x0000, 0x2166,0x0000, 0x2167,0x0000, 0x2168,0x0000, +0x2169,0x0000, 0x216A,0x0000, 0x216B,0x0000, 0x216C,0x0000, +0x216D,0x0000, 0x216E,0x0000, 0x216F,0x0000, 0x2170,0x0000, +0x2171,0x0000, 0x2172,0x0000, 0x2173,0x0000, 0x2174,0x0000, +0x2175,0x0000, 0x2176,0x0000, 0x2177,0x0000, 0x2178,0x0000, +0x2179,0x0000, 0x217A,0x0000, 0x217B,0x0000, 0x217C,0x0000, +0x217D,0x0000, 0x217E,0x0000, 0x217F,0x0000, 0x2180,0x0000, +0x2181,0x0000, 0x2182,0x0000, 0x2183,0x0000, 0x2184,0x0000, +0x2185,0x0000, 0x2186,0x0000, 0x2187,0x0000, 0x2188,0x0000, +0x2189,0x0000, 0x218A,0x0000, 0x218B,0x0000, 0x218C,0x0000, +0x218D,0x0000, 0x218E,0x0000, 0x218F,0x0000, 0x2190,0x0000, +0x2191,0x0000, 0x2192,0x0000, 0x2193,0x0000, 0x2194,0x0000, +0x2195,0x0000, 0x2196,0x0000, 0x2197,0x0000, 0x2198,0x0000, +0x2199,0x0000, 0x219A,0x0000, 0x219B,0x0000, 0x219C,0x0000, +0x219D,0x0000, 0x219E,0x0000, 0x219F,0x0000, 0x21A0,0x0000, +0x21A1,0x0000, 0x21A2,0x0000, 0x21A3,0x0000, 0x21A4,0x0000, +0x21A5,0x0000, 0x21A6,0x0000, 0x21A7,0x0000, 0x21A8,0x0000, +0x21A9,0x0000, 0x21AA,0x0000, 0x21AB,0x0000, 0x21AC,0x0000, +0x21AD,0x0000, 0x21AE,0x0000, 0x21AF,0x0000, 0x21B0,0x0000 +}; + +uint16 page0A3data[]= { /* A300 (2 weights per char) */ +0x21B1,0x0000, 0x21B2,0x0000, 0x21B3,0x0000, 0x21B4,0x0000, +0x21B5,0x0000, 0x21B6,0x0000, 0x21B7,0x0000, 0x21B8,0x0000, +0x21B9,0x0000, 0x21BA,0x0000, 0x21BB,0x0000, 0x21BC,0x0000, +0x21BD,0x0000, 0x21BE,0x0000, 0x21BF,0x0000, 0x21C0,0x0000, +0x21C1,0x0000, 0x21C2,0x0000, 0x21C3,0x0000, 0x21C4,0x0000, +0x21C5,0x0000, 0x21C6,0x0000, 0x21C7,0x0000, 0x21C8,0x0000, +0x21C9,0x0000, 0x21CA,0x0000, 0x21CB,0x0000, 0x21CC,0x0000, +0x21CD,0x0000, 0x21CE,0x0000, 0x21CF,0x0000, 0x21D0,0x0000, +0x21D1,0x0000, 0x21D2,0x0000, 0x21D3,0x0000, 0x21D4,0x0000, +0x21D5,0x0000, 0x21D6,0x0000, 0x21D7,0x0000, 0x21D8,0x0000, +0x21D9,0x0000, 0x21DA,0x0000, 0x21DB,0x0000, 0x21DC,0x0000, +0x21DD,0x0000, 0x21DE,0x0000, 0x21DF,0x0000, 0x21E0,0x0000, +0x21E1,0x0000, 0x21E2,0x0000, 0x21E3,0x0000, 0x21E4,0x0000, +0x21E5,0x0000, 0x21E6,0x0000, 0x21E7,0x0000, 0x21E8,0x0000, +0x21E9,0x0000, 0x21EA,0x0000, 0x21EB,0x0000, 0x21EC,0x0000, +0x21ED,0x0000, 0x21EE,0x0000, 0x21EF,0x0000, 0x21F0,0x0000, +0x21F1,0x0000, 0x21F2,0x0000, 0x21F3,0x0000, 0x21F4,0x0000, +0x21F5,0x0000, 0x21F6,0x0000, 0x21F7,0x0000, 0x21F8,0x0000, +0x21F9,0x0000, 0x21FA,0x0000, 0x21FB,0x0000, 0x21FC,0x0000, +0x21FD,0x0000, 0x21FE,0x0000, 0x21FF,0x0000, 0x2200,0x0000, +0x2201,0x0000, 0x2202,0x0000, 0x2203,0x0000, 0x2204,0x0000, +0x2205,0x0000, 0x2206,0x0000, 0x2207,0x0000, 0x2208,0x0000, +0x2209,0x0000, 0x220A,0x0000, 0x220B,0x0000, 0x220C,0x0000, +0x220D,0x0000, 0x220E,0x0000, 0x220F,0x0000, 0x2210,0x0000, +0x2211,0x0000, 0x2212,0x0000, 0x2213,0x0000, 0x2214,0x0000, +0x2215,0x0000, 0x2216,0x0000, 0x2217,0x0000, 0x2218,0x0000, +0x2219,0x0000, 0x221A,0x0000, 0x221B,0x0000, 0x221C,0x0000, +0x221D,0x0000, 0x221E,0x0000, 0x221F,0x0000, 0x2220,0x0000, +0x2221,0x0000, 0x2222,0x0000, 0x2223,0x0000, 0x2224,0x0000, +0x2225,0x0000, 0x2226,0x0000, 0x2227,0x0000, 0x2228,0x0000, +0x2229,0x0000, 0x222A,0x0000, 0x222B,0x0000, 0x222C,0x0000, +0x222D,0x0000, 0x222E,0x0000, 0x222F,0x0000, 0x2230,0x0000, +0x2231,0x0000, 0x2232,0x0000, 0x2233,0x0000, 0x2234,0x0000, +0x2235,0x0000, 0x2236,0x0000, 0x2237,0x0000, 0x2238,0x0000, +0x2239,0x0000, 0x223A,0x0000, 0x223B,0x0000, 0x223C,0x0000, +0x223D,0x0000, 0x223E,0x0000, 0x223F,0x0000, 0x2240,0x0000, +0x2241,0x0000, 0x2242,0x0000, 0x2243,0x0000, 0x2244,0x0000, +0x2245,0x0000, 0x2246,0x0000, 0x2247,0x0000, 0x2248,0x0000, +0x2249,0x0000, 0x224A,0x0000, 0x224B,0x0000, 0x224C,0x0000, +0x224D,0x0000, 0x224E,0x0000, 0x224F,0x0000, 0x2250,0x0000, +0x2251,0x0000, 0x2252,0x0000, 0x2253,0x0000, 0x2254,0x0000, +0x2255,0x0000, 0x2256,0x0000, 0x2257,0x0000, 0x2258,0x0000, +0x2259,0x0000, 0x225A,0x0000, 0x225B,0x0000, 0x225C,0x0000, +0x225D,0x0000, 0x225E,0x0000, 0x225F,0x0000, 0x2260,0x0000, +0x2261,0x0000, 0x2262,0x0000, 0x2263,0x0000, 0x2264,0x0000, +0x2265,0x0000, 0x2266,0x0000, 0x2267,0x0000, 0x2268,0x0000, +0x2269,0x0000, 0x226A,0x0000, 0x226B,0x0000, 0x226C,0x0000, +0x226D,0x0000, 0x226E,0x0000, 0x226F,0x0000, 0x2270,0x0000, +0x2271,0x0000, 0x2272,0x0000, 0x2273,0x0000, 0x2274,0x0000, +0x2275,0x0000, 0x2276,0x0000, 0x2277,0x0000, 0x2278,0x0000, +0x2279,0x0000, 0x227A,0x0000, 0x227B,0x0000, 0x227C,0x0000, +0x227D,0x0000, 0x227E,0x0000, 0x227F,0x0000, 0x2280,0x0000, +0x2281,0x0000, 0x2282,0x0000, 0x2283,0x0000, 0x2284,0x0000, +0x2285,0x0000, 0x2286,0x0000, 0x2287,0x0000, 0x2288,0x0000, +0x2289,0x0000, 0x228A,0x0000, 0x228B,0x0000, 0x228C,0x0000, +0x228D,0x0000, 0x228E,0x0000, 0x228F,0x0000, 0x2290,0x0000, +0x2291,0x0000, 0x2292,0x0000, 0x2293,0x0000, 0x2294,0x0000, +0x2295,0x0000, 0x2296,0x0000, 0x2297,0x0000, 0x2298,0x0000, +0x2299,0x0000, 0x229A,0x0000, 0x229B,0x0000, 0x229C,0x0000, +0x229D,0x0000, 0x229E,0x0000, 0x229F,0x0000, 0x22A0,0x0000, +0x22A1,0x0000, 0x22A2,0x0000, 0x22A3,0x0000, 0x22A4,0x0000, +0x22A5,0x0000, 0x22A6,0x0000, 0x22A7,0x0000, 0x22A8,0x0000, +0x22A9,0x0000, 0x22AA,0x0000, 0x22AB,0x0000, 0x22AC,0x0000, +0x22AD,0x0000, 0x22AE,0x0000, 0x22AF,0x0000, 0x22B0,0x0000 +}; + +uint16 page0A4data[]= { /* A400 (3 weights per char) */ +0x22B1,0x0000,0x0000, 0x22B2,0x0000,0x0000, 0x22B3,0x0000,0x0000, +0x22B4,0x0000,0x0000, 0x22B5,0x0000,0x0000, 0x22B6,0x0000,0x0000, +0x22B7,0x0000,0x0000, 0x22B8,0x0000,0x0000, 0x22B9,0x0000,0x0000, +0x22BA,0x0000,0x0000, 0x22BB,0x0000,0x0000, 0x22BC,0x0000,0x0000, +0x22BD,0x0000,0x0000, 0x22BE,0x0000,0x0000, 0x22BF,0x0000,0x0000, +0x22C0,0x0000,0x0000, 0x22C1,0x0000,0x0000, 0x22C2,0x0000,0x0000, +0x22C3,0x0000,0x0000, 0x22C4,0x0000,0x0000, 0x22C5,0x0000,0x0000, +0x22C6,0x0000,0x0000, 0x22C7,0x0000,0x0000, 0x22C8,0x0000,0x0000, +0x22C9,0x0000,0x0000, 0x22CA,0x0000,0x0000, 0x22CB,0x0000,0x0000, +0x22CC,0x0000,0x0000, 0x22CD,0x0000,0x0000, 0x22CE,0x0000,0x0000, +0x22CF,0x0000,0x0000, 0x22D0,0x0000,0x0000, 0x22D1,0x0000,0x0000, +0x22D2,0x0000,0x0000, 0x22D3,0x0000,0x0000, 0x22D4,0x0000,0x0000, +0x22D5,0x0000,0x0000, 0x22D6,0x0000,0x0000, 0x22D7,0x0000,0x0000, +0x22D8,0x0000,0x0000, 0x22D9,0x0000,0x0000, 0x22DA,0x0000,0x0000, +0x22DB,0x0000,0x0000, 0x22DC,0x0000,0x0000, 0x22DD,0x0000,0x0000, +0x22DE,0x0000,0x0000, 0x22DF,0x0000,0x0000, 0x22E0,0x0000,0x0000, +0x22E1,0x0000,0x0000, 0x22E2,0x0000,0x0000, 0x22E3,0x0000,0x0000, +0x22E4,0x0000,0x0000, 0x22E5,0x0000,0x0000, 0x22E6,0x0000,0x0000, +0x22E7,0x0000,0x0000, 0x22E8,0x0000,0x0000, 0x22E9,0x0000,0x0000, +0x22EA,0x0000,0x0000, 0x22EB,0x0000,0x0000, 0x22EC,0x0000,0x0000, +0x22ED,0x0000,0x0000, 0x22EE,0x0000,0x0000, 0x22EF,0x0000,0x0000, +0x22F0,0x0000,0x0000, 0x22F1,0x0000,0x0000, 0x22F2,0x0000,0x0000, +0x22F3,0x0000,0x0000, 0x22F4,0x0000,0x0000, 0x22F5,0x0000,0x0000, +0x22F6,0x0000,0x0000, 0x22F7,0x0000,0x0000, 0x22F8,0x0000,0x0000, +0x22F9,0x0000,0x0000, 0x22FA,0x0000,0x0000, 0x22FB,0x0000,0x0000, +0x22FC,0x0000,0x0000, 0x22FD,0x0000,0x0000, 0x22FE,0x0000,0x0000, +0x22FF,0x0000,0x0000, 0x2300,0x0000,0x0000, 0x2301,0x0000,0x0000, +0x2302,0x0000,0x0000, 0x2303,0x0000,0x0000, 0x2304,0x0000,0x0000, +0x2305,0x0000,0x0000, 0x2306,0x0000,0x0000, 0x2307,0x0000,0x0000, +0x2308,0x0000,0x0000, 0x2309,0x0000,0x0000, 0x230A,0x0000,0x0000, +0x230B,0x0000,0x0000, 0x230C,0x0000,0x0000, 0x230D,0x0000,0x0000, +0x230E,0x0000,0x0000, 0x230F,0x0000,0x0000, 0x2310,0x0000,0x0000, +0x2311,0x0000,0x0000, 0x2312,0x0000,0x0000, 0x2313,0x0000,0x0000, +0x2314,0x0000,0x0000, 0x2315,0x0000,0x0000, 0x2316,0x0000,0x0000, +0x2317,0x0000,0x0000, 0x2318,0x0000,0x0000, 0x2319,0x0000,0x0000, +0x231A,0x0000,0x0000, 0x231B,0x0000,0x0000, 0x231C,0x0000,0x0000, +0x231D,0x0000,0x0000, 0x231E,0x0000,0x0000, 0x231F,0x0000,0x0000, +0x2320,0x0000,0x0000, 0x2321,0x0000,0x0000, 0x2322,0x0000,0x0000, +0x2323,0x0000,0x0000, 0x2324,0x0000,0x0000, 0x2325,0x0000,0x0000, +0x2326,0x0000,0x0000, 0x2327,0x0000,0x0000, 0x2328,0x0000,0x0000, +0x2329,0x0000,0x0000, 0x232A,0x0000,0x0000, 0x232B,0x0000,0x0000, +0x232C,0x0000,0x0000, 0x232D,0x0000,0x0000, 0x232E,0x0000,0x0000, +0x232F,0x0000,0x0000, 0x2330,0x0000,0x0000, 0x2331,0x0000,0x0000, +0x2332,0x0000,0x0000, 0x2333,0x0000,0x0000, 0x2334,0x0000,0x0000, +0x2335,0x0000,0x0000, 0x2336,0x0000,0x0000, 0x2337,0x0000,0x0000, +0x2338,0x0000,0x0000, 0x2339,0x0000,0x0000, 0x233A,0x0000,0x0000, +0x233B,0x0000,0x0000, 0x233C,0x0000,0x0000, 0x233D,0x0000,0x0000, +0xFBC1,0xA48D,0x0000, 0xFBC1,0xA48E,0x0000, 0xFBC1,0xA48F,0x0000, +0x0BCE,0x0000,0x0000, 0x0BCF,0x0000,0x0000, 0x0BD0,0x0000,0x0000, +0x0BD1,0x0000,0x0000, 0x0BD2,0x0000,0x0000, 0x0BD3,0x0000,0x0000, +0x0BD4,0x0000,0x0000, 0x0BD5,0x0000,0x0000, 0x0BD6,0x0000,0x0000, +0x0BD7,0x0000,0x0000, 0x0BD8,0x0000,0x0000, 0x0BD9,0x0000,0x0000, +0x0BDA,0x0000,0x0000, 0x0BDB,0x0000,0x0000, 0x0BDC,0x0000,0x0000, +0x0BDD,0x0000,0x0000, 0x0BDE,0x0000,0x0000, 0x0BDF,0x0000,0x0000, +0x0BE0,0x0000,0x0000, 0x0BE1,0x0000,0x0000, 0x0BE2,0x0000,0x0000, +0x0BE3,0x0000,0x0000, 0x0BE4,0x0000,0x0000, 0x0BE5,0x0000,0x0000, +0x0BE6,0x0000,0x0000, 0x0BE7,0x0000,0x0000, 0x0BE8,0x0000,0x0000, +0x0BE9,0x0000,0x0000, 0x0BEA,0x0000,0x0000, 0x0BEB,0x0000,0x0000, +0x0BEC,0x0000,0x0000, 0x0BED,0x0000,0x0000, 0x0BEE,0x0000,0x0000, +0x0BEF,0x0000,0x0000, 0x0BF0,0x0000,0x0000, 0x0BF1,0x0000,0x0000, +0x0BF2,0x0000,0x0000, 0x0BF3,0x0000,0x0000, 0x0BF4,0x0000,0x0000, +0x0BF5,0x0000,0x0000, 0x0BF6,0x0000,0x0000, 0x0BF7,0x0000,0x0000, +0x0BF8,0x0000,0x0000, 0x0BF9,0x0000,0x0000, 0x0BFA,0x0000,0x0000, +0x0BFB,0x0000,0x0000, 0x0BFC,0x0000,0x0000, 0x0BFD,0x0000,0x0000, +0x0BFE,0x0000,0x0000, 0x0BFF,0x0000,0x0000, 0x0C00,0x0000,0x0000, +0x0C01,0x0000,0x0000, 0x0C02,0x0000,0x0000, 0x0C03,0x0000,0x0000, +0x0C04,0x0000,0x0000, 0xFBC1,0xA4C7,0x0000, 0xFBC1,0xA4C8,0x0000, +0xFBC1,0xA4C9,0x0000, 0xFBC1,0xA4CA,0x0000, 0xFBC1,0xA4CB,0x0000, +0xFBC1,0xA4CC,0x0000, 0xFBC1,0xA4CD,0x0000, 0xFBC1,0xA4CE,0x0000, +0xFBC1,0xA4CF,0x0000, 0xFBC1,0xA4D0,0x0000, 0xFBC1,0xA4D1,0x0000, +0xFBC1,0xA4D2,0x0000, 0xFBC1,0xA4D3,0x0000, 0xFBC1,0xA4D4,0x0000, +0xFBC1,0xA4D5,0x0000, 0xFBC1,0xA4D6,0x0000, 0xFBC1,0xA4D7,0x0000, +0xFBC1,0xA4D8,0x0000, 0xFBC1,0xA4D9,0x0000, 0xFBC1,0xA4DA,0x0000, +0xFBC1,0xA4DB,0x0000, 0xFBC1,0xA4DC,0x0000, 0xFBC1,0xA4DD,0x0000, +0xFBC1,0xA4DE,0x0000, 0xFBC1,0xA4DF,0x0000, 0xFBC1,0xA4E0,0x0000, +0xFBC1,0xA4E1,0x0000, 0xFBC1,0xA4E2,0x0000, 0xFBC1,0xA4E3,0x0000, +0xFBC1,0xA4E4,0x0000, 0xFBC1,0xA4E5,0x0000, 0xFBC1,0xA4E6,0x0000, +0xFBC1,0xA4E7,0x0000, 0xFBC1,0xA4E8,0x0000, 0xFBC1,0xA4E9,0x0000, +0xFBC1,0xA4EA,0x0000, 0xFBC1,0xA4EB,0x0000, 0xFBC1,0xA4EC,0x0000, +0xFBC1,0xA4ED,0x0000, 0xFBC1,0xA4EE,0x0000, 0xFBC1,0xA4EF,0x0000, +0xFBC1,0xA4F0,0x0000, 0xFBC1,0xA4F1,0x0000, 0xFBC1,0xA4F2,0x0000, +0xFBC1,0xA4F3,0x0000, 0xFBC1,0xA4F4,0x0000, 0xFBC1,0xA4F5,0x0000, +0xFBC1,0xA4F6,0x0000, 0xFBC1,0xA4F7,0x0000, 0xFBC1,0xA4F8,0x0000, +0xFBC1,0xA4F9,0x0000, 0xFBC1,0xA4FA,0x0000, 0xFBC1,0xA4FB,0x0000, +0xFBC1,0xA4FC,0x0000, 0xFBC1,0xA4FD,0x0000, 0xFBC1,0xA4FE,0x0000, +0xFBC1,0xA4FF,0x0000 }; + +uint16 page0F9data[]= { /* F900 (3 weights per char) */ +0xFB41,0x8C48,0x0000, 0xFB40,0xE6F4,0x0000, 0xFB41,0x8ECA,0x0000, +0xFB41,0x8CC8,0x0000, 0xFB40,0xEED1,0x0000, 0xFB40,0xCE32,0x0000, +0xFB40,0xD3E5,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000, +0xFB40,0xD951,0x0000, 0xFB41,0x91D1,0x0000, 0xFB40,0xD587,0x0000, +0xFB40,0xD948,0x0000, 0xFB40,0xE1F6,0x0000, 0xFB40,0xF669,0x0000, +0xFB40,0xFF85,0x0000, 0xFB41,0x863F,0x0000, 0xFB41,0x87BA,0x0000, +0xFB41,0x88F8,0x0000, 0xFB41,0x908F,0x0000, 0xFB40,0xEA02,0x0000, +0xFB40,0xED1B,0x0000, 0xFB40,0xF0D9,0x0000, 0xFB40,0xF3DE,0x0000, +0xFB41,0x843D,0x0000, 0xFB41,0x916A,0x0000, 0xFB41,0x99F1,0x0000, +0xFB40,0xCE82,0x0000, 0xFB40,0xD375,0x0000, 0xFB40,0xEB04,0x0000, +0xFB40,0xF21B,0x0000, 0xFB41,0x862D,0x0000, 0xFB41,0x9E1E,0x0000, +0xFB40,0xDD50,0x0000, 0xFB40,0xEFEB,0x0000, 0xFB41,0x85CD,0x0000, +0xFB41,0x8964,0x0000, 0xFB40,0xE2C9,0x0000, 0xFB41,0x81D8,0x0000, +0xFB41,0x881F,0x0000, 0xFB40,0xDECA,0x0000, 0xFB40,0xE717,0x0000, +0xFB40,0xED6A,0x0000, 0xFB40,0xF2FC,0x0000, 0xFB41,0x90CE,0x0000, +0xFB40,0xCF86,0x0000, 0xFB40,0xD1B7,0x0000, 0xFB40,0xD2DE,0x0000, +0xFB40,0xE4C4,0x0000, 0xFB40,0xEAD3,0x0000, 0xFB40,0xF210,0x0000, +0xFB40,0xF6E7,0x0000, 0xFB41,0x8001,0x0000, 0xFB41,0x8606,0x0000, +0xFB41,0x865C,0x0000, 0xFB41,0x8DEF,0x0000, 0xFB41,0x9732,0x0000, +0xFB41,0x9B6F,0x0000, 0xFB41,0x9DFA,0x0000, 0xFB40,0xF88C,0x0000, +0xFB40,0xF97F,0x0000, 0xFB40,0xFDA0,0x0000, 0xFB41,0x83C9,0x0000, +0xFB41,0x9304,0x0000, 0xFB41,0x9E7F,0x0000, 0xFB41,0x8AD6,0x0000, +0xFB40,0xD8DF,0x0000, 0xFB40,0xDF04,0x0000, 0xFB40,0xFC60,0x0000, +0xFB41,0x807E,0x0000, 0xFB40,0xF262,0x0000, 0xFB40,0xF8CA,0x0000, +0xFB41,0x8CC2,0x0000, 0xFB41,0x96F7,0x0000, 0xFB40,0xD8D8,0x0000, +0xFB40,0xDC62,0x0000, 0xFB40,0xEA13,0x0000, 0xFB40,0xEDDA,0x0000, +0xFB40,0xEF0F,0x0000, 0xFB40,0xFD2F,0x0000, 0xFB40,0xFE37,0x0000, +0xFB41,0x964B,0x0000, 0xFB40,0xD2D2,0x0000, 0xFB41,0x808B,0x0000, +0xFB40,0xD1DC,0x0000, 0xFB40,0xD1CC,0x0000, 0xFB40,0xFA1C,0x0000, +0xFB40,0xFDBE,0x0000, 0xFB41,0x83F1,0x0000, 0xFB41,0x9675,0x0000, +0xFB41,0x8B80,0x0000, 0xFB40,0xE2CF,0x0000, 0xFB40,0xEA02,0x0000, +0xFB41,0x8AFE,0x0000, 0xFB40,0xCE39,0x0000, 0xFB40,0xDBE7,0x0000, +0xFB40,0xE012,0x0000, 0xFB40,0xF387,0x0000, 0xFB40,0xF570,0x0000, +0xFB40,0xD317,0x0000, 0xFB40,0xF8FB,0x0000, 0xFB40,0xCFBF,0x0000, +0xFB40,0xDFA9,0x0000, 0xFB40,0xCE0D,0x0000, 0xFB40,0xECCC,0x0000, +0xFB40,0xE578,0x0000, 0xFB40,0xFD22,0x0000, 0xFB40,0xD3C3,0x0000, +0xFB40,0xD85E,0x0000, 0xFB40,0xF701,0x0000, 0xFB41,0x8449,0x0000, +0xFB41,0x8AAA,0x0000, 0xFB40,0xEBBA,0x0000, 0xFB41,0x8FB0,0x0000, +0xFB40,0xEC88,0x0000, 0xFB40,0xE2FE,0x0000, 0xFB41,0x82E5,0x0000, +0xFB40,0xE3A0,0x0000, 0xFB40,0xF565,0x0000, 0xFB40,0xCEAE,0x0000, +0xFB40,0xD169,0x0000, 0xFB40,0xD1C9,0x0000, 0xFB40,0xE881,0x0000, +0xFB40,0xFCE7,0x0000, 0xFB41,0x826F,0x0000, 0xFB41,0x8AD2,0x0000, +0xFB41,0x91CF,0x0000, 0xFB40,0xD2F5,0x0000, 0xFB40,0xD442,0x0000, +0xFB40,0xD973,0x0000, 0xFB40,0xDEEC,0x0000, 0xFB40,0xE5C5,0x0000, +0xFB40,0xEFFE,0x0000, 0xFB40,0xF92A,0x0000, 0xFB41,0x95AD,0x0000, +0xFB41,0x9A6A,0x0000, 0xFB41,0x9E97,0x0000, 0xFB41,0x9ECE,0x0000, +0xFB40,0xD29B,0x0000, 0xFB40,0xE6C6,0x0000, 0xFB40,0xEB77,0x0000, +0xFB41,0x8F62,0x0000, 0xFB40,0xDE74,0x0000, 0xFB40,0xE190,0x0000, +0xFB40,0xE200,0x0000, 0xFB40,0xE49A,0x0000, 0xFB40,0xEF23,0x0000, +0xFB40,0xF149,0x0000, 0xFB40,0xF489,0x0000, 0xFB40,0xF9CA,0x0000, +0xFB40,0xFDF4,0x0000, 0xFB41,0x806F,0x0000, 0xFB41,0x8F26,0x0000, +0xFB41,0x84EE,0x0000, 0xFB41,0x9023,0x0000, 0xFB41,0x934A,0x0000, +0xFB40,0xD217,0x0000, 0xFB40,0xD2A3,0x0000, 0xFB40,0xD4BD,0x0000, +0xFB40,0xF0C8,0x0000, 0xFB41,0x88C2,0x0000, 0xFB41,0x8AAA,0x0000, +0xFB40,0xDEC9,0x0000, 0xFB40,0xDFF5,0x0000, 0xFB40,0xE37B,0x0000, +0xFB40,0xEBAE,0x0000, 0xFB40,0xFC3E,0x0000, 0xFB40,0xF375,0x0000, +0xFB40,0xCEE4,0x0000, 0xFB40,0xD6F9,0x0000, 0xFB40,0xDBE7,0x0000, +0xFB40,0xDDBA,0x0000, 0xFB40,0xE01C,0x0000, 0xFB40,0xF3B2,0x0000, +0xFB40,0xF469,0x0000, 0xFB40,0xFF9A,0x0000, 0xFB41,0x8046,0x0000, +0xFB41,0x9234,0x0000, 0xFB41,0x96F6,0x0000, 0xFB41,0x9748,0x0000, +0xFB41,0x9818,0x0000, 0xFB40,0xCF8B,0x0000, 0xFB40,0xF9AE,0x0000, +0xFB41,0x91B4,0x0000, 0xFB41,0x96B8,0x0000, 0xFB40,0xE0E1,0x0000, +0xFB40,0xCE86,0x0000, 0xFB40,0xD0DA,0x0000, 0xFB40,0xDBEE,0x0000, +0xFB40,0xDC3F,0x0000, 0xFB40,0xE599,0x0000, 0xFB40,0xEA02,0x0000, +0xFB40,0xF1CE,0x0000, 0xFB40,0xF642,0x0000, 0xFB41,0x84FC,0x0000, +0xFB41,0x907C,0x0000, 0xFB41,0x9F8D,0x0000, 0xFB40,0xE688,0x0000, +0xFB41,0x962E,0x0000, 0xFB40,0xD289,0x0000, 0xFB40,0xE77B,0x0000, +0xFB40,0xE7F3,0x0000, 0xFB40,0xED41,0x0000, 0xFB40,0xEE9C,0x0000, +0xFB40,0xF409,0x0000, 0xFB40,0xF559,0x0000, 0xFB40,0xF86B,0x0000, +0xFB40,0xFD10,0x0000, 0xFB41,0x985E,0x0000, 0xFB40,0xD16D,0x0000, +0xFB40,0xE22E,0x0000, 0xFB41,0x9678,0x0000, 0xFB40,0xD02B,0x0000, +0xFB40,0xDD19,0x0000, 0xFB40,0xEDEA,0x0000, 0xFB41,0x8F2A,0x0000, +0xFB40,0xDF8B,0x0000, 0xFB40,0xE144,0x0000, 0xFB40,0xE817,0x0000, +0xFB40,0xF387,0x0000, 0xFB41,0x9686,0x0000, 0xFB40,0xD229,0x0000, +0xFB40,0xD40F,0x0000, 0xFB40,0xDC65,0x0000, 0xFB40,0xE613,0x0000, +0xFB40,0xE74E,0x0000, 0xFB40,0xE8A8,0x0000, 0xFB40,0xECE5,0x0000, +0xFB40,0xF406,0x0000, 0xFB40,0xF5E2,0x0000, 0xFB40,0xFF79,0x0000, +0xFB41,0x88CF,0x0000, 0xFB41,0x88E1,0x0000, 0xFB41,0x91CC,0x0000, +0xFB41,0x96E2,0x0000, 0xFB40,0xD33F,0x0000, 0xFB40,0xEEBA,0x0000, +0xFB40,0xD41D,0x0000, 0xFB40,0xF1D0,0x0000, 0xFB40,0xF498,0x0000, +0xFB41,0x85FA,0x0000, 0xFB41,0x96A3,0x0000, 0xFB41,0x9C57,0x0000, +0xFB41,0x9E9F,0x0000, 0xFB40,0xE797,0x0000, 0xFB40,0xEDCB,0x0000, +0xFB41,0x81E8,0x0000, 0xFB40,0xFACB,0x0000, 0xFB40,0xFB20,0x0000, +0xFB40,0xFC92,0x0000, 0xFB40,0xF2C0,0x0000, 0xFB40,0xF099,0x0000, +0xFB41,0x8B58,0x0000, 0xFB40,0xCEC0,0x0000, 0xFB41,0x8336,0x0000, +0xFB40,0xD23A,0x0000 }; + +uint16 page0FAdata[]= { /* FA00 (3 weights per char) */ +0xFB40,0xD207,0x0000, 0xFB40,0xDEA6,0x0000, 0xFB40,0xE2D3,0x0000, +0xFB40,0xFCD6,0x0000, 0xFB40,0xDB85,0x0000, 0xFB40,0xED1E,0x0000, +0xFB40,0xE6B4,0x0000, 0xFB41,0x8F3B,0x0000, 0xFB41,0x884C,0x0000, +0xFB41,0x964D,0x0000, 0xFB41,0x898B,0x0000, 0xFB40,0xDED3,0x0000, +0xFB40,0xD140,0x0000, 0xFB40,0xD5C0,0x0000, 0xFB41,0xFA0E,0x0000, +0xFB41,0xFA0F,0x0000, 0xFB40,0xD85A,0x0000, 0xFB41,0xFA11,0x0000, +0xFB40,0xE674,0x0000, 0xFB41,0xFA13,0x0000, 0xFB41,0xFA14,0x0000, +0xFB40,0xD1DE,0x0000, 0xFB40,0xF32A,0x0000, 0xFB40,0xF6CA,0x0000, +0xFB40,0xF93C,0x0000, 0xFB40,0xF95E,0x0000, 0xFB40,0xF965,0x0000, +0xFB40,0xF98F,0x0000, 0xFB41,0x9756,0x0000, 0xFB40,0xFCBE,0x0000, +0xFB40,0xFFBD,0x0000, 0xFB41,0xFA1F,0x0000, 0xFB41,0x8612,0x0000, +0xFB41,0xFA21,0x0000, 0xFB41,0x8AF8,0x0000, 0xFB41,0xFA23,0x0000, +0xFB41,0xFA24,0x0000, 0xFB41,0x9038,0x0000, 0xFB41,0x90FD,0x0000, +0xFB41,0xFA27,0x0000, 0xFB41,0xFA28,0x0000, 0xFB41,0xFA29,0x0000, +0xFB41,0x98EF,0x0000, 0xFB41,0x98FC,0x0000, 0xFB41,0x9928,0x0000, +0xFB41,0x9DB4,0x0000, 0xFBC1,0xFA2E,0x0000, 0xFBC1,0xFA2F,0x0000, +0xFB40,0xCFAE,0x0000, 0xFB40,0xD0E7,0x0000, 0xFB40,0xD14D,0x0000, +0xFB40,0xD2C9,0x0000, 0xFB40,0xD2E4,0x0000, 0xFB40,0xD351,0x0000, +0xFB40,0xD59D,0x0000, 0xFB40,0xD606,0x0000, 0xFB40,0xD668,0x0000, +0xFB40,0xD840,0x0000, 0xFB40,0xD8A8,0x0000, 0xFB40,0xDC64,0x0000, +0xFB40,0xDC6E,0x0000, 0xFB40,0xE094,0x0000, 0xFB40,0xE168,0x0000, +0xFB40,0xE18E,0x0000, 0xFB40,0xE1F2,0x0000, 0xFB40,0xE54F,0x0000, +0xFB40,0xE5E2,0x0000, 0xFB40,0xE691,0x0000, 0xFB40,0xE885,0x0000, +0xFB40,0xED77,0x0000, 0xFB40,0xEE1A,0x0000, 0xFB40,0xEF22,0x0000, +0xFB40,0xF16E,0x0000, 0xFB40,0xF22B,0x0000, 0xFB40,0xF422,0x0000, +0xFB40,0xF891,0x0000, 0xFB40,0xF93E,0x0000, 0xFB40,0xF949,0x0000, +0xFB40,0xF948,0x0000, 0xFB40,0xF950,0x0000, 0xFB40,0xF956,0x0000, +0xFB40,0xF95D,0x0000, 0xFB40,0xF98D,0x0000, 0xFB40,0xF98E,0x0000, +0xFB40,0xFA40,0x0000, 0xFB40,0xFA81,0x0000, 0xFB40,0xFBC0,0x0000, +0xFB40,0xFDF4,0x0000, 0xFB40,0xFE09,0x0000, 0xFB40,0xFE41,0x0000, +0xFB40,0xFF72,0x0000, 0xFB41,0x8005,0x0000, 0xFB41,0x81ED,0x0000, +0xFB41,0x8279,0x0000, 0xFB41,0x8279,0x0000, 0xFB41,0x8457,0x0000, +0xFB41,0x8910,0x0000, 0xFB41,0x8996,0x0000, 0xFB41,0x8B01,0x0000, +0xFB41,0x8B39,0x0000, 0xFB41,0x8CD3,0x0000, 0xFB41,0x8D08,0x0000, +0xFB41,0x8FB6,0x0000, 0xFB41,0x9038,0x0000, 0xFB41,0x96E3,0x0000, +0xFB41,0x97FF,0x0000, 0xFB41,0x983B,0x0000, 0xFBC1,0xFA6B,0x0000, +0xFBC1,0xFA6C,0x0000, 0xFBC1,0xFA6D,0x0000, 0xFBC1,0xFA6E,0x0000, +0xFBC1,0xFA6F,0x0000, 0xFBC1,0xFA70,0x0000, 0xFBC1,0xFA71,0x0000, +0xFBC1,0xFA72,0x0000, 0xFBC1,0xFA73,0x0000, 0xFBC1,0xFA74,0x0000, +0xFBC1,0xFA75,0x0000, 0xFBC1,0xFA76,0x0000, 0xFBC1,0xFA77,0x0000, +0xFBC1,0xFA78,0x0000, 0xFBC1,0xFA79,0x0000, 0xFBC1,0xFA7A,0x0000, +0xFBC1,0xFA7B,0x0000, 0xFBC1,0xFA7C,0x0000, 0xFBC1,0xFA7D,0x0000, +0xFBC1,0xFA7E,0x0000, 0xFBC1,0xFA7F,0x0000, 0xFBC1,0xFA80,0x0000, +0xFBC1,0xFA81,0x0000, 0xFBC1,0xFA82,0x0000, 0xFBC1,0xFA83,0x0000, +0xFBC1,0xFA84,0x0000, 0xFBC1,0xFA85,0x0000, 0xFBC1,0xFA86,0x0000, +0xFBC1,0xFA87,0x0000, 0xFBC1,0xFA88,0x0000, 0xFBC1,0xFA89,0x0000, +0xFBC1,0xFA8A,0x0000, 0xFBC1,0xFA8B,0x0000, 0xFBC1,0xFA8C,0x0000, +0xFBC1,0xFA8D,0x0000, 0xFBC1,0xFA8E,0x0000, 0xFBC1,0xFA8F,0x0000, +0xFBC1,0xFA90,0x0000, 0xFBC1,0xFA91,0x0000, 0xFBC1,0xFA92,0x0000, +0xFBC1,0xFA93,0x0000, 0xFBC1,0xFA94,0x0000, 0xFBC1,0xFA95,0x0000, +0xFBC1,0xFA96,0x0000, 0xFBC1,0xFA97,0x0000, 0xFBC1,0xFA98,0x0000, +0xFBC1,0xFA99,0x0000, 0xFBC1,0xFA9A,0x0000, 0xFBC1,0xFA9B,0x0000, +0xFBC1,0xFA9C,0x0000, 0xFBC1,0xFA9D,0x0000, 0xFBC1,0xFA9E,0x0000, +0xFBC1,0xFA9F,0x0000, 0xFBC1,0xFAA0,0x0000, 0xFBC1,0xFAA1,0x0000, +0xFBC1,0xFAA2,0x0000, 0xFBC1,0xFAA3,0x0000, 0xFBC1,0xFAA4,0x0000, +0xFBC1,0xFAA5,0x0000, 0xFBC1,0xFAA6,0x0000, 0xFBC1,0xFAA7,0x0000, +0xFBC1,0xFAA8,0x0000, 0xFBC1,0xFAA9,0x0000, 0xFBC1,0xFAAA,0x0000, +0xFBC1,0xFAAB,0x0000, 0xFBC1,0xFAAC,0x0000, 0xFBC1,0xFAAD,0x0000, +0xFBC1,0xFAAE,0x0000, 0xFBC1,0xFAAF,0x0000, 0xFBC1,0xFAB0,0x0000, +0xFBC1,0xFAB1,0x0000, 0xFBC1,0xFAB2,0x0000, 0xFBC1,0xFAB3,0x0000, +0xFBC1,0xFAB4,0x0000, 0xFBC1,0xFAB5,0x0000, 0xFBC1,0xFAB6,0x0000, +0xFBC1,0xFAB7,0x0000, 0xFBC1,0xFAB8,0x0000, 0xFBC1,0xFAB9,0x0000, +0xFBC1,0xFABA,0x0000, 0xFBC1,0xFABB,0x0000, 0xFBC1,0xFABC,0x0000, +0xFBC1,0xFABD,0x0000, 0xFBC1,0xFABE,0x0000, 0xFBC1,0xFABF,0x0000, +0xFBC1,0xFAC0,0x0000, 0xFBC1,0xFAC1,0x0000, 0xFBC1,0xFAC2,0x0000, +0xFBC1,0xFAC3,0x0000, 0xFBC1,0xFAC4,0x0000, 0xFBC1,0xFAC5,0x0000, +0xFBC1,0xFAC6,0x0000, 0xFBC1,0xFAC7,0x0000, 0xFBC1,0xFAC8,0x0000, +0xFBC1,0xFAC9,0x0000, 0xFBC1,0xFACA,0x0000, 0xFBC1,0xFACB,0x0000, +0xFBC1,0xFACC,0x0000, 0xFBC1,0xFACD,0x0000, 0xFBC1,0xFACE,0x0000, +0xFBC1,0xFACF,0x0000, 0xFBC1,0xFAD0,0x0000, 0xFBC1,0xFAD1,0x0000, +0xFBC1,0xFAD2,0x0000, 0xFBC1,0xFAD3,0x0000, 0xFBC1,0xFAD4,0x0000, +0xFBC1,0xFAD5,0x0000, 0xFBC1,0xFAD6,0x0000, 0xFBC1,0xFAD7,0x0000, +0xFBC1,0xFAD8,0x0000, 0xFBC1,0xFAD9,0x0000, 0xFBC1,0xFADA,0x0000, +0xFBC1,0xFADB,0x0000, 0xFBC1,0xFADC,0x0000, 0xFBC1,0xFADD,0x0000, +0xFBC1,0xFADE,0x0000, 0xFBC1,0xFADF,0x0000, 0xFBC1,0xFAE0,0x0000, +0xFBC1,0xFAE1,0x0000, 0xFBC1,0xFAE2,0x0000, 0xFBC1,0xFAE3,0x0000, +0xFBC1,0xFAE4,0x0000, 0xFBC1,0xFAE5,0x0000, 0xFBC1,0xFAE6,0x0000, +0xFBC1,0xFAE7,0x0000, 0xFBC1,0xFAE8,0x0000, 0xFBC1,0xFAE9,0x0000, +0xFBC1,0xFAEA,0x0000, 0xFBC1,0xFAEB,0x0000, 0xFBC1,0xFAEC,0x0000, +0xFBC1,0xFAED,0x0000, 0xFBC1,0xFAEE,0x0000, 0xFBC1,0xFAEF,0x0000, +0xFBC1,0xFAF0,0x0000, 0xFBC1,0xFAF1,0x0000, 0xFBC1,0xFAF2,0x0000, +0xFBC1,0xFAF3,0x0000, 0xFBC1,0xFAF4,0x0000, 0xFBC1,0xFAF5,0x0000, +0xFBC1,0xFAF6,0x0000, 0xFBC1,0xFAF7,0x0000, 0xFBC1,0xFAF8,0x0000, +0xFBC1,0xFAF9,0x0000, 0xFBC1,0xFAFA,0x0000, 0xFBC1,0xFAFB,0x0000, +0xFBC1,0xFAFC,0x0000, 0xFBC1,0xFAFD,0x0000, 0xFBC1,0xFAFE,0x0000, +0xFBC1,0xFAFF,0x0000 }; + +uint16 page0FBdata[]= { /* FB00 (4 weights per char) */ +0x0EB9,0x0EB9,0x0000,0x0000, 0x0EB9,0x0EFB,0x0000,0x0000, +0x0EB9,0x0F2E,0x0000,0x0000, 0x0EB9,0x0EB9,0x0EFB,0x0000, +0x0EB9,0x0EB9,0x0F2E,0x0000, 0x0FEA,0x1002,0x0000,0x0000, +0x0FEA,0x1002,0x0000,0x0000, 0xFBC1,0xFB07,0x0000,0x0000, +0xFBC1,0xFB08,0x0000,0x0000, 0xFBC1,0xFB09,0x0000,0x0000, +0xFBC1,0xFB0A,0x0000,0x0000, 0xFBC1,0xFB0B,0x0000,0x0000, +0xFBC1,0xFB0C,0x0000,0x0000, 0xFBC1,0xFB0D,0x0000,0x0000, +0xFBC1,0xFB0E,0x0000,0x0000, 0xFBC1,0xFB0F,0x0000,0x0000, +0xFBC1,0xFB10,0x0000,0x0000, 0xFBC1,0xFB11,0x0000,0x0000, +0xFBC1,0xFB12,0x0000,0x0000, 0x131D,0x131F,0x0000,0x0000, +0x131D,0x130E,0x0000,0x0000, 0x131D,0x1314,0x0000,0x0000, +0x1327,0x131F,0x0000,0x0000, 0x131D,0x1316,0x0000,0x0000, +0xFBC1,0xFB18,0x0000,0x0000, 0xFBC1,0xFB19,0x0000,0x0000, +0xFBC1,0xFB1A,0x0000,0x0000, 0xFBC1,0xFB1B,0x0000,0x0000, +0xFBC1,0xFB1C,0x0000,0x0000, 0x133A,0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000,0x0000, 0x133A,0x133A,0x0000,0x0000, +0x1340,0x0000,0x0000,0x0000, 0x1331,0x0000,0x0000,0x0000, +0x1334,0x0000,0x0000,0x0000, 0x1335,0x0000,0x0000,0x0000, +0x133B,0x0000,0x0000,0x0000, 0x133C,0x0000,0x0000,0x0000, +0x133D,0x0000,0x0000,0x0000, 0x1344,0x0000,0x0000,0x0000, +0x1346,0x0000,0x0000,0x0000, 0x0428,0x0000,0x0000,0x0000, +0x1345,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000, +0x1345,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000, +0x1331,0x0000,0x0000,0x0000, 0x1331,0x0000,0x0000,0x0000, +0x1331,0x0000,0x0000,0x0000, 0x1332,0x0000,0x0000,0x0000, +0x1333,0x0000,0x0000,0x0000, 0x1334,0x0000,0x0000,0x0000, +0x1335,0x0000,0x0000,0x0000, 0x1336,0x0000,0x0000,0x0000, +0x1337,0x0000,0x0000,0x0000, 0xFBC1,0xFB37,0x0000,0x0000, +0x1339,0x0000,0x0000,0x0000, 0x133A,0x0000,0x0000,0x0000, +0x133B,0x0000,0x0000,0x0000, 0x133B,0x0000,0x0000,0x0000, +0x133C,0x0000,0x0000,0x0000, 0xFBC1,0xFB3D,0x0000,0x0000, +0x133D,0x0000,0x0000,0x0000, 0xFBC1,0xFB3F,0x0000,0x0000, +0x133E,0x0000,0x0000,0x0000, 0x133F,0x0000,0x0000,0x0000, +0xFBC1,0xFB42,0x0000,0x0000, 0x1341,0x0000,0x0000,0x0000, +0x1341,0x0000,0x0000,0x0000, 0xFBC1,0xFB45,0x0000,0x0000, +0x1342,0x0000,0x0000,0x0000, 0x1343,0x0000,0x0000,0x0000, +0x1344,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000, +0x1346,0x0000,0x0000,0x0000, 0x1336,0x0000,0x0000,0x0000, +0x1332,0x0000,0x0000,0x0000, 0x133B,0x0000,0x0000,0x0000, +0x1341,0x0000,0x0000,0x0000, 0x1331,0x133C,0x0000,0x0000, +0x134B,0x0000,0x0000,0x0000, 0x134B,0x0000,0x0000,0x0000, +0x1353,0x0000,0x0000,0x0000, 0x1353,0x0000,0x0000,0x0000, +0x1353,0x0000,0x0000,0x0000, 0x1353,0x0000,0x0000,0x0000, +0x1354,0x0000,0x0000,0x0000, 0x1354,0x0000,0x0000,0x0000, +0x1354,0x0000,0x0000,0x0000, 0x1354,0x0000,0x0000,0x0000, +0x1355,0x0000,0x0000,0x0000, 0x1355,0x0000,0x0000,0x0000, +0x1355,0x0000,0x0000,0x0000, 0x1355,0x0000,0x0000,0x0000, +0x135A,0x0000,0x0000,0x0000, 0x135A,0x0000,0x0000,0x0000, +0x135A,0x0000,0x0000,0x0000, 0x135A,0x0000,0x0000,0x0000, +0x135D,0x0000,0x0000,0x0000, 0x135D,0x0000,0x0000,0x0000, +0x135D,0x0000,0x0000,0x0000, 0x135D,0x0000,0x0000,0x0000, +0x1359,0x0000,0x0000,0x0000, 0x1359,0x0000,0x0000,0x0000, +0x1359,0x0000,0x0000,0x0000, 0x1359,0x0000,0x0000,0x0000, +0x1397,0x0000,0x0000,0x0000, 0x1397,0x0000,0x0000,0x0000, +0x1397,0x0000,0x0000,0x0000, 0x1397,0x0000,0x0000,0x0000, +0x1399,0x0000,0x0000,0x0000, 0x1399,0x0000,0x0000,0x0000, +0x1399,0x0000,0x0000,0x0000, 0x1399,0x0000,0x0000,0x0000, +0x1360,0x0000,0x0000,0x0000, 0x1360,0x0000,0x0000,0x0000, +0x1360,0x0000,0x0000,0x0000, 0x1360,0x0000,0x0000,0x0000, +0x135F,0x0000,0x0000,0x0000, 0x135F,0x0000,0x0000,0x0000, +0x135F,0x0000,0x0000,0x0000, 0x135F,0x0000,0x0000,0x0000, +0x1361,0x0000,0x0000,0x0000, 0x1361,0x0000,0x0000,0x0000, +0x1361,0x0000,0x0000,0x0000, 0x1361,0x0000,0x0000,0x0000, +0x1363,0x0000,0x0000,0x0000, 0x1363,0x0000,0x0000,0x0000, +0x1363,0x0000,0x0000,0x0000, 0x1363,0x0000,0x0000,0x0000, +0x1370,0x0000,0x0000,0x0000, 0x1370,0x0000,0x0000,0x0000, +0x136F,0x0000,0x0000,0x0000, 0x136F,0x0000,0x0000,0x0000, +0x1371,0x0000,0x0000,0x0000, 0x1371,0x0000,0x0000,0x0000, +0x136B,0x0000,0x0000,0x0000, 0x136B,0x0000,0x0000,0x0000, +0x137E,0x0000,0x0000,0x0000, 0x137E,0x0000,0x0000,0x0000, +0x1377,0x0000,0x0000,0x0000, 0x1377,0x0000,0x0000,0x0000, +0x139F,0x0000,0x0000,0x0000, 0x139F,0x0000,0x0000,0x0000, +0x139F,0x0000,0x0000,0x0000, 0x139F,0x0000,0x0000,0x0000, +0x13A5,0x0000,0x0000,0x0000, 0x13A5,0x0000,0x0000,0x0000, +0x13A5,0x0000,0x0000,0x0000, 0x13A5,0x0000,0x0000,0x0000, +0x13A9,0x0000,0x0000,0x0000, 0x13A9,0x0000,0x0000,0x0000, +0x13A9,0x0000,0x0000,0x0000, 0x13A9,0x0000,0x0000,0x0000, +0x13A7,0x0000,0x0000,0x0000, 0x13A7,0x0000,0x0000,0x0000, +0x13A7,0x0000,0x0000,0x0000, 0x13A7,0x0000,0x0000,0x0000, +0x13B2,0x0000,0x0000,0x0000, 0x13B2,0x0000,0x0000,0x0000, +0x13B3,0x0000,0x0000,0x0000, 0x13B3,0x0000,0x0000,0x0000, +0x13B3,0x0000,0x0000,0x0000, 0x13B3,0x0000,0x0000,0x0000, +0x13BC,0x0000,0x0000,0x0000, 0x13BC,0x0000,0x0000,0x0000, +0x13B9,0x0000,0x0000,0x0000, 0x13B9,0x0000,0x0000,0x0000, +0x13B9,0x0000,0x0000,0x0000, 0x13B9,0x0000,0x0000,0x0000, +0x13B8,0x0000,0x0000,0x0000, 0x13B8,0x0000,0x0000,0x0000, +0x13B8,0x0000,0x0000,0x0000, 0x13B8,0x0000,0x0000,0x0000, +0x13CE,0x0000,0x0000,0x0000, 0x13CE,0x0000,0x0000,0x0000, +0x13CE,0x0000,0x0000,0x0000, 0x13CE,0x0000,0x0000,0x0000, +0xFBC1,0xFBB2,0x0000,0x0000, 0xFBC1,0xFBB3,0x0000,0x0000, +0xFBC1,0xFBB4,0x0000,0x0000, 0xFBC1,0xFBB5,0x0000,0x0000, +0xFBC1,0xFBB6,0x0000,0x0000, 0xFBC1,0xFBB7,0x0000,0x0000, +0xFBC1,0xFBB8,0x0000,0x0000, 0xFBC1,0xFBB9,0x0000,0x0000, +0xFBC1,0xFBBA,0x0000,0x0000, 0xFBC1,0xFBBB,0x0000,0x0000, +0xFBC1,0xFBBC,0x0000,0x0000, 0xFBC1,0xFBBD,0x0000,0x0000, +0xFBC1,0xFBBE,0x0000,0x0000, 0xFBC1,0xFBBF,0x0000,0x0000, +0xFBC1,0xFBC0,0x0000,0x0000, 0xFBC1,0xFBC1,0x0000,0x0000, +0xFBC1,0xFBC2,0x0000,0x0000, 0xFBC1,0xFBC3,0x0000,0x0000, +0xFBC1,0xFBC4,0x0000,0x0000, 0xFBC1,0xFBC5,0x0000,0x0000, +0xFBC1,0xFBC6,0x0000,0x0000, 0xFBC1,0xFBC7,0x0000,0x0000, +0xFBC1,0xFBC8,0x0000,0x0000, 0xFBC1,0xFBC9,0x0000,0x0000, +0xFBC1,0xFBCA,0x0000,0x0000, 0xFBC1,0xFBCB,0x0000,0x0000, +0xFBC1,0xFBCC,0x0000,0x0000, 0xFBC1,0xFBCD,0x0000,0x0000, +0xFBC1,0xFBCE,0x0000,0x0000, 0xFBC1,0xFBCF,0x0000,0x0000, +0xFBC1,0xFBD0,0x0000,0x0000, 0xFBC1,0xFBD1,0x0000,0x0000, +0xFBC1,0xFBD2,0x0000,0x0000, 0x13A3,0x0000,0x0000,0x0000, +0x13A3,0x0000,0x0000,0x0000, 0x13A3,0x0000,0x0000,0x0000, +0x13A3,0x0000,0x0000,0x0000, 0x13C1,0x0000,0x0000,0x0000, +0x13C1,0x0000,0x0000,0x0000, 0x13C0,0x0000,0x0000,0x0000, +0x13C0,0x0000,0x0000,0x0000, 0x13C2,0x0000,0x0000,0x0000, +0x13C2,0x0000,0x0000,0x0000, 0x13C1,0x1347,0x0000,0x0000, +0x13C5,0x0000,0x0000,0x0000, 0x13C5,0x0000,0x0000,0x0000, +0x13BF,0x0000,0x0000,0x0000, 0x13BF,0x0000,0x0000,0x0000, +0x13C3,0x0000,0x0000,0x0000, 0x13C3,0x0000,0x0000,0x0000, +0x13CC,0x0000,0x0000,0x0000, 0x13CC,0x0000,0x0000,0x0000, +0x13CC,0x0000,0x0000,0x0000, 0x13CC,0x0000,0x0000,0x0000, +0x13C7,0x0000,0x0000,0x0000, 0x13C7,0x0000,0x0000,0x0000, +0x134F,0x1350,0x0000,0x0000, 0x134F,0x1350,0x0000,0x0000, +0x134F,0x13BC,0x0000,0x0000, 0x134F,0x13BC,0x0000,0x0000, +0x134F,0x13BD,0x0000,0x0000, 0x134F,0x13BD,0x0000,0x0000, +0x134F,0x13C1,0x0000,0x0000, 0x134F,0x13C1,0x0000,0x0000, +0x134F,0x13C0,0x0000,0x0000, 0x134F,0x13C0,0x0000,0x0000, +0x134F,0x13C2,0x0000,0x0000, 0x134F,0x13C2,0x0000,0x0000, +0x134F,0x13CC,0x0000,0x0000, 0x134F,0x13CC,0x0000,0x0000, +0x134F,0x13CC,0x0000,0x0000, 0x134F,0x13C7,0x0000,0x0000, +0x134F,0x13C7,0x0000,0x0000, 0x134F,0x13C7,0x0000,0x0000, +0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000, +0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000 +}; + +uint16 page0FCdata[]= { /* FC00 (3 weights per char) */ +0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000, 0x134F,0x13B0,0x0000, +0x134F,0x13C7,0x0000, 0x134F,0x13C8,0x0000, 0x1352,0x135E,0x0000, +0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000, 0x1352,0x13B0,0x0000, +0x1352,0x13C7,0x0000, 0x1352,0x13C8,0x0000, 0x1357,0x135E,0x0000, +0x1357,0x1364,0x0000, 0x1357,0x1365,0x0000, 0x1357,0x13B0,0x0000, +0x1357,0x13C7,0x0000, 0x1357,0x13C8,0x0000, 0x1358,0x135E,0x0000, +0x1358,0x13B0,0x0000, 0x1358,0x13C7,0x0000, 0x1358,0x13C8,0x0000, +0x135E,0x1364,0x0000, 0x135E,0x13B0,0x0000, 0x1364,0x135E,0x0000, +0x1364,0x13B0,0x0000, 0x1365,0x135E,0x0000, 0x1365,0x1364,0x0000, +0x1365,0x13B0,0x0000, 0x1381,0x135E,0x0000, 0x1381,0x1364,0x0000, +0x1381,0x1365,0x0000, 0x1381,0x13B0,0x0000, 0x1387,0x1364,0x0000, +0x1387,0x13B0,0x0000, 0x1388,0x135E,0x0000, 0x1388,0x1364,0x0000, +0x1388,0x1365,0x0000, 0x1388,0x13B0,0x0000, 0x138C,0x1364,0x0000, +0x138C,0x13B0,0x0000, 0x138D,0x13B0,0x0000, 0x138F,0x135E,0x0000, +0x138F,0x13B0,0x0000, 0x1390,0x135E,0x0000, 0x1390,0x13B0,0x0000, +0x1393,0x135E,0x0000, 0x1393,0x1364,0x0000, 0x1393,0x1365,0x0000, +0x1393,0x13B0,0x0000, 0x1393,0x13C7,0x0000, 0x1393,0x13C8,0x0000, +0x139B,0x1364,0x0000, 0x139B,0x13B0,0x0000, 0x139B,0x13C7,0x0000, +0x139B,0x13C8,0x0000, 0x139E,0x1350,0x0000, 0x139E,0x135E,0x0000, +0x139E,0x1364,0x0000, 0x139E,0x1365,0x0000, 0x139E,0x13AB,0x0000, +0x139E,0x13B0,0x0000, 0x139E,0x13C7,0x0000, 0x139E,0x13C8,0x0000, +0x13AB,0x135E,0x0000, 0x13AB,0x1364,0x0000, 0x13AB,0x1365,0x0000, +0x13AB,0x13B0,0x0000, 0x13AB,0x13C7,0x0000, 0x13AB,0x13C8,0x0000, +0x13B0,0x135E,0x0000, 0x13B0,0x1364,0x0000, 0x13B0,0x1365,0x0000, +0x13B0,0x13B0,0x0000, 0x13B0,0x13C7,0x0000, 0x13B0,0x13C8,0x0000, +0x13B1,0x135E,0x0000, 0x13B1,0x1364,0x0000, 0x13B1,0x1365,0x0000, +0x13B1,0x13B0,0x0000, 0x13B1,0x13C7,0x0000, 0x13B1,0x13C8,0x0000, +0x13B7,0x135E,0x0000, 0x13B7,0x13B0,0x0000, 0x13B7,0x13C7,0x0000, +0x13B7,0x13C8,0x0000, 0x13C8,0x135E,0x0000, 0x13C8,0x1364,0x0000, +0x13C8,0x1365,0x0000, 0x13C8,0x13B0,0x0000, 0x13C8,0x13C7,0x0000, +0x13C8,0x13C8,0x0000, 0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000, +0x13C7,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x134F,0x1375,0x0000, 0x134F,0x1376,0x0000, +0x134F,0x13B0,0x0000, 0x134F,0x13B1,0x0000, 0x134F,0x13C7,0x0000, +0x134F,0x13C8,0x0000, 0x1352,0x1375,0x0000, 0x1352,0x1376,0x0000, +0x1352,0x13B0,0x0000, 0x1352,0x13B1,0x0000, 0x1352,0x13C7,0x0000, +0x1352,0x13C8,0x0000, 0x1357,0x1375,0x0000, 0x1357,0x1376,0x0000, +0x1357,0x13B0,0x0000, 0x1357,0x13B1,0x0000, 0x1357,0x13C7,0x0000, +0x1357,0x13C8,0x0000, 0x1358,0x1375,0x0000, 0x1358,0x1376,0x0000, +0x1358,0x13B0,0x0000, 0x1358,0x13B1,0x0000, 0x1358,0x13C7,0x0000, +0x1358,0x13C8,0x0000, 0x1393,0x13C7,0x0000, 0x1393,0x13C8,0x0000, +0x139B,0x13C7,0x0000, 0x139B,0x13C8,0x0000, 0x139E,0x1350,0x0000, +0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000, 0x139E,0x13C7,0x0000, +0x139E,0x13C8,0x0000, 0x13AB,0x13B0,0x0000, 0x13AB,0x13C7,0x0000, +0x13AB,0x13C8,0x0000, 0x13B0,0x1350,0x0000, 0x13B0,0x13B0,0x0000, +0x13B1,0x1375,0x0000, 0x13B1,0x1376,0x0000, 0x13B1,0x13B0,0x0000, +0x13B1,0x13B1,0x0000, 0x13B1,0x13C7,0x0000, 0x13B1,0x13C8,0x0000, +0x13C7,0x0000,0x0000, 0x13C8,0x1375,0x0000, 0x13C8,0x1376,0x0000, +0x13C8,0x13B0,0x0000, 0x13C8,0x13B1,0x0000, 0x13C8,0x13C7,0x0000, +0x13C8,0x13C8,0x0000, 0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000, +0x134F,0x1365,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13B7,0x0000, +0x1352,0x135E,0x0000, 0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000, +0x1352,0x13B0,0x0000, 0x1352,0x13B7,0x0000, 0x1357,0x135E,0x0000, +0x1357,0x1364,0x0000, 0x1357,0x1365,0x0000, 0x1357,0x13B0,0x0000, +0x1357,0x13B7,0x0000, 0x1358,0x13B0,0x0000, 0x135E,0x1364,0x0000, +0x135E,0x13B0,0x0000, 0x1364,0x135E,0x0000, 0x1364,0x13B0,0x0000, +0x1365,0x135E,0x0000, 0x1365,0x13B0,0x0000, 0x1381,0x135E,0x0000, +0x1381,0x1364,0x0000, 0x1381,0x1365,0x0000, 0x1381,0x13B0,0x0000, +0x1387,0x1364,0x0000, 0x1387,0x1365,0x0000, 0x1387,0x13B0,0x0000, +0x1388,0x135E,0x0000, 0x1388,0x1364,0x0000, 0x1388,0x1365,0x0000, +0x1388,0x13B0,0x0000, 0x138C,0x1364,0x0000, 0x138D,0x13B0,0x0000, +0x138F,0x135E,0x0000, 0x138F,0x13B0,0x0000, 0x1390,0x135E,0x0000, +0x1390,0x13B0,0x0000, 0x1393,0x135E,0x0000, 0x1393,0x1364,0x0000, +0x1393,0x1365,0x0000, 0x1393,0x13B0,0x0000, 0x139B,0x1364,0x0000, +0x139B,0x13B0,0x0000, 0x139E,0x135E,0x0000, 0x139E,0x1364,0x0000, +0x139E,0x1365,0x0000, 0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000, +0x13AB,0x135E,0x0000, 0x13AB,0x1364,0x0000, 0x13AB,0x1365,0x0000, +0x13AB,0x13B0,0x0000, 0x13AB,0x13B7,0x0000, 0x13B0,0x135E,0x0000, +0x13B0,0x1364,0x0000, 0x13B0,0x1365,0x0000, 0x13B0,0x13B0,0x0000, +0x13B1,0x135E,0x0000, 0x13B1,0x1364,0x0000, 0x13B1,0x1365,0x0000, +0x13B1,0x13B0,0x0000, 0x13B1,0x13B7,0x0000, 0x13B7,0x135E,0x0000, +0x13B7,0x13B0,0x0000, 0x13B7,0x0000,0x0000, 0x13C8,0x135E,0x0000, +0x13C8,0x1364,0x0000, 0x13C8,0x1365,0x0000, 0x13C8,0x13B0,0x0000, +0x13C8,0x13B7,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13B7,0x0000, +0x1352,0x13B0,0x0000, 0x1352,0x13B7,0x0000, 0x1357,0x13B0,0x0000, +0x1357,0x13B7,0x0000, 0x1358,0x13B0,0x0000, 0x1358,0x13B7,0x0000, +0x1381,0x13B0,0x0000, 0x1381,0x13B7,0x0000, 0x1382,0x13B0,0x0000, +0x1382,0x13B7,0x0000, 0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000, +0x13AB,0x13B0,0x0000, 0x13B1,0x13B0,0x0000, 0x13B1,0x13B7,0x0000, +0x13C8,0x13B0,0x0000, 0x13C8,0x13B7,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x138C,0x13C7,0x0000, +0x138C,0x13C8,0x0000, 0x138F,0x13C7,0x0000, 0x138F,0x13C8,0x0000, +0x1390,0x13C7,0x0000, 0x1390,0x13C8,0x0000, 0x1381,0x13C7,0x0000, +0x1381,0x13C8,0x0000, 0x1382,0x13C7,0x0000, 0x1382,0x13C8,0x0000, +0x1364,0x13C7,0x0000 }; + +uint16 page0FDdata[]= { /* FD00 (9 weights per char) */ +0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1390,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1390,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138D,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1350,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1350,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x02C0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x02C1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD40,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD41,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD42,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD43,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD44,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD45,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD46,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD47,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD48,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD49,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD4B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD4C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD4D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD4E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD4F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1364,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1364,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x1364,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x1364,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138C,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1390,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1390,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1390,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1393,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1393,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139B,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139B,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x135E,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x135E,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1365,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD90,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFD91,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x135E,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B7,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B7,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13C8,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13C8,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1352,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1357,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1382,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1388,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13C8,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13C8,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13C8,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139B,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139B,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139E,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139E,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13AB,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1364,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1393,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1352,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139E,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1381,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B1,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDC8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDC9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDCA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDCB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDCC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDCD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDCE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDCF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDD9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDDA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDDB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDDC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDDD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDDE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDDF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDE9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDEB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDEC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDED,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDEE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDEF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13AB,0x13CE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x139B,0x13AB,0x13CE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1350,0x13AB,0x13AB,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1350,0x139E,0x1352,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13B0,0x1364,0x13B0,0x1369,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13AB,0x138F,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1375,0x1381,0x13BD,0x13AB,0x0000,0x0000,0x0000,0x0000,0x0000, +0x138F,0x13AB,0x13C8,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000, +0x13BD,0x1381,0x13AB,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000, +0x1387,0x13AB,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDFA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0x135E,0x13AB,0x0209,0x135E,0x13AB,0x1350,0x13AB,0x13B7,0x0000, +0x1375,0x13C9,0x1350,0x13AB,0x0000,0x0000,0x0000,0x0000,0x0000, +0x034F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDFE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, +0xFBC1,0xFDFF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + +uint16 page0FEdata[]= { /* FE00 (3 weights per char) */ +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0xFBC1,0xFE10,0x0000, 0xFBC1,0xFE11,0x0000, +0xFBC1,0xFE12,0x0000, 0xFBC1,0xFE13,0x0000, 0xFBC1,0xFE14,0x0000, +0xFBC1,0xFE15,0x0000, 0xFBC1,0xFE16,0x0000, 0xFBC1,0xFE17,0x0000, +0xFBC1,0xFE18,0x0000, 0xFBC1,0xFE19,0x0000, 0xFBC1,0xFE1A,0x0000, +0xFBC1,0xFE1B,0x0000, 0xFBC1,0xFE1C,0x0000, 0xFBC1,0xFE1D,0x0000, +0xFBC1,0xFE1E,0x0000, 0xFBC1,0xFE1F,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC1,0xFE24,0x0000, 0xFBC1,0xFE25,0x0000, 0xFBC1,0xFE26,0x0000, +0xFBC1,0xFE27,0x0000, 0xFBC1,0xFE28,0x0000, 0xFBC1,0xFE29,0x0000, +0xFBC1,0xFE2A,0x0000, 0xFBC1,0xFE2B,0x0000, 0xFBC1,0xFE2C,0x0000, +0xFBC1,0xFE2D,0x0000, 0xFBC1,0xFE2E,0x0000, 0xFBC1,0xFE2F,0x0000, +0x025D,0x025D,0x0000, 0x0228,0x0000,0x0000, 0x0227,0x0000,0x0000, +0x021B,0x0000,0x0000, 0x021B,0x0000,0x0000, 0x0288,0x0000,0x0000, +0x0289,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x028D,0x0000,0x0000, +0x02B8,0x0000,0x0000, 0x02B9,0x0000,0x0000, 0x02B6,0x0000,0x0000, +0x02B7,0x0000,0x0000, 0x02B0,0x0000,0x0000, 0x02B1,0x0000,0x0000, +0x02AE,0x0000,0x0000, 0x02AF,0x0000,0x0000, 0x02B2,0x0000,0x0000, +0x02B3,0x0000,0x0000, 0x02B4,0x0000,0x0000, 0x02B5,0x0000,0x0000, +0x0238,0x0000,0x0000, 0x0239,0x0000,0x0000, 0x028A,0x0000,0x0000, +0x028B,0x0000,0x0000, 0x0211,0x0000,0x0000, 0x0211,0x0000,0x0000, +0x0211,0x0000,0x0000, 0x0211,0x0000,0x0000, 0x021B,0x0000,0x0000, +0x021B,0x0000,0x0000, 0x021B,0x0000,0x0000, 0x022F,0x0000,0x0000, +0x0237,0x0000,0x0000, 0x025D,0x0000,0x0000, 0xFBC1,0xFE53,0x0000, +0x023A,0x0000,0x0000, 0x023D,0x0000,0x0000, 0x0255,0x0000,0x0000, +0x0251,0x0000,0x0000, 0x0228,0x0000,0x0000, 0x0288,0x0000,0x0000, +0x0289,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x028D,0x0000,0x0000, +0x02B8,0x0000,0x0000, 0x02B9,0x0000,0x0000, 0x02D2,0x0000,0x0000, +0x02CF,0x0000,0x0000, 0x02C8,0x0000,0x0000, 0x0428,0x0000,0x0000, +0x0221,0x0000,0x0000, 0x042C,0x0000,0x0000, 0x042E,0x0000,0x0000, +0x042D,0x0000,0x0000, 0xFBC1,0xFE67,0x0000, 0x02CE,0x0000,0x0000, +0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000, 0x02C7,0x0000,0x0000, +0xFBC1,0xFE6C,0x0000, 0xFBC1,0xFE6D,0x0000, 0xFBC1,0xFE6E,0x0000, +0xFBC1,0xFE6F,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0xFBC1,0xFE75,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x1347,0x0000,0x0000, +0x1348,0x0000,0x0000, 0x1348,0x0000,0x0000, 0x1349,0x0000,0x0000, +0x1349,0x0000,0x0000, 0x134C,0x0000,0x0000, 0x134C,0x0000,0x0000, +0x134D,0x0000,0x0000, 0x134D,0x0000,0x0000, 0x134F,0x0000,0x0000, +0x134F,0x0000,0x0000, 0x134F,0x0000,0x0000, 0x134F,0x0000,0x0000, +0x1350,0x0000,0x0000, 0x1350,0x0000,0x0000, 0x1352,0x0000,0x0000, +0x1352,0x0000,0x0000, 0x1352,0x0000,0x0000, 0x1352,0x0000,0x0000, +0x1356,0x0000,0x0000, 0x1356,0x0000,0x0000, 0x1357,0x0000,0x0000, +0x1357,0x0000,0x0000, 0x1357,0x0000,0x0000, 0x1357,0x0000,0x0000, +0x1358,0x0000,0x0000, 0x1358,0x0000,0x0000, 0x1358,0x0000,0x0000, +0x1358,0x0000,0x0000, 0x135E,0x0000,0x0000, 0x135E,0x0000,0x0000, +0x135E,0x0000,0x0000, 0x135E,0x0000,0x0000, 0x1364,0x0000,0x0000, +0x1364,0x0000,0x0000, 0x1364,0x0000,0x0000, 0x1364,0x0000,0x0000, +0x1365,0x0000,0x0000, 0x1365,0x0000,0x0000, 0x1365,0x0000,0x0000, +0x1365,0x0000,0x0000, 0x1369,0x0000,0x0000, 0x1369,0x0000,0x0000, +0x136A,0x0000,0x0000, 0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000, +0x1375,0x0000,0x0000, 0x1376,0x0000,0x0000, 0x1376,0x0000,0x0000, +0x1381,0x0000,0x0000, 0x1381,0x0000,0x0000, 0x1381,0x0000,0x0000, +0x1381,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1382,0x0000,0x0000, +0x1382,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1387,0x0000,0x0000, +0x1387,0x0000,0x0000, 0x1387,0x0000,0x0000, 0x1387,0x0000,0x0000, +0x1388,0x0000,0x0000, 0x1388,0x0000,0x0000, 0x1388,0x0000,0x0000, +0x1388,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138C,0x0000,0x0000, +0x138C,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138D,0x0000,0x0000, +0x138D,0x0000,0x0000, 0x138D,0x0000,0x0000, 0x138D,0x0000,0x0000, +0x138F,0x0000,0x0000, 0x138F,0x0000,0x0000, 0x138F,0x0000,0x0000, +0x138F,0x0000,0x0000, 0x1390,0x0000,0x0000, 0x1390,0x0000,0x0000, +0x1390,0x0000,0x0000, 0x1390,0x0000,0x0000, 0x1393,0x0000,0x0000, +0x1393,0x0000,0x0000, 0x1393,0x0000,0x0000, 0x1393,0x0000,0x0000, +0x139B,0x0000,0x0000, 0x139B,0x0000,0x0000, 0x139B,0x0000,0x0000, +0x139B,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x139E,0x0000,0x0000, +0x139E,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x13AB,0x0000,0x0000, +0x13AB,0x0000,0x0000, 0x13AB,0x0000,0x0000, 0x13AB,0x0000,0x0000, +0x13B0,0x0000,0x0000, 0x13B0,0x0000,0x0000, 0x13B0,0x0000,0x0000, +0x13B0,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B1,0x0000,0x0000, +0x13B1,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B7,0x0000,0x0000, +0x13B7,0x0000,0x0000, 0x13B7,0x0000,0x0000, 0x13B7,0x0000,0x0000, +0x13BD,0x0000,0x0000, 0x13BD,0x0000,0x0000, 0x13C7,0x0000,0x0000, +0x13C7,0x0000,0x0000, 0x13C8,0x0000,0x0000, 0x13C8,0x0000,0x0000, +0x13C8,0x0000,0x0000, 0x13C8,0x0000,0x0000, 0x13AB,0x1348,0x0000, +0x13AB,0x1348,0x0000, 0x13AB,0x1349,0x0000, 0x13AB,0x1349,0x0000, +0x13AB,0x134D,0x0000, 0x13AB,0x134D,0x0000, 0x13AB,0x1350,0x0000, +0x13AB,0x1350,0x0000, 0xFBC1,0xFEFD,0x0000, 0xFBC1,0xFEFE,0x0000, +0x0000,0x0000,0x0000 }; + +uint16 page0FFdata[]= { /* FF00 (3 weights per char) */ +0xFBC1,0xFF00,0x0000, 0x0251,0x0000,0x0000, 0x027E,0x0000,0x0000, +0x02D2,0x0000,0x0000, 0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000, +0x02CF,0x0000,0x0000, 0x0277,0x0000,0x0000, 0x0288,0x0000,0x0000, +0x0289,0x0000,0x0000, 0x02C8,0x0000,0x0000, 0x0428,0x0000,0x0000, +0x022F,0x0000,0x0000, 0x0221,0x0000,0x0000, 0x025D,0x0000,0x0000, +0x02CC,0x0000,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, +0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, +0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, +0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x023D,0x0000,0x0000, +0x023A,0x0000,0x0000, 0x042C,0x0000,0x0000, 0x042D,0x0000,0x0000, +0x042E,0x0000,0x0000, 0x0255,0x0000,0x0000, 0x02C7,0x0000,0x0000, +0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000, +0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EB9,0x0000,0x0000, +0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000, +0x0F10,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000, +0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, +0x0FA7,0x0000,0x0000, 0x0FB4,0x0000,0x0000, 0x0FC0,0x0000,0x0000, +0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, +0x1044,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x105A,0x0000,0x0000, +0x105E,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x028A,0x0000,0x0000, +0x02CE,0x0000,0x0000, 0x028B,0x0000,0x0000, 0x020F,0x0000,0x0000, +0x021B,0x0000,0x0000, 0x020C,0x0000,0x0000, 0x0E33,0x0000,0x0000, +0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000, +0x0E8B,0x0000,0x0000, 0x0EB9,0x0000,0x0000, 0x0EC1,0x0000,0x0000, +0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0F10,0x0000,0x0000, +0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F5B,0x0000,0x0000, +0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0FA7,0x0000,0x0000, +0x0FB4,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FEA,0x0000,0x0000, +0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000, +0x1051,0x0000,0x0000, 0x105A,0x0000,0x0000, 0x105E,0x0000,0x0000, +0x106A,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x0430,0x0000,0x0000, +0x028D,0x0000,0x0000, 0x0433,0x0000,0x0000, 0x029A,0x0000,0x0000, +0x029B,0x0000,0x0000, 0x0266,0x0000,0x0000, 0x02B2,0x0000,0x0000, +0x02B3,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x022E,0x0000,0x0000, +0x1E80,0x0000,0x0000, 0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, +0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, +0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E77,0x0000,0x0000, +0x1E63,0x0000,0x0000, 0x0E0B,0x0000,0x0000, 0x1E52,0x0000,0x0000, +0x1E53,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000, +0x1E56,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000, +0x1E59,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000, +0x1E5C,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000, +0x1E5F,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000, +0x1E62,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E64,0x0000,0x0000, +0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000, +0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000, +0x1E6B,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6D,0x0000,0x0000, +0x1E6E,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E70,0x0000,0x0000, +0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000, 0x1E73,0x0000,0x0000, +0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, +0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000, 0x1E79,0x0000,0x0000, +0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, 0x1E7C,0x0000,0x0000, +0x1E7D,0x0000,0x0000, 0x1E81,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0000,0x0000,0x0000, 0x1DBD,0x0000,0x0000, 0x1D62,0x0000,0x0000, +0x1D63,0x0000,0x0000, 0x1E02,0x0000,0x0000, 0x1D64,0x0000,0x0000, +0x1E04,0x0000,0x0000, 0x1E05,0x0000,0x0000, 0x1D65,0x0000,0x0000, +0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000, 0x1E08,0x0000,0x0000, +0x1E09,0x0000,0x0000, 0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000, +0x1E0C,0x0000,0x0000, 0x1E0D,0x0000,0x0000, 0x1D7C,0x0000,0x0000, +0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000, +0x1D83,0x0000,0x0000, 0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, +0x1D6D,0x0000,0x0000, 0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, +0x1D70,0x0000,0x0000, 0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, +0x1D73,0x0000,0x0000, 0x1D74,0x0000,0x0000, 0xFBC1,0xFFBF,0x0000, +0xFBC1,0xFFC0,0x0000, 0xFBC1,0xFFC1,0x0000, 0x1DBE,0x0000,0x0000, +0x1DBF,0x0000,0x0000, 0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, +0x1DC2,0x0000,0x0000, 0x1DC3,0x0000,0x0000, 0xFBC1,0xFFC8,0x0000, +0xFBC1,0xFFC9,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000, +0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000, +0x1DC9,0x0000,0x0000, 0xFBC1,0xFFD0,0x0000, 0xFBC1,0xFFD1,0x0000, +0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000, 0x1DCC,0x0000,0x0000, +0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000, 0x1DCF,0x0000,0x0000, +0xFBC1,0xFFD8,0x0000, 0xFBC1,0xFFD9,0x0000, 0x1DD0,0x0000,0x0000, +0x1DD1,0x0000,0x0000, 0x1DD2,0x0000,0x0000, 0xFBC1,0xFFDD,0x0000, +0xFBC1,0xFFDE,0x0000, 0xFBC1,0xFFDF,0x0000, 0x0E0E,0x0000,0x0000, +0x0E10,0x0000,0x0000, 0x042F,0x0000,0x0000, 0x0210,0x0000,0x0000, +0x0431,0x0000,0x0000, 0x0E11,0x0000,0x0000, 0x0E20,0x0000,0x0000, +0xFBC1,0xFFE7,0x0000, 0x05FE,0x0000,0x0000, 0x03AE,0x0000,0x0000, +0x03B0,0x0000,0x0000, 0x03AF,0x0000,0x0000, 0x03B1,0x0000,0x0000, +0x069C,0x0000,0x0000, 0x06C7,0x0000,0x0000, 0xFBC1,0xFFEF,0x0000, +0xFBC1,0xFFF0,0x0000, 0xFBC1,0xFFF1,0x0000, 0xFBC1,0xFFF2,0x0000, +0xFBC1,0xFFF3,0x0000, 0xFBC1,0xFFF4,0x0000, 0xFBC1,0xFFF5,0x0000, +0xFBC1,0xFFF6,0x0000, 0xFBC1,0xFFF7,0x0000, 0xFBC1,0xFFF8,0x0000, +0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, +0x0DC5,0x0000,0x0000, 0x0DC6,0x0000,0x0000, 0xFBC1,0xFFFE,0x0000, +0xFBC1,0xFFFF,0x0000 }; + +uchar uca_length[256]={ +4,3,3,4,3,3,3,3,0,3,3,3,3,3,3,3, +3,3,3,3,3,2,3,3,3,3,0,0,0,3,3,3, +5,5,4,3,5,2,3,3,2,2,5,3,0,0,3,3, +3,3,8,9,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,3,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3 +}; +uint16 *uca_weight[256]={ +page000data,page001data,page002data,page003data, +page004data,page005data,page006data,page007data, +NULL ,page009data,page00Adata,page00Bdata, +page00Cdata,page00Ddata,page00Edata,page00Fdata, +page010data,page011data,page012data,page013data, +page014data,page015data,page016data,page017data, +page018data,page019data,NULL ,NULL , +NULL ,page01Ddata,page01Edata,page01Fdata, +page020data,page021data,page022data,page023data, +page024data,page025data,page026data,page027data, +page028data,page029data,page02Adata,page02Bdata, +NULL ,NULL ,page02Edata,page02Fdata, +page030data,page031data,page032data,page033data, +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,page04Ddata,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +page0A0data,page0A1data,page0A2data,page0A3data, +page0A4data,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,NULL , +NULL ,page0F9data,page0FAdata,page0FBdata, +page0FCdata,page0FDdata,page0FEdata,page0FFdata +}; + +/* + Some sources treat LETTER A WITH DIARESIS (00E4,00C4) + secondary greater than LETTER AE (00E6,00C6). + http://www.evertype.com/alphabets/icelandic.pdf + http://developer.mimer.com/collations/charts/icelandic.htm + + Other sources do not provide any special rules + for LETTER A WITH DIARESIS: + http://www.omniglot.com/writing/icelandic.htm + http://en.wikipedia.org/wiki/Icelandic_alphabet + http://oss.software.ibm.com/icu/charts/collation/is.html + + Let's go the first way. +*/ + +static const char icelandic[]= + "& A < \\u00E1 <<< \\u00C1 " + "& D < \\u00F0 <<< \\u00D0 " + "& E < \\u00E9 <<< \\u00C9 " + "& I < \\u00ED <<< \\u00CD " + "& O < \\u00F3 <<< \\u00D3 " + "& U < \\u00FA <<< \\u00DA " + "& Y < \\u00FD <<< \\u00DD " + "& Z < \\u00FE <<< \\u00DE " + "< \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4 " + "< \\u00F6 <<< \\u00D6 << \\u00F8 <<< \\u00D8 " + "< \\u00E5 <<< \\u00C5 "; + +/* + Some sources treat I and Y primary different. + Other sources treat I and Y the same on primary level. + We'll go the first way. +*/ + +static const char latvian[]= + "& C < \\u010D <<< \\u010C " + "& G < \\u0123 <<< \\u0122 " + "& I < \\u0079 <<< \\u0059 " + "& K < \\u0137 <<< \\u0136 " + "& L < \\u013C <<< \\u013B " + "& N < \\u0146 <<< \\u0145 " + "& R < \\u0157 <<< \\u0156 " + "& S < \\u0161 <<< \\u0160 " + "& Z < \\u017E <<< \\u017D "; + + +static const char romanian[]= + "& A < \\u0103 <<< \\u0102 < \\u00E2 <<< \\u00C2 " + "& I < \\u00EE <<< \\u00CE " + "& S < \\u0219 <<< \\u0218 << \\u015F <<< \\u015E " + "& T < \\u021B <<< \\u021A << \\u0163 <<< \\u0162 "; + +static const char slovenian[]= + "& C < \\u010D <<< \\u010C " + "& S < \\u0161 <<< \\u0160 " + "& Z < \\u017E <<< \\u017D "; + + +static const char polish[]= + "& A < \\u0105 <<< \\u0104 " + "& C < \\u0107 <<< \\u0106 " + "& E < \\u0119 <<< \\u0118 " + "& L < \\u0142 <<< \\u0141 " + "& N < \\u0144 <<< \\u0143 " + "& O < \\u00F3 <<< \\u00D3 " + "& S < \\u015B <<< \\u015A " + "& Z < \\u017A <<< \\u0179 < \\u017C <<< \\u017B"; + +static const char estonian[]= + "& S < \\u0161 <<< \\u0160 " + " < \\u007A <<< \\u005A " + " < \\u017E <<< \\u017D " + "& W < \\u00F5 <<< \\u00D5 " + "< \\u00E4 <<< \\u00C4 " + "< \\u00F6 <<< \\u00D6 " + "< \\u00FC <<< \\u00DC "; + +static const char spanish[]= "& N < \\u00F1 <<< \\u00D1 "; + +/* + Some sources treat V and W as similar on primary level. + We'll treat V and W as different on primary level. +*/ + +static const char swedish[]= + "& Y <<\\u00FC <<< \\u00DC " + "& Z < \\u00E5 <<< \\u00C5 " + "< \\u00E4 <<< \\u00C4 << \\u00E6 <<< \\u00C6 " + "< \\u00F6 <<< \\u00D6 << \\u00F8 <<< \\u00D8 "; + +static const char turkish[]= + "& C < \\u00E7 <<< \\u00C7 " + "& G < \\u011F <<< \\u011E " + "& H < \\u0131 <<< \\u0049 " + "& O < \\u00F6 <<< \\u00D6 " + "& S < \\u015F <<< \\u015E " + "& U < \\u00FC <<< \\u00DC "; + + +static const char czech[]= + "& C < \\u010D <<< \\u010C " + "& H < ch <<< Ch <<< CH" + "& R < \\u0159 <<< \\u0158" + "& S < \\u0161 <<< \\u0160" + "& Z < \\u017E <<< \\u017D"; + +static const char danish[]= /* Also good for Norwegian */ + "& Y << \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170" + "& Z < \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4" + " < \\u00F8 <<< \\u00D8 << \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150" + " < \\u00E5 <<< \\u00C5 << aa <<< Aa <<< AA"; + +static const char lithuanian[]= + "& C << ch <<< Ch <<< CH< \\u010D <<< \\u010C" + "& E << \\u0119 <<< \\u0118 << \\u0117 <<< \\u0116" + "& I << y <<< Y" + "& S < \\u0161 <<< \\u0160" + "& Z < \\u017E <<< \\u017D"; + +static const char slovak[]= + "& A < \\u00E4 <<< \\u00C4" + "& C < \\u010D <<< \\u010C" + "& H < ch <<< Ch <<< CH" + "& O < \\u00F4 <<< \\u00D4" + "& S < \\u0161 <<< \\u0160" + "& Z < \\u017E <<< \\u017D"; + +static const char spanish2[]= /* Also good for Asturian and Galician */ + "&C < ch <<< Ch <<< CH" + "&L < ll <<< Ll <<< LL" + "&N < \\u00F1 <<< \\u00D1"; + +static const char roman[]= /* i.e. Classical Latin */ + "& I << j <<< J " + "& V << u <<< U "; + +/* + Persian collation support was provided by + Jody McIntyre + + To: internals@lists.mysql.com + Subject: Persian UTF8 collation support + Date: 17.08.2004 + + Contraction is not implemented. Some implementations do perform + contraction but others do not, and it is able to sort all my test + strings correctly. + + Jody. +*/ +static const char persian[]= + "& \\u066D < \\u064E < \\uFE76 < \\uFE77 < \\u0650 < \\uFE7A < \\uFE7B" + " < \\u064F < \\uFE78 < \\uFE79 < \\u064B < \\uFE70 < \\uFE71" + " < \\u064D < \\uFE74 < \\u064C < \\uFE72" + "& \\uFE7F < \\u0653 < \\u0654 < \\u0655 < \\u0670" + "& \\u0669 < \\u0622 < \\u0627 < \\u0671 < \\u0621 < \\u0623 < \\u0625" + " < \\u0624 < \\u0626" + "& \\u0642 < \\u06A9 < \\u0643" + "& \\u0648 < \\u0647 < \\u0629 < \\u06C0 < \\u06CC < \\u0649 < \\u064A" + "& \\uFE80 < \\uFE81 < \\uFE82 < \\uFE8D < \\uFE8E < \\uFB50 < \\uFB51" + " < \\uFE80 < \\uFE83 < \\uFE84 < \\uFE87 < \\uFE88 < \\uFE85" + " < \\uFE86 < \\u0689 < \\u068A" + "& \\uFEAE < \\uFDFC" + "& \\uFED8 < \\uFB8E < \\uFB8F < \\uFB90 < \\uFB91 < \\uFED9 < \\uFEDA" + " < \\uFEDB < \\uFEDC" + "& \\uFEEE < \\uFEE9 < \\uFEEA < \\uFEEB < \\uFEEC < \\uFE93 < \\uFE94" + " < \\uFBA4 < \\uFBA5 < \\uFBFC < \\uFBFD < \\uFBFE < \\uFBFF" + " < \\uFEEF < \\uFEF0 < \\uFEF1 < \\uFEF2 < \\uFEF3 < \\uFEF4" + " < \\uFEF5 < \\uFEF6 < \\uFEF7 < \\uFEF8 < \\uFEF9 < \\uFEFA" + " < \\uFEFB < \\uFEFC"; + +/* + Esperanto tailoring. + Contributed by Bertilo Wennergren + September 1, 2005 +*/ +static const char esperanto[]= + "& C < \\u0109 <<< \\u0108" + "& G < \\u011D <<< \\u011C" + "& H < \\u0125 <<< \\u0124" + "& J < \\u0135 <<< \\u0134" + "& S < \\u015d <<< \\u015c" + "& U < \\u016d <<< \\u016c"; + +/* + A simplified version of Hungarian, without consonant contractions. +*/ +static const char hungarian[]= + "&O < \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150" + "&U < \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170"; + +/* + SCCII Part 1 : Collation Sequence (SLS1134) + 2006/11/24 + Harshula Jayasuriya + Language Technology Research Lab, University of Colombo / ICTA +*/ +#if 0 +static const char sinhala[]= + "& \\u0D96 < \\u0D82 < \\u0D83" + "& \\u0DA5 < \\u0DA4" + "& \\u0DD8 < \\u0DF2 < \\u0DDF < \\u0DF3" + "& \\u0DDE < \\u0DCA"; +#else +static const char sinhala[]= + "& \\u0D96 < \\u0D82 < \\u0D83 < \\u0D9A < \\u0D9B < \\u0D9C < \\u0D9D" + "< \\u0D9E < \\u0D9F < \\u0DA0 < \\u0DA1 < \\u0DA2 < \\u0DA3" + "< \\u0DA5 < \\u0DA4 < \\u0DA6" + "< \\u0DA7 < \\u0DA8 < \\u0DA9 < \\u0DAA < \\u0DAB < \\u0DAC" + "< \\u0DAD < \\u0DAE < \\u0DAF < \\u0DB0 < \\u0DB1" + "< \\u0DB3 < \\u0DB4 < \\u0DB5 < \\u0DB6 < \\u0DB7 < \\u0DB8" + "< \\u0DB9 < \\u0DBA < \\u0DBB < \\u0DBD < \\u0DC0 < \\u0DC1" + "< \\u0DC2 < \\u0DC3 < \\u0DC4 < \\u0DC5 < \\u0DC6" + "< \\u0DCF" + "< \\u0DD0 < \\u0DD1 < \\u0DD2 < \\u0DD3 < \\u0DD4 < \\u0DD6" + "< \\u0DD8 < \\u0DF2 < \\u0DDF < \\u0DF3 < \\u0DD9 < \\u0DDA" + "< \\u0DDB < \\u0DDC < \\u0DDD < \\u0DDE < \\u0DCA"; +#endif + + +/* + Unicode Collation Algorithm: + Collation element (weight) scanner, + for consequent scan of collations + weights from a string. +*/ +typedef struct my_uca_scanner_st +{ + const uint16 *wbeg; /* Beginning of the current weight string */ + const uchar *sbeg; /* Beginning of the input string */ + const uchar *send; /* End of the input string */ + uchar *uca_length; + uint16 **uca_weight; + uint16 *contractions; + uint16 implicit[2]; + int page; + int code; + CHARSET_INFO *cs; +} my_uca_scanner; + +/* + Charset dependent scanner part, to optimize + some character sets. +*/ +typedef struct my_uca_scanner_handler_st +{ + void (*init)(my_uca_scanner *scanner, CHARSET_INFO *cs, + const uchar *str, size_t length); + int (*next)(my_uca_scanner *scanner); +} my_uca_scanner_handler; + +static uint16 nochar[]= {0,0}; + + +#ifdef HAVE_CHARSET_ucs2 +/* + Initialize collation weight scanner + + SYNOPSIS: + my_uca_scanner_init() + scanner Pointer to an initialized scanner structure + cs Character set + collation information + str Beginning of the string + length Length of the string. + + NOTES: + Optimized for UCS2 + + RETURN + N/A +*/ + +static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, + CHARSET_INFO *cs __attribute__((unused)), + const uchar *str, size_t length) +{ + scanner->wbeg= nochar; + if (length) + { + scanner->sbeg= str; + scanner->send= str + length - 2; + scanner->uca_length= cs->sort_order; + scanner->uca_weight= cs->sort_order_big; + scanner->contractions= cs->contractions; + return; + } + + /* + Sometimes this function is called with + str=NULL and length=0, which should be + considered as an empty string. + + The above initialization is unsafe for such cases, + because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE. + Then we fall into an endless loop in my_uca_scanner_next_ucs2(). + + Do special initialization for the case when length=0. + Initialize scanner->sbeg to an address greater than scanner->send. + Next call of my_uca_scanner_next_ucs2() will correctly return with -1. + */ + scanner->sbeg= (uchar*) &nochar[1]; + scanner->send= (uchar*) &nochar[0]; +} + + +/* + Read next collation element (weight), i.e. converts + a stream of characters into a stream of their weights. + + SYNOPSIS: + my_uca_scanner_next() + scanner Address of a previously initialized scanner strucuture + + NOTES: + Optimized for UCS2 + + Checks if the current character's weight string has been fully scanned, + if no, then returns the next weight for this character, + else scans the next character and returns its first weight. + + Each character can have number weights from 0 to 8. + + Some characters do not have weights at all, 0 weights. + It means they are ignored during comparison. + + Examples: + 1. 0x0001 START OF HEADING, has no weights, ignored, does + not produce any weights. + 2. 0x0061 LATIN SMALL LETTER A, has one weight. + 0x0E33 will be returned + 3. 0x00DF LATIN SMALL LETTER SHARP S, aka SZ ligature, + has two weights. It will return 0x0FEA twice for two + consequent calls. + 4. 0x247D PATENTHESIZED NUMBER TEN, has four weights, + this function will return these numbers in four + consequent calls: 0x0288, 0x0E2A, 0x0E29, 0x0289 + 5. A string consisting of the above characters: + 0x0001 0x0061 0x00DF 0x247D + will return the following weights, one weight per call: + 0x0E33 0x0FEA 0x0FEA 0x0288, 0x0E2A, 0x0E29, 0x0289 + + RETURN + Next weight, a number between 0x0000 and 0xFFFF + Or -1 on error (END-OF-STRING or ILLEGAL MULTIBYTE SEQUENCE) +*/ + +static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner) +{ + + /* + Check if the weights for the previous character have been + already fully scanned. If yes, then get the next character and + initialize wbeg and wlength to its weight string. + */ + + if (scanner->wbeg[0]) + return *scanner->wbeg++; + + do + { + uint16 **ucaw= scanner->uca_weight; + uchar *ucal= scanner->uca_length; + + if (scanner->sbeg > scanner->send) + return -1; + + scanner->page= (uchar)scanner->sbeg[0]; + scanner->code= (uchar)scanner->sbeg[1]; + scanner->sbeg+= 2; + + if (scanner->contractions && (scanner->sbeg <= scanner->send)) + { + int cweight; + + if (!scanner->page && !scanner->sbeg[0] && + (scanner->sbeg[1] > 0x40) && (scanner->sbeg[1] < 0x80) && + (scanner->code > 0x40) && (scanner->code < 0x80) && + (cweight= scanner->contractions[(scanner->code-0x40)*0x40+scanner->sbeg[1]-0x40])) + { + scanner->implicit[0]= 0; + scanner->wbeg= scanner->implicit; + scanner->sbeg+=2; + return cweight; + } + } + + if (!ucaw[scanner->page]) + goto implicit; + scanner->wbeg= ucaw[scanner->page] + scanner->code * ucal[scanner->page]; + } while (!scanner->wbeg[0]); + + return *scanner->wbeg++; + +implicit: + + scanner->code= (scanner->page << 8) + scanner->code; + scanner->implicit[0]= (scanner->code & 0x7FFF) | 0x8000; + scanner->implicit[1]= 0; + scanner->wbeg= scanner->implicit; + + scanner->page= scanner->page >> 7; + + if (scanner->code >= 0x3400 && scanner->code <= 0x4DB5) + scanner->page+= 0xFB80; + else if (scanner->code >= 0x4E00 && scanner->code <= 0x9FA5) + scanner->page+= 0xFB40; + else + scanner->page+= 0xFBC0; + + return scanner->page; +} + +static my_uca_scanner_handler my_ucs2_uca_scanner_handler= +{ + my_uca_scanner_init_ucs2, + my_uca_scanner_next_ucs2 +}; + +#endif + + +/* + The same two functions for any character set +*/ +static void my_uca_scanner_init_any(my_uca_scanner *scanner, + CHARSET_INFO *cs __attribute__((unused)), + const uchar *str, size_t length) +{ + /* Note, no needs to initialize scanner->wbeg */ + scanner->sbeg= str; + scanner->send= str + length; + scanner->wbeg= nochar; + scanner->uca_length= cs->sort_order; + scanner->uca_weight= cs->sort_order_big; + scanner->contractions= cs->contractions; + scanner->cs= cs; +} + +static int my_uca_scanner_next_any(my_uca_scanner *scanner) +{ + + /* + Check if the weights for the previous character have been + already fully scanned. If yes, then get the next character and + initialize wbeg and wlength to its weight string. + */ + + if (scanner->wbeg[0]) + return *scanner->wbeg++; + + do + { + uint16 **ucaw= scanner->uca_weight; + uchar *ucal= scanner->uca_length; + my_wc_t wc; + int mb_len; + + if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc, + scanner->sbeg, + scanner->send)) <= 0)) + return -1; + + scanner->sbeg+= mb_len; + if (wc > 0xFFFF) + { + /* Return 0xFFFD as weight for all characters outside BMP */ + scanner->wbeg= nochar; + return 0xFFFD; + } + else + { + scanner->page= wc >> 8; + scanner->code= wc & 0xFF; + } + + if (scanner->contractions && !scanner->page && + (scanner->code > 0x40) && (scanner->code < 0x80)) + { + uint page1, code1, cweight; + + if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc, + scanner->sbeg, + scanner->send)) >=0) && + (!(page1= (wc >> 8))) && + ((code1= (wc & 0xFF)) > 0x40) && + (code1 < 0x80) && + (cweight= scanner->contractions[(scanner->code-0x40)*0x40 + code1-0x40])) + { + scanner->implicit[0]= 0; + scanner->wbeg= scanner->implicit; + scanner->sbeg+= mb_len; + return cweight; + } + } + + if (!ucaw[scanner->page]) + goto implicit; + scanner->wbeg= ucaw[scanner->page] + scanner->code * ucal[scanner->page]; + } while (!scanner->wbeg[0]); + + return *scanner->wbeg++; + +implicit: + + scanner->code= (scanner->page << 8) + scanner->code; + scanner->implicit[0]= (scanner->code & 0x7FFF) | 0x8000; + scanner->implicit[1]= 0; + scanner->wbeg= scanner->implicit; + + scanner->page= scanner->page >> 7; + + if (scanner->code >= 0x3400 && scanner->code <= 0x4DB5) + scanner->page+= 0xFB80; + else if (scanner->code >= 0x4E00 && scanner->code <= 0x9FA5) + scanner->page+= 0xFB40; + else + scanner->page+= 0xFBC0; + + return scanner->page; +} + + +static my_uca_scanner_handler my_any_uca_scanner_handler= +{ + my_uca_scanner_init_any, + my_uca_scanner_next_any +}; + +/* + Compares two strings according to the collation + + SYNOPSIS: + my_strnncoll_uca() + cs Character set information + s First string + slen First string length + t Second string + tlen Seconf string length + + NOTES: + Initializes two weight scanners and gets weights + corresponding to two strings in a loop. If weights are not + the same at some step then returns their difference. + + In the while() comparison these situations are possible: + 1. (s_res>0) and (t_res>0) and (s_res == t_res) + Weights are the same so far, continue comparison + 2. (s_res>0) and (t_res>0) and (s_res!=t_res) + A difference has been found, return. + 3. (s_res>0) and (t_res<0) + We have reached the end of the second string, or found + an illegal multibyte sequence in the second string. + Return a positive number, i.e. the first string is bigger. + 4. (s_res<0) and (t_res>0) + We have reached the end of the first string, or found + an illegal multibyte sequence in the first string. + Return a negative number, i.e. the second string is bigger. + 5. (s_res<0) and (t_res<0) + Both scanners returned -1. It means we have riched + the end-of-string of illegal-sequence in both strings + at the same time. Return 0, strings are equal. + + RETURN + Difference between two strings, according to the collation: + 0 - means strings are equal + negative number - means the first string is smaller + positive number - means the first string is bigger +*/ + +static int my_strnncoll_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + my_uca_scanner sscanner; + my_uca_scanner tscanner; + int s_res; + int t_res; + + scanner_handler->init(&sscanner, cs, s, slen); + scanner_handler->init(&tscanner, cs, t, tlen); + + do + { + s_res= scanner_handler->next(&sscanner); + t_res= scanner_handler->next(&tscanner); + } while ( s_res == t_res && s_res >0); + + return (t_is_prefix && t_res < 0) ? 0 : (s_res - t_res); +} + +/* + Compares two strings according to the collation, + ignoring trailing spaces. + + SYNOPSIS: + my_strnncollsp_uca() + cs Character set information + s First string + slen First string length + t Second string + tlen Seconf string length + diff_if_only_endspace_difference + Set to 1 if the strings should be regarded as different + if they only difference in end space + + NOTES: + Works exactly the same with my_strnncoll_uca(), + but ignores trailing spaces. + + In the while() comparison these situations are possible: + 1. (s_res>0) and (t_res>0) and (s_res == t_res) + Weights are the same so far, continue comparison + 2. (s_res>0) and (t_res>0) and (s_res!=t_res) + A difference has been found, return. + 3. (s_res>0) and (t_res<0) + We have reached the end of the second string, or found + an illegal multibyte sequence in the second string. + Compare the first string to an infinite array of + space characters until difference is found, or until + the end of the first string. + 4. (s_res<0) and (t_res>0) + We have reached the end of the first string, or found + an illegal multibyte sequence in the first string. + Compare the second string to an infinite array of + space characters until difference is found or until + the end of the second steing. + 5. (s_res<0) and (t_res<0) + Both scanners returned -1. It means we have riched + the end-of-string of illegal-sequence in both strings + at the same time. Return 0, strings are equal. + + RETURN + Difference between two strings, according to the collation: + 0 - means strings are equal + negative number - means the first string is smaller + positive number - means the first string is bigger +*/ + +static int my_strnncollsp_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + my_uca_scanner sscanner, tscanner; + int s_res, t_res; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= 0; +#endif + + scanner_handler->init(&sscanner, cs, s, slen); + scanner_handler->init(&tscanner, cs, t, tlen); + + do + { + s_res= scanner_handler->next(&sscanner); + t_res= scanner_handler->next(&tscanner); + } while ( s_res == t_res && s_res >0); + + if (s_res > 0 && t_res < 0) + { + /* Calculate weight for SPACE character */ + t_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]]; + + /* compare the first string to spaces */ + do + { + if (s_res != t_res) + return (s_res - t_res); + s_res= scanner_handler->next(&sscanner); + } while (s_res > 0); + return diff_if_only_endspace_difference ? 1 : 0; + } + + if (s_res < 0 && t_res > 0) + { + /* Calculate weight for SPACE character */ + s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]]; + + /* compare the second string to spaces */ + do + { + if (s_res != t_res) + return (s_res - t_res); + t_res= scanner_handler->next(&tscanner); + } while (t_res > 0); + return diff_if_only_endspace_difference ? -1 : 0; + } + + return ( s_res - t_res ); +} + +/* + Calculates hash value for the given string, + according to the collation, and ignoring trailing spaces. + + SYNOPSIS: + my_hash_sort_uca() + cs Character set information + s String + slen String's length + n1 First hash parameter + n2 Second hash parameter + + NOTES: + Scans consequently weights and updates + hash parameters n1 and n2. In a case insensitive collation, + upper and lower case of the same letter will return the same + weight sequence, and thus will produce the same hash values + in n1 and n2. + + RETURN + N/A +*/ + +static void my_hash_sort_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + int s_res; + my_uca_scanner scanner; + + slen= cs->cset->lengthsp(cs, (char*) s, slen); + scanner_handler->init(&scanner, cs, s, slen); + + while ((s_res= scanner_handler->next(&scanner)) >0) + { + n1[0]^= (((n1[0] & 63)+n2[0])*(s_res >> 8))+ (n1[0] << 8); + n2[0]+=3; + n1[0]^= (((n1[0] & 63)+n2[0])*(s_res & 0xFF))+ (n1[0] << 8); + n2[0]+=3; + } +} + + +/* + For the given string creates its "binary image", suitable + to be used in binary comparison, i.e. in memcmp(). + + SYNOPSIS: + my_strnxfrm_uca() + cs Character set information + dst Where to write the image + dstlen Space available for the image, in bytes + src The source string + srclen Length of the source string, in bytes + + NOTES: + In a loop, scans weights from the source string and writes + them into the binary image. In a case insensitive collation, + upper and lower cases of the same letter will produce the + same image subsequences. When we have reached the end-of-string + or found an illegal multibyte sequence, the loop stops. + + It is impossible to restore the original string using its + binary image. + + Binary images are used for bulk comparison purposes, + e.g. in ORDER BY, when it is more efficient to create + a binary image and use it instead of weight scanner + for the original strings for every comparison. + + RETURN + Number of bytes that have been written into the binary image. +*/ + +static size_t my_strnxfrm_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + uchar *d0= dst; + uchar *de= dst + dstlen; + int s_res; + my_uca_scanner scanner; + scanner_handler->init(&scanner, cs, src, srclen); + + for (; dst < de && nweights && + (s_res= scanner_handler->next(&scanner)) > 0 ; nweights--) + { + *dst++= s_res >> 8; + if (dst < de) + *dst++= s_res & 0xFF; + } + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint space_count= min((uint) (de - dst) / 2, nweights); + s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]]; + for (; space_count ; space_count--) + { + *dst++= s_res >> 8; + *dst++= s_res & 0xFF; + } + } + my_strxfrm_desc_and_reverse(d0, dst, flags, 0); + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + { + s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]]; + for ( ; dst < de; ) + { + *dst++= s_res >> 8; + if (dst < de) + *dst++= s_res & 0xFF; + } + } + return dst - d0; +} + + + +/* + This function compares if two characters are the same. + The sign +1 or -1 does not matter. The only + important thing is that the result is 0 or not 0. + This fact allows us to use memcmp() safely, on both + little-endian and big-endian machines. +*/ + +static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +{ + size_t page1= wc1 >> MY_UCA_PSHIFT; + size_t page2= wc2 >> MY_UCA_PSHIFT; + uchar *ucal= cs->sort_order; + uint16 **ucaw= cs->sort_order_big; + size_t length1= ucal[page1]; + size_t length2= ucal[page2]; + uint16 *weight1= ucaw[page1] + (wc1 & MY_UCA_CMASK) * ucal[page1]; + uint16 *weight2= ucaw[page2] + (wc2 & MY_UCA_CMASK) * ucal[page2]; + + if (!weight1 || !weight2) + return wc1 != wc2; + + if (length1 > length2) + return memcmp((const void*)weight1, (const void*)weight2, length2*2) ? + 1: weight1[length2]; + + if (length1 < length2) + return memcmp((const void*)weight1, (const void*)weight2, length1*2) ? + 1 : weight2[length1]; + + return memcmp((const void*)weight1, (const void*)weight2, length1*2); +} + +/* +** Compare string against string with wildcard +** 0 if matched +** -1 if not matched with wildcard +** 1 if matched with wildcard +*/ + +static +int my_wildcmp_uca(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + int result= -1; /* Not found, using wildcards */ + my_wc_t s_wc, w_wc; + int scan; + int (*mb_wc)(struct charset_info_st *, my_wc_t *, + const uchar *, const uchar *); + mb_wc= cs->cset->mb_wc; + + while (wildstr != wildend) + { + while (1) + { + my_bool escaped= 0; + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + + if (w_wc == (my_wc_t)w_many) + { + result= 1; /* Found an anchor char */ + break; + } + + wildstr+= scan; + if (w_wc == (my_wc_t)escape) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + wildstr+= scan; + escaped= 1; + } + + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, + (const uchar*)str_end)) <= 0) + return 1; + str+= scan; + + if (!escaped && w_wc == (my_wc_t)w_one) + { + result= 1; /* Found an anchor char */ + } + else + { + if (my_uca_charcmp(cs,s_wc,w_wc)) + return 1; + } + if (wildstr == wildend) + return (str != str_end); /* Match if both are at end */ + } + + + if (w_wc == (my_wc_t)w_many) + { /* Found w_many */ + + /* Remove any '%' and '_' from the wild search string */ + for ( ; wildstr != wildend ; ) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + + if (w_wc == (my_wc_t)w_many) + { + wildstr+= scan; + continue; + } + + if (w_wc == (my_wc_t)w_one) + { + wildstr+= scan; + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, + (const uchar*)str_end)) <= 0) + return 1; + str+= scan; + continue; + } + break; /* Not a wild character */ + } + + if (wildstr == wildend) + return 0; /* Ok if w_many is last */ + + if (str == str_end) + return -1; + + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + + if (w_wc == (my_wc_t)escape) + { + wildstr+= scan; + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + } + + while (1) + { + /* Skip until the first character from wildstr is found */ + while (str != str_end) + { + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, + (const uchar*)str_end)) <= 0) + return 1; + + if (!my_uca_charcmp(cs,s_wc,w_wc)) + break; + str+= scan; + } + if (str == str_end) + return -1; + + result= my_wildcmp_uca(cs, str, str_end, wildstr, wildend, + escape, w_one, w_many); + + if (result <= 0) + return result; + + str+= scan; + } + } + } + return (str != str_end ? 1 : 0); +} + + +/* + Collation language is implemented according to + subset of ICU Collation Customization (tailorings): + http://icu.sourceforge.net/userguide/Collate_Customization.html + + Collation language elements: + Delimiters: + space - skipped + + := A-Z | a-z | \uXXXX + + Shift command: + := & - reset at this letter. + + Diff command: + := < - Identifies a primary difference. + := << - Identifies a secondary difference. + := <<< - Idenfifies a tertiary difference. + + + Collation rules: + := { } + + := + | + | + | + + := [ ] + + An example, Polish collation: + + &A < \u0105 <<< \u0104 + &C < \u0107 <<< \u0106 + &E < \u0119 <<< \u0118 + &L < \u0142 <<< \u0141 + &N < \u0144 <<< \u0143 + &O < \u00F3 <<< \u00D3 + &S < \u015B <<< \u015A + &Z < \u017A <<< \u017B +*/ + + +typedef enum my_coll_lexem_num_en +{ + MY_COLL_LEXEM_EOF = 0, + MY_COLL_LEXEM_DIFF = 1, + MY_COLL_LEXEM_SHIFT = 4, + MY_COLL_LEXEM_CHAR = 5, + MY_COLL_LEXEM_ERROR = 6 +} my_coll_lexem_num; + + +typedef struct my_coll_lexem_st +{ + const char *beg; + const char *end; + const char *prev; + int diff; + int code; +} MY_COLL_LEXEM; + + +/* + Initialize collation rule lexical anilizer + + SYNOPSIS + my_coll_lexem_init + lexem Lex analizer to init + str Const string to parse + str_end End of the string + USAGE + + RETURN VALUES + N/A +*/ + +static void my_coll_lexem_init(MY_COLL_LEXEM *lexem, + const char *str, const char *str_end) +{ + lexem->beg= str; + lexem->prev= str; + lexem->end= str_end; + lexem->diff= 0; + lexem->code= 0; +} + + +/* + Print collation customization expression parse error, with context. + + SYNOPSIS + my_coll_lexem_print_error + lexem Lex analizer to take context from + errstr sting to write error to + errsize errstr size + txt error message + USAGE + + RETURN VALUES + N/A +*/ + +static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem, + char *errstr, size_t errsize, + const char *txt) +{ + char tail[30]; + size_t len= lexem->end - lexem->prev; + strmake (tail, lexem->prev, (size_t) min(len, sizeof(tail)-1)); + errstr[errsize-1]= '\0'; + my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail); +} + + +/* + Convert a hex digit into its numeric value + + SYNOPSIS + ch2x + ch hex digit to convert + USAGE + + RETURN VALUES + an integer value in the range 0..15 + -1 on error +*/ + +static int ch2x(int ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + + if (ch >= 'a' && ch <= 'f') + return 10 + ch - 'a'; + + if (ch >= 'A' && ch <= 'F') + return 10 + ch - 'A'; + + return -1; +} + + +/* + Collation language lexical parser: + Scans the next lexem. + + SYNOPSIS + my_coll_lexem_next + lexem Lex analizer, previously initialized by + my_coll_lexem_init. + USAGE + Call this function in a loop + + RETURN VALUES + Lexem number: eof, diff, shift, char or error. +*/ + +static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) +{ + const char *beg; + my_coll_lexem_num rc; + + for (beg= lexem->beg ; beg < lexem->end ; beg++) + { + if (*beg == ' ' || *beg == '\t' || *beg == '\r' || *beg == '\n') + continue; + + if (*beg == '&') + { + beg++; + rc= MY_COLL_LEXEM_SHIFT; + goto ex; + } + + if (beg[0] == '=') + { + beg++; + rc= MY_COLL_LEXEM_DIFF; + goto ex; + } + + if (beg[0] == '<') + { + for (beg++, lexem->diff= 1; + (beg < lexem->end) && + (*beg == '<') && (lexem->diff<3); + beg++, lexem->diff++); + rc= MY_COLL_LEXEM_DIFF; + goto ex; + } + + if ((*beg >= 'a' && *beg <= 'z') || (*beg >= 'A' && *beg <= 'Z')) + { + lexem->code= *beg++; + rc= MY_COLL_LEXEM_CHAR; + goto ex; + } + + if ((*beg == '\\') && (beg+2 < lexem->end) && (beg[1] == 'u')) + { + int ch; + + beg+= 2; + lexem->code= 0; + while ((beg < lexem->end) && ((ch= ch2x(beg[0])) >= 0)) + { + lexem->code= (lexem->code << 4) + ch; + beg++; + } + rc= MY_COLL_LEXEM_CHAR; + goto ex; + } + + rc= MY_COLL_LEXEM_ERROR; + goto ex; + } + rc= MY_COLL_LEXEM_EOF; + +ex: + lexem->prev= lexem->beg; + lexem->beg= beg; + return rc; +} + + +/* + Collation rule item +*/ + +typedef struct my_coll_rule_item_st +{ + uint base; /* Base character */ + uint curr[2]; /* Current character */ + int diff[3]; /* Primary, Secondary and Tertiary difference */ +} MY_COLL_RULE; + + +/* + Collation language syntax parser. + Uses lexical parser. + + SYNOPSIS + my_coll_rule_parse + rule Collation rule list to load to. + str A string containin collation language expression. + str_end End of the string. + USAGE + + RETURN VALUES + A positive number means the number of rules loaded. + -1 means ERROR, e.g. too many items, syntax error, etc. +*/ + +static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, + const char *str, const char *str_end, + char *errstr, size_t errsize) +{ + MY_COLL_LEXEM lexem; + my_coll_lexem_num lexnum; + my_coll_lexem_num prevlexnum= MY_COLL_LEXEM_ERROR; + MY_COLL_RULE item; + int state= 0; + size_t nitems= 0; + + /* Init all variables */ + errstr[0]= '\0'; + bzero(&item, sizeof(item)); + my_coll_lexem_init(&lexem, str, str_end); + + while ((lexnum= my_coll_lexem_next(&lexem))) + { + if (lexnum == MY_COLL_LEXEM_ERROR) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Unknown character"); + return -1; + } + + switch (state) { + case 0: + if (lexnum != MY_COLL_LEXEM_SHIFT) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& expected"); + return -1; + } + prevlexnum= lexnum; + state= 2; + continue; + + case 1: + if (lexnum != MY_COLL_LEXEM_SHIFT && lexnum != MY_COLL_LEXEM_DIFF) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& or < expected"); + return -1; + } + prevlexnum= lexnum; + state= 2; + continue; + + case 2: + if (lexnum != MY_COLL_LEXEM_CHAR) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"character expected"); + return -1; + } + + if (prevlexnum == MY_COLL_LEXEM_SHIFT) + { + item.base= lexem.code; + item.diff[0]= 0; + item.diff[1]= 0; + item.diff[2]= 0; + } + else if (prevlexnum == MY_COLL_LEXEM_DIFF) + { + MY_COLL_LEXEM savlex; + savlex= lexem; + item.curr[0]= lexem.code; + if ((lexnum= my_coll_lexem_next(&lexem)) == MY_COLL_LEXEM_CHAR) + { + item.curr[1]= lexem.code; + } + else + { + item.curr[1]= 0; + lexem=savlex; /* Restore previous parser state */ + } + if (lexem.diff == 3) + { + item.diff[2]++; + } + else if (lexem.diff == 2) + { + item.diff[1]++; + item.diff[2]= 0; + } + else if (lexem.diff == 1) + { + item.diff[0]++; + item.diff[1]= 0; + item.diff[2]= 0; + } + else if (lexem.diff == 0) + { + item.diff[0]= item.diff[1]= item.diff[2]= 0; + } + if (nitems >= mitems) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Too many rules"); + return -1; + } + rule[nitems++]= item; + } + else + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Should never happen"); + return -1; + } + state= 1; + continue; + } + } + return (int) nitems; +} + +#define MY_MAX_COLL_RULE 128 + +/* + This function copies an UCS2 collation from + the default Unicode Collation Algorithm (UCA) + weights applying tailorings, i.e. a set of + alternative weights for some characters. + + The default UCA weights are stored in uca_weight/uca_length. + They consist of 256 pages, 256 character each. + + If a page is not overwritten by tailoring rules, + it is copies as is from UCA as is. + + If a page contains some overwritten characters, it is + allocated. Untouched characters are copied from the + default weights. +*/ + +static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t)) +{ + MY_COLL_RULE rule[MY_MAX_COLL_RULE]; + char errstr[128]; + uchar *newlengths; + uint16 **newweights; + const uchar *deflengths= uca_length; + uint16 **defweights= uca_weight; + int rc, i; + int ncontractions= 0; + + if (!cs->tailoring) + return 1; + + /* Parse ICU Collation Customization expression */ + if ((rc= my_coll_rule_parse(rule, MY_MAX_COLL_RULE, + cs->tailoring, + cs->tailoring + strlen(cs->tailoring), + errstr, sizeof(errstr))) < 0) + { + /* + TODO: add error message reporting. + printf("Error: %d '%s'\n", rc, errstr); + */ + return 1; + } + + if (!(newweights= (uint16**) (*alloc)(256*sizeof(uint16*)))) + return 1; + bzero(newweights, 256*sizeof(uint16*)); + + if (!(newlengths= (uchar*) (*alloc)(256))) + return 1; + + memcpy(newlengths, deflengths, 256); + + /* + Calculate maximum lenghts for the pages + which will be overwritten. + */ + for (i=0; i < rc; i++) + { + if (!rule[i].curr[1]) /* If not a contraction */ + { + uint pageb= (rule[i].base >> 8) & 0xFF; + uint pagec= (rule[i].curr[0] >> 8) & 0xFF; + + if (newlengths[pagec] < deflengths[pageb]) + newlengths[pagec]= deflengths[pageb]; + } + else + ncontractions++; + } + + for (i=0; i < rc; i++) + { + uint pageb= (rule[i].base >> 8) & 0xFF; + uint pagec= (rule[i].curr[0] >> 8) & 0xFF; + uint chb, chc; + + if (rule[i].curr[1]) /* Skip contraction */ + continue; + + if (!newweights[pagec]) + { + /* Alloc new page and copy the default UCA weights */ + uint size= 256*newlengths[pagec]*sizeof(uint16); + + if (!(newweights[pagec]= (uint16*) (*alloc)(size))) + return 1; + bzero((void*) newweights[pagec], size); + + for (chc=0 ; chc < 256; chc++) + { + memcpy(newweights[pagec] + chc*newlengths[pagec], + defweights[pagec] + chc*deflengths[pagec], + deflengths[pagec]*sizeof(uint16)); + } + } + + /* + Aply the alternative rule: + shift to the base character and primary difference. + */ + chc= rule[i].curr[0] & 0xFF; + chb= rule[i].base & 0xFF; + memcpy(newweights[pagec] + chc*newlengths[pagec], + defweights[pageb] + chb*deflengths[pageb], + deflengths[pageb]*sizeof(uint16)); + /* Apply primary difference */ + newweights[pagec][chc*newlengths[pagec]]+= rule[i].diff[0]; + } + + /* Copy non-overwritten pages from the default UCA weights */ + for (i= 0; i < 256 ; i++) + { + if (!newweights[i]) + newweights[i]= defweights[i]; + } + + cs->sort_order= newlengths; + cs->sort_order_big= newweights; + cs->contractions= NULL; + + /* Now process contractions */ + if (ncontractions) + { + /* + 8K for weights for basic latin letter pairs, + plus 256 bytes for "is contraction part" flags. + */ + uint size= 0x40*0x40*sizeof(uint16) + 256; + char *contraction_flags; + if (!(cs->contractions= (uint16*) (*alloc)(size))) + return 1; + bzero((void*)cs->contractions, size); + contraction_flags= ((char*) cs->contractions) + 0x40*0x40; + for (i=0; i < rc; i++) + { + if (rule[i].curr[1]) + { + uint pageb= (rule[i].base >> 8) & 0xFF; + uint chb= rule[i].base & 0xFF; + uint16 *offsb= defweights[pageb] + chb*deflengths[pageb]; + uint offsc; + + if (offsb[1] || + rule[i].curr[0] < 0x40 || rule[i].curr[0] > 0x7f || + rule[i].curr[1] < 0x40 || rule[i].curr[1] > 0x7f) + { + /* + TODO: add error reporting; + We support only basic latin letters contractions at this point. + Also, We don't support contractions with weight longer than one. + Otherwise, we'd need much more memory. + */ + return 1; + } + offsc= (rule[i].curr[0]-0x40)*0x40+(rule[i].curr[1]-0x40); + + /* Copy base weight applying primary difference */ + cs->contractions[offsc]= offsb[0] + rule[i].diff[0]; + /* Mark both letters as "is contraction part */ + contraction_flags[rule[i].curr[0]]= 1; + contraction_flags[rule[i].curr[1]]= 1; + } + } + } + return 0; +} + + +/* + Universal CHARSET_INFO compatible wrappers + for the above internal functions. + Should work for any character set. +*/ + +static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(size_t)) +{ + cs->pad_char= ' '; + return create_tailoring(cs, alloc); +} + +static int my_strnncoll_any_uca(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + return my_strnncoll_uca(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen, t_is_prefix); +} + +static int my_strnncollsp_any_uca(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen, + diff_if_only_endspace_difference); +} + +static void my_hash_sort_any_uca(CHARSET_INFO *cs, + const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); +} + +static size_t my_strnxfrm_any_uca(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + return my_strnxfrm_uca(cs, &my_any_uca_scanner_handler, + dst, dstlen, nweights, src, srclen, flags); +} + + +#ifdef HAVE_CHARSET_ucs2 +/* + UCS2 optimized CHARSET_INFO compatible wrappers. +*/ +static int my_strnncoll_ucs2_uca(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + return my_strnncoll_uca(cs, &my_ucs2_uca_scanner_handler, + s, slen, t, tlen, t_is_prefix); +} + +static int my_strnncollsp_ucs2_uca(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + return my_strnncollsp_uca(cs, &my_ucs2_uca_scanner_handler, + s, slen, t, tlen, + diff_if_only_endspace_difference); +} + +static void my_hash_sort_ucs2_uca(CHARSET_INFO *cs, + const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_hash_sort_uca(cs, &my_ucs2_uca_scanner_handler, s, slen, n1, n2); +} + +static size_t my_strnxfrm_ucs2_uca(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + return my_strnxfrm_uca(cs, &my_ucs2_uca_scanner_handler, + dst, dstlen, nweights, src, srclen, flags); +} + +MY_COLLATION_HANDLER my_collation_ucs2_uca_handler = +{ + my_coll_init_uca, /* init */ + my_strnncoll_ucs2_uca, + my_strnncollsp_ucs2_uca, + my_strnxfrm_ucs2_uca, + my_strnxfrmlen_simple, + my_like_range_ucs2, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_ucs2_uca, + my_propagate_complex +}; + +CHARSET_INFO my_charset_ucs2_unicode_ci= +{ + 128,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_unicode_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + uca_length, /* sort_order */ + NULL, /* contractions */ + uca_weight, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= +{ + 129,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_icelandic_ci", /* name */ + "", /* comment */ + icelandic, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_latvian_uca_ci= +{ + 130,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_romanian_uca_ci= +{ + 131,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_romanian_ci", /* name */ + "", /* comment */ + romanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= +{ + 132,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_slovenian_ci", /* name */ + "", /* comment */ + slovenian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_polish_uca_ci= +{ + 133,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_estonian_uca_ci= +{ + 134,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_spanish_uca_ci= +{ + 135,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_swedish_uca_ci= +{ + 136,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_turkish_uca_ci= +{ + 137,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_czech_uca_ci= +{ + 138,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_danish_uca_ci= +{ + 139,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= +{ + 140,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_slovak_uca_ci= +{ + 141,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= +{ + 142,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_spanish2_ci", /* name */ + "", /* comment */ + spanish2, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_roman_uca_ci= +{ + 143,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_roman_ci", /* name */ + "", /* comment */ + roman, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_persian_uca_ci= +{ + 144,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_persian_ci", /* name */ + "", /* comment */ + persian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_esperanto_uca_ci= +{ + 145,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_esperanto_ci", /* name */ + "", /* comment */ + esperanto, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_hungarian_uca_ci= +{ + 146,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* csname */ + "ucs2_hungarian_ci", /* name */ + "", /* comment */ + hungarian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_sinhala_uca_ci= +{ + 147,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* csname */ + "ucs2_sinhala_ci", /* name */ + "", /* comment */ + sinhala, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +#endif + + +#if defined(HAVE_CHARSET_utf8mb3) || defined(HAVE_CHARSET_utf8mb4) +/* + We consider bytes with code more than 127 as a letter. + This garantees that word boundaries work fine with regular + expressions. Note, there is no need to mark byte 255 as a + letter, it is illegal byte in UTF8. +*/ +static uchar ctype_utf8[]= +{ + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0 +}; + + +MY_COLLATION_HANDLER my_collation_any_uca_handler = +{ + my_coll_init_uca, /* init */ + my_strnncoll_any_uca, + my_strnncollsp_any_uca, + my_strnxfrm_any_uca, + my_strnxfrmlen_simple, + my_like_range_mb, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca, + my_propagate_complex +}; + +#endif /* HAVE_CHARSET_utf8mb3 || HAVE_CHARSET_utf8mb4 */ + + +#ifdef HAVE_CHARSET_utf8mb3 + +extern MY_CHARSET_HANDLER my_charset_utf8mb3_handler; + +CHARSET_INFO my_charset_utf8mb3_unicode_ci= +{ + 192,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_unicode_ci",/* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + uca_length, /* sort_order */ + NULL, /* contractions */ + uca_weight, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8mb3_icelandic_uca_ci= +{ + 193,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_icelandic_ci",/* name */ + "", /* comment */ + icelandic, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_latvian_uca_ci= +{ + 194,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_romanian_uca_ci= +{ + 195,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_romanian_ci",/* name */ + "", /* comment */ + romanian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_slovenian_uca_ci= +{ + 196,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_slovenian_ci",/* name */ + "", /* comment */ + slovenian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_dort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_polish_uca_ci= +{ + 197,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_estonian_uca_ci= +{ + 198,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_spanish_uca_ci= +{ + 199,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_swedish_uca_ci= +{ + 200,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_turkish_uca_ci= +{ + 201,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* caseup_multiply */ + 2, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_czech_uca_ci= +{ + 202,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8mb3_danish_uca_ci= +{ + 203,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_lithuanian_uca_ci= +{ + 204,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_slovak_uca_ci= +{ + 205,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_spanish2_uca_ci= +{ + 206,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_spanish2_ci", /* name */ + "", /* comment */ + spanish2, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_roman_uca_ci= +{ + 207,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_roman_ci", /* name */ + "", /* comment */ + roman, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_persian_uca_ci= +{ + 208,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_persian_ci", /* name */ + "", /* comment */ + persian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_esperanto_uca_ci= +{ + 209,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_esperanto_ci",/* name */ + "", /* comment */ + esperanto, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_hungarian_uca_ci= +{ + 210,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* csname */ + MY_UTF8MB3 "_hungarian_ci",/* name */ + "", /* comment */ + hungarian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb3_sinhala_uca_ci= +{ + 211,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB3, /* cs name */ + MY_UTF8MB3 "_sinhala_ci",/* name */ + "", /* comment */ + sinhala, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 3, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_any_uca_handler +}; + +#endif /* HAVE_CHARSET_utf8mb3 */ + + +#ifdef HAVE_CHARSET_utf8mb4 + +extern MY_CHARSET_HANDLER my_charset_utf8mb4_handler; + +CHARSET_INFO my_charset_utf8mb4_unicode_ci= +{ + 224,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_unicode_ci",/* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + uca_length, /* sort_order */ + NULL, /* contractions */ + uca_weight, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8mb4_icelandic_uca_ci= +{ + 225,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_icelandic_ci",/* name */ + "", /* comment */ + icelandic, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_latvian_uca_ci= +{ + 226,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_romanian_uca_ci= +{ + 227,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_romanian_ci", /* name */ + "", /* comment */ + romanian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_slovenian_uca_ci= +{ + 228,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_slovenian_ci",/* name */ + "", /* comment */ + slovenian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_polish_uca_ci= +{ + 229,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_estonian_uca_ci= +{ + 230,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_spanish_uca_ci= +{ + 231,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_swedish_uca_ci= +{ + 232,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_turkish_uca_ci= +{ + 233,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* caseup_multiply */ + 2, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_czech_uca_ci= +{ + 234,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8mb4_danish_uca_ci= +{ + 235,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_lithuanian_uca_ci= +{ + 236,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_slovak_uca_ci= +{ + 237,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_spanish2_uca_ci= +{ + 238,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_spanish2_ci", /* name */ + "", /* comment */ + spanish2, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_roman_uca_ci= +{ + 239,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_roman_ci", /* name */ + "", /* comment */ + roman, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_persian_uca_ci= +{ + 240,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_persian_ci", /* name */ + "", /* comment */ + persian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_esperanto_uca_ci= +{ + 241,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_esperanto_ci",/* name */ + "", /* comment */ + esperanto, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_hungarian_uca_ci= +{ + 242,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_hungarian_ci",/* name */ + "", /* comment */ + hungarian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_sinhala_uca_ci= +{ + 243,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_sinhala_ci",/* name */ + "", /* comment */ + sinhala, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +#endif /* HAVE_CHARSET_utf8mb4 */ + + +#ifdef HAVE_CHARSET_utf32 + +MY_COLLATION_HANDLER my_collation_utf32_uca_handler = +{ + my_coll_init_uca, /* init */ + my_strnncoll_any_uca, + my_strnncollsp_any_uca, + my_strnxfrm_any_uca, + my_strnxfrmlen_simple, + my_like_range_utf32, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca, + my_propagate_complex +}; + +extern MY_CHARSET_HANDLER my_charset_utf32_handler; + +CHARSET_INFO my_charset_utf32_unicode_ci= +{ + 160,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_unicode_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + uca_length, /* sort_order */ + NULL, /* contractions */ + uca_weight, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + + +CHARSET_INFO my_charset_utf32_icelandic_uca_ci= +{ + 161,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_icelandic_ci",/* name */ + "", /* comment */ + icelandic, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_latvian_uca_ci= +{ + 162,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_romanian_uca_ci= +{ + 163,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_romanian_ci", /* name */ + "", /* comment */ + romanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_slovenian_uca_ci= +{ + 164,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_slovenian_ci",/* name */ + "", /* comment */ + slovenian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_polish_uca_ci= +{ + 165,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_estonian_uca_ci= +{ + 166,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_spanish_uca_ci= +{ + 167,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_swedish_uca_ci= +{ + 168,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_turkish_uca_ci= +{ + 169,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_czech_uca_ci= +{ + 170,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + + +CHARSET_INFO my_charset_utf32_danish_uca_ci= +{ + 171,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_lithuanian_uca_ci= +{ + 172,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_slovak_uca_ci= +{ + 173,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_spanish2_uca_ci= +{ + 174,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_spanish2_ci", /* name */ + "", /* comment */ + spanish2, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_roman_uca_ci= +{ + 175,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_roman_ci", /* name */ + "", /* comment */ + roman, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_persian_uca_ci= +{ + 176,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_persian_ci", /* name */ + "", /* comment */ + persian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_esperanto_uca_ci= +{ + 177,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_esperanto_ci",/* name */ + "", /* comment */ + esperanto, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_hungarian_uca_ci= +{ + 178,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_hungarian_ci",/* name */ + "", /* comment */ + hungarian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_sinhala_uca_ci= +{ + 179,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* csname */ + "utf32_sinhala_ci", /* name */ + "", /* comment */ + sinhala, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +#endif /* HAVE_CHARSET_utf32 */ + + +#ifdef HAVE_CHARSET_utf16 + + +MY_COLLATION_HANDLER my_collation_utf16_uca_handler = +{ + my_coll_init_uca, /* init */ + my_strnncoll_any_uca, + my_strnncollsp_any_uca, + my_strnxfrm_any_uca, + my_strnxfrmlen_simple, + my_like_range_utf16, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca, + my_propagate_complex +}; + +extern MY_CHARSET_HANDLER my_charset_utf16_handler; + +CHARSET_INFO my_charset_utf16_unicode_ci= +{ + 101,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* csname */ + "utf16_unicode_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + uca_length, /* sort_order */ + NULL, /* contractions */ + uca_weight, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + + +CHARSET_INFO my_charset_utf16_icelandic_uca_ci= +{ + 102,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* csname */ + "utf16_icelandic_ci",/* name */ + "", /* comment */ + icelandic, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_latvian_uca_ci= +{ + 103,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_romanian_uca_ci= +{ + 104,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_romanian_ci", /* name */ + "", /* comment */ + romanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_slovenian_uca_ci= +{ + 105,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_slovenian_ci",/* name */ + "", /* comment */ + slovenian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_polish_uca_ci= +{ + 106,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_estonian_uca_ci= +{ + 107,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_spanish_uca_ci= +{ + 108,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_swedish_uca_ci= +{ + 109,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_turkish_uca_ci= +{ + 110,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_turkish, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_czech_uca_ci= +{ + 111,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + + +CHARSET_INFO my_charset_utf16_danish_uca_ci= +{ + 112,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_lithuanian_uca_ci= +{ + 113,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_slovak_uca_ci= +{ + 114,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_spanish2_uca_ci= +{ + 115,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_spanish2_ci",/* name */ + "", /* comment */ + spanish2, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_roman_uca_ci= +{ + 116,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_roman_ci", /* name */ + "", /* comment */ + roman, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_persian_uca_ci= +{ + 117,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_persian_ci", /* name */ + "", /* comment */ + persian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_esperanto_uca_ci= +{ + 118,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_esperanto_ci",/* name */ + "", /* comment */ + esperanto, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_hungarian_uca_ci= +{ + 119,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_hungarian_ci",/* name */ + "", /* comment */ + hungarian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_sinhala_uca_ci= +{ + 120,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_sinhala_ci",/* name */ + "", /* comment */ + sinhala, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default,/* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +#endif /* HAVE_CHARSET_utf16 */ + + +#endif /* HAVE_UCA_COLLATIONS */ diff --git a/externals/mysql/strings/ctype-ucs2.c b/externals/mysql/strings/ctype-ucs2.c new file mode 100644 index 00000000000..3f1495c496a --- /dev/null +++ b/externals/mysql/strings/ctype-ucs2.c @@ -0,0 +1,3592 @@ +/* Copyright (C) 2000 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* UCS2 support. Written by Alexander Barkov */ + +#include +#include +#include "m_string.h" +#include "m_ctype.h" +#include +#include + + +#ifndef EILSEQ +#define EILSEQ ENOENT +#endif + +#undef ULONGLONG_MAX +#define ULONGLONG_MAX ~0ULL +#define MAX_NEGATIVE_NUMBER 0x8000000000000000ULL +#define INIT_CNT 9 +#define LFACTOR 1000000000ULL +#define LFACTOR1 10000000000ULL +#define LFACTOR2 100000000000ULL + +static unsigned long lfactor[9]= +{ + 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L +}; + + +#define REPLACEMENT_CHAR 0xFFFD; + + +#if defined(HAVE_CHARSET_utf16) || defined(HAVE_CHARSET_ucs2) +#define HAVE_CHARSET_mb2 +#endif + + +#if defined(HAVE_CHARSET_mb2) || defined(HAVE_CHARSET_utf32) +#define HAVE_CHARSET_mb2_or_mb4 +#endif + + +#ifdef HAVE_CHARSET_mb2_or_mb4 +static inline int +my_bincmp(const uchar *s, const uchar *se, + const uchar *t, const uchar *te) +{ + int slen= (int) (se - s), tlen= (int) (te - t); + int len= min(slen, tlen); + int cmp= memcmp(s, t, len); + return cmp ? cmp : slen - tlen; +} + + +static size_t +my_caseup_str_mb2_or_mb4(CHARSET_INFO * cs __attribute__((unused)), + char * s __attribute__((unused))) +{ + DBUG_ASSERT(0); + return 0; +} + + +static size_t +my_casedn_str_mb2_or_mb4(CHARSET_INFO *cs __attribute__((unused)), + char * s __attribute__((unused))) +{ + DBUG_ASSERT(0); + return 0; +} + + +static int +my_strcasecmp_mb2_or_mb4(CHARSET_INFO *cs __attribute__((unused)), + const char *s __attribute__((unused)), + const char *t __attribute__((unused))) +{ + DBUG_ASSERT(0); + return 0; +} + + +static long +my_strntol_mb2_or_mb4(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative= 0; + int overflow; + int cnv; + my_wc_t wc; + register unsigned int cutlim; + register uint32 cutoff; + register uint32 res; + register const uchar *s= (const uchar*) nptr; + register const uchar *e= (const uchar*) nptr+l; + const uchar *save; + + *err= 0; + do + { + if ((cnv= cs->cset->mb_wc(cs, &wc, s, e))>0) + { + switch (wc) + { + case ' ' : break; + case '\t': break; + case '-' : negative= !negative; break; + case '+' : break; + default : goto bs; + } + } + else /* No more characters or bad multibyte sequence */ + { + if (endptr != NULL ) + *endptr= (char*) s; + err[0]= (cnv==MY_CS_ILSEQ) ? EILSEQ : EDOM; + return 0; + } + s+= cnv; + } while (1); + +bs: + +#ifdef NOT_USED + if (base <= 0 || base == 1 || base > 36) + base = 10; +#endif + + overflow= 0; + res= 0; + save= s; + cutoff= ((uint32)~0L) / (uint32) base; + cutlim= (uint) (((uint32)~0L) % (uint32) base); + + do { + if ((cnv= cs->cset->mb_wc(cs, &wc, s, e)) > 0) + { + s+= cnv; + if (wc >= '0' && wc <= '9') + wc-= '0'; + else if (wc >= 'A' && wc <= 'Z') + wc= wc - 'A' + 10; + else if (wc >= 'a' && wc <= 'z') + wc= wc - 'a' + 10; + else + break; + if ((int)wc >= base) + break; + if (res > cutoff || (res == cutoff && wc > cutlim)) + overflow= 1; + else + { + res*= (uint32) base; + res+= wc; + } + } + else if (cnv == MY_CS_ILSEQ) + { + if (endptr !=NULL ) + *endptr = (char*) s; + err[0]= EILSEQ; + return 0; + } + else + { + /* No more characters */ + break; + } + } while(1); + + if (endptr != NULL) + *endptr = (char *) s; + + if (s == save) + { + err[0]= EDOM; + return 0L; + } + + if (negative) + { + if (res > (uint32) INT_MIN32) + overflow= 1; + } + else if (res > INT_MAX32) + overflow= 1; + + if (overflow) + { + err[0]= ERANGE; + return negative ? INT_MIN32 : INT_MAX32; + } + + return (negative ? -((long) res) : (long) res); +} + + +static ulong +my_strntoul_mb2_or_mb4(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative= 0; + int overflow; + int cnv; + my_wc_t wc; + register unsigned int cutlim; + register uint32 cutoff; + register uint32 res; + register const uchar *s= (const uchar*) nptr; + register const uchar *e= (const uchar*) nptr + l; + const uchar *save; + + *err= 0; + do + { + if ((cnv= cs->cset->mb_wc(cs, &wc, s, e)) > 0) + { + switch (wc) + { + case ' ' : break; + case '\t': break; + case '-' : negative= !negative; break; + case '+' : break; + default : goto bs; + } + } + else /* No more characters or bad multibyte sequence */ + { + if (endptr !=NULL ) + *endptr= (char*)s; + err[0]= (cnv == MY_CS_ILSEQ) ? EILSEQ : EDOM; + return 0; + } + s+= cnv; + } while (1); + +bs: + +#ifdef NOT_USED + if (base <= 0 || base == 1 || base > 36) + base = 10; +#endif + + overflow= 0; + res= 0; + save= s; + cutoff= ((uint32)~0L) / (uint32) base; + cutlim= (uint) (((uint32)~0L) % (uint32) base); + + do + { + if ((cnv= cs->cset->mb_wc(cs, &wc, s, e)) > 0) + { + s+= cnv; + if (wc >= '0' && wc <= '9') + wc-= '0'; + else if (wc >= 'A' && wc <= 'Z') + wc= wc - 'A' + 10; + else if (wc >= 'a' && wc <= 'z') + wc= wc - 'a' + 10; + else + break; + if ((int) wc >= base) + break; + if (res > cutoff || (res == cutoff && wc > cutlim)) + overflow = 1; + else + { + res*= (uint32) base; + res+= wc; + } + } + else if (cnv == MY_CS_ILSEQ) + { + if (endptr != NULL ) + *endptr= (char*)s; + err[0]= EILSEQ; + return 0; + } + else + { + /* No more characters */ + break; + } + } while(1); + + if (endptr != NULL) + *endptr= (char *) s; + + if (s == save) + { + err[0]= EDOM; + return 0L; + } + + if (overflow) + { + err[0]= (ERANGE); + return (~(uint32) 0); + } + + return (negative ? -((long) res) : (long) res); +} + + +static longlong +my_strntoll_mb2_or_mb4(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative=0; + int overflow; + int cnv; + my_wc_t wc; + register ulonglong cutoff; + register unsigned int cutlim; + register ulonglong res; + register const uchar *s= (const uchar*) nptr; + register const uchar *e= (const uchar*) nptr+l; + const uchar *save; + + *err= 0; + do + { + if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0) + { + switch (wc) + { + case ' ' : break; + case '\t': break; + case '-' : negative= !negative; break; + case '+' : break; + default : goto bs; + } + } + else /* No more characters or bad multibyte sequence */ + { + if (endptr !=NULL ) + *endptr = (char*)s; + err[0] = (cnv==MY_CS_ILSEQ) ? EILSEQ : EDOM; + return 0; + } + s+=cnv; + } while (1); + +bs: + +#ifdef NOT_USED + if (base <= 0 || base == 1 || base > 36) + base = 10; +#endif + + overflow = 0; + res = 0; + save = s; + cutoff = (~(ulonglong) 0) / (unsigned long int) base; + cutlim = (uint) ((~(ulonglong) 0) % (unsigned long int) base); + + do { + if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0) + { + s+=cnv; + if ( wc>='0' && wc<='9') + wc -= '0'; + else if ( wc>='A' && wc<='Z') + wc = wc - 'A' + 10; + else if ( wc>='a' && wc<='z') + wc = wc - 'a' + 10; + else + break; + if ((int)wc >= base) + break; + if (res > cutoff || (res == cutoff && wc > cutlim)) + overflow = 1; + else + { + res *= (ulonglong) base; + res += wc; + } + } + else if (cnv==MY_CS_ILSEQ) + { + if (endptr !=NULL ) + *endptr = (char*)s; + err[0]=EILSEQ; + return 0; + } + else + { + /* No more characters */ + break; + } + } while(1); + + if (endptr != NULL) + *endptr = (char *) s; + + if (s == save) + { + err[0]=EDOM; + return 0L; + } + + if (negative) + { + if (res > (ulonglong) LONGLONG_MIN) + overflow = 1; + } + else if (res > (ulonglong) LONGLONG_MAX) + overflow = 1; + + if (overflow) + { + err[0]=ERANGE; + return negative ? LONGLONG_MIN : LONGLONG_MAX; + } + + return (negative ? -((longlong)res) : (longlong)res); +} + + +static ulonglong +my_strntoull_mb2_or_mb4(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) +{ + int negative= 0; + int overflow; + int cnv; + my_wc_t wc; + register ulonglong cutoff; + register unsigned int cutlim; + register ulonglong res; + register const uchar *s= (const uchar*) nptr; + register const uchar *e= (const uchar*) nptr + l; + const uchar *save; + + *err= 0; + do + { + if ((cnv= cs->cset->mb_wc(cs,&wc,s,e)) > 0) + { + switch (wc) + { + case ' ' : break; + case '\t': break; + case '-' : negative= !negative; break; + case '+' : break; + default : goto bs; + } + } + else /* No more characters or bad multibyte sequence */ + { + if (endptr !=NULL ) + *endptr = (char*)s; + err[0]= (cnv==MY_CS_ILSEQ) ? EILSEQ : EDOM; + return 0; + } + s+=cnv; + } while (1); + +bs: + +#ifdef NOT_USED + if (base <= 0 || base == 1 || base > 36) + base = 10; +#endif + + overflow = 0; + res = 0; + save = s; + cutoff = (~(ulonglong) 0) / (unsigned long int) base; + cutlim = (uint) ((~(ulonglong) 0) % (unsigned long int) base); + + do + { + if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0) + { + s+=cnv; + if ( wc>='0' && wc<='9') + wc -= '0'; + else if ( wc>='A' && wc<='Z') + wc = wc - 'A' + 10; + else if ( wc>='a' && wc<='z') + wc = wc - 'a' + 10; + else + break; + if ((int)wc >= base) + break; + if (res > cutoff || (res == cutoff && wc > cutlim)) + overflow = 1; + else + { + res *= (ulonglong) base; + res += wc; + } + } + else if (cnv==MY_CS_ILSEQ) + { + if (endptr !=NULL ) + *endptr = (char*)s; + err[0]= EILSEQ; + return 0; + } + else + { + /* No more characters */ + break; + } + } while(1); + + if (endptr != NULL) + *endptr = (char *) s; + + if (s == save) + { + err[0]= EDOM; + return 0L; + } + + if (overflow) + { + err[0]= ERANGE; + return (~(ulonglong) 0); + } + + return (negative ? -((longlong) res) : (longlong) res); +} + + +static double +my_strntod_mb2_or_mb4(CHARSET_INFO *cs, + char *nptr, size_t length, + char **endptr, int *err) +{ + char buf[256]; + double res; + register char *b= buf; + register const uchar *s= (const uchar*) nptr; + const uchar *end; + my_wc_t wc; + int cnv; + + *err= 0; + /* Cut too long strings */ + if (length >= sizeof(buf)) + length= sizeof(buf) - 1; + end= s + length; + + while ((cnv= cs->cset->mb_wc(cs,&wc,s,end)) > 0) + { + s+= cnv; + if (wc > (int) (uchar) 'e' || !wc) + break; /* Can't be part of double */ + *b++= (char) wc; + } + + *endptr= b; + res= my_strtod(buf, endptr, err); + *endptr= nptr + cs->mbminlen * (size_t) (*endptr - buf); + return res; +} + + +static ulonglong +my_strntoull10rnd_mb2_or_mb4(CHARSET_INFO *cs, + const char *nptr, size_t length, + int unsign_fl, + char **endptr, int *err) +{ + char buf[256], *b= buf; + ulonglong res; + const uchar *end, *s= (const uchar*) nptr; + my_wc_t wc; + int cnv; + + /* Cut too long strings */ + if (length >= sizeof(buf)) + length= sizeof(buf)-1; + end= s + length; + + while ((cnv= cs->cset->mb_wc(cs,&wc,s,end)) > 0) + { + s+= cnv; + if (wc > (int) (uchar) 'e' || !wc) + break; /* Can't be a number part */ + *b++= (char) wc; + } + + res= my_strntoull10rnd_8bit(cs, buf, b - buf, unsign_fl, endptr, err); + *endptr= (char*) nptr + cs->mbminlen * (size_t) (*endptr - buf); + return res; +} + + +/* + This is a fast version optimized for the case of radix 10 / -10 +*/ + +static size_t +my_l10tostr_mb2_or_mb4(CHARSET_INFO *cs, + char *dst, size_t len, int radix, long int val) +{ + char buffer[66]; + register char *p, *db, *de; + long int new_val; + int sl= 0; + unsigned long int uval = (unsigned long int) val; + + p= &buffer[sizeof(buffer) - 1]; + *p= '\0'; + + if (radix < 0) + { + if (val < 0) + { + sl= 1; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (unsigned long int)0 - uval; + } + } + + new_val = (long) (uval / 10); + *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); + val= new_val; + + while (val != 0) + { + new_val= val / 10; + *--p= '0' + (char) (val - new_val * 10); + val= new_val; + } + + if (sl) + { + *--p= '-'; + } + + for ( db= dst, de= dst + len ; (dst < de) && *p ; p++) + { + int cnvres= cs->cset->wc_mb(cs,(my_wc_t)p[0],(uchar*) dst, (uchar*) de); + if (cnvres > 0) + dst+= cnvres; + else + break; + } + return (int) (dst - db); +} + + +static size_t +my_ll10tostr_mb2_or_mb4(CHARSET_INFO *cs, + char *dst, size_t len, int radix, longlong val) +{ + char buffer[65]; + register char *p, *db, *de; + long long_val; + int sl= 0; + ulonglong uval= (ulonglong) val; + + if (radix < 0) + { + if (val < 0) + { + sl= 1; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; + } + } + + p= &buffer[sizeof(buffer)-1]; + *p='\0'; + + if (uval == 0) + { + *--p= '0'; + goto cnv; + } + + while (uval > (ulonglong) LONG_MAX) + { + ulonglong quo= uval/(uint) 10; + uint rem= (uint) (uval- quo* (uint) 10); + *--p= '0' + rem; + uval= quo; + } + + long_val= (long) uval; + while (long_val != 0) + { + long quo= long_val/10; + *--p= (char) ('0' + (long_val - quo*10)); + long_val= quo; + } + +cnv: + if (sl) + { + *--p= '-'; + } + + for ( db= dst, de= dst + len ; (dst < de) && *p ; p++) + { + int cnvres= cs->cset->wc_mb(cs, (my_wc_t) p[0], (uchar*) dst, (uchar*) de); + if (cnvres > 0) + dst+= cnvres; + else + break; + } + return (int) (dst -db); +} + +#endif + + +#ifdef HAVE_CHARSET_mb2 +static longlong +my_strtoll10_mb2(CHARSET_INFO *cs __attribute__((unused)), + const char *nptr, char **endptr, int *error) +{ + const char *s, *end, *start, *n_end, *true_end; + uchar c; + unsigned long i, j, k; + ulonglong li; + int negative; + ulong cutoff, cutoff2, cutoff3; + + s= nptr; + /* If fixed length string */ + if (endptr) + { + /* Make sure string length is even */ + end= s + ((*endptr - s) / 2) * 2; + while (s < end && !s[0] && (s[1] == ' ' || s[1] == '\t')) + s+= 2; + if (s == end) + goto no_conv; + } + else + { + /* We don't support null terminated strings in UCS2 */ + goto no_conv; + } + + /* Check for a sign. */ + negative= 0; + if (!s[0] && s[1] == '-') + { + *error= -1; /* Mark as negative number */ + negative= 1; + s+= 2; + if (s == end) + goto no_conv; + cutoff= MAX_NEGATIVE_NUMBER / LFACTOR2; + cutoff2= (MAX_NEGATIVE_NUMBER % LFACTOR2) / 100; + cutoff3= MAX_NEGATIVE_NUMBER % 100; + } + else + { + *error= 0; + if (!s[0] && s[1] == '+') + { + s+= 2; + if (s == end) + goto no_conv; + } + cutoff= ULONGLONG_MAX / LFACTOR2; + cutoff2= ULONGLONG_MAX % LFACTOR2 / 100; + cutoff3= ULONGLONG_MAX % 100; + } + + /* Handle case where we have a lot of pre-zero */ + if (!s[0] && s[1] == '0') + { + i= 0; + do + { + s+= 2; + if (s == end) + goto end_i; /* Return 0 */ + } + while (!s[0] && s[1] == '0'); + n_end= s + 2 * INIT_CNT; + } + else + { + /* Read first digit to check that it's a valid number */ + if (s[0] || (c= (s[1]-'0')) > 9) + goto no_conv; + i= c; + s+= 2; + n_end= s + 2 * (INIT_CNT-1); + } + + /* Handle first 9 digits and store them in i */ + if (n_end > end) + n_end= end; + for (; s != n_end ; s+= 2) + { + if (s[0] || (c= (s[1]-'0')) > 9) + goto end_i; + i= i*10+c; + } + if (s == end) + goto end_i; + + /* Handle next 9 digits and store them in j */ + j= 0; + start= s; /* Used to know how much to shift i */ + n_end= true_end= s + 2 * INIT_CNT; + if (n_end > end) + n_end= end; + do + { + if (s[0] || (c= (s[1]-'0')) > 9) + goto end_i_and_j; + j= j*10+c; + s+= 2; + } while (s != n_end); + if (s == end) + { + if (s != true_end) + goto end_i_and_j; + goto end3; + } + if (s[0] || (c= (s[1]-'0')) > 9) + goto end3; + + /* Handle the next 1 or 2 digits and store them in k */ + k=c; + s+= 2; + if (s == end || s[0] || (c= (s[1]-'0')) > 9) + goto end4; + k= k*10+c; + s+= 2; + *endptr= (char*) s; + + /* number string should have ended here */ + if (s != end && !s[0] && (c= (s[1]-'0')) <= 9) + goto overflow; + + /* Check that we didn't get an overflow with the last digit */ + if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) && + k > cutoff3))) + goto overflow; + li=i*LFACTOR2+ (ulonglong) j*100 + k; + return (longlong) li; + +overflow: /* *endptr is set here */ + *error= MY_ERRNO_ERANGE; + return negative ? LONGLONG_MIN : (longlong) ULONGLONG_MAX; + +end_i: + *endptr= (char*) s; + return (negative ? ((longlong) -(long) i) : (longlong) i); + +end_i_and_j: + li= (ulonglong) i * lfactor[(size_t) (s-start) / 2] + j; + *endptr= (char*) s; + return (negative ? -((longlong) li) : (longlong) li); + +end3: + li=(ulonglong) i*LFACTOR+ (ulonglong) j; + *endptr= (char*) s; + return (negative ? -((longlong) li) : (longlong) li); + +end4: + li=(ulonglong) i*LFACTOR1+ (ulonglong) j * 10 + k; + *endptr= (char*) s; + if (negative) + { + if (li > MAX_NEGATIVE_NUMBER) + goto overflow; + return -((longlong) li); + } + return (longlong) li; + +no_conv: + /* There was no number to convert. */ + *error= MY_ERRNO_EDOM; + *endptr= (char *) nptr; + return 0; +} + + +static size_t +my_scan_mb2(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *end, int sequence_type) +{ + const char *str0= str; + end--; /* for easier loop condition, because of two bytes per character */ + + switch (sequence_type) + { + case MY_SEQ_SPACES: + for ( ; str < end; str+= 2) + { + if (str[0] != '\0' || str[1] != ' ') + break; + } + return (size_t) (str - str0); + default: + return 0; + } +} + + +static void +my_fill_mb2(CHARSET_INFO *cs __attribute__((unused)), + char *s, size_t l, int fill) +{ + for ( ; l >= 2; s[0]= 0, s[1]= fill, s+= 2, l-= 2); +} + + +static int +my_vsnprintf_mb2(char *dst, size_t n, const char* fmt, va_list ap) +{ + char *start=dst, *end= dst + n - 1; + for (; *fmt ; fmt++) + { + if (fmt[0] != '%') + { + if (dst == end) /* End of buffer */ + break; + + *dst++='\0'; + *dst++= *fmt; /* Copy ordinary char */ + continue; + } + + fmt++; + + /* Skip if max size is used (to be compatible with printf) */ + while ( (*fmt >= '0' && *fmt <= '9') || *fmt == '.' || *fmt == '-') + fmt++; + + if (*fmt == 'l') + fmt++; + + if (*fmt == 's') /* String parameter */ + { + char *par= va_arg(ap, char *); + size_t plen; + size_t left_len= (size_t)(end-dst); + if (!par) + par= (char*) "(null)"; + plen= strlen(par); + if (left_len <= plen * 2) + plen = left_len / 2 - 1; + + for ( ; plen ; plen--, dst+=2, par++) + { + dst[0]= '\0'; + dst[1]= par[0]; + } + continue; + } + else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ + { + int iarg; + char nbuf[16]; + char *pbuf= nbuf; + + if ((size_t) (end - dst) < 32) + break; + iarg= va_arg(ap, int); + if (*fmt == 'd') + int10_to_str((long) iarg, nbuf, -10); + else + int10_to_str((long) (uint) iarg, nbuf,10); + + for (; pbuf[0]; pbuf++) + { + *dst++= '\0'; + *dst++= *pbuf; + } + continue; + } + + /* We come here on '%%', unknown code or too long parameter */ + if (dst == end) + break; + *dst++= '\0'; + *dst++= '%'; /* % used as % or unknown code */ + } + + DBUG_ASSERT(dst <= end); + *dst='\0'; /* End of errmessage */ + return (size_t) (dst - start); +} + + +static size_t +my_snprintf_mb2(CHARSET_INFO *cs __attribute__((unused)), + char* to, size_t n, const char* fmt, ...) +{ + va_list args; + va_start(args,fmt); + return my_vsnprintf_mb2(to, n, fmt, args); +} + + +static size_t +my_lengthsp_mb2(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr, size_t length) +{ + const char *end= ptr + length; + while (end > ptr + 1 && end[-1] == ' ' && end[-2] == '\0') + end-= 2; + return (size_t) (end - ptr); +} + +#endif + + +#ifdef HAVE_CHARSET_utf16 + +/* + D800..DB7F - Non-provate surrogate high (896 pages) + DB80..DBFF - Private surrogate high (128 pages) + DC00..DFFF - Surrogate low (1024 codes in a page) +*/ + +#define MY_UTF16_HIGH_HEAD(x) ((((uchar) (x)) & 0xFC) == 0xD8) +#define MY_UTF16_LOW_HEAD(x) ((((uchar) (x)) & 0xFC) == 0xDC) +#define MY_UTF16_SURROGATE(x) (((x) & 0xF800) == 0xD800) + +static int +my_utf16_uni(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e) +{ + if (s + 2 > e) + return MY_CS_TOOSMALL2; + + /* + High bytes: 0xD[89AB] = B'110110??' + Low bytes: 0xD[CDEF] = B'110111??' + Surrogate mask: 0xFC = B'11111100' + */ + + if (MY_UTF16_HIGH_HEAD(*s)) /* Surrogate head */ + { + if (s + 4 > e) + return MY_CS_TOOSMALL4; + + if (!MY_UTF16_LOW_HEAD(s[2])) /* Broken surrigate pair */ + return MY_CS_ILSEQ; + + /* + s[0]= 110110?? (<< 18) + s[1]= ???????? (<< 10) + s[2]= 110111?? (<< 8) + s[3]= ???????? (<< 0) + */ + + *pwc= ((s[0] & 3) << 18) + (s[1] << 10) + + ((s[2] & 3) << 8) + s[3] + 0x10000; + + return 4; + } + + if (MY_UTF16_LOW_HEAD(*s)) /* Low surrogate part without high part */ + return MY_CS_ILSEQ; + + *pwc= (s[0] << 8) + s[1]; + return 2; +} + + +static int +my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + if (wc <= 0xFFFF) + { + if (s + 2 > e) + return MY_CS_TOOSMALL2; + if (MY_UTF16_SURROGATE(wc)) + return MY_CS_ILUNI; + *s++= (uchar) (wc >> 8); + *s= (uchar) (wc & 0xFF); + return 2; + } + + if (wc <= 0x10FFFF) + { + if (s + 4 > e) + return MY_CS_TOOSMALL4; + *s++= (uchar) ((wc-= 0x10000) >> 18) | 0xD8; + *s++= (uchar) (wc >> 10) & 0xFF; + *s++= (uchar) ((wc >> 8) & 3) | 0xDC; + *s= (uchar) wc & 0xFF; + return 4; + } + + return MY_CS_ILUNI; +} + + +static inline void +my_tolower_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256 && uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].tolower; +} + + +static inline void +my_toupper_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256 && uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].toupper; +} + + +static inline void +my_tosort_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256) + { + if (uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].sort; + } + else + { + *wc= REPLACEMENT_CHAR; + } +} + + +static size_t +my_caseup_utf16(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + my_wc_t wc; + int res; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((src < srcend) && + (res= my_utf16_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0) + { + my_toupper_utf16(uni_plane, &wc); + if (res != my_uni_utf16(cs, wc, (uchar*) src, (uchar*) srcend)) + break; + src+= res; + } + return srclen; +} + + +static void +my_hash_sort_utf16(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_wc_t wc; + int res; + const uchar *e= s+slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + while (e > s + 1 && e[-1] == ' ' && e[-2] == '\0') + e-= 2; + + while ((s < e) && (res= my_utf16_uni(cs, &wc, (uchar *)s, (uchar*)e)) > 0) + { + my_tosort_utf16(uni_plane, &wc); + n1[0]^= (((n1[0] & 63) + n2[0]) * (wc & 0xFF)) + (n1[0] << 8); + n2[0]+= 3; + n1[0]^= (((n1[0] & 63) + n2[0]) * (wc >> 8)) + (n1[0] << 8); + n2[0]+= 3; + s+= res; + } +} + + +static size_t +my_casedn_utf16(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + my_wc_t wc; + int res; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((src < srcend) && + (res= my_utf16_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) + { + my_tolower_utf16(uni_plane, &wc); + if (res != my_uni_utf16(cs, wc, (uchar*) src, (uchar*) srcend)) + break; + src+= res; + } + return srclen; +} + + +static int +my_strnncoll_utf16(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + int s_res, t_res; + my_wc_t s_wc,t_wc; + const uchar *se= s + slen; + const uchar *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while (s < se && t < te) + { + s_res= my_utf16_uni(cs, &s_wc, s, se); + t_res= my_utf16_uni(cs, &t_wc, t, te); + + if (s_res <= 0 || t_res <= 0) + { + /* Incorrect string, compare by char value */ + return my_bincmp(s, se, t, te); + } + + my_tosort_utf16(uni_plane, &s_wc); + my_tosort_utf16(uni_plane, &t_wc); + + if (s_wc != t_wc) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + return (int) (t_is_prefix ? (t - te) : ((se - s) - (te - t))); +} + + +/** + Compare strings, discarding end space + + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + @param cs Character set pinter. + @param a First string to compare. + @param a_length Length of 'a'. + @param b Second string to compare. + @param b_length Length of 'b'. + + IMPLEMENTATION + + @return Comparison result. + @retval Negative number, if a less than b. + @retval 0, if a is equal to b + @retval Positive number, if a > b +*/ + +static int +my_strnncollsp_utf16(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + int res; + my_wc_t s_wc, t_wc; + const uchar *se= s + slen, *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + DBUG_ASSERT((slen % 2) == 0); + DBUG_ASSERT((tlen % 2) == 0); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= FALSE; +#endif + + while (s < se && t < te) + { + int s_res= my_utf16_uni(cs, &s_wc, s, se); + int t_res= my_utf16_uni(cs, &t_wc, t, te); + + if (s_res <= 0 || t_res <= 0) + { + /* Incorrect string, compare bytewise */ + return my_bincmp(s, se, t, te); + } + + my_tosort_utf16(uni_plane, &s_wc); + my_tosort_utf16(uni_plane, &t_wc); + + if (s_wc != t_wc) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + + slen= (size_t) (se - s); + tlen= (size_t) (te - t); + res= 0; + + if (slen != tlen) + { + int s_res, swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 's' is bigger */ + if (slen < tlen) + { + slen= tlen; + s= t; + se= te; + swap= -1; + res= -res; + } + + for ( ; s < se; s+= s_res) + { + if ((s_res= my_utf16_uni(cs, &s_wc, s, se)) < 0) + { + DBUG_ASSERT(0); + return 0; + } + if (s_wc != ' ') + return (s_wc < ' ') ? -swap : swap; + } + } + return res; +} + + +static uint +my_ismbchar_utf16(CHARSET_INFO *cs __attribute__((unused)), + const char *b __attribute__((unused)), + const char *e __attribute__((unused))) +{ + if (b + 2 > e) + return 0; + + if (MY_UTF16_HIGH_HEAD(*b)) + { + return (b + 4 <= e) && MY_UTF16_LOW_HEAD(b[2]) ? 4 : 0; + } + + if (MY_UTF16_LOW_HEAD(*b)) + return 0; + + return 2; +} + + +static uint +my_mbcharlen_utf16(CHARSET_INFO *cs __attribute__((unused)), + uint c __attribute__((unused))) +{ + return MY_UTF16_HIGH_HEAD(c) ? 4 : 2; +} + + +static size_t +my_numchars_utf16(CHARSET_INFO *cs, + const char *b, const char *e) +{ + size_t nchars= 0; + for ( ; ; nchars++) + { + size_t charlen= my_ismbchar_utf16(cs, b, e); + if (!charlen) + break; + b+= charlen; + } + return nchars; +} + + +static size_t +my_charpos_utf16(CHARSET_INFO *cs, + const char *b, const char *e, size_t pos) +{ + const char *b0= b; + uint charlen; + + for ( ; pos; b+= charlen, pos--) + { + if (!(charlen= my_ismbchar(cs, b, e))) + return (e + 2 - b0); /* Error, return pos outside the string */ + } + return (size_t) (pos ? (e + 2 - b0) : (b - b0)); +} + + +static size_t +my_well_formed_len_utf16(CHARSET_INFO *cs, + const char *b, const char *e, + size_t nchars, int *error) +{ + const char *b0= b; + uint charlen; + *error= 0; + + for ( ; nchars; b+= charlen, nchars--) + { + if (!(charlen= my_ismbchar(cs, b, e))) + { + *error= b < e ? 1 : 0; + break; + } + } + return (size_t) (b - b0); +} + + +static int +my_wildcmp_utf16_ci(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, + escape, w_one, w_many, uni_plane); +} + + +static int +my_wildcmp_utf16_bin(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, + escape, w_one, w_many, NULL); +} + + +static int +my_strnncoll_utf16_bin(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + int s_res,t_res; + my_wc_t s_wc,t_wc; + const uchar *se=s+slen; + const uchar *te=t+tlen; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while ( s < se && t < te ) + { + s_res= my_utf16_uni(cs,&s_wc, s, se); + t_res= my_utf16_uni(cs,&t_wc, t, te); + + if (s_res <= 0 || t_res <= 0) + { + /* Incorrect string, compare by char value */ + return my_bincmp(s, se, t, te); + } + if (s_wc != t_wc) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + return (int) (t_is_prefix ? (t - te) : ((se - s) - (te - t))); +} + + +static int +my_strnncollsp_utf16_bin(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + int res; + my_wc_t s_wc, t_wc; + const uchar *se= s + slen, *te= t + tlen; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + DBUG_ASSERT((slen % 2) == 0); + DBUG_ASSERT((tlen % 2) == 0); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= FALSE; +#endif + + while (s < se && t < te) + { + int s_res= my_utf16_uni(cs, &s_wc, s, se); + int t_res= my_utf16_uni(cs, &t_wc, t, te); + + if (s_res <= 0 || t_res <= 0) + { + /* Incorrect string, compare bytewise */ + return my_bincmp(s, se, t, te); + } + + if (s_wc != t_wc) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + + slen= (size_t) (se - s); + tlen= (size_t) (te - t); + res= 0; + + if (slen != tlen) + { + int s_res, swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 's' is bigger */ + if (slen < tlen) + { + slen= tlen; + s= t; + se= te; + swap= -1; + res= -res; + } + + for ( ; s < se; s+= s_res) + { + if ((s_res= my_utf16_uni(cs, &s_wc, s, se)) < 0) + { + DBUG_ASSERT(0); + return 0; + } + if (s_wc != ' ') + return (s_wc < ' ') ? -swap : swap; + } + } + return res; +} + + +static void +my_hash_sort_utf16_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) +{ + const uchar *pos = key; + + key+= len; + + while (key > pos + 1 && key[-1] == ' ' && key[-2] == '\0') + key-= 2; + + for (; pos < (uchar*) key ; pos++) + { + nr1[0]^= (ulong) ((((uint) nr1[0] & 63) + nr2[0]) * + ((uint)*pos)) + (nr1[0] << 8); + nr2[0]+= 3; + } +} + + +/** + Calculate min_str and max_str that ranges a LIKE string. + + @param ptr Pointer to LIKE pattern. + @param ptr_length Length of LIKE pattern. + @param escape Escape character in LIKE. (Normally '\'). + All escape characters should be removed + from min_str and max_str. + @param res_length Length of min_str and max_str. + @param min_str Smallest case sensitive string that ranges LIKE. + Should be space padded to res_length. + @param max_str Largest case sensitive string that ranges LIKE. + Normally padded with the biggest character sort value. + + @return Optimization status. + @retval FALSE if LIKE pattern can be optimized + @rerval TRUE if LIKE can't be optimized. +*/ + +my_bool +my_like_range_utf16(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) +{ + const char *end=ptr+ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + size_t charlen= res_length / cs->mbmaxlen; + + for ( ; ptr + 1 < end && min_str + 1 < min_end && charlen > 0 + ; ptr+=2, charlen--) + { + if (ptr[0] == '\0' && ptr[1] == escape && ptr + 1 < end) + { + ptr+=2; /* Skip escape */ + *min_str++= *max_str++ = ptr[0]; + *min_str++= *max_str++ = ptr[1]; + continue; + } + if (ptr[0] == '\0' && ptr[1] == w_one) /* '_' in SQL */ + { + *min_str++= (char) (cs->min_sort_char >> 8); + *min_str++= (char) (cs->min_sort_char & 255); + *max_str++= (char) (cs->max_sort_char >> 8); + *max_str++= (char) (cs->max_sort_char & 255); + continue; + } + if (ptr[0] == '\0' && ptr[1] == w_many) /* '%' in SQL */ + { + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + do { + *min_str++ = 0; + *min_str++ = 0; + *max_str++ = (char) (cs->max_sort_char >> 8); + *max_str++ = (char) (cs->max_sort_char & 255); + } while (min_str + 1 < min_end); + return FALSE; + } + *min_str++= *max_str++ = ptr[0]; + *min_str++= *max_str++ = ptr[1]; + } + + /* Temporary fix for handling w_one at end of string (key compression) */ + { + char *tmp; + for (tmp= min_str ; tmp-1 > min_org && tmp[-1] == '\0' && tmp[-2]=='\0';) + { + *--tmp=' '; + *--tmp='\0'; + } + } + + *min_length= *max_length = (size_t) (min_str - min_org); + while (min_str + 1 < min_end) + { + *min_str++ = *max_str++ = '\0'; + *min_str++ = *max_str++ = ' '; /* Because if key compression */ + } + return FALSE; +} + + +static MY_COLLATION_HANDLER my_collation_utf16_general_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf16, + my_strnncollsp_utf16, + my_strnxfrm_unicode, + my_strnxfrmlen_simple, + my_like_range_utf16, + my_wildcmp_utf16_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf16, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_utf16_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf16_bin, + my_strnncollsp_utf16_bin, + my_strnxfrm_unicode, + my_strnxfrmlen_simple, + my_like_range_utf16, + my_wildcmp_utf16_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf16_bin, + my_propagate_simple +}; + + +MY_CHARSET_HANDLER my_charset_utf16_handler= +{ + NULL, /* init */ + my_ismbchar_utf16, /* ismbchar */ + my_mbcharlen_utf16, /* mbcharlen */ + my_numchars_utf16, + my_charpos_utf16, + my_well_formed_len_utf16, + my_lengthsp_mb2, + my_numcells_mb, + my_utf16_uni, /* mb_wc */ + my_uni_utf16, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb2_or_mb4, + my_casedn_str_mb2_or_mb4, + my_caseup_utf16, + my_casedn_utf16, + my_snprintf_mb2, + my_l10tostr_mb2_or_mb4, + my_ll10tostr_mb2_or_mb4, + my_fill_mb2, + my_strntol_mb2_or_mb4, + my_strntoul_mb2_or_mb4, + my_strntoll_mb2_or_mb4, + my_strntoull_mb2_or_mb4, + my_strntod_mb2_or_mb4, + my_strtoll10_mb2, + my_strntoull10rnd_mb2_or_mb4, + my_scan_mb2 +}; + + +CHARSET_INFO my_charset_utf16_general_ci= +{ + 54,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_general_ci", /* name */ + "UTF-16 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_general_ci_handler +}; + + +CHARSET_INFO my_charset_utf16_bin= +{ + 55,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, + "utf16", /* cs name */ + "utf16_bin", /* name */ + "UTF-16 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf16_handler, + &my_collation_utf16_bin_handler +}; + +#endif /* HAVE_CHARSET_utf16 */ + + +#ifdef HAVE_CHARSET_utf32 + +static int +my_utf32_uni(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e) +{ + if (s + 4 > e) + return MY_CS_TOOSMALL4; + *pwc= (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]); + return 4; +} + + +static int +my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + if (s + 4 > e) + return MY_CS_TOOSMALL4; + + s[0]= (uchar) (wc >> 24); + s[1]= (uchar) (wc >> 16) & 0xFF; + s[2]= (uchar) (wc >> 8) & 0xFF; + s[3]= (uchar) wc & 0xFF; + return 4; +} + + +static inline void +my_tolower_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256 && uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].tolower; +} + + +static inline void +my_toupper_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256 && uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].toupper; +} + + +static inline void +my_tosort_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256) + { + if (uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].sort; + } + else + { + *wc= REPLACEMENT_CHAR; + } +} + + +static size_t +my_caseup_utf32(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + my_wc_t wc; + int res; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((src < srcend) && + (res= my_utf32_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0) + { + my_toupper_utf32(uni_plane, &wc); + if (res != my_uni_utf32(cs, wc, (uchar*) src, (uchar*) srcend)) + break; + src+= res; + } + return srclen; +} + + +static inline void +my_hash_add(ulong *n1, ulong *n2, uint ch) +{ + n1[0]^= (((n1[0] & 63) + n2[0]) * (ch)) + (n1[0] << 8); + n2[0]+= 3; +} + + +static void +my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_wc_t wc; + int res; + const uchar *e= s + slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + /* Skip trailing spaces */ + while (e > s + 3 && e[-1] == ' ' && !e[-2] && !e[-3] && !e[-4]) + e-= 4; + + while ((res= my_utf32_uni(cs, &wc, (uchar*) s, (uchar*) e)) > 0) + { + my_tosort_utf32(uni_plane, &wc); + my_hash_add(n1, n2, (uint) (wc >> 24)); + my_hash_add(n1, n2, (uint) (wc >> 16) & 0xFF); + my_hash_add(n1, n2, (uint) (wc >> 8) & 0xFF); + my_hash_add(n1, n2, (uint) (wc & 0xFF)); + s+= res; + } +} + + +static size_t +my_casedn_utf32(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + my_wc_t wc; + int res; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((res= my_utf32_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) + { + my_tolower_utf32(uni_plane,&wc); + if (res != my_uni_utf32(cs, wc, (uchar*) src, (uchar*) srcend)) + break; + src+= res; + } + return srclen; +} + + +static int +my_strnncoll_utf32(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + my_wc_t s_wc,t_wc; + const uchar *se= s + slen; + const uchar *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while (s < se && t < te) + { + int s_res= my_utf32_uni(cs, &s_wc, s, se); + int t_res= my_utf32_uni(cs, &t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0) + { + /* Incorrect string, compare by char value */ + return my_bincmp(s, se, t, te); + } + + my_tosort_utf32(uni_plane, &s_wc); + my_tosort_utf32(uni_plane, &t_wc); + + if (s_wc != t_wc) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + return (int) (t_is_prefix ? (t - te) : ((se - s) - (te - t))); +} + + +/** + Compare strings, discarding end space + + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + @param cs Character set pinter. + @param a First string to compare. + @param a_length Length of 'a'. + @param b Second string to compare. + @param b_length Length of 'b'. + + IMPLEMENTATION + + @return Comparison result. + @retval Negative number, if a less than b. + @retval 0, if a is equal to b + @retval Positive number, if a > b +*/ + + +static int +my_strnncollsp_utf32(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + int res; + my_wc_t s_wc, t_wc; + const uchar *se= s + slen, *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + DBUG_ASSERT((slen % 4) == 0); + DBUG_ASSERT((tlen % 4) == 0); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= FALSE; +#endif + + while ( s < se && t < te ) + { + int s_res= my_utf32_uni(cs, &s_wc, s, se); + int t_res= my_utf32_uni(cs, &t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare bytewise */ + return my_bincmp(s, se, t, te); + } + + my_tosort_utf32(uni_plane, &s_wc); + my_tosort_utf32(uni_plane, &t_wc); + + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + + slen= (size_t) (se - s); + tlen= (size_t) (te - t); + res= 0; + + if (slen != tlen) + { + int s_res, swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 's' is bigger */ + if (slen < tlen) + { + slen= tlen; + s= t; + se= te; + swap= -1; + res= -res; + } + + for ( ; s < se; s+= s_res) + { + if ((s_res= my_utf32_uni(cs, &s_wc, s, se)) < 0) + { + DBUG_ASSERT(0); + return 0; + } + if (s_wc != ' ') + return (s_wc < ' ') ? -swap : swap; + } + } + return res; +} + + +static size_t +my_strnxfrmlen_utf32(CHARSET_INFO *cs __attribute__((unused)), size_t len) +{ + return len / 2; +} + + +static void +my_fill_utf32_for_strxfrm(CHARSET_INFO *cs __attribute__((unused)), + char *s, size_t slen, int fill) +{ + DBUG_ASSERT(fill <= 0xFFFF); + + for ( ; slen > 1; slen-= 2) + { + *s++= fill >> 8; + *s++= fill & 0xFF; + } + if (slen) + *s= 0x00; +} + + +size_t +my_strxfrm_pad_desc_and_reverse_utf32(CHARSET_INFO *cs, + uchar *str, uchar *frmend, uchar *strend, + uint nweights, uint flags, uint level) +{ + if (nweights && frmend < strend && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint fill_length= min((uint) (strend - frmend), nweights * 2); + my_fill_utf32_for_strxfrm(cs, (char*) frmend, fill_length, cs->pad_char); + frmend+= fill_length; + } + my_strxfrm_desc_and_reverse(str, frmend, flags, level); + return frmend - str; +} + + +static uint +my_ismbchar_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *b __attribute__((unused)), + const char *e __attribute__((unused))) +{ + return 4; +} + + +static uint +my_mbcharlen_utf32(CHARSET_INFO *cs __attribute__((unused)) , + uint c __attribute__((unused))) +{ + return 4; +} + + +static int +my_vsnprintf_utf32(char *dst, size_t n, const char* fmt, va_list ap) +{ + char *start= dst, *end= dst + n; + DBUG_ASSERT((n % 4) == 0); + for (; *fmt ; fmt++) + { + if (fmt[0] != '%') + { + if (dst >= end) /* End of buffer */ + break; + + *dst++= '\0'; + *dst++= '\0'; + *dst++= '\0'; + *dst++= *fmt; /* Copy ordinary char */ + continue; + } + + fmt++; + + /* Skip if max size is used (to be compatible with printf) */ + while ( (*fmt>='0' && *fmt<='9') || *fmt == '.' || *fmt == '-') + fmt++; + + if (*fmt == 'l') + fmt++; + + if (*fmt == 's') /* String parameter */ + { + reg2 char *par= va_arg(ap, char *); + size_t plen; + size_t left_len= (size_t)(end - dst); + if (!par) par= (char*)"(null)"; + plen= strlen(par); + if (left_len <= plen*4) + plen= left_len / 4 - 1; + + for ( ; plen ; plen--, dst+= 4, par++) + { + dst[0]= '\0'; + dst[1]= '\0'; + dst[2]= '\0'; + dst[3]= par[0]; + } + continue; + } + else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ + { + register int iarg; + char nbuf[16]; + char *pbuf= nbuf; + + if ((size_t) (end - dst) < 64) + break; + iarg= va_arg(ap, int); + if (*fmt == 'd') + int10_to_str((long) iarg, nbuf, -10); + else + int10_to_str((long) (uint) iarg,nbuf,10); + + for (; pbuf[0]; pbuf++) + { + *dst++= '\0'; + *dst++= '\0'; + *dst++= '\0'; + *dst++= *pbuf; + } + continue; + } + + /* We come here on '%%', unknown code or too long parameter */ + if (dst == end) + break; + *dst++= '\0'; + *dst++= '\0'; + *dst++= '\0'; + *dst++= '%'; /* % used as % or unknown code */ + } + + DBUG_ASSERT(dst < end); + *dst++= '\0'; + *dst++= '\0'; + *dst++= '\0'; + *dst++= '\0'; /* End of errmessage */ + return (size_t) (dst - start - 4); +} + + +static size_t +my_snprintf_utf32(CHARSET_INFO *cs __attribute__((unused)), + char* to, size_t n, const char* fmt, ...) +{ + va_list args; + va_start(args,fmt); + return my_vsnprintf_utf32(to, n, fmt, args); +} + + +static longlong +my_strtoll10_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *nptr, char **endptr, int *error) +{ + const char *s, *end, *start, *n_end, *true_end; + uchar c; + unsigned long i, j, k; + ulonglong li; + int negative; + ulong cutoff, cutoff2, cutoff3; + + s= nptr; + /* If fixed length string */ + if (endptr) + { + /* Make sure string length is even */ + end= s + ((*endptr - s) / 4) * 4; + while (s < end && !s[0] && !s[1] && !s[2] && + (s[3] == ' ' || s[3] == '\t')) + s+= 4; + if (s == end) + goto no_conv; + } + else + { + /* We don't support null terminated strings in UCS2 */ + goto no_conv; + } + + /* Check for a sign. */ + negative= 0; + if (!s[0] && !s[1] && !s[2] && s[3] == '-') + { + *error= -1; /* Mark as negative number */ + negative= 1; + s+= 4; + if (s == end) + goto no_conv; + cutoff= MAX_NEGATIVE_NUMBER / LFACTOR2; + cutoff2= (MAX_NEGATIVE_NUMBER % LFACTOR2) / 100; + cutoff3= MAX_NEGATIVE_NUMBER % 100; + } + else + { + *error= 0; + if (!s[0] && !s[1] && !s[2] && s[3] == '+') + { + s+= 4; + if (s == end) + goto no_conv; + } + cutoff= ULONGLONG_MAX / LFACTOR2; + cutoff2= ULONGLONG_MAX % LFACTOR2 / 100; + cutoff3= ULONGLONG_MAX % 100; + } + + /* Handle case where we have a lot of pre-zero */ + if (!s[0] && !s[1] && !s[2] && s[3] == '0') + { + i= 0; + do + { + s+= 4; + if (s == end) + goto end_i; /* Return 0 */ + } + while (!s[0] && !s[1] && !s[2] && s[3] == '0'); + n_end= s + 4 * INIT_CNT; + } + else + { + /* Read first digit to check that it's a valid number */ + if (s[0] || s[1] || s[2] || (c= (s[3]-'0')) > 9) + goto no_conv; + i= c; + s+= 4; + n_end= s + 4 * (INIT_CNT-1); + } + + /* Handle first 9 digits and store them in i */ + if (n_end > end) + n_end= end; + for (; s != n_end ; s+= 4) + { + if (s[0] || s[1] || s[2] || (c= (s[3] - '0')) > 9) + goto end_i; + i= i * 10 + c; + } + if (s == end) + goto end_i; + + /* Handle next 9 digits and store them in j */ + j= 0; + start= s; /* Used to know how much to shift i */ + n_end= true_end= s + 4 * INIT_CNT; + if (n_end > end) + n_end= end; + do + { + if (s[0] || s[1] || s[2] || (c= (s[3] - '0')) > 9) + goto end_i_and_j; + j= j * 10 + c; + s+= 4; + } while (s != n_end); + if (s == end) + { + if (s != true_end) + goto end_i_and_j; + goto end3; + } + if (s[0] || s[1] || s[2] || (c= (s[3] - '0')) > 9) + goto end3; + + /* Handle the next 1 or 2 digits and store them in k */ + k=c; + s+= 4; + if (s == end || s[0] || s[1] || s[2] || (c= (s[3]-'0')) > 9) + goto end4; + k= k * 10 + c; + s+= 2; + *endptr= (char*) s; + + /* number string should have ended here */ + if (s != end && !s[0] && !s[1] && !s[2] && (c= (s[3] - '0')) <= 9) + goto overflow; + + /* Check that we didn't get an overflow with the last digit */ + if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) && + k > cutoff3))) + goto overflow; + li= i * LFACTOR2+ (ulonglong) j * 100 + k; + return (longlong) li; + +overflow: /* *endptr is set here */ + *error= MY_ERRNO_ERANGE; + return negative ? LONGLONG_MIN : (longlong) ULONGLONG_MAX; + +end_i: + *endptr= (char*) s; + return (negative ? ((longlong) -(long) i) : (longlong) i); + +end_i_and_j: + li= (ulonglong) i * lfactor[(size_t) (s-start) / 4] + j; + *endptr= (char*) s; + return (negative ? -((longlong) li) : (longlong) li); + +end3: + li= (ulonglong) i*LFACTOR+ (ulonglong) j; + *endptr= (char*) s; + return (negative ? -((longlong) li) : (longlong) li); + +end4: + li= (ulonglong) i*LFACTOR1+ (ulonglong) j * 10 + k; + *endptr= (char*) s; + if (negative) + { + if (li > MAX_NEGATIVE_NUMBER) + goto overflow; + return -((longlong) li); + } + return (longlong) li; + +no_conv: + /* There was no number to convert. */ + *error= MY_ERRNO_EDOM; + *endptr= (char *) nptr; + return 0; +} + + +static size_t +my_numchars_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e) +{ + return (size_t) (e - b) / 4; +} + + +static size_t +my_charpos_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, size_t pos) +{ + size_t string_length= (size_t) (e - b); + return pos * 4 > string_length ? string_length + 4 : pos * 4; +} + + +static size_t +my_well_formed_len_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t nchars, int *error) +{ + /* Ensure string length is divisible by 4 */ + const char *b0= b; + size_t length= e - b; + DBUG_ASSERT((length % 4) == 0); + *error= 0; + nchars*= 4; + if (length > nchars) + { + length= nchars; + e= b + nchars; + } + for (; b < e; b+= 4) + { + /* Don't accept characters greater than U+10FFFF */ + if (b[0] || (uchar) b[1] > 0x10) + { + *error= 1; + return b - b0; + } + } + return length; +} + + +static +void my_fill_utf32(CHARSET_INFO *cs, + char *s, size_t slen, int fill) +{ + char buf[10]; + uint buflen; + char *e= s + slen; + + DBUG_ASSERT((slen % 4) == 0); + + buflen= cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf, + (uchar*) buf + sizeof(buf)); + DBUG_ASSERT(buflen == 4); + while (s < e) + { + memcpy(s, buf, 4); + s+= 4; + } +} + + +static size_t +my_lengthsp_utf32(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr, size_t length) +{ + const char *end= ptr + length; + DBUG_ASSERT((length % 4) == 0); + while (end > ptr + 3 && end[-1] == ' ' && !end[-2] && !end[-3] && !end[-4]) + end-= 4; + return (size_t) (end - ptr); +} + + +static int +my_wildcmp_utf32_ci(CHARSET_INFO *cs, + const char *str, const char *str_end, + const char *wildstr, const char *wildend, + int escape, int w_one, int w_many) +{ + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, + escape, w_one, w_many, uni_plane); +} + + +static int +my_wildcmp_utf32_bin(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, + escape, w_one, w_many, NULL); +} + + +static int +my_strnncoll_utf32_bin(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + my_wc_t s_wc, t_wc; + const uchar *se= s + slen; + const uchar *te= t + tlen; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while (s < se && t < te) + { + int s_res= my_utf32_uni(cs, &s_wc, s, se); + int t_res= my_utf32_uni(cs, &t_wc, t, te); + + if (s_res <= 0 || t_res <= 0) + { + /* Incorrect string, compare by char value */ + return my_bincmp(s, se, t, te); + } + if (s_wc != t_wc) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + return (int) (t_is_prefix ? (t-te) : ((se - s) - (te - t))); +} + + +static inline my_wc_t +my_utf32_get(const uchar *s) +{ + return + ((my_wc_t) s[0] << 24) + + ((my_wc_t) s[1] << 16) + + ((my_wc_t) s[2] << 8) + + s[3]; +} + + +static int +my_strnncollsp_utf32_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + const uchar *se, *te; + size_t minlen; + + DBUG_ASSERT((slen % 4) == 0); + DBUG_ASSERT((tlen % 4) == 0); + + se= s + slen; + te= t + tlen; + + for (minlen= min(slen, tlen); minlen; minlen-= 4) + { + my_wc_t s_wc= my_utf32_get(s); + my_wc_t t_wc= my_utf32_get(t); + if (s_wc != t_wc) + return s_wc > t_wc ? 1 : -1; + + s+= 4; + t+= 4; + } + + if (slen != tlen) + { + int swap= 1; + if (slen < tlen) + { + s= t; + se= te; + swap= -1; + } + + for ( ; s < se ; s+= 4) + { + my_wc_t s_wc= my_utf32_get(s); + if (s_wc != ' ') + return (s_wc < ' ') ? -swap : swap; + } + } + return 0; +} + + +/** + Calculate min_str and max_str that ranges a LIKE string. + + @param ptr Pointer to LIKE pattern. + @param ptr_length Length of LIKE pattern. + @param escape Escape character in LIKE. (Normally '\'). + All escape characters should be removed + from min_str and max_str. + @param res_length Length of min_str and max_str. + @param min_str Smallest case sensitive string that ranges LIKE. + Should be space padded to res_length. + @param max_str Largest case sensitive string that ranges LIKE. + Normally padded with the biggest character sort value. + + @return Optimization status. + @retval FALSE if LIKE pattern can be optimized + @rerval TRUE if LIKE can't be optimized. +*/ + +my_bool +my_like_range_utf32(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) +{ + const char *end= ptr + ptr_length; + char *min_org= min_str; + char *min_end= min_str + res_length; + char *max_end= max_str + res_length; + size_t charlen= res_length / cs->mbmaxlen; + + DBUG_ASSERT((res_length % 4) == 0); + + for ( ; charlen > 0; ptr+= 4, charlen--) + { + my_wc_t wc; + int res; + if ((res= my_utf32_uni(cs, &wc, ptr, end)) < 0) + { + my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char); + my_fill_utf32(cs, max_str, min_end - min_str, cs->max_sort_char); + /* min_length and max_legnth are not important */ + return TRUE; + } + + if (wc == (my_wc_t) escape) + { + ptr+= 4; /* Skip escape */ + if ((res= my_utf32_uni(cs, &wc, ptr, end)) < 0) + { + my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char); + my_fill_utf32(cs, max_str, max_end - min_str, cs->max_sort_char); + /* min_length and max_length are not important */ + return TRUE; + } + if (my_uni_utf32(cs, wc, min_str, min_end) != 4 || + my_uni_utf32(cs, wc, max_str, max_end) != 4) + goto pad_set_lengths; + *min_str++= 4; + *max_str++= 4; + continue; + } + + if (wc == (my_wc_t) w_one) + { + if (my_uni_utf32(cs, cs->min_sort_char, min_str, min_end) != 4 || + my_uni_utf32(cs, cs->max_sort_char, max_str, max_end) != 4) + goto pad_set_lengths; + min_str+= 4; + max_str+= 4; + continue; + } + + if (wc == (my_wc_t) w_many) + { + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? + (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + goto pad_min_max; + } + + /* Normal character */ + if (my_uni_utf32(cs, wc, min_str, min_end) != 4 || + my_uni_utf32(cs, wc, max_str, max_end) != 4) + goto pad_set_lengths; + min_str+= 4; + max_str+= 4; + } + +pad_set_lengths: + *min_length= *max_length= (size_t) (min_str - min_org); + +pad_min_max: + my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char); + my_fill_utf32(cs, max_str, max_end - max_str, cs->max_sort_char); + return FALSE; +} + + +static size_t +my_scan_utf32(CHARSET_INFO *cs, + const char *str, const char *end, int sequence_type) +{ + const char *str0= str; + + switch (sequence_type) + { + case MY_SEQ_SPACES: + for ( ; str < end; ) + { + my_wc_t wc; + int res= my_utf32_uni(cs, &wc, str, end); + if (res < 0 || wc != ' ') + break; + str+= res; + } + return (size_t) (str - str0); + default: + return 0; + } +} + + +static MY_COLLATION_HANDLER my_collation_utf32_general_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf32, + my_strnncollsp_utf32, + my_strnxfrm_unicode, + my_strnxfrmlen_utf32, + my_like_range_utf32, + my_wildcmp_utf32_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf32, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_utf32_bin_handler = +{ + NULL, /* init */ + my_strnncoll_utf32_bin, + my_strnncollsp_utf32_bin, + my_strnxfrm_unicode, + my_strnxfrmlen_utf32, + my_like_range_utf32, + my_wildcmp_utf32_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_utf32, + my_propagate_simple +}; + + +MY_CHARSET_HANDLER my_charset_utf32_handler= +{ + NULL, /* init */ + my_ismbchar_utf32, + my_mbcharlen_utf32, + my_numchars_utf32, + my_charpos_utf32, + my_well_formed_len_utf32, + my_lengthsp_utf32, + my_numcells_mb, + my_utf32_uni, + my_uni_utf32, + my_mb_ctype_mb, + my_caseup_str_mb2_or_mb4, + my_casedn_str_mb2_or_mb4, + my_caseup_utf32, + my_casedn_utf32, + my_snprintf_utf32, + my_l10tostr_mb2_or_mb4, + my_ll10tostr_mb2_or_mb4, + my_fill_utf32, + my_strntol_mb2_or_mb4, + my_strntoul_mb2_or_mb4, + my_strntoll_mb2_or_mb4, + my_strntoull_mb2_or_mb4, + my_strntod_mb2_or_mb4, + my_strtoll10_utf32, + my_strntoull10rnd_mb2_or_mb4, + my_scan_utf32 +}; + + +CHARSET_INFO my_charset_utf32_general_ci= +{ + 60,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* cs name */ + "utf32_general_ci", /* name */ + "UTF-32 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_general_ci_handler +}; + + +CHARSET_INFO my_charset_utf32_bin= +{ + 61,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, + "utf32", /* cs name */ + "utf32_bin", /* name */ + "UTF-32 Unicode", /* comment */ + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf32_handler, + &my_collation_utf32_bin_handler +}; + + +#endif /* HAVE_CHARSET_utf32 */ + + +#ifdef HAVE_CHARSET_ucs2 + +static uchar ctype_ucs2[] = { + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static uchar to_lower_ucs2[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + +static uchar to_upper_ucs2[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + + +static int my_ucs2_uni(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t * pwc, const uchar *s, const uchar *e) +{ + if (s+2 > e) /* Need 2 characters */ + return MY_CS_TOOSMALL2; + + *pwc= ((uchar)s[0]) * 256 + ((uchar)s[1]); + return 2; +} + +static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) , + my_wc_t wc, uchar *r, uchar *e) +{ + if ( r+2 > e ) + return MY_CS_TOOSMALL2; + + r[0]= (uchar) (wc >> 8); + r[1]= (uchar) (wc & 0xFF); + return 2; +} + + +static size_t my_caseup_ucs2(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + my_wc_t wc; + int res; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((src < srcend) && + (res= my_ucs2_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0) + { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; + if (res != my_uni_ucs2(cs, wc, (uchar*) src, (uchar*) srcend)) + break; + src+= res; + } + return srclen; +} + + +static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_wc_t wc; + int res; + const uchar *e=s+slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + while (e > s+1 && e[-1] == ' ' && e[-2] == '\0') + e-= 2; + + while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0) + { + int plane = (wc>>8) & 0xFF; + wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc; + n1[0]^= (((n1[0] & 63)+n2[0])*(wc & 0xFF))+ (n1[0] << 8); + n2[0]+=3; + n1[0]^= (((n1[0] & 63)+n2[0])*(wc >> 8))+ (n1[0] << 8); + n2[0]+=3; + s+=res; + } +} + + +static size_t my_casedn_ucs2(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst __attribute__((unused)), + size_t dstlen __attribute__((unused))) +{ + my_wc_t wc; + int res; + char *srcend= src + srclen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src == dst && srclen == dstlen); + + while ((src < srcend) && + (res= my_ucs2_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) + { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; + if (res != my_uni_ucs2(cs, wc, (uchar*) src, (uchar*) srcend)) + break; + src+= res; + } + return srclen; +} + + +static int my_strnncoll_ucs2(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + int s_res,t_res; + my_wc_t s_wc,t_wc; + const uchar *se=s+slen; + const uchar *te=t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + + while ( s < se && t < te ) + { + int plane; + s_res=my_ucs2_uni(cs,&s_wc, s, se); + t_res=my_ucs2_uni(cs,&t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare by char value */ + return ((int)s[0]-(int)t[0]); + } + + plane=(s_wc>>8) & 0xFF; + s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc; + plane=(t_wc>>8) & 0xFF; + t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc; + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+=s_res; + t+=t_res; + } + return (int) (t_is_prefix ? t-te : ((se-s) - (te-t))); +} + + +/** + Compare strings, discarding end space + + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + @param cs Character set pinter. + @param a First string to compare. + @param a_length Length of 'a'. + @param b Second string to compare. + @param b_length Length of 'b'. + + IMPLEMENTATION + + @return Comparison result. + @retval Negative number, if a less than b. + @retval 0, if a is equal to b + @retval Positive number, if a > b +*/ + +static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + const uchar *se, *te; + size_t minlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + /* extra safety to make sure the lengths are even numbers */ + slen&= ~1; + tlen&= ~1; + + se= s + slen; + te= t + tlen; + + for (minlen= min(slen, tlen); minlen; minlen-= 2) + { + int s_wc = uni_plane[s[0]] ? (int) uni_plane[s[0]][s[1]].sort : + (((int) s[0]) << 8) + (int) s[1]; + + int t_wc = uni_plane[t[0]] ? (int) uni_plane[t[0]][t[1]].sort : + (((int) t[0]) << 8) + (int) t[1]; + if ( s_wc != t_wc ) + return s_wc > t_wc ? 1 : -1; + + s+= 2; + t+= 2; + } + + if (slen != tlen) + { + int swap= 1; + if (slen < tlen) + { + s= t; + se= te; + swap= -1; + } + + for ( ; s < se ; s+= 2) + { + if (s[0] || s[1] != ' ') + return (s[0] == 0 && s[1] < ' ') ? -swap : swap; + } + } + return 0; +} + + +static uint my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *b __attribute__((unused)), + const char *e __attribute__((unused))) +{ + return 2; +} + + +static uint my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) , + uint c __attribute__((unused))) +{ + return 2; +} + + +static +size_t my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e) +{ + return (size_t) (e-b)/2; +} + + +static +size_t my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, size_t pos) +{ + size_t string_length= (size_t) (e - b); + return pos > string_length ? string_length + 2 : pos * 2; +} + + +static +size_t my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, + size_t nchars, int *error) +{ + /* Ensure string length is dividable with 2 */ + size_t nbytes= ((size_t) (e-b)) & ~(size_t) 1; + *error= 0; + nchars*= 2; + return min(nbytes, nchars); +} + + +static +int my_wildcmp_ucs2_ci(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, + escape,w_one,w_many,uni_plane); +} + + +static +int my_wildcmp_ucs2_bin(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, + escape,w_one,w_many,NULL); +} + + +static +int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + int s_res,t_res; + my_wc_t s_wc,t_wc; + const uchar *se=s+slen; + const uchar *te=t+tlen; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while ( s < se && t < te ) + { + s_res=my_ucs2_uni(cs,&s_wc, s, se); + t_res=my_ucs2_uni(cs,&t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare by char value */ + return ((int)s[0]-(int)t[0]); + } + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+=s_res; + t+=t_res; + } + return (int) (t_is_prefix ? t-te : ((se-s) - (te-t))); +} + +static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + const uchar *se, *te; + size_t minlen; + + /* extra safety to make sure the lengths are even numbers */ + slen= (slen >> 1) << 1; + tlen= (tlen >> 1) << 1; + + se= s + slen; + te= t + tlen; + + for (minlen= min(slen, tlen); minlen; minlen-= 2) + { + int s_wc= s[0] * 256 + s[1]; + int t_wc= t[0] * 256 + t[1]; + if ( s_wc != t_wc ) + return s_wc > t_wc ? 1 : -1; + + s+= 2; + t+= 2; + } + + if (slen != tlen) + { + int swap= 1; + if (slen < tlen) + { + s= t; + se= te; + swap= -1; + } + + for ( ; s < se ; s+= 2) + { + if (s[0] || s[1] != ' ') + return (s[0] == 0 && s[1] < ' ') ? -swap : swap; + } + } + return 0; +} + + +static +void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), + const uchar *key, size_t len,ulong *nr1, ulong *nr2) +{ + const uchar *pos = key; + + key+= len; + + while (key > pos+1 && key[-1] == ' ' && key[-2] == '\0') + key-= 2; + + for (; pos < (uchar*) key ; pos++) + { + nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * + ((uint)*pos)) + (nr1[0] << 8); + nr2[0]+=3; + } +} + + +/** + Calculate min_str and max_str that ranges a LIKE string. + + @param ptr Pointer to LIKE pattern. + @param ptr_length Length of LIKE pattern. + @param escape Escape character in LIKE. (Normally '\'). + All escape characters should be removed + from min_str and max_str. + @param res_length Length of min_str and max_str. + @param min_str Smallest case sensitive string that ranges LIKE. + Should be space padded to res_length. + @param max_str Largest case sensitive string that ranges LIKE. + Normally padded with the biggest character sort value. + + @return Optimization status. + @retval FALSE if LIKE pattern can be optimized + @rerval TRUE if LIKE can't be optimized. +*/ + +my_bool my_like_range_ucs2(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str,char *max_str, + size_t *min_length,size_t *max_length) +{ + const char *end=ptr+ptr_length; + char *min_org=min_str; + char *min_end=min_str+res_length; + size_t charlen= res_length / cs->mbmaxlen; + const char *contraction_flags= cs->contractions ? + ((const char*) cs->contractions) + 0x40*0x40 : NULL; + + for ( ; ptr + 1 < end && min_str + 1 < min_end && charlen > 0 + ; ptr+=2, charlen--) + { + if (ptr[0] == '\0' && ptr[1] == escape && ptr + 1 < end) + { + ptr+=2; /* Skip escape */ + *min_str++= *max_str++ = ptr[0]; + *min_str++= *max_str++ = ptr[1]; + continue; + } + if (ptr[0] == '\0' && ptr[1] == w_one) /* '_' in SQL */ + { + *min_str++= (char) (cs->min_sort_char >> 8); + *min_str++= (char) (cs->min_sort_char & 255); + *max_str++= (char) (cs->max_sort_char >> 8); + *max_str++= (char) (cs->max_sort_char & 255); + continue; + } + if (ptr[0] == '\0' && ptr[1] == w_many) /* '%' in SQL */ + { +fill_max_and_min: + /* + Calculate length of keys: + 'a\0\0... is the smallest possible string when we have space expand + a\ff\ff... is the biggest possible string + */ + *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) : + res_length); + *max_length= res_length; + do { + *min_str++ = 0; + *min_str++ = 0; + *max_str++ = (char) (cs->max_sort_char >> 8); + *max_str++ = (char) (cs->max_sort_char & 255); + } while (min_str + 1 < min_end); + return FALSE; + } + + if (contraction_flags && ptr + 3 < end && + ptr[0] == '\0' && contraction_flags[(uchar) ptr[1]]) + { + /* Contraction head found */ + if (ptr[2] == '\0' && (ptr[3] == w_one || ptr[3] == w_many)) + { + /* Contraction head followed by a wildcard, quit */ + goto fill_max_and_min; + } + + /* + Check if the second letter can be contraction part, + and if two letters really produce a contraction. + */ + if (ptr[2] == '\0' && contraction_flags[(uchar) ptr[3]] && + cs->contractions[(ptr[1]-0x40)*0x40 + ptr[3] - 0x40]) + { + /* Contraction found */ + if (charlen == 1 || min_str + 2 >= min_end) + { + /* Full contraction doesn't fit, quit */ + goto fill_max_and_min; + } + + /* Put contraction head */ + *min_str++= *max_str++= *ptr++; + *min_str++= *max_str++= *ptr++; + charlen--; + } + } + /* Put contraction tail, or a single character */ + *min_str++= *max_str++ = ptr[0]; + *min_str++= *max_str++ = ptr[1]; + } + + /* Temporary fix for handling w_one at end of string (key compression) */ + { + char *tmp; + for (tmp= min_str ; tmp-1 > min_org && tmp[-1] == '\0' && tmp[-2]=='\0';) + { + *--tmp=' '; + *--tmp='\0'; + } + } + + *min_length= *max_length = (size_t) (min_str - min_org); + while (min_str + 1 < min_end) + { + *min_str++ = *max_str++ = '\0'; + *min_str++ = *max_str++ = ' '; /* Because if key compression */ + } + return FALSE; +} + + +static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = +{ + NULL, /* init */ + my_strnncoll_ucs2, + my_strnncollsp_ucs2, + my_strnxfrm_unicode, + my_strnxfrmlen_simple, + my_like_range_ucs2, + my_wildcmp_ucs2_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_ucs2, + my_propagate_simple +}; + + +static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = +{ + NULL, /* init */ + my_strnncoll_ucs2_bin, + my_strnncollsp_ucs2_bin, + my_strnxfrm_unicode, + my_strnxfrmlen_simple, + my_like_range_ucs2, + my_wildcmp_ucs2_bin, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_ucs2_bin, + my_propagate_simple +}; + + +MY_CHARSET_HANDLER my_charset_ucs2_handler= +{ + NULL, /* init */ + my_ismbchar_ucs2, /* ismbchar */ + my_mbcharlen_ucs2, /* mbcharlen */ + my_numchars_ucs2, + my_charpos_ucs2, + my_well_formed_len_ucs2, + my_lengthsp_mb2, + my_numcells_mb, + my_ucs2_uni, /* mb_wc */ + my_uni_ucs2, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb2_or_mb4, + my_casedn_str_mb2_or_mb4, + my_caseup_ucs2, + my_casedn_ucs2, + my_snprintf_mb2, + my_l10tostr_mb2_or_mb4, + my_ll10tostr_mb2_or_mb4, + my_fill_mb2, + my_strntol_mb2_or_mb4, + my_strntoul_mb2_or_mb4, + my_strntoll_mb2_or_mb4, + my_strntoull_mb2_or_mb4, + my_strntod_mb2_or_mb4, + my_strtoll10_mb2, + my_strntoull10rnd_mb2_or_mb4, + my_scan_mb2 +}; + + +CHARSET_INFO my_charset_ucs2_general_ci= +{ + 35,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_general_ci", /* name */ + "UCS-2 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_ucs2, /* ctype */ + to_lower_ucs2, /* to_lower */ + to_upper_ucs2, /* to_upper */ + to_upper_ucs2, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_general_ci_handler +}; + +CHARSET_INFO my_charset_ucs2_bin= +{ + 90,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_bin", /* name */ + "UCS-2 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_ucs2, /* ctype */ + to_lower_ucs2, /* to_lower */ + to_upper_ucs2, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_ucs2_handler, + &my_collation_ucs2_bin_handler +}; + + +#endif /* HAVE_CHARSET_ucs2 */ diff --git a/externals/mysql/strings/ctype-ujis.c b/externals/mysql/strings/ctype-ujis.c new file mode 100644 index 00000000000..bdcc3f80047 --- /dev/null +++ b/externals/mysql/strings/ctype-ujis.c @@ -0,0 +1,8616 @@ +/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* This file is for Japanese EUC charset, and created by tommy@valley.ne.jp. + */ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. mbmaxlen_ujis=3 + */ + +#include +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_ujis + + +static uchar NEAR ctype_ujis[257] = +{ + 0, /* For standard library */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ + 0040, 0050, 0050, 0050, 0050, 0050, 0040, 0040, /* ^H - ^O */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^P - ^W */ + 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* ^X - ^Z ^[ ^\ ^] ^^ ^_ */ + 0110, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* SPC ! " # $ % ^ ' */ + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, /* ( ) * + , - . / */ + 0204, 0204, 0204, 0204, 0204, 0204, 0204, 0204, /* 0 1 2 3 4 5 6 7 */ + 0204, 0204, 0020, 0020, 0020, 0020, 0020, 0020, /* 8 9 : ; < = > ? */ + 0020, 0201, 0201, 0201, 0201, 0201, 0201, 0001, /* @ A B C D E F G */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* H I J K L M N O */ + 0001, 0001, 0001, 0001, 0001, 0001, 0001, 0001, /* P Q R S T U V W */ + 0001, 0001, 0001, 0020, 0020, 0020, 0020, 0020, /* X Y Z [ \ ] ^ _ */ + 0020, 0202, 0202, 0202, 0202, 0202, 0202, 0002, /* ` a b c d e f g */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* h i j k l m n o */ + 0002, 0002, 0002, 0002, 0002, 0002, 0002, 0002, /* p q r s t u v w */ + 0002, 0002, 0002, 0020, 0020, 0020, 0020, 0040, /* x y z { | } + DEL */ + 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, + 0000, 0000, 0000, 0000, 0000, 0000, 0020, 0020, + 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, + 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, + 0000, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0020, + 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, +}; + +static uchar NEAR to_lower_ujis[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR to_upper_ujis[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' +}; + +static uchar NEAR sort_order_ujis[]= +{ + '\000','\001','\002','\003','\004','\005','\006','\007', + '\010','\011','\012','\013','\014','\015','\016','\017', + '\020','\021','\022','\023','\024','\025','\026','\027', + '\030','\031','\032','\033','\034','\035','\036','\037', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '{', '|', '}', '~', '\177', + (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207', + (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217', + (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227', + (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237', + (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247', + (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257', + (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267', + (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277', + (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307', + (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317', + (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327', + (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337', + (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347', + (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357', + (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367', + (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375', (uchar) (uchar) '\376', (uchar) '\377' +}; + + +#define isujis(c) ((0xa1<=((c)&0xff) && ((c)&0xff)<=0xfe)) +#define iskata(c) ((0xa1<=((c)&0xff) && ((c)&0xff)<=0xdf)) +#define isujis_ss2(c) (((c)&0xff) == 0x8e) +#define isujis_ss3(c) (((c)&0xff) == 0x8f) + + +static uint ismbchar_ujis(CHARSET_INFO *cs __attribute__((unused)), + const char* p, const char *e) +{ + return ((*(uchar*)(p)<0x80)? 0:\ + isujis(*(p)) && (e)-(p)>1 && isujis(*((p)+1))? 2:\ + isujis_ss2(*(p)) && (e)-(p)>1 && iskata(*((p)+1))? 2:\ + isujis_ss3(*(p)) && (e)-(p)>2 && isujis(*((p)+1)) && isujis(*((p)+2))? 3:\ + 0); +} + +static uint mbcharlen_ujis(CHARSET_INFO *cs __attribute__((unused)),uint c) +{ + return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 1); +} + + +static uint16 tab_jisx0201_uni[256]={ + 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x00A5,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x203E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67, +0xFF68,0xFF69,0xFF6A,0xFF6B,0xFF6C,0xFF6D,0xFF6E,0xFF6F, +0xFF70,0xFF71,0xFF72,0xFF73,0xFF74,0xFF75,0xFF76,0xFF77, +0xFF78,0xFF79,0xFF7A,0xFF7B,0xFF7C,0xFF7D,0xFF7E,0xFF7F, +0xFF80,0xFF81,0xFF82,0xFF83,0xFF84,0xFF85,0xFF86,0xFF87, +0xFF88,0xFF89,0xFF8A,0xFF8B,0xFF8C,0xFF8D,0xFF8E,0xFF8F, +0xFF90,0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97, +0xFF98,0xFF99,0xFF9A,0xFF9B,0xFF9C,0xFF9D,0xFF9E,0xFF9F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + + +static int +my_mb_wc_jisx0201(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *wc,const uchar *s, + const uchar *e __attribute__((unused))) +{ + wc[0]=tab_jisx0201_uni[*s]; + return (!wc[0] && s[0]) ? -1 : 1; +} + + +static int +my_wc_mb_jisx0201(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, + uchar *e __attribute__((unused))) +{ + + if ((int) wc <= 0x7D) + { + *s = (uchar) wc; + return (wc == 0x5C) ? MY_CS_ILUNI : 1; + } + + if (wc >= 0xFF61 && wc <= 0xFF9F) + { + *s = (uchar) (wc - 0xFEC0); + return 1; + } + + return MY_CS_ILUNI; +} + + +/* page 0 0x2121-0x217E */ +static uint16 tab_jisx0208_uni0[]={ +0x3000,0x3001,0x3002,0xFF0C,0xFF0E,0x30FB,0xFF1A,0xFF1B, +0xFF1F,0xFF01,0x309B,0x309C,0x00B4,0xFF40,0x00A8,0xFF3E, +0xFFE3,0xFF3F,0x30FD,0x30FE,0x309D,0x309E,0x3003,0x4EDD, +0x3005,0x3006,0x3007,0x30FC,0x2015,0x2010,0xFF0F,0x005C, +0x301C,0x2016,0xFF5C,0x2026,0x2025,0x2018,0x2019,0x201C, +0x201D,0xFF08,0xFF09,0x3014,0x3015,0xFF3B,0xFF3D,0xFF5B, +0xFF5D,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E, +0x300F,0x3010,0x3011,0xFF0B,0x2212,0x00B1,0x00D7,0x00F7, +0xFF1D,0x2260,0xFF1C,0xFF1E,0x2266,0x2267,0x221E,0x2234, +0x2642,0x2640,0x00B0,0x2032,0x2033,0x2103,0xFFE5,0xFF04, +0x00A2,0x00A3,0xFF05,0xFF03,0xFF06,0xFF0A,0xFF20,0x00A7, +0x2606,0x2605,0x25CB,0x25CF,0x25CE,0x25C7}; + +/* page 1 0x2221-0x227E */ +static uint16 tab_jisx0208_uni1[]={ +0x25C6,0x25A1,0x25A0,0x25B3,0x25B2,0x25BD,0x25BC,0x203B, +0x3012,0x2192,0x2190,0x2191,0x2193,0x3013, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x2208,0x220B,0x2286,0x2287,0x2282,0x2283,0x222A, +0x2229, 0, 0, 0, 0, 0, 0, 0, + 0,0x2227,0x2228,0x00AC,0x21D2,0x21D4,0x2200,0x2203, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x2220,0x22A5,0x2312,0x2202,0x2207, +0x2261,0x2252,0x226A,0x226B,0x221A,0x223D,0x221D,0x2235, +0x222B,0x222C, 0, 0, 0, 0, 0, 0, + 0,0x212B,0x2030,0x266F,0x266D,0x266A,0x2020,0x2021, +0x00B6, 0, 0, 0, 0,0x25EF}; + +/* page 2 0x2330-0x237A */ +static uint16 tab_jisx0208_uni2[]={ +0xFF10,0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17, +0xFF18,0xFF19, 0, 0, 0, 0, 0, 0, + 0,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, +0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, +0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, +0xFF38,0xFF39,0xFF3A, 0, 0, 0, 0, 0, + 0,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47, +0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F, +0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0xFF57, +0xFF58,0xFF59,0xFF5A}; + +/* page 3 0x2421-0x2473 */ +static uint16 tab_jisx0208_uni3[]={ +0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048, +0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050, +0x3051,0x3052,0x3053,0x3054,0x3055,0x3056,0x3057,0x3058, +0x3059,0x305A,0x305B,0x305C,0x305D,0x305E,0x305F,0x3060, +0x3061,0x3062,0x3063,0x3064,0x3065,0x3066,0x3067,0x3068, +0x3069,0x306A,0x306B,0x306C,0x306D,0x306E,0x306F,0x3070, +0x3071,0x3072,0x3073,0x3074,0x3075,0x3076,0x3077,0x3078, +0x3079,0x307A,0x307B,0x307C,0x307D,0x307E,0x307F,0x3080, +0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088, +0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090, +0x3091,0x3092,0x3093}; + +/* page 4 0x2521-0x2576 */ +static uint16 tab_jisx0208_uni4[]={ +0x30A1,0x30A2,0x30A3,0x30A4,0x30A5,0x30A6,0x30A7,0x30A8, +0x30A9,0x30AA,0x30AB,0x30AC,0x30AD,0x30AE,0x30AF,0x30B0, +0x30B1,0x30B2,0x30B3,0x30B4,0x30B5,0x30B6,0x30B7,0x30B8, +0x30B9,0x30BA,0x30BB,0x30BC,0x30BD,0x30BE,0x30BF,0x30C0, +0x30C1,0x30C2,0x30C3,0x30C4,0x30C5,0x30C6,0x30C7,0x30C8, +0x30C9,0x30CA,0x30CB,0x30CC,0x30CD,0x30CE,0x30CF,0x30D0, +0x30D1,0x30D2,0x30D3,0x30D4,0x30D5,0x30D6,0x30D7,0x30D8, +0x30D9,0x30DA,0x30DB,0x30DC,0x30DD,0x30DE,0x30DF,0x30E0, +0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,0x30E8, +0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,0x30F0, +0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6}; + +/* page 5 0x2621-0x2658 */ +static uint16 tab_jisx0208_uni5[]={ +0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398, +0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,0x03A0, +0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9, + 0, 0, 0, 0, 0, 0, 0, 0, +0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8, +0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0, +0x03C1,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9 +}; + +/* page 6 0x2721-0x2771 */ +static uint16 tab_jisx0208_uni6[]={ +0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, +0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, +0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, +0x0427,0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E, +0x042F, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0451,0x0436, +0x0437,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, +0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446, +0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E, +0x044F}; + +/* page 7 0x2821-0x2840 */ +static uint16 tab_jisx0208_uni7[]={ +0x2500,0x2502,0x250C,0x2510,0x2518,0x2514,0x251C,0x252C, +0x2524,0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B, +0x2517,0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F, +0x2528,0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542 +}; + +/* page 8 0x3021-0x307E */ +static uint16 tab_jisx0208_uni8[]={ +0x4E9C,0x5516,0x5A03,0x963F,0x54C0,0x611B,0x6328,0x59F6, +0x9022,0x8475,0x831C,0x7A50,0x60AA,0x63E1,0x6E25,0x65ED, +0x8466,0x82A6,0x9BF5,0x6893,0x5727,0x65A1,0x6271,0x5B9B, +0x59D0,0x867B,0x98F4,0x7D62,0x7DBE,0x9B8E,0x6216,0x7C9F, +0x88B7,0x5B89,0x5EB5,0x6309,0x6697,0x6848,0x95C7,0x978D, +0x674F,0x4EE5,0x4F0A,0x4F4D,0x4F9D,0x5049,0x56F2,0x5937, +0x59D4,0x5A01,0x5C09,0x60DF,0x610F,0x6170,0x6613,0x6905, +0x70BA,0x754F,0x7570,0x79FB,0x7DAD,0x7DEF,0x80C3,0x840E, +0x8863,0x8B02,0x9055,0x907A,0x533B,0x4E95,0x4EA5,0x57DF, +0x80B2,0x90C1,0x78EF,0x4E00,0x58F1,0x6EA2,0x9038,0x7A32, +0x8328,0x828B,0x9C2F,0x5141,0x5370,0x54BD,0x54E1,0x56E0, +0x59FB,0x5F15,0x98F2,0x6DEB,0x80E4,0x852D}; + +/* page 9 0x3121-0x317E */ +static uint16 tab_jisx0208_uni9[]={ +0x9662,0x9670,0x96A0,0x97FB,0x540B,0x53F3,0x5B87,0x70CF, +0x7FBD,0x8FC2,0x96E8,0x536F,0x9D5C,0x7ABA,0x4E11,0x7893, +0x81FC,0x6E26,0x5618,0x5504,0x6B1D,0x851A,0x9C3B,0x59E5, +0x53A9,0x6D66,0x74DC,0x958F,0x5642,0x4E91,0x904B,0x96F2, +0x834F,0x990C,0x53E1,0x55B6,0x5B30,0x5F71,0x6620,0x66F3, +0x6804,0x6C38,0x6CF3,0x6D29,0x745B,0x76C8,0x7A4E,0x9834, +0x82F1,0x885B,0x8A60,0x92ED,0x6DB2,0x75AB,0x76CA,0x99C5, +0x60A6,0x8B01,0x8D8A,0x95B2,0x698E,0x53AD,0x5186,0x5712, +0x5830,0x5944,0x5BB4,0x5EF6,0x6028,0x63A9,0x63F4,0x6CBF, +0x6F14,0x708E,0x7114,0x7159,0x71D5,0x733F,0x7E01,0x8276, +0x82D1,0x8597,0x9060,0x925B,0x9D1B,0x5869,0x65BC,0x6C5A, +0x7525,0x51F9,0x592E,0x5965,0x5F80,0x5FDC}; + +/* page 10 0x3221-0x327E */ +static uint16 tab_jisx0208_uni10[]={ +0x62BC,0x65FA,0x6A2A,0x6B27,0x6BB4,0x738B,0x7FC1,0x8956, +0x9D2C,0x9D0E,0x9EC4,0x5CA1,0x6C96,0x837B,0x5104,0x5C4B, +0x61B6,0x81C6,0x6876,0x7261,0x4E59,0x4FFA,0x5378,0x6069, +0x6E29,0x7A4F,0x97F3,0x4E0B,0x5316,0x4EEE,0x4F55,0x4F3D, +0x4FA1,0x4F73,0x52A0,0x53EF,0x5609,0x590F,0x5AC1,0x5BB6, +0x5BE1,0x79D1,0x6687,0x679C,0x67B6,0x6B4C,0x6CB3,0x706B, +0x73C2,0x798D,0x79BE,0x7A3C,0x7B87,0x82B1,0x82DB,0x8304, +0x8377,0x83EF,0x83D3,0x8766,0x8AB2,0x5629,0x8CA8,0x8FE6, +0x904E,0x971E,0x868A,0x4FC4,0x5CE8,0x6211,0x7259,0x753B, +0x81E5,0x82BD,0x86FE,0x8CC0,0x96C5,0x9913,0x99D5,0x4ECB, +0x4F1A,0x89E3,0x56DE,0x584A,0x58CA,0x5EFB,0x5FEB,0x602A, +0x6094,0x6062,0x61D0,0x6212,0x62D0,0x6539}; + +/* page 11 0x3321-0x337E */ +static uint16 tab_jisx0208_uni11[]={ +0x9B41,0x6666,0x68B0,0x6D77,0x7070,0x754C,0x7686,0x7D75, +0x82A5,0x87F9,0x958B,0x968E,0x8C9D,0x51F1,0x52BE,0x5916, +0x54B3,0x5BB3,0x5D16,0x6168,0x6982,0x6DAF,0x788D,0x84CB, +0x8857,0x8A72,0x93A7,0x9AB8,0x6D6C,0x99A8,0x86D9,0x57A3, +0x67FF,0x86CE,0x920E,0x5283,0x5687,0x5404,0x5ED3,0x62E1, +0x64B9,0x683C,0x6838,0x6BBB,0x7372,0x78BA,0x7A6B,0x899A, +0x89D2,0x8D6B,0x8F03,0x90ED,0x95A3,0x9694,0x9769,0x5B66, +0x5CB3,0x697D,0x984D,0x984E,0x639B,0x7B20,0x6A2B,0x6A7F, +0x68B6,0x9C0D,0x6F5F,0x5272,0x559D,0x6070,0x62EC,0x6D3B, +0x6E07,0x6ED1,0x845B,0x8910,0x8F44,0x4E14,0x9C39,0x53F6, +0x691B,0x6A3A,0x9784,0x682A,0x515C,0x7AC3,0x84B2,0x91DC, +0x938C,0x565B,0x9D28,0x6822,0x8305,0x8431}; + +/* page 12 0x3421-0x347E */ +static uint16 tab_jisx0208_uni12[]={ +0x7CA5,0x5208,0x82C5,0x74E6,0x4E7E,0x4F83,0x51A0,0x5BD2, +0x520A,0x52D8,0x52E7,0x5DFB,0x559A,0x582A,0x59E6,0x5B8C, +0x5B98,0x5BDB,0x5E72,0x5E79,0x60A3,0x611F,0x6163,0x61BE, +0x63DB,0x6562,0x67D1,0x6853,0x68FA,0x6B3E,0x6B53,0x6C57, +0x6F22,0x6F97,0x6F45,0x74B0,0x7518,0x76E3,0x770B,0x7AFF, +0x7BA1,0x7C21,0x7DE9,0x7F36,0x7FF0,0x809D,0x8266,0x839E, +0x89B3,0x8ACC,0x8CAB,0x9084,0x9451,0x9593,0x9591,0x95A2, +0x9665,0x97D3,0x9928,0x8218,0x4E38,0x542B,0x5CB8,0x5DCC, +0x73A9,0x764C,0x773C,0x5CA9,0x7FEB,0x8D0B,0x96C1,0x9811, +0x9854,0x9858,0x4F01,0x4F0E,0x5371,0x559C,0x5668,0x57FA, +0x5947,0x5B09,0x5BC4,0x5C90,0x5E0C,0x5E7E,0x5FCC,0x63EE, +0x673A,0x65D7,0x65E2,0x671F,0x68CB,0x68C4}; + +/* page 13 0x3521-0x357E */ +static uint16 tab_jisx0208_uni13[]={ +0x6A5F,0x5E30,0x6BC5,0x6C17,0x6C7D,0x757F,0x7948,0x5B63, +0x7A00,0x7D00,0x5FBD,0x898F,0x8A18,0x8CB4,0x8D77,0x8ECC, +0x8F1D,0x98E2,0x9A0E,0x9B3C,0x4E80,0x507D,0x5100,0x5993, +0x5B9C,0x622F,0x6280,0x64EC,0x6B3A,0x72A0,0x7591,0x7947, +0x7FA9,0x87FB,0x8ABC,0x8B70,0x63AC,0x83CA,0x97A0,0x5409, +0x5403,0x55AB,0x6854,0x6A58,0x8A70,0x7827,0x6775,0x9ECD, +0x5374,0x5BA2,0x811A,0x8650,0x9006,0x4E18,0x4E45,0x4EC7, +0x4F11,0x53CA,0x5438,0x5BAE,0x5F13,0x6025,0x6551,0x673D, +0x6C42,0x6C72,0x6CE3,0x7078,0x7403,0x7A76,0x7AAE,0x7B08, +0x7D1A,0x7CFE,0x7D66,0x65E7,0x725B,0x53BB,0x5C45,0x5DE8, +0x62D2,0x62E0,0x6319,0x6E20,0x865A,0x8A31,0x8DDD,0x92F8, +0x6F01,0x79A6,0x9B5A,0x4EA8,0x4EAB,0x4EAC}; + +/* page 14 0x3621-0x367E */ +static uint16 tab_jisx0208_uni14[]={ +0x4F9B,0x4FA0,0x50D1,0x5147,0x7AF6,0x5171,0x51F6,0x5354, +0x5321,0x537F,0x53EB,0x55AC,0x5883,0x5CE1,0x5F37,0x5F4A, +0x602F,0x6050,0x606D,0x631F,0x6559,0x6A4B,0x6CC1,0x72C2, +0x72ED,0x77EF,0x80F8,0x8105,0x8208,0x854E,0x90F7,0x93E1, +0x97FF,0x9957,0x9A5A,0x4EF0,0x51DD,0x5C2D,0x6681,0x696D, +0x5C40,0x66F2,0x6975,0x7389,0x6850,0x7C81,0x50C5,0x52E4, +0x5747,0x5DFE,0x9326,0x65A4,0x6B23,0x6B3D,0x7434,0x7981, +0x79BD,0x7B4B,0x7DCA,0x82B9,0x83CC,0x887F,0x895F,0x8B39, +0x8FD1,0x91D1,0x541F,0x9280,0x4E5D,0x5036,0x53E5,0x533A, +0x72D7,0x7396,0x77E9,0x82E6,0x8EAF,0x99C6,0x99C8,0x99D2, +0x5177,0x611A,0x865E,0x55B0,0x7A7A,0x5076,0x5BD3,0x9047, +0x9685,0x4E32,0x6ADB,0x91E7,0x5C51,0x5C48}; + +/* page 15 0x3721-0x377E */ +static uint16 tab_jisx0208_uni15[]={ +0x6398,0x7A9F,0x6C93,0x9774,0x8F61,0x7AAA,0x718A,0x9688, +0x7C82,0x6817,0x7E70,0x6851,0x936C,0x52F2,0x541B,0x85AB, +0x8A13,0x7FA4,0x8ECD,0x90E1,0x5366,0x8888,0x7941,0x4FC2, +0x50BE,0x5211,0x5144,0x5553,0x572D,0x73EA,0x578B,0x5951, +0x5F62,0x5F84,0x6075,0x6176,0x6167,0x61A9,0x63B2,0x643A, +0x656C,0x666F,0x6842,0x6E13,0x7566,0x7A3D,0x7CFB,0x7D4C, +0x7D99,0x7E4B,0x7F6B,0x830E,0x834A,0x86CD,0x8A08,0x8A63, +0x8B66,0x8EFD,0x981A,0x9D8F,0x82B8,0x8FCE,0x9BE8,0x5287, +0x621F,0x6483,0x6FC0,0x9699,0x6841,0x5091,0x6B20,0x6C7A, +0x6F54,0x7A74,0x7D50,0x8840,0x8A23,0x6708,0x4EF6,0x5039, +0x5026,0x5065,0x517C,0x5238,0x5263,0x55A7,0x570F,0x5805, +0x5ACC,0x5EFA,0x61B2,0x61F8,0x62F3,0x6372}; + +/* page 16 0x3821-0x387E */ +static uint16 tab_jisx0208_uni16[]={ +0x691C,0x6A29,0x727D,0x72AC,0x732E,0x7814,0x786F,0x7D79, +0x770C,0x80A9,0x898B,0x8B19,0x8CE2,0x8ED2,0x9063,0x9375, +0x967A,0x9855,0x9A13,0x9E78,0x5143,0x539F,0x53B3,0x5E7B, +0x5F26,0x6E1B,0x6E90,0x7384,0x73FE,0x7D43,0x8237,0x8A00, +0x8AFA,0x9650,0x4E4E,0x500B,0x53E4,0x547C,0x56FA,0x59D1, +0x5B64,0x5DF1,0x5EAB,0x5F27,0x6238,0x6545,0x67AF,0x6E56, +0x72D0,0x7CCA,0x88B4,0x80A1,0x80E1,0x83F0,0x864E,0x8A87, +0x8DE8,0x9237,0x96C7,0x9867,0x9F13,0x4E94,0x4E92,0x4F0D, +0x5348,0x5449,0x543E,0x5A2F,0x5F8C,0x5FA1,0x609F,0x68A7, +0x6A8E,0x745A,0x7881,0x8A9E,0x8AA4,0x8B77,0x9190,0x4E5E, +0x9BC9,0x4EA4,0x4F7C,0x4FAF,0x5019,0x5016,0x5149,0x516C, +0x529F,0x52B9,0x52FE,0x539A,0x53E3,0x5411}; + +/* page 17 0x3921-0x397E */ +static uint16 tab_jisx0208_uni17[]={ +0x540E,0x5589,0x5751,0x57A2,0x597D,0x5B54,0x5B5D,0x5B8F, +0x5DE5,0x5DE7,0x5DF7,0x5E78,0x5E83,0x5E9A,0x5EB7,0x5F18, +0x6052,0x614C,0x6297,0x62D8,0x63A7,0x653B,0x6602,0x6643, +0x66F4,0x676D,0x6821,0x6897,0x69CB,0x6C5F,0x6D2A,0x6D69, +0x6E2F,0x6E9D,0x7532,0x7687,0x786C,0x7A3F,0x7CE0,0x7D05, +0x7D18,0x7D5E,0x7DB1,0x8015,0x8003,0x80AF,0x80B1,0x8154, +0x818F,0x822A,0x8352,0x884C,0x8861,0x8B1B,0x8CA2,0x8CFC, +0x90CA,0x9175,0x9271,0x783F,0x92FC,0x95A4,0x964D,0x9805, +0x9999,0x9AD8,0x9D3B,0x525B,0x52AB,0x53F7,0x5408,0x58D5, +0x62F7,0x6FE0,0x8C6A,0x8F5F,0x9EB9,0x514B,0x523B,0x544A, +0x56FD,0x7A40,0x9177,0x9D60,0x9ED2,0x7344,0x6F09,0x8170, +0x7511,0x5FFD,0x60DA,0x9AA8,0x72DB,0x8FBC}; + +/* page 18 0x3A21-0x3A7E */ +static uint16 tab_jisx0208_uni18[]={ +0x6B64,0x9803,0x4ECA,0x56F0,0x5764,0x58BE,0x5A5A,0x6068, +0x61C7,0x660F,0x6606,0x6839,0x68B1,0x6DF7,0x75D5,0x7D3A, +0x826E,0x9B42,0x4E9B,0x4F50,0x53C9,0x5506,0x5D6F,0x5DE6, +0x5DEE,0x67FB,0x6C99,0x7473,0x7802,0x8A50,0x9396,0x88DF, +0x5750,0x5EA7,0x632B,0x50B5,0x50AC,0x518D,0x6700,0x54C9, +0x585E,0x59BB,0x5BB0,0x5F69,0x624D,0x63A1,0x683D,0x6B73, +0x6E08,0x707D,0x91C7,0x7280,0x7815,0x7826,0x796D,0x658E, +0x7D30,0x83DC,0x88C1,0x8F09,0x969B,0x5264,0x5728,0x6750, +0x7F6A,0x8CA1,0x51B4,0x5742,0x962A,0x583A,0x698A,0x80B4, +0x54B2,0x5D0E,0x57FC,0x7895,0x9DFA,0x4F5C,0x524A,0x548B, +0x643E,0x6628,0x6714,0x67F5,0x7A84,0x7B56,0x7D22,0x932F, +0x685C,0x9BAD,0x7B39,0x5319,0x518A,0x5237}; + +/* page 19 0x3B21-0x3B7E */ +static uint16 tab_jisx0208_uni19[]={ +0x5BDF,0x62F6,0x64AE,0x64E6,0x672D,0x6BBA,0x85A9,0x96D1, +0x7690,0x9BD6,0x634C,0x9306,0x9BAB,0x76BF,0x6652,0x4E09, +0x5098,0x53C2,0x5C71,0x60E8,0x6492,0x6563,0x685F,0x71E6, +0x73CA,0x7523,0x7B97,0x7E82,0x8695,0x8B83,0x8CDB,0x9178, +0x9910,0x65AC,0x66AB,0x6B8B,0x4ED5,0x4ED4,0x4F3A,0x4F7F, +0x523A,0x53F8,0x53F2,0x55E3,0x56DB,0x58EB,0x59CB,0x59C9, +0x59FF,0x5B50,0x5C4D,0x5E02,0x5E2B,0x5FD7,0x601D,0x6307, +0x652F,0x5B5C,0x65AF,0x65BD,0x65E8,0x679D,0x6B62,0x6B7B, +0x6C0F,0x7345,0x7949,0x79C1,0x7CF8,0x7D19,0x7D2B,0x80A2, +0x8102,0x81F3,0x8996,0x8A5E,0x8A69,0x8A66,0x8A8C,0x8AEE, +0x8CC7,0x8CDC,0x96CC,0x98FC,0x6B6F,0x4E8B,0x4F3C,0x4F8D, +0x5150,0x5B57,0x5BFA,0x6148,0x6301,0x6642}; + +/* page 20 0x3C21-0x3C7E */ +static uint16 tab_jisx0208_uni20[]={ +0x6B21,0x6ECB,0x6CBB,0x723E,0x74BD,0x75D4,0x78C1,0x793A, +0x800C,0x8033,0x81EA,0x8494,0x8F9E,0x6C50,0x9E7F,0x5F0F, +0x8B58,0x9D2B,0x7AFA,0x8EF8,0x5B8D,0x96EB,0x4E03,0x53F1, +0x57F7,0x5931,0x5AC9,0x5BA4,0x6089,0x6E7F,0x6F06,0x75BE, +0x8CEA,0x5B9F,0x8500,0x7BE0,0x5072,0x67F4,0x829D,0x5C61, +0x854A,0x7E1E,0x820E,0x5199,0x5C04,0x6368,0x8D66,0x659C, +0x716E,0x793E,0x7D17,0x8005,0x8B1D,0x8ECA,0x906E,0x86C7, +0x90AA,0x501F,0x52FA,0x5C3A,0x6753,0x707C,0x7235,0x914C, +0x91C8,0x932B,0x82E5,0x5BC2,0x5F31,0x60F9,0x4E3B,0x53D6, +0x5B88,0x624B,0x6731,0x6B8A,0x72E9,0x73E0,0x7A2E,0x816B, +0x8DA3,0x9152,0x9996,0x5112,0x53D7,0x546A,0x5BFF,0x6388, +0x6A39,0x7DAC,0x9700,0x56DA,0x53CE,0x5468}; + +/* page 21 0x3D21-0x3D7E */ +static uint16 tab_jisx0208_uni21[]={ +0x5B97,0x5C31,0x5DDE,0x4FEE,0x6101,0x62FE,0x6D32,0x79C0, +0x79CB,0x7D42,0x7E4D,0x7FD2,0x81ED,0x821F,0x8490,0x8846, +0x8972,0x8B90,0x8E74,0x8F2F,0x9031,0x914B,0x916C,0x96C6, +0x919C,0x4EC0,0x4F4F,0x5145,0x5341,0x5F93,0x620E,0x67D4, +0x6C41,0x6E0B,0x7363,0x7E26,0x91CD,0x9283,0x53D4,0x5919, +0x5BBF,0x6DD1,0x795D,0x7E2E,0x7C9B,0x587E,0x719F,0x51FA, +0x8853,0x8FF0,0x4FCA,0x5CFB,0x6625,0x77AC,0x7AE3,0x821C, +0x99FF,0x51C6,0x5FAA,0x65EC,0x696F,0x6B89,0x6DF3,0x6E96, +0x6F64,0x76FE,0x7D14,0x5DE1,0x9075,0x9187,0x9806,0x51E6, +0x521D,0x6240,0x6691,0x66D9,0x6E1A,0x5EB6,0x7DD2,0x7F72, +0x66F8,0x85AF,0x85F7,0x8AF8,0x52A9,0x53D9,0x5973,0x5E8F, +0x5F90,0x6055,0x92E4,0x9664,0x50B7,0x511F}; + +/* page 22 0x3E21-0x3E7E */ +static uint16 tab_jisx0208_uni22[]={ +0x52DD,0x5320,0x5347,0x53EC,0x54E8,0x5546,0x5531,0x5617, +0x5968,0x59BE,0x5A3C,0x5BB5,0x5C06,0x5C0F,0x5C11,0x5C1A, +0x5E84,0x5E8A,0x5EE0,0x5F70,0x627F,0x6284,0x62DB,0x638C, +0x6377,0x6607,0x660C,0x662D,0x6676,0x677E,0x68A2,0x6A1F, +0x6A35,0x6CBC,0x6D88,0x6E09,0x6E58,0x713C,0x7126,0x7167, +0x75C7,0x7701,0x785D,0x7901,0x7965,0x79F0,0x7AE0,0x7B11, +0x7CA7,0x7D39,0x8096,0x83D6,0x848B,0x8549,0x885D,0x88F3, +0x8A1F,0x8A3C,0x8A54,0x8A73,0x8C61,0x8CDE,0x91A4,0x9266, +0x937E,0x9418,0x969C,0x9798,0x4E0A,0x4E08,0x4E1E,0x4E57, +0x5197,0x5270,0x57CE,0x5834,0x58CC,0x5B22,0x5E38,0x60C5, +0x64FE,0x6761,0x6756,0x6D44,0x72B6,0x7573,0x7A63,0x84B8, +0x8B72,0x91B8,0x9320,0x5631,0x57F4,0x98FE}; + +/* page 23 0x3F21-0x3F7E */ +static uint16 tab_jisx0208_uni23[]={ +0x62ED,0x690D,0x6B96,0x71ED,0x7E54,0x8077,0x8272,0x89E6, +0x98DF,0x8755,0x8FB1,0x5C3B,0x4F38,0x4FE1,0x4FB5,0x5507, +0x5A20,0x5BDD,0x5BE9,0x5FC3,0x614E,0x632F,0x65B0,0x664B, +0x68EE,0x699B,0x6D78,0x6DF1,0x7533,0x75B9,0x771F,0x795E, +0x79E6,0x7D33,0x81E3,0x82AF,0x85AA,0x89AA,0x8A3A,0x8EAB, +0x8F9B,0x9032,0x91DD,0x9707,0x4EBA,0x4EC1,0x5203,0x5875, +0x58EC,0x5C0B,0x751A,0x5C3D,0x814E,0x8A0A,0x8FC5,0x9663, +0x976D,0x7B25,0x8ACF,0x9808,0x9162,0x56F3,0x53A8,0x9017, +0x5439,0x5782,0x5E25,0x63A8,0x6C34,0x708A,0x7761,0x7C8B, +0x7FE0,0x8870,0x9042,0x9154,0x9310,0x9318,0x968F,0x745E, +0x9AC4,0x5D07,0x5D69,0x6570,0x67A2,0x8DA8,0x96DB,0x636E, +0x6749,0x6919,0x83C5,0x9817,0x96C0,0x88FE}; + +/* page 24 0x4021-0x407E */ +static uint16 tab_jisx0208_uni24[]={ +0x6F84,0x647A,0x5BF8,0x4E16,0x702C,0x755D,0x662F,0x51C4, +0x5236,0x52E2,0x59D3,0x5F81,0x6027,0x6210,0x653F,0x6574, +0x661F,0x6674,0x68F2,0x6816,0x6B63,0x6E05,0x7272,0x751F, +0x76DB,0x7CBE,0x8056,0x58F0,0x88FD,0x897F,0x8AA0,0x8A93, +0x8ACB,0x901D,0x9192,0x9752,0x9759,0x6589,0x7A0E,0x8106, +0x96BB,0x5E2D,0x60DC,0x621A,0x65A5,0x6614,0x6790,0x77F3, +0x7A4D,0x7C4D,0x7E3E,0x810A,0x8CAC,0x8D64,0x8DE1,0x8E5F, +0x78A9,0x5207,0x62D9,0x63A5,0x6442,0x6298,0x8A2D,0x7A83, +0x7BC0,0x8AAC,0x96EA,0x7D76,0x820C,0x8749,0x4ED9,0x5148, +0x5343,0x5360,0x5BA3,0x5C02,0x5C16,0x5DDD,0x6226,0x6247, +0x64B0,0x6813,0x6834,0x6CC9,0x6D45,0x6D17,0x67D3,0x6F5C, +0x714E,0x717D,0x65CB,0x7A7F,0x7BAD,0x7DDA}; + +/* page 25 0x4121-0x417E */ +static uint16 tab_jisx0208_uni25[]={ +0x7E4A,0x7FA8,0x817A,0x821B,0x8239,0x85A6,0x8A6E,0x8CCE, +0x8DF5,0x9078,0x9077,0x92AD,0x9291,0x9583,0x9BAE,0x524D, +0x5584,0x6F38,0x7136,0x5168,0x7985,0x7E55,0x81B3,0x7CCE, +0x564C,0x5851,0x5CA8,0x63AA,0x66FE,0x66FD,0x695A,0x72D9, +0x758F,0x758E,0x790E,0x7956,0x79DF,0x7C97,0x7D20,0x7D44, +0x8607,0x8A34,0x963B,0x9061,0x9F20,0x50E7,0x5275,0x53CC, +0x53E2,0x5009,0x55AA,0x58EE,0x594F,0x723D,0x5B8B,0x5C64, +0x531D,0x60E3,0x60F3,0x635C,0x6383,0x633F,0x63BB,0x64CD, +0x65E9,0x66F9,0x5DE3,0x69CD,0x69FD,0x6F15,0x71E5,0x4E89, +0x75E9,0x76F8,0x7A93,0x7CDF,0x7DCF,0x7D9C,0x8061,0x8349, +0x8358,0x846C,0x84BC,0x85FB,0x88C5,0x8D70,0x9001,0x906D, +0x9397,0x971C,0x9A12,0x50CF,0x5897,0x618E}; + +/* page 26 0x4221-0x427E */ +static uint16 tab_jisx0208_uni26[]={ +0x81D3,0x8535,0x8D08,0x9020,0x4FC3,0x5074,0x5247,0x5373, +0x606F,0x6349,0x675F,0x6E2C,0x8DB3,0x901F,0x4FD7,0x5C5E, +0x8CCA,0x65CF,0x7D9A,0x5352,0x8896,0x5176,0x63C3,0x5B58, +0x5B6B,0x5C0A,0x640D,0x6751,0x905C,0x4ED6,0x591A,0x592A, +0x6C70,0x8A51,0x553E,0x5815,0x59A5,0x60F0,0x6253,0x67C1, +0x8235,0x6955,0x9640,0x99C4,0x9A28,0x4F53,0x5806,0x5BFE, +0x8010,0x5CB1,0x5E2F,0x5F85,0x6020,0x614B,0x6234,0x66FF, +0x6CF0,0x6EDE,0x80CE,0x817F,0x82D4,0x888B,0x8CB8,0x9000, +0x902E,0x968A,0x9EDB,0x9BDB,0x4EE3,0x53F0,0x5927,0x7B2C, +0x918D,0x984C,0x9DF9,0x6EDD,0x7027,0x5353,0x5544,0x5B85, +0x6258,0x629E,0x62D3,0x6CA2,0x6FEF,0x7422,0x8A17,0x9438, +0x6FC1,0x8AFE,0x8338,0x51E7,0x86F8,0x53EA}; + +/* page 27 0x4321-0x437E */ +static uint16 tab_jisx0208_uni27[]={ +0x53E9,0x4F46,0x9054,0x8FB0,0x596A,0x8131,0x5DFD,0x7AEA, +0x8FBF,0x68DA,0x8C37,0x72F8,0x9C48,0x6A3D,0x8AB0,0x4E39, +0x5358,0x5606,0x5766,0x62C5,0x63A2,0x65E6,0x6B4E,0x6DE1, +0x6E5B,0x70AD,0x77ED,0x7AEF,0x7BAA,0x7DBB,0x803D,0x80C6, +0x86CB,0x8A95,0x935B,0x56E3,0x58C7,0x5F3E,0x65AD,0x6696, +0x6A80,0x6BB5,0x7537,0x8AC7,0x5024,0x77E5,0x5730,0x5F1B, +0x6065,0x667A,0x6C60,0x75F4,0x7A1A,0x7F6E,0x81F4,0x8718, +0x9045,0x99B3,0x7BC9,0x755C,0x7AF9,0x7B51,0x84C4,0x9010, +0x79E9,0x7A92,0x8336,0x5AE1,0x7740,0x4E2D,0x4EF2,0x5B99, +0x5FE0,0x62BD,0x663C,0x67F1,0x6CE8,0x866B,0x8877,0x8A3B, +0x914E,0x92F3,0x99D0,0x6A17,0x7026,0x732A,0x82E7,0x8457, +0x8CAF,0x4E01,0x5146,0x51CB,0x558B,0x5BF5}; + +/* page 28 0x4421-0x447E */ +static uint16 tab_jisx0208_uni28[]={ +0x5E16,0x5E33,0x5E81,0x5F14,0x5F35,0x5F6B,0x5FB4,0x61F2, +0x6311,0x66A2,0x671D,0x6F6E,0x7252,0x753A,0x773A,0x8074, +0x8139,0x8178,0x8776,0x8ABF,0x8ADC,0x8D85,0x8DF3,0x929A, +0x9577,0x9802,0x9CE5,0x52C5,0x6357,0x76F4,0x6715,0x6C88, +0x73CD,0x8CC3,0x93AE,0x9673,0x6D25,0x589C,0x690E,0x69CC, +0x8FFD,0x939A,0x75DB,0x901A,0x585A,0x6802,0x63B4,0x69FB, +0x4F43,0x6F2C,0x67D8,0x8FBB,0x8526,0x7DB4,0x9354,0x693F, +0x6F70,0x576A,0x58F7,0x5B2C,0x7D2C,0x722A,0x540A,0x91E3, +0x9DB4,0x4EAD,0x4F4E,0x505C,0x5075,0x5243,0x8C9E,0x5448, +0x5824,0x5B9A,0x5E1D,0x5E95,0x5EAD,0x5EF7,0x5F1F,0x608C, +0x62B5,0x633A,0x63D0,0x68AF,0x6C40,0x7887,0x798E,0x7A0B, +0x7DE0,0x8247,0x8A02,0x8AE6,0x8E44,0x9013}; + +/* page 29 0x4521-0x457E */ +static uint16 tab_jisx0208_uni29[]={ +0x90B8,0x912D,0x91D8,0x9F0E,0x6CE5,0x6458,0x64E2,0x6575, +0x6EF4,0x7684,0x7B1B,0x9069,0x93D1,0x6EBA,0x54F2,0x5FB9, +0x64A4,0x8F4D,0x8FED,0x9244,0x5178,0x586B,0x5929,0x5C55, +0x5E97,0x6DFB,0x7E8F,0x751C,0x8CBC,0x8EE2,0x985B,0x70B9, +0x4F1D,0x6BBF,0x6FB1,0x7530,0x96FB,0x514E,0x5410,0x5835, +0x5857,0x59AC,0x5C60,0x5F92,0x6597,0x675C,0x6E21,0x767B, +0x83DF,0x8CED,0x9014,0x90FD,0x934D,0x7825,0x783A,0x52AA, +0x5EA6,0x571F,0x5974,0x6012,0x5012,0x515A,0x51AC,0x51CD, +0x5200,0x5510,0x5854,0x5858,0x5957,0x5B95,0x5CF6,0x5D8B, +0x60BC,0x6295,0x642D,0x6771,0x6843,0x68BC,0x68DF,0x76D7, +0x6DD8,0x6E6F,0x6D9B,0x706F,0x71C8,0x5F53,0x75D8,0x7977, +0x7B49,0x7B54,0x7B52,0x7CD6,0x7D71,0x5230}; + +/* page 30 0x4621-0x467E */ +static uint16 tab_jisx0208_uni30[]={ +0x8463,0x8569,0x85E4,0x8A0E,0x8B04,0x8C46,0x8E0F,0x9003, +0x900F,0x9419,0x9676,0x982D,0x9A30,0x95D8,0x50CD,0x52D5, +0x540C,0x5802,0x5C0E,0x61A7,0x649E,0x6D1E,0x77B3,0x7AE5, +0x80F4,0x8404,0x9053,0x9285,0x5CE0,0x9D07,0x533F,0x5F97, +0x5FB3,0x6D9C,0x7279,0x7763,0x79BF,0x7BE4,0x6BD2,0x72EC, +0x8AAD,0x6803,0x6A61,0x51F8,0x7A81,0x6934,0x5C4A,0x9CF6, +0x82EB,0x5BC5,0x9149,0x701E,0x5678,0x5C6F,0x60C7,0x6566, +0x6C8C,0x8C5A,0x9041,0x9813,0x5451,0x66C7,0x920D,0x5948, +0x90A3,0x5185,0x4E4D,0x51EA,0x8599,0x8B0E,0x7058,0x637A, +0x934B,0x6962,0x99B4,0x7E04,0x7577,0x5357,0x6960,0x8EDF, +0x96E3,0x6C5D,0x4E8C,0x5C3C,0x5F10,0x8FE9,0x5302,0x8CD1, +0x8089,0x8679,0x5EFF,0x65E5,0x4E73,0x5165}; + +/* page 31 0x4721-0x477E */ +static uint16 tab_jisx0208_uni31[]={ +0x5982,0x5C3F,0x97EE,0x4EFB,0x598A,0x5FCD,0x8A8D,0x6FE1, +0x79B0,0x7962,0x5BE7,0x8471,0x732B,0x71B1,0x5E74,0x5FF5, +0x637B,0x649A,0x71C3,0x7C98,0x4E43,0x5EFC,0x4E4B,0x57DC, +0x56A2,0x60A9,0x6FC3,0x7D0D,0x80FD,0x8133,0x81BF,0x8FB2, +0x8997,0x86A4,0x5DF4,0x628A,0x64AD,0x8987,0x6777,0x6CE2, +0x6D3E,0x7436,0x7834,0x5A46,0x7F75,0x82AD,0x99AC,0x4FF3, +0x5EC3,0x62DD,0x6392,0x6557,0x676F,0x76C3,0x724C,0x80CC, +0x80BA,0x8F29,0x914D,0x500D,0x57F9,0x5A92,0x6885,0x6973, +0x7164,0x72FD,0x8CB7,0x58F2,0x8CE0,0x966A,0x9019,0x877F, +0x79E4,0x77E7,0x8429,0x4F2F,0x5265,0x535A,0x62CD,0x67CF, +0x6CCA,0x767D,0x7B94,0x7C95,0x8236,0x8584,0x8FEB,0x66DD, +0x6F20,0x7206,0x7E1B,0x83AB,0x99C1,0x9EA6}; + +/* page 32 0x4821-0x487E */ +static uint16 tab_jisx0208_uni32[]={ +0x51FD,0x7BB1,0x7872,0x7BB8,0x8087,0x7B48,0x6AE8,0x5E61, +0x808C,0x7551,0x7560,0x516B,0x9262,0x6E8C,0x767A,0x9197, +0x9AEA,0x4F10,0x7F70,0x629C,0x7B4F,0x95A5,0x9CE9,0x567A, +0x5859,0x86E4,0x96BC,0x4F34,0x5224,0x534A,0x53CD,0x53DB, +0x5E06,0x642C,0x6591,0x677F,0x6C3E,0x6C4E,0x7248,0x72AF, +0x73ED,0x7554,0x7E41,0x822C,0x85E9,0x8CA9,0x7BC4,0x91C6, +0x7169,0x9812,0x98EF,0x633D,0x6669,0x756A,0x76E4,0x78D0, +0x8543,0x86EE,0x532A,0x5351,0x5426,0x5983,0x5E87,0x5F7C, +0x60B2,0x6249,0x6279,0x62AB,0x6590,0x6BD4,0x6CCC,0x75B2, +0x76AE,0x7891,0x79D8,0x7DCB,0x7F77,0x80A5,0x88AB,0x8AB9, +0x8CBB,0x907F,0x975E,0x98DB,0x6A0B,0x7C38,0x5099,0x5C3E, +0x5FAE,0x6787,0x6BD8,0x7435,0x7709,0x7F8E}; + +/* page 33 0x4921-0x497E */ +static uint16 tab_jisx0208_uni33[]={ +0x9F3B,0x67CA,0x7A17,0x5339,0x758B,0x9AED,0x5F66,0x819D, +0x83F1,0x8098,0x5F3C,0x5FC5,0x7562,0x7B46,0x903C,0x6867, +0x59EB,0x5A9B,0x7D10,0x767E,0x8B2C,0x4FF5,0x5F6A,0x6A19, +0x6C37,0x6F02,0x74E2,0x7968,0x8868,0x8A55,0x8C79,0x5EDF, +0x63CF,0x75C5,0x79D2,0x82D7,0x9328,0x92F2,0x849C,0x86ED, +0x9C2D,0x54C1,0x5F6C,0x658C,0x6D5C,0x7015,0x8CA7,0x8CD3, +0x983B,0x654F,0x74F6,0x4E0D,0x4ED8,0x57E0,0x592B,0x5A66, +0x5BCC,0x51A8,0x5E03,0x5E9C,0x6016,0x6276,0x6577,0x65A7, +0x666E,0x6D6E,0x7236,0x7B26,0x8150,0x819A,0x8299,0x8B5C, +0x8CA0,0x8CE6,0x8D74,0x961C,0x9644,0x4FAE,0x64AB,0x6B66, +0x821E,0x8461,0x856A,0x90E8,0x5C01,0x6953,0x98A8,0x847A, +0x8557,0x4F0F,0x526F,0x5FA9,0x5E45,0x670D}; + +/* page 34 0x4A21-0x4A7E */ +static uint16 tab_jisx0208_uni34[]={ +0x798F,0x8179,0x8907,0x8986,0x6DF5,0x5F17,0x6255,0x6CB8, +0x4ECF,0x7269,0x9B92,0x5206,0x543B,0x5674,0x58B3,0x61A4, +0x626E,0x711A,0x596E,0x7C89,0x7CDE,0x7D1B,0x96F0,0x6587, +0x805E,0x4E19,0x4F75,0x5175,0x5840,0x5E63,0x5E73,0x5F0A, +0x67C4,0x4E26,0x853D,0x9589,0x965B,0x7C73,0x9801,0x50FB, +0x58C1,0x7656,0x78A7,0x5225,0x77A5,0x8511,0x7B86,0x504F, +0x5909,0x7247,0x7BC7,0x7DE8,0x8FBA,0x8FD4,0x904D,0x4FBF, +0x52C9,0x5A29,0x5F01,0x97AD,0x4FDD,0x8217,0x92EA,0x5703, +0x6355,0x6B69,0x752B,0x88DC,0x8F14,0x7A42,0x52DF,0x5893, +0x6155,0x620A,0x66AE,0x6BCD,0x7C3F,0x83E9,0x5023,0x4FF8, +0x5305,0x5446,0x5831,0x5949,0x5B9D,0x5CF0,0x5CEF,0x5D29, +0x5E96,0x62B1,0x6367,0x653E,0x65B9,0x670B}; + +/* page 35 0x4B21-0x4B7E */ +static uint16 tab_jisx0208_uni35[]={ +0x6CD5,0x6CE1,0x70F9,0x7832,0x7E2B,0x80DE,0x82B3,0x840C, +0x84EC,0x8702,0x8912,0x8A2A,0x8C4A,0x90A6,0x92D2,0x98FD, +0x9CF3,0x9D6C,0x4E4F,0x4EA1,0x508D,0x5256,0x574A,0x59A8, +0x5E3D,0x5FD8,0x5FD9,0x623F,0x66B4,0x671B,0x67D0,0x68D2, +0x5192,0x7D21,0x80AA,0x81A8,0x8B00,0x8C8C,0x8CBF,0x927E, +0x9632,0x5420,0x982C,0x5317,0x50D5,0x535C,0x58A8,0x64B2, +0x6734,0x7267,0x7766,0x7A46,0x91E6,0x52C3,0x6CA1,0x6B86, +0x5800,0x5E4C,0x5954,0x672C,0x7FFB,0x51E1,0x76C6,0x6469, +0x78E8,0x9B54,0x9EBB,0x57CB,0x59B9,0x6627,0x679A,0x6BCE, +0x54E9,0x69D9,0x5E55,0x819C,0x6795,0x9BAA,0x67FE,0x9C52, +0x685D,0x4EA6,0x4FE3,0x53C8,0x62B9,0x672B,0x6CAB,0x8FC4, +0x4FAD,0x7E6D,0x9EBF,0x4E07,0x6162,0x6E80}; + +/* page 36 0x4C21-0x4C7E */ +static uint16 tab_jisx0208_uni36[]={ +0x6F2B,0x8513,0x5473,0x672A,0x9B45,0x5DF3,0x7B95,0x5CAC, +0x5BC6,0x871C,0x6E4A,0x84D1,0x7A14,0x8108,0x5999,0x7C8D, +0x6C11,0x7720,0x52D9,0x5922,0x7121,0x725F,0x77DB,0x9727, +0x9D61,0x690B,0x5A7F,0x5A18,0x51A5,0x540D,0x547D,0x660E, +0x76DF,0x8FF7,0x9298,0x9CF4,0x59EA,0x725D,0x6EC5,0x514D, +0x68C9,0x7DBF,0x7DEC,0x9762,0x9EBA,0x6478,0x6A21,0x8302, +0x5984,0x5B5F,0x6BDB,0x731B,0x76F2,0x7DB2,0x8017,0x8499, +0x5132,0x6728,0x9ED9,0x76EE,0x6762,0x52FF,0x9905,0x5C24, +0x623B,0x7C7E,0x8CB0,0x554F,0x60B6,0x7D0B,0x9580,0x5301, +0x4E5F,0x51B6,0x591C,0x723A,0x8036,0x91CE,0x5F25,0x77E2, +0x5384,0x5F79,0x7D04,0x85AC,0x8A33,0x8E8D,0x9756,0x67F3, +0x85AE,0x9453,0x6109,0x6108,0x6CB9,0x7652}; + +/* page 37 0x4D21-0x4D7E */ +static uint16 tab_jisx0208_uni37[]={ +0x8AED,0x8F38,0x552F,0x4F51,0x512A,0x52C7,0x53CB,0x5BA5, +0x5E7D,0x60A0,0x6182,0x63D6,0x6709,0x67DA,0x6E67,0x6D8C, +0x7336,0x7337,0x7531,0x7950,0x88D5,0x8A98,0x904A,0x9091, +0x90F5,0x96C4,0x878D,0x5915,0x4E88,0x4F59,0x4E0E,0x8A89, +0x8F3F,0x9810,0x50AD,0x5E7C,0x5996,0x5BB9,0x5EB8,0x63DA, +0x63FA,0x64C1,0x66DC,0x694A,0x69D8,0x6D0B,0x6EB6,0x7194, +0x7528,0x7AAF,0x7F8A,0x8000,0x8449,0x84C9,0x8981,0x8B21, +0x8E0A,0x9065,0x967D,0x990A,0x617E,0x6291,0x6B32,0x6C83, +0x6D74,0x7FCC,0x7FFC,0x6DC0,0x7F85,0x87BA,0x88F8,0x6765, +0x83B1,0x983C,0x96F7,0x6D1B,0x7D61,0x843D,0x916A,0x4E71, +0x5375,0x5D50,0x6B04,0x6FEB,0x85CD,0x862D,0x89A7,0x5229, +0x540F,0x5C65,0x674E,0x68A8,0x7406,0x7483}; + +/* page 38 0x4E21-0x4E7E */ +static uint16 tab_jisx0208_uni38[]={ +0x75E2,0x88CF,0x88E1,0x91CC,0x96E2,0x9678,0x5F8B,0x7387, +0x7ACB,0x844E,0x63A0,0x7565,0x5289,0x6D41,0x6E9C,0x7409, +0x7559,0x786B,0x7C92,0x9686,0x7ADC,0x9F8D,0x4FB6,0x616E, +0x65C5,0x865C,0x4E86,0x4EAE,0x50DA,0x4E21,0x51CC,0x5BEE, +0x6599,0x6881,0x6DBC,0x731F,0x7642,0x77AD,0x7A1C,0x7CE7, +0x826F,0x8AD2,0x907C,0x91CF,0x9675,0x9818,0x529B,0x7DD1, +0x502B,0x5398,0x6797,0x6DCB,0x71D0,0x7433,0x81E8,0x8F2A, +0x96A3,0x9C57,0x9E9F,0x7460,0x5841,0x6D99,0x7D2F,0x985E, +0x4EE4,0x4F36,0x4F8B,0x51B7,0x52B1,0x5DBA,0x601C,0x73B2, +0x793C,0x82D3,0x9234,0x96B7,0x96F6,0x970A,0x9E97,0x9F62, +0x66A6,0x6B74,0x5217,0x52A3,0x70C8,0x88C2,0x5EC9,0x604B, +0x6190,0x6F23,0x7149,0x7C3E,0x7DF4,0x806F}; + +/* page 39 0x4F21-0x4F53 */ +static uint16 tab_jisx0208_uni39[]={ +0x84EE,0x9023,0x932C,0x5442,0x9B6F,0x6AD3,0x7089,0x8CC2, +0x8DEF,0x9732,0x52B4,0x5A41,0x5ECA,0x5F04,0x6717,0x697C, +0x6994,0x6D6A,0x6F0F,0x7262,0x72FC,0x7BED,0x8001,0x807E, +0x874B,0x90CE,0x516D,0x9E93,0x7984,0x808B,0x9332,0x8AD6, +0x502D,0x548C,0x8A71,0x6B6A,0x8CC4,0x8107,0x60D1,0x67A0, +0x9DF2,0x4E99,0x4E98,0x9C10,0x8A6B,0x85C1,0x8568,0x6900, +0x6E7E,0x7897,0x8155}; + +/* page 40 0x5021-0x507E */ +static uint16 tab_jisx0208_uni40[]={ +0x5F0C,0x4E10,0x4E15,0x4E2A,0x4E31,0x4E36,0x4E3C,0x4E3F, +0x4E42,0x4E56,0x4E58,0x4E82,0x4E85,0x8C6B,0x4E8A,0x8212, +0x5F0D,0x4E8E,0x4E9E,0x4E9F,0x4EA0,0x4EA2,0x4EB0,0x4EB3, +0x4EB6,0x4ECE,0x4ECD,0x4EC4,0x4EC6,0x4EC2,0x4ED7,0x4EDE, +0x4EED,0x4EDF,0x4EF7,0x4F09,0x4F5A,0x4F30,0x4F5B,0x4F5D, +0x4F57,0x4F47,0x4F76,0x4F88,0x4F8F,0x4F98,0x4F7B,0x4F69, +0x4F70,0x4F91,0x4F6F,0x4F86,0x4F96,0x5118,0x4FD4,0x4FDF, +0x4FCE,0x4FD8,0x4FDB,0x4FD1,0x4FDA,0x4FD0,0x4FE4,0x4FE5, +0x501A,0x5028,0x5014,0x502A,0x5025,0x5005,0x4F1C,0x4FF6, +0x5021,0x5029,0x502C,0x4FFE,0x4FEF,0x5011,0x5006,0x5043, +0x5047,0x6703,0x5055,0x5050,0x5048,0x505A,0x5056,0x506C, +0x5078,0x5080,0x509A,0x5085,0x50B4,0x50B2}; + +/* page 41 0x5121-0x517E */ +static uint16 tab_jisx0208_uni41[]={ +0x50C9,0x50CA,0x50B3,0x50C2,0x50D6,0x50DE,0x50E5,0x50ED, +0x50E3,0x50EE,0x50F9,0x50F5,0x5109,0x5101,0x5102,0x5116, +0x5115,0x5114,0x511A,0x5121,0x513A,0x5137,0x513C,0x513B, +0x513F,0x5140,0x5152,0x514C,0x5154,0x5162,0x7AF8,0x5169, +0x516A,0x516E,0x5180,0x5182,0x56D8,0x518C,0x5189,0x518F, +0x5191,0x5193,0x5195,0x5196,0x51A4,0x51A6,0x51A2,0x51A9, +0x51AA,0x51AB,0x51B3,0x51B1,0x51B2,0x51B0,0x51B5,0x51BD, +0x51C5,0x51C9,0x51DB,0x51E0,0x8655,0x51E9,0x51ED,0x51F0, +0x51F5,0x51FE,0x5204,0x520B,0x5214,0x520E,0x5227,0x522A, +0x522E,0x5233,0x5239,0x524F,0x5244,0x524B,0x524C,0x525E, +0x5254,0x526A,0x5274,0x5269,0x5273,0x527F,0x527D,0x528D, +0x5294,0x5292,0x5271,0x5288,0x5291,0x8FA8}; + +/* page 42 0x5221-0x527E */ +static uint16 tab_jisx0208_uni42[]={ +0x8FA7,0x52AC,0x52AD,0x52BC,0x52B5,0x52C1,0x52CD,0x52D7, +0x52DE,0x52E3,0x52E6,0x98ED,0x52E0,0x52F3,0x52F5,0x52F8, +0x52F9,0x5306,0x5308,0x7538,0x530D,0x5310,0x530F,0x5315, +0x531A,0x5323,0x532F,0x5331,0x5333,0x5338,0x5340,0x5346, +0x5345,0x4E17,0x5349,0x534D,0x51D6,0x535E,0x5369,0x536E, +0x5918,0x537B,0x5377,0x5382,0x5396,0x53A0,0x53A6,0x53A5, +0x53AE,0x53B0,0x53B6,0x53C3,0x7C12,0x96D9,0x53DF,0x66FC, +0x71EE,0x53EE,0x53E8,0x53ED,0x53FA,0x5401,0x543D,0x5440, +0x542C,0x542D,0x543C,0x542E,0x5436,0x5429,0x541D,0x544E, +0x548F,0x5475,0x548E,0x545F,0x5471,0x5477,0x5470,0x5492, +0x547B,0x5480,0x5476,0x5484,0x5490,0x5486,0x54C7,0x54A2, +0x54B8,0x54A5,0x54AC,0x54C4,0x54C8,0x54A8}; + +/* page 43 0x5321-0x537E */ +static uint16 tab_jisx0208_uni43[]={ +0x54AB,0x54C2,0x54A4,0x54BE,0x54BC,0x54D8,0x54E5,0x54E6, +0x550F,0x5514,0x54FD,0x54EE,0x54ED,0x54FA,0x54E2,0x5539, +0x5540,0x5563,0x554C,0x552E,0x555C,0x5545,0x5556,0x5557, +0x5538,0x5533,0x555D,0x5599,0x5580,0x54AF,0x558A,0x559F, +0x557B,0x557E,0x5598,0x559E,0x55AE,0x557C,0x5583,0x55A9, +0x5587,0x55A8,0x55DA,0x55C5,0x55DF,0x55C4,0x55DC,0x55E4, +0x55D4,0x5614,0x55F7,0x5616,0x55FE,0x55FD,0x561B,0x55F9, +0x564E,0x5650,0x71DF,0x5634,0x5636,0x5632,0x5638,0x566B, +0x5664,0x562F,0x566C,0x566A,0x5686,0x5680,0x568A,0x56A0, +0x5694,0x568F,0x56A5,0x56AE,0x56B6,0x56B4,0x56C2,0x56BC, +0x56C1,0x56C3,0x56C0,0x56C8,0x56CE,0x56D1,0x56D3,0x56D7, +0x56EE,0x56F9,0x5700,0x56FF,0x5704,0x5709}; + +/* page 44 0x5421-0x547E */ +static uint16 tab_jisx0208_uni44[]={ +0x5708,0x570B,0x570D,0x5713,0x5718,0x5716,0x55C7,0x571C, +0x5726,0x5737,0x5738,0x574E,0x573B,0x5740,0x574F,0x5769, +0x57C0,0x5788,0x5761,0x577F,0x5789,0x5793,0x57A0,0x57B3, +0x57A4,0x57AA,0x57B0,0x57C3,0x57C6,0x57D4,0x57D2,0x57D3, +0x580A,0x57D6,0x57E3,0x580B,0x5819,0x581D,0x5872,0x5821, +0x5862,0x584B,0x5870,0x6BC0,0x5852,0x583D,0x5879,0x5885, +0x58B9,0x589F,0x58AB,0x58BA,0x58DE,0x58BB,0x58B8,0x58AE, +0x58C5,0x58D3,0x58D1,0x58D7,0x58D9,0x58D8,0x58E5,0x58DC, +0x58E4,0x58DF,0x58EF,0x58FA,0x58F9,0x58FB,0x58FC,0x58FD, +0x5902,0x590A,0x5910,0x591B,0x68A6,0x5925,0x592C,0x592D, +0x5932,0x5938,0x593E,0x7AD2,0x5955,0x5950,0x594E,0x595A, +0x5958,0x5962,0x5960,0x5967,0x596C,0x5969}; + +/* page 45 0x5521-0x557E */ +static uint16 tab_jisx0208_uni45[]={ +0x5978,0x5981,0x599D,0x4F5E,0x4FAB,0x59A3,0x59B2,0x59C6, +0x59E8,0x59DC,0x598D,0x59D9,0x59DA,0x5A25,0x5A1F,0x5A11, +0x5A1C,0x5A09,0x5A1A,0x5A40,0x5A6C,0x5A49,0x5A35,0x5A36, +0x5A62,0x5A6A,0x5A9A,0x5ABC,0x5ABE,0x5ACB,0x5AC2,0x5ABD, +0x5AE3,0x5AD7,0x5AE6,0x5AE9,0x5AD6,0x5AFA,0x5AFB,0x5B0C, +0x5B0B,0x5B16,0x5B32,0x5AD0,0x5B2A,0x5B36,0x5B3E,0x5B43, +0x5B45,0x5B40,0x5B51,0x5B55,0x5B5A,0x5B5B,0x5B65,0x5B69, +0x5B70,0x5B73,0x5B75,0x5B78,0x6588,0x5B7A,0x5B80,0x5B83, +0x5BA6,0x5BB8,0x5BC3,0x5BC7,0x5BC9,0x5BD4,0x5BD0,0x5BE4, +0x5BE6,0x5BE2,0x5BDE,0x5BE5,0x5BEB,0x5BF0,0x5BF6,0x5BF3, +0x5C05,0x5C07,0x5C08,0x5C0D,0x5C13,0x5C20,0x5C22,0x5C28, +0x5C38,0x5C39,0x5C41,0x5C46,0x5C4E,0x5C53}; + +/* page 46 0x5621-0x567E */ +static uint16 tab_jisx0208_uni46[]={ +0x5C50,0x5C4F,0x5B71,0x5C6C,0x5C6E,0x4E62,0x5C76,0x5C79, +0x5C8C,0x5C91,0x5C94,0x599B,0x5CAB,0x5CBB,0x5CB6,0x5CBC, +0x5CB7,0x5CC5,0x5CBE,0x5CC7,0x5CD9,0x5CE9,0x5CFD,0x5CFA, +0x5CED,0x5D8C,0x5CEA,0x5D0B,0x5D15,0x5D17,0x5D5C,0x5D1F, +0x5D1B,0x5D11,0x5D14,0x5D22,0x5D1A,0x5D19,0x5D18,0x5D4C, +0x5D52,0x5D4E,0x5D4B,0x5D6C,0x5D73,0x5D76,0x5D87,0x5D84, +0x5D82,0x5DA2,0x5D9D,0x5DAC,0x5DAE,0x5DBD,0x5D90,0x5DB7, +0x5DBC,0x5DC9,0x5DCD,0x5DD3,0x5DD2,0x5DD6,0x5DDB,0x5DEB, +0x5DF2,0x5DF5,0x5E0B,0x5E1A,0x5E19,0x5E11,0x5E1B,0x5E36, +0x5E37,0x5E44,0x5E43,0x5E40,0x5E4E,0x5E57,0x5E54,0x5E5F, +0x5E62,0x5E64,0x5E47,0x5E75,0x5E76,0x5E7A,0x9EBC,0x5E7F, +0x5EA0,0x5EC1,0x5EC2,0x5EC8,0x5ED0,0x5ECF}; + +/* page 47 0x5721-0x577E */ +static uint16 tab_jisx0208_uni47[]={ +0x5ED6,0x5EE3,0x5EDD,0x5EDA,0x5EDB,0x5EE2,0x5EE1,0x5EE8, +0x5EE9,0x5EEC,0x5EF1,0x5EF3,0x5EF0,0x5EF4,0x5EF8,0x5EFE, +0x5F03,0x5F09,0x5F5D,0x5F5C,0x5F0B,0x5F11,0x5F16,0x5F29, +0x5F2D,0x5F38,0x5F41,0x5F48,0x5F4C,0x5F4E,0x5F2F,0x5F51, +0x5F56,0x5F57,0x5F59,0x5F61,0x5F6D,0x5F73,0x5F77,0x5F83, +0x5F82,0x5F7F,0x5F8A,0x5F88,0x5F91,0x5F87,0x5F9E,0x5F99, +0x5F98,0x5FA0,0x5FA8,0x5FAD,0x5FBC,0x5FD6,0x5FFB,0x5FE4, +0x5FF8,0x5FF1,0x5FDD,0x60B3,0x5FFF,0x6021,0x6060,0x6019, +0x6010,0x6029,0x600E,0x6031,0x601B,0x6015,0x602B,0x6026, +0x600F,0x603A,0x605A,0x6041,0x606A,0x6077,0x605F,0x604A, +0x6046,0x604D,0x6063,0x6043,0x6064,0x6042,0x606C,0x606B, +0x6059,0x6081,0x608D,0x60E7,0x6083,0x609A}; + +/* page 48 0x5821-0x587E */ +static uint16 tab_jisx0208_uni48[]={ +0x6084,0x609B,0x6096,0x6097,0x6092,0x60A7,0x608B,0x60E1, +0x60B8,0x60E0,0x60D3,0x60B4,0x5FF0,0x60BD,0x60C6,0x60B5, +0x60D8,0x614D,0x6115,0x6106,0x60F6,0x60F7,0x6100,0x60F4, +0x60FA,0x6103,0x6121,0x60FB,0x60F1,0x610D,0x610E,0x6147, +0x613E,0x6128,0x6127,0x614A,0x613F,0x613C,0x612C,0x6134, +0x613D,0x6142,0x6144,0x6173,0x6177,0x6158,0x6159,0x615A, +0x616B,0x6174,0x616F,0x6165,0x6171,0x615F,0x615D,0x6153, +0x6175,0x6199,0x6196,0x6187,0x61AC,0x6194,0x619A,0x618A, +0x6191,0x61AB,0x61AE,0x61CC,0x61CA,0x61C9,0x61F7,0x61C8, +0x61C3,0x61C6,0x61BA,0x61CB,0x7F79,0x61CD,0x61E6,0x61E3, +0x61F6,0x61FA,0x61F4,0x61FF,0x61FD,0x61FC,0x61FE,0x6200, +0x6208,0x6209,0x620D,0x620C,0x6214,0x621B}; + +/* page 49 0x5921-0x597E */ +static uint16 tab_jisx0208_uni49[]={ +0x621E,0x6221,0x622A,0x622E,0x6230,0x6232,0x6233,0x6241, +0x624E,0x625E,0x6263,0x625B,0x6260,0x6268,0x627C,0x6282, +0x6289,0x627E,0x6292,0x6293,0x6296,0x62D4,0x6283,0x6294, +0x62D7,0x62D1,0x62BB,0x62CF,0x62FF,0x62C6,0x64D4,0x62C8, +0x62DC,0x62CC,0x62CA,0x62C2,0x62C7,0x629B,0x62C9,0x630C, +0x62EE,0x62F1,0x6327,0x6302,0x6308,0x62EF,0x62F5,0x6350, +0x633E,0x634D,0x641C,0x634F,0x6396,0x638E,0x6380,0x63AB, +0x6376,0x63A3,0x638F,0x6389,0x639F,0x63B5,0x636B,0x6369, +0x63BE,0x63E9,0x63C0,0x63C6,0x63E3,0x63C9,0x63D2,0x63F6, +0x63C4,0x6416,0x6434,0x6406,0x6413,0x6426,0x6436,0x651D, +0x6417,0x6428,0x640F,0x6467,0x646F,0x6476,0x644E,0x652A, +0x6495,0x6493,0x64A5,0x64A9,0x6488,0x64BC}; + +/* page 50 0x5A21-0x5A7E */ +static uint16 tab_jisx0208_uni50[]={ +0x64DA,0x64D2,0x64C5,0x64C7,0x64BB,0x64D8,0x64C2,0x64F1, +0x64E7,0x8209,0x64E0,0x64E1,0x62AC,0x64E3,0x64EF,0x652C, +0x64F6,0x64F4,0x64F2,0x64FA,0x6500,0x64FD,0x6518,0x651C, +0x6505,0x6524,0x6523,0x652B,0x6534,0x6535,0x6537,0x6536, +0x6538,0x754B,0x6548,0x6556,0x6555,0x654D,0x6558,0x655E, +0x655D,0x6572,0x6578,0x6582,0x6583,0x8B8A,0x659B,0x659F, +0x65AB,0x65B7,0x65C3,0x65C6,0x65C1,0x65C4,0x65CC,0x65D2, +0x65DB,0x65D9,0x65E0,0x65E1,0x65F1,0x6772,0x660A,0x6603, +0x65FB,0x6773,0x6635,0x6636,0x6634,0x661C,0x664F,0x6644, +0x6649,0x6641,0x665E,0x665D,0x6664,0x6667,0x6668,0x665F, +0x6662,0x6670,0x6683,0x6688,0x668E,0x6689,0x6684,0x6698, +0x669D,0x66C1,0x66B9,0x66C9,0x66BE,0x66BC}; + +/* page 51 0x5B21-0x5B7E */ +static uint16 tab_jisx0208_uni51[]={ +0x66C4,0x66B8,0x66D6,0x66DA,0x66E0,0x663F,0x66E6,0x66E9, +0x66F0,0x66F5,0x66F7,0x670F,0x6716,0x671E,0x6726,0x6727, +0x9738,0x672E,0x673F,0x6736,0x6741,0x6738,0x6737,0x6746, +0x675E,0x6760,0x6759,0x6763,0x6764,0x6789,0x6770,0x67A9, +0x677C,0x676A,0x678C,0x678B,0x67A6,0x67A1,0x6785,0x67B7, +0x67EF,0x67B4,0x67EC,0x67B3,0x67E9,0x67B8,0x67E4,0x67DE, +0x67DD,0x67E2,0x67EE,0x67B9,0x67CE,0x67C6,0x67E7,0x6A9C, +0x681E,0x6846,0x6829,0x6840,0x684D,0x6832,0x684E,0x68B3, +0x682B,0x6859,0x6863,0x6877,0x687F,0x689F,0x688F,0x68AD, +0x6894,0x689D,0x689B,0x6883,0x6AAE,0x68B9,0x6874,0x68B5, +0x68A0,0x68BA,0x690F,0x688D,0x687E,0x6901,0x68CA,0x6908, +0x68D8,0x6922,0x6926,0x68E1,0x690C,0x68CD}; + +/* page 52 0x5C21-0x5C7E */ +static uint16 tab_jisx0208_uni52[]={ +0x68D4,0x68E7,0x68D5,0x6936,0x6912,0x6904,0x68D7,0x68E3, +0x6925,0x68F9,0x68E0,0x68EF,0x6928,0x692A,0x691A,0x6923, +0x6921,0x68C6,0x6979,0x6977,0x695C,0x6978,0x696B,0x6954, +0x697E,0x696E,0x6939,0x6974,0x693D,0x6959,0x6930,0x6961, +0x695E,0x695D,0x6981,0x696A,0x69B2,0x69AE,0x69D0,0x69BF, +0x69C1,0x69D3,0x69BE,0x69CE,0x5BE8,0x69CA,0x69DD,0x69BB, +0x69C3,0x69A7,0x6A2E,0x6991,0x69A0,0x699C,0x6995,0x69B4, +0x69DE,0x69E8,0x6A02,0x6A1B,0x69FF,0x6B0A,0x69F9,0x69F2, +0x69E7,0x6A05,0x69B1,0x6A1E,0x69ED,0x6A14,0x69EB,0x6A0A, +0x6A12,0x6AC1,0x6A23,0x6A13,0x6A44,0x6A0C,0x6A72,0x6A36, +0x6A78,0x6A47,0x6A62,0x6A59,0x6A66,0x6A48,0x6A38,0x6A22, +0x6A90,0x6A8D,0x6AA0,0x6A84,0x6AA2,0x6AA3}; + +/* page 53 0x5D21-0x5D7E */ +static uint16 tab_jisx0208_uni53[]={ +0x6A97,0x8617,0x6ABB,0x6AC3,0x6AC2,0x6AB8,0x6AB3,0x6AAC, +0x6ADE,0x6AD1,0x6ADF,0x6AAA,0x6ADA,0x6AEA,0x6AFB,0x6B05, +0x8616,0x6AFA,0x6B12,0x6B16,0x9B31,0x6B1F,0x6B38,0x6B37, +0x76DC,0x6B39,0x98EE,0x6B47,0x6B43,0x6B49,0x6B50,0x6B59, +0x6B54,0x6B5B,0x6B5F,0x6B61,0x6B78,0x6B79,0x6B7F,0x6B80, +0x6B84,0x6B83,0x6B8D,0x6B98,0x6B95,0x6B9E,0x6BA4,0x6BAA, +0x6BAB,0x6BAF,0x6BB2,0x6BB1,0x6BB3,0x6BB7,0x6BBC,0x6BC6, +0x6BCB,0x6BD3,0x6BDF,0x6BEC,0x6BEB,0x6BF3,0x6BEF,0x9EBE, +0x6C08,0x6C13,0x6C14,0x6C1B,0x6C24,0x6C23,0x6C5E,0x6C55, +0x6C62,0x6C6A,0x6C82,0x6C8D,0x6C9A,0x6C81,0x6C9B,0x6C7E, +0x6C68,0x6C73,0x6C92,0x6C90,0x6CC4,0x6CF1,0x6CD3,0x6CBD, +0x6CD7,0x6CC5,0x6CDD,0x6CAE,0x6CB1,0x6CBE}; + +/* page 54 0x5E21-0x5E7E */ +static uint16 tab_jisx0208_uni54[]={ +0x6CBA,0x6CDB,0x6CEF,0x6CD9,0x6CEA,0x6D1F,0x884D,0x6D36, +0x6D2B,0x6D3D,0x6D38,0x6D19,0x6D35,0x6D33,0x6D12,0x6D0C, +0x6D63,0x6D93,0x6D64,0x6D5A,0x6D79,0x6D59,0x6D8E,0x6D95, +0x6FE4,0x6D85,0x6DF9,0x6E15,0x6E0A,0x6DB5,0x6DC7,0x6DE6, +0x6DB8,0x6DC6,0x6DEC,0x6DDE,0x6DCC,0x6DE8,0x6DD2,0x6DC5, +0x6DFA,0x6DD9,0x6DE4,0x6DD5,0x6DEA,0x6DEE,0x6E2D,0x6E6E, +0x6E2E,0x6E19,0x6E72,0x6E5F,0x6E3E,0x6E23,0x6E6B,0x6E2B, +0x6E76,0x6E4D,0x6E1F,0x6E43,0x6E3A,0x6E4E,0x6E24,0x6EFF, +0x6E1D,0x6E38,0x6E82,0x6EAA,0x6E98,0x6EC9,0x6EB7,0x6ED3, +0x6EBD,0x6EAF,0x6EC4,0x6EB2,0x6ED4,0x6ED5,0x6E8F,0x6EA5, +0x6EC2,0x6E9F,0x6F41,0x6F11,0x704C,0x6EEC,0x6EF8,0x6EFE, +0x6F3F,0x6EF2,0x6F31,0x6EEF,0x6F32,0x6ECC}; + +/* page 55 0x5F21-0x5F7E */ +static uint16 tab_jisx0208_uni55[]={ +0x6F3E,0x6F13,0x6EF7,0x6F86,0x6F7A,0x6F78,0x6F81,0x6F80, +0x6F6F,0x6F5B,0x6FF3,0x6F6D,0x6F82,0x6F7C,0x6F58,0x6F8E, +0x6F91,0x6FC2,0x6F66,0x6FB3,0x6FA3,0x6FA1,0x6FA4,0x6FB9, +0x6FC6,0x6FAA,0x6FDF,0x6FD5,0x6FEC,0x6FD4,0x6FD8,0x6FF1, +0x6FEE,0x6FDB,0x7009,0x700B,0x6FFA,0x7011,0x7001,0x700F, +0x6FFE,0x701B,0x701A,0x6F74,0x701D,0x7018,0x701F,0x7030, +0x703E,0x7032,0x7051,0x7063,0x7099,0x7092,0x70AF,0x70F1, +0x70AC,0x70B8,0x70B3,0x70AE,0x70DF,0x70CB,0x70DD,0x70D9, +0x7109,0x70FD,0x711C,0x7119,0x7165,0x7155,0x7188,0x7166, +0x7162,0x714C,0x7156,0x716C,0x718F,0x71FB,0x7184,0x7195, +0x71A8,0x71AC,0x71D7,0x71B9,0x71BE,0x71D2,0x71C9,0x71D4, +0x71CE,0x71E0,0x71EC,0x71E7,0x71F5,0x71FC}; + +/* page 56 0x6021-0x607E */ +static uint16 tab_jisx0208_uni56[]={ +0x71F9,0x71FF,0x720D,0x7210,0x721B,0x7228,0x722D,0x722C, +0x7230,0x7232,0x723B,0x723C,0x723F,0x7240,0x7246,0x724B, +0x7258,0x7274,0x727E,0x7282,0x7281,0x7287,0x7292,0x7296, +0x72A2,0x72A7,0x72B9,0x72B2,0x72C3,0x72C6,0x72C4,0x72CE, +0x72D2,0x72E2,0x72E0,0x72E1,0x72F9,0x72F7,0x500F,0x7317, +0x730A,0x731C,0x7316,0x731D,0x7334,0x732F,0x7329,0x7325, +0x733E,0x734E,0x734F,0x9ED8,0x7357,0x736A,0x7368,0x7370, +0x7378,0x7375,0x737B,0x737A,0x73C8,0x73B3,0x73CE,0x73BB, +0x73C0,0x73E5,0x73EE,0x73DE,0x74A2,0x7405,0x746F,0x7425, +0x73F8,0x7432,0x743A,0x7455,0x743F,0x745F,0x7459,0x7441, +0x745C,0x7469,0x7470,0x7463,0x746A,0x7476,0x747E,0x748B, +0x749E,0x74A7,0x74CA,0x74CF,0x74D4,0x73F1}; + +/* page 57 0x6121-0x617E */ +static uint16 tab_jisx0208_uni57[]={ +0x74E0,0x74E3,0x74E7,0x74E9,0x74EE,0x74F2,0x74F0,0x74F1, +0x74F8,0x74F7,0x7504,0x7503,0x7505,0x750C,0x750E,0x750D, +0x7515,0x7513,0x751E,0x7526,0x752C,0x753C,0x7544,0x754D, +0x754A,0x7549,0x755B,0x7546,0x755A,0x7569,0x7564,0x7567, +0x756B,0x756D,0x7578,0x7576,0x7586,0x7587,0x7574,0x758A, +0x7589,0x7582,0x7594,0x759A,0x759D,0x75A5,0x75A3,0x75C2, +0x75B3,0x75C3,0x75B5,0x75BD,0x75B8,0x75BC,0x75B1,0x75CD, +0x75CA,0x75D2,0x75D9,0x75E3,0x75DE,0x75FE,0x75FF,0x75FC, +0x7601,0x75F0,0x75FA,0x75F2,0x75F3,0x760B,0x760D,0x7609, +0x761F,0x7627,0x7620,0x7621,0x7622,0x7624,0x7634,0x7630, +0x763B,0x7647,0x7648,0x7646,0x765C,0x7658,0x7661,0x7662, +0x7668,0x7669,0x766A,0x7667,0x766C,0x7670}; + +/* page 58 0x6221-0x627E */ +static uint16 tab_jisx0208_uni58[]={ +0x7672,0x7676,0x7678,0x767C,0x7680,0x7683,0x7688,0x768B, +0x768E,0x7696,0x7693,0x7699,0x769A,0x76B0,0x76B4,0x76B8, +0x76B9,0x76BA,0x76C2,0x76CD,0x76D6,0x76D2,0x76DE,0x76E1, +0x76E5,0x76E7,0x76EA,0x862F,0x76FB,0x7708,0x7707,0x7704, +0x7729,0x7724,0x771E,0x7725,0x7726,0x771B,0x7737,0x7738, +0x7747,0x775A,0x7768,0x776B,0x775B,0x7765,0x777F,0x777E, +0x7779,0x778E,0x778B,0x7791,0x77A0,0x779E,0x77B0,0x77B6, +0x77B9,0x77BF,0x77BC,0x77BD,0x77BB,0x77C7,0x77CD,0x77D7, +0x77DA,0x77DC,0x77E3,0x77EE,0x77FC,0x780C,0x7812,0x7926, +0x7820,0x792A,0x7845,0x788E,0x7874,0x7886,0x787C,0x789A, +0x788C,0x78A3,0x78B5,0x78AA,0x78AF,0x78D1,0x78C6,0x78CB, +0x78D4,0x78BE,0x78BC,0x78C5,0x78CA,0x78EC}; + +/* page 59 0x6321-0x637E */ +static uint16 tab_jisx0208_uni59[]={ +0x78E7,0x78DA,0x78FD,0x78F4,0x7907,0x7912,0x7911,0x7919, +0x792C,0x792B,0x7940,0x7960,0x7957,0x795F,0x795A,0x7955, +0x7953,0x797A,0x797F,0x798A,0x799D,0x79A7,0x9F4B,0x79AA, +0x79AE,0x79B3,0x79B9,0x79BA,0x79C9,0x79D5,0x79E7,0x79EC, +0x79E1,0x79E3,0x7A08,0x7A0D,0x7A18,0x7A19,0x7A20,0x7A1F, +0x7980,0x7A31,0x7A3B,0x7A3E,0x7A37,0x7A43,0x7A57,0x7A49, +0x7A61,0x7A62,0x7A69,0x9F9D,0x7A70,0x7A79,0x7A7D,0x7A88, +0x7A97,0x7A95,0x7A98,0x7A96,0x7AA9,0x7AC8,0x7AB0,0x7AB6, +0x7AC5,0x7AC4,0x7ABF,0x9083,0x7AC7,0x7ACA,0x7ACD,0x7ACF, +0x7AD5,0x7AD3,0x7AD9,0x7ADA,0x7ADD,0x7AE1,0x7AE2,0x7AE6, +0x7AED,0x7AF0,0x7B02,0x7B0F,0x7B0A,0x7B06,0x7B33,0x7B18, +0x7B19,0x7B1E,0x7B35,0x7B28,0x7B36,0x7B50}; + +/* page 60 0x6421-0x647E */ +static uint16 tab_jisx0208_uni60[]={ +0x7B7A,0x7B04,0x7B4D,0x7B0B,0x7B4C,0x7B45,0x7B75,0x7B65, +0x7B74,0x7B67,0x7B70,0x7B71,0x7B6C,0x7B6E,0x7B9D,0x7B98, +0x7B9F,0x7B8D,0x7B9C,0x7B9A,0x7B8B,0x7B92,0x7B8F,0x7B5D, +0x7B99,0x7BCB,0x7BC1,0x7BCC,0x7BCF,0x7BB4,0x7BC6,0x7BDD, +0x7BE9,0x7C11,0x7C14,0x7BE6,0x7BE5,0x7C60,0x7C00,0x7C07, +0x7C13,0x7BF3,0x7BF7,0x7C17,0x7C0D,0x7BF6,0x7C23,0x7C27, +0x7C2A,0x7C1F,0x7C37,0x7C2B,0x7C3D,0x7C4C,0x7C43,0x7C54, +0x7C4F,0x7C40,0x7C50,0x7C58,0x7C5F,0x7C64,0x7C56,0x7C65, +0x7C6C,0x7C75,0x7C83,0x7C90,0x7CA4,0x7CAD,0x7CA2,0x7CAB, +0x7CA1,0x7CA8,0x7CB3,0x7CB2,0x7CB1,0x7CAE,0x7CB9,0x7CBD, +0x7CC0,0x7CC5,0x7CC2,0x7CD8,0x7CD2,0x7CDC,0x7CE2,0x9B3B, +0x7CEF,0x7CF2,0x7CF4,0x7CF6,0x7CFA,0x7D06}; + +/* page 61 0x6521-0x657E */ +static uint16 tab_jisx0208_uni61[]={ +0x7D02,0x7D1C,0x7D15,0x7D0A,0x7D45,0x7D4B,0x7D2E,0x7D32, +0x7D3F,0x7D35,0x7D46,0x7D73,0x7D56,0x7D4E,0x7D72,0x7D68, +0x7D6E,0x7D4F,0x7D63,0x7D93,0x7D89,0x7D5B,0x7D8F,0x7D7D, +0x7D9B,0x7DBA,0x7DAE,0x7DA3,0x7DB5,0x7DC7,0x7DBD,0x7DAB, +0x7E3D,0x7DA2,0x7DAF,0x7DDC,0x7DB8,0x7D9F,0x7DB0,0x7DD8, +0x7DDD,0x7DE4,0x7DDE,0x7DFB,0x7DF2,0x7DE1,0x7E05,0x7E0A, +0x7E23,0x7E21,0x7E12,0x7E31,0x7E1F,0x7E09,0x7E0B,0x7E22, +0x7E46,0x7E66,0x7E3B,0x7E35,0x7E39,0x7E43,0x7E37,0x7E32, +0x7E3A,0x7E67,0x7E5D,0x7E56,0x7E5E,0x7E59,0x7E5A,0x7E79, +0x7E6A,0x7E69,0x7E7C,0x7E7B,0x7E83,0x7DD5,0x7E7D,0x8FAE, +0x7E7F,0x7E88,0x7E89,0x7E8C,0x7E92,0x7E90,0x7E93,0x7E94, +0x7E96,0x7E8E,0x7E9B,0x7E9C,0x7F38,0x7F3A}; + +/* page 62 0x6621-0x667E */ +static uint16 tab_jisx0208_uni62[]={ +0x7F45,0x7F4C,0x7F4D,0x7F4E,0x7F50,0x7F51,0x7F55,0x7F54, +0x7F58,0x7F5F,0x7F60,0x7F68,0x7F69,0x7F67,0x7F78,0x7F82, +0x7F86,0x7F83,0x7F88,0x7F87,0x7F8C,0x7F94,0x7F9E,0x7F9D, +0x7F9A,0x7FA3,0x7FAF,0x7FB2,0x7FB9,0x7FAE,0x7FB6,0x7FB8, +0x8B71,0x7FC5,0x7FC6,0x7FCA,0x7FD5,0x7FD4,0x7FE1,0x7FE6, +0x7FE9,0x7FF3,0x7FF9,0x98DC,0x8006,0x8004,0x800B,0x8012, +0x8018,0x8019,0x801C,0x8021,0x8028,0x803F,0x803B,0x804A, +0x8046,0x8052,0x8058,0x805A,0x805F,0x8062,0x8068,0x8073, +0x8072,0x8070,0x8076,0x8079,0x807D,0x807F,0x8084,0x8086, +0x8085,0x809B,0x8093,0x809A,0x80AD,0x5190,0x80AC,0x80DB, +0x80E5,0x80D9,0x80DD,0x80C4,0x80DA,0x80D6,0x8109,0x80EF, +0x80F1,0x811B,0x8129,0x8123,0x812F,0x814B}; + +/* page 63 0x6721-0x677E */ +static uint16 tab_jisx0208_uni63[]={ +0x968B,0x8146,0x813E,0x8153,0x8151,0x80FC,0x8171,0x816E, +0x8165,0x8166,0x8174,0x8183,0x8188,0x818A,0x8180,0x8182, +0x81A0,0x8195,0x81A4,0x81A3,0x815F,0x8193,0x81A9,0x81B0, +0x81B5,0x81BE,0x81B8,0x81BD,0x81C0,0x81C2,0x81BA,0x81C9, +0x81CD,0x81D1,0x81D9,0x81D8,0x81C8,0x81DA,0x81DF,0x81E0, +0x81E7,0x81FA,0x81FB,0x81FE,0x8201,0x8202,0x8205,0x8207, +0x820A,0x820D,0x8210,0x8216,0x8229,0x822B,0x8238,0x8233, +0x8240,0x8259,0x8258,0x825D,0x825A,0x825F,0x8264,0x8262, +0x8268,0x826A,0x826B,0x822E,0x8271,0x8277,0x8278,0x827E, +0x828D,0x8292,0x82AB,0x829F,0x82BB,0x82AC,0x82E1,0x82E3, +0x82DF,0x82D2,0x82F4,0x82F3,0x82FA,0x8393,0x8303,0x82FB, +0x82F9,0x82DE,0x8306,0x82DC,0x8309,0x82D9}; + +/* page 64 0x6821-0x687E */ +static uint16 tab_jisx0208_uni64[]={ +0x8335,0x8334,0x8316,0x8332,0x8331,0x8340,0x8339,0x8350, +0x8345,0x832F,0x832B,0x8317,0x8318,0x8385,0x839A,0x83AA, +0x839F,0x83A2,0x8396,0x8323,0x838E,0x8387,0x838A,0x837C, +0x83B5,0x8373,0x8375,0x83A0,0x8389,0x83A8,0x83F4,0x8413, +0x83EB,0x83CE,0x83FD,0x8403,0x83D8,0x840B,0x83C1,0x83F7, +0x8407,0x83E0,0x83F2,0x840D,0x8422,0x8420,0x83BD,0x8438, +0x8506,0x83FB,0x846D,0x842A,0x843C,0x855A,0x8484,0x8477, +0x846B,0x84AD,0x846E,0x8482,0x8469,0x8446,0x842C,0x846F, +0x8479,0x8435,0x84CA,0x8462,0x84B9,0x84BF,0x849F,0x84D9, +0x84CD,0x84BB,0x84DA,0x84D0,0x84C1,0x84C6,0x84D6,0x84A1, +0x8521,0x84FF,0x84F4,0x8517,0x8518,0x852C,0x851F,0x8515, +0x8514,0x84FC,0x8540,0x8563,0x8558,0x8548}; + +/* page 65 0x6921-0x697E */ +static uint16 tab_jisx0208_uni65[]={ +0x8541,0x8602,0x854B,0x8555,0x8580,0x85A4,0x8588,0x8591, +0x858A,0x85A8,0x856D,0x8594,0x859B,0x85EA,0x8587,0x859C, +0x8577,0x857E,0x8590,0x85C9,0x85BA,0x85CF,0x85B9,0x85D0, +0x85D5,0x85DD,0x85E5,0x85DC,0x85F9,0x860A,0x8613,0x860B, +0x85FE,0x85FA,0x8606,0x8622,0x861A,0x8630,0x863F,0x864D, +0x4E55,0x8654,0x865F,0x8667,0x8671,0x8693,0x86A3,0x86A9, +0x86AA,0x868B,0x868C,0x86B6,0x86AF,0x86C4,0x86C6,0x86B0, +0x86C9,0x8823,0x86AB,0x86D4,0x86DE,0x86E9,0x86EC,0x86DF, +0x86DB,0x86EF,0x8712,0x8706,0x8708,0x8700,0x8703,0x86FB, +0x8711,0x8709,0x870D,0x86F9,0x870A,0x8734,0x873F,0x8737, +0x873B,0x8725,0x8729,0x871A,0x8760,0x875F,0x8778,0x874C, +0x874E,0x8774,0x8757,0x8768,0x876E,0x8759}; + +/* page 66 0x6A21-0x6A7E */ +static uint16 tab_jisx0208_uni66[]={ +0x8753,0x8763,0x876A,0x8805,0x87A2,0x879F,0x8782,0x87AF, +0x87CB,0x87BD,0x87C0,0x87D0,0x96D6,0x87AB,0x87C4,0x87B3, +0x87C7,0x87C6,0x87BB,0x87EF,0x87F2,0x87E0,0x880F,0x880D, +0x87FE,0x87F6,0x87F7,0x880E,0x87D2,0x8811,0x8816,0x8815, +0x8822,0x8821,0x8831,0x8836,0x8839,0x8827,0x883B,0x8844, +0x8842,0x8852,0x8859,0x885E,0x8862,0x886B,0x8881,0x887E, +0x889E,0x8875,0x887D,0x88B5,0x8872,0x8882,0x8897,0x8892, +0x88AE,0x8899,0x88A2,0x888D,0x88A4,0x88B0,0x88BF,0x88B1, +0x88C3,0x88C4,0x88D4,0x88D8,0x88D9,0x88DD,0x88F9,0x8902, +0x88FC,0x88F4,0x88E8,0x88F2,0x8904,0x890C,0x890A,0x8913, +0x8943,0x891E,0x8925,0x892A,0x892B,0x8941,0x8944,0x893B, +0x8936,0x8938,0x894C,0x891D,0x8960,0x895E}; + +/* page 67 0x6B21-0x6B7E */ +static uint16 tab_jisx0208_uni67[]={ +0x8966,0x8964,0x896D,0x896A,0x896F,0x8974,0x8977,0x897E, +0x8983,0x8988,0x898A,0x8993,0x8998,0x89A1,0x89A9,0x89A6, +0x89AC,0x89AF,0x89B2,0x89BA,0x89BD,0x89BF,0x89C0,0x89DA, +0x89DC,0x89DD,0x89E7,0x89F4,0x89F8,0x8A03,0x8A16,0x8A10, +0x8A0C,0x8A1B,0x8A1D,0x8A25,0x8A36,0x8A41,0x8A5B,0x8A52, +0x8A46,0x8A48,0x8A7C,0x8A6D,0x8A6C,0x8A62,0x8A85,0x8A82, +0x8A84,0x8AA8,0x8AA1,0x8A91,0x8AA5,0x8AA6,0x8A9A,0x8AA3, +0x8AC4,0x8ACD,0x8AC2,0x8ADA,0x8AEB,0x8AF3,0x8AE7,0x8AE4, +0x8AF1,0x8B14,0x8AE0,0x8AE2,0x8AF7,0x8ADE,0x8ADB,0x8B0C, +0x8B07,0x8B1A,0x8AE1,0x8B16,0x8B10,0x8B17,0x8B20,0x8B33, +0x97AB,0x8B26,0x8B2B,0x8B3E,0x8B28,0x8B41,0x8B4C,0x8B4F, +0x8B4E,0x8B49,0x8B56,0x8B5B,0x8B5A,0x8B6B}; + +/* page 68 0x6C21-0x6C7E */ +static uint16 tab_jisx0208_uni68[]={ +0x8B5F,0x8B6C,0x8B6F,0x8B74,0x8B7D,0x8B80,0x8B8C,0x8B8E, +0x8B92,0x8B93,0x8B96,0x8B99,0x8B9A,0x8C3A,0x8C41,0x8C3F, +0x8C48,0x8C4C,0x8C4E,0x8C50,0x8C55,0x8C62,0x8C6C,0x8C78, +0x8C7A,0x8C82,0x8C89,0x8C85,0x8C8A,0x8C8D,0x8C8E,0x8C94, +0x8C7C,0x8C98,0x621D,0x8CAD,0x8CAA,0x8CBD,0x8CB2,0x8CB3, +0x8CAE,0x8CB6,0x8CC8,0x8CC1,0x8CE4,0x8CE3,0x8CDA,0x8CFD, +0x8CFA,0x8CFB,0x8D04,0x8D05,0x8D0A,0x8D07,0x8D0F,0x8D0D, +0x8D10,0x9F4E,0x8D13,0x8CCD,0x8D14,0x8D16,0x8D67,0x8D6D, +0x8D71,0x8D73,0x8D81,0x8D99,0x8DC2,0x8DBE,0x8DBA,0x8DCF, +0x8DDA,0x8DD6,0x8DCC,0x8DDB,0x8DCB,0x8DEA,0x8DEB,0x8DDF, +0x8DE3,0x8DFC,0x8E08,0x8E09,0x8DFF,0x8E1D,0x8E1E,0x8E10, +0x8E1F,0x8E42,0x8E35,0x8E30,0x8E34,0x8E4A}; + +/* page 69 0x6D21-0x6D7E */ +static uint16 tab_jisx0208_uni69[]={ +0x8E47,0x8E49,0x8E4C,0x8E50,0x8E48,0x8E59,0x8E64,0x8E60, +0x8E2A,0x8E63,0x8E55,0x8E76,0x8E72,0x8E7C,0x8E81,0x8E87, +0x8E85,0x8E84,0x8E8B,0x8E8A,0x8E93,0x8E91,0x8E94,0x8E99, +0x8EAA,0x8EA1,0x8EAC,0x8EB0,0x8EC6,0x8EB1,0x8EBE,0x8EC5, +0x8EC8,0x8ECB,0x8EDB,0x8EE3,0x8EFC,0x8EFB,0x8EEB,0x8EFE, +0x8F0A,0x8F05,0x8F15,0x8F12,0x8F19,0x8F13,0x8F1C,0x8F1F, +0x8F1B,0x8F0C,0x8F26,0x8F33,0x8F3B,0x8F39,0x8F45,0x8F42, +0x8F3E,0x8F4C,0x8F49,0x8F46,0x8F4E,0x8F57,0x8F5C,0x8F62, +0x8F63,0x8F64,0x8F9C,0x8F9F,0x8FA3,0x8FAD,0x8FAF,0x8FB7, +0x8FDA,0x8FE5,0x8FE2,0x8FEA,0x8FEF,0x9087,0x8FF4,0x9005, +0x8FF9,0x8FFA,0x9011,0x9015,0x9021,0x900D,0x901E,0x9016, +0x900B,0x9027,0x9036,0x9035,0x9039,0x8FF8}; + +/* page 70 0x6E21-0x6E7E */ +static uint16 tab_jisx0208_uni70[]={ +0x904F,0x9050,0x9051,0x9052,0x900E,0x9049,0x903E,0x9056, +0x9058,0x905E,0x9068,0x906F,0x9076,0x96A8,0x9072,0x9082, +0x907D,0x9081,0x9080,0x908A,0x9089,0x908F,0x90A8,0x90AF, +0x90B1,0x90B5,0x90E2,0x90E4,0x6248,0x90DB,0x9102,0x9112, +0x9119,0x9132,0x9130,0x914A,0x9156,0x9158,0x9163,0x9165, +0x9169,0x9173,0x9172,0x918B,0x9189,0x9182,0x91A2,0x91AB, +0x91AF,0x91AA,0x91B5,0x91B4,0x91BA,0x91C0,0x91C1,0x91C9, +0x91CB,0x91D0,0x91D6,0x91DF,0x91E1,0x91DB,0x91FC,0x91F5, +0x91F6,0x921E,0x91FF,0x9214,0x922C,0x9215,0x9211,0x925E, +0x9257,0x9245,0x9249,0x9264,0x9248,0x9295,0x923F,0x924B, +0x9250,0x929C,0x9296,0x9293,0x929B,0x925A,0x92CF,0x92B9, +0x92B7,0x92E9,0x930F,0x92FA,0x9344,0x932E}; + +/* page 71 0x6F21-0x6F7E */ +static uint16 tab_jisx0208_uni71[]={ +0x9319,0x9322,0x931A,0x9323,0x933A,0x9335,0x933B,0x935C, +0x9360,0x937C,0x936E,0x9356,0x93B0,0x93AC,0x93AD,0x9394, +0x93B9,0x93D6,0x93D7,0x93E8,0x93E5,0x93D8,0x93C3,0x93DD, +0x93D0,0x93C8,0x93E4,0x941A,0x9414,0x9413,0x9403,0x9407, +0x9410,0x9436,0x942B,0x9435,0x9421,0x943A,0x9441,0x9452, +0x9444,0x945B,0x9460,0x9462,0x945E,0x946A,0x9229,0x9470, +0x9475,0x9477,0x947D,0x945A,0x947C,0x947E,0x9481,0x947F, +0x9582,0x9587,0x958A,0x9594,0x9596,0x9598,0x9599,0x95A0, +0x95A8,0x95A7,0x95AD,0x95BC,0x95BB,0x95B9,0x95BE,0x95CA, +0x6FF6,0x95C3,0x95CD,0x95CC,0x95D5,0x95D4,0x95D6,0x95DC, +0x95E1,0x95E5,0x95E2,0x9621,0x9628,0x962E,0x962F,0x9642, +0x964C,0x964F,0x964B,0x9677,0x965C,0x965E}; + +/* page 72 0x7021-0x707E */ +static uint16 tab_jisx0208_uni72[]={ +0x965D,0x965F,0x9666,0x9672,0x966C,0x968D,0x9698,0x9695, +0x9697,0x96AA,0x96A7,0x96B1,0x96B2,0x96B0,0x96B4,0x96B6, +0x96B8,0x96B9,0x96CE,0x96CB,0x96C9,0x96CD,0x894D,0x96DC, +0x970D,0x96D5,0x96F9,0x9704,0x9706,0x9708,0x9713,0x970E, +0x9711,0x970F,0x9716,0x9719,0x9724,0x972A,0x9730,0x9739, +0x973D,0x973E,0x9744,0x9746,0x9748,0x9742,0x9749,0x975C, +0x9760,0x9764,0x9766,0x9768,0x52D2,0x976B,0x9771,0x9779, +0x9785,0x977C,0x9781,0x977A,0x9786,0x978B,0x978F,0x9790, +0x979C,0x97A8,0x97A6,0x97A3,0x97B3,0x97B4,0x97C3,0x97C6, +0x97C8,0x97CB,0x97DC,0x97ED,0x9F4F,0x97F2,0x7ADF,0x97F6, +0x97F5,0x980F,0x980C,0x9838,0x9824,0x9821,0x9837,0x983D, +0x9846,0x984F,0x984B,0x986B,0x986F,0x9870}; + +/* page 73 0x7121-0x717E */ +static uint16 tab_jisx0208_uni73[]={ +0x9871,0x9874,0x9873,0x98AA,0x98AF,0x98B1,0x98B6,0x98C4, +0x98C3,0x98C6,0x98E9,0x98EB,0x9903,0x9909,0x9912,0x9914, +0x9918,0x9921,0x991D,0x991E,0x9924,0x9920,0x992C,0x992E, +0x993D,0x993E,0x9942,0x9949,0x9945,0x9950,0x994B,0x9951, +0x9952,0x994C,0x9955,0x9997,0x9998,0x99A5,0x99AD,0x99AE, +0x99BC,0x99DF,0x99DB,0x99DD,0x99D8,0x99D1,0x99ED,0x99EE, +0x99F1,0x99F2,0x99FB,0x99F8,0x9A01,0x9A0F,0x9A05,0x99E2, +0x9A19,0x9A2B,0x9A37,0x9A45,0x9A42,0x9A40,0x9A43,0x9A3E, +0x9A55,0x9A4D,0x9A5B,0x9A57,0x9A5F,0x9A62,0x9A65,0x9A64, +0x9A69,0x9A6B,0x9A6A,0x9AAD,0x9AB0,0x9ABC,0x9AC0,0x9ACF, +0x9AD1,0x9AD3,0x9AD4,0x9ADE,0x9ADF,0x9AE2,0x9AE3,0x9AE6, +0x9AEF,0x9AEB,0x9AEE,0x9AF4,0x9AF1,0x9AF7}; + +/* page 74 0x7221-0x727E */ +static uint16 tab_jisx0208_uni74[]={ +0x9AFB,0x9B06,0x9B18,0x9B1A,0x9B1F,0x9B22,0x9B23,0x9B25, +0x9B27,0x9B28,0x9B29,0x9B2A,0x9B2E,0x9B2F,0x9B32,0x9B44, +0x9B43,0x9B4F,0x9B4D,0x9B4E,0x9B51,0x9B58,0x9B74,0x9B93, +0x9B83,0x9B91,0x9B96,0x9B97,0x9B9F,0x9BA0,0x9BA8,0x9BB4, +0x9BC0,0x9BCA,0x9BB9,0x9BC6,0x9BCF,0x9BD1,0x9BD2,0x9BE3, +0x9BE2,0x9BE4,0x9BD4,0x9BE1,0x9C3A,0x9BF2,0x9BF1,0x9BF0, +0x9C15,0x9C14,0x9C09,0x9C13,0x9C0C,0x9C06,0x9C08,0x9C12, +0x9C0A,0x9C04,0x9C2E,0x9C1B,0x9C25,0x9C24,0x9C21,0x9C30, +0x9C47,0x9C32,0x9C46,0x9C3E,0x9C5A,0x9C60,0x9C67,0x9C76, +0x9C78,0x9CE7,0x9CEC,0x9CF0,0x9D09,0x9D08,0x9CEB,0x9D03, +0x9D06,0x9D2A,0x9D26,0x9DAF,0x9D23,0x9D1F,0x9D44,0x9D15, +0x9D12,0x9D41,0x9D3F,0x9D3E,0x9D46,0x9D48}; + +/* page 75 0x7321-0x737E */ +static uint16 tab_jisx0208_uni75[]={ +0x9D5D,0x9D5E,0x9D64,0x9D51,0x9D50,0x9D59,0x9D72,0x9D89, +0x9D87,0x9DAB,0x9D6F,0x9D7A,0x9D9A,0x9DA4,0x9DA9,0x9DB2, +0x9DC4,0x9DC1,0x9DBB,0x9DB8,0x9DBA,0x9DC6,0x9DCF,0x9DC2, +0x9DD9,0x9DD3,0x9DF8,0x9DE6,0x9DED,0x9DEF,0x9DFD,0x9E1A, +0x9E1B,0x9E1E,0x9E75,0x9E79,0x9E7D,0x9E81,0x9E88,0x9E8B, +0x9E8C,0x9E92,0x9E95,0x9E91,0x9E9D,0x9EA5,0x9EA9,0x9EB8, +0x9EAA,0x9EAD,0x9761,0x9ECC,0x9ECE,0x9ECF,0x9ED0,0x9ED4, +0x9EDC,0x9EDE,0x9EDD,0x9EE0,0x9EE5,0x9EE8,0x9EEF,0x9EF4, +0x9EF6,0x9EF7,0x9EF9,0x9EFB,0x9EFC,0x9EFD,0x9F07,0x9F08, +0x76B7,0x9F15,0x9F21,0x9F2C,0x9F3E,0x9F4A,0x9F52,0x9F54, +0x9F63,0x9F5F,0x9F60,0x9F61,0x9F66,0x9F67,0x9F6C,0x9F6A, +0x9F77,0x9F72,0x9F76,0x9F95,0x9F9C,0x9FA0}; + +/* page 76 0x7421-0x7426 */ +static uint16 tab_jisx0208_uni76[]={ +0x582F,0x69C7,0x9059,0x7464,0x51DC,0x7199}; + +static int +my_jisx0208_uni_onechar(int code){ + if ((code>=0x2121)&&(code<=0x217E)) + return(tab_jisx0208_uni0[code-0x2121]); + if ((code>=0x2221)&&(code<=0x227E)) + return(tab_jisx0208_uni1[code-0x2221]); + if ((code>=0x2330)&&(code<=0x237A)) + return(tab_jisx0208_uni2[code-0x2330]); + if ((code>=0x2421)&&(code<=0x2473)) + return(tab_jisx0208_uni3[code-0x2421]); + if ((code>=0x2521)&&(code<=0x2576)) + return(tab_jisx0208_uni4[code-0x2521]); + if ((code>=0x2621)&&(code<=0x2658)) + return(tab_jisx0208_uni5[code-0x2621]); + if ((code>=0x2721)&&(code<=0x2771)) + return(tab_jisx0208_uni6[code-0x2721]); + if ((code>=0x2821)&&(code<=0x2840)) + return(tab_jisx0208_uni7[code-0x2821]); + if ((code>=0x3021)&&(code<=0x307E)) + return(tab_jisx0208_uni8[code-0x3021]); + if ((code>=0x3121)&&(code<=0x317E)) + return(tab_jisx0208_uni9[code-0x3121]); + if ((code>=0x3221)&&(code<=0x327E)) + return(tab_jisx0208_uni10[code-0x3221]); + if ((code>=0x3321)&&(code<=0x337E)) + return(tab_jisx0208_uni11[code-0x3321]); + if ((code>=0x3421)&&(code<=0x347E)) + return(tab_jisx0208_uni12[code-0x3421]); + if ((code>=0x3521)&&(code<=0x357E)) + return(tab_jisx0208_uni13[code-0x3521]); + if ((code>=0x3621)&&(code<=0x367E)) + return(tab_jisx0208_uni14[code-0x3621]); + if ((code>=0x3721)&&(code<=0x377E)) + return(tab_jisx0208_uni15[code-0x3721]); + if ((code>=0x3821)&&(code<=0x387E)) + return(tab_jisx0208_uni16[code-0x3821]); + if ((code>=0x3921)&&(code<=0x397E)) + return(tab_jisx0208_uni17[code-0x3921]); + if ((code>=0x3A21)&&(code<=0x3A7E)) + return(tab_jisx0208_uni18[code-0x3A21]); + if ((code>=0x3B21)&&(code<=0x3B7E)) + return(tab_jisx0208_uni19[code-0x3B21]); + if ((code>=0x3C21)&&(code<=0x3C7E)) + return(tab_jisx0208_uni20[code-0x3C21]); + if ((code>=0x3D21)&&(code<=0x3D7E)) + return(tab_jisx0208_uni21[code-0x3D21]); + if ((code>=0x3E21)&&(code<=0x3E7E)) + return(tab_jisx0208_uni22[code-0x3E21]); + if ((code>=0x3F21)&&(code<=0x3F7E)) + return(tab_jisx0208_uni23[code-0x3F21]); + if ((code>=0x4021)&&(code<=0x407E)) + return(tab_jisx0208_uni24[code-0x4021]); + if ((code>=0x4121)&&(code<=0x417E)) + return(tab_jisx0208_uni25[code-0x4121]); + if ((code>=0x4221)&&(code<=0x427E)) + return(tab_jisx0208_uni26[code-0x4221]); + if ((code>=0x4321)&&(code<=0x437E)) + return(tab_jisx0208_uni27[code-0x4321]); + if ((code>=0x4421)&&(code<=0x447E)) + return(tab_jisx0208_uni28[code-0x4421]); + if ((code>=0x4521)&&(code<=0x457E)) + return(tab_jisx0208_uni29[code-0x4521]); + if ((code>=0x4621)&&(code<=0x467E)) + return(tab_jisx0208_uni30[code-0x4621]); + if ((code>=0x4721)&&(code<=0x477E)) + return(tab_jisx0208_uni31[code-0x4721]); + if ((code>=0x4821)&&(code<=0x487E)) + return(tab_jisx0208_uni32[code-0x4821]); + if ((code>=0x4921)&&(code<=0x497E)) + return(tab_jisx0208_uni33[code-0x4921]); + if ((code>=0x4A21)&&(code<=0x4A7E)) + return(tab_jisx0208_uni34[code-0x4A21]); + if ((code>=0x4B21)&&(code<=0x4B7E)) + return(tab_jisx0208_uni35[code-0x4B21]); + if ((code>=0x4C21)&&(code<=0x4C7E)) + return(tab_jisx0208_uni36[code-0x4C21]); + if ((code>=0x4D21)&&(code<=0x4D7E)) + return(tab_jisx0208_uni37[code-0x4D21]); + if ((code>=0x4E21)&&(code<=0x4E7E)) + return(tab_jisx0208_uni38[code-0x4E21]); + if ((code>=0x4F21)&&(code<=0x4F53)) + return(tab_jisx0208_uni39[code-0x4F21]); + if ((code>=0x5021)&&(code<=0x507E)) + return(tab_jisx0208_uni40[code-0x5021]); + if ((code>=0x5121)&&(code<=0x517E)) + return(tab_jisx0208_uni41[code-0x5121]); + if ((code>=0x5221)&&(code<=0x527E)) + return(tab_jisx0208_uni42[code-0x5221]); + if ((code>=0x5321)&&(code<=0x537E)) + return(tab_jisx0208_uni43[code-0x5321]); + if ((code>=0x5421)&&(code<=0x547E)) + return(tab_jisx0208_uni44[code-0x5421]); + if ((code>=0x5521)&&(code<=0x557E)) + return(tab_jisx0208_uni45[code-0x5521]); + if ((code>=0x5621)&&(code<=0x567E)) + return(tab_jisx0208_uni46[code-0x5621]); + if ((code>=0x5721)&&(code<=0x577E)) + return(tab_jisx0208_uni47[code-0x5721]); + if ((code>=0x5821)&&(code<=0x587E)) + return(tab_jisx0208_uni48[code-0x5821]); + if ((code>=0x5921)&&(code<=0x597E)) + return(tab_jisx0208_uni49[code-0x5921]); + if ((code>=0x5A21)&&(code<=0x5A7E)) + return(tab_jisx0208_uni50[code-0x5A21]); + if ((code>=0x5B21)&&(code<=0x5B7E)) + return(tab_jisx0208_uni51[code-0x5B21]); + if ((code>=0x5C21)&&(code<=0x5C7E)) + return(tab_jisx0208_uni52[code-0x5C21]); + if ((code>=0x5D21)&&(code<=0x5D7E)) + return(tab_jisx0208_uni53[code-0x5D21]); + if ((code>=0x5E21)&&(code<=0x5E7E)) + return(tab_jisx0208_uni54[code-0x5E21]); + if ((code>=0x5F21)&&(code<=0x5F7E)) + return(tab_jisx0208_uni55[code-0x5F21]); + if ((code>=0x6021)&&(code<=0x607E)) + return(tab_jisx0208_uni56[code-0x6021]); + if ((code>=0x6121)&&(code<=0x617E)) + return(tab_jisx0208_uni57[code-0x6121]); + if ((code>=0x6221)&&(code<=0x627E)) + return(tab_jisx0208_uni58[code-0x6221]); + if ((code>=0x6321)&&(code<=0x637E)) + return(tab_jisx0208_uni59[code-0x6321]); + if ((code>=0x6421)&&(code<=0x647E)) + return(tab_jisx0208_uni60[code-0x6421]); + if ((code>=0x6521)&&(code<=0x657E)) + return(tab_jisx0208_uni61[code-0x6521]); + if ((code>=0x6621)&&(code<=0x667E)) + return(tab_jisx0208_uni62[code-0x6621]); + if ((code>=0x6721)&&(code<=0x677E)) + return(tab_jisx0208_uni63[code-0x6721]); + if ((code>=0x6821)&&(code<=0x687E)) + return(tab_jisx0208_uni64[code-0x6821]); + if ((code>=0x6921)&&(code<=0x697E)) + return(tab_jisx0208_uni65[code-0x6921]); + if ((code>=0x6A21)&&(code<=0x6A7E)) + return(tab_jisx0208_uni66[code-0x6A21]); + if ((code>=0x6B21)&&(code<=0x6B7E)) + return(tab_jisx0208_uni67[code-0x6B21]); + if ((code>=0x6C21)&&(code<=0x6C7E)) + return(tab_jisx0208_uni68[code-0x6C21]); + if ((code>=0x6D21)&&(code<=0x6D7E)) + return(tab_jisx0208_uni69[code-0x6D21]); + if ((code>=0x6E21)&&(code<=0x6E7E)) + return(tab_jisx0208_uni70[code-0x6E21]); + if ((code>=0x6F21)&&(code<=0x6F7E)) + return(tab_jisx0208_uni71[code-0x6F21]); + if ((code>=0x7021)&&(code<=0x707E)) + return(tab_jisx0208_uni72[code-0x7021]); + if ((code>=0x7121)&&(code<=0x717E)) + return(tab_jisx0208_uni73[code-0x7121]); + if ((code>=0x7221)&&(code<=0x727E)) + return(tab_jisx0208_uni74[code-0x7221]); + if ((code>=0x7321)&&(code<=0x737E)) + return(tab_jisx0208_uni75[code-0x7321]); + if ((code>=0x7421)&&(code<=0x7426)) + return(tab_jisx0208_uni76[code-0x7421]); + return(0); +} + + +/* page 0 0x005C-0x005C */ +static uint16 tab_uni_jisx02080[]={ +0x2140}; + +/* page 1 0x00A2-0x00B6 */ +static uint16 tab_uni_jisx02081[]={ +0x2171,0x2172, 0, 0, 0,0x2178,0x212F, 0, + 0, 0,0x224C, 0, 0, 0,0x216B,0x215E, + 0, 0,0x212D, 0,0x2279}; + +/* page 2 0x00D7-0x00D7 */ +static uint16 tab_uni_jisx02082[]={ +0x215F}; + +/* page 3 0x00F7-0x00F7 */ +static uint16 tab_uni_jisx02083[]={ +0x2160}; + +/* page 4 0x0391-0x03C9 */ +static uint16 tab_uni_jisx02084[]={ +0x2621,0x2622,0x2623,0x2624,0x2625,0x2626,0x2627,0x2628, +0x2629,0x262A,0x262B,0x262C,0x262D,0x262E,0x262F,0x2630, +0x2631, 0,0x2632,0x2633,0x2634,0x2635,0x2636,0x2637, +0x2638, 0, 0, 0, 0, 0, 0, 0, +0x2641,0x2642,0x2643,0x2644,0x2645,0x2646,0x2647,0x2648, +0x2649,0x264A,0x264B,0x264C,0x264D,0x264E,0x264F,0x2650, +0x2651, 0,0x2652,0x2653,0x2654,0x2655,0x2656,0x2657, +0x2658}; + +/* page 5 0x0401-0x0451 */ +static uint16 tab_uni_jisx02085[]={ +0x2727, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x2721, +0x2722,0x2723,0x2724,0x2725,0x2726,0x2728,0x2729,0x272A, +0x272B,0x272C,0x272D,0x272E,0x272F,0x2730,0x2731,0x2732, +0x2733,0x2734,0x2735,0x2736,0x2737,0x2738,0x2739,0x273A, +0x273B,0x273C,0x273D,0x273E,0x273F,0x2740,0x2741,0x2751, +0x2752,0x2753,0x2754,0x2755,0x2756,0x2758,0x2759,0x275A, +0x275B,0x275C,0x275D,0x275E,0x275F,0x2760,0x2761,0x2762, +0x2763,0x2764,0x2765,0x2766,0x2767,0x2768,0x2769,0x276A, +0x276B,0x276C,0x276D,0x276E,0x276F,0x2770,0x2771, 0, +0x2757}; + +/* page 6 0x2010-0x203B */ +static uint16 tab_uni_jisx02086[]={ +0x213E, 0, 0, 0, 0,0x213D,0x2142, 0, +0x2146,0x2147, 0, 0,0x2148,0x2149, 0, 0, +0x2277,0x2278, 0, 0, 0,0x2145,0x2144, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2273, 0,0x216C,0x216D, 0, 0, 0, 0, + 0, 0, 0,0x2228}; + +/* page 7 0x2103-0x2103 */ +static uint16 tab_uni_jisx02087[]={ +0x216E}; + +/* page 8 0x212B-0x212B */ +static uint16 tab_uni_jisx02088[]={ +0x2272}; + +/* page 9 0x2190-0x2193 */ +static uint16 tab_uni_jisx02089[]={ +0x222B,0x222C,0x222A,0x222D}; + +/* page 10 0x21D2-0x21D4 */ +static uint16 tab_uni_jisx020810[]={ +0x224D, 0,0x224E}; + +/* page 11 0x2200-0x223D */ +static uint16 tab_uni_jisx020811[]={ +0x224F, 0,0x225F,0x2250, 0, 0, 0,0x2260, +0x223A, 0, 0,0x223B, 0, 0, 0, 0, + 0, 0,0x215D, 0, 0, 0, 0, 0, + 0, 0,0x2265, 0, 0,0x2267,0x2167, 0, +0x225C, 0, 0, 0, 0, 0, 0,0x224A, +0x224B,0x2241,0x2240,0x2269,0x226A, 0, 0, 0, + 0, 0, 0, 0,0x2168,0x2268, 0, 0, + 0, 0, 0, 0, 0,0x2266}; + +/* page 12 0x2252-0x226B */ +static uint16 tab_uni_jisx020812[]={ +0x2262, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x2162,0x2261, + 0, 0, 0, 0,0x2165,0x2166, 0, 0, +0x2263,0x2264}; + +/* page 13 0x2282-0x2287 */ +static uint16 tab_uni_jisx020813[]={ +0x223E,0x223F, 0, 0,0x223C,0x223D}; + +/* page 14 0x22A5-0x22A5 */ +static uint16 tab_uni_jisx020814[]={ +0x225D}; + +/* page 15 0x2312-0x2312 */ +static uint16 tab_uni_jisx020815[]={ +0x225E}; + +/* page 16 0x2500-0x254B */ +static uint16 tab_uni_jisx020816[]={ +0x2821,0x282C,0x2822,0x282D, 0, 0, 0, 0, + 0, 0, 0, 0,0x2823, 0, 0,0x282E, +0x2824, 0, 0,0x282F,0x2826, 0, 0,0x2831, +0x2825, 0, 0,0x2830,0x2827,0x283C, 0, 0, +0x2837, 0, 0,0x2832,0x2829,0x283E, 0, 0, +0x2839, 0, 0,0x2834,0x2828, 0, 0,0x2838, +0x283D, 0, 0,0x2833,0x282A, 0, 0,0x283A, +0x283F, 0, 0,0x2835,0x282B, 0, 0,0x283B, + 0, 0,0x2840, 0, 0, 0, 0, 0, + 0, 0, 0,0x2836}; + +/* page 17 0x25A0-0x25CF */ +static uint16 tab_uni_jisx020817[]={ +0x2223,0x2222, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x2225,0x2224, 0, 0, 0, 0, + 0, 0, 0, 0,0x2227,0x2226, 0, 0, + 0, 0, 0, 0, 0, 0,0x2221,0x217E, + 0, 0, 0,0x217B, 0, 0,0x217D,0x217C +}; + +/* page 18 0x25EF-0x25EF */ +static uint16 tab_uni_jisx020818[]={ +0x227E}; + +/* page 19 0x2605-0x2606 */ +static uint16 tab_uni_jisx020819[]={ +0x217A,0x2179}; + +/* page 20 0x2640-0x2642 */ +static uint16 tab_uni_jisx020820[]={ +0x216A, 0,0x2169}; + +/* page 21 0x266A-0x266F */ +static uint16 tab_uni_jisx020821[]={ +0x2276, 0, 0,0x2275, 0,0x2274}; + +/* page 22 0x3000-0x301C */ +static uint16 tab_uni_jisx020822[]={ +0x2121,0x2122,0x2123,0x2137, 0,0x2139,0x213A,0x213B, +0x2152,0x2153,0x2154,0x2155,0x2156,0x2157,0x2158,0x2159, +0x215A,0x215B,0x2229,0x222E,0x214C,0x214D, 0, 0, + 0, 0, 0, 0,0x2141}; + +/* page 23 0x3041-0x30FE */ +static uint16 tab_uni_jisx020823[]={ +0x2421,0x2422,0x2423,0x2424,0x2425,0x2426,0x2427,0x2428, +0x2429,0x242A,0x242B,0x242C,0x242D,0x242E,0x242F,0x2430, +0x2431,0x2432,0x2433,0x2434,0x2435,0x2436,0x2437,0x2438, +0x2439,0x243A,0x243B,0x243C,0x243D,0x243E,0x243F,0x2440, +0x2441,0x2442,0x2443,0x2444,0x2445,0x2446,0x2447,0x2448, +0x2449,0x244A,0x244B,0x244C,0x244D,0x244E,0x244F,0x2450, +0x2451,0x2452,0x2453,0x2454,0x2455,0x2456,0x2457,0x2458, +0x2459,0x245A,0x245B,0x245C,0x245D,0x245E,0x245F,0x2460, +0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467,0x2468, +0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F,0x2470, +0x2471,0x2472,0x2473, 0, 0, 0, 0, 0, + 0, 0,0x212B,0x212C,0x2135,0x2136, 0, 0, +0x2521,0x2522,0x2523,0x2524,0x2525,0x2526,0x2527,0x2528, +0x2529,0x252A,0x252B,0x252C,0x252D,0x252E,0x252F,0x2530, +0x2531,0x2532,0x2533,0x2534,0x2535,0x2536,0x2537,0x2538, +0x2539,0x253A,0x253B,0x253C,0x253D,0x253E,0x253F,0x2540, +0x2541,0x2542,0x2543,0x2544,0x2545,0x2546,0x2547,0x2548, +0x2549,0x254A,0x254B,0x254C,0x254D,0x254E,0x254F,0x2550, +0x2551,0x2552,0x2553,0x2554,0x2555,0x2556,0x2557,0x2558, +0x2559,0x255A,0x255B,0x255C,0x255D,0x255E,0x255F,0x2560, +0x2561,0x2562,0x2563,0x2564,0x2565,0x2566,0x2567,0x2568, +0x2569,0x256A,0x256B,0x256C,0x256D,0x256E,0x256F,0x2570, +0x2571,0x2572,0x2573,0x2574,0x2575,0x2576, 0, 0, + 0, 0,0x2126,0x213C,0x2133,0x2134}; + +/* page 24 0x4E00-0x5516 */ +static uint16 tab_uni_jisx020824[]={ +0x306C,0x437A, 0,0x3C37, 0, 0, 0,0x4B7C, +0x3E66,0x3B30,0x3E65,0x323C, 0,0x4954,0x4D3F, 0, +0x5022,0x312F, 0, 0,0x336E,0x5023,0x4024,0x5242, +0x3556,0x4A3A, 0, 0, 0, 0,0x3E67, 0, + 0,0x4E3E, 0, 0, 0, 0,0x4A42, 0, + 0, 0,0x5024, 0, 0,0x4366, 0, 0, + 0,0x5025,0x367A, 0, 0, 0,0x5026, 0, +0x345D,0x4330, 0,0x3C67,0x5027, 0, 0,0x5028, + 0, 0,0x5029,0x4735, 0,0x3557, 0, 0, + 0, 0, 0,0x4737, 0,0x4663,0x3843,0x4B33, + 0, 0, 0, 0, 0,0x6949,0x502A,0x3E68, +0x502B,0x3235, 0, 0, 0,0x3665,0x3870,0x4C69, + 0, 0,0x5626, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4D70, 0,0x467D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3425, 0, +0x3535, 0,0x502C, 0, 0,0x502D,0x4E3B, 0, +0x4D3D,0x4168,0x502F,0x3B76,0x4673, 0,0x5032, 0, + 0,0x313E,0x385F, 0,0x385E,0x3066, 0, 0, +0x4F4B,0x4F4A, 0,0x3A33,0x3021, 0,0x5033,0x5034, +0x5035,0x4B34,0x5036, 0,0x3872,0x3067,0x4B72, 0, +0x357C, 0, 0,0x357D,0x357E,0x4462,0x4E3C, 0, +0x5037, 0, 0,0x5038, 0, 0,0x5039, 0, + 0, 0,0x3F4D, 0, 0, 0, 0, 0, +0x3D3A,0x3F4E,0x503E, 0,0x503C, 0,0x503D,0x3558, + 0, 0,0x3A23,0x3270, 0,0x503B,0x503A,0x4A29, + 0, 0, 0, 0,0x3B46,0x3B45,0x423E,0x503F, +0x4955,0x4067, 0, 0, 0,0x2138,0x5040,0x5042, + 0, 0, 0,0x4265,0x4E61,0x304A, 0, 0, + 0, 0, 0, 0, 0,0x5041,0x323E, 0, +0x3644, 0,0x4367, 0, 0, 0,0x376F,0x5043, + 0, 0, 0,0x4724, 0, 0, 0, 0, + 0,0x346B, 0, 0, 0, 0, 0, 0, + 0,0x5044,0x304B, 0, 0,0x3860,0x346C,0x497A, +0x4832,0x3559, 0, 0, 0, 0, 0, 0, + 0, 0,0x3271, 0,0x5067,0x4541, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x476C, +0x5046, 0, 0, 0,0x483C, 0,0x4E62, 0, +0x3F2D, 0,0x3B47, 0,0x3B77,0x3240, 0, 0, + 0, 0, 0,0x4451, 0, 0,0x4322,0x504A, + 0, 0, 0, 0, 0,0x304C,0x4463,0x3D3B, +0x3A34,0x4D24, 0,0x424E, 0,0x323F, 0,0x5049, + 0,0x4D3E,0x5045,0x5047,0x3A6E,0x5048,0x5524, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5050, 0, 0, 0, 0, 0,0x5053, +0x5051, 0, 0,0x3242, 0,0x4A3B,0x504B, 0, + 0, 0, 0,0x504F,0x3873, 0, 0,0x3B48, + 0, 0, 0,0x3426, 0, 0,0x5054, 0, +0x504C, 0, 0,0x4E63, 0,0x3B78, 0,0x504D, + 0,0x5052, 0, 0, 0, 0,0x5055, 0, +0x504E, 0, 0,0x3621, 0,0x304D, 0, 0, +0x3622,0x3241, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5525, 0,0x4B79,0x496E,0x3874, + 0, 0, 0, 0, 0,0x3F2F,0x4E37, 0, + 0, 0, 0, 0, 0, 0, 0,0x4A58, + 0, 0,0x3738,0x4225,0x3264, 0, 0, 0, + 0, 0,0x3D53, 0, 0, 0,0x5059, 0, +0x505E,0x505C, 0, 0,0x5057, 0, 0,0x422F, +0x505A, 0,0x505D,0x505B, 0,0x4A5D, 0,0x5058, + 0,0x3F2E, 0,0x4B73,0x505F,0x5060, 0, 0, + 0, 0, 0, 0, 0, 0,0x3D24,0x506D, + 0, 0, 0,0x4750, 0,0x4936,0x5068, 0, +0x4A70, 0,0x3236, 0, 0, 0,0x506C, 0, + 0, 0, 0, 0, 0,0x5066,0x506F, 0, + 0,0x4152, 0,0x3844, 0,0x475C, 0,0x6047, + 0,0x506E,0x455D, 0,0x5063, 0,0x3876, 0, + 0,0x3875,0x5061, 0, 0, 0, 0,0x3C5A, + 0,0x5069, 0,0x4A6F,0x434D,0x5065,0x3771, 0, +0x5062,0x506A,0x5064,0x4E51,0x506B,0x4F41, 0, 0, + 0, 0, 0, 0, 0, 0,0x3666, 0, + 0,0x3770, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5070, 0, 0, 0,0x5071, +0x5075,0x304E, 0, 0, 0, 0, 0,0x4A50, +0x5074, 0, 0, 0, 0,0x5073,0x5077, 0, + 0, 0,0x5076, 0,0x4464, 0, 0, 0, + 0, 0, 0, 0, 0,0x3772, 0, 0, + 0, 0, 0, 0,0x5078, 0, 0, 0, + 0, 0,0x3C45, 0,0x4226,0x4465,0x3676, 0, +0x5079, 0, 0, 0, 0,0x3536, 0, 0, +0x507A, 0, 0, 0, 0,0x507C, 0, 0, + 0, 0, 0, 0, 0,0x4B35, 0, 0, + 0,0x3766, 0, 0, 0, 0, 0, 0, +0x3B31,0x4877,0x507B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3A45,0x4D43, 0, 0, + 0, 0,0x507E,0x5123,0x507D,0x3A44, 0,0x3D7D, + 0, 0, 0, 0, 0, 0,0x3739, 0, + 0, 0,0x5124, 0, 0,0x364F, 0, 0, + 0,0x5121,0x5122, 0, 0,0x462F, 0,0x417C, + 0,0x3623, 0, 0, 0,0x4B4D,0x5125, 0, + 0, 0,0x4E3D, 0, 0, 0,0x5126, 0, + 0, 0, 0,0x5129, 0,0x5127, 0,0x414E, + 0, 0, 0, 0, 0,0x5128,0x512A, 0, + 0, 0, 0, 0, 0,0x512C, 0, 0, + 0,0x512B, 0,0x4A48, 0, 0, 0, 0, +0x3537,0x512E,0x512F, 0,0x322F, 0, 0, 0, + 0,0x512D, 0, 0, 0, 0, 0, 0, + 0, 0,0x3C74, 0,0x5132,0x5131,0x5130, 0, +0x5056, 0,0x5133, 0, 0, 0, 0,0x3D7E, + 0,0x5134, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D25, 0, 0, 0, 0, 0, + 0, 0,0x4C59, 0, 0, 0, 0,0x5136, + 0, 0,0x5135,0x5138,0x5137, 0, 0,0x5139, +0x513A,0x3074, 0,0x3835,0x373B,0x3D3C,0x437B,0x3624, +0x4068,0x3877, 0,0x396E,0x513C,0x4C48,0x4546, 0, +0x3B79, 0,0x513B, 0,0x513D, 0, 0, 0, + 0, 0,0x455E, 0,0x3375, 0, 0, 0, + 0, 0,0x513E, 0, 0,0x467E, 0, 0, +0x4134,0x5140,0x5141,0x482C,0x3878,0x4F3B,0x5142, 0, + 0,0x3626, 0, 0, 0,0x4A3C,0x4236,0x3671, +0x4535, 0, 0, 0,0x3773, 0, 0, 0, +0x5143, 0,0x5144, 0, 0,0x4662,0x315F, 0, + 0,0x5147,0x3A7D, 0,0x5146,0x3A46, 0,0x5148, +0x666E,0x5149,0x4B41,0x514A, 0,0x514B,0x514C,0x3E69, + 0,0x3C4C, 0, 0, 0, 0, 0, 0, +0x3427, 0,0x514F, 0,0x514D,0x4C3D,0x514E, 0, +0x495A,0x5150,0x5151,0x5152,0x455F, 0, 0, 0, +0x5156,0x5154,0x5155,0x5153,0x3A63,0x5157,0x4C6A,0x4E64, + 0, 0, 0, 0, 0,0x5158, 0, 0, + 0, 0, 0, 0,0x4028,0x5159,0x3D5A, 0, + 0,0x515A, 0,0x437C,0x4E3F,0x4560, 0, 0, + 0, 0, 0, 0, 0, 0,0x5245, 0, + 0, 0, 0,0x515B,0x7425,0x3645, 0, 0, +0x515C,0x4B5E, 0, 0, 0, 0,0x3D68,0x427C, + 0,0x515E,0x4664, 0, 0,0x515F, 0, 0, +0x5160,0x332E, 0, 0, 0,0x5161,0x3627, 0, +0x464C,0x317A,0x3D50, 0, 0,0x4821,0x5162, 0, +0x4561, 0, 0,0x3F4F,0x5163, 0,0x4A2C,0x405A, +0x3422, 0,0x3429,0x5164, 0, 0,0x5166, 0, + 0,0x373A, 0, 0,0x5165, 0, 0,0x4E73, + 0, 0, 0, 0, 0,0x3D69, 0, 0, + 0, 0, 0, 0,0x483D,0x4A4C, 0,0x5167, + 0,0x4D78,0x5168, 0, 0, 0,0x5169, 0, +0x457E, 0, 0,0x516A, 0, 0,0x4029,0x3A7E, +0x3774,0x516B,0x3B49,0x396F, 0, 0, 0, 0, + 0, 0, 0,0x4466,0x516D, 0, 0,0x4227, + 0, 0,0x3A6F,0x516E,0x516F,0x4130, 0,0x516C, + 0, 0, 0, 0,0x5171, 0,0x4B36, 0, + 0, 0, 0,0x3964, 0, 0,0x5170, 0, + 0, 0, 0,0x3775,0x3A5E,0x476D, 0, 0, + 0,0x5174,0x5172, 0, 0, 0, 0,0x497B, +0x3E6A,0x517B,0x3364,0x5175,0x5173,0x414F, 0, 0, + 0, 0, 0, 0, 0,0x5177, 0,0x5176, + 0, 0, 0,0x3344, 0, 0, 0,0x3760, +0x517C,0x4E2D, 0, 0, 0,0x5178, 0, 0, + 0,0x517D,0x517A, 0,0x5179, 0, 0, 0, + 0, 0, 0,0x4E4F, 0, 0, 0,0x3879, +0x3243, 0, 0,0x4E74, 0, 0, 0, 0, + 0,0x3D75,0x4558,0x3965,0x5222,0x5223, 0, 0, + 0,0x4E65, 0, 0,0x4F2B,0x5225, 0, 0, + 0,0x387A, 0, 0,0x5224, 0,0x332F, 0, + 0,0x5226, 0,0x4B56, 0,0x443C, 0,0x4D26, + 0,0x4A59, 0, 0, 0,0x5227, 0, 0, + 0, 0,0x7055, 0, 0,0x4630, 0,0x5228, +0x342A,0x4C33, 0, 0, 0,0x3E21,0x5229,0x4A67, +0x522D, 0,0x402A,0x522A,0x3650, 0,0x522B,0x342B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x372E,0x522E, 0,0x522F, 0, 0, +0x5230,0x5231,0x3C5B, 0, 0, 0,0x387B,0x4C5E, + 0,0x4C68,0x4677, 0, 0,0x4A71,0x5232, 0, +0x5233, 0, 0, 0, 0,0x5235, 0,0x5237, +0x5236, 0, 0, 0, 0,0x5238,0x323D,0x4B4C, + 0,0x3A7C,0x5239, 0, 0,0x4159, 0, 0, +0x3E22,0x3629, 0,0x523A, 0, 0, 0, 0, + 0, 0,0x485B, 0, 0, 0, 0,0x523B, + 0,0x523C, 0,0x523D, 0, 0, 0, 0, +0x523E,0x4924,0x3668,0x3065, 0, 0, 0,0x463F, +0x523F,0x3D3D, 0,0x4069, 0,0x5241,0x5240,0x3E23, +0x3861,0x5243,0x483E, 0, 0,0x5244, 0, 0, + 0,0x485C,0x4234,0x426E,0x3628, 0, 0,0x466E, +0x4331, 0,0x476E, 0,0x4B4E, 0,0x5246, 0, +0x406A, 0, 0, 0, 0, 0,0x3735, 0, + 0,0x5247, 0, 0, 0, 0,0x5248,0x312C, +0x3075,0x346D, 0,0x4228,0x3551,0x4D71, 0,0x524B, +0x3237, 0, 0,0x524A, 0, 0, 0,0x362A, + 0, 0,0x524C, 0,0x4C71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x524D, 0, +0x4E52, 0,0x387C, 0, 0, 0, 0,0x3836, +0x524E, 0, 0, 0, 0,0x5250,0x524F, 0, +0x3F5F,0x3139, 0, 0, 0,0x315E,0x5251, 0, +0x5252, 0, 0,0x3837, 0, 0,0x5253, 0, + 0, 0, 0,0x356E, 0, 0, 0, 0, + 0, 0,0x3B32,0x5254, 0, 0, 0, 0, +0x4B74,0x3A35,0x355A,0x4D27,0x4150,0x483F,0x3C7D, 0, + 0, 0, 0, 0,0x3D47, 0,0x3C68,0x3C75, + 0,0x3D76, 0,0x4840, 0, 0, 0,0x5257, + 0,0x3143,0x4151,0x387D,0x3845,0x3667, 0, 0, +0x525B,0x4321,0x427E,0x362B,0x3E24,0x525C,0x525A,0x3244, +0x4266,0x3C38,0x3B4B,0x3126, 0, 0,0x3370,0x3966, +0x3B4A, 0,0x525D, 0, 0, 0, 0, 0, + 0,0x525E, 0,0x3549,0x3346, 0, 0, 0, +0x3967,0x3548,0x445F,0x3125,0x4631,0x4C3E,0x3921,0x4D79, +0x4547,0x387E, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x372F, 0,0x5267, 0,0x3663, +0x4B4A, 0, 0, 0, 0, 0,0x485D, 0, + 0,0x5266, 0,0x345E,0x5261,0x5262,0x5264, 0, + 0, 0, 0, 0, 0, 0,0x5265, 0, +0x355B,0x3F61, 0,0x4A2D,0x5263,0x525F,0x3863, 0, +0x5260, 0,0x4F24, 0, 0, 0,0x4A72, 0, +0x4468,0x3862,0x3970, 0, 0, 0,0x5268, 0, + 0,0x465D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x526C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3C7E, 0,0x3C76, 0, 0, 0, 0, 0, +0x526F,0x526D, 0,0x4C23, 0,0x526A,0x5273,0x526E, + 0, 0, 0,0x5271,0x3846,0x4C3F, 0, 0, +0x5272, 0, 0, 0,0x5274, 0,0x5276, 0, + 0, 0, 0,0x3A70,0x4F42, 0,0x526B,0x5269, +0x5275, 0,0x5270, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5278, 0,0x5323,0x527A, 0, 0, +0x527E, 0, 0,0x5321,0x527B, 0, 0,0x533E, + 0, 0,0x3A69,0x3331, 0, 0, 0, 0, +0x5279, 0, 0, 0,0x5325,0x3076,0x5324, 0, +0x3025,0x494A,0x5322, 0,0x527C, 0, 0,0x5277, +0x527D,0x3A48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5326, 0, 0, 0, 0, 0, 0, 0, + 0,0x3077,0x532F, 0, 0,0x5327,0x5328, 0, +0x3E25,0x4B69, 0, 0, 0,0x532D,0x532C, 0, + 0, 0,0x452F, 0, 0, 0, 0, 0, + 0, 0,0x532E, 0, 0,0x532B, 0, 0, + 0, 0, 0, 0,0x3134, 0,0x3A36,0x3F30, + 0, 0, 0, 0, 0, 0, 0,0x5329, +0x4562, 0, 0, 0,0x532A, 0,0x3022}; + +/* page 25 0x552E-0x5563 */ +static uint16 tab_uni_jisx020825[]={ +0x5334,0x4D23, 0,0x3E27, 0,0x533A, 0, 0, + 0, 0,0x5339,0x5330, 0, 0, 0, 0, +0x4243, 0,0x5331, 0, 0, 0,0x426F,0x5336, +0x3E26, 0, 0, 0, 0, 0,0x5333, 0, + 0,0x4C64, 0, 0, 0,0x373C, 0, 0, +0x5337,0x5338, 0, 0, 0, 0,0x5335,0x533B, + 0, 0, 0, 0, 0,0x5332}; + +/* page 26 0x557B-0x576A */ +static uint16 tab_uni_jisx020826[]={ +0x5341,0x5346, 0,0x5342, 0,0x533D, 0, 0, +0x5347,0x4131, 0, 0,0x5349, 0,0x3922,0x533F, +0x437D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5343,0x533C,0x342D, + 0,0x346E,0x3365,0x5344,0x5340, 0, 0, 0, + 0, 0, 0, 0,0x3776,0x534A,0x5348,0x4153, +0x354A,0x362C, 0,0x5345, 0,0x3674, 0, 0, + 0, 0, 0,0x3144, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x534E,0x534C, 0,0x5427, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5351, 0, 0, 0, 0, 0,0x534B, + 0,0x534F, 0, 0,0x534D, 0, 0, 0, +0x3B4C,0x5350, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5353, 0,0x5358, 0, + 0, 0,0x5356,0x5355, 0, 0, 0, 0, + 0, 0, 0,0x4332, 0, 0,0x3245, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5352, 0,0x5354,0x3E28,0x3133, 0, 0, +0x5357, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x325E, 0, + 0, 0, 0, 0,0x5362, 0,0x3E7C,0x535E, + 0,0x535C, 0,0x535D, 0,0x535F, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x313D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4139, 0,0x5359, 0,0x535A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x337A, 0, 0, 0, 0, 0, 0, 0, + 0,0x5361, 0, 0, 0,0x346F, 0,0x5364, +0x5360,0x5363, 0, 0, 0, 0, 0, 0, + 0,0x4A2E, 0, 0, 0,0x4655, 0,0x4838, + 0, 0, 0, 0, 0,0x5366, 0, 0, + 0, 0, 0,0x5365,0x3345, 0, 0,0x5367, + 0, 0, 0, 0,0x536A, 0, 0, 0, + 0,0x5369, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5368, 0,0x4739, + 0, 0,0x536B, 0, 0, 0, 0, 0, + 0, 0, 0,0x536C, 0, 0, 0, 0, + 0,0x536E, 0,0x536D, 0, 0, 0, 0, + 0,0x5370, 0, 0, 0,0x5373,0x5371,0x536F, +0x5372, 0, 0, 0, 0,0x5374, 0, 0, + 0, 0, 0,0x5375, 0, 0,0x5376, 0, +0x5377, 0, 0, 0,0x5378,0x5145, 0,0x3C7C, +0x3B4D, 0, 0,0x3273, 0,0x3078, 0, 0, +0x4344, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5379, 0,0x3A24, 0,0x304F, +0x3F5E, 0, 0, 0, 0, 0,0x537A,0x3847, + 0, 0,0x3971, 0,0x537C,0x537B, 0, 0, +0x4A60,0x537D, 0, 0, 0,0x5421,0x537E, 0, +0x5422, 0,0x5423, 0,0x3777, 0, 0,0x3160, +0x5424, 0, 0,0x5426, 0,0x5425, 0, 0, + 0,0x5428, 0, 0,0x455A, 0, 0, 0, + 0, 0, 0,0x5429,0x3035,0x3A5F, 0, 0, + 0, 0,0x373D, 0, 0,0x434F, 0, 0, + 0, 0, 0, 0,0x542A,0x542B, 0, 0, +0x542D, 0, 0, 0, 0,0x542E, 0,0x3A64, + 0, 0, 0, 0,0x3651, 0, 0,0x4B37, + 0, 0, 0,0x542C,0x542F,0x3A41,0x3923, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5433, 0, + 0,0x3A25, 0,0x4333, 0, 0,0x5430,0x445A +}; + +/* page 27 0x577F-0x5A9B */ +static uint16 tab_uni_jisx020827[]={ +0x5434, 0, 0,0x3F62, 0, 0, 0, 0, + 0,0x5432,0x5435, 0,0x373F, 0, 0, 0, + 0, 0, 0, 0,0x5436, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5437, 0,0x3924,0x3340,0x5439, 0, 0, + 0, 0, 0,0x543A, 0, 0, 0, 0, + 0,0x543B, 0, 0,0x5438, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5431, 0, 0,0x543C, 0, 0,0x543D, + 0, 0, 0, 0,0x4B64, 0, 0,0x3E6B, + 0, 0, 0,0x543F,0x5440,0x543E, 0,0x5442, + 0, 0, 0, 0, 0,0x4738, 0, 0, +0x3068,0x4956, 0, 0,0x5443, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3E7D, 0, 0, +0x3C39, 0,0x475D,0x3470, 0,0x3A6B, 0, 0, + 0,0x4B59, 0,0x4632, 0, 0,0x3778,0x424F, + 0, 0, 0,0x5441,0x5444, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4244, 0, + 0, 0,0x5445, 0, 0, 0,0x5446, 0, + 0, 0,0x5448, 0, 0,0x4469, 0, 0, + 0, 0, 0,0x342E, 0, 0, 0, 0, +0x7421,0x3161,0x4A73, 0, 0,0x3E6C,0x4548, 0, + 0, 0, 0,0x3A66, 0, 0,0x544E, 0, + 0,0x4A3D,0x4E5D, 0, 0, 0, 0, 0, + 0, 0, 0,0x3274,0x544A, 0, 0, 0, + 0, 0,0x413A,0x544D, 0,0x4563, 0, 0, +0x4549,0x4564,0x4839,0x444D, 0, 0, 0,0x3A49, + 0, 0, 0,0x5449, 0, 0, 0, 0, + 0, 0,0x3176, 0,0x4536, 0, 0, 0, + 0,0x544B, 0,0x5447, 0, 0,0x3F50, 0, + 0, 0,0x544F, 0, 0, 0, 0,0x3D4E, + 0, 0, 0, 0,0x362D, 0,0x5450, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4A68, 0, 0, 0, +0x417D, 0, 0, 0, 0,0x4446, 0, 0, +0x5452, 0, 0, 0, 0, 0, 0, 0, + 0,0x4B4F, 0, 0,0x5453, 0, 0,0x5458, + 0, 0, 0, 0,0x4A2F, 0, 0, 0, + 0,0x5457,0x5451,0x5454,0x5456, 0, 0,0x3A26, + 0, 0,0x4A49, 0, 0, 0,0x5459, 0, +0x4345, 0, 0,0x3275, 0,0x3E6D, 0, 0, + 0, 0,0x545B, 0,0x545A, 0,0x3968, 0, +0x545C,0x545E,0x545D, 0, 0,0x5460, 0,0x5455, +0x5462, 0, 0, 0, 0,0x5461,0x545F, 0, + 0, 0, 0, 0,0x3B4E,0x3F51, 0,0x4154, +0x5463,0x403C,0x306D,0x4764, 0, 0, 0, 0, +0x445B, 0,0x5465,0x5464,0x5466,0x5467,0x5468, 0, + 0, 0, 0,0x5469, 0, 0, 0, 0, + 0, 0,0x4A51,0x546A, 0, 0, 0, 0, +0x3246,0x546B, 0, 0, 0, 0,0x4D3C,0x3330, + 0,0x5249,0x3D48,0x423F,0x546C,0x4C6B, 0, 0, + 0, 0, 0,0x4C34, 0, 0,0x546E, 0, +0x4267, 0,0x4537,0x4240,0x4957,0x546F,0x5470,0x317B, + 0, 0,0x3C3A,0x5471, 0, 0, 0, 0, +0x3050,0x5472, 0, 0, 0, 0, 0,0x5473, + 0, 0, 0, 0, 0,0x3162, 0, 0, +0x3471,0x4660,0x4A74, 0, 0, 0, 0,0x5477, +0x4155,0x5476,0x3740, 0, 0,0x4B5B,0x5475, 0, +0x4565,0x5479, 0,0x5478, 0, 0, 0, 0, + 0,0x547B, 0,0x547A, 0, 0,0x317C, 0, +0x547C,0x3E29,0x547E,0x4325, 0,0x547D, 0,0x4A33, + 0, 0, 0, 0,0x3D77,0x455B, 0, 0, + 0,0x5521, 0, 0, 0, 0,0x3925, 0, + 0, 0,0x5522,0x4721,0x485E,0x4C51, 0, 0, + 0, 0, 0,0x4725, 0, 0,0x552B, 0, + 0, 0, 0, 0,0x3538, 0, 0,0x4D45, + 0, 0,0x4C2F, 0,0x562C, 0,0x5523, 0, + 0, 0, 0, 0,0x5526, 0,0x4245, 0, + 0,0x4B38, 0, 0, 0,0x454A, 0, 0, + 0, 0, 0,0x5527, 0, 0, 0, 0, + 0, 0,0x4B65, 0,0x3A4A, 0, 0,0x3E2A, + 0, 0, 0, 0, 0, 0, 0,0x5528, + 0, 0,0x3B50, 0,0x3B4F, 0, 0, 0, + 0,0x3039,0x3848, 0,0x402B,0x3051, 0, 0, + 0, 0,0x552C,0x552D, 0,0x552A, 0, 0, + 0, 0, 0, 0, 0, 0,0x3138,0x342F, + 0,0x5529, 0,0x4C45,0x4931, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3028, + 0, 0, 0, 0,0x3079, 0, 0, 0, +0x3B51, 0,0x3052, 0,0x3023, 0, 0, 0, + 0, 0,0x5532, 0, 0, 0, 0, 0, + 0, 0,0x5530, 0, 0, 0, 0, 0, + 0,0x4C3C, 0,0x5533, 0,0x5531, 0, 0, +0x552F,0x3F31, 0, 0, 0, 0,0x552E, 0, + 0, 0,0x4A5A, 0, 0, 0, 0, 0, +0x3864, 0, 0, 0, 0, 0,0x5537,0x5538, + 0, 0, 0, 0, 0,0x3E2B, 0, 0, + 0,0x5534,0x4F2C, 0, 0, 0, 0,0x474C, + 0, 0,0x5536, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3A27, 0, 0, 0, 0, + 0, 0, 0,0x5539, 0, 0, 0,0x4958, + 0, 0, 0,0x553A, 0,0x5535, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4C3B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x475E, 0, 0, 0, 0, + 0, 0, 0,0x553B,0x4932}; + +/* page 28 0x5ABC-0x5D29 */ +static uint16 tab_uni_jisx020828[]={ +0x553C,0x5540,0x553D, 0, 0,0x3247,0x553F, 0, + 0, 0, 0, 0, 0,0x3C3B, 0,0x553E, +0x3779, 0, 0, 0,0x554C, 0, 0, 0, + 0, 0,0x5545,0x5542, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4364, 0,0x5541, + 0, 0,0x5543, 0, 0,0x5544, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5546,0x5547, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3472, 0,0x5549, +0x5548, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x554A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3E6E, 0, + 0, 0, 0, 0, 0, 0,0x554D, 0, +0x445C, 0, 0, 0,0x3145, 0,0x554B, 0, + 0, 0,0x554E, 0, 0, 0, 0, 0, + 0, 0,0x554F, 0,0x5552, 0, 0,0x5550, + 0,0x5551, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3B52,0x5553, 0, 0, +0x3926,0x5554, 0,0x3B7A,0x4238, 0,0x5555,0x5556, +0x3B5A,0x3927, 0,0x4C52, 0, 0, 0,0x3528, +0x3849,0x5557,0x3358, 0, 0,0x5558, 0,0x4239, + 0, 0, 0, 0,0x5559,0x5623, 0,0x555A, + 0,0x555B, 0, 0,0x555C, 0,0x555E, 0, + 0, 0, 0, 0,0x555F, 0, 0,0x5560, + 0,0x4270, 0,0x3127,0x3C69,0x3042, 0,0x4157, +0x3430,0x3C35, 0,0x3928, 0, 0, 0, 0, + 0,0x4566, 0,0x3D21,0x3431,0x4368,0x446A,0x3038, +0x3539,0x4A75, 0,0x3C42, 0, 0,0x3552,0x406B, +0x3C3C,0x4D28,0x5561, 0, 0, 0, 0, 0, + 0, 0,0x355C, 0,0x3A4B, 0, 0,0x3332, +0x3163,0x3E2C,0x3248, 0,0x5562,0x4D46, 0, 0, + 0, 0, 0,0x3D49, 0, 0,0x3C64,0x5563, +0x3473,0x4652,0x4C29,0x5564, 0,0x5565, 0, 0, +0x4959, 0, 0, 0,0x5567, 0,0x3428,0x3677, +0x5566, 0, 0, 0, 0, 0, 0,0x3432, + 0,0x3F32,0x556B,0x3B21, 0,0x3249,0x556A, 0, +0x5568,0x556C,0x5569,0x472B,0x5C4D,0x3F33, 0,0x556D, + 0, 0,0x4E40, 0,0x556E, 0, 0,0x5570, + 0,0x437E,0x556F, 0,0x4023, 0,0x3B7B, 0, + 0, 0,0x4250,0x3C77, 0,0x4975,0x406C, 0, +0x3C4D,0x5571,0x3E2D,0x5572,0x5573,0x3053,0x423A,0x3F52, + 0,0x5574,0x4633,0x3E2E, 0,0x3E2F, 0,0x5575, + 0, 0,0x406D, 0, 0, 0,0x3E30, 0, + 0, 0, 0, 0,0x5576, 0,0x5577, 0, +0x4C60, 0, 0, 0,0x5578, 0, 0, 0, + 0,0x3646, 0, 0, 0,0x3D22, 0, 0, + 0, 0, 0, 0,0x5579,0x557A,0x3C5C,0x3F2C, +0x4674,0x3F54,0x4878,0x4722,0x3649,0x557B, 0, 0, + 0,0x356F,0x557C, 0,0x367E, 0,0x464F,0x3230, + 0,0x3B53,0x557D,0x5622,0x5621,0x367D, 0,0x557E, + 0,0x4538, 0, 0, 0, 0, 0, 0, + 0, 0,0x4230, 0,0x454B,0x3C48, 0, 0, +0x4158,0x4D7A, 0, 0, 0, 0, 0, 0, +0x5624, 0,0x5625,0x4656, 0,0x3B33, 0, 0, + 0, 0,0x5627, 0, 0,0x5628, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5629, 0, 0, 0,0x3474,0x562A, 0, 0, +0x562B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x322C, 0, 0, + 0, 0, 0, 0,0x413B,0x3464, 0,0x562D, +0x4C28, 0, 0, 0, 0,0x4252, 0,0x3359, + 0, 0,0x562F,0x5631,0x345F, 0, 0,0x562E, +0x5630, 0,0x5633, 0, 0, 0, 0, 0, + 0,0x5632, 0,0x5634, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5635, 0, 0, + 0, 0, 0, 0,0x463D,0x362E, 0, 0, + 0, 0, 0, 0,0x3265,0x5636,0x563B, 0, + 0,0x5639, 0,0x4A77,0x4A76, 0, 0, 0, + 0, 0,0x4567, 0, 0, 0,0x5638,0x3D54, + 0,0x5637, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F72, 0, 0, 0,0x563C, + 0, 0,0x3A6A, 0, 0,0x5642, 0, 0, +0x5643,0x563D,0x3333,0x563E,0x5647,0x5646,0x5645,0x5641, + 0, 0, 0,0x5640, 0, 0,0x5644, 0, + 0, 0, 0, 0, 0,0x4A78}; + +/* page 29 0x5D4B-0x6BF3 */ +static uint16 tab_uni_jisx020829[]={ +0x564B,0x5648, 0,0x564A, 0,0x4D72, 0,0x5649, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x563F, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3F73, 0, + 0,0x564C, 0, 0,0x3A37, 0, 0, 0, +0x564D, 0, 0,0x564E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5651, + 0,0x5650, 0, 0,0x564F, 0, 0, 0, +0x4568,0x563A, 0, 0, 0,0x5657, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5653, 0, 0, 0, 0,0x5652, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5654, 0,0x5655, 0, 0, 0, 0, + 0, 0, 0, 0,0x5658, 0, 0,0x4E66, + 0,0x5659,0x5656, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x565A, 0, + 0,0x3460,0x565B, 0, 0, 0, 0,0x565D, +0x565C, 0, 0,0x565E, 0, 0, 0, 0, +0x565F, 0,0x406E,0x3D23, 0, 0,0x3D64, 0, +0x4163, 0,0x3929,0x3A38,0x392A,0x3570, 0, 0, +0x5660, 0, 0,0x3A39, 0, 0,0x384A,0x5661, +0x4C26,0x4743,0x5662, 0,0x392B, 0, 0, 0, +0x342C, 0,0x4327,0x3652, 0, 0, 0,0x3B54, +0x495B, 0, 0,0x4841, 0, 0, 0, 0, +0x5663,0x3475, 0, 0, 0, 0,0x5666, 0, + 0, 0, 0,0x4421, 0, 0,0x5665,0x5664, +0x5667, 0,0x446B, 0, 0, 0, 0, 0, + 0, 0,0x3F63, 0, 0, 0, 0, 0, +0x3B55, 0,0x404A, 0,0x4253,0x3522, 0, 0, +0x4422, 0, 0,0x5668,0x5669,0x3E6F, 0, 0, + 0, 0,0x4B39, 0, 0,0x566C, 0, 0, +0x566B,0x566A,0x497D, 0,0x5673, 0, 0, 0, + 0,0x4B5A, 0,0x566D, 0, 0, 0, 0, + 0,0x566F,0x4B6B, 0,0x566E, 0, 0, 0, + 0, 0, 0, 0,0x5670, 0,0x4828,0x5671, +0x4A3E,0x5672, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3433, +0x4A3F,0x472F,0x5674,0x5675, 0,0x392C,0x3434,0x5676, +0x3838,0x4D44,0x4D29,0x3476,0x5678, 0,0x4423, 0, +0x392D,0x3E31, 0, 0,0x485F, 0, 0,0x3E32, + 0, 0, 0, 0,0x3D78, 0, 0, 0, + 0, 0,0x446C,0x4A79,0x4539, 0, 0,0x392E, + 0,0x495C, 0, 0, 0,0x5679, 0, 0, + 0, 0, 0,0x4559,0x3A42, 0, 0, 0, +0x384B, 0,0x446D, 0, 0, 0, 0, 0, + 0, 0,0x3043,0x3D6E,0x392F,0x4D47, 0, 0, + 0, 0, 0, 0, 0, 0,0x567A,0x567B, +0x4751, 0, 0, 0, 0,0x567C,0x4E77,0x4F2D, + 0, 0, 0, 0,0x567E,0x567D, 0, 0, +0x3347, 0, 0,0x5721, 0, 0, 0,0x5724, +0x5725, 0,0x5723, 0,0x4940,0x3E33,0x5727,0x5726, +0x5722, 0, 0, 0, 0,0x5728,0x5729, 0, + 0,0x572A, 0, 0, 0,0x572D,0x572B, 0, +0x572C,0x572E, 0,0x3164,0x446E,0x572F, 0,0x377A, +0x3276,0x4736, 0,0x5730,0x467B, 0,0x4A5B, 0, +0x5731,0x4F2E, 0, 0, 0, 0,0x5732,0x4A40, +0x5735,0x5021,0x5031, 0,0x3C30,0x4675,0x5736, 0, +0x355D,0x4424,0x307A,0x5737,0x4A26,0x3930, 0, 0, +0x4350, 0, 0, 0,0x446F, 0, 0, 0, + 0, 0,0x4C6F,0x3839,0x384C, 0,0x5738, 0, + 0, 0,0x5739, 0,0x573F, 0,0x3C65, 0, + 0, 0,0x4425, 0,0x362F,0x573A, 0, 0, + 0,0x492B, 0,0x4346, 0, 0,0x573B, 0, + 0, 0, 0, 0, 0,0x573C, 0,0x3630, + 0,0x573D, 0,0x573E, 0, 0,0x5740, 0, +0x4576, 0, 0,0x5741,0x5742, 0,0x5743, 0, + 0,0x5734,0x5733, 0, 0, 0,0x5744,0x3741, + 0, 0, 0,0x4927, 0, 0,0x3A4C,0x4937, +0x4426,0x494B,0x5745, 0, 0,0x3E34,0x3146, 0, +0x5746, 0, 0, 0,0x5747, 0,0x4C72, 0, + 0,0x4860, 0, 0,0x574A,0x317D,0x402C,0x5749, +0x5748,0x3742,0x4254, 0,0x574E,0x574C, 0,0x574B, +0x4E27,0x3865, 0, 0, 0,0x3D79,0x574D,0x454C, +0x3D3E, 0, 0, 0,0x4640,0x5751,0x5750, 0, + 0, 0, 0,0x574F, 0,0x5752,0x3866, 0, + 0, 0, 0, 0, 0,0x5753,0x497C,0x3D5B, + 0, 0,0x5754,0x4879, 0, 0, 0, 0, +0x4641,0x4427, 0, 0, 0, 0,0x4530, 0, + 0,0x5755,0x352B, 0, 0, 0, 0, 0, +0x3F34, 0,0x492C, 0, 0, 0, 0, 0, + 0,0x3477,0x4726, 0, 0, 0, 0, 0, + 0, 0, 0,0x5756,0x3B56,0x4B3A,0x4B3B, 0, + 0,0x317E,0x575B, 0, 0,0x4369, 0, 0, + 0,0x5758, 0, 0, 0, 0, 0, 0, +0x3277, 0, 0, 0, 0,0x582D,0x575A, 0, + 0, 0,0x4730, 0, 0,0x5759, 0, 0, +0x5757, 0,0x397A, 0,0x575D, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5763,0x5769,0x5761, 0,0x455C, + 0, 0,0x5766,0x495D, 0, 0,0x5760, 0, +0x5765,0x4E67,0x3B57, 0, 0,0x4255,0x575E, 0, + 0, 0,0x355E,0x5768,0x402D,0x3165,0x5762,0x3278, +0x5767, 0, 0, 0,0x3631, 0,0x5764, 0, + 0, 0, 0, 0, 0, 0, 0,0x576A, + 0, 0, 0, 0, 0, 0,0x576C,0x5776, +0x5774, 0, 0,0x5771, 0, 0, 0,0x5770, +0x4E78, 0,0x5772, 0, 0,0x3632, 0,0x3931, + 0, 0,0x3D7A, 0, 0, 0,0x5779,0x576B, + 0, 0, 0, 0,0x576F,0x575F, 0,0x327A, +0x5773,0x5775,0x4351, 0, 0,0x3A28,0x3238,0x576D, +0x5778,0x5777,0x3633, 0,0x4229,0x3366, 0, 0, + 0, 0,0x3743, 0,0x576E, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x577A, 0, +0x577D,0x5821, 0, 0, 0, 0,0x3C3D, 0, +0x5827,0x4470,0x577B, 0, 0, 0, 0,0x5825, + 0,0x3279, 0,0x5823,0x5824, 0, 0,0x577E, +0x5822, 0, 0, 0,0x3867,0x4D2A, 0, 0, +0x3435, 0, 0,0x3159,0x5826, 0,0x473A,0x302D, + 0, 0, 0, 0, 0, 0, 0,0x4861, +0x575C,0x582C,0x5830,0x4C65, 0,0x5829, 0, 0, + 0,0x4569,0x582E, 0, 0, 0, 0, 0, + 0, 0,0x3E70,0x582F,0x4657, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4F47, 0, +0x582B, 0, 0, 0, 0,0x5831, 0,0x397B, + 0,0x404B, 0, 0,0x3054,0x582A,0x5828, 0, +0x415A, 0, 0, 0,0x577C,0x3B34, 0, 0, + 0, 0, 0, 0, 0,0x4246,0x583D, 0, +0x415B,0x5838, 0,0x5835,0x5836, 0,0x3C66,0x5839, +0x583C, 0, 0, 0, 0,0x5837,0x3D25, 0, +0x583A, 0, 0,0x5834, 0,0x4C7C,0x4C7B, 0, + 0, 0,0x583E,0x583F,0x3055, 0, 0, 0, + 0, 0,0x5833, 0, 0, 0, 0,0x3672, +0x3026, 0, 0, 0,0x3436, 0,0x583B, 0, + 0, 0, 0, 0,0x5843,0x5842, 0, 0, + 0,0x5847, 0, 0, 0, 0, 0, 0, + 0,0x5848, 0, 0, 0, 0, 0, 0, + 0,0x5846,0x5849,0x5841,0x5845, 0, 0,0x584A, + 0,0x584B, 0, 0,0x5840,0x3B7C, 0,0x5844, +0x4256,0x3932,0x5832,0x3F35, 0, 0, 0, 0, +0x5858, 0,0x4A69, 0, 0,0x584E,0x584F,0x5850, + 0, 0,0x5857, 0,0x5856, 0, 0,0x4B7D, +0x3437, 0,0x5854, 0,0x3745,0x3334, 0, 0, +0x5851, 0, 0,0x4E38,0x5853,0x3056,0x5855, 0, +0x584C,0x5852,0x5859,0x3744,0x584D, 0, 0, 0, + 0, 0, 0,0x4D5D, 0, 0, 0,0x4D2B, + 0, 0, 0, 0,0x585C, 0, 0,0x5860, + 0, 0, 0,0x417E, 0,0x4E79,0x5861, 0, + 0,0x585E, 0,0x585B, 0, 0,0x585A,0x585F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4A30, 0, 0,0x4634, 0,0x3746, 0, +0x5862,0x585D, 0,0x5863, 0, 0, 0,0x377B, + 0, 0, 0,0x3231, 0, 0, 0,0x586B, + 0, 0, 0,0x3438, 0, 0, 0, 0, +0x5869, 0, 0,0x586A,0x3A29,0x5868,0x5866,0x5865, +0x586C,0x5864,0x586E, 0, 0,0x327B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5870, 0, 0,0x586F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4428, + 0,0x5873, 0,0x5871,0x5867,0x377C, 0,0x5872, + 0,0x5876,0x5875,0x5877,0x5874,0x5878, 0, 0, + 0, 0, 0, 0, 0,0x5879,0x587A,0x4A6A, + 0,0x587C,0x587B,0x3D3F, 0,0x402E,0x3266,0x327C, + 0,0x587D, 0,0x303F, 0, 0, 0,0x404C, +0x587E, 0,0x6C43,0x5921,0x3761, 0,0x5922, 0, + 0, 0, 0,0x406F, 0, 0, 0,0x5923, + 0, 0, 0,0x5924,0x353A,0x5925, 0,0x5926, +0x5927,0x4257, 0, 0, 0,0x384D, 0, 0, +0x4C61, 0, 0, 0,0x4B3C,0x3D6A,0x5928, 0, + 0, 0, 0, 0,0x4070,0x6E3D,0x4862, 0, +0x3C6A, 0,0x3A4D,0x5929, 0, 0, 0, 0, +0x4247, 0,0x4A27, 0, 0,0x4271, 0, 0, +0x592C, 0, 0,0x592A, 0,0x592D, 0, 0, +0x592B, 0, 0, 0, 0,0x592E, 0, 0, + 0, 0, 0,0x4A31, 0, 0,0x3037, 0, + 0, 0, 0,0x495E, 0, 0,0x4863, 0, + 0,0x592F, 0,0x5932,0x3E35,0x353B, 0,0x5930, +0x5937,0x3E36, 0, 0, 0, 0,0x5931,0x4744, + 0, 0, 0, 0, 0, 0,0x4D5E,0x5933, +0x5934,0x5938,0x456A,0x5935,0x3933,0x405E, 0, 0, +0x5946,0x4834, 0,0x4272, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4864,0x5A2D, 0, 0, 0, 0,0x4A7A, 0, + 0, 0,0x4471, 0, 0, 0,0x4B75, 0, +0x593B,0x3221,0x436A, 0, 0, 0, 0,0x5944, + 0, 0,0x4334,0x593E,0x5945,0x5940,0x5947,0x5943, + 0,0x5942,0x476F, 0,0x593C,0x327D,0x593A,0x3571, +0x4273,0x5936, 0, 0,0x5939,0x3934,0x405B, 0, +0x3E37,0x5941,0x4752, 0, 0,0x3572,0x3348, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3367,0x3F21,0x5949,0x594E, 0,0x594A, 0, +0x377D, 0,0x594F,0x3B22,0x3969, 0, 0, 0, + 0, 0, 0,0x3D26,0x593D, 0,0x3B7D,0x594C, + 0, 0, 0, 0,0x3B58,0x594D,0x3044, 0, + 0,0x5948, 0, 0, 0, 0,0x4429, 0, + 0, 0, 0, 0, 0, 0,0x3573, 0, + 0, 0, 0, 0,0x3634, 0, 0, 0, + 0, 0, 0, 0,0x594B,0x3027, 0, 0, +0x3A43, 0, 0, 0,0x3F36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4472, + 0, 0,0x4854,0x5951,0x415E, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x422A, 0, + 0,0x3B2B,0x5952, 0,0x5954,0x5950, 0, 0, + 0, 0,0x4A61, 0,0x443D, 0, 0, 0, + 0,0x415C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4A7B,0x3C4E,0x5960, 0, +0x595F, 0, 0,0x3F78, 0, 0, 0,0x377E, + 0, 0, 0,0x5959,0x3E39, 0, 0,0x4668, +0x4731, 0, 0, 0, 0,0x5957, 0, 0, +0x415D, 0, 0, 0, 0,0x3C78,0x595C, 0, + 0,0x3E38, 0,0x5956,0x595B, 0, 0,0x4753, + 0, 0, 0,0x5955, 0,0x3721, 0, 0, +0x335D, 0, 0, 0,0x595D,0x4E2B,0x3A4E,0x4335, +0x595A, 0,0x405C, 0,0x3935,0x3F64,0x3166,0x413C, +0x5958,0x3545, 0, 0, 0, 0, 0,0x3747, + 0,0x444F,0x595E, 0, 0, 0, 0, 0, +0x415F, 0, 0,0x5961, 0,0x5963, 0, 0, +0x4237,0x5969, 0,0x5964, 0, 0,0x5966, 0, + 0, 0, 0, 0,0x4941,0x4473, 0,0x5967, + 0, 0, 0,0x4D2C, 0, 0, 0,0x4D48, +0x3439, 0, 0, 0, 0, 0,0x302E, 0, +0x5965, 0, 0, 0, 0, 0,0x5962, 0, + 0, 0, 0,0x3478, 0, 0, 0, 0, + 0,0x3167, 0,0x5968, 0, 0, 0,0x4D49, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x596C, 0, 0, 0, 0, + 0, 0,0x423B, 0,0x5973, 0, 0, 0, +0x596D, 0, 0,0x596A,0x5971, 0, 0, 0, + 0,0x5953, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x596E, 0,0x5972, 0, 0, + 0,0x4842,0x456B, 0, 0, 0, 0, 0, + 0,0x596B, 0,0x596F, 0, 0, 0,0x3748, + 0, 0, 0,0x3A71, 0, 0, 0,0x405D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5977, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4526, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5974, 0,0x4B60, 0, + 0, 0, 0, 0,0x5975, 0, 0, 0, + 0, 0, 0,0x5976, 0,0x4C4E, 0,0x4022, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3762, 0, 0, 0, 0,0x597D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3B35, +0x597A, 0,0x5979, 0, 0, 0, 0,0x4732, + 0, 0, 0,0x4635, 0, 0, 0, 0, + 0,0x4531,0x597B, 0, 0, 0,0x597C, 0, +0x496F, 0,0x4745,0x3B23, 0,0x4071, 0,0x4B50, + 0, 0, 0, 0, 0, 0,0x3349, 0, +0x5A25,0x597E, 0, 0, 0, 0,0x4D4A,0x5A27, + 0, 0,0x5A23, 0,0x5A24, 0, 0, 0, + 0, 0,0x4160, 0, 0, 0, 0,0x5A22, + 0,0x593F, 0, 0, 0,0x5A26, 0,0x5A21, + 0, 0, 0, 0, 0,0x5A2B,0x5A2C,0x4527, +0x5A2E, 0, 0,0x3B24,0x5A29, 0, 0, 0, + 0,0x353C, 0, 0,0x5A2F, 0,0x5A28,0x5A33, + 0,0x5A32, 0,0x5A31, 0, 0, 0,0x5A34, + 0, 0,0x5A36,0x3E71, 0,0x5A35, 0, 0, + 0, 0,0x5A39, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5A37, 0, 0, + 0,0x5A38,0x5970, 0, 0, 0, 0, 0, +0x5A3B,0x5A3A, 0, 0, 0, 0, 0,0x5978, +0x5A3C,0x5A30, 0, 0,0x3B59, 0, 0, 0, + 0,0x5A3D,0x5A3E,0x5A40,0x5A3F,0x5A41,0x327E, 0, +0x3936, 0, 0,0x4A7C,0x402F, 0, 0, 0, + 0, 0,0x384E, 0, 0,0x5A43, 0, 0, + 0, 0,0x5A46, 0,0x4952, 0,0x355F, 0, + 0, 0,0x5A45,0x5A44,0x4754,0x5A47,0x3635, 0, + 0, 0,0x5A49,0x5A48, 0, 0, 0,0x343A, +0x3B36, 0, 0,0x4658, 0, 0, 0, 0, + 0,0x3749, 0, 0, 0,0x3F74, 0,0x5A4A, + 0,0x4030,0x4528, 0,0x495F,0x5A4B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5A4C, +0x5A4D, 0, 0, 0,0x4A38,0x555D,0x4046, 0, + 0,0x494C, 0,0x3A58, 0,0x4865,0x4843, 0, + 0, 0, 0, 0,0x454D, 0,0x4E41, 0, +0x5A4F,0x3C50, 0, 0,0x5A50, 0,0x3036, 0, + 0,0x3654,0x404D, 0,0x4960, 0, 0, 0, +0x5A51,0x3B42,0x4347, 0,0x3B5B,0x3F37, 0, 0, + 0, 0, 0, 0,0x5A52, 0,0x4A7D, 0, + 0,0x3177,0x3B5C, 0, 0, 0,0x5A55, 0, +0x5A53,0x5A56,0x4E39,0x5A54, 0, 0, 0, 0, +0x407B,0x5A57, 0, 0,0x4232, 0, 0,0x5A58, + 0, 0, 0, 0,0x347A, 0,0x5A5A, 0, +0x5A59, 0, 0, 0, 0,0x5A5B,0x5A5C,0x347B, + 0, 0,0x467C,0x4336,0x356C,0x3B5D,0x4161, 0, + 0,0x3D5C,0x3030, 0, 0, 0,0x5A5D, 0, + 0, 0, 0, 0, 0, 0, 0,0x3222, +0x5A61, 0, 0, 0, 0, 0, 0,0x3937, +0x5A60, 0, 0,0x3A2B,0x3E3A, 0, 0,0x5A5F, + 0,0x3E3B, 0,0x4C40,0x3A2A, 0, 0, 0, +0x3057,0x404E, 0, 0, 0, 0, 0, 0, + 0,0x5A66, 0, 0,0x4031,0x3147, 0, 0, + 0, 0,0x3D55, 0,0x4B66,0x3A72, 0, 0, + 0, 0,0x3E3C, 0,0x4027, 0, 0, 0, + 0,0x5A65,0x5A63,0x5A64, 0, 0, 0, 0, + 0,0x436B, 0, 0,0x5B26, 0,0x5A6A,0x3B7E, +0x3938,0x5A68, 0, 0, 0, 0,0x5A69, 0, +0x3F38, 0, 0, 0,0x5A67, 0, 0,0x3B2F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5A6C,0x5A6B,0x5A70, 0, 0,0x5A71, + 0,0x5A6D, 0,0x3322,0x5A6E,0x5A6F,0x4855, 0, + 0, 0, 0,0x4961,0x374A,0x5A72, 0, 0, + 0,0x4032, 0,0x3E3D, 0, 0, 0,0x4352, + 0, 0, 0, 0, 0, 0,0x3647, 0, +0x5A73,0x5A77, 0, 0,0x324B,0x5A74,0x5A76, 0, + 0, 0, 0,0x5A75, 0, 0,0x3D6B, 0, + 0, 0, 0,0x4348,0x3045,0x5A78, 0, 0, + 0, 0,0x5A79, 0, 0, 0, 0,0x442A, + 0, 0, 0,0x4E71, 0, 0, 0, 0, +0x3B43, 0, 0,0x4A6B, 0, 0, 0, 0, + 0,0x4B3D, 0, 0, 0,0x5B22,0x5A7B, 0, + 0,0x5A7E, 0,0x5A7D, 0, 0,0x5A7A, 0, + 0,0x5B21, 0, 0,0x465E, 0,0x5A7C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5B23, 0, 0,0x3D6C,0x5B24, + 0,0x4D4B,0x4778, 0, 0,0x5B25, 0, 0, + 0, 0, 0,0x5B27, 0, 0,0x5B28, 0, + 0, 0, 0, 0, 0,0x5B29, 0,0x364A, +0x3148,0x3939,0x5B2A, 0,0x5B2B,0x3D71,0x4162, 0, + 0,0x5258,0x413E,0x413D,0x4258,0x3A47, 0, 0, +0x5072, 0, 0, 0, 0,0x376E,0x4D2D, 0, +0x4A7E, 0,0x497E, 0,0x5B2C, 0, 0, 0, + 0,0x3A73,0x443F,0x5B2D,0x4F2F, 0, 0, 0, +0x4B3E, 0,0x442B,0x5B2E,0x347C, 0, 0, 0, + 0, 0, 0,0x5B2F,0x5B30,0x4C5A, 0,0x4C24, +0x4B76,0x4B5C,0x3B25,0x5B32, 0, 0,0x3C6B, 0, + 0,0x4B51, 0,0x5B34,0x5B37,0x5B36, 0,0x3479, + 0, 0,0x3560, 0,0x5B33, 0,0x5B35, 0, + 0, 0, 0,0x5B38, 0, 0,0x3F79, 0, + 0, 0, 0,0x4D7B,0x3049,0x3A60,0x423C, 0, +0x3C5D, 0, 0,0x3E73, 0, 0,0x5B3B, 0, + 0,0x454E, 0,0x5B39,0x422B,0x5B3A,0x3E72,0x4C5D, +0x5B3C,0x5B3D,0x4D68, 0, 0, 0, 0,0x5B42, + 0, 0,0x393A, 0,0x4755,0x5B3F,0x456C,0x5A5E, +0x5A62, 0,0x354F, 0,0x4747, 0, 0, 0, + 0,0x5B41, 0,0x3E3E,0x4844, 0, 0, 0, + 0, 0,0x5B47, 0,0x487A, 0,0x5B3E, 0, +0x5B44,0x5B43, 0, 0, 0,0x404F, 0, 0, + 0, 0,0x4B6D, 0,0x4E53, 0, 0,0x4B67, + 0,0x324C,0x3B5E, 0, 0,0x4F48,0x5B46,0x3F75, + 0, 0, 0,0x5B45, 0, 0,0x5B40, 0, + 0, 0, 0, 0,0x384F, 0, 0, 0, +0x5B4C,0x5B4A, 0,0x324D,0x5B48,0x5B4E,0x5B54, 0, + 0, 0, 0, 0, 0, 0,0x4248, 0, + 0,0x4A41, 0,0x5B56, 0, 0, 0,0x4922, + 0, 0, 0,0x5B55,0x4770,0x4B3F,0x343B, 0, +0x4077,0x3D40, 0, 0, 0,0x4453, 0,0x4D2E, + 0, 0,0x5B51,0x5B50, 0, 0, 0,0x5B52, + 0,0x5B4F, 0, 0,0x5B57, 0,0x5B4D, 0, + 0,0x5B4B, 0,0x5B53,0x5B49, 0,0x436C, 0, +0x4C78,0x3C46,0x3A74, 0, 0, 0, 0, 0, +0x3A3A, 0, 0,0x4B6F,0x3341, 0, 0,0x444E, +0x464A,0x3149, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4072, 0, 0,0x4034,0x372A, 0, 0, 0, + 0, 0, 0,0x5B59, 0, 0,0x393B,0x337C, + 0, 0, 0, 0, 0, 0,0x5B5B,0x3374, +0x5B61, 0, 0, 0, 0, 0, 0,0x5B5E, + 0,0x4073, 0, 0, 0,0x334B,0x3A2C, 0, + 0,0x334A,0x3A4F, 0, 0,0x5B5C,0x3765,0x374B, +0x456D, 0, 0,0x5B5A, 0,0x3046, 0, 0, + 0, 0,0x5B5D,0x5B5F, 0,0x364D,0x372C, 0, +0x343C,0x354B, 0, 0, 0, 0,0x5B62, 0, + 0,0x3A79,0x4B71, 0,0x3B37, 0, 0, 0, +0x5B63, 0, 0, 0,0x4930, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B6F, 0,0x3233,0x5B64, 0, 0, 0, + 0, 0, 0,0x5B75,0x5B65, 0,0x4E42, 0, +0x5B6C, 0,0x475F, 0, 0, 0, 0, 0, + 0, 0,0x5B74, 0,0x5B67, 0, 0, 0, +0x3034,0x5B69, 0, 0,0x393C, 0, 0, 0, +0x5B6B, 0,0x5B6A, 0,0x5B66,0x5B71, 0,0x3E3F, + 0, 0, 0,0x546D,0x3868,0x4D7C, 0, 0, + 0, 0,0x5B68, 0,0x4474,0x3323,0x3A2D, 0, +0x5B60, 0,0x5B70,0x3361, 0, 0,0x5B6E,0x5B72, + 0,0x456E, 0, 0, 0, 0, 0, 0, + 0,0x347E, 0,0x5C32, 0, 0,0x4C49,0x5B77, +0x347D, 0,0x5B7E, 0, 0, 0, 0,0x4B40, + 0,0x5C21,0x5C23, 0,0x5C27,0x5B79, 0,0x432A, + 0, 0, 0, 0,0x456F,0x5C2B,0x5B7C, 0, +0x5C28, 0, 0, 0,0x5C22, 0, 0, 0, + 0, 0, 0,0x3F39,0x5C2C, 0, 0,0x4033, + 0, 0, 0, 0, 0, 0,0x5C2A,0x343D, + 0, 0, 0, 0, 0,0x4F50,0x5B76, 0, + 0,0x5C26,0x3058, 0, 0,0x5B78, 0, 0, +0x4C3A,0x5B7D,0x3F22,0x4447,0x5B73, 0, 0,0x5C25, + 0, 0, 0, 0, 0, 0,0x3F7A,0x5C2F, +0x3371,0x3821, 0, 0, 0, 0,0x5C31,0x5B7A, +0x5C30, 0,0x5C29,0x5B7B, 0,0x5C2D, 0,0x5C2E, + 0, 0, 0, 0, 0,0x5C3F, 0, 0, + 0,0x464E, 0,0x5C24, 0, 0,0x5C3B, 0, + 0, 0,0x5C3D, 0,0x4458, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4D4C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4976,0x5C38,0x424A, 0, 0, 0,0x5C3E,0x413F, + 0,0x5C35,0x5C42,0x5C41, 0,0x466F,0x5C40,0x466A, + 0, 0, 0, 0, 0, 0, 0,0x5C44, +0x5C37, 0,0x3648,0x5C3A,0x3D5D, 0, 0, 0, +0x4760,0x5C3C,0x364B, 0,0x5C34,0x5C36,0x5C33, 0, + 0,0x4F30,0x335A,0x5C39, 0, 0,0x5C43,0x3335, + 0, 0, 0, 0, 0, 0, 0,0x3A67, + 0, 0, 0,0x315D, 0, 0,0x5C54, 0, + 0,0x4F31,0x5C57, 0, 0, 0, 0, 0, +0x3F3A,0x5C56, 0, 0, 0,0x5C55, 0, 0, + 0, 0, 0, 0,0x5C52, 0, 0, 0, + 0, 0, 0,0x5C46, 0, 0,0x5C63,0x5C45, + 0,0x5C58, 0, 0, 0, 0, 0, 0, +0x5C50, 0, 0,0x5C4B,0x5C48, 0,0x5C49, 0, +0x5C51, 0, 0, 0,0x7422, 0, 0,0x5C4E, +0x393D,0x4448,0x4164,0x5C4C, 0,0x5C47, 0, 0, +0x5C4A, 0, 0, 0, 0,0x4D4D,0x4B6A, 0, + 0, 0,0x5C4F,0x5C59, 0, 0, 0, 0, + 0, 0, 0, 0,0x5C61,0x5C5A, 0, 0, +0x5C67, 0,0x5C65, 0, 0, 0, 0,0x5C60, + 0, 0, 0, 0, 0, 0,0x5C5F, 0, +0x4450, 0,0x4165, 0,0x5C5D, 0, 0,0x5C5B, + 0, 0,0x5C62, 0, 0, 0, 0,0x5C68, +0x4875,0x5C6E, 0, 0, 0, 0, 0,0x5C69, +0x5C6C,0x5C66, 0, 0,0x4374, 0,0x4938, 0, +0x5C5C, 0, 0,0x5C64,0x3E40, 0,0x4C4F,0x5C78, +0x5C6B, 0, 0, 0, 0, 0,0x3822,0x3223, +0x335F, 0, 0,0x5C53, 0, 0, 0, 0, + 0, 0,0x3E41,0x5C70, 0,0x5C77,0x3C79,0x3372, + 0, 0,0x432E, 0, 0, 0, 0, 0, + 0,0x5C6D, 0, 0,0x5C72,0x5C76, 0, 0, +0x3636, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x354C,0x5C74, 0, + 0, 0, 0, 0,0x3521, 0,0x464B,0x5C73, + 0, 0, 0,0x5C75, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5C6F, + 0, 0, 0, 0, 0,0x5C71, 0, 0, + 0, 0, 0, 0,0x3360,0x4349, 0, 0, + 0,0x5C7C, 0, 0, 0, 0, 0, 0, + 0, 0,0x5C7A,0x3869, 0,0x5C79, 0, 0, + 0, 0, 0, 0,0x5D21, 0, 0, 0, + 0,0x5B58, 0, 0, 0,0x5C7B, 0,0x5C7D, +0x5C7E, 0, 0, 0, 0, 0, 0,0x5D2C, + 0,0x5D28, 0,0x5B6D, 0, 0, 0, 0, +0x5D27, 0, 0, 0, 0,0x5D26, 0, 0, +0x5D23, 0, 0, 0, 0, 0,0x5C6A,0x5D25, +0x5D24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5D2A, 0, +0x4F26, 0, 0, 0, 0, 0, 0,0x5D2D, +0x367B, 0, 0,0x5D29,0x5D2B, 0, 0, 0, + 0, 0, 0, 0, 0,0x4827, 0,0x5D2E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5D32, +0x5D2F, 0, 0, 0, 0, 0, 0, 0, + 0,0x4D73,0x5D30, 0, 0, 0, 0,0x5C5E, + 0, 0, 0, 0, 0, 0, 0,0x5D33, + 0, 0, 0,0x5D34, 0, 0, 0, 0, + 0, 0,0x3135, 0,0x5D36,0x3767,0x3C21, 0, +0x3655, 0, 0, 0,0x3224, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4D5F, + 0, 0, 0, 0,0x5D38,0x5D37,0x5D3A,0x353D, + 0, 0,0x3656,0x343E, 0, 0, 0, 0, +0x5D3D, 0, 0, 0,0x5D3C, 0,0x5D3E, 0, + 0,0x324E, 0,0x4337, 0,0x5D3F, 0, 0, +0x343F,0x5D41, 0, 0, 0, 0,0x5D40, 0, +0x5D42, 0, 0, 0,0x5D43, 0,0x5D44,0x3B5F, +0x4035,0x3A21, 0,0x4970, 0, 0,0x4A62,0x4F44, + 0, 0, 0, 0,0x3B75, 0, 0, 0, +0x3A50,0x4E72, 0, 0, 0,0x5D45,0x5D46, 0, +0x3B60, 0, 0, 0,0x5D47,0x5D48, 0, 0, +0x5D4A,0x5D49, 0,0x4B58, 0, 0,0x3D5E,0x3C6C, +0x3B44, 0,0x5D4B, 0, 0, 0, 0, 0, + 0, 0,0x5D4D,0x3F23, 0,0x5D4C, 0, 0, + 0, 0, 0,0x5D4E, 0, 0, 0, 0, + 0,0x5D4F, 0, 0, 0, 0, 0,0x5D50, +0x5D51, 0, 0, 0,0x5D52, 0,0x5D54,0x5D53, +0x5D55,0x3225,0x434A, 0,0x5D56, 0, 0,0x3B26, +0x334C,0x5D57, 0, 0,0x4542,0x544C, 0, 0, + 0, 0,0x3523,0x5D58, 0, 0, 0, 0, +0x5D59, 0,0x4A6C,0x4B68, 0, 0, 0,0x4647, +0x5D5A,0x4866, 0, 0, 0,0x487B, 0, 0, +0x4C53, 0, 0, 0,0x5D5B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5D5D,0x5D5C, 0, 0,0x5D5F, 0, 0, 0, +0x5D5E}; + +/* page 30 0x6C08-0x6CF3 */ +static uint16 tab_uni_jisx020830[]={ +0x5D61, 0, 0, 0, 0, 0, 0,0x3B61, + 0,0x4C31, 0,0x5D62,0x5D63, 0, 0,0x3524, + 0, 0, 0,0x5D64, 0, 0, 0, 0, + 0, 0, 0,0x5D66,0x5D65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3F65, 0, 0,0x4939, +0x314A, 0, 0, 0, 0, 0,0x4845, 0, +0x4475,0x3D41,0x3561, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4846, 0, +0x3C2E, 0, 0, 0, 0,0x5D68, 0,0x3440, + 0, 0,0x3178, 0, 0,0x4672,0x5D67,0x393E, +0x4353, 0,0x5D69, 0, 0, 0, 0, 0, +0x5D71, 0,0x5D6A, 0, 0, 0, 0, 0, +0x4241, 0,0x3562,0x5D72, 0, 0, 0, 0, + 0, 0,0x3768, 0, 0,0x3525,0x5D70, 0, + 0,0x5D6E,0x5D6B,0x4D60, 0, 0, 0, 0, +0x4440, 0, 0, 0,0x4659,0x5D6C, 0, 0, +0x5D74, 0,0x5D73,0x3723, 0, 0,0x322D, 0, + 0,0x3A3B,0x5D6D,0x5D6F, 0, 0, 0, 0, + 0,0x4B57,0x4274, 0, 0, 0, 0, 0, + 0, 0, 0,0x4B77, 0, 0,0x5D7C, 0, + 0,0x5D7D, 0,0x324F, 0, 0, 0, 0, +0x4A28,0x4C7D,0x5E21,0x3C23,0x3E42,0x5D78,0x5D7E,0x3168, + 0,0x3637, 0, 0,0x5D75,0x5D7A, 0, 0, + 0,0x4074,0x4771, 0,0x4867, 0, 0, 0, + 0, 0, 0,0x5D77, 0,0x4B21, 0,0x5D79, + 0,0x5E24, 0,0x5E22, 0,0x5D7B, 0, 0, + 0,0x4B22,0x4748,0x3563, 0,0x4525, 0, 0, +0x436D, 0,0x5E25, 0, 0, 0, 0,0x5E23, +0x4259,0x5D76, 0,0x314B}; + +/* page 31 0x6D0B-0x7409 */ +static uint16 tab_uni_jisx020831[]={ +0x4D4E,0x5E30, 0, 0, 0, 0, 0,0x5E2F, + 0, 0, 0, 0,0x4076, 0,0x5E2C, 0, +0x4D6C, 0, 0,0x4636,0x5E26, 0, 0, 0, + 0, 0,0x4445, 0, 0, 0,0x314C,0x393F, +0x5E29, 0, 0, 0, 0, 0, 0,0x3D27, +0x5E2E, 0,0x5E2D,0x5E28, 0,0x5E2B, 0, 0, +0x3368, 0,0x5E2A,0x4749, 0, 0,0x4E2E, 0, + 0,0x3E74,0x4075, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5E36,0x5E34, + 0,0x494D, 0, 0, 0, 0, 0, 0, +0x5E31,0x5E33, 0,0x313A, 0, 0,0x3940,0x4F32, + 0,0x333D, 0,0x4962, 0, 0, 0, 0, + 0,0x4D61, 0, 0,0x3324,0x3F3B,0x5E35, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5E3A, 0, 0,0x3E43, 0, 0, + 0,0x4D30, 0,0x5E37, 0, 0, 0, 0, +0x5E32, 0,0x5E38, 0, 0, 0,0x4E5E, 0, +0x4573,0x4642, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3336, 0, 0,0x3155, + 0, 0,0x5E3E, 0, 0,0x5E41, 0, 0, + 0,0x4E43, 0, 0, 0,0x4D64, 0, 0, + 0, 0,0x5E48,0x5E42,0x5E3F, 0, 0, 0, +0x4E54,0x5E45, 0, 0, 0, 0,0x3D4A,0x5E47, + 0, 0,0x5E4C, 0, 0,0x4571,0x5E4A, 0, + 0, 0, 0,0x5E44, 0, 0,0x4338, 0, + 0,0x5E4B, 0,0x5E40, 0,0x5E46, 0,0x5E4D, +0x307C,0x5E43, 0,0x5E4E, 0, 0,0x3F3C, 0, +0x3D5F, 0,0x4A25, 0,0x3A2E, 0,0x5E3B,0x5E49, +0x453A, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4036, 0,0x3369,0x3A51,0x3E44,0x5E3D, +0x3D42, 0, 0, 0, 0, 0, 0, 0, +0x374C, 0,0x5E3C, 0, 0, 0,0x5E52,0x3D6D, +0x383A, 0,0x5E61, 0,0x5E5B,0x3574,0x454F, 0, +0x5E56,0x5E5F,0x302F,0x3132, 0, 0,0x3239, 0, +0x5E58,0x422C,0x5E4F,0x5E51,0x3941, 0, 0, 0, + 0, 0, 0, 0, 0,0x5E62, 0,0x5E5D, + 0, 0, 0,0x5E55, 0, 0, 0, 0, +0x5E5C, 0, 0, 0, 0, 0, 0,0x4C2B, + 0, 0,0x5E5A,0x5E5E, 0, 0, 0, 0, + 0, 0, 0,0x3850, 0,0x3E45, 0, 0, +0x4339, 0, 0, 0,0x5E54, 0, 0, 0, + 0, 0, 0, 0,0x4D2F, 0, 0, 0, +0x5E57, 0, 0,0x5E50,0x4572, 0, 0,0x5E53, + 0, 0, 0,0x5E59, 0, 0, 0, 0, + 0, 0, 0,0x4F51,0x3C3E,0x4B7E, 0,0x5E63, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x482E, 0, 0,0x5E6F,0x383B, 0, 0, + 0, 0, 0,0x3D60, 0,0x5E65, 0, 0, + 0,0x4E2F,0x3942, 0,0x5E72, 0, 0,0x306E, + 0, 0,0x5E70, 0, 0, 0, 0,0x5E64, + 0, 0, 0, 0,0x5E6A, 0, 0,0x5E6C, + 0, 0, 0,0x4D4F,0x5E67, 0, 0,0x452E, + 0, 0,0x5E69, 0, 0, 0, 0,0x5E71, + 0,0x5E6B,0x4C47, 0, 0, 0,0x5E66, 0, +0x3C22,0x5E7E, 0, 0, 0, 0,0x336A, 0, +0x5E68,0x5E6D,0x5E6E, 0, 0, 0, 0, 0, + 0, 0,0x426C,0x425A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E76, 0, 0,0x5E7C, 0, 0,0x5E7A, + 0,0x4529, 0, 0,0x5F23,0x5E77, 0, 0, + 0, 0, 0,0x5E78,0x5E60, 0,0x3579,0x493A, + 0, 0, 0,0x3C3F, 0, 0,0x3977, 0, + 0, 0, 0, 0,0x4F33, 0,0x5E74, 0, +0x5F22,0x3169,0x4166, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4779, 0,0x3441, +0x4E7A, 0, 0, 0, 0, 0, 0, 0, +0x4C21,0x4452, 0, 0, 0, 0,0x5E7B,0x5E7D, + 0, 0, 0, 0, 0,0x4132, 0, 0, + 0, 0, 0,0x5F21,0x5E79, 0,0x5E73, 0, + 0, 0,0x3443, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3769, 0, 0, 0,0x5F2F, 0, 0, +0x5F2A,0x4078, 0, 0,0x3363, 0, 0, 0, + 0,0x3D61, 0,0x5F33, 0, 0, 0, 0, + 0, 0,0x5F2C,0x442C,0x5F29,0x4459, 0, 0, + 0,0x5F4C, 0, 0, 0,0x5F26, 0,0x5F25, + 0,0x5F2E, 0, 0, 0,0x5F28,0x5F27,0x5F2D, + 0,0x4021, 0,0x5F24, 0, 0, 0, 0, + 0, 0, 0,0x5F30, 0, 0,0x5F31, 0, + 0, 0, 0, 0,0x3442, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F36, 0, +0x5F35,0x5F37, 0, 0, 0, 0, 0,0x5F3A, + 0, 0, 0, 0, 0, 0,0x4543, 0, +0x5F34, 0, 0, 0, 0, 0,0x5F38, 0, + 0, 0, 0, 0, 0,0x3763,0x4279,0x5F32, +0x473B, 0, 0,0x5F39, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F3E,0x5F3C, 0, 0,0x5F3F, 0, 0, +0x5F42, 0, 0, 0,0x5F3B,0x396A,0x4728, 0, + 0,0x5E39, 0, 0, 0, 0, 0, 0, +0x4D74,0x5F3D, 0,0x5F41,0x4275, 0,0x5F40, 0, +0x5F2B, 0, 0,0x6F69, 0, 0, 0,0x5F45, + 0, 0, 0,0x5F49, 0, 0,0x5F47, 0, + 0, 0, 0, 0, 0, 0,0x5F43, 0, +0x5F44, 0, 0, 0,0x5F48, 0,0x5F46, 0, + 0, 0,0x494E, 0, 0,0x5F4E, 0,0x5F4B, +0x5F4A, 0,0x5F4D,0x4654,0x5F4F, 0, 0, 0, + 0, 0, 0,0x4375,0x426D, 0, 0, 0, + 0,0x4025, 0, 0, 0,0x5F50, 0,0x5F52, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5F51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E75, 0, 0, 0, 0,0x5F53, 0, + 0, 0, 0, 0, 0,0x4667, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F54, 0, 0, 0, 0, 0, 0, 0, +0x3250, 0, 0, 0,0x4574,0x3325, 0, 0, + 0, 0, 0, 0, 0,0x3564, 0, 0, + 0,0x3C5E,0x3A52, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4F27,0x3F66, + 0, 0, 0,0x316A, 0, 0, 0,0x5F56, + 0, 0, 0, 0, 0, 0,0x5F55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F59,0x433A,0x5F5C,0x5F57, 0, 0, 0, +0x5F5B, 0, 0, 0, 0,0x5F5A,0x4540,0x3059, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4E75, 0, 0, +0x5F5E, 0, 0, 0,0x3128, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F60, 0, + 0, 0,0x5F5F, 0,0x5F5D, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F58, 0, + 0, 0, 0, 0, 0, 0,0x4B23, 0, + 0, 0,0x5F62, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5F61, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x316B, 0, 0, 0, 0,0x5F64,0x4A32, + 0,0x5F63, 0, 0, 0, 0,0x4C35, 0, + 0, 0, 0,0x3E47, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4133, 0, 0, 0, 0, + 0,0x3E46, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4E7B, 0, + 0,0x5F6A, 0,0x4079, 0, 0, 0, 0, + 0, 0,0x5F66,0x5F6B, 0, 0,0x316C, 0, + 0, 0, 0, 0, 0, 0, 0,0x5F69, + 0,0x4761,0x5F65,0x5F68,0x3E48, 0,0x4851, 0, + 0,0x5F6C, 0,0x3C51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x407A, 0, 0, 0, 0, 0, + 0,0x5F6F, 0, 0, 0,0x5F67, 0,0x3727, + 0, 0, 0, 0,0x5F6D, 0, 0, 0, + 0,0x4D50,0x5F70, 0, 0, 0,0x7426, 0, + 0, 0, 0, 0,0x3D4F, 0, 0, 0, + 0, 0, 0, 0, 0,0x5F71, 0, 0, + 0,0x5F72, 0, 0, 0, 0,0x472E, 0, + 0, 0, 0, 0, 0, 0,0x5F74, 0, + 0, 0, 0,0x5F75, 0, 0, 0, 0, +0x4733, 0, 0, 0, 0,0x4575,0x5F77, 0, + 0, 0, 0,0x5F79, 0,0x4E55, 0,0x5F76, + 0,0x5F78,0x316D, 0,0x5F73, 0, 0, 0, + 0, 0, 0, 0,0x535B,0x5F7A, 0, 0, + 0, 0,0x4167,0x3B38,0x5F7C, 0, 0, 0, + 0,0x5F7B,0x3F24,0x5259, 0, 0, 0, 0, + 0, 0,0x5F7D, 0, 0, 0,0x6021, 0, +0x5F6E,0x5F7E, 0, 0,0x6022, 0, 0, 0, + 0, 0, 0,0x477A, 0, 0, 0, 0, + 0, 0,0x6023, 0, 0,0x6024, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6025, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6026, 0,0x445E, + 0,0x6028,0x6027, 0, 0,0x6029, 0,0x602A, + 0, 0,0x3C5F,0x4963, 0, 0, 0,0x4C6C, +0x602B,0x602C,0x4156,0x3C24,0x602D,0x602E, 0, 0, + 0, 0, 0,0x602F,0x4A52,0x4847, 0, 0, +0x6030,0x4757, 0, 0, 0, 0, 0,0x442D, + 0, 0, 0, 0, 0,0x6031,0x3267, 0, +0x356D, 0,0x4C46, 0,0x4C36, 0,0x3234,0x4F34, + 0, 0, 0, 0,0x4B52, 0,0x4A2A, 0, + 0, 0, 0, 0, 0, 0, 0,0x4037, + 0,0x6032, 0, 0, 0, 0,0x4643, 0, + 0, 0,0x3823,0x6033, 0,0x3A54,0x6035,0x6034, + 0, 0, 0, 0,0x6036, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6037, + 0, 0, 0,0x6038, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x353E, 0,0x6039, + 0, 0, 0, 0,0x603A, 0, 0, 0, + 0,0x3824, 0, 0,0x4848, 0, 0,0x603C, + 0, 0, 0,0x3E75, 0, 0,0x603B, 0, + 0, 0, 0, 0, 0, 0, 0,0x3638, +0x603D,0x603F, 0,0x603E, 0, 0, 0, 0, + 0, 0, 0,0x6040, 0,0x3851, 0,0x6041, + 0, 0, 0, 0,0x3669, 0,0x4140, 0, +0x397D, 0, 0, 0, 0,0x6043,0x6044,0x6042, + 0, 0, 0, 0, 0, 0,0x3C6D, 0, + 0,0x4648,0x3639, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6046,0x432C,0x6045, 0, + 0,0x4F35,0x4762, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6049, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x604B,0x6048, 0, 0, 0, +0x4C54,0x604A,0x604C, 0,0x4E44, 0, 0, 0, + 0, 0,0x6050, 0, 0, 0,0x604F,0x4376, +0x472D, 0, 0,0x3825,0x604E, 0, 0, 0, + 0,0x604D, 0,0x4D31,0x4D32, 0, 0, 0, + 0, 0, 0,0x6051,0x316E, 0, 0, 0, + 0,0x3976,0x3B62, 0, 0, 0, 0, 0, + 0, 0, 0,0x6052,0x6053, 0, 0, 0, + 0, 0, 0, 0,0x6055, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3D43, 0, 0, 0, 0,0x6057, 0,0x6056, + 0, 0, 0, 0, 0,0x6058, 0,0x334D, + 0, 0,0x605A, 0, 0,0x6059, 0,0x605C, +0x605B, 0, 0, 0, 0, 0, 0, 0, + 0,0x383C, 0, 0,0x4E28, 0,0x364C, 0, +0x3226, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x366A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3461, 0, + 0, 0, 0, 0, 0, 0, 0,0x4E68, +0x605E, 0, 0, 0, 0, 0, 0, 0, +0x6060, 0, 0, 0, 0,0x6061, 0,0x3251, + 0, 0, 0, 0, 0,0x605D, 0,0x3B39, + 0, 0,0x4441,0x605F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6064, 0,0x3C6E, 0, 0, + 0, 0,0x6062, 0, 0, 0, 0,0x373E, + 0, 0,0x4849,0x6063, 0, 0,0x607E, 0, + 0, 0, 0, 0, 0,0x6069, 0, 0, + 0, 0, 0,0x383D, 0, 0, 0, 0, +0x3565, 0,0x6066,0x4D7D, 0, 0,0x4E30}; + +/* page 32 0x7422-0x7845 */ +static uint16 tab_uni_jisx020832[]={ +0x4276, 0, 0,0x6068, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x606A,0x4E56,0x3657,0x487C,0x474A, 0, 0, 0, +0x606B, 0, 0, 0, 0,0x606D, 0,0x6070, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x606C, 0, 0, 0,0x606F, +0x386A,0x314D,0x6071, 0,0x3F70,0x606E,0x4E5C, 0, + 0,0x6074,0x7424, 0, 0, 0, 0,0x6072, +0x6075, 0, 0, 0, 0,0x6067,0x6073, 0, + 0,0x3A3C, 0, 0,0x6076, 0, 0, 0, + 0, 0, 0, 0,0x6077, 0, 0, 0, + 0,0x4D7E, 0, 0, 0, 0, 0, 0, + 0,0x6078, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6079, 0, 0, 0, +0x6065, 0, 0, 0, 0,0x607A, 0, 0, + 0, 0, 0, 0, 0, 0,0x3444, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3C25, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x607B, 0, 0, 0, 0,0x607C, 0, 0, + 0, 0,0x607D, 0, 0, 0, 0, 0, + 0, 0,0x313B, 0, 0, 0,0x6121, 0, +0x493B,0x6122, 0, 0,0x3424,0x6123, 0,0x6124, + 0, 0, 0, 0,0x6125, 0,0x6127,0x6128, +0x6126, 0, 0, 0,0x4953,0x612A,0x6129, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x612C,0x612B,0x612D, 0, 0, 0, 0, + 0, 0,0x612E,0x6130,0x612F, 0, 0,0x3979, + 0,0x6132, 0,0x6131, 0, 0,0x3445, 0, +0x3F53, 0,0x453C, 0,0x6133,0x4038, 0, 0, + 0,0x3B3A, 0,0x3179,0x6134, 0,0x4D51, 0, + 0,0x4A63,0x6135, 0, 0, 0,0x4544,0x4D33, +0x3943,0x3F3D, 0, 0, 0,0x434B,0x5234, 0, +0x442E,0x3268,0x6136, 0, 0, 0, 0, 0, + 0, 0,0x6137, 0,0x613C, 0, 0,0x613A, +0x6139,0x5A42,0x3326,0x6138, 0,0x305A, 0,0x482A, + 0, 0,0x484A, 0, 0, 0, 0,0x4E31, +0x613D,0x613B,0x435C,0x4026, 0, 0,0x482B, 0, +0x492D, 0,0x613F,0x4E2C,0x374D,0x6140, 0,0x613E, +0x4856,0x6141, 0,0x6142, 0, 0,0x305B, 0, + 0,0x3E76,0x6147, 0,0x6144,0x466D,0x6143, 0, + 0, 0, 0, 0, 0,0x3526, 0, 0, +0x614A, 0, 0, 0,0x6145,0x6146, 0,0x6149, +0x6148,0x4925, 0, 0,0x4142,0x4141, 0,0x353F, + 0, 0,0x614B, 0, 0, 0, 0, 0, +0x614C, 0, 0,0x614D, 0, 0, 0, 0, + 0,0x614F, 0,0x614E, 0, 0, 0, 0, + 0,0x3156, 0, 0, 0, 0, 0,0x6157, +0x4868,0x6151, 0,0x6153, 0, 0,0x6155,0x3F3E, + 0, 0,0x6156,0x6154,0x3C40, 0, 0, 0, +0x6150,0x6152, 0,0x4942, 0,0x3E49, 0, 0, +0x6159, 0, 0,0x6158, 0, 0, 0, 0, +0x615A, 0,0x3C26,0x3A2F, 0, 0,0x4577,0x615B, + 0,0x444B, 0, 0,0x615D, 0, 0, 0, +0x4E21,0x615C, 0, 0, 0, 0, 0,0x4169, + 0, 0, 0, 0, 0, 0,0x6162, 0, +0x6164,0x6165,0x4354, 0, 0, 0, 0, 0, +0x6163, 0,0x6160, 0,0x615E,0x615F, 0,0x6161, + 0, 0, 0, 0, 0, 0, 0,0x6168, + 0,0x6166, 0,0x6167, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6169,0x616B,0x616C, +0x616D, 0,0x616E, 0, 0,0x616A, 0, 0, + 0, 0, 0, 0, 0, 0,0x6170, 0, + 0, 0,0x616F, 0, 0, 0, 0, 0, + 0,0x6171, 0, 0, 0, 0, 0, 0, +0x4E45, 0, 0, 0,0x6174,0x6172,0x6173, 0, + 0, 0,0x3462, 0, 0, 0, 0, 0, +0x4C7E, 0, 0, 0,0x4A4A, 0,0x6176, 0, + 0, 0,0x6175, 0, 0, 0, 0,0x6177, +0x6178, 0, 0, 0, 0,0x617C,0x6179,0x617A, +0x617B, 0,0x617D, 0, 0, 0,0x617E, 0, +0x6221, 0, 0, 0,0x6222, 0,0x6223, 0, +0x482F,0x4550,0x6224,0x4772,0x4934, 0,0x6225, 0, + 0,0x6226,0x452A, 0,0x3327,0x3944,0x6227, 0, + 0,0x6228, 0, 0,0x6229, 0,0x3B29, 0, + 0,0x622B, 0, 0,0x622A, 0, 0,0x622C, +0x622D, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4869, 0,0x622E, 0, + 0, 0,0x622F, 0, 0,0x7369,0x6230,0x6231, +0x6232, 0, 0, 0, 0,0x3B2E, 0, 0, +0x6233,0x4756, 0, 0,0x4B5F, 0,0x314E, 0, +0x3157, 0, 0,0x6234, 0, 0, 0, 0, +0x6236, 0, 0, 0,0x6235,0x4570, 0, 0, + 0,0x4039,0x5D39, 0,0x6237,0x4C41, 0,0x6238, + 0,0x3446,0x4857,0x6239, 0,0x623A, 0, 0, +0x623B, 0, 0, 0,0x4C5C, 0, 0, 0, +0x4C55, 0,0x443E, 0, 0, 0,0x416A, 0, + 0,0x623D, 0, 0,0x3D62, 0, 0,0x3E4A, + 0, 0,0x6240, 0, 0,0x623F,0x623E,0x487D, + 0,0x3447,0x3829, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6246, 0, 0,0x6243,0x3F3F,0x4C32, 0, + 0, 0,0x6242,0x6244,0x6245, 0, 0,0x6241, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6247,0x6248, 0, +0x442F, 0,0x3463, 0, 0, 0,0x4365, 0, + 0, 0, 0, 0, 0,0x6249, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x624A,0x624D, 0, 0, 0, 0, 0,0x3F67, + 0,0x4644, 0,0x624E,0x4B53, 0,0x624B, 0, + 0,0x624C, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6251, + 0, 0, 0, 0,0x6250,0x624F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6253, 0, 0,0x6252, 0, 0,0x6254, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6256, 0,0x6255, 0, + 0, 0, 0,0x4A4D, 0, 0, 0, 0, + 0, 0,0x3D56,0x4E46, 0, 0,0x6257, 0, + 0,0x4637, 0, 0,0x6258, 0, 0,0x6259, + 0,0x625D,0x625B,0x625C, 0,0x625A, 0, 0, + 0, 0, 0, 0, 0,0x625E, 0, 0, + 0, 0, 0,0x625F, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6260, 0, 0, +0x6261,0x4C37,0x6262, 0, 0, 0, 0, 0, +0x4C70,0x6263, 0,0x434E, 0,0x476A, 0,0x366B, + 0, 0, 0,0x433B,0x6264,0x363A, 0, 0, + 0,0x4050, 0, 0, 0, 0, 0, 0, + 0, 0,0x6265, 0, 0, 0, 0, 0, +0x3A3D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6266, 0, 0, 0, 0, 0, +0x6267, 0,0x3826,0x3A55, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6269, 0, + 0, 0, 0,0x4556,0x3A56,0x354E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4B24, 0,0x474B, 0, 0, 0, 0, 0, +0x4557, 0, 0, 0, 0,0x395C, 0, 0, + 0, 0, 0,0x626B}; + +/* page 33 0x785D-0x7E9C */ +static uint16 tab_uni_jisx020833[]={ +0x3E4B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4E32,0x3945, + 0, 0,0x3827, 0, 0,0x4823, 0,0x626D, + 0, 0, 0, 0, 0, 0, 0,0x626F, + 0, 0, 0, 0,0x386B, 0, 0, 0, + 0,0x626E,0x4476, 0, 0, 0, 0,0x6271, +0x3337,0x626C, 0, 0,0x486A, 0,0x3130, 0, +0x3A6C, 0,0x4F52, 0, 0,0x6270, 0, 0, + 0, 0, 0, 0, 0, 0,0x6272, 0, + 0, 0,0x4A4B, 0,0x4059,0x6274, 0, 0, + 0, 0,0x6275, 0, 0, 0, 0, 0, +0x6273, 0, 0, 0, 0,0x334E, 0,0x627B, + 0,0x627A, 0, 0,0x3C27, 0, 0, 0, +0x627C,0x6277, 0, 0, 0,0x627D,0x6278, 0, + 0, 0, 0,0x4858,0x6276, 0, 0,0x6279, + 0, 0, 0, 0, 0,0x6322, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6321,0x4B61, 0, 0, 0,0x627E, + 0, 0,0x306B, 0, 0, 0, 0,0x6324, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6323, 0, 0, 0,0x3E4C, 0, 0, 0, + 0, 0,0x6325, 0, 0, 0, 0, 0, + 0,0x4143, 0, 0,0x6327,0x6326, 0, 0, + 0, 0, 0, 0,0x6328, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6268, 0, 0, 0,0x626A,0x632A,0x6329, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C28, 0,0x4E69, + 0,0x3C52, 0,0x632B,0x3737, 0, 0, 0, + 0, 0,0x3540,0x3527,0x3B63, 0, 0, 0, + 0, 0, 0,0x4D34, 0, 0,0x6331, 0, +0x6330,0x4144,0x632D, 0, 0,0x632F, 0, 0, +0x3D4B,0x3F40,0x632E,0x632C, 0,0x472A, 0, 0, +0x3E4D, 0, 0,0x493C, 0, 0, 0, 0, +0x3A57, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4578, 0, 0,0x6332, 0, 0, + 0, 0,0x6333,0x6349,0x3658, 0, 0,0x4F3D, +0x4135, 0, 0, 0, 0,0x6334, 0, 0, +0x3252,0x4477,0x4A21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6335, 0, 0, 0, 0, 0, 0, 0, + 0,0x357A,0x6336, 0, 0,0x6338, 0, 0, + 0,0x6339, 0,0x4729, 0, 0,0x633A, 0, + 0, 0, 0, 0,0x633B,0x633C, 0, 0, +0x3659,0x3253,0x4645,0x3D28,0x3B64, 0, 0, 0, + 0, 0, 0, 0,0x633D, 0,0x3D29, 0, + 0, 0, 0, 0,0x324A,0x4943, 0, 0, +0x633E, 0, 0,0x486B, 0, 0, 0, 0, + 0, 0,0x4145, 0,0x6341, 0,0x6342,0x4769, + 0,0x3F41,0x633F, 0,0x4361, 0, 0,0x6340, + 0, 0, 0,0x3E4E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x305C, 0, + 0, 0, 0,0x3529, 0, 0, 0, 0, + 0, 0, 0,0x6343, 0, 0,0x4478, 0, +0x6344,0x4047, 0, 0, 0, 0, 0,0x4C2D, + 0, 0,0x4923,0x6345,0x6346,0x4355, 0,0x4E47, + 0, 0,0x6348,0x6347, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3C6F, 0, 0,0x634A,0x3070, 0, 0, + 0, 0,0x634D, 0, 0, 0,0x634B,0x3254, +0x374E,0x634C,0x3946,0x3972, 0,0x4A66,0x634E, 0, + 0,0x4B54, 0, 0,0x6350, 0, 0, 0, +0x4051,0x314F,0x323A,0x302C, 0, 0, 0, 0, + 0, 0,0x634F, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6351,0x6352,0x3E77, 0, + 0, 0, 0, 0,0x6353, 0,0x334F, 0, + 0, 0, 0,0x6355, 0, 0, 0,0x376A, + 0,0x3566, 0, 0,0x6356,0x3675, 0, 0, +0x6357, 0,0x407C, 0,0x464D, 0,0x4060,0x3A75, + 0, 0, 0,0x6358, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4362,0x416B, 0, +0x635A,0x635C,0x6359,0x635B, 0, 0, 0, 0, + 0, 0,0x3722, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x635D,0x3726, 0, 0, + 0,0x3567,0x4D52,0x635F, 0, 0, 0, 0, + 0,0x6360, 0, 0, 0,0x312E, 0, 0, + 0, 0,0x6363, 0, 0, 0,0x3376,0x6362, +0x6361, 0,0x6365,0x635E, 0,0x6366,0x4E29, 0, +0x6367, 0,0x6368, 0, 0,0x5474,0x636A, 0, +0x6369, 0, 0, 0,0x636B,0x636C, 0,0x4E35, +0x636D, 0,0x706F,0x3E4F,0x636E,0x636F,0x3D57, 0, +0x4638,0x6370, 0, 0, 0,0x4328, 0, 0, +0x6371, 0,0x433C,0x6372, 0, 0, 0, 0, + 0,0x3625, 0,0x513F,0x435D,0x3C33, 0, 0, + 0, 0,0x3448, 0, 0,0x6373, 0,0x6422, + 0,0x6376, 0,0x3568, 0,0x6375,0x6424, 0, + 0, 0,0x6374, 0,0x3E50, 0, 0, 0, + 0, 0, 0,0x6378,0x6379, 0,0x452B, 0, + 0,0x637A, 0,0x335E, 0, 0, 0, 0, +0x3F5A,0x4964, 0,0x637C, 0, 0, 0,0x4268, + 0, 0, 0, 0, 0, 0,0x6377, 0, +0x637B,0x637D, 0, 0,0x3A7B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6426,0x492E, 0,0x4826,0x4579, 0,0x365A,0x6425, +0x6423, 0,0x4835,0x637E,0x435E,0x457B, 0,0x457A, + 0,0x3A76, 0, 0, 0, 0, 0, 0, +0x6438, 0, 0, 0, 0, 0, 0, 0, +0x6428, 0,0x642A, 0, 0, 0, 0,0x642D, + 0,0x642E, 0,0x642B,0x642C, 0, 0,0x6429, +0x6427, 0, 0, 0, 0,0x6421, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4A4F,0x3255, 0, 0, 0,0x6435, 0, +0x6432, 0,0x6437, 0, 0,0x6436, 0,0x4773, +0x4C27, 0,0x3B3B,0x6430,0x6439,0x6434, 0,0x6433, +0x642F, 0,0x6431, 0,0x3449, 0, 0, 0, + 0, 0, 0, 0, 0,0x433D, 0, 0, +0x407D, 0, 0, 0,0x4822, 0, 0,0x643E, + 0, 0, 0,0x4824, 0, 0, 0, 0, + 0, 0, 0,0x4061,0x643B, 0, 0,0x484F, + 0,0x643F,0x4A53, 0,0x435B, 0,0x643A,0x643C, + 0, 0,0x643D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6440, 0, 0,0x3C44, 0, 0, 0,0x4646, +0x6445,0x6444, 0, 0,0x6441, 0, 0, 0, +0x4F36, 0, 0, 0, 0, 0,0x644A, 0, + 0,0x644E,0x644B, 0, 0, 0, 0, 0, + 0, 0, 0,0x6447, 0, 0, 0, 0, + 0, 0,0x6448, 0, 0, 0, 0, 0, +0x644D, 0, 0, 0,0x6442,0x5255,0x6449,0x6443, + 0, 0,0x644C, 0, 0, 0, 0, 0, + 0, 0,0x6452, 0,0x344A, 0,0x644F, 0, + 0, 0,0x6450, 0, 0,0x6451,0x6454, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6453,0x4876, 0, 0, 0, 0, +0x6455,0x4E7C,0x4A6D,0x645A, 0, 0,0x6457, 0, + 0, 0, 0, 0, 0, 0, 0,0x6456, +0x4052, 0,0x6459,0x645B, 0, 0, 0,0x6458, + 0,0x645F, 0,0x645C, 0, 0, 0, 0, + 0, 0,0x645D,0x6446, 0, 0, 0,0x645E, +0x6460, 0, 0, 0, 0, 0, 0,0x6461, + 0, 0, 0, 0, 0, 0,0x4A46, 0, +0x6462, 0, 0, 0, 0, 0, 0, 0, + 0,0x4C62, 0, 0,0x364E,0x3729,0x6463, 0, + 0, 0, 0, 0,0x4A34, 0,0x3F68, 0, +0x4C30, 0, 0,0x6464, 0,0x4E33, 0, 0, +0x4774, 0,0x4146,0x4734, 0, 0,0x3D4D, 0, + 0, 0,0x3040, 0,0x6469,0x6467, 0,0x6465, +0x3421, 0,0x3E51,0x646A, 0, 0,0x6468, 0, +0x6466,0x646E, 0, 0,0x646D,0x646C,0x646B, 0, + 0, 0, 0, 0,0x646F, 0, 0, 0, +0x6470,0x403A, 0,0x6471, 0,0x6473, 0, 0, +0x6472, 0, 0, 0, 0,0x3852, 0, 0, + 0,0x4138, 0, 0, 0,0x6475, 0, 0, + 0,0x457C, 0,0x6474, 0, 0, 0,0x6476, + 0,0x4A35,0x416C,0x3947, 0,0x6477, 0, 0, + 0, 0,0x4E48, 0, 0, 0, 0, 0, + 0, 0,0x6479, 0, 0,0x647A, 0,0x647B, + 0,0x647C, 0,0x3B65, 0,0x647D,0x374F, 0, + 0,0x356A, 0,0x352A, 0,0x6521, 0,0x4C73, +0x3948,0x647E, 0, 0, 0,0x6524,0x4C66, 0, +0x473C, 0, 0,0x4933, 0, 0, 0,0x3D63, +0x6523, 0,0x3C53,0x3949,0x3B66,0x3569,0x4A36,0x6522, + 0, 0, 0,0x4147,0x4B42,0x3A77, 0, 0, + 0, 0, 0, 0, 0, 0,0x3B67,0x445D, + 0,0x6527,0x4E5F,0x3A59, 0,0x6528,0x3F42, 0, +0x652A, 0, 0, 0,0x3E52,0x3A30, 0, 0, + 0, 0,0x6529, 0, 0,0x3D2A,0x383E,0x4148, +0x6525,0x652B, 0, 0, 0, 0,0x6526,0x3750, + 0,0x652E,0x6532,0x376B, 0, 0, 0, 0, + 0,0x652D, 0, 0, 0, 0,0x6536, 0, + 0,0x394A, 0, 0,0x4D6D,0x303C,0x6533, 0, + 0,0x356B, 0,0x6530, 0, 0, 0, 0, + 0,0x6531, 0, 0,0x457D,0x652F,0x652C, 0, +0x3328,0x4064, 0, 0,0x3828, 0, 0, 0, +0x6538, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6535, 0, 0, 0, + 0, 0,0x6537, 0, 0, 0,0x6534, 0, + 0, 0, 0, 0,0x3751,0x4233,0x6539,0x416E, + 0, 0,0x6546, 0, 0,0x6542,0x653C, 0, + 0, 0, 0, 0, 0, 0,0x6540,0x3C7A, +0x305D,0x653B,0x6543,0x6547,0x394B,0x4C56, 0,0x4456, +0x653D, 0, 0,0x6545, 0,0x653A,0x433E, 0, +0x653F,0x303D,0x4C4A, 0, 0, 0, 0, 0, + 0, 0,0x653E, 0, 0,0x365B,0x486C, 0, + 0, 0,0x416D, 0,0x4E50,0x3D6F, 0, 0, +0x656E, 0, 0,0x6548, 0,0x407E, 0,0x6544, +0x6549,0x654B, 0,0x4479,0x654E, 0, 0,0x654A, + 0, 0, 0,0x4A54,0x344B, 0, 0,0x4C4B, + 0, 0,0x305E, 0, 0,0x654D, 0,0x4E7D, + 0, 0, 0, 0, 0, 0,0x654C, 0, + 0, 0, 0, 0,0x316F, 0, 0,0x466C, +0x654F, 0, 0, 0,0x6556,0x6550,0x6557, 0, + 0, 0, 0, 0, 0,0x6553, 0, 0, + 0, 0, 0, 0, 0, 0,0x477B, 0, + 0,0x3C4A,0x6555, 0,0x6552,0x6558,0x6551, 0, + 0,0x3D44, 0, 0, 0, 0,0x4B25, 0, + 0,0x3D4C, 0, 0,0x6554,0x6560, 0, 0, +0x655C, 0,0x655F, 0,0x655D,0x6561,0x655B, 0, +0x6541,0x4053, 0, 0,0x484B, 0,0x655E, 0, + 0,0x6559, 0, 0, 0,0x4121,0x3752, 0, +0x3D2B, 0, 0, 0, 0, 0, 0,0x3F25, +0x4136,0x6564, 0, 0,0x6566,0x6567, 0, 0, +0x6563,0x6565, 0, 0, 0, 0, 0, 0, + 0,0x655A,0x6562, 0,0x656A,0x6569, 0, 0, +0x4B7A, 0, 0,0x372B, 0, 0, 0, 0, + 0, 0, 0, 0,0x6568, 0,0x656C,0x656B, +0x656F, 0,0x6571, 0, 0,0x3B3C,0x656D, 0, + 0, 0, 0,0x6572,0x6573, 0, 0,0x6574, + 0,0x657A,0x453B,0x6576, 0,0x6575,0x6577,0x6578, + 0,0x6579, 0, 0, 0, 0,0x657B,0x657C +}; + +/* page 34 0x7F36-0x8358 */ +static uint16 tab_uni_jisx020834[]={ +0x344C, 0,0x657D, 0,0x657E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6621, + 0, 0, 0, 0, 0, 0,0x6622,0x6623, +0x6624, 0,0x6625,0x6626, 0, 0,0x6628,0x6627, + 0, 0,0x6629, 0, 0, 0, 0, 0, + 0,0x662A,0x662B, 0, 0, 0, 0, 0, + 0,0x662E,0x662C,0x662D,0x3A61,0x3753, 0, 0, +0x4356, 0,0x4833, 0,0x3D70, 0, 0,0x474D, + 0,0x486D,0x662F,0x586D, 0, 0, 0, 0, + 0, 0, 0, 0,0x6630,0x6632, 0,0x4D65, +0x6631,0x6634,0x6633, 0,0x4D53, 0,0x6635, 0, +0x487E, 0, 0, 0, 0, 0,0x6636, 0, + 0, 0, 0, 0,0x6639, 0, 0,0x6638, +0x6637, 0, 0, 0, 0,0x663A,0x3732, 0, + 0, 0,0x4122,0x3541, 0, 0, 0, 0, +0x663E,0x663B, 0, 0,0x663C, 0, 0, 0, +0x663F, 0,0x6640,0x663D, 0, 0, 0,0x3129, + 0, 0, 0,0x3227, 0, 0, 0,0x6642, +0x6643, 0, 0, 0,0x6644, 0,0x4D62, 0, + 0, 0, 0, 0,0x3D2C, 0,0x6646,0x6645, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3F69,0x6647, 0, 0, 0, 0, +0x6648, 0, 0,0x6649, 0,0x3465, 0, 0, + 0, 0,0x344D, 0, 0,0x664A, 0, 0, + 0, 0, 0,0x664B, 0,0x4B5D,0x4D63, 0, + 0, 0,0x4D54,0x4F37, 0,0x394D,0x664E,0x3C54, +0x664D, 0, 0, 0, 0,0x664F,0x3C29, 0, + 0, 0,0x4251, 0,0x6650, 0, 0,0x394C, + 0,0x4C57,0x6651,0x6652, 0, 0,0x6653, 0, + 0, 0, 0,0x6654, 0, 0, 0, 0, + 0, 0,0x6655, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C2A, 0, 0, +0x4C6D, 0, 0, 0, 0,0x6657, 0,0x433F, + 0,0x6656, 0, 0, 0, 0, 0, 0, +0x6659, 0, 0, 0,0x6658, 0, 0, 0, + 0, 0, 0, 0,0x665A, 0, 0, 0, +0x403B, 0,0x665B, 0,0x665C, 0, 0, 0, +0x4A39,0x665D, 0,0x416F,0x665E, 0, 0, 0, + 0, 0,0x665F, 0, 0, 0, 0, 0, + 0,0x4E7E,0x6662, 0,0x6661,0x6660,0x4430, 0, +0x6663,0x3F26, 0,0x6664, 0, 0, 0,0x6665, +0x4F38,0x6666, 0, 0, 0, 0,0x6667,0x6669, +0x6668,0x4825, 0,0x4679, 0,0x4F3E,0x4829, 0, + 0, 0, 0, 0, 0,0x666B, 0, 0, +0x3E53, 0,0x492A, 0,0x666C,0x666A, 0,0x344E, + 0, 0, 0,0x3854,0x3B68, 0, 0,0x486E, + 0, 0, 0,0x382A,0x4B43, 0,0x666F,0x666D, + 0,0x394E, 0,0x394F,0x3069, 0,0x3A68, 0, + 0, 0, 0, 0,0x4759, 0, 0, 0, + 0, 0, 0, 0, 0,0x305F,0x6674, 0, +0x4340, 0, 0, 0, 0, 0,0x4758, 0, +0x425B, 0, 0, 0, 0, 0, 0, 0, +0x6676, 0, 0,0x6672,0x6675,0x6670, 0,0x6673, +0x4B26, 0, 0,0x3855, 0, 0,0x307D,0x6671, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6678, 0,0x6679, 0, 0,0x4639, 0, + 0, 0,0x363B, 0, 0, 0,0x6726,0x473D, + 0, 0, 0, 0,0x3B69, 0, 0,0x363C, +0x4048,0x4F46,0x4C2E,0x6677,0x4054, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3553,0x667A, 0, 0, + 0, 0, 0, 0, 0,0x667C, 0, 0, + 0, 0, 0,0x667B, 0, 0, 0, 0, + 0,0x667D, 0,0x4326, 0,0x473E, 0, 0, + 0, 0, 0,0x4431, 0, 0, 0, 0, +0x6723, 0, 0, 0, 0, 0, 0, 0, +0x6722, 0, 0, 0, 0,0x667E, 0, 0, +0x3F55, 0,0x4965,0x6725, 0,0x6724,0x3950,0x4F53, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6735, 0, 0, 0, 0, 0,0x6729, +0x672A, 0, 0, 0, 0,0x3C70, 0, 0, +0x6728, 0,0x3978,0x6727, 0, 0,0x672B, 0, + 0, 0,0x4432,0x4A22,0x4123, 0, 0, 0, + 0,0x425C,0x672F, 0,0x6730,0x672C, 0, 0, + 0, 0,0x672D, 0,0x672E, 0, 0, 0, + 0,0x3951, 0, 0, 0,0x6736, 0,0x6732, + 0, 0, 0, 0,0x4966, 0,0x4B6C,0x4928, + 0, 0,0x6731, 0, 0,0x6734,0x6733, 0, + 0, 0,0x4B44,0x6737, 0, 0, 0, 0, + 0, 0,0x6738, 0, 0,0x4137, 0,0x6739, + 0, 0,0x673B, 0,0x673F, 0, 0,0x673C, +0x673A,0x473F,0x673D, 0,0x673E, 0, 0, 0, +0x3232, 0,0x6745,0x6740, 0, 0, 0,0x6741, + 0, 0, 0,0x6742, 0,0x4221, 0, 0, + 0, 0,0x6744,0x6743,0x6746, 0, 0, 0, + 0,0x6747,0x6748, 0, 0,0x3F43, 0,0x3269, + 0,0x6749,0x4E57, 0,0x3C2B, 0, 0,0x3D2D, + 0, 0, 0, 0, 0,0x3B6A,0x4357, 0, + 0, 0, 0, 0,0x674A,0x674B,0x3131, 0, +0x674C, 0, 0,0x674D,0x674E, 0, 0,0x674F, + 0,0x6750,0x363D,0x5A2A,0x6751, 0,0x4065,0x6752, +0x3C4B, 0,0x6753, 0,0x5030, 0, 0, 0, +0x6754,0x4A5E,0x345C, 0, 0,0x4124,0x3D58, 0, +0x4971,0x3D2E, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6755,0x3952,0x6756,0x484C, 0, +0x6764, 0, 0, 0, 0,0x6758, 0,0x4249, +0x4775,0x383F,0x6757,0x4125, 0, 0, 0, 0, + 0, 0,0x6759, 0, 0, 0, 0, 0, + 0,0x447A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x675B,0x675A,0x675D, 0, 0,0x675C, + 0,0x675E, 0, 0,0x6760, 0,0x675F, 0, +0x344F, 0,0x6761, 0,0x6762,0x6763, 0, 0, +0x3A31,0x4E49, 0,0x6765,0x3F27, 0, 0, 0, +0x3170,0x6766,0x6767, 0, 0, 0, 0, 0, +0x6768, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3072, 0,0x6769, + 0, 0, 0, 0,0x676A, 0, 0, 0, + 0, 0, 0,0x4967, 0, 0, 0,0x3C47, + 0,0x676C, 0, 0, 0, 0, 0,0x3329, +0x3032, 0, 0, 0, 0,0x676B,0x676E,0x474E, + 0,0x3F44, 0,0x3256, 0,0x4B27, 0, 0, + 0, 0,0x375D,0x365C, 0,0x676D, 0,0x326A, + 0, 0, 0, 0, 0, 0, 0,0x3423, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3171,0x6772,0x4E6A,0x425D, 0, + 0,0x4944, 0,0x677E, 0,0x3257,0x677C, 0, +0x677A,0x6771, 0,0x676F, 0,0x6770, 0,0x3C63, +0x366C,0x4377, 0, 0, 0,0x4651, 0, 0, + 0, 0, 0,0x3151, 0,0x6774,0x6773, 0, + 0, 0, 0,0x6779,0x6775,0x6778, 0, 0, + 0, 0, 0, 0,0x4C50,0x6777,0x3258,0x337D, +0x677B, 0, 0,0x677D, 0, 0, 0, 0, +0x3754, 0, 0, 0, 0, 0, 0, 0, +0x6823,0x682C,0x682D, 0, 0, 0,0x302B, 0, + 0, 0, 0, 0, 0,0x6834, 0, 0, + 0, 0,0x3071, 0, 0,0x682B, 0, 0, + 0,0x682A, 0,0x6825,0x6824, 0,0x6822,0x6821, +0x4363, 0,0x427B,0x6827, 0, 0, 0, 0, + 0, 0,0x6826, 0, 0, 0, 0,0x6829, + 0, 0, 0,0x4170,0x3755, 0, 0, 0, + 0,0x3141,0x6828, 0,0x3953, 0, 0, 0, + 0, 0,0x4171}; + +/* page 35 0x8373-0x8B9A */ +static uint16 tab_uni_jisx020835[]={ +0x683A, 0,0x683B, 0,0x3259, 0, 0, 0, +0x322E,0x6838, 0, 0, 0, 0, 0, 0, + 0, 0,0x682E, 0,0x6836, 0,0x683D,0x6837, + 0, 0, 0,0x6835, 0, 0, 0, 0, +0x6776, 0, 0,0x6833, 0, 0, 0,0x682F, + 0, 0, 0,0x3450,0x6831,0x683C, 0,0x6832, + 0, 0, 0, 0, 0,0x683E, 0,0x6830, +0x477C, 0, 0, 0, 0, 0,0x4D69, 0, + 0, 0,0x6839, 0, 0, 0, 0, 0, + 0, 0,0x684F, 0, 0, 0,0x6847, 0, + 0, 0,0x3F7B, 0, 0, 0, 0,0x3546, + 0,0x365D, 0,0x6842, 0, 0, 0, 0, +0x325B, 0, 0,0x3E54, 0,0x6845, 0, 0, + 0,0x3A5A, 0, 0,0x4551,0x684A, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A6E, 0, +0x6841, 0, 0, 0,0x325A,0x3856,0x4929,0x684B, + 0,0x683F, 0, 0,0x6848, 0, 0, 0, +0x6852, 0,0x6843, 0, 0, 0, 0, 0, +0x6844,0x463A, 0, 0,0x6849, 0, 0, 0, +0x6846,0x4B28,0x684C,0x3060, 0, 0, 0, 0, +0x6840, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x684E, 0,0x684D, + 0, 0, 0, 0, 0, 0,0x476B,0x6854, + 0,0x685F, 0, 0, 0, 0,0x337E, 0, + 0, 0,0x6862, 0, 0,0x6850, 0, 0, + 0,0x6855,0x4D6E, 0, 0, 0, 0, 0, + 0, 0, 0,0x685E, 0, 0,0x4D55, 0, + 0, 0, 0,0x4E2A, 0, 0, 0, 0, + 0, 0, 0, 0,0x4378, 0, 0, 0, +0x336B, 0, 0, 0, 0, 0,0x4972,0x6864, +0x4621, 0, 0,0x3031, 0, 0,0x685D, 0, +0x6859,0x4172,0x6853,0x685B,0x6860, 0,0x472C, 0, + 0, 0,0x302A, 0,0x6858, 0,0x6861,0x4978, + 0, 0, 0, 0, 0, 0, 0,0x685C, + 0,0x6857, 0, 0, 0, 0, 0, 0, +0x3E55, 0, 0, 0, 0,0x3D2F, 0, 0, + 0,0x3C2C, 0, 0, 0, 0,0x4C58, 0, + 0,0x4947, 0, 0,0x6867, 0,0x6870, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x685A, 0, 0, 0, 0,0x3377, + 0, 0, 0, 0, 0,0x3E78,0x6865, 0, +0x686A,0x4173, 0, 0,0x6866, 0,0x686D, 0, + 0,0x435F, 0,0x686E, 0, 0,0x4D56,0x6863, +0x3338, 0,0x6869, 0, 0,0x686C,0x4C2C, 0, + 0, 0, 0,0x686F, 0, 0,0x6868,0x686B, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4B29, 0,0x4F21, 0, 0, 0, 0, + 0,0x6873, 0, 0, 0, 0, 0, 0, + 0,0x687A, 0, 0,0x6872,0x3C43, 0, 0, + 0, 0, 0,0x6851, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A4E, 0, +0x4C22,0x6879,0x6878, 0,0x6874,0x6875, 0,0x3136, + 0, 0, 0, 0,0x6877, 0,0x6871, 0, + 0, 0, 0,0x4455, 0, 0, 0, 0, + 0,0x6876,0x307E, 0, 0, 0, 0, 0, + 0, 0,0x4222, 0, 0, 0, 0, 0, + 0, 0,0x4A43, 0, 0,0x687B,0x6921, 0, +0x4859, 0, 0, 0, 0,0x687E,0x3E56,0x3C49, +0x6923, 0, 0,0x363E, 0, 0, 0, 0, + 0, 0,0x6924, 0,0x4979,0x687D, 0,0x6856, + 0, 0, 0, 0, 0, 0, 0, 0, +0x687C, 0, 0, 0, 0,0x4F4F,0x4622,0x4973, + 0, 0,0x692B, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6931, 0, 0, 0, + 0, 0, 0,0x6932, 0,0x6925, 0, 0, + 0,0x4776, 0, 0,0x692F,0x6927, 0,0x6929, + 0, 0, 0, 0, 0,0x6933,0x6928, 0, + 0,0x692C, 0, 0,0x3172, 0,0x4665, 0, +0x692D,0x6930, 0, 0, 0, 0, 0, 0, + 0,0x6926, 0,0x4126, 0,0x692A,0x3B27,0x3F45, +0x3730,0x4C74, 0,0x4C79,0x3D72, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6937,0x6935, + 0, 0, 0, 0, 0, 0,0x4F4E, 0, + 0, 0, 0, 0, 0, 0,0x6934, 0, + 0, 0,0x4D75, 0,0x6936,0x6938, 0, 0, + 0, 0,0x6939, 0, 0, 0, 0, 0, + 0,0x693C,0x693A, 0, 0, 0, 0, 0, + 0,0x4623,0x693B, 0, 0, 0,0x484D,0x692E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3D73, 0,0x693D,0x6942, +0x4174, 0, 0,0x6941, 0, 0, 0,0x6922, + 0, 0, 0,0x6943,0x4149, 0, 0,0x693E, +0x6940, 0, 0, 0, 0, 0, 0, 0, +0x693F, 0, 0,0x5D31,0x5D22, 0, 0,0x6945, + 0, 0, 0, 0, 0, 0, 0,0x6944, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D76, 0,0x623C,0x6946, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6947, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6948,0x3857, 0,0x3554, 0, 0, + 0,0x694A,0x515D, 0, 0, 0, 0,0x3575, + 0,0x4E3A, 0,0x3673,0x694B, 0, 0, 0, + 0, 0, 0, 0,0x694C, 0, 0, 0, +0x436E, 0, 0, 0, 0, 0,0x694D, 0, + 0, 0, 0, 0, 0, 0,0x467A, 0, +0x303A, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3263, +0x6952,0x6953, 0, 0, 0, 0, 0, 0, +0x694E, 0,0x3B3D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x694F,0x4742, 0, 0, 0, 0,0x6950,0x6951, +0x695B, 0, 0, 0,0x6955,0x6958, 0, 0, + 0, 0, 0,0x6954, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6956, 0,0x6957,0x3C58, 0,0x6959, 0, +0x4341, 0,0x3756,0x3342, 0, 0, 0, 0, + 0,0x695C, 0, 0, 0, 0,0x333F, 0, +0x6961, 0, 0,0x695D,0x6960, 0, 0, 0, + 0,0x483A, 0, 0, 0, 0,0x695E, 0, + 0,0x695F,0x4948,0x485A,0x6962, 0, 0, 0, + 0, 0, 0, 0, 0,0x427D,0x696C, 0, +0x6968, 0, 0,0x326B, 0,0x6966, 0,0x4B2A, +0x6967, 0, 0,0x6964, 0,0x6965,0x696A,0x696D, + 0, 0,0x696B, 0, 0, 0,0x6969,0x6963, + 0, 0, 0, 0, 0,0x4358, 0,0x6974, + 0,0x4C2A, 0, 0, 0, 0, 0, 0, + 0, 0,0x6972, 0, 0, 0,0x6973, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x696E, 0, 0,0x6970, 0, 0, 0, +0x6971, 0, 0, 0,0x696F, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4066, 0, +0x4F39,0x6978, 0,0x6979, 0, 0, 0, 0, +0x6A21, 0,0x3F2A, 0,0x697B, 0,0x697E, 0, + 0, 0, 0, 0,0x6976,0x6975, 0, 0, +0x6A22, 0, 0,0x325C, 0,0x697C, 0,0x6A23, + 0, 0, 0,0x697D, 0, 0, 0, 0, + 0,0x697A, 0,0x4433, 0,0x6977, 0, 0, + 0, 0, 0, 0,0x4768, 0, 0,0x6A27, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D3B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6A26, 0, 0,0x6A25, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6A2E, 0, 0, 0,0x6A28, 0, 0, 0, +0x6A30, 0, 0, 0, 0, 0, 0,0x4D66, +0x6A33, 0,0x6A2A, 0, 0,0x6A2B, 0, 0, + 0,0x6A2F, 0,0x6A32,0x6A31, 0, 0, 0, +0x6A29, 0, 0, 0, 0,0x6A2C, 0,0x6A3D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6A36, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6A34, 0, 0,0x6A35, + 0, 0, 0,0x6A3A,0x6A3B, 0,0x332A, 0, +0x3542, 0, 0,0x6A39, 0, 0, 0, 0, + 0, 0,0x6A24, 0, 0, 0, 0, 0, + 0, 0,0x6A38,0x6A3C,0x6A37, 0,0x6A3E, 0, + 0, 0,0x6A40,0x6A3F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A42,0x6A41, +0x695A, 0, 0, 0,0x6A46, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A43, 0, + 0, 0, 0,0x6A44, 0, 0,0x6A45, 0, +0x6A47, 0, 0, 0, 0,0x376C, 0,0x6A49, + 0,0x6A48, 0,0x3D30, 0, 0, 0, 0, + 0,0x3954,0x5E27, 0, 0, 0, 0,0x6A4A, +0x3D51, 0, 0, 0,0x3339, 0,0x6A4B, 0, +0x3152, 0,0x3E57,0x6A4C, 0, 0,0x3955,0x6A4D, +0x3061, 0, 0, 0, 0,0x493D, 0, 0, +0x6A4E, 0, 0, 0, 0,0x3F6A, 0,0x6A55, + 0, 0,0x6A52, 0,0x436F, 0, 0, 0, + 0, 0,0x6A53,0x6A50,0x365E, 0,0x6A4F,0x6A56, + 0, 0, 0, 0, 0,0x3736, 0, 0, +0x425E, 0,0x6A5C, 0, 0, 0, 0,0x6A58, + 0, 0, 0,0x4235,0x6A57, 0,0x6A5A, 0, + 0, 0, 0,0x6A51, 0, 0, 0,0x6A5B, + 0,0x6A5D, 0, 0, 0, 0, 0, 0, +0x486F, 0, 0,0x6A59, 0,0x6A5E,0x6A60, 0, + 0,0x3853,0x6A54, 0,0x3041, 0, 0, 0, + 0, 0, 0, 0,0x6A5F, 0,0x3A5B,0x4E76, +0x6A61,0x6A62,0x4175, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4E22, 0, 0, 0, + 0,0x6A63,0x4D35, 0, 0,0x6A64,0x6A65, 0, + 0,0x4A64,0x6A66, 0,0x3A40, 0,0x4E23, 0, + 0, 0, 0, 0, 0,0x6A6B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6A6C, +0x3E58,0x6A6A, 0, 0, 0,0x4D67,0x6A67, 0, + 0,0x6A69,0x403D,0x3F7E, 0, 0, 0,0x6A68, + 0,0x6A6D, 0, 0,0x4A23, 0, 0,0x6A6F, + 0,0x6A6E, 0, 0, 0,0x336C, 0,0x4B2B, +0x6A70, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6A7C,0x6A72, 0, 0, 0, 0, + 0, 0,0x6A73, 0, 0, 0, 0,0x6A74, +0x6A75, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6A79, 0,0x6A7A, 0, 0, +0x6A78, 0, 0, 0, 0, 0,0x6A76, 0, +0x6A71,0x6A77, 0, 0, 0, 0, 0, 0, + 0,0x6A7B,0x7037, 0, 0, 0, 0, 0, + 0, 0, 0,0x3228, 0, 0, 0, 0, + 0, 0, 0,0x6A7E,0x365F,0x6A7D, 0, 0, + 0,0x6B22, 0,0x6B21, 0, 0, 0,0x6B24, + 0, 0,0x6B23, 0,0x6B25, 0, 0,0x3D31, + 0,0x6B26, 0, 0,0x6B27, 0, 0, 0, + 0, 0, 0,0x6B28,0x403E, 0,0x4D57, 0, +0x6B29, 0, 0,0x4A24,0x4746,0x6B2A, 0,0x6B2B, +0x382B, 0, 0, 0,0x352C, 0, 0, 0, +0x6B2C, 0, 0,0x3B6B,0x4741,0x6B2D, 0,0x3350, + 0, 0, 0, 0, 0, 0,0x6B2E, 0, + 0, 0, 0,0x6B30,0x4D77, 0,0x6B2F,0x3F46, + 0,0x6B31, 0, 0,0x6B32, 0, 0,0x6B33, +0x3451, 0, 0, 0, 0, 0, 0,0x6B34, + 0, 0,0x6B35, 0,0x6B36,0x6B37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3351, + 0, 0, 0, 0, 0, 0, 0,0x6B38, + 0,0x6B39,0x6B3A, 0, 0, 0, 0, 0, +0x3272, 0, 0,0x3F28,0x6B3B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B3C, 0, 0, 0,0x6B3D, 0, 0, + 0, 0, 0, 0, 0,0x3840, 0,0x447B, +0x6B3E, 0, 0, 0, 0,0x3757, 0,0x3F56, + 0,0x6B41, 0,0x4624, 0,0x6B40, 0, 0, +0x3731, 0, 0,0x6B3F,0x4277,0x352D, 0, 0, +0x6B42, 0,0x6B43, 0,0x3E59, 0, 0, 0, +0x376D, 0,0x6B44, 0, 0, 0, 0,0x4B2C, + 0, 0,0x405F, 0, 0, 0,0x3576, 0, +0x4C75,0x414A, 0,0x6B45, 0, 0, 0,0x3F47, +0x4370,0x3E5A, 0, 0, 0, 0,0x6B46, 0, + 0, 0, 0,0x6B49, 0,0x6B4A, 0, 0, + 0, 0, 0, 0, 0,0x3A3E,0x4242,0x6B48, + 0,0x3E5B,0x493E, 0, 0, 0, 0, 0, +0x6B47, 0, 0,0x3B6C, 0,0x3153, 0,0x6B4E, +0x3758, 0, 0,0x3B6E, 0, 0,0x3B6D, 0, +0x4F4D,0x6B4D,0x6B4C,0x4127, 0,0x354D,0x4F43,0x333A, +0x3E5C, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B4B, 0, 0, 0, 0, 0,0x6B50, + 0,0x6B51,0x6B4F, 0,0x3858, 0,0x4D40, 0, + 0,0x3B6F,0x4727, 0, 0, 0,0x6B54, 0, +0x4040, 0,0x4342, 0, 0,0x4D36, 0,0x6B57, + 0, 0, 0,0x386C, 0,0x403F,0x6B53, 0, +0x6B58,0x386D,0x6B55,0x6B56, 0,0x6B52, 0, 0, + 0,0x4062,0x4649, 0, 0,0x432F, 0,0x325D, + 0, 0, 0, 0, 0, 0,0x4870, 0, + 0,0x3543, 0, 0,0x4434, 0, 0,0x6B5B, + 0,0x6B59, 0, 0,0x434C, 0, 0, 0, +0x4041,0x3452,0x6B5A, 0,0x3F5B, 0, 0,0x4E4A, + 0, 0, 0,0x4F40, 0, 0, 0,0x6B5C, +0x6B67,0x4435, 0,0x6B66, 0,0x6B63,0x6B6B,0x6B64, + 0,0x6B60, 0,0x447C,0x6B5F, 0, 0, 0, +0x6B5D, 0,0x4D21,0x3B70, 0, 0,0x6B61, 0, +0x6B5E, 0, 0, 0,0x6B65,0x3D74, 0,0x3841, + 0, 0, 0,0x427A, 0,0x4B45,0x315A,0x3062, + 0,0x4625, 0, 0,0x6B69, 0, 0, 0, + 0,0x6B68, 0,0x4666, 0,0x6B6D, 0, 0, + 0,0x6B62, 0,0x6B6C,0x6B6E, 0,0x382C,0x6B6A, +0x3956, 0,0x3C55, 0, 0,0x6B6F,0x4D58, 0, + 0, 0, 0,0x6B72, 0,0x6B75, 0, 0, +0x6B73,0x4935, 0, 0, 0, 0, 0, 0, +0x6B70, 0, 0, 0, 0, 0,0x3660, 0, + 0, 0, 0,0x6B74, 0, 0,0x6B76, 0, + 0, 0, 0, 0, 0, 0,0x6B7A, 0, + 0,0x6B77, 0,0x6B79,0x6B78, 0, 0, 0, + 0, 0, 0,0x6B7B, 0,0x3C31, 0,0x6B7D, +0x6B7C,0x4968, 0, 0,0x6C21, 0, 0, 0, + 0, 0, 0,0x3759, 0, 0, 0, 0, +0x6B7E,0x6C22, 0, 0,0x6C23,0x3544,0x6641,0x3E79, + 0,0x6C24, 0, 0,0x386E, 0, 0, 0, + 0, 0,0x6C25, 0, 0,0x6C26, 0, 0, +0x3B3E, 0, 0, 0, 0, 0, 0,0x5A4E, + 0,0x6C27, 0,0x6C28, 0,0x3D32, 0,0x6C29, +0x6C2A, 0, 0,0x6C2B, 0, 0,0x6C2C,0x6C2D +}; + +/* page 36 0x8C37-0x8D16 */ +static uint16 tab_uni_jisx020836[]={ +0x432B, 0, 0,0x6C2E, 0, 0, 0, 0, +0x6C30, 0,0x6C2F, 0, 0, 0, 0,0x4626, + 0,0x6C31, 0,0x4B2D, 0,0x6C32, 0,0x6C33, + 0,0x6C34, 0, 0, 0, 0,0x6C35, 0, + 0, 0, 0,0x465A, 0, 0, 0, 0, + 0, 0,0x3E5D,0x6C36, 0, 0, 0, 0, + 0, 0, 0,0x396B,0x502E,0x6C37, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C38,0x493F,0x6C39, 0,0x6C41, 0, 0, + 0, 0, 0,0x6C3A, 0, 0,0x6C3C, 0, + 0, 0,0x6C3B,0x6C3D, 0,0x4B46,0x6C3E,0x6C3F, + 0, 0, 0, 0, 0,0x6C40, 0, 0, + 0,0x6C42, 0, 0, 0, 0,0x332D,0x4467, + 0,0x4969,0x3A62,0x3957, 0, 0, 0, 0, +0x494F,0x325F,0x484E,0x6C45,0x3453,0x4055,0x6C44,0x6C49, +0x4379,0x4C63, 0,0x6C47,0x6C48,0x352E, 0,0x6C4A, +0x4763,0x425F, 0, 0,0x4871,0x453D,0x6C46, 0, +0x4B47,0x326C,0x6C4C,0x4F28,0x4442,0x4F45, 0, 0, +0x3B71,0x6C4B, 0,0x4231, 0, 0,0x6C5C,0x4128, + 0, 0,0x4678, 0,0x4950, 0, 0, 0, + 0, 0, 0,0x6C4F,0x3B3F,0x3B72, 0,0x3E5E, + 0,0x4765, 0,0x382D,0x6C4E,0x6C4D, 0,0x496A, + 0, 0, 0,0x3C41, 0, 0,0x4552, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C51,0x6C52,0x3958,0x6C50, 0, + 0, 0, 0, 0, 0,0x6C53,0x6C54, 0, +0x6C56,0x4223, 0,0x6C55,0x3466, 0,0x6C58, 0, +0x6C57,0x6C59, 0, 0,0x6C5B,0x6C5D, 0,0x6C5E +}; + +/* page 37 0x8D64-0x8F64 */ +static uint16 tab_uni_jisx020837[]={ +0x4056, 0,0x3C4F,0x6C5F, 0, 0, 0,0x3352, + 0,0x6C60, 0, 0,0x4176,0x6C61, 0,0x6C62, +0x496B, 0, 0,0x352F, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C63, 0, 0, + 0,0x4436, 0, 0, 0, 0,0x315B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C64, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C71, + 0, 0, 0, 0,0x3F76, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x422D, + 0, 0, 0, 0, 0, 0,0x6C67, 0, + 0, 0,0x6C66, 0, 0, 0,0x6C65, 0, + 0, 0, 0, 0, 0, 0, 0,0x6C6D, +0x6C6B, 0, 0,0x6C68, 0, 0, 0, 0, + 0, 0,0x6C6A, 0, 0, 0,0x6C69,0x6C6C, + 0,0x3577, 0,0x6C70, 0,0x4057, 0,0x6C71, + 0, 0, 0, 0,0x3859, 0,0x6C6E,0x6C6F, + 0, 0, 0,0x4F29, 0, 0, 0,0x4437, + 0,0x4129, 0, 0, 0, 0, 0, 0, +0x6C72, 0, 0,0x6C75, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C73,0x6C74,0x4D59, 0, + 0, 0, 0,0x4627,0x6C78, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6C76,0x6C77,0x6C79, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D29, 0, + 0, 0, 0, 0,0x6C7C, 0, 0, 0, +0x6C7D,0x6C7B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6C7A, 0, +0x447D, 0, 0,0x6D21,0x6D25,0x6D22,0x6C7E, 0, +0x6D23, 0, 0, 0,0x6D24, 0, 0, 0, + 0,0x6D2B, 0, 0, 0,0x6D26, 0, 0, + 0, 0, 0,0x4058,0x6D28, 0, 0,0x6D2A, +0x6D27, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D2D, 0, +0x3D33, 0,0x6D2C, 0, 0, 0, 0, 0, +0x6D2E, 0, 0, 0, 0,0x6D2F, 0, 0, +0x6D32,0x6D31, 0,0x6D30, 0, 0,0x6D34,0x6D33, + 0,0x4C76, 0, 0, 0,0x6D36, 0,0x6D35, +0x6D37, 0, 0, 0, 0,0x6D38, 0, 0, + 0, 0, 0, 0, 0,0x6D3A, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D39,0x3F48, +0x6D3B, 0, 0,0x366D,0x6D3C,0x6D3E, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6D3F, 0, 0, 0, 0, 0, + 0,0x6D40,0x6D3D, 0,0x6D41, 0,0x3C56,0x6D42, +0x3530,0x3733, 0, 0, 0, 0,0x382E, 0, + 0, 0, 0, 0, 0, 0, 0,0x6D43, + 0, 0, 0,0x4670, 0, 0,0x453E,0x6D44, + 0, 0, 0, 0, 0, 0, 0,0x6D47, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3C34, 0, 0,0x6D46, +0x6D45,0x375A,0x6D48, 0, 0, 0, 0,0x3353, + 0,0x6D4A, 0, 0, 0,0x3A5C,0x6D49, 0, +0x6D52, 0, 0, 0, 0, 0,0x6D4C,0x6D4E, +0x4A65,0x6D4B, 0, 0, 0,0x6D4D, 0,0x6D51, +0x6D4F,0x3531, 0,0x6D50, 0, 0, 0, 0, + 0, 0,0x6D53, 0, 0,0x475A,0x4E58, 0, + 0, 0, 0,0x3D34, 0, 0, 0,0x6D54, + 0, 0, 0, 0,0x4D22,0x6D56, 0,0x6D55, + 0, 0,0x6D59,0x4D41, 0, 0,0x6D58, 0, +0x336D,0x6D57,0x6D5C, 0, 0,0x6D5B, 0, 0, +0x6D5A,0x4532,0x6D5D, 0, 0, 0, 0, 0, + 0, 0, 0,0x6D5E, 0, 0, 0, 0, +0x6D5F, 0, 0,0x396C, 0,0x3725,0x6D60,0x6D61, +0x6D62}; + +/* page 38 0x8F9B-0x9132 */ +static uint16 tab_uni_jisx020838[]={ +0x3F49,0x6D63, 0,0x3C2D,0x6D64, 0, 0, 0, +0x6D65, 0, 0, 0,0x5221,0x517E, 0, 0, + 0, 0,0x6D66,0x6570,0x6D67,0x4324,0x3F2B,0x4740, + 0, 0, 0, 0,0x6D68, 0, 0,0x4A55, +0x4454,0x397E, 0, 0,0x4329, 0, 0,0x312A, + 0,0x4B78,0x3F57, 0, 0, 0, 0, 0, + 0, 0, 0,0x375E, 0, 0,0x3661, 0, + 0,0x4A56, 0, 0, 0, 0, 0,0x6D69, + 0, 0, 0, 0, 0, 0, 0,0x6D6B, + 0, 0,0x6D6A,0x3260, 0, 0,0x4676,0x6D6C, +0x4777, 0,0x4533, 0,0x6D6D,0x3D52, 0, 0, + 0,0x6D6F, 0, 0,0x4C42,0x6D7E,0x6D71,0x6D72, + 0, 0,0x4449, 0, 0,0x4260,0x4177, 0, +0x4628, 0,0x6D70,0x3555, 0, 0, 0, 0, +0x6D79, 0,0x6D76,0x6E25,0x4629,0x4360,0x6D73, 0, +0x447E,0x4553,0x6D74,0x6D78,0x3F60, 0,0x4767,0x444C, + 0, 0,0x4042,0x6D77,0x422E,0x4224,0x6D75,0x3029, +0x4F22, 0, 0, 0,0x6D7A, 0, 0, 0, + 0, 0, 0,0x4261, 0, 0,0x3D35,0x3F4A, + 0, 0,0x6D7C,0x6D7B, 0,0x306F,0x6D7D, 0, + 0,0x492F, 0,0x6E27, 0, 0,0x465B,0x3F6B, + 0, 0,0x4359, 0,0x3678, 0,0x6E26,0x4D37, +0x313F, 0,0x4A57,0x3261,0x6E21,0x6E22,0x6E23,0x6E24, +0x463B,0x4323,0x3063,0x6E28, 0,0x6E29,0x7423, 0, + 0,0x423D, 0,0x6E2A, 0,0x3173,0x414C, 0, +0x382F, 0,0x4D5A, 0, 0,0x6E2B,0x452C, 0, + 0, 0,0x4178,0x3C57,0x6E2C, 0, 0,0x6E2F, + 0, 0,0x3D65,0x6E2D,0x412B,0x412A, 0,0x3064, + 0,0x4E4B,0x6E31, 0,0x4872,0x6E33,0x6E32,0x6E30, +0x6364,0x3454, 0, 0,0x6D6E, 0,0x6E35,0x6E34, + 0, 0, 0, 0,0x6E36, 0,0x4D38, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4661, 0, 0,0x4B2E, 0,0x6E37, 0,0x3C59, + 0, 0, 0, 0,0x6E38, 0,0x6E39, 0, + 0, 0,0x6E3A, 0, 0,0x4521, 0, 0, + 0, 0, 0, 0, 0, 0,0x306A, 0, + 0, 0, 0, 0, 0, 0, 0,0x3959, + 0, 0, 0,0x4F3A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E3E, 0, 0, 0, 0, 0,0x3734,0x6E3B, + 0,0x6E3C, 0, 0, 0,0x4974, 0, 0, + 0, 0,0x3354, 0, 0, 0, 0, 0, + 0, 0,0x4D39, 0,0x363F, 0, 0, 0, + 0, 0,0x4554, 0, 0, 0, 0,0x6E3F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x6E40, + 0, 0, 0, 0, 0, 0,0x6E41, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4522, 0, 0,0x6E43, 0,0x6E42 +}; + +/* page 39 0x9149-0x92B9 */ +static uint16 tab_uni_jisx020839[]={ +0x4653,0x6E44,0x3D36,0x3C60,0x475B,0x4371, 0, 0, + 0,0x3C72, 0,0x3F6C, 0,0x6E45, 0,0x6E46, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3F5D,0x6E47, 0,0x6E48, 0, 0, 0, +0x6E49,0x4D6F, 0,0x3D37, 0, 0, 0, 0, + 0,0x6E4B,0x6E4A, 0,0x395A, 0,0x3973,0x3B40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6E4E, 0, 0, 0, 0,0x3D66, 0, +0x6E4D, 0,0x6E4C, 0,0x4269, 0, 0,0x386F, + 0,0x4043, 0, 0, 0, 0,0x4830, 0, + 0, 0, 0,0x3D39, 0, 0, 0, 0, + 0,0x6E4F, 0,0x3E5F, 0, 0, 0, 0, + 0,0x6E52,0x6E50, 0, 0, 0,0x6E51, 0, + 0, 0, 0,0x6E54,0x6E53, 0, 0,0x3E7A, + 0,0x6E55, 0, 0, 0, 0, 0,0x6E56, +0x6E57, 0, 0, 0, 0,0x4850,0x3A53,0x3C61, +0x6E58, 0,0x6E59,0x4E24,0x3D45,0x4C6E,0x4E4C,0x6E5A, +0x3662, 0, 0, 0, 0,0x6E5B, 0,0x4523, + 0, 0,0x6E5E,0x3378,0x3F4B, 0,0x6E5C, 0, +0x6E5D, 0,0x4460, 0, 0,0x4B55,0x367C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6E60,0x6E61, 0, 0, + 0, 0, 0,0x6E5F, 0, 0,0x6E63, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x465F,0x3343, 0, 0, +0x6E67, 0, 0,0x6E64,0x6E66, 0, 0, 0, + 0, 0, 0, 0, 0,0x6E62, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6F4F, 0, 0,0x6E65, 0, 0, 0, 0, + 0, 0, 0,0x4E6B, 0, 0,0x385A, 0, + 0, 0, 0, 0, 0, 0,0x6E6F, 0, + 0, 0, 0,0x4534,0x6E6A, 0, 0,0x6E6D, +0x6E6B, 0,0x6E70, 0, 0, 0, 0,0x6E71, + 0, 0, 0, 0, 0, 0,0x6E69, 0, + 0,0x6E76,0x3174, 0, 0,0x6E68, 0, 0, + 0,0x482D, 0,0x6E6C, 0,0x3E60, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x395B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4B48, 0,0x3664, + 0, 0,0x3D46, 0,0x463C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x412D, 0,0x6E74, 0,0x6E6E,0x6E73, 0,0x4C43, + 0,0x4438,0x6E75,0x6E72, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x412C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6E79, 0, +0x6E78}; + +/* page 40 0x92CF-0x93E8 */ +static uint16 tab_uni_jisx020840[]={ +0x6E77, 0, 0,0x4B2F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3D7B, 0, 0, + 0, 0,0x6E7A,0x4A5F, 0, 0,0x3154, 0, + 0, 0, 0,0x4946,0x4372, 0, 0, 0, + 0,0x3578, 0,0x6E7C, 0,0x395D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3B2C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6E7B,0x3F6D, 0, 0, 0, 0, 0, 0, + 0,0x3F6E,0x6F21,0x6F23, 0, 0, 0, 0, + 0,0x3E7B, 0,0x6F22,0x6F24, 0, 0,0x3653, + 0,0x4945, 0, 0,0x3C62,0x4F23, 0,0x6E7E, +0x3A78, 0, 0,0x4F3F, 0, 0,0x6F26, 0, + 0, 0, 0,0x6F25,0x6F27, 0, 0, 0, + 0, 0, 0, 0, 0,0x6E7D, 0, 0, + 0, 0, 0, 0,0x4669, 0,0x4555, 0, + 0, 0, 0, 0, 0,0x4457, 0,0x6F2C, + 0, 0, 0, 0,0x4343,0x6F28, 0, 0, + 0,0x6F29, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x372D, 0,0x6F2B, + 0, 0, 0, 0, 0, 0,0x3830, 0, + 0, 0, 0, 0, 0,0x6F2A, 0,0x3E61, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3379, 0, 0, + 0, 0, 0, 0, 0,0x6F30, 0,0x3A3F, +0x4179, 0, 0,0x444A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x333B, 0, 0, 0, 0,0x6F2E,0x6F2F,0x4443, + 0,0x6F2D, 0, 0, 0, 0, 0, 0, + 0, 0,0x6F31, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6F37, 0, 0, 0, + 0,0x6F3A, 0, 0, 0, 0, 0, 0, + 0,0x6F39,0x452D, 0, 0, 0, 0,0x6F32, +0x6F33,0x6F36, 0, 0, 0, 0,0x6F38, 0, + 0, 0,0x3640, 0, 0,0x6F3B,0x6F35, 0, + 0,0x6F34}; + +/* page 41 0x9403-0x9481 */ +static uint16 tab_uni_jisx020841[]={ +0x6F3F, 0, 0, 0,0x6F40, 0, 0, 0, + 0, 0, 0, 0, 0,0x6F41, 0, 0, +0x6F3E,0x6F3D, 0, 0, 0,0x3E62,0x462A,0x6F3C, + 0, 0, 0, 0, 0, 0,0x6F45, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6F43, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6F44,0x6F42, 0,0x4278, 0,0x6F46, + 0, 0, 0, 0, 0, 0,0x6F47, 0, + 0,0x6F49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3455,0x6F48, +0x4C7A, 0, 0, 0, 0, 0, 0,0x6F54, +0x6F4A, 0, 0,0x6F4D, 0,0x6F4B, 0,0x6F4C, + 0, 0, 0, 0, 0, 0, 0,0x6F4E, + 0, 0, 0, 0, 0,0x6F50, 0, 0, + 0, 0,0x6F51, 0,0x6F52, 0, 0, 0, + 0,0x6F55,0x6F53,0x6F56,0x6F58, 0,0x6F57}; + +/* page 42 0x9577-0x95E5 */ +static uint16 tab_uni_jisx020842[]={ +0x4439, 0, 0, 0, 0, 0, 0, 0, + 0,0x4C67, 0,0x6F59,0x412E, 0, 0, 0, +0x6F5A, 0,0x4A44,0x6F5B,0x332B, 0, 0, 0, +0x313C, 0,0x3457, 0,0x3456,0x6F5C, 0,0x6F5D, + 0,0x6F5E,0x6F5F, 0, 0, 0, 0, 0, + 0,0x6F60, 0,0x3458,0x3355,0x395E,0x4836, 0, +0x6F62,0x6F61, 0, 0, 0, 0,0x6F63, 0, + 0, 0, 0,0x315C, 0, 0, 0, 0, + 0, 0,0x6F66, 0,0x6F65,0x6F64, 0,0x6F67, + 0, 0, 0, 0,0x6F6A, 0, 0, 0, +0x3047, 0, 0,0x6F68, 0,0x6F6C,0x6F6B, 0, + 0, 0, 0, 0, 0,0x6F6E,0x6F6D,0x6F6F, + 0,0x462E, 0, 0, 0,0x6F70, 0, 0, + 0, 0,0x6F71,0x6F73, 0, 0,0x6F72}; + +/* page 43 0x961C-0x9874 */ +static uint16 tab_uni_jisx020843[]={ +0x496C, 0, 0, 0, 0,0x6F74, 0, 0, + 0, 0, 0, 0,0x6F75, 0,0x3A65, 0, + 0, 0,0x6F76,0x6F77, 0, 0,0x4B49, 0, + 0, 0, 0, 0, 0, 0, 0,0x414B, + 0, 0, 0,0x3024,0x424B, 0,0x6F78, 0, +0x496D, 0, 0, 0, 0, 0, 0,0x6F7B, +0x6F79,0x395F, 0,0x6F7A,0x3842, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4A45, +0x6F7D,0x7021,0x6F7E,0x7022, 0, 0,0x3121,0x3F58, +0x3D7C,0x3459,0x7023, 0, 0, 0,0x4766, 0, +0x7025, 0, 0, 0,0x3122, 0,0x7024,0x4444, + 0,0x4E4D,0x462B,0x6F7C,0x4E26, 0,0x3831, 0, + 0,0x4D5B, 0, 0, 0, 0, 0, 0, + 0,0x3679,0x4E34, 0,0x3728, 0,0x4262,0x6721, + 0,0x7026,0x332C,0x3F6F, 0, 0, 0, 0, +0x3356,0x7028, 0,0x7029,0x7027,0x3764, 0,0x3A5D, +0x3E63, 0, 0, 0,0x3123, 0, 0,0x4E59, + 0, 0, 0,0x702B,0x6E2E, 0,0x702A, 0, + 0, 0, 0, 0,0x702E,0x702C,0x702D, 0, +0x702F, 0,0x7030,0x4E6C,0x7031,0x7032, 0,0x4049, +0x483B, 0, 0, 0,0x3F7D,0x3467, 0, 0, +0x4D3A,0x326D,0x3D38,0x385B, 0,0x7035, 0,0x7034, +0x3B73,0x7036,0x7033, 0, 0,0x3B28, 0, 0, + 0,0x703A,0x6A2D, 0, 0,0x5256, 0,0x3F77, +0x7038, 0, 0, 0, 0, 0,0x4E25,0x4671, + 0, 0, 0, 0,0x312B, 0,0x4063,0x3C36, + 0, 0, 0, 0,0x4A37, 0,0x3140, 0, + 0, 0,0x4E6D,0x4D6B, 0,0x703B, 0,0x4545, + 0, 0, 0, 0,0x3C7B, 0, 0, 0, +0x703C, 0,0x703D,0x3F4C,0x703E, 0,0x4E6E, 0, + 0,0x7039,0x7040,0x7042, 0,0x7041, 0,0x703F, + 0, 0,0x7043, 0, 0,0x7044, 0, 0, +0x417A, 0,0x3262, 0, 0, 0, 0, 0, +0x7045, 0, 0,0x4C38, 0, 0,0x7046, 0, + 0, 0, 0, 0,0x7047, 0,0x4F2A, 0, + 0, 0, 0, 0,0x5B31,0x7048, 0, 0, + 0,0x7049,0x704A, 0, 0, 0,0x704E, 0, +0x704B, 0,0x704C, 0,0x704D,0x704F, 0, 0, + 0, 0, 0, 0, 0, 0,0x4044, 0, + 0, 0,0x4C77, 0, 0,0x4045, 0, 0, +0x7050, 0,0x4873, 0,0x7051,0x7353,0x4C4C, 0, +0x7052, 0,0x7053, 0,0x7054,0x3357, 0,0x7056, + 0,0x3F59, 0, 0, 0,0x7057, 0, 0, +0x3724, 0, 0, 0, 0,0x7058,0x705C, 0, +0x705A, 0, 0, 0, 0,0x705B, 0, 0, +0x3373,0x7059,0x705D, 0, 0, 0, 0,0x705E, + 0,0x3048, 0,0x705F,0x7060, 0, 0, 0, + 0, 0, 0, 0,0x3E64, 0, 0, 0, +0x7061, 0, 0, 0,0x3547, 0, 0,0x7064, + 0, 0,0x7063, 0,0x7062, 0, 0,0x6B71, + 0,0x4A5C, 0, 0, 0, 0, 0,0x7065, +0x7066, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7067, + 0, 0,0x7068, 0,0x7069, 0, 0,0x706A, + 0, 0, 0, 0, 0, 0, 0,0x345A, + 0, 0, 0, 0, 0, 0, 0, 0, +0x706B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x706C,0x4723, 0, 0, 0,0x706E,0x323B, + 0,0x7071,0x7070, 0, 0, 0, 0,0x3124, + 0, 0, 0,0x3641, 0,0x4A47,0x443A,0x3A22, + 0,0x3960,0x3D67, 0,0x3F5C, 0, 0, 0, +0x7073, 0, 0,0x7072,0x4D42,0x3468,0x4852,0x465C, + 0, 0, 0,0x3F7C,0x4E4E, 0,0x375B, 0, + 0, 0, 0, 0, 0,0x7076, 0, 0, +0x7075, 0, 0, 0, 0, 0, 0, 0, +0x4B4B,0x462C, 0, 0, 0, 0, 0, 0, +0x3150, 0, 0,0x7077,0x7074, 0, 0,0x4951, +0x4D6A,0x7078, 0, 0, 0, 0, 0, 0, + 0, 0,0x7079, 0, 0, 0, 0,0x707B, +0x426A,0x335B,0x335C,0x707A, 0, 0, 0, 0, +0x3469,0x3832, 0, 0,0x346A, 0, 0,0x453F, + 0, 0,0x4E60, 0, 0, 0, 0, 0, + 0, 0, 0,0x385C, 0, 0, 0,0x707C, + 0, 0, 0,0x707D,0x707E,0x7121, 0,0x7123, +0x7122}; + +/* page 44 0x98A8-0x98C6 */ +static uint16 tab_uni_jisx020844[]={ +0x4977, 0,0x7124, 0, 0, 0, 0,0x7125, + 0,0x7126, 0, 0, 0, 0,0x7127, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x7129,0x7128, 0,0x712A}; + +/* page 45 0x98DB-0x9957 */ +static uint16 tab_uni_jisx020845[]={ +0x4874,0x664C, 0, 0,0x3F29, 0, 0,0x3532, + 0, 0, 0, 0, 0, 0,0x712B, 0, +0x712C, 0,0x522C,0x5D3B,0x4853, 0, 0,0x307B, + 0,0x303B, 0, 0, 0, 0, 0, 0, + 0,0x3B74,0x4B30,0x3E7E, 0, 0, 0, 0, +0x712D, 0,0x4C5F, 0, 0, 0,0x712E,0x4D5C, + 0,0x3142, 0, 0, 0,0x3B41, 0,0x712F, +0x326E,0x7130, 0, 0, 0,0x7131, 0, 0, + 0, 0,0x7133,0x7134, 0,0x7136,0x7132, 0, + 0,0x7135, 0, 0, 0,0x345B, 0, 0, + 0,0x7137, 0,0x7138, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7139,0x713A, 0, 0, 0,0x713B, + 0, 0,0x713D, 0, 0, 0,0x713C, 0, +0x713F,0x7142, 0, 0, 0,0x713E,0x7140,0x7141, + 0, 0,0x7143, 0,0x3642}; + +/* page 46 0x9996-0x9A6B */ +static uint16 tab_uni_jisx020846[]={ +0x3C73,0x7144,0x7145,0x3961, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7146, + 0, 0,0x333E, 0, 0, 0,0x474F,0x7147, +0x7148, 0, 0, 0, 0,0x435A,0x466B, 0, + 0, 0, 0, 0, 0, 0,0x7149, 0, + 0, 0, 0,0x477D, 0, 0,0x424C,0x3158, +0x366E, 0,0x366F, 0, 0, 0, 0, 0, + 0, 0,0x4373,0x714E,0x3670, 0, 0,0x326F, + 0, 0,0x714D, 0, 0,0x714B, 0,0x714C, + 0,0x714A, 0, 0,0x7158, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x714F, +0x7150, 0, 0,0x7151,0x7152, 0, 0, 0, + 0, 0,0x7154, 0, 0,0x7153, 0, 0, + 0,0x3D59, 0,0x7155, 0, 0, 0,0x7157, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3533,0x7156, 0, 0,0x417B,0x3833, 0, 0, + 0, 0, 0,0x7159, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x424D, 0, 0,0x715A, 0, 0, + 0, 0,0x462D, 0, 0, 0, 0, 0, + 0,0x715B, 0, 0, 0, 0, 0, 0, +0x7160, 0,0x715E, 0,0x715D,0x715F, 0,0x715C, + 0, 0, 0, 0, 0, 0, 0,0x7162, + 0, 0, 0, 0, 0, 0, 0,0x7161, + 0,0x7164, 0, 0,0x3643,0x7163, 0, 0, + 0,0x7165, 0, 0,0x7166, 0,0x7168,0x7167, + 0, 0, 0,0x7169,0x716B,0x716A}; + +/* page 47 0x9AA8-0x9B5A */ +static uint16 tab_uni_jisx020847[]={ +0x397C, 0, 0, 0, 0,0x716C, 0, 0, +0x716D, 0, 0, 0, 0, 0, 0, 0, +0x333C, 0, 0, 0,0x716E, 0, 0, 0, +0x716F, 0, 0, 0,0x3F71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7170, + 0,0x7171, 0,0x7172,0x7173, 0, 0, 0, +0x3962, 0, 0, 0, 0, 0,0x7174,0x7175, + 0, 0,0x7176,0x7177, 0, 0,0x7178, 0, + 0, 0,0x4831,0x717A, 0,0x4926,0x717B,0x7179, + 0,0x717D, 0, 0,0x717C, 0, 0,0x717E, + 0, 0, 0,0x7221, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7222, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x7223, 0,0x7224, 0, 0, 0, 0,0x7225, + 0, 0,0x7226,0x7227, 0,0x7228, 0,0x7229, +0x722A,0x722B,0x722C, 0, 0, 0,0x722D,0x722E, + 0,0x5D35,0x722F, 0, 0, 0, 0, 0, + 0, 0, 0,0x6478,0x3534, 0, 0, 0, + 0,0x3321,0x3A32,0x7231,0x7230,0x4C25, 0, 0, + 0, 0, 0, 0, 0,0x7233,0x7234,0x7232, + 0,0x7235, 0, 0,0x4B62, 0, 0, 0, +0x7236, 0,0x357B}; + +/* page 48 0x9B6F-0x9C78 */ +static uint16 tab_uni_jisx020848[]={ +0x4F25, 0, 0, 0, 0,0x7237, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x7239, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x303E, + 0, 0,0x723A,0x4A2B,0x7238, 0, 0,0x723B, +0x723C, 0, 0, 0, 0, 0, 0, 0, +0x723D,0x723E, 0, 0, 0, 0, 0, 0, + 0,0x723F, 0,0x4B6E,0x3B2D, 0,0x3A7A,0x412F, + 0, 0, 0, 0, 0,0x7240, 0, 0, + 0, 0,0x7243, 0, 0, 0, 0, 0, + 0,0x7241, 0, 0, 0, 0, 0,0x7244, + 0, 0,0x3871,0x7242, 0, 0, 0, 0, +0x7245, 0,0x7246,0x7247, 0,0x724B, 0,0x3B2A, + 0, 0, 0, 0,0x4264, 0, 0, 0, + 0, 0,0x724C,0x7249,0x7248,0x724A, 0, 0, + 0,0x375F, 0, 0, 0, 0, 0, 0, + 0,0x7250,0x724F,0x724E, 0, 0,0x3033, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x725A, 0,0x7256, + 0,0x7257,0x7253,0x7259, 0,0x7255,0x3362, 0, + 0,0x4F4C, 0,0x7258,0x7254,0x7252,0x7251, 0, + 0, 0, 0, 0,0x725C, 0, 0, 0, + 0, 0,0x725F, 0, 0,0x725E,0x725D, 0, + 0, 0, 0, 0, 0, 0,0x4949,0x725B, +0x3073,0x7260, 0,0x7262, 0, 0, 0, 0, + 0, 0,0x336F,0x724D,0x3137, 0, 0,0x7264, + 0, 0, 0, 0, 0, 0, 0,0x7263, +0x7261,0x432D, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4B70, 0, 0, 0, 0, +0x4E5A, 0, 0,0x7265, 0, 0, 0, 0, + 0,0x7266, 0, 0, 0, 0, 0, 0, +0x7267, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x7268, + 0,0x7269}; + +/* page 49 0x9CE5-0x9DFD */ +static uint16 tab_uni_jisx020849[]={ +0x443B, 0,0x726A, 0,0x4837, 0,0x726F,0x726B, + 0, 0, 0,0x726C, 0, 0,0x4B31,0x4C44, + 0,0x4650, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x7270, 0, + 0,0x7271,0x463E,0x726E,0x726D, 0, 0, 0, + 0,0x322A, 0, 0, 0,0x7279, 0, 0, +0x7278, 0, 0, 0, 0, 0,0x3175, 0, + 0, 0,0x7276, 0, 0, 0,0x7275, 0, + 0,0x7273, 0,0x337B, 0,0x7272,0x3C32,0x3229, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3963, 0, + 0,0x727C,0x727B, 0,0x727A, 0, 0,0x7277, + 0,0x727D, 0,0x727E, 0, 0, 0, 0, + 0, 0, 0,0x7325,0x7324, 0, 0, 0, + 0, 0, 0, 0,0x7326, 0, 0,0x312D, +0x7321,0x7322, 0,0x3974,0x4C39, 0, 0,0x7323, + 0, 0, 0, 0, 0, 0, 0,0x4B32, + 0, 0,0x732B, 0, 0,0x7327, 0, 0, + 0, 0, 0, 0, 0,0x732C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7329, 0,0x7328, 0, 0, 0, + 0, 0,0x375C, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x732D, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x732E, + 0, 0, 0, 0,0x732F, 0,0x732A, 0, + 0, 0,0x7274, 0, 0,0x7330, 0,0x4461, + 0, 0, 0,0x7334, 0,0x7335,0x7333, 0, + 0, 0, 0, 0,0x7332,0x7338, 0,0x7331, + 0,0x7336, 0, 0, 0, 0, 0, 0, + 0, 0,0x7337, 0, 0, 0,0x733A, 0, + 0, 0, 0, 0,0x7339, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x733C, 0, 0, 0, 0, 0, 0, +0x733D, 0,0x733E, 0, 0,0x4F49, 0, 0, + 0, 0, 0,0x733B,0x426B,0x3A6D, 0, 0, +0x733F}; + +/* page 50 0x9E1A-0x9E1E */ +static uint16 tab_uni_jisx020850[]={ +0x7340,0x7341, 0, 0,0x7342}; + +/* page 51 0x9E75-0x9F77 */ +static uint16 tab_uni_jisx020851[]={ +0x7343, 0, 0,0x3834,0x7344, 0, 0, 0, +0x7345, 0,0x3C2F, 0,0x7346, 0, 0, 0, + 0, 0, 0,0x7347, 0, 0,0x7348,0x7349, + 0, 0, 0, 0,0x734C,0x734A,0x4F3C, 0, +0x734B, 0,0x4E6F, 0, 0, 0, 0, 0, +0x734D, 0,0x4E5B, 0, 0, 0, 0, 0, +0x734E,0x477E, 0, 0,0x734F,0x7351, 0, 0, +0x7352, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x7350,0x396D,0x4C4D,0x4B63,0x5677, + 0,0x5D60,0x4B7B, 0, 0, 0, 0,0x322B, + 0, 0, 0, 0, 0, 0, 0,0x7354, +0x3550,0x7355,0x7356,0x7357, 0,0x3975, 0,0x7358, + 0, 0, 0,0x6054,0x4C5B, 0,0x4263,0x7359, +0x735B,0x735A, 0,0x735C, 0, 0, 0, 0, +0x735D, 0, 0,0x735E, 0, 0, 0, 0, + 0, 0,0x735F, 0, 0, 0, 0,0x7360, + 0,0x7361,0x7362, 0,0x7363, 0,0x7364,0x7365, +0x7366, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7367,0x7368, 0, 0, 0, 0, + 0,0x4524, 0, 0, 0, 0,0x385D, 0, +0x736A, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x414D,0x736B, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x736C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4921, 0, + 0,0x736D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x736E,0x6337, 0, + 0,0x6C5A,0x706D, 0, 0,0x736F, 0,0x7370, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x7372,0x7373,0x7374,0x4E70,0x7371, 0, + 0,0x7375,0x7376, 0, 0,0x7378, 0,0x7377, + 0, 0, 0, 0, 0,0x737A, 0, 0, + 0,0x737B,0x7379}; + +/* page 52 0x9F8D-0x9FA0 */ +static uint16 tab_uni_jisx020852[]={ +0x4E36, 0, 0, 0, 0, 0, 0, 0, +0x737C, 0, 0, 0, 0, 0, 0,0x737D, +0x6354, 0, 0,0x737E}; + +/* page 53 0xFF01-0xFF5D */ +static uint16 tab_uni_jisx020853[]={ +0x212A, 0,0x2174,0x2170,0x2173,0x2175, 0,0x214A, +0x214B,0x2176,0x215C,0x2124, 0,0x2125,0x213F,0x2330, +0x2331,0x2332,0x2333,0x2334,0x2335,0x2336,0x2337,0x2338, +0x2339,0x2127,0x2128,0x2163,0x2161,0x2164,0x2129,0x2177, +0x2341,0x2342,0x2343,0x2344,0x2345,0x2346,0x2347,0x2348, +0x2349,0x234A,0x234B,0x234C,0x234D,0x234E,0x234F,0x2350, +0x2351,0x2352,0x2353,0x2354,0x2355,0x2356,0x2357,0x2358, +0x2359,0x235A,0x214E, 0,0x214F,0x2130,0x2132,0x212E, +0x2361,0x2362,0x2363,0x2364,0x2365,0x2366,0x2367,0x2368, +0x2369,0x236A,0x236B,0x236C,0x236D,0x236E,0x236F,0x2370, +0x2371,0x2372,0x2373,0x2374,0x2375,0x2376,0x2377,0x2378, +0x2379,0x237A,0x2150,0x2143,0x2151}; + +/* page 54 0xFFE3-0xFFE5 */ +static uint16 tab_uni_jisx020854[]={ +0x2131, 0,0x216F}; + +static int +my_uni_jisx0208_onechar(int code){ + if ((code>=0x005C)&&(code<=0x005C)) + return(tab_uni_jisx02080[code-0x005C]); + if ((code>=0x00A2)&&(code<=0x00B6)) + return(tab_uni_jisx02081[code-0x00A2]); + if ((code>=0x00D7)&&(code<=0x00D7)) + return(tab_uni_jisx02082[code-0x00D7]); + if ((code>=0x00F7)&&(code<=0x00F7)) + return(tab_uni_jisx02083[code-0x00F7]); + if ((code>=0x0391)&&(code<=0x03C9)) + return(tab_uni_jisx02084[code-0x0391]); + if ((code>=0x0401)&&(code<=0x0451)) + return(tab_uni_jisx02085[code-0x0401]); + if ((code>=0x2010)&&(code<=0x203B)) + return(tab_uni_jisx02086[code-0x2010]); + if ((code>=0x2103)&&(code<=0x2103)) + return(tab_uni_jisx02087[code-0x2103]); + if ((code>=0x212B)&&(code<=0x212B)) + return(tab_uni_jisx02088[code-0x212B]); + if ((code>=0x2190)&&(code<=0x2193)) + return(tab_uni_jisx02089[code-0x2190]); + if ((code>=0x21D2)&&(code<=0x21D4)) + return(tab_uni_jisx020810[code-0x21D2]); + if ((code>=0x2200)&&(code<=0x223D)) + return(tab_uni_jisx020811[code-0x2200]); + if ((code>=0x2252)&&(code<=0x226B)) + return(tab_uni_jisx020812[code-0x2252]); + if ((code>=0x2282)&&(code<=0x2287)) + return(tab_uni_jisx020813[code-0x2282]); + if ((code>=0x22A5)&&(code<=0x22A5)) + return(tab_uni_jisx020814[code-0x22A5]); + if ((code>=0x2312)&&(code<=0x2312)) + return(tab_uni_jisx020815[code-0x2312]); + if ((code>=0x2500)&&(code<=0x254B)) + return(tab_uni_jisx020816[code-0x2500]); + if ((code>=0x25A0)&&(code<=0x25CF)) + return(tab_uni_jisx020817[code-0x25A0]); + if ((code>=0x25EF)&&(code<=0x25EF)) + return(tab_uni_jisx020818[code-0x25EF]); + if ((code>=0x2605)&&(code<=0x2606)) + return(tab_uni_jisx020819[code-0x2605]); + if ((code>=0x2640)&&(code<=0x2642)) + return(tab_uni_jisx020820[code-0x2640]); + if ((code>=0x266A)&&(code<=0x266F)) + return(tab_uni_jisx020821[code-0x266A]); + if ((code>=0x3000)&&(code<=0x301C)) + return(tab_uni_jisx020822[code-0x3000]); + if ((code>=0x3041)&&(code<=0x30FE)) + return(tab_uni_jisx020823[code-0x3041]); + if ((code>=0x4E00)&&(code<=0x5516)) + return(tab_uni_jisx020824[code-0x4E00]); + if ((code>=0x552E)&&(code<=0x5563)) + return(tab_uni_jisx020825[code-0x552E]); + if ((code>=0x557B)&&(code<=0x576A)) + return(tab_uni_jisx020826[code-0x557B]); + if ((code>=0x577F)&&(code<=0x5A9B)) + return(tab_uni_jisx020827[code-0x577F]); + if ((code>=0x5ABC)&&(code<=0x5D29)) + return(tab_uni_jisx020828[code-0x5ABC]); + if ((code>=0x5D4B)&&(code<=0x6BF3)) + return(tab_uni_jisx020829[code-0x5D4B]); + if ((code>=0x6C08)&&(code<=0x6CF3)) + return(tab_uni_jisx020830[code-0x6C08]); + if ((code>=0x6D0B)&&(code<=0x7409)) + return(tab_uni_jisx020831[code-0x6D0B]); + if ((code>=0x7422)&&(code<=0x7845)) + return(tab_uni_jisx020832[code-0x7422]); + if ((code>=0x785D)&&(code<=0x7E9C)) + return(tab_uni_jisx020833[code-0x785D]); + if ((code>=0x7F36)&&(code<=0x8358)) + return(tab_uni_jisx020834[code-0x7F36]); + if ((code>=0x8373)&&(code<=0x8B9A)) + return(tab_uni_jisx020835[code-0x8373]); + if ((code>=0x8C37)&&(code<=0x8D16)) + return(tab_uni_jisx020836[code-0x8C37]); + if ((code>=0x8D64)&&(code<=0x8F64)) + return(tab_uni_jisx020837[code-0x8D64]); + if ((code>=0x8F9B)&&(code<=0x9132)) + return(tab_uni_jisx020838[code-0x8F9B]); + if ((code>=0x9149)&&(code<=0x92B9)) + return(tab_uni_jisx020839[code-0x9149]); + if ((code>=0x92CF)&&(code<=0x93E8)) + return(tab_uni_jisx020840[code-0x92CF]); + if ((code>=0x9403)&&(code<=0x9481)) + return(tab_uni_jisx020841[code-0x9403]); + if ((code>=0x9577)&&(code<=0x95E5)) + return(tab_uni_jisx020842[code-0x9577]); + if ((code>=0x961C)&&(code<=0x9874)) + return(tab_uni_jisx020843[code-0x961C]); + if ((code>=0x98A8)&&(code<=0x98C6)) + return(tab_uni_jisx020844[code-0x98A8]); + if ((code>=0x98DB)&&(code<=0x9957)) + return(tab_uni_jisx020845[code-0x98DB]); + if ((code>=0x9996)&&(code<=0x9A6B)) + return(tab_uni_jisx020846[code-0x9996]); + if ((code>=0x9AA8)&&(code<=0x9B5A)) + return(tab_uni_jisx020847[code-0x9AA8]); + if ((code>=0x9B6F)&&(code<=0x9C78)) + return(tab_uni_jisx020848[code-0x9B6F]); + if ((code>=0x9CE5)&&(code<=0x9DFD)) + return(tab_uni_jisx020849[code-0x9CE5]); + if ((code>=0x9E1A)&&(code<=0x9E1E)) + return(tab_uni_jisx020850[code-0x9E1A]); + if ((code>=0x9E75)&&(code<=0x9F77)) + return(tab_uni_jisx020851[code-0x9E75]); + if ((code>=0x9F8D)&&(code<=0x9FA0)) + return(tab_uni_jisx020852[code-0x9F8D]); + if ((code>=0xFF01)&&(code<=0xFF5D)) + return(tab_uni_jisx020853[code-0xFF01]); + if ((code>=0xFFE3)&&(code<=0xFFE5)) + return(tab_uni_jisx020854[code-0xFFE3]); + return(0); +} + + + +/* page 0 0x007E-0x007E */ +static uint16 tab_uni_jisx02120[]={ +0x2237}; + +/* page 1 0x00A1-0x017E */ +static uint16 tab_uni_jisx02121[]={ +0x2242, 0, 0,0x2270, 0,0x2243, 0, 0, +0x226D,0x226C, 0, 0, 0,0x226E,0x2234, 0, + 0, 0, 0, 0, 0, 0, 0,0x2231, + 0,0x226B, 0, 0, 0, 0,0x2244,0x2A22, +0x2A21,0x2A24,0x2A2A,0x2A23,0x2A29,0x2921,0x2A2E,0x2A32, +0x2A31,0x2A34,0x2A33,0x2A40,0x2A3F,0x2A42,0x2A41, 0, +0x2A50,0x2A52,0x2A51,0x2A54,0x2A58,0x2A53, 0,0x292C, +0x2A63,0x2A62,0x2A65,0x2A64,0x2A72,0x2930,0x294E,0x2B22, +0x2B21,0x2B24,0x2B2A,0x2B23,0x2B29,0x2941,0x2B2E,0x2B32, +0x2B31,0x2B34,0x2B33,0x2B40,0x2B3F,0x2B42,0x2B41,0x2943, +0x2B50,0x2B52,0x2B51,0x2B54,0x2B58,0x2B53, 0,0x294C, +0x2B63,0x2B62,0x2B65,0x2B64,0x2B72,0x2950,0x2B73,0x2A27, +0x2B27,0x2A25,0x2B25,0x2A28,0x2B28,0x2A2B,0x2B2B,0x2A2C, +0x2B2C,0x2A2F,0x2B2F,0x2A2D,0x2B2D,0x2A30,0x2B30,0x2922, +0x2942,0x2A37,0x2B37, 0, 0,0x2A36,0x2B36,0x2A38, +0x2B38,0x2A35,0x2B35,0x2A3A,0x2B3A,0x2A3B,0x2B3B,0x2A3D, +0x2B3D,0x2A3C, 0,0x2A3E,0x2B3E,0x2924,0x2944,0x2A47, +0x2B47,0x2A45,0x2B45, 0, 0,0x2A46,0x2B46,0x2A44, +0x2945,0x2926,0x2946,0x2A48,0x2B48,0x2A49,0x2B49,0x2947, +0x2A4A,0x2B4A,0x2A4C,0x2B4C,0x2A4B,0x2B4B,0x2929,0x2949, +0x2928,0x2948,0x2A4D,0x2B4D,0x2A4F,0x2B4F,0x2A4E,0x2B4E, +0x294A,0x292B,0x294B,0x2A57,0x2B57, 0, 0,0x2A56, +0x2B56,0x292D,0x294D,0x2A59,0x2B59,0x2A5B,0x2B5B,0x2A5A, +0x2B5A,0x2A5C,0x2B5C,0x2A5D,0x2B5D,0x2A5F,0x2B5F,0x2A5E, +0x2B5E,0x2A61,0x2B61,0x2A60,0x2B60,0x292F,0x294F,0x2A6C, +0x2B6C,0x2A69,0x2B69,0x2A66,0x2B66,0x2A6B,0x2B6B,0x2A68, +0x2B68,0x2A6A,0x2B6A,0x2A71,0x2B71,0x2A74,0x2B74,0x2A73, +0x2A75,0x2B75,0x2A77,0x2B77,0x2A76,0x2B76}; + +/* page 2 0x01CD-0x01DC */ +static uint16 tab_uni_jisx02122[]={ +0x2A26,0x2B26,0x2A43,0x2B43,0x2A55,0x2B55,0x2A67,0x2B67, +0x2A70,0x2B70,0x2A6D,0x2B6D,0x2A6F,0x2B6F,0x2A6E,0x2B6E +}; + +/* page 3 0x01F5-0x01F5 */ +static uint16 tab_uni_jisx02123[]={ +0x2B39}; + +/* page 4 0x02C7-0x02DD */ +static uint16 tab_uni_jisx02124[]={ +0x2230, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x222F,0x2232,0x2236,0x2235, 0,0x2233}; + +/* page 5 0x0384-0x0390 */ +static uint16 tab_uni_jisx02125[]={ +0x2238,0x2239,0x2661, 0,0x2662,0x2663,0x2664, 0, +0x2667, 0,0x2669,0x266C,0x2676}; + +/* page 6 0x03AA-0x03CE */ +static uint16 tab_uni_jisx02126[]={ +0x2665,0x266A,0x2671,0x2672,0x2673,0x2674,0x267B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x2678, 0, 0, 0, 0, 0, 0, 0, +0x2675,0x267A,0x2677,0x2679,0x267C}; + +/* page 7 0x0402-0x040F */ +static uint16 tab_uni_jisx02127[]={ +0x2742,0x2743,0x2744,0x2745,0x2746,0x2747,0x2748,0x2749, +0x274A,0x274B,0x274C, 0,0x274D,0x274E}; + +/* page 8 0x0452-0x045F */ +static uint16 tab_uni_jisx02128[]={ +0x2772,0x2773,0x2774,0x2775,0x2776,0x2777,0x2778,0x2779, +0x277A,0x277B,0x277C, 0,0x277D,0x277E}; + +/* page 9 0x2116-0x2122 */ +static uint16 tab_uni_jisx02129[]={ +0x2271, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x226F}; + +/* page 10 0x4E02-0x4F19 */ +static uint16 tab_uni_jisx021210[]={ +0x3021, 0,0x3022,0x3023, 0, 0, 0, 0, + 0, 0,0x3024, 0, 0, 0, 0, 0, +0x3025, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3026, 0, 0, + 0,0x3027,0x3028, 0, 0, 0,0x3029, 0, + 0,0x302A, 0, 0,0x302B,0x302C,0x302D, 0, + 0, 0, 0,0x302E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x302F,0x3030, + 0, 0,0x3031, 0, 0,0x3032, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3033, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3034, 0,0x3035, 0, 0, 0, 0, 0, + 0,0x3036, 0, 0, 0, 0,0x3037,0x3038, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3039,0x303A, 0, 0, 0,0x303B, + 0, 0, 0, 0, 0,0x303C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x303D, 0, 0, 0, 0, + 0, 0, 0, 0,0x303E,0x303F, 0, 0, + 0, 0, 0,0x3040, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3041, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3042, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3043, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3044, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3045,0x3046, 0, 0, 0, 0,0x3047,0x3048, +0x3049, 0, 0, 0, 0, 0,0x304A, 0, + 0, 0, 0, 0, 0,0x304B, 0,0x304C, + 0,0x304D, 0,0x304E, 0, 0, 0, 0, + 0, 0, 0,0x304F,0x3050,0x3051,0x3052, 0, +0x3053,0x3054, 0, 0, 0, 0,0x3055, 0, + 0,0x3056,0x3057, 0, 0, 0, 0, 0, +0x3058, 0, 0,0x3059,0x305A,0x305B, 0,0x305C +}; + +/* page 11 0x4F2E-0x5166 */ +static uint16 tab_uni_jisx021211[]={ +0x305D, 0, 0,0x305E, 0,0x3060, 0,0x3061, + 0,0x3062, 0,0x3063, 0,0x3064, 0, 0, +0x3065, 0,0x3066, 0,0x3067, 0, 0, 0, + 0, 0,0x3068,0x3069, 0,0x306A,0x306B, 0, + 0, 0, 0, 0,0x306C, 0,0x306D, 0, +0x306E, 0,0x306F, 0, 0, 0, 0, 0, + 0,0x3070,0x305F, 0, 0,0x3071, 0, 0, + 0, 0, 0, 0,0x3072, 0,0x3073, 0, +0x3074, 0, 0,0x3075, 0, 0, 0, 0, + 0,0x3076,0x3077,0x3078,0x3079, 0, 0,0x307A, +0x307B, 0, 0,0x307C,0x307D, 0,0x307E,0x3121, + 0, 0, 0,0x3122,0x3123, 0,0x3124, 0, +0x3125, 0,0x3126, 0,0x3127,0x3128,0x3129, 0, + 0,0x312A, 0,0x312B,0x312C, 0, 0, 0, +0x312D,0x312E, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x312F, 0, 0, 0, + 0,0x3130, 0,0x3131, 0,0x3132,0x3133,0x3134, +0x3135, 0,0x3136,0x3137, 0, 0, 0,0x3138, +0x3139, 0,0x313A,0x313B, 0,0x313C,0x313D,0x313E, + 0,0x313F, 0, 0,0x3140, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3141, 0, + 0, 0,0x3142, 0,0x3143, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3144, 0,0x3145, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3146,0x3147, + 0,0x3148,0x3149,0x314A, 0, 0,0x314B, 0, + 0,0x314C, 0, 0,0x314D, 0,0x314E, 0, +0x314F, 0,0x3150, 0, 0,0x3151, 0, 0, + 0,0x3152,0x3153, 0, 0,0x3154,0x3155,0x3156, +0x3157, 0, 0, 0,0x3158, 0, 0, 0, + 0,0x3159, 0, 0, 0, 0, 0, 0, +0x315A, 0,0x315B, 0,0x315C,0x315D, 0,0x315E, + 0, 0, 0, 0, 0,0x3176, 0, 0, + 0, 0,0x315F,0x3160,0x3161, 0, 0,0x3162, +0x3163, 0, 0, 0,0x3164, 0,0x3165, 0, +0x3166, 0, 0,0x3167,0x3168,0x3169, 0, 0, + 0,0x316A, 0,0x316B, 0, 0, 0, 0, + 0,0x316C,0x316D, 0,0x316E,0x316F, 0, 0, +0x3170,0x3171, 0, 0,0x3172, 0, 0,0x3173, + 0, 0,0x3174,0x3175, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3177, 0,0x3178,0x3179, 0, +0x317A, 0, 0, 0,0x317B, 0, 0, 0, +0x317C,0x317D,0x317E, 0,0x3221,0x3222,0x3223, 0, +0x3224, 0, 0, 0, 0,0x3225,0x3226, 0, +0x3227,0x3228,0x3229,0x322A,0x322B, 0, 0, 0, + 0, 0, 0, 0,0x322C, 0, 0, 0, + 0,0x322D,0x322E, 0, 0, 0, 0, 0, + 0, 0, 0,0x322F,0x3230, 0, 0,0x3231, + 0, 0,0x3232, 0, 0,0x3233,0x3234, 0, + 0,0x3235, 0, 0, 0, 0,0x3236, 0, +0x3237, 0,0x3238, 0, 0,0x3239,0x323A, 0, + 0, 0,0x323B, 0, 0, 0,0x323C,0x323D, + 0,0x323E, 0, 0,0x323F, 0,0x3240, 0, +0x3241, 0,0x3242,0x3243, 0, 0, 0, 0, + 0,0x3244, 0,0x3245,0x3251, 0, 0, 0, +0x3246, 0, 0, 0,0x3247, 0, 0, 0, +0x3248, 0, 0, 0, 0,0x3249, 0, 0, +0x324A,0x324B,0x324C, 0, 0,0x324D,0x324E,0x324F, +0x3250, 0,0x3252, 0, 0, 0, 0, 0, + 0,0x3253, 0,0x3254, 0,0x3255,0x3256,0x3257, +0x3258, 0, 0, 0, 0,0x3259, 0, 0, + 0,0x325A,0x325B, 0, 0, 0,0x325C,0x325D, + 0,0x325E, 0,0x325F, 0,0x3260,0x3261,0x3262, + 0, 0,0x3263,0x3264, 0, 0, 0, 0, + 0, 0, 0, 0,0x3265, 0, 0, 0, + 0, 0, 0, 0,0x3266, 0, 0, 0, + 0,0x3267, 0, 0, 0,0x3268, 0,0x3269, + 0,0x326A,0x326B, 0, 0, 0, 0, 0, + 0,0x326C, 0, 0, 0, 0,0x326D, 0, +0x326E}; + +/* page 12 0x517E-0x5515 */ +static uint16 tab_uni_jisx021212[]={ +0x326F, 0, 0, 0, 0,0x3270,0x3271, 0, + 0, 0, 0, 0, 0,0x3272, 0, 0, +0x3273, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3274, 0, 0, 0, 0,0x3275, + 0, 0, 0,0x3276, 0,0x3277, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3278, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3279, 0,0x327A, 0,0x327B, 0, +0x327C,0x327D, 0, 0,0x327E, 0, 0, 0, + 0, 0,0x3321, 0, 0, 0, 0, 0, + 0,0x3322, 0,0x3323,0x3324,0x3325, 0,0x3326, + 0, 0,0x3327, 0, 0, 0, 0, 0, +0x3328, 0, 0, 0,0x3329, 0, 0,0x332A, + 0, 0, 0, 0, 0, 0, 0, 0, +0x332B, 0, 0, 0,0x332C,0x332D,0x332E, 0, + 0,0x332F, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3330,0x3331, 0, 0,0x3332, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3333,0x3334, 0,0x3335, +0x3336, 0,0x3337, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3338, 0, 0, 0, + 0, 0,0x3339, 0, 0, 0, 0, 0, + 0, 0, 0,0x333A,0x333B, 0, 0,0x333C, + 0, 0, 0, 0, 0, 0,0x333D, 0, + 0, 0, 0, 0, 0, 0, 0,0x333E, + 0, 0, 0,0x333F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3340, + 0,0x3341,0x3342, 0,0x3343, 0,0x3344, 0, + 0,0x3345,0x3346,0x3347, 0, 0, 0, 0, +0x3348, 0, 0, 0, 0, 0, 0, 0, +0x3349, 0, 0, 0, 0, 0, 0, 0, + 0,0x334A,0x334B,0x334C, 0, 0, 0, 0, + 0, 0,0x334D, 0,0x334E, 0, 0,0x334F, + 0, 0, 0, 0,0x3350, 0,0x3351, 0, + 0, 0, 0, 0, 0,0x3352, 0,0x3353, +0x3354,0x3355,0x3356, 0,0x3357, 0,0x3358, 0, + 0, 0, 0, 0, 0, 0,0x3359,0x335A, +0x335B,0x335C, 0, 0, 0, 0, 0, 0, + 0,0x335D,0x335E, 0, 0, 0, 0, 0, +0x335F,0x3360,0x3361, 0,0x3362,0x3363, 0,0x3364, + 0, 0,0x3365, 0, 0, 0,0x3366, 0, +0x3367, 0,0x3368, 0, 0, 0,0x3369, 0, + 0,0x336A, 0,0x336B, 0, 0,0x336C, 0, +0x336D, 0, 0, 0, 0,0x336E,0x336F, 0, + 0, 0, 0,0x3370, 0, 0, 0,0x3371, + 0, 0,0x3372,0x3373,0x3374, 0,0x3375, 0, + 0, 0,0x3376,0x3377, 0, 0,0x3378, 0, +0x3379,0x337A, 0, 0, 0, 0, 0, 0, + 0, 0,0x337B, 0, 0,0x337C, 0, 0, + 0, 0, 0, 0,0x337D,0x337E,0x3421, 0, + 0, 0, 0,0x3422, 0,0x3423, 0, 0, + 0, 0,0x3424, 0, 0,0x3425,0x3426, 0, +0x3427,0x3428, 0, 0, 0, 0, 0,0x3429, + 0,0x342A,0x342B,0x342C, 0,0x342D,0x342E,0x342F, + 0, 0,0x3430, 0,0x3431, 0, 0,0x3432, + 0, 0, 0, 0, 0, 0,0x3433,0x3434, +0x3435, 0, 0, 0,0x3436, 0, 0, 0, + 0, 0, 0, 0, 0,0x3438,0x3437, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3439, 0,0x343A, 0, 0, + 0, 0, 0,0x343B, 0,0x343C, 0,0x343D, + 0, 0, 0, 0, 0, 0,0x343E,0x343F, + 0, 0, 0, 0,0x3440, 0, 0, 0, + 0, 0, 0,0x3441, 0, 0, 0, 0, +0x3442, 0, 0, 0, 0,0x3443, 0, 0, + 0,0x3444,0x3445, 0, 0, 0, 0, 0, +0x3446, 0, 0, 0, 0,0x3447,0x3448, 0, + 0, 0, 0,0x3449, 0, 0, 0,0x344A, + 0, 0, 0,0x344B, 0, 0,0x344C, 0, + 0, 0, 0, 0,0x344D,0x344E, 0, 0, + 0,0x344F, 0, 0,0x3450, 0,0x3451,0x3452, + 0,0x3453,0x3454, 0,0x3455, 0, 0,0x3456, + 0, 0,0x3457, 0, 0, 0, 0,0x3458, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3459, 0, 0,0x345A,0x345B, 0,0x345C, + 0, 0, 0, 0,0x345D, 0, 0,0x345E, +0x345F, 0,0x3460, 0, 0, 0, 0, 0, +0x3461,0x3462, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3463, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3464, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3465, 0, 0, + 0, 0, 0, 0,0x3466, 0, 0, 0, + 0, 0, 0,0x3467, 0, 0, 0, 0, + 0,0x3468,0x3469, 0,0x346A, 0, 0, 0, + 0,0x346B, 0,0x346C, 0, 0,0x346D,0x346E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x346F,0x3470, 0, + 0,0x3471, 0, 0, 0, 0, 0,0x3472, + 0,0x3473, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3474, 0, 0, 0,0x3475, 0,0x3476, 0, +0x3477,0x3478, 0,0x3479, 0,0x347A, 0,0x347B, +0x347C, 0, 0, 0, 0, 0,0x347D, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x347E, 0,0x3521, 0,0x3522, 0,0x3523, + 0, 0,0x3524,0x3525, 0, 0, 0,0x3526, + 0, 0, 0,0x3527, 0, 0, 0,0x3528, +0x3529, 0, 0, 0, 0, 0,0x352A, 0, + 0,0x352B, 0,0x352C, 0, 0, 0, 0, +0x352D,0x352E, 0,0x352F,0x3530, 0, 0,0x3531, +0x3532, 0, 0,0x3533, 0, 0, 0, 0, + 0,0x3534, 0,0x3535,0x3536,0x3537, 0, 0, + 0,0x3538, 0, 0, 0, 0, 0, 0, +0x3539, 0, 0, 0,0x353A, 0, 0,0x353B, +0x353C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x353D, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x353E, 0,0x353F, 0, + 0,0x3540, 0, 0, 0, 0, 0, 0, +0x3541, 0, 0, 0, 0, 0,0x3542, 0, +0x3543,0x3544,0x3545,0x3546, 0, 0, 0,0x3547, + 0, 0,0x3548,0x3549, 0, 0,0x354A,0x354B, +0x354C, 0, 0, 0, 0, 0, 0,0x354D +}; + +/* page 13 0x552A-0x5566 */ +static uint16 tab_uni_jisx021213[]={ +0x354E,0x354F, 0, 0, 0, 0, 0, 0, +0x3550, 0, 0,0x3551,0x3552, 0, 0, 0, + 0,0x3553,0x3554,0x3555, 0, 0, 0,0x3556, + 0, 0, 0, 0, 0,0x3557, 0,0x3558, +0x3559, 0, 0,0x355A, 0, 0,0x355B,0x355C, + 0, 0, 0, 0, 0, 0,0x355D, 0, +0x355E,0x355F, 0, 0,0x3560, 0,0x3561,0x3562, + 0, 0,0x3563, 0,0x3564}; + +/* page 14 0x557F-0x5C36 */ +static uint16 tab_uni_jisx021214[]={ +0x3565, 0,0x3566,0x3567, 0, 0, 0,0x3568, + 0,0x3569, 0, 0, 0, 0, 0,0x356A, +0x356B, 0,0x356C,0x356D,0x356E,0x356F, 0, 0, +0x3570, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3571,0x3572, 0, 0, + 0, 0, 0, 0, 0, 0,0x3573, 0, + 0, 0, 0,0x3574, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3575, 0,0x3576, 0,0x3577, 0, 0,0x3578, + 0, 0,0x3579, 0,0x357A,0x357B, 0,0x357C, + 0, 0,0x357D,0x357E,0x3621, 0, 0, 0, +0x3622,0x3623, 0, 0,0x3624, 0, 0,0x3625, + 0, 0, 0,0x3626, 0, 0, 0, 0, + 0, 0,0x3627, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3628, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3629, 0, 0, 0, 0, 0,0x362A, 0, + 0,0x362B, 0,0x362C, 0, 0,0x362D,0x362E, +0x362F,0x3630,0x3631,0x3632, 0, 0, 0, 0, + 0, 0,0x3633, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3634, 0, 0, + 0,0x3635, 0, 0,0x3636, 0,0x3637, 0, +0x3638, 0,0x3639, 0,0x363A,0x363B,0x363C, 0, +0x363D,0x363E,0x363F, 0,0x3640,0x3641, 0,0x3642, + 0, 0,0x3643, 0,0x3644, 0,0x3645, 0, +0x3646, 0, 0, 0, 0,0x3647, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3648, + 0,0x3649,0x364A,0x364B,0x364C, 0, 0,0x364D, + 0, 0,0x364E, 0, 0, 0,0x364F, 0, +0x3650, 0,0x3651,0x3652, 0, 0,0x3653, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3654,0x3655, 0, + 0,0x3656, 0, 0,0x3657,0x3658, 0, 0, + 0, 0, 0, 0, 0, 0,0x3659, 0, + 0, 0,0x365A,0x365B, 0, 0,0x365C,0x365D, +0x365E, 0, 0, 0, 0, 0, 0,0x365F, +0x3660,0x3661,0x3662, 0,0x3663,0x3664,0x3665, 0, + 0, 0,0x3666, 0,0x3667, 0, 0, 0, +0x3668, 0, 0, 0, 0, 0, 0,0x3669, + 0, 0, 0, 0, 0, 0,0x366A, 0, + 0, 0,0x366B,0x366C,0x366D,0x3670,0x3671, 0, +0x366E,0x366F, 0, 0, 0, 0, 0, 0, + 0, 0,0x3672, 0, 0,0x3673,0x3674, 0, +0x3675, 0,0x3676, 0, 0,0x3677,0x3678,0x3679, +0x367A,0x367B, 0, 0,0x367D, 0,0x367E, 0, + 0, 0,0x367C, 0, 0, 0, 0,0x3721, +0x3722, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3723,0x3724, 0, 0, 0, 0, +0x3725, 0, 0,0x3726, 0,0x3727, 0, 0, + 0, 0,0x3728, 0, 0, 0,0x3729, 0, + 0, 0, 0,0x372A,0x372B, 0,0x372C, 0, + 0,0x372D, 0,0x372E,0x372F,0x3730,0x3731, 0, + 0, 0,0x3732,0x3733, 0,0x3734, 0,0x3735, +0x3736, 0, 0, 0,0x3737,0x3738, 0, 0, + 0, 0, 0, 0, 0, 0,0x3739,0x373A, +0x373B, 0, 0, 0, 0, 0,0x373C,0x373D, + 0, 0, 0, 0, 0,0x373E,0x373F, 0, + 0, 0, 0,0x3740, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3741, 0, 0,0x3742, 0, +0x3743,0x3744, 0, 0,0x3745, 0,0x3746,0x3747, +0x3748,0x3749,0x374A, 0,0x374B,0x374C,0x374D, 0, +0x374E, 0,0x374F,0x3750,0x3751,0x3752, 0,0x3753, + 0, 0,0x3754, 0,0x3755, 0, 0, 0, + 0, 0, 0, 0, 0,0x3756, 0, 0, + 0, 0, 0, 0, 0,0x3757,0x3760, 0, +0x3758, 0,0x3759,0x375A, 0,0x375B,0x375C,0x375D, +0x375E, 0,0x375F, 0, 0, 0, 0, 0, +0x3761,0x3762,0x3763, 0, 0,0x3764, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3765, 0, 0, 0, 0,0x3766, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3767,0x3768, 0, 0, 0,0x3769, 0, 0, +0x376A, 0, 0, 0, 0, 0,0x376B, 0, + 0, 0, 0, 0, 0, 0,0x376C,0x376D, + 0, 0,0x377E, 0, 0,0x376E, 0,0x376F, +0x3770, 0,0x3771, 0, 0, 0,0x3772, 0, + 0,0x3773, 0, 0, 0, 0,0x3774,0x3775, + 0,0x3776, 0, 0, 0, 0,0x3777,0x3778, +0x3779, 0, 0, 0,0x377A,0x377B, 0, 0, + 0,0x377C,0x377D, 0, 0,0x3821,0x3822, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3823, 0, 0,0x3824, +0x3825,0x3826, 0, 0, 0, 0, 0,0x3827, +0x3828, 0, 0, 0, 0, 0,0x3829, 0, + 0, 0, 0,0x382A, 0, 0, 0, 0, + 0, 0,0x382B, 0, 0, 0, 0, 0, +0x382C, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x382D, 0, 0,0x382E,0x382F, 0, +0x3830,0x3831, 0, 0, 0, 0,0x3832, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3833, 0,0x3834, 0, 0,0x3835, 0, 0, +0x3836,0x3837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3838, 0, 0, 0,0x3839, 0, 0, +0x383A,0x383B,0x383C, 0, 0, 0, 0, 0, +0x383D,0x383E,0x383F,0x3840, 0,0x3841,0x3842, 0, +0x3843,0x3844, 0, 0, 0,0x3845, 0,0x3846, + 0, 0, 0, 0, 0, 0,0x3847, 0, + 0,0x3848,0x3849,0x384A, 0, 0, 0,0x384B, + 0, 0,0x384C, 0, 0, 0, 0, 0, + 0, 0,0x384D,0x384E, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3850, 0, 0, + 0, 0, 0,0x3851, 0,0x384F, 0, 0, + 0,0x3852, 0, 0, 0, 0,0x3853,0x3854, + 0,0x3855, 0,0x3856, 0,0x3857, 0,0x3858, + 0, 0, 0,0x3859, 0, 0,0x385A, 0, + 0, 0,0x385B,0x385C, 0, 0, 0, 0, + 0, 0,0x385D, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x385E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x385F,0x3860, + 0, 0, 0, 0,0x3861,0x3862, 0, 0, + 0, 0, 0,0x3863,0x3864,0x3865, 0, 0, + 0, 0, 0, 0, 0, 0,0x3867, 0, + 0, 0,0x3868, 0,0x3869,0x386A, 0, 0, + 0,0x386B, 0, 0, 0, 0, 0, 0, +0x386C,0x386D, 0, 0,0x386E, 0,0x386F,0x3870, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3871, 0, 0, 0,0x3872, 0, 0,0x3873, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3874,0x3875, 0, 0, 0, + 0, 0,0x3876, 0,0x3877, 0,0x3878,0x3879, +0x387A, 0,0x387B, 0,0x387C, 0, 0, 0, + 0, 0, 0, 0,0x387D, 0,0x387E, 0, +0x3921, 0, 0,0x3922, 0, 0,0x3923,0x3924, + 0, 0,0x3925, 0,0x3926,0x3927, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3928,0x3929, 0,0x392A, + 0, 0, 0,0x392B, 0, 0,0x392C, 0, +0x392D, 0, 0, 0, 0, 0, 0, 0, +0x392E, 0, 0, 0, 0,0x392F, 0, 0, +0x3930, 0, 0, 0, 0, 0,0x3931,0x3932, +0x3933,0x3934, 0, 0,0x3935, 0, 0, 0, +0x3936, 0, 0,0x3937, 0,0x3938, 0, 0, + 0, 0,0x3939, 0,0x393A,0x393B, 0, 0, + 0,0x393C, 0,0x393D, 0, 0,0x393E, 0, + 0, 0, 0,0x393F, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3940,0x3941, +0x3942, 0, 0, 0,0x3943,0x3944, 0, 0, +0x3945, 0, 0, 0, 0, 0, 0,0x3946, +0x3947, 0,0x3948,0x3949, 0,0x394A, 0, 0, +0x394B, 0, 0, 0, 0, 0, 0, 0, + 0,0x394C, 0, 0, 0,0x394D, 0, 0, + 0, 0, 0, 0, 0,0x394E,0x394F,0x3950, + 0, 0, 0,0x3951,0x3952, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3953, + 0, 0, 0, 0,0x3954,0x3955, 0, 0, +0x3956,0x3957, 0,0x3958, 0, 0,0x3959, 0, + 0,0x395A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x395B,0x395C, 0, +0x395D,0x395E, 0, 0, 0,0x395F, 0, 0, + 0,0x3960, 0, 0, 0, 0,0x3961, 0, + 0, 0, 0, 0, 0, 0, 0,0x3962, + 0, 0, 0, 0,0x3963, 0,0x3964, 0, +0x3965, 0, 0, 0, 0, 0,0x3966, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3967, 0, 0,0x3968,0x3969, 0, 0,0x396A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x396B, 0, 0, 0, + 0,0x396C, 0, 0,0x396D, 0, 0,0x396E, + 0, 0,0x396F, 0, 0,0x3970, 0,0x3971, +0x3972,0x3973, 0,0x3974, 0, 0, 0, 0, +0x3975, 0, 0, 0, 0,0x3976, 0, 0, + 0, 0,0x3977,0x3978,0x3979, 0,0x397A, 0, + 0,0x397B, 0,0x397C,0x397D, 0, 0, 0, +0x397E, 0, 0, 0, 0,0x3A21, 0,0x3A22, + 0,0x3A23, 0, 0, 0, 0, 0, 0, +0x3A24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3A25, 0,0x3A26, 0, 0, + 0,0x3A27, 0, 0, 0, 0,0x3A28, 0, + 0, 0, 0,0x3A29, 0, 0, 0,0x3A2A, + 0, 0, 0, 0, 0, 0,0x3A2B,0x3A2C, + 0, 0, 0, 0, 0, 0,0x3A2D, 0, + 0,0x3A2E,0x3A2F, 0, 0, 0, 0, 0, + 0,0x3A30, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3A31, 0,0x3A33, 0,0x3A34, 0,0x3A35, 0, + 0, 0,0x3A36, 0, 0, 0,0x3A37, 0, + 0, 0, 0, 0, 0, 0,0x3A38, 0, + 0, 0, 0, 0, 0,0x3A32, 0, 0, + 0,0x3A39, 0, 0, 0, 0, 0, 0, + 0, 0,0x3A3A, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3A3B,0x3A3C, 0, 0, + 0, 0, 0,0x3A3D, 0, 0, 0,0x3A3E, + 0, 0, 0, 0, 0, 0, 0,0x3A3F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3A40, 0, 0, 0, 0, 0,0x3A41, +0x3A42, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3A43,0x3A44,0x3A45, +0x3A46, 0,0x3A47, 0, 0,0x3A48, 0,0x3A49, + 0, 0, 0,0x3A4A, 0, 0, 0,0x3A4B, + 0,0x3A4C,0x3A4D, 0,0x3A4E,0x3A4F, 0,0x3A50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3A51,0x3A52, 0, 0,0x3A53,0x3A54, 0, +0x3A55, 0,0x3A56,0x3A57, 0, 0, 0, 0, +0x3A58, 0, 0,0x3A59, 0,0x3A5A, 0, 0, + 0,0x3A5B,0x3A5C, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3A5D, 0, +0x3A5E, 0, 0, 0, 0, 0, 0,0x3A5F, +0x3A60,0x3A61,0x3A62,0x3A63, 0, 0, 0, 0, + 0,0x3A64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3A65, 0,0x3A66, 0, 0,0x3A67, 0, 0, + 0, 0, 0, 0, 0, 0,0x3A68, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3A69, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3A6A, 0, 0, 0, 0, 0, 0,0x3A6B, +0x3A6C, 0, 0, 0,0x3A6D, 0, 0,0x3A6E, + 0, 0,0x3A6F, 0,0x3A70,0x3A71, 0,0x3A72, + 0,0x3A73, 0,0x3A74, 0, 0,0x3A75,0x3A76 +}; + +/* page 15 0x5C59-0x5EEB */ +static uint16 tab_uni_jisx021215[]={ +0x3A77,0x3A78, 0,0x3A79, 0, 0, 0, 0, + 0,0x3A7A,0x3A7B, 0, 0, 0,0x3A7C,0x3A7D, +0x3A7E, 0, 0, 0,0x3B21, 0, 0,0x3B22, + 0, 0, 0,0x3B23,0x3B24, 0, 0, 0, + 0,0x3B25,0x3B26,0x3B27,0x3B28, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3B29,0x3B2A, + 0,0x3B2B, 0, 0, 0, 0,0x3B2C, 0, + 0,0x3B2D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3B2E, 0,0x3B2F,0x3B30, + 0,0x3B31,0x3B32, 0, 0,0x3B33, 0, 0, + 0,0x3B34, 0, 0, 0, 0, 0, 0, + 0,0x3B35, 0,0x3B36,0x3B37, 0, 0, 0, + 0,0x3B38, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3B39, 0,0x3B3A, 0, 0, 0, 0, 0, + 0,0x3B3B, 0, 0, 0, 0,0x3B3D, 0, + 0, 0, 0, 0,0x3B3C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3B3E, 0, 0, +0x3B3F,0x3B40, 0,0x3B41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3B42, 0, 0, 0, 0,0x3B43, 0, 0, + 0, 0, 0, 0,0x3B44, 0, 0, 0, + 0,0x3B45, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3B47,0x3B48, 0,0x3B49,0x3B4A, 0, + 0, 0,0x3B46, 0, 0, 0, 0, 0, +0x3B4B, 0, 0,0x3B4C, 0, 0, 0, 0, +0x3B4D, 0, 0, 0,0x3B4E, 0,0x3B4F, 0, + 0,0x3B50,0x3B51, 0, 0,0x3B52, 0,0x3B53, + 0,0x3B57, 0, 0, 0, 0, 0, 0, +0x3B55, 0, 0, 0,0x3B54, 0, 0, 0, +0x3B56, 0, 0, 0, 0, 0,0x3B58,0x3B59, +0x3B5A,0x3B5B, 0,0x3B5C, 0, 0, 0, 0, + 0,0x3B5D, 0, 0,0x3B5E, 0, 0,0x3B5F, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3B60,0x3B61, 0, 0, 0,0x3B62,0x3B63, 0, +0x3B64, 0,0x3B65, 0, 0, 0, 0,0x3B66, + 0,0x3B67, 0, 0, 0, 0, 0, 0, + 0,0x3B68,0x3B69,0x3B6A,0x3B6B, 0, 0, 0, +0x3B6C, 0,0x3B6D, 0, 0, 0,0x3B6E,0x3B6F, + 0, 0, 0, 0, 0, 0,0x3B70, 0, + 0, 0,0x3B71, 0, 0, 0, 0,0x3B72, + 0,0x6674, 0,0x3B73, 0, 0, 0,0x3B74, +0x3B75, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3B76, 0, 0, 0,0x3B77, 0, + 0, 0,0x3B78, 0, 0,0x3B7A, 0,0x3B79, + 0, 0, 0, 0, 0, 0, 0,0x3B7B, +0x3B7C, 0, 0, 0, 0, 0, 0,0x3B7D, + 0, 0, 0,0x3B7E, 0, 0, 0, 0, +0x3C21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C22, +0x3C23, 0, 0, 0, 0, 0, 0,0x3C24, + 0, 0, 0, 0, 0, 0,0x3C25, 0, + 0, 0, 0, 0,0x3C26, 0, 0, 0, + 0,0x3C27, 0,0x3C28,0x3C29, 0, 0,0x3C2A, + 0, 0, 0, 0, 0, 0,0x3C2B,0x3C2C, + 0, 0, 0, 0, 0, 0, 0,0x3C2E, + 0, 0, 0, 0, 0,0x3C2D, 0, 0, + 0,0x3C2F, 0, 0,0x3C30, 0, 0, 0, + 0, 0, 0, 0, 0,0x3C31, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3C34, 0,0x3C32, 0, 0, 0, 0,0x3C33, +0x3C35, 0, 0, 0, 0,0x3C36, 0,0x3C37, + 0, 0,0x3C38,0x3C39, 0,0x3C3A, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C3B, + 0,0x3C3C,0x3C3D,0x3C3E,0x3C3F,0x3C40, 0,0x3C41, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C42, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3C43, 0, 0,0x3C44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x3C45, 0,0x3C46,0x3C47, 0, 0,0x3C48, + 0,0x3C49, 0,0x3C4A, 0, 0, 0, 0, +0x3C4B, 0,0x3C4C, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3C4D,0x3C4E,0x3C4F, 0, + 0, 0, 0, 0, 0,0x3C50, 0, 0, + 0, 0,0x3C52,0x3C51, 0,0x3C53, 0, 0, +0x3C54,0x3C55, 0,0x3C56,0x3C57, 0, 0, 0, + 0, 0, 0,0x3C58, 0,0x3C59, 0, 0, + 0, 0, 0, 0,0x3C5A, 0, 0, 0, + 0, 0,0x3C5B}; + +/* page 16 0x5F02-0x6149 */ +static uint16 tab_uni_jisx021216[]={ +0x3C5C, 0, 0, 0,0x3C5D,0x3C5E,0x3C5F, 0, + 0, 0, 0, 0,0x3C60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3C61, + 0, 0,0x3C62,0x3C63, 0, 0, 0,0x3C64, +0x3C65,0x3C66,0x3C67, 0, 0, 0,0x3C68, 0, + 0,0x3C69,0x3C6A, 0,0x3C6B, 0,0x3C6C, 0, + 0, 0,0x3C6D, 0,0x3C6E, 0, 0, 0, + 0,0x3C6F, 0,0x3C70, 0,0x3C71,0x3C72, 0, + 0, 0,0x3C73,0x3C74, 0,0x3C75, 0, 0, + 0, 0, 0,0x3C76, 0, 0,0x3C77, 0, + 0, 0,0x3C78, 0, 0, 0,0x3C79, 0, + 0,0x3C7A, 0, 0, 0, 0,0x3C7B, 0, + 0,0x3C7C,0x3C7D, 0, 0,0x3C7E, 0, 0, + 0, 0, 0, 0, 0,0x3D21, 0, 0, +0x3D22, 0,0x3D23,0x3D24, 0, 0,0x3D25, 0, +0x3D26, 0, 0,0x3D27,0x3D28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3D29, + 0, 0, 0,0x3D2A, 0,0x3D2B, 0, 0, + 0, 0, 0, 0,0x3D2C, 0, 0, 0, + 0, 0,0x3D2D,0x3D2E, 0, 0, 0, 0, +0x3D2F, 0,0x3D32, 0, 0,0x3D30, 0, 0, + 0,0x3D31,0x3D33, 0, 0,0x3D34,0x3D35,0x3D36, + 0, 0, 0, 0, 0, 0,0x3D37, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3D38, 0, 0,0x3D39,0x3D3A,0x3D3B, + 0,0x3D3C, 0, 0, 0, 0,0x3D3D,0x3D3E, +0x3D3F,0x3D40,0x3D41, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3D42, 0, 0,0x3D43, +0x3D44, 0, 0, 0, 0, 0,0x3D45,0x3D46, +0x3D47, 0,0x3D48,0x3D49,0x3D4A,0x3D4B, 0, 0, +0x3D4C,0x3D4D, 0, 0,0x3D4E, 0, 0, 0, +0x3D4F, 0,0x3D50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3D51, 0, 0, +0x3D52, 0, 0,0x3D53, 0, 0, 0, 0, + 0,0x3D54,0x3D55, 0, 0,0x3D56,0x3D57, 0, +0x3D58, 0, 0, 0, 0,0x3D59, 0, 0, + 0, 0,0x3D5A, 0, 0, 0, 0, 0, + 0, 0, 0,0x3D5B, 0, 0, 0, 0, + 0,0x3D5C, 0,0x3D5D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3D5E, 0, + 0, 0, 0, 0, 0,0x3D5F,0x3D60,0x3D61, + 0, 0,0x3D62, 0, 0, 0, 0,0x3D63, + 0, 0,0x3D64, 0,0x3D65,0x3D66, 0, 0, + 0, 0, 0,0x3D67, 0, 0, 0,0x3D68, + 0, 0, 0, 0, 0,0x3D69, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3D6A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3D6B,0x3D6C, 0, 0, +0x3D6D, 0, 0, 0,0x3D6E, 0,0x3D6F, 0, +0x3D70, 0, 0, 0,0x3D71, 0, 0,0x3D72, + 0,0x3D73, 0,0x3D74, 0, 0,0x3D75, 0, + 0, 0, 0,0x3D76,0x3D77, 0, 0, 0, +0x3D78, 0,0x3D79,0x3D7A, 0, 0,0x3D7B, 0, + 0, 0, 0, 0, 0, 0,0x3D7C,0x3D7D, + 0, 0, 0, 0, 0,0x3D7E, 0, 0, + 0,0x3E21, 0, 0,0x3E22, 0, 0, 0, +0x3E23, 0,0x3E24, 0, 0, 0,0x3E25,0x3E26, +0x3E27,0x3E28, 0, 0,0x3E29,0x3E2A, 0, 0, + 0, 0,0x3E2B,0x3E2C, 0, 0, 0,0x3E2D, + 0,0x3E2E, 0,0x3E2F,0x3E30, 0, 0, 0, +0x3E31, 0, 0,0x3E32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3E33, 0, 0,0x3E34, 0, 0,0x3E35, 0, + 0, 0,0x3E36,0x3E37, 0, 0, 0, 0, +0x3E38, 0, 0, 0, 0,0x3E39, 0, 0, +0x3E3A, 0,0x3E3B, 0, 0, 0,0x3E3C,0x3E3D, +0x3E3E,0x3E3F,0x3E40, 0,0x3E41,0x3E42, 0,0x3E43, + 0, 0,0x3E44, 0,0x3E45, 0, 0, 0, +0x3E46, 0, 0, 0, 0, 0, 0, 0, +0x3E47,0x3E48, 0, 0, 0, 0,0x3E49,0x3E4A, + 0, 0, 0,0x3E4B,0x3E4C,0x3E4D, 0,0x3E4E, + 0, 0, 0, 0, 0, 0, 0,0x3E4F, + 0, 0, 0,0x3E50,0x3E51, 0, 0,0x3E52 +}; + +/* page 17 0x615E-0x6290 */ +static uint16 tab_uni_jisx021217[]={ +0x3E53, 0,0x3E54, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x3E55, 0, + 0, 0, 0, 0,0x3E56, 0, 0, 0, + 0, 0,0x3E57, 0, 0,0x3E58,0x3E59, 0, + 0,0x3E5A,0x3E5B,0x3E5C, 0,0x3E5D,0x3E5E, 0, + 0, 0, 0, 0, 0,0x3E5F, 0,0x3E60, + 0, 0, 0, 0,0x3E61,0x3E62, 0, 0, + 0,0x3E63,0x3E64, 0, 0, 0,0x3E65,0x3E66, + 0,0x3E67,0x3E68, 0, 0, 0, 0,0x3E69, + 0, 0,0x3E6A, 0,0x3E6B, 0, 0,0x3E6C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x3E6D,0x3E6E, 0, 0,0x3E6F, 0, + 0, 0,0x3E70,0x3E71,0x3E72, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3E73,0x3E74, 0, 0, 0, 0, 0,0x3E75, + 0, 0, 0, 0, 0, 0,0x3E76,0x3E77, +0x3E78,0x3E79, 0,0x3E7A,0x3E7B, 0, 0,0x3E7E, + 0,0x3E7C, 0,0x3E7D, 0, 0,0x3F21,0x3F22, + 0,0x3F23, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F24, 0,0x3F25,0x3F26, 0, + 0,0x3F27, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3F28, 0,0x3F29, + 0, 0, 0, 0, 0, 0,0x3F2A, 0, + 0, 0,0x3F2B, 0,0x3F2C,0x3F2D, 0, 0, + 0,0x3F2E, 0,0x3F2F, 0,0x3F30, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F31, 0, 0, 0,0x3F32, + 0, 0, 0, 0,0x3F33,0x3F34,0x3F35, 0, +0x3F36, 0, 0, 0, 0, 0,0x3F37, 0, + 0, 0,0x3F38,0x3F39,0x3F3A, 0,0x3F3B, 0, +0x3F3C, 0, 0, 0,0x3F3D, 0,0x3F3E, 0, + 0, 0, 0, 0, 0, 0,0x3F3F, 0, + 0, 0, 0, 0, 0, 0, 0,0x3F40, + 0,0x3F41, 0, 0, 0,0x3F42, 0, 0, + 0, 0, 0, 0,0x3F43, 0, 0,0x3F44, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3F45, +0x3F46,0x3F47,0x3F48}; + +/* page 18 0x62A6-0x679B */ +static uint16 tab_uni_jisx021218[]={ +0x3F49, 0,0x3F4A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x3F4B, 0, 0, +0x3F4C,0x3F4D, 0, 0,0x3F4E, 0, 0, 0, +0x3F4F,0x3F50, 0, 0, 0, 0,0x3F51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x3F52, 0, 0, 0, 0, 0, 0,0x3F53, +0x3F54, 0, 0, 0,0x3F55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x3F56, 0, 0, 0, + 0, 0, 0, 0,0x3F57, 0,0x3F58, 0, + 0, 0, 0, 0, 0, 0,0x3F59,0x3F5A, + 0, 0, 0, 0, 0,0x3F5B,0x3F5C, 0, + 0, 0, 0, 0,0x3F5D,0x3F5E, 0,0x3F5F, + 0, 0,0x3F60, 0, 0,0x3F61, 0, 0, +0x3F62, 0,0x3F63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x3F64,0x3F65, 0, 0,0x3F66, + 0, 0, 0, 0, 0, 0, 0,0x3F67, +0x3F68, 0, 0,0x3F69, 0, 0,0x3F6A, 0, + 0, 0, 0,0x3F6B,0x3F6C,0x3F6D,0x3F6E, 0, +0x3F6F, 0, 0, 0,0x3F70,0x3F71, 0, 0, +0x3F72, 0, 0, 0,0x3F73,0x3F74,0x3F75, 0, + 0, 0,0x3F76, 0, 0,0x3F77, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x3F78, +0x3F79, 0, 0, 0, 0, 0,0x3F7A,0x3F7B, + 0, 0, 0,0x3F7C, 0, 0,0x3F7D,0x3F7E, + 0, 0,0x4021, 0, 0, 0,0x4022,0x4023, + 0,0x4024, 0, 0,0x4025, 0,0x4026, 0, + 0,0x4027, 0, 0,0x4028, 0, 0, 0, + 0, 0,0x4029, 0, 0, 0,0x402A,0x402B, + 0, 0, 0,0x402C,0x402D, 0, 0, 0, +0x402E, 0, 0, 0, 0, 0,0x402F, 0, +0x4030, 0, 0, 0, 0, 0, 0,0x4031, +0x4032,0x4033, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4034, + 0, 0, 0,0x4035, 0, 0, 0,0x4036, + 0, 0,0x4037, 0, 0, 0, 0, 0, +0x4038, 0, 0,0x4039, 0,0x403A,0x403B,0x403C, + 0, 0, 0, 0, 0, 0,0x403D, 0, + 0, 0,0x403E, 0, 0, 0, 0,0x403F, + 0, 0, 0, 0,0x4040, 0,0x4041, 0, + 0, 0, 0, 0,0x4042,0x4043, 0,0x4044, + 0, 0,0x4045,0x4046, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4047,0x4048, 0, 0, 0, + 0, 0,0x4049, 0,0x404A, 0,0x404B, 0, + 0, 0,0x404C, 0, 0, 0, 0, 0, +0x404D, 0,0x404E, 0,0x404F, 0,0x4050,0x4051, + 0, 0, 0,0x4052,0x4053, 0, 0, 0, + 0,0x4054,0x4055, 0, 0, 0, 0,0x4056, + 0, 0, 0, 0, 0, 0, 0,0x4057, + 0,0x4058, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4059, 0, 0, + 0,0x405A, 0,0x405B,0x405C,0x405D,0x405E, 0, + 0, 0, 0, 0,0x405F,0x4060,0x4061,0x4062, + 0,0x4063,0x4064,0x4065, 0,0x4066, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4067, + 0, 0, 0, 0, 0,0x4068,0x4069, 0, + 0, 0, 0, 0, 0,0x406A, 0,0x406B, + 0, 0, 0, 0, 0, 0, 0,0x406C, + 0,0x406D, 0, 0, 0, 0, 0, 0, + 0,0x406E,0x406F,0x4070, 0, 0, 0, 0, + 0, 0,0x4071,0x4072, 0,0x4073, 0,0x4074, + 0,0x4075, 0,0x4076, 0,0x4077, 0, 0, +0x4078, 0,0x4079, 0, 0, 0,0x407A, 0, + 0, 0, 0, 0, 0,0x407B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x407C, +0x407D,0x407E, 0, 0, 0, 0,0x4121, 0, + 0, 0, 0,0x4122,0x4123,0x4124,0x4125, 0, +0x4126, 0,0x4127,0x4128, 0, 0, 0,0x4129, + 0,0x412A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x412B,0x412C, + 0, 0, 0,0x412D,0x412E, 0, 0,0x412F, + 0, 0,0x4130, 0, 0, 0, 0,0x4131, + 0,0x4132, 0, 0, 0,0x4133, 0, 0, + 0,0x4134, 0,0x4135, 0, 0,0x4136, 0, + 0, 0,0x4137,0x4138,0x4139, 0, 0, 0, + 0,0x413A, 0, 0, 0,0x413B,0x413C, 0, +0x413D, 0, 0,0x413E, 0,0x413F, 0, 0, +0x4140,0x4141, 0, 0,0x4142, 0, 0, 0, +0x4143, 0, 0,0x4144, 0, 0, 0, 0, +0x4145, 0, 0,0x4146, 0, 0, 0, 0, + 0, 0, 0, 0,0x4147, 0,0x4148,0x4149, + 0, 0, 0, 0, 0,0x414A, 0, 0, + 0,0x414B, 0,0x414C, 0, 0, 0, 0, + 0, 0,0x414D, 0,0x414E, 0,0x414F, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4150,0x4151, 0, 0, 0, 0, 0, + 0,0x4152, 0, 0, 0,0x4153, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4154, 0, 0,0x4155, + 0, 0, 0,0x4156, 0, 0, 0,0x4157, + 0, 0, 0, 0,0x4158, 0, 0, 0, + 0, 0, 0, 0,0x4159, 0, 0,0x415A, + 0, 0,0x415B, 0, 0, 0, 0,0x415C, + 0, 0,0x415D, 0, 0,0x415E, 0, 0, +0x415F, 0, 0, 0, 0, 0, 0, 0, +0x4160, 0, 0, 0,0x4161,0x4162,0x4163, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4164, 0, 0,0x4165, 0, 0, 0, + 0, 0,0x4166,0x4167, 0, 0, 0, 0, +0x4168, 0,0x4169, 0, 0, 0,0x416A, 0, +0x416B, 0,0x416C, 0, 0, 0, 0, 0, + 0,0x416D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x416E, 0,0x416F, 0,0x4170,0x4171, + 0, 0, 0,0x4172, 0, 0, 0, 0, +0x4173,0x4174,0x4175, 0, 0, 0,0x4176, 0, + 0, 0,0x4177,0x4178, 0, 0, 0,0x4179, + 0, 0, 0,0x417A,0x417B, 0, 0,0x417C, +0x417D, 0, 0, 0, 0, 0, 0,0x417E, +0x4221, 0, 0,0x4222,0x4223,0x4224,0x4225, 0, +0x4226, 0, 0,0x4227,0x4228,0x4229,0x422A, 0, +0x422B, 0,0x422C,0x422D, 0,0x422E, 0, 0, + 0,0x4230, 0,0x422F, 0, 0, 0, 0, + 0, 0,0x4231, 0, 0, 0, 0,0x4232, +0x4233, 0, 0, 0,0x4234, 0,0x4235, 0, +0x4237, 0, 0,0x4236, 0, 0, 0, 0, + 0,0x4238,0x4239,0x423A, 0,0x423B,0x423C, 0, + 0, 0,0x423D,0x423E, 0, 0, 0, 0, + 0, 0, 0, 0,0x4240,0x4241,0x4242, 0, + 0, 0, 0, 0, 0,0x4244, 0,0x4245, + 0,0x4247,0x4248,0x4249, 0,0x424A,0x424C, 0, +0x4243,0x4246,0x424B, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x424D,0x424E,0x424F, + 0, 0,0x4250, 0,0x4251, 0, 0, 0, + 0, 0, 0,0x4252,0x4253,0x4254,0x4255, 0, + 0,0x4256,0x4257, 0, 0, 0,0x4258, 0, + 0, 0, 0, 0, 0, 0, 0,0x4259, + 0, 0, 0,0x425A,0x425B, 0, 0,0x425C, + 0, 0, 0, 0, 0,0x425D, 0, 0, + 0,0x425E,0x425F, 0,0x4260,0x4261, 0, 0, + 0, 0,0x4262, 0, 0, 0,0x4263, 0, +0x4264,0x4265, 0, 0, 0, 0,0x4266, 0, + 0, 0, 0, 0, 0,0x4267, 0, 0, + 0,0x4268, 0, 0, 0, 0, 0, 0, + 0, 0,0x4269, 0, 0,0x426A,0x426B, 0, +0x426C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x426D,0x423F, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x426E, + 0,0x426F, 0, 0, 0, 0, 0, 0, +0x4270, 0, 0, 0, 0,0x4271, 0, 0, + 0, 0, 0,0x4272, 0, 0,0x4273, 0, + 0, 0,0x4274, 0,0x4275, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4276, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4277, 0, 0, 0, 0, 0, 0,0x4278, + 0,0x4279,0x427A, 0, 0, 0,0x427B, 0, + 0, 0, 0, 0, 0, 0,0x427C,0x427D, + 0, 0, 0, 0, 0, 0, 0,0x427E, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4321, 0, 0, 0, 0, 0,0x4322, 0, +0x4323, 0, 0, 0, 0, 0,0x4324, 0, +0x4325, 0, 0, 0, 0,0x4326, 0, 0, + 0, 0, 0,0x4327, 0, 0,0x4328, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4329,0x432A, 0,0x432B, 0,0x432C, 0, 0, +0x432D, 0,0x432E,0x432F, 0,0x4330}; + +/* page 19 0x67B0-0x67F9 */ +static uint16 tab_uni_jisx021219[]={ +0x4331,0x4332,0x4333, 0, 0,0x4334, 0, 0, + 0, 0, 0,0x4335,0x4336,0x4337, 0, 0, +0x4339, 0,0x433A,0x433B, 0,0x433C, 0, 0, +0x433D,0x433E, 0, 0, 0, 0, 0, 0, + 0, 0,0x433F, 0, 0, 0, 0,0x4340, + 0,0x4341, 0, 0,0x4342, 0, 0, 0, + 0,0x4343, 0, 0, 0, 0,0x4344, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4345, 0,0x4346, 0, 0, 0,0x4347,0x4348, + 0,0x4338}; + +/* page 20 0x6814-0x6917 */ +static uint16 tab_uni_jisx021220[]={ +0x434A, 0, 0, 0, 0,0x434B, 0, 0, + 0,0x434C, 0,0x434D, 0, 0, 0, 0, + 0, 0, 0,0x434F,0x434E, 0, 0, 0, +0x4350,0x4351, 0,0x4352,0x4353,0x4354, 0,0x4355, + 0, 0, 0, 0, 0, 0, 0,0x4356, + 0, 0, 0,0x4357, 0, 0, 0, 0, +0x4358,0x4359, 0, 0, 0, 0,0x435A, 0, +0x435B, 0, 0, 0, 0, 0,0x4349, 0, + 0,0x435C, 0,0x435D,0x435E, 0, 0,0x435F, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4360, + 0, 0,0x4361,0x4362,0x4363,0x4364,0x4365, 0, + 0,0x4366, 0, 0, 0,0x4367,0x4368,0x4369, +0x436A, 0, 0, 0, 0, 0,0x436B, 0, +0x436C, 0,0x436D, 0,0x436E, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x436F, 0,0x4370, 0,0x4371, 0, +0x4372, 0, 0, 0, 0,0x4373, 0,0x4374, + 0,0x4375, 0, 0, 0,0x4376,0x4377, 0, + 0, 0,0x4378, 0, 0, 0,0x4379, 0, + 0, 0, 0, 0, 0, 0, 0,0x437A, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x437B, 0, 0,0x437C, 0, 0, 0, +0x437D, 0, 0,0x437E,0x4421,0x4422, 0,0x4423, + 0, 0,0x4424, 0, 0,0x4425, 0, 0, +0x4426,0x4427, 0, 0, 0, 0, 0, 0, + 0,0x4428, 0, 0,0x4429, 0,0x442A,0x442B, +0x442C,0x442D, 0, 0,0x442E,0x442F, 0, 0, + 0,0x4430,0x4431, 0, 0, 0, 0,0x4432, +0x4433,0x4434, 0, 0, 0, 0, 0, 0, + 0, 0,0x4435, 0, 0,0x4436,0x4437, 0, + 0, 0, 0, 0,0x4438,0x4439, 0,0x443A, + 0, 0,0x443B,0x443C}; + +/* page 21 0x6931-0x6D3F */ +static uint16 tab_uni_jisx021221[]={ +0x443D, 0,0x443E, 0,0x443F, 0, 0,0x4440, + 0, 0,0x4441, 0, 0, 0, 0, 0, + 0,0x4442, 0, 0,0x4443, 0, 0, 0, +0x4444, 0, 0, 0, 0,0x4445, 0, 0, + 0, 0, 0, 0, 0, 0,0x4446, 0, + 0, 0,0x4447, 0, 0, 0, 0, 0, + 0, 0,0x4448,0x4449,0x444A,0x444B, 0,0x444C, +0x444D, 0, 0,0x444E, 0, 0, 0,0x444F, +0x4450,0x4451, 0, 0, 0, 0, 0, 0, + 0,0x4452,0x4453, 0, 0, 0,0x4454,0x4455, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4456, 0, 0, 0, + 0,0x4457, 0, 0, 0,0x4458, 0,0x4459, + 0, 0, 0, 0, 0, 0, 0, 0, +0x445A, 0, 0, 0,0x445B,0x445C, 0,0x445D, + 0, 0,0x445E, 0,0x445F, 0,0x4460, 0, + 0, 0, 0, 0, 0, 0,0x4461,0x4462, + 0,0x4463, 0,0x4464, 0, 0, 0, 0, + 0, 0, 0, 0,0x4465, 0, 0,0x4466, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4467, 0, 0, 0, 0,0x4468,0x4469, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x446A, 0, 0,0x446B, 0, 0, 0, + 0, 0, 0, 0, 0,0x446C,0x446D, 0, +0x446E, 0,0x446F, 0,0x4470, 0, 0, 0, + 0, 0, 0, 0, 0,0x4471, 0,0x4472, +0x4473, 0,0x4474, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4475, 0, +0x4476, 0, 0, 0,0x4477, 0, 0, 0, + 0,0x4478, 0, 0,0x4479, 0, 0,0x447A, + 0, 0, 0,0x447B, 0, 0, 0,0x447C, + 0, 0, 0, 0, 0, 0, 0,0x447D, + 0,0x447E, 0,0x4521, 0, 0,0x4522, 0, + 0, 0,0x4523, 0, 0,0x4524,0x4525, 0, + 0, 0, 0, 0,0x4526,0x4527, 0, 0, +0x4528,0x4529, 0, 0, 0,0x452A, 0,0x452B, +0x452C,0x452D, 0, 0,0x452E,0x452F, 0, 0, + 0, 0,0x4530, 0, 0, 0, 0, 0, + 0, 0, 0,0x4531, 0, 0,0x4532, 0, + 0,0x4533, 0, 0, 0, 0, 0, 0, +0x4534, 0,0x4535, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4536, 0, 0, +0x4537, 0,0x4538, 0, 0,0x4539,0x453A, 0, +0x453B, 0,0x453C, 0, 0, 0, 0, 0, +0x453D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x453E, 0,0x453F,0x4540,0x4541, 0, + 0, 0, 0, 0,0x4542, 0, 0, 0, + 0, 0,0x4543, 0, 0, 0,0x4544,0x4545, +0x4546, 0, 0,0x4547, 0, 0, 0, 0, + 0, 0, 0, 0,0x4548,0x4549,0x454A, 0, + 0, 0, 0, 0, 0,0x454B, 0,0x454D, +0x454C, 0, 0,0x454E, 0, 0, 0,0x454F, + 0, 0, 0,0x4550,0x4551,0x4552, 0, 0, + 0, 0, 0,0x4553,0x4554, 0, 0, 0, + 0, 0, 0,0x4555, 0, 0,0x4556, 0, + 0, 0, 0,0x4557, 0, 0, 0,0x4558, +0x4559,0x455A, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x455B,0x455C, 0, 0, 0, + 0,0x455D,0x455E, 0, 0,0x455F,0x4560, 0, +0x4561, 0, 0, 0, 0, 0,0x4562,0x4563, +0x4564, 0, 0, 0, 0, 0,0x4565, 0, + 0, 0,0x4566, 0, 0,0x4567, 0, 0, + 0, 0, 0,0x4568, 0, 0, 0,0x4569, + 0, 0,0x456A,0x456B, 0, 0,0x456C, 0, + 0, 0, 0, 0,0x456D,0x456E, 0, 0, + 0, 0,0x456F, 0, 0, 0,0x4570, 0, + 0, 0, 0, 0, 0,0x4571, 0, 0, + 0,0x4572, 0, 0,0x4573, 0, 0, 0, + 0,0x4574, 0, 0, 0,0x4575, 0,0x4576, + 0, 0, 0, 0,0x4577, 0, 0,0x4578, + 0, 0, 0, 0, 0, 0,0x4579, 0, + 0, 0,0x457A, 0, 0,0x457B, 0,0x457C, + 0, 0, 0, 0,0x457D, 0, 0, 0, + 0, 0, 0, 0,0x457E,0x4621, 0, 0, + 0,0x4622, 0, 0,0x4623, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4624, 0, + 0, 0,0x4625, 0, 0, 0,0x4626,0x4627, + 0,0x4628,0x4629, 0, 0, 0, 0,0x462A, +0x462B, 0, 0,0x462C,0x462D,0x462E, 0,0x462F, + 0, 0, 0, 0, 0, 0, 0,0x4630, +0x4631, 0, 0, 0,0x4632,0x4633, 0, 0, + 0, 0,0x4634,0x4635, 0, 0, 0, 0, +0x4636, 0, 0,0x4637, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4638, 0, 0, + 0,0x4639, 0, 0, 0, 0, 0, 0, +0x463A, 0,0x463B, 0, 0,0x463C,0x463D, 0, + 0, 0, 0, 0, 0,0x463E, 0, 0, +0x463F, 0, 0, 0, 0, 0,0x4640, 0, +0x4641, 0, 0, 0, 0, 0,0x4642, 0, + 0,0x4643, 0,0x4644,0x4645, 0, 0, 0, +0x4646, 0, 0, 0,0x4647,0x4648, 0,0x4649, + 0,0x464A, 0, 0, 0, 0, 0, 0, +0x464B, 0, 0, 0, 0, 0,0x464C, 0, + 0, 0, 0, 0, 0,0x464D,0x464E,0x464F, + 0, 0, 0,0x4650, 0,0x4651, 0, 0, + 0, 0,0x4652, 0,0x4653,0x4654, 0, 0, + 0,0x4655,0x4656, 0, 0, 0,0x4657, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4658,0x4659, 0,0x465A, 0,0x465B, 0, + 0,0x465C, 0,0x465D, 0, 0, 0, 0, +0x465E, 0,0x465F,0x4660, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4736, 0, + 0, 0,0x4661, 0,0x4662, 0,0x4663, 0, + 0, 0, 0,0x4664, 0,0x4665, 0,0x4666, +0x4667, 0,0x4668, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4669,0x466A,0x466B, 0, +0x466C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x466D,0x466E, 0,0x466F,0x4670, + 0, 0, 0,0x4671, 0, 0,0x4672, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4673, + 0,0x4674, 0,0x4675, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4676, 0, 0, 0,0x4677, 0, 0, + 0, 0, 0, 0,0x4678, 0,0x4679,0x467A, +0x467B,0x467C, 0,0x467D, 0,0x467E, 0, 0, + 0,0x4721, 0,0x4722, 0, 0, 0,0x4723, + 0, 0, 0, 0, 0, 0,0x4724, 0, +0x4725, 0,0x4726,0x4727, 0,0x4728, 0, 0, + 0,0x4729, 0,0x472A, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x472B, 0, 0,0x472C, 0, + 0,0x472D, 0, 0, 0,0x472E,0x472F, 0, +0x4730, 0,0x4731, 0, 0, 0, 0, 0, + 0,0x4732, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4733,0x4734,0x4735, + 0, 0, 0, 0, 0,0x4737,0x4738, 0, +0x4739, 0, 0, 0, 0, 0, 0, 0, +0x473A, 0, 0,0x473B, 0, 0,0x473C}; + +/* page 22 0x6D57-0x6E04 */ +static uint16 tab_uni_jisx021222[]={ +0x473D, 0, 0, 0, 0, 0, 0,0x473E, +0x473F, 0,0x4740, 0, 0, 0,0x4741, 0, +0x4742, 0, 0, 0, 0, 0, 0, 0, +0x4743,0x4744, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4745, 0, 0, + 0, 0, 0,0x4746, 0, 0, 0, 0, +0x4747, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4748,0x4749, 0,0x474A, 0,0x474B, +0x474C,0x474D, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x474E, 0,0x474F, 0, 0, + 0, 0, 0, 0, 0,0x4750, 0, 0, +0x4751, 0,0x4752, 0, 0, 0,0x4753, 0, +0x4754, 0, 0, 0, 0,0x4755, 0, 0, + 0,0x4756, 0,0x4757, 0, 0, 0,0x4758, +0x4759, 0, 0, 0, 0, 0, 0,0x475A, + 0, 0, 0, 0,0x475B, 0,0x475C, 0, +0x475D,0x475E, 0,0x475F, 0, 0,0x4760, 0, + 0, 0,0x4761, 0, 0, 0, 0, 0, +0x4762,0x4763, 0, 0, 0,0x4764, 0,0x4765, + 0, 0, 0, 0, 0,0x4766, 0, 0, + 0,0x4767, 0, 0, 0,0x4768}; + +/* page 23 0x6E1E-0x6ECF */ +static uint16 tab_uni_jisx021223[]={ +0x4769, 0, 0, 0,0x476A, 0, 0, 0, + 0,0x476B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x476C, 0, 0, 0, +0x476D, 0, 0,0x476E, 0,0x476F,0x4770, 0, + 0, 0, 0, 0, 0, 0,0x4771,0x4772, + 0, 0,0x4773,0x4774, 0,0x4775, 0, 0, + 0,0x4776, 0,0x4777,0x4778,0x4779,0x477A, 0, + 0,0x477B, 0, 0, 0, 0,0x477C,0x477D, +0x477E, 0, 0, 0,0x4821,0x4822, 0, 0, + 0, 0,0x4823, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4824, 0, 0, + 0, 0, 0, 0, 0,0x4825, 0,0x4826, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4827, + 0, 0, 0, 0, 0,0x4828, 0, 0, + 0, 0, 0,0x4829, 0, 0, 0, 0, + 0, 0,0x482A, 0, 0, 0, 0, 0, + 0,0x482B, 0, 0, 0, 0, 0,0x482C, +0x482D, 0, 0,0x482E, 0,0x482F, 0, 0, + 0, 0, 0, 0, 0,0x4830, 0, 0, + 0,0x4831,0x4832,0x4833, 0,0x4834, 0, 0, + 0,0x4835,0x4836, 0,0x4837, 0, 0,0x4838, +0x4839,0x483A}; + +/* page 24 0x6EEB-0x70E4 */ +static uint16 tab_uni_jisx021224[]={ +0x483B, 0,0x483C,0x483D, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x483E, 0, +0x483F, 0,0x4840, 0, 0, 0, 0, 0, + 0,0x4841, 0, 0, 0,0x4842, 0,0x4843, + 0,0x4844,0x4845, 0, 0, 0, 0, 0, + 0, 0, 0,0x4846, 0,0x4847, 0,0x4848, +0x4849, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x484A, 0, 0,0x484B,0x484C, + 0, 0,0x4853, 0,0x484D,0x484E, 0, 0, +0x484F, 0, 0,0x4850, 0, 0, 0, 0, +0x4851,0x4852, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4854, 0,0x4855,0x4856, +0x4857, 0, 0, 0,0x4858, 0,0x4859,0x485A, + 0, 0,0x485B,0x485C, 0, 0,0x485D,0x485E, + 0, 0, 0, 0, 0,0x485F, 0, 0, + 0,0x4860, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4861,0x4862, 0, 0, 0, 0, +0x4863, 0, 0, 0,0x4864,0x4865, 0, 0, +0x4866,0x4867,0x4868, 0, 0,0x4869, 0,0x486A, +0x486B,0x486C, 0,0x486D, 0, 0, 0,0x486E, + 0, 0, 0, 0,0x486F,0x4870, 0, 0, + 0, 0,0x4871,0x4872,0x4873,0x4874, 0, 0, + 0, 0, 0,0x4875,0x4876,0x4877, 0, 0, + 0, 0,0x4878,0x4879, 0, 0, 0, 0, + 0,0x487A, 0, 0, 0, 0, 0, 0, + 0, 0,0x487B, 0,0x487C,0x487D, 0,0x487E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4921, + 0, 0, 0,0x4922, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4923,0x4924, 0, + 0, 0, 0, 0, 0,0x4925, 0, 0, + 0, 0,0x4926, 0, 0, 0,0x4927, 0, + 0,0x4928,0x4929, 0, 0,0x492A, 0, 0, + 0, 0,0x492B,0x492C,0x492D, 0, 0, 0, + 0, 0,0x492E, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x492F, 0, 0, 0, + 0, 0, 0, 0, 0,0x4930, 0, 0, +0x4931, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4932, 0, 0, 0, + 0,0x4933, 0, 0,0x4934, 0,0x4935, 0, + 0,0x4936, 0, 0, 0, 0, 0, 0, +0x4937,0x4938, 0, 0, 0,0x4939,0x493A,0x493B, +0x493C, 0, 0,0x4941, 0, 0, 0, 0, + 0,0x493D,0x493E, 0, 0, 0, 0, 0, + 0, 0,0x493F,0x4940, 0, 0, 0, 0, + 0,0x4942,0x4943, 0, 0, 0, 0, 0, + 0,0x4944, 0,0x4945, 0, 0, 0, 0, + 0, 0,0x4946,0x4947, 0, 0, 0, 0, + 0, 0, 0,0x4948, 0, 0,0x4949, 0, + 0, 0,0x494A,0x494B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x494C,0x494D,0x494E,0x494F,0x4950, 0, 0, +0x4951, 0, 0, 0, 0, 0, 0, 0, + 0,0x4952, 0, 0, 0, 0, 0, 0, +0x4953, 0, 0, 0, 0,0x4954,0x4955, 0, + 0,0x4956, 0, 0,0x4957, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4958, + 0, 0, 0, 0, 0, 0,0x4959, 0, +0x495A,0x495B,0x495C,0x495D, 0,0x495E, 0, 0, + 0,0x495F, 0, 0, 0, 0, 0, 0, + 0,0x4960}; + +/* page 25 0x70FA-0x71DC */ +static uint16 tab_uni_jisx021225[]={ +0x4961, 0, 0, 0, 0, 0, 0, 0, + 0,0x4962,0x4963,0x4964,0x4965,0x4966, 0, 0, + 0,0x4967,0x4968, 0, 0,0x4969, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x496A, 0,0x496B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x496C, 0,0x496D, 0,0x496E,0x496F,0x4970, + 0, 0, 0, 0, 0, 0,0x4971, 0, + 0, 0, 0, 0, 0, 0, 0,0x4972, + 0, 0, 0,0x4973,0x4974,0x4975, 0, 0, +0x4976,0x4977, 0, 0, 0, 0,0x4978, 0, +0x4979, 0, 0, 0, 0,0x497A, 0, 0, +0x497B, 0,0x497C, 0,0x497D, 0,0x497E, 0, + 0, 0, 0, 0, 0, 0,0x4A21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4A22, + 0, 0, 0, 0, 0, 0,0x4A23, 0, + 0, 0, 0,0x4A24, 0,0x4A25, 0, 0, + 0, 0,0x4A26, 0, 0, 0, 0, 0, +0x4A27, 0, 0, 0, 0, 0, 0, 0, +0x4A28,0x4A29, 0, 0, 0, 0,0x4A2A, 0, +0x4A2B, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4A2C,0x4A2D, 0, +0x4A2E,0x4A2F, 0, 0, 0, 0, 0, 0, +0x4A30, 0, 0, 0, 0,0x4A31,0x4A32,0x4A33, + 0, 0,0x4A34, 0, 0, 0, 0, 0, + 0,0x4A35,0x4A36, 0, 0, 0, 0, 0, + 0,0x4A37, 0, 0,0x4A38, 0, 0,0x4A39, +0x4A3A, 0,0x4A3B}; + +/* page 26 0x71F8-0x7E9E */ +static uint16 tab_uni_jisx021226[]={ +0x4A3C, 0, 0, 0, 0, 0,0x4A3D, 0, +0x4A3E, 0, 0, 0, 0, 0, 0,0x4A3F, +0x4A40,0x4A41, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4A42, 0, 0, 0,0x4A43, + 0, 0,0x4A44, 0, 0,0x4A45, 0,0x4A46, + 0, 0, 0, 0,0x4A47, 0, 0, 0, + 0, 0, 0,0x4A48, 0, 0, 0,0x4A49, + 0, 0, 0, 0,0x4A4A, 0, 0, 0, +0x4A4B,0x4A4C, 0, 0, 0, 0, 0, 0, + 0,0x4A4D,0x4A4E,0x4A4F, 0,0x4A50, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A51,0x4A52, +0x4A53, 0, 0,0x4A54, 0,0x4A55,0x4A56, 0, + 0, 0,0x4A57, 0,0x4A58, 0,0x4A59, 0, +0x4A5A, 0, 0,0x4A5B, 0, 0, 0, 0, +0x4A5C, 0, 0,0x4A5D, 0, 0,0x4A5E,0x4A5F, + 0,0x4A60, 0, 0, 0, 0, 0,0x4A61, +0x4A62, 0, 0,0x4A63,0x4A64, 0, 0,0x4A65, + 0, 0, 0, 0,0x4A66, 0, 0, 0, + 0,0x4A67, 0, 0, 0,0x4A68,0x4A69, 0, + 0, 0, 0,0x4A6A, 0, 0, 0, 0, + 0, 0, 0,0x4A6B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4A6C, 0, 0, 0, 0,0x4A6D,0x4A6E, 0, + 0,0x4A6F, 0, 0,0x4A70, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x4A71, 0, + 0,0x4A72, 0, 0, 0, 0, 0,0x4A73, + 0,0x4A74, 0, 0,0x4A75, 0, 0, 0, + 0, 0, 0, 0, 0,0x4A76,0x4A77, 0, +0x4A78, 0, 0, 0, 0, 0, 0,0x4A79, + 0, 0, 0, 0, 0,0x4A7A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4A7B,0x4A7C, 0, 0, 0, + 0, 0,0x4A7D,0x4A7E, 0, 0,0x4B21, 0, + 0, 0,0x4B22, 0,0x4B23,0x4B24, 0,0x4B25, + 0, 0, 0,0x4B26, 0,0x4B27, 0, 0, + 0, 0,0x4B28,0x4B29, 0, 0, 0, 0, +0x4B2A,0x4B2B, 0, 0, 0, 0,0x4B2C, 0, + 0, 0,0x4B2D, 0,0x4B2E, 0, 0,0x4B2F, +0x4B30, 0, 0, 0,0x4B31, 0, 0, 0, + 0,0x4B32,0x4B33, 0, 0,0x4B34, 0, 0, + 0, 0,0x4B35,0x4B36, 0,0x4B37, 0, 0, + 0, 0, 0,0x4B38, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4B39, 0, 0, +0x4B3A, 0,0x4B3B, 0, 0, 0,0x4B3C, 0, +0x4B3D, 0, 0, 0, 0,0x4B3E,0x4B3F,0x4B40, +0x4B41, 0, 0, 0, 0, 0,0x4B42,0x4B43, + 0,0x4B44, 0,0x4B45,0x4B46, 0,0x4B47,0x4B48, + 0,0x4B49, 0, 0, 0, 0, 0,0x4B4A, + 0,0x4B4B, 0, 0,0x4B4C, 0, 0, 0, +0x4B4D,0x4B4E, 0,0x4B4F, 0,0x4B50,0x4B51, 0, + 0, 0, 0, 0, 0, 0,0x4B52, 0, +0x4B53, 0, 0,0x4B54, 0,0x4B55, 0,0x4B56, +0x4B57, 0, 0, 0,0x4B58, 0,0x4B59,0x4B5A, +0x4B5B, 0,0x4B5C, 0, 0,0x4B5D,0x4B5E, 0, + 0, 0,0x4B5F,0x4B60, 0,0x4B61, 0, 0, + 0, 0, 0, 0, 0,0x4B62, 0,0x4B63, + 0,0x4B64, 0, 0,0x4B65,0x4B66, 0,0x4B67, + 0, 0, 0, 0, 0,0x4B68,0x4B69, 0, + 0,0x4B6A, 0,0x4B6B,0x4B6C, 0, 0,0x4B6D, + 0, 0,0x4B6E,0x4B6F, 0, 0,0x4B70, 0, + 0,0x4B71, 0, 0, 0,0x4B72, 0, 0, + 0,0x4B73, 0,0x4B74, 0, 0,0x4B75,0x4B76, + 0,0x4B77, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4B78,0x4B79, 0,0x4B7A, + 0,0x4B7B,0x4B7C,0x4B7D, 0,0x4B7E, 0,0x4C21, +0x4C22,0x4C23, 0, 0,0x4C24, 0, 0,0x4C25, + 0, 0,0x4C26, 0, 0, 0, 0, 0, + 0,0x4C27, 0, 0, 0, 0, 0, 0, + 0, 0,0x4C28,0x4C29, 0, 0, 0, 0, + 0, 0, 0, 0,0x4C2A, 0,0x4C2B, 0, +0x4C2C,0x4C2D,0x4C2E,0x4C2F,0x4C30,0x4C31,0x4C32,0x4C33, +0x4C34,0x4C35, 0, 0, 0, 0, 0, 0, + 0,0x4C36, 0, 0, 0, 0, 0, 0, +0x4C37, 0, 0,0x4C38,0x4C39, 0,0x4C3A,0x4C3B, + 0, 0, 0,0x4C3C, 0,0x4C3D, 0, 0, + 0,0x4C3E,0x4C3F, 0, 0, 0, 0,0x4C40, + 0, 0, 0, 0, 0,0x4C41, 0, 0, + 0, 0,0x4C42, 0, 0, 0,0x4C43,0x4C44, +0x4C45, 0, 0,0x4C46, 0,0x4C47,0x4C48, 0, + 0,0x4C49,0x4C4A, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4C4B,0x4C4C, 0, 0, 0,0x4C4D,0x4C4E,0x4C4F, + 0,0x4C50, 0, 0, 0, 0, 0,0x4C51, +0x4C52,0x4C53,0x4C54, 0, 0, 0, 0, 0, +0x4C55,0x4C56,0x4C57, 0,0x4C58, 0, 0,0x4C59, +0x4C5A,0x4C5B, 0,0x4C5C, 0, 0,0x4C5D, 0, +0x4C5E,0x4C5F,0x4C60,0x4C61, 0, 0,0x4C62,0x4C63, + 0,0x4C64,0x4C65, 0, 0,0x4C66, 0, 0, + 0,0x4C67, 0,0x4C68, 0, 0, 0,0x4C69, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4C6A,0x4C6B, 0, 0,0x4C6C, 0, 0, 0, +0x4C6D, 0, 0,0x4C6E, 0, 0, 0, 0, +0x4C6F, 0,0x4C70,0x4C71, 0, 0,0x4C72,0x4C73, + 0, 0, 0, 0,0x4C74, 0, 0, 0, +0x4C75, 0,0x4C76,0x4C77, 0, 0, 0,0x4C78, + 0, 0, 0, 0,0x4C79, 0, 0, 0, + 0, 0,0x4C7A,0x4C7B,0x4C7C, 0, 0,0x4C7D, + 0, 0, 0, 0, 0, 0,0x4C7E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4D21, 0, 0, 0,0x4D22,0x4D23, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4D24,0x4D25, 0, 0,0x4D26, 0, 0,0x4D27, + 0,0x4D28,0x4D29, 0, 0, 0, 0,0x4D2A, + 0, 0, 0, 0, 0, 0,0x4D2B, 0, + 0,0x4D2C, 0, 0, 0,0x4D2D,0x4D2E,0x4D2F, +0x4D30, 0, 0,0x4D31, 0, 0, 0,0x4D32, +0x4D33, 0, 0, 0, 0, 0,0x4D34, 0, +0x4D35, 0,0x4D36, 0, 0, 0, 0,0x4D37, + 0, 0, 0, 0, 0, 0,0x4D38,0x4D39, + 0,0x4D3A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x4D3B, + 0,0x4D3C, 0, 0, 0, 0, 0, 0, + 0,0x4D3D,0x4D3E,0x4D3F,0x4D40,0x4D41,0x4D42, 0, + 0,0x4D43, 0, 0, 0,0x4D44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x4D45, 0,0x4D46,0x4D47, 0,0x4D48, 0, 0, + 0,0x4D49, 0, 0,0x4D4A, 0, 0, 0, + 0, 0,0x4D4B, 0,0x4D4C, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4D4D, 0, 0, 0, + 0, 0,0x4D4E, 0, 0, 0, 0,0x4D4F, +0x4D50,0x4D51, 0, 0,0x4D52, 0,0x4D53, 0, + 0, 0, 0, 0,0x4D54, 0,0x4D55,0x4D56, + 0, 0, 0, 0, 0, 0, 0,0x4D57, + 0, 0, 0, 0,0x4D58, 0, 0,0x4D59, +0x4D5A,0x4D5B, 0, 0,0x4D5C, 0, 0,0x4D5D, + 0, 0, 0, 0,0x4D5E, 0,0x4D5F,0x4D60, + 0,0x4D61, 0, 0, 0, 0, 0, 0, + 0,0x4D62, 0, 0, 0, 0, 0, 0, +0x4D63, 0,0x4D64,0x4D65,0x4D66, 0, 0,0x4D67, +0x4D68, 0,0x4D69, 0,0x4D6A, 0, 0,0x4D6B, + 0, 0,0x4D6C,0x4D6D, 0,0x4D6E,0x4D6F, 0, + 0,0x4D70, 0,0x4D71,0x4D72,0x4D73,0x4D74, 0, + 0, 0, 0,0x4D75, 0,0x4D76,0x4D77, 0, + 0,0x4D78, 0, 0, 0,0x4D79, 0, 0, + 0, 0,0x4D7A,0x4D7B, 0,0x4D7C, 0, 0, +0x4D7D,0x4D7E,0x4E21, 0,0x4E22, 0, 0, 0, +0x4E24,0x4E25, 0,0x4E26,0x4E27,0x4E28, 0, 0, + 0,0x4E29,0x4E23,0x4E2A, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4E2B, 0, 0, + 0,0x4E2C, 0, 0, 0, 0, 0,0x4E2D, + 0, 0, 0, 0,0x4E2E,0x4E2F, 0, 0, + 0, 0, 0, 0, 0,0x4E30,0x4E31,0x4E32, + 0,0x4E33, 0, 0,0x4E34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x4E35, 0, 0, 0,0x4E36, 0, 0, + 0, 0, 0, 0,0x4E37,0x4E38, 0, 0, + 0, 0, 0, 0, 0,0x4E39, 0, 0, + 0, 0, 0,0x4E3A,0x4E3B,0x4E3C, 0,0x4E3D, +0x4E3E, 0,0x4E3F,0x4E40,0x4E41,0x4E42,0x4E43,0x4E44, +0x4E45, 0,0x4E46, 0, 0,0x4E47, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4E48, 0, 0, + 0,0x4E49, 0, 0, 0,0x4E4A, 0, 0, + 0,0x4E4B, 0,0x4E4C,0x4E4D, 0,0x4E4E, 0, + 0, 0, 0, 0,0x4E4F, 0, 0, 0, + 0,0x4E50, 0, 0, 0, 0, 0, 0, +0x4E51, 0, 0, 0, 0, 0,0x4E52, 0, +0x4E53, 0, 0, 0,0x4E54, 0, 0, 0, +0x4E55,0x4E56, 0, 0, 0, 0,0x4E57, 0, + 0,0x4E58, 0, 0,0x4E59, 0, 0, 0, +0x4E5A, 0, 0, 0, 0, 0,0x4E5B, 0, + 0, 0,0x4E5C, 0, 0, 0,0x4E5D, 0, + 0, 0,0x4E5E, 0,0x4E5F,0x4E60, 0,0x4E61, + 0,0x4E62,0x4E63, 0,0x4E64, 0, 0, 0, + 0, 0,0x4E65, 0, 0, 0, 0, 0, +0x4E66, 0, 0, 0, 0,0x4E67,0x4E68,0x4E69, + 0, 0, 0, 0,0x4E6A,0x4E6B,0x4E6C, 0, + 0,0x4E6D, 0, 0, 0,0x4E6E,0x4E6F, 0, + 0, 0,0x4E70, 0, 0,0x4E71,0x4E72, 0, + 0, 0,0x4E73, 0, 0,0x4E74,0x4E75,0x4E76, + 0, 0,0x4E77, 0, 0, 0,0x4E78,0x4E79, + 0, 0, 0, 0,0x4E7A, 0,0x4E7B,0x4E7C, +0x4E7D, 0,0x4E7E, 0,0x4F21, 0, 0,0x4F22, + 0, 0,0x4F23, 0,0x4F24, 0, 0, 0, +0x4F25, 0,0x4F26,0x4F27,0x4F28, 0, 0, 0, + 0, 0,0x4F29, 0, 0,0x4F2A, 0, 0, +0x4F2B, 0, 0, 0,0x4F2C, 0, 0, 0, + 0, 0, 0, 0,0x4F2D,0x4F2E, 0, 0, + 0, 0, 0, 0,0x4F2F,0x4F30,0x4F31, 0, + 0, 0,0x4F32, 0, 0, 0, 0,0x4F33, + 0, 0,0x4F34, 0, 0, 0, 0,0x4F35, + 0, 0,0x4F36, 0, 0, 0,0x4F37,0x4F38, + 0,0x4F39, 0, 0, 0,0x4F3A, 0, 0, + 0, 0, 0, 0, 0, 0,0x4F3B, 0, + 0, 0, 0,0x4F3C, 0, 0, 0, 0, + 0,0x4F3D, 0, 0, 0, 0, 0, 0, + 0,0x4F3E,0x4F3F, 0, 0,0x4F40, 0, 0, + 0,0x4F41, 0, 0, 0, 0,0x4F42,0x4F43, +0x4F44, 0, 0, 0,0x4F45, 0,0x4F46, 0, + 0, 0,0x4F47, 0,0x4F48, 0, 0, 0, +0x4F49,0x4F4A, 0, 0,0x4F4B, 0, 0, 0, +0x4F4C, 0, 0,0x4F4D, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4F4E,0x4F4F, 0, + 0,0x4F50, 0, 0, 0,0x4F51,0x4F52, 0, + 0,0x4F53, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4F54, 0, 0, + 0,0x4F55,0x4F56,0x4F57, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x4F58,0x4F59, 0, +0x4F5A, 0, 0, 0, 0,0x4F5B, 0,0x4F5C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x4F5D,0x4F5E, 0, 0,0x4F5F, +0x4F60, 0, 0, 0,0x4F61, 0,0x4F62, 0, + 0, 0,0x4F63, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x4F64, 0,0x4F65, 0, +0x4F66,0x4F67, 0,0x4F68,0x4F69, 0, 0, 0, +0x4F6A, 0,0x4F6B, 0, 0, 0,0x4F6C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4F6D, 0, 0, 0,0x4F6E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x4F6F, 0, 0, 0, 0,0x4F70, + 0, 0, 0, 0,0x4F71, 0, 0, 0, +0x4F72, 0, 0, 0, 0,0x4F74,0x4F75,0x4F76, + 0,0x4F73, 0, 0,0x4F77, 0, 0, 0, +0x4F78, 0, 0, 0,0x4F79,0x4F7A, 0, 0, +0x4F7B,0x4F7C,0x4F7D,0x4F7E, 0, 0, 0, 0, + 0, 0, 0,0x5021, 0,0x5022, 0,0x5023, + 0, 0, 0, 0, 0, 0, 0,0x5024, +0x5025,0x5026, 0, 0,0x5027, 0,0x5028, 0, + 0, 0,0x5029,0x502A, 0,0x502B,0x502C, 0, + 0, 0, 0,0x502E, 0, 0, 0,0x502F, +0x5030,0x5031, 0, 0,0x502D, 0,0x5032, 0, + 0, 0,0x5033, 0, 0, 0, 0, 0, + 0, 0,0x5034,0x5035, 0, 0,0x5037,0x5038, + 0, 0,0x5039,0x503A, 0, 0, 0,0x503B, +0x5036, 0, 0, 0, 0, 0,0x503C, 0, + 0, 0, 0, 0,0x503D, 0, 0, 0, +0x503E, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x503F, 0,0x5040, 0,0x5041,0x5042, +0x5043, 0, 0, 0, 0,0x5044, 0,0x5045, + 0,0x5046, 0, 0, 0,0x5047, 0, 0, + 0,0x5048, 0, 0,0x5049,0x504A, 0, 0, + 0, 0, 0,0x504B, 0,0x504C, 0,0x504D, + 0, 0, 0, 0,0x504E,0x504F,0x5050, 0, + 0, 0,0x5051,0x5052, 0, 0, 0,0x5053, + 0,0x5054, 0, 0,0x5055, 0, 0, 0, +0x5056, 0, 0,0x5057,0x5058, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5059, + 0,0x505A, 0,0x505B, 0, 0, 0, 0, + 0, 0,0x505C, 0, 0, 0, 0, 0, + 0,0x505D, 0,0x505E,0x505F, 0,0x5060, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5061,0x5062, 0, 0, 0, + 0,0x5063, 0,0x5064,0x5065,0x5066,0x5067, 0, +0x5068, 0, 0,0x5069,0x506A, 0, 0, 0, + 0,0x506B, 0, 0, 0, 0, 0, 0, +0x506C,0x506D, 0,0x506E, 0, 0, 0,0x506F, + 0,0x5070, 0, 0,0x5071, 0, 0, 0, +0x5072, 0, 0,0x5073, 0, 0, 0, 0, + 0, 0,0x5074, 0,0x5075, 0, 0,0x5076, +0x5077, 0,0x5078, 0, 0, 0, 0,0x5079, + 0, 0, 0, 0,0x507A, 0,0x507B, 0, + 0, 0,0x507C, 0, 0,0x507D,0x507E, 0, +0x5121, 0,0x5122, 0, 0,0x5123, 0, 0, + 0, 0,0x5124,0x5125, 0,0x5126, 0, 0, + 0,0x5127, 0, 0, 0, 0, 0, 0, +0x5128, 0, 0, 0,0x5129, 0, 0, 0, + 0, 0,0x512A,0x512B, 0, 0, 0,0x512C, + 0,0x512D,0x512E, 0,0x512F, 0, 0, 0, + 0,0x5130, 0, 0, 0,0x5131, 0, 0, + 0, 0, 0,0x5132, 0, 0,0x5133, 0, + 0,0x5134, 0, 0, 0, 0, 0,0x5135, + 0, 0, 0,0x5136, 0,0x5137, 0,0x5138, +0x5139, 0, 0, 0,0x513A,0x513B, 0, 0, +0x513C,0x513D,0x513E, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x513F,0x5140, 0,0x5141, +0x5142, 0, 0, 0,0x5143, 0, 0, 0, + 0, 0, 0, 0, 0,0x5144,0x5145, 0, + 0,0x5146, 0, 0,0x5147,0x5148, 0,0x5149, +0x514A, 0, 0, 0, 0,0x514B, 0,0x514C, + 0, 0,0x514D, 0, 0,0x514E, 0, 0, + 0, 0, 0, 0, 0,0x514F, 0, 0, +0x5150, 0, 0, 0, 0, 0,0x5151, 0, +0x5152, 0,0x5153, 0, 0,0x5154,0x5155, 0, + 0, 0,0x5156,0x5157, 0, 0, 0, 0, +0x5158,0x5159, 0, 0,0x515A, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x515B, 0, +0x515C, 0, 0,0x515D, 0, 0, 0, 0, + 0, 0, 0, 0,0x515E, 0, 0, 0, + 0, 0, 0,0x515F, 0,0x5160, 0, 0, + 0,0x5161, 0,0x5162,0x5163, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5164, 0, + 0,0x5165, 0, 0,0x5166, 0,0x5167, 0, + 0,0x5168, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5169, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x516A,0x516B, 0,0x516C,0x516D, 0, 0, 0, + 0,0x516E, 0, 0,0x516F, 0, 0, 0, + 0, 0, 0,0x5170, 0,0x5171,0x5172, 0, + 0, 0, 0, 0, 0, 0, 0,0x5173, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5174, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5175, + 0, 0, 0,0x5176, 0, 0, 0,0x5177, + 0,0x5178,0x5179,0x517A, 0,0x517B,0x517C,0x517D, +0x517E,0x5221, 0, 0,0x5222, 0, 0, 0, + 0, 0, 0, 0, 0,0x5223, 0,0x5224, +0x5225,0x5226, 0, 0, 0, 0, 0,0x5227, + 0, 0, 0, 0, 0, 0,0x5228, 0, + 0, 0, 0, 0, 0,0x5229, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x522A, 0, 0, 0,0x522B, 0,0x522C, 0, + 0,0x522D,0x522E, 0, 0,0x522F, 0,0x5230, + 0, 0,0x5231,0x5232, 0, 0, 0,0x5233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5234, 0, 0, 0, + 0,0x5235, 0, 0, 0, 0,0x5236, 0, +0x5237,0x5238, 0, 0, 0, 0,0x5239, 0, + 0, 0, 0,0x523A, 0, 0,0x523B, 0, +0x523C, 0, 0, 0, 0,0x523D, 0, 0, + 0, 0, 0, 0,0x523E, 0, 0,0x523F, +0x5240, 0,0x5241, 0, 0,0x5242,0x5243, 0, + 0, 0,0x5244,0x5245,0x5246,0x5247, 0, 0, + 0, 0,0x5248, 0, 0,0x5249, 0, 0, +0x524A, 0,0x524B, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x524C, 0,0x524D,0x524E, + 0,0x524F,0x5250,0x5251, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5252, 0,0x5253, 0, 0, 0, 0, 0, + 0, 0,0x5254, 0,0x5255,0x5256, 0, 0, +0x5257,0x5258,0x5259, 0,0x525A, 0,0x525B, 0, + 0,0x525C,0x525D,0x525E,0x525F, 0,0x5260, 0, + 0,0x5261, 0,0x5262,0x5263, 0,0x5264,0x5265, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5266, 0,0x5267, 0, 0, 0, 0, +0x5268, 0, 0, 0, 0,0x5269,0x526A, 0, +0x526B, 0, 0, 0,0x526C, 0, 0, 0, + 0,0x526D, 0,0x526E,0x526F, 0,0x5270, 0, + 0,0x5271,0x5272, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5273, 0, + 0, 0,0x5274, 0, 0, 0, 0, 0, + 0,0x5276,0x5277,0x5278, 0,0x5275, 0, 0, + 0,0x5279,0x527A,0x527B,0x527C,0x527D,0x527E, 0, + 0,0x5321, 0,0x5322, 0, 0, 0,0x5323, + 0,0x5324, 0, 0, 0,0x5325,0x5326, 0, +0x5327, 0,0x5328, 0, 0, 0, 0, 0, + 0,0x5329, 0, 0,0x532A,0x532B, 0, 0, + 0, 0, 0, 0, 0, 0,0x532C,0x532D, + 0, 0, 0, 0, 0, 0, 0,0x532E, + 0, 0, 0, 0,0x532F, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5330, 0, +0x5331, 0, 0, 0, 0, 0,0x5332, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5333, 0, 0, 0, 0, 0,0x5334,0x5335, + 0, 0,0x5336,0x5337,0x5338, 0, 0,0x5339, + 0, 0, 0, 0,0x533A, 0, 0,0x533B, +0x533C,0x533D, 0, 0, 0,0x533E, 0,0x533F, + 0, 0, 0,0x5340,0x5341,0x5342, 0,0x5343, + 0,0x5344,0x5345, 0, 0,0x5346, 0, 0, + 0, 0, 0, 0, 0, 0,0x5347, 0, + 0,0x5348, 0,0x5349, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x534A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x534B, 0, 0, 0,0x534C, +0x534D,0x534E, 0, 0, 0, 0, 0,0x534F, + 0,0x5350,0x5351,0x5352, 0, 0,0x5353, 0, + 0, 0, 0, 0, 0,0x5354,0x5355, 0, + 0, 0, 0,0x5356, 0, 0,0x5357, 0, + 0, 0,0x5358, 0, 0,0x5359, 0, 0, + 0,0x535A, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x535B,0x535C,0x535D, 0, +0x535E,0x535F, 0, 0, 0, 0, 0,0x5360, +0x5361, 0, 0, 0, 0,0x5362, 0, 0, + 0,0x5363, 0,0x5364, 0, 0, 0,0x5365, + 0,0x5366,0x5367, 0,0x5368,0x5369, 0, 0, + 0, 0, 0, 0, 0,0x536A, 0,0x536B, + 0, 0,0x536C, 0, 0, 0, 0, 0, +0x536D, 0, 0, 0, 0, 0, 0, 0, +0x536E, 0,0x536F,0x5370, 0, 0, 0,0x5371, + 0,0x5372,0x5373,0x5374, 0,0x5375,0x5376, 0, +0x5377, 0, 0,0x5378,0x5379,0x537A, 0, 0, + 0,0x537B, 0, 0, 0, 0,0x537C,0x537D, + 0, 0, 0, 0, 0,0x537E,0x5421, 0, + 0, 0, 0, 0, 0, 0,0x5422,0x5423, + 0, 0,0x5424, 0, 0, 0, 0, 0, + 0, 0, 0,0x5425, 0, 0,0x5426,0x5427, + 0,0x5428, 0, 0, 0, 0, 0, 0, + 0, 0,0x5429,0x542A,0x542B,0x542C,0x542D, 0, + 0, 0, 0, 0,0x542E,0x542F,0x5430, 0, + 0, 0, 0, 0, 0, 0, 0,0x5431, + 0,0x5432, 0, 0, 0, 0, 0, 0, + 0, 0,0x5434, 0, 0,0x5435,0x5436, 0, + 0, 0,0x5437,0x5438, 0,0x5439, 0, 0, + 0,0x543A, 0, 0, 0,0x543B,0x543C, 0, + 0,0x543D,0x543E, 0, 0, 0, 0, 0, +0x5433, 0, 0, 0, 0, 0, 0, 0, +0x543F, 0, 0, 0, 0, 0, 0, 0, +0x5440,0x5441, 0, 0, 0,0x5442, 0,0x5443, + 0, 0, 0, 0,0x5444,0x5445, 0, 0, +0x5446, 0, 0, 0, 0, 0, 0,0x5447, +0x5448, 0, 0, 0,0x5449,0x544A, 0,0x544B, + 0, 0, 0,0x544C, 0, 0,0x544D, 0, + 0, 0, 0, 0, 0, 0, 0,0x544E, + 0, 0, 0, 0,0x544F,0x5450, 0,0x5451, + 0, 0, 0, 0, 0, 0,0x5452, 0, +0x5453, 0,0x5454, 0, 0, 0, 0, 0, +0x5455, 0, 0, 0, 0, 0, 0,0x5456, + 0,0x5457,0x5458, 0, 0,0x5459, 0, 0, + 0, 0, 0,0x545A, 0, 0,0x545B,0x545C, + 0, 0, 0,0x545D, 0, 0, 0, 0, +0x545E, 0, 0, 0, 0, 0,0x545F, 0, + 0,0x5460, 0, 0, 0, 0,0x5461,0x5462, + 0, 0,0x5463, 0, 0,0x5464, 0, 0, + 0,0x5465, 0, 0, 0,0x5466, 0, 0, +0x5467, 0,0x5468, 0, 0,0x5469,0x546A}; + +/* page 27 0x7F3B-0x8044 */ +static uint16 tab_uni_jisx021227[]={ +0x546C,0x546B,0x546D,0x546E,0x546F, 0, 0, 0, +0x5470,0x5471, 0, 0,0x5472, 0, 0, 0, + 0, 0, 0, 0,0x5473, 0, 0,0x5474, +0x5475, 0, 0, 0, 0, 0, 0, 0, +0x5476,0x5477,0x5478, 0, 0, 0,0x5479, 0, +0x547A,0x547B,0x547C,0x547D, 0, 0, 0, 0, + 0, 0,0x547E, 0, 0, 0,0x5521, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5522,0x5523,0x5524,0x5525, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5526, 0,0x5527, 0,0x5528,0x5529,0x552A, 0, + 0, 0, 0,0x552B,0x552C, 0, 0, 0, + 0,0x552D, 0, 0, 0, 0,0x552E,0x552F, + 0, 0, 0,0x5530, 0, 0, 0,0x5531, + 0, 0,0x5532, 0, 0, 0, 0, 0, + 0,0x5533, 0, 0, 0, 0, 0, 0, + 0,0x5534, 0, 0,0x5535,0x5536, 0, 0, +0x5537, 0, 0, 0, 0,0x5538, 0, 0, + 0, 0, 0,0x5539,0x553A, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x553B, 0, 0, 0,0x553C, 0, 0, 0, +0x553D, 0,0x553E, 0, 0,0x553F, 0, 0, + 0,0x5540, 0,0x5541,0x5542, 0, 0,0x5543, + 0, 0, 0, 0, 0, 0, 0,0x5544, + 0, 0,0x5545,0x5546,0x5547, 0, 0, 0, + 0, 0, 0, 0,0x5548,0x5549, 0,0x554A, + 0, 0,0x554B,0x554C,0x554D, 0,0x554E, 0, +0x554F,0x5550, 0,0x5551, 0, 0, 0, 0, + 0, 0,0x5552,0x5553,0x5554,0x5555, 0, 0, + 0,0x5556, 0,0x5557, 0, 0, 0, 0, + 0,0x5558, 0,0x5559, 0,0x555A, 0, 0, + 0,0x555B,0x555C, 0,0x555D, 0,0x555E,0x555F, + 0,0x5560, 0,0x5561, 0,0x5562, 0, 0, + 0,0x5563}; + +/* page 28 0x8060-0x8357 */ +static uint16 tab_uni_jisx021228[]={ +0x5564, 0, 0, 0,0x5565, 0,0x5566, 0, + 0, 0, 0, 0, 0,0x5567, 0, 0, + 0,0x5568, 0, 0, 0,0x5569, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x556A, 0, 0, 0, 0, 0, 0, +0x556B, 0, 0, 0, 0, 0,0x556C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x556D, 0,0x556E, 0, + 0, 0, 0, 0, 0, 0,0x556F,0x5570, + 0, 0, 0,0x5571, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5572,0x5573, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5574, 0, 0, 0, 0,0x5575, 0,0x5576, + 0, 0,0x5577, 0,0x5578,0x5579, 0,0x557A, +0x557B, 0, 0, 0, 0, 0, 0, 0, +0x557C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x557D,0x557E, 0, +0x5621, 0,0x5622,0x5623, 0, 0,0x5624, 0, + 0,0x5625,0x5626, 0, 0, 0,0x5627, 0, + 0, 0, 0,0x5628, 0, 0, 0, 0, + 0, 0, 0,0x5629, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x562A,0x562B, +0x562C, 0, 0, 0,0x562D, 0,0x562E, 0, +0x562F, 0, 0, 0,0x5630, 0, 0,0x5631, + 0, 0, 0, 0,0x5632, 0, 0, 0, +0x5633, 0, 0, 0, 0,0x5634, 0, 0, + 0, 0,0x5635, 0,0x5636, 0, 0, 0, + 0, 0, 0, 0, 0,0x5637, 0,0x5638, + 0, 0,0x5639, 0,0x563A, 0, 0, 0, + 0, 0,0x563B, 0, 0, 0, 0,0x563C, + 0, 0, 0, 0, 0, 0, 0, 0, +0x563D,0x563E, 0, 0, 0, 0, 0,0x563F, +0x5640,0x5641, 0, 0, 0,0x5642, 0,0x5643, + 0, 0, 0, 0, 0, 0, 0,0x5644, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5645, 0, 0,0x5647,0x5648,0x5649, 0, + 0, 0, 0,0x564A, 0, 0,0x564B, 0, +0x5646, 0, 0, 0, 0, 0,0x564C, 0, +0x564D, 0, 0,0x564E, 0, 0,0x564F, 0, + 0, 0,0x5650, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5651, 0, + 0, 0,0x5652, 0,0x5653, 0, 0, 0, + 0, 0, 0,0x5654, 0, 0, 0, 0, + 0, 0, 0,0x5656, 0,0x5657, 0, 0, + 0, 0,0x5658,0x5655, 0, 0,0x5659,0x565A, + 0, 0, 0, 0, 0,0x565B, 0,0x565C, + 0, 0, 0,0x565D, 0,0x565E,0x565F, 0, + 0,0x5660, 0, 0,0x5661, 0, 0, 0, + 0, 0, 0,0x5662,0x5663, 0, 0, 0, +0x5664,0x5665,0x5666, 0, 0,0x5667,0x5668, 0, +0x5669,0x566A, 0, 0, 0,0x566B, 0,0x566C, +0x566D, 0, 0,0x566E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x566F, + 0, 0, 0,0x5670,0x5671, 0, 0, 0, + 0,0x5672,0x5673, 0, 0,0x5674, 0, 0, + 0,0x5675,0x5676, 0, 0, 0, 0, 0, +0x5677, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5678, 0,0x5679, 0, 0, 0, + 0, 0,0x567A, 0, 0, 0, 0, 0, + 0, 0, 0,0x567B,0x567C,0x567D,0x567E, 0, + 0, 0, 0,0x5721, 0, 0,0x5722,0x5723, + 0,0x5724, 0, 0, 0, 0,0x5725, 0, + 0, 0, 0, 0,0x5726, 0, 0, 0, +0x5727, 0, 0,0x5728, 0, 0, 0,0x5729, + 0, 0, 0, 0, 0,0x572A, 0, 0, + 0, 0, 0, 0,0x572B, 0, 0, 0, + 0, 0, 0,0x572C, 0,0x572D, 0,0x572E, +0x572F,0x5730, 0,0x5731,0x5732, 0, 0,0x5733, + 0,0x5734,0x5735, 0, 0, 0,0x5736, 0, + 0,0x5737, 0, 0,0x5738, 0,0x5739, 0, +0x573A, 0,0x573B,0x573C, 0, 0, 0, 0, +0x573D,0x573E, 0,0x573F,0x5740, 0, 0,0x5741, +0x5742,0x5743,0x5744, 0, 0, 0,0x5745, 0, +0x5746, 0,0x5747, 0,0x5748, 0, 0,0x5749, + 0, 0,0x574A, 0,0x574B, 0,0x574C,0x574D, + 0, 0, 0, 0, 0, 0,0x574E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x574F, 0, 0, 0, 0,0x5750, 0, 0, + 0, 0,0x5751, 0, 0, 0, 0, 0, +0x5752, 0,0x5753, 0,0x5754, 0, 0, 0, +0x5755, 0,0x5756, 0, 0,0x5757, 0,0x5758, + 0, 0, 0, 0, 0, 0,0x5759,0x575A, + 0, 0, 0, 0, 0,0x575B,0x575C, 0, +0x575D,0x575E, 0, 0, 0, 0, 0,0x575F, +0x5760, 0,0x5761,0x5762, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5764, 0,0x5765,0x5766,0x5767, + 0,0x5768,0x5769, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x576A,0x576B,0x576C, 0, +0x576D, 0, 0,0x576E, 0, 0, 0,0x576F, + 0, 0,0x5770, 0,0x5771,0x5772, 0, 0, + 0, 0,0x5773,0x5774,0x5775, 0, 0,0x5776, + 0, 0, 0, 0, 0,0x5777,0x5778, 0, + 0,0x5779, 0,0x583E,0x5763,0x577A,0x577B,0x577C +}; + +/* page 29 0x8370-0x8419 */ +static uint16 tab_uni_jisx021229[]={ +0x577D, 0, 0, 0, 0, 0, 0, 0, +0x577E, 0, 0, 0, 0,0x5821, 0,0x5822, +0x5823, 0,0x5824, 0,0x5825, 0,0x5826, 0, + 0, 0, 0, 0, 0,0x5827, 0, 0, + 0, 0,0x5828, 0,0x5829,0x582A, 0, 0, +0x582B,0x582C, 0,0x582D,0x582E,0x582F, 0, 0, + 0, 0, 0, 0, 0, 0,0x5830,0x5831, + 0,0x5832, 0, 0,0x5833,0x584C, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5834,0x5835, +0x5836, 0, 0, 0, 0, 0, 0,0x5837, + 0,0x5838, 0, 0, 0, 0, 0,0x5839, +0x583A,0x583B, 0, 0,0x583C, 0, 0, 0, + 0, 0, 0, 0, 0,0x583D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x583F, 0,0x5840, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x5841, 0, +0x5842,0x5843, 0, 0,0x5844, 0, 0, 0, + 0,0x5845, 0, 0, 0, 0,0x5846, 0, + 0, 0,0x5847, 0, 0, 0, 0,0x5848, + 0,0x5849, 0, 0, 0,0x584A, 0, 0, + 0,0x584B}; + +/* page 30 0x842F-0x8880 */ +static uint16 tab_uni_jisx021230[]={ +0x584D, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x584E, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x584F, 0, +0x5850,0x5851, 0,0x5852, 0, 0,0x5853, 0, +0x5854, 0,0x5855,0x5856, 0, 0, 0,0x5857, + 0,0x5858,0x5859,0x585A, 0,0x585B, 0, 0, + 0,0x585C, 0, 0, 0,0x585D,0x585E, 0, +0x585F, 0, 0,0x5860, 0, 0, 0, 0, + 0,0x5861, 0, 0,0x5862,0x5863, 0,0x5864, + 0,0x5865, 0, 0, 0,0x5866,0x5867, 0, + 0, 0,0x5868, 0, 0, 0,0x5869, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x586A,0x586B, 0,0x586C, 0, + 0, 0, 0, 0, 0, 0, 0,0x586D, + 0, 0, 0, 0, 0, 0, 0,0x586E, + 0,0x586F,0x5870,0x5871, 0, 0, 0, 0, +0x5872, 0,0x5873, 0, 0,0x5874, 0, 0, + 0, 0, 0,0x5875, 0, 0,0x5876,0x5877, + 0,0x5878, 0,0x5879, 0, 0, 0, 0, +0x587A,0x587B, 0, 0, 0,0x587C, 0, 0, +0x587D, 0, 0, 0,0x587E, 0, 0, 0, + 0, 0, 0, 0, 0,0x5921, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5922, 0, 0,0x5923, 0, 0, 0, 0, +0x5924,0x5925,0x5926,0x5927, 0, 0, 0, 0, +0x5928, 0, 0,0x592A,0x592B, 0,0x592C, 0, + 0, 0, 0,0x592D,0x592E, 0, 0, 0, +0x592F, 0, 0, 0, 0,0x5930, 0,0x5931, + 0,0x5932, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x5933, 0,0x5934, + 0, 0, 0,0x5935,0x5936,0x5937,0x5938, 0, +0x5939, 0, 0,0x593A,0x593B, 0, 0, 0, +0x593C, 0, 0,0x5929,0x593D,0x593E, 0,0x593F, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5940, 0, 0, 0, 0, 0, 0,0x5941, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5942,0x5943,0x5944,0x5945,0x5946, 0, 0,0x5947, + 0, 0,0x5948, 0, 0,0x5949,0x594A,0x594B, +0x594C,0x594D,0x594E,0x594F, 0,0x5950, 0, 0, + 0, 0, 0, 0,0x5951, 0, 0, 0, +0x5952, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5953,0x5954,0x5955, 0,0x5956, 0, +0x5957, 0,0x5958, 0, 0, 0,0x5959,0x595A, + 0, 0,0x595B, 0,0x595C,0x595D, 0, 0, +0x595E, 0, 0, 0,0x595F, 0, 0, 0, + 0,0x5960, 0, 0, 0, 0,0x5961, 0, +0x5962,0x5963, 0,0x5964, 0, 0,0x5965, 0, +0x5966, 0, 0, 0, 0, 0,0x5974, 0, + 0, 0, 0, 0, 0,0x5967, 0,0x5968, +0x5969,0x596A, 0, 0, 0,0x596B,0x596C,0x596D, +0x596E, 0, 0,0x596F, 0, 0, 0, 0, +0x5970, 0, 0,0x5971,0x5972, 0, 0,0x5973, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5975, 0,0x5976, 0, 0, 0, 0, +0x5977,0x5978, 0, 0, 0, 0, 0,0x5979, + 0,0x597A, 0, 0, 0, 0,0x597B, 0, + 0, 0, 0, 0,0x597C, 0, 0,0x597D, + 0, 0, 0, 0, 0,0x597E, 0, 0, +0x5A21,0x5A22, 0, 0, 0,0x5A23,0x5A24, 0, + 0, 0, 0, 0, 0, 0,0x5A25,0x5A26, + 0,0x5A27,0x5A28,0x5A29, 0, 0, 0, 0, + 0,0x5A2A,0x5A2B, 0,0x5A2C, 0, 0,0x5A2D, + 0, 0,0x5A2E, 0, 0, 0, 0, 0, +0x5A2F, 0,0x5A30, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5A31, + 0,0x5A32, 0,0x5A33, 0,0x5A34,0x5A35, 0, + 0,0x5A36,0x3866,0x5A37, 0, 0, 0,0x5A38, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5A39,0x5A3A, 0, 0,0x5A3B, +0x5A3C,0x5A3D,0x5A3E, 0, 0, 0,0x5A3F, 0, + 0,0x5A40,0x5A41,0x5A42,0x5A43,0x5A44, 0, 0, + 0, 0,0x5A45, 0, 0,0x5A46, 0, 0, +0x5A47, 0, 0, 0, 0, 0,0x5A48,0x5A49, +0x5A4A, 0, 0,0x5A4B, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5A6D, 0, 0, 0, 0,0x5A4C, 0, + 0, 0,0x5A4D, 0, 0, 0, 0,0x5A4E, + 0,0x5A4F, 0,0x5A50, 0,0x5A51, 0, 0, + 0, 0,0x5A52, 0, 0, 0, 0,0x5A53, +0x5A54,0x5A55, 0, 0, 0, 0,0x5A56, 0, + 0, 0,0x5A57, 0,0x5A58,0x5A59,0x5A5A, 0, +0x5A5B,0x5A5C,0x5A5D, 0, 0, 0, 0, 0, +0x5A5E,0x5A5F,0x5A60, 0,0x5A61, 0,0x5A62, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5A63,0x5A64, 0, 0,0x5A65, 0, +0x5A66, 0, 0,0x5A67, 0,0x5A68, 0, 0, + 0,0x5A69, 0, 0,0x5A6A, 0,0x5A6B, 0, +0x5A6C, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5A6E, 0,0x5A6F,0x5A70, 0, + 0, 0, 0, 0, 0,0x5A71,0x5A72, 0, +0x5A73, 0, 0, 0,0x5A74, 0, 0,0x5A75, +0x5A76,0x5A77, 0, 0,0x5A78,0x5A79, 0, 0, + 0, 0,0x5A7A, 0, 0, 0, 0,0x5A7B, +0x5A7C, 0,0x5A7D, 0,0x5A7E, 0, 0, 0, + 0,0x5B21, 0, 0, 0, 0, 0,0x5B22, +0x5B23, 0,0x5B24,0x5B25, 0, 0, 0, 0, + 0, 0,0x5B26,0x5B27, 0,0x5B28,0x5B29,0x5B2A, + 0,0x5B2B, 0, 0,0x5B2C, 0,0x5B2D, 0, + 0, 0, 0, 0, 0, 0,0x5B2E, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B2F, 0, 0, 0, 0,0x5B30, 0, + 0, 0,0x5B31, 0, 0,0x5B32,0x5B33, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5B34, 0,0x5B35,0x5B36, 0, 0, 0, 0, + 0, 0, 0, 0,0x5B37, 0, 0, 0, + 0, 0, 0, 0,0x5B38,0x5B39,0x5B3A,0x5B3B, +0x5B3C,0x5B3D,0x5B3E, 0,0x5B3F,0x5B40, 0, 0, + 0,0x5B41, 0, 0,0x5B42, 0,0x5B43, 0, +0x5B44,0x5B45,0x5B46, 0, 0, 0, 0,0x5B47, + 0,0x5B48, 0, 0,0x5B49, 0, 0, 0, +0x5B4A, 0, 0, 0, 0,0x5B4B,0x5B4C,0x5B4D, + 0, 0,0x5B4E, 0, 0, 0,0x5B4F, 0, + 0, 0, 0, 0, 0, 0, 0,0x5B50, +0x5B51, 0,0x5B52, 0, 0, 0, 0, 0, + 0,0x5B53,0x5B54,0x5B55, 0, 0, 0,0x5B56, + 0, 0, 0, 0, 0, 0,0x5B57,0x5B58, + 0, 0,0x5B59,0x5B5A, 0,0x5B5B, 0, 0, +0x5B5C, 0, 0,0x5B5D,0x5B5E,0x5B5F, 0, 0, + 0, 0, 0,0x5B60,0x5B61, 0,0x5B62, 0, + 0, 0,0x5B63, 0,0x5B64, 0, 0, 0, + 0,0x5B65, 0,0x5B66, 0, 0, 0, 0, +0x5B67, 0,0x5B68, 0,0x5B69, 0, 0,0x5B6A, + 0, 0,0x5B6B,0x5B6C,0x5B6D, 0, 0, 0, + 0,0x5B6E, 0,0x5B70,0x5B71,0x5B72, 0, 0, + 0,0x5B73,0x5B6F,0x5B74,0x5B75,0x5B76, 0,0x5B77, +0x5B78, 0, 0, 0, 0, 0, 0, 0, + 0,0x5B79, 0, 0, 0, 0,0x5B7A,0x5B7B, + 0,0x5B7C, 0,0x5B7D, 0, 0,0x5B7E, 0, + 0, 0, 0,0x5C21, 0,0x5C22, 0, 0, + 0, 0,0x5C23, 0,0x5C24, 0,0x5C25, 0, + 0,0x5C26,0x5C27,0x5C28,0x5C29, 0, 0,0x5C2A, + 0, 0,0x5C2B, 0, 0, 0,0x5C2C,0x5C2D, + 0,0x5C2E, 0,0x5C2F, 0,0x5C30, 0, 0, +0x5C31,0x5C32, 0, 0, 0,0x5C33, 0, 0, + 0, 0,0x5C34, 0, 0, 0, 0, 0, + 0, 0,0x5C35, 0, 0, 0, 0, 0, + 0, 0,0x5C36, 0,0x5C37, 0, 0, 0, + 0,0x5C38}; + +/* page 31 0x8898-0x89BC */ +static uint16 tab_uni_jisx021231[]={ +0x5C39, 0,0x5C3A,0x5C3B,0x5C3C, 0, 0,0x5C3D, +0x5C3E, 0, 0, 0, 0, 0, 0, 0, +0x5C3F, 0,0x5C40, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5C41, 0, 0,0x5C42,0x5C43, 0, +0x5C44, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5C45,0x5C46,0x5C47,0x5C48,0x5C49, 0, + 0,0x5C4A,0x5C4B,0x5C4C, 0, 0, 0, 0, + 0, 0, 0,0x5C4D, 0, 0,0x5C4E, 0, + 0, 0, 0, 0, 0, 0, 0,0x5C4F, + 0, 0, 0, 0, 0, 0, 0,0x5C50, +0x5C51,0x5C52, 0, 0, 0,0x5C53, 0,0x5C54, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5C55, 0, 0, 0, 0,0x5C56, 0, + 0, 0, 0, 0, 0,0x5C57,0x5C58,0x5C59, + 0, 0, 0, 0, 0,0x5C5A,0x5C5B, 0, +0x5C5C,0x5C5D,0x5C5E, 0,0x5C5F, 0, 0, 0, +0x5C60, 0, 0, 0, 0, 0,0x5C61,0x5C62, +0x5C63, 0, 0, 0, 0, 0, 0, 0, +0x5C64,0x5C65,0x5C66, 0, 0,0x5C67, 0, 0, + 0,0x5C68,0x5C69, 0, 0, 0,0x5C6A, 0, +0x5C6B, 0,0x5C6C, 0, 0,0x5C6D,0x5C6E, 0, + 0,0x5C6F, 0, 0, 0, 0, 0,0x5C70, + 0, 0,0x5C71, 0, 0, 0, 0,0x5C72, + 0, 0,0x5C73,0x5C74,0x5C75, 0, 0, 0, + 0,0x5C76,0x5C77,0x5C78, 0, 0, 0, 0, + 0, 0, 0,0x5C79, 0, 0,0x5C7A, 0, +0x5C7B, 0, 0,0x5C7C, 0,0x5C7D, 0, 0, + 0, 0,0x5C7E,0x5D21,0x5D22,0x5D23, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D24, 0, 0, 0,0x5D25, 0, 0, +0x5D26, 0, 0, 0,0x5D27,0x5D28, 0, 0, + 0, 0, 0,0x5D29,0x5D2A, 0, 0,0x5D2B, +0x5D2C, 0, 0, 0, 0,0x5D2D, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5D2E, 0, 0, 0,0x5D2F,0x5D30,0x5D31,0x5D32, + 0, 0, 0, 0,0x5D33}; + +/* page 32 0x89D4-0x8B9F */ +static uint16 tab_uni_jisx021232[]={ +0x5D34,0x5D35,0x5D36,0x5D37,0x5D38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D39, 0, 0, 0,0x5D3A, 0,0x5D3B, + 0,0x5D3C, 0, 0, 0,0x5D3D, 0,0x5D3E, + 0, 0,0x5D3F, 0, 0,0x5D40, 0, 0, + 0,0x5D41, 0,0x5D42, 0, 0, 0, 0, +0x5D43,0x5D44, 0,0x5D45, 0, 0, 0, 0, + 0, 0, 0,0x5D46, 0,0x5D47,0x5D48, 0, +0x5D49,0x5D4A, 0, 0, 0, 0, 0, 0, + 0, 0,0x5D4B, 0,0x5D4C, 0,0x5D4D, 0, +0x5D4E, 0,0x5D4F, 0, 0, 0, 0,0x5D50, +0x5D51, 0, 0,0x5D52, 0, 0, 0, 0, + 0,0x5D53, 0,0x5D54, 0, 0, 0, 0, + 0,0x5D55,0x5D56, 0,0x5D57, 0, 0,0x5D58, + 0,0x5D59, 0,0x5D5A, 0,0x5D5B, 0, 0, + 0,0x5D5C,0x5D5D, 0, 0, 0, 0,0x5D5E, + 0, 0,0x5D5F,0x5D60,0x5D61, 0, 0, 0, +0x5D62,0x5D63, 0, 0, 0,0x5D64, 0, 0, + 0,0x5D65, 0,0x5D66, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5D67,0x5D68,0x5D69, 0,0x5D6A,0x5D6B,0x5D6C, + 0, 0,0x5D6D,0x5D6E,0x5D6F, 0, 0,0x5D70, + 0, 0,0x5D71, 0, 0, 0, 0,0x5D72, + 0, 0, 0,0x5D73,0x5D74, 0,0x5D75, 0, + 0, 0,0x5D76,0x5D77, 0,0x5D78, 0, 0, + 0, 0, 0,0x5D79, 0, 0, 0, 0, + 0, 0, 0,0x5D7A, 0,0x5D7B, 0, 0, + 0, 0,0x5D7C,0x5D7D, 0, 0, 0,0x5D7E, + 0, 0,0x5E21,0x5E22, 0, 0, 0,0x5E23, + 0, 0,0x5E24, 0, 0, 0, 0,0x5E25, + 0, 0,0x5E26, 0,0x5E27,0x5E28,0x5E29, 0, + 0, 0, 0, 0, 0,0x5E2A, 0,0x5E2B, +0x5E2C,0x5E2D, 0,0x5E2E, 0, 0, 0, 0, + 0,0x5E2F, 0,0x5E30, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5E31, 0, 0, 0,0x5E32, 0, 0, 0, +0x5E33,0x5E34,0x5E35, 0, 0, 0, 0, 0, +0x5E36, 0, 0,0x5E37, 0, 0, 0, 0, + 0,0x5E38,0x5E39, 0, 0, 0,0x5E3F,0x5E3A, + 0, 0, 0, 0, 0,0x5E3B, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5E3C, 0,0x5E3D,0x5E3E, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E40, 0, 0,0x5E41, 0, 0, 0, + 0, 0, 0,0x5E42, 0, 0, 0, 0, +0x5E43, 0, 0, 0, 0, 0,0x5E44,0x5E45, +0x5E46,0x5E47,0x5E48, 0,0x5E49, 0, 0, 0, + 0,0x5E4E, 0, 0, 0, 0,0x5E4A,0x5E4B, +0x5E4C, 0, 0, 0, 0,0x5E4D, 0, 0, + 0, 0,0x5E4F, 0, 0, 0, 0,0x5E50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x5E51, 0, 0, 0, 0, 0, 0, + 0, 0,0x5E52, 0,0x5E53,0x5E54, 0, 0, +0x5E55, 0,0x5E56, 0, 0,0x5E57, 0, 0, +0x5E58,0x5E59, 0, 0, 0, 0, 0,0x5E5A, + 0,0x5E5B, 0,0x5E5C, 0, 0, 0, 0, +0x5E5D,0x5E5E, 0, 0, 0, 0, 0, 0, +0x5E5F, 0,0x5E60,0x5E61}; + +/* page 33 0x8C38-0x8CA4 */ +static uint16 tab_uni_jisx021233[]={ +0x5E62,0x5E63, 0, 0, 0,0x5E64,0x5E65, 0, + 0, 0, 0, 0, 0,0x5E66, 0,0x5E67, + 0,0x5E68, 0,0x5E69, 0, 0, 0,0x5E6A, + 0,0x5E6B, 0,0x5E6C,0x5E6D, 0, 0,0x5E6E, +0x5E6F,0x5E72, 0,0x5E70, 0,0x5E71, 0, 0, + 0, 0, 0,0x5E73,0x5E74, 0,0x5E75, 0, +0x5E76,0x5E77, 0, 0, 0,0x5E78, 0, 0, + 0, 0, 0,0x5E79, 0,0x5E7A,0x5E7B, 0, + 0, 0, 0,0x5E7C, 0, 0,0x5E7D, 0, + 0, 0, 0, 0, 0, 0,0x5E7E,0x5F21, + 0, 0, 0,0x5F22, 0, 0, 0, 0, +0x5F23, 0,0x5F24,0x5F25, 0, 0, 0, 0, + 0,0x5F26, 0,0x5F27,0x5F28, 0, 0, 0, + 0, 0, 0, 0,0x5F29}; + +/* page 34 0x8CB9-0x8D1B */ +static uint16 tab_uni_jisx021234[]={ +0x5F2A,0x5F2B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x5F2C,0x5F2D, 0, 0, +0x5F2E, 0,0x5F2F, 0, 0, 0,0x5F30, 0, + 0, 0, 0, 0,0x5F32,0x5F31, 0, 0, +0x5F33, 0, 0, 0,0x5F34, 0, 0, 0, +0x5F35, 0, 0, 0, 0, 0, 0,0x5F36, + 0, 0, 0,0x5F37, 0, 0,0x5F38,0x5F39, + 0,0x5F3A, 0, 0,0x5F3B, 0,0x5F3C,0x5F3D, + 0, 0, 0, 0, 0,0x5F3E,0x5F3F, 0, +0x5F40, 0,0x5F41, 0, 0, 0, 0, 0, +0x5F42, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F43, 0, 0, 0, 0,0x5F44, 0, + 0, 0,0x5F45}; + +/* page 35 0x8D65-0x8F65 */ +static uint16 tab_uni_jisx021235[]={ +0x5F46, 0, 0, 0,0x5F47, 0, 0,0x5F48, + 0,0x5F49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x5F4A, 0, 0,0x5F4B, 0,0x5F4C, + 0, 0, 0,0x5F4D, 0, 0, 0, 0, +0x5F4E, 0, 0,0x5F4F,0x5F50, 0, 0, 0, +0x5F51, 0, 0, 0, 0, 0, 0, 0, + 0,0x5F52,0x5F53,0x5F54, 0, 0, 0, 0, + 0,0x5F55, 0, 0, 0, 0,0x5F56,0x5F57, + 0, 0,0x5F58, 0, 0,0x5F59, 0, 0, +0x5F5A, 0,0x5F5B, 0,0x5F5C, 0,0x5F5D,0x5F6F, + 0, 0, 0,0x5F5E, 0, 0, 0, 0, +0x5F5F,0x5F60,0x5F61,0x5F62, 0,0x5F63, 0, 0, + 0,0x5F64, 0, 0,0x5F65, 0, 0,0x5F66, +0x5F67, 0,0x5F68, 0,0x5F69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x5F6A, +0x5F6B, 0,0x5F6C, 0, 0, 0, 0,0x5F6D, + 0, 0, 0,0x5F6E,0x5F70,0x5F71, 0,0x5F72, + 0, 0, 0, 0, 0, 0, 0, 0, +0x5F73, 0, 0, 0,0x5F74, 0, 0,0x5F75, +0x5F76,0x5F77, 0, 0, 0, 0,0x5F78, 0, + 0, 0, 0, 0,0x5F79, 0, 0,0x5F7A, + 0,0x5F7B, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x5F7C,0x5F7D,0x5F7E,0x6021, 0, + 0,0x6022,0x6023, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6024, 0,0x6025, 0, + 0,0x6026,0x6027,0x6028,0x6029, 0, 0, 0, +0x602A, 0, 0,0x602B,0x602C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x602D, 0, +0x602E,0x602F,0x6030, 0, 0, 0, 0,0x6031, + 0, 0, 0, 0, 0, 0,0x6032,0x6033, +0x6034,0x6035, 0, 0,0x6036,0x6037, 0, 0, + 0, 0, 0, 0,0x6038, 0, 0,0x6039, +0x603A, 0,0x603B,0x603C,0x603D, 0, 0, 0, + 0, 0, 0, 0,0x603E,0x603F,0x6040, 0, + 0, 0, 0, 0, 0,0x6041,0x6042, 0, + 0, 0, 0, 0,0x6043, 0, 0, 0, + 0, 0, 0,0x6044, 0,0x6045, 0, 0, +0x6046, 0, 0, 0, 0,0x6047,0x6048, 0, +0x6049,0x604A, 0, 0, 0,0x604B, 0, 0, + 0, 0,0x604C, 0,0x604D, 0, 0, 0, +0x604E,0x604F, 0, 0, 0, 0,0x6050, 0, +0x6051, 0, 0, 0, 0,0x6052,0x6053, 0, + 0, 0, 0,0x6054,0x6055, 0,0x6056,0x6057, + 0, 0,0x6058, 0, 0, 0, 0, 0, + 0, 0,0x6059, 0,0x605A, 0, 0,0x605B, + 0, 0, 0, 0, 0, 0, 0,0x605C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x605D, 0, 0, 0, 0, +0x6064,0x605E, 0,0x605F,0x6060, 0, 0, 0, + 0, 0,0x6061, 0,0x6062,0x6063, 0, 0, + 0, 0, 0,0x6065, 0,0x6066, 0, 0, + 0, 0,0x6067,0x6068, 0, 0, 0, 0, + 0, 0,0x6069,0x606A, 0, 0, 0, 0, + 0,0x606B,0x606C,0x606D, 0, 0, 0, 0, + 0,0x606E, 0,0x606F,0x6070, 0,0x6071, 0, +0x6072, 0,0x6073,0x6074, 0, 0, 0,0x6075, +0x6076,0x6077, 0, 0, 0, 0, 0,0x6078, +0x6079,0x607A,0x607B, 0, 0,0x607C, 0, 0, + 0, 0, 0,0x607D,0x607E, 0,0x6121, 0, + 0, 0,0x6122, 0, 0, 0, 0, 0, + 0, 0,0x6123, 0,0x6124,0x6125,0x6126,0x6127, +0x6128, 0, 0,0x6129, 0, 0, 0, 0, +0x612A,0x612B, 0, 0, 0, 0, 0, 0, +0x612C}; + +/* page 36 0x8F9D-0x9484 */ +static uint16 tab_uni_jisx021236[]={ +0x612D, 0, 0,0x612E,0x612F, 0, 0,0x6130, +0x6131,0x6132, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6133,0x6134, 0,0x6135, 0, 0, 0, 0, + 0,0x6136, 0,0x6137,0x6138, 0, 0, 0, + 0,0x6139, 0, 0, 0,0x613A,0x613B, 0, +0x613C, 0, 0,0x613D, 0,0x613E,0x613F, 0, +0x6140, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6141, 0, 0,0x6142,0x6143, + 0, 0, 0,0x6144, 0, 0, 0, 0, + 0,0x6145, 0, 0,0x6146, 0, 0, 0, +0x6147,0x6148, 0, 0, 0, 0,0x6149, 0, + 0,0x614A, 0, 0, 0,0x614B, 0,0x614C, + 0, 0, 0,0x614D, 0, 0, 0,0x614E, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x614F, 0, 0,0x6150, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6151,0x6152,0x6154, 0,0x6155, +0x6156, 0,0x6153, 0, 0, 0,0x6157,0x6158, + 0, 0,0x6159, 0, 0, 0, 0, 0, + 0, 0,0x615A, 0, 0, 0,0x615B,0x615C, + 0, 0, 0, 0, 0, 0, 0,0x615D, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x615E, 0, +0x615F, 0, 0, 0, 0,0x6160, 0, 0, + 0,0x6161,0x6162, 0, 0, 0, 0,0x6163, + 0, 0, 0,0x6164, 0, 0, 0,0x6165, + 0, 0, 0, 0,0x6166, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6167, 0, 0,0x6168, 0, 0,0x6169,0x616A, + 0,0x616B, 0,0x616C, 0, 0, 0, 0, +0x616D, 0,0x616E,0x616F,0x6170, 0,0x6171, 0, + 0, 0, 0,0x6172,0x6173,0x6174, 0, 0, +0x6175, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6176, 0,0x6177,0x6178,0x6179, + 0,0x617A, 0, 0, 0, 0, 0, 0, +0x617B,0x617D, 0, 0, 0, 0,0x617E,0x6221, +0x6222, 0,0x6223,0x6224, 0, 0, 0,0x617C, + 0, 0, 0, 0, 0,0x622D, 0, 0, +0x6225, 0,0x6226,0x6227,0x6228, 0, 0,0x6229, +0x622A, 0,0x622B, 0, 0, 0, 0, 0, +0x622C, 0, 0, 0, 0, 0,0x622F, 0, + 0, 0,0x6230,0x6231, 0, 0, 0,0x6232, + 0,0x622E, 0, 0, 0, 0, 0, 0, + 0,0x6233,0x6234,0x6235, 0, 0, 0,0x6236, +0x6237,0x6238, 0,0x6239, 0, 0, 0, 0, +0x623A, 0, 0,0x623B, 0, 0, 0,0x623C, + 0,0x623D,0x623E,0x623F, 0,0x6240, 0,0x6241, + 0,0x6242, 0,0x6243, 0,0x6245,0x6246, 0, +0x6244, 0,0x6247, 0,0x6248, 0, 0, 0, + 0,0x6249,0x624A, 0,0x624B, 0, 0,0x624C, + 0,0x624D,0x624E, 0,0x624F,0x6250, 0,0x6251, +0x6252, 0, 0, 0, 0, 0,0x6253, 0, + 0, 0,0x6254,0x6255, 0, 0, 0, 0, + 0, 0,0x6256, 0, 0, 0,0x6257, 0, + 0, 0,0x6258, 0,0x6259,0x625A,0x625B, 0, + 0, 0, 0, 0,0x625C, 0, 0,0x625D, + 0, 0,0x625E, 0, 0, 0, 0, 0, +0x625F, 0, 0, 0, 0, 0, 0,0x6260, + 0, 0, 0, 0,0x6261,0x6262,0x6263, 0, + 0, 0, 0, 0,0x6264, 0,0x6265, 0, +0x6266,0x6267, 0, 0, 0,0x6268, 0, 0, + 0,0x6269, 0, 0,0x626A, 0,0x626B,0x626C, +0x626D, 0, 0,0x626E, 0, 0, 0, 0, + 0,0x626F, 0, 0,0x6270, 0, 0, 0, + 0,0x6271, 0,0x6272, 0, 0, 0,0x6273, +0x6274,0x6275, 0,0x6276,0x6277,0x6278,0x6279, 0, + 0,0x627A, 0, 0, 0, 0,0x627B,0x627C, +0x627D, 0,0x627E, 0, 0,0x6321,0x6322, 0, +0x6323, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6324,0x6325, + 0, 0,0x6326, 0,0x6327,0x6328, 0, 0, + 0,0x6329, 0, 0, 0, 0, 0,0x632A, +0x632B, 0, 0, 0,0x632C,0x632D, 0,0x632E, +0x632F,0x6330,0x6331,0x6332,0x6333, 0, 0, 0, + 0, 0,0x6334, 0,0x6335, 0,0x6336, 0, +0x6337, 0, 0,0x6338,0x6339, 0, 0,0x633A, +0x633B,0x633C,0x633D, 0,0x633E,0x633F, 0,0x6340, + 0, 0, 0,0x6341, 0,0x6342,0x6343, 0, + 0,0x6344, 0,0x6345, 0, 0, 0,0x6346, +0x6347, 0, 0, 0, 0, 0,0x6348,0x6349, +0x634A,0x634B, 0,0x634C, 0, 0, 0, 0, + 0,0x634D,0x634E,0x634F, 0, 0,0x6350, 0, +0x6351,0x6352, 0,0x6353,0x6354,0x6355, 0,0x6356, + 0,0x6357, 0,0x6358, 0,0x6359,0x635A, 0, + 0,0x635B,0x635C, 0, 0,0x635D, 0, 0, +0x635E,0x635F,0x6360, 0,0x6361, 0, 0, 0, + 0, 0, 0,0x6362,0x6363, 0, 0,0x6364, +0x6365, 0, 0,0x6366,0x6367, 0, 0, 0, +0x6368, 0,0x6369,0x636A,0x636B, 0, 0, 0, + 0,0x636C,0x636D,0x636E, 0, 0, 0, 0, +0x636F,0x6370,0x6371,0x6372,0x6373, 0,0x6374,0x6375, +0x6376, 0,0x6377, 0, 0, 0, 0, 0, + 0, 0, 0,0x6378,0x6379,0x637A, 0, 0, +0x637B,0x637C, 0, 0, 0,0x637D, 0, 0, + 0, 0,0x637E, 0,0x6421, 0, 0, 0, + 0, 0,0x6422,0x6423, 0, 0, 0,0x6424, +0x6425, 0,0x6426,0x6427, 0, 0,0x6428, 0, + 0, 0,0x6429, 0, 0,0x642A, 0, 0, + 0,0x642B, 0,0x642C, 0,0x642D,0x642E,0x642F, +0x6430, 0,0x6431,0x6432,0x6433,0x6434,0x6435, 0, +0x6436,0x6437,0x6438,0x6439, 0, 0,0x643A,0x643B, +0x643C,0x643D, 0,0x643E, 0, 0,0x643F, 0, +0x6440, 0,0x6441,0x6442,0x6443, 0, 0,0x6444, +0x6445, 0,0x6446,0x6447,0x6448, 0,0x6449, 0, +0x644A, 0,0x644B,0x644C, 0, 0, 0,0x644D, + 0,0x644E, 0,0x644F, 0, 0, 0, 0, + 0, 0, 0, 0,0x6450, 0,0x6451, 0, + 0, 0,0x6452,0x6453, 0,0x6454, 0, 0, + 0, 0, 0,0x6455, 0, 0, 0, 0, +0x6456, 0, 0, 0,0x6457, 0, 0,0x6458, +0x6459, 0, 0, 0, 0, 0, 0,0x645A, +0x645B,0x645C,0x645D, 0,0x645E, 0, 0,0x645F, +0x6460, 0,0x6461, 0,0x6462,0x6463, 0, 0, + 0, 0, 0, 0, 0, 0,0x6464,0x6465, + 0,0x6466,0x6467, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6468,0x6469,0x646A, 0, 0, 0, + 0, 0, 0,0x646B,0x646C,0x646D, 0, 0, +0x646E, 0,0x646F,0x6470, 0,0x6471, 0, 0, + 0,0x6472, 0, 0, 0, 0, 0,0x6473, +0x6474, 0,0x6475, 0,0x6476,0x6477, 0, 0, +0x6478, 0,0x6479,0x647A,0x647B, 0,0x647C,0x647D, + 0,0x647E, 0, 0, 0,0x6521, 0, 0, +0x6522, 0,0x6523,0x6524,0x6525,0x6526, 0, 0, + 0, 0, 0,0x6527, 0,0x6528,0x6529, 0, +0x652A, 0,0x652B, 0, 0,0x652C, 0, 0, +0x652D, 0, 0,0x652E, 0, 0,0x652F, 0, + 0,0x6530, 0, 0,0x6531, 0,0x6532,0x6533, + 0,0x6534, 0,0x6535,0x653B, 0,0x6536, 0, + 0, 0, 0, 0, 0, 0, 0,0x6537, +0x6538,0x6539, 0, 0, 0,0x653A, 0, 0, + 0, 0, 0, 0,0x653C, 0, 0,0x653D, +0x653E,0x653F,0x6540, 0,0x6541,0x6542,0x6543,0x6544, +0x6545, 0, 0, 0, 0, 0,0x6546, 0, + 0, 0, 0, 0,0x6547, 0, 0,0x6548, + 0,0x6549,0x654A, 0, 0,0x654B, 0, 0, + 0,0x654C,0x654D, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x654F,0x6550,0x654E,0x6551,0x6552, 0, +0x6553, 0, 0, 0,0x6554,0x6555, 0,0x6556, + 0, 0, 0,0x6557,0x6558, 0, 0, 0, +0x6559,0x655A,0x655B, 0, 0, 0, 0, 0, +0x655C,0x655D,0x655E, 0, 0, 0, 0, 0, + 0, 0,0x655F, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6560,0x6561, 0,0x6562,0x6563,0x6564,0x6565, + 0, 0, 0, 0, 0, 0,0x6566, 0, +0x6568, 0,0x6567, 0, 0, 0,0x6569, 0, +0x656A, 0, 0,0x656B, 0,0x656C, 0,0x656D, + 0, 0, 0, 0, 0, 0, 0, 0, +0x656E, 0, 0, 0,0x656F, 0, 0,0x6570, + 0, 0,0x6571, 0,0x6572, 0,0x6573, 0, + 0, 0, 0,0x6574, 0, 0,0x6575, 0, +0x6576,0x6577,0x6578, 0,0x6579,0x657A, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x657C,0x657B +}; + +/* page 37 0x9578-0x95E6 */ +static uint16 tab_uni_jisx021237[]={ +0x657D,0x657E, 0, 0, 0, 0,0x6621, 0, + 0, 0, 0, 0,0x6622, 0, 0, 0, +0x6623, 0, 0, 0,0x6624,0x6625,0x6626, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6627,0x6628,0x6629, + 0,0x662A, 0, 0, 0, 0,0x662B, 0, + 0,0x662C, 0,0x662D,0x662E, 0, 0, 0, + 0, 0, 0, 0,0x662F, 0,0x6630, 0, + 0, 0,0x6631, 0, 0,0x6632, 0,0x6633, + 0, 0, 0, 0, 0, 0,0x6634, 0, +0x6635,0x6636, 0,0x6637, 0, 0, 0, 0, +0x6638,0x6639,0x663A,0x663B, 0, 0, 0, 0, + 0,0x663C,0x663D, 0, 0,0x663E,0x663F,0x6640, +0x6641, 0, 0, 0,0x6642, 0,0x6643}; + +/* page 38 0x961D-0x986C */ +static uint16 tab_uni_jisx021238[]={ +0x6644,0x6645, 0, 0, 0,0x6646, 0,0x6647, +0x6648,0x6649, 0, 0, 0, 0, 0,0x664A, + 0, 0, 0, 0,0x664B, 0,0x664C, 0, + 0, 0,0x664D,0x664E,0x664F,0x6650, 0,0x6651, +0x6652, 0, 0, 0,0x6653, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6654, 0,0x6655, + 0,0x6656,0x6657,0x6658, 0, 0, 0, 0, + 0, 0, 0, 0,0x6659, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x665A, 0, 0, 0, 0, 0,0x665B, + 0, 0, 0, 0, 0, 0,0x665C,0x665D, + 0,0x665E,0x665F, 0,0x6660,0x6661,0x6662,0x6663, + 0, 0, 0, 0,0x6664, 0, 0, 0, + 0, 0, 0, 0,0x6665, 0, 0, 0, + 0,0x6666, 0, 0, 0,0x6667, 0, 0, +0x6668, 0,0x6669, 0, 0, 0, 0,0x666A, +0x666B,0x666C, 0, 0,0x666D, 0, 0, 0, + 0,0x666E,0x666F, 0, 0, 0,0x6670, 0, + 0, 0, 0, 0, 0,0x6671, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6672, 0, 0, + 0, 0, 0, 0, 0,0x6673, 0, 0, + 0, 0, 0,0x6675, 0,0x6676, 0, 0, +0x6677,0x6678,0x6679, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x667A, 0, 0, 0, + 0, 0,0x667B, 0,0x667C, 0, 0, 0, + 0, 0, 0, 0, 0,0x667D, 0, 0, + 0, 0, 0, 0, 0,0x667E,0x6721, 0, +0x6722, 0, 0, 0,0x6723, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6724,0x6725, 0, +0x6726, 0, 0, 0,0x6727,0x6728,0x6729, 0, + 0, 0, 0,0x672A, 0, 0, 0, 0, + 0, 0, 0, 0,0x672B, 0,0x672C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x672D, 0,0x672E, 0, + 0, 0, 0, 0, 0,0x672F, 0, 0, + 0,0x6730,0x6731, 0, 0, 0, 0, 0, +0x6732, 0,0x6733,0x6734, 0,0x6735,0x6736, 0, + 0, 0, 0, 0, 0, 0,0x6737, 0, + 0, 0,0x6738, 0, 0,0x6739, 0, 0, + 0,0x673A, 0, 0, 0, 0,0x673B, 0, + 0,0x673C,0x673D,0x673E, 0, 0,0x673F, 0, +0x6740, 0,0x6741,0x6742, 0, 0, 0, 0, + 0, 0, 0, 0,0x6743, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6744,0x6745,0x6746, 0,0x6747,0x6748, 0, 0, + 0,0x6749,0x674A, 0, 0,0x674B, 0, 0, + 0, 0, 0, 0, 0, 0, 0,0x674C, + 0,0x674D, 0, 0,0x674E,0x674F, 0, 0, +0x6750,0x6751, 0,0x6752,0x6753,0x6754, 0,0x6755, + 0,0x6756,0x6757, 0,0x6758, 0, 0,0x6759, +0x675A, 0,0x675B, 0,0x675C,0x675D, 0,0x675E, +0x675F,0x6760, 0,0x6761,0x6762, 0, 0,0x6763, + 0, 0,0x6764,0x6765,0x6766, 0,0x676A, 0, +0x6767,0x6768, 0,0x6769,0x676B, 0, 0,0x676C, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x676D, 0,0x676E, 0, 0,0x676F, + 0, 0,0x6770,0x6771, 0,0x6772, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,0x6773, 0, 0,0x6774, 0, 0, +0x6776,0x6777, 0, 0, 0, 0, 0,0x6778, + 0,0x6779, 0, 0,0x6775, 0, 0,0x677A, + 0,0x677B, 0,0x677C, 0, 0,0x677D, 0, +0x6828,0x677E, 0, 0, 0, 0,0x6821, 0, + 0,0x6822,0x6823,0x6824, 0,0x6825,0x6826, 0, +0x6827, 0, 0, 0, 0, 0, 0, 0, + 0,0x6829, 0, 0, 0, 0, 0,0x682A, + 0, 0,0x682B, 0, 0,0x682C, 0, 0, + 0, 0, 0, 0,0x682D,0x682E,0x682F, 0, + 0,0x6830,0x6831, 0,0x6832,0x6833, 0, 0, + 0, 0, 0, 0, 0,0x6834,0x6835, 0, +0x6836,0x6837, 0, 0, 0,0x6838, 0,0x6839 +}; + +/* page 39 0x98AB-0x98CC */ +static uint16 tab_uni_jisx021239[]={ +0x683A, 0,0x683B,0x683C, 0,0x683D, 0, 0, + 0,0x683E, 0, 0,0x683F,0x6840, 0,0x6841, +0x6842, 0, 0, 0,0x6843, 0, 0,0x6844, + 0, 0,0x6845, 0, 0,0x6846, 0, 0, + 0,0x6847}; + +/* page 40 0x98E1-0x9960 */ +static uint16 tab_uni_jisx021240[]={ +0x6848, 0,0x6849, 0,0x684A,0x684B,0x684C, 0, + 0,0x684D, 0, 0, 0, 0, 0, 0, + 0, 0,0x684E, 0, 0,0x684F, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6850, 0, 0, 0, 0,0x6851,0x6852, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6853, 0, 0, 0,0x6854,0x6855,0x6856, 0, + 0,0x6857,0x6858,0x6859, 0, 0,0x685A, 0, + 0,0x685B, 0, 0, 0,0x685C,0x685D, 0, + 0, 0,0x685E, 0, 0, 0, 0, 0, +0x685F,0x6860,0x6861,0x6862,0x6863, 0, 0, 0, +0x6864,0x6865,0x6866,0x6867, 0, 0, 0,0x6868, +0x6869, 0, 0, 0, 0,0x686A,0x686B,0x686C, + 0, 0, 0, 0,0x686D,0x686E, 0, 0, + 0, 0, 0,0x686F, 0, 0, 0,0x6870, +0x6871, 0,0x6872,0x6873, 0,0x6874,0x6875,0x6876 +}; + +/* page 41 0x999B-0x9A5D */ +static uint16 tab_uni_jisx021241[]={ +0x6877, 0,0x6878, 0,0x6879, 0, 0, 0, + 0, 0, 0,0x687A, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x687B,0x687C,0x687D, + 0, 0,0x687E, 0, 0, 0,0x6921,0x6922, + 0, 0,0x6923, 0,0x6924, 0, 0, 0, +0x6925, 0, 0, 0, 0, 0,0x6926, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6927,0x6928, 0, 0, 0, 0,0x6929,0x692A, + 0,0x692B, 0,0x692C, 0, 0, 0, 0, + 0, 0, 0, 0,0x692D, 0, 0,0x692E, +0x692F,0x6930, 0, 0, 0,0x6931, 0, 0, + 0,0x6932,0x6933, 0, 0, 0,0x6934, 0, + 0, 0,0x6935,0x6936, 0, 0, 0,0x6937, +0x6938,0x6939, 0, 0, 0, 0, 0, 0, +0x693A,0x693B, 0, 0, 0,0x693C,0x693D, 0, + 0, 0, 0,0x693E, 0, 0, 0, 0, + 0, 0, 0,0x693F, 0,0x6940, 0,0x6941, +0x6942,0x6943, 0, 0,0x6944, 0, 0, 0, + 0, 0,0x6945,0x6946, 0, 0, 0, 0, +0x6947, 0,0x6948,0x6949, 0,0x694A, 0, 0, + 0, 0, 0, 0, 0, 0,0x694C, 0, + 0,0x694D, 0, 0,0x694B, 0, 0,0x694E, +0x694F,0x6950, 0,0x6951, 0, 0,0x6952, 0, + 0,0x6953, 0,0x6954, 0, 0, 0, 0, + 0, 0,0x6955}; + +/* page 42 0x9AAA-0x9C7B */ +static uint16 tab_uni_jisx021242[]={ +0x6956, 0,0x6957, 0,0x6958,0x6959, 0, 0, +0x695A, 0,0x695B,0x695C,0x695D, 0, 0,0x695E, + 0,0x695F, 0, 0,0x6960,0x6961, 0,0x6962, + 0,0x6963, 0, 0,0x6964, 0,0x6965, 0, + 0, 0, 0, 0,0x6966, 0,0x6967, 0, +0x6968, 0, 0,0x6969,0x696A,0x696B, 0, 0, + 0,0x696C,0x696D, 0, 0, 0,0x696E, 0, + 0, 0,0x696F,0x6970, 0,0x6971, 0,0x6972, + 0, 0,0x6973, 0, 0, 0, 0, 0, +0x6974,0x6975, 0,0x6976, 0, 0, 0,0x6977, +0x6978, 0, 0,0x6979, 0,0x697A,0x697B,0x697C, +0x697D,0x697E,0x6A21,0x6A22, 0, 0,0x6A23,0x6A24, + 0,0x6A25,0x6A26,0x6A27,0x6A28, 0,0x6A29, 0, +0x6A2A, 0, 0, 0,0x6A2B, 0, 0,0x6A2C, + 0,0x6A2D,0x6A2E, 0, 0, 0,0x6A2F, 0, + 0, 0, 0, 0,0x6A30, 0, 0, 0, + 0,0x6A31, 0,0x6A32, 0, 0, 0, 0, + 0,0x6A33,0x6A34,0x6A35, 0,0x6A36, 0,0x6A37, +0x6A38, 0, 0,0x6A39, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6A3A, 0, + 0,0x6A3B,0x6A3C, 0, 0, 0, 0, 0, + 0, 0, 0,0x6A3D,0x6A3E,0x6A3F, 0, 0, + 0,0x6A40, 0, 0,0x6A41, 0, 0,0x6A42, + 0,0x6A43, 0,0x6A44,0x6A45, 0,0x6A46, 0, +0x6A47,0x6A48,0x6A49,0x6A4A,0x6A4B, 0, 0, 0, + 0,0x6A4C, 0,0x6A4D, 0,0x6A4E,0x6A4F,0x6A50, + 0, 0, 0, 0, 0,0x6A51,0x6A52, 0, + 0, 0,0x6A53,0x6A54,0x6A55,0x6A56, 0,0x6A57, +0x6A58,0x6A59, 0,0x6A5A, 0,0x6A5B,0x6A5C, 0, + 0, 0,0x6A5D, 0, 0, 0, 0, 0, +0x6A5E, 0, 0,0x6A5F,0x6A60, 0, 0, 0, + 0, 0, 0, 0,0x6A61,0x6A62, 0,0x6A63, + 0, 0,0x6A64, 0, 0, 0,0x6A65,0x6A66, +0x6A67, 0, 0, 0, 0,0x6A68,0x6A69, 0, + 0,0x6A6A,0x6A6B, 0,0x6A6C,0x6A6D, 0,0x6A6E, + 0, 0, 0, 0, 0,0x6A6F,0x6A70, 0, + 0, 0, 0, 0,0x6A71, 0,0x6A72, 0, + 0, 0, 0, 0, 0,0x6A73,0x6A74, 0, + 0, 0, 0,0x6A75, 0,0x6A76, 0, 0, + 0, 0, 0,0x6A77, 0,0x6A78, 0, 0, +0x6A79,0x6A7A, 0, 0, 0,0x6A7B, 0, 0, + 0,0x6A7C, 0, 0, 0,0x6A7D,0x6A7E,0x6B21, +0x6B22, 0, 0,0x6B23, 0,0x6B24,0x6B25, 0, +0x6B26, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B27, 0, 0, 0,0x6B28, 0,0x6B29, + 0, 0, 0, 0,0x6B2A, 0,0x6B2B,0x6B2C, +0x6B2D, 0,0x6B2E, 0,0x6B2F, 0, 0, 0, +0x6B30,0x6B31, 0, 0,0x6B32,0x6B33,0x6B34,0x6B35, +0x6B36, 0, 0, 0, 0, 0, 0,0x6B37, + 0, 0, 0,0x6B38,0x6B39,0x6B3A, 0, 0, + 0, 0, 0,0x6B3B, 0, 0, 0,0x6B3C, + 0,0x6B3D,0x6B3E,0x6B3F, 0, 0, 0,0x6B40, +0x6B41, 0, 0, 0,0x6B42,0x6B43,0x6B44, 0, + 0,0x6B45,0x6B46, 0,0x6B47, 0,0x6B48, 0, + 0,0x6B49,0x6B50,0x6B4A,0x6B4B,0x6B4C, 0, 0, + 0,0x6B4D, 0, 0, 0, 0,0x6B52,0x6B4E, +0x6B4F,0x6B51, 0, 0,0x6B53, 0,0x6B54, 0, +0x6B55, 0, 0,0x6B56, 0,0x6B57, 0, 0, + 0,0x6B58}; + +/* page 43 0x9CE6-0x9E1D */ +static uint16 tab_uni_jisx021243[]={ +0x6B59, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6B5A, 0, 0, 0, + 0,0x6B5B, 0,0x6B5C, 0, 0, 0, 0, + 0, 0, 0, 0,0x6B5E, 0, 0, 0, + 0, 0, 0, 0, 0,0x6B5D, 0, 0, + 0, 0, 0,0x6B5F, 0, 0, 0, 0, + 0,0x6B60,0x6B61, 0, 0, 0,0x6B62,0x6B63, +0x6B64, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B65,0x6B66, 0,0x6B67,0x6B68,0x6B69, 0, + 0, 0, 0, 0,0x6B6A, 0,0x6B6B,0x6B6D, + 0, 0, 0, 0,0x6B6E,0x6B6F, 0,0x6B6C, + 0,0x6B70, 0, 0,0x6B71, 0, 0, 0, + 0, 0, 0, 0, 0,0x6B72,0x6B73, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6B74, 0, 0,0x6B76,0x6B75, 0,0x6B77, + 0, 0, 0,0x6B78,0x6B79,0x6B7A, 0, 0, + 0, 0,0x6B7B, 0, 0, 0, 0, 0, +0x6B7C,0x6B7D, 0, 0, 0,0x6B7E,0x6C21, 0, +0x6C22, 0, 0, 0, 0,0x6C23,0x6C24, 0, +0x6C25, 0, 0, 0,0x6C26, 0, 0,0x6C27, +0x6C28, 0, 0, 0,0x6C29,0x6C2A, 0,0x6C2B, +0x6C2C,0x6C2D,0x6C2E, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C2F, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C30, 0,0x6C31, 0, +0x6C32, 0, 0,0x6C33, 0, 0, 0,0x6C34, + 0, 0, 0,0x6C35, 0, 0,0x6C36, 0, + 0,0x6C37, 0, 0, 0,0x6C38, 0, 0, + 0,0x6C39, 0,0x6C3A,0x6C3B, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6C3C,0x6C3D, +0x6C3E,0x6C3F, 0, 0,0x6C40, 0, 0, 0, +0x6C41,0x6C42,0x6C43, 0, 0, 0, 0,0x6C44, + 0,0x6C45, 0,0x6C46, 0,0x6C47, 0, 0, +0x6C48, 0,0x6C49, 0, 0,0x6C4A,0x6C4B, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x6C4C, 0, 0, 0,0x6C4E, 0, 0, 0, + 0,0x6C4F, 0, 0,0x6C4D, 0, 0, 0, +0x6C50, 0,0x6C51,0x6C52,0x6C53, 0, 0,0x6C54, +0x6C55, 0, 0,0x6C56, 0, 0,0x6C57,0x6C58 +}; + +/* page 44 0x9E7A-0x9FA5 */ +static uint16 tab_uni_jisx021244[]={ +0x6C59,0x6C5A,0x6C5B, 0, 0, 0,0x6C5C, 0, +0x6C5D,0x6C5E,0x6C5F,0x6C60, 0,0x6C61, 0, 0, + 0, 0, 0, 0,0x6C62,0x6C63, 0, 0, + 0, 0, 0, 0,0x6C64, 0,0x6C65, 0, + 0,0x6C66, 0, 0,0x6C67, 0, 0, 0, + 0, 0,0x6C68, 0, 0, 0,0x6C69, 0, + 0, 0,0x6C6A, 0,0x6C6B,0x6C6C,0x6C6D, 0, + 0,0x6C6E,0x6C6F,0x6C70, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,0x6C71, 0,0x6C72, 0, + 0,0x6C73, 0, 0, 0, 0, 0, 0, + 0, 0, 0,0x6C74, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6C75, 0, 0, + 0, 0,0x6C76, 0, 0,0x6C77, 0, 0, + 0, 0,0x6C78,0x6C79,0x6C7A, 0,0x6C7B,0x6C7C, +0x6C7D, 0, 0,0x6C7E, 0, 0,0x6D21, 0, + 0, 0, 0, 0, 0,0x6D22, 0, 0, +0x6D23,0x6D24, 0, 0, 0, 0, 0,0x6D25, + 0, 0, 0, 0, 0,0x6D26,0x6D27,0x6D28, +0x6D29, 0,0x6D2A, 0,0x6D2B,0x6D2C, 0,0x6D2D, +0x6D2E,0x6D2F, 0, 0, 0,0x6D30, 0, 0, +0x6D31, 0, 0, 0,0x6D32, 0, 0, 0, +0x6D33,0x6D34, 0, 0, 0,0x6D35, 0,0x6D36, +0x6D37, 0,0x6D38, 0, 0,0x6D39, 0,0x6D3A, +0x6D3B, 0,0x6D3C,0x6D3D, 0,0x6D3E, 0,0x6D3F, + 0,0x6D40,0x6D41,0x6D42,0x6D43,0x6D44, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0,0x6D45, 0,0x6D46,0x6D47,0x6D48,0x6D49, 0, +0x6D4A, 0, 0,0x6D4B,0x6D4C, 0, 0, 0, + 0, 0, 0, 0, 0, 0,0x6D4D,0x6D4E, + 0, 0, 0,0x6D4F,0x6D50,0x6D51,0x6D52,0x6D53, + 0,0x6D54, 0,0x6D55, 0, 0, 0, 0, +0x6D56, 0, 0,0x6D57, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0,0x6D58,0x6D59,0x6D5A, +0x6D5B, 0,0x6D5C, 0,0x6D5D,0x6D5E, 0, 0, + 0, 0, 0, 0,0x6D5F, 0, 0,0x6D60, +0x6D61,0x6D62, 0,0x6D63}; + +static int +my_uni_jisx0212_onechar(int code){ + if ((code>=0x007E)&&(code<=0x007E)) + return(tab_uni_jisx02120[code-0x007E]); + if ((code>=0x00A1)&&(code<=0x017E)) + return(tab_uni_jisx02121[code-0x00A1]); + if ((code>=0x01CD)&&(code<=0x01DC)) + return(tab_uni_jisx02122[code-0x01CD]); + if ((code>=0x01F5)&&(code<=0x01F5)) + return(tab_uni_jisx02123[code-0x01F5]); + if ((code>=0x02C7)&&(code<=0x02DD)) + return(tab_uni_jisx02124[code-0x02C7]); + if ((code>=0x0384)&&(code<=0x0390)) + return(tab_uni_jisx02125[code-0x0384]); + if ((code>=0x03AA)&&(code<=0x03CE)) + return(tab_uni_jisx02126[code-0x03AA]); + if ((code>=0x0402)&&(code<=0x040F)) + return(tab_uni_jisx02127[code-0x0402]); + if ((code>=0x0452)&&(code<=0x045F)) + return(tab_uni_jisx02128[code-0x0452]); + if ((code>=0x2116)&&(code<=0x2122)) + return(tab_uni_jisx02129[code-0x2116]); + if ((code>=0x4E02)&&(code<=0x4F19)) + return(tab_uni_jisx021210[code-0x4E02]); + if ((code>=0x4F2E)&&(code<=0x5166)) + return(tab_uni_jisx021211[code-0x4F2E]); + if ((code>=0x517E)&&(code<=0x5515)) + return(tab_uni_jisx021212[code-0x517E]); + if ((code>=0x552A)&&(code<=0x5566)) + return(tab_uni_jisx021213[code-0x552A]); + if ((code>=0x557F)&&(code<=0x5C36)) + return(tab_uni_jisx021214[code-0x557F]); + if ((code>=0x5C59)&&(code<=0x5EEB)) + return(tab_uni_jisx021215[code-0x5C59]); + if ((code>=0x5F02)&&(code<=0x6149)) + return(tab_uni_jisx021216[code-0x5F02]); + if ((code>=0x615E)&&(code<=0x6290)) + return(tab_uni_jisx021217[code-0x615E]); + if ((code>=0x62A6)&&(code<=0x679B)) + return(tab_uni_jisx021218[code-0x62A6]); + if ((code>=0x67B0)&&(code<=0x67F9)) + return(tab_uni_jisx021219[code-0x67B0]); + if ((code>=0x6814)&&(code<=0x6917)) + return(tab_uni_jisx021220[code-0x6814]); + if ((code>=0x6931)&&(code<=0x6D3F)) + return(tab_uni_jisx021221[code-0x6931]); + if ((code>=0x6D57)&&(code<=0x6E04)) + return(tab_uni_jisx021222[code-0x6D57]); + if ((code>=0x6E1E)&&(code<=0x6ECF)) + return(tab_uni_jisx021223[code-0x6E1E]); + if ((code>=0x6EEB)&&(code<=0x70E4)) + return(tab_uni_jisx021224[code-0x6EEB]); + if ((code>=0x70FA)&&(code<=0x71DC)) + return(tab_uni_jisx021225[code-0x70FA]); + if ((code>=0x71F8)&&(code<=0x7E9E)) + return(tab_uni_jisx021226[code-0x71F8]); + if ((code>=0x7F3B)&&(code<=0x8044)) + return(tab_uni_jisx021227[code-0x7F3B]); + if ((code>=0x8060)&&(code<=0x8357)) + return(tab_uni_jisx021228[code-0x8060]); + if ((code>=0x8370)&&(code<=0x8419)) + return(tab_uni_jisx021229[code-0x8370]); + if ((code>=0x842F)&&(code<=0x8880)) + return(tab_uni_jisx021230[code-0x842F]); + if ((code>=0x8898)&&(code<=0x89BC)) + return(tab_uni_jisx021231[code-0x8898]); + if ((code>=0x89D4)&&(code<=0x8B9F)) + return(tab_uni_jisx021232[code-0x89D4]); + if ((code>=0x8C38)&&(code<=0x8CA4)) + return(tab_uni_jisx021233[code-0x8C38]); + if ((code>=0x8CB9)&&(code<=0x8D1B)) + return(tab_uni_jisx021234[code-0x8CB9]); + if ((code>=0x8D65)&&(code<=0x8F65)) + return(tab_uni_jisx021235[code-0x8D65]); + if ((code>=0x8F9D)&&(code<=0x9484)) + return(tab_uni_jisx021236[code-0x8F9D]); + if ((code>=0x9578)&&(code<=0x95E6)) + return(tab_uni_jisx021237[code-0x9578]); + if ((code>=0x961D)&&(code<=0x986C)) + return(tab_uni_jisx021238[code-0x961D]); + if ((code>=0x98AB)&&(code<=0x98CC)) + return(tab_uni_jisx021239[code-0x98AB]); + if ((code>=0x98E1)&&(code<=0x9960)) + return(tab_uni_jisx021240[code-0x98E1]); + if ((code>=0x999B)&&(code<=0x9A5D)) + return(tab_uni_jisx021241[code-0x999B]); + if ((code>=0x9AAA)&&(code<=0x9C7B)) + return(tab_uni_jisx021242[code-0x9AAA]); + if ((code>=0x9CE6)&&(code<=0x9E1D)) + return(tab_uni_jisx021243[code-0x9CE6]); + if ((code>=0x9E7A)&&(code<=0x9FA5)) + return(tab_uni_jisx021244[code-0x9E7A]); + return(0); +} + + +/* page 0 0x222F-0x2244 */ +static uint16 tab_jisx0212_uni0[]={ +0x02D8,0x02C7,0x00B8,0x02D9,0x02DD,0x00AF,0x02DB,0x02DA, +0x007E,0x0384,0x0385, 0, 0, 0, 0, 0, + 0, 0, 0,0x00A1,0x00A6,0x00BF}; + +/* page 1 0x226B-0x2271 */ +static uint16 tab_jisx0212_uni1[]={ +0x00BA,0x00AA,0x00A9,0x00AE,0x2122,0x00A4,0x2116}; + +/* page 2 0x2661-0x267C */ +static uint16 tab_jisx0212_uni2[]={ +0x0386,0x0388,0x0389,0x038A,0x03AA, 0,0x038C, 0, +0x038E,0x03AB, 0,0x038F, 0, 0, 0, 0, +0x03AC,0x03AD,0x03AE,0x03AF,0x03CA,0x0390,0x03CC,0x03C2, +0x03CD,0x03CB,0x03B0,0x03CE}; + +/* page 3 0x2742-0x274E */ +static uint16 tab_jisx0212_uni3[]={ +0x0402,0x0403,0x0404,0x0405,0x0406,0x0407,0x0408,0x0409, +0x040A,0x040B,0x040C,0x040E,0x040F}; + +/* page 4 0x2772-0x277E */ +static uint16 tab_jisx0212_uni4[]={ +0x0452,0x0453,0x0454,0x0455,0x0456,0x0457,0x0458,0x0459, +0x045A,0x045B,0x045C,0x045E,0x045F}; + +/* page 5 0x2921-0x2950 */ +static uint16 tab_jisx0212_uni5[]={ +0x00C6,0x0110, 0,0x0126, 0,0x0132, 0,0x0141, +0x013F, 0,0x014A,0x00D8,0x0152, 0,0x0166,0x00DE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +0x00E6,0x0111,0x00F0,0x0127,0x0131,0x0133,0x0138,0x0142, +0x0140,0x0149,0x014B,0x00F8,0x0153,0x00DF,0x0167,0x00FE +}; + +/* page 6 0x2A21-0x2A77 */ +static uint16 tab_jisx0212_uni6[]={ +0x00C1,0x00C0,0x00C4,0x00C2,0x0102,0x01CD,0x0100,0x0104, +0x00C5,0x00C3,0x0106,0x0108,0x010C,0x00C7,0x010A,0x010E, +0x00C9,0x00C8,0x00CB,0x00CA,0x011A,0x0116,0x0112,0x0118, + 0,0x011C,0x011E,0x0122,0x0120,0x0124,0x00CD,0x00CC, +0x00CF,0x00CE,0x01CF,0x0130,0x012A,0x012E,0x0128,0x0134, +0x0136,0x0139,0x013D,0x013B,0x0143,0x0147,0x0145,0x00D1, +0x00D3,0x00D2,0x00D6,0x00D4,0x01D1,0x0150,0x014C,0x00D5, +0x0154,0x0158,0x0156,0x015A,0x015C,0x0160,0x015E,0x0164, +0x0162,0x00DA,0x00D9,0x00DC,0x00DB,0x016C,0x01D3,0x0170, +0x016A,0x0172,0x016E,0x0168,0x01D7,0x01DB,0x01D9,0x01D5, +0x0174,0x00DD,0x0178,0x0176,0x0179,0x017D,0x017B}; + +/* page 7 0x2B21-0x2B77 */ +static uint16 tab_jisx0212_uni7[]={ +0x00E1,0x00E0,0x00E4,0x00E2,0x0103,0x01CE,0x0101,0x0105, +0x00E5,0x00E3,0x0107,0x0109,0x010D,0x00E7,0x010B,0x010F, +0x00E9,0x00E8,0x00EB,0x00EA,0x011B,0x0117,0x0113,0x0119, +0x01F5,0x011D,0x011F, 0,0x0121,0x0125,0x00ED,0x00EC, +0x00EF,0x00EE,0x01D0, 0,0x012B,0x012F,0x0129,0x0135, +0x0137,0x013A,0x013E,0x013C,0x0144,0x0148,0x0146,0x00F1, +0x00F3,0x00F2,0x00F6,0x00F4,0x01D2,0x0151,0x014D,0x00F5, +0x0155,0x0159,0x0157,0x015B,0x015D,0x0161,0x015F,0x0165, +0x0163,0x00FA,0x00F9,0x00FC,0x00FB,0x016D,0x01D4,0x0171, +0x016B,0x0173,0x016F,0x0169,0x01D8,0x01DC,0x01DA,0x01D6, +0x0175,0x00FD,0x00FF,0x0177,0x017A,0x017E,0x017C}; + +/* page 8 0x3021-0x307E */ +static uint16 tab_jisx0212_uni8[]={ +0x4E02,0x4E04,0x4E05,0x4E0C,0x4E12,0x4E1F,0x4E23,0x4E24, +0x4E28,0x4E2B,0x4E2E,0x4E2F,0x4E30,0x4E35,0x4E40,0x4E41, +0x4E44,0x4E47,0x4E51,0x4E5A,0x4E5C,0x4E63,0x4E68,0x4E69, +0x4E74,0x4E75,0x4E79,0x4E7F,0x4E8D,0x4E96,0x4E97,0x4E9D, +0x4EAF,0x4EB9,0x4EC3,0x4ED0,0x4EDA,0x4EDB,0x4EE0,0x4EE1, +0x4EE2,0x4EE8,0x4EEF,0x4EF1,0x4EF3,0x4EF5,0x4EFD,0x4EFE, +0x4EFF,0x4F00,0x4F02,0x4F03,0x4F08,0x4F0B,0x4F0C,0x4F12, +0x4F15,0x4F16,0x4F17,0x4F19,0x4F2E,0x4F31,0x4F60,0x4F33, +0x4F35,0x4F37,0x4F39,0x4F3B,0x4F3E,0x4F40,0x4F42,0x4F48, +0x4F49,0x4F4B,0x4F4C,0x4F52,0x4F54,0x4F56,0x4F58,0x4F5F, +0x4F63,0x4F6A,0x4F6C,0x4F6E,0x4F71,0x4F77,0x4F78,0x4F79, +0x4F7A,0x4F7D,0x4F7E,0x4F81,0x4F82,0x4F84}; + +/* page 9 0x3121-0x317E */ +static uint16 tab_jisx0212_uni9[]={ +0x4F85,0x4F89,0x4F8A,0x4F8C,0x4F8E,0x4F90,0x4F92,0x4F93, +0x4F94,0x4F97,0x4F99,0x4F9A,0x4F9E,0x4F9F,0x4FB2,0x4FB7, +0x4FB9,0x4FBB,0x4FBC,0x4FBD,0x4FBE,0x4FC0,0x4FC1,0x4FC5, +0x4FC6,0x4FC8,0x4FC9,0x4FCB,0x4FCC,0x4FCD,0x4FCF,0x4FD2, +0x4FDC,0x4FE0,0x4FE2,0x4FF0,0x4FF2,0x4FFC,0x4FFD,0x4FFF, +0x5000,0x5001,0x5004,0x5007,0x500A,0x500C,0x500E,0x5010, +0x5013,0x5017,0x5018,0x501B,0x501C,0x501D,0x501E,0x5022, +0x5027,0x502E,0x5030,0x5032,0x5033,0x5035,0x5040,0x5041, +0x5042,0x5045,0x5046,0x504A,0x504C,0x504E,0x5051,0x5052, +0x5053,0x5057,0x5059,0x505F,0x5060,0x5062,0x5063,0x5066, +0x5067,0x506A,0x506D,0x5070,0x5071,0x503B,0x5081,0x5083, +0x5084,0x5086,0x508A,0x508E,0x508F,0x5090}; + +/* page 10 0x3221-0x327E */ +static uint16 tab_jisx0212_uni10[]={ +0x5092,0x5093,0x5094,0x5096,0x509B,0x509C,0x509E,0x509F, +0x50A0,0x50A1,0x50A2,0x50AA,0x50AF,0x50B0,0x50B9,0x50BA, +0x50BD,0x50C0,0x50C3,0x50C4,0x50C7,0x50CC,0x50CE,0x50D0, +0x50D3,0x50D4,0x50D8,0x50DC,0x50DD,0x50DF,0x50E2,0x50E4, +0x50E6,0x50E8,0x50E9,0x50EF,0x50F1,0x50F6,0x50FA,0x50FE, +0x5103,0x5106,0x5107,0x5108,0x510B,0x510C,0x510D,0x510E, +0x50F2,0x5110,0x5117,0x5119,0x511B,0x511C,0x511D,0x511E, +0x5123,0x5127,0x5128,0x512C,0x512D,0x512F,0x5131,0x5133, +0x5134,0x5135,0x5138,0x5139,0x5142,0x514A,0x514F,0x5153, +0x5155,0x5157,0x5158,0x515F,0x5164,0x5166,0x517E,0x5183, +0x5184,0x518B,0x518E,0x5198,0x519D,0x51A1,0x51A3,0x51AD, +0x51B8,0x51BA,0x51BC,0x51BE,0x51BF,0x51C2}; + +/* page 11 0x3321-0x337E */ +static uint16 tab_jisx0212_uni11[]={ +0x51C8,0x51CF,0x51D1,0x51D2,0x51D3,0x51D5,0x51D8,0x51DE, +0x51E2,0x51E5,0x51EE,0x51F2,0x51F3,0x51F4,0x51F7,0x5201, +0x5202,0x5205,0x5212,0x5213,0x5215,0x5216,0x5218,0x5222, +0x5228,0x5231,0x5232,0x5235,0x523C,0x5245,0x5249,0x5255, +0x5257,0x5258,0x525A,0x525C,0x525F,0x5260,0x5261,0x5266, +0x526E,0x5277,0x5278,0x5279,0x5280,0x5282,0x5285,0x528A, +0x528C,0x5293,0x5295,0x5296,0x5297,0x5298,0x529A,0x529C, +0x52A4,0x52A5,0x52A6,0x52A7,0x52AF,0x52B0,0x52B6,0x52B7, +0x52B8,0x52BA,0x52BB,0x52BD,0x52C0,0x52C4,0x52C6,0x52C8, +0x52CC,0x52CF,0x52D1,0x52D4,0x52D6,0x52DB,0x52DC,0x52E1, +0x52E5,0x52E8,0x52E9,0x52EA,0x52EC,0x52F0,0x52F1,0x52F4, +0x52F6,0x52F7,0x5300,0x5303,0x530A,0x530B}; + +/* page 12 0x3421-0x347E */ +static uint16 tab_jisx0212_uni12[]={ +0x530C,0x5311,0x5313,0x5318,0x531B,0x531C,0x531E,0x531F, +0x5325,0x5327,0x5328,0x5329,0x532B,0x532C,0x532D,0x5330, +0x5332,0x5335,0x533C,0x533D,0x533E,0x5342,0x534C,0x534B, +0x5359,0x535B,0x5361,0x5363,0x5365,0x536C,0x536D,0x5372, +0x5379,0x537E,0x5383,0x5387,0x5388,0x538E,0x5393,0x5394, +0x5399,0x539D,0x53A1,0x53A4,0x53AA,0x53AB,0x53AF,0x53B2, +0x53B4,0x53B5,0x53B7,0x53B8,0x53BA,0x53BD,0x53C0,0x53C5, +0x53CF,0x53D2,0x53D3,0x53D5,0x53DA,0x53DD,0x53DE,0x53E0, +0x53E6,0x53E7,0x53F5,0x5402,0x5413,0x541A,0x5421,0x5427, +0x5428,0x542A,0x542F,0x5431,0x5434,0x5435,0x5443,0x5444, +0x5447,0x544D,0x544F,0x545E,0x5462,0x5464,0x5466,0x5467, +0x5469,0x546B,0x546D,0x546E,0x5474,0x547F}; + +/* page 13 0x3521-0x357E */ +static uint16 tab_jisx0212_uni13[]={ +0x5481,0x5483,0x5485,0x5488,0x5489,0x548D,0x5491,0x5495, +0x5496,0x549C,0x549F,0x54A1,0x54A6,0x54A7,0x54A9,0x54AA, +0x54AD,0x54AE,0x54B1,0x54B7,0x54B9,0x54BA,0x54BB,0x54BF, +0x54C6,0x54CA,0x54CD,0x54CE,0x54E0,0x54EA,0x54EC,0x54EF, +0x54F6,0x54FC,0x54FE,0x54FF,0x5500,0x5501,0x5505,0x5508, +0x5509,0x550C,0x550D,0x550E,0x5515,0x552A,0x552B,0x5532, +0x5535,0x5536,0x553B,0x553C,0x553D,0x5541,0x5547,0x5549, +0x554A,0x554D,0x5550,0x5551,0x5558,0x555A,0x555B,0x555E, +0x5560,0x5561,0x5564,0x5566,0x557F,0x5581,0x5582,0x5586, +0x5588,0x558E,0x558F,0x5591,0x5592,0x5593,0x5594,0x5597, +0x55A3,0x55A4,0x55AD,0x55B2,0x55BF,0x55C1,0x55C3,0x55C6, +0x55C9,0x55CB,0x55CC,0x55CE,0x55D1,0x55D2}; + +/* page 14 0x3621-0x367E */ +static uint16 tab_jisx0212_uni14[]={ +0x55D3,0x55D7,0x55D8,0x55DB,0x55DE,0x55E2,0x55E9,0x55F6, +0x55FF,0x5605,0x5608,0x560A,0x560D,0x560E,0x560F,0x5610, +0x5611,0x5612,0x5619,0x562C,0x5630,0x5633,0x5635,0x5637, +0x5639,0x563B,0x563C,0x563D,0x563F,0x5640,0x5641,0x5643, +0x5644,0x5646,0x5649,0x564B,0x564D,0x564F,0x5654,0x565E, +0x5660,0x5661,0x5662,0x5663,0x5666,0x5669,0x566D,0x566F, +0x5671,0x5672,0x5675,0x5684,0x5685,0x5688,0x568B,0x568C, +0x5695,0x5699,0x569A,0x569D,0x569E,0x569F,0x56A6,0x56A7, +0x56A8,0x56A9,0x56AB,0x56AC,0x56AD,0x56B1,0x56B3,0x56B7, +0x56BE,0x56C5,0x56C9,0x56CA,0x56CB,0x56CF,0x56D0,0x56CC, +0x56CD,0x56D9,0x56DC,0x56DD,0x56DF,0x56E1,0x56E4,0x56E5, +0x56E6,0x56E7,0x56E8,0x56F1,0x56EB,0x56ED}; + +/* page 15 0x3721-0x377E */ +static uint16 tab_jisx0212_uni15[]={ +0x56F6,0x56F7,0x5701,0x5702,0x5707,0x570A,0x570C,0x5711, +0x5715,0x571A,0x571B,0x571D,0x5720,0x5722,0x5723,0x5724, +0x5725,0x5729,0x572A,0x572C,0x572E,0x572F,0x5733,0x5734, +0x573D,0x573E,0x573F,0x5745,0x5746,0x574C,0x574D,0x5752, +0x5762,0x5765,0x5767,0x5768,0x576B,0x576D,0x576E,0x576F, +0x5770,0x5771,0x5773,0x5774,0x5775,0x5777,0x5779,0x577A, +0x577B,0x577C,0x577E,0x5781,0x5783,0x578C,0x5794,0x5797, +0x5799,0x579A,0x579C,0x579D,0x579E,0x579F,0x57A1,0x5795, +0x57A7,0x57A8,0x57A9,0x57AC,0x57B8,0x57BD,0x57C7,0x57C8, +0x57CC,0x57CF,0x57D5,0x57DD,0x57DE,0x57E4,0x57E6,0x57E7, +0x57E9,0x57ED,0x57F0,0x57F5,0x57F6,0x57F8,0x57FD,0x57FE, +0x57FF,0x5803,0x5804,0x5808,0x5809,0x57E1}; + +/* page 16 0x3821-0x387E */ +static uint16 tab_jisx0212_uni16[]={ +0x580C,0x580D,0x581B,0x581E,0x581F,0x5820,0x5826,0x5827, +0x582D,0x5832,0x5839,0x583F,0x5849,0x584C,0x584D,0x584F, +0x5850,0x5855,0x585F,0x5861,0x5864,0x5867,0x5868,0x5878, +0x587C,0x587F,0x5880,0x5881,0x5887,0x5888,0x5889,0x588A, +0x588C,0x588D,0x588F,0x5890,0x5894,0x5896,0x589D,0x58A0, +0x58A1,0x58A2,0x58A6,0x58A9,0x58B1,0x58B2,0x58C4,0x58BC, +0x58C2,0x58C8,0x58CD,0x58CE,0x58D0,0x58D2,0x58D4,0x58D6, +0x58DA,0x58DD,0x58E1,0x58E2,0x58E9,0x58F3,0x5905,0x5906, +0x590B,0x590C,0x5912,0x5913,0x5914,0x8641,0x591D,0x5921, +0x5923,0x5924,0x5928,0x592F,0x5930,0x5933,0x5935,0x5936, +0x593F,0x5943,0x5946,0x5952,0x5953,0x5959,0x595B,0x595D, +0x595E,0x595F,0x5961,0x5963,0x596B,0x596D}; + +/* page 17 0x3921-0x397E */ +static uint16 tab_jisx0212_uni17[]={ +0x596F,0x5972,0x5975,0x5976,0x5979,0x597B,0x597C,0x598B, +0x598C,0x598E,0x5992,0x5995,0x5997,0x599F,0x59A4,0x59A7, +0x59AD,0x59AE,0x59AF,0x59B0,0x59B3,0x59B7,0x59BA,0x59BC, +0x59C1,0x59C3,0x59C4,0x59C8,0x59CA,0x59CD,0x59D2,0x59DD, +0x59DE,0x59DF,0x59E3,0x59E4,0x59E7,0x59EE,0x59EF,0x59F1, +0x59F2,0x59F4,0x59F7,0x5A00,0x5A04,0x5A0C,0x5A0D,0x5A0E, +0x5A12,0x5A13,0x5A1E,0x5A23,0x5A24,0x5A27,0x5A28,0x5A2A, +0x5A2D,0x5A30,0x5A44,0x5A45,0x5A47,0x5A48,0x5A4C,0x5A50, +0x5A55,0x5A5E,0x5A63,0x5A65,0x5A67,0x5A6D,0x5A77,0x5A7A, +0x5A7B,0x5A7E,0x5A8B,0x5A90,0x5A93,0x5A96,0x5A99,0x5A9C, +0x5A9E,0x5A9F,0x5AA0,0x5AA2,0x5AA7,0x5AAC,0x5AB1,0x5AB2, +0x5AB3,0x5AB5,0x5AB8,0x5ABA,0x5ABB,0x5ABF}; + +/* page 18 0x3A21-0x3A7E */ +static uint16 tab_jisx0212_uni18[]={ +0x5AC4,0x5AC6,0x5AC8,0x5ACF,0x5ADA,0x5ADC,0x5AE0,0x5AE5, +0x5AEA,0x5AEE,0x5AF5,0x5AF6,0x5AFD,0x5B00,0x5B01,0x5B08, +0x5B17,0x5B34,0x5B19,0x5B1B,0x5B1D,0x5B21,0x5B25,0x5B2D, +0x5B38,0x5B41,0x5B4B,0x5B4C,0x5B52,0x5B56,0x5B5E,0x5B68, +0x5B6E,0x5B6F,0x5B7C,0x5B7D,0x5B7E,0x5B7F,0x5B81,0x5B84, +0x5B86,0x5B8A,0x5B8E,0x5B90,0x5B91,0x5B93,0x5B94,0x5B96, +0x5BA8,0x5BA9,0x5BAC,0x5BAD,0x5BAF,0x5BB1,0x5BB2,0x5BB7, +0x5BBA,0x5BBC,0x5BC0,0x5BC1,0x5BCD,0x5BCF,0x5BD6,0x5BD7, +0x5BD8,0x5BD9,0x5BDA,0x5BE0,0x5BEF,0x5BF1,0x5BF4,0x5BFD, +0x5C0C,0x5C17,0x5C1E,0x5C1F,0x5C23,0x5C26,0x5C29,0x5C2B, +0x5C2C,0x5C2E,0x5C30,0x5C32,0x5C35,0x5C36,0x5C59,0x5C5A, +0x5C5C,0x5C62,0x5C63,0x5C67,0x5C68,0x5C69}; + +/* page 19 0x3B21-0x3B7E */ +static uint16 tab_jisx0212_uni19[]={ +0x5C6D,0x5C70,0x5C74,0x5C75,0x5C7A,0x5C7B,0x5C7C,0x5C7D, +0x5C87,0x5C88,0x5C8A,0x5C8F,0x5C92,0x5C9D,0x5C9F,0x5CA0, +0x5CA2,0x5CA3,0x5CA6,0x5CAA,0x5CB2,0x5CB4,0x5CB5,0x5CBA, +0x5CC9,0x5CCB,0x5CD2,0x5CDD,0x5CD7,0x5CEE,0x5CF1,0x5CF2, +0x5CF4,0x5D01,0x5D06,0x5D0D,0x5D12,0x5D2B,0x5D23,0x5D24, +0x5D26,0x5D27,0x5D31,0x5D34,0x5D39,0x5D3D,0x5D3F,0x5D42, +0x5D43,0x5D46,0x5D48,0x5D55,0x5D51,0x5D59,0x5D4A,0x5D5F, +0x5D60,0x5D61,0x5D62,0x5D64,0x5D6A,0x5D6D,0x5D70,0x5D79, +0x5D7A,0x5D7E,0x5D7F,0x5D81,0x5D83,0x5D88,0x5D8A,0x5D92, +0x5D93,0x5D94,0x5D95,0x5D99,0x5D9B,0x5D9F,0x5DA0,0x5DA7, +0x5DAB,0x5DB0,0x5DB4,0x5DB8,0x5DB9,0x5DC3,0x5DC7,0x5DCB, +0x5DD0,0x5DCE,0x5DD8,0x5DD9,0x5DE0,0x5DE4}; + +/* page 20 0x3C21-0x3C7E */ +static uint16 tab_jisx0212_uni20[]={ +0x5DE9,0x5DF8,0x5DF9,0x5E00,0x5E07,0x5E0D,0x5E12,0x5E14, +0x5E15,0x5E18,0x5E1F,0x5E20,0x5E2E,0x5E28,0x5E32,0x5E35, +0x5E3E,0x5E4B,0x5E50,0x5E49,0x5E51,0x5E56,0x5E58,0x5E5B, +0x5E5C,0x5E5E,0x5E68,0x5E6A,0x5E6B,0x5E6C,0x5E6D,0x5E6E, +0x5E70,0x5E80,0x5E8B,0x5E8E,0x5EA2,0x5EA4,0x5EA5,0x5EA8, +0x5EAA,0x5EAC,0x5EB1,0x5EB3,0x5EBD,0x5EBE,0x5EBF,0x5EC6, +0x5ECC,0x5ECB,0x5ECE,0x5ED1,0x5ED2,0x5ED4,0x5ED5,0x5EDC, +0x5EDE,0x5EE5,0x5EEB,0x5F02,0x5F06,0x5F07,0x5F08,0x5F0E, +0x5F19,0x5F1C,0x5F1D,0x5F21,0x5F22,0x5F23,0x5F24,0x5F28, +0x5F2B,0x5F2C,0x5F2E,0x5F30,0x5F34,0x5F36,0x5F3B,0x5F3D, +0x5F3F,0x5F40,0x5F44,0x5F45,0x5F47,0x5F4D,0x5F50,0x5F54, +0x5F58,0x5F5B,0x5F60,0x5F63,0x5F64,0x5F67}; + +/* page 21 0x3D21-0x3D7E */ +static uint16 tab_jisx0212_uni21[]={ +0x5F6F,0x5F72,0x5F74,0x5F75,0x5F78,0x5F7A,0x5F7D,0x5F7E, +0x5F89,0x5F8D,0x5F8F,0x5F96,0x5F9C,0x5F9D,0x5FA2,0x5FA7, +0x5FAB,0x5FA4,0x5FAC,0x5FAF,0x5FB0,0x5FB1,0x5FB8,0x5FC4, +0x5FC7,0x5FC8,0x5FC9,0x5FCB,0x5FD0,0x5FD1,0x5FD2,0x5FD3, +0x5FD4,0x5FDE,0x5FE1,0x5FE2,0x5FE8,0x5FE9,0x5FEA,0x5FEC, +0x5FED,0x5FEE,0x5FEF,0x5FF2,0x5FF3,0x5FF6,0x5FFA,0x5FFC, +0x6007,0x600A,0x600D,0x6013,0x6014,0x6017,0x6018,0x601A, +0x601F,0x6024,0x602D,0x6033,0x6035,0x6040,0x6047,0x6048, +0x6049,0x604C,0x6051,0x6054,0x6056,0x6057,0x605D,0x6061, +0x6067,0x6071,0x607E,0x607F,0x6082,0x6086,0x6088,0x608A, +0x608E,0x6091,0x6093,0x6095,0x6098,0x609D,0x609E,0x60A2, +0x60A4,0x60A5,0x60A8,0x60B0,0x60B1,0x60B7}; + +/* page 22 0x3E21-0x3E7E */ +static uint16 tab_jisx0212_uni22[]={ +0x60BB,0x60BE,0x60C2,0x60C4,0x60C8,0x60C9,0x60CA,0x60CB, +0x60CE,0x60CF,0x60D4,0x60D5,0x60D9,0x60DB,0x60DD,0x60DE, +0x60E2,0x60E5,0x60F2,0x60F5,0x60F8,0x60FC,0x60FD,0x6102, +0x6107,0x610A,0x610C,0x6110,0x6111,0x6112,0x6113,0x6114, +0x6116,0x6117,0x6119,0x611C,0x611E,0x6122,0x612A,0x612B, +0x6130,0x6131,0x6135,0x6136,0x6137,0x6139,0x6141,0x6145, +0x6146,0x6149,0x615E,0x6160,0x616C,0x6172,0x6178,0x617B, +0x617C,0x617F,0x6180,0x6181,0x6183,0x6184,0x618B,0x618D, +0x6192,0x6193,0x6197,0x6198,0x619C,0x619D,0x619F,0x61A0, +0x61A5,0x61A8,0x61AA,0x61AD,0x61B8,0x61B9,0x61BC,0x61C0, +0x61C1,0x61C2,0x61CE,0x61CF,0x61D5,0x61DC,0x61DD,0x61DE, +0x61DF,0x61E1,0x61E2,0x61E7,0x61E9,0x61E5}; + +/* page 23 0x3F21-0x3F7E */ +static uint16 tab_jisx0212_uni23[]={ +0x61EC,0x61ED,0x61EF,0x6201,0x6203,0x6204,0x6207,0x6213, +0x6215,0x621C,0x6220,0x6222,0x6223,0x6227,0x6229,0x622B, +0x6239,0x623D,0x6242,0x6243,0x6244,0x6246,0x624C,0x6250, +0x6251,0x6252,0x6254,0x6256,0x625A,0x625C,0x6264,0x626D, +0x626F,0x6273,0x627A,0x627D,0x628D,0x628E,0x628F,0x6290, +0x62A6,0x62A8,0x62B3,0x62B6,0x62B7,0x62BA,0x62BE,0x62BF, +0x62C4,0x62CE,0x62D5,0x62D6,0x62DA,0x62EA,0x62F2,0x62F4, +0x62FC,0x62FD,0x6303,0x6304,0x630A,0x630B,0x630D,0x6310, +0x6313,0x6316,0x6318,0x6329,0x632A,0x632D,0x6335,0x6336, +0x6339,0x633C,0x6341,0x6342,0x6343,0x6344,0x6346,0x634A, +0x634B,0x634E,0x6352,0x6353,0x6354,0x6358,0x635B,0x6365, +0x6366,0x636C,0x636D,0x6371,0x6374,0x6375}; + +/* page 24 0x4021-0x407E */ +static uint16 tab_jisx0212_uni24[]={ +0x6378,0x637C,0x637D,0x637F,0x6382,0x6384,0x6387,0x638A, +0x6390,0x6394,0x6395,0x6399,0x639A,0x639E,0x63A4,0x63A6, +0x63AD,0x63AE,0x63AF,0x63BD,0x63C1,0x63C5,0x63C8,0x63CE, +0x63D1,0x63D3,0x63D4,0x63D5,0x63DC,0x63E0,0x63E5,0x63EA, +0x63EC,0x63F2,0x63F3,0x63F5,0x63F8,0x63F9,0x6409,0x640A, +0x6410,0x6412,0x6414,0x6418,0x641E,0x6420,0x6422,0x6424, +0x6425,0x6429,0x642A,0x642F,0x6430,0x6435,0x643D,0x643F, +0x644B,0x644F,0x6451,0x6452,0x6453,0x6454,0x645A,0x645B, +0x645C,0x645D,0x645F,0x6460,0x6461,0x6463,0x646D,0x6473, +0x6474,0x647B,0x647D,0x6485,0x6487,0x648F,0x6490,0x6491, +0x6498,0x6499,0x649B,0x649D,0x649F,0x64A1,0x64A3,0x64A6, +0x64A8,0x64AC,0x64B3,0x64BD,0x64BE,0x64BF}; + +/* page 25 0x4121-0x417E */ +static uint16 tab_jisx0212_uni25[]={ +0x64C4,0x64C9,0x64CA,0x64CB,0x64CC,0x64CE,0x64D0,0x64D1, +0x64D5,0x64D7,0x64E4,0x64E5,0x64E9,0x64EA,0x64ED,0x64F0, +0x64F5,0x64F7,0x64FB,0x64FF,0x6501,0x6504,0x6508,0x6509, +0x650A,0x650F,0x6513,0x6514,0x6516,0x6519,0x651B,0x651E, +0x651F,0x6522,0x6526,0x6529,0x652E,0x6531,0x653A,0x653C, +0x653D,0x6543,0x6547,0x6549,0x6550,0x6552,0x6554,0x655F, +0x6560,0x6567,0x656B,0x657A,0x657D,0x6581,0x6585,0x658A, +0x6592,0x6595,0x6598,0x659D,0x65A0,0x65A3,0x65A6,0x65AE, +0x65B2,0x65B3,0x65B4,0x65BF,0x65C2,0x65C8,0x65C9,0x65CE, +0x65D0,0x65D4,0x65D6,0x65D8,0x65DF,0x65F0,0x65F2,0x65F4, +0x65F5,0x65F9,0x65FE,0x65FF,0x6600,0x6604,0x6608,0x6609, +0x660D,0x6611,0x6612,0x6615,0x6616,0x661D}; + +/* page 26 0x4221-0x427E */ +static uint16 tab_jisx0212_uni26[]={ +0x661E,0x6621,0x6622,0x6623,0x6624,0x6626,0x6629,0x662A, +0x662B,0x662C,0x662E,0x6630,0x6631,0x6633,0x6639,0x6637, +0x6640,0x6645,0x6646,0x664A,0x664C,0x6651,0x664E,0x6657, +0x6658,0x6659,0x665B,0x665C,0x6660,0x6661,0x66FB,0x666A, +0x666B,0x666C,0x667E,0x6673,0x6675,0x667F,0x6677,0x6678, +0x6679,0x667B,0x6680,0x667C,0x668B,0x668C,0x668D,0x6690, +0x6692,0x6699,0x669A,0x669B,0x669C,0x669F,0x66A0,0x66A4, +0x66AD,0x66B1,0x66B2,0x66B5,0x66BB,0x66BF,0x66C0,0x66C2, +0x66C3,0x66C8,0x66CC,0x66CE,0x66CF,0x66D4,0x66DB,0x66DF, +0x66E8,0x66EB,0x66EC,0x66EE,0x66FA,0x6705,0x6707,0x670E, +0x6713,0x6719,0x671C,0x6720,0x6722,0x6733,0x673E,0x6745, +0x6747,0x6748,0x674C,0x6754,0x6755,0x675D}; + +/* page 27 0x4321-0x437E */ +static uint16 tab_jisx0212_uni27[]={ +0x6766,0x676C,0x676E,0x6774,0x6776,0x677B,0x6781,0x6784, +0x678E,0x678F,0x6791,0x6793,0x6796,0x6798,0x6799,0x679B, +0x67B0,0x67B1,0x67B2,0x67B5,0x67BB,0x67BC,0x67BD,0x67F9, +0x67C0,0x67C2,0x67C3,0x67C5,0x67C8,0x67C9,0x67D2,0x67D7, +0x67D9,0x67DC,0x67E1,0x67E6,0x67F0,0x67F2,0x67F6,0x67F7, +0x6852,0x6814,0x6819,0x681D,0x681F,0x6828,0x6827,0x682C, +0x682D,0x682F,0x6830,0x6831,0x6833,0x683B,0x683F,0x6844, +0x6845,0x684A,0x684C,0x6855,0x6857,0x6858,0x685B,0x686B, +0x686E,0x686F,0x6870,0x6871,0x6872,0x6875,0x6879,0x687A, +0x687B,0x687C,0x6882,0x6884,0x6886,0x6888,0x6896,0x6898, +0x689A,0x689C,0x68A1,0x68A3,0x68A5,0x68A9,0x68AA,0x68AE, +0x68B2,0x68BB,0x68C5,0x68C8,0x68CC,0x68CF}; + +/* page 28 0x4421-0x447E */ +static uint16 tab_jisx0212_uni28[]={ +0x68D0,0x68D1,0x68D3,0x68D6,0x68D9,0x68DC,0x68DD,0x68E5, +0x68E8,0x68EA,0x68EB,0x68EC,0x68ED,0x68F0,0x68F1,0x68F5, +0x68F6,0x68FB,0x68FC,0x68FD,0x6906,0x6909,0x690A,0x6910, +0x6911,0x6913,0x6916,0x6917,0x6931,0x6933,0x6935,0x6938, +0x693B,0x6942,0x6945,0x6949,0x694E,0x6957,0x695B,0x6963, +0x6964,0x6965,0x6966,0x6968,0x6969,0x696C,0x6970,0x6971, +0x6972,0x697A,0x697B,0x697F,0x6980,0x698D,0x6992,0x6996, +0x6998,0x69A1,0x69A5,0x69A6,0x69A8,0x69AB,0x69AD,0x69AF, +0x69B7,0x69B8,0x69BA,0x69BC,0x69C5,0x69C8,0x69D1,0x69D6, +0x69D7,0x69E2,0x69E5,0x69EE,0x69EF,0x69F1,0x69F3,0x69F5, +0x69FE,0x6A00,0x6A01,0x6A03,0x6A0F,0x6A11,0x6A15,0x6A1A, +0x6A1D,0x6A20,0x6A24,0x6A28,0x6A30,0x6A32}; + +/* page 29 0x4521-0x457E */ +static uint16 tab_jisx0212_uni29[]={ +0x6A34,0x6A37,0x6A3B,0x6A3E,0x6A3F,0x6A45,0x6A46,0x6A49, +0x6A4A,0x6A4E,0x6A50,0x6A51,0x6A52,0x6A55,0x6A56,0x6A5B, +0x6A64,0x6A67,0x6A6A,0x6A71,0x6A73,0x6A7E,0x6A81,0x6A83, +0x6A86,0x6A87,0x6A89,0x6A8B,0x6A91,0x6A9B,0x6A9D,0x6A9E, +0x6A9F,0x6AA5,0x6AAB,0x6AAF,0x6AB0,0x6AB1,0x6AB4,0x6ABD, +0x6ABE,0x6ABF,0x6AC6,0x6AC9,0x6AC8,0x6ACC,0x6AD0,0x6AD4, +0x6AD5,0x6AD6,0x6ADC,0x6ADD,0x6AE4,0x6AE7,0x6AEC,0x6AF0, +0x6AF1,0x6AF2,0x6AFC,0x6AFD,0x6B02,0x6B03,0x6B06,0x6B07, +0x6B09,0x6B0F,0x6B10,0x6B11,0x6B17,0x6B1B,0x6B1E,0x6B24, +0x6B28,0x6B2B,0x6B2C,0x6B2F,0x6B35,0x6B36,0x6B3B,0x6B3F, +0x6B46,0x6B4A,0x6B4D,0x6B52,0x6B56,0x6B58,0x6B5D,0x6B60, +0x6B67,0x6B6B,0x6B6E,0x6B70,0x6B75,0x6B7D}; + +/* page 30 0x4621-0x467E */ +static uint16 tab_jisx0212_uni30[]={ +0x6B7E,0x6B82,0x6B85,0x6B97,0x6B9B,0x6B9F,0x6BA0,0x6BA2, +0x6BA3,0x6BA8,0x6BA9,0x6BAC,0x6BAD,0x6BAE,0x6BB0,0x6BB8, +0x6BB9,0x6BBD,0x6BBE,0x6BC3,0x6BC4,0x6BC9,0x6BCC,0x6BD6, +0x6BDA,0x6BE1,0x6BE3,0x6BE6,0x6BE7,0x6BEE,0x6BF1,0x6BF7, +0x6BF9,0x6BFF,0x6C02,0x6C04,0x6C05,0x6C09,0x6C0D,0x6C0E, +0x6C10,0x6C12,0x6C19,0x6C1F,0x6C26,0x6C27,0x6C28,0x6C2C, +0x6C2E,0x6C33,0x6C35,0x6C36,0x6C3A,0x6C3B,0x6C3F,0x6C4A, +0x6C4B,0x6C4D,0x6C4F,0x6C52,0x6C54,0x6C59,0x6C5B,0x6C5C, +0x6C6B,0x6C6D,0x6C6F,0x6C74,0x6C76,0x6C78,0x6C79,0x6C7B, +0x6C85,0x6C86,0x6C87,0x6C89,0x6C94,0x6C95,0x6C97,0x6C98, +0x6C9C,0x6C9F,0x6CB0,0x6CB2,0x6CB4,0x6CC2,0x6CC6,0x6CCD, +0x6CCF,0x6CD0,0x6CD1,0x6CD2,0x6CD4,0x6CD6}; + +/* page 31 0x4721-0x477E */ +static uint16 tab_jisx0212_uni31[]={ +0x6CDA,0x6CDC,0x6CE0,0x6CE7,0x6CE9,0x6CEB,0x6CEC,0x6CEE, +0x6CF2,0x6CF4,0x6D04,0x6D07,0x6D0A,0x6D0E,0x6D0F,0x6D11, +0x6D13,0x6D1A,0x6D26,0x6D27,0x6D28,0x6C67,0x6D2E,0x6D2F, +0x6D31,0x6D39,0x6D3C,0x6D3F,0x6D57,0x6D5E,0x6D5F,0x6D61, +0x6D65,0x6D67,0x6D6F,0x6D70,0x6D7C,0x6D82,0x6D87,0x6D91, +0x6D92,0x6D94,0x6D96,0x6D97,0x6D98,0x6DAA,0x6DAC,0x6DB4, +0x6DB7,0x6DB9,0x6DBD,0x6DBF,0x6DC4,0x6DC8,0x6DCA,0x6DCE, +0x6DCF,0x6DD6,0x6DDB,0x6DDD,0x6DDF,0x6DE0,0x6DE2,0x6DE5, +0x6DE9,0x6DEF,0x6DF0,0x6DF4,0x6DF6,0x6DFC,0x6E00,0x6E04, +0x6E1E,0x6E22,0x6E27,0x6E32,0x6E36,0x6E39,0x6E3B,0x6E3C, +0x6E44,0x6E45,0x6E48,0x6E49,0x6E4B,0x6E4F,0x6E51,0x6E52, +0x6E53,0x6E54,0x6E57,0x6E5C,0x6E5D,0x6E5E}; + +/* page 32 0x4821-0x487E */ +static uint16 tab_jisx0212_uni32[]={ +0x6E62,0x6E63,0x6E68,0x6E73,0x6E7B,0x6E7D,0x6E8D,0x6E93, +0x6E99,0x6EA0,0x6EA7,0x6EAD,0x6EAE,0x6EB1,0x6EB3,0x6EBB, +0x6EBF,0x6EC0,0x6EC1,0x6EC3,0x6EC7,0x6EC8,0x6ECA,0x6ECD, +0x6ECE,0x6ECF,0x6EEB,0x6EED,0x6EEE,0x6EF9,0x6EFB,0x6EFD, +0x6F04,0x6F08,0x6F0A,0x6F0C,0x6F0D,0x6F16,0x6F18,0x6F1A, +0x6F1B,0x6F26,0x6F29,0x6F2A,0x6F2F,0x6F30,0x6F33,0x6F36, +0x6F3B,0x6F3C,0x6F2D,0x6F4F,0x6F51,0x6F52,0x6F53,0x6F57, +0x6F59,0x6F5A,0x6F5D,0x6F5E,0x6F61,0x6F62,0x6F68,0x6F6C, +0x6F7D,0x6F7E,0x6F83,0x6F87,0x6F88,0x6F8B,0x6F8C,0x6F8D, +0x6F90,0x6F92,0x6F93,0x6F94,0x6F96,0x6F9A,0x6F9F,0x6FA0, +0x6FA5,0x6FA6,0x6FA7,0x6FA8,0x6FAE,0x6FAF,0x6FB0,0x6FB5, +0x6FB6,0x6FBC,0x6FC5,0x6FC7,0x6FC8,0x6FCA}; + +/* page 33 0x4921-0x497E */ +static uint16 tab_jisx0212_uni33[]={ +0x6FDA,0x6FDE,0x6FE8,0x6FE9,0x6FF0,0x6FF5,0x6FF9,0x6FFC, +0x6FFD,0x7000,0x7005,0x7006,0x7007,0x700D,0x7017,0x7020, +0x7023,0x702F,0x7034,0x7037,0x7039,0x703C,0x7043,0x7044, +0x7048,0x7049,0x704A,0x704B,0x7054,0x7055,0x705D,0x705E, +0x704E,0x7064,0x7065,0x706C,0x706E,0x7075,0x7076,0x707E, +0x7081,0x7085,0x7086,0x7094,0x7095,0x7096,0x7097,0x7098, +0x709B,0x70A4,0x70AB,0x70B0,0x70B1,0x70B4,0x70B7,0x70CA, +0x70D1,0x70D3,0x70D4,0x70D5,0x70D6,0x70D8,0x70DC,0x70E4, +0x70FA,0x7103,0x7104,0x7105,0x7106,0x7107,0x710B,0x710C, +0x710F,0x711E,0x7120,0x712B,0x712D,0x712F,0x7130,0x7131, +0x7138,0x7141,0x7145,0x7146,0x7147,0x714A,0x714B,0x7150, +0x7152,0x7157,0x715A,0x715C,0x715E,0x7160}; + +/* page 34 0x4A21-0x4A7E */ +static uint16 tab_jisx0212_uni34[]={ +0x7168,0x7179,0x7180,0x7185,0x7187,0x718C,0x7192,0x719A, +0x719B,0x71A0,0x71A2,0x71AF,0x71B0,0x71B2,0x71B3,0x71BA, +0x71BF,0x71C0,0x71C1,0x71C4,0x71CB,0x71CC,0x71D3,0x71D6, +0x71D9,0x71DA,0x71DC,0x71F8,0x71FE,0x7200,0x7207,0x7208, +0x7209,0x7213,0x7217,0x721A,0x721D,0x721F,0x7224,0x722B, +0x722F,0x7234,0x7238,0x7239,0x7241,0x7242,0x7243,0x7245, +0x724E,0x724F,0x7250,0x7253,0x7255,0x7256,0x725A,0x725C, +0x725E,0x7260,0x7263,0x7268,0x726B,0x726E,0x726F,0x7271, +0x7277,0x7278,0x727B,0x727C,0x727F,0x7284,0x7289,0x728D, +0x728E,0x7293,0x729B,0x72A8,0x72AD,0x72AE,0x72B1,0x72B4, +0x72BE,0x72C1,0x72C7,0x72C9,0x72CC,0x72D5,0x72D6,0x72D8, +0x72DF,0x72E5,0x72F3,0x72F4,0x72FA,0x72FB}; + +/* page 35 0x4B21-0x4B7E */ +static uint16 tab_jisx0212_uni35[]={ +0x72FE,0x7302,0x7304,0x7305,0x7307,0x730B,0x730D,0x7312, +0x7313,0x7318,0x7319,0x731E,0x7322,0x7324,0x7327,0x7328, +0x732C,0x7331,0x7332,0x7335,0x733A,0x733B,0x733D,0x7343, +0x734D,0x7350,0x7352,0x7356,0x7358,0x735D,0x735E,0x735F, +0x7360,0x7366,0x7367,0x7369,0x736B,0x736C,0x736E,0x736F, +0x7371,0x7377,0x7379,0x737C,0x7380,0x7381,0x7383,0x7385, +0x7386,0x738E,0x7390,0x7393,0x7395,0x7397,0x7398,0x739C, +0x739E,0x739F,0x73A0,0x73A2,0x73A5,0x73A6,0x73AA,0x73AB, +0x73AD,0x73B5,0x73B7,0x73B9,0x73BC,0x73BD,0x73BF,0x73C5, +0x73C6,0x73C9,0x73CB,0x73CC,0x73CF,0x73D2,0x73D3,0x73D6, +0x73D9,0x73DD,0x73E1,0x73E3,0x73E6,0x73E7,0x73E9,0x73F4, +0x73F5,0x73F7,0x73F9,0x73FA,0x73FB,0x73FD}; + +/* page 36 0x4C21-0x4C7E */ +static uint16 tab_jisx0212_uni36[]={ +0x73FF,0x7400,0x7401,0x7404,0x7407,0x740A,0x7411,0x741A, +0x741B,0x7424,0x7426,0x7428,0x7429,0x742A,0x742B,0x742C, +0x742D,0x742E,0x742F,0x7430,0x7431,0x7439,0x7440,0x7443, +0x7444,0x7446,0x7447,0x744B,0x744D,0x7451,0x7452,0x7457, +0x745D,0x7462,0x7466,0x7467,0x7468,0x746B,0x746D,0x746E, +0x7471,0x7472,0x7480,0x7481,0x7485,0x7486,0x7487,0x7489, +0x748F,0x7490,0x7491,0x7492,0x7498,0x7499,0x749A,0x749C, +0x749F,0x74A0,0x74A1,0x74A3,0x74A6,0x74A8,0x74A9,0x74AA, +0x74AB,0x74AE,0x74AF,0x74B1,0x74B2,0x74B5,0x74B9,0x74BB, +0x74BF,0x74C8,0x74C9,0x74CC,0x74D0,0x74D3,0x74D8,0x74DA, +0x74DB,0x74DE,0x74DF,0x74E4,0x74E8,0x74EA,0x74EB,0x74EF, +0x74F4,0x74FA,0x74FB,0x74FC,0x74FF,0x7506}; + +/* page 37 0x4D21-0x4D7E */ +static uint16 tab_jisx0212_uni37[]={ +0x7512,0x7516,0x7517,0x7520,0x7521,0x7524,0x7527,0x7529, +0x752A,0x752F,0x7536,0x7539,0x753D,0x753E,0x753F,0x7540, +0x7543,0x7547,0x7548,0x754E,0x7550,0x7552,0x7557,0x755E, +0x755F,0x7561,0x756F,0x7571,0x7579,0x757A,0x757B,0x757C, +0x757D,0x757E,0x7581,0x7585,0x7590,0x7592,0x7593,0x7595, +0x7599,0x759C,0x75A2,0x75A4,0x75B4,0x75BA,0x75BF,0x75C0, +0x75C1,0x75C4,0x75C6,0x75CC,0x75CE,0x75CF,0x75D7,0x75DC, +0x75DF,0x75E0,0x75E1,0x75E4,0x75E7,0x75EC,0x75EE,0x75EF, +0x75F1,0x75F9,0x7600,0x7602,0x7603,0x7604,0x7607,0x7608, +0x760A,0x760C,0x760F,0x7612,0x7613,0x7615,0x7616,0x7619, +0x761B,0x761C,0x761D,0x761E,0x7623,0x7625,0x7626,0x7629, +0x762D,0x7632,0x7633,0x7635,0x7638,0x7639}; + +/* page 38 0x4E21-0x4E7E */ +static uint16 tab_jisx0212_uni38[]={ +0x763A,0x763C,0x764A,0x7640,0x7641,0x7643,0x7644,0x7645, +0x7649,0x764B,0x7655,0x7659,0x765F,0x7664,0x7665,0x766D, +0x766E,0x766F,0x7671,0x7674,0x7681,0x7685,0x768C,0x768D, +0x7695,0x769B,0x769C,0x769D,0x769F,0x76A0,0x76A2,0x76A3, +0x76A4,0x76A5,0x76A6,0x76A7,0x76A8,0x76AA,0x76AD,0x76BD, +0x76C1,0x76C5,0x76C9,0x76CB,0x76CC,0x76CE,0x76D4,0x76D9, +0x76E0,0x76E6,0x76E8,0x76EC,0x76F0,0x76F1,0x76F6,0x76F9, +0x76FC,0x7700,0x7706,0x770A,0x770E,0x7712,0x7714,0x7715, +0x7717,0x7719,0x771A,0x771C,0x7722,0x7728,0x772D,0x772E, +0x772F,0x7734,0x7735,0x7736,0x7739,0x773D,0x773E,0x7742, +0x7745,0x7746,0x774A,0x774D,0x774E,0x774F,0x7752,0x7756, +0x7757,0x775C,0x775E,0x775F,0x7760,0x7762}; + +/* page 39 0x4F21-0x4F7E */ +static uint16 tab_jisx0212_uni39[]={ +0x7764,0x7767,0x776A,0x776C,0x7770,0x7772,0x7773,0x7774, +0x777A,0x777D,0x7780,0x7784,0x778C,0x778D,0x7794,0x7795, +0x7796,0x779A,0x779F,0x77A2,0x77A7,0x77AA,0x77AE,0x77AF, +0x77B1,0x77B5,0x77BE,0x77C3,0x77C9,0x77D1,0x77D2,0x77D5, +0x77D9,0x77DE,0x77DF,0x77E0,0x77E4,0x77E6,0x77EA,0x77EC, +0x77F0,0x77F1,0x77F4,0x77F8,0x77FB,0x7805,0x7806,0x7809, +0x780D,0x780E,0x7811,0x781D,0x7821,0x7822,0x7823,0x782D, +0x782E,0x7830,0x7835,0x7837,0x7843,0x7844,0x7847,0x7848, +0x784C,0x784E,0x7852,0x785C,0x785E,0x7860,0x7861,0x7863, +0x7864,0x7868,0x786A,0x786E,0x787A,0x787E,0x788A,0x788F, +0x7894,0x7898,0x78A1,0x789D,0x789E,0x789F,0x78A4,0x78A8, +0x78AC,0x78AD,0x78B0,0x78B1,0x78B2,0x78B3}; + +/* page 40 0x5021-0x507E */ +static uint16 tab_jisx0212_uni40[]={ +0x78BB,0x78BD,0x78BF,0x78C7,0x78C8,0x78C9,0x78CC,0x78CE, +0x78D2,0x78D3,0x78D5,0x78D6,0x78E4,0x78DB,0x78DF,0x78E0, +0x78E1,0x78E6,0x78EA,0x78F2,0x78F3,0x7900,0x78F6,0x78F7, +0x78FA,0x78FB,0x78FF,0x7906,0x790C,0x7910,0x791A,0x791C, +0x791E,0x791F,0x7920,0x7925,0x7927,0x7929,0x792D,0x7931, +0x7934,0x7935,0x793B,0x793D,0x793F,0x7944,0x7945,0x7946, +0x794A,0x794B,0x794F,0x7951,0x7954,0x7958,0x795B,0x795C, +0x7967,0x7969,0x796B,0x7972,0x7979,0x797B,0x797C,0x797E, +0x798B,0x798C,0x7991,0x7993,0x7994,0x7995,0x7996,0x7998, +0x799B,0x799C,0x79A1,0x79A8,0x79A9,0x79AB,0x79AF,0x79B1, +0x79B4,0x79B8,0x79BB,0x79C2,0x79C4,0x79C7,0x79C8,0x79CA, +0x79CF,0x79D4,0x79D6,0x79DA,0x79DD,0x79DE}; + +/* page 41 0x5121-0x517E */ +static uint16 tab_jisx0212_uni41[]={ +0x79E0,0x79E2,0x79E5,0x79EA,0x79EB,0x79ED,0x79F1,0x79F8, +0x79FC,0x7A02,0x7A03,0x7A07,0x7A09,0x7A0A,0x7A0C,0x7A11, +0x7A15,0x7A1B,0x7A1E,0x7A21,0x7A27,0x7A2B,0x7A2D,0x7A2F, +0x7A30,0x7A34,0x7A35,0x7A38,0x7A39,0x7A3A,0x7A44,0x7A45, +0x7A47,0x7A48,0x7A4C,0x7A55,0x7A56,0x7A59,0x7A5C,0x7A5D, +0x7A5F,0x7A60,0x7A65,0x7A67,0x7A6A,0x7A6D,0x7A75,0x7A78, +0x7A7E,0x7A80,0x7A82,0x7A85,0x7A86,0x7A8A,0x7A8B,0x7A90, +0x7A91,0x7A94,0x7A9E,0x7AA0,0x7AA3,0x7AAC,0x7AB3,0x7AB5, +0x7AB9,0x7ABB,0x7ABC,0x7AC6,0x7AC9,0x7ACC,0x7ACE,0x7AD1, +0x7ADB,0x7AE8,0x7AE9,0x7AEB,0x7AEC,0x7AF1,0x7AF4,0x7AFB, +0x7AFD,0x7AFE,0x7B07,0x7B14,0x7B1F,0x7B23,0x7B27,0x7B29, +0x7B2A,0x7B2B,0x7B2D,0x7B2E,0x7B2F,0x7B30}; + +/* page 42 0x5221-0x527E */ +static uint16 tab_jisx0212_uni42[]={ +0x7B31,0x7B34,0x7B3D,0x7B3F,0x7B40,0x7B41,0x7B47,0x7B4E, +0x7B55,0x7B60,0x7B64,0x7B66,0x7B69,0x7B6A,0x7B6D,0x7B6F, +0x7B72,0x7B73,0x7B77,0x7B84,0x7B89,0x7B8E,0x7B90,0x7B91, +0x7B96,0x7B9B,0x7B9E,0x7BA0,0x7BA5,0x7BAC,0x7BAF,0x7BB0, +0x7BB2,0x7BB5,0x7BB6,0x7BBA,0x7BBB,0x7BBC,0x7BBD,0x7BC2, +0x7BC5,0x7BC8,0x7BCA,0x7BD4,0x7BD6,0x7BD7,0x7BD9,0x7BDA, +0x7BDB,0x7BE8,0x7BEA,0x7BF2,0x7BF4,0x7BF5,0x7BF8,0x7BF9, +0x7BFA,0x7BFC,0x7BFE,0x7C01,0x7C02,0x7C03,0x7C04,0x7C06, +0x7C09,0x7C0B,0x7C0C,0x7C0E,0x7C0F,0x7C19,0x7C1B,0x7C20, +0x7C25,0x7C26,0x7C28,0x7C2C,0x7C31,0x7C33,0x7C34,0x7C36, +0x7C39,0x7C3A,0x7C46,0x7C4A,0x7C55,0x7C51,0x7C52,0x7C53, +0x7C59,0x7C5A,0x7C5B,0x7C5C,0x7C5D,0x7C5E}; + +/* page 43 0x5321-0x537E */ +static uint16 tab_jisx0212_uni43[]={ +0x7C61,0x7C63,0x7C67,0x7C69,0x7C6D,0x7C6E,0x7C70,0x7C72, +0x7C79,0x7C7C,0x7C7D,0x7C86,0x7C87,0x7C8F,0x7C94,0x7C9E, +0x7CA0,0x7CA6,0x7CB0,0x7CB6,0x7CB7,0x7CBA,0x7CBB,0x7CBC, +0x7CBF,0x7CC4,0x7CC7,0x7CC8,0x7CC9,0x7CCD,0x7CCF,0x7CD3, +0x7CD4,0x7CD5,0x7CD7,0x7CD9,0x7CDA,0x7CDD,0x7CE6,0x7CE9, +0x7CEB,0x7CF5,0x7D03,0x7D07,0x7D08,0x7D09,0x7D0F,0x7D11, +0x7D12,0x7D13,0x7D16,0x7D1D,0x7D1E,0x7D23,0x7D26,0x7D2A, +0x7D2D,0x7D31,0x7D3C,0x7D3D,0x7D3E,0x7D40,0x7D41,0x7D47, +0x7D48,0x7D4D,0x7D51,0x7D53,0x7D57,0x7D59,0x7D5A,0x7D5C, +0x7D5D,0x7D65,0x7D67,0x7D6A,0x7D70,0x7D78,0x7D7A,0x7D7B, +0x7D7F,0x7D81,0x7D82,0x7D83,0x7D85,0x7D86,0x7D88,0x7D8B, +0x7D8C,0x7D8D,0x7D91,0x7D96,0x7D97,0x7D9D}; + +/* page 44 0x5421-0x547E */ +static uint16 tab_jisx0212_uni44[]={ +0x7D9E,0x7DA6,0x7DA7,0x7DAA,0x7DB3,0x7DB6,0x7DB7,0x7DB9, +0x7DC2,0x7DC3,0x7DC4,0x7DC5,0x7DC6,0x7DCC,0x7DCD,0x7DCE, +0x7DD7,0x7DD9,0x7E00,0x7DE2,0x7DE5,0x7DE6,0x7DEA,0x7DEB, +0x7DED,0x7DF1,0x7DF5,0x7DF6,0x7DF9,0x7DFA,0x7E08,0x7E10, +0x7E11,0x7E15,0x7E17,0x7E1C,0x7E1D,0x7E20,0x7E27,0x7E28, +0x7E2C,0x7E2D,0x7E2F,0x7E33,0x7E36,0x7E3F,0x7E44,0x7E45, +0x7E47,0x7E4E,0x7E50,0x7E52,0x7E58,0x7E5F,0x7E61,0x7E62, +0x7E65,0x7E6B,0x7E6E,0x7E6F,0x7E73,0x7E78,0x7E7E,0x7E81, +0x7E86,0x7E87,0x7E8A,0x7E8D,0x7E91,0x7E95,0x7E98,0x7E9A, +0x7E9D,0x7E9E,0x7F3C,0x7F3B,0x7F3D,0x7F3E,0x7F3F,0x7F43, +0x7F44,0x7F47,0x7F4F,0x7F52,0x7F53,0x7F5B,0x7F5C,0x7F5D, +0x7F61,0x7F63,0x7F64,0x7F65,0x7F66,0x7F6D}; + +/* page 45 0x5521-0x557E */ +static uint16 tab_jisx0212_uni45[]={ +0x7F71,0x7F7D,0x7F7E,0x7F7F,0x7F80,0x7F8B,0x7F8D,0x7F8F, +0x7F90,0x7F91,0x7F96,0x7F97,0x7F9C,0x7FA1,0x7FA2,0x7FA6, +0x7FAA,0x7FAD,0x7FB4,0x7FBC,0x7FBF,0x7FC0,0x7FC3,0x7FC8, +0x7FCE,0x7FCF,0x7FDB,0x7FDF,0x7FE3,0x7FE5,0x7FE8,0x7FEC, +0x7FEE,0x7FEF,0x7FF2,0x7FFA,0x7FFD,0x7FFE,0x7FFF,0x8007, +0x8008,0x800A,0x800D,0x800E,0x800F,0x8011,0x8013,0x8014, +0x8016,0x801D,0x801E,0x801F,0x8020,0x8024,0x8026,0x802C, +0x802E,0x8030,0x8034,0x8035,0x8037,0x8039,0x803A,0x803C, +0x803E,0x8040,0x8044,0x8060,0x8064,0x8066,0x806D,0x8071, +0x8075,0x8081,0x8088,0x808E,0x809C,0x809E,0x80A6,0x80A7, +0x80AB,0x80B8,0x80B9,0x80C8,0x80CD,0x80CF,0x80D2,0x80D4, +0x80D5,0x80D7,0x80D8,0x80E0,0x80ED,0x80EE}; + +/* page 46 0x5621-0x567E */ +static uint16 tab_jisx0212_uni46[]={ +0x80F0,0x80F2,0x80F3,0x80F6,0x80F9,0x80FA,0x80FE,0x8103, +0x810B,0x8116,0x8117,0x8118,0x811C,0x811E,0x8120,0x8124, +0x8127,0x812C,0x8130,0x8135,0x813A,0x813C,0x8145,0x8147, +0x814A,0x814C,0x8152,0x8157,0x8160,0x8161,0x8167,0x8168, +0x8169,0x816D,0x816F,0x8177,0x8181,0x8190,0x8184,0x8185, +0x8186,0x818B,0x818E,0x8196,0x8198,0x819B,0x819E,0x81A2, +0x81AE,0x81B2,0x81B4,0x81BB,0x81CB,0x81C3,0x81C5,0x81CA, +0x81CE,0x81CF,0x81D5,0x81D7,0x81DB,0x81DD,0x81DE,0x81E1, +0x81E4,0x81EB,0x81EC,0x81F0,0x81F1,0x81F2,0x81F5,0x81F6, +0x81F8,0x81F9,0x81FD,0x81FF,0x8200,0x8203,0x820F,0x8213, +0x8214,0x8219,0x821A,0x821D,0x8221,0x8222,0x8228,0x8232, +0x8234,0x823A,0x8243,0x8244,0x8245,0x8246}; + +/* page 47 0x5721-0x577E */ +static uint16 tab_jisx0212_uni47[]={ +0x824B,0x824E,0x824F,0x8251,0x8256,0x825C,0x8260,0x8263, +0x8267,0x826D,0x8274,0x827B,0x827D,0x827F,0x8280,0x8281, +0x8283,0x8284,0x8287,0x8289,0x828A,0x828E,0x8291,0x8294, +0x8296,0x8298,0x829A,0x829B,0x82A0,0x82A1,0x82A3,0x82A4, +0x82A7,0x82A8,0x82A9,0x82AA,0x82AE,0x82B0,0x82B2,0x82B4, +0x82B7,0x82BA,0x82BC,0x82BE,0x82BF,0x82C6,0x82D0,0x82D5, +0x82DA,0x82E0,0x82E2,0x82E4,0x82E8,0x82EA,0x82ED,0x82EF, +0x82F6,0x82F7,0x82FD,0x82FE,0x8300,0x8301,0x8307,0x8308, +0x830A,0x830B,0x8354,0x831B,0x831D,0x831E,0x831F,0x8321, +0x8322,0x832C,0x832D,0x832E,0x8330,0x8333,0x8337,0x833A, +0x833C,0x833D,0x8342,0x8343,0x8344,0x8347,0x834D,0x834E, +0x8351,0x8355,0x8356,0x8357,0x8370,0x8378}; + +/* page 48 0x5821-0x587E */ +static uint16 tab_jisx0212_uni48[]={ +0x837D,0x837F,0x8380,0x8382,0x8384,0x8386,0x838D,0x8392, +0x8394,0x8395,0x8398,0x8399,0x839B,0x839C,0x839D,0x83A6, +0x83A7,0x83A9,0x83AC,0x83BE,0x83BF,0x83C0,0x83C7,0x83C9, +0x83CF,0x83D0,0x83D1,0x83D4,0x83DD,0x8353,0x83E8,0x83EA, +0x83F6,0x83F8,0x83F9,0x83FC,0x8401,0x8406,0x840A,0x840F, +0x8411,0x8415,0x8419,0x83AD,0x842F,0x8439,0x8445,0x8447, +0x8448,0x844A,0x844D,0x844F,0x8451,0x8452,0x8456,0x8458, +0x8459,0x845A,0x845C,0x8460,0x8464,0x8465,0x8467,0x846A, +0x8470,0x8473,0x8474,0x8476,0x8478,0x847C,0x847D,0x8481, +0x8485,0x8492,0x8493,0x8495,0x849E,0x84A6,0x84A8,0x84A9, +0x84AA,0x84AF,0x84B1,0x84B4,0x84BA,0x84BD,0x84BE,0x84C0, +0x84C2,0x84C7,0x84C8,0x84CC,0x84CF,0x84D3}; + +/* page 49 0x5921-0x597E */ +static uint16 tab_jisx0212_uni49[]={ +0x84DC,0x84E7,0x84EA,0x84EF,0x84F0,0x84F1,0x84F2,0x84F7, +0x8532,0x84FA,0x84FB,0x84FD,0x8502,0x8503,0x8507,0x850C, +0x850E,0x8510,0x851C,0x851E,0x8522,0x8523,0x8524,0x8525, +0x8527,0x852A,0x852B,0x852F,0x8533,0x8534,0x8536,0x853F, +0x8546,0x854F,0x8550,0x8551,0x8552,0x8553,0x8556,0x8559, +0x855C,0x855D,0x855E,0x855F,0x8560,0x8561,0x8562,0x8564, +0x856B,0x856F,0x8579,0x857A,0x857B,0x857D,0x857F,0x8581, +0x8585,0x8586,0x8589,0x858B,0x858C,0x858F,0x8593,0x8598, +0x859D,0x859F,0x85A0,0x85A2,0x85A5,0x85A7,0x85B4,0x85B6, +0x85B7,0x85B8,0x85BC,0x85BD,0x85BE,0x85BF,0x85C2,0x85C7, +0x85CA,0x85CB,0x85CE,0x85AD,0x85D8,0x85DA,0x85DF,0x85E0, +0x85E6,0x85E8,0x85ED,0x85F3,0x85F6,0x85FC}; + +/* page 50 0x5A21-0x5A7E */ +static uint16 tab_jisx0212_uni50[]={ +0x85FF,0x8600,0x8604,0x8605,0x860D,0x860E,0x8610,0x8611, +0x8612,0x8618,0x8619,0x861B,0x861E,0x8621,0x8627,0x8629, +0x8636,0x8638,0x863A,0x863C,0x863D,0x8640,0x8642,0x8646, +0x8652,0x8653,0x8656,0x8657,0x8658,0x8659,0x865D,0x8660, +0x8661,0x8662,0x8663,0x8664,0x8669,0x866C,0x866F,0x8675, +0x8676,0x8677,0x867A,0x868D,0x8691,0x8696,0x8698,0x869A, +0x869C,0x86A1,0x86A6,0x86A7,0x86A8,0x86AD,0x86B1,0x86B3, +0x86B4,0x86B5,0x86B7,0x86B8,0x86B9,0x86BF,0x86C0,0x86C1, +0x86C3,0x86C5,0x86D1,0x86D2,0x86D5,0x86D7,0x86DA,0x86DC, +0x86E0,0x86E3,0x86E5,0x86E7,0x8688,0x86FA,0x86FC,0x86FD, +0x8704,0x8705,0x8707,0x870B,0x870E,0x870F,0x8710,0x8713, +0x8714,0x8719,0x871E,0x871F,0x8721,0x8723}; + +/* page 51 0x5B21-0x5B7E */ +static uint16 tab_jisx0212_uni51[]={ +0x8728,0x872E,0x872F,0x8731,0x8732,0x8739,0x873A,0x873C, +0x873D,0x873E,0x8740,0x8743,0x8745,0x874D,0x8758,0x875D, +0x8761,0x8764,0x8765,0x876F,0x8771,0x8772,0x877B,0x8783, +0x8784,0x8785,0x8786,0x8787,0x8788,0x8789,0x878B,0x878C, +0x8790,0x8793,0x8795,0x8797,0x8798,0x8799,0x879E,0x87A0, +0x87A3,0x87A7,0x87AC,0x87AD,0x87AE,0x87B1,0x87B5,0x87BE, +0x87BF,0x87C1,0x87C8,0x87C9,0x87CA,0x87CE,0x87D5,0x87D6, +0x87D9,0x87DA,0x87DC,0x87DF,0x87E2,0x87E3,0x87E4,0x87EA, +0x87EB,0x87ED,0x87F1,0x87F3,0x87F8,0x87FA,0x87FF,0x8801, +0x8803,0x8806,0x8809,0x880A,0x880B,0x8810,0x8819,0x8812, +0x8813,0x8814,0x8818,0x881A,0x881B,0x881C,0x881E,0x881F, +0x8828,0x882D,0x882E,0x8830,0x8832,0x8835}; + +/* page 52 0x5C21-0x5C7E */ +static uint16 tab_jisx0212_uni52[]={ +0x883A,0x883C,0x8841,0x8843,0x8845,0x8848,0x8849,0x884A, +0x884B,0x884E,0x8851,0x8855,0x8856,0x8858,0x885A,0x885C, +0x885F,0x8860,0x8864,0x8869,0x8871,0x8879,0x887B,0x8880, +0x8898,0x889A,0x889B,0x889C,0x889F,0x88A0,0x88A8,0x88AA, +0x88BA,0x88BD,0x88BE,0x88C0,0x88CA,0x88CB,0x88CC,0x88CD, +0x88CE,0x88D1,0x88D2,0x88D3,0x88DB,0x88DE,0x88E7,0x88EF, +0x88F0,0x88F1,0x88F5,0x88F7,0x8901,0x8906,0x890D,0x890E, +0x890F,0x8915,0x8916,0x8918,0x8919,0x891A,0x891C,0x8920, +0x8926,0x8927,0x8928,0x8930,0x8931,0x8932,0x8935,0x8939, +0x893A,0x893E,0x8940,0x8942,0x8945,0x8946,0x8949,0x894F, +0x8952,0x8957,0x895A,0x895B,0x895C,0x8961,0x8962,0x8963, +0x896B,0x896E,0x8970,0x8973,0x8975,0x897A}; + +/* page 53 0x5D21-0x5D7E */ +static uint16 tab_jisx0212_uni53[]={ +0x897B,0x897C,0x897D,0x8989,0x898D,0x8990,0x8994,0x8995, +0x899B,0x899C,0x899F,0x89A0,0x89A5,0x89B0,0x89B4,0x89B5, +0x89B6,0x89B7,0x89BC,0x89D4,0x89D5,0x89D6,0x89D7,0x89D8, +0x89E5,0x89E9,0x89EB,0x89ED,0x89F1,0x89F3,0x89F6,0x89F9, +0x89FD,0x89FF,0x8A04,0x8A05,0x8A07,0x8A0F,0x8A11,0x8A12, +0x8A14,0x8A15,0x8A1E,0x8A20,0x8A22,0x8A24,0x8A26,0x8A2B, +0x8A2C,0x8A2F,0x8A35,0x8A37,0x8A3D,0x8A3E,0x8A40,0x8A43, +0x8A45,0x8A47,0x8A49,0x8A4D,0x8A4E,0x8A53,0x8A56,0x8A57, +0x8A58,0x8A5C,0x8A5D,0x8A61,0x8A65,0x8A67,0x8A75,0x8A76, +0x8A77,0x8A79,0x8A7A,0x8A7B,0x8A7E,0x8A7F,0x8A80,0x8A83, +0x8A86,0x8A8B,0x8A8F,0x8A90,0x8A92,0x8A96,0x8A97,0x8A99, +0x8A9F,0x8AA7,0x8AA9,0x8AAE,0x8AAF,0x8AB3}; + +/* page 54 0x5E21-0x5E7E */ +static uint16 tab_jisx0212_uni54[]={ +0x8AB6,0x8AB7,0x8ABB,0x8ABE,0x8AC3,0x8AC6,0x8AC8,0x8AC9, +0x8ACA,0x8AD1,0x8AD3,0x8AD4,0x8AD5,0x8AD7,0x8ADD,0x8ADF, +0x8AEC,0x8AF0,0x8AF4,0x8AF5,0x8AF6,0x8AFC,0x8AFF,0x8B05, +0x8B06,0x8B0B,0x8B11,0x8B1C,0x8B1E,0x8B1F,0x8B0A,0x8B2D, +0x8B30,0x8B37,0x8B3C,0x8B42,0x8B43,0x8B44,0x8B45,0x8B46, +0x8B48,0x8B52,0x8B53,0x8B54,0x8B59,0x8B4D,0x8B5E,0x8B63, +0x8B6D,0x8B76,0x8B78,0x8B79,0x8B7C,0x8B7E,0x8B81,0x8B84, +0x8B85,0x8B8B,0x8B8D,0x8B8F,0x8B94,0x8B95,0x8B9C,0x8B9E, +0x8B9F,0x8C38,0x8C39,0x8C3D,0x8C3E,0x8C45,0x8C47,0x8C49, +0x8C4B,0x8C4F,0x8C51,0x8C53,0x8C54,0x8C57,0x8C58,0x8C5B, +0x8C5D,0x8C59,0x8C63,0x8C64,0x8C66,0x8C68,0x8C69,0x8C6D, +0x8C73,0x8C75,0x8C76,0x8C7B,0x8C7E,0x8C86}; + +/* page 55 0x5F21-0x5F7E */ +static uint16 tab_jisx0212_uni55[]={ +0x8C87,0x8C8B,0x8C90,0x8C92,0x8C93,0x8C99,0x8C9B,0x8C9C, +0x8CA4,0x8CB9,0x8CBA,0x8CC5,0x8CC6,0x8CC9,0x8CCB,0x8CCF, +0x8CD6,0x8CD5,0x8CD9,0x8CDD,0x8CE1,0x8CE8,0x8CEC,0x8CEF, +0x8CF0,0x8CF2,0x8CF5,0x8CF7,0x8CF8,0x8CFE,0x8CFF,0x8D01, +0x8D03,0x8D09,0x8D12,0x8D17,0x8D1B,0x8D65,0x8D69,0x8D6C, +0x8D6E,0x8D7F,0x8D82,0x8D84,0x8D88,0x8D8D,0x8D90,0x8D91, +0x8D95,0x8D9E,0x8D9F,0x8DA0,0x8DA6,0x8DAB,0x8DAC,0x8DAF, +0x8DB2,0x8DB5,0x8DB7,0x8DB9,0x8DBB,0x8DC0,0x8DC5,0x8DC6, +0x8DC7,0x8DC8,0x8DCA,0x8DCE,0x8DD1,0x8DD4,0x8DD5,0x8DD7, +0x8DD9,0x8DE4,0x8DE5,0x8DE7,0x8DEC,0x8DF0,0x8DBC,0x8DF1, +0x8DF2,0x8DF4,0x8DFD,0x8E01,0x8E04,0x8E05,0x8E06,0x8E0B, +0x8E11,0x8E14,0x8E16,0x8E20,0x8E21,0x8E22}; + +/* page 56 0x6021-0x607E */ +static uint16 tab_jisx0212_uni56[]={ +0x8E23,0x8E26,0x8E27,0x8E31,0x8E33,0x8E36,0x8E37,0x8E38, +0x8E39,0x8E3D,0x8E40,0x8E41,0x8E4B,0x8E4D,0x8E4E,0x8E4F, +0x8E54,0x8E5B,0x8E5C,0x8E5D,0x8E5E,0x8E61,0x8E62,0x8E69, +0x8E6C,0x8E6D,0x8E6F,0x8E70,0x8E71,0x8E79,0x8E7A,0x8E7B, +0x8E82,0x8E83,0x8E89,0x8E90,0x8E92,0x8E95,0x8E9A,0x8E9B, +0x8E9D,0x8E9E,0x8EA2,0x8EA7,0x8EA9,0x8EAD,0x8EAE,0x8EB3, +0x8EB5,0x8EBA,0x8EBB,0x8EC0,0x8EC1,0x8EC3,0x8EC4,0x8EC7, +0x8ECF,0x8ED1,0x8ED4,0x8EDC,0x8EE8,0x8EEE,0x8EF0,0x8EF1, +0x8EF7,0x8EF9,0x8EFA,0x8EED,0x8F00,0x8F02,0x8F07,0x8F08, +0x8F0F,0x8F10,0x8F16,0x8F17,0x8F18,0x8F1E,0x8F20,0x8F21, +0x8F23,0x8F25,0x8F27,0x8F28,0x8F2C,0x8F2D,0x8F2E,0x8F34, +0x8F35,0x8F36,0x8F37,0x8F3A,0x8F40,0x8F41}; + +/* page 57 0x6121-0x617E */ +static uint16 tab_jisx0212_uni57[]={ +0x8F43,0x8F47,0x8F4F,0x8F51,0x8F52,0x8F53,0x8F54,0x8F55, +0x8F58,0x8F5D,0x8F5E,0x8F65,0x8F9D,0x8FA0,0x8FA1,0x8FA4, +0x8FA5,0x8FA6,0x8FB5,0x8FB6,0x8FB8,0x8FBE,0x8FC0,0x8FC1, +0x8FC6,0x8FCA,0x8FCB,0x8FCD,0x8FD0,0x8FD2,0x8FD3,0x8FD5, +0x8FE0,0x8FE3,0x8FE4,0x8FE8,0x8FEE,0x8FF1,0x8FF5,0x8FF6, +0x8FFB,0x8FFE,0x9002,0x9004,0x9008,0x900C,0x9018,0x901B, +0x9028,0x9029,0x902F,0x902A,0x902C,0x902D,0x9033,0x9034, +0x9037,0x903F,0x9043,0x9044,0x904C,0x905B,0x905D,0x9062, +0x9066,0x9067,0x906C,0x9070,0x9074,0x9079,0x9085,0x9088, +0x908B,0x908C,0x908E,0x9090,0x9095,0x9097,0x9098,0x9099, +0x909B,0x90A0,0x90A1,0x90A2,0x90A5,0x90B0,0x90B2,0x90B3, +0x90B4,0x90B6,0x90BD,0x90CC,0x90BE,0x90C3}; + +/* page 58 0x6221-0x627E */ +static uint16 tab_jisx0212_uni58[]={ +0x90C4,0x90C5,0x90C7,0x90C8,0x90D5,0x90D7,0x90D8,0x90D9, +0x90DC,0x90DD,0x90DF,0x90E5,0x90D2,0x90F6,0x90EB,0x90EF, +0x90F0,0x90F4,0x90FE,0x90FF,0x9100,0x9104,0x9105,0x9106, +0x9108,0x910D,0x9110,0x9114,0x9116,0x9117,0x9118,0x911A, +0x911C,0x911E,0x9120,0x9125,0x9122,0x9123,0x9127,0x9129, +0x912E,0x912F,0x9131,0x9134,0x9136,0x9137,0x9139,0x913A, +0x913C,0x913D,0x9143,0x9147,0x9148,0x914F,0x9153,0x9157, +0x9159,0x915A,0x915B,0x9161,0x9164,0x9167,0x916D,0x9174, +0x9179,0x917A,0x917B,0x9181,0x9183,0x9185,0x9186,0x918A, +0x918E,0x9191,0x9193,0x9194,0x9195,0x9198,0x919E,0x91A1, +0x91A6,0x91A8,0x91AC,0x91AD,0x91AE,0x91B0,0x91B1,0x91B2, +0x91B3,0x91B6,0x91BB,0x91BC,0x91BD,0x91BF}; + +/* page 59 0x6321-0x637E */ +static uint16 tab_jisx0212_uni59[]={ +0x91C2,0x91C3,0x91C5,0x91D3,0x91D4,0x91D7,0x91D9,0x91DA, +0x91DE,0x91E4,0x91E5,0x91E9,0x91EA,0x91EC,0x91ED,0x91EE, +0x91EF,0x91F0,0x91F1,0x91F7,0x91F9,0x91FB,0x91FD,0x9200, +0x9201,0x9204,0x9205,0x9206,0x9207,0x9209,0x920A,0x920C, +0x9210,0x9212,0x9213,0x9216,0x9218,0x921C,0x921D,0x9223, +0x9224,0x9225,0x9226,0x9228,0x922E,0x922F,0x9230,0x9233, +0x9235,0x9236,0x9238,0x9239,0x923A,0x923C,0x923E,0x9240, +0x9242,0x9243,0x9246,0x9247,0x924A,0x924D,0x924E,0x924F, +0x9251,0x9258,0x9259,0x925C,0x925D,0x9260,0x9261,0x9265, +0x9267,0x9268,0x9269,0x926E,0x926F,0x9270,0x9275,0x9276, +0x9277,0x9278,0x9279,0x927B,0x927C,0x927D,0x927F,0x9288, +0x9289,0x928A,0x928D,0x928E,0x9292,0x9297}; + +/* page 60 0x6421-0x647E */ +static uint16 tab_jisx0212_uni60[]={ +0x9299,0x929F,0x92A0,0x92A4,0x92A5,0x92A7,0x92A8,0x92AB, +0x92AF,0x92B2,0x92B6,0x92B8,0x92BA,0x92BB,0x92BC,0x92BD, +0x92BF,0x92C0,0x92C1,0x92C2,0x92C3,0x92C5,0x92C6,0x92C7, +0x92C8,0x92CB,0x92CC,0x92CD,0x92CE,0x92D0,0x92D3,0x92D5, +0x92D7,0x92D8,0x92D9,0x92DC,0x92DD,0x92DF,0x92E0,0x92E1, +0x92E3,0x92E5,0x92E7,0x92E8,0x92EC,0x92EE,0x92F0,0x92F9, +0x92FB,0x92FF,0x9300,0x9302,0x9308,0x930D,0x9311,0x9314, +0x9315,0x931C,0x931D,0x931E,0x931F,0x9321,0x9324,0x9325, +0x9327,0x9329,0x932A,0x9333,0x9334,0x9336,0x9337,0x9347, +0x9348,0x9349,0x9350,0x9351,0x9352,0x9355,0x9357,0x9358, +0x935A,0x935E,0x9364,0x9365,0x9367,0x9369,0x936A,0x936D, +0x936F,0x9370,0x9371,0x9373,0x9374,0x9376}; + +/* page 61 0x6521-0x657E */ +static uint16 tab_jisx0212_uni61[]={ +0x937A,0x937D,0x937F,0x9380,0x9381,0x9382,0x9388,0x938A, +0x938B,0x938D,0x938F,0x9392,0x9395,0x9398,0x939B,0x939E, +0x93A1,0x93A3,0x93A4,0x93A6,0x93A8,0x93AB,0x93B4,0x93B5, +0x93B6,0x93BA,0x93A9,0x93C1,0x93C4,0x93C5,0x93C6,0x93C7, +0x93C9,0x93CA,0x93CB,0x93CC,0x93CD,0x93D3,0x93D9,0x93DC, +0x93DE,0x93DF,0x93E2,0x93E6,0x93E7,0x93F9,0x93F7,0x93F8, +0x93FA,0x93FB,0x93FD,0x9401,0x9402,0x9404,0x9408,0x9409, +0x940D,0x940E,0x940F,0x9415,0x9416,0x9417,0x941F,0x942E, +0x942F,0x9431,0x9432,0x9433,0x9434,0x943B,0x943F,0x943D, +0x9443,0x9445,0x9448,0x944A,0x944C,0x9455,0x9459,0x945C, +0x945F,0x9461,0x9463,0x9468,0x946B,0x946D,0x946E,0x946F, +0x9471,0x9472,0x9484,0x9483,0x9578,0x9579}; + +/* page 62 0x6621-0x667E */ +static uint16 tab_jisx0212_uni62[]={ +0x957E,0x9584,0x9588,0x958C,0x958D,0x958E,0x959D,0x959E, +0x959F,0x95A1,0x95A6,0x95A9,0x95AB,0x95AC,0x95B4,0x95B6, +0x95BA,0x95BD,0x95BF,0x95C6,0x95C8,0x95C9,0x95CB,0x95D0, +0x95D1,0x95D2,0x95D3,0x95D9,0x95DA,0x95DD,0x95DE,0x95DF, +0x95E0,0x95E4,0x95E6,0x961D,0x961E,0x9622,0x9624,0x9625, +0x9626,0x962C,0x9631,0x9633,0x9637,0x9638,0x9639,0x963A, +0x963C,0x963D,0x9641,0x9652,0x9654,0x9656,0x9657,0x9658, +0x9661,0x966E,0x9674,0x967B,0x967C,0x967E,0x967F,0x9681, +0x9682,0x9683,0x9684,0x9689,0x9691,0x9696,0x969A,0x969D, +0x969F,0x96A4,0x96A5,0x96A6,0x96A9,0x96AE,0x96AF,0x96B3, +0x96BA,0x96CA,0x96D2,0x5DB2,0x96D8,0x96DA,0x96DD,0x96DE, +0x96DF,0x96E9,0x96EF,0x96F1,0x96FA,0x9702}; + +/* page 63 0x6721-0x677E */ +static uint16 tab_jisx0212_uni63[]={ +0x9703,0x9705,0x9709,0x971A,0x971B,0x971D,0x9721,0x9722, +0x9723,0x9728,0x9731,0x9733,0x9741,0x9743,0x974A,0x974E, +0x974F,0x9755,0x9757,0x9758,0x975A,0x975B,0x9763,0x9767, +0x976A,0x976E,0x9773,0x9776,0x9777,0x9778,0x977B,0x977D, +0x977F,0x9780,0x9789,0x9795,0x9796,0x9797,0x9799,0x979A, +0x979E,0x979F,0x97A2,0x97AC,0x97AE,0x97B1,0x97B2,0x97B5, +0x97B6,0x97B8,0x97B9,0x97BA,0x97BC,0x97BE,0x97BF,0x97C1, +0x97C4,0x97C5,0x97C7,0x97C9,0x97CA,0x97CC,0x97CD,0x97CE, +0x97D0,0x97D1,0x97D4,0x97D7,0x97D8,0x97D9,0x97DD,0x97DE, +0x97E0,0x97DB,0x97E1,0x97E4,0x97EF,0x97F1,0x97F4,0x97F7, +0x97F8,0x97FA,0x9807,0x980A,0x9819,0x980D,0x980E,0x9814, +0x9816,0x981C,0x981E,0x9820,0x9823,0x9826}; + +/* page 64 0x6821-0x687E */ +static uint16 tab_jisx0212_uni64[]={ +0x982B,0x982E,0x982F,0x9830,0x9832,0x9833,0x9835,0x9825, +0x983E,0x9844,0x9847,0x984A,0x9851,0x9852,0x9853,0x9856, +0x9857,0x9859,0x985A,0x9862,0x9863,0x9865,0x9866,0x986A, +0x986C,0x98AB,0x98AD,0x98AE,0x98B0,0x98B4,0x98B7,0x98B8, +0x98BA,0x98BB,0x98BF,0x98C2,0x98C5,0x98C8,0x98CC,0x98E1, +0x98E3,0x98E5,0x98E6,0x98E7,0x98EA,0x98F3,0x98F6,0x9902, +0x9907,0x9908,0x9911,0x9915,0x9916,0x9917,0x991A,0x991B, +0x991C,0x991F,0x9922,0x9926,0x9927,0x992B,0x9931,0x9932, +0x9933,0x9934,0x9935,0x9939,0x993A,0x993B,0x993C,0x9940, +0x9941,0x9946,0x9947,0x9948,0x994D,0x994E,0x9954,0x9958, +0x9959,0x995B,0x995C,0x995E,0x995F,0x9960,0x999B,0x999D, +0x999F,0x99A6,0x99B0,0x99B1,0x99B2,0x99B5}; + +/* page 65 0x6921-0x697E */ +static uint16 tab_jisx0212_uni65[]={ +0x99B9,0x99BA,0x99BD,0x99BF,0x99C3,0x99C9,0x99D3,0x99D4, +0x99D9,0x99DA,0x99DC,0x99DE,0x99E7,0x99EA,0x99EB,0x99EC, +0x99F0,0x99F4,0x99F5,0x99F9,0x99FD,0x99FE,0x9A02,0x9A03, +0x9A04,0x9A0B,0x9A0C,0x9A10,0x9A11,0x9A16,0x9A1E,0x9A20, +0x9A22,0x9A23,0x9A24,0x9A27,0x9A2D,0x9A2E,0x9A33,0x9A35, +0x9A36,0x9A38,0x9A47,0x9A41,0x9A44,0x9A4A,0x9A4B,0x9A4C, +0x9A4E,0x9A51,0x9A54,0x9A56,0x9A5D,0x9AAA,0x9AAC,0x9AAE, +0x9AAF,0x9AB2,0x9AB4,0x9AB5,0x9AB6,0x9AB9,0x9ABB,0x9ABE, +0x9ABF,0x9AC1,0x9AC3,0x9AC6,0x9AC8,0x9ACE,0x9AD0,0x9AD2, +0x9AD5,0x9AD6,0x9AD7,0x9ADB,0x9ADC,0x9AE0,0x9AE4,0x9AE5, +0x9AE7,0x9AE9,0x9AEC,0x9AF2,0x9AF3,0x9AF5,0x9AF9,0x9AFA, +0x9AFD,0x9AFF,0x9B00,0x9B01,0x9B02,0x9B03}; + +/* page 66 0x6A21-0x6A7E */ +static uint16 tab_jisx0212_uni66[]={ +0x9B04,0x9B05,0x9B08,0x9B09,0x9B0B,0x9B0C,0x9B0D,0x9B0E, +0x9B10,0x9B12,0x9B16,0x9B19,0x9B1B,0x9B1C,0x9B20,0x9B26, +0x9B2B,0x9B2D,0x9B33,0x9B34,0x9B35,0x9B37,0x9B39,0x9B3A, +0x9B3D,0x9B48,0x9B4B,0x9B4C,0x9B55,0x9B56,0x9B57,0x9B5B, +0x9B5E,0x9B61,0x9B63,0x9B65,0x9B66,0x9B68,0x9B6A,0x9B6B, +0x9B6C,0x9B6D,0x9B6E,0x9B73,0x9B75,0x9B77,0x9B78,0x9B79, +0x9B7F,0x9B80,0x9B84,0x9B85,0x9B86,0x9B87,0x9B89,0x9B8A, +0x9B8B,0x9B8D,0x9B8F,0x9B90,0x9B94,0x9B9A,0x9B9D,0x9B9E, +0x9BA6,0x9BA7,0x9BA9,0x9BAC,0x9BB0,0x9BB1,0x9BB2,0x9BB7, +0x9BB8,0x9BBB,0x9BBC,0x9BBE,0x9BBF,0x9BC1,0x9BC7,0x9BC8, +0x9BCE,0x9BD0,0x9BD7,0x9BD8,0x9BDD,0x9BDF,0x9BE5,0x9BE7, +0x9BEA,0x9BEB,0x9BEF,0x9BF3,0x9BF7,0x9BF8}; + +/* page 67 0x6B21-0x6B7E */ +static uint16 tab_jisx0212_uni67[]={ +0x9BF9,0x9BFA,0x9BFD,0x9BFF,0x9C00,0x9C02,0x9C0B,0x9C0F, +0x9C11,0x9C16,0x9C18,0x9C19,0x9C1A,0x9C1C,0x9C1E,0x9C22, +0x9C23,0x9C26,0x9C27,0x9C28,0x9C29,0x9C2A,0x9C31,0x9C35, +0x9C36,0x9C37,0x9C3D,0x9C41,0x9C43,0x9C44,0x9C45,0x9C49, +0x9C4A,0x9C4E,0x9C4F,0x9C50,0x9C53,0x9C54,0x9C56,0x9C58, +0x9C5B,0x9C5D,0x9C5E,0x9C5F,0x9C63,0x9C69,0x9C6A,0x9C5C, +0x9C6B,0x9C68,0x9C6E,0x9C70,0x9C72,0x9C75,0x9C77,0x9C7B, +0x9CE6,0x9CF2,0x9CF7,0x9CF9,0x9D0B,0x9D02,0x9D11,0x9D17, +0x9D18,0x9D1C,0x9D1D,0x9D1E,0x9D2F,0x9D30,0x9D32,0x9D33, +0x9D34,0x9D3A,0x9D3C,0x9D45,0x9D3D,0x9D42,0x9D43,0x9D47, +0x9D4A,0x9D53,0x9D54,0x9D5F,0x9D63,0x9D62,0x9D65,0x9D69, +0x9D6A,0x9D6B,0x9D70,0x9D76,0x9D77,0x9D7B}; + +/* page 68 0x6C21-0x6C7E */ +static uint16 tab_jisx0212_uni68[]={ +0x9D7C,0x9D7E,0x9D83,0x9D84,0x9D86,0x9D8A,0x9D8D,0x9D8E, +0x9D92,0x9D93,0x9D95,0x9D96,0x9D97,0x9D98,0x9DA1,0x9DAA, +0x9DAC,0x9DAE,0x9DB1,0x9DB5,0x9DB9,0x9DBC,0x9DBF,0x9DC3, +0x9DC7,0x9DC9,0x9DCA,0x9DD4,0x9DD5,0x9DD6,0x9DD7,0x9DDA, +0x9DDE,0x9DDF,0x9DE0,0x9DE5,0x9DE7,0x9DE9,0x9DEB,0x9DEE, +0x9DF0,0x9DF3,0x9DF4,0x9DFE,0x9E0A,0x9E02,0x9E07,0x9E0E, +0x9E10,0x9E11,0x9E12,0x9E15,0x9E16,0x9E19,0x9E1C,0x9E1D, +0x9E7A,0x9E7B,0x9E7C,0x9E80,0x9E82,0x9E83,0x9E84,0x9E85, +0x9E87,0x9E8E,0x9E8F,0x9E96,0x9E98,0x9E9B,0x9E9E,0x9EA4, +0x9EA8,0x9EAC,0x9EAE,0x9EAF,0x9EB0,0x9EB3,0x9EB4,0x9EB5, +0x9EC6,0x9EC8,0x9ECB,0x9ED5,0x9EDF,0x9EE4,0x9EE7,0x9EEC, +0x9EED,0x9EEE,0x9EF0,0x9EF1,0x9EF2,0x9EF5}; + +/* page 69 0x6D21-0x6D63 */ +static uint16 tab_jisx0212_uni69[]={ +0x9EF8,0x9EFF,0x9F02,0x9F03,0x9F09,0x9F0F,0x9F10,0x9F11, +0x9F12,0x9F14,0x9F16,0x9F17,0x9F19,0x9F1A,0x9F1B,0x9F1F, +0x9F22,0x9F26,0x9F2A,0x9F2B,0x9F2F,0x9F31,0x9F32,0x9F34, +0x9F37,0x9F39,0x9F3A,0x9F3C,0x9F3D,0x9F3F,0x9F41,0x9F43, +0x9F44,0x9F45,0x9F46,0x9F47,0x9F53,0x9F55,0x9F56,0x9F57, +0x9F58,0x9F5A,0x9F5D,0x9F5E,0x9F68,0x9F69,0x9F6D,0x9F6E, +0x9F6F,0x9F70,0x9F71,0x9F73,0x9F75,0x9F7A,0x9F7D,0x9F8F, +0x9F90,0x9F91,0x9F92,0x9F94,0x9F96,0x9F97,0x9F9E,0x9FA1, +0x9FA2,0x9FA3,0x9FA5}; + +static int +my_jisx0212_uni_onechar(int code){ + if ((code>=0x222F)&&(code<=0x2244)) + return(tab_jisx0212_uni0[code-0x222F]); + if ((code>=0x226B)&&(code<=0x2271)) + return(tab_jisx0212_uni1[code-0x226B]); + if ((code>=0x2661)&&(code<=0x267C)) + return(tab_jisx0212_uni2[code-0x2661]); + if ((code>=0x2742)&&(code<=0x274E)) + return(tab_jisx0212_uni3[code-0x2742]); + if ((code>=0x2772)&&(code<=0x277E)) + return(tab_jisx0212_uni4[code-0x2772]); + if ((code>=0x2921)&&(code<=0x2950)) + return(tab_jisx0212_uni5[code-0x2921]); + if ((code>=0x2A21)&&(code<=0x2A77)) + return(tab_jisx0212_uni6[code-0x2A21]); + if ((code>=0x2B21)&&(code<=0x2B77)) + return(tab_jisx0212_uni7[code-0x2B21]); + if ((code>=0x3021)&&(code<=0x307E)) + return(tab_jisx0212_uni8[code-0x3021]); + if ((code>=0x3121)&&(code<=0x317E)) + return(tab_jisx0212_uni9[code-0x3121]); + if ((code>=0x3221)&&(code<=0x327E)) + return(tab_jisx0212_uni10[code-0x3221]); + if ((code>=0x3321)&&(code<=0x337E)) + return(tab_jisx0212_uni11[code-0x3321]); + if ((code>=0x3421)&&(code<=0x347E)) + return(tab_jisx0212_uni12[code-0x3421]); + if ((code>=0x3521)&&(code<=0x357E)) + return(tab_jisx0212_uni13[code-0x3521]); + if ((code>=0x3621)&&(code<=0x367E)) + return(tab_jisx0212_uni14[code-0x3621]); + if ((code>=0x3721)&&(code<=0x377E)) + return(tab_jisx0212_uni15[code-0x3721]); + if ((code>=0x3821)&&(code<=0x387E)) + return(tab_jisx0212_uni16[code-0x3821]); + if ((code>=0x3921)&&(code<=0x397E)) + return(tab_jisx0212_uni17[code-0x3921]); + if ((code>=0x3A21)&&(code<=0x3A7E)) + return(tab_jisx0212_uni18[code-0x3A21]); + if ((code>=0x3B21)&&(code<=0x3B7E)) + return(tab_jisx0212_uni19[code-0x3B21]); + if ((code>=0x3C21)&&(code<=0x3C7E)) + return(tab_jisx0212_uni20[code-0x3C21]); + if ((code>=0x3D21)&&(code<=0x3D7E)) + return(tab_jisx0212_uni21[code-0x3D21]); + if ((code>=0x3E21)&&(code<=0x3E7E)) + return(tab_jisx0212_uni22[code-0x3E21]); + if ((code>=0x3F21)&&(code<=0x3F7E)) + return(tab_jisx0212_uni23[code-0x3F21]); + if ((code>=0x4021)&&(code<=0x407E)) + return(tab_jisx0212_uni24[code-0x4021]); + if ((code>=0x4121)&&(code<=0x417E)) + return(tab_jisx0212_uni25[code-0x4121]); + if ((code>=0x4221)&&(code<=0x427E)) + return(tab_jisx0212_uni26[code-0x4221]); + if ((code>=0x4321)&&(code<=0x437E)) + return(tab_jisx0212_uni27[code-0x4321]); + if ((code>=0x4421)&&(code<=0x447E)) + return(tab_jisx0212_uni28[code-0x4421]); + if ((code>=0x4521)&&(code<=0x457E)) + return(tab_jisx0212_uni29[code-0x4521]); + if ((code>=0x4621)&&(code<=0x467E)) + return(tab_jisx0212_uni30[code-0x4621]); + if ((code>=0x4721)&&(code<=0x477E)) + return(tab_jisx0212_uni31[code-0x4721]); + if ((code>=0x4821)&&(code<=0x487E)) + return(tab_jisx0212_uni32[code-0x4821]); + if ((code>=0x4921)&&(code<=0x497E)) + return(tab_jisx0212_uni33[code-0x4921]); + if ((code>=0x4A21)&&(code<=0x4A7E)) + return(tab_jisx0212_uni34[code-0x4A21]); + if ((code>=0x4B21)&&(code<=0x4B7E)) + return(tab_jisx0212_uni35[code-0x4B21]); + if ((code>=0x4C21)&&(code<=0x4C7E)) + return(tab_jisx0212_uni36[code-0x4C21]); + if ((code>=0x4D21)&&(code<=0x4D7E)) + return(tab_jisx0212_uni37[code-0x4D21]); + if ((code>=0x4E21)&&(code<=0x4E7E)) + return(tab_jisx0212_uni38[code-0x4E21]); + if ((code>=0x4F21)&&(code<=0x4F7E)) + return(tab_jisx0212_uni39[code-0x4F21]); + if ((code>=0x5021)&&(code<=0x507E)) + return(tab_jisx0212_uni40[code-0x5021]); + if ((code>=0x5121)&&(code<=0x517E)) + return(tab_jisx0212_uni41[code-0x5121]); + if ((code>=0x5221)&&(code<=0x527E)) + return(tab_jisx0212_uni42[code-0x5221]); + if ((code>=0x5321)&&(code<=0x537E)) + return(tab_jisx0212_uni43[code-0x5321]); + if ((code>=0x5421)&&(code<=0x547E)) + return(tab_jisx0212_uni44[code-0x5421]); + if ((code>=0x5521)&&(code<=0x557E)) + return(tab_jisx0212_uni45[code-0x5521]); + if ((code>=0x5621)&&(code<=0x567E)) + return(tab_jisx0212_uni46[code-0x5621]); + if ((code>=0x5721)&&(code<=0x577E)) + return(tab_jisx0212_uni47[code-0x5721]); + if ((code>=0x5821)&&(code<=0x587E)) + return(tab_jisx0212_uni48[code-0x5821]); + if ((code>=0x5921)&&(code<=0x597E)) + return(tab_jisx0212_uni49[code-0x5921]); + if ((code>=0x5A21)&&(code<=0x5A7E)) + return(tab_jisx0212_uni50[code-0x5A21]); + if ((code>=0x5B21)&&(code<=0x5B7E)) + return(tab_jisx0212_uni51[code-0x5B21]); + if ((code>=0x5C21)&&(code<=0x5C7E)) + return(tab_jisx0212_uni52[code-0x5C21]); + if ((code>=0x5D21)&&(code<=0x5D7E)) + return(tab_jisx0212_uni53[code-0x5D21]); + if ((code>=0x5E21)&&(code<=0x5E7E)) + return(tab_jisx0212_uni54[code-0x5E21]); + if ((code>=0x5F21)&&(code<=0x5F7E)) + return(tab_jisx0212_uni55[code-0x5F21]); + if ((code>=0x6021)&&(code<=0x607E)) + return(tab_jisx0212_uni56[code-0x6021]); + if ((code>=0x6121)&&(code<=0x617E)) + return(tab_jisx0212_uni57[code-0x6121]); + if ((code>=0x6221)&&(code<=0x627E)) + return(tab_jisx0212_uni58[code-0x6221]); + if ((code>=0x6321)&&(code<=0x637E)) + return(tab_jisx0212_uni59[code-0x6321]); + if ((code>=0x6421)&&(code<=0x647E)) + return(tab_jisx0212_uni60[code-0x6421]); + if ((code>=0x6521)&&(code<=0x657E)) + return(tab_jisx0212_uni61[code-0x6521]); + if ((code>=0x6621)&&(code<=0x667E)) + return(tab_jisx0212_uni62[code-0x6621]); + if ((code>=0x6721)&&(code<=0x677E)) + return(tab_jisx0212_uni63[code-0x6721]); + if ((code>=0x6821)&&(code<=0x687E)) + return(tab_jisx0212_uni64[code-0x6821]); + if ((code>=0x6921)&&(code<=0x697E)) + return(tab_jisx0212_uni65[code-0x6921]); + if ((code>=0x6A21)&&(code<=0x6A7E)) + return(tab_jisx0212_uni66[code-0x6A21]); + if ((code>=0x6B21)&&(code<=0x6B7E)) + return(tab_jisx0212_uni67[code-0x6B21]); + if ((code>=0x6C21)&&(code<=0x6C7E)) + return(tab_jisx0212_uni68[code-0x6C21]); + if ((code>=0x6D21)&&(code<=0x6D63)) + return(tab_jisx0212_uni69[code-0x6D21]); + return(0); +} + + +/* + EUC-JP encoding subcomponents: + [x00-x7F] # ASCII/JIS-Roman (one-byte/character) + [x8E][xA0-xDF] # half-width katakana (two bytes/char) + [x8F][xA1-xFE][xA1-xFE] # JIS X 0212-1990 (three bytes/char) + [xA1-xFE][xA1-xFE] # JIS X 0208:1997 (two bytes/char) +*/ + +static +size_t my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), + const char *beg, const char *end, + size_t pos, int *error) +{ + const uchar *b= (uchar *) beg; + + for ( *error= 0 ; pos && b < (uchar*) end; pos--, b++) + { + char *chbeg; + uint ch= *b; + + if (ch <= 0x7F) /* one byte */ + continue; + + chbeg= (char *) b++; + if (b >= (uchar *) end) /* need more bytes */ + { + *error= 1; + return (size_t) (chbeg - beg); /* unexpected EOL */ + } + + if (ch == 0x8E) /* [x8E][xA0-xDF] */ + { + if (*b >= 0xA0 && *b <= 0xDF) + continue; + *error= 1; + return (size_t) (chbeg - beg); /* invalid sequence */ + } + + if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ + { + ch= *b++; + if (b >= (uchar*) end) + { + *error= 1; + return (size_t) (chbeg - beg); /* unexpected EOL */ + } + } + + if (ch >= 0xA1 && ch <= 0xFE && + *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ + continue; + *error= 1; + return (size_t) (chbeg - beg); /* invalid sequence */ + } + return (size_t) (b - (uchar *) beg); +} + + +static +size_t my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *str_end) +{ + size_t clen; + const uchar *b= (const uchar *) str; + const uchar *e= (const uchar *) str_end; + + for (clen= 0; b < e; ) + { + if (*b == 0x8E) + { + clen++; + b+= 2; + } + else if (*b == 0x8F) + { + clen+= 2; + b+= 3; + } + else if (*b & 0x80) + { + clen+= 2; + b+= 2; + } + else + { + clen++; + b++; + } + } + return clen; +} + + +static int +my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e) +{ + int c1,c2,c3; + + if (s >= e) + return MY_CS_TOOSMALL; + + c1=s[0]; + + /* Ascii code set */ + if (c1<=0x7F) + { + *pwc=c1; + return 1; + } + + if (s+2>e) + return MY_CS_TOOSMALL2; + + c2=s[1]; + + + /* JIS X 0208 code set */ + if (c1>=0xA1 && c1<=0xFE) + { + if (c2 < 0xA1 || c2 >0xFE) + return MY_CS_ILSEQ; + + if (c1 < 0xF5) + { + pwc[0]=my_jisx0208_uni_onechar( ((c1-0x80) << 8) + (c2-0x80)); + if (!pwc[0]) + return -2; + } + else + { + /* User defined range */ + pwc[0]=0xE000 + 94*(c1-0xF5) +(c2-0xA1); + } + return 2; + } + + /* JIS X 0201 code set (Half Width Tatakana) */ + if (c1==0x8E) + { + int ret; + + if (c2<0xA1 || c2>0xDF) + return MY_CS_ILSEQ; + + ret = my_mb_wc_jisx0201(cs,pwc,s+1,e); + if (ret!=1) + return -2; + return 2; + } + + /* JIS X 0212 code set */ + if (c1==0x8F) + { + if (c2<0xA1 || c2>=0xFF) + return MY_CS_ILSEQ; + + if (s+3>e) + return MY_CS_TOOSMALL3; + + c3=s[2]; + if (c3 < 0xA1 || c3>=0xFF) + return MY_CS_ILSEQ; + + if (c2<0xF5) + { + pwc[0]=my_jisx0212_uni_onechar((c2-0x80)*256 + (c3-0x80)); + if (!pwc[0]) + return -3; + } + else + { + /* User defined range */ + pwc[0]= 0xE3AC + 94*(c2-0xF5) + (c3-0xA1); + } + return 3; + } + + return MY_CS_ILSEQ; +} + + +static int +my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, uchar *s, uchar *e) +{ + uchar c1; + int jp; + + if (s >= e) + return MY_CS_TOOSMALL; + + if ((int) wc < 0x80) + { + *s= (uchar) wc; + return 1; + } + + if ((jp=my_uni_jisx0208_onechar(wc))) + { + if (s+2>e) + return MY_CS_TOOSMALL2; + + jp+=0x8080; + s[0]=jp>>8; + s[1]=jp&0xFF; + return 2; + } + + /* Half width Katakana */ + if (my_wc_mb_jisx0201(c,wc,s,e) == 1) + { + if (s+2>e) + return MY_CS_TOOSMALL2; + s[1]= s[0]; + s[0]= 0x8E; + return 2; + } + + + if ((jp=my_uni_jisx0212_onechar(wc))) + { + if (s+3>e) + return MY_CS_TOOSMALL3; + + jp+=0x8080; + s[0]=0x8F; + s[1]=jp>>8; + s[2]=jp&0xFF; + return 3; + } + + + /* User defined range */ + if (wc>=0xE000 && wc<0xE3AC) + { + if (s+2>e) + return MY_CS_TOOSMALL2; + + c1=((unsigned)(wc-0xE000)/94)+0xF5; + s[0]=c1; + c1=((unsigned)(wc-0xE000)%94)+0xa1; + s[1]=c1; + return 2; + } + + + /* User defined range */ + if (wc>=0xE3AC && wc<0xE758) + { + if (s+3>e) + return MY_CS_TOOSMALL3; + + s[0]=0x8F; + c1=((unsigned)(wc-0xE3AC)/94)+0xF5; + s[1]=c1; + c1=((unsigned)(wc-0xE3AC)%94)+0xa1; + s[2]=c1; + return 3; + } + + return MY_CS_ILUNI; +} + + +static MY_COLLATION_HANDLER my_collation_ci_handler = +{ + NULL, /* init */ + my_strnncoll_simple,/* strnncoll */ + my_strnncollsp_simple, + my_strnxfrm_mb, /* strnxfrm */ + my_strnxfrmlen_simple, + my_like_range_mb, /* like_range */ + my_wildcmp_mb, /* wildcmp */ + my_strcasecmp_mb, + my_instr_mb, + my_hash_sort_simple, + my_propagate_simple +}; + + +static MY_CHARSET_HANDLER my_charset_handler= +{ + NULL, /* init */ + ismbchar_ujis, + mbcharlen_ujis, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_ujis, + my_lengthsp_8bit, + my_numcells_eucjp, + my_mb_wc_euc_jp, /* mb_wc */ + my_wc_mb_euc_jp, /* wc_mb */ + my_mb_ctype_mb, + my_caseup_str_mb, + my_casedn_str_mb, + my_caseup_mb, + my_casedn_mb, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + + +CHARSET_INFO my_charset_ujis_japanese_ci= +{ + 12,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ + "ujis", /* cs name */ + "ujis_japanese_ci", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ujis, + to_lower_ujis, + to_upper_ujis, + sort_order_ujis, + NULL, /* sort_order_big*/ + NULL, /* contractions */ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_ci_handler +}; + + +CHARSET_INFO my_charset_ujis_bin= +{ + 91,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT, /* state */ + "ujis", /* cs name */ + "ujis_bin", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_ujis, + to_lower_ujis, + to_upper_ujis, + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_handler, + &my_collation_mb_bin_handler +}; + + +#endif diff --git a/externals/mysql/strings/ctype-utf8.c b/externals/mysql/strings/ctype-utf8.c new file mode 100644 index 00000000000..f412d4ee4d6 --- /dev/null +++ b/externals/mysql/strings/ctype-utf8.c @@ -0,0 +1,5308 @@ +/* Copyright (C) 2000 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* UTF8 according RFC 2279 */ +/* Written by Alexander Barkov */ + +#include +#include "m_string.h" +#include "m_ctype.h" +#include + +#ifndef EILSEQ +#define EILSEQ ENOENT +#endif + + +#define MY_UTF8MB3_GENERAL_CI MY_UTF8MB3 "_general_ci" +#define MY_UTF8MB3_GENERAL_CS MY_UTF8MB3 "_general_cs" +#define MY_UTF8MB3_BIN MY_UTF8MB3 "_bin" +#define MY_UTF8MB4_GENERAL_CI MY_UTF8MB4 "_general_ci" +#define MY_UTF8MB4_GENERAL_CS MY_UTF8MB4 "_general_cs" +#define MY_UTF8MB4_BIN MY_UTF8MB4 "_bin" + + +#ifdef HAVE_CHARSET_utf8mb3 +#define HAVE_UNIDATA +#endif + +#ifdef HAVE_CHARSET_ucs2 +#define HAVE_UNIDATA +#endif + +#ifdef HAVE_CHARSET_utf8mb4 +#define HAVE_UNIDATA +#endif + +#ifdef HAVE_CHARSET_utf16 +#define HAVE_UNIDATA +#endif + +#ifdef HAVE_CHARSET_utf32 +#define HAVE_UNIDATA +#endif + +#ifdef HAVE_UNIDATA + +#include "my_uctype.h" + +static MY_UNICASE_INFO plane00[]={ + {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, + {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, + {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, + {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, + {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, + {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, + {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, + {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, + {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, + {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, + {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, + {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, + {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, + {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, + {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, + {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, + {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, + {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, + {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, + {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, + {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, + {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, + {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, + {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, + {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, + {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, + {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, + {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, + {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, + {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, + {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, + {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, + {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, + {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, + {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, + {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, + {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, + {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, + {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, + {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, + {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, + {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, + {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, + {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, + {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, + {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, + {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, + {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, + {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, + {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, + {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, + {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, + {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, + {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, + {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, + {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, + {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, + {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, + {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, + {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, + {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, + {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, + {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, + {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, + {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, + {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, + {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, + {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, + {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, + {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, + {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, + {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, + {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, + {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, + {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, + {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, + {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, + {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, + {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, + {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, + {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, + {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, + {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, + {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, + {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, + {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, + {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, + {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, + {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, + {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, + {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, + {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, + {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, + {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, + {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, + {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, + {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, + {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, + {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, + {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, + {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, + {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, + {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, + {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, + {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, + {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, + {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, + {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, + {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, + {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, + {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, + {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x0053}, + {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, + {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, + {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, + {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, + {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, + {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, + {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, + {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, + {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, + {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, + {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, + {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, + {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, + {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, + {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, + {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} +}; + + + +static MY_UNICASE_INFO plane01[]={ + {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, + {0x0102,0x0103,0x0041}, {0x0102,0x0103,0x0041}, + {0x0104,0x0105,0x0041}, {0x0104,0x0105,0x0041}, + {0x0106,0x0107,0x0043}, {0x0106,0x0107,0x0043}, + {0x0108,0x0109,0x0043}, {0x0108,0x0109,0x0043}, + {0x010A,0x010B,0x0043}, {0x010A,0x010B,0x0043}, + {0x010C,0x010D,0x0043}, {0x010C,0x010D,0x0043}, + {0x010E,0x010F,0x0044}, {0x010E,0x010F,0x0044}, + {0x0110,0x0111,0x0110}, {0x0110,0x0111,0x0110}, + {0x0112,0x0113,0x0045}, {0x0112,0x0113,0x0045}, + {0x0114,0x0115,0x0045}, {0x0114,0x0115,0x0045}, + {0x0116,0x0117,0x0045}, {0x0116,0x0117,0x0045}, + {0x0118,0x0119,0x0045}, {0x0118,0x0119,0x0045}, + {0x011A,0x011B,0x0045}, {0x011A,0x011B,0x0045}, + {0x011C,0x011D,0x0047}, {0x011C,0x011D,0x0047}, + {0x011E,0x011F,0x0047}, {0x011E,0x011F,0x0047}, + {0x0120,0x0121,0x0047}, {0x0120,0x0121,0x0047}, + {0x0122,0x0123,0x0047}, {0x0122,0x0123,0x0047}, + {0x0124,0x0125,0x0048}, {0x0124,0x0125,0x0048}, + {0x0126,0x0127,0x0126}, {0x0126,0x0127,0x0126}, + {0x0128,0x0129,0x0049}, {0x0128,0x0129,0x0049}, + {0x012A,0x012B,0x0049}, {0x012A,0x012B,0x0049}, + {0x012C,0x012D,0x0049}, {0x012C,0x012D,0x0049}, + {0x012E,0x012F,0x0049}, {0x012E,0x012F,0x0049}, + {0x0130,0x0069,0x0049}, {0x0049,0x0131,0x0049}, + {0x0132,0x0133,0x0132}, {0x0132,0x0133,0x0132}, + {0x0134,0x0135,0x004A}, {0x0134,0x0135,0x004A}, + {0x0136,0x0137,0x004B}, {0x0136,0x0137,0x004B}, + {0x0138,0x0138,0x0138}, {0x0139,0x013A,0x004C}, + {0x0139,0x013A,0x004C}, {0x013B,0x013C,0x004C}, + {0x013B,0x013C,0x004C}, {0x013D,0x013E,0x004C}, + {0x013D,0x013E,0x004C}, {0x013F,0x0140,0x013F}, + {0x013F,0x0140,0x013F}, {0x0141,0x0142,0x0141}, + {0x0141,0x0142,0x0141}, {0x0143,0x0144,0x004E}, + {0x0143,0x0144,0x004E}, {0x0145,0x0146,0x004E}, + {0x0145,0x0146,0x004E}, {0x0147,0x0148,0x004E}, + {0x0147,0x0148,0x004E}, {0x0149,0x0149,0x0149}, + {0x014A,0x014B,0x014A}, {0x014A,0x014B,0x014A}, + {0x014C,0x014D,0x004F}, {0x014C,0x014D,0x004F}, + {0x014E,0x014F,0x004F}, {0x014E,0x014F,0x004F}, + {0x0150,0x0151,0x004F}, {0x0150,0x0151,0x004F}, + {0x0152,0x0153,0x0152}, {0x0152,0x0153,0x0152}, + {0x0154,0x0155,0x0052}, {0x0154,0x0155,0x0052}, + {0x0156,0x0157,0x0052}, {0x0156,0x0157,0x0052}, + {0x0158,0x0159,0x0052}, {0x0158,0x0159,0x0052}, + {0x015A,0x015B,0x0053}, {0x015A,0x015B,0x0053}, + {0x015C,0x015D,0x0053}, {0x015C,0x015D,0x0053}, + {0x015E,0x015F,0x0053}, {0x015E,0x015F,0x0053}, + {0x0160,0x0161,0x0053}, {0x0160,0x0161,0x0053}, + {0x0162,0x0163,0x0054}, {0x0162,0x0163,0x0054}, + {0x0164,0x0165,0x0054}, {0x0164,0x0165,0x0054}, + {0x0166,0x0167,0x0166}, {0x0166,0x0167,0x0166}, + {0x0168,0x0169,0x0055}, {0x0168,0x0169,0x0055}, + {0x016A,0x016B,0x0055}, {0x016A,0x016B,0x0055}, + {0x016C,0x016D,0x0055}, {0x016C,0x016D,0x0055}, + {0x016E,0x016F,0x0055}, {0x016E,0x016F,0x0055}, + {0x0170,0x0171,0x0055}, {0x0170,0x0171,0x0055}, + {0x0172,0x0173,0x0055}, {0x0172,0x0173,0x0055}, + {0x0174,0x0175,0x0057}, {0x0174,0x0175,0x0057}, + {0x0176,0x0177,0x0059}, {0x0176,0x0177,0x0059}, + {0x0178,0x00FF,0x0059}, {0x0179,0x017A,0x005A}, + {0x0179,0x017A,0x005A}, {0x017B,0x017C,0x005A}, + {0x017B,0x017C,0x005A}, {0x017D,0x017E,0x005A}, + {0x017D,0x017E,0x005A}, {0x0053,0x017F,0x0053}, + {0x0180,0x0180,0x0180}, {0x0181,0x0253,0x0181}, + {0x0182,0x0183,0x0182}, {0x0182,0x0183,0x0182}, + {0x0184,0x0185,0x0184}, {0x0184,0x0185,0x0184}, + {0x0186,0x0254,0x0186}, {0x0187,0x0188,0x0187}, + {0x0187,0x0188,0x0187}, {0x0189,0x0256,0x0189}, + {0x018A,0x0257,0x018A}, {0x018B,0x018C,0x018B}, + {0x018B,0x018C,0x018B}, {0x018D,0x018D,0x018D}, + {0x018E,0x01DD,0x018E}, {0x018F,0x0259,0x018F}, + {0x0190,0x025B,0x0190}, {0x0191,0x0192,0x0191}, + {0x0191,0x0192,0x0191}, {0x0193,0x0260,0x0193}, + {0x0194,0x0263,0x0194}, {0x01F6,0x0195,0x01F6}, + {0x0196,0x0269,0x0196}, {0x0197,0x0268,0x0197}, + {0x0198,0x0199,0x0198}, {0x0198,0x0199,0x0198}, + {0x019A,0x019A,0x019A}, {0x019B,0x019B,0x019B}, + {0x019C,0x026F,0x019C}, {0x019D,0x0272,0x019D}, + {0x019E,0x019E,0x019E}, {0x019F,0x0275,0x019F}, + {0x01A0,0x01A1,0x004F}, {0x01A0,0x01A1,0x004F}, + {0x01A2,0x01A3,0x01A2}, {0x01A2,0x01A3,0x01A2}, + {0x01A4,0x01A5,0x01A4}, {0x01A4,0x01A5,0x01A4}, + {0x01A6,0x0280,0x01A6}, {0x01A7,0x01A8,0x01A7}, + {0x01A7,0x01A8,0x01A7}, {0x01A9,0x0283,0x01A9}, + {0x01AA,0x01AA,0x01AA}, {0x01AB,0x01AB,0x01AB}, + {0x01AC,0x01AD,0x01AC}, {0x01AC,0x01AD,0x01AC}, + {0x01AE,0x0288,0x01AE}, {0x01AF,0x01B0,0x0055}, + {0x01AF,0x01B0,0x0055}, {0x01B1,0x028A,0x01B1}, + {0x01B2,0x028B,0x01B2}, {0x01B3,0x01B4,0x01B3}, + {0x01B3,0x01B4,0x01B3}, {0x01B5,0x01B6,0x01B5}, + {0x01B5,0x01B6,0x01B5}, {0x01B7,0x0292,0x01B7}, + {0x01B8,0x01B9,0x01B8}, {0x01B8,0x01B9,0x01B8}, + {0x01BA,0x01BA,0x01BA}, {0x01BB,0x01BB,0x01BB}, + {0x01BC,0x01BD,0x01BC}, {0x01BC,0x01BD,0x01BC}, + {0x01BE,0x01BE,0x01BE}, {0x01F7,0x01BF,0x01F7}, + {0x01C0,0x01C0,0x01C0}, {0x01C1,0x01C1,0x01C1}, + {0x01C2,0x01C2,0x01C2}, {0x01C3,0x01C3,0x01C3}, + {0x01C4,0x01C6,0x01C4}, {0x01C4,0x01C6,0x01C4}, + {0x01C4,0x01C6,0x01C4}, {0x01C7,0x01C9,0x01C7}, + {0x01C7,0x01C9,0x01C7}, {0x01C7,0x01C9,0x01C7}, + {0x01CA,0x01CC,0x01CA}, {0x01CA,0x01CC,0x01CA}, + {0x01CA,0x01CC,0x01CA}, {0x01CD,0x01CE,0x0041}, + {0x01CD,0x01CE,0x0041}, {0x01CF,0x01D0,0x0049}, + {0x01CF,0x01D0,0x0049}, {0x01D1,0x01D2,0x004F}, + {0x01D1,0x01D2,0x004F}, {0x01D3,0x01D4,0x0055}, + {0x01D3,0x01D4,0x0055}, {0x01D5,0x01D6,0x0055}, + {0x01D5,0x01D6,0x0055}, {0x01D7,0x01D8,0x0055}, + {0x01D7,0x01D8,0x0055}, {0x01D9,0x01DA,0x0055}, + {0x01D9,0x01DA,0x0055}, {0x01DB,0x01DC,0x0055}, + {0x01DB,0x01DC,0x0055}, {0x018E,0x01DD,0x018E}, + {0x01DE,0x01DF,0x0041}, {0x01DE,0x01DF,0x0041}, + {0x01E0,0x01E1,0x0041}, {0x01E0,0x01E1,0x0041}, + {0x01E2,0x01E3,0x00C6}, {0x01E2,0x01E3,0x00C6}, + {0x01E4,0x01E5,0x01E4}, {0x01E4,0x01E5,0x01E4}, + {0x01E6,0x01E7,0x0047}, {0x01E6,0x01E7,0x0047}, + {0x01E8,0x01E9,0x004B}, {0x01E8,0x01E9,0x004B}, + {0x01EA,0x01EB,0x004F}, {0x01EA,0x01EB,0x004F}, + {0x01EC,0x01ED,0x004F}, {0x01EC,0x01ED,0x004F}, + {0x01EE,0x01EF,0x01B7}, {0x01EE,0x01EF,0x01B7}, + {0x01F0,0x01F0,0x004A}, {0x01F1,0x01F3,0x01F1}, + {0x01F1,0x01F3,0x01F1}, {0x01F1,0x01F3,0x01F1}, + {0x01F4,0x01F5,0x0047}, {0x01F4,0x01F5,0x0047}, + {0x01F6,0x0195,0x01F6}, {0x01F7,0x01BF,0x01F7}, + {0x01F8,0x01F9,0x004E}, {0x01F8,0x01F9,0x004E}, + {0x01FA,0x01FB,0x0041}, {0x01FA,0x01FB,0x0041}, + {0x01FC,0x01FD,0x00C6}, {0x01FC,0x01FD,0x00C6}, + {0x01FE,0x01FF,0x00D8}, {0x01FE,0x01FF,0x00D8} +}; + +static MY_UNICASE_INFO plane02[]={ + {0x0200,0x0201,0x0041}, {0x0200,0x0201,0x0041}, + {0x0202,0x0203,0x0041}, {0x0202,0x0203,0x0041}, + {0x0204,0x0205,0x0045}, {0x0204,0x0205,0x0045}, + {0x0206,0x0207,0x0045}, {0x0206,0x0207,0x0045}, + {0x0208,0x0209,0x0049}, {0x0208,0x0209,0x0049}, + {0x020A,0x020B,0x0049}, {0x020A,0x020B,0x0049}, + {0x020C,0x020D,0x004F}, {0x020C,0x020D,0x004F}, + {0x020E,0x020F,0x004F}, {0x020E,0x020F,0x004F}, + {0x0210,0x0211,0x0052}, {0x0210,0x0211,0x0052}, + {0x0212,0x0213,0x0052}, {0x0212,0x0213,0x0052}, + {0x0214,0x0215,0x0055}, {0x0214,0x0215,0x0055}, + {0x0216,0x0217,0x0055}, {0x0216,0x0217,0x0055}, + {0x0218,0x0219,0x0053}, {0x0218,0x0219,0x0053}, + {0x021A,0x021B,0x0054}, {0x021A,0x021B,0x0054}, + {0x021C,0x021D,0x021C}, {0x021C,0x021D,0x021C}, + {0x021E,0x021F,0x0048}, {0x021E,0x021F,0x0048}, + {0x0220,0x0220,0x0220}, {0x0221,0x0221,0x0221}, + {0x0222,0x0223,0x0222}, {0x0222,0x0223,0x0222}, + {0x0224,0x0225,0x0224}, {0x0224,0x0225,0x0224}, + {0x0226,0x0227,0x0041}, {0x0226,0x0227,0x0041}, + {0x0228,0x0229,0x0045}, {0x0228,0x0229,0x0045}, + {0x022A,0x022B,0x004F}, {0x022A,0x022B,0x004F}, + {0x022C,0x022D,0x004F}, {0x022C,0x022D,0x004F}, + {0x022E,0x022F,0x004F}, {0x022E,0x022F,0x004F}, + {0x0230,0x0231,0x004F}, {0x0230,0x0231,0x004F}, + {0x0232,0x0233,0x0059}, {0x0232,0x0233,0x0059}, + {0x0234,0x0234,0x0234}, {0x0235,0x0235,0x0235}, + {0x0236,0x0236,0x0236}, {0x0237,0x0237,0x0237}, + {0x0238,0x0238,0x0238}, {0x0239,0x0239,0x0239}, + {0x023A,0x023A,0x023A}, {0x023B,0x023B,0x023B}, + {0x023C,0x023C,0x023C}, {0x023D,0x023D,0x023D}, + {0x023E,0x023E,0x023E}, {0x023F,0x023F,0x023F}, + {0x0240,0x0240,0x0240}, {0x0241,0x0241,0x0241}, + {0x0242,0x0242,0x0242}, {0x0243,0x0243,0x0243}, + {0x0244,0x0244,0x0244}, {0x0245,0x0245,0x0245}, + {0x0246,0x0246,0x0246}, {0x0247,0x0247,0x0247}, + {0x0248,0x0248,0x0248}, {0x0249,0x0249,0x0249}, + {0x024A,0x024A,0x024A}, {0x024B,0x024B,0x024B}, + {0x024C,0x024C,0x024C}, {0x024D,0x024D,0x024D}, + {0x024E,0x024E,0x024E}, {0x024F,0x024F,0x024F}, + {0x0250,0x0250,0x0250}, {0x0251,0x0251,0x0251}, + {0x0252,0x0252,0x0252}, {0x0181,0x0253,0x0181}, + {0x0186,0x0254,0x0186}, {0x0255,0x0255,0x0255}, + {0x0189,0x0256,0x0189}, {0x018A,0x0257,0x018A}, + {0x0258,0x0258,0x0258}, {0x018F,0x0259,0x018F}, + {0x025A,0x025A,0x025A}, {0x0190,0x025B,0x0190}, + {0x025C,0x025C,0x025C}, {0x025D,0x025D,0x025D}, + {0x025E,0x025E,0x025E}, {0x025F,0x025F,0x025F}, + {0x0193,0x0260,0x0193}, {0x0261,0x0261,0x0261}, + {0x0262,0x0262,0x0262}, {0x0194,0x0263,0x0194}, + {0x0264,0x0264,0x0264}, {0x0265,0x0265,0x0265}, + {0x0266,0x0266,0x0266}, {0x0267,0x0267,0x0267}, + {0x0197,0x0268,0x0197}, {0x0196,0x0269,0x0196}, + {0x026A,0x026A,0x026A}, {0x026B,0x026B,0x026B}, + {0x026C,0x026C,0x026C}, {0x026D,0x026D,0x026D}, + {0x026E,0x026E,0x026E}, {0x019C,0x026F,0x019C}, + {0x0270,0x0270,0x0270}, {0x0271,0x0271,0x0271}, + {0x019D,0x0272,0x019D}, {0x0273,0x0273,0x0273}, + {0x0274,0x0274,0x0274}, {0x019F,0x0275,0x019F}, + {0x0276,0x0276,0x0276}, {0x0277,0x0277,0x0277}, + {0x0278,0x0278,0x0278}, {0x0279,0x0279,0x0279}, + {0x027A,0x027A,0x027A}, {0x027B,0x027B,0x027B}, + {0x027C,0x027C,0x027C}, {0x027D,0x027D,0x027D}, + {0x027E,0x027E,0x027E}, {0x027F,0x027F,0x027F}, + {0x01A6,0x0280,0x01A6}, {0x0281,0x0281,0x0281}, + {0x0282,0x0282,0x0282}, {0x01A9,0x0283,0x01A9}, + {0x0284,0x0284,0x0284}, {0x0285,0x0285,0x0285}, + {0x0286,0x0286,0x0286}, {0x0287,0x0287,0x0287}, + {0x01AE,0x0288,0x01AE}, {0x0289,0x0289,0x0289}, + {0x01B1,0x028A,0x01B1}, {0x01B2,0x028B,0x01B2}, + {0x028C,0x028C,0x028C}, {0x028D,0x028D,0x028D}, + {0x028E,0x028E,0x028E}, {0x028F,0x028F,0x028F}, + {0x0290,0x0290,0x0290}, {0x0291,0x0291,0x0291}, + {0x01B7,0x0292,0x01B7}, {0x0293,0x0293,0x0293}, + {0x0294,0x0294,0x0294}, {0x0295,0x0295,0x0295}, + {0x0296,0x0296,0x0296}, {0x0297,0x0297,0x0297}, + {0x0298,0x0298,0x0298}, {0x0299,0x0299,0x0299}, + {0x029A,0x029A,0x029A}, {0x029B,0x029B,0x029B}, + {0x029C,0x029C,0x029C}, {0x029D,0x029D,0x029D}, + {0x029E,0x029E,0x029E}, {0x029F,0x029F,0x029F}, + {0x02A0,0x02A0,0x02A0}, {0x02A1,0x02A1,0x02A1}, + {0x02A2,0x02A2,0x02A2}, {0x02A3,0x02A3,0x02A3}, + {0x02A4,0x02A4,0x02A4}, {0x02A5,0x02A5,0x02A5}, + {0x02A6,0x02A6,0x02A6}, {0x02A7,0x02A7,0x02A7}, + {0x02A8,0x02A8,0x02A8}, {0x02A9,0x02A9,0x02A9}, + {0x02AA,0x02AA,0x02AA}, {0x02AB,0x02AB,0x02AB}, + {0x02AC,0x02AC,0x02AC}, {0x02AD,0x02AD,0x02AD}, + {0x02AE,0x02AE,0x02AE}, {0x02AF,0x02AF,0x02AF}, + {0x02B0,0x02B0,0x02B0}, {0x02B1,0x02B1,0x02B1}, + {0x02B2,0x02B2,0x02B2}, {0x02B3,0x02B3,0x02B3}, + {0x02B4,0x02B4,0x02B4}, {0x02B5,0x02B5,0x02B5}, + {0x02B6,0x02B6,0x02B6}, {0x02B7,0x02B7,0x02B7}, + {0x02B8,0x02B8,0x02B8}, {0x02B9,0x02B9,0x02B9}, + {0x02BA,0x02BA,0x02BA}, {0x02BB,0x02BB,0x02BB}, + {0x02BC,0x02BC,0x02BC}, {0x02BD,0x02BD,0x02BD}, + {0x02BE,0x02BE,0x02BE}, {0x02BF,0x02BF,0x02BF}, + {0x02C0,0x02C0,0x02C0}, {0x02C1,0x02C1,0x02C1}, + {0x02C2,0x02C2,0x02C2}, {0x02C3,0x02C3,0x02C3}, + {0x02C4,0x02C4,0x02C4}, {0x02C5,0x02C5,0x02C5}, + {0x02C6,0x02C6,0x02C6}, {0x02C7,0x02C7,0x02C7}, + {0x02C8,0x02C8,0x02C8}, {0x02C9,0x02C9,0x02C9}, + {0x02CA,0x02CA,0x02CA}, {0x02CB,0x02CB,0x02CB}, + {0x02CC,0x02CC,0x02CC}, {0x02CD,0x02CD,0x02CD}, + {0x02CE,0x02CE,0x02CE}, {0x02CF,0x02CF,0x02CF}, + {0x02D0,0x02D0,0x02D0}, {0x02D1,0x02D1,0x02D1}, + {0x02D2,0x02D2,0x02D2}, {0x02D3,0x02D3,0x02D3}, + {0x02D4,0x02D4,0x02D4}, {0x02D5,0x02D5,0x02D5}, + {0x02D6,0x02D6,0x02D6}, {0x02D7,0x02D7,0x02D7}, + {0x02D8,0x02D8,0x02D8}, {0x02D9,0x02D9,0x02D9}, + {0x02DA,0x02DA,0x02DA}, {0x02DB,0x02DB,0x02DB}, + {0x02DC,0x02DC,0x02DC}, {0x02DD,0x02DD,0x02DD}, + {0x02DE,0x02DE,0x02DE}, {0x02DF,0x02DF,0x02DF}, + {0x02E0,0x02E0,0x02E0}, {0x02E1,0x02E1,0x02E1}, + {0x02E2,0x02E2,0x02E2}, {0x02E3,0x02E3,0x02E3}, + {0x02E4,0x02E4,0x02E4}, {0x02E5,0x02E5,0x02E5}, + {0x02E6,0x02E6,0x02E6}, {0x02E7,0x02E7,0x02E7}, + {0x02E8,0x02E8,0x02E8}, {0x02E9,0x02E9,0x02E9}, + {0x02EA,0x02EA,0x02EA}, {0x02EB,0x02EB,0x02EB}, + {0x02EC,0x02EC,0x02EC}, {0x02ED,0x02ED,0x02ED}, + {0x02EE,0x02EE,0x02EE}, {0x02EF,0x02EF,0x02EF}, + {0x02F0,0x02F0,0x02F0}, {0x02F1,0x02F1,0x02F1}, + {0x02F2,0x02F2,0x02F2}, {0x02F3,0x02F3,0x02F3}, + {0x02F4,0x02F4,0x02F4}, {0x02F5,0x02F5,0x02F5}, + {0x02F6,0x02F6,0x02F6}, {0x02F7,0x02F7,0x02F7}, + {0x02F8,0x02F8,0x02F8}, {0x02F9,0x02F9,0x02F9}, + {0x02FA,0x02FA,0x02FA}, {0x02FB,0x02FB,0x02FB}, + {0x02FC,0x02FC,0x02FC}, {0x02FD,0x02FD,0x02FD}, + {0x02FE,0x02FE,0x02FE}, {0x02FF,0x02FF,0x02FF} +}; + +static MY_UNICASE_INFO plane03[]={ + {0x0300,0x0300,0x0300}, {0x0301,0x0301,0x0301}, + {0x0302,0x0302,0x0302}, {0x0303,0x0303,0x0303}, + {0x0304,0x0304,0x0304}, {0x0305,0x0305,0x0305}, + {0x0306,0x0306,0x0306}, {0x0307,0x0307,0x0307}, + {0x0308,0x0308,0x0308}, {0x0309,0x0309,0x0309}, + {0x030A,0x030A,0x030A}, {0x030B,0x030B,0x030B}, + {0x030C,0x030C,0x030C}, {0x030D,0x030D,0x030D}, + {0x030E,0x030E,0x030E}, {0x030F,0x030F,0x030F}, + {0x0310,0x0310,0x0310}, {0x0311,0x0311,0x0311}, + {0x0312,0x0312,0x0312}, {0x0313,0x0313,0x0313}, + {0x0314,0x0314,0x0314}, {0x0315,0x0315,0x0315}, + {0x0316,0x0316,0x0316}, {0x0317,0x0317,0x0317}, + {0x0318,0x0318,0x0318}, {0x0319,0x0319,0x0319}, + {0x031A,0x031A,0x031A}, {0x031B,0x031B,0x031B}, + {0x031C,0x031C,0x031C}, {0x031D,0x031D,0x031D}, + {0x031E,0x031E,0x031E}, {0x031F,0x031F,0x031F}, + {0x0320,0x0320,0x0320}, {0x0321,0x0321,0x0321}, + {0x0322,0x0322,0x0322}, {0x0323,0x0323,0x0323}, + {0x0324,0x0324,0x0324}, {0x0325,0x0325,0x0325}, + {0x0326,0x0326,0x0326}, {0x0327,0x0327,0x0327}, + {0x0328,0x0328,0x0328}, {0x0329,0x0329,0x0329}, + {0x032A,0x032A,0x032A}, {0x032B,0x032B,0x032B}, + {0x032C,0x032C,0x032C}, {0x032D,0x032D,0x032D}, + {0x032E,0x032E,0x032E}, {0x032F,0x032F,0x032F}, + {0x0330,0x0330,0x0330}, {0x0331,0x0331,0x0331}, + {0x0332,0x0332,0x0332}, {0x0333,0x0333,0x0333}, + {0x0334,0x0334,0x0334}, {0x0335,0x0335,0x0335}, + {0x0336,0x0336,0x0336}, {0x0337,0x0337,0x0337}, + {0x0338,0x0338,0x0338}, {0x0339,0x0339,0x0339}, + {0x033A,0x033A,0x033A}, {0x033B,0x033B,0x033B}, + {0x033C,0x033C,0x033C}, {0x033D,0x033D,0x033D}, + {0x033E,0x033E,0x033E}, {0x033F,0x033F,0x033F}, + {0x0340,0x0340,0x0340}, {0x0341,0x0341,0x0341}, + {0x0342,0x0342,0x0342}, {0x0343,0x0343,0x0343}, + {0x0344,0x0344,0x0344}, {0x0399,0x0345,0x0399}, + {0x0346,0x0346,0x0346}, {0x0347,0x0347,0x0347}, + {0x0348,0x0348,0x0348}, {0x0349,0x0349,0x0349}, + {0x034A,0x034A,0x034A}, {0x034B,0x034B,0x034B}, + {0x034C,0x034C,0x034C}, {0x034D,0x034D,0x034D}, + {0x034E,0x034E,0x034E}, {0x034F,0x034F,0x034F}, + {0x0350,0x0350,0x0350}, {0x0351,0x0351,0x0351}, + {0x0352,0x0352,0x0352}, {0x0353,0x0353,0x0353}, + {0x0354,0x0354,0x0354}, {0x0355,0x0355,0x0355}, + {0x0356,0x0356,0x0356}, {0x0357,0x0357,0x0357}, + {0x0358,0x0358,0x0358}, {0x0359,0x0359,0x0359}, + {0x035A,0x035A,0x035A}, {0x035B,0x035B,0x035B}, + {0x035C,0x035C,0x035C}, {0x035D,0x035D,0x035D}, + {0x035E,0x035E,0x035E}, {0x035F,0x035F,0x035F}, + {0x0360,0x0360,0x0360}, {0x0361,0x0361,0x0361}, + {0x0362,0x0362,0x0362}, {0x0363,0x0363,0x0363}, + {0x0364,0x0364,0x0364}, {0x0365,0x0365,0x0365}, + {0x0366,0x0366,0x0366}, {0x0367,0x0367,0x0367}, + {0x0368,0x0368,0x0368}, {0x0369,0x0369,0x0369}, + {0x036A,0x036A,0x036A}, {0x036B,0x036B,0x036B}, + {0x036C,0x036C,0x036C}, {0x036D,0x036D,0x036D}, + {0x036E,0x036E,0x036E}, {0x036F,0x036F,0x036F}, + {0x0370,0x0370,0x0370}, {0x0371,0x0371,0x0371}, + {0x0372,0x0372,0x0372}, {0x0373,0x0373,0x0373}, + {0x0374,0x0374,0x0374}, {0x0375,0x0375,0x0375}, + {0x0376,0x0376,0x0376}, {0x0377,0x0377,0x0377}, + {0x0378,0x0378,0x0378}, {0x0379,0x0379,0x0379}, + {0x037A,0x037A,0x037A}, {0x037B,0x037B,0x037B}, + {0x037C,0x037C,0x037C}, {0x037D,0x037D,0x037D}, + {0x037E,0x037E,0x037E}, {0x037F,0x037F,0x037F}, + {0x0380,0x0380,0x0380}, {0x0381,0x0381,0x0381}, + {0x0382,0x0382,0x0382}, {0x0383,0x0383,0x0383}, + {0x0384,0x0384,0x0384}, {0x0385,0x0385,0x0385}, + {0x0386,0x03AC,0x0391}, {0x0387,0x0387,0x0387}, + {0x0388,0x03AD,0x0395}, {0x0389,0x03AE,0x0397}, + {0x038A,0x03AF,0x0399}, {0x038B,0x038B,0x038B}, + {0x038C,0x03CC,0x039F}, {0x038D,0x038D,0x038D}, + {0x038E,0x03CD,0x03A5}, {0x038F,0x03CE,0x03A9}, + {0x0390,0x0390,0x0399}, {0x0391,0x03B1,0x0391}, + {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, + {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, + {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, + {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, + {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, + {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, + {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, + {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, + {0x03A2,0x03A2,0x03A2}, {0x03A3,0x03C3,0x03A3}, + {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, + {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, + {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, + {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, + {0x0386,0x03AC,0x0391}, {0x0388,0x03AD,0x0395}, + {0x0389,0x03AE,0x0397}, {0x038A,0x03AF,0x0399}, + {0x03B0,0x03B0,0x03A5}, {0x0391,0x03B1,0x0391}, + {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, + {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, + {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, + {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, + {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, + {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, + {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, + {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, + {0x03A3,0x03C2,0x03A3}, {0x03A3,0x03C3,0x03A3}, + {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, + {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, + {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, + {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, + {0x038C,0x03CC,0x039F}, {0x038E,0x03CD,0x03A5}, + {0x038F,0x03CE,0x03A9}, {0x03CF,0x03CF,0x03CF}, + {0x0392,0x03D0,0x0392}, {0x0398,0x03D1,0x0398}, + {0x03D2,0x03D2,0x03D2}, {0x03D3,0x03D3,0x03D2}, + {0x03D4,0x03D4,0x03D2}, {0x03A6,0x03D5,0x03A6}, + {0x03A0,0x03D6,0x03A0}, {0x03D7,0x03D7,0x03D7}, + {0x03D8,0x03D8,0x03D8}, {0x03D9,0x03D9,0x03D9}, + {0x03DA,0x03DB,0x03DA}, {0x03DA,0x03DB,0x03DA}, + {0x03DC,0x03DD,0x03DC}, {0x03DC,0x03DD,0x03DC}, + {0x03DE,0x03DF,0x03DE}, {0x03DE,0x03DF,0x03DE}, + {0x03E0,0x03E1,0x03E0}, {0x03E0,0x03E1,0x03E0}, + {0x03E2,0x03E3,0x03E2}, {0x03E2,0x03E3,0x03E2}, + {0x03E4,0x03E5,0x03E4}, {0x03E4,0x03E5,0x03E4}, + {0x03E6,0x03E7,0x03E6}, {0x03E6,0x03E7,0x03E6}, + {0x03E8,0x03E9,0x03E8}, {0x03E8,0x03E9,0x03E8}, + {0x03EA,0x03EB,0x03EA}, {0x03EA,0x03EB,0x03EA}, + {0x03EC,0x03ED,0x03EC}, {0x03EC,0x03ED,0x03EC}, + {0x03EE,0x03EF,0x03EE}, {0x03EE,0x03EF,0x03EE}, + {0x039A,0x03F0,0x039A}, {0x03A1,0x03F1,0x03A1}, + {0x03A3,0x03F2,0x03A3}, {0x03F3,0x03F3,0x03F3}, + {0x03F4,0x03F4,0x03F4}, {0x03F5,0x03F5,0x03F5}, + {0x03F6,0x03F6,0x03F6}, {0x03F7,0x03F7,0x03F7}, + {0x03F8,0x03F8,0x03F8}, {0x03F9,0x03F9,0x03F9}, + {0x03FA,0x03FA,0x03FA}, {0x03FB,0x03FB,0x03FB}, + {0x03FC,0x03FC,0x03FC}, {0x03FD,0x03FD,0x03FD}, + {0x03FE,0x03FE,0x03FE}, {0x03FF,0x03FF,0x03FF} +}; + +static MY_UNICASE_INFO plane04[]={ + {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, + {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, + {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, + {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, + {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, + {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, + {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, + {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, + {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, + {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, + {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, + {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, + {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, + {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, + {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, + {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, + {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, + {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, + {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, + {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, + {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, + {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, + {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, + {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, + {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, + {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, + {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, + {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, + {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, + {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, + {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, + {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, + {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, + {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, + {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, + {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, + {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, + {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, + {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, + {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, + {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, + {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, + {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, + {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, + {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, + {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, + {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, + {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, + {0x0460,0x0461,0x0460}, {0x0460,0x0461,0x0460}, + {0x0462,0x0463,0x0462}, {0x0462,0x0463,0x0462}, + {0x0464,0x0465,0x0464}, {0x0464,0x0465,0x0464}, + {0x0466,0x0467,0x0466}, {0x0466,0x0467,0x0466}, + {0x0468,0x0469,0x0468}, {0x0468,0x0469,0x0468}, + {0x046A,0x046B,0x046A}, {0x046A,0x046B,0x046A}, + {0x046C,0x046D,0x046C}, {0x046C,0x046D,0x046C}, + {0x046E,0x046F,0x046E}, {0x046E,0x046F,0x046E}, + {0x0470,0x0471,0x0470}, {0x0470,0x0471,0x0470}, + {0x0472,0x0473,0x0472}, {0x0472,0x0473,0x0472}, + {0x0474,0x0475,0x0474}, {0x0474,0x0475,0x0474}, + {0x0476,0x0477,0x0474}, {0x0476,0x0477,0x0474}, + {0x0478,0x0479,0x0478}, {0x0478,0x0479,0x0478}, + {0x047A,0x047B,0x047A}, {0x047A,0x047B,0x047A}, + {0x047C,0x047D,0x047C}, {0x047C,0x047D,0x047C}, + {0x047E,0x047F,0x047E}, {0x047E,0x047F,0x047E}, + {0x0480,0x0481,0x0480}, {0x0480,0x0481,0x0480}, + {0x0482,0x0482,0x0482}, {0x0483,0x0483,0x0483}, + {0x0484,0x0484,0x0484}, {0x0485,0x0485,0x0485}, + {0x0486,0x0486,0x0486}, {0x0487,0x0487,0x0487}, + {0x0488,0x0488,0x0488}, {0x0489,0x0489,0x0489}, + {0x048A,0x048A,0x048A}, {0x048B,0x048B,0x048B}, + {0x048C,0x048D,0x048C}, {0x048C,0x048D,0x048C}, + {0x048E,0x048F,0x048E}, {0x048E,0x048F,0x048E}, + {0x0490,0x0491,0x0490}, {0x0490,0x0491,0x0490}, + {0x0492,0x0493,0x0492}, {0x0492,0x0493,0x0492}, + {0x0494,0x0495,0x0494}, {0x0494,0x0495,0x0494}, + {0x0496,0x0497,0x0496}, {0x0496,0x0497,0x0496}, + {0x0498,0x0499,0x0498}, {0x0498,0x0499,0x0498}, + {0x049A,0x049B,0x049A}, {0x049A,0x049B,0x049A}, + {0x049C,0x049D,0x049C}, {0x049C,0x049D,0x049C}, + {0x049E,0x049F,0x049E}, {0x049E,0x049F,0x049E}, + {0x04A0,0x04A1,0x04A0}, {0x04A0,0x04A1,0x04A0}, + {0x04A2,0x04A3,0x04A2}, {0x04A2,0x04A3,0x04A2}, + {0x04A4,0x04A5,0x04A4}, {0x04A4,0x04A5,0x04A4}, + {0x04A6,0x04A7,0x04A6}, {0x04A6,0x04A7,0x04A6}, + {0x04A8,0x04A9,0x04A8}, {0x04A8,0x04A9,0x04A8}, + {0x04AA,0x04AB,0x04AA}, {0x04AA,0x04AB,0x04AA}, + {0x04AC,0x04AD,0x04AC}, {0x04AC,0x04AD,0x04AC}, + {0x04AE,0x04AF,0x04AE}, {0x04AE,0x04AF,0x04AE}, + {0x04B0,0x04B1,0x04B0}, {0x04B0,0x04B1,0x04B0}, + {0x04B2,0x04B3,0x04B2}, {0x04B2,0x04B3,0x04B2}, + {0x04B4,0x04B5,0x04B4}, {0x04B4,0x04B5,0x04B4}, + {0x04B6,0x04B7,0x04B6}, {0x04B6,0x04B7,0x04B6}, + {0x04B8,0x04B9,0x04B8}, {0x04B8,0x04B9,0x04B8}, + {0x04BA,0x04BB,0x04BA}, {0x04BA,0x04BB,0x04BA}, + {0x04BC,0x04BD,0x04BC}, {0x04BC,0x04BD,0x04BC}, + {0x04BE,0x04BF,0x04BE}, {0x04BE,0x04BF,0x04BE}, + {0x04C0,0x04C0,0x04C0}, {0x04C1,0x04C2,0x0416}, + {0x04C1,0x04C2,0x0416}, {0x04C3,0x04C4,0x04C3}, + {0x04C3,0x04C4,0x04C3}, {0x04C5,0x04C5,0x04C5}, + {0x04C6,0x04C6,0x04C6}, {0x04C7,0x04C8,0x04C7}, + {0x04C7,0x04C8,0x04C7}, {0x04C9,0x04C9,0x04C9}, + {0x04CA,0x04CA,0x04CA}, {0x04CB,0x04CC,0x04CB}, + {0x04CB,0x04CC,0x04CB}, {0x04CD,0x04CD,0x04CD}, + {0x04CE,0x04CE,0x04CE}, {0x04CF,0x04CF,0x04CF}, + {0x04D0,0x04D1,0x0410}, {0x04D0,0x04D1,0x0410}, + {0x04D2,0x04D3,0x0410}, {0x04D2,0x04D3,0x0410}, + {0x04D4,0x04D5,0x04D4}, {0x04D4,0x04D5,0x04D4}, + {0x04D6,0x04D7,0x0415}, {0x04D6,0x04D7,0x0415}, + {0x04D8,0x04D9,0x04D8}, {0x04D8,0x04D9,0x04D8}, + {0x04DA,0x04DB,0x04D8}, {0x04DA,0x04DB,0x04D8}, + {0x04DC,0x04DD,0x0416}, {0x04DC,0x04DD,0x0416}, + {0x04DE,0x04DF,0x0417}, {0x04DE,0x04DF,0x0417}, + {0x04E0,0x04E1,0x04E0}, {0x04E0,0x04E1,0x04E0}, + {0x04E2,0x04E3,0x0418}, {0x04E2,0x04E3,0x0418}, + {0x04E4,0x04E5,0x0418}, {0x04E4,0x04E5,0x0418}, + {0x04E6,0x04E7,0x041E}, {0x04E6,0x04E7,0x041E}, + {0x04E8,0x04E9,0x04E8}, {0x04E8,0x04E9,0x04E8}, + {0x04EA,0x04EB,0x04E8}, {0x04EA,0x04EB,0x04E8}, + {0x04EC,0x04ED,0x042D}, {0x04EC,0x04ED,0x042D}, + {0x04EE,0x04EF,0x0423}, {0x04EE,0x04EF,0x0423}, + {0x04F0,0x04F1,0x0423}, {0x04F0,0x04F1,0x0423}, + {0x04F2,0x04F3,0x0423}, {0x04F2,0x04F3,0x0423}, + {0x04F4,0x04F5,0x0427}, {0x04F4,0x04F5,0x0427}, + {0x04F6,0x04F6,0x04F6}, {0x04F7,0x04F7,0x04F7}, + {0x04F8,0x04F9,0x042B}, {0x04F8,0x04F9,0x042B}, + {0x04FA,0x04FA,0x04FA}, {0x04FB,0x04FB,0x04FB}, + {0x04FC,0x04FC,0x04FC}, {0x04FD,0x04FD,0x04FD}, + {0x04FE,0x04FE,0x04FE}, {0x04FF,0x04FF,0x04FF} +}; + +static MY_UNICASE_INFO plane05[]={ + {0x0500,0x0500,0x0500}, {0x0501,0x0501,0x0501}, + {0x0502,0x0502,0x0502}, {0x0503,0x0503,0x0503}, + {0x0504,0x0504,0x0504}, {0x0505,0x0505,0x0505}, + {0x0506,0x0506,0x0506}, {0x0507,0x0507,0x0507}, + {0x0508,0x0508,0x0508}, {0x0509,0x0509,0x0509}, + {0x050A,0x050A,0x050A}, {0x050B,0x050B,0x050B}, + {0x050C,0x050C,0x050C}, {0x050D,0x050D,0x050D}, + {0x050E,0x050E,0x050E}, {0x050F,0x050F,0x050F}, + {0x0510,0x0510,0x0510}, {0x0511,0x0511,0x0511}, + {0x0512,0x0512,0x0512}, {0x0513,0x0513,0x0513}, + {0x0514,0x0514,0x0514}, {0x0515,0x0515,0x0515}, + {0x0516,0x0516,0x0516}, {0x0517,0x0517,0x0517}, + {0x0518,0x0518,0x0518}, {0x0519,0x0519,0x0519}, + {0x051A,0x051A,0x051A}, {0x051B,0x051B,0x051B}, + {0x051C,0x051C,0x051C}, {0x051D,0x051D,0x051D}, + {0x051E,0x051E,0x051E}, {0x051F,0x051F,0x051F}, + {0x0520,0x0520,0x0520}, {0x0521,0x0521,0x0521}, + {0x0522,0x0522,0x0522}, {0x0523,0x0523,0x0523}, + {0x0524,0x0524,0x0524}, {0x0525,0x0525,0x0525}, + {0x0526,0x0526,0x0526}, {0x0527,0x0527,0x0527}, + {0x0528,0x0528,0x0528}, {0x0529,0x0529,0x0529}, + {0x052A,0x052A,0x052A}, {0x052B,0x052B,0x052B}, + {0x052C,0x052C,0x052C}, {0x052D,0x052D,0x052D}, + {0x052E,0x052E,0x052E}, {0x052F,0x052F,0x052F}, + {0x0530,0x0530,0x0530}, {0x0531,0x0561,0x0531}, + {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, + {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, + {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, + {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, + {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, + {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, + {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, + {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, + {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, + {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, + {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, + {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, + {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, + {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, + {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, + {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, + {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, + {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, + {0x0556,0x0586,0x0556}, {0x0557,0x0557,0x0557}, + {0x0558,0x0558,0x0558}, {0x0559,0x0559,0x0559}, + {0x055A,0x055A,0x055A}, {0x055B,0x055B,0x055B}, + {0x055C,0x055C,0x055C}, {0x055D,0x055D,0x055D}, + {0x055E,0x055E,0x055E}, {0x055F,0x055F,0x055F}, + {0x0560,0x0560,0x0560}, {0x0531,0x0561,0x0531}, + {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, + {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, + {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, + {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, + {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, + {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, + {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, + {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, + {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, + {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, + {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, + {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, + {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, + {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, + {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, + {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, + {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, + {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, + {0x0556,0x0586,0x0556}, {0x0587,0x0587,0x0587}, + {0x0588,0x0588,0x0588}, {0x0589,0x0589,0x0589}, + {0x058A,0x058A,0x058A}, {0x058B,0x058B,0x058B}, + {0x058C,0x058C,0x058C}, {0x058D,0x058D,0x058D}, + {0x058E,0x058E,0x058E}, {0x058F,0x058F,0x058F}, + {0x0590,0x0590,0x0590}, {0x0591,0x0591,0x0591}, + {0x0592,0x0592,0x0592}, {0x0593,0x0593,0x0593}, + {0x0594,0x0594,0x0594}, {0x0595,0x0595,0x0595}, + {0x0596,0x0596,0x0596}, {0x0597,0x0597,0x0597}, + {0x0598,0x0598,0x0598}, {0x0599,0x0599,0x0599}, + {0x059A,0x059A,0x059A}, {0x059B,0x059B,0x059B}, + {0x059C,0x059C,0x059C}, {0x059D,0x059D,0x059D}, + {0x059E,0x059E,0x059E}, {0x059F,0x059F,0x059F}, + {0x05A0,0x05A0,0x05A0}, {0x05A1,0x05A1,0x05A1}, + {0x05A2,0x05A2,0x05A2}, {0x05A3,0x05A3,0x05A3}, + {0x05A4,0x05A4,0x05A4}, {0x05A5,0x05A5,0x05A5}, + {0x05A6,0x05A6,0x05A6}, {0x05A7,0x05A7,0x05A7}, + {0x05A8,0x05A8,0x05A8}, {0x05A9,0x05A9,0x05A9}, + {0x05AA,0x05AA,0x05AA}, {0x05AB,0x05AB,0x05AB}, + {0x05AC,0x05AC,0x05AC}, {0x05AD,0x05AD,0x05AD}, + {0x05AE,0x05AE,0x05AE}, {0x05AF,0x05AF,0x05AF}, + {0x05B0,0x05B0,0x05B0}, {0x05B1,0x05B1,0x05B1}, + {0x05B2,0x05B2,0x05B2}, {0x05B3,0x05B3,0x05B3}, + {0x05B4,0x05B4,0x05B4}, {0x05B5,0x05B5,0x05B5}, + {0x05B6,0x05B6,0x05B6}, {0x05B7,0x05B7,0x05B7}, + {0x05B8,0x05B8,0x05B8}, {0x05B9,0x05B9,0x05B9}, + {0x05BA,0x05BA,0x05BA}, {0x05BB,0x05BB,0x05BB}, + {0x05BC,0x05BC,0x05BC}, {0x05BD,0x05BD,0x05BD}, + {0x05BE,0x05BE,0x05BE}, {0x05BF,0x05BF,0x05BF}, + {0x05C0,0x05C0,0x05C0}, {0x05C1,0x05C1,0x05C1}, + {0x05C2,0x05C2,0x05C2}, {0x05C3,0x05C3,0x05C3}, + {0x05C4,0x05C4,0x05C4}, {0x05C5,0x05C5,0x05C5}, + {0x05C6,0x05C6,0x05C6}, {0x05C7,0x05C7,0x05C7}, + {0x05C8,0x05C8,0x05C8}, {0x05C9,0x05C9,0x05C9}, + {0x05CA,0x05CA,0x05CA}, {0x05CB,0x05CB,0x05CB}, + {0x05CC,0x05CC,0x05CC}, {0x05CD,0x05CD,0x05CD}, + {0x05CE,0x05CE,0x05CE}, {0x05CF,0x05CF,0x05CF}, + {0x05D0,0x05D0,0x05D0}, {0x05D1,0x05D1,0x05D1}, + {0x05D2,0x05D2,0x05D2}, {0x05D3,0x05D3,0x05D3}, + {0x05D4,0x05D4,0x05D4}, {0x05D5,0x05D5,0x05D5}, + {0x05D6,0x05D6,0x05D6}, {0x05D7,0x05D7,0x05D7}, + {0x05D8,0x05D8,0x05D8}, {0x05D9,0x05D9,0x05D9}, + {0x05DA,0x05DA,0x05DA}, {0x05DB,0x05DB,0x05DB}, + {0x05DC,0x05DC,0x05DC}, {0x05DD,0x05DD,0x05DD}, + {0x05DE,0x05DE,0x05DE}, {0x05DF,0x05DF,0x05DF}, + {0x05E0,0x05E0,0x05E0}, {0x05E1,0x05E1,0x05E1}, + {0x05E2,0x05E2,0x05E2}, {0x05E3,0x05E3,0x05E3}, + {0x05E4,0x05E4,0x05E4}, {0x05E5,0x05E5,0x05E5}, + {0x05E6,0x05E6,0x05E6}, {0x05E7,0x05E7,0x05E7}, + {0x05E8,0x05E8,0x05E8}, {0x05E9,0x05E9,0x05E9}, + {0x05EA,0x05EA,0x05EA}, {0x05EB,0x05EB,0x05EB}, + {0x05EC,0x05EC,0x05EC}, {0x05ED,0x05ED,0x05ED}, + {0x05EE,0x05EE,0x05EE}, {0x05EF,0x05EF,0x05EF}, + {0x05F0,0x05F0,0x05F0}, {0x05F1,0x05F1,0x05F1}, + {0x05F2,0x05F2,0x05F2}, {0x05F3,0x05F3,0x05F3}, + {0x05F4,0x05F4,0x05F4}, {0x05F5,0x05F5,0x05F5}, + {0x05F6,0x05F6,0x05F6}, {0x05F7,0x05F7,0x05F7}, + {0x05F8,0x05F8,0x05F8}, {0x05F9,0x05F9,0x05F9}, + {0x05FA,0x05FA,0x05FA}, {0x05FB,0x05FB,0x05FB}, + {0x05FC,0x05FC,0x05FC}, {0x05FD,0x05FD,0x05FD}, + {0x05FE,0x05FE,0x05FE}, {0x05FF,0x05FF,0x05FF} +}; + +static MY_UNICASE_INFO plane1E[]={ + {0x1E00,0x1E01,0x0041}, {0x1E00,0x1E01,0x0041}, + {0x1E02,0x1E03,0x0042}, {0x1E02,0x1E03,0x0042}, + {0x1E04,0x1E05,0x0042}, {0x1E04,0x1E05,0x0042}, + {0x1E06,0x1E07,0x0042}, {0x1E06,0x1E07,0x0042}, + {0x1E08,0x1E09,0x0043}, {0x1E08,0x1E09,0x0043}, + {0x1E0A,0x1E0B,0x0044}, {0x1E0A,0x1E0B,0x0044}, + {0x1E0C,0x1E0D,0x0044}, {0x1E0C,0x1E0D,0x0044}, + {0x1E0E,0x1E0F,0x0044}, {0x1E0E,0x1E0F,0x0044}, + {0x1E10,0x1E11,0x0044}, {0x1E10,0x1E11,0x0044}, + {0x1E12,0x1E13,0x0044}, {0x1E12,0x1E13,0x0044}, + {0x1E14,0x1E15,0x0045}, {0x1E14,0x1E15,0x0045}, + {0x1E16,0x1E17,0x0045}, {0x1E16,0x1E17,0x0045}, + {0x1E18,0x1E19,0x0045}, {0x1E18,0x1E19,0x0045}, + {0x1E1A,0x1E1B,0x0045}, {0x1E1A,0x1E1B,0x0045}, + {0x1E1C,0x1E1D,0x0045}, {0x1E1C,0x1E1D,0x0045}, + {0x1E1E,0x1E1F,0x0046}, {0x1E1E,0x1E1F,0x0046}, + {0x1E20,0x1E21,0x0047}, {0x1E20,0x1E21,0x0047}, + {0x1E22,0x1E23,0x0048}, {0x1E22,0x1E23,0x0048}, + {0x1E24,0x1E25,0x0048}, {0x1E24,0x1E25,0x0048}, + {0x1E26,0x1E27,0x0048}, {0x1E26,0x1E27,0x0048}, + {0x1E28,0x1E29,0x0048}, {0x1E28,0x1E29,0x0048}, + {0x1E2A,0x1E2B,0x0048}, {0x1E2A,0x1E2B,0x0048}, + {0x1E2C,0x1E2D,0x0049}, {0x1E2C,0x1E2D,0x0049}, + {0x1E2E,0x1E2F,0x0049}, {0x1E2E,0x1E2F,0x0049}, + {0x1E30,0x1E31,0x004B}, {0x1E30,0x1E31,0x004B}, + {0x1E32,0x1E33,0x004B}, {0x1E32,0x1E33,0x004B}, + {0x1E34,0x1E35,0x004B}, {0x1E34,0x1E35,0x004B}, + {0x1E36,0x1E37,0x004C}, {0x1E36,0x1E37,0x004C}, + {0x1E38,0x1E39,0x004C}, {0x1E38,0x1E39,0x004C}, + {0x1E3A,0x1E3B,0x004C}, {0x1E3A,0x1E3B,0x004C}, + {0x1E3C,0x1E3D,0x004C}, {0x1E3C,0x1E3D,0x004C}, + {0x1E3E,0x1E3F,0x004D}, {0x1E3E,0x1E3F,0x004D}, + {0x1E40,0x1E41,0x004D}, {0x1E40,0x1E41,0x004D}, + {0x1E42,0x1E43,0x004D}, {0x1E42,0x1E43,0x004D}, + {0x1E44,0x1E45,0x004E}, {0x1E44,0x1E45,0x004E}, + {0x1E46,0x1E47,0x004E}, {0x1E46,0x1E47,0x004E}, + {0x1E48,0x1E49,0x004E}, {0x1E48,0x1E49,0x004E}, + {0x1E4A,0x1E4B,0x004E}, {0x1E4A,0x1E4B,0x004E}, + {0x1E4C,0x1E4D,0x004F}, {0x1E4C,0x1E4D,0x004F}, + {0x1E4E,0x1E4F,0x004F}, {0x1E4E,0x1E4F,0x004F}, + {0x1E50,0x1E51,0x004F}, {0x1E50,0x1E51,0x004F}, + {0x1E52,0x1E53,0x004F}, {0x1E52,0x1E53,0x004F}, + {0x1E54,0x1E55,0x0050}, {0x1E54,0x1E55,0x0050}, + {0x1E56,0x1E57,0x0050}, {0x1E56,0x1E57,0x0050}, + {0x1E58,0x1E59,0x0052}, {0x1E58,0x1E59,0x0052}, + {0x1E5A,0x1E5B,0x0052}, {0x1E5A,0x1E5B,0x0052}, + {0x1E5C,0x1E5D,0x0052}, {0x1E5C,0x1E5D,0x0052}, + {0x1E5E,0x1E5F,0x0052}, {0x1E5E,0x1E5F,0x0052}, + {0x1E60,0x1E61,0x0053}, {0x1E60,0x1E61,0x0053}, + {0x1E62,0x1E63,0x0053}, {0x1E62,0x1E63,0x0053}, + {0x1E64,0x1E65,0x0053}, {0x1E64,0x1E65,0x0053}, + {0x1E66,0x1E67,0x0053}, {0x1E66,0x1E67,0x0053}, + {0x1E68,0x1E69,0x0053}, {0x1E68,0x1E69,0x0053}, + {0x1E6A,0x1E6B,0x0054}, {0x1E6A,0x1E6B,0x0054}, + {0x1E6C,0x1E6D,0x0054}, {0x1E6C,0x1E6D,0x0054}, + {0x1E6E,0x1E6F,0x0054}, {0x1E6E,0x1E6F,0x0054}, + {0x1E70,0x1E71,0x0054}, {0x1E70,0x1E71,0x0054}, + {0x1E72,0x1E73,0x0055}, {0x1E72,0x1E73,0x0055}, + {0x1E74,0x1E75,0x0055}, {0x1E74,0x1E75,0x0055}, + {0x1E76,0x1E77,0x0055}, {0x1E76,0x1E77,0x0055}, + {0x1E78,0x1E79,0x0055}, {0x1E78,0x1E79,0x0055}, + {0x1E7A,0x1E7B,0x0055}, {0x1E7A,0x1E7B,0x0055}, + {0x1E7C,0x1E7D,0x0056}, {0x1E7C,0x1E7D,0x0056}, + {0x1E7E,0x1E7F,0x0056}, {0x1E7E,0x1E7F,0x0056}, + {0x1E80,0x1E81,0x0057}, {0x1E80,0x1E81,0x0057}, + {0x1E82,0x1E83,0x0057}, {0x1E82,0x1E83,0x0057}, + {0x1E84,0x1E85,0x0057}, {0x1E84,0x1E85,0x0057}, + {0x1E86,0x1E87,0x0057}, {0x1E86,0x1E87,0x0057}, + {0x1E88,0x1E89,0x0057}, {0x1E88,0x1E89,0x0057}, + {0x1E8A,0x1E8B,0x0058}, {0x1E8A,0x1E8B,0x0058}, + {0x1E8C,0x1E8D,0x0058}, {0x1E8C,0x1E8D,0x0058}, + {0x1E8E,0x1E8F,0x0059}, {0x1E8E,0x1E8F,0x0059}, + {0x1E90,0x1E91,0x005A}, {0x1E90,0x1E91,0x005A}, + {0x1E92,0x1E93,0x005A}, {0x1E92,0x1E93,0x005A}, + {0x1E94,0x1E95,0x005A}, {0x1E94,0x1E95,0x005A}, + {0x1E96,0x1E96,0x0048}, {0x1E97,0x1E97,0x0054}, + {0x1E98,0x1E98,0x0057}, {0x1E99,0x1E99,0x0059}, + {0x1E9A,0x1E9A,0x1E9A}, {0x1E60,0x1E9B,0x0053}, + {0x1E9C,0x1E9C,0x1E9C}, {0x1E9D,0x1E9D,0x1E9D}, + {0x1E9E,0x1E9E,0x1E9E}, {0x1E9F,0x1E9F,0x1E9F}, + {0x1EA0,0x1EA1,0x0041}, {0x1EA0,0x1EA1,0x0041}, + {0x1EA2,0x1EA3,0x0041}, {0x1EA2,0x1EA3,0x0041}, + {0x1EA4,0x1EA5,0x0041}, {0x1EA4,0x1EA5,0x0041}, + {0x1EA6,0x1EA7,0x0041}, {0x1EA6,0x1EA7,0x0041}, + {0x1EA8,0x1EA9,0x0041}, {0x1EA8,0x1EA9,0x0041}, + {0x1EAA,0x1EAB,0x0041}, {0x1EAA,0x1EAB,0x0041}, + {0x1EAC,0x1EAD,0x0041}, {0x1EAC,0x1EAD,0x0041}, + {0x1EAE,0x1EAF,0x0041}, {0x1EAE,0x1EAF,0x0041}, + {0x1EB0,0x1EB1,0x0041}, {0x1EB0,0x1EB1,0x0041}, + {0x1EB2,0x1EB3,0x0041}, {0x1EB2,0x1EB3,0x0041}, + {0x1EB4,0x1EB5,0x0041}, {0x1EB4,0x1EB5,0x0041}, + {0x1EB6,0x1EB7,0x0041}, {0x1EB6,0x1EB7,0x0041}, + {0x1EB8,0x1EB9,0x0045}, {0x1EB8,0x1EB9,0x0045}, + {0x1EBA,0x1EBB,0x0045}, {0x1EBA,0x1EBB,0x0045}, + {0x1EBC,0x1EBD,0x0045}, {0x1EBC,0x1EBD,0x0045}, + {0x1EBE,0x1EBF,0x0045}, {0x1EBE,0x1EBF,0x0045}, + {0x1EC0,0x1EC1,0x0045}, {0x1EC0,0x1EC1,0x0045}, + {0x1EC2,0x1EC3,0x0045}, {0x1EC2,0x1EC3,0x0045}, + {0x1EC4,0x1EC5,0x0045}, {0x1EC4,0x1EC5,0x0045}, + {0x1EC6,0x1EC7,0x0045}, {0x1EC6,0x1EC7,0x0045}, + {0x1EC8,0x1EC9,0x0049}, {0x1EC8,0x1EC9,0x0049}, + {0x1ECA,0x1ECB,0x0049}, {0x1ECA,0x1ECB,0x0049}, + {0x1ECC,0x1ECD,0x004F}, {0x1ECC,0x1ECD,0x004F}, + {0x1ECE,0x1ECF,0x004F}, {0x1ECE,0x1ECF,0x004F}, + {0x1ED0,0x1ED1,0x004F}, {0x1ED0,0x1ED1,0x004F}, + {0x1ED2,0x1ED3,0x004F}, {0x1ED2,0x1ED3,0x004F}, + {0x1ED4,0x1ED5,0x004F}, {0x1ED4,0x1ED5,0x004F}, + {0x1ED6,0x1ED7,0x004F}, {0x1ED6,0x1ED7,0x004F}, + {0x1ED8,0x1ED9,0x004F}, {0x1ED8,0x1ED9,0x004F}, + {0x1EDA,0x1EDB,0x004F}, {0x1EDA,0x1EDB,0x004F}, + {0x1EDC,0x1EDD,0x004F}, {0x1EDC,0x1EDD,0x004F}, + {0x1EDE,0x1EDF,0x004F}, {0x1EDE,0x1EDF,0x004F}, + {0x1EE0,0x1EE1,0x004F}, {0x1EE0,0x1EE1,0x004F}, + {0x1EE2,0x1EE3,0x004F}, {0x1EE2,0x1EE3,0x004F}, + {0x1EE4,0x1EE5,0x0055}, {0x1EE4,0x1EE5,0x0055}, + {0x1EE6,0x1EE7,0x0055}, {0x1EE6,0x1EE7,0x0055}, + {0x1EE8,0x1EE9,0x0055}, {0x1EE8,0x1EE9,0x0055}, + {0x1EEA,0x1EEB,0x0055}, {0x1EEA,0x1EEB,0x0055}, + {0x1EEC,0x1EED,0x0055}, {0x1EEC,0x1EED,0x0055}, + {0x1EEE,0x1EEF,0x0055}, {0x1EEE,0x1EEF,0x0055}, + {0x1EF0,0x1EF1,0x0055}, {0x1EF0,0x1EF1,0x0055}, + {0x1EF2,0x1EF3,0x0059}, {0x1EF2,0x1EF3,0x0059}, + {0x1EF4,0x1EF5,0x0059}, {0x1EF4,0x1EF5,0x0059}, + {0x1EF6,0x1EF7,0x0059}, {0x1EF6,0x1EF7,0x0059}, + {0x1EF8,0x1EF9,0x0059}, {0x1EF8,0x1EF9,0x0059}, + {0x1EFA,0x1EFA,0x1EFA}, {0x1EFB,0x1EFB,0x1EFB}, + {0x1EFC,0x1EFC,0x1EFC}, {0x1EFD,0x1EFD,0x1EFD}, + {0x1EFE,0x1EFE,0x1EFE}, {0x1EFF,0x1EFF,0x1EFF} +}; + +static MY_UNICASE_INFO plane1F[]={ + {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, + {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, + {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, + {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, + {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, + {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, + {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, + {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, + {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, + {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, + {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, + {0x1F16,0x1F16,0x1F16}, {0x1F17,0x1F17,0x1F17}, + {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, + {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, + {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, + {0x1F1E,0x1F1E,0x1F1E}, {0x1F1F,0x1F1F,0x1F1F}, + {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, + {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, + {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, + {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, + {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, + {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, + {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, + {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, + {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, + {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, + {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, + {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, + {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, + {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, + {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, + {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, + {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, + {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, + {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, + {0x1F46,0x1F46,0x1F46}, {0x1F47,0x1F47,0x1F47}, + {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, + {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, + {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, + {0x1F4E,0x1F4E,0x1F4E}, {0x1F4F,0x1F4F,0x1F4F}, + {0x1F50,0x1F50,0x03A5}, {0x1F59,0x1F51,0x03A5}, + {0x1F52,0x1F52,0x03A5}, {0x1F5B,0x1F53,0x03A5}, + {0x1F54,0x1F54,0x03A5}, {0x1F5D,0x1F55,0x03A5}, + {0x1F56,0x1F56,0x03A5}, {0x1F5F,0x1F57,0x03A5}, + {0x1F58,0x1F58,0x1F58}, {0x1F59,0x1F51,0x03A5}, + {0x1F5A,0x1F5A,0x1F5A}, {0x1F5B,0x1F53,0x03A5}, + {0x1F5C,0x1F5C,0x1F5C}, {0x1F5D,0x1F55,0x03A5}, + {0x1F5E,0x1F5E,0x1F5E}, {0x1F5F,0x1F57,0x03A5}, + {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, + {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, + {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, + {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, + {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, + {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, + {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, + {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, + {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, + {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, + {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, + {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, + {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, + {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, + {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, + {0x1F7E,0x1F7E,0x1F7E}, {0x1F7F,0x1F7F,0x1F7F}, + {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, + {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, + {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, + {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, + {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, + {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, + {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, + {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, + {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, + {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, + {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, + {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, + {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, + {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, + {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, + {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, + {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, + {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, + {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, + {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, + {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, + {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, + {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, + {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, + {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, + {0x1FB2,0x1FB2,0x0391}, {0x1FBC,0x1FB3,0x0391}, + {0x1FB4,0x1FB4,0x0391}, {0x1FB5,0x1FB5,0x1FB5}, + {0x1FB6,0x1FB6,0x0391}, {0x1FB7,0x1FB7,0x0391}, + {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, + {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, + {0x1FBC,0x1FB3,0x0391}, {0x1FBD,0x1FBD,0x1FBD}, + {0x0399,0x1FBE,0x0399}, {0x1FBF,0x1FBF,0x1FBF}, + {0x1FC0,0x1FC0,0x1FC0}, {0x1FC1,0x1FC1,0x1FC1}, + {0x1FC2,0x1FC2,0x0397}, {0x1FCC,0x1FC3,0x0397}, + {0x1FC4,0x1FC4,0x0397}, {0x1FC5,0x1FC5,0x1FC5}, + {0x1FC6,0x1FC6,0x0397}, {0x1FC7,0x1FC7,0x0397}, + {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, + {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, + {0x1FCC,0x1FC3,0x0397}, {0x1FCD,0x1FCD,0x1FCD}, + {0x1FCE,0x1FCE,0x1FCE}, {0x1FCF,0x1FCF,0x1FCF}, + {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, + {0x1FD2,0x1FD2,0x0399}, {0x1FD3,0x1FD3,0x1FD3}, + {0x1FD4,0x1FD4,0x1FD4}, {0x1FD5,0x1FD5,0x1FD5}, + {0x1FD6,0x1FD6,0x0399}, {0x1FD7,0x1FD7,0x0399}, + {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, + {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, + {0x1FDC,0x1FDC,0x1FDC}, {0x1FDD,0x1FDD,0x1FDD}, + {0x1FDE,0x1FDE,0x1FDE}, {0x1FDF,0x1FDF,0x1FDF}, + {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, + {0x1FE2,0x1FE2,0x03A5}, {0x1FE3,0x1FE3,0x1FE3}, + {0x1FE4,0x1FE4,0x03A1}, {0x1FEC,0x1FE5,0x03A1}, + {0x1FE6,0x1FE6,0x03A5}, {0x1FE7,0x1FE7,0x03A5}, + {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, + {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, + {0x1FEC,0x1FE5,0x03A1}, {0x1FED,0x1FED,0x1FED}, + {0x1FEE,0x1FEE,0x1FEE}, {0x1FEF,0x1FEF,0x1FEF}, + {0x1FF0,0x1FF0,0x1FF0}, {0x1FF1,0x1FF1,0x1FF1}, + {0x1FF2,0x1FF2,0x03A9}, {0x1FFC,0x1FF3,0x03A9}, + {0x1FF4,0x1FF4,0x03A9}, {0x1FF5,0x1FF5,0x1FF5}, + {0x1FF6,0x1FF6,0x03A9}, {0x1FF7,0x1FF7,0x03A9}, + {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, + {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, + {0x1FFC,0x1FF3,0x03A9}, {0x1FFD,0x1FFD,0x1FFD}, + {0x1FFE,0x1FFE,0x1FFE}, {0x1FFF,0x1FFF,0x1FFF} +}; + +static MY_UNICASE_INFO plane21[]={ + {0x2100,0x2100,0x2100}, {0x2101,0x2101,0x2101}, + {0x2102,0x2102,0x2102}, {0x2103,0x2103,0x2103}, + {0x2104,0x2104,0x2104}, {0x2105,0x2105,0x2105}, + {0x2106,0x2106,0x2106}, {0x2107,0x2107,0x2107}, + {0x2108,0x2108,0x2108}, {0x2109,0x2109,0x2109}, + {0x210A,0x210A,0x210A}, {0x210B,0x210B,0x210B}, + {0x210C,0x210C,0x210C}, {0x210D,0x210D,0x210D}, + {0x210E,0x210E,0x210E}, {0x210F,0x210F,0x210F}, + {0x2110,0x2110,0x2110}, {0x2111,0x2111,0x2111}, + {0x2112,0x2112,0x2112}, {0x2113,0x2113,0x2113}, + {0x2114,0x2114,0x2114}, {0x2115,0x2115,0x2115}, + {0x2116,0x2116,0x2116}, {0x2117,0x2117,0x2117}, + {0x2118,0x2118,0x2118}, {0x2119,0x2119,0x2119}, + {0x211A,0x211A,0x211A}, {0x211B,0x211B,0x211B}, + {0x211C,0x211C,0x211C}, {0x211D,0x211D,0x211D}, + {0x211E,0x211E,0x211E}, {0x211F,0x211F,0x211F}, + {0x2120,0x2120,0x2120}, {0x2121,0x2121,0x2121}, + {0x2122,0x2122,0x2122}, {0x2123,0x2123,0x2123}, + {0x2124,0x2124,0x2124}, {0x2125,0x2125,0x2125}, + {0x2126,0x03C9,0x2126}, {0x2127,0x2127,0x2127}, + {0x2128,0x2128,0x2128}, {0x2129,0x2129,0x2129}, + {0x212A,0x006B,0x212A}, {0x212B,0x00E5,0x212B}, + {0x212C,0x212C,0x212C}, {0x212D,0x212D,0x212D}, + {0x212E,0x212E,0x212E}, {0x212F,0x212F,0x212F}, + {0x2130,0x2130,0x2130}, {0x2131,0x2131,0x2131}, + {0x2132,0x2132,0x2132}, {0x2133,0x2133,0x2133}, + {0x2134,0x2134,0x2134}, {0x2135,0x2135,0x2135}, + {0x2136,0x2136,0x2136}, {0x2137,0x2137,0x2137}, + {0x2138,0x2138,0x2138}, {0x2139,0x2139,0x2139}, + {0x213A,0x213A,0x213A}, {0x213B,0x213B,0x213B}, + {0x213C,0x213C,0x213C}, {0x213D,0x213D,0x213D}, + {0x213E,0x213E,0x213E}, {0x213F,0x213F,0x213F}, + {0x2140,0x2140,0x2140}, {0x2141,0x2141,0x2141}, + {0x2142,0x2142,0x2142}, {0x2143,0x2143,0x2143}, + {0x2144,0x2144,0x2144}, {0x2145,0x2145,0x2145}, + {0x2146,0x2146,0x2146}, {0x2147,0x2147,0x2147}, + {0x2148,0x2148,0x2148}, {0x2149,0x2149,0x2149}, + {0x214A,0x214A,0x214A}, {0x214B,0x214B,0x214B}, + {0x214C,0x214C,0x214C}, {0x214D,0x214D,0x214D}, + {0x214E,0x214E,0x214E}, {0x214F,0x214F,0x214F}, + {0x2150,0x2150,0x2150}, {0x2151,0x2151,0x2151}, + {0x2152,0x2152,0x2152}, {0x2153,0x2153,0x2153}, + {0x2154,0x2154,0x2154}, {0x2155,0x2155,0x2155}, + {0x2156,0x2156,0x2156}, {0x2157,0x2157,0x2157}, + {0x2158,0x2158,0x2158}, {0x2159,0x2159,0x2159}, + {0x215A,0x215A,0x215A}, {0x215B,0x215B,0x215B}, + {0x215C,0x215C,0x215C}, {0x215D,0x215D,0x215D}, + {0x215E,0x215E,0x215E}, {0x215F,0x215F,0x215F}, + {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, + {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, + {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, + {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, + {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, + {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, + {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, + {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, + {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, + {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, + {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, + {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, + {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, + {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, + {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, + {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, + {0x2180,0x2180,0x2180}, {0x2181,0x2181,0x2181}, + {0x2182,0x2182,0x2182}, {0x2183,0x2183,0x2183}, + {0x2184,0x2184,0x2184}, {0x2185,0x2185,0x2185}, + {0x2186,0x2186,0x2186}, {0x2187,0x2187,0x2187}, + {0x2188,0x2188,0x2188}, {0x2189,0x2189,0x2189}, + {0x218A,0x218A,0x218A}, {0x218B,0x218B,0x218B}, + {0x218C,0x218C,0x218C}, {0x218D,0x218D,0x218D}, + {0x218E,0x218E,0x218E}, {0x218F,0x218F,0x218F}, + {0x2190,0x2190,0x2190}, {0x2191,0x2191,0x2191}, + {0x2192,0x2192,0x2192}, {0x2193,0x2193,0x2193}, + {0x2194,0x2194,0x2194}, {0x2195,0x2195,0x2195}, + {0x2196,0x2196,0x2196}, {0x2197,0x2197,0x2197}, + {0x2198,0x2198,0x2198}, {0x2199,0x2199,0x2199}, + {0x219A,0x219A,0x219A}, {0x219B,0x219B,0x219B}, + {0x219C,0x219C,0x219C}, {0x219D,0x219D,0x219D}, + {0x219E,0x219E,0x219E}, {0x219F,0x219F,0x219F}, + {0x21A0,0x21A0,0x21A0}, {0x21A1,0x21A1,0x21A1}, + {0x21A2,0x21A2,0x21A2}, {0x21A3,0x21A3,0x21A3}, + {0x21A4,0x21A4,0x21A4}, {0x21A5,0x21A5,0x21A5}, + {0x21A6,0x21A6,0x21A6}, {0x21A7,0x21A7,0x21A7}, + {0x21A8,0x21A8,0x21A8}, {0x21A9,0x21A9,0x21A9}, + {0x21AA,0x21AA,0x21AA}, {0x21AB,0x21AB,0x21AB}, + {0x21AC,0x21AC,0x21AC}, {0x21AD,0x21AD,0x21AD}, + {0x21AE,0x21AE,0x21AE}, {0x21AF,0x21AF,0x21AF}, + {0x21B0,0x21B0,0x21B0}, {0x21B1,0x21B1,0x21B1}, + {0x21B2,0x21B2,0x21B2}, {0x21B3,0x21B3,0x21B3}, + {0x21B4,0x21B4,0x21B4}, {0x21B5,0x21B5,0x21B5}, + {0x21B6,0x21B6,0x21B6}, {0x21B7,0x21B7,0x21B7}, + {0x21B8,0x21B8,0x21B8}, {0x21B9,0x21B9,0x21B9}, + {0x21BA,0x21BA,0x21BA}, {0x21BB,0x21BB,0x21BB}, + {0x21BC,0x21BC,0x21BC}, {0x21BD,0x21BD,0x21BD}, + {0x21BE,0x21BE,0x21BE}, {0x21BF,0x21BF,0x21BF}, + {0x21C0,0x21C0,0x21C0}, {0x21C1,0x21C1,0x21C1}, + {0x21C2,0x21C2,0x21C2}, {0x21C3,0x21C3,0x21C3}, + {0x21C4,0x21C4,0x21C4}, {0x21C5,0x21C5,0x21C5}, + {0x21C6,0x21C6,0x21C6}, {0x21C7,0x21C7,0x21C7}, + {0x21C8,0x21C8,0x21C8}, {0x21C9,0x21C9,0x21C9}, + {0x21CA,0x21CA,0x21CA}, {0x21CB,0x21CB,0x21CB}, + {0x21CC,0x21CC,0x21CC}, {0x21CD,0x21CD,0x21CD}, + {0x21CE,0x21CE,0x21CE}, {0x21CF,0x21CF,0x21CF}, + {0x21D0,0x21D0,0x21D0}, {0x21D1,0x21D1,0x21D1}, + {0x21D2,0x21D2,0x21D2}, {0x21D3,0x21D3,0x21D3}, + {0x21D4,0x21D4,0x21D4}, {0x21D5,0x21D5,0x21D5}, + {0x21D6,0x21D6,0x21D6}, {0x21D7,0x21D7,0x21D7}, + {0x21D8,0x21D8,0x21D8}, {0x21D9,0x21D9,0x21D9}, + {0x21DA,0x21DA,0x21DA}, {0x21DB,0x21DB,0x21DB}, + {0x21DC,0x21DC,0x21DC}, {0x21DD,0x21DD,0x21DD}, + {0x21DE,0x21DE,0x21DE}, {0x21DF,0x21DF,0x21DF}, + {0x21E0,0x21E0,0x21E0}, {0x21E1,0x21E1,0x21E1}, + {0x21E2,0x21E2,0x21E2}, {0x21E3,0x21E3,0x21E3}, + {0x21E4,0x21E4,0x21E4}, {0x21E5,0x21E5,0x21E5}, + {0x21E6,0x21E6,0x21E6}, {0x21E7,0x21E7,0x21E7}, + {0x21E8,0x21E8,0x21E8}, {0x21E9,0x21E9,0x21E9}, + {0x21EA,0x21EA,0x21EA}, {0x21EB,0x21EB,0x21EB}, + {0x21EC,0x21EC,0x21EC}, {0x21ED,0x21ED,0x21ED}, + {0x21EE,0x21EE,0x21EE}, {0x21EF,0x21EF,0x21EF}, + {0x21F0,0x21F0,0x21F0}, {0x21F1,0x21F1,0x21F1}, + {0x21F2,0x21F2,0x21F2}, {0x21F3,0x21F3,0x21F3}, + {0x21F4,0x21F4,0x21F4}, {0x21F5,0x21F5,0x21F5}, + {0x21F6,0x21F6,0x21F6}, {0x21F7,0x21F7,0x21F7}, + {0x21F8,0x21F8,0x21F8}, {0x21F9,0x21F9,0x21F9}, + {0x21FA,0x21FA,0x21FA}, {0x21FB,0x21FB,0x21FB}, + {0x21FC,0x21FC,0x21FC}, {0x21FD,0x21FD,0x21FD}, + {0x21FE,0x21FE,0x21FE}, {0x21FF,0x21FF,0x21FF} +}; + +static MY_UNICASE_INFO plane24[]={ + {0x2400,0x2400,0x2400}, {0x2401,0x2401,0x2401}, + {0x2402,0x2402,0x2402}, {0x2403,0x2403,0x2403}, + {0x2404,0x2404,0x2404}, {0x2405,0x2405,0x2405}, + {0x2406,0x2406,0x2406}, {0x2407,0x2407,0x2407}, + {0x2408,0x2408,0x2408}, {0x2409,0x2409,0x2409}, + {0x240A,0x240A,0x240A}, {0x240B,0x240B,0x240B}, + {0x240C,0x240C,0x240C}, {0x240D,0x240D,0x240D}, + {0x240E,0x240E,0x240E}, {0x240F,0x240F,0x240F}, + {0x2410,0x2410,0x2410}, {0x2411,0x2411,0x2411}, + {0x2412,0x2412,0x2412}, {0x2413,0x2413,0x2413}, + {0x2414,0x2414,0x2414}, {0x2415,0x2415,0x2415}, + {0x2416,0x2416,0x2416}, {0x2417,0x2417,0x2417}, + {0x2418,0x2418,0x2418}, {0x2419,0x2419,0x2419}, + {0x241A,0x241A,0x241A}, {0x241B,0x241B,0x241B}, + {0x241C,0x241C,0x241C}, {0x241D,0x241D,0x241D}, + {0x241E,0x241E,0x241E}, {0x241F,0x241F,0x241F}, + {0x2420,0x2420,0x2420}, {0x2421,0x2421,0x2421}, + {0x2422,0x2422,0x2422}, {0x2423,0x2423,0x2423}, + {0x2424,0x2424,0x2424}, {0x2425,0x2425,0x2425}, + {0x2426,0x2426,0x2426}, {0x2427,0x2427,0x2427}, + {0x2428,0x2428,0x2428}, {0x2429,0x2429,0x2429}, + {0x242A,0x242A,0x242A}, {0x242B,0x242B,0x242B}, + {0x242C,0x242C,0x242C}, {0x242D,0x242D,0x242D}, + {0x242E,0x242E,0x242E}, {0x242F,0x242F,0x242F}, + {0x2430,0x2430,0x2430}, {0x2431,0x2431,0x2431}, + {0x2432,0x2432,0x2432}, {0x2433,0x2433,0x2433}, + {0x2434,0x2434,0x2434}, {0x2435,0x2435,0x2435}, + {0x2436,0x2436,0x2436}, {0x2437,0x2437,0x2437}, + {0x2438,0x2438,0x2438}, {0x2439,0x2439,0x2439}, + {0x243A,0x243A,0x243A}, {0x243B,0x243B,0x243B}, + {0x243C,0x243C,0x243C}, {0x243D,0x243D,0x243D}, + {0x243E,0x243E,0x243E}, {0x243F,0x243F,0x243F}, + {0x2440,0x2440,0x2440}, {0x2441,0x2441,0x2441}, + {0x2442,0x2442,0x2442}, {0x2443,0x2443,0x2443}, + {0x2444,0x2444,0x2444}, {0x2445,0x2445,0x2445}, + {0x2446,0x2446,0x2446}, {0x2447,0x2447,0x2447}, + {0x2448,0x2448,0x2448}, {0x2449,0x2449,0x2449}, + {0x244A,0x244A,0x244A}, {0x244B,0x244B,0x244B}, + {0x244C,0x244C,0x244C}, {0x244D,0x244D,0x244D}, + {0x244E,0x244E,0x244E}, {0x244F,0x244F,0x244F}, + {0x2450,0x2450,0x2450}, {0x2451,0x2451,0x2451}, + {0x2452,0x2452,0x2452}, {0x2453,0x2453,0x2453}, + {0x2454,0x2454,0x2454}, {0x2455,0x2455,0x2455}, + {0x2456,0x2456,0x2456}, {0x2457,0x2457,0x2457}, + {0x2458,0x2458,0x2458}, {0x2459,0x2459,0x2459}, + {0x245A,0x245A,0x245A}, {0x245B,0x245B,0x245B}, + {0x245C,0x245C,0x245C}, {0x245D,0x245D,0x245D}, + {0x245E,0x245E,0x245E}, {0x245F,0x245F,0x245F}, + {0x2460,0x2460,0x2460}, {0x2461,0x2461,0x2461}, + {0x2462,0x2462,0x2462}, {0x2463,0x2463,0x2463}, + {0x2464,0x2464,0x2464}, {0x2465,0x2465,0x2465}, + {0x2466,0x2466,0x2466}, {0x2467,0x2467,0x2467}, + {0x2468,0x2468,0x2468}, {0x2469,0x2469,0x2469}, + {0x246A,0x246A,0x246A}, {0x246B,0x246B,0x246B}, + {0x246C,0x246C,0x246C}, {0x246D,0x246D,0x246D}, + {0x246E,0x246E,0x246E}, {0x246F,0x246F,0x246F}, + {0x2470,0x2470,0x2470}, {0x2471,0x2471,0x2471}, + {0x2472,0x2472,0x2472}, {0x2473,0x2473,0x2473}, + {0x2474,0x2474,0x2474}, {0x2475,0x2475,0x2475}, + {0x2476,0x2476,0x2476}, {0x2477,0x2477,0x2477}, + {0x2478,0x2478,0x2478}, {0x2479,0x2479,0x2479}, + {0x247A,0x247A,0x247A}, {0x247B,0x247B,0x247B}, + {0x247C,0x247C,0x247C}, {0x247D,0x247D,0x247D}, + {0x247E,0x247E,0x247E}, {0x247F,0x247F,0x247F}, + {0x2480,0x2480,0x2480}, {0x2481,0x2481,0x2481}, + {0x2482,0x2482,0x2482}, {0x2483,0x2483,0x2483}, + {0x2484,0x2484,0x2484}, {0x2485,0x2485,0x2485}, + {0x2486,0x2486,0x2486}, {0x2487,0x2487,0x2487}, + {0x2488,0x2488,0x2488}, {0x2489,0x2489,0x2489}, + {0x248A,0x248A,0x248A}, {0x248B,0x248B,0x248B}, + {0x248C,0x248C,0x248C}, {0x248D,0x248D,0x248D}, + {0x248E,0x248E,0x248E}, {0x248F,0x248F,0x248F}, + {0x2490,0x2490,0x2490}, {0x2491,0x2491,0x2491}, + {0x2492,0x2492,0x2492}, {0x2493,0x2493,0x2493}, + {0x2494,0x2494,0x2494}, {0x2495,0x2495,0x2495}, + {0x2496,0x2496,0x2496}, {0x2497,0x2497,0x2497}, + {0x2498,0x2498,0x2498}, {0x2499,0x2499,0x2499}, + {0x249A,0x249A,0x249A}, {0x249B,0x249B,0x249B}, + {0x249C,0x249C,0x249C}, {0x249D,0x249D,0x249D}, + {0x249E,0x249E,0x249E}, {0x249F,0x249F,0x249F}, + {0x24A0,0x24A0,0x24A0}, {0x24A1,0x24A1,0x24A1}, + {0x24A2,0x24A2,0x24A2}, {0x24A3,0x24A3,0x24A3}, + {0x24A4,0x24A4,0x24A4}, {0x24A5,0x24A5,0x24A5}, + {0x24A6,0x24A6,0x24A6}, {0x24A7,0x24A7,0x24A7}, + {0x24A8,0x24A8,0x24A8}, {0x24A9,0x24A9,0x24A9}, + {0x24AA,0x24AA,0x24AA}, {0x24AB,0x24AB,0x24AB}, + {0x24AC,0x24AC,0x24AC}, {0x24AD,0x24AD,0x24AD}, + {0x24AE,0x24AE,0x24AE}, {0x24AF,0x24AF,0x24AF}, + {0x24B0,0x24B0,0x24B0}, {0x24B1,0x24B1,0x24B1}, + {0x24B2,0x24B2,0x24B2}, {0x24B3,0x24B3,0x24B3}, + {0x24B4,0x24B4,0x24B4}, {0x24B5,0x24B5,0x24B5}, + {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, + {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, + {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, + {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, + {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, + {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, + {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, + {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, + {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, + {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, + {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, + {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, + {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, + {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, + {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, + {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, + {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, + {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, + {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, + {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, + {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, + {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, + {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, + {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, + {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, + {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, + {0x24EA,0x24EA,0x24EA}, {0x24EB,0x24EB,0x24EB}, + {0x24EC,0x24EC,0x24EC}, {0x24ED,0x24ED,0x24ED}, + {0x24EE,0x24EE,0x24EE}, {0x24EF,0x24EF,0x24EF}, + {0x24F0,0x24F0,0x24F0}, {0x24F1,0x24F1,0x24F1}, + {0x24F2,0x24F2,0x24F2}, {0x24F3,0x24F3,0x24F3}, + {0x24F4,0x24F4,0x24F4}, {0x24F5,0x24F5,0x24F5}, + {0x24F6,0x24F6,0x24F6}, {0x24F7,0x24F7,0x24F7}, + {0x24F8,0x24F8,0x24F8}, {0x24F9,0x24F9,0x24F9}, + {0x24FA,0x24FA,0x24FA}, {0x24FB,0x24FB,0x24FB}, + {0x24FC,0x24FC,0x24FC}, {0x24FD,0x24FD,0x24FD}, + {0x24FE,0x24FE,0x24FE}, {0x24FF,0x24FF,0x24FF} +}; + +static MY_UNICASE_INFO planeFF[]={ + {0xFF00,0xFF00,0xFF00}, {0xFF01,0xFF01,0xFF01}, + {0xFF02,0xFF02,0xFF02}, {0xFF03,0xFF03,0xFF03}, + {0xFF04,0xFF04,0xFF04}, {0xFF05,0xFF05,0xFF05}, + {0xFF06,0xFF06,0xFF06}, {0xFF07,0xFF07,0xFF07}, + {0xFF08,0xFF08,0xFF08}, {0xFF09,0xFF09,0xFF09}, + {0xFF0A,0xFF0A,0xFF0A}, {0xFF0B,0xFF0B,0xFF0B}, + {0xFF0C,0xFF0C,0xFF0C}, {0xFF0D,0xFF0D,0xFF0D}, + {0xFF0E,0xFF0E,0xFF0E}, {0xFF0F,0xFF0F,0xFF0F}, + {0xFF10,0xFF10,0xFF10}, {0xFF11,0xFF11,0xFF11}, + {0xFF12,0xFF12,0xFF12}, {0xFF13,0xFF13,0xFF13}, + {0xFF14,0xFF14,0xFF14}, {0xFF15,0xFF15,0xFF15}, + {0xFF16,0xFF16,0xFF16}, {0xFF17,0xFF17,0xFF17}, + {0xFF18,0xFF18,0xFF18}, {0xFF19,0xFF19,0xFF19}, + {0xFF1A,0xFF1A,0xFF1A}, {0xFF1B,0xFF1B,0xFF1B}, + {0xFF1C,0xFF1C,0xFF1C}, {0xFF1D,0xFF1D,0xFF1D}, + {0xFF1E,0xFF1E,0xFF1E}, {0xFF1F,0xFF1F,0xFF1F}, + {0xFF20,0xFF20,0xFF20}, {0xFF21,0xFF41,0xFF21}, + {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, + {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, + {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, + {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, + {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, + {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, + {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, + {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, + {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, + {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, + {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, + {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, + {0xFF3A,0xFF5A,0xFF3A}, {0xFF3B,0xFF3B,0xFF3B}, + {0xFF3C,0xFF3C,0xFF3C}, {0xFF3D,0xFF3D,0xFF3D}, + {0xFF3E,0xFF3E,0xFF3E}, {0xFF3F,0xFF3F,0xFF3F}, + {0xFF40,0xFF40,0xFF40}, {0xFF21,0xFF41,0xFF21}, + {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, + {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, + {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, + {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, + {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, + {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, + {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, + {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, + {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, + {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, + {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, + {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, + {0xFF3A,0xFF5A,0xFF3A}, {0xFF5B,0xFF5B,0xFF5B}, + {0xFF5C,0xFF5C,0xFF5C}, {0xFF5D,0xFF5D,0xFF5D}, + {0xFF5E,0xFF5E,0xFF5E}, {0xFF5F,0xFF5F,0xFF5F}, + {0xFF60,0xFF60,0xFF60}, {0xFF61,0xFF61,0xFF61}, + {0xFF62,0xFF62,0xFF62}, {0xFF63,0xFF63,0xFF63}, + {0xFF64,0xFF64,0xFF64}, {0xFF65,0xFF65,0xFF65}, + {0xFF66,0xFF66,0xFF66}, {0xFF67,0xFF67,0xFF67}, + {0xFF68,0xFF68,0xFF68}, {0xFF69,0xFF69,0xFF69}, + {0xFF6A,0xFF6A,0xFF6A}, {0xFF6B,0xFF6B,0xFF6B}, + {0xFF6C,0xFF6C,0xFF6C}, {0xFF6D,0xFF6D,0xFF6D}, + {0xFF6E,0xFF6E,0xFF6E}, {0xFF6F,0xFF6F,0xFF6F}, + {0xFF70,0xFF70,0xFF70}, {0xFF71,0xFF71,0xFF71}, + {0xFF72,0xFF72,0xFF72}, {0xFF73,0xFF73,0xFF73}, + {0xFF74,0xFF74,0xFF74}, {0xFF75,0xFF75,0xFF75}, + {0xFF76,0xFF76,0xFF76}, {0xFF77,0xFF77,0xFF77}, + {0xFF78,0xFF78,0xFF78}, {0xFF79,0xFF79,0xFF79}, + {0xFF7A,0xFF7A,0xFF7A}, {0xFF7B,0xFF7B,0xFF7B}, + {0xFF7C,0xFF7C,0xFF7C}, {0xFF7D,0xFF7D,0xFF7D}, + {0xFF7E,0xFF7E,0xFF7E}, {0xFF7F,0xFF7F,0xFF7F}, + {0xFF80,0xFF80,0xFF80}, {0xFF81,0xFF81,0xFF81}, + {0xFF82,0xFF82,0xFF82}, {0xFF83,0xFF83,0xFF83}, + {0xFF84,0xFF84,0xFF84}, {0xFF85,0xFF85,0xFF85}, + {0xFF86,0xFF86,0xFF86}, {0xFF87,0xFF87,0xFF87}, + {0xFF88,0xFF88,0xFF88}, {0xFF89,0xFF89,0xFF89}, + {0xFF8A,0xFF8A,0xFF8A}, {0xFF8B,0xFF8B,0xFF8B}, + {0xFF8C,0xFF8C,0xFF8C}, {0xFF8D,0xFF8D,0xFF8D}, + {0xFF8E,0xFF8E,0xFF8E}, {0xFF8F,0xFF8F,0xFF8F}, + {0xFF90,0xFF90,0xFF90}, {0xFF91,0xFF91,0xFF91}, + {0xFF92,0xFF92,0xFF92}, {0xFF93,0xFF93,0xFF93}, + {0xFF94,0xFF94,0xFF94}, {0xFF95,0xFF95,0xFF95}, + {0xFF96,0xFF96,0xFF96}, {0xFF97,0xFF97,0xFF97}, + {0xFF98,0xFF98,0xFF98}, {0xFF99,0xFF99,0xFF99}, + {0xFF9A,0xFF9A,0xFF9A}, {0xFF9B,0xFF9B,0xFF9B}, + {0xFF9C,0xFF9C,0xFF9C}, {0xFF9D,0xFF9D,0xFF9D}, + {0xFF9E,0xFF9E,0xFF9E}, {0xFF9F,0xFF9F,0xFF9F}, + {0xFFA0,0xFFA0,0xFFA0}, {0xFFA1,0xFFA1,0xFFA1}, + {0xFFA2,0xFFA2,0xFFA2}, {0xFFA3,0xFFA3,0xFFA3}, + {0xFFA4,0xFFA4,0xFFA4}, {0xFFA5,0xFFA5,0xFFA5}, + {0xFFA6,0xFFA6,0xFFA6}, {0xFFA7,0xFFA7,0xFFA7}, + {0xFFA8,0xFFA8,0xFFA8}, {0xFFA9,0xFFA9,0xFFA9}, + {0xFFAA,0xFFAA,0xFFAA}, {0xFFAB,0xFFAB,0xFFAB}, + {0xFFAC,0xFFAC,0xFFAC}, {0xFFAD,0xFFAD,0xFFAD}, + {0xFFAE,0xFFAE,0xFFAE}, {0xFFAF,0xFFAF,0xFFAF}, + {0xFFB0,0xFFB0,0xFFB0}, {0xFFB1,0xFFB1,0xFFB1}, + {0xFFB2,0xFFB2,0xFFB2}, {0xFFB3,0xFFB3,0xFFB3}, + {0xFFB4,0xFFB4,0xFFB4}, {0xFFB5,0xFFB5,0xFFB5}, + {0xFFB6,0xFFB6,0xFFB6}, {0xFFB7,0xFFB7,0xFFB7}, + {0xFFB8,0xFFB8,0xFFB8}, {0xFFB9,0xFFB9,0xFFB9}, + {0xFFBA,0xFFBA,0xFFBA}, {0xFFBB,0xFFBB,0xFFBB}, + {0xFFBC,0xFFBC,0xFFBC}, {0xFFBD,0xFFBD,0xFFBD}, + {0xFFBE,0xFFBE,0xFFBE}, {0xFFBF,0xFFBF,0xFFBF}, + {0xFFC0,0xFFC0,0xFFC0}, {0xFFC1,0xFFC1,0xFFC1}, + {0xFFC2,0xFFC2,0xFFC2}, {0xFFC3,0xFFC3,0xFFC3}, + {0xFFC4,0xFFC4,0xFFC4}, {0xFFC5,0xFFC5,0xFFC5}, + {0xFFC6,0xFFC6,0xFFC6}, {0xFFC7,0xFFC7,0xFFC7}, + {0xFFC8,0xFFC8,0xFFC8}, {0xFFC9,0xFFC9,0xFFC9}, + {0xFFCA,0xFFCA,0xFFCA}, {0xFFCB,0xFFCB,0xFFCB}, + {0xFFCC,0xFFCC,0xFFCC}, {0xFFCD,0xFFCD,0xFFCD}, + {0xFFCE,0xFFCE,0xFFCE}, {0xFFCF,0xFFCF,0xFFCF}, + {0xFFD0,0xFFD0,0xFFD0}, {0xFFD1,0xFFD1,0xFFD1}, + {0xFFD2,0xFFD2,0xFFD2}, {0xFFD3,0xFFD3,0xFFD3}, + {0xFFD4,0xFFD4,0xFFD4}, {0xFFD5,0xFFD5,0xFFD5}, + {0xFFD6,0xFFD6,0xFFD6}, {0xFFD7,0xFFD7,0xFFD7}, + {0xFFD8,0xFFD8,0xFFD8}, {0xFFD9,0xFFD9,0xFFD9}, + {0xFFDA,0xFFDA,0xFFDA}, {0xFFDB,0xFFDB,0xFFDB}, + {0xFFDC,0xFFDC,0xFFDC}, {0xFFDD,0xFFDD,0xFFDD}, + {0xFFDE,0xFFDE,0xFFDE}, {0xFFDF,0xFFDF,0xFFDF}, + {0xFFE0,0xFFE0,0xFFE0}, {0xFFE1,0xFFE1,0xFFE1}, + {0xFFE2,0xFFE2,0xFFE2}, {0xFFE3,0xFFE3,0xFFE3}, + {0xFFE4,0xFFE4,0xFFE4}, {0xFFE5,0xFFE5,0xFFE5}, + {0xFFE6,0xFFE6,0xFFE6}, {0xFFE7,0xFFE7,0xFFE7}, + {0xFFE8,0xFFE8,0xFFE8}, {0xFFE9,0xFFE9,0xFFE9}, + {0xFFEA,0xFFEA,0xFFEA}, {0xFFEB,0xFFEB,0xFFEB}, + {0xFFEC,0xFFEC,0xFFEC}, {0xFFED,0xFFED,0xFFED}, + {0xFFEE,0xFFEE,0xFFEE}, {0xFFEF,0xFFEF,0xFFEF}, + {0xFFF0,0xFFF0,0xFFF0}, {0xFFF1,0xFFF1,0xFFF1}, + {0xFFF2,0xFFF2,0xFFF2}, {0xFFF3,0xFFF3,0xFFF3}, + {0xFFF4,0xFFF4,0xFFF4}, {0xFFF5,0xFFF5,0xFFF5}, + {0xFFF6,0xFFF6,0xFFF6}, {0xFFF7,0xFFF7,0xFFF7}, + {0xFFF8,0xFFF8,0xFFF8}, {0xFFF9,0xFFF9,0xFFF9}, + {0xFFFA,0xFFFA,0xFFFA}, {0xFFFB,0xFFFB,0xFFFB}, + {0xFFFC,0xFFFC,0xFFFC}, {0xFFFD,0xFFFD,0xFFFD}, + {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF} +}; + +MY_UNICASE_INFO *my_unicase_default[256]={ + plane00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, + NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF + +}; + + +/* + Turkish lower/upper mapping: + 1. LOWER(0x0049 LATIN CAPITAL LETTER I) -> + 0x0131 LATIN SMALL LETTER DOTLESS I + 2. UPPER(0x0069 LATIN SMALL LETTER I) -> + 0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE +*/ + +static MY_UNICASE_INFO turk00[]= +{ + {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, + {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, + {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, + {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, + {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, + {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, + {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, + {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, + {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, + {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, + {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, + {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, + {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, + {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, + {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, + {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, + {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, + {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, + {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, + {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, + {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, + {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, + {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, + {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, + {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, + {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, + {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, + {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, + {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, + {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, + {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, + {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, + {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, + {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, + {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, + {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, + {0x0048,0x0068,0x0048}, {0x0049,0x0131,0x0049}, + {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, + {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, + {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, + {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, + {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, + {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, + {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, + {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, + {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, + {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, + {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, + {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, + {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, + {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, + {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, + {0x0048,0x0068,0x0048}, {0x0130,0x0069,0x0049}, + {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, + {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, + {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, + {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, + {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, + {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, + {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, + {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, + {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, + {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, + {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, + {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, + {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, + {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, + {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, + {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, + {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, + {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, + {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, + {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, + {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, + {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, + {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, + {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, + {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, + {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, + {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, + {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, + {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, + {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, + {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, + {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, + {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, + {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, + {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, + {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, + {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, + {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, + {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, + {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, + {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, + {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, + {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, + {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, + {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, + {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, + {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, + {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, + {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, + {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, + {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, + {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, + {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, + {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, + {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, + {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, + {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, + {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, + {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF}, + {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, + {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, + {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, + {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, + {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, + {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, + {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, + {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, + {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, + {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, + {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, + {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, + {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, + {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, + {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, + {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} +}; + + + +MY_UNICASE_INFO *my_unicase_turkish[256]= +{ + turk00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, + NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF +}; + + + +/** + Compare string against string with wildcard + This function is used for utf8mb3, utf8mb4, ucs2, utf16, utf32 + + @param cs Character set. + @str String. + @str_end End of string. + @wildstr Wildcard pattern. + @wildend End of wildcard pattern. + @escape Escape characters, typically \\. + @w_one "One character", typically _. + @w_many "Many characters", typically %. + + @return Comparison result. + @retval 0 if matched. + @retval -1 if not matched with wildcard. + @retval 1 if matched with wildcard. +*/ + +int my_wildcmp_unicode(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many, + MY_UNICASE_INFO **weights) +{ + int result= -1; /* Not found, using wildcards */ + my_wc_t s_wc, w_wc; + int scan, plane; + int (*mb_wc)(struct charset_info_st *, my_wc_t *, + const uchar *, const uchar *); + mb_wc= cs->cset->mb_wc; + + while (wildstr != wildend) + { + while (1) + { + my_bool escaped= 0; + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + + if (w_wc == (my_wc_t)w_many) + { + result= 1; /* Found an anchor char */ + break; + } + + wildstr+= scan; + if (w_wc == (my_wc_t)escape && wildstr < wildend) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + wildstr+= scan; + escaped= 1; + } + + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, + (const uchar*)str_end)) <= 0) + return 1; + str+= scan; + + if (!escaped && w_wc == (my_wc_t)w_one) + { + result= 1; /* Found an anchor char */ + } + else + { + if (weights) + { + if (s_wc < 0x10000) + { + plane=(s_wc>>8) & 0xFF; + s_wc = weights[plane] ? weights[plane][s_wc & 0xFF].sort : s_wc; + } + if (w_wc < 0x10000) + { + plane=(w_wc>>8) & 0xFF; + w_wc = weights[plane] ? weights[plane][w_wc & 0xFF].sort : w_wc; + } + } + if (s_wc != w_wc) + return 1; /* No match */ + } + if (wildstr == wildend) + return (str != str_end); /* Match if both are at end */ + } + + + if (w_wc == (my_wc_t)w_many) + { /* Found w_many */ + + /* Remove any '%' and '_' from the wild search string */ + for (; wildstr != wildend ;) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + + if (w_wc == (my_wc_t)w_many) + { + wildstr+= scan; + continue; + } + + if (w_wc == (my_wc_t)w_one) + { + wildstr+= scan; + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, + (const uchar*)str_end)) <=0) + return 1; + str+= scan; + continue; + } + break; /* Not a wild character */ + } + + if (wildstr == wildend) + return 0; /* Ok if w_many is last */ + + if (str == str_end) + return -1; + + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <=0) + return 1; + wildstr+= scan; + + if (w_wc == (my_wc_t)escape) + { + if (wildstr < wildend) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <=0) + return 1; + wildstr+= scan; + } + } + + while (1) + { + /* Skip until the first character from wildstr is found */ + while (str != str_end) + { + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, + (const uchar*)str_end)) <=0) + return 1; + if (weights) + { + plane=(s_wc>>8) & 0xFF; + s_wc = weights[plane] ? weights[plane][s_wc & 0xFF].sort : s_wc; + plane=(w_wc>>8) & 0xFF; + w_wc = weights[plane] ? weights[plane][w_wc & 0xFF].sort : w_wc; + } + + if (s_wc == w_wc) + break; + str+= scan; + } + if (str == str_end) + return -1; + + str+= scan; + result= my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, + escape, w_one, w_many, + weights); + if (result <= 0) + return result; + } + } + } + return (str != str_end ? 1 : 0); +} + + +/** + Pad buffer with weights for space characters. + + @details + This functions fills the buffer pointed by "str" + with weights of space character. Not more than + "nweights" weights are put. If at some iteration + step only a half of weight can fit + (which is possible if buffer length is an odd number) + then a half of this weight is put - this gives + a little bit better ORDER BY result for long strings. + + @str Buffer + @strend End of buffer + @nweights Number of weights + + @return Result length +*/ + +static size_t +my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights) +{ + uchar *str0; + DBUG_ASSERT(str && str <= strend); + for (str0= str; str < strend && nweights; nweights--) + { + *str++= 0x00; + if (str < strend) + *str++= 0x20; + } + return str - str0; +} + + +/** + Pad buffer with weights for space characters. + + @details + This functions fills the buffer pointed by "str" + with weights of space character. Putting half of weight + (when buffer length is an odd number) is OK. + + @str Buffer + @strend End of buffer + + @return Result length +*/ + +static size_t +my_strxfrm_pad_unicode(uchar *str, uchar *strend) +{ + uchar *str0= str; + DBUG_ASSERT(str && str <= strend); + for ( ; str < strend ; ) + { + *str++= 0x00; + if (str < strend) + *str++= 0x20; + } + return str - str0; +} + + +#define REPLACEMENT_CHAR 0xFFFD; + + +static inline void +my_tosort_unicode(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256) + { + if (uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].sort; + } + else + { + *wc= REPLACEMENT_CHAR; + } +} + + +size_t +my_strnxfrm_unicode(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, uint nweights, + const uchar *src, size_t srclen, uint flags) +{ + my_wc_t wc; + int res; + uchar *dst0= dst; + uchar *de= dst + dstlen; + const uchar *se= src + srclen; + MY_UNICASE_INFO **uni_plane= (cs->state & MY_CS_BINSORT) ? + NULL : cs->caseinfo; + LINT_INIT(wc); + DBUG_ASSERT(src); + + for (; dst < de && nweights; nweights--) + { + if ((res= cs->cset->mb_wc(cs, &wc, src, se)) <= 0) + break; + src+= res; + + if (uni_plane) + my_tosort_unicode(uni_plane, &wc); + + *dst++= (uchar) (wc >> 8); + if (dst < de) + *dst++= (uchar) (wc & 0xFF); + } + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + dst+= my_strxfrm_pad_nweights_unicode(dst, de, nweights); + + my_strxfrm_desc_and_reverse(dst0, dst, flags, 0); + + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + dst+= my_strxfrm_pad_unicode(dst, de); + return dst - dst0; +} + + + +#endif + + +#ifdef HAVE_CHARSET_utf8mb4 + +/* + We consider bytes with code more than 127 as a letter. + This garantees that word boundaries work fine with regular + expressions. Note, there is no need to mark byte 255 as a + letter, it is illegal byte in UTF8. +*/ +static uchar ctype_utf8mb4[]= +{ + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0 +}; + + +static uchar to_lower_utf8mb4[]= +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + + +static uchar to_upper_utf8mb4[]= +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + + +static inline int +bincmp_utf8mb4(const uchar *s, const uchar *se, + const uchar *t, const uchar *te) +{ + int slen= (int) (se - s), tlen= (int) (te - t); + int len= min(slen, tlen); + int cmp= memcmp(s, t, len); + return cmp ? cmp : slen - tlen; +} + + +static int +my_mb_wc_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t * pwc, const uchar *s, const uchar *e) +{ + uchar c; + + if (s >= e) + return MY_CS_TOOSMALL; + + c= s[0]; + if (c < 0x80) + { + *pwc= c; + return 1; + } + else if (c < 0xc2) + return MY_CS_ILSEQ; + else if (c < 0xe0) + { + if (s + 2 > e) /* We need 2 characters */ + return MY_CS_TOOSMALL2; + + if (!((s[1] ^ 0x80) < 0x40)) + return MY_CS_ILSEQ; + + *pwc= ((my_wc_t) (c & 0x1f) << 6) | (my_wc_t) (s[1] ^ 0x80); + return 2; + } + else if (c < 0xf0) + { + if (s + 3 > e) /* We need 3 characters */ + return MY_CS_TOOSMALL3; + + if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && + (c >= 0xe1 || s[1] >= 0xa0))) + return MY_CS_ILSEQ; + + *pwc= ((my_wc_t) (c & 0x0f) << 12) | + ((my_wc_t) (s[1] ^ 0x80) << 6) | + (my_wc_t) (s[2] ^ 0x80); + return 3; + } + else if (c < 0xf5) + { + if (s + 4 > e) /* We need 4 characters */ + return MY_CS_TOOSMALL4; + + /* + UTF-8 quick four-byte mask: + 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + Encoding allows to encode U+00010000..U+001FFFFF + + The maximum character defined in the Unicode standard is U+0010FFFF. + Higher characters U+00110000..U+001FFFFF are not used. + + 11110000.10010000.10xxxxxx.10xxxxxx == F0.90.80.80 == U+00010000 (min) + 11110100.10001111.10111111.10111111 == F4.8F.BF.BF == U+0010FFFF (max) + + Valid codes: + [F0][90..BF][80..BF][80..BF] + [F1][80..BF][80..BF][80..BF] + [F2][80..BF][80..BF][80..BF] + [F3][80..BF][80..BF][80..BF] + [F4][80..8F][80..BF][80..BF] + */ + + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (s[3] ^ 0x80) < 0x40 && + (c >= 0xf1 || s[1] >= 0x90) && + (c <= 0xf3 || s[1] <= 0x8F))) + return MY_CS_ILSEQ; + *pwc = ((my_wc_t) (c & 0x07) << 18) | + ((my_wc_t) (s[1] ^ 0x80) << 12) | + ((my_wc_t) (s[2] ^ 0x80) << 6) | + (my_wc_t) (s[3] ^ 0x80); + return 4; + } + return MY_CS_ILSEQ; +} + + +/* + The same as above, but without range check + for example, for a null-terminated string +*/ +static int +my_mb_wc_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s) +{ + uchar c; + + c= s[0]; + if (c < 0x80) + { + *pwc = c; + return 1; + } + + if (c < 0xc2) + return MY_CS_ILSEQ; + + if (c < 0xe0) + { + if (!((s[1] ^ 0x80) < 0x40)) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x1f) << 6) | (my_wc_t) (s[1] ^ 0x80); + return 2; + } + + if (c < 0xf0) + { + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (c >= 0xe1 || s[1] >= 0xa0))) + return MY_CS_ILSEQ; + *pwc= ((my_wc_t) (c & 0x0f) << 12) | + ((my_wc_t) (s[1] ^ 0x80) << 6) | + (my_wc_t) (s[2] ^ 0x80); + + return 3; + } + else if (c < 0xf5) + { + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (s[3] ^ 0x80) < 0x40 && + (c >= 0xf1 || s[1] >= 0x90) && + (c <= 0xf3 || s[1] <= 0x8F))) + return MY_CS_ILSEQ; + *pwc = ((my_wc_t) (c & 0x07) << 18) | + ((my_wc_t) (s[1] ^ 0x80) << 12) | + ((my_wc_t) (s[2] ^ 0x80) << 6) | + (my_wc_t) (s[3] ^ 0x80); + return 4; + } + return MY_CS_ILSEQ; +} + + +static int +my_wc_mb_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *r, uchar *e) +{ + int count; + + if (r >= e) + return MY_CS_TOOSMALL; + + if (wc < 0x80) + count= 1; + else if (wc < 0x800) + count= 2; + else if (wc < 0x10000) + count= 3; + else if (wc < 0x200000) + count= 4; + else return MY_CS_ILUNI; + + if (r + count > e) + return MY_CS_TOOSMALLN(count); + + switch (count) { + /* Fall through all cases!!! */ + case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000; + case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800; + case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0; + case 1: r[0] = (uchar) wc; + } + return count; +} + + +/* + The same as above, but without range check. +*/ +static int +my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *r) +{ + int count; + + if (wc < 0x80) + count= 1; + else if (wc < 0x800) + count= 2; + else if (wc < 0x10000) + count= 3; + else if (wc < 0x200000) + count= 4; + else + return MY_CS_ILUNI; + + switch (count) + { + /* Fall through all cases!!! */ + case 4: r[3]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x10000; + case 3: r[2]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x800; + case 2: r[1]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0xc0; + case 1: r[0]= (uchar) wc; + } + return count; +} + + +static inline void +my_tolower_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256 && uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].tolower; +} + + +static inline void +my_toupper_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +{ + int page= *wc >> 8; + if (page < 256 && uni_plane[page]) + *wc= uni_plane[page][*wc & 0xFF].toupper; +} + + +static size_t +my_caseup_utf8mb4(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst, size_t dstlen) +{ + my_wc_t wc; + int srcres, dstres; + char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src != dst || cs->caseup_multiply == 1); + + while ((src < srcend) && + (srcres= my_mb_wc_utf8mb4(cs, &wc, + (uchar *) src, (uchar*) srcend)) > 0) + { + my_toupper_utf8mb4(uni_plane, &wc); + if ((dstres= my_wc_mb_utf8mb4(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + return (size_t) (dst - dst0); +} + + +static inline void +my_hash_add(ulong *n1, ulong *n2, uint ch) +{ + n1[0]^= (((n1[0] & 63) + n2[0]) * (ch)) + (n1[0] << 8); + n2[0]+= 3; +} + + +static void +my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_wc_t wc; + int res; + const uchar *e= s + slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + /* + Remove end space. We do this to be able to compare + 'A ' and 'A' as identical + */ + while (e > s && e[-1] == ' ') + e--; + + while ((res= my_mb_wc_utf8mb4(cs, &wc, (uchar*) s, (uchar*) e)) > 0) + { + my_tosort_unicode(uni_plane, &wc); + my_hash_add(n1, n2, (uint) (wc & 0xFF)); + my_hash_add(n1, n2, (uint) (wc >> 8) & 0xFF); + if (wc > 0xFFFF) + { + /* + Put the highest byte only if it is non-zero, + to make hash functions for utf8mb3 and utf8mb4 + compatible for BMP characters. + This is useful to keep order of records in + test results, e.g. for "SHOW GRANTS". + */ + my_hash_add(n1, n2, (uint) (wc >> 16) & 0xFF); + } + s+= res; + } +} + + +static size_t +my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src) +{ + my_wc_t wc; + int srcres, dstres; + char *dst= src, *dst0= src; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(cs->caseup_multiply == 1); + + while (*src && + (srcres= my_mb_wc_utf8mb4_no_range(cs, &wc, (uchar *) src)) > 0) + { + my_toupper_utf8mb4(uni_plane, &wc); + if ((dstres= my_wc_mb_utf8mb4_no_range(cs, wc, (uchar*) dst)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + *dst= '\0'; + return (size_t) (dst - dst0); +} + + +static size_t +my_casedn_utf8mb4(CHARSET_INFO *cs, + char *src, size_t srclen, + char *dst, size_t dstlen) +{ + my_wc_t wc; + int srcres, dstres; + char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src != dst || cs->casedn_multiply == 1); + + while ((src < srcend) && + (srcres= my_mb_wc_utf8mb4(cs, &wc, + (uchar*) src, (uchar*) srcend)) > 0) + { + my_tolower_utf8mb4(uni_plane, &wc); + if ((dstres= my_wc_mb_utf8mb4(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + return (size_t) (dst - dst0); +} + + +static size_t +my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src) +{ + my_wc_t wc; + int srcres, dstres; + char *dst= src, *dst0= src; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(cs->casedn_multiply == 1); + + while (*src && + (srcres= my_mb_wc_utf8mb4_no_range(cs, &wc, (uchar *) src)) > 0) + { + my_tolower_utf8mb4(uni_plane, &wc); + if ((dstres= my_wc_mb_utf8mb4_no_range(cs, wc, (uchar*) dst)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + + /* + In rare cases lower string can be shorter than + the original string, for example: + + "U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE" + (which is 0xC4B0 in utf8, i.e. two bytes) + + is converted into + + "U+0069 LATIN SMALL LETTER I" + (which is 0x69 in utf8, i.e. one byte) + + So, we need to put '\0' terminator after converting. + */ + + *dst= '\0'; + return (size_t) (dst - dst0); +} + + +static int +my_strnncoll_utf8mb4(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + my_wc_t s_wc,t_wc; + const uchar *se= s + slen; + const uchar *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while ( s < se && t < te ) + { + int s_res= my_mb_wc_utf8mb4(cs, &s_wc, s, se); + int t_res= my_mb_wc_utf8mb4(cs, &t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare bytewise */ + return bincmp_utf8mb4(s, se, t, te); + } + + my_tosort_unicode(uni_plane, &s_wc); + my_tosort_unicode(uni_plane, &t_wc); + + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+= s_res; + t+= t_res; + } + return (int) (t_is_prefix ? (t - te) : ((se - s) - (te - t))); +} + + +/** + Compare strings, discarding end space + + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + @param cs Character set pinter. + @param a First string to compare. + @param a_length Length of 'a'. + @param b Second string to compare. + @param b_length Length of 'b'. + @param diff_if_only_endspace_difference + Set to 1 if the strings should be regarded as different + if they only difference in end space + + @return Comparison result. + @retval Negative number, if a less than b. + @retval 0, if a is equal to b + @retval Positive number, if a > b +*/ + +static int +my_strnncollsp_utf8mb4(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + int res; + my_wc_t s_wc, t_wc; + const uchar *se= s + slen, *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= FALSE; +#endif + + while ( s < se && t < te ) + { + int s_res= my_mb_wc_utf8mb4(cs, &s_wc, s, se); + int t_res= my_mb_wc_utf8mb4(cs, &t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare bytewise */ + return bincmp_utf8mb4(s, se, t, te); + } + + my_tosort_unicode(uni_plane, &s_wc); + my_tosort_unicode(uni_plane, &t_wc); + + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+=s_res; + t+=t_res; + } + + slen= (size_t) (se-s); + tlen= (size_t) (te-t); + res= 0; + + if (slen != tlen) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + if (slen < tlen) + { + slen= tlen; + s= t; + se= te; + swap= -1; + res= -res; + } + /* + This following loop uses the fact that in UTF-8 + all multibyte characters are greater than space, + and all multibyte head characters are greater than + space. It means if we meet a character greater + than space, it always means that the longer string + is greater. So we can reuse the same loop from the + 8bit version, without having to process full multibute + sequences. + */ + for ( ; s < se; s++) + { + if (*s != ' ') + return (*s < ' ') ? -swap : swap; + } + } + return res; +} + + +/** + Compare 0-terminated UTF8 strings. + + @param cs character set handler + @param s First 0-terminated string to compare + @param t Second 0-terminated string to compare + + @return Comparison result. + @retval negative number if s < t + @retval positive number if s > t + @retval 0 is the strings are equal +*/ + +static int +my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) +{ + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + while (s[0] && t[0]) + { + my_wc_t s_wc,t_wc; + + if ((uchar) s[0] < 128) + { + /* + s[0] is between 0 and 127. + It represents a single byte character. + Convert it into weight according to collation. + */ + s_wc= plane00[(uchar) s[0]].tolower; + s++; + } + else + { + int res= my_mb_wc_utf8mb4_no_range(cs, &s_wc, (const uchar*) s); + + /* + In the case of wrong multibyte sequence we will + call strcmp() for byte-to-byte comparison. + */ + if (res <= 0) + return strcmp(s, t); + s+= res; + + my_tolower_utf8mb4(uni_plane, &s_wc); + } + + + /* Do the same for the second string */ + + if ((uchar) t[0] < 128) + { + /* Convert single byte character into weight */ + t_wc= plane00[(uchar) t[0]].tolower; + t++; + } + else + { + int res= my_mb_wc_utf8mb4_no_range(cs, &t_wc, (const uchar*) t); + if (res <= 0) + return strcmp(s, t); + t+= res; + + my_tolower_utf8mb4(uni_plane, &t_wc); + } + + /* Now we have two weights, let's compare them */ + if ( s_wc != t_wc ) + return ((int) s_wc) - ((int) t_wc); + } + return ((int) (uchar) s[0]) - ((int) (uchar) t[0]); +} + + +static int +my_wildcmp_utf8mb4(CHARSET_INFO *cs, + const char *str, const char *strend, + const char *wildstr, const char *wildend, + int escape, int w_one, int w_many) +{ + return my_wildcmp_unicode(cs, str, strend, wildstr, wildend, + escape, w_one, w_many, cs->caseinfo); +} + + +static size_t +my_strnxfrmlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), size_t len) +{ + /* TODO: fix when working on WL "Unicode new version" */ + return (len * 2 + 2) / 4; +} + + +static uint +my_ismbchar_utf8mb4(CHARSET_INFO *cs, const char *b, const char *e) +{ + my_wc_t wc; + int res= my_mb_wc_utf8mb4(cs,&wc, (const uchar*)b, (const uchar*)e); + return (res > 1) ? res : 0; +} + + +static uint +my_mbcharlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), uint c) +{ + if (c < 0x80) + return 1; + if (c < 0xc2) + return 0; /* Illegal mb head */ + if (c < 0xe0) + return 2; + if (c < 0xf0) + return 3; + if (c < 0xf8) + return 4; + return 0; /* Illegal mb head */; +} + + +static MY_COLLATION_HANDLER my_collation_utf8mb4_general_ci_handler= +{ + NULL, /* init */ + my_strnncoll_utf8mb4, + my_strnncollsp_utf8mb4, + my_strnxfrm_unicode, + my_strnxfrmlen_utf8mb4, + my_like_range_mb, + my_wildcmp_utf8mb4, + my_strcasecmp_utf8mb4, + my_instr_mb, + my_hash_sort_utf8mb4, + my_propagate_complex +}; + + +static MY_COLLATION_HANDLER my_collation_utf8mb4_bin_handler = +{ + NULL, /* init */ + my_strnncoll_mb_bin, + my_strnncollsp_mb_bin, + my_strnxfrm_unicode, + my_strnxfrmlen_utf8mb4, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_bin, + my_propagate_simple +}; + + +MY_CHARSET_HANDLER my_charset_utf8mb4_handler= +{ + NULL, /* init */ + my_ismbchar_utf8mb4, + my_mbcharlen_utf8mb4, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_mb, + my_lengthsp_8bit, + my_numcells_mb, + my_mb_wc_utf8mb4, + my_wc_mb_utf8mb4, + my_mb_ctype_mb, + my_caseup_str_utf8mb4, + my_casedn_str_utf8mb4, + my_caseup_utf8mb4, + my_casedn_utf8mb4, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + + +CHARSET_INFO my_charset_utf8mb4_general_ci= +{ + 45,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */ + MY_UTF8MB4, /* cs name */ + MY_UTF8MB4_GENERAL_CI,/* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8mb4, /* ctype */ + to_lower_utf8mb4, /* to_lower */ + to_upper_utf8mb4, /* to_upper */ + to_upper_utf8mb4, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_utf8mb4_general_ci_handler +}; + + +CHARSET_INFO my_charset_utf8mb4_bin= +{ + 46,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, /* state */ + MY_UTF8MB4, /* cs name */ + MY_UTF8MB4_BIN, /* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8mb4, /* ctype */ + to_lower_utf8mb4, /* to_lower */ + to_upper_utf8mb4, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb4_handler, + &my_collation_utf8mb4_bin_handler +}; + +#endif /* HAVE_CHARSET_utf8mb4 */ + + +#ifdef HAVE_CHARSET_utf8mb3 + +/* + We consider bytes with code more than 127 as a letter. + This garantees that word boundaries work fine with regular + expressions. Note, there is no need to mark byte 255 as a + letter, it is illegal byte in UTF8. +*/ +static uchar ctype_utf8[] = { + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0 +}; + +/* The below are taken from usa7 implementation */ + +static uchar to_lower_utf8[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + +static uchar to_upper_utf8[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + +static inline int bincmp(const uchar *s, const uchar *se, + const uchar *t, const uchar *te) +{ + int slen= (int) (se-s), tlen= (int) (te-t); + int len=min(slen,tlen); + int cmp= memcmp(s,t,len); + return cmp ? cmp : slen-tlen; +} + + +static int +my_mb_wc_utf8mb3(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t * pwc, const uchar *s, const uchar *e) +{ + uchar c; + + if (s >= e) + return MY_CS_TOOSMALL; + + c= s[0]; + if (c < 0x80) + { + *pwc = c; + return 1; + } + else if (c < 0xc2) + return MY_CS_ILSEQ; + else if (c < 0xe0) + { + if (s+2 > e) /* We need 2 characters */ + return MY_CS_TOOSMALL2; + + if (!((s[1] ^ 0x80) < 0x40)) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x1f) << 6) | (my_wc_t) (s[1] ^ 0x80); + return 2; + } + else if (c < 0xf0) + { + if (s+3 > e) /* We need 3 characters */ + return MY_CS_TOOSMALL3; + + if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && + (c >= 0xe1 || s[1] >= 0xa0))) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x0f) << 12) | + ((my_wc_t) (s[1] ^ 0x80) << 6) | + (my_wc_t) (s[2] ^ 0x80); + + return 3; + } +#ifdef UNICODE_32BIT + else if (c < 0xf8 && sizeof(my_wc_t)*8 >= 32) + { + if (s+4 > e) /* We need 4 characters */ + return MY_CS_TOOSMALL4; + + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (s[3] ^ 0x80) < 0x40 && + (c >= 0xf1 || s[1] >= 0x90))) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x07) << 18) | + ((my_wc_t) (s[1] ^ 0x80) << 12) | + ((my_wc_t) (s[2] ^ 0x80) << 6) | + (my_wc_t) (s[3] ^ 0x80); + + return 4; + } + else if (c < 0xfc && sizeof(my_wc_t)*8 >= 32) + { + if (s+5 >e) /* We need 5 characters */ + return MY_CS_TOOSMALL5; + + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (s[3] ^ 0x80) < 0x40 && + (s[4] ^ 0x80) < 0x40 && + (c >= 0xf9 || s[1] >= 0x88))) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x03) << 24) | + ((my_wc_t) (s[1] ^ 0x80) << 18) | + ((my_wc_t) (s[2] ^ 0x80) << 12) | + ((my_wc_t) (s[3] ^ 0x80) << 6) | + (my_wc_t) (s[4] ^ 0x80); + return 5; + } + else if (c < 0xfe && sizeof(my_wc_t)*8 >= 32) + { + if ( s+6 >e ) /* We need 6 characters */ + return MY_CS_TOOSMALL6; + + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (s[3] ^ 0x80) < 0x40 && + (s[4] ^ 0x80) < 0x40 && + (s[5] ^ 0x80) < 0x40 && + (c >= 0xfd || s[1] >= 0x84))) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x01) << 30) + | ((my_wc_t) (s[1] ^ 0x80) << 24) + | ((my_wc_t) (s[2] ^ 0x80) << 18) + | ((my_wc_t) (s[3] ^ 0x80) << 12) + | ((my_wc_t) (s[4] ^ 0x80) << 6) + | (my_wc_t) (s[5] ^ 0x80); + return 6; + } +#endif + return MY_CS_ILSEQ; +} + + +/* + The same as above, but without range check + for example, for a null-terminated string +*/ +static int +my_mb_wc_utf8mb3_no_range(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t * pwc, const uchar *s) +{ + uchar c; + + c= s[0]; + if (c < 0x80) + { + *pwc = c; + return 1; + } + + if (c < 0xc2) + return MY_CS_ILSEQ; + + if (c < 0xe0) + { + if (!((s[1] ^ 0x80) < 0x40)) + return MY_CS_ILSEQ; + + *pwc = ((my_wc_t) (c & 0x1f) << 6) | (my_wc_t) (s[1] ^ 0x80); + return 2; + } + + if (c < 0xf0) + { + if (!((s[1] ^ 0x80) < 0x40 && + (s[2] ^ 0x80) < 0x40 && + (c >= 0xe1 || s[1] >= 0xa0))) + return MY_CS_ILSEQ; + + *pwc= ((my_wc_t) (c & 0x0f) << 12) | + ((my_wc_t) (s[1] ^ 0x80) << 6) | + (my_wc_t) (s[2] ^ 0x80); + + return 3; + } + return MY_CS_ILSEQ; +} + + +static int +my_wc_mb_utf8mb3(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *r, uchar *e) +{ + int count; + + if (r >= e) + return MY_CS_TOOSMALL; + + if (wc < 0x80) + count = 1; + else if (wc < 0x800) + count = 2; + else if (wc < 0x10000) + count = 3; +#ifdef UNICODE_32BIT + else if (wc < 0x200000) + count = 4; + else if (wc < 0x4000000) + count = 5; + else if (wc <= 0x7fffffff) + count = 6; +#endif + else return MY_CS_ILUNI; + + /* + e is a character after the string r, not the last character of it. + Because of it (r+count > e), not (r+count-1 >e ) + */ + if ( r+count > e ) + return MY_CS_TOOSMALLN(count); + + switch (count) { + /* Fall through all cases!!! */ +#ifdef UNICODE_32BIT + case 6: r[5] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x4000000; + case 5: r[4] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x200000; + case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000; +#endif + case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800; + case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0; + case 1: r[0] = (uchar) wc; + } + return count; +} + + +/* + The same as above, but without range check. +*/ +static int +my_wc_mb_utf8mb3_no_range(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *r) +{ + int count; + + if (wc < 0x80) + count= 1; + else if (wc < 0x800) + count= 2; + else if (wc < 0x10000) + count= 3; + else + return MY_CS_ILUNI; + + switch (count) + { + /* Fall through all cases!!! */ + case 3: r[2]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x800; + case 2: r[1]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0xc0; + case 1: r[0]= (uchar) wc; + } + return count; +} + + +static size_t +my_caseup_utf8mb3(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst, size_t dstlen) +{ + my_wc_t wc; + int srcres, dstres; + char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src != dst || cs->caseup_multiply == 1); + + while ((src < srcend) && + (srcres= my_mb_wc_utf8mb3(cs, &wc, + (uchar *) src, (uchar*) srcend)) > 0) + { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; + if ((dstres= my_wc_mb_utf8mb3(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + return (size_t) (dst - dst0); +} + + +static void +my_hash_sort_utf8mb3(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *n1, ulong *n2) +{ + my_wc_t wc; + int res; + const uchar *e=s+slen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + /* + Remove end space. We have to do this to be able to compare + 'A ' and 'A' as identical + */ + while (e > s && e[-1] == ' ') + e--; + + while ((s < e) && (res= my_mb_wc_utf8mb3(cs, &wc, + (uchar *)s, (uchar*)e)) > 0) + { + int plane = (wc>>8) & 0xFF; + wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc; + n1[0]^= (((n1[0] & 63)+n2[0])*(wc & 0xFF))+ (n1[0] << 8); + n2[0]+=3; + n1[0]^= (((n1[0] & 63)+n2[0])*(wc >> 8))+ (n1[0] << 8); + n2[0]+=3; + s+=res; + } +} + + +static size_t +my_caseup_str_utf8mb3(CHARSET_INFO *cs, char *src) +{ + my_wc_t wc; + int srcres, dstres; + char *dst= src, *dst0= src; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(cs->caseup_multiply == 1); + + while (*src && + (srcres= my_mb_wc_utf8mb3_no_range(cs, &wc, (uchar *) src)) > 0) + { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc; + if ((dstres= my_wc_mb_utf8mb3_no_range(cs, wc, (uchar*) dst)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + *dst= '\0'; + return (size_t) (dst - dst0); +} + + +static size_t +my_casedn_utf8mb3(CHARSET_INFO *cs, char *src, size_t srclen, + char *dst, size_t dstlen) +{ + my_wc_t wc; + int srcres, dstres; + char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(src != dst || cs->casedn_multiply == 1); + + while ((src < srcend) && + (srcres= my_mb_wc_utf8mb3(cs, &wc, + (uchar*) src, (uchar*)srcend)) > 0) + { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; + if ((dstres= my_wc_mb_utf8mb3(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + return (size_t) (dst - dst0); +} + + +static size_t +my_casedn_str_utf8mb3(CHARSET_INFO *cs, char *src) +{ + my_wc_t wc; + int srcres, dstres; + char *dst= src, *dst0= src; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + DBUG_ASSERT(cs->casedn_multiply == 1); + + while (*src && + (srcres= my_mb_wc_utf8mb3_no_range(cs, &wc, (uchar *) src)) > 0) + { + int plane= (wc>>8) & 0xFF; + wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc; + if ((dstres= my_wc_mb_utf8mb3_no_range(cs, wc, (uchar*) dst)) <= 0) + break; + src+= srcres; + dst+= dstres; + } + + /* + In rare cases lower string can be shorter than + the original string, for example: + + "U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE" + (which is 0xC4B0 in utf8, i.e. two bytes) + + is converted into + + "U+0069 LATIN SMALL LETTER I" + (which is 0x69 in utf8, i.e. one byte) + + So, we need to put '\0' terminator after converting. + */ + + *dst= '\0'; + return (size_t) (dst - dst0); +} + + +static int +my_strnncoll_utf8mb3(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + int s_res,t_res; + my_wc_t s_wc,t_wc; + const uchar *se=s+slen; + const uchar *te=t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + + while ( s < se && t < te ) + { + int plane; + s_res= my_mb_wc_utf8mb3(cs,&s_wc, s, se); + t_res= my_mb_wc_utf8mb3(cs,&t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare bytewise */ + return bincmp(s, se, t, te); + } + + plane=(s_wc>>8) & 0xFF; + s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc; + plane=(t_wc>>8) & 0xFF; + t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc; + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+=s_res; + t+=t_res; + } + return (int) (t_is_prefix ? t-te : ((se-s) - (te-t))); +} + + +/** + Compare strings, discarding end space + + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + @param cs Character set pinter. + @param a First string to compare. + @param a_length Length of 'a'. + @param b Second string to compare. + @param b_length Length of 'b'. + @param diff_if_only_endspace_difference + Set to 1 if the strings should be regarded as different + if they only difference in end space + + @return Comparison result. + @retval Negative number, if a less than b. + @retval 0, if a is equal to b + @retval Positive number, if a > b +*/ + +static int +my_strnncollsp_utf8mb3(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + int s_res, t_res, res; + my_wc_t s_wc,t_wc; + const uchar *se= s+slen, *te= t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + LINT_INIT(s_wc); + LINT_INIT(t_wc); + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= FALSE; +#endif + + while ( s < se && t < te ) + { + int plane; + s_res= my_mb_wc_utf8mb3(cs,&s_wc, s, se); + t_res= my_mb_wc_utf8mb3(cs,&t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare bytewise */ + return bincmp(s, se, t, te); + } + + plane=(s_wc>>8) & 0xFF; + s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc; + plane=(t_wc>>8) & 0xFF; + t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc; + if ( s_wc != t_wc ) + { + return s_wc > t_wc ? 1 : -1; + } + + s+=s_res; + t+=t_res; + } + + slen= (size_t) (se-s); + tlen= (size_t) (te-t); + res= 0; + + if (slen != tlen) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + if (slen < tlen) + { + slen= tlen; + s= t; + se= te; + swap= -1; + res= -res; + } + /* + This following loop uses the fact that in UTF-8 + all multibyte characters are greater than space, + and all multibyte head characters are greater than + space. It means if we meet a character greater + than space, it always means that the longer string + is greater. So we can reuse the same loop from the + 8bit version, without having to process full multibute + sequences. + */ + for ( ; s < se; s++) + { + if (*s != ' ') + return (*s < ' ') ? -swap : swap; + } + } + return res; +} + + +/* + Compare 0-terminated UTF8 strings. + + SYNOPSIS + my_strcasecmp_utf8mb3() + cs character set handler + s First 0-terminated string to compare + t Second 0-terminated string to compare + + IMPLEMENTATION + + RETURN + - negative number if s < t + - positive number if s > t + - 0 is the strings are equal +*/ + +static int +my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t) +{ + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + while (s[0] && t[0]) + { + my_wc_t s_wc,t_wc; + + if ((uchar) s[0] < 128) + { + /* + s[0] is between 0 and 127. + It represents a single byte character. + Convert it into weight according to collation. + */ + s_wc= plane00[(uchar) s[0]].tolower; + s++; + } + else + { + int plane, res; + + /* + Scan a multibyte character. + + In the future it is worth to write a special version of my_utf8_uni() + for 0-terminated strings which will not take in account length. Now + we call the regular version of my_utf8_uni() with s+3 in the + last argument. s+3 is enough to scan any multibyte sequence. + + Calling the regular version of my_utf8_uni is safe for 0-terminated + strings: we will never lose the end of the string: + If we have 0 character in the middle of a multibyte sequence, + then my_utf8_uni will always return a negative number, so the + loop with finish. + */ + + res= my_mb_wc_utf8mb3(cs, &s_wc, (const uchar*)s, (const uchar*) s + 3); + + /* + In the case of wrong multibyte sequence we will + call strcmp() for byte-to-byte comparison. + */ + if (res <= 0) + return strcmp(s, t); + s+= res; + + /* Convert Unicode code into weight according to collation */ + plane=(s_wc>>8) & 0xFF; + s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].tolower : s_wc; + } + + + /* Do the same for the second string */ + + if ((uchar) t[0] < 128) + { + /* Convert single byte character into weight */ + t_wc= plane00[(uchar) t[0]].tolower; + t++; + } + else + { + int plane; + int res= my_mb_wc_utf8mb3(cs, &t_wc, + (const uchar*)t, (const uchar*) t + 3); + if (res <= 0) + return strcmp(s, t); + t+= res; + + /* Convert code into weight */ + plane=(t_wc>>8) & 0xFF; + t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].tolower : t_wc; + } + + /* Now we have two weights, let's compare them */ + if ( s_wc != t_wc ) + return ((int) s_wc) - ((int) t_wc); + } + return ((int)(uchar)s[0]) - ((int) (uchar) t[0]); +} + + +static int +my_wildcmp_utf8mb3(CHARSET_INFO *cs, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many) +{ + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, + escape,w_one,w_many,uni_plane); +} + + +static size_t +my_strnxfrmlen_utf8mb3(CHARSET_INFO *cs __attribute__((unused)), size_t len) +{ + return (len * 2 + 2) / 3; +} + + +static uint +my_ismbchar_utf8mb3(CHARSET_INFO *cs, const char *b, const char *e) +{ + my_wc_t wc; + int res= my_mb_wc_utf8mb3(cs, &wc, (const uchar*) b, (const uchar*) e); + return (res>1) ? res : 0; +} + + +static uint +my_mbcharlen_utf8mb3(CHARSET_INFO *cs __attribute__((unused)), uint c) +{ + if (c < 0x80) + return 1; + else if (c < 0xc2) + return 0; /* Illegal mb head */ + else if (c < 0xe0) + return 2; + else if (c < 0xf0) + return 3; +#ifdef UNICODE_32BIT + else if (c < 0xf8) + return 4; + else if (c < 0xfc) + return 5; + else if (c < 0xfe) + return 6; +#endif + return 0; /* Illegal mb head */; +} + + +static MY_COLLATION_HANDLER my_collation_utf8mb3_general_ci_handler = +{ + NULL, /* init */ + my_strnncoll_utf8mb3, + my_strnncollsp_utf8mb3, + my_strnxfrm_unicode, + my_strnxfrmlen_utf8mb3, + my_like_range_mb, + my_wildcmp_utf8mb3, + my_strcasecmp_utf8mb3, + my_instr_mb, + my_hash_sort_utf8mb3, + my_propagate_complex +}; + + +static MY_COLLATION_HANDLER my_collation_utf8mb3_bin_handler = +{ + NULL, /* init */ + my_strnncoll_mb_bin, + my_strnncollsp_mb_bin, + my_strnxfrm_unicode, + my_strnxfrmlen_utf8mb3, + my_like_range_mb, + my_wildcmp_mb_bin, + my_strcasecmp_mb_bin, + my_instr_mb, + my_hash_sort_mb_bin, + my_propagate_simple +}; + + +MY_CHARSET_HANDLER my_charset_utf8mb3_handler= +{ + NULL, /* init */ + my_ismbchar_utf8mb3, + my_mbcharlen_utf8mb3, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_mb, + my_lengthsp_8bit, + my_numcells_mb, + my_mb_wc_utf8mb3, + my_wc_mb_utf8mb3, + my_mb_ctype_mb, + my_caseup_str_utf8mb3, + my_casedn_str_utf8mb3, + my_caseup_utf8mb3, + my_casedn_utf8mb3, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + + +CHARSET_INFO my_charset_utf8mb3_general_ci= +{ + 33,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */ + MY_UTF8MB3, /* cs name */ + MY_UTF8MB3_GENERAL_CI,/* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8, /* ctype */ + to_lower_utf8, /* to_lower */ + to_upper_utf8, /* to_upper */ + to_upper_utf8, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_utf8mb3_general_ci_handler +}; + + +CHARSET_INFO my_charset_utf8mb3_bin= +{ + 83,0,0, /* number */ + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, /* state */ + MY_UTF8MB3, /* cs name */ + MY_UTF8MB3_BIN, /* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8, /* ctype */ + to_lower_utf8, /* to_lower */ + to_upper_utf8, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_utf8mb3_bin_handler +}; + +#ifdef HAVE_UTF8_GENERAL_CS + +/* + * These functions bacically do the same as their original, except + * that they return 0 only when two comparing unicode strings are + * strictly the same in case-sensitive way. See "save_diff" local + * variable to what they actually do. + */ + +static int +my_strnncoll_utf8mb3_cs(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool t_is_prefix) +{ + int s_res,t_res; + my_wc_t s_wc,t_wc; + const uchar *se=s+slen; + const uchar *te=t+tlen; + int save_diff = 0; + int diff; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + while ( s < se && t < te ) + { + int plane; + s_res= my_mb_wc_utf8mb3(cs, &s_wc, s, se); + t_res= my_mb_wc_utf8mb3(cs, &t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + + { + /* Incorrect string, compare by char value */ + return ((int)s[0]-(int)t[0]); + } + + if ( save_diff == 0 ) + { + save_diff = ((int)s_wc) - ((int)t_wc); + } + plane=(s_wc>>8) & 0xFF; + s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc; + plane=(t_wc>>8) & 0xFF; + t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc; + if ( s_wc != t_wc ) + { + return ((int) s_wc) - ((int) t_wc); + } + + s+=s_res; + t+=t_res; + } + diff = ( (se-s) - (te-t) ); + return t_is_prefix ? t-te : ((diff == 0) ? save_diff : diff); +} + +static int +my_strnncollsp_utf8mb3_cs(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference) +{ + int s_res, t_res, res; + my_wc_t s_wc, t_wc; + const uchar *se= s + slen; + const uchar *te= t + tlen; + int save_diff= 0; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + +#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE + diff_if_only_endspace_difference= FALSE; +#endif + + while ( s < se && t < te ) + { + int plane; + s_res= my_mb_wc_utf8mb3(cs, &s_wc, s, se); + t_res= my_mb_wc_utf8mb3(cs, &t_wc, t, te); + + if ( s_res <= 0 || t_res <= 0 ) + { + /* Incorrect string, compare by char value */ + return ((int)s[0]-(int)t[0]); + } + + if ( save_diff == 0 ) + { + save_diff = ((int)s_wc) - ((int)t_wc); + } + plane=(s_wc>>8) & 0xFF; + s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc; + plane=(t_wc>>8) & 0xFF; + t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc; + if ( s_wc != t_wc ) + { + return ((int) s_wc) - ((int) t_wc); + } + + s+=s_res; + t+=t_res; + } + + slen= se-s; + tlen= te-t; + res= 0; + + if (slen != tlen) + { + int swap= 1; + if (diff_if_only_endspace_difference) + res= 1; /* Assume 'a' is bigger */ + if (slen < tlen) + { + slen= tlen; + s= t; + se= te; + swap= -1; + res= -res; + } + /* + This following loop uses the fact that in UTF-8 + all multibyte characters are greater than space, + and all multibyte head characters are greater than + space. It means if we meet a character greater + than space, it always means that the longer string + is greater. So we can reuse the same loop from the + 8bit version, without having to process full multibute + sequences. + */ + for ( ; s < se; s++) + { + if (*s != (uchar) ' ') + return (*s < (uchar) ' ') ? -swap : swap; + } + } + return save_diff; +} + + +static MY_COLLATION_HANDLER my_collation_utf8mb3_general_cs_handler = +{ + NULL, /* init */ + my_strnncoll_utf8mb3_cs, + my_strnncollsp_utf8mb3_cs, + my_strnxfrm_unicode, + my_strnxfrmlen_utf8mb3, + my_like_range_simple, + my_wildcmp_mb, + my_strcasecmp_utf8mb3, + my_instr_mb, + my_hash_sort_utf8mb3, + my_propagate_simple +}; + + +CHARSET_INFO my_charset_utf8mb3_general_cs= +{ + 254,0,0, /* number */ + MY_CS_COMPILED|MY_CS_UNICODE, /* state */ + MY_UTF8MB3, /* cs name */ + MY_UTF8MB3_GENERAL_CS,/* name */ + "UTF-8 Unicode", /* comment */ + NULL, /* tailoring */ + ctype_utf8, /* ctype */ + to_lower_utf8, /* to_lower */ + to_upper_utf8, /* to_upper */ + to_upper_utf8, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 0, /* min_sort_char */ + 255, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_utf8mb3_handler, + &my_collation_utf8mb3_general_cs_handler +}; +#endif /* Cybozu Hack */ + + +/* + File system encoding components: + +Code range Pattern Number Used Unused Blocks +----------------------------------------------------------------------------- +00C0..017F [.][0..4][g..z] 5*20= 100 97 3 Latin1 Supplement + Ext A +0370..03FF [.][5..9][g..z] 5*20= 100 88 12 Greek + Coptic +0400..052F [.][g..z][0..6] 20*7= 140 140 137 Cyrillic +0530..058F [.][g..z][7..8] 20*2= 40 38 2 Armenian +2160..217F [.][g..z][9] 20*1= 20 16 4 Number Forms +0180..02AF [.][g..z][a..k] 28*11=220 203 17 Latin Ext B + IPA +1E00..0EFF [.][g..z][l..r] 20*7= 140 136 4 Latin Additional Extended +1F00..1FFF [.][g..z][s..z] 20*8= 160 144 16 Greek Extended +.... .... [.][a..f][g..z] 6*20= 120 0 120 RESERVED +24B6..24E9 [.][@][a..z] 26 26 0 Enclosed Alphanumerics +FF21..FF5A [.][a..z][@] 26 26 0 Full Width forms + +All other characters are encoded using five bytes: + +[.][0..9a..z][0..9a..z][0..9a..z][0..9a..z] + +*/ + + +static uint16 touni[5994]= +{ + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00C0, + 0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,0x00C8, + 0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,0x00D0, + 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00E0, + 0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,0x00E8, + 0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,0x00F0, + 0x00F1,0x00F2,0x00F3,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00D4, + 0x00D5,0x00D6,0x0000,0x00D8,0x00D9,0x00DA,0x00DB,0x00DC, + 0x00DD,0x00DE,0x0178,0x0100,0x0102,0x0104,0x0106,0x0108, + 0x010A,0x010C,0x010E,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00F4, + 0x00F5,0x00F6,0x00DF,0x00F8,0x00F9,0x00FA,0x00FB,0x00FC, + 0x00FD,0x00FE,0x00FF,0x0101,0x0103,0x0105,0x0107,0x0109, + 0x010B,0x010D,0x010F,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0110, + 0x0112,0x0114,0x0116,0x0118,0x011A,0x011C,0x011E,0x0120, + 0x0122,0x0124,0x0126,0x0128,0x012A,0x012C,0x012E,0x0000, + 0x0132,0x0134,0x0136,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0111, + 0x0113,0x0115,0x0117,0x0119,0x011B,0x011D,0x011F,0x0121, + 0x0123,0x0125,0x0127,0x0129,0x012B,0x012D,0x012F,0x0131, + 0x0133,0x0135,0x0137,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0139,0x013B,0x013D,0x013F,0x0141,0x0143,0x0145,0x0147, + 0x0000,0x014A,0x014C,0x014E,0x0150,0x0152,0x0154,0x0156, + 0x0158,0x015A,0x015C,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0138, + 0x013A,0x013C,0x013E,0x0140,0x0142,0x0144,0x0146,0x0148, + 0x0149,0x014B,0x014D,0x014F,0x0151,0x0153,0x0155,0x0157, + 0x0159,0x015B,0x015D,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x015E, + 0x0160,0x0162,0x0164,0x0166,0x0168,0x016A,0x016C,0x016E, + 0x0170,0x0172,0x0174,0x0176,0x0179,0x017B,0x017D,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x015F, + 0x0161,0x0163,0x0165,0x0167,0x0169,0x016B,0x016D,0x016F, + 0x0171,0x0173,0x0175,0x0177,0x017A,0x017C,0x017E,0x017F, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0390,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0386, + 0x0388,0x0389,0x038A,0x0000,0x0391,0x0000,0x0393,0x0394, + 0x0395,0x0396,0x0397,0x0000,0x0399,0x0000,0x039B,0x039C, + 0x039D,0x039E,0x039F,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03AC, + 0x03AD,0x03AE,0x03AF,0x03B0,0x03B1,0x03B2,0x03B3,0x03B4, + 0x03B5,0x03B6,0x03B7,0x03B8,0x03B9,0x03BA,0x03BB,0x03BC, + 0x03BD,0x03BE,0x03BF,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x03A1,0x0000,0x0000,0x03A4,0x03A5,0x0000,0x03A7,0x03A8, + 0x03A9,0x03AA,0x03AB,0x038C,0x038E,0x038F,0x0000,0x0392, + 0x0398,0x03D2,0x03D3,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03C0, + 0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8, + 0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000,0x03D0, + 0x03D1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03D4, + 0x03A6,0x03A0,0x0000,0x0000,0x03DA,0x03DC,0x03DE,0x03E0, + 0x03E2,0x03E4,0x03E6,0x03E8,0x03EA,0x03EC,0x03EE,0x039A, + 0x0000,0x03A3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x03D5,0x03D6,0x03D7,0x03D9,0x03DB,0x03DD,0x03DF,0x03E1, + 0x03E3,0x03E5,0x03E7,0x03E9,0x03EB,0x03ED,0x03EF,0x03F0, + 0x03F1,0x03F2,0x03F3,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x03FD,0x03FE,0x03FF,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03F5, + 0x03F6,0x03F8,0x03FB,0x03FC,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x24B6,0x24B7,0x24B8,0x24B9,0x24BA,0x24BB,0x24BC, + 0x24BD,0x24BE,0x24BF,0x24C0,0x24C1,0x24C2,0x24C3,0x24C4, + 0x24C5,0x24C6,0x24C7,0x24C8,0x24C9,0x24CA,0x24CB,0x24CC, + 0x24CD,0x24CE,0x24CF,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x24D0,0x24D1,0x24D2,0x24D3,0x24D4,0x24D5,0x24D6, + 0x24D7,0x24D8,0x24D9,0x24DA,0x24DB,0x24DC,0x24DD,0x24DE, + 0x24DF,0x24E0,0x24E1,0x24E2,0x24E3,0x24E4,0x24E5,0x24E6, + 0x24E7,0x24E8,0x24E9,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF21,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF22,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF23,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF24,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF25,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF26,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0410,0x0424,0x0408,0x0478,0x04A6,0x04CD,0x04F4,0x0000, + 0x0544,0x2160,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF27,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x01B3,0x01DE,0x0208,0x0230,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E00,0x1E28,0x1E50,0x1E78, + 0x1E60,0x1EBE,0x1EE6,0x1F08,0x1F2A,0x0000,0x1F6C,0x1F88, + 0x1FAC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0411,0x0425,0x0409,0x047A,0x04A8,0x0000,0x04F6,0x0531, + 0x0545,0x2161,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF28,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0182,0x01B5,0x01E0,0x020A,0x0232,0x0000,0x0000, + 0x019D,0x0000,0x0000,0x0000,0x1E02,0x1E2A,0x1E52,0x1E7A, + 0x0000,0x1EC0,0x1EE8,0x1F09,0x1F2B,0x0000,0x1F6D,0x1F89, + 0x1FAD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0412,0x0426,0x040A,0x047C,0x04AA,0x04D0,0x04F8,0x0532, + 0x0546,0x2162,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0184,0x01B8,0x01E2,0x020C,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E04,0x1E2C,0x1E54,0x1E7C, + 0x0000,0x1EC2,0x1EEA,0x1F0A,0x1F2C,0x0000,0x1F6E,0x1F8A, + 0x1FAE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0413,0x0427,0x040B,0x047E,0x04AC,0x04D2,0x0000,0x0533, + 0x0547,0x2163,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0187,0x0000,0x01E4,0x020E,0x0000,0x0000,0x0193, + 0x0000,0x01AE,0x0000,0x0000,0x1E06,0x1E2E,0x1E56,0x1E7E, + 0x0000,0x1EC4,0x1EEC,0x1F0B,0x1F2D,0x0000,0x1F6F,0x1F8B, + 0x1FAF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0414,0x0428,0x040C,0x0480,0x04AE,0x04D4,0x0000,0x0534, + 0x0548,0x2164,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x018B,0x0000,0x01E6,0x0210,0x0000,0x0000,0x0000, + 0x019F,0x0000,0x0000,0x0000,0x1E08,0x1E30,0x1E58,0x1E80, + 0x0000,0x1EC6,0x1EEE,0x1F0C,0x1F2E,0x0000,0x1FBA,0x1F8C, + 0x1FB8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0415,0x0429,0x040D,0x0000,0x04B0,0x04D6,0x0000,0x0535, + 0x0549,0x2165,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x01E8,0x0212,0x0000,0x0000,0x0000, + 0x0000,0x01B1,0x0000,0x0000,0x1E0A,0x1E32,0x1E5A,0x1E82, + 0x1EA0,0x1EC8,0x1EF0,0x1F0D,0x1F2F,0x1F59,0x1FBB,0x1F8D, + 0x1FB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0416,0x042A,0x040E,0x048A,0x04B2,0x04D8,0x0000,0x0536, + 0x054A,0x2166,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0191,0x0000,0x01EA,0x0214,0x0000,0x0000,0x0194, + 0x0000,0x01B2,0x0000,0x0000,0x1E0C,0x1E34,0x1E5C,0x1E84, + 0x1EA2,0x1ECA,0x1EF2,0x1F0E,0x1F38,0x0000,0x1FC8,0x1F8E, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0417,0x042B,0x040F,0x048C,0x04B4,0x04DA,0x0000,0x0537, + 0x054B,0x2167,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01F6,0x01BC,0x01EC,0x0216,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E0E,0x1E36,0x1E5E,0x1E86, + 0x1EA4,0x1ECC,0x1EF4,0x1F0F,0x1F39,0x1F5B,0x1FC9,0x1F8F, + 0x1FBC,0x1FE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0418,0x042C,0x0460,0x048E,0x04B6,0x04DC,0x0000,0x0538, + 0x054C,0x2168,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0198,0x01C4,0x01EE,0x0218,0x023A,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E10,0x1E38,0x0000,0x1E88, + 0x1EA6,0x1ECE,0x1EF6,0x1F18,0x1F3A,0x0000,0x1FCA,0x1F98, + 0x0000,0x1FE9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0419,0x042D,0x0462,0x0490,0x04B8,0x04DE,0x0500,0x0539, + 0x054D,0x2169,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x023D,0x01C7,0x0000,0x021A,0x023B,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E12,0x1E3A,0x1E62,0x1E8A, + 0x1EA8,0x1ED0,0x1EF8,0x1F19,0x1F3B,0x1F5D,0x1FCB,0x1F99, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x041A,0x042E,0x0464,0x0492,0x04BA,0x04E0,0x0502,0x053A, + 0x054E,0x216A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x01CA,0x01F1,0x021C,0x023E,0x0181,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E14,0x1E3C,0x1E64,0x1E8C, + 0x1EAA,0x1ED2,0x0000,0x1F1A,0x1F3C,0x0000,0x1FDA,0x1F9A, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x041B,0x042F,0x0466,0x0494,0x04BC,0x04E2,0x0504,0x053B, + 0x054F,0x216B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0220,0x01CD,0x01F4,0x021E,0x0000,0x0186,0x0197, + 0x0000,0x0000,0x0000,0x0000,0x1E16,0x1E3E,0x1E66,0x1E8E, + 0x1EAC,0x1ED4,0x0000,0x1F1B,0x1F3D,0x1F5F,0x1FDB,0x1F9B, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x041C,0x0400,0x0468,0x0496,0x04BE,0x04E4,0x0506,0x053C, + 0x0550,0x216C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A0,0x01CF,0x01F8,0x0000,0x0000,0x0000,0x0196, + 0x0000,0x0000,0x0000,0x0000,0x1E18,0x1E40,0x1E68,0x1E90, + 0x1EAE,0x1ED6,0x0000,0x1F1C,0x1F3E,0x0000,0x1FF8,0x1F9C, + 0x0000,0x1FEC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x041D,0x0401,0x046A,0x0498,0x04C0,0x04E6,0x0508,0x053D, + 0x0551,0x216D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A2,0x01D1,0x01FA,0x0222,0x0000,0x0189,0x0000, + 0x0000,0x01B7,0x0000,0x0000,0x1E1A,0x1E42,0x1E6A,0x1E92, + 0x1EB0,0x1ED8,0x0000,0x1F1D,0x1F3F,0x0000,0x1FF9,0x1F9D, + 0x1FCC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x041E,0x0402,0x046C,0x049A,0x04C1,0x04E8,0x050A,0x053E, + 0x0552,0x216E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF35,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A4,0x01D3,0x01FC,0x0224,0x0000,0x018A,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E1C,0x1E44,0x1E6C,0x1E94, + 0x1EB2,0x1EDA,0x0000,0x0000,0x1F48,0x0000,0x1FEA,0x1F9E, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x041F,0x0403,0x046E,0x049C,0x04C3,0x04EA,0x050C,0x053F, + 0x0553,0x216F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF36,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A7,0x01D5,0x01FE,0x0226,0x0000,0x0000,0x0000, + 0x01A6,0x0241,0x0000,0x0000,0x1E1E,0x1E46,0x1E6E,0x0000, + 0x1EB4,0x1EDC,0x0000,0x0000,0x1F49,0x0000,0x1FEB,0x1F9F, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0420,0x0404,0x0470,0x049E,0x04C5,0x04EC,0x050E,0x0540, + 0x0554,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF37,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x01D7,0x0200,0x0228,0x0000,0x018F,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E20,0x1E48,0x1E70,0x0000, + 0x1EB6,0x1EDE,0x0000,0x0000,0x1F4A,0x1F68,0x1FFA,0x1FA8, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0421,0x0405,0x0472,0x04A0,0x04C7,0x04EE,0x0000,0x0541, + 0x0555,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF38,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x01D9,0x0202,0x022A,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E22,0x1E4A,0x1E72,0x0000, + 0x1EB8,0x1EE0,0x0000,0x0000,0x1F4B,0x1F69,0x1FFB,0x1FA9, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0422,0x0406,0x0474,0x04A2,0x04C9,0x04F0,0x0000,0x0542, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF39,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01AC,0x01DB,0x0204,0x022C,0x0000,0x0190,0x019C, + 0x01A9,0x0000,0x0000,0x0000,0x1E24,0x1E4C,0x1E74,0x0000, + 0x1EBA,0x1EE2,0x0000,0x1F28,0x1F4C,0x1F6A,0x0000,0x1FAA, + 0x1FD8,0x1FFC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0423,0x0407,0x0476,0x04A4,0x04CB,0x04F2,0x0000,0x0543, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF3A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01AF,0x018E,0x0206,0x022E,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x1E26,0x1E4E,0x1E76,0x0000, + 0x1EBC,0x1EE4,0x0000,0x1F29,0x1F4D,0x1F6B,0x0000,0x1FAB, + 0x1FD9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF41,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF42,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF43,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF44,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF45,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF46,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0430,0x0444,0x0458,0x0479,0x04A7,0x04CE,0x04F5,0x0000, + 0x0574,0x2170,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF47,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0180,0x01B4,0x01DF,0x0209,0x0231,0x0000,0x025D, + 0x0271,0x0285,0x0299,0x02AD,0x1E01,0x1E29,0x1E51,0x1E79, + 0x1E9B,0x1EBF,0x1EE7,0x1F00,0x1F22,0x0000,0x1F64,0x1F80, + 0x1FA4,0x1FD2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0431,0x0445,0x0459,0x047B,0x04A9,0x0000,0x04F7,0x0561, + 0x0575,0x2171,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF48,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0183,0x01B6,0x01E1,0x020B,0x0233,0x0000,0x025E, + 0x0272,0x0286,0x029A,0x02AE,0x1E03,0x1E2B,0x1E53,0x1E7B, + 0x0000,0x1EC1,0x1EE9,0x1F01,0x1F23,0x0000,0x1F65,0x1F81, + 0x1FA5,0x1FD3,0x1FF6,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0432,0x0446,0x045A,0x047D,0x04AB,0x04D1,0x04F9,0x0562, + 0x0576,0x2172,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF49,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0185,0x01B9,0x01E3,0x020D,0x0234,0x0000,0x025F, + 0x0273,0x0287,0x029B,0x02AF,0x1E05,0x1E2D,0x1E55,0x1E7D, + 0x0000,0x1EC3,0x1EEB,0x1F02,0x1F24,0x0000,0x1F66,0x1F82, + 0x1FA6,0x0000,0x1FF7,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0433,0x0447,0x045B,0x047F,0x04AD,0x04D3,0x0000,0x0563, + 0x0577,0x2173,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0188,0x01BA,0x01E5,0x020F,0x0235,0x0000,0x0260, + 0x0274,0x0288,0x029C,0x0000,0x1E07,0x1E2F,0x1E57,0x1E7F, + 0x0000,0x1EC5,0x1EED,0x1F03,0x1F25,0x0000,0x1F67,0x1F83, + 0x1FA7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0434,0x0448,0x045C,0x0481,0x04AF,0x04D5,0x0000,0x0564, + 0x0578,0x2174,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF4B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x018C,0x01BB,0x01E7,0x0211,0x0236,0x0000,0x0261, + 0x0275,0x0289,0x029D,0x0000,0x1E09,0x1E31,0x1E59,0x1E81, + 0x0000,0x1EC7,0x1EEF,0x1F04,0x1F26,0x1F50,0x1F70,0x1F84, + 0x1FB0,0x1FD6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0435,0x0449,0x045D,0x0000,0x04B1,0x04D7,0x0000,0x0565, + 0x0579,0x2175,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF4C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x018D,0x0000,0x01E9,0x0213,0x0237,0x0000,0x0262, + 0x0276,0x028A,0x029E,0x0000,0x1E0B,0x1E33,0x1E5B,0x1E83, + 0x1EA1,0x1EC9,0x1EF1,0x1F05,0x1F27,0x1F51,0x1F71,0x1F85, + 0x1FB1,0x1FD7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0436,0x044A,0x045E,0x048B,0x04B3,0x04D9,0x0000,0x0566, + 0x057A,0x2176,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF4D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0192,0x01BE,0x01EB,0x0215,0x0238,0x0000,0x0263, + 0x0277,0x028B,0x029F,0x0000,0x1E0D,0x1E35,0x1E5D,0x1E85, + 0x1EA3,0x1ECB,0x1EF3,0x1F06,0x1F30,0x1F52,0x1F72,0x1F86, + 0x1FB2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0437,0x044B,0x045F,0x048D,0x04B5,0x04DB,0x0000,0x0567, + 0x057B,0x2177,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF4E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0195,0x01BD,0x01ED,0x0217,0x0239,0x0250,0x0264, + 0x0278,0x028C,0x02A0,0x0000,0x1E0F,0x1E37,0x1E5F,0x1E87, + 0x1EA5,0x1ECD,0x1EF5,0x1F07,0x1F31,0x1F53,0x1F73,0x1F87, + 0x1FB3,0x1FE0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0438,0x044C,0x0461,0x048F,0x04B7,0x04DD,0x0000,0x0568, + 0x057C,0x2178,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF4F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0199,0x01C6,0x01EF,0x0219,0x0000,0x0251,0x0265, + 0x0279,0x028D,0x02A1,0x0000,0x1E11,0x1E39,0x1E61,0x1E89, + 0x1EA7,0x1ECF,0x1EF7,0x1F10,0x1F32,0x1F54,0x1F74,0x1F90, + 0x1FB4,0x1FE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0439,0x044D,0x0463,0x0491,0x04B9,0x04DF,0x0501,0x0569, + 0x057D,0x2179,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF50,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x019A,0x01C9,0x01F0,0x021B,0x023C,0x0252,0x0266, + 0x027A,0x028E,0x02A2,0x0000,0x1E13,0x1E3B,0x1E63,0x1E8B, + 0x1EA9,0x1ED1,0x1EF9,0x1F11,0x1F33,0x1F55,0x1F75,0x1F91, + 0x0000,0x1FE2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x043A,0x044E,0x0465,0x0493,0x04BB,0x04E1,0x0503,0x056A, + 0x057E,0x217A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF51,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x019B,0x01CC,0x01F3,0x021D,0x0000,0x0253,0x0267, + 0x027B,0x028F,0x02A3,0x0000,0x1E15,0x1E3D,0x1E65,0x1E8D, + 0x1EAB,0x1ED3,0x0000,0x1F12,0x1F34,0x1F56,0x1F76,0x1F92, + 0x1FB6,0x1FE3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x043B,0x044F,0x0467,0x0495,0x04BD,0x04E3,0x0505,0x056B, + 0x057F,0x217B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF52,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x019E,0x01CE,0x01F5,0x021F,0x023F,0x0254,0x0268, + 0x027C,0x0290,0x02A4,0x0000,0x1E17,0x1E3F,0x1E67,0x1E8F, + 0x1EAD,0x1ED5,0x0000,0x1F13,0x1F35,0x1F57,0x1F77,0x1F93, + 0x1FB7,0x1FE4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x043C,0x0450,0x0469,0x0497,0x04BF,0x04E5,0x0507,0x056C, + 0x0580,0x217C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF53,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A1,0x01D0,0x01F9,0x0221,0x0240,0x0255,0x0269, + 0x027D,0x0291,0x02A5,0x0000,0x1E19,0x1E41,0x1E69,0x1E91, + 0x1EAF,0x1ED7,0x0000,0x1F14,0x1F36,0x0000,0x1F78,0x1F94, + 0x1FC2,0x1FE5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x043D,0x0451,0x046B,0x0499,0x0000,0x04E7,0x0509,0x056D, + 0x0581,0x217D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF54,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A3,0x01D2,0x01FB,0x0223,0x0000,0x0256,0x026A, + 0x027E,0x0292,0x02A6,0x0000,0x1E1B,0x1E43,0x1E6B,0x1E93, + 0x1EB1,0x1ED9,0x0000,0x1F15,0x1F37,0x0000,0x1F79,0x1F95, + 0x1FC3,0x1FE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x043E,0x0452,0x046D,0x049B,0x04C2,0x04E9,0x050B,0x056E, + 0x0582,0x217E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF55,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A5,0x01D4,0x01FD,0x0225,0x0000,0x0257,0x026B, + 0x027F,0x0293,0x02A7,0x0000,0x1E1D,0x1E45,0x1E6D,0x1E95, + 0x1EB3,0x1EDB,0x0000,0x0000,0x1F40,0x0000,0x1F7A,0x1F96, + 0x1FC4,0x1FE7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x043F,0x0453,0x046F,0x049D,0x04C4,0x04EB,0x050D,0x056F, + 0x0583,0x217F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF56,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01A8,0x01D6,0x01FF,0x0227,0x0000,0x0258,0x026C, + 0x0280,0x0294,0x02A8,0x0000,0x1E1F,0x1E47,0x1E6F,0x1E96, + 0x1EB5,0x1EDD,0x0000,0x0000,0x1F41,0x0000,0x1F7B,0x1F97, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0440,0x0454,0x0471,0x049F,0x04C6,0x04ED,0x050F,0x0570, + 0x0584,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01AA,0x01D8,0x0201,0x0229,0x0000,0x0259,0x026D, + 0x0281,0x0295,0x02A9,0x0000,0x1E21,0x1E49,0x1E71,0x1E97, + 0x1EB7,0x1EDF,0x0000,0x0000,0x1F42,0x1F60,0x1F7C,0x1FA0, + 0x1FC6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0441,0x0455,0x0473,0x04A1,0x04C8,0x04EF,0x0000,0x0571, + 0x0585,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF58,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01AB,0x01DA,0x0203,0x022B,0x0000,0x025A,0x026E, + 0x0282,0x0296,0x02AA,0x0000,0x1E23,0x1E4B,0x1E73,0x1E98, + 0x1EB9,0x1EE1,0x0000,0x0000,0x1F43,0x1F61,0x1F7D,0x1FA1, + 0x1FC7,0x1FF2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0442,0x0456,0x0475,0x04A3,0x04CA,0x04F1,0x0000,0x0572, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01AD,0x01DC,0x0205,0x022D,0x0000,0x025B,0x026F, + 0x0283,0x0297,0x02AB,0x0000,0x1E25,0x1E4D,0x1E75,0x1E99, + 0x1EBB,0x1EE3,0x0000,0x1F20,0x1F44,0x1F62,0x0000,0x1FA2, + 0x1FD0,0x1FF3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0443,0x0457,0x0477,0x04A5,0x04CC,0x04F3,0x0000,0x0573, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0xFF5A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x01B0,0x01DD,0x0207,0x022F,0x0000,0x025C,0x0270, + 0x0284,0x0298,0x02AC,0x0000,0x1E27,0x1E4F,0x1E77,0x1E9A, + 0x1EBD,0x1EE5,0x0000,0x1F21,0x1F45,0x1F63,0x0000,0x1FA3, + 0x1FD1,0x1FF4 +}; + + +/* 00C0-05FF */ +static uint16 uni_0C00_05FF[1344]= +{ + 0x0017,0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E, + 0x001F,0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026, + 0x0027,0x0028,0x0029,0x002A,0x0067,0x0068,0x0069,0x0000, + 0x006B,0x006C,0x006D,0x006E,0x006F,0x0070,0x0071,0x008A, + 0x0037,0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E, + 0x003F,0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046, + 0x0047,0x0048,0x0049,0x004A,0x0087,0x0088,0x0089,0x0000, + 0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,0x0092, + 0x0073,0x0093,0x0074,0x0094,0x0075,0x0095,0x0076,0x0096, + 0x0077,0x0097,0x0078,0x0098,0x0079,0x0099,0x007A,0x009A, + 0x00B7,0x00D7,0x00B8,0x00D8,0x00B9,0x00D9,0x00BA,0x00DA, + 0x00BB,0x00DB,0x00BC,0x00DC,0x00BD,0x00DD,0x00BE,0x00DE, + 0x00BF,0x00DF,0x00C0,0x00E0,0x00C1,0x00E1,0x00C2,0x00E2, + 0x00C3,0x00E3,0x00C4,0x00E4,0x00C5,0x00E5,0x00C6,0x00E6, + 0x0000,0x00E7,0x00C8,0x00E8,0x00C9,0x00E9,0x00CA,0x00EA, + 0x0127,0x0108,0x0128,0x0109,0x0129,0x010A,0x012A,0x010B, + 0x012B,0x010C,0x012C,0x010D,0x012D,0x010E,0x012E,0x010F, + 0x012F,0x0130,0x0111,0x0131,0x0112,0x0132,0x0113,0x0133, + 0x0114,0x0134,0x0115,0x0135,0x0116,0x0136,0x0117,0x0137, + 0x0118,0x0138,0x0119,0x0139,0x011A,0x013A,0x0157,0x0177, + 0x0158,0x0178,0x0159,0x0179,0x015A,0x017A,0x015B,0x017B, + 0x015C,0x017C,0x015D,0x017D,0x015E,0x017E,0x015F,0x017F, + 0x0160,0x0180,0x0161,0x0181,0x0162,0x0182,0x0163,0x0183, + 0x0072,0x0164,0x0184,0x0165,0x0185,0x0166,0x0186,0x0187, + 0x1161,0x0A86,0x07B1,0x11B1,0x0801,0x1201,0x0AD6,0x0851, + 0x1251,0x0B76,0x0BC6,0x08A1,0x12A1,0x12F1,0x0D52,0x0C66, + 0x0D06,0x0941,0x1341,0x0857,0x0947,0x1391,0x0B27,0x0AD7, + 0x09E1,0x13E1,0x1431,0x1481,0x0D07,0x07B8,0x14D1,0x08A8, + 0x0B21,0x1521,0x0B71,0x1571,0x0BC1,0x15C1,0x0C18,0x0C11, + 0x1611,0x0D08,0x1661,0x16B1,0x0D01,0x1701,0x0859,0x0D51, + 0x1751,0x08F9,0x0949,0x0762,0x1162,0x07B2,0x11B2,0x0B79, + 0x0802,0x1202,0x1252,0x12A2,0x0992,0x1392,0x1342,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x09E2,0x0000,0x13E2,0x0A32, + 0x0000,0x1432,0x0A82,0x0000,0x1482,0x0AD2,0x14D2,0x0B22, + 0x1522,0x0B72,0x1572,0x0BC2,0x15C2,0x0C12,0x1612,0x0C62, + 0x1662,0x0CB2,0x16B2,0x0D02,0x1702,0x1752,0x0763,0x1163, + 0x07B3,0x11B3,0x0803,0x1203,0x0853,0x1253,0x08A3,0x12A3, + 0x08F3,0x12F3,0x0943,0x1343,0x0993,0x1393,0x09E3,0x13E3, + 0x1433,0x0A83,0x0000,0x1483,0x0AD3,0x14D3,0x0991,0x0000, + 0x0B23,0x1523,0x0B73,0x1573,0x0BC3,0x15C3,0x0C13,0x1613, + 0x0C63,0x1663,0x0CB3,0x16B3,0x0D03,0x1703,0x0D53,0x1753, + 0x0764,0x1164,0x07B4,0x11B4,0x0804,0x1204,0x0854,0x1254, + 0x08A4,0x12A4,0x08F4,0x12F4,0x0944,0x1344,0x0994,0x1394, + 0x09E4,0x13E4,0x0A34,0x1434,0x0A84,0x1484,0x0AD4,0x14D4, + 0x0AD1,0x1524,0x0B74,0x1574,0x0BC4,0x15C4,0x0C14,0x1614, + 0x0C64,0x1664,0x0CB4,0x16B4,0x0D04,0x1704,0x0D54,0x1754, + 0x0765,0x1165,0x07B5,0x11B5,0x1205,0x1255,0x12A5,0x12F5, + 0x1345,0x1395,0x09E5,0x0A35,0x1435,0x0A31,0x0A85,0x14D5, + 0x1525,0x0C19,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x1396,0x13E6,0x1436,0x1486,0x14D6,0x1526,0x1576,0x15C6, + 0x1616,0x1666,0x16B6,0x1706,0x1756,0x1167,0x11B7,0x1207, + 0x1257,0x12A7,0x12F7,0x1347,0x1397,0x13E7,0x1437,0x1487, + 0x14D7,0x1527,0x1577,0x15C7,0x1617,0x1667,0x16B7,0x1707, + 0x1757,0x1168,0x11B8,0x1208,0x1258,0x12A8,0x12F8,0x1348, + 0x1398,0x13E8,0x1438,0x1488,0x14D8,0x1528,0x1578,0x15C8, + 0x1618,0x1668,0x16B8,0x1708,0x1758,0x1169,0x11B9,0x1209, + 0x1259,0x12A9,0x12F9,0x1349,0x1399,0x13E9,0x1439,0x1489, + 0x14D9,0x1529,0x1579,0x15C9,0x1619,0x1669,0x16B9,0x1709, + 0x1759,0x116A,0x11BA,0x120A,0x125A,0x12AA,0x12FA,0x134A, + 0x139A,0x13EA,0x143A,0x148A,0x14DA,0x152A,0x157A,0x15CA, + 0x161A,0x166A,0x16BA,0x170A,0x175A,0x116B,0x11BB,0x120B, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01F7,0x0000, + 0x01F8,0x01F9,0x01FA,0x0000,0x0253,0x0000,0x0254,0x0255, + 0x01D9,0x01FC,0x0257,0x01FE,0x01FF,0x0200,0x0201,0x0202, + 0x0258,0x0204,0x02A7,0x0206,0x0207,0x0208,0x0209,0x020A, + 0x0299,0x0248,0x0000,0x02A9,0x024B,0x024C,0x0298,0x024E, + 0x024F,0x0250,0x0251,0x0252,0x0217,0x0218,0x0219,0x021A, + 0x021B,0x021C,0x021D,0x021E,0x021F,0x0220,0x0221,0x0222, + 0x0223,0x0224,0x0225,0x0226,0x0227,0x0228,0x0229,0x022A, + 0x0267,0x0268,0x0269,0x026A,0x026B,0x026C,0x026D,0x026E, + 0x026F,0x0270,0x0271,0x0272,0x0273,0x0274,0x0275,0x0000, + 0x0277,0x0278,0x0259,0x025A,0x0297,0x02B8,0x02B9,0x02BA, + 0x0000,0x02BB,0x029C,0x02BC,0x029D,0x02BD,0x029E,0x02BE, + 0x029F,0x02BF,0x02A0,0x02C0,0x02A1,0x02C1,0x02A2,0x02C2, + 0x02A3,0x02C3,0x02A4,0x02C4,0x02A5,0x02C5,0x02A6,0x02C6, + 0x02C7,0x02C8,0x02C9,0x02CA,0x0000,0x0307,0x0308,0x0000, + 0x0309,0x0000,0x0000,0x030A,0x030B,0x02EC,0x02ED,0x02EE, + 0x0AF1,0x0B41,0x0B91,0x0BE1,0x0C31,0x0C81,0x0CD1,0x0D21, + 0x0732,0x0782,0x07D2,0x0822,0x0872,0x08C2,0x0912,0x0962, + 0x0730,0x0780,0x07D0,0x0820,0x0870,0x08C0,0x0910,0x0960, + 0x09B0,0x0A00,0x0A50,0x0AA0,0x0AF0,0x0B40,0x0B90,0x0BE0, + 0x0C30,0x0C80,0x0CD0,0x0D20,0x0731,0x0781,0x07D1,0x0821, + 0x0871,0x08C1,0x0911,0x0961,0x09B1,0x0A01,0x0A51,0x0AA1, + 0x1130,0x1180,0x11D0,0x1220,0x1270,0x12C0,0x1310,0x1360, + 0x13B0,0x1400,0x1450,0x14A0,0x14F0,0x1540,0x1590,0x15E0, + 0x1630,0x1680,0x16D0,0x1720,0x1131,0x1181,0x11D1,0x1221, + 0x1271,0x12C1,0x1311,0x1361,0x13B1,0x1401,0x1451,0x14A1, + 0x14F1,0x1541,0x1591,0x15E1,0x1631,0x1681,0x16D1,0x1721, + 0x1132,0x1182,0x11D2,0x1222,0x1272,0x12C2,0x1312,0x1362, + 0x09B2,0x13B2,0x0A02,0x1402,0x0A52,0x1452,0x0AA2,0x14A2, + 0x0AF2,0x14F2,0x0B42,0x1542,0x0B92,0x1592,0x0BE2,0x15E2, + 0x0C32,0x1632,0x0C82,0x1682,0x0CD2,0x16D2,0x0D22,0x1722, + 0x0733,0x1133,0x0783,0x1183,0x07D3,0x11D3,0x0823,0x1223, + 0x0873,0x1273,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0913,0x1313,0x0963,0x1363,0x09B3,0x13B3, + 0x0A03,0x1403,0x0A53,0x1453,0x0AA3,0x14A3,0x0AF3,0x14F3, + 0x0B43,0x1543,0x0B93,0x1593,0x0BE3,0x15E3,0x0C33,0x1633, + 0x0C83,0x1683,0x0CD3,0x16D3,0x0D23,0x1723,0x0734,0x1134, + 0x0784,0x1184,0x07D4,0x11D4,0x0824,0x1224,0x0874,0x1274, + 0x08C4,0x12C4,0x0914,0x1314,0x0964,0x1364,0x09B4,0x13B4, + 0x0A04,0x1404,0x0A54,0x1454,0x0AA4,0x14A4,0x0AF4,0x14F4, + 0x0B44,0x0B94,0x1594,0x0BE4,0x15E4,0x0C34,0x1634,0x0C84, + 0x1684,0x0CD4,0x16D4,0x0D24,0x1724,0x0735,0x1135,0x0000, + 0x07D5,0x11D5,0x0825,0x1225,0x0875,0x1275,0x08C5,0x12C5, + 0x0915,0x1315,0x0965,0x1365,0x09B5,0x13B5,0x0A05,0x1405, + 0x0A55,0x1455,0x0AA5,0x14A5,0x0AF5,0x14F5,0x0B45,0x1545, + 0x0B95,0x1595,0x0BE5,0x15E5,0x0C35,0x1635,0x0C85,0x1685, + 0x0CD5,0x16D5,0x0D25,0x1725,0x0736,0x1136,0x0786,0x1186, + 0x07D6,0x11D6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0A06,0x1406,0x0A56,0x1456,0x0AA6,0x14A6,0x0AF6,0x14F6, + 0x0B46,0x1546,0x0B96,0x1596,0x0BE6,0x15E6,0x0C36,0x1636, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0787,0x07D7,0x0827,0x0877,0x08C7,0x0917,0x0967, + 0x09B7,0x0A07,0x0A57,0x0AA7,0x0AF7,0x0B47,0x0B97,0x0BE7, + 0x0C37,0x0C87,0x0CD7,0x0D27,0x0738,0x0788,0x07D8,0x0828, + 0x0878,0x08C8,0x0918,0x0968,0x09B8,0x0A08,0x0A58,0x0AA8, + 0x0AF8,0x0B48,0x0B98,0x0BE8,0x0C38,0x0C88,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x1187,0x11D7,0x1227,0x1277,0x12C7,0x1317,0x1367, + 0x13B7,0x1407,0x1457,0x14A7,0x14F7,0x1547,0x1597,0x15E7, + 0x1637,0x1687,0x16D7,0x1727,0x1138,0x1188,0x11D8,0x1228, + 0x1278,0x12C8,0x1318,0x1368,0x13B8,0x1408,0x1458,0x14A8, + 0x14F8,0x1548,0x1598,0x15E8,0x1638,0x1688,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + + +/* 1E00-1FFF */ +static uint16 uni_1E00_1FFF[512]= +{ + 0x076C,0x116C,0x07BC,0x11BC,0x080C,0x120C,0x085C,0x125C, + 0x08AC,0x12AC,0x08FC,0x12FC,0x094C,0x134C,0x099C,0x139C, + 0x09EC,0x13EC,0x0A3C,0x143C,0x0A8C,0x148C,0x0ADC,0x14DC, + 0x0B2C,0x152C,0x0B7C,0x157C,0x0BCC,0x15CC,0x0C1C,0x161C, + 0x0C6C,0x166C,0x0CBC,0x16BC,0x0D0C,0x170C,0x0D5C,0x175C, + 0x076D,0x116D,0x07BD,0x11BD,0x080D,0x120D,0x085D,0x125D, + 0x08AD,0x12AD,0x08FD,0x12FD,0x094D,0x134D,0x099D,0x139D, + 0x09ED,0x13ED,0x0A3D,0x143D,0x0A8D,0x148D,0x0ADD,0x14DD, + 0x0B2D,0x152D,0x0B7D,0x157D,0x0BCD,0x15CD,0x0C1D,0x161D, + 0x0C6D,0x166D,0x0CBD,0x16BD,0x0D0D,0x170D,0x0D5D,0x175D, + 0x076E,0x116E,0x07BE,0x11BE,0x080E,0x120E,0x085E,0x125E, + 0x08AE,0x12AE,0x08FE,0x12FE,0x094E,0x134E,0x099E,0x139E, + 0x0770,0x13EE,0x0A3E,0x143E,0x0A8E,0x148E,0x0ADE,0x14DE, + 0x0B2E,0x152E,0x0B7E,0x157E,0x0BCE,0x15CE,0x0C1E,0x161E, + 0x0C6E,0x166E,0x0CBE,0x16BE,0x0D0E,0x170E,0x0D5E,0x175E, + 0x076F,0x116F,0x07BF,0x11BF,0x080F,0x120F,0x085F,0x125F, + 0x08AF,0x12AF,0x08FF,0x12FF,0x094F,0x134F,0x099F,0x139F, + 0x09EF,0x13EF,0x0A3F,0x143F,0x0A8F,0x148F,0x0ADF,0x14DF, + 0x0B2F,0x152F,0x0B7F,0x157F,0x0BCF,0x15CF,0x161F,0x166F, + 0x16BF,0x170F,0x175F,0x1170,0x0000,0x0000,0x0000,0x0000, + 0x0900,0x1300,0x0950,0x1350,0x09A0,0x13A0,0x09F0,0x13F0, + 0x0A40,0x1440,0x0A90,0x1490,0x0AE0,0x14E0,0x0B30,0x1530, + 0x0B80,0x1580,0x0BD0,0x15D0,0x0C20,0x1620,0x0C70,0x1670, + 0x0CC0,0x16C0,0x0D10,0x1710,0x0D60,0x1760,0x0771,0x1171, + 0x07C1,0x11C1,0x0811,0x1211,0x0861,0x1261,0x08B1,0x12B1, + 0x0901,0x1301,0x0951,0x1351,0x09A1,0x13A1,0x09F1,0x13F1, + 0x0A41,0x1441,0x0A91,0x1491,0x0AE1,0x14E1,0x0B31,0x1531, + 0x0B81,0x1581,0x0BD1,0x15D1,0x0C21,0x1621,0x0C71,0x1671, + 0x0CC1,0x16C1,0x0D11,0x1711,0x0D61,0x1761,0x0772,0x1172, + 0x07C2,0x11C2,0x0812,0x1212,0x0862,0x1262,0x08B2,0x12B2, + 0x0902,0x1302,0x0952,0x1352,0x09A2,0x13A2,0x09F2,0x13F2, + 0x0A42,0x1442,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x1173,0x11C3,0x1213,0x1263,0x12B3,0x1303,0x1353,0x13A3, + 0x0773,0x07C3,0x0813,0x0863,0x08B3,0x0903,0x0953,0x09A3, + 0x13F3,0x1443,0x1493,0x14E3,0x1533,0x1583,0x0000,0x0000, + 0x09F3,0x0A43,0x0A93,0x0AE3,0x0B33,0x0B83,0x0000,0x0000, + 0x1713,0x1763,0x1174,0x11C4,0x1214,0x1264,0x12B4,0x1304, + 0x0D13,0x0D63,0x0774,0x07C4,0x0814,0x0864,0x08B4,0x0904, + 0x1354,0x13A4,0x13F4,0x1444,0x1494,0x14E4,0x1534,0x1584, + 0x0954,0x09A4,0x09F4,0x0A44,0x0A94,0x0AE4,0x0B34,0x0B84, + 0x15D4,0x1624,0x1674,0x16C4,0x1714,0x1764,0x0000,0x0000, + 0x0BD4,0x0C24,0x0C74,0x0CC4,0x0D14,0x0D64,0x0000,0x0000, + 0x12B5,0x1305,0x1355,0x13A5,0x13F5,0x1445,0x1495,0x14E5, + 0x0000,0x0905,0x0000,0x09A5,0x0000,0x0A45,0x0000,0x0AE5, + 0x1675,0x16C5,0x1715,0x1765,0x1176,0x11C6,0x1216,0x1266, + 0x0C75,0x0CC5,0x0D15,0x0D65,0x0776,0x07C6,0x0816,0x0866, + 0x12B6,0x1306,0x1356,0x13A6,0x13F6,0x1446,0x1496,0x14E6, + 0x1536,0x1586,0x15D6,0x1626,0x1676,0x16C6,0x0000,0x0000, + 0x1177,0x11C7,0x1217,0x1267,0x12B7,0x1307,0x1357,0x13A7, + 0x0777,0x07C7,0x0817,0x0867,0x08B7,0x0907,0x0957,0x09A7, + 0x13F7,0x1447,0x1497,0x14E7,0x1537,0x1587,0x15D7,0x1627, + 0x09F7,0x0A47,0x0A97,0x0AE7,0x0B37,0x0B87,0x0BD7,0x0C27, + 0x1677,0x16C7,0x1717,0x1767,0x1178,0x11C8,0x1218,0x1268, + 0x0C77,0x0CC7,0x0D17,0x0D67,0x0778,0x07C8,0x0818,0x0868, + 0x12B8,0x1308,0x1358,0x13A8,0x13F8,0x0000,0x1498,0x14E8, + 0x08B8,0x0908,0x08B6,0x0906,0x09A8,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x1538,0x1588,0x15D8,0x0000,0x1678,0x16C8, + 0x0956,0x09A6,0x09F6,0x0A46,0x0B88,0x0000,0x0000,0x0000, + 0x1718,0x1768,0x1179,0x11C9,0x0000,0x0000,0x12B9,0x1309, + 0x0D18,0x0D68,0x0A96,0x0AE6,0x0000,0x0000,0x0000,0x0000, + 0x13A9,0x13F9,0x1449,0x1499,0x14E9,0x1539,0x1589,0x15D9, + 0x09A9,0x09F9,0x0BD6,0x0C26,0x0B39,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x16C9,0x1719,0x0000,0x0000,0x11CA,0x121A, + 0x0B36,0x0B86,0x0C76,0x0CC6,0x0D19,0x0000,0x0000,0x0000 +}; + + +/* 2160-217F */ +static uint16 uni_2160_217F[32]= +{ + 0x0739,0x0789,0x07D9,0x0829,0x0879,0x08C9,0x0919,0x0969, + 0x09B9,0x0A09,0x0A59,0x0AA9,0x0AF9,0x0B49,0x0B99,0x0BE9, + 0x1139,0x1189,0x11D9,0x1229,0x1279,0x12C9,0x1319,0x1369, + 0x13B9,0x1409,0x1459,0x14A9,0x14F9,0x1549,0x1599,0x15E9 +}; + + +/* 24B0-24EF */ +static uint16 uni_24B0_24EF[64]= +{ + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0511,0x0512, + 0x0513,0x0514,0x0515,0x0516,0x0517,0x0518,0x0519,0x051A, + 0x051B,0x051C,0x051D,0x051E,0x051F,0x0520,0x0521,0x0522, + 0x0523,0x0524,0x0525,0x0526,0x0527,0x0528,0x0529,0x052A, + 0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537,0x0538, + 0x0539,0x053A,0x053B,0x053C,0x053D,0x053E,0x053F,0x0540, + 0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547,0x0548, + 0x0549,0x054A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + + +/* FF20-FF5F */ +static uint16 uni_FF20_FF5F[64]= +{ + 0x0000,0x0560,0x05B0,0x0600,0x0650,0x06A0,0x06F0,0x0740, + 0x0790,0x07E0,0x0830,0x0880,0x08D0,0x0920,0x0970,0x09C0, + 0x0A10,0x0A60,0x0AB0,0x0B00,0x0B50,0x0BA0,0x0BF0,0x0C40, + 0x0C90,0x0CE0,0x0D30,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0F60,0x0FB0,0x1000,0x1050,0x10A0,0x10F0,0x1140, + 0x1190,0x11E0,0x1230,0x1280,0x12D0,0x1320,0x1370,0x13C0, + 0x1410,0x1460,0x14B0,0x1500,0x1550,0x15A0,0x15F0,0x1640, + 0x1690,0x16E0,0x1730,0x0000,0x0000,0x0000,0x0000,0x0000 +}; + + + + + +/* + Returns + a number 0..15, if a valid HEX digit in lower case, + -1 otherwise. +*/ + +static int hexlo(int x) +{ + static char hex_lo_digit[256]= + { + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* !"#$%&'()*+,-./ */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, /* 0123456789:;<=>? */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* @ABCDEFGHIJKLMNO */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* PQRSTUVWXYZ[\]^_ */ + -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* `abcdefghijklmno */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* pqrstuvwxyz{|}~. */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ + }; + return hex_lo_digit[(unsigned int) x]; +} + + +/* + Safe characters: + '\0' NULL + A..Z capital letters, + a..z small letters + 0..9 digits + _ underscore +*/ +static char filename_safe_char[128]= +{ + 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* !"#$%&'()*+,-./ */ + 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0123456789:;<=>? */ + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* @ABCDEFGHIJKLMNO */ + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ[\]^_ */ + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* `abcdefghijklmno */ + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz{|}~. */ +}; + +#define MY_FILENAME_ESCAPE '@' + +static int +my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e) +{ + int byte1, byte2; + if (s >= e) + return MY_CS_TOOSMALL; + + if (*s < 128 && filename_safe_char[*s]) + { + *pwc= *s; + return 1; + } + + if (*s != MY_FILENAME_ESCAPE) + return MY_CS_ILSEQ; + + if (s + 3 > e) + return MY_CS_TOOSMALL3; + + byte1= s[1]; + byte2= s[2]; + + if (byte1 >= 0x30 && byte1 <= 0x7F && + byte2 >= 0x30 && byte2 <= 0x7F) + { + int code= (byte1 - 0x30) * 80 + byte2 - 0x30; + if (code < 5994 && touni[code]) + { + *pwc= touni[code]; + return 3; + } + if (byte1 == '@' && byte2 == '@') + { + *pwc= 0; + return 3; + } + } + + if (s + 4 > e) + return MY_CS_TOOSMALL4; + + if ((byte1= hexlo(byte1)) >= 0 && + (byte2= hexlo(byte2)) >= 0) + { + int byte3= hexlo(s[3]); + int byte4= hexlo(s[4]); + if (byte3 >=0 && byte4 >=0) + { + *pwc= (byte1 << 12) + (byte2 << 8) + (byte3 << 4) + byte4; + return 5; + } + } + + return MY_CS_ILSEQ; +} + + +static int +my_wc_mb_filename(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t wc, uchar *s, uchar *e) +{ + int code; + char hex[]= "0123456789abcdef"; + if (wc < 128 && filename_safe_char[wc]) + { + *s= (uchar) wc; + return 1; + } + + if (s + 3 > e) + return MY_CS_TOOSMALL3; + + *s++= MY_FILENAME_ESCAPE; + if ((wc >= 0x00C0 && wc <= 0x05FF && (code= uni_0C00_05FF[wc - 0x00C0])) || + (wc >= 0x1E00 && wc <= 0x1FFF && (code= uni_1E00_1FFF[wc - 0x1E00])) || + (wc >= 0x2160 && wc <= 0x217F && (code= uni_2160_217F[wc - 0x2160])) || + (wc >= 0x24B0 && wc <= 0x24EF && (code= uni_24B0_24EF[wc - 0x24B0])) || + (wc >= 0xFF20 && wc <= 0xFF5F && (code= uni_FF20_FF5F[wc - 0xFF20]))) + { + *s++= (code / 80) + 0x30; + *s++= (code % 80) + 0x30; + return 3; + } + + /* Non letter */ + if (s + 5 > e) + return MY_CS_TOOSMALL5; + + *s++= hex[(wc >> 12) & 15]; + *s++= hex[(wc >> 8) & 15]; + *s++= hex[(wc >> 4) & 15]; + *s++= hex[(wc) & 15]; + return 5; +} + + +static MY_COLLATION_HANDLER my_collation_filename_handler = +{ + NULL, /* init */ + my_strnncoll_utf8mb3, + my_strnncollsp_utf8mb3, + my_strnxfrm_unicode, + my_strnxfrmlen_utf8mb3, + my_like_range_mb, + my_wildcmp_utf8mb3, + my_strcasecmp_utf8mb3, + my_instr_mb, + my_hash_sort_utf8mb3, + my_propagate_complex +}; + + +static MY_CHARSET_HANDLER my_charset_filename_handler= +{ + NULL, /* init */ + my_ismbchar_utf8mb3, + my_mbcharlen_utf8mb3, + my_numchars_mb, + my_charpos_mb, + my_well_formed_len_mb, + my_lengthsp_8bit, + my_numcells_mb, + my_mb_wc_filename, + my_wc_mb_filename, + my_mb_ctype_mb, + my_caseup_str_utf8mb3, + my_casedn_str_utf8mb3, + my_caseup_utf8mb3, + my_casedn_utf8mb3, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit +}; + + + +CHARSET_INFO my_charset_filename= +{ + 17,0,0, /* number */ + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_HIDDEN|MY_CS_NONASCII, + "filename", /* cs name */ + "filename", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_utf8, /* ctype */ + to_lower_utf8, /* to_lower */ + to_upper_utf8, /* to_upper */ + to_upper_utf8, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 1, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 5, /* mbmaxlen */ + 0, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 1, /* levels_for_compare */ + 1, /* levels_for_order */ + &my_charset_filename_handler, + &my_collation_filename_handler +}; + +#ifdef MY_TEST_UTF8 +#include + +static void test_mb(CHARSET_INFO *cs, uchar *s) +{ + while(*s) + { + if (my_ismbhead_utf8(cs,*s)) + { + uint len=my_mbcharlen_utf8(cs,*s); + while(len--) + { + printf("%c",*s); + s++; + } + printf("\n"); + } + else + { + printf("%c\n",*s); + s++; + } + } +} + +int main() +{ + char str[1024]=" utf8 test проба ПЕРРпо-РУССКĐ"; + CHARSET_INFO *cs; + + test_mb(cs,(uchar*)str); + + printf("orig :'%s'\n",str); + + my_caseup_utf8(cs,str,15); + printf("caseup :'%s'\n",str); + + my_caseup_str_utf8(cs,str); + printf("caseup_str:'%s'\n",str); + + my_casedn_utf8(cs,str,15); + printf("casedn :'%s'\n",str); + + my_casedn_str_utf8(cs,str); + printf("casedn_str:'%s'\n",str); + + return 0; +} + +#endif + +#endif /* HAVE_CHARSET_utf8mb3 */ diff --git a/externals/mysql/strings/ctype-win1250ch.c b/externals/mysql/strings/ctype-win1250ch.c new file mode 100644 index 00000000000..f0e4ae74566 --- /dev/null +++ b/externals/mysql/strings/ctype-win1250ch.c @@ -0,0 +1,794 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Shared, independent copyright: (C) 2001 Jan Pazdziora. + + Development of this software was supported by Neocortex, s.r.o. + MySQL AB expresses its gratitude to Jan for for giving us this software. + + Bug reports and suggestions are always welcome. + + This file implements the collating sequence for Windows-1250 + character set. It merely extends the binary sorting of US-ASCII + by adding characters with diacritical marks into proper places. + In addition, it sorts 'ch' between 'h' and 'i', and the sorting + is case sensitive, with uppercase being sorted first, in the + second pass. +*/ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_win1250ch=2 + */ + +#include "my_global.h" +#include "m_string.h" +#include "m_ctype.h" + +#ifdef HAVE_CHARSET_cp1250 + + +static uint16 tab_cp1250_uni[256]={ + 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, +0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, +0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, +0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, +0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, +0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, +0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, +0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, +0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, +0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, +0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, +0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, +0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, +0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, +0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, +0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, +0x20AC, 0,0x201A, 0,0x201E,0x2026,0x2020,0x2021, + 0,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, + 0,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, + 0,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, +0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, +0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, +0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, +0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, +0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, +0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, +0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, +0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, +0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, +0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, +0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, +0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 +}; + + +/* 0000-00FD , 254 chars */ +static uchar tab_uni_cp1250_plane00[]={ +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0xA0,0x00,0x00,0x00,0xA4,0x00,0xA6,0xA7,0xA8,0xA9,0x00,0xAB,0xAC,0xAD,0xAE,0x00, +0xB0,0xB1,0x00,0x00,0xB4,0xB5,0xB6,0xB7,0xB8,0x00,0x00,0xBB,0x00,0x00,0x00,0x00, +0x00,0xC1,0xC2,0x00,0xC4,0x00,0x00,0xC7,0x00,0xC9,0x00,0xCB,0x00,0xCD,0xCE,0x00, +0x00,0x00,0x00,0xD3,0xD4,0x00,0xD6,0xD7,0x00,0x00,0xDA,0x00,0xDC,0xDD,0x00,0xDF, +0x00,0xE1,0xE2,0x00,0xE4,0x00,0x00,0xE7,0x00,0xE9,0x00,0xEB,0x00,0xED,0xEE,0x00, +0x00,0x00,0x00,0xF3,0xF4,0x00,0xF6,0xF7,0x00,0x00,0xFA,0x00,0xFC,0xFD}; + +/* 0102-017E , 125 chars */ +static uchar tab_uni_cp1250_plane01[]={ +0xC3,0xE3,0xA5,0xB9,0xC6,0xE6,0x00,0x00,0x00,0x00,0xC8,0xE8,0xCF,0xEF,0xD0,0xF0, +0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC5,0xE5,0x00,0x00,0xBC,0xBE,0x00,0x00,0xA3, +0xB3,0xD1,0xF1,0x00,0x00,0xD2,0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0xF5, +0x00,0x00,0xC0,0xE0,0x00,0x00,0xD8,0xF8,0x8C,0x9C,0x00,0x00,0xAA,0xBA,0x8A,0x9A, +0xDE,0xFE,0x8D,0x9D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD9,0xF9,0xDB,0xFB, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,0x9F,0xAF,0xBF,0x8E,0x9E}; + +/* 2013-20AC , 154 chars */ +static uchar tab_uni_cp1250_plane20[]={ +0x96,0x97,0x00,0x00,0x00,0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00,0x86,0x87,0x95, +0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80}; + +/* 02C7-02DD , 23 chars */ +static uchar tab_uni_cp1250_plane02[]={ +0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0xA2,0xFF,0x00,0xB2,0x00,0xBD}; + +/* 2122-2122 , 1 chars */ +static uchar tab_uni_cp1250_plane21[]={ +0x99}; + + +static MY_UNI_IDX idx_uni_cp1250[]={ + {0x0000,0x00FD,tab_uni_cp1250_plane00}, + {0x0102,0x017E,tab_uni_cp1250_plane01}, + {0x2013,0x20AC,tab_uni_cp1250_plane20}, + {0x02C7,0x02DD,tab_uni_cp1250_plane02}, + {0x2122,0x2122,tab_uni_cp1250_plane21}, + {0,0,NULL} +}; + + +static uchar NEAR ctype_win1250ch[] = { +0x00, +0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, +0x20, 0x28, 0x28, 0x28, 0x28, 0x28, 0x20, 0x20, +0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, +0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, +0x48, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, +0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, +0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, +0x84, 0x84, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, +0x10, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x10, 0x10, 0x10, 0x10, 0x10, +0x10, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x10, 0x10, 0x10, 0x10, 0x20, +0x20, 0x20, 0x10, 0x20, 0x10, 0x10, 0x10, 0x10, +0x20, 0x10, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, +0x20, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, +0x20, 0x10, 0x02, 0x10, 0x02, 0x02, 0x02, 0x02, +0x48, 0x10, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, +0x10, 0x10, 0x01, 0x10, 0x10, 0x10, 0x10, 0x01, +0x10, 0x10, 0x10, 0x02, 0x10, 0x10, 0x10, 0x10, +0x10, 0x02, 0x02, 0x10, 0x01, 0x10, 0x02, 0x02, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10 +}; + +static uchar NEAR to_lower_win1250ch[] = { +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, +0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, +0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, +0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, +0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, +0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, +0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, +0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, +0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, +0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, +0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, +0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, +0x88, 0x89, 0x9a, 0x8b, 0x9c, 0x9d, 0x9e, 0x9f, +0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, +0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, +0xa0, 0xa1, 0xa2, 0xb3, 0xa4, 0xb9, 0xa6, 0xdf, +0xa8, 0xa9, 0xba, 0xab, 0xac, 0xad, 0xae, 0xbf, +0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, +0xb8, 0xb9, 0xba, 0xbb, 0xbe, 0xbd, 0xbe, 0xbf, +0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, +0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, +0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xd7, +0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, +0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, +0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, +0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, +0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff +}; + +static uchar NEAR to_upper_win1250ch[] = { +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, +0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, +0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, +0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, +0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, +0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, +0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, +0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, +0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, +0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, +0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, +0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, +0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, +0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, +0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, +0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, +0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, +0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, +0x98, 0x99, 0x8a, 0x9b, 0x8c, 0x8d, 0x8e, 0x8f, +0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, +0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, +0xb0, 0xb1, 0xb2, 0xa3, 0xb4, 0xb5, 0xb6, 0xb7, +0xb8, 0xa5, 0xaa, 0xbb, 0xbc, 0xbd, 0xbc, 0xaf, +0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, +0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, +0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, +0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xa7, +0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, +0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, +0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xf7, +0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff +}; + + + +static uchar NEAR sort_order_win1250ch[] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, +16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, +32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, +48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, +80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, +96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, +112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, +128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, +144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, +160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, +176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, +192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, +208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, +224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, +240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 +}; + +static uchar NEAR _sort_order_win1250ch1[] = { +0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, +0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, +0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, +0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, +/* space ord 32 0x20 */ +0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, +0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, +/* 0 ord 48 0x30 */ +0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, +0x9a, 0x9b, + /* colon ord 58 0x3a */ + 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, +0xa2, + /* A ord 65 0x41 */ + 0xa4, 0xa5, + /* C ord 67 0x43 */ + 0xff, 0xa8, 0xa9, 0xaa, 0xab, +0xac, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, +0xb5, 0xb6, + /* R ord 82 0x52 */ + 0xb7, + /* S ord 83 0x53 */ + 0xb9, 0xbc, 0xbd, 0xbe, 0xbf, +0xc0, 0xc1, 0xc2, + /* [ ord 91 0x5b */ + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, +0xc9, + /* a ord 97 0x61 */ + 0xa4, 0xa5, 0xff, 0xa8, 0xa9, 0xaa, 0xab, +0xac, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, +0xb5, 0xb6, 0xb7, 0xb9, 0xbc, 0xbd, 0xbe, 0xbf, +0xc0, 0xc1, 0xc2, + /* { ord 123 0x7b */ + 0xca, 0xcb, 0xcc, 0xcd, 0x81, +0x81, 0x81, 0xce, 0x81, 0xcf, 0xd0, 0xd1, 0xd2, +0x81, 0xd3, + /* Scaron ord 138 0x8a */ + 0xba, 0xd4, 0xb9, 0xbc, 0xc3, 0xc2, +0x81, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, +0x81, 0xdc, 0xba, 0xdd, 0xb9, 0xbc, 0xc3, 0xc2, +/* nobreakspace ord 160 0xa0 */ +0x82, 0xde, 0xdf, 0xb1, 0xe0, 0xa4, 0xe1, 0xe2, +0xe3, 0xe4, 0xb9, 0xe5, 0xe6, 0xe7, 0xe8, 0xc2, +0xe9, 0xea, 0xeb, 0xb1, 0xed, 0xee, 0x81, 0xef, +/* cedilla ord 183 0xb8 */ +0xf0, 0xa4, 0xb9, 0xf1, 0xb1, 0xf2, 0xb1, 0xc2, +0xb7, 0xa4, 0xa4, 0xa4, 0xa4, 0xb1, 0xa6, 0xa6, +0xa7, 0xa9, 0xa9, 0xa9, 0xa9, 0xae, 0xae, 0xa8, +/* Eth ord 208 0xd0 */ +0xa8, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4, 0xb4, 0xf3, +0xb8, 0xbd, 0xbd, 0xbd, 0xbd, 0xc1, 0xbc, 0xbb, +/* racute ord 224 0xe0 */ +0xb7, 0xa4, 0xa4, 0xa4, 0xa4, 0xb1, 0xa6, 0xa6, +0xa7, 0xa9, 0xa9, 0xa9, 0xa9, 0xae, 0xae, 0xa8, +/* eth ord 240 0xf0 */ +0xa8, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4, 0xb4, 0xf4, +0xb8, 0xbd, 0xbd, 0xbd, 0xbd, 0xc1, 0xbc, 0xf5 +}; + +static uchar NEAR _sort_order_win1250ch2[] = { +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, +0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, +0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, +0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, +/* space ord 32 0x20 */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +/* 0 ord 48 0x30 */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, + /* colon ord 58 0x3a */ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, + /* A ord 65 0x41 */ + 0x01, 0x01, + /* C ord 67 0x43 */ + 0xff, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, + /* R ord 82 0x52 */ + 0x01, + /* S ord 83 0x53 */ + 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, + /* [ ord 91 0x5b */ + 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, + /* a ord 97 0x61 */ + 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, + /* { ord 123 0x7b */ + 0x01, 0x01, 0x01, 0x01, 0x22, +0x23, 0x24, 0x01, 0x25, 0x01, 0x01, 0x01, 0x01, +0x26, 0x01, + /* Scaron ord 138 0x8a */ + 0x01, 0x01, 0x03, 0x03, 0x01, 0x05, +0x27, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x28, 0x01, 0x02, 0x01, 0x04, 0x04, 0x02, 0x06, +/* nobreakspace ord 160 0xa0 */ +0x02, 0x01, 0x01, 0x07, 0x01, 0x11, 0x01, 0x01, +0x01, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x03, +0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x29, 0x01, +/* cedilla ord 184 0xb8 */ +0x01, 0x12, 0x06, 0x01, 0x05, 0x01, 0x06, 0x04, +0x03, 0x03, 0x05, 0x07, 0x09, 0x03, 0x03, 0x05, +0x01, 0x03, 0x09, 0x07, 0x05, 0x03, 0x05, 0x03, +/* Eth ord 208 0xd0 */ +0x05, 0x03, 0x05, 0x03, 0x05, 0x09, 0x07, 0x01, +0x01, 0x05, 0x03, 0x09, 0x07, 0x03, 0x05, 0x01, +/* racute ord 224 0xe0 */ +0x04, 0x04, 0x06, 0x08, 0x0a, 0x04, 0x04, 0x06, +0x02, 0x04, 0x0a, 0x08, 0x06, 0x04, 0x06, 0x04, +/* eth ord 240 0xf0 */ +0x06, 0x04, 0x06, 0x04, 0x06, 0x0a, 0x08, 0x01, +0x02, 0x06, 0x04, 0x0a, 0x08, 0x04, 0x06, 0x01 +}; + +struct wordvalue +{ + const uchar * word; + uchar pass1; + uchar pass2; +}; + +static struct wordvalue doubles[]= +{ + { (uchar*) "ch", 0xad, 0x03 }, + { (uchar*) "c", 0xa6, 0x02 }, + { (uchar*) "Ch", 0xad, 0x02 }, + { (uchar*) "CH", 0xad, 0x01 }, + { (uchar*) "C", 0xa6, 0x01 }, +}; + +/* + ml - a flag indicating whether automatically + switch to the secondary level, + or stop on the primary level +*/ + +#define NEXT_CMP_VALUE(src, p, pass, value, len, ml) \ + while (1) \ + { \ + if (IS_END(p, src, len)) \ + { \ + if (pass == 0 && ml && len > 0) \ + { \ + p= src; \ + pass++; \ + } \ + else \ + { \ + value= 0; \ + break; \ + } \ + } \ + value= (pass == 0) ? \ + _sort_order_win1250ch1[*p] : \ + _sort_order_win1250ch2[*p]; \ + if (value == 0xff) \ + { \ + int i; \ + for (i= 0; i < (int) array_elements(doubles); i++) \ + { \ + const uchar *patt= doubles[i].word; \ + const uchar *q= (const uchar *) p; \ + while (*patt && \ + !IS_END(q, src, len) && \ + (*patt == *q)) \ + { \ + patt++; \ + q++; \ + } \ + if (!(*patt)) \ + { \ + value= (int) ((pass == 0) ? \ + doubles[i].pass1 : \ + doubles[i].pass2); \ + p= (const uchar *) q - 1; \ + break; \ + } \ + } \ + } \ + p++; \ + break; \ + } + +#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len)) + +static int my_strnncoll_win1250ch(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s1, size_t len1, + const uchar *s2, size_t len2, + my_bool s2_is_prefix) +{ + int v1, v2; + const uchar *p1, * p2; + int pass1 = 0, pass2 = 0; + int diff; + + if (s2_is_prefix && len1 > len2) + len1=len2; + + p1 = s1; p2 = s2; + + do + { + NEXT_CMP_VALUE(s1, p1, pass1, v1, (int)len1, 1); + NEXT_CMP_VALUE(s2, p2, pass2, v2, (int)len2, 1); + if ((diff = v1 - v2)) + return diff; + } while (v1); + return 0; +} + + +/* + Compare strings, ignore trailing spaces +*/ + +static int +my_strnncollsp_win1250ch(CHARSET_INFO * cs __attribute__((unused)), + const uchar *s, size_t slen, + const uchar *t, size_t tlen, + my_bool diff_if_only_endspace_difference + __attribute__((unused))) +{ + int level; + + for (level= 0; level <= 3; level++) + { + const uchar *s1= s; + const uchar *t1= t; + + for (;;) + { + int sval, tval, diff; + NEXT_CMP_VALUE(s, s1, level, sval, (int) slen, 0); + NEXT_CMP_VALUE(t, t1, level, tval, (int) tlen, 0); + if (!sval) + { + sval= level ? _sort_order_win1250ch2[32] : _sort_order_win1250ch1[32]; + for (; tval;) + { + if ((diff= sval - tval)) + return diff; + NEXT_CMP_VALUE(t, t1, level, tval, (int) tlen, 0); + } + break; + } + else if (!tval) + { + tval= level ? _sort_order_win1250ch2[32] : _sort_order_win1250ch1[32]; + for (; sval;) + { + if ((diff= sval - tval)) + return diff; + NEXT_CMP_VALUE(s, s1, level, sval, (int) slen, 0); + } + break; + } + + if ((diff= sval - tval)) + return diff; + } + } + return 0; +} + + +static size_t +my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), + uchar *dst, size_t dstlen, uint nweights_arg, + const uchar *src, size_t srclen, uint flags) +{ + uint level; + uchar *dst0= dst; + uchar *de= dst + dstlen; + + if (!(flags & 0x03)) /* All levels by default */ + flags|= 0x03; + + for (level= 0; level <= 1; level++) + { + if (flags & (1 << level)) + { + uint nweights= nweights_arg; + const uchar *p= src; + int value; + uchar *dstl= dst; + + for (; dst < de && nweights; nweights--) + { + NEXT_CMP_VALUE(src, p, level, value, (int) srclen, 0); + if (!value) + break; + *dst++= value; + } + + if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) + { + uint pad_length= de - dst; + set_if_smaller(pad_length, nweights); + /* [82.01] - weights for space character */ + bfill(dst, pad_length, (int) (level ? 0x01 : 0x82)); + dst+= pad_length; + } + my_strxfrm_desc_and_reverse(dstl, dst, flags, level); + } + } + if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && dst < de) + { + uint fill_length= de - dst; + cs->cset->fill(cs, (char*) dst, fill_length, 0); + dst= de; + } + return dst - dst0; +} + +#undef IS_END + + +static uchar NEAR like_range_prefix_min_win1250ch[]= +{ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, + 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, + 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +}; + +/* + The letter "C" is a special case: + "CH" is sorted between "H" and "I". + prefix_max for "C" is "I": prefix_max[0x43] == 0x49 + prefix_max for "c" is "i": prefix_max[0x63] == 0x69 + For all other characters: prefix_max[i] == i +*/ + +static uchar NEAR like_range_prefix_max_win1250ch[]= +{ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x49, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x69, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, + 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, + 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +}; + +#define min_sort_char '\x20' +#define max_sort_char '\xff' + +/* +** Calculate min_str and max_str that ranges a LIKE string. +** Arguments: +** ptr Pointer to LIKE string. +** ptr_length Length of LIKE string. +** escape Escape character in LIKE. (Normally '\'). +** All escape characters should be removed from min_str and max_str +** res_length Length of min_str and max_str. +** min_str Smallest case sensitive string that ranges LIKE. +** Should be space padded to res_length. +** max_str Largest case sensitive string that ranges LIKE. +** Normally padded with the biggest character sort value. +** +** The function should return 0 if ok and 1 if the LIKE string can't be +** optimized ! +*/ + +static my_bool +my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)), + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length) +{ + + int only_min_found= 1; + const char *end = ptr + ptr_length; + char *min_org = min_str; + char *min_end = min_str + res_length; + + /* return 1; */ + + for (; ptr != end && min_str != min_end ; ptr++) + { + if (*ptr == escape && ptr+1 != end) + ptr++; /* Skip escape */ + else if (*ptr == w_one || *ptr == w_many) /* '_' or '%' in SQL */ + break; + *min_str= like_range_prefix_min_win1250ch[(uint) (uchar) (*ptr)]; + if (*min_str != min_sort_char) + only_min_found= 0; + min_str++; + *max_str++= like_range_prefix_max_win1250ch[(uint) (uchar) (*ptr)]; + } + + if (cs->state & MY_CS_BINSORT) + *min_length= (size_t) (min_str - min_org); + else + { + /* 'a\0\0... is the smallest possible string */ + *min_length= res_length; + } + /* a\ff\ff... is the biggest possible string */ + *max_length= res_length; + + while (min_str != min_end) + { + *min_str++ = min_sort_char; + *max_str++ = max_sort_char; + } + return (only_min_found); +} + + +static MY_COLLATION_HANDLER my_collation_czech_ci_handler = +{ + NULL, /* init */ + my_strnncoll_win1250ch, + my_strnncollsp_win1250ch, + my_strnxfrm_win1250ch, + my_strnxfrmlen_simple, + my_like_range_win1250ch, + my_wildcmp_8bit, + my_strcasecmp_8bit, + my_instr_simple, + my_hash_sort_simple, + my_propagate_simple +}; + + +CHARSET_INFO my_charset_cp1250_czech_ci = +{ + 34,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ + "cp1250", /* cs name */ + "cp1250_czech_cs", /* name */ + "", /* comment */ + NULL, /* tailoring */ + ctype_win1250ch, + to_lower_win1250ch, + to_upper_win1250ch, + sort_order_win1250ch, + NULL, /* contractions */ + NULL, /* sort_order_big*/ + tab_cp1250_uni, /* tab_to_uni */ + idx_uni_cp1250, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 2, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 1, /* mbmaxlen */ + 0, /* min_sort_char */ + 0, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + 2, /* levels_for_compare */ + 2, /* levels_for_order */ + &my_charset_8bit_handler, + &my_collation_czech_ci_handler +}; + + +#endif /* HAVE_CHARSET_cp1250 */ diff --git a/externals/mysql/strings/ctype.c b/externals/mysql/strings/ctype.c new file mode 100644 index 00000000000..fe66860444a --- /dev/null +++ b/externals/mysql/strings/ctype.c @@ -0,0 +1,430 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#ifndef SCO +#include +#endif + + +/* + + This files implements routines which parse XML based + character set and collation description files. + + Unicode collations are encoded according to + + Unicode Technical Standard #35 + Locale Data Markup Language (LDML) + http://www.unicode.org/reports/tr35/ + + and converted into ICU string according to + + Collation Customization + http://oss.software.ibm.com/icu/userguide/Collate_Customization.html + +*/ + +static char *mstr(char *str,const char *src,uint l1,uint l2) +{ + l1= l1str; s++) + { + if (!strncmp(attr,s->str,len)) + return s; + } + return NULL; +} + +#define MY_CS_CSDESCR_SIZE 64 +#define MY_CS_TAILORING_SIZE 1024 + +typedef struct my_cs_file_info +{ + char csname[MY_CS_NAME_SIZE]; + char name[MY_CS_NAME_SIZE]; + uchar ctype[MY_CS_CTYPE_TABLE_SIZE]; + uchar to_lower[MY_CS_TO_LOWER_TABLE_SIZE]; + uchar to_upper[MY_CS_TO_UPPER_TABLE_SIZE]; + uchar sort_order[MY_CS_SORT_ORDER_TABLE_SIZE]; + uint16 tab_to_uni[MY_CS_TO_UNI_TABLE_SIZE]; + char comment[MY_CS_CSDESCR_SIZE]; + char tailoring[MY_CS_TAILORING_SIZE]; + size_t tailoring_length; + CHARSET_INFO cs; + int (*add_collation)(CHARSET_INFO *cs); +} MY_CHARSET_LOADER; + + + +static int fill_uchar(uchar *a,uint size,const char *str, uint len) +{ + uint i= 0; + const char *s, *b, *e=str+len; + + for (s=str ; s < e ; i++) + { + for ( ; (s < e) && strchr(" \t\r\n",s[0]); s++) ; + b=s; + for ( ; (s < e) && !strchr(" \t\r\n",s[0]); s++) ; + if (s == b || i > size) + break; + a[i]= (uchar) strtoul(b,NULL,16); + } + return 0; +} + +static int fill_uint16(uint16 *a,uint size,const char *str, size_t len) +{ + uint i= 0; + + const char *s, *b, *e=str+len; + for (s=str ; s < e ; i++) + { + for ( ; (s < e) && strchr(" \t\r\n",s[0]); s++) ; + b=s; + for ( ; (s < e) && !strchr(" \t\r\n",s[0]); s++) ; + if (s == b || i > size) + break; + a[i]= (uint16) strtol(b,NULL,16); + } + return 0; +} + + +static int cs_enter(MY_XML_PARSER *st,const char *attr, size_t len) +{ + struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data; + struct my_cs_file_section_st *s= cs_file_sec(attr,len); + + if ( s && (s->state == _CS_CHARSET)) + bzero(&i->cs,sizeof(i->cs)); + + if (s && (s->state == _CS_COLLATION)) + i->tailoring_length= 0; + + return MY_XML_OK; +} + + +static int cs_leave(MY_XML_PARSER *st,const char *attr, size_t len) +{ + struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data; + struct my_cs_file_section_st *s= cs_file_sec(attr,len); + int state= s ? s->state : 0; + int rc; + + switch(state){ + case _CS_COLLATION: + rc= i->add_collation ? i->add_collation(&i->cs) : MY_XML_OK; + break; + default: + rc=MY_XML_OK; + } + return rc; +} + + +static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) +{ + struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data; + struct my_cs_file_section_st *s; + int state= (int)((s=cs_file_sec(st->attr, strlen(st->attr))) ? s->state : + 0); + + switch (state) { + case _CS_ID: + i->cs.number= strtol(attr,(char**)NULL,10); + break; + case _CS_BINARY_ID: + i->cs.binary_number= strtol(attr,(char**)NULL,10); + break; + case _CS_PRIMARY_ID: + i->cs.primary_number= strtol(attr,(char**)NULL,10); + break; + case _CS_COLNAME: + i->cs.name=mstr(i->name,attr,len,MY_CS_NAME_SIZE-1); + break; + case _CS_CSNAME: + i->cs.csname=mstr(i->csname,attr,len,MY_CS_NAME_SIZE-1); + break; + case _CS_CSDESCRIPT: + i->cs.comment=mstr(i->comment,attr,len,MY_CS_CSDESCR_SIZE-1); + break; + case _CS_FLAG: + if (!strncmp("primary",attr,len)) + i->cs.state|= MY_CS_PRIMARY; + else if (!strncmp("binary",attr,len)) + i->cs.state|= MY_CS_BINSORT; + else if (!strncmp("compiled",attr,len)) + i->cs.state|= MY_CS_COMPILED; + break; + case _CS_UPPERMAP: + fill_uchar(i->to_upper,MY_CS_TO_UPPER_TABLE_SIZE,attr,len); + i->cs.to_upper=i->to_upper; + break; + case _CS_LOWERMAP: + fill_uchar(i->to_lower,MY_CS_TO_LOWER_TABLE_SIZE,attr,len); + i->cs.to_lower=i->to_lower; + break; + case _CS_UNIMAP: + fill_uint16(i->tab_to_uni,MY_CS_TO_UNI_TABLE_SIZE,attr,len); + i->cs.tab_to_uni=i->tab_to_uni; + break; + case _CS_COLLMAP: + fill_uchar(i->sort_order,MY_CS_SORT_ORDER_TABLE_SIZE,attr,len); + i->cs.sort_order=i->sort_order; + break; + case _CS_CTYPEMAP: + fill_uchar(i->ctype,MY_CS_CTYPE_TABLE_SIZE,attr,len); + i->cs.ctype=i->ctype; + break; + case _CS_RESET: + case _CS_DIFF1: + case _CS_DIFF2: + case _CS_DIFF3: + case _CS_IDENTICAL: + { + /* + Convert collation description from + Locale Data Markup Language (LDML) + into ICU Collation Customization expression. + */ + char arg[16]; + const char *cmd[]= {"&","<","<<","<<<","="}; + i->cs.tailoring= i->tailoring; + mstr(arg,attr,len,sizeof(arg)-1); + if (i->tailoring_length + 20 < sizeof(i->tailoring)) + { + char *dst= i->tailoring_length + i->tailoring; + i->tailoring_length+= sprintf(dst," %s %s",cmd[state-_CS_RESET],arg); + } + } + } + return MY_XML_OK; +} + + +my_bool my_parse_charset_xml(const char *buf, size_t len, + int (*add_collation)(CHARSET_INFO *cs)) +{ + MY_XML_PARSER p; + struct my_cs_file_info i; + my_bool rc; + + my_xml_parser_create(&p); + my_xml_set_enter_handler(&p,cs_enter); + my_xml_set_value_handler(&p,cs_value); + my_xml_set_leave_handler(&p,cs_leave); + i.add_collation= add_collation; + my_xml_set_user_data(&p,(void*)&i); + rc= (my_xml_parse(&p,buf,len) == MY_XML_OK) ? FALSE : TRUE; + my_xml_parser_free(&p); + return rc; +} + + +/* + Check repertoire: detect pure ascii strings +*/ +uint +my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong length) +{ + const char *strend= str + length; + if (cs->mbminlen == 1) + { + for ( ; str < strend; str++) + { + if (((uchar) *str) > 0x7F) + return MY_REPERTOIRE_UNICODE30; + } + } + else + { + my_wc_t wc; + int chlen; + for (; + (chlen= cs->cset->mb_wc(cs, &wc, (uchar*) str, (uchar*) strend)) > 0; + str+= chlen) + { + if (wc > 0x7F) + return MY_REPERTOIRE_UNICODE30; + } + } + return MY_REPERTOIRE_ASCII; +} + + +/* + Returns repertoire for charset +*/ +uint my_charset_repertoire(CHARSET_INFO *cs) +{ + return cs->state & MY_CS_PUREASCII ? + MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; +} + + +/* + Detect whether a character set is ASCII compatible. + + Returns TRUE for: + + - all 8bit character sets whose Unicode mapping of 0x7B is '{' + (ignores swe7 which maps 0x7B to "LATIN LETTER A WITH DIAERESIS") + + - all multi-byte character sets having mbminlen == 1 + (ignores ucs2 whose mbminlen is 2) + + TODO: + + When merging to 5.2, this function should be changed + to check a new flag MY_CS_NONASCII, + + return (cs->flag & MY_CS_NONASCII) ? 0 : 1; + + This flag was previously added into 5.2 under terms + of WL#3759 "Optimize identifier conversion in client-server protocol" + especially to mark character sets not compatible with ASCII. + + We won't backport this flag to 5.0 or 5.1. + This function is Ok for 5.0 and 5.1, because we're not going + to introduce new tricky character sets between 5.0 and 5.2. +*/ +my_bool +my_charset_is_ascii_based(CHARSET_INFO *cs) +{ + return + (cs->mbmaxlen == 1 && cs->tab_to_uni && cs->tab_to_uni['{'] == '{') || + (cs->mbminlen == 1 && cs->mbmaxlen > 1); +} + + +/* + Detect if a character set is 8bit, + and it is pure ascii, i.e. doesn't have + characters outside U+0000..U+007F + This functions is shared between "conf_to_src" + and dynamic charsets loader in "mysqld". +*/ +my_bool +my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs) +{ + size_t code; + if (!cs->tab_to_uni) + return 0; + for (code= 0; code < 256; code++) + { + if (cs->tab_to_uni[code] > 0x7F) + return 0; + } + return 1; +} + + +/* + Shared function between conf_to_src and mysys. + Check if a 8bit character set is compatible with + ascii on the range 0x00..0x7F. +*/ +my_bool +my_charset_is_ascii_compatible(CHARSET_INFO *cs) +{ + uint i; + if (!cs->tab_to_uni) + return 1; + for (i= 0; i < 128; i++) + { + if (cs->tab_to_uni[i] != i) + return 0; + } + return 1; +} diff --git a/externals/mysql/strings/decimal.c b/externals/mysql/strings/decimal.c new file mode 100644 index 00000000000..df60bac6f13 --- /dev/null +++ b/externals/mysql/strings/decimal.c @@ -0,0 +1,3134 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#line 18 "decimal.c" + +/* +======================================================================= + NOTE: this library implements SQL standard "exact numeric" type + and is not at all generic, but rather intentinally crippled to + follow the standard :) +======================================================================= + Quoting the standard + (SQL:2003, Part 2 Foundations, aka ISO/IEC 9075-2:2003) + +4.4.2 Characteristics of numbers, page 27: + + An exact numeric type has a precision P and a scale S. P is a positive + integer that determines the number of significant digits in a + particular radix R, where R is either 2 or 10. S is a non-negative + integer. Every value of an exact numeric type of scale S is of the + form n*10^{-S}, where n is an integer such that ­-R^P <= n <= R^P. + + [...] + + If an assignment of some number would result in a loss of its most + significant digit, an exception condition is raised. If least + significant digits are lost, implementation-defined rounding or + truncating occurs, with no exception condition being raised. + + [...] + + Whenever an exact or approximate numeric value is assigned to an exact + numeric value site, an approximation of its value that preserves + leading significant digits after rounding or truncating is represented + in the declared type of the target. The value is converted to have the + precision and scale of the target. The choice of whether to truncate + or round is implementation-defined. + + [...] + + All numeric values between the smallest and the largest value, + inclusive, in a given exact numeric type have an approximation + obtained by rounding or truncation for that type; it is + implementation-defined which other numeric values have such + approximations. + +5.3 , page 143 + + ::= + [ [ ] ] + | + +6.1 , page 165: + + 19) The of an shall not be greater than + the of the . + + 20) For the s DECIMAL and NUMERIC: + + a) The maximum value of is implementation-defined. + shall not be greater than this value. + b) The maximum value of is implementation-defined. + shall not be greater than this maximum value. + + 21) NUMERIC specifies the data type exact numeric, with the decimal + precision and scale specified by the and . + + 22) DECIMAL specifies the data type exact numeric, with the decimal + scale specified by the and the implementation-defined + decimal precision equal to or greater than the value of the + specified . + +6.26 , page 241: + + 1) If the declared type of both operands of a dyadic arithmetic + operator is exact numeric, then the declared type of the result is + an implementation-defined exact numeric type, with precision and + scale determined as follows: + + a) Let S1 and S2 be the scale of the first and second operands + respectively. + b) The precision of the result of addition and subtraction is + implementation-defined, and the scale is the maximum of S1 and S2. + c) The precision of the result of multiplication is + implementation-defined, and the scale is S1 + S2. + d) The precision and scale of the result of division are + implementation-defined. +*/ + +#include +#include +#include +#include /* for my_alloca */ +#include +#include + +/* + Internally decimal numbers are stored base 10^9 (see DIG_BASE below) + So one variable of type decimal_digit_t is limited: + + 0 < decimal_digit <= DIG_MAX < DIG_BASE + + in the struct st_decimal_t: + + intg is the number of *decimal* digits (NOT number of decimal_digit_t's !) + before the point + frac - number of decimal digits after the point + buf is an array of decimal_digit_t's + len is the length of buf (length of allocated space) in decimal_digit_t's, + not in bytes +*/ +typedef decimal_digit_t dec1; +typedef longlong dec2; + +#define DIG_PER_DEC1 9 +#define DIG_MASK 100000000 +#define DIG_BASE 1000000000 +#define DIG_MAX (DIG_BASE-1) +#define DIG_BASE2 ((dec2)DIG_BASE * (dec2)DIG_BASE) +#define ROUND_UP(X) (((X)+DIG_PER_DEC1-1)/DIG_PER_DEC1) +static const dec1 powers10[DIG_PER_DEC1+1]={ + 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}; +static const int dig2bytes[DIG_PER_DEC1+1]={0, 1, 1, 2, 2, 3, 3, 4, 4, 4}; +static const dec1 frac_max[DIG_PER_DEC1-1]={ + 900000000, 990000000, 999000000, + 999900000, 999990000, 999999000, + 999999900, 999999990 }; + +#ifdef HAVE_purify +#define sanity(d) DBUG_ASSERT((d)->len > 0) +#else +#define sanity(d) DBUG_ASSERT((d)->len >0 && ((d)->buf[0] | \ + (d)->buf[(d)->len-1] | 1)) +#endif + +#define FIX_INTG_FRAC_ERROR(len, intg1, frac1, error) \ + do \ + { \ + if (unlikely(intg1+frac1 > (len))) \ + { \ + if (unlikely(intg1 > (len))) \ + { \ + intg1=(len); \ + frac1=0; \ + error=E_DEC_OVERFLOW; \ + } \ + else \ + { \ + frac1=(len)-intg1; \ + error=E_DEC_TRUNCATED; \ + } \ + } \ + else \ + error=E_DEC_OK; \ + } while(0) + +#define ADD(to, from1, from2, carry) /* assume carry <= 1 */ \ + do \ + { \ + dec1 a=(from1)+(from2)+(carry); \ + DBUG_ASSERT((carry) <= 1); \ + if (((carry)= a >= DIG_BASE)) /* no division here! */ \ + a-=DIG_BASE; \ + (to)=a; \ + } while(0) + +#define ADD2(to, from1, from2, carry) \ + do \ + { \ + dec2 a=((dec2)(from1))+(from2)+(carry); \ + if (((carry)= a >= DIG_BASE)) \ + a-=DIG_BASE; \ + if (unlikely(a >= DIG_BASE)) \ + { \ + a-=DIG_BASE; \ + carry++; \ + } \ + (to)=(dec1) a; \ + } while(0) + +#define SUB(to, from1, from2, carry) /* to=from1-from2 */ \ + do \ + { \ + dec1 a=(from1)-(from2)-(carry); \ + if (((carry)= a < 0)) \ + a+=DIG_BASE; \ + (to)=a; \ + } while(0) + +#define SUB2(to, from1, from2, carry) /* to=from1-from2 */ \ + do \ + { \ + dec1 a=(from1)-(from2)-(carry); \ + if (((carry)= a < 0)) \ + a+=DIG_BASE; \ + if (unlikely(a < 0)) \ + { \ + a+=DIG_BASE; \ + carry++; \ + } \ + (to)=a; \ + } while(0) + +/* + Get maximum value for given precision and scale + + SYNOPSIS + max_decimal() + precision/scale - see decimal_bin_size() below + to - decimal where where the result will be stored + to->buf and to->len must be set. +*/ + +void max_decimal(int precision, int frac, decimal_t *to) +{ + int intpart; + dec1 *buf= to->buf; + DBUG_ASSERT(precision && precision >= frac); + + to->sign= 0; + if ((intpart= to->intg= (precision - frac))) + { + int firstdigits= intpart % DIG_PER_DEC1; + if (firstdigits) + *buf++= powers10[firstdigits] - 1; /* get 9 99 999 ... */ + for(intpart/= DIG_PER_DEC1; intpart; intpart--) + *buf++= DIG_MAX; + } + + if ((to->frac= frac)) + { + int lastdigits= frac % DIG_PER_DEC1; + for(frac/= DIG_PER_DEC1; frac; frac--) + *buf++= DIG_MAX; + if (lastdigits) + *buf= frac_max[lastdigits - 1]; + } +} + + +static dec1 *remove_leading_zeroes(decimal_t *from, int *intg_result) +{ + int intg= from->intg, i; + dec1 *buf0= from->buf; + i= ((intg - 1) % DIG_PER_DEC1) + 1; + while (intg > 0 && *buf0 == 0) + { + intg-= i; + i= DIG_PER_DEC1; + buf0++; + } + if (intg > 0) + { + for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i--]; intg--) ; + DBUG_ASSERT(intg > 0); + } + else + intg=0; + *intg_result= intg; + return buf0; +} + + +/* + Count actual length of fraction part (without ending zeroes) + + SYNOPSIS + decimal_actual_fraction() + from number for processing +*/ + +int decimal_actual_fraction(decimal_t *from) +{ + int frac= from->frac, i; + dec1 *buf0= from->buf + ROUND_UP(from->intg) + ROUND_UP(frac) - 1; + + if (frac == 0) + return 0; + + i= ((frac - 1) % DIG_PER_DEC1 + 1); + while (frac > 0 && *buf0 == 0) + { + frac-= i; + i= DIG_PER_DEC1; + buf0--; + } + if (frac > 0) + { + for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1); + *buf0 % powers10[i++] == 0; + frac--); + } + return frac; +} + + +/* + Convert decimal to its printable string representation + + SYNOPSIS + decimal2string() + from - value to convert + to - points to buffer where string representation + should be stored + *to_len - in: size of to buffer + out: length of the actually written string + fixed_precision - 0 if representation can be variable length and + fixed_decimals will not be checked in this case. + Put number as with fixed point position with this + number of digits (sign counted and decimal point is + counted) + fixed_decimals - number digits after point. + filler - character to fill gaps in case of fixed_precision > 0 + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW +*/ + +int decimal2string(decimal_t *from, char *to, int *to_len, + int fixed_precision, int fixed_decimals, + char filler) +{ + int len, intg, frac= from->frac, i, intg_len, frac_len, fill; + /* number digits before decimal point */ + int fixed_intg= (fixed_precision ? + (fixed_precision - fixed_decimals) : 0); + int error=E_DEC_OK; + char *s=to; + dec1 *buf, *buf0=from->buf, tmp; + + DBUG_ASSERT(*to_len >= 2+from->sign); + + /* removing leading zeroes */ + buf0= remove_leading_zeroes(from, &intg); + if (unlikely(intg+frac==0)) + { + intg=1; + tmp=0; + buf0=&tmp; + } + + if (!(intg_len= fixed_precision ? fixed_intg : intg)) + intg_len= 1; + frac_len= fixed_precision ? fixed_decimals : frac; + len= from->sign + intg_len + test(frac) + frac_len; + if (fixed_precision) + { + if (frac > fixed_decimals) + { + error= E_DEC_TRUNCATED; + frac= fixed_decimals; + } + if (intg > fixed_intg) + { + error= E_DEC_OVERFLOW; + intg= fixed_intg; + } + } + else if (unlikely(len > --*to_len)) /* reserve one byte for \0 */ + { + int j= len-*to_len; + error= (frac && j <= frac + 1) ? E_DEC_TRUNCATED : E_DEC_OVERFLOW; + if (frac && j >= frac + 1) j--; + if (j > frac) + { + intg-= j-frac; + frac= 0; + } + else + frac-=j; + len= from->sign + intg_len + test(frac) + frac_len; + } + *to_len=len; + s[len]=0; + + if (from->sign) + *s++='-'; + + if (frac) + { + char *s1= s + intg_len; + fill= frac_len - frac; + buf=buf0+ROUND_UP(intg); + *s1++='.'; + for (; frac>0; frac-=DIG_PER_DEC1) + { + dec1 x=*buf++; + for (i=min(frac, DIG_PER_DEC1); i; i--) + { + dec1 y=x/DIG_MASK; + *s1++='0'+(uchar)y; + x-=y*DIG_MASK; + x*=10; + } + } + for(; fill; fill--) + *s1++=filler; + } + + fill= intg_len - intg; + if (intg == 0) + fill--; /* symbol 0 before digital point */ + for(; fill; fill--) + *s++=filler; + if (intg) + { + s+=intg; + for (buf=buf0+ROUND_UP(intg); intg>0; intg-=DIG_PER_DEC1) + { + dec1 x=*--buf; + for (i=min(intg, DIG_PER_DEC1); i; i--) + { + dec1 y=x/10; + *--s='0'+(uchar)(x-y*10); + x=y; + } + } + } + else + *s= '0'; + return error; +} + + +/* + Return bounds of decimal digits in the number + + SYNOPSIS + digits_bounds() + from - decimal number for processing + start_result - index (from 0 ) of first decimal digits will + be written by this address + end_result - index of position just after last decimal digit + be written by this address +*/ + +static void digits_bounds(decimal_t *from, int *start_result, int *end_result) +{ + int start, stop, i; + dec1 *buf_beg= from->buf; + dec1 *end= from->buf + ROUND_UP(from->intg) + ROUND_UP(from->frac); + dec1 *buf_end= end - 1; + + /* find non-zero digit from number begining */ + while (buf_beg < end && *buf_beg == 0) + buf_beg++; + + if (buf_beg >= end) + { + /* it is zero */ + *start_result= *end_result= 0; + return; + } + + /* find non-zero decimal digit from number begining */ + if (buf_beg == from->buf && from->intg) + { + start= DIG_PER_DEC1 - (i= ((from->intg-1) % DIG_PER_DEC1 + 1)); + i--; + } + else + { + i= DIG_PER_DEC1 - 1; + start= (int) ((buf_beg - from->buf) * DIG_PER_DEC1); + } + if (buf_beg < end) + for (; *buf_beg < powers10[i--]; start++) ; + *start_result= start; /* index of first decimal digit (from 0) */ + + /* find non-zero digit at the end */ + while (buf_end > buf_beg && *buf_end == 0) + buf_end--; + /* find non-zero decimal digit from the end */ + if (buf_end == end - 1 && from->frac) + { + stop= (int) (((buf_end - from->buf) * DIG_PER_DEC1 + + (i= ((from->frac - 1) % DIG_PER_DEC1 + 1)))); + i= DIG_PER_DEC1 - i + 1; + } + else + { + stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1); + i= 1; + } + for (; *buf_end % powers10[i++] == 0; stop--); + *end_result= stop; /* index of position after last decimal digit (from 0) */ +} + + +/* + Left shift for alignment of data in buffer + + SYNOPSIS + do_mini_left_shift() + dec pointer to decimal number which have to be shifted + shift number of decimal digits on which it should be shifted + beg/end bounds of decimal digits (see digits_bounds()) + + NOTE + Result fitting in the buffer should be garanted. + 'shift' have to be from 1 to DIG_PER_DEC1-1 (inclusive) +*/ + +void do_mini_left_shift(decimal_t *dec, int shift, int beg, int last) +{ + dec1 *from= dec->buf + ROUND_UP(beg + 1) - 1; + dec1 *end= dec->buf + ROUND_UP(last) - 1; + int c_shift= DIG_PER_DEC1 - shift; + DBUG_ASSERT(from >= dec->buf); + DBUG_ASSERT(end < dec->buf + dec->len); + if (beg % DIG_PER_DEC1 < shift) + *(from - 1)= (*from) / powers10[c_shift]; + for(; from < end; from++) + *from= ((*from % powers10[c_shift]) * powers10[shift] + + (*(from + 1)) / powers10[c_shift]); + *from= (*from % powers10[c_shift]) * powers10[shift]; +} + + +/* + Right shift for alignment of data in buffer + + SYNOPSIS + do_mini_left_shift() + dec pointer to decimal number which have to be shifted + shift number of decimal digits on which it should be shifted + beg/end bounds of decimal digits (see digits_bounds()) + + NOTE + Result fitting in the buffer should be garanted. + 'shift' have to be from 1 to DIG_PER_DEC1-1 (inclusive) +*/ + +void do_mini_right_shift(decimal_t *dec, int shift, int beg, int last) +{ + dec1 *from= dec->buf + ROUND_UP(last) - 1; + dec1 *end= dec->buf + ROUND_UP(beg + 1) - 1; + int c_shift= DIG_PER_DEC1 - shift; + DBUG_ASSERT(from < dec->buf + dec->len); + DBUG_ASSERT(end >= dec->buf); + if (DIG_PER_DEC1 - ((last - 1) % DIG_PER_DEC1 + 1) < shift) + *(from + 1)= (*from % powers10[shift]) * powers10[c_shift]; + for(; from > end; from--) + *from= (*from / powers10[shift] + + (*(from - 1) % powers10[shift]) * powers10[c_shift]); + *from= *from / powers10[shift]; +} + + +/* + Shift of decimal digits in given number (with rounding if it need) + + SYNOPSIS + decimal_shift() + dec number to be shifted + shift number of decimal positions + shift > 0 means shift to left shift + shift < 0 meand right shift + NOTE + In fact it is multipling on 10^shift. + RETURN + E_DEC_OK OK + E_DEC_OVERFLOW operation lead to overflow, number is untoched + E_DEC_TRUNCATED number was rounded to fit into buffer +*/ + +int decimal_shift(decimal_t *dec, int shift) +{ + /* index of first non zero digit (all indexes from 0) */ + int beg; + /* index of position after last decimal digit */ + int end; + /* index of digit position just after point */ + int point= ROUND_UP(dec->intg) * DIG_PER_DEC1; + /* new point position */ + int new_point= point + shift; + /* number of digits in result */ + int digits_int, digits_frac; + /* length of result and new fraction in big digits*/ + int new_len, new_frac_len; + /* return code */ + int err= E_DEC_OK; + int new_front; + + if (shift == 0) + return E_DEC_OK; + + digits_bounds(dec, &beg, &end); + + if (beg == end) + { + decimal_make_zero(dec); + return E_DEC_OK; + } + + digits_int= new_point - beg; + set_if_bigger(digits_int, 0); + digits_frac= end - new_point; + set_if_bigger(digits_frac, 0); + + if ((new_len= ROUND_UP(digits_int) + (new_frac_len= ROUND_UP(digits_frac))) > + dec->len) + { + int lack= new_len - dec->len; + int diff; + + if (new_frac_len < lack) + return E_DEC_OVERFLOW; /* lack more then we have in fraction */ + + /* cat off fraction part to allow new number to fit in our buffer */ + err= E_DEC_TRUNCATED; + new_frac_len-= lack; + diff= digits_frac - (new_frac_len * DIG_PER_DEC1); + /* Make rounding method as parameter? */ + decimal_round(dec, dec, end - point - diff, HALF_UP); + end-= diff; + digits_frac= new_frac_len * DIG_PER_DEC1; + + if (end <= beg) + { + /* + we lost all digits (they will be shifted out of buffer), so we can + just return 0 + */ + decimal_make_zero(dec); + return E_DEC_TRUNCATED; + } + } + + if (shift % DIG_PER_DEC1) + { + int l_mini_shift, r_mini_shift, mini_shift; + int do_left; + /* + Calculate left/right shift to align decimal digits inside our bug + digits correctly + */ + if (shift > 0) + { + l_mini_shift= shift % DIG_PER_DEC1; + r_mini_shift= DIG_PER_DEC1 - l_mini_shift; + /* + It is left shift so prefer left shift, but if we have not place from + left, we have to have it from right, because we checked length of + result + */ + do_left= l_mini_shift <= beg; + DBUG_ASSERT(do_left || (dec->len * DIG_PER_DEC1 - end) >= r_mini_shift); + } + else + { + r_mini_shift= (-shift) % DIG_PER_DEC1; + l_mini_shift= DIG_PER_DEC1 - r_mini_shift; + /* see comment above */ + do_left= !((dec->len * DIG_PER_DEC1 - end) >= r_mini_shift); + DBUG_ASSERT(!do_left || l_mini_shift <= beg); + } + if (do_left) + { + do_mini_left_shift(dec, l_mini_shift, beg, end); + mini_shift=- l_mini_shift; + } + else + { + do_mini_right_shift(dec, r_mini_shift, beg, end); + mini_shift= r_mini_shift; + } + new_point+= mini_shift; + /* + If number is shifted and correctly aligned in buffer we can + finish + */ + if (!(shift+= mini_shift) && (new_point - digits_int) < DIG_PER_DEC1) + { + dec->intg= digits_int; + dec->frac= digits_frac; + return err; /* already shifted as it should be */ + } + beg+= mini_shift; + end+= mini_shift; + } + + /* if new 'decimal front' is in first digit, we do not need move digits */ + if ((new_front= (new_point - digits_int)) >= DIG_PER_DEC1 || + new_front < 0) + { + /* need to move digits */ + int d_shift; + dec1 *to, *barier; + if (new_front > 0) + { + /* move left */ + d_shift= new_front / DIG_PER_DEC1; + to= dec->buf + (ROUND_UP(beg + 1) - 1 - d_shift); + barier= dec->buf + (ROUND_UP(end) - 1 - d_shift); + DBUG_ASSERT(to >= dec->buf); + DBUG_ASSERT(barier + d_shift < dec->buf + dec->len); + for(; to <= barier; to++) + *to= *(to + d_shift); + for(barier+= d_shift; to <= barier; to++) + *to= 0; + d_shift= -d_shift; + } + else + { + /* move right */ + d_shift= (1 - new_front) / DIG_PER_DEC1; + to= dec->buf + ROUND_UP(end) - 1 + d_shift; + barier= dec->buf + ROUND_UP(beg + 1) - 1 + d_shift; + DBUG_ASSERT(to < dec->buf + dec->len); + DBUG_ASSERT(barier - d_shift >= dec->buf); + for(; to >= barier; to--) + *to= *(to - d_shift); + for(barier-= d_shift; to >= barier; to--) + *to= 0; + } + d_shift*= DIG_PER_DEC1; + beg+= d_shift; + end+= d_shift; + new_point+= d_shift; + } + + /* + If there are gaps then fill ren with 0. + + Only one of following 'for' loops will work becouse beg <= end + */ + beg= ROUND_UP(beg + 1) - 1; + end= ROUND_UP(end) - 1; + DBUG_ASSERT(new_point >= 0); + + /* We don't want negative new_point below */ + if (new_point != 0) + new_point= ROUND_UP(new_point) - 1; + + if (new_point > end) + { + do + { + dec->buf[new_point]=0; + } while (--new_point > end); + } + else + { + for (; new_point < beg; new_point++) + dec->buf[new_point]= 0; + } + dec->intg= digits_int; + dec->frac= digits_frac; + return err; +} + + +/* + Convert string to decimal + + SYNOPSIS + internal_str2decl() + from - value to convert. Doesn't have to be \0 terminated! + to - decimal where where the result will be stored + to->buf and to->len must be set. + end - Pointer to pointer to end of string. Will on return be + set to the char after the last used character + fixed - use to->intg, to->frac as limits for input number + + NOTE + to->intg and to->frac can be modified even when fixed=1 + (but only decreased, in this case) + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW/E_DEC_BAD_NUM/E_DEC_OOM + In case of E_DEC_FATAL_ERROR *to is set to decimal zero + (to make error handling easier) +*/ + +int +internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed) +{ + const char *s= from, *s1, *endp, *end_of_string= *end; + int i, intg, frac, error, intg1, frac1; + dec1 x,*buf; + sanity(to); + + error= E_DEC_BAD_NUM; /* In case of bad number */ + while (s < end_of_string && my_isspace(&my_charset_latin1, *s)) + s++; + if (s == end_of_string) + goto fatal_error; + + if ((to->sign= (*s == '-'))) + s++; + else if (*s == '+') + s++; + + s1=s; + while (s < end_of_string && my_isdigit(&my_charset_latin1, *s)) + s++; + intg= (int) (s-s1); + if (s < end_of_string && *s=='.') + { + endp= s+1; + while (endp < end_of_string && my_isdigit(&my_charset_latin1, *endp)) + endp++; + frac= (int) (endp - s - 1); + } + else + { + frac= 0; + endp= s; + } + + *end= (char*) endp; + + if (frac+intg == 0) + goto fatal_error; + + error= 0; + if (fixed) + { + if (frac > to->frac) + { + error=E_DEC_TRUNCATED; + frac=to->frac; + } + if (intg > to->intg) + { + error=E_DEC_OVERFLOW; + intg=to->intg; + } + intg1=ROUND_UP(intg); + frac1=ROUND_UP(frac); + if (intg1+frac1 > to->len) + { + error= E_DEC_OOM; + goto fatal_error; + } + } + else + { + intg1=ROUND_UP(intg); + frac1=ROUND_UP(frac); + FIX_INTG_FRAC_ERROR(to->len, intg1, frac1, error); + if (unlikely(error)) + { + frac=frac1*DIG_PER_DEC1; + if (error == E_DEC_OVERFLOW) + intg=intg1*DIG_PER_DEC1; + } + } + /* Error is guranteed to be set here */ + to->intg=intg; + to->frac=frac; + + buf=to->buf+intg1; + s1=s; + + for (x=0, i=0; intg; intg--) + { + x+= (*--s - '0')*powers10[i]; + + if (unlikely(++i == DIG_PER_DEC1)) + { + *--buf=x; + x=0; + i=0; + } + } + if (i) + *--buf=x; + + buf=to->buf+intg1; + for (x=0, i=0; frac; frac--) + { + x= (*++s1 - '0') + x*10; + + if (unlikely(++i == DIG_PER_DEC1)) + { + *buf++=x; + x=0; + i=0; + } + } + if (i) + *buf=x*powers10[DIG_PER_DEC1-i]; + + /* Handle exponent */ + if (endp+1 < end_of_string && (*endp == 'e' || *endp == 'E')) + { + int str_error; + longlong exponent= my_strtoll10(endp+1, (char**) &end_of_string, + &str_error); + + if (end_of_string != endp +1) /* If at least one digit */ + { + *end= (char*) end_of_string; + if (str_error > 0) + { + error= E_DEC_BAD_NUM; + goto fatal_error; + } + if (exponent > INT_MAX/2 || (str_error == 0 && exponent < 0)) + { + error= E_DEC_OVERFLOW; + goto fatal_error; + } + if (exponent < INT_MIN/2 && error != E_DEC_OVERFLOW) + { + error= E_DEC_TRUNCATED; + goto fatal_error; + } + if (error != E_DEC_OVERFLOW) + error= decimal_shift(to, (int) exponent); + } + } + return error; + +fatal_error: + decimal_make_zero(to); + return error; +} + + +/* + Convert decimal to double + + SYNOPSIS + decimal2double() + from - value to convert + to - result will be stored there + + RETURN VALUE + E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED +*/ + +int decimal2double(decimal_t *from, double *to) +{ + char strbuf[FLOATING_POINT_BUFFER], *end; + int len= sizeof(strbuf); + int rc, error; + + rc = decimal2string(from, strbuf, &len, 0, 0, 0); + end= strbuf + len; + + DBUG_PRINT("info", ("interm.: %s", strbuf)); + + *to= my_strtod(strbuf, &end, &error); + + DBUG_PRINT("info", ("result: %f (%lx)", *to, *(ulong *)to)); + + return (rc != E_DEC_OK) ? rc : (error ? E_DEC_OVERFLOW : E_DEC_OK); +} + +/* + Convert double to decimal + + SYNOPSIS + double2decimal() + from - value to convert + to - result will be stored there + + RETURN VALUE + E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED +*/ + +int double2decimal(double from, decimal_t *to) +{ + char buff[FLOATING_POINT_BUFFER], *end; + int res; + DBUG_ENTER("double2decimal"); + end= buff + my_gcvt(from, MY_GCVT_ARG_DOUBLE, sizeof(buff) - 1, buff, NULL); + res= string2decimal(buff, to, &end); + DBUG_PRINT("exit", ("res: %d", res)); + DBUG_RETURN(res); +} + + +static int ull2dec(ulonglong from, decimal_t *to) +{ + int intg1, error=E_DEC_OK; + ulonglong x=from; + dec1 *buf; + + sanity(to); + + for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE); + if (unlikely(intg1 > to->len)) + { + intg1=to->len; + error=E_DEC_OVERFLOW; + } + to->frac=0; + to->intg=intg1*DIG_PER_DEC1; + + for (buf=to->buf+intg1; intg1; intg1--) + { + ulonglong y=x/DIG_BASE; + *--buf=(dec1)(x-y*DIG_BASE); + x=y; + } + return error; +} + +int ulonglong2decimal(ulonglong from, decimal_t *to) +{ + to->sign=0; + return ull2dec(from, to); +} + +int longlong2decimal(longlong from, decimal_t *to) +{ + if ((to->sign= from < 0)) + return ull2dec(-from, to); + return ull2dec(from, to); +} + +int decimal2ulonglong(decimal_t *from, ulonglong *to) +{ + dec1 *buf=from->buf; + ulonglong x=0; + int intg, frac; + + if (from->sign) + { + *to=0ULL; + return E_DEC_OVERFLOW; + } + + for (intg=from->intg; intg > 0; intg-=DIG_PER_DEC1) + { + ulonglong y=x; + x=x*DIG_BASE + *buf++; + if (unlikely(y > ((ulonglong) ULONGLONG_MAX/DIG_BASE) || x < y)) + { + *to=ULONGLONG_MAX; + return E_DEC_OVERFLOW; + } + } + *to=x; + for (frac=from->frac; unlikely(frac > 0); frac-=DIG_PER_DEC1) + if (*buf++) + return E_DEC_TRUNCATED; + return E_DEC_OK; +} + +int decimal2longlong(decimal_t *from, longlong *to) +{ + dec1 *buf=from->buf; + longlong x=0; + int intg, frac; + + for (intg=from->intg; intg > 0; intg-=DIG_PER_DEC1) + { + longlong y=x; + /* + Attention: trick! + we're calculating -|from| instead of |from| here + because |LONGLONG_MIN| > LONGLONG_MAX + so we can convert -9223372036854775808 correctly + */ + x=x*DIG_BASE - *buf++; + if (unlikely(y < (LONGLONG_MIN/DIG_BASE) || x > y)) + { + /* + the decimal is bigger than any possible integer + return border integer depending on the sign + */ + *to= from->sign ? LONGLONG_MIN : LONGLONG_MAX; + return E_DEC_OVERFLOW; + } + } + /* boundary case: 9223372036854775808 */ + if (unlikely(from->sign==0 && x == LONGLONG_MIN)) + { + *to= LONGLONG_MAX; + return E_DEC_OVERFLOW; + } + + *to=from->sign ? x : -x; + for (frac=from->frac; unlikely(frac > 0); frac-=DIG_PER_DEC1) + if (*buf++) + return E_DEC_TRUNCATED; + return E_DEC_OK; +} + +/* + Convert decimal to its binary fixed-length representation + two representations of the same length can be compared with memcmp + with the correct -1/0/+1 result + + SYNOPSIS + decimal2bin() + from - value to convert + to - points to buffer where string representation should be stored + precision/scale - see decimal_bin_size() below + + NOTE + the buffer is assumed to be of the size decimal_bin_size(precision, scale) + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW + + DESCRIPTION + for storage decimal numbers are converted to the "binary" format. + + This format has the following properties: + 1. length of the binary representation depends on the {precision, scale} + as provided by the caller and NOT on the intg/frac of the decimal to + convert. + 2. binary representations of the same {precision, scale} can be compared + with memcmp - with the same result as decimal_cmp() of the original + decimals (not taking into account possible precision loss during + conversion). + + This binary format is as follows: + 1. First the number is converted to have a requested precision and scale. + 2. Every full DIG_PER_DEC1 digits of intg part are stored in 4 bytes + as is + 3. The first intg % DIG_PER_DEC1 digits are stored in the reduced + number of bytes (enough bytes to store this number of digits - + see dig2bytes) + 4. same for frac - full decimal_digit_t's are stored as is, + the last frac % DIG_PER_DEC1 digits - in the reduced number of bytes. + 5. If the number is negative - every byte is inversed. + 5. The very first bit of the resulting byte array is inverted (because + memcmp compares unsigned bytes, see property 2 above) + + Example: + + 1234567890.1234 + + internally is represented as 3 decimal_digit_t's + + 1 234567890 123400000 + + (assuming we want a binary representation with precision=14, scale=4) + in hex it's + + 00-00-00-01 0D-FB-38-D2 07-5A-EF-40 + + now, middle decimal_digit_t is full - it stores 9 decimal digits. It goes + into binary representation as is: + + + ........... 0D-FB-38-D2 ............ + + First decimal_digit_t has only one decimal digit. We can store one digit in + one byte, no need to waste four: + + 01 0D-FB-38-D2 ............ + + now, last digit. It's 123400000. We can store 1234 in two bytes: + + 01 0D-FB-38-D2 04-D2 + + So, we've packed 12 bytes number in 7 bytes. + And now we invert the highest bit to get the final result: + + 81 0D FB 38 D2 04 D2 + + And for -1234567890.1234 it would be + + 7E F2 04 37 2D FB 2D +*/ +int decimal2bin(decimal_t *from, uchar *to, int precision, int frac) +{ + dec1 mask=from->sign ? -1 : 0, *buf1=from->buf, *stop1; + int error=E_DEC_OK, intg=precision-frac, + isize1, intg1, intg1x, from_intg, + intg0=intg/DIG_PER_DEC1, + frac0=frac/DIG_PER_DEC1, + intg0x=intg-intg0*DIG_PER_DEC1, + frac0x=frac-frac0*DIG_PER_DEC1, + frac1=from->frac/DIG_PER_DEC1, + frac1x=from->frac-frac1*DIG_PER_DEC1, + isize0=intg0*sizeof(dec1)+dig2bytes[intg0x], + fsize0=frac0*sizeof(dec1)+dig2bytes[frac0x], + fsize1=frac1*sizeof(dec1)+dig2bytes[frac1x]; + const int orig_isize0= isize0; + const int orig_fsize0= fsize0; + uchar *orig_to= to; + + buf1= remove_leading_zeroes(from, &from_intg); + + if (unlikely(from_intg+fsize1==0)) + { + mask=0; /* just in case */ + intg=1; + buf1=&mask; + } + + intg1=from_intg/DIG_PER_DEC1; + intg1x=from_intg-intg1*DIG_PER_DEC1; + isize1=intg1*sizeof(dec1)+dig2bytes[intg1x]; + + if (intg < from_intg) + { + buf1+=intg1-intg0+(intg1x>0)-(intg0x>0); + intg1=intg0; intg1x=intg0x; + error=E_DEC_OVERFLOW; + } + else if (isize0 > isize1) + { + while (isize0-- > isize1) + *to++= (char)mask; + } + if (fsize0 < fsize1) + { + frac1=frac0; frac1x=frac0x; + error=E_DEC_TRUNCATED; + } + else if (fsize0 > fsize1 && frac1x) + { + if (frac0 == frac1) + { + frac1x=frac0x; + fsize0= fsize1; + } + else + { + frac1++; + frac1x=0; + } + } + + /* intg1x part */ + if (intg1x) + { + int i=dig2bytes[intg1x]; + dec1 x=(*buf1++ % powers10[intg1x]) ^ mask; + switch (i) + { + case 1: mi_int1store(to, x); break; + case 2: mi_int2store(to, x); break; + case 3: mi_int3store(to, x); break; + case 4: mi_int4store(to, x); break; + default: DBUG_ASSERT(0); + } + to+=i; + } + + /* intg1+frac1 part */ + for (stop1=buf1+intg1+frac1; buf1 < stop1; to+=sizeof(dec1)) + { + dec1 x=*buf1++ ^ mask; + DBUG_ASSERT(sizeof(dec1) == 4); + mi_int4store(to, x); + } + + /* frac1x part */ + if (frac1x) + { + dec1 x; + int i=dig2bytes[frac1x], + lim=(frac1 < frac0 ? DIG_PER_DEC1 : frac0x); + while (frac1x < lim && dig2bytes[frac1x] == i) + frac1x++; + x=(*buf1 / powers10[DIG_PER_DEC1 - frac1x]) ^ mask; + switch (i) + { + case 1: mi_int1store(to, x); break; + case 2: mi_int2store(to, x); break; + case 3: mi_int3store(to, x); break; + case 4: mi_int4store(to, x); break; + default: DBUG_ASSERT(0); + } + to+=i; + } + if (fsize0 > fsize1) + { + uchar *to_end= orig_to + orig_fsize0 + orig_isize0; + + while (fsize0-- > fsize1 && to < to_end) + *to++= (uchar)mask; + } + orig_to[0]^= 0x80; + + /* Check that we have written the whole decimal and nothing more */ + DBUG_ASSERT(to == orig_to + orig_fsize0 + orig_isize0); + return error; +} + +/* + Restores decimal from its binary fixed-length representation + + SYNOPSIS + bin2decimal() + from - value to convert + to - result + precision/scale - see decimal_bin_size() below + + NOTE + see decimal2bin() + the buffer is assumed to be of the size decimal_bin_size(precision, scale) + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW +*/ + +int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale) +{ + int error=E_DEC_OK, intg=precision-scale, + intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1, + intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1, + intg1=intg0+(intg0x>0), frac1=frac0+(frac0x>0); + dec1 *buf=to->buf, mask=(*from & 0x80) ? 0 : -1; + const uchar *stop; + uchar *d_copy; + int bin_size= decimal_bin_size(precision, scale); + + sanity(to); + d_copy= (uchar*) my_alloca(bin_size); + memcpy(d_copy, from, bin_size); + d_copy[0]^= 0x80; + from= d_copy; + + FIX_INTG_FRAC_ERROR(to->len, intg1, frac1, error); + if (unlikely(error)) + { + if (intg1 < intg0+(intg0x>0)) + { + from+=dig2bytes[intg0x]+sizeof(dec1)*(intg0-intg1); + frac0=frac0x=intg0x=0; + intg0=intg1; + } + else + { + frac0x=0; + frac0=frac1; + } + } + + to->sign=(mask != 0); + to->intg=intg0*DIG_PER_DEC1+intg0x; + to->frac=frac0*DIG_PER_DEC1+frac0x; + + if (intg0x) + { + int i=dig2bytes[intg0x]; + dec1 x; + LINT_INIT(x); + switch (i) + { + case 1: x=mi_sint1korr(from); break; + case 2: x=mi_sint2korr(from); break; + case 3: x=mi_sint3korr(from); break; + case 4: x=mi_sint4korr(from); break; + default: DBUG_ASSERT(0); + } + from+=i; + *buf=x ^ mask; + if (((ulonglong)*buf) >= (ulonglong) powers10[intg0x+1]) + goto err; + if (buf > to->buf || *buf != 0) + buf++; + else + to->intg-=intg0x; + } + for (stop=from+intg0*sizeof(dec1); from < stop; from+=sizeof(dec1)) + { + DBUG_ASSERT(sizeof(dec1) == 4); + *buf=mi_sint4korr(from) ^ mask; + if (((uint32)*buf) > DIG_MAX) + goto err; + if (buf > to->buf || *buf != 0) + buf++; + else + to->intg-=DIG_PER_DEC1; + } + DBUG_ASSERT(to->intg >=0); + for (stop=from+frac0*sizeof(dec1); from < stop; from+=sizeof(dec1)) + { + DBUG_ASSERT(sizeof(dec1) == 4); + *buf=mi_sint4korr(from) ^ mask; + if (((uint32)*buf) > DIG_MAX) + goto err; + buf++; + } + if (frac0x) + { + int i=dig2bytes[frac0x]; + dec1 x; + LINT_INIT(x); + switch (i) + { + case 1: x=mi_sint1korr(from); break; + case 2: x=mi_sint2korr(from); break; + case 3: x=mi_sint3korr(from); break; + case 4: x=mi_sint4korr(from); break; + default: DBUG_ASSERT(0); + } + *buf=(x ^ mask) * powers10[DIG_PER_DEC1 - frac0x]; + if (((uint32)*buf) > DIG_MAX) + goto err; + buf++; + } + my_afree(d_copy); + return error; + +err: + my_afree(d_copy); + decimal_make_zero(((decimal_t*) to)); + return(E_DEC_BAD_NUM); +} + +/* + Returns the size of array to hold a decimal with given precision and scale + + RETURN VALUE + size in dec1 + (multiply by sizeof(dec1) to get the size if bytes) +*/ + +int decimal_size(int precision, int scale) +{ + DBUG_ASSERT(scale >= 0 && precision > 0 && scale <= precision); + return ROUND_UP(precision-scale)+ROUND_UP(scale); +} + +/* + Returns the size of array to hold a binary representation of a decimal + + RETURN VALUE + size in bytes +*/ + +int decimal_bin_size(int precision, int scale) +{ + int intg=precision-scale, + intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1, + intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1; + + DBUG_ASSERT(scale >= 0 && precision > 0 && scale <= precision); + return intg0*sizeof(dec1)+dig2bytes[intg0x]+ + frac0*sizeof(dec1)+dig2bytes[frac0x]; +} + +/* + Rounds the decimal to "scale" digits + + SYNOPSIS + decimal_round() + from - decimal to round, + to - result buffer. from==to is allowed + scale - to what position to round. can be negative! + mode - round to nearest even or truncate + + NOTES + scale can be negative ! + one TRUNCATED error (line XXX below) isn't treated very logical :( + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED +*/ + +int +decimal_round(decimal_t *from, decimal_t *to, int scale, + decimal_round_mode mode) +{ + int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1, + frac1=ROUND_UP(from->frac), round_digit, + intg0=ROUND_UP(from->intg), error=E_DEC_OK, len=to->len, + intg1=ROUND_UP(from->intg + + (((intg0 + frac0)>0) && (from->buf[0] == DIG_MAX))); + dec1 *buf0=from->buf, *buf1=to->buf, x, y, carry=0; + int first_dig; + + sanity(to); + + LINT_INIT(round_digit); + switch (mode) { + case HALF_UP: + case HALF_EVEN: round_digit=5; break; + case CEILING: round_digit= from->sign ? 10 : 0; break; + case FLOOR: round_digit= from->sign ? 0 : 10; break; + case TRUNCATE: round_digit=10; break; + default: DBUG_ASSERT(0); + } + + if (unlikely(frac0+intg0 > len)) + { + frac0=len-intg0; + scale=frac0*DIG_PER_DEC1; + error=E_DEC_TRUNCATED; + } + + if (scale+from->intg < 0) + { + decimal_make_zero(to); + return E_DEC_OK; + } + + if (to != from || intg1>intg0) + { + dec1 *p0= buf0+intg0+max(frac1, frac0); + dec1 *p1= buf1+intg1+max(frac1, frac0); + + while (buf0 < p0) + *(--p1) = *(--p0); + if (unlikely(intg1 > intg0)) + to->buf[0]= 0; + + intg0= intg1; + buf0=to->buf; + buf1=to->buf; + to->sign=from->sign; + to->intg=min(intg0, len)*DIG_PER_DEC1; + } + + if (frac0 > frac1) + { + buf1+=intg0+frac1; + while (frac0-- > frac1) + *buf1++=0; + goto done; + } + + if (scale >= from->frac) + goto done; /* nothing to do */ + + buf0+=intg0+frac0-1; + buf1+=intg0+frac0-1; + if (scale == frac0*DIG_PER_DEC1) + { + int do_inc= FALSE; + DBUG_ASSERT(frac0+intg0 >= 0); + switch (round_digit) { + case 0: + { + dec1 *p0= buf0 + (frac1-frac0); + for (; p0 > buf0; p0--) + { + if (*p0) + { + do_inc= TRUE; + break; + } + } + break; + } + case 5: + { + x= buf0[1]/DIG_MASK; + do_inc= (x>5) || ((x == 5) && + (mode == HALF_UP || (frac0+intg0 > 0 && *buf0 & 1))); + break; + } + default: + break; + } + if (do_inc) + { + if (frac0+intg0>0) + (*buf1)++; + else + *(++buf1)=DIG_BASE; + } + else if (frac0+intg0==0) + { + decimal_make_zero(to); + return E_DEC_OK; + } + } + else + { + /* TODO - fix this code as it won't work for CEILING mode */ + int pos=frac0*DIG_PER_DEC1-scale-1; + DBUG_ASSERT(frac0+intg0 > 0); + x=*buf1 / powers10[pos]; + y=x % 10; + if (y > round_digit || + (round_digit == 5 && y == 5 && (mode == HALF_UP || (x/10) & 1))) + x+=10; + *buf1=powers10[pos]*(x-y); + } + /* + In case we're rounding e.g. 1.5e9 to 2.0e9, the decimal_digit_t's inside + the buffer are as follows. + + Before <1, 5e8> + After <2, 5e8> + + Hence we need to set the 2nd field to 0. + The same holds if we round 1.5e-9 to 2e-9. + */ + if (frac0 < frac1) + { + dec1 *buf= to->buf + ((scale == 0 && intg0 == 0) ? 1 : intg0 + frac0); + dec1 *end= to->buf + len; + + while (buf < end) + *buf++=0; + } + if (*buf1 >= DIG_BASE) + { + carry=1; + *buf1-=DIG_BASE; + while (carry && --buf1 >= to->buf) + ADD(*buf1, *buf1, 0, carry); + if (unlikely(carry)) + { + /* shifting the number to create space for new digit */ + if (frac0+intg0 >= len) + { + frac0--; + scale=frac0*DIG_PER_DEC1; + error=E_DEC_TRUNCATED; /* XXX */ + } + for (buf1=to->buf+intg0+max(frac0,0); buf1 > to->buf; buf1--) + { + buf1[0]=buf1[-1]; + } + *buf1=1; + to->intg++; + } + } + else + { + for (;;) + { + if (likely(*buf1)) + break; + if (buf1-- == to->buf) + { + /* making 'zero' with the proper scale */ + dec1 *p0= to->buf + frac0 + 1; + to->intg=1; + to->frac= max(scale, 0); + to->sign= 0; + for (buf1= to->buf; buf1 1000 case when we need to increase intg */ + first_dig= to->intg % DIG_PER_DEC1; + if (first_dig && (*buf1 >= powers10[first_dig])) + to->intg++; + + if (scale<0) + scale=0; + +done: + to->frac=scale; + return error; +} + +/* + Returns the size of the result of the operation + + SYNOPSIS + decimal_result_size() + from1 - operand of the unary operation or first operand of the + binary operation + from2 - second operand of the binary operation + op - operation. one char '+', '-', '*', '/' are allowed + others may be added later + param - extra param to the operation. unused for '+', '-', '*' + scale increment for '/' + + NOTE + returned valued may be larger than the actual buffer requred + in the operation, as decimal_result_size, by design, operates on + precision/scale values only and not on the actual decimal number + + RETURN VALUE + size of to->buf array in dec1 elements. to get size in bytes + multiply by sizeof(dec1) +*/ + +int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param) +{ + switch (op) { + case '-': + return ROUND_UP(max(from1->intg, from2->intg)) + + ROUND_UP(max(from1->frac, from2->frac)); + case '+': + return ROUND_UP(max(from1->intg, from2->intg)+1) + + ROUND_UP(max(from1->frac, from2->frac)); + case '*': + return ROUND_UP(from1->intg+from2->intg)+ + ROUND_UP(from1->frac)+ROUND_UP(from2->frac); + case '/': + return ROUND_UP(from1->intg+from2->intg+1+from1->frac+from2->frac+param); + default: DBUG_ASSERT(0); + } + return -1; /* shut up the warning */ +} + +static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +{ + int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), + frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), + frac0=max(frac1, frac2), intg0=max(intg1, intg2), error; + dec1 *buf1, *buf2, *buf0, *stop, *stop2, x, carry; + + sanity(to); + + /* is there a need for extra word because of carry ? */ + x=intg1 > intg2 ? from1->buf[0] : + intg2 > intg1 ? from2->buf[0] : + from1->buf[0] + from2->buf[0] ; + if (unlikely(x > DIG_MAX-1)) /* yes, there is */ + { + intg0++; + to->buf[0]=0; /* safety */ + } + + FIX_INTG_FRAC_ERROR(to->len, intg0, frac0, error); + if (unlikely(error == E_DEC_OVERFLOW)) + { + max_decimal(to->len * DIG_PER_DEC1, 0, to); + return error; + } + + buf0=to->buf+intg0+frac0; + + to->sign=from1->sign; + to->frac=max(from1->frac, from2->frac); + to->intg=intg0*DIG_PER_DEC1; + if (unlikely(error)) + { + set_if_smaller(to->frac, frac0*DIG_PER_DEC1); + set_if_smaller(frac1, frac0); + set_if_smaller(frac2, frac0); + set_if_smaller(intg1, intg0); + set_if_smaller(intg2, intg0); + } + + /* part 1 - max(frac) ... min (frac) */ + if (frac1 > frac2) + { + buf1=from1->buf+intg1+frac1; + stop=from1->buf+intg1+frac2; + buf2=from2->buf+intg2+frac2; + stop2=from1->buf+(intg1 > intg2 ? intg1-intg2 : 0); + } + else + { + buf1=from2->buf+intg2+frac2; + stop=from2->buf+intg2+frac1; + buf2=from1->buf+intg1+frac1; + stop2=from2->buf+(intg2 > intg1 ? intg2-intg1 : 0); + } + while (buf1 > stop) + *--buf0=*--buf1; + + /* part 2 - min(frac) ... min(intg) */ + carry=0; + while (buf1 > stop2) + { + ADD(*--buf0, *--buf1, *--buf2, carry); + } + + /* part 3 - min(intg) ... max(intg) */ + buf1= intg1 > intg2 ? ((stop=from1->buf)+intg1-intg2) : + ((stop=from2->buf)+intg2-intg1) ; + while (buf1 > stop) + { + ADD(*--buf0, *--buf1, 0, carry); + } + + if (unlikely(carry)) + *--buf0=1; + DBUG_ASSERT(buf0 == to->buf || buf0 == to->buf+1); + + return error; +} + +/* to=from1-from2. + if to==0, return -1/0/+1 - the result of the comparison */ +static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +{ + int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), + frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac); + int frac0=max(frac1, frac2), error; + dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2, carry=0; + + /* let carry:=1 if from2 > from1 */ + start1=buf1=from1->buf; stop1=buf1+intg1; + start2=buf2=from2->buf; stop2=buf2+intg2; + if (unlikely(*buf1 == 0)) + { + while (buf1 < stop1 && *buf1 == 0) + buf1++; + start1=buf1; + intg1= (int) (stop1-buf1); + } + if (unlikely(*buf2 == 0)) + { + while (buf2 < stop2 && *buf2 == 0) + buf2++; + start2=buf2; + intg2= (int) (stop2-buf2); + } + if (intg2 > intg1) + carry=1; + else if (intg2 == intg1) + { + dec1 *end1= stop1 + (frac1 - 1); + dec1 *end2= stop2 + (frac2 - 1); + while (unlikely((buf1 <= end1) && (*end1 == 0))) + end1--; + while (unlikely((buf2 <= end2) && (*end2 == 0))) + end2--; + frac1= (int) (end1 - stop1) + 1; + frac2= (int) (end2 - stop2) + 1; + while (buf1 <=end1 && buf2 <= end2 && *buf1 == *buf2) + buf1++, buf2++; + if (buf1 <= end1) + { + if (buf2 <= end2) + carry= *buf2 > *buf1; + else + carry= 0; + } + else + { + if (buf2 <= end2) + carry=1; + else /* short-circuit everything: from1 == from2 */ + { + if (to == 0) /* decimal_cmp() */ + return 0; + decimal_make_zero(to); + return E_DEC_OK; + } + } + } + + if (to == 0) /* decimal_cmp() */ + return carry == from1->sign ? 1 : -1; + + sanity(to); + + to->sign=from1->sign; + + /* ensure that always from1 > from2 (and intg1 >= intg2) */ + if (carry) + { + swap_variables(decimal_t *,from1,from1); + swap_variables(dec1 *,start1, start2); + swap_variables(int,intg1,intg2); + swap_variables(int,frac1,frac2); + to->sign= 1 - to->sign; + } + + FIX_INTG_FRAC_ERROR(to->len, intg1, frac0, error); + buf0=to->buf+intg1+frac0; + + to->frac=max(from1->frac, from2->frac); + to->intg=intg1*DIG_PER_DEC1; + if (unlikely(error)) + { + set_if_smaller(to->frac, frac0*DIG_PER_DEC1); + set_if_smaller(frac1, frac0); + set_if_smaller(frac2, frac0); + set_if_smaller(intg2, intg1); + } + carry=0; + + /* part 1 - max(frac) ... min (frac) */ + if (frac1 > frac2) + { + buf1=start1+intg1+frac1; + stop1=start1+intg1+frac2; + buf2=start2+intg2+frac2; + while (frac0-- > frac1) + *--buf0=0; + while (buf1 > stop1) + *--buf0=*--buf1; + } + else + { + buf1=start1+intg1+frac1; + buf2=start2+intg2+frac2; + stop2=start2+intg2+frac1; + while (frac0-- > frac2) + *--buf0=0; + while (buf2 > stop2) + { + SUB(*--buf0, 0, *--buf2, carry); + } + } + + /* part 2 - min(frac) ... intg2 */ + while (buf2 > start2) + { + SUB(*--buf0, *--buf1, *--buf2, carry); + } + + /* part 3 - intg2 ... intg1 */ + while (carry && buf1 > start1) + { + SUB(*--buf0, *--buf1, 0, carry); + } + + while (buf1 > start1) + *--buf0=*--buf1; + + while (buf0 > to->buf) + *--buf0=0; + + return error; +} + +int decimal_intg(decimal_t *from) +{ + int res; + dec1 *tmp_res; + tmp_res= remove_leading_zeroes(from, &res); + return res; +} + +int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to) +{ + if (likely(from1->sign == from2->sign)) + return do_add(from1, from2, to); + return do_sub(from1, from2, to); +} + +int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) +{ + if (likely(from1->sign == from2->sign)) + return do_sub(from1, from2, to); + return do_add(from1, from2, to); +} + +int decimal_cmp(decimal_t *from1, decimal_t *from2) +{ + if (likely(from1->sign == from2->sign)) + return do_sub(from1, from2, 0); + return from1->sign > from2->sign ? -1 : 1; +} + +int decimal_is_zero(decimal_t *from) +{ + dec1 *buf1=from->buf, + *end=buf1+ROUND_UP(from->intg)+ROUND_UP(from->frac); + while (buf1 < end) + if (*buf1++) + return 0; + return 1; +} + +/* + multiply two decimals + + SYNOPSIS + decimal_mul() + from1, from2 - factors + to - product + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW; + + NOTES + in this implementation, with sizeof(dec1)=4 we have DIG_PER_DEC1=9, + and 63-digit number will take only 7 dec1 words (basically a 7-digit + "base 999999999" number). Thus there's no need in fast multiplication + algorithms, 7-digit numbers can be multiplied with a naive O(n*n) + method. + + XXX if this library is to be used with huge numbers of thousands of + digits, fast multiplication must be implemented. +*/ +int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) +{ + int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), + frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), + intg0=ROUND_UP(from1->intg+from2->intg), + frac0=frac1+frac2, error, i, j, d_to_move; + dec1 *buf1=from1->buf+intg1, *buf2=from2->buf+intg2, *buf0, + *start2, *stop2, *stop1, *start0, carry; + + sanity(to); + + i=intg0; /* save 'ideal' values */ + j=frac0; + FIX_INTG_FRAC_ERROR(to->len, intg0, frac0, error); /* bound size */ + to->sign=from1->sign != from2->sign; + to->frac=from1->frac+from2->frac; /* store size in digits */ + to->intg=intg0*DIG_PER_DEC1; + + if (unlikely(error)) + { + set_if_smaller(to->frac, frac0*DIG_PER_DEC1); + set_if_smaller(to->intg, intg0*DIG_PER_DEC1); + if (unlikely(i > intg0)) /* bounded integer-part */ + { + i-=intg0; + j=i >> 1; + intg1-= j; + intg2-=i-j; + frac1=frac2=0; /* frac0 is already 0 here */ + } + else /* bounded fract part */ + { + j-=frac0; + i=j >> 1; + if (frac1 <= frac2) + { + frac1-= i; + frac2-=j-i; + } + else + { + frac2-= i; + frac1-=j-i; + } + } + } + start0=to->buf+intg0+frac0-1; + start2=buf2+frac2-1; + stop1=buf1-intg1; + stop2=buf2-intg2; + + bzero(to->buf, (intg0+frac0)*sizeof(dec1)); + + for (buf1+=frac1-1; buf1 >= stop1; buf1--, start0--) + { + carry=0; + for (buf0=start0, buf2=start2; buf2 >= stop2; buf2--, buf0--) + { + dec1 hi, lo; + dec2 p= ((dec2)*buf1) * ((dec2)*buf2); + hi=(dec1)(p/DIG_BASE); + lo=(dec1)(p-((dec2)hi)*DIG_BASE); + ADD2(*buf0, *buf0, lo, carry); + carry+=hi; + } + if (carry) + { + if (buf0 < to->buf) + return E_DEC_OVERFLOW; + ADD2(*buf0, *buf0, 0, carry); + } + for (buf0--; carry; buf0--) + { + if (buf0 < to->buf) + return E_DEC_OVERFLOW; + ADD(*buf0, *buf0, 0, carry); + } + } + + /* Now we have to check for -0.000 case */ + if (to->sign) + { + dec1 *buf= to->buf; + dec1 *end= to->buf + intg0 + frac0; + DBUG_ASSERT(buf != end); + for (;;) + { + if (*buf) + break; + if (++buf == end) + { + /* We got decimal zero */ + decimal_make_zero(to); + break; + } + } + } + buf1= to->buf; + d_to_move= intg0 + ROUND_UP(to->frac); + while (!*buf1 && (to->intg > DIG_PER_DEC1)) + { + buf1++; + to->intg-= DIG_PER_DEC1; + d_to_move--; + } + if (to->buf < buf1) + { + dec1 *cur_d= to->buf; + for (; d_to_move--; cur_d++, buf1++) + *cur_d= *buf1; + } + return error; +} + +/* + naive division algorithm (Knuth's Algorithm D in 4.3.1) - + it's ok for short numbers + also we're using alloca() to allocate a temporary buffer + + XXX if this library is to be used with huge numbers of thousands of + digits, fast division must be implemented and alloca should be + changed to malloc (or at least fallback to malloc if alloca() fails) + but then, decimal_mul() should be rewritten too :( +*/ +static int do_div_mod(decimal_t *from1, decimal_t *from2, + decimal_t *to, decimal_t *mod, int scale_incr) +{ + int frac1=ROUND_UP(from1->frac)*DIG_PER_DEC1, prec1=from1->intg+frac1, + frac2=ROUND_UP(from2->frac)*DIG_PER_DEC1, prec2=from2->intg+frac2, + error, i, intg0, frac0, len1, len2, dintg, div_mod=(!mod); + dec1 *buf0, *buf1=from1->buf, *buf2=from2->buf, *tmp1, + *start2, *stop2, *stop1, *stop0, norm2, carry, *start1, dcarry; + dec2 norm_factor, x, guess, y; + + LINT_INIT(error); + + if (mod) + to=mod; + + sanity(to); + + /* removing all the leading zeroes */ + i= ((prec2 - 1) % DIG_PER_DEC1) + 1; + while (prec2 > 0 && *buf2 == 0) + { + prec2-= i; + i= DIG_PER_DEC1; + buf2++; + } + if (prec2 <= 0) /* short-circuit everything: from2 == 0 */ + return E_DEC_DIV_ZERO; + for (i= (prec2 - 1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ; + DBUG_ASSERT(prec2 > 0); + + i=((prec1-1) % DIG_PER_DEC1)+1; + while (prec1 > 0 && *buf1 == 0) + { + prec1-=i; + i=DIG_PER_DEC1; + buf1++; + } + if (prec1 <= 0) + { /* short-circuit everything: from1 == 0 */ + decimal_make_zero(to); + return E_DEC_OK; + } + for (i=(prec1-1) % DIG_PER_DEC1; *buf1 < powers10[i--]; prec1--) ; + DBUG_ASSERT(prec1 > 0); + + /* let's fix scale_incr, taking into account frac1,frac2 increase */ + if ((scale_incr-= frac1 - from1->frac + frac2 - from2->frac) < 0) + scale_incr=0; + + dintg=(prec1-frac1)-(prec2-frac2)+(*buf1 >= *buf2); + if (dintg < 0) + { + dintg/=DIG_PER_DEC1; + intg0=0; + } + else + intg0=ROUND_UP(dintg); + if (mod) + { + /* we're calculating N1 % N2. + The result will have + frac=max(frac1, frac2), as for subtraction + intg=intg2 + */ + to->sign=from1->sign; + to->frac=max(from1->frac, from2->frac); + frac0=0; + } + else + { + /* + we're calculating N1/N2. N1 is in the buf1, has prec1 digits + N2 is in the buf2, has prec2 digits. Scales are frac1 and + frac2 accordingly. + Thus, the result will have + frac = ROUND_UP(frac1+frac2+scale_incr) + and + intg = (prec1-frac1) - (prec2-frac2) + 1 + prec = intg+frac + */ + frac0=ROUND_UP(frac1+frac2+scale_incr); + FIX_INTG_FRAC_ERROR(to->len, intg0, frac0, error); + to->sign=from1->sign != from2->sign; + to->intg=intg0*DIG_PER_DEC1; + to->frac=frac0*DIG_PER_DEC1; + } + buf0=to->buf; + stop0=buf0+intg0+frac0; + if (likely(div_mod)) + while (dintg++ < 0) + *buf0++=0; + + len1=(i=ROUND_UP(prec1))+ROUND_UP(2*frac2+scale_incr+1) + 1; + set_if_bigger(len1, 3); + if (!(tmp1=(dec1 *)my_alloca(len1*sizeof(dec1)))) + return E_DEC_OOM; + memcpy(tmp1, buf1, i*sizeof(dec1)); + bzero(tmp1+i, (len1-i)*sizeof(dec1)); + + start1=tmp1; + stop1=start1+len1; + start2=buf2; + stop2=buf2+ROUND_UP(prec2)-1; + + /* removing end zeroes */ + while (*stop2 == 0 && stop2 >= start2) + stop2--; + len2= (int) (stop2++ - start2); + + /* + calculating norm2 (normalized *start2) - we need *start2 to be large + (at least > DIG_BASE/2), but unlike Knuth's Alg. D we don't want to + normalize input numbers (as we don't make a copy of the divisor). + Thus we normalize first dec1 of buf2 only, and we'll normalize *start1 + on the fly for the purpose of guesstimation only. + It's also faster, as we're saving on normalization of buf2 + */ + norm_factor=DIG_BASE/(*start2+1); + norm2=(dec1)(norm_factor*start2[0]); + if (likely(len2>0)) + norm2+=(dec1)(norm_factor*start2[1]/DIG_BASE); + + if (*start1 < *start2) + dcarry=*start1++; + else + dcarry=0; + + /* main loop */ + for (; buf0 < stop0; buf0++) + { + /* short-circuit, if possible */ + if (unlikely(dcarry == 0 && *start1 < *start2)) + guess=0; + else + { + /* D3: make a guess */ + x=start1[0]+((dec2)dcarry)*DIG_BASE; + y=start1[1]; + guess=(norm_factor*x+norm_factor*y/DIG_BASE)/norm2; + if (unlikely(guess >= DIG_BASE)) + guess=DIG_BASE-1; + if (likely(len2>0)) + { + /* hmm, this is a suspicious trick - I removed normalization here */ + if (start2[1]*guess > (x-guess*start2[0])*DIG_BASE+y) + guess--; + if (unlikely(start2[1]*guess > (x-guess*start2[0])*DIG_BASE+y)) + guess--; + DBUG_ASSERT(start2[1]*guess <= (x-guess*start2[0])*DIG_BASE+y); + } + + /* D4: multiply and subtract */ + buf2=stop2; + buf1=start1+len2; + DBUG_ASSERT(buf1 < stop1); + for (carry=0; buf2 > start2; buf1--) + { + dec1 hi, lo; + x=guess * (*--buf2); + hi=(dec1)(x/DIG_BASE); + lo=(dec1)(x-((dec2)hi)*DIG_BASE); + SUB2(*buf1, *buf1, lo, carry); + carry+=hi; + } + carry= dcarry < carry; + + /* D5: check the remainder */ + if (unlikely(carry)) + { + /* D6: correct the guess */ + guess--; + buf2=stop2; + buf1=start1+len2; + for (carry=0; buf2 > start2; buf1--) + { + ADD(*buf1, *buf1, *--buf2, carry); + } + } + } + if (likely(div_mod)) + *buf0=(dec1)guess; + dcarry= *start1; + start1++; + } + if (mod) + { + /* + now the result is in tmp1, it has + intg=prec1-frac1 + frac=max(frac1, frac2)=to->frac + */ + if (dcarry) + *--start1=dcarry; + buf0=to->buf; + intg0=(int) (ROUND_UP(prec1-frac1)-(start1-tmp1)); + frac0=ROUND_UP(to->frac); + error=E_DEC_OK; + if (unlikely(frac0==0 && intg0==0)) + { + decimal_make_zero(to); + goto done; + } + if (intg0<=0) + { + if (unlikely(-intg0 >= to->len)) + { + decimal_make_zero(to); + error=E_DEC_TRUNCATED; + goto done; + } + stop1=start1+frac0; + frac0+=intg0; + to->intg=0; + while (intg0++ < 0) + *buf0++=0; + } + else + { + if (unlikely(intg0 > to->len)) + { + frac0=0; + intg0=to->len; + error=E_DEC_OVERFLOW; + goto done; + } + DBUG_ASSERT(intg0 <= ROUND_UP(from2->intg)); + stop1=start1+frac0+intg0; + to->intg=min(intg0*DIG_PER_DEC1, from2->intg); + } + if (unlikely(intg0+frac0 > to->len)) + { + stop1-=frac0+intg0-to->len; + frac0=to->len-intg0; + to->frac=frac0*DIG_PER_DEC1; + error=E_DEC_TRUNCATED; + } + DBUG_ASSERT(buf0 + (stop1 - start1) <= to->buf + to->len); + while (start1 < stop1) + *buf0++=*start1++; + } +done: + my_afree(tmp1); + return error; +} + +/* + division of two decimals + + SYNOPSIS + decimal_div() + from1 - dividend + from2 - divisor + to - quotient + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW/E_DEC_DIV_ZERO; + + NOTES + see do_div_mod() +*/ + +int +decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr) +{ + return do_div_mod(from1, from2, to, 0, scale_incr); +} + +/* + modulus + + SYNOPSIS + decimal_mod() + from1 - dividend + from2 - divisor + to - modulus + + RETURN VALUE + E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW/E_DEC_DIV_ZERO; + + NOTES + see do_div_mod() + + DESCRIPTION + the modulus R in R = M mod N + + is defined as + + 0 <= |R| < |M| + sign R == sign M + R = M - k*N, where k is integer + + thus, there's no requirement for M or N to be integers +*/ + +int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to) +{ + return do_div_mod(from1, from2, 0, to, 0); +} + +#ifdef MAIN + +int full= 0; +decimal_t a, b, c; +char buf1[100], buf2[100], buf3[100]; + +void dump_decimal(decimal_t *d) +{ + int i; + printf("/* intg=%d, frac=%d, sign=%d, buf[]={", d->intg, d->frac, d->sign); + for (i=0; i < ROUND_UP(d->frac)+ROUND_UP(d->intg)-1; i++) + printf("%09d, ", d->buf[i]); + printf("%09d} */ ", d->buf[i]); +} + + +void check_result_code(int actual, int want) +{ + if (actual != want) + { + printf("\n^^^^^^^^^^^^^ must return %d\n", want); + exit(1); + } +} + + +void print_decimal(decimal_t *d, const char *orig, int actual, int want) +{ + char s[100]; + int slen=sizeof(s); + + if (full) dump_decimal(d); + decimal2string(d, s, &slen, 0, 0, 0); + printf("'%s'", s); + check_result_code(actual, want); + if (orig && strcmp(orig, s)) + { + printf("\n^^^^^^^^^^^^^ must've been '%s'\n", orig); + exit(1); + } +} + +void test_d2s() +{ + char s[100]; + int slen, res; + + /***********************************/ + printf("==== decimal2string ====\n"); + a.buf[0]=12345; a.intg=5; a.frac=0; a.sign=0; + slen=sizeof(s); + res=decimal2string(&a, s, &slen, 0, 0, 0); + dump_decimal(&a); printf(" --> res=%d str='%s' len=%d\n", res, s, slen); + + a.buf[1]=987000000; a.frac=3; + slen=sizeof(s); + res=decimal2string(&a, s, &slen, 0, 0, 0); + dump_decimal(&a); printf(" --> res=%d str='%s' len=%d\n", res, s, slen); + + a.sign=1; + slen=sizeof(s); + res=decimal2string(&a, s, &slen, 0, 0, 0); + dump_decimal(&a); printf(" --> res=%d str='%s' len=%d\n", res, s, slen); + + slen=8; + res=decimal2string(&a, s, &slen, 0, 0, 0); + dump_decimal(&a); printf(" --> res=%d str='%s' len=%d\n", res, s, slen); + + slen=5; + res=decimal2string(&a, s, &slen, 0, 0, 0); + dump_decimal(&a); printf(" --> res=%d str='%s' len=%d\n", res, s, slen); + + a.buf[0]=987000000; a.frac=3; a.intg=0; + slen=sizeof(s); + res=decimal2string(&a, s, &slen, 0, 0, 0); + dump_decimal(&a); printf(" --> res=%d str='%s' len=%d\n", res, s, slen); +} + +void test_s2d(const char *s, const char *orig, int ex) +{ + char s1[100], *end; + int res; + sprintf(s1, "'%s'", s); + end= strend(s); + printf("len=%2d %-30s => res=%d ", a.len, s1, + (res= string2decimal(s, &a, &end))); + print_decimal(&a, orig, res, ex); + printf("\n"); +} + +void test_d2f(const char *s, int ex) +{ + char s1[100], *end; + double x; + int res; + + sprintf(s1, "'%s'", s); + end= strend(s); + string2decimal(s, &a, &end); + res=decimal2double(&a, &x); + if (full) dump_decimal(&a); + printf("%-40s => res=%d %.*g\n", s1, res, a.intg+a.frac, x); + check_result_code(res, ex); +} + +void test_d2b2d(const char *str, int p, int s, const char *orig, int ex) +{ + char s1[100], buf[100], *end; + int res, i, size=decimal_bin_size(p, s); + + sprintf(s1, "'%s'", str); + end= strend(str); + string2decimal(str, &a, &end); + res=decimal2bin(&a, buf, p, s); + printf("%-31s {%2d, %2d} => res=%d size=%-2d ", s1, p, s, res, size); + if (full) + { + printf("0x"); + for (i=0; i < size; i++) + printf("%02x", ((uchar *)buf)[i]); + } + res=bin2decimal(buf, &a, p, s); + printf(" => res=%d ", res); + print_decimal(&a, orig, res, ex); + printf("\n"); +} + +void test_f2d(double from, int ex) +{ + int res; + + res=double2decimal(from, &a); + printf("%-40.*f => res=%d ", DBL_DIG-2, from, res); + print_decimal(&a, 0, res, ex); + printf("\n"); +} + +void test_ull2d(ulonglong from, const char *orig, int ex) +{ + char s[100]; + int res; + + res=ulonglong2decimal(from, &a); + longlong10_to_str(from,s,10); + printf("%-40s => res=%d ", s, res); + print_decimal(&a, orig, res, ex); + printf("\n"); +} + +void test_ll2d(longlong from, const char *orig, int ex) +{ + char s[100]; + int res; + + res=longlong2decimal(from, &a); + longlong10_to_str(from,s,-10); + printf("%-40s => res=%d ", s, res); + print_decimal(&a, orig, res, ex); + printf("\n"); +} + +void test_d2ull(const char *s, const char *orig, int ex) +{ + char s1[100], *end; + ulonglong x; + int res; + + end= strend(s); + string2decimal(s, &a, &end); + res=decimal2ulonglong(&a, &x); + if (full) dump_decimal(&a); + longlong10_to_str(x,s1,10); + printf("%-40s => res=%d %s\n", s, res, s1); + check_result_code(res, ex); + if (orig && strcmp(orig, s1)) + { + printf("\n^^^^^^^^^^^^^ must've been '%s'\n", orig); + exit(1); + } +} + +void test_d2ll(const char *s, const char *orig, int ex) +{ + char s1[100], *end; + longlong x; + int res; + + end= strend(s); + string2decimal(s, &a, &end); + res=decimal2longlong(&a, &x); + if (full) dump_decimal(&a); + longlong10_to_str(x,s1,-10); + printf("%-40s => res=%d %s\n", s, res, s1); + check_result_code(res, ex); + if (orig && strcmp(orig, s1)) + { + printf("\n^^^^^^^^^^^^^ must've been '%s'\n", orig); + exit(1); + } +} + +void test_da(const char *s1, const char *s2, const char *orig, int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' + '%s'", s1, s2); + end= strend(s1); + string2decimal(s1, &a, &end); + end= strend(s2); + string2decimal(s2, &b, &end); + res=decimal_add(&a, &b, &c); + printf("%-40s => res=%d ", s, res); + print_decimal(&c, orig, res, ex); + printf("\n"); +} + +void test_ds(const char *s1, const char *s2, const char *orig, int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' - '%s'", s1, s2); + end= strend(s1); + string2decimal(s1, &a, &end); + end= strend(s2); + string2decimal(s2, &b, &end); + res=decimal_sub(&a, &b, &c); + printf("%-40s => res=%d ", s, res); + print_decimal(&c, orig, res, ex); + printf("\n"); +} + +void test_dc(const char *s1, const char *s2, int orig) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' <=> '%s'", s1, s2); + end= strend(s1); + string2decimal(s1, &a, &end); + end= strend(s2); + string2decimal(s2, &b, &end); + res=decimal_cmp(&a, &b); + printf("%-40s => res=%d\n", s, res); + if (orig != res) + { + printf("\n^^^^^^^^^^^^^ must've been %d\n", orig); + exit(1); + } +} + +void test_dm(const char *s1, const char *s2, const char *orig, int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' * '%s'", s1, s2); + end= strend(s1); + string2decimal(s1, &a, &end); + end= strend(s2); + string2decimal(s2, &b, &end); + res=decimal_mul(&a, &b, &c); + printf("%-40s => res=%d ", s, res); + print_decimal(&c, orig, res, ex); + printf("\n"); +} + +void test_dv(const char *s1, const char *s2, const char *orig, int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' / '%s'", s1, s2); + end= strend(s1); + string2decimal(s1, &a, &end); + end= strend(s2); + string2decimal(s2, &b, &end); + res=decimal_div(&a, &b, &c, 5); + printf("%-40s => res=%d ", s, res); + check_result_code(res, ex); + if (res == E_DEC_DIV_ZERO) + printf("E_DEC_DIV_ZERO"); + else + print_decimal(&c, orig, res, ex); + printf("\n"); +} + +void test_md(const char *s1, const char *s2, const char *orig, int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' %% '%s'", s1, s2); + end= strend(s1); + string2decimal(s1, &a, &end); + end= strend(s2); + string2decimal(s2, &b, &end); + res=decimal_mod(&a, &b, &c); + printf("%-40s => res=%d ", s, res); + check_result_code(res, ex); + if (res == E_DEC_DIV_ZERO) + printf("E_DEC_DIV_ZERO"); + else + print_decimal(&c, orig, res, ex); + printf("\n"); +} + +const char *round_mode[]= +{"TRUNCATE", "HALF_EVEN", "HALF_UP", "CEILING", "FLOOR"}; + +void test_ro(const char *s1, int n, decimal_round_mode mode, const char *orig, + int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s', %d, %s", s1, n, round_mode[mode]); + end= strend(s1); + string2decimal(s1, &a, &end); + res=decimal_round(&a, &b, n, mode); + printf("%-40s => res=%d ", s, res); + print_decimal(&b, orig, res, ex); + printf("\n"); +} + + +void test_mx(int precision, int frac, const char *orig) +{ + char s[100]; + sprintf(s, "%d, %d", precision, frac); + max_decimal(precision, frac, &a); + printf("%-40s => ", s); + print_decimal(&a, orig, 0, 0); + printf("\n"); +} + + +void test_pr(const char *s1, int prec, int dec, char filler, const char *orig, + int ex) +{ + char s[100], *end; + char s2[100]; + int slen= sizeof(s2); + int res; + + sprintf(s, filler ? "'%s', %d, %d, '%c'" : "'%s', %d, %d, '\\0'", + s1, prec, dec, filler); + end= strend(s1); + string2decimal(s1, &a, &end); + res= decimal2string(&a, s2, &slen, prec, dec, filler); + printf("%-40s => res=%d '%s'", s, res, s2); + check_result_code(res, ex); + if (orig && strcmp(orig, s2)) + { + printf("\n^^^^^^^^^^^^^ must've been '%s'\n", orig); + exit(1); + } + printf("\n"); +} + + +void test_sh(const char *s1, int shift, const char *orig, int ex) +{ + char s[100], *end; + int res; + sprintf(s, "'%s' %s %d", s1, ((shift < 0) ? ">>" : "<<"), abs(shift)); + end= strend(s1); + string2decimal(s1, &a, &end); + res= decimal_shift(&a, shift); + printf("%-40s => res=%d ", s, res); + print_decimal(&a, orig, res, ex); + printf("\n"); +} + + +void test_fr(const char *s1, const char *orig) +{ + char s[100], *end; + sprintf(s, "'%s'", s1); + printf("%-40s => ", s); + end= strend(s1); + string2decimal(s1, &a, &end); + a.frac= decimal_actual_fraction(&a); + print_decimal(&a, orig, 0, 0); + printf("\n"); +} + + +int main() +{ + a.buf=(void*)buf1; + a.len=sizeof(buf1)/sizeof(dec1); + b.buf=(void*)buf2; + b.len=sizeof(buf2)/sizeof(dec1); + c.buf=(void*)buf3; + c.len=sizeof(buf3)/sizeof(dec1); + + if (full) + test_d2s(); + + printf("==== string2decimal ====\n"); + test_s2d("12345", "12345", 0); + test_s2d("12345.", "12345", 0); + test_s2d("123.45", "123.45", 0); + test_s2d("-123.45", "-123.45", 0); + test_s2d(".00012345000098765", "0.00012345000098765", 0); + test_s2d(".12345000098765", "0.12345000098765", 0); + test_s2d("-.000000012345000098765", "-0.000000012345000098765", 0); + test_s2d("1234500009876.5", "1234500009876.5", 0); + a.len=1; + test_s2d("123450000098765", "98765", 2); + test_s2d("123450.000098765", "123450", 1); + a.len=sizeof(buf1)/sizeof(dec1); + test_s2d("123E5", "12300000", 0); + test_s2d("123E-2", "1.23", 0); + + printf("==== decimal2double ====\n"); + test_d2f("12345", 0); + test_d2f("123.45", 0); + test_d2f("-123.45", 0); + test_d2f("0.00012345000098765", 0); + test_d2f("1234500009876.5", 0); + + printf("==== double2decimal ====\n"); + test_f2d(12345, 0); + test_f2d(1.0/3, 0); + test_f2d(-123.45, 0); + test_f2d(0.00012345000098765, 0); + test_f2d(1234500009876.5, 0); + + printf("==== ulonglong2decimal ====\n"); + test_ull2d(12345ULL, "12345", 0); + test_ull2d(0ULL, "0", 0); + test_ull2d(18446744073709551615ULL, "18446744073709551615", 0); + + printf("==== decimal2ulonglong ====\n"); + test_d2ull("12345", "12345", 0); + test_d2ull("0", "0", 0); + test_d2ull("18446744073709551615", "18446744073709551615", 0); + test_d2ull("18446744073709551616", "18446744073", 2); + test_d2ull("-1", "0", 2); + test_d2ull("1.23", "1", 1); + test_d2ull("9999999999999999999999999.000", "9999999999999999", 2); + + printf("==== longlong2decimal ====\n"); + test_ll2d(-12345LL, "-12345", 0); + test_ll2d(-1LL, "-1", 0); + test_ll2d(-9223372036854775807LL, "-9223372036854775807", 0); + test_ll2d(9223372036854775808ULL, "-9223372036854775808", 0); + + printf("==== decimal2longlong ====\n"); + test_d2ll("18446744073709551615", "18446744073", 2); + test_d2ll("-1", "-1", 0); + test_d2ll("-1.23", "-1", 1); + test_d2ll("-9223372036854775807", "-9223372036854775807", 0); + test_d2ll("-9223372036854775808", "-9223372036854775808", 0); + test_d2ll("9223372036854775808", "9223372036854775807", 2); + + printf("==== do_add ====\n"); + test_da(".00012345000098765" ,"123.45", "123.45012345000098765", 0); + test_da(".1" ,".45", "0.55", 0); + test_da("1234500009876.5" ,".00012345000098765", "1234500009876.50012345000098765", 0); + test_da("9999909999999.5" ,".555", "9999910000000.055", 0); + test_da("99999999" ,"1", "100000000", 0); + test_da("989999999" ,"1", "990000000", 0); + test_da("999999999" ,"1", "1000000000", 0); + test_da("12345" ,"123.45", "12468.45", 0); + test_da("-12345" ,"-123.45", "-12468.45", 0); + test_ds("-12345" ,"123.45", "-12468.45", 0); + test_ds("12345" ,"-123.45", "12468.45", 0); + + printf("==== do_sub ====\n"); + test_ds(".00012345000098765", "123.45","-123.44987654999901235", 0); + test_ds("1234500009876.5", ".00012345000098765","1234500009876.49987654999901235", 0); + test_ds("9999900000000.5", ".555","9999899999999.945", 0); + test_ds("1111.5551", "1111.555","0.0001", 0); + test_ds(".555", ".555","0", 0); + test_ds("10000000", "1","9999999", 0); + test_ds("1000001000", ".1","1000000999.9", 0); + test_ds("1000000000", ".1","999999999.9", 0); + test_ds("12345", "123.45","12221.55", 0); + test_ds("-12345", "-123.45","-12221.55", 0); + test_da("-12345", "123.45","-12221.55", 0); + test_da("12345", "-123.45","12221.55", 0); + test_ds("123.45", "12345","-12221.55", 0); + test_ds("-123.45", "-12345","12221.55", 0); + test_da("123.45", "-12345","-12221.55", 0); + test_da("-123.45", "12345","12221.55", 0); + test_da("5", "-6.0","-1.0", 0); + + printf("==== decimal_mul ====\n"); + test_dm("12", "10","120", 0); + test_dm("-123.456", "98765.4321","-12193185.1853376", 0); + test_dm("-123456000000", "98765432100000","-12193185185337600000000000", 0); + test_dm("123456", "987654321","121931851853376", 0); + test_dm("123456", "9876543210","1219318518533760", 0); + test_dm("123", "0.01","1.23", 0); + test_dm("123", "0","0", 0); + + printf("==== decimal_div ====\n"); + test_dv("120", "10","12.000000000", 0); + test_dv("123", "0.01","12300.000000000", 0); + test_dv("120", "100000000000.00000","0.000000001200000000", 0); + test_dv("123", "0","", 4); + test_dv("0", "0", "", 4); + test_dv("-12193185.1853376", "98765.4321","-123.456000000000000000", 0); + test_dv("121931851853376", "987654321","123456.000000000", 0); + test_dv("0", "987","0", 0); + test_dv("1", "3","0.333333333", 0); + test_dv("1.000000000000", "3","0.333333333333333333", 0); + test_dv("1", "1","1.000000000", 0); + test_dv("0.0123456789012345678912345", "9999999999","0.000000000001234567890246913578148141", 0); + test_dv("10.333000000", "12.34500","0.837019036046982584042122316", 0); + test_dv("10.000000000060", "2","5.000000000030000000", 0); + + printf("==== decimal_mod ====\n"); + test_md("234","10","4", 0); + test_md("234.567","10.555","2.357", 0); + test_md("-234.567","10.555","-2.357", 0); + test_md("234.567","-10.555","2.357", 0); + c.buf[1]=0x3ABECA; + test_md("99999999999999999999999999999999999999","3","0", 0); + if (c.buf[1] != 0x3ABECA) + { + printf("%X - overflow\n", c.buf[1]); + exit(1); + } + + printf("==== decimal2bin/bin2decimal ====\n"); + test_d2b2d("-10.55", 4, 2,"-10.55", 0); + test_d2b2d("0.0123456789012345678912345", 30, 25,"0.0123456789012345678912345", 0); + test_d2b2d("12345", 5, 0,"12345", 0); + test_d2b2d("12345", 10, 3,"12345.000", 0); + test_d2b2d("123.45", 10, 3,"123.450", 0); + test_d2b2d("-123.45", 20, 10,"-123.4500000000", 0); + test_d2b2d(".00012345000098765", 15, 14,"0.00012345000098", 0); + test_d2b2d(".00012345000098765", 22, 20,"0.00012345000098765000", 0); + test_d2b2d(".12345000098765", 30, 20,"0.12345000098765000000", 0); + test_d2b2d("-.000000012345000098765", 30, 20,"-0.00000001234500009876", 0); + test_d2b2d("1234500009876.5", 30, 5,"1234500009876.50000", 0); + test_d2b2d("111111111.11", 10, 2,"11111111.11", 0); + test_d2b2d("000000000.01", 7, 3,"0.010", 0); + test_d2b2d("123.4", 10, 2, "123.40", 0); + + + printf("==== decimal_cmp ====\n"); + test_dc("12","13",-1); + test_dc("13","12",1); + test_dc("-10","10",-1); + test_dc("10","-10",1); + test_dc("-12","-13",1); + test_dc("0","12",-1); + test_dc("-10","0",-1); + test_dc("4","4",0); + + printf("==== decimal_round ====\n"); + test_ro("5678.123451",-4,TRUNCATE,"0", 0); + test_ro("5678.123451",-3,TRUNCATE,"5000", 0); + test_ro("5678.123451",-2,TRUNCATE,"5600", 0); + test_ro("5678.123451",-1,TRUNCATE,"5670", 0); + test_ro("5678.123451",0,TRUNCATE,"5678", 0); + test_ro("5678.123451",1,TRUNCATE,"5678.1", 0); + test_ro("5678.123451",2,TRUNCATE,"5678.12", 0); + test_ro("5678.123451",3,TRUNCATE,"5678.123", 0); + test_ro("5678.123451",4,TRUNCATE,"5678.1234", 0); + test_ro("5678.123451",5,TRUNCATE,"5678.12345", 0); + test_ro("5678.123451",6,TRUNCATE,"5678.123451", 0); + test_ro("-5678.123451",-4,TRUNCATE,"0", 0); + memset(buf2, 33, sizeof(buf2)); + test_ro("99999999999999999999999999999999999999",-31,TRUNCATE,"99999990000000000000000000000000000000", 0); + test_ro("15.1",0,HALF_UP,"15", 0); + test_ro("15.5",0,HALF_UP,"16", 0); + test_ro("15.9",0,HALF_UP,"16", 0); + test_ro("-15.1",0,HALF_UP,"-15", 0); + test_ro("-15.5",0,HALF_UP,"-16", 0); + test_ro("-15.9",0,HALF_UP,"-16", 0); + test_ro("15.1",1,HALF_UP,"15.1", 0); + test_ro("-15.1",1,HALF_UP,"-15.1", 0); + test_ro("15.17",1,HALF_UP,"15.2", 0); + test_ro("15.4",-1,HALF_UP,"20", 0); + test_ro("-15.4",-1,HALF_UP,"-20", 0); + test_ro("5.4",-1,HALF_UP,"10", 0); + test_ro(".999", 0, HALF_UP, "1", 0); + memset(buf2, 33, sizeof(buf2)); + test_ro("999999999", -9, HALF_UP, "1000000000", 0); + test_ro("15.1",0,HALF_EVEN,"15", 0); + test_ro("15.5",0,HALF_EVEN,"16", 0); + test_ro("14.5",0,HALF_EVEN,"14", 0); + test_ro("15.9",0,HALF_EVEN,"16", 0); + test_ro("15.1",0,CEILING,"16", 0); + test_ro("-15.1",0,CEILING,"-15", 0); + test_ro("15.1",0,FLOOR,"15", 0); + test_ro("-15.1",0,FLOOR,"-16", 0); + test_ro("999999999999999999999.999", 0, CEILING,"1000000000000000000000", 0); + test_ro("-999999999999999999999.999", 0, FLOOR,"-1000000000000000000000", 0); + + b.buf[0]=DIG_BASE+1; + b.buf++; + test_ro(".3", 0, HALF_UP, "0", 0); + b.buf--; + if (b.buf[0] != DIG_BASE+1) + { + printf("%d - underflow\n", b.buf[0]); + exit(1); + } + + printf("==== max_decimal ====\n"); + test_mx(1,1,"0.9"); + test_mx(1,0,"9"); + test_mx(2,1,"9.9"); + test_mx(4,2,"99.99"); + test_mx(6,3,"999.999"); + test_mx(8,4,"9999.9999"); + test_mx(10,5,"99999.99999"); + test_mx(12,6,"999999.999999"); + test_mx(14,7,"9999999.9999999"); + test_mx(16,8,"99999999.99999999"); + test_mx(18,9,"999999999.999999999"); + test_mx(20,10,"9999999999.9999999999"); + test_mx(20,20,"0.99999999999999999999"); + test_mx(20,0,"99999999999999999999"); + test_mx(40,20,"99999999999999999999.99999999999999999999"); + + printf("==== decimal2string ====\n"); + test_pr("123.123", 0, 0, 0, "123.123", 0); + test_pr("123.123", 7, 3, '0', "123.123", 0); + test_pr("123.123", 9, 3, '0', "00123.123", 0); + test_pr("123.123", 9, 4, '0', "0123.1230", 0); + test_pr("123.123", 9, 5, '0', "123.12300", 0); + test_pr("123.123", 9, 2, '0', "000123.12", 1); + test_pr("123.123", 9, 6, '0', "23.123000", 2); + + printf("==== decimal_shift ====\n"); + test_sh("123.123", 1, "1231.23", 0); + test_sh("123457189.123123456789000", 1, "1234571891.23123456789", 0); + test_sh("123457189.123123456789000", 4, "1234571891231.23456789", 0); + test_sh("123457189.123123456789000", 8, "12345718912312345.6789", 0); + test_sh("123457189.123123456789000", 9, "123457189123123456.789", 0); + test_sh("123457189.123123456789000", 10, "1234571891231234567.89", 0); + test_sh("123457189.123123456789000", 17, "12345718912312345678900000", 0); + test_sh("123457189.123123456789000", 18, "123457189123123456789000000", 0); + test_sh("123457189.123123456789000", 19, "1234571891231234567890000000", 0); + test_sh("123457189.123123456789000", 26, "12345718912312345678900000000000000", 0); + test_sh("123457189.123123456789000", 27, "123457189123123456789000000000000000", 0); + test_sh("123457189.123123456789000", 28, "1234571891231234567890000000000000000", 0); + test_sh("000000000000000000000000123457189.123123456789000", 26, "12345718912312345678900000000000000", 0); + test_sh("00000000123457189.123123456789000", 27, "123457189123123456789000000000000000", 0); + test_sh("00000000000000000123457189.123123456789000", 28, "1234571891231234567890000000000000000", 0); + test_sh("123", 1, "1230", 0); + test_sh("123", 10, "1230000000000", 0); + test_sh(".123", 1, "1.23", 0); + test_sh(".123", 10, "1230000000", 0); + test_sh(".123", 14, "12300000000000", 0); + test_sh("000.000", 1000, "0", 0); + test_sh("000.", 1000, "0", 0); + test_sh(".000", 1000, "0", 0); + test_sh("1", 1000, "1", 2); + test_sh("123.123", -1, "12.3123", 0); + test_sh("123987654321.123456789000", -1, "12398765432.1123456789", 0); + test_sh("123987654321.123456789000", -2, "1239876543.21123456789", 0); + test_sh("123987654321.123456789000", -3, "123987654.321123456789", 0); + test_sh("123987654321.123456789000", -8, "1239.87654321123456789", 0); + test_sh("123987654321.123456789000", -9, "123.987654321123456789", 0); + test_sh("123987654321.123456789000", -10, "12.3987654321123456789", 0); + test_sh("123987654321.123456789000", -11, "1.23987654321123456789", 0); + test_sh("123987654321.123456789000", -12, "0.123987654321123456789", 0); + test_sh("123987654321.123456789000", -13, "0.0123987654321123456789", 0); + test_sh("123987654321.123456789000", -14, "0.00123987654321123456789", 0); + test_sh("00000087654321.123456789000", -14, "0.00000087654321123456789", 0); + a.len= 2; + test_sh("123.123", -2, "1.23123", 0); + test_sh("123.123", -3, "0.123123", 0); + test_sh("123.123", -6, "0.000123123", 0); + test_sh("123.123", -7, "0.0000123123", 0); + test_sh("123.123", -15, "0.000000000000123123", 0); + test_sh("123.123", -16, "0.000000000000012312", 1); + test_sh("123.123", -17, "0.000000000000001231", 1); + test_sh("123.123", -18, "0.000000000000000123", 1); + test_sh("123.123", -19, "0.000000000000000012", 1); + test_sh("123.123", -20, "0.000000000000000001", 1); + test_sh("123.123", -21, "0", 1); + test_sh(".000000000123", -1, "0.0000000000123", 0); + test_sh(".000000000123", -6, "0.000000000000000123", 0); + test_sh(".000000000123", -7, "0.000000000000000012", 1); + test_sh(".000000000123", -8, "0.000000000000000001", 1); + test_sh(".000000000123", -9, "0", 1); + test_sh(".000000000123", 1, "0.00000000123", 0); + test_sh(".000000000123", 8, "0.0123", 0); + test_sh(".000000000123", 9, "0.123", 0); + test_sh(".000000000123", 10, "1.23", 0); + test_sh(".000000000123", 17, "12300000", 0); + test_sh(".000000000123", 18, "123000000", 0); + test_sh(".000000000123", 19, "1230000000", 0); + test_sh(".000000000123", 20, "12300000000", 0); + test_sh(".000000000123", 21, "123000000000", 0); + test_sh(".000000000123", 22, "1230000000000", 0); + test_sh(".000000000123", 23, "12300000000000", 0); + test_sh(".000000000123", 24, "123000000000000", 0); + test_sh(".000000000123", 25, "1230000000000000", 0); + test_sh(".000000000123", 26, "12300000000000000", 0); + test_sh(".000000000123", 27, "123000000000000000", 0); + test_sh(".000000000123", 28, "0.000000000123", 2); + test_sh("123456789.987654321", -1, "12345678.998765432", 1); + test_sh("123456789.987654321", -2, "1234567.899876543", 1); + test_sh("123456789.987654321", -8, "1.234567900", 1); + test_sh("123456789.987654321", -9, "0.123456789987654321", 0); + test_sh("123456789.987654321", -10, "0.012345678998765432", 1); + test_sh("123456789.987654321", -17, "0.000000001234567900", 1); + test_sh("123456789.987654321", -18, "0.000000000123456790", 1); + test_sh("123456789.987654321", -19, "0.000000000012345679", 1); + test_sh("123456789.987654321", -26, "0.000000000000000001", 1); + test_sh("123456789.987654321", -27, "0", 1); + test_sh("123456789.987654321", 1, "1234567900", 1); + test_sh("123456789.987654321", 2, "12345678999", 1); + test_sh("123456789.987654321", 4, "1234567899877", 1); + test_sh("123456789.987654321", 8, "12345678998765432", 1); + test_sh("123456789.987654321", 9, "123456789987654321", 0); + test_sh("123456789.987654321", 10, "123456789.987654321", 2); + test_sh("123456789.987654321", 0, "123456789.987654321", 0); + a.len= sizeof(buf1)/sizeof(dec1); + + printf("==== decimal_actual_fraction ====\n"); + test_fr("1.123456789000000000", "1.123456789"); + test_fr("1.12345678000000000", "1.12345678"); + test_fr("1.1234567000000000", "1.1234567"); + test_fr("1.123456000000000", "1.123456"); + test_fr("1.12345000000000", "1.12345"); + test_fr("1.1234000000000", "1.1234"); + test_fr("1.123000000000", "1.123"); + test_fr("1.12000000000", "1.12"); + test_fr("1.1000000000", "1.1"); + test_fr("1.000000000", "1"); + test_fr("1.0", "1"); + test_fr("10000000000000000000.0", "10000000000000000000"); + + return 0; +} +#endif diff --git a/externals/mysql/strings/do_ctype.c b/externals/mysql/strings/do_ctype.c new file mode 100644 index 00000000000..f33ddc5eb81 --- /dev/null +++ b/externals/mysql/strings/do_ctype.c @@ -0,0 +1,198 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Prints case-convert and sort-convert tabell on stdout. This is used to + make _ctype.c easyer */ + +#ifdef DBUG_OFF +#undef DBUG_OFF +#endif + +#include +#include +#include +#include "m_string.h" + +uchar NEAR to_upper[256]; +uchar NEAR to_lower[256],NEAR sort_order[256]; + +static int ascii_output=1; +static string tab_names[]={ "to_lower[]={","to_upper[]={","sort_order[]={" }; +static uchar* tabell[]= {to_lower,to_upper,sort_order}; + +void get_options(),init_case_convert(); + +main(argc,argv) +int argc; +char *argv[]; +{ + int i,j,ch; + DBUG_ENTER ("main"); + DBUG_PROCESS (argv[0]); + + get_options(&argc,&argv); + init_case_convert(); + puts("Tabells for caseconverts and sorttest of characters\n"); + for (i=0 ; i < 3 ; i++) + { + printf("uchar NEAR %s\n",tab_names[i]); + for (j=0 ; j <= 255 ; j++) + { + ch=(int) tabell[i][j]; + if (ascii_output && isprint(ch) && ! (ch & 128)) + { + if (strchr("\\'",(char) ch)) + printf("'\\%c', ",ch); + else + printf("'%c', ",ch); + } + else + printf("'\\%03o',",ch); + if ((j+1 & 7) == 0) + puts(""); + } + puts("};\n"); + } + DBUG_RETURN(0); +} /* main */ + + /* Read options */ + +void get_options(argc,argv) +register int *argc; +register char **argv[]; +{ + int help,version; + char *pos,*progname; + + progname= (*argv)[0]; + help=0; ascii_output=1; + while (--*argc >0 && *(pos = *(++*argv)) == '-' ) + { + while (*++pos) + { + version=0; + switch(*pos) { + case 'n': /* Numeric output */ + ascii_output=0; + break; + case '#': + DBUG_PUSH (++pos); + *(pos--) = '\0'; /* Skippa argument */ + break; + case 'V': + version=1; + case 'I': + case '?': + printf("%s Ver 1.0\n",progname); + if (version) + break; + puts("Output tabells of to_lower[], to_upper[] and sortorder[]\n"); + printf("Usage: %s [-n?I]\n",progname); + puts("Options: -? or -I \"Info\" -n \"numeric output\""); + break; + default: + fprintf(stderr,"illegal option: -%c\n",*pos); + break; + } + } + } + return; +} /* get_options */ + + + /* set up max character for which isupper() and toupper() gives */ + /* right answer. Is usually 127 or 255 */ + +#ifdef USE_INTERNAL_CTYPE +#define MAX_CHAR_OK CHAR_MAX /* All chars is right */ +#else +#define MAX_CHAR_OK 127 /* 7 Bit ascii */ +#endif + + /* Initiate arrays for case-conversation */ + +void init_case_convert() +{ + reg1 int16 i; + reg2 uchar *higher_pos,*lower_pos; + DBUG_ENTER("init_case_convert"); + + for (i=0 ; i <= MAX_CHAR_OK ; i++) + { + to_upper[i]= sort_order[i]= (islower(i) ? toupper(i) : (char) i); + to_lower[i]= (isupper(i) ? tolower(i) : (char) i); + } +#if MAX_CHAR_OK != 255 + for (i--; i++ < 255 ;) + to_upper[i]= sort_order[i]= to_lower[i]= (char) i; +#endif + +#ifdef MSDOS + higher_pos= (uchar *) "\217\216\231\232\220"; /* Extra chars to konv. */ + lower_pos= (uchar *) "\206\204\224\201\202"; +#else +#if defined(HPUX10) && ASCII_BITS_USED == 8 + higher_pos= (uchar *) "\xd0\xd8\xda\xdb\xdc\xd3"; + lower_pos= (uchar *) "\xd4\xcc\xce\xdf\xc9\xd7"; +#else +#ifdef USE_INTERNAL_CTYPE + higher_pos=lower_pos= (uchar* ) ""; /* System converts chars */ +#else +#if defined(DEC_MULTINATIONAL_CHAR) || defined(HP_MULTINATIONAL_CHAR) + higher_pos= (uchar *) "\305\304\326\311\334"; + lower_pos= (uchar *) "\345\344\366\351\374"; +#else + higher_pos= (uchar *) "[]\\@^"; + lower_pos= (uchar *) "{}|`~"; +#endif +#endif /* USE_INTERNAL_CTYPE */ +#endif /* HPUX10 */ +#endif /* MSDOS */ + + while (*higher_pos) + { + to_upper[ *lower_pos ] = sort_order[ *lower_pos ] = (char) *higher_pos; + to_lower[ *higher_pos++ ] = (char) *lower_pos++; + } + + /* sets upp sortorder; higer_pos character (upper and lower) is */ + /* changed to lower_pos character */ + +#ifdef MSDOS + higher_pos= (uchar *) "\217\216\231\232\220"; + lower_pos= (uchar *) "\216\217\231YE"; +#else +#if defined(HPUX10) && ASCII_BITS_USED == 8 + higher_pos= lower_pos= (uchar *) ""; /* Tecknen i r{tt ordning */ +#else +#ifdef USE_ISO_8859_1 /* As in USG5 ICL-386 */ + higher_pos= (uchar *) "\305\304\326\334\311"; + lower_pos= (uchar *) "\304\305\326YE"; +#else + higher_pos= (uchar *) "][\\~`"; /* R{tt ordning p} tecknen */ + lower_pos= (uchar *) "[\\]YE"; /* Ordning enligt ascii */ +#endif /* USE_ISO_8859_1 */ +#endif /* HPUX10 */ +#endif /* MSDOS */ + + while (*higher_pos) + { + sort_order[ *higher_pos ] = + sort_order[(uchar)to_lower[*higher_pos]] = *lower_pos; + higher_pos++; lower_pos++; + } + DBUG_VOID_RETURN; +} /* init_case_convert */ diff --git a/externals/mysql/strings/dtoa.c b/externals/mysql/strings/dtoa.c new file mode 100644 index 00000000000..07e6dfc7164 --- /dev/null +++ b/externals/mysql/strings/dtoa.c @@ -0,0 +1,2782 @@ +/* Copyright (C) 2007 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/**************************************************************** + + This file incorporates work covered by the following copyright and + permission notice: + + The author of this software is David M. Gay. + + Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + ***************************************************************/ + +#include /* for EOVERFLOW on Windows */ +#include +#include /* for memcpy and NOT_FIXED_DEC */ + +/** + Appears to suffice to not call malloc() in most cases. + @todo + see if it is possible to get rid of malloc(). + this constant is sufficient to avoid malloc() on all inputs I have tried. +*/ +#define DTOA_BUFF_SIZE (420 * sizeof(void *)) + +/* Magic value returned by dtoa() to indicate overflow */ +#define DTOA_OVERFLOW 9999 + +static double my_strtod_int(const char *, char **, int *, char *, size_t); +static char *dtoa(double, int, int, int *, int *, char **, char *, size_t); +static void dtoa_free(char *, char *, size_t); + +/** + @brief + Converts a given floating point number to a zero-terminated string + representation using the 'f' format. + + @details + This function is a wrapper around dtoa() to do the same as + sprintf(to, "%-.*f", precision, x), though the conversion is usually more + precise. The only difference is in handling [-,+]infinity and nan values, + in which case we print '0\0' to the output string and indicate an overflow. + + @param x the input floating point number. + @param precision the number of digits after the decimal point. + All properties of sprintf() apply: + - if the number of significant digits after the decimal + point is less than precision, the resulting string is + right-padded with zeros + - if the precision is 0, no decimal point appears + - if a decimal point appears, at least one digit appears + before it + @param to pointer to the output buffer. The longest string which + my_fcvt() can return is FLOATING_POINT_BUFFER bytes + (including the terminating '\0'). + @param error if not NULL, points to a location where the status of + conversion is stored upon return. + FALSE successful conversion + TRUE the input number is [-,+]infinity or nan. + The output string in this case is always '0'. + @return number of written characters (excluding terminating '\0') +*/ + +size_t my_fcvt(double x, int precision, char *to, my_bool *error) +{ + int decpt, sign, len, i; + char *res, *src, *end, *dst= to; + char buf[DTOA_BUFF_SIZE]; + DBUG_ASSERT(precision >= 0 && precision < NOT_FIXED_DEC && to != NULL); + + res= dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf)); + + if (decpt == DTOA_OVERFLOW) + { + dtoa_free(res, buf, sizeof(buf)); + *to++= '0'; + *to= '\0'; + if (error != NULL) + *error= TRUE; + return 1; + } + + src= res; + len= end - src; + + if (sign) + *dst++= '-'; + + if (decpt <= 0) + { + *dst++= '0'; + *dst++= '.'; + for (i= decpt; i < 0; i++) + *dst++= '0'; + } + + for (i= 1; i <= len; i++) + { + *dst++= *src++; + if (i == decpt && i < len) + *dst++= '.'; + } + while (i++ <= decpt) + *dst++= '0'; + + if (precision > 0) + { + if (len <= decpt) + *dst++= '.'; + + for (i= precision - max(0, (len - decpt)); i > 0; i--) + *dst++= '0'; + } + + *dst= '\0'; + if (error != NULL) + *error= FALSE; + + dtoa_free(res, buf, sizeof(buf)); + + return dst - to; +} + +/** + @brief + Converts a given floating point number to a zero-terminated string + representation with a given field width using the 'e' format + (aka scientific notation) or the 'f' one. + + @details + The format is chosen automatically to provide the most number of significant + digits (and thus, precision) with a given field width. In many cases, the + result is similar to that of sprintf(to, "%g", x) with a few notable + differences: + - the conversion is usually more precise than C library functions. + - there is no 'precision' argument. instead, we specify the number of + characters available for conversion (i.e. a field width). + - the result never exceeds the specified field width. If the field is too + short to contain even a rounded decimal representation, my_gcvt() + indicates overflow and truncates the output string to the specified width. + - float-type arguments are handled differently than double ones. For a + float input number (i.e. when the 'type' argument is MY_GCVT_ARG_FLOAT) + we deliberately limit the precision of conversion by FLT_DIG digits to + avoid garbage past the significant digits. + - unlike sprintf(), in cases where the 'e' format is preferred, we don't + zero-pad the exponent to save space for significant digits. The '+' sign + for a positive exponent does not appear for the same reason. + + @param x the input floating point number. + @param type is either MY_GCVT_ARG_FLOAT or MY_GCVT_ARG_DOUBLE. + Specifies the type of the input number (see notes above). + @param width field width in characters. The minimal field width to + hold any number representation (albeit rounded) is 7 + characters ("-Ne-NNN"). + @param to pointer to the output buffer. The result is always + zero-terminated, and the longest returned string is thus + 'width + 1' bytes. + @param error if not NULL, points to a location where the status of + conversion is stored upon return. + FALSE successful conversion + TRUE the input number is [-,+]infinity or nan. + The output string in this case is always '0'. + @return number of written characters (excluding terminating '\0') + + @todo + Check if it is possible and makes sense to do our own rounding on top of + dtoa() instead of calling dtoa() twice in (rare) cases when the resulting + string representation does not fit in the specified field width and we want + to re-round the input number with fewer significant digits. Examples: + + my_gcvt(-9e-3, ..., 4, ...); + my_gcvt(-9e-3, ..., 2, ...); + my_gcvt(1.87e-3, ..., 4, ...); + my_gcvt(55, ..., 1, ...); + + We do our best to minimize such cases by: + + - passing to dtoa() the field width as the number of significant digits + + - removing the sign of the number early (and decreasing the width before + passing it to dtoa()) + + - choosing the proper format to preserve the most number of significant + digits. +*/ + +size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, + my_bool *error) +{ + int decpt, sign, len, exp_len; + char *res, *src, *end, *dst= to, *dend= dst + width; + char buf[DTOA_BUFF_SIZE]; + my_bool have_space, force_e_format; + DBUG_ASSERT(width > 0 && to != NULL); + + /* We want to remove '-' from equations early */ + if (x < 0.) + width--; + + res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : min(width, FLT_DIG), + &decpt, &sign, &end, buf, sizeof(buf)); + if (decpt == DTOA_OVERFLOW) + { + dtoa_free(res, buf, sizeof(buf)); + *to++= '0'; + *to= '\0'; + if (error != NULL) + *error= TRUE; + return 1; + } + + if (error != NULL) + *error= FALSE; + + src= res; + len= end - res; + + /* + Number of digits in the exponent from the 'e' conversion. + The sign of the exponent is taken into account separetely, we don't need + to count it here. + */ + exp_len= 1 + (decpt >= 101 || decpt <= -99) + (decpt >= 11 || decpt <= -9); + + /* + Do we have enough space for all digits in the 'f' format? + Let 'len' be the number of significant digits returned by dtoa, + and F be the length of the resulting decimal representation. + Consider the following cases: + 1. decpt <= 0, i.e. we have "0.NNN" => F = len - decpt + 2 + 2. 0 < decpt < len, i.e. we have "NNN.NNN" => F = len + 1 + 3. len <= decpt, i.e. we have "NNN00" => F = decpt + */ + have_space= (decpt <= 0 ? len - decpt + 2 : + decpt > 0 && decpt < len ? len + 1 : + decpt) <= width; + /* + The following is true when no significant digits can be placed with the + specified field width using the 'f' format, and the 'e' format + will not be truncated. + */ + force_e_format= (decpt <= 0 && width <= 2 - decpt && width >= 3 + exp_len); + /* + Assume that we don't have enough space to place all significant digits in + the 'f' format. We have to choose between the 'e' format and the 'f' one + to keep as many significant digits as possible. + Let E and F be the lengths of decimal representaion in the 'e' and 'f' + formats, respectively. We want to use the 'f' format if, and only if F <= E. + Consider the following cases: + 1. decpt <= 0. + F = len - decpt + 2 (see above) + E = len + (len > 1) + 1 + 1 (decpt <= -99) + (decpt <= -9) + 1 + ("N.NNe-MMM") + (F <= E) <=> (len == 1 && decpt >= -1) || (len > 1 && decpt >= -2) + We also need to ensure that if the 'f' format is chosen, + the field width allows us to place at least one significant digit + (i.e. width > 2 - decpt). If not, we prefer the 'e' format. + 2. 0 < decpt < len + F = len + 1 (see above) + E = len + 1 + 1 + ... ("N.NNeMMM") + F is always less than E. + 3. len <= decpt <= width + In this case we have enough space to represent the number in the 'f' + format, so we prefer it with some exceptions. + 4. width < decpt + The number cannot be represented in the 'f' format at all, always use + the 'e' 'one. + */ + if ((have_space || + /* + Not enough space, let's see if the 'f' format provides the most number + of significant digits. + */ + ((decpt <= width && (decpt >= -1 || (decpt == -2 && + (len > 1 || !force_e_format)))) && + !force_e_format)) && + + /* + Use the 'e' format in some cases even if we have enough space for the + 'f' one. See comment for MAX_DECPT_FOR_F_FORMAT. + */ + (!have_space || (decpt >= -MAX_DECPT_FOR_F_FORMAT + 1 && + (decpt <= MAX_DECPT_FOR_F_FORMAT || len > decpt)))) + { + /* 'f' format */ + int i; + + width-= (decpt < len) + (decpt <= 0 ? 1 - decpt : 0); + + /* Do we have to truncate any digits? */ + if (width < len) + { + if (width < decpt) + { + if (error != NULL) + *error= TRUE; + width= decpt; + } + + /* + We want to truncate (len - width) least significant digits after the + decimal point. For this we are calling dtoa with mode=5, passing the + number of significant digits = (len-decpt) - (len-width) = width-decpt + */ + dtoa_free(res, buf, sizeof(buf)); + res= dtoa(x, 5, width - decpt, &decpt, &sign, &end, buf, sizeof(buf)); + src= res; + len= end - res; + } + + if (len == 0) + { + /* Underflow. Just print '0' and exit */ + *dst++= '0'; + goto end; + } + + /* + At this point we are sure we have enough space to put all digits + returned by dtoa + */ + if (sign && dst < dend) + *dst++= '-'; + if (decpt <= 0) + { + if (dst < dend) + *dst++= '0'; + if (len > 0 && dst < dend) + *dst++= '.'; + for (; decpt < 0 && dst < dend; decpt++) + *dst++= '0'; + } + + for (i= 1; i <= len && dst < dend; i++) + { + *dst++= *src++; + if (i == decpt && i < len && dst < dend) + *dst++= '.'; + } + while (i++ <= decpt && dst < dend) + *dst++= '0'; + } + else + { + /* 'e' format */ + int decpt_sign= 0; + + if (--decpt < 0) + { + decpt= -decpt; + width--; + decpt_sign= 1; + } + width-= 1 + exp_len; /* eNNN */ + + if (len > 1) + width--; + + if (width <= 0) + { + /* Overflow */ + if (error != NULL) + *error= TRUE; + width= 0; + } + + /* Do we have to truncate any digits? */ + if (width < len) + { + /* Yes, re-convert with a smaller width */ + dtoa_free(res, buf, sizeof(buf)); + res= dtoa(x, 4, width, &decpt, &sign, &end, buf, sizeof(buf)); + src= res; + len= end - res; + if (--decpt < 0) + decpt= -decpt; + } + /* + At this point we are sure we have enough space to put all digits + returned by dtoa + */ + if (sign && dst < dend) + *dst++= '-'; + if (dst < dend) + *dst++= *src++; + if (len > 1 && dst < dend) + { + *dst++= '.'; + while (src < end && dst < dend) + *dst++= *src++; + } + if (dst < dend) + *dst++= 'e'; + if (decpt_sign && dst < dend) + *dst++= '-'; + + if (decpt >= 100 && dst < dend) + { + *dst++= decpt / 100 + '0'; + decpt%= 100; + if (dst < dend) + *dst++= decpt / 10 + '0'; + } + else if (decpt >= 10 && dst < dend) + *dst++= decpt / 10 + '0'; + if (dst < dend) + *dst++= decpt % 10 + '0'; + + } + +end: + dtoa_free(res, buf, sizeof(buf)); + *dst= '\0'; + + return dst - to; +} + +/** + @brief + Converts string to double (string does not have to be zero-terminated) + + @details + This is a wrapper around dtoa's version of strtod(). + + @param str input string + @param end address of a pointer to the first character after the input + string. Upon return the pointer is set to point to the first + rejected character. + @param error Upon return is set to EOVERFLOW in case of underflow or + overflow. + + @return The resulting double value. In case of underflow, 0.0 is + returned. In case overflow, signed DBL_MAX is returned. +*/ + +double my_strtod(const char *str, char **end, int *error) +{ + char buf[DTOA_BUFF_SIZE]; + double res; + DBUG_ASSERT(str != NULL && end != NULL && *end != NULL && error != NULL); + + res= my_strtod_int(str, end, error, buf, sizeof(buf)); + return (*error == 0) ? res : (res < 0 ? -DBL_MAX : DBL_MAX); +} + + +double my_atof(const char *nptr) +{ + int error; + const char *end= nptr+65535; /* Should be enough */ + return (my_strtod(nptr, (char**) &end, &error)); +} + + +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ +/* Please send bug reports to David M. Gay (dmg at acm dot org, + * with " at " changed at "@" and " dot " changed to "."). */ + +/* + Original copy of the software is located at http://www.netlib.org/fp/dtoa.c + It was adjusted to serve MySQL server needs: + * strtod() was modified to not expect a zero-terminated string. + It now honors 'se' (end of string) argument as the input parameter, + not just as the output one. + * in dtoa(), in case of overflow/underflow/NaN result string now contains "0"; + decpt is set to DTOA_OVERFLOW to indicate overflow. + * support for VAX, IBM mainframe and 16-bit hardware removed + * we always assume that 64-bit integer type is available + * support for Kernigan-Ritchie style headers (pre-ANSI compilers) + removed + * all gcc warnings ironed out + * we always assume multithreaded environment, so we had to change + memory allocation procedures to use stack in most cases; + malloc is used as the last resort. + * pow5mult rewritten to use pre-calculated pow5 list instead of + the one generated on the fly. +*/ + + +/* + On a machine with IEEE extended-precision registers, it is + necessary to specify double-precision (53-bit) rounding precision + before invoking strtod or dtoa. If the machine uses (the equivalent + of) Intel 80x87 arithmetic, the call + _control87(PC_53, MCW_PC); + does this with many compilers. Whether this or another call is + appropriate depends on the compiler; for this to work, it may be + necessary to #include "float.h" or another system-dependent header + file. +*/ + +/* + #define Honor_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 + and dtoa should round accordingly. + #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3 + and Honor_FLT_ROUNDS is not #defined. + + TODO: check if we can get rid of the above two +*/ + +typedef int32 Long; +typedef uint32 ULong; +typedef int64 LLong; +typedef uint64 ULLong; + +typedef union { double d; ULong L[2]; } U; + +#if defined(WORDS_BIGENDIAN) || (defined(__FLOAT_WORD_ORDER) && \ + (__FLOAT_WORD_ORDER == __BIG_ENDIAN)) +#define word0(x) ((U*)&x)->L[0] +#define word1(x) ((U*)&x)->L[1] +#else +#define word0(x) ((U*)&x)->L[1] +#define word1(x) ((U*)&x)->L[0] +#endif + +#define dval(x) ((U*)&x)->d + +/* #define P DBL_MANT_DIG */ +/* Ten_pmax= floor(P*log(2)/log(5)) */ +/* Bletch= (highest power of 2 < DBL_MAX_10_EXP) / 16 */ +/* Quick_max= floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ +/* Int_max= floor(P*log(FLT_RADIX)/log(10) - 1) */ + +#define Exp_shift 20 +#define Exp_shift1 20 +#define Exp_msk1 0x100000 +#define Exp_mask 0x7ff00000 +#define P 53 +#define Bias 1023 +#define Emin (-1022) +#define Exp_1 0x3ff00000 +#define Exp_11 0x3ff00000 +#define Ebits 11 +#define Frac_mask 0xfffff +#define Frac_mask1 0xfffff +#define Ten_pmax 22 +#define Bletch 0x10 +#define Bndry_mask 0xfffff +#define Bndry_mask1 0xfffff +#define LSB 1 +#define Sign_bit 0x80000000 +#define Log2P 1 +#define Tiny1 1 +#define Quick_max 14 +#define Int_max 14 + +#ifndef Flt_Rounds +#ifdef FLT_ROUNDS +#define Flt_Rounds FLT_ROUNDS +#else +#define Flt_Rounds 1 +#endif +#endif /*Flt_Rounds*/ + +#ifdef Honor_FLT_ROUNDS +#define Rounding rounding +#undef Check_FLT_ROUNDS +#define Check_FLT_ROUNDS +#else +#define Rounding Flt_Rounds +#endif + +#define rounded_product(a,b) a*= b +#define rounded_quotient(a,b) a/= b + +#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) +#define Big1 0xffffffff +#define FFFFFFFF 0xffffffffUL + +/* This is tested to be enough for dtoa */ + +#define Kmax 15 + +#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ + 2*sizeof(int) + y->wds*sizeof(ULong)) + +/* Arbitrary-length integer */ + +typedef struct Bigint +{ + union { + ULong *x; /* points right after this Bigint object */ + struct Bigint *next; /* to maintain free lists */ + } p; + int k; /* 2^k = maxwds */ + int maxwds; /* maximum length in 32-bit words */ + int sign; /* not zero if number is negative */ + int wds; /* current length in 32-bit words */ +} Bigint; + + +/* A simple stack-memory based allocator for Bigints */ + +typedef struct Stack_alloc +{ + char *begin; + char *free; + char *end; + /* + Having list of free blocks lets us reduce maximum required amount + of memory from ~4000 bytes to < 1680 (tested on x86). + */ + Bigint *freelist[Kmax+1]; +} Stack_alloc; + + +/* + Try to allocate object on stack, and resort to malloc if all + stack memory is used. Ensure allocated objects to be aligned by the pointer + size in order to not break the alignment rules when storing a pointer to a + Bigint. +*/ + +static Bigint *Balloc(int k, Stack_alloc *alloc) +{ + Bigint *rv; + if (k <= Kmax && alloc->freelist[k]) + { + rv= alloc->freelist[k]; + alloc->freelist[k]= rv->p.next; + } + else + { + int x, len; + + x= 1 << k; + len= MY_ALIGN(sizeof(Bigint) + x * sizeof(ULong), SIZEOF_CHARP); + + if (alloc->free + len <= alloc->end) + { + rv= (Bigint*) alloc->free; + alloc->free+= len; + } + else + rv= (Bigint*) malloc(len); + + rv->k= k; + rv->maxwds= x; + } + rv->sign= rv->wds= 0; + rv->p.x= (ULong*) (rv + 1); + return rv; +} + + +/* + If object was allocated on stack, try putting it to the free + list. Otherwise call free(). +*/ + +static void Bfree(Bigint *v, Stack_alloc *alloc) +{ + char *gptr= (char*) v; /* generic pointer */ + if (gptr < alloc->begin || gptr >= alloc->end) + free(gptr); + else if (v->k <= Kmax) + { + /* + Maintain free lists only for stack objects: this way we don't + have to bother with freeing lists in the end of dtoa; + heap should not be used normally anyway. + */ + v->p.next= alloc->freelist[v->k]; + alloc->freelist[v->k]= v; + } +} + + +/* + This is to place return value of dtoa in: tries to use stack + as well, but passes by free lists management and just aligns len by + the pointer size in order to not break the alignment rules when storing a + pointer to a Bigint. +*/ + +static char *dtoa_alloc(int i, Stack_alloc *alloc) +{ + char *rv; + int aligned_size= MY_ALIGN(i, SIZEOF_CHARP); + if (alloc->free + aligned_size <= alloc->end) + { + rv= alloc->free; + alloc->free+= aligned_size; + } + else + rv= malloc(i); + return rv; +} + + +/* + dtoa_free() must be used to free values s returned by dtoa() + This is the counterpart of dtoa_alloc() +*/ + +static void dtoa_free(char *gptr, char *buf, size_t buf_size) +{ + if (gptr < buf || gptr >= buf + buf_size) + free(gptr); +} + + +/* Bigint arithmetic functions */ + +/* Multiply by m and add a */ + +static Bigint *multadd(Bigint *b, int m, int a, Stack_alloc *alloc) +{ + int i, wds; + ULong *x; + ULLong carry, y; + Bigint *b1; + + wds= b->wds; + x= b->p.x; + i= 0; + carry= a; + do + { + y= *x * (ULLong)m + carry; + carry= y >> 32; + *x++= (ULong)(y & FFFFFFFF); + } + while (++i < wds); + if (carry) + { + if (wds >= b->maxwds) + { + b1= Balloc(b->k+1, alloc); + Bcopy(b1, b); + Bfree(b, alloc); + b= b1; + } + b->p.x[wds++]= (ULong) carry; + b->wds= wds; + } + return b; +} + + +static Bigint *s2b(const char *s, int nd0, int nd, ULong y9, Stack_alloc *alloc) +{ + Bigint *b; + int i, k; + Long x, y; + + x= (nd + 8) / 9; + for (k= 0, y= 1; x > y; y <<= 1, k++) ; + b= Balloc(k, alloc); + b->p.x[0]= y9; + b->wds= 1; + + i= 9; + if (9 < nd0) + { + s+= 9; + do + b= multadd(b, 10, *s++ - '0', alloc); + while (++i < nd0); + s++; + } + else + s+= 10; + for(; i < nd; i++) + b= multadd(b, 10, *s++ - '0', alloc); + return b; +} + + +static int hi0bits(register ULong x) +{ + register int k= 0; + + if (!(x & 0xffff0000)) + { + k= 16; + x<<= 16; + } + if (!(x & 0xff000000)) + { + k+= 8; + x<<= 8; + } + if (!(x & 0xf0000000)) + { + k+= 4; + x<<= 4; + } + if (!(x & 0xc0000000)) + { + k+= 2; + x<<= 2; + } + if (!(x & 0x80000000)) + { + k++; + if (!(x & 0x40000000)) + return 32; + } + return k; +} + + +static int lo0bits(ULong *y) +{ + register int k; + register ULong x= *y; + + if (x & 7) + { + if (x & 1) + return 0; + if (x & 2) + { + *y= x >> 1; + return 1; + } + *y= x >> 2; + return 2; + } + k= 0; + if (!(x & 0xffff)) + { + k= 16; + x>>= 16; + } + if (!(x & 0xff)) + { + k+= 8; + x>>= 8; + } + if (!(x & 0xf)) + { + k+= 4; + x>>= 4; + } + if (!(x & 0x3)) + { + k+= 2; + x>>= 2; + } + if (!(x & 1)) + { + k++; + x>>= 1; + if (!x) + return 32; + } + *y= x; + return k; +} + + +/* Convert integer to Bigint number */ + +static Bigint *i2b(int i, Stack_alloc *alloc) +{ + Bigint *b; + + b= Balloc(1, alloc); + b->p.x[0]= i; + b->wds= 1; + return b; +} + + +/* Multiply two Bigint numbers */ + +static Bigint *mult(Bigint *a, Bigint *b, Stack_alloc *alloc) +{ + Bigint *c; + int k, wa, wb, wc; + ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; + ULong y; + ULLong carry, z; + + if (a->wds < b->wds) + { + c= a; + a= b; + b= c; + } + k= a->k; + wa= a->wds; + wb= b->wds; + wc= wa + wb; + if (wc > a->maxwds) + k++; + c= Balloc(k, alloc); + for (x= c->p.x, xa= x + wc; x < xa; x++) + *x= 0; + xa= a->p.x; + xae= xa + wa; + xb= b->p.x; + xbe= xb + wb; + xc0= c->p.x; + for (; xb < xbe; xc0++) + { + if ((y= *xb++)) + { + x= xa; + xc= xc0; + carry= 0; + do + { + z= *x++ * (ULLong)y + *xc + carry; + carry= z >> 32; + *xc++= (ULong) (z & FFFFFFFF); + } + while (x < xae); + *xc= (ULong) carry; + } + } + for (xc0= c->p.x, xc= xc0 + wc; wc > 0 && !*--xc; --wc) ; + c->wds= wc; + return c; +} + + +/* + Precalculated array of powers of 5: tested to be enough for + vasting majority of dtoa_r cases. +*/ + +static ULong powers5[]= +{ + 625UL, + + 390625UL, + + 2264035265UL, 35UL, + + 2242703233UL, 762134875UL, 1262UL, + + 3211403009UL, 1849224548UL, 3668416493UL, 3913284084UL, 1593091UL, + + 781532673UL, 64985353UL, 253049085UL, 594863151UL, 3553621484UL, + 3288652808UL, 3167596762UL, 2788392729UL, 3911132675UL, 590UL, + + 2553183233UL, 3201533787UL, 3638140786UL, 303378311UL, 1809731782UL, + 3477761648UL, 3583367183UL, 649228654UL, 2915460784UL, 487929380UL, + 1011012442UL, 1677677582UL, 3428152256UL, 1710878487UL, 1438394610UL, + 2161952759UL, 4100910556UL, 1608314830UL, 349175UL +}; + + +static Bigint p5_a[]= +{ + /* { x } - k - maxwds - sign - wds */ + { { powers5 }, 1, 1, 0, 1 }, + { { powers5 + 1 }, 1, 1, 0, 1 }, + { { powers5 + 2 }, 1, 2, 0, 2 }, + { { powers5 + 4 }, 2, 3, 0, 3 }, + { { powers5 + 7 }, 3, 5, 0, 5 }, + { { powers5 + 12 }, 4, 10, 0, 10 }, + { { powers5 + 22 }, 5, 19, 0, 19 } +}; + +#define P5A_MAX (sizeof(p5_a)/sizeof(*p5_a) - 1) + +static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc) +{ + Bigint *b1, *p5, *p51; + int i; + static int p05[3]= { 5, 25, 125 }; + + if ((i= k & 3)) + b= multadd(b, p05[i-1], 0, alloc); + + if (!(k>>= 2)) + return b; + p5= p5_a; + for (;;) + { + if (k & 1) + { + b1= mult(b, p5, alloc); + Bfree(b, alloc); + b= b1; + } + if (!(k>>= 1)) + break; + /* Calculate next power of 5 */ + if (p5 < p5_a + P5A_MAX) + ++p5; + else if (p5 == p5_a + P5A_MAX) + p5= mult(p5, p5, alloc); + else + { + p51= mult(p5, p5, alloc); + Bfree(p5, alloc); + p5= p51; + } + } + return b; +} + + +static Bigint *lshift(Bigint *b, int k, Stack_alloc *alloc) +{ + int i, k1, n, n1; + Bigint *b1; + ULong *x, *x1, *xe, z; + + n= k >> 5; + k1= b->k; + n1= n + b->wds + 1; + for (i= b->maxwds; n1 > i; i<<= 1) + k1++; + b1= Balloc(k1, alloc); + x1= b1->p.x; + for (i= 0; i < n; i++) + *x1++= 0; + x= b->p.x; + xe= x + b->wds; + if (k&= 0x1f) + { + k1= 32 - k; + z= 0; + do + { + *x1++= *x << k | z; + z= *x++ >> k1; + } + while (x < xe); + if ((*x1= z)) + ++n1; + } + else + do + *x1++= *x++; + while (x < xe); + b1->wds= n1 - 1; + Bfree(b, alloc); + return b1; +} + + +static int cmp(Bigint *a, Bigint *b) +{ + ULong *xa, *xa0, *xb, *xb0; + int i, j; + + i= a->wds; + j= b->wds; + if (i-= j) + return i; + xa0= a->p.x; + xa= xa0 + j; + xb0= b->p.x; + xb= xb0 + j; + for (;;) + { + if (*--xa != *--xb) + return *xa < *xb ? -1 : 1; + if (xa <= xa0) + break; + } + return 0; +} + + +static Bigint *diff(Bigint *a, Bigint *b, Stack_alloc *alloc) +{ + Bigint *c; + int i, wa, wb; + ULong *xa, *xae, *xb, *xbe, *xc; + ULLong borrow, y; + + i= cmp(a,b); + if (!i) + { + c= Balloc(0, alloc); + c->wds= 1; + c->p.x[0]= 0; + return c; + } + if (i < 0) + { + c= a; + a= b; + b= c; + i= 1; + } + else + i= 0; + c= Balloc(a->k, alloc); + c->sign= i; + wa= a->wds; + xa= a->p.x; + xae= xa + wa; + wb= b->wds; + xb= b->p.x; + xbe= xb + wb; + xc= c->p.x; + borrow= 0; + do + { + y= (ULLong)*xa++ - *xb++ - borrow; + borrow= y >> 32 & (ULong)1; + *xc++= (ULong) (y & FFFFFFFF); + } + while (xb < xbe); + while (xa < xae) + { + y= *xa++ - borrow; + borrow= y >> 32 & (ULong)1; + *xc++= (ULong) (y & FFFFFFFF); + } + while (!*--xc) + wa--; + c->wds= wa; + return c; +} + + +static double ulp(double x) +{ + register Long L; + double a; + + L= (word0(x) & Exp_mask) - (P - 1)*Exp_msk1; + word0(a) = L; + word1(a) = 0; + return dval(a); +} + + +static double b2d(Bigint *a, int *e) +{ + ULong *xa, *xa0, w, y, z; + int k; + double d; +#define d0 word0(d) +#define d1 word1(d) + + xa0= a->p.x; + xa= xa0 + a->wds; + y= *--xa; + k= hi0bits(y); + *e= 32 - k; + if (k < Ebits) + { + d0= Exp_1 | y >> (Ebits - k); + w= xa > xa0 ? *--xa : 0; + d1= y << ((32-Ebits) + k) | w >> (Ebits - k); + goto ret_d; + } + z= xa > xa0 ? *--xa : 0; + if (k-= Ebits) + { + d0= Exp_1 | y << k | z >> (32 - k); + y= xa > xa0 ? *--xa : 0; + d1= z << k | y >> (32 - k); + } + else + { + d0= Exp_1 | y; + d1= z; + } + ret_d: +#undef d0 +#undef d1 + return dval(d); +} + + +static Bigint *d2b(double d, int *e, int *bits, Stack_alloc *alloc) +{ + Bigint *b; + int de, k; + ULong *x, y, z; + int i; +#define d0 word0(d) +#define d1 word1(d) + + b= Balloc(1, alloc); + x= b->p.x; + + z= d0 & Frac_mask; + d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ + if ((de= (int)(d0 >> Exp_shift))) + z|= Exp_msk1; + if ((y= d1)) + { + if ((k= lo0bits(&y))) + { + x[0]= y | z << (32 - k); + z>>= k; + } + else + x[0]= y; + i= b->wds= (x[1]= z) ? 2 : 1; + } + else + { + k= lo0bits(&z); + x[0]= z; + i= b->wds= 1; + k+= 32; + } + if (de) + { + *e= de - Bias - (P-1) + k; + *bits= P - k; + } + else + { + *e= de - Bias - (P-1) + 1 + k; + *bits= 32*i - hi0bits(x[i-1]); + } + return b; +#undef d0 +#undef d1 +} + + +static double ratio(Bigint *a, Bigint *b) +{ + double da, db; + int k, ka, kb; + + dval(da)= b2d(a, &ka); + dval(db)= b2d(b, &kb); + k= ka - kb + 32*(a->wds - b->wds); + if (k > 0) + word0(da)+= k*Exp_msk1; + else + { + k= -k; + word0(db)+= k*Exp_msk1; + } + return dval(da) / dval(db); +} + +static const double tens[] = +{ + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + 1e20, 1e21, 1e22 +}; + +static const double bigtens[]= { 1e16, 1e32, 1e64, 1e128, 1e256 }; +static const double tinytens[]= +{ 1e-16, 1e-32, 1e-64, 1e-128, + 9007199254740992.*9007199254740992.e-256 /* = 2^106 * 1e-53 */ +}; +/* + The factor of 2^53 in tinytens[4] helps us avoid setting the underflow + flag unnecessarily. It leads to a song and dance at the end of strtod. +*/ +#define Scale_Bit 0x10 +#define n_bigtens 5 + +/* + strtod for IEEE--arithmetic machines. + + This strtod returns a nearest machine number to the input decimal + string (or sets errno to EOVERFLOW). Ties are broken by the IEEE round-even + rule. + + Inspired loosely by William D. Clinger's paper "How to Read Floating + Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. + + Modifications: + + 1. We only require IEEE (not IEEE double-extended). + 2. We get by with floating-point arithmetic in a case that + Clinger missed -- when we're computing d * 10^n + for a small integer d and the integer n is not too + much larger than 22 (the maximum integer k for which + we can represent 10^k exactly), we may be able to + compute (d*10^k) * 10^(e-k) with just one roundoff. + 3. Rather than a bit-at-a-time adjustment of the binary + result in the hard case, we use floating-point + arithmetic to determine the adjustment to within + one bit; only in really hard cases do we need to + compute a second residual. + 4. Because of 3., we don't need a large table of powers of 10 + for ten-to-e (just some small tables, e.g. of 10^k + for 0 <= k <= 22). +*/ + +static double my_strtod_int(const char *s00, char **se, int *error, char *buf, size_t buf_size) +{ + int scale; + int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, + e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; + const char *s, *s0, *s1, *end = *se; + double aadj, aadj1, adj, rv, rv0; + Long L; + ULong y, z; + Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; +#ifdef SET_INEXACT + int inexact, oldinexact; +#endif +#ifdef Honor_FLT_ROUNDS + int rounding; +#endif + Stack_alloc alloc; + LINT_INIT(c); + + *error= 0; + + alloc.begin= alloc.free= buf; + alloc.end= buf + buf_size; + memset(alloc.freelist, 0, sizeof(alloc.freelist)); + + sign= nz0= nz= 0; + dval(rv)= 0.; + for (s= s00; s < end; s++) + switch (*s) { + case '-': + sign= 1; + /* no break */ + case '+': + s++; + goto break2; + case '\t': + case '\n': + case '\v': + case '\f': + case '\r': + case ' ': + continue; + default: + goto break2; + } + break2: + if (s >= end) + goto ret0; + + if (*s == '0') + { + nz0= 1; + while (++s < end && *s == '0') ; + if (s >= end) + goto ret; + } + s0= s; + y= z= 0; + for (nd= nf= 0; s < end && (c= *s) >= '0' && c <= '9'; nd++, s++) + if (nd < 9) + y= 10*y + c - '0'; + else if (nd < 16) + z= 10*z + c - '0'; + nd0= nd; + if (s < end - 1 && c == '.') + { + c= *++s; + if (!nd) + { + for (; s < end && c == '0'; c= *++s) + nz++; + if (s < end && c > '0' && c <= '9') + { + s0= s; + nf+= nz; + nz= 0; + goto have_dig; + } + goto dig_done; + } + for (; s < end && c >= '0' && c <= '9'; c = *++s) + { + have_dig: + nz++; + if (c-= '0') + { + nf+= nz; + for (i= 1; i < nz; i++) + if (nd++ < 9) + y*= 10; + else if (nd <= DBL_DIG + 1) + z*= 10; + if (nd++ < 9) + y= 10*y + c; + else if (nd <= DBL_DIG + 1) + z= 10*z + c; + nz= 0; + } + } + } + dig_done: + e= 0; + if (s < end && (c == 'e' || c == 'E')) + { + if (!nd && !nz && !nz0) + goto ret0; + s00= s; + esign= 0; + if (++s < end) + switch (c= *s) { + case '-': + esign= 1; + case '+': + c= *++s; + } + if (s < end && c >= '0' && c <= '9') + { + while (s < end && c == '0') + c= *++s; + if (s < end && c > '0' && c <= '9') { + L= c - '0'; + s1= s; + while (++s < end && (c= *s) >= '0' && c <= '9') + L= 10*L + c - '0'; + if (s - s1 > 8 || L > 19999) + /* Avoid confusion from exponents + * so large that e might overflow. + */ + e= 19999; /* safe for 16 bit ints */ + else + e= (int)L; + if (esign) + e= -e; + } + else + e= 0; + } + else + s= s00; + } + if (!nd) + { + if (!nz && !nz0) + { + ret0: + s= s00; + sign= 0; + } + goto ret; + } + e1= e -= nf; + + /* + Now we have nd0 digits, starting at s0, followed by a + decimal point, followed by nd-nd0 digits. The number we're + after is the integer represented by those digits times + 10**e + */ + + if (!nd0) + nd0= nd; + k= nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; + dval(rv)= y; + if (k > 9) + { +#ifdef SET_INEXACT + if (k > DBL_DIG) + oldinexact = get_inexact(); +#endif + dval(rv)= tens[k - 9] * dval(rv) + z; + } + bd0= 0; + if (nd <= DBL_DIG +#ifndef Honor_FLT_ROUNDS + && Flt_Rounds == 1 +#endif + ) + { + if (!e) + goto ret; + if (e > 0) + { + if (e <= Ten_pmax) + { +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) + { + rv= -rv; + sign= 0; + } +#endif + /* rv = */ rounded_product(dval(rv), tens[e]); + goto ret; + } + i= DBL_DIG - nd; + if (e <= Ten_pmax + i) + { + /* + A fancier test would sometimes let us do + this for larger i values. + */ +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) + { + rv= -rv; + sign= 0; + } +#endif + e-= i; + dval(rv)*= tens[i]; + /* rv = */ rounded_product(dval(rv), tens[e]); + goto ret; + } + } +#ifndef Inaccurate_Divide + else if (e >= -Ten_pmax) + { +#ifdef Honor_FLT_ROUNDS + /* round correctly FLT_ROUNDS = 2 or 3 */ + if (sign) + { + rv= -rv; + sign= 0; + } +#endif + /* rv = */ rounded_quotient(dval(rv), tens[-e]); + goto ret; + } +#endif + } + e1+= nd - k; + +#ifdef SET_INEXACT + inexact= 1; + if (k <= DBL_DIG) + oldinexact= get_inexact(); +#endif + scale= 0; +#ifdef Honor_FLT_ROUNDS + if ((rounding= Flt_Rounds) >= 2) + { + if (sign) + rounding= rounding == 2 ? 0 : 2; + else + if (rounding != 2) + rounding= 0; + } +#endif + + /* Get starting approximation = rv * 10**e1 */ + + if (e1 > 0) + { + if ((i= e1 & 15)) + dval(rv)*= tens[i]; + if (e1&= ~15) + { + if (e1 > DBL_MAX_10_EXP) + { + ovfl: + *error= EOVERFLOW; + /* Can't trust HUGE_VAL */ +#ifdef Honor_FLT_ROUNDS + switch (rounding) + { + case 0: /* toward 0 */ + case 3: /* toward -infinity */ + word0(rv)= Big0; + word1(rv)= Big1; + break; + default: + word0(rv)= Exp_mask; + word1(rv)= 0; + } +#else /*Honor_FLT_ROUNDS*/ + word0(rv)= Exp_mask; + word1(rv)= 0; +#endif /*Honor_FLT_ROUNDS*/ +#ifdef SET_INEXACT + /* set overflow bit */ + dval(rv0)= 1e300; + dval(rv0)*= dval(rv0); +#endif + if (bd0) + goto retfree; + goto ret; + } + e1>>= 4; + for(j= 0; e1 > 1; j++, e1>>= 1) + if (e1 & 1) + dval(rv)*= bigtens[j]; + /* The last multiplication could overflow. */ + word0(rv)-= P*Exp_msk1; + dval(rv)*= bigtens[j]; + if ((z= word0(rv) & Exp_mask) > Exp_msk1 * (DBL_MAX_EXP + Bias - P)) + goto ovfl; + if (z > Exp_msk1 * (DBL_MAX_EXP + Bias - 1 - P)) + { + /* set to largest number (Can't trust DBL_MAX) */ + word0(rv)= Big0; + word1(rv)= Big1; + } + else + word0(rv)+= P*Exp_msk1; + } + } + else if (e1 < 0) + { + e1= -e1; + if ((i= e1 & 15)) + dval(rv)/= tens[i]; + if ((e1>>= 4)) + { + if (e1 >= 1 << n_bigtens) + goto undfl; + if (e1 & Scale_Bit) + scale= 2 * P; + for(j= 0; e1 > 0; j++, e1>>= 1) + if (e1 & 1) + dval(rv)*= tinytens[j]; + if (scale && (j = 2 * P + 1 - ((word0(rv) & Exp_mask) >> Exp_shift)) > 0) + { + /* scaled rv is denormal; zap j low bits */ + if (j >= 32) + { + word1(rv)= 0; + if (j >= 53) + word0(rv)= (P + 2) * Exp_msk1; + else + word0(rv)&= 0xffffffff << (j - 32); + } + else + word1(rv)&= 0xffffffff << j; + } + if (!dval(rv)) + { + undfl: + dval(rv)= 0.; + if (bd0) + goto retfree; + goto ret; + } + } + } + + /* Now the hard part -- adjusting rv to the correct value.*/ + + /* Put digits into bd: true value = bd * 10^e */ + + bd0= s2b(s0, nd0, nd, y, &alloc); + + for(;;) + { + bd= Balloc(bd0->k, &alloc); + Bcopy(bd, bd0); + bb= d2b(dval(rv), &bbe, &bbbits, &alloc); /* rv = bb * 2^bbe */ + bs= i2b(1, &alloc); + + if (e >= 0) + { + bb2= bb5= 0; + bd2= bd5= e; + } + else + { + bb2= bb5= -e; + bd2= bd5= 0; + } + if (bbe >= 0) + bb2+= bbe; + else + bd2-= bbe; + bs2= bb2; +#ifdef Honor_FLT_ROUNDS + if (rounding != 1) + bs2++; +#endif + j= bbe - scale; + i= j + bbbits - 1; /* logb(rv) */ + if (i < Emin) /* denormal */ + j+= P - Emin; + else + j= P + 1 - bbbits; + bb2+= j; + bd2+= j; + bd2+= scale; + i= bb2 < bd2 ? bb2 : bd2; + if (i > bs2) + i= bs2; + if (i > 0) + { + bb2-= i; + bd2-= i; + bs2-= i; + } + if (bb5 > 0) + { + bs= pow5mult(bs, bb5, &alloc); + bb1= mult(bs, bb, &alloc); + Bfree(bb, &alloc); + bb= bb1; + } + if (bb2 > 0) + bb= lshift(bb, bb2, &alloc); + if (bd5 > 0) + bd= pow5mult(bd, bd5, &alloc); + if (bd2 > 0) + bd= lshift(bd, bd2, &alloc); + if (bs2 > 0) + bs= lshift(bs, bs2, &alloc); + delta= diff(bb, bd, &alloc); + dsign= delta->sign; + delta->sign= 0; + i= cmp(delta, bs); +#ifdef Honor_FLT_ROUNDS + if (rounding != 1) + { + if (i < 0) + { + /* Error is less than an ulp */ + if (!delta->x[0] && delta->wds <= 1) + { + /* exact */ +#ifdef SET_INEXACT + inexact= 0; +#endif + break; + } + if (rounding) + { + if (dsign) + { + adj= 1.; + goto apply_adj; + } + } + else if (!dsign) + { + adj= -1.; + if (!word1(rv) && !(word0(rv) & Frac_mask)) + { + y= word0(rv) & Exp_mask; + if (!scale || y > 2*P*Exp_msk1) + { + delta= lshift(delta,Log2P); + if (cmp(delta, bs) <= 0) + adj= -0.5; + } + } + apply_adj: + if (scale && (y= word0(rv) & Exp_mask) <= 2 * P * Exp_msk1) + word0(adj)+= (2 * P + 1) * Exp_msk1 - y; + dval(rv)+= adj * ulp(dval(rv)); + } + break; + } + adj= ratio(delta, bs); + if (adj < 1.) + adj= 1.; + if (adj <= 0x7ffffffe) + { + /* adj = rounding ? ceil(adj) : floor(adj); */ + y= adj; + if (y != adj) + { + if (!((rounding >> 1) ^ dsign)) + y++; + adj= y; + } + } + if (scale && (y= word0(rv) & Exp_mask) <= 2 * P * Exp_msk1) + word0(adj)+= (2 * P + 1) * Exp_msk1 - y; + adj*= ulp(dval(rv)); + if (dsign) + dval(rv)+= adj; + else + dval(rv)-= adj; + goto cont; + } +#endif /*Honor_FLT_ROUNDS*/ + + if (i < 0) + { + /* + Error is less than half an ulp -- check for special case of mantissa + a power of two. + */ + if (dsign || word1(rv) || word0(rv) & Bndry_mask || + (word0(rv) & Exp_mask) <= (2 * P + 1) * Exp_msk1) + { +#ifdef SET_INEXACT + if (!delta->x[0] && delta->wds <= 1) + inexact= 0; +#endif + break; + } + if (!delta->p.x[0] && delta->wds <= 1) + { + /* exact result */ +#ifdef SET_INEXACT + inexact= 0; +#endif + break; + } + delta= lshift(delta, Log2P, &alloc); + if (cmp(delta, bs) > 0) + goto drop_down; + break; + } + if (i == 0) + { + /* exactly half-way between */ + if (dsign) + { + if ((word0(rv) & Bndry_mask1) == Bndry_mask1 && + word1(rv) == + ((scale && (y = word0(rv) & Exp_mask) <= 2 * P * Exp_msk1) ? + (0xffffffff & (0xffffffff << (2*P+1-(y>>Exp_shift)))) : + 0xffffffff)) + { + /*boundary case -- increment exponent*/ + word0(rv)= (word0(rv) & Exp_mask) + Exp_msk1; + word1(rv) = 0; + dsign = 0; + break; + } + } + else if (!(word0(rv) & Bndry_mask) && !word1(rv)) + { + drop_down: + /* boundary case -- decrement exponent */ + if (scale) + { + L= word0(rv) & Exp_mask; + if (L <= (2 *P + 1) * Exp_msk1) + { + if (L > (P + 2) * Exp_msk1) + /* round even ==> accept rv */ + break; + /* rv = smallest denormal */ + goto undfl; + } + } + L= (word0(rv) & Exp_mask) - Exp_msk1; + word0(rv)= L | Bndry_mask1; + word1(rv)= 0xffffffff; + break; + } + if (!(word1(rv) & LSB)) + break; + if (dsign) + dval(rv)+= ulp(dval(rv)); + else + { + dval(rv)-= ulp(dval(rv)); + if (!dval(rv)) + goto undfl; + } + dsign= 1 - dsign; + break; + } + if ((aadj= ratio(delta, bs)) <= 2.) + { + if (dsign) + aadj= aadj1= 1.; + else if (word1(rv) || word0(rv) & Bndry_mask) + { + if (word1(rv) == Tiny1 && !word0(rv)) + goto undfl; + aadj= 1.; + aadj1= -1.; + } + else + { + /* special case -- power of FLT_RADIX to be rounded down... */ + if (aadj < 2. / FLT_RADIX) + aadj= 1. / FLT_RADIX; + else + aadj*= 0.5; + aadj1= -aadj; + } + } + else + { + aadj*= 0.5; + aadj1= dsign ? aadj : -aadj; +#ifdef Check_FLT_ROUNDS + switch (Rounding) + { + case 2: /* towards +infinity */ + aadj1-= 0.5; + break; + case 0: /* towards 0 */ + case 3: /* towards -infinity */ + aadj1+= 0.5; + } +#else + if (Flt_Rounds == 0) + aadj1+= 0.5; +#endif /*Check_FLT_ROUNDS*/ + } + y= word0(rv) & Exp_mask; + + /* Check for overflow */ + + if (y == Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) + { + dval(rv0)= dval(rv); + word0(rv)-= P * Exp_msk1; + adj= aadj1 * ulp(dval(rv)); + dval(rv)+= adj; + if ((word0(rv) & Exp_mask) >= Exp_msk1 * (DBL_MAX_EXP + Bias - P)) + { + if (word0(rv0) == Big0 && word1(rv0) == Big1) + goto ovfl; + word0(rv)= Big0; + word1(rv)= Big1; + goto cont; + } + else + word0(rv)+= P * Exp_msk1; + } + else + { + if (scale && y <= 2 * P * Exp_msk1) + { + if (aadj <= 0x7fffffff) + { + if ((z= (ULong) aadj) <= 0) + z= 1; + aadj= z; + aadj1= dsign ? aadj : -aadj; + } + word0(aadj1)+= (2 * P + 1) * Exp_msk1 - y; + } + adj = aadj1 * ulp(dval(rv)); + dval(rv) += adj; + } + z= word0(rv) & Exp_mask; +#ifndef SET_INEXACT + if (!scale) + if (y == z) + { + /* Can we stop now? */ + L= (Long)aadj; + aadj-= L; + /* The tolerances below are conservative. */ + if (dsign || word1(rv) || word0(rv) & Bndry_mask) + { + if (aadj < .4999999 || aadj > .5000001) + break; + } + else if (aadj < .4999999 / FLT_RADIX) + break; + } +#endif + cont: + Bfree(bb, &alloc); + Bfree(bd, &alloc); + Bfree(bs, &alloc); + Bfree(delta, &alloc); + } +#ifdef SET_INEXACT + if (inexact) + { + if (!oldinexact) + { + word0(rv0)= Exp_1 + (70 << Exp_shift); + word1(rv0)= 0; + dval(rv0)+= 1.; + } + } + else if (!oldinexact) + clear_inexact(); +#endif + if (scale) + { + word0(rv0)= Exp_1 - 2 * P * Exp_msk1; + word1(rv0)= 0; + dval(rv)*= dval(rv0); + } +#ifdef SET_INEXACT + if (inexact && !(word0(rv) & Exp_mask)) + { + /* set underflow bit */ + dval(rv0)= 1e-300; + dval(rv0)*= dval(rv0); + } +#endif + retfree: + Bfree(bb, &alloc); + Bfree(bd, &alloc); + Bfree(bs, &alloc); + Bfree(bd0, &alloc); + Bfree(delta, &alloc); + ret: + *se= (char *)s; + return sign ? -dval(rv) : dval(rv); +} + + +static int quorem(Bigint *b, Bigint *S) +{ + int n; + ULong *bx, *bxe, q, *sx, *sxe; + ULLong borrow, carry, y, ys; + + n= S->wds; + if (b->wds < n) + return 0; + sx= S->p.x; + sxe= sx + --n; + bx= b->p.x; + bxe= bx + n; + q= *bxe / (*sxe + 1); /* ensure q <= true quotient */ + if (q) + { + borrow= 0; + carry= 0; + do + { + ys= *sx++ * (ULLong)q + carry; + carry= ys >> 32; + y= *bx - (ys & FFFFFFFF) - borrow; + borrow= y >> 32 & (ULong)1; + *bx++= (ULong) (y & FFFFFFFF); + } + while (sx <= sxe); + if (!*bxe) + { + bx= b->p.x; + while (--bxe > bx && !*bxe) + --n; + b->wds= n; + } + } + if (cmp(b, S) >= 0) + { + q++; + borrow= 0; + carry= 0; + bx= b->p.x; + sx= S->p.x; + do + { + ys= *sx++ + carry; + carry= ys >> 32; + y= *bx - (ys & FFFFFFFF) - borrow; + borrow= y >> 32 & (ULong)1; + *bx++= (ULong) (y & FFFFFFFF); + } + while (sx <= sxe); + bx= b->p.x; + bxe= bx + n; + if (!*bxe) + { + while (--bxe > bx && !*bxe) + --n; + b->wds= n; + } + } + return q; +} + + +/* + dtoa for IEEE arithmetic (dmg): convert double to ASCII string. + + Inspired by "How to Print Floating-Point Numbers Accurately" by + Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. + + Modifications: + 1. Rather than iterating, we use a simple numeric overestimate + to determine k= floor(log10(d)). We scale relevant + quantities using O(log2(k)) rather than O(k) multiplications. + 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't + try to generate digits strictly left to right. Instead, we + compute with fewer bits and propagate the carry if necessary + when rounding the final digit up. This is often faster. + 3. Under the assumption that input will be rounded nearest, + mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. + That is, we allow equality in stopping tests when the + round-nearest rule will give the same floating-point value + as would satisfaction of the stopping test with strict + inequality. + 4. We remove common factors of powers of 2 from relevant + quantities. + 5. When converting floating-point integers less than 1e16, + we use floating-point arithmetic rather than resorting + to multiple-precision integers. + 6. When asked to produce fewer than 15 digits, we first try + to get by with floating-point arithmetic; we resort to + multiple-precision integer arithmetic only if we cannot + guarantee that the floating-point calculation has given + the correctly rounded result. For k requested digits and + "uniformly" distributed input, the probability is + something like 10^(k-15) that we must resort to the Long + calculation. + */ + +static char *dtoa(double d, int mode, int ndigits, int *decpt, int *sign, + char **rve, char *buf, size_t buf_size) +{ + /* + Arguments ndigits, decpt, sign are similar to those + of ecvt and fcvt; trailing zeros are suppressed from + the returned string. If not null, *rve is set to point + to the end of the return value. If d is +-Infinity or NaN, + then *decpt is set to DTOA_OVERFLOW. + + mode: + 0 ==> shortest string that yields d when read in + and rounded to nearest. + 1 ==> like 0, but with Steele & White stopping rule; + e.g. with IEEE P754 arithmetic , mode 0 gives + 1e23 whereas mode 1 gives 9.999999999999999e22. + 2 ==> max(1,ndigits) significant digits. This gives a + return value similar to that of ecvt, except + that trailing zeros are suppressed. + 3 ==> through ndigits past the decimal point. This + gives a return value similar to that from fcvt, + except that trailing zeros are suppressed, and + ndigits can be negative. + 4,5 ==> similar to 2 and 3, respectively, but (in + round-nearest mode) with the tests of mode 0 to + possibly return a shorter string that rounds to d. + With IEEE arithmetic and compilation with + -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same + as modes 2 and 3 when FLT_ROUNDS != 1. + 6-9 ==> Debugging modes similar to mode - 4: don't try + fast floating-point estimate (if applicable). + + Values of mode other than 0-9 are treated as mode 0. + + Sufficient space is allocated to the return value + to hold the suppressed trailing zeros. + */ + + int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, + j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, + spec_case, try_quick; + Long L; + int denorm; + ULong x; + Bigint *b, *b1, *delta, *mlo, *mhi, *S; + double d2, ds, eps; + char *s, *s0; +#ifdef Honor_FLT_ROUNDS + int rounding; +#endif + Stack_alloc alloc; + LINT_INIT(ilim); + LINT_INIT(ilim1); + + alloc.begin= alloc.free= buf; + alloc.end= buf + buf_size; + memset(alloc.freelist, 0, sizeof(alloc.freelist)); + + if (word0(d) & Sign_bit) + { + /* set sign for everything, including 0's and NaNs */ + *sign= 1; + word0(d) &= ~Sign_bit; /* clear sign bit */ + } + else + *sign= 0; + + /* If infinity, set decpt to DTOA_OVERFLOW, if 0 set it to 1 */ + if (((word0(d) & Exp_mask) == Exp_mask && (*decpt= DTOA_OVERFLOW)) || + (!dval(d) && (*decpt= 1))) + { + /* Infinity, NaN, 0 */ + char *res= (char*) dtoa_alloc(2, &alloc); + res[0]= '0'; + res[1]= '\0'; + if (rve) + *rve= res + 1; + return res; + } + +#ifdef Honor_FLT_ROUNDS + if ((rounding= Flt_Rounds) >= 2) + { + if (*sign) + rounding= rounding == 2 ? 0 : 2; + else + if (rounding != 2) + rounding= 0; + } +#endif + + b= d2b(dval(d), &be, &bbits, &alloc); + if ((i= (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) + { + dval(d2)= dval(d); + word0(d2) &= Frac_mask1; + word0(d2) |= Exp_11; + + /* + log(x) ~=~ log(1.5) + (x-1.5)/1.5 + log10(x) = log(x) / log(10) + ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) + log10(d)= (i-Bias)*log(2)/log(10) + log10(d2) + + This suggests computing an approximation k to log10(d) by + + k= (i - Bias)*0.301029995663981 + + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); + + We want k to be too large rather than too small. + The error in the first-order Taylor series approximation + is in our favor, so we just round up the constant enough + to compensate for any error in the multiplication of + (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, + and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, + adding 1e-13 to the constant term more than suffices. + Hence we adjust the constant term to 0.1760912590558. + (We could get a more accurate k by invoking log10, + but this is probably not worthwhile.) + */ + + i-= Bias; + denorm= 0; + } + else + { + /* d is denormalized */ + + i= bbits + be + (Bias + (P-1) - 1); + x= i > 32 ? word0(d) << (64 - i) | word1(d) >> (i - 32) + : word1(d) << (32 - i); + dval(d2)= x; + word0(d2)-= 31*Exp_msk1; /* adjust exponent */ + i-= (Bias + (P-1) - 1) + 1; + denorm= 1; + } + ds= (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; + k= (int)ds; + if (ds < 0. && ds != k) + k--; /* want k= floor(ds) */ + k_check= 1; + if (k >= 0 && k <= Ten_pmax) + { + if (dval(d) < tens[k]) + k--; + k_check= 0; + } + j= bbits - i - 1; + if (j >= 0) + { + b2= 0; + s2= j; + } + else + { + b2= -j; + s2= 0; + } + if (k >= 0) + { + b5= 0; + s5= k; + s2+= k; + } + else + { + b2-= k; + b5= -k; + s5= 0; + } + if (mode < 0 || mode > 9) + mode= 0; + +#ifdef Check_FLT_ROUNDS + try_quick= Rounding == 1; +#else + try_quick= 1; +#endif + + if (mode > 5) + { + mode-= 4; + try_quick= 0; + } + leftright= 1; + switch (mode) { + case 0: + case 1: + ilim= ilim1= -1; + i= 18; + ndigits= 0; + break; + case 2: + leftright= 0; + /* no break */ + case 4: + if (ndigits <= 0) + ndigits= 1; + ilim= ilim1= i= ndigits; + break; + case 3: + leftright= 0; + /* no break */ + case 5: + i= ndigits + k + 1; + ilim= i; + ilim1= i - 1; + if (i <= 0) + i= 1; + } + s= s0= dtoa_alloc(i, &alloc); + +#ifdef Honor_FLT_ROUNDS + if (mode > 1 && rounding != 1) + leftright= 0; +#endif + + if (ilim >= 0 && ilim <= Quick_max && try_quick) + { + /* Try to get by with floating-point arithmetic. */ + i= 0; + dval(d2)= dval(d); + k0= k; + ilim0= ilim; + ieps= 2; /* conservative */ + if (k > 0) + { + ds= tens[k&0xf]; + j= k >> 4; + if (j & Bletch) + { + /* prevent overflows */ + j&= Bletch - 1; + dval(d)/= bigtens[n_bigtens-1]; + ieps++; + } + for (; j; j>>= 1, i++) + { + if (j & 1) + { + ieps++; + ds*= bigtens[i]; + } + } + dval(d)/= ds; + } + else if ((j1= -k)) + { + dval(d)*= tens[j1 & 0xf]; + for (j= j1 >> 4; j; j>>= 1, i++) + { + if (j & 1) + { + ieps++; + dval(d)*= bigtens[i]; + } + } + } + if (k_check && dval(d) < 1. && ilim > 0) + { + if (ilim1 <= 0) + goto fast_failed; + ilim= ilim1; + k--; + dval(d)*= 10.; + ieps++; + } + dval(eps)= ieps*dval(d) + 7.; + word0(eps)-= (P-1)*Exp_msk1; + if (ilim == 0) + { + S= mhi= 0; + dval(d)-= 5.; + if (dval(d) > dval(eps)) + goto one_digit; + if (dval(d) < -dval(eps)) + goto no_digits; + goto fast_failed; + } + if (leftright) + { + /* Use Steele & White method of only generating digits needed. */ + dval(eps)= 0.5/tens[ilim-1] - dval(eps); + for (i= 0;;) + { + L= (Long) dval(d); + dval(d)-= L; + *s++= '0' + (int)L; + if (dval(d) < dval(eps)) + goto ret1; + if (1. - dval(d) < dval(eps)) + goto bump_up; + if (++i >= ilim) + break; + dval(eps)*= 10.; + dval(d)*= 10.; + } + } + else + { + /* Generate ilim digits, then fix them up. */ + dval(eps)*= tens[ilim-1]; + for (i= 1;; i++, dval(d)*= 10.) + { + L= (Long)(dval(d)); + if (!(dval(d)-= L)) + ilim= i; + *s++= '0' + (int)L; + if (i == ilim) + { + if (dval(d) > 0.5 + dval(eps)) + goto bump_up; + else if (dval(d) < 0.5 - dval(eps)) + { + while (*--s == '0'); + s++; + goto ret1; + } + break; + } + } + } + fast_failed: + s= s0; + dval(d)= dval(d2); + k= k0; + ilim= ilim0; + } + + /* Do we have a "small" integer? */ + + if (be >= 0 && k <= Int_max) + { + /* Yes. */ + ds= tens[k]; + if (ndigits < 0 && ilim <= 0) + { + S= mhi= 0; + if (ilim < 0 || dval(d) <= 5*ds) + goto no_digits; + goto one_digit; + } + for (i= 1;; i++, dval(d)*= 10.) + { + L= (Long)(dval(d) / ds); + dval(d)-= L*ds; +#ifdef Check_FLT_ROUNDS + /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (dval(d) < 0) + { + L--; + dval(d)+= ds; + } +#endif + *s++= '0' + (int)L; + if (!dval(d)) + { + break; + } + if (i == ilim) + { +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + { + switch (rounding) { + case 0: goto ret1; + case 2: goto bump_up; + } + } +#endif + dval(d)+= dval(d); + if (dval(d) > ds || (dval(d) == ds && L & 1)) + { +bump_up: + while (*--s == '9') + if (s == s0) + { + k++; + *s= '0'; + break; + } + ++*s++; + } + break; + } + } + goto ret1; + } + + m2= b2; + m5= b5; + mhi= mlo= 0; + if (leftright) + { + i = denorm ? be + (Bias + (P-1) - 1 + 1) : 1 + P - bbits; + b2+= i; + s2+= i; + mhi= i2b(1, &alloc); + } + if (m2 > 0 && s2 > 0) + { + i= m2 < s2 ? m2 : s2; + b2-= i; + m2-= i; + s2-= i; + } + if (b5 > 0) + { + if (leftright) + { + if (m5 > 0) + { + mhi= pow5mult(mhi, m5, &alloc); + b1= mult(mhi, b, &alloc); + Bfree(b, &alloc); + b= b1; + } + if ((j= b5 - m5)) + b= pow5mult(b, j, &alloc); + } + else + b= pow5mult(b, b5, &alloc); + } + S= i2b(1, &alloc); + if (s5 > 0) + S= pow5mult(S, s5, &alloc); + + /* Check for special case that d is a normalized power of 2. */ + + spec_case= 0; + if ((mode < 2 || leftright) +#ifdef Honor_FLT_ROUNDS + && rounding == 1 +#endif + ) + { + if (!word1(d) && !(word0(d) & Bndry_mask) && + word0(d) & (Exp_mask & ~Exp_msk1) + ) + { + /* The special case */ + b2+= Log2P; + s2+= Log2P; + spec_case= 1; + } + } + + /* + Arrange for convenient computation of quotients: + shift left if necessary so divisor has 4 leading 0 bits. + + Perhaps we should just compute leading 28 bits of S once + a nd for all and pass them and a shift to quorem, so it + can do shifts and ors to compute the numerator for q. + */ + if ((i= ((s5 ? 32 - hi0bits(S->p.x[S->wds-1]) : 1) + s2) & 0x1f)) + i= 32 - i; + if (i > 4) + { + i-= 4; + b2+= i; + m2+= i; + s2+= i; + } + else if (i < 4) + { + i+= 28; + b2+= i; + m2+= i; + s2+= i; + } + if (b2 > 0) + b= lshift(b, b2, &alloc); + if (s2 > 0) + S= lshift(S, s2, &alloc); + if (k_check) + { + if (cmp(b,S) < 0) + { + k--; + /* we botched the k estimate */ + b= multadd(b, 10, 0, &alloc); + if (leftright) + mhi= multadd(mhi, 10, 0, &alloc); + ilim= ilim1; + } + } + if (ilim <= 0 && (mode == 3 || mode == 5)) + { + if (ilim < 0 || cmp(b,S= multadd(S,5,0, &alloc)) <= 0) + { + /* no digits, fcvt style */ +no_digits: + k= -1 - ndigits; + goto ret; + } +one_digit: + *s++= '1'; + k++; + goto ret; + } + if (leftright) + { + if (m2 > 0) + mhi= lshift(mhi, m2, &alloc); + + /* + Compute mlo -- check for special case that d is a normalized power of 2. + */ + + mlo= mhi; + if (spec_case) + { + mhi= Balloc(mhi->k, &alloc); + Bcopy(mhi, mlo); + mhi= lshift(mhi, Log2P, &alloc); + } + + for (i= 1;;i++) + { + dig= quorem(b,S) + '0'; + /* Do we yet have the shortest decimal string that will round to d? */ + j= cmp(b, mlo); + delta= diff(S, mhi, &alloc); + j1= delta->sign ? 1 : cmp(b, delta); + Bfree(delta, &alloc); + if (j1 == 0 && mode != 1 && !(word1(d) & 1) +#ifdef Honor_FLT_ROUNDS + && rounding >= 1 +#endif + ) + { + if (dig == '9') + goto round_9_up; + if (j > 0) + dig++; + *s++= dig; + goto ret; + } + if (j < 0 || (j == 0 && mode != 1 && !(word1(d) & 1))) + { + if (!b->p.x[0] && b->wds <= 1) + { + goto accept_dig; + } +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + switch (rounding) { + case 0: goto accept_dig; + case 2: goto keep_dig; + } +#endif /*Honor_FLT_ROUNDS*/ + if (j1 > 0) + { + b= lshift(b, 1, &alloc); + j1= cmp(b, S); + if ((j1 > 0 || (j1 == 0 && dig & 1)) + && dig++ == '9') + goto round_9_up; + } +accept_dig: + *s++= dig; + goto ret; + } + if (j1 > 0) + { +#ifdef Honor_FLT_ROUNDS + if (!rounding) + goto accept_dig; +#endif + if (dig == '9') + { /* possible if i == 1 */ +round_9_up: + *s++= '9'; + goto roundoff; + } + *s++= dig + 1; + goto ret; + } +#ifdef Honor_FLT_ROUNDS +keep_dig: +#endif + *s++= dig; + if (i == ilim) + break; + b= multadd(b, 10, 0, &alloc); + if (mlo == mhi) + mlo= mhi= multadd(mhi, 10, 0, &alloc); + else + { + mlo= multadd(mlo, 10, 0, &alloc); + mhi= multadd(mhi, 10, 0, &alloc); + } + } + } + else + for (i= 1;; i++) + { + *s++= dig= quorem(b,S) + '0'; + if (!b->p.x[0] && b->wds <= 1) + { + goto ret; + } + if (i >= ilim) + break; + b= multadd(b, 10, 0, &alloc); + } + + /* Round off last digit */ + +#ifdef Honor_FLT_ROUNDS + switch (rounding) { + case 0: goto trimzeros; + case 2: goto roundoff; + } +#endif + b= lshift(b, 1, &alloc); + j= cmp(b, S); + if (j > 0 || (j == 0 && dig & 1)) + { +roundoff: + while (*--s == '9') + if (s == s0) + { + k++; + *s++= '1'; + goto ret; + } + ++*s++; + } + else + { +#ifdef Honor_FLT_ROUNDS +trimzeros: +#endif + while (*--s == '0'); + s++; + } +ret: + Bfree(S, &alloc); + if (mhi) + { + if (mlo && mlo != mhi) + Bfree(mlo, &alloc); + Bfree(mhi, &alloc); + } +ret1: + Bfree(b, &alloc); + *s= 0; + *decpt= k + 1; + if (rve) + *rve= s; + return s0; +} diff --git a/externals/mysql/strings/dump_map.c b/externals/mysql/strings/dump_map.c new file mode 100644 index 00000000000..e2b8b7db077 --- /dev/null +++ b/externals/mysql/strings/dump_map.c @@ -0,0 +1,89 @@ +/* Copyright (C) 2003-2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include + +static void print_short_array(unsigned short *a, size_t width) +{ + int i; + printf("{\n"); + for (i=0; i<=0xFF; i++) + { + const char *fmt= (width==4) ? "0x%04X" : "0x%02X"; + printf(fmt,(int)a[i]); + printf("%s%s",i<0xFF?",":"",(i+1) % 8 ? "" :"\n"); + } + printf("};\n"); + +} + + + +int main(void) +{ + char str[160]; + unsigned short touni[256]; + unsigned short fromuni[65536]; + unsigned short fromstat[256]; + int i; + + bzero((void*)touni,sizeof(touni)); + bzero((void*)fromuni,sizeof(fromuni)); + bzero((void*)fromstat,sizeof(fromstat)); + + while (fgets(str,sizeof(str),stdin)) + { + unsigned int c,u; + + if ((str[0]=='#') || (2!=sscanf(str,"%x%x",&c,&u))) + continue; + if (c>0xFF || u>0xFFFF) + continue; + + touni[c]= u; + fromuni[u]= c; + } + + printf("unsigned short cs_to_uni[256]="); + print_short_array(touni, 4); + + for (i=0;i<=0xFF;i++) + { + fromstat[touni[i]>>8]++; + } + + for (i=0;i<=256;i++) + { + if (fromstat[i]) + { + printf("unsigned char pl%02X[256]=",i); + print_short_array(fromuni+i*256, 2); + } + } + + printf("unsigned short *uni_to_cs[256]={\n"); + for (i=0;i<=255;i++) + { + if (fromstat[i]) + printf("pl%02X",i); + else + printf("NULL"); + printf("%s%s",i<255?",":"",((i+1) % 8) ? "":"\n"); + } + printf("};\n"); + + return 0; +} diff --git a/externals/mysql/strings/int2str.c b/externals/mysql/strings/int2str.c new file mode 100644 index 00000000000..fba98aac3f1 --- /dev/null +++ b/externals/mysql/strings/int2str.c @@ -0,0 +1,164 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include "m_string.h" + +/* + _dig_vec arrays are public because they are used in several outer places. +*/ +char NEAR _dig_vec_upper[] = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +char NEAR _dig_vec_lower[] = + "0123456789abcdefghijklmnopqrstuvwxyz"; + + +/* + Convert integer to its string representation in given scale of notation. + + SYNOPSIS + int2str() + val - value to convert + dst - points to buffer where string representation should be stored + radix - radix of scale of notation + upcase - set to 1 if we should use upper-case digits + + DESCRIPTION + Converts the (long) integer value to its character form and moves it to + the destination buffer followed by a terminating NUL. + If radix is -2..-36, val is taken to be SIGNED, if radix is 2..36, val is + taken to be UNSIGNED. That is, val is signed if and only if radix is. + All other radixes treated as bad and nothing will be changed in this case. + + For conversion to decimal representation (radix is -10 or 10) one can use + optimized int10_to_str() function. + + RETURN VALUE + Pointer to ending NUL character or NullS if radix is bad. +*/ + +char * +int2str(register long int val, register char *dst, register int radix, + int upcase) +{ + char buffer[65]; + register char *p; + long int new_val; + char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; + ulong uval= (ulong) val; + + if (radix < 0) + { + if (radix < -36 || radix > -2) + return NullS; + if (val < 0) + { + *dst++ = '-'; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulong)0 - uval; + } + radix = -radix; + } + else if (radix > 36 || radix < 2) + return NullS; + + /* + The slightly contorted code which follows is due to the fact that + few machines directly support unsigned long / and %. Certainly + the VAX C compiler generates a subroutine call. In the interests + of efficiency (hollow laugh) I let this happen for the first digit + only; after that "val" will be in range so that signed integer + division will do. Sorry 'bout that. CHECK THE CODE PRODUCED BY + YOUR C COMPILER. The first % and / should be unsigned, the second + % and / signed, but C compilers tend to be extraordinarily + sensitive to minor details of style. This works on a VAX, that's + all I claim for it. + */ + p = &buffer[sizeof(buffer)-1]; + *p = '\0'; + new_val= uval / (ulong) radix; + *--p = dig_vec[(uchar) (uval- (ulong) new_val*(ulong) radix)]; + val = new_val; +#ifdef HAVE_LDIV + while (val != 0) + { + ldiv_t res; + res=ldiv(val,radix); + *--p = dig_vec[res.rem]; + val= res.quot; + } +#else + while (val != 0) + { + new_val=val/radix; + *--p = dig_vec[(uchar) (val-new_val*radix)]; + val= new_val; + } +#endif + while ((*dst++ = *p++) != 0) ; + return dst-1; +} + + +/* + Converts integer to its string representation in decimal notation. + + SYNOPSIS + int10_to_str() + val - value to convert + dst - points to buffer where string representation should be stored + radix - flag that shows whenever val should be taken as signed or not + + DESCRIPTION + This is version of int2str() function which is optimized for normal case + of radix 10/-10. It takes only sign of radix parameter into account and + not its absolute value. + + RETURN VALUE + Pointer to ending NUL character. +*/ + +char *int10_to_str(long int val,char *dst,int radix) +{ + char buffer[65]; + register char *p; + long int new_val; + unsigned long int uval = (unsigned long int) val; + + if (radix < 0) /* -10 */ + { + if (val < 0) + { + *dst++ = '-'; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (unsigned long int)0 - uval; + } + } + + p = &buffer[sizeof(buffer)-1]; + *p = '\0'; + new_val= (long) (uval / 10); + *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); + val = new_val; + + while (val != 0) + { + new_val=val/10; + *--p = '0' + (char) (val-new_val*10); + val= new_val; + } + while ((*dst++ = *p++) != 0) ; + return dst-1; +} diff --git a/externals/mysql/strings/is_prefix.c b/externals/mysql/strings/is_prefix.c new file mode 100644 index 00000000000..451cd468b7e --- /dev/null +++ b/externals/mysql/strings/is_prefix.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : is_prefix.c + Author : Michael Widenius + Defines: is_prefix() + + is_prefix(s, t) returns 1 if s starts with t. + A empty t is allways a prefix. +*/ + +#include +#include "m_string.h" + +int is_prefix(register const char *s, register const char *t) +{ + while (*t) + if (*s++ != *t++) return 0; + return 1; /* WRONG */ +} diff --git a/externals/mysql/strings/latin2.def b/externals/mysql/strings/latin2.def new file mode 100644 index 00000000000..159d01894f3 --- /dev/null +++ b/externals/mysql/strings/latin2.def @@ -0,0 +1,478 @@ +; Character code definition file for latin2 languages (for use with cset) +; it's written for Czech, but may be used generally; works +; minimum for Slovenian alphabet too (or at least I hope so) +; +; Written by Jaromir Dolecek +; +; Notes of defined sorting order: +; Upper/Lower case is ignored +; All characters with the accents are sorted after appropriate +; character without accent in order: +; Xacute, Xring , Xcaron, Xslash, Xcedilla, Xogonek, Xcircumflex, +; Xbreve, Xhungarumlaut, Xdieresis, Xdotaccent +; +latin2 +*** +NUL 0 C +SOH C +STX C +ETX C +EOT C +ENQ C +ACK C +BEL C +BS C +HT CS +LF CS +VT CS +FF CS +CR CS +SO C +SI C +DLE C +DC1 C +DC2 C +DC3 C +DC4 C +NAK C +SYN C +ETB C +CAN C +EM C +SUB C +ESC C +FS C +GS C +RS C +US C +/space BS +/exclam P +/quotedbl P +/numbersign P +/dollar P +/percent P +/ampersand P +/quoteright P +/parenleft P +/parenright P +/asterisk P +/plus P +/comma P +/minus P +/period P +/slash P +/zero NX +/one NX +/two NX +/three NX +/four NX +/five NX +/six NX +/seven NX +/eight NX +/nine NX +/colon P +/semicolon P +/less P +/equal P +/greater P +/question P +/at P +/A UX +/B UX +/C UX +/D UX +/E UX +/F UX +/G U +/H U +/I U +/J U +/K U +/L U +/M U +/N U +/O U +/P U +/Q U +/R U +/S U +/T U +/U U +/V U +/W U +/X U +/Y U +/Z U +/bracketleft P +/backslash P +/bracketright P +/asciicircum P +/underscore P +/quoteleft P +/a LX +/b LX +/c LX +/d LX +/e LX +/f LX +/g L +/h L +/i L +/j L +/k L +/l L +/m L +/n L +/o L +/p L +/q L +/r L +/s L +/t L +/u L +/v L +/w L +/x L +/y L +/z L +/braceleft P +/bar P +/braceright P +/tilde P +NUL_ C +SOH_ C +STX_ C +ETX_ C +EOT_ C +ENQ_ C +ACK_ C +BEL_ C +BS_ C +HT_ CS +LF_ CS +VT_ CS +FF_ CS +CR_ CS +SO_ C +SI_ C +DLE_ C +DC1_ C +DC2_ C +DC3_ C +DC4_ C +NAK_ C +SYN_ C +ETB_ C +CAN_ C +EM_ C +SUB_ C +ESC_ C +FS_ C +GS_ C +RS_ C +US_ C +/space_ SB +/Aogonek U +/breve P +/Lslash U +/currency P +/Lcaron U +/Sacute U +/dieresis P +/Scaron 169 U +/Scedilla U +/Tcaron U +/Zacute U +/hyphen P +/Zcaron U +/Zdotaccent U +/degree P +/aogonek L +/ogonek P +/lslash L +/acute P +/lcaron L +/sacute L +/caron P +/cedilla P +/scaron L +/scedilla L +/tcaron L +/zacute L +/hungarumlaut P +/zcaron L +/zdotaccent L +/Racute U +/Aacute U +/Acircumflex U +/Abreve U +/Adieresis U +/Lacute U +/Cacute U +/Ccedilla U +/Ccaron U +/Eacute U +/Eogonek U +/Edieresis U +/Ecaron U +/Iacute U +/Icircumflex U +/Dcaron U +/Eth P +/Nacute U +/Ncaron U +/Oacute U +/Ocircumflex U +/Ohungarumlaut U +/Odieresis U +/multiply P +/Rcaron U +/Uring U +/Uacute U +/Uhungarumlaut U +/Udieresis U +/Yacute U +/Tcedilla U +/germandbls P +/racute L +/aacute L +/acircumflex L +/abreve L +/adieresis L +/lacute L +/cacute L +/ccedilla L +/ccaron L +/eacute L +/eogonek L +/edieresis L +/ecaron L +/iacute L +/icircumflex L +/dcaron L +/dbar L +/nacute L +/ncaron L +/oacute L +/ocircumflex L +/ohungarumlaut L +/odieresis L +/divide P +/rcaron L +/uring L +/uacute L +/uhungarumlaut L +/udieresis L +/yacute L +/tcedilla L +/dotaccent P +*** +/A /a +/B /b +/C /c +/D /d +/E /e +/F /f +/G /g +/H /h +/I /i +/J /j +/K /k +/L /l +/M /m +/N /n +/O /o +/P /p +/Q /q +/R /r +/S /s +/T /t +/U /u +/V /v +/W /w +/X /x +/Y /y +/Z /z +/Aogonek /aogonek +/Lslash /lslash +/Lcaron /lcaron +/Sacute /sacute +/Scaron /scaron +/Scedilla /scedilla +/Tcaron /tcaron +/Zacute /zacute +/Zcaron /zcaron +/Zdotaccent /zdotaccent +/Racute /racute +/Aacute /aacute +/Acircumflex /acircumflex +/Abreve /abreve +/Adieresis /adieresis +/Lacute /lacute +/Cacute /cacute +/Ccedilla /ccedilla +/Ccaron /ccaron +/Eacute /eacute +/Eogonek /eogonek +/Edieresis /edieresis +/Ecaron /ecaron +/Iacute /iacute +/Icircumflex /icircumflex +/Dcaron /dcaron +/Nacute /nacute +/Ncaron /ncaron +/Oacute /oacute +/Ocircumflex /ocircumflex +/Ohungarumlaut /ohungarumlaut +/Odieresis /odieresis +/Rcaron /rcaron +/Uring /uring +/Uacute /uacute +/Uhungarumlaut /uhungarumlaut +/Udieresis /udieresis +/Yacute /yacute +/Tcedilla /tcedilla +*** +NUL NUL_ +SOH SOH_ +STX STX_ +ETX ETX_ +EOT EOT_ +ENQ ENQ_ +ACK ACK_ +BEL BEL_ +BS BS_ +HT HT_ +LF LF_ +VT VT_ +FF FF_ +CR CR_ +SO SO_ +SI SI_ +DLE DLE_ +DC1 DC1_ +DC2 DC2_ +DC3 DC3_ +DC4 DC4_ +NAK NAK_ +SYN SYN_ +ETB ETB_ +CAN CAN_ +EM EM_ +SUB SUB_ +ESC ESC_ +FS FS_ +GS GS_ +RS RS_ +US US_ +/space +/exclam +/quotedbl +/numbersign +/dollar +/percent +/ampersand +/quoteright +/parenleft +/parenright +/asterisk +/plus +/comma +/minus +/period +/slash +/zero +/one +/two +/three +/four +/five +/six +/seven +/eight +/nine +/colon +/semicolon +/less +/equal +/greater +/question +/at +/A /a +/Aogonek /aogonek +/Aacute /aacute +/Acircumflex /acircumflex +/Abreve /abreve +/Adieresis /adieresis +/B /b +/C /c +/Cacute /cacute +/Ccaron /ccaron +/Ccedilla /ccedilla +/D /d +/Dcaron /dcaron +/E /e +/Eacute /eacute +/Ecaron /ecaron +/Eogonek /eogonek +/Edieresis /edieresis +/F /f +/G /g +/H /h +/I /i +/Icircumflex +/icircumflex +/Iacute /iacute +/J /j +/K /k +/L /l +/Lslash /lslash +/Lcaron /lcaron +/Lacute /lacute +/M /m +/N /n +/Nacute /nacute +/Ncaron /ncaron +/O /o +/Oacute /oacute +/Ocircumflex /ocircumflex +/Ohungarumlaut /ohungarumlaut +/Odieresis /odieresis +/P /p +/Q /q +/R /r +/Racute /racute +/Rcaron /rcaron +/S /s +/Sacute /sacute +/Scaron /scaron +/Scedilla /scedilla +/T /t +/Tcaron /tcaron +/Tcedilla /tcedilla +/U /u +/Uacute /uacute +/Uring /uring +/Uhungarumlaut /uhungarumlaut +/Udieresis /udieresis +/V /v +/W /w +/X /x +/Y /y +/Yacute /yacute +/Z /z +/Zacute /zacute +/Zcaron /zcaron +/Zdotaccent /zdotaccent +/bracketleft +/backslash +/bracketright +/asciicircum +/underscore +/quoteleft +/braceleft +/bar +/braceright +/tilde +*** diff --git a/externals/mysql/strings/llstr.c b/externals/mysql/strings/llstr.c new file mode 100644 index 00000000000..643cf36a311 --- /dev/null +++ b/externals/mysql/strings/llstr.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Defines: llstr(); + + llstr(value, buff); + + This function saves a longlong value in a buffer and returns the pointer to + the buffer. This is useful when trying to portable print longlong + variables with printf() as there is no usable printf() standard one can use. +*/ + + +#include +#include "m_string.h" + +char *llstr(longlong value,char *buff) +{ + longlong10_to_str(value,buff,-10); + return buff; +} + +char *ullstr(longlong value,char *buff) +{ + longlong10_to_str(value,buff,10); + return buff; +} diff --git a/externals/mysql/strings/longlong2str.c b/externals/mysql/strings/longlong2str.c new file mode 100644 index 00000000000..641ae0955d3 --- /dev/null +++ b/externals/mysql/strings/longlong2str.c @@ -0,0 +1,143 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Defines: longlong2str(); + + longlong2str(dst, radix, val) + converts the (longlong) integer "val" to character form and moves it to + the destination string "dst" followed by a terminating NUL. The + result is normally a pointer to this NUL character, but if the radix + is dud the result will be NullS and nothing will be changed. + + If radix is -2..-36, val is taken to be SIGNED. + If radix is 2.. 36, val is taken to be UNSIGNED. + That is, val is signed if and only if radix is. You will normally + use radix -10 only through itoa and ltoa, for radix 2, 8, or 16 + unsigned is what you generally want. + + _dig_vec is public just in case someone has a use for it. + The definitions of itoa and ltoa are actually macros in m_string.h, + but this is where the code is. + + Note: The standard itoa() returns a pointer to the argument, when int2str + returns the pointer to the end-null. + itoa assumes that 10 -base numbers are allways signed and other arn't. +*/ + +#include +#include "m_string.h" + +#ifndef ll2str + +/* + This assumes that longlong multiplication is faster than longlong division. +*/ + +char *ll2str(longlong val,char *dst,int radix, int upcase) +{ + char buffer[65]; + register char *p; + long long_val; + char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; + ulonglong uval= (ulonglong) val; + + if (radix < 0) + { + if (radix < -36 || radix > -2) return (char*) 0; + if (val < 0) { + *dst++ = '-'; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; + } + radix = -radix; + } + else + { + if (radix > 36 || radix < 2) return (char*) 0; + } + if (uval == 0) + { + *dst++='0'; + *dst='\0'; + return dst; + } + p = &buffer[sizeof(buffer)-1]; + *p = '\0'; + + while (uval > (ulonglong) LONG_MAX) + { + ulonglong quo= uval/(uint) radix; + uint rem= (uint) (uval- quo* (uint) radix); + *--p= dig_vec[rem]; + uval= quo; + } + long_val= (long) uval; + while (long_val != 0) + { + long quo= long_val/radix; + *--p= dig_vec[(uchar) (long_val - quo*radix)]; + long_val= quo; + } + while ((*dst++ = *p++) != 0) ; + return dst-1; +} +#endif + +#ifndef longlong10_to_str +char *longlong10_to_str(longlong val,char *dst,int radix) +{ + char buffer[65]; + register char *p; + long long_val; + ulonglong uval= (ulonglong) val; + + if (radix < 0) + { + if (val < 0) + { + *dst++ = '-'; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; + } + } + + if (uval == 0) + { + *dst++='0'; + *dst='\0'; + return dst; + } + p = &buffer[sizeof(buffer)-1]; + *p = '\0'; + + while (uval > (ulonglong) LONG_MAX) + { + ulonglong quo= uval/(uint) 10; + uint rem= (uint) (uval- quo* (uint) 10); + *--p = _dig_vec_upper[rem]; + uval= quo; + } + long_val= (long) uval; + while (long_val != 0) + { + long quo= long_val/10; + *--p = _dig_vec_upper[(uchar) (long_val - quo*10)]; + long_val= quo; + } + while ((*dst++ = *p++) != 0) ; + return dst-1; +} +#endif diff --git a/externals/mysql/strings/longlong2str_asm.c b/externals/mysql/strings/longlong2str_asm.c new file mode 100644 index 00000000000..9a2b86b570c --- /dev/null +++ b/externals/mysql/strings/longlong2str_asm.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Wrapper for longlong2str.s + + We need this because the assembler code can't access the local variable + _dig_vector in a portable manner. +*/ + +#include +#include "m_string.h" + +extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, + const char *dig_vector); + +char *ll2str(longlong val,char *dst,int radix, int upcase) +{ + return longlong2str_with_dig_vector(val, dst, radix, + upcase?_dig_vec_upper:_dig_vec_lower); +} diff --git a/externals/mysql/strings/my_strchr.c b/externals/mysql/strings/my_strchr.c new file mode 100644 index 00000000000..6724bf39ff2 --- /dev/null +++ b/externals/mysql/strings/my_strchr.c @@ -0,0 +1,47 @@ +/* Copyright (C) 2005 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + my_strchr(cs, str, end, c) returns a pointer to the first place in + str where c (1-byte character) occurs, or NULL if c does not occur + in str. This function is multi-byte safe. + TODO: should be moved to CHARSET_INFO if it's going to be called + frequently. +*/ + +#include +#include "m_string.h" +#include "m_ctype.h" + + +char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, + pchar c) +{ + uint mbl; + while (str < end) + { + mbl= my_mbcharlen(cs, *(uchar *)str); + if (mbl < 2) + { + if (*str == c) + return((char *)str); + str++; + } + else + str+= mbl; + } + return(0); +} + diff --git a/externals/mysql/strings/my_strtoll10.c b/externals/mysql/strings/my_strtoll10.c new file mode 100644 index 00000000000..8dba51e9491 --- /dev/null +++ b/externals/mysql/strings/my_strtoll10.c @@ -0,0 +1,247 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include /* Needed for MY_ERRNO_ERANGE */ +#include + +#undef ULONGLONG_MAX +/* + Needed under MetroWerks Compiler, since MetroWerks compiler does not + properly handle a constant expression containing a mod operator +*/ +#if defined(__NETWARE__) && defined(__MWERKS__) +static ulonglong ulonglong_max= ~(ulonglong) 0; +#define ULONGLONG_MAX ulonglong_max +#else +#define ULONGLONG_MAX (~(ulonglong) 0) +#endif /* __NETWARE__ && __MWERKS__ */ +#define MAX_NEGATIVE_NUMBER ((ulonglong) 0x8000000000000000LL) +#define INIT_CNT 9 +#define LFACTOR 1000000000ULL +#define LFACTOR1 10000000000ULL +#define LFACTOR2 100000000000ULL + +static unsigned long lfactor[9]= +{ + 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L +}; + +/* + Convert a string to an to unsigned long long integer value + + SYNOPSYS + my_strtoll10() + nptr in pointer to the string to be converted + endptr in/out pointer to the end of the string/ + pointer to the stop character + error out returned error code + + DESCRIPTION + This function takes the decimal representation of integer number + from string nptr and converts it to an signed or unsigned + long long integer value. + Space characters and tab are ignored. + A sign character might precede the digit characters. The number + may have any number of pre-zero digits. + + The function stops reading the string nptr at the first character + that is not a decimal digit. If endptr is not NULL then the function + will not read characters after *endptr. + + RETURN VALUES + Value of string as a signed/unsigned longlong integer + + if no error and endptr != NULL, it will be set to point at the character + after the number + + The error parameter contains information how things went: + -1 Number was an ok negative number + 0 ok + ERANGE If the the value of the converted number exceeded the + maximum negative/unsigned long long integer. + In this case the return value is ~0 if value was + positive and LONGLONG_MIN if value was negative. + EDOM If the string didn't contain any digits. In this case + the return value is 0. + + If endptr is not NULL the function will store the end pointer to + the stop character here. +*/ + + +longlong my_strtoll10(const char *nptr, char **endptr, int *error) +{ + const char *s, *end, *start, *n_end, *true_end; + char *dummy; + uchar c; + unsigned long i, j, k; + ulonglong li; + int negative; + ulong cutoff, cutoff2, cutoff3; + + s= nptr; + /* If fixed length string */ + if (endptr) + { + end= *endptr; + while (s != end && (*s == ' ' || *s == '\t')) + s++; + if (s == end) + goto no_conv; + } + else + { + endptr= &dummy; /* Easier end test */ + while (*s == ' ' || *s == '\t') + s++; + if (!*s) + goto no_conv; + /* This number must be big to guard against a lot of pre-zeros */ + end= s+65535; /* Can't be longer than this */ + } + + /* Check for a sign. */ + negative= 0; + if (*s == '-') + { + *error= -1; /* Mark as negative number */ + negative= 1; + if (++s == end) + goto no_conv; + cutoff= MAX_NEGATIVE_NUMBER / LFACTOR2; + cutoff2= (MAX_NEGATIVE_NUMBER % LFACTOR2) / 100; + cutoff3= MAX_NEGATIVE_NUMBER % 100; + } + else + { + *error= 0; + if (*s == '+') + { + if (++s == end) + goto no_conv; + } + cutoff= ULONGLONG_MAX / LFACTOR2; + cutoff2= ULONGLONG_MAX % LFACTOR2 / 100; + cutoff3= ULONGLONG_MAX % 100; + } + + /* Handle case where we have a lot of pre-zero */ + if (*s == '0') + { + i= 0; + do + { + if (++s == end) + goto end_i; /* Return 0 */ + } + while (*s == '0'); + n_end= s+ INIT_CNT; + } + else + { + /* Read first digit to check that it's a valid number */ + if ((c= (*s-'0')) > 9) + goto no_conv; + i= c; + n_end= ++s+ INIT_CNT-1; + } + + /* Handle first 9 digits and store them in i */ + if (n_end > end) + n_end= end; + for (; s != n_end ; s++) + { + if ((c= (*s-'0')) > 9) + goto end_i; + i= i*10+c; + } + if (s == end) + goto end_i; + + /* Handle next 9 digits and store them in j */ + j= 0; + start= s; /* Used to know how much to shift i */ + n_end= true_end= s + INIT_CNT; + if (n_end > end) + n_end= end; + do + { + if ((c= (*s-'0')) > 9) + goto end_i_and_j; + j= j*10+c; + } while (++s != n_end); + if (s == end) + { + if (s != true_end) + goto end_i_and_j; + goto end3; + } + if ((c= (*s-'0')) > 9) + goto end3; + + /* Handle the next 1 or 2 digits and store them in k */ + k=c; + if (++s == end || (c= (*s-'0')) > 9) + goto end4; + k= k*10+c; + *endptr= (char*) ++s; + + /* number string should have ended here */ + if (s != end && (c= (*s-'0')) <= 9) + goto overflow; + + /* Check that we didn't get an overflow with the last digit */ + if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) && + k > cutoff3))) + goto overflow; + li=i*LFACTOR2+ (ulonglong) j*100 + k; + return (longlong) li; + +overflow: /* *endptr is set here */ + *error= MY_ERRNO_ERANGE; + return negative ? LONGLONG_MIN : (longlong) ULONGLONG_MAX; + +end_i: + *endptr= (char*) s; + return (negative ? ((longlong) -(long) i) : (longlong) i); + +end_i_and_j: + li= (ulonglong) i * lfactor[(uint) (s-start)] + j; + *endptr= (char*) s; + return (negative ? -((longlong) li) : (longlong) li); + +end3: + li=(ulonglong) i*LFACTOR+ (ulonglong) j; + *endptr= (char*) s; + return (negative ? -((longlong) li) : (longlong) li); + +end4: + li=(ulonglong) i*LFACTOR1+ (ulonglong) j * 10 + k; + *endptr= (char*) s; + if (negative) + { + if (li > MAX_NEGATIVE_NUMBER) + goto overflow; + return -((longlong) li); + } + return (longlong) li; + +no_conv: + /* There was no number to convert. */ + *error= MY_ERRNO_EDOM; + *endptr= (char *) nptr; + return 0; +} diff --git a/externals/mysql/strings/my_vsnprintf.c b/externals/mysql/strings/my_vsnprintf.c new file mode 100644 index 00000000000..ade53252db9 --- /dev/null +++ b/externals/mysql/strings/my_vsnprintf.c @@ -0,0 +1,252 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include + +/* + Limited snprintf() implementations + + exported to plugins as a service, see the detailed documentation + around my_snprintf_service_st +*/ + +size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) +{ + char *start=to, *end=to+n-1; + size_t length, width; + uint pre_zero, have_longlong; + + for (; *fmt ; fmt++) + { + if (*fmt != '%') + { + if (to == end) /* End of buffer */ + break; + *to++= *fmt; /* Copy ordinary char */ + continue; + } + fmt++; /* skip '%' */ + /* Read max fill size (only used with %d and %u) */ + if (*fmt == '-') + fmt++; + length= width= 0; + pre_zero= have_longlong= 0; + if (*fmt == '*') + { + fmt++; + length= va_arg(ap, int); + } + else + for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) + { + length= length * 10 + (uint)(*fmt - '0'); + if (!length) + pre_zero= 1; /* first digit was 0 */ + } + if (*fmt == '.') + { + fmt++; + if (*fmt == '*') + { + fmt++; + width= va_arg(ap, int); + } + else + { + for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) + width= width * 10 + (uint)(*fmt - '0'); + } + } + else + width= SIZE_T_MAX; + if (*fmt == 'l') + { + fmt++; + if (*fmt != 'l') + have_longlong= (sizeof(long) == sizeof(longlong)); + else + { + fmt++; + have_longlong= 1; + } + } + else if (*fmt == 'z') + { + fmt++; + have_longlong= (sizeof(size_t) == sizeof(longlong)); + } + if (*fmt == 's') /* String parameter */ + { + reg2 char *par= va_arg(ap, char *); + size_t plen, left_len= (size_t) (end - to) + 1; + if (!par) + par = (char*) "(null)"; + plen= strnlen(par, width); + if (left_len <= plen) + plen = left_len - 1; + to= strnmov(to,par,plen); + continue; + } + else if (*fmt == 'b') /* Buffer parameter */ + { + char *par = va_arg(ap, char *); + DBUG_ASSERT(to <= end); + if (to + width + 1 > end) + width= end - to - 1; /* sign doesn't matter */ + memmove(to, par, width); + to+= width; + continue; + } + else if (*fmt == 'f' || *fmt == 'g') + { + double d= va_arg(ap, double); + if (width == SIZE_T_MAX) + width= FLT_DIG; /* width not set, use default */ + else if (width >= NOT_FIXED_DEC) + width= NOT_FIXED_DEC - 1; /* max.precision for my_fcvt() */ + width= min(width, (size_t)(end-to) - 1); + + if (*fmt == 'f') + to+= my_fcvt(d, (int)width , to, NULL); + else + to+= my_gcvt(d, MY_GCVT_ARG_DOUBLE, (int) width , to, NULL); + } + else if (*fmt == 'd' || *fmt == 'u' || *fmt == 'x' || *fmt == 'X' || + *fmt == 'p') + { + /* Integer parameter */ + longlong larg; + size_t res_length, to_length; + char *store_start= to, *store_end; + char buff[32]; + if (*fmt == 'p') + { + have_longlong= (sizeof(void *) == sizeof(longlong)); + } + + if ((to_length= (size_t) (end-to)) < 16 || length) + store_start= buff; + if (have_longlong) + larg = va_arg(ap,longlong); + else if (*fmt == 'd') + larg = va_arg(ap, int); + else + larg= va_arg(ap, uint); + if (*fmt == 'd') + store_end= longlong10_to_str(larg, store_start, -10); + else if (*fmt == 'u') + store_end= longlong10_to_str(larg, store_start, 10); + else if (*fmt == 'p') + { + store_start[0]= '0'; + store_start[1]= 'x'; + store_end= ll2str(larg, store_start + 2, 16, 0); + } + else + { + DBUG_ASSERT(*fmt == 'X' || *fmt =='x'); + store_end= ll2str(larg, store_start, 16, (*fmt == 'X')); + } + + if ((res_length= (size_t) (store_end - store_start)) > to_length) + break; /* num doesn't fit in output */ + /* If %#d syntax was used, we have to pre-zero/pre-space the string */ + if (store_start == buff) + { + length= min(length, to_length); + if (res_length < length) + { + size_t diff= (length- res_length); + bfill(to, diff, pre_zero ? '0' : ' '); + to+= diff; + } + bmove(to, store_start, res_length); + } + to+= res_length; + continue; + } + else if (*fmt == 'c') /* Character parameter */ + { + register int larg; + if (to == end) + break; + larg = va_arg(ap, int); + *to++= (char) larg; + continue; + } + + /* We come here on '%%', unknown code or too long parameter */ + if (to == end) + break; + *to++='%'; /* % used as % or unknown code */ + } + DBUG_ASSERT(to <= end); + *to='\0'; /* End of errmessage */ + return (size_t) (to - start); +} + + +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) +{ + size_t result; + va_list args; + va_start(args,fmt); + result= my_vsnprintf(to, n, fmt, args); + va_end(args); + return result; +} + +#ifdef MAIN +#define OVERRUN_SENTRY 250 +static void my_printf(const char * fmt, ...) +{ + char buf[33]; + int n; + va_list ar; + va_start(ar, fmt); + buf[sizeof(buf)-1]=OVERRUN_SENTRY; + n = my_vsnprintf(buf, sizeof(buf)-1,fmt, ar); + printf(buf); + printf("n=%d, strlen=%d\n", n, strlen(buf)); + if ((uchar) buf[sizeof(buf)-1] != OVERRUN_SENTRY) + { + fprintf(stderr, "Buffer overrun\n"); + abort(); + } + va_end(ar); +} + + +int main() +{ + + my_printf("Hello\n"); + my_printf("Hello int, %d\n", 1); + my_printf("Hello string '%s'\n", "I am a string"); + my_printf("Hello hack hack hack hack hack hack hack %d\n", 1); + my_printf("Hello %d hack %d\n", 1, 4); + my_printf("Hello %d hack hack hack hack hack %d\n", 1, 4); + my_printf("Hello '%s' hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\n", "hack"); + my_printf("Hello hhhhhhhhhhhhhh %d sssssssssssssss\n", 1); + my_printf("Hello %u\n", 1); + my_printf("Hex: %lx '%6lx'\n", 32, 65); + my_printf("conn %ld to: '%-.64s' user: '%-.32s' host:\ + `%-.64s' (%-.64s)", 1, 0,0,0,0); + return 0; +} +#endif diff --git a/externals/mysql/strings/r_strinstr.c b/externals/mysql/strings/r_strinstr.c new file mode 100644 index 00000000000..fb1e0c5a090 --- /dev/null +++ b/externals/mysql/strings/r_strinstr.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Author : David + strintstr(src, from, pat) looks for an instance of pat in src + backwards from pos from. pat is not a regex(3) pattern, it is a literal + string which must be matched exactly. + The result 0 if the pattern was not found else it is the start char of + the pattern counted from the begining of the string. +*/ + +#include +#include "m_string.h" + +size_t r_strinstr(reg1 const char * str, size_t from, reg4 const char * search) +{ + reg2 const char *i, *j; + size_t len = strlen(search); + /* pointer to the last char of buff */ + const char * start = str + from - 1; + /* pointer to the last char of search */ + const char * search_end = search + len - 1; + + skip: + while (start >= str) /* Cant be != because the first char */ + { + if (*start-- == *search_end) + { + i = start; j = search_end - 1; + while (j >= search && start > str) + if (*i-- != *j--) + goto skip; + return (size_t) ((start - len) - str + 3); + } + } + return (0); +} diff --git a/externals/mysql/strings/str2int.c b/externals/mysql/strings/str2int.c new file mode 100644 index 00000000000..c4a4c07eeff --- /dev/null +++ b/externals/mysql/strings/str2int.c @@ -0,0 +1,201 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + str2int(src, radix, lower, upper, &val) + converts the string pointed to by src to an integer and stores it in + val. It skips leading spaces and tabs (but not newlines, formfeeds, + backspaces), then it accepts an optional sign and a sequence of digits + in the specified radix. The result should satisfy lower <= *val <= upper. + The result is a pointer to the first character after the number; + trailing spaces will NOT be skipped. + + If an error is detected, the result will be NullS, the value put + in val will be 0, and errno will be set to + EDOM if there are no digits + ERANGE if the result would overflow or otherwise fail to lie + within the specified bounds. + Check that the bounds are right for your machine. + This looks amazingly complicated for what you probably thought was an + easy task. Coping with integer overflow and the asymmetric range of + twos complement machines is anything but easy. + + So that users of atoi and atol can check whether an error occured, + I have taken a wholly unprecedented step: errno is CLEARED if this + call has no problems. +*/ + +#include +#include "m_string.h" +#include "m_ctype.h" +#include "my_sys.h" /* defines errno */ +#include + +#define char_val(X) (X >= '0' && X <= '9' ? X-'0' :\ + X >= 'A' && X <= 'Z' ? X-'A'+10 :\ + X >= 'a' && X <= 'z' ? X-'a'+10 :\ + '\177') + +char *str2int(register const char *src, register int radix, long int lower, + long int upper, long int *val) +{ + int sign; /* is number negative (+1) or positive (-1) */ + int n; /* number of digits yet to be converted */ + long limit; /* "largest" possible valid input */ + long scale; /* the amount to multiply next digit by */ + long sofar; /* the running value */ + register int d; /* (negative of) next digit */ + char *start; + int digits[32]; /* Room for numbers */ + + /* Make sure *val is sensible in case of error */ + + *val = 0; + + /* Check that the radix is in the range 2..36 */ + +#ifndef DBUG_OFF + if (radix < 2 || radix > 36) { + errno=EDOM; + return NullS; + } +#endif + + /* The basic problem is: how do we handle the conversion of + a number without resorting to machine-specific code to + check for overflow? Obviously, we have to ensure that + no calculation can overflow. We are guaranteed that the + "lower" and "upper" arguments are valid machine integers. + On sign-and-magnitude, twos-complement, and ones-complement + machines all, if +|n| is representable, so is -|n|, but on + twos complement machines the converse is not true. So the + "maximum" representable number has a negative representative. + Limit is set to min(-|lower|,-|upper|); this is the "largest" + number we are concerned with. */ + + /* Calculate Limit using Scale as a scratch variable */ + + if ((limit = lower) > 0) limit = -limit; + if ((scale = upper) > 0) scale = -scale; + if (scale < limit) limit = scale; + + /* Skip leading spaces and check for a sign. + Note: because on a 2s complement machine MinLong is a valid + integer but |MinLong| is not, we have to keep the current + converted value (and the scale!) as *negative* numbers, + so the sign is the opposite of what you might expect. + */ + while (my_isspace(&my_charset_latin1,*src)) src++; + sign = -1; + if (*src == '+') src++; else + if (*src == '-') src++, sign = 1; + + /* Skip leading zeros so that we never compute a power of radix + in scale that we won't have a need for. Otherwise sticking + enough 0s in front of a number could cause the multiplication + to overflow when it neededn't. + */ + start=(char*) src; + while (*src == '0') src++; + + /* Move over the remaining digits. We have to convert from left + to left in order to avoid overflow. Answer is after last digit. + */ + + for (n = 0; (digits[n]=char_val(*src)) < radix && n < 20; n++,src++) ; + + /* Check that there is at least one digit */ + + if (start == src) { + errno=EDOM; + return NullS; + } + + /* The invariant we want to maintain is that src is just + to the right of n digits, we've converted k digits to + sofar, scale = -radix**k, and scale < sofar < 0. Now + if the final number is to be within the original + Limit, we must have (to the left)*scale+sofar >= Limit, + or (to the left)*scale >= Limit-sofar, i.e. the digits + to the left of src must form an integer <= (Limit-sofar)/(scale). + In particular, this is true of the next digit. In our + incremental calculation of Limit, + + IT IS VITAL that (-|N|)/(-|D|) = |N|/|D| + */ + + for (sofar = 0, scale = -1; --n >= 1;) + { + if ((long) -(d=digits[n]) < limit) { + errno=ERANGE; + return NullS; + } + limit = (limit+d)/radix, sofar += d*scale; scale *= radix; + } + if (n == 0) + { + if ((long) -(d=digits[n]) < limit) /* get last digit */ + { + errno=ERANGE; + return NullS; + } + sofar+=d*scale; + } + + /* Now it might still happen that sofar = -32768 or its equivalent, + so we can't just multiply by the sign and check that the result + is in the range lower..upper. All of this caution is a right + pain in the neck. If only there were a standard routine which + says generate thus and such a signal on integer overflow... + But not enough machines can do it *SIGH*. + */ + if (sign < 0) + { + if (sofar < -LONG_MAX || (sofar= -sofar) > upper) + { + errno=ERANGE; + return NullS; + } + } + else if (sofar < lower) + { + errno=ERANGE; + return NullS; + } + *val = sofar; + errno=0; /* indicate that all went well */ + return (char*) src; +} + + /* Theese are so slow compared with ordinary, optimized atoi */ + +#ifdef WANT_OUR_ATOI + +int atoi(const char *src) +{ + long val; + str2int(src, 10, (long) INT_MIN, (long) INT_MAX, &val); + return (int) val; +} + + +long atol(const char *src) +{ + long val; + str2int(src, 10, LONG_MIN, LONG_MAX, &val); + return val; +} + +#endif /* WANT_OUR_ATOI */ diff --git a/externals/mysql/strings/str_alloc.c b/externals/mysql/strings/str_alloc.c new file mode 100644 index 00000000000..615ad1ba1e2 --- /dev/null +++ b/externals/mysql/strings/str_alloc.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +static void *my_str_malloc_default(size_t size) +{ + void *ret= malloc(size); + if (!ret) + exit(1); + return ret; +} + +static void my_str_free_default(void *ptr) +{ + free(ptr); +} + +void *(*my_str_malloc)(size_t)= &my_str_malloc_default; +void (*my_str_free)(void *)= &my_str_free_default; diff --git a/externals/mysql/strings/str_test.c b/externals/mysql/strings/str_test.c new file mode 100644 index 00000000000..e4358196f27 --- /dev/null +++ b/externals/mysql/strings/str_test.c @@ -0,0 +1,277 @@ +/* Copyright (C) 2000-2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Test of all stringfunktions that is coded in assembler */ + +#include +#include +#include "m_string.h" + +#define F_LEN 8 +#define F_CHAR 'A' +#define F_FILL 'B' +#define T_LEN 15 +#define T_CHAR 'D' +#define T_FILL 'E' +#define F_PREFILL '0' +#define T_PREFILL '1' + +static char from_buff[100],to_buff[100]; +static char * from, *to; +static int errors,tests; +static int test_strarg(const char *name,...); +static void init_strings (void); /* Init from and to */ +void test_arg (const char *message,long func_value,long value); +int compare_buff(const char *message,char * b1,char * b2,int length, + pchar fill, pchar prefill); + +static int my_test(int a) +{ + return a ? 1 : 0; +} + +int main(void) +{ + static char v1[]="Monty",v2[]="on",v3[]="Montys",v4[]="ty",v5[]="gr", + v6[]="hohohoo",v7[]="hohoo",v8[]="hohooo",v9[]="t", + cont[]="qwet"; + errors=tests=0; + init_strings(); + + test_arg("bcmp(from,to,5)",(long) my_test(bcmp(from,to,5)),1L); + test_arg("bcmp(from,from,5)",(long) bcmp(from,from,5),0L); + + test_arg("bcmp(from,to,0)",(long) bcmp(from,to,0),0L); + test_arg("strend(from)",(long) strend(from),(long) from+F_LEN); + test_arg("strchr(v1,'M')",(long) strchr(v1,'M'),(long) v1); + test_arg("strchr(v1,'y')",(long) strchr(v1,'y'),(long) v1+4); + test_arg("strchr(v1,'x')",(long) strchr(v1,'x'),0L); + test_arg("strcont(v1,cont)",(long) strcont(v1,cont),(long) v1+3); + test_arg("strcont(v1,v2)",(long) strcont(v1,v2),(long) v1+1); + test_arg("strcont(v1,v5)",(long) strcont(v1,v5),0L); + test_arg("is_prefix(v3,v1)",(long) is_prefix(v3,v1),1L); + test_arg("is_prefix(v1,v3)",(long) is_prefix(v1,v3),0L); + test_arg("is_prefix(v3,v4)",(long) is_prefix(v3,v4),0L); + test_arg("strstr(v1,v1)",(long) strstr(v1,v1),(long) v1); + test_arg("strstr(v1,v2)",(long) strstr(v1,v2),(long) v1+1); + test_arg("strstr(v1,v4)",(long) strstr(v1,v4),(long) v1+3); + test_arg("strstr(v6,v7)",(long) strstr(v6,v7),(long) v6+2); + test_arg("strstr(v1,v9)",(long) strstr(v1,v9),(long) v1+3); + test_arg("strstr(v1,v3)",(long) strstr(v1,v3),0L); + test_arg("strstr(v1,v5)",(long) strstr(v1,v5),0L); + test_arg("strstr(v6,v8)",(long) strstr(v6,v8),0L); + + test_arg("strinstr(v1,v4)",(long) strinstr(v1,v4),4L); + test_arg("strinstr(v1,v5)",(long) strinstr(v1,v5),0L); + test_arg("strlen(from)",(long) strlen(from),(long) F_LEN); + test_arg("strlen(\"\")",(long) strlen(""),0L); +#ifdef HAVE_STRNLEN + test_arg("strnlen(from,3)",(long) strnlen(from,3),3L); + test_arg("strnlen(from,0)",(long) strnlen(from,0),0L); + test_arg("strnlen(from,1000)",(long) strnlen(from,1000),(long) F_LEN); +#endif + + test_strarg("bfill(to,4,' ')",(bfill(to,4,' '),0L),INT_MAX32,4,' ',0,0); + test_strarg("bfill(from,0,' ')",(bfill(from,0,' '),0L),INT_MAX32,0,0); + test_strarg("bzero(to,3)",(bzero(to,3),0L),INT_MAX32,3,0,0,0); + test_strarg("bzero(to,0)",(bzero(to,0),0L),INT_MAX32,0,0); + test_strarg("bmove(to,from,4)",(bmove(to,from,4),0L),INT_MAX32,4,F_CHAR, + 0,0); + test_strarg("bmove(to,from,0)",(bmove(to,from,0),0L),INT_MAX32,0,0); + test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp(to+6,from+6,3),0L),INT_MAX32, + 3,T_CHAR,3,F_CHAR,0,0); + test_strarg("bmove_upp(to,from,0)",(bmove_upp(to,from,0),0L),INT_MAX32,0,0); + test_strarg("bmove_align(to,from,8)",(bmove_align(to,from,8),0L),INT_MAX32, + 8,F_CHAR,0,0); + test_strarg("strappend(to,3,' ')",(strappend(to,3,' '),0L),INT_MAX32, + 3,T_CHAR,1,0,T_LEN-4,T_CHAR,1,0,0,0); + test_strarg("strappend(to,T_LEN+5,' ')",(strappend(to,T_LEN+5,' '),0L),INT_MAX32, + T_LEN,T_CHAR,5,' ',1,0,0,0); + test_strarg("strcat(to,from)",strcat(to,from),to,T_LEN,T_CHAR, + F_LEN,F_CHAR,1,0,0,0); + test_strarg("strcat(to,\"\")",strcat(to,""),INT_MAX32,0,0); + test_strarg("strfill(to,4,' ')",strfill(to,4,' '),to+4,4,' ',1,0,0,0); + test_strarg("strfill(from,0,' ')",strfill(from,0,' '),from,0,1,0,0); + test_strarg("strmake(to,from,4)",strmake(to,from,4),to+4,4,F_CHAR, + 1,0,0,0); + test_strarg("strmake(to,from,0)",strmake(to,from,0),to+0,1,0,0,0); + test_strarg("strmov(to,from)",strmov(to,from),to+F_LEN,F_LEN,F_CHAR,0,0); + test_strarg("strmov(to,\"\")",strmov(to,""),to,1,0,0,0); + test_strarg("strnmov(to,from,2)",strnmov(to,from,2),to+2,2,F_CHAR,0,0); + test_strarg("strnmov(to,from,F_LEN+5)",strnmov(to,from,F_LEN+5),to+F_LEN, + F_LEN,F_CHAR,1,0,0,0); + test_strarg("strnmov(to,\"\",2)",strnmov(to,"",2),to,1,0,0,0); + test_strarg("strxmov(to,from,\"!!\",NullS)",strxmov(to,from,"!!",NullS),to+F_LEN+2,F_LEN,F_CHAR,2,'!',0,0,0); + test_strarg("strxmov(to,NullS)",strxmov(to,NullS),to,1,0,0,0); + test_strarg("strxmov(to,from,from,from,from,from,'!!',from,NullS)",strxmov(to,from,from,from,from,from,"!!",from,NullS),to+F_LEN*6+2,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,2,'!',F_LEN,F_CHAR,1,0,0,0); + + test_strarg("strxnmov(to,100,from,\"!!\",NullS)",strxnmov(to,100,from,"!!",NullS),to+F_LEN+2,F_LEN,F_CHAR,2,'!',0,0,0); + test_strarg("strxnmov(to,2,NullS)",strxnmov(to,2,NullS),to,1,0,0,0); + test_strarg("strxnmov(to,100,from,from,from,from,from,'!!',from,NullS)",strxnmov(to,100,from,from,from,from,from,"!!",from,NullS),to+F_LEN*6+2,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,2,'!',F_LEN,F_CHAR,1,0,0,0); + test_strarg("strxnmov(to,2,\"!!!\",NullS)",strxnmov(to,2,"!!!",NullS),to+2,2,'!',0,0,0); + test_strarg("strxnmov(to,2,\"!!\",NullS)",strxnmov(to,2,"!!","xx",NullS),to+2,2,'!',0,0,0); + test_strarg("strxnmov(to,2,\"!\",\"x\",\"y\",NullS)",strxnmov(to,2,"!","x","y",NullS),to+2,1,'!',1,'x',0,0,0); + + test_strarg("bchange(to,2,from,4,6)",(bchange(to,2,from,4,6),0L),INT_MAX32, + 4,F_CHAR,2,T_CHAR,0,0); + + printf("tests: %d errors: %d\n",tests,errors); + if (errors) + fputs("--- Some functions doesn't work!! Fix them\n",stderr); + return(errors > 0); +} /* main */ + + + /* Init strings */ + +void init_strings(void) +{ + reg1 int i; + reg2 char *pos; + + from=from_buff+3; to=to_buff+3; + + pos=from_buff; *pos++= F_FILL; *pos++=F_FILL; *pos++=F_PREFILL; + for (i=0 ; i < F_LEN ; i++) + *pos++=F_CHAR; + *pos++=0; + for (i=0; i<50 ; i++) + *pos++= F_FILL; + + pos=to_buff; *pos++= T_FILL; *pos++=T_FILL; *pos++=T_PREFILL; + for (i=0 ; i < T_LEN ; i++) + *pos++=T_CHAR; + *pos++=0; + for (i=0; i<50 ; i++) + *pos++= T_FILL; +} /* init_strings */ + + + /* Test that function return rigth value */ + +void test_arg(const char *message, long int func_value, long int value) +{ + tests++; + printf("testing '%s'\n",message); + if (func_value != value) + { + printf("func: '%s' = %ld Should be: %ld\n",message,func_value,value); + errors++; + } +} /* test_arg */ + + /* Test function return value and from and to arrays */ + +static int test_strarg(const char *message,...) +{ + long func_value,value; + int error,length; + char chr,cmp_buff[100],*pos,*pos2; + va_list pvar; + + tests++; + va_start(pvar,message); + func_value=va_arg(pvar,long); + value=va_arg(pvar,long); + + printf("testing '%s'\n",message); + if (func_value != value && value != INT_MAX32) + { + printf("func: '%s' = %ld Should be: %ld\n",message,func_value,value); + errors++; + } + pos= cmp_buff; + while ((length = va_arg(pvar, int)) != 0) + { + chr= (char) (va_arg(pvar, int)); + while (length--) + *pos++=chr; + } + pos2=to+ (int)(pos-cmp_buff); + while (pos <= cmp_buff+T_LEN) + *pos++= *pos2++; + if (compare_buff(message,to,cmp_buff,(int) (pos-cmp_buff),T_FILL,T_PREFILL)) + { + init_strings(); + va_end(pvar); + return 1; + } + + pos= cmp_buff; + while ((length = va_arg(pvar, int)) != 0) + { + chr= (char) (va_arg(pvar, int)); + while (length--) + *pos++=chr; + } + pos2=from+ (int)(pos-cmp_buff); + while (pos <= cmp_buff+F_LEN) + *pos++= *pos2++; + error=compare_buff(message,from,cmp_buff,(int) (pos-cmp_buff),F_FILL,F_PREFILL); + init_strings(); + va_end(pvar); + return (error != 0); +} /* test_strarg */ + + + /* test if function made right value */ + +int compare_buff(const char *message, char * b1, char * b2, int length, + pchar fill, pchar prefill) +{ + int i,error=0; + + if (bcmp(b1,b2,length)) + { + errors++; + printf("func: '%s' Buffers differ\nIs: ",message); + for (i=0 ; i +#include "m_string.h" + + +void strappend(register char *s, size_t len, pchar fill) +{ + register char *endpos; + + endpos = s+len; + while (*s++); + s--; + while (s +#include "m_string.h" + +#if defined(MC68000) && defined(DS90) + +char *strcend(const char *s, pchar c) +{ +asm(" movl 4(a7),a0 "); +asm(" movl 8(a7),d1 "); +asm(".L2: movb (a0)+,d0 "); +asm(" cmpb d0,d1 "); +asm(" beq .L1 "); +asm(" tstb d0 "); +asm(" bne .L2 "); +asm(".L1: movl a0,d0 "); +asm(" subql #1,d0 "); +} + +#else + +char *strcend(register const char *s, register pchar c) +{ + for (;;) + { + if (*s == (char) c) return (char*) s; + if (!*s++) return (char*) s-1; + } +} + +#endif diff --git a/externals/mysql/strings/strcont.c b/externals/mysql/strings/strcont.c new file mode 100644 index 00000000000..5a518a3550f --- /dev/null +++ b/externals/mysql/strings/strcont.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : strcont.c + Author : Monty + Updated: 1988.07.27 + Defines: strcont() + + strcont(str, set) if str contanies any character in the string set. + The result is the position of the first found character in str, or NullS + if there isn't anything found. + +*/ + +#include +#include "m_string.h" + +char * strcont(reg1 const char *str,reg2 const char *set) +{ + reg3 char * start = (char *) set; + + while (*str) + { + while (*set) + { + if (*set++ == *str) + return ((char*) str); + } + set=start; str++; + } + return (NullS); +} /* strcont */ diff --git a/externals/mysql/strings/strend.c b/externals/mysql/strings/strend.c new file mode 100644 index 00000000000..4dadf0675dc --- /dev/null +++ b/externals/mysql/strings/strend.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* File : strend.c + Author : Richard A. O'Keefe. + Updated: 23 April 1984 + Defines: strend() + + strend(s) returns a character pointer to the NUL which ends s. That + is, strend(s)-s == strlen(s). This is useful for adding things at + the end of strings. It is redundant, because strchr(s,'\0') could + be used instead, but this is clearer and faster. + Beware: the asm version works only if strlen(s) < 65535. +*/ + +#include +#include "m_string.h" + +#if VaxAsm + +char *strend(s) +const char *s; +{ + asm("locc $0,$65535,*4(ap)"); + asm("movl r1,r0"); +} + +#else /* ~VaxAsm */ + +char *strend(register const char *s) +{ + while (*s++); + return (char*) (s-1); +} + +#endif /* VaxAsm */ diff --git a/externals/mysql/strings/strfill.c b/externals/mysql/strings/strfill.c new file mode 100644 index 00000000000..4b1fe67b206 --- /dev/null +++ b/externals/mysql/strings/strfill.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : strfill.c + Author : Monty + Updated: 1987.04.16 + Defines: strfill() + + strfill(dest, len, fill) makes a string of fill-characters. The result + string is of length == len. The des+len character is allways set to NULL. + strfill() returns pointer to dest+len; +*/ + +#include +#include "m_string.h" + +char * strfill(char *s, size_t len, pchar fill) +{ + while (len--) *s++ = fill; + *(s) = '\0'; + return(s); +} /* strfill */ diff --git a/externals/mysql/strings/strings-not-used.h b/externals/mysql/strings/strings-not-used.h new file mode 100644 index 00000000000..3efaa8ab6eb --- /dev/null +++ b/externals/mysql/strings/strings-not-used.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : strings.h + Author : Richard A. O'Keefe. + Updated: 1 June 1984 + Purpose: Header file for the "string(3C)" package. + + All the routines in this package are the original work of + R.A.O'Keefe. Any resemblance between them and any routines in + licensed software is due entirely to these routines having been + written using the "man 3 string" UNIX manual page, or in some cases + the "man 1 sort" manual page as a specification. See the READ-ME to + find the conditions under which these routines may be used & copied. +*/ + +#ifndef NullS + +#include /* Define standar vars */ +#include "m_string.h" + +#define NUL '\0' +#define _AlphabetSize 256 + +#endif /* NullS */ diff --git a/externals/mysql/strings/strinstr.c b/externals/mysql/strings/strinstr.c new file mode 100644 index 00000000000..dce498d61e8 --- /dev/null +++ b/externals/mysql/strings/strinstr.c @@ -0,0 +1,48 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : strinstr.c + Author : Monty & David + Updated: 1986.12.08 + Defines: strinstr() + + strinstr(src, pat) looks for an instance of pat in src. pat is not a + regex(3) pattern, it is a literal string which must be matched exactly. + The result 0 if the pattern was not found else it is the start char of + the pattern counted from the beginning of the string, where the first + char is 1. +*/ + +#include +#include "m_string.h" + +size_t strinstr(reg1 const char *str,reg4 const char *search) +{ + reg2 const char *i, *j; + const char *start= str; + + skip: + while (*str != '\0') + { + if (*str++ == *search) + { + i= str; j= search+1; + while (*j) + if (*i++ != *j++) goto skip; + return ((size_t) (str - start)); + } + } + return (0); +} diff --git a/externals/mysql/strings/strmake.c b/externals/mysql/strings/strmake.c new file mode 100644 index 00000000000..903a1b83626 --- /dev/null +++ b/externals/mysql/strings/strmake.c @@ -0,0 +1,66 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : strmake.c + Author : Michael Widenius + Updated: 20 Jul 1984 + Defines: strmake() + + strmake(dst,src,length) moves length characters, or until end, of src to + dst and appends a closing NUL to dst. + Note that if strlen(src) >= length then dst[length] will be set to \0 + strmake() returns pointer to closing null +*/ + +#include +#include "m_string.h" + +char *strmake(register char *dst, register const char *src, size_t length) +{ + while (length--) + { + if (! (*dst++ = *src++)) + { +#ifdef EXTRA_DEBUG + /* + 'length' is the maximum length of the string; the buffer needs + to be one character larger to accommodate the terminating + '\0'. This is easy to get wrong, so we make sure we write to + the entire length of the buffer to identify incorrect + buffer-sizes. We only initialism the "unused" part of the + buffer here, a) for efficiency, and b) because dst==src is + allowed, so initializing the entire buffer would overwrite the + source-string. Also, we write a character rather than '\0' as + this makes spotting these problems in the results easier. + + If we are using purify/valgrind, we only set one character at + end to be able to detect also wrong accesses after the end of + dst. + */ + if (length) + { +#ifdef HAVE_purify + dst[length-1]= 'Z'; +#else + bfill(dst, length-1, (int) 'Z'); +#endif /* HAVE_purify */ + } +#endif /* EXTRA_DEBUG */ + return dst-1; + } + } + *dst=0; + return dst; +} diff --git a/externals/mysql/strings/strmov.c b/externals/mysql/strings/strmov.c new file mode 100644 index 00000000000..1393411dd8f --- /dev/null +++ b/externals/mysql/strings/strmov.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + strmov(dst, src) moves all the characters of src (including the + closing NUL) to dst, and returns a pointer to the new closing NUL in + dst. The similar UNIX routine strcpy returns the old value of dst, + which I have never found useful. strmov(strmov(dst,a),b) moves a//b + into dst, which seems useful. +*/ + +#include +#include "m_string.h" + +#ifdef BAD_STRING_COMPILER +#undef strmov +#define strmov strmov_overlapp +#endif + +#ifndef strmov + +#if !defined(MC68000) && !defined(DS90) + +char *strmov(register char *dst, register const char *src) +{ + while ((*dst++ = *src++)) ; + return dst-1; +} + +#else + +char *strmov(dst, src) + char *dst, *src; +{ + asm(" movl 4(a7),a1 "); + asm(" movl 8(a7),a0 "); + asm(".L4: movb (a0)+,(a1)+ "); + asm(" jne .L4 "); + asm(" movl a1,d0 "); + asm(" subql #1,d0 "); +} + +#endif + +#endif /* strmov */ diff --git a/externals/mysql/strings/strnlen.c b/externals/mysql/strings/strnlen.c new file mode 100644 index 00000000000..826cd5ae5dd --- /dev/null +++ b/externals/mysql/strings/strnlen.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* File : strnlen.c + Author : Michael Widenius + Updated: 20 April 1984 + Defines: strnlen. + strnlen(s, len) returns the length of s or len if s is longer than len. +*/ + +#include +#include "m_string.h" + +#ifndef HAVE_STRNLEN + +size_t strnlen(register const char *s, register size_t maxlen) +{ + const char *end= (const char *)memchr(s, '\0', maxlen); + return end ? (size_t) (end - s) : maxlen; +} + +#endif diff --git a/externals/mysql/strings/strnmov.c b/externals/mysql/strings/strnmov.c new file mode 100644 index 00000000000..7e26877637b --- /dev/null +++ b/externals/mysql/strings/strnmov.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + strnmov(dst,src,length) moves length characters, or until end, of src to + dst and appends a closing NUL to dst if src is shorter than length. + The result is a pointer to the first NUL in dst, or is dst+n if dst was + truncated. +*/ + +#include +#include "m_string.h" + +char *strnmov(register char *dst, register const char *src, size_t n) +{ + while (n-- != 0) { + if (!(*dst++ = *src++)) { + return (char*) dst-1; + } + } + return dst; +} diff --git a/externals/mysql/strings/strstr.c b/externals/mysql/strings/strstr.c new file mode 100644 index 00000000000..a5b50d12043 --- /dev/null +++ b/externals/mysql/strings/strstr.c @@ -0,0 +1,52 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* File : strstr.c + Author : Monty + Updated: 1986.11.24 + Defines: strstr() + + strstr(src, pat) looks for an instance of pat in src. pat is not a + regex(3) pattern, it is a literal string which must be matched exactly. + The result is a pointer to the first character of the located instance, + or NullS if pat does not occur in src. + +*/ + +#include +#include "m_string.h" + +#ifndef HAVE_STRSTR + +char *strstr(register const char *str,const char *search) +{ + register char *i,*j; + register char first= *search; + +skip: + while (*str != '\0') { + if (*str++ == first) { + i=(char*) str; j=(char*) search+1; + while (*j) + if (*i++ != *j++) goto skip; + return ((char*) str-1); + } + } + return ((char*) 0); +} /* strstr */ + +#endif diff --git a/externals/mysql/strings/strto.c b/externals/mysql/strings/strto.c new file mode 100644 index 00000000000..fcb0d800b81 --- /dev/null +++ b/externals/mysql/strings/strto.c @@ -0,0 +1,209 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + strtol,strtoul,strtoll,strtoull + convert string to long, unsigned long, long long or unsigned long long. + strtoxx(char *src,char **ptr,int base) + converts the string pointed to by src to an long of appropriate long and + returnes it. It skips leading spaces and tabs (but not newlines, formfeeds, + backspaces), then it accepts an optional sign and a sequence of digits + in the specified radix. + If the value of ptr is not (char **)NULL, a pointer to the character + terminating the scan is returned in the location pointed to by ptr. + Trailing spaces will NOT be skipped. + + If an error is detected, the result will be LONG_MIN, 0 or LONG_MAX, + (or LONGLONG..) and errno will be set to + EDOM if there are no digits + ERANGE if the result would overflow. + the ptr will be set to src. + This file is based on the strtol from the the GNU C Library. + it can be compiled with the UNSIGNED and/or LONGLONG flag set +*/ + + +#if !defined(_global_h) || !defined(_m_string_h) +# error Calling file must include 'my_global.h' and 'm_string.h' + /* see 'strtoll.c' and 'strtoull.c' for the reasons */ +#endif + +#include "m_ctype.h" +#include "my_sys.h" /* defines errno */ +#include + +#undef strtoull +#undef strtoll +#undef strtoul +#undef strtol +#ifdef USE_LONGLONG +#define UTYPE_MAX (~(ulonglong) 0) +#define TYPE_MIN LONGLONG_MIN +#define TYPE_MAX LONGLONG_MAX +#define longtype longlong +#define ulongtype ulonglong +#ifdef USE_UNSIGNED +#define function ulongtype strtoull +#else +#define function longtype strtoll +#endif +#else +#define UTYPE_MAX (ulong) ~0L +#define TYPE_MIN LONG_MIN +#define TYPE_MAX LONG_MAX +#define longtype long +#define ulongtype unsigned long +#ifdef USE_UNSIGNED +#define function ulongtype strtoul +#else +#define function longtype strtol +#endif +#endif + + +/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. + If BASE is 0 the base is determined by the presence of a leading + zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. + If BASE is < 2 or > 36, it is reset to 10. + If ENDPTR is not NULL, a pointer to the character after the last + one converted is stored in *ENDPTR. */ + + +function (const char *nptr,char **endptr,int base) +{ + int negative; + register ulongtype cutoff; + register unsigned int cutlim; + register ulongtype i; + register const char *s; + register uchar c; + const char *save; + int overflow; + + if (base < 0 || base == 1 || base > 36) + base = 10; + + s = nptr; + + /* Skip white space. */ + while (my_isspace(&my_charset_latin1, *s)) + ++s; + if (*s == '\0') + { + goto noconv; + } + + /* Check for a sign. */ + negative= 0; + if (*s == '-') + { + negative = 1; + ++s; + } + else if (*s == '+') + { + ++s; + } + + + if (base == 16 && s[0] == '0' && my_toupper (&my_charset_latin1, s[1]) == 'X') + s += 2; + + /* If BASE is zero, figure it out ourselves. */ + if (base == 0) + { + if (*s == '0') + { + if (my_toupper (&my_charset_latin1, s[1]) == 'X') + { + s += 2; + base = 16; + } + else + base = 8; + } + else + base = 10; + } + + /* Save the pointer so we can check later if anything happened. */ + save = s; + + cutoff = UTYPE_MAX / (unsigned long int) base; + cutlim = (uint) (UTYPE_MAX % (unsigned long int) base); + + overflow = 0; + i = 0; + for (c = *s; c != '\0'; c = *++s) + { + if (my_isdigit (&my_charset_latin1, c)) + c -= '0'; + else if (my_isalpha (&my_charset_latin1, c)) + c = my_toupper (&my_charset_latin1, c) - 'A' + 10; + else + break; + if (c >= base) + break; + /* Check for overflow. */ + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (ulongtype) base; + i += c; + } + } + + /* Check if anything actually happened. */ + if (s == save) + goto noconv; + + /* Store in ENDPTR the address of one character + past the last character we converted. */ + if (endptr != NULL) + *endptr = (char *) s; + +#ifndef USE_UNSIGNED + /* Check for a value that is within the range of + `unsigned long int', but outside the range of `long int'. */ + if (negative) + { + if (i > (ulongtype) TYPE_MIN) + overflow = 1; + } + else if (i > (ulongtype) TYPE_MAX) + overflow = 1; +#endif + + if (overflow) + { + my_errno=ERANGE; +#ifdef USE_UNSIGNED + return UTYPE_MAX; +#else + return negative ? TYPE_MIN : TYPE_MAX; +#endif + } + + /* Return the result of the appropriate sign. */ + return (negative ? -((longtype) i) : (longtype) i); + +noconv: + /* There was no number to convert. */ + my_errno=EDOM; + if (endptr != NULL) + *endptr = (char *) nptr; + return 0L; +} diff --git a/externals/mysql/strings/strtol.c b/externals/mysql/strings/strtol.c new file mode 100644 index 00000000000..42476b0226a --- /dev/null +++ b/externals/mysql/strings/strtol.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This implements strtol() if needed */ + +/* + These includes are mandatory because they check for type sizes and + functions, especially they handle tricks for Tru64 where 'long' is + 64 bit already and our 'longlong' is just a 'long'. + */ +#include +#include + +#if !defined(MSDOS) && !defined(HAVE_STRTOL) && !defined(__WIN__) +#include "strto.c" +#endif diff --git a/externals/mysql/strings/strtoll.c b/externals/mysql/strings/strtoll.c new file mode 100644 index 00000000000..cfb6fbd75ee --- /dev/null +++ b/externals/mysql/strings/strtoll.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This implements strtoll() if needed */ + + +/* + These includes are mandatory because they check for type sizes and + functions, especially they handle tricks for Tru64 where 'long' is + 64 bit already and our 'longlong' is just a 'long'. + This solves a problem on Tru64 where the C99 compiler has a prototype + for 'strtoll()' but no implementation, see "6.1 New C99 library functions" + in file '/usr/share/doclib/cc.dtk/release_notes.txt'. + */ +#include +#include + +#if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG) +#define USE_LONGLONG +#include "strto.c" +#endif diff --git a/externals/mysql/strings/strtoul.c b/externals/mysql/strings/strtoul.c new file mode 100644 index 00000000000..3e2b51bc982 --- /dev/null +++ b/externals/mysql/strings/strtoul.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This implements strtol() if needed */ + +/* + These includes are mandatory because they check for type sizes and + functions, especially they handle tricks for Tru64 where 'long' is + 64 bit already and our 'longlong' is just a 'long'. + */ +#include +#include + +#if !defined(MSDOS) && !defined(HAVE_STRTOUL) +#define USE_UNSIGNED +#include "strto.c" +#endif diff --git a/externals/mysql/strings/strtoull.c b/externals/mysql/strings/strtoull.c new file mode 100644 index 00000000000..94bf6904f8d --- /dev/null +++ b/externals/mysql/strings/strtoull.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This implements strtoull() if needed */ + + +/* + These includes are mandatory because they check for type sizes and + functions, especially they handle tricks for Tru64 where 'long' is + 64 bit already and our 'longlong' is just a 'long'. + This solves a problem on Tru64 where the C99 compiler has a prototype + for 'strtoull()' but no implementation, see "6.1 New C99 library functions" + in file '/usr/share/doclib/cc.dtk/release_notes.txt'. + */ +#include +#include + +#if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG) +#define USE_UNSIGNED +#define USE_LONGLONG +#include "strto.c" +#endif diff --git a/externals/mysql/strings/strxmov.c b/externals/mysql/strings/strxmov.c new file mode 100644 index 00000000000..9dd2c936620 --- /dev/null +++ b/externals/mysql/strings/strxmov.c @@ -0,0 +1,50 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* File : strxmov.c + Author : Richard A. O'Keefe. + Updated: 25 may 1984 + Defines: strxmov() + + strxmov(dst, src1, ..., srcn, NullS) + moves the concatenation of src1,...,srcn to dst, terminates it + with a NUL character, and returns a pointer to the terminating NUL. + It is just like strmov except that it concatenates multiple sources. + Beware: the last argument should be the null character pointer. + Take VERY great care not to omit it! Also be careful to use NullS + and NOT to use 0, as on some machines 0 is not the same size as a + character pointer, or not the same bit pattern as NullS. +*/ + +#include +#include "m_string.h" +#include + +char *strxmov(char *dst,const char *src, ...) +{ + va_list pvar; + + va_start(pvar,src); + while (src != NullS) { + while ((*dst++ = *src++)) ; + dst--; + src = va_arg(pvar, char *); + } + va_end(pvar); + *dst = 0; /* there might have been no sources! */ + return dst; +} diff --git a/externals/mysql/strings/strxnmov.c b/externals/mysql/strings/strxnmov.c new file mode 100644 index 00000000000..16469be6e45 --- /dev/null +++ b/externals/mysql/strings/strxnmov.c @@ -0,0 +1,63 @@ +/* Copyright (C) 2002 MySQL AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* File : strxnmov.c + Author : Richard A. O'Keefe. + Updated: 2 June 1984 + Defines: strxnmov() + + strxnmov(dst, len, src1, ..., srcn, NullS) + moves the first len characters of the concatenation of src1,...,srcn + to dst and add a closing NUL character. + It is just like strnmov except that it concatenates multiple sources. + Beware: the last argument should be the null character pointer. + Take VERY great care not to omit it! Also be careful to use NullS + and NOT to use 0, as on some machines 0 is not the same size as a + character pointer, or not the same bit pattern as NullS. + + NOTE + strxnmov is like strnmov in that it moves up to len + characters; dst will be padded on the right with one '\0' character. + if total-string-length >= length then dst[length] will be set to \0 +*/ + +#include +#include "m_string.h" +#include + +char *strxnmov(char *dst, size_t len, const char *src, ...) +{ + va_list pvar; + char *end_of_dst=dst+len; + + va_start(pvar,src); + while (src != NullS) + { + do + { + if (dst == end_of_dst) + goto end; + } + while ((*dst++ = *src++)); + dst--; + src = va_arg(pvar, char *); + } +end: + *dst=0; + va_end(pvar); + return dst; +} diff --git a/externals/mysql/strings/t_ctype.h b/externals/mysql/strings/t_ctype.h new file mode 100644 index 00000000000..af4f3ebbaa1 --- /dev/null +++ b/externals/mysql/strings/t_ctype.h @@ -0,0 +1,258 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. + Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. + Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that the above copyright notice appear in all copies. + Smaphan Raruenrom and Pruet Boonma makes no representations about + the suitability of this software for any purpose. It is provided + "as is" without express or implied warranty. +*/ + +/* + LC_COLLATE category + Level information +*/ + +#ifndef _t_ctype_h +#define _t_ctype_h + +typedef unsigned char tchar; + +#define TOT_LEVELS 5 +#define LAST_LEVEL 4 /* TOT_LEVELS - 1 */ + +#define IGNORE 0 + + +/* level 1 symbols & order */ +enum l1_symbols { + L1_08 = TOT_LEVELS, + L1_18, + L1_28, + L1_38, + L1_48, + L1_58, + L1_68, + L1_78, + L1_88, + L1_98, + L1_A8, + L1_B8, + L1_C8, + L1_D8, + L1_E8, + L1_F8, + L1_G8, + L1_H8, + L1_I8, + L1_J8, + L1_K8, + L1_L8, + L1_M8, + L1_N8, + L1_O8, + L1_P8, + L1_Q8, + L1_R8, + L1_S8, + L1_T8, + L1_U8, + L1_V8, + L1_W8, + L1_X8, + L1_Y8, + L1_Z8, + L1_KO_KAI, + L1_KHO_KHAI, + L1_KHO_KHUAT, + L1_KHO_KHWAI, + L1_KHO_KHON, + L1_KHO_RAKHANG, + L1_NGO_NGU, + L1_CHO_CHAN, + L1_CHO_CHING, + L1_CHO_CHANG, + L1_SO_SO, + L1_CHO_CHOE, + L1_YO_YING, + L1_DO_CHADA, + L1_TO_PATAK, + L1_THO_THAN, + L1_THO_NANGMONTHO, + L1_THO_PHUTHAO, + L1_NO_NEN, + L1_DO_DEK, + L1_TO_TAO, + L1_THO_THUNG, + L1_THO_THAHAN, + L1_THO_THONG, + L1_NO_NU, + L1_BO_BAIMAI, + L1_PO_PLA, + L1_PHO_PHUNG, + L1_FO_FA, + L1_PHO_PHAN, + L1_FO_FAN, + L1_PHO_SAMPHAO, + L1_MO_MA, + L1_YO_YAK, + L1_RO_RUA, + L1_RU, + L1_LO_LING, + L1_LU, + L1_WO_WAEN, + L1_SO_SALA, + L1_SO_RUSI, + L1_SO_SUA, + L1_HO_HIP, + L1_LO_CHULA, + L1_O_ANG, + L1_HO_NOKHUK, + L1_NKHIT, + L1_SARA_A, + L1_MAI_HAN_AKAT, + L1_SARA_AA, + L1_SARA_AM, + L1_SARA_I, + L1_SARA_II, + L1_SARA_UE, + L1_SARA_UEE, + L1_SARA_U, + L1_SARA_UU, + L1_SARA_E, + L1_SARA_AE, + L1_SARA_O, + L1_SARA_AI_MAIMUAN, + L1_SARA_AI_MAIMALAI +}; + +/* level 2 symbols & order */ +enum l2_symbols { + L2_BLANK = TOT_LEVELS, + L2_THAII, + L2_YAMAK, + L2_PINTHU, + L2_GARAN, + L2_TYKHU, + L2_TONE1, + L2_TONE2, + L2_TONE3, + L2_TONE4 +}; + +/* level 3 symbols & order */ +enum l3_symbols { + L3_BLANK = TOT_LEVELS, + L3_SPACE, + L3_NB_SACE, + L3_LOW_LINE, + L3_HYPHEN, + L3_COMMA, + L3_SEMICOLON, + L3_COLON, + L3_EXCLAMATION, + L3_QUESTION, + L3_SOLIDUS, + L3_FULL_STOP, + L3_PAIYAN_NOI, + L3_MAI_YAMOK, + L3_GRAVE, + L3_CIRCUMFLEX, + L3_TILDE, + L3_APOSTROPHE, + L3_QUOTATION, + L3_L_PARANTHESIS, + L3_L_BRACKET, + L3_L_BRACE, + L3_R_BRACE, + L3_R_BRACKET, + L3_R_PARENTHESIS, + L3_AT, + L3_BAHT, + L3_DOLLAR, + L3_FONGMAN, + L3_ANGKHANKHU, + L3_KHOMUT, + L3_ASTERISK, + L3_BK_SOLIDUS, + L3_AMPERSAND, + L3_NUMBER, + L3_PERCENT, + L3_PLUS, + L3_LESS_THAN, + L3_EQUAL, + L3_GREATER_THAN, + L3_V_LINE +}; + +/* level 4 symbols & order */ +enum l4_symbols { + L4_BLANK = TOT_LEVELS, + L4_MIN, + L4_CAP, + L4_EXT +}; + +enum level_symbols { + L_UPRUPR = TOT_LEVELS, + L_UPPER, + L_MIDDLE, + L_LOWER +}; + +#define _is(c) (t_ctype[(c)][LAST_LEVEL]) +#define _level 8 +#define _consnt 16 +#define _ldvowel 32 +#define _fllwvowel 64 +#define _uprvowel 128 +#define _lwrvowel 256 +#define _tone 512 +#define _diacrt1 1024 +#define _diacrt2 2048 +#define _combine 4096 +#define _stone 8192 +#define _tdig 16384 +#define _rearvowel (_fllwvowel | _uprvowel | _lwrvowel) +#define _diacrt (_diacrt1 | _diacrt2) +#define levelof(c) ( _is(c) & _level ) +#define isthai(c) ( (c) >= 128 ) +#define istalpha(c) ( _is(c) & (_consnt|_ldvowel|_rearvowel|\ + _tone|_diacrt1|_diacrt2) ) +#define isconsnt(c) ( _is(c) & _consnt ) +#define isldvowel(c) ( _is(c) & _ldvowel ) +#define isfllwvowel(c) ( _is(c) & _fllwvowel ) +#define ismidvowel(c) ( _is(c) & (_ldvowel|_fllwvowel) ) +#define isuprvowel(c) ( _is(c) & _uprvowel ) +#define islwrvowel(c) ( _is(c) & _lwrvowel ) +#define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel)) +#define isrearvowel(c) ( _is(c) & _rearvowel ) +#define isvowel(c) ( _is(c) & (_ldvowel|_rearvowel) ) +#define istone(c) ( _is(c) & _tone ) +#define isunldable(c) ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) ) +#define iscombinable(c) ( _is(c) & _combine ) +#define istdigit(c) ( _is(c) & _tdig ) +#define isstone(c) ( _is(c) & _stone ) +#define isdiacrt1(c) ( _is(c) & _diacrt1) +#define isdiacrt2(c) ( _is(c) & _diacrt2) +#define isdiacrt(c) ( _is(c) & _diacrt) + +/* Function prototype called by sql/field.cc */ +void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length); + +#endif diff --git a/externals/mysql/strings/uca-dump.c b/externals/mysql/strings/uca-dump.c new file mode 100644 index 00000000000..774e940c7da --- /dev/null +++ b/externals/mysql/strings/uca-dump.c @@ -0,0 +1,332 @@ +/* Copyright (C) 2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include +#include + +typedef unsigned char uchar; +typedef unsigned short uint16; + +struct uca_item_st +{ + uchar num; + uint16 weight[4][9]; +}; + +#if 0 +#define MY_UCA_NPAGES 1024 +#define MY_UCA_NCHARS 64 +#define MY_UCA_CMASK 63 +#define MY_UCA_PSHIFT 6 +#else +#define MY_UCA_NPAGES 256 +#define MY_UCA_NCHARS 256 +#define MY_UCA_CMASK 255 +#define MY_UCA_PSHIFT 8 +#endif + +static char *pname[]= {"", "2", "3"}; + +int main(int ac, char **av) +{ + char str[256]; + char *weights[64]; + struct uca_item_st uca[64*1024]; + size_t code, w; + int pageloaded[MY_UCA_NPAGES]; + + bzero(uca, sizeof(uca)); + bzero(pageloaded, sizeof(pageloaded)); + + while (fgets(str,sizeof(str),stdin)) + { + char *comment; + char *weight; + char *s; + size_t codenum; + + code= strtol(str,NULL,16); + + if (str[0]=='#' || (code > 0xFFFF)) + continue; + if ((comment=strchr(str,'#'))) + { + *comment++= '\0'; + for ( ; *comment==' ' ; comment++); + }else + continue; + + if ((weight=strchr(str,';'))) + { + *weight++= '\0'; + for ( ; *weight==' ' ; weight++); + } + else + continue; + + codenum= 0; + s= strtok(str, " \t"); + while (s) + { + s= strtok(NULL, " \t"); + codenum++; + } + + if (codenum>1) + { + /* Multi-character weight, + i.e. contraction. + Not supported yet. + */ + continue; + } + + uca[code].num= 0; + s= strtok(weight, " []"); + while (s) + { + weights[uca[code].num]= s; + s= strtok(NULL, " []"); + uca[code].num++; + } + + for (w=0; w < uca[code].num; w++) + { + size_t partnum; + + partnum= 0; + s= weights[w]; + while (*s) + { + char *endptr; + size_t part; + part= strtol(s+1,&endptr,16); + uca[code].weight[partnum][w]= part; + s= endptr; + partnum++; + } + } + /* Mark that a character from this page was loaded */ + pageloaded[code >> MY_UCA_PSHIFT]++; + } + + + + /* Now set implicit weights */ + for (code=0; code <= 0xFFFF; code++) + { + size_t base, aaaa, bbbb; + + if (uca[code].num) + continue; + + /* + 3400; + 4DB5; + 4E00; + 9FA5; + */ + + if (code >= 0x3400 && code <= 0x4DB5) + base= 0xFB80; + else if (code >= 0x4E00 && code <= 0x9FA5) + base= 0xFB40; + else + base= 0xFBC0; + + aaaa= base + (code >> 15); + bbbb= (code & 0x7FFF) | 0x8000; + uca[code].weight[0][0]= aaaa; + uca[code].weight[0][1]= bbbb; + + uca[code].weight[1][0]= 0x0020; + uca[code].weight[1][1]= 0x0000; + + uca[code].weight[2][0]= 0x0002; + uca[code].weight[2][1]= 0x0000; + + uca[code].weight[3][0]= 0x0001; + uca[code].weight[3][2]= 0x0000; + + uca[code].num= 2; + } + + printf("#include \"my_uca.h\"\n"); + + printf("#define MY_UCA_NPAGES %d\n",MY_UCA_NPAGES); + printf("#define MY_UCA_NCHARS %d\n",MY_UCA_NCHARS); + printf("#define MY_UCA_CMASK %d\n",MY_UCA_CMASK); + printf("#define MY_UCA_PSHIFT %d\n",MY_UCA_PSHIFT); + + for (w=0; w<3; w++) + { + size_t page; + int pagemaxlen[MY_UCA_NPAGES]; + + for (page=0; page < MY_UCA_NPAGES; page++) + { + size_t offs; + size_t maxnum= 0; + size_t nchars= 0; + size_t mchars; + size_t ndefs= 0; + + pagemaxlen[page]= 0; + + /* + Skip this page if no weights were loaded + */ + + if (!pageloaded[page]) + continue; + + /* + Calculate maximum weight + length for this page + */ + + for (offs=0; offs < MY_UCA_NCHARS; offs++) + { + size_t i, num; + + code= page*MY_UCA_NCHARS+offs; + + /* Calculate only non-zero weights */ + for (num=0, i=0; i < uca[code].num; i++) + if (uca[code].weight[w][i]) + num++; + + maxnum= maxnum < num ? num : maxnum; + + /* Check if default weight */ + if (w == 1 && num == 1) + { + /* 0020 0000 ... */ + if (uca[code].weight[w][0] == 0x0020) + ndefs++; + } + else if (w == 2 && num == 1) + { + /* 0002 0000 ... */ + if (uca[code].weight[w][0] == 0x0002) + ndefs++; + } + } + maxnum++; + + /* + If the page have only default weights + then no needs to dump it, skip. + */ + if (ndefs == MY_UCA_NCHARS) + { + continue; + } + switch (maxnum) + { + case 0: mchars= 8; break; + case 1: mchars= 8; break; + case 2: mchars= 8; break; + case 3: mchars= 9; break; + case 4: mchars= 8; break; + default: mchars= uca[code].num; + } + + pagemaxlen[page]= maxnum; + + + /* + Now print this page + */ + + + printf("uint16 page%03Xdata%s[]= { /* %04X (%d weights per char) */\n", + page, pname[w], page*MY_UCA_NCHARS, maxnum); + + for (offs=0; offs < MY_UCA_NCHARS; offs++) + { + uint16 weight[8]; + size_t num, i; + + code= page*MY_UCA_NCHARS+offs; + + bzero(weight,sizeof(weight)); + + /* Copy non-zero weights */ + for (num=0, i=0; i < uca[code].num; i++) + { + if (uca[code].weight[w][i]) + { + weight[num]= uca[code].weight[w][i]; + num++; + } + } + + for (i=0; i < maxnum; i++) + { + /* + Invert weights for secondary level to + sort upper case letters before their + lower case counter part. + */ + int tmp= weight[i]; + if (w == 2 && tmp) + tmp= (int)(0x20 - weight[i]); + + + printf("0x%04X", tmp); + if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum)) + printf(","); + nchars++; + } + if (nchars >=mchars) + { + printf("\n"); + nchars=0; + } + else + { + printf(" "); + } + } + printf("};\n\n"); + } + + printf("uchar uca_length%s[%d]={\n", pname[w], MY_UCA_NPAGES); + for (page=0; page < MY_UCA_NPAGES; page++) + { + printf("%d%s%s",pagemaxlen[page],page +#include +#include +*/ +#include +#include +#include +#include "m_ctype.h" + + +typedef struct my_ctype_name_st +{ + const char *name; + int val; +} MY_CTYPE_NAME_ST; + + +static MY_CTYPE_NAME_ST my_ctype_name[]= +{ + {"Lu", _MY_U}, /* Letter, Uppercase */ + {"Ll", _MY_L}, /* Letter, Lowercase */ + {"Lt", _MY_U}, /* Letter, Titlecase */ + {"Lm", _MY_L}, /* Letter, Modifier */ + {"Lo", _MY_L}, /* Letter, other */ + + {"Nd", _MY_NMR}, /* Number, Decimal Digit */ + {"Nl", _MY_NMR|_MY_U|_MY_L}, /* Number, Letter */ + {"No", _MY_NMR|_MY_PNT}, /* Number, Other */ + + {"Mn", _MY_L|_MY_PNT}, /* Mark, Nonspacing */ + {"Mc", _MY_L|_MY_PNT}, /* Mark, Spacing Combining */ + {"Me", _MY_L|_MY_PNT}, /* Mark, Enclosing */ + + {"Pc", _MY_PNT}, /* Punctuation, Connector */ + {"Pd", _MY_PNT}, /* Punctuation, Dash */ + {"Ps", _MY_PNT}, /* Punctuation, Open */ + {"Pe", _MY_PNT}, /* Punctuation, Close */ + {"Pi", _MY_PNT}, /* Punctuation, Initial quote */ + {"Pf", _MY_PNT}, /* Punctuation, Final quote */ + {"Po", _MY_PNT}, /* Punctuation, Other */ + + {"Sm", _MY_PNT}, /* Symbol, Math */ + {"Sc", _MY_PNT}, /* Symbol, Currency */ + {"Sk", _MY_PNT}, /* Symbol, Modifier */ + {"So", _MY_PNT}, /* Symbol, Other */ + + {"Zs", _MY_SPC}, /* Separator, Space */ + {"Zl", _MY_SPC}, /* Separator, Line */ + {"Zp", _MY_SPC}, /* Separator, Paragraph */ + + {"Cc", _MY_CTR}, /* Other, Control */ + {"Cf", _MY_CTR}, /* Other, Format */ + {"Cs", _MY_CTR}, /* Other, Surrogate */ + {"Co", _MY_CTR}, /* Other, Private Use */ + {"Cn", _MY_CTR}, /* Other, Not Assigned */ + {NULL, 0} +}; + + +static int +ctypestr2num(const char *tok) +{ + MY_CTYPE_NAME_ST *p; + for (p= my_ctype_name; p->name; p++) + { + if (!strncasecmp(p->name, tok, 2)) + return p->val; + } + return 0; +} + + +int main(int ac, char ** av) +{ + char str[1024]; + unsigned char ctypea[64*1024]; + size_t i; + size_t plane; + MY_UNI_CTYPE uctype[256]; + FILE *f= stdin; + + if (ac > 1 && av[1] && !(f= fopen(av[1],"r"))) + { + fprintf(stderr, "Can't open file %s\n", av[1]); + exit(1); + } + bzero(&ctypea,sizeof(ctypea)); + bzero(&uctype, sizeof(uctype)); + + printf("/*\n"); + printf(" Unicode ctype data\n"); + printf(" Generated from %s\n", av[1] ? av[1] : "stdin"); + printf("*/\n"); + + while(fgets(str, sizeof(str), f)) + { + size_t n= 0, code= 0; + char *s,*e; + int ctype= 0; + + for(s= str; s; ) + { + char *end; + char tok[1024]=""; + e=strchr(s,';'); + if(e) + { + strncpy(tok,s,(unsigned int)(e-s)); + tok[e-s]=0; + } + else + { + strcpy(tok,s); + } + + end=tok+strlen(tok); + + switch(n) + { + case 0: code= strtol(tok,&end,16);break; + case 2: ctype= ctypestr2num(tok);break; + } + + n++; + if(e) s=e+1; + else s=e; + } + if(code<=0xFFFF) + { + ctypea[code]= ctype; + } + } + + /* Fill digits */ + for (i= '0'; i <= '9'; i++) + ctypea[i]= _MY_NMR; + + for (i= 'a'; i <= 'z'; i++) + ctypea[i]|= _MY_X; + for (i= 'A'; i <= 'Z'; i++) + ctypea[i]|= _MY_X; + + + /* Fill ideographs */ + + /* CJK Ideographs Extension A (U+3400 - U+4DB5) */ + for(i=0x3400;i<=0x4DB5;i++) + { + ctypea[i]= _MY_L | _MY_U; + } + + /* CJK Ideographs (U+4E00 - U+9FA5) */ + for(i=0x4E00;i<=0x9FA5;i++){ + ctypea[i]= _MY_L | _MY_U; + } + + /* Hangul Syllables (U+AC00 - U+D7A3) */ + for(i=0xAC00;i<=0xD7A3;i++) + { + ctypea[i]= _MY_L | _MY_U; + } + + + /* Calc plane parameters */ + for(plane=0;plane<256;plane++) + { + size_t character; + uctype[plane].ctype= ctypea+plane*256; + + uctype[plane].pctype= uctype[plane].ctype[0]; + for(character=1;character<256;character++) + { + if (uctype[plane].ctype[character] != uctype[plane].pctype) + { + uctype[plane].pctype= 0; /* Mixed plane */ + break; + } + } + if (character==256) /* All the same, no needs to dump whole plane */ + uctype[plane].ctype= NULL; + } + + /* Dump mixed planes */ + for(plane=0;plane<256;plane++) + { + if(uctype[plane].ctype) + { + int charnum=0; + int num=0; + + printf("static unsigned char uctype_page%02X[256]=\n{\n",plane); + + for(charnum=0;charnum<256;charnum++) + { + int cod; + + cod=(plane<<8)+charnum; + printf(" %2d%s",uctype[plane].ctype[charnum],charnum<255?",":""); + + num++; + if(num==16) + { + printf("\n"); + num=0; + } + } + printf("};\n\n"); + } + } + + + /* Dump plane index */ + printf("MY_UNI_CTYPE my_uni_ctype[256]={\n"); + for(plane=0;plane<256;plane++) + { + char plane_name[128]="NULL"; + if(uctype[plane].ctype){ + sprintf(plane_name,"uctype_page%02X",plane); + } + printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":""); + } + printf("};\n"); + + return 0; +} diff --git a/externals/mysql/strings/utr11-dump.c b/externals/mysql/strings/utr11-dump.c new file mode 100644 index 00000000000..a15f63025f4 --- /dev/null +++ b/externals/mysql/strings/utr11-dump.c @@ -0,0 +1,127 @@ +/* Copyright (C) 2004 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include +#include + + +/* + Dump an EastAsianWidth.txt file. + See http://www.unicode.org/reports/tr11/ for details. + Character types: + F - Full width = 1 + H - Half width = 0 + W - Wide = 1 + Na - Narrow = 0 + A - Ambiguous = 0 + N - Neutral = 0 +*/ + + +int main(int ac, char **av) +{ + char str[128]; + int errors= 0; + int plane[0x10000]; + int page[256]; + int i; + + memset(plane, 0, sizeof(plane)); + memset(page, 0, sizeof(page)); + + while (fgets(str, sizeof(str), stdin)) + { + int code1, code2, width; + char *end; + + if (str[0] == '#') + continue; + code1= strtol(str, &end, 16); + if (code1 < 0 || code1 > 0xFFFF) + continue; + if (end[0] == ';') /* One character */ + { + code2= code1; + } + else if (end[0] == '.' && end[1] == '.') /* Range */ + { + end+= 2; + code2= strtol(end, &end, 16); + if (code2 < 0 || code2 > 0xFFFF) + continue; + if (end[0] != ';') + { + errors++; + fprintf(stderr, "error: %s", str); + continue; + } + } + else + { + errors++; + fprintf(stderr, "error: %s", str); + continue; + } + + end++; + width= (end[0] == 'F' || end[0] == 'W') ? 1 : 0; + + for ( ; code1 <= code2; code1++) + { + plane[code1]= width; + } + } + + if (errors) + return 1; + + for (i=0; i < 256; i++) + { + int j; + int *p= plane + 256 * i; + page[i]= 0; + for (j=0; j < 256; j++) + { + page[i]+= p[j]; + } + if (page[i] != 0 && page[i] != 256) + { + printf("static char pg%02X[256]=\n{\n", i); + for (j=0; j < 256; j++) + { + printf("%d%s%s", p[j], j < 255 ? "," : "", (j + 1) % 32 ? "" : "\n"); + } + printf("};\n\n"); + } + } + + printf("static struct {int page; char *p;} utr11_data[256]=\n{\n"); + for (i=0; i < 256; i++) + { + if (page[i] == 0 || page[i] == 256) + { + int width= (page[i] == 256) ? 1 : 0; + printf("{%d,NULL}", width); + } + else + { + printf("{0,pg%02X}", i); + } + printf("%s%s", i < 255 ? "," : "", (i+1) % 8 ? "" : "\n"); + } + printf("};\n"); + return 0; +} diff --git a/externals/mysql/strings/xml.c b/externals/mysql/strings/xml.c new file mode 100644 index 00000000000..1b697ec6b26 --- /dev/null +++ b/externals/mysql/strings/xml.c @@ -0,0 +1,496 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "my_global.h" +#include "m_string.h" +#include "my_xml.h" + + +#define MY_XML_UNKNOWN 'U' +#define MY_XML_EOF 'E' +#define MY_XML_STRING 'S' +#define MY_XML_IDENT 'I' +#define MY_XML_EQ '=' +#define MY_XML_LT '<' +#define MY_XML_GT '>' +#define MY_XML_SLASH '/' +#define MY_XML_COMMENT 'C' +#define MY_XML_TEXT 'T' +#define MY_XML_QUESTION '?' +#define MY_XML_EXCLAM '!' +#define MY_XML_CDATA 'D' + +typedef struct xml_attr_st +{ + const char *beg; + const char *end; +} MY_XML_ATTR; + + +/* + XML ctype: +*/ +#define MY_XML_ID0 0x01 /* Identifier initial character */ +#define MY_XML_ID1 0x02 /* Identifier medial character */ +#define MY_XML_SPC 0x08 /* Spacing character */ + + +/* + http://www.w3.org/TR/REC-xml/ + [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | + CombiningChar | Extender + [5] Name ::= (Letter | '_' | ':') (NameChar)* +*/ + +static char my_xml_ctype[256]= +{ +/*00*/ 0,0,0,0,0,0,0,0,0,8,8,0,0,8,0,0, +/*10*/ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +/*20*/ 8,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0, /* !"#$%&'()*+,-./ */ +/*30*/ 2,2,2,2,2,2,2,2,2,2,3,0,0,0,0,0, /* 0123456789:;<=>? */ +/*40*/ 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, /* @ABCDEFGHIJKLMNO */ +/*50*/ 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3, /* PQRSTUVWXYZ[\]^_ */ +/*60*/ 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, /* `abcdefghijklmno */ +/*70*/ 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0, /* pqrstuvwxyz{|}~ */ +/*80*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*90*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*A0*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*B0*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*C0*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*D0*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*E0*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +/*F0*/ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 +}; + +#define my_xml_is_space(c) (my_xml_ctype[(uchar) (c)] & MY_XML_SPC) +#define my_xml_is_id0(c) (my_xml_ctype[(uchar) (c)] & MY_XML_ID0) +#define my_xml_is_id1(c) (my_xml_ctype[(uchar) (c)] & MY_XML_ID1) + + +static const char *lex2str(int lex) +{ + switch(lex) + { + case MY_XML_EOF: return "END-OF-INPUT"; + case MY_XML_STRING: return "STRING"; + case MY_XML_IDENT: return "IDENT"; + case MY_XML_CDATA: return "CDATA"; + case MY_XML_EQ: return "'='"; + case MY_XML_LT: return "'<'"; + case MY_XML_GT: return "'>'"; + case MY_XML_SLASH: return "'/'"; + case MY_XML_COMMENT: return "COMMENT"; + case MY_XML_TEXT: return "TEXT"; + case MY_XML_QUESTION: return "'?'"; + case MY_XML_EXCLAM: return "'!'"; + } + return "unknown token"; +} + +static void my_xml_norm_text(MY_XML_ATTR *a) +{ + for ( ; (a->beg < a->end) && my_xml_is_space(a->beg[0]) ; a->beg++ ); + for ( ; (a->beg < a->end) && my_xml_is_space(a->end[-1]) ; a->end-- ); +} + + +static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a) +{ + int lex; + + for (; ( p->cur < p->end) && my_xml_is_space(p->cur[0]) ; p->cur++); + + if (p->cur >= p->end) + { + a->beg=p->end; + a->end=p->end; + lex=MY_XML_EOF; + goto ret; + } + + a->beg=p->cur; + a->end=p->cur; + + if ((p->end - p->cur > 3) && !bcmp(p->cur,"", 3); p->cur++) + {} + if (!bcmp(p->cur, "-->", 3)) + p->cur+=3; + a->end=p->cur; + lex=MY_XML_COMMENT; + } + else if (!bcmp(p->cur, "cur+= 9; + for (; p->cur < p->end - 2 ; p->cur++) + { + if (p->cur[0] == ']' && p->cur[1] == ']' && p->cur[2] == '>') + { + p->cur+= 3; + a->end= p->cur; + break; + } + } + lex= MY_XML_CDATA; + } + else if (strchr("?=/<>!",p->cur[0])) + { + p->cur++; + a->end=p->cur; + lex=a->beg[0]; + } + else if ( (p->cur[0] == '"') || (p->cur[0] == '\'') ) + { + p->cur++; + for (; ( p->cur < p->end ) && (p->cur[0] != a->beg[0]); p->cur++) + {} + a->end=p->cur; + if (a->beg[0] == p->cur[0])p->cur++; + a->beg++; + if (!(p->flags & MY_XML_FLAG_SKIP_TEXT_NORMALIZATION)) + my_xml_norm_text(a); + lex=MY_XML_STRING; + } + else if (my_xml_is_id0(p->cur[0])) + { + p->cur++; + while (p->cur < p->end && my_xml_is_id1(p->cur[0])) + p->cur++; + a->end=p->cur; + my_xml_norm_text(a); + lex=MY_XML_IDENT; + } + else + lex= MY_XML_UNKNOWN; + +#if 0 + printf("LEX=%s[%d]\n",lex2str(lex),a->end-a->beg); +#endif + +ret: + return lex; +} + + +static int my_xml_value(MY_XML_PARSER *st, const char *str, size_t len) +{ + return (st->value) ? (st->value)(st,str,len) : MY_XML_OK; +} + + +static int my_xml_enter(MY_XML_PARSER *st, const char *str, size_t len) +{ + if ((size_t) (st->attrend-st->attr+len+1) > sizeof(st->attr)) + { + sprintf(st->errstr,"To deep XML"); + return MY_XML_ERROR; + } + if (st->attrend > st->attr) + { + st->attrend[0]= '/'; + st->attrend++; + } + memcpy(st->attrend,str,len); + st->attrend+=len; + st->attrend[0]='\0'; + if (st->flags & MY_XML_FLAG_RELATIVE_NAMES) + return st->enter ? st->enter(st, str, len) : MY_XML_OK; + else + return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK; +} + + +static void mstr(char *s,const char *src,size_t l1, size_t l2) +{ + l1 = l1attrend; (e>p->attr) && (e[0] != '/') ; e--); + glen = (size_t) ((e[0] == '/') ? (p->attrend-e-1) : p->attrend-e); + + if (str && (slen != glen)) + { + mstr(s,str,sizeof(s)-1,slen); + if (glen) + { + mstr(g,e+1,sizeof(g)-1,glen), + sprintf(p->errstr,"'' unexpected ('' wanted)",s,g); + } + else + sprintf(p->errstr,"'' unexpected (END-OF-INPUT wanted)", s); + return MY_XML_ERROR; + } + + if (p->flags & MY_XML_FLAG_RELATIVE_NAMES) + rc= p->leave_xml ? p->leave_xml(p, str, slen) : MY_XML_OK; + else + rc= (p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : + MY_XML_OK); + + *e='\0'; + p->attrend=e; + + return rc; +} + + +int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len) +{ + p->attrend=p->attr; + p->beg=str; + p->cur=str; + p->end=str+len; + + while ( p->cur < p->end ) + { + MY_XML_ATTR a; + if (p->cur[0] == '<') + { + int lex; + int question=0; + int exclam=0; + + lex=my_xml_scan(p,&a); + + if (MY_XML_COMMENT == lex) + continue; + + if (lex == MY_XML_CDATA) + { + a.beg+= 9; + a.end-= 3; + my_xml_value(p, a.beg, (size_t) (a.end-a.beg)); + continue; + } + + lex=my_xml_scan(p,&a); + + if (MY_XML_SLASH == lex) + { + if (MY_XML_IDENT != (lex=my_xml_scan(p,&a))) + { + sprintf(p->errstr,"%s unexpected (ident wanted)",lex2str(lex)); + return MY_XML_ERROR; + } + if (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))) + return MY_XML_ERROR; + lex=my_xml_scan(p,&a); + goto gt; + } + + if (MY_XML_EXCLAM == lex) + { + lex=my_xml_scan(p,&a); + exclam=1; + } + else if (MY_XML_QUESTION == lex) + { + lex=my_xml_scan(p,&a); + question=1; + } + + if (MY_XML_IDENT == lex) + { + p->current_node_type= MY_XML_NODE_TAG; + if (MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) + return MY_XML_ERROR; + } + else + { + sprintf(p->errstr,"%s unexpected (ident or '/' wanted)", + lex2str(lex)); + return MY_XML_ERROR; + } + + while ((MY_XML_IDENT == (lex=my_xml_scan(p,&a))) || + ((MY_XML_STRING == lex && exclam))) + { + MY_XML_ATTR b; + if (MY_XML_EQ == (lex=my_xml_scan(p,&b))) + { + lex=my_xml_scan(p,&b); + if ( (lex == MY_XML_IDENT) || (lex == MY_XML_STRING) ) + { + p->current_node_type= MY_XML_NODE_ATTR; + if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) || + (MY_XML_OK != my_xml_value(p,b.beg,(size_t) (b.end-b.beg))) || + (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg)))) + return MY_XML_ERROR; + } + else + { + sprintf(p->errstr,"%s unexpected (ident or string wanted)", + lex2str(lex)); + return MY_XML_ERROR; + } + } + else if (MY_XML_IDENT == lex) + { + p->current_node_type= MY_XML_NODE_ATTR; + if ((MY_XML_OK != my_xml_enter(p,a.beg,(size_t) (a.end-a.beg))) || + (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg)))) + return MY_XML_ERROR; + } + else if ((MY_XML_STRING == lex) && exclam) + { + /* + We are in , e.g. + + + Just skip "SystemLiteral" and "PublicidLiteral" + */ + } + else + break; + } + + if (lex == MY_XML_SLASH) + { + if (MY_XML_OK != my_xml_leave(p,NULL,0)) + return MY_XML_ERROR; + lex=my_xml_scan(p,&a); + } + +gt: + if (question) + { + if (lex != MY_XML_QUESTION) + { + sprintf(p->errstr,"%s unexpected ('?' wanted)",lex2str(lex)); + return MY_XML_ERROR; + } + if (MY_XML_OK != my_xml_leave(p,NULL,0)) + return MY_XML_ERROR; + lex=my_xml_scan(p,&a); + } + + if (exclam) + { + if (MY_XML_OK != my_xml_leave(p,NULL,0)) + return MY_XML_ERROR; + } + + if (lex != MY_XML_GT) + { + sprintf(p->errstr,"%s unexpected ('>' wanted)",lex2str(lex)); + return MY_XML_ERROR; + } + } + else + { + a.beg=p->cur; + for ( ; (p->cur < p->end) && (p->cur[0] != '<') ; p->cur++); + a.end=p->cur; + + if (!(p->flags & MY_XML_FLAG_SKIP_TEXT_NORMALIZATION)) + my_xml_norm_text(&a); + if (a.beg != a.end) + { + my_xml_value(p,a.beg,(size_t) (a.end-a.beg)); + } + } + } + + if (p->attr[0]) + { + sprintf(p->errstr,"unexpected END-OF-INPUT"); + return MY_XML_ERROR; + } + return MY_XML_OK; +} + + +void my_xml_parser_create(MY_XML_PARSER *p) +{ + bzero((void*)p,sizeof(p[0])); +} + + +void my_xml_parser_free(MY_XML_PARSER *p __attribute__((unused))) +{ +} + + +void my_xml_set_value_handler(MY_XML_PARSER *p, + int (*action)(MY_XML_PARSER *p, const char *s, + size_t l)) +{ + p->value=action; +} + +void my_xml_set_enter_handler(MY_XML_PARSER *p, + int (*action)(MY_XML_PARSER *p, const char *s, + size_t l)) +{ + p->enter=action; +} + + +void my_xml_set_leave_handler(MY_XML_PARSER *p, + int (*action)(MY_XML_PARSER *p, const char *s, + size_t l)) +{ + p->leave_xml=action; +} + + +void my_xml_set_user_data(MY_XML_PARSER *p, void *user_data) +{ + p->user_data=user_data; +} + + +const char *my_xml_error_string(MY_XML_PARSER *p) +{ + return p->errstr; +} + + +size_t my_xml_error_pos(MY_XML_PARSER *p) +{ + const char *beg=p->beg; + const char *s; + for ( s=p->beg ; scur; s++) + { + if (s[0] == '\n') + beg=s; + } + return (size_t) (p->cur-beg); +} + +uint my_xml_error_lineno(MY_XML_PARSER *p) +{ + uint res=0; + const char *s; + for (s=p->beg ; scur; s++) + { + if (s[0] == '\n') + res++; + } + return res; +} diff --git a/externals/mysql/t_ctype.h b/externals/mysql/t_ctype.h new file mode 100644 index 00000000000..15600019cd6 --- /dev/null +++ b/externals/mysql/t_ctype.h @@ -0,0 +1,254 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. + Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. + Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that the above copyright notice appear in all copies. + Smaphan Raruenrom and Pruet Boonma makes no representations about + the suitability of this software for any purpose. It is provided + "as is" without express or implied warranty. +*/ + +/* LC_COLLATE category + Level information */ + +#ifndef _t_ctype_h +#define _t_ctype_h + +#define TOT_LEVELS 5 +#define LAST_LEVEL 4 /* TOT_LEVELS - 1 */ + +#define IGNORE 0 + + +/* level 1 symbols & order */ +enum l1_symbols { + L1_08 = TOT_LEVELS, + L1_18, + L1_28, + L1_38, + L1_48, + L1_58, + L1_68, + L1_78, + L1_88, + L1_98, + L1_A8, + L1_B8, + L1_C8, + L1_D8, + L1_E8, + L1_F8, + L1_G8, + L1_H8, + L1_I8, + L1_J8, + L1_K8, + L1_L8, + L1_M8, + L1_N8, + L1_O8, + L1_P8, + L1_Q8, + L1_R8, + L1_S8, + L1_T8, + L1_U8, + L1_V8, + L1_W8, + L1_X8, + L1_Y8, + L1_Z8, + L1_KO_KAI, + L1_KHO_KHAI, + L1_KHO_KHUAT, + L1_KHO_KHWAI, + L1_KHO_KHON, + L1_KHO_RAKHANG, + L1_NGO_NGU, + L1_CHO_CHAN, + L1_CHO_CHING, + L1_CHO_CHANG, + L1_SO_SO, + L1_CHO_CHOE, + L1_YO_YING, + L1_DO_CHADA, + L1_TO_PATAK, + L1_THO_THAN, + L1_THO_NANGMONTHO, + L1_THO_PHUTHAO, + L1_NO_NEN, + L1_DO_DEK, + L1_TO_TAO, + L1_THO_THUNG, + L1_THO_THAHAN, + L1_THO_THONG, + L1_NO_NU, + L1_BO_BAIMAI, + L1_PO_PLA, + L1_PHO_PHUNG, + L1_FO_FA, + L1_PHO_PHAN, + L1_FO_FAN, + L1_PHO_SAMPHAO, + L1_MO_MA, + L1_YO_YAK, + L1_RO_RUA, + L1_RU, + L1_LO_LING, + L1_LU, + L1_WO_WAEN, + L1_SO_SALA, + L1_SO_RUSI, + L1_SO_SUA, + L1_HO_HIP, + L1_LO_CHULA, + L1_O_ANG, + L1_HO_NOKHUK, + L1_NKHIT, + L1_SARA_A, + L1_MAI_HAN_AKAT, + L1_SARA_AA, + L1_SARA_AM, + L1_SARA_I, + L1_SARA_II, + L1_SARA_UE, + L1_SARA_UEE, + L1_SARA_U, + L1_SARA_UU, + L1_SARA_E, + L1_SARA_AE, + L1_SARA_O, + L1_SARA_AI_MAIMUAN, + L1_SARA_AI_MAIMALAI +}; + +/* level 2 symbols & order */ +enum l2_symbols { + L2_BLANK = TOT_LEVELS, + L2_THAII, + L2_YAMAK, + L2_PINTHU, + L2_GARAN, + L2_TYKHU, + L2_TONE1, + L2_TONE2, + L2_TONE3, + L2_TONE4 +}; + +/* level 3 symbols & order */ +enum l3_symbols { + L3_BLANK = TOT_LEVELS, + L3_SPACE, + L3_NB_SACE, + L3_LOW_LINE, + L3_HYPHEN, + L3_COMMA, + L3_SEMICOLON, + L3_COLON, + L3_EXCLAMATION, + L3_QUESTION, + L3_SOLIDUS, + L3_FULL_STOP, + L3_PAIYAN_NOI, + L3_MAI_YAMOK, + L3_GRAVE, + L3_CIRCUMFLEX, + L3_TILDE, + L3_APOSTROPHE, + L3_QUOTATION, + L3_L_PARANTHESIS, + L3_L_BRACKET, + L3_L_BRACE, + L3_R_BRACE, + L3_R_BRACKET, + L3_R_PARENTHESIS, + L3_AT, + L3_BAHT, + L3_DOLLAR, + L3_FONGMAN, + L3_ANGKHANKHU, + L3_KHOMUT, + L3_ASTERISK, + L3_BK_SOLIDUS, + L3_AMPERSAND, + L3_NUMBER, + L3_PERCENT, + L3_PLUS, + L3_LESS_THAN, + L3_EQUAL, + L3_GREATER_THAN, + L3_V_LINE +}; + +/* level 4 symbols & order */ +enum l4_symbols { + L4_BLANK = TOT_LEVELS, + L4_MIN, + L4_CAP, + L4_EXT +}; + +enum level_symbols { + L_UPRUPR = TOT_LEVELS, + L_UPPER, + L_MIDDLE, + L_LOWER +}; + +#define _is(c) (t_ctype[(c)][LAST_LEVEL]) +#define _level 8 +#define _consnt 16 +#define _ldvowel 32 +#define _fllwvowel 64 +#define _uprvowel 128 +#define _lwrvowel 256 +#define _tone 512 +#define _diacrt1 1024 +#define _diacrt2 2048 +#define _combine 4096 +#define _stone 8192 +#define _tdig 16384 +#define _rearvowel (_fllwvowel | _uprvowel | _lwrvowel) +#define _diacrt (_diacrt1 | _diacrt2) +#define levelof(c) ( _is(c) & _level ) +#define isthai(c) ( (c) >= 128 ) +#define istalpha(c) ( _is(c) & (_consnt|_ldvowel|_rearvowel|\ + _tone|_diacrt1|_diacrt2) ) +#define isconsnt(c) ( _is(c) & _consnt ) +#define isldvowel(c) ( _is(c) & _ldvowel ) +#define isfllwvowel(c) ( _is(c) & _fllwvowel ) +#define ismidvowel(c) ( _is(c) & (_ldvowel|_fllwvowel) ) +#define isuprvowel(c) ( _is(c) & _uprvowel ) +#define islwrvowel(c) ( _is(c) & _lwrvowel ) +#define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel)) +#define isrearvowel(c) ( _is(c) & _rearvowel ) +#define isvowel(c) ( _is(c) & (_ldvowel|_rearvowel) ) +#define istone(c) ( _is(c) & _tone ) +#define isunldable(c) ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) ) +#define iscombinable(c) ( _is(c) & _combine ) +#define istdigit(c) ( _is(c) & _tdig ) +#define isstone(c) ( _is(c) & _stone ) +#define isdiacrt1(c) ( _is(c) & _diacrt1) +#define isdiacrt2(c) ( _is(c) & _diacrt2) +#define isdiacrt(c) ( _is(c) & _diacrt) + +/* Function prototype called by sql/field.cc */ +void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length); + +#endif diff --git a/externals/mysql/thr_alarm.h b/externals/mysql/thr_alarm.h new file mode 100644 index 00000000000..fb906039269 --- /dev/null +++ b/externals/mysql/thr_alarm.h @@ -0,0 +1,110 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Prototypes when using thr_alarm library functions */ + +#ifndef _thr_alarm_h +#define _thr_alarm_h +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef USE_ALARM_THREAD +#define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ +#endif +#ifdef HAVE_rts_threads +#undef USE_ONE_SIGNAL_HAND +#define USE_ALARM_THREAD +#define THR_SERVER_ALARM SIGUSR1 +#else +#define THR_SERVER_ALARM SIGALRM +#endif + +typedef struct st_alarm_info +{ + ulong next_alarm_time; + uint active_alarms; + uint max_used_alarms; +} ALARM_INFO; + +void thr_alarm_info(ALARM_INFO *info); + +#if defined(DONT_USE_THR_ALARM) || !defined(THREAD) + +#define USE_ALARM_THREAD +#undef USE_ONE_SIGNAL_HAND + +typedef my_bool thr_alarm_t; +typedef my_bool ALARM; + +#define thr_alarm_init(A) (*(A))=0 +#define thr_alarm_in_use(A) (*(A) != 0) +#define thr_end_alarm(A) +#define thr_alarm(A,B,C) ((*(A)=1)-1) +/* The following should maybe be (*(A)) */ +#define thr_got_alarm(A) 0 +#define init_thr_alarm(A) +#define thr_alarm_kill(A) +#define resize_thr_alarm(N) +#define end_thr_alarm(A) + +#else +#if defined(__WIN__) +typedef struct st_thr_alarm_entry +{ + rf_SetTimer crono; +} thr_alarm_entry; + +#else /* System with posix threads */ + +typedef int thr_alarm_entry; + +#define thr_got_alarm(thr_alarm) (**(thr_alarm)) + +#endif /* __WIN__ */ + +typedef thr_alarm_entry* thr_alarm_t; + +typedef struct st_alarm { + ulong expire_time; + thr_alarm_entry alarmed; /* set when alarm is due */ + pthread_t thread; + my_thread_id thread_id; + my_bool malloced; +} ALARM; + +extern uint thr_client_alarm; +extern pthread_t alarm_thread; + +#define thr_alarm_init(A) (*(A))=0 +#define thr_alarm_in_use(A) (*(A)!= 0) +void init_thr_alarm(uint max_alarm); +void resize_thr_alarm(uint max_alarms); +my_bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff); +void thr_alarm_kill(my_thread_id thread_id); +void thr_end_alarm(thr_alarm_t *alarmed); +void end_thr_alarm(my_bool free_structures); +sig_handler process_alarm(int); +#ifndef thr_got_alarm +my_bool thr_got_alarm(thr_alarm_t *alrm); +#endif + + +#endif /* DONT_USE_THR_ALARM */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _thr_alarm_h */ diff --git a/externals/mysql/thr_lock.h b/externals/mysql/thr_lock.h new file mode 100644 index 00000000000..38f0478f276 --- /dev/null +++ b/externals/mysql/thr_lock.h @@ -0,0 +1,181 @@ +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* For use with thr_lock:s */ + +#ifndef _thr_lock_h +#define _thr_lock_h +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +struct st_thr_lock; +extern ulong locks_immediate,locks_waited ; + +/** + Lock types are used to request a lock on a table. Changes in this enumeration + might affect transactional locks as well. + Important: if a new lock type is added, a matching lock description + must be added to sql_test.cc's lock_descriptions array. + @see set_handler_table_locks + @see read_lock_type_for_table +*/ +enum thr_lock_type { TL_IGNORE=-1, + TL_UNLOCK, /* UNLOCK ANY LOCK */ + /* + Parser only! At open_tables() becomes TL_READ or + TL_READ_NO_INSERT depending on the binary log format + (SBR/RBR) and on the table category (log table). + Used for tables that are read by statements which + modify tables. + */ + TL_READ_DEFAULT, + TL_READ, /* Read lock */ + TL_READ_WITH_SHARED_LOCKS, + /* High prior. than TL_WRITE. Allow concurrent insert */ + TL_READ_HIGH_PRIORITY, + /* READ, Don't allow concurrent insert */ + TL_READ_NO_INSERT, + /* + Write lock, but allow other threads to read / write. + Used by BDB tables in MySQL to mark that someone is + reading/writing to the table. + */ + TL_WRITE_ALLOW_WRITE, + /* + Write lock, but allow other threads to read. + Used by ALTER TABLE in MySQL to allow readers + to use the table until ALTER TABLE is finished. + */ + TL_WRITE_ALLOW_READ, + /* + WRITE lock used by concurrent insert. Will allow + READ, if one could use concurrent insert on table. + */ + TL_WRITE_CONCURRENT_INSERT, + /* Write used by INSERT DELAYED. Allows READ locks */ + TL_WRITE_DELAYED, + /* + parser only! Late bound low_priority flag. + At open_tables() becomes thd->update_lock_default. + */ + TL_WRITE_DEFAULT, + /* WRITE lock that has lower priority than TL_READ */ + TL_WRITE_LOW_PRIORITY, + /* Normal WRITE lock */ + TL_WRITE, + /* Abort new lock request with an error */ + TL_WRITE_ONLY}; + +enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1, + THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 }; + + +extern ulong max_write_lock_count; +extern ulong table_lock_wait_timeout; +extern my_bool thr_lock_inited; +extern enum thr_lock_type thr_upgraded_concurrent_insert_lock; + +/* + A description of the thread which owns the lock. The address + of an instance of this structure is used to uniquely identify the thread. +*/ + +typedef struct st_thr_lock_info +{ + pthread_t thread; + my_thread_id thread_id; + ulong n_cursors; +} THR_LOCK_INFO; + +/* + Lock owner identifier. Globally identifies the lock owner within the + thread and among all the threads. The address of an instance of this + structure is used as id. +*/ + +typedef struct st_thr_lock_owner +{ + THR_LOCK_INFO *info; +} THR_LOCK_OWNER; + + +typedef struct st_thr_lock_data { + THR_LOCK_OWNER *owner; + struct st_thr_lock_data *next,**prev; + struct st_thr_lock *lock; + pthread_cond_t *cond; + enum thr_lock_type type; + void *status_param; /* Param to status functions */ + void *debug_print_param; +} THR_LOCK_DATA; + +struct st_lock_list { + THR_LOCK_DATA *data,**last; +}; + +typedef struct st_thr_lock { + LIST list; + pthread_mutex_t mutex; + struct st_lock_list read_wait; + struct st_lock_list read; + struct st_lock_list write_wait; + struct st_lock_list write; + /* write_lock_count is incremented for write locks and reset on read locks */ + ulong write_lock_count; + uint read_no_write_count; + void (*get_status)(void*, my_bool); /* When one gets a lock */ + void (*copy_status)(void*,void*); + void (*update_status)(void*); /* Before release of write */ + void (*restore_status)(void*); /* Before release of read */ + my_bool (*check_status)(void *); + my_bool allow_multiple_concurrent_insert; +} THR_LOCK; + + +extern LIST *thr_lock_thread_list; +extern pthread_mutex_t THR_LOCK_lock; + +my_bool init_thr_lock(void); /* Must be called once/thread */ +#define thr_lock_owner_init(owner, info_arg) (owner)->info= (info_arg) +void thr_lock_info_init(THR_LOCK_INFO *info); +void thr_lock_init(THR_LOCK *lock); +void thr_lock_delete(THR_LOCK *lock); +void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, + void *status_param); +enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data, + THR_LOCK_OWNER *owner, + enum thr_lock_type lock_type); +void thr_unlock(THR_LOCK_DATA *data); +enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data, + uint count, THR_LOCK_OWNER *owner); +void thr_multi_unlock(THR_LOCK_DATA **data,uint count); +void +thr_lock_merge_status(THR_LOCK_DATA **data, uint count); +void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock); +my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread); +void thr_print_locks(void); /* For debugging */ +my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data, + enum thr_lock_type new_lock_type); +void thr_downgrade_write_lock(THR_LOCK_DATA *data, + enum thr_lock_type new_lock_type); +my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data); +#ifdef __cplusplus +} +#endif +#endif /* _thr_lock_h */ diff --git a/dep/include/mysql/typelib.h b/externals/mysql/typelib.h similarity index 72% rename from dep/include/mysql/typelib.h rename to externals/mysql/typelib.h index 40d69b89e34..46106d1bdab 100644 --- a/dep/include/mysql/typelib.h +++ b/externals/mysql/typelib.h @@ -19,14 +19,17 @@ #include "my_alloc.h" -typedef struct st_typelib { /* Different types saved here */ - unsigned int count; /* How many types */ - const char *name; /* Name of typelib */ +typedef struct st_typelib { /* Different types saved here */ + unsigned int count; /* How many types */ + const char *name; /* Name of typelib */ const char **type_names; unsigned int *type_lengths; } TYPELIB; -extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); +extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); +extern int find_type_or_exit(const char *x, TYPELIB *typelib, + const char *option); +extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); @@ -34,4 +37,3 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; #endif /* _typelib_h */ - diff --git a/externals/mysql/vio/test-ssl.c b/externals/mysql/vio/test-ssl.c new file mode 100644 index 00000000000..855dc5fbb3e --- /dev/null +++ b/externals/mysql/vio/test-ssl.c @@ -0,0 +1,149 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#if defined(HAVE_OPENSSL) && !defined(__NETWARE__) +#include +#include +#include +#include "mysql.h" +#include "errmsg.h" +#include +#include +#include +#include + +const char *VER="0.2"; + + +#ifndef DBUG_OFF +const char *default_dbug_option="d:t:O,-"; +#endif + +void +fatal_error( const char* r) +{ + perror(r); + exit(0); +} + +void +print_usage() +{ + printf("viossl-test: testing SSL virtual IO. Usage:\n"); + printf("viossl-test server-key server-cert client-key client-cert [CAfile] [CApath]\n"); +} + + +int +main(int argc, char** argv) +{ + char* server_key = 0, *server_cert = 0; + char* client_key = 0, *client_cert = 0; + char* ca_file = 0, *ca_path = 0; + char* cipher=0; + int child_pid,sv[2]; + my_bool unused; + struct st_VioSSLFd* ssl_acceptor= 0; + struct st_VioSSLFd* ssl_connector= 0; + Vio* client_vio=0, *server_vio=0; + MY_INIT(argv[0]); + DBUG_PROCESS(argv[0]); + DBUG_PUSH(default_dbug_option); + + if (argc<5) + { + print_usage(); + return 1; + } + + server_key = argv[1]; + server_cert = argv[2]; + client_key = argv[3]; + client_cert = argv[4]; + if (argc>5) + ca_file = argv[5]; + if (argc>6) + ca_path = argv[6]; + printf("Server key/cert : %s/%s\n", server_key, server_cert); + printf("Client key/cert : %s/%s\n", client_key, client_cert); + if (ca_file!=0) + printf("CAfile : %s\n", ca_file); + if (ca_path!=0) + printf("CApath : %s\n", ca_path); + + + if (socketpair(PF_UNIX, SOCK_STREAM, IPPROTO_IP, sv)==-1) + fatal_error("socketpair"); + + ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file, + ca_path, cipher); + ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, + ca_path, cipher); + + client_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0)); + client_vio->sd = sv[0]; + client_vio->vioblocking(client_vio, 0, &unused); + sslconnect(ssl_connector,client_vio,60L); + server_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0)); + server_vio->sd = sv[1]; + server_vio->vioblocking(client_vio, 0, &unused); + sslaccept(ssl_acceptor,server_vio,60L); + + printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd); + + child_pid = fork(); + if (child_pid==-1) { + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("fork"); + } + if (child_pid==0) + { + /* child, therefore, client */ + char xbuf[100]; + int r = vio_read(client_vio,xbuf, sizeof(xbuf)); + if (r<=0) { + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("client:SSL_read"); + } + xbuf[r] = 0; + printf("client:got %s\n", xbuf); + my_free((uchar*)client_vio,MYF(0)); + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + } + else + { + const char* s = "Huhuhuh"; + int r = vio_write(server_vio,(uchar*)s, strlen(s)); + if (r<=0) { + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("server:SSL_write"); + } + my_free((uchar*)server_vio,MYF(0)); + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + } + return 0; +} +#else /* HAVE_OPENSSL */ + +int main() { +return 0; +} +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/test-sslclient.c b/externals/mysql/vio/test-sslclient.c new file mode 100644 index 00000000000..e1b8461397b --- /dev/null +++ b/externals/mysql/vio/test-sslclient.c @@ -0,0 +1,101 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#ifdef HAVE_OPENSSL +#include +#include +#include +#include "mysql.h" +#include "errmsg.h" +#include +#include +#include +#include + +const char *VER="0.2"; + + +#ifndef DBUG_OFF +const char *default_dbug_option="d:t:O,-"; +#endif + +void +fatal_error( const char* r) +{ + perror(r); + exit(0); +} + +int +main( int argc __attribute__((unused)), + char** argv) +{ + char client_key[] = "../SSL/client-key.pem", client_cert[] = "../SSL/client-cert.pem"; + char ca_file[] = "../SSL/cacert.pem", *ca_path = 0, *cipher=0; + struct st_VioSSLFd* ssl_connector= 0; + struct sockaddr_in sa; + Vio* client_vio=0; + int err; + char xbuf[100]="Ohohhhhoh1234"; + MY_INIT(argv[0]); + DBUG_PROCESS(argv[0]); + DBUG_PUSH(default_dbug_option); + + printf("Client key/cert : %s/%s\n", client_key, client_cert); + if (ca_file!=0) + printf("CAfile : %s\n", ca_file); + if (ca_path!=0) + printf("CApath : %s\n", ca_path); + + ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, ca_path, cipher); + if(!ssl_connector) { + fatal_error("client:new_VioSSLConnectorFd failed"); + } + + /* ----------------------------------------------- */ + /* Create a socket and connect to server using normal socket calls. */ + + client_vio = vio_new(socket (AF_INET, SOCK_STREAM, 0), VIO_TYPE_TCPIP, TRUE); + + memset (&sa, '\0', sizeof(sa)); + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = inet_addr ("127.0.0.1"); /* Server IP */ + sa.sin_port = htons (1111); /* Server Port number */ + + err = connect(client_vio->sd, (struct sockaddr*) &sa, + sizeof(sa)); + + /* ----------------------------------------------- */ + /* Now we have TCP conncetion. Start SSL negotiation. */ + read(client_vio->sd,xbuf, sizeof(xbuf)); + sslconnect(ssl_connector,client_vio,60L); + err = vio_read(client_vio,xbuf, sizeof(xbuf)); + if (err<=0) { + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("client:SSL_read"); + } + xbuf[err] = 0; + printf("client:got %s\n", xbuf); + my_free((uchar*)client_vio,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + return 0; +} +#else /* HAVE_OPENSSL */ + +int main() { +return 0; +} +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/test-sslserver.c b/externals/mysql/vio/test-sslserver.c new file mode 100644 index 00000000000..8877dd3cbc8 --- /dev/null +++ b/externals/mysql/vio/test-sslserver.c @@ -0,0 +1,155 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#ifdef HAVE_OPENSSL +#include +#include +#include +#include "mysql.h" +#include "errmsg.h" +#include +#include +#include +#include + +const char *VER="0.2"; + + +#ifndef DBUG_OFF +const char *default_dbug_option="d:t:O,-"; +#endif + +#if 0 +static void +fatal_error( const char* r) +{ + perror(r); + exit(0); +} +#endif + +typedef struct { + int sd; + struct st_VioSSLFd* ssl_acceptor; +} TH_ARGS; + +static void +do_ssl_stuff( TH_ARGS* args) +{ + const char* s = "Huhuhuhuuu"; + Vio* server_vio; + int err; + DBUG_ENTER("do_ssl_stuff"); + + server_vio = vio_new(args->sd, VIO_TYPE_TCPIP, TRUE); + + /* ----------------------------------------------- */ + /* TCP connection is ready. Do server side SSL. */ + + err = write(server_vio->sd,(uchar*)s, strlen(s)); + sslaccept(args->ssl_acceptor,server_vio,60L); + err = server_vio->write(server_vio,(uchar*)s, strlen(s)); + DBUG_VOID_RETURN; +} + +static void* +client_thread( void* arg) +{ + my_thread_init(); + do_ssl_stuff((TH_ARGS*)arg); + return 0; +} + +int +main(int argc __attribute__((unused)), char** argv) +{ + char server_key[] = "../SSL/server-key.pem", + server_cert[] = "../SSL/server-cert.pem"; + char ca_file[] = "../SSL/cacert.pem", + *ca_path = 0, + *cipher = 0; + struct st_VioSSLFd* ssl_acceptor; + pthread_t th; + TH_ARGS th_args; + + + struct sockaddr_in sa_serv; + struct sockaddr_in sa_cli; + int listen_sd; + int err; + socklen_t client_len; + int reuseaddr = 1; /* better testing, uh? */ + + MY_INIT(argv[0]); + DBUG_PROCESS(argv[0]); + DBUG_PUSH(default_dbug_option); + + printf("Server key/cert : %s/%s\n", server_key, server_cert); + if (ca_file!=0) + + printf("CAfile : %s\n", ca_file); + if (ca_path!=0) + printf("CApath : %s\n", ca_path); + + th_args.ssl_acceptor = ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file, ca_path,cipher); + + /* ----------------------------------------------- */ + /* Prepare TCP socket for receiving connections */ + + listen_sd = socket (AF_INET, SOCK_STREAM, 0); + setsockopt(listen_sd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(&reuseaddr)); + + memset (&sa_serv, '\0', sizeof(sa_serv)); + sa_serv.sin_family = AF_INET; + sa_serv.sin_addr.s_addr = INADDR_ANY; + sa_serv.sin_port = htons (1111); /* Server Port number */ + + err = bind(listen_sd, (struct sockaddr*) &sa_serv, + sizeof (sa_serv)); + + /* Receive a TCP connection. */ + + err = listen (listen_sd, 5); + client_len = sizeof(sa_cli); + th_args.sd = accept (listen_sd, (struct sockaddr*) &sa_cli, &client_len); + close (listen_sd); + + printf ("Connection from %lx, port %x\n", + (long)sa_cli.sin_addr.s_addr, sa_cli.sin_port); + + /* ----------------------------------------------- */ + /* TCP connection is ready. Do server side SSL. */ + + err = pthread_create(&th, NULL, client_thread, (void*)&th_args); + DBUG_PRINT("info", ("pthread_create: %d", err)); + pthread_join(th, NULL); + +#if 0 + if (err<=0) { + my_free((uchar*)ssl_acceptor,MYF(0)); + fatal_error("server:SSL_write"); + } +#endif /* 0 */ + + my_free((uchar*)ssl_acceptor,MYF(0)); + return 0; +} +#else /* HAVE_OPENSSL */ + +int main() { +return 0; +} +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/vio.c b/externals/mysql/vio/vio.c new file mode 100644 index 00000000000..cc5f629e26d --- /dev/null +++ b/externals/mysql/vio/vio.c @@ -0,0 +1,242 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Note that we can't have assertion on file descriptors; The reason for + this is that during mysql shutdown, another thread can close a file + we are working on. In this case we should just return read errors from + the file descriptior. +*/ + +#include "vio_priv.h" + +/* + * Helper to fill most of the Vio* with defaults. + */ + +static void vio_init(Vio* vio, enum enum_vio_type type, + my_socket sd, HANDLE hPipe, uint flags) +{ + DBUG_ENTER("vio_init"); + DBUG_PRINT("enter", ("type: %d sd: %d flags: %d", type, sd, flags)); + +#ifndef HAVE_VIO_READ_BUFF + flags&= ~VIO_BUFFERED_READ; +#endif + bzero((char*) vio, sizeof(*vio)); + vio->type = type; + vio->sd = sd; + vio->hPipe = hPipe; + vio->localhost= flags & VIO_LOCALHOST; + if ((flags & VIO_BUFFERED_READ) && + !(vio->read_buffer= (char*)my_malloc(VIO_READ_BUFFER_SIZE, MYF(MY_WME)))) + flags&= ~VIO_BUFFERED_READ; +#ifdef __WIN__ + if (type == VIO_TYPE_NAMEDPIPE) + { + vio->viodelete =vio_delete; + vio->vioerrno =vio_errno; + vio->read =vio_read_pipe; + vio->write =vio_write_pipe; + vio->fastsend =vio_fastsend; + vio->viokeepalive =vio_keepalive; + vio->should_retry =vio_should_retry; + vio->was_interrupted=vio_was_interrupted; + vio->vioclose =vio_close_pipe; + vio->peer_addr =vio_peer_addr; + vio->vioblocking =vio_blocking; + vio->is_blocking =vio_is_blocking; + vio->timeout =vio_ignore_timeout; + } + else /* default is VIO_TYPE_TCPIP */ +#endif +#ifdef HAVE_SMEM + if (type == VIO_TYPE_SHARED_MEMORY) + { + vio->viodelete =vio_delete; + vio->vioerrno =vio_errno; + vio->read =vio_read_shared_memory; + vio->write =vio_write_shared_memory; + vio->fastsend =vio_fastsend; + vio->viokeepalive =vio_keepalive; + vio->should_retry =vio_should_retry; + vio->was_interrupted=vio_was_interrupted; + vio->vioclose =vio_close_shared_memory; + vio->peer_addr =vio_peer_addr; + vio->vioblocking =vio_blocking; + vio->is_blocking =vio_is_blocking; + vio->timeout =vio_ignore_timeout; + } + else +#endif +#ifdef HAVE_OPENSSL + if (type == VIO_TYPE_SSL) + { + vio->viodelete =vio_ssl_delete; + vio->vioerrno =vio_errno; + vio->read =vio_ssl_read; + vio->write =vio_ssl_write; + vio->fastsend =vio_fastsend; + vio->viokeepalive =vio_keepalive; + vio->should_retry =vio_should_retry; + vio->was_interrupted=vio_was_interrupted; + vio->vioclose =vio_ssl_close; + vio->peer_addr =vio_peer_addr; + vio->vioblocking =vio_ssl_blocking; + vio->is_blocking =vio_is_blocking; + vio->timeout =vio_timeout; + } + else /* default is VIO_TYPE_TCPIP */ +#endif /* HAVE_OPENSSL */ + { + vio->viodelete =vio_delete; + vio->vioerrno =vio_errno; + vio->read= (flags & VIO_BUFFERED_READ) ? vio_read_buff : vio_read; + vio->write =vio_write; + vio->fastsend =vio_fastsend; + vio->viokeepalive =vio_keepalive; + vio->should_retry =vio_should_retry; + vio->was_interrupted=vio_was_interrupted; + vio->vioclose =vio_close; + vio->peer_addr =vio_peer_addr; + vio->vioblocking =vio_blocking; + vio->is_blocking =vio_is_blocking; + vio->timeout =vio_timeout; + } + DBUG_VOID_RETURN; +} + + +/* Reset initialized VIO to use with another transport type */ + +void vio_reset(Vio* vio, enum enum_vio_type type, + my_socket sd, HANDLE hPipe, uint flags) +{ + my_free(vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR)); + vio_init(vio, type, sd, hPipe, flags); +} + + +/* Open the socket or TCP/IP connection and read the fnctl() status */ + +Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags) +{ + Vio *vio; + DBUG_ENTER("vio_new"); + DBUG_PRINT("enter", ("sd: %d", sd)); + if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME)))) + { + vio_init(vio, type, sd, 0, flags); + sprintf(vio->desc, + (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), + vio->sd); +#if !defined(__WIN__) +#if !defined(NO_FCNTL_NONBLOCK) + /* + We call fcntl() to set the flags and then immediately read them back + to make sure that we and the system are in agreement on the state of + things. + + An example of why we need to do this is FreeBSD (and apparently some + other BSD-derived systems, like Mac OS X), where the system sometimes + reports that the socket is set for non-blocking when it really will + block. + */ + fcntl(sd, F_SETFL, 0); + vio->fcntl_mode= fcntl(sd, F_GETFL); +#elif defined(HAVE_SYS_IOCTL_H) /* hpux */ + /* Non blocking sockets doesn't work good on HPUX 11.0 */ + (void) ioctl(sd,FIOSNBIO,0); + vio->fcntl_mode &= ~O_NONBLOCK; +#endif +#else /* !defined(__WIN__) */ + { + /* set to blocking mode by default */ + ulong arg=0, r; + r = ioctlsocket(sd,FIONBIO,(void*) &arg); + vio->fcntl_mode &= ~O_NONBLOCK; + } +#endif + } + DBUG_RETURN(vio); +} + + +#ifdef __WIN__ + +Vio *vio_new_win32pipe(HANDLE hPipe) +{ + Vio *vio; + DBUG_ENTER("vio_new_handle"); + if ((vio = (Vio*) my_malloc(sizeof(Vio),MYF(MY_WME)))) + { + vio_init(vio, VIO_TYPE_NAMEDPIPE, 0, hPipe, VIO_LOCALHOST); + strmov(vio->desc, "named pipe"); + } + DBUG_RETURN(vio); +} + +#ifdef HAVE_SMEM +Vio *vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE handle_map, + HANDLE event_server_wrote, HANDLE event_server_read, + HANDLE event_client_wrote, HANDLE event_client_read, + HANDLE event_conn_closed) +{ + Vio *vio; + DBUG_ENTER("vio_new_win32shared_memory"); + if ((vio = (Vio*) my_malloc(sizeof(Vio),MYF(MY_WME)))) + { + vio_init(vio, VIO_TYPE_SHARED_MEMORY, 0, 0, VIO_LOCALHOST); + vio->handle_file_map= handle_file_map; + vio->handle_map= handle_map; + vio->event_server_wrote= event_server_wrote; + vio->event_server_read= event_server_read; + vio->event_client_wrote= event_client_wrote; + vio->event_client_read= event_client_read; + vio->event_conn_closed= event_conn_closed; + vio->shared_memory_remain= 0; + vio->shared_memory_pos= handle_map; + vio->net= net; + strmov(vio->desc, "shared memory"); + } + DBUG_RETURN(vio); +} +#endif +#endif + + +void vio_delete(Vio* vio) +{ + if (!vio) + return; /* It must be safe to delete null pointers. */ + + if (vio->type != VIO_CLOSED) + vio->vioclose(vio); + my_free((uchar*) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*) vio,MYF(0)); +} + + +/* + Cleanup memory allocated by vio or the + components below it when application finish + +*/ +void vio_end(void) +{ +#ifdef HAVE_YASSL + yaSSL_CleanUp(); +#endif +} diff --git a/externals/mysql/vio/vio_priv.h b/externals/mysql/vio/vio_priv.h new file mode 100644 index 00000000000..54c18dd8420 --- /dev/null +++ b/externals/mysql/vio/vio_priv.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Structures and functions private to the vio package */ + +#define DONT_MAP_VIO +#include +#include +#include +#include +#include + +#ifndef __WIN__ +#include +#include +#endif + + +void vio_ignore_timeout(Vio *vio, uint which, uint timeout); +void vio_timeout(Vio *vio,uint which, uint timeout); + +#ifdef HAVE_OPENSSL +#include "my_net.h" /* needed because of struct in_addr */ + +size_t vio_ssl_read(Vio *vio,uchar* buf, size_t size); +size_t vio_ssl_write(Vio *vio,const uchar* buf, size_t size); + +/* When the workday is over... */ +int vio_ssl_close(Vio *vio); +void vio_ssl_delete(Vio *vio); + +int vio_ssl_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode); + +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/viosocket.c b/externals/mysql/vio/viosocket.c new file mode 100644 index 00000000000..e823f25c24e --- /dev/null +++ b/externals/mysql/vio/viosocket.c @@ -0,0 +1,714 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Note that we can't have assertion on file descriptors; The reason for + this is that during mysql shutdown, another thread can close a file + we are working on. In this case we should just return read errors from + the file descriptior. +*/ + +#include "vio_priv.h" + +int vio_errno(Vio *vio __attribute__((unused))) +{ + return socket_errno; /* On Win32 this mapped to WSAGetLastError() */ +} + + +size_t vio_read(Vio * vio, uchar* buf, size_t size) +{ + size_t r; + DBUG_ENTER("vio_read"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u", vio->sd, buf, + (uint) size)); + + /* Ensure nobody uses vio_read_buff and vio_read simultaneously */ + DBUG_ASSERT(vio->read_end == vio->read_pos); +#ifdef __WIN__ + r = recv(vio->sd, buf, size,0); +#else + errno=0; /* For linux */ + r = read(vio->sd, buf, size); +#endif /* __WIN__ */ +#ifndef DBUG_OFF + if (r == (size_t) -1) + { + DBUG_PRINT("vio_error", ("Got error %d during read",errno)); + } +#endif /* DBUG_OFF */ + DBUG_PRINT("exit", ("%ld", (long) r)); + DBUG_RETURN(r); +} + + +/* + Buffered read: if average read size is small it may + reduce number of syscalls. +*/ + +size_t vio_read_buff(Vio *vio, uchar* buf, size_t size) +{ + size_t rc; +#define VIO_UNBUFFERED_READ_MIN_SIZE 2048 + DBUG_ENTER("vio_read_buff"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u", vio->sd, buf, + (uint) size)); + + if (vio->read_pos < vio->read_end) + { + rc= min((size_t) (vio->read_end - vio->read_pos), size); + memcpy(buf, vio->read_pos, rc); + vio->read_pos+= rc; + /* + Do not try to read from the socket now even if rc < size: + vio_read can return -1 due to an error or non-blocking mode, and + the safest way to handle it is to move to a separate branch. + */ + } + else if (size < VIO_UNBUFFERED_READ_MIN_SIZE) + { + rc= vio_read(vio, (uchar*) vio->read_buffer, VIO_READ_BUFFER_SIZE); + if (rc != 0 && rc != (size_t) -1) + { + if (rc > size) + { + vio->read_pos= vio->read_buffer + size; + vio->read_end= vio->read_buffer + rc; + rc= size; + } + memcpy(buf, vio->read_buffer, rc); + } + } + else + rc= vio_read(vio, buf, size); + DBUG_RETURN(rc); +#undef VIO_UNBUFFERED_READ_MIN_SIZE +} + + +size_t vio_write(Vio * vio, const uchar* buf, size_t size) +{ + size_t r; + DBUG_ENTER("vio_write"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u", vio->sd, buf, + (uint) size)); +#ifdef __WIN__ + r = send(vio->sd, buf, size,0); +#else + r = write(vio->sd, buf, size); +#endif /* __WIN__ */ +#ifndef DBUG_OFF + if (r == (size_t) -1) + { + DBUG_PRINT("vio_error", ("Got error on write: %d",socket_errno)); + } +#endif /* DBUG_OFF */ + DBUG_PRINT("exit", ("%u", (uint) r)); + DBUG_RETURN(r); +} + +int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode, + my_bool *old_mode) +{ + int r=0; + DBUG_ENTER("vio_blocking"); + + *old_mode= test(!(vio->fcntl_mode & O_NONBLOCK)); + DBUG_PRINT("enter", ("set_blocking_mode: %d old_mode: %d", + (int) set_blocking_mode, (int) *old_mode)); + +#if !defined(__WIN__) +#if !defined(NO_FCNTL_NONBLOCK) + if (vio->sd >= 0) + { + int old_fcntl=vio->fcntl_mode; + if (set_blocking_mode) + vio->fcntl_mode &= ~O_NONBLOCK; /* clear bit */ + else + vio->fcntl_mode |= O_NONBLOCK; /* set bit */ + if (old_fcntl != vio->fcntl_mode) + { + r= fcntl(vio->sd, F_SETFL, vio->fcntl_mode); + if (r == -1) + { + DBUG_PRINT("info", ("fcntl failed, errno %d", errno)); + vio->fcntl_mode= old_fcntl; + } + } + } +#else + r= set_blocking_mode ? 0 : 1; +#endif /* !defined(NO_FCNTL_NONBLOCK) */ +#else /* !defined(__WIN__) */ + if (vio->type != VIO_TYPE_NAMEDPIPE && vio->type != VIO_TYPE_SHARED_MEMORY) + { + ulong arg; + int old_fcntl=vio->fcntl_mode; + if (set_blocking_mode) + { + arg = 0; + vio->fcntl_mode &= ~O_NONBLOCK; /* clear bit */ + } + else + { + arg = 1; + vio->fcntl_mode |= O_NONBLOCK; /* set bit */ + } + if (old_fcntl != vio->fcntl_mode) + r = ioctlsocket(vio->sd,FIONBIO,(void*) &arg); + } + else + r= test(!(vio->fcntl_mode & O_NONBLOCK)) != set_blocking_mode; +#endif /* !defined(__WIN__) */ + DBUG_PRINT("exit", ("%d", r)); + DBUG_RETURN(r); +} + +my_bool +vio_is_blocking(Vio * vio) +{ + my_bool r; + DBUG_ENTER("vio_is_blocking"); + r = !(vio->fcntl_mode & O_NONBLOCK); + DBUG_PRINT("exit", ("%d", (int) r)); + DBUG_RETURN(r); +} + + +int vio_fastsend(Vio * vio __attribute__((unused))) +{ + int r=0; + DBUG_ENTER("vio_fastsend"); + +#if defined(IPTOS_THROUGHPUT) + { + int tos = IPTOS_THROUGHPUT; + r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)); + } +#endif /* IPTOS_THROUGHPUT */ + if (!r) + { +#ifdef __WIN__ + BOOL nodelay= 1; +#else + int nodelay = 1; +#endif + + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, + IF_WIN(const char*, void*) &nodelay, + sizeof(nodelay)); + + } + if (r) + { + DBUG_PRINT("warning", ("Couldn't set socket option for fast send")); + r= -1; + } + DBUG_PRINT("exit", ("%d", r)); + DBUG_RETURN(r); +} + +int vio_keepalive(Vio* vio, my_bool set_keep_alive) +{ + int r=0; + uint opt = 0; + DBUG_ENTER("vio_keepalive"); + DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d", vio->sd, (int) + set_keep_alive)); + if (vio->type != VIO_TYPE_NAMEDPIPE) + { + if (set_keep_alive) + opt = 1; + r = setsockopt(vio->sd, SOL_SOCKET, SO_KEEPALIVE, (char *) &opt, + sizeof(opt)); + } + DBUG_RETURN(r); +} + + +my_bool +vio_should_retry(Vio * vio __attribute__((unused))) +{ + int en = socket_errno; + return (en == SOCKET_EAGAIN || en == SOCKET_EINTR || + en == SOCKET_EWOULDBLOCK); +} + + +my_bool +vio_was_interrupted(Vio *vio __attribute__((unused))) +{ + int en= socket_errno; + return (en == SOCKET_EAGAIN || en == SOCKET_EINTR || + en == SOCKET_EWOULDBLOCK || en == SOCKET_ETIMEDOUT); +} + + +int vio_close(Vio * vio) +{ + int r=0; + DBUG_ENTER("vio_close"); +#ifdef _WIN32 + if (vio->type == VIO_TYPE_NAMEDPIPE) + { +#ifdef MYSQL_SERVER + CancelIo(vio->hPipe); + DisconnectNamedPipe(vio->hPipe); +#endif + r=CloseHandle(vio->hPipe); + } + else +#endif /* _WIN32 */ + if (vio->type != VIO_CLOSED) + { + DBUG_ASSERT(vio->sd >= 0); + if (shutdown(vio->sd, SHUT_RDWR)) + r= -1; + if (closesocket(vio->sd)) + r= -1; + } + if (r) + { + DBUG_PRINT("vio_error", ("close() failed, error: %d",socket_errno)); + /* FIXME: error handling (not critical for MySQL) */ + } + vio->type= VIO_CLOSED; + vio->sd= -1; + DBUG_RETURN(r); +} + + +const char *vio_description(Vio * vio) +{ + return vio->desc; +} + +enum enum_vio_type vio_type(Vio* vio) +{ + return vio->type; +} + +my_socket vio_fd(Vio* vio) +{ + return vio->sd; +} + +my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen) +{ + DBUG_ENTER("vio_peer_addr"); + DBUG_PRINT("enter", ("sd: %d", vio->sd)); + + if (vio->localhost) + { + strmov(buf, "127.0.0.1"); + *port= 0; + } + else + { + int error; + char port_buf[NI_MAXSERV]; + socklen_t addrLen = sizeof(vio->remote); + if (getpeername(vio->sd, (struct sockaddr *) (&vio->remote), + &addrLen) != 0) + { + DBUG_PRINT("exit", ("getpeername gave error: %d", socket_errno)); + DBUG_RETURN(1); + } + vio->addrLen= (int)addrLen; + + if ((error= getnameinfo((struct sockaddr *)(&vio->remote), + addrLen, + buf, buflen, + port_buf, NI_MAXSERV, NI_NUMERICHOST|NI_NUMERICSERV))) + { + DBUG_PRINT("exit", ("getnameinfo gave error: %s", + gai_strerror(error))); + DBUG_RETURN(1); + } + + *port= (uint16)strtol(port_buf, (char **)NULL, 10); + + /* + A lot of users do not have IPv6 loopback resolving to localhost + correctly setup. Should this exist? No. If we do not do it though + we will be getting a lot of support questions from users who + have bad setups. This code should be removed by say... 2012. + -Brian + */ + if (!memcmp(buf, "::ffff:127.0.0.1", sizeof("::ffff:127.0.0.1"))) + strmov(buf, "127.0.0.1"); + } + DBUG_PRINT("exit", ("addr: %s", buf)); + DBUG_RETURN(0); +} + + +/* Return 0 if there is data to be read */ + +my_bool vio_poll_read(Vio *vio,uint timeout) +{ +#ifdef __WIN__ + int res; + my_socket fd= vio->sd; + fd_set readfds, errorfds; + struct timeval tm; + DBUG_ENTER("vio_poll"); + tm.tv_sec= timeout; + tm.tv_usec= 0; + FD_ZERO(&readfds); + FD_ZERO(&errorfds); + FD_SET(fd, &readfds); + FD_SET(fd, &errorfds); + /* The first argument is ignored on Windows, so a conversion to int is OK */ + if ((res= select((int) fd, &readfds, NULL, &errorfds, &tm) <= 0)) + { + DBUG_RETURN(res < 0 ? 0 : 1); + } + res= FD_ISSET(fd, &readfds) || FD_ISSET(fd, &errorfds); + DBUG_RETURN(!res); +#elif defined(HAVE_POLL) + struct pollfd fds; + int res; + DBUG_ENTER("vio_poll"); + fds.fd=vio->sd; + fds.events=POLLIN; + fds.revents=0; + if ((res=poll(&fds,1,(int) timeout*1000)) <= 0) + { + DBUG_RETURN(res < 0 ? 0 : 1); /* Don't return 1 on errors */ + } + DBUG_RETURN(fds.revents & (POLLIN | POLLERR | POLLHUP) ? 0 : 1); +#else + return 0; +#endif +} + + +my_bool vio_peek_read(Vio *vio, uint *bytes) +{ +#ifdef __WIN__ + int len; + if (ioctlsocket(vio->sd, FIONREAD, &len)) + return TRUE; + *bytes= len; + return FALSE; +#elif FIONREAD_IN_SYS_IOCTL + int len; + if (ioctl(vio->sd, FIONREAD, &len) < 0) + return TRUE; + *bytes= len; + return FALSE; +#else + char buf[1024]; + ssize_t res= recv(vio->sd, &buf, sizeof(buf), MSG_PEEK); + if (res < 0) + return TRUE; + *bytes= res; + return FALSE; +#endif +} + +void vio_timeout(Vio *vio, uint which, uint timeout) +{ +#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) + int r; + DBUG_ENTER("vio_timeout"); + + { +#ifdef __WIN__ + /* Windows expects time in milliseconds as int */ + int wait_timeout= (int) timeout * 1000; +#else + /* POSIX specifies time as struct timeval. */ + struct timeval wait_timeout; + wait_timeout.tv_sec= timeout; + wait_timeout.tv_usec= 0; +#endif + + r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO, + IF_WIN(const char*, const void*)&wait_timeout, + sizeof(wait_timeout)); + + } + +#ifndef DBUG_OFF + if (r != 0) + DBUG_PRINT("error", ("setsockopt failed: %d, errno: %d", r, socket_errno)); +#endif + + DBUG_VOID_RETURN; +#else +/* + Platforms not suporting setting of socket timeout should either use + thr_alarm or just run without read/write timeout(s) +*/ +#endif +} + + +#ifdef __WIN__ +size_t vio_read_pipe(Vio * vio, uchar* buf, size_t size) +{ + DWORD length; + DBUG_ENTER("vio_read_pipe"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u", vio->sd, buf, + (uint) size)); + + if (!ReadFile(vio->hPipe, buf, size, &length, NULL)) + DBUG_RETURN(-1); + + DBUG_PRINT("exit", ("%d", length)); + DBUG_RETURN((size_t) length); +} + + +size_t vio_write_pipe(Vio * vio, const uchar* buf, size_t size) +{ + DWORD length; + DBUG_ENTER("vio_write_pipe"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u", vio->sd, buf, + (uint) size)); + + if (!WriteFile(vio->hPipe, (char*) buf, size, &length, NULL)) + DBUG_RETURN(-1); + + DBUG_PRINT("exit", ("%d", length)); + DBUG_RETURN((size_t) length); +} + +int vio_close_pipe(Vio * vio) +{ + int r; + DBUG_ENTER("vio_close_pipe"); +#ifdef MYSQL_SERVER + CancelIo(vio->hPipe); + DisconnectNamedPipe(vio->hPipe); +#endif + r=CloseHandle(vio->hPipe); + if (r) + { + DBUG_PRINT("vio_error", ("close() failed, error: %d",GetLastError())); + /* FIXME: error handling (not critical for MySQL) */ + } + vio->type= VIO_CLOSED; + vio->sd= -1; + DBUG_RETURN(r); +} + + +void vio_ignore_timeout(Vio *vio __attribute__((unused)), + uint which __attribute__((unused)), + uint timeout __attribute__((unused))) +{ +} + + +#ifdef HAVE_SMEM + +size_t vio_read_shared_memory(Vio * vio, uchar* buf, size_t size) +{ + size_t length; + size_t remain_local; + char *current_postion; + HANDLE events[2]; + + DBUG_ENTER("vio_read_shared_memory"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->sd, buf, + size)); + + remain_local = size; + current_postion=buf; + + events[0]= vio->event_server_wrote; + events[1]= vio->event_conn_closed; + + do + { + if (vio->shared_memory_remain == 0) + { + /* + WaitForMultipleObjects can return next values: + WAIT_OBJECT_0+0 - event from vio->event_server_wrote + WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read + anything + WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything + */ + if (WaitForMultipleObjects(array_elements(events), events, FALSE, + vio->net->read_timeout*1000) != WAIT_OBJECT_0) + { + DBUG_RETURN(-1); + }; + + vio->shared_memory_pos = vio->handle_map; + vio->shared_memory_remain = uint4korr((ulong*)vio->shared_memory_pos); + vio->shared_memory_pos+=4; + } + + length = size; + + if (vio->shared_memory_remain < length) + length = vio->shared_memory_remain; + if (length > remain_local) + length = remain_local; + + memcpy(current_postion,vio->shared_memory_pos,length); + + vio->shared_memory_remain-=length; + vio->shared_memory_pos+=length; + current_postion+=length; + remain_local-=length; + + if (!vio->shared_memory_remain) + { + if (!SetEvent(vio->event_client_read)) + DBUG_RETURN(-1); + } + } while (remain_local); + length = size; + + DBUG_PRINT("exit", ("%lu", (ulong) length)); + DBUG_RETURN(length); +} + + +size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size) +{ + size_t length, remain, sz; + HANDLE pos; + const uchar *current_postion; + HANDLE events[2]; + + DBUG_ENTER("vio_write_shared_memory"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %d", vio->sd, buf, + size)); + + remain = size; + current_postion = buf; + + events[0]= vio->event_server_read; + events[1]= vio->event_conn_closed; + + while (remain != 0) + { + if (WaitForMultipleObjects(array_elements(events), events, FALSE, + vio->net->write_timeout*1000) != WAIT_OBJECT_0) + { + DBUG_RETURN((size_t) -1); + } + + sz= (remain > shared_memory_buffer_length ? shared_memory_buffer_length : + remain); + + int4store(vio->handle_map,sz); + pos = vio->handle_map + 4; + memcpy(pos,current_postion,sz); + remain-=sz; + current_postion+=sz; + if (!SetEvent(vio->event_client_wrote)) + DBUG_RETURN((size_t) -1); + } + length = size; + + DBUG_PRINT("exit", ("%lu", (ulong) length)); + DBUG_RETURN(length); +} + + +/** + Close shared memory and DBUG_PRINT any errors that happen on closing. + @return Zero if all closing functions succeed, and nonzero otherwise. +*/ +int vio_close_shared_memory(Vio * vio) +{ + int error_count= 0; + DBUG_ENTER("vio_close_shared_memory"); + if (vio->type != VIO_CLOSED) + { + /* + Set event_conn_closed for notification of both client and server that + connection is closed + */ + SetEvent(vio->event_conn_closed); + /* + Close all handlers. UnmapViewOfFile and CloseHandle return non-zero + result if they are success. + */ + if (UnmapViewOfFile(vio->handle_map) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("UnmapViewOfFile() failed")); + } + if (CloseHandle(vio->event_server_wrote) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("CloseHandle(vio->esw) failed")); + } + if (CloseHandle(vio->event_server_read) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("CloseHandle(vio->esr) failed")); + } + if (CloseHandle(vio->event_client_wrote) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("CloseHandle(vio->ecw) failed")); + } + if (CloseHandle(vio->event_client_read) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("CloseHandle(vio->ecr) failed")); + } + if (CloseHandle(vio->handle_file_map) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("CloseHandle(vio->hfm) failed")); + } + if (CloseHandle(vio->event_conn_closed) == 0) + { + error_count++; + DBUG_PRINT("vio_error", ("CloseHandle(vio->ecc) failed")); + } + } + vio->type= VIO_CLOSED; + vio->sd= -1; + DBUG_RETURN(error_count); +} +#endif /* HAVE_SMEM */ +#endif /* __WIN__ */ + + +/** + Number of bytes in the read buffer. + + @return number of bytes in the read buffer or < 0 if error. +*/ + +ssize_t vio_pending(Vio *vio) +{ +#ifdef HAVE_OPENSSL + SSL *ssl= (SSL*) vio->ssl_arg; +#endif + + if (vio->read_pos < vio->read_end) + return vio->read_end - vio->read_pos; + +#ifdef HAVE_OPENSSL + if (ssl) + return SSL_pending(ssl); +#endif + + return 0; +} diff --git a/externals/mysql/vio/viossl.c b/externals/mysql/vio/viossl.c new file mode 100644 index 00000000000..9cbd74034a9 --- /dev/null +++ b/externals/mysql/vio/viossl.c @@ -0,0 +1,279 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Note that we can't have assertion on file descriptors; The reason for + this is that during mysql shutdown, another thread can close a file + we are working on. In this case we should just return read errors from + the file descriptior. +*/ + +#include "vio_priv.h" + +#ifdef HAVE_OPENSSL + +#ifdef __NETWARE__ + +/* yaSSL already uses BSD sockets */ +#ifndef HAVE_YASSL + +/* + The default OpenSSL implementation on NetWare uses WinSock. + This code allows us to use the BSD sockets. +*/ + +static int SSL_set_fd_bsd(SSL *s, int fd) +{ + int result= -1; + BIO_METHOD *BIO_s_bsdsocket(); + BIO *bio; + + if ((bio= BIO_new(BIO_s_bsdsocket()))) + { + result= BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(s, bio, bio); + } + return result; +} + +#define SSL_set_fd(A, B) SSL_set_fd_bsd((A), (B)) + +#endif /* HAVE_YASSL */ +#endif /* __NETWARE__ */ + + +static void +report_errors(SSL* ssl) +{ + unsigned long l; + const char *file; + const char *data; + int line, flags; +#ifndef DBUG_OFF + char buf[512]; +#endif + + DBUG_ENTER("report_errors"); + + while ((l= ERR_get_error_line_data(&file,&line,&data,&flags))) + { + DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf), + file,line,(flags&ERR_TXT_STRING)?data:"")) ; + } + + if (ssl) + DBUG_PRINT("error", ("error: %s", + ERR_error_string(SSL_get_error(ssl, l), buf))); + + DBUG_PRINT("info", ("socket_errno: %d", socket_errno)); + DBUG_VOID_RETURN; +} + + +size_t vio_ssl_read(Vio *vio, uchar* buf, size_t size) +{ + size_t r; + DBUG_ENTER("vio_ssl_read"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u ssl: %p", + vio->sd, buf, (uint) size, vio->ssl_arg)); + + r= SSL_read((SSL*) vio->ssl_arg, buf, size); +#ifndef DBUG_OFF + if (r == (size_t) -1) + report_errors((SSL*) vio->ssl_arg); +#endif + DBUG_PRINT("exit", ("%u", (uint) r)); + DBUG_RETURN(r); +} + + +size_t vio_ssl_write(Vio *vio, const uchar* buf, size_t size) +{ + size_t r; + DBUG_ENTER("vio_ssl_write"); + DBUG_PRINT("enter", ("sd: %d buf: %p size: %u", vio->sd, + buf, (uint) size)); + + r= SSL_write((SSL*) vio->ssl_arg, buf, size); +#ifndef DBUG_OFF + if (r == (size_t) -1) + report_errors((SSL*) vio->ssl_arg); +#endif + DBUG_PRINT("exit", ("%u", (uint) r)); + DBUG_RETURN(r); +} + + +int vio_ssl_close(Vio *vio) +{ + int r= 0; + SSL *ssl= (SSL*)vio->ssl_arg; + DBUG_ENTER("vio_ssl_close"); + + if (ssl) + { + /* + THE SSL standard says that SSL sockets must send and receive a close_notify + alert on socket shutdown to avoid truncation attacks. However, this can + cause problems since we often hold a lock during shutdown and this IO can + take an unbounded amount of time to complete. Since our packets are self + describing with length, we aren't vunerable to these attacks. Therefore, + we just shutdown by closing the socket (quiet shutdown). + */ + SSL_set_quiet_shutdown(ssl, 1); + + switch ((r= SSL_shutdown(ssl))) { + case 1: + /* Shutdown successful */ + break; + case 0: + /* + Shutdown not yet finished - since the socket is going to + be closed there is no need to call SSL_shutdown() a second + time to wait for the other side to respond + */ + break; + default: /* Shutdown failed */ + DBUG_PRINT("vio_error", ("SSL_shutdown() failed, error: %d", + SSL_get_error(ssl, r))); + break; + } + } + DBUG_RETURN(vio_close(vio)); +} + + +void vio_ssl_delete(Vio *vio) +{ + if (!vio) + return; /* It must be safe to delete null pointer */ + + if (vio->type == VIO_TYPE_SSL) + vio_ssl_close(vio); /* Still open, close connection first */ + + if (vio->ssl_arg) + { + SSL_free((SSL*) vio->ssl_arg); + vio->ssl_arg= 0; + } + + vio_delete(vio); +} + +#ifndef EMBEDDED_LIBRARY +static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, + int (*connect_accept_func)(SSL*)) +{ + SSL *ssl; + my_bool unused; + my_bool was_blocking; + + DBUG_ENTER("ssl_do"); + DBUG_PRINT("enter", ("ptr: %p, sd: %d ctx: %p", + ptr, vio->sd, ptr->ssl_context)); + + /* Set socket to blocking if not already set */ + vio_blocking(vio, 1, &was_blocking); + + if (!(ssl= SSL_new(ptr->ssl_context))) + { + DBUG_PRINT("error", ("SSL_new failure")); + report_errors(ssl); + vio_blocking(vio, was_blocking, &unused); + DBUG_RETURN(1); + } + DBUG_PRINT("info", ("ssl: %p timeout: %ld", ssl, timeout)); + SSL_clear(ssl); + SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout); + SSL_set_fd(ssl, vio->sd); + + if (connect_accept_func(ssl) < 1) + { + DBUG_PRINT("error", ("SSL_connect/accept failure")); + report_errors(ssl); + SSL_free(ssl); + vio_blocking(vio, was_blocking, &unused); + DBUG_RETURN(1); + } + + /* + Connection succeeded. Install new function handlers, + change type, set sd to the fd used when connecting + and set pointer to the SSL structure + */ + vio_reset(vio, VIO_TYPE_SSL, SSL_get_fd(ssl), 0, 0); + vio->ssl_arg= (void*)ssl; + +#ifndef DBUG_OFF + { + /* Print some info about the peer */ + X509 *cert; + char buf[512]; + + DBUG_PRINT("info",("SSL connection succeeded")); + DBUG_PRINT("info",("Using cipher: '%s'" , SSL_get_cipher_name(ssl))); + + if ((cert= SSL_get_peer_certificate (ssl))) + { + DBUG_PRINT("info",("Peer certificate:")); + X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf)); + DBUG_PRINT("info",("\t subject: '%s'", buf)); + X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf)); + DBUG_PRINT("info",("\t issuer: '%s'", buf)); + X509_free(cert); + } + else + DBUG_PRINT("info",("Peer does not have certificate.")); + + if (SSL_get_shared_ciphers(ssl, buf, sizeof(buf))) + { + DBUG_PRINT("info",("shared_ciphers: '%s'", buf)); + } + else + DBUG_PRINT("info",("no shared ciphers!")); + } +#endif + + DBUG_RETURN(0); +} + + +int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout) +{ + DBUG_ENTER("sslaccept"); + DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_accept)); +} + + +int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout) +{ + DBUG_ENTER("sslconnect"); + DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_connect)); +} +#endif /*EMBEDDED_LIBRARY*/ + +int vio_ssl_blocking(Vio *vio __attribute__((unused)), + my_bool set_blocking_mode, + my_bool *old_mode) +{ + /* Mode is always blocking */ + *old_mode= 1; + /* Return error if we try to change to non_blocking mode */ + return (set_blocking_mode ? 0 : 1); +} + + + +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/viosslfactories.c b/externals/mysql/vio/viosslfactories.c new file mode 100644 index 00000000000..95dbd73d24d --- /dev/null +++ b/externals/mysql/vio/viosslfactories.c @@ -0,0 +1,385 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "vio_priv.h" + +#ifdef HAVE_OPENSSL + +static my_bool ssl_algorithms_added = FALSE; +static my_bool ssl_error_strings_loaded= FALSE; +static int verify_depth = 0; + +static unsigned char dh512_p[]= +{ + 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75, + 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F, + 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3, + 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12, + 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C, + 0x47,0x74,0xE8,0x33, +}; + +static unsigned char dh512_g[]={ + 0x02, +}; + +static DH *get_dh512(void) +{ + DH *dh; + if ((dh=DH_new())) + { + dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL); + dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL); + if (! dh->p || ! dh->g) + { + DH_free(dh); + dh=0; + } + } + return(dh); +} + + +static void +report_errors() +{ + unsigned long l; + const char* file; + const char* data; + int line,flags; + + DBUG_ENTER("report_errors"); + + while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) + { +#ifndef DBUG_OFF /* Avoid warning */ + char buf[200]; + DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf), + file,line,(flags & ERR_TXT_STRING) ? data : "")) ; +#endif + } + DBUG_VOID_RETURN; +} + + +static int +vio_set_cert_stuff(SSL_CTX *ctx, const char *cert_file, const char *key_file) +{ + DBUG_ENTER("vio_set_cert_stuff"); + DBUG_PRINT("enter", ("ctx: %p cert_file: %s key_file: %s", + ctx, cert_file, key_file)); + if (cert_file) + { + if (SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0) + { + DBUG_PRINT("error",("unable to get certificate from '%s'", cert_file)); + DBUG_EXECUTE("error", ERR_print_errors_fp(DBUG_FILE);); + fprintf(stderr, "SSL error: Unable to get certificate from '%s'\n", + cert_file); + fflush(stderr); + DBUG_RETURN(1); + } + + if (!key_file) + key_file= cert_file; + + if (SSL_CTX_use_PrivateKey_file(ctx, key_file, SSL_FILETYPE_PEM) <= 0) + { + DBUG_PRINT("error", ("unable to get private key from '%s'", key_file)); + DBUG_EXECUTE("error", ERR_print_errors_fp(DBUG_FILE);); + fprintf(stderr, "SSL error: Unable to get private key from '%s'\n", + key_file); + fflush(stderr); + DBUG_RETURN(1); + } + + /* + If we are using DSA, we can copy the parameters from the private key + Now we know that a key and cert have been set against the SSL context + */ + if (!SSL_CTX_check_private_key(ctx)) + { + DBUG_PRINT("error", + ("Private key does not match the certificate public key")); + DBUG_EXECUTE("error", ERR_print_errors_fp(DBUG_FILE);); + fprintf(stderr, + "SSL error: " + "Private key does not match the certificate public key\n"); + fflush(stderr); + DBUG_RETURN(1); + } + } + DBUG_RETURN(0); +} + + +static int +vio_verify_callback(int ok, X509_STORE_CTX *ctx) +{ + char buf[256]; + X509 *err_cert; + + DBUG_ENTER("vio_verify_callback"); + DBUG_PRINT("enter", ("ok: %d ctx: %p", ok, ctx)); + + err_cert= X509_STORE_CTX_get_current_cert(ctx); + X509_NAME_oneline(X509_get_subject_name(err_cert), buf, sizeof(buf)); + DBUG_PRINT("info", ("cert: %s", buf)); + if (!ok) + { + int err, depth; + err= X509_STORE_CTX_get_error(ctx); + depth= X509_STORE_CTX_get_error_depth(ctx); + + DBUG_PRINT("error",("verify error: %d '%s'",err, + X509_verify_cert_error_string(err))); + /* + Approve cert if depth is greater then "verify_depth", currently + verify_depth is always 0 and there is no way to increase it. + */ + if (verify_depth >= depth) + ok= 1; + } + switch (ctx->error) + { + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256); + DBUG_PRINT("info",("issuer= %s\n", buf)); + break; + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + DBUG_PRINT("error", ("notBefore")); + /*ASN1_TIME_print_fp(stderr,X509_get_notBefore(ctx->current_cert));*/ + break; + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + DBUG_PRINT("error", ("notAfter error")); + /*ASN1_TIME_print_fp(stderr,X509_get_notAfter(ctx->current_cert));*/ + break; + } + DBUG_PRINT("exit", ("%d", ok)); + DBUG_RETURN(ok); +} + + +#ifdef __NETWARE__ + +/* NetWare SSL cleanup */ +void netware_ssl_cleanup() +{ + /* free memory from SSL_library_init() */ + EVP_cleanup(); + +/* OpenSSL NetWare port specific functions */ +#ifndef HAVE_YASSL + + /* free global X509 method */ + X509_STORE_method_cleanup(); + + /* free the thread_hash error table */ + ERR_free_state_table(); +#endif +} + + +/* NetWare SSL initialization */ +static void netware_ssl_init() +{ + /* cleanup OpenSSL library */ + NXVmRegisterExitHandler(netware_ssl_cleanup, NULL); +} + +#endif /* __NETWARE__ */ + + +static void check_ssl_init() +{ + if (!ssl_algorithms_added) + { + ssl_algorithms_added= TRUE; + SSL_library_init(); + OpenSSL_add_all_algorithms(); + + } + +#ifdef __NETWARE__ + netware_ssl_init(); +#endif + + if (!ssl_error_strings_loaded) + { + ssl_error_strings_loaded= TRUE; + SSL_load_error_strings(); + } +} + +#ifndef EMBEDDED_LIBRARY +/************************ VioSSLFd **********************************/ +static struct st_VioSSLFd * +new_VioSSLFd(const char *key_file, const char *cert_file, + const char *ca_file, const char *ca_path, + const char *cipher, SSL_METHOD *method) +{ + DH *dh; + struct st_VioSSLFd *ssl_fd; + DBUG_ENTER("new_VioSSLFd"); + DBUG_PRINT("enter", + ("key_file: '%s' cert_file: '%s' ca_file: '%s' ca_path: '%s' " + "cipher: '%s'", + key_file ? key_file : "NULL", + cert_file ? cert_file : "NULL", + ca_file ? ca_file : "NULL", + ca_path ? ca_path : "NULL", + cipher ? cipher : "NULL")); + + check_ssl_init(); + + if (!(ssl_fd= ((struct st_VioSSLFd*) + my_malloc(sizeof(struct st_VioSSLFd),MYF(0))))) + DBUG_RETURN(0); + + if (!(ssl_fd->ssl_context= SSL_CTX_new(method))) + { + DBUG_PRINT("error", ("SSL_CTX_new failed")); + report_errors(); + my_free((void*)ssl_fd,MYF(0)); + DBUG_RETURN(0); + } + + /* + Set the ciphers that can be used + NOTE: SSL_CTX_set_cipher_list will return 0 if + none of the provided ciphers could be selected + */ + if (cipher && + SSL_CTX_set_cipher_list(ssl_fd->ssl_context, cipher) == 0) + { + DBUG_PRINT("error", ("failed to set ciphers to use")); + report_errors(); + SSL_CTX_free(ssl_fd->ssl_context); + my_free((void*)ssl_fd,MYF(0)); + DBUG_RETURN(0); + } + + /* Load certs from the trusted ca */ + if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) == 0) + { + DBUG_PRINT("warning", ("SSL_CTX_load_verify_locations failed")); + if (SSL_CTX_set_default_verify_paths(ssl_fd->ssl_context) == 0) + { + DBUG_PRINT("error", ("SSL_CTX_set_default_verify_paths failed")); + report_errors(); + SSL_CTX_free(ssl_fd->ssl_context); + my_free((void*)ssl_fd,MYF(0)); + DBUG_RETURN(0); + } + } + + if (vio_set_cert_stuff(ssl_fd->ssl_context, cert_file, key_file)) + { + DBUG_PRINT("error", ("vio_set_cert_stuff failed")); + report_errors(); + SSL_CTX_free(ssl_fd->ssl_context); + my_free((void*)ssl_fd,MYF(0)); + DBUG_RETURN(0); + } + + /* DH stuff */ + dh=get_dh512(); + SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh); + DH_free(dh); + + DBUG_PRINT("exit", ("OK 1")); + + DBUG_RETURN(ssl_fd); +} + + +/************************ VioSSLConnectorFd **********************************/ +struct st_VioSSLFd * +new_VioSSLConnectorFd(const char *key_file, const char *cert_file, + const char *ca_file, const char *ca_path, + const char *cipher) +{ + struct st_VioSSLFd *ssl_fd; + int verify= SSL_VERIFY_PEER; + + /* + Turn off verification of servers certificate if both + ca_file and ca_path is set to NULL + */ + if (ca_file == 0 && ca_path == 0) + verify= SSL_VERIFY_NONE; + + if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, + ca_path, cipher, TLSv1_client_method()))) + { + return 0; + } + + /* Init the VioSSLFd as a "connector" ie. the client side */ + + /* + The verify_callback function is used to control the behaviour + when the SSL_VERIFY_PEER flag is set. + */ + SSL_CTX_set_verify(ssl_fd->ssl_context, verify, vio_verify_callback); + + return ssl_fd; +} + + +/************************ VioSSLAcceptorFd **********************************/ +struct st_VioSSLFd * +new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, + const char *ca_file, const char *ca_path, + const char *cipher) +{ + struct st_VioSSLFd *ssl_fd; + int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE; + if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, + ca_path, cipher, TLSv1_server_method()))) + { + return 0; + } + /* Init the the VioSSLFd as a "acceptor" ie. the server side */ + + /* Set max number of cached sessions, returns the previous size */ + SSL_CTX_sess_set_cache_size(ssl_fd->ssl_context, 128); + + /* + The verify_callback function is used to control the behaviour + when the SSL_VERIFY_PEER flag is set. + */ + SSL_CTX_set_verify(ssl_fd->ssl_context, verify, vio_verify_callback); + + /* + Set session_id - an identifier for this server session + Use the ssl_fd pointer + */ + SSL_CTX_set_session_id_context(ssl_fd->ssl_context, + (const unsigned char *)ssl_fd, + sizeof(ssl_fd)); + + return ssl_fd; +} + +void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd) +{ + SSL_CTX_free(fd->ssl_context); + my_free((uchar*) fd, MYF(0)); +} +#endif /*EMBEDDED_LIBRARY*/ +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/viotest-ssl.c b/externals/mysql/vio/viotest-ssl.c new file mode 100644 index 00000000000..b8abbac4ed6 --- /dev/null +++ b/externals/mysql/vio/viotest-ssl.c @@ -0,0 +1,151 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#ifdef HAVE_OPENSSL +#include +#include +#include +#include "mysql.h" +#include "errmsg.h" +#include +#include +#include +#include + +const char *VER="0.2"; + + +#ifndef DBUG_OFF +const char *default_dbug_option="d:t:O,/tmp/viotest-ssl.trace"; +#endif + +void +fatal_error(const char *r) +{ + perror(r); + exit(0); +} + +void +print_usage() +{ + printf("viossl-test: testing SSL virtual IO. Usage:\n"); + printf("viossl-test server-key server-cert client-key client-cert [CAfile] [CApath]\n"); +} + + +int main(int argc, char **argv) +{ + char* server_key = 0; + char* server_cert = 0; + char* client_key = 0; + char* client_cert = 0; + char* ca_file = 0; + char* ca_path = 0; + int child_pid,sv[2]; + struct st_VioSSLAcceptorFd* ssl_acceptor=0; + struct st_VioSSLConnectorFd* ssl_connector=0; + Vio* client_vio=0; + Vio* server_vio=0; + MY_INIT(argv[0]); + DBUG_PROCESS(argv[0]); + DBUG_PUSH(default_dbug_option); + + if (argc<5) + { + print_usage(); + return 1; + } + + server_key = argv[1]; + server_cert = argv[2]; + client_key = argv[3]; + client_cert = argv[4]; + if (argc>5) + ca_file = argv[5]; + if (argc>6) + ca_path = argv[6]; + printf("Server key/cert : %s/%s\n", server_key, server_cert); + printf("Client key/cert : %s/%s\n", client_key, client_cert); + if (ca_file!=0) + printf("CAfile : %s\n", ca_file); + if (ca_path!=0) + printf("CApath : %s\n", ca_path); + + + if (socketpair(PF_UNIX, SOCK_STREAM, IPPROTO_IP, sv)==-1) + fatal_error("socketpair"); + + ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file, + ca_path); + ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, + ca_path); + + client_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0)); + client_vio->sd = sv[0]; + sslconnect(ssl_connector,client_vio); + server_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0)); + server_vio->sd = sv[1]; + sslaccept(ssl_acceptor,server_vio); + + printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd); + + child_pid = fork(); + if (child_pid==-1) + { + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("fork"); + } + if (child_pid==0) + { + /* child, therefore, client */ + char xbuf[100]; + int r = vio_ssl_read(client_vio,xbuf, sizeof(xbuf)); + if (r<=0) { + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("client:SSL_read"); + } + xbuf[r] = 0; + printf("client:got %s\n", xbuf); + my_free((uchar*)client_vio,MYF(0)); + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + sleep(1); + } + else + { + const char* s = "Huhuhuh"; + int r = vio_ssl_write(server_vio,(uchar*)s, strlen(s)); + if (r<=0) { + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + fatal_error("server:SSL_write"); + } + my_free((uchar*)server_vio,MYF(0)); + my_free((uchar*)ssl_acceptor,MYF(0)); + my_free((uchar*)ssl_connector,MYF(0)); + sleep(1); + } + return 0; +} +#else /* HAVE_OPENSSL */ + +int main() { +return 0; +} +#endif /* HAVE_OPENSSL */ diff --git a/externals/mysql/vio/viotest-sslconnect.cc b/externals/mysql/vio/viotest-sslconnect.cc new file mode 100644 index 00000000000..89e1a6e7dfe --- /dev/null +++ b/externals/mysql/vio/viotest-sslconnect.cc @@ -0,0 +1,80 @@ + +/* +** Virtual I/O library +** Written by Andrei Errapart +*/ + +#include "all.h" + +#include +#include +#include +#include +#include + + +void +fatal_error( const char* r) +{ + perror(r); + exit(0); +} + +void +print_usage() +{ + printf("viotest-sslconnect: testing SSL virtual IO. Usage:\n"); + printf("viotest-sslconnect key cert\n"); +} + +int +main( int argc, + char** argv) +{ + char* key = 0; + char* cert = 0; + + if (argc<3) + { + print_usage(); + return 1; + } + + char ip[4] = {127, 0, 0, 1}; + unsigned long addr = (unsigned long) + ((unsigned long)ip[0]<<24L)| + ((unsigned long)ip[1]<<16L)| + ((unsigned long)ip[2]<< 8L)| + ((unsigned long)ip[3]); + int fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + if (fd<0) + fatal_error("socket"); + struct sockaddr_in sa; + sa.sin_family = AF_INET; + sa.sin_port=htons(4433); + sa.sin_addr.s_addr=htonl(addr); + int sa_size = sizeof sa; + if (connect(fd, reinterpret_cast(&sa), sa_size)==-1) + fatal_error("connect"); + key = argv[1]; + cert = argv[2]; + printf("Key : %s\n", key); + printf("Cert : %s\n", cert); + + VIO_NS::VioSSLConnectorFd* ssl_connector = new VIO_NS::VioSSLConnectorFd(cert, key,0,0); + + VIO_NS::VioSSL* vio = ssl_connector->connect(fd); + + char xbuf[100]; + int r = vio->read(xbuf, sizeof(xbuf)); + if (r<=0) { + delete ssl_connector; + delete vio; + fatal_error("client:SSL_read"); + } + xbuf[r] = 0; + printf("client:got %s\n", xbuf); + delete vio; + delete ssl_connector; + return 0; +} diff --git a/externals/mysql/vio/viotest.cc b/externals/mysql/vio/viotest.cc new file mode 100644 index 00000000000..490a9ca6694 --- /dev/null +++ b/externals/mysql/vio/viotest.cc @@ -0,0 +1,47 @@ +/* +** Virtual I/O library +** Written by Andrei Errapart +*/ + +#include "all.h" + +#include +#include +#include + +#include + +VIO_NS_USING; + +int +main( int argc, + char** argv) +{ + VioFd* fs = 0; + VioSocket* ss = 0; + int fd = -1; + char* hh = "hshshsh\n"; + + DBUG_ENTER("main"); + DBUG_PROCESS(argv[0]); + DBUG_PUSH("d:t"); + + fd = open("/dev/tty", O_WRONLY); + if (fd<0) + { + perror("open"); + return 1; + } + fs = new VioFd(fd); + ss = new VioSocket(fd); + if (fs->write(hh,strlen(hh)) < 0) + perror("write"); + ss->write(hh,strlen(hh)); + printf("peer_name:%s\n", ss->peer_name()); + printf("cipher_description:%s\n", ss->cipher_description()); + delete fs; + delete ss; + + DBUG_RETURN(0); +} + diff --git a/externals/mysql/violite.h b/externals/mysql/violite.h new file mode 100644 index 00000000000..2720047b312 --- /dev/null +++ b/externals/mysql/violite.h @@ -0,0 +1,222 @@ +/* Copyright (C) 2000 MySQL AB + + 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + * Vio Lite. + * Purpose: include file for Vio that will work with C and C++ + */ + +#ifndef vio_violite_h_ +#define vio_violite_h_ + +#include "my_net.h" /* needed because of struct in_addr */ + + +/* Simple vio interface in C; The functions are implemented in violite.c */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +enum enum_vio_type +{ + VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE, + VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY +}; + + +#define VIO_LOCALHOST 1 /* a localhost connection */ +#define VIO_BUFFERED_READ 2 /* use buffered read */ +#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */ + +Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags); +#ifdef __WIN__ +Vio* vio_new_win32pipe(HANDLE hPipe); +Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, + HANDLE handle_map, + HANDLE event_server_wrote, + HANDLE event_server_read, + HANDLE event_client_wrote, + HANDLE event_client_read, + HANDLE event_conn_closed); +size_t vio_read_pipe(Vio *vio, uchar * buf, size_t size); +size_t vio_write_pipe(Vio *vio, const uchar * buf, size_t size); +int vio_close_pipe(Vio * vio); +#else +#define HANDLE void * +#endif /* __WIN__ */ + +void vio_delete(Vio* vio); +int vio_close(Vio* vio); +void vio_reset(Vio* vio, enum enum_vio_type type, + my_socket sd, HANDLE hPipe, uint flags); +size_t vio_read(Vio *vio, uchar * buf, size_t size); +size_t vio_read_buff(Vio *vio, uchar * buf, size_t size); +size_t vio_write(Vio *vio, const uchar * buf, size_t size); +int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); +my_bool vio_is_blocking(Vio *vio); +/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */ +int vio_fastsend(Vio *vio); +/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */ +int vio_keepalive(Vio *vio, my_bool onoff); +/* Whenever we should retry the last read/write operation. */ +my_bool vio_should_retry(Vio *vio); +/* Check that operation was timed out */ +my_bool vio_was_interrupted(Vio *vio); +/* Short text description of the socket for those, who are curious.. */ +const char* vio_description(Vio *vio); +/* Return the type of the connection */ +enum enum_vio_type vio_type(Vio* vio); +/* Return last error number */ +int vio_errno(Vio*vio); +/* Get socket number */ +my_socket vio_fd(Vio*vio); +/* Remote peer's address and name in text form */ +my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen); +my_bool vio_poll_read(Vio *vio,uint timeout); +my_bool vio_peek_read(Vio *vio, uint *bytes); +ssize_t vio_pending(Vio *vio); + +#ifdef HAVE_OPENSSL +#include +#if OPENSSL_VERSION_NUMBER < 0x0090700f +#define DES_cblock des_cblock +#define DES_key_schedule des_key_schedule +#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) +#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) +#endif + +#define HEADER_DES_LOCL_H dummy_something +#define YASSL_MYSQL_COMPATIBLE +#ifndef YASSL_PREFIX +#define YASSL_PREFIX +#endif +/* Set yaSSL to use same type as MySQL do for socket handles */ +typedef my_socket YASSL_SOCKET_T; +#define YASSL_SOCKET_T_DEFINED +#include +#include + +#ifndef EMBEDDED_LIBRARY + +struct st_VioSSLFd +{ + SSL_CTX *ssl_context; +}; + +int sslaccept(struct st_VioSSLFd*, Vio *, long timeout); +int sslconnect(struct st_VioSSLFd*, Vio *, long timeout); + +struct st_VioSSLFd +*new_VioSSLConnectorFd(const char *key_file, const char *cert_file, + const char *ca_file, const char *ca_path, + const char *cipher); +struct st_VioSSLFd +*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, + const char *ca_file,const char *ca_path, + const char *cipher); +void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd); +#endif /* ! EMBEDDED_LIBRARY */ +#endif /* HAVE_OPENSSL */ + +#ifdef HAVE_SMEM +size_t vio_read_shared_memory(Vio *vio, uchar * buf, size_t size); +size_t vio_write_shared_memory(Vio *vio, const uchar * buf, size_t size); +int vio_close_shared_memory(Vio * vio); +#endif + +void vio_end(void); + +#ifdef __cplusplus +} +#endif + +#if !defined(DONT_MAP_VIO) +#define vio_delete(vio) (vio)->viodelete(vio) +#define vio_errno(vio) (vio)->vioerrno(vio) +#define vio_read(vio, buf, size) ((vio)->read)(vio,buf,size) +#define vio_write(vio, buf, size) ((vio)->write)(vio, buf, size) +#define vio_blocking(vio, set_blocking_mode, old_mode)\ + (vio)->vioblocking(vio, set_blocking_mode, old_mode) +#define vio_is_blocking(vio) (vio)->is_blocking(vio) +#define vio_fastsend(vio) (vio)->fastsend(vio) +#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive) +#define vio_should_retry(vio) (vio)->should_retry(vio) +#define vio_was_interrupted(vio) (vio)->was_interrupted(vio) +#define vio_close(vio) ((vio)->vioclose)(vio) +#define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen) +#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds) +#endif /* !defined(DONT_MAP_VIO) */ + +/* This enumerator is used in parser - should be always visible */ +enum SSL_type +{ + SSL_TYPE_NOT_SPECIFIED= -1, + SSL_TYPE_NONE, + SSL_TYPE_ANY, + SSL_TYPE_X509, + SSL_TYPE_SPECIFIED +}; + + +/* HFTODO - hide this if we don't want client in embedded server */ +/* This structure is for every connection on both sides */ +struct st_vio +{ + my_socket sd; /* my_socket - real or imaginary */ + HANDLE hPipe; + my_bool localhost; /* Are we from localhost? */ + int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ + struct sockaddr_storage local; /* Local internet address */ + struct sockaddr_storage remote; /* Remote internet address */ + int addrLen; /* Length of remote address */ + enum enum_vio_type type; /* Type of connection */ + char desc[30]; /* String description */ + char *read_buffer; /* buffer for vio_read_buff */ + char *read_pos; /* start of unfetched data in the + read buffer */ + char *read_end; /* end of unfetched data */ + /* function pointers. They are similar for socket/SSL/whatever */ + void (*viodelete)(Vio*); + int (*vioerrno)(Vio*); + size_t (*read)(Vio*, uchar *, size_t); + size_t (*write)(Vio*, const uchar *, size_t); + int (*vioblocking)(Vio*, my_bool, my_bool *); + my_bool (*is_blocking)(Vio*); + int (*viokeepalive)(Vio*, my_bool); + int (*fastsend)(Vio*); + my_bool (*peer_addr)(Vio*, char *, uint16*, size_t); + void (*in_addr)(Vio*, struct sockaddr_storage*); + my_bool (*should_retry)(Vio*); + my_bool (*was_interrupted)(Vio*); + int (*vioclose)(Vio*); + void (*timeout)(Vio*, unsigned int which, unsigned int timeout); +#ifdef HAVE_OPENSSL + void *ssl_arg; +#endif +#ifdef HAVE_SMEM + HANDLE handle_file_map; + char *handle_map; + HANDLE event_server_wrote; + HANDLE event_server_read; + HANDLE event_client_wrote; + HANDLE event_client_read; + HANDLE event_conn_closed; + size_t shared_memory_remain; + char *shared_memory_pos; + NET *net; +#endif /* HAVE_SMEM */ +}; +#endif /* vio_violite_h_ */ diff --git a/externals/mysql/waiting_threads.h b/externals/mysql/waiting_threads.h new file mode 100644 index 00000000000..1e580529938 --- /dev/null +++ b/externals/mysql/waiting_threads.h @@ -0,0 +1,130 @@ +/* Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, 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 + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _waiting_threads_h +#define _waiting_threads_h + +#include +#include + +#include + +C_MODE_START + +typedef struct st_wt_resource_id WT_RESOURCE_ID; +typedef struct st_wt_resource WT_RESOURCE; + +typedef struct st_wt_resource_type { + my_bool (*compare)(const void *a, const void *b); + const void *(*make_key)(const WT_RESOURCE_ID *id, uint *len); /* not used */ +} WT_RESOURCE_TYPE; + +struct st_wt_resource_id { + ulonglong value; + const WT_RESOURCE_TYPE *type; +}; +/* the below differs from sizeof(WT_RESOURCE_ID) by the amount of padding */ +#define sizeof_WT_RESOURCE_ID (sizeof(ulonglong)+sizeof(void*)) + +#define WT_WAIT_STATS 24 +#define WT_CYCLE_STATS 32 +extern ulonglong wt_wait_table[WT_WAIT_STATS]; +extern uint32 wt_wait_stats[WT_WAIT_STATS+1]; +extern uint32 wt_cycle_stats[2][WT_CYCLE_STATS+1]; +extern uint32 wt_success_stats; + +typedef struct st_wt_thd { + /* + XXX + there's no protection (mutex) against concurrent access of the + dynarray below. it is assumed that a caller will have it anyway + (not to protect this array but to protect its own - caller's - + data structures), and we'll get it for free. A caller needs to + ensure that a blocker won't release a resource before a blocked + thread starts waiting, which is usually done with a mutex. + + If the above assumption is wrong, we'll need to add a mutex here. + */ + DYNAMIC_ARRAY my_resources; + /* + 'waiting_for' is modified under waiting_for->lock, and only by thd itself + 'waiting_for' is read lock-free (using pinning protocol), but a thd object + can read its own 'waiting_for' without any locks or tricks. + */ + WT_RESOURCE *waiting_for; + LF_PINS *pins; + + /* pointers to values */ + const ulong *timeout_short; + const ulong *deadlock_search_depth_short; + const ulong *timeout_long; + const ulong *deadlock_search_depth_long; + + /* + weight relates to the desirability of a transaction being killed if it's + part of a deadlock. In a deadlock situation transactions with lower weights + are killed first. + + Examples of using the weight to implement different selection strategies: + + 1. Latest + Keep all weights equal. + 2. Random + Assight weights at random. + (variant: modify a weight randomly before every lock request) + 3. Youngest + Set weight to -NOW() + 4. Minimum locks + count locks granted in your lock manager, store the value as a weight + 5. Minimum work + depends on the definition of "work". For example, store the number + of rows modifies in this transaction (or a length of REDO log for a + transaction) as a weight. + + It is only statistically relevant and is not protected by any locks. + */ + ulong volatile weight; + /* + 'killed' is indirectly protected by waiting_for->lock because + a killed thread needs to clear its 'waiting_for' and thus needs a lock. + That is a thread needs an exclusive lock to read 'killed' reliably. + But other threads may change 'killed' from 0 to 1, a shared + lock is enough for that. + */ + my_bool killed; +#ifndef DBUG_OFF + const char *name; +#endif +} WT_THD; + +#define WT_TIMEOUT ETIMEDOUT +#define WT_OK 0 +#define WT_DEADLOCK -1 +#define WT_DEPTH_EXCEEDED -2 +#define WT_FREE_TO_GO -3 + +void wt_init(void); +void wt_end(void); +void wt_thd_lazy_init(WT_THD *, const ulong *, const ulong *, const ulong *, const ulong *); +void wt_thd_destroy(WT_THD *); +int wt_thd_will_wait_for(WT_THD *, WT_THD *, const WT_RESOURCE_ID *); +int wt_thd_cond_timedwait(WT_THD *, pthread_mutex_t *); +void wt_thd_release(WT_THD *, const WT_RESOURCE_ID *); +#define wt_thd_release_all(THD) wt_thd_release((THD), 0) +my_bool wt_resource_id_memcmp(const void *, const void *); + +C_MODE_END + +#endif diff --git a/externals/mysql/win/VC90/libmysql.vcproj b/externals/mysql/win/VC90/libmysql.vcproj new file mode 100644 index 00000000000..4534e1ab1af --- /dev/null +++ b/externals/mysql/win/VC90/libmysql.vcproj @@ -0,0 +1,11143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/externals/mysql/win/delme b/externals/mysql/win/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/externals/mysql/win/libmysql.sln b/externals/mysql/win/libmysql.sln new file mode 100644 index 00000000000..7d0f29bd243 --- /dev/null +++ b/externals/mysql/win/libmysql.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysql", "VC90\libmysql.vcproj", "{4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|Win32.ActiveCfg = Debug|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|Win32.Build.0 = Debug|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|x64.ActiveCfg = Debug|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|x64.Build.0 = Debug|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|Win32.ActiveCfg = Release|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|Win32.Build.0 = Release|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|x64.ActiveCfg = Release|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/externals/mysql/wqueue.h b/externals/mysql/wqueue.h new file mode 100644 index 00000000000..658f3d66f12 --- /dev/null +++ b/externals/mysql/wqueue.h @@ -0,0 +1,27 @@ + +#ifndef _wqueue_h +#define _wqueue_h + +#include +#include + +/* info about requests in a waiting queue */ +typedef struct st_pagecache_wqueue +{ + struct st_my_thread_var *last_thread; /* circular list of waiting + threads */ +} WQUEUE; + +#ifdef THREAD +void wqueue_link_into_queue(WQUEUE *wqueue, struct st_my_thread_var *thread); +void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread); +void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread); +void wqueue_add_and_wait(WQUEUE *wqueue, + struct st_my_thread_var *thread, + pthread_mutex_t *lock); +void wqueue_release_queue(WQUEUE *wqueue); +void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue); + +#endif + +#endif diff --git a/dep/include/openssl/aes.h b/externals/openssl/aes.h similarity index 100% rename from dep/include/openssl/aes.h rename to externals/openssl/aes.h diff --git a/dep/include/openssl/asn1.h b/externals/openssl/asn1.h similarity index 100% rename from dep/include/openssl/asn1.h rename to externals/openssl/asn1.h diff --git a/dep/include/openssl/asn1_mac.h b/externals/openssl/asn1_mac.h similarity index 100% rename from dep/include/openssl/asn1_mac.h rename to externals/openssl/asn1_mac.h diff --git a/dep/include/openssl/asn1t.h b/externals/openssl/asn1t.h similarity index 100% rename from dep/include/openssl/asn1t.h rename to externals/openssl/asn1t.h diff --git a/dep/include/openssl/bio.h b/externals/openssl/bio.h similarity index 100% rename from dep/include/openssl/bio.h rename to externals/openssl/bio.h diff --git a/dep/include/openssl/blowfish.h b/externals/openssl/blowfish.h similarity index 100% rename from dep/include/openssl/blowfish.h rename to externals/openssl/blowfish.h diff --git a/dep/include/openssl/bn.h b/externals/openssl/bn.h similarity index 100% rename from dep/include/openssl/bn.h rename to externals/openssl/bn.h diff --git a/dep/include/openssl/buffer.h b/externals/openssl/buffer.h similarity index 100% rename from dep/include/openssl/buffer.h rename to externals/openssl/buffer.h diff --git a/dep/include/openssl/cast.h b/externals/openssl/cast.h similarity index 100% rename from dep/include/openssl/cast.h rename to externals/openssl/cast.h diff --git a/dep/include/openssl/comp.h b/externals/openssl/comp.h similarity index 100% rename from dep/include/openssl/comp.h rename to externals/openssl/comp.h diff --git a/dep/include/openssl/conf.h b/externals/openssl/conf.h similarity index 100% rename from dep/include/openssl/conf.h rename to externals/openssl/conf.h diff --git a/dep/include/openssl/conf_api.h b/externals/openssl/conf_api.h similarity index 100% rename from dep/include/openssl/conf_api.h rename to externals/openssl/conf_api.h diff --git a/dep/include/openssl/crypto.h b/externals/openssl/crypto.h similarity index 100% rename from dep/include/openssl/crypto.h rename to externals/openssl/crypto.h diff --git a/externals/openssl/delme b/externals/openssl/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/dep/include/openssl/des.h b/externals/openssl/des.h similarity index 100% rename from dep/include/openssl/des.h rename to externals/openssl/des.h diff --git a/dep/include/openssl/des_old.h b/externals/openssl/des_old.h similarity index 100% rename from dep/include/openssl/des_old.h rename to externals/openssl/des_old.h diff --git a/dep/include/openssl/dh.h b/externals/openssl/dh.h similarity index 100% rename from dep/include/openssl/dh.h rename to externals/openssl/dh.h diff --git a/dep/include/openssl/dsa.h b/externals/openssl/dsa.h similarity index 100% rename from dep/include/openssl/dsa.h rename to externals/openssl/dsa.h diff --git a/dep/include/openssl/dso.h b/externals/openssl/dso.h similarity index 100% rename from dep/include/openssl/dso.h rename to externals/openssl/dso.h diff --git a/dep/include/openssl/dtls1.h b/externals/openssl/dtls1.h similarity index 100% rename from dep/include/openssl/dtls1.h rename to externals/openssl/dtls1.h diff --git a/dep/include/openssl/e_os2.h b/externals/openssl/e_os2.h similarity index 100% rename from dep/include/openssl/e_os2.h rename to externals/openssl/e_os2.h diff --git a/dep/include/openssl/ebcdic.h b/externals/openssl/ebcdic.h similarity index 100% rename from dep/include/openssl/ebcdic.h rename to externals/openssl/ebcdic.h diff --git a/dep/include/openssl/ec.h b/externals/openssl/ec.h similarity index 100% rename from dep/include/openssl/ec.h rename to externals/openssl/ec.h diff --git a/dep/include/openssl/ecdh.h b/externals/openssl/ecdh.h similarity index 100% rename from dep/include/openssl/ecdh.h rename to externals/openssl/ecdh.h diff --git a/dep/include/openssl/ecdsa.h b/externals/openssl/ecdsa.h similarity index 100% rename from dep/include/openssl/ecdsa.h rename to externals/openssl/ecdsa.h diff --git a/dep/include/openssl/engine.h b/externals/openssl/engine.h similarity index 100% rename from dep/include/openssl/engine.h rename to externals/openssl/engine.h diff --git a/dep/include/openssl/err.h b/externals/openssl/err.h similarity index 100% rename from dep/include/openssl/err.h rename to externals/openssl/err.h diff --git a/dep/include/openssl/evp.h b/externals/openssl/evp.h similarity index 100% rename from dep/include/openssl/evp.h rename to externals/openssl/evp.h diff --git a/dep/include/openssl/hmac.h b/externals/openssl/hmac.h similarity index 100% rename from dep/include/openssl/hmac.h rename to externals/openssl/hmac.h diff --git a/dep/include/openssl/idea.h b/externals/openssl/idea.h similarity index 100% rename from dep/include/openssl/idea.h rename to externals/openssl/idea.h diff --git a/dep/include/openssl/krb5_asn.h b/externals/openssl/krb5_asn.h similarity index 100% rename from dep/include/openssl/krb5_asn.h rename to externals/openssl/krb5_asn.h diff --git a/dep/include/openssl/kssl.h b/externals/openssl/kssl.h similarity index 100% rename from dep/include/openssl/kssl.h rename to externals/openssl/kssl.h diff --git a/dep/include/openssl/lhash.h b/externals/openssl/lhash.h similarity index 100% rename from dep/include/openssl/lhash.h rename to externals/openssl/lhash.h diff --git a/dep/include/openssl/md2.h b/externals/openssl/md2.h similarity index 100% rename from dep/include/openssl/md2.h rename to externals/openssl/md2.h diff --git a/dep/include/openssl/md4.h b/externals/openssl/md4.h similarity index 100% rename from dep/include/openssl/md4.h rename to externals/openssl/md4.h diff --git a/dep/include/openssl/md5.h b/externals/openssl/md5.h similarity index 100% rename from dep/include/openssl/md5.h rename to externals/openssl/md5.h diff --git a/dep/include/openssl/obj_mac.h b/externals/openssl/obj_mac.h similarity index 100% rename from dep/include/openssl/obj_mac.h rename to externals/openssl/obj_mac.h diff --git a/dep/include/openssl/objects.h b/externals/openssl/objects.h similarity index 100% rename from dep/include/openssl/objects.h rename to externals/openssl/objects.h diff --git a/dep/include/openssl/ocsp.h b/externals/openssl/ocsp.h similarity index 100% rename from dep/include/openssl/ocsp.h rename to externals/openssl/ocsp.h diff --git a/dep/include/openssl/opensslconf.h b/externals/openssl/opensslconf.h similarity index 100% rename from dep/include/openssl/opensslconf.h rename to externals/openssl/opensslconf.h diff --git a/dep/include/openssl/opensslv.h b/externals/openssl/opensslv.h similarity index 100% rename from dep/include/openssl/opensslv.h rename to externals/openssl/opensslv.h diff --git a/dep/include/openssl/ossl_typ.h b/externals/openssl/ossl_typ.h similarity index 100% rename from dep/include/openssl/ossl_typ.h rename to externals/openssl/ossl_typ.h diff --git a/dep/include/openssl/pem.h b/externals/openssl/pem.h similarity index 100% rename from dep/include/openssl/pem.h rename to externals/openssl/pem.h diff --git a/dep/include/openssl/pem2.h b/externals/openssl/pem2.h similarity index 100% rename from dep/include/openssl/pem2.h rename to externals/openssl/pem2.h diff --git a/dep/include/openssl/pkcs12.h b/externals/openssl/pkcs12.h similarity index 100% rename from dep/include/openssl/pkcs12.h rename to externals/openssl/pkcs12.h diff --git a/dep/include/openssl/pkcs7.h b/externals/openssl/pkcs7.h similarity index 100% rename from dep/include/openssl/pkcs7.h rename to externals/openssl/pkcs7.h diff --git a/dep/include/openssl/pq_compat.h b/externals/openssl/pq_compat.h similarity index 100% rename from dep/include/openssl/pq_compat.h rename to externals/openssl/pq_compat.h diff --git a/dep/include/openssl/pqueue.h b/externals/openssl/pqueue.h similarity index 100% rename from dep/include/openssl/pqueue.h rename to externals/openssl/pqueue.h diff --git a/dep/include/openssl/rand.h b/externals/openssl/rand.h similarity index 100% rename from dep/include/openssl/rand.h rename to externals/openssl/rand.h diff --git a/dep/include/openssl/rc2.h b/externals/openssl/rc2.h similarity index 100% rename from dep/include/openssl/rc2.h rename to externals/openssl/rc2.h diff --git a/dep/include/openssl/rc4.h b/externals/openssl/rc4.h similarity index 100% rename from dep/include/openssl/rc4.h rename to externals/openssl/rc4.h diff --git a/dep/include/openssl/ripemd.h b/externals/openssl/ripemd.h similarity index 100% rename from dep/include/openssl/ripemd.h rename to externals/openssl/ripemd.h diff --git a/dep/include/openssl/rsa.h b/externals/openssl/rsa.h similarity index 100% rename from dep/include/openssl/rsa.h rename to externals/openssl/rsa.h diff --git a/dep/include/openssl/safestack.h b/externals/openssl/safestack.h similarity index 100% rename from dep/include/openssl/safestack.h rename to externals/openssl/safestack.h diff --git a/dep/include/openssl/sha.h b/externals/openssl/sha.h similarity index 100% rename from dep/include/openssl/sha.h rename to externals/openssl/sha.h diff --git a/dep/include/openssl/ssl.h b/externals/openssl/ssl.h similarity index 100% rename from dep/include/openssl/ssl.h rename to externals/openssl/ssl.h diff --git a/dep/include/openssl/ssl2.h b/externals/openssl/ssl2.h similarity index 100% rename from dep/include/openssl/ssl2.h rename to externals/openssl/ssl2.h diff --git a/dep/include/openssl/ssl23.h b/externals/openssl/ssl23.h similarity index 100% rename from dep/include/openssl/ssl23.h rename to externals/openssl/ssl23.h diff --git a/dep/include/openssl/ssl3.h b/externals/openssl/ssl3.h similarity index 100% rename from dep/include/openssl/ssl3.h rename to externals/openssl/ssl3.h diff --git a/dep/include/openssl/stack.h b/externals/openssl/stack.h similarity index 100% rename from dep/include/openssl/stack.h rename to externals/openssl/stack.h diff --git a/dep/include/openssl/store.h b/externals/openssl/store.h similarity index 100% rename from dep/include/openssl/store.h rename to externals/openssl/store.h diff --git a/dep/include/openssl/symhacks.h b/externals/openssl/symhacks.h similarity index 100% rename from dep/include/openssl/symhacks.h rename to externals/openssl/symhacks.h diff --git a/dep/include/openssl/tls1.h b/externals/openssl/tls1.h similarity index 100% rename from dep/include/openssl/tls1.h rename to externals/openssl/tls1.h diff --git a/dep/include/openssl/tmdiff.h b/externals/openssl/tmdiff.h similarity index 100% rename from dep/include/openssl/tmdiff.h rename to externals/openssl/tmdiff.h diff --git a/dep/include/openssl/txt_db.h b/externals/openssl/txt_db.h similarity index 100% rename from dep/include/openssl/txt_db.h rename to externals/openssl/txt_db.h diff --git a/dep/include/openssl/ui.h b/externals/openssl/ui.h similarity index 100% rename from dep/include/openssl/ui.h rename to externals/openssl/ui.h diff --git a/dep/include/openssl/ui_compat.h b/externals/openssl/ui_compat.h similarity index 100% rename from dep/include/openssl/ui_compat.h rename to externals/openssl/ui_compat.h diff --git a/externals/openssl/win/delme b/externals/openssl/win/delme deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/dep/include/openssl/x509.h b/externals/openssl/x509.h similarity index 100% rename from dep/include/openssl/x509.h rename to externals/openssl/x509.h diff --git a/dep/include/openssl/x509_vfy.h b/externals/openssl/x509_vfy.h similarity index 100% rename from dep/include/openssl/x509_vfy.h rename to externals/openssl/x509_vfy.h diff --git a/dep/include/openssl/x509v3.h b/externals/openssl/x509v3.h similarity index 100% rename from dep/include/openssl/x509v3.h rename to externals/openssl/x509v3.h diff --git a/externals/sockets/CMakeLists.txt b/externals/sockets/CMakeLists.txt index a47c8dee75f..a1756773c08 100644 --- a/externals/sockets/CMakeLists.txt +++ b/externals/sockets/CMakeLists.txt @@ -1,26 +1,21 @@ -SET(trinitysockets_STAT_SRCS - Base64.cpp - Exception.cpp - Ipv4Address.cpp - Ipv6Address.cpp - Lock.cpp - Mutex.cpp - Parse.cpp - ResolvServer.cpp - ResolvSocket.cpp - Socket.cpp - SocketHandler.cpp - StdoutLog.cpp - StreamSocket.cpp - TcpSocket.cpp - Thread.cpp - UdpSocket.cpp - Utility.cpp - socket_include.cpp +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +file(GLOB sources *.cpp) + +set(trinitysockets_STAT_SRCS + ${sources} ) include_directories( - ${CMAKE_SOURCE_DIR}/dep/include/sockets + ${CMAKE_CURRENT_SOURCE_DIR}/include ) add_library(trinitysockets STATIC ${trinitysockets_STAT_SRCS}) diff --git a/externals/sockets/Makefile b/externals/sockets/Makefile new file mode 100644 index 00000000000..80faf67aed9 --- /dev/null +++ b/externals/sockets/Makefile @@ -0,0 +1,136 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.6 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canoncical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/ccmake + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/trinity/dev/trinitycore/externals/sockets + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/trinity/dev/trinitycore/externals/sockets + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/trinity/dev/trinitycore/externals/sockets/CMakeFiles /home/trinity/dev/trinitycore/externals/sockets/CMakeFiles/progress.make + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/trinity/dev/trinitycore/externals/sockets/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named trinitysockets + +# Build rule for target. +trinitysockets: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 trinitysockets +.PHONY : trinitysockets + +# fast build rule for target. +trinitysockets/fast: + $(MAKE) -f CMakeFiles/trinitysockets.dir/build.make CMakeFiles/trinitysockets.dir/build +.PHONY : trinitysockets/fast + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... trinitysockets" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/win/VC90/zlib.vcproj b/externals/sockets/win/VC90/sockets.vcproj similarity index 56% rename from win/VC90/zlib.vcproj rename to externals/sockets/win/VC90/sockets.vcproj index 290c4375e2d..3660ebeee93 100644 --- a/win/VC90/zlib.vcproj +++ b/externals/sockets/win/VC90/sockets.vcproj @@ -2,9 +2,9 @@ @@ -21,8 +21,8 @@ @@ -44,15 +44,16 @@ @@ -113,15 +115,16 @@ @@ -181,13 +185,15 @@ @@ -248,13 +255,15 @@ + + + + + + + + + + @@ -357,43 +387,107 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/externals/sockets/win/sockets.sln b/externals/sockets/win/sockets.sln new file mode 100644 index 00000000000..3ae708ebc8d --- /dev/null +++ b/externals/sockets/win/sockets.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "VC90\sockets.vcproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.ActiveCfg = Debug|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.Build.0 = Debug|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.ActiveCfg = Release|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/externals/utf8cpp/include/doc/ReleaseNotes b/externals/utf8cpp/include/doc/ReleaseNotes deleted file mode 100644 index 8541c7a6031..00000000000 --- a/externals/utf8cpp/include/doc/ReleaseNotes +++ /dev/null @@ -1,9 +0,0 @@ -utf8 cpp library -Release 2.1 - -This is a minor feature release - added the function peek_next. - -Changes from version 2.o -- Implemented feature request [ 1770746 ] "Provide a const version of next() (some sort of a peek() ) - -Files included in the release: utf8.h, core.h, checked.h, unchecked.h, utf8cpp.html, ReleaseNotes diff --git a/externals/utf8cpp/include/doc/utf8cpp.html b/externals/utf8cpp/include/doc/utf8cpp.html deleted file mode 100644 index 4ad7e1002a9..00000000000 --- a/externals/utf8cpp/include/doc/utf8cpp.html +++ /dev/null @@ -1,1574 +0,0 @@ - - - - - - - - - UTF8-CPP: UTF-8 with C++ in a Portable Way - - - - -

- UTF8-CPP: UTF-8 with C++ in a Portable Way -

-

- The Sourceforge project page -

- -

- Introduction -

-

- Many C++ developers miss an easy and portable way of handling Unicode encoded - strings. C++ Standard is currently Unicode agnostic, and while some work is being - done to introduce Unicode to the next incarnation called C++0x, for the moment - nothing of the sort is available. In the meantime, developers use 3rd party - libraries like ICU, OS specific capabilities, or simply roll out their own - solutions. -

-

- In order to easily handle UTF-8 encoded Unicode strings, I have come up with a small - generic library. For anybody used to work with STL algorithms and iterators, it should be - easy and natural to use. The code is freely available for any purpose - check out - the license at the beginning of the utf8.h file. If you run into - bugs or performance issues, please let me know and I'll do my best to address them. -

-

- The purpose of this article is not to offer an introduction to Unicode in general, - and UTF-8 in particular. If you are not familiar with Unicode, be sure to check out - Unicode Home Page or some other source of - information for Unicode. Also, it is not my aim to advocate the use of UTF-8 - encoded strings in C++ programs; if you want to handle UTF-8 encoded strings from - C++, I am sure you have good reasons for it. -

-

- Examples of use -

-

- To illustrate the use of this utf8 library, we shall open a file containing UTF-8 - encoded text, check whether it starts with a byte order mark, read each line into a - std::string, check it for validity, convert the text to UTF-16, and - back to UTF-8: -

-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-#include "utf8.h"
-using namespace std;
-int main()
-{
-    if (argc != 2) {
-        cout << "\nUsage: docsample filename\n";
-        return 0;
-    }
-    const char* test_file_path = argv[1];
-    // Open the test file (must be UTF-8 encoded)
-    ifstream fs8(test_file_path);
-    if (!fs8.is_open()) {
-    cout << "Could not open " << test_file_path << endl;
-    return 0;
-    }
-    // Read the first line of the file
-    unsigned line_count = 1;
-    string line;
-    if (!getline(fs8, line)) 
-        return 0;
-    // Look for utf-8 byte-order mark at the beginning
-    if (line.size() > 2) {
-        if (utf8::is_bom(line.c_str()))
-            cout << "There is a byte order mark at the beginning of the file\n";
-    }
-    // Play with all the lines in the file
-    do {
-       // check for invalid utf-8 (for a simple yes/no check, there is also utf8::is_valid function)
-        string::iterator end_it = utf8::find_invalid(line.begin(), line.end());
-        if (end_it != line.end()) {
-            cout << "Invalid UTF-8 encoding detected at line " << line_count << "\n";
-            cout << "This part is fine: " << string(line.begin(), end_it) << "\n";
-        }
-        // Get the line length (at least for the valid part)
-        int length = utf8::distance(line.begin(), end_it);
-        cout << "Length of line " << line_count << " is " << length <<  "\n";
-        // Convert it to utf-16
-        vector<unsigned short> utf16line;
-        utf8::utf8to16(line.begin(), end_it, back_inserter(utf16line));
-        // And back to utf-8
-        string utf8line; 
-        utf8::utf16to8(utf16line.begin(), utf16line.end(), back_inserter(utf8line));
-        // Confirm that the conversion went OK:
-        if (utf8line != string(line.begin(), end_it))
-            cout << "Error in UTF-16 conversion at line: " << line_count << "\n";        
-        getline(fs8, line);
-        line_count++;
-    } while (!fs8.eof());
-    return 0;
-}
-
-

- In the previous code sample, we have seen the use of the following functions from - utf8 namespace: first we used is_bom function to detect - UTF-8 byte order mark at the beginning of the file; then for each line we performed - a detection of invalid UTF-8 sequences with find_invalid; the number - of characters (more precisely - the number of Unicode code points) in each line was - determined with a use of utf8::distance; finally, we have converted - each line to UTF-16 encoding with utf8to16 and back to UTF-8 with - utf16to8. -

-

- Reference -

-

- Functions From utf8 Namespace -

-

- utf8::append -

-

- Available in version 1.0 and later. -

-

- Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence - to a UTF-8 string. -

-
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-   
-
-

- cp: A 32 bit integer representing a code point to append to the - sequence.
- result: An output iterator to the place in the sequence where to - append the code point.
- Return value: An iterator pointing to the place - after the newly appended sequence. -

-

- Example of use: -

-
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-
-

- Note that append does not allocate any memory - it is the burden of - the caller to make sure there is enough memory allocated for the operation. To make - things more interesting, append can add anywhere between 1 and 4 - octets to the sequence. In practice, you would most often want to use - std::back_inserter to ensure that the necessary memory is allocated. -

-

- In case of an invalid code point, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::next -

-

- Available in version 1.0 and later. -

-

- Given the iterator to the beginning of the UTF-8 sequence, it returns the code - point and moves the iterator to the next position. -

-
-template <typename octet_iterator> 
-uint32_t next(octet_iterator& it, octet_iterator end);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - beginning of the next code point.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-
-

- This function is typically used to iterate through a UTF-8 encoded string. -

-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. -

-

- utf8::peek_next -

-

- Available in version 2.1 and later. -

-

- Given the iterator to the beginning of the UTF-8 sequence, it returns the code - point for the following sequence without changing the value of the iterator. -

-
-template <typename octet_iterator> 
-uint32_t peek_next(octet_iterator it, octet_iterator end);
-   
-
-

- it: an iterator pointing to the beginning of an UTF-8 - encoded code point.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = peek_next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. -

-

- utf8::prior -

-

- Available in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator> 
-uint32_t prior(octet_iterator& it, octet_iterator start);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- start: an iterator to the beginning of the sequence where the search - for the beginning of a code point is performed. It is a - safety measure to prevent passing the beginning of the string in the search for a - UTF-8 lead octet.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = prior (w, twochars);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This function has two purposes: one is two iterate backwards through a UTF-8 - encoded string. Note that it is usually a better idea to iterate forward instead, - since utf8::next is faster. The second purpose is to find a beginning - of a UTF-8 sequence if we have a random position within a string. -

-

- it will typically point to the beginning of - a code point, and start will point to the - beginning of the string to ensure we don't go backwards too far. it is - decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence - beginning with that octet is decoded to a 32 bit representation and returned. -

-

- In case pass_end is reached before a UTF-8 lead octet is hit, or if an - invalid UTF-8 sequence is started by the lead octet, an invalid_utf8 - exception is thrown. -

-

- utf8::previous -

-

- Deprecated in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator> 
-uint32_t previous(octet_iterator& it, octet_iterator pass_start);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- pass_start: an iterator to the point in the sequence where the search - for the beginning of a code point is aborted if no result was reached. It is a - safety measure to prevent passing the beginning of the string in the search for a - UTF-8 lead octet.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = previous (w, twochars - 1);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- utf8::previous is deprecated, and utf8::prior should - be used instead, although the existing code can continue using this function. - The problem is the parameter pass_start that points to the position - just before the beginning of the sequence. Standard containers don't have the - concept of "pass start" and the function can not be used with their iterators. -

-

- it will typically point to the beginning of - a code point, and pass_start will point to the octet just before the - beginning of the string to ensure we don't go backwards too far. it is - decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence - beginning with that octet is decoded to a 32 bit representation and returned. -

-

- In case pass_end is reached before a UTF-8 lead octet is hit, or if an - invalid UTF-8 sequence is started by the lead octet, an invalid_utf8 - exception is thrown -

-

- utf8::advance -

-

- Available in version 1.0 and later. -

-

- Advances an iterator by the specified number of code points within an UTF-8 - sequence. -

-
-template <typename octet_iterator, typename distance_type> 
-void advance (octet_iterator& it, distance_type n, octet_iterator end);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - nth following code point.
- n: a positive integer that shows how many code points we want to - advance.
- end: end of the UTF-8 sequence to be processed. If it - gets equal to end during the extraction of a code point, an - utf8::not_enough_room exception is thrown.
-

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars;
-advance (w, 2, twochars + 6);
-assert (w == twochars + 5);
-
-

- This function works only "forward". In case of a negative n, there is - no effect. -

-

- In case of an invalid code point, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::distance -

-

- Available in version 1.0 and later. -

-

- Given the iterators to two UTF-8 encoded code points in a seqence, returns the - number of code points between them. -

-
-template <typename octet_iterator> 
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-   
-
-

- first: an iterator to a beginning of a UTF-8 encoded code point.
- last: an iterator to a "post-end" of the last UTF-8 encoded code - point in the sequence we are trying to determine the length. It can be the - beginning of a new code point, or not.
- Return value the distance between the iterators, - in code points. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::distance(twochars, twochars + 5);
-assert (dist == 2);
-
-

- This function is used to find the length (in code points) of a UTF-8 encoded - string. The reason it is called distance, rather than, say, - length is mainly because developers are used that length is an - O(1) function. Computing the length of an UTF-8 string is a linear operation, and - it looked better to model it after std::distance algorithm. -

-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If last does not point to the past-of-end of a UTF-8 seqence, - a utf8::not_enough_room exception is thrown. -

-

- utf8::utf16to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-16 encoded string to UTF-8. -

-
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-16 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-16 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);    
-
-

- In case of invalid UTF-16 sequence, a utf8::invalid_utf16 exception is - thrown. -

-

- utf8::utf8to16 -

-

- Available in version 1.0 and later. -

-

- Converts an UTF-8 encoded string to UTF-16 -

-
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert. < br /> end: an iterator pointing to - pass-the-end of the UTF-8 encoded string to convert.
- result: an output iterator to the place in the UTF-16 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-16 string. -

-

- Example of use: -

-
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If end does not point to the past-of-end of a UTF-8 seqence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::utf32to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-32 encoded string to UTF-8. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-32 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-32 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-int utf32string[] = {0x448, 0x65E5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-
-

- In case of invalid UTF-32 string, a utf8::invalid_code_point exception - is thrown. -

-

- utf8::utf8to32 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-8 encoded string to UTF-32. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-8 encoded string - to convert.
- result: an output iterator to the place in the UTF-32 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-32 string. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-
-

- In case of an invalid UTF-8 seqence, a utf8::invalid_utf8 exception is - thrown. If end does not point to the past-of-end of a UTF-8 seqence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::find_invalid -

-

- Available in version 1.0 and later. -

-

- Detects an invalid sequence within a UTF-8 string. -

-
-template <typename octet_iterator> 
-octet_iterator find_invalid(octet_iterator start, octet_iterator end);
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - test for validity.
- end: an iterator pointing to pass-the-end of the UTF-8 string to test - for validity.
- Return value: an iterator pointing to the first - invalid octet in the UTF-8 string. In case none were found, equals - end. -

-

- Example of use: -

-
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-char* invalid = find_invalid(utf_invalid, utf_invalid + 6);
-assert (invalid == utf_invalid + 5);
-
-

- This function is typically used to make sure a UTF-8 string is valid before - processing it with other functions. It is especially important to call it if before - doing any of the unchecked operations on it. -

-

- utf8::is_valid -

-

- Available in version 1.0 and later. -

-

- Checks whether a sequence of octets is a valid UTF-8 string. -

-
-template <typename octet_iterator> 
-bool is_valid(octet_iterator start, octet_iterator end);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - test for validity.
- end: an iterator pointing to pass-the-end of the UTF-8 string to test - for validity.
- Return value: true if the sequence - is a valid UTF-8 string; false if not. -

- Example of use: -
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-bool bvalid = is_valid(utf_invalid, utf_invalid + 6);
-assert (bvalid == false);
-
-

- is_valid is a shorthand for find_invalid(start, end) == - end;. You may want to use it to make sure that a byte seqence is a valid - UTF-8 string without the need to know where it fails if it is not valid. -

-

- utf8::replace_invalid -

-

- Available in version 2.0 and later. -

-

- Replaces all invalid UTF-8 sequences within a string with a replacement marker. -

-
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement);
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 string to - look for invalid UTF-8 sequences.
- end: an iterator pointing to pass-the-end of the UTF-8 string to look - for invalid UTF-8 sequences.
- out: An output iterator to the range where the result of replacement - is stored.
- replacement: A Unicode code point for the replacement marker. The - version without this parameter assumes the value 0xfffd
- Return value: An iterator pointing to the place - after the UTF-8 string with replaced invalid sequences. -

-

- Example of use: -

-
-char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-vector<char> replace_invalid_result;
-replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), back_inserter(replace_invalid_result), '?');
-bvalid = is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
-assert (bvalid);
-char* fixed_invalid_sequence = "a????z";
-assert (std::equal(replace_invalid_result.begin(), replace_invalid_result.end(), fixed_invalid_sequence));
-
-

- replace_invalid does not perform in-place replacement of invalid - sequences. Rather, it produces a copy of the original string with the invalid - sequences replaced with a replacement marker. Therefore, out must not - be in the [start, end] range. -

-

- If end does not point to the past-of-end of a UTF-8 sequence, a - utf8::not_enough_room exception is thrown. -

-

- utf8::is_bom -

-

- Available in version 1.0 and later. -

-

- Checks whether a sequence of three octets is a UTF-8 byte order mark (BOM) -

-
-template <typename octet_iterator> 
-bool is_bom (octet_iterator it);
-
-

- it: beginning of the 3-octet sequence to check
- Return value: true if the sequence - is UTF-8 byte order mark; false if not. -

-

- Example of use: -

-
-unsigned char byte_order_mark[] = {0xef, 0xbb, 0xbf};
-bool bbom = is_bom(byte_order_mark);
-assert (bbom == true);
-
-

- The typical use of this function is to check the first three bytes of a file. If - they form the UTF-8 BOM, we want to skip them before processing the actual UTF-8 - encoded text. -

-

- Types From utf8 Namespace -

-

- utf8::iterator -

-

- Available in version 2.0 and later. -

-

- Adapts the underlying octet iterator to iterate over the sequence of code points, - rather than raw octets. -

-
-template <typename octet_iterator>
-class iterator;
-
- -
Member functions
-
-
iterator();
the deafult constructor; the underlying octet_iterator is - constructed with its default constructor. -
explicit iterator (const octet_iterator& octet_it, - const octet_iterator& range_start, - const octet_iterator& range_end);
a constructor - that initializes the underlying octet_iterator with octet_it - and sets the range in which the iterator is considered valid. -
octet_iterator base () const;
returns the - underlying octet_iterator. -
uint32_t operator * () const;
decodes the utf-8 sequence - the underlying octet_iterator is pointing to and returns the code point. -
bool operator == (const iterator& rhs) - const;
returns true - if the two underlaying iterators are equal. -
bool operator != (const iterator& rhs) - const;
returns true - if the two underlaying iterators are not equal. -
iterator& operator ++ ();
the prefix increment - moves - the iterator to the next UTF-8 encoded code point. -
iterator operator ++ (int);
- the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one. -
iterator& operator -- ();
the prefix decrement - moves - the iterator to the previous UTF-8 encoded code point. -
iterator operator -- (int);
- the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one. -
-

- Example of use: -

-
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::iterator<char*> it(threechars, threechars, threechars + 9);
-utf8::iterator<char*> it2 = it;
-assert (it2 == it);
-assert (*it == 0x10346);
-assert (*(++it) == 0x65e5);
-assert ((*it++) == 0x65e5);
-assert (*it == 0x0448);
-assert (it != it2);
-utf8::iterator<char*> endit (threechars + 9, threechars, threechars + 9);  
-assert (++it == endit);
-assert (*(--it) == 0x0448);
-assert ((*it--) == 0x0448);
-assert (*it == 0x65e5);
-assert (--it == utf8::iterator<char*>(threechars, threechars, threechars + 9));
-assert (*it == 0x10346);
-
-

- The purpose of utf8::iterator adapter is to enable easy iteration as well as the use of STL - algorithms with UTF-8 encoded strings. Increment and decrement operators are implemented in terms of - utf8::next() and utf8::prior() functions. -

-

- Note that utf8::iterator adapter is a checked iterator. It operates on the range specified in - the constructor; any attempt to go out of that range will result in an exception. Even the comparison operators - require both iterator object to be constructed against the same range - otherwise an exception is thrown. Typically, - the range will be determined by sequence container functions begin and end, i.e.: -

-
-std::string s = "example";
-utf8::iterator i (s.begin(), s.begin(), s.end());
-
-

- Functions From utf8::unchecked Namespace -

-

- utf8::unchecked::append -

-

- Available in version 1.0 and later. -

-

- Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence - to a UTF-8 string. -

-
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-   
-
-

- cp: A 32 bit integer representing a code point to append to the - sequence.
- result: An output iterator to the place in the sequence where to - append the code point.
- Return value: An iterator pointing to the place - after the newly appended sequence. -

-

- Example of use: -

-
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = unchecked::append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-
-

- This is a faster but less safe version of utf8::append. It does not - check for validity of the supplied code point, and may produce an invalid UTF-8 - sequence. -

-

- utf8::unchecked::next -

-

- Available in version 1.0 and later. -

-

- Given the iterator to the beginning of a UTF-8 sequence, it returns the code point - and moves the iterator to the next position. -

-
-template <typename octet_iterator>
-uint32_t next(octet_iterator& it);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - beginning of the next code point.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::next(w);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-
-

- This is a faster but less safe version of utf8::next. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::peek_next -

-

- Available in version 2.1 and later. -

-

- Given the iterator to the beginning of a UTF-8 sequence, it returns the code point. -

-
-template <typename octet_iterator>
-uint32_t peek_next(octet_iterator it);
-   
-
-

- it: an iterator pointing to the beginning of an UTF-8 - encoded code point.
- Return value: the 32 bit representation of the - processed UTF-8 code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::peek_next(w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This is a faster but less safe version of utf8::peek_next. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::prior -

-

- Available in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator>
-uint32_t prior(octet_iterator& it);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::prior (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- This is a faster but less safe version of utf8::prior. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::previous (deprecated, see utf8::unchecked::prior) -

-

- Deprecated in version 1.02 and later. -

-

- Given a reference to an iterator pointing to an octet in a UTF-8 seqence, it - decreases the iterator until it hits the beginning of the previous UTF-8 encoded - code point and returns the 32 bits representation of the code point. -

-
-template <typename octet_iterator>
-uint32_t previous(octet_iterator& it);
-   
-
-

- it: a reference pointing to an octet within a UTF-8 encoded string. - After the function returns, it is decremented to point to the beginning of the - previous code point.
- Return value: the 32 bit representation of the - previous code point. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::previous (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-
-

- The reason this function is deprecated is just the consistency with the "checked" - versions, where prior should be used instead of previous. - In fact, unchecked::previous behaves exactly the same as - unchecked::prior -

-

- This is a faster but less safe version of utf8::previous. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::advance -

-

- Available in version 1.0 and later. -

-

- Advances an iterator by the specified number of code points within an UTF-8 - sequence. -

-
-template <typename octet_iterator, typename distance_type>
-void advance (octet_iterator& it, distance_type n);
-   
-
-

- it: a reference to an iterator pointing to the beginning of an UTF-8 - encoded code point. After the function returns, it is incremented to point to the - nth following code point.
- n: a positive integer that shows how many code points we want to - advance.
-

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-unchecked::advance (w, 2);
-assert (w == twochars + 5);
-
-

- This function works only "forward". In case of a negative n, there is - no effect. -

-

- This is a faster but less safe version of utf8::advance. It does not - check for validity of the supplied UTF-8 sequence and offers no boundary checking. -

-

- utf8::unchecked::distance -

-

- Available in version 1.0 and later. -

-

- Given the iterators to two UTF-8 encoded code points in a seqence, returns the - number of code points between them. -

-
-template <typename octet_iterator>
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-
-

- first: an iterator to a beginning of a UTF-8 encoded code point.
- last: an iterator to a "post-end" of the last UTF-8 encoded code - point in the sequence we are trying to determine the length. It can be the - beginning of a new code point, or not.
- Return value the distance between the iterators, - in code points. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::unchecked::distance(twochars, twochars + 5);
-assert (dist == 2);
-
-

- This is a faster but less safe version of utf8::distance. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::utf16to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-16 encoded string to UTF-8. -

-
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-16 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-16 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-unchecked::utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);    
-
-

- This is a faster but less safe version of utf8::utf16to8. It does not - check for validity of the supplied UTF-16 sequence. -

-

- utf8::unchecked::utf8to16 -

-

- Available in version 1.0 and later. -

-

- Converts an UTF-8 encoded string to UTF-16 -

-
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert. < br /> end: an iterator pointing to - pass-the-end of the UTF-8 encoded string to convert.
- result: an output iterator to the place in the UTF-16 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-16 string. -

-

- Example of use: -

-
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-unchecked::utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-
-

- This is a faster but less safe version of utf8::utf8to16. It does not - check for validity of the supplied UTF-8 sequence. -

-

- utf8::unchecked::utf32to8 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-32 encoded string to UTF-8. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-32 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-32 encoded - string to convert.
- result: an output iterator to the place in the UTF-8 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-8 string. -

-

- Example of use: -

-
-int utf32string[] = {0x448, 0x65e5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-
-

- This is a faster but less safe version of utf8::utf32to8. It does not - check for validity of the supplied UTF-32 sequence. -

-

- utf8::unchecked::utf8to32 -

-

- Available in version 1.0 and later. -

-

- Converts a UTF-8 encoded string to UTF-32. -

-
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-   
-
-

- start: an iterator pointing to the beginning of the UTF-8 encoded - string to convert.
- end: an iterator pointing to pass-the-end of the UTF-8 encoded string - to convert.
- result: an output iterator to the place in the UTF-32 string where to - append the result of conversion.
- Return value: An iterator pointing to the place - after the appended UTF-32 string. -

-

- Example of use: -

-
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-unchecked::utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-
-

- This is a faster but less safe version of utf8::utf8to32. It does not - check for validity of the supplied UTF-8 sequence. -

-

- Types From utf8::unchecked Namespace -

-

- utf8::iterator -

-

- Available in version 2.0 and later. -

-

- Adapts the underlying octet iterator to iterate over the sequence of code points, - rather than raw octets. -

-
-template <typename octet_iterator>
-class iterator;
-
- -
Member functions
-
-
iterator();
the deafult constructor; the underlying octet_iterator is - constructed with its default constructor. -
explicit iterator (const octet_iterator& octet_it); -
a constructor - that initializes the underlying octet_iterator with octet_it -
octet_iterator base () const;
returns the - underlying octet_iterator. -
uint32_t operator * () const;
decodes the utf-8 sequence - the underlying octet_iterator is pointing to and returns the code point. -
bool operator == (const iterator& rhs) - const;
returns true - if the two underlaying iterators are equal. -
bool operator != (const iterator& rhs) - const;
returns true - if the two underlaying iterators are not equal. -
iterator& operator ++ ();
the prefix increment - moves - the iterator to the next UTF-8 encoded code point. -
iterator operator ++ (int);
- the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one. -
iterator& operator -- ();
the prefix decrement - moves - the iterator to the previous UTF-8 encoded code point. -
iterator operator -- (int);
- the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one. -
-

- Example of use: -

-
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::unchecked::iterator<char*> un_it(threechars);
-utf8::unchecked::iterator<char*> un_it2 = un_it;
-assert (un_it2 == un_it);
-assert (*un_it == 0x10346);
-assert (*(++un_it) == 0x65e5);
-assert ((*un_it++) == 0x65e5);
-assert (*un_it == 0x0448);
-assert (un_it != un_it2);
-utf8::::unchecked::iterator<char*> un_endit (threechars + 9);  
-assert (++un_it == un_endit);
-assert (*(--un_it) == 0x0448);
-assert ((*un_it--) == 0x0448);
-assert (*un_it == 0x65e5);
-assert (--un_it == utf8::unchecked::iterator<char*>(threechars));
-assert (*un_it == 0x10346);
-
-

- This is an unchecked version of utf8::iterator. It is faster in many cases, but offers - no validity or range checks. -

-

- Points of interest -

-

- Design goals and decisions -

-

- The library was designed to be: -

-
    -
  1. - Generic: for better or worse, there are many C++ string classes out there, and - the library should work with as many of them as possible. -
  2. -
  3. - Portable: the library should be portable both accross different platforms and - compilers. The only non-portable code is a small section that declares unsigned - integers of different sizes: three typedefs. They can be changed by the users of - the library if they don't match their platform. The default setting should work - for Windows (both 32 and 64 bit), and most 32 bit and 64 bit Unix derivatives. -
  4. -
  5. - Lightweight: follow the "pay only for what you use" guidline. -
  6. -
  7. - Unintrusive: avoid forcing any particular design or even programming style on the - user. This is a library, not a framework. -
  8. -
-

- Alternatives -

-

- In case you want to look into other means of working with UTF-8 strings from C++, - here is the list of solutions I am aware of: -

-
    -
  1. - ICU Library. It is very powerful, - complete, feature-rich, mature, and widely used. Also big, intrusive, - non-generic, and doesn't play well with the Standard Library. I definitelly - recommend looking at ICU even if you don't plan to use it. -
  2. -
  3. - Glib::ustring. - A class specifically made to work with UTF-8 strings, and also feel like - std::string. If you prefer to have yet another string class in your - code, it may be worth a look. Be aware of the licensing issues, though. -
  4. -
  5. - Platform dependent solutions: Windows and POSIX have functions to convert strings - from one encoding to another. That is only a subset of what my library offers, - but if that is all you need it may be good enough, especially given the fact that - these functions are mature and tested in production. -
  6. -
-

- Conclusion -

-

- Until Unicode becomes officially recognized by the C++ Standard Library, we need to - use other means to work with UTF-8 strings. Template functions I describe in this - article may be a good step in this direction. -

- -
    -
  1. - The Unicode Consortium. -
  2. -
  3. - ICU Library. -
  4. -
  5. - UTF-8 at Wikipedia -
  6. -
  7. - UTF-8 and Unicode FAQ for - Unix/Linux -
  8. -
- - diff --git a/externals/utf8cpp/include/utf8.h b/externals/utf8cpp/include/utf8.h deleted file mode 100644 index cc463cb82d5..00000000000 --- a/externals/utf8cpp/include/utf8.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "utf8/checked.h" -#include "utf8/unchecked.h" - -#endif // header guard - diff --git a/externals/utf8cpp/include/utf8/checked.h b/externals/utf8cpp/include/utf8/checked.h deleted file mode 100644 index 86204eae3ea..00000000000 --- a/externals/utf8cpp/include/utf8/checked.h +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "core.h" -#include - -namespace utf8 -{ - // Exceptions that may be thrown from the library functions. - class invalid_code_point : public std::exception { - uint32_t cp; - public: - invalid_code_point(uint32_t cp) : cp(cp) {} - virtual const char* what() const throw() { return "Invalid code point"; } - uint32_t code_point() const {return cp;} - }; - - class invalid_utf8 : public std::exception { - uint8_t u8; - public: - invalid_utf8 (uint8_t u) : u8(u) {} - virtual const char* what() const throw() { return "Invalid UTF-8"; } - uint8_t utf8_octet() const {return u8;} - }; - - class invalid_utf16 : public std::exception { - uint16_t u16; - public: - invalid_utf16 (uint16_t u) : u16(u) {} - virtual const char* what() const throw() { return "Invalid UTF-16"; } - uint16_t utf16_word() const {return u16;} - }; - - class not_enough_room : public std::exception { - public: - virtual const char* what() const throw() { return "Not enough space"; } - }; - - /// The library API - functions intended to be called by the users - - template - output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement) - { - while (start != end) { - octet_iterator sequence_start = start; - internal::utf_error err_code = internal::validate_next(start, end); - switch (err_code) { - case internal::OK : - for (octet_iterator it = sequence_start; it != start; ++it) - *out++ = *it; - break; - case internal::NOT_ENOUGH_ROOM: - throw not_enough_room(); - case internal::INVALID_LEAD: - append (replacement, out); - ++start; - break; - case internal::INCOMPLETE_SEQUENCE: - case internal::OVERLONG_SEQUENCE: - case internal::INVALID_CODE_POINT: - append (replacement, out); - ++start; - // just one replacement mark for the sequence - while (internal::is_trail(*start) && start != end) - ++start; - break; - } - } - return out; - } - - template - inline output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out) - { - static const uint32_t replacement_marker = internal::mask16(0xfffd); - return replace_invalid(start, end, out, replacement_marker); - } - - template - octet_iterator append(uint32_t cp, octet_iterator result) - { - if (!internal::is_code_point_valid(cp)) - throw invalid_code_point(cp); - - if (cp < 0x80) // one octet - *(result++) = static_cast(cp); - else if (cp < 0x800) { // two octets - *(result++) = static_cast((cp >> 6) | 0xc0); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else if (cp < 0x10000) { // three octets - *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else if (cp <= internal::CODE_POINT_MAX) { // four octets - *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast(((cp >> 12)& 0x3f) | 0x80); - *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else - throw invalid_code_point(cp); - - return result; - } - - template - uint32_t next(octet_iterator& it, octet_iterator end) - { - uint32_t cp = 0; - internal::utf_error err_code = internal::validate_next(it, end, &cp); - switch (err_code) { - case internal::OK : - break; - case internal::NOT_ENOUGH_ROOM : - throw not_enough_room(); - case internal::INVALID_LEAD : - case internal::INCOMPLETE_SEQUENCE : - case internal::OVERLONG_SEQUENCE : - throw invalid_utf8(*it); - case internal::INVALID_CODE_POINT : - throw invalid_code_point(cp); - } - return cp; - } - - template - uint32_t peek_next(octet_iterator it, octet_iterator end) - { - return next(it, end); - } - - template - uint32_t prior(octet_iterator& it, octet_iterator start) - { - octet_iterator end = it; - while (internal::is_trail(*(--it))) - if (it < start) - throw invalid_utf8(*it); // error - no lead byte in the sequence - octet_iterator temp = it; - return next(temp, end); - } - - /// Deprecated in versions that include "prior" - template - uint32_t previous(octet_iterator& it, octet_iterator pass_start) - { - octet_iterator end = it; - while (internal::is_trail(*(--it))) - if (it == pass_start) - throw invalid_utf8(*it); // error - no lead byte in the sequence - octet_iterator temp = it; - return next(temp, end); - } - - template - void advance (octet_iterator& it, distance_type n, octet_iterator end) - { - for (distance_type i = 0; i < n; ++i) - next(it, end); - } - - template - typename std::iterator_traits::difference_type - distance (octet_iterator first, octet_iterator last) - { - typename std::iterator_traits::difference_type dist; - for (dist = 0; first < last; ++dist) - next(first, last); - return dist; - } - - template - octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result) - { - while (start != end) { - uint32_t cp = internal::mask16(*start++); - // Take care of surrogate pairs first - if (internal::is_surrogate(cp)) { - if (start != end) { - uint32_t trail_surrogate = internal::mask16(*start++); - if (trail_surrogate >= internal::TRAIL_SURROGATE_MIN && trail_surrogate <= internal::TRAIL_SURROGATE_MAX) - cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; - else - throw invalid_utf16(static_cast(trail_surrogate)); - } - else - throw invalid_utf16(static_cast(*start)); - - } - result = append(cp, result); - } - return result; - } - - template - u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result) - { - while (start != end) { - uint32_t cp = next(start, end); - if (cp > 0xffff) { //make a surrogate pair - *result++ = static_cast((cp >> 10) + internal::LEAD_OFFSET); - *result++ = static_cast((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN); - } - else - *result++ = static_cast(cp); - } - return result; - } - - template - octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result) - { - while (start != end) - result = append(*(start++), result); - - return result; - } - - template - u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result) - { - while (start < end) - (*result++) = next(start, end); - - return result; - } - - // The iterator class - template - class iterator : public std::iterator { - octet_iterator it; - octet_iterator range_start; - octet_iterator range_end; - public: - iterator () {}; - explicit iterator (const octet_iterator& octet_it, - const octet_iterator& range_start, - const octet_iterator& range_end) : - it(octet_it), range_start(range_start), range_end(range_end) - { - if (it < range_start || it > range_end) - throw std::out_of_range("Invalid utf-8 iterator position"); - } - // the default "big three" are OK - octet_iterator base () const { return it; } - uint32_t operator * () const - { - octet_iterator temp = it; - return next(temp, range_end); - } - bool operator == (const iterator& rhs) const - { - if (range_start != rhs.range_start || range_end != rhs.range_end) - throw std::logic_error("Comparing utf-8 iterators defined with different ranges"); - return (it == rhs.it); - } - bool operator != (const iterator& rhs) const - { - return !(operator == (rhs)); - } - iterator& operator ++ () - { - next(it, range_end); - return *this; - } - iterator operator ++ (int) - { - iterator temp = *this; - next(it, range_end); - return temp; - } - iterator& operator -- () - { - prior(it, range_start); - return *this; - } - iterator operator -- (int) - { - iterator temp = *this; - prior(it, range_start); - return temp; - } - }; // class iterator - -} // namespace utf8 - -#endif //header guard - - - diff --git a/externals/utf8cpp/include/utf8/core.h b/externals/utf8cpp/include/utf8/core.h deleted file mode 100644 index 389dd3e8ca5..00000000000 --- a/externals/utf8cpp/include/utf8/core.h +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include - -// use Trinity core types -#include "Platform/Define.h" - -namespace utf8 -{ - // The typedefs for 8-bit, 16-bit and 32-bit unsigned integers - // You may need to change them to match your system. - // These typedefs have the same names as ones from cstdint, or boost/cstdint - - /* use Trinity alternatives - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - */ - typedef uint8 uint8_t; - typedef uint16 uint16_t; - typedef uint32 uint32_t; - -// Helper code - not intended to be directly called by the library users. May be changed at any time -namespace internal -{ - // Unicode constants - // Leading (high) surrogates: 0xd800 - 0xdbff - // Trailing (low) surrogates: 0xdc00 - 0xdfff - const uint16_t LEAD_SURROGATE_MIN = 0xd800u; - const uint16_t LEAD_SURROGATE_MAX = 0xdbffu; - const uint16_t TRAIL_SURROGATE_MIN = 0xdc00u; - const uint16_t TRAIL_SURROGATE_MAX = 0xdfffu; - const uint16_t LEAD_OFFSET = LEAD_SURROGATE_MIN - (0x10000 >> 10); - const uint32_t SURROGATE_OFFSET = 0x10000u - (LEAD_SURROGATE_MIN << 10) - TRAIL_SURROGATE_MIN; - - // Maximum valid value for a Unicode code point - const uint32_t CODE_POINT_MAX = 0x0010ffffu; - - template - inline uint8_t mask8(octet_type oc) - { - return static_cast(0xff & oc); - } - template - inline uint16_t mask16(u16_type oc) - { - return static_cast(0xffff & oc); - } - template - inline bool is_trail(octet_type oc) - { - return ((mask8(oc) >> 6) == 0x2); - } - - template - inline bool is_surrogate(u16 cp) - { - return (cp >= LEAD_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX); - } - - template - inline bool is_code_point_valid(u32 cp) - { - return (cp <= CODE_POINT_MAX && !is_surrogate(cp) && cp != 0xfffe && cp != 0xffff); - } - - template - inline typename std::iterator_traits::difference_type - sequence_length(octet_iterator lead_it) - { - uint8_t lead = mask8(*lead_it); - if (lead < 0x80) - return 1; - else if ((lead >> 5) == 0x6) - return 2; - else if ((lead >> 4) == 0xe) - return 3; - else if ((lead >> 3) == 0x1e) - return 4; - else - return 0; - } - - enum utf_error {OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT}; - - template - utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t* code_point) - { - uint32_t cp = mask8(*it); - // Check the lead octet - typedef typename std::iterator_traits::difference_type octet_difference_type; - octet_difference_type length = sequence_length(it); - - // "Shortcut" for ASCII characters - if (length == 1) { - if (end - it > 0) { - if (code_point) - *code_point = cp; - ++it; - return OK; - } - else - return NOT_ENOUGH_ROOM; - } - - // Do we have enough memory? - if (std::distance(it, end) < length) - return NOT_ENOUGH_ROOM; - - // Check trail octets and calculate the code point - switch (length) { - case 0: - return INVALID_LEAD; - break; - case 2: - if (is_trail(*(++it))) { - cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } - break; - case 3: - if (is_trail(*(++it))) { - cp = ((cp << 12) & 0xffff) + ((mask8(*it) << 6) & 0xfff); - if (is_trail(*(++it))) { - cp += (*it) & 0x3f; - } - else { - std::advance(it, -2); - return INCOMPLETE_SEQUENCE; - } - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } - break; - case 4: - if (is_trail(*(++it))) { - cp = ((cp << 18) & 0x1fffff) + ((mask8(*it) << 12) & 0x3ffff); - if (is_trail(*(++it))) { - cp += (mask8(*it) << 6) & 0xfff; - if (is_trail(*(++it))) { - cp += (*it) & 0x3f; - } - else { - std::advance(it, -3); - return INCOMPLETE_SEQUENCE; - } - } - else { - std::advance(it, -2); - return INCOMPLETE_SEQUENCE; - } - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } - break; - } - // Is the code point valid? - if (!is_code_point_valid(cp)) { - for (octet_difference_type i = 0; i < length - 1; ++i) - --it; - return INVALID_CODE_POINT; - } - - if (code_point) - *code_point = cp; - - if (cp < 0x80) { - if (length != 1) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - else if (cp < 0x800) { - if (length != 2) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - else if (cp < 0x10000) { - if (length != 3) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - - ++it; - return OK; - } - - template - inline utf_error validate_next(octet_iterator& it, octet_iterator end) { - return validate_next(it, end, 0); - } - -} // namespace internal - - /// The library API - functions intended to be called by the users - - // Byte order mark - const uint8_t bom[] = {0xef, 0xbb, 0xbf}; - - template - octet_iterator find_invalid(octet_iterator start, octet_iterator end) - { - octet_iterator result = start; - while (result != end) { - internal::utf_error err_code = internal::validate_next(result, end); - if (err_code != internal::OK) - return result; - } - return result; - } - - template - inline bool is_valid(octet_iterator start, octet_iterator end) - { - return (find_invalid(start, end) == end); - } - - template - inline bool is_bom (octet_iterator it) - { - return ( - (internal::mask8(*it++)) == bom[0] && - (internal::mask8(*it++)) == bom[1] && - (internal::mask8(*it)) == bom[2] - ); - } -} // namespace utf8 - -#endif // header guard - - - diff --git a/externals/utf8cpp/include/utf8/unchecked.h b/externals/utf8cpp/include/utf8/unchecked.h deleted file mode 100644 index fc7267d1b98..00000000000 --- a/externals/utf8cpp/include/utf8/unchecked.h +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2006 Nemanja Trifunovic - -/* -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -*/ - - -#ifndef UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 -#define UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731 - -#include "core.h" - -namespace utf8 -{ - namespace unchecked - { - template - octet_iterator append(uint32_t cp, octet_iterator result) - { - if (cp < 0x80) // one octet - *(result++) = static_cast(cp); - else if (cp < 0x800) { // two octets - *(result++) = static_cast((cp >> 6) | 0xc0); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else if (cp < 0x10000) { // three octets - *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - else { // four octets - *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast((cp >> 12)& 0x3f | 0x80); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); - *(result++) = static_cast((cp & 0x3f) | 0x80); - } - return result; - } - - template - uint32_t next(octet_iterator& it) - { - uint32_t cp = internal::mask8(*it); - typename std::iterator_traits::difference_type length = utf8::internal::sequence_length(it); - switch (length) { - case 1: - break; - case 2: - it++; - cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); - break; - case 3: - ++it; - cp = ((cp << 12) & 0xffff) + ((internal::mask8(*it) << 6) & 0xfff); - ++it; - cp += (*it) & 0x3f; - break; - case 4: - ++it; - cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff); - ++it; - cp += (internal::mask8(*it) << 6) & 0xfff; - ++it; - cp += (*it) & 0x3f; - break; - } - ++it; - return cp; - } - - template - uint32_t peek_next(octet_iterator it) - { - return next(it); - } - - template - uint32_t prior(octet_iterator& it) - { - while (internal::is_trail(*(--it))) ; - octet_iterator temp = it; - return next(temp); - } - - // Deprecated in versions that include prior, but only for the sake of consistency (see utf8::previous) - template - inline uint32_t previous(octet_iterator& it) - { - return prior(it); - } - - template - void advance (octet_iterator& it, distance_type n) - { - for (distance_type i = 0; i < n; ++i) - next(it); - } - - template - typename std::iterator_traits::difference_type - distance (octet_iterator first, octet_iterator last) - { - typename std::iterator_traits::difference_type dist; - for (dist = 0; first < last; ++dist) - next(first); - return dist; - } - - template - octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result) - { - while (start != end) { - uint32_t cp = internal::mask16(*start++); - // Take care of surrogate pairs first - if (internal::is_surrogate(cp)) { - uint32_t trail_surrogate = internal::mask16(*start++); - cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; - } - result = append(cp, result); - } - return result; - } - - template - u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result) - { - while (start != end) { - uint32_t cp = next(start); - if (cp > 0xffff) { //make a surrogate pair - *result++ = static_cast((cp >> 10) + internal::LEAD_OFFSET); - *result++ = static_cast((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN); - } - else - *result++ = static_cast(cp); - } - return result; - } - - template - octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result) - { - while (start != end) - result = append(*(start++), result); - - return result; - } - - template - u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result) - { - while (start < end) - (*result++) = next(start); - - return result; - } - - // The iterator class - template - class iterator : public std::iterator { - octet_iterator it; - public: - iterator () {}; - explicit iterator (const octet_iterator& octet_it): it(octet_it) {} - // the default "big three" are OK - octet_iterator base () const { return it; } - uint32_t operator * () const - { - octet_iterator temp = it; - return next(temp); - } - bool operator == (const iterator& rhs) const - { - return (it == rhs.it); - } - bool operator != (const iterator& rhs) const - { - return !(operator == (rhs)); - } - iterator& operator ++ () - { - std::advance(it, internal::sequence_length(it)); - return *this; - } - iterator operator ++ (int) - { - iterator temp = *this; - std::advance(it, internal::sequence_length(it)); - return temp; - } - iterator& operator -- () - { - prior(it); - return *this; - } - iterator operator -- (int) - { - iterator temp = *this; - prior(it); - return temp; - } - }; // class iterator - - } // namespace utf8::unchecked -} // namespace utf8 - - -#endif // header guard - - diff --git a/dep/include/utf8cpp/utf8.h b/externals/utf8cpp/utf8.h similarity index 99% rename from dep/include/utf8cpp/utf8.h rename to externals/utf8cpp/utf8.h index cc463cb82d5..82b13f59f98 100644 --- a/dep/include/utf8cpp/utf8.h +++ b/externals/utf8cpp/utf8.h @@ -32,4 +32,3 @@ DEALINGS IN THE SOFTWARE. #include "utf8/unchecked.h" #endif // header guard - diff --git a/dep/include/utf8cpp/utf8/checked.h b/externals/utf8cpp/utf8/checked.h similarity index 92% rename from dep/include/utf8cpp/utf8/checked.h rename to externals/utf8cpp/utf8/checked.h index 86204eae3ea..a1d2035364d 100644 --- a/dep/include/utf8cpp/utf8/checked.h +++ b/externals/utf8cpp/utf8/checked.h @@ -33,8 +33,12 @@ DEALINGS IN THE SOFTWARE. namespace utf8 { + // Base for the exceptions that may be thrown from the library + class exception : public std::exception { + }; + // Exceptions that may be thrown from the library functions. - class invalid_code_point : public std::exception { + class invalid_code_point : public exception { uint32_t cp; public: invalid_code_point(uint32_t cp) : cp(cp) {} @@ -42,7 +46,7 @@ namespace utf8 uint32_t code_point() const {return cp;} }; - class invalid_utf8 : public std::exception { + class invalid_utf8 : public exception { uint8_t u8; public: invalid_utf8 (uint8_t u) : u8(u) {} @@ -50,7 +54,7 @@ namespace utf8 uint8_t utf8_octet() const {return u8;} }; - class invalid_utf16 : public std::exception { + class invalid_utf16 : public exception { uint16_t u16; public: invalid_utf16 (uint16_t u) : u16(u) {} @@ -58,7 +62,7 @@ namespace utf8 uint16_t utf16_word() const {return u16;} }; - class not_enough_room : public std::exception { + class not_enough_room : public exception { public: virtual const char* what() const throw() { return "Not enough space"; } }; @@ -72,7 +76,7 @@ namespace utf8 octet_iterator sequence_start = start; internal::utf_error err_code = internal::validate_next(start, end); switch (err_code) { - case internal::OK : + case internal::UTF8_OK : for (octet_iterator it = sequence_start; it != start; ++it) *out++ = *it; break; @@ -120,15 +124,12 @@ namespace utf8 *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } - else if (cp <= internal::CODE_POINT_MAX) { // four octets + else { // four octets *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast(((cp >> 12)& 0x3f) | 0x80); + *(result++) = static_cast(((cp >> 12) & 0x3f) | 0x80); *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } - else - throw invalid_code_point(cp); - return result; } @@ -138,7 +139,7 @@ namespace utf8 uint32_t cp = 0; internal::utf_error err_code = internal::validate_next(it, end, &cp); switch (err_code) { - case internal::OK : + case internal::UTF8_OK : break; case internal::NOT_ENOUGH_ROOM : throw not_enough_room(); @@ -204,18 +205,22 @@ namespace utf8 while (start != end) { uint32_t cp = internal::mask16(*start++); // Take care of surrogate pairs first - if (internal::is_surrogate(cp)) { + if (internal::is_lead_surrogate(cp)) { if (start != end) { uint32_t trail_surrogate = internal::mask16(*start++); - if (trail_surrogate >= internal::TRAIL_SURROGATE_MIN && trail_surrogate <= internal::TRAIL_SURROGATE_MAX) + if (internal::is_trail_surrogate(trail_surrogate)) cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; else throw invalid_utf16(static_cast(trail_surrogate)); } else - throw invalid_utf16(static_cast(*start)); + throw invalid_utf16(static_cast(cp)); } + // Lone trail surrogate + else if (internal::is_trail_surrogate(cp)) + throw invalid_utf16(static_cast(cp)); + result = append(cp, result); } return result; @@ -248,7 +253,7 @@ namespace utf8 template u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result) { - while (start < end) + while (start != end) (*result++) = next(start, end); return result; @@ -316,4 +321,3 @@ namespace utf8 #endif //header guard - diff --git a/dep/include/utf8cpp/utf8/core.h b/externals/utf8cpp/utf8/core.h similarity index 51% rename from dep/include/utf8cpp/utf8/core.h rename to externals/utf8cpp/utf8/core.h index 389dd3e8ca5..ec709f12006 100644 --- a/dep/include/utf8cpp/utf8/core.h +++ b/externals/utf8cpp/utf8/core.h @@ -30,23 +30,14 @@ DEALINGS IN THE SOFTWARE. #include -// use Trinity core types -#include "Platform/Define.h" - namespace utf8 { // The typedefs for 8-bit, 16-bit and 32-bit unsigned integers // You may need to change them to match your system. // These typedefs have the same names as ones from cstdint, or boost/cstdint - - /* use Trinity alternatives typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; - */ - typedef uint8 uint8_t; - typedef uint16 uint16_t; - typedef uint32 uint32_t; // Helper code - not intended to be directly called by the library users. May be changed at any time namespace internal @@ -80,6 +71,18 @@ namespace internal return ((mask8(oc) >> 6) == 0x2); } + template + inline bool is_lead_surrogate(u16 cp) + { + return (cp >= LEAD_SURROGATE_MIN && cp <= LEAD_SURROGATE_MAX); + } + + template + inline bool is_trail_surrogate(u16 cp) + { + return (cp >= TRAIL_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX); + } + template inline bool is_surrogate(u16 cp) { @@ -109,117 +112,193 @@ namespace internal return 0; } - enum utf_error {OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT}; + template + inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length) + { + if (cp < 0x80) { + if (length != 1) + return true; + } + else if (cp < 0x800) { + if (length != 2) + return true; + } + else if (cp < 0x10000) { + if (length != 3) + return true; + } + + return false; + } + + enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT}; + + /// get_sequence_x functions decode utf-8 sequences of the length x + + template + utf_error get_sequence_1(octet_iterator& it, octet_iterator end, uint32_t* code_point) + { + if (it != end) { + if (code_point) + *code_point = mask8(*it); + return UTF8_OK; + } + return NOT_ENOUGH_ROOM; + } + + template + utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t* code_point) + { + utf_error ret_code = NOT_ENOUGH_ROOM; + + if (it != end) { + uint32_t cp = mask8(*it); + if (++it != end) { + if (is_trail(*it)) { + cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); + + if (code_point) + *code_point = cp; + ret_code = UTF8_OK; + } + else + ret_code = INCOMPLETE_SEQUENCE; + } + else + ret_code = NOT_ENOUGH_ROOM; + } + + return ret_code; + } + + template + utf_error get_sequence_3(octet_iterator& it, octet_iterator end, uint32_t* code_point) + { + utf_error ret_code = NOT_ENOUGH_ROOM; + + if (it != end) { + uint32_t cp = mask8(*it); + if (++it != end) { + if (is_trail(*it)) { + cp = ((cp << 12) & 0xffff) + ((mask8(*it) << 6) & 0xfff); + if (++it != end) { + if (is_trail(*it)) { + cp += (*it) & 0x3f; + + if (code_point) + *code_point = cp; + ret_code = UTF8_OK; + } + else + ret_code = INCOMPLETE_SEQUENCE; + } + else + ret_code = NOT_ENOUGH_ROOM; + } + else + ret_code = INCOMPLETE_SEQUENCE; + } + else + ret_code = NOT_ENOUGH_ROOM; + } + + return ret_code; + } + + template + utf_error get_sequence_4(octet_iterator& it, octet_iterator end, uint32_t* code_point) + { + utf_error ret_code = NOT_ENOUGH_ROOM; + + if (it != end) { + uint32_t cp = mask8(*it); + if (++it != end) { + if (is_trail(*it)) { + cp = ((cp << 18) & 0x1fffff) + ((mask8(*it) << 12) & 0x3ffff); + if (++it != end) { + if (is_trail(*it)) { + cp += (mask8(*it) << 6) & 0xfff; + if (++it != end) { + if (is_trail(*it)) { + cp += (*it) & 0x3f; + + if (code_point) + *code_point = cp; + ret_code = UTF8_OK; + } + else + ret_code = INCOMPLETE_SEQUENCE; + } + else + ret_code = NOT_ENOUGH_ROOM; + } + else + ret_code = INCOMPLETE_SEQUENCE; + } + else + ret_code = NOT_ENOUGH_ROOM; + } + else + ret_code = INCOMPLETE_SEQUENCE; + } + else + ret_code = NOT_ENOUGH_ROOM; + } + + return ret_code; + } template utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t* code_point) { - uint32_t cp = mask8(*it); - // Check the lead octet + // Save the original value of it so we can go back in case of failure + // Of course, it does not make much sense with i.e. stream iterators + octet_iterator original_it = it; + + uint32_t cp = 0; + // Determine the sequence length based on the lead octet typedef typename std::iterator_traits::difference_type octet_difference_type; octet_difference_type length = sequence_length(it); + if (length == 0) + return INVALID_LEAD; - // "Shortcut" for ASCII characters - if (length == 1) { - if (end - it > 0) { - if (code_point) - *code_point = cp; - ++it; - return OK; - } - else - return NOT_ENOUGH_ROOM; - } - - // Do we have enough memory? - if (std::distance(it, end) < length) - return NOT_ENOUGH_ROOM; - - // Check trail octets and calculate the code point + // Now that we have a valid sequence length, get trail octets and calculate the code point + utf_error err = UTF8_OK; switch (length) { - case 0: - return INVALID_LEAD; + case 1: + err = get_sequence_1(it, end, &cp); break; case 2: - if (is_trail(*(++it))) { - cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } + err = get_sequence_2(it, end, &cp); break; case 3: - if (is_trail(*(++it))) { - cp = ((cp << 12) & 0xffff) + ((mask8(*it) << 6) & 0xfff); - if (is_trail(*(++it))) { - cp += (*it) & 0x3f; - } - else { - std::advance(it, -2); - return INCOMPLETE_SEQUENCE; - } - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } + err = get_sequence_3(it, end, &cp); break; case 4: - if (is_trail(*(++it))) { - cp = ((cp << 18) & 0x1fffff) + ((mask8(*it) << 12) & 0x3ffff); - if (is_trail(*(++it))) { - cp += (mask8(*it) << 6) & 0xfff; - if (is_trail(*(++it))) { - cp += (*it) & 0x3f; - } - else { - std::advance(it, -3); - return INCOMPLETE_SEQUENCE; - } - } - else { - std::advance(it, -2); - return INCOMPLETE_SEQUENCE; - } - } - else { - --it; - return INCOMPLETE_SEQUENCE; - } + err = get_sequence_4(it, end, &cp); break; } - // Is the code point valid? - if (!is_code_point_valid(cp)) { - for (octet_difference_type i = 0; i < length - 1; ++i) - --it; - return INVALID_CODE_POINT; + + if (err == UTF8_OK) { + // Decoding succeeded. Now, security checks... + if (is_code_point_valid(cp)) { + if (!is_overlong_sequence(cp, length)){ + // Passed! Return here. + if (code_point) + *code_point = cp; + ++it; + return UTF8_OK; + } + else + err = OVERLONG_SEQUENCE; + } + else + err = INVALID_CODE_POINT; } - if (code_point) - *code_point = cp; - - if (cp < 0x80) { - if (length != 1) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - else if (cp < 0x800) { - if (length != 2) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - else if (cp < 0x10000) { - if (length != 3) { - std::advance(it, -(length-1)); - return OVERLONG_SEQUENCE; - } - } - - ++it; - return OK; + // Failure branch - restore the original value of the iterator + it = original_it; + return err; } template @@ -240,7 +319,7 @@ namespace internal octet_iterator result = start; while (result != end) { internal::utf_error err_code = internal::validate_next(result, end); - if (err_code != internal::OK) + if (err_code != internal::UTF8_OK) return result; } return result; @@ -252,6 +331,17 @@ namespace internal return (find_invalid(start, end) == end); } + template + inline bool starts_with_bom (octet_iterator it, octet_iterator end) + { + return ( + ((it != end) && (internal::mask8(*it++)) == bom[0]) && + ((it != end) && (internal::mask8(*it++)) == bom[1]) && + ((it != end) && (internal::mask8(*it)) == bom[2]) + ); + } + + //Deprecated in release 2.3 template inline bool is_bom (octet_iterator it) { @@ -266,4 +356,3 @@ namespace internal #endif // header guard - diff --git a/dep/include/utf8cpp/utf8/unchecked.h b/externals/utf8cpp/utf8/unchecked.h similarity index 89% rename from dep/include/utf8cpp/utf8/unchecked.h rename to externals/utf8cpp/utf8/unchecked.h index fc7267d1b98..2f3eb4d1d02 100644 --- a/dep/include/utf8cpp/utf8/unchecked.h +++ b/externals/utf8cpp/utf8/unchecked.h @@ -32,26 +32,26 @@ DEALINGS IN THE SOFTWARE. namespace utf8 { - namespace unchecked + namespace unchecked { template octet_iterator append(uint32_t cp, octet_iterator result) { if (cp < 0x80) // one octet - *(result++) = static_cast(cp); + *(result++) = static_cast(cp); else if (cp < 0x800) { // two octets *(result++) = static_cast((cp >> 6) | 0xc0); *(result++) = static_cast((cp & 0x3f) | 0x80); } else if (cp < 0x10000) { // three octets *(result++) = static_cast((cp >> 12) | 0xe0); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } else { // four octets *(result++) = static_cast((cp >> 18) | 0xf0); - *(result++) = static_cast((cp >> 12)& 0x3f | 0x80); - *(result++) = static_cast((cp >> 6) & 0x3f | 0x80); + *(result++) = static_cast(((cp >> 12) & 0x3f)| 0x80); + *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); *(result++) = static_cast((cp & 0x3f) | 0x80); } return result; @@ -70,28 +70,28 @@ namespace utf8 cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f); break; case 3: - ++it; + ++it; cp = ((cp << 12) & 0xffff) + ((internal::mask8(*it) << 6) & 0xfff); ++it; cp += (*it) & 0x3f; break; case 4: ++it; - cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff); + cp = ((cp << 18) & 0x1fffff) + ((internal::mask8(*it) << 12) & 0x3ffff); ++it; cp += (internal::mask8(*it) << 6) & 0xfff; ++it; - cp += (*it) & 0x3f; + cp += (*it) & 0x3f; break; } ++it; - return cp; + return cp; } template uint32_t peek_next(octet_iterator it) { - return next(it); + return next(it); } template @@ -121,30 +121,30 @@ namespace utf8 distance (octet_iterator first, octet_iterator last) { typename std::iterator_traits::difference_type dist; - for (dist = 0; first < last; ++dist) + for (dist = 0; first < last; ++dist) next(first); return dist; } template octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result) - { + { while (start != end) { uint32_t cp = internal::mask16(*start++); // Take care of surrogate pairs first - if (internal::is_surrogate(cp)) { + if (internal::is_lead_surrogate(cp)) { uint32_t trail_surrogate = internal::mask16(*start++); cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET; } result = append(cp, result); } - return result; + return result; } template u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result) { - while (start != end) { + while (start < end) { uint32_t cp = next(start); if (cp > 0xffff) { //make a surrogate pair *result++ = static_cast((cp >> 10) + internal::LEAD_OFFSET); @@ -176,7 +176,7 @@ namespace utf8 // The iterator class template - class iterator : public std::iterator { + class iterator : public std::iterator { octet_iterator it; public: iterator () {}; @@ -188,15 +188,15 @@ namespace utf8 octet_iterator temp = it; return next(temp); } - bool operator == (const iterator& rhs) const - { + bool operator == (const iterator& rhs) const + { return (it == rhs.it); } bool operator != (const iterator& rhs) const { return !(operator == (rhs)); } - iterator& operator ++ () + iterator& operator ++ () { std::advance(it, internal::sequence_length(it)); return *this; @@ -206,7 +206,7 @@ namespace utf8 iterator temp = *this; std::advance(it, internal::sequence_length(it)); return temp; - } + } iterator& operator -- () { prior(it); @@ -221,9 +221,8 @@ namespace utf8 }; // class iterator } // namespace utf8::unchecked -} // namespace utf8 +} // namespace utf8 #endif // header guard - diff --git a/externals/zlib/CMakeLists.txt b/externals/zlib/CMakeLists.txt new file mode 100644 index 00000000000..e53fae3053d --- /dev/null +++ b/externals/zlib/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + +SET(zlib_STAT_SRCS + adler32.c + compress.c + crc32.c + deflate.c + example.c + infback.c + inffast.c + inflate.c + inftrees.c + trees.c + uncompr.c + zutil.c +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_library(zlib STATIC ${zlib_STAT_SRCS}) diff --git a/externals/zlib/ChangeLog b/externals/zlib/ChangeLog deleted file mode 100644 index f310bb0fcdb..00000000000 --- a/externals/zlib/ChangeLog +++ /dev/null @@ -1,1208 +0,0 @@ - - ChangeLog file for zlib - -Changes in 1.2.5 (19 Apr 2010) -- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev] -- Default to libdir as sharedlibdir in configure [Nieder] -- Update copyright dates on modified source files -- Update trees.c to be able to generate modified trees.h -- Exit configure for MinGW, suggesting win32/Makefile.gcc - -Changes in 1.2.4.5 (18 Apr 2010) -- Set sharedlibdir in configure [Torok] -- Set LDFLAGS in Makefile.in [Bar-Lev] -- Avoid mkdir objs race condition in Makefile.in [Bowler] -- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays -- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C -- Don't use hidden attribute when it is a warning generator (e.g. Solaris) - -Changes in 1.2.4.4 (18 Apr 2010) -- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok] -- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty -- Try to use bash or ksh regardless of functionality of /bin/sh -- Fix configure incompatibility with NetBSD sh -- Remove attempt to run under bash or ksh since have better NetBSD fix -- Fix win32/Makefile.gcc for MinGW [Bar-Lev] -- Add diagnostic messages when using CROSS_PREFIX in configure -- Added --sharedlibdir option to configure [Weigelt] -- Use hidden visibility attribute when available [Frysinger] - -Changes in 1.2.4.3 (10 Apr 2010) -- Only use CROSS_PREFIX in configure for ar and ranlib if they exist -- Use CROSS_PREFIX for nm [Bar-Lev] -- Assume _LARGEFILE64_SOURCE defined is equivalent to true -- Avoid use of undefined symbols in #if with && and || -- Make *64 prototypes in gzguts.h consistent with functions -- Add -shared load option for MinGW in configure [Bowler] -- Move z_off64_t to public interface, use instead of off64_t -- Remove ! from shell test in configure (not portable to Solaris) -- Change +0 macro tests to -0 for possibly increased portability - -Changes in 1.2.4.2 (9 Apr 2010) -- Add consistent carriage returns to readme.txt's in masmx86 and masmx64 -- Really provide prototypes for *64 functions when building without LFS -- Only define unlink() in minigzip.c if unistd.h not included -- Update README to point to contrib/vstudio project files -- Move projects/vc6 to old/ and remove projects/ -- Include stdlib.h in minigzip.c for setmode() definition under WinCE -- Clean up assembler builds in win32/Makefile.msc [Rowe] -- Include sys/types.h for Microsoft for off_t definition -- Fix memory leak on error in gz_open() -- Symbolize nm as $NM in configure [Weigelt] -- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt] -- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined -- Fix bug in gzeof() to take into account unused input data -- Avoid initialization of structures with variables in puff.c -- Updated win32/README-WIN32.txt [Rowe] - -Changes in 1.2.4.1 (28 Mar 2010) -- Remove the use of [a-z] constructs for sed in configure [gentoo 310225] -- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech] -- Restore "for debugging" comment on sprintf() in gzlib.c -- Remove fdopen for MVS from gzguts.h -- Put new README-WIN32.txt in win32 [Rowe] -- Add check for shell to configure and invoke another shell if needed -- Fix big fat stinking bug in gzseek() on uncompressed files -- Remove vestigial F_OPEN64 define in zutil.h -- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE -- Avoid errors on non-LFS systems when applications define LFS macros -- Set EXE to ".exe" in configure for MINGW [Kahle] -- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill] -- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev] -- Add DLL install in win32/makefile.gcc [Bar-Lev] -- Allow Linux* or linux* from uname in configure [Bar-Lev] -- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev] -- Add cross-compilation prefixes to configure [Bar-Lev] -- Match type exactly in gz_load() invocation in gzread.c -- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func -- Provide prototypes for *64 functions when building zlib without LFS -- Don't use -lc when linking shared library on MinGW -- Remove errno.h check in configure and vestigial errno code in zutil.h - -Changes in 1.2.4 (14 Mar 2010) -- Fix VER3 extraction in configure for no fourth subversion -- Update zlib.3, add docs to Makefile.in to make .pdf out of it -- Add zlib.3.pdf to distribution -- Don't set error code in gzerror() if passed pointer is NULL -- Apply destination directory fixes to CMakeLists.txt [Lowman] -- Move #cmakedefine's to a new zconf.in.cmakein -- Restore zconf.h for builds that don't use configure or cmake -- Add distclean to dummy Makefile for convenience -- Update and improve INDEX, README, and FAQ -- Update CMakeLists.txt for the return of zconf.h [Lowman] -- Update contrib/vstudio/vc9 and vc10 [Vollant] -- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc -- Apply license and readme changes to contrib/asm686 [Raiter] -- Check file name lengths and add -c option in minigzip.c [Li] -- Update contrib/amd64 and contrib/masmx86/ [Vollant] -- Avoid use of "eof" parameter in trees.c to not shadow library variable -- Update make_vms.com for removal of zlibdefs.h [Zinser] -- Update assembler code and vstudio projects in contrib [Vollant] -- Remove outdated assembler code contrib/masm686 and contrib/asm586 -- Remove old vc7 and vc8 from contrib/vstudio -- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe] -- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open() -- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant] -- Remove *64 functions from win32/zlib.def (they're not 64-bit yet) -- Fix bug in void-returning vsprintf() case in gzwrite.c -- Fix name change from inflate.h in contrib/inflate86/inffas86.c -- Check if temporary file exists before removing in make_vms.com [Zinser] -- Fix make install and uninstall for --static option -- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta] -- Update readme.txt in contrib/masmx64 and masmx86 to assemble - -Changes in 1.2.3.9 (21 Feb 2010) -- Expunge gzio.c -- Move as400 build information to old -- Fix updates in contrib/minizip and contrib/vstudio -- Add const to vsnprintf test in configure to avoid warnings [Weigelt] -- Delete zconf.h (made by configure) [Weigelt] -- Change zconf.in.h to zconf.h.in per convention [Weigelt] -- Check for NULL buf in gzgets() -- Return empty string for gzgets() with len == 1 (like fgets()) -- Fix description of gzgets() in zlib.h for end-of-file, NULL return -- Update minizip to 1.1 [Vollant] -- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c -- Note in zlib.h that gzerror() should be used to distinguish from EOF -- Remove use of snprintf() from gzlib.c -- Fix bug in gzseek() -- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant] -- Fix zconf.h generation in CMakeLists.txt [Lowman] -- Improve comments in zconf.h where modified by configure - -Changes in 1.2.3.8 (13 Feb 2010) -- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer] -- Use z_off64_t in gz_zero() and gz_skip() to match state->skip -- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t) -- Revert to Makefile.in from 1.2.3.6 (live with the clutter) -- Fix missing error return in gzflush(), add zlib.h note -- Add *64 functions to zlib.map [Levin] -- Fix signed/unsigned comparison in gz_comp() -- Use SFLAGS when testing shared linking in configure -- Add --64 option to ./configure to use -m64 with gcc -- Fix ./configure --help to correctly name options -- Have make fail if a test fails [Levin] -- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson] -- Remove assembler object files from contrib - -Changes in 1.2.3.7 (24 Jan 2010) -- Always gzopen() with O_LARGEFILE if available -- Fix gzdirect() to work immediately after gzopen() or gzdopen() -- Make gzdirect() more precise when the state changes while reading -- Improve zlib.h documentation in many places -- Catch memory allocation failure in gz_open() -- Complete close operation if seek forward in gzclose_w() fails -- Return Z_ERRNO from gzclose_r() if close() fails -- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL -- Return zero for gzwrite() errors to match zlib.h description -- Return -1 on gzputs() error to match zlib.h description -- Add zconf.in.h to allow recovery from configure modification [Weigelt] -- Fix static library permissions in Makefile.in [Weigelt] -- Avoid warnings in configure tests that hide functionality [Weigelt] -- Add *BSD and DragonFly to Linux case in configure [gentoo 123571] -- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212] -- Avoid access of uninitialized data for first inflateReset2 call [Gomes] -- Keep object files in subdirectories to reduce the clutter somewhat -- Remove default Makefile and zlibdefs.h, add dummy Makefile -- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_ -- Remove zlibdefs.h completely -- modify zconf.h instead - -Changes in 1.2.3.6 (17 Jan 2010) -- Avoid void * arithmetic in gzread.c and gzwrite.c -- Make compilers happier with const char * for gz_error message -- Avoid unused parameter warning in inflate.c -- Avoid signed-unsigned comparison warning in inflate.c -- Indent #pragma's for traditional C -- Fix usage of strwinerror() in glib.c, change to gz_strwinerror() -- Correct email address in configure for system options -- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser] -- Update zlib.map [Brown] -- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok] -- Apply various fixes to CMakeLists.txt [Lowman] -- Add checks on len in gzread() and gzwrite() -- Add error message for no more room for gzungetc() -- Remove zlib version check in gzwrite() -- Defer compression of gzprintf() result until need to -- Use snprintf() in gzdopen() if available -- Remove USE_MMAP configuration determination (only used by minigzip) -- Remove examples/pigz.c (available separately) -- Update examples/gun.c to 1.6 - -Changes in 1.2.3.5 (8 Jan 2010) -- Add space after #if in zutil.h for some compilers -- Fix relatively harmless bug in deflate_fast() [Exarevsky] -- Fix same problem in deflate_slow() -- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown] -- Add deflate_rle() for faster Z_RLE strategy run-length encoding -- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding -- Change name of "write" variable in inffast.c to avoid library collisions -- Fix premature EOF from gzread() in gzio.c [Brown] -- Use zlib header window size if windowBits is 0 in inflateInit2() -- Remove compressBound() call in deflate.c to avoid linking compress.o -- Replace use of errno in gz* with functions, support WinCE [Alves] -- Provide alternative to perror() in minigzip.c for WinCE [Alves] -- Don't use _vsnprintf on later versions of MSVC [Lowman] -- Add CMake build script and input file [Lowman] -- Update contrib/minizip to 1.1 [Svensson, Vollant] -- Moved nintendods directory from contrib to . -- Replace gzio.c with a new set of routines with the same functionality -- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above -- Update contrib/minizip to 1.1b -- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h - -Changes in 1.2.3.4 (21 Dec 2009) -- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility -- Update comments in configure and Makefile.in for default --shared -- Fix test -z's in configure [Marquess] -- Build examplesh and minigzipsh when not testing -- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h -- Import LDFLAGS from the environment in configure -- Fix configure to populate SFLAGS with discovered CFLAGS options -- Adapt make_vms.com to the new Makefile.in [Zinser] -- Add zlib2ansi script for C++ compilation [Marquess] -- Add _FILE_OFFSET_BITS=64 test to make test (when applicable) -- Add AMD64 assembler code for longest match to contrib [Teterin] -- Include options from $SFLAGS when doing $LDSHARED -- Simplify 64-bit file support by introducing z_off64_t type -- Make shared object files in objs directory to work around old Sun cc -- Use only three-part version number for Darwin shared compiles -- Add rc option to ar in Makefile.in for when ./configure not run -- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4* -- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile -- Protect against _FILE_OFFSET_BITS being defined when compiling zlib -- Rename Makefile.in targets allstatic to static and allshared to shared -- Fix static and shared Makefile.in targets to be independent -- Correct error return bug in gz_open() by setting state [Brown] -- Put spaces before ;;'s in configure for better sh compatibility -- Add pigz.c (parallel implementation of gzip) to examples/ -- Correct constant in crc32.c to UL [Leventhal] -- Reject negative lengths in crc32_combine() -- Add inflateReset2() function to work like inflateEnd()/inflateInit2() -- Include sys/types.h for _LARGEFILE64_SOURCE [Brown] -- Correct typo in doc/algorithm.txt [Janik] -- Fix bug in adler32_combine() [Zhu] -- Catch missing-end-of-block-code error in all inflates and in puff - Assures that random input to inflate eventually results in an error -- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/ -- Update ENOUGH and its usage to reflect discovered bounds -- Fix gzerror() error report on empty input file [Brown] -- Add ush casts in trees.c to avoid pedantic runtime errors -- Fix typo in zlib.h uncompress() description [Reiss] -- Correct inflate() comments with regard to automatic header detection -- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays) -- Put new version of gzlog (2.0) in examples with interruption recovery -- Add puff compile option to permit invalid distance-too-far streams -- Add puff TEST command options, ability to read piped input -- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but - _LARGEFILE64_SOURCE not defined -- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart -- Fix deflateSetDictionary() to use all 32K for output consistency -- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h) -- Clear bytes after deflate lookahead to avoid use of uninitialized data -- Change a limit in inftrees.c to be more transparent to Coverity Prevent -- Update win32/zlib.def with exported symbols from zlib.h -- Correct spelling error in zlib.h [Willem] -- Allow Z_BLOCK for deflate() to force a new block -- Allow negative bits in inflatePrime() to delete existing bit buffer -- Add Z_TREES flush option to inflate() to return at end of trees -- Add inflateMark() to return current state information for random access -- Add Makefile for NintendoDS to contrib [Costa] -- Add -w in configure compile tests to avoid spurious warnings [Beucler] -- Fix typos in zlib.h comments for deflateSetDictionary() -- Fix EOF detection in transparent gzread() [Maier] - -Changes in 1.2.3.3 (2 October 2006) -- Make --shared the default for configure, add a --static option -- Add compile option to permit invalid distance-too-far streams -- Add inflateUndermine() function which is required to enable above -- Remove use of "this" variable name for C++ compatibility [Marquess] -- Add testing of shared library in make test, if shared library built -- Use ftello() and fseeko() if available instead of ftell() and fseek() -- Provide two versions of all functions that use the z_off_t type for - binary compatibility -- a normal version and a 64-bit offset version, - per the Large File Support Extension when _LARGEFILE64_SOURCE is - defined; use the 64-bit versions by default when _FILE_OFFSET_BITS - is defined to be 64 -- Add a --uname= option to configure to perhaps help with cross-compiling - -Changes in 1.2.3.2 (3 September 2006) -- Turn off silly Borland warnings [Hay] -- Use off64_t and define _LARGEFILE64_SOURCE when present -- Fix missing dependency on inffixed.h in Makefile.in -- Rig configure --shared to build both shared and static [Teredesai, Truta] -- Remove zconf.in.h and instead create a new zlibdefs.h file -- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant] -- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt] - -Changes in 1.2.3.1 (16 August 2006) -- Add watcom directory with OpenWatcom make files [Daniel] -- Remove #undef of FAR in zconf.in.h for MVS [Fedtke] -- Update make_vms.com [Zinser] -- Use -fPIC for shared build in configure [Teredesai, Nicholson] -- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen] -- Use fdopen() (not _fdopen()) for Interix in zutil.h [BŠck] -- Add some FAQ entries about the contrib directory -- Update the MVS question in the FAQ -- Avoid extraneous reads after EOF in gzio.c [Brown] -- Correct spelling of "successfully" in gzio.c [Randers-Pehrson] -- Add comments to zlib.h about gzerror() usage [Brown] -- Set extra flags in gzip header in gzopen() like deflate() does -- Make configure options more compatible with double-dash conventions - [Weigelt] -- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen] -- Fix uninstall target in Makefile.in [Truta] -- Add pkgconfig support [Weigelt] -- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt] -- Replace set_data_type() with a more accurate detect_data_type() in - trees.c, according to the txtvsbin.txt document [Truta] -- Swap the order of #include and #include "zlib.h" in - gzio.c, example.c and minigzip.c [Truta] -- Shut up annoying VS2005 warnings about standard C deprecation [Rowe, - Truta] (where?) -- Fix target "clean" from win32/Makefile.bor [Truta] -- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe] -- Update zlib www home address in win32/DLL_FAQ.txt [Truta] -- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove] -- Enable browse info in the "Debug" and "ASM Debug" configurations in - the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta] -- Add pkgconfig support [Weigelt] -- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h, - for use in win32/zlib1.rc [Polushin, Rowe, Truta] -- Add a document that explains the new text detection scheme to - doc/txtvsbin.txt [Truta] -- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta] -- Move algorithm.txt into doc/ [Truta] -- Synchronize FAQ with website -- Fix compressBound(), was low for some pathological cases [Fearnley] -- Take into account wrapper variations in deflateBound() -- Set examples/zpipe.c input and output to binary mode for Windows -- Update examples/zlib_how.html with new zpipe.c (also web site) -- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems - that gcc became pickier in 4.0) -- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain - un-versioned, the patch adds versioning only for symbols introduced in - zlib-1.2.0 or later. It also declares as local those symbols which are - not designed to be exported." [Levin] -- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure -- Do not initialize global static by default in trees.c, add a response - NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess] -- Don't use strerror() in gzio.c under WinCE [Yakimov] -- Don't use errno.h in zutil.h under WinCE [Yakimov] -- Move arguments for AR to its usage to allow replacing ar [Marot] -- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson] -- Improve inflateInit() and inflateInit2() documentation -- Fix structure size comment in inflate.h -- Change configure help option from --h* to --help [Santos] - -Changes in 1.2.3 (18 July 2005) -- Apply security vulnerability fixes to contrib/infback9 as well -- Clean up some text files (carriage returns, trailing space) -- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant] - -Changes in 1.2.2.4 (11 July 2005) -- Add inflatePrime() function for starting inflation at bit boundary -- Avoid some Visual C warnings in deflate.c -- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit - compile -- Fix some spelling errors in comments [Betts] -- Correct inflateInit2() error return documentation in zlib.h -- Add zran.c example of compressed data random access to examples - directory, shows use of inflatePrime() -- Fix cast for assignments to strm->state in inflate.c and infback.c -- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] -- Move declarations of gf2 functions to right place in crc32.c [Oberhumer] -- Add cast in trees.c t avoid a warning [Oberhumer] -- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer] -- Update make_vms.com [Zinser] -- Initialize state->write in inflateReset() since copied in inflate_fast() -- Be more strict on incomplete code sets in inflate_table() and increase - ENOUGH and MAXD -- this repairs a possible security vulnerability for - invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for - discovering the vulnerability and providing test cases. -- Add ia64 support to configure for HP-UX [Smith] -- Add error return to gzread() for format or i/o error [Levin] -- Use malloc.h for OS/2 [Necasek] - -Changes in 1.2.2.3 (27 May 2005) -- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile -- Typecast fread() return values in gzio.c [Vollant] -- Remove trailing space in minigzip.c outmode (VC++ can't deal with it) -- Fix crc check bug in gzread() after gzungetc() [Heiner] -- Add the deflateTune() function to adjust internal compression parameters -- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack) -- Remove an incorrect assertion in examples/zpipe.c -- Add C++ wrapper in infback9.h [Donais] -- Fix bug in inflateCopy() when decoding fixed codes -- Note in zlib.h how much deflateSetDictionary() actually uses -- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used) -- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer] -- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer] -- Add gzdirect() function to indicate transparent reads -- Update contrib/minizip [Vollant] -- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer] -- Add casts in crc32.c to avoid warnings [Oberhumer] -- Add contrib/masmx64 [Vollant] -- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant] - -Changes in 1.2.2.2 (30 December 2004) -- Replace structure assignments in deflate.c and inflate.c with zmemcpy to - avoid implicit memcpy calls (portability for no-library compilation) -- Increase sprintf() buffer size in gzdopen() to allow for large numbers -- Add INFLATE_STRICT to check distances against zlib header -- Improve WinCE errno handling and comments [Chang] -- Remove comment about no gzip header processing in FAQ -- Add Z_FIXED strategy option to deflateInit2() to force fixed trees -- Add updated make_vms.com [Coghlan], update README -- Create a new "examples" directory, move gzappend.c there, add zpipe.c, - fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html. -- Add FAQ entry and comments in deflate.c on uninitialized memory access -- Add Solaris 9 make options in configure [Gilbert] -- Allow strerror() usage in gzio.c for STDC -- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer] -- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant] -- Use z_off_t for adler32_combine() and crc32_combine() lengths -- Make adler32() much faster for small len -- Use OS_CODE in deflate() default gzip header - -Changes in 1.2.2.1 (31 October 2004) -- Allow inflateSetDictionary() call for raw inflate -- Fix inflate header crc check bug for file names and comments -- Add deflateSetHeader() and gz_header structure for custom gzip headers -- Add inflateGetheader() to retrieve gzip headers -- Add crc32_combine() and adler32_combine() functions -- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list -- Use zstreamp consistently in zlib.h (inflate_back functions) -- Remove GUNZIP condition from definition of inflate_mode in inflate.h - and in contrib/inflate86/inffast.S [Truta, Anderson] -- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson] -- Update projects/README.projects and projects/visualc6 [Truta] -- Update win32/DLL_FAQ.txt [Truta] -- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta] -- Deprecate Z_ASCII; use Z_TEXT instead [Truta] -- Use a new algorithm for setting strm->data_type in trees.c [Truta] -- Do not define an exit() prototype in zutil.c unless DEBUG defined -- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta] -- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate() -- Fix Darwin build version identification [Peterson] - -Changes in 1.2.2 (3 October 2004) -- Update zlib.h comments on gzip in-memory processing -- Set adler to 1 in inflateReset() to support Java test suite [Walles] -- Add contrib/dotzlib [Ravn] -- Update win32/DLL_FAQ.txt [Truta] -- Update contrib/minizip [Vollant] -- Move contrib/visual-basic.txt to old/ [Truta] -- Fix assembler builds in projects/visualc6/ [Truta] - -Changes in 1.2.1.2 (9 September 2004) -- Update INDEX file -- Fix trees.c to update strm->data_type (no one ever noticed!) -- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown] -- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE) -- Add limited multitasking protection to DYNAMIC_CRC_TABLE -- Add NO_vsnprintf for VMS in zutil.h [Mozilla] -- Don't declare strerror() under VMS [Mozilla] -- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize -- Update contrib/ada [Anisimkov] -- Update contrib/minizip [Vollant] -- Fix configure to not hardcode directories for Darwin [Peterson] -- Fix gzio.c to not return error on empty files [Brown] -- Fix indentation; update version in contrib/delphi/ZLib.pas and - contrib/pascal/zlibpas.pas [Truta] -- Update mkasm.bat in contrib/masmx86 [Truta] -- Update contrib/untgz [Truta] -- Add projects/README.projects [Truta] -- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta] -- Update win32/DLL_FAQ.txt [Truta] -- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta] -- Remove an unnecessary assignment to curr in inftrees.c [Truta] -- Add OS/2 to exe builds in configure [Poltorak] -- Remove err dummy parameter in zlib.h [Kientzle] - -Changes in 1.2.1.1 (9 January 2004) -- Update email address in README -- Several FAQ updates -- Fix a big fat bug in inftrees.c that prevented decoding valid - dynamic blocks with only literals and no distance codes -- - Thanks to "Hot Emu" for the bug report and sample file -- Add a note to puff.c on no distance codes case. - -Changes in 1.2.1 (17 November 2003) -- Remove a tab in contrib/gzappend/gzappend.c -- Update some interfaces in contrib for new zlib functions -- Update zlib version number in some contrib entries -- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta] -- Support shared libraries on Hurd and KFreeBSD [Brown] -- Fix error in NO_DIVIDE option of adler32.c - -Changes in 1.2.0.8 (4 November 2003) -- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas -- Add experimental NO_DIVIDE #define in adler32.c - - Possibly faster on some processors (let me know if it is) -- Correct Z_BLOCK to not return on first inflate call if no wrap -- Fix strm->data_type on inflate() return to correctly indicate EOB -- Add deflatePrime() function for appending in the middle of a byte -- Add contrib/gzappend for an example of appending to a stream -- Update win32/DLL_FAQ.txt [Truta] -- Delete Turbo C comment in README [Truta] -- Improve some indentation in zconf.h [Truta] -- Fix infinite loop on bad input in configure script [Church] -- Fix gzeof() for concatenated gzip files [Johnson] -- Add example to contrib/visual-basic.txt [Michael B.] -- Add -p to mkdir's in Makefile.in [vda] -- Fix configure to properly detect presence or lack of printf functions -- Add AS400 support [Monnerat] -- Add a little Cygwin support [Wilson] - -Changes in 1.2.0.7 (21 September 2003) -- Correct some debug formats in contrib/infback9 -- Cast a type in a debug statement in trees.c -- Change search and replace delimiter in configure from % to # [Beebe] -- Update contrib/untgz to 0.2 with various fixes [Truta] -- Add build support for Amiga [Nikl] -- Remove some directories in old that have been updated to 1.2 -- Add dylib building for Mac OS X in configure and Makefile.in -- Remove old distribution stuff from Makefile -- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X -- Update links in README - -Changes in 1.2.0.6 (13 September 2003) -- Minor FAQ updates -- Update contrib/minizip to 1.00 [Vollant] -- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta] -- Update POSTINC comment for 68060 [Nikl] -- Add contrib/infback9 with deflate64 decoding (unsupported) -- For MVS define NO_vsnprintf and undefine FAR [van Burik] -- Add pragma for fdopen on MVS [van Burik] - -Changes in 1.2.0.5 (8 September 2003) -- Add OF to inflateBackEnd() declaration in zlib.h -- Remember start when using gzdopen in the middle of a file -- Use internal off_t counters in gz* functions to properly handle seeks -- Perform more rigorous check for distance-too-far in inffast.c -- Add Z_BLOCK flush option to return from inflate at block boundary -- Set strm->data_type on return from inflate - - Indicate bits unused, if at block boundary, and if in last block -- Replace size_t with ptrdiff_t in crc32.c, and check for correct size -- Add condition so old NO_DEFLATE define still works for compatibility -- FAQ update regarding the Windows DLL [Truta] -- INDEX update: add qnx entry, remove aix entry [Truta] -- Install zlib.3 into mandir [Wilson] -- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta] -- Adapt the zlib interface to the new DLL convention guidelines [Truta] -- Introduce ZLIB_WINAPI macro to allow the export of functions using - the WINAPI calling convention, for Visual Basic [Vollant, Truta] -- Update msdos and win32 scripts and makefiles [Truta] -- Export symbols by name, not by ordinal, in win32/zlib.def [Truta] -- Add contrib/ada [Anisimkov] -- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta] -- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant] -- Add contrib/masm686 [Truta] -- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm - [Truta, Vollant] -- Update contrib/delphi; rename to contrib/pascal; add example [Truta] -- Remove contrib/delphi2; add a new contrib/delphi [Truta] -- Avoid inclusion of the nonstandard in contrib/iostream, - and fix some method prototypes [Truta] -- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip - [Truta] -- Avoid the use of backslash (\) in contrib/minizip [Vollant] -- Fix file time handling in contrib/untgz; update makefiles [Truta] -- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines - [Vollant] -- Remove contrib/vstudio/vc15_16 [Vollant] -- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta] -- Update README.contrib [Truta] -- Invert the assignment order of match_head and s->prev[...] in - INSERT_STRING [Truta] -- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings - [Truta] -- Compare function pointers with 0, not with NULL or Z_NULL [Truta] -- Fix prototype of syncsearch in inflate.c [Truta] -- Introduce ASMINF macro to be enabled when using an ASM implementation - of inflate_fast [Truta] -- Change NO_DEFLATE to NO_GZCOMPRESS [Truta] -- Modify test_gzio in example.c to take a single file name as a - parameter [Truta] -- Exit the example.c program if gzopen fails [Truta] -- Add type casts around strlen in example.c [Truta] -- Remove casting to sizeof in minigzip.c; give a proper type - to the variable compared with SUFFIX_LEN [Truta] -- Update definitions of STDC and STDC99 in zconf.h [Truta] -- Synchronize zconf.h with the new Windows DLL interface [Truta] -- Use SYS16BIT instead of __32BIT__ to distinguish between - 16- and 32-bit platforms [Truta] -- Use far memory allocators in small 16-bit memory models for - Turbo C [Truta] -- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in - zlibCompileFlags [Truta] -- Cygwin has vsnprintf [Wilson] -- In Windows16, OS_CODE is 0, as in MSDOS [Truta] -- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson] - -Changes in 1.2.0.4 (10 August 2003) -- Minor FAQ updates -- Be more strict when checking inflateInit2's windowBits parameter -- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well -- Add gzip wrapper option to deflateInit2 using windowBits -- Add updated QNX rule in configure and qnx directory [Bonnefoy] -- Make inflate distance-too-far checks more rigorous -- Clean up FAR usage in inflate -- Add casting to sizeof() in gzio.c and minigzip.c - -Changes in 1.2.0.3 (19 July 2003) -- Fix silly error in gzungetc() implementation [Vollant] -- Update contrib/minizip and contrib/vstudio [Vollant] -- Fix printf format in example.c -- Correct cdecl support in zconf.in.h [Anisimkov] -- Minor FAQ updates - -Changes in 1.2.0.2 (13 July 2003) -- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons -- Attempt to avoid warnings in crc32.c for pointer-int conversion -- Add AIX to configure, remove aix directory [Bakker] -- Add some casts to minigzip.c -- Improve checking after insecure sprintf() or vsprintf() calls -- Remove #elif's from crc32.c -- Change leave label to inf_leave in inflate.c and infback.c to avoid - library conflicts -- Remove inflate gzip decoding by default--only enable gzip decoding by - special request for stricter backward compatibility -- Add zlibCompileFlags() function to return compilation information -- More typecasting in deflate.c to avoid warnings -- Remove leading underscore from _Capital #defines [Truta] -- Fix configure to link shared library when testing -- Add some Windows CE target adjustments [Mai] -- Remove #define ZLIB_DLL in zconf.h [Vollant] -- Add zlib.3 [Rodgers] -- Update RFC URL in deflate.c and algorithm.txt [Mai] -- Add zlib_dll_FAQ.txt to contrib [Truta] -- Add UL to some constants [Truta] -- Update minizip and vstudio [Vollant] -- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h -- Expand use of NO_DUMMY_DECL to avoid all dummy structures -- Added iostream3 to contrib [Schwardt] -- Replace rewind() with fseek() for WinCE [Truta] -- Improve setting of zlib format compression level flags - - Report 0 for huffman and rle strategies and for level == 0 or 1 - - Report 2 only for level == 6 -- Only deal with 64K limit when necessary at compile time [Truta] -- Allow TOO_FAR check to be turned off at compile time [Truta] -- Add gzclearerr() function [Souza] -- Add gzungetc() function - -Changes in 1.2.0.1 (17 March 2003) -- Add Z_RLE strategy for run-length encoding [Truta] - - When Z_RLE requested, restrict matches to distance one - - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE -- Correct FASTEST compilation to allow level == 0 -- Clean up what gets compiled for FASTEST -- Incorporate changes to zconf.in.h [Vollant] - - Refine detection of Turbo C need for dummy returns - - Refine ZLIB_DLL compilation - - Include additional header file on VMS for off_t typedef -- Try to use _vsnprintf where it supplants vsprintf [Vollant] -- Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to - write more than 4095 bytes before compression -- Remove unused state from inflateBackEnd() -- Remove exit(0) from minigzip.c, example.c -- Get rid of all those darn tabs -- Add "check" target to Makefile.in that does the same thing as "test" -- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in -- Update contrib/inflate86 [Anderson] -- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant] -- Add msdos and win32 directories with makefiles [Truta] -- More additions and improvements to the FAQ - -Changes in 1.2.0 (9 March 2003) -- New and improved inflate code - - About 20% faster - - Does not allocate 32K window unless and until needed - - Automatically detects and decompresses gzip streams - - Raw inflate no longer needs an extra dummy byte at end - - Added inflateBack functions using a callback interface--even faster - than inflate, useful for file utilities (gzip, zip) - - Added inflateCopy() function to record state for random access on - externally generated deflate streams (e.g. in gzip files) - - More readable code (I hope) -- New and improved crc32() - - About 50% faster, thanks to suggestions from Rodney Brown -- Add deflateBound() and compressBound() functions -- Fix memory leak in deflateInit2() -- Permit setting dictionary for raw deflate (for parallel deflate) -- Fix const declaration for gzwrite() -- Check for some malloc() failures in gzio.c -- Fix bug in gzopen() on single-byte file 0x1f -- Fix bug in gzread() on concatenated file with 0x1f at end of buffer - and next buffer doesn't start with 0x8b -- Fix uncompress() to return Z_DATA_ERROR on truncated input -- Free memory at end of example.c -- Remove MAX #define in trees.c (conflicted with some libraries) -- Fix static const's in deflate.c, gzio.c, and zutil.[ch] -- Declare malloc() and free() in gzio.c if STDC not defined -- Use malloc() instead of calloc() in zutil.c if int big enough -- Define STDC for AIX -- Add aix/ with approach for compiling shared library on AIX -- Add HP-UX support for shared libraries in configure -- Add OpenUNIX support for shared libraries in configure -- Use $cc instead of gcc to build shared library -- Make prefix directory if needed when installing -- Correct Macintosh avoidance of typedef Byte in zconf.h -- Correct Turbo C memory allocation when under Linux -- Use libz.a instead of -lz in Makefile (assure use of compiled library) -- Update configure to check for snprintf or vsnprintf functions and their - return value, warn during make if using an insecure function -- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that - is lost when library is used--resolution is to build new zconf.h -- Documentation improvements (in zlib.h): - - Document raw deflate and inflate - - Update RFCs URL - - Point out that zlib and gzip formats are different - - Note that Z_BUF_ERROR is not fatal - - Document string limit for gzprintf() and possible buffer overflow - - Note requirement on avail_out when flushing - - Note permitted values of flush parameter of inflate() -- Add some FAQs (and even answers) to the FAQ -- Add contrib/inflate86/ for x86 faster inflate -- Add contrib/blast/ for PKWare Data Compression Library decompression -- Add contrib/puff/ simple inflate for deflate format description - -Changes in 1.1.4 (11 March 2002) -- ZFREE was repeated on same allocation on some error conditions. - This creates a security problem described in - http://www.zlib.org/advisory-2002-03-11.txt -- Returned incorrect error (Z_MEM_ERROR) on some invalid data -- Avoid accesses before window for invalid distances with inflate window - less than 32K. -- force windowBits > 8 to avoid a bug in the encoder for a window size - of 256 bytes. (A complete fix will be available in 1.1.5). - -Changes in 1.1.3 (9 July 1998) -- fix "an inflate input buffer bug that shows up on rare but persistent - occasions" (Mark) -- fix gzread and gztell for concatenated .gz files (Didier Le Botlan) -- fix gzseek(..., SEEK_SET) in write mode -- fix crc check after a gzeek (Frank Faubert) -- fix miniunzip when the last entry in a zip file is itself a zip file - (J Lillge) -- add contrib/asm586 and contrib/asm686 (Brian Raiter) - See http://www.muppetlabs.com/~breadbox/software/assembly.html -- add support for Delphi 3 in contrib/delphi (Bob Dellaca) -- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti) -- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren) -- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks) -- added a FAQ file - -- Support gzdopen on Mac with Metrowerks (Jason Linhart) -- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart) -- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young) -- avoid some warnings with Borland C (Tom Tanner) -- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant) -- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant) -- allow several arguments to configure (Tim Mooney, Frodo Looijaard) -- use libdir and includedir in Makefile.in (Tim Mooney) -- support shared libraries on OSF1 V4 (Tim Mooney) -- remove so_locations in "make clean" (Tim Mooney) -- fix maketree.c compilation error (Glenn, Mark) -- Python interface to zlib now in Python 1.5 (Jeremy Hylton) -- new Makefile.riscos (Rich Walker) -- initialize static descriptors in trees.c for embedded targets (Nick Smith) -- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) -- add the OS/2 files in Makefile.in too (Andrew Zabolotny) -- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) -- fix maketree.c to allow clean compilation of inffixed.h (Mark) -- fix parameter check in deflateCopy (Gunther Nikl) -- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) -- Many portability patches by Christian Spieler: - . zutil.c, zutil.h: added "const" for zmem* - . Make_vms.com: fixed some typos - . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists - . msdos/Makefile.msc: remove "default rtl link library" info from obj files - . msdos/Makefile.*: use model-dependent name for the built zlib library - . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc: - new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT) -- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane) -- replace __far with _far for better portability (Christian Spieler, Tom Lane) -- fix test for errno.h in configure (Tim Newsham) - -Changes in 1.1.2 (19 March 98) -- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) - See http://www.winimage.com/zLibDll/unzip.html -- preinitialize the inflate tables for fixed codes, to make the code - completely thread safe (Mark) -- some simplifications and slight speed-up to the inflate code (Mark) -- fix gzeof on non-compressed files (Allan Schrum) -- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) -- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) -- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) -- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) -- do not wrap extern "C" around system includes (Tom Lane) -- mention zlib binding for TCL in README (Andreas Kupries) -- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) -- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) -- allow "configure --prefix $HOME" (Tim Mooney) -- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) -- move Makefile.sas to amiga/Makefile.sas - -Changes in 1.1.1 (27 Feb 98) -- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson) -- remove block truncation heuristic which had very marginal effect for zlib - (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the - compression ratio on some files. This also allows inlining _tr_tally for - matches in deflate_slow. -- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) - -Changes in 1.1.0 (24 Feb 98) -- do not return STREAM_END prematurely in inflate (John Bowler) -- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler) -- compile with -DFASTEST to get compression code optimized for speed only -- in minigzip, try mmap'ing the input file first (Miguel Albrecht) -- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain - on Sun but significant on HP) - -- add a pointer to experimental unzip library in README (Gilles Vollant) -- initialize variable gcc in configure (Chris Herborth) - -Changes in 1.0.9 (17 Feb 1998) -- added gzputs and gzgets functions -- do not clear eof flag in gzseek (Mark Diekhans) -- fix gzseek for files in transparent mode (Mark Diekhans) -- do not assume that vsprintf returns the number of bytes written (Jens Krinke) -- replace EXPORT with ZEXPORT to avoid conflict with other programs -- added compress2 in zconf.h, zlib.def, zlib.dnt -- new asm code from Gilles Vollant in contrib/asm386 -- simplify the inflate code (Mark): - . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new() - . ZALLOC the length list in inflate_trees_fixed() instead of using stack - . ZALLOC the value area for huft_build() instead of using stack - . Simplify Z_FINISH check in inflate() - -- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 -- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) -- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) -- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) -- read_buf buf parameter of type Bytef* instead of charf* -- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) -- do not redeclare unlink in minigzip.c for WIN32 (John Bowler) -- fix check for presence of directories in "make install" (Ian Willis) - -Changes in 1.0.8 (27 Jan 1998) -- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant) -- fix gzgetc and gzputc for big endian systems (Markus Oberhumer) -- added compress2() to allow setting the compression level -- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) -- use constant arrays for the static trees in trees.c instead of computing - them at run time (thanks to Ken Raeburn for this suggestion). To create - trees.h, compile with GEN_TREES_H and run "make test". -- check return code of example in "make test" and display result -- pass minigzip command line options to file_compress -- simplifying code of inflateSync to avoid gcc 2.8 bug - -- support CC="gcc -Wall" in configure -s (QingLong) -- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn) -- fix test for shared library support to avoid compiler warnings -- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant) -- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit) -- do not use fdopen for Metrowerks on Mac (Brad Pettit)) -- add checks for gzputc and gzputc in example.c -- avoid warnings in gzio.c and deflate.c (Andreas Kleinert) -- use const for the CRC table (Ken Raeburn) -- fixed "make uninstall" for shared libraries -- use Tracev instead of Trace in infblock.c -- in example.c use correct compressed length for test_sync -- suppress +vnocompatwarnings in configure for HPUX (not always supported) - -Changes in 1.0.7 (20 Jan 1998) -- fix gzseek which was broken in write mode -- return error for gzseek to negative absolute position -- fix configure for Linux (Chun-Chung Chen) -- increase stack space for MSC (Tim Wegner) -- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant) -- define EXPORTVA for gzprintf (Gilles Vollant) -- added man page zlib.3 (Rick Rodgers) -- for contrib/untgz, fix makedir() and improve Makefile - -- check gzseek in write mode in example.c -- allocate extra buffer for seeks only if gzseek is actually called -- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant) -- add inflateSyncPoint in zconf.h -- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def - -Changes in 1.0.6 (19 Jan 1998) -- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and - gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) -- Fix a deflate bug occurring only with compression level 0 (thanks to - Andy Buckler for finding this one). -- In minigzip, pass transparently also the first byte for .Z files. -- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() -- check Z_FINISH in inflate (thanks to Marc Schluper) -- Implement deflateCopy (thanks to Adam Costello) -- make static libraries by default in configure, add --shared option. -- move MSDOS or Windows specific files to directory msdos -- suppress the notion of partial flush to simplify the interface - (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) -- suppress history buffer provided by application to simplify the interface - (this feature was not implemented anyway in 1.0.4) -- next_in and avail_in must be initialized before calling inflateInit or - inflateInit2 -- add EXPORT in all exported functions (for Windows DLL) -- added Makefile.nt (thanks to Stephen Williams) -- added the unsupported "contrib" directory: - contrib/asm386/ by Gilles Vollant - 386 asm code replacing longest_match(). - contrib/iostream/ by Kevin Ruland - A C++ I/O streams interface to the zlib gz* functions - contrib/iostream2/ by Tyge Lřvset - Another C++ I/O streams interface - contrib/untgz/ by "Pedro A. Aranda Guti\irrez" - A very simple tar.gz file extractor using zlib - contrib/visual-basic.txt by Carlos Rios - How to use compress(), uncompress() and the gz* functions from VB. -- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression - level) in minigzip (thanks to Tom Lane) - -- use const for rommable constants in deflate -- added test for gzseek and gztell in example.c -- add undocumented function inflateSyncPoint() (hack for Paul Mackerras) -- add undocumented function zError to convert error code to string - (for Tim Smithers) -- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. -- Use default memcpy for Symantec MSDOS compiler. -- Add EXPORT keyword for check_func (needed for Windows DLL) -- add current directory to LD_LIBRARY_PATH for "make test" -- create also a link for libz.so.1 -- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura) -- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX) -- added -soname for Linux in configure (Chun-Chung Chen, -- assign numbers to the exported functions in zlib.def (for Windows DLL) -- add advice in zlib.h for best usage of deflateSetDictionary -- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn) -- allow compilation with ANSI keywords only enabled for TurboC in large model -- avoid "versionString"[0] (Borland bug) -- add NEED_DUMMY_RETURN for Borland -- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). -- allow compilation with CC -- defined STDC for OS/2 (David Charlap) -- limit external names to 8 chars for MVS (Thomas Lund) -- in minigzip.c, use static buffers only for 16-bit systems -- fix suffix check for "minigzip -d foo.gz" -- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee) -- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) -- added makelcc.bat for lcc-win32 (Tom St Denis) -- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) -- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. -- check for unistd.h in configure (for off_t) -- remove useless check parameter in inflate_blocks_free -- avoid useless assignment of s->check to itself in inflate_blocks_new -- do not flush twice in gzclose (thanks to Ken Raeburn) -- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h -- use NO_ERRNO_H instead of enumeration of operating systems with errno.h -- work around buggy fclose on pipes for HP/UX -- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson) -- fix configure if CC is already equal to gcc - -Changes in 1.0.5 (3 Jan 98) -- Fix inflate to terminate gracefully when fed corrupted or invalid data -- Use const for rommable constants in inflate -- Eliminate memory leaks on error conditions in inflate -- Removed some vestigial code in inflate -- Update web address in README - -Changes in 1.0.4 (24 Jul 96) -- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF - bit, so the decompressor could decompress all the correct data but went - on to attempt decompressing extra garbage data. This affected minigzip too. -- zlibVersion and gzerror return const char* (needed for DLL) -- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) -- use z_error only for DEBUG (avoid problem with DLLs) - -Changes in 1.0.3 (2 Jul 96) -- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS - small and medium models; this makes the library incompatible with previous - versions for these models. (No effect in large model or on other systems.) -- return OK instead of BUF_ERROR if previous deflate call returned with - avail_out as zero but there is nothing to do -- added memcmp for non STDC compilers -- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) -- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) -- better check for 16-bit mode MSC (avoids problem with Symantec) - -Changes in 1.0.2 (23 May 96) -- added Windows DLL support -- added a function zlibVersion (for the DLL support) -- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model) -- Bytef is define's instead of typedef'd only for Borland C -- avoid reading uninitialized memory in example.c -- mention in README that the zlib format is now RFC1950 -- updated Makefile.dj2 -- added algorithm.doc - -Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] -- fix array overlay in deflate.c which sometimes caused bad compressed data -- fix inflate bug with empty stored block -- fix MSDOS medium model which was broken in 0.99 -- fix deflateParams() which could generated bad compressed data. -- Bytef is define'd instead of typedef'ed (work around Borland bug) -- added an INDEX file -- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), - Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) -- speed up adler32 for modern machines without auto-increment -- added -ansi for IRIX in configure -- static_init_done in trees.c is an int -- define unlink as delete for VMS -- fix configure for QNX -- add configure branch for SCO and HPUX -- avoid many warnings (unused variables, dead assignments, etc...) -- no fdopen for BeOS -- fix the Watcom fix for 32 bit mode (define FAR as empty) -- removed redefinition of Byte for MKWERKS -- work around an MWKERKS bug (incorrect merge of all .h files) - -Changes in 0.99 (27 Jan 96) -- allow preset dictionary shared between compressor and decompressor -- allow compression level 0 (no compression) -- add deflateParams in zlib.h: allow dynamic change of compression level - and compression strategy. -- test large buffers and deflateParams in example.c -- add optional "configure" to build zlib as a shared library -- suppress Makefile.qnx, use configure instead -- fixed deflate for 64-bit systems (detected on Cray) -- fixed inflate_blocks for 64-bit systems (detected on Alpha) -- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2) -- always return Z_BUF_ERROR when deflate() has nothing to do -- deflateInit and inflateInit are now macros to allow version checking -- prefix all global functions and types with z_ with -DZ_PREFIX -- make falloc completely reentrant (inftrees.c) -- fixed very unlikely race condition in ct_static_init -- free in reverse order of allocation to help memory manager -- use zlib-1.0/* instead of zlib/* inside the tar.gz -- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith - -Wconversion -Wstrict-prototypes -Wmissing-prototypes" -- allow gzread on concatenated .gz files -- deflateEnd now returns Z_DATA_ERROR if it was premature -- deflate is finally (?) fully deterministic (no matches beyond end of input) -- Document Z_SYNC_FLUSH -- add uninstall in Makefile -- Check for __cpluplus in zlib.h -- Better test in ct_align for partial flush -- avoid harmless warnings for Borland C++ -- initialize hash_head in deflate.c -- avoid warning on fdopen (gzio.c) for HP cc -Aa -- include stdlib.h for STDC compilers -- include errno.h for Cray -- ignore error if ranlib doesn't exist -- call ranlib twice for NeXTSTEP -- use exec_prefix instead of prefix for libz.a -- renamed ct_* as _tr_* to avoid conflict with applications -- clear z->msg in inflateInit2 before any error return -- initialize opaque in example.c, gzio.c, deflate.c and inflate.c -- fixed typo in zconf.h (_GNUC__ => __GNUC__) -- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode) -- fix typo in Make_vms.com (f$trnlnm -> f$getsyi) -- in fcalloc, normalize pointer if size > 65520 bytes -- don't use special fcalloc for 32 bit Borland C++ -- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... -- use Z_BINARY instead of BINARY -- document that gzclose after gzdopen will close the file -- allow "a" as mode in gzopen. -- fix error checking in gzread -- allow skipping .gz extra-field on pipes -- added reference to Perl interface in README -- put the crc table in FAR data (I dislike more and more the medium model :) -- added get_crc_table -- added a dimension to all arrays (Borland C can't count). -- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast -- guard against multiple inclusion of *.h (for precompiled header on Mac) -- Watcom C pretends to be Microsoft C small model even in 32 bit mode. -- don't use unsized arrays to avoid silly warnings by Visual C++: - warning C4746: 'inflate_mask' : unsized array treated as '__far' - (what's wrong with far data in far model?). -- define enum out of inflate_blocks_state to allow compilation with C++ - -Changes in 0.95 (16 Aug 95) -- fix MSDOS small and medium model (now easier to adapt to any compiler) -- inlined send_bits -- fix the final (:-) bug for deflate with flush (output was correct but - not completely flushed in rare occasions). -- default window size is same for compression and decompression - (it's now sufficient to set MAX_WBITS in zconf.h). -- voidp -> voidpf and voidnp -> voidp (for consistency with other - typedefs and because voidnp was not near in large model). - -Changes in 0.94 (13 Aug 95) -- support MSDOS medium model -- fix deflate with flush (could sometimes generate bad output) -- fix deflateReset (zlib header was incorrectly suppressed) -- added support for VMS -- allow a compression level in gzopen() -- gzflush now calls fflush -- For deflate with flush, flush even if no more input is provided. -- rename libgz.a as libz.a -- avoid complex expression in infcodes.c triggering Turbo C bug -- work around a problem with gcc on Alpha (in INSERT_STRING) -- don't use inline functions (problem with some gcc versions) -- allow renaming of Byte, uInt, etc... with #define. -- avoid warning about (unused) pointer before start of array in deflate.c -- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c -- avoid reserved word 'new' in trees.c - -Changes in 0.93 (25 June 95) -- temporarily disable inline functions -- make deflate deterministic -- give enough lookahead for PARTIAL_FLUSH -- Set binary mode for stdin/stdout in minigzip.c for OS/2 -- don't even use signed char in inflate (not portable enough) -- fix inflate memory leak for segmented architectures - -Changes in 0.92 (3 May 95) -- don't assume that char is signed (problem on SGI) -- Clear bit buffer when starting a stored block -- no memcpy on Pyramid -- suppressed inftest.c -- optimized fill_window, put longest_match inline for gcc -- optimized inflate on stored blocks. -- untabify all sources to simplify patches - -Changes in 0.91 (2 May 95) -- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h -- Document the memory requirements in zconf.h -- added "make install" -- fix sync search logic in inflateSync -- deflate(Z_FULL_FLUSH) now works even if output buffer too short -- after inflateSync, don't scare people with just "lo world" -- added support for DJGPP - -Changes in 0.9 (1 May 95) -- don't assume that zalloc clears the allocated memory (the TurboC bug - was Mark's bug after all :) -- let again gzread copy uncompressed data unchanged (was working in 0.71) -- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented -- added a test of inflateSync in example.c -- moved MAX_WBITS to zconf.h because users might want to change that. -- document explicitly that zalloc(64K) on MSDOS must return a normalized - pointer (zero offset) -- added Makefiles for Microsoft C, Turbo C, Borland C++ -- faster crc32() - -Changes in 0.8 (29 April 95) -- added fast inflate (inffast.c) -- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this - is incompatible with previous versions of zlib which returned Z_OK. -- work around a TurboC compiler bug (bad code for b << 0, see infutil.h) - (actually that was not a compiler bug, see 0.81 above) -- gzread no longer reads one extra byte in certain cases -- In gzio destroy(), don't reference a freed structure -- avoid many warnings for MSDOS -- avoid the ERROR symbol which is used by MS Windows - -Changes in 0.71 (14 April 95) -- Fixed more MSDOS compilation problems :( There is still a bug with - TurboC large model. - -Changes in 0.7 (14 April 95) -- Added full inflate support. -- Simplified the crc32() interface. The pre- and post-conditioning - (one's complement) is now done inside crc32(). WARNING: this is - incompatible with previous versions; see zlib.h for the new usage. - -Changes in 0.61 (12 April 95) -- workaround for a bug in TurboC. example and minigzip now work on MSDOS. - -Changes in 0.6 (11 April 95) -- added minigzip.c -- added gzdopen to reopen a file descriptor as gzFile -- added transparent reading of non-gziped files in gzread. -- fixed bug in gzread (don't read crc as data) -- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). -- don't allocate big arrays in the stack (for MSDOS) -- fix some MSDOS compilation problems - -Changes in 0.5: -- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but - not yet Z_FULL_FLUSH. -- support decompression but only in a single step (forced Z_FINISH) -- added opaque object for zalloc and zfree. -- added deflateReset and inflateReset -- added a variable zlib_version for consistency checking. -- renamed the 'filter' parameter of deflateInit2 as 'strategy'. - Added Z_FILTERED and Z_HUFFMAN_ONLY constants. - -Changes in 0.4: -- avoid "zip" everywhere, use zlib instead of ziplib. -- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush - if compression method == 8. -- added adler32 and crc32 -- renamed deflateOptions as deflateInit2, call one or the other but not both -- added the method parameter for deflateInit2. -- added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting - user-provided history buffer. This is supported only in deflateInit2 - and inflateInit2. - -Changes in 0.3: -- prefix all macro names with Z_ -- use Z_FINISH instead of deflateEnd to finish compression. -- added Z_HUFFMAN_ONLY -- added gzerror() diff --git a/externals/zlib/README b/externals/zlib/README deleted file mode 100644 index d4219bf889f..00000000000 --- a/externals/zlib/README +++ /dev/null @@ -1,115 +0,0 @@ -ZLIB DATA COMPRESSION LIBRARY - -zlib 1.2.5 is a general purpose data compression library. All the code is -thread safe. The data format used by the zlib library is described by RFCs -(Request for Comments) 1950 to 1952 in the files -http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) -and rfc1952.txt (gzip format). - -All functions of the compression library are documented in the file zlib.h -(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example -of the library is given in the file example.c which also tests that the library -is working correctly. Another example is given in the file minigzip.c. The -compression library itself is composed of all source files except example.c and -minigzip.c. - -To compile all files and run the test program, follow the instructions given at -the top of Makefile.in. In short "./configure; make test", and if that goes -well, "make install" should work for most flavors of Unix. For Windows, use one -of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use -make_vms.com. - -Questions about zlib should be sent to , or to Gilles Vollant - for the Windows DLL version. The zlib home page is -http://zlib.net/ . Before reporting a problem, please check this site to -verify that you have the latest version of zlib; otherwise get the latest -version and check whether the problem still exists or not. - -PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. - -Mark Nelson wrote an article about zlib for the Jan. 1997 -issue of Dr. Dobb's Journal; a copy of the article is available at -http://marknelson.us/1997/01/01/zlib-engine/ . - -The changes made in version 1.2.5 are documented in the file ChangeLog. - -Unsupported third party contributions are provided in directory contrib/ . - -zlib is available in Java using the java.util.zip package, documented at -http://java.sun.com/developer/technicalArticles/Programming/compression/ . - -A Perl interface to zlib written by Paul Marquess is available -at CPAN (Comprehensive Perl Archive Network) sites, including -http://search.cpan.org/~pmqs/IO-Compress-Zlib/ . - -A Python interface to zlib written by A.M. Kuchling is -available in Python 1.5 and later versions, see -http://www.python.org/doc/lib/module-zlib.html . - -zlib is built into tcl: http://wiki.tcl.tk/4610 . - -An experimental package to read and write files in .zip format, written on top -of zlib by Gilles Vollant , is available in the -contrib/minizip directory of zlib. - - -Notes for some targets: - -- For Windows DLL versions, please see win32/DLL_FAQ.txt - -- For 64-bit Irix, deflate.c must be compiled without any optimization. With - -O, one libpng test fails. The test works in 32 bit mode (with the -n32 - compiler flag). The compiler bug has been reported to SGI. - -- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works - when compiled with cc. - -- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is - necessary to get gzprintf working correctly. This is done by configure. - -- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with - other compilers. Use "make test" to check your compiler. - -- gzdopen is not supported on RISCOS or BEOS. - -- For PalmOs, see http://palmzlib.sourceforge.net/ - - -Acknowledgments: - - The deflate format used by zlib was defined by Phil Katz. The deflate and - zlib specifications were written by L. Peter Deutsch. Thanks to all the - people who reported problems and suggested various improvements in zlib; they - are too numerous to cite here. - -Copyright notice: - - (C) 1995-2010 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -If you use the zlib library in a product, we would appreciate *not* receiving -lengthy legal documents to sign. The sources are provided for free but without -warranty of any kind. The library has been entirely written by Jean-loup -Gailly and Mark Adler; it does not include third-party code. - -If you redistribute modified sources, we would appreciate that you include in -the file ChangeLog history information documenting your changes. Please read -the FAQ for more information on the distribution of modified source versions. diff --git a/externals/zlib/win/VC90/zlib.vcproj b/externals/zlib/win/VC90/zlib.vcproj index 1b63254aa23..8ffe8163edc 100644 --- a/externals/zlib/win/VC90/zlib.vcproj +++ b/externals/zlib/win/VC90/zlib.vcproj @@ -21,8 +21,8 @@ @@ -45,14 +45,15 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" + PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" + MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" EnableFunctionLevelLinking="true" + EnableEnhancedInstructionSet="0" RuntimeTypeInfo="true" UsePrecompiledHeader="0" - PrecompiledHeaderFile=".\zlib__$(PlatformName)_$(ConfigurationName)\zlib.pch" + PrecompiledHeaderFile="" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" @@ -89,8 +90,8 @@ @@ -114,14 +115,15 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" + PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" + MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" EnableFunctionLevelLinking="true" + EnableEnhancedInstructionSet="0" RuntimeTypeInfo="true" UsePrecompiledHeader="0" - PrecompiledHeaderFile=".\zlib__$(PlatformName)_$(ConfigurationName)\zlib.pch" + PrecompiledHeaderFile="" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" @@ -158,8 +160,8 @@ @@ -182,12 +184,14 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" + PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" + StringPooling="true" RuntimeLibrary="2" + EnableFunctionLevelLinking="true" EnableEnhancedInstructionSet="1" RuntimeTypeInfo="true" UsePrecompiledHeader="0" - PrecompiledHeaderFile=".\zlib__$(PlatformName)_$(ConfigurationName)\zlib.pch" + PrecompiledHeaderFile="" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" @@ -205,6 +209,7 @@ @@ -249,12 +254,14 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" + PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE" + StringPooling="true" RuntimeLibrary="2" + EnableFunctionLevelLinking="true" EnableEnhancedInstructionSet="0" RuntimeTypeInfo="true" UsePrecompiledHeader="0" - PrecompiledHeaderFile=".\zlib__$(PlatformName)_$(ConfigurationName)\zlib.pch" + PrecompiledHeaderFile="" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql new file mode 100644 index 00000000000..459b3fa1468 --- /dev/null +++ b/sql/base/auth_database.sql @@ -0,0 +1,254 @@ +-- MySQL dump 10.11 +-- +-- Host: localhost Database: realmd +-- ------------------------------------------------------ +-- Server version 5.0.45-Debian_1ubuntu3.1-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `account_access` +-- + +DROP TABLE IF EXISTS `account_access`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_access` ( + `id` int(11) unsigned NOT NULL, + `gmlevel` tinyint(3) unsigned NOT NULL, + `RealmID` int(11) NOT NULL default '-1', + PRIMARY KEY (`id`,`RealmID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_access` +-- + +LOCK TABLES `account_access` WRITE; +/*!40000 ALTER TABLE `account_access` DISABLE KEYS */; +/*!40000 ALTER TABLE `account_access` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account` +-- + +DROP TABLE IF EXISTS `account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account` ( + `id` int(11) unsigned NOT NULL auto_increment COMMENT 'Identifier', + `username` varchar(32) NOT NULL default '', + `sha_pass_hash` varchar(40) NOT NULL default '', + `sessionkey` longtext, + `v` longtext, + `s` longtext, + `email` text, + `joindate` timestamp NOT NULL default CURRENT_TIMESTAMP, + `last_ip` varchar(30) NOT NULL default '127.0.0.1', + `failed_logins` int(11) unsigned NOT NULL default '0', + `locked` tinyint(3) unsigned NOT NULL default '0', + `last_login` timestamp NOT NULL default '0000-00-00 00:00:00', + `online` tinyint(4) NOT NULL default '0', + `expansion` tinyint(3) unsigned NOT NULL default '2', + `mutetime` bigint(40) unsigned NOT NULL default '0', + `locale` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `idx_username` (`username`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='Account System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account` +-- + +LOCK TABLES `account` WRITE; +/*!40000 ALTER TABLE `account` DISABLE KEYS */; +/*!40000 ALTER TABLE `account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_banned` +-- + +DROP TABLE IF EXISTS `account_banned`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_banned` ( + `id` int(11) NOT NULL default '0' COMMENT 'Account id', + `bandate` bigint(40) NOT NULL default '0', + `unbandate` bigint(40) NOT NULL default '0', + `bannedby` varchar(50) NOT NULL, + `banreason` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL default '1', + PRIMARY KEY (`id`,`bandate`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Ban List'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_banned` +-- + +LOCK TABLES `account_banned` WRITE; +/*!40000 ALTER TABLE `account_banned` DISABLE KEYS */; +/*!40000 ALTER TABLE `account_banned` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ip_banned` +-- + +DROP TABLE IF EXISTS `ip_banned`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ip_banned` ( + `ip` varchar(32) NOT NULL default '127.0.0.1', + `bandate` bigint(40) NOT NULL, + `unbandate` bigint(40) NOT NULL, + `bannedby` varchar(50) NOT NULL default '[Console]', + `banreason` varchar(255) NOT NULL default 'no reason', + PRIMARY KEY (`ip`,`bandate`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Banned IPs'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ip_banned` +-- + +LOCK TABLES `ip_banned` WRITE; +/*!40000 ALTER TABLE `ip_banned` DISABLE KEYS */; +/*!40000 ALTER TABLE `ip_banned` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `logs` +-- + +DROP TABLE IF EXISTS `logs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `logs` ( + `time` int(14) NOT NULL, + `realm` int(4) NOT NULL, + `type` int(4) NOT NULL, + `string` text +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `logs` +-- + +LOCK TABLES `logs` WRITE; +/*!40000 ALTER TABLE `logs` DISABLE KEYS */; +/*!40000 ALTER TABLE `logs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `realmcharacters` +-- + +DROP TABLE IF EXISTS `realmcharacters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `realmcharacters` ( + `realmid` int(11) unsigned NOT NULL default '0', + `acctid` bigint(20) unsigned NOT NULL, + `numchars` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`realmid`,`acctid`), + KEY (acctid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm Character Tracker'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `realmcharacters` +-- + +LOCK TABLES `realmcharacters` WRITE; +/*!40000 ALTER TABLE `realmcharacters` DISABLE KEYS */; +/*!40000 ALTER TABLE `realmcharacters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `realmlist` +-- + +DROP TABLE IF EXISTS `realmlist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `realmlist` ( + `id` int(11) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL default '', + `address` varchar(32) NOT NULL default '127.0.0.1', + `port` int(11) NOT NULL default '8085', + `icon` tinyint(3) unsigned NOT NULL default '0', + `color` tinyint(3) unsigned NOT NULL default '2', + `timezone` tinyint(3) unsigned NOT NULL default '0', + `allowedSecurityLevel` tinyint(3) unsigned NOT NULL default '0', + `population` float unsigned NOT NULL default '0', + `gamebuild` int(11) unsigned NOT NULL default '12340', + PRIMARY KEY (`id`), + UNIQUE KEY `idx_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `realmlist` +-- + +LOCK TABLES `realmlist` WRITE; +/*!40000 ALTER TABLE `realmlist` DISABLE KEYS */; +INSERT INTO `realmlist` (`id`,`name`,`address`,`port`,`icon`,`color`,`timezone`,`allowedSecurityLevel`,`population`,`gamebuild`) VALUES +(1,'Trinity','127.0.0.1',8085,1,0,1,0,0,12340); +/*!40000 ALTER TABLE `realmlist` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `uptime` +-- + +DROP TABLE IF EXISTS `uptime`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `uptime` ( + `realmid` int(11) unsigned NOT NULL, + `starttime` bigint(20) unsigned NOT NULL default '0', + `startstring` varchar(64) NOT NULL default '', + `uptime` bigint(20) unsigned NOT NULL default '0', + `maxplayers` smallint(5) unsigned NOT NULL default '0', + `revision` VARCHAR(255) NOT NULL DEFAULT 'Trinitycore', + PRIMARY KEY (`realmid`,`starttime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `uptime` +-- + +LOCK TABLES `uptime` WRITE; +/*!40000 ALTER TABLE `uptime` DISABLE KEYS */; +/*!40000 ALTER TABLE `uptime` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2008-01-10 11:37:06 + +-- Updated on 2010-01-29 23:21:45 GMT+1 diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql new file mode 100644 index 00000000000..6ec8cd968e9 --- /dev/null +++ b/sql/base/characters_database.sql @@ -0,0 +1,1991 @@ +-- MySQL dump 10.11 +-- +-- Host: localhost Database: characters +-- ------------------------------------------------------ +-- Server version 5.0.45-Debian_1ubuntu3.1-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `account_data` +-- + +DROP TABLE IF EXISTS `account_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_data` ( + `account` int(11) unsigned NOT NULL default '0', + `type` int(11) unsigned NOT NULL default '0', + `time` bigint(11) unsigned NOT NULL default '0', + `data` longblob NOT NULL, + PRIMARY KEY (`account`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_data` +-- + +LOCK TABLES `account_data` WRITE; +/*!40000 ALTER TABLE `account_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `account_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `addons` +-- + +DROP TABLE IF EXISTS `addons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `addons` ( + `name` varchar(120) NOT NULL default '', + `crc` int(32) unsigned NOT NULL default '0', + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Addons'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `addons` +-- + +LOCK TABLES `addons` WRITE; +/*!40000 ALTER TABLE `addons` DISABLE KEYS */; +/*!40000 ALTER TABLE `addons` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `arena_team` +-- + +DROP TABLE IF EXISTS `arena_team`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `arena_team` ( + `arenateamid` int(10) unsigned NOT NULL default '0', + `name` char(255) NOT NULL, + `captainguid` int(10) unsigned NOT NULL default '0', + `type` tinyint(3) unsigned NOT NULL default '0', + `BackgroundColor` int(10) unsigned NOT NULL default '0', + `EmblemStyle` int(10) unsigned NOT NULL default '0', + `EmblemColor` int(10) unsigned NOT NULL default '0', + `BorderStyle` int(10) unsigned NOT NULL default '0', + `BorderColor` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`arenateamid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `arena_team` +-- + +LOCK TABLES `arena_team` WRITE; +/*!40000 ALTER TABLE `arena_team` DISABLE KEYS */; +/*!40000 ALTER TABLE `arena_team` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `arena_team_member` +-- + +DROP TABLE IF EXISTS `arena_team_member`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `arena_team_member` ( + `arenateamid` int(10) unsigned NOT NULL default '0', + `guid` int(10) unsigned NOT NULL default '0', + `played_week` int(10) unsigned NOT NULL default '0', + `wons_week` int(10) unsigned NOT NULL default '0', + `played_season` int(10) unsigned NOT NULL default '0', + `wons_season` int(10) unsigned NOT NULL default '0', + `personal_rating` int(10) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`arenateamid`,`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `arena_team_member` +-- + +LOCK TABLES `arena_team_member` WRITE; +/*!40000 ALTER TABLE `arena_team_member` DISABLE KEYS */; +/*!40000 ALTER TABLE `arena_team_member` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `arena_team_stats` +-- + +DROP TABLE IF EXISTS `arena_team_stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `arena_team_stats` ( + `arenateamid` int(10) unsigned NOT NULL default '0', + `rating` int(10) unsigned NOT NULL default '0', + `games` int(10) unsigned NOT NULL default '0', + `wins` int(10) unsigned NOT NULL default '0', + `played` int(10) unsigned NOT NULL default '0', + `wins2` int(10) unsigned NOT NULL default '0', + `rank` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`arenateamid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `arena_team_stats` +-- + +LOCK TABLES `arena_team_stats` WRITE; +/*!40000 ALTER TABLE `arena_team_stats` DISABLE KEYS */; +/*!40000 ALTER TABLE `arena_team_stats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `auctionhouse` +-- + +DROP TABLE IF EXISTS `auctionhouse`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `auctionhouse` ( + `id` int(11) unsigned NOT NULL default '0', + `auctioneerguid` int(11) unsigned NOT NULL default '0', + `itemguid` int(11) unsigned NOT NULL default '0', + `item_template` int(11) unsigned NOT NULL default '0' COMMENT 'Item Identifier', + `itemowner` int(11) unsigned NOT NULL default '0', + `buyoutprice` int(11) NOT NULL default '0', + `time` bigint(40) NOT NULL default '0', + `buyguid` int(11) unsigned NOT NULL default '0', + `lastbid` int(11) NOT NULL default '0', + `startbid` int(11) NOT NULL default '0', + `deposit` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `item_guid` (`itemguid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `auctionhouse` +-- + +LOCK TABLES `auctionhouse` WRITE; +/*!40000 ALTER TABLE `auctionhouse` DISABLE KEYS */; +/*!40000 ALTER TABLE `auctionhouse` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `auctionhousebot` +-- + +DROP TABLE IF EXISTS `auctionhousebot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `auctionhousebot` ( + `auctionhouse` int(11) NOT NULL default '0' COMMENT 'mapID of the auctionhouse.', + `name` char(25) default NULL COMMENT 'Text name of the auctionhouse.', + `minitems` int(11) default '0' COMMENT 'This is the minimum number of items you want to keep in the auction house. a 0 here will make it the same as the maximum.', + `maxitems` int(11) default '0' COMMENT 'This is the number of items you want to keep in the auction house.', + `percentgreytradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Grey Trade Goods auction items', + `percentwhitetradegoods` int(11) default '27' COMMENT 'Sets the percentage of the White Trade Goods auction items', + `percentgreentradegoods` int(11) default '12' COMMENT 'Sets the percentage of the Green Trade Goods auction items', + `percentbluetradegoods` int(11) default '10' COMMENT 'Sets the percentage of the Blue Trade Goods auction items', + `percentpurpletradegoods` int(11) default '1' COMMENT 'Sets the percentage of the Purple Trade Goods auction items', + `percentorangetradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Orange Trade Goods auction items', + `percentyellowtradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Yellow Trade Goods auction items', + `percentgreyitems` int(11) default '0' COMMENT 'Sets the percentage of the non trade Grey auction items', + `percentwhiteitems` int(11) default '10' COMMENT 'Sets the percentage of the non trade White auction items', + `percentgreenitems` int(11) default '30' COMMENT 'Sets the percentage of the non trade Green auction items', + `percentblueitems` int(11) default '8' COMMENT 'Sets the percentage of the non trade Blue auction items', + `percentpurpleitems` int(11) default '2' COMMENT 'Sets the percentage of the non trade Purple auction items', + `percentorangeitems` int(11) default '0' COMMENT 'Sets the percentage of the non trade Orange auction items', + `percentyellowitems` int(11) default '0' COMMENT 'Sets the percentage of the non trade Yellow auction items', + `minpricegrey` int(11) default '100' COMMENT 'Minimum price of Grey items (percentage).', + `maxpricegrey` int(11) default '150' COMMENT 'Maximum price of Grey items (percentage).', + `minpricewhite` int(11) default '150' COMMENT 'Minimum price of White items (percentage).', + `maxpricewhite` int(11) default '250' COMMENT 'Maximum price of White items (percentage).', + `minpricegreen` int(11) default '800' COMMENT 'Minimum price of Green items (percentage).', + `maxpricegreen` int(11) default '1400' COMMENT 'Maximum price of Green items (percentage).', + `minpriceblue` int(11) default '1250' COMMENT 'Minimum price of Blue items (percentage).', + `maxpriceblue` int(11) default '1750' COMMENT 'Maximum price of Blue items (percentage).', + `minpricepurple` int(11) default '2250' COMMENT 'Minimum price of Purple items (percentage).', + `maxpricepurple` int(11) default '4550' COMMENT 'Maximum price of Purple items (percentage).', + `minpriceorange` int(11) default '3250' COMMENT 'Minimum price of Orange items (percentage).', + `maxpriceorange` int(11) default '5550' COMMENT 'Maximum price of Orange items (percentage).', + `minpriceyellow` int(11) default '5250' COMMENT 'Minimum price of Yellow items (percentage).', + `maxpriceyellow` int(11) default '6550' COMMENT 'Maximum price of Yellow items (percentage).', + `minbidpricegrey` int(11) default '70' COMMENT 'Starting bid price of Grey items as a percentage of the randomly chosen buyout price. Default: 70', + `maxbidpricegrey` int(11) default '100' COMMENT 'Starting bid price of Grey items as a percentage of the randomly chosen buyout price. Default: 100', + `minbidpricewhite` int(11) default '70' COMMENT 'Starting bid price of White items as a percentage of the randomly chosen buyout price. Default: 70', + `maxbidpricewhite` int(11) default '100' COMMENT 'Starting bid price of White items as a percentage of the randomly chosen buyout price. Default: 100', + `minbidpricegreen` int(11) default '80' COMMENT 'Starting bid price of Green items as a percentage of the randomly chosen buyout price. Default: 80', + `maxbidpricegreen` int(11) default '100' COMMENT 'Starting bid price of Green items as a percentage of the randomly chosen buyout price. Default: 100', + `minbidpriceblue` int(11) default '75' COMMENT 'Starting bid price of Blue items as a percentage of the randomly chosen buyout price. Default: 75', + `maxbidpriceblue` int(11) default '100' COMMENT 'Starting bid price of Blue items as a percentage of the randomly chosen buyout price. Default: 100', + `minbidpricepurple` int(11) default '80' COMMENT 'Starting bid price of Purple items as a percentage of the randomly chosen buyout price. Default: 80', + `maxbidpricepurple` int(11) default '100' COMMENT 'Starting bid price of Purple items as a percentage of the randomly chosen buyout price. Default: 100', + `minbidpriceorange` int(11) default '80' COMMENT 'Starting bid price of Orange items as a percentage of the randomly chosen buyout price. Default: 80', + `maxbidpriceorange` int(11) default '100' COMMENT 'Starting bid price of Orange items as a percentage of the randomly chosen buyout price. Default: 100', + `minbidpriceyellow` int(11) default '80' COMMENT 'Starting bid price of Yellow items as a percentage of the randomly chosen buyout price. Default: 80', + `maxbidpriceyellow` int(11) default '100' COMMENT 'Starting bid price of Yellow items as a percentage of the randomly chosen buyout price. Default: 100', + `maxstackgrey` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `maxstackwhite` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `maxstackgreen` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `maxstackblue` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `maxstackpurple` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `maxstackorange` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `maxstackyellow` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.', + `buyerpricegrey` int(11) default '1' COMMENT 'Multiplier to vendorprice when buying grey items from auctionhouse', + `buyerpricewhite` int(11) default '3' COMMENT 'Multiplier to vendorprice when buying white items from auctionhouse', + `buyerpricegreen` int(11) default '5' COMMENT 'Multiplier to vendorprice when buying green items from auctionhouse', + `buyerpriceblue` int(11) default '12' COMMENT 'Multiplier to vendorprice when buying blue items from auctionhouse', + `buyerpricepurple` int(11) default '15' COMMENT 'Multiplier to vendorprice when buying purple items from auctionhouse', + `buyerpriceorange` int(11) default '20' COMMENT 'Multiplier to vendorprice when buying orange items from auctionhouse', + `buyerpriceyellow` int(11) default '22' COMMENT 'Multiplier to vendorprice when buying yellow items from auctionhouse', + `buyerbiddinginterval` int(11) default '1' COMMENT 'Interval how frequently AHB bids on each AH. Time in minutes', + `buyerbidsperinterval` int(11) default '1' COMMENT 'number of bids to put in per bidding interval', + PRIMARY KEY (`auctionhouse`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `auctionhousebot` +-- + +INSERT INTO `auctionhousebot`(`auctionhouse`,`name`,`minitems`,`maxitems`,`percentgreytradegoods`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentorangetradegoods`,`percentyellowtradegoods`,`percentgreyitems`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`percentorangeitems`,`percentyellowitems`,`minpricegrey`,`maxpricegrey`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minpriceorange`,`maxpriceorange`,`minpriceyellow`,`maxpriceyellow`,`minbidpricegrey`,`maxbidpricegrey`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`minbidpriceorange`,`maxbidpriceorange`,`minbidpriceyellow`,`maxbidpriceyellow`,`maxstackgrey`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`maxstackorange`,`maxstackyellow`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerpriceorange`,`buyerpriceyellow`,`buyerbiddinginterval`,`buyerbidsperinterval`) VALUES +(2,'Alliance',0,0,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,3,5,12,15,20,22,1,1), +(6,'Horde',0,0,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,3,5,12,15,20,22,1,1), +(7,'Neutral',0,0,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,3,5,12,15,20,22,1,1); + +-- +-- Table structure for table `bugreport` +-- + +DROP TABLE IF EXISTS `bugreport`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bugreport` ( + `id` int(11) NOT NULL auto_increment COMMENT 'Identifier', + `type` longtext NOT NULL default '', + `content` longtext NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Debug System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `bugreport` +-- + +LOCK TABLES `bugreport` WRITE; +/*!40000 ALTER TABLE `bugreport` DISABLE KEYS */; +/*!40000 ALTER TABLE `bugreport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `channels` +-- + +DROP TABLE IF EXISTS `channels`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `channels` ( + `m_name` text NOT NULL, + `m_team` int(10) unsigned NOT NULL, + `m_announce` tinyint(1) unsigned NOT NULL default '0', + `m_moderate` tinyint(1) unsigned NOT NULL default '0', + `m_public` tinyint(1) unsigned NOT NULL default '1', + `m_password` text, + `BannedList` longtext, + PRIMARY KEY (`m_name`(10),`m_team`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Channel System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `channels` +-- + +LOCK TABLES `channels` WRITE; +/*!40000 ALTER TABLE `channels` DISABLE KEYS */; +/*!40000 ALTER TABLE `channels` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `characters` +-- + +DROP TABLE IF EXISTS `characters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `characters` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `account` int(11) unsigned NOT NULL default '0' COMMENT 'Account Identifier', + `name` varchar(12) NOT NULL default '', + `race` tinyint(3) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `gender` TINYINT UNSIGNED NOT NULL default '0', + `level` TINYINT UNSIGNED NOT NULL default '0', + `xp` INT UNSIGNED NOT NULL default '0', + `money` INT UNSIGNED NOT NULL default '0', + `playerBytes` INT UNSIGNED NOT NULL default '0', + `playerBytes2` INT UNSIGNED NOT NULL default '0', + `playerFlags` INT UNSIGNED NOT NULL default '0', + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + `map` int(11) unsigned NOT NULL default '0' COMMENT 'Map Identifier', + `instance_id` int(11) unsigned NOT NULL default '0', + `dungeon_difficulty` tinyint(1) unsigned NOT NULL default '0', + `orientation` float NOT NULL default '0', + `taximask` longtext, + `online` tinyint(3) unsigned NOT NULL default '0', + `cinematic` tinyint(3) unsigned NOT NULL default '0', + `totaltime` int(11) unsigned NOT NULL default '0', + `leveltime` int(11) unsigned NOT NULL default '0', + `logout_time` bigint(20) unsigned NOT NULL default '0', + `is_logout_resting` tinyint(3) unsigned NOT NULL default '0', + `rest_bonus` float NOT NULL default '0', + `resettalents_cost` int(11) unsigned NOT NULL default '0', + `resettalents_time` bigint(20) unsigned NOT NULL default '0', + `trans_x` float NOT NULL default '0', + `trans_y` float NOT NULL default '0', + `trans_z` float NOT NULL default '0', + `trans_o` float NOT NULL default '0', + `transguid` bigint(20) unsigned NOT NULL default '0', + `extra_flags` int(11) unsigned NOT NULL default '0', + `stable_slots` tinyint(1) unsigned NOT NULL default '0', + `at_login` int(11) unsigned NOT NULL default '0', + `zone` int(11) unsigned NOT NULL default '0', + `death_expire_time` bigint(20) unsigned NOT NULL default '0', + `taxi_path` text, + `arenaPoints` int(10) unsigned NOT NULL default'0', + `totalHonorPoints` int(10) unsigned NOT NULL default'0', + `todayHonorPoints` int(10) unsigned NOT NULL default'0', + `yesterdayHonorPoints` int(10) unsigned NOT NULL default'0', + `totalKills` int(10) unsigned NOT NULL default'0', + `todayKills` smallint(5) unsigned NOT NULL default'0', + `yesterdayKills` smallint(5) unsigned NOT NULL default'0', + `chosenTitle` int(10) unsigned NOT NULL default'0', + `knownCurrencies` bigint(20) unsigned NOT NULL default'0', + `watchedFaction` bigint(10) unsigned NOT NULL default'0', + `drunk` smallint(5) unsigned NOT NULL default'0', + `health` int(10) unsigned NOT NULL default'0', + `power1` int(10) unsigned NOT NULL default'0', + `power2` int(10) unsigned NOT NULL default'0', + `power3` int(10) unsigned NOT NULL default'0', + `power4` int(10) unsigned NOT NULL default'0', + `power5` int(10) unsigned NOT NULL default'0', + `power6` int(10) unsigned NOT NULL default'0', + `power7` int(10) unsigned NOT NULL default'0', + `latency` int(11) unsigned NOT NULL default '0', + `speccount` tinyint(3) unsigned NOT NULL default 1, + `activespec` tinyint(3) unsigned NOT NULL default 0, + `exploredZones` longtext, + `equipmentCache` longtext, + `ammoId` int(10) UNSIGNED NOT NULL default '0', + `knownTitles` longtext, + `actionBars` tinyint(3) UNSIGNED NOT NULL default '0', + PRIMARY KEY (`guid`), + KEY `idx_account` (`account`), + KEY `idx_online` (`online`), + KEY `idx_name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `characters` +-- + +LOCK TABLES `characters` WRITE; +/*!40000 ALTER TABLE `characters` DISABLE KEYS */; +/*!40000 ALTER TABLE `characters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_account_data` +-- + +DROP TABLE IF EXISTS `character_account_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_account_data` ( + `guid` int(11) unsigned NOT NULL default '0', + `type` int(11) unsigned NOT NULL default '0', + `time` bigint(11) unsigned NOT NULL default '0', + `data` longblob NOT NULL, + PRIMARY KEY (`guid`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_account_data` +-- + +LOCK TABLES `character_account_data` WRITE; +/*!40000 ALTER TABLE `character_account_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_account_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_achievement` +-- + +DROP TABLE IF EXISTS `character_achievement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_achievement` ( + `guid` int(11) unsigned NOT NULL, + `achievement` int(11) unsigned NOT NULL, + `date` bigint(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`achievement`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_achievement` +-- + +LOCK TABLES `character_achievement` WRITE; +/*!40000 ALTER TABLE `character_achievement` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_achievement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_achievement_progress` +-- + +DROP TABLE IF EXISTS `character_achievement_progress`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_achievement_progress` ( + `guid` int(11) unsigned NOT NULL, + `criteria` int(11) unsigned NOT NULL, + `counter` int(11) unsigned NOT NULL, + `date` bigint(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`criteria`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_achievement_progress` +-- + +LOCK TABLES `character_achievement_progress` WRITE; +/*!40000 ALTER TABLE `character_achievement_progress` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_achievement_progress` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_action` +-- + +DROP TABLE IF EXISTS `character_action`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_action` ( + `guid` int(11) unsigned NOT NULL default '0', + `spec` tinyint(3) unsigned NOT NULL default '0', + `button` tinyint(3) unsigned NOT NULL default '0', + `action` int(11) unsigned NOT NULL default '0', + `type` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`spec`,`button`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_action` +-- + +LOCK TABLES `character_action` WRITE; +/*!40000 ALTER TABLE `character_action` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_action` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_aura` +-- + +DROP TABLE IF EXISTS `character_aura`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_aura` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `caster_guid` bigint(20) unsigned NOT NULL default '0' COMMENT 'Full Global Unique Identifier', + `spell` int(11) unsigned NOT NULL default '0', + `effect_mask` tinyint(3) unsigned NOT NULL default '0', + `recalculate_mask` tinyint(3) unsigned NOT NULL default '0', + `stackcount` tinyint(3) unsigned NOT NULL default '1', + `amount0` int(11) NOT NULL default '0', + `amount1` int(11) NOT NULL default '0', + `amount2` int(11) NOT NULL default '0', + `base_amount0` int(11) NOT NULL default '0', + `base_amount1` int(11) NOT NULL default '0', + `base_amount2` int(11) NOT NULL default '0', + `maxduration` int(11) NOT NULL default '0', + `remaintime` int(11) NOT NULL default '0', + `remaincharges` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`caster_guid`,`spell`,`effect_mask`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_aura` +-- + +LOCK TABLES `character_aura` WRITE; +/*!40000 ALTER TABLE `character_aura` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_aura` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_battleground_data` +-- + +DROP TABLE IF EXISTS `character_battleground_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_battleground_data` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `instance_id` int(11) unsigned NOT NULL default '0', + `team` int(11) unsigned NOT NULL default '0', + `join_x` float NOT NULL default '0', + `join_y` float NOT NULL default '0', + `join_z` float NOT NULL default '0', + `join_o` float NOT NULL default '0', + `join_map` int(11) NOT NULL default '0', + `taxi_start` int(11) NOT NULL default '0', + `taxi_end` int(11) NOT NULL default '0', + `mount_spell` int(11) NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_battleground_data` +-- + +LOCK TABLES `character_battleground_data` WRITE; +/*!40000 ALTER TABLE `character_battleground_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_battleground_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_battleground_random` +-- + +DROP TABLE IF EXISTS `character_battleground_random`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_battleground_random` ( + `guid` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_battleground_random` +-- + +LOCK TABLES `character_battleground_random` WRITE; +/*!40000 ALTER TABLE `character_battleground_random` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_battleground_random` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_declinedname` +-- + +DROP TABLE IF EXISTS `character_declinedname`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_declinedname` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `genitive` varchar(15) NOT NULL default '', + `dative` varchar(15) NOT NULL default '', + `accusative` varchar(15) NOT NULL default '', + `instrumental` varchar(15) NOT NULL default '', + `prepositional` varchar(15) NOT NULL default '', + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_declinedname` +-- + +LOCK TABLES `character_declinedname` WRITE; +/*!40000 ALTER TABLE `character_declinedname` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_declinedname` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_equipmentsets` +-- + +DROP TABLE IF EXISTS `character_equipmentsets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_equipmentsets` ( + `guid` int(11) NOT NULL default '0', + `setguid` bigint(20) NOT NULL auto_increment, + `setindex` tinyint(4) NOT NULL default '0', + `name` varchar(100) NOT NULL, + `iconname` varchar(100) NOT NULL, + `item0` int(11) NOT NULL default '0', + `item1` int(11) NOT NULL default '0', + `item2` int(11) NOT NULL default '0', + `item3` int(11) NOT NULL default '0', + `item4` int(11) NOT NULL default '0', + `item5` int(11) NOT NULL default '0', + `item6` int(11) NOT NULL default '0', + `item7` int(11) NOT NULL default '0', + `item8` int(11) NOT NULL default '0', + `item9` int(11) NOT NULL default '0', + `item10` int(11) NOT NULL default '0', + `item11` int(11) NOT NULL default '0', + `item12` int(11) NOT NULL default '0', + `item13` int(11) NOT NULL default '0', + `item14` int(11) NOT NULL default '0', + `item15` int(11) NOT NULL default '0', + `item16` int(11) NOT NULL default '0', + `item17` int(11) NOT NULL default '0', + `item18` int(11) NOT NULL default '0', + PRIMARY KEY (`setguid`), + UNIQUE KEY `idx_set` (`guid`,`setguid`,`setindex`), + INDEX `Idx_setindex` (`setindex`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_equipmentsets` +-- + +LOCK TABLES `character_equipmentsets` WRITE; +/*!40000 ALTER TABLE `character_equipmentsets` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_equipmentsets` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_gifts` +-- + +DROP TABLE IF EXISTS `character_gifts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_gifts` ( + `guid` int(20) unsigned NOT NULL default '0', + `item_guid` int(11) unsigned NOT NULL default '0', + `entry` int(20) unsigned NOT NULL default '0', + `flags` int(20) unsigned NOT NULL default '0', + PRIMARY KEY (`item_guid`), + KEY `idx_guid` (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_gifts` +-- + +LOCK TABLES `character_gifts` WRITE; +/*!40000 ALTER TABLE `character_gifts` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_gifts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_glyphs` +-- + +DROP TABLE IF EXISTS `character_glyphs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_glyphs` ( + `guid` int(11) unsigned NOT NULL, + `spec` tinyint(3) unsigned NOT NULL DEFAULT '0', + `glyph1` int(11) unsigned NOT NULL DEFAULT '0', + `glyph2` int(11) unsigned DEFAULT '0', + `glyph3` int(11) unsigned DEFAULT '0', + `glyph4` int(11) unsigned DEFAULT '0', + `glyph5` int(11) unsigned DEFAULT '0', + `glyph6` int(11) unsigned DEFAULT '0', + PRIMARY KEY (`guid`,`spec`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_glyphs` +-- + +LOCK TABLES `character_glyphs` WRITE; +/*!40000 ALTER TABLE `character_glyphs` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_glyphs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_homebind` +-- + +DROP TABLE IF EXISTS `character_homebind`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_homebind` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `map` int(11) unsigned NOT NULL default '0' COMMENT 'Map Identifier', + `zone` int(11) unsigned NOT NULL default '0' COMMENT 'Zone Identifier', + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_homebind` +-- + +LOCK TABLES `character_homebind` WRITE; +/*!40000 ALTER TABLE `character_homebind` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_homebind` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_instance` +-- + +DROP TABLE IF EXISTS `character_instance`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_instance` ( + `guid` int(11) unsigned NOT NULL default '0', + `instance` int(11) unsigned NOT NULL default '0', + `permanent` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`instance`), + KEY `instance` (`instance`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_instance` +-- + +LOCK TABLES `character_instance` WRITE; +/*!40000 ALTER TABLE `character_instance` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_instance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_inventory` +-- + +DROP TABLE IF EXISTS `character_inventory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_inventory` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `bag` int(11) unsigned NOT NULL default '0', + `slot` tinyint(3) unsigned NOT NULL default '0', + `item` int(11) unsigned NOT NULL default '0' COMMENT 'Item Global Unique Identifier', + `item_template` int(11) unsigned NOT NULL default '0' COMMENT 'Item Identifier', + PRIMARY KEY (`item`), + KEY `idx_guid` (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_inventory` +-- + +LOCK TABLES `character_inventory` WRITE; +/*!40000 ALTER TABLE `character_inventory` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_inventory` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_pet` +-- + +DROP TABLE IF EXISTS `character_pet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_pet` ( + `id` int(11) unsigned NOT NULL default '0', + `entry` int(11) unsigned NOT NULL default '0', + `owner` int(11) unsigned NOT NULL default '0', + `modelid` int(11) unsigned default '0', + `CreatedBySpell` int(11) unsigned NOT NULL default '0', + `PetType` tinyint(3) unsigned NOT NULL default '0', + `level` int(11) unsigned NOT NULL default '1', + `exp` int(11) unsigned NOT NULL default '0', + `Reactstate` tinyint(1) unsigned NOT NULL default '0', + `name` varchar(100) default 'Pet', + `renamed` tinyint(1) unsigned NOT NULL default '0', + `slot` int(11) unsigned NOT NULL default '0', + `curhealth` int(11) unsigned NOT NULL default '1', + `curmana` int(11) unsigned NOT NULL default '0', + `curhappiness` int(11) unsigned NOT NULL default '0', + `savetime` bigint(20) unsigned NOT NULL default '0', + `resettalents_cost` int(11) unsigned NOT NULL default '0', + `resettalents_time` bigint(20) unsigned NOT NULL default '0', + `abdata` longtext, + PRIMARY KEY (`id`), + KEY `owner` (`owner`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_pet` +-- + +LOCK TABLES `character_pet` WRITE; +/*!40000 ALTER TABLE `character_pet` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_pet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_pet_declinedname` +-- + +DROP TABLE IF EXISTS `character_pet_declinedname`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_pet_declinedname` ( + `id` int(11) unsigned NOT NULL default '0', + `owner` int(11) unsigned NOT NULL default '0', + `genitive` varchar(12) NOT NULL default '', + `dative` varchar(12) NOT NULL default '', + `accusative` varchar(12) NOT NULL default '', + `instrumental` varchar(12) NOT NULL default '', + `prepositional` varchar(12) NOT NULL default '', + PRIMARY KEY (`id`), + KEY owner_key (`owner`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_pet_declinedname` +-- + +LOCK TABLES `character_pet_declinedname` WRITE; +/*!40000 ALTER TABLE `character_pet_declinedname` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_pet_declinedname` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_queststatus` +-- + +DROP TABLE IF EXISTS `character_queststatus`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_queststatus` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `quest` int(11) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + `status` int(11) unsigned NOT NULL default '0', + `rewarded` tinyint(1) unsigned NOT NULL default '0', + `explored` tinyint(1) unsigned NOT NULL default '0', + `timer` bigint(20) unsigned NOT NULL default '0', + `mobcount1` int(11) unsigned NOT NULL default '0', + `mobcount2` int(11) unsigned NOT NULL default '0', + `mobcount3` int(11) unsigned NOT NULL default '0', + `mobcount4` int(11) unsigned NOT NULL default '0', + `itemcount1` int(11) unsigned NOT NULL default '0', + `itemcount2` int(11) unsigned NOT NULL default '0', + `itemcount3` int(11) unsigned NOT NULL default '0', + `itemcount4` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`quest`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_queststatus` +-- + +LOCK TABLES `character_queststatus` WRITE; +/*!40000 ALTER TABLE `character_queststatus` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_queststatus` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_queststatus_daily` +-- + +DROP TABLE IF EXISTS `character_queststatus_daily`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_queststatus_daily` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `quest` int(11) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + `time` bigint(20) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`quest`), + KEY `idx_guid` (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_queststatus_daily` +-- + +LOCK TABLES `character_queststatus_daily` WRITE; +/*!40000 ALTER TABLE `character_queststatus_daily` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_queststatus_daily` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_queststatus_weekly` +-- + +DROP TABLE IF EXISTS `character_queststatus_weekly`; +CREATE TABLE `character_queststatus_weekly` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `quest` int(11) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`guid`,`quest`), + KEY `idx_guid` (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; + +-- +-- Dumping data for table `character_queststatus_weekly` +-- + +LOCK TABLES `character_queststatus_weekly` WRITE; +/*!40000 ALTER TABLE `character_queststatus_weekly` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_queststatus_weekly` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_reputation` +-- + +DROP TABLE IF EXISTS `character_reputation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_reputation` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `faction` int(11) unsigned NOT NULL default '0', + `standing` int(11) NOT NULL default '0', + `flags` int(11) NOT NULL default '0', + PRIMARY KEY (`guid`,`faction`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_reputation` +-- + +LOCK TABLES `character_reputation` WRITE; +/*!40000 ALTER TABLE `character_reputation` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_reputation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_skills` +-- + +DROP TABLE IF EXISTS `character_skills`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_skills` ( + `guid` int(11) unsigned NOT NULL COMMENT 'Global Unique Identifier', + `skill` mediumint(9) unsigned NOT NULL, + `value` mediumint(9) unsigned NOT NULL, + `max` mediumint(9) unsigned NOT NULL, + PRIMARY KEY (`guid`,`skill`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_skills` +-- + +LOCK TABLES `character_skills` WRITE; +/*!40000 ALTER TABLE `character_skills` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_skills` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_social` +-- + +DROP TABLE IF EXISTS `character_social`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_social` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Character Global Unique Identifier', + `friend` int(11) unsigned NOT NULL default '0' COMMENT 'Friend Global Unique Identifier', + `flags` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Friend Flags', + `note` varchar(48) NOT NULL DEFAULT '' COMMENT 'Friend Note', + PRIMARY KEY (`guid`,`friend`,`flags`), + KEY `guid` (`guid`), + KEY `friend` (`friend`), + KEY `guid_flags` (`guid`,`flags`), + KEY `friend_flags` (`friend`,`flags`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_social` +-- + +LOCK TABLES `character_social` WRITE; +/*!40000 ALTER TABLE `character_social` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_social` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_spell` +-- + +DROP TABLE IF EXISTS `character_spell`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_spell` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier', + `active` tinyint(3) unsigned NOT NULL default '1', + `disabled` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`spell`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_spell` +-- + +LOCK TABLES `character_spell` WRITE; +/*!40000 ALTER TABLE `character_spell` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_spell_cooldown` +-- + +DROP TABLE IF EXISTS `character_spell_cooldown`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_spell_cooldown` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier, Low part', + `spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier', + `item` int(11) unsigned NOT NULL default '0' COMMENT 'Item Identifier', + `time` bigint(20) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`spell`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_spell_cooldown` +-- + +LOCK TABLES `character_spell_cooldown` WRITE; +/*!40000 ALTER TABLE `character_spell_cooldown` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_spell_cooldown` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_stats` +-- + +DROP TABLE IF EXISTS `character_stats`; +CREATE TABLE `character_stats` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier, Low part', + `maxhealth` int(10) UNSIGNED NOT NULL default '0', + `maxpower1` int(10) UNSIGNED NOT NULL default '0', + `maxpower2` int(10) UNSIGNED NOT NULL default '0', + `maxpower3` int(10) UNSIGNED NOT NULL default '0', + `maxpower4` int(10) UNSIGNED NOT NULL default '0', + `maxpower5` int(10) UNSIGNED NOT NULL default '0', + `maxpower6` int(10) UNSIGNED NOT NULL default '0', + `maxpower7` int(10) UNSIGNED NOT NULL default '0', + `strength` int(10) UNSIGNED NOT NULL default '0', + `agility` int(10) UNSIGNED NOT NULL default '0', + `stamina` int(10) UNSIGNED NOT NULL default '0', + `intellect` int(10) UNSIGNED NOT NULL default '0', + `spirit` int(10) UNSIGNED NOT NULL default '0', + `armor` int(10) UNSIGNED NOT NULL default '0', + `resHoly` int(10) UNSIGNED NOT NULL default '0', + `resFire` int(10) UNSIGNED NOT NULL default '0', + `resNature` int(10) UNSIGNED NOT NULL default '0', + `resFrost` int(10) UNSIGNED NOT NULL default '0', + `resShadow` int(10) UNSIGNED NOT NULL default '0', + `resArcane` int(10) UNSIGNED NOT NULL default '0', + `blockPct` float UNSIGNED NOT NULL default '0', + `dodgePct` float UNSIGNED NOT NULL default '0', + `parryPct` float UNSIGNED NOT NULL default '0', + `critPct` float UNSIGNED NOT NULL default '0', + `rangedCritPct` float UNSIGNED NOT NULL default '0', + `spellCritPct` float UNSIGNED NOT NULL default '0', + `attackPower` int(10) UNSIGNED NOT NULL default '0', + `rangedAttackPower` int(10) UNSIGNED NOT NULL default '0', + `spellPower` int(10) UNSIGNED NOT NULL default '0', + + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `character_stats` +-- + +LOCK TABLES `character_stats` WRITE; +/*!40000 ALTER TABLE `character_stats` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_stats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_talent` +-- + +DROP TABLE IF EXISTS `character_talent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_talent` ( + `guid` int(11) unsigned NOT NULL, + `spell` int(11) unsigned NOT NULL, + `spec` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`,`spell`,`spec`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_talent` +-- + +LOCK TABLES `character_talent` WRITE; +/*!40000 ALTER TABLE `character_talent` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_talent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `character_tutorial` +-- + +DROP TABLE IF EXISTS `character_tutorial`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_tutorial` ( + `account` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Account Identifier', + `realmid` int(11) unsigned NOT NULL default '0' COMMENT 'Realm Identifier', + `tut0` int(11) unsigned NOT NULL default '0', + `tut1` int(11) unsigned NOT NULL default '0', + `tut2` int(11) unsigned NOT NULL default '0', + `tut3` int(11) unsigned NOT NULL default '0', + `tut4` int(11) unsigned NOT NULL default '0', + `tut5` int(11) unsigned NOT NULL default '0', + `tut6` int(11) unsigned NOT NULL default '0', + `tut7` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`account`,`realmid`), + KEY acc_key (`account`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_tutorial` +-- + +LOCK TABLES `character_tutorial` WRITE; +/*!40000 ALTER TABLE `character_tutorial` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_tutorial` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `corpse` +-- + +DROP TABLE IF EXISTS `corpse`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `corpse` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `player` int(11) unsigned NOT NULL default '0' COMMENT 'Character Global Unique Identifier', + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + `orientation` float NOT NULL default '0', + `zone` int(11) unsigned NOT NULL default '38' COMMENT 'Zone Identifier', + `map` int(11) unsigned NOT NULL default '0' COMMENT 'Map Identifier', + `phaseMask` smallint(5) unsigned NOT NULL default '1', + `data` longtext, + `time` bigint(20) unsigned NOT NULL default '0', + `corpse_type` tinyint(3) unsigned NOT NULL default '0', + `instance` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`), + KEY `idx_type` (`corpse_type`), + KEY `instance` (`instance`), + INDEX `Idx_player`(`player`), + INDEX `Idx_time`(`time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Death System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `corpse` +-- + +LOCK TABLES `corpse` WRITE; +/*!40000 ALTER TABLE `corpse` DISABLE KEYS */; +/*!40000 ALTER TABLE `corpse` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_condition_save` +-- + +DROP TABLE IF EXISTS `game_event_condition_save`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_condition_save` ( + `event_id` mediumint(8) unsigned NOT NULL, + `condition_id` mediumint(8) unsigned NOT NULL default '0', + `done` float default '0', + PRIMARY KEY (`event_id`,`condition_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_condition_save` +-- + +LOCK TABLES `game_event_condition_save` WRITE; +/*!40000 ALTER TABLE `game_event_condition_save` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_condition_save` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_save` +-- + +DROP TABLE IF EXISTS `game_event_save`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_save` ( + `event_id` mediumint(8) unsigned NOT NULL, + `state` tinyint(3) unsigned NOT NULL default '1', + `next_start` timestamp NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (`event_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_save` +-- + +LOCK TABLES `game_event_save` WRITE; +/*!40000 ALTER TABLE `game_event_save` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_save` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gm_tickets` +-- + +DROP TABLE IF EXISTS `gm_tickets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gm_tickets` ( + `guid` int(10) NOT NULL auto_increment, + `playerGuid` int(11) unsigned NOT NULL default '0', + `name` varchar(15) NOT NULL, + `message` text NOT NULL, + `createtime` int(10) NOT NULL default '0', + `map` int NOT NULL DEFAULT '0', + `posX` float NOT NULL DEFAULT '0', + `posY` float NOT NULL DEFAULT '0', + `posZ` float NOT NULL DEFAULT '0', + `timestamp` int(10) NOT NULL default '0', + `closed` int(10) NOT NULL default '0', + `assignedto` int(10) NOT NULL default '0', + `comment` text NOT NULL, + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gm_tickets` +-- + +LOCK TABLES `gm_tickets` WRITE; +/*!40000 ALTER TABLE `gm_tickets` DISABLE KEYS */; +/*!40000 ALTER TABLE `gm_tickets` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `group_instance` +-- + +DROP TABLE IF EXISTS `group_instance`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `group_instance` ( + `guid` int(11) unsigned NOT NULL default '0', + `instance` int(11) unsigned NOT NULL default '0', + `permanent` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`instance`), + KEY `instance` (`instance`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `group_instance` +-- + +LOCK TABLES `group_instance` WRITE; +/*!40000 ALTER TABLE `group_instance` DISABLE KEYS */; +/*!40000 ALTER TABLE `group_instance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `group_member` +-- + +DROP TABLE IF EXISTS `group_member`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `group_member` ( + `guid` int(11) unsigned NOT NULL, + `memberGuid` int(11) unsigned NOT NULL, + `memberFlags` tinyint(2) unsigned NOT NULL, + `subgroup` smallint(6) unsigned NOT NULL, + PRIMARY KEY (`memberGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Groups'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `group_member` +-- + +LOCK TABLES `group_member` WRITE; +/*!40000 ALTER TABLE `group_member` DISABLE KEYS */; +/*!40000 ALTER TABLE `group_member` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `groups` +-- + +DROP TABLE IF EXISTS `groups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `groups` ( + `guid` int(11) unsigned NOT NULL, + `leaderGuid` int(11) unsigned NOT NULL, + `lootMethod` tinyint(4) unsigned NOT NULL, + `looterGuid` int(11) unsigned NOT NULL, + `lootThreshold` tinyint(4) unsigned NOT NULL, + `icon1` int(11) unsigned NOT NULL, + `icon2` int(11) unsigned NOT NULL, + `icon3` int(11) unsigned NOT NULL, + `icon4` int(11) unsigned NOT NULL, + `icon5` int(11) unsigned NOT NULL, + `icon6` int(11) unsigned NOT NULL, + `icon7` int(11) unsigned NOT NULL, + `icon8` int(11) unsigned NOT NULL, + `groupType` mediumint(8) unsigned NOT NULL, + `difficulty` tinyint(3) unsigned NOT NULL default '0', + `raiddifficulty` int(11) UNSIGNED NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Groups'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `groups` +-- + +LOCK TABLES `groups` WRITE; +/*!40000 ALTER TABLE `groups` DISABLE KEYS */; +/*!40000 ALTER TABLE `groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild` +-- + +DROP TABLE IF EXISTS `guild`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild` ( + `guildid` int(6) unsigned NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `leaderguid` int(6) unsigned NOT NULL default '0', + `EmblemStyle` int(5) NOT NULL default '0', + `EmblemColor` int(5) NOT NULL default '0', + `BorderStyle` int(5) NOT NULL default '0', + `BorderColor` int(5) NOT NULL default '0', + `BackgroundColor` int(5) NOT NULL default '0', + `info` text NOT NULL, + `motd` varchar(255) NOT NULL default '', + `createdate` bigint(20) NOT NULL default '0', + `BankMoney` bigint(20) NOT NULL default '0', + PRIMARY KEY (`guildid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild` +-- + +LOCK TABLES `guild` WRITE; +/*!40000 ALTER TABLE `guild` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_bank_eventlog` +-- + +DROP TABLE IF EXISTS `guild_bank_eventlog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_bank_eventlog` ( + `guildid` int(11) unsigned NOT NULL default '0' COMMENT 'Guild Identificator', + `LogGuid` int(11) unsigned NOT NULL default '0' COMMENT 'Log record identificator - auxiliary column', + `TabId` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Guild bank TabId', + `EventType` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Event type', + `PlayerGuid` int(11) unsigned NOT NULL default '0', + `ItemOrMoney` int(11) unsigned NOT NULL default '0', + `ItemStackCount` tinyint(3) unsigned NOT NULL default '0', + `DestTabId` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Destination Tab Id', + `TimeStamp` bigint(20) unsigned NOT NULL default '0' COMMENT 'Event UNIX time', + PRIMARY KEY (`guildid`,`LogGuid`,`TabId`), + KEY `guildid_key` (`guildid`), + INDEX `Idx_PlayerGuid`(`PlayerGuid`), + INDEX `Idx_LogGuid`(`LogGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_bank_eventlog` +-- + +LOCK TABLES `guild_bank_eventlog` WRITE; +/*!40000 ALTER TABLE `guild_bank_eventlog` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_bank_eventlog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_bank_item` +-- + +DROP TABLE IF EXISTS `guild_bank_item`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_bank_item` ( + `guildid` int(11) unsigned NOT NULL default '0', + `TabId` tinyint(1) unsigned NOT NULL default '0', + `SlotId` tinyint(3) unsigned NOT NULL default '0', + `item_guid` int(11) unsigned NOT NULL default '0', + `item_entry` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guildid`,`tabid`,`slotid`), + KEY `guildid_key` (`guildid`), + INDEX `Idx_item_guid`(`item_guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_bank_item` +-- + +LOCK TABLES `guild_bank_item` WRITE; +/*!40000 ALTER TABLE `guild_bank_item` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_bank_item` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_bank_right` +-- + +DROP TABLE IF EXISTS `guild_bank_right`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_bank_right` ( + `guildid` int(11) unsigned NOT NULL default '0', + `TabId` tinyint(1) unsigned NOT NULL default '0', + `rid` int(11) unsigned NOT NULL default '0', + `gbright` tinyint(3) unsigned NOT NULL default '0', + `SlotPerDay` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guildid`,`TabId`,`rid`), + KEY `guildid_key` (`guildid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_bank_right` +-- + +LOCK TABLES `guild_bank_right` WRITE; +/*!40000 ALTER TABLE `guild_bank_right` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_bank_right` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_bank_tab` +-- + +DROP TABLE IF EXISTS `guild_bank_tab`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_bank_tab` ( + `guildid` int(11) unsigned NOT NULL default '0', + `TabId` tinyint(1) unsigned NOT NULL default '0', + `TabName` varchar(100) NOT NULL default '', + `TabIcon` varchar(100) NOT NULL default '', + `TabText` text, + PRIMARY KEY (`guildid`,`TabId`), + KEY `guildid_key` (`guildid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_bank_tab` +-- + +LOCK TABLES `guild_bank_tab` WRITE; +/*!40000 ALTER TABLE `guild_bank_tab` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_bank_tab` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_eventlog` +-- + +DROP TABLE IF EXISTS `guild_eventlog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_eventlog` ( + `guildid` int(11) NOT NULL COMMENT 'Guild Identificator', + `LogGuid` int(11) NOT NULL COMMENT 'Log record identificator - auxiliary column', + `EventType` tinyint(1) NOT NULL COMMENT 'Event type', + `PlayerGuid1` int(11) NOT NULL COMMENT 'Player 1', + `PlayerGuid2` int(11) NOT NULL COMMENT 'Player 2', + `NewRank` tinyint(2) NOT NULL COMMENT 'New rank(in case promotion/demotion)', + `TimeStamp` bigint(20) NOT NULL COMMENT 'Event UNIX time', + PRIMARY KEY (`guildid`, `LogGuid`), + INDEX `Idx_PlayerGuid1`(`PlayerGuid1`), + INDEX `Idx_PlayerGuid2`(`PlayerGuid2`), + INDEX `Idx_LogGuid`(`LogGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT 'Guild Eventlog'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_eventlog` +-- + +LOCK TABLES `guild_eventlog` WRITE; +/*!40000 ALTER TABLE `guild_eventlog` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_eventlog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_member` +-- + +DROP TABLE IF EXISTS `guild_member`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_member` ( + `guildid` int(6) unsigned NOT NULL default '0', + `guid` int(11) unsigned NOT NULL default '0', + `rank` tinyint(2) unsigned NOT NULL default '0', + `pnote` varchar(255) NOT NULL default '', + `offnote` varchar(255) NOT NULL default '', + `BankResetTimeMoney` int(11) unsigned NOT NULL default '0', + `BankRemMoney` int(11) unsigned NOT NULL default '0', + `BankResetTimeTab0` int(11) unsigned NOT NULL default '0', + `BankRemSlotsTab0` int(11) unsigned NOT NULL default '0', + `BankResetTimeTab1` int(11) unsigned NOT NULL default '0', + `BankRemSlotsTab1` int(11) unsigned NOT NULL default '0', + `BankResetTimeTab2` int(11) unsigned NOT NULL default '0', + `BankRemSlotsTab2` int(11) unsigned NOT NULL default '0', + `BankResetTimeTab3` int(11) unsigned NOT NULL default '0', + `BankRemSlotsTab3` int(11) unsigned NOT NULL default '0', + `BankResetTimeTab4` int(11) unsigned NOT NULL default '0', + `BankRemSlotsTab4` int(11) unsigned NOT NULL default '0', + `BankResetTimeTab5` int(11) unsigned NOT NULL default '0', + `BankRemSlotsTab5` int(11) unsigned NOT NULL default '0', + KEY `guildid_key` (`guildid`), + KEY `guildid_rank_key` (`guildid`,`rank`), + UNIQUE KEY `guid_key` (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Guild System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_member` +-- + +LOCK TABLES `guild_member` WRITE; +/*!40000 ALTER TABLE `guild_member` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_member` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_rank` +-- + +DROP TABLE IF EXISTS `guild_rank`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_rank` ( + `guildid` int(6) unsigned NOT NULL default '0', + `rid` int(11) unsigned NOT NULL, + `rname` varchar(255) NOT NULL default '', + `rights` int(3) unsigned NOT NULL default '0', + `BankMoneyPerDay` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guildid`,`rid`), + INDEX `Idx_rid`(`rid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_rank` +-- + +LOCK TABLES `guild_rank` WRITE; +/*!40000 ALTER TABLE `guild_rank` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_rank` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `instance` +-- + +DROP TABLE IF EXISTS `instance`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `instance` ( + `id` int(11) unsigned NOT NULL default '0', + `map` int(11) unsigned NOT NULL default '0', + `resettime` bigint(40) NOT NULL default '0', + `difficulty` tinyint(1) unsigned NOT NULL default '0', + `data` longtext, + PRIMARY KEY (`id`), + KEY `map` (`map`), + KEY `resettime` (`resettime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `instance` +-- + +LOCK TABLES `instance` WRITE; +/*!40000 ALTER TABLE `instance` DISABLE KEYS */; +/*!40000 ALTER TABLE `instance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `instance_reset` +-- + +DROP TABLE IF EXISTS `instance_reset`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `instance_reset` ( + `mapid` int(11) unsigned NOT NULL default '0', + `difficulty` tinyint(1) unsigned NOT NULL default '0', + `resettime` bigint(40) NOT NULL default '0', + PRIMARY KEY (`mapid`,`difficulty`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `instance_reset` +-- + +LOCK TABLES `instance_reset` WRITE; +/*!40000 ALTER TABLE `instance_reset` DISABLE KEYS */; +/*!40000 ALTER TABLE `instance_reset` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_instance` +-- + +DROP TABLE IF EXISTS `item_instance`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_instance` ( + `guid` int(11) unsigned NOT NULL default '0', + `owner_guid` int(11) unsigned NOT NULL default '0', + `data` longtext, + `text` longtext, + PRIMARY KEY (`guid`), + KEY `idx_owner_guid` (`owner_guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Item System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_instance` +-- + +LOCK TABLES `item_instance` WRITE; +/*!40000 ALTER TABLE `item_instance` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_instance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_refund_instance` +-- + +DROP TABLE IF EXISTS `item_refund_instance`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_refund_instance` ( + `item_guid` int(11) unsigned NOT NULL COMMENT 'Item GUID', + `player_guid` int(11) unsigned NOT NULL COMMENT 'Player GUID', + `paidMoney` int(11) unsigned NOT NULL DEFAULT '0', + `paidExtendedCost` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`item_guid`,`player_guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Item Refund System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_refund_instance` +-- + +LOCK TABLES `item_refund_instance` WRITE; +/*!40000 ALTER TABLE `item_refund_instance` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_refund_instance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mail` +-- + +DROP TABLE IF EXISTS `mail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mail` ( + `id` int(11) unsigned NOT NULL default '0' COMMENT 'Identifier', + `messageType` tinyint(3) unsigned NOT NULL default '0', + `stationery` tinyint(3) NOT NULL default '41', + `mailTemplateId` mediumint(8) unsigned NOT NULL default '0', + `sender` int(11) unsigned NOT NULL default '0' COMMENT 'Character Global Unique Identifier', + `receiver` int(11) unsigned NOT NULL default '0' COMMENT 'Character Global Unique Identifier', + `subject` longtext, + `body` longtext, + `has_items` tinyint(3) unsigned NOT NULL default '0', + `expire_time` bigint(40) NOT NULL default '0', + `deliver_time` bigint(40) NOT NULL default '0', + `money` int(11) unsigned NOT NULL default '0', + `cod` int(11) unsigned NOT NULL default '0', + `checked` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `idx_receiver` (`receiver`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Mail System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mail` +-- + +LOCK TABLES `mail` WRITE; +/*!40000 ALTER TABLE `mail` DISABLE KEYS */; +/*!40000 ALTER TABLE `mail` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mail_items` +-- + +DROP TABLE IF EXISTS `mail_items`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mail_items` ( + `mail_id` int(11) NOT NULL default '0', + `item_guid` int(11) NOT NULL default '0', + `item_template` int(11) NOT NULL default '0', + `receiver` int(11) unsigned NOT NULL default '0' COMMENT 'Character Global Unique Identifier', + PRIMARY KEY (`mail_id`,`item_guid`), + KEY `idx_receiver` (`receiver`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mail_items` +-- + +LOCK TABLES `mail_items` WRITE; +/*!40000 ALTER TABLE `mail_items` DISABLE KEYS */; +/*!40000 ALTER TABLE `mail_items` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_aura` +-- + +DROP TABLE IF EXISTS `pet_aura`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pet_aura` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `caster_guid` bigint(20) unsigned NOT NULL default '0' COMMENT 'Full Global Unique Identifier', + `spell` int(11) unsigned NOT NULL default '0', + `effect_mask` tinyint(3) unsigned NOT NULL default '0', + `recalculate_mask` tinyint(3) unsigned NOT NULL default '0', + `stackcount` tinyint(3) unsigned NOT NULL default '1', + `amount0` int(11) NOT NULL default '0', + `amount1` int(11) NOT NULL default '0', + `amount2` int(11) NOT NULL default '0', + `base_amount0` int(11) NOT NULL default '0', + `base_amount1` int(11) NOT NULL default '0', + `base_amount2` int(11) NOT NULL default '0', + `maxduration` int(11) NOT NULL default '0', + `remaintime` int(11) NOT NULL default '0', + `remaincharges` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`spell`,`effect_mask`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pet_aura` +-- + +LOCK TABLES `pet_aura` WRITE; +/*!40000 ALTER TABLE `pet_aura` DISABLE KEYS */; +/*!40000 ALTER TABLE `pet_aura` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_spell` +-- + +DROP TABLE IF EXISTS `pet_spell`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pet_spell` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier', + `active` int(11) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`spell`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pet_spell` +-- + +LOCK TABLES `pet_spell` WRITE; +/*!40000 ALTER TABLE `pet_spell` DISABLE KEYS */; +/*!40000 ALTER TABLE `pet_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_spell_cooldown` +-- + +DROP TABLE IF EXISTS `pet_spell_cooldown`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pet_spell_cooldown` ( + `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier, Low part', + `spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier', + `time` bigint(20) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`spell`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pet_spell_cooldown` +-- + +LOCK TABLES `pet_spell_cooldown` WRITE; +/*!40000 ALTER TABLE `pet_spell_cooldown` DISABLE KEYS */; +/*!40000 ALTER TABLE `pet_spell_cooldown` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `petition` +-- + +DROP TABLE IF EXISTS `petition`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `petition` ( + `ownerguid` int(10) unsigned NOT NULL, + `petitionguid` int(10) unsigned default '0', + `name` varchar(255) NOT NULL default '', + `type` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`ownerguid`,`type`), + UNIQUE KEY `index_ownerguid_petitionguid` (`ownerguid`,`petitionguid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `petition` +-- + +LOCK TABLES `petition` WRITE; +/*!40000 ALTER TABLE `petition` DISABLE KEYS */; +/*!40000 ALTER TABLE `petition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `petition_sign` +-- + +DROP TABLE IF EXISTS `petition_sign`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `petition_sign` ( + `ownerguid` int(10) unsigned NOT NULL, + `petitionguid` int(11) unsigned NOT NULL default '0', + `playerguid` int(11) unsigned NOT NULL default '0', + `player_account` int(11) unsigned NOT NULL default '0', + `type` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`petitionguid`,`playerguid`), + INDEX `Idx_playerguid`(`playerguid`), + INDEX `Idx_ownerguid`(`ownerguid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `petition_sign` +-- + +LOCK TABLES `petition_sign` WRITE; +/*!40000 ALTER TABLE `petition_sign` DISABLE KEYS */; +/*!40000 ALTER TABLE `petition_sign` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `worldstates` +-- + +DROP TABLE IF EXISTS `worldstates`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `worldstates` ( + `entry` mediumint(11) UNSIGNED NOT NULL DEFAULT '0', + `value` bigint(40) UNSIGNED NOT NULL DEFAULT '0', + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Variable Saves'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `worldstates` +-- + +LOCK TABLES `worldstates` WRITE; +/*!40000 ALTER TABLE `worldstates` DISABLE KEYS */; +INSERT INTO `worldstates` (`entry`,`value`, `comment`) VALUES +(20001, 0, 'NextArenaPointDistributionTime'), +(20002, 0, 'NextWeeklyQuestResetTime'), +(20003, 0, 'NextBGRandomDailyResetTime'); +/*!40000 ALTER TABLE `worldstates` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2008-01-10 11:37:06 + +-- Updated on 2010-01-29 23:05:45 GMT+1 diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql new file mode 100644 index 00000000000..fb3fcb2b322 --- /dev/null +++ b/sql/base/world_database.sql @@ -0,0 +1,15596 @@ +-- Remove the following line to import this ++++DO NOT IMPORT THIS UNLESS YOU WANT A *BLANK* DATABASE.+++ +-- MySQL dump 10.13 Distrib 5.1.36, for redhat-linux-gnu (x86_64) +-- +-- Host: localhost Database: world +-- ------------------------------------------------------ +-- Server version 5.1.36 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `access_requirement` +-- + +DROP TABLE IF EXISTS `access_requirement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `access_requirement` ( + `id` bigint(20) unsigned NOT NULL COMMENT 'Identifier', + `level_min` tinyint(3) unsigned NOT NULL DEFAULT '0', + `heroic_level_min` tinyint(3) unsigned NOT NULL DEFAULT '0', + `level_max` tinyint(3) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `heroic_key` mediumint(8) unsigned NOT NULL DEFAULT '0', + `heroic_key2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest_done` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest_failed_text` text, + `heroic_quest_done` mediumint(8) unsigned NOT NULL DEFAULT '0', + `heroic_quest_failed_text` text, + `comment` text, + `status` tinyint(3) unsigned DEFAULT '15' COMMENT 'instance status (open/close)', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Access Requirements'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `access_requirement` +-- + +LOCK TABLES `access_requirement` WRITE; +/*!40000 ALTER TABLE `access_requirement` DISABLE KEYS */; +/*!40000 ALTER TABLE `access_requirement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `achievement_criteria_data` +-- + +DROP TABLE IF EXISTS `achievement_criteria_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievement_criteria_data` ( + `criteria_id` mediumint(8) NOT NULL, + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`criteria_id`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Achievment system'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `achievement_criteria_data` +-- + +LOCK TABLES `achievement_criteria_data` WRITE; +/*!40000 ALTER TABLE `achievement_criteria_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievement_criteria_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `achievement_reward` +-- + +DROP TABLE IF EXISTS `achievement_reward`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `achievement_reward` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `title_A` mediumint(8) unsigned NOT NULL DEFAULT '0', + `title_H` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `sender` mediumint(8) unsigned NOT NULL DEFAULT '0', + `subject` varchar(255) DEFAULT NULL, + `text` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `achievement_reward` +-- + +LOCK TABLES `achievement_reward` WRITE; +/*!40000 ALTER TABLE `achievement_reward` DISABLE KEYS */; +/*!40000 ALTER TABLE `achievement_reward` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_involvedrelation` +-- + +DROP TABLE IF EXISTS `areatrigger_involvedrelation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `areatrigger_involvedrelation` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `areatrigger_involvedrelation` +-- + +LOCK TABLES `areatrigger_involvedrelation` WRITE; +/*!40000 ALTER TABLE `areatrigger_involvedrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_involvedrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_scripts` +-- + +DROP TABLE IF EXISTS `areatrigger_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `areatrigger_scripts` ( + `entry` mediumint(8) NOT NULL, + `ScriptName` char(64) NOT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `areatrigger_scripts` +-- + +LOCK TABLES `areatrigger_scripts` WRITE; +/*!40000 ALTER TABLE `areatrigger_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_tavern` +-- + +DROP TABLE IF EXISTS `areatrigger_tavern`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `areatrigger_tavern` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', + `name` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `areatrigger_tavern` +-- + +LOCK TABLES `areatrigger_tavern` WRITE; +/*!40000 ALTER TABLE `areatrigger_tavern` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_tavern` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_teleport` +-- + +DROP TABLE IF EXISTS `areatrigger_teleport`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `areatrigger_teleport` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', + `name` text, + `access_id` bigint(20) unsigned NOT NULL DEFAULT '0', + `target_map` smallint(5) unsigned NOT NULL DEFAULT '0', + `target_position_x` float NOT NULL DEFAULT '0', + `target_position_y` float NOT NULL DEFAULT '0', + `target_position_z` float NOT NULL DEFAULT '0', + `target_orientation` float NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + FULLTEXT KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `areatrigger_teleport` +-- + +LOCK TABLES `areatrigger_teleport` WRITE; +/*!40000 ALTER TABLE `areatrigger_teleport` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_teleport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `autobroadcast` +-- + +DROP TABLE IF EXISTS `autobroadcast`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `autobroadcast` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `text` longtext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `autobroadcast` +-- + +LOCK TABLES `autobroadcast` WRITE; +/*!40000 ALTER TABLE `autobroadcast` DISABLE KEYS */; +/*!40000 ALTER TABLE `autobroadcast` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `battleground_template` +-- + +DROP TABLE IF EXISTS `battleground_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `battleground_template` ( + `id` mediumint(8) unsigned NOT NULL, + `MinPlayersPerTeam` smallint(5) unsigned NOT NULL DEFAULT '0', + `MaxPlayersPerTeam` smallint(5) unsigned NOT NULL DEFAULT '0', + `MinLvl` tinyint(3) unsigned NOT NULL DEFAULT '0', + `MaxLvl` tinyint(3) unsigned NOT NULL DEFAULT '0', + `AllianceStartLoc` mediumint(8) unsigned NOT NULL, + `AllianceStartO` float NOT NULL, + `HordeStartLoc` mediumint(8) unsigned NOT NULL, + `HordeStartO` float NOT NULL, + `Disable` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `battleground_template` +-- + +LOCK TABLES `battleground_template` WRITE; +/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */; +INSERT INTO `battleground_template` (`id`,`MinPlayersPerTeam`,`MaxPlayersPerTeam`,`MinLvl`,`MaxLvl`,`AllianceStartLoc`,`AllianceStartO`,`HordeStartLoc`,`HordeStartO`, `Disable`) VALUES +(1,20,40,51,80,611,2.72532,610,2.27452,0), +(2,5,10,10,80,769,3.14159,770,3.14159,0), +(3,8,15,20,80,890,3.40156,889,0.263892,0), +(4,0,2,10,80,929,0,936,3.14159,0), +(5,0,2,10,80,939,0,940,3.14159,0), +(6,0,2,10,80,0,0,0,0,0), +(7,8,15,61,80,1103,3.40156,1104,0.263892,0), +(8,0,2,10,80,1258,0,1259,3.14159,0), +(9,7,15,71,80,1367,0,1368,0,0), +(10,5,5,10,80,1362,0,1363,0,1), +(11,5,5,10,80,1364,0,1365,0,1), +(30,20,40,71,80,1485,0,1486,0,0), +(32,10,10,0,80,0,0,0,0,0); +/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `battlemaster_entry` +-- + +DROP TABLE IF EXISTS `battlemaster_entry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `battlemaster_entry` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Entry of a creature', + `bg_template` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Battleground template id', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `battlemaster_entry` +-- + +LOCK TABLES `battlemaster_entry` WRITE; +/*!40000 ALTER TABLE `battlemaster_entry` DISABLE KEYS */; +/*!40000 ALTER TABLE `battlemaster_entry` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `command` +-- + +DROP TABLE IF EXISTS `command`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `command` ( + `name` varchar(50) NOT NULL DEFAULT '', + `security` tinyint(3) unsigned NOT NULL DEFAULT '0', + `help` longtext, + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Chat System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `command` +-- + +LOCK TABLES `command` WRITE; +/*!40000 ALTER TABLE `command` DISABLE KEYS */; +INSERT INTO `command` VALUES +('account',0,'Syntax: .account\r\n\r\nDisplay the access level of your account.'), +('account addon',1,'Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'), +('account create',4,'Syntax: .account create $account $password\r\n\r\nCreate account and set password to it.'), +('account delete',4,'Syntax: .account delete $account\r\n\r\nDelete account with all characters.'), +('account lock',0,'Syntax: .account lock [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'), +('account onlinelist',4,'Syntax: .account onlinelist\r\n\r\nShow list of online accounts.'), +('account password',0,'Syntax: .account password $old_password $new_password $new_password\r\n\r\nChange your account password.'), +('account set',3,'Syntax: .account set $subcommand\nType .account set to see the list of possible subcommands or .help account set $subcommand to see info on subcommands'), +('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'), +('account set gmlevel',4,'Syntax: .account set gmlevel [$account] #level [#realmid]\r\n\r\nSet the security level for targeted player (can''t be used at self) or for account $name to a level of #level on the realm #realmID.\r\n\r\n#level may range from 0 to 3.\r\n\r\n#reamID may be -1 for all realms.'), +('account set password',4,'Syntax: .account set password $account $password $password\r\n\r\nSet password for account.'), +('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'), +('additemset',3,'Syntax: .additemset #itemsetid\r\n\r\nAdd items from itemset of id #itemsetid to your or selected character inventory. Will add by one example each item from itemset.'), +('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'), +('aura',3,'Syntax: .aura #spellid\r\n\r\nAdd the aura from spell #spellid to the selected Unit.'), +('ban',3,'Syntax: .ban $subcommand\nType .ban to see the list of possible subcommands or .help ban $subcommand to see info on subcommands'), +('ban account',3,'Syntax: .ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('ban character',3,'Syntax: .ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('ban ip',3,'Syntax: .ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'), +('baninfo',3,'Syntax: .baninfo $subcommand\nType .baninfo to see the list of possible subcommands or .help baninfo $subcommand to see info on subcommands'), +('baninfo account',3,'Syntax: .baninfo account $accountid\r\nWatch full information about a specific ban.'), +('baninfo character',3,'Syntax: .baninfo character $charactername \r\nWatch full information about a specific ban.'), +('baninfo ip',3,'Syntax: .baninfo ip $ip\r\nWatch full information about a specific ban.'), +('bank',3,'Syntax: .bank\r\n\r\nShow your bank inventory.'), +('banlist',3,'Syntax: .banlist $subcommand\nType .banlist to see the list of possible subcommands or .help banlist $subcommand to see info on subcommands'), +('banlist account',3,'Syntax: .banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'), +('banlist character',3,'Syntax: .banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'), +('banlist ip',3,'Syntax: .banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'), +('bindsight',3,'Syntax: .bindsight\r\n\r\nBinds vision to the selected unit indefinitely. Cannot be used while currently possessing a target.'), +('cast',3,'Syntax: .cast #spellid [triggered]\r\n Cast #spellid to selected target. If no target selected cast to self. If ''trigered'' or part provided then spell casted with triggered flag.'), +('cast back',3,'Syntax: .cast back #spellid [triggered]\r\n Selected target will cast #spellid to your character. If ''trigered'' or part provided then spell casted with triggered flag.'), +('cast dist',3,'Syntax: .cast dist #spellid [#dist [triggered]]\r\n You will cast spell to pint at distance #dist. If ''trigered'' or part provided then spell casted with triggered flag. Not all spells can be casted as area spells.'), +('cast self',3,'Syntax: .cast self #spellid [triggered]\r\nCast #spellid by target at target itself. If ''trigered'' or part provided then spell casted with triggered flag.'), +('cast target',3,'Syntax: .cast target #spellid [triggered]\r\n Selected target will cast #spellid to his victim. If ''trigered'' or part provided then spell casted with triggered flag.'), +('character customize',2,'Syntax: .character customize [$name]\r\n\r\nMark selected in game or by $name in command character for customize at next login.'), +('character delete',4,'Syntax: .character delete $name\r\n\r\nDelete character $name.'), +('character level',3,'Syntax: .character level [$playername] [#level]\r\n\r\nSet the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent values recalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'), +('character rename',2,'Syntax: .character rename [$name]\r\n\r\nMark selected in game or by $name in command character for rename at next login.'), +('character reputation',2,'Syntax: .character reputation [$player_name]\r\n\r\nShow reputation information for selected player or player find by $player_name.'), +('character titles',2,'Syntax: .character titles [$player_name]\r\n\r\nShow known titles list for selected player or player find by $player_name.'), +('channel set public', 3, 'Syntax: .channel set public $channel $public\r\n\r\nChange password-changing ability for a channel. 1 for possible, 0 for GM only.'), +('combatstop',2,'Syntax: .combatstop [$playername]\r\nStop combat for selected character. If selected non-player then command applied to self. If $playername provided then attempt applied to online player $playername.'), +('cometome',3,'SYntax: .cometome $parameter\nMake selected creature come to your current location (new position not saved to DB).'), +('commands',0,'Syntax: .commands\r\n\r\nDisplay a list of available commands for your account level.'), +('cooldown',3,'Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or you (if no selection).'), +('damage',3,'Syntax: .damage $damage_amount [$school [$spellid]]\r\n\r\nApply $damage to target. If not $school and $spellid provided then this flat clean melee damage without any modifiers. If $school provided then damage modified by armor reduction (if school physical), and target absorbing modifiers and result applied as melee damage to target. If spell provided then damage modified and applied as spell damage. $spellid can be shift-link.'), +('debug',1,'Syntax: .debug $subcommand\nType .debug to see the list of possible subcommands or .help debug $subcommand to see info on subcommands'), +('debug arena',3,'Syntax: .debug arena\r\n\r\nToggle debug mode for arenas. In debug mode GM can start arena with single player.'), +('debug bg',3,'Syntax: .debug bg\r\n\r\nToggle debug mode for battlegrounds. In debug mode GM can start battleground with single player.'), +('debug Mod32Value',3,'Syntax: .debug Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'), +('debug play cinematic',1,'Syntax: .debug play cinematic #cinematicid\r\n\r\nPlay cinematic #cinematicid for you. You stay at place while your mind fly.\r\n'), +('debug play movie',1,'Syntax: .debug play movie #movieid\r\n\r\nPlay movie #movieid for you.'), +('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'), +('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'), +('die',3,'Syntax: .die\r\n\r\nKill the selected player. If no player is selected, it will kill you.'), +('dismount',0,'Syntax: .dismount\r\n\r\nDismount you, if you are mounted.'), +('distance',3,'Syntax: .distance\r\n\r\nDisplay the distance from your character to the selected creature.'), +('event',2,'Syntax: .event #event_id\r\nShow details about event with #event_id.'), +('event activelist',2,'Syntax: .event activelist\r\nShow list of currently active events.'), +('event start',2,'Syntax: .event start #event_id\r\nStart event #event_id. Set start time for event to current moment (change not saved in DB).'), +('event stop',2,'Syntax: .event stop #event_id\r\nStop event #event_id. Set start time for event to time in past that make current moment is event stop time (change not saved in DB).'), +('explorecheat',3,'Syntax: .explorecheat #flag\r\n\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\n\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'), +('flusharenapoints',3,'Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'), +('freeze',1,'Syntax: .freeze (#player)\r\n\"Freezes\" #player and disables his chat. When using this without #name it will freeze your target.'), +('gm',1,'Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'), +('gm chat',1,'Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'), +('gm fly',3,'Syntax: .gm fly [on/off]\r\nEnable/disable gm fly mode.'), +('gm ingame',0,'Syntax: .gm ingame\r\n\r\nDisplay a list of available in game Game Masters.'), +('gm list',3,'Syntax: .gm list\r\n\r\nDisplay a list of all Game Masters accounts and security levels.'), +('gm visible',1,'Syntax: .gm visible on/off\r\n\r\nOutput current visibility state or make GM visible(on) and invisible(off) for other players.'), +('gmannounce',1,'Syntax: .gmannounce $announcement\r\nSend an announcement to online Gamemasters.'), +('gmnameannounce',1,'Syntax: .gmnameannounce $announcement.\r\nSend an announcement to all online GM''s, displaying the name of the sender.'), +('gmnotify',1,'Syntax: .gmnotify $notification\r\nDisplays a notification on the screen of all online GM''s.'), +('go',1,'Syntax: .go $subcommand\nType .go to see the list of possible subcommands or .help go $subcommand to see info on subcommands'), +('go creature',1,'Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'), +('go graveyard',1,'Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'), +('go grid',1,'Syntax: .go grid #gridX #gridY [#mapId]\r\n\r\nTeleport the gm to center of grid with provided indexes at map #mapId (or current map if it not provided).'), +('go object',1,'Syntax: .go object #object_guid\r\nTeleport your character to gameobject with guid #object_guid'), +('go taxinode',1,'Syntax: .go taxinode #taxinode\r\n\r\nTeleport player to taxinode coordinates. You can look up zone using .lookup taxinode $namepart'), +('go ticket',1,'Syntax: .go ticket #ticketid\r\nTeleports the user to the location where $ticketid was created.'), +('go trigger',1,'Syntax: .go trigger #trigger_id\r\n\r\nTeleport your character to areatrigger with id #trigger_id. Character will be teleported to trigger target if selected areatrigger is telporting trigger.'), +('go xy',1,'Syntax: .go xy #x #y [#mapid]\r\n\r\nTeleport player to point with (#x,#y) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'), +('go xyz',1,'Syntax: .go xyz #x #y #z [#mapid]\r\n\r\nTeleport player to point with (#x,#y,#z) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'), +('go zonexy',1,'Syntax: .go zonexy #x #y [#zone]\r\n\r\nTeleport player to point with (#x,#y) client coordinates at ground(water) level in zone #zoneid or current zone if #zoneid not provided. You can look up zone using .lookup area $namepart'), +('gobject',2,'Syntax: .gobject $subcommand\nType .gobject to see the list of possible subcommands or .help gobject $subcommand to see info on subcommands'), +('gobject activate',2,'Syntax: .gobject activate #guid\r\n\r\nActivates an object like a door or a button.'), +('gobject add',2,'Syntax: .gobject add #id \r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'), +('gobject delete',2,'Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'), +('gobject info', 2, 'Syntax: .gobject info [$object_entry]\r\n\r\nQuery Gameobject information for selected gameobject or given entry.'), +('gobject move',2,'Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'), +('gobject near',2,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'), +('gobject setphase',2,'Syntax: .gobject setphase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'), +('gobject target',2,'Syntax: .gobject target [#go_id|#go_name_part]\r\n\r\nLocate and show position nearest gameobject. If #go_id or #go_name_part provide then locate and show position of nearest gameobject with gameobject template id #go_id or name included #go_name_part as part.'), +('gobject tempadd',2,'Adds a temporary gameobject that is not saved to DB.'), +('gobject turn',2,'Syntax: .gobject turn #goguid \r\n\r\nSet for gameobject #goguid orientation same as current character orientation.'), +('goname',1,'Syntax: .goname [$charactername]\r\n\r\nTeleport to the given character. Either specify the character name or click on the character''s portrait, e.g. when you are in a group. Character can be offline.'), +('gps',1,'Syntax: .gps [$name|$shift-link]\r\n\r\nDisplay the position information for a selected character or creature (also if player name $name provided then for named player, or if creature/gameobject shift-link provided then pointed creature/gameobject if it loaded). Position information includes X, Y, Z, and orientation, map Id and zone Id'), +('groupgo',1,'Syntax: .groupgo [$charactername]\r\n\r\nTeleport the given character and his group to you. Teleported only online characters but original selected group member can be offline.'), +('guid',2,'Syntax: .guid\r\n\r\nDisplay the GUID for the selected character.'), +('guild',3,'Syntax: .guild $subcommand\nType .guild to see the list of possible subcommands or .help guild $subcommand to see info on subcommands'), +('guild create',2,'Syntax: .guild create [$GuildLeaderName] \"$GuildName\"\r\n\r\nCreate a guild named $GuildName with the player $GuildLeaderName (or selected) as leader. Guild name must in quotes.'), +('guild delete',2,'Syntax: .guild delete \"$GuildName\"\r\n\r\nDelete guild $GuildName. Guild name must in quotes.'), +('guild invite',2,'Syntax: .guild invite [$CharacterName] \"$GuildName\"\r\n\r\nAdd player $CharacterName (or selected) into a guild $GuildName. Guild name must in quotes.'), +('guild rank',2,'Syntax: .guild rank [$CharacterName] #Rank\r\n\r\nSet for player $CharacterName (or selected) rank #Rank in a guild.'), +('guild uninvite',2,'Syntax: .guild uninvite [$CharacterName]\r\n\r\nRemove player $CharacterName (or selected) from a guild.'), +('help',0,'Syntax: .help [$command]\r\n\r\nDisplay usage instructions for the given $command. If no $command provided show list available commands.'), +('hidearea',3,'Syntax: .hidearea #areaid\r\n\r\nHide the area of #areaid to the selected character. If no character is selected, hide this area to you.'), +('honor',2,'Syntax: .honor $subcommand\nType .honor to see the list of possible subcommands or .help honor $subcommand to see info on subcommands'), +('honor add',2,'Syntax: .honor add $amount\r\n\r\nAdd a certain amount of honor (gained today) to the selected player.'), +('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it''s a racial leader or a player)'), +('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday''s honor fields to be updated with today''s data, which will get reset for the selected player.'), +('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'), +('instance',3,'Syntax: .instance $subcommand\nType .instance to see the list of possible subcommands or .help instance $subcommand to see info on subcommands'), +('instance listbinds',3,'Syntax: .instance listbinds\r\n Lists the binds of the selected player.'), +('instance savedata',3,'Syntax: .instance savedata\r\n Save the InstanceData for the current player''s map to the DB.'), +('instance stats',3,'Syntax: .instance stats\r\n Shows statistics about instances.'), +('instance unbind',3,'Syntax: .instance unbind all\r\n All of the selected player''s binds will be cleared.'), +('instance open', 3, 'Syntax: .instance open mapid [normal|heroic|10normal|10heroic|25normal|25heroic]'), +('instance close', 3, 'Syntax: .instance close mapid [normal|heroic|10normal|10heroic|25normal|25heroic]'), +('itemmove',2,'Syntax: .itemmove #sourceslotid #destinationslotid\r\n\r\nMove an item from slots #sourceslotid to #destinationslotid in your inventory\r\n\r\nNot yet implemented'), +('kick',2,'Syntax: .kick [$charactername] [$reason]\r\n\r\nKick the given character name from the world with or without reason. If no character name is provided then the selected player (except for yourself) will be kicked. If no reason is provided, default is \"No Reason\".'), +('learn',3,'Syntax: .learn #spell [all]\r\n\r\nSelected character learn a spell of id #spell. If ''all'' provided then all ranks learned.'), +('learn all',3,'Syntax: .learn all\r\n\r\nLearn all big set different spell maybe useful for Administaror.'), +('learn all_crafts',2,'Syntax: .learn crafts\r\n\r\nLearn all professions and recipes.'), +('learn all_default',1,'Syntax: .learn all_default [$playername]\r\n\r\nLearn for selected/$playername player all default spells for his race/class and spells rewarded by completed quests.'), +('learn all_gm',2,'Syntax: .learn all_gm\r\n\r\nLearn all default spells for Game Masters.'), +('learn all_lang',1,'Syntax: .learn all_lang\r\n\r\nLearn all languages'), +('learn all_myclass',3,'Syntax: .learn all_myclass\r\n\r\nLearn all spells and talents available for his class.'), +('learn all_mypettalents',3,'Syntax: .learn all_mypettalents\r\n\r\nLearn all talents for your pet available for his creature type (only for hunter pets).'), +('learn all_myspells',3,'Syntax: .learn all_myspells\r\n\r\nLearn all spells (except talents and spells with first rank learned as talent) available for his class.'), +('learn all_mytalents',3,'Syntax: .learn all_mytalents\r\n\r\nLearn all talents (and spells with first rank learned as talent) available for his class.'), +('learn all_recipes',2,'Syntax: .learn all_recipes [$profession]\r\rLearns all recipes of specified profession and sets skill level to max.\rExample: .learn all_recipes enchanting'), +('levelup',3,'Syntax: .levelup [$playername] [#numberoflevels]\r\n\r\nIncrease/decrease the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent values recalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'), +('linkgrave',3,'Syntax: .linkgrave #graveyard_id [alliance|horde]\r\n\r\nLink current zone to graveyard for any (or alliance/horde faction ghosts). This let character ghost from zone teleport to graveyard after die if graveyard is nearest from linked to zone and accept ghost of this faction. Add only single graveyard at another map and only if no graveyards linked (or planned linked at same map).'), +('list',3,'Syntax: .list $subcommand\nType .list to see the list of possible subcommands or .help list $subcommand to see info on subcommands'), +('list auras',3,'Syntax: .list auras\nList auras (passive and active) of selected creature or player. If no creature or player is selected, list your own auras.'), +('list creature',3,'Syntax: .list creature #creature_id [#max_count]\r\n\r\nOutput creatures with creature id #creature_id found in world. Output creature guids and coordinates sorted by distance from character. Will be output maximum #max_count creatures. If #max_count not provided use 10 as default value.'), +('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails, auctions, and guild banks. Output item guids, item owner guid, owner account and owner name (guild name and guid in case guild bank). Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'), +('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'), +('listfreeze',1,'Syntax: .listfreeze\r\n\r\nSearch and output all frozen players.'), +('loadpath',3,'Syntax: .loadpath $pathid\nLoad path changes ingame - IMPORTANT: must be applied first for new paths before .path load #pathid '), +('lookup',3,'Syntax: .lookup $subcommand\nType .lookup to see the list of possible subcommands or .help lookup $subcommand to see info on subcommands'), +('lookup area',1,'Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID''s.'), +('lookup creature',3,'Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID''s.'), +('lookup event',2,'Syntax: .lookup event $name\r\nAttempts to find the ID of the event with the provided $name.'), +('lookup faction',3,'Syntax: .lookup faction $name\r\nAttempts to find the ID of the faction with the provided $name.'), +('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID''s.'), +('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID''s.'), +('lookup map',3,'Syntax: .lookup map $namepart\r\n\r\nLooks up a map by $namepart, and returns all matches with their map ID''s.'), +('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID''s.'), +('lookup player account',2,'Syntax: .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'), +('lookup player email',2,'Syntax: .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'), +('lookup player ip',2,'Syntax: .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'), +('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID''s.'), +('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID''s.'), +('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID''s.'), +('lookup taxinode',3,'Syntax: .lookup taxinode $substring\r\n\r\nSearch and output all taxinodes with provide $substring in name.'), +('lookup tele',1,'Syntax: .lookup tele $substring\r\n\r\nSearch and output all .tele command locations with provide $substring in name.'), +('maxskill',3,'Syntax: .maxskill\r\nSets all skills of the targeted player to their maximum values for its current level.'), +('modify',1,'Syntax: .modify $subcommand\nType .modify to see the list of possible subcommands or .help modify $subcommand to see info on subcommands'), +('modify arena',1,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'), +('modify aspeed',1,'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to \"normalbase speed for this move type\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify bit',1,'Syntax: .modify bit #field #bit\r\n\r\nToggle the #bit bit of the #field field for the selected player. If no player is selected, modify your character.'), +('modify bwalk',1,'Syntax: .modify bwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to \"normal walk back speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify drunk',1,'Syntax: .modify drunk #value\r\n Set drunk level to #value (0..100). Value 0 remove drunk state, 100 is max drunked state.'), +('modify energy',1,'Syntax: .modify energy #energy\r\n\r\nModify the energy of the selected player. If no player is selected, modify your energy.'), +('modify faction',1,'Syntax: .modify faction #factionid #flagid #npcflagid #dynamicflagid\r\n\r\nModify the faction and flags of the selected creature. Without arguments, display the faction and flags of the selected creature.'), +('modify fly',1,'.modify fly $parameter\nModify the flying speed of the selected player to \"normal flying speed\"*rate. If no player is selected, modify your speed.\n #rate may range from 0.1 to 50.'), +('modify gender',2,'Syntax: .modify gender male/female\r\n\r\nChange gender of selected player.'), +('modify honor',1,'Syntax: .modify honor $amount\r\n\r\nAdd $amount honor points to the selected player.'), +('modify hp',1,'Syntax: .modify hp #newhp\r\n\r\nModify the hp of the selected player. If no player is selected, modify your hp.'), +('modify mana',1,'Syntax: .modify mana #newmana\r\n\r\nModify the mana of the selected player. If no player is selected, modify your mana.'), +('modify money',1,'Syntax: .modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'), +('modify morph',2,'Syntax: .modify morph #displayid\r\n\r\nChange your current model id to #displayid.'), +('modify mount',1,'Syntax: .modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'), +('modify phase',3,'Syntax: .modify phase #phasemask\r\n\r\nSelected character phasemask changed to #phasemask with related world vision update. Change active until in game phase changed, or GM-mode enable/disable, or re-login. Character pts pasemask update to same value.'), +('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'), +('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use ''.pinfo rep'' to list all known reputation ids, or use ''.lookup faction $name'' to locate a specific faction id.'), +('modify runicpower',1,'Syntax: .modify runicpower #newrunicpower\r\n\r\nModify the runic power of the selected player. If no player is selected, modify your runic power.'), +('modify scale',1,'.modify scale $parameter\nModify size of the selected player to \"normal scale\"*rate. If no player is selected, modify your size.\n#rate may range from 0.1 to 10.'), +('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify spell',1,'TODO'), +('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'), +('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify tp',1,'Syntax: .modify tp #amount\r\n\r\nSet free talent pointes for selected character or character''s pet. It will be reset to default expected at next levelup/login/quest reward.'), +('movegens',3,'Syntax: .movegens\r\n Show movement generators stack for selected creature or player.'), +('mute',1,'Syntax: .mute [$playerName] $timeInMinutes [$reason]\r\n\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $timeInMinutes minutes. Player can be offline.'), +('nameannounce',1,'Syntax: .nameannounce $announcement.\nSend an announcement to all online players, displaying the name of the sender.'), +('namego',1,'Syntax: .namego [$charactername]\r\n\r\nTeleport the given character to you. Character can be offline.'), +('neargrave',3,'Syntax: .neargrave [alliance|horde]\r\n\r\nFind nearest graveyard linked to zone (or only nearest from accepts alliance or horde faction ghosts).'), +('notify',1,'Syntax: .notify $MessageToBroadcast\r\n\r\nSend a global message to all players online in screen.'), +('npc',1,'Syntax: .npc $subcommand\nType .npc to see the list of possible subcommands or .help npc $subcommand to see info on subcommands'), +('npc add',2,'Syntax: .npc add #creatureid\r\n\r\nSpawn a creature by the given template id of #creatureid.'), +('npc addformation',1,'Syntax: .npc addformation $leader\nAdd selected creature to a leader''s formation.'), +('npc additem',2,'Syntax: .npc additem #itemId <#maxcount><#incrtime><#extendedcost>r\r\n\r\nAdd item #itemid to item list of selected vendor. Also optionally set max count item in vendor item list and time to item count restoring and items ExtendedCost.'), +('npc addmove',2,'Syntax: .npc addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'), +('npc allowmove',3,'Syntax: .npc allowmove\r\n\r\nEnable or disable movement creatures in world. Not implemented.'), +('npc changeentry',3,'Syntax: .npc changeentry $entry\nSwitch selected creature with another entry from creature_template. - New creature.id value not saved to DB.'), +('npc changelevel',2,'Syntax: .npc changelevel #level\r\n\r\nChange the level of the selected creature to #level.\r\n\r\n#level may range from 1 to 63.'), +('npc delete',2,'Syntax: .npc delete [#guid]\r\n\r\nDelete creature with guid #guid (or the selected if no guid is provided)'), +('npc delitem',2,'Syntax: .npc delitem #itemId\r\n\r\nRemove item #itemid from item list of selected vendor.'), +('npc factionid',2,'Syntax: .npc factionid #factionid\r\n\r\nSet the faction of the selected creature to #factionid.'), +('npc flag',2,'Syntax: .npc flag #npcflag\r\n\r\nSet the NPC flags of creature template of the selected creature and selected creature to #npcflag. NPC flags will applied to all creatures of selected creature template after server restart or grid unload/load.'), +('npc follow',2,'Syntax: .npc follow\r\n\r\nSelected creature start follow you until death/fight/etc.'), +('npc info',3,'Syntax: .npc info\r\n\r\nDisplay a list of details for the selected creature.\r\n\r\nThe list includes:\r\n- GUID, Faction, NPC flags, Entry ID, Model ID,\r\n- Level,\r\n- Health (current/maximum),\r\n\r\n- Field flags, dynamic flags, faction template, \r\n- Position information,\r\n- and the creature type, e.g. if the creature is a vendor.'), +('npc move',2,'Syntax: .npc move [#creature_guid]\r\n\r\nMove the targeted creature spawn point to your coordinates.'), +('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'), +('npc say',1,'Syntax: .npc say $message\nMake selected creature say specified message.'), +('npc setdeathstate',2,'Syntax: .npc setdeathstate on/off\r\n\r\nSet default death state (dead/alive) for npc at spawn.'), +('npc setlink',2,'Syntax: .npc setlink $creatureGUID\r\n\r\nLinks respawn of selected creature to the condition that $creatureGUID defined is alive.'), +('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'), +('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'), +('npc setphase',2,'Syntax: .npc setphase #phasemask\r\n\r\nSelected unit or pet phasemask changed to #phasemask with related world vision update for players. In creature case state saved to DB and persistent. In pet case change active until in game phase changed for owner, owner re-login, or GM-mode enable/disable..'), +('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'), +('npc spawntime',2,'Syntax: .npc spawntime #time \r\n\r\nAdjust spawntime of selected creature to time.'), +('npc tempadd',2,'Adds temporary NPC, not saved to database.'), +('npc textemote',1,'Syntax: .npc textemote #emoteid\r\n\r\nMake the selected creature to do textemote with an emote of id #emoteid.'), +('npc unfollow',2,'Syntax: .npc unfollow\r\n\r\nSelected creature (non pet) stop follow you.'), +('npc whisper',1,'Syntax: .npc whisper #playerguid #text\r\nMake the selected npc whisper #text to #playerguid.'), +('npc yell',1,'Syntax: .npc yell $message\nMake selected creature yell specified message.'), +('pdump',3,'Syntax: .pdump $subcommand\nType .pdump to see the list of possible subcommands or .help pdump $subcommand to see info on subcommands'), +('pdump load',3,'Syntax: .pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'), +('pdump write',3,'Syntax: .pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'), +('pet',2,'Syntax: .pet $subcommand\nType .pet to see the list of possible subcommands or .help pet $subcommand to see info on subcommands'), +('pet create',2,'Syntax: .pet create\r\n\r\nCreates a pet of the selected creature.'), +('pet learn',2,'Syntax: .pet learn\r\n\r\nLearn #spellid to pet.'), +('pet tp',2,'Syntax: .pet tp #\r\n\r\nChange pet''s amount of training points.'), +('pet unlearn',2,'Syntax: .pet unlean\r\n\r\nunLearn #spellid to pet.'), +('pinfo',2,'Syntax: .pinfo [$player_name]\r\n\r\nOutput account information for selected player or player find by $player_name.'), +('playall',2,'Syntax: .playall #soundid\r\n\r\nPlayer a sound to whole server.'), +('possess',3,'Syntax: .possess\r\n\r\nPossesses indefinitely the selected creature.'), +('quest',3,'Syntax: .quest $subcommand\nType .quest to see the list of possible subcommands or .help quest $subcommand to see info on subcommands'), +('quest add',3,'Syntax: .quest add #quest_id\r\n\r\nAdd to character quest log quest #quest_id. Quest started from item can''t be added by this command but correct .additem call provided in command output.'), +('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'), +('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'), +('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'), +('reload',3,'Syntax: .reload $subcommand\nType .reload to see the list of possible subcommands or .help reload $subcommand to see info on subcommands'), +('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'), +('reload all_item',3,'Syntax: .reload all_item\nReload page_text, item_enchantment_table tables.'), +('reload all_locales',3,'Syntax: .reload all_locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.'), +('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'), +('reload all_npc',3,'Syntax: .reload all_npc\nReload npc_gossip, npc_option, npc_trainer, npc vendor, points of interest tables.'), +('reload all_quest',3,'Syntax: .reload all_quest\r\n\r\nReload all quest related tables if reload support added for this table and this table can be _safe_ reloaded.'), +('reload all_scripts',3,'Syntax: .reload all_scripts\nReload gameobject_scripts, event_scripts, quest_end_scripts, quest_start_scripts, spell_scripts, db_script_string, waypoint_scripts tables.'), +('reload all_spell',3,'Syntax: .reload all\r\n\r\nReload all `spell_*` tables with reload support added and that can be _safe_ reloaded.'), +('reload areatrigger_involvedrelation',3,'Syntax: .reload areatrigger_involvedrelation\nReload areatrigger_involvedrelation table.'), +('reload areatrigger_tavern',3,'Syntax: .reload areatrigger_tavern\nReload areatrigger_tavern table.'), +('reload areatrigger_teleport',3,'Syntax: .reload areatrigger_teleport\nReload areatrigger_teleport table.'), +('reload autobroadcast',3,'Syntax: .reload autobroadcast\nReload autobroadcast table.'), +('reload command',3,'Syntax: .reload command\nReload command table.'), +('reload conditions', 3, 'Reload conditions table.'), +('reload config',3,'Syntax: .reload config\r\n\r\nReload config settings (by default stored in trinityd.conf). Not all settings can be change at reload: some new setting values will be ignored until restart, some values will applied with delay or only to new objects/maps, some values will explicitly rejected to change at reload.'), +('reload creature_involvedrelation',3,'Syntax: .reload creature_involvedrelation\nReload creature_involvedrelation table.'), +('reload creature_linked_respawn',2,'Syntax: .reload creature_linked_respawn\r\nReload creature_linked_respawn table.'), +('reload creature_loot_template',3,'Syntax: .reload creature_loot_template\nReload creature_loot_template table.'), +('reload creature_onkill_reputation','3','Syntax: .reload creature_onkill_reputation\r\nReload creature_onkill_reputation table.'), +('reload creature_questrelation',3,'Syntax: .reload creature_questrelation\nReload creature_questrelation table.'), +('reload disenchant_loot_template',3,'Syntax: .reload disenchant_loot_template\nReload disenchant_loot_template table.'), +('reload event_scripts',3,'Syntax: .reload event_scripts\nReload event_scripts table.'), +('reload fishing_loot_template',3,'Syntax: .reload fishing_loot_template\nReload fishing_loot_template table.'), +('reload gameobject_involvedrelation',3,'Syntax: .reload gameobject_involvedrelation\nReload gameobject_involvedrelation table.'), +('reload gameobject_loot_template',3,'Syntax: .reload gameobject_loot_template\nReload gameobject_loot_template table.'), +('reload gameobject_questrelation',3,'Syntax: .reload gameobject_questrelation\nReload gameobject_questrelation table.'), +('reload gameobject_scripts',3,'Syntax: .reload gameobject_scripts\nReload gameobject_scripts table.'), +('reload game_graveyard_zone',3,'Syntax: .reload game_graveyard_zone\nReload game_graveyard_zone table.'), +('reload game_tele',3,'Syntax: .reload game_tele\nReload game_tele table.'), +('reload gm_tickets',3,'Syntax: .reload gm_tickets\nReload gm_tickets table.'), +('reload item_enchantment_template',3,'Syntax: .reload item_enchantment_template\nReload item_enchantment_template table.'), +('reload item_loot_template',3,'Syntax: .reload item_loot_template\nReload item_loot_template table.'), +('reload item_set_names',3,'Syntax: .reload item_set_names\nReload item_set_names table.'), +('reload locales_creature',3,'Syntax: .reload locales_creature\nReload locales_creature table.'), +('reload locales_gameobject',3,'Syntax: .reload locales_gameobject\nReload locales_gameobject table.'), +('reload locales_item',3,'Syntax: .reload locales_item\nReload locales_item table.'), +('reload locales_item_set_name',3,'Syntax: .reload locales_item_set_name\nReload locales_item_set_name table.'), +('reload locales_npc_text',3,'Syntax: .reload locales_npc_text\nReload locales_npc_text table.'), +('reload locales_page_text',3,'Syntax: .reload locales_page_text\nReload locales_page_text table.'), +('reload locales_points_of_interest',3,'Syntax: .reload locales_points_of_interest\nReload locales_point_of_interest table.'), +('reload locales_quest',3,'Syntax: .reload locales_quest\nReload locales_quest table.'), +('reload milling_loot_template',3,'Syntax: .reload milling_loot_template\nReload milling_loot_template table.'), +('reload npc_gossip',3,'Syntax: .reload npc_gossip\nReload npc_gossip table.'), +('reload npc_trainer',3,'Syntax: .reload npc_trainer\nReload npc_trainer table.'), +('reload npc_vendor',3,'Syntax: .reload npc_vendor\nReload npc_vendor table.'), +('reload page_text',3,'Syntax: .reload page_text\nReload page_text table.'), +('reload pickpocketing_loot_template',3,'Syntax: .reload pickpocketing_loot_template\nReload pickpocketing_loot_template table.'), +('reload points_of_interest',3,'Syntax: .reload points_of_interest\nReload points_of_interest table.'), +('reload prospecting_loot_template',3,'Syntax: .reload prospecting_loot_template\nReload prospecting_loot_template table.'), +('reload quest_end_scripts',3,'Syntax: .reload quest_end_scripts\nReload quest_end_scripts table.'), +('reload mail_loot_template',3,'Syntax: .reload mail_loot_template\nReload mail_loot_template table.'), +('reload quest_start_scripts',3,'Syntax: .reload quest_start_scripts\nReload quest_start_scripts table.'), +('reload quest_template',3,'Syntax: .reload quest_template\nReload quest_template table.'), +('reload reference_loot_template',3,'Syntax: .reload reference_loot_template\nReload reference_loot_template table.'), +('reload reserved_name',3,'Syntax: .reload reserved_name\nReload reserved_name table.'), +('reload skill_discovery_template',3,'Syntax: .reload skill_discovery_template\nReload skill_discovery_template table.'), +('reload skill_extra_item_template',3,'Syntax: .reload skill_extra_item_template\nReload skill_extra_item_template table.'), +('reload skill_fishing_base_level',3,'Syntax: .reload skill_fishing_base_level\nReload skill_fishing_base_level table.'), +('reload skinning_loot_template',3,'Syntax: .reload skinning_loot_template\nReload skinning_loot_template table.'), +('reload spell_area',3,'Syntax: .reload spell_area\nReload spell_area table.'), +('reload spell_bonus_data',3,'Syntax: .reload spell_bonus_data\nReload spell_bonus_data table.'), +('reload spell_disabled',3,'Syntax: .reload spell_disabled\nReload spell_disabled table.'), +('reload spell_group',3,'Syntax: .reload spell_group\nReload spell_group table.'), +('reload spell_group_stack_rules',3,'Syntax: .reload spell_group\nReload spell_group_stack_rules table.'), +('reload spell_learn_spell',3,'Syntax: .reload spell_learn_spell\nReload spell_learn_spell table.'), +('reload spell_linked_spell',3,'Usage: .reload spell_linked_spell\r\nReloads the spell_linked_spell DB table.'), +('reload spell_loot_template',3,'Syntax: .reload spell_loot_template\nReload spell_loot_template table.'), +('reload spell_pet_auras',3,'Syntax: .reload spell_pet_auras\nReload spell_pet_auras table.'), +('reload spell_proc_event',3,'Syntax: .reload spell_proc_event\nReload spell_proc_event table.'), +('reload spell_required',3,'Syntax: .reload spell_required\nReload spell_required table.'), +('reload spell_scripts',3,'Syntax: .reload spell_scripts\nReload spell_scripts table.'), +('reload spell_target_position',3,'Syntax: .reload spell_target_position\nReload spell_target_position table.'), +('reload spell_threats',3,'Syntax: .reload spell_threats\nReload spell_threats table.'), +('reload creature_template','3','Syntax: .reload creature_template $entry\r\nReload the specified creature''s template.'), +('reload trinity_string',3,'Syntax: .reload trinity_string\nReload trinity_string table.'), +('reload waypoint_scripts',3,'Syntax: .reload waypoint_scripts\nReload waypoint_scripts table.'), +('repairitems',2,'Syntax: .repairitems\r\n\r\nRepair all selected player''s items.'), +('reset',3,'Syntax: .reset $subcommand\nType .reset to see the list of possible subcommands or .help reset $subcommand to see info on subcommands'), +('reset achievements',3,'Syntax: .reset achievements [$playername]\r\n\r\nReset achievements data for selected or named (online or offline) character. Achievements for persistance progress data like completed quests/etc re-filled at reset. Achievements for events like kills/casts/etc will lost.'), +('reset all',3,'Syntax: .reset all spells\r\n\r\nSyntax: .reset all talents\r\n\r\nRequest reset spells or talents (including talents for all character''s pets if any) at next login each existed character.'), +('reset honor',3,'Syntax: .reset honor [Playername]\r\n Reset all honor data for targeted character.'), +('reset level',3,'Syntax: .reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'), +('reset spells',3,'Syntax: .reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'), +('reset stats',3,'Syntax: .reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'), +('reset talents',3,'Syntax: .reset talents [Playername]\r\n Removes all talents of the targeted player or pet or named player. Playername can be name of offline character. With player talents also will be reset talents for all character''s pets if any.'), +('respawn',3,'Syntax: .respawn\r\n\r\nRespawn all nearest creatures and GO without waiting respawn time expiration.'), +('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'), +('save',0,'Syntax: .save\r\n\r\nSaves your character.'), +('saveall',1,'Syntax: .saveall\r\n\r\nSave all characters in game.'), +('send items',3,'Syntax: .send items #playername \"#subject\" \"#text\" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in \"\". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'), +('send mail',1,'Syntax: .send mail #playername \"#subject\" \"#text\"\r\n\r\nSend a mail to a player. Subject and mail text must be in \"\".'), +('send message',3,'Syntax: .send message $playername $message\r\n\r\nSend screen message to player from ADMINISTRATOR.'), +('send money',3,'Syntax: .send money #playername \"#subject\" \"#text\" #money\r\n\r\nSend mail with money to a player. Subject and mail text must be in \"\".'), +('server',3,'Syntax: .server $subcommand\nType .server to see the list of possible subcommands or .help server $subcommand to see info on subcommands'), +('server corpses',2,'Syntax: .server corpses\r\n\r\nTriggering corpses expire check in world.'), +('server exit',4,'Syntax: .server exit\r\n\r\nTerminate trinity-core NOW. Exit code 0.'), +('server idlerestart',3,'Syntax: .server idlerestart #delay\r\n\r\nRestart the server after #delay seconds if no active connections are present (no players). Use #exist_code or 2 as program exist code.'), +('server idlerestart cancel',3,'Syntax: .server idlerestart cancel\r\n\r\nCancel the restart/shutdown timer if any.'), +('server idleshutdown',3,'Syntax: .server idleshutdown #delay [#exist_code]\r\n\r\nShut the server down after #delay seconds if no active connections are present (no players). Use #exist_code or 0 as program exist code.'), +('server idleshutdown cancel',3,'Syntax: .server idleshutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'), +('server info',0,'Syntax: .server info\r\n\r\nDisplay server version and the number of connected players.'), +('server motd',0,'Syntax: .server motd\r\n\r\nShow server Message of the day.'), +('server plimit',3,'Syntax: .server plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'), +('server restart',3,'Syntax: .server restart #delay\r\n\r\nRestart the server after #delay seconds. Use #exist_code or 2 as program exist code.'), +('server restart cancel',3,'Syntax: .server restart cancel\r\n\r\nCancel the restart/shutdown timer if any.'), +('server set closed',3,'Syntax: server set closed on/off\r\n\r\nSets whether the world accepts new client connectsions.'), +('server set loglevel',4,'Syntax: .server set loglevel #level\r\n\r\nSet server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).'), +('server set motd',3,'Syntax: .server set motd $MOTD\r\n\r\nSet server Message of the day.'), +('server shutdown',3,'Syntax: .server shutdown #delay [#exit_code]\r\n\r\nShut the server down after #delay seconds. Use #exit_code or 0 as program exit code.'), +('server shutdown cancel',3,'Syntax: .server shutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'), +('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'), +('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'), +('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'), +('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'), +('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'), +('tele add',3,'Syntax: .tele add $name\r\n\r\nAdd current your position to .tele command target locations list with name $name.'), +('tele del',3,'Syntax: .tele del $name\r\n\r\nRemove location with name $name for .tele command locations list.'), +('tele group',1,'Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'), +('tele name',1,'Syntax: .tele name [#playername] #location\r\n\r\nTeleport the given character to a given location. Character can be offline.'), +('ticket',1,'Syntax: .ticket $subcommand\nType .ticket to see the list of possible subcommands or .help ticket $subcommand to see info on subcommands'), +('ticket assign',1,'Usage: .ticket assign $ticketid $gmname.\r\nAssigns the specified ticket to the specified Game Master.'), +('ticket close',1,'Usage: .ticket close $ticketid.\r\nCloses the specified ticket. Does not delete permanently.'), +('ticket closedlist',1,'Displays a list of closed GM tickets.'), +('ticket comment',1,'Usage: .ticket comment $ticketid $comment.\r\nAllows the adding or modifying of a comment to the specified ticket.'), +('ticket delete',3,'Usage: .ticket delete $ticketid.\r\nDeletes the specified ticket permanently. Ticket must be closed first.'), +('ticket list',1,'Displays a list of open GM tickets.'), +('ticket onlinelist',1,'Displays a list of open GM tickets whose owner is online.'), +('ticket unassign',1,'Usage: .ticket unassign $ticketid.\r\nUnassigns the specified ticket from the current assigned Game Master.'), +('ticket viewid',1,'Usage: .ticket viewid $ticketid.\r\nReturns details about specified ticket. Ticket must be open and not deleted.'), +('ticket viewname',1,'Usage: .ticket viewname $creatorname. \r\nReturns details about specified ticket. Ticket must be open and not deleted.'), +('titles add',2,'Syntax: .titles add #title\r\nAdd title #title (id or shift-link) to known titles list for selected player.'), +('titles current',2,'Syntax: .titles current #title\r\nSet title #title (id or shift-link) as current selected titl for selected player. If title not in known title list for player then it will be added to list.'), +('titles remove',2,'Syntax: .titles remove #title\r\nRemove title #title (id or shift-link) from known titles list for selected player.'), +('titles setmask',2,'Syntax: .titles setmask #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'), +('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'), +('unban',3,'Syntax: .unban $subcommand\nType .unban to see the list of possible subcommands or .help unban $subcommand to see info on subcommands'), +('unban account',3,'Syntax: .unban account $Name\r\nUnban accounts for account name pattern.'), +('unban character',3,'Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'), +('unban ip',3,'Syntax : .unban ip $Ip\r\nUnban accounts for IP pattern.'), +('unbindsight',3,'Syntax: .unbindsight\r\n\r\nRemoves bound vision. Cannot be used while currently possessing a target.'), +('unfreeze',1,'Syntax: .unfreeze (#player)\r\n\"Unfreezes\" #player and enables his chat again. When using this without #name it will unfreeze your target.'), +('unlearn',3,'Syntax: .unlearn #spell [all]\r\n\r\nUnlearn for selected player a spell #spell. If ''all'' provided then all ranks unlearned.'), +('unmute',1,'Syntax: .unmute [$playerName]\r\n\r\nRestore chat messaging for any character from account of character $playerName (or selected). Character can be ofline.'), +('unpossess',3,'Syntax: .unpossess\r\n\r\nIf you are possessed, unpossesses yourself; otherwise unpossesses current possessed target.'), +('waterwalk',2,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player or self if no player selected.'), +('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'), +('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use trinityd.conf setting.'), +('wp event',2,'Syntax: .wp event $subcommand\nType .path event to see the list of possible subcommands or .help path event $subcommand to see info on subcommands.'), +('wp load',2,'Syntax: .wp load $pathid\nLoad pathid number for selected creature. Creature must have no waypoint data.'), +('wp show',2,'Syntax: .wp show $option\nOptions:\non $pathid (or selected creature with loaded path) - Show path\noff - Hide path\ninfo $slected_waypoint - Show info for selected waypoint.'), +('wp unload',2,'Syntax: .wp unload\nUnload path for selected creature.'); +/*!40000 ALTER TABLE `command` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for `conditions` +-- + +DROP TABLE IF EXISTS `conditions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `conditions` ( + `SourceTypeOrReferenceId` mediumint(8) NOT NULL DEFAULT '0', + `SourceGroup` mediumint(8) unsigned NOT NULL DEFAULT '0', + `SourceEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ElseGroup` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ConditionTypeOrReference` mediumint(8) NOT NULL DEFAULT '0', + `ConditionValue1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ConditionValue2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ConditionValue3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ErrorTextId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Condition System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `conditions` +-- + +LOCK TABLES `conditions` WRITE; +/*!40000 ALTER TABLE `conditions` DISABLE KEYS */; +/*!40000 ALTER TABLE `conditions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature` +-- + +DROP TABLE IF EXISTS `creature`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature` ( + `guid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Global Unique Identifier', + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Identifier', + `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', + `spawnMask` tinyint(3) unsigned NOT NULL DEFAULT '1', + `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `equipment_id` mediumint(9) NOT NULL DEFAULT '0', + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + `orientation` float NOT NULL DEFAULT '0', + `spawntimesecs` int(10) unsigned NOT NULL DEFAULT '120', + `spawndist` float NOT NULL DEFAULT '0', + `currentwaypoint` mediumint(8) unsigned NOT NULL DEFAULT '0', + `curhealth` int(10) unsigned NOT NULL DEFAULT '1', + `curmana` int(10) unsigned NOT NULL DEFAULT '0', + `DeathState` tinyint(3) unsigned NOT NULL DEFAULT '0', + `MovementType` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`), + KEY `idx_map` (`map`), + KEY `idx_id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +ALTER TABLE `creature` AUTO_INCREMENT=250001; + +-- +-- Dumping data for table `creature` +-- + +LOCK TABLES `creature` WRITE; +/*!40000 ALTER TABLE `creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_addon` +-- + +DROP TABLE IF EXISTS `creature_addon`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_addon` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0', + `path_id` int(11) unsigned NOT NULL DEFAULT '0', + `mount` mediumint(8) unsigned NOT NULL DEFAULT '0', + `bytes1` int(10) unsigned NOT NULL DEFAULT '0', + `bytes2` int(10) unsigned NOT NULL DEFAULT '0', + `emote` int(10) unsigned NOT NULL DEFAULT '0', + `auras` text, + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_addon` +-- + +LOCK TABLES `creature_addon` WRITE; +/*!40000 ALTER TABLE `creature_addon` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_addon` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_ai_scripts` +-- + +DROP TABLE IF EXISTS `creature_ai_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_ai_scripts` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + `creature_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Template Identifier', + `event_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Event Type', + `event_inverse_phase_mask` int(11) NOT NULL DEFAULT '0' COMMENT 'Mask which phases this event will not trigger in', + `event_chance` int(3) unsigned NOT NULL DEFAULT '100', + `event_flags` int(3) unsigned NOT NULL DEFAULT '0', + `event_param1` int(11) NOT NULL DEFAULT '0', + `event_param2` int(11) NOT NULL DEFAULT '0', + `event_param3` int(11) NOT NULL DEFAULT '0', + `event_param4` int(11) NOT NULL DEFAULT '0', + `action1_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type', + `action1_param1` int(11) NOT NULL DEFAULT '0', + `action1_param2` int(11) NOT NULL DEFAULT '0', + `action1_param3` int(11) NOT NULL DEFAULT '0', + `action2_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type', + `action2_param1` int(11) NOT NULL DEFAULT '0', + `action2_param2` int(11) NOT NULL DEFAULT '0', + `action2_param3` int(11) NOT NULL DEFAULT '0', + `action3_type` tinyint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type', + `action3_param1` int(11) NOT NULL DEFAULT '0', + `action3_param2` int(11) NOT NULL DEFAULT '0', + `action3_param3` int(11) NOT NULL DEFAULT '0', + `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'Event Comment', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Scripts'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_ai_scripts` +-- + +LOCK TABLES `creature_ai_scripts` WRITE; +/*!40000 ALTER TABLE `creature_ai_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_ai_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_ai_summons` +-- + +DROP TABLE IF EXISTS `creature_ai_summons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_ai_summons` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Location Identifier', + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + `orientation` float NOT NULL DEFAULT '0', + `spawntimesecs` int(11) unsigned NOT NULL DEFAULT '120', + `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'Summon Comment', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_ai_summons` +-- + +LOCK TABLES `creature_ai_summons` WRITE; +/*!40000 ALTER TABLE `creature_ai_summons` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_ai_summons` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_ai_texts` +-- + +DROP TABLE IF EXISTS `creature_ai_texts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_ai_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `language` tinyint(3) unsigned NOT NULL DEFAULT '0', + `emote` smallint(5) unsigned NOT NULL DEFAULT '0', + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_ai_texts` +-- + +LOCK TABLES `creature_ai_texts` WRITE; +/*!40000 ALTER TABLE `creature_ai_texts` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_ai_texts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_classlevelstats` +-- + +DROP TABLE IF EXISTS `creature_classlevelstats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_classlevelstats` ( + `level` tinyint(1) NOT NULL, + `class` tinyint(1) NOT NULL, + `basehp0` smallint(2) NOT NULL, + `basehp1` smallint(2) NOT NULL, + `basehp2` smallint(2) NOT NULL, + `basemana` smallint(2) NOT NULL, + `basearmor` smallint(2) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_classlevelstats`; +-- + +LOCK TABLES `creature_classlevelstats` WRITE; +/*!40000 ALTER TABLE `creature_classlevelstats` DISABLE KEYS */; +INSERT INTO `creature_classlevelstats` (`class`,`level`,`basehp0`,`basehp1`,`basehp2`,`basemana`,`basearmor`) VALUES +(1,1,42,1,1,0,8), +(1,2,55,1,1,0,20), +(1,3,71,1,1,0,33), +(1,4,86,1,1,0,68), +(1,5,102,1,1,0,111), +(1,6,120,1,1,0,165), +(1,7,137,1,1,0,230), +(1,8,156,1,1,0,306), +(1,9,176,1,1,0,387), +(1,10,198,1,1,0,463), +(1,11,222,1,1,0,528), +(1,12,247,1,1,0,562), +(1,13,273,1,1,0,596), +(1,14,300,1,1,0,630), +(1,15,328,1,1,0,665), +(1,16,356,1,1,0,700), +(1,17,386,1,1,0,734), +(1,18,417,1,1,0,768), +(1,19,449,1,1,0,802), +(1,20,484,1,1,0,836), +(1,21,521,1,1,0,872), +(1,22,562,1,1,0,906), +(1,23,605,1,1,0,940), +(1,24,651,1,1,0,975), +(1,25,699,1,1,0,1008), +(1,26,750,1,1,0,1043), +(1,27,800,1,1,0,1078), +(1,28,853,1,1,0,1111), +(1,29,905,1,1,0,1145), +(1,30,955,1,1,0,1179), +(1,31,1006,1,1,0,1213), +(1,32,1057,1,1,0,1249), +(1,33,1110,1,1,0,1281), +(1,34,1163,1,1,0,1317), +(1,35,1220,1,1,0,1349), +(1,36,1277,1,1,0,1456), +(1,37,1336,1,1,0,1568), +(1,38,1395,1,1,0,1684), +(1,39,1459,1,1,0,1808), +(1,40,1524,1,1,0,1938), +(1,41,1585,1,1,0,2074), +(1,42,1651,1,1,0,2218), +(1,43,1716,1,1,0,2369), +(1,44,1782,1,1,0,2528), +(1,45,1848,1,1,0,2695), +(1,46,1919,1,1,0,2750), +(1,47,1990,1,1,0,2804), +(1,48,2062,1,1,0,2857), +(1,49,2138,1,1,0,2912), +(1,50,2215,1,1,0,2966), +(1,51,2292,1,1,0,3018), +(1,52,2371,1,1,0,3060), +(1,53,2453,1,1,0,3128), +(1,54,2533,1,1,0,3180), +(1,55,2614,1,1,0,3234), +(1,56,2699,1,1,0,3289), +(1,57,2784,1,1,0,3342), +(1,58,2871,3989,1,0,3396), +(1,59,2961,4142,1,0,3449), +(1,60,3052,4979,1,0,3750), +(1,61,3144,5158,1,0,4047), +(1,62,3237,5341,1,0,4344), +(1,63,3331,5527,1,0,4641), +(1,64,3427,5715,1,0,4937), +(1,65,3524,5914,1,0,5234), +(1,66,3624,6116,1,0,5531), +(1,67,3728,6326,1,0,5829), +(1,68,3834,6542,6986,0,6126), +(1,69,3942,6761,7984,0,6423), +(1,70,4050,6986,8982,0,6719), +(1,71,4163,7181,9291,0,7018), +(1,72,4278,7380,9610,0,7318), +(1,73,4399,7588,9940,0,7618), +(1,74,4524,7804,10282,0,7918), +(1,75,4652,8025,10635,0,8219), +(1,76,4781,8247,11001,0,8520), +(1,77,4916,8480,11379,0,8822), +(1,78,5052,8715,11770,0,9124), +(1,79,5194,8960,12175,0,9426), +(1,80,5342,9215,12600,0,9729), +(1,81,5492,9474,13033,0,10033), +(1,82,5647,1,13481,0,10356), +(1,83,5808,1,13945,0,10673), +(1,84,1,1,1,0,1), +(1,85,1,1,1,0,1), +(1,86,1,1,1,0,1), +(1,87,1,1,1,0,1), +(1,88,1,1,1,0,1), +(1,89,1,1,1,0,1), +(1,90,1,1,1,0,1), +(1,91,1,1,1,0,1), +(1,92,1,1,1,0,1), +(1,93,1,1,1,0,1), +(1,94,1,1,1,0,1), +(1,95,1,1,1,0,1), +(1,96,1,1,1,0,1), +(1,97,1,1,1,0,1), +(1,98,1,1,1,0,1), +(1,99,1,1,1,0,1), +(1,100,1,1,1,0,1), +(2,1,41,1,1,60,7), +(2,2,54,1,1,69,19), +(2,3,69,1,1,79,33), +(2,4,83,1,1,104,66), +(2,5,98,1,1,115,109), +(2,6,115,1,1,126,163), +(2,7,131,1,1,138,208), +(2,8,148,1,1,165,303), +(2,9,166,1,1,178,369), +(2,10,186,1,1,191,460), +(2,11,208,1,1,205,526), +(2,12,230,1,1,249,560), +(2,13,253,1,1,264,596), +(2,14,276,1,1,295,630), +(2,15,301,1,1,326,665), +(2,16,325,1,1,357,700), +(2,17,350,1,1,390,734), +(2,18,377,1,1,408,768), +(2,19,404,1,1,456,802), +(2,20,433,1,1,490,836), +(2,21,464,1,1,510,872), +(2,22,498,1,1,545,906), +(2,23,533,1,1,581,940), +(2,24,571,1,1,618,975), +(2,25,610,1,1,655,1008), +(2,26,651,1,1,693,1042), +(2,27,690,1,1,732,1078), +(2,28,732,1,1,756,1110), +(2,29,773,1,1,811,1145), +(2,30,811,1,1,852,1178), +(2,31,850,1,1,878,1213), +(2,32,888,1,1,935,1248), +(2,33,928,1,1,963,1281), +(2,34,967,1,1,1007,1316), +(2,35,1009,1,1,1067,1349), +(2,36,1050,1,1,1097,1455), +(2,37,1093,1,1,1142,1567), +(2,38,1135,1,1,1189,1683), +(2,39,1180,1,1,1236,1807), +(2,40,1226,1,1,1283,1937), +(2,41,1268,1,1,1332,2072), +(2,42,1321,1,1,1381,2216), +(2,43,1373,1,1,1432,2367), +(2,44,1426,1,1,1483,2527), +(2,45,1478,1,1,1534,2692), +(2,46,1535,1,1,1587,2749), +(2,47,1592,1,1,1640,2802), +(2,48,1650,1,1,1695,2855), +(2,49,1710,1,1,1750,2910), +(2,50,1772,1,1,1807,2964), +(2,51,1834,1,1,1864,3017), +(2,52,1897,1,1,1923,3072), +(2,53,1962,1,1,1982,3126), +(2,54,2026,1,1,2041,3178), +(2,55,2091,1,1,2117,3232), +(2,56,2159,1,1,2163,3287), +(2,57,2227,1,1,2241,3340), +(2,58,2297,3191,1,2289,3394), +(2,59,2369,3314,1,2369,3447), +(2,60,2442,3984,1,2434,3748), +(2,61,2515,4126,1,2486,4044), +(2,62,2590,4274,1,2568,4340), +(2,63,2665,4422,1,2620,4637), +(2,64,2740,4572,1,2705,4933), +(2,65,2819,4731,1,2790,5228), +(2,66,2899,4892,6116,2846,5523), +(2,67,2982,5060,1,2933,5821), +(2,68,3067,5233,6986,2991,6116), +(2,69,3153,5409,7984,3080,6412), +(2,70,3240,5589,8982,3155,6708), +(2,71,3330,5744,9291,3231,7007), +(2,72,3422,5903,9610,3309,7305), +(2,73,3519,6070,9940,3387,7604), +(2,74,3619,6243,10282,3466,7903), +(2,75,3722,6420,10635,3561,8204), +(2,76,3825,6602,11001,3643,8503), +(2,77,3933,6784,11379,3725,8803), +(2,78,4042,6972,11770,3809,9104), +(2,79,4155,7167,12175,3893,9405), +(2,80,4274,7373,12600,3994,9706), +(2,81,4394,7581,13033,4081,10007), +(2,82,4518,7794,13481,4169,10253), +(2,83,4646,1,13945,4258,10573), +(2,84,1,1,1,1,1), +(2,85,1,1,1,1,1), +(2,86,1,1,1,1,1), +(2,87,1,1,1,1,1), +(2,88,1,1,1,1,1), +(2,89,1,1,1,1,1), +(2,90,1,1,1,1,1), +(2,91,1,1,1,1,1), +(2,92,1,1,1,1,1), +(2,93,1,1,1,1,1), +(2,94,1,1,1,1,1), +(2,95,1,1,1,1,1), +(2,96,1,1,1,1,1), +(2,97,1,1,1,1,1), +(2,98,1,1,1,1,1), +(2,99,1,1,1,1,1), +(2,100,1,1,1,1,1), +(4,1,42,1,1,0,6), +(4,2,55,1,1,0,18), +(4,3,71,1,1,0,31), +(4,4,86,1,1,0,63), +(4,5,102,1,1,0,102), +(4,6,120,1,1,0,152), +(4,7,137,1,1,0,212), +(4,8,156,1,1,0,286), +(4,9,176,1,1,0,363), +(4,10,198,1,1,0,443), +(4,11,222,1,1,0,488), +(4,12,247,1,1,0,519), +(4,13,273,1,1,0,553), +(4,14,300,1,1,0,577), +(4,15,328,1,1,0,612), +(4,16,356,1,1,0,645), +(4,17,386,1,1,0,676), +(4,18,417,1,1,0,706), +(4,19,449,1,1,0,738), +(4,20,484,1,1,0,769), +(4,21,521,1,1,0,801), +(4,22,562,1,1,0,833), +(4,23,605,1,1,0,863), +(4,24,651,1,1,0,895), +(4,25,699,1,1,0,926), +(4,26,750,1,1,0,957), +(4,27,800,1,1,0,989), +(4,28,853,1,1,0,1020), +(4,29,905,1,1,0,1051), +(4,30,955,1,1,0,1082), +(4,31,1006,1,1,0,1113), +(4,32,1057,1,1,0,1146), +(4,33,1110,1,1,0,1173), +(4,34,1163,1,1,0,1208), +(4,35,1220,1,1,0,1237), +(4,36,1277,1,1,0,1349), +(4,37,1336,1,1,0,1434), +(4,38,1395,1,1,0,1538), +(4,39,1459,1,1,0,1649), +(4,40,1524,1,1,0,1764), +(4,41,1585,1,1,0,1886), +(4,42,1651,1,1,0,2015), +(4,43,1716,1,1,0,2148), +(4,44,1782,1,1,0,2303), +(4,45,1848,1,1,0,2436), +(4,46,1919,1,1,0,2485), +(4,47,1990,1,1,0,2535), +(4,48,2062,1,1,0,2582), +(4,49,2138,1,1,0,2631), +(4,50,2215,1,1,0,2680), +(4,51,2292,1,1,0,2728), +(4,52,2371,1,1,0,2778), +(4,53,2453,1,1,0,2826), +(4,54,2533,1,1,0,2874), +(4,55,2614,1,1,0,2922), +(4,56,2699,1,1,0,2972), +(4,57,2784,1,1,0,3020), +(4,58,2871,3989,1,0,3068), +(4,59,2961,4142,1,0,3117), +(4,60,3052,4979,1,0,3388), +(4,61,3144,5158,1,0,3655), +(4,62,3237,5341,1,0,3922), +(4,63,3331,5527,1,0,4189), +(4,64,3427,5715,1,0,4457), +(4,65,3524,5914,1,0,4724), +(4,66,3624,6116,1,0,5104), +(4,67,3728,6326,1,0,5326), +(4,68,3834,6542,6986,0,5527), +(4,69,3942,6761,7984,0,5795), +(4,70,4050,6986,8982,0,6062), +(4,71,4163,7181,9291,0,6332), +(4,72,4278,7380,9610,0,6602), +(4,73,4399,7580,9940,0,6872), +(4,74,4524,1,10282,0,7143), +(4,75,4652,1,10635,0,7415), +(4,76,4781,1,11001,0,7686), +(4,77,4916,1,11379,0,7958), +(4,78,5052,1,11770,0,8230), +(4,79,5194,1,12175,0,8503), +(4,80,5342,1,12600,0,8776), +(4,81,5496,1,13033,0,9068), +(4,82,5647,1,13481,0,9348), +(4,83,5808,1,13945,0,9589), +(4,84,1,1,1,0,1), +(4,85,1,1,1,0,1), +(4,86,1,1,1,0,1), +(4,87,1,1,1,0,1), +(4,88,1,1,1,0,1), +(4,89,1,1,1,0,1), +(4,90,1,1,1,0,1), +(4,91,1,1,1,0,1), +(4,92,1,1,1,0,1), +(4,93,1,1,1,0,1), +(4,94,1,1,1,0,1), +(4,95,1,1,1,0,1), +(4,96,1,1,1,0,1), +(4,97,1,1,1,0,1), +(4,98,1,1,1,0,1), +(4,99,1,1,1,0,1), +(4,100,1,1,1,0,1), +(8,1,40,1,1,120,5), +(8,2,52,1,1,147,16), +(8,3,67,1,1,174,28), +(8,4,81,1,1,202,57), +(8,5,95,1,1,230,93), +(8,6,111,1,1,259,139), +(8,7,126,1,1,289,194), +(8,8,143,1,1,319,265), +(8,9,160,1,1,350,339), +(8,10,178,1,1,382,423), +(8,11,199,1,1,459,447), +(8,12,219,1,1,537,475), +(8,13,241,1,1,601,509), +(8,14,263,1,1,710,523), +(8,15,285,1,1,790,559), +(8,16,307,1,1,856,589), +(8,17,330,1,1,938,617), +(8,18,354,1,1,1020,643), +(8,19,379,1,1,1118,674), +(8,20,405,1,1,1202,701), +(8,21,432,1,1,1272,729), +(8,22,463,1,1,1357,759), +(8,23,494,1,1,1443,786), +(8,24,528,1,1,1545,815), +(8,25,562,1,1,1633,843), +(8,26,598,1,1,1707,871), +(8,27,633,1,1,1812,900), +(8,28,669,1,1,1977,928), +(8,29,704,1,1,2068,957), +(8,30,737,1,1,2175,984), +(8,31,770,1,1,2253,1012), +(8,32,802,1,1,2362,1042), +(8,33,835,1,1,2457,1065), +(8,34,867,1,1,2553,1098), +(8,35,902,1,1,2680,1124), +(8,36,935,1,1,2763,1241), +(8,37,970,1,1,2861,1300), +(8,38,1004,1,1,2975,1391), +(8,39,1040,1,1,3075,1489), +(8,40,1077,1,1,3191,1590), +(8,41,1110,1,1,3293,1697), +(8,42,1156,1,1,3471,1811), +(8,43,1201,1,1,3575,1926), +(8,44,1247,1,1,3680,2078), +(8,45,1294,1,1,3801,2177), +(8,46,1343,1,1,3923,2220), +(8,47,1393,1,1,4031,2265), +(8,48,1443,1,1,4140,2307), +(8,49,1497,1,1,4281,2349), +(8,50,1551,1,1,4393,2393), +(8,51,1604,1,1,4506,2437), +(8,52,1660,1,1,4650,2481), +(8,53,1717,1,1,4765,2524), +(8,54,1773,1,1,4896,2567), +(8,55,1830,1,1,5013,2609), +(8,56,1889,1,1,5206,2654), +(8,57,1949,1,1,5340,2698), +(8,58,2010,2793,1,5461,2740), +(8,59,2073,2899,1,5598,2784), +(8,60,2136,3484,1,5751,3025), +(8,61,2201,3611,1,5875,3263), +(8,62,2266,3739,1,6015,3500), +(8,63,2332,3870,1,6156,3736), +(8,64,2399,4000,1,6229,3977), +(8,65,2467,4140,4731,6443,4214), +(8,66,2552,4281,4892,6588,4460), +(8,67,2610,4429,1,6749,4710), +(8,68,2684,4580,5588,6882,4928), +(8,69,2759,4733,6387,7031,5167), +(8,70,2835,4890,7185,7196,5404), +(8,71,2914,5027,7432,7332,5645), +(8,72,2995,5166,7688,7500,5886), +(8,73,3098,5311,7952,7654,6126), +(8,74,3186,1,8225,7809,6368), +(8,75,3256,5617,8508,7981,6610), +(8,76,3367,1,8800,8139,6851), +(8,77,3462,1,9103,8313,7094), +(8,78,3558,1,9416,8459,7335), +(8,79,3658,1,9740,8636,7579), +(8,80,3739,1,10080,8814,7822), +(8,81,3870,1,10486,8979,8102), +(8,82,3977,1,10784,9160,8340), +(8,83,4090,1,11156,9325,8505), +(8,84,1,1,1,1,1), +(8,85,1,1,1,1,1), +(8,86,1,1,1,1,1), +(8,87,1,1,1,1,1), +(8,88,1,1,1,1,1), +(8,89,1,1,1,1,1), +(8,90,1,1,1,1,1), +(8,91,1,1,1,1,1), +(8,92,1,1,1,1,1), +(8,93,1,1,1,1,1), +(8,94,1,1,1,1,1), +(8,95,1,1,1,1,1), +(8,96,1,1,1,1,1), +(8,97,1,1,1,1,1), +(8,98,1,1,1,1,1), +(8,99,1,1,1,1,1), +(8,100,1,1,1,1,1); +/*!40000 ALTER TABLE `creature_classlevelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_equip_template` +-- + +DROP TABLE IF EXISTS `creature_equip_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_equip_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Unique entry', + `equipentry1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `equipentry2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `equipentry3` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_equip_template` +-- + +LOCK TABLES `creature_equip_template` WRITE; +/*!40000 ALTER TABLE `creature_equip_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_equip_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_formations` +-- + +DROP TABLE IF EXISTS `creature_formations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_formations` ( + `leaderGUID` int(11) unsigned NOT NULL, + `memberGUID` int(11) unsigned NOT NULL, + `dist` float unsigned NOT NULL, + `angle` float unsigned NOT NULL, + `groupAI` int(11) unsigned NOT NULL, + PRIMARY KEY (`memberGUID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_formations` +-- + +LOCK TABLES `creature_formations` WRITE; +/*!40000 ALTER TABLE `creature_formations` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_formations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_involvedrelation` +-- + +DROP TABLE IF EXISTS `creature_involvedrelation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_involvedrelation` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_involvedrelation` +-- + +LOCK TABLES `creature_involvedrelation` WRITE; +/*!40000 ALTER TABLE `creature_involvedrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_involvedrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_linked_respawn` +-- + +DROP TABLE IF EXISTS `creature_linked_respawn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_linked_respawn` ( + `guid` int(10) unsigned NOT NULL COMMENT 'dependent creature', + `linkedGuid` int(10) unsigned NOT NULL COMMENT 'master creature', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature Respawn Link System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_linked_respawn` +-- + +LOCK TABLES `creature_linked_respawn` WRITE; +/*!40000 ALTER TABLE `creature_linked_respawn` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_linked_respawn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_loot_template` +-- + +DROP TABLE IF EXISTS `creature_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_loot_template` +-- + +LOCK TABLES `creature_loot_template` WRITE; +/*!40000 ALTER TABLE `creature_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_model_info` +-- + +DROP TABLE IF EXISTS `creature_model_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_model_info` ( + `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `bounding_radius` float NOT NULL DEFAULT '0', + `combat_reach` float NOT NULL DEFAULT '0', + `gender` tinyint(3) unsigned NOT NULL DEFAULT '2', + `modelid_other_gender` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`modelid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Model related info)'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_model_info` +-- + +LOCK TABLES `creature_model_info` WRITE; +/*!40000 ALTER TABLE `creature_model_info` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_model_info` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_onkill_reputation` +-- + +DROP TABLE IF EXISTS `creature_onkill_reputation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_onkill_reputation` ( + `creature_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Identifier', + `RewOnKillRepFaction1` smallint(6) NOT NULL DEFAULT '0', + `RewOnKillRepFaction2` smallint(6) NOT NULL DEFAULT '0', + `MaxStanding1` tinyint(4) NOT NULL DEFAULT '0', + `IsTeamAward1` tinyint(4) NOT NULL DEFAULT '0', + `RewOnKillRepValue1` mediumint(9) NOT NULL DEFAULT '0', + `MaxStanding2` tinyint(4) NOT NULL DEFAULT '0', + `IsTeamAward2` tinyint(4) NOT NULL DEFAULT '0', + `RewOnKillRepValue2` mediumint(9) NOT NULL DEFAULT '0', + `TeamDependent` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`creature_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature OnKill Reputation gain'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_onkill_reputation` +-- + +LOCK TABLES `creature_onkill_reputation` WRITE; +/*!40000 ALTER TABLE `creature_onkill_reputation` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_onkill_reputation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_questrelation` +-- + +DROP TABLE IF EXISTS `creature_questrelation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_questrelation` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_questrelation` +-- + +LOCK TABLES `creature_questrelation` WRITE; +/*!40000 ALTER TABLE `creature_questrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_questrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_respawn` +-- + +DROP TABLE IF EXISTS `creature_respawn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_respawn` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `respawntime` bigint(20) NOT NULL DEFAULT '0', + `instance` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`,`instance`), + KEY `instance` (`instance`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_respawn` +-- + +LOCK TABLES `creature_respawn` WRITE; +/*!40000 ALTER TABLE `creature_respawn` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_respawn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_template` +-- + +DROP TABLE IF EXISTS `creature_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `difficulty_entry_1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `difficulty_entry_2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `difficulty_entry_3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `KillCredit1` int(11) unsigned NOT NULL DEFAULT '0', + `KillCredit2` int(11) unsigned NOT NULL DEFAULT '0', + `modelid1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `modelid2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `modelid3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `modelid4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(100) NOT NULL DEFAULT '0', + `subname` char(100) DEFAULT NULL, + `IconName` char(100) DEFAULT NULL, + `gossip_menu_id` mediumint(8) unsigned NOT NULL default '0', + `minlevel` tinyint(3) unsigned NOT NULL DEFAULT '1', + `maxlevel` tinyint(3) unsigned NOT NULL DEFAULT '1', + `exp` smallint(2) NOT NULL DEFAULT '0', + `faction_A` smallint(5) unsigned NOT NULL DEFAULT '0', + `faction_H` smallint(5) unsigned NOT NULL DEFAULT '0', + `npcflag` int(10) unsigned NOT NULL DEFAULT '0', + `speed_walk` float NOT NULL default '1' COMMENT 'Result of 2.5/2.5, most common value', + `speed_run` float NOT NULL default '1.14286' COMMENT 'Result of 8.0/7.0, most common value', + `scale` float NOT NULL DEFAULT '1', + `rank` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mindmg` float NOT NULL DEFAULT '0', + `maxdmg` float NOT NULL DEFAULT '0', + `dmgschool` tinyint(4) NOT NULL DEFAULT '0', + `attackpower` int(10) unsigned NOT NULL DEFAULT '0', + `dmg_multiplier` float NOT NULL DEFAULT '1', + `baseattacktime` int(10) unsigned NOT NULL DEFAULT '0', + `rangeattacktime` int(10) unsigned NOT NULL DEFAULT '0', + `unit_class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `unit_flags` int(10) unsigned NOT NULL DEFAULT '0', + `dynamicflags` int(10) unsigned NOT NULL DEFAULT '0', + `family` tinyint(4) NOT NULL DEFAULT '0', + `trainer_type` tinyint(4) NOT NULL DEFAULT '0', + `trainer_spell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `trainer_class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `trainer_race` tinyint(3) unsigned NOT NULL DEFAULT '0', + `minrangedmg` float NOT NULL DEFAULT '0', + `maxrangedmg` float NOT NULL DEFAULT '0', + `rangedattackpower` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `type_flags` int(10) unsigned NOT NULL DEFAULT '0', + `lootid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pickpocketloot` mediumint(8) unsigned NOT NULL DEFAULT '0', + `skinloot` mediumint(8) unsigned NOT NULL DEFAULT '0', + `resistance1` smallint(5) NOT NULL DEFAULT '0', + `resistance2` smallint(5) NOT NULL DEFAULT '0', + `resistance3` smallint(5) NOT NULL DEFAULT '0', + `resistance4` smallint(5) NOT NULL DEFAULT '0', + `resistance5` smallint(5) NOT NULL DEFAULT '0', + `resistance6` smallint(5) NOT NULL DEFAULT '0', + `spell1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell5` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell6` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell7` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell8` mediumint(8) unsigned NOT NULL DEFAULT '0', + `PetSpellDataId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `VehicleId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `mingold` mediumint(8) unsigned NOT NULL DEFAULT '0', + `maxgold` mediumint(8) unsigned NOT NULL DEFAULT '0', + `AIName` char(64) NOT NULL DEFAULT '', + `MovementType` tinyint(3) unsigned NOT NULL DEFAULT '0', + `InhabitType` tinyint(3) unsigned NOT NULL DEFAULT '3', + `Health_mod` float NOT NULL DEFAULT '1', + `Mana_mod` float NOT NULL DEFAULT '1', + `Armor_mod` float NOT NULL DEFAULT '1', + `RacialLeader` tinyint(3) unsigned NOT NULL DEFAULT '0', + `questItem1` int(11) unsigned NOT NULL DEFAULT '0', + `questItem2` int(11) unsigned NOT NULL DEFAULT '0', + `questItem3` int(11) unsigned NOT NULL DEFAULT '0', + `questItem4` int(11) unsigned NOT NULL DEFAULT '0', + `questItem5` int(11) unsigned NOT NULL DEFAULT '0', + `questItem6` int(11) unsigned NOT NULL DEFAULT '0', + `movementId` int(11) unsigned NOT NULL DEFAULT '0', + `RegenHealth` tinyint(3) unsigned NOT NULL DEFAULT '1', + `equipment_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `mechanic_immune_mask` int(10) unsigned NOT NULL DEFAULT '0', + `flags_extra` int(10) unsigned NOT NULL DEFAULT '0', + `ScriptName` char(64) NOT NULL DEFAULT '', + `WDBVerified` smallint(5) signed DEFAULT '1', + PRIMARY KEY (`entry`), + KEY `idx_name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_template` +-- + +LOCK TABLES `creature_template` WRITE; +/*!40000 ALTER TABLE `creature_template` DISABLE KEYS */; +INSERT INTO `creature_template` (`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction_A`,`faction_H`,`npcflag`,`speed_walk`,`scale`,`rank`,`mindmg`,`maxdmg`,`dmgschool`,`attackpower`,`dmg_multiplier`,`baseattacktime`,`rangeattacktime`,`unit_class`,`unit_flags`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`minrangedmg`,`maxrangedmg`,`rangedattackpower`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`Health_mod`,`Mana_mod`,`Armor_mod`,`RacialLeader`,`questItem1`,`questItem2`,`questItem3`,`questItem4`,`questItem5`,`questItem6`,`movementId`,`RegenHealth`,`equipment_id`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`) VALUES (1,0,0,0,0,0,10045,0,0,0,'Waypoint (Only GM can see it)','Visual',NULL,0,1,80,0,35,35,0,0.91,1,0,7,7,0,3,1,2000,2200,1,4096,0,0,0,0,0,0,1.76,2.42,100,8,5242886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'',0,7,0.0125,1,1,0,0,0,0,0,0,0,0,1,0,0,130,''); +/*!40000 ALTER TABLE `creature_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_template_addon` +-- + +DROP TABLE IF EXISTS `creature_template_addon`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creature_template_addon` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path_id` int(11) unsigned NOT NULL DEFAULT '0', + `mount` mediumint(8) unsigned NOT NULL DEFAULT '0', + `bytes1` int(10) unsigned NOT NULL DEFAULT '0', + `bytes2` int(10) unsigned NOT NULL DEFAULT '0', + `emote` mediumint(8) unsigned NOT NULL DEFAULT '0', + `auras` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creature_template_addon` +-- + +LOCK TABLES `creature_template_addon` WRITE; +/*!40000 ALTER TABLE `creature_template_addon` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `custom_texts` +-- + +DROP TABLE IF EXISTS `custom_texts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `custom_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `language` tinyint(3) unsigned NOT NULL DEFAULT '0', + `emote` smallint(5) unsigned NOT NULL DEFAULT '0', + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Custom Texts'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `custom_texts` +-- + +LOCK TABLES `custom_texts` WRITE; +/*!40000 ALTER TABLE `custom_texts` DISABLE KEYS */; +/*!40000 ALTER TABLE `custom_texts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `db_script_string` +-- + +DROP TABLE IF EXISTS `db_script_string`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `db_script_string` ( + `entry` int(11) unsigned NOT NULL DEFAULT '0', + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `db_script_string` +-- + +LOCK TABLES `db_script_string` WRITE; +/*!40000 ALTER TABLE `db_script_string` DISABLE KEYS */; +/*!40000 ALTER TABLE `db_script_string` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `disenchant_loot_template` +-- + +DROP TABLE IF EXISTS `disenchant_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `disenchant_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Recommended id selection: item_level*100 + item_quality', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `disenchant_loot_template` +-- + +LOCK TABLES `disenchant_loot_template` WRITE; +/*!40000 ALTER TABLE `disenchant_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `disenchant_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `event_scripts` +-- + +DROP TABLE IF EXISTS `event_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `event_scripts` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `delay` int(10) unsigned NOT NULL DEFAULT '0', + `command` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong2` int(10) unsigned NOT NULL DEFAULT '0', + `dataint` int(11) NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `z` float NOT NULL DEFAULT '0', + `o` float NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `event_scripts` +-- + +LOCK TABLES `event_scripts` WRITE; +/*!40000 ALTER TABLE `event_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `event_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `exploration_basexp` +-- + +DROP TABLE IF EXISTS `exploration_basexp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `exploration_basexp` ( + `level` tinyint(4) unsigned NOT NULL DEFAULT '0', + `basexp` mediumint(9) NOT NULL DEFAULT '0', + PRIMARY KEY (`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Exploration System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `exploration_basexp` +-- + +LOCK TABLES `exploration_basexp` WRITE; +/*!40000 ALTER TABLE `exploration_basexp` DISABLE KEYS */; +INSERT INTO `exploration_basexp` VALUES (0,0),(1,5),(2,15),(3,25),(4,35),(5,45),(6,55),(7,65),(8,70),(9,80),(10,85),(11,90),(12,90),(13,90),(14,100),(15,105),(16,115),(17,125),(18,135),(19,145),(20,155),(21,165),(22,175),(23,185),(24,195),(25,200),(26,210),(27,220),(28,230),(29,240),(30,245),(31,250),(32,255),(33,265),(34,270),(35,275),(36,280),(37,285),(38,285),(39,300),(40,315),(41,330),(42,345),(43,360),(44,375),(45,390),(46,405),(47,420),(48,440),(49,455),(50,470),(51,490),(52,510),(53,530),(54,540),(55,560),(56,580),(57,600),(58,620),(59,640),(60,660),(61,970),(62,1000),(63,1050),(64,1080),(65,1100),(66,1130),(67,1160),(68,1200),(69,1230),(70,1300); +/*!40000 ALTER TABLE `exploration_basexp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `fishing_loot_template` +-- + +DROP TABLE IF EXISTS `fishing_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `fishing_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `fishing_loot_template` +-- + +LOCK TABLES `fishing_loot_template` WRITE; +/*!40000 ALTER TABLE `fishing_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `fishing_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event` +-- + +DROP TABLE IF EXISTS `game_event`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event` ( + `entry` mediumint(8) unsigned NOT NULL COMMENT 'Entry of the game event', + `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Absolute start date, the event will never start before', + `end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler', + `occurence` bigint(20) unsigned NOT NULL DEFAULT '5184000' COMMENT 'Delay in minutes between occurences of the event', + `length` bigint(20) unsigned NOT NULL DEFAULT '2592000' COMMENT 'Length in minutes of the event', + `holiday` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Client side holiday id', + `description` varchar(255) DEFAULT NULL COMMENT 'Description of the event displayed in console', + `world_event` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '0 if normal event, 1 if world event', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event` +-- + +LOCK TABLES `game_event` WRITE; +/*!40000 ALTER TABLE `game_event` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_battleground_holiday` +-- + +DROP TABLE IF EXISTS `game_event_battleground_holiday`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_battleground_holiday` ( + `event` int(10) unsigned NOT NULL, + `bgflag` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_battleground_holiday` +-- + +LOCK TABLES `game_event_battleground_holiday` WRITE; +/*!40000 ALTER TABLE `game_event_battleground_holiday` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_battleground_holiday` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_condition` +-- + +DROP TABLE IF EXISTS `game_event_condition`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_condition` ( + `event_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `req_num` float DEFAULT '0', + `max_world_state_field` smallint(5) unsigned NOT NULL DEFAULT '0', + `done_world_state_field` smallint(5) unsigned NOT NULL DEFAULT '0', + `description` varchar(25) NOT NULL DEFAULT '', + PRIMARY KEY (`event_id`,`condition_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_condition` +-- + +LOCK TABLES `game_event_condition` WRITE; +/*!40000 ALTER TABLE `game_event_condition` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_condition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_creature` +-- + +DROP TABLE IF EXISTS `game_event_creature`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_creature` ( + `guid` int(10) unsigned NOT NULL, + `event` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Put negatives values to remove during event', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_creature` +-- + +LOCK TABLES `game_event_creature` WRITE; +/*!40000 ALTER TABLE `game_event_creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_creature_quest` +-- + +DROP TABLE IF EXISTS `game_event_creature_quest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_creature_quest` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0', + `event` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_creature_quest` +-- + +LOCK TABLES `game_event_creature_quest` WRITE; +/*!40000 ALTER TABLE `game_event_creature_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_creature_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_gameobject` +-- + +DROP TABLE IF EXISTS `game_event_gameobject`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_gameobject` ( + `guid` int(10) unsigned NOT NULL, + `event` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Put negatives values to remove during event', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_gameobject` +-- + +LOCK TABLES `game_event_gameobject` WRITE; +/*!40000 ALTER TABLE `game_event_gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_gameobject_quest` +-- + +DROP TABLE IF EXISTS `game_event_gameobject_quest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_gameobject_quest` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0', + `event` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`quest`,`event`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_gameobject_quest` +-- + +LOCK TABLES `game_event_gameobject_quest` WRITE; +/*!40000 ALTER TABLE `game_event_gameobject_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_gameobject_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_model_equip` +-- + +DROP TABLE IF EXISTS `game_event_model_equip`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_model_equip` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0', + `modelid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `equipment_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `event` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_model_equip` +-- + +LOCK TABLES `game_event_model_equip` WRITE; +/*!40000 ALTER TABLE `game_event_model_equip` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_model_equip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_npc_gossip` +-- + +DROP TABLE IF EXISTS `game_event_npc_gossip`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_npc_gossip` ( + `guid` int(10) unsigned NOT NULL, + `event_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `textid` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_npc_gossip` +-- + +LOCK TABLES `game_event_npc_gossip` WRITE; +/*!40000 ALTER TABLE `game_event_npc_gossip` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_npc_gossip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_npc_vendor` +-- + +DROP TABLE IF EXISTS `game_event_npc_vendor`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_npc_vendor` ( + `event` mediumint(8) unsigned NOT NULL DEFAULT '0', + `guid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `slot` smallint(6) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) NOT NULL DEFAULT '0', + `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0', + `incrtime` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ExtendedCost` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '', + PRIMARY KEY (`guid`,`item`), + INDEX (`slot`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_npc_vendor` +-- + +LOCK TABLES `game_event_npc_vendor` WRITE; +/*!40000 ALTER TABLE `game_event_npc_vendor` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_npc_vendor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_npcflag` +-- + +DROP TABLE IF EXISTS `game_event_npcflag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_npcflag` ( + `guid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `event_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `npcflag` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`,`event_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_npcflag` +-- + +LOCK TABLES `game_event_npcflag` WRITE; +/*!40000 ALTER TABLE `game_event_npcflag` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_npcflag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_pool` +-- + +DROP TABLE IF EXISTS `game_event_pool`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_pool` ( + `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Id of the pool', + `event` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Put negatives values to remove during event', + PRIMARY KEY (`pool_entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_pool` +-- + +LOCK TABLES `game_event_pool` WRITE; +/*!40000 ALTER TABLE `game_event_pool` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_pool` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_prerequisite` +-- + +DROP TABLE IF EXISTS `game_event_prerequisite`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_prerequisite` ( + `event_id` mediumint(8) unsigned NOT NULL, + `prerequisite_event` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`event_id`,`prerequisite_event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_prerequisite` +-- + +LOCK TABLES `game_event_prerequisite` WRITE; +/*!40000 ALTER TABLE `game_event_prerequisite` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_prerequisite` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_quest_condition` +-- + +DROP TABLE IF EXISTS `game_event_quest_condition`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_event_quest_condition` ( + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0', + `event_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `num` float DEFAULT '0', + PRIMARY KEY (`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_event_quest_condition` +-- + +LOCK TABLES `game_event_quest_condition` WRITE; +/*!40000 ALTER TABLE `game_event_quest_condition` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_quest_condition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_graveyard_zone` +-- + +DROP TABLE IF EXISTS `game_graveyard_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_graveyard_zone` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ghost_zone` mediumint(8) unsigned NOT NULL DEFAULT '0', + `faction` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`ghost_zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_graveyard_zone` +-- + +LOCK TABLES `game_graveyard_zone` WRITE; +/*!40000 ALTER TABLE `game_graveyard_zone` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_graveyard_zone` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_tele` +-- + +DROP TABLE IF EXISTS `game_tele`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_tele` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + `orientation` float NOT NULL DEFAULT '0', + `map` smallint(5) unsigned NOT NULL DEFAULT '0', + `name` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Tele Command'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_tele` +-- + +LOCK TABLES `game_tele` WRITE; +/*!40000 ALTER TABLE `game_tele` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_tele` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_weather` +-- + +DROP TABLE IF EXISTS `game_weather`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_weather` ( + `zone` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spring_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `spring_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `spring_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `summer_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `summer_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `summer_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `fall_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `fall_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `fall_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `winter_rain_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `winter_snow_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + `winter_storm_chance` tinyint(3) unsigned NOT NULL DEFAULT '25', + PRIMARY KEY (`zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Weather System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_weather` +-- + +LOCK TABLES `game_weather` WRITE; +/*!40000 ALTER TABLE `game_weather` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_weather` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject` +-- + +DROP TABLE IF EXISTS `gameobject`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject` ( + `guid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Global Unique Identifier', + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Gameobject Identifier', + `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', + `spawnMask` tinyint(3) unsigned NOT NULL DEFAULT '1', + `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + `orientation` float NOT NULL DEFAULT '0', + `rotation0` float NOT NULL DEFAULT '0', + `rotation1` float NOT NULL DEFAULT '0', + `rotation2` float NOT NULL DEFAULT '0', + `rotation3` float NOT NULL DEFAULT '0', + `spawntimesecs` int(11) NOT NULL DEFAULT '0', + `animprogress` tinyint(3) unsigned NOT NULL DEFAULT '0', + `state` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +ALTER TABLE `gameobject` AUTO_INCREMENT=200001; + +-- +-- Dumping data for table `gameobject` +-- + +LOCK TABLES `gameobject` WRITE; +/*!40000 ALTER TABLE `gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_involvedrelation` +-- + +DROP TABLE IF EXISTS `gameobject_involvedrelation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_involvedrelation` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gameobject_involvedrelation` +-- + +LOCK TABLES `gameobject_involvedrelation` WRITE; +/*!40000 ALTER TABLE `gameobject_involvedrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_involvedrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_loot_template` +-- + +DROP TABLE IF EXISTS `gameobject_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gameobject_loot_template` +-- + +LOCK TABLES `gameobject_loot_template` WRITE; +/*!40000 ALTER TABLE `gameobject_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_questrelation` +-- + +DROP TABLE IF EXISTS `gameobject_questrelation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_questrelation` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gameobject_questrelation` +-- + +LOCK TABLES `gameobject_questrelation` WRITE; +/*!40000 ALTER TABLE `gameobject_questrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_questrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_respawn` +-- + +DROP TABLE IF EXISTS `gameobject_respawn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_respawn` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `respawntime` bigint(20) NOT NULL DEFAULT '0', + `instance` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`,`instance`), + KEY `instance` (`instance`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gameobject_respawn` +-- + +LOCK TABLES `gameobject_respawn` WRITE; +/*!40000 ALTER TABLE `gameobject_respawn` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_respawn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_scripts` +-- + +DROP TABLE IF EXISTS `gameobject_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_scripts` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `delay` int(10) unsigned NOT NULL DEFAULT '0', + `command` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong2` int(10) unsigned NOT NULL DEFAULT '0', + `dataint` int(11) NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `z` float NOT NULL DEFAULT '0', + `o` float NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gameobject_scripts` +-- + +LOCK TABLES `gameobject_scripts` WRITE; +/*!40000 ALTER TABLE `gameobject_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_template` +-- + +DROP TABLE IF EXISTS `gameobject_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `displayId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(100) NOT NULL DEFAULT '', + `IconName` varchar(100) NOT NULL DEFAULT '', + `castBarCaption` varchar(100) NOT NULL DEFAULT '', + `unk1` varchar(100) NOT NULL DEFAULT '', + `faction` smallint(5) unsigned NOT NULL DEFAULT '0', + `flags` int(10) unsigned NOT NULL DEFAULT '0', + `size` float NOT NULL DEFAULT '1', + `questItem1` int(11) unsigned NOT NULL DEFAULT '0', + `questItem2` int(11) unsigned NOT NULL DEFAULT '0', + `questItem3` int(11) unsigned NOT NULL DEFAULT '0', + `questItem4` int(11) unsigned NOT NULL DEFAULT '0', + `questItem5` int(11) unsigned NOT NULL DEFAULT '0', + `questItem6` int(11) unsigned NOT NULL DEFAULT '0', + `data0` int(10) unsigned NOT NULL DEFAULT '0', + `data1` int(11) signed NOT NULL DEFAULT '-1', + `data2` int(10) unsigned NOT NULL DEFAULT '0', + `data3` int(10) unsigned NOT NULL DEFAULT '0', + `data4` int(10) unsigned NOT NULL DEFAULT '0', + `data5` int(10) unsigned NOT NULL DEFAULT '0', + `data6` int(11) signed NOT NULL DEFAULT '-1', + `data7` int(10) unsigned NOT NULL DEFAULT '0', + `data8` int(10) unsigned NOT NULL DEFAULT '0', + `data9` int(10) unsigned NOT NULL DEFAULT '0', + `data10` int(10) unsigned NOT NULL DEFAULT '0', + `data11` int(10) unsigned NOT NULL DEFAULT '0', + `data12` int(10) unsigned NOT NULL DEFAULT '0', + `data13` int(10) unsigned NOT NULL DEFAULT '0', + `data14` int(10) unsigned NOT NULL DEFAULT '0', + `data15` int(10) unsigned NOT NULL DEFAULT '0', + `data16` int(10) unsigned NOT NULL DEFAULT '0', + `data17` int(10) unsigned NOT NULL DEFAULT '0', + `data18` int(10) unsigned NOT NULL DEFAULT '0', + `data19` int(10) unsigned NOT NULL DEFAULT '0', + `data20` int(10) unsigned NOT NULL DEFAULT '0', + `data21` int(10) unsigned NOT NULL DEFAULT '0', + `data22` int(10) unsigned NOT NULL DEFAULT '0', + `data23` int(10) unsigned NOT NULL DEFAULT '0', + `ScriptName` varchar(64) NOT NULL DEFAULT '', + `WDBVerified` smallint(5) signed DEFAULT '1', + PRIMARY KEY (`entry`), + KEY `idx_name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gameobject_template` +-- + +LOCK TABLES `gameobject_template` WRITE; +/*!40000 ALTER TABLE `gameobject_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gossip_scripts` +-- + +DROP TABLE IF EXISTS `gossip_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gossip_scripts` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `command` mediumint(8) unsigned NOT NULL default '0', + `datalong` mediumint(8) unsigned NOT NULL default '0', + `datalong2` int(10) unsigned NOT NULL default '0', + `dataint` int(11) NOT NULL default '0', + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gossip_scripts` +-- + +LOCK TABLES `gossip_scripts` WRITE; +/*!40000 ALTER TABLE `gossip_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `gossip_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gossip_menu` +-- + +DROP TABLE IF EXISTS `gossip_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gossip_menu` ( + entry smallint(6) unsigned NOT NULL default '0', + text_id mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (entry, text_id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gossip_menu` +-- + +LOCK TABLES `gossip_menu` WRITE; +/*!40000 ALTER TABLE `gossip_menu` DISABLE KEYS */; +/*!40000 ALTER TABLE `gossip_menu` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gossip_menu_option` +-- + +DROP TABLE IF EXISTS `gossip_menu_option`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE gossip_menu_option ( + menu_id smallint(6) unsigned NOT NULL default '0', + id smallint(6) unsigned NOT NULL default '0', + option_icon mediumint(8) unsigned NOT NULL default '0', + option_text text, + option_id tinyint(3) unsigned NOT NULL default '0', + npc_option_npcflag int(10) unsigned NOT NULL default '0', + action_menu_id mediumint(8) unsigned NOT NULL default '0', + action_poi_id mediumint(8) unsigned NOT NULL default '0', + action_script_id mediumint(8) unsigned NOT NULL default '0', + box_coded tinyint(3) unsigned NOT NULL default '0', + box_money int(11) unsigned NOT NULL default '0', + box_text text, + PRIMARY KEY (menu_id, id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gossip_menu_option` +-- + +LOCK TABLES `gossip_menu_option` WRITE; +/*!40000 ALTER TABLE `gossip_menu_option` DISABLE KEYS */; +/*!40000 ALTER TABLE `gossip_menu_option` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `instance_template` +-- + +DROP TABLE IF EXISTS `instance_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `instance_template` ( + `map` smallint(5) unsigned NOT NULL, + `parent` int(10) unsigned NOT NULL, + `access_id` bigint(20) unsigned NOT NULL DEFAULT '0', + `startLocX` float DEFAULT NULL, + `startLocY` float DEFAULT NULL, + `startLocZ` float DEFAULT NULL, + `startLocO` float DEFAULT NULL, + `script` varchar(128) NOT NULL DEFAULT '', + `allowMount` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`map`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `instance_template` +-- + +LOCK TABLES `instance_template` WRITE; +/*!40000 ALTER TABLE `instance_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `instance_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_enchantment_template` +-- + +DROP TABLE IF EXISTS `item_enchantment_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_enchantment_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ench` mediumint(8) unsigned NOT NULL DEFAULT '0', + `chance` float unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`ench`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item Random Enchantment System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_enchantment_template` +-- + +LOCK TABLES `item_enchantment_template` WRITE; +/*!40000 ALTER TABLE `item_enchantment_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_enchantment_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_loot_template` +-- + +DROP TABLE IF EXISTS `item_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` smallint(5) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_loot_template` +-- + +LOCK TABLES `item_loot_template` WRITE; +/*!40000 ALTER TABLE `item_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_set_names` +-- + +DROP TABLE IF EXISTS `item_set_names`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_set_names` ( + `entry` mediumint(8) unsigned NOT NULL, + `name` varchar(255) character set utf8 NOT NULL default '', + `InventoryType` tinyint(3) unsigned NOT NULL default '0', + `WDBVerified` smallint(5) signed NOT NULL DEFAULT '1', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_set_names` +-- + +LOCK TABLES `item_set_names` WRITE; +/*!40000 ALTER TABLE `item_set_names` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_set_names` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_required_target` +-- + +DROP TABLE IF EXISTS `item_required_target`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_required_target` ( + `entry` mediumint(8) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `targetEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_required_target` +-- + +LOCK TABLES `item_required_target` WRITE; +/*!40000 ALTER TABLE `item_required_target` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_required_target` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_template` +-- + +DROP TABLE IF EXISTS `item_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `subclass` tinyint(3) unsigned NOT NULL DEFAULT '0', + `unk0` int(11) NOT NULL DEFAULT '-1', + `name` varchar(255) NOT NULL DEFAULT '', + `displayid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Quality` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Flags` bigint(20) signed NOT NULL DEFAULT '0', + `FlagsExtra` int(10) unsigned NOT NULL DEFAULT '0', + `BuyCount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `BuyPrice` bigint(20) signed NOT NULL DEFAULT '0', + `SellPrice` int(10) unsigned NOT NULL DEFAULT '0', + `InventoryType` tinyint(3) unsigned NOT NULL DEFAULT '0', + `AllowableClass` int(11) NOT NULL DEFAULT '-1', + `AllowableRace` int(11) NOT NULL DEFAULT '-1', + `ItemLevel` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `RequiredSkill` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredSkillRank` smallint(5) unsigned NOT NULL DEFAULT '0', + `requiredspell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `requiredhonorrank` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RequiredCityRank` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RequiredReputationFaction` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredReputationRank` smallint(5) unsigned NOT NULL DEFAULT '0', + `maxcount` int(11) signed NOT NULL DEFAULT '0', + `stackable` int(11) signed NOT NULL DEFAULT '1', + `ContainerSlots` tinyint(3) unsigned NOT NULL DEFAULT '0', + `StatsCount` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_type1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value1` smallint(6) NOT NULL DEFAULT '0', + `stat_type2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value2` smallint(6) NOT NULL DEFAULT '0', + `stat_type3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value3` smallint(6) NOT NULL DEFAULT '0', + `stat_type4` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value4` smallint(6) NOT NULL DEFAULT '0', + `stat_type5` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value5` smallint(6) NOT NULL DEFAULT '0', + `stat_type6` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value6` smallint(6) NOT NULL DEFAULT '0', + `stat_type7` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value7` smallint(6) NOT NULL DEFAULT '0', + `stat_type8` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value8` smallint(6) NOT NULL DEFAULT '0', + `stat_type9` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value9` smallint(6) NOT NULL DEFAULT '0', + `stat_type10` tinyint(3) unsigned NOT NULL DEFAULT '0', + `stat_value10` smallint(6) NOT NULL DEFAULT '0', + `ScalingStatDistribution` smallint(6) NOT NULL DEFAULT '0', + `ScalingStatValue` int(6) unsigned NOT NULL DEFAULT '0', + `dmg_min1` float NOT NULL DEFAULT '0', + `dmg_max1` float NOT NULL DEFAULT '0', + `dmg_type1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `dmg_min2` float NOT NULL DEFAULT '0', + `dmg_max2` float NOT NULL DEFAULT '0', + `dmg_type2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `armor` smallint(5) unsigned NOT NULL DEFAULT '0', + `holy_res` tinyint(3) unsigned NOT NULL DEFAULT '0', + `fire_res` tinyint(3) unsigned NOT NULL DEFAULT '0', + `nature_res` tinyint(3) unsigned NOT NULL DEFAULT '0', + `frost_res` tinyint(3) unsigned NOT NULL DEFAULT '0', + `shadow_res` tinyint(3) unsigned NOT NULL DEFAULT '0', + `arcane_res` tinyint(3) unsigned NOT NULL DEFAULT '0', + `delay` smallint(5) unsigned NOT NULL DEFAULT '1000', + `ammo_type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `RangedModRange` float NOT NULL DEFAULT '0', + `spellid_1` mediumint(8) signed NOT NULL DEFAULT '0', + `spelltrigger_1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `spellcharges_1` smallint(4) NOT NULL DEFAULT '0', + `spellppmRate_1` float NOT NULL DEFAULT '0', + `spellcooldown_1` int(11) NOT NULL DEFAULT '-1', + `spellcategory_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `spellcategorycooldown_1` int(11) NOT NULL DEFAULT '-1', + `spellid_2` mediumint(8) signed NOT NULL DEFAULT '0', + `spelltrigger_2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `spellcharges_2` smallint(4) NOT NULL DEFAULT '0', + `spellppmRate_2` float NOT NULL DEFAULT '0', + `spellcooldown_2` int(11) NOT NULL DEFAULT '-1', + `spellcategory_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `spellcategorycooldown_2` int(11) NOT NULL DEFAULT '-1', + `spellid_3` mediumint(8) signed NOT NULL DEFAULT '0', + `spelltrigger_3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `spellcharges_3` smallint(4) NOT NULL DEFAULT '0', + `spellppmRate_3` float NOT NULL DEFAULT '0', + `spellcooldown_3` int(11) NOT NULL DEFAULT '-1', + `spellcategory_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `spellcategorycooldown_3` int(11) NOT NULL DEFAULT '-1', + `spellid_4` mediumint(8) signed NOT NULL DEFAULT '0', + `spelltrigger_4` tinyint(3) unsigned NOT NULL DEFAULT '0', + `spellcharges_4` smallint(4) NOT NULL DEFAULT '0', + `spellppmRate_4` float NOT NULL DEFAULT '0', + `spellcooldown_4` int(11) NOT NULL DEFAULT '-1', + `spellcategory_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `spellcategorycooldown_4` int(11) NOT NULL DEFAULT '-1', + `spellid_5` mediumint(8) signed NOT NULL DEFAULT '0', + `spelltrigger_5` tinyint(3) unsigned NOT NULL DEFAULT '0', + `spellcharges_5` smallint(4) NOT NULL DEFAULT '0', + `spellppmRate_5` float NOT NULL DEFAULT '0', + `spellcooldown_5` int(11) NOT NULL DEFAULT '-1', + `spellcategory_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `spellcategorycooldown_5` int(11) NOT NULL DEFAULT '-1', + `bonding` tinyint(3) unsigned NOT NULL DEFAULT '0', + `description` varchar(255) NOT NULL DEFAULT '', + `PageText` mediumint(8) unsigned NOT NULL DEFAULT '0', + `LanguageID` tinyint(3) unsigned NOT NULL DEFAULT '0', + `PageMaterial` tinyint(3) unsigned NOT NULL DEFAULT '0', + `startquest` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lockid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Material` tinyint(4) NOT NULL DEFAULT '0', + `sheath` tinyint(3) unsigned NOT NULL DEFAULT '0', + `RandomProperty` mediumint(8) signed NOT NULL DEFAULT '0', + `RandomSuffix` mediumint(8) unsigned NOT NULL DEFAULT '0', + `block` mediumint(8) unsigned NOT NULL DEFAULT '0', + `itemset` mediumint(8) unsigned NOT NULL DEFAULT '0', + `MaxDurability` smallint(5) unsigned NOT NULL DEFAULT '0', + `area` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Map` smallint(6) NOT NULL DEFAULT '0', + `BagFamily` mediumint(9) NOT NULL DEFAULT '0', + `TotemCategory` mediumint(9) NOT NULL DEFAULT '0', + `socketColor_1` tinyint(4) NOT NULL DEFAULT '0', + `socketContent_1` mediumint(9) NOT NULL DEFAULT '0', + `socketColor_2` tinyint(4) NOT NULL DEFAULT '0', + `socketContent_2` mediumint(9) NOT NULL DEFAULT '0', + `socketColor_3` tinyint(4) NOT NULL DEFAULT '0', + `socketContent_3` mediumint(9) NOT NULL DEFAULT '0', + `socketBonus` mediumint(9) NOT NULL DEFAULT '0', + `GemProperties` mediumint(9) NOT NULL DEFAULT '0', + `RequiredDisenchantSkill` smallint(6) NOT NULL DEFAULT '-1', + `ArmorDamageModifier` float NOT NULL DEFAULT '0', + `Duration` int(11) NOT NULL DEFAULT '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time', + `ItemLimitCategory` smallint(6) NOT NULL DEFAULT '0', + `HolidayId` int(11) unsigned NOT NULL DEFAULT '0', + `ScriptName` varchar(64) NOT NULL DEFAULT '', + `DisenchantID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `FoodType` tinyint(3) unsigned NOT NULL DEFAULT '0', + `minMoneyLoot` int(10) unsigned NOT NULL DEFAULT '0', + `maxMoneyLoot` int(10) unsigned NOT NULL DEFAULT '0', + `WDBVerified` smallint(5) signed DEFAULT '1', + PRIMARY KEY (`entry`), + KEY `idx_name` (`name`), + KEY `items_index` (`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `item_template` +-- + +LOCK TABLES `item_template` WRITE; +/*!40000 ALTER TABLE `item_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_achievement_reward` +-- + +DROP TABLE IF EXISTS `locales_achievement_reward`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_achievement_reward` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `subject_loc1` varchar(100) NOT NULL DEFAULT '', + `subject_loc2` varchar(100) NOT NULL DEFAULT '', + `subject_loc3` varchar(100) NOT NULL DEFAULT '', + `subject_loc4` varchar(100) NOT NULL DEFAULT '', + `subject_loc5` varchar(100) NOT NULL DEFAULT '', + `subject_loc6` varchar(100) NOT NULL DEFAULT '', + `subject_loc7` varchar(100) NOT NULL DEFAULT '', + `subject_loc8` varchar(100) NOT NULL DEFAULT '', + `text_loc1` text, + `text_loc2` text, + `text_loc3` text, + `text_loc4` text, + `text_loc5` text, + `text_loc6` text, + `text_loc7` text, + `text_loc8` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_achievement_reward` +-- + +LOCK TABLES `locales_achievement_reward` WRITE; +/*!40000 ALTER TABLE `locales_achievement_reward` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_achievement_reward` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_creature` +-- + +DROP TABLE IF EXISTS `locales_creature`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_creature` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name_loc1` varchar(100) NOT NULL DEFAULT '', + `name_loc2` varchar(100) NOT NULL DEFAULT '', + `name_loc3` varchar(100) NOT NULL DEFAULT '', + `name_loc4` varchar(100) NOT NULL DEFAULT '', + `name_loc5` varchar(100) NOT NULL DEFAULT '', + `name_loc6` varchar(100) NOT NULL DEFAULT '', + `name_loc7` varchar(100) NOT NULL DEFAULT '', + `name_loc8` varchar(100) NOT NULL DEFAULT '', + `subname_loc1` varchar(100) DEFAULT NULL, + `subname_loc2` varchar(100) DEFAULT NULL, + `subname_loc3` varchar(100) DEFAULT NULL, + `subname_loc4` varchar(100) DEFAULT NULL, + `subname_loc5` varchar(100) DEFAULT NULL, + `subname_loc6` varchar(100) DEFAULT NULL, + `subname_loc7` varchar(100) DEFAULT NULL, + `subname_loc8` varchar(100) DEFAULT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_creature` +-- + +LOCK TABLES `locales_creature` WRITE; +/*!40000 ALTER TABLE `locales_creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_gameobject` +-- + +DROP TABLE IF EXISTS `locales_gameobject`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_gameobject` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name_loc1` varchar(100) NOT NULL DEFAULT '', + `name_loc2` varchar(100) NOT NULL DEFAULT '', + `name_loc3` varchar(100) NOT NULL DEFAULT '', + `name_loc4` varchar(100) NOT NULL DEFAULT '', + `name_loc5` varchar(100) NOT NULL DEFAULT '', + `name_loc6` varchar(100) NOT NULL DEFAULT '', + `name_loc7` varchar(100) NOT NULL DEFAULT '', + `name_loc8` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc1` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc2` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc3` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc4` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc5` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc6` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc7` varchar(100) NOT NULL DEFAULT '', + `castbarcaption_loc8` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_gameobject` +-- + +LOCK TABLES `locales_gameobject` WRITE; +/*!40000 ALTER TABLE `locales_gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_item` +-- + +DROP TABLE IF EXISTS `locales_item`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_item` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name_loc1` varchar(100) NOT NULL DEFAULT '', + `name_loc2` varchar(100) NOT NULL DEFAULT '', + `name_loc3` varchar(100) NOT NULL DEFAULT '', + `name_loc4` varchar(100) NOT NULL DEFAULT '', + `name_loc5` varchar(100) NOT NULL DEFAULT '', + `name_loc6` varchar(100) NOT NULL DEFAULT '', + `name_loc7` varchar(100) NOT NULL DEFAULT '', + `name_loc8` varchar(100) NOT NULL DEFAULT '', + `description_loc1` varchar(255) DEFAULT NULL, + `description_loc2` varchar(255) DEFAULT NULL, + `description_loc3` varchar(255) DEFAULT NULL, + `description_loc4` varchar(255) DEFAULT NULL, + `description_loc5` varchar(255) DEFAULT NULL, + `description_loc6` varchar(255) DEFAULT NULL, + `description_loc7` varchar(255) DEFAULT NULL, + `description_loc8` varchar(255) DEFAULT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_item` +-- + +LOCK TABLES `locales_item` WRITE; +/*!40000 ALTER TABLE `locales_item` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_item` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_item_set_names` +-- + +DROP TABLE IF EXISTS `locales_item_set_names`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_item_set_names` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name_loc1` varchar(100) NOT NULL DEFAULT '', + `name_loc2` varchar(100) NOT NULL DEFAULT '', + `name_loc3` varchar(100) NOT NULL DEFAULT '', + `name_loc4` varchar(100) NOT NULL DEFAULT '', + `name_loc5` varchar(100) NOT NULL DEFAULT '', + `name_loc6` varchar(100) NOT NULL DEFAULT '', + `name_loc7` varchar(100) NOT NULL DEFAULT '', + `name_loc8` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_item_set_names` +-- + +LOCK TABLES `locales_item_set_names` WRITE; +/*!40000 ALTER TABLE `locales_item_set_names` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_item_set_names` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_gossip_menu_option` +-- + +DROP TABLE IF EXISTS `locales_gossip_menu_option`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_gossip_menu_option` ( + `menu_id` smallint(6) unsigned NOT NULL DEFAULT '0', + `id` smallint(6) unsigned NOT NULL DEFAULT '0', + `option_text_loc1` text, + `option_text_loc2` text, + `option_text_loc3` text, + `option_text_loc4` text, + `option_text_loc5` text, + `option_text_loc6` text, + `option_text_loc7` text, + `option_text_loc8` text, + `box_text_loc1` text, + `box_text_loc2` text, + `box_text_loc3` text, + `box_text_loc4` text, + `box_text_loc5` text, + `box_text_loc6` text, + `box_text_loc7` text, + `box_text_loc8` text, + PRIMARY KEY (`menu_id`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_gossip_menu_option` +-- + +LOCK TABLES `locales_gossip_menu_option` WRITE; +/*!40000 ALTER TABLE `locales_gossip_menu_option` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_gossip_menu_option` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_npc_text` +-- + +DROP TABLE IF EXISTS `locales_npc_text`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_npc_text` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Text0_0_loc1` longtext, + `Text0_0_loc2` longtext, + `Text0_0_loc3` longtext, + `Text0_0_loc4` longtext, + `Text0_0_loc5` longtext, + `Text0_0_loc6` longtext, + `Text0_0_loc7` longtext, + `Text0_0_loc8` longtext, + `Text0_1_loc1` longtext, + `Text0_1_loc2` longtext, + `Text0_1_loc3` longtext, + `Text0_1_loc4` longtext, + `Text0_1_loc5` longtext, + `Text0_1_loc6` longtext, + `Text0_1_loc7` longtext, + `Text0_1_loc8` longtext, + `Text1_0_loc1` longtext, + `Text1_0_loc2` longtext, + `Text1_0_loc3` longtext, + `Text1_0_loc4` longtext, + `Text1_0_loc5` longtext, + `Text1_0_loc6` longtext, + `Text1_0_loc7` longtext, + `Text1_0_loc8` longtext, + `Text1_1_loc1` longtext, + `Text1_1_loc2` longtext, + `Text1_1_loc3` longtext, + `Text1_1_loc4` longtext, + `Text1_1_loc5` longtext, + `Text1_1_loc6` longtext, + `Text1_1_loc7` longtext, + `Text1_1_loc8` longtext, + `Text2_0_loc1` longtext, + `Text2_0_loc2` longtext, + `Text2_0_loc3` longtext, + `Text2_0_loc4` longtext, + `Text2_0_loc5` longtext, + `Text2_0_loc6` longtext, + `Text2_0_loc7` longtext, + `Text2_0_loc8` longtext, + `Text2_1_loc1` longtext, + `Text2_1_loc2` longtext, + `Text2_1_loc3` longtext, + `Text2_1_loc4` longtext, + `Text2_1_loc5` longtext, + `Text2_1_loc6` longtext, + `Text2_1_loc7` longtext, + `Text2_1_loc8` longtext, + `Text3_0_loc1` longtext, + `Text3_0_loc2` longtext, + `Text3_0_loc3` longtext, + `Text3_0_loc4` longtext, + `Text3_0_loc5` longtext, + `Text3_0_loc6` longtext, + `Text3_0_loc7` longtext, + `Text3_0_loc8` longtext, + `Text3_1_loc1` longtext, + `Text3_1_loc2` longtext, + `Text3_1_loc3` longtext, + `Text3_1_loc4` longtext, + `Text3_1_loc5` longtext, + `Text3_1_loc6` longtext, + `Text3_1_loc7` longtext, + `Text3_1_loc8` longtext, + `Text4_0_loc1` longtext, + `Text4_0_loc2` longtext, + `Text4_0_loc3` longtext, + `Text4_0_loc4` longtext, + `Text4_0_loc5` longtext, + `Text4_0_loc6` longtext, + `Text4_0_loc7` longtext, + `Text4_0_loc8` longtext, + `Text4_1_loc1` longtext, + `Text4_1_loc2` longtext, + `Text4_1_loc3` longtext, + `Text4_1_loc4` longtext, + `Text4_1_loc5` longtext, + `Text4_1_loc6` longtext, + `Text4_1_loc7` longtext, + `Text4_1_loc8` longtext, + `Text5_0_loc1` longtext, + `Text5_0_loc2` longtext, + `Text5_0_loc3` longtext, + `Text5_0_loc4` longtext, + `Text5_0_loc5` longtext, + `Text5_0_loc6` longtext, + `Text5_0_loc7` longtext, + `Text5_0_loc8` longtext, + `Text5_1_loc1` longtext, + `Text5_1_loc2` longtext, + `Text5_1_loc3` longtext, + `Text5_1_loc4` longtext, + `Text5_1_loc5` longtext, + `Text5_1_loc6` longtext, + `Text5_1_loc7` longtext, + `Text5_1_loc8` longtext, + `Text6_0_loc1` longtext, + `Text6_0_loc2` longtext, + `Text6_0_loc3` longtext, + `Text6_0_loc4` longtext, + `Text6_0_loc5` longtext, + `Text6_0_loc6` longtext, + `Text6_0_loc7` longtext, + `Text6_0_loc8` longtext, + `Text6_1_loc1` longtext, + `Text6_1_loc2` longtext, + `Text6_1_loc3` longtext, + `Text6_1_loc4` longtext, + `Text6_1_loc5` longtext, + `Text6_1_loc6` longtext, + `Text6_1_loc7` longtext, + `Text6_1_loc8` longtext, + `Text7_0_loc1` longtext, + `Text7_0_loc2` longtext, + `Text7_0_loc3` longtext, + `Text7_0_loc4` longtext, + `Text7_0_loc5` longtext, + `Text7_0_loc6` longtext, + `Text7_0_loc7` longtext, + `Text7_0_loc8` longtext, + `Text7_1_loc1` longtext, + `Text7_1_loc2` longtext, + `Text7_1_loc3` longtext, + `Text7_1_loc4` longtext, + `Text7_1_loc5` longtext, + `Text7_1_loc6` longtext, + `Text7_1_loc7` longtext, + `Text7_1_loc8` longtext, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_npc_text` +-- + +LOCK TABLES `locales_npc_text` WRITE; +/*!40000 ALTER TABLE `locales_npc_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_npc_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_page_text` +-- + +DROP TABLE IF EXISTS `locales_page_text`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_page_text` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Text_loc1` longtext, + `Text_loc2` longtext, + `Text_loc3` longtext, + `Text_loc4` longtext, + `Text_loc5` longtext, + `Text_loc6` longtext, + `Text_loc7` longtext, + `Text_loc8` longtext, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_page_text` +-- + +LOCK TABLES `locales_page_text` WRITE; +/*!40000 ALTER TABLE `locales_page_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_page_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_points_of_interest` +-- + +DROP TABLE IF EXISTS `locales_points_of_interest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_points_of_interest` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `icon_name_loc1` text, + `icon_name_loc2` text, + `icon_name_loc3` text, + `icon_name_loc4` text, + `icon_name_loc5` text, + `icon_name_loc6` text, + `icon_name_loc7` text, + `icon_name_loc8` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_points_of_interest` +-- + +LOCK TABLES `locales_points_of_interest` WRITE; +/*!40000 ALTER TABLE `locales_points_of_interest` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_points_of_interest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_quest` +-- + +DROP TABLE IF EXISTS `locales_quest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_quest` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Title_loc1` text, + `Title_loc2` text, + `Title_loc3` text, + `Title_loc4` text, + `Title_loc5` text, + `Title_loc6` text, + `Title_loc7` text, + `Title_loc8` text, + `Details_loc1` text, + `Details_loc2` text, + `Details_loc3` text, + `Details_loc4` text, + `Details_loc5` text, + `Details_loc6` text, + `Details_loc7` text, + `Details_loc8` text, + `Objectives_loc1` text, + `Objectives_loc2` text, + `Objectives_loc3` text, + `Objectives_loc4` text, + `Objectives_loc5` text, + `Objectives_loc6` text, + `Objectives_loc7` text, + `Objectives_loc8` text, + `OfferRewardText_loc1` text, + `OfferRewardText_loc2` text, + `OfferRewardText_loc3` text, + `OfferRewardText_loc4` text, + `OfferRewardText_loc5` text, + `OfferRewardText_loc6` text, + `OfferRewardText_loc7` text, + `OfferRewardText_loc8` text, + `RequestItemsText_loc1` text, + `RequestItemsText_loc2` text, + `RequestItemsText_loc3` text, + `RequestItemsText_loc4` text, + `RequestItemsText_loc5` text, + `RequestItemsText_loc6` text, + `RequestItemsText_loc7` text, + `RequestItemsText_loc8` text, + `EndText_loc1` text, + `EndText_loc2` text, + `EndText_loc3` text, + `EndText_loc4` text, + `EndText_loc5` text, + `EndText_loc6` text, + `EndText_loc7` text, + `EndText_loc8` text, + `CompletedText_loc1` text, + `CompletedText_loc2` text, + `CompletedText_loc3` text, + `CompletedText_loc4` text, + `CompletedText_loc5` text, + `CompletedText_loc6` text, + `CompletedText_loc7` text, + `CompletedText_loc8` text, + `ObjectiveText1_loc1` text, + `ObjectiveText1_loc2` text, + `ObjectiveText1_loc3` text, + `ObjectiveText1_loc4` text, + `ObjectiveText1_loc5` text, + `ObjectiveText1_loc6` text, + `ObjectiveText1_loc7` text, + `ObjectiveText1_loc8` text, + `ObjectiveText2_loc1` text, + `ObjectiveText2_loc2` text, + `ObjectiveText2_loc3` text, + `ObjectiveText2_loc4` text, + `ObjectiveText2_loc5` text, + `ObjectiveText2_loc6` text, + `ObjectiveText2_loc7` text, + `ObjectiveText2_loc8` text, + `ObjectiveText3_loc1` text, + `ObjectiveText3_loc2` text, + `ObjectiveText3_loc3` text, + `ObjectiveText3_loc4` text, + `ObjectiveText3_loc5` text, + `ObjectiveText3_loc6` text, + `ObjectiveText3_loc7` text, + `ObjectiveText3_loc8` text, + `ObjectiveText4_loc1` text, + `ObjectiveText4_loc2` text, + `ObjectiveText4_loc3` text, + `ObjectiveText4_loc4` text, + `ObjectiveText4_loc5` text, + `ObjectiveText4_loc6` text, + `ObjectiveText4_loc7` text, + `ObjectiveText4_loc8` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `locales_quest` +-- + +LOCK TABLES `locales_quest` WRITE; +/*!40000 ALTER TABLE `locales_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mail_level_reward` +-- + +DROP TABLE IF EXISTS `mail_level_reward`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mail_level_reward` ( + `level` tinyint(3) unsigned NOT NULL DEFAULT '0', + `raceMask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `mailTemplateId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `senderEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`level`,`raceMask`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Mail System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mail_level_reward` +-- + +LOCK TABLES `mail_level_reward` WRITE; +/*!40000 ALTER TABLE `mail_level_reward` DISABLE KEYS */; +/*!40000 ALTER TABLE `mail_level_reward` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mail_loot_template` +-- + +DROP TABLE IF EXISTS `mail_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mail_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mail_loot_template` +-- + +LOCK TABLES `mail_loot_template` WRITE; +/*!40000 ALTER TABLE `mail_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `mail_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `milling_loot_template` +-- + +DROP TABLE IF EXISTS `milling_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `milling_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `milling_loot_template` +-- + +LOCK TABLES `milling_loot_template` WRITE; +/*!40000 ALTER TABLE `milling_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `milling_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_gossip` +-- + +DROP TABLE IF EXISTS `npc_gossip`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `npc_gossip` ( + `npc_guid` int(10) unsigned NOT NULL DEFAULT '0', + `textid` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`npc_guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `npc_gossip` +-- + +LOCK TABLES `npc_gossip` WRITE; +/*!40000 ALTER TABLE `npc_gossip` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_gossip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_spellclick_spells` +-- + +DROP TABLE IF EXISTS `npc_spellclick_spells`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `npc_spellclick_spells` ( + `npc_entry` int(10) unsigned NOT NULL COMMENT 'reference to creature_template', + `spell_id` int(10) unsigned NOT NULL COMMENT 'spell which should be casted ', + `quest_start` mediumint(8) unsigned NOT NULL COMMENT 'reference to quest_template', + `quest_start_active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `quest_end` mediumint(8) unsigned NOT NULL DEFAULT '0', + `cast_flags` tinyint(3) unsigned NOT NULL COMMENT 'first bit defines caster: 1=player, 0=creature; second bit defines target, same mapping as caster bit', + `aura_required` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'player without aura cant click', + `aura_forbidden` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'player with aura cant click', + `user_type` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'relation with summoner: 0-no 1-friendly 2-raid 3-party player can click' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `npc_spellclick_spells` +-- + +LOCK TABLES `npc_spellclick_spells` WRITE; +/*!40000 ALTER TABLE `npc_spellclick_spells` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_spellclick_spells` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_text` +-- + +DROP TABLE IF EXISTS `npc_text`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `npc_text` ( + `ID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `text0_0` longtext, + `text0_1` longtext, + `lang0` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob0` float NOT NULL DEFAULT '0', + `em0_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em0_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em0_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em0_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em0_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em0_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text1_0` longtext, + `text1_1` longtext, + `lang1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob1` float NOT NULL DEFAULT '0', + `em1_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em1_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em1_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em1_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em1_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em1_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text2_0` longtext, + `text2_1` longtext, + `lang2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob2` float NOT NULL DEFAULT '0', + `em2_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em2_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em2_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em2_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em2_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em2_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text3_0` longtext, + `text3_1` longtext, + `lang3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob3` float NOT NULL DEFAULT '0', + `em3_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em3_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em3_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em3_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em3_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em3_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text4_0` longtext, + `text4_1` longtext, + `lang4` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob4` float NOT NULL DEFAULT '0', + `em4_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em4_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em4_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em4_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em4_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em4_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text5_0` longtext, + `text5_1` longtext, + `lang5` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob5` float NOT NULL DEFAULT '0', + `em5_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em5_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em5_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em5_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em5_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em5_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text6_0` longtext, + `text6_1` longtext, + `lang6` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob6` float NOT NULL DEFAULT '0', + `em6_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em6_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em6_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em6_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em6_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em6_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `text7_0` longtext, + `text7_1` longtext, + `lang7` tinyint(3) unsigned NOT NULL DEFAULT '0', + `prob7` float NOT NULL DEFAULT '0', + `em7_0` smallint(5) unsigned NOT NULL DEFAULT '0', + `em7_1` smallint(5) unsigned NOT NULL DEFAULT '0', + `em7_2` smallint(5) unsigned NOT NULL DEFAULT '0', + `em7_3` smallint(5) unsigned NOT NULL DEFAULT '0', + `em7_4` smallint(5) unsigned NOT NULL DEFAULT '0', + `em7_5` smallint(5) unsigned NOT NULL DEFAULT '0', + `WDBVerified` smallint(5) signed DEFAULT '1', + PRIMARY KEY (`ID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `npc_text` +-- + +LOCK TABLES `npc_text` WRITE; +/*!40000 ALTER TABLE `npc_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_trainer` +-- + +DROP TABLE IF EXISTS `npc_trainer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `npc_trainer` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `spell` mediumint(8) NOT NULL DEFAULT '0', + `spellcost` int(10) unsigned NOT NULL DEFAULT '0', + `reqskill` smallint(5) unsigned NOT NULL DEFAULT '0', + `reqskillvalue` smallint(5) unsigned NOT NULL DEFAULT '0', + `reqlevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `npc_trainer` +-- + +LOCK TABLES `npc_trainer` WRITE; +/*!40000 ALTER TABLE `npc_trainer` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_trainer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_vendor` +-- + +DROP TABLE IF EXISTS `npc_vendor`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `npc_vendor` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `slot` smallint(6) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '0', + `incrtime` int(10) unsigned NOT NULL DEFAULT '0', + `ExtendedCost` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`,`extendedCost`), + INDEX (`slot`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `npc_vendor` +-- + +LOCK TABLES `npc_vendor` WRITE; +/*!40000 ALTER TABLE `npc_vendor` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_vendor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `page_text` +-- + +DROP TABLE IF EXISTS `page_text`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `page_text` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `text` longtext NOT NULL, + `next_page` mediumint(8) unsigned NOT NULL DEFAULT '0', + `WDBVerified` smallint(5) signed DEFAULT '1', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Item System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `page_text` +-- + +LOCK TABLES `page_text` WRITE; +/*!40000 ALTER TABLE `page_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `page_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_levelstats` +-- + +DROP TABLE IF EXISTS `pet_levelstats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pet_levelstats` ( + `creature_entry` mediumint(8) unsigned NOT NULL, + `level` tinyint(3) unsigned NOT NULL, + `hp` smallint(5) unsigned NOT NULL, + `mana` smallint(5) unsigned NOT NULL, + `armor` int(10) unsigned NOT NULL DEFAULT '0', + `str` smallint(5) unsigned NOT NULL, + `agi` smallint(5) unsigned NOT NULL, + `sta` smallint(5) unsigned NOT NULL, + `inte` smallint(5) unsigned NOT NULL, + `spi` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`creature_entry`,`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores pet levels stats.'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pet_levelstats` +-- + +LOCK TABLES `pet_levelstats` WRITE; +/*!40000 ALTER TABLE `pet_levelstats` DISABLE KEYS */; +INSERT INTO `pet_levelstats` VALUES (1,1,42,1,20,22,20,22,20,20),(1,2,55,1,21,23,21,23,20,20),(1,3,71,1,46,24,21,24,20,21),(1,4,86,1,82,25,22,25,21,21),(1,5,102,1,126,26,23,25,21,21),(1,6,120,1,180,27,24,26,21,22),(1,7,137,1,245,28,24,27,21,22),(1,8,156,1,322,29,25,28,22,22),(1,9,176,1,412,30,26,29,22,23),(1,10,198,1,518,31,26,30,22,23),(1,11,222,1,545,32,27,34,22,24),(1,12,247,1,580,33,28,38,23,25),(1,13,273,1,615,34,30,42,23,25),(1,14,300,1,650,35,31,46,23,27),(1,15,328,1,685,37,32,51,24,28),(1,16,356,1,721,38,33,55,25,29),(1,17,386,1,756,40,34,59,25,30),(1,18,417,1,791,42,36,63,25,30),(1,19,449,1,826,44,37,67,26,32),(1,20,484,1,861,45,39,72,27,33),(1,21,521,1,897,47,39,76,27,34),(1,22,562,1,932,49,40,80,27,35),(1,23,605,1,967,50,42,84,28,36),(1,24,651,1,1002,52,43,88,28,37),(1,25,699,1,1037,53,45,94,29,39),(1,26,750,1,1072,55,46,98,30,39),(1,27,800,1,1108,56,47,102,30,40),(1,28,853,1,1142,58,49,106,30,41),(1,29,905,1,1177,60,50,110,31,42),(1,30,955,1,1212,61,52,115,32,44),(1,31,1006,1,1247,63,53,120,32,44),(1,32,1057,1,1283,64,54,124,33,46),(1,33,1110,1,1317,66,56,128,33,46),(1,34,1163,1,1353,67,57,132,33,48),(1,35,1220,1,1387,69,59,138,35,49),(1,36,1277,1,1494,70,60,142,35,50),(1,37,1336,1,1607,72,61,146,35,52),(1,38,1395,1,1724,74,63,151,36,52),(1,39,1459,1,1849,76,64,155,36,54),(1,40,1524,1,1980,78,66,160,37,55),(1,41,1585,1,2117,81,68,165,38,56),(1,42,1651,1,2262,86,69,169,38,57),(1,43,1716,1,2414,91,71,174,39,58),(1,44,1782,1,2574,97,72,178,39,59),(1,45,1848,1,2742,102,74,184,40,61),(1,46,1919,1,2798,104,75,188,41,62),(1,47,1990,1,2853,106,77,193,41,63),(1,48,2062,1,2907,108,79,197,42,64),(1,49,2138,1,2963,110,80,202,42,66),(1,50,2215,1,3018,113,82,207,43,67),(1,51,2292,1,3072,115,84,212,44,68),(1,52,2371,1,3128,117,85,216,44,69),(1,53,2453,1,3183,119,87,221,45,70),(1,54,2533,1,3237,122,89,226,45,72),(1,55,2614,1,3292,124,91,231,47,73),(1,56,2699,1,3348,127,92,236,47,74),(1,57,2784,1,3402,129,94,241,48,76),(1,58,2871,1,3457,131,96,245,48,77),(1,59,2961,1,3512,134,98,250,49,78),(1,60,3052,1,3814,136,100,256,50,80),(1,61,3144,1,4113,139,102,161,51,81),(1,62,3237,1,4410,141,105,266,52,83),(1,63,3331,1,4708,144,107,271,53,85),(1,64,3425,1,5006,146,110,276,54,87),(1,65,3524,1,5303,149,113,281,55,89),(1,66,3624,1,5601,151,116,287,56,91),(1,67,3728,1,5900,154,119,292,57,93),(1,68,3834,1,6197,156,122,297,58,95),(1,69,3941,1,6495,159,125,302,59,97),(1,70,4051,1,6794,162,128,307,60,99),(416,70,1528,2568,2207,145,39,101,334,264),(416,69,1464,2351,2008,144,36,100,327,262),(416,68,1429,2298,1987,143,34,98,320,260),(416,67,1401,2244,1900,142,33,98,313,258),(416,66,1357,2191,1872,141,33,97,306,255),(416,65,1335,2137,1844,140,33,97,299,250),(416,64,1292,2084,1809,139,33,95,292,247),(416,63,1188,2030,1732,137,32,92,285,244),(416,62,1050,1977,1663,135,31,90,278,241),(416,61,973,1925,1608,132,29,88,271,239),(416,60,920,1898,1163,122,27,86,264,197),(416,59,878,1824,1150,127,27,85,258,192),(416,58,862,1763,1125,125,27,84,250,189),(416,57,850,1714,1101,123,27,83,243,185),(416,56,846,1666,1091,121,27,83,236,181),(416,55,836,1620,1078,119,26,81,229,177),(416,54,820,1573,1055,115,26,80,222,172),(416,53,787,1527,1039,114,25,78,215,168),(416,52,764,1481,1013,112,24,76,208,165),(416,51,750,1435,996,109,22,74,202,161),(416,50,747,1391,983,107,22,72,194,158),(416,49,734,1347,964,105,22,69,188,155),(416,48,726,1320,946,102,22,68,184,152),(416,47,718,1294,928,100,22,68,181,151),(416,46,709,1267,910,98,22,67,177,149),(416,45,701,1240,884,96,21,67,174,148),(416,44,693,1214,853,91,21,66,170,146),(416,43,685,1187,808,87,20,66,167,145),(416,42,676,1103,756,81,20,65,163,144),(416,41,668,1063,694,77,20,65,160,143),(416,40,650,1026,639,74,20,64,156,142),(416,39,642,988,561,72,19,64,69,118),(416,38,634,952,549,70,19,63,68,115),(416,37,626,916,537,69,19,63,68,112),(416,36,617,879,525,67,19,62,66,110),(416,35,609,845,513,64,19,62,66,107),(416,34,601,793,501,63,19,60,65,104),(416,33,598,742,488,62,18,60,65,101),(416,32,590,720,476,60,17,58,64,98),(416,31,581,676,462,59,16,58,64,95),(416,30,579,648,449,57,16,57,63,92),(416,29,576,620,436,57,16,55,62,89),(416,28,574,592,424,55,15,54,62,86),(416,27,571,564,411,53,14,52,61,81),(416,26,569,534,399,52,13,49,60,78),(416,25,540,504,386,50,13,46,98,100),(416,24,520,476,373,49,13,43,97,95),(416,23,473,447,360,47,13,40,96,90),(416,22,449,420,346,46,13,38,95,86),(416,21,425,393,320,44,13,37,91,83),(416,20,403,377,303,42,13,35,87,78),(416,19,393,351,291,40,13,33,74,75),(416,18,362,314,278,39,13,32,70,70),(416,17,350,300,265,38,13,31,65,65),(416,16,329,275,253,36,13,30,62,56),(416,15,309,251,240,34,13,29,57,52),(416,14,299,227,228,33,13,28,54,47),(416,13,289,203,215,32,13,26,50,43),(416,12,250,180,203,31,12,26,41,39),(416,11,232,158,190,30,11,24,37,35),(416,10,223,147,180,29,10,24,33,31),(416,9,213,136,147,25,9,27,32,30),(416,8,204,125,117,23,8,23,31,29),(416,7,195,114,92,22,7,23,30,28),(416,6,186,103,68,20,7,22,29,27),(416,5,177,92,49,18,5,22,28,27),(416,4,168,81,33,17,5,21,27,26),(416,3,158,70,20,15,5,21,26,25),(416,2,149,59,20,21,5,20,25,24),(416,1,140,48,20,20,5,20,24,23),(417,70,3112,2420,4400,153,108,280,133,122),(417,69,3056,2360,4229,150,105,276,130,120),(417,68,3000,2300,4061,148,103,271,127,117),(417,67,2944,2252,3900,146,101,267,124,115),(417,66,2888,2195,3745,143,99,262,121,113),(417,65,2823,2139,3597,141,97,258,119,111),(417,64,2758,2084,3454,139,95,253,116,109),(417,63,2693,2030,3317,137,93,249,113,107),(417,62,2638,1977,3186,134,91,244,111,105),(417,61,2583,1925,3059,132,89,240,108,103),(417,60,2529,1874,2938,130,87,235,106,101),(417,59,2476,1824,2821,127,85,231,103,99),(417,58,2424,1763,2709,125,83,226,101,97),(417,57,2371,1714,2602,123,82,222,99,94),(417,56,2318,1666,2499,120,80,217,96,92),(417,55,2266,1620,2400,118,78,213,94,90),(417,54,2213,1573,2305,116,77,208,92,88),(417,53,2161,1527,2213,113,75,204,90,86),(417,52,2108,1481,2125,111,74,199,88,84),(417,51,2055,1435,2041,109,72,195,86,82),(417,50,2003,1391,1959,107,71,190,84,80),(417,49,1950,1347,1925,104,69,186,82,78),(417,48,1889,1320,1888,102,68,181,80,76),(417,47,1828,1294,1853,100,66,177,78,75),(417,46,1768,1267,1817,98,65,173,77,73),(417,45,1708,1240,1750,95,64,168,75,71),(417,44,1648,1214,1650,91,61,164,73,70),(417,43,1588,1187,1550,87,60,160,71,68),(417,42,1528,1103,1484,81,59,156,70,67),(417,41,1468,1063,1390,76,58,151,68,65),(417,40,1408,1026,1250,73,57,146,67,64),(417,39,1348,988,1048,71,56,142,68,62),(417,38,1288,952,1024,70,55,139,69,61),(417,37,1227,916,1001,68,54,138,70,60),(417,36,1167,879,977,67,53,138,72,58),(417,35,1107,845,953,65,52,137,73,57),(417,34,1047,793,929,63,50,135,76,56),(417,33,987,742,905,62,49,131,74,54),(417,32,921,720,882,60,47,127,73,53),(417,31,856,676,858,59,47,123,71,52),(417,30,800,648,834,57,46,118,69,51),(417,29,775,620,810,55,45,114,67,50),(417,28,740,592,786,54,44,110,65,49),(417,27,705,564,763,52,43,105,63,48),(417,26,678,543,739,51,42,101,61,47),(417,25,630,504,715,49,41,97,59,46),(417,24,595,476,691,47,40,93,57,45),(417,23,558,447,667,46,39,88,55,44),(417,22,528,423,644,44,38,84,53,43),(417,21,500,400,620,43,37,80,51,42),(417,20,471,377,596,41,36,75,49,41),(417,19,438,351,572,39,35,71,47,40),(417,18,392,314,548,38,34,67,45,39),(417,17,375,300,525,36,33,62,43,38),(417,16,343,275,501,35,32,58,41,37),(417,15,313,251,477,33,31,54,39,36),(417,14,284,227,453,31,30,50,37,35),(417,13,254,203,429,30,29,45,35,34),(417,12,225,180,406,28,28,41,33,33),(417,11,198,158,382,27,27,37,31,32),(417,10,184,147,358,25,26,34,29,31),(417,9,170,136,334,23,25,32,27,30),(417,8,156,125,310,22,24,29,25,29),(417,7,152,114,287,20,23,27,23,28),(417,6,129,103,263,19,22,24,21,27),(417,5,115,92,239,17,21,22,19,26),(417,4,101,81,215,15,20,19,17,25),(417,3,87,70,191,14,19,17,15,24),(417,2,73,59,168,12,18,14,13,23),(417,1,60,48,144,11,17,12,11,22),(1860,70,4860,2885,9109,153,109,280,133,190),(1860,69,4764,2751,8876,151,106,278,130,185),(1860,68,4529,2598,8409,148,104,276,127,175),(1860,67,4321,2444,7944,146,101,272,124,170),(1860,66,4145,2391,7481,144,99,268,122,168),(1860,65,3934,2237,7020,142,97,264,119,167),(1860,64,3830,2184,6561,139,95,259,102,164),(1860,63,3726,2030,6104,137,93,255,93,160),(1860,62,3627,1977,5649,135,91,253,86,158),(1860,61,3522,1925,5196,132,89,251,78,153),(1860,60,3419,1874,4745,129,85,249,70,150),(1860,59,3318,1824,4673,127,83,230,69,147),(1860,58,3222,1763,4579,125,82,224,68,144),(1860,57,3110,1714,4500,123,81,220,67,142),(1860,56,3006,1666,4428,121,80,215,66,139),(1860,55,2876,1620,4362,119,79,211,65,135),(1860,54,2840,1573,4302,115,76,207,64,133),(1860,53,2757,1527,4207,114,75,203,63,131),(1860,52,2661,1481,4136,112,74,198,62,128),(1860,51,2560,1435,4068,109,72,194,60,127),(1860,50,2527,1391,4013,107,71,190,59,123),(1860,49,2474,1347,3943,105,69,186,58,78),(1860,48,2436,1320,3868,102,68,181,57,76),(1860,47,2358,1294,3796,100,66,177,57,75),(1860,46,2349,1267,3722,98,65,173,57,73),(1860,45,2303,1240,3620,96,64,169,55,72),(1860,44,2290,1214,3463,91,61,164,54,71),(1860,43,2260,1187,3228,87,60,160,52,69),(1860,42,2215,1103,3034,81,59,156,51,67),(1860,41,2135,1063,2826,77,58,152,51,66),(1860,40,2052,1026,2675,74,57,147,50,64),(1860,39,1974,988,2496,72,56,142,49,62),(1860,38,1924,952,2331,70,55,139,49,61),(1860,37,1830,916,2246,69,53,138,48,59),(1860,36,1760,879,2150,67,52,137,47,58),(1860,35,1690,845,1911,64,51,136,46,57),(1860,34,1574,793,1861,63,50,135,46,56),(1860,33,1457,742,1812,62,49,131,45,54),(1860,32,1386,720,1766,60,47,127,43,53),(1860,31,1292,676,1715,59,47,123,42,52),(1860,30,1215,648,1667,57,46,118,41,51),(1860,29,1127,620,1619,57,44,114,40,49),(1860,28,1035,592,1572,55,43,110,39,48),(1860,27,968,564,1524,53,42,105,38,47),(1860,26,911,534,1474,52,41,101,37,46),(1860,25,854,504,1427,50,40,97,36,44),(1860,24,823,476,1378,49,39,93,35,43),(1860,23,746,447,1330,47,38,89,34,42),(1860,22,699,420,1282,46,36,84,33,41),(1860,21,653,393,1232,44,36,80,32,39),(1860,20,606,377,1165,42,35,67,31,49),(1860,19,566,351,1120,40,33,63,30,46),(1860,18,528,314,1068,39,33,59,28,38),(1860,17,490,300,1022,38,31,55,28,42),(1860,16,455,275,975,36,30,52,27,39),(1860,15,421,251,925,34,30,48,26,37),(1860,14,368,227,878,33,28,44,25,35),(1860,13,354,203,827,32,28,43,26,32),(1860,12,322,180,782,31,26,36,24,31),(1860,11,291,158,734,30,25,32,22,28),(1860,10,260,147,694,29,25,29,22,26),(1860,9,113,136,180,25,22,27,4,0),(1860,8,104,125,160,23,21,25,4,0),(1860,7,95,114,140,22,20,21,3,0),(1860,6,86,103,120,20,19,16,3,0),(1860,5,77,92,100,18,18,12,2,0),(1860,4,68,81,80,17,17,8,2,0),(1860,3,58,70,60,15,16,4,1,0),(1860,2,49,59,40,14,15,2,1,0),(1860,1,40,48,20,12,14,1,1,0),(1863,70,2164,2405,4293,153,108,280,133,122),(1863,69,2118,2351,3800,151,106,271,130,119),(1863,68,2073,2298,3450,148,104,266,127,117),(1863,67,2027,2244,3150,146,101,262,124,114),(1863,66,1982,2191,2910,144,99,258,122,112),(1863,65,1936,2137,2700,142,97,254,119,109),(1863,64,1891,2084,2550,139,95,249,116,107),(1863,63,1845,2030,2440,137,93,245,113,105),(1863,62,1800,1977,2380,135,91,241,111,103),(1863,61,1754,1925,2300,132,89,237,108,101),(1863,60,1709,1874,2261,130,87,232,106,98),(1863,59,1666,1824,2230,128,86,228,103,96),(1863,58,1623,1763,2189,125,84,224,101,94),(1863,57,1580,1714,2156,123,82,220,99,92),(1863,56,1536,1666,2113,121,80,215,96,90),(1863,55,1493,1620,2089,119,79,211,94,88),(1863,54,1450,1573,2056,116,77,207,92,87),(1863,53,1407,1527,2020,114,75,203,90,85),(1863,52,1364,1481,1984,112,74,198,88,83),(1863,51,1320,1435,1945,109,72,194,86,81),(1863,50,1277,1391,1912,107,71,190,84,80),(1863,49,1234,1347,1878,105,69,186,82,78),(1863,48,1196,1320,1843,102,68,181,80,76),(1863,47,1158,1294,1808,100,66,177,78,75),(1863,46,1119,1267,1773,98,65,173,77,73),(1863,45,1081,1240,1738,96,64,169,75,72),(1863,44,1043,1214,1670,91,61,164,74,71),(1863,43,1005,1187,1560,87,60,160,72,69),(1863,42,976,1103,1448,81,59,156,70,67),(1863,41,928,1063,1338,77,58,152,68,66),(1863,40,890,1026,1244,74,57,147,67,64),(1863,39,852,988,1163,72,56,142,68,62),(1863,38,814,952,1095,70,55,139,69,61),(1863,37,776,916,1038,69,53,138,70,59),(1863,36,737,879,990,67,52,137,72,58),(1863,35,699,845,950,63,51,136,73,57),(1863,34,661,793,908,64,50,135,76,56),(1863,33,728,742,884,62,49,131,74,54),(1863,32,680,720,862,60,47,127,73,53),(1863,31,631,676,838,59,47,123,71,52),(1863,30,599,648,815,57,46,118,69,51),(1863,29,566,620,791,57,44,114,67,49),(1863,28,534,592,768,55,43,110,65,48),(1863,27,501,564,745,53,42,105,63,47),(1863,26,469,534,721,52,41,101,62,46),(1863,25,440,504,699,50,40,97,60,44),(1863,24,400,476,675,49,39,93,57,43),(1863,23,373,447,652,47,38,89,56,42),(1863,22,349,420,628,46,36,84,54,41),(1863,21,325,393,604,44,36,80,53,39),(1863,20,303,377,563,42,35,67,31,49),(1863,19,293,351,550,40,33,72,29,39),(1863,18,262,314,510,39,32,67,24,38),(1863,17,250,300,460,37,31,63,20,37),(1863,16,229,275,400,36,30,59,16,36),(1863,15,209,251,360,34,29,55,14,35),(1863,14,189,227,320,33,28,50,11,35),(1863,13,169,203,280,31,27,46,9,34),(1863,12,150,180,240,29,26,42,8,33),(1863,11,132,158,220,28,25,38,6,32),(1863,10,123,147,200,26,23,33,5,31),(1863,9,113,136,180,25,22,29,4,31),(1863,8,104,125,160,23,21,25,4,30),(1863,7,95,114,140,22,20,21,3,29),(1863,6,86,103,120,20,19,16,3,29),(1863,5,77,92,100,18,18,12,2,28),(1863,4,68,81,80,17,17,8,2,27),(1863,3,58,70,60,15,16,4,1,27),(1863,2,49,59,40,14,15,2,1,26),(1863,1,40,48,20,12,14,1,1,25),(510,1,60,60,0,20,16,20,13,8),(510,2,73,73,0,21,17,21,14,10),(510,3,87,87,0,22,18,22,15,12),(510,4,101,101,0,23,19,23,16,14),(510,5,115,115,0,24,20,24,17,16),(510,6,129,129,0,25,21,25,18,18),(510,7,152,152,0,26,22,26,19,20),(510,8,156,156,0,27,23,27,20,22),(510,9,170,170,0,28,24,28,21,24),(510,10,184,184,0,29,25,29,22,26),(510,11,198,198,0,30,25,32,22,28),(510,12,225,225,0,31,26,36,24,31),(510,13,254,254,0,32,28,43,26,32),(510,14,284,254,0,33,28,44,25,35),(510,15,313,313,0,34,30,48,26,37),(510,16,343,343,0,36,30,52,27,39),(510,17,375,375,0,38,31,55,28,42),(510,18,392,392,0,39,33,59,28,44),(510,19,438,438,0,40,33,63,30,46),(510,20,471,471,0,42,35,67,31,49),(510,21,500,500,0,44,36,80,31,51),(510,22,528,528,0,46,36,84,32,53),(510,23,558,558,0,47,38,89,33,55),(510,24,595,595,0,49,39,83,34,58),(510,25,630,630,0,50,40,87,35,61),(510,26,678,678,0,52,41,91,36,62),(510,27,705,705,0,53,42,95,37,65),(510,28,740,740,0,55,43,99,38,67),(510,29,775,775,0,56,44,103,39,70),(510,30,800,800,0,58,46,107,40,72),(510,31,856,856,0,59,47,111,40,74),(510,32,921,921,0,61,48,115,41,77),(510,33,987,987,0,62,49,119,42,79),(510,34,1047,1047,0,63,51,123,43,82),(510,35,1107,1107,0,65,52,127,44,84),(510,36,1167,1167,0,66,53,131,45,87),(510,37,1227,1227,0,68,53,135,46,89),(510,38,1288,1288,0,70,55,139,47,91),(510,39,1348,1348,0,72,56,143,48,94),(510,40,1408,1408,0,74,58,148,49,97),(510,41,1468,1468,0,76,59,152,50,99),(510,42,1528,1528,0,81,59,156,51,102),(510,43,1588,1588,0,86,61,160,52,104),(510,44,1648,1648,0,89,62,164,53,107),(510,45,1708,1708,0,91,64,169,54,109),(510,46,1768,1768,0,94,65,173,55,112),(510,47,1828,1828,0,96,66,178,56,115),(510,48,1889,1889,0,99,68,182,57,117),(510,49,1950,1950,0,101,69,186,58,120),(510,50,2003,2003,0,104,71,191,59,123),(510,51,2055,2055,0,107,72,195,61,126),(510,52,2108,2108,0,109,73,199,62,128),(510,53,2161,2161,0,112,75,204,63,131),(510,54,2213,2213,0,114,76,208,64,134),(510,55,2266,2266,0,117,77,213,65,136),(510,56,2318,2318,0,119,79,217,66,139),(510,57,2371,2371,0,122,80,221,67,142),(510,58,2424,2425,0,124,82,226,68,144),(510,59,2476,2476,0,127,83,230,69,147),(510,60,2529,1874,0,129,85,234,70,150),(510,61,2582,2682,0,130,86,238,71,153),(510,62,2635,2735,0,131,87,242,72,156),(510,63,2688,2788,0,132,88,246,73,159),(510,64,2741,2841,0,133,89,250,74,162),(510,65,2794,2894,0,134,90,254,75,165),(510,66,2847,2947,0,135,91,258,76,168),(510,67,2900,3000,0,136,92,262,77,171),(510,68,2953,3053,0,137,93,266,78,174),(510,69,3006,3100,0,138,94,280,79,177),(510,70,3059,3212,0,139,95,284,80,180),(19668,1,100,0,100,10,10,0,0,0),(19668,2,100,0,100,10,10,0,0,0),(19668,3,100,0,100,10,10,0,0,0),(19668,4,100,0,100,10,10,0,0,0),(19668,5,100,0,100,10,10,0,0,0),(19668,6,100,0,100,10,10,0,0,0),(19668,7,100,0,100,10,10,0,0,0),(19668,8,100,0,100,10,10,0,0,0),(19668,9,100,0,100,10,10,0,0,0),(19668,10,100,0,100,10,10,0,0,0),(19668,11,100,0,100,10,10,0,0,0),(19668,12,100,0,100,10,10,0,0,0),(19668,13,100,0,100,10,10,0,0,0),(19668,14,100,0,100,10,10,0,0,0),(19668,15,100,0,100,10,10,0,0,0),(19668,16,100,0,100,10,10,0,0,0),(19668,17,100,0,100,10,10,0,0,0),(19668,18,100,0,100,10,10,0,0,0),(19668,19,100,0,100,10,10,0,0,0),(19668,20,100,0,100,10,10,0,0,0),(19668,21,100,0,100,10,10,0,0,0),(19668,22,100,0,100,10,10,0,0,0),(19668,23,100,0,100,10,10,0,0,0),(19668,24,100,0,100,10,10,0,0,0),(19668,25,100,0,100,10,10,0,0,0),(19668,26,100,0,100,10,10,0,0,0),(19668,27,100,0,100,10,10,0,0,0),(19668,28,100,0,100,10,10,0,0,0),(19668,29,100,0,100,10,10,0,0,0),(19668,30,100,0,100,10,10,0,0,0),(19668,31,100,0,100,10,10,0,0,0),(19668,32,100,0,100,10,10,0,0,0),(19668,33,100,0,100,10,10,0,0,0),(19668,34,100,0,100,10,10,0,0,0),(19668,35,100,0,100,10,10,0,0,0),(19668,36,100,0,100,10,10,0,0,0),(19668,37,100,0,100,10,10,0,0,0),(19668,38,100,0,100,10,10,0,0,0),(19668,39,100,0,100,10,10,0,0,0),(19668,40,100,0,100,10,10,0,0,0),(19668,41,100,0,100,10,10,0,0,0),(19668,42,100,0,100,10,10,0,0,0),(19668,43,100,0,100,10,10,0,0,0),(19668,44,100,0,100,10,10,0,0,0),(19668,45,100,0,100,10,10,0,0,0),(19668,46,100,0,100,10,10,0,0,0),(19668,47,100,0,100,10,10,0,0,0),(19668,48,100,0,100,10,10,0,0,0),(19668,49,100,0,100,10,10,0,0,0),(19668,50,100,0,100,10,10,0,0,0),(19668,51,100,0,100,10,10,0,0,0),(19668,52,100,0,100,10,10,0,0,0),(19668,53,100,0,100,10,10,0,0,0),(19668,54,100,0,100,10,10,0,0,0),(19668,55,100,0,100,10,10,0,0,0),(19668,56,100,0,100,10,10,0,0,0),(19668,57,100,0,100,10,10,0,0,0),(19668,58,100,0,100,10,10,0,0,0),(19668,59,100,0,100,10,10,0,0,0),(19668,60,100,0,100,10,10,0,0,0),(19668,61,100,0,100,10,10,0,0,0),(19668,62,100,0,100,10,10,0,0,0),(19668,63,100,0,100,10,10,0,0,0),(19668,64,100,0,100,10,10,0,0,0),(19668,65,100,0,100,10,10,0,0,0),(19668,66,7500,0,100,140,10,0,0,0),(19668,67,8000,0,100,140,10,0,0,0),(19668,68,8500,0,100,140,10,0,0,0),(19668,69,9000,0,100,140,10,0,0,0),(19668,70,9630,0,100,140,10,0,0,0),(575,1,100,0,100,10,10,0,0,0),(575,2,100,0,100,10,10,0,0,0),(575,3,100,0,100,10,10,0,0,0),(575,4,100,0,100,10,10,0,0,0),(575,5,100,0,100,10,10,0,0,0),(575,6,100,0,100,10,10,0,0,0),(575,7,100,0,100,10,10,0,0,0),(575,8,100,0,100,10,10,0,0,0),(575,9,100,0,100,10,10,0,0,0),(575,10,100,0,100,10,10,0,0,0),(575,11,100,0,100,10,10,0,0,0),(575,12,100,0,100,10,10,0,0,0),(575,13,100,0,100,10,10,0,0,0),(575,14,100,0,100,10,10,0,0,0),(575,15,100,0,100,10,10,0,0,0),(575,16,100,0,100,10,10,0,0,0),(575,17,100,0,100,10,10,0,0,0),(575,18,100,0,100,10,10,0,0,0),(575,19,100,0,100,10,10,0,0,0),(575,20,100,0,100,10,10,0,0,0),(575,21,100,0,100,10,10,0,0,0),(575,22,100,0,100,10,10,0,0,0),(575,23,100,0,100,10,10,0,0,0),(575,24,100,0,100,10,10,0,0,0),(575,25,100,0,100,10,10,0,0,0),(575,26,100,0,100,10,10,0,0,0),(575,27,100,0,100,10,10,0,0,0),(575,28,100,0,100,10,10,0,0,0),(575,29,100,0,100,10,10,0,0,0),(575,30,100,0,100,10,10,0,0,0),(575,31,100,0,100,10,10,0,0,0),(575,32,100,0,100,10,10,0,0,0),(575,33,100,0,100,10,10,0,0,0),(575,34,100,0,100,10,10,0,0,0),(575,35,1400,0,50,10,10,0,0,0),(575,36,1700,0,50,10,10,0,0,0),(575,37,100,0,100,10,10,0,0,0),(575,38,100,0,100,10,10,0,0,0),(575,39,100,0,100,10,10,0,0,0),(575,40,100,0,100,10,10,0,0,0),(575,41,100,0,100,10,10,0,0,0),(575,42,100,0,100,10,10,0,0,0),(575,43,100,0,100,10,10,0,0,0),(575,44,100,0,100,10,10,0,0,0),(575,45,100,0,100,10,10,0,0,0),(575,46,100,0,100,10,10,0,0,0),(575,47,100,0,100,10,10,0,0,0),(575,48,100,0,100,10,10,0,0,0),(575,49,100,0,100,10,10,0,0,0),(575,50,100,0,100,10,10,0,0,0),(575,51,100,0,100,10,10,0,0,0),(575,52,100,0,100,10,10,0,0,0),(575,53,100,0,100,10,10,0,0,0),(575,54,100,0,100,10,10,0,0,0),(575,55,100,0,100,10,10,0,0,0),(575,56,100,0,100,10,10,0,0,0),(575,57,100,0,100,10,10,0,0,0),(575,58,100,0,100,10,10,0,0,0),(575,59,100,0,100,10,10,0,0,0),(575,60,100,0,100,10,10,0,0,0),(575,61,100,0,100,10,10,0,0,0),(575,62,100,0,100,10,10,0,0,0),(575,63,100,0,100,10,10,0,0,0),(575,64,100,0,100,10,10,0,0,0),(575,65,100,0,100,10,10,0,0,0),(575,66,7500,0,100,140,10,0,0,0),(575,67,8000,0,100,140,10,0,0,0),(575,68,8500,0,100,140,10,0,0,0),(575,69,9000,0,100,140,10,0,0,0),(575,70,9630,0,100,140,10,0,0,0),(17252,1,40,48,20,12,14,1,1,25),(17252,2,49,59,40,14,15,2,1,26),(17252,3,58,70,60,15,16,4,1,27),(17252,4,68,81,80,17,17,8,2,27),(17252,5,77,92,100,18,18,12,2,28),(17252,6,86,103,120,20,19,16,3,29),(17252,7,95,114,140,22,20,21,3,29),(17252,8,104,125,160,23,21,25,4,30),(17252,9,113,136,180,25,22,29,4,31),(17252,10,123,147,200,26,23,33,5,31),(17252,11,132,158,220,28,25,38,6,32),(17252,12,150,180,240,29,26,42,8,33),(17252,13,169,203,280,31,27,46,9,34),(17252,14,189,227,320,33,28,50,11,35),(17252,15,209,251,360,34,29,55,14,35),(17252,16,229,275,400,36,30,59,16,36),(17252,17,250,300,460,37,31,63,20,37),(17252,18,262,314,510,39,32,67,24,38),(17252,19,293,351,550,40,33,72,29,39),(17252,20,303,377,563,42,35,67,31,49),(17252,21,325,393,604,44,36,80,53,39),(17252,22,349,420,628,46,36,84,54,41),(17252,23,373,447,652,47,38,89,56,42),(17252,24,400,476,675,49,39,93,57,43),(17252,25,440,504,699,50,40,97,60,44),(17252,26,469,534,721,52,41,101,62,46),(17252,27,501,564,745,53,42,105,63,47),(17252,28,534,592,768,55,43,110,65,48),(17252,29,566,620,791,57,44,114,67,49),(17252,30,599,648,815,57,46,118,69,51),(17252,31,631,676,838,59,47,123,71,52),(17252,32,680,720,862,60,47,127,73,53),(17252,33,728,742,884,62,49,131,74,54),(17252,34,661,793,908,64,50,135,76,56),(17252,35,699,845,950,63,51,136,73,57),(17252,36,737,879,990,67,52,137,72,58),(17252,37,776,916,1038,69,53,138,70,59),(17252,38,814,952,1095,70,55,139,69,61),(17252,39,852,988,1163,72,56,142,68,62),(17252,40,890,1026,1244,74,57,147,67,64),(17252,41,928,1063,1338,77,58,152,68,66),(17252,42,976,1103,1448,81,59,156,70,67),(17252,43,1005,1187,1560,87,60,160,72,69),(17252,44,1043,1214,1670,91,61,164,74,71),(17252,45,1081,1240,1738,96,64,169,75,72),(17252,46,1119,1267,1773,98,65,173,77,73),(17252,47,1158,1294,1808,100,66,177,78,75),(17252,48,1196,1320,1843,102,68,181,80,76),(17252,49,1234,1347,1878,105,69,186,82,78),(17252,50,2877,2391,3494,107,71,190,84,80),(17252,51,2920,2435,3559,109,72,223,97,81),(17252,52,3164,2481,3624,112,74,228,100,82),(17252,53,3207,2527,3686,113,75,233,102,84),(17252,54,3350,2573,3752,116,77,238,104,87),(17252,55,3493,2620,3814,119,78,243,106,88),(17252,56,3536,2766,3878,120,79,248,108,89),(17252,57,3680,2814,3941,123,82,251,111,92),(17252,58,3723,2913,4006,125,84,255,113,94),(17252,59,3866,2924,4067,128,86,258,115,96),(17252,60,3909,3174,4635,130,87,270,118,98),(17252,61,4054,3225,6300,132,90,274,121,101),(17252,62,4300,3377,6380,135,92,280,122,103),(17252,63,4545,3430,6440,137,93,286,123,105),(17252,64,4691,3584,6550,139,95,295,128,107),(17252,65,4749,3646,6612,142,98,300,129,110),(17252,66,4876,3778,6910,144,99,306,130,112),(17252,67,4984,3863,7150,146,101,310,131,114),(17252,68,5197,3949,7450,148,105,325,132,117),(17252,69,5208,4035,7800,151,107,335,133,119),(17252,70,5320,4170,7927,153,108,351,196,122),(14385,1,48,80,10,20,16,13,20,8),(14385,2,105,106,67,22,17,14,21,9),(14385,3,162,132,124,24,18,15,22,10),(14385,4,219,158,181,26,19,16,23,11),(14385,5,276,184,238,28,20,17,24,12),(14385,6,333,210,295,30,21,18,25,13),(14385,7,390,236,352,32,22,19,26,14),(14385,8,447,262,409,34,23,20,27,15),(14385,9,504,288,466,36,24,21,28,16),(14385,10,561,314,523,38,25,22,29,17),(14385,11,618,340,580,40,26,23,30,18),(14385,12,675,366,637,42,27,24,31,19),(14385,13,732,392,694,44,28,25,32,20),(14385,14,789,418,751,46,29,26,33,21),(14385,15,846,444,808,48,30,27,34,22),(14385,16,903,470,865,50,31,28,35,23),(14385,17,960,496,922,52,32,29,36,24),(14385,18,1017,522,979,54,33,30,37,25),(14385,19,1074,548,1036,56,34,31,38,26),(14385,20,1131,574,1093,58,35,32,39,27),(14385,21,1188,600,1150,60,36,33,40,28),(14385,22,1245,626,1207,62,37,34,41,29),(14385,23,1302,652,1264,64,38,35,42,30),(14385,24,1359,678,1321,66,39,36,43,31),(14385,25,1416,704,1378,68,40,37,44,32),(14385,26,1473,730,1435,70,41,38,45,33),(14385,27,1530,756,1492,72,42,39,46,34),(14385,28,1587,782,1549,74,43,40,47,35),(14385,29,1644,808,1606,76,44,41,48,36),(14385,30,1701,834,1663,78,45,42,49,37),(14385,31,1758,860,1720,80,46,43,50,38),(14385,32,1815,886,1777,82,47,44,51,39),(14385,33,1872,912,1834,84,48,45,52,40),(14385,34,1929,938,1891,86,49,46,53,41),(14385,35,1986,964,1948,88,50,47,54,42),(14385,36,2043,990,2005,90,51,48,55,43),(14385,37,2100,1016,2062,92,52,49,56,44),(14385,38,2157,1042,2119,94,53,50,57,45),(14385,39,2214,1068,2176,96,54,51,58,46),(14385,40,2271,1094,2233,98,55,52,59,47),(14385,41,2328,1120,2290,100,56,53,60,48),(14385,42,2385,1146,2347,102,57,54,61,49),(14385,43,2442,1172,2404,104,58,55,62,50),(14385,44,2499,1198,2461,106,59,56,63,51),(14385,45,2556,1224,2518,108,60,57,64,52),(14385,46,2613,1250,2575,110,61,58,65,53),(14385,47,2670,1276,2632,112,62,59,66,54),(14385,48,2727,1302,2689,114,63,60,67,55),(14385,49,2784,1328,2746,116,64,61,68,56),(14385,50,2841,1354,2803,118,65,62,69,57),(14385,51,2898,1380,2860,120,66,63,70,58),(14385,52,2955,1406,2917,122,67,64,71,59),(14385,53,3012,1432,2974,124,68,65,72,60),(14385,54,3069,1458,3031,126,69,66,73,61),(14385,55,3126,1484,3088,128,70,67,74,62),(14385,56,3183,1510,3145,130,71,68,75,63),(14385,57,3240,1536,3202,132,72,69,76,64),(14385,58,3297,1562,3259,134,73,70,77,65),(14385,59,3354,1588,3316,136,74,71,78,66),(14385,60,3411,1614,3373,138,75,72,79,67),(14385,61,3468,1640,3430,140,76,73,80,68),(14385,62,3525,1666,3487,142,77,74,81,69),(14385,63,3582,1692,3544,144,78,75,82,70),(14385,64,3639,1718,3601,146,79,76,83,71),(14385,65,3696,1744,3658,148,80,77,84,72),(14385,66,3753,1770,3715,150,81,78,85,73),(14385,67,3810,1796,3772,152,82,79,86,74),(14385,68,3867,1822,3829,154,83,80,87,75),(14385,69,3924,1848,3886,156,84,81,88,76),(14385,70,3981,1874,3943,158,85,82,89,77),(3450,1,14,40,0,20,20,20,24,23),(3450,2,19,49,0,21,20,20,25,24),(3450,3,24,58,0,22,20,21,26,25),(3450,4,29,67,0,23,21,21,27,26),(3450,5,34,76,0,23,21,22,28,27),(3450,6,40,85,0,24,21,22,29,27),(3450,7,46,95,0,25,21,23,30,28),(3450,8,52,105,0,26,21,23,31,29),(3450,9,58,116,0,27,21,23,32,30),(3450,10,64,126,0,27,22,24,33,31),(3450,11,75,151,0,28,22,24,37,35),(3450,12,83,177,0,29,22,26,41,39),(3450,13,91,198,0,30,22,26,44,43),(3450,14,120,234,0,31,22,28,50,47),(3450,15,129,262,0,32,23,29,54,52),(3450,16,138,290,0,34,23,30,57,56),(3450,17,147,318,0,36,23,31,61,60),(3450,18,156,346,0,37,23,32,65,65),(3450,19,165,374,0,38,23,33,70,69),(3450,20,175,402,0,40,24,35,74,74),(3450,21,184,430,0,42,24,37,87,78),(3450,22,193,458,0,44,24,39,91,82),(3450,23,202,486,0,45,24,40,95,86),(3450,24,212,514,0,46,25,42,94,90),(3450,25,224,539,0,47,25,43,94,95),(3450,26,237,568,0,48,25,43,98,100),(3450,27,249,598,0,50,25,42,102,104),(3450,28,262,632,0,51,25,44,109,110),(3450,29,274,667,0,52,26,44,114,114),(3450,30,287,702,0,54,26,45,120,118),(3450,31,299,734,0,55,26,46,124,123),(3450,32,312,772,0,57,26,47,128,128),(3450,33,324,807,0,58,27,48,132,131),(3450,34,338,842,0,60,27,50,136,135),(3450,35,360,898,0,62,27,51,139,136),(3450,36,382,954,0,65,27,52,142,137),(3450,37,404,1010,0,67,27,54,146,138),(3450,38,427,1066,0,70,28,55,149,139),(3450,39,449,1122,0,73,28,56,153,141),(3450,40,471,1178,0,75,28,58,156,142),(3450,41,493,1234,0,78,28,59,160,143),(3450,42,516,1290,0,80,29,60,163,144),(3450,43,538,1346,0,83,29,62,167,145),(3450,44,560,1402,0,86,29,63,170,147),(3450,45,582,1458,0,88,29,64,174,148),(3450,46,605,1514,0,91,30,66,177,149),(3450,47,627,1570,0,93,30,67,181,151),(3450,48,649,1627,0,96,30,68,184,152),(3450,49,672,1685,0,99,31,70,188,155),(3450,50,694,1704,0,101,31,71,194,160),(3450,51,716,1723,0,103,31,72,201,170),(3450,52,738,1743,0,105,32,74,208,180),(3450,53,761,1762,0,107,32,75,215,190),(3450,54,783,1781,0,109,32,77,222,200),(3450,55,805,1801,0,111,33,78,229,210),(3450,56,827,1820,0,113,33,80,236,220),(3450,57,850,1839,0,115,33,81,243,230),(3450,58,872,1859,0,117,34,83,250,240),(3450,59,894,1878,0,120,34,84,257,250),(3450,60,917,1898,0,122,35,86,264,260),(3450,61,939,1918,0,125,35,88,271,270),(3450,62,961,1937,0,128,36,89,278,280),(3450,63,983,1956,0,131,36,91,285,290),(3450,64,1005,1975,0,134,36,93,292,300),(3450,65,1027,1994,0,137,37,94,299,310),(3450,66,1049,2013,0,140,37,96,306,320),(3450,67,1072,2032,0,143,37,97,313,330),(3450,68,1094,2052,0,146,38,99,320,340),(3450,69,1126,2071,0,149,38,100,327,350),(3450,70,1149,2090,0,152,39,102,334,360),(8996,1,80,48,0,0,0,0,0,0),(8996,2,100,59,0,0,0,0,0,0),(8996,3,120,70,0,0,0,0,0,0),(8996,4,140,81,0,0,0,0,0,0),(8996,5,160,92,0,0,0,0,0,0),(8996,6,180,103,0,0,0,0,0,0),(8996,7,200,114,0,0,0,0,0,0),(8996,8,220,125,0,0,0,0,0,0),(8996,9,240,136,0,0,0,0,0,0),(8996,10,260,147,694,29,25,29,22,26),(8996,11,291,158,734,30,25,32,23,28),(8996,12,322,180,782,31,26,36,24,31),(8996,13,354,203,827,32,28,43,26,32),(8996,14,368,227,878,33,28,44,25,35),(8996,15,421,251,925,34,30,48,26,37),(8996,16,455,275,975,36,30,52,27,39),(8996,17,490,300,1022,38,31,55,28,42),(8996,18,528,314,1068,39,33,59,28,44),(8996,19,566,351,1120,40,33,63,29,46),(8996,20,606,377,1165,42,35,67,30,49),(8996,21,653,400,1232,44,36,80,31,51),(8996,22,699,423,1282,46,36,84,32,53),(8996,23,746,447,1330,47,38,89,33,55),(8996,24,823,476,1378,49,39,93,34,58),(8996,25,854,504,1427,50,40,97,35,61),(8996,26,911,543,1474,52,41,101,36,62),(8996,27,966,564,1524,53,42,105,37,65),(8996,28,1047,592,1572,55,43,110,38,67),(8996,29,1129,620,1619,56,44,114,39,70),(8996,30,1210,648,1667,58,46,118,40,72),(8996,31,1292,676,1715,59,47,123,40,74),(8996,32,1373,720,1766,61,48,127,41,77),(8996,33,1455,742,1812,62,49,131,42,79),(8996,34,1573,793,1861,63,51,135,43,82),(8996,35,1690,845,2000,65,52,136,44,84),(8996,36,1760,879,2154,66,53,137,45,87),(8996,37,1827,916,2248,68,53,138,46,89),(8996,38,1900,952,2331,70,55,139,47,91),(8996,39,1974,988,2483,72,56,144,48,94),(8996,40,2041,1026,2770,74,58,150,49,97),(8996,41,2127,1063,2856,76,59,153,50,99),(8996,42,2171,1103,3034,81,59,156,51,102),(8996,43,2215,1187,3228,86,61,169,52,104),(8996,44,2259,1214,2463,89,62,172,53,107),(8996,45,2303,1240,2638,91,64,175,54,109),(8996,46,2347,1267,2862,94,65,178,55,112),(8996,47,2391,1294,3021,96,66,181,56,115),(8996,48,2435,1320,3218,99,68,184,57,117),(8996,49,2479,1347,3370,101,69,187,58,120),(8996,50,2523,1391,3528,104,71,190,59,123),(8996,51,2568,1435,3963,107,72,193,61,126),(8996,52,2661,1481,4132,109,73,199,62,128),(8996,53,2755,1527,4286,112,75,203,63,131),(8996,54,2848,1573,4307,114,76,207,64,133),(8996,55,2942,1620,4389,117,77,213,65,136),(8996,56,3036,1666,4476,119,79,218,66,139),(8996,57,3129,1714,4532,122,80,222,67,142),(8996,58,3223,1763,4599,124,82,227,68,144),(8996,59,3317,1824,4673,127,83,230,69,147),(8996,60,3419,1874,4745,129,85,249,70,150),(8996,61,3522,1925,5238,131,87,252,78,153),(8996,62,3624,1977,5670,135,90,255,86,157),(8996,63,3727,2030,6133,138,94,258,93,160),(8996,64,3830,2084,6492,142,97,261,102,164),(8996,65,3934,2139,6981,145,101,264,110,167),(8996,66,4039,2195,7429,149,104,267,119,171),(8996,67,4143,2252,7912,152,108,270,125,175),(8996,68,4248,2310,8320,156,111,273,127,180),(8996,69,4352,2369,8693,159,115,276,130,185),(8996,70,4460,2429,9070,153,109,280,133,189),(10928,1,40,48,0,0,0,0,0,0),(10928,2,49,59,0,0,0,0,0,0),(10928,3,58,70,0,0,0,0,0,0),(10928,4,68,81,0,0,0,0,0,0),(10928,5,77,92,0,0,0,0,0,0),(10928,6,86,103,0,0,0,0,0,0),(10928,7,95,114,0,0,0,0,0,0),(10928,8,104,125,0,0,0,0,0,0),(10928,9,113,136,0,0,0,0,0,0),(10928,10,123,147,0,0,0,0,0,0),(10928,11,132,158,0,0,0,0,0,0),(10928,12,150,180,0,0,0,0,0,0),(10928,13,169,203,0,0,0,0,0,0),(10928,14,189,227,0,0,0,0,0,0),(10928,15,209,251,0,0,0,0,0,0),(10928,16,229,275,0,0,0,0,0,0),(10928,17,250,300,0,0,0,0,0,0),(10928,18,262,314,0,0,0,0,0,0),(10928,19,293,351,0,0,0,0,0,0),(10928,20,303,377,0,42,35,67,31,49),(10928,21,325,393,0,44,36,80,31,51),(10928,22,349,420,0,46,36,84,32,53),(10928,23,373,447,0,47,38,79,33,55),(10928,24,400,476,0,49,39,83,34,58),(10928,25,440,504,0,50,40,87,35,61),(10928,26,469,534,0,52,41,91,36,62),(10928,27,501,564,0,53,42,95,37,65),(10928,28,534,592,0,55,43,99,38,67),(10928,29,566,620,0,56,44,103,39,70),(10928,30,599,648,800,58,46,107,40,72),(10928,31,631,676,856,59,47,111,40,74),(10928,32,680,720,921,61,48,115,41,77),(10928,33,728,742,987,62,49,119,42,79),(10928,34,661,793,1047,63,51,123,43,82),(10928,35,699,845,1107,65,52,127,44,84),(10928,36,737,879,1167,66,53,131,45,87),(10928,37,776,916,1227,68,53,135,46,89),(10928,38,814,952,1288,70,55,139,47,91),(10928,39,852,988,1345,72,56,143,48,94),(10928,40,890,1026,1409,74,58,148,49,97),(10928,41,928,1063,1462,76,59,152,50,99),(10928,42,976,1103,1528,81,59,156,51,102),(10928,43,1005,1187,1586,86,61,160,52,104),(10928,44,1043,1214,1642,89,62,164,53,107),(10928,45,1081,1240,1708,91,64,169,54,109),(10928,46,1119,1267,1769,94,65,173,55,112),(10928,47,1158,1294,1826,96,66,178,56,115),(10928,48,1196,1320,1889,99,68,182,57,117),(10928,49,1234,1347,1950,101,69,186,58,120),(10928,50,1277,1391,2003,104,71,191,59,123),(10928,51,1320,1435,2055,107,72,195,61,126),(10928,52,1364,1481,2108,109,73,199,62,128),(10928,53,1407,1527,2161,112,75,204,63,131),(10928,54,1450,1573,2213,114,76,208,64,134),(10928,55,1493,1620,2266,117,77,213,65,136),(10928,56,1536,1666,2318,119,79,217,66,139),(10928,57,1580,1714,2371,122,80,221,67,142),(10928,58,1623,1763,2424,124,82,226,68,144),(10928,59,1666,1824,2476,127,83,230,69,147),(10928,60,1709,1874,2529,129,85,234,70,150),(10928,61,1754,1925,2583,132,86,239,72,154),(10928,62,1800,1977,2638,136,87,245,73,159),(10928,63,1845,2030,2693,140,88,250,74,163),(10928,64,1891,2084,2758,143,89,256,75,168),(10928,65,1936,2137,2823,147,90,261,76,172),(10928,66,1982,2191,2888,150,91,266,77,177),(10928,67,2027,2244,2944,154,92,272,78,181),(10928,68,2073,2298,3000,157,93,277,79,186),(10928,69,2118,2351,3056,161,94,283,80,190),(10928,70,2164,2405,3112,165,95,289,81,195),(12922,1,14,40,0,20,20,20,24,23),(12922,2,19,49,0,21,20,20,25,24),(12922,3,24,58,0,22,20,21,26,25),(12922,4,29,67,0,23,21,21,27,26),(12922,5,34,76,0,23,21,22,28,27),(12922,6,40,85,0,24,21,22,29,27),(12922,7,46,95,0,25,21,23,30,28),(12922,8,52,105,0,26,21,23,31,29),(12922,9,58,116,0,27,21,23,32,30),(12922,10,64,126,0,27,22,24,33,31),(12922,11,75,151,0,28,22,24,37,35),(12922,12,83,177,0,29,22,26,41,39),(12922,13,91,198,0,30,22,26,44,43),(12922,14,120,234,0,31,22,28,50,47),(12922,15,129,262,0,32,23,29,54,52),(12922,16,138,290,0,34,23,30,57,56),(12922,17,147,318,0,36,23,31,61,60),(12922,18,156,346,0,37,23,32,65,65),(12922,19,165,374,0,38,23,33,70,69),(12922,20,175,402,0,40,24,35,74,74),(12922,21,184,430,0,42,24,37,87,78),(12922,22,193,458,0,44,24,39,91,82),(12922,23,202,486,0,45,24,40,95,86),(12922,24,212,514,0,46,25,42,94,90),(12922,25,224,539,0,47,25,43,94,95),(12922,26,237,568,0,48,25,43,98,100),(12922,27,249,598,0,50,25,42,102,104),(12922,28,262,632,0,51,25,44,109,110),(12922,29,274,667,0,52,26,44,114,114),(12922,30,287,702,0,54,26,45,120,118),(12922,31,299,734,0,55,26,46,124,123),(12922,32,312,772,0,57,26,47,128,128),(12922,33,324,807,0,58,27,48,132,131),(12922,34,338,842,0,60,27,50,136,135),(12922,35,360,898,0,62,27,51,139,136),(12922,36,382,954,0,65,27,52,142,137),(12922,37,404,1010,0,67,27,54,146,138),(12922,38,427,1066,0,70,28,55,149,139),(12922,39,449,1122,0,73,28,56,153,141),(12922,40,471,1178,0,75,28,58,156,142),(12922,41,493,1234,0,78,28,59,160,143),(12922,42,516,1290,0,80,29,60,163,144),(12922,43,538,1346,0,83,29,62,167,145),(12922,44,560,1402,0,86,29,63,170,147),(12922,45,582,1458,0,88,29,64,174,148),(12922,46,605,1514,0,91,30,66,177,149),(12922,47,627,1570,0,93,30,67,181,151),(12922,48,649,1627,0,96,30,68,184,152),(12922,49,672,1685,0,99,31,70,188,155),(12922,50,694,1704,0,101,31,71,194,160),(12922,51,716,1723,0,103,31,72,201,170),(12922,52,738,1743,0,105,32,74,208,180),(12922,53,761,1762,0,107,32,75,215,190),(12922,54,783,1781,0,109,32,77,222,200),(12922,55,805,1801,0,111,33,78,229,210),(12922,56,827,1820,0,113,33,80,236,220),(12922,57,850,1839,0,115,33,81,243,230),(12922,58,872,1859,0,117,34,83,250,240),(12922,59,894,1878,0,120,34,84,257,250),(12922,60,917,1898,0,122,35,86,264,260),(12922,61,939,1918,0,125,35,88,271,270),(12922,62,961,1937,0,128,36,89,278,280),(12922,63,983,1956,0,131,36,91,285,290),(12922,64,1005,1975,0,134,36,93,292,300),(12922,65,1027,1994,0,137,37,94,299,310),(12922,66,1049,2013,0,140,37,96,306,320),(12922,67,1072,2032,0,143,37,97,313,330),(12922,68,1094,2052,0,146,38,99,320,340),(12922,69,1126,2071,0,149,38,100,327,350),(12922,70,1149,2090,0,152,39,102,334,360),(8477,1,80,48,0,0,0,0,0,0),(8477,2,100,59,0,0,0,0,0,0),(8477,3,120,70,0,0,0,0,0,0),(8477,4,140,81,0,0,0,0,0,0),(8477,5,160,92,0,0,0,0,0,0),(8477,6,180,103,0,0,0,0,0,0),(8477,7,200,114,0,0,0,0,0,0),(8477,8,220,125,0,0,0,0,0,0),(8477,9,240,136,0,0,0,0,0,0),(8477,10,260,147,694,29,25,29,22,26),(8477,11,291,158,734,30,25,32,23,28),(8477,12,322,180,782,31,26,36,24,31),(8477,13,354,203,827,32,28,43,26,32),(8477,14,368,227,878,33,28,44,25,35),(8477,15,421,251,925,34,30,48,26,37),(8477,16,455,275,975,36,30,52,27,39),(8477,17,490,300,1022,38,31,55,28,42),(8477,18,528,314,1068,39,33,59,28,44),(8477,19,566,351,1120,40,33,63,29,46),(8477,20,606,377,1165,42,35,67,30,49),(8477,21,653,400,1232,44,36,80,31,51),(8477,22,699,423,1282,46,36,84,32,53),(8477,23,746,447,1330,47,38,89,33,55),(8477,24,823,476,1378,49,39,93,34,58),(8477,25,854,504,1427,50,40,97,35,61),(8477,26,911,543,1474,52,41,101,36,62),(8477,27,966,564,1524,53,42,105,37,65),(8477,28,1047,592,1572,55,43,110,38,67),(8477,29,1129,620,1619,56,44,114,39,70),(8477,30,1210,648,1667,58,46,118,40,72),(8477,31,1292,676,1715,59,47,123,40,74),(8477,32,1373,720,1766,61,48,127,41,77),(8477,33,1455,742,1812,62,49,131,42,79),(8477,34,1573,793,1861,63,51,135,43,82),(8477,35,1690,845,2000,65,52,136,44,84),(8477,36,1760,879,2154,66,53,137,45,87),(8477,37,1827,916,2248,68,53,138,46,89),(8477,38,1900,952,2331,70,55,139,47,91),(8477,39,1974,988,2483,72,56,144,48,94),(8477,40,2041,1026,2770,74,58,150,49,97),(8477,41,2127,1063,2856,76,59,153,50,99),(8477,42,2171,1103,3034,81,59,156,51,102),(8477,43,2215,1187,3228,86,61,169,52,104),(8477,44,2259,1214,2463,89,62,172,53,107),(8477,45,2303,1240,2638,91,64,175,54,109),(8477,46,2347,1267,2862,94,65,178,55,112),(8477,47,2391,1294,3021,96,66,181,56,115),(8477,48,2435,1320,3218,99,68,184,57,117),(8477,49,2479,1347,3370,101,69,187,58,120),(8477,50,2523,1391,3528,104,71,190,59,123),(8477,51,2568,1435,3963,107,72,193,61,126),(8477,52,2661,1481,4132,109,73,199,62,128),(8477,53,2755,1527,4286,112,75,203,63,131),(8477,54,2848,1573,4307,114,76,207,64,133),(8477,55,2942,1620,4389,117,77,213,65,136),(8477,56,3036,1666,4476,119,79,218,66,139),(8477,57,3129,1714,4532,122,80,222,67,142),(8477,58,3223,1763,4599,124,82,227,68,144),(8477,59,3317,1824,4673,127,83,230,69,147),(8477,60,3419,1874,4745,129,85,249,70,150),(8477,61,3522,1925,5238,131,87,252,78,153),(8477,62,3624,1977,5670,135,90,255,86,157),(8477,63,3727,2030,6133,138,94,258,93,160),(8477,64,3830,2084,6492,142,97,261,102,164),(8477,65,3934,2139,6981,145,101,264,110,167),(8477,66,4039,2195,7429,149,104,267,119,171),(8477,67,4143,2252,7912,152,108,270,125,175),(8477,68,4248,2310,8320,156,111,273,127,180),(8477,69,4352,2369,8693,159,115,276,130,185),(8477,70,4460,2429,9070,153,109,280,133,189),(24815,1,14,40,0,20,20,20,24,23),(24815,2,19,49,0,21,20,20,25,24),(24815,3,24,58,0,22,20,21,26,25),(24815,4,29,67,0,23,21,21,27,26),(24815,5,34,76,0,23,21,22,28,27),(24815,6,40,85,0,24,21,22,29,27),(24815,7,46,95,0,25,21,23,30,28),(24815,8,52,105,0,26,21,23,31,29),(24815,9,58,116,0,27,21,23,32,30),(24815,10,64,126,0,27,22,24,33,31),(24815,11,75,151,0,28,22,24,37,35),(24815,12,83,177,0,29,22,26,41,39),(24815,13,91,198,0,30,22,26,44,43),(24815,14,120,234,0,31,22,28,50,47),(24815,15,129,262,0,32,23,29,54,52),(24815,16,138,290,0,34,23,30,57,56),(24815,17,147,318,0,36,23,31,61,60),(24815,18,156,346,0,37,23,32,65,65),(24815,19,165,374,0,38,23,33,70,69),(24815,20,175,402,0,40,24,35,74,74),(24815,21,184,430,0,42,24,37,87,78),(24815,22,193,458,0,44,24,39,91,82),(24815,23,202,486,0,45,24,40,95,86),(24815,24,212,514,0,46,25,42,94,90),(24815,25,224,539,0,47,25,43,94,95),(24815,26,237,568,0,48,25,43,98,100),(24815,27,249,598,0,50,25,42,102,104),(24815,28,262,632,0,51,25,44,109,110),(24815,29,274,667,0,52,26,44,114,114),(24815,30,287,702,0,54,26,45,120,118),(24815,31,299,734,0,55,26,46,124,123),(24815,32,312,772,0,57,26,47,128,128),(24815,33,324,807,0,58,27,48,132,131),(24815,34,338,842,0,60,27,50,136,135),(24815,35,360,898,0,62,27,51,139,136),(24815,36,382,954,0,65,27,52,142,137),(24815,37,404,1010,0,67,27,54,146,138),(24815,38,427,1066,0,70,28,55,149,139),(24815,39,449,1122,0,73,28,56,153,141),(24815,40,471,1178,0,75,28,58,156,142),(24815,41,493,1234,0,78,28,59,160,143),(24815,42,516,1290,0,80,29,60,163,144),(24815,43,538,1346,0,83,29,62,167,145),(24815,44,560,1402,0,86,29,63,170,147),(24815,45,582,1458,0,88,29,64,174,148),(24815,46,605,1514,0,91,30,66,177,149),(24815,47,627,1570,0,93,30,67,181,151),(24815,48,649,1627,0,96,30,68,184,152),(24815,49,672,1685,0,99,31,70,188,155),(24815,50,694,1704,0,101,31,71,194,160),(24815,51,716,1723,0,103,31,72,201,170),(24815,52,738,1743,0,105,32,74,208,180),(24815,53,761,1762,0,107,32,75,215,190),(24815,54,783,1781,0,109,32,77,222,200),(24815,55,805,1801,0,111,33,78,229,210),(24815,56,827,1820,0,113,33,80,236,220),(24815,57,850,1839,0,115,33,81,243,230),(24815,58,872,1859,0,117,34,83,250,240),(24815,59,894,1878,0,120,34,84,257,250),(24815,60,917,1898,0,122,35,86,264,260),(24815,61,939,1918,0,125,35,88,271,270),(24815,62,961,1937,0,128,36,89,278,280),(24815,63,983,1956,0,131,36,91,285,290),(24815,64,1005,1975,0,134,36,93,292,300),(24815,65,1027,1994,0,137,37,94,299,310),(24815,66,1049,2013,0,140,37,96,306,320),(24815,67,1072,2032,0,143,37,97,313,330),(24815,68,1094,2052,0,146,38,99,320,340),(24815,69,1126,2071,0,149,38,100,327,350),(24815,70,1149,2090,0,152,39,102,334,360),(22362,1,14,40,20,20,20,20,24,23),(22362,2,19,49,24,21,20,20,25,24),(22362,3,24,58,28,22,20,21,26,25),(22362,4,29,67,33,23,21,21,27,26),(22362,5,34,76,49,23,21,22,28,27),(22362,6,40,85,68,24,21,22,29,27),(22362,7,46,95,92,25,21,23,30,28),(22362,8,52,105,117,26,21,23,31,29),(22362,9,58,116,147,27,21,23,32,30),(22362,10,64,126,180,27,22,24,33,31),(22362,11,75,151,190,28,22,24,37,35),(22362,12,83,177,203,29,22,26,41,39),(22362,13,91,198,215,30,22,26,44,43),(22362,14,120,234,228,31,22,28,50,47),(22362,15,129,262,240,32,23,29,54,52),(22362,16,138,290,253,34,23,30,57,56),(22362,17,147,318,265,36,23,31,61,60),(22362,18,156,346,278,37,23,32,65,65),(22362,19,165,374,291,38,23,33,70,69),(22362,20,175,402,303,40,24,35,74,74),(22362,21,184,430,320,42,24,37,87,78),(22362,22,193,458,346,44,24,39,91,82),(22362,23,202,486,360,45,24,40,95,86),(22362,24,212,514,373,46,25,42,94,90),(22362,25,224,539,386,47,25,43,94,95),(22362,26,237,568,399,48,25,43,98,100),(22362,27,249,598,411,50,25,42,102,104),(22362,28,262,632,424,51,25,44,109,110),(22362,29,274,667,436,52,26,44,114,114),(22362,30,287,702,449,54,26,45,120,118),(22362,31,299,734,462,55,26,46,124,123),(22362,32,312,772,478,57,26,47,128,128),(22362,33,324,807,488,58,27,48,132,131),(22362,34,338,842,501,60,27,50,136,135),(22362,35,360,898,536,62,27,51,139,136),(22362,36,382,954,572,65,27,52,142,137),(22362,37,404,1010,604,67,27,54,146,138),(22362,38,427,1066,643,70,28,55,149,139),(22362,39,449,1122,682,73,28,56,153,141),(22362,40,471,1178,701,75,28,58,156,142),(22362,41,493,1234,726,78,28,59,160,143),(22362,42,516,1290,756,80,29,60,163,144),(22362,43,538,1346,782,83,29,62,167,145),(22362,44,560,1402,815,86,29,63,170,147),(22362,45,582,1458,843,88,29,64,174,148),(22362,46,605,1514,878,91,30,66,177,149),(22362,47,627,1570,900,93,30,67,181,151),(22362,48,649,1627,924,96,30,68,184,152),(22362,49,672,1685,946,99,31,70,188,155),(22362,50,694,1704,979,101,31,71,194,160),(22362,51,716,1723,999,103,31,72,201,170),(22362,52,738,1743,1020,105,32,74,208,180),(22362,53,761,1762,1039,107,32,75,215,190),(22362,54,783,1781,1055,109,32,77,222,200),(22362,55,805,1801,1073,111,33,78,229,210),(22362,56,827,1820,1091,113,33,80,236,220),(22362,57,850,1839,1107,115,33,81,243,230),(22362,58,872,1859,1123,117,34,83,250,240),(22362,59,894,1878,1148,120,34,84,257,250),(22362,60,917,1898,1163,122,35,86,264,260),(22362,61,939,1918,1260,125,35,88,271,270),(22362,62,961,1937,1398,128,36,89,278,280),(22362,63,983,1956,1420,131,36,91,285,290),(22362,64,1005,1975,1572,134,36,93,292,300),(22362,65,1027,1994,1699,137,37,94,299,310),(22362,66,1049,2013,1840,140,37,96,306,320),(22362,67,1072,2032,1939,143,37,97,313,330),(22362,68,1094,2052,2070,146,38,99,320,340),(22362,69,1126,2071,2130,149,38,100,327,350),(22362,70,1149,2090,2207,152,39,102,334,360),(10979,1,14,40,0,20,20,20,24,23),(10979,2,19,49,0,21,20,20,25,24),(10979,3,24,58,0,22,20,21,26,25),(10979,4,29,67,0,23,21,21,27,26),(10979,5,34,76,0,23,21,22,28,27),(10979,6,40,85,0,24,21,22,29,27),(10979,7,46,95,0,25,21,23,30,28),(10979,8,52,105,0,26,21,23,31,29),(10979,9,58,116,0,27,21,23,32,30),(10979,10,64,126,0,27,22,24,33,31),(10979,11,75,151,0,28,22,24,37,35),(10979,12,83,177,0,29,22,26,41,39),(10979,13,91,198,0,30,22,26,44,43),(10979,14,120,234,0,31,22,28,50,47),(10979,15,129,262,0,32,23,29,54,52),(10979,16,138,290,0,34,23,30,57,56),(10979,17,147,318,0,36,23,31,61,60),(10979,18,156,346,0,37,23,32,65,65),(10979,19,165,374,0,38,23,33,70,69),(10979,20,175,402,0,40,24,35,74,74),(10979,21,184,430,0,42,24,37,87,78),(10979,22,193,458,0,44,24,39,91,82),(10979,23,202,486,0,45,24,40,95,86),(10979,24,212,514,0,46,25,42,94,90),(10979,25,224,539,0,47,25,43,94,95),(10979,26,237,568,0,48,25,43,98,100),(10979,27,249,598,0,50,25,42,102,104),(10979,28,262,632,0,51,25,44,109,110),(10979,29,274,667,0,52,26,44,114,114),(10979,30,287,702,0,54,26,45,120,118),(10979,31,299,734,0,55,26,46,124,123),(10979,32,312,772,0,57,26,47,128,128),(10979,33,324,807,0,58,27,48,132,131),(10979,34,338,842,0,60,27,50,136,135),(10979,35,360,898,0,62,27,51,139,136),(10979,36,382,954,0,65,27,52,142,137),(10979,37,404,1010,0,67,27,54,146,138),(10979,38,427,1066,0,70,28,55,149,139),(10979,39,449,1122,0,73,28,56,153,141),(10979,40,471,1178,0,75,28,58,156,142),(10979,41,493,1234,0,78,28,59,160,143),(10979,42,516,1290,0,80,29,60,163,144),(10979,43,538,1346,0,83,29,62,167,145),(10979,44,560,1402,0,86,29,63,170,147),(10979,45,582,1458,0,88,29,64,174,148),(10979,46,605,1514,0,91,30,66,177,149),(10979,47,627,1570,0,93,30,67,181,151),(10979,48,649,1627,0,96,30,68,184,152),(10979,49,672,1685,0,99,31,70,188,155),(10979,50,694,1704,0,101,31,71,194,160),(10979,51,716,1723,0,103,31,72,201,170),(10979,52,738,1743,0,105,32,74,208,180),(10979,53,761,1762,0,107,32,75,215,190),(10979,54,783,1781,0,109,32,77,222,200),(10979,55,805,1801,0,111,33,78,229,210),(10979,56,827,1820,0,113,33,80,236,220),(10979,57,850,1839,0,115,33,81,243,230),(10979,58,872,1859,0,117,34,83,250,240),(10979,59,894,1878,0,120,34,84,257,250),(10979,60,917,1898,0,122,35,86,264,260),(10979,61,939,1918,0,125,35,88,271,270),(10979,62,961,1937,0,128,36,89,278,280),(10979,63,983,1956,0,131,36,91,285,290),(10979,64,1005,1975,0,134,36,93,292,300),(10979,65,1027,1994,0,137,37,94,299,310),(10979,66,1049,2013,0,140,37,96,306,320),(10979,67,1072,2032,0,143,37,97,313,330),(10979,68,1094,2052,0,146,38,99,320,340),(10979,69,1126,2071,0,149,38,100,327,350),(10979,70,1149,2090,0,152,39,102,334,360),(15352,1,1,0,1,1,1,1,1,1),(15352,2,1,0,1,1,1,1,1,1),(15352,3,1,0,1,1,1,1,1,1),(15352,4,1,0,1,1,1,1,1,1),(15352,5,1,0,1,1,1,1,1,1),(15352,6,1,0,1,1,1,1,1,1),(15352,7,1,0,1,1,1,1,1,1),(15352,8,1,0,1,1,1,1,1,1),(15352,9,1,0,1,1,1,1,1,1),(15352,10,1,0,1,1,1,1,1,1),(15352,11,1,0,1,1,1,1,1,1),(15352,12,1,0,1,1,1,1,1,1),(15352,13,1,0,1,1,1,1,1,1),(15352,14,1,0,1,1,1,1,1,1),(15352,15,1,0,1,1,1,1,1,1),(15352,16,1,0,1,1,1,1,1,1),(15352,17,1,0,1,1,1,1,1,1),(15352,18,1,0,1,1,1,1,1,1),(15352,19,1,0,1,1,1,1,1,1),(15352,20,1,0,1,1,1,1,1,1),(15352,21,1,0,1,1,1,1,1,1),(15352,22,1,0,1,1,1,1,1,1),(15352,23,1,0,1,1,1,1,1,1),(15352,24,1,0,1,1,1,1,1,1),(15352,25,1,0,1,1,1,1,1,1),(15352,26,1,0,1,1,1,1,1,1),(15352,27,1,0,1,1,1,1,1,1),(15352,28,1,0,1,1,1,1,1,1),(15352,29,1,0,1,1,1,1,1,1),(15352,30,1,0,1,1,1,1,1,1),(15352,31,1,0,1,1,1,1,1,1),(15352,32,1,0,1,1,1,1,1,1),(15352,33,1,0,1,1,1,1,1,1),(15352,34,1,0,1,1,1,1,1,1),(15352,35,1,0,1,1,1,1,1,1),(15352,36,1,0,1,1,1,1,1,1),(15352,37,1,0,1,1,1,1,1,1),(15352,38,1,0,1,1,1,1,1,1),(15352,39,1,0,1,1,1,1,1,1),(15352,40,1,0,1,1,1,1,1,1),(15352,41,1,0,1,1,1,1,1,1),(15352,42,1,0,1,1,1,1,1,1),(15352,43,1,0,1,1,1,1,1,1),(15352,44,1,0,1,1,1,1,1,1),(15352,45,1,0,1,1,1,1,1,1),(15352,46,1,0,1,1,1,1,1,1),(15352,47,1,0,1,1,1,1,1,1),(15352,48,1,0,1,1,1,1,1,1),(15352,49,1,0,1,1,1,1,1,1),(15352,50,1,0,1,1,1,1,1,1),(15352,51,1,0,1,1,1,1,1,1),(15352,52,1,0,1,1,1,1,1,1),(15352,53,1,0,1,1,1,1,1,1),(15352,54,1,0,1,1,1,1,1,1),(15352,55,1,0,1,1,1,1,1,1),(15352,56,1,0,1,1,1,1,1,1),(15352,57,1,0,1,1,1,1,1,1),(15352,58,1,0,1,1,1,1,1,1),(15352,59,1,0,1,1,1,1,1,1),(15352,60,1,0,1,1,1,1,1,1),(15352,61,1,0,1,1,1,1,1,1),(15352,62,1,0,1,1,1,1,1,1),(15352,63,1,0,1,1,1,1,1,1),(15352,64,1,0,1,1,1,1,1,1),(15352,65,1,0,1,1,1,1,1,1),(15352,66,6600,0,6200,132,62,96,132,320),(15352,67,6700,0,6400,134,64,97,134,330),(15352,68,6800,0,6600,136,66,99,136,340),(15352,69,6900,0,6800,138,68,100,138,350),(15352,70,7000,0,7000,140,70,102,140,360),(15438,1,1,1,1,1,1,1,1,1),(15438,2,1,1,1,1,1,1,1,1),(15438,3,1,1,1,1,1,1,1,1),(15438,4,1,1,1,1,1,1,1,1),(15438,5,1,1,1,1,1,1,1,1),(15438,6,1,1,1,1,1,1,1,1),(15438,7,1,1,1,1,1,1,1,1),(15438,8,1,1,1,1,1,1,1,1),(15438,9,1,1,1,1,1,1,1,1),(15438,10,1,1,1,1,1,1,1,1),(15438,11,1,1,1,1,1,1,1,1),(15438,12,1,1,1,1,1,1,1,1),(15438,13,1,1,1,1,1,1,1,1),(15438,14,1,1,1,1,1,1,1,1),(15438,15,1,1,1,1,1,1,1,1),(15438,16,1,1,1,1,1,1,1,1),(15438,17,1,1,1,1,1,1,1,1),(15438,18,1,1,1,1,1,1,1,1),(15438,19,1,1,1,1,1,1,1,1),(15438,20,1,1,1,1,1,1,1,1),(15438,21,1,1,1,1,1,1,1,1),(15438,22,1,1,1,1,1,1,1,1),(15438,23,1,1,1,1,1,1,1,1),(15438,24,1,1,1,1,1,1,1,1),(15438,25,1,1,1,1,1,1,1,1),(15438,26,1,1,1,1,1,1,1,1),(15438,27,1,1,1,1,1,1,1,1),(15438,28,1,1,1,1,1,1,1,1),(15438,29,1,1,1,1,1,1,1,1),(15438,30,1,1,1,1,1,1,1,1),(15438,31,1,1,1,1,1,1,1,1),(15438,32,1,1,1,1,1,1,1,1),(15438,33,1,1,1,1,1,1,1,1),(15438,34,1,1,1,1,1,1,1,1),(15438,35,1,1,1,1,1,1,1,1),(15438,36,1,1,1,1,1,1,1,1),(15438,37,1,1,1,1,1,1,1,1),(15438,38,1,1,1,1,1,1,1,1),(15438,39,1,1,1,1,1,1,1,1),(15438,40,1,1,1,1,1,1,1,1),(15438,41,1,1,1,1,1,1,1,1),(15438,42,1,1,1,1,1,1,1,1),(15438,43,1,1,1,1,1,1,1,1),(15438,44,1,1,1,1,1,1,1,1),(15438,45,1,1,1,1,1,1,1,1),(15438,46,1,1,1,1,1,1,1,1),(15438,47,1,1,1,1,1,1,1,1),(15438,48,1,1,1,1,1,1,1,1),(15438,49,1,1,1,1,1,1,1,1),(15438,50,1,1,1,1,1,1,1,1),(15438,51,1,1,1,1,1,1,1,1),(15438,52,1,1,1,1,1,1,1,1),(15438,53,1,1,1,1,1,1,1,1),(15438,54,1,1,1,1,1,1,1,1),(15438,55,1,1,1,1,1,1,1,1),(15438,56,1,1,1,1,1,1,1,1),(15438,57,1,1,1,1,1,1,1,1),(15438,58,1,1,1,1,1,1,1,1),(15438,59,1,1,1,1,1,1,1,1),(15438,60,1,1,1,1,1,1,1,1),(15438,61,1,1,1,1,1,1,1,1),(15438,62,1,1,1,1,1,1,1,1),(15438,63,1,1,1,1,1,1,1,1),(15438,64,1,1,1,1,1,1,1,1),(15438,65,1,1,1,1,1,1,1,1),(15438,66,1,1,1,1,1,1,1,1),(15438,67,1,1,1,1,1,1,1,1),(15438,68,6800,2052,980,198,136,99,320,340),(15438,69,6900,2071,990,204,138,100,327,350),(15438,70,7000,2090,1000,210,140,102,334,360),(26101,1,1,1,0,1,1,1,1,1),(26101,2,1,1,0,1,1,1,1,1),(26101,3,1,1,0,1,1,1,1,1),(26101,4,1,1,0,1,1,1,1,1),(26101,5,1,1,0,1,1,1,1,1),(26101,6,1,1,0,1,1,1,1,1),(26101,7,1,1,0,1,1,1,1,1),(26101,8,1,1,0,1,1,1,1,1),(26101,9,1,1,0,1,1,1,1,1),(26101,10,1,1,0,1,1,1,1,1),(26101,11,1,1,0,1,1,1,1,1),(26101,12,1,1,0,1,1,1,1,1),(26101,13,1,1,0,1,1,1,1,1),(26101,14,1,1,0,1,1,1,1,1),(26101,15,1,1,0,1,1,1,1,1),(26101,16,1,1,0,1,1,1,1,1),(26101,17,1,1,0,1,1,1,1,1),(26101,18,1,1,0,1,1,1,1,1),(26101,19,1,1,0,1,1,1,1,1),(26101,20,1,1,0,1,1,1,1,1),(26101,21,1,1,0,1,1,1,1,1),(26101,22,1,1,0,1,1,1,1,1),(26101,23,1,1,0,1,1,1,1,1),(26101,24,1,1,0,1,1,1,1,1),(26101,25,1,1,0,1,1,1,1,1),(26101,26,1,1,0,1,1,1,1,1),(26101,27,1,1,0,1,1,1,1,1),(26101,28,1,1,0,1,1,1,1,1),(26101,29,1,1,0,1,1,1,1,1),(26101,30,1,1,0,1,1,1,1,1),(26101,31,1,1,0,1,1,1,1,1),(26101,32,1,1,0,1,1,1,1,1),(26101,33,1,1,0,1,1,1,1,1),(26101,34,1,1,0,1,1,1,1,1),(26101,35,1,1,0,1,1,1,1,1),(26101,36,1,1,0,1,1,1,1,1),(26101,37,1,1,0,1,1,1,1,1),(26101,38,1,1,0,1,1,1,1,1),(26101,39,1,1,0,1,1,1,1,1),(26101,40,1,1,0,1,1,1,1,1),(26101,41,1,1,0,1,1,1,1,1),(26101,42,1,1,0,1,1,1,1,1),(26101,43,1,1,0,1,1,1,1,1),(26101,44,1,1,0,1,1,1,1,1),(26101,45,1,1,0,1,1,1,1,1),(26101,46,1,1,0,1,1,1,1,1),(26101,47,1,1,0,1,1,1,1,1),(26101,48,1,1,0,1,1,1,1,1),(26101,49,1,1,0,1,1,1,1,1),(26101,50,1,1,0,1,1,1,1,1),(26101,51,1,1,0,1,1,1,1,1),(26101,52,1,1,0,1,1,1,1,1),(26101,53,1,1,0,1,1,1,1,1),(26101,54,1,1,0,1,1,1,1,1),(26101,55,1,1,0,1,1,1,1,1),(26101,56,1,1,0,1,1,1,1,1),(26101,57,1,1,0,1,1,1,1,1),(26101,58,1,1,0,1,1,1,1,1),(26101,59,1,1,0,1,1,1,1,1),(26101,60,1,1,0,1,1,1,1,1),(26101,61,1,1,0,1,1,1,1,1),(26101,62,1,1,0,1,1,1,1,1),(26101,63,1,1,0,1,1,1,1,1),(26101,64,1,1,0,1,1,1,1,1),(26101,65,1,1,0,1,1,1,1,1),(26101,66,1,1,0,1,1,1,1,1),(26101,67,1,1,0,1,1,1,1,1),(26101,68,1,1,0,1,1,1,1,1),(26101,69,1,1,0,1,1,1,1,1),(26101,70,11352,3155,6792,152,39,102,334,360),(26101,71,1172,2109,0,155,39,104,341,370),(26101,72,1195,2128,0,158,40,106,348,380),(26101,73,1218,2147,0,161,40,108,355,390),(26101,74,1241,2166,0,164,40,110,362,400),(26101,75,1264,2185,0,167,41,112,369,410),(26101,76,1287,2204,0,170,41,114,376,420),(26101,77,1310,2223,0,173,41,116,383,430),(26101,78,1333,2242,0,176,42,118,390,440),(26101,79,1356,2261,0,179,42,120,397,450),(26101,80,1379,2280,0,182,42,122,404,460),(24815,71,1174,2110,0,158,40,105,347,370),(24815,72,1190,2132,0,164,40,106,354,380),(24815,73,1204,2145,0,179,42,108,363,390),(24815,74,1219,2159,0,188,43,110,377,400),(24815,75,1231,2172,0,200,44,113,390,410),(24815,76,1250,2190,0,211,45,115,402,420),(24815,77,1269,2203,0,225,46,118,420,430),(24815,78,1281,2220,0,236,47,131,439,440),(24815,79,1299,2239,0,249,48,140,450,450),(24815,80,1314,2252,0,261,50,162,470,460),(22362,71,1174,2110,0,158,40,105,347,370),(22362,72,1190,2132,0,164,40,106,354,380),(22362,73,1204,2145,0,179,42,108,363,390),(22362,74,1219,2159,0,188,43,110,377,400),(22362,75,1231,2172,0,200,44,113,390,410),(22362,76,1250,2190,0,211,45,115,402,420),(22362,77,1269,2203,0,225,46,118,420,430),(22362,78,1281,2220,0,236,47,131,439,440),(22362,79,1299,2239,0,249,48,140,450,450),(22362,80,1314,2252,0,261,50,162,470,460),(14385,71,4046,1902,4233,160,88,84,91,78),(14385,72,4112,1931,4528,162,88,84,92,80),(14385,73,4179,1960,4828,163,90,86,94,81),(14385,74,4247,1990,5133,164,90,87,95,82),(14385,75,4315,2021,5438,166,94,88,97,84),(14385,76,4384,2051,5748,168,95,90,98,86),(14385,77,4454,2084,6058,170,95,91,99,87),(14385,78,4525,2116,6368,174,96,92,100,88),(14385,79,4597,2149,6683,178,97,92,101,88),(14385,80,4665,2186,6993,181,98,95,103,90),(12922,71,1174,2110,0,158,40,105,347,370),(12922,72,1190,2132,0,164,40,106,354,380),(12922,73,1204,2145,0,179,42,108,363,390),(12922,74,1219,2159,0,188,43,110,377,400),(12922,75,1231,2172,0,200,44,113,390,410),(12922,76,1250,2190,0,211,45,115,402,420),(12922,77,1269,2203,0,225,46,118,420,430),(12922,78,1281,2220,0,236,47,131,439,440),(12922,79,1299,2239,0,249,48,140,450,450),(12922,80,1314,2252,0,261,50,162,470,460),(10979,71,1174,2110,0,158,40,105,347,370),(10979,72,1190,2132,0,164,40,106,354,380),(10979,73,1204,2145,0,179,42,108,363,390),(10979,74,1219,2159,0,188,43,110,377,400),(10979,75,1231,2172,0,200,44,113,390,410),(10979,76,1250,2190,0,211,45,115,402,420),(10979,77,1269,2203,0,225,46,118,420,430),(10979,78,1281,2220,0,236,47,131,439,440),(10979,79,1299,2239,0,249,48,140,450,450),(10979,80,1314,2252,0,261,50,162,470,460),(10928,71,1174,2110,0,158,40,105,347,370),(10928,72,1190,2132,0,164,40,106,354,380),(10928,73,1204,2145,0,179,42,108,363,390),(10928,74,1219,2159,0,188,43,110,377,400),(10928,75,1231,2172,0,200,44,113,390,410),(10928,76,1250,2190,0,211,45,115,402,420),(10928,77,1269,2203,0,225,46,118,420,430),(10928,78,1281,2220,0,236,47,131,439,440),(10928,79,1299,2239,0,249,48,140,450,450),(10928,80,1314,2252,0,261,50,162,470,460),(8996,71,1174,2110,0,158,40,105,347,370),(8996,72,1190,2132,0,164,40,106,354,380),(8996,73,1204,2145,0,179,42,108,363,390),(8996,74,1219,2159,0,188,43,110,377,400),(8996,75,1231,2172,0,200,44,113,390,410),(8996,76,1250,2190,0,211,45,115,402,420),(8996,77,1269,2203,0,225,46,118,420,430),(8996,78,1281,2220,0,236,47,131,439,440),(8996,79,1299,2239,0,249,48,140,450,450),(8996,80,1314,2252,0,261,50,162,470,460),(8477,71,1174,2110,0,158,40,105,347,370),(8477,72,1190,2132,0,164,40,106,354,380),(8477,73,1204,2145,0,179,42,108,363,390),(8477,74,1219,2159,0,188,43,110,377,400),(8477,75,1231,2172,0,200,44,113,390,410),(8477,76,1250,2190,0,211,45,115,402,420),(8477,77,1269,2203,0,225,46,118,420,430),(8477,78,1281,2220,0,236,47,131,439,440),(8477,79,1299,2239,0,249,48,140,450,450),(8477,80,1314,2252,0,261,50,162,470,460),(3450,71,1174,2110,0,158,40,105,347,370),(3450,72,1190,2132,0,164,40,106,354,380),(3450,73,1204,2145,0,179,42,108,363,390),(3450,74,1219,2159,0,188,43,110,377,400),(3450,75,1231,2172,0,200,44,113,390,410),(3450,76,1250,2190,0,211,45,115,402,420),(3450,77,1269,2203,0,225,46,118,420,430),(3450,78,1281,2220,0,236,47,131,439,440),(3450,79,1299,2239,0,249,48,140,450,450),(3450,80,1314,2252,0,261,50,162,470,460),(1,71,4162,1,7093,165,131,311,61,97),(1,72,4273,1,7392,168,134,316,62,99),(1,73,4384,1,7691,171,137,321,63,101),(1,74,4495,1,7990,174,140,326,64,103),(1,75,4606,1,8289,177,143,331,65,105),(1,76,4717,1,8588,180,146,336,66,107),(1,77,4828,1,8887,183,149,341,67,109),(1,78,4939,1,9186,186,152,346,68,111),(1,79,5050,1,9485,189,155,351,69,113),(1,80,5161,1,9784,192,158,356,70,115),(15438,71,7100,2109,1010,218,142,105,342,370),(15438,72,7200,2133,1020,224,144,106,349,380),(15438,73,7300,2149,1030,229,146,108,356,390),(15438,74,7400,2169,1040,238,148,110,363,400),(15438,75,7500,2188,1050,247,150,113,370,410),(15438,76,7600,2209,1060,253,152,115,377,420),(15438,77,7700,2228,1070,260,154,118,384,430),(15438,78,7800,2246,1080,268,156,120,391,440),(15438,79,7900,2264,1090,276,158,124,398,450),(15438,80,8000,2280,1100,283,160,125,405,460),(15352,71,7100,0,7200,158,72,105,142,370),(15352,72,7200,0,7400,164,74,106,144,380),(15352,73,7300,0,7600,179,77,108,147,390),(15352,74,7400,0,7800,188,80,110,150,400),(15352,75,7500,0,8000,200,83,113,152,410),(15352,76,7600,0,8200,211,84,115,155,420),(15352,77,7700,0,8400,225,86,118,158,430),(15352,78,7800,0,8600,236,89,131,160,440),(15352,79,7900,0,8800,249,89,140,163,450),(15352,80,8000,0,9000,261,90,162,165,460),(575,71,4501,4560,0,164,122,81,297,192),(575,72,4797,4664,0,167,125,82,303,196),(575,73,5093,4768,0,170,129,83,309,200),(575,74,5389,4872,0,174,132,84,315,204),(575,75,5685,4976,0,177,136,85,321,208),(575,76,5980,5080,0,180,139,86,326,212),(575,77,6276,5184,0,183,142,87,332,216),(575,78,6572,5288,0,186,146,88,338,220),(575,79,6868,5392,0,189,149,89,344,224),(575,80,7164,5496,0,193,153,90,350,228),(19668,71,2458,4560,0,177,122,81,297,192),(19668,72,2511,4664,0,181,125,82,303,196),(19668,73,2564,4768,0,186,129,83,309,200),(19668,74,2618,4872,0,191,132,84,315,204),(19668,75,2671,4976,0,196,136,85,321,208),(19668,76,2724,5080,0,200,139,86,326,212),(19668,77,2777,5184,0,205,142,87,332,216),(19668,78,2831,5288,0,210,146,88,338,220),(19668,79,2884,5392,0,215,149,89,344,224),(19668,80,2937,5496,0,219,153,90,350,228),(416,71,1580,2632,2319,148,40,102,342,269),(416,72,1639,2695,2431,150,41,104,351,274),(416,73,1699,2763,2544,153,44,104,358,280),(416,74,1761,2830,2660,156,45,108,365,283),(416,75,1821,2896,2760,159,46,109,373,288),(416,76,1882,2964,2890,164,48,110,381,295),(416,77,1949,3033,2999,166,49,113,390,300),(416,78,2011,3100,3110,168,50,114,397,308),(416,79,2073,3167,3150,171,51,115,392,313),(416,80,2129,3228,3191,175,54,119,402,319),(417,71,3169,2478,4561,156,111,285,136,124),(417,72,3227,2535,4721,159,113,290,139,126),(417,73,3283,2594,4882,162,116,294,143,128),(417,74,3342,2653,5041,165,118,298,146,129),(417,75,3403,2711,5199,167,121,304,150,131),(417,76,3459,2772,5363,170,124,309,153,132),(417,77,3518,2833,5526,172,127,313,156,135),(417,78,3576,2894,5688,175,129,319,157,137),(417,79,3645,2954,5868,177,130,324,158,140),(417,80,3733,3025,6008,179,133,329,162,142),(510,71,2489,4568,0,167,123,81,299,195),(510,72,2549,4676,0,171,127,82,305,200),(510,73,2609,4784,0,175,131,83,311,205),(510,74,2669,4892,0,179,135,84,317,210),(510,75,2729,5000,0,183,139,85,323,215),(510,76,2789,5108,0,187,143,86,329,220),(510,77,2849,5216,0,191,147,87,335,225),(510,78,2909,5324,0,195,151,88,341,230),(510,79,2969,5432,0,199,155,89,347,235),(510,80,3029,5540,0,203,159,90,353,240),(1860,71,5010,2992,9484,155,112,283,137,194),(1860,72,5161,3100,9861,157,114,286,141,197),(1860,73,5313,3208,10231,159,116,289,145,201),(1860,74,5466,3317,10603,163,120,293,151,205),(1860,75,5620,3426,10983,165,123,296,156,214),(1860,76,5775,3535,11362,167,125,300,160,218),(1860,77,5930,3645,11743,170,127,303,165,222),(1860,78,6086,3758,12125,172,129,306,172,226),(1860,79,6243,3874,12508,174,131,310,178,231),(1860,80,6401,3997,13011,177,134,313,185,235),(1863,71,2211,2460,4479,155,110,284,136,124),(1863,72,2259,2516,4666,157,111,288,139,125),(1863,73,2308,2573,4854,159,113,293,143,127),(1863,74,2358,2631,5042,161,115,298,147,131),(1863,75,2409,2660,5231,164,118,303,150,134),(1863,76,2461,2735,5421,167,120,309,154,137),(1863,77,2512,2793,5612,170,122,314,156,141),(1863,78,2562,2852,5804,172,124,319,158,143),(1863,79,2612,2911,5997,175,127,324,160,147),(1863,80,2665,2989,6204,178,130,330,163,150),(17252,71,5471,4277,8267,155,109,359,204,124),(17252,72,5623,4384,8607,158,111,367,211,125),(17252,73,5776,4492,8952,161,113,375,219,128),(17252,74,5930,4600,9297,164,115,382,227,130),(17252,75,6085,4709,9647,166,118,390,235,132),(17252,76,6241,4818,9997,170,121,399,242,135),(17252,77,6398,4927,10352,172,124,407,250,138),(17252,78,6556,5036,10712,174,125,414,257,141),(17252,79,6711,5144,11067,176,127,423,266,145),(17252,80,6872,5266,11454,177,130,432,275,150),(329,1,140,48,20,20,5,20,24,23),(329,2,149,59,20,21,5,2,25,24),(329,3,158,70,20,15,5,4,26,25),(329,4,168,81,33,17,5,8,27,26),(329,5,177,92,49,18,5,12,28,27),(329,6,186,103,68,20,7,16,29,27),(329,7,195,114,92,22,7,21,30,28),(329,8,204,125,117,23,8,25,31,29),(329,9,213,136,147,25,9,27,32,30),(329,10,223,147,180,29,10,29,33,31),(329,11,232,158,190,30,11,32,37,35),(329,12,250,180,203,31,12,36,41,39),(329,13,289,203,215,32,13,43,50,43),(329,14,299,227,228,33,13,44,54,47),(329,15,309,251,240,34,13,48,57,52),(329,16,329,275,253,36,13,52,62,56),(329,17,350,300,265,38,13,55,65,65),(329,18,362,314,278,39,13,59,70,70),(329,19,393,351,291,40,13,63,74,75),(329,20,403,377,303,42,13,67,87,78),(329,21,425,393,320,44,13,80,91,83),(329,22,449,420,346,46,13,84,95,86),(329,23,473,447,360,47,13,89,96,90),(329,24,520,476,373,49,13,93,97,95),(329,25,540,504,386,50,13,97,98,100),(329,26,569,534,399,52,13,101,60,78),(329,27,571,564,411,53,14,105,61,81),(329,28,574,592,424,55,15,110,62,86),(329,29,576,620,436,57,16,114,62,89),(329,30,579,648,449,57,16,118,63,92),(329,31,581,676,462,59,16,123,64,95),(329,32,590,720,476,60,17,127,64,98),(329,33,598,742,488,62,18,131,65,101),(329,34,601,793,501,63,19,135,65,104),(329,35,609,845,513,64,19,136,66,107),(329,36,617,879,525,67,19,137,66,110),(329,37,626,916,537,69,19,138,68,112),(329,38,634,952,549,70,19,139,68,115),(329,39,642,988,561,72,19,142,69,118),(329,40,650,1026,639,74,20,147,156,142),(329,41,668,1063,694,77,20,152,160,143),(329,42,676,1103,756,81,20,156,163,144),(329,43,685,1187,808,87,20,160,167,145),(329,44,693,1214,853,91,21,164,170,146),(329,45,701,1240,884,96,21,169,174,148),(329,46,709,1267,910,98,22,173,177,149),(329,47,718,1294,928,100,22,177,181,151),(329,48,726,1320,946,102,22,181,184,152),(329,49,734,1347,964,105,22,186,188,155),(329,50,747,1391,983,107,22,190,194,158),(329,51,750,1435,996,109,22,194,202,161),(329,52,764,1481,1013,112,24,198,208,165),(329,53,787,1527,1039,114,25,203,215,168),(329,54,820,1573,1055,115,26,207,222,172),(329,55,836,1620,1078,119,26,211,229,177),(329,56,846,1666,1091,121,27,215,236,181),(329,57,850,1714,1101,123,27,220,243,185),(329,58,862,1763,1125,125,27,224,250,189),(329,59,878,1824,1150,127,27,230,258,192),(329,60,920,1898,1163,122,27,128,264,197),(329,61,973,1925,1608,132,29,251,271,239),(329,62,1050,1977,1663,135,31,253,278,241),(329,63,1188,2030,1732,137,32,255,285,244),(329,64,1292,2084,1809,139,33,259,292,247),(329,65,1335,2137,1844,142,33,264,299,250),(329,66,1357,2191,1872,144,33,268,306,255),(329,67,1401,2244,1900,146,33,272,313,258),(329,68,1429,2298,1987,148,34,276,320,260),(329,69,1464,2351,2008,151,36,278,327,262),(329,70,1528,2568,2227,152,39,103,334,264),(329,71,7100,2109,1010,71,39,104,341,370),(329,72,7200,2128,1020,72,39,105,348,380),(329,73,7300,2147,1030,73,40,107,355,390),(329,74,7400,2167,1040,74,40,108,362,400),(329,75,7500,2186,1050,75,40,110,369,410),(329,76,7600,2205,1060,76,41,111,376,420),(329,77,7700,2224,1070,77,41,113,383,430),(329,78,7800,2243,1080,78,42,115,390,440),(329,79,7900,2262,1090,79,42,116,397,450),(329,80,8000,2282,1100,80,42,118,404,460),(3939,1,140,48,20,20,5,20,24,23),(3939,2,149,59,20,21,5,2,25,24),(3939,3,158,70,20,15,5,4,26,25),(3939,4,168,81,33,17,5,8,27,26),(3939,5,177,92,49,18,5,12,28,27),(3939,6,186,103,68,20,7,16,29,27),(3939,7,195,114,92,22,7,21,30,28),(3939,8,204,125,117,23,8,25,31,29),(3939,9,213,136,147,25,9,27,32,30),(3939,10,223,147,180,29,10,29,33,31),(3939,11,232,158,190,30,11,32,37,35),(3939,12,250,180,203,31,12,36,41,39),(3939,13,289,203,215,32,13,43,50,43),(3939,14,299,227,228,33,13,44,54,47),(3939,15,309,251,240,34,13,48,57,52),(3939,16,329,275,253,36,13,52,62,56),(3939,17,350,300,265,38,13,55,65,65),(3939,18,362,314,278,39,13,59,70,70),(3939,19,393,351,291,40,13,63,74,75),(3939,20,403,377,303,42,13,67,87,78),(3939,21,425,393,320,44,13,80,91,83),(3939,22,449,420,346,46,13,84,95,86),(3939,23,473,447,360,47,13,89,96,90),(3939,24,520,476,373,49,13,93,97,95),(3939,25,540,504,386,50,13,97,98,100),(3939,26,569,534,399,52,13,101,60,78),(3939,27,571,564,411,53,14,105,61,81),(3939,28,574,592,424,55,15,110,62,86),(3939,29,576,620,436,57,16,114,62,89),(3939,30,579,648,449,57,16,118,63,92),(3939,31,581,676,462,59,16,123,64,95),(3939,32,590,720,476,60,17,127,64,98),(3939,33,598,742,488,62,18,131,65,101),(3939,34,601,793,501,63,19,135,65,104),(3939,35,609,845,513,64,19,136,66,107),(3939,36,617,879,525,67,19,137,66,110),(3939,37,626,916,537,69,19,138,68,112),(3939,38,634,952,549,70,19,139,68,115),(3939,39,642,988,561,72,19,142,69,118),(3939,40,650,1026,639,74,20,147,156,142),(3939,41,668,1063,694,77,20,152,160,143),(3939,42,676,1103,756,81,20,156,163,144),(3939,43,685,1187,808,87,20,160,167,145),(3939,44,693,1214,853,91,21,164,170,146),(3939,45,701,1240,884,96,21,169,174,148),(3939,46,709,1267,910,98,22,173,177,149),(3939,47,718,1294,928,100,22,177,181,151),(3939,48,726,1320,946,102,22,181,184,152),(3939,49,734,1347,964,105,22,186,188,155),(3939,50,747,1391,983,107,22,190,194,158),(3939,51,750,1435,996,109,22,194,202,161),(3939,52,764,1481,1013,112,24,198,208,165),(3939,53,787,1527,1039,114,25,203,215,168),(3939,54,820,1573,1055,115,26,207,222,172),(3939,55,836,1620,1078,119,26,211,229,177),(3939,56,846,1666,1091,121,27,215,236,181),(3939,57,850,1714,1101,123,27,220,243,185),(3939,58,862,1763,1125,125,27,224,250,189),(3939,59,878,1824,1150,127,27,230,258,192),(3939,60,920,1898,1163,122,27,128,264,197),(3939,61,973,1925,1608,132,29,251,271,239),(3939,62,1050,1977,1663,135,31,253,278,241),(3939,63,1188,2030,1732,137,32,255,285,244),(3939,64,1292,2084,1809,139,33,259,292,247),(3939,65,1335,2137,1844,142,33,264,299,250),(3939,66,1357,2191,1872,144,33,268,306,255),(3939,67,1401,2244,1900,146,33,272,313,258),(3939,68,1429,2298,1987,148,34,276,320,260),(3939,69,1464,2351,2008,151,36,278,327,262),(3939,70,1528,2568,2227,152,39,103,334,264),(3939,71,5654,4225,8300,155,112,325,135,124),(3939,72,5750,4377,8380,157,115,329,136,126),(3939,73,5945,4430,8440,159,118,332,137,129),(3939,74,6191,4584,8550,162,121,335,138,131),(3939,75,6349,4646,8612,164,123,338,139,134),(3939,76,6676,4778,8910,166,126,343,140,136),(3939,77,6884,4863,9150,169,129,347,141,138),(3939,78,7097,4949,9450,172,132,351,142,141),(3939,79,7208,5035,9800,174,135,355,143,143),(3939,80,7320,5170,10087,177,137,361,144,146),(5058,1,40,48,20,12,14,1,1,25),(5058,2,49,59,40,14,15,2,1,26),(5058,3,58,70,60,15,16,4,1,27),(5058,4,68,81,80,17,17,8,2,27),(5058,5,77,92,100,18,18,12,2,28),(5058,6,86,103,120,20,19,16,3,29),(5058,7,95,114,140,22,20,21,3,29),(5058,8,104,125,160,23,21,25,4,30),(5058,9,113,136,180,25,22,29,4,31),(5058,10,123,147,200,26,23,33,5,31),(5058,11,132,158,220,28,25,38,6,32),(5058,12,150,180,240,29,26,42,8,33),(5058,13,169,203,280,31,27,46,9,34),(5058,14,189,227,320,33,28,50,11,35),(5058,15,209,251,360,34,29,55,14,35),(5058,16,229,275,400,36,30,59,16,36),(5058,17,250,300,460,37,31,63,20,37),(5058,18,262,314,510,39,32,67,24,38),(5058,19,293,351,550,40,33,72,29,39),(5058,20,303,377,563,42,35,67,31,49),(5058,21,325,393,604,44,36,80,53,39),(5058,22,349,420,628,46,36,84,54,41),(5058,23,373,447,652,47,38,89,56,42),(5058,24,400,476,675,49,39,93,57,43),(5058,25,440,504,699,50,40,97,60,44),(5058,26,469,534,721,52,41,101,62,46),(5058,27,501,564,745,53,42,105,63,47),(5058,28,534,592,768,55,43,110,65,48),(5058,29,566,620,791,57,44,114,67,49),(5058,30,599,648,815,57,46,118,69,51),(5058,31,631,676,838,59,47,123,71,52),(5058,32,680,720,862,60,47,127,73,53),(5058,33,728,742,884,62,49,131,74,54),(5058,34,661,793,908,64,50,135,76,56),(5058,35,699,845,950,63,51,136,73,57),(5058,36,737,879,990,67,52,137,72,58),(5058,37,776,916,1038,69,53,138,70,59),(5058,38,814,952,1095,70,55,139,69,61),(5058,39,852,988,1163,72,56,142,68,62),(5058,40,890,1026,1244,74,57,147,67,64),(5058,41,928,1063,1338,77,58,152,68,66),(5058,42,976,1103,1448,81,59,156,70,67),(5058,43,1005,1187,1560,87,60,160,72,69),(5058,44,1043,1214,1670,91,61,164,74,71),(5058,45,1081,1240,1738,96,64,169,75,72),(5058,46,1119,1267,1773,98,65,173,77,73),(5058,47,1158,1294,1808,100,66,177,78,75),(5058,48,1196,1320,1843,102,68,181,80,76),(5058,49,1234,1347,1878,105,69,186,82,78),(5058,50,2877,2391,3494,107,71,219,95,80),(5058,51,2920,2435,3559,109,72,223,97,81),(5058,52,3164,2481,3624,112,74,228,100,82),(5058,53,3207,2527,3686,113,75,233,102,84),(5058,54,3350,2573,3752,116,77,238,104,87),(5058,55,3493,2620,3814,119,78,243,106,88),(5058,56,3536,2766,3878,120,79,248,108,89),(5058,57,3680,2814,3941,123,82,251,111,92),(5058,58,3723,2913,4006,125,84,255,113,94),(5058,59,3866,2924,4067,128,86,258,115,96),(5058,60,3909,3174,4635,130,87,270,118,98),(5058,61,4054,3225,6300,132,90,274,121,101),(5058,62,4300,3377,6380,135,92,280,122,103),(5058,63,4545,3430,6440,137,93,286,123,105),(5058,64,4691,3584,6550,139,95,295,128,107),(5058,65,4749,3646,6612,142,98,300,129,110),(5058,66,4876,3778,6910,144,99,306,130,112),(5058,67,4984,3863,7150,146,101,310,131,114),(5058,68,5197,3949,7450,148,105,315,132,117),(5058,69,5208,4035,7800,151,107,318,133,119),(5058,70,5320,4170,8087,153,109,322,134,122),(5058,71,4162,1,7093,165,131,311,61,97),(5058,72,4273,1,7392,168,134,316,62,99),(5058,73,4384,1,7691,171,137,321,63,101),(5058,74,4495,1,7990,174,140,326,64,103),(5058,75,4606,1,8289,177,143,331,65,105),(5058,76,4717,1,8588,180,146,336,66,107),(5058,77,4828,1,8887,183,149,341,67,109),(5058,78,4939,1,9186,186,152,346,68,111),(5058,79,5050,1,9485,189,155,351,69,113),(5058,80,5161,1,9784,192,158,356,70,115),(5766,1,140,48,20,20,5,20,24,23),(5766,2,149,59,20,21,5,2,25,24),(5766,3,158,70,20,15,5,4,26,25),(5766,4,168,81,33,17,5,8,27,26),(5766,5,177,92,49,18,5,12,28,27),(5766,6,186,103,68,20,7,16,29,27),(5766,7,195,114,92,22,7,21,30,28),(5766,8,204,125,117,23,8,25,31,29),(5766,9,213,136,147,25,9,27,32,30),(5766,10,223,147,180,29,10,29,33,31),(5766,11,232,158,190,30,11,32,37,35),(5766,12,250,180,203,31,12,36,41,39),(5766,13,289,203,215,32,13,43,50,43),(5766,14,299,227,228,33,13,44,54,47),(5766,15,309,251,240,34,13,48,57,52),(5766,16,329,275,253,36,13,52,62,56),(5766,17,350,300,265,38,13,55,65,65),(5766,18,362,314,278,39,13,59,70,70),(5766,19,393,351,291,40,13,63,74,75),(5766,20,403,377,303,42,13,67,87,78),(5766,21,425,393,320,44,13,80,91,83),(5766,22,449,420,346,46,13,84,95,86),(5766,23,473,447,360,47,13,89,96,90),(5766,24,520,476,373,49,13,93,97,95),(5766,25,540,504,386,50,13,97,98,100),(5766,26,569,534,399,52,13,101,60,78),(5766,27,571,564,411,53,14,105,61,81),(5766,28,574,592,424,55,15,110,62,86),(5766,29,576,620,436,57,16,114,62,89),(5766,30,579,648,449,57,16,118,63,92),(5766,31,581,676,462,59,16,123,64,95),(5766,32,590,720,476,60,17,127,64,98),(5766,33,598,742,488,62,18,131,65,101),(5766,34,601,793,501,63,19,135,65,104),(5766,35,609,845,513,64,19,136,66,107),(5766,36,617,879,525,67,19,137,66,110),(5766,37,626,916,537,69,19,138,68,112),(5766,38,634,952,549,70,19,139,68,115),(5766,39,642,988,561,72,19,142,69,118),(5766,40,650,1026,639,74,20,147,156,142),(5766,41,668,1063,694,77,20,152,160,143),(5766,42,676,1103,756,81,20,156,163,144),(5766,43,685,1187,808,87,20,160,167,145),(5766,44,693,1214,853,91,21,164,170,146),(5766,45,701,1240,884,96,21,169,174,148),(5766,46,709,1267,910,98,22,173,177,149),(5766,47,718,1294,928,100,22,177,181,151),(5766,48,726,1320,946,102,22,181,184,152),(5766,49,734,1347,964,105,22,186,188,155),(5766,50,747,1391,983,107,22,190,194,158),(5766,51,750,1435,996,109,22,194,202,161),(5766,52,764,1481,1013,112,24,198,208,165),(5766,53,787,1527,1039,114,25,203,215,168),(5766,54,820,1573,1055,115,26,207,222,172),(5766,55,836,1620,1078,119,26,211,229,177),(5766,56,846,1666,1091,121,27,215,236,181),(5766,57,850,1714,1101,123,27,220,243,185),(5766,58,862,1763,1125,125,27,224,250,189),(5766,59,878,1824,1150,127,27,230,258,192),(5766,60,920,1898,1163,122,27,128,264,197),(5766,61,973,1925,1608,132,29,251,271,239),(5766,62,1050,1977,1663,135,31,253,278,241),(5766,63,1188,2030,1732,137,32,255,285,244),(5766,64,1292,2084,1809,139,33,259,292,247),(5766,65,1335,2137,1844,142,33,264,299,250),(5766,66,1357,2191,1872,144,33,268,306,255),(5766,67,1401,2244,1900,146,33,272,313,258),(5766,68,1429,2298,1987,148,34,276,320,260),(5766,69,1464,2351,2008,151,36,278,327,262),(5766,70,1528,2568,2227,152,39,103,334,264),(5766,71,4162,1,7093,165,131,311,61,97),(5766,72,4273,1,7392,168,134,316,62,99),(5766,73,4384,1,7691,171,137,321,63,101),(5766,74,4495,1,7990,174,140,326,64,103),(5766,75,4606,1,8289,177,143,331,65,105),(5766,76,4717,1,8588,180,146,336,66,107),(5766,77,4828,1,8887,183,149,341,67,109),(5766,78,4939,1,9186,186,152,346,68,111),(5766,79,5050,1,9485,189,155,351,69,113),(5766,80,5161,1,9784,192,158,356,70,115),(6250,1,140,48,20,20,5,20,24,23),(6250,2,149,59,20,21,5,2,25,24),(6250,3,158,70,20,15,5,4,26,25),(6250,4,168,81,33,17,5,8,27,26),(6250,5,177,92,49,18,5,12,28,27),(6250,6,186,103,68,20,7,16,29,27),(6250,7,195,114,92,22,7,21,30,28),(6250,8,204,125,117,23,8,25,31,29),(6250,9,213,136,147,25,9,27,32,30),(6250,10,223,147,180,29,10,29,33,31),(6250,11,232,158,190,30,11,32,37,35),(6250,12,250,180,203,31,12,36,41,39),(6250,13,289,203,215,32,13,43,50,43),(6250,14,299,227,228,33,13,44,54,47),(6250,15,309,251,240,34,13,48,57,52),(6250,16,329,275,253,36,13,52,62,56),(6250,17,350,300,265,38,13,55,65,65),(6250,18,362,314,278,39,13,59,70,70),(6250,19,393,351,291,40,13,63,74,75),(6250,20,403,377,303,42,13,67,87,78),(6250,21,425,393,320,44,13,80,91,83),(6250,22,449,420,346,46,13,84,95,86),(6250,23,473,447,360,47,13,89,96,90),(6250,24,520,476,373,49,13,93,97,95),(6250,25,540,504,386,50,13,97,98,100),(6250,26,569,534,399,52,13,101,60,78),(6250,27,571,564,411,53,14,105,61,81),(6250,28,574,592,424,55,15,110,62,86),(6250,29,576,620,436,57,16,114,62,89),(6250,30,579,648,449,57,16,118,63,92),(6250,31,581,676,462,59,16,123,64,95),(6250,32,590,720,476,60,17,127,64,98),(6250,33,598,742,488,62,18,131,65,101),(6250,34,601,793,501,63,19,135,65,104),(6250,35,609,845,513,64,19,136,66,107),(6250,36,617,879,525,67,19,137,66,110),(6250,37,626,916,537,69,19,138,68,112),(6250,38,634,952,549,70,19,139,68,115),(6250,39,642,988,561,72,19,142,69,118),(6250,40,650,1026,639,74,20,147,156,142),(6250,41,668,1063,694,77,20,152,160,143),(6250,42,676,1103,756,81,20,156,163,144),(6250,43,685,1187,808,87,20,160,167,145),(6250,44,693,1214,853,91,21,164,170,146),(6250,45,701,1240,884,96,21,169,174,148),(6250,46,709,1267,910,98,22,173,177,149),(6250,47,718,1294,928,100,22,177,181,151),(6250,48,726,1320,946,102,22,181,184,152),(6250,49,734,1347,964,105,22,186,188,155),(6250,50,747,1391,983,107,22,190,194,158),(6250,51,750,1435,996,109,22,194,202,161),(6250,52,764,1481,1013,112,24,198,208,165),(6250,53,787,1527,1039,114,25,203,215,168),(6250,54,820,1573,1055,115,26,207,222,172),(6250,55,836,1620,1078,119,26,211,229,177),(6250,56,846,1666,1091,121,27,215,236,181),(6250,57,850,1714,1101,123,27,220,243,185),(6250,58,862,1763,1125,125,27,224,250,189),(6250,59,878,1824,1150,127,27,230,258,192),(6250,60,920,1898,1163,122,27,128,264,197),(6250,61,973,1925,1608,132,29,251,271,239),(6250,62,1050,1977,1663,135,31,253,278,241),(6250,63,1188,2030,1732,137,32,255,285,244),(6250,64,1292,2084,1809,139,33,259,292,247),(6250,65,1335,2137,1844,142,33,264,299,250),(6250,66,1357,2191,1872,144,33,268,306,255),(6250,67,1401,2244,1900,146,33,272,313,258),(6250,68,1429,2298,1987,148,34,276,320,260),(6250,69,1464,2351,2008,151,36,278,327,262),(6250,70,1528,2568,2227,152,39,103,334,264),(6250,71,4162,1,7093,165,131,311,61,97),(6250,72,4273,1,7392,168,134,316,62,99),(6250,73,4384,1,7691,171,137,321,63,101),(6250,74,4495,1,7990,174,140,326,64,103),(6250,75,4606,1,8289,177,143,331,65,105),(6250,76,4717,1,8588,180,146,336,66,107),(6250,77,4828,1,8887,183,149,341,67,109),(6250,78,4939,1,9186,186,152,346,68,111),(6250,79,5050,1,9485,189,155,351,69,113),(6250,80,5161,1,9784,192,158,356,70,115),(15214,1,140,48,20,20,5,20,24,23),(15214,2,149,59,20,21,5,2,25,24),(15214,3,158,70,20,15,5,4,26,25),(15214,4,168,81,33,17,5,8,27,26),(15214,5,177,92,49,18,5,12,28,27),(15214,6,186,103,68,20,7,16,29,27),(15214,7,195,114,92,22,7,21,30,28),(15214,8,204,125,117,23,8,25,31,29),(15214,9,213,136,147,25,9,27,32,30),(15214,10,223,147,180,29,10,29,33,31),(15214,11,232,158,190,30,11,32,37,35),(15214,12,250,180,203,31,12,36,41,39),(15214,13,289,203,215,32,13,43,50,43),(15214,14,299,227,228,33,13,44,54,47),(15214,15,309,251,240,34,13,48,57,52),(15214,16,329,275,253,36,13,52,62,56),(15214,17,350,300,265,38,13,55,65,65),(15214,18,362,314,278,39,13,59,70,70),(15214,19,393,351,291,40,13,63,74,75),(15214,20,403,377,303,42,13,67,87,78),(15214,21,425,393,320,44,13,80,91,83),(15214,22,449,420,346,46,13,84,95,86),(15214,23,473,447,360,47,13,89,96,90),(15214,24,520,476,373,49,13,93,97,95),(15214,25,540,504,386,50,13,97,98,100),(15214,26,569,534,399,52,13,101,60,78),(15214,27,571,564,411,53,14,105,61,81),(15214,28,574,592,424,55,15,110,62,86),(15214,29,576,620,436,57,16,114,62,89),(15214,30,579,648,449,57,16,118,63,92),(15214,31,581,676,462,59,16,123,64,95),(15214,32,590,720,476,60,17,127,64,98),(15214,33,598,742,488,62,18,131,65,101),(15214,34,601,793,501,63,19,135,65,104),(15214,35,609,845,513,64,19,136,66,107),(15214,36,617,879,525,67,19,137,66,110),(15214,37,626,916,537,69,19,138,68,112),(15214,38,634,952,549,70,19,139,68,115),(15214,39,642,988,561,72,19,142,69,118),(15214,40,650,1026,639,74,20,147,156,142),(15214,41,668,1063,694,77,20,152,160,143),(15214,42,676,1103,756,81,20,156,163,144),(15214,43,685,1187,808,87,20,160,167,145),(15214,44,693,1214,853,91,21,164,170,146),(15214,45,701,1240,884,96,21,169,174,148),(15214,46,709,1267,910,98,22,173,177,149),(15214,47,718,1294,928,100,22,177,181,151),(15214,48,726,1320,946,102,22,181,184,152),(15214,49,734,1347,964,105,22,186,188,155),(15214,50,747,1391,983,107,22,190,194,158),(15214,51,750,1435,996,109,22,194,202,161),(15214,52,764,1481,1013,112,24,198,208,165),(15214,53,787,1527,1039,114,25,203,215,168),(15214,54,820,1573,1055,115,26,207,222,172),(15214,55,836,1620,1078,119,26,211,229,177),(15214,56,846,1666,1091,121,27,215,236,181),(15214,57,850,1714,1101,123,27,220,243,185),(15214,58,862,1763,1125,125,27,224,250,189),(15214,59,878,1824,1150,127,27,230,258,192),(15214,60,920,1898,1163,122,27,128,264,197),(15214,61,973,1925,1608,132,29,251,271,239),(15214,62,1050,1977,1663,135,31,253,278,241),(15214,63,1188,2030,1732,137,32,255,285,244),(15214,64,1292,2084,1809,139,33,259,292,247),(15214,65,1335,2137,1844,142,33,264,299,250),(15214,66,1357,2191,1872,144,33,268,306,255),(15214,67,1401,2244,1900,146,33,272,313,258),(15214,68,1429,2298,1987,148,34,276,320,260),(15214,69,1464,2351,2008,151,36,278,327,262),(15214,70,1528,2568,2227,152,39,103,334,264),(15214,71,5654,4225,8300,155,112,325,135,124),(15214,72,5750,4377,8380,157,115,329,136,126),(15214,73,5945,4430,8440,159,118,332,137,129),(15214,74,6191,4584,8550,162,121,335,138,131),(15214,75,6349,4646,8612,164,123,338,139,134),(15214,76,6676,4778,8910,166,126,343,140,136),(15214,77,6884,4863,9150,169,129,347,141,138),(15214,78,7097,4949,9450,172,132,351,142,141),(15214,79,7208,5035,9800,174,135,355,143,143),(15214,80,7320,5170,10087,177,137,361,144,146),(24476,1,140,48,20,20,5,20,24,23),(24476,2,149,59,20,21,5,2,25,24),(24476,3,158,70,20,15,5,4,26,25),(24476,4,168,81,33,17,5,8,27,26),(24476,5,177,92,49,18,5,12,28,27),(24476,6,186,103,68,20,7,16,29,27),(24476,7,195,114,92,22,7,21,30,28),(24476,8,204,125,117,23,8,25,31,29),(24476,9,213,136,147,25,9,27,32,30),(24476,10,223,147,180,29,10,29,33,31),(24476,11,232,158,190,30,11,32,37,35),(24476,12,250,180,203,31,12,36,41,39),(24476,13,289,203,215,32,13,43,50,43),(24476,14,299,227,228,33,13,44,54,47),(24476,15,309,251,240,34,13,48,57,52),(24476,16,329,275,253,36,13,52,62,56),(24476,17,350,300,265,38,13,55,65,65),(24476,18,362,314,278,39,13,59,70,70),(24476,19,393,351,291,40,13,63,74,75),(24476,20,403,377,303,42,13,67,87,78),(24476,21,425,393,320,44,13,80,91,83),(24476,22,449,420,346,46,13,84,95,86),(24476,23,473,447,360,47,13,89,96,90),(24476,24,520,476,373,49,13,93,97,95),(24476,25,540,504,386,50,13,97,98,100),(24476,26,569,534,399,52,13,101,60,78),(24476,27,571,564,411,53,14,105,61,81),(24476,28,574,592,424,55,15,110,62,86),(24476,29,576,620,436,57,16,114,62,89),(24476,30,579,648,449,57,16,118,63,92),(24476,31,581,676,462,59,16,123,64,95),(24476,32,590,720,476,60,17,127,64,98),(24476,33,598,742,488,62,18,131,65,101),(24476,34,601,793,501,63,19,135,65,104),(24476,35,609,845,513,64,19,136,66,107),(24476,36,617,879,525,67,19,137,66,110),(24476,37,626,916,537,69,19,138,68,112),(24476,38,634,952,549,70,19,139,68,115),(24476,39,642,988,561,72,19,142,69,118),(24476,40,650,1026,639,74,20,147,156,142),(24476,41,668,1063,694,77,20,152,160,143),(24476,42,676,1103,756,81,20,156,163,144),(24476,43,685,1187,808,87,20,160,167,145),(24476,44,693,1214,853,91,21,164,170,146),(24476,45,701,1240,884,96,21,169,174,148),(24476,46,709,1267,910,98,22,173,177,149),(24476,47,718,1294,928,100,22,177,181,151),(24476,48,726,1320,946,102,22,181,184,152),(24476,49,734,1347,964,105,22,186,188,155),(24476,50,747,1391,983,107,22,190,194,158),(24476,51,750,1435,996,109,22,194,202,161),(24476,52,764,1481,1013,112,24,198,208,165),(24476,53,787,1527,1039,114,25,203,215,168),(24476,54,820,1573,1055,115,26,207,222,172),(24476,55,836,1620,1078,119,26,211,229,177),(24476,56,846,1666,1091,121,27,215,236,181),(24476,57,850,1714,1101,123,27,220,243,185),(24476,58,862,1763,1125,125,27,224,250,189),(24476,59,878,1824,1150,127,27,230,258,192),(24476,60,920,1898,1163,122,27,128,264,197),(24476,61,973,1925,1608,132,29,251,271,239),(24476,62,1050,1977,1663,135,31,253,278,241),(24476,63,1188,2030,1732,137,32,255,285,244),(24476,64,1292,2084,1809,139,33,259,292,247),(24476,65,1335,2137,1844,142,33,264,299,250),(24476,66,1357,2191,1872,144,33,268,306,255),(24476,67,1401,2244,1900,146,33,272,313,258),(24476,68,1429,2298,1987,148,34,276,320,260),(24476,69,1464,2351,2008,151,36,278,327,262),(24476,70,1528,2568,2227,152,39,103,334,264),(24476,71,4162,1,7093,165,131,311,61,97),(24476,72,4273,1,7392,168,134,316,62,99),(24476,73,4384,1,7691,171,137,321,63,101),(24476,74,4495,1,7990,174,140,326,64,103),(24476,75,4606,1,8289,177,143,331,65,105),(24476,76,4717,1,8588,180,146,336,66,107),(24476,77,4828,1,8887,183,149,341,67,109),(24476,78,4939,1,9186,186,152,346,68,111),(24476,79,5050,1,9485,189,155,351,69,113),(24476,80,5161,1,9784,192,158,356,70,115),(24656,1,1,1,0,1,1,1,1,1),(24656,2,1,1,0,1,1,1,1,1),(24656,3,1,1,0,1,1,1,1,1),(24656,4,1,1,0,1,1,1,1,1),(24656,5,1,1,0,1,1,1,1,1),(24656,6,1,1,0,1,1,1,1,1),(24656,7,1,1,0,1,1,1,1,1),(24656,8,1,1,0,1,1,1,1,1),(24656,9,1,1,0,1,1,1,1,1),(24656,10,1,1,0,1,1,1,1,1),(24656,11,1,1,0,1,1,1,1,1),(24656,12,1,1,0,1,1,1,1,1),(24656,13,1,1,0,1,1,1,1,1),(24656,14,1,1,0,1,1,1,1,1),(24656,15,1,1,0,1,1,1,1,1),(24656,16,1,1,0,1,1,1,1,1),(24656,17,1,1,0,1,1,1,1,1),(24656,18,1,1,0,1,1,1,1,1),(24656,19,1,1,0,1,1,1,1,1),(24656,20,1,1,0,1,1,1,1,1),(24656,21,1,1,0,1,1,1,1,1),(24656,22,1,1,0,1,1,1,1,1),(24656,23,1,1,0,1,1,1,1,1),(24656,24,1,1,0,1,1,1,1,1),(24656,25,1,1,0,1,1,1,1,1),(24656,26,1,1,0,1,1,1,1,1),(24656,27,1,1,0,1,1,1,1,1),(24656,28,1,1,0,1,1,1,1,1),(24656,29,1,1,0,1,1,1,1,1),(24656,30,1,1,0,1,1,1,1,1),(24656,31,1,1,0,1,1,1,1,1),(24656,32,1,1,0,1,1,1,1,1),(24656,33,1,1,0,1,1,1,1,1),(24656,34,1,1,0,1,1,1,1,1),(24656,35,1,1,0,1,1,1,1,1),(24656,36,1,1,0,1,1,1,1,1),(24656,37,1,1,0,1,1,1,1,1),(24656,38,1,1,0,1,1,1,1,1),(24656,39,1,1,0,1,1,1,1,1),(24656,40,1,1,0,1,1,1,1,1),(24656,41,1,1,0,1,1,1,1,1),(24656,42,1,1,0,1,1,1,1,1),(24656,43,1,1,0,1,1,1,1,1),(24656,44,1,1,0,1,1,1,1,1),(24656,45,1,1,0,1,1,1,1,1),(24656,46,1,1,0,1,1,1,1,1),(24656,47,1,1,0,1,1,1,1,1),(24656,48,1,1,0,1,1,1,1,1),(24656,49,1,1,0,1,1,1,1,1),(24656,50,1,1,0,1,1,1,1,1),(24656,51,1,1,0,1,1,1,1,1),(24656,52,1,1,0,1,1,1,1,1),(24656,53,1,1,0,1,1,1,1,1),(24656,54,1,1,0,1,1,1,1,1),(24656,55,1,1,0,1,1,1,1,1),(24656,56,1,1,0,1,1,1,1,1),(24656,57,1,1,0,1,1,1,1,1),(24656,58,1,1,0,1,1,1,1,1),(24656,59,1,1,0,1,1,1,1,1),(24656,60,1,1,0,1,1,1,1,1),(24656,61,1,1,0,1,1,1,1,1),(24656,62,1,1,0,1,1,1,1,1),(24656,63,1,1,0,1,1,1,1,1),(24656,64,1,1,0,1,1,1,1,1),(24656,65,1,1,0,1,1,1,1,1),(24656,66,1,1,0,1,1,1,1,1),(24656,67,1,1,0,1,1,1,1,1),(24656,68,1,1,0,1,1,1,1,1),(24656,69,1,1,0,1,1,1,1,1),(24656,70,8782,2878,3696,152,39,102,334,360),(24656,71,5654,4225,8300,155,112,325,135,124),(24656,72,5750,4377,8380,157,115,329,136,126),(24656,73,5945,4430,8440,159,118,332,137,129),(24656,74,6191,4584,8550,162,121,335,138,131),(24656,75,6349,4646,8612,164,123,338,139,134),(24656,76,6676,4778,8910,166,126,343,140,136),(24656,77,6884,4863,9150,169,129,347,141,138),(24656,78,7097,4949,9450,172,132,351,142,141),(24656,79,7208,5035,9800,174,135,355,143,143),(24656,80,7320,5170,10087,177,137,361,144,146),(25553,1,140,48,20,20,5,20,24,23),(25553,2,149,59,20,21,5,2,25,24),(25553,3,158,70,20,15,5,4,26,25),(25553,4,168,81,33,17,5,8,27,26),(25553,5,177,92,49,18,5,12,28,27),(25553,6,186,103,68,20,7,16,29,27),(25553,7,195,114,92,22,7,21,30,28),(25553,8,204,125,117,23,8,25,31,29),(25553,9,213,136,147,25,9,27,32,30),(25553,10,223,147,180,29,10,29,33,31),(25553,11,232,158,190,30,11,32,37,35),(25553,12,250,180,203,31,12,36,41,39),(25553,13,289,203,215,32,13,43,50,43),(25553,14,299,227,228,33,13,44,54,47),(25553,15,309,251,240,34,13,48,57,52),(25553,16,329,275,253,36,13,52,62,56),(25553,17,350,300,265,38,13,55,65,65),(25553,18,362,314,278,39,13,59,70,70),(25553,19,393,351,291,40,13,63,74,75),(25553,20,403,377,303,42,13,67,87,78),(25553,21,425,393,320,44,13,80,91,83),(25553,22,449,420,346,46,13,84,95,86),(25553,23,473,447,360,47,13,89,96,90),(25553,24,520,476,373,49,13,93,97,95),(25553,25,540,504,386,50,13,97,98,100),(25553,26,569,534,399,52,13,101,60,78),(25553,27,571,564,411,53,14,105,61,81),(25553,28,574,592,424,55,15,110,62,86),(25553,29,576,620,436,57,16,114,62,89),(25553,30,579,648,449,57,16,118,63,92),(25553,31,581,676,462,59,16,123,64,95),(25553,32,590,720,476,60,17,127,64,98),(25553,33,598,742,488,62,18,131,65,101),(25553,34,601,793,501,63,19,135,65,104),(25553,35,609,845,513,64,19,136,66,107),(25553,36,617,879,525,67,19,137,66,110),(25553,37,626,916,537,69,19,138,68,112),(25553,38,634,952,549,70,19,139,68,115),(25553,39,642,988,561,72,19,142,69,118),(25553,40,650,1026,639,74,20,147,156,142),(25553,41,668,1063,694,77,20,152,160,143),(25553,42,676,1103,756,81,20,156,163,144),(25553,43,685,1187,808,87,20,160,167,145),(25553,44,693,1214,853,91,21,164,170,146),(25553,45,701,1240,884,96,21,169,174,148),(25553,46,709,1267,910,98,22,173,177,149),(25553,47,718,1294,928,100,22,177,181,151),(25553,48,726,1320,946,102,22,181,184,152),(25553,49,734,1347,964,105,22,186,188,155),(25553,50,747,1391,983,107,22,190,194,158),(25553,51,750,1435,996,109,22,194,202,161),(25553,52,764,1481,1013,112,24,198,208,165),(25553,53,787,1527,1039,114,25,203,215,168),(25553,54,820,1573,1055,115,26,207,222,172),(25553,55,836,1620,1078,119,26,211,229,177),(25553,56,846,1666,1091,121,27,215,236,181),(25553,57,850,1714,1101,123,27,220,243,185),(25553,58,862,1763,1125,125,27,224,250,189),(25553,59,878,1824,1150,127,27,230,258,192),(25553,60,920,1898,1163,122,27,128,264,197),(25553,61,973,1925,1608,132,29,251,271,239),(25553,62,1050,1977,1663,135,31,253,278,241),(25553,63,1188,2030,1732,137,32,255,285,244),(25553,64,1292,2084,1809,139,33,259,292,247),(25553,65,1335,2137,1844,142,33,264,299,250),(25553,66,1357,2191,1872,144,33,268,306,255),(25553,67,1401,2244,1900,146,33,272,313,258),(25553,68,1429,2298,1987,148,34,276,320,260),(25553,69,1464,2351,2008,151,36,278,327,262),(25553,70,1528,2568,2227,152,39,103,334,264),(25553,71,5654,4225,8300,155,112,325,135,124),(25553,72,5750,4377,8380,157,115,329,136,126),(25553,73,5945,4430,8440,159,118,332,137,129),(25553,74,6191,4584,8550,162,121,335,138,131),(25553,75,6349,4646,8612,164,123,338,139,134),(25553,76,6676,4778,8910,166,126,343,140,136),(25553,77,6884,4863,9150,169,129,347,141,138),(25553,78,7097,4949,9450,172,132,351,142,141),(25553,79,7208,5035,9800,174,135,355,143,143),(25553,80,7320,5170,10087,177,137,361,144,146),(25566,1,14,40,0,20,20,20,24,23),(25566,2,19,49,0,21,20,20,25,24),(25566,3,24,58,0,22,20,21,26,25),(25566,4,29,67,0,23,21,21,27,26),(25566,5,34,76,0,23,21,22,28,27),(25566,6,40,85,0,24,21,22,29,27),(25566,7,46,95,0,25,21,23,30,28),(25566,8,52,105,0,26,21,23,31,29),(25566,9,58,116,0,27,21,23,32,30),(25566,10,64,126,0,27,22,24,33,31),(25566,11,75,151,0,28,22,24,37,35),(25566,12,83,177,0,29,22,26,41,39),(25566,13,91,198,0,30,22,26,44,43),(25566,14,120,234,0,31,22,28,50,47),(25566,15,129,262,0,32,23,29,54,52),(25566,16,138,290,0,34,23,30,57,56),(25566,17,147,318,0,36,23,31,61,60),(25566,18,156,346,0,37,23,32,65,65),(25566,19,165,374,0,38,23,33,70,69),(25566,20,175,402,0,40,24,35,74,74),(25566,21,184,430,0,42,24,37,87,78),(25566,22,193,458,0,44,24,39,91,82),(25566,23,202,486,0,45,24,40,95,86),(25566,24,212,514,0,46,25,42,94,90),(25566,25,224,539,0,47,25,43,94,95),(25566,26,237,568,0,48,25,43,98,100),(25566,27,249,598,0,50,25,42,102,104),(25566,28,262,632,0,51,25,44,109,110),(25566,29,274,667,0,52,26,44,114,114),(25566,30,287,702,0,54,26,45,120,118),(25566,31,299,734,0,55,26,46,124,123),(25566,32,312,772,0,57,26,47,128,128),(25566,33,324,807,0,58,27,48,132,131),(25566,34,338,842,0,60,27,50,136,135),(25566,35,360,898,0,62,27,51,139,136),(25566,36,382,954,0,65,27,52,142,137),(25566,37,404,1010,0,67,27,54,146,138),(25566,38,427,1066,0,70,28,55,149,139),(25566,39,449,1122,0,73,28,56,153,141),(25566,40,471,1178,0,75,28,58,156,142),(25566,41,493,1234,0,78,28,59,160,143),(25566,42,516,1290,0,80,29,60,163,144),(25566,43,538,1346,0,83,29,62,167,145),(25566,44,560,1402,0,86,29,63,170,147),(25566,45,582,1458,0,88,29,64,174,148),(25566,46,605,1514,0,91,30,66,177,149),(25566,47,627,1570,0,93,30,67,181,151),(25566,48,649,1627,0,96,30,68,184,152),(25566,49,672,1685,0,99,31,70,188,155),(25566,50,694,1704,0,101,31,71,194,160),(25566,51,716,1723,0,103,31,72,201,170),(25566,52,738,1743,0,105,32,74,208,180),(25566,53,761,1762,0,107,32,75,215,190),(25566,54,783,1781,0,109,32,77,222,200),(25566,55,805,1801,0,111,33,78,229,210),(25566,56,827,1820,0,113,33,80,236,220),(25566,57,850,1839,0,115,33,81,243,230),(25566,58,872,1859,0,117,34,83,250,240),(25566,59,894,1878,0,120,34,84,257,250),(25566,60,917,1898,0,122,35,86,264,260),(25566,61,939,1918,0,125,35,88,271,270),(25566,62,961,1937,0,128,36,89,278,280),(25566,63,983,1956,0,131,36,91,285,290),(25566,64,1005,1975,0,134,36,93,292,300),(25566,65,1027,1994,0,137,37,94,299,310),(25566,66,1049,2013,0,140,37,96,306,320),(25566,67,1072,2032,0,143,37,97,313,330),(25566,68,1094,2052,0,146,38,99,320,340),(25566,69,1126,2071,0,149,38,100,327,350),(25566,70,1149,2090,0,152,39,102,334,360),(25566,71,5654,4225,8300,155,112,325,135,124),(25566,72,5750,4377,8380,157,115,329,136,126),(25566,73,5945,4430,8440,159,118,332,137,129),(25566,74,6191,4584,8550,162,121,335,138,131),(25566,75,6349,4646,8612,164,123,338,139,134),(25566,76,6676,4778,8910,166,126,343,140,136),(25566,77,6884,4863,9150,169,129,347,141,138),(25566,78,7097,4949,9450,172,132,351,142,141),(25566,79,7208,5035,9800,174,135,355,143,143),(25566,80,7320,5170,10087,177,137,361,144,146); +/*!40000 ALTER TABLE `pet_levelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_name_generation` +-- + +DROP TABLE IF EXISTS `pet_name_generation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pet_name_generation` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `word` tinytext NOT NULL, + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `half` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=314 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pet_name_generation` +-- + +LOCK TABLES `pet_name_generation` WRITE; +/*!40000 ALTER TABLE `pet_name_generation` DISABLE KEYS */; +INSERT INTO `pet_name_generation` VALUES (1,'Aba',416,0),(2,'Az',416,0),(3,'Bel',416,0),(4,'Biz',416,0),(5,'Cho',416,0),(6,'Dag',416,0),(7,'Gak',416,0),(8,'Gar',416,0),(9,'Gel',416,0),(10,'Gho',416,0),(11,'Gob',416,0),(12,'Gra',416,0),(13,'Jak',416,0),(14,'Jub',416,0),(15,'Kar',416,0),(16,'Kup',416,0),(17,'Laz',416,0),(18,'Nal',416,0),(19,'Nok',416,0),(20,'Pag',416,0),(21,'Pig',416,0),(22,'Pip',416,0),(23,'Piz',416,0),(24,'Quz',416,0),(25,'Rui',416,0),(26,'Rul',416,0),(27,'Rup',416,0),(28,'Tar',416,0),(29,'Vol',416,0),(30,'Yaz',416,0),(31,'Zep',416,0),(32,'Zig',416,0),(33,'Zil',416,0),(34,'Zor',416,0),(35,'bis',416,1),(36,'fip',416,1),(37,'gup',416,1),(38,'ham',416,1),(39,'jub',416,1),(40,'kin',416,1),(41,'kol',416,1),(42,'lop',416,1),(43,'loz',416,1),(44,'mat',416,1),(45,'mir',416,1),(46,'nam',416,1),(47,'nar',416,1),(48,'nik',416,1),(49,'nip',416,1),(50,'pad',416,1),(51,'pep',416,1),(52,'pit',416,1),(53,'qua',416,1),(54,'rai',416,1),(55,'rin',416,1),(56,'rot',416,1),(57,'tai',416,1),(58,'tal',416,1),(59,'tik',416,1),(60,'tip',416,1),(61,'tog',416,1),(62,'tuk',416,1),(63,'uri',416,1),(64,'yal',416,1),(65,'yap',416,1),(66,'Bhee',417,0),(67,'Bruu',417,0),(68,'Czaa',417,0),(69,'Droo',417,0),(70,'Flaa',417,0),(71,'Fzuu',417,0),(72,'Ghaa',417,0),(73,'Gree',417,0),(74,'Gzaa',417,0),(75,'Haa',417,0),(76,'Haad',417,0),(77,'Haag',417,0),(78,'Haap',417,0),(79,'Jhaa',417,0),(80,'Jhuu',417,0),(81,'Khaa',417,0),(82,'Khii',417,0),(83,'Khuu',417,0),(84,'Kree',417,0),(85,'Luu',417,0),(86,'Maa',417,0),(87,'Nhee',417,0),(88,'Phuu',417,0),(89,'Pryy',417,0),(90,'Rhuu',417,0),(91,'Shaa',417,0),(92,'Sloo',417,0),(93,'Sruu',417,0),(94,'Thoo',417,0),(95,'Traa',417,0),(96,'Wraa',417,0),(97,'Zhaa',417,0),(98,'dhon',417,1),(99,'dhum',417,1),(100,'dhun',417,1),(101,'dom',417,1),(102,'don',417,1),(103,'drom',417,1),(104,'dym',417,1),(105,'fenn',417,1),(106,'fum',417,1),(107,'fun',417,1),(108,'ghon',417,1),(109,'ghun',417,1),(110,'grom',417,1),(111,'grym',417,1),(112,'hom',417,1),(113,'hon',417,1),(114,'hun',417,1),(115,'jhom',417,1),(116,'kun',417,1),(117,'lum',417,1),(118,'mmon',417,1),(119,'mon',417,1),(120,'myn',417,1),(121,'nam',417,1),(122,'nem',417,1),(123,'nhym',417,1),(124,'nom',417,1),(125,'num',417,1),(126,'phom',417,1),(127,'roon',417,1),(128,'rym',417,1),(129,'shon',417,1),(130,'thun',417,1),(131,'tom',417,1),(132,'zhem',417,1),(133,'zhum',417,1),(134,'zun',417,1),(135,'Bar',1860,0),(136,'Bel',1860,0),(137,'Char',1860,0),(138,'Grak\'',1860,0),(139,'Graz\'',1860,0),(140,'Grim',1860,0),(141,'Hath',1860,0),(142,'Hel',1860,0),(143,'Hok',1860,0),(144,'Huk',1860,0),(145,'Jhaz',1860,0),(146,'Jhom',1860,0),(147,'Juk\'',1860,0),(148,'Kal\'',1860,0),(149,'Klath',1860,0),(150,'Kon',1860,0),(151,'Krag',1860,0),(152,'Krak',1860,0),(153,'Mak',1860,0),(154,'Mezz',1860,0),(155,'Orm',1860,0),(156,'Phan',1860,0),(157,'Sar',1860,0),(158,'Tang',1860,0),(159,'Than',1860,0),(160,'Thog',1860,0),(161,'Thok',1860,0),(162,'Thul',1860,0),(163,'Zag\'',1860,0),(164,'Zang',1860,0),(165,'Zhar\'',1860,0),(166,'kath',1860,1),(167,'doc',1860,1),(168,'dok',1860,1),(169,'gak',1860,1),(170,'garth',1860,1),(171,'gore',1860,1),(172,'gorg',1860,1),(173,'grave',1860,1),(174,'gron',1860,1),(175,'juk',1860,1),(176,'krast',1860,1),(177,'kresh',1860,1),(178,'krit',1860,1),(179,'los',1860,1),(180,'mon',1860,1),(181,'mos',1860,1),(182,'moth',1860,1),(183,'nagma',1860,1),(184,'nak',1860,1),(185,'nar',1860,1),(186,'nos',1860,1),(187,'nuz',1860,1),(188,'phog',1860,1),(189,'rath',1860,1),(190,'tast',1860,1),(191,'taz',1860,1),(192,'thak',1860,1),(193,'thang',1860,1),(194,'thyk',1860,1),(195,'vhug',1860,1),(196,'zazt',1860,1),(197,'Ael',1863,0),(198,'Aez',1863,0),(199,'Ang',1863,0),(200,'Ban',1863,0),(201,'Bet',1863,0),(202,'Bro',1863,0),(203,'Bry',1863,0),(204,'Cat',1863,0),(205,'Dir',1863,0),(206,'Dis',1863,0),(207,'Dom',1863,0),(208,'Drus',1863,0),(209,'Fie',1863,0),(210,'Fier',1863,0),(211,'Gly',1863,0),(212,'Hel',1863,0),(213,'Hes',1863,0),(214,'Kal',1863,0),(215,'Lyn',1863,0),(216,'Mir',1863,0),(217,'Nim',1863,0),(218,'Sar',1863,0),(219,'Sel',1863,0),(220,'Vil',1863,0),(221,'Zah',1863,0),(222,'aith',1863,1),(223,'anda',1863,1),(224,'antia',1863,1),(225,'evere',1863,1),(226,'lia',1863,1),(227,'lissa',1863,1),(228,'neri',1863,1),(229,'neth',1863,1),(230,'nia',1863,1),(231,'nlissa',1863,1),(232,'nora',1863,1),(233,'nva',1863,1),(234,'nys',1863,1),(235,'ola',1863,1),(236,'ona',1863,1),(237,'ora',1863,1),(238,'rah',1863,1),(239,'riana',1863,1),(240,'riel',1863,1),(241,'rona',1863,1),(242,'tai',1863,1),(243,'tevere',1863,1),(244,'thea',1863,1),(245,'vina',1863,1),(246,'wena',1863,1),(247,'wyn',1863,1),(248,'xia',1863,1),(249,'yla',1863,1),(250,'yssa',1863,1),(251,'Flaa',17252,0),(252,'Haa',17252,0),(253,'Jhuu',17252,0),(254,'Shaa',17252,0),(255,'Thoo',17252,0),(256,'dhun',17252,1),(257,'ghun',17252,1),(258,'roon',17252,1),(259,'thun',17252,1),(260,'tom',17252,1),(261,'Stone',26125,0),(262,'Stone',26125,0),(263,'Eye',26125,0),(264,'Dirt',26125,0),(265,'Blight',26125,0),(266,'Bat',26125,0),(267,'Rat',26125,0),(268,'Corpse',26125,0),(269,'Grave',26125,0),(270,'Carrion',26125,0),(271,'Skull',26125,0),(272,'Bone',26125,0),(273,'Crypt',26125,0),(274,'Rib',26125,0),(275,'Brain',26125,0),(276,'Tomb',26125,0),(277,'Rot',26125,0),(278,'Gravel',26125,0),(279,'Plague',26125,0),(280,'Casket',26125,0),(281,'Limb',26125,0),(282,'Worm',26125,0),(283,'Earth',26125,0),(284,'Spine',26125,0),(285,'Pebble',26125,0),(286,'Root',26125,0),(287,'Marrow',26125,0),(288,'Hammer',26125,0),(289,'ravager',26125,1),(290,'muncher',26125,1),(291,'cruncher',26125,1),(292,'masher',26125,1),(293,'leaper',26125,1),(294,'grinder',26125,1),(295,'stalker',26125,1),(296,'gobbler',26125,1),(297,'feeder',26125,1),(298,'basher',26125,1),(299,'chewer',26125,1),(300,'ripper',26125,1),(301,'slicer',26125,1),(302,'gnaw',26125,1),(303,'flayer',26125,1),(304,'rumbler',26125,1),(305,'chomp',26125,1),(306,'breaker',26125,1),(307,'keeper',26125,1),(308,'rawler',26125,1),(309,'stealer',26125,1),(310,'thief',26125,1),(311,'catcher',26125,1),(312,'drinker',26125,1),(313,'slicer',26125,1); +/*!40000 ALTER TABLE `pet_name_generation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pickpocketing_loot_template` +-- + +DROP TABLE IF EXISTS `pickpocketing_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pickpocketing_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pickpocketing_loot_template` +-- + +LOCK TABLES `pickpocketing_loot_template` WRITE; +/*!40000 ALTER TABLE `pickpocketing_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `pickpocketing_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `player_classlevelstats` +-- + +DROP TABLE IF EXISTS `player_classlevelstats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `player_classlevelstats` ( + `class` tinyint(3) unsigned NOT NULL, + `level` tinyint(3) unsigned NOT NULL, + `basehp` smallint(5) unsigned NOT NULL, + `basemana` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`class`,`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `player_classlevelstats` +-- + +LOCK TABLES `player_classlevelstats` WRITE; +/*!40000 ALTER TABLE `player_classlevelstats` DISABLE KEYS */; +INSERT INTO `player_classlevelstats` VALUES (1,1,20,0),(1,2,29,0),(1,3,38,0),(1,4,47,0),(1,5,56,0),(1,6,65,0),(1,7,74,0),(1,8,83,0),(1,9,92,0),(1,10,101,0),(1,11,100,0),(1,12,109,0),(1,13,118,0),(1,14,128,0),(1,15,139,0),(1,16,151,0),(1,17,154,0),(1,18,168,0),(1,19,183,0),(1,20,199,0),(1,21,206,0),(1,22,224,0),(1,23,243,0),(1,24,253,0),(1,25,274,0),(1,26,296,0),(1,27,309,0),(1,28,333,0),(1,29,348,0),(1,30,374,0),(1,31,401,0),(1,32,419,0),(1,33,448,0),(1,34,468,0),(1,35,499,0),(1,36,521,0),(1,37,545,0),(1,38,581,0),(1,39,609,0),(1,40,649,0),(1,41,681,0),(1,42,715,0),(1,43,761,0),(1,44,799,0),(1,45,839,0),(1,46,881,0),(1,47,935,0),(1,48,981,0),(1,49,1029,0),(1,50,1079,0),(1,51,1131,0),(1,52,1185,0),(1,53,1241,0),(1,54,1299,0),(1,55,1359,0),(1,56,1421,0),(1,57,1485,0),(1,58,1551,0),(1,59,1619,0),(1,60,1689,0),(1,61,1902,0),(1,62,2129,0),(1,63,2357,0),(1,64,2612,0),(1,65,2883,0),(1,66,3169,0),(1,67,3455,0),(1,68,3774,0),(1,69,4109,0),(1,70,4444,0),(2,1,28,60),(2,2,36,78),(2,3,44,98),(2,4,52,104),(2,5,60,111),(2,6,68,134),(2,7,76,143),(2,8,84,153),(2,9,92,179),(2,10,100,192),(2,11,108,205),(2,12,116,219),(2,13,124,249),(2,14,132,265),(2,15,131,282),(2,16,141,315),(2,17,152,334),(2,18,164,354),(2,19,177,390),(2,20,191,412),(2,21,206,435),(2,22,222,459),(2,23,239,499),(2,24,247,525),(2,25,266,552),(2,26,286,579),(2,27,307,621),(2,28,329,648),(2,29,342,675),(2,30,366,702),(2,31,391,729),(2,32,407,756),(2,33,434,798),(2,34,462,825),(2,35,481,852),(2,36,511,879),(2,37,542,906),(2,38,564,933),(2,39,597,960),(2,40,621,987),(2,41,656,1014),(2,42,682,1041),(2,43,719,1068),(2,44,747,1110),(2,45,786,1137),(2,46,816,1164),(2,47,857,1176),(2,48,889,1203),(2,49,922,1230),(2,50,966,1257),(2,51,1001,1284),(2,52,1037,1311),(2,53,1084,1338),(2,54,1122,1365),(2,55,1161,1392),(2,56,1201,1419),(2,57,1252,1446),(2,58,1294,1458),(2,59,1337,1485),(2,60,1381,1512),(2,61,1540,1656),(2,62,1708,1800),(2,63,1884,1944),(2,64,2068,2088),(2,65,2262,2232),(2,66,2466,2377),(2,67,2679,2521),(2,68,2901,2665),(2,69,3134,2809),(2,70,3377,2953),(3,1,46,65),(3,2,53,70),(3,3,60,76),(3,4,67,98),(3,5,74,106),(3,6,81,130),(3,7,88,140),(3,8,95,166),(3,9,102,193),(3,10,109,206),(3,11,116,235),(3,12,123,250),(3,13,130,266),(3,14,138,298),(3,15,147,316),(3,16,157,350),(3,17,168,370),(3,18,180,391),(3,19,193,428),(3,20,207,451),(3,21,222,475),(3,22,238,515),(3,23,255,541),(3,24,273,568),(3,25,292,611),(3,26,312,640),(3,27,333,670),(3,28,355,715),(3,29,378,745),(3,30,402,775),(3,31,417,805),(3,32,443,850),(3,33,470,880),(3,34,498,910),(3,35,527,940),(3,36,547,970),(3,37,578,1015),(3,38,610,1045),(3,39,643,1075),(3,40,667,1105),(3,41,702,1135),(3,42,738,1180),(3,43,775,1210),(3,44,803,1240),(3,45,842,1270),(3,46,872,1300),(3,47,913,1330),(3,48,955,1360),(3,49,994,1390),(3,50,1047,1420),(3,51,1067,1450),(3,52,1113,1480),(3,53,1150,1510),(3,54,1198,1540),(3,55,1237,1570),(3,56,1287,1600),(3,57,1328,1630),(3,58,1370,1660),(3,59,1423,1690),(3,60,1467,1720),(3,61,1633,1886),(3,62,1819,2053),(3,63,2003,2219),(3,64,2195,2385),(3,65,2397,2552),(3,66,2623,2718),(3,67,2844,2884),(3,68,3075,3050),(3,69,3316,3217),(3,70,3568,3383),(4,1,25,0),(4,2,32,0),(4,3,49,0),(4,4,56,0),(4,5,63,0),(4,6,70,0),(4,7,87,0),(4,8,94,0),(4,9,101,0),(4,10,118,0),(4,11,125,0),(4,12,142,0),(4,13,149,0),(4,14,156,0),(4,15,173,0),(4,16,181,0),(4,17,190,0),(4,18,200,0),(4,19,221,0),(4,20,233,0),(4,21,246,0),(4,22,260,0),(4,23,275,0),(4,24,301,0),(4,25,318,0),(4,26,336,0),(4,27,355,0),(4,28,375,0),(4,29,396,0),(4,30,428,0),(4,31,451,0),(4,32,475,0),(4,33,500,0),(4,34,526,0),(4,35,553,0),(4,36,581,0),(4,37,610,0),(4,38,640,0),(4,39,671,0),(4,40,703,0),(4,41,736,0),(4,42,770,0),(4,43,805,0),(4,44,841,0),(4,45,878,0),(4,46,916,0),(4,47,955,0),(4,48,995,0),(4,49,1026,0),(4,50,1068,0),(4,51,1111,0),(4,52,1155,0),(4,53,1200,0),(4,54,1246,0),(4,55,1283,0),(4,56,1331,0),(4,57,1380,0),(4,58,1430,0),(4,59,1471,0),(4,60,1523,0),(4,61,1702,0),(4,62,1879,0),(4,63,2077,0),(4,64,2285,0),(4,65,2489,0),(4,66,2717,0),(4,67,2941,0),(4,68,3190,0),(4,69,3450,0),(4,70,3704,0),(5,1,52,73),(5,2,57,76),(5,3,72,95),(5,4,77,114),(5,5,92,133),(5,6,97,152),(5,7,112,171),(5,8,117,190),(5,9,132,209),(5,10,137,212),(5,11,142,215),(5,12,157,234),(5,13,172,254),(5,14,177,260),(5,15,192,282),(5,16,197,305),(5,17,212,329),(5,18,227,339),(5,19,232,365),(5,20,247,377),(5,21,252,405),(5,22,268,434),(5,23,275,449),(5,24,293,480),(5,25,302,497),(5,26,322,530),(5,27,343,549),(5,28,355,584),(5,29,378,605),(5,30,392,627),(5,31,417,665),(5,32,433,689),(5,33,460,728),(5,34,478,752),(5,35,507,776),(5,36,527,800),(5,37,548,839),(5,38,580,863),(5,39,603,887),(5,40,637,911),(5,41,662,950),(5,42,698,974),(5,43,725,998),(5,44,763,1022),(5,45,792,1046),(5,46,822,1070),(5,47,863,1094),(5,48,895,1118),(5,49,928,1142),(5,50,972,1166),(5,51,1007,1190),(5,52,1053,1214),(5,53,1090,1238),(5,54,1128,1262),(5,55,1177,1271),(5,56,1217,1295),(5,57,1258,1319),(5,58,1300,1343),(5,59,1353,1352),(5,60,1397,1376),(5,61,1557,1500),(5,62,1738,1625),(5,63,1916,1749),(5,64,2101,1873),(5,65,2295,1998),(5,66,2495,2122),(5,67,2719,2247),(5,68,2936,2371),(5,69,3160,2495),(5,70,3391,2620),(7,80,6939,4396),(7,79,6457,4252),(7,78,6009,4108),(7,77,5592,3965),(7,76,5203,3821),(7,75,4843,3677),(7,74,4507,3533),(7,73,4194,3389),(7,72,3903,3246),(7,71,3633,3102),(7,70,3380,2958),(7,69,3136,2814),(7,68,2903,2670),(7,67,2679,2527),(7,66,2465,2383),(7,65,2262,2239),(7,64,2067,2095),(7,63,1883,1951),(7,62,1694,1808),(7,61,1528,1664),(7,60,1423,1520),(7,59,1326,1501),(7,58,1283,1467),(7,57,1231,1448),(7,56,1190,1414),(7,55,1150,1395),(7,54,1101,1376),(7,53,1064,1342),(7,52,1027,1323),(7,51,981,1289),(7,50,947,1255),(7,49,903,1236),(7,48,871,1202),(7,47,829,1183),(7,46,799,1149),(7,45,760,1115),(7,44,732,1096),(7,43,694,1062),(7,42,669,1028),(7,41,633,1009),(7,40,610,975),(7,39,577,941),(7,38,545,922),(7,37,524,888),(7,36,494,854),(7,35,465,820),(7,34,448,786),(7,33,422,767),(7,32,396,733),(7,31,371,699),(7,30,358,665),(7,29,336,631),(7,28,315,598),(7,27,294,566),(7,26,275,535),(7,25,257,505),(7,24,250,476),(7,23,234,448),(7,22,219,421),(7,21,205,395),(7,20,193,370),(7,19,181,346),(7,18,170,323),(7,17,161,301),(7,16,152,280),(7,15,144,260),(7,14,137,241),(7,13,129,223),(7,12,122,206),(7,11,114,190),(8,1,32,100),(8,2,47,110),(8,3,52,106),(8,4,67,118),(8,5,82,131),(8,6,97,130),(8,7,102,145),(8,8,117,146),(8,9,132,163),(8,10,137,196),(8,11,152,215),(8,12,167,220),(8,13,172,241),(8,14,187,263),(8,15,202,271),(8,16,207,295),(8,17,222,305),(8,18,237,331),(8,19,242,343),(8,20,257,371),(8,21,272,385),(8,22,277,415),(8,23,292,431),(8,24,298,463),(8,25,315,481),(8,26,333,515),(8,27,342,535),(8,28,362,556),(8,29,373,592),(8,30,395,613),(8,31,418,634),(8,32,432,670),(8,33,457,691),(8,34,473,712),(8,35,500,733),(8,36,518,754),(8,37,547,790),(8,38,577,811),(8,39,598,832),(8,40,630,853),(8,41,653,874),(8,42,687,895),(8,43,712,916),(8,44,748,937),(8,45,775,958),(8,46,813,979),(8,47,842,1000),(8,48,882,1021),(8,49,913,1042),(8,50,955,1048),(8,51,988,1069),(8,52,1032,1090),(8,53,1067,1111),(8,54,1103,1117),(8,55,1150,1138),(8,56,1188,1159),(8,57,1237,1165),(8,58,1277,1186),(8,59,1328,1192),(8,60,1370,1213),(8,61,1526,1316),(8,62,1702,1419),(8,63,1875,1521),(8,64,2070,1624),(8,65,2261,1727),(8,66,2461,1830),(8,67,2686,1932),(8,68,2906,2035),(8,69,3136,2138),(8,70,3393,2241),(9,1,23,90),(9,2,28,98),(9,3,43,107),(9,4,48,102),(9,5,63,113),(9,6,68,126),(9,7,83,144),(9,8,88,162),(9,9,93,180),(9,10,108,198),(9,11,123,200),(9,12,128,218),(9,13,143,237),(9,14,148,257),(9,15,153,278),(9,16,168,300),(9,17,173,308),(9,18,189,332),(9,19,196,357),(9,20,204,383),(9,21,223,395),(9,22,233,423),(9,23,244,452),(9,24,266,467),(9,25,279,498),(9,26,293,530),(9,27,318,548),(9,28,334,582),(9,29,351,602),(9,30,379,638),(9,31,398,674),(9,32,418,695),(9,33,439,731),(9,34,471,752),(9,35,494,788),(9,36,518,809),(9,37,543,830),(9,38,569,866),(9,39,606,887),(9,40,634,923),(9,41,663,944),(9,42,693,965),(9,43,724,1001),(9,44,756,1022),(9,45,799,1043),(9,46,832,1064),(9,47,868,1100),(9,48,904,1121),(9,49,941,1142),(9,50,979,1163),(9,51,1018,1184),(9,52,1058,1205),(9,53,1099,1226),(9,54,1141,1247),(9,55,1184,1268),(9,56,1228,1289),(9,57,1273,1310),(9,58,1319,1331),(9,59,1366,1352),(9,60,1414,1373),(9,61,1580,1497),(9,62,1755,1621),(9,63,1939,1745),(9,64,2133,1870),(9,65,2323,1994),(9,66,2535,2118),(9,67,2758,2242),(9,68,2991,2366),(9,69,3235,2490),(9,70,3490,2615),(11,1,44,60),(11,2,51,66),(11,3,58,73),(11,4,75,81),(11,5,82,90),(11,6,89,100),(11,7,106,111),(11,8,113,123),(11,9,120,136),(11,10,137,150),(11,11,144,165),(11,12,151,182),(11,13,168,200),(11,14,175,219),(11,15,182,239),(11,16,199,260),(11,17,206,282),(11,18,214,305),(11,19,233,329),(11,20,243,354),(11,21,254,380),(11,22,266,392),(11,23,289,420),(11,24,303,449),(11,25,318,479),(11,26,334,509),(11,27,361,524),(11,28,379,554),(11,29,398,584),(11,30,418,614),(11,31,439,629),(11,32,461,659),(11,33,494,689),(11,34,518,704),(11,35,543,734),(11,36,569,749),(11,37,596,779),(11,38,624,809),(11,39,653,824),(11,40,683,854),(11,41,714,869),(11,42,746,899),(11,43,779,914),(11,44,823,944),(11,45,858,959),(11,46,894,989),(11,47,921,1004),(11,48,959,1019),(11,49,998,1049),(11,50,1038,1064),(11,51,1079,1079),(11,52,1121,1109),(11,53,1164,1124),(11,54,1208,1139),(11,55,1253,1154),(11,56,1299,1169),(11,57,1346,1199),(11,58,1384,1214),(11,59,1433,1229),(11,60,1483,1244),(11,61,1657,1357),(11,62,1840,1469),(11,63,2020,1582),(11,64,2222,1694),(11,65,2433,1807),(11,66,2640,1919),(11,67,2872,2032),(11,68,3114,2145),(11,69,3351,2257),(11,70,3614,2370),(1,71,4720,0),(1,72,5013,0),(1,73,5325,0),(1,74,5656,0),(1,75,6008,0),(1,76,6381,0),(1,77,6778,0),(1,78,7198,0),(1,79,7646,0),(1,80,8121,0),(2,71,3629,3097),(2,72,3900,3241),(2,73,4191,3385),(2,74,4503,3529),(2,75,4839,3673),(2,76,5200,3817),(2,77,5588,3962),(2,78,6005,4106),(2,79,6453,4250),(2,80,6934,4394),(3,71,3834,3549),(3,72,4120,3716),(3,73,4427,3882),(3,74,4757,4048),(3,75,5112,4215),(3,76,5493,4381),(3,77,5903,4547),(3,78,6343,4713),(3,79,6816,4880),(3,80,7324,5046),(4,71,3980,0),(4,72,4277,0),(4,73,4596,0),(4,74,4939,0),(4,75,5307,0),(4,76,5703,0),(4,77,6128,0),(4,78,6585,0),(4,79,7076,0),(4,80,7604,0),(5,71,3644,2744),(5,72,3916,2868),(5,73,4208,2993),(5,74,4522,3117),(5,75,4859,3242),(5,76,5221,3366),(5,77,5610,3490),(5,78,6028,3615),(5,79,6477,3739),(5,80,6960,3863),(6,1,22,0),(6,2,27,0),(6,3,32,0),(6,4,37,0),(6,5,42,0),(6,6,47,0),(6,7,52,0),(6,8,58,0),(6,9,64,0),(6,10,70,0),(6,11,77,0),(6,12,84,0),(6,13,92,0),(6,14,100,0),(6,15,117,0),(6,16,127,0),(6,17,138,0),(6,18,150,0),(6,19,163,0),(6,20,177,0),(6,21,192,0),(6,22,208,0),(6,23,225,0),(6,24,239,0),(6,25,258,0),(6,26,278,0),(6,27,299,0),(6,28,321,0),(6,29,344,0),(6,30,368,0),(6,31,393,0),(6,32,419,0),(6,33,446,0),(6,34,474,0),(6,35,503,0),(6,36,533,0),(6,37,564,0),(6,38,596,0),(6,39,629,0),(6,40,698,0),(6,41,698,0),(6,42,734,0),(6,43,771,0),(6,44,809,0),(6,45,849,0),(6,46,891,0),(6,47,935,0),(6,48,981,0),(6,49,1029,0),(6,50,1079,0),(6,51,1131,0),(6,52,1185,0),(6,53,1241,0),(6,54,1299,0),(6,55,1359,0),(6,56,1421,0),(6,57,1485,0),(6,58,1551,0),(6,59,1619,0),(6,60,1689,0),(6,61,1902,0),(6,62,2129,0),(6,63,2357,0),(6,64,2612,0),(6,65,2883,0),(6,66,3169,0),(6,67,3455,0),(6,68,3774,0),(6,69,4109,0),(6,70,4444,0),(6,71,4720,0),(6,72,5013,0),(6,73,5325,0),(6,74,5656,0),(6,75,6008,0),(6,76,6381,0),(6,77,6778,0),(6,78,7199,0),(6,79,7646,0),(6,80,8121,0),(7,10,107,175),(7,9,100,161),(7,8,92,148),(7,7,85,136),(7,6,77,125),(7,5,70,115),(7,4,62,106),(7,3,55,98),(7,2,47,91),(7,1,40,85),(8,71,3646,2343),(8,72,3918,2446),(8,73,4210,2549),(8,74,4524,2652),(8,75,4861,2754),(8,76,5223,2857),(8,77,5612,2960),(8,78,6030,3063),(8,79,6480,3165),(8,80,6963,3268),(9,71,3750,2739),(9,72,4025,2863),(9,73,4330,2987),(9,74,4646,3111),(9,75,4997,3235),(9,76,5373,3360),(9,77,5774,3483),(9,78,6207,3608),(9,79,6667,3732),(9,80,7136,3856),(11,71,3883,2482),(11,72,4172,2595),(11,73,4483,2708),(11,74,4817,2820),(11,75,5176,2933),(11,76,5562,3045),(11,77,5977,3158),(11,78,6423,3270),(11,79,6902,3383),(11,80,7417,3496); +/*!40000 ALTER TABLE `player_classlevelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `player_levelstats` +-- + +DROP TABLE IF EXISTS `player_levelstats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `player_levelstats` ( + `race` tinyint(3) unsigned NOT NULL, + `class` tinyint(3) unsigned NOT NULL, + `level` tinyint(3) unsigned NOT NULL, + `str` tinyint(3) unsigned NOT NULL, + `agi` tinyint(3) unsigned NOT NULL, + `sta` tinyint(3) unsigned NOT NULL, + `inte` tinyint(3) unsigned NOT NULL, + `spi` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`race`,`class`,`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `player_levelstats` +-- + +LOCK TABLES `player_levelstats` WRITE; +/*!40000 ALTER TABLE `player_levelstats` DISABLE KEYS */; +INSERT INTO `player_levelstats` VALUES (1,1,1,23,20,22,20,20),(1,1,2,24,21,23,20,20),(1,1,3,26,22,24,20,21),(1,1,4,27,22,26,20,21),(1,1,5,28,23,27,20,21),(1,1,6,30,24,28,20,21),(1,1,7,31,25,29,21,22),(1,1,8,32,26,30,21,22),(1,1,9,34,26,32,21,22),(1,1,10,35,27,33,21,23),(1,1,11,36,28,34,21,23),(1,1,12,38,29,35,21,23),(1,1,13,39,30,37,21,24),(1,1,14,41,31,38,21,24),(1,1,15,42,32,39,21,24),(1,1,16,44,33,41,21,25),(1,1,17,45,34,42,22,25),(1,1,18,47,34,43,22,25),(1,1,19,48,35,45,22,26),(1,1,20,50,36,46,22,26),(1,1,21,51,37,48,22,26),(1,1,22,53,38,49,22,27),(1,1,23,54,39,51,22,27),(1,1,24,56,40,52,23,28),(1,1,25,58,41,53,23,28),(1,1,26,59,42,55,23,28),(1,1,27,61,43,56,23,29),(1,1,28,63,44,58,23,29),(1,1,29,64,45,59,23,30),(1,1,30,66,46,61,24,30),(1,1,31,68,47,62,24,30),(1,1,32,69,48,64,24,31),(1,1,33,71,50,66,24,31),(1,1,34,73,51,67,24,32),(1,1,35,74,52,69,24,32),(1,1,36,76,53,70,25,33),(1,1,37,78,54,72,25,33),(1,1,38,80,55,74,25,34),(1,1,39,82,56,75,25,34),(1,1,40,83,57,77,25,35),(1,1,41,85,58,79,26,35),(1,1,42,87,60,80,26,35),(1,1,43,89,61,82,26,36),(1,1,44,91,62,84,26,36),(1,1,45,93,63,85,26,37),(1,1,46,95,64,87,27,37),(1,1,47,97,66,89,27,38),(1,1,48,99,67,91,27,38),(1,1,49,101,68,93,27,39),(1,1,50,103,69,94,28,40),(1,1,51,105,71,96,28,40),(1,1,52,107,72,98,28,41),(1,1,53,109,73,100,28,41),(1,1,54,111,74,102,29,42),(1,1,55,113,76,103,29,42),(1,1,56,115,77,105,29,43),(1,1,57,117,78,107,29,43),(1,1,58,119,79,109,30,44),(1,1,59,121,81,111,30,44),(1,1,60,123,82,113,30,45),(1,1,61,125,83,115,30,46),(1,1,62,127,85,117,31,46),(1,1,63,129,86,119,31,47),(1,1,64,132,88,121,31,47),(1,1,65,134,89,123,32,48),(1,1,66,136,90,125,32,49),(1,1,67,138,92,127,32,49),(1,1,68,140,93,129,32,50),(1,1,69,143,95,131,33,50),(1,1,70,145,96,133,33,51),(1,1,71,148,97,140,33,53),(1,1,72,156,99,143,33,54),(1,1,73,162,101,148,33,55),(1,1,74,162,102,148,34,55),(1,1,75,165,104,150,34,56),(1,1,76,171,106,156,34,57),(1,1,77,171,108,157,35,58),(1,1,78,174,109,159,35,58),(1,1,79,181,111,165,35,59),(1,1,80,184,113,168,36,60),(1,2,1,22,20,22,20,21),(1,2,2,23,21,23,21,22),(1,2,3,24,21,24,21,22),(1,2,4,25,22,25,22,23),(1,2,5,26,22,26,23,24),(1,2,6,28,23,27,23,25),(1,2,7,29,24,28,24,25),(1,2,8,30,24,29,25,26),(1,2,9,31,25,30,25,27),(1,2,10,32,25,32,26,27),(1,2,11,33,26,33,27,28),(1,2,12,35,27,34,27,29),(1,2,13,36,27,35,28,30),(1,2,14,37,28,36,29,31),(1,2,15,38,29,37,30,31),(1,2,16,40,29,38,30,32),(1,2,17,41,30,40,31,33),(1,2,18,42,31,41,32,34),(1,2,19,43,31,42,33,35),(1,2,20,45,32,43,33,35),(1,2,21,46,33,45,34,36),(1,2,22,47,33,46,35,37),(1,2,23,49,34,47,36,38),(1,2,24,50,35,48,37,39),(1,2,25,51,36,50,37,40),(1,2,26,53,36,51,38,41),(1,2,27,54,37,52,39,42),(1,2,28,56,38,54,40,43),(1,2,29,57,39,55,41,43),(1,2,30,58,39,56,42,44),(1,2,31,60,40,58,43,45),(1,2,32,61,41,59,43,46),(1,2,33,63,42,60,44,47),(1,2,34,64,43,62,45,48),(1,2,35,66,44,63,46,49),(1,2,36,67,44,65,47,50),(1,2,37,69,45,66,48,51),(1,2,38,70,46,67,49,52),(1,2,39,72,47,69,50,53),(1,2,40,73,48,70,51,54),(1,2,41,75,49,72,52,55),(1,2,42,77,49,73,53,56),(1,2,43,78,50,75,54,57),(1,2,44,80,51,76,55,58),(1,2,45,81,52,78,56,59),(1,2,46,83,53,79,57,61),(1,2,47,85,54,81,58,62),(1,2,48,86,55,83,59,63),(1,2,49,88,56,84,60,64),(1,2,50,90,57,86,61,65),(1,2,51,91,58,87,62,66),(1,2,52,93,59,89,63,67),(1,2,53,95,60,91,64,68),(1,2,54,97,61,92,65,69),(1,2,55,98,61,94,66,71),(1,2,56,100,62,95,67,72),(1,2,57,102,63,97,68,73),(1,2,58,104,64,99,69,74),(1,2,59,105,65,101,70,75),(1,2,60,107,66,102,71,77),(1,2,61,109,67,104,73,78),(1,2,62,111,69,106,74,79),(1,2,63,113,70,107,75,80),(1,2,64,115,71,109,76,81),(1,2,65,116,72,111,77,83),(1,2,66,118,73,113,78,84),(1,2,67,120,74,115,79,85),(1,2,68,122,75,116,81,86),(1,2,69,124,76,118,82,88),(1,2,70,126,77,120,83,89),(1,2,71,148,78,122,84,92),(1,2,72,150,79,125,86,94),(1,2,73,152,80,127,87,96),(1,2,74,156,82,129,89,97),(1,2,75,158,83,131,90,99),(1,2,76,162,84,134,92,100),(1,2,77,164,86,136,93,103),(1,2,78,167,87,138,95,105),(1,2,79,170,88,153,96,106),(1,2,80,173,90,160,98,108),(1,4,1,21,23,21,20,20),(1,4,2,22,24,22,20,20),(1,4,3,23,26,22,20,21),(1,4,4,23,27,23,20,21),(1,4,5,24,29,24,21,21),(1,4,6,25,30,25,21,22),(1,4,7,26,32,25,21,22),(1,4,8,26,33,26,21,23),(1,4,9,27,35,27,21,23),(1,4,10,28,36,27,21,23),(1,4,11,29,38,28,22,24),(1,4,12,30,39,29,22,24),(1,4,13,31,41,30,22,25),(1,4,14,31,43,31,22,25),(1,4,15,32,44,31,22,25),(1,4,16,33,46,32,23,26),(1,4,17,34,48,33,23,26),(1,4,18,35,49,34,23,27),(1,4,19,36,51,35,23,27),(1,4,20,37,53,35,23,28),(1,4,21,38,54,36,24,28),(1,4,22,39,56,37,24,29),(1,4,23,40,58,38,24,29),(1,4,24,41,60,39,24,30),(1,4,25,42,61,40,25,30),(1,4,26,43,63,41,25,31),(1,4,27,44,65,42,25,31),(1,4,28,45,67,43,25,32),(1,4,29,46,69,43,25,32),(1,4,30,47,71,44,26,33),(1,4,31,48,72,45,26,33),(1,4,32,49,74,46,26,34),(1,4,33,50,76,47,27,34),(1,4,34,51,78,48,27,35),(1,4,35,52,80,49,27,35),(1,4,36,53,82,50,27,36),(1,4,37,54,84,51,28,36),(1,4,38,55,86,52,28,37),(1,4,39,56,88,53,28,38),(1,4,40,57,90,54,28,38),(1,4,41,58,92,55,29,39),(1,4,42,60,94,56,29,39),(1,4,43,61,96,57,29,40),(1,4,44,62,98,58,30,40),(1,4,45,63,100,59,30,41),(1,4,46,64,103,61,30,42),(1,4,47,65,105,62,31,42),(1,4,48,66,107,63,31,43),(1,4,49,68,109,64,31,44),(1,4,50,69,111,65,32,44),(1,4,51,70,113,66,32,45),(1,4,52,71,116,67,32,45),(1,4,53,73,118,68,33,46),(1,4,54,74,120,69,33,47),(1,4,55,75,122,71,33,47),(1,4,56,76,125,72,34,48),(1,4,57,78,127,73,34,49),(1,4,58,79,129,74,34,49),(1,4,59,80,131,75,35,50),(1,4,60,81,134,77,35,51),(1,4,61,83,136,78,35,51),(1,4,62,84,138,79,36,52),(1,4,63,85,141,80,36,53),(1,4,64,87,143,81,37,54),(1,4,65,88,146,83,37,54),(1,4,66,89,148,84,37,55),(1,4,67,91,151,85,38,56),(1,4,68,92,153,86,38,57),(1,4,69,94,156,88,39,57),(1,4,70,95,158,89,39,58),(1,4,71,97,161,90,39,60),(1,4,72,99,164,92,40,60),(1,4,73,100,167,94,40,61),(1,4,74,102,170,95,41,62),(1,4,75,104,173,97,41,63),(1,4,76,105,176,98,41,64),(1,4,77,107,179,100,42,65),(1,4,78,109,183,106,42,66),(1,4,79,111,186,107,43,67),(1,4,80,113,189,109,43,69),(1,5,1,20,20,20,22,23),(1,5,2,20,20,20,23,24),(1,5,3,20,20,21,25,26),(1,5,4,20,21,21,26,27),(1,5,5,21,21,21,27,28),(1,5,6,21,21,22,29,30),(1,5,7,21,21,22,30,31),(1,5,8,21,22,23,31,33),(1,5,9,21,22,23,33,34),(1,5,10,21,22,23,34,36),(1,5,11,22,22,24,36,37),(1,5,12,22,23,24,37,39),(1,5,13,22,23,25,38,40),(1,5,14,22,23,25,40,42),(1,5,15,22,23,25,41,43),(1,5,16,23,24,26,43,45),(1,5,17,23,24,26,44,46),(1,5,18,23,24,27,46,48),(1,5,19,23,24,27,47,49),(1,5,20,23,25,28,49,51),(1,5,21,24,25,28,51,53),(1,5,22,24,25,29,52,54),(1,5,23,24,26,29,54,56),(1,5,24,24,26,30,55,58),(1,5,25,25,26,30,57,59),(1,5,26,25,27,31,59,61),(1,5,27,25,27,31,60,63),(1,5,28,25,27,32,62,65),(1,5,29,25,28,32,64,66),(1,5,30,26,28,33,65,68),(1,5,31,26,28,33,67,70),(1,5,32,26,29,34,69,72),(1,5,33,27,29,34,70,73),(1,5,34,27,29,35,72,75),(1,5,35,27,30,35,74,77),(1,5,36,27,30,36,76,79),(1,5,37,28,30,36,78,81),(1,5,38,28,31,37,79,83),(1,5,39,28,31,38,81,85),(1,5,40,28,31,38,83,87),(1,5,41,29,32,39,85,88),(1,5,42,29,32,39,87,90),(1,5,43,29,33,40,89,92),(1,5,44,30,33,40,91,94),(1,5,45,30,33,41,92,96),(1,5,46,30,34,42,94,98),(1,5,47,31,34,42,96,100),(1,5,48,31,35,43,98,102),(1,5,49,31,35,44,100,104),(1,5,50,32,36,44,102,106),(1,5,51,32,36,45,104,109),(1,5,52,32,36,45,106,111),(1,5,53,33,37,46,108,113),(1,5,54,33,37,47,110,115),(1,5,55,33,38,47,112,117),(1,5,56,34,38,48,114,119),(1,5,57,34,39,49,117,121),(1,5,58,34,39,49,119,124),(1,5,59,35,40,50,121,126),(1,5,60,35,40,51,123,128),(1,5,61,35,41,51,125,130),(1,5,62,36,41,52,127,132),(1,5,63,36,41,53,129,135),(1,5,64,37,42,54,132,137),(1,5,65,37,42,54,134,139),(1,5,66,37,43,55,136,142),(1,5,67,38,43,56,138,144),(1,5,68,38,44,57,140,146),(1,5,69,39,44,57,143,149),(1,5,70,39,45,58,145,151),(1,5,71,39,46,59,148,158),(1,5,72,40,46,59,151,161),(1,5,73,40,47,60,154,164),(1,5,74,41,47,61,156,167),(1,5,75,41,48,62,159,170),(1,5,76,41,49,63,162,174),(1,5,77,42,49,64,165,177),(1,5,78,42,50,65,168,180),(1,5,79,43,50,66,171,183),(1,5,80,43,51,67,174,186),(1,6,1,23,20,22,20,20),(1,6,2,24,21,23,20,20),(1,6,3,26,22,24,20,21),(1,6,4,27,22,26,20,21),(1,6,5,28,23,27,20,21),(1,6,6,30,24,28,20,21),(1,6,7,31,25,29,21,22),(1,6,8,32,26,30,21,22),(1,6,9,34,26,32,21,22),(1,6,10,35,27,33,21,23),(1,6,11,36,28,34,21,23),(1,6,12,38,29,35,21,23),(1,6,13,39,30,37,21,24),(1,6,14,41,31,38,21,24),(1,6,15,42,32,39,21,24),(1,6,16,44,33,41,21,25),(1,6,17,45,34,42,22,25),(1,6,18,47,34,43,22,25),(1,6,19,48,35,45,22,26),(1,6,20,50,36,46,22,26),(1,6,21,51,37,48,22,26),(1,6,22,53,38,49,22,27),(1,6,23,54,39,51,22,27),(1,6,24,56,40,52,23,28),(1,6,25,58,41,53,23,28),(1,6,26,59,42,55,23,28),(1,6,27,61,43,56,23,29),(1,6,28,63,44,58,23,29),(1,6,29,64,45,59,23,30),(1,6,30,66,46,61,24,30),(1,6,31,68,47,62,24,30),(1,6,32,69,48,64,24,31),(1,6,33,71,50,66,24,31),(1,6,34,73,51,67,24,32),(1,6,35,74,52,69,24,32),(1,6,36,76,53,70,25,33),(1,6,37,78,54,72,25,33),(1,6,38,80,55,74,25,34),(1,6,39,82,56,75,25,34),(1,6,40,83,57,77,25,35),(1,6,41,85,58,79,26,35),(1,6,42,87,60,80,26,35),(1,6,43,89,61,82,26,36),(1,6,44,91,62,84,26,36),(1,6,45,93,63,85,26,37),(1,6,46,95,64,87,27,37),(1,6,47,97,66,89,27,38),(1,6,48,99,67,91,27,38),(1,6,49,101,68,93,27,39),(1,6,50,103,69,94,28,40),(1,6,51,105,71,96,28,40),(1,6,52,106,72,97,28,41),(1,6,53,107,72,98,28,41),(1,6,54,107,73,98,29,42),(1,6,55,108,73,99,29,43),(1,6,56,111,75,102,29,44),(1,6,57,113,76,104,29,44),(1,6,58,118,77,106,30,45),(1,6,59,118,79,108,30,45),(1,6,60,123,80,110,30,46),(1,6,61,125,81,112,30,47),(1,6,62,128,83,114,30,47),(1,6,63,130,84,117,31,48),(1,6,64,130,86,119,31,48),(1,6,65,140,87,128,31,49),(1,6,66,143,89,131,31,50),(1,6,67,146,90,133,32,50),(1,6,68,148,92,135,32,51),(1,6,69,151,93,138,32,52),(1,6,70,154,95,140,32,52),(1,6,71,162,97,144,33,53),(1,6,72,164,98,146,33,54),(1,6,73,165,100,148,33,55),(1,6,74,166,102,151,33,55),(1,6,75,169,103,154,34,56),(1,6,76,172,105,157,34,57),(1,6,77,175,107,157,34,58),(1,6,78,176,108,157,34,58),(1,6,79,177,110,157,35,59),(1,6,80,180,112,160,35,60),(1,8,1,20,20,20,23,22),(1,8,2,20,20,20,24,23),(1,8,3,20,20,21,26,25),(1,8,4,20,20,21,27,26),(1,8,5,20,21,21,28,27),(1,8,6,20,21,21,30,29),(1,8,7,21,21,22,31,30),(1,8,8,21,21,22,33,31),(1,8,9,21,21,22,34,33),(1,8,10,21,21,23,36,34),(1,8,11,21,22,23,37,36),(1,8,12,21,22,23,39,37),(1,8,13,21,22,24,40,38),(1,8,14,21,22,24,42,40),(1,8,15,21,22,24,43,41),(1,8,16,21,23,25,45,43),(1,8,17,22,23,25,46,44),(1,8,18,22,23,25,48,46),(1,8,19,22,23,26,49,47),(1,8,20,22,23,26,51,49),(1,8,21,22,24,26,53,51),(1,8,22,22,24,27,54,52),(1,8,23,22,24,27,56,54),(1,8,24,23,24,28,58,55),(1,8,25,23,25,28,59,57),(1,8,26,23,25,28,61,59),(1,8,27,23,25,29,63,60),(1,8,28,23,25,29,65,62),(1,8,29,23,25,30,66,64),(1,8,30,24,26,30,68,65),(1,8,31,24,26,30,70,67),(1,8,32,24,26,31,72,69),(1,8,33,24,27,31,73,70),(1,8,34,24,27,32,75,72),(1,8,35,24,27,32,77,74),(1,8,36,25,27,33,79,76),(1,8,37,25,28,33,81,78),(1,8,38,25,28,34,83,79),(1,8,39,25,28,34,85,81),(1,8,40,25,28,35,87,83),(1,8,41,26,29,35,88,85),(1,8,42,26,29,35,90,87),(1,8,43,26,29,36,92,89),(1,8,44,26,30,36,94,91),(1,8,45,26,30,37,96,92),(1,8,46,27,30,37,98,94),(1,8,47,27,31,38,100,96),(1,8,48,27,31,38,102,98),(1,8,49,27,31,39,104,100),(1,8,50,28,32,40,106,102),(1,8,51,28,32,40,109,104),(1,8,52,28,32,41,111,106),(1,8,53,28,33,41,113,108),(1,8,54,29,33,42,115,110),(1,8,55,29,33,42,117,112),(1,8,56,29,34,43,119,114),(1,8,57,29,34,43,121,117),(1,8,58,30,34,44,124,119),(1,8,59,30,35,44,126,121),(1,8,60,30,35,45,128,123),(1,8,61,30,35,46,130,125),(1,8,62,31,36,46,132,127),(1,8,63,31,36,47,135,129),(1,8,64,31,37,47,137,132),(1,8,65,32,37,48,139,134),(1,8,66,32,37,49,142,136),(1,8,67,32,38,49,144,138),(1,8,68,32,38,50,146,140),(1,8,69,33,39,50,149,143),(1,8,70,33,39,51,151,145),(1,8,71,33,39,52,154,152),(1,8,72,33,40,53,160,155),(1,8,73,33,40,54,160,158),(1,8,74,34,41,54,163,160),(1,8,75,34,41,55,166,163),(1,8,76,34,41,56,169,166),(1,8,77,35,42,57,172,169),(1,8,78,35,42,57,175,173),(1,8,79,35,43,58,178,176),(1,8,80,36,43,59,181,179),(1,9,1,20,20,21,22,22),(1,9,2,20,20,22,23,23),(1,9,3,21,21,22,24,24),(1,9,4,21,21,23,26,25),(1,9,5,21,21,23,27,27),(1,9,6,21,22,24,28,28),(1,9,7,22,22,24,29,29),(1,9,8,22,23,25,30,30),(1,9,9,22,23,26,32,31),(1,9,10,23,23,26,33,33),(1,9,11,23,24,27,34,34),(1,9,12,23,24,27,35,35),(1,9,13,24,25,28,37,36),(1,9,14,24,25,29,38,38),(1,9,15,24,25,29,39,39),(1,9,16,25,26,30,41,40),(1,9,17,25,26,31,42,42),(1,9,18,25,27,31,43,43),(1,9,19,26,27,32,45,44),(1,9,20,26,28,33,46,46),(1,9,21,26,28,33,48,47),(1,9,22,27,29,34,49,49),(1,9,23,27,29,35,51,50),(1,9,24,28,30,35,52,51),(1,9,25,28,30,36,53,53),(1,9,26,28,31,37,55,54),(1,9,27,29,31,37,56,56),(1,9,28,29,32,38,58,57),(1,9,29,30,32,39,59,59),(1,9,30,30,33,40,61,60),(1,9,31,30,33,40,62,62),(1,9,32,31,34,41,64,63),(1,9,33,31,34,42,66,65),(1,9,34,32,35,43,67,66),(1,9,35,32,35,44,69,68),(1,9,36,33,36,44,70,69),(1,9,37,33,36,45,72,71),(1,9,38,34,37,46,74,73),(1,9,39,34,38,47,75,74),(1,9,40,35,38,48,77,76),(1,9,41,35,39,48,79,78),(1,9,42,35,39,49,80,79),(1,9,43,36,40,50,82,81),(1,9,44,36,40,51,84,83),(1,9,45,37,41,52,85,84),(1,9,46,37,42,53,87,86),(1,9,47,38,42,54,89,88),(1,9,48,38,43,55,91,89),(1,9,49,39,44,55,93,91),(1,9,50,40,44,56,94,93),(1,9,51,40,45,57,96,95),(1,9,52,41,45,58,98,97),(1,9,53,41,46,59,100,98),(1,9,54,42,47,60,102,100),(1,9,55,42,47,61,103,102),(1,9,56,43,48,62,105,104),(1,9,57,43,49,63,107,106),(1,9,58,44,49,64,109,108),(1,9,59,44,50,65,111,109),(1,9,60,45,51,66,113,111),(1,9,61,46,51,67,115,113),(1,9,62,46,52,68,117,115),(1,9,63,47,53,69,119,117),(1,9,64,47,54,70,121,119),(1,9,65,48,54,71,123,121),(1,9,66,49,55,72,125,123),(1,9,67,49,56,73,127,125),(1,9,68,50,57,74,129,127),(1,9,69,50,57,75,131,129),(1,9,70,51,58,76,133,131),(1,9,71,52,59,78,135,146),(1,9,72,53,59,79,138,148),(1,9,73,54,60,80,140,151),(1,9,74,54,61,89,143,154),(1,9,75,55,62,91,145,156),(1,9,76,56,63,92,148,159),(1,9,77,57,64,93,151,162),(1,9,78,57,65,95,153,165),(1,9,79,58,66,96,156,168),(1,9,80,59,67,97,159,170),(2,1,1,26,17,24,17,23),(2,1,2,27,18,25,17,23),(2,1,3,29,19,26,17,24),(2,1,4,30,19,27,17,24),(2,1,5,31,20,29,17,24),(2,1,6,32,21,30,17,24),(2,1,7,34,22,31,18,25),(2,1,8,35,23,32,18,25),(2,1,9,37,24,34,18,25),(2,1,10,38,24,35,18,26),(2,1,11,39,25,36,18,26),(2,1,12,41,26,37,18,26),(2,1,13,42,27,39,18,27),(2,1,14,44,28,40,18,27),(2,1,15,45,29,41,18,27),(2,1,16,47,30,43,19,28),(2,1,17,48,31,44,19,28),(2,1,18,50,32,45,19,28),(2,1,19,51,33,47,19,29),(2,1,20,53,34,48,19,29),(2,1,21,54,34,50,19,29),(2,1,22,56,35,51,19,30),(2,1,23,57,36,52,20,30),(2,1,24,59,37,54,20,30),(2,1,25,60,38,55,20,31),(2,1,26,62,39,57,20,31),(2,1,27,64,40,58,20,32),(2,1,28,65,41,60,20,32),(2,1,29,67,43,61,21,32),(2,1,30,69,44,63,21,33),(2,1,31,70,45,64,21,33),(2,1,32,72,46,66,21,34),(2,1,33,74,47,67,21,34),(2,1,34,76,48,69,21,35),(2,1,35,77,49,71,22,35),(2,1,36,79,50,72,22,36),(2,1,37,81,51,74,22,36),(2,1,38,83,52,76,22,36),(2,1,39,84,53,77,22,37),(2,1,40,86,55,79,23,37),(2,1,41,88,56,81,23,38),(2,1,42,90,57,82,23,38),(2,1,43,92,58,84,23,39),(2,1,44,94,59,86,23,39),(2,1,45,96,60,87,24,40),(2,1,46,98,62,89,24,40),(2,1,47,100,63,91,24,41),(2,1,48,101,64,93,24,41),(2,1,49,103,65,94,25,42),(2,1,50,105,66,96,25,42),(2,1,51,107,68,98,25,43),(2,1,52,109,69,100,25,43),(2,1,53,111,70,102,25,44),(2,1,54,113,71,104,26,45),(2,1,55,115,73,105,26,45),(2,1,56,118,74,107,26,46),(2,1,57,120,75,109,26,46),(2,1,58,122,77,111,27,47),(2,1,59,124,78,113,27,47),(2,1,60,126,79,115,27,48),(2,1,61,128,81,117,27,48),(2,1,62,130,82,119,28,49),(2,1,63,132,83,121,28,50),(2,1,64,135,85,123,28,50),(2,1,65,137,86,125,29,51),(2,1,66,139,87,127,29,52),(2,1,67,141,89,129,29,52),(2,1,68,143,90,131,29,53),(2,1,69,146,92,133,30,53),(2,1,70,148,93,135,30,54),(2,1,71,157,94,142,30,55),(2,1,72,162,96,148,30,56),(2,1,73,165,98,150,30,57),(2,1,74,168,99,153,31,57),(2,1,75,170,101,154,31,58),(2,1,76,172,103,156,31,59),(2,1,77,174,105,159,32,60),(2,1,78,179,106,162,32,60),(2,1,79,184,108,167,32,61),(2,1,80,187,110,170,33,62),(2,3,1,23,20,23,17,24),(2,3,2,23,21,24,18,25),(2,3,3,24,23,25,18,25),(2,3,4,24,24,26,19,26),(2,3,5,25,25,27,19,26),(2,3,6,25,27,28,20,27),(2,3,7,26,28,28,21,28),(2,3,8,26,30,29,21,28),(2,3,9,26,31,30,22,29),(2,3,10,27,33,31,22,30),(2,3,11,27,34,32,23,30),(2,3,12,28,36,33,24,31),(2,3,13,28,37,34,24,32),(2,3,14,29,39,35,25,33),(2,3,15,29,40,36,26,33),(2,3,16,30,42,37,26,34),(2,3,17,30,43,39,27,35),(2,3,18,31,45,40,28,35),(2,3,19,31,47,41,28,36),(2,3,20,32,48,42,29,37),(2,3,21,32,50,43,30,38),(2,3,22,33,51,44,31,39),(2,3,23,34,53,45,31,39),(2,3,24,34,55,46,32,40),(2,3,25,35,57,47,33,41),(2,3,26,35,58,48,34,42),(2,3,27,36,60,50,34,43),(2,3,28,36,62,51,35,43),(2,3,29,37,63,52,36,44),(2,3,30,38,65,53,37,45),(2,3,31,38,67,54,37,46),(2,3,32,39,69,56,38,47),(2,3,33,39,71,57,39,48),(2,3,34,40,72,58,40,49),(2,3,35,41,74,59,41,49),(2,3,36,41,76,61,42,50),(2,3,37,42,78,62,42,51),(2,3,38,43,80,63,43,52),(2,3,39,43,82,64,44,53),(2,3,40,44,84,66,45,54),(2,3,41,45,86,67,46,55),(2,3,42,45,88,68,47,56),(2,3,43,46,90,70,47,57),(2,3,44,47,91,71,48,58),(2,3,45,47,93,72,49,59),(2,3,46,48,95,74,50,60),(2,3,47,49,98,75,51,61),(2,3,48,50,100,77,52,62),(2,3,49,50,102,78,53,63),(2,3,50,51,104,79,54,64),(2,3,51,52,106,81,55,65),(2,3,52,52,108,82,56,66),(2,3,53,53,110,84,57,67),(2,3,54,54,112,85,58,68),(2,3,55,55,114,87,59,69),(2,3,56,55,116,88,60,70),(2,3,57,56,118,90,61,71),(2,3,58,57,121,91,62,72),(2,3,59,58,123,93,63,73),(2,3,60,59,125,94,64,74),(2,3,61,59,127,96,65,76),(2,3,62,60,130,97,66,77),(2,3,63,61,132,99,67,78),(2,3,64,62,134,100,68,79),(2,3,65,63,136,102,69,80),(2,3,66,64,139,104,70,81),(2,3,67,64,141,105,71,82),(2,3,68,65,143,107,72,84),(2,3,69,66,146,108,73,85),(2,3,70,67,148,110,74,86),(2,3,71,68,151,112,75,87),(2,3,72,69,154,114,76,88),(2,3,73,70,157,116,77,90),(2,3,74,71,160,118,79,91),(2,3,75,72,163,120,80,93),(2,3,76,73,166,122,81,94),(2,3,77,74,169,124,83,96),(2,3,78,75,172,126,84,97),(2,3,79,76,175,128,85,99),(2,3,80,77,178,130,87,100),(2,4,1,24,20,23,17,23),(2,4,2,25,21,24,17,23),(2,4,3,25,23,24,17,24),(2,4,4,26,24,25,17,24),(2,4,5,27,26,26,18,24),(2,4,6,28,27,26,18,25),(2,4,7,29,29,27,18,25),(2,4,8,29,30,28,18,26),(2,4,9,30,32,29,18,26),(2,4,10,31,33,29,19,26),(2,4,11,32,35,30,19,27),(2,4,12,33,37,31,19,27),(2,4,13,34,38,32,19,28),(2,4,14,34,40,32,19,28),(2,4,15,35,41,33,19,28),(2,4,16,36,43,34,20,29),(2,4,17,37,45,35,20,29),(2,4,18,38,46,36,20,30),(2,4,19,39,48,37,20,30),(2,4,20,40,50,37,21,31),(2,4,21,41,52,38,21,31),(2,4,22,42,53,39,21,31),(2,4,23,43,55,40,21,32),(2,4,24,43,57,41,21,32),(2,4,25,44,59,42,22,33),(2,4,26,45,60,43,22,33),(2,4,27,46,62,44,22,34),(2,4,28,47,64,44,22,34),(2,4,29,48,66,45,23,35),(2,4,30,49,68,46,23,35),(2,4,31,50,70,47,23,36),(2,4,32,51,72,48,23,36),(2,4,33,53,73,49,24,37),(2,4,34,54,75,50,24,38),(2,4,35,55,77,51,24,38),(2,4,36,56,79,52,24,39),(2,4,37,57,81,53,25,39),(2,4,38,58,83,54,25,40),(2,4,39,59,85,55,25,40),(2,4,40,60,87,56,26,41),(2,4,41,61,89,57,26,41),(2,4,42,62,91,58,26,42),(2,4,43,63,93,59,27,43),(2,4,44,65,95,60,27,43),(2,4,45,66,98,61,27,44),(2,4,46,67,100,62,27,44),(2,4,47,68,102,64,28,45),(2,4,48,69,104,65,28,46),(2,4,49,71,106,66,28,46),(2,4,50,72,108,67,29,47),(2,4,51,73,110,68,29,48),(2,4,52,74,113,69,29,48),(2,4,53,75,115,70,30,49),(2,4,54,77,117,71,30,50),(2,4,55,78,119,73,30,50),(2,4,56,79,122,74,31,51),(2,4,57,80,124,75,31,52),(2,4,58,82,126,76,31,52),(2,4,59,83,129,77,32,53),(2,4,60,84,131,78,32,54),(2,4,61,86,133,80,33,54),(2,4,62,87,136,81,33,55),(2,4,63,88,138,82,33,56),(2,4,64,90,140,83,34,57),(2,4,65,91,143,85,34,57),(2,4,66,92,145,86,34,58),(2,4,67,94,148,87,35,59),(2,4,68,95,150,88,35,59),(2,4,69,97,153,90,36,60),(2,4,70,98,155,91,36,61),(2,4,71,100,158,92,36,62),(2,4,72,102,161,94,37,62),(2,4,73,103,164,99,37,63),(2,4,74,105,167,100,38,64),(2,4,75,107,170,102,38,65),(2,4,76,108,173,102,38,66),(2,4,77,110,176,102,39,67),(2,4,78,112,180,103,39,68),(2,4,79,114,183,105,40,69),(2,4,80,116,186,107,40,70),(2,6,1,26,17,24,17,23),(2,6,2,27,18,25,17,23),(2,6,3,29,19,26,17,24),(2,6,4,30,19,27,17,24),(2,6,5,31,20,29,17,24),(2,6,6,32,21,30,17,24),(2,6,7,34,22,31,18,25),(2,6,8,35,23,32,18,25),(2,6,9,37,24,34,18,25),(2,6,10,38,24,35,18,26),(2,6,11,39,25,36,18,26),(2,6,12,41,26,37,18,26),(2,6,13,42,27,39,18,27),(2,6,14,44,28,40,18,27),(2,6,15,45,29,41,18,27),(2,6,16,47,30,43,19,28),(2,6,17,48,31,44,19,28),(2,6,18,50,32,45,19,28),(2,6,19,51,33,47,19,29),(2,6,20,53,34,48,19,29),(2,6,21,54,34,50,19,29),(2,6,22,56,35,51,19,30),(2,6,23,57,36,52,20,30),(2,6,24,59,37,54,20,30),(2,6,25,60,38,55,20,31),(2,6,26,62,39,57,20,31),(2,6,27,64,40,58,20,32),(2,6,28,65,41,60,20,32),(2,6,29,67,43,61,21,32),(2,6,30,69,44,63,21,33),(2,6,31,70,45,64,21,33),(2,6,32,72,46,66,21,34),(2,6,33,74,47,67,21,34),(2,6,34,76,48,69,21,35),(2,6,35,77,49,71,22,35),(2,6,36,79,50,72,22,36),(2,6,37,81,51,74,22,36),(2,6,38,83,52,76,22,36),(2,6,39,84,53,77,22,37),(2,6,40,86,55,79,23,37),(2,6,41,88,56,81,23,38),(2,6,42,90,57,82,23,38),(2,6,43,92,58,84,23,39),(2,6,44,94,59,86,23,39),(2,6,45,96,60,87,24,40),(2,6,46,98,62,89,24,40),(2,6,47,100,63,91,24,41),(2,6,48,101,64,93,24,41),(2,6,49,103,65,94,25,42),(2,6,50,105,66,96,25,42),(2,6,51,107,68,98,25,43),(2,6,52,109,69,100,25,43),(2,6,53,110,69,100,25,44),(2,6,54,111,70,101,26,45),(2,6,55,111,70,101,26,45),(2,6,56,114,72,104,26,46),(2,6,57,116,73,106,26,46),(2,6,58,118,74,108,27,47),(2,6,59,124,76,110,27,47),(2,6,60,126,77,112,27,48),(2,6,61,128,78,114,27,49),(2,6,62,131,80,116,27,49),(2,6,63,133,81,119,28,50),(2,6,64,136,83,121,28,50),(2,6,65,136,84,123,28,51),(2,6,66,142,86,126,28,52),(2,6,67,145,87,128,29,52),(2,6,68,147,89,130,29,53),(2,6,69,150,90,133,29,54),(2,6,70,157,92,135,29,54),(2,6,71,160,94,138,30,55),(2,6,72,163,95,140,30,56),(2,6,73,166,97,151,30,57),(2,6,74,169,99,154,30,57),(2,6,75,172,100,156,31,58),(2,6,76,175,102,160,31,59),(2,6,77,179,104,162,31,60),(2,6,78,182,105,165,31,60),(2,6,79,191,107,168,32,61),(2,6,80,194,109,171,32,62),(2,7,1,24,17,23,18,25),(2,7,2,25,17,24,19,26),(2,7,3,26,18,25,20,27),(2,7,4,26,18,26,21,28),(2,7,5,27,19,27,22,29),(2,7,6,28,19,28,23,30),(2,7,7,29,20,29,24,31),(2,7,8,30,20,30,25,32),(2,7,9,31,21,31,26,33),(2,7,10,32,21,32,27,34),(2,7,11,33,22,33,28,36),(2,7,12,34,22,34,29,37),(2,7,13,34,23,35,30,38),(2,7,14,35,23,36,31,39),(2,7,15,36,24,37,32,40),(2,7,16,37,24,39,33,41),(2,7,17,38,25,40,34,43),(2,7,18,39,25,41,35,44),(2,7,19,40,26,42,36,45),(2,7,20,41,26,43,37,46),(2,7,21,42,27,44,38,47),(2,7,22,43,27,45,39,49),(2,7,23,44,28,47,40,50),(2,7,24,45,28,48,41,51),(2,7,25,47,29,49,43,52),(2,7,26,48,30,50,44,54),(2,7,27,49,30,52,45,55),(2,7,28,50,31,53,46,56),(2,7,29,51,31,54,47,58),(2,7,30,52,32,55,48,59),(2,7,31,53,33,57,50,60),(2,7,32,54,33,58,51,62),(2,7,33,55,34,59,52,63),(2,7,34,57,34,61,53,65),(2,7,35,58,35,62,55,66),(2,7,36,59,36,63,56,67),(2,7,37,60,36,65,57,69),(2,7,38,61,37,66,58,70),(2,7,39,62,38,67,60,72),(2,7,40,64,38,69,61,73),(2,7,41,65,39,70,62,75),(2,7,42,66,40,72,64,76),(2,7,43,67,40,73,65,78),(2,7,44,69,41,74,66,79),(2,7,45,70,42,76,68,81),(2,7,46,71,42,77,69,82),(2,7,47,72,43,79,70,84),(2,7,48,74,44,80,72,85),(2,7,49,75,45,82,73,87),(2,7,50,76,45,83,75,89),(2,7,51,78,46,85,76,90),(2,7,52,79,47,86,77,92),(2,7,53,80,47,88,79,93),(2,7,54,82,48,90,80,95),(2,7,55,83,49,91,82,97),(2,7,56,85,50,93,83,98),(2,7,57,86,50,94,85,100),(2,7,58,87,51,96,86,102),(2,7,59,89,52,97,88,103),(2,7,60,90,53,99,89,105),(2,7,61,92,54,101,91,107),(2,7,62,93,54,102,92,109),(2,7,63,95,55,104,94,110),(2,7,64,96,56,106,95,112),(2,7,65,97,57,107,97,114),(2,7,66,99,58,109,99,116),(2,7,67,100,58,111,100,118),(2,7,68,102,59,113,102,119),(2,7,69,103,60,114,103,121),(2,7,70,105,61,116,105,123),(2,7,71,106,62,118,117,125),(2,7,72,108,63,120,119,128),(2,7,73,110,64,122,122,130),(2,7,74,112,65,125,124,132),(2,7,75,114,66,127,126,134),(2,7,76,116,67,129,128,137),(2,7,77,117,68,131,128,139),(2,7,78,119,69,133,133,141),(2,7,79,121,70,136,135,144),(2,7,80,123,71,138,137,146),(2,9,1,23,17,23,19,25),(2,9,2,23,17,24,20,26),(2,9,3,24,18,24,21,27),(2,9,4,24,18,25,23,28),(2,9,5,24,18,25,24,30),(2,9,6,24,19,26,25,31),(2,9,7,25,19,26,26,32),(2,9,8,25,20,27,27,33),(2,9,9,25,20,27,29,34),(2,9,10,26,20,28,30,36),(2,9,11,26,21,29,31,37),(2,9,12,26,21,29,33,38),(2,9,13,27,22,30,34,39),(2,9,14,27,22,31,35,41),(2,9,15,27,23,31,37,42),(2,9,16,28,23,32,38,43),(2,9,17,28,23,32,39,45),(2,9,18,28,24,33,41,46),(2,9,19,29,24,34,42,47),(2,9,20,29,25,34,43,49),(2,9,21,29,25,35,45,50),(2,9,22,30,26,36,46,51),(2,9,23,30,26,37,48,53),(2,9,24,30,27,37,49,54),(2,9,25,31,27,38,51,56),(2,9,26,31,28,39,52,57),(2,9,27,32,28,39,54,59),(2,9,28,32,29,40,55,60),(2,9,29,32,29,41,57,62),(2,9,30,33,30,42,58,63),(2,9,31,33,30,42,60,65),(2,9,32,34,31,43,61,66),(2,9,33,34,31,44,63,68),(2,9,34,35,32,45,64,69),(2,9,35,35,32,45,66,71),(2,9,36,36,33,46,68,72),(2,9,37,36,34,47,69,74),(2,9,38,36,34,48,71,76),(2,9,39,37,35,49,72,77),(2,9,40,37,35,50,74,79),(2,9,41,38,36,50,76,80),(2,9,42,38,36,51,77,82),(2,9,43,39,37,52,79,84),(2,9,44,39,38,53,81,85),(2,9,45,40,38,54,83,87),(2,9,46,40,39,55,84,89),(2,9,47,41,39,56,86,91),(2,9,48,41,40,56,88,92),(2,9,49,42,41,57,90,94),(2,9,50,42,41,58,91,96),(2,9,51,43,42,59,93,98),(2,9,52,43,43,60,95,99),(2,9,53,44,43,61,97,101),(2,9,54,45,44,62,99,103),(2,9,55,45,45,63,101,105),(2,9,56,46,45,64,102,107),(2,9,57,46,46,65,104,109),(2,9,58,47,47,66,106,110),(2,9,59,47,47,67,108,112),(2,9,60,48,48,68,110,114),(2,9,61,48,49,69,112,116),(2,9,62,49,49,70,114,118),(2,9,63,50,50,71,116,120),(2,9,64,50,51,72,118,122),(2,9,65,51,51,73,120,124),(2,9,66,52,52,74,122,126),(2,9,67,52,53,75,124,128),(2,9,68,53,54,76,126,130),(2,9,69,53,54,77,128,132),(2,9,70,54,55,78,130,134),(2,9,71,55,56,88,134,145),(2,9,72,56,56,89,135,147),(2,9,73,57,57,90,137,150),(2,9,74,57,58,91,142,153),(2,9,75,58,59,93,142,155),(2,9,76,59,60,94,145,158),(2,9,77,60,61,95,148,161),(2,9,78,60,62,97,150,164),(2,9,79,61,63,98,153,167),(2,9,80,62,64,99,156,169),(3,1,1,25,16,25,19,19),(3,1,2,26,17,26,19,19),(3,1,3,28,18,27,19,20),(3,1,4,29,18,28,19,20),(3,1,5,30,19,30,19,20),(3,1,6,31,20,31,19,20),(3,1,7,33,21,32,20,21),(3,1,8,34,22,33,20,21),(3,1,9,36,23,35,20,21),(3,1,10,37,23,36,20,22),(3,1,11,38,24,37,20,22),(3,1,12,40,25,38,20,22),(3,1,13,41,26,40,20,23),(3,1,14,43,27,41,20,23),(3,1,15,44,28,42,20,23),(3,1,16,46,29,44,21,24),(3,1,17,47,30,45,21,24),(3,1,18,49,31,46,21,24),(3,1,19,50,32,48,21,25),(3,1,20,52,33,49,21,25),(3,1,21,53,34,51,21,26),(3,1,22,55,34,52,21,26),(3,1,23,56,35,53,21,26),(3,1,24,58,36,55,22,27),(3,1,25,59,37,56,22,27),(3,1,26,61,38,58,22,27),(3,1,27,63,39,59,22,28),(3,1,28,64,41,61,22,28),(3,1,29,66,42,62,22,29),(3,1,30,68,43,64,23,29),(3,1,31,69,44,65,23,30),(3,1,32,71,45,67,23,30),(3,1,33,73,46,68,23,30),(3,1,34,75,47,70,23,31),(3,1,35,76,48,72,24,31),(3,1,36,78,49,73,24,32),(3,1,37,80,50,75,24,32),(3,1,38,82,51,76,24,33),(3,1,39,84,52,78,24,33),(3,1,40,85,54,80,24,34),(3,1,41,87,55,81,25,34),(3,1,42,89,56,83,25,35),(3,1,43,91,57,85,25,35),(3,1,44,93,58,87,25,36),(3,1,45,95,59,88,26,36),(3,1,46,97,61,90,26,37),(3,1,47,99,62,92,26,37),(3,1,48,101,63,94,26,38),(3,1,49,102,64,95,26,38),(3,1,50,104,65,97,27,39),(3,1,51,106,67,99,27,39),(3,1,52,108,68,101,27,40),(3,1,53,110,69,103,27,40),(3,1,54,112,70,104,28,41),(3,1,55,115,72,106,28,41),(3,1,56,117,73,108,28,42),(3,1,57,119,74,110,28,42),(3,1,58,121,76,112,29,43),(3,1,59,123,77,114,29,43),(3,1,60,125,78,116,29,44),(3,1,61,127,80,118,29,45),(3,1,62,129,81,120,30,45),(3,1,63,131,82,122,30,46),(3,1,64,134,84,124,30,46),(3,1,65,136,85,126,31,47),(3,1,66,138,86,128,31,48),(3,1,67,140,88,130,31,48),(3,1,68,142,89,132,31,49),(3,1,69,145,91,134,32,49),(3,1,70,147,92,136,32,50),(3,1,71,150,93,138,32,51),(3,1,72,152,95,141,32,52),(3,1,73,164,97,151,32,53),(3,1,74,164,98,151,33,53),(3,1,75,170,100,156,33,54),(3,1,76,173,102,160,33,55),(3,1,77,173,104,160,34,56),(3,1,78,176,105,162,34,56),(3,1,79,183,107,168,34,57),(3,1,80,186,109,171,35,58),(3,2,1,24,16,25,19,20),(3,2,2,25,17,26,20,21),(3,2,3,26,17,27,20,21),(3,2,4,27,18,28,21,22),(3,2,5,28,18,29,22,23),(3,2,6,29,19,30,22,24),(3,2,7,31,20,31,23,24),(3,2,8,32,20,32,24,25),(3,2,9,33,21,33,24,26),(3,2,10,34,21,34,25,26),(3,2,11,35,22,36,26,27),(3,2,12,36,23,37,26,28),(3,2,13,38,23,38,27,29),(3,2,14,39,24,39,28,30),(3,2,15,40,25,40,29,30),(3,2,16,41,25,41,29,31),(3,2,17,43,26,43,30,32),(3,2,18,44,27,44,31,33),(3,2,19,45,28,45,32,34),(3,2,20,47,28,46,32,35),(3,2,21,48,29,47,33,35),(3,2,22,49,30,49,34,36),(3,2,23,51,30,50,35,37),(3,2,24,52,31,51,36,38),(3,2,25,53,32,52,36,39),(3,2,26,55,33,54,37,40),(3,2,27,56,33,55,38,41),(3,2,28,57,34,56,39,42),(3,2,29,59,35,58,40,43),(3,2,30,60,36,59,41,43),(3,2,31,62,37,60,42,44),(3,2,32,63,37,62,42,45),(3,2,33,65,38,63,43,46),(3,2,34,66,39,65,44,47),(3,2,35,68,40,66,45,48),(3,2,36,69,41,67,46,49),(3,2,37,71,41,69,47,50),(3,2,38,72,42,70,48,51),(3,2,39,74,43,72,49,52),(3,2,40,75,44,73,50,53),(3,2,41,77,45,75,51,54),(3,2,42,78,46,76,52,55),(3,2,43,80,47,78,53,56),(3,2,44,82,47,79,54,57),(3,2,45,83,48,81,55,59),(3,2,46,85,49,82,56,60),(3,2,47,87,50,84,57,61),(3,2,48,88,51,85,58,62),(3,2,49,90,52,87,59,63),(3,2,50,92,53,89,60,64),(3,2,51,93,54,90,61,65),(3,2,52,95,55,92,62,66),(3,2,53,97,56,93,63,67),(3,2,54,98,57,95,64,69),(3,2,55,100,58,97,65,70),(3,2,56,102,59,98,66,71),(3,2,57,104,60,100,67,72),(3,2,58,106,61,102,68,73),(3,2,59,107,62,103,69,74),(3,2,60,109,63,105,70,76),(3,2,61,111,64,107,72,77),(3,2,62,113,65,109,73,78),(3,2,63,115,66,110,74,79),(3,2,64,117,67,112,75,80),(3,2,65,118,68,114,76,82),(3,2,66,120,69,116,77,83),(3,2,67,122,70,118,78,84),(3,2,68,124,71,119,80,85),(3,2,69,126,72,121,81,87),(3,2,70,128,73,123,82,88),(3,2,71,150,74,125,83,89),(3,2,72,152,75,128,85,91),(3,2,73,156,76,130,86,93),(3,2,74,158,78,132,88,94),(3,2,75,161,79,134,89,96),(3,2,76,164,80,137,91,97),(3,2,77,166,82,139,92,99),(3,2,78,170,83,141,94,101),(3,2,79,172,84,144,95,102),(3,2,80,175,86,146,97,104),(3,3,1,22,19,24,19,20),(3,3,2,22,20,25,20,21),(3,3,3,23,22,26,20,21),(3,3,4,23,23,27,21,22),(3,3,5,24,25,28,21,23),(3,3,6,24,26,29,22,23),(3,3,7,25,27,29,23,24),(3,3,8,25,29,30,23,25),(3,3,9,25,30,31,24,25),(3,3,10,26,32,32,24,26),(3,3,11,26,33,33,25,27),(3,3,12,27,35,34,26,27),(3,3,13,27,36,35,26,28),(3,3,14,28,38,36,27,29),(3,3,15,28,39,37,28,29),(3,3,16,29,41,38,28,30),(3,3,17,29,42,39,29,31),(3,3,18,30,44,41,30,32),(3,3,19,30,46,42,30,32),(3,3,20,31,47,43,31,33),(3,3,21,32,49,44,32,34),(3,3,22,32,51,45,33,35),(3,3,23,33,52,46,33,36),(3,3,24,33,54,47,34,36),(3,3,25,34,56,48,35,37),(3,3,26,34,57,49,35,38),(3,3,27,35,59,51,36,39),(3,3,28,35,61,52,37,40),(3,3,29,36,63,53,38,40),(3,3,30,37,64,54,39,41),(3,3,31,37,66,55,39,42),(3,3,32,38,68,57,40,43),(3,3,33,38,70,58,41,44),(3,3,34,39,71,59,42,45),(3,3,35,40,73,60,43,46),(3,3,36,40,75,62,43,47),(3,3,37,41,77,63,44,47),(3,3,38,42,79,64,45,48),(3,3,39,42,81,65,46,49),(3,3,40,43,83,67,47,50),(3,3,41,44,85,68,48,51),(3,3,42,44,87,69,49,52),(3,3,43,45,89,71,49,53),(3,3,44,46,91,72,50,54),(3,3,45,46,93,73,51,55),(3,3,46,47,95,75,52,56),(3,3,47,48,97,76,53,57),(3,3,48,49,99,78,54,58),(3,3,49,49,101,79,55,59),(3,3,50,50,103,80,56,60),(3,3,51,51,105,82,57,61),(3,3,52,51,107,83,58,62),(3,3,53,52,109,85,59,63),(3,3,54,53,111,86,60,64),(3,3,55,54,113,88,61,65),(3,3,56,55,115,89,62,66),(3,3,57,55,118,91,62,67),(3,3,58,56,120,92,63,68),(3,3,59,57,122,94,64,70),(3,3,60,58,124,95,65,71),(3,3,61,58,126,97,67,72),(3,3,62,59,129,98,68,73),(3,3,63,60,131,100,69,74),(3,3,64,61,133,101,70,75),(3,3,65,62,135,103,71,76),(3,3,66,63,138,105,72,77),(3,3,67,63,140,106,73,78),(3,3,68,64,142,108,74,80),(3,3,69,65,145,109,75,81),(3,3,70,66,147,111,76,82),(3,3,71,67,150,113,77,83),(3,3,72,68,153,115,78,84),(3,3,73,69,156,117,79,86),(3,3,74,70,159,119,81,87),(3,3,75,71,162,121,82,89),(3,3,76,72,165,123,83,90),(3,3,77,73,168,125,85,92),(3,3,78,74,171,127,86,93),(3,3,79,75,174,129,87,95),(3,3,80,76,177,131,89,96),(3,4,1,23,19,24,19,19),(3,4,2,24,20,25,19,19),(3,4,3,24,22,25,19,20),(3,4,4,25,23,26,19,20),(3,4,5,26,25,27,20,20),(3,4,6,27,26,27,20,21),(3,4,7,28,28,28,20,21),(3,4,8,28,29,29,20,22),(3,4,9,29,31,30,20,22),(3,4,10,30,32,30,20,22),(3,4,11,31,34,31,21,23),(3,4,12,32,36,32,21,23),(3,4,13,33,37,33,21,24),(3,4,14,33,39,33,21,24),(3,4,15,34,40,34,21,25),(3,4,16,35,42,35,22,25),(3,4,17,36,44,36,22,25),(3,4,18,37,45,37,22,26),(3,4,19,38,47,38,22,26),(3,4,20,39,49,38,22,27),(3,4,21,40,51,39,23,27),(3,4,22,41,52,40,23,28),(3,4,23,42,54,41,23,28),(3,4,24,43,56,42,23,29),(3,4,25,44,58,43,24,29),(3,4,26,44,59,44,24,30),(3,4,27,45,61,44,24,30),(3,4,28,46,63,45,24,31),(3,4,29,47,65,46,25,31),(3,4,30,48,67,47,25,32),(3,4,31,49,69,48,25,32),(3,4,32,51,71,49,25,33),(3,4,33,52,72,50,26,33),(3,4,34,53,74,51,26,34),(3,4,35,54,76,52,26,34),(3,4,36,55,78,53,26,35),(3,4,37,56,80,54,27,35),(3,4,38,57,82,55,27,36),(3,4,39,58,84,56,27,37),(3,4,40,59,86,57,28,37),(3,4,41,60,88,58,28,38),(3,4,42,61,90,59,28,38),(3,4,43,63,92,60,28,39),(3,4,44,64,95,61,29,39),(3,4,45,65,97,62,29,40),(3,4,46,66,99,63,29,41),(3,4,47,67,101,64,30,41),(3,4,48,68,103,66,30,42),(3,4,49,70,105,67,30,43),(3,4,50,71,107,68,31,43),(3,4,51,72,110,69,31,44),(3,4,52,73,112,70,31,44),(3,4,53,74,114,71,32,45),(3,4,54,76,116,72,32,46),(3,4,55,77,118,73,32,46),(3,4,56,78,121,75,33,47),(3,4,57,80,123,76,33,48),(3,4,58,81,125,77,33,48),(3,4,59,82,128,78,34,49),(3,4,60,83,130,79,34,50),(3,4,61,85,132,81,34,51),(3,4,62,86,135,82,35,51),(3,4,63,87,137,83,35,52),(3,4,64,89,139,84,36,53),(3,4,65,90,142,86,36,53),(3,4,66,91,144,87,36,54),(3,4,67,93,147,88,37,55),(3,4,68,94,149,89,37,56),(3,4,69,96,152,91,38,56),(3,4,70,97,154,92,38,57),(3,4,71,99,157,93,38,58),(3,4,72,101,160,96,39,58),(3,4,73,102,163,97,39,59),(3,4,74,104,166,98,40,60),(3,4,75,106,169,100,40,61),(3,4,76,107,172,101,40,62),(3,4,77,109,175,103,41,63),(3,4,78,111,179,105,41,64),(3,4,79,113,182,106,42,65),(3,4,80,115,185,108,42,66),(3,5,1,22,16,23,21,22),(3,5,2,22,16,23,22,23),(3,5,3,22,16,24,24,25),(3,5,4,22,17,24,25,26),(3,5,5,23,17,24,26,27),(3,5,6,23,17,25,28,29),(3,5,7,23,17,25,29,30),(3,5,8,23,18,26,30,32),(3,5,9,23,18,26,32,33),(3,5,10,23,18,26,33,35),(3,5,11,24,18,27,35,36),(3,5,12,24,19,27,36,38),(3,5,13,24,19,28,37,39),(3,5,14,24,19,28,39,41),(3,5,15,24,19,28,40,42),(3,5,16,24,20,29,42,44),(3,5,17,25,20,29,43,45),(3,5,18,25,20,30,45,47),(3,5,19,25,21,30,46,49),(3,5,20,25,21,31,48,50),(3,5,21,25,21,31,50,52),(3,5,22,26,22,31,51,53),(3,5,23,26,22,32,53,55),(3,5,24,26,22,32,54,57),(3,5,25,26,22,33,56,58),(3,5,26,27,23,33,58,60),(3,5,27,27,23,34,59,62),(3,5,28,27,23,34,61,64),(3,5,29,27,24,35,63,65),(3,5,30,28,24,35,64,67),(3,5,31,28,24,36,66,69),(3,5,32,28,25,36,68,71),(3,5,33,28,25,37,70,72),(3,5,34,29,26,38,71,74),(3,5,35,29,26,38,73,76),(3,5,36,29,26,39,75,78),(3,5,37,29,27,39,77,80),(3,5,38,30,27,40,78,82),(3,5,39,30,27,40,80,84),(3,5,40,30,28,41,82,86),(3,5,41,31,28,41,84,88),(3,5,42,31,29,42,86,89),(3,5,43,31,29,43,88,91),(3,5,44,32,29,43,90,93),(3,5,45,32,30,44,92,95),(3,5,46,32,30,44,93,97),(3,5,47,32,30,45,95,99),(3,5,48,33,31,46,97,101),(3,5,49,33,31,46,99,103),(3,5,50,33,32,47,101,106),(3,5,51,34,32,48,103,108),(3,5,52,34,33,48,105,110),(3,5,53,35,33,49,107,112),(3,5,54,35,33,50,109,114),(3,5,55,35,34,50,111,116),(3,5,56,36,34,51,113,118),(3,5,57,36,35,52,116,120),(3,5,58,36,35,52,118,123),(3,5,59,37,36,53,120,125),(3,5,60,37,36,54,122,127),(3,5,61,37,37,54,124,129),(3,5,62,38,37,55,126,131),(3,5,63,38,38,56,128,134),(3,5,64,39,38,57,131,136),(3,5,65,39,39,57,133,138),(3,5,66,39,39,58,135,141),(3,5,67,40,40,59,137,143),(3,5,68,40,40,59,139,145),(3,5,69,41,40,60,142,148),(3,5,70,41,41,61,144,150),(3,5,71,41,42,62,147,153),(3,5,72,42,42,62,150,163),(3,5,73,42,43,63,153,166),(3,5,74,43,43,64,155,170),(3,5,75,43,44,65,158,173),(3,5,76,43,45,66,161,176),(3,5,77,44,45,67,164,179),(3,5,78,44,46,68,167,182),(3,5,79,45,46,69,170,184),(3,5,80,45,47,70,173,189),(3,6,1,25,16,25,19,19),(3,6,2,26,17,26,19,19),(3,6,3,28,18,27,19,20),(3,6,4,29,18,28,19,20),(3,6,5,30,19,30,19,20),(3,6,6,31,20,31,19,20),(3,6,7,33,21,32,20,21),(3,6,8,34,22,33,20,21),(3,6,9,36,23,35,20,21),(3,6,10,37,23,36,20,22),(3,6,11,38,24,37,20,22),(3,6,12,40,25,38,20,22),(3,6,13,41,26,40,20,23),(3,6,14,43,27,41,20,23),(3,6,15,44,28,42,20,23),(3,6,16,46,29,44,21,24),(3,6,17,47,30,45,21,24),(3,6,18,49,31,46,21,24),(3,6,19,50,32,48,21,25),(3,6,20,52,33,49,21,25),(3,6,21,53,34,51,21,26),(3,6,22,55,34,52,21,26),(3,6,23,56,35,53,21,26),(3,6,24,58,36,55,22,27),(3,6,25,59,37,56,22,27),(3,6,26,61,38,58,22,27),(3,6,27,63,39,59,22,28),(3,6,28,64,41,61,22,28),(3,6,29,66,42,62,22,29),(3,6,30,68,43,64,23,29),(3,6,31,69,44,65,23,30),(3,6,32,71,45,67,23,30),(3,6,33,73,46,68,23,30),(3,6,34,75,47,70,23,31),(3,6,35,76,48,72,24,31),(3,6,36,78,49,73,24,32),(3,6,37,80,50,75,24,32),(3,6,38,82,51,76,24,33),(3,6,39,84,52,78,24,33),(3,6,40,85,54,80,24,34),(3,6,41,87,55,81,25,34),(3,6,42,89,56,83,25,35),(3,6,43,91,57,85,25,35),(3,6,44,93,58,87,25,36),(3,6,45,95,59,88,26,36),(3,6,46,97,61,90,26,37),(3,6,47,99,62,92,26,37),(3,6,48,101,63,94,26,38),(3,6,49,102,64,95,26,38),(3,6,50,104,65,97,27,39),(3,6,51,106,67,99,27,39),(3,6,52,108,68,99,27,40),(3,6,53,109,68,101,27,40),(3,6,54,110,69,101,28,41),(3,6,55,110,69,102,28,41),(3,6,56,113,71,105,28,42),(3,6,57,118,72,107,28,42),(3,6,58,120,73,109,29,43),(3,6,59,123,75,111,29,43),(3,6,60,125,76,113,29,44),(3,6,61,126,77,115,29,45),(3,6,62,127,79,117,29,45),(3,6,63,129,80,120,30,46),(3,6,64,132,82,122,30,46),(3,6,65,135,83,124,30,47),(3,6,66,137,85,127,30,48),(3,6,67,144,86,129,31,48),(3,6,68,146,88,131,31,49),(3,6,69,149,89,133,31,50),(3,6,70,152,91,136,31,50),(3,6,71,154,93,139,32,51),(3,6,72,157,94,141,32,52),(3,6,73,160,96,144,32,53),(3,6,74,163,98,146,32,53),(3,6,75,166,99,150,33,54),(3,6,76,169,101,152,33,55),(3,6,77,172,103,155,33,56),(3,6,78,176,104,157,33,56),(3,6,79,179,106,160,34,57),(3,6,80,182,108,163,34,58),(4,1,1,20,25,21,20,20),(4,1,2,21,26,22,20,20),(4,1,3,23,27,23,20,21),(4,1,4,24,27,25,20,21),(4,1,5,25,28,26,20,21),(4,1,6,27,29,27,20,21),(4,1,7,28,30,28,21,22),(4,1,8,29,31,29,21,22),(4,1,9,31,31,31,21,22),(4,1,10,32,32,32,21,23),(4,1,11,33,33,33,21,23),(4,1,12,35,34,34,21,23),(4,1,13,36,35,36,21,24),(4,1,14,38,36,37,21,24),(4,1,15,39,37,38,21,24),(4,1,16,41,37,40,21,25),(4,1,17,42,38,41,22,25),(4,1,18,44,39,43,22,25),(4,1,19,45,40,44,22,26),(4,1,20,47,41,45,22,26),(4,1,21,48,42,47,22,26),(4,1,22,50,43,48,22,27),(4,1,23,52,44,50,22,27),(4,1,24,53,45,51,23,28),(4,1,25,55,46,52,23,28),(4,1,26,56,47,54,23,28),(4,1,27,58,48,55,23,29),(4,1,28,60,49,57,23,29),(4,1,29,61,50,58,23,30),(4,1,30,63,51,60,24,30),(4,1,31,65,52,62,24,30),(4,1,32,66,53,63,24,31),(4,1,33,68,54,65,24,31),(4,1,34,70,55,66,24,32),(4,1,35,72,56,68,24,32),(4,1,36,73,58,69,25,33),(4,1,37,75,59,71,25,33),(4,1,38,77,60,73,25,34),(4,1,39,79,61,74,25,34),(4,1,40,81,62,76,25,35),(4,1,41,82,63,78,26,35),(4,1,42,84,64,79,26,35),(4,1,43,86,66,81,26,36),(4,1,44,88,67,83,26,36),(4,1,45,90,68,85,26,37),(4,1,46,92,69,86,27,37),(4,1,47,94,70,88,27,38),(4,1,48,96,72,90,27,38),(4,1,49,98,73,92,27,39),(4,1,50,100,74,93,28,40),(4,1,51,102,75,95,28,40),(4,1,52,104,77,97,28,41),(4,1,53,106,78,99,28,41),(4,1,54,108,79,101,29,42),(4,1,55,110,80,103,29,42),(4,1,56,112,82,104,29,43),(4,1,57,114,83,106,29,43),(4,1,58,116,84,108,30,44),(4,1,59,118,86,110,30,44),(4,1,60,120,87,112,30,45),(4,1,61,122,88,114,30,46),(4,1,62,124,90,116,31,46),(4,1,63,127,91,118,31,47),(4,1,64,129,92,120,31,47),(4,1,65,131,94,122,32,48),(4,1,66,133,95,124,32,49),(4,1,67,135,97,126,32,49),(4,1,68,138,98,128,32,50),(4,1,69,140,100,130,33,50),(4,1,70,142,101,132,33,51),(4,1,71,145,102,134,33,52),(4,1,72,147,104,137,33,53),(4,1,73,150,106,139,33,54),(4,1,74,153,107,142,34,54),(4,1,75,156,109,144,34,55),(4,1,76,159,111,148,34,56),(4,1,77,162,113,150,35,57),(4,1,78,165,114,152,35,57),(4,1,79,178,116,164,35,58),(4,1,80,181,118,167,36,59),(4,3,1,17,28,20,20,21),(4,3,2,17,29,21,21,22),(4,3,3,18,31,22,21,22),(4,3,4,18,32,23,22,23),(4,3,5,19,33,24,22,24),(4,3,6,19,35,25,23,24),(4,3,7,20,36,26,24,25),(4,3,8,20,38,27,24,25),(4,3,9,21,39,27,25,26),(4,3,10,21,40,28,25,27),(4,3,11,22,42,29,26,28),(4,3,12,22,43,30,27,28),(4,3,13,23,45,31,27,29),(4,3,14,23,46,32,28,30),(4,3,15,24,48,34,29,30),(4,3,16,24,50,35,29,31),(4,3,17,25,51,36,30,32),(4,3,18,25,53,37,31,33),(4,3,19,26,54,38,31,33),(4,3,20,26,56,39,32,34),(4,3,21,27,57,40,33,35),(4,3,22,27,59,41,33,36),(4,3,23,28,61,42,34,36),(4,3,24,28,62,43,35,37),(4,3,25,29,64,44,36,38),(4,3,26,30,66,46,36,39),(4,3,27,30,68,47,37,40),(4,3,28,31,69,48,38,41),(4,3,29,31,71,49,39,41),(4,3,30,32,73,50,39,42),(4,3,31,33,75,52,40,43),(4,3,32,33,76,53,41,44),(4,3,33,34,78,54,42,45),(4,3,34,34,80,55,43,46),(4,3,35,35,82,57,44,47),(4,3,36,36,84,58,44,48),(4,3,37,36,86,59,45,48),(4,3,38,37,87,60,46,49),(4,3,39,38,89,62,47,50),(4,3,40,38,91,63,48,51),(4,3,41,39,93,64,49,52),(4,3,42,40,95,66,49,53),(4,3,43,40,97,67,50,54),(4,3,44,41,99,68,51,55),(4,3,45,42,101,70,52,56),(4,3,46,42,103,71,53,57),(4,3,47,43,105,72,54,58),(4,3,48,44,107,74,55,59),(4,3,49,45,109,75,56,60),(4,3,50,45,111,77,57,61),(4,3,51,46,113,78,58,62),(4,3,52,47,115,79,59,63),(4,3,53,47,118,81,60,64),(4,3,54,48,120,82,61,65),(4,3,55,49,122,84,61,66),(4,3,56,50,124,85,62,67),(4,3,57,50,126,87,63,68),(4,3,58,51,128,88,64,69),(4,3,59,52,131,90,65,70),(4,3,60,53,133,91,66,72),(4,3,61,54,135,93,67,73),(4,3,62,54,137,94,69,74),(4,3,63,55,140,96,70,75),(4,3,64,56,142,97,71,76),(4,3,65,57,144,99,72,77),(4,3,66,58,147,101,73,78),(4,3,67,58,149,102,74,79),(4,3,68,59,151,104,75,81),(4,3,69,60,154,105,76,82),(4,3,70,61,156,107,77,83),(4,3,71,62,159,109,78,84),(4,3,72,63,162,111,79,85),(4,3,73,64,165,113,80,87),(4,3,74,65,168,115,82,88),(4,3,75,66,171,117,83,90),(4,3,76,67,174,119,84,91),(4,3,77,68,177,121,86,93),(4,3,78,69,180,123,87,94),(4,3,79,70,190,125,91,96),(4,3,80,71,193,127,93,97),(4,4,1,18,28,20,20,20),(4,4,2,19,29,21,20,20),(4,4,3,20,31,21,20,21),(4,4,4,20,32,22,20,21),(4,4,5,21,34,23,21,21),(4,4,6,22,35,24,21,22),(4,4,7,23,37,24,21,22),(4,4,8,24,38,25,21,23),(4,4,9,24,40,26,21,23),(4,4,10,25,41,26,21,23),(4,4,11,26,43,27,22,24),(4,4,12,27,44,28,22,24),(4,4,13,28,46,29,22,25),(4,4,14,29,48,30,22,25),(4,4,15,29,49,30,22,25),(4,4,16,30,51,31,23,26),(4,4,17,31,52,32,23,26),(4,4,18,32,54,33,23,27),(4,4,19,33,56,34,23,27),(4,4,20,34,57,35,23,28),(4,4,21,35,59,35,24,28),(4,4,22,36,61,36,24,29),(4,4,23,37,63,37,24,29),(4,4,24,38,64,38,24,30),(4,4,25,39,66,39,25,30),(4,4,26,40,68,40,25,31),(4,4,27,41,70,41,25,31),(4,4,28,42,72,42,25,32),(4,4,29,43,73,43,25,32),(4,4,30,44,75,43,26,33),(4,4,31,45,77,44,26,33),(4,4,32,46,79,45,26,34),(4,4,33,47,81,46,27,34),(4,4,34,48,83,47,27,35),(4,4,35,49,85,48,27,35),(4,4,36,50,87,49,27,36),(4,4,37,51,89,50,28,36),(4,4,38,52,91,51,28,37),(4,4,39,53,93,52,28,38),(4,4,40,54,95,53,28,38),(4,4,41,56,97,54,29,39),(4,4,42,57,99,55,29,39),(4,4,43,58,101,56,29,40),(4,4,44,59,103,57,30,40),(4,4,45,60,105,59,30,41),(4,4,46,61,107,60,30,42),(4,4,47,62,109,61,31,42),(4,4,48,64,112,62,31,43),(4,4,49,65,114,63,31,44),(4,4,50,66,116,64,32,44),(4,4,51,67,118,65,32,45),(4,4,52,68,120,66,32,45),(4,4,53,70,123,67,33,46),(4,4,54,71,125,69,33,47),(4,4,55,72,127,70,33,47),(4,4,56,73,129,71,34,48),(4,4,57,75,132,72,34,49),(4,4,58,76,134,73,34,49),(4,4,59,77,136,74,35,50),(4,4,60,79,139,76,35,51),(4,4,61,80,141,77,35,51),(4,4,62,81,143,78,36,52),(4,4,63,82,146,79,36,53),(4,4,64,84,148,80,37,54),(4,4,65,85,151,82,37,54),(4,4,66,87,153,83,37,55),(4,4,67,88,156,84,38,56),(4,4,68,89,158,85,38,57),(4,4,69,91,160,87,39,57),(4,4,70,92,163,88,39,58),(4,4,71,94,166,90,39,59),(4,4,72,96,169,91,40,59),(4,4,73,97,172,93,40,60),(4,4,74,99,175,94,41,61),(4,4,75,101,178,96,41,62),(4,4,76,102,181,97,41,63),(4,4,77,104,184,99,42,64),(4,4,78,106,188,101,42,65),(4,4,79,108,191,102,43,66),(4,4,80,110,194,104,43,67),(4,5,1,17,25,19,22,23),(4,5,2,17,25,19,23,24),(4,5,3,17,25,20,25,26),(4,5,4,17,26,20,26,27),(4,5,5,18,26,20,27,28),(4,5,6,18,26,21,29,30),(4,5,7,18,26,21,30,31),(4,5,8,18,26,22,31,33),(4,5,9,18,27,22,33,34),(4,5,10,19,27,22,34,36),(4,5,11,19,27,23,36,37),(4,5,12,19,27,23,37,39),(4,5,13,19,28,24,38,40),(4,5,14,19,28,24,40,42),(4,5,15,19,28,25,41,43),(4,5,16,20,28,25,43,45),(4,5,17,20,29,25,44,46),(4,5,18,20,29,26,46,48),(4,5,19,20,29,26,47,49),(4,5,20,21,30,27,49,51),(4,5,21,21,30,27,51,53),(4,5,22,21,30,28,52,54),(4,5,23,21,30,28,54,56),(4,5,24,21,31,29,55,58),(4,5,25,22,31,29,57,59),(4,5,26,22,31,30,59,61),(4,5,27,22,32,30,60,63),(4,5,28,22,32,31,62,65),(4,5,29,23,32,31,64,66),(4,5,30,23,33,32,65,68),(4,5,31,23,33,32,67,70),(4,5,32,23,33,33,69,72),(4,5,33,24,34,33,70,73),(4,5,34,24,34,34,72,75),(4,5,35,24,34,34,74,77),(4,5,36,24,35,35,76,79),(4,5,37,25,35,35,78,81),(4,5,38,25,35,36,79,83),(4,5,39,25,36,37,81,85),(4,5,40,26,36,37,83,87),(4,5,41,26,37,38,85,88),(4,5,42,26,37,38,87,90),(4,5,43,27,37,39,89,92),(4,5,44,27,38,39,91,94),(4,5,45,27,38,40,92,96),(4,5,46,27,39,41,94,98),(4,5,47,28,39,41,96,100),(4,5,48,28,39,42,98,102),(4,5,49,28,40,43,100,104),(4,5,50,29,40,43,102,106),(4,5,51,29,41,44,104,109),(4,5,52,29,41,44,106,111),(4,5,53,30,42,45,108,113),(4,5,54,30,42,46,110,115),(4,5,55,30,43,46,112,117),(4,5,56,31,43,47,114,119),(4,5,57,31,43,48,117,121),(4,5,58,31,44,48,119,124),(4,5,59,32,44,49,121,126),(4,5,60,32,45,50,123,128),(4,5,61,33,45,51,125,130),(4,5,62,33,46,51,127,132),(4,5,63,33,46,52,129,135),(4,5,64,34,47,53,132,137),(4,5,65,34,47,53,134,139),(4,5,66,34,48,54,136,142),(4,5,67,35,48,55,138,144),(4,5,68,35,49,56,140,146),(4,5,69,36,49,56,143,149),(4,5,70,36,50,57,145,151),(4,5,71,36,51,58,148,161),(4,5,72,37,51,58,151,164),(4,5,73,37,52,59,154,168),(4,5,74,38,52,60,156,171),(4,5,75,38,53,61,159,174),(4,5,76,38,54,62,162,177),(4,5,77,39,54,63,165,180),(4,5,78,39,55,64,168,183),(4,5,79,40,55,65,171,186),(4,5,80,40,56,66,200,191),(4,6,1,20,25,21,20,20),(4,6,2,21,26,22,20,20),(4,6,3,23,27,23,20,21),(4,6,4,24,27,25,20,21),(4,6,5,25,28,26,20,21),(4,6,6,27,29,27,20,21),(4,6,7,28,30,28,21,22),(4,6,8,29,31,29,21,22),(4,6,9,31,31,31,21,22),(4,6,10,32,32,32,21,23),(4,6,11,33,33,33,21,23),(4,6,12,35,34,34,21,23),(4,6,13,36,35,36,21,24),(4,6,14,38,36,37,21,24),(4,6,15,39,37,38,21,24),(4,6,16,41,37,40,21,25),(4,6,17,42,38,41,22,25),(4,6,18,44,39,43,22,25),(4,6,19,45,40,44,22,26),(4,6,20,47,41,45,22,26),(4,6,21,48,42,47,22,26),(4,6,22,50,43,48,22,27),(4,6,23,52,44,50,22,27),(4,6,24,53,45,51,23,28),(4,6,25,55,46,52,23,28),(4,6,26,56,47,54,23,28),(4,6,27,58,48,55,23,29),(4,6,28,60,49,57,23,29),(4,6,29,61,50,58,23,30),(4,6,30,63,51,60,24,30),(4,6,31,65,52,62,24,30),(4,6,32,66,53,63,24,31),(4,6,33,68,54,65,24,31),(4,6,34,70,55,66,24,32),(4,6,35,72,56,68,24,32),(4,6,36,73,58,69,25,33),(4,6,37,75,59,71,25,33),(4,6,38,77,60,73,25,34),(4,6,39,79,61,74,25,34),(4,6,40,81,62,76,25,35),(4,6,41,82,63,78,26,35),(4,6,42,84,64,79,26,35),(4,6,43,86,66,81,26,36),(4,6,44,88,67,83,26,36),(4,6,45,90,68,85,26,37),(4,6,46,92,69,86,27,37),(4,6,47,94,70,88,27,38),(4,6,48,96,72,90,27,38),(4,6,49,98,73,92,27,39),(4,6,50,100,74,93,28,40),(4,6,51,101,75,94,28,40),(4,6,52,102,76,95,28,41),(4,6,53,103,77,96,28,41),(4,6,54,104,77,97,29,42),(4,6,55,105,78,98,29,42),(4,6,56,108,80,101,29,43),(4,6,57,113,81,103,29,43),(4,6,58,115,82,105,30,44),(4,6,59,115,84,107,30,44),(4,6,60,120,85,109,30,45),(4,6,61,122,86,111,30,46),(4,6,62,122,88,113,30,46),(4,6,63,127,89,116,31,47),(4,6,64,127,91,118,31,47),(4,6,65,133,92,120,31,48),(4,6,66,135,94,123,31,49),(4,6,67,136,95,125,32,49),(4,6,68,137,97,127,32,50),(4,6,69,140,98,130,32,51),(4,6,70,147,100,132,32,51),(4,6,71,154,102,135,33,52),(4,6,72,156,103,137,33,53),(4,6,73,157,105,140,33,54),(4,6,74,158,107,142,33,54),(4,6,75,161,108,145,34,55),(4,6,76,164,110,148,34,56),(4,6,77,167,112,150,34,57),(4,6,78,170,113,153,34,57),(4,6,79,172,115,156,35,58),(4,6,80,177,117,159,35,59),(4,11,1,18,25,19,22,22),(4,11,2,19,25,20,23,23),(4,11,3,19,26,20,24,24),(4,11,4,20,26,21,25,26),(4,11,5,20,27,22,26,27),(4,11,6,21,27,22,27,28),(4,11,7,21,28,23,28,29),(4,11,8,22,28,24,29,30),(4,11,9,23,29,24,30,32),(4,11,10,23,29,25,32,33),(4,11,11,24,30,26,33,34),(4,11,12,24,31,26,34,35),(4,11,13,25,31,27,35,37),(4,11,14,26,32,28,36,38),(4,11,15,26,32,29,37,39),(4,11,16,27,33,29,38,41),(4,11,17,28,33,30,40,42),(4,11,18,28,34,31,41,43),(4,11,19,29,35,32,42,45),(4,11,20,30,35,32,43,46),(4,11,21,30,36,33,45,48),(4,11,22,31,36,34,46,49),(4,11,23,32,37,35,47,51),(4,11,24,32,38,36,48,52),(4,11,25,33,38,36,50,53),(4,11,26,34,39,37,51,55),(4,11,27,35,40,38,52,56),(4,11,28,35,40,39,54,58),(4,11,29,36,41,40,55,59),(4,11,30,37,42,41,56,61),(4,11,31,38,42,42,58,62),(4,11,32,38,43,42,59,64),(4,11,33,39,44,43,60,66),(4,11,34,40,44,44,62,67),(4,11,35,41,45,45,63,69),(4,11,36,42,46,46,65,70),(4,11,37,42,47,47,66,72),(4,11,38,43,47,48,67,74),(4,11,39,44,48,49,69,75),(4,11,40,45,49,50,70,77),(4,11,41,46,50,51,72,79),(4,11,42,46,50,52,73,80),(4,11,43,47,51,53,75,82),(4,11,44,48,52,54,76,84),(4,11,45,49,53,55,78,85),(4,11,46,50,54,56,79,87),(4,11,47,51,54,57,81,89),(4,11,48,52,55,58,83,91),(4,11,49,53,56,59,84,93),(4,11,50,53,57,60,86,94),(4,11,51,54,58,61,87,96),(4,11,52,55,59,62,89,98),(4,11,53,56,59,63,91,100),(4,11,54,57,60,64,92,102),(4,11,55,58,61,65,94,103),(4,11,56,59,62,66,95,105),(4,11,57,60,63,67,97,107),(4,11,58,61,64,68,99,109),(4,11,59,62,65,69,101,111),(4,11,60,63,66,70,102,113),(4,11,61,64,66,72,104,115),(4,11,62,65,67,73,106,117),(4,11,63,66,68,74,107,119),(4,11,64,67,69,75,109,121),(4,11,65,68,70,76,111,123),(4,11,66,69,71,77,113,125),(4,11,67,70,72,78,115,127),(4,11,68,71,73,80,116,129),(4,11,69,72,74,81,118,131),(4,11,70,73,75,82,120,133),(4,11,71,75,76,83,122,135),(4,11,72,76,78,85,125,138),(4,11,73,77,79,86,127,140),(4,11,74,78,80,88,131,143),(4,11,75,80,81,89,133,145),(4,11,76,81,82,91,134,148),(4,11,77,82,83,92,136,151),(4,11,78,84,85,94,138,153),(4,11,79,85,86,95,141,156),(4,11,80,86,87,97,143,159),(5,1,1,22,18,23,18,25),(5,1,2,23,19,24,18,25),(5,1,3,25,20,25,18,26),(5,1,4,26,20,26,18,26),(5,1,5,27,21,28,18,26),(5,1,6,29,22,29,18,26),(5,1,7,30,23,30,19,27),(5,1,8,31,24,31,19,27),(5,1,9,33,25,33,19,27),(5,1,10,34,25,34,19,28),(5,1,11,35,26,35,19,28),(5,1,12,37,27,36,19,28),(5,1,13,38,28,38,19,28),(5,1,14,40,29,39,19,29),(5,1,15,41,30,40,19,29),(5,1,16,43,31,42,20,29),(5,1,17,44,32,43,20,30),(5,1,18,46,33,44,20,30),(5,1,19,47,34,46,20,31),(5,1,20,49,34,47,20,31),(5,1,21,50,35,49,20,31),(5,1,22,52,36,50,20,32),(5,1,23,53,37,51,21,32),(5,1,24,55,38,53,21,32),(5,1,25,57,39,54,21,33),(5,1,26,58,40,56,21,33),(5,1,27,60,41,57,21,34),(5,1,28,62,42,59,21,34),(5,1,29,63,43,60,21,34),(5,1,30,65,44,62,22,35),(5,1,31,67,46,63,22,35),(5,1,32,68,47,65,22,36),(5,1,33,70,48,67,22,36),(5,1,34,72,49,68,22,36),(5,1,35,74,50,70,23,37),(5,1,36,75,51,71,23,37),(5,1,37,77,52,73,23,38),(5,1,38,79,53,75,23,38),(5,1,39,81,54,76,23,39),(5,1,40,83,55,78,24,39),(5,1,41,84,57,80,24,40),(5,1,42,86,58,81,24,40),(5,1,43,88,59,83,24,41),(5,1,44,90,60,85,24,41),(5,1,45,92,61,86,25,42),(5,1,46,94,62,88,25,42),(5,1,47,96,64,90,25,43),(5,1,48,98,65,92,25,43),(5,1,49,100,66,93,25,44),(5,1,50,102,67,95,26,44),(5,1,51,104,69,97,26,45),(5,1,52,106,70,99,26,45),(5,1,53,108,71,101,26,46),(5,1,54,110,72,103,27,46),(5,1,55,112,74,104,27,47),(5,1,56,114,75,106,27,48),(5,1,57,116,76,108,27,48),(5,1,58,118,78,110,28,49),(5,1,59,120,79,112,28,49),(5,1,60,122,80,114,28,50),(5,1,61,124,82,116,28,50),(5,1,62,126,83,118,29,51),(5,1,63,128,84,120,29,52),(5,1,64,131,86,122,29,52),(5,1,65,133,87,124,30,53),(5,1,66,135,88,126,30,53),(5,1,67,137,90,128,30,54),(5,1,68,139,91,130,30,55),(5,1,69,142,93,132,31,55),(5,1,70,144,94,134,31,56),(5,1,71,147,95,136,31,57),(5,1,72,150,97,139,31,58),(5,1,73,152,99,141,31,59),(5,1,74,155,100,144,32,59),(5,1,75,158,102,146,32,60),(5,1,76,163,104,149,32,61),(5,1,77,167,106,152,33,62),(5,1,78,167,107,154,33,62),(5,1,79,170,109,157,33,63),(5,1,80,173,111,160,34,64),(5,4,1,20,21,22,18,25),(5,4,2,21,22,23,18,25),(5,4,3,22,24,23,18,26),(5,4,4,22,25,24,18,26),(5,4,5,23,27,25,19,26),(5,4,6,24,28,25,19,27),(5,4,7,25,30,26,19,27),(5,4,8,25,31,27,19,27),(5,4,9,26,33,28,19,28),(5,4,10,27,34,28,19,28),(5,4,11,28,36,29,20,29),(5,4,12,29,38,30,20,29),(5,4,13,30,39,31,20,29),(5,4,14,31,41,32,20,30),(5,4,15,31,42,32,20,30),(5,4,16,32,44,33,21,31),(5,4,17,33,46,34,21,31),(5,4,18,34,47,35,21,32),(5,4,19,35,49,36,21,32),(5,4,20,36,51,36,21,32),(5,4,21,37,52,37,22,33),(5,4,22,38,54,38,22,33),(5,4,23,39,56,39,22,34),(5,4,24,40,58,40,22,34),(5,4,25,41,60,41,23,35),(5,4,26,42,61,42,23,35),(5,4,27,43,63,43,23,36),(5,4,28,44,65,44,23,36),(5,4,29,45,67,44,24,37),(5,4,30,46,69,45,24,37),(5,4,31,47,71,46,24,38),(5,4,32,48,72,47,24,38),(5,4,33,49,74,48,25,39),(5,4,34,50,76,49,25,39),(5,4,35,51,78,50,25,40),(5,4,36,52,80,51,25,41),(5,4,37,53,82,52,26,41),(5,4,38,54,84,53,26,42),(5,4,39,55,86,54,26,42),(5,4,40,56,88,55,27,43),(5,4,41,57,90,56,27,43),(5,4,42,59,92,57,27,44),(5,4,43,60,94,58,27,45),(5,4,44,61,96,59,28,45),(5,4,45,62,99,60,28,46),(5,4,46,63,101,61,28,46),(5,4,47,64,103,63,29,47),(5,4,48,66,105,64,29,48),(5,4,49,67,107,65,29,48),(5,4,50,68,109,66,30,49),(5,4,51,69,111,67,30,50),(5,4,52,70,114,68,30,50),(5,4,53,72,116,69,31,51),(5,4,54,73,118,70,31,52),(5,4,55,74,120,72,31,52),(5,4,56,75,123,73,32,53),(5,4,57,77,125,74,32,54),(5,4,58,78,127,75,32,54),(5,4,59,79,130,76,33,55),(5,4,60,81,132,77,33,56),(5,4,61,82,134,79,34,56),(5,4,62,83,137,80,34,57),(5,4,63,84,139,81,34,58),(5,4,64,86,141,82,35,59),(5,4,65,87,144,84,35,59),(5,4,66,88,146,85,35,60),(5,4,67,90,149,86,36,61),(5,4,68,91,151,87,36,61),(5,4,69,93,154,89,37,62),(5,4,70,94,156,90,37,63),(5,4,71,96,159,91,37,64),(5,4,72,98,162,93,38,64),(5,4,73,99,165,95,38,65),(5,4,74,101,168,96,39,66),(5,4,75,103,171,98,39,67),(5,4,76,104,174,99,39,68),(5,4,77,106,177,101,40,69),(5,4,78,108,181,103,40,70),(5,4,79,110,184,104,41,71),(5,4,80,112,187,106,41,72),(5,5,1,19,18,21,20,28),(5,5,2,19,18,21,21,29),(5,5,3,19,18,22,23,31),(5,5,4,19,19,22,24,32),(5,5,5,20,19,22,25,33),(5,5,6,20,19,23,27,35),(5,5,7,20,19,23,28,36),(5,5,8,20,20,24,29,38),(5,5,9,20,20,24,31,39),(5,5,10,20,20,24,32,40),(5,5,11,21,20,25,34,42),(5,5,12,21,21,25,35,43),(5,5,13,21,21,26,37,45),(5,5,14,21,21,26,38,46),(5,5,15,21,21,26,39,48),(5,5,16,22,22,27,41,50),(5,5,17,22,22,27,42,51),(5,5,18,22,22,28,44,53),(5,5,19,22,23,28,46,54),(5,5,20,22,23,29,47,56),(5,5,21,23,23,29,49,57),(5,5,22,23,23,30,50,59),(5,5,23,23,24,30,52,61),(5,5,24,23,24,31,53,62),(5,5,25,24,24,31,55,64),(5,5,26,24,25,32,57,66),(5,5,27,24,25,32,58,68),(5,5,28,24,25,33,60,69),(5,5,29,25,26,33,62,71),(5,5,30,25,26,34,63,73),(5,5,31,25,26,34,65,75),(5,5,32,25,27,35,67,76),(5,5,33,26,27,35,69,78),(5,5,34,26,27,36,70,80),(5,5,35,26,28,36,72,82),(5,5,36,26,28,37,74,84),(5,5,37,27,28,37,76,86),(5,5,38,27,29,38,77,87),(5,5,39,27,29,38,79,89),(5,5,40,28,30,39,81,91),(5,5,41,28,30,40,83,93),(5,5,42,28,30,40,85,95),(5,5,43,28,31,41,87,97),(5,5,44,29,31,41,89,99),(5,5,45,29,32,42,91,101),(5,5,46,29,32,43,92,103),(5,5,47,30,32,43,94,105),(5,5,48,30,33,44,96,107),(5,5,49,30,33,44,98,109),(5,5,50,31,34,45,100,111),(5,5,51,31,34,46,102,113),(5,5,52,31,35,46,104,115),(5,5,53,32,35,47,106,118),(5,5,54,32,35,48,108,120),(5,5,55,32,36,48,110,122),(5,5,56,33,36,49,113,124),(5,5,57,33,37,50,115,126),(5,5,58,33,37,50,117,128),(5,5,59,34,38,51,119,131),(5,5,60,34,38,52,121,133),(5,5,61,34,39,52,123,135),(5,5,62,35,39,53,125,137),(5,5,63,35,40,54,127,140),(5,5,64,36,40,55,130,142),(5,5,65,36,41,55,132,144),(5,5,66,36,41,56,134,147),(5,5,67,37,41,57,136,149),(5,5,68,37,42,58,138,151),(5,5,69,38,42,58,141,154),(5,5,70,38,43,59,143,156),(5,5,71,38,44,60,146,159),(5,5,72,39,44,60,149,162),(5,5,73,39,45,61,152,165),(5,5,74,40,45,62,157,168),(5,5,75,40,46,63,157,171),(5,5,76,40,47,64,160,174),(5,5,77,41,47,65,163,177),(5,5,78,41,48,66,166,180),(5,5,79,42,48,67,169,183),(5,5,80,42,49,68,172,186),(5,6,1,22,18,23,18,25),(5,6,2,23,19,24,18,25),(5,6,3,25,20,25,18,26),(5,6,4,26,20,26,18,26),(5,6,5,27,21,28,18,26),(5,6,6,29,22,29,18,26),(5,6,7,30,23,30,19,27),(5,6,8,31,24,31,19,27),(5,6,9,33,25,33,19,27),(5,6,10,34,25,34,19,28),(5,6,11,35,26,35,19,28),(5,6,12,37,27,36,19,28),(5,6,13,38,28,38,19,28),(5,6,14,40,29,39,19,29),(5,6,15,41,30,40,19,29),(5,6,16,43,31,42,20,29),(5,6,17,44,32,43,20,30),(5,6,18,46,33,44,20,30),(5,6,19,47,34,46,20,31),(5,6,20,49,34,47,20,31),(5,6,21,50,35,49,20,31),(5,6,22,52,36,50,20,32),(5,6,23,53,37,51,21,32),(5,6,24,55,38,53,21,32),(5,6,25,57,39,54,21,33),(5,6,26,58,40,56,21,33),(5,6,27,60,41,57,21,34),(5,6,28,62,42,59,21,34),(5,6,29,63,43,60,21,34),(5,6,30,65,44,62,22,35),(5,6,31,67,46,63,22,35),(5,6,32,68,47,65,22,36),(5,6,33,70,48,67,22,36),(5,6,34,72,49,68,22,36),(5,6,35,74,50,70,23,37),(5,6,36,75,51,71,23,37),(5,6,37,77,52,73,23,38),(5,6,38,79,53,75,23,38),(5,6,39,81,54,76,23,39),(5,6,40,83,55,78,24,39),(5,6,41,84,57,80,24,40),(5,6,42,86,58,81,24,40),(5,6,43,88,59,83,24,41),(5,6,44,90,60,85,24,41),(5,6,45,92,61,86,25,42),(5,6,46,94,62,88,25,42),(5,6,47,96,64,90,25,43),(5,6,48,98,65,92,25,43),(5,6,49,100,66,93,25,44),(5,6,50,102,67,95,26,44),(5,6,51,103,67,96,26,45),(5,6,52,104,68,97,26,45),(5,6,53,105,69,98,26,46),(5,6,54,106,70,99,27,46),(5,6,55,107,71,100,27,47),(5,6,56,110,73,103,27,48),(5,6,57,112,74,105,27,48),(5,6,58,114,75,107,28,49),(5,6,59,119,77,109,28,49),(5,6,60,122,78,111,28,50),(5,6,61,124,79,113,28,51),(5,6,62,127,81,115,28,51),(5,6,63,129,82,118,29,52),(5,6,64,136,84,120,29,52),(5,6,65,137,85,123,29,53),(5,6,66,138,87,125,29,54),(5,6,67,141,88,127,30,54),(5,6,68,143,90,129,30,55),(5,6,69,146,91,132,30,56),(5,6,70,149,93,134,30,56),(5,6,71,152,95,137,31,57),(5,6,72,154,96,139,31,58),(5,6,73,157,98,142,31,59),(5,6,74,158,100,145,31,59),(5,6,75,159,101,147,32,60),(5,6,76,162,103,150,32,61),(5,6,77,167,105,152,32,62),(5,6,78,173,106,155,32,62),(5,6,79,174,108,158,33,63),(5,6,80,174,110,161,33,64),(5,8,1,19,18,21,21,27),(5,8,2,19,18,21,22,28),(5,8,3,19,18,22,24,30),(5,8,4,19,18,22,25,31),(5,8,5,19,19,22,26,32),(5,8,6,19,19,22,28,34),(5,8,7,20,19,23,29,35),(5,8,8,20,19,23,31,36),(5,8,9,20,19,23,32,38),(5,8,10,20,19,24,34,39),(5,8,11,20,20,24,35,40),(5,8,12,20,20,24,37,42),(5,8,13,20,20,25,38,43),(5,8,14,20,20,25,40,45),(5,8,15,20,20,25,41,46),(5,8,16,21,21,26,43,48),(5,8,17,21,21,26,44,49),(5,8,18,21,21,26,46,51),(5,8,19,21,21,27,48,52),(5,8,20,21,21,27,49,54),(5,8,21,21,22,27,51,55),(5,8,22,21,22,28,52,57),(5,8,23,21,22,28,54,58),(5,8,24,22,22,29,56,60),(5,8,25,22,23,29,57,62),(5,8,26,22,23,29,59,63),(5,8,27,22,23,30,61,65),(5,8,28,22,23,30,63,67),(5,8,29,22,24,31,64,68),(5,8,30,23,24,31,66,70),(5,8,31,23,24,31,68,72),(5,8,32,23,24,32,70,73),(5,8,33,23,25,32,72,75),(5,8,34,23,25,33,73,77),(5,8,35,24,25,33,75,79),(5,8,36,24,25,34,77,80),(5,8,37,24,26,34,79,82),(5,8,38,24,26,35,81,84),(5,8,39,24,26,35,83,86),(5,8,40,24,27,35,85,88),(5,8,41,25,27,36,87,90),(5,8,42,25,27,36,89,91),(5,8,43,25,27,37,90,93),(5,8,44,25,28,37,92,95),(5,8,45,26,28,38,94,97),(5,8,46,26,28,38,96,99),(5,8,47,26,29,39,98,101),(5,8,48,26,29,39,100,103),(5,8,49,26,29,40,103,105),(5,8,50,27,30,40,105,107),(5,8,51,27,30,41,107,109),(5,8,52,27,30,42,109,111),(5,8,53,27,31,42,111,113),(5,8,54,28,31,43,113,115),(5,8,55,28,31,43,115,117),(5,8,56,28,32,44,117,119),(5,8,57,28,32,44,119,121),(5,8,58,29,32,45,122,123),(5,8,59,29,33,45,124,126),(5,8,60,29,33,46,126,128),(5,8,61,29,34,47,128,130),(5,8,62,30,34,47,131,132),(5,8,63,30,34,48,133,134),(5,8,64,30,35,48,135,136),(5,8,65,31,35,49,137,139),(5,8,66,31,35,50,140,141),(5,8,67,31,36,50,142,143),(5,8,68,31,36,51,144,145),(5,8,69,32,37,51,147,148),(5,8,70,32,37,52,149,150),(5,8,71,32,37,53,152,153),(5,8,72,32,38,54,155,156),(5,8,73,32,38,55,158,159),(5,8,74,33,39,55,161,161),(5,8,75,33,39,56,164,164),(5,8,76,33,39,57,167,167),(5,8,77,34,40,58,170,170),(5,8,78,34,40,58,173,173),(5,8,79,34,41,59,176,176),(5,8,80,35,41,60,179,179),(5,9,1,19,18,22,20,27),(5,9,2,19,18,23,21,28),(5,9,3,20,19,23,22,29),(5,9,4,20,19,24,24,30),(5,9,5,20,19,24,25,32),(5,9,6,20,20,25,26,33),(5,9,7,21,20,25,27,34),(5,9,8,21,21,26,28,35),(5,9,9,21,21,26,30,36),(5,9,10,22,21,27,31,38),(5,9,11,22,22,28,32,39),(5,9,12,22,22,28,34,40),(5,9,13,23,23,29,35,41),(5,9,14,23,23,30,36,43),(5,9,15,23,24,30,37,44),(5,9,16,24,24,31,39,45),(5,9,17,24,24,31,40,47),(5,9,18,24,25,32,42,48),(5,9,19,25,25,33,43,49),(5,9,20,25,26,33,44,51),(5,9,21,26,26,34,46,52),(5,9,22,26,27,35,47,53),(5,9,23,26,27,36,49,55),(5,9,24,27,28,36,50,56),(5,9,25,27,28,37,52,58),(5,9,26,27,29,38,53,59),(5,9,27,28,29,38,55,60),(5,9,28,28,30,39,56,62),(5,9,29,29,30,40,58,63),(5,9,30,29,31,41,59,65),(5,9,31,30,31,41,61,66),(5,9,32,30,32,42,62,68),(5,9,33,30,32,43,64,69),(5,9,34,31,33,44,65,71),(5,9,35,31,33,45,67,73),(5,9,36,32,34,45,69,74),(5,9,37,32,34,46,70,76),(5,9,38,33,35,47,72,77),(5,9,39,33,36,48,73,79),(5,9,40,34,36,49,75,81),(5,9,41,34,37,49,77,82),(5,9,42,35,37,50,78,84),(5,9,43,35,38,51,80,86),(5,9,44,36,39,52,82,87),(5,9,45,36,39,53,84,89),(5,9,46,37,40,54,85,91),(5,9,47,37,40,55,87,92),(5,9,48,38,41,55,89,94),(5,9,49,38,42,56,91,96),(5,9,50,39,42,57,92,98),(5,9,51,39,43,58,94,100),(5,9,52,40,44,59,96,101),(5,9,53,40,44,60,98,103),(5,9,54,41,45,61,100,105),(5,9,55,41,45,62,102,107),(5,9,56,42,46,63,103,109),(5,9,57,42,47,64,105,111),(5,9,58,43,47,65,107,112),(5,9,59,43,48,66,109,114),(5,9,60,44,49,67,111,116),(5,9,61,45,50,68,113,118),(5,9,62,45,50,69,115,120),(5,9,63,46,51,70,117,122),(5,9,64,46,52,71,119,124),(5,9,65,47,52,72,121,126),(5,9,66,48,53,73,123,128),(5,9,67,48,54,74,125,130),(5,9,68,49,55,75,127,132),(5,9,69,49,55,76,129,134),(5,9,70,50,56,77,131,136),(5,9,71,51,57,86,135,147),(5,9,72,52,57,88,136,149),(5,9,73,53,58,89,138,152),(5,9,74,53,59,90,141,155),(5,9,75,54,60,92,143,157),(5,9,76,55,61,93,146,160),(5,9,77,56,62,94,149,163),(5,9,78,56,63,96,151,166),(5,9,79,57,64,97,154,169),(5,9,80,58,65,99,157,171),(6,1,1,28,15,24,15,22),(6,1,2,29,16,25,15,22),(6,1,3,31,17,26,15,23),(6,1,4,32,17,27,15,23),(6,1,5,33,18,29,15,23),(6,1,6,34,19,30,15,23),(6,1,7,36,20,31,16,24),(6,1,8,37,21,32,16,24),(6,1,9,38,22,34,16,24),(6,1,10,40,22,35,16,25),(6,1,11,41,23,36,16,25),(6,1,12,43,24,37,16,25),(6,1,13,44,25,39,16,26),(6,1,14,46,26,40,16,26),(6,1,15,47,27,41,17,26),(6,1,16,48,28,43,17,27),(6,1,17,50,29,44,17,27),(6,1,18,51,30,45,17,27),(6,1,19,53,31,47,17,28),(6,1,20,54,32,48,17,28),(6,1,21,56,33,50,17,28),(6,1,22,58,34,51,18,29),(6,1,23,59,35,52,18,29),(6,1,24,61,36,54,18,30),(6,1,25,62,37,55,18,30),(6,1,26,64,38,57,18,30),(6,1,27,66,39,58,18,31),(6,1,28,67,40,60,18,31),(6,1,29,69,41,61,19,32),(6,1,30,71,42,63,19,32),(6,1,31,72,43,64,19,32),(6,1,32,74,44,66,19,33),(6,1,33,76,45,67,19,33),(6,1,34,77,46,69,20,34),(6,1,35,79,47,71,20,34),(6,1,36,81,48,72,20,35),(6,1,37,83,49,74,20,35),(6,1,38,85,50,76,20,35),(6,1,39,86,51,77,21,36),(6,1,40,88,53,79,21,36),(6,1,41,90,54,81,21,37),(6,1,42,92,55,82,21,37),(6,1,43,94,56,84,21,38),(6,1,44,96,57,86,22,38),(6,1,45,98,58,87,22,39),(6,1,46,99,60,89,22,39),(6,1,47,101,61,91,22,40),(6,1,48,103,62,93,22,40),(6,1,49,105,63,94,23,41),(6,1,50,107,65,96,23,41),(6,1,51,109,66,98,23,42),(6,1,52,111,67,100,23,42),(6,1,53,113,68,102,24,43),(6,1,54,115,70,104,24,44),(6,1,55,117,71,105,24,44),(6,1,56,119,72,107,24,45),(6,1,57,122,73,109,25,45),(6,1,58,124,75,111,25,46),(6,1,59,126,76,113,25,46),(6,1,60,128,77,115,25,47),(6,1,61,130,79,117,26,48),(6,1,62,132,80,119,26,48),(6,1,63,134,81,121,26,49),(6,1,64,137,83,123,26,49),(6,1,65,139,84,125,27,50),(6,1,66,141,85,127,27,51),(6,1,67,143,87,129,27,51),(6,1,68,145,88,131,27,52),(6,1,69,148,90,133,28,52),(6,1,70,150,91,135,28,53),(6,1,71,153,92,137,28,54),(6,1,72,155,94,140,28,55),(6,1,73,158,96,142,28,56),(6,1,74,161,97,145,29,56),(6,1,75,164,99,147,29,57),(6,1,76,167,101,150,29,58),(6,1,77,170,103,153,30,59),(6,1,78,173,104,155,30,59),(6,1,79,176,106,164,30,60),(6,1,80,179,108,170,31,61),(6,3,1,25,18,23,15,23),(6,3,2,25,19,24,16,24),(6,3,3,26,21,25,16,24),(6,3,4,26,22,26,17,25),(6,3,5,27,24,27,17,25),(6,3,6,27,25,28,18,26),(6,3,7,28,26,28,19,27),(6,3,8,28,28,29,19,27),(6,3,9,28,29,30,20,28),(6,3,10,29,31,31,20,29),(6,3,11,29,32,32,21,29),(6,3,12,30,34,33,22,30),(6,3,13,30,35,34,22,31),(6,3,14,31,37,35,23,32),(6,3,15,31,38,36,24,32),(6,3,16,32,40,37,24,33),(6,3,17,32,41,39,25,34),(6,3,18,33,43,40,26,35),(6,3,19,33,45,41,27,35),(6,3,20,34,46,42,27,36),(6,3,21,34,48,43,28,37),(6,3,22,35,50,44,29,38),(6,3,23,35,51,45,29,38),(6,3,24,36,53,46,30,39),(6,3,25,37,55,47,31,40),(6,3,26,37,56,48,32,41),(6,3,27,38,58,50,32,42),(6,3,28,38,60,51,33,42),(6,3,29,39,62,52,34,43),(6,3,30,39,63,53,35,44),(6,3,31,40,65,54,36,45),(6,3,32,41,67,56,36,46),(6,3,33,41,69,57,37,47),(6,3,34,42,71,58,38,48),(6,3,35,43,72,59,39,48),(6,3,36,43,74,61,40,49),(6,3,37,44,76,62,40,50),(6,3,38,45,78,63,41,51),(6,3,39,45,80,64,42,52),(6,3,40,46,82,66,43,53),(6,3,41,47,84,67,44,54),(6,3,42,47,86,68,45,55),(6,3,43,48,88,70,46,56),(6,3,44,49,90,71,46,57),(6,3,45,49,92,72,47,58),(6,3,46,50,94,74,48,59),(6,3,47,51,96,75,49,60),(6,3,48,51,98,77,50,61),(6,3,49,52,100,78,51,62),(6,3,50,53,102,79,52,63),(6,3,51,54,104,81,53,64),(6,3,52,54,106,82,54,65),(6,3,53,55,108,84,55,66),(6,3,54,56,110,85,56,67),(6,3,55,57,112,87,57,68),(6,3,56,57,114,88,58,69),(6,3,57,58,117,90,59,70),(6,3,58,59,119,91,60,71),(6,3,59,60,121,93,61,72),(6,3,60,61,123,94,62,74),(6,3,61,61,125,96,63,75),(6,3,62,62,128,97,64,76),(6,3,63,63,130,99,65,77),(6,3,64,64,132,100,66,78),(6,3,65,65,134,102,67,79),(6,3,66,66,137,104,68,80),(6,3,67,66,139,105,69,81),(6,3,68,67,141,107,70,83),(6,3,69,68,144,108,71,84),(6,3,70,69,146,110,72,85),(6,3,71,70,149,112,73,86),(6,3,72,71,152,114,74,87),(6,3,73,72,155,116,75,89),(6,3,74,73,158,118,77,90),(6,3,75,74,161,120,78,92),(6,3,76,75,164,122,79,93),(6,3,77,76,167,124,81,95),(6,3,78,77,176,126,85,96),(6,3,79,78,179,128,86,98),(6,3,80,79,183,130,88,99),(6,6,1,28,15,24,15,22),(6,6,2,29,16,25,15,22),(6,6,3,31,17,26,15,23),(6,6,4,32,17,27,15,23),(6,6,5,33,18,29,15,23),(6,6,6,34,19,30,15,23),(6,6,7,36,20,31,16,24),(6,6,8,37,21,32,16,24),(6,6,9,38,22,34,16,24),(6,6,10,40,22,35,16,25),(6,6,11,41,23,36,16,25),(6,6,12,43,24,37,16,25),(6,6,13,44,25,39,16,26),(6,6,14,46,26,40,16,26),(6,6,15,47,27,41,17,26),(6,6,16,48,28,43,17,27),(6,6,17,50,29,44,17,27),(6,6,18,51,30,45,17,27),(6,6,19,53,31,47,17,28),(6,6,20,54,32,48,17,28),(6,6,21,56,33,50,17,28),(6,6,22,58,34,51,18,29),(6,6,23,59,35,52,18,29),(6,6,24,61,36,54,18,30),(6,6,25,62,37,55,18,30),(6,6,26,64,38,57,18,30),(6,6,27,66,39,58,18,31),(6,6,28,67,40,60,18,31),(6,6,29,69,41,61,19,32),(6,6,30,71,42,63,19,32),(6,6,31,72,43,64,19,32),(6,6,32,74,44,66,19,33),(6,6,33,76,45,67,19,33),(6,6,34,77,46,69,20,34),(6,6,35,79,47,71,20,34),(6,6,36,81,48,72,20,35),(6,6,37,83,49,74,20,35),(6,6,38,85,50,76,20,35),(6,6,39,86,51,77,21,36),(6,6,40,88,53,79,21,36),(6,6,41,90,54,81,21,37),(6,6,42,92,55,82,21,37),(6,6,43,94,56,84,21,38),(6,6,44,96,57,86,22,38),(6,6,45,98,58,87,22,39),(6,6,46,99,60,89,22,39),(6,6,47,101,60,91,22,40),(6,6,48,103,61,93,22,40),(6,6,49,105,62,94,23,41),(6,6,50,107,63,96,23,41),(6,6,51,109,64,97,23,42),(6,6,52,110,65,98,23,42),(6,6,53,111,66,99,24,43),(6,6,54,112,67,100,24,44),(6,6,55,113,68,101,24,44),(6,6,56,116,70,104,24,45),(6,6,57,121,71,106,24,45),(6,6,58,123,72,108,25,46),(6,6,59,123,74,110,25,46),(6,6,60,125,75,112,25,47),(6,6,61,127,76,114,25,48),(6,6,62,133,78,116,25,48),(6,6,63,135,79,119,26,49),(6,6,64,139,81,121,26,49),(6,6,65,142,82,123,26,50),(6,6,66,146,84,126,26,51),(6,6,67,150,85,132,27,51),(6,6,68,153,87,137,27,52),(6,6,69,157,88,140,27,53),(6,6,70,160,90,143,27,53),(6,6,71,163,92,146,28,54),(6,6,72,165,93,148,28,55),(6,6,73,167,95,150,28,56),(6,6,74,171,97,153,28,56),(6,6,75,174,98,156,29,57),(6,6,76,178,100,156,29,58),(6,6,77,179,102,156,29,59),(6,6,78,179,103,156,29,59),(6,6,79,182,105,159,30,60),(6,6,80,185,107,162,30,61),(6,7,1,26,15,23,16,24),(6,7,2,27,15,24,17,25),(6,7,3,28,16,25,18,26),(6,7,4,28,16,26,19,27),(6,7,5,29,17,27,20,28),(6,7,6,30,17,28,21,29),(6,7,7,31,18,29,22,30),(6,7,8,32,18,30,23,31),(6,7,9,33,19,31,24,32),(6,7,10,34,19,32,25,33),(6,7,11,35,20,33,26,35),(6,7,12,35,20,34,27,36),(6,7,13,36,21,35,28,37),(6,7,14,37,21,36,29,38),(6,7,15,38,22,37,30,39),(6,7,16,39,22,39,31,40),(6,7,17,40,23,40,32,42),(6,7,18,41,23,41,33,43),(6,7,19,42,24,42,34,44),(6,7,20,43,24,43,35,45),(6,7,21,44,25,44,36,46),(6,7,22,45,25,45,37,48),(6,7,23,46,26,47,38,49),(6,7,24,47,27,48,40,50),(6,7,25,48,27,49,41,51),(6,7,26,49,28,50,42,53),(6,7,27,51,28,52,43,54),(6,7,28,52,29,53,44,55),(6,7,29,53,29,54,45,57),(6,7,30,54,30,55,47,58),(6,7,31,55,31,57,48,59),(6,7,32,56,31,58,49,61),(6,7,33,57,32,59,50,62),(6,7,34,58,33,61,51,64),(6,7,35,60,33,62,53,65),(6,7,36,61,34,63,54,66),(6,7,37,62,34,65,55,68),(6,7,38,63,35,66,57,69),(6,7,39,64,36,67,58,71),(6,7,40,66,36,69,59,72),(6,7,41,67,37,70,60,74),(6,7,42,68,38,72,62,75),(6,7,43,69,38,73,63,77),(6,7,44,70,39,74,64,78),(6,7,45,72,40,76,66,80),(6,7,46,73,41,77,67,81),(6,7,47,74,41,79,69,83),(6,7,48,76,42,80,70,84),(6,7,49,77,43,82,71,86),(6,7,50,78,43,83,73,88),(6,7,51,80,44,85,74,89),(6,7,52,81,45,86,76,91),(6,7,53,82,46,88,77,92),(6,7,54,84,46,90,78,94),(6,7,55,85,47,91,80,96),(6,7,56,86,48,93,81,97),(6,7,57,88,49,94,83,99),(6,7,58,89,49,96,84,101),(6,7,59,91,50,97,86,102),(6,7,60,92,51,99,87,104),(6,7,61,94,52,101,89,106),(6,7,62,95,52,102,90,108),(6,7,63,96,53,104,92,109),(6,7,64,98,54,106,93,111),(6,7,65,99,55,107,95,113),(6,7,66,101,56,109,97,115),(6,7,67,102,57,111,98,117),(6,7,68,104,57,113,100,118),(6,7,69,105,58,114,101,120),(6,7,70,107,59,116,103,122),(6,7,71,108,60,118,113,124),(6,7,72,110,61,120,117,127),(6,7,73,112,62,122,119,129),(6,7,74,114,63,125,122,131),(6,7,75,116,64,127,124,133),(6,7,76,118,65,129,126,136),(6,7,77,119,66,131,128,138),(6,7,78,121,67,133,130,140),(6,7,79,123,68,136,133,143),(6,7,80,125,69,138,135,145),(6,11,1,26,15,22,17,24),(6,11,2,27,16,23,18,25),(6,11,3,27,16,23,19,26),(6,11,4,28,17,24,20,27),(6,11,5,28,17,25,21,29),(6,11,6,29,18,25,22,30),(6,11,7,29,18,26,23,31),(6,11,8,30,19,27,24,32),(6,11,9,30,19,27,26,34),(6,11,10,31,20,28,27,35),(6,11,11,32,20,29,28,36),(6,11,12,32,21,29,29,37),(6,11,13,33,21,30,30,39),(6,11,14,33,22,31,31,40),(6,11,15,34,23,32,32,41),(6,11,16,35,23,32,34,43),(6,11,17,35,24,33,35,44),(6,11,18,36,24,34,36,45),(6,11,19,37,25,35,37,47),(6,11,20,37,26,35,39,48),(6,11,21,38,26,36,40,50),(6,11,22,39,27,37,41,51),(6,11,23,39,28,38,42,52),(6,11,24,40,28,39,44,54),(6,11,25,41,29,39,45,55),(6,11,26,41,30,40,46,57),(6,11,27,42,30,41,47,58),(6,11,28,43,31,42,49,60),(6,11,29,44,32,43,50,61),(6,11,30,44,32,44,52,63),(6,11,31,45,33,44,53,64),(6,11,32,46,34,45,54,66),(6,11,33,47,34,46,56,67),(6,11,34,47,35,47,57,69),(6,11,35,48,36,48,58,71),(6,11,36,49,36,49,60,72),(6,11,37,50,37,50,61,74),(6,11,38,51,38,51,63,76),(6,11,39,52,39,52,64,77),(6,11,40,52,39,53,66,79),(6,11,41,53,40,54,67,81),(6,11,42,54,41,55,69,82),(6,11,43,55,42,56,70,84),(6,11,44,56,43,57,72,86),(6,11,45,57,43,57,73,87),(6,11,46,57,44,58,75,89),(6,11,47,58,45,60,76,91),(6,11,48,59,46,61,78,93),(6,11,49,60,47,62,79,94),(6,11,50,61,47,63,81,96),(6,11,51,62,48,64,83,98),(6,11,52,63,49,65,84,100),(6,11,53,64,50,66,86,102),(6,11,54,65,51,67,87,104),(6,11,55,66,51,68,89,105),(6,11,56,67,52,69,91,107),(6,11,57,68,53,70,92,109),(6,11,58,69,54,71,94,111),(6,11,59,70,55,72,96,113),(6,11,60,71,56,73,97,115),(6,11,61,72,57,74,99,117),(6,11,62,73,58,76,101,119),(6,11,63,74,59,77,103,121),(6,11,64,75,59,78,104,123),(6,11,65,76,60,79,106,125),(6,11,66,77,61,80,108,127),(6,11,67,78,62,81,110,129),(6,11,68,79,63,83,111,131),(6,11,69,80,64,84,113,133),(6,11,70,81,65,85,115,135),(6,11,71,83,66,86,117,137),(6,11,72,84,68,88,120,140),(6,11,73,85,69,89,122,142),(6,11,74,86,70,91,124,145),(6,11,75,88,71,92,126,147),(6,11,76,89,72,94,128,150),(6,11,77,90,73,95,131,153),(6,11,78,92,75,97,133,155),(6,11,79,93,76,98,136,158),(6,11,80,94,77,100,138,185),(7,1,1,18,23,21,24,20),(7,1,2,19,24,22,24,20),(7,1,3,21,25,23,24,21),(7,1,4,22,25,25,24,21),(7,1,5,23,26,26,24,21),(7,1,6,25,27,27,24,21),(7,1,7,26,28,28,24,22),(7,1,8,27,29,29,25,22),(7,1,9,29,29,31,25,22),(7,1,10,30,30,32,25,23),(7,1,11,32,31,33,25,23),(7,1,12,33,32,34,25,23),(7,1,13,34,33,36,25,24),(7,1,14,36,34,37,25,24),(7,1,15,37,35,38,25,24),(7,1,16,39,36,40,25,25),(7,1,17,40,36,41,25,25),(7,1,18,42,37,43,26,25),(7,1,19,43,38,44,26,26),(7,1,20,45,39,45,26,26),(7,1,21,47,40,47,26,26),(7,1,22,48,41,48,26,27),(7,1,23,50,42,50,26,27),(7,1,24,51,43,51,26,28),(7,1,25,53,44,52,27,28),(7,1,26,55,45,54,27,28),(7,1,27,56,46,55,27,29),(7,1,28,58,47,57,27,29),(7,1,29,59,48,58,27,30),(7,1,30,61,49,60,27,30),(7,1,31,63,50,62,27,30),(7,1,32,65,51,63,28,31),(7,1,33,66,52,65,28,31),(7,1,34,68,53,66,28,32),(7,1,35,70,55,68,28,32),(7,1,36,72,56,69,28,33),(7,1,37,73,57,71,29,33),(7,1,38,75,58,73,29,34),(7,1,39,77,59,74,29,34),(7,1,40,79,60,76,29,35),(7,1,41,81,61,78,29,35),(7,1,42,82,62,79,30,35),(7,1,43,84,64,81,30,36),(7,1,44,86,65,83,30,36),(7,1,45,88,66,85,30,37),(7,1,46,90,67,86,30,37),(7,1,47,92,68,88,31,38),(7,1,48,94,70,90,31,38),(7,1,49,96,71,92,31,39),(7,1,50,98,72,93,31,40),(7,1,51,100,73,95,32,40),(7,1,52,102,75,97,32,41),(7,1,53,104,76,99,32,41),(7,1,54,106,77,101,32,42),(7,1,55,108,78,103,33,42),(7,1,56,110,80,104,33,43),(7,1,57,112,81,106,33,43),(7,1,58,114,82,108,33,44),(7,1,59,116,84,110,34,44),(7,1,60,118,85,112,34,45),(7,1,61,120,86,114,34,46),(7,1,62,122,88,116,35,46),(7,1,63,125,89,118,35,47),(7,1,64,127,91,120,35,47),(7,1,65,129,92,122,35,48),(7,1,66,131,93,124,36,49),(7,1,67,133,95,126,36,49),(7,1,68,136,96,128,36,50),(7,1,69,138,98,130,37,50),(7,1,70,140,99,132,37,51),(7,1,71,143,100,134,37,52),(7,1,72,145,102,137,37,53),(7,1,73,148,104,139,37,54),(7,1,74,151,105,142,38,54),(7,1,75,154,107,144,38,55),(7,1,76,157,109,147,38,56),(7,1,77,163,111,153,39,57),(7,1,78,169,112,158,39,57),(7,1,79,172,114,161,39,58),(7,1,80,175,116,164,40,59),(7,4,1,16,26,20,24,20),(7,4,2,17,27,21,24,20),(7,4,3,18,29,21,24,21),(7,4,4,18,30,22,24,21),(7,4,5,19,32,23,25,21),(7,4,6,20,33,24,25,22),(7,4,7,21,35,24,25,22),(7,4,8,22,36,25,25,23),(7,4,9,22,38,26,25,23),(7,4,10,23,39,26,25,23),(7,4,11,24,41,27,25,24),(7,4,12,25,42,28,26,24),(7,4,13,26,44,29,26,25),(7,4,14,27,46,30,26,25),(7,4,15,28,47,30,26,25),(7,4,16,28,49,31,26,26),(7,4,17,29,50,32,27,26),(7,4,18,30,52,33,27,27),(7,4,19,31,54,34,27,27),(7,4,20,32,56,35,27,28),(7,4,21,33,57,35,27,28),(7,4,22,34,59,36,28,29),(7,4,23,35,61,37,28,29),(7,4,24,36,62,38,28,30),(7,4,25,37,64,39,28,30),(7,4,26,38,66,40,29,31),(7,4,27,39,68,41,29,31),(7,4,28,40,70,42,29,32),(7,4,29,41,72,43,29,32),(7,4,30,42,73,43,29,33),(7,4,31,43,75,44,30,33),(7,4,32,44,77,45,30,34),(7,4,33,45,79,46,30,34),(7,4,34,46,81,47,31,35),(7,4,35,47,83,48,31,35),(7,4,36,48,85,49,31,36),(7,4,37,49,87,50,31,36),(7,4,38,50,89,51,32,37),(7,4,39,51,91,52,32,38),(7,4,40,53,93,53,32,38),(7,4,41,54,95,54,33,39),(7,4,42,55,97,55,33,39),(7,4,43,56,99,56,33,40),(7,4,44,57,101,57,33,40),(7,4,45,58,103,59,34,41),(7,4,46,59,105,60,34,42),(7,4,47,61,107,61,34,42),(7,4,48,62,110,62,35,43),(7,4,49,63,112,63,35,44),(7,4,50,64,114,64,35,44),(7,4,51,65,116,65,36,45),(7,4,52,67,118,66,36,45),(7,4,53,68,121,67,36,46),(7,4,54,69,123,69,37,47),(7,4,55,70,125,70,37,47),(7,4,56,72,127,71,37,48),(7,4,57,73,130,72,38,49),(7,4,58,74,132,73,38,49),(7,4,59,75,134,74,39,50),(7,4,60,77,137,76,39,51),(7,4,61,78,139,77,39,51),(7,4,62,79,141,78,40,52),(7,4,63,81,144,79,40,53),(7,4,64,82,146,80,41,54),(7,4,65,83,149,82,41,54),(7,4,66,85,151,83,41,55),(7,4,67,86,154,84,42,56),(7,4,68,87,156,85,42,57),(7,4,69,89,158,87,43,57),(7,4,70,90,161,88,43,58),(7,4,71,92,164,89,44,59),(7,4,72,94,167,91,45,59),(7,4,73,95,170,93,45,60),(7,4,74,97,173,94,46,61),(7,4,75,99,176,96,46,62),(7,4,76,100,179,97,46,63),(7,4,77,102,182,102,47,64),(7,4,78,104,186,105,47,65),(7,4,79,106,189,106,48,66),(7,4,80,108,192,108,48,67),(7,6,1,18,23,21,24,20),(7,6,2,19,24,22,24,20),(7,6,3,21,25,23,24,21),(7,6,4,22,25,25,24,21),(7,6,5,23,26,26,24,21),(7,6,6,25,27,27,24,21),(7,6,7,26,28,28,24,22),(7,6,8,27,29,29,25,22),(7,6,9,29,29,31,25,22),(7,6,10,30,30,32,25,23),(7,6,11,32,31,33,25,23),(7,6,12,33,32,34,25,23),(7,6,13,34,33,36,25,24),(7,6,14,36,34,37,25,24),(7,6,15,37,35,38,25,24),(7,6,16,39,36,40,25,25),(7,6,17,40,36,41,25,25),(7,6,18,42,37,43,26,25),(7,6,19,43,38,44,26,26),(7,6,20,45,39,45,26,26),(7,6,21,47,40,47,26,26),(7,6,22,48,41,48,26,27),(7,6,23,50,42,50,26,27),(7,6,24,51,43,51,26,28),(7,6,25,53,44,52,27,28),(7,6,26,55,45,54,27,28),(7,6,27,56,46,55,27,29),(7,6,28,58,47,57,27,29),(7,6,29,59,48,58,27,30),(7,6,30,61,49,60,27,30),(7,6,31,63,50,62,27,30),(7,6,32,65,51,63,28,31),(7,6,33,66,52,65,28,31),(7,6,34,68,53,66,28,32),(7,6,35,70,55,68,28,32),(7,6,36,72,56,69,28,33),(7,6,37,73,57,71,29,33),(7,6,38,75,58,73,29,34),(7,6,39,77,59,74,29,34),(7,6,40,79,60,76,29,35),(7,6,41,81,61,78,29,35),(7,6,42,82,62,79,30,35),(7,6,43,84,64,81,30,36),(7,6,44,86,65,83,30,36),(7,6,45,88,66,85,30,37),(7,6,46,90,67,86,30,37),(7,6,47,92,68,88,31,38),(7,6,48,94,70,90,31,38),(7,6,49,96,71,92,31,39),(7,6,50,98,72,93,31,40),(7,6,51,99,72,93,32,40),(7,6,52,100,73,95,32,41),(7,6,53,101,74,96,32,41),(7,6,54,102,75,97,32,42),(7,6,55,103,76,98,33,42),(7,6,56,106,78,101,33,43),(7,6,57,111,79,103,33,43),(7,6,58,113,80,105,34,44),(7,6,59,116,82,107,34,44),(7,6,60,118,83,109,34,45),(7,6,61,120,84,111,34,46),(7,6,62,127,86,119,34,46),(7,6,63,129,87,122,35,47),(7,6,64,132,89,125,35,47),(7,6,65,135,90,127,35,48),(7,6,66,137,92,130,35,49),(7,6,67,138,93,130,36,49),(7,6,68,140,95,131,36,50),(7,6,69,142,96,131,36,51),(7,6,70,145,98,132,36,51),(7,6,71,148,100,135,37,52),(7,6,72,150,101,137,37,53),(7,6,73,153,103,140,37,54),(7,6,74,154,105,142,37,54),(7,6,75,155,106,145,38,55),(7,6,76,158,108,151,38,56),(7,6,77,161,110,157,38,57),(7,6,78,164,111,162,38,57),(7,6,79,167,113,165,39,58),(7,6,80,170,115,168,39,59),(7,8,1,15,23,19,27,22),(7,8,2,15,23,19,28,23),(7,8,3,15,23,20,30,25),(7,8,4,15,23,20,31,26),(7,8,5,15,24,20,32,27),(7,8,6,15,24,20,34,29),(7,8,7,16,24,21,35,30),(7,8,8,16,24,21,37,31),(7,8,9,16,24,21,38,33),(7,8,10,16,24,22,40,34),(7,8,11,16,25,22,41,36),(7,8,12,16,25,22,42,37),(7,8,13,16,25,23,44,38),(7,8,14,16,25,23,45,40),(7,8,15,17,25,23,47,41),(7,8,16,17,25,24,49,43),(7,8,17,17,26,24,50,44),(7,8,18,17,26,24,52,46),(7,8,19,17,26,25,53,47),(7,8,20,17,26,25,55,49),(7,8,21,17,26,26,57,51),(7,8,22,18,27,26,58,52),(7,8,23,18,27,26,60,54),(7,8,24,18,27,27,61,55),(7,8,25,18,27,27,63,57),(7,8,26,18,28,27,65,59),(7,8,27,18,28,28,67,60),(7,8,28,18,28,28,68,62),(7,8,29,19,28,29,70,64),(7,8,30,19,29,29,72,65),(7,8,31,19,29,30,74,67),(7,8,32,19,29,30,75,69),(7,8,33,19,29,30,77,70),(7,8,34,20,30,31,79,72),(7,8,35,20,30,31,81,74),(7,8,36,20,30,32,83,76),(7,8,37,20,30,32,85,78),(7,8,38,20,31,33,86,79),(7,8,39,21,31,33,88,81),(7,8,40,21,31,34,90,83),(7,8,41,21,32,34,92,85),(7,8,42,21,32,35,94,87),(7,8,43,21,32,35,96,89),(7,8,44,22,32,36,98,91),(7,8,45,22,33,36,100,92),(7,8,46,22,33,37,102,94),(7,8,47,22,33,37,104,96),(7,8,48,22,34,38,106,98),(7,8,49,23,34,38,108,100),(7,8,50,23,34,39,110,102),(7,8,51,23,35,39,112,104),(7,8,52,23,35,40,114,106),(7,8,53,24,35,40,117,108),(7,8,54,24,36,41,119,110),(7,8,55,24,36,41,121,112),(7,8,56,24,37,42,123,114),(7,8,57,25,37,42,125,117),(7,8,58,25,37,43,127,119),(7,8,59,25,38,43,130,121),(7,8,60,25,38,44,132,123),(7,8,61,26,38,45,134,125),(7,8,62,26,39,45,136,127),(7,8,63,26,39,46,139,129),(7,8,64,26,40,46,141,132),(7,8,65,27,40,47,143,134),(7,8,66,27,40,48,146,136),(7,8,67,27,41,48,148,138),(7,8,68,27,41,49,150,140),(7,8,69,28,42,49,153,143),(7,8,70,28,42,50,155,145),(7,8,71,28,42,51,168,148),(7,8,72,28,43,52,168,151),(7,8,73,28,43,53,171,154),(7,8,74,29,44,53,174,156),(7,8,75,29,44,54,177,159),(7,8,76,29,44,55,180,162),(7,8,77,30,45,56,183,165),(7,8,78,30,45,56,186,168),(7,8,79,30,46,57,190,171),(7,8,80,31,46,58,193,174),(7,9,1,15,23,20,26,22),(7,9,2,15,23,21,27,23),(7,9,3,16,24,21,28,24),(7,9,4,16,24,22,29,25),(7,9,5,16,24,22,31,27),(7,9,6,17,25,23,32,28),(7,9,7,17,25,23,33,29),(7,9,8,17,26,24,34,30),(7,9,9,17,26,25,36,31),(7,9,10,18,26,25,37,33),(7,9,11,18,27,26,38,34),(7,9,12,18,27,26,39,35),(7,9,13,19,28,27,41,36),(7,9,14,19,28,28,42,38),(7,9,15,20,28,28,43,39),(7,9,16,20,29,29,45,40),(7,9,17,20,29,30,46,42),(7,9,18,21,30,30,47,43),(7,9,19,21,30,31,49,44),(7,9,20,21,31,32,50,46),(7,9,21,22,31,32,51,47),(7,9,22,22,31,33,53,49),(7,9,23,23,32,34,54,50),(7,9,24,23,32,34,56,51),(7,9,25,23,33,35,57,53),(7,9,26,24,33,36,59,54),(7,9,27,24,34,37,60,56),(7,9,28,25,34,37,62,57),(7,9,29,25,35,38,63,59),(7,9,30,25,35,39,65,60),(7,9,31,26,36,40,66,62),(7,9,32,26,36,40,68,63),(7,9,33,27,37,41,69,65),(7,9,34,27,38,42,71,66),(7,9,35,28,38,43,73,68),(7,9,36,28,39,43,74,69),(7,9,37,28,39,44,76,71),(7,9,38,29,40,45,77,73),(7,9,39,29,40,46,79,74),(7,9,40,30,41,47,81,76),(7,9,41,30,41,48,82,78),(7,9,42,31,42,48,84,79),(7,9,43,31,43,49,86,81),(7,9,44,32,43,50,88,83),(7,9,45,32,44,51,89,84),(7,9,46,33,44,52,91,86),(7,9,47,33,45,53,93,88),(7,9,48,34,46,54,95,89),(7,9,49,34,46,54,96,91),(7,9,50,35,47,55,98,93),(7,9,51,35,48,56,100,95),(7,9,52,36,48,57,102,97),(7,9,53,36,49,58,104,98),(7,9,54,37,50,59,105,100),(7,9,55,37,50,60,107,102),(7,9,56,38,51,61,109,104),(7,9,57,38,52,62,111,106),(7,9,58,39,52,63,113,108),(7,9,59,40,53,64,115,109),(7,9,60,40,54,65,117,111),(7,9,61,41,54,66,119,113),(7,9,62,41,55,67,121,115),(7,9,63,42,56,68,123,117),(7,9,64,42,57,69,125,119),(7,9,65,43,57,70,127,121),(7,9,66,44,58,71,129,123),(7,9,67,44,59,72,131,125),(7,9,68,45,59,73,133,127),(7,9,69,45,60,74,135,129),(7,9,70,46,61,75,137,131),(7,9,71,47,62,84,147,142),(7,9,72,48,62,85,148,144),(7,9,73,49,63,85,153,147),(7,9,74,49,64,88,153,150),(7,9,75,50,65,90,155,152),(7,9,76,51,66,91,158,155),(7,9,77,52,67,92,161,158),(7,9,78,52,68,93,163,161),(7,9,79,53,69,95,166,164),(7,9,80,54,70,96,170,166),(8,1,1,24,22,23,16,21),(8,1,2,25,23,24,16,21),(8,1,3,27,24,25,16,22),(8,1,4,28,24,26,16,22),(8,1,5,29,25,28,16,22),(8,1,6,31,26,29,16,22),(8,1,7,32,27,30,17,23),(8,1,8,33,28,31,17,23),(8,1,9,35,28,33,17,23),(8,1,10,36,29,34,17,24),(8,1,11,37,30,35,17,24),(8,1,12,39,31,36,17,24),(8,1,13,40,32,38,17,25),(8,1,14,42,33,39,17,25),(8,1,15,43,34,40,18,25),(8,1,16,45,35,42,18,26),(8,1,17,46,35,43,18,26),(8,1,18,48,36,44,18,26),(8,1,19,49,37,46,18,27),(8,1,20,51,38,47,18,27),(8,1,21,52,39,49,18,27),(8,1,22,54,40,50,18,28),(8,1,23,55,41,51,19,28),(8,1,24,57,42,53,19,29),(8,1,25,59,43,54,19,29),(8,1,26,60,44,56,19,29),(8,1,27,62,45,57,19,30),(8,1,28,63,46,59,19,30),(8,1,29,65,47,60,20,31),(8,1,30,67,48,62,20,31),(8,1,31,69,49,63,20,31),(8,1,32,70,50,65,20,32),(8,1,33,72,51,67,20,32),(8,1,34,74,53,68,20,33),(8,1,35,75,54,70,21,33),(8,1,36,77,55,71,21,34),(8,1,37,79,56,73,21,34),(8,1,38,81,57,75,21,35),(8,1,39,83,58,76,21,35),(8,1,40,84,59,78,22,35),(8,1,41,86,60,80,22,36),(8,1,42,88,62,81,22,36),(8,1,43,90,63,83,22,37),(8,1,44,92,64,85,22,37),(8,1,45,94,65,86,23,38),(8,1,46,96,66,88,23,38),(8,1,47,98,67,90,23,39),(8,1,48,100,69,92,23,39),(8,1,49,102,70,93,24,40),(8,1,50,103,71,95,24,40),(8,1,51,105,72,97,24,41),(8,1,52,107,74,99,24,42),(8,1,53,109,75,101,25,42),(8,1,54,112,76,103,25,43),(8,1,55,114,78,104,25,43),(8,1,56,116,79,106,25,44),(8,1,57,118,80,108,25,44),(8,1,58,120,81,110,26,45),(8,1,59,122,83,112,26,45),(8,1,60,124,84,114,26,46),(8,1,61,126,85,116,27,47),(8,1,62,128,87,118,27,47),(8,1,63,130,88,120,27,48),(8,1,64,133,90,122,27,48),(8,1,65,135,91,124,28,49),(8,1,66,137,92,126,28,50),(8,1,67,139,94,128,28,50),(8,1,68,141,95,130,28,51),(8,1,69,144,97,132,29,51),(8,1,70,146,98,134,29,52),(8,1,71,149,99,136,29,53),(8,1,72,151,101,139,29,54),(8,1,73,154,103,141,29,55),(8,1,74,157,104,144,30,55),(8,1,75,166,106,151,30,56),(8,1,76,172,108,157,30,57),(8,1,77,175,110,161,31,58),(8,1,78,179,111,163,31,58),(8,1,79,182,113,164,31,59),(8,1,80,185,115,169,32,60),(8,3,1,21,25,22,16,22),(8,3,2,21,26,23,17,23),(8,3,3,22,28,24,17,23),(8,3,4,22,29,25,18,24),(8,3,5,23,30,26,18,25),(8,3,6,23,32,27,19,25),(8,3,7,24,33,28,20,26),(8,3,8,24,35,28,20,26),(8,3,9,25,36,29,21,27),(8,3,10,25,38,30,21,28),(8,3,11,25,39,31,22,29),(8,3,12,26,41,32,23,29),(8,3,13,26,42,33,23,30),(8,3,14,27,44,34,24,31),(8,3,15,27,45,35,25,31),(8,3,16,28,47,36,25,32),(8,3,17,28,48,38,26,33),(8,3,18,29,50,39,27,34),(8,3,19,29,51,40,28,34),(8,3,20,30,53,41,28,35),(8,3,21,31,55,42,29,36),(8,3,22,31,56,43,30,37),(8,3,23,32,58,44,30,37),(8,3,24,32,60,45,31,38),(8,3,25,33,61,46,32,39),(8,3,26,33,63,48,33,40),(8,3,27,34,65,49,33,41),(8,3,28,35,66,50,34,41),(8,3,29,35,68,51,35,42),(8,3,30,36,70,52,36,43),(8,3,31,36,72,53,37,44),(8,3,32,37,73,55,37,45),(8,3,33,38,75,56,38,46),(8,3,34,38,77,57,39,47),(8,3,35,39,79,58,40,48),(8,3,36,39,81,60,41,48),(8,3,37,40,83,61,41,49),(8,3,38,41,85,62,42,50),(8,3,39,41,86,63,43,51),(8,3,40,42,88,65,44,52),(8,3,41,43,90,66,45,53),(8,3,42,43,92,67,46,54),(8,3,43,44,94,69,47,55),(8,3,44,45,96,70,47,56),(8,3,45,45,98,71,48,57),(8,3,46,46,100,73,49,58),(8,3,47,47,102,74,50,59),(8,3,48,48,104,76,51,60),(8,3,49,48,106,77,52,61),(8,3,50,49,108,78,53,62),(8,3,51,50,110,80,54,63),(8,3,52,51,113,81,55,64),(8,3,53,51,115,83,56,65),(8,3,54,52,117,84,57,66),(8,3,55,53,119,86,58,67),(8,3,56,54,121,87,59,68),(8,3,57,54,123,89,60,69),(8,3,58,55,126,90,61,70),(8,3,59,56,128,92,62,71),(8,3,60,57,130,93,63,73),(8,3,61,58,132,95,64,74),(8,3,62,58,134,96,65,75),(8,3,63,59,137,98,66,76),(8,3,64,60,139,99,67,77),(8,3,65,61,141,101,68,78),(8,3,66,62,144,103,69,79),(8,3,67,62,146,104,70,80),(8,3,68,63,148,106,71,82),(8,3,69,64,151,107,72,83),(8,3,70,65,153,109,73,84),(8,3,71,66,156,111,74,85),(8,3,72,67,159,113,75,86),(8,3,73,68,162,115,76,88),(8,3,74,69,165,117,78,89),(8,3,75,70,174,119,82,91),(8,3,76,71,177,121,83,92),(8,3,77,72,180,123,85,94),(8,3,78,73,184,125,86,95),(8,3,79,74,187,127,87,97),(8,3,80,75,190,129,89,98),(8,4,1,22,25,22,16,21),(8,4,2,23,26,23,16,21),(8,4,3,24,28,23,16,22),(8,4,4,24,29,24,16,22),(8,4,5,25,31,25,17,22),(8,4,6,26,32,25,17,23),(8,4,7,27,34,26,17,23),(8,4,8,27,35,27,17,24),(8,4,9,28,37,28,17,24),(8,4,10,29,38,28,18,24),(8,4,11,30,40,29,18,25),(8,4,12,31,41,30,18,25),(8,4,13,32,43,31,18,26),(8,4,14,32,45,32,18,26),(8,4,15,33,46,32,19,26),(8,4,16,34,48,33,19,27),(8,4,17,35,50,34,19,27),(8,4,18,36,51,35,19,28),(8,4,19,37,53,36,19,28),(8,4,20,38,55,36,20,29),(8,4,21,39,56,37,20,29),(8,4,22,40,58,38,20,30),(8,4,23,41,60,39,20,30),(8,4,24,42,62,40,20,31),(8,4,25,43,63,41,21,31),(8,4,26,44,65,42,21,32),(8,4,27,45,67,43,21,32),(8,4,28,46,69,44,21,33),(8,4,29,47,71,44,22,33),(8,4,30,48,72,45,22,34),(8,4,31,49,74,46,22,34),(8,4,32,50,76,47,22,35),(8,4,33,51,78,48,23,35),(8,4,34,52,80,49,23,36),(8,4,35,53,82,50,23,36),(8,4,36,54,84,51,24,37),(8,4,37,55,86,52,24,37),(8,4,38,56,88,53,24,38),(8,4,39,57,90,54,24,38),(8,4,40,58,92,55,25,39),(8,4,41,59,94,56,25,40),(8,4,42,60,96,57,25,40),(8,4,43,62,98,58,26,41),(8,4,44,63,100,59,26,41),(8,4,45,64,102,60,26,42),(8,4,46,65,104,61,27,43),(8,4,47,66,107,63,27,43),(8,4,48,67,109,64,27,44),(8,4,49,69,111,65,27,44),(8,4,50,70,113,66,28,45),(8,4,51,71,115,67,28,46),(8,4,52,72,117,68,28,46),(8,4,53,74,120,69,29,47),(8,4,54,75,122,70,29,48),(8,4,55,76,124,72,29,48),(8,4,56,77,126,73,30,49),(8,4,57,79,129,74,30,50),(8,4,58,80,131,75,30,50),(8,4,59,81,133,76,31,51),(8,4,60,82,136,77,31,52),(8,4,61,84,138,79,32,52),(8,4,62,85,140,80,32,53),(8,4,63,86,143,81,32,54),(8,4,64,88,145,82,33,55),(8,4,65,89,148,84,33,55),(8,4,66,90,150,85,33,56),(8,4,67,92,153,86,34,57),(8,4,68,93,155,87,34,58),(8,4,69,95,157,89,35,58),(8,4,70,96,160,90,35,59),(8,4,71,98,163,94,35,60),(8,4,72,100,166,96,36,60),(8,4,73,101,169,96,36,61),(8,4,74,103,172,97,37,62),(8,4,75,105,175,98,37,63),(8,4,76,106,178,99,37,64),(8,4,77,108,181,105,38,65),(8,4,78,110,185,107,38,66),(8,4,79,112,188,109,39,67),(8,4,80,114,191,110,39,68),(8,5,1,21,22,21,18,24),(8,5,2,21,22,21,19,25),(8,5,3,21,22,22,21,27),(8,5,4,21,23,22,22,28),(8,5,5,22,23,22,23,29),(8,5,6,22,23,23,25,31),(8,5,7,22,23,23,26,32),(8,5,8,22,24,24,27,34),(8,5,9,22,24,24,29,35),(8,5,10,22,24,24,30,37),(8,5,11,23,24,25,32,38),(8,5,12,23,24,25,33,40),(8,5,13,23,25,26,35,41),(8,5,14,23,25,26,36,43),(8,5,15,23,25,26,38,44),(8,5,16,24,26,27,39,46),(8,5,17,24,26,27,41,47),(8,5,18,24,26,28,42,49),(8,5,19,24,26,28,44,50),(8,5,20,24,27,29,45,52),(8,5,21,25,27,29,47,54),(8,5,22,25,27,30,48,55),(8,5,23,25,28,30,50,57),(8,5,24,25,28,31,52,59),(8,5,25,25,28,31,53,60),(8,5,26,26,28,32,55,62),(8,5,27,26,29,32,56,64),(8,5,28,26,29,33,58,65),(8,5,29,26,29,33,60,67),(8,5,30,27,30,34,62,69),(8,5,31,27,30,34,63,71),(8,5,32,27,30,35,65,73),(8,5,33,27,31,35,67,74),(8,5,34,28,31,36,68,76),(8,5,35,28,32,36,70,78),(8,5,36,28,32,37,72,80),(8,5,37,29,32,37,74,82),(8,5,38,29,33,38,76,84),(8,5,39,29,33,38,77,86),(8,5,40,29,33,39,79,87),(8,5,41,30,34,40,81,89),(8,5,42,30,34,40,83,91),(8,5,43,30,35,41,85,93),(8,5,44,31,35,41,87,95),(8,5,45,31,35,42,89,97),(8,5,46,31,36,43,91,99),(8,5,47,32,36,43,93,101),(8,5,48,32,37,44,94,103),(8,5,49,32,37,44,96,105),(8,5,50,33,37,45,98,107),(8,5,51,33,38,46,100,110),(8,5,52,33,38,46,102,112),(8,5,53,34,39,47,104,114),(8,5,54,34,39,48,106,116),(8,5,55,34,40,48,109,118),(8,5,56,35,40,49,111,120),(8,5,57,35,41,50,113,122),(8,5,58,35,41,50,115,125),(8,5,59,36,42,51,117,127),(8,5,60,36,42,52,119,129),(8,5,61,36,42,52,121,131),(8,5,62,37,43,53,123,133),(8,5,63,37,43,54,125,136),(8,5,64,38,44,55,128,138),(8,5,65,38,44,55,130,140),(8,5,66,38,45,56,132,143),(8,5,67,39,45,57,134,145),(8,5,68,39,46,58,136,147),(8,5,69,40,46,58,139,150),(8,5,70,40,47,59,141,152),(8,5,71,40,48,60,144,155),(8,5,72,41,48,60,147,158),(8,5,73,41,49,61,150,161),(8,5,74,42,49,62,152,164),(8,5,75,42,50,63,155,167),(8,5,76,42,51,64,158,170),(8,5,77,43,51,65,161,173),(8,5,78,43,52,66,164,176),(8,5,79,44,52,67,167,179),(8,5,80,44,53,68,170,182),(8,6,1,24,22,23,16,21),(8,6,2,25,23,24,16,21),(8,6,3,27,24,25,16,22),(8,6,4,28,24,26,16,22),(8,6,5,29,25,28,16,22),(8,6,6,31,26,29,16,22),(8,6,7,32,27,30,17,23),(8,6,8,33,28,31,17,23),(8,6,9,35,28,33,17,23),(8,6,10,36,29,34,17,24),(8,6,11,37,30,35,17,24),(8,6,12,39,31,36,17,24),(8,6,13,40,32,38,17,25),(8,6,14,42,33,39,17,25),(8,6,15,43,34,40,18,25),(8,6,16,45,35,42,18,26),(8,6,17,46,35,43,18,26),(8,6,18,48,36,44,18,26),(8,6,19,49,37,46,18,27),(8,6,20,51,38,47,18,27),(8,6,21,52,39,49,18,27),(8,6,22,54,40,50,18,28),(8,6,23,55,41,51,19,28),(8,6,24,57,42,53,19,29),(8,6,25,59,43,54,19,29),(8,6,26,60,44,56,19,29),(8,6,27,62,45,57,19,30),(8,6,28,63,46,59,19,30),(8,6,29,65,47,60,20,31),(8,6,30,67,48,62,20,31),(8,6,31,69,49,63,20,31),(8,6,32,70,50,65,20,32),(8,6,33,72,51,67,20,32),(8,6,34,74,53,68,20,33),(8,6,35,75,54,70,21,33),(8,6,36,77,55,71,21,34),(8,6,37,79,56,73,21,34),(8,6,38,81,57,75,21,35),(8,6,39,83,58,76,21,35),(8,6,40,84,59,78,22,35),(8,6,41,86,60,80,22,36),(8,6,42,88,62,81,22,36),(8,6,43,90,63,83,22,37),(8,6,44,92,64,85,22,37),(8,6,45,94,65,86,23,38),(8,6,46,96,66,88,23,38),(8,6,47,98,67,90,23,39),(8,6,48,100,69,92,23,39),(8,6,49,102,70,93,24,40),(8,6,50,103,71,95,24,40),(8,6,51,105,72,96,24,41),(8,6,52,106,74,97,24,42),(8,6,53,107,73,98,25,42),(8,6,54,108,74,99,25,43),(8,6,55,109,75,100,25,43),(8,6,56,112,77,103,25,44),(8,6,57,114,78,105,25,44),(8,6,58,118,79,107,26,45),(8,6,59,119,81,109,26,45),(8,6,60,121,82,111,26,46),(8,6,61,123,83,113,26,47),(8,6,62,126,85,115,26,47),(8,6,63,128,86,118,27,48),(8,6,64,131,88,120,27,48),(8,6,65,138,89,122,27,49),(8,6,66,140,91,125,27,50),(8,6,67,143,92,127,28,50),(8,6,68,145,94,129,28,51),(8,6,69,148,95,132,28,52),(8,6,70,151,97,134,28,52),(8,6,71,154,99,137,29,53),(8,6,72,156,100,139,29,54),(8,6,73,159,102,142,29,55),(8,6,74,162,104,144,29,55),(8,6,75,165,105,147,30,56),(8,6,76,168,107,150,30,57),(8,6,77,169,109,153,30,58),(8,6,78,170,110,155,30,58),(8,6,79,178,112,158,31,59),(8,6,80,181,114,161,31,60),(8,7,1,22,22,22,17,23),(8,7,2,23,22,23,18,24),(8,7,3,24,23,24,19,25),(8,7,4,25,23,25,20,26),(8,7,5,25,24,26,21,27),(8,7,6,26,24,27,22,28),(8,7,7,27,25,28,23,29),(8,7,8,28,25,29,24,30),(8,7,9,29,25,30,25,31),(8,7,10,30,26,31,26,33),(8,7,11,31,26,32,27,34),(8,7,12,32,27,33,28,35),(8,7,13,33,27,34,29,36),(8,7,14,34,28,35,30,37),(8,7,15,34,28,36,31,38),(8,7,16,35,29,38,32,39),(8,7,17,36,29,39,33,41),(8,7,18,37,30,40,34,42),(8,7,19,38,30,41,35,43),(8,7,20,39,31,42,36,44),(8,7,21,40,32,43,37,45),(8,7,22,41,32,45,38,47),(8,7,23,43,33,46,39,48),(8,7,24,44,33,47,40,49),(8,7,25,45,34,48,42,51),(8,7,26,46,34,49,43,52),(8,7,27,47,35,51,44,53),(8,7,28,48,35,52,45,54),(8,7,29,49,36,53,46,56),(8,7,30,50,37,54,48,57),(8,7,31,51,37,56,49,59),(8,7,32,52,38,57,50,60),(8,7,33,53,38,58,51,61),(8,7,34,55,39,60,52,63),(8,7,35,56,40,61,54,64),(8,7,36,57,40,62,55,66),(8,7,37,58,41,64,56,67),(8,7,38,59,42,65,57,68),(8,7,39,61,42,66,59,70),(8,7,40,62,43,68,60,71),(8,7,41,63,44,69,61,73),(8,7,42,64,44,71,63,74),(8,7,43,65,45,72,64,76),(8,7,44,67,46,74,65,77),(8,7,45,68,46,75,67,79),(8,7,46,69,47,76,68,80),(8,7,47,71,48,78,69,82),(8,7,48,72,49,79,71,83),(8,7,49,73,49,81,72,85),(8,7,50,74,50,82,74,87),(8,7,51,76,51,84,75,88),(8,7,52,77,51,85,77,90),(8,7,53,78,52,87,78,92),(8,7,54,80,53,89,79,93),(8,7,55,81,54,90,81,95),(8,7,56,83,55,92,82,96),(8,7,57,84,55,93,84,98),(8,7,58,85,56,95,85,100),(8,7,59,87,57,97,87,102),(8,7,60,88,58,98,88,103),(8,7,61,90,58,100,90,105),(8,7,62,91,59,101,91,107),(8,7,63,93,60,103,93,108),(8,7,64,94,61,105,94,110),(8,7,65,95,62,106,96,112),(8,7,66,97,63,108,98,114),(8,7,67,98,63,110,99,116),(8,7,68,100,64,112,101,117),(8,7,69,101,65,113,102,119),(8,7,70,103,66,115,104,121),(8,7,71,104,67,117,116,123),(8,7,72,106,68,119,118,126),(8,7,73,108,69,121,121,128),(8,7,74,110,70,124,123,130),(8,7,75,112,71,126,125,132),(8,7,76,114,72,128,127,135),(8,7,77,115,73,130,129,137),(8,7,78,117,74,132,132,139),(8,7,79,119,75,135,134,142),(8,7,80,121,76,137,136,144),(8,8,1,21,22,21,19,23),(8,8,2,21,22,21,20,24),(8,8,3,21,22,22,22,26),(8,8,4,21,22,22,23,27),(8,8,5,21,23,22,25,28),(8,8,6,21,23,22,26,30),(8,8,7,21,23,23,27,31),(8,8,8,22,23,23,29,32),(8,8,9,22,23,23,30,34),(8,8,10,22,23,24,32,35),(8,8,11,22,24,24,33,37),(8,8,12,22,24,24,35,38),(8,8,13,22,24,25,36,39),(8,8,14,22,24,25,38,41),(8,8,15,22,24,25,39,42),(8,8,16,22,24,26,41,44),(8,8,17,23,25,26,42,45),(8,8,18,23,25,26,44,47),(8,8,19,23,25,27,46,48),(8,8,20,23,25,27,47,50),(8,8,21,23,25,27,49,51),(8,8,22,23,26,28,51,53),(8,8,23,23,26,28,52,55),(8,8,24,24,26,29,54,56),(8,8,25,24,26,29,56,58),(8,8,26,24,27,29,57,60),(8,8,27,24,27,30,59,61),(8,8,28,24,27,30,61,63),(8,8,29,24,27,31,63,65),(8,8,30,24,28,31,64,66),(8,8,31,25,28,31,66,68),(8,8,32,25,28,32,68,70),(8,8,33,25,28,32,70,71),(8,8,34,25,29,33,71,73),(8,8,35,25,29,33,73,75),(8,8,36,26,29,34,75,77),(8,8,37,26,29,34,77,79),(8,8,38,26,30,35,79,80),(8,8,39,26,30,35,81,82),(8,8,40,26,30,35,83,84),(8,8,41,27,31,36,85,86),(8,8,42,27,31,36,87,88),(8,8,43,27,31,37,89,90),(8,8,44,27,32,37,91,91),(8,8,45,27,32,38,93,93),(8,8,46,28,32,38,95,95),(8,8,47,28,32,39,97,97),(8,8,48,28,33,39,99,99),(8,8,49,28,33,40,101,101),(8,8,50,29,33,40,103,103),(8,8,51,29,34,41,105,105),(8,8,52,29,34,42,107,107),(8,8,53,29,35,42,109,109),(8,8,54,30,35,43,111,111),(8,8,55,30,35,43,113,113),(8,8,56,30,36,44,115,115),(8,8,57,30,36,44,118,118),(8,8,58,31,36,45,120,120),(8,8,59,31,37,45,122,122),(8,8,60,31,37,46,124,124),(8,8,61,31,37,47,126,126),(8,8,62,32,38,47,129,128),(8,8,63,32,38,48,131,130),(8,8,64,32,39,48,133,133),(8,8,65,33,39,49,135,135),(8,8,66,33,39,50,138,137),(8,8,67,33,40,50,140,139),(8,8,68,33,40,51,142,141),(8,8,69,34,41,51,145,144),(8,8,70,34,41,52,147,146),(8,8,71,34,41,53,150,149),(8,8,72,34,42,54,153,152),(8,8,73,34,42,55,156,155),(8,8,74,35,43,55,159,157),(8,8,75,35,43,56,162,160),(8,8,76,35,43,57,168,163),(8,8,77,36,44,58,168,166),(8,8,78,36,44,58,171,169),(8,8,79,36,45,59,177,172),(8,8,80,37,45,60,177,175),(10,2,1,19,22,21,24,20),(10,2,2,20,23,22,25,21),(10,2,3,21,23,23,25,21),(10,2,4,22,24,24,26,22),(10,2,5,23,24,25,27,23),(10,2,6,25,25,26,27,24),(10,2,7,26,25,27,28,24),(10,2,8,27,26,28,29,25),(10,2,9,28,27,29,29,26),(10,2,10,29,27,31,30,26),(10,2,11,30,28,32,31,27),(10,2,12,32,29,33,31,28),(10,2,13,33,29,34,32,29),(10,2,14,34,30,35,33,30),(10,2,15,35,31,36,33,30),(10,2,16,37,31,37,34,31),(10,2,17,38,32,39,35,32),(10,2,18,39,33,40,36,33),(10,2,19,40,33,41,36,34),(10,2,20,42,34,42,37,35),(10,2,21,43,35,44,38,35),(10,2,22,44,35,45,39,36),(10,2,23,46,36,46,40,37),(10,2,24,47,37,47,40,38),(10,2,25,49,38,49,41,39),(10,2,26,50,38,50,42,40),(10,2,27,51,39,51,43,41),(10,2,28,53,40,53,44,42),(10,2,29,54,41,54,45,43),(10,2,30,56,41,55,45,43),(10,2,31,57,42,57,46,44),(10,2,32,58,43,58,47,45),(10,2,33,60,44,59,48,46),(10,2,34,61,45,61,49,47),(10,2,35,63,45,62,50,48),(10,2,36,64,46,64,51,49),(10,2,37,66,47,65,52,50),(10,2,38,67,48,67,53,51),(10,2,39,69,49,68,54,52),(10,2,40,71,50,69,55,53),(10,2,41,72,50,71,55,54),(10,2,42,74,51,72,56,55),(10,2,43,75,52,74,57,56),(10,2,44,77,53,75,58,57),(10,2,45,79,54,77,59,59),(10,2,46,80,55,78,60,60),(10,2,47,82,56,80,61,61),(10,2,48,83,57,82,62,62),(10,2,49,85,58,83,63,63),(10,2,50,87,59,85,64,64),(10,2,51,89,60,86,66,65),(10,2,52,90,61,88,67,66),(10,2,53,92,61,90,68,67),(10,2,54,94,62,91,69,69),(10,2,55,95,63,93,70,70),(10,2,56,97,64,95,71,71),(10,2,57,99,65,96,72,72),(10,2,58,101,66,98,73,73),(10,2,59,102,67,100,74,74),(10,2,60,104,68,101,75,76),(10,2,61,106,69,103,76,77),(10,2,62,108,70,105,78,78),(10,2,63,110,72,106,79,79),(10,2,64,112,73,108,80,80),(10,2,65,113,74,110,81,82),(10,2,66,115,75,112,82,83),(10,2,67,117,76,114,83,84),(10,2,68,119,77,115,85,85),(10,2,69,121,78,117,86,87),(10,2,70,123,79,119,87,88),(10,2,71,125,80,120,88,89),(10,2,72,128,81,123,90,91),(10,2,73,130,82,125,91,93),(10,2,74,133,84,127,93,94),(10,2,75,135,85,129,94,96),(10,2,76,137,86,132,96,97),(10,2,77,140,88,134,97,99),(10,2,78,143,89,136,99,101),(10,2,79,145,90,139,100,102),(10,2,80,148,92,141,102,104),(10,3,1,17,25,20,24,20),(10,3,2,17,26,21,25,21),(10,3,3,18,28,22,25,21),(10,3,4,18,29,23,26,22),(10,3,5,19,30,24,26,23),(10,3,6,19,32,25,27,23),(10,3,7,20,33,26,27,24),(10,3,8,20,35,27,28,25),(10,3,9,21,36,27,29,25),(10,3,10,21,38,28,29,26),(10,3,11,22,39,29,30,27),(10,3,12,22,41,30,31,27),(10,3,13,23,42,31,31,28),(10,3,14,23,44,32,32,29),(10,3,15,24,45,34,32,29),(10,3,16,24,47,35,33,30),(10,3,17,25,48,36,34,31),(10,3,18,25,50,37,34,32),(10,3,19,26,51,38,35,32),(10,3,20,26,53,39,36,33),(10,3,21,27,55,40,37,34),(10,3,22,27,56,41,37,35),(10,3,23,28,58,42,38,36),(10,3,24,28,60,43,39,36),(10,3,25,29,61,44,39,37),(10,3,26,30,63,46,40,38),(10,3,27,30,65,47,41,39),(10,3,28,31,66,48,42,40),(10,3,29,31,68,49,42,40),(10,3,30,32,70,50,43,41),(10,3,31,33,72,52,44,42),(10,3,32,33,73,53,45,43),(10,3,33,34,75,54,46,44),(10,3,34,34,77,55,46,45),(10,3,35,35,79,57,47,46),(10,3,36,36,81,58,48,47),(10,3,37,36,83,59,49,47),(10,3,38,37,85,60,50,48),(10,3,39,38,86,62,51,49),(10,3,40,38,88,63,51,50),(10,3,41,39,90,64,52,51),(10,3,42,40,92,66,53,52),(10,3,43,40,94,67,54,53),(10,3,44,41,96,68,55,54),(10,3,45,42,98,70,56,55),(10,3,46,42,100,71,57,56),(10,3,47,43,102,72,58,57),(10,3,48,44,104,74,59,58),(10,3,49,45,106,75,60,59),(10,3,50,45,108,77,61,60),(10,3,51,46,110,78,61,61),(10,3,52,47,113,79,62,62),(10,3,53,47,115,81,63,63),(10,3,54,48,117,82,64,64),(10,3,55,49,119,84,65,65),(10,3,56,50,121,85,66,66),(10,3,57,50,123,87,67,67),(10,3,58,51,126,88,68,68),(10,3,59,52,128,90,69,70),(10,3,60,53,130,91,70,71),(10,3,61,54,132,93,71,72),(10,3,62,54,134,94,72,73),(10,3,63,55,137,96,73,74),(10,3,64,56,139,97,75,75),(10,3,65,57,141,99,76,76),(10,3,66,58,144,101,77,77),(10,3,67,58,146,102,78,78),(10,3,68,59,148,104,79,80),(10,3,69,60,151,105,80,81),(10,3,70,61,153,107,81,82),(10,3,71,62,156,108,82,83),(10,3,72,63,159,110,83,84),(10,3,73,64,162,112,84,86),(10,3,74,65,165,114,86,87),(10,3,75,66,168,116,87,89),(10,3,76,67,171,118,89,90),(10,3,77,68,174,120,90,92),(10,3,78,69,177,122,91,93),(10,3,79,70,180,124,92,95),(10,3,80,71,183,126,94,96),(10,4,1,18,25,20,24,19),(10,4,2,19,26,21,24,19),(10,4,3,20,28,21,24,20),(10,4,4,20,29,22,24,20),(10,4,5,21,31,23,25,20),(10,4,6,22,32,24,25,21),(10,4,7,23,34,24,25,21),(10,4,8,24,35,25,25,22),(10,4,9,24,37,26,25,22),(10,4,10,25,38,26,25,22),(10,4,11,26,40,27,25,23),(10,4,12,27,41,28,26,23),(10,4,13,28,43,29,26,24),(10,4,14,29,45,30,26,24),(10,4,15,29,46,30,26,25),(10,4,16,30,48,31,26,25),(10,4,17,31,50,32,27,25),(10,4,18,32,51,33,27,26),(10,4,19,33,53,34,27,26),(10,4,20,34,55,35,27,27),(10,4,21,35,56,35,27,27),(10,4,22,36,58,36,28,28),(10,4,23,37,60,37,28,28),(10,4,24,38,62,38,28,29),(10,4,25,39,63,39,28,29),(10,4,26,40,65,40,29,30),(10,4,27,41,67,41,29,30),(10,4,28,42,69,42,29,31),(10,4,29,43,71,43,29,31),(10,4,30,44,72,43,29,32),(10,4,31,45,74,44,30,32),(10,4,32,46,76,45,30,33),(10,4,33,47,78,46,30,33),(10,4,34,48,80,47,31,34),(10,4,35,49,82,48,31,34),(10,4,36,50,84,49,31,35),(10,4,37,51,86,50,31,35),(10,4,38,52,88,51,32,36),(10,4,39,53,90,52,32,37),(10,4,40,54,92,53,32,37),(10,4,41,56,94,54,33,38),(10,4,42,57,96,55,33,38),(10,4,43,58,98,56,33,39),(10,4,44,59,100,57,33,39),(10,4,45,60,102,59,34,40),(10,4,46,61,104,60,34,41),(10,4,47,62,107,61,34,41),(10,4,48,64,109,62,35,42),(10,4,49,65,111,63,35,43),(10,4,50,66,113,64,35,43),(10,4,51,67,115,65,36,44),(10,4,52,68,117,66,36,44),(10,4,53,70,120,67,36,45),(10,4,54,71,122,69,37,46),(10,4,55,72,124,70,37,46),(10,4,56,73,126,71,37,47),(10,4,57,75,129,72,38,48),(10,4,58,76,131,73,38,48),(10,4,59,77,133,74,39,49),(10,4,60,79,136,76,39,50),(10,4,61,80,138,77,39,51),(10,4,62,81,140,78,40,51),(10,4,63,82,143,79,40,52),(10,4,64,84,145,80,41,53),(10,4,65,85,148,82,41,53),(10,4,66,87,150,83,41,54),(10,4,67,88,153,84,42,55),(10,4,68,89,155,85,42,56),(10,4,69,91,157,87,43,56),(10,4,70,92,160,88,43,57),(10,4,71,94,163,88,43,58),(10,4,72,96,166,90,44,58),(10,4,73,97,169,92,44,59),(10,4,74,99,172,93,45,60),(10,4,75,101,175,95,45,61),(10,4,76,102,178,96,45,62),(10,4,77,104,181,101,46,63),(10,4,78,106,185,104,46,64),(10,4,79,108,188,105,47,65),(10,4,80,110,191,107,47,66),(10,5,1,17,22,19,26,22),(10,5,2,17,22,19,27,23),(10,5,3,17,22,20,29,25),(10,5,4,17,23,20,30,26),(10,5,5,18,23,20,31,27),(10,5,6,18,23,21,33,29),(10,5,7,18,23,21,34,30),(10,5,8,18,24,22,35,32),(10,5,9,18,24,22,37,33),(10,5,10,19,24,22,38,35),(10,5,11,19,24,23,39,36),(10,5,12,19,24,23,41,38),(10,5,13,19,25,24,42,39),(10,5,14,19,25,24,44,41),(10,5,15,19,25,25,45,42),(10,5,16,20,26,25,47,44),(10,5,17,20,26,25,48,45),(10,5,18,20,26,26,50,47),(10,5,19,20,26,26,51,49),(10,5,20,21,27,27,53,50),(10,5,21,21,27,27,54,52),(10,5,22,21,27,28,56,53),(10,5,23,21,28,28,58,55),(10,5,24,21,28,29,59,57),(10,5,25,22,28,29,61,58),(10,5,26,22,28,30,62,60),(10,5,27,22,29,30,64,62),(10,5,28,22,29,31,66,64),(10,5,29,23,29,31,67,65),(10,5,30,23,30,32,69,67),(10,5,31,23,30,32,71,69),(10,5,32,23,30,33,72,71),(10,5,33,24,31,33,74,72),(10,5,34,24,31,34,76,74),(10,5,35,24,32,34,78,76),(10,5,36,24,32,35,80,78),(10,5,37,25,32,35,81,80),(10,5,38,25,33,36,83,82),(10,5,39,25,33,37,85,84),(10,5,40,26,33,37,87,86),(10,5,41,26,34,38,89,88),(10,5,42,26,34,38,91,89),(10,5,43,27,35,39,92,91),(10,5,44,27,35,39,94,93),(10,5,45,27,35,40,96,95),(10,5,46,27,36,41,98,97),(10,5,47,28,36,41,100,99),(10,5,48,28,37,42,102,101),(10,5,49,28,37,43,104,103),(10,5,50,29,37,43,106,106),(10,5,51,29,38,44,108,108),(10,5,52,29,38,44,110,110),(10,5,53,30,39,45,112,112),(10,5,54,30,39,46,114,114),(10,5,55,30,40,46,116,116),(10,5,56,31,40,47,118,118),(10,5,57,31,41,48,120,120),(10,5,58,31,41,48,123,123),(10,5,59,32,42,49,125,125),(10,5,60,32,42,50,127,127),(10,5,61,33,42,51,129,129),(10,5,62,33,43,51,131,131),(10,5,63,33,43,52,133,134),(10,5,64,34,44,53,135,136),(10,5,65,34,44,53,138,138),(10,5,66,34,45,54,140,141),(10,5,67,35,45,55,142,143),(10,5,68,35,46,56,144,145),(10,5,69,36,46,56,147,148),(10,5,70,36,47,57,149,150),(10,5,71,36,48,57,152,153),(10,5,72,37,48,57,155,156),(10,5,73,37,49,58,158,159),(10,5,74,38,49,59,160,163),(10,5,75,38,50,60,163,165),(10,5,76,38,51,61,166,170),(10,5,77,39,51,62,168,175),(10,5,78,39,52,63,172,174),(10,5,79,40,52,64,175,177),(10,5,80,40,53,65,178,180),(10,6,1,18,23,21,24,20),(10,6,2,19,24,22,24,20),(10,6,3,21,25,23,24,21),(10,6,4,22,25,25,24,21),(10,6,5,23,26,26,24,21),(10,6,6,25,27,27,24,21),(10,6,7,26,28,28,24,22),(10,6,8,27,29,29,25,22),(10,6,9,29,29,31,25,22),(10,6,10,30,30,32,25,23),(10,6,11,32,31,33,25,23),(10,6,12,33,32,34,25,23),(10,6,13,34,33,36,25,24),(10,6,14,36,34,37,25,24),(10,6,15,37,35,38,25,24),(10,6,16,39,36,40,25,25),(10,6,17,40,36,41,25,25),(10,6,18,42,37,43,26,25),(10,6,19,43,38,44,26,26),(10,6,20,45,39,45,26,26),(10,6,21,47,40,47,26,26),(10,6,22,48,41,48,26,27),(10,6,23,50,42,50,26,27),(10,6,24,51,43,51,26,28),(10,6,25,53,44,52,27,28),(10,6,26,55,45,54,27,28),(10,6,27,56,46,55,27,29),(10,6,28,58,47,57,27,29),(10,6,29,59,48,58,27,30),(10,6,30,61,49,60,27,30),(10,6,31,63,50,62,27,30),(10,6,32,65,51,63,28,31),(10,6,33,66,52,65,28,31),(10,6,34,68,53,66,28,32),(10,6,35,70,55,68,28,32),(10,6,36,72,56,69,28,33),(10,6,37,73,57,71,29,33),(10,6,38,75,58,73,29,34),(10,6,39,77,59,74,29,34),(10,6,40,79,60,76,29,35),(10,6,41,81,61,78,29,35),(10,6,42,82,62,79,30,35),(10,6,43,84,64,81,30,36),(10,6,44,86,65,83,30,36),(10,6,45,88,66,85,30,37),(10,6,46,90,67,86,30,37),(10,6,47,92,68,88,31,38),(10,6,48,94,69,90,31,38),(10,6,49,96,69,92,31,39),(10,6,50,98,70,93,31,40),(10,6,51,100,71,95,32,40),(10,6,52,102,72,96,32,41),(10,6,53,103,73,97,32,41),(10,6,54,104,74,98,32,41),(10,6,55,105,75,97,33,41),(10,6,56,108,77,100,33,42),(10,6,57,113,78,102,33,42),(10,6,58,115,79,104,34,43),(10,6,59,117,81,106,34,43),(10,6,60,118,82,108,34,44),(10,6,61,119,83,110,34,45),(10,6,62,121,85,112,34,45),(10,6,63,124,86,115,35,46),(10,6,64,127,88,117,35,46),(10,6,65,133,89,119,35,47),(10,6,66,135,91,122,35,48),(10,6,67,139,92,124,36,48),(10,6,68,141,94,126,36,49),(10,6,69,142,95,129,36,50),(10,6,70,145,97,131,36,50),(10,6,71,150,99,134,37,51),(10,6,72,152,100,136,37,52),(10,6,73,155,102,139,37,53),(10,6,74,158,104,141,37,53),(10,6,75,159,105,144,38,54),(10,6,76,160,107,147,38,55),(10,6,77,163,109,149,38,56),(10,6,78,166,110,152,38,56),(10,6,79,169,112,155,39,57),(10,6,80,172,114,158,39,58),(10,8,1,17,22,19,27,21),(10,8,2,17,22,19,28,22),(10,8,3,17,22,20,30,24),(10,8,4,17,22,20,31,25),(10,8,5,17,23,20,32,26),(10,8,6,17,23,20,34,28),(10,8,7,18,23,21,35,29),(10,8,8,18,23,21,37,30),(10,8,9,18,23,21,38,32),(10,8,10,18,23,22,40,33),(10,8,11,18,24,22,41,35),(10,8,12,18,24,22,42,36),(10,8,13,18,24,23,44,37),(10,8,14,18,24,23,45,39),(10,8,15,18,24,23,47,40),(10,8,16,19,24,24,49,42),(10,8,17,19,25,24,50,43),(10,8,18,19,25,24,52,45),(10,8,19,19,25,25,53,46),(10,8,20,19,25,25,55,48),(10,8,21,19,25,26,57,50),(10,8,22,19,26,26,58,51),(10,8,23,20,26,26,60,53),(10,8,24,20,26,27,61,54),(10,8,25,20,26,27,63,56),(10,8,26,20,27,27,65,58),(10,8,27,20,27,28,67,59),(10,8,28,20,27,28,68,61),(10,8,29,21,27,29,70,63),(10,8,30,21,28,29,72,64),(10,8,31,21,28,30,74,66),(10,8,32,21,28,30,75,68),(10,8,33,21,28,30,77,70),(10,8,34,21,29,31,79,71),(10,8,35,22,29,31,81,73),(10,8,36,22,29,32,83,75),(10,8,37,22,29,32,85,77),(10,8,38,22,30,33,86,78),(10,8,39,22,30,33,88,80),(10,8,40,23,30,34,90,82),(10,8,41,23,31,34,92,84),(10,8,42,23,31,35,94,86),(10,8,43,23,31,35,96,88),(10,8,44,23,32,36,98,90),(10,8,45,24,32,36,100,92),(10,8,46,24,32,37,102,93),(10,8,47,24,32,37,104,95),(10,8,48,24,33,38,106,97),(10,8,49,25,33,38,108,99),(10,8,50,25,33,39,110,101),(10,8,51,25,34,39,112,103),(10,8,52,25,34,40,114,105),(10,8,53,25,35,40,117,107),(10,8,54,26,35,41,119,109),(10,8,55,26,35,41,121,111),(10,8,56,26,36,42,123,113),(10,8,57,26,36,42,125,116),(10,8,58,27,36,43,127,118),(10,8,59,27,37,43,130,120),(10,8,60,27,37,44,132,122),(10,8,61,27,37,45,134,124),(10,8,62,28,38,45,136,126),(10,8,63,28,38,46,139,128),(10,8,64,28,39,46,141,131),(10,8,65,29,39,47,143,133),(10,8,66,29,39,48,146,135),(10,8,67,29,40,48,148,137),(10,8,68,29,40,49,150,139),(10,8,69,30,41,49,153,142),(10,8,70,30,41,50,155,144),(10,8,71,30,41,50,158,147),(10,8,72,30,42,51,161,150),(10,8,73,30,42,52,164,153),(10,8,74,31,43,52,167,155),(10,8,75,31,43,53,170,158),(10,8,76,31,43,54,173,161),(10,8,77,32,44,55,176,164),(10,8,78,32,44,55,179,167),(10,8,79,32,45,56,182,170),(10,8,80,33,45,57,185,173),(10,9,1,17,22,20,26,21),(10,9,2,17,22,21,27,22),(10,9,3,18,23,21,28,23),(10,9,4,18,23,22,29,24),(10,9,5,18,23,22,31,26),(10,9,6,18,24,23,32,27),(10,9,7,19,24,23,33,28),(10,9,8,19,25,24,34,29),(10,9,9,19,25,25,36,30),(10,9,10,20,25,25,37,32),(10,9,11,20,26,26,38,33),(10,9,12,20,26,26,39,34),(10,9,13,21,27,27,41,36),(10,9,14,21,27,28,42,37),(10,9,15,21,27,28,43,38),(10,9,16,22,28,29,45,39),(10,9,17,22,28,30,46,41),(10,9,18,23,29,30,47,42),(10,9,19,23,29,31,49,43),(10,9,20,23,30,32,50,45),(10,9,21,24,30,32,51,46),(10,9,22,24,31,33,53,48),(10,9,23,24,31,34,54,49),(10,9,24,25,31,34,56,50),(10,9,25,25,32,35,57,52),(10,9,26,26,32,36,59,53),(10,9,27,26,33,37,60,55),(10,9,28,26,33,37,62,56),(10,9,29,27,34,38,63,58),(10,9,30,27,34,39,65,59),(10,9,31,28,35,40,66,61),(10,9,32,28,36,40,68,62),(10,9,33,29,36,41,69,64),(10,9,34,29,37,42,71,65),(10,9,35,29,37,43,73,67),(10,9,36,30,38,43,74,69),(10,9,37,30,38,44,76,70),(10,9,38,31,39,45,77,72),(10,9,39,31,39,46,79,73),(10,9,40,32,40,47,81,75),(10,9,41,32,41,48,82,77),(10,9,42,33,41,48,84,78),(10,9,43,33,42,49,86,80),(10,9,44,34,42,50,88,82),(10,9,45,34,43,51,89,83),(10,9,46,35,44,52,91,85),(10,9,47,35,44,53,93,87),(10,9,48,36,45,54,95,89),(10,9,49,36,45,54,96,90),(10,9,50,37,46,55,98,92),(10,9,51,37,47,56,100,94),(10,9,52,38,47,57,102,96),(10,9,53,38,48,58,104,97),(10,9,54,39,49,59,105,99),(10,9,55,39,49,60,107,101),(10,9,56,40,50,61,109,103),(10,9,57,40,51,62,111,105),(10,9,58,41,51,63,113,107),(10,9,59,42,52,64,115,108),(10,9,60,42,53,65,117,110),(10,9,61,43,53,66,119,112),(10,9,62,43,54,67,121,114),(10,9,63,44,55,68,123,116),(10,9,64,44,56,69,125,118),(10,9,65,45,56,70,127,120),(10,9,66,46,57,71,129,122),(10,9,67,46,58,72,131,124),(10,9,68,47,58,73,133,126),(10,9,69,47,59,74,135,128),(10,9,70,48,60,75,137,130),(10,9,71,49,61,83,139,141),(10,9,72,50,61,84,142,143),(10,9,73,51,62,84,144,146),(10,9,74,51,63,86,147,149),(10,9,75,52,64,89,149,151),(10,9,76,53,65,90,155,154),(10,9,77,54,66,91,155,157),(10,9,78,54,67,93,157,160),(10,9,79,55,68,94,160,163),(10,9,80,56,69,95,163,165),(11,1,1,24,17,21,21,22),(11,1,2,25,18,22,21,22),(11,1,3,27,19,23,21,23),(11,1,4,28,19,25,21,23),(11,1,5,29,20,26,21,23),(11,1,6,31,21,27,21,23),(11,1,7,32,22,28,21,24),(11,1,8,33,23,29,22,24),(11,1,9,35,24,31,22,24),(11,1,10,36,24,32,22,25),(11,1,11,37,25,33,22,25),(11,1,12,39,26,34,22,25),(11,1,13,40,27,36,22,26),(11,1,14,42,28,37,22,26),(11,1,15,43,29,38,22,26),(11,1,16,45,30,40,22,27),(11,1,17,46,31,41,23,27),(11,1,18,48,32,43,23,27),(11,1,19,49,33,44,23,28),(11,1,20,51,34,45,23,28),(11,1,21,52,34,47,23,28),(11,1,22,54,35,48,23,29),(11,1,23,55,36,50,23,29),(11,1,24,57,37,51,24,30),(11,1,25,59,38,52,24,30),(11,1,26,60,39,54,24,30),(11,1,27,62,40,55,24,31),(11,1,28,63,41,57,24,31),(11,1,29,65,43,58,24,32),(11,1,30,67,44,60,24,32),(11,1,31,69,45,62,25,32),(11,1,32,70,46,63,25,33),(11,1,33,72,47,65,25,33),(11,1,34,74,48,66,25,34),(11,1,35,75,49,68,25,34),(11,1,36,77,50,69,26,35),(11,1,37,79,51,71,26,35),(11,1,38,81,52,73,26,35),(11,1,39,83,53,74,26,36),(11,1,40,84,55,76,26,36),(11,1,41,86,56,78,27,37),(11,1,42,88,57,79,27,37),(11,1,43,90,58,81,27,38),(11,1,44,92,59,83,27,38),(11,1,45,94,60,85,27,39),(11,1,46,96,62,86,28,39),(11,1,47,98,63,88,28,40),(11,1,48,100,64,90,28,40),(11,1,49,102,65,92,28,41),(11,1,50,103,66,93,29,41),(11,1,51,105,68,95,29,42),(11,1,52,107,69,97,29,42),(11,1,53,109,70,99,29,43),(11,1,54,112,71,101,30,44),(11,1,55,114,73,103,30,44),(11,1,56,116,74,104,30,45),(11,1,57,118,75,106,30,45),(11,1,58,120,77,108,31,46),(11,1,59,122,78,110,31,46),(11,1,60,124,79,112,31,47),(11,1,61,126,81,114,31,48),(11,1,62,128,82,116,32,48),(11,1,63,130,83,118,32,49),(11,1,64,133,85,120,32,49),(11,1,65,135,86,122,33,50),(11,1,66,137,87,124,33,51),(11,1,67,139,89,126,33,51),(11,1,68,141,90,128,33,52),(11,1,69,144,92,130,34,52),(11,1,70,146,93,132,34,53),(11,1,71,149,94,134,34,54),(11,1,72,151,96,137,34,55),(11,1,73,154,98,139,34,56),(11,1,74,157,99,142,35,56),(11,1,75,166,101,149,35,57),(11,1,76,172,103,155,35,58),(11,1,77,175,105,159,36,59),(11,1,78,179,106,161,36,59),(11,1,79,182,108,164,36,60),(11,1,80,185,110,167,37,61),(11,2,1,23,17,21,21,23),(11,2,2,24,18,22,22,24),(11,2,3,25,18,23,22,24),(11,2,4,26,19,24,23,25),(11,2,5,27,19,25,24,26),(11,2,6,29,20,26,24,26),(11,2,7,30,21,27,25,27),(11,2,8,31,21,28,26,28),(11,2,9,32,22,29,26,29),(11,2,10,33,22,31,27,29),(11,2,11,34,23,32,28,30),(11,2,12,36,24,33,28,31),(11,2,13,37,24,34,29,32),(11,2,14,38,25,35,30,32),(11,2,15,39,26,36,31,33),(11,2,16,40,26,37,31,34),(11,2,17,42,27,39,32,35),(11,2,18,43,28,40,33,36),(11,2,19,44,28,41,34,37),(11,2,20,46,29,42,34,37),(11,2,21,47,30,44,35,38),(11,2,22,48,31,45,36,39),(11,2,23,50,31,46,37,40),(11,2,24,51,32,47,38,41),(11,2,25,52,33,49,38,42),(11,2,26,54,34,50,39,43),(11,2,27,55,34,51,40,44),(11,2,28,56,35,53,41,44),(11,2,29,58,36,54,42,45),(11,2,30,59,37,55,43,46),(11,2,31,61,37,57,43,47),(11,2,32,62,38,58,44,48),(11,2,33,64,39,59,45,49),(11,2,34,65,40,61,46,50),(11,2,35,67,41,62,47,51),(11,2,36,68,42,64,48,52),(11,2,37,70,42,65,49,53),(11,2,38,71,43,67,50,54),(11,2,39,73,44,68,51,55),(11,2,40,74,45,69,52,56),(11,2,41,76,46,71,53,57),(11,2,42,78,47,72,54,58),(11,2,43,79,47,74,55,59),(11,2,44,81,48,75,56,60),(11,2,45,82,49,77,57,61),(11,2,46,84,50,78,58,62),(11,2,47,86,51,80,59,64),(11,2,48,87,52,82,60,65),(11,2,49,89,53,83,61,66),(11,2,50,91,54,85,62,67),(11,2,51,92,55,86,63,68),(11,2,52,94,56,88,64,69),(11,2,53,96,57,90,65,70),(11,2,54,97,58,91,66,71),(11,2,55,99,59,93,67,73),(11,2,56,101,60,95,68,74),(11,2,57,103,61,96,69,75),(11,2,58,105,62,98,70,76),(11,2,59,106,63,100,71,77),(11,2,60,108,64,101,72,78),(11,2,61,110,65,103,74,80),(11,2,62,112,66,105,75,81),(11,2,63,114,67,106,76,82),(11,2,64,116,68,108,77,83),(11,2,65,117,69,110,78,85),(11,2,66,119,70,112,79,86),(11,2,67,121,71,114,80,87),(11,2,68,123,72,115,82,88),(11,2,69,125,73,117,83,90),(11,2,70,127,74,119,84,91),(11,2,71,130,75,121,87,92),(11,2,72,132,76,124,90,94),(11,2,73,134,77,126,93,96),(11,2,74,137,79,128,97,97),(11,2,75,139,80,130,101,99),(11,2,76,142,81,133,106,100),(11,2,77,144,83,135,108,102),(11,2,78,147,84,137,110,104),(11,2,79,149,85,140,111,105),(11,2,80,152,87,142,113,107),(11,3,1,21,20,20,21,23),(11,3,2,21,21,21,22,24),(11,3,3,22,23,22,22,24),(11,3,4,22,24,23,23,25),(11,3,5,23,25,24,23,25),(11,3,6,23,27,25,24,26),(11,3,7,24,28,26,24,27),(11,3,8,24,30,27,25,27),(11,3,9,25,31,27,26,28),(11,3,10,25,33,28,26,29),(11,3,11,25,34,29,27,29),(11,3,12,26,36,30,28,30),(11,3,13,26,37,31,28,31),(11,3,14,27,39,32,29,32),(11,3,15,27,40,34,30,32),(11,3,16,28,42,35,30,33),(11,3,17,28,43,36,31,34),(11,3,18,29,45,37,32,35),(11,3,19,29,47,38,32,35),(11,3,20,30,48,39,33,36),(11,3,21,31,50,40,34,37),(11,3,22,31,51,41,34,38),(11,3,23,32,53,42,35,38),(11,3,24,32,55,43,36,39),(11,3,25,33,57,44,37,40),(11,3,26,33,58,46,37,41),(11,3,27,34,60,47,38,42),(11,3,28,35,62,48,39,42),(11,3,29,35,63,49,40,43),(11,3,30,36,65,50,40,44),(11,3,31,36,67,52,41,45),(11,3,32,37,69,53,42,46),(11,3,33,38,71,54,43,47),(11,3,34,38,72,55,44,48),(11,3,35,39,74,57,44,48),(11,3,36,39,76,58,45,49),(11,3,37,40,78,59,46,50),(11,3,38,41,80,60,47,51),(11,3,39,41,82,62,48,52),(11,3,40,42,84,63,49,53),(11,3,41,43,86,64,50,54),(11,3,42,43,88,66,50,55),(11,3,43,44,90,67,51,56),(11,3,44,45,91,68,52,57),(11,3,45,45,93,70,53,58),(11,3,46,46,95,71,54,59),(11,3,47,47,98,72,55,60),(11,3,48,48,100,74,56,61),(11,3,49,48,102,75,57,62),(11,3,50,49,104,77,58,63),(11,3,51,50,106,78,59,64),(11,3,52,51,108,79,60,65),(11,3,53,51,110,81,61,66),(11,3,54,52,112,82,61,67),(11,3,55,53,114,84,62,68),(11,3,56,54,116,85,63,69),(11,3,57,54,118,87,64,70),(11,3,58,55,121,88,65,71),(11,3,59,56,123,90,66,72),(11,3,60,57,125,91,67,74),(11,3,61,58,127,93,68,75),(11,3,62,58,130,94,69,76),(11,3,63,59,132,96,71,77),(11,3,64,60,134,97,72,78),(11,3,65,61,136,99,73,79),(11,3,66,62,139,101,74,80),(11,3,67,62,141,102,75,81),(11,3,68,63,143,104,76,83),(11,3,69,64,146,105,77,84),(11,3,70,65,148,107,78,85),(11,3,71,66,151,109,79,86),(11,3,72,67,154,111,80,87),(11,3,73,68,157,113,81,89),(11,3,74,69,160,115,83,90),(11,3,75,70,163,117,84,92),(11,3,76,71,166,119,85,93),(11,3,77,72,169,121,87,95),(11,3,78,73,172,123,88,96),(11,3,79,74,175,125,89,98),(11,3,80,75,178,127,91,99),(11,5,1,21,17,19,23,25),(11,5,2,21,17,19,24,26),(11,5,3,21,17,20,26,28),(11,5,4,21,18,20,27,29),(11,5,5,22,18,20,28,30),(11,5,6,22,18,21,30,32),(11,5,7,22,18,21,31,33),(11,5,8,22,19,22,32,35),(11,5,9,22,19,22,34,36),(11,5,10,22,19,22,35,38),(11,5,11,23,19,23,37,39),(11,5,12,23,20,23,38,41),(11,5,13,23,20,24,39,42),(11,5,14,23,20,24,41,44),(11,5,15,23,20,25,42,45),(11,5,16,24,21,25,44,47),(11,5,17,24,21,25,45,48),(11,5,18,24,21,26,47,50),(11,5,19,24,22,26,48,51),(11,5,20,24,22,27,50,53),(11,5,21,25,22,27,51,55),(11,5,22,25,22,28,53,56),(11,5,23,25,23,28,55,58),(11,5,24,25,23,29,56,60),(11,5,25,25,23,29,58,61),(11,5,26,26,24,30,60,63),(11,5,27,26,24,30,61,65),(11,5,28,26,24,31,63,66),(11,5,29,26,25,31,65,68),(11,5,30,27,25,32,66,70),(11,5,31,27,25,32,68,72),(11,5,32,27,26,33,70,73),(11,5,33,27,26,33,71,75),(11,5,34,28,26,34,73,77),(11,5,35,28,27,34,75,79),(11,5,36,28,27,35,77,81),(11,5,37,29,28,35,79,83),(11,5,38,29,28,36,80,85),(11,5,39,29,28,37,82,86),(11,5,40,29,29,37,84,88),(11,5,41,30,29,38,86,90),(11,5,42,30,29,38,88,92),(11,5,43,30,30,39,90,94),(11,5,44,31,30,39,91,96),(11,5,45,31,31,40,93,98),(11,5,46,31,31,41,95,100),(11,5,47,32,31,41,97,102),(11,5,48,32,32,42,99,104),(11,5,49,32,32,43,101,106),(11,5,50,33,33,43,103,108),(11,5,51,33,33,44,105,110),(11,5,52,33,34,44,107,113),(11,5,53,34,34,45,109,115),(11,5,54,34,34,46,111,117),(11,5,55,34,35,46,113,119),(11,5,56,35,35,47,115,121),(11,5,57,35,36,48,118,123),(11,5,58,35,36,48,120,126),(11,5,59,36,37,49,122,128),(11,5,60,36,37,50,124,130),(11,5,61,36,38,51,126,132),(11,5,62,37,38,51,128,134),(11,5,63,37,39,52,130,137),(11,5,64,38,39,53,133,139),(11,5,65,38,40,53,135,141),(11,5,66,38,40,54,137,144),(11,5,67,39,40,55,139,146),(11,5,68,39,41,56,141,148),(11,5,69,40,41,56,144,151),(11,5,70,40,42,57,146,153),(11,5,71,40,43,58,149,156),(11,5,72,41,43,58,155,159),(11,5,73,41,44,59,157,160),(11,5,74,42,44,61,160,163),(11,5,75,42,45,62,164,166),(11,5,76,42,46,62,167,169),(11,5,77,43,46,63,168,172),(11,5,78,43,47,64,169,177),(11,5,79,44,47,65,172,180),(11,5,80,44,48,66,175,183),(11,6,1,24,17,21,21,22),(11,6,2,25,18,22,21,22),(11,6,3,27,19,23,21,23),(11,6,4,28,19,25,21,23),(11,6,5,29,20,26,21,23),(11,6,6,31,21,27,21,23),(11,6,7,32,22,28,21,24),(11,6,8,33,23,29,22,24),(11,6,9,35,24,31,22,24),(11,6,10,36,24,32,22,25),(11,6,11,37,25,33,22,25),(11,6,12,39,26,34,22,25),(11,6,13,40,27,36,22,26),(11,6,14,42,28,37,22,26),(11,6,15,43,29,38,22,26),(11,6,16,45,30,40,22,27),(11,6,17,46,31,41,23,27),(11,6,18,48,32,43,23,27),(11,6,19,49,33,44,23,28),(11,6,20,51,34,45,23,28),(11,6,21,52,34,47,23,28),(11,6,22,54,35,48,23,29),(11,6,23,55,36,50,23,29),(11,6,24,57,37,51,24,30),(11,6,25,59,38,52,24,30),(11,6,26,60,39,54,24,30),(11,6,27,62,40,55,24,31),(11,6,28,63,41,57,24,31),(11,6,29,65,43,58,24,32),(11,6,30,67,44,60,24,32),(11,6,31,69,45,62,25,32),(11,6,32,70,46,63,25,33),(11,6,33,72,47,65,25,33),(11,6,34,74,48,66,25,34),(11,6,35,75,49,68,25,34),(11,6,36,77,50,69,26,35),(11,6,37,79,51,71,26,35),(11,6,38,81,52,73,26,35),(11,6,39,83,53,74,26,36),(11,6,40,84,55,76,26,36),(11,6,41,86,56,78,27,37),(11,6,42,88,57,79,27,37),(11,6,43,90,58,81,27,38),(11,6,44,92,59,83,27,38),(11,6,45,94,60,85,27,39),(11,6,46,96,62,86,28,39),(11,6,47,98,63,88,28,40),(11,6,48,100,64,90,28,40),(11,6,49,102,65,92,28,41),(11,6,50,103,65,93,29,41),(11,6,51,105,66,94,29,42),(11,6,52,106,67,95,29,42),(11,6,53,107,68,96,29,43),(11,6,54,108,69,97,30,44),(11,6,55,109,70,98,30,44),(11,6,56,112,72,101,30,45),(11,6,57,114,73,103,30,45),(11,6,58,117,74,105,31,46),(11,6,59,119,76,107,31,46),(11,6,60,121,77,109,31,47),(11,6,61,123,78,111,31,48),(11,6,62,126,80,113,31,48),(11,6,63,128,81,116,32,49),(11,6,64,131,83,118,32,49),(11,6,65,136,84,120,32,50),(11,6,66,140,86,123,32,51),(11,6,67,141,87,125,33,51),(11,6,68,141,89,127,33,52),(11,6,69,144,90,130,33,53),(11,6,70,147,92,132,33,53),(11,6,71,150,94,135,34,54),(11,6,72,152,95,137,34,55),(11,6,73,155,97,140,34,56),(11,6,74,162,99,142,34,56),(11,6,75,165,100,145,35,57),(11,6,76,167,102,146,35,58),(11,6,77,169,104,150,35,59),(11,6,78,170,105,152,35,59),(11,6,79,173,107,156,36,60),(11,6,80,176,109,159,36,61),(11,7,1,22,17,20,22,24),(11,7,2,23,17,21,23,25),(11,7,3,24,18,22,24,26),(11,7,4,25,18,23,25,27),(11,7,5,25,19,24,26,28),(11,7,6,26,19,25,27,29),(11,7,7,27,20,26,28,30),(11,7,8,28,20,27,28,31),(11,7,9,29,21,28,29,32),(11,7,10,30,21,29,30,33),(11,7,11,31,22,30,31,35),(11,7,12,32,22,31,32,36),(11,7,13,33,23,32,33,37),(11,7,14,34,23,33,34,38),(11,7,15,34,24,35,35,39),(11,7,16,35,24,36,36,40),(11,7,17,36,25,37,38,42),(11,7,18,37,25,38,39,43),(11,7,19,38,26,39,40,44),(11,7,20,39,26,40,41,45),(11,7,21,40,27,41,42,46),(11,7,22,41,27,43,43,48),(11,7,23,43,28,44,44,49),(11,7,24,44,28,45,45,50),(11,7,25,45,29,46,46,51),(11,7,26,46,30,47,48,53),(11,7,27,47,30,49,49,54),(11,7,28,48,31,50,50,55),(11,7,29,49,31,51,51,57),(11,7,30,50,32,53,52,58),(11,7,31,51,33,54,53,59),(11,7,32,52,33,55,55,61),(11,7,33,53,34,56,56,62),(11,7,34,55,34,58,57,64),(11,7,35,56,35,59,58,65),(11,7,36,57,36,60,60,66),(11,7,37,58,36,62,61,68),(11,7,38,59,37,63,62,69),(11,7,39,61,38,65,63,71),(11,7,40,62,38,66,65,72),(11,7,41,63,39,67,66,74),(11,7,42,64,40,69,67,75),(11,7,43,65,40,70,69,77),(11,7,44,67,41,72,70,78),(11,7,45,68,42,73,71,80),(11,7,46,69,42,75,73,81),(11,7,47,71,43,76,74,83),(11,7,48,72,44,78,76,84),(11,7,49,73,45,79,77,86),(11,7,50,74,45,81,78,88),(11,7,51,76,46,82,80,89),(11,7,52,77,47,84,81,91),(11,7,53,78,47,85,83,92),(11,7,54,80,48,87,84,94),(11,7,55,81,49,88,86,96),(11,7,56,83,50,90,87,97),(11,7,57,84,50,91,89,99),(11,7,58,85,51,93,90,101),(11,7,59,87,52,95,92,102),(11,7,60,88,53,96,93,104),(11,7,61,90,54,98,95,106),(11,7,62,91,54,99,96,108),(11,7,63,93,55,101,98,109),(11,7,64,94,56,103,99,111),(11,7,65,95,57,104,101,113),(11,7,66,97,58,106,103,115),(11,7,67,98,58,108,104,117),(11,7,68,100,59,110,106,118),(11,7,69,101,60,111,107,120),(11,7,70,103,61,113,109,122),(11,7,71,104,62,115,122,124),(11,7,72,106,63,117,124,127),(11,7,73,108,64,119,126,129),(11,7,74,110,65,122,128,131),(11,7,75,112,66,124,130,133),(11,7,76,114,67,126,133,136),(11,7,77,115,68,128,135,138),(11,7,78,117,69,130,137,140),(11,7,79,119,70,133,139,143),(11,7,80,121,71,135,141,145),(11,8,1,21,17,19,24,24),(11,8,2,21,17,19,25,25),(11,8,3,21,17,20,27,27),(11,8,4,21,17,20,28,28),(11,8,5,21,18,20,29,29),(11,8,6,21,18,20,31,31),(11,8,7,21,18,21,32,32),(11,8,8,22,18,21,34,33),(11,8,9,22,18,21,35,35),(11,8,10,22,19,22,37,36),(11,8,11,22,19,22,38,37),(11,8,12,22,19,22,40,39),(11,8,13,22,19,23,41,40),(11,8,14,22,19,23,43,42),(11,8,15,22,19,23,44,43),(11,8,16,22,20,24,46,45),(11,8,17,23,20,24,47,46),(11,8,18,23,20,24,49,48),(11,8,19,23,20,25,50,49),(11,8,20,23,21,25,52,51),(11,8,21,23,21,26,54,52),(11,8,22,23,21,26,55,54),(11,8,23,23,21,26,57,56),(11,8,24,24,21,27,59,57),(11,8,25,24,22,27,60,59),(11,8,26,24,22,27,62,60),(11,8,27,24,22,28,64,62),(11,8,28,24,22,28,65,64),(11,8,29,24,23,29,67,65),(11,8,30,24,23,29,69,67),(11,8,31,25,23,30,71,69),(11,8,32,25,23,30,73,71),(11,8,33,25,24,30,74,72),(11,8,34,25,24,31,76,74),(11,8,35,25,24,31,78,76),(11,8,36,26,24,32,80,78),(11,8,37,26,25,32,82,79),(11,8,38,26,25,33,84,81),(11,8,39,26,25,33,86,83),(11,8,40,26,26,34,87,85),(11,8,41,27,26,34,89,87),(11,8,42,27,26,35,91,89),(11,8,43,27,27,35,93,91),(11,8,44,27,27,36,95,92),(11,8,45,27,27,36,97,94),(11,8,46,28,27,37,99,96),(11,8,47,28,28,37,101,98),(11,8,48,28,28,38,103,100),(11,8,49,28,28,38,105,102),(11,8,50,29,29,39,107,104),(11,8,51,29,29,39,110,106),(11,8,52,29,29,40,112,108),(11,8,53,29,30,40,114,110),(11,8,54,30,30,41,116,112),(11,8,55,30,30,41,118,114),(11,8,56,30,31,42,120,116),(11,8,57,30,31,42,122,118),(11,8,58,31,31,43,125,121),(11,8,59,31,32,43,127,123),(11,8,60,31,32,44,129,125),(11,8,61,31,33,45,131,127),(11,8,62,32,33,45,133,129),(11,8,63,32,33,46,136,131),(11,8,64,32,34,46,138,134),(11,8,65,33,34,47,140,136),(11,8,66,33,34,48,143,138),(11,8,67,33,35,48,145,140),(11,8,68,33,35,49,147,142),(11,8,69,34,36,49,150,145),(11,8,70,34,36,50,152,147),(11,8,71,34,36,51,155,150),(11,8,72,34,37,52,161,153),(11,8,73,34,37,53,161,156),(11,8,74,35,38,53,164,158),(11,8,75,35,38,54,167,161),(11,8,76,35,38,55,170,164),(11,8,77,36,39,56,173,167),(11,8,78,36,39,56,176,170),(11,8,79,36,40,57,179,173),(11,8,80,37,40,58,182,176); +/*!40000 ALTER TABLE `player_levelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `player_xp_for_level` +-- + +DROP TABLE IF EXISTS `player_xp_for_level`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `player_xp_for_level` ( + `lvl` int(3) unsigned NOT NULL, + `xp_for_next_level` int(10) unsigned NOT NULL, + PRIMARY KEY (`lvl`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `player_xp_for_level` +-- + +LOCK TABLES `player_xp_for_level` WRITE; +/*!40000 ALTER TABLE `player_xp_for_level` DISABLE KEYS */; +INSERT INTO `player_xp_for_level` VALUES (1,400),(2,900),(3,1400),(4,2100),(5,2800),(6,3600),(7,4500),(8,5400),(9,6500),(10,7600),(11,8700),(12,9800),(13,11000),(14,12300),(15,13600),(16,15000),(17,16400),(18,17800),(19,19300),(20,20800),(21,22400),(22,24000),(23,25500),(24,27200),(25,28900),(26,30500),(27,32200),(28,33900),(29,36300),(30,38800),(31,41600),(32,44600),(33,48000),(34,51400),(35,55000),(36,58700),(37,62400),(38,66200),(39,70200),(40,74300),(41,78500),(42,82800),(43,87100),(44,91600),(45,96300),(46,101000),(47,105800),(48,110700),(49,115700),(50,120900),(51,126100),(52,131500),(53,137000),(54,142500),(55,148200),(56,154000),(57,159900),(58,165800),(59,172000),(60,290000),(61,317000),(62,349000),(63,386000),(64,428000),(65,475000),(66,527000),(67,585000),(68,648000),(69,717000),(70,1523800),(71,1539600),(72,1555700),(73,1571800),(74,1587900),(75,1604200),(76,1620700),(77,1637400),(78,1653900),(79,1670800); +/*!40000 ALTER TABLE `player_xp_for_level` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo` +-- + +DROP TABLE IF EXISTS `playercreateinfo`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playercreateinfo` ( + `race` tinyint(3) unsigned NOT NULL DEFAULT '0', + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `map` smallint(5) unsigned NOT NULL DEFAULT '0', + `zone` mediumint(8) unsigned NOT NULL DEFAULT '0', + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + PRIMARY KEY (`race`,`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `playercreateinfo` +-- + +LOCK TABLES `playercreateinfo` WRITE; +/*!40000 ALTER TABLE `playercreateinfo` DISABLE KEYS */; +INSERT INTO `playercreateinfo` VALUES (1,1,0,12,-8949.95,-132.493,83.5312),(1,2,0,12,-8949.95,-132.493,83.5312),(1,4,0,12,-8949.95,-132.493,83.5312),(1,5,0,12,-8949.95,-132.493,83.5312),(1,8,0,12,-8949.95,-132.493,83.5312),(1,9,0,12,-8949.95,-132.493,83.5312),(2,1,1,14,-618.518,-4251.67,38.718),(2,3,1,14,-618.518,-4251.67,38.718),(2,4,1,14,-618.518,-4251.67,38.718),(2,7,1,14,-618.518,-4251.67,38.718),(2,9,1,14,-618.518,-4251.67,38.718),(3,1,0,1,-6240.32,331.033,382.758),(3,2,0,1,-6240.32,331.033,382.758),(3,3,0,1,-6240.32,331.033,382.758),(3,4,0,1,-6240.32,331.033,382.758),(3,5,0,1,-6240.32,331.033,382.758),(4,1,1,141,10311.3,832.463,1326.41),(4,3,1,141,10311.3,832.463,1326.41),(4,4,1,141,10311.3,832.463,1326.41),(4,5,1,141,10311.3,832.463,1326.41),(4,11,1,141,10311.3,832.463,1326.41),(5,1,0,85,1676.71,1678.31,121.67),(5,4,0,85,1676.71,1678.31,121.67),(5,5,0,85,1676.71,1678.31,121.67),(5,8,0,85,1676.71,1678.31,121.67),(5,9,0,85,1676.71,1678.31,121.67),(6,1,1,215,-2917.58,-257.98,52.9968),(6,3,1,215,-2917.58,-257.98,52.9968),(6,7,1,215,-2917.58,-257.98,52.9968),(6,11,1,215,-2917.58,-257.98,52.9968),(7,1,0,1,-6240.32,331.033,382.758),(7,9,0,1,-6240,331,383),(7,8,0,1,-6240,331,383),(7,4,0,1,-6240,331,383),(8,1,1,14,-618.518,-4251.67,38.718),(8,3,1,14,-618.518,-4251.67,38.718),(8,4,1,14,-618.518,-4251.67,38.718),(8,5,1,14,-618.518,-4251.67,38.718),(8,7,1,14,-618.518,-4251.67,38.718),(8,8,1,14,-618.518,-4251.67,38.718),(10,2,530,3431,10349.6,-6357.29,33.4026),(10,3,530,3431,10349.6,-6357.29,33.4026),(10,4,530,3431,10349.6,-6357.29,33.4026),(10,5,530,3431,10349.6,-6357.29,33.4026),(10,8,530,3431,10349.6,-6357.29,33.4026),(10,9,530,3431,10349.6,-6357.29,33.4026),(11,1,530,3526,-3961.64,-13931.2,100.615),(11,2,530,3526,-3961.64,-13931.2,100.615),(11,3,530,3526,-3961.64,-13931.2,100.615),(11,5,530,3526,-3961.64,-13931.2,100.615),(11,7,530,3526,-3961.64,-13931.2,100.615),(11,8,530,3526,-3961.64,-13931.2,100.615),(1,6,609,4298,2355.84,-5664.77,426.028),(2,6,609,4298,2358.44,-5666.9,426.023),(3,6,609,4298,2358.44,-5666.9,426.023),(4,6,609,4298,2356.21,-5662.21,426.026),(5,6,609,4298,2356.21,-5662.21,426.026),(6,6,609,4298,2358.17,-5663.21,426.027),(7,6,609,4298,2355.05,-5661.7,426.026),(8,6,609,4298,2355.05,-5661.7,426.026),(10,6,609,4298,2355.84,-5664.77,426.028),(11,6,609,4298,2358.17,-5663.21,426.027); +/*!40000 ALTER TABLE `playercreateinfo` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_action` +-- + +DROP TABLE IF EXISTS `playercreateinfo_action`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playercreateinfo_action` ( + `race` tinyint(3) unsigned NOT NULL DEFAULT '0', + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `button` smallint(5) unsigned NOT NULL DEFAULT '0', + `action` int(11) unsigned NOT NULL DEFAULT '0', + `type` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`race`,`class`,`button`), + KEY `playercreateinfo_race_class_index` (`race`,`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `playercreateinfo_action` +-- + +LOCK TABLES `playercreateinfo_action` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_action` DISABLE KEYS */; +INSERT INTO `playercreateinfo_action` (`race`,`class`,`button`,`action`,`type`) VALUES +(10,6,2,45477,0), +(10,6,3,45462,0), +(10,6,4,45902,0), +(10,6,5,47541,0), +(10,6,6,50613,0), +(10,8,0,133,0), +(10,8,1,168,0), +(10,8,2,28730,0), +(10,9,0,686,0), +(10,9,1,687,0), +(10,9,2,28730,0), +(11,1,0,6603,0), +(11,1,72,6603,0), +(11,1,73,78,0), +(11,1,74,28880,0), +(11,1,84,6603,0), +(11,1,96,6603,0), +(11,1,108,6603,0), +(11,2,0,6603,0), +(11,2,1,21084,0), +(11,2,2,635,0), +(11,2,3,59542,0), +(11,3,0,6603,0), +(11,3,1,2973,0), +(11,3,2,75,0), +(11,3,3,59543,0), +(11,3,72,6603,0), +(11,3,73,2973,0), +(11,3,74,75,0), +(11,5,0,585,0), +(11,5,1,2050,0), +(11,5,2,59544,0), +(11,6,0,6603,0), +(11,6,1,49576,0), +(11,6,2,45477,0), +(11,6,3,45462,0), +(11,6,4,45902,0), +(11,6,5,47541,0), +(11,6,10,59545,0), +(11,7,0,6603,0), +(11,7,1,403,0), +(11,7,2,331,0), +(11,7,3,59547,0), +(11,8,0,133,0), +(11,8,1,168,0), +(11,8,2,59548,0), +(11,6,11,41751,128); +/*!40000 ALTER TABLE `playercreateinfo_action` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_item` +-- + +DROP TABLE IF EXISTS `playercreateinfo_item`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playercreateinfo_item` ( + `race` tinyint(3) unsigned NOT NULL DEFAULT '0', + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `itemid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `amount` tinyint(3) NOT NULL DEFAULT '1', + KEY `playercreateinfo_race_class_index` (`race`,`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `playercreateinfo_item` +-- + +LOCK TABLES `playercreateinfo_item` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_item` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo_item` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_spell` +-- + +DROP TABLE IF EXISTS `playercreateinfo_spell`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playercreateinfo_spell` ( + `race` tinyint(3) unsigned NOT NULL DEFAULT '0', + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Spell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Note` varchar(255) DEFAULT NULL, + PRIMARY KEY (`race`,`class`,`Spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `playercreateinfo_spell` +-- + +LOCK TABLES `playercreateinfo_spell` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_spell` DISABLE KEYS */; +INSERT INTO `playercreateinfo_spell` VALUES (1,1,78,'Heroic Strike'),(1,1,81,'Dodge'),(1,1,107,'Block'),(1,1,196,'One-Handed Axes'),(1,1,198,'One-Handed Maces'),(1,1,201,'One-Handed Swords'),(1,1,203,'Unarmed'),(1,1,204,'Defense'),(1,1,522,'SPELLDEFENSE (DND)'),(1,1,668,'Language Common'),(1,1,1843,'Disarm'),(1,1,2382,'Generic'),(1,1,2457,'Battle Stance'),(1,1,2479,'Honorless Target'),(1,1,3050,'Detect'),(1,1,3365,'Opening'),(1,1,5301,'Defensive State (DND)'),(1,1,6233,'Closing'),(1,1,6246,'Closing'),(1,1,6247,'Opening'),(1,1,6477,'Opening'),(1,1,6478,'Opening'),(1,1,6603,'Attack'),(1,1,7266,'Duel'),(1,1,7267,'Grovel'),(1,1,7355,'Stuck'),(1,1,8386,'Attacking'),(1,1,8737,'Mail'),(1,1,9077,'Leather'),(1,1,9078,'Cloth'),(1,1,9116,'Shield'),(1,1,9125,'Generic'),(1,1,20597,'Sword Specialization'),(1,1,20598,'The Human Spirit'),(1,1,20599,'Diplomacy'),(1,1,20864,'Mace Specialization'),(1,1,21651,'Opening'),(1,1,21652,'Closing'),(1,1,22027,'Remove Insignia'),(1,1,22810,'Opening - No Text'),(1,1,32215,'Victorious State'),(1,1,45927,'Summon Friend'),(1,1,58985,'Perception'),(1,1,59752,'Every Man for Himself'),(1,1,61437,'Opening'),(1,2,81,'Dodge'),(1,2,107,'Block'),(1,2,198,'One-Handed Maces'),(1,2,199,'Two-Handed Maces'),(1,2,203,'Unarmed'),(1,2,204,'Defense'),(1,2,522,'SPELLDEFENSE (DND)'),(1,2,635,'Holy Light'),(1,2,668,'Language Common'),(1,2,1843,'Disarm'),(1,2,2382,'Generic'),(1,2,2479,'Honorless Target'),(1,2,3050,'Detect'),(1,2,3365,'Opening'),(1,2,6233,'Closing'),(1,2,6246,'Closing'),(1,2,6247,'Opening'),(1,2,6477,'Opening'),(1,2,6478,'Opening'),(1,2,6603,'Attack'),(1,2,7266,'Duel'),(1,2,7267,'Grovel'),(1,2,7355,'Stuck'),(1,2,8386,'Attacking'),(1,2,8737,'Mail'),(1,2,9077,'Leather'),(1,2,9078,'Cloth'),(1,2,9116,'Shield'),(1,2,9125,'Generic'),(1,2,21084,'Seal of Righteousness'),(1,2,20597,'Sword Specialization'),(1,2,20598,'The Human Spirit'),(1,2,20599,'Diplomacy'),(1,2,20864,'Mace Specialization'),(1,2,21651,'Opening'),(1,2,21652,'Closing'),(1,2,22027,'Remove Insignia'),(1,2,22810,'Opening - No Text'),(1,2,27762,'Libram'),(1,2,45927,'Summon Friend'),(1,2,58985,'Perception'),(1,2,59752,'Every Man for Himself'),(1,2,61437,'Opening'),(1,4,81,'Dodge'),(1,4,203,'Unarmed'),(1,4,204,'Defense'),(1,4,522,'SPELLDEFENSE (DND)'),(1,4,668,'Language Common'),(1,4,1180,'Daggers'),(1,4,1752,'Sinister Strike'),(1,4,1843,'Disarm'),(1,4,2098,'Eviscerate'),(1,4,2382,'Generic'),(1,4,2479,'Honorless Target'),(1,4,2567,'Thrown'),(1,4,2764,'Throw'),(1,4,3050,'Detect'),(1,4,3365,'Opening'),(1,4,6233,'Closing'),(1,4,6246,'Closing'),(1,4,6247,'Opening'),(1,4,6477,'Opening'),(1,4,6478,'Opening'),(1,4,6603,'Attack'),(1,4,7266,'Duel'),(1,4,7267,'Grovel'),(1,4,7355,'Stuck'),(1,4,8386,'Attacking'),(1,4,9077,'Leather'),(1,4,9078,'Cloth'),(1,4,9125,'Generic'),(1,4,16092,'Defensive State (DND)'),(1,4,20597,'Sword Specialization'),(1,4,20598,'The Human Spirit'),(1,4,20599,'Diplomacy'),(1,4,20864,'Mace Specialization'),(1,4,21184,'Rogue Passive (DND)'),(1,4,21651,'Opening'),(1,4,21652,'Closing'),(1,4,22027,'Remove Insignia'),(1,4,22810,'Opening - No Text'),(1,4,45927,'Summon Friend'),(1,4,58985,'Perception'),(1,4,59752,'Every Man for Himself'),(1,4,61437,'Opening'),(1,5,81,'Dodge'),(1,5,198,'One-Handed Maces'),(1,5,203,'Unarmed'),(1,5,204,'Defense'),(1,5,522,'SPELLDEFENSE (DND)'),(1,5,585,'Smite'),(1,5,668,'Language Common'),(1,5,1843,'Disarm'),(1,5,2050,'Lesser Heal'),(1,5,2382,'Generic'),(1,5,2479,'Honorless Target'),(1,5,3050,'Detect'),(1,5,3365,'Opening'),(1,5,5009,'Wands'),(1,5,5019,'Shoot'),(1,5,6233,'Closing'),(1,5,6246,'Closing'),(1,5,6247,'Opening'),(1,5,6477,'Opening'),(1,5,6478,'Opening'),(1,5,6603,'Attack'),(1,5,7266,'Duel'),(1,5,7267,'Grovel'),(1,5,7355,'Stuck'),(1,5,8386,'Attacking'),(1,5,9078,'Cloth'),(1,5,9125,'Generic'),(1,5,20597,'Sword Specialization'),(1,5,20598,'The Human Spirit'),(1,5,20599,'Diplomacy'),(1,5,20864,'Mace Specialization'),(1,5,21651,'Opening'),(1,5,21652,'Closing'),(1,5,22027,'Remove Insignia'),(1,5,22810,'Opening - No Text'),(1,5,45927,'Summon Friend'),(1,5,58985,'Perception'),(1,5,59752,'Every Man for Himself'),(1,5,61437,'Opening'),(1,6,81,'Dodge'),(1,6,196,'One-Handed Axes'),(1,6,197,'Two-Handed Axes'),(1,6,200,'Polearms'),(1,6,201,'One-Handed Swords'),(1,6,202,'Two-Handed Swords'),(1,6,203,'Unarmed'),(1,6,204,'Defense'),(1,6,522,'SPELLDEFENSE (DND)'),(1,6,668,'Language Common'),(1,6,674,'Dual Wield'),(1,6,750,'Plate Mail'),(1,6,1843,'Disarm'),(1,6,2382,'Generic'),(1,6,2479,'Honorless Target'),(1,6,3050,'Detect'),(1,6,3127,'Parry'),(1,6,3275,'Linen Bandage'),(1,6,3276,'Heavy Linen Bandage'),(1,6,3277,'Wool Bandage'),(1,6,3278,'Heavy Wool Bandage'),(1,6,3365,'Opening'),(1,6,6233,'Closing'),(1,6,6246,'Closing'),(1,6,6247,'Opening'),(1,6,6477,'Opening'),(1,6,6478,'Opening'),(1,6,6603,'Attack'),(1,6,7266,'Duel'),(1,6,7267,'Grovel'),(1,6,7355,'Stuck'),(1,6,7928,'Silk Bandage'),(1,6,7929,'Heavy Silk Bandage'),(1,6,7934,'Anti-Venom'),(1,6,8386,'Attacking'),(1,6,8737,'Mail'),(1,6,9077,'Leather'),(1,6,9078,'Cloth'),(1,6,9125,'Generic'),(1,6,10840,'Mageweave Bandage'),(1,6,10841,'Heavy Mageweave Bandage'),(1,6,10846,'First Aid'),(1,6,18629,'Runecloth Bandage'),(1,6,18630,'Heavy Runecloth Bandage'),(1,6,20597,'Sword Specialization'),(1,6,20598,'The Human Spirit'),(1,6,20599,'Diplomacy'),(1,6,20864,'Mace Specialization'),(1,6,21651,'Opening'),(1,6,21652,'Closing'),(1,6,22027,'Remove Insignia'),(1,6,22810,'Opening - No Text'),(1,6,33391,'Journeyman Riding'),(1,6,45462,'Plague Strike'),(1,6,45477,'Icy Touch'),(1,6,45902,'Blood Strike'),(1,6,45903,'Offensive State (DND)'),(1,6,45927,'Summon Friend'),(1,6,47541,'Death Coil'),(1,6,48266,'Blood Presence'),(1,6,49410,'Forceful Deflection'),(1,6,49576,'Death Grip'),(1,6,52665,'Sigil'),(1,6,58985,'Perception'),(1,6,59752,'Every Man for Himself'),(1,6,59879,'Blood Plague'),(1,6,59921,'Frost Fever'),(1,6,61437,'Opening'),(1,6,61455,'Runic Focus'),(1,8,81,'Dodge'),(1,8,133,'Fireball'),(1,8,168,'Frost Armor'),(1,8,203,'Unarmed'),(1,8,204,'Defense'),(1,8,227,'Staves'),(1,8,522,'SPELLDEFENSE (DND)'),(1,8,668,'Language Common'),(1,8,1843,'Disarm'),(1,8,2382,'Generic'),(1,8,2479,'Honorless Target'),(1,8,3050,'Detect'),(1,8,3365,'Opening'),(1,8,5009,'Wands'),(1,8,5019,'Shoot'),(1,8,6233,'Closing'),(1,8,6246,'Closing'),(1,8,6247,'Opening'),(1,8,6477,'Opening'),(1,8,6478,'Opening'),(1,8,6603,'Attack'),(1,8,7266,'Duel'),(1,8,7267,'Grovel'),(1,8,7355,'Stuck'),(1,8,8386,'Attacking'),(1,8,9078,'Cloth'),(1,8,9125,'Generic'),(1,8,20597,'Sword Specialization'),(1,8,20598,'The Human Spirit'),(1,8,20599,'Diplomacy'),(1,8,20864,'Mace Specialization'),(1,8,21651,'Opening'),(1,8,21652,'Closing'),(1,8,22027,'Remove Insignia'),(1,8,22810,'Opening - No Text'),(1,8,45927,'Summon Friend'),(1,8,58985,'Perception'),(1,8,59752,'Every Man for Himself'),(1,8,61437,'Opening'),(1,9,81,'Dodge'),(1,9,203,'Unarmed'),(1,9,204,'Defense'),(1,9,522,'SPELLDEFENSE (DND)'),(1,9,668,'Language Common'),(1,9,686,'Shadow Bolt'),(1,9,687,'Demon Skin'),(1,9,1180,'Daggers'),(1,9,1843,'Disarm'),(1,9,2382,'Generic'),(1,9,2479,'Honorless Target'),(1,9,3050,'Detect'),(1,9,3365,'Opening'),(1,9,5009,'Wands'),(1,9,5019,'Shoot'),(1,9,6233,'Closing'),(1,9,6246,'Closing'),(1,9,6247,'Opening'),(1,9,6477,'Opening'),(1,9,6478,'Opening'),(1,9,6603,'Attack'),(1,9,7266,'Duel'),(1,9,7267,'Grovel'),(1,9,7355,'Stuck'),(1,9,8386,'Attacking'),(1,9,9078,'Cloth'),(1,9,9125,'Generic'),(1,9,20597,'Sword Specialization'),(1,9,20598,'The Human Spirit'),(1,9,20599,'Diplomacy'),(1,9,20864,'Mace Specialization'),(1,9,21651,'Opening'),(1,9,21652,'Closing'),(1,9,22027,'Remove Insignia'),(1,9,22810,'Opening - No Text'),(1,9,45927,'Summon Friend'),(5,9,58284,'Chaos Bolt Passive'),(1,9,58985,'Perception'),(1,9,59752,'Every Man for Himself'),(1,9,61437,'Opening'),(2,1,78,'Heroic Strike'),(2,1,81,'Dodge'),(2,1,107,'Block'),(2,1,196,'One-Handed Axes'),(2,1,197,'Two-Handed Axes'),(2,1,201,'One-Handed Swords'),(2,1,203,'Unarmed'),(2,1,204,'Defense'),(2,1,522,'SPELLDEFENSE (DND)'),(2,1,669,'Language Orcish'),(2,1,1843,'Disarm'),(2,1,2382,'Generic'),(2,1,2457,'Battle Stance'),(2,1,2479,'Honorless Target'),(2,1,3050,'Detect'),(2,1,3365,'Opening'),(2,1,5301,'Defensive State (DND)'),(2,1,6233,'Closing'),(2,1,6246,'Closing'),(2,1,6247,'Opening'),(2,1,6477,'Opening'),(2,1,6478,'Opening'),(2,1,6603,'Attack'),(2,1,7266,'Duel'),(2,1,7267,'Grovel'),(2,1,7355,'Stuck'),(2,1,8386,'Attacking'),(2,1,8737,'Mail'),(2,1,9077,'Leather'),(2,1,9078,'Cloth'),(2,1,9116,'Shield'),(2,1,9125,'Generic'),(2,1,20572,'Blood Fury'),(2,1,20573,'Hardiness'),(2,1,20574,'Axe Specialization'),(2,1,21563,'Command'),(2,1,21651,'Opening'),(2,1,21652,'Closing'),(2,1,22027,'Remove Insignia'),(2,1,22810,'Opening - No Text'),(2,1,32215,'Victorious State'),(2,1,45927,'Summon Friend'),(2,1,61437,'Opening'),(2,3,75,'Auto Shot'),(2,3,81,'Dodge'),(2,3,196,'One-Handed Axes'),(2,3,203,'Unarmed'),(2,3,204,'Defense'),(2,3,264,'Bows'),(2,3,522,'SPELLDEFENSE (DND)'),(2,3,669,'Language Orcish'),(2,3,1843,'Disarm'),(2,3,2382,'Generic'),(2,3,2479,'Honorless Target'),(2,3,2973,'Raptor Strike'),(2,3,3050,'Detect'),(2,3,3365,'Opening'),(2,3,6233,'Closing'),(2,3,6246,'Closing'),(2,3,6247,'Opening'),(2,3,6477,'Opening'),(2,3,6478,'Opening'),(2,3,6603,'Attack'),(2,3,7266,'Duel'),(2,3,7267,'Grovel'),(2,3,7355,'Stuck'),(2,3,8386,'Attacking'),(2,3,9077,'Leather'),(2,3,9078,'Cloth'),(2,3,9125,'Generic'),(2,3,13358,'Defensive State (DND)'),(2,3,20572,'Blood Fury'),(2,3,20573,'Hardiness'),(2,3,20574,'Axe Specialization'),(2,3,20576,'Command'),(2,3,21651,'Opening'),(2,3,21652,'Closing'),(2,3,22027,'Remove Insignia'),(2,3,22810,'Opening - No Text'),(2,3,24949,'Defensive State 2 (DND)'),(2,3,34082,'Advantaged State (DND)'),(2,3,45927,'Summon Friend'),(2,3,61437,'Opening'),(2,4,81,'Dodge'),(2,4,203,'Unarmed'),(2,4,204,'Defense'),(2,4,522,'SPELLDEFENSE (DND)'),(2,4,669,'Language Orcish'),(2,4,1180,'Daggers'),(2,4,1752,'Sinister Strike'),(2,4,1843,'Disarm'),(2,4,2098,'Eviscerate'),(2,4,2382,'Generic'),(2,4,2479,'Honorless Target'),(2,4,2567,'Thrown'),(2,4,2764,'Throw'),(2,4,3050,'Detect'),(2,4,3365,'Opening'),(2,4,6233,'Closing'),(2,4,6246,'Closing'),(2,4,6247,'Opening'),(2,4,6477,'Opening'),(2,4,6478,'Opening'),(2,4,6603,'Attack'),(2,4,7266,'Duel'),(2,4,7267,'Grovel'),(2,4,7355,'Stuck'),(2,4,8386,'Attacking'),(2,4,9077,'Leather'),(2,4,9078,'Cloth'),(2,4,9125,'Generic'),(2,4,16092,'Defensive State (DND)'),(2,4,20572,'Blood Fury'),(2,4,20573,'Hardiness'),(2,4,20574,'Axe Specialization'),(2,4,21184,'Rogue Passive (DND)'),(2,4,21563,'Command'),(2,4,21651,'Opening'),(2,4,21652,'Closing'),(2,4,22027,'Remove Insignia'),(2,4,22810,'Opening - No Text'),(2,4,45927,'Summon Friend'),(2,4,61437,'Opening'),(2,6,81,'Dodge'),(2,6,196,'One-Handed Axes'),(2,6,197,'Two-Handed Axes'),(2,6,200,'Polearms'),(2,6,201,'One-Handed Swords'),(2,6,202,'Two-Handed Swords'),(2,6,203,'Unarmed'),(2,6,204,'Defense'),(2,6,522,'SPELLDEFENSE (DND)'),(2,6,669,'Language Orcish'),(2,6,674,'Dual Wield'),(2,6,750,'Plate Mail'),(2,6,1843,'Disarm'),(2,6,2382,'Generic'),(2,6,2479,'Honorless Target'),(2,6,3050,'Detect'),(2,6,3127,'Parry'),(2,6,3275,'Linen Bandage'),(2,6,3276,'Heavy Linen Bandage'),(2,6,3277,'Wool Bandage'),(2,6,3278,'Heavy Wool Bandage'),(2,6,3365,'Opening'),(2,6,6233,'Closing'),(2,6,6246,'Closing'),(2,6,6247,'Opening'),(2,6,6477,'Opening'),(2,6,6478,'Opening'),(2,6,6603,'Attack'),(2,6,7266,'Duel'),(2,6,7267,'Grovel'),(2,6,7355,'Stuck'),(2,6,7928,'Silk Bandage'),(2,6,7929,'Heavy Silk Bandage'),(2,6,7934,'Anti-Venom'),(2,6,8386,'Attacking'),(2,6,8737,'Mail'),(2,6,9077,'Leather'),(2,6,9078,'Cloth'),(2,6,9125,'Generic'),(2,6,10840,'Mageweave Bandage'),(2,6,10841,'Heavy Mageweave Bandage'),(2,6,10846,'First Aid'),(2,6,18629,'Runecloth Bandage'),(2,6,18630,'Heavy Runecloth Bandage'),(2,6,20572,'Blood Fury'),(2,6,20573,'Hardiness'),(2,6,20574,'Axe Specialization'),(2,6,21651,'Opening'),(2,6,21652,'Closing'),(2,6,22027,'Remove Insignia'),(2,6,22810,'Opening - No Text'),(2,6,33391,'Journeyman Riding'),(2,6,45462,'Plague Strike'),(2,6,45477,'Icy Touch'),(2,6,45902,'Blood Strike'),(2,6,45903,'Offensive State (DND)'),(2,6,45927,'Summon Friend'),(2,6,47541,'Death Coil'),(2,6,48266,'Blood Presence'),(2,6,49410,'Forceful Deflection'),(2,6,49576,'Death Grip'),(2,6,52665,'Sigil'),(2,6,54562,'Command'),(2,6,59879,'Blood Plague'),(2,6,59921,'Frost Fever'),(2,6,61437,'Opening'),(2,6,61455,'Runic Focus'),(2,7,81,'Dodge'),(2,7,107,'Block'),(2,7,198,'One-Handed Maces'),(2,7,203,'Unarmed'),(2,7,204,'Defense'),(2,7,227,'Staves'),(2,7,331,'Healing Wave'),(2,7,403,'Lightning Bolt'),(2,7,522,'SPELLDEFENSE (DND)'),(2,7,669,'Language Orcish'),(2,7,1843,'Disarm'),(2,7,2382,'Generic'),(2,7,2479,'Honorless Target'),(2,7,3050,'Detect'),(2,7,3365,'Opening'),(2,7,6233,'Closing'),(2,7,6246,'Closing'),(2,7,6247,'Opening'),(2,7,6477,'Opening'),(2,7,6478,'Opening'),(2,7,6603,'Attack'),(2,7,7266,'Duel'),(2,7,7267,'Grovel'),(2,7,7355,'Stuck'),(2,7,8386,'Attacking'),(2,7,9077,'Leather'),(2,7,9078,'Cloth'),(2,7,9116,'Shield'),(2,7,9125,'Generic'),(2,7,20573,'Hardiness'),(2,7,20574,'Axe Specialization'),(2,7,21563,'Command'),(2,7,21651,'Opening'),(2,7,21652,'Closing'),(2,7,22027,'Remove Insignia'),(2,7,22810,'Opening - No Text'),(2,7,27763,'Totem'),(2,7,33697,'Blood Fury'),(2,7,45927,'Summon Friend'),(2,7,61437,'Opening'),(2,9,81,'Dodge'),(2,9,203,'Unarmed'),(2,9,204,'Defense'),(2,9,522,'SPELLDEFENSE (DND)'),(2,9,669,'Language Orcish'),(2,9,686,'Shadow Bolt'),(2,9,687,'Demon Skin'),(2,9,1180,'Daggers'),(2,9,1843,'Disarm'),(2,9,2382,'Generic'),(2,9,2479,'Honorless Target'),(2,9,3050,'Detect'),(2,9,3365,'Opening'),(2,9,5009,'Wands'),(2,9,5019,'Shoot'),(2,9,6233,'Closing'),(2,9,6246,'Closing'),(2,9,6247,'Opening'),(2,9,6477,'Opening'),(2,9,6478,'Opening'),(2,9,6603,'Attack'),(2,9,7266,'Duel'),(2,9,7267,'Grovel'),(2,9,7355,'Stuck'),(2,9,8386,'Attacking'),(2,9,9078,'Cloth'),(2,9,9125,'Generic'),(2,9,20573,'Hardiness'),(2,9,20574,'Axe Specialization'),(2,9,20575,'Command'),(2,9,21651,'Opening'),(2,9,21652,'Closing'),(2,9,22027,'Remove Insignia'),(2,9,22810,'Opening - No Text'),(2,9,33702,'Blood Fury'),(2,9,45927,'Summon Friend'),(2,9,58284,'Chaos Bolt Passive'),(2,9,61437,'Opening'),(3,1,78,'Heroic Strike'),(3,1,81,'Dodge'),(3,1,107,'Block'),(3,1,196,'One-Handed Axes'),(3,1,197,'Two-Handed Axes'),(3,1,198,'One-Handed Maces'),(3,1,203,'Unarmed'),(3,1,204,'Defense'),(3,1,522,'SPELLDEFENSE (DND)'),(3,1,668,'Language Common'),(3,1,672,'Language Dwarven'),(3,1,1843,'Disarm'),(3,1,2382,'Generic'),(3,1,2457,'Battle Stance'),(3,1,2479,'Honorless Target'),(3,1,2481,'Find Treasure'),(3,1,3050,'Detect'),(3,1,3365,'Opening'),(3,1,5301,'Defensive State (DND)'),(3,1,6233,'Closing'),(3,1,6246,'Closing'),(3,1,6247,'Opening'),(3,1,6477,'Opening'),(3,1,6478,'Opening'),(3,1,6603,'Attack'),(3,1,7266,'Duel'),(3,1,7267,'Grovel'),(3,1,7355,'Stuck'),(3,1,8386,'Attacking'),(3,1,8737,'Mail'),(3,1,9077,'Leather'),(3,1,9078,'Cloth'),(3,1,9116,'Shield'),(3,1,9125,'Generic'),(3,1,20594,'Stoneform'),(3,1,20595,'Gun Specialization'),(3,1,20596,'Frost Resistance'),(3,1,21651,'Opening'),(3,1,21652,'Closing'),(3,1,22027,'Remove Insignia'),(3,1,22810,'Opening - No Text'),(3,1,32215,'Victorious State'),(3,1,45927,'Summon Friend'),(3,1,59224,'Mace Specialization'),(3,1,61437,'Opening'),(3,2,81,'Dodge'),(3,2,107,'Block'),(3,2,198,'One-Handed Maces'),(3,2,199,'Two-Handed Maces'),(3,2,203,'Unarmed'),(3,2,204,'Defense'),(3,2,522,'SPELLDEFENSE (DND)'),(3,2,635,'Holy Light'),(3,2,668,'Language Common'),(3,2,672,'Language Dwarven'),(3,2,1843,'Disarm'),(3,2,2382,'Generic'),(3,2,2479,'Honorless Target'),(3,2,2481,'Find Treasure'),(3,2,3050,'Detect'),(3,2,3365,'Opening'),(3,2,6233,'Closing'),(3,2,6246,'Closing'),(3,2,6247,'Opening'),(3,2,6477,'Opening'),(3,2,6478,'Opening'),(3,2,6603,'Attack'),(3,2,7266,'Duel'),(3,2,7267,'Grovel'),(3,2,7355,'Stuck'),(3,2,8386,'Attacking'),(3,2,8737,'Mail'),(3,2,9077,'Leather'),(3,2,9078,'Cloth'),(3,2,9116,'Shield'),(3,2,9125,'Generic'),(3,2,21084,'Seal of Righteousness'),(3,2,20594,'Stoneform'),(3,2,20595,'Gun Specialization'),(3,2,20596,'Frost Resistance'),(3,2,21651,'Opening'),(3,2,21652,'Closing'),(3,2,22027,'Remove Insignia'),(3,2,22810,'Opening - No Text'),(3,2,27762,'Libram'),(3,2,45927,'Summon Friend'),(3,2,59224,'Mace Specialization'),(3,2,61437,'Opening'),(3,3,75,'Auto Shot'),(3,3,81,'Dodge'),(3,3,196,'One-Handed Axes'),(3,3,203,'Unarmed'),(3,3,204,'Defense'),(3,3,266,'Guns'),(3,3,522,'SPELLDEFENSE (DND)'),(3,3,668,'Language Common'),(3,3,672,'Language Dwarven'),(3,3,1843,'Disarm'),(3,3,2382,'Generic'),(3,3,2479,'Honorless Target'),(3,3,2481,'Find Treasure'),(3,3,2973,'Raptor Strike'),(3,3,3050,'Detect'),(3,3,3365,'Opening'),(3,3,6233,'Closing'),(3,3,6246,'Closing'),(3,3,6247,'Opening'),(3,3,6477,'Opening'),(3,3,6478,'Opening'),(3,3,6603,'Attack'),(3,3,7266,'Duel'),(3,3,7267,'Grovel'),(3,3,7355,'Stuck'),(3,3,8386,'Attacking'),(3,3,9077,'Leather'),(3,3,9078,'Cloth'),(3,3,9125,'Generic'),(3,3,13358,'Defensive State (DND)'),(3,3,20594,'Stoneform'),(3,3,20595,'Gun Specialization'),(3,3,20596,'Frost Resistance'),(3,3,21651,'Opening'),(3,3,21652,'Closing'),(3,3,22027,'Remove Insignia'),(3,3,22810,'Opening - No Text'),(3,3,24949,'Defensive State 2 (DND)'),(3,3,34082,'Advantaged State (DND)'),(3,3,45927,'Summon Friend'),(3,3,59224,'Mace Specialization'),(3,3,61437,'Opening'),(3,4,81,'Dodge'),(3,4,203,'Unarmed'),(3,4,204,'Defense'),(3,4,522,'SPELLDEFENSE (DND)'),(3,4,668,'Language Common'),(3,4,672,'Language Dwarven'),(3,4,1180,'Daggers'),(3,4,1752,'Sinister Strike'),(3,4,1843,'Disarm'),(3,4,2098,'Eviscerate'),(3,4,2382,'Generic'),(3,4,2479,'Honorless Target'),(3,4,2481,'Find Treasure'),(3,4,2567,'Thrown'),(3,4,2764,'Throw'),(3,4,3050,'Detect'),(3,4,3365,'Opening'),(3,4,6233,'Closing'),(3,4,6246,'Closing'),(3,4,6247,'Opening'),(3,4,6477,'Opening'),(3,4,6478,'Opening'),(3,4,6603,'Attack'),(3,4,7266,'Duel'),(3,4,7267,'Grovel'),(3,4,7355,'Stuck'),(3,4,8386,'Attacking'),(3,4,9077,'Leather'),(3,4,9078,'Cloth'),(3,4,9125,'Generic'),(3,4,16092,'Defensive State (DND)'),(3,4,20594,'Stoneform'),(3,4,20595,'Gun Specialization'),(3,4,20596,'Frost Resistance'),(3,4,21184,'Rogue Passive (DND)'),(3,4,21651,'Opening'),(3,4,21652,'Closing'),(3,4,22027,'Remove Insignia'),(3,4,22810,'Opening - No Text'),(3,4,45927,'Summon Friend'),(3,4,59224,'Mace Specialization'),(3,4,61437,'Opening'),(3,5,81,'Dodge'),(3,5,198,'One-Handed Maces'),(3,5,203,'Unarmed'),(3,5,204,'Defense'),(3,5,522,'SPELLDEFENSE (DND)'),(3,5,585,'Smite'),(3,5,668,'Language Common'),(3,5,672,'Language Dwarven'),(3,5,1843,'Disarm'),(3,5,2050,'Lesser Heal'),(3,5,2382,'Generic'),(3,5,2479,'Honorless Target'),(3,5,2481,'Find Treasure'),(3,5,3050,'Detect'),(3,5,3365,'Opening'),(3,5,5009,'Wands'),(3,5,5019,'Shoot'),(3,5,6233,'Closing'),(3,5,6246,'Closing'),(3,5,6247,'Opening'),(3,5,6477,'Opening'),(3,5,6478,'Opening'),(3,5,6603,'Attack'),(3,5,7266,'Duel'),(3,5,7267,'Grovel'),(3,5,7355,'Stuck'),(3,5,8386,'Attacking'),(3,5,9078,'Cloth'),(3,5,9125,'Generic'),(3,5,20594,'Stoneform'),(3,5,20595,'Gun Specialization'),(3,5,20596,'Frost Resistance'),(3,5,21651,'Opening'),(3,5,21652,'Closing'),(3,5,22027,'Remove Insignia'),(3,5,22810,'Opening - No Text'),(3,5,45927,'Summon Friend'),(3,5,59224,'Mace Specialization'),(3,5,61437,'Opening'),(3,6,81,'Dodge'),(3,6,196,'One-Handed Axes'),(3,6,197,'Two-Handed Axes'),(3,6,200,'Polearms'),(3,6,201,'One-Handed Swords'),(3,6,202,'Two-Handed Swords'),(3,6,203,'Unarmed'),(3,6,204,'Defense'),(3,6,522,'SPELLDEFENSE (DND)'),(3,6,668,'Language Common'),(3,6,672,'Language Dwarven'),(3,6,674,'Dual Wield'),(3,6,750,'Plate Mail'),(3,6,1843,'Disarm'),(3,6,2382,'Generic'),(3,6,2479,'Honorless Target'),(3,6,2481,'Find Treasure'),(3,6,3050,'Detect'),(3,6,3127,'Parry'),(3,6,3275,'Linen Bandage'),(3,6,3276,'Heavy Linen Bandage'),(3,6,3277,'Wool Bandage'),(3,6,3278,'Heavy Wool Bandage'),(3,6,3365,'Opening'),(3,6,6233,'Closing'),(3,6,6246,'Closing'),(3,6,6247,'Opening'),(3,6,6477,'Opening'),(3,6,6478,'Opening'),(3,6,6603,'Attack'),(3,6,7266,'Duel'),(3,6,7267,'Grovel'),(3,6,7355,'Stuck'),(3,6,7928,'Silk Bandage'),(3,6,7929,'Heavy Silk Bandage'),(3,6,7934,'Anti-Venom'),(3,6,8386,'Attacking'),(3,6,8737,'Mail'),(3,6,9077,'Leather'),(3,6,9078,'Cloth'),(3,6,9125,'Generic'),(3,6,10840,'Mageweave Bandage'),(3,6,10841,'Heavy Mageweave Bandage'),(3,6,10846,'First Aid'),(3,6,18629,'Runecloth Bandage'),(3,6,18630,'Heavy Runecloth Bandage'),(3,6,20594,'Stoneform'),(3,6,20595,'Gun Specialization'),(3,6,20596,'Frost Resistance'),(3,6,21651,'Opening'),(3,6,21652,'Closing'),(3,6,22027,'Remove Insignia'),(3,6,22810,'Opening - No Text'),(3,6,33391,'Journeyman Riding'),(3,6,45462,'Plague Strike'),(3,6,45477,'Icy Touch'),(3,6,45902,'Blood Strike'),(3,6,45903,'Offensive State (DND)'),(3,6,45927,'Summon Friend'),(3,6,47541,'Death Coil'),(3,6,48266,'Blood Presence'),(3,6,49410,'Forceful Deflection'),(3,6,49576,'Death Grip'),(3,6,52665,'Sigil'),(3,6,59224,'Mace Specialization'),(3,6,59879,'Blood Plague'),(3,6,59921,'Frost Fever'),(3,6,61437,'Opening'),(3,6,61455,'Runic Focus'),(4,1,78,'Heroic Strike'),(4,1,81,'Dodge'),(4,1,107,'Block'),(4,1,198,'One-Handed Maces'),(4,1,201,'One-Handed Swords'),(4,1,203,'Unarmed'),(4,1,204,'Defense'),(4,1,522,'SPELLDEFENSE (DND)'),(4,1,668,'Language Common'),(4,1,671,'Language Darnassian'),(4,1,1180,'Daggers'),(4,1,1843,'Disarm'),(4,1,2382,'Generic'),(4,1,2457,'Battle Stance'),(4,1,2479,'Honorless Target'),(4,1,3050,'Detect'),(4,1,3365,'Opening'),(4,1,5301,'Defensive State (DND)'),(4,1,6233,'Closing'),(4,1,6246,'Closing'),(4,1,6247,'Opening'),(4,1,6477,'Opening'),(4,1,6478,'Opening'),(4,1,6603,'Attack'),(4,1,7266,'Duel'),(4,1,7267,'Grovel'),(4,1,7355,'Stuck'),(4,1,8386,'Attacking'),(4,1,8737,'Mail'),(4,1,9077,'Leather'),(4,1,9078,'Cloth'),(4,1,9116,'Shield'),(4,1,9125,'Generic'),(4,1,20582,'Quickness'),(4,1,20583,'Nature Resistance'),(4,1,20585,'Wisp Spirit'),(4,1,21651,'Opening'),(4,1,21652,'Closing'),(4,1,22027,'Remove Insignia'),(4,1,22810,'Opening - No Text'),(4,1,32215,'Victorious State'),(4,1,45927,'Summon Friend'),(4,1,58984,'Shadowmelt'),(4,1,61437,'Opening'),(4,3,75,'Auto Shot'),(4,3,81,'Dodge'),(4,3,203,'Unarmed'),(4,3,204,'Defense'),(4,3,264,'Bows'),(4,3,522,'SPELLDEFENSE (DND)'),(4,3,668,'Language Common'),(4,3,671,'Language Darnassian'),(4,3,1180,'Daggers'),(4,3,1843,'Disarm'),(4,3,2382,'Generic'),(4,3,2479,'Honorless Target'),(4,3,2973,'Raptor Strike'),(4,3,3050,'Detect'),(4,3,3365,'Opening'),(4,3,6233,'Closing'),(4,3,6246,'Closing'),(4,3,6247,'Opening'),(4,3,6477,'Opening'),(4,3,6478,'Opening'),(4,3,6603,'Attack'),(4,3,7266,'Duel'),(4,3,7267,'Grovel'),(4,3,7355,'Stuck'),(4,3,8386,'Attacking'),(4,3,9077,'Leather'),(4,3,9078,'Cloth'),(4,3,9125,'Generic'),(4,3,13358,'Defensive State (DND)'),(4,3,20582,'Quickness'),(4,3,20583,'Nature Resistance'),(4,3,20585,'Wisp Spirit'),(4,3,21651,'Opening'),(4,3,21652,'Closing'),(4,3,22027,'Remove Insignia'),(4,3,22810,'Opening - No Text'),(4,3,24949,'Defensive State 2 (DND)'),(4,3,34082,'Advantaged State (DND)'),(4,3,45927,'Summon Friend'),(4,3,58984,'Shadowmelt'),(4,3,61437,'Opening'),(4,4,81,'Dodge'),(4,4,203,'Unarmed'),(4,4,204,'Defense'),(4,4,522,'SPELLDEFENSE (DND)'),(4,4,668,'Language Common'),(4,4,671,'Language Darnassian'),(4,4,1180,'Daggers'),(4,4,1752,'Sinister Strike'),(4,4,1843,'Disarm'),(4,4,2098,'Eviscerate'),(4,4,2382,'Generic'),(4,4,2479,'Honorless Target'),(4,4,2567,'Thrown'),(4,4,2764,'Throw'),(4,4,3050,'Detect'),(4,4,3365,'Opening'),(4,4,6233,'Closing'),(4,4,6246,'Closing'),(4,4,6247,'Opening'),(4,4,6477,'Opening'),(4,4,6478,'Opening'),(4,4,6603,'Attack'),(4,4,7266,'Duel'),(4,4,7267,'Grovel'),(4,4,7355,'Stuck'),(4,4,8386,'Attacking'),(4,4,9077,'Leather'),(4,4,9078,'Cloth'),(4,4,9125,'Generic'),(4,4,16092,'Defensive State (DND)'),(4,4,20582,'Quickness'),(4,4,20583,'Nature Resistance'),(4,4,20585,'Wisp Spirit'),(4,4,21184,'Rogue Passive (DND)'),(4,4,21651,'Opening'),(4,4,21652,'Closing'),(4,4,22027,'Remove Insignia'),(4,4,22810,'Opening - No Text'),(4,4,45927,'Summon Friend'),(4,4,58984,'Shadowmelt'),(4,4,61437,'Opening'),(4,5,81,'Dodge'),(4,5,198,'One-Handed Maces'),(4,5,203,'Unarmed'),(4,5,204,'Defense'),(4,5,522,'SPELLDEFENSE (DND)'),(4,5,585,'Smite'),(4,5,668,'Language Common'),(4,5,671,'Language Darnassian'),(4,5,1843,'Disarm'),(4,5,2050,'Lesser Heal'),(4,5,2382,'Generic'),(4,5,2479,'Honorless Target'),(4,5,3050,'Detect'),(4,5,3365,'Opening'),(4,5,5009,'Wands'),(4,5,5019,'Shoot'),(4,5,6233,'Closing'),(4,5,6246,'Closing'),(4,5,6247,'Opening'),(4,5,6477,'Opening'),(4,5,6478,'Opening'),(4,5,6603,'Attack'),(4,5,7266,'Duel'),(4,5,7267,'Grovel'),(4,5,7355,'Stuck'),(4,5,8386,'Attacking'),(4,5,9078,'Cloth'),(4,5,9125,'Generic'),(4,5,20582,'Quickness'),(4,5,20583,'Nature Resistance'),(4,5,20585,'Wisp Spirit'),(4,5,21651,'Opening'),(4,5,21652,'Closing'),(4,5,22027,'Remove Insignia'),(4,5,22810,'Opening - No Text'),(4,5,45927,'Summon Friend'),(4,5,58984,'Shadowmelt'),(4,5,61437,'Opening'),(4,6,81,'Dodge'),(4,6,196,'One-Handed Axes'),(4,6,197,'Two-Handed Axes'),(4,6,200,'Polearms'),(4,6,201,'One-Handed Swords'),(4,6,202,'Two-Handed Swords'),(4,6,203,'Unarmed'),(4,6,204,'Defense'),(4,6,522,'SPELLDEFENSE (DND)'),(4,6,668,'Language Common'),(4,6,671,'Language Darnassian'),(4,6,674,'Dual Wield'),(4,6,750,'Plate Mail'),(4,6,1843,'Disarm'),(4,6,2382,'Generic'),(4,6,2479,'Honorless Target'),(4,6,3050,'Detect'),(4,6,3127,'Parry'),(4,6,3275,'Linen Bandage'),(4,6,3276,'Heavy Linen Bandage'),(4,6,3277,'Wool Bandage'),(4,6,3278,'Heavy Wool Bandage'),(4,6,3365,'Opening'),(4,6,6233,'Closing'),(4,6,6246,'Closing'),(4,6,6247,'Opening'),(4,6,6477,'Opening'),(4,6,6478,'Opening'),(4,6,6603,'Attack'),(4,6,7266,'Duel'),(4,6,7267,'Grovel'),(4,6,7355,'Stuck'),(4,6,7928,'Silk Bandage'),(4,6,7929,'Heavy Silk Bandage'),(4,6,7934,'Anti-Venom'),(4,6,8386,'Attacking'),(4,6,8737,'Mail'),(4,6,9077,'Leather'),(4,6,9078,'Cloth'),(4,6,9125,'Generic'),(4,6,10840,'Mageweave Bandage'),(4,6,10841,'Heavy Mageweave Bandage'),(4,6,10846,'First Aid'),(4,6,18629,'Runecloth Bandage'),(4,6,18630,'Heavy Runecloth Bandage'),(4,6,20582,'Quickness'),(4,6,20583,'Nature Resistance'),(4,6,20585,'Wisp Spirit'),(4,6,21651,'Opening'),(4,6,21652,'Closing'),(4,6,22027,'Remove Insignia'),(4,6,22810,'Opening - No Text'),(4,6,33391,'Journeyman Riding'),(4,6,45462,'Plague Strike'),(4,6,45477,'Icy Touch'),(4,6,45902,'Blood Strike'),(4,6,45903,'Offensive State (DND)'),(4,6,45927,'Summon Friend'),(4,6,47541,'Death Coil'),(4,6,48266,'Blood Presence'),(4,6,49410,'Forceful Deflection'),(4,6,49576,'Death Grip'),(4,6,52665,'Sigil'),(4,6,58984,'Shadowmeld'),(4,6,59879,'Blood Plague'),(4,6,59921,'Frost Fever'),(4,6,61437,'Opening'),(4,6,61455,'Runic Focus'),(4,11,81,'Dodge'),(4,11,203,'Unarmed'),(4,11,204,'Defense'),(4,11,227,'Staves'),(4,11,522,'SPELLDEFENSE (DND)'),(4,11,668,'Language Common'),(4,11,671,'Language Darnassian'),(4,11,1180,'Daggers'),(4,11,1843,'Disarm'),(4,11,2382,'Generic'),(4,11,2479,'Honorless Target'),(4,11,3050,'Detect'),(4,11,3365,'Opening'),(4,11,5176,'Wrath'),(4,11,5185,'Healing Touch'),(4,11,6233,'Closing'),(4,11,6246,'Closing'),(4,11,6247,'Opening'),(4,11,6477,'Opening'),(4,11,6478,'Opening'),(4,11,6603,'Attack'),(4,11,7266,'Duel'),(4,11,7267,'Grovel'),(4,11,7355,'Stuck'),(4,11,8386,'Attacking'),(4,11,9077,'Leather'),(4,11,9078,'Cloth'),(4,11,9125,'Generic'),(4,11,20582,'Quickness'),(4,11,20583,'Nature Resistance'),(4,11,20585,'Wisp Spirit'),(4,11,21651,'Opening'),(4,11,21652,'Closing'),(4,11,22027,'Remove Insignia'),(4,11,22810,'Opening - No Text'),(4,11,27764,'Fetish'),(4,11,45927,'Summon Friend'),(4,11,58984,'Shadowmelt'),(4,11,61437,'Opening'),(5,1,78,'Heroic Strike'),(5,1,81,'Dodge'),(5,1,107,'Block'),(5,1,201,'One-Handed Swords'),(5,1,202,'Two-Handed Swords'),(5,1,203,'Unarmed'),(5,1,204,'Defense'),(5,1,522,'SPELLDEFENSE (DND)'),(5,1,669,'Language Orcish'),(5,1,1180,'Daggers'),(5,1,1843,'Disarm'),(5,1,2382,'Generic'),(5,1,2457,'Battle Stance'),(5,1,2479,'Honorless Target'),(5,1,3050,'Detect'),(5,1,3365,'Opening'),(5,1,5227,'Underwater Breathing'),(5,1,5301,'Defensive State (DND)'),(5,1,6233,'Closing'),(5,1,6246,'Closing'),(5,1,6247,'Opening'),(5,1,6477,'Opening'),(5,1,6478,'Opening'),(5,1,6603,'Attack'),(5,1,7266,'Duel'),(5,1,7267,'Grovel'),(5,1,7355,'Stuck'),(5,1,7744,'Will of the Forsaken'),(5,1,8386,'Attacking'),(5,1,8737,'Mail'),(5,1,9077,'Leather'),(5,1,9078,'Cloth'),(5,1,9116,'Shield'),(5,1,9125,'Generic'),(5,1,17737,'Language Gutterspeak'),(5,1,20577,'Cannibalize'),(5,1,20579,'Shadow Resistance'),(5,1,21651,'Opening'),(5,1,21652,'Closing'),(5,1,22027,'Remove Insignia'),(5,1,22810,'Opening - No Text'),(5,1,32215,'Victorious State'),(5,1,45927,'Summon Friend'),(5,1,61437,'Opening'),(5,4,81,'Dodge'),(5,4,203,'Unarmed'),(5,4,204,'Defense'),(5,4,522,'SPELLDEFENSE (DND)'),(5,4,669,'Language Orcish'),(5,4,1180,'Daggers'),(5,4,1752,'Sinister Strike'),(5,4,1843,'Disarm'),(5,4,2098,'Eviscerate'),(5,4,2382,'Generic'),(5,4,2479,'Honorless Target'),(5,4,2567,'Thrown'),(5,4,2764,'Throw'),(5,4,3050,'Detect'),(5,4,3365,'Opening'),(5,4,5227,'Underwater Breathing'),(5,4,6233,'Closing'),(5,4,6246,'Closing'),(5,4,6247,'Opening'),(5,4,6477,'Opening'),(5,4,6478,'Opening'),(5,4,6603,'Attack'),(5,4,7266,'Duel'),(5,4,7267,'Grovel'),(5,4,7355,'Stuck'),(5,4,7744,'Will of the Forsaken'),(5,4,8386,'Attacking'),(5,4,9077,'Leather'),(5,4,9078,'Cloth'),(5,4,9125,'Generic'),(5,4,16092,'Defensive State (DND)'),(5,4,17737,'Language Gutterspeak'),(5,4,20577,'Cannibalize'),(5,4,20579,'Shadow Resistance'),(5,4,21184,'Rogue Passive (DND)'),(5,4,21651,'Opening'),(5,4,21652,'Closing'),(5,4,22027,'Remove Insignia'),(5,4,22810,'Opening - No Text'),(5,4,45927,'Summon Friend'),(5,4,61437,'Opening'),(5,5,81,'Dodge'),(5,5,198,'One-Handed Maces'),(5,5,203,'Unarmed'),(5,5,204,'Defense'),(5,5,522,'SPELLDEFENSE (DND)'),(5,5,585,'Smite'),(5,5,669,'Language Orcish'),(5,5,1843,'Disarm'),(5,5,2050,'Lesser Heal'),(5,5,2382,'Generic'),(5,5,2479,'Honorless Target'),(5,5,3050,'Detect'),(5,5,3365,'Opening'),(5,5,5009,'Wands'),(5,5,5019,'Shoot'),(5,5,5227,'Underwater Breathing'),(5,5,6233,'Closing'),(5,5,6246,'Closing'),(5,5,6247,'Opening'),(5,5,6477,'Opening'),(5,5,6478,'Opening'),(5,5,6603,'Attack'),(5,5,7266,'Duel'),(5,5,7267,'Grovel'),(5,5,7355,'Stuck'),(5,5,7744,'Will of the Forsaken'),(5,5,8386,'Attacking'),(5,5,9078,'Cloth'),(5,5,9125,'Generic'),(5,5,17737,'Language Gutterspeak'),(5,5,20577,'Cannibalize'),(5,5,20579,'Shadow Resistance'),(5,5,21651,'Opening'),(5,5,21652,'Closing'),(5,5,22027,'Remove Insignia'),(5,5,22810,'Opening - No Text'),(5,5,45927,'Summon Friend'),(5,5,61437,'Opening'),(5,6,81,'Dodge'),(5,6,196,'One-Handed Axes'),(5,6,197,'Two-Handed Axes'),(5,6,200,'Polearms'),(5,6,201,'One-Handed Swords'),(5,6,202,'Two-Handed Swords'),(5,6,203,'Unarmed'),(5,6,204,'Defense'),(5,6,522,'SPELLDEFENSE (DND)'),(5,6,669,'Language Orcish'),(5,6,674,'Dual Wield'),(5,6,750,'Plate Mail'),(5,6,1843,'Disarm'),(5,6,2382,'Generic'),(5,6,2479,'Honorless Target'),(5,6,3050,'Detect'),(5,6,3127,'Parry'),(5,6,3275,'Linen Bandage'),(5,6,3276,'Heavy Linen Bandage'),(5,6,3277,'Wool Bandage'),(5,6,3278,'Heavy Wool Bandage'),(5,6,3365,'Opening'),(5,6,5227,'Underwater Breathing'),(5,6,6233,'Closing'),(5,6,6246,'Closing'),(5,6,6247,'Opening'),(5,6,6477,'Opening'),(5,6,6478,'Opening'),(5,6,6603,'Attack'),(5,6,7266,'Duel'),(5,6,7267,'Grovel'),(5,6,7355,'Stuck'),(5,6,7744,'Will of the Forsaken'),(5,6,7928,'Silk Bandage'),(5,6,7929,'Heavy Silk Bandage'),(5,6,7934,'Anti-Venom'),(5,6,8386,'Attacking'),(5,6,8737,'Mail'),(5,6,9077,'Leather'),(5,6,9078,'Cloth'),(5,6,9125,'Generic'),(5,6,10840,'Mageweave Bandage'),(5,6,10841,'Heavy Mageweave Bandage'),(5,6,10846,'First Aid'),(5,6,17737,'Language Gutterspeak'),(5,6,18629,'Runecloth Bandage'),(5,6,18630,'Heavy Runecloth Bandage'),(5,6,20577,'Cannibalize'),(5,6,20579,'Shadow Resistance'),(5,6,21651,'Opening'),(5,6,21652,'Closing'),(5,6,22027,'Remove Insignia'),(5,6,22810,'Opening - No Text'),(5,6,33391,'Journeyman Riding'),(5,6,45462,'Plague Strike'),(5,6,45477,'Icy Touch'),(5,6,45902,'Blood Strike'),(5,6,45903,'Offensive State (DND)'),(5,6,45927,'Summon Friend'),(5,6,47541,'Death Coil'),(5,6,48266,'Blood Presence'),(5,6,49410,'Forceful Deflection'),(5,6,49576,'Death Grip'),(5,6,52665,'Sigil'),(5,6,59879,'Blood Plague'),(5,6,59921,'Frost Fever'),(5,6,61437,'Opening'),(5,6,61455,'Runic Focus'),(5,8,81,'Dodge'),(5,8,133,'Fireball'),(5,8,168,'Frost Armor'),(5,8,203,'Unarmed'),(5,8,204,'Defense'),(5,8,227,'Staves'),(5,8,522,'SPELLDEFENSE (DND)'),(5,8,669,'Language Orcish'),(5,8,1843,'Disarm'),(5,8,2382,'Generic'),(5,8,2479,'Honorless Target'),(5,8,3050,'Detect'),(5,8,3365,'Opening'),(5,8,5009,'Wands'),(5,8,5019,'Shoot'),(5,8,5227,'Underwater Breathing'),(5,8,6233,'Closing'),(5,8,6246,'Closing'),(5,8,6247,'Opening'),(5,8,6477,'Opening'),(5,8,6478,'Opening'),(5,8,6603,'Attack'),(5,8,7266,'Duel'),(5,8,7267,'Grovel'),(5,8,7355,'Stuck'),(5,8,7744,'Will of the Forsaken'),(5,8,8386,'Attacking'),(5,8,9078,'Cloth'),(5,8,9125,'Generic'),(5,8,17737,'Language Gutterspeak'),(5,8,20577,'Cannibalize'),(5,8,20579,'Shadow Resistance'),(5,8,21651,'Opening'),(5,8,21652,'Closing'),(5,8,22027,'Remove Insignia'),(5,8,22810,'Opening - No Text'),(5,8,45927,'Summon Friend'),(5,8,61437,'Opening'),(5,9,81,'Dodge'),(5,9,203,'Unarmed'),(5,9,204,'Defense'),(5,9,522,'SPELLDEFENSE (DND)'),(5,9,669,'Language Orcish'),(5,9,686,'Shadow Bolt'),(5,9,687,'Demon Skin'),(5,9,1180,'Daggers'),(5,9,1843,'Disarm'),(5,9,2382,'Generic'),(5,9,2479,'Honorless Target'),(5,9,3050,'Detect'),(5,9,3365,'Opening'),(5,9,5009,'Wands'),(5,9,5019,'Shoot'),(5,9,5227,'Underwater Breathing'),(5,9,6233,'Closing'),(5,9,6246,'Closing'),(5,9,6247,'Opening'),(5,9,6477,'Opening'),(5,9,6478,'Opening'),(5,9,6603,'Attack'),(5,9,7266,'Duel'),(5,9,7267,'Grovel'),(5,9,7355,'Stuck'),(5,9,7744,'Will of the Forsaken'),(5,9,8386,'Attacking'),(5,9,9078,'Cloth'),(5,9,9125,'Generic'),(5,9,17737,'Language Gutterspeak'),(5,9,20577,'Cannibalize'),(5,9,20579,'Shadow Resistance'),(5,9,21651,'Opening'),(5,9,21652,'Closing'),(5,9,22027,'Remove Insignia'),(5,9,22810,'Opening - No Text'),(5,9,45927,'Summon Friend'),(1,9,58284,'Chaos Bolt Passive'),(5,9,61437,'Opening'),(6,1,78,'Heroic Strike'),(6,1,81,'Dodge'),(6,1,107,'Block'),(6,1,196,'One-Handed Axes'),(6,1,198,'One-Handed Maces'),(6,1,199,'Two-Handed Maces'),(6,1,203,'Unarmed'),(6,1,204,'Defense'),(6,1,522,'SPELLDEFENSE (DND)'),(6,1,669,'Language Orcish'),(6,1,670,'Language Taurahe'),(6,1,1843,'Disarm'),(6,1,2382,'Generic'),(6,1,2457,'Battle Stance'),(6,1,2479,'Honorless Target'),(6,1,3050,'Detect'),(6,1,3365,'Opening'),(6,1,5301,'Defensive State (DND)'),(6,1,6233,'Closing'),(6,1,6246,'Closing'),(6,1,6247,'Opening'),(6,1,6477,'Opening'),(6,1,6478,'Opening'),(6,1,6603,'Attack'),(6,1,7266,'Duel'),(6,1,7267,'Grovel'),(6,1,7355,'Stuck'),(6,1,8386,'Attacking'),(6,1,8737,'Mail'),(6,1,9077,'Leather'),(6,1,9078,'Cloth'),(6,1,9116,'Shield'),(6,1,9125,'Generic'),(6,1,20549,'War Stomp'),(6,1,20550,'Endurance'),(6,1,20551,'Nature Resistance'),(6,1,20552,'Cultivation'),(6,1,21651,'Opening'),(6,1,21652,'Closing'),(6,1,22027,'Remove Insignia'),(6,1,22810,'Opening - No Text'),(6,1,32215,'Victorious State'),(6,1,45927,'Summon Friend'),(6,1,61437,'Opening'),(6,3,75,'Auto Shot'),(6,3,81,'Dodge'),(6,3,196,'One-Handed Axes'),(6,3,203,'Unarmed'),(6,3,204,'Defense'),(6,3,266,'Guns'),(6,3,522,'SPELLDEFENSE (DND)'),(6,3,669,'Language Orcish'),(6,3,670,'Language Taurahe'),(6,3,1843,'Disarm'),(6,3,2382,'Generic'),(6,3,2479,'Honorless Target'),(6,3,2973,'Raptor Strike'),(6,3,3050,'Detect'),(6,3,3365,'Opening'),(6,3,6233,'Closing'),(6,3,6246,'Closing'),(6,3,6247,'Opening'),(6,3,6477,'Opening'),(6,3,6478,'Opening'),(6,3,6603,'Attack'),(6,3,7266,'Duel'),(6,3,7267,'Grovel'),(6,3,7355,'Stuck'),(6,3,8386,'Attacking'),(6,3,9077,'Leather'),(6,3,9078,'Cloth'),(6,3,9125,'Generic'),(6,3,13358,'Defensive State (DND)'),(6,3,20549,'War Stomp'),(6,3,20550,'Endurance'),(6,3,20551,'Nature Resistance'),(6,3,20552,'Cultivation'),(6,3,21651,'Opening'),(6,3,21652,'Closing'),(6,3,22027,'Remove Insignia'),(6,3,22810,'Opening - No Text'),(6,3,24949,'Defensive State 2 (DND)'),(6,3,34082,'Advantaged State (DND)'),(6,3,45927,'Summon Friend'),(6,3,61437,'Opening'),(6,6,81,'Dodge'),(6,6,196,'One-Handed Axes'),(6,6,197,'Two-Handed Axes'),(6,6,200,'Polearms'),(6,6,201,'One-Handed Swords'),(6,6,202,'Two-Handed Swords'),(6,6,203,'Unarmed'),(6,6,204,'Defense'),(6,6,522,'SPELLDEFENSE (DND)'),(6,6,669,'Language Orcish'),(6,6,670,'Language Taurahe'),(6,6,674,'Dual Wield'),(6,6,750,'Plate Mail'),(6,6,1843,'Disarm'),(6,6,2382,'Generic'),(6,6,2479,'Honorless Target'),(6,6,3050,'Detect'),(6,6,3127,'Parry'),(6,6,3275,'Linen Bandage'),(6,6,3276,'Heavy Linen Bandage'),(6,6,3277,'Wool Bandage'),(6,6,3278,'Heavy Wool Bandage'),(6,6,3365,'Opening'),(6,6,6233,'Closing'),(6,6,6246,'Closing'),(6,6,6247,'Opening'),(6,6,6477,'Opening'),(6,6,6478,'Opening'),(6,6,6603,'Attack'),(6,6,7266,'Duel'),(6,6,7267,'Grovel'),(6,6,7355,'Stuck'),(6,6,7928,'Silk Bandage'),(6,6,7929,'Heavy Silk Bandage'),(6,6,7934,'Anti-Venom'),(6,6,8386,'Attacking'),(6,6,8737,'Mail'),(6,6,9077,'Leather'),(6,6,9078,'Cloth'),(6,6,9125,'Generic'),(6,6,10840,'Mageweave Bandage'),(6,6,10841,'Heavy Mageweave Bandage'),(6,6,10846,'First Aid'),(6,6,18629,'Runecloth Bandage'),(6,6,18630,'Heavy Runecloth Bandage'),(6,6,20549,'War Stomp'),(6,6,20550,'Endurance'),(6,6,20551,'Nature Resistance'),(6,6,20552,'Cultivation'),(6,6,21651,'Opening'),(6,6,21652,'Closing'),(6,6,22027,'Remove Insignia'),(6,6,22810,'Opening - No Text'),(6,6,33391,'Journeyman Riding'),(6,6,45462,'Plague Strike'),(6,6,45477,'Icy Touch'),(6,6,45902,'Blood Strike'),(6,6,45903,'Offensive State (DND)'),(6,6,45927,'Summon Friend'),(6,6,47541,'Death Coil'),(6,6,48266,'Blood Presence'),(6,6,49410,'Forceful Deflection'),(6,6,49576,'Death Grip'),(6,6,52665,'Sigil'),(6,6,59879,'Blood Plague'),(6,6,59921,'Frost Fever'),(6,6,61437,'Opening'),(6,6,61455,'Runic Focus'),(6,7,81,'Dodge'),(6,7,107,'Block'),(6,7,198,'One-Handed Maces'),(6,7,203,'Unarmed'),(6,7,204,'Defense'),(6,7,227,'Staves'),(6,7,331,'Healing Wave'),(6,7,403,'Lightning Bolt'),(6,7,522,'SPELLDEFENSE (DND)'),(6,7,669,'Language Orcish'),(6,7,670,'Language Taurahe'),(6,7,1843,'Disarm'),(6,7,2382,'Generic'),(6,7,2479,'Honorless Target'),(6,7,3050,'Detect'),(6,7,3365,'Opening'),(6,7,6233,'Closing'),(6,7,6246,'Closing'),(6,7,6247,'Opening'),(6,7,6477,'Opening'),(6,7,6478,'Opening'),(6,7,6603,'Attack'),(6,7,7266,'Duel'),(6,7,7267,'Grovel'),(6,7,7355,'Stuck'),(6,7,8386,'Attacking'),(6,7,9077,'Leather'),(6,7,9078,'Cloth'),(6,7,9116,'Shield'),(6,7,9125,'Generic'),(6,7,20549,'War Stomp'),(6,7,20550,'Endurance'),(6,7,20551,'Nature Resistance'),(6,7,20552,'Cultivation'),(6,7,21651,'Opening'),(6,7,21652,'Closing'),(6,7,22027,'Remove Insignia'),(6,7,22810,'Opening - No Text'),(6,7,27763,'Totem'),(6,7,45927,'Summon Friend'),(6,7,61437,'Opening'),(6,11,81,'Dodge'),(6,11,198,'One-Handed Maces'),(6,11,203,'Unarmed'),(6,11,204,'Defense'),(6,11,227,'Staves'),(6,11,522,'SPELLDEFENSE (DND)'),(6,11,669,'Language Orcish'),(6,11,670,'Language Taurahe'),(6,11,1843,'Disarm'),(6,11,2382,'Generic'),(6,11,2479,'Honorless Target'),(6,11,3050,'Detect'),(6,11,3365,'Opening'),(6,11,5176,'Wrath'),(6,11,5185,'Healing Touch'),(6,11,6233,'Closing'),(6,11,6246,'Closing'),(6,11,6247,'Opening'),(6,11,6477,'Opening'),(6,11,6478,'Opening'),(6,11,6603,'Attack'),(6,11,7266,'Duel'),(6,11,7267,'Grovel'),(6,11,7355,'Stuck'),(6,11,8386,'Attacking'),(6,11,9077,'Leather'),(6,11,9078,'Cloth'),(6,11,9125,'Generic'),(6,11,20549,'War Stomp'),(6,11,20550,'Endurance'),(6,11,20551,'Nature Resistance'),(6,11,20552,'Cultivation'),(6,11,21651,'Opening'),(6,11,21652,'Closing'),(6,11,22027,'Remove Insignia'),(6,11,22810,'Opening - No Text'),(6,11,27764,'Fetish'),(6,11,45927,'Summon Friend'),(6,11,61437,'Opening'),(7,1,78,'Heroic Strike'),(7,1,81,'Dodge'),(7,1,107,'Block'),(7,1,198,'One-Handed Maces'),(7,1,201,'One-Handed Swords'),(7,1,203,'Unarmed'),(7,1,204,'Defense'),(7,1,522,'SPELLDEFENSE (DND)'),(7,1,668,'Language Common'),(7,1,1180,'Daggers'),(7,1,1843,'Disarm'),(7,1,2382,'Generic'),(7,1,2457,'Battle Stance'),(7,1,2479,'Honorless Target'),(7,1,3050,'Detect'),(7,1,3365,'Opening'),(7,1,5301,'Defensive State (DND)'),(7,1,6233,'Closing'),(7,1,6246,'Closing'),(7,1,6247,'Opening'),(7,1,6477,'Opening'),(7,1,6478,'Opening'),(7,1,6603,'Attack'),(7,1,7266,'Duel'),(7,1,7267,'Grovel'),(7,1,7340,'Language Gnomish'),(7,1,7355,'Stuck'),(7,1,8386,'Attacking'),(7,1,8737,'Mail'),(7,1,9077,'Leather'),(7,1,9078,'Cloth'),(7,1,9116,'Shield'),(7,1,9125,'Generic'),(7,1,20589,'Escape Artist'),(7,1,20591,'Expansive Mind'),(7,1,20592,'Arcane Resistance'),(7,1,20593,'Engineering Specialization'),(7,1,21651,'Opening'),(7,1,21652,'Closing'),(7,1,22027,'Remove Insignia'),(7,1,22810,'Opening - No Text'),(7,1,32215,'Victorious State'),(7,1,45927,'Summon Friend'),(7,1,61437,'Opening'),(7,4,81,'Dodge'),(7,4,203,'Unarmed'),(7,4,204,'Defense'),(7,4,522,'SPELLDEFENSE (DND)'),(7,4,668,'Language Common'),(7,4,1180,'Daggers'),(7,4,1752,'Sinister Strike'),(7,4,1843,'Disarm'),(7,4,2098,'Eviscerate'),(7,4,2382,'Generic'),(7,4,2479,'Honorless Target'),(7,4,2567,'Thrown'),(7,4,2764,'Throw'),(7,4,3050,'Detect'),(7,4,3365,'Opening'),(7,4,6233,'Closing'),(7,4,6246,'Closing'),(7,4,6247,'Opening'),(7,4,6477,'Opening'),(7,4,6478,'Opening'),(7,4,6603,'Attack'),(7,4,7266,'Duel'),(7,4,7267,'Grovel'),(7,4,7340,'Language Gnomish'),(7,4,7355,'Stuck'),(7,4,8386,'Attacking'),(7,4,9077,'Leather'),(7,4,9078,'Cloth'),(7,4,9125,'Generic'),(7,4,16092,'Defensive State (DND)'),(7,4,20589,'Escape Artist'),(7,4,20591,'Expansive Mind'),(7,4,20592,'Arcane Resistance'),(7,4,20593,'Engineering Specialization'),(7,4,21184,'Rogue Passive (DND)'),(7,4,21651,'Opening'),(7,4,21652,'Closing'),(7,4,22027,'Remove Insignia'),(7,4,22810,'Opening - No Text'),(7,4,45927,'Summon Friend'),(7,4,61437,'Opening'),(7,6,81,'Dodge'),(7,6,196,'One-Handed Axes'),(7,6,197,'Two-Handed Axes'),(7,6,200,'Polearms'),(7,6,201,'One-Handed Swords'),(7,6,202,'Two-Handed Swords'),(7,6,203,'Unarmed'),(7,6,204,'Defense'),(7,6,522,'SPELLDEFENSE (DND)'),(7,6,668,'Language Common'),(7,6,674,'Dual Wield'),(7,6,750,'Plate Mail'),(7,6,1843,'Disarm'),(7,6,2382,'Generic'),(7,6,2479,'Honorless Target'),(7,6,3050,'Detect'),(7,6,3127,'Parry'),(7,6,3275,'Linen Bandage'),(7,6,3276,'Heavy Linen Bandage'),(7,6,3277,'Wool Bandage'),(7,6,3278,'Heavy Wool Bandage'),(7,6,3365,'Opening'),(7,6,6233,'Closing'),(7,6,6246,'Closing'),(7,6,6247,'Opening'),(7,6,6477,'Opening'),(7,6,6478,'Opening'),(7,6,6603,'Attack'),(7,6,7266,'Duel'),(7,6,7267,'Grovel'),(7,6,7340,'Language Gnomish'),(7,6,7355,'Stuck'),(7,6,7928,'Silk Bandage'),(7,6,7929,'Heavy Silk Bandage'),(7,6,7934,'Anti-Venom'),(7,6,8386,'Attacking'),(7,6,8737,'Mail'),(7,6,9077,'Leather'),(7,6,9078,'Cloth'),(7,6,9125,'Generic'),(7,6,10840,'Mageweave Bandage'),(7,6,10841,'Heavy Mageweave Bandage'),(7,6,10846,'First Aid'),(7,6,18629,'Runecloth Bandage'),(7,6,18630,'Heavy Runecloth Bandage'),(7,6,20589,'Escape Artist'),(7,6,20591,'Expansive Mind'),(7,6,20592,'Arcane Resistance'),(7,6,20593,'Engineering Specialization'),(7,6,21651,'Opening'),(7,6,21652,'Closing'),(7,6,22027,'Remove Insignia'),(7,6,22810,'Opening - No Text'),(7,6,33391,'Journeyman Riding'),(7,6,45462,'Plague Strike'),(7,6,45477,'Icy Touch'),(7,6,45902,'Blood Strike'),(7,6,45903,'Offensive State (DND)'),(7,6,45927,'Summon Friend'),(7,6,47541,'Death Coil'),(7,6,48266,'Blood Presence'),(7,6,49410,'Forceful Deflection'),(7,6,49576,'Death Grip'),(7,6,52665,'Sigil'),(7,6,59879,'Blood Plague'),(7,6,59921,'Frost Fever'),(7,6,61437,'Opening'),(7,6,61455,'Runic Focus'),(7,8,81,'Dodge'),(7,8,133,'Fireball'),(7,8,168,'Frost Armor'),(7,8,203,'Unarmed'),(7,8,204,'Defense'),(7,8,227,'Staves'),(7,8,522,'SPELLDEFENSE (DND)'),(7,8,668,'Language Common'),(7,8,1843,'Disarm'),(7,8,2382,'Generic'),(7,8,2479,'Honorless Target'),(7,8,3050,'Detect'),(7,8,3365,'Opening'),(7,8,5009,'Wands'),(7,8,5019,'Shoot'),(7,8,6233,'Closing'),(7,8,6246,'Closing'),(7,8,6247,'Opening'),(7,8,6477,'Opening'),(7,8,6478,'Opening'),(7,8,6603,'Attack'),(7,8,7266,'Duel'),(7,8,7267,'Grovel'),(7,8,7340,'Language Gnomish'),(7,8,7355,'Stuck'),(7,8,8386,'Attacking'),(7,8,9078,'Cloth'),(7,8,9125,'Generic'),(7,8,20589,'Escape Artist'),(7,8,20591,'Expansive Mind'),(7,8,20592,'Arcane Resistance'),(7,8,20593,'Engineering Specialization'),(7,8,21651,'Opening'),(7,8,21652,'Closing'),(7,8,22027,'Remove Insignia'),(7,8,22810,'Opening - No Text'),(7,8,45927,'Summon Friend'),(7,8,61437,'Opening'),(7,9,81,'Dodge'),(7,9,203,'Unarmed'),(7,9,204,'Defense'),(7,9,522,'SPELLDEFENSE (DND)'),(7,9,668,'Language Common'),(7,9,686,'Shadow Bolt'),(7,9,687,'Demon Skin'),(7,9,1180,'Daggers'),(7,9,1843,'Disarm'),(7,9,2382,'Generic'),(7,9,2479,'Honorless Target'),(7,9,3050,'Detect'),(7,9,3365,'Opening'),(7,9,5009,'Wands'),(7,9,5019,'Shoot'),(7,9,6233,'Closing'),(7,9,6246,'Closing'),(7,9,6247,'Opening'),(7,9,6477,'Opening'),(7,9,6478,'Opening'),(7,9,6603,'Attack'),(7,9,7266,'Duel'),(7,9,7267,'Grovel'),(7,9,7340,'Language Gnomish'),(7,9,7355,'Stuck'),(7,9,8386,'Attacking'),(7,9,9078,'Cloth'),(7,9,9125,'Generic'),(7,9,20589,'Escape Artist'),(7,9,20591,'Expansive Mind'),(7,9,20592,'Arcane Resistance'),(7,9,20593,'Engineering Specialization'),(7,9,21651,'Opening'),(7,9,21652,'Closing'),(7,9,22027,'Remove Insignia'),(7,9,22810,'Opening - No Text'),(7,9,45927,'Summon Friend'),(7,9,61437,'Opening'),(8,1,78,'Heroic Strike'),(8,1,81,'Dodge'),(8,1,107,'Block'),(8,1,196,'One-Handed Axes'),(8,1,203,'Unarmed'),(8,1,204,'Defense'),(8,1,522,'SPELLDEFENSE (DND)'),(8,1,669,'Language Orcish'),(8,1,1180,'Daggers'),(8,1,1843,'Disarm'),(8,1,2382,'Generic'),(8,1,2457,'Battle Stance'),(8,1,2479,'Honorless Target'),(8,1,2567,'Thrown'),(8,1,2764,'Throw'),(8,1,3050,'Detect'),(8,1,3365,'Opening'),(8,1,5301,'Defensive State (DND)'),(8,1,6233,'Closing'),(8,1,6246,'Closing'),(8,1,6247,'Opening'),(8,1,6477,'Opening'),(8,1,6478,'Opening'),(8,1,6603,'Attack'),(8,1,7266,'Duel'),(8,1,7267,'Grovel'),(8,1,7341,'Language Troll'),(8,1,7355,'Stuck'),(8,1,8386,'Attacking'),(8,1,8737,'Mail'),(8,1,9077,'Leather'),(8,1,9078,'Cloth'),(8,1,9116,'Shield'),(8,1,9125,'Generic'),(8,1,20555,'Regeneration'),(8,1,20557,'Beast Slaying'),(8,1,20558,'Throwing Specialization'),(8,1,21651,'Opening'),(8,1,21652,'Closing'),(8,1,22027,'Remove Insignia'),(8,1,22810,'Opening - No Text'),(8,1,26290,'Bow Specialization'),(8,1,26297,'Berserking'),(8,1,32215,'Victorious State'),(8,1,45927,'Summon Friend'),(8,1,58943,'Da Voodoo Shuffle'),(8,1,61437,'Opening'),(8,3,75,'Auto Shot'),(8,3,81,'Dodge'),(8,3,196,'One-Handed Axes'),(8,3,203,'Unarmed'),(8,3,204,'Defense'),(8,3,264,'Bows'),(8,3,522,'SPELLDEFENSE (DND)'),(8,3,669,'Language Orcish'),(8,3,1843,'Disarm'),(8,3,2382,'Generic'),(8,3,2479,'Honorless Target'),(8,3,2973,'Raptor Strike'),(8,3,3050,'Detect'),(8,3,3365,'Opening'),(8,3,6233,'Closing'),(8,3,6246,'Closing'),(8,3,6247,'Opening'),(8,3,6477,'Opening'),(8,3,6478,'Opening'),(8,3,6603,'Attack'),(8,3,7266,'Duel'),(8,3,7267,'Grovel'),(8,3,7341,'Language Troll'),(8,3,7355,'Stuck'),(8,3,8386,'Attacking'),(8,3,9077,'Leather'),(8,3,9078,'Cloth'),(8,3,9125,'Generic'),(8,3,13358,'Defensive State (DND)'),(8,3,26297,'Berserking'),(8,3,20555,'Regeneration'),(8,3,20557,'Beast Slaying'),(8,3,20558,'Throwing Specialization'),(8,3,21651,'Opening'),(8,3,21652,'Closing'),(8,3,22027,'Remove Insignia'),(8,3,22810,'Opening - No Text'),(8,3,24949,'Defensive State 2 (DND)'),(8,3,26290,'Bow Specialization'),(8,3,34082,'Advantaged State (DND)'),(8,3,45927,'Summon Friend'),(8,3,58943,'Da Voodoo Shuffle'),(8,3,61437,'Opening'),(8,4,81,'Dodge'),(8,4,203,'Unarmed'),(8,4,204,'Defense'),(8,4,522,'SPELLDEFENSE (DND)'),(8,4,669,'Language Orcish'),(8,4,1180,'Daggers'),(8,4,1752,'Sinister Strike'),(8,4,1843,'Disarm'),(8,4,2098,'Eviscerate'),(8,4,2382,'Generic'),(8,4,2479,'Honorless Target'),(8,4,2567,'Thrown'),(8,4,2764,'Throw'),(8,4,3050,'Detect'),(8,4,3365,'Opening'),(8,4,6233,'Closing'),(8,4,6246,'Closing'),(8,4,6247,'Opening'),(8,4,6477,'Opening'),(8,4,6478,'Opening'),(8,4,6603,'Attack'),(8,4,7266,'Duel'),(8,4,7267,'Grovel'),(8,4,7341,'Language Troll'),(8,4,7355,'Stuck'),(8,4,8386,'Attacking'),(8,4,9077,'Leather'),(8,4,9078,'Cloth'),(8,4,9125,'Generic'),(8,4,16092,'Defensive State (DND)'),(8,4,20555,'Regeneration'),(8,4,20557,'Beast Slaying'),(8,4,20558,'Throwing Specialization'),(8,4,21184,'Rogue Passive (DND)'),(8,4,21651,'Opening'),(8,4,21652,'Closing'),(8,4,22027,'Remove Insignia'),(8,4,22810,'Opening - No Text'),(8,4,26290,'Bow Specialization'),(8,4,26297,'Berserking'),(8,4,45927,'Summon Friend'),(8,4,58943,'Da Voodoo Shuffle'),(8,4,61437,'Opening'),(8,5,81,'Dodge'),(8,5,198,'One-Handed Maces'),(8,5,203,'Unarmed'),(8,5,204,'Defense'),(8,5,522,'SPELLDEFENSE (DND)'),(8,5,585,'Smite'),(8,5,669,'Language Orcish'),(8,5,1843,'Disarm'),(8,5,2050,'Lesser Heal'),(8,5,2382,'Generic'),(8,5,2479,'Honorless Target'),(8,5,3050,'Detect'),(8,5,3365,'Opening'),(8,5,5009,'Wands'),(8,5,5019,'Shoot'),(8,5,6233,'Closing'),(8,5,6246,'Closing'),(8,5,6247,'Opening'),(8,5,6477,'Opening'),(8,5,6478,'Opening'),(8,5,6603,'Attack'),(8,5,7266,'Duel'),(8,5,7267,'Grovel'),(8,5,7341,'Language Troll'),(8,5,7355,'Stuck'),(8,5,8386,'Attacking'),(8,5,9078,'Cloth'),(8,5,9125,'Generic'),(8,5,26297,'Berserking'),(8,5,20555,'Regeneration'),(8,5,20557,'Beast Slaying'),(8,5,20558,'Throwing Specialization'),(8,5,21651,'Opening'),(8,5,21652,'Closing'),(8,5,22027,'Remove Insignia'),(8,5,22810,'Opening - No Text'),(8,5,26290,'Bow Specialization'),(8,5,45927,'Summon Friend'),(8,5,58943,'Da Voodoo Shuffle'),(8,5,61437,'Opening'),(8,6,81,'Dodge'),(8,6,196,'One-Handed Axes'),(8,6,197,'Two-Handed Axes'),(8,6,200,'Polearms'),(8,6,201,'One-Handed Swords'),(8,6,202,'Two-Handed Swords'),(8,6,203,'Unarmed'),(8,6,204,'Defense'),(8,6,522,'SPELLDEFENSE (DND)'),(8,6,669,'Language Orcish'),(8,6,674,'Dual Wield'),(8,6,750,'Plate Mail'),(8,6,1843,'Disarm'),(8,6,2382,'Generic'),(8,6,2479,'Honorless Target'),(8,6,3050,'Detect'),(8,6,3127,'Parry'),(8,6,3275,'Linen Bandage'),(8,6,3276,'Heavy Linen Bandage'),(8,6,3277,'Wool Bandage'),(8,6,3278,'Heavy Wool Bandage'),(8,6,3365,'Opening'),(8,6,6233,'Closing'),(8,6,6246,'Closing'),(8,6,6247,'Opening'),(8,6,6477,'Opening'),(8,6,6478,'Opening'),(8,6,6603,'Attack'),(8,6,7266,'Duel'),(8,6,7267,'Grovel'),(8,6,7341,'Language Troll'),(8,6,7355,'Stuck'),(8,6,7928,'Silk Bandage'),(8,6,7929,'Heavy Silk Bandage'),(8,6,7934,'Anti-Venom'),(8,6,8386,'Attacking'),(8,6,8737,'Mail'),(8,6,9077,'Leather'),(8,6,9078,'Cloth'),(8,6,9125,'Generic'),(8,6,10840,'Mageweave Bandage'),(8,6,10841,'Heavy Mageweave Bandage'),(8,6,10846,'First Aid'),(8,6,18629,'Runecloth Bandage'),(8,6,18630,'Heavy Runecloth Bandage'),(8,6,20555,'Regeneration'),(8,6,20557,'Beast Slaying'),(8,6,20558,'Throwing Specialization'),(8,6,21651,'Opening'),(8,6,21652,'Closing'),(8,6,22027,'Remove Insignia'),(8,6,22810,'Opening - No Text'),(8,6,26290,'Bow Specialization'),(8,6,33391,'Journeyman Riding'),(8,6,45462,'Plague Strike'),(8,6,45477,'Icy Touch'),(8,6,45902,'Blood Strike'),(8,6,45903,'Offensive State (DND)'),(8,6,45927,'Summon Friend'),(8,6,47541,'Death Coil'),(8,6,48266,'Blood Presence'),(8,6,49410,'Forceful Deflection'),(8,6,49576,'Death Grip'),(8,6,26297,'Berserking'),(8,6,52665,'Sigil'),(8,6,58943,'Da Voodoo Shuffle'),(8,6,59879,'Blood Plague'),(8,6,59921,'Frost Fever'),(8,6,61437,'Opening'),(8,6,61455,'Runic Focus'),(8,7,81,'Dodge'),(8,7,107,'Block'),(8,7,198,'One-Handed Maces'),(8,7,203,'Unarmed'),(8,7,204,'Defense'),(8,7,227,'Staves'),(8,7,331,'Healing Wave'),(8,7,403,'Lightning Bolt'),(8,7,522,'SPELLDEFENSE (DND)'),(8,7,669,'Language Orcish'),(8,7,1843,'Disarm'),(8,7,2382,'Generic'),(8,7,2479,'Honorless Target'),(8,7,3050,'Detect'),(8,7,3365,'Opening'),(8,7,6233,'Closing'),(8,7,6246,'Closing'),(8,7,6247,'Opening'),(8,7,6477,'Opening'),(8,7,6478,'Opening'),(8,7,6603,'Attack'),(8,7,7266,'Duel'),(8,7,7267,'Grovel'),(8,7,7341,'Language Troll'),(8,7,7355,'Stuck'),(8,7,8386,'Attacking'),(8,7,9077,'Leather'),(8,7,9078,'Cloth'),(8,7,9116,'Shield'),(8,7,9125,'Generic'),(8,7,26297,'Berserking'),(8,7,20555,'Regeneration'),(8,7,20557,'Beast Slaying'),(8,7,20558,'Throwing Specialization'),(8,7,21651,'Opening'),(8,7,21652,'Closing'),(8,7,22027,'Remove Insignia'),(8,7,22810,'Opening - No Text'),(8,7,26290,'Bow Specialization'),(8,7,27763,'Totem'),(8,7,45927,'Summon Friend'),(8,7,58943,'Da Voodoo Shuffle'),(8,7,61437,'Opening'),(8,8,81,'Dodge'),(8,8,133,'Fireball'),(8,8,168,'Frost Armor'),(8,8,203,'Unarmed'),(8,8,204,'Defense'),(8,8,227,'Staves'),(8,8,522,'SPELLDEFENSE (DND)'),(8,8,669,'Language Orcish'),(8,8,1843,'Disarm'),(8,8,2382,'Generic'),(8,8,2479,'Honorless Target'),(8,8,3050,'Detect'),(8,8,3365,'Opening'),(8,8,5009,'Wands'),(8,8,5019,'Shoot'),(8,8,6233,'Closing'),(8,8,6246,'Closing'),(8,8,6247,'Opening'),(8,8,6477,'Opening'),(8,8,6478,'Opening'),(8,8,6603,'Attack'),(8,8,7266,'Duel'),(8,8,7267,'Grovel'),(8,8,7341,'Language Troll'),(8,8,7355,'Stuck'),(8,8,8386,'Attacking'),(8,8,9078,'Cloth'),(8,8,9125,'Generic'),(8,8,26297,'Berserking'),(8,8,20555,'Regeneration'),(8,8,20557,'Beast Slaying'),(8,8,20558,'Throwing Specialization'),(8,8,21651,'Opening'),(8,8,21652,'Closing'),(8,8,22027,'Remove Insignia'),(8,8,22810,'Opening - No Text'),(8,8,26290,'Bow Specialization'),(8,8,45927,'Summon Friend'),(8,8,58943,'Da Voodoo Shuffle'),(8,8,61437,'Opening'),(10,2,81,'Dodge'),(10,2,107,'Block'),(10,2,201,'One-Handed Swords'),(10,2,202,'Two-Handed Swords'),(10,2,203,'Unarmed'),(10,2,204,'Defense'),(10,2,522,'SPELLDEFENSE (DND)'),(10,2,635,'Holy Light'),(10,2,669,'Language Orcish'),(10,2,813,'Language Thalassian'),(10,2,822,'Magic Resistance'),(10,2,2382,'Generic'),(10,2,2479,'Honorless Target'),(10,2,3050,'Detect'),(10,2,3365,'Opening'),(10,2,6233,'Closing'),(10,2,6246,'Closing'),(10,2,6247,'Opening'),(10,2,6477,'Opening'),(10,2,6478,'Opening'),(10,2,6603,'Attack'),(10,2,7266,'Duel'),(10,2,7267,'Grovel'),(10,2,7355,'Stuck'),(10,2,8386,'Attacking'),(10,2,8737,'Mail'),(10,2,9077,'Leather'),(10,2,9078,'Cloth'),(10,2,9116,'Shield'),(10,2,9125,'Generic'),(10,2,21084,'Seal of Righteousness'),(10,2,21651,'Opening'),(10,2,21652,'Closing'),(10,2,22027,'Remove Insignia'),(10,2,22810,'Opening - No Text'),(10,2,27762,'Libram'),(10,2,28730,'Arcane Torrent'),(10,2,28877,'Arcane Affinity'),(10,3,75,'Auto Shot'),(10,3,81,'Dodge'),(10,3,203,'Unarmed'),(10,3,204,'Defense'),(10,3,264,'Bows'),(10,3,522,'SPELLDEFENSE (DND)'),(10,3,669,'Language Orcish'),(10,3,813,'Language Thalassian'),(10,3,822,'Magic Resistance'),(10,3,1180,'Daggers'),(10,3,2382,'Generic'),(10,3,2479,'Honorless Target'),(10,3,2973,'Raptor Strike'),(10,3,3050,'Detect'),(10,3,3365,'Opening'),(10,3,6233,'Closing'),(10,3,6246,'Closing'),(10,3,6247,'Opening'),(10,3,6477,'Opening'),(10,3,6478,'Opening'),(10,3,6603,'Attack'),(10,3,7266,'Duel'),(10,3,7267,'Grovel'),(10,3,7355,'Stuck'),(10,3,8386,'Attacking'),(10,3,9077,'Leather'),(10,3,9078,'Cloth'),(10,3,9125,'Generic'),(10,3,13358,'Defensive State (DND)'),(10,3,21651,'Opening'),(10,3,21652,'Closing'),(10,3,22027,'Remove Insignia'),(10,3,22810,'Opening - No Text'),(10,3,24949,'Defensive State 2 (DND)'),(10,3,28730,'Arcane Torrent'),(10,3,28877,'Arcane Affinity'),(10,3,34082,'Advantaged State (DND)'),(10,4,81,'Dodge'),(10,4,203,'Unarmed'),(10,4,204,'Defense'),(10,4,522,'SPELLDEFENSE (DND)'),(10,4,669,'Language Orcish'),(10,4,813,'Language Thalassian'),(10,4,822,'Magic Resistance'),(10,4,1180,'Daggers'),(10,4,1752,'Sinister Strike'),(10,4,2098,'Eviscerate'),(10,4,2382,'Generic'),(10,4,2479,'Honorless Target'),(10,4,2567,'Thrown'),(10,4,2764,'Throw'),(10,4,3050,'Detect'),(10,4,3365,'Opening'),(10,4,6233,'Closing'),(10,4,6246,'Closing'),(10,4,6247,'Opening'),(10,4,6477,'Opening'),(10,4,6478,'Opening'),(10,4,6603,'Attack'),(10,4,7266,'Duel'),(10,4,7267,'Grovel'),(10,4,7355,'Stuck'),(10,4,8386,'Attacking'),(10,4,9077,'Leather'),(10,4,9078,'Cloth'),(10,4,9125,'Generic'),(10,4,16092,'Defensive State (DND)'),(10,4,21184,'Rogue Passive (DND)'),(10,4,21651,'Opening'),(10,4,21652,'Closing'),(10,4,22027,'Remove Insignia'),(10,4,22810,'Opening - No Text'),(10,4,25046,'Arcane Torrent'),(10,4,28877,'Arcane Affinity'),(10,5,81,'Dodge'),(10,5,198,'One-Handed Maces'),(10,5,203,'Unarmed'),(10,5,204,'Defense'),(10,5,522,'SPELLDEFENSE (DND)'),(10,5,585,'Smite'),(10,5,669,'Language Orcish'),(10,5,813,'Language Thalassian'),(10,5,822,'Magic Resistance'),(10,5,2050,'Lesser Heal'),(10,5,2382,'Generic'),(10,5,2479,'Honorless Target'),(10,5,3050,'Detect'),(10,5,3365,'Opening'),(10,5,5009,'Wands'),(10,5,5019,'Shoot'),(10,5,6233,'Closing'),(10,5,6246,'Closing'),(10,5,6247,'Opening'),(10,5,6477,'Opening'),(10,5,6478,'Opening'),(10,5,6603,'Attack'),(10,5,7266,'Duel'),(10,5,7267,'Grovel'),(10,5,7355,'Stuck'),(10,5,8386,'Attacking'),(10,5,9078,'Cloth'),(10,5,9125,'Generic'),(10,5,21651,'Opening'),(10,5,21652,'Closing'),(10,5,22027,'Remove Insignia'),(10,5,22810,'Opening - No Text'),(10,5,28730,'Arcane Torrent'),(10,5,28877,'Arcane Affinity'),(10,6,81,'Dodge'),(10,6,196,'One-Handed Axes'),(10,6,197,'Two-Handed Axes'),(10,6,200,'Polearms'),(10,6,201,'One-Handed Swords'),(10,6,202,'Two-Handed Swords'),(10,6,203,'Unarmed'),(10,6,204,'Defense'),(10,6,522,'SPELLDEFENSE (DND)'),(10,6,669,'Language Orcish'),(10,6,674,'Dual Wield'),(10,6,750,'Plate Mail'),(10,6,813,'Language Thalassian'),(10,6,822,'Magic Resistance'),(10,6,1843,'Disarm'),(10,6,2382,'Generic'),(10,6,2479,'Honorless Target'),(10,6,3050,'Detect'),(10,6,3127,'Parry'),(10,6,3275,'Linen Bandage'),(10,6,3276,'Heavy Linen Bandage'),(10,6,3277,'Wool Bandage'),(10,6,3278,'Heavy Wool Bandage'),(10,6,3365,'Opening'),(10,6,6233,'Closing'),(10,6,6246,'Closing'),(10,6,6247,'Opening'),(10,6,6477,'Opening'),(10,6,6478,'Opening'),(10,6,6603,'Attack'),(10,6,7266,'Duel'),(10,6,7267,'Grovel'),(10,6,7355,'Stuck'),(10,6,7928,'Silk Bandage'),(10,6,7929,'Heavy Silk Bandage'),(10,6,7934,'Anti-Venom'),(10,6,8386,'Attacking'),(10,6,8737,'Mail'),(10,6,9077,'Leather'),(10,6,9078,'Cloth'),(10,6,9125,'Generic'),(10,6,10840,'Mageweave Bandage'),(10,6,10841,'Heavy Mageweave Bandage'),(10,6,10846,'First Aid'),(10,6,18629,'Runecloth Bandage'),(10,6,18630,'Heavy Runecloth Bandage'),(10,6,21651,'Opening'),(10,6,21652,'Closing'),(10,6,22027,'Remove Insignia'),(10,6,22810,'Opening - No Text'),(10,6,28877,'Arcane Affinity'),(10,6,33391,'Journeyman Riding'),(10,6,45462,'Plague Strike'),(10,6,45477,'Icy Touch'),(10,6,45902,'Blood Strike'),(10,6,45903,'Offensive State (DND)'),(10,6,45927,'Summon Friend'),(10,6,47541,'Death Coil'),(10,6,48266,'Blood Presence'),(10,6,49410,'Forceful Deflection'),(10,6,49576,'Death Grip'),(10,6,50613,'Arcane Torrent'),(10,6,52665,'Sigil'),(10,6,59879,'Blood Plague'),(10,6,59921,'Frost Fever'),(10,6,61437,'Opening'),(10,6,61455,'Runic Focus'),(10,8,81,'Dodge'),(10,8,133,'Fireball'),(10,8,168,'Frost Armor'),(10,8,203,'Unarmed'),(10,8,204,'Defense'),(10,8,227,'Staves'),(10,8,522,'SPELLDEFENSE (DND)'),(10,8,669,'Language Orcish'),(10,8,813,'Language Thalassian'),(10,8,822,'Magic Resistance'),(10,8,2382,'Generic'),(10,8,2479,'Honorless Target'),(10,8,3050,'Detect'),(10,8,3365,'Opening'),(10,8,5009,'Wands'),(10,8,5019,'Shoot'),(10,8,6233,'Closing'),(10,8,6246,'Closing'),(10,8,6247,'Opening'),(10,8,6477,'Opening'),(10,8,6478,'Opening'),(10,8,6603,'Attack'),(10,8,7266,'Duel'),(10,8,7267,'Grovel'),(10,8,7355,'Stuck'),(10,8,8386,'Attacking'),(10,8,9078,'Cloth'),(10,8,9125,'Generic'),(10,8,21651,'Opening'),(10,8,21652,'Closing'),(10,8,22027,'Remove Insignia'),(10,8,22810,'Opening - No Text'),(10,8,28730,'Arcane Torrent'),(10,8,28877,'Arcane Affinity'),(10,9,81,'Dodge'),(10,9,203,'Unarmed'),(10,9,204,'Defense'),(10,9,522,'SPELLDEFENSE (DND)'),(10,9,669,'Language Orcish'),(10,9,686,'Shadow Bolt'),(10,9,687,'Demon Skin'),(10,9,813,'Language Thalassian'),(10,9,822,'Magic Resistance'),(10,9,1180,'Daggers'),(10,9,2382,'Generic'),(10,9,2479,'Honorless Target'),(10,9,3050,'Detect'),(10,9,3365,'Opening'),(10,9,5009,'Wands'),(10,9,5019,'Shoot'),(10,9,6233,'Closing'),(10,9,6246,'Closing'),(10,9,6247,'Opening'),(10,9,6477,'Opening'),(10,9,6478,'Opening'),(10,9,6603,'Attack'),(10,9,7266,'Duel'),(10,9,7267,'Grovel'),(10,9,7355,'Stuck'),(10,9,8386,'Attacking'),(10,9,9078,'Cloth'),(10,9,9125,'Generic'),(10,9,21651,'Opening'),(10,9,21652,'Closing'),(10,9,22027,'Remove Insignia'),(10,9,22810,'Opening - No Text'),(10,9,28730,'Arcane Torrent'),(10,9,28877,'Arcane Affinity'),(11,1,78,'Heroic Strike'),(11,1,81,'Dodge'),(11,1,107,'Block'),(11,1,198,'One-Handed Maces'),(11,1,201,'One-Handed Swords'),(11,1,203,'Unarmed'),(11,1,204,'Defense'),(11,1,522,'SPELLDEFENSE (DND)'),(11,1,668,'Language Common'),(11,1,1843,'Disarm'),(11,1,2382,'Generic'),(11,1,2457,'Battle Stance'),(11,1,2479,'Honorless Target'),(11,1,3050,'Detect'),(11,1,3365,'Opening'),(11,1,5301,'Defensive State (DND)'),(11,1,6233,'Closing'),(11,1,6246,'Closing'),(11,1,6247,'Opening'),(11,1,6477,'Opening'),(11,1,6478,'Opening'),(11,1,6562,'Heroic Presence'),(11,1,6603,'Attack'),(11,1,7266,'Duel'),(11,1,7267,'Grovel'),(11,1,7355,'Stuck'),(11,1,8386,'Attacking'),(11,1,8737,'Mail'),(11,1,9077,'Leather'),(11,1,9078,'Cloth'),(11,1,9116,'Shield'),(11,1,9125,'Generic'),(11,1,21651,'Opening'),(11,1,21652,'Closing'),(11,1,22027,'Remove Insignia'),(11,1,22810,'Opening - No Text'),(11,1,28875,'Gemcutting'),(11,1,28880,'Gift of the Naaru'),(11,1,29932,'Language Draenei'),(11,1,32215,'Victorious State'),(11,1,45927,'Summon Friend'),(11,1,59221,'Shadow Resistance'),(11,1,61437,'Opening'),(11,2,81,'Dodge'),(11,2,107,'Block'),(11,2,198,'One-Handed Maces'),(11,2,199,'Two-Handed Maces'),(11,2,203,'Unarmed'),(11,2,204,'Defense'),(11,2,522,'SPELLDEFENSE (DND)'),(11,2,635,'Holy Light'),(11,2,668,'Language Common'),(11,2,1843,'Disarm'),(11,2,2382,'Generic'),(11,2,2479,'Honorless Target'),(11,2,3050,'Detect'),(11,2,3365,'Opening'),(11,2,6233,'Closing'),(11,2,6246,'Closing'),(11,2,6247,'Opening'),(11,2,6477,'Opening'),(11,2,6478,'Opening'),(11,2,6562,'Heroic Presence'),(11,2,6603,'Attack'),(11,2,7266,'Duel'),(11,2,7267,'Grovel'),(11,2,7355,'Stuck'),(11,2,8386,'Attacking'),(11,2,8737,'Mail'),(11,2,9077,'Leather'),(11,2,9078,'Cloth'),(11,2,9116,'Shield'),(11,2,9125,'Generic'),(11,2,21084,'Seal of Righteousness'),(11,2,21651,'Opening'),(11,2,21652,'Closing'),(11,2,22027,'Remove Insignia'),(11,2,22810,'Opening - No Text'),(11,2,27762,'Libram'),(11,2,28875,'Gemcutting'),(11,2,29932,'Language Draenei'),(11,2,45927,'Summon Friend'),(11,2,59221,'Shadow Resistance'),(11,2,59542,'Gift of the Naaru'),(11,2,61437,'Opening'),(11,3,75,'Auto Shot'),(11,3,81,'Dodge'),(11,3,201,'One-Handed Swords'),(11,3,203,'Unarmed'),(11,3,204,'Defense'),(11,3,522,'SPELLDEFENSE (DND)'),(11,3,668,'Language Common'),(11,3,1843,'Disarm'),(11,3,2382,'Generic'),(11,3,2479,'Honorless Target'),(11,3,2973,'Raptor Strike'),(11,3,3050,'Detect'),(11,3,3365,'Opening'),(11,3,5011,'Crossbows'),(11,3,6233,'Closing'),(11,3,6246,'Closing'),(11,3,6247,'Opening'),(11,3,6477,'Opening'),(11,3,6478,'Opening'),(11,3,6562,'Heroic Presence'),(11,3,6603,'Attack'),(11,3,7266,'Duel'),(11,3,7267,'Grovel'),(11,3,7355,'Stuck'),(11,3,8386,'Attacking'),(11,3,9077,'Leather'),(11,3,9078,'Cloth'),(11,3,9125,'Generic'),(11,3,13358,'Defensive State (DND)'),(11,3,21651,'Opening'),(11,3,21652,'Closing'),(11,3,22027,'Remove Insignia'),(11,3,22810,'Opening - No Text'),(11,3,24949,'Defensive State 2 (DND)'),(11,3,28875,'Gemcutting'),(11,3,29932,'Language Draenei'),(11,3,34082,'Advantaged State (DND)'),(11,3,45927,'Summon Friend'),(11,3,59221,'Shadow Resistance'),(11,3,59543,'Gift of the Naaru'),(11,3,61437,'Opening'),(11,5,81,'Dodge'),(11,5,198,'One-Handed Maces'),(11,5,203,'Unarmed'),(11,5,204,'Defense'),(11,5,522,'SPELLDEFENSE (DND)'),(11,5,585,'Smite'),(11,5,668,'Language Common'),(11,5,1843,'Disarm'),(11,5,2050,'Lesser Heal'),(11,5,2382,'Generic'),(11,5,2479,'Honorless Target'),(11,5,3050,'Detect'),(11,5,3365,'Opening'),(11,5,5009,'Wands'),(11,5,5019,'Shoot'),(11,5,6233,'Closing'),(11,5,6246,'Closing'),(11,5,6247,'Opening'),(11,5,6477,'Opening'),(11,5,6478,'Opening'),(11,5,6603,'Attack'),(11,5,7266,'Duel'),(11,5,7267,'Grovel'),(11,5,7355,'Stuck'),(11,5,8386,'Attacking'),(11,5,9078,'Cloth'),(11,5,9125,'Generic'),(11,5,21651,'Opening'),(11,5,21652,'Closing'),(11,5,22027,'Remove Insignia'),(11,5,22810,'Opening - No Text'),(11,5,28875,'Gemcutting'),(11,5,28878,'Inspiring Presence'),(11,5,29932,'Language Draenei'),(11,5,45927,'Summon Friend'),(11,5,59221,'Shadow Resistance'),(11,5,59544,'Gift of the Naaru'),(11,5,61437,'Opening'),(11,6,81,'Dodge'),(11,6,196,'One-Handed Axes'),(11,6,197,'Two-Handed Axes'),(11,6,200,'Polearms'),(11,6,201,'One-Handed Swords'),(11,6,202,'Two-Handed Swords'),(11,6,203,'Unarmed'),(11,6,204,'Defense'),(11,6,522,'SPELLDEFENSE (DND)'),(11,6,668,'Language Common'),(11,6,674,'Dual Wield'),(11,6,750,'Plate Mail'),(11,6,1843,'Disarm'),(11,6,2382,'Generic'),(11,6,2479,'Honorless Target'),(11,6,3050,'Detect'),(11,6,3127,'Parry'),(11,6,3275,'Linen Bandage'),(11,6,3276,'Heavy Linen Bandage'),(11,6,3277,'Wool Bandage'),(11,6,3278,'Heavy Wool Bandage'),(11,6,3365,'Opening'),(11,6,6233,'Closing'),(11,6,6246,'Closing'),(11,6,6247,'Opening'),(11,6,6477,'Opening'),(11,6,6478,'Opening'),(11,6,6562,'Heroic Presence'),(11,6,6603,'Attack'),(11,6,7266,'Duel'),(11,6,7267,'Grovel'),(11,6,7355,'Stuck'),(11,6,7928,'Silk Bandage'),(11,6,7929,'Heavy Silk Bandage'),(11,6,7934,'Anti-Venom'),(11,6,8386,'Attacking'),(11,6,8737,'Mail'),(11,6,9077,'Leather'),(11,6,9078,'Cloth'),(11,6,9125,'Generic'),(11,6,10840,'Mageweave Bandage'),(11,6,10841,'Heavy Mageweave Bandage'),(11,6,10846,'First Aid'),(11,6,18629,'Runecloth Bandage'),(11,6,18630,'Heavy Runecloth Bandage'),(11,6,21651,'Opening'),(11,6,21652,'Closing'),(11,6,22027,'Remove Insignia'),(11,6,22810,'Opening - No Text'),(11,6,28875,'Gemcutting'),(11,6,29932,'Language Draenei'),(11,6,33391,'Journeyman Riding'),(11,6,45462,'Plague Strike'),(11,6,45477,'Icy Touch'),(11,6,45902,'Blood Strike'),(11,6,45903,'Offensive State (DND)'),(11,6,45927,'Summon Friend'),(11,6,47541,'Death Coil'),(11,6,48266,'Blood Presence'),(11,6,49410,'Forceful Deflection'),(11,6,49576,'Death Grip'),(11,6,52665,'Sigil'),(11,6,59221,'Shadow Resistance'),(11,6,59539,'Shadow Resistance'),(11,6,59545,'Gift of the Naaru'),(11,6,59879,'Blood Plague'),(11,6,59921,'Frost Fever'),(11,6,61437,'Opening'),(11,6,61455,'Runic Focus'),(11,7,81,'Dodge'),(11,7,107,'Block'),(11,7,198,'One-Handed Maces'),(11,7,203,'Unarmed'),(11,7,204,'Defense'),(11,7,227,'Staves'),(11,7,331,'Healing Wave'),(11,7,403,'Lightning Bolt'),(11,7,522,'SPELLDEFENSE (DND)'),(11,7,668,'Language Common'),(11,7,1843,'Disarm'),(11,7,2382,'Generic'),(11,7,2479,'Honorless Target'),(11,7,3050,'Detect'),(11,7,3365,'Opening'),(11,7,6233,'Closing'),(11,7,6246,'Closing'),(11,7,6247,'Opening'),(11,7,6477,'Opening'),(11,7,6478,'Opening'),(11,7,6603,'Attack'),(11,7,7266,'Duel'),(11,7,7267,'Grovel'),(11,7,7355,'Stuck'),(11,7,8386,'Attacking'),(11,7,9077,'Leather'),(11,7,9078,'Cloth'),(11,7,9116,'Shield'),(11,7,9125,'Generic'),(11,7,21651,'Opening'),(11,7,21652,'Closing'),(11,7,22027,'Remove Insignia'),(11,7,22810,'Opening - No Text'),(11,7,27763,'Totem'),(11,7,28875,'Gemcutting'),(11,7,28878,'Inspiring Presence'),(11,7,29932,'Language Draenei'),(11,7,45927,'Summon Friend'),(11,7,59221,'Shadow Resistance'),(11,7,59547,'Gift of the Naaru'),(11,7,61437,'Opening'),(11,8,81,'Dodge'),(11,8,133,'Fireball'),(11,8,168,'Frost Armor'),(11,8,203,'Unarmed'),(11,8,204,'Defense'),(11,8,227,'Staves'),(11,8,522,'SPELLDEFENSE (DND)'),(11,8,668,'Language Common'),(11,8,1843,'Disarm'),(11,8,2382,'Generic'),(11,8,2479,'Honorless Target'),(11,8,3050,'Detect'),(11,8,3365,'Opening'),(11,8,5009,'Wands'),(11,8,5019,'Shoot'),(11,8,6233,'Closing'),(11,8,6246,'Closing'),(11,8,6247,'Opening'),(11,8,6477,'Opening'),(11,8,6478,'Opening'),(11,8,6603,'Attack'),(11,8,7266,'Duel'),(11,8,7267,'Grovel'),(11,8,7355,'Stuck'),(11,8,8386,'Attacking'),(11,8,9078,'Cloth'),(11,8,9125,'Generic'),(11,8,21651,'Opening'),(11,8,21652,'Closing'),(11,8,22027,'Remove Insignia'),(11,8,22810,'Opening - No Text'),(11,8,28875,'Gemcutting'),(11,8,28878,'Inspiring Presence'),(11,8,29932,'Language Draenei'),(11,8,45927,'Summon Friend'),(11,8,59221,'Shadow Resistance'),(11,8,59548,'Gift of the Naaru'),(11,8,61437,'Opening'),(7,9,58284,'Chaos Bolt Passive'),(10,9,58284,'Chaos Bolt Passive'),(11,2,60091,'Judgement Anti-Parry/Dodge Passive'),(10,2,60091,'Judgement Anti-Parry/Dodge Passive'),(3,2,60091,'Judgement Anti-Parry/Dodge Passive'),(1,2,60091,'Judgement Anti-Parry/Dodge Passive'),(0,6,56816,'Rune Strike'),(1,1,202,'Two-Handed Swords'),(4,1,202,'Two-Handed Swords'),(7,1,202,'Two-Handed Swords'),(8,1,202,'Two-Handed Swords'),(11,1,202,'Two-Handed Swords'),(2,3,197,'Two-Handed Axes'),(3,3,197,'Two-Handed Axes'),(4,3,197,'Two-Handed Axes'),(6,3,197,'Two-Handed Axes'),(8,3,197,'Two-Handed Axes'),(10,3,197,'Two-Handed Axes'),(11,3,197,'Two-Handed Axes'),(1,4,674,'Dual Wield'),(2,4,674,'Dual Wield'),(3,4,674,'Dual Wield'),(4,4,674,'Dual Wield'),(5,4,674,'Dual Wield'),(7,4,674,'Dual Wield'),(8,4,674,'Dual Wield'),(10,4,674,'Dual Wield'),(1,5,227,'Staves'),(3,5,227,'Staves'),(4,5,227,'Staves'),(5,5,227,'Staves'),(8,5,227,'Staves'),(10,5,227,'Staves'),(11,5,227,'Staves'),(1,9,227,'Staves'),(2,9,227,'Staves'),(5,9,227,'Staves'),(7,9,227,'Staves'),(10,9,227,'Staves'),(0,7,75461,'Flame Shock Passive'); +/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_spell_custom` +-- + +DROP TABLE IF EXISTS `playercreateinfo_spell_custom`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playercreateinfo_spell_custom` ( + `race` tinyint(3) unsigned NOT NULL DEFAULT '0', + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Spell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Note` varchar(255) DEFAULT NULL, + `Active` tinyint(3) unsigned NOT NULL DEFAULT '1', + PRIMARY KEY (`race`,`class`,`Spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `playercreateinfo_spell_custom` +-- + +LOCK TABLES `playercreateinfo_spell_custom` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_spell_custom` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo_spell_custom` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `points_of_interest` +-- + +DROP TABLE IF EXISTS `points_of_interest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `points_of_interest` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `icon` mediumint(8) unsigned NOT NULL DEFAULT '0', + `flags` mediumint(8) unsigned NOT NULL DEFAULT '0', + `data` mediumint(8) unsigned NOT NULL DEFAULT '0', + `icon_name` text NOT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `points_of_interest` +-- + +LOCK TABLES `points_of_interest` WRITE; +/*!40000 ALTER TABLE `points_of_interest` DISABLE KEYS */; +/*!40000 ALTER TABLE `points_of_interest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pool_creature` +-- + +DROP TABLE IF EXISTS `pool_creature`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pool_creature` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0', + `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `chance` float unsigned NOT NULL DEFAULT '0', + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`guid`), + KEY `idx_guid` (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pool_creature` +-- + +LOCK TABLES `pool_creature` WRITE; +/*!40000 ALTER TABLE `pool_creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `pool_creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pool_gameobject` +-- + +DROP TABLE IF EXISTS `pool_gameobject`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pool_gameobject` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0', + `pool_entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `chance` float unsigned NOT NULL DEFAULT '0', + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`guid`), + KEY `idx_guid` (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pool_gameobject` +-- + +LOCK TABLES `pool_gameobject` WRITE; +/*!40000 ALTER TABLE `pool_gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `pool_gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pool_pool` +-- + +DROP TABLE IF EXISTS `pool_pool`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pool_pool` ( + `pool_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `mother_pool` mediumint(8) unsigned NOT NULL DEFAULT '0', + `chance` float NOT NULL DEFAULT '0', + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`pool_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pool_pool` +-- + +LOCK TABLES `pool_pool` WRITE; +/*!40000 ALTER TABLE `pool_pool` DISABLE KEYS */; +/*!40000 ALTER TABLE `pool_pool` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pool_template` +-- + +DROP TABLE IF EXISTS `pool_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pool_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Pool entry', + `max_limit` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Max number of objects (0) is no limit', + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pool_template` +-- + +LOCK TABLES `pool_template` WRITE; +/*!40000 ALTER TABLE `pool_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `pool_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `prospecting_loot_template` +-- + +DROP TABLE IF EXISTS `prospecting_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `prospecting_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `prospecting_loot_template` +-- + +LOCK TABLES `prospecting_loot_template` WRITE; +/*!40000 ALTER TABLE `prospecting_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `prospecting_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_end_scripts` +-- + +DROP TABLE IF EXISTS `quest_end_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quest_end_scripts` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `delay` int(10) unsigned NOT NULL DEFAULT '0', + `command` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong2` int(10) unsigned NOT NULL DEFAULT '0', + `dataint` int(11) NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `z` float NOT NULL DEFAULT '0', + `o` float NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `quest_end_scripts` +-- + +LOCK TABLES `quest_end_scripts` WRITE; +/*!40000 ALTER TABLE `quest_end_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_end_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_poi` +-- + +DROP TABLE IF EXISTS `quest_poi`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quest_poi` ( + `questId` int(10) UNSIGNED NOT NULL DEFAULT '0', + `id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `objIndex` int(10) NOT NULL DEFAULT '0', + `mapid` int(10) UNSIGNED NOT NULL DEFAULT '0', + `WorldMapAreaId` int(10) UNSIGNED NOT NULL DEFAULT '0', + `FloorId` int(10) UNSIGNED NOT NULL DEFAULT '0', + `unk3` int(10) UNSIGNED NOT NULL DEFAULT '0', + `unk4` int(10) UNSIGNED NOT NULL DEFAULT '0', + KEY `questId` (`questId`,`id`), + KEY `id` (`id`,`questId`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `quest_poi` +-- + +LOCK TABLES `quest_poi` WRITE; +/*!40000 ALTER TABLE `quest_poi` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_poi` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_poi_points` +-- + +DROP TABLE IF EXISTS `quest_poi_points`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quest_poi_points` ( + `questId` int(10) UNSIGNED NOT NULL DEFAULT '0', + `id` int(10) UNSIGNED NOT NULL DEFAULT '0', + `x` int(10) NOT NULL DEFAULT '0', + `y` int(10) NOT NULL DEFAULT '0', + KEY `questId_id` (`questId`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `quest_poi_points` +-- + +LOCK TABLES `quest_poi_points` WRITE; +/*!40000 ALTER TABLE `quest_poi_points` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_poi_points` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_start_scripts` +-- + +DROP TABLE IF EXISTS `quest_start_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quest_start_scripts` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `delay` int(10) unsigned NOT NULL DEFAULT '0', + `command` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong2` int(10) unsigned NOT NULL DEFAULT '0', + `dataint` int(11) NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `z` float NOT NULL DEFAULT '0', + `o` float NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `quest_start_scripts` +-- + +LOCK TABLES `quest_start_scripts` WRITE; +/*!40000 ALTER TABLE `quest_start_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_start_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_template` +-- + +DROP TABLE IF EXISTS `quest_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quest_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Method` tinyint(3) unsigned NOT NULL DEFAULT '2', + `ZoneOrSort` smallint(6) NOT NULL DEFAULT '0', + `SkillOrClassMask` mediumint(8) NOT NULL DEFAULT '0', + `MinLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `QuestLevel` smallint(3) NOT NULL DEFAULT '1', + `Type` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredRaces` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredSkillValue` smallint(5) unsigned NOT NULL DEFAULT '0', + `RepObjectiveFaction` smallint(5) unsigned NOT NULL DEFAULT '0', + `RepObjectiveValue` mediumint(9) NOT NULL DEFAULT '0', + `RepObjectiveFaction2` smallint(5) unsigned NOT NULL DEFAULT '0', + `RepObjectiveValue2` mediumint(9) NOT NULL DEFAULT '0', + `RequiredMinRepFaction` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredMinRepValue` mediumint(9) NOT NULL DEFAULT '0', + `RequiredMaxRepFaction` smallint(5) unsigned NOT NULL DEFAULT '0', + `RequiredMaxRepValue` mediumint(9) NOT NULL DEFAULT '0', + `SuggestedPlayers` tinyint(3) unsigned NOT NULL DEFAULT '0', + `LimitTime` int(10) unsigned NOT NULL DEFAULT '0', + `QuestFlags` int(10) unsigned NOT NULL DEFAULT '0', + `SpecialFlags` tinyint(3) unsigned NOT NULL DEFAULT '0', + `CharTitleId` tinyint(3) unsigned NOT NULL DEFAULT '0', + `PlayersSlain` tinyint(3) unsigned NOT NULL DEFAULT '0', + `BonusTalents` tinyint(3) unsigned unsigned NULL DEFAULT '0', + `RewardArenaPoints` smallint(5) unsigned NOT NULL DEFAULT '0', + `PrevQuestId` mediumint(9) NOT NULL DEFAULT '0', + `NextQuestId` mediumint(9) NOT NULL DEFAULT '0', + `ExclusiveGroup` mediumint(9) NOT NULL DEFAULT '0', + `NextQuestInChain` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewXPId` tinyint(2) unsigned NOT NULL DEFAULT '0', + `SrcItemId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `SrcItemCount` tinyint(3) unsigned NOT NULL DEFAULT '0', + `SrcSpell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Title` text DEFAULT NULL, + `Details` text DEFAULT NULL, + `Objectives` text DEFAULT NULL, + `OfferRewardText` text DEFAULT NULL, + `RequestItemsText` text DEFAULT NULL, + `EndText` text DEFAULT NULL, + `CompletedText` text DEFAULT NULL, + `ObjectiveText1` text DEFAULT NULL, + `ObjectiveText2` text DEFAULT NULL, + `ObjectiveText3` text DEFAULT NULL, + `ObjectiveText4` text DEFAULT NULL, + `ReqItemId1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqItemId2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqItemId3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqItemId4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqItemId5` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqItemId6` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqItemCount1` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqItemCount2` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqItemCount3` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqItemCount4` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqItemCount5` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqItemCount6` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqSourceId1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSourceId2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSourceId3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSourceId4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSourceCount1` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqSourceCount2` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqSourceCount3` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqSourceCount4` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqCreatureOrGOId1` mediumint(9) NOT NULL DEFAULT '0', + `ReqCreatureOrGOId2` mediumint(9) NOT NULL DEFAULT '0', + `ReqCreatureOrGOId3` mediumint(9) NOT NULL DEFAULT '0', + `ReqCreatureOrGOId4` mediumint(9) NOT NULL DEFAULT '0', + `ReqCreatureOrGOCount1` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqCreatureOrGOCount2` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqCreatureOrGOCount3` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqCreatureOrGOCount4` smallint(5) unsigned NOT NULL DEFAULT '0', + `ReqSpellCast1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSpellCast2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSpellCast3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ReqSpellCast4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemId1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemId2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemId3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemId4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemId5` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemId6` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemCount1` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemCount2` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemCount3` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemCount4` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemCount5` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewChoiceItemCount6` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewItemId1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewItemId2` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewItemId3` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewItemId4` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewItemCount1` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewItemCount2` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewItemCount3` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewItemCount4` smallint(5) unsigned NOT NULL DEFAULT '0', + `RewRepFaction1` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction2` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction3` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction4` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction5` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepValueId1` mediumint(6) NOT NULL DEFAULT '0', + `RewRepValueId2` mediumint(6) NOT NULL DEFAULT '0', + `RewRepValueId3` mediumint(6) NOT NULL DEFAULT '0', + `RewRepValueId4` mediumint(6) NOT NULL DEFAULT '0', + `RewRepValueId5` mediumint(6) NOT NULL DEFAULT '0', + `RewRepValue1` mediumint(9) NOT NULL DEFAULT '0', + `RewRepValue2` mediumint(9) NOT NULL DEFAULT '0', + `RewRepValue3` mediumint(9) NOT NULL DEFAULT '0', + `RewRepValue4` mediumint(9) NOT NULL DEFAULT '0', + `RewRepValue5` mediumint(9) NOT NULL DEFAULT '0', + `RewHonorAddition` int(10) signed NOT NULL DEFAULT '0', + `RewHonorMultiplier` float NOT NULL DEFAULT '1', + `unk0` tinyint(2) unsigned NOT NULL DEFAULT '0', + `RewOrReqMoney` int(11) NOT NULL DEFAULT '0', + `RewMoneyMaxLevel` int(10) unsigned NOT NULL DEFAULT '0', + `RewSpell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewSpellCast` int(11) signed NOT NULL DEFAULT '0', + `RewMailTemplateId` mediumint(8) unsigned NOT NULL DEFAULT '0', + `RewMailDelaySecs` int(11) unsigned NOT NULL DEFAULT '0', + `PointMapId` smallint(5) unsigned NOT NULL DEFAULT '0', + `PointX` float NOT NULL DEFAULT '0', + `PointY` float NOT NULL DEFAULT '0', + `PointOpt` mediumint(8) unsigned NOT NULL DEFAULT '0', + `DetailsEmote1` smallint(5) unsigned NOT NULL DEFAULT '0', + `DetailsEmote2` smallint(5) unsigned NOT NULL DEFAULT '0', + `DetailsEmote3` smallint(5) unsigned NOT NULL DEFAULT '0', + `DetailsEmote4` smallint(5) unsigned NOT NULL DEFAULT '0', + `DetailsEmoteDelay1` int(11) unsigned NOT NULL DEFAULT '0', + `DetailsEmoteDelay2` int(11) unsigned NOT NULL DEFAULT '0', + `DetailsEmoteDelay3` int(11) unsigned NOT NULL DEFAULT '0', + `DetailsEmoteDelay4` int(11) unsigned NOT NULL DEFAULT '0', + `IncompleteEmote` smallint(5) unsigned NOT NULL DEFAULT '0', + `CompleteEmote` smallint(5) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmote1` smallint(5) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmote2` smallint(5) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmote3` smallint(5) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmote4` smallint(5) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmoteDelay1` int(11) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmoteDelay2` int(11) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmoteDelay3` int(11) unsigned NOT NULL DEFAULT '0', + `OfferRewardEmoteDelay4` int(11) unsigned NOT NULL DEFAULT '0', + `StartScript` mediumint(8) unsigned NOT NULL DEFAULT '0', + `CompleteScript` mediumint(8) unsigned NOT NULL DEFAULT '0', + `WDBVerified` smallint(5) signed DEFAULT '1', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quest System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `quest_template` +-- + +LOCK TABLES `quest_template` WRITE; +/*!40000 ALTER TABLE `quest_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `reference_loot_template` +-- + +DROP TABLE IF EXISTS `reference_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `reference_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `reference_loot_template` +-- + +LOCK TABLES `reference_loot_template` WRITE; +/*!40000 ALTER TABLE `reference_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `reference_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `reserved_name` +-- + +DROP TABLE IF EXISTS `reserved_name`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `reserved_name` ( + `name` varchar(12) NOT NULL DEFAULT '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player Reserved Names'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `reserved_name` +-- + +LOCK TABLES `reserved_name` WRITE; +/*!40000 ALTER TABLE `reserved_name` DISABLE KEYS */; +/*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `script_texts` +-- + +DROP TABLE IF EXISTS `script_texts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `script_texts` ( + `npc_entry` mediumint(8) NOT NULL DEFAULT '0' COMMENT 'creature_template entry', + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `language` tinyint(3) unsigned NOT NULL DEFAULT '0', + `emote` smallint(5) unsigned NOT NULL DEFAULT '0', + `comment` text, + PRIMARY KEY (`npc_entry`,`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `script_texts` +-- + +LOCK TABLES `script_texts` WRITE; +/*!40000 ALTER TABLE `script_texts` DISABLE KEYS */; +/*!40000 ALTER TABLE `script_texts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `script_waypoint` +-- + +DROP TABLE IF EXISTS `script_waypoint`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `script_waypoint` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry', + `pointid` mediumint(8) unsigned NOT NULL DEFAULT '0', + `location_x` float NOT NULL DEFAULT '0', + `location_y` float NOT NULL DEFAULT '0', + `location_z` float NOT NULL DEFAULT '0', + `waittime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs', + `point_comment` text, + PRIMARY KEY (`entry`,`pointid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `script_waypoint` +-- + +LOCK TABLES `script_waypoint` WRITE; +/*!40000 ALTER TABLE `script_waypoint` DISABLE KEYS */; +/*!40000 ALTER TABLE `script_waypoint` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `season_linked_event` +-- + +DROP TABLE IF EXISTS `season_linked_event`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `season_linked_event` ( + `season` int(3) UNSIGNED NOT NULL default '0', + `event` int(8) UNSIGNED NOT NULL default '0', + PRIMARY KEY (`season`), + UNIQUE (`season`,`event`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `season_linked_event` +-- + +LOCK TABLES `season_linked_event` WRITE; +/*!40000 ALTER TABLE `season_linked_event` DISABLE KEYS */; +/*!40000 ALTER TABLE `season_linked_event` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skill_discovery_template` +-- + +DROP TABLE IF EXISTS `skill_discovery_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `skill_discovery_template` ( + `spellId` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'SpellId of the discoverable spell', + `reqSpell` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'spell requirement', + `reqSkillValue` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'skill points requirement', + `chance` float NOT NULL DEFAULT '0' COMMENT 'chance to discover', + PRIMARY KEY (`spellId`,`reqSpell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Discovery System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `skill_discovery_template` +-- + +LOCK TABLES `skill_discovery_template` WRITE; +/*!40000 ALTER TABLE `skill_discovery_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `skill_discovery_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skill_extra_item_template` +-- + +DROP TABLE IF EXISTS `skill_extra_item_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `skill_extra_item_template` ( + `spellId` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'SpellId of the item creation spell', + `requiredSpecialization` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Specialization spell id', + `additionalCreateChance` float NOT NULL DEFAULT '0' COMMENT 'chance to create add', + `additionalMaxNum` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'max num of adds', + PRIMARY KEY (`spellId`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Specialization System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `skill_extra_item_template` +-- + +LOCK TABLES `skill_extra_item_template` WRITE; +/*!40000 ALTER TABLE `skill_extra_item_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `skill_extra_item_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skill_fishing_base_level` +-- + +DROP TABLE IF EXISTS `skill_fishing_base_level`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `skill_fishing_base_level` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Area identifier', + `skill` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Base skill level requirement', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Fishing system'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `skill_fishing_base_level` +-- + +LOCK TABLES `skill_fishing_base_level` WRITE; +/*!40000 ALTER TABLE `skill_fishing_base_level` DISABLE KEYS */; +/*!40000 ALTER TABLE `skill_fishing_base_level` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skinning_loot_template` +-- + +DROP TABLE IF EXISTS `skinning_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `skinning_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `skinning_loot_template` +-- + +LOCK TABLES `skinning_loot_template` WRITE; +/*!40000 ALTER TABLE `skinning_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `skinning_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_area` +-- + +DROP TABLE IF EXISTS `spell_area`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_area` ( + `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `area` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest_start` mediumint(8) unsigned NOT NULL DEFAULT '0', + `quest_start_active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `quest_end` mediumint(8) unsigned NOT NULL DEFAULT '0', + `aura_spell` mediumint(8) NOT NULL DEFAULT '0', + `racemask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `gender` tinyint(1) unsigned NOT NULL DEFAULT '2', + `autocast` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`spell`,`area`,`quest_start`,`quest_start_active`,`aura_spell`,`racemask`,`gender`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_area` +-- + +LOCK TABLES `spell_area` WRITE; +/*!40000 ALTER TABLE `spell_area` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_area` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_bonus_data` +-- + +DROP TABLE IF EXISTS `spell_bonus_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_bonus_data` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `direct_bonus` float NOT NULL DEFAULT '0', + `dot_bonus` float NOT NULL DEFAULT '0', + `ap_bonus` float NOT NULL DEFAULT '0', + `ap_dot_bonus` float NOT NULL DEFAULT '0', + `comments` varchar(255) DEFAULT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_bonus_data` +-- + +LOCK TABLES `spell_bonus_data` WRITE; +/*!40000 ALTER TABLE `spell_bonus_data` DISABLE KEYS */; +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(49941, -1, -1, 0.04, -1, 'Death Knight - Blood Boil'), +(48721, 0, -1, 0.04, -1, 'Death Knight - Blood Boil'), +(55078, 0, 0, -1, 0.06325, 'Death Knight - Blood Plague'), +(50444, -1, -1, 0.105, -1, 'Death Knight - Corpse Explosion Triggered'), +(52212, 0, -1, 0.0475, -1, 'Death Knight - Death and Decay'), +(47632, -1, -1, 0.15, -1, 'Death Knight - Death Coil'), +(47633, -1, -1, 0.15, -1, 'Death Knight - Death Coil Heal'), +(55095, -1, 0, -1, 0.06325, 'Death Knight - Frost Fever'), +(58621, -1, -1, 0.08, -1, 'Death Knight - Glyph of Chains of Ice'), +(49184, -1, -1, 0.1, -1, 'Death Knight - Howling Blast'), +(45477, 0, -1, 0.1, -1, 'Death Knight - Icy Touch'), +(56903, 0, 0, 0, 0, 'Death Knight - Lichflame'), +(51460, 0, -1, -1, -1, 'Death Knight - Necrosis'), +(50842, -1, -1, 0.04, -1, 'Death Knight - Pestilence'), +(50401, 0, 0, 0, 0, 'Death Knight - Razor Frost'), +(47476, -1, -1, 0.06, -1, 'Death Knight - Strangulate'), +(50536, -1, 0, -1, -1, 'Death Knight - Unholy Blight (Rank 1)'), +(339, -1, 0.1, -1, -1, 'Druid - Entangling Roots'), +(60089, -1, -1, 0.15, -1, 'Druid - Faerie Fire (feral)'), +(5185, 1.611, -1, -1, -1, 'Druid - Healing Touch'), +(42231, 0.12898, -1, -1, -1, 'Druid - Hurricane Triggered'), +(5570, -1, 0.2, -1, -1, 'Druid - Insect Swarm'), +(33745, -1, -1, -1, 0.01, 'Druid - Lacerate($AP*0.05 / number of ticks)'), +(33778, 0.516, 0, 0, 0, 'Druid - Lifebloom final heal'), +(33763, 0, 0.09518, 0, 0, 'Druid - Lifebloom HoT(rank 1)'), +(48450, 0, 0.09518, 0, 0, 'Druid - Lifebloom HoT(rank 2)'), +(48451, 0, 0.09518, 0, 0, 'Druid - Lifebloom HoT(rank 3)'), +(48628, -1, -1, -1, 0.15, 'Druid - Lock Jaw'), +(8921, 0.1515, 0.13, -1, -1, 'Druid - Moonfire'), +(50464, 0.67305, -1, -1, -1, 'Druid - Nourish'), +(1822, -1, -1, 0.01, 0.06, 'Druid - Rake ($AP*0.18 / number of ticks)'), +(8936, 0.539, 0.188, -1, -1, 'Druid - Regrowth'), +(774, -1, 0.37604, -1, -1, 'Druid - Rejuvenation'), +(50294, 0.0119, -1, -1, -1, 'Druid - Starfall AOE rank 1'), +(53188, 0.0119, -1, -1, -1, 'Druid - Starfall AOE rank 2'), +(53189, 0.0119, -1, -1, -1, 'Druid - Starfall AOE rank 3'), +(53190, 0.0119, -1, -1, -1, 'Druid - Starfall AOE rank 4'), +(50288, 0.0458, -1, -1, -1, 'Druid - Starfall rank 1'), +(53191, 0.0458, -1, -1, -1, 'Druid - Starfall rank 2'), +(53194, 0.0458, -1, -1, -1, 'Druid - Starfall rank 3'), +(53195, 0.0458, -1, -1, -1, 'Druid - Starfall rank 4'), +(2912, 1, -1, -1, -1, 'Druid - Starfire'), +(18562, 0, 0, 0, 0, 'Druid - Swiftmend'), +(779, -1, -1, 0.063, -1, 'Druid - Swipe (Bear)'), +(44203, 0.538, -1, -1, -1, 'Druid - Tranquility Triggered'), +(61391, 0.193, -1, -1, -1, 'Druid - Typhoon'), +(48438, -1, 0.11505, -1, -1, 'Druid - Wild Growth'), +(5176, 0.5714, -1, -1, -1, 'Druid - Wrath'), +(3044, -1, -1, 0.15, -1, 'Hunter - Arcane Shot'), +(3674, -1, -1, -1, 0.02, 'Hunter - Black Arrow($RAP*0.1 / number of ticks)'), +(19306, -1, -1, 0.2, -1, 'Hunter - Counterattack'), +(13812, -1, -1, 0.1, -1, 'Hunter - Explosive Trap Effect'), +(13797, -1, -1, -1, 0.02, 'Hunter - Immolation Trap($RAP*0.1 / number of ticks)'), +(1495, -1, -1, 0.2, -1, 'Hunter - Mongoose Bite'), +(1978, -1, -1, -1, 0.04, 'Hunter - Serpent Sting($RAP*0.2 / number of ticks)'), +(56641, -1, -1, 0.1, -1, 'Hunter - Steady Shot'), +(42243, -1, -1, 0.07, -1, 'Hunter - Volley'), +(53352, -1, -1, 0.14, -1, 'Hunter - Explosive Shot (triggered)'), +(55039, 0, 0, 0, 0, 'Item - Gnomish Lightning Generator'), +(40293, 0, 0, 0, 0, 'Item - Siphon Essence'), +(44425, 0.7143, -1, -1, -1, 'Mage - Arcane Barrage'), +(30451, 0.7143, -1, -1, -1, 'Mage - Arcane Blast'), +(1449, 0.2128, -1, -1, -1, 'Mage - Arcane Explosion'), +(7268, 0.2857, -1, -1, -1, 'Mage - Arcane Missiles Triggered Spell Rank 1'), +(7269, 0.2857, -1, -1, -1, 'Mage - Arcane Missiles Triggered Spell Rank 2'), +(11113, 0.1936, -1, -1, -1, 'Mage - Blast Wave'), +(42208, 0.1437, -1, -1, -1, 'Mage - Blizzard Triggered Spell'), +(120, 0.214, -1, -1, -1, 'Mage - Cone of Cold'), +(31661, 0.1936, -1, -1, -1, 'Mage - Dragons Breath'), +(133, 1, -1, -1, -1, 'Mage - Fire Ball'), +(2136, 0.4286, -1, -1, -1, 'Mage - Fire Blast'), +(543, 0.1, -1, -1, -1, 'Mage - Fire Ward'), +(2120, 0.2357, 0.122, -1, -1, 'Mage - Flamestrike'), +(116, 0.8143, -1, -1, -1, 'Mage - Frost Bolt'), +(122, 0.193, -1, -1, -1, 'Mage - Frost Nova'), +(6143, 0.1, -1, -1, -1, 'Mage - Frost Ward'), +(44614, 0.8571, -1, -1, -1, 'Mage - Frostfire Bolt'), +(11426, 0.8053, -1, -1, -1, 'Mage - Ice Barrier'), +(30455, 0.1429, -1, -1, -1, 'Mage - Ice Lance'), +(12654, 0, 0, 0, 0, 'Mage - Ignite'), +(44457, 0.4, 0.2, -1, -1, 'Mage - Living Bomb'), +(1463, 0.8053, -1, -1, -1, 'Mage - Mana Shield'), +(34913, 0, 0, 0, 0, 'Mage - Molten Armor Triggered Rank 1'), +(11366, 1.15, 0.05, -1, -1, 'Mage - Pyroblast'), +(2948, 0.4286, -1, -1, -1, 'Mage - Scorch'), +(59638, 0.3, -1, 0, -1, 'Mage - Mirror Image Frostbolt'), +(59637, 0.15, -1, 0, -1, 'Mage - Mirror Image Fire Blast'), +(31935, 0.07, -1, 0.07, -1, 'Paladin - Avenger Shield'), +(53742, -1, 0.0176, -1, 0.03, 'Paladin - Blood Corruption'), +(26573, -1, 0.04, -1, 0.04, 'Paladin - Consecration'), +(879, 0.15, -1, 0.15, -1, 'Paladin - Exorcism'), +(19750, 1, -1, -1, -1, 'Paladin - Flash of Light'), +(53595, 0, 0, 0, 0, 'Paladin - Hammer of the Righteous'), +(24275, 0.15, -1, 0.15, -1, 'Paladin - Hammer of Wrath'), +(62124, 0.085, -1, -1, -1, 'Paladin - Hand of Reckoning'), +(635, 1.66, -1, -1, -1, 'Paladin - Holy Light'), +(20925, 0.09, -1, 0.056, -1, 'Paladin - Holy Shield'), +(25914, 0.81, -1, -1, -1, 'Paladin - Holy Shock Triggered Heal Rank 1'), +(25912, 0.4286, -1, -1, -1, 'Paladin - Holy Shock Triggered Hurt Rank 1'), +(31803, -1, 0.0176, -1, 0.03, 'Paladin - Holy Vengeance'), +(2812, 0.07, -1, 0.07, -1, 'Paladin - Holy Wrath'), +(31898, 0.25, -1, 0.16, -1, 'Paladin - Judgement of Blood Enemy'), +(32220, 0.0833, -1, 0.0533, -1, 'Paladin - Judgement of Blood Self'), +(20467, 0.25, -1, 0.16, -1, 'Paladin - Judgement of Command'), +(53733, 0.22, -1, 0.14, -1, 'Paladin - Judgement of Corruption'), +-- (20187, 0.4, -1, 0.25, -1, 'Paladin - Judgement of Righteousness'), +(20187, 0, 0, 0, 0, 'Paladin - Judgement of Righteousness'), +(53726, 0.25, -1, 0.16, -1, 'Paladin - Judgement of the Martyr Enemy'), +(53725, 0.0833, -1, 0.0533, -1, 'Paladin - Judgement of the Martyr Self'), +(31804, 0.22, -1, 0.14, -1, 'Paladin - Judgement of Vengeance'), +-- (54158, 0.25, -1, 0.16, -1, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), +(54158, 0, 0, 0, 0, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), +(58597, 0.75, -1, -1, -1, 'Paladin - Sacred Shield'), +(53601, 0.75, -1, -1, -1, 'Paladin - Sacred Shield'), +(31893, 0, 0, 0, 0, 'Paladin - Seal of Blood Proc Enemy'), +(32221, 0, 0, 0, 0, 'Paladin - Seal of Blood Proc Self'), +(20424, 0, 0, 0, 0, 'Paladin - Seal of Command Proc'), +(20167, 0.15, -1, 0.15, -1, 'Paladin - Seal of Light Proc'), +(25742, 0.07, -1, 0.039, -1, 'Paladin - Seal of Righteousness Dummy Proc'), +(53719, 0, 0, 0, 0, 'Paladin - Seal of the Martyr Proc Enemy'), +(53718, 0, 0, 0, 0, 'Paladin - Seal of the Martyr Proc Self'), +(20267, 0, 0, 0, 0, 'Paladin - Judgement of Light Proc'), +(25997, 0, 0, 0, 0, 'Paladin - Eye for an Eye'), +(50256, -1, -1, 0.08, -1, 'Pet Skills - Bear (Swipe)'), +(32546, 0.8068, -1, -1, -1, 'Priest - Binding Heal'), +(27813, 0, 0, 0, 0, 'Priest - Blessed Recovery Rank 1'), +(34861, 0.402, -1, -1, -1, 'Priest - Circle of Healing'), +(19236, 0.8068, -1, -1, -1, 'Priest - Desperate Prayer'), +(2944, -1, 0.1849, -1, -1, 'Priest - Devouring Plague'), +(63544, 0, -1, -1, -1, 'Priest - Empowered Renew'), +(2061, 0.8068, -1, -1, -1, 'Priest - Flash Heal'), +(2060, 1.6135, -1, -1, -1, 'Priest - Greater Heal'), +(14914, 0.5711, 0.024, -1, -1, 'Priest - Holy Fire'), +(15237, 0.1606, -1, -1, -1, 'Priest - Holy Nova Damage'), +(23455, 0.3035, -1, -1, -1, 'Priest - Holy Nova Heal Rank 1'), +(8129, 0, 0, 0, 0, 'Priest - Mana Burn'), +(8092, 0.428, -1, -1, -1, 'Priest - Mind Blast'), +(15407, 0.257, -1, -1, -1, 'Priest - Mind Flay'), +(49821, 0.2861, -1, -1, -1, 'Priest - Mind Sear Trigger Rank 1'), +(47750, 0.5362, -1, -1, -1, 'Priest - Penance Heal (Rank 1)'), +(52983, 0.5362, -1, -1, -1, 'Priest - Penance Heal (Rank 2)'), +(52954, 0.5362, -1, -1, -1, 'Priest - Penance Heal (Rank 3)'), +(58985, 0.5362, -1, -1, -1, 'Priest - Penance Heal (Rank 4)'), +(47666, 0.229, -1, -1, -1, 'Priest - Penance Hurt (Rank 1)'), +(52998, 0.229, -1, -1, -1, 'Priest - Penance Hurt (Rank 2)'), +(52999, 0.229, -1, -1, -1, 'Priest - Penance Hurt (Rank 3)'), +(53000, 0.229, -1, -1, -1, 'Priest - Penance Hurt (Rank 4)'), +(17, 0.8068, -1, -1, -1, 'Priest - Power Word: Shield'), +(596, 0.8068, -1, -1, -1, 'Priest - Prayer of Healing'), +(33110, 0.8068, -1, -1, -1, 'Priest - Prayer of Mending Heal Proc'), +(33619, 0, 0, 0, 0, 'Priest - Reflective Shield'), +(139, -1, 0.376, -1, -1, 'Priest - Renew'), +(32379, 0.4296, -1, -1, -1, 'Priest - Shadow Word: Death'), +(589, -1, 0.1829, -1, -1, 'Priest - Shadow Word: Pain'), +(34433, 0.65, -1, -1, -1, 'Priest - Shadowfiend'), +(585, 0.714, -1, -1, -1, 'Priest - Smite'), +(34914, -1, 0.4, -1, -1, 'Priest - Vampiric Touch'), +(7001, -1, 0.3333, -1, -1, 'Priest - Lightwell Renew Rank 1'), +(63675, 0, 0, 0, 0, 'Priest - Improved Devouring Plague'), +(56131, 0, 0, 0, 0, 'Priest - Glyph of Dispel Magic'), +(56160, 0, 0, 0, 0, 'Priest - Glyph of Power Word: Shield'), +(2818, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 1($AP*0.12 / number of ticks)'), +(2819, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 2($AP*0.12 / number of ticks)'), +(11353, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 3($AP*0.12 / number of ticks)'), +(11354, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 4($AP*0.12 / number of ticks)'), +(25349, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 5($AP*0.12 / number of ticks)'), +(26968, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 6($AP*0.12 / number of ticks)'), +(27187, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 7($AP*0.12 / number of ticks)'), +(57969, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 8($AP*0.12 / number of ticks)'), +(57970, -1, -1, -1, 0.03, 'Rogue - Deadly Poison Rank 9($AP*0.12 / number of ticks)'), +(703, -1, -1, -1, 0.02, 'Rogue - Garrote'), +(1776, -1, -1, 0.21, -1, 'Rogue - Gouge'), +(8680, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 1'), +(8685, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 2'), +(8689, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 3'), +(11335, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 4'), +(11336, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 5'), +(11337, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 6'), +(26890, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 7'), +(57964, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 8'), +(57965, -1, -1, 0.1, -1, 'Rogue - Instant Poison Rank 9'), +(13218, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 1'), +(13222, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 2'), +(13223, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 3'), +(13224, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 4'), +(27189, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 5'), +(57974, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 6'), +(57975, -1, -1, 0.04, -1, 'Rogue - Wound Poison Rank 7'), +(1064, 1.34, -1, -1, -1, 'Shaman - Chain Heal'), +(421, 0.57, -1, -1, -1, 'Shaman - Chain Lightning'), +(974, 0.4762, -1, -1, -1, 'Shaman - Earth Shield'), +(379, 0, 0, 0, 0, 'Shaman - Earth Shield Triggered'), +(8042, 0.3858, -1, -1, -1, 'Shaman - Earth Shock'), +(8050, 0.2142, 0.1, -1, -1, 'Shaman - Flame Shock'), +(8026, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 1'), +(58788, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 10'), +(8028, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 2'), +(8029, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 3'), +(10445, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 4'), +(16343, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 5'), +(16344, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 6'), +(25488, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 7'), +(58786, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 8'), +(58787, 0.1, -1, -1, -1, 'Shaman - Flametongue Weapon Proc Rank 9'), +(8056, 0.3858, -1, -1, -1, 'Shaman - Frost Shock'), +(8034, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 1'), +(8037, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 2'), +(10458, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 3'), +(16352, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 4'), +(16353, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 5'), +(25501, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 6'), +(58797, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 7'), +(58798, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 8'), +(58799, 0.1, -1, -1, -1, 'Shaman - Frostbrand Attack Rank 9'), +(2645, 0, 0, 0, 0, 'Shaman - Glyph of Ghost Wolf'), +(52042, 0.0445, 0.0445, -1, -1, 'Shaman - Healing Stream Totem Triggered Heal'), +(331, 1.6106, -1, -1, -1, 'Shaman - Healing Wave'), +(51505, 0.5714, -1, -1, -1, 'Shaman - Lava Burst'), +(8004, 0.8082, -1, -1, -1, 'Shaman - Lesser Healing Wave'), +(403, 0.7143, -1, -1, -1, 'Shaman - Lightning Bolt'), +(26364, 0.33, -1, -1, -1, 'Shaman - Lightning Shield Proc Rank 1'), +(45284, 0.357, -1, -1, -1, 'Shaman - LO Lightning Bolt'), +(45297, 0.285, -1, -1, -1, 'Shaman - LO Chain Lightning'), +(8188, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 1'), +(10582, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 2'), +(10583, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 3'), +(10584, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 4'), +(25551, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 5'), +(58733, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 6'), +(58736, 0.1, -1, -1, -1, 'Shaman - Magma Totam Passive Rank 7'), +(61295, 0.4, 0.18, -1, -1, 'Shaman - Riptide'), +(3606, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 1'), +(58702, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 10'), +(6350, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 2'), +(6351, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 3'), +(6352, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 4'), +(10435, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 5'), +(10436, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 6'), +(25530, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 7'), +(58700, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 8'), +(58701, 0.1667, -1, -1, -1, 'Shaman - Searing Totem Attack Rank 9'), +(52752, 0, 0, 0, 0, 'Ancestral Awakening'), +(55533, 0, 0, 0, 0, 'Shaman - Glyph of Healing Wave'), +(50796, 0.7139, -1, -1, -1, 'Warlock - Chaos Bolt'), +(17962, 0, 0, 0, 0, 'Warlock - Conflagrate'), +(172, -1, 0.2, -1, -1, 'Warlock - Corruption'), +(980, -1, 0.1, -1, -1, 'Warlock - Curse of Agony'), +(603, -1, 2, -1, -1, 'Warlock - Curse of Doom'), +(18220, 0.96, -1, -1, -1, 'Warlock - Dark Pact Rank 1'), +(6789, 0.214, -1, -1, -1, 'Warlock - Death Coil'), +(689, -1, 0.143, -1, -1, 'Warlock - Drain Life'), +(5138, 0, 0, 0, 0, 'Warlock - Drain Mana'), +(1120, -1, 0.429, -1, -1, 'Warlock - Drain Soul'), +(28176, 0, 0, 0, 0, 'Warlock - Fel Armor'), +(18790, 0, 0, 0, 0, 'Warlock - Fel Stamina'), +(54181, 0, -1, -1, -1, 'Warlock - Fel Synergy'), +(48181, 0.4793, -1, -1, -1, 'Warlock - Haunt'), +(755, -1, 0.4485, -1, -1, 'Warlock - Health Funnel'), +(1949, -1, 0.0949, -1, -1, 'Warlock - Hellfire'), +(5857, 0.145, -1, -1, -1, 'Warlock - Hellfire Effect on Enemy Rank 1'), +(348, 0.2, 0.2, -1, -1, 'Warlock - Immolate'), +(29722, 0.7139, -1, -1, -1, 'Warlock - Incinerate'), +(42223, 0.286, -1, -1, -1, 'Warlock - Rain of Fire Triggered Rank 1'), +(5676, 0.4293, -1, -1, -1, 'Warlock - Searing Pain'), +(27243, 0.2129, 0.25, -1, -1, 'Warlock - Seed of Corruption'), +(686, 0.8569, -1, -1, -1, 'Warlock - Shadow Bolt'), +(6229, 0.3, -1, -1, -1, 'Warlock - Shadow Ward'), +(17877, 0.4293, -1, -1, -1, 'Warlock - Shadowburn'), +(47960, 0.1064, 0.0667, -1, -1, 'Warlock - Shadowflame Rank 1'), +(61291, 0.1064, 0.0667, -1, -1, 'Warlock - Shadowflame Rank 2'), +(30283, 0.1932, -1, -1, -1, 'Warlock - Shadowfury'), +(63106, 0, 0, 0, 0, 'Warlock - Siphon Life Triggered'), +(6353, 1.15, -1, -1, -1, 'Warlock - Soul Fire'), +(30294, 0, 0, 0, 0, 'Warlock - Soul Leech'), +(30108, -1, 0.2, -1, -1, 'Warlock - Unstable Affliction'), +(31117, 1.8, -1, -1, -1, 'Warlock - Unstable Affliction Dispell'), +(57755, -1, -1, 0.5, -1, 'Warrior - Heroic Throw'), +(20253, -1, -1, 0.12, -1, 'Warrior - Intercept'), +(61491, -1, -1, 0.12, -1, 'Warrior - Intercept'), +(6572, -1, -1, 0.207, -1, 'Warrior - Revenge'), +(64382, -1, -1, 0.5, -1, 'Warrior - Shattering Throw'), +(6343, -1, -1, 0.12, -1, 'Warrior - Thunder Clap'), +(54757, 0, -1, -1, -1, 'Hand-Mounted Pyro Rocket - Pyro Rocket'), +(45055, 0, -1, -1, -1, 'Timbal''s Focusing Crystal - Shadow Bolt'), +(60203, 0, -1, -1, -1, 'Darkmoon Card: Death'), +(60488, 0, -1, -1, -1, 'Extract of Necromatic Power'), +(45429, 0, -1, -1, -1, 'Shattered Sun Pendant of Acumen - Arcane Bolt'); +/*!40000 ALTER TABLE `spell_bonus_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_dbc` +-- + +DROP TABLE IF EXISTS `spell_dbc`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_dbc` ( + `Id` int(10) unsigned NOT NULL, + `Dispel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Mechanic` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Attributes` int(10) unsigned NOT NULL DEFAULT '0', + `AttributesEx` int(10) unsigned NOT NULL DEFAULT '0', + `AttributesEx2` int(10) unsigned NOT NULL DEFAULT '0', + `AttributesEx3` int(10) unsigned NOT NULL DEFAULT '0', + `AttributesEx4` int(10) unsigned NOT NULL DEFAULT '0', + `AttributesEx5` int(10) unsigned NOT NULL DEFAULT '0', + `Stances` int(10) unsigned NOT NULL DEFAULT '0', + `StancesNot` int(10) unsigned NOT NULL DEFAULT '0', + `Targets` int(10) unsigned NOT NULL DEFAULT '0', + `CastingTimeIndex` tinyint(3) unsigned NOT NULL DEFAULT '1', + `AuraInterruptFlags` int(10) unsigned NOT NULL DEFAULT '0', + `ProcFlags` int(10) unsigned NOT NULL DEFAULT '0', + `ProcChance` tinyint(3) unsigned NOT NULL DEFAULT '0', + `ProcCharges` tinyint(3) unsigned NOT NULL DEFAULT '0', + `MaxLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `BaseLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `SpellLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `DurationIndex` smallint(5) unsigned NOT NULL DEFAULT '0', + `RangeIndex` tinyint(3) unsigned NOT NULL DEFAULT '1', + `StackAmount` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EquippedItemClass` int(11) NOT NULL DEFAULT '-1', + `EquippedItemSubClassMask` int(11) NOT NULL DEFAULT '0', + `EquippedItemInventoryTypeMask` int(11) NOT NULL DEFAULT '0', + `Effect1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Effect2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `Effect3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectDieSides1` int(11) NOT NULL DEFAULT '0', + `EffectDieSides2` int(11) NOT NULL DEFAULT '0', + `EffectDieSides3` int(11) NOT NULL DEFAULT '0', + `EffectRealPointsPerLevel1` float NOT NULL DEFAULT '0', + `EffectRealPointsPerLevel2` float NOT NULL DEFAULT '0', + `EffectRealPointsPerLevel3` float NOT NULL DEFAULT '0', + `EffectBasePoints1` int(11) NOT NULL DEFAULT '0', + `EffectBasePoints2` int(11) NOT NULL DEFAULT '0', + `EffectBasePoints3` int(11) NOT NULL DEFAULT '0', + `EffectMechanic1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectMechanic2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectMechanic3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectImplicitTargetA1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectImplicitTargetA2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectImplicitTargetA3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectImplicitTargetB1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectImplicitTargetB2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectImplicitTargetB3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectRadiusIndex1` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectRadiusIndex2` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectRadiusIndex3` tinyint(3) unsigned NOT NULL DEFAULT '0', + `EffectApplyAuraName1` smallint(5) unsigned NOT NULL DEFAULT '0', + `EffectApplyAuraName2` smallint(5) unsigned NOT NULL DEFAULT '0', + `EffectApplyAuraName3` smallint(5) unsigned NOT NULL DEFAULT '0', + `EffectAmplitude1` int(11) NOT NULL DEFAULT '0', + `EffectAmplitude2` int(11) NOT NULL DEFAULT '0', + `EffectAmplitude3` int(11) NOT NULL DEFAULT '0', + `EffectMultipleValue1` float NOT NULL DEFAULT '0', + `EffectMultipleValue2` float NOT NULL DEFAULT '0', + `EffectMultipleValue3` float NOT NULL DEFAULT '0', + `EffectMiscValue1` int(11) NOT NULL DEFAULT '0', + `EffectMiscValue2` int(11) NOT NULL DEFAULT '0', + `EffectMiscValue3` int(11) NOT NULL DEFAULT '0', + `EffectMiscValueB1` int(11) NOT NULL DEFAULT '0', + `EffectMiscValueB2` int(11) NOT NULL DEFAULT '0', + `EffectMiscValueB3` int(11) NOT NULL DEFAULT '0', + `EffectTriggerSpell1` int(10) unsigned NOT NULL DEFAULT '0', + `EffectTriggerSpell2` int(10) unsigned NOT NULL DEFAULT '0', + `EffectTriggerSpell3` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskA1` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskA2` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskA3` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskB1` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskB2` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskB3` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskC1` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskC2` int(10) unsigned NOT NULL DEFAULT '0', + `EffectSpellClassMaskC3` int(10) unsigned NOT NULL DEFAULT '0', + `MaxTargetLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', + `SpellFamilyName` tinyint(3) unsigned NOT NULL DEFAULT '0', + `SpellFamilyFlags1` int(10) unsigned NOT NULL DEFAULT '0', + `SpellFamilyFlags2` int(10) unsigned NOT NULL DEFAULT '0', + `SpellFamilyFlags3` int(10) unsigned NOT NULL DEFAULT '0', + `MaxAffectedTargets` tinyint(3) unsigned NOT NULL DEFAULT '0', + `DmgClass` tinyint(3) unsigned NOT NULL DEFAULT '0', + `PreventionType` tinyint(3) unsigned NOT NULL DEFAULT '0', + `DmgMultiplier1` float NOT NULL DEFAULT '0', + `DmgMultiplier2` float NOT NULL DEFAULT '0', + `DmgMultiplier3` float NOT NULL DEFAULT '0', + `AreaGroupId` int(11) NOT NULL DEFAULT '0', + `SchoolMask` int(10) unsigned NOT NULL DEFAULT '0', + `Comment` text NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Custom spell.dbc entries'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_dbc` +-- + +LOCK TABLES `spell_dbc` WRITE; +/*!40000 ALTER TABLE `spell_dbc` DISABLE KEYS */; +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(62388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 21, 1, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Demonic Circle: Teleport(48020) - casterAuraSpell'), +(65142, 3, 22, 0, 0, 0, 128, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 21, 13, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 'Crypt Fever - SPELL_AURA_LINKED'), +(34145, 0, 0, 0, 0, 0, 67108864, 0, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 80, 80, 0, 1, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Ritual of Souls Rank 1 - Trigger Create Soulwell (29886)'), +(58888, 0, 0, 0, 0, 0, 67108864, 0, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 68, 68, 0, 1, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58889, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Ritual of Souls Rank 2 - Trigger Create Soulwell (58889)'), +(61988, 0, 0, 671089024, 268436480, 4, 269484032, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 25, 13, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Divine Shield Exclude Aura - 61988'), +(200000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8, 1, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Drain Soul increased damage - serverside spell'), +(42876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 9275 reward serverside spell'), +(44987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11521 reward serverside spell'), +(48803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 12214 reward serverside spell'), +(68496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Item_template serverside spell'), +(72958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Item_template serverside spell'), +(32780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 10040 reward serverside spell'), +(45453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11587 reward serverside spell'), +(25347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Item_template serverside spell'), +(45315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11566 reward serverside spell'), +(43236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11288 reward serverside spell'), +(43459, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11332 reward serverside spell'), +(43499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11250 reward serverside spell'), +(44275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11432 reward serverside spell'), +(64689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 13854 and 13862 reward serverside spell'), +(50574, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 12597 reward serverside spell'), +(71356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2108 spellid0 serverside spell'), +(71803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2108 spellid1 serverside spell'), +(72111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2136 spellid0 serverside spell'), +(72125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2136 spellid1 serverside spell'), +(70816, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2146 spellid0 serverside spell'), +(72233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2146 spellid1 serverside spell'), +(72234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2146 spellid2 serverside spell'), +(72235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spelldifficulty_dbc id:2146 spellid3 serverside spell'), +(58428, 0, 0, 671089024, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 100, 0, 0, 0, 0, 18, 1, 0, -1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 226, 0, 0, 20000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Overkill - aura remove spell'), +(56817, 0, 0, 384, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 16, 101, 1, 0, 67, 67, 1, 1, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rune strike proc'), +(24899, 0, 0, 400, 1024, 0, 0, 2097152, 0, 144, 0, 0, 1, 0, 0, 101, 0, 0, 0, 0, 21, 1, 0, -1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 137, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 'Heart of the Wild Bear Effect'), +(24900, 0, 0, 400, 1024, 0, 0, 2097152, 0, 1, 0, 0, 1, 0, 0, 101, 0, 0, 0, 0, 21, 1, 0, -1, 0, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 'Heart of the Wild Cat Effect'), +(43503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11261 reward serverside spell'), +(39613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 10967 reward serverside spell'), +(34448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Serverside spell orb of translocation (gobjid=180911)'), +(34452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Serverside spell orb of translocation (gobjid=180912)'), +(39616, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 10966 reward serverside spell'), +(11202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Item 3776 spellid_1 serverside spell'), +(25359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Item 21293 spellid_2 serverside spell'), +(40145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11000 RewSpellCast serverside spell'), +(45767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11670 RewSpellCast serverside spell'), +(71098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 24451 RewSpellCast serverside spell'), +(70878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Creature 40160 creature_addon serverside spell'); +/*!40000 ALTER TABLE `spell_dbc` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_disabled` +-- + +DROP TABLE IF EXISTS `spell_disabled`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_disabled` ( + `entry` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell entry', + `disable_mask` int(8) unsigned NOT NULL DEFAULT '0', + `comment` varchar(64) NOT NULL DEFAULT '', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Disabled Spell System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_disabled` +-- + +LOCK TABLES `spell_disabled` WRITE; +/*!40000 ALTER TABLE `spell_disabled` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_disabled` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_group` +-- + +DROP TABLE IF EXISTS `spell_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_group` ( + `id` int(11) unsigned NOT NULL DEFAULT 0, + `spell_id` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`, `spell_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_group` +-- + +LOCK TABLES `spell_group` WRITE; +/*!40000 ALTER TABLE `spell_group` DISABLE KEYS */; +INSERT INTO `spell_group` (`id`, `spell_id`) VALUES + -- SPELL_GROUP_ELIXIR_BATTLE +(1, 2367), +(1, 2374), +(1, 3160), +(1, 3164), +(1, 7844), +(1, 8212), +(1, 10667), +(1, 10669), +(1, 11328), +(1, 11334), +(1, 11390), +(1, 11405), +(1, 11406), +(1, 11474), +(1, 16322), +(1, 16323), +(1, 16329), +(1, 17038), +(1, 17537), +(1, 17538), +(1, 17539), +(1, 17624), +(1, 17626), +(1, 17627), +(1, 17628), +(1, 17629), +(1, 21920), +(1, 26276), +(1, 28486), +(1, 28488), +(1, 28490), +(1, 28491), +(1, 28493), +(1, 28497), +(1, 28501), +(1, 28503), +(1, 28518), +(1, 28519), +(1, 28520), +(1, 28521), +(1, 28540), +(1, 33720), +(1, 33721), +(1, 33726), +(1, 38954), +(1, 40567), +(1, 40568), +(1, 40572), +(1, 40573), +(1, 40575), +(1, 40576), +(1, 41608), +(1, 41609), +(1, 41610), +(1, 41611), +(1, 42735), +(1, 45373), +(1, 46837), +(1, 46839), +(1, 53746), +(1, 53748), +(1, 53749), +(1, 53752), +(1, 53755), +(1, 53758), +(1, 53760), +(1, 54212), +(1, 54452), +(1, 54494), +(1, 60340), +(1, 60341), +(1, 60344), +(1, 60345), +(1, 60346), +(1, 62380), +(1, 67016), +(1, 67017), +(1, 67018), + -- SPELL_GROUP_ELIXIR_GUARDIAN +(2, 673), +(2, 2378), +(2, 2380), +(2, 3166), +(2, 3219), +(2, 3220), +(2, 3222), +(2, 3223), +(2, 3593), +(2, 10668), +(2, 10692), +(2, 10693), +(2, 11319), +(2, 11348), +(2, 11349), +(2, 11364), +(2, 11371), +(2, 11396), +(2, 15231), +(2, 15233), +(2, 16321), +(2, 16325), +(2, 16326), +(2, 16327), +(2, 17535), +(2, 17624), +(2, 17626), +(2, 17627), +(2, 17628), +(2, 17629), +(2, 24361), +(2, 24363), +(2, 24382), +(2, 24383), +(2, 24417), +(2, 27652), +(2, 27653), +(2, 28502), +(2, 28509), +(2, 28514), +(2, 28518), +(2, 28519), +(2, 28520), +(2, 28521), +(2, 28540), +(2, 29348), +(2, 39625), +(2, 39626), +(2, 39627), +(2, 39628), +(2, 40567), +(2, 40568), +(2, 40572), +(2, 40573), +(2, 40575), +(2, 40576), +(2, 41608), +(2, 41609), +(2, 41610), +(2, 41611), +(2, 42735), +(2, 46837), +(2, 46839), +(2, 53747), +(2, 53751), +(2, 53752), +(2, 53755), +(2, 53758), +(2, 53760), +(2, 53763), +(2, 53764), +(2, 54212), +(2, 60343), +(2, 60347), +(2, 62380), +(2, 67016), +(2, 67017), +(2, 67018), + -- SPELL_GROUP_ELIXIR_UNSTABLE +(3, 40567), +(3, 40568), +(3, 40572), +(3, 40573), +(3, 40575), +(3, 40576), + -- SPELL_GROUP_ELIXIR_SHATTRATH +(4, 41608), +(4, 41609), +(4, 41610), +(4, 41611), +(4, 46837), +(4, 46839), + -- Well Fed +(1001, 19705), +(1001, 19706), +(1001, 19708), +(1001, 19709), +(1001, 19710), +(1001, 19711), +(1001, 24799), +(1001, 24870), +(1001, 25694), +(1001, 25941), +(1001, 33254), +(1001, 33256), +(1001, 33257), +(1001, 33259), +(1001, 33261), +(1001, 33263), +(1001, 33265), +(1001, 33268), +(1001, 33272), +(1001, 35272), +(1001, 40323), +(1001, 42293), +(1001, 43764), +(1001, 43771), +(1001, 44097), +(1001, 44098), +(1001, 44099), +(1001, 44100), +(1001, 44101), +(1001, 44102), +(1001, 44104), +(1001, 44105), +(1001, 44106), +(1001, 45245), +(1001, 45619), +(1001, 46682), +(1001, 46687), +(1001, 46899), +(1001, 53284), +(1001, 57079), +(1001, 57097), +(1001, 57100), +(1001, 57102), +(1001, 57107), +(1001, 57111), +(1001, 57139), +(1001, 57286), +(1001, 57288), +(1001, 57291), +(1001, 57294), +(1001, 57325), +(1001, 57327), +(1001, 57329), +(1001, 57332), +(1001, 57334), +(1001, 57356), +(1001, 57358), +(1001, 57360), +(1001, 57363), +(1001, 57365), +(1001, 57367), +(1001, 57371), +(1001, 57373), +(1001, 57399), +(1001, 58468), +(1001, 58479), +(1001, 59230), +(1001, 59690), +(1001, 59699), +(1001, 62349), +(1001, 64057), +(1001, 65247), +(1001, 65365), +(1001, 65410), +(1001, 65412), +(1001, 65414), +(1001, 65415), +(1001, 65416), +(1001, 66623), +(1001, 66624), +(1001, 69559), +(1001, 18125), +(1001, 18141), +(1001, 23697), + -- Blessing of Might +(1002, 19740), +(1002, 25782), +(1002, 56520), +-- Battle Shout +(1003, 6673), +-- Blessing of Might, Battle Shout +(1004, -1002), +(1004, -1003), +-- Blessing of Wisdom +(1005, 19742), +(1005, 25894), +(1005, 56521), +-- Blessing of Kings +(1006, 20217), +(1006, 25898), +(1006, 43223), +(1006, 56525), +(1006, 58054), +-- Blessing of Sanctuary +(1007, 20911), +(1007, 25899), +-- Blessing of Protection +(1008, 41450), +(1008, 23415), +-- Blessing of Light +(1009, 32770), +-- Blessings +(1010, -1002), +(1010, -1005), +(1010, -1006), +(1010, -1007), +(1010, -1008), +(1010, -1009), +-- Commanding shout, Battle Shout +(1011,-1083), +(1011, -1003), +-- Armor Debuff (Major) +(1012,55749), -- Acid Spit +(1013,8647), -- Exposed Armor +(1014,7386), -- sunder Armor +-- Armor Debuff (Minor) +(1016,770), -- Faerie Fire +(1016,16857), -- Faerie Fire +(1017,56626), -- Sting +(1018,16231), -- Curse of Recklessness +-- Melee Haste Buff +(1020,55610), -- Improved Icy Talons +(1021,8515), -- windfury totem +-- Melee Critical Strike Chance Buff +(1023,17007), -- Leader of the Pack +(1024,29801), -- Rampage +-- Attack Power Buff (Multiplier) +(1026,53137), -- Abomination's Might +(1027,19506), -- Trueshot Aura +(1028,30802), -- Unleashed Rage +-- Bleed Damage Increase Debuff +(1030,33878), -- Mangle (Bear) +(1031,33876), -- Mangle (Cat) +(1032,46854), -- Trauma +-- Spell Critical Strike Chance Buff +(1034,24907), -- moonkng aura +(1035,51466), -- elemental oath +-- Spell Critical Strike Chance Debuff +(1037,11095), -- improved scorch +(1038,11180), -- Winter's Chill +-- Increased Spell Damage Taken Debuff +(1040,51099), -- Ebon Plaguebringer +(1041,48506), -- Earth and Moon +(1042,1490), -- Curse of the Elements +-- Increased Spell Power Buff +(1044,54646), -- Focus Magic +(1045,52109), -- Flametongue Totem +(1046,63283), -- Totem of Wrath +(1046,57658), -- Totem of Wrath +(1046,57660), -- Totem of Wrath +(1046,57662), -- Totem of Wrath +(1046,57663), -- Totem of Wrath +(1046,30708), -- Totem of Wrath +(1047,53646), -- Demonic Pact +-- Increased Spell Hit Chance Taken Debuff +(1049,33600), -- Improved Faerie Fire +(1050,33191), -- Misery +-- Percentage Haste Increase (All Types) +(1052,48384), -- Improved Moonkin Form +(1053,53379), -- Swift Retribution +-- Percentage Damage Increase +(1055,34455), -- Ferocious Inspiration +(1056,31869), -- Sanctified Retribution +-- Critical Strike Chance Taken Debuff (All types) +(1058,20335), -- Heart of the Crusader +-- totem of wrath 1046 CHECK IT! +-- Melee Attack Speed Slow Debuff +(1060,45477), -- Icy Touch +(1061,48483), -- Infected Wounds +(1062,53695), -- Judgements of the Just +(1063,6343), -- Thunder Clap +-- Melee Hit Chance Reduction Debuff +(1066,5570), -- Insect Swarm +(1067,3043), -- Scorpid Sting +-- Healing Debuff +(1070,13218), -- Wound Posion +(1071,19434), -- Aimed Shot +(1072,12294), -- Mortal Strike +(1073,46910), -- Furious Attacks +-- Attack Power Debuff +(1076,99), -- Demoralizing Roar +(1077,702), -- Curse of Weakness +(1078,1160), -- Demoralizing Shout +-- Agility and Strength Buff +(1080,8076), -- Strength of Earth +(1081,57330), -- Horn of Winter +-- Health Buff +(1083,469), -- Commanding Shout +(1084,6307), -- Blood Pact +-- Intellect Buff +(1086,1459), -- Arcane Intellect +(1104,23028), -- Arcane Brilliance +(1087,54424), -- Fel Intelligence +-- Spirit Buff +-- fel intelegencegoes here +(1105,14752), -- Divine Spirit +(1106,27681), -- Prayer of Spirit +-- Damage Reduction Percentage Buff +(1091,47930), -- Grace +(1092,20911), -- Blessing of Sanctuary +-- Percentage Increase Healing Received Buff +(1094,34123), -- tree of life aura +(1095,20138), -- Improved Devotion Aura +-- Armor Increase Percentage Buff +(1097,14892), -- Inspiration +(1098,16176), -- Ancestral Healing +-- Cast Speed Slow +(1100,1714), -- Curse of Tongues +(1101,31589), -- Slow +(1102,5760), -- Mind-numbing Poison +-- Armor Debuff (Major) +(1015,-1012), +(1015,-1013), +(1015,-1014), +-- Armor Debuff (Minor) +(1019,-1016), +(1019,-1017), +(1019,-1018), +-- Melee Haste Buff +(1022,-1020), +(1022,-1021), +-- Melee Critical Strike Chance Buff +(1025,-1023), +(1025,-1024), +-- Attack Power Buff (Multiplier) +(1029,-1026), +(1029,-1027), +(1029,-1028), +-- Bleed Damage Increase Debuff +(1033,-1030), +(1033,-1031), +(1033,-1032), +-- Spell Critical Strike Chance Buff +(1036,-1034), +(1036,-1035), +-- Spell Critical Strike Chance Debuff +(1039,-1037), +(1039,-1038), +-- Increased Spell Damage Taken Debuff +(1043,-1040), +(1043,-1041), +(1043,-1042), +-- Increased Spell Power Buff +(1048,-1044), +(1048,-1045), +(1048,-1046), +(1048,-1047), +-- Increased Spell Hit Chance Taken Debuff +(1051,-1049), +(1051,-1050), +-- Percentage Haste Increase (All Types) +(1054,-1052), +(1054,-1053), +-- Percentage Damage Increase +(1057,-1055), +(1057,-1056), +-- Critical Strike Chance Taken Debuff (All types) +(1059,-1058), +(1059,-1046), +-- Melee Attack Speed Slow Debuff +(1064,-1060), +(1064,-1061), +(1064,-1062), +(1064,-1063), +-- Melee Hit Chance Reduction Debuff +(1068,-1066), +(1068,-1067), +-- Healing Debuff +(1074,-1070), +(1074,-1071), +(1074,-1072), +(1074,-1073), +-- Attack Power Debuff +(1079,-1076), +(1079,-1077), +(1079,-1078), +-- Agility and Strength Buff +(1082,-1080), +(1082,-1081), +-- Health Buff +(1085,-1083), +(1085,-1084), +-- Intellect Buff +(1088,-1086), +(1088,-1104), +(1088,-1087), +-- Spirit Buff +(1090,-1087), +(1090,-1105), +(1090,-1106), +-- Damage Reduction Percentage Buff +(1093,-1091), +(1093,-1092), +-- Percentage Increase Healing Received Buff +(1096,-1094), +(1096,-1095), +-- Armor Increase Percentage Buff +(1099,-1097), +(1099,-1098), +-- Cast Speed Slow +(1103,-1100), +(1103,-1101), +(1103,-1102), +-- mage freezing spells +(1107, 122), -- Frost Nova +(1107, 33395), -- Freeze +(1107, 55080); -- Shattered Barrier + +/*!40000 ALTER TABLE `spell_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_enchant_proc_data` +-- + +DROP TABLE IF EXISTS `spell_enchant_proc_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_enchant_proc_data` ( + `entry` int(10) unsigned NOT NULL, + `customChance` int(10) unsigned NOT NULL DEFAULT '0', + `PPMChance` float unsigned NOT NULL DEFAULT '0', + `procEx` float unsigned NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Spell enchant proc data'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_enchant_proc_data` +-- + +LOCK TABLES `spell_enchant_proc_data` WRITE; +/*!40000 ALTER TABLE `spell_enchant_proc_data` DISABLE KEYS */; +INSERT INTO spell_enchant_proc_data (`entry`,`customChance`,`PPMChance`,`procEx`) VALUES + -- Frostbrand Weapon +(2, 0, 8.8,0), +(12, 0, 8.8,0), +(524, 0, 8.8,0), +(1667, 0, 8.8,0), +(1668, 0, 8.8,0), +(2635, 0, 8.8,0), +(3782, 0, 8.8,0), +(3783, 0, 8.8,0), +(3784, 0, 8.8,0), + -- Wound Poison +(703, 0, 21.43,0), +(704, 0, 21.43,0), +(705, 0, 21.43,0), +(706, 0, 21.43,0), +(2644, 0, 21.43,0), +(3772, 0, 21.43,0), +(3773, 0, 21.43,0), + -- Instant Poison +(323, 0, 8.53,0), +(324, 0, 8.53,0), +(325, 0, 8.53,0), +(623, 0, 8.53,0), +(624, 0, 8.53,0), +(625, 0, 8.53,0), +(2641, 0, 8.53,0), +(3768, 0, 8.53,0), +(3769, 0, 8.53,0), + -- Fiery Weapon +(803, 0, 6.0,0), + -- Demonslaying +(912, 0, 6.0,0), + -- Icy Weapon +(1894, 0, 3.0,0), + -- Lifestealing +(1898, 0, 6.0,0), + -- Unholy Weapon +(1899, 0, 1.0,0), + -- Crusader +(1900, 0, 1.0,0), + -- Mongoose +(2673, 0, 1.0,0), + -- Battlemaster +(2675, 0, 1.0,0), + -- Executioner +(3225, 0, 1.0,0), + -- Icebreaker Weapon +(3239, 0, 3.0,0), + -- Lifeward +(3241, 0, 3.0,0), + -- Giantslaying +(3251, 0, 3.0,0), + -- Deathfrost +(3273, 0, 3.0,0), + -- Rune of the Fallen Crusader +(3368, 0, 1.0,0), + -- Rune of Cinderglacier +(3369, 0, 1.0,0), + -- Berserking +(3789, 0, 1.0,0), + -- Blade Ward +(3869, 0, 1.0,0); +/*!40000 ALTER TABLE `spell_enchant_proc_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_learn_spell` +-- + +DROP TABLE IF EXISTS `spell_learn_spell`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_learn_spell` ( + `entry` smallint(5) unsigned NOT NULL DEFAULT '0', + `SpellID` smallint(5) unsigned NOT NULL DEFAULT '0', + `Active` tinyint(3) unsigned NOT NULL DEFAULT '1', + PRIMARY KEY (`entry`,`SpellID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_learn_spell` +-- + +LOCK TABLES `spell_learn_spell` WRITE; +/*!40000 ALTER TABLE `spell_learn_spell` DISABLE KEYS */; +INSERT INTO `spell_learn_spell` VALUES (53428,53341,1),(53428,53343,1),(17002,24867,0),(24866,24864,0),(33872,47179,0),(33873,47180,0),(33943,34090,1),(58984,21009,1); +/*!40000 ALTER TABLE `spell_learn_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_linked_spell` +-- + +-- -------- +-- LINKED +-- -------- +-- spell1 / spell2 / type +-- + + 0 caster casts 2 when casts 1 +-- + - 0 caster removes aura 2 when casts 1 +-- + + 1 target casts 2 on self (originalCaster = caster) when 1 casted by caster hits target +-- + - 1 target removes aura 2 when hit by 1 +-- + + 2 when aura 1 is applied, aura 2 is also applied; when 1 is removed, 2 is also removed +-- + - 2 when aura 1 is applied, target is immune to spell 2, until 1 is removed +-- - + 0 target casts 2 on self (originalCaster = caster) when aura 1 casted by caster is removed +-- - - 0 aura 2 is removed when aura 1 is removed + +DROP TABLE IF EXISTS `spell_linked_spell`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_linked_spell` ( + `spell_trigger` mediumint(8) NOT NULL, + `spell_effect` mediumint(8) NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `comment` text NOT NULL, + UNIQUE KEY `trigger_effect_type` (`spell_trigger`,`spell_effect`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Spell System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_linked_spell` +-- + +LOCK TABLES `spell_linked_spell` WRITE; +/*!40000 ALTER TABLE `spell_linked_spell` DISABLE KEYS */; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +-- class +( 16857, 60089, 0, 'Faerie Fire (Feral)'), +( 31224, -1543, 2, 'Cloak of Shadows - Flare'), +( 15237, 23455, 0, 'Holy Nova (rank1)'), +( 15430, 23458, 0, 'Holy Nova (rank2)'), +( 15431, 23459, 0, 'Holy Nova (rank3)'), +( 27799, 27803, 0, 'Holy Nova (rank4)'), +( 27800, 27804, 0, 'Holy Nova (rank5)'), +( 27801, 27805, 0, 'Holy Nova (rank6)'), +( 25331, 25329, 0, 'Holy Nova (rank7)'), +( 48077, 48075, 0, 'Holy Nova (rank8)'), +( 48078, 48076, 0, 'Holy Nova (rank9)'), +(-19386, 24131, 0, 'Wyvern Sting'), +(-24132, 24134, 0, 'Wyvern Sting'), +(-24133, 24135, 0, 'Wyvern Sting'), +(-27068, 27069, 0, 'Wyvern Sting'), +(-49011, 49009, 0, 'Wyvern Sting'), +(-49012, 49010, 0, 'Wyvern Sting'), +( 47585, 60069, 2, 'Dispersion (transform/regen)'), +( 47585, 63230, 2, 'Dispersion (immunity)'), +( 61847, 61848, 2, 'Aspect of the dragonhawk'), +( 61846, 61848, 2, 'Aspect of the dragonhawk'), +( 47988, 54501, 2, 'Consume Shadows - Rank 9'), +( 47987, 54501, 2, 'Consume Shadows - Rank 8'), +( 27272, 54501, 2, 'Consume Shadows - Rank 7'), +( 17854, 54501, 2, 'Consume Shadows - Rank 6'), +( 17853, 54501, 2, 'Consume Shadows - Rank 5'), +( 17852, 54501, 2, 'Consume Shadows - Rank 4'), +( 17851, 54501, 2, 'Consume Shadows - Rank 3'), +( 17850, 54501, 2, 'Consume Shadows - Rank 2'), +( 17767, 54501, 2, 'Consume Shadows - Rank 1'), +(-5143, -36032, 0, 'Arcane Missiles Rank 1'), +(-5144, -36032, 0, 'Arcane Missiles Rank 2'), +(-5145, -36032, 0, 'Arcane Missiles Rank 3'), +(-8416, -36032, 0, 'Arcane Missiles Rank 4'), +(-8417, -36032, 0, 'Arcane Missiles Rank 5'), +(-10211,-36032, 0, 'Arcane Missiles Rank 6'), +(-10212,-36032, 0, 'Arcane Missiles Rank 7'), +(-25345,-36032, 0, 'Arcane Missiles Rank 8'), +(-27075,-36032, 0, 'Arcane Missiles Rank 9'), +(-38699,-36032, 0, 'Arcane Missiles Rank 10'), +(-38704,-36032, 0, 'Arcane Missiles Rank 11'), +(-42843,-36032, 0, 'Arcane Missiles Rank 12'), +(-42846,-36032, 0, 'Arcane Missiles Rank 13'), +( 53563, 53651, 2, 'Beacon of Light'), +( 781, 56446, 0, 'Disengage'), +( 57635, 57636, 0, 'Disengage'), +( 60932, 60934, 0, 'Disengage'), +( 61507, 61508, 0, 'Disengage'), +( 49576, 49560, 0, 'Death Grip'), +( 47897, 47960, 1, 'Shadowflame Rank 1'), +( 61290, 61291, 1, 'Shadowflame Rank 2'), +( 51723, 52874, 0, 'Fan Of Knives'), +( 32386, 60448, 2, 'Shadow Embrace Rank1'), +( 32388, 60465, 2, 'Shadow Embrace Rank2'), +( 32389, 60466, 2, 'Shadow Embrace Rank3'), +( 32390, 60467, 2, 'Shadow Embrace Rank4'), +( 32391, 60468, 2, 'Shadow Embrace Rank5'), +( 33206, 44416, 2, 'Pain Suppression (threat)'), +( 52610, 62071, 0, 'Savage Roar'), +(-52610,-62071, 0, 'Savage Roar'), +( 51209, 55095, 1, 'Hungering cold - frost fever'), +( 50334, 58923, 2, 'Berserk - modify target number aura'), +(-5229, -51185, 0, 'King of the Jungle - remove with enrage'), +( 48384, 50170, 2, 'Improved Moonkin Form'), +( 48395, 50171, 2, 'Improved Moonkin Form'), +( 48396, 50172, 2, 'Improved Moonkin Form'), +( 20594, 65116, 0, 'Stoneform'), +( 49039, 50397, 2, 'Lichborne - shapeshift'), +( 64382, 64380, 0, 'Shattering Throw'), +(-59907, 7, 0, 'Lightwell Charges - Suicide'), +( 19263, 67801, 2, 'Deterrence'), +( 45524, 55095, 0, 'Chains of Ice - Frost Fever'), +( 20066,-61840, 0, 'Repentance'), +( 66235, 66233, 0, 'Ardent Defender Visuals'), +-- Quest +( 40214, 40216, 2, 'Dragonmaw Illusion'), +( 40214, 42016, 2, 'Dragonmaw Illusion'), +( 66744, 66747, 0, 'Totem of the earthen ring'), +( 53099, 53098, 0, 'Trigger teleport to acherus (for quest 12757)'), +-- Creature +( 36574, 36650, 0, 'Apply Phase Slip Vulnerability'), +-- instance +(-30410, 44032, 0, 'Manticron Cube Mind Exhaustion'), +(-33711, 33686, 0, 'Murmur''s Shockwave (Normal)'), +(-38794, 33686, 0, 'Murmur''s Shockwave (Heroic)'), +( 33686, 31705, 0, 'Murmur''s Shockwave Jump'), +-- Zul'aman +( 44008, 45265, 1, 'Static Disruption Visual'), +( 43648, 44007, 1, 'Storm Eye Safe Zone'), +( 44007,-43657, 2, 'Storm Eye Safe Zone Immune'), +( 43658, 43653, 0, 'Electrical Arc Visual'), +( 43658, 43654, 0, 'Electrical Arc Visual'), +( 43658, 43655, 0, 'Electrical Arc Visual'), +( 43658, 43656, 0, 'Electrical Arc Visual'), +( 43658, 43659, 0, 'Electrical Arc Visual'), +-- black temple +-- (39992, 39835, 1, 'Needle Spine'), +( 39835, 39968, 1, 'Needle Spine'), +(-41376, 41377, 0, 'Spite'), +( 41126, 41131, 1, 'Flame Crash'), +(-41914, 41915, 0, 'Summon Parasitic Shadowfiend'), +(-41917, 41915, 0, 'Summon Parasitic Shadowfiend'), +( 39908, 40017, 1, 'Eye Blast'), +( 40604, 40616, 1, 'Fel Rage Aura'), +( 40616, 41625, 1, 'Fel Rage Aura'), +( 41292, 42017, 2, 'Aura of Suffering'), +-- sunwell +( 44869, 44866, 1, 'Spectral Blast Portal'), +-- (44869, 46648, 1, 'Spectral Blast Visual'), cause severe lag seems should be casted by go +( 44869, 46019, 1, 'Spectral Blast Teleport'), +( 46019, 46021, 1, 'Spectral Realm Aura'), +-- (46021, 44852, 1, 'Spectral Realm Aura'), 44852 makes boss friendly to you +(-46021, 46020, 0, 'Teleport: Normal Realm'), +( 46020, 44867, 1, 'Spectral Exhaustion'), +( 44867,-46019, 2, 'Spectral Exhaustion - Teleport: Spectral Realm'), +( 45661, 45665, 1, 'Encapsulate'), +( 45347,-45348, 1, 'Remove Flame Touched'), +( 45348,-45347, 1, 'Remove Dark Touched'), +( 45248, 45347, 1, 'Apply Dark Touched'), +( 45329, 45347, 1, 'Apply Dark Touched'), +( 45256, 45347, 1, 'Apply Dark Touched'), +( 45270, 45347, 1, 'Apply Dark Touched'), +( 45342, 45348, 1, 'Apply Flame Touched'), +( 46771, 45348, 1, 'Apply Flame Touched'), +( 45271, 45347, 1, 'Apply Dark Touched'), +( 45246, 45348, 1, 'Apply Flame Touched'), +( 44869,-45018, 1, 'Remove Arcane Buffet'), +( 46019,-45018, 1, 'Remove Arcane Buffet'), +( 46242, 46247, 0, 'Black Hole Visual (Birth)'), +( 46228, 46235, 0, 'Black Hole Visual (Grown)'), +( 46228,-46247, 0, 'Black Hole Visual (Grown)'), +( 46262, 46265, 0, 'Void Zone Visual'), +-- naxx +(-28169, 28206, 0, 'Mutating Injection - Mutagen Explosion'), +( 28732,-28798, 1, 'Widow''s Embrace - Frenzy'), +( 54097,-54100, 1, 'Widow''s Embrace - Frenzy (H)'), +(-28169, 28240, 0, 'Mutating Injection - Poison Cloud'), +-- Archavon +( 58666, 58672, 1, 'Impale (Archavon)'), +( 60882, 58672, 1, 'Impale (Archavon)'), +-- Violet Hold +(-54361, 54343, 0, 'Void Shift (Normal) - Void Shifted'), +(-59743, 54343, 0, 'Void Shift (Heroic) - Void Shifted'), +-- Gundrak +( 54850, 54851, 1, 'Emerge - Emerge Summon'), +-- Trial of the Champion +( 66680, 66547, 0, 'Confess - Confess'), +( 66889,-66865, 0, 'Remove Vengeance'), +-- Warsong Gulch +( 54861,-23335, 0, 'Drop Flag on Nitro Boost WSG'), +( 54861,-23333, 0, 'Drop Flag on Nitro Boost WSG'), +( 55004,-23335, 0, 'Drop Flag on Nitro Boost WSG'), +( 55004,-23333, 0, 'Drop Flag on Nitro Boost WSG'), +-- Eye of Storm +( 54861,-34976, 0, 'Drop Flag on Nitro Boost EOS'), +( 55004,-34976, 0, 'Drop Flag on Nitro Boost EOS'), +-- Strand of the Ancients +( 52415, 52418, 0, 'Carrying Seaforium - Add'), +( 52410,-52418, 0, 'Carrying Seaforium - Remove'), +-- Item +( 69381, 72588, 1, 'Drums of the Wild'), +( 69378, 72586, 1, 'Drums of the Forgotten Kings'), +( 69377, 72590, 1, 'Runescroll of Fortitude'), +( 50141, 50001, 0, 'Blood Oath to Blood Oath Aura'); +/*!40000 ALTER TABLE `spell_linked_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_loot_template` +-- + +DROP TABLE IF EXISTS `spell_loot_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `item` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ChanceOrQuestChance` float NOT NULL DEFAULT '100', + `lootmode` smallint(5) unsigned NOT NULL DEFAULT '1', + `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `mincountOrRef` mediumint(9) NOT NULL DEFAULT '1', + `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1', + `lootcondition` tinyint(3) unsigned NOT NULL DEFAULT '0', + `condition_value1` mediumint(8) unsigned NOT NULL DEFAULT '0', + `condition_value2` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_loot_template` +-- + +LOCK TABLES `spell_loot_template` WRITE; +/*!40000 ALTER TABLE `spell_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_pet_auras` +-- + +DROP TABLE IF EXISTS `spell_pet_auras`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_pet_auras` ( + `spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id', + `effectId` tinyint(3) unsigned NOT NULL DEFAULT '0', + `pet` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'pet id; 0 = all', + `aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id', + PRIMARY KEY (`spell`,`effectId`,`pet`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_pet_auras` +-- + +LOCK TABLES `spell_pet_auras` WRITE; +/*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */; +INSERT INTO `spell_pet_auras` VALUES (19028,0,0,25228),(19578,0,0,19579),(20895,0,0,24529),(28757,0,0,28758),(35029,0,0,35060),(35030,0,0,35061),(35691,0,0,35696),(35692,0,0,35696),(35693,0,0,35696),(56314,0,0,57447),(56314,1,0,57485),(56315,0,0,57452),(56315,1,0,57484),(56316,0,0,57453),(56316,1,0,57483),(56317,0,0,57457),(56317,1,0,57482),(56318,0,0,57458),(56318,1,0,57475),(23785,0,416,23759),(23822,0,416,23826),(23823,0,416,23827),(23824,0,416,23828),(23825,0,416,23829),(23785,0,417,23762),(23822,0,417,23837),(23823,0,417,23838),(23824,0,417,23839),(23825,0,417,23840),(23785,0,1860,23760),(23822,0,1860,23841),(23823,0,1860,23842),(23824,0,1860,23843),(23825,0,1860,23844),(23785,0,1863,23761),(23822,0,1863,23833),(23823,0,1863,23834),(23824,0,1863,23835),(23825,0,1863,23836),(23785,0,17252,35702),(23822,0,17252,35703),(23823,0,17252,35704),(23824,0,17252,35705),(23825,0,17252,35706); +/*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_proc_event` +-- + +DROP TABLE IF EXISTS `spell_proc_event`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_proc_event` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `SchoolMask` tinyint(4) NOT NULL DEFAULT '0', + `SpellFamilyName` smallint(5) unsigned NOT NULL DEFAULT '0', + `SpellFamilyMask0` int(10) unsigned NOT NULL DEFAULT '0', + `SpellFamilyMask1` int(10) unsigned NOT NULL DEFAULT '0', + `SpellFamilyMask2` int(10) unsigned NOT NULL DEFAULT '0', + `procFlags` int(10) unsigned NOT NULL DEFAULT '0', + `procEx` int(10) unsigned NOT NULL DEFAULT '0', + `ppmRate` float NOT NULL DEFAULT '0', + `CustomChance` float NOT NULL DEFAULT '0', + `Cooldown` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_proc_event` +-- + +LOCK TABLES `spell_proc_event` WRITE; +/*!40000 ALTER TABLE `spell_proc_event` DISABLE KEYS */; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +( 324, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 1) +( 325, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 2) +( 905, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 3) +( 945, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 4) +( 974, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000222A8, 0x00000000, 0, 0, 3), -- Earth Shield (Rank 1) +( 1463, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 1) +( 3232, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Gouge Stun Test +( 5952, 0x00, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Throwing Specialization (Rank 1) +( 6346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0, 0, 0), -- Fear Ward +( 7383, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0, 0, 0), -- Water Bubble +( 7434, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Fate Rune of Unsurpassed Vigor +( 8134, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 5) +( 8178, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Grounding Totem Effect (Rank 1) +( 8494, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 2) +( 8495, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 3) +( 9452, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Vindication (Rank 1) +( 9782, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Mithril Shield Spike +( 9784, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Iron Shield Spike +( 9799, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Eye for an Eye (Rank 1) +( 10191, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 4) +( 10192, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 5) +( 10193, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 6) +( 10431, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 6) +( 10432, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 7) +( 11095, 0x00, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Scorch (Rank 1) +( 11119, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 1) +( 11120, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 2) +( 11129, 0x04, 3, 0x08c00017, 0x00031048, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Combustion +( 11180, 0x10, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Winter's Chill (Rank 1) +( 11185, 0x00, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0, 0, 0), -- Improved Blizzard (Rank 1) +( 11255, 0x00, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Counterspell (Rank 1) +( 12169, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Shield Block +( 12281, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Sword Specialization (Rank 1) +( 12289, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Hamstring (Rank 1) +( 12298, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Shield Specialization (Rank 1) +( 12311, 0x00, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Gag Order (Rank 1) +( 12319, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 1) +( 12322, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Unbridled Wrath (Rank 1) +( 12487, 0x00, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0, 0, 0), -- Improved Blizzard (Rank 2) +( 12488, 0x00, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0, 0, 0), -- Improved Blizzard (Rank 3) +( 12598, 0x00, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Counterspell (Rank 2) +( 12668, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Hamstring (Rank 2) +( 12724, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Shield Specialization (Rank 2) +( 12725, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Shield Specialization (Rank 3) +( 12726, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Shield Specialization (Rank 4) +( 12727, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Shield Specialization (Rank 5) +( 12797, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Revenge (Rank 1) +( 12799, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Revenge (Rank 2) +( 12812, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Sword Specialization (Rank 2) +( 12813, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Sword Specialization (Rank 3) +( 12814, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Sword Specialization (Rank 4) +( 12815, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Sword Specialization (Rank 5) +( 12834, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Deep Wounds (Rank 1) +( 12846, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 3) +( 12847, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 4) +( 12848, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 5) +( 12849, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Deep Wounds (Rank 2) +( 12867, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Deep Wounds (Rank 3) +( 12872, 0x00, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Scorch (Rank 2) +( 12873, 0x00, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Scorch (Rank 3) +( 12958, 0x00, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Gag Order (Rank 2) +( 12966, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 1) +( 12967, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 2) +( 12968, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 3) +( 12969, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 4) +( 12970, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 5) +( 12971, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 2) +( 12972, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 3) +( 12973, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 4) +( 12974, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 5) +( 12999, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4, 0, 0), -- Unbridled Wrath (Rank 2) +( 13000, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6, 0, 0), -- Unbridled Wrath (Rank 3) +( 13001, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 8, 0, 0), -- Unbridled Wrath (Rank 4) +( 13002, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10, 0, 0), -- Unbridled Wrath (Rank 5) +( 13163, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Aspect of the Monkey +( 13754, 0x00, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Kick (Rank 1) +( 13867, 0x00, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Kick (Rank 2) +( 13983, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0, 0, 0), -- Setup (Rank 1) +( 14070, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0, 0, 0), -- Setup (Rank 2) +( 14071, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0, 0, 0), -- Setup (Rank 3) +( 14156, 0x00, 8, 0x003E0000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Ruthlessness (Rank 1) +( 14160, 0x00, 8, 0x003E0000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Ruthlessness (Rank 2) +( 14161, 0x00, 8, 0x003E0000, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Ruthlessness (Rank 3) +( 14186, 0x00, 8, 0x40800508, 0x00000006, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Seal Fate (Rank 1) +( 14190, 0x00, 8, 0x40800508, 0x00000006, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Seal Fate (Rank 2) +( 14193, 0x00, 8, 0x40800508, 0x00000006, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Seal Fate (Rank 3) +( 14194, 0x00, 8, 0x40800508, 0x00000006, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Seal Fate (Rank 4) +( 14195, 0x00, 8, 0x40800508, 0x00000006, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Seal Fate (Rank 5) +( 14531, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Martyrdom (Rank 1) +( 14774, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Martyrdom (Rank 2) +( 14892, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 1) +( 15088, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry +( 15128, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Mark of Flames +( 15277, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6, 0, 0), -- Seal of Reckoning +( 15286, 0x20, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Embrace +( 15337, 0x00, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Improved Spirit Tap (Rank 1) +( 15338, 0x00, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Improved Spirit Tap (Rank 2) +( 15346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6, 0, 0), -- Seal of Reckoning +( 15362, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 2) +( 15363, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 3) +( 15600, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Hand of Justice +( 16086, 0x04, 11, 0x00000000, 0x00040000, 0x00000000, 0x00030000, 0x00000000, 0, 0, 0), -- Improved Fire Nova Totem (Rank 1) +( 16544, 0x04, 11, 0x00000000, 0x00040000, 0x00000000, 0x00030000, 0x00000000, 0, 0, 0), -- Improved Fire Nova Totem (Rank 2) +( 16176, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Healing (Rank 1) +( 16180, 0x00, 11, 0x000001C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 100, 0), -- Improved Water Shield (Rank 1) +( 16196, 0x00, 11, 0x000001C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 100, 0), -- Improved Water Shield (Rank 2) +( 16198, 0x00, 11, 0x000001C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 100, 0), -- Improved Water Shield (Rank 3) +( 16235, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Healing (Rank 2) +( 16240, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Healing (Rank 3) +( 16256, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 1) +( 16257, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 1) +( 16277, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 2) +( 16278, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 3) +( 16279, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 4) +( 16280, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Flurry (Rank 5) +( 16281, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 2) +( 16282, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 3) +( 16283, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 4) +( 16284, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Flurry (Rank 5) +( 16487, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blood Craze (Rank 1) +( 16489, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blood Craze (Rank 2) +( 16492, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blood Craze (Rank 3) +( 16550, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Bonespike (Rank 1) +( 16620, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Proc Self Invulnerability +( 16624, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Thorium Shield Spike +( 16850, 0x00, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Celestial Focus (Rank 1) +( 16864, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Omen of Clarity +( 16880, 0x48, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nature's Grace +( 16923, 0x00, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Celestial Focus (Rank 2) +( 16924, 0x00, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Celestial Focus (Rank 3) +( 16952, 0x00, 7, 0x00039000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blood Frenzy (Rank 1) +( 16954, 0x00, 7, 0x00039000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blood Frenzy (Rank 2) +( 16958, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Primal Fury (Rank 1) +( 16961, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Primal Fury (Rank 2) +( 17106, 0x00, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Intensity (Rank 1) +( 17107, 0x00, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Intensity (Rank 2) +( 17108, 0x00, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Intensity (Rank 3) +( 17364, 0x08, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Stormstrike +( 17495, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Crest of Retribution +( 17619, 0x00, 13, 0x00000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0, 0, 0), -- Alchemist's Stone +( 17793, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Shadow Bolt (Rank 1) +( 17796, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Shadow Bolt (Rank 2) +( 17801, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Shadow Bolt (Rank 3) +( 17802, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Shadow Bolt (Rank 4) +( 17803, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Shadow Bolt (Rank 5) +( 18094, 0x00, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Nightfall (Rank 1) +( 18095, 0x00, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Nightfall (Rank 2) +( 18820, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Insight +( 19184, 0x00, 9, 0x00000010, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Entrapment (Rank 1) +( 19387, 0x00, 9, 0x00000010, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Entrapment (Rank 2) +( 19388, 0x00, 9, 0x00000010, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Entrapment (Rank 3) +( 19572, 0x00, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Improved Mend Pet (Rank 1) +( 19573, 0x00, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Improved Mend Pet (Rank 2) +( 20049, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Vengeance (Rank 1) +( 20056, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Vengeance (Rank 2) +( 20057, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Vengeance (Rank 3) +( 20128, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Redoubt +( 20131, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Redoubt +( 20132, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Redoubt +( 20164, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5, 0, 0), -- Seal of Justice +( 20165, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 20, 0, 0), -- Seal of Light +( 20166, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 12, 0, 0), -- Seal of Wisdom +( 20177, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 1) +( 20179, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 2) +( 20180, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 4) +( 20181, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 3) +( 20182, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 5) +( 20185, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 15, 0, 0), -- Judgement of Light +( 20186, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 15, 0, 0), -- Judgement of Wisdom +( 20210, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 1) +( 20212, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 2) +( 20213, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 3) +( 20214, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 4) +( 20215, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 5) +( 20234, 0x00, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Lay on Hands (Rank 1) +( 20235, 0x00, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Lay on Hands (Rank 2) +( 20375, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 1), -- Seal of Command +( 20500, 0x00, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Berserker Rage (Rank 1) +( 20501, 0x00, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Berserker Rage (Rank 2) +( 20705, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Power Shield 500 +( 20911, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Blessing of Sanctuary +( 20925, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield (Rank 1) +( 20927, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield (Rank 2) +( 20928, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield (Rank 3) +( 21084, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Seal of Righteousness +( 21185, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Spinal Reaper +( 21882, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Judgement Smite +( 21890, 0x00, 4, 0x2A764EEF, 0x0000036C, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Warrior's Wrath +( 22007, 0x00, 3, 0x00200021, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Netherwind Focus +( 22618, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Force Reactive Disk +( 22648, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Call of Eskhandar +( 23547, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Parry +( 23548, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Parry +( 23551, 0x00, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lightning Shield +( 23552, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield +( 23572, 0x00, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Mana Surge +( 23578, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Expose Weakness +( 23581, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Bloodfang +( 23686, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Lightning Strike +( 23688, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Aura of the Blue Dragon +( 23689, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4, 0, 0), -- Heroism +( 23695, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Hamstring (Rank 3) +( 23721, 0x00, 9, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Infused +( 23920, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection +( 24353, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Primal Instinct +( 24389, 0x00, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Chaos Fire +( 24398, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 7) +( 24658, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00014110, 0x00000000, 0, 0, 0), -- Unstable Power +( 24905, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 15, 0, 0), -- Moonkin Form (Passive) (Passive) +( 24932, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 6), -- Leader of the Pack +( 25050, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Mark of Flames +( 25469, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 8) +( 25472, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 9) +( 25669, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Decapitate +( 25899, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Greater Blessing of Sanctuary +( 25988, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Eye for an Eye (Rank 2) +( 26016, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Vindication (Rank 2) +( 26107, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000064, 0, 0, 0), -- Symbols of Unending Life Finisher Bonus +( 26119, 0x00, 10, 0x90100003, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Stormcaller Spelldamage Bonus +( 26128, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0, 0, 0), -- Enigma Resist Bonus +( 26135, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Battlegear of Eternal Justice +( 26480, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Badge of the Swarmguard +( 26605, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Bloodcrown +( 27131, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 7) +( 27179, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield (Rank 4) +( 27419, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Warrior's Resolve +( 27498, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Crusader's Wrath +( 27521, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 15), -- Mana Restore +( 27656, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Flame Lash +( 27774, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- The Furious Storm +( 27787, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Rogue Armor Energize +( 27811, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blessed Recovery (Rank 1) +( 27815, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blessed Recovery (Rank 2) +( 27816, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blessed Recovery (Rank 3) +( 28592, 0x10, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Winter's Chill (Rank 2) +( 28593, 0x10, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Winter's Chill (Rank 3) +( 28716, 0x00, 7, 0x00000010, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0, 0, 0), -- Rejuvenation +( 28719, 0x00, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Healing Touch +( 28744, 0x00, 7, 0x00000040, 0x00000000, 0x00000000, 0x00044000, 0x00000000, 0, 0, 0), -- Regrowth +( 28752, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Adrenaline Rush +( 28789, 0x00, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Holy Power +( 28802, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Epiphany +( 28809, 0x00, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Greater Heal +( 28812, 0x00, 8, 0x02000006, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Head Rush +( 28816, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Invigorate +( 28823, 0x00, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Totemic Power +( 28847, 0x00, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Healing Touch Refund +( 28849, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lesser Healing Wave +( 29074, 0x14, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Master of Elements (Rank 1) +( 29075, 0x14, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Master of Elements (Rank 2) +( 29076, 0x14, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Master of Elements (Rank 3) +( 29150, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Electric Discharge +( 29179, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Elemental Devastation (Rank 2) +( 29180, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Elemental Devastation (Rank 3) +( 29385, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7, 0, 0), -- Seal of Command +( 29441, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0, 0, 1), -- Magic Absorption (Rank 1) +( 29444, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0, 0, 1), -- Magic Absorption (Rank 2) +( 29455, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Felsteel Shield Spike +( 29501, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Frost Arrow +( 29593, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Improved Defensive Stance (Rank 1) +( 29594, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Improved Defensive Stance (Rank 2) +( 29624, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Searing Arrow +( 29625, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Flaming Cannonball +( 29626, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Shadow Bolt +( 29632, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Shadow Shot +( 29633, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Fire Blast +( 29634, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Quill Shot +( 29635, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Flaming Shell +( 29636, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Venom Shot +( 29637, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Keeper's Sting +( 29834, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Second Wind (Rank 1) +( 29838, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Second Wind (Rank 2) +( 29977, 0x00, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Combustion +( 30003, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Sheen of Zanza +( 30160, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Elemental Devastation (Rank 1) +( 30293, 0x00, 5, 0x00000381, 0x000200C0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Soul Leech (Rank 1) +( 30295, 0x00, 5, 0x00000381, 0x000200C0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Soul Leech (Rank 2) +( 30296, 0x00, 5, 0x00000381, 0x000200C0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Soul Leech (Rank 3) +( 30299, 0x7E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Nether Protection (Rank 1) +( 30301, 0x7E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Nether Protection (Rank 2) +( 30302, 0x7E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Nether Protection (Rank 3) +( 30675, 0x00, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lightning Overload (Rank 1) +( 30678, 0x00, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lightning Overload (Rank 2) +( 30679, 0x00, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lightning Overload (Rank 3) +( 30701, 0x1C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Elemental Absorption (Rank 1) +( 30705, 0x1C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Elemental Absorption (Rank 5) +( 30823, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10., 0, 0), -- Shamanistic Rage +( 30881, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Nature's Guardian (Rank 1) +( 30883, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Nature's Guardian (Rank 2) +( 30884, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Nature's Guardian (Rank 3) +( 30885, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Nature's Guardian (Rank 4) +( 30886, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Nature's Guardian (Rank 5) +( 30937, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Mark of Shadow +( 31124, 0x00, 8, 0x01000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Blade Twisting (Rank 1) +( 31126, 0x00, 8, 0x01000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Blade Twisting (Rank 2) +( 31244, 0x00, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000004, 0, 0, 0), -- Quick Recovery (Rank 1) +( 31245, 0x00, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000004, 0, 0, 0), -- Quick Recovery (Rank 2) +( 31394, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Mark of Shadow +( 31569, 0x00, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Blink (Rank 1) +( 31570, 0x00, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Blink (Rank 2) +( 31571, 0x00, 3, 0x00000000, 0x00000022, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Arcane Potency (Rank 1) +( 31572, 0x00, 3, 0x00000000, 0x00000022, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Arcane Potency (Rank 2) +( 31656, 0x04, 3, 0x8000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Empowered Fire (Rank 1) +( 31657, 0x04, 3, 0x8000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Empowered Fire (Rank 2) +( 31658, 0x04, 3, 0x8000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Empowered Fire (Rank 3) +( 31794, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Focused Mind +( 31801, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Seal of Vengeance +( 31833, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Light's Grace (Rank 1) +( 31835, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Light's Grace (Rank 2) +( 31836, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Light's Grace (Rank 3) +( 31871, 0x00, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Divine Purpose (Rank 1) +( 31872, 0x00, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Divine Purpose (Rank 2) +( 53530, 1, 10, 0x00000000, 0x00000000, 0x0004, 0x0400, 0x0001, 0, 100, 0), -- Divine Guardian +( 31876, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Wise (Rank 1) +( 31877, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Wise (Rank 2) +( 31878, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Wise (Rank 3) +( 31904, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield +( 32385, 0x00, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Embrace (Rank 1) +( 32387, 0x00, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Embrace (Rank 2) +( 32392, 0x00, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Embrace (Rank 3) +( 32393, 0x00, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Embrace (Rank 4) +( 32394, 0x00, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Embrace (Rank 5) +( 32409, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Word: Death +( 32587, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Shield Block +( 32593, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000222A8, 0x00000000, 0, 0, 3), -- Earth Shield (Rank 2) +( 32594, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000222A8, 0x00000000, 0, 0, 3), -- Earth Shield (Rank 3) +( 32642, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Spore Cloud +( 32734, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Earth Shield +( 32748, 0x00, 8, 0x00000000, 0x00000001, 0x00000000, 0x00000140, 0x00000000, 0, 0, 0), -- Deadly Throw Interrupt (Rank 5) +( 32776, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Redoubt +( 32777, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield +( 32837, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 45), -- Spell Focus Trigger +( 32844, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 0), -- Lesser Heroism +( 32885, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Infuriate +( 33076, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A22A8, 0x00000000, 0, 0, 0), -- Prayer of Mending (Rank 1) +( 33089, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Vigilance of the Colossus +( 33127, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7, 0, 0), -- Seal of Command +( 33142, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blessed Resilience (Rank 1) +( 33145, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blessed Resilience (Rank 2) +( 33146, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Blessed Resilience (Rank 3) +( 33150, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Surge of Light (Rank 1) +( 33151, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Surge of Light (Rank 1) +( 33154, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Surge of Light (Rank 2) +( 33191, 0x00, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Misery (Rank 1) +( 33192, 0x00, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Misery (Rank 2) +( 33193, 0x00, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Misery (Rank 3) +( 33297, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Spell Haste Trinket +( 33299, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Coilfang Slave Pens Lvl 70 Boss3a Caster Trinket +( 33510, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5, 0, 0), -- Health Restore +( 33648, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Reflection of Torment +( 33719, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Perfect Spell Reflection +( 33736, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 8) +( 33746, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Essence Infused Mushroom +( 33757, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 100, 3), -- Windfury Weapon (Passive) (Rank 1) +( 33759, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Power Infused Mushroom +( 33881, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Natural Perfection (Rank 1) +( 33882, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Natural Perfection (Rank 2) +( 33883, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Natural Perfection (Rank 3) +( 33953, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00044000, 0x00000000, 0, 0, 45), -- Essence of Life +( 34074, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0, 0, 0), -- Aspect of the Viper +( 34080, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0, 0, 0), -- Riposte Stance +( 34138, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Totem of the Third Wind +( 34139, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Libram of Justice +( 34258, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Justice +( 34262, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Mercy +( 34320, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Call of the Nexus +( 34355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Poison Shield +( 34497, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Thrill of the Hunt (Rank 1) +( 34498, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Thrill of the Hunt (Rank 2) +( 34499, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Thrill of the Hunt (Rank 3) +( 34500, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Expose Weakness (Rank 1) +( 34502, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Expose Weakness (Rank 2) +( 34503, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Expose Weakness (Rank 3) +( 34584, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Love Struck +( 34586, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.5, 0, 0), -- Romulo's Poison +( 34598, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Karazhan Caster Robe +( 34749, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0, 0, 0), -- Recurring Power +( 34753, 0x00, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Holy Concentration (Rank 1) +( 34774, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.5, 0, 20), -- Magtheridon Melee Trinket +( 34783, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection +( 34827, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield +( 34859, 0x00, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Holy Concentration (Rank 2) +( 34860, 0x00, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Holy Concentration (Rank 3) +( 34914, 0x00, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Touch (Rank 1) +( 34916, 0x00, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Touch (Rank 2) +( 34917, 0x00, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Touch (Rank 3) +( 34935, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 8), -- Backlash (Rank 1) +( 34938, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 8), -- Backlash (Rank 2) +( 34939, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 8), -- Backlash (Rank 3) +( 34950, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Go for the Throat (Rank 1) +( 34954, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Go for the Throat (Rank 2) +( 35077, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Band of the Eternal Defender +( 35080, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 60), -- Band of the Eternal Champion +( 35083, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Band of the Eternal Sage +( 35086, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Band of the Eternal Restorer +( 35121, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nether Power +( 35541, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00800000, 0x00000000, 0, 0, 0), -- Combat Potency (Rank 1) +( 35550, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00800000, 0x00000000, 0, 0, 0), -- Combat Potency (Rank 2) +( 35551, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00800000, 0x00000000, 0, 0, 0), -- Combat Potency (Rank 3) +( 35552, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00800000, 0x00000000, 0, 0, 0), -- Combat Potency (Rank 4) +( 35553, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00800000, 0x00000000, 0, 0, 0), -- Combat Potency (Rank 5) +( 36032, 0x00, 3, 0x00001000, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Blast +( 36096, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection +( 36111, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- World Breaker +( 36541, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Curse of Burning Shadows +( 37165, 0x00, 8, 0x00200400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Haste +( 37168, 0x00, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Finisher Combo +( 37170, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Free Finisher Chance +( 37173, 0x00, 8, 0x2CBC0598, 0x00000106, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Armor Penetration +( 37189, 0x00, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 60), -- Recuced Holy Light Cast Time +( 37193, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Infused Shield +( 37195, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgement Group Heal +( 37197, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 45), -- Spell Damage +( 37213, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Mana Cost Reduction +( 37214, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Energized +( 37227, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 60), -- Improved Healing Wave +( 37237, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Lightning Bolt Discount +( 37247, 0x08, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 45), -- Regain Mana +( 37377, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Shadowflame +( 37379, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Flameshadow +( 37384, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Corruption and Immolate +( 37443, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Crit Bonus Damage +( 37514, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Blade Turning +( 37516, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Revenge Bonus +( 37519, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0, 0, 0), -- Rage Bonus +( 37523, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Reinforced Shield +( 37528, 0x00, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Overpower Bonus +( 37536, 0x00, 4, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Battle Shout +( 37568, 0x00, 6, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Greater Heal Discount +( 37594, 0x00, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Greater Heal Refund +( 37600, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Offensive Discount +( 37601, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Relentlessness +( 37603, 0x00, 6, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shadow Word Pain Damage +( 37655, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Bonus Mana Regen +( 37657, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 3), -- Lightning Capacitor +( 38026, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0, 0, 0), -- Viscous Shield +( 38031, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Shield Block +( 38290, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.6, 0, 0), -- Santos' Blessing +( 38299, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- HoTs on Heals +( 38326, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Crit Threat Reduction Melee +( 38327, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Crit Threat Reduction Spell +( 38334, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Proc Mana Regen +( 38347, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Crit Proc Spell Damage +( 38350, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Crit Proc Heal +( 38394, 0x00, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dot Heals +( 38857, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Spell Ground +( 39027, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Poison Shield +( 39372, 0x30, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Frozen Shadoweave +( 39437, 0x04, 5, 0x00001364, 0x000000C0, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Shadowflame Hellfire and RoF +( 39442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0, 0, 0), -- Aura of Wrath +( 39443, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Aura of Wrath +( 39530, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Focus +( 39958, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.7, 0, 40), -- Skyfire Swiftness +( 40407, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6, 0, 0), -- Illidan Tank Shield +( 40438, 0x00, 6, 0x00008040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Priest Tier 6 Trinket +( 40442, 0x00, 7, 0x00000014, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Druid Tier 6 Trinket +( 40444, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Black Temple Tank Trinket +( 40458, 0x00, 4, 0x02000000, 0x00000601, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Warrior Tier 6 Trinket +( 40463, 0x00, 11, 0x00000081, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shaman Tier 6 Trinket +( 40470, 0x00, 10, 0xC0800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Paladin Tier 6 Trinket +( 40475, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3, 0, 0), -- Black Temple Melee Trinket +( 40478, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Warlock Tier 6 Trinket +( 40482, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Mage Tier 6 Trinket +( 40485, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Hunter Tier 6 Trinket +( 40899, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Felfire Proc +( 41034, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Spell Absorption +( 41260, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Aviana's Purpose +( 41262, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Aviana's Will +( 41381, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0, 0, 0), -- Shell of Life +( 41393, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Riposte +( 41434, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2, 0, 45), -- The Twin Blades of Azzinoth +( 41469, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7, 0, 0), -- Seal of Command +( 41635, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A22A8, 0x00000000, 0, 0, 0), -- Prayer of Mending (Rank 1) +( 41989, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.5, 0, 0), -- Fists of Fury +( 42083, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Fury of the Crashing Waves +( 42135, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 90), -- Lesser Rune of Warding +( 42136, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 90), -- Greater Rune of Warding +( 42368, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Merciless Libram of Justice +( 42370, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Merciless Totem of the Third WInd +( 42770, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Second Wind (Rank 2) +( 43019, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 8) +( 43020, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0, 0, 0), -- Mana Shield (Rank 9) +( 43338, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Shamanistic Focus +( 43443, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection +( 43726, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vengeful Libram of Justice +( 43728, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vengeful Totem of Third WInd +( 43737, 0x00, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Primal Instinct +( 43739, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Lunar Grace +( 43741, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Light's Grace +( 43745, 0x00, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Crusader's Command +( 43748, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Elemental Strength +( 43750, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Energized +( 43819, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Lucidity +( 44404, 0x00, 3, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Missile Barrage (Rank 1) +( 44442, 0x00, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0, 0, 1), -- Firestarter (Rank 1) +( 44443, 0x00, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0, 0, 1), -- Firestarter (Rank 2) +( 44445, 0x00, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Hot Streak (Rank 1) +( 44446, 0x00, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Hot Streak (Rank 2) +( 44448, 0x00, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Hot Streak (Rank 3) +( 44449, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 1) +( 44469, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 2) +( 44470, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 3) +( 44471, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 4) +( 44472, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 5) +( 44543, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 7, 0), -- Fingers of Frost (Rank 1) +( 44545, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 15, 0), -- Fingers of Frost (Rank 2) +( 44546, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1) +( 44548, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2) +( 44549, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 3) +( 44557, 0x00, 3, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Enduring Winter (Rank 1) +( 44560, 0x00, 3, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Enduring Winter (Rank 2) +( 44561, 0x00, 3, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Enduring Winter (Rank 3) +( 44835, 0x00, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Maim Interrupt +( 45054, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Augment Pain +( 45057, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Evasive Maneuvers +( 45234, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focused Will (Rank 1) +( 45243, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focused Will (Rank 2) +( 45244, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focused Will (Rank 3) +( 45354, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Item - Sunwell Dungeon Melee Trinket +( 45469, 0x00, 15, 0x00000010, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Death Strike +( 45481, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Sunwell Exalted Caster Neck +( 45482, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Sunwell Exalted Melee Neck +( 45483, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Sunwell Exalted Tank Neck +( 45484, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 45), -- Sunwell Exalted Healer Neck +( 46025, 0x20, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Blackout (Rank 5) +( 46092, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brutal Libram of Justice +( 46098, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brutal Totem of Third WInd +( 46569, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Sunwell Exalted Caster Neck +( 46662, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 20), -- Deathfrost +( 46832, 0x00, 7, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Moonkin Starfire Bonus +( 46854, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Trauma (Rank 1) +( 46855, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Trauma (Rank 2) +( 46867, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Wrecking Crew (Rank 1) +( 46910, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 5.5, 0, 0), -- Furious Attacks (Rank 1) +( 46911, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 7.5, 0, 0), -- Furious Attacks (Rank 2) +( 46913, 0x00, 4, 0x00000040, 0x00000404, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Bloodsurge (Rank 1) +( 46914, 0x00, 4, 0x00000040, 0x00000404, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Bloodsurge (Rank 2) +( 46915, 0x00, 4, 0x00000040, 0x00000404, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Bloodsurge (Rank 3) +( 46916, 0x00, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Slam! +( 46951, 0x00, 4, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sword and Board (Rank 1) +( 46952, 0x00, 0, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sword and Board (Rank 2) +( 46953, 0x00, 0, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sword and Board (Rank 3) +( 47195, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Eradication (Rank 1) +( 47196, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Eradication (Rank 2) +( 47197, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Eradication (Rank 3) +( 47201, 0x00, 5, 0x00004009, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Everlasting Affliction (1) +( 47202, 0x00, 5, 0x00004009, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Everlasting Affliction (2) +( 47203, 0x00, 5, 0x00004009, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Everlasting Affliction (3) +( 47204, 0x00, 5, 0x00004009, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Everlasting Affliction (4) +( 47205, 0x00, 5, 0x00004009, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Everlasting Affliction (5) +( 47245, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0, 0, 0), -- Molten Core (Rank 1) +( 47246, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0, 0, 0), -- Molten Core (Rank 2) +( 47247, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0, 0, 0), -- Molten Core (Rank 3) +( 47258, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Backdraft (Rank 1) +( 47259, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Backdraft (Rank 2) +( 47260, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Backdraft (Rank 3) +( 47263, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 20), -- Torture (Rank 1) +( 47264, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 20), -- Torture (Rank 2) +( 47265, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 20), -- Torture (Rank 3) +( 47509, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Divine Aegis (Rank 1) +( 47511, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Divine Aegis (Rank 2) +( 47515, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Divine Aegis (Rank 3) +( 47516, 0x00, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Grace (Rank 1) +( 47517, 0x00, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Grace (Rank 2) +( 47569, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Improved Shadowform (Rank 1) +( 47570, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Improved Shadowform (Rank 2) +( 47580, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0, 0, 0), -- Pain and Suffering (Rank 1) +( 47581, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0, 0, 0), -- Pain and Suffering (Rank 2) +( 47582, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0, 0, 0), -- Pain and Suffering (Rank 3) +( 48110, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A22A8, 0x00000000, 0, 0, 0), -- Prayer of Mending (Rank 2) +( 48111, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A22A8, 0x00000000, 0, 0, 0), -- Prayer of Mending (Rank 3) +( 48112, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A22A8, 0x00000000, 0, 0, 0), -- Prayer of Mending (Rank 2) +( 48113, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A22A8, 0x00000000, 0, 0, 0), -- Prayer of Mending (Rank 3) +( 48159, 0x00, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Touch (Rank 4) +( 48160, 0x00, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Vampiric Touch (Rank 5) +( 48483, 0x00, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Infected Wounds (Rank 1) +( 48484, 0x00, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Infected Wounds (Rank 2) +( 48485, 0x00, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Infected Wounds (Rank 3) +( 48492, 0x00, 7, 0x00080000, 0x00000000, 0x00000800, 0x00000400, 0x00000000, 0, 0, 0), -- King of the Jungle (Rank1) +( 48494, 0x00, 7, 0x00080000, 0x00000000, 0x00000800, 0x00000400, 0x00000000, 0, 0, 0), -- King of the Jungle (Rank2) +( 48495, 0x00, 7, 0x00080000, 0x00000000, 0x00000800, 0x00000400, 0x00000000, 0, 0, 0), -- King of the Jungle (Rank3) +( 48496, 0x00, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Living Seed (Rank 1) +( 48499, 0x00, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Living Seed (Rank 2) +( 48500, 0x00, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Living Seed (Rank 3) +( 48506, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Earth and Moon (Rank 1) +( 48510, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Earth and Moon (Rank 2) +( 48511, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Earth and Moon (Rank 3) +( 48516, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 30), -- Eclipse (Rank 1) +( 48521, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 30), -- Eclipse (Rank 2) +( 48525, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 30), -- Eclipse (Rank 3) +( 48833, 0x00, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Primal Instinct +( 48835, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Justice +( 48837, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Elemental Tenacity +( 48951, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield (Rank 5) +( 48952, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Holy Shield (Rank 6) +( 48988, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Bloody Vengeance (Rank 1) +( 49018, 0x00, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sudden Doom (Rank 1) +( 49194, 0x00, 15, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Unholy Blight +( 49027, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 3, 20), -- Bloodworms rank 1 +( 49542, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 6, 20), -- Bloodworms rank 2 +( 49543, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 9, 20), -- Bloodworms rank 3 +( 49208, 0x00, 15, 0x00400000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Reaping (Rank 1) +( 49222, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Bone Shield +( 49280, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 10) +( 49281, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Lightning Shield (Rank 11) +( 49283, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000222A8, 0x00000000, 0, 0, 3), -- Earth Shield (Rank 4) +( 49284, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000222A8, 0x00000000, 0, 0, 3), -- Earth Shield (Rank 5) +( 49503, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Bloody Vengeance (Rank 2) +( 49504, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Bloody Vengeance (Rank 3) +( 49529, 0x00, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sudden Doom (Rank 2) +( 49530, 0x00, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sudden Doom (Rank 3) +( 49622, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Bonus Mana Regen +( 50781, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 6), -- Fate Rune of Primal Energy +( 50880, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50884, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50885, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50886, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 50887, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Talons +( 51123, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Killing Machine (Rank 1) +( 51127, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Killing Machine (Rank 2) +( 51128, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Killing Machine (Rank 3) +( 51129, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Killing Machine (Rank 4) +( 51130, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Killing Machine (Rank 5) +( 51346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Venture Company Beatdown! +( 51349, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Venture Company Beatdown +( 51352, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Venture Company Beatdown! +( 51359, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 10), -- Venture Company Beatdown +( 51414, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Venomous Breath Aura +( 51474, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 1) +( 51478, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 2) +( 51479, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 3) +( 51483, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0, 0, 0), -- Storm, Earth and Fire +( 51485, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0, 0, 0), -- Storm, Earth and Fire +( 51486, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0, 0, 0), -- Storm, Earth and Fire +( 51521, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormstrike +( 51522, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormstrike +( 51523, 0x00, 11, 0x00000000, 0x00000001, 0x00000000, 0x00010000, 0x00000000, 0, 50, 0), -- Earthen Power (Rank 1) +( 51524, 0x00, 11, 0x00000000, 0x00000001, 0x00000000, 0x00010000, 0x00000000, 0, 50, 0), -- Earthen Power (Rank 2) +( 51528, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.5, 0, 0), -- Maelstrom Weapon (Rank 1) +( 51529, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5, 0, 0), -- Maelstrom Weapon (Rank 2) +( 51530, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.5, 0, 0), -- Maelstrom Weapon (Rank 3) +( 51531, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10, 0, 0), -- Maelstrom Weapon (Rank 4) +( 51532, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 12., 0, 0), -- Maelstrom Weapon (Rank 5) +( 51556, 0x00, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Awakening (Rank 1) +( 51557, 0x00, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Awakening (Rank 2) +( 51558, 0x00, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Awakening (Rank 3) +( 51562, 0x00, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0, 0, 0), -- Tidal Waves (Rank 1) +( 51563, 0x00, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0, 0, 0), -- Tidal Waves (Rank 2) +( 51564, 0x00, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0, 0, 0), -- Tidal Waves (Rank 3) +( 51565, 0x00, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0, 0, 0), -- Tidal Waves (Rank 4) +( 51566, 0x00, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0, 0, 0), -- Tidal Waves (Rank 5) +( 51625, 0x00, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Deadly Brew (Rank 1) +( 51626, 0x00, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Deadly Brew (Rank 2) +( 51627, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Turn the Tables (Rank 1) +( 51628, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Turn the Tables (Rank 2) +( 51629, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0, 0, 0), -- Turn the Tables (Rank 3) +( 51634, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focused Attacks (Rank 1) +( 51635, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focused Attacks (Rank 2) +( 51636, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focused Attacks (Rank 3) +( 51664, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 1) +( 51665, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 2) +( 51667, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 3) +( 51668, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 4) +( 51669, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Cut to the Chase (Rank 5) +( 51672, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 1), -- Unfair Advantage (Rank 1) +( 51674, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 1), -- Unfair Advantage (Rank 2) +( 51679, 0x00, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Throwing Specialization (Rank 2) +( 51692, 0x00, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Waylay (Rank 1) +( 51696, 0x00, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Waylay (Rank 2) +( 51698, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Honor Among Thieves (Rank 1) +( 51700, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Honor Among Thieves (Rank 2) +( 51701, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 1), -- Honor Among Thieves (Rank 3) +( 51915, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0, 100, 600), -- Undying Resolve +( 51940, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Earthliving Weapon (Passive) (Rank 1) +( 51989, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Earthliving Weapon (Passive) (Rank 2) +( 52004, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Earthliving Weapon (Passive) (Rank 3) +( 52005, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Earthliving Weapon (Passive) (Rank 4) +( 52007, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Earthliving Weapon (Passive) (Rank 5) +( 52008, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 20, 0), -- Earthliving Weapon (Passive) (Rank 6) +( 52020, 0x00, 7, 0x00008000, 0x00100000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Snap and Snarl +( 52127, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 1) +( 52129, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 2) +( 52131, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 3) +( 52134, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 4) +( 52136, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 5) +( 52138, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 6) +( 52420, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Deflection +( 52423, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Retaliation +( 52795, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Borrowed Time (Rank 1) +( 52797, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Borrowed Time (Rank 2) +( 52798, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Borrowed Time (Rank 3) +( 52799, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Borrowed Time (Rank 4) +( 52800, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Borrowed Time (Rank 5) +( 52898, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Spell Damping +( 53215, 0x00, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Wild Quiver (Rank 1) +( 53216, 0x00, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Wild Quiver (Rank 2) +( 53217, 0x00, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Wild Quiver (Rank 3) +( 53221, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Steady Shot (Rank 1) +( 53222, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Steady Shot (Rank 2) +( 53224, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Steady Shot (Rank 3) +( 53228, 0x00, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Rapid Recuperation (Rank 1) +( 53232, 0x00, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Rapid Recuperation (Rank 2) +( 53256, 0x00, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Cobra Strikes (Rank 1) +( 53259, 0x00, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Cobra Strikes (Rank 2) +( 53260, 0x00, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Cobra Strikes (Rank 3) +( 53290, 0x00, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Hunting Party (Rank 1) +( 53291, 0x00, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Hunting Party (Rank 2) +( 53292, 0x00, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Hunting Party (Rank 3) +( 53375, 0x00, 10, 0x00000000, 0x00002000, 0x00000000, 0x00000400, 0x00000000, 0, 0, 6), -- Sanctified Wrath (Rank 1) +( 53376, 0x00, 10, 0x00000000, 0x00002000, 0x00000000, 0x00000400, 0x00000000, 0, 0, 6), -- Sanctified Wrath (Rank 2) +( 53380, 0x00, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00040002, 0, 0, 0), -- Righteous Vengeance (Rank 1) +( 53381, 0x00, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00040002, 0, 0, 0), -- Righteous Vengeance (Rank 2) +( 53382, 0x00, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00040002, 0, 0, 0), -- Righteous Vengeance (Rank 3) +( 53397, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Invigoration (Rank 1) +( 53486, 0x00, 10, 0x00800000, 0x00028000, 0x00000000, 0x00000004, 0x00040002, 0, 0, 0), -- The Art of War (Rank 1) +( 53488, 0x00, 10, 0x00800000, 0x00028000, 0x00000000, 0x00000004, 0x00040002, 0, 0, 0), -- The Art of War (Rank 2) +( 53501, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Sheath of Light (Rank 1) +( 53502, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Sheath of Light (Rank 2) +( 53503, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Sheath of Light (Rank 3) +( 53551, 0x00, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sacred Cleansing (Rank 1) +( 53552, 0x00, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sacred Cleansing (Rank 2) +( 53553, 0x00, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sacred Cleansing (Rank 3) +( 53569, 0x00, 10, 0x40200000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Infusion of Light (Rank 1) +( 53576, 0x00, 10, 0x40200000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Infusion of Light (Rank 2) +( 53646, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Demonic Pact (Rank 1) +( 53671, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Pure (Rank 1) +( 53672, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Infusion of Light +( 53673, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Pure (Rank 2) +( 53709, 0x02, 10, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shield of the templar +( 53710, 0x02, 10, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shield of the templar +( 53711, 0x02, 10, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Shield of the templar +( 54149, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Infusion of Light (Rank 2) +( 54151, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Pure (Rank 3) +( 54154, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Pure (Rank 4) +( 54155, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00040000, 0, 0, 0), -- Judgements of the Pure (Rank 5) +( 54278, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Empowered Imp +( 54486, 0x00, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Missile Barrage (Rank 2) +( 54488, 0x00, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Missile Barrage (Rank 3) +( 54489, 0x00, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Missile Barrage (Rank 4) +( 54490, 0x00, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Missile Barrage (Rank 5) +( 54695, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Item - Death Knight's Anguish Base +( 54707, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Sonic Awareness (DND) +( 54738, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Star of Light +( 54747, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Burning Determination (Rank 1) +( 54749, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Burning Determination (Rank 2) +( 54754, 0x00, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Rejuvenation +( 54808, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Sonic Shield +( 54838, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Purified Spirit +( 54841, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 3), -- Thunder Capacitor +( 54936, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Flash of Light +( 54937, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Holy Light +( 54939, 0x00, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Divinity +( 55198, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00004000, 0x00000002, 0, 0, 0), -- Tidal Force +( 55380, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Skyflare Swiftness +( 55381, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 15), -- Mana Restore +( 55440, 0x00, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Healing Wave +( 55610, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00001000, 0x00000000, 0, 0, 0), -- Improved Icy Talons +( 55640, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Lightweave Embroidery +( 55677, 0x00, 6, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Dispel Magic +( 55680, 0x00, 6, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Prayer of Healing +( 55689, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Glyph of Shadow +( 55747, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Argent Fury +( 55768, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Darkglow Embroidery +( 55776, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Swordguard Embroidery +( 56218, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Corruption +( 56249, 0x00, 5, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Felhunter +( 56355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Titanium Shield Spike +( 56364, 0x00, 3, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Remove Curse +( 56372, 0x00, 3, 0x00000000, 0x00000080, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Glyph of Ice Block +( 56374, 0x00, 3, 0x00000000, 0x00004000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Glyph of Icy Veins +( 56451, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Earth Shield +( 56611, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Wrecking Crew (Rank 2) +( 56612, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Wrecking Crew (Rank 3) +( 56613, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Wrecking Crew (Rank 4) +( 56614, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Wrecking Crew (Rank 5) +( 56816, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0, 0, 0), -- Rune Strike +( 56821, 0x00, 8, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Glyph of Sinister Strike +( 56834, 0x00, 15, 0x00400000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Reaping (Rank 2) +( 56835, 0x00, 15, 0x00400000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Reaping (Rank 3) +( 57345, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Darkmoon Card: Greatness +( 57352, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00051154, 0x00000000, 0, 0, 45), -- Darkmoon Card: Death +( 57870, 0x00, 9, 0x00800000, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0, 0, 0), -- Glyph of Mend Pet +( 57878, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Natural Reaction (Rank 1) +( 57880, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Natural Reaction (Rank 2) +( 57881, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Natural Reaction (Rank 3) +( 57907, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Increased Spirit +( 57960, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Water Shield (Rank 9) +( 58357, 0x00, 4, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Glyph of Heroic Strike +( 58364, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Revenge +( 58372, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Hamstring +( 58386, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Glyph of Overpower +( 58442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Airy Pale Ale +( 58444, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 5), -- Worg Tooth Oatmeal Stout +( 58626, 0x00, 15, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Death Grip +( 58642, 0x00, 15, 0x00000000, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Scourge Strike +( 58644, 0x00, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Frost Strike +( 58647, 0x00, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Frost Strike +( 58676, 0x00, 15, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Vampiric Blood +( 58677, 0x00, 15, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Death's Embrace +( 58872, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Damage Shield (Rank 1) +( 58874, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Damage Shield (Rank 2) +( 58901, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Tears of Anguish +( 59088, 0x00, 4, 0x00000000, 0x00000002, 0x00000000, 0x00000400, 0x00000000, 0, 0, 0), -- Improved Spell Reflection (Rank 1) +( 59089, 0x00, 4, 0x00000000, 0x00000002, 0x00000000, 0x00000400, 0x00000000, 0, 0, 0), -- Improved Spell Reflection (Rank 2) +( 59176, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Spell Damping +( 59327, 0x00, 15, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Rune Tap +( 59345, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Chagrin +( 59630, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Black Magic +( 59725, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection +( 60061, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Flow of Time +( 60063, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Now is the Time! +( 60132, 0x00, 15, 0x00000000, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Oblit/Scourge Strike Runic Power Up +( 60170, 0x00, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Corruption Triggers Crit +( 60172, 0x00, 5, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Life Tap Bonus Spirit +( 60176, 0x00, 4, 0x00000020, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Bleed Cost Reduction +( 60221, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Essence of Gossamer +( 60301, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Meteorite Whetstone +( 60306, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Vestige of Haldor +( 60317, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Signet of Edward the Odd +( 60436, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Grim Toll +( 60442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Bandit's Insignia +( 60473, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Forge Ember +( 60482, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Pendulum of Telluric Currents +( 60487, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Extract of Necromatic Power +( 60490, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Embrace of the Spider +( 60493, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Dying Curse +( 60519, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Spark of Life +( 60529, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Forethought Talisman +( 60537, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Soul of the Dead +( 60564, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Savage Gladiator's Totem of Survival +( 60571, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Hateful Gladiator's Totem of Survival +( 60572, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Deadly Gladiator's Totem of Survival +( 60573, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- LK Arena 4 Gladiator's Totem of Survival +( 60574, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- LK Arena 5 Gladiator's Totem of Survival +( 60575, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- LK Arena 6 Gladiator's Totem of Survival +( 60617, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Parry +( 60710, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Savage Gladiator's Idol of Steadfastness +( 60717, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 100, 0), -- Hateful Gladiator's Idol of Steadfastness +( 60719, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Deadly Gladiator's Idol of Steadfastness +( 60722, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- LK Arena 4 Gladiator's Idol of Steadfastness +( 60724, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- LK Arena 5 Gladiator's Idol of Steadfastness +( 60726, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- LK Arena 6 Gladiator's Idol of Steadfastness +( 60770, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Totem of the Elemental Plane +( 60818, 0x00, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Libram of Reciprocation +( 60826, 0x00, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Sigil of Haunted Dreams +( 61188, 0x00, 5, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Chaotic Mind +( 61324, 0x00, 10, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Justice +( 61345, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nature's Grace +( 61346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nature's Grace +( 61356, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 90), -- Invigorating Earthsiege Diamond Passive +( 61618, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Tentacles +( 61848, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Aspect of the Dragonhawk +( 62147, 0x00, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Touch Defense Increase +( 62459, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Chains of Ice Frost Rune Refresh (Rank 3) +( 63108, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Siphon Life +( 63158, 0x00, 5, 0x00000001, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Decimation +( 63156, 0x00, 5, 0x00000001, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Decimation +( 64343, 0x00, 3, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Impact +( 64976, 0x00, 4, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Juggernaut +( 64914, 0x00, 8, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Rogue T8 2P Bonus +( 64938, 0x00, 4, 0x00200040, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Item - Warrior T8 Melee 2P Bonus +( 64952, 0x00, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Druid T8 Feral Relic +( 64964, 0x00, 15, 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Death Knight T8 Tank Relic +( 65002, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Bonus Mana Regen +( 65005, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Alacrity of the Elements +( 64999, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5, 0, 0), -- Meteoric Inspiration +( 65007, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5, 0, 0), -- Eye of the Broodmother +( 65013, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Pyrite Infusion +( 65020, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Mjolnir Runestone +( 65025, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Dark Matter +( 46949, 0x00, 4, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Safeguard +( 46945, 0x00, 4, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Safeguard +( 64415, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Val'anyr Hammer of Ancient Kings - Equip Effect +( 60066, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Rage of the Unraveller +( 62115, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Strength of the Titans +( 62114, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Flow of Knowledge +( 62600, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Savage Defense +( 63245, 0x00, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Pyroclasm +( 18096, 0x00, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Pyroclasm +( 18073, 0x00, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Pyroclasm +( 63280, 0x00, 11, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Totem of Wrath +( 63310, 0x00, 5, 0x00000000, 0x00010000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Glyph of Shadowflame +( 63335, 0x00, 15, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Howling Blast +( 63730, 0x00, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Serendipity +( 63733, 0x00, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Serendipity +( 63737, 0x00, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Serendipity +( 64127, 0x00, 6, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Body and Soul +( 64129, 0x00, 6, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Body and Soul +( 64568, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 3), -- Blood Reserve +( 64571, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Blood Draining +( 64440, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 20), -- Blade Warding +( 64714, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Flame of the Heavens +( 64738, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Show of Faith +( 64742, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Pandora's Plea +( 64752, 0x00, 7, 0x00800000, 0x10000100, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Druid T8 Feral 2P Bonus +( 64786, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Comet's Trail +( 64792, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 45), -- Blood of the Old God +( 64824, 0x00, 7, 0x00200000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Druid T8 Balance 4P Bonus +( 64928, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Item - Shaman T8 Elemental +( 64860, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Hunter T8 4P Bonus +( 64867, 0x00, 3, 0x20000021, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Mage T8 2P Bonus +( 64882, 0x00, 10, 0x00000000, 0x00100000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Paladin T8 Protection 4P Bonus +( 64890, 0x00, 10, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Item - Paladin T8 Holy 2P Bonus +( 64908, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Priest T8 Shadow 4P Bonus +( 64912, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Priest T8 Healer 4P Bonus +( 57470, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Renewed Hope +( 57472, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Renewed Hope +( 35100, 0x00, 9, 0x00001000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0, 0, 0), -- Concussive Barrage +( 35102, 0x00, 9, 0x00001000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0, 0, 0), -- Concussive Barrage +( 18119, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Aftermath +( 18120, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Aftermath +( 13165, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 14318, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 14319, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 14320, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 14321, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 14322, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 25296, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 27044, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Hawk +( 61846, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Dragonhawk +( 61847, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0, 0, 0), -- Aspect of the Dragonhawk +( 49223, 0x00, 15, 0x00000011, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dirge +( 49599, 0x00, 15, 0x00000011, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dirge +( 49188, 0x00, 15, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Rime +( 56822, 0x00, 15, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Rime +( 59057, 0x00, 15, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Rime +( 55666, 0x00, 15, 0x00000001, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Desecration +( 55667, 0x00, 15, 0x00000001, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Desecration +( 58616, 0x00, 15, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Heart Strike +( 16164, 0x00, 11, 0x901000C3, 0x00001000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Elemental Focus +( 49149, 0x00, 15, 0x00000006, 0x00020002, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Chill of the Grave +( 50115, 0x00, 15, 0x00000006, 0x00020002, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Chill of the Grave +( 49217, 0x00, 15, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0, 0, 1), -- Wandering Plague +( 49654, 0x00, 15, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0, 0, 1), -- Wandering Plague +( 49655, 0x00, 15, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0, 0, 1), -- Wandering Plague +( 58620, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Chains of Ice +( 56342, 0x00, 9, 0x00000018, 0x08000000, 0x00024000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load +( 56343, 0x00, 9, 0x00000018, 0x08000000, 0x00024000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load +( 56344, 0x00, 9, 0x00000018, 0x08000000, 0x00024000, 0x00000000, 0x00000000, 0, 0, 0), -- Lock and Load +( 48539, 0x00, 7, 0x00000010, 0x04000000, 0x00000000, 0x00040000, 0x00000000, 0, 0, 0), -- Revitalize +( 48544, 0x00, 7, 0x00000010, 0x04000000, 0x00000000, 0x00040000, 0x00000000, 0, 0, 0), -- Revitalize +( 48545, 0x00, 7, 0x00000010, 0x04000000, 0x00000000, 0x00040000, 0x00000000, 0, 0, 0), -- Revitalize +( 53234, 0x00, 9, 0x00020000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0, 0, 0), -- Piercing Shots (Rank 1) +( 53237, 0x00, 9, 0x00020000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0, 0, 0), -- Piercing Shots (Rank 2) +( 53238, 0x00, 9, 0x00020000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0, 0, 0), -- Piercing Shots (Rank 3) +( 56636, 0x00, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Taste for Blood (Rank 1) +( 56637, 0x00, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Taste for Blood (Rank 2) +( 56638, 0x00, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 6), -- Taste for Blood (Rank 3) +( 56375, 0x00, 3, 0x01000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Glyphs of Polymorph +( 54639, 0x00, 15, 0x00400000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Blood of the north +( 54638, 0x00, 15, 0x00400000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Blood of the north +( 54637, 0x00, 15, 0x00400000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Blood of the north +( 49467, 0x00, 15, 0x00000010, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Death Rune Mastery +( 50033, 0x00, 15, 0x00000010, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Death Rune Mastery +( 50034, 0x00, 15, 0x00000010, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Death Rune Mastery +( 63373, 0x00, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Frozen Power (Rank 1) +( 63374, 0x00, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Frozen Power (Rank 2) +( 54821, 0x00, 7, 0x00001000, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Glyph of Rake +( 54815, 0x00, 7, 0x00008000, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Glyph of Shred +( 54845, 0x00, 7, 0x00000004, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Glyph of Starfire +( 56800, 0x00, 8, 0x00800004, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Glyph of Backstab +( 54832, 0x00, 7, 0x00000000, 0x00001000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 0), -- Glyph of Innervate +( 67353, 0x00, 7, 0x00008000, 0x00100500, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- uncommented +( 57989, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0, 0, 0), -- uncommented +( 65661, 0x00, 15, 0x00400010, 0x20020004, 0x00000000, 0x00000010, 0x00000000, 0, 100, 0), -- Threat of Thassarian (Rank 1) +( 66191, 0x00, 15, 0x00400010, 0x20020004, 0x00000000, 0x00000010, 0x00000000, 0, 100, 0), -- Threat of Thassarian (Rank 2) +( 66192, 0x00, 15, 0x00400010, 0x20020004, 0x00000000, 0x00000010, 0x00000000, 0, 100, 0), -- Threat of Thassarian (Rank 3) +( 53601, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0, 0, 6), -- Sacred Shield (Rank 1) +( 58375, 0x00, 4, 0x00000000, 0x00000200, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Glyph of Blocking +( 58387, 0x00, 4, 0x00004000, 0x00000040, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Glyph of Sunder Armor +( 54925, 0x02, 10, 0x00000000, 0x00000208, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Seal of Command +( 63320, 0x00, 5, 0x80040000, 0x00000000, 0x00008000, 0x00000400, 0x00000000, 0, 0, 0), -- Glyph of Life Tap +( 67356, 0x08, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Item - Druid T9 Restoration Relic (Rejuvenation) +( 67653, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00400028, 0x00000000, 0, 0, 45), -- Item - Coliseum Tank Trinket 5men +( 67667, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 0, 45), -- Item - Coliseum Healer Trinket 5men +( 67670, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 45), -- Item - Coliseum Caster Trinket 5men +( 67672, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00800154, 0x00000000, 0, 0, 45), -- Item - Coliseum Melee Trinket 5men +( 67758, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 2), -- Item - Coliseum 25 Heroic Caster Trinket +( 67771, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00851154, 0x00000003, 0, 35, 45), -- Item - Coliseum Melee Trinket 10men +( 67702, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00851154, 0x00000003, 0, 35, 45), -- Item - Coliseum Melee Trinket 25men +( 70807, 0x00, 11, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0, 100, 0), -- Item - Shaman T10 Restoration 2P Bonus +( 71519, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 105), -- Item - Deathbringer's Will Trinket Normal +( 71562, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 105), -- Item - Deathbringer's Will Trinket Heroic +( 70761, 0x00, 10, 0x00000000, 0x80004000, 0x00000001, 0x00000400, 0x00000000, 0, 0, 0); -- Item - Paladin T10 Protection 4P Bonus +/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_required` +-- + +DROP TABLE IF EXISTS `spell_required`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_required` ( + `spell_id` mediumint(9) NOT NULL DEFAULT '0', + `req_spell` mediumint(9) NOT NULL DEFAULT '0', + PRIMARY KEY (`spell_id`, `req_spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell Additinal Data'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_required` +-- + +LOCK TABLES `spell_required` WRITE; +/*!40000 ALTER TABLE `spell_required` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_required` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_script_target` +-- + +DROP TABLE IF EXISTS `spell_script_target`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_script_target` ( + `entry` mediumint(8) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `targetEntry` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Spell System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_script_target` +-- + +LOCK TABLES `spell_script_target` WRITE; +/*!40000 ALTER TABLE `spell_script_target` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_script_target` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_scripts` +-- + +DROP TABLE IF EXISTS `spell_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_scripts` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `delay` int(10) unsigned NOT NULL DEFAULT '0', + `command` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong` mediumint(8) unsigned NOT NULL DEFAULT '0', + `datalong2` int(10) unsigned NOT NULL DEFAULT '0', + `dataint` int(11) NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `z` float NOT NULL DEFAULT '0', + `o` float NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_scripts` +-- + +LOCK TABLES `spell_scripts` WRITE; +/*!40000 ALTER TABLE `spell_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_group_stack_rules` +-- + +DROP TABLE IF EXISTS `spell_group_stack_rules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +DROP TABLE IF EXISTS `spell_group_stack_rules`; +CREATE TABLE `spell_group_stack_rules` ( + `group_id` INT(11) UNSIGNED NOT NULL DEFAULT 0, + `stack_rule` TINYINT(3) NOT NULL DEFAULT 0, + PRIMARY KEY (`group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_group_stack_rules` +-- + +LOCK TABLES `spell_group_stack_rules` WRITE; +/*!40000 ALTER TABLE `spell_group_stack_rules` DISABLE KEYS */; +INSERT INTO spell_group_stack_rules (`group_id`, `stack_rule`) VALUES +(1, 1), +(2, 1), +(1001, 1), +(1002, 1), +(1003, 1), +(1004, 1), +(1005, 1), +(1006, 1), +(1007, 1), +(1008, 1), +(1009, 1), +(1010, 2), +(1011, 2), +(1015,1), +(1016,1), +(1019,1), +(1022,1), +(1025,1), +(1029,1), +(1033,1), +(1036,1), +(1043,1), +(1048,1), +(1051,1), +(1054,1), +(1057,1), +(1059,1), +(1064,1), +(1068,1), +(1074,1), +(1079,1), +(1082,1), +(1085,1), +(1088,1), +(1090,1), +(1093,1), +(1096,1), +(1099,1), +(1103,1), +(1046,1), +(1107,1); + +/*!40000 ALTER TABLE `spell_group_stack_rules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_ranks` +-- + +DROP TABLE IF EXISTS `spell_ranks`; +CREATE TABLE `spell_ranks` ( + `first_spell_id` INT UNSIGNED NOT NULL DEFAULT 0, + `spell_id` INT UNSIGNED NOT NULL DEFAULT 0, + `rank` TINYINT UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`first_spell_id`, `rank`), + UNIQUE (`spell_id`) +) ENGINE=MYISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell Rank Data'; + +-- +-- Dumping data for table `spell_ranks` +-- + +LOCK TABLES `spell_ranks` WRITE; +/*!40000 ALTER TABLE `spell_ranks` DISABLE KEYS */; +INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES + -- Abomination's Might +(53137, 53137, 1), +(53137, 53138, 2), + -- Absolution +(33167, 33167, 1), +(33167, 33171, 2), +(33167, 33172, 3), + -- Acclimation +(49200, 49200, 1), +(49200, 50151, 2), +(49200, 50152, 3), + -- Acid Spit +(55749, 55749, 1), +(55749, 55750, 2), +(55749, 55751, 3), +(55749, 55752, 4), +(55749, 55753, 5), +(55749, 55754, 6), + -- Aftermath +(18119, 18119, 1), +(18119, 18120, 2), + -- Aggression +(18427, 18427, 1), +(18427, 18428, 2), +(18427, 18429, 3), +(18427, 61330, 4), +(18427, 61331, 5), + -- Agility +(8115, 8115, 1), +(8115, 8116, 2), +(8115, 8117, 3), +(8115, 12174, 4), +(8115, 33077, 5), +(8115, 43194, 6), +(8115, 58450, 7), +(8115, 58451, 8), + -- Aimed Shot +(19434, 19434, 1), +(19434, 20900, 2), +(19434, 20901, 3), +(19434, 20902, 4), +(19434, 20903, 5), +(19434, 20904, 6), +(19434, 27065, 7), +(19434, 49049, 8), +(19434, 49050, 9), + -- Alchemy +(2259, 2259, 1), +(2259, 3101, 2), +(2259, 3464, 3), +(2259, 11611, 4), +(2259, 28596, 5), +(2259, 51304, 6), + -- Ambush +(8676, 8676, 1), +(8676, 8724, 2), +(8676, 8725, 3), +(8676, 11267, 4), +(8676, 11268, 5), +(8676, 11269, 6), +(8676, 27441, 7), +(8676, 48689, 8), +(8676, 48690, 9), +(8676, 48691, 10), + -- Amplify Magic +(1267, 1267, 1), +(1267, 8456, 2), +(1267, 10171, 3), +(1267, 10172, 4), +(1267, 27397, 5), +(1267, 33947, 6), + -- Amplify Magic +(1008, 1008, 1), +(1008, 8455, 2), +(1008, 10169, 3), +(1008, 10170, 4), +(1008, 27130, 5), +(1008, 33946, 6), +(1008, 43017, 7), + -- Ancestral Awakening +(51556, 51556, 1), +(51556, 51557, 2), +(51556, 51558, 3), + -- Ancestral Fortitude +(16177, 16177, 1), +(16177, 16236, 2), +(16177, 16237, 3), + -- Ancestral Healing +(16176, 16176, 1), +(16176, 16235, 2), +(16176, 16240, 3), + -- Ancestral Knowledge +(17485, 17485, 1), +(17485, 17486, 2), +(17485, 17487, 3), +(17485, 17488, 4), +(17485, 17489, 5), + -- Ancestral Spirit +(2008, 2008, 1), +(2008, 20609, 2), +(2008, 20610, 3), +(2008, 20776, 4), +(2008, 20777, 5), +(2008, 25590, 6), +(2008, 49277, 7), + -- Anguish +(33704, 33704, 1), +(33704, 33705, 2), +(33704, 33706, 3), + -- Anguish +(33698, 33698, 1), +(33698, 33699, 2), +(33698, 33700, 3), +(33698, 47993, 4), + -- Animal Handler +(34453, 34453, 1), +(34453, 34454, 2), + -- Annihilation +(51468, 51468, 1), +(51468, 51472, 2), +(51468, 51473, 3), + -- Anticipation +(12297, 12297, 1), +(12297, 12750, 2), +(12297, 12751, 3), +(12297, 12752, 4), +(12297, 12753, 5), + -- Anticipation +(20096, 20096, 1), +(20096, 20097, 2), +(20096, 20098, 3), +(20096, 20099, 4), +(20096, 20100, 5), + -- Anticipation +(16254, 16254, 1), +(16254, 16271, 2), +(16254, 16272, 3), + -- Anticipation +(55129, 55129, 1), +(55129, 55130, 2), +(55129, 55131, 3), +(55129, 55132, 4), +(55129, 55133, 5), + -- Arcane Barrage +(44425, 44425, 1), +(44425, 44780, 2), +(44425, 44781, 3), + -- Arcane Blast +(30451, 30451, 1), +(30451, 42894, 2), +(30451, 42896, 3), +(30451, 42897, 4), + -- Arcane Brilliance +(23028, 23028, 1), +(23028, 27127, 2), +(23028, 43002, 3), + -- Arcane Concentration +(11213, 11213, 1), +(11213, 12574, 2), +(11213, 12575, 3), +(11213, 12576, 4), +(11213, 12577, 5), + -- Arcane Empowerment +(31579, 31579, 1), +(31579, 31582, 2), +(31579, 31583, 3), + -- Arcane Explosion +(1449, 1449, 1), +(1449, 8437, 2), +(1449, 8438, 3), +(1449, 8439, 4), +(1449, 10201, 5), +(1449, 10202, 6), +(1449, 27080, 7), +(1449, 27082, 8), +(1449, 42920, 9), +(1449, 42921, 10), + -- Arcane Flows +(44378, 44378, 1), +(44378, 44379, 2), + -- Arcane Focus +(11222, 11222, 1), +(11222, 12839, 2), +(11222, 12840, 3), + -- Arcane Fortitude +(28574, 28574, 1), +(28574, 54658, 2), +(28574, 54659, 3), + -- Arcane Instability +(15058, 15058, 1), +(15058, 15059, 2), +(15058, 15060, 3), + -- Arcane Intellect +(1459, 1459, 1), +(1459, 1460, 2), +(1459, 1461, 3), +(1459, 10156, 4), +(1459, 10157, 5), +(1459, 27126, 6), +(1459, 42995, 7), + -- Arcane Mastery +(16734, 16734, 1), +(16734, 16735, 2), +(16734, 16736, 3), +(16734, 16737, 4), +(16734, 16738, 5), + -- Arcane Meditation +(18462, 18462, 1), +(18462, 18463, 2), +(18462, 18464, 3), + -- Arcane Mind +(11232, 11232, 1), +(11232, 12500, 2), +(11232, 12501, 3), +(11232, 12502, 4), +(11232, 12503, 5), + -- Arcane Potency +(31571, 31571, 1), +(31571, 31572, 2), + -- Arcane Shielding +(11252, 11252, 1), +(11252, 12605, 2), + -- Arcane Shot +(3044, 3044, 1), +(3044, 14281, 2), +(3044, 14282, 3), +(3044, 14283, 4), +(3044, 14284, 5), +(3044, 14285, 6), +(3044, 14286, 7), +(3044, 14287, 8), +(3044, 27019, 9), +(3044, 49044, 10), +(3044, 49045, 11), + -- Arcane Stability +(11237, 11237, 1), +(11237, 12463, 2), +(11237, 12464, 3), +(11237, 16769, 4), +(11237, 16770, 5), + -- Arcane Subtlety +(11210, 11210, 1), +(11210, 12592, 2), + -- Arctic Reach +(16757, 16757, 1), +(16757, 16758, 2), + -- Arctic Winds +(31674, 31674, 1), +(31674, 31675, 2), +(31674, 31676, 3), +(31674, 31677, 4), +(31674, 31678, 5), + -- Ardent Defender +(31850, 31850, 1), +(31850, 31851, 2), +(31850, 31852, 3), + -- Armor +(8091, 8091, 1), +(8091, 8094, 2), +(8091, 8095, 3), +(8091, 12175, 4), +(8091, 33079, 5), +(8091, 43196, 6), +(8091, 58452, 7), +(8091, 58453, 8), + -- Armored to the Teeth +(61216, 61216, 1), +(61216, 61221, 2), +(61216, 61222, 3), + -- Aspect of the Dragonhawk +(61846, 61846, 1), +(61846, 61847, 2), + -- Aspect of the Hawk +(13165, 13165, 1), +(13165, 14318, 2), +(13165, 14319, 3), +(13165, 14320, 4), +(13165, 14321, 5), +(13165, 14322, 6), +(13165, 25296, 7), +(13165, 27044, 8), + -- Aspect of the Wild +(20043, 20043, 1), +(20043, 20190, 2), +(20043, 27045, 3), +(20043, 49071, 4), + -- Aspiration +(47507, 47507, 1), +(47507, 47508, 2), + -- Astral Shift +(51474, 51474, 1), +(51474, 51478, 2), +(51474, 51479, 3), + -- Avenger's Shield +(31935, 31935, 1), +(31935, 32699, 2), +(31935, 32700, 3), +(31935, 48826, 4), +(31935, 48827, 5), + -- Backdraft +(47258, 47258, 1), +(47258, 47259, 2), +(47258, 47260, 3), + -- Backlash +(34935, 34935, 1), +(34935, 34938, 2), +(34935, 34939, 3), + -- Backstab +(53, 53, 1), +(53, 2589, 2), +(53, 2590, 3), +(53, 2591, 4), +(53, 8721, 5), +(53, 11279, 6), +(53, 11280, 7), +(53, 11281, 8), +(53, 25300, 9), +(53, 26863, 10), +(53, 48656, 11), +(53, 48657, 12), + -- Bad Attitude +(50433, 50433, 1), +(50433, 52395, 2), +(50433, 52396, 3), +(50433, 52397, 4), +(50433, 52398, 5), +(50433, 52399, 6), + -- Balance of Power +(33592, 33592, 1), +(33592, 33596, 2), + -- Bane +(17788, 17788, 1), +(17788, 17789, 2), +(17788, 17790, 3), +(17788, 17791, 4), +(17788, 17792, 5), + -- Banish +(710, 710, 1), +(710, 18647, 2), + -- Barrage +(19461, 19461, 1), +(19461, 19462, 2), +(19461, 24691, 3), + -- Bash +(5211, 5211, 1), +(5211, 6798, 2), +(5211, 8983, 3), + -- Battle Shout +(6673, 6673, 1), +(6673, 5242, 2), +(6673, 6192, 3), +(6673, 11549, 4), +(6673, 11550, 5), +(6673, 11551, 6), +(6673, 25289, 7), +(6673, 2048, 8), +(6673, 47436, 9), + -- Benediction +(20101, 20101, 1), +(20101, 20102, 2), +(20101, 20103, 3), +(20101, 20104, 4), +(20101, 20105, 5), + -- Bestial Discipline +(19590, 19590, 1), +(19590, 19592, 2), + -- Bestial Fury +(19603, 19603, 1), +(19603, 19605, 2), +(19603, 19606, 3), +(19603, 19607, 4), +(19603, 19608, 5), + -- Binding Heal +(32546, 32546, 1), +(32546, 48119, 2), +(32546, 48120, 3), + -- Bite +(17254, 17254, 1), +(17254, 17262, 2), +(17254, 17263, 3), +(17254, 17264, 4), +(17254, 17265, 5), +(17254, 17266, 6), +(17254, 17267, 7), +(17254, 17268, 8), +(17254, 27348, 9), + -- Bite +(17253, 17253, 1), +(17253, 17255, 2), +(17253, 17256, 3), +(17253, 17257, 4), +(17253, 17258, 5), +(17253, 17259, 6), +(17253, 17260, 7), +(17253, 17261, 8), +(17253, 27050, 9), +(17253, 52473, 10), +(17253, 52474, 11), + -- Black Arrow +(3674, 3674, 1), +(3674, 63668, 2), +(3674, 63669, 3), +(3674, 63670, 4), +(3674, 63671, 5), +(3674, 63672, 6), + -- Black Ice +(49140, 49140, 1), +(49140, 49661, 2), +(49140, 49662, 3), +(49140, 49663, 4), +(49140, 49664, 5), + -- Blacksmithing +(2018, 2018, 1), +(2018, 3100, 2), +(2018, 3538, 3), +(2018, 9785, 4), +(2018, 29844, 5), +(2018, 51300, 6), + -- Blade Barrier +(51789, 51789, 1), +(51789, 64855, 2), +(51789, 64856, 3), +(51789, 64858, 4), +(51789, 64859, 5), + -- Blade Barrier +(49182, 49182, 1), +(49182, 49500, 2), +(49182, 49501, 3), +(49182, 55225, 4), +(49182, 55226, 5), + -- Blade Twisting +(31124, 31124, 1), +(31124, 31126, 2), + -- Bladed Armor +(48978, 48978, 1), +(48978, 49390, 2), +(48978, 49391, 3), +(48978, 49392, 4), +(48978, 49393, 5), + -- Blast Wave +(11113, 11113, 1), +(11113, 13018, 2), +(11113, 13019, 3), +(11113, 13020, 4), +(11113, 13021, 5), +(11113, 27133, 6), +(11113, 33933, 7), +(11113, 42944, 8), +(11113, 42945, 9), + -- Blazing Speed +(31641, 31641, 1), +(31641, 31642, 2), + -- Blessed Hands +(53660, 53660, 1), +(53660, 53661, 2), + -- Blessed Life +(31828, 31828, 1), +(31828, 31829, 2), +(31828, 31830, 3), + -- Blessing of Might +(19740, 19740, 1), +(19740, 19834, 2), +(19740, 19835, 3), +(19740, 19836, 4), +(19740, 19837, 5), +(19740, 19838, 6), +(19740, 25291, 7), +(19740, 27140, 8), +(19740, 48931, 9), +(19740, 48932, 10), + -- Blessing of the Eternals +(51554, 51554, 1), +(51554, 51555, 2), + -- Blessing of Wisdom +(19742, 19742, 1), +(19742, 19850, 2), +(19742, 19852, 3), +(19742, 19853, 4), +(19742, 19854, 5), +(19742, 25290, 6), +(19742, 27142, 7), +(19742, 48935, 8), +(19742, 48936, 9), + -- Blood Boil +(48721, 48721, 1), +(48721, 49939, 2), +(48721, 49940, 3), +(48721, 49941, 4), + -- Blood Craze +(16487, 16487, 1), +(16487, 16489, 2), +(16487, 16492, 3), + -- Blood Frenzy +(30069, 30069, 1), +(30069, 30070, 2), + -- Blood Frenzy +(29836, 29836, 1), +(29836, 29859, 2), + -- Blood Frenzy +(16952, 16952, 1), +(16952, 16954, 2), + -- Blood of Icewater +(50122, 50122, 1), +(50122, 50123, 2), +(50122, 50124, 3), +(50122, 50125, 4), +(50122, 50126, 5), + -- Blood of the North +(54639, 54639, 1), +(54639, 54638, 2), +(54639, 54637, 3), + -- Blood of the Rhino +(53481, 53481, 1), +(53481, 53482, 2), + -- Blood Pact +(6307, 6307, 1), +(6307, 7804, 2), +(6307, 7805, 3), +(6307, 11766, 4), +(6307, 11767, 5), +(6307, 27268, 6), +(6307, 47982, 7), + -- Blood Spatter +(51632, 51632, 1), +(51632, 51633, 2), + -- Blood-Caked Blade +(49219, 49219, 1), +(49219, 49627, 2), +(49219, 49628, 3), + -- Bloodsurge +(46913, 46913, 1), +(46913, 46914, 2), +(46913, 46915, 3), + -- Bloodthirsty +(53186, 53186, 1), +(53186, 53187, 2), + -- Bloodworms +(49027, 49027, 1), +(49027, 49542, 2), +(49027, 49543, 3), + -- Bloody Strikes +(48977, 48977, 1), +(48977, 49394, 2), +(48977, 49395, 3), + -- Bloody Vengeance +(48988, 48988, 1), +(48988, 49503, 2), +(48988, 49504, 3), + -- Body and Soul +(64127, 64127, 1), +(64127, 64129, 2), + -- Booming Echoes +(63370, 63370, 1), +(63370, 63372, 2), + -- Booming Voice +(12321, 12321, 1), +(12321, 12835, 2), + -- Borrowed Time +(52795, 52795, 1), +(52795, 52797, 2), +(52795, 52798, 3), +(52795, 52799, 4), +(52795, 52800, 5), + -- Brain Freeze +(44546, 44546, 1), +(44546, 44548, 2), +(44546, 44549, 3), + -- Brambles +(16836, 16836, 1), +(16836, 16839, 2), +(16836, 16840, 3), + -- Brutal Impact +(16940, 16940, 1), +(16940, 16941, 2), + -- Burning Determination +(54747, 54747, 1), +(54747, 54749, 2), + -- Burning Soul +(11083, 11083, 1), +(11083, 12351, 2), + -- Burnout +(44449, 44449, 1), +(44449, 44469, 2), +(44449, 44470, 3), +(44449, 44471, 4), +(44449, 44472, 5), + -- Butchery +(48979, 48979, 1), +(48979, 49483, 2), + -- Call of Flame +(16038, 16038, 1), +(16038, 16160, 2), +(16038, 16161, 3), + -- Camouflage +(13975, 13975, 1), +(13975, 14062, 2), +(13975, 14063, 3), + -- Careful Aim +(34482, 34482, 1), +(34482, 34483, 2), +(34482, 34484, 3), + -- Cataclysm +(17778, 17778, 1), +(17778, 17779, 2), +(17778, 17780, 3), + -- Catlike Reflexes +(34462, 34462, 1), +(34462, 34464, 2), +(34462, 34465, 3), + -- Celestial Focus +(16850, 16850, 1), +(16850, 16923, 2), +(16850, 16924, 3), + -- Chain Heal +(1064, 1064, 1), +(1064, 10622, 2), +(1064, 10623, 3), +(1064, 25422, 4), +(1064, 25423, 5), +(1064, 55458, 6), +(1064, 55459, 7), + -- Chains of Ice +(113, 113, 1), +(113, 512, 2), + -- Chaos Bolt +(50796, 50796, 1), +(50796, 59170, 2), +(50796, 59171, 3), +(50796, 59172, 4), + -- Charge +(100, 100, 1), +(100, 6178, 2), +(100, 11578, 3), + -- Charge Rage Bonus Effect +(12695, 12695, 1), +(12695, 12696, 2), + -- Cheat Death +(31228, 31228, 1), +(31228, 31229, 2), +(31228, 31230, 3), + -- Chilblains +(50040, 50040, 1), +(50040, 50041, 2), +(50040, 50043, 3), + -- Chill of the Grave +(49149, 49149, 1), +(49149, 50115, 2), + -- Chilled +(12484, 12484, 1), +(12484, 12485, 2), +(12484, 12486, 3), + -- Chilled to the Bone +(44566, 44566, 1), +(44566, 44567, 2), +(44566, 44568, 3), +(44566, 44570, 4), +(44566, 44571, 5), + -- Circle of Healing +(34861, 34861, 1), +(34861, 34863, 2), +(34861, 34864, 3), +(34861, 34865, 4), +(34861, 34866, 5), +(34861, 48088, 6), +(34861, 48089, 7), + -- Claw +(1082, 1082, 1), +(1082, 3029, 2), +(1082, 5201, 3), +(1082, 9849, 4), +(1082, 9850, 5), +(1082, 27000, 6), +(1082, 48569, 7), +(1082, 48570, 8), + -- Claw +(16827, 16827, 1), +(16827, 16828, 2), +(16827, 16829, 3), +(16827, 16830, 4), +(16827, 16831, 5), +(16827, 16832, 6), +(16827, 3010, 7), +(16827, 3009, 8), +(16827, 27049, 9), +(16827, 52471, 10), +(16827, 52472, 11), + -- Cleave +(30214, 30214, 1), +(30214, 30222, 2), +(30214, 30224, 3), + -- Cleave +(845, 845, 1), +(845, 7369, 2), +(845, 11608, 3), +(845, 11609, 4), +(845, 20569, 5), +(845, 25231, 6), +(845, 47519, 7), +(845, 47520, 8), + -- Cleave +(30213, 30213, 1), +(30213, 30219, 2), +(30213, 30223, 3), +(30213, 47994, 4), + -- Cleave Armor +(5508, 5508, 1), +(5508, 5480, 2), + -- Close Quarters Combat +(13706, 13706, 1), +(13706, 13804, 2), +(13706, 13805, 3), +(13706, 13806, 4), +(13706, 13807, 5), + -- Cobra Reflexes +(61682, 61682, 1), +(61682, 61683, 2), + -- Cobra Strikes +(53256, 53256, 1), +(53256, 53259, 2), +(53256, 53260, 3), + -- Cold as Ice +(55091, 55091, 1), +(55091, 55092, 2), + -- Combat Endurance +(17427, 17427, 1), +(17427, 17428, 2), +(17427, 17429, 3), + -- Combat Experience +(34475, 34475, 1), +(34475, 34476, 2), + -- Combat Expertise +(31858, 31858, 1), +(31858, 31859, 2), +(31858, 31860, 3), + -- Combat Potency +(35542, 35542, 1), +(35542, 35545, 2), +(35542, 35546, 3), +(35542, 35547, 4), +(35542, 35548, 5), + -- Combat Potency +(35541, 35541, 1), +(35541, 35550, 2), +(35541, 35551, 3), +(35541, 35552, 4), +(35541, 35553, 5), + -- Commanding Presence +(12318, 12318, 1), +(12318, 12857, 2), +(12318, 12858, 3), +(12318, 12860, 4), +(12318, 12861, 5), + -- Commanding Shout +(469, 469, 1), +(469, 47439, 2), +(469, 47440, 3), + -- Concussion +(16035, 16035, 1), +(16035, 16105, 2), +(16035, 16106, 3), +(16035, 16107, 4), +(16035, 16108, 5), + -- Concussive Barrage +(35100, 35100, 1), +(35100, 35102, 2), + -- Cone of Cold +(120, 120, 1), +(120, 8492, 2), +(120, 10159, 3), +(120, 10160, 4), +(120, 10161, 5), +(120, 27087, 6), +(120, 42930, 7), +(120, 42931, 8), + -- Conjure Food +(587, 587, 1), +(587, 597, 2), +(587, 990, 3), +(587, 6129, 4), +(587, 10144, 5), +(587, 10145, 6), +(587, 28612, 7), +(587, 33717, 8), + -- Conjure Mana Gem +(759, 759, 1), +(759, 3552, 2), +(759, 10053, 3), +(759, 10054, 4), +(759, 27101, 5), +(759, 42985, 6), + -- Conjure Refreshment +(42955, 42955, 1), +(42955, 42956, 2), + -- Conjure Water +(5504, 5504, 1), +(5504, 5505, 2), +(5504, 5506, 3), +(5504, 6127, 4), +(5504, 10138, 5), +(5504, 10139, 6), +(5504, 10140, 7), +(5504, 37420, 8), +(5504, 27090, 9), + -- Consecration +(26573, 26573, 1), +(26573, 20116, 2), +(26573, 20922, 3), +(26573, 20923, 4), +(26573, 20924, 5), +(26573, 27173, 6), +(26573, 48818, 7), +(26573, 48819, 8), + -- Consume Shadows +(17767, 17767, 1), +(17767, 17850, 2), +(17767, 17851, 3), +(17767, 17852, 4), +(17767, 17853, 5), +(17767, 17854, 6), +(17767, 27272, 7), +(17767, 47987, 8), +(17767, 47988, 9), + -- Contagion +(30060, 30060, 1), +(30060, 30061, 2), +(30060, 30062, 3), +(30060, 30063, 4), +(30060, 30064, 5), + -- Convection +(16039, 16039, 1), +(16039, 16109, 2), +(16039, 16110, 3), +(16039, 16111, 4), +(16039, 16112, 5), + -- Conviction +(20117, 20117, 1), +(20117, 20118, 2), +(20117, 20119, 3), +(20117, 20120, 4), +(20117, 20121, 5), + -- Cooking +(2550, 2550, 1), +(2550, 3102, 2), +(2550, 3413, 3), +(2550, 18260, 4), +(2550, 33359, 5), +(2550, 51296, 6), + -- Cornered +(52234, 52234, 1), +(52234, 53497, 2), + -- Corpse Explosion +(49158, 49158, 1), +(49158, 51325, 2), +(49158, 51326, 3), +(49158, 51327, 4), +(49158, 51328, 5), + -- Corruption +(172, 172, 1), +(172, 6222, 2), +(172, 6223, 3), +(172, 7648, 4), +(172, 11671, 5), +(172, 11672, 6), +(172, 25311, 7), +(172, 27216, 8), +(172, 47812, 9), +(172, 47813, 10), + -- Counterattack +(19306, 19306, 1), +(19306, 20909, 2), +(19306, 20910, 3), +(19306, 27067, 4), +(19306, 48998, 5), +(19306, 48999, 6), + -- Cower +(8998, 8998, 1), +(8998, 9000, 2), +(8998, 9892, 3), +(8998, 31709, 4), +(8998, 27004, 5), +(8998, 48575, 6), + -- Create Firestone +(6366, 6366, 1), +(6366, 17951, 2), +(6366, 17952, 3), +(6366, 17953, 4), +(6366, 27250, 5), +(6366, 60219, 6), +(6366, 60220, 7), + -- Create Healthstone +(6201, 6201, 1), +(6201, 6202, 2), +(6201, 5699, 3), +(6201, 11729, 4), +(6201, 11730, 5), +(6201, 27230, 6), +(6201, 47871, 7), +(6201, 47878, 8), + -- Create Soulstone +(693, 693, 1), +(693, 20752, 2), +(693, 20755, 3), +(693, 20756, 4), +(693, 20757, 5), +(693, 27238, 6), +(693, 47884, 7), + -- Create Spellstone +(2362, 2362, 1), +(2362, 17727, 2), +(2362, 17728, 3), +(2362, 28172, 4), +(2362, 47886, 5), +(2362, 47888, 6), + -- Critical Block +(47294, 47294, 1), +(47294, 47295, 2), +(47294, 47296, 3), + -- Critical Mass +(11115, 11115, 1), +(11115, 11367, 2), +(11115, 11368, 3), + -- Cruelty +(12320, 12320, 1), +(12320, 12852, 2), +(12320, 12853, 3), +(12320, 12855, 4), +(12320, 12856, 5), + -- Crusade +(31866, 31866, 1), +(31866, 31867, 2), +(31866, 31868, 3), + -- Crypt Fever +(49032, 49032, 1), +(49032, 49631, 2), +(49032, 49632, 3), + -- Culling the Herd +(61680, 61680, 1), +(61680, 61681, 2), +(61680, 52858, 3), + -- Curse of Agony +(980, 980, 1), +(980, 1014, 2), +(980, 6217, 3), +(980, 11711, 4), +(980, 11712, 5), +(980, 11713, 6), +(980, 27218, 7), +(980, 47863, 8), +(980, 47864, 9), + -- Curse of Doom +(603, 603, 1), +(603, 30910, 2), +(603, 47867, 3), + -- Curse of the Elements +(1490, 1490, 1), +(1490, 11721, 2), +(1490, 11722, 3), +(1490, 27228, 4), +(1490, 47865, 5), + -- Curse of Tongues +(1714, 1714, 1), +(1714, 11719, 2), + -- Curse of Weakness +(702, 702, 1), +(702, 1108, 2), +(702, 6205, 3), +(702, 7646, 4), +(702, 11707, 5), +(702, 11708, 6), +(702, 27224, 7), +(702, 30909, 8), +(702, 50511, 9), + -- Cut to the Chase +(51664, 51664, 1), +(51664, 51665, 2), +(51664, 51667, 3), +(51664, 51668, 4), +(51664, 51669, 5), + -- Damage Shield +(58872, 58872, 1), +(58872, 58874, 2), + -- Dampen Magic +(1266, 1266, 1), +(1266, 8452, 2), +(1266, 8453, 3), +(1266, 10175, 4), +(1266, 10176, 5), + -- Dampen Magic +(604, 604, 1), +(604, 8450, 2), +(604, 8451, 3), +(604, 10173, 4), +(604, 10174, 5), +(604, 33944, 6), +(604, 43015, 7), + -- Dark Conviction +(48987, 48987, 1), +(48987, 49477, 2), +(48987, 49478, 3), +(48987, 49479, 4), +(48987, 49480, 5), + -- Dark Pact +(18220, 18220, 1), +(18220, 18937, 2), +(18220, 18938, 3), +(18220, 27265, 4), +(18220, 59092, 5), + -- Darkness +(15259, 15259, 1), +(15259, 15307, 2), +(15259, 15308, 3), +(15259, 15309, 4), +(15259, 15310, 5), + -- Dash +(1850, 1850, 1), +(1850, 9821, 2), +(1850, 33357, 3), + -- Deadened Nerves +(31380, 31380, 1), +(31380, 31382, 2), +(31380, 31383, 3), + -- Deadliness +(30902, 30902, 1), +(30902, 30903, 2), +(30902, 30904, 3), +(30902, 30905, 4), +(30902, 30906, 5), + -- Deadly Brew +(51625, 51625, 1), +(51625, 51626, 2), + -- Deadly Throw +(26679, 26679, 1), +(26679, 48673, 2), +(26679, 48674, 3), + -- Death and Decay +(43265, 43265, 1), +(43265, 49936, 2), +(43265, 49937, 3), +(43265, 49938, 4), + -- Death Coil +(6789, 6789, 1), +(6789, 17925, 2), +(6789, 17926, 3), +(6789, 27223, 4), +(6789, 47859, 5), +(6789, 47860, 6), + -- Death Coil +(62900, 62900, 1), +(62900, 62901, 2), +(62900, 62902, 3), +(62900, 62903, 4), +(62900, 62904, 5), + -- Death Strike +(49998, 49998, 1), +(49998, 49999, 2), +(49998, 45463, 3), +(49998, 49923, 4), +(49998, 49924, 5), + -- Death's Embrace +(47198, 47198, 1), +(47198, 47199, 2), +(47198, 47200, 3), + -- Decimation +(63156, 63156, 1), +(63156, 63158, 2), + -- Deep Wounds +(12162, 12162, 1), +(12162, 12850, 2), +(12162, 12868, 3), + -- Deep Wounds +(12834, 12834, 1), +(12834, 12849, 2), +(12834, 12867, 3), + -- Defensive Tactics +(29559, 29559, 1), +(29559, 29588, 2), +(29559, 29589, 3), + -- Defiance +(12303, 12303, 1), +(12303, 12788, 2), +(12303, 12789, 3), + -- Deflection +(16462, 16462, 1), +(16462, 16463, 2), +(16462, 16464, 3), +(16462, 16465, 4), +(16462, 16466, 5), + -- Deflection +(13713, 13713, 1), +(13713, 13853, 2), +(13713, 13854, 3), + -- Deflection +(19295, 19295, 1), +(19295, 19297, 2), +(19295, 19298, 3), + -- Deflection +(20060, 20060, 1), +(20060, 20061, 2), +(20060, 20062, 3), +(20060, 20063, 4), +(20060, 20064, 5), + -- Demon Armor +(706, 706, 1), +(706, 1086, 2), +(706, 11733, 3), +(706, 11734, 4), +(706, 11735, 5), +(706, 27260, 6), +(706, 47793, 7), +(706, 47889, 8), + -- Demon Skin +(687, 687, 1), +(687, 696, 2), + -- Demonic Aegis +(30143, 30143, 1), +(30143, 30144, 2), +(30143, 30145, 3), + -- Demonic Brutality +(18705, 18705, 1), +(18705, 18706, 2), +(18705, 18707, 3), + -- Demonic Embrace +(18697, 18697, 1), +(18697, 18698, 2), +(18697, 18699, 3), + -- Demonic Knowledge +(35691, 35691, 1), +(35691, 35692, 2), +(35691, 35693, 3), + -- Demonic Pact +(47236, 47236, 1), +(47236, 47237, 2), +(47236, 47238, 3), +(47236, 47239, 4), +(47236, 47240, 5), + -- Demonic Power +(18126, 18126, 1), +(18126, 18127, 2), + -- Demonic Resilience +(30319, 30319, 1), +(30319, 30320, 2), +(30319, 30321, 3), + -- Demonic Tactics +(30242, 30242, 1), +(30242, 30245, 2), +(30242, 30246, 3), +(30242, 30247, 4), +(30242, 30248, 5), + -- Demoralizing Roar +(99, 99, 1), +(99, 1735, 2), +(99, 9490, 3), +(99, 9747, 4), +(99, 9898, 5), +(99, 26998, 6), +(99, 48559, 7), +(99, 48560, 8), + -- Demoralizing Screech +(24424, 24424, 1), +(24424, 24580, 2), +(24424, 24581, 3), +(24424, 24582, 4), +(24424, 27349, 5), + -- Demoralizing Screech +(24423, 24423, 1), +(24423, 24577, 2), +(24423, 24578, 3), +(24423, 24579, 4), +(24423, 27051, 5), +(24423, 55487, 6), + -- Demoralizing Shout +(1160, 1160, 1), +(1160, 6190, 2), +(1160, 11554, 3), +(1160, 11555, 4), +(1160, 11556, 5), +(1160, 25202, 6), +(1160, 25203, 7), +(1160, 47437, 8), + -- Desecration +(55666, 55666, 1), +(55666, 55667, 2), + -- Desperate Prayer +(19236, 19236, 1), +(19236, 19238, 2), +(19236, 19240, 3), +(19236, 19241, 4), +(19236, 19242, 5), +(19236, 19243, 6), +(19236, 25437, 7), +(19236, 48172, 8), +(19236, 48173, 9), + -- Destructive Reach +(17917, 17917, 1), +(17917, 17918, 2), + -- Destructive Soul +(30251, 30251, 1), +(30251, 30256, 2), + -- Devastate +(20243, 20243, 1), +(20243, 30016, 2), +(20243, 30022, 3), +(20243, 47497, 4), +(20243, 47498, 5), + -- Devotion Aura +(465, 465, 1), +(465, 10290, 2), +(465, 643, 3), +(465, 10291, 4), +(465, 1032, 5), +(465, 10292, 6), +(465, 10293, 7), +(465, 27149, 8), +(465, 48941, 9), +(465, 48942, 10), + -- Devour Magic +(19505, 19505, 1), +(19505, 19731, 2), +(19505, 19734, 3), +(19505, 19736, 4), +(19505, 27276, 5), +(19505, 27277, 6), +(19505, 48011, 7), + -- Devouring Plague +(2944, 2944, 1), +(2944, 19276, 2), +(2944, 19277, 3), +(2944, 19278, 4), +(2944, 19279, 5), +(2944, 19280, 6), +(2944, 25467, 7), +(2944, 48299, 8), +(2944, 48300, 9), + -- Dirge +(49223, 49223, 1), +(49223, 49599, 2), + -- Dirty Deeds +(14082, 14082, 1), +(14082, 14083, 2), + -- Dirty Tricks +(14076, 14076, 1), +(14076, 14094, 2), + -- Dispel Magic +(527, 527, 1), +(527, 988, 2), + -- Displacement +(34478, 34478, 1), +(34478, 34479, 2), +(34478, 34481, 3), + -- Dive +(23146, 23146, 1), +(23146, 23149, 2), +(23146, 23150, 3), + -- Divine Aegis +(47509, 47509, 1), +(47509, 47511, 2), +(47509, 47515, 3), + -- Divine Fury +(18530, 18530, 1), +(18530, 18531, 2), +(18530, 18533, 3), +(18530, 18534, 4), +(18530, 18535, 5), + -- Divine Guardian +(53527, 53527, 1), +(53527, 53530, 2), + -- Divine Intellect +(20257, 20257, 1), +(20257, 20258, 2), +(20257, 20259, 3), +(20257, 20260, 4), +(20257, 20261, 5), + -- Divine Providence +(47562, 47562, 1), +(47562, 47564, 2), +(47562, 47565, 3), +(47562, 47566, 4), +(47562, 47567, 5), + -- Divine Purpose +(31871, 31871, 1), +(31871, 31872, 2), + -- Divine Spirit +(14752, 14752, 1), +(14752, 14818, 2), +(14752, 14819, 3), +(14752, 27841, 4), +(14752, 25312, 5), +(14752, 48073, 6), + -- Divine Strength +(20262, 20262, 1), +(20262, 20263, 2), +(20262, 20264, 3), +(20262, 20265, 4), +(20262, 20266, 5), + -- Divinity +(63646, 63646, 1), +(63646, 63647, 2), +(63646, 63648, 3), +(63646, 63649, 4), +(63646, 63650, 5), + -- Dragon's Breath +(31661, 31661, 1), +(31661, 33041, 2), +(31661, 33042, 3), +(31661, 33043, 4), +(31661, 42949, 5), +(31661, 42950, 6), + -- Drain Life +(689, 689, 1), +(689, 699, 2), +(689, 709, 3), +(689, 7651, 4), +(689, 11699, 5), +(689, 11700, 6), +(689, 27219, 7), +(689, 27220, 8), +(689, 47857, 9), + -- Drain Soul +(1120, 1120, 1), +(1120, 8288, 2), +(1120, 8289, 3), +(1120, 11675, 4), +(1120, 27217, 5), +(1120, 47855, 6), + -- Dreamstate +(33597, 33597, 1), +(33597, 33599, 2), +(33597, 33956, 3), + -- Dual Wield Specialization +(13715, 13715, 1), +(13715, 13848, 2), +(13715, 13849, 3), +(13715, 13851, 4), +(13715, 13852, 5), + -- Dual Wield Specialization +(23584, 23584, 1), +(23584, 23585, 2), +(23584, 23586, 3), +(23584, 23587, 4), +(23584, 23588, 5), + -- Dual Wield Specialization +(30816, 30816, 1), +(30816, 30818, 2), +(30816, 30819, 3), + -- Earth and Moon +(48506, 48506, 1), +(48506, 48510, 2), +(48506, 48511, 3), + -- Earth Shield +(974, 974, 1), +(974, 32593, 2), +(974, 32594, 3), +(974, 49283, 4), +(974, 49284, 5), + -- Earth Shock +(8042, 8042, 1), +(8042, 8044, 2), +(8042, 8045, 3), +(8042, 8046, 4), +(8042, 10412, 5), +(8042, 10413, 6), +(8042, 10414, 7), +(8042, 25454, 8), +(8042, 49230, 9), +(8042, 49231, 10), + -- Earthen Power +(51523, 51523, 1), +(51523, 51524, 2), + -- Earthliving +(51945, 51945, 1), +(51945, 51990, 2), +(51945, 51997, 3), +(51945, 51998, 4), +(51945, 51999, 5), +(51945, 52000, 6), + -- Earthliving Weapon +(51730, 51730, 1), +(51730, 51988, 2), +(51730, 51991, 3), +(51730, 51992, 4), +(51730, 51993, 5), +(51730, 51994, 6), + -- Earthliving Weapon (Passive) +(51940, 51940, 1), +(51940, 51989, 2), +(51940, 52004, 3), +(51940, 52005, 4), +(51940, 52007, 5), +(51940, 52008, 6), + -- Earth's Grasp +(16043, 16043, 1), +(16043, 16130, 2), + -- Ebon Plaguebringer +(51099, 51099, 1), +(51099, 51160, 2), +(51099, 51161, 3), + -- Eclipse +(48516, 48516, 1), +(48516, 48521, 2), +(48516, 48525, 3), + -- Efficiency +(19416, 19416, 1), +(19416, 19417, 2), +(19416, 19418, 3), +(19416, 19419, 4), +(19416, 19420, 5), + -- Elemental Absorption +(30701, 30701, 1), +(30701, 30702, 2), +(30701, 30703, 3), +(30701, 30704, 4), +(30701, 30705, 5), + -- Elemental Oath +(51466, 51466, 1), +(51466, 51470, 2), + -- Elemental Precision +(30672, 30672, 1), +(30672, 30673, 2), +(30672, 30674, 3), + -- Elemental Reach +(28999, 28999, 1), +(28999, 29000, 2), + -- Elemental Shields +(30669, 30669, 1), +(30669, 30670, 2), +(30669, 30671, 3), + -- Elemental Warding +(28996, 28996, 1), +(28996, 28997, 2), +(28996, 28998, 3), + -- Elemental Weapons +(16266, 16266, 1), +(16266, 29079, 2), +(16266, 29080, 3), + -- Elusiveness +(13981, 13981, 1), +(13981, 14066, 2), + -- Emberstorm +(17954, 17954, 1), +(17954, 17955, 2), +(17954, 17956, 3), +(17954, 17957, 4), +(17954, 17958, 5), + -- Empowered Corruption +(32381, 32381, 1), +(32381, 32382, 2), +(32381, 32383, 3), + -- Empowered Fire +(31656, 31656, 1), +(31656, 31657, 2), +(31656, 31658, 3), + -- Empowered Frostbolt +(31682, 31682, 1), +(31682, 31683, 2), + -- Empowered Healing +(33158, 33158, 1), +(33158, 33159, 2), +(33158, 33160, 3), +(33158, 33161, 4), +(33158, 33162, 5), + -- Empowered Imp +(47220, 47220, 1), +(47220, 47221, 2), +(47220, 47223, 3), + -- Empowered Rejuvenation +(33886, 33886, 1), +(33886, 33887, 2), +(33886, 33888, 3), +(33886, 33889, 4), +(33886, 33890, 5), + -- Empowered Renew +(63534, 63534, 1), +(63534, 63542, 2), +(63534, 63543, 3), + -- Empowered Touch +(33879, 33879, 1), +(33879, 33880, 2), + -- Enchanting +(7411, 7411, 1), +(7411, 7412, 2), +(7411, 7413, 3), +(7411, 13920, 4), +(7411, 28029, 5), +(7411, 51313, 6), + -- Endless Winter +(49137, 49137, 1), +(49137, 49657, 2), + -- Endurance +(13742, 13742, 1), +(13742, 13872, 2), + -- Endurance Training +(19583, 19583, 1), +(19583, 19584, 2), +(19583, 19585, 3), +(19583, 19586, 4), +(19583, 19587, 5), + -- Enduring Winter +(44557, 44557, 1), +(44557, 44560, 2), +(44557, 44561, 3), + -- Engineering +(4036, 4036, 1), +(4036, 4037, 2), +(4036, 4038, 3), +(4036, 12656, 4), +(4036, 30350, 5), +(4036, 51306, 6), + -- Enhancing Totems +(16259, 16259, 1), +(16259, 16295, 2), +(16259, 52456, 3), + -- Enlightened Judgements +(53556, 53556, 1), +(53556, 53557, 2), + -- Enlightenment +(34908, 34908, 1), +(34908, 34909, 2), +(34908, 34910, 3), + -- Enrage +(12317, 12317, 1), +(12317, 13045, 2), +(12317, 13046, 3), +(12317, 13047, 4), +(12317, 13048, 5), + -- Enslave Demon +(1098, 1098, 1), +(1098, 11725, 2), +(1098, 11726, 3), +(1098, 61191, 4), + -- Entangling Roots +(339, 339, 1), +(339, 1062, 2), +(339, 5195, 3), +(339, 5196, 4), +(339, 9852, 5), +(339, 9853, 6), +(339, 26989, 7), +(339, 53308, 8), + -- Entrapment +(19184, 19184, 1), +(19184, 19387, 2), +(19184, 19388, 3), + -- Enveloping Shadows +(31211, 31211, 1), +(31211, 31212, 2), +(31211, 31213, 3), + -- Envenom +(32645, 32645, 1), +(32645, 32684, 2), +(32645, 57992, 3), +(32645, 57993, 4), + -- Epidemic +(49036, 49036, 1), +(49036, 49562, 2), + -- Eradication +(47195, 47195, 1), +(47195, 47196, 2), +(47195, 47197, 3), + -- Evasion +(5277, 5277, 1), +(5277, 26669, 2), + -- Everlasting Affliction +(47201, 47201, 1), +(47201, 47202, 2), +(47201, 47203, 3), +(47201, 47204, 4), +(47201, 47205, 5), + -- Eviscerate +(2098, 2098, 1), +(2098, 6760, 2), +(2098, 6761, 3), +(2098, 6762, 4), +(2098, 8623, 5), +(2098, 8624, 6), +(2098, 11299, 7), +(2098, 11300, 8), +(2098, 31016, 9), +(2098, 26865, 10), +(2098, 48667, 11), +(2098, 48668, 12), + -- Execute +(5308, 5308, 1), +(5308, 20658, 2), +(5308, 20660, 3), +(5308, 20661, 4), +(5308, 20662, 5), +(5308, 25234, 6), +(5308, 25236, 7), +(5308, 47470, 8), +(5308, 47471, 9), + -- Exorcism +(879, 879, 1), +(879, 5614, 2), +(879, 5615, 3), +(879, 10312, 4), +(879, 10313, 5), +(879, 10314, 6), +(879, 27138, 7), +(879, 48800, 8), +(879, 48801, 9), + -- Explosive Shot +(53301, 53301, 1), +(53301, 60051, 2), +(53301, 60052, 3), +(53301, 60053, 4), + -- Explosive Trap +(13813, 13813, 1), +(13813, 14316, 2), +(13813, 14317, 3), +(13813, 27025, 4), +(13813, 49066, 5), +(13813, 49067, 6), + -- Explosive Trap Effect +(13812, 13812, 1), +(13812, 14314, 2), +(13812, 14315, 3), +(13812, 27026, 4), +(13812, 49064, 5), +(13812, 49065, 6), + -- Expose Weakness +(34500, 34500, 1), +(34500, 34502, 2), +(34500, 34503, 3), + -- Eye of the Storm +(29062, 29062, 1), +(29062, 29064, 2), +(29062, 29065, 3), + -- Faerie Fire +(13424, 13424, 1), +(13424, 13752, 2), + -- Fanaticism +(31879, 31879, 1), +(31879, 31880, 2), +(31879, 31881, 3), + -- Fear +(5782, 5782, 1), +(5782, 6213, 2), +(5782, 6215, 3), + -- Feeding Frenzy +(60096, 60096, 1), +(60096, 60097, 2), + -- Feeding Frenzy +(53511, 53511, 1), +(53511, 53512, 2), + -- Feint +(1966, 1966, 1), +(1966, 6768, 2), +(1966, 8637, 3), +(1966, 11303, 4), +(1966, 25302, 5), +(1966, 27448, 6), +(1966, 48658, 7), +(1966, 48659, 8), + -- Fel Armor +(28176, 28176, 1), +(28176, 28189, 2), +(28176, 47892, 3), +(28176, 47893, 4), + -- Fel Concentration +(17783, 17783, 1), +(17783, 17784, 2), +(17783, 17785, 3), + -- Fel Intelligence +(54424, 54424, 1), +(54424, 57564, 2), +(54424, 57565, 3), +(54424, 57566, 4), +(54424, 57567, 5), + -- Fel Synergy +(47230, 47230, 1), +(47230, 47231, 2), + -- Fel Vitality +(18731, 18731, 1), +(18731, 18743, 2), +(18731, 18744, 3), + -- Feral Aggression +(16858, 16858, 1), +(16858, 16859, 2), +(16858, 16860, 3), +(16858, 16861, 4), +(16858, 16862, 5), + -- Feral Instinct +(16947, 16947, 1), +(16947, 16948, 2), +(16947, 16949, 3), + -- Ferocious Bite +(22568, 22568, 1), +(22568, 22827, 2), +(22568, 22828, 3), +(22568, 22829, 4), +(22568, 31018, 5), +(22568, 24248, 6), +(22568, 48576, 7), +(22568, 48577, 8), + -- Ferocious Dead +(49038, 49038, 1), +(49038, 49595, 2), +(49038, 49596, 3), + -- Ferocious Inspiration +(34455, 34455, 1), +(34455, 34459, 2), +(34455, 34460, 3), + -- Ferocity +(19598, 19598, 1), +(19598, 19599, 2), +(19598, 19600, 3), +(19598, 19601, 4), +(19598, 19602, 5), + -- Ferocity +(16934, 16934, 1), +(16934, 16935, 2), +(16934, 16936, 3), +(16934, 16937, 4), +(16934, 16938, 5), + -- Filthy Tricks +(58414, 58414, 1), +(58414, 58415, 2), + -- Find Weakness +(31234, 31234, 1), +(31234, 31235, 2), +(31234, 31236, 3), + -- Fingers of Frost +(44543, 44543, 1), +(44543, 44545, 2), + -- Fire and Brimstone +(47266, 47266, 1), +(47266, 47267, 2), +(47266, 47268, 3), +(47266, 47269, 4), +(47266, 47270, 5), + -- Fire Blast +(2141, 2141, 1), +(2141, 2142, 2), +(2141, 2143, 3), +(2141, 8414, 4), +(2141, 8415, 5), +(2141, 10198, 6), +(2141, 10200, 7), +(2141, 27378, 8), +(2141, 27379, 9), + -- Fire Blast +(2136, 2136, 1), +(2136, 2137, 2), +(2136, 2138, 3), +(2136, 8412, 4), +(2136, 8413, 5), +(2136, 10197, 6), +(2136, 10199, 7), +(2136, 27078, 8), +(2136, 27079, 9), +(2136, 42872, 10), +(2136, 42873, 11), + -- Fire Breath +(34889, 34889, 1), +(34889, 35323, 2), +(34889, 55482, 3), +(34889, 55483, 4), +(34889, 55484, 5), +(34889, 55485, 6), + -- Fire Power +(11124, 11124, 1), +(11124, 12378, 2), +(11124, 12398, 3), +(11124, 12399, 4), +(11124, 12400, 5), + -- Fire Resistance Aura +(19891, 19891, 1), +(19891, 19899, 2), +(19891, 19900, 3), +(19891, 27153, 4), +(19891, 48947, 5), + -- Fire Resistance Totem +(8184, 8184, 1), +(8184, 10537, 2), +(8184, 10538, 3), +(8184, 25563, 4), +(8184, 58737, 5), +(8184, 58739, 6), + -- Fire Shield +(2947, 2947, 1), +(2947, 8316, 2), +(2947, 8317, 3), +(2947, 11770, 4), +(2947, 11771, 5), +(2947, 27269, 6), +(2947, 47983, 7), + -- Fire Shot +(3011, 3011, 1), +(3011, 6979, 2), +(3011, 6980, 3), + -- Fire Ward +(1035, 1035, 1), +(1035, 8459, 2), +(1035, 8460, 3), +(1035, 10224, 4), +(1035, 10226, 5), +(1035, 27395, 6), + -- Fire Ward +(543, 543, 1), +(543, 8457, 2), +(543, 8458, 3), +(543, 10223, 4), +(543, 10225, 5), +(543, 27128, 6), +(543, 43010, 7), + -- Fireball +(133, 133, 1), +(133, 143, 2), +(133, 145, 3), +(133, 3140, 4), +(133, 8400, 5), +(133, 8401, 6), +(133, 8402, 7), +(133, 10148, 8), +(133, 10149, 9), +(133, 10150, 10), +(133, 10151, 11), +(133, 25306, 12), +(133, 27070, 13), +(133, 38692, 14), +(133, 42832, 15), +(133, 42833, 16), + -- Firebolt +(3110, 3110, 1), +(3110, 7799, 2), +(3110, 7800, 3), +(3110, 7801, 4), +(3110, 7802, 5), +(3110, 11762, 6), +(3110, 11763, 7), +(3110, 27267, 8), +(3110, 47964, 9), + -- Firestarter +(44442, 44442, 1), +(44442, 44443, 2), + -- First Aid +(3273, 3273, 1), +(3273, 3274, 2), +(3273, 7924, 3), +(3273, 10846, 4), +(3273, 27028, 5), +(3273, 45542, 6), + -- Flame Shock +(8050, 8050, 1), +(8050, 8052, 2), +(8050, 8053, 3), +(8050, 10447, 4), +(8050, 10448, 5), +(8050, 29228, 6), +(8050, 25457, 7), +(8050, 49232, 8), +(8050, 49233, 9), + -- Flame Throwing +(11100, 11100, 1), +(11100, 12353, 2), + -- Flamestrike +(2120, 2120, 1), +(2120, 2121, 2), +(2120, 8422, 3), +(2120, 8423, 4), +(2120, 10215, 5), +(2120, 10216, 6), +(2120, 27086, 7), +(2120, 42925, 8), +(2120, 42926, 9), + -- Flametongue Totem +(52109, 52109, 1), +(52109, 52110, 2), +(52109, 52111, 3), +(52109, 52112, 4), +(52109, 52113, 5), +(52109, 58651, 6), +(52109, 58654, 7), +(52109, 58655, 8), + -- Flametongue Totem +(8227, 8227, 1), +(8227, 8249, 2), +(8227, 10526, 3), +(8227, 16387, 4), +(8227, 25557, 5), +(8227, 58649, 6), +(8227, 58652, 7), +(8227, 58656, 8), + -- Flametongue Weapon +(8024, 8024, 1), +(8024, 8027, 2), +(8024, 8030, 3), +(8024, 16339, 4), +(8024, 16341, 5), +(8024, 16342, 6), +(8024, 25489, 7), +(8024, 58785, 8), +(8024, 58789, 9), +(8024, 58790, 10), + -- Flametongue Weapon (Passive) +(10400, 10400, 1), +(10400, 15567, 2), +(10400, 15568, 3), +(10400, 15569, 4), +(10400, 16311, 5), +(10400, 16312, 6), +(10400, 16313, 7), +(10400, 58784, 8), +(10400, 58791, 9), +(10400, 58792, 10), + -- Flametongue Weapon Proc +(8026, 8026, 1), +(8026, 8028, 2), +(8026, 8029, 3), +(8026, 10445, 4), +(8026, 16343, 5), +(8026, 16344, 6), +(8026, 25488, 7), +(8026, 58786, 8), +(8026, 58787, 9), +(8026, 58788, 10), + -- Flash Heal +(2061, 2061, 1), +(2061, 9472, 2), +(2061, 9473, 3), +(2061, 9474, 4), +(2061, 10915, 5), +(2061, 10916, 6), +(2061, 10917, 7), +(2061, 25233, 8), +(2061, 25235, 9), +(2061, 48070, 10), +(2061, 48071, 11), + -- Flash of Light +(19750, 19750, 1), +(19750, 19939, 2), +(19750, 19940, 3), +(19750, 19941, 4), +(19750, 19942, 5), +(19750, 19943, 6), +(19750, 27137, 7), +(19750, 48784, 8), +(19750, 48785, 9), + -- Fleet Footed +(31208, 31208, 1), +(31208, 31209, 2), + -- Flurry +(16257, 16257, 1), +(16257, 16277, 2), +(16257, 16278, 3), +(16257, 16279, 4), +(16257, 16280, 5), + -- Flurry +(16256, 16256, 1), +(16256, 16281, 2), +(16256, 16282, 3), +(16256, 16283, 4), +(16256, 16284, 5), + -- Focused Aim +(53620, 53620, 1), +(53620, 53621, 2), +(53620, 53622, 3), + -- Focused Attacks +(51634, 51634, 1), +(51634, 51635, 2), +(51634, 51636, 3), + -- Focused Casting +(14743, 14743, 1), +(14743, 27828, 2), + -- Focused Fire +(35060, 35060, 1), +(35060, 35061, 2), + -- Focused Fire +(35029, 35029, 1), +(35029, 35030, 2), + -- Focused Mind +(33213, 33213, 1), +(33213, 33214, 2), +(33213, 33215, 3), + -- Focused Mind +(30864, 30864, 1), +(30864, 30865, 2), +(30864, 30866, 3), + -- Focused Power +(33186, 33186, 1), +(33186, 33190, 2), + -- Focused Rage +(29787, 29787, 1), +(29787, 29790, 2), +(29787, 29792, 3), + -- Freezing Trap +(1499, 1499, 1), +(1499, 14310, 2), +(1499, 14311, 3), + -- Freezing Trap Effect +(3355, 3355, 1), +(3355, 14308, 2), +(3355, 14309, 3), + -- Frenzy +(19621, 19621, 1), +(19621, 19622, 2), +(19621, 19623, 3), +(19621, 19624, 4), +(19621, 19625, 5), + -- Frigid Dreadplate +(49186, 49186, 1), +(49186, 51108, 2), +(49186, 51109, 3), + -- Frost Armor +(168, 168, 1), +(168, 7300, 2), +(168, 7301, 3), + -- Frost Channeling +(11160, 11160, 1), +(11160, 12518, 2), +(11160, 12519, 3), + -- Frost Nova +(122, 122, 1), +(122, 865, 2), +(122, 6131, 3), +(122, 10230, 4), +(122, 27088, 5), +(122, 42917, 6), + -- Frost Resistance Aura +(19888, 19888, 1), +(19888, 19897, 2), +(19888, 19898, 3), +(19888, 27152, 4), +(19888, 48945, 5), + -- Frost Resistance Totem +(8181, 8181, 1), +(8181, 10478, 2), +(8181, 10479, 3), +(8181, 25560, 4), +(8181, 58741, 5), +(8181, 58745, 6), + -- Frost Shock +(8056, 8056, 1), +(8056, 8058, 2), +(8056, 10472, 3), +(8056, 10473, 4), +(8056, 25464, 5), +(8056, 49235, 6), +(8056, 49236, 7), + -- Frost Ward +(6144, 6144, 1), +(6144, 8463, 2), +(6144, 8464, 3), +(6144, 10178, 4), +(6144, 27396, 5), +(6144, 32797, 6), + -- Frost Ward +(6143, 6143, 1), +(6143, 8461, 2), +(6143, 8462, 3), +(6143, 10177, 4), +(6143, 28609, 5), +(6143, 32796, 6), +(6143, 43012, 7), + -- Frost Warding +(11189, 11189, 1), +(11189, 28332, 2), + -- Frostbite +(11071, 11071, 1), +(11071, 12496, 2), +(11071, 12497, 3), + -- Frostbolt +(116, 116, 1), +(116, 205, 2), +(116, 837, 3), +(116, 7322, 4), +(116, 8406, 5), +(116, 8407, 6), +(116, 8408, 7), +(116, 10179, 8), +(116, 10180, 9), +(116, 10181, 10), +(116, 25304, 11), +(116, 27071, 12), +(116, 27072, 13), +(116, 38697, 14), +(116, 42841, 15), +(116, 42842, 16), + -- Frostbrand Weapon +(8033, 8033, 1), +(8033, 8038, 2), +(8033, 10456, 3), +(8033, 16355, 4), +(8033, 16356, 5), +(8033, 25500, 6), +(8033, 58794, 7), +(8033, 58795, 8), +(8033, 58796, 9), + -- Frostfire Bolt +(44614, 44614, 1), +(44614, 47610, 2), + -- Froststorm Breath +(54644, 54644, 1), +(54644, 55488, 2), +(54644, 55489, 3), +(54644, 55490, 4), +(54644, 55491, 5), +(54644, 55492, 6), + -- Frozen Core +(31667, 31667, 1), +(31667, 31668, 2), +(31667, 31669, 3), + -- Frozen Power +(63373, 63373, 1), +(63373, 63374, 2), + -- Furious Attacks +(46910, 46910, 1), +(46910, 46911, 2), + -- Furious Howl +(24604, 24604, 1), +(24604, 64491, 2), +(24604, 64492, 3), +(24604, 64493, 4), +(24604, 64494, 5), +(24604, 64495, 6), + -- Furor +(17056, 17056, 1), +(17056, 17058, 2), +(17056, 17059, 3), +(17056, 17060, 4), +(17056, 17061, 5), + -- Gag Order +(12311, 12311, 1), +(12311, 12958, 2), + -- Gale Winds +(48488, 48488, 1), +(48488, 48514, 2), + -- Garrote +(703, 703, 1), +(703, 8631, 2), +(703, 8632, 3), +(703, 8633, 4), +(703, 11289, 5), +(703, 11290, 6), +(703, 26839, 7), +(703, 26884, 8), +(703, 48675, 9), +(703, 48676, 10), + -- Genesis +(57810, 57810, 1), +(57810, 57811, 2), +(57810, 57812, 3), +(57810, 57813, 4), +(57810, 57814, 5), + -- Gift of Nature +(17104, 17104, 1), +(17104, 24943, 2), +(17104, 24944, 3), +(17104, 24945, 4), +(17104, 24946, 5), + -- Gift of the Earthmother +(51179, 51179, 1), +(51179, 51180, 2), +(51179, 51181, 3), +(51179, 51182, 4), +(51179, 51183, 5), + -- Gift of the Wild +(21849, 21849, 1), +(21849, 21850, 2), +(21849, 26991, 3), +(21849, 48470, 4), + -- Glacier Rot +(49471, 49471, 1), +(49471, 49790, 2), +(49471, 49791, 3), + -- Go for the Throat +(34952, 34952, 1), +(34952, 34953, 2), + -- Go for the Throat +(34950, 34950, 1), +(34950, 34954, 2), + -- Gore +(35299, 35299, 1), +(35299, 35300, 2), +(35299, 35302, 3), +(35299, 35303, 4), +(35299, 35304, 5), +(35299, 35305, 6), +(35299, 35306, 7), +(35299, 35307, 8), +(35299, 35308, 9), + -- Gore +(35290, 35290, 1), +(35290, 35291, 2), +(35290, 35292, 3), +(35290, 35293, 4), +(35290, 35294, 5), +(35290, 35295, 6), + -- Grace +(47516, 47516, 1), +(47516, 47517, 2), + -- Grace of the Mantis +(53450, 53450, 1), +(53450, 53451, 2), + -- Great Resistance +(53427, 53427, 1), +(53427, 53429, 2), +(53427, 53430, 3), + -- Great Stamina +(4195, 4195, 1), +(4195, 4196, 2), +(4195, 4197, 3), +(4195, 4198, 4), +(4195, 4199, 5), +(4195, 4200, 6), +(4195, 4201, 7), +(4195, 4202, 8), +(4195, 5048, 9), +(4195, 5049, 10), +(4195, 27364, 11), + -- Great Stamina +(61686, 61686, 1), +(61686, 61687, 2), +(61686, 61688, 3), + -- Greater Blessing of Might +(25782, 25782, 1), +(25782, 25916, 2), +(25782, 27141, 3), +(25782, 48933, 4), +(25782, 48934, 5), + -- Greater Blessing of Wisdom +(25894, 25894, 1), +(25894, 25918, 2), +(25894, 27143, 3), +(25894, 48937, 4), +(25894, 48938, 5), + -- Greater Heal +(2060, 2060, 1), +(2060, 10963, 2), +(2060, 10964, 3), +(2060, 10965, 4), +(2060, 25314, 5), +(2060, 25210, 6), +(2060, 25213, 7), +(2060, 48062, 8), +(2060, 48063, 9), + -- Grim Reach +(18218, 18218, 1), +(18218, 18219, 2), + -- Growl +(1853, 1853, 1), +(1853, 14922, 2), +(1853, 14923, 3), +(1853, 14924, 4), +(1853, 14925, 5), +(1853, 14926, 6), +(1853, 14927, 7), +(1853, 27344, 8), + -- Growl +(2649, 2649, 1), +(2649, 14916, 2), +(2649, 14917, 3), +(2649, 14918, 4), +(2649, 14919, 5), +(2649, 14920, 6), +(2649, 14921, 7), +(2649, 27047, 8), +(2649, 61676, 9), + -- Guard Dog +(53178, 53178, 1), +(53178, 53179, 2), + -- Guarded by the Light +(53583, 53583, 1), +(53583, 53585, 2), + -- Guardian Totems +(16258, 16258, 1), +(16258, 16293, 2), + -- Guardian's Favor +(20174, 20174, 1), +(20174, 20175, 2), + -- Guile of Gorefiend +(50187, 50187, 1), +(50187, 50190, 2), +(50187, 50191, 3), + -- Hack and Slash +(13960, 13960, 1), +(13960, 13961, 2), +(13960, 13962, 3), +(13960, 13963, 4), +(13960, 13964, 5), + -- Hammer of Justice +(853, 853, 1), +(853, 5588, 2), +(853, 5589, 3), +(853, 10308, 4), + -- Hammer of Wrath +(24275, 24275, 1), +(24275, 24274, 2), +(24275, 24239, 3), +(24275, 27180, 4), +(24275, 48805, 5), +(24275, 48806, 6), + -- Hand of Protection +(1022, 1022, 1), +(1022, 5599, 2), +(1022, 10278, 3), + -- Haunt +(48181, 48181, 1), +(48181, 59161, 2), +(48181, 59163, 3), +(48181, 59164, 4), + -- Hawk Eye +(19498, 19498, 1), +(19498, 19499, 2), +(19498, 19500, 3), + -- Heal +(2054, 2054, 1), +(2054, 2055, 2), +(2054, 6063, 3), +(2054, 6064, 4), + -- Healing Focus +(14913, 14913, 1), +(14913, 15012, 2), + -- Healing Focus +(16181, 16181, 1), +(16181, 16230, 2), +(16181, 16232, 3), + -- Healing Grace +(29187, 29187, 1), +(29187, 29189, 2), +(29187, 29191, 3), + -- Healing Light +(20237, 20237, 1), +(20237, 20238, 2), +(20237, 20239, 3), + -- Healing Prayers +(14911, 14911, 1), +(14911, 15018, 2), + -- Healing Stream Totem +(5394, 5394, 1), +(5394, 6375, 2), +(5394, 6377, 3), +(5394, 10462, 4), +(5394, 10463, 5), +(5394, 25567, 6), +(5394, 58755, 7), +(5394, 58756, 8), +(5394, 58757, 9), + -- Healing Touch +(5185, 5185, 1), +(5185, 5186, 2), +(5185, 5187, 3), +(5185, 5188, 4), +(5185, 5189, 5), +(5185, 6778, 6), +(5185, 8903, 7), +(5185, 9758, 8), +(5185, 9888, 9), +(5185, 9889, 10), +(5185, 25297, 11), +(5185, 26978, 12), +(5185, 26979, 13), +(5185, 48377, 14), +(5185, 48378, 15), + -- Healing Wave +(331, 331, 1), +(331, 332, 2), +(331, 547, 3), +(331, 913, 4), +(331, 939, 5), +(331, 959, 6), +(331, 8005, 7), +(331, 10395, 8), +(331, 10396, 9), +(331, 25357, 10), +(331, 25391, 11), +(331, 25396, 12), +(331, 49272, 13), +(331, 49273, 14), + -- Healing Way +(29206, 29206, 1), +(29206, 29205, 2), +(29206, 29202, 3), + -- Health Funnel +(755, 755, 1), +(755, 3698, 2), +(755, 3699, 3), +(755, 3700, 4), +(755, 11693, 5), +(755, 11694, 6), +(755, 11695, 7), +(755, 27259, 8), +(755, 47856, 9), + -- Heart of the Crusader +(21183, 21183, 1), +(21183, 54498, 2), +(21183, 54499, 3), + -- Heart of the Crusader +(20335, 20335, 1), +(20335, 20336, 2), +(20335, 20337, 3), + -- Heart of the Wild +(17003, 17003, 1), +(17003, 17004, 2), +(17003, 17005, 3), +(17003, 17006, 4), +(17003, 24894, 5), + -- Heart Strike +(55050, 55050, 1), +(55050, 55258, 2), +(55050, 55259, 3), +(55050, 55260, 4), +(55050, 55261, 5), +(55050, 55262, 6), + -- Heightened Senses +(30894, 30894, 1), +(30894, 30895, 2), + -- Hellfire +(1949, 1949, 1), +(1949, 11683, 2), +(1949, 11684, 3), +(1949, 27213, 4), +(1949, 47823, 5), + -- Hellfire Effect +(5857, 5857, 1), +(5857, 11681, 2), +(5857, 11682, 3), +(5857, 27214, 4), +(5857, 47822, 5), + -- Hemorrhage +(16511, 16511, 1), +(16511, 17347, 2), +(16511, 17348, 3), +(16511, 26864, 4), +(16511, 48660, 5), + -- Herb Gathering +(2366, 2366, 1), +(2366, 2368, 2), +(2366, 3570, 3), +(2366, 11993, 4), +(2366, 28695, 5), +(2366, 50300, 6), + -- Heroic Strike +(78, 78, 1), +(78, 284, 2), +(78, 285, 3), +(78, 1608, 4), +(78, 11564, 5), +(78, 11565, 6), +(78, 11566, 7), +(78, 11567, 8), +(78, 25286, 9), +(78, 29707, 10), +(78, 30324, 11), +(78, 47449, 12), +(78, 47450, 13), + -- Hibernate +(2637, 2637, 1), +(2637, 18657, 2), +(2637, 18658, 3), + -- Holy Concentration +(34753, 34753, 1), +(34753, 34859, 2), +(34753, 34860, 3), + -- Holy Fire +(14914, 14914, 1), +(14914, 15262, 2), +(14914, 15263, 3), +(14914, 15264, 4), +(14914, 15265, 5), +(14914, 15266, 6), +(14914, 15267, 7), +(14914, 15261, 8), +(14914, 25384, 9), +(14914, 48134, 10), +(14914, 48135, 11), + -- Holy Guidance +(31837, 31837, 1), +(31837, 31838, 2), +(31837, 31839, 3), +(31837, 31840, 4), +(31837, 31841, 5), + -- Holy Light +(635, 635, 1), +(635, 639, 2), +(635, 647, 3), +(635, 1026, 4), +(635, 1042, 5), +(635, 3472, 6), +(635, 10328, 7), +(635, 10329, 8), +(635, 25292, 9), +(635, 27135, 10), +(635, 27136, 11), +(635, 48781, 12), +(635, 48782, 13), + -- Holy Power +(5923, 5923, 1), +(5923, 5924, 2), +(5923, 5925, 3), +(5923, 5926, 4), +(5923, 25829, 5), + -- Holy Reach +(27789, 27789, 1), +(27789, 27790, 2), + -- Holy Shield +(20925, 20925, 1), +(20925, 20927, 2), +(20925, 20928, 3), +(20925, 27179, 4), +(20925, 48951, 5), +(20925, 48952, 6), + -- Holy Specialization +(14889, 14889, 1), +(14889, 15008, 2), +(14889, 15009, 3), +(14889, 15010, 4), +(14889, 15011, 5), + -- Holy Wrath +(2812, 2812, 1), +(2812, 10318, 2), +(2812, 27139, 3), +(2812, 48816, 4), +(2812, 48817, 5), + -- Honor Among Thieves +(51698, 51698, 1), +(51698, 51700, 2), +(51698, 51701, 3), + -- Horn of Winter +(57330, 57330, 1), +(57330, 57623, 2), + -- Hot Streak +(44445, 44445, 1), +(44445, 44446, 2), +(44445, 44448, 3), + -- Howl of Terror +(5484, 5484, 1), +(5484, 17928, 2), + -- Howling Blast +(49184, 49184, 1), +(49184, 51409, 2), +(49184, 51410, 3), +(49184, 51411, 4), + -- Hunter vs. Wild +(56339, 56339, 1), +(56339, 56340, 2), +(56339, 56341, 3), + -- Hunter's Mark +(1130, 1130, 1), +(1130, 14323, 2), +(1130, 14324, 3), +(1130, 14325, 4), +(1130, 53338, 5), + -- Hunting Party +(53290, 53290, 1), +(53290, 53291, 2), +(53290, 53292, 3), + -- Ice Armor +(1214, 1214, 1), +(1214, 1228, 2), +(1214, 10221, 3), +(1214, 10222, 4), +(1214, 27391, 5), + -- Ice Armor +(7302, 7302, 1), +(7302, 7320, 2), +(7302, 10219, 3), +(7302, 10220, 4), +(7302, 27124, 5), +(7302, 43008, 6), + -- Ice Barrier +(11426, 11426, 1), +(11426, 13031, 2), +(11426, 13032, 3), +(11426, 13033, 4), +(11426, 27134, 5), +(11426, 33405, 6), +(11426, 43038, 7), +(11426, 43039, 8), + -- Ice Floes +(31670, 31670, 1), +(31670, 31672, 2), +(31670, 55094, 3), + -- Ice Lance +(30455, 30455, 1), +(30455, 42913, 2), +(30455, 42914, 3), + -- Ice Shards +(11207, 11207, 1), +(11207, 12672, 2), +(11207, 15047, 3), + -- Icy Reach +(55061, 55061, 1), +(55061, 55062, 2), + -- Icy Talons +(50880, 50880, 1), +(50880, 50884, 2), +(50880, 50885, 3), +(50880, 50886, 4), +(50880, 50887, 5), + -- Ignite +(11119, 11119, 1), +(11119, 11120, 2), +(11119, 12846, 3), +(11119, 12847, 4), +(11119, 12848, 5), + -- Illumination +(20210, 20210, 1), +(20210, 20212, 2), +(20210, 20213, 3), +(20210, 20214, 4), +(20210, 20215, 5), + -- Immolate +(348, 348, 1), +(348, 707, 2), +(348, 1094, 3), +(348, 2941, 4), +(348, 11665, 5), +(348, 11667, 6), +(348, 11668, 7), +(348, 25309, 8), +(348, 27215, 9), +(348, 47810, 10), +(348, 47811, 11), + -- Impale +(16493, 16493, 1), +(16493, 16494, 2), + -- Improved Ambush +(14079, 14079, 1), +(14079, 14080, 2), + -- Improved Arcane Shot +(19454, 19454, 1), +(19454, 19455, 2), +(19454, 19456, 3), + -- Improved Aspect of the Hawk +(19552, 19552, 1), +(19552, 19553, 2), +(19552, 19554, 3), +(19552, 19555, 4), +(19552, 19556, 5), + -- Improved Aspect of the Monkey +(19549, 19549, 1), +(19549, 19550, 2), +(19549, 19551, 3), + -- Improved Barkskin +(63410, 63410, 1), +(63410, 63411, 2), + -- Improved Barrage +(35104, 35104, 1), +(35104, 35110, 2), +(35104, 35111, 3), + -- Improved Berserker Rage +(20500, 20500, 1), +(20500, 20501, 2), + -- Improved Berserker Stance +(29759, 29759, 1), +(29759, 29760, 2), +(29759, 29761, 3), +(29759, 29762, 4), +(29759, 29763, 5), + -- Improved Blessing of Might +(20042, 20042, 1), +(20042, 20045, 2), + -- Improved Blessing of Salvation +(20194, 20194, 1), +(20194, 20195, 2), + -- Improved Blessing of Wisdom +(20244, 20244, 1), +(20244, 20245, 2), + -- Improved Blink +(31569, 31569, 1), +(31569, 31570, 2), + -- Improved Blizzard +(11185, 11185, 1), +(11185, 12487, 2), +(11185, 12488, 3), + -- Improved Blood Presence +(50365, 50365, 1), +(50365, 50371, 2), + -- Improved Bloodrage +(12301, 12301, 1), +(12301, 12818, 2), + -- Improved Chain Heal +(30872, 30872, 1), +(30872, 30873, 2), + -- Improved Challenging Shout +(12327, 12327, 1), +(12327, 12886, 2), + -- Improved Charge +(12285, 12285, 1), +(12285, 12697, 2), + -- Improved Cleave +(12329, 12329, 1), +(12329, 12950, 2), +(12329, 20496, 3), + -- Improved Concentration Aura +(20254, 20254, 1), +(20254, 20255, 2), +(20254, 20256, 3), + -- Improved Concussive Shot +(19407, 19407, 1), +(19407, 19412, 2), + -- Improved Cone of Cold +(11190, 11190, 1), +(11190, 12489, 2), +(11190, 12490, 3), + -- Improved Corpse Explosion +(49601, 49601, 1), +(49601, 49602, 2), + -- Improved Corruption +(17810, 17810, 1), +(17810, 17811, 2), +(17810, 17812, 3), +(17810, 17813, 4), +(17810, 17814, 5), + -- Improved Counterspell +(11255, 11255, 1), +(11255, 12598, 2), + -- Improved Cower +(53180, 53180, 1), +(53180, 53181, 2), + -- Improved Curse of Agony +(18827, 18827, 1), +(18827, 18829, 2), + -- Improved Curse of Weakness +(18179, 18179, 1), +(18179, 18180, 2), + -- Improved Death Coil +(30049, 30049, 1), +(30049, 30051, 2), +(30049, 30052, 3), + -- Improved Defensive Stance +(29593, 29593, 1), +(29593, 29594, 2), + -- Improved Demonic Tactics +(54347, 54347, 1), +(54347, 54348, 2), +(54347, 54349, 3), + -- Improved Demoralizing Shout +(12324, 12324, 1), +(12324, 12876, 2), +(12324, 12877, 3), +(12324, 12878, 4), +(12324, 12879, 5), + -- Improved Devotion Aura +(20138, 20138, 1), +(20138, 20139, 2), +(20138, 20140, 3), + -- Improved Devouring Plague +(63625, 63625, 1), +(63625, 63626, 2), +(63625, 63627, 3), + -- Improved Disarm +(12313, 12313, 1), +(12313, 12804, 2), + -- Improved Disciplines +(12312, 12312, 1), +(12312, 12803, 2), + -- Improved Drain Soul +(18213, 18213, 1), +(18213, 18372, 2), + -- Improved Earth Shield +(51560, 51560, 1), +(51560, 51561, 2), + -- Improved Eviscerate +(14162, 14162, 1), +(14162, 14163, 2), +(14162, 14164, 3), + -- Improved Execute +(20502, 20502, 1), +(20502, 20503, 2), + -- Improved Expose Armor +(14168, 14168, 1), +(14168, 14169, 2), + -- Improved Eyes of the Beast +(19557, 19557, 1), +(19557, 19558, 2), + -- Improved Faerie Fire +(33600, 33600, 1), +(33600, 33601, 2), +(33600, 33602, 3), + -- Improved Fear +(53754, 53754, 1), +(53754, 53759, 2), + -- Improved Felhunter +(54037, 54037, 1), +(54037, 54038, 2), + -- Improved Fire Blast +(11078, 11078, 1), +(11078, 11080, 2), + -- Improved Fire Nova +(16086, 16086, 1), +(16086, 16544, 2), + -- Improved Fireball +(11069, 11069, 1), +(11069, 12338, 2), +(11069, 12339, 3), +(11069, 12340, 4), +(11069, 12341, 5), + -- Improved Flash of Light +(20249, 20249, 1), +(20249, 20250, 2), +(20249, 20251, 3), + -- Improved Frost Presence +(50384, 50384, 1), +(50384, 50385, 2), + -- Improved Frostbolt +(11070, 11070, 1), +(11070, 12473, 2), +(11070, 16763, 3), +(11070, 16765, 4), +(11070, 16766, 5), + -- Improved Ghost Wolf +(16262, 16262, 1), +(16262, 16287, 2), + -- Improved Gouge +(13741, 13741, 1), +(13741, 13793, 2), +(13741, 13792, 3), + -- Improved Hammer of Justice +(20487, 20487, 1), +(20487, 20488, 2), + -- Improved Hamstring +(12289, 12289, 1), +(12289, 12668, 2), +(12289, 23695, 3), + -- Improved Healing +(14912, 14912, 1), +(14912, 15013, 2), +(14912, 15014, 3), + -- Improved Healing Wave +(16182, 16182, 1), +(16182, 16226, 2), +(16182, 16227, 3), +(16182, 16228, 4), +(16182, 16229, 5), + -- Improved Health Funnel +(18703, 18703, 1), +(18703, 18704, 2), + -- Improved Healthstone +(18692, 18692, 1), +(18692, 18693, 2), + -- Improved Heroic Strike +(12282, 12282, 1), +(12282, 12663, 2), +(12282, 12664, 3), + -- Improved Howl of Terror +(30054, 30054, 1), +(30054, 30057, 2), + -- Improved Hunter's Mark +(19421, 19421, 1), +(19421, 19422, 2), +(19421, 19423, 3), + -- Improved Icy Touch +(49175, 49175, 1), +(49175, 50031, 2), +(49175, 51456, 3), + -- Improved Immolate +(17815, 17815, 1), +(17815, 17833, 2), +(17815, 17834, 3), + -- Improved Imp +(18694, 18694, 1), +(18694, 18695, 2), +(18694, 18696, 3), + -- Improved Inner Fire +(14747, 14747, 1), +(14747, 14770, 2), +(14747, 14771, 3), + -- Improved Inner Rage +(12325, 12325, 1), +(12325, 12863, 2), +(12325, 12864, 3), +(12325, 12865, 4), +(12325, 12866, 5), + -- Improved Insect Swarm +(57849, 57849, 1), +(57849, 57850, 2), +(57849, 57851, 3), + -- Improved Intercept +(29888, 29888, 1), +(29888, 29889, 2), + -- Improved Intimidating Shout +(19870, 19870, 1), +(19870, 19871, 2), + -- Improved Judgements +(25956, 25956, 1), +(25956, 25957, 2), + -- Improved Kick +(13754, 13754, 1), +(13754, 13867, 2), + -- Improved Kidney Shot +(14174, 14174, 1), +(14174, 14175, 2), +(14174, 14176, 3), + -- Improved Lay on Hands +(20234, 20234, 1), +(20234, 20235, 2), + -- Improved Leader of the Pack +(34297, 34297, 1), +(34297, 34300, 2), + -- Improved Life Tap +(18182, 18182, 1), +(18182, 18183, 2), + -- Improved Mana Burn +(14750, 14750, 1), +(14750, 14772, 2), + -- Improved Mangle +(48532, 48532, 1), +(48532, 48489, 2), +(48532, 48491, 3), + -- Improved Mark of the Wild +(17050, 17050, 1), +(17050, 17051, 2), + -- Improved Mind Blast +(15273, 15273, 1), +(15273, 15312, 2), +(15273, 15313, 3), +(15273, 15314, 4), +(15273, 15316, 5), + -- Improved Moonfire +(16821, 16821, 1), +(16821, 16822, 2), + -- Improved Moonkin Form +(50170, 50170, 1), +(50170, 50171, 2), +(50170, 50172, 3), + -- Improved Moonkin Form +(48384, 48384, 1), +(48384, 48395, 2), +(48384, 48396, 3), + -- Improved Mortal Strike +(35446, 35446, 1), +(35446, 35448, 2), +(35446, 35449, 3), + -- Improved Overpower +(12290, 12290, 1), +(12290, 12963, 2), + -- Improved Poisons +(14113, 14113, 1), +(14113, 14114, 2), +(14113, 14115, 3), +(14113, 14116, 4), +(14113, 14117, 5), + -- Improved Power Word: Fortitude +(14749, 14749, 1), +(14749, 14767, 2), + -- Improved Power Word: Shield +(14748, 14748, 1), +(14748, 14768, 2), +(14748, 14769, 3), + -- Improved Psychic Scream +(15392, 15392, 1), +(15392, 15448, 2), + -- Improved Reincarnation +(16184, 16184, 1), +(16184, 16209, 2), + -- Improved Rejuvenation +(17111, 17111, 1), +(17111, 17112, 2), +(17111, 17113, 3), + -- Improved Rend +(12286, 12286, 1), +(12286, 12658, 2), + -- Improved Renew +(14908, 14908, 1), +(14908, 15020, 2), +(14908, 17191, 3), + -- Improved Revenge +(12797, 12797, 1), +(12797, 12799, 2), + -- Improved Revive Pet +(24443, 24443, 1), +(24443, 19575, 2), + -- Improved Righteous Fury +(20468, 20468, 1), +(20468, 20469, 2), +(20468, 20470, 3), + -- Improved Rune Tap +(48985, 48985, 1), +(48985, 49488, 2), +(48985, 49489, 3), + -- Improved Scorch +(11095, 11095, 1), +(11095, 12872, 2), +(11095, 12873, 3), + -- Improved Scorpid Sting +(19491, 19491, 1), +(19491, 19493, 2), +(19491, 19494, 3), + -- Improved Searing Pain +(17927, 17927, 1), +(17927, 17929, 2), +(17927, 17930, 3), + -- Improved Shadow Bolt +(17793, 17793, 1), +(17793, 17796, 2), +(17793, 17801, 3), +(17793, 17802, 4), +(17793, 17803, 5), + -- Improved Shadow Word: Pain +(15275, 15275, 1), +(15275, 15317, 2), + -- Improved Shadowform +(47569, 47569, 1), +(47569, 47570, 2), + -- Improved Shields +(16261, 16261, 1), +(16261, 16290, 2), +(16261, 51881, 3), + -- Improved Sinister Strike +(13732, 13732, 1), +(13732, 13863, 2), + -- Improved Slam +(12862, 12862, 1), +(12862, 12330, 2), + -- Improved Slice and Dice +(14165, 14165, 1), +(14165, 14166, 2), + -- Improved Soul Leech +(54117, 54117, 1), +(54117, 54118, 2), + -- Improved Spell Reflection +(59088, 59088, 1), +(59088, 59089, 2), + -- Improved Spirit Tap +(49694, 49694, 1), +(49694, 59000, 2), + -- Improved Spirit Tap +(15337, 15337, 1), +(15337, 15338, 2), + -- Improved Sprint +(13743, 13743, 1), +(13743, 13875, 2), + -- Improved Steady Shot +(53221, 53221, 1), +(53221, 53222, 2), +(53221, 53224, 3), + -- Improved Stings +(19464, 19464, 1), +(19464, 19465, 2), +(19464, 19466, 3), + -- Improved Stormstrike +(51521, 51521, 1), +(51521, 51522, 2), + -- Improved Succubus +(18754, 18754, 1), +(18754, 18755, 2), +(18754, 18756, 3), + -- Improved Thunder Clap +(12287, 12287, 1), +(12287, 12665, 2), +(12287, 12666, 3), + -- Improved Tracking +(52783, 52783, 1), +(52783, 52785, 2), +(52783, 52786, 3), +(52783, 52787, 4), +(52783, 52788, 5), + -- Improved Tranquility +(17123, 17123, 1), +(17123, 17124, 2), + -- Improved Tree of Life +(48535, 48535, 1), +(48535, 48536, 2), +(48535, 48537, 3), + -- Improved Unholy Presence +(50391, 50391, 1), +(50391, 50392, 2), + -- Improved Vampiric Embrace +(27839, 27839, 1), +(27839, 27840, 2), + -- Improved Water Shield +(16180, 16180, 1), +(16180, 16196, 2), +(16180, 16198, 3), + -- Improved Whirlwind +(29721, 29721, 1), +(29721, 29776, 2), + -- Improved Windfury Totem +(29192, 29192, 1), +(29192, 29193, 2), + -- Impurity +(49220, 49220, 1), +(49220, 49633, 2), +(49220, 49635, 3), +(49220, 49636, 4), +(49220, 49638, 5), + -- Incanter's Absorption +(44394, 44394, 1), +(44394, 44395, 2), +(44394, 44396, 3), + -- Incinerate +(29722, 29722, 1), +(29722, 32231, 2), +(29722, 47837, 3), +(29722, 47838, 4), + -- Incineration +(18459, 18459, 1), +(18459, 18460, 2), +(18459, 54734, 3), + -- Incite +(50685, 50685, 1), +(50685, 50686, 2), +(50685, 50687, 3), + -- Infected Wounds +(48483, 48483, 1), +(48483, 48484, 2), +(48483, 48485, 3), + -- Infectious Poisons +(51630, 51630, 1), +(51630, 51631, 2), + -- Inner Fire +(588, 588, 1), +(588, 7128, 2), +(588, 602, 3), +(588, 1006, 4), +(588, 10951, 5), +(588, 10952, 6), +(588, 25431, 7), +(588, 48040, 8), +(588, 48168, 9), + -- Inscription +(45357, 45357, 1), +(45357, 45358, 2), +(45357, 45359, 3), +(45357, 45360, 4), +(45357, 45361, 5), +(45357, 45363, 6), + -- Insect Swarm +(5570, 5570, 1), +(5570, 24974, 2), +(5570, 24975, 3), +(5570, 24976, 4), +(5570, 24977, 5), +(5570, 27013, 6), +(5570, 48468, 7), + -- Inspiration +(14893, 14893, 1), +(14893, 15357, 2), +(14893, 15359, 3), + -- Inspiration +(14892, 14892, 1), +(14892, 15362, 2), +(14892, 15363, 3), + -- Intensify Rage +(46908, 46908, 1), +(46908, 46909, 2), +(46908, 56924, 3), + -- Intensity +(17080, 17080, 1), +(17080, 35358, 2), +(17080, 35359, 3), + -- Intensity +(17106, 17106, 1), +(17106, 17107, 2), +(17106, 17108, 3), + -- Intensity +(18135, 18135, 1), +(18135, 18136, 2), + -- Invigoration +(53252, 53252, 1), +(53252, 53253, 2), + -- Iron Will +(12300, 12300, 1), +(12300, 12959, 2), +(12300, 12960, 3), + -- Jewelcrafting +(25229, 25229, 1), +(25229, 25230, 2), +(25229, 28894, 3), +(25229, 28895, 4), +(25229, 28897, 5), +(25229, 51311, 6), + -- Judgements of the Just +(53695, 53695, 1), +(53695, 53696, 2), + -- Judgements of the Wise +(31876, 31876, 1), +(31876, 31877, 2), +(31876, 31878, 3), + -- Khadgar's Unlocking +(491, 491, 1), +(491, 857, 2), +(491, 10165, 3), +(491, 10166, 4), + -- Kidney Shot +(408, 408, 1), +(408, 8643, 2), + -- Kill Shot +(53351, 53351, 1), +(53351, 61005, 2), +(53351, 61006, 3), + -- Killer Instinct +(19370, 19370, 1), +(19370, 19371, 2), +(19370, 19373, 3), + -- Killing Machine +(51123, 51123, 1), +(51123, 51127, 2), +(51123, 51128, 3), +(51123, 51129, 4), +(51123, 51130, 5), + -- Kindling Soul +(47426, 47426, 1), +(47426, 47427, 2), + -- Kindling Soul +(47261, 47261, 1), +(47261, 47262, 2), + -- Kindred Spirits +(56314, 56314, 1), +(56314, 56315, 2), +(56314, 56316, 3), +(56314, 56317, 4), +(56314, 56318, 5), + -- King of the Jungle +(48492, 48492, 1), +(48492, 48494, 2), +(48492, 48495, 3), + -- Lacerate +(33745, 33745, 1), +(33745, 48567, 2), +(33745, 48568, 3), + -- Lash of Pain +(7814, 7814, 1), +(7814, 7815, 2), +(7814, 7816, 3), +(7814, 11778, 4), +(7814, 11779, 5), +(7814, 11780, 6), +(7814, 27274, 7), +(7814, 47991, 8), +(7814, 47992, 9), + -- Lava Breath +(58604, 58604, 1), +(58604, 58607, 2), +(58604, 58608, 3), +(58604, 58609, 4), +(58604, 58610, 5), +(58604, 58611, 6), + -- Lava Burst +(51505, 51505, 1), +(51505, 60043, 2), + -- Lava Flows +(51480, 51480, 1), +(51480, 51481, 2), +(51480, 51482, 3), + -- Lay on Hands +(633, 633, 1), +(633, 2800, 2), +(633, 10310, 3), +(633, 27154, 4), +(633, 48788, 5), + -- Leatherworking +(2108, 2108, 1), +(2108, 3104, 2), +(2108, 3811, 3), +(2108, 10662, 4), +(2108, 32549, 5), +(2108, 51302, 6), + -- Lesser Heal +(2050, 2050, 1), +(2050, 2052, 2), +(2050, 2053, 3), + -- Lesser Healing Wave +(8004, 8004, 1), +(8004, 8008, 2), +(8004, 8010, 3), +(8004, 10466, 4), +(8004, 10467, 5), +(8004, 10468, 6), +(8004, 25420, 7), +(8004, 49275, 8), +(8004, 49276, 9), + -- Lethal Shots +(19426, 19426, 1), +(19426, 19427, 2), +(19426, 19429, 3), +(19426, 19430, 4), +(19426, 19431, 5), + -- Lethality +(14128, 14128, 1), +(14128, 14132, 2), +(14128, 14135, 3), +(14128, 14136, 4), +(14128, 14137, 5), + -- Life Tap +(1454, 1454, 1), +(1454, 1455, 2), +(1454, 1456, 3), +(1454, 11687, 4), +(1454, 11688, 5), +(1454, 11689, 6), +(1454, 27222, 7), +(1454, 57946, 8), + -- Lifeblood +(55428, 55428, 1), +(55428, 55480, 2), +(55428, 55500, 3), +(55428, 55501, 4), +(55428, 55502, 5), +(55428, 55503, 6), + -- Lifebloom +(33763, 33763, 1), +(33763, 48450, 2), +(33763, 48451, 3), + -- Lightning Breath +(24845, 24845, 1), +(24845, 25013, 2), +(24845, 25014, 3), +(24845, 25015, 4), +(24845, 25016, 5), +(24845, 25017, 6), + -- Lightning Breath +(24844, 24844, 1), +(24844, 25008, 2), +(24844, 25009, 3), +(24844, 25010, 4), +(24844, 25011, 5), +(24844, 25012, 6), + -- Lightning Mastery +(16578, 16578, 1), +(16578, 16579, 2), +(16578, 16580, 3), +(16578, 16581, 4), +(16578, 16582, 5), + -- Lightning Overload +(30675, 30675, 1), +(30675, 30678, 2), +(30675, 30679, 3), + -- Lightning Reflexes +(13712, 13712, 1), +(13712, 13788, 2), +(13712, 13789, 3), + -- Lightning Reflexes +(19168, 19168, 1), +(19168, 19180, 2), +(19168, 19181, 3), +(19168, 24296, 4), +(19168, 24297, 5), + -- Light's Grace +(31833, 31833, 1), +(31833, 31835, 2), +(31833, 31836, 3), + -- Lightwell +(724, 724, 1), +(724, 27870, 2), +(724, 27871, 3), +(724, 28275, 4), +(724, 48086, 5), +(724, 48087, 6), + -- Lightwell Renew +(7001, 7001, 1), +(7001, 27873, 2), +(7001, 27874, 3), +(7001, 28276, 4), +(7001, 48084, 5), +(7001, 48085, 6), + -- Lionhearted +(53409, 53409, 1), +(53409, 53411, 2), + -- Living Seed +(48496, 48496, 1), +(48496, 48499, 2), +(48496, 48500, 3), + -- Living Spirit +(34151, 34151, 1), +(34151, 34152, 2), +(34151, 34153, 3), + -- Lock and Load +(56342, 56342, 1), +(56342, 56343, 2), +(56342, 56344, 3), + -- Lockpicking +(1809, 1809, 1), +(1809, 1810, 2), +(1809, 6460, 3), + -- Longevity +(53262, 53262, 1), +(53262, 53263, 2), +(53262, 53264, 3), + -- Lunar Guidance +(33589, 33589, 1), +(33589, 33590, 2), +(33589, 33591, 3), + -- Mace Specialization +(13709, 13709, 1), +(13709, 13800, 2), +(13709, 13801, 3), +(13709, 13802, 4), +(13709, 13803, 5), + -- Maelstrom Weapon +(51528, 51528, 1), +(51528, 51529, 2), +(51528, 51530, 3), +(51528, 51531, 4), +(51528, 51532, 5), + -- Mage Armor +(6121, 6121, 1), +(6121, 22784, 2), +(6121, 22785, 3), +(6121, 27392, 4), + -- Mage Armor +(6117, 6117, 1), +(6117, 22782, 2), +(6117, 22783, 3), +(6117, 27125, 4), +(6117, 43023, 5), +(6117, 43024, 6), + -- Magic Absorption +(29441, 29441, 1), +(29441, 29444, 2), + -- Magic Attunement +(11247, 11247, 1), +(11247, 12606, 2), + -- Magic Suppression +(49224, 49224, 1), +(49224, 49610, 2), +(49224, 49611, 3), + -- Magma Totem +(8187, 8187, 1), +(8187, 10579, 2), +(8187, 10580, 3), +(8187, 10581, 4), +(8187, 25550, 5), +(8187, 58732, 6), +(8187, 58735, 7), + -- Magma Totem +(8190, 8190, 1), +(8190, 10585, 2), +(8190, 10586, 3), +(8190, 10587, 4), +(8190, 25552, 5), +(8190, 58731, 6), +(8190, 58734, 7), + -- Magma Totem Passive +(8188, 8188, 1), +(8188, 10582, 2), +(8188, 10583, 3), +(8188, 10584, 4), +(8188, 25551, 5), +(8188, 58733, 6), +(8188, 58736, 7), + -- Maim +(22570, 22570, 1), +(22570, 49802, 2), + -- Malediction +(32477, 32477, 1), +(32477, 32483, 2), +(32477, 32484, 3), + -- Malice +(14138, 14138, 1), +(14138, 14139, 2), +(14138, 14140, 3), +(14138, 14141, 4), +(14138, 14142, 5), + -- Mana Shield +(1481, 1481, 1), +(1481, 8496, 2), +(1481, 8497, 3), +(1481, 10194, 4), +(1481, 10195, 5), +(1481, 10196, 6), +(1481, 27398, 7), + -- Mana Shield +(1463, 1463, 1), +(1463, 8494, 2), +(1463, 8495, 3), +(1463, 10191, 4), +(1463, 10192, 5), +(1463, 10193, 6), +(1463, 27131, 7), +(1463, 43019, 8), +(1463, 43020, 9), + -- Mana Spring +(5677, 5677, 1), +(5677, 10491, 2), +(5677, 10493, 3), +(5677, 10494, 4), +(5677, 25569, 5), +(5677, 58775, 6), +(5677, 58776, 7), +(5677, 58777, 8), + -- Mana Spring Totem +(5675, 5675, 1), +(5675, 10495, 2), +(5675, 10496, 3), +(5675, 10497, 4), +(5675, 25570, 5), +(5675, 58771, 6), +(5675, 58773, 7), +(5675, 58774, 8), + -- Mangle (Bear) +(33878, 33878, 1), +(33878, 33986, 2), +(33878, 33987, 3), +(33878, 48563, 4), +(33878, 48564, 5), + -- Mangle (Cat) +(33876, 33876, 1), +(33876, 33982, 2), +(33876, 33983, 3), +(33876, 48565, 4), +(33876, 48566, 5), + -- Mark of the Wild +(1126, 1126, 1), +(1126, 5232, 2), +(1126, 6756, 3), +(1126, 5234, 4), +(1126, 8907, 5), +(1126, 9884, 6), +(1126, 9885, 7), +(1126, 26990, 8), +(1126, 48469, 9), + -- Marked for Death +(53241, 53241, 1), +(53241, 53243, 2), +(53241, 53244, 3), +(53241, 53245, 4), +(53241, 53246, 5), + -- Martyrdom +(14531, 14531, 1), +(14531, 14774, 2), + -- Master Conjuror +(18767, 18767, 1), +(18767, 18768, 2), + -- Master Healer +(14904, 14904, 1), +(14904, 15024, 2), +(14904, 15025, 3), +(14904, 15026, 4), +(14904, 15027, 5), + -- Master Marksman +(34485, 34485, 1), +(34485, 34486, 2), +(34485, 34487, 3), +(34485, 34488, 4), +(34485, 34489, 5), + -- Master of Anatomy +(53125, 53125, 1), +(53125, 53662, 2), +(53125, 53663, 3), +(53125, 53664, 4), +(53125, 53665, 5), +(53125, 53666, 6), + -- Master of Deception +(13958, 13958, 1), +(13958, 13970, 2), +(13958, 13971, 3), + -- Master of Elements +(29074, 29074, 1), +(29074, 29075, 2), +(29074, 29076, 3), + -- Master of Subtlety +(31221, 31221, 1), +(31221, 31222, 2), +(31221, 31223, 3), + -- Master Poisoner +(31226, 31226, 1), +(31226, 31227, 2), +(31226, 58410, 3), + -- Master Summoner +(18709, 18709, 1), +(18709, 18710, 2), + -- Maul +(6807, 6807, 1), +(6807, 6808, 2), +(6807, 6809, 3), +(6807, 8972, 4), +(6807, 9745, 5), +(6807, 9880, 6), +(6807, 9881, 7), +(6807, 26996, 8), +(6807, 48479, 9), +(6807, 48480, 10), + -- Meditation +(14521, 14521, 1), +(14521, 14776, 2), +(14521, 14777, 3), + -- Melee Specialization +(19381, 19381, 1), +(19381, 19382, 2), +(19381, 19383, 3), +(19381, 19384, 4), +(19381, 19385, 5), + -- Melted Mind +(58378, 58378, 1), +(58378, 58379, 2), + -- Mend Pet +(136, 136, 1), +(136, 3111, 2), +(136, 3661, 3), +(136, 3662, 4), +(136, 13542, 5), +(136, 13543, 6), +(136, 13544, 7), +(136, 27046, 8), +(136, 48989, 9), +(136, 48990, 10), + -- Mental Agility +(14520, 14520, 1), +(14520, 14780, 2), +(14520, 14781, 3), + -- Mental Dexterity +(51883, 51883, 1), +(51883, 51884, 2), +(51883, 51885, 3), + -- Mental Quickness +(30812, 30812, 1), +(30812, 30813, 2), +(30812, 30814, 3), + -- Mental Strength +(18551, 18551, 1), +(18551, 18552, 2), +(18551, 18553, 3), +(18551, 18554, 4), +(18551, 18555, 5), + -- Merciless Combat +(49024, 49024, 1), +(49024, 49538, 2), + -- Might of Mograine +(49023, 49023, 1), +(49023, 49533, 2), +(49023, 49534, 3), + -- Mind Blast +(8092, 8092, 1), +(8092, 8102, 2), +(8092, 8103, 3), +(8092, 8104, 4), +(8092, 8105, 5), +(8092, 8106, 6), +(8092, 10945, 7), +(8092, 10946, 8), +(8092, 10947, 9), +(8092, 25372, 10), +(8092, 25375, 11), +(8092, 48126, 12), +(8092, 48127, 13), + -- Mind Flay +(15407, 15407, 1), +(15407, 17311, 2), +(15407, 17312, 3), +(15407, 17313, 4), +(15407, 17314, 5), +(15407, 18807, 6), +(15407, 25387, 7), +(15407, 48155, 8), +(15407, 48156, 9), + -- Mind Mastery +(31584, 31584, 1), +(31584, 31585, 2), +(31584, 31586, 3), +(31584, 31587, 4), +(31584, 31588, 5), + -- Mind Melt +(14910, 14910, 1), +(14910, 33371, 2), + -- Mind Vision +(2096, 2096, 1), +(2096, 10909, 2), + -- Mining +(2575, 2575, 1), +(2575, 2576, 2), +(2575, 3564, 3), +(2575, 10248, 4), +(2575, 29354, 5), +(2575, 50310, 6), + -- Missile Barrage +(44404, 44404, 1), +(44404, 54486, 2), +(44404, 54488, 3), +(44404, 54489, 4), +(44404, 54490, 5), + -- Molten Core +(47245, 47245, 1), +(47245, 47246, 2), +(47245, 47247, 3), + -- Molten Fury +(31679, 31679, 1), +(31679, 31680, 2), + -- Molten Shields +(11094, 11094, 1), +(11094, 13043, 2), + -- Mongoose Bite +(1495, 1495, 1), +(1495, 14269, 2), +(1495, 14270, 3), +(1495, 14271, 4), +(1495, 36916, 5), +(1495, 53339, 6), + -- Monstrous Bite +(54680, 54680, 1), +(54680, 55495, 2), +(54680, 55496, 3), +(54680, 55497, 4), +(54680, 55498, 5), +(54680, 55499, 6), + -- Moonfire +(8921, 8921, 1), +(8921, 8924, 2), +(8921, 8925, 3), +(8921, 8926, 4), +(8921, 8927, 5), +(8921, 8928, 6), +(8921, 8929, 7), +(8921, 9833, 8), +(8921, 9834, 9), +(8921, 9835, 10), +(8921, 26987, 11), +(8921, 26988, 12), +(8921, 48462, 13), +(8921, 48463, 14), + -- Moonfury +(16896, 16896, 1), +(16896, 16897, 2), +(16896, 16899, 3), + -- Moonglow +(16845, 16845, 1), +(16845, 16846, 2), +(16845, 16847, 3), + -- Morbidity +(48963, 48963, 1), +(48963, 49564, 2), +(48963, 49565, 3), + -- Mortal Shots +(19485, 19485, 1), +(19485, 19487, 2), +(19485, 19488, 3), +(19485, 19489, 4), +(19485, 19490, 5), + -- Mortal Strike +(12294, 12294, 1), +(12294, 21551, 2), +(12294, 21552, 3), +(12294, 21553, 4), +(12294, 25248, 5), +(12294, 30330, 6), +(12294, 47485, 7), +(12294, 47486, 8), + -- Multi-Shot +(2643, 2643, 1), +(2643, 14288, 2), +(2643, 14289, 3), +(2643, 14290, 4), +(2643, 25294, 5), +(2643, 27021, 6), +(2643, 49047, 7), +(2643, 49048, 8), + -- Murder +(14158, 14158, 1), +(14158, 14159, 2), + -- Mutilate +(1329, 1329, 1), +(1329, 34411, 2), +(1329, 34412, 3), +(1329, 34413, 4), +(1329, 48663, 5), +(1329, 48666, 6), + -- Natural Armor +(24547, 24547, 1), +(24547, 24556, 2), +(24547, 24557, 3), +(24547, 24558, 4), +(24547, 24559, 5), +(24547, 24560, 6), +(24547, 24561, 7), +(24547, 24562, 8), +(24547, 24631, 9), +(24547, 24632, 10), +(24547, 27362, 11), + -- Natural Armor +(61689, 61689, 1), +(61689, 61690, 2), + -- Natural Perfection +(45281, 45281, 1), +(45281, 45282, 2), +(45281, 45283, 3), + -- Natural Perfection +(33881, 33881, 1), +(33881, 33882, 2), +(33881, 33883, 3), + -- Natural Reaction +(57878, 57878, 1), +(57878, 57880, 2), +(57878, 57881, 3), + -- Natural Shapeshifter +(16833, 16833, 1), +(16833, 16834, 2), +(16833, 16835, 3), + -- Naturalist +(17069, 17069, 1), +(17069, 17070, 2), +(17069, 17071, 3), +(17069, 17072, 4), +(17069, 17073, 5), + -- Nature Resistance Totem +(10595, 10595, 1), +(10595, 10600, 2), +(10595, 10601, 3), +(10595, 25574, 4), +(10595, 58746, 5), +(10595, 58749, 6), + -- Nature's Blessing +(30867, 30867, 1), +(30867, 30868, 2), +(30867, 30869, 3), + -- Nature's Bounty +(17074, 17074, 1), +(17074, 17075, 2), +(17074, 17076, 3), +(17074, 17077, 4), +(17074, 17078, 5), + -- Nature's Focus +(17063, 17063, 1), +(17063, 17065, 2), +(17063, 17066, 3), + -- Nature's Grasp +(16689, 16689, 1), +(16689, 16810, 2), +(16689, 16811, 3), +(16689, 16812, 4), +(16689, 16813, 5), +(16689, 17329, 6), +(16689, 27009, 7), +(16689, 53312, 8), + -- Nature's Guardian +(30881, 30881, 1), +(30881, 30883, 2), +(30881, 30884, 3), +(30881, 30885, 4), +(30881, 30886, 5), + -- Nature's Reach +(16819, 16819, 1), +(16819, 16820, 2), + -- Necrosis +(51459, 51459, 1), +(51459, 51462, 2), +(51459, 51463, 3), +(51459, 51464, 4), +(51459, 51465, 5), + -- Nemesis +(63117, 63117, 1), +(63117, 63121, 2), +(63117, 63123, 3), + -- Nerves of Cold Steel +(49226, 49226, 1), +(49226, 50137, 2), +(49226, 50138, 3), + -- Nerves of Steel +(31130, 31130, 1), +(31130, 31131, 2), + -- Nether Protection +(30299, 30299, 1), +(30299, 30301, 2), +(30299, 30302, 3), + -- Nether Shock +(50479, 50479, 1), +(50479, 53584, 2), +(50479, 53586, 3), +(50479, 53587, 4), +(50479, 53588, 5), +(50479, 53589, 6), + -- Netherwind Presence +(44400, 44400, 1), +(44400, 44402, 2), +(44400, 44403, 3), + -- Night of the Dead +(55620, 55620, 1), +(55620, 55623, 2), + -- Nightfall +(18094, 18094, 1), +(18094, 18095, 2), + -- Noxious Stings +(53295, 53295, 1), +(53295, 53296, 2), +(53295, 53297, 3), + -- Nurturing Instinct +(47179, 47179, 1), +(47179, 47180, 2), + -- Nurturing Instinct +(33872, 33872, 1), +(33872, 33873, 2), + -- One-Handed Weapon Specialization +(16538, 16538, 1), +(16538, 16539, 2), +(16538, 16540, 3), +(16538, 16541, 4), +(16538, 16542, 5), + -- One-Handed Weapon Specialization +(20196, 20196, 1), +(20196, 20197, 2), +(20196, 20198, 3), + -- Opportunity +(14057, 14057, 1), +(14057, 14072, 2), + -- Outbreak +(49013, 49013, 1), +(49013, 55236, 2), +(49013, 55237, 3), + -- Owlkin Frenzy +(48389, 48389, 1), +(48389, 48392, 2), +(48389, 48393, 3), + -- Owl's Focus +(53514, 53514, 1), +(53514, 53516, 2), + -- Pain and Suffering +(47580, 47580, 1), +(47580, 47581, 2), +(47580, 47582, 3), + -- Pathfinding +(19559, 19559, 1), +(19559, 19560, 2), + -- Permafrost +(11175, 11175, 1), +(11175, 12569, 2), +(11175, 12571, 3), + -- Pet Aggression +(6311, 6311, 1), +(6311, 6314, 2), +(6311, 6315, 3), +(6311, 6316, 4), +(6311, 6317, 5), + -- Pet Barding +(53175, 53175, 1), +(53175, 53176, 2), + -- Pet Hardiness +(6280, 6280, 1), +(6280, 6281, 2), +(6280, 6282, 3), +(6280, 6283, 4), +(6280, 6286, 5), + -- Pet Recovery +(6328, 6328, 1), +(6328, 6331, 2), +(6328, 6332, 3), +(6328, 6333, 4), +(6328, 6334, 5), + -- Pet Resistance +(6443, 6443, 1), +(6443, 6444, 2), +(6443, 6445, 3), +(6443, 6446, 4), +(6443, 6447, 5), + -- Piercing Ice +(11151, 11151, 1), +(11151, 12952, 2), +(11151, 12953, 3), + -- Piercing Shots +(53234, 53234, 1), +(53234, 53237, 2), +(53234, 53238, 3), + -- Pin +(50245, 50245, 1), +(50245, 53544, 2), +(50245, 53545, 3), +(50245, 53546, 4), +(50245, 53547, 5), +(50245, 53548, 6), + -- Playing with Fire +(31638, 31638, 1), +(31638, 31639, 2), +(31638, 31640, 3), + -- Point of No Escape +(53298, 53298, 1), +(53298, 53299, 2), + -- Poison Spit +(35388, 35388, 1), +(35388, 35390, 2), +(35388, 35391, 3), + -- Poison Spit +(35387, 35387, 1), +(35387, 35389, 2), +(35387, 35392, 3), +(35387, 55555, 4), +(35387, 55556, 5), +(35387, 55557, 6), + -- Poleaxe Specialization +(12700, 12700, 1), +(12700, 12781, 2), +(12700, 12783, 3), +(12700, 12784, 4), +(12700, 12785, 5), + -- Polymorph +(118, 118, 1), +(118, 12824, 2), +(118, 12825, 3), +(118, 12826, 4), + -- Pounce +(9005, 9005, 1), +(9005, 9823, 2), +(9005, 9827, 3), +(9005, 27006, 4), +(9005, 49803, 5), + -- Pounce Bleed +(9007, 9007, 1), +(9007, 9824, 2), +(9007, 9826, 3), +(9007, 27007, 4), +(9007, 49804, 5), + -- Power Word: Fortitude +(1243, 1243, 1), +(1243, 1244, 2), +(1243, 1245, 3), +(1243, 2791, 4), +(1243, 10937, 5), +(1243, 10938, 6), +(1243, 25389, 7), +(1243, 48161, 8), + -- Power Word: Shield +(17, 17, 1), +(17, 592, 2), +(17, 600, 3), +(17, 3747, 4), +(17, 6065, 5), +(17, 6066, 6), +(17, 10898, 7), +(17, 10899, 8), +(17, 10900, 9), +(17, 10901, 10), +(17, 25217, 11), +(17, 25218, 12), +(17, 48065, 13), +(17, 48066, 14), + -- Prayer of Fortitude +(21562, 21562, 1), +(21562, 21564, 2), +(21562, 25392, 3), +(21562, 48162, 4), + -- Prayer of Healing +(596, 596, 1), +(596, 996, 2), +(596, 10960, 3), +(596, 10961, 4), +(596, 25316, 5), +(596, 25308, 6), +(596, 48072, 7), + -- Prayer of Mending +(41635, 41635, 1), +(41635, 48110, 2), +(41635, 48111, 3), + -- Prayer of Mending +(33076, 33076, 1), +(33076, 48112, 2), +(33076, 48113, 3), + -- Prayer of Shadow Protection +(27683, 27683, 1), +(27683, 39374, 2), +(27683, 48170, 3), + -- Prayer of Spirit +(27681, 27681, 1), +(27681, 32999, 2), +(27681, 48074, 3), + -- Precision +(29438, 29438, 1), +(29438, 29439, 2), +(29438, 29440, 3), + -- Precision +(13705, 13705, 1), +(13705, 13832, 2), +(13705, 13843, 3), +(13705, 13844, 4), +(13705, 13845, 5), + -- Precision +(29590, 29590, 1), +(29590, 29591, 2), +(29590, 29592, 3), + -- Predatory Instincts +(33859, 33859, 1), +(33859, 33866, 2), +(33859, 33867, 3), + -- Predatory Strikes +(16972, 16972, 1), +(16972, 16974, 2), +(16972, 16975, 3), + -- Prey on the Weak +(51685, 51685, 1), +(51685, 51686, 2), +(51685, 51687, 3), +(51685, 51688, 4), +(51685, 51689, 5), + -- Primal Precision +(48409, 48409, 1), +(48409, 48410, 2), + -- Primal Tenacity +(33851, 33851, 1), +(33851, 33852, 2), +(33851, 33957, 3), + -- Prismatic Cloak +(31574, 31574, 1), +(31574, 31575, 2), +(31574, 54354, 3), + -- Protector of the Pack +(57873, 57873, 1), +(57873, 57876, 2), +(57873, 57877, 3), + -- Prowl +(24450, 24450, 1), +(24450, 24452, 2), +(24450, 24453, 3), + -- Psychic Scream +(8122, 8122, 1), +(8122, 8124, 2), +(8122, 10888, 3), +(8122, 10890, 4), + -- Pummel +(13491, 13491, 1), +(13491, 6554, 2), +(13491, 6555, 3), + -- Puncture +(12308, 12308, 1), +(12308, 12810, 2), +(12308, 12811, 3), + -- Puncturing Wounds +(13733, 13733, 1), +(13733, 13865, 2), +(13733, 13866, 3), + -- Pure of Heart +(31822, 31822, 1), +(31822, 31823, 2), + -- Purge +(370, 370, 1), +(370, 8012, 2), + -- Purification +(16178, 16178, 1), +(16178, 16210, 2), +(16178, 16211, 3), +(16178, 16212, 4), +(16178, 16213, 5), + -- Purifying Power +(31825, 31825, 1), +(31825, 31826, 2), + -- Pursuit of Justice +(26022, 26022, 1), +(26022, 26023, 2), + -- Pyroblast +(11366, 11366, 1), +(11366, 12505, 2), +(11366, 12522, 3), +(11366, 12523, 4), +(11366, 12524, 5), +(11366, 12525, 6), +(11366, 12526, 7), +(11366, 18809, 8), +(11366, 27132, 9), +(11366, 33938, 10), +(11366, 42890, 11), +(11366, 42891, 12), + -- Pyroclasm +(18096, 18096, 1), +(18096, 18073, 2), +(18096, 63245, 3), + -- Pyromaniac +(34293, 34293, 1), +(34293, 34295, 2), +(34293, 34296, 3), + -- Quick Recovery +(31244, 31244, 1), +(31244, 31245, 2), + -- Rage of Rivendare +(50117, 50117, 1), +(50117, 50118, 2), +(50117, 50119, 3), +(50117, 50120, 4), +(50117, 50121, 5), + -- Rake +(1822, 1822, 1), +(1822, 1823, 2), +(1822, 1824, 3), +(1822, 9904, 4), +(1822, 27003, 5), +(1822, 48573, 6), +(1822, 48574, 7), + -- Rake +(59881, 59881, 1), +(59881, 59882, 2), +(59881, 59883, 3), +(59881, 59884, 4), +(59881, 59885, 5), +(59881, 59886, 6), + -- Ranged Weapon Specialization +(19507, 19507, 1), +(19507, 19508, 2), +(19507, 19509, 3), + -- Rapid Recuperation +(53228, 53228, 1), +(53228, 53232, 2), + -- Raptor Strike +(2973, 2973, 1), +(2973, 14260, 2), +(2973, 14261, 3), +(2973, 14262, 4), +(2973, 14263, 5), +(2973, 14264, 6), +(2973, 14265, 7), +(2973, 14266, 8), +(2973, 27014, 9), +(2973, 48995, 10), +(2973, 48996, 11), + -- Rapture +(47535, 47535, 1), +(47535, 47536, 2), +(47535, 47537, 3), + -- Ravage +(6785, 6785, 1), +(6785, 6787, 2), +(6785, 9866, 3), +(6785, 9867, 4), +(6785, 27005, 5), +(6785, 48578, 6), +(6785, 48579, 7), + -- Ravage +(50518, 50518, 1), +(50518, 53558, 2), +(50518, 53559, 3), +(50518, 53560, 4), +(50518, 53561, 5), +(50518, 53562, 6), + -- Ravenous Dead +(48965, 48965, 1), +(48965, 49571, 2), +(48965, 49572, 3), + -- Reaping +(49208, 49208, 1), +(49208, 56834, 2), +(49208, 56835, 3), + -- Rebirth +(20484, 20484, 1), +(20484, 20739, 2), +(20484, 20742, 3), +(20484, 20747, 4), +(20484, 20748, 5), +(20484, 26994, 6), +(20484, 48477, 7), + -- Reckoning +(20177, 20177, 1), +(20177, 20179, 2), +(20177, 20181, 3), +(20177, 20180, 4), +(20177, 20182, 5), + -- Redemption +(7328, 7328, 1), +(7328, 10322, 2), +(7328, 10324, 3), +(7328, 20772, 4), +(7328, 20773, 5), +(7328, 48949, 6), +(7328, 48950, 7), + -- Redoubt +(20127, 20127, 1), +(20127, 20130, 2), +(20127, 20135, 3), + -- Reflective Shield +(33201, 33201, 1), +(33201, 33202, 2), + -- Regeneration +(30799, 30799, 1), +(30799, 30800, 2), +(30799, 30801, 3), + -- Regrowth +(8936, 8936, 1), +(8936, 8938, 2), +(8936, 8939, 3), +(8936, 8940, 4), +(8936, 8941, 5), +(8936, 9750, 6), +(8936, 9856, 7), +(8936, 9857, 8), +(8936, 9858, 9), +(8936, 26980, 10), +(8936, 48442, 11), +(8936, 48443, 12), + -- Rejuvenation +(774, 774, 1), +(774, 1058, 2), +(774, 1430, 3), +(774, 2090, 4), +(774, 2091, 5), +(774, 3627, 6), +(774, 8910, 7), +(774, 9839, 8), +(774, 9840, 9), +(774, 9841, 10), +(774, 25299, 11), +(774, 26981, 12), +(774, 26982, 13), +(774, 48440, 14), +(774, 48441, 15), + -- Relentless Strikes +(14179, 14179, 1), +(14179, 58422, 2), +(14179, 58423, 3), +(14179, 58424, 4), +(14179, 58425, 5), + -- Remorseless +(14143, 14143, 1), +(14143, 14149, 2), + -- Remorseless Attacks +(14144, 14144, 1), +(14144, 14148, 2), + -- Rend +(772, 772, 1), +(772, 6546, 2), +(772, 6547, 3), +(772, 6548, 4), +(772, 11572, 5), +(772, 11573, 6), +(772, 11574, 7), +(772, 25208, 8), +(772, 46845, 9), +(772, 47465, 10), + -- Rend and Tear +(48432, 48432, 1), +(48432, 48433, 2), +(48432, 48434, 3), +(48432, 51268, 4), +(48432, 51269, 5), + -- Renew +(139, 139, 1), +(139, 6074, 2), +(139, 6075, 3), +(139, 6076, 4), +(139, 6077, 5), +(139, 6078, 6), +(139, 10927, 7), +(139, 10928, 8), +(139, 10929, 9), +(139, 25315, 10), +(139, 25221, 11), +(139, 25222, 12), +(139, 48067, 13), +(139, 48068, 14), + -- Renewed Hope +(57470, 57470, 1), +(57470, 57472, 2), + -- Replenish Mana +(5405, 5405, 1), +(5405, 10052, 2), +(5405, 10057, 3), +(5405, 10058, 4), +(5405, 27103, 5), +(5405, 42987, 6), +(5405, 42988, 7), + -- Resourcefulness +(34491, 34491, 1), +(34491, 34492, 2), +(34491, 34493, 3), + -- Restorative Totems +(16187, 16187, 1), +(16187, 16205, 2), +(16187, 16206, 3), + -- Resurrection +(2006, 2006, 1), +(2006, 2010, 2), +(2006, 10880, 3), +(2006, 10881, 4), +(2006, 20770, 5), +(2006, 25435, 6), +(2006, 48171, 7), + -- Retribution Aura +(7294, 7294, 1), +(7294, 10298, 2), +(7294, 10299, 3), +(7294, 10300, 4), +(7294, 10301, 5), +(7294, 27150, 6), +(7294, 54043, 7), + -- Revenge +(6572, 6572, 1), +(6572, 6574, 2), +(6572, 7379, 3), +(6572, 11600, 4), +(6572, 11601, 5), +(6572, 25288, 6), +(6572, 25269, 7), +(6572, 30357, 8), +(6572, 57823, 9), + -- Reverberation +(16040, 16040, 1), +(16040, 16113, 2), +(16040, 16114, 3), +(16040, 16115, 4), +(16040, 16116, 5), + -- Revitalize +(48539, 48539, 1), +(48539, 48544, 2), +(48539, 48545, 3), + -- Revive +(50769, 50769, 1), +(50769, 50768, 2), +(50769, 50767, 3), +(50769, 50766, 4), +(50769, 50765, 5), +(50769, 50764, 6), +(50769, 50763, 7), + -- Righteous Vengeance +(53380, 53380, 1), +(53380, 53381, 2), +(53380, 53382, 3), + -- Rime +(49188, 49188, 1), +(49188, 56822, 2), +(49188, 59057, 3), + -- Rip +(1079, 1079, 1), +(1079, 9492, 2), +(1079, 9493, 3), +(1079, 9752, 4), +(1079, 9894, 5), +(1079, 9896, 6), +(1079, 27008, 7), +(1079, 49799, 8), +(1079, 49800, 9), + -- Riptide +(61295, 61295, 1), +(61295, 61299, 2), +(61295, 61300, 3), +(61295, 61301, 4), + -- Ritual of Refreshment +(43987, 43987, 1), +(43987, 58659, 2), + -- Ritual of Souls +(29893, 29893, 1), +(29893, 58887, 2), + -- Rockbiter Weapon +(8017, 8017, 1), +(8017, 8018, 2), +(8017, 8019, 3), +(8017, 10399, 4), + -- Ruin +(17959, 17959, 1), +(17959, 59738, 2), +(17959, 59739, 3), +(17959, 59740, 4), +(17959, 59741, 5), + -- Runic Power Mastery +(49455, 49455, 1), +(49455, 50147, 2), + -- Rupture +(1943, 1943, 1), +(1943, 8639, 2), +(1943, 8640, 3), +(1943, 11273, 4), +(1943, 11274, 5), +(1943, 11275, 6), +(1943, 26867, 7), +(1943, 48671, 8), +(1943, 48672, 9), + -- Ruthlessness +(14156, 14156, 1), +(14156, 14160, 2), +(14156, 14161, 3), + -- Sacred Cleansing +(53551, 53551, 1), +(53551, 53552, 2), +(53551, 53553, 3), + -- Sacred Duty +(31848, 31848, 1), +(31848, 31849, 2), + -- Sacrifice +(7812, 7812, 1), +(7812, 19438, 2), +(7812, 19440, 3), +(7812, 19441, 4), +(7812, 19442, 5), +(7812, 19443, 6), +(7812, 27273, 7), +(7812, 47985, 8), +(7812, 47986, 9), + -- Sanctified Light +(20359, 20359, 1), +(20359, 20360, 2), +(20359, 20361, 3), + -- Sanctified Wrath +(53375, 53375, 1), +(53375, 53376, 2), + -- Sanctity of Battle +(32043, 32043, 1), +(32043, 35396, 2), +(32043, 35397, 3), + -- Sap +(6770, 6770, 1), +(6770, 2070, 2), +(6770, 11297, 3), +(6770, 51724, 4), + -- Savage Combat +(58684, 58684, 1), +(58684, 58683, 2), + -- Savage Combat +(51682, 51682, 1), +(51682, 58413, 2), + -- Savage Fury +(16998, 16998, 1), +(16998, 16999, 2), + -- Savage Strikes +(19159, 19159, 1), +(19159, 19160, 2), + -- Scare Beast +(1513, 1513, 1), +(1513, 14326, 2), +(1513, 14327, 3), + -- Scent of Blood +(49004, 49004, 1), +(49004, 49508, 2), +(49004, 49509, 3), + -- Scorch +(1811, 1811, 1), +(1811, 8447, 2), +(1811, 8448, 3), +(1811, 8449, 4), +(1811, 10208, 5), +(1811, 10209, 6), +(1811, 10210, 7), +(1811, 27375, 8), +(1811, 27376, 9), + -- Scorch +(2948, 2948, 1), +(2948, 8444, 2), +(2948, 8445, 3), +(2948, 8446, 4), +(2948, 10205, 5), +(2948, 10206, 6), +(2948, 10207, 7), +(2948, 27073, 8), +(2948, 27074, 9), +(2948, 42858, 10), +(2948, 42859, 11), + -- Scorpid Poison +(24641, 24641, 1), +(24641, 24584, 2), +(24641, 24588, 3), +(24641, 24589, 4), +(24641, 27361, 5), + -- Scorpid Poison +(24640, 24640, 1), +(24640, 24583, 2), +(24640, 24586, 3), +(24640, 24587, 4), +(24640, 27060, 5), +(24640, 55728, 6), + -- Scourge Strike +(55090, 55090, 1), +(55090, 55265, 2), +(55090, 55270, 3), +(55090, 55271, 4), + -- Seal Fate +(14186, 14186, 1), +(14186, 14190, 2), +(14186, 14193, 3), +(14186, 14194, 4), +(14186, 14195, 5), + -- Seals of the Pure +(20224, 20224, 1), +(20224, 20225, 2), +(20224, 20330, 3), +(20224, 20331, 4), +(20224, 20332, 5), + -- Searing Light +(14909, 14909, 1), +(14909, 15017, 2), + -- Searing Pain +(5676, 5676, 1), +(5676, 17919, 2), +(5676, 17920, 3), +(5676, 17921, 4), +(5676, 17922, 5), +(5676, 17923, 6), +(5676, 27210, 7), +(5676, 30459, 8), +(5676, 47814, 9), +(5676, 47815, 10), + -- Searing Totem +(2075, 2075, 1), +(2075, 38116, 2), + -- Searing Totem +(3599, 3599, 1), +(3599, 6363, 2), +(3599, 6364, 3), +(3599, 6365, 4), +(3599, 10437, 5), +(3599, 10438, 6), +(3599, 25533, 7), +(3599, 58699, 8), +(3599, 58703, 9), +(3599, 58704, 10), + -- Seed of Corruption +(43991, 43991, 1), +(43991, 47831, 2), +(43991, 47832, 3), + -- Serendipity +(63730, 63730, 1), +(63730, 63733, 2), +(63730, 63737, 3), + -- Serenity Dust +(50318, 50318, 1), +(50318, 52012, 2), +(50318, 52013, 3), +(50318, 52014, 4), +(50318, 52015, 5), +(50318, 52016, 6), + -- Serious Wound +(5597, 5597, 1), +(5597, 5598, 2), + -- Serpent Sting +(1978, 1978, 1), +(1978, 13549, 2), +(1978, 13550, 3), +(1978, 13551, 4), +(1978, 13552, 5), +(1978, 13553, 6), +(1978, 13554, 7), +(1978, 13555, 8), +(1978, 25295, 9), +(1978, 27016, 10), +(1978, 49000, 11), +(1978, 49001, 12), + -- Serpent's Swiftness +(34466, 34466, 1), +(34466, 34467, 2), +(34466, 34468, 3), +(34466, 34469, 4), +(34466, 34470, 5), + -- Serrated Blades +(14171, 14171, 1), +(14171, 14172, 2), +(14171, 14173, 3), + -- Setup +(13983, 13983, 1), +(13983, 14070, 2), +(13983, 14071, 3), + -- Shackle Undead +(9484, 9484, 1), +(9484, 9485, 2), +(9484, 10955, 3), + -- Shadow Affinity +(15318, 15318, 1), +(15318, 15272, 2), +(15318, 15320, 3), + -- Shadow and Flame +(30288, 30288, 1), +(30288, 30289, 2), +(30288, 30290, 3), +(30288, 30291, 4), +(30288, 30292, 5), + -- Shadow Bite +(54049, 54049, 1), +(54049, 54050, 2), +(54049, 54051, 3), +(54049, 54052, 4), +(54049, 54053, 5), + -- Shadow Bolt +(686, 686, 1), +(686, 695, 2), +(686, 705, 3), +(686, 1088, 4), +(686, 1106, 5), +(686, 7641, 6), +(686, 11659, 7), +(686, 11660, 8), +(686, 11661, 9), +(686, 25307, 10), +(686, 27209, 11), +(686, 47808, 12), +(686, 47809, 13), + -- Shadow Embrace +(32385, 32385, 1), +(32385, 32387, 2), +(32385, 32392, 3), +(32385, 32393, 4), +(32385, 32394, 5), + -- Shadow Focus +(15260, 15260, 1), +(15260, 15327, 2), +(15260, 15328, 3), + -- Shadow Mastery +(18271, 18271, 1), +(18271, 18272, 2), +(18271, 18273, 3), +(18271, 18274, 4), +(18271, 18275, 5), + -- Shadow Power +(33221, 33221, 1), +(33221, 33222, 2), +(33221, 33223, 3), +(33221, 33224, 4), +(33221, 33225, 5), + -- Shadow Protection +(976, 976, 1), +(976, 10957, 2), +(976, 10958, 3), +(976, 25433, 4), +(976, 48169, 5), + -- Shadow Reach +(17322, 17322, 1), +(17322, 17323, 2), + -- Shadow Resistance Aura +(19876, 19876, 1), +(19876, 19895, 2), +(19876, 19896, 3), +(19876, 27151, 4), +(19876, 48943, 5), + -- Shadow Ward +(6229, 6229, 1), +(6229, 11739, 2), +(6229, 11740, 3), +(6229, 28610, 4), +(6229, 47890, 5), +(6229, 47891, 6), + -- Shadow Weaving +(15257, 15257, 1), +(15257, 15331, 2), +(15257, 15332, 3), + -- Shadow Word: Death +(32379, 32379, 1), +(32379, 32996, 2), +(32379, 48157, 3), +(32379, 48158, 4), + -- Shadow Word: Pain +(589, 589, 1), +(589, 594, 2), +(589, 970, 3), +(589, 992, 4), +(589, 2767, 5), +(589, 10892, 6), +(589, 10893, 7), +(589, 10894, 8), +(589, 25367, 9), +(589, 25368, 10), +(589, 48124, 11), +(589, 48125, 12), + -- Shadowburn +(17877, 17877, 1), +(17877, 18867, 2), +(17877, 18868, 3), +(17877, 18869, 4), +(17877, 18870, 5), +(17877, 18871, 6), +(17877, 27263, 7), +(17877, 30546, 8), +(17877, 47826, 9), +(17877, 47827, 10), + -- Shadowflame +(47897, 47897, 1), +(47897, 61290, 2), + -- Shadowfury +(30283, 30283, 1), +(30283, 30413, 2), +(30283, 30414, 3), +(30283, 47846, 4), +(30283, 47847, 5), + -- Shamanism +(62097, 62097, 1), +(62097, 62098, 2), +(62097, 62099, 3), +(62097, 62100, 4), +(62097, 62101, 5), + -- Shark Attack +(62759, 62759, 1), +(62759, 62760, 2), + -- Sharpened Claws +(16942, 16942, 1), +(16942, 16943, 2), +(16942, 16944, 3), + -- Shatter +(11170, 11170, 1), +(11170, 12982, 2), +(11170, 12983, 3), + -- Shattered Barrier +(44745, 44745, 1), +(44745, 54787, 2), + -- Sheath of Light +(53501, 53501, 1), +(53501, 53502, 2), +(53501, 53503, 3), + -- Shield Mastery +(29598, 29598, 1), +(29598, 29599, 2), + -- Shield of Righteousness +(53600, 53600, 1), +(53600, 61411, 2), + -- Shield of the Templar +(53709, 53709, 1), +(53709, 53710, 2), +(53709, 53711, 3), + -- Shield Slam +(23922, 23922, 1), +(23922, 23923, 2), +(23922, 23924, 3), +(23922, 23925, 4), +(23922, 25258, 5), +(23922, 30356, 6), +(23922, 47487, 7), +(23922, 47488, 8), + -- Shield Specialization +(12298, 12298, 1), +(12298, 12724, 2), +(12298, 12725, 3), +(12298, 12726, 4), +(12298, 12727, 5), + -- Shield Specialization +(16253, 16253, 1), +(16253, 16298, 2), + -- Shock +(2607, 2607, 1), +(2607, 2606, 2), +(2607, 2608, 3), +(2607, 2609, 4), +(2607, 2610, 5), + -- Shred +(5221, 5221, 1), +(5221, 6800, 2), +(5221, 8992, 3), +(5221, 9829, 4), +(5221, 9830, 5), +(5221, 27001, 6), +(5221, 27002, 7), +(5221, 48571, 8), +(5221, 48572, 9), + -- Shredding Attacks +(16966, 16966, 1), +(16966, 16968, 2), + -- Silenced - Improved Counterspell +(18469, 18469, 1), +(18469, 55021, 2), + -- Silent Hunter +(34472, 34472, 1), +(34472, 34473, 2), +(34472, 34474, 3), + -- Silent Resolve +(14523, 14523, 1), +(14523, 14784, 2), +(14523, 14785, 3), + -- Silverback +(62764, 62764, 1), +(62764, 62765, 2), + -- Sinister Calling +(31216, 31216, 1), +(31216, 31217, 2), +(31216, 31218, 3), +(31216, 31219, 4), +(31216, 31220, 5), + -- Sinister Strike +(1752, 1752, 1), +(1752, 1757, 2), +(1752, 1758, 3), +(1752, 1759, 4), +(1752, 1760, 5), +(1752, 8621, 6), +(1752, 11293, 7), +(1752, 11294, 8), +(1752, 26861, 9), +(1752, 26862, 10), +(1752, 48637, 11), +(1752, 48638, 12), + -- Skinning +(8613, 8613, 1), +(8613, 8617, 2), +(8613, 8618, 3), +(8613, 10768, 4), +(8613, 32678, 5), +(8613, 50305, 6), + -- Slam +(1464, 1464, 1), +(1464, 8820, 2), +(1464, 11604, 3), +(1464, 11605, 4), +(1464, 25241, 5), +(1464, 25242, 6), +(1464, 47474, 7), +(1464, 47475, 8), + -- Slaughter from the Shadows +(51708, 51708, 1), +(51708, 51709, 2), +(51708, 51710, 3), +(51708, 51711, 4), +(51708, 51712, 5), + -- Sleep +(700, 700, 1), +(700, 1090, 2), + -- Sleight of Hand +(30892, 30892, 1), +(30892, 30893, 2), + -- Slice and Dice +(5171, 5171, 1), +(5171, 6774, 2), + -- Slow +(246, 246, 1), +(246, 6146, 2), + -- Smack +(49966, 49966, 1), +(49966, 49967, 2), +(49966, 49968, 3), +(49966, 49969, 4), +(49966, 49970, 5), +(49966, 49971, 6), +(49966, 49972, 7), +(49966, 49973, 8), +(49966, 49974, 9), +(49966, 52475, 10), +(49966, 52476, 11), + -- Smite +(585, 585, 1), +(585, 591, 2), +(585, 598, 3), +(585, 984, 4), +(585, 1004, 5), +(585, 6060, 6), +(585, 10933, 7), +(585, 10934, 8), +(585, 25363, 9), +(585, 25364, 10), +(585, 48122, 11), +(585, 48123, 12), + -- Snatch +(50541, 50541, 1), +(50541, 53537, 2), +(50541, 53538, 3), +(50541, 53540, 4), +(50541, 53542, 5), +(50541, 53543, 6), + -- Sniper Training +(53302, 53302, 1), +(53302, 53303, 2), +(53302, 53304, 3), + -- Sonic Blast +(50519, 50519, 1), +(50519, 53564, 2), +(50519, 53565, 3), +(50519, 53566, 4), +(50519, 53567, 5), +(50519, 53568, 6), + -- Soothe Animal +(2908, 2908, 1), +(2908, 8955, 2), +(2908, 9901, 3), +(2908, 26995, 4), + -- Soothing Kiss +(6360, 6360, 1), +(6360, 7813, 2), +(6360, 11784, 3), +(6360, 11785, 4), +(6360, 27275, 5), + -- Soul Fire +(6353, 6353, 1), +(6353, 17924, 2), +(6353, 27211, 3), +(6353, 30545, 4), +(6353, 47824, 5), +(6353, 47825, 6), + -- Soul Leech +(30293, 30293, 1), +(30293, 30295, 2), +(30293, 30296, 3), + -- Soul Siphon +(17804, 17804, 1), +(17804, 17805, 2), + -- Spark of Nature +(48435, 48435, 1), +(48435, 48436, 2), +(48435, 48437, 3), + -- Spell Deflection +(49145, 49145, 1), +(49145, 49495, 2), +(49145, 49497, 3), + -- Spell Impact +(11242, 11242, 1), +(11242, 12467, 2), +(11242, 12469, 3), + -- Spell Lock +(19244, 19244, 1), +(19244, 19647, 2), + -- Spell Power +(35578, 35578, 1), +(35578, 35581, 2), + -- Spell Warding +(27900, 27900, 1), +(27900, 27901, 2), +(27900, 27902, 3), +(27900, 27903, 4), +(27900, 27904, 5), + -- Spider's Bite +(53203, 53203, 1), +(53203, 53204, 2), +(53203, 53205, 3), + -- Spiked Collar +(53182, 53182, 1), +(53182, 53183, 2), +(53182, 53184, 3), + -- Spirit +(8112, 8112, 1), +(8112, 8113, 2), +(8112, 8114, 3), +(8112, 12177, 4), +(8112, 33080, 5), +(8112, 43197, 6), +(8112, 48103, 7), +(8112, 48104, 8), + -- Spirit Strike +(61193, 61193, 1), +(61193, 61194, 2), +(61193, 61195, 3), +(61193, 61196, 4), +(61193, 61197, 5), +(61193, 61198, 6), + -- Spirit Tap +(15270, 15270, 1), +(15270, 15335, 2), +(15270, 15336, 3), + -- Spiritual Attunement +(31785, 31785, 1), +(31785, 33776, 2), + -- Spiritual Focus +(20205, 20205, 1), +(20205, 20206, 2), +(20205, 20207, 3), +(20205, 20209, 4), +(20205, 20208, 5), + -- Spiritual Guidance +(14901, 14901, 1), +(14901, 15028, 2), +(14901, 15029, 3), +(14901, 15030, 4), +(14901, 15031, 5), + -- Spiritual Healing +(14898, 14898, 1), +(14898, 15349, 2), +(14898, 15354, 3), +(14898, 15355, 4), +(14898, 15356, 5), + -- Spore Cloud +(50274, 50274, 1), +(50274, 53593, 2), +(50274, 53594, 3), +(50274, 53596, 4), +(50274, 53597, 5), +(50274, 53598, 6), + -- Sprint +(2983, 2983, 1), +(2983, 8696, 2), +(2983, 11305, 3), + -- Stampede +(57386, 57386, 1), +(57386, 57389, 2), +(57386, 57390, 3), +(57386, 57391, 4), +(57386, 57392, 5), +(57386, 57393, 6), + -- Starfall +(48505, 48505, 1), +(48505, 53199, 2), +(48505, 53200, 3), +(48505, 53201, 4), + -- Starfire +(2912, 2912, 1), +(2912, 8949, 2), +(2912, 8950, 3), +(2912, 8951, 4), +(2912, 9875, 5), +(2912, 9876, 6), +(2912, 25298, 7), +(2912, 26986, 8), +(2912, 48464, 9), +(2912, 48465, 10), + -- Starlight Wrath +(16814, 16814, 1), +(16814, 16815, 2), +(16814, 16816, 3), +(16814, 16817, 4), +(16814, 16818, 5), + -- Static Shock +(51525, 51525, 1), +(51525, 51526, 2), +(51525, 51527, 3), + -- Steady Shot +(56641, 56641, 1), +(56641, 34120, 2), +(56641, 49051, 3), +(56641, 49052, 4), + -- Sting +(56626, 56626, 1), +(56626, 56627, 2), +(56626, 56628, 3), +(56626, 56629, 4), +(56626, 56630, 5), +(56626, 56631, 6), + -- Stoicism +(31844, 31844, 1), +(31844, 31845, 2), +(31844, 53519, 3), + -- Stoneclaw Totem +(5730, 5730, 1), +(5730, 6390, 2), +(5730, 6391, 3), +(5730, 6392, 4), +(5730, 10427, 5), +(5730, 10428, 6), +(5730, 25525, 7), +(5730, 58580, 8), +(5730, 58581, 9), +(5730, 58582, 10), + -- Stoneclaw Totem Passive +(5728, 5728, 1), +(5728, 6397, 2), +(5728, 6398, 3), +(5728, 6399, 4), +(5728, 10425, 5), +(5728, 10426, 6), +(5728, 25513, 7), +(5728, 58583, 8), +(5728, 58584, 9), +(5728, 58585, 10), + -- Stoneskin Totem +(8073, 8073, 1), +(8073, 38115, 2), + -- Stoneskin Totem +(8071, 8071, 1), +(8071, 8154, 2), +(8071, 8155, 3), +(8071, 10406, 4), +(8071, 10407, 5), +(8071, 10408, 6), +(8071, 25508, 7), +(8071, 25509, 8), +(8071, 58751, 9), +(8071, 58753, 10), + -- Storm, Earth and Fire +(51483, 51483, 1), +(51483, 51485, 2), +(51483, 51486, 3), + -- Strength +(8118, 8118, 1), +(8118, 8119, 2), +(8118, 8120, 3), +(8118, 12179, 4), +(8118, 33082, 5), +(8118, 43199, 6), +(8118, 58448, 7), +(8118, 58449, 8), + -- Strength of Arms +(46865, 46865, 1), +(46865, 46866, 2), + -- Strength of Earth Totem +(8075, 8075, 1), +(8075, 8160, 2), +(8075, 8161, 3), +(8075, 10442, 4), +(8075, 25361, 5), +(8075, 25528, 6), +(8075, 57622, 7), +(8075, 58643, 8), + -- Student of the Mind +(44397, 44397, 1), +(44397, 44398, 2), +(44397, 44399, 3), + -- Stunning Blast +(5648, 5648, 1), +(5648, 5649, 2), + -- Stunning Blow +(5726, 5726, 1), +(5726, 5727, 2), + -- Subtlety +(17118, 17118, 1), +(17118, 17119, 2), +(17118, 17120, 3), + -- Subversion +(48997, 48997, 1), +(48997, 49490, 2), +(48997, 49491, 3), + -- Sudden Death +(29723, 29723, 1), +(29723, 29725, 2), +(29723, 29724, 3), + -- Sudden Doom +(49018, 49018, 1), +(49018, 49529, 2), +(49018, 49530, 3), + -- Suffering +(17735, 17735, 1), +(17735, 17750, 2), +(17735, 17751, 3), +(17735, 17752, 4), +(17735, 27271, 5), +(17735, 33701, 6), +(17735, 47989, 7), +(17735, 47990, 8), + -- Suppression +(18174, 18174, 1), +(18174, 18175, 2), +(18174, 18176, 3), + -- Surefooted +(19290, 19290, 1), +(19290, 19294, 2), +(19290, 24283, 3), + -- Survival Instincts +(34494, 34494, 1), +(34494, 34496, 2), + -- Survival of the Fittest +(33853, 33853, 1), +(33853, 33855, 2), +(33853, 33856, 3), + -- Survival Tactics +(19286, 19286, 1), +(19286, 19287, 2), + -- Survivalist +(19255, 19255, 1), +(19255, 19256, 2), +(19255, 19257, 3), +(19255, 19258, 4), +(19255, 19259, 5), + -- Swift Retribution +(53379, 53379, 1), +(53379, 53484, 2), +(53379, 53648, 3), + -- Swipe +(50256, 50256, 1), +(50256, 53526, 2), +(50256, 53528, 3), +(50256, 53529, 4), +(50256, 53532, 5), +(50256, 53533, 6), + -- Swipe (Bear) +(779, 779, 1), +(779, 780, 2), +(779, 769, 3), +(779, 9754, 4), +(779, 9908, 5), +(779, 26997, 6), +(779, 48561, 7), +(779, 48562, 8), + -- Sword and Board +(46951, 46951, 1), +(46951, 46952, 2), +(46951, 46953, 3), + -- Sword Specialization +(12281, 12281, 1), +(12281, 12812, 2), +(12281, 12813, 3), +(12281, 12814, 4), +(12281, 12815, 5), + -- T.N.T. +(56333, 56333, 1), +(56333, 56336, 2), +(56333, 56337, 3), + -- Tactical Mastery +(12295, 12295, 1), +(12295, 12676, 2), +(12295, 12677, 3), + -- Tailoring +(3908, 3908, 1), +(3908, 3909, 2), +(3908, 3910, 3), +(3908, 12180, 4), +(3908, 26790, 5), +(3908, 51309, 6), + -- Taste for Blood +(56636, 56636, 1), +(56636, 56637, 2), +(56636, 56638, 3), + -- Tendon Rip +(50271, 50271, 1), +(50271, 53571, 2), +(50271, 53572, 3), +(50271, 53573, 4), +(50271, 53574, 5), +(50271, 53575, 6), + -- Test of Faith +(47558, 47558, 1), +(47558, 47559, 2), +(47558, 47560, 3), + -- Thick Hide +(19609, 19609, 1), +(19609, 19610, 2), +(19609, 19612, 3), + -- Thick Hide +(16929, 16929, 1), +(16929, 16930, 2), +(16929, 16931, 3), + -- Thorns +(467, 467, 1), +(467, 782, 2), +(467, 1075, 3), +(467, 8914, 4), +(467, 9756, 5), +(467, 9910, 6), +(467, 26992, 7), +(467, 53307, 8), + -- Threat of Thassarian +(65661, 65661, 1), +(65661, 66191, 2), +(65661, 66192, 3), + -- Thrill of the Hunt +(34497, 34497, 1), +(34497, 34498, 2), +(34497, 34499, 3), + -- Throwing Specialization +(5952, 5952, 1), +(5952, 51679, 2), + -- Thunder Clap +(6343, 6343, 1), +(6343, 8198, 2), +(6343, 8204, 3), +(6343, 8205, 4), +(6343, 11580, 5), +(6343, 11581, 6), +(6343, 25264, 7), +(6343, 47501, 8), +(6343, 47502, 9), + -- Thundering Strikes +(16255, 16255, 1), +(16255, 16302, 2), +(16255, 16303, 3), +(16255, 16304, 4), +(16255, 16305, 5), + -- Thunderstorm +(51490, 51490, 1), +(51490, 59156, 2), +(51490, 59158, 3), +(51490, 59159, 4), + -- Tidal Focus +(16179, 16179, 1), +(16179, 16214, 2), +(16179, 16215, 3), +(16179, 16216, 4), +(16179, 16217, 5), + -- Tidal Mastery +(16194, 16194, 1), +(16194, 16218, 2), +(16194, 16219, 3), +(16194, 16220, 4), +(16194, 16221, 5), + -- Tidal Waves +(51562, 51562, 1), +(51562, 51563, 2), +(51562, 51564, 3), +(51562, 51565, 4), +(51562, 51566, 5), + -- Tiger's Fury +(5217, 5217, 1), +(5217, 6793, 2), +(5217, 9845, 3), +(5217, 9846, 4), +(5217, 50212, 5), +(5217, 50213, 6), + -- Torment +(3716, 3716, 1), +(3716, 7809, 2), +(3716, 7810, 3), +(3716, 7811, 4), +(3716, 11774, 5), +(3716, 11775, 6), +(3716, 27270, 7), +(3716, 47984, 8), + -- Torment the Weak +(29447, 29447, 1), +(29447, 55339, 2), +(29447, 55340, 3), + -- Torture +(47263, 47263, 1), +(47263, 47264, 2), +(47263, 47265, 3), + -- Totem of Wrath +(30706, 30706, 1), +(30706, 57720, 2), +(30706, 57721, 3), +(30706, 57722, 4), + -- Totemic Focus +(16173, 16173, 1), +(16173, 16222, 2), +(16173, 16223, 3), +(16173, 16224, 4), +(16173, 16225, 5), + -- Touched by the Light +(53590, 53590, 1), +(53590, 53591, 2), +(53590, 53592, 3), + -- Toughness +(53120, 53120, 1), +(53120, 53121, 2), +(53120, 53122, 3), +(53120, 53123, 4), +(53120, 53124, 5), +(53120, 53040, 6), + -- Toughness +(12299, 12299, 1), +(12299, 12761, 2), +(12299, 12762, 3), +(12299, 12763, 4), +(12299, 12764, 5), + -- Toughness +(20143, 20143, 1), +(20143, 20144, 2), +(20143, 20145, 3), +(20143, 20146, 4), +(20143, 20147, 5), + -- Toughness +(16252, 16252, 1), +(16252, 16306, 2), +(16252, 16307, 3), +(16252, 16308, 4), +(16252, 16309, 5), + -- Toughness +(49042, 49042, 1), +(49042, 49786, 2), +(49042, 49787, 3), +(49042, 49788, 4), +(49042, 49789, 5), + -- Tranquil Spirit +(24968, 24968, 1), +(24968, 24969, 2), +(24968, 24970, 3), +(24968, 24971, 4), +(24968, 24972, 5), + -- Trap Mastery +(19376, 19376, 1), +(19376, 63457, 2), +(19376, 63458, 3), + -- Tundra Stalker +(49202, 49202, 1), +(49202, 50127, 2), +(49202, 50128, 3), +(49202, 50129, 4), +(49202, 50130, 5), + -- Turn the Tables +(51627, 51627, 1), +(51627, 51628, 2), +(51627, 51629, 3), + -- Twin Disciplines +(47586, 47586, 1), +(47586, 47587, 2), +(47586, 47588, 3), +(47586, 52802, 4), +(47586, 52803, 5), + -- Twisted Faith +(47573, 47573, 1), +(47573, 47577, 2), +(47573, 47578, 3), +(47573, 51166, 4), +(47573, 51167, 5), + -- Two-Handed Weapon Specialization +(12163, 12163, 1), +(12163, 12711, 2), +(12163, 12712, 3), + -- Two-Handed Weapon Specialization +(20111, 20111, 1), +(20111, 20112, 2), +(20111, 20113, 3), + -- Two-Handed Weapon Specialization +(55107, 55107, 1), +(55107, 55108, 2), + -- Unbreakable Will +(14522, 14522, 1), +(14522, 14788, 2), +(14522, 14789, 3), +(14522, 14790, 4), +(14522, 14791, 5), + -- Unending Fury +(56927, 56927, 1), +(56927, 56929, 2), +(56927, 56930, 3), +(56927, 56931, 4), +(56927, 56932, 5), + -- Unholy Command +(49588, 49588, 1), +(49588, 49589, 2), + -- Unholy Power +(18769, 18769, 1), +(18769, 18770, 2), +(18769, 18771, 3), +(18769, 18772, 4), +(18769, 18773, 5), + -- Unleashed Fury +(19616, 19616, 1), +(19616, 19617, 2), +(19616, 19618, 3), +(19616, 19619, 4), +(19616, 19620, 5), + -- Unrelenting Assault +(46859, 46859, 1), +(46859, 46860, 2), + -- Unrelenting Storm +(30664, 30664, 1), +(30664, 30665, 2), +(30664, 30666, 3), + -- Unstable Affliction +(30108, 30108, 1), +(30108, 30404, 2), +(30108, 30405, 3), +(30108, 47841, 4), +(30108, 47843, 5), + -- Unyielding Faith +(9453, 9453, 1), +(9453, 25836, 2), + -- Vampiric Touch +(34914, 34914, 1), +(34914, 34916, 2), +(34914, 34917, 3), +(34914, 48159, 4), +(34914, 48160, 5), + -- Vanish +(1856, 1856, 1), +(1856, 1857, 2), +(1856, 26889, 3), + -- Veiled Shadows +(15274, 15274, 1), +(15274, 15311, 2), + -- Vendetta +(49015, 49015, 1), +(49015, 50154, 2), +(49015, 55136, 3), + -- Vengeance +(20049, 20049, 1), +(20049, 20056, 2), +(20049, 20057, 3), + -- Vengeance +(16909, 16909, 1), +(16909, 16910, 2), +(16909, 16911, 3), +(16909, 16912, 4), +(16909, 16913, 5), + -- Venom Web Spray +(54706, 54706, 1), +(54706, 55505, 2), +(54706, 55506, 3), +(54706, 55507, 4), +(54706, 55508, 5), +(54706, 55509, 6), + -- Veteran of the Third War +(49006, 49006, 1), +(49006, 49526, 2), +(49006, 50029, 3), + -- Vicious Strikes +(51745, 51745, 1), +(51745, 51746, 2), + -- Vile Poisons +(16513, 16513, 1), +(16513, 16514, 2), +(16513, 16515, 3), + -- Virulence +(48962, 48962, 1), +(48962, 49567, 2), +(48962, 49568, 3), + -- Vitality +(31122, 31122, 1), +(31122, 31123, 2), +(31122, 61329, 3), + -- Vitality +(29140, 29140, 1), +(29140, 29143, 2), +(29140, 29144, 3), + -- Wand Specialization +(14524, 14524, 1), +(14524, 14525, 2), +(14524, 14526, 3), +(14524, 14527, 4), +(14524, 14528, 5), + -- Wandering Plague +(49217, 49217, 1), +(49217, 49654, 2), +(49217, 49655, 3), + -- Water Shield +(52127, 52127, 1), +(52127, 52129, 2), +(52127, 52131, 3), +(52127, 52134, 4), +(52127, 52136, 5), +(52127, 52138, 6), +(52127, 24398, 7), +(52127, 33736, 8), +(52127, 57960, 9), + -- Waylay +(51692, 51692, 1), +(51692, 51696, 2), + -- Weapon Expertise +(30919, 30919, 1), +(30919, 30920, 2), + -- Weapon Mastery +(20504, 20504, 1), +(20504, 20505, 2), + -- Weapon Mastery +(29082, 29082, 1), +(29082, 29084, 2), +(29082, 29086, 3), + -- Wild Growth +(48438, 48438, 1), +(48438, 53248, 2), +(48438, 53249, 3), +(48438, 53251, 4), + -- Wild Hunt +(62758, 62758, 1), +(62758, 62762, 2), + -- Wild Quiver +(53215, 53215, 1), +(53215, 53216, 2), +(53215, 53217, 3), + -- Windfury Weapon +(8232, 8232, 1), +(8232, 8235, 2), +(8232, 10486, 3), +(8232, 16362, 4), +(8232, 25505, 5), +(8232, 58801, 6), +(8232, 58803, 7), +(8232, 58804, 8), + -- Winter's Chill +(11180, 11180, 1), +(11180, 28592, 2), +(11180, 28593, 3), + -- World in Flames +(11108, 11108, 1), +(11108, 12349, 2), +(11108, 12350, 3), + -- Wrath +(5176, 5176, 1), +(5176, 5177, 2), +(5176, 5178, 3), +(5176, 5179, 4), +(5176, 5180, 5), +(5176, 6780, 6), +(5176, 8905, 7), +(5176, 9912, 8), +(5176, 26984, 9), +(5176, 26985, 10), +(5176, 48459, 11), +(5176, 48461, 12), + -- Wrath of Cenarius +(33603, 33603, 1), +(33603, 33604, 2), +(33603, 33605, 3), +(33603, 33606, 4), +(33603, 33607, 5), + -- Wrecking Crew +(46867, 46867, 1), +(46867, 56611, 2), +(46867, 56612, 3), +(46867, 56613, 4), +(46867, 56614, 5), + -- Arcane Brilliance +(23030, 23030, 1), +(23030, 27394, 2), + -- Arcane Explosion +(1467, 1467, 1), +(1467, 8440, 2), +(1467, 8441, 3), +(1467, 8442, 4), +(1467, 10203, 5), +(1467, 10204, 6), +(1467, 27380, 7), +(1467, 27381, 8), + -- Arcane Intellect +(1472, 1472, 1), +(1472, 1473, 2), +(1472, 1474, 3), +(1472, 1475, 4), +(1472, 10158, 5), +(1472, 27393, 6), +(1472, 42999, 7), + -- Arcane Missiles +(5143, 5143, 1), +(5143, 5144, 2), +(5143, 5145, 3), +(5143, 8416, 4), +(5143, 8417, 5), +(5143, 10211, 6), +(5143, 10212, 7), +(5143, 25345, 8), +(5143, 27075, 9), +(5143, 38699, 10), +(5143, 38704, 11), +(5143, 42843, 12), +(5143, 42846, 13), + -- Blessed Recovery +(27811, 27811, 1), +(27811, 27815, 2), +(27811, 27816, 3), + -- Blessed Recovery +(27813, 27813, 1), +(27813, 27817, 2), +(27813, 27818, 3), + -- Blessed Resilience +(33142, 33142, 1), +(33142, 33145, 2), +(33142, 33146, 3), + -- Blizzard +(1196, 1196, 1), +(1196, 6142, 2), +(1196, 8428, 3), +(1196, 10188, 4), +(1196, 10189, 5), +(1196, 10190, 6), +(1196, 27384, 7), + -- Blizzard +(42208, 42208, 1), +(42208, 42209, 2), +(42208, 42210, 3), +(42208, 42211, 4), +(42208, 42212, 5), +(42208, 42213, 6), +(42208, 42198, 7), +(42208, 42937, 8), +(42208, 42938, 9), + -- Blizzard +(10, 10, 1), +(10, 6141, 2), +(10, 8427, 3), +(10, 10185, 4), +(10, 10186, 5), +(10, 10187, 6), +(10, 27085, 7), +(10, 42939, 8), +(10, 42940, 9), + -- Chain Lightning +(421, 421, 1), +(421, 930, 2), +(421, 2860, 3), +(421, 10605, 4), +(421, 25439, 5), +(421, 25442, 6), +(421, 49270, 7), +(421, 49271, 8), + -- Chain Lightning +(45297, 45297, 1), +(45297, 45298, 2), +(45297, 45299, 3), +(45297, 45300, 4), +(45297, 45301, 5), +(45297, 45302, 6), +(45297, 49268, 7), +(45297, 49269, 8), + -- Charge +(7370, 7370, 1), +(7370, 26184, 2), +(7370, 26185, 3), +(7370, 26186, 4), +(7370, 26202, 5), +(7370, 28343, 6), + -- Consume Shadows +(17776, 17776, 1), +(17776, 17855, 2), +(17776, 17856, 3), +(17776, 17857, 4), +(17776, 17859, 5), +(17776, 17860, 6), + -- Consume Shadows +(20387, 20387, 1), +(20387, 20388, 2), +(20387, 20389, 3), +(20387, 20390, 4), +(20387, 20391, 5), +(20387, 20392, 6), +(20387, 27491, 7), +(20387, 48003, 8), +(20387, 48004, 9), + -- Cower +(1747, 1747, 1), +(1747, 1748, 2), +(1747, 1749, 3), +(1747, 1750, 4), +(1747, 1751, 5), +(1747, 16698, 6), +(1747, 27346, 7), + -- Echoes of Lordaeron +(6966, 6966, 1), +(6966, 30880, 2), +(6966, 30683, 3), +(6966, 30682, 4), +(6966, 29520, 5), + -- Echoes of Lordaeron +(6964, 6964, 1), +(6964, 11413, 2), +(6964, 11414, 3), +(6964, 11415, 4), +(6964, 1386, 5), + -- Eye for an Eye +(9799, 9799, 1), +(9799, 25988, 2), + -- Fire Nova +(1535, 1535, 1), +(1535, 8498, 2), +(1535, 8499, 3), +(1535, 11314, 4), +(1535, 11315, 5), +(1535, 25546, 6), +(1535, 25547, 7), +(1535, 61649, 8), +(1535, 61657, 9), + -- Fire Nova +(8349, 8349, 1), +(8349, 8502, 2), +(8349, 8503, 3), +(8349, 11306, 4), +(8349, 11307, 5), +(8349, 25535, 6), +(8349, 25537, 7), +(8349, 61650, 8), +(8349, 61654, 9), + -- Fire Protection +(7230, 7230, 1), +(7230, 7231, 2), +(7230, 7232, 3), +(7230, 7233, 4), +(7230, 7234, 5), + -- Fire Resistance +(24440, 24440, 1), +(24440, 24441, 2), +(24440, 24463, 3), +(24440, 24464, 4), +(24440, 27351, 5), + -- Fire Resistance +(8185, 8185, 1), +(8185, 10534, 2), +(8185, 10535, 3), +(8185, 25562, 4), +(8185, 58738, 5), +(8185, 58740, 6), + -- Fire Shield +(2949, 2949, 1), +(2949, 8318, 2), +(2949, 8319, 3), +(2949, 11772, 4), +(2949, 11773, 5), +(2949, 27486, 6), + -- Fire Shield +(20322, 20322, 1), +(20322, 20323, 2), +(20322, 20324, 3), +(20322, 20326, 4), +(20322, 20327, 5), +(20322, 27489, 6), +(20322, 47998, 7), + -- Flameblade +(7829, 7829, 1), +(7829, 7874, 2), +(7829, 7875, 3), + -- Flameblade +(7806, 7806, 1), +(7806, 7807, 2), +(7806, 7808, 3), + -- Flurry +(12319, 12319, 1), +(12319, 12971, 2), +(12319, 12972, 3), +(12319, 12973, 4), +(12319, 12974, 5), + -- Flurry +(12966, 12966, 1), +(12966, 12967, 2), +(12966, 12968, 3), +(12966, 12969, 4), +(12966, 12970, 5), + -- Focused Will +(45234, 45234, 1), +(45234, 45243, 2), +(45234, 45244, 3), + -- Focused Will +(45237, 45237, 1), +(45237, 45241, 2), +(45237, 45242, 3), + -- Frost Nova +(1194, 1194, 1), +(1194, 1225, 2), +(1194, 6132, 3), +(1194, 10231, 4), +(1194, 27387, 5), + -- Frost Protection +(7240, 7240, 1), +(7240, 7236, 2), +(7240, 7238, 3), +(7240, 7237, 4), +(7240, 7239, 5), + -- Frost Resistance +(24475, 24475, 1), +(24475, 24476, 2), +(24475, 24477, 3), +(24475, 24478, 4), +(24475, 27352, 5), + -- Frost Resistance +(8182, 8182, 1), +(8182, 10476, 2), +(8182, 10477, 3), +(8182, 25559, 4), +(8182, 58742, 5), +(8182, 58744, 6), + -- Frostbrand Attack +(8034, 8034, 1), +(8034, 8037, 2), +(8034, 10458, 3), +(8034, 16352, 4), +(8034, 16353, 5), +(8034, 25501, 6), +(8034, 58797, 7), +(8034, 58798, 8), +(8034, 58799, 9), + -- Healing Stream +(5672, 5672, 1), +(5672, 6371, 2), +(5672, 6372, 3), +(5672, 10460, 4), +(5672, 10461, 5), +(5672, 25566, 6), +(5672, 58763, 7), +(5672, 58764, 8), +(5672, 58765, 9), + -- Holy Nova +(15237, 15237, 1), +(15237, 15430, 2), +(15237, 15431, 3), +(15237, 27799, 4), +(15237, 27800, 5), +(15237, 27801, 6), +(15237, 25331, 7), +(15237, 48077, 8), +(15237, 48078, 9), + -- Holy Nova +(23455, 23455, 1), +(23455, 23458, 2), +(23455, 23459, 3), +(23455, 27803, 4), +(23455, 27804, 5), +(23455, 27805, 6), +(23455, 25329, 7), +(23455, 48075, 8), +(23455, 48076, 9), + -- Holy Protection +(7245, 7245, 1), +(7245, 7246, 2), +(7245, 7247, 3), +(7245, 7248, 4), +(7245, 7249, 5), +(7245, 17545, 6), + -- Holy Shock +(20473, 20473, 1), +(20473, 20929, 2), +(20473, 20930, 3), +(20473, 27174, 4), +(20473, 33072, 5), +(20473, 48824, 6), +(20473, 48825, 7), + -- Holy Shock +(25912, 25912, 1), +(25912, 25911, 2), +(25912, 25902, 3), +(25912, 27176, 4), +(25912, 33073, 5), +(25912, 48822, 6), +(25912, 48823, 7), + -- Holy Shock +(25914, 25914, 1), +(25914, 25913, 2), +(25914, 25903, 3), +(25914, 27175, 4), +(25914, 33074, 5), +(25914, 48820, 6), +(25914, 48821, 7), + -- Hurricane +(16914, 16914, 1), +(16914, 17401, 2), +(16914, 17402, 3), +(16914, 27012, 4), +(16914, 48467, 5), + -- Hurricane +(42231, 42231, 1), +(42231, 42232, 2), +(42231, 42233, 3), +(42231, 42230, 4), +(42231, 48466, 5), + -- Immolation Trap +(13795, 13795, 1), +(13795, 14302, 2), +(13795, 14303, 3), +(13795, 14304, 4), +(13795, 14305, 5), +(13795, 27023, 6), +(13795, 49055, 7), +(13795, 49056, 8), + -- Impact +(11103, 11103, 1), +(11103, 12357, 2), +(11103, 12358, 3), + -- Improved Mend Pet +(19572, 19572, 1), +(19572, 19573, 2), + -- Infusion of Light +(53569, 53569, 1), +(53569, 53576, 2), + -- Initiative +(13976, 13976, 1), +(13976, 13979, 2), +(13976, 13980, 3), + -- Intercept +(30154, 30154, 1), +(30154, 30199, 2), +(30154, 30200, 3), + -- Intercept +(30153, 30153, 1), +(30153, 30195, 2), +(30153, 30197, 3), +(30153, 47995, 4), + -- Intercept +(30151, 30151, 1), +(30151, 30194, 2), +(30151, 30198, 3), +(30151, 47996, 4), + -- Lash of Pain +(7876, 7876, 1), +(7876, 7877, 2), +(7876, 7878, 3), +(7876, 11781, 4), +(7876, 11782, 5), +(7876, 11783, 6), + -- Lay on Hands +(20233, 20233, 1), +(20233, 20236, 2), + -- Lay on Hands +(17233, 17233, 1), +(17233, 9257, 2), + -- Lightning Bolt +(403, 403, 1), +(403, 529, 2), +(403, 548, 3), +(403, 915, 4), +(403, 943, 5), +(403, 6041, 6), +(403, 10391, 7), +(403, 10392, 8), +(403, 15207, 9), +(403, 15208, 10), +(403, 25448, 11), +(403, 25449, 12), +(403, 49237, 13), +(403, 49238, 14), + -- Lightning Bolt +(45284, 45284, 1), +(45284, 45286, 2), +(45284, 45287, 3), +(45284, 45288, 4), +(45284, 45289, 5), +(45284, 45290, 6), +(45284, 45291, 7), +(45284, 45292, 8), +(45284, 45293, 9), +(45284, 45294, 10), +(45284, 45295, 11), +(45284, 45296, 12), +(45284, 49239, 13), +(45284, 49240, 14), + -- Lightning Shield +(324, 324, 1), +(324, 325, 2), +(324, 905, 3), +(324, 945, 4), +(324, 8134, 5), +(324, 10431, 6), +(324, 10432, 7), +(324, 25469, 8), +(324, 25472, 9), +(324, 49280, 10), +(324, 49281, 11), + -- Lightning Shield +(26364, 26364, 1), +(26364, 26365, 2), +(26364, 26366, 3), +(26364, 26367, 4), +(26364, 26369, 5), +(26364, 26370, 6), +(26364, 26363, 7), +(26364, 26371, 8), +(26364, 26372, 9), +(26364, 49278, 10), +(26364, 49279, 11), + -- Living Bomb +(44457, 44457, 1), +(44457, 55359, 2), +(44457, 55360, 3), + -- Living Bomb +(44461, 44461, 1), +(44461, 55361, 2), +(44461, 55362, 3), + -- Mind Sear +(48045, 48045, 1), +(48045, 53023, 2), + -- Mind Sear +(49821, 49821, 1), +(49821, 53022, 2), + -- Molten Armor +(34913, 34913, 1), +(34913, 43043, 2), +(34913, 43044, 3), + -- Molten Armor +(30482, 30482, 1), +(30482, 43045, 2), +(30482, 43046, 3), + -- Nature Protection +(7250, 7250, 1), +(7250, 7251, 2), +(7250, 7252, 3), +(7250, 7253, 4), +(7250, 7254, 5), + -- Nature Resistance +(24494, 24494, 1), +(24494, 24511, 2), +(24494, 24512, 3), +(24494, 24513, 4), +(24494, 27354, 5), + -- Nature Resistance +(10596, 10596, 1), +(10596, 10598, 2), +(10596, 10599, 3), +(10596, 25573, 4), +(10596, 58748, 5), +(10596, 58750, 6), + -- On a Pale Horse +(49146, 49146, 1), +(49146, 51267, 2), + -- Penance +(47540, 47540, 1), +(47540, 53005, 2), +(47540, 53006, 3), +(47540, 53007, 4), + -- Penance +(47750, 47750, 1), +(47750, 52983, 2), +(47750, 52984, 3), +(47750, 52985, 4), + -- Penance +(47666, 47666, 1), +(47666, 52998, 2), +(47666, 52999, 3), +(47666, 53000, 4), + -- Plague Strike +(59133, 59133, 1), +(59133, 66988, 2), +(59133, 66989, 3), +(59133, 66990, 4), +(59133, 66991, 5), +(59133, 66992, 6), + -- Prowl +(24451, 24451, 1), +(24451, 24454, 2), +(24451, 24455, 3), + -- Rain of Fire +(42223, 42223, 1), +(42223, 42224, 2), +(42223, 42225, 3), +(42223, 42226, 4), +(42223, 42218, 5), +(42223, 47817, 6), +(42223, 47818, 7), + -- Rain of Fire +(5740, 5740, 1), +(5740, 6219, 2), +(5740, 11677, 3), +(5740, 11678, 4), +(5740, 27212, 5), +(5740, 47819, 6), +(5740, 47820, 7), + -- Sacrifice +(7885, 7885, 1), +(7885, 19439, 2), +(7885, 19444, 3), +(7885, 19445, 4), +(7885, 19446, 5), +(7885, 19447, 6), + -- Sacrifice +(20381, 20381, 1), +(20381, 20382, 2), +(20381, 20383, 3), +(20381, 20384, 4), +(20381, 20385, 5), +(20381, 20386, 6), +(20381, 27492, 7), +(20381, 48001, 8), +(20381, 48002, 9), + -- Safeguard +(46945, 46945, 1), +(46945, 46949, 2), + -- Safeguard +(46946, 46946, 1), +(46946, 46947, 2), + -- Seed of Corruption +(27285, 27285, 1), +(27285, 47833, 2), +(27285, 47834, 3), + -- Seed of Corruption +(27243, 27243, 1), +(27243, 47835, 2), +(27243, 47836, 3), + -- Shadow Protection +(7235, 7235, 1), +(7235, 7241, 2), +(7235, 7242, 3), +(7235, 7243, 4), +(7235, 7244, 5), + -- Shadow Resistance +(24490, 24490, 1), +(24490, 24514, 2), +(24490, 24515, 3), +(24490, 24516, 4), +(24490, 27353, 5), + -- Soothing Kiss +(6362, 6362, 1), +(6362, 7879, 2), +(6362, 11786, 3), +(6362, 11787, 4), + -- Soothing Kiss +(20403, 20403, 1), +(20403, 20404, 2), +(20403, 20405, 3), +(20403, 20406, 4), +(20403, 27494, 5), + -- Spell Lock +(19648, 19648, 1), +(19648, 19650, 2), + -- Spell Lock +(20433, 20433, 1), +(20433, 20434, 2), + -- Starfall +(50286, 50286, 1), +(50286, 53196, 2), +(50286, 53197, 3), +(50286, 53198, 4), + -- Starfall +(50294, 50294, 1), +(50294, 53188, 2), +(50294, 53189, 3), +(50294, 53190, 4), + -- Starfall +(50288, 50288, 1), +(50288, 53191, 2), +(50288, 53194, 3), +(50288, 53195, 4), + -- Suffering +(17736, 17736, 1), +(17736, 17753, 2), +(17736, 17754, 3), +(17736, 17755, 4), + -- Suffering +(20393, 20393, 1), +(20393, 20394, 2), +(20393, 20395, 3), +(20393, 20396, 4), +(20393, 27500, 5), +(20393, 33703, 6), +(20393, 48005, 7), +(20393, 48006, 8), + -- Surge of Light +(33150, 33150, 1), +(33150, 33154, 2), + -- Tainted Blood +(19661, 19661, 1), +(19661, 19662, 2), +(19661, 19663, 3), +(19661, 19664, 4), + -- Tainted Blood +(20429, 20429, 1), +(20429, 20430, 2), +(20429, 20431, 3), +(20429, 20432, 4), +(20429, 27497, 5), + -- The Art of War +(53486, 53486, 1), +(53486, 53488, 2), + -- Thick Skin +(5364, 5364, 1), +(5364, 5368, 2), +(5364, 5369, 3), +(5364, 5370, 4), + -- Thick Skin +(5363, 5363, 1), +(5363, 5365, 2), +(5363, 5366, 3), +(5363, 5367, 4), + -- Torment +(7881, 7881, 1), +(7881, 7882, 2), +(7881, 7883, 3), +(7881, 7884, 4), +(7881, 11776, 5), +(7881, 11777, 6), + -- Tough Shell +(4112, 4112, 1), +(4112, 4113, 2), +(4112, 4115, 3), +(4112, 4114, 4), + -- Tough Shell +(4107, 4107, 1), +(4107, 4108, 2), +(4107, 4109, 3), +(4107, 4111, 4), + -- Tranquility +(740, 740, 1), +(740, 8918, 2), +(740, 9862, 3), +(740, 9863, 4), +(740, 26983, 5), +(740, 48446, 6), +(740, 48447, 7), + -- Tranquility +(44203, 44203, 1), +(44203, 44205, 2), +(44203, 44206, 3), +(44203, 44207, 4), +(44203, 44208, 5), +(44203, 48444, 6), +(44203, 48445, 7), + -- Typhoon +(61391, 61391, 1), +(61391, 61390, 2), +(61391, 61388, 3), +(61391, 61387, 4), +(61391, 53227, 5), + -- Typhoon +(50516, 50516, 1), +(50516, 53223, 2), +(50516, 53225, 3), +(50516, 53226, 4), +(50516, 61384, 5), + -- Unfair Advantage +(51675, 51675, 1), +(51675, 51677, 2), + -- Unfair Advantage +(51672, 51672, 1), +(51672, 51674, 2), + -- Unleashed Rage +(30802, 30802, 1), +(30802, 30808, 2), +(30802, 30809, 3), + -- Vindication +(9452, 9452, 1), +(9452, 26016, 2), + -- Vindication +(67, 67, 1), +(67, 26017, 2), + -- Volley +(42243, 42243, 1), +(42243, 42244, 2), +(42243, 42245, 3), +(42243, 42234, 4), +(42243, 58432, 5), +(42243, 58433, 6), + -- Volley +(1510, 1510, 1), +(1510, 14294, 2), +(1510, 14295, 3), +(1510, 27022, 4), +(1510, 58431, 5), +(1510, 58434, 6), + -- Will of the Necropolis +(52284, 52284, 1), +(52284, 52285, 2), +(52284, 52286, 3), + -- Will of the Necropolis +(49189, 49189, 1), +(49189, 50149, 2), +(49189, 50150, 3), + -- Wyvern Sting +(19386, 19386, 1), +(19386, 24132, 2), +(19386, 24133, 3), +(19386, 27068, 4), +(19386, 49011, 5), +(19386, 49012, 6), + -- First Aid +(746, 746, 1), +(746, 1159, 2), +(746, 3267, 3), +(746, 3268, 4), +(746, 7926, 5), +(746, 7927, 6), +(746, 10838, 7), +(746, 10839, 8), +(746, 18608, 9), +(746, 18610, 10), +(746, 27030, 11), +(746, 27031, 12), +(746, 45543, 13), +(746, 51827, 14), +(746, 45544, 15), +(746, 51803, 16), + -- Frost Strike +(49143, 49143, 1), +(49143, 51416, 2), +(49143, 51417, 3), +(49143, 51418, 4), +(49143, 51419, 5), +(49143, 55268, 6), + -- Intercept +(20253, 20253, 1), +(20253, 20614, 2), +(20253, 20615, 3), +(20253, 25273, 4), +(20253, 25274, 5), + -- Misery +(33191, 33191, 1), +(33191, 33192, 2), +(33191, 33193, 3), + -- Misery +(33196, 33196, 1), +(33196, 33197, 2), +(33196, 33198, 3), + -- Obliterate +(49020, 49020, 1), +(49020, 51423, 2), +(49020, 51424, 3), +(49020, 51425, 4), + -- Penance +(47758, 47758, 1), +(47758, 53001, 2), +(47758, 53002, 3), +(47758, 53003, 4), + -- Penance +(47757, 47757, 1), +(47757, 52986, 2), + -- Savage Rend +(50498, 50498, 1), +(50498, 53578, 2), +(50498, 53579, 3), +(50498, 53580, 4), +(50498, 53581, 5), +(50498, 53582, 6), + -- Spirit Bond +(19578, 19578, 1), +(19578, 20895, 2), + -- Spirit Bond +(19579, 19579, 1), +(19579, 24529, 2), + -- Stoneskin +(8072, 8072, 1), +(8072, 8156, 2), +(8072, 8157, 3), +(8072, 10403, 4), +(8072, 10404, 5), +(8072, 10405, 6), +(8072, 25506, 7), +(8072, 25507, 8), +(8072, 58752, 9), +(8072, 58754, 10), + -- Attack +(3606, 3606, 1), +(3606, 6350, 2), +(3606, 6351, 3), +(3606, 6352, 4), +(3606, 10435, 5), +(3606, 10436, 6), +(3606, 25530, 7), +(3606, 58700, 8), +(3606, 58701, 9), +(3606, 58702, 10), + -- Blood Strike +(45902, 45902, 1), +(45902, 49926, 2), +(45902, 49927, 3), +(45902, 49928, 4), +(45902, 49929, 5), +(45902, 49930, 6), + -- Elemental Devastation +(30160, 30160, 1), +(30160, 29179, 2), +(30160, 29180, 3), + -- Elemental Devastation +(30165, 30165, 1), +(30165, 29177, 2), +(30165, 29178, 3), + -- Fishing +(7620, 7620, 1), +(7620, 7731, 2), +(7620, 7732, 3), +(7620, 18248, 4), +(7620, 33095, 5), +(7620, 51294, 6), + -- Icy Touch +(45477, 45477, 1), +(45477, 49896, 2), +(45477, 49903, 3), +(45477, 49904, 4), +(45477, 49909, 5), + -- Judgements of the Pure +(53671, 53671, 1), +(53671, 53673, 2), +(53671, 54151, 3), +(53671, 54154, 4), +(53671, 54155, 5), + -- Judgements of the Pure +(53655, 53655, 1), +(53655, 53656, 2), +(53655, 53657, 3), +(53655, 54152, 4), +(53655, 54153, 5), + -- Master Tactician +(34506, 34506, 1), +(34506, 34507, 2), +(34506, 34508, 3), +(34506, 34838, 4), +(34506, 34839, 5), + -- Master Tactician +(34833, 34833, 1), +(34833, 34834, 2), +(34833, 34835, 3), +(34833, 34836, 4), +(34833, 34837, 5), + -- Plague Strike +(45462, 45462, 1), +(45462, 49917, 2), +(45462, 49918, 3), +(45462, 49919, 4), +(45462, 49920, 5), +(45462, 49921, 6), + -- Rapid Killing +(34948, 34948, 1), +(34948, 34949, 2), + -- Rapid Killing +(35098, 35098, 1), +(35098, 35099, 2), + -- Second Wind +(29841, 29841, 1), +(29841, 29842, 2), + -- Second Wind +(29834, 29834, 1), +(29834, 29838, 2), + -- Strength of Earth +(8076, 8076, 1), +(8076, 8162, 2), +(8076, 8163, 3), +(8076, 10441, 4), +(8076, 25362, 5), +(8076, 25527, 6), +(8076, 57621, 7), +(8076, 58646, 8), + -- Trauma +(46854, 46854, 1), +(46854, 46855, 2), + -- Trauma +(46856, 46856, 1), +(46856, 46857, 2), + -- Unbridled Wrath +(12322, 12322, 1), +(12322, 12999, 2), +(12322, 13000, 3), +(12322, 13001, 4), +(12322, 13002, 5), + -- Vanish +(11327, 11327, 1), +(11327, 11329, 2), +(11327, 26888, 3), + -- Blood Gorged +(50096, 50096, 1), +(50096, 50108, 2), +(50096, 50109, 3), +(50096, 50110, 4), +(50096, 50111, 5), + -- Blood Gorged +(61274, 61274, 1), +(61274, 61275, 2), +(61274, 61276, 3), +(61274, 61277, 4), +(61274, 61278, 5), + -- Blood Gorged +(61154, 61154, 1), +(61154, 61155, 2), +(61154, 61156, 3), +(61154, 61157, 4), +(61154, 61158, 5), + -- Cone of Cold +(1241, 1241, 1), +(1241, 8493, 2), +(1241, 10162, 3), +(1241, 10163, 4), +(1241, 10164, 5), +(1241, 27386, 6), + -- Flamestrike +(2124, 2124, 1), +(2124, 2125, 2), +(2124, 8425, 3), +(2124, 8426, 4), +(2124, 10217, 5), +(2124, 10218, 6), +(2124, 27385, 7), + -- Anesthetic Poison +(26688, 26688, 1), +(26688, 57981, 2), + -- Anesthetic Poison +(26785, 26785, 1), +(26785, 57982, 2), + -- Apprentice Riding +(33388, 33388, 1), +(33388, 33391, 2), +(33388, 34090, 3), +(33388, 34091, 4), + -- Primal Fury +(16958, 16958, 1), +(16958, 16961, 2), + -- Primal Fury +(37116, 37116, 1), +(37116, 37117, 2), + -- Nature Resist +(4548, 4548, 1), +(4548, 24502, 2), +(4548, 24503, 3), +(4548, 24504, 4), +(4548, 27055, 5), + -- Instant Poison +(8680, 8680, 1), +(8680, 8685, 2), +(8680, 8689, 3), +(8680, 11335, 4), +(8680, 11336, 5), +(8680, 11337, 6), +(8680, 26890, 7), +(8680, 57964, 8), +(8680, 57965, 9), + -- Instant Poison +(8679, 8679, 1), +(8679, 8686, 2), +(8679, 8688, 3), +(8679, 11338, 4), +(8679, 11339, 5), +(8679, 11340, 6), +(8679, 26891, 7), +(8679, 57967, 8), +(8679, 57968, 9), + -- Claw +(2980, 2980, 1), +(2980, 2981, 2), +(2980, 2982, 3), +(2980, 3667, 4), +(2980, 2975, 5), +(2980, 2976, 6), +(2980, 2977, 7), +(2980, 3666, 8), +(2980, 27347, 9), + -- Mace Specialization +(12284, 12284, 1), +(12284, 12701, 2), +(12284, 12702, 3), +(12284, 12703, 4), +(12284, 12704, 5), + -- Deadly Toxin +(11539, 11539, 1), +(11539, 11471, 2), +(11539, 11470, 3), +(11539, 11469, 4), + -- Deadly Poison +(2818, 2818, 1), +(2818, 2819, 2), +(2818, 11353, 3), +(2818, 11354, 4), +(2818, 25349, 5), +(2818, 26968, 6), +(2818, 27187, 7), +(2818, 57969, 8), +(2818, 57970, 9), + -- Deadly Poison +(2823, 2823, 1), +(2823, 2824, 2), +(2823, 11355, 3), +(2823, 11356, 4), +(2823, 25351, 5), +(2823, 26967, 6), +(2823, 27186, 7), +(2823, 57972, 8), +(2823, 57973, 9), + -- On a Pale Horse +(51983, 51983, 1), +(51983, 51986, 2), + -- On a Pale Horse +(51969, 51969, 1), +(51969, 51970, 2), + -- Wound Poison +(13218, 13218, 1), +(13218, 13222, 2), +(13218, 13223, 3), +(13218, 13224, 4), +(13218, 27189, 5), +(13218, 57974, 6), +(13218, 57975, 7), + -- Wound Poison +(13219, 13219, 1), +(13219, 13225, 2), +(13219, 13226, 3), +(13219, 13227, 4), +(13219, 27188, 5), +(13219, 57977, 6), +(13219, 57978, 7), + -- Thunderstomp +(26094, 26094, 1), +(26094, 26189, 2), +(26094, 26190, 3), +(26094, 27366, 4), + -- Obliterate +(66198, 66198, 1), +(66198, 66972, 2), +(66198, 66973, 3), +(66198, 66974, 4), + -- Frost Strike +(66196, 66196, 1), +(66196, 66958, 2), +(66196, 66959, 3), +(66196, 66960, 4), +(66196, 66961, 5), +(66196, 66962, 6), + -- Death Strike +(66188, 66188, 1), +(66188, 66950, 2), +(66188, 66951, 3), +(66188, 66952, 4), +(66188, 66953, 5), + -- Fiery Payback +(44440, 44440, 1), +(44440, 44441, 2), + -- Fiery Payback +(64353, 64353, 1), +(64353, 64357, 2), + -- Improved Flash Heal +(63504, 63504, 1), +(63504, 63505, 2), +(63504, 63506, 3), + -- Elemental Fury +(16089, 16089, 1), +(16089, 60184, 2), +(16089, 60185, 3), +(16089, 60187, 4), +(16089, 60188, 5), + -- Feral Swiftness +(17002, 17002, 1), +(17002, 24866, 2), + -- Master Shapeshifter +(48411, 48411, 1), +(48411, 48412, 2), + -- Nature's Majesty +(35363, 35363, 1), +(35363, 35364, 2), + -- Nature's Grace +(16880, 16880, 1), +(16880, 61345, 2), +(16880, 61346, 3), + -- Molten Skin +(63349, 63349, 1), +(63349, 63350, 2), +(63349, 63351, 3), + -- Master Demonologist +(23785, 23785, 1), +(23785, 23822, 2), +(23785, 23823, 3), +(23785, 23824, 4), +(23785, 23825, 5), + -- Death Rune Mastery +(49467, 49467, 1), +(49467, 50033, 2), +(49467, 50034, 3), + -- Improved Death Strike +(62905, 62905, 1), +(62905, 62908, 2), + -- Desolation +(66799, 66799, 1), +(66799, 66814, 2), +(66799, 66815, 3), +(66799, 66816, 4), +(66799, 66817, 5), + -- Mobility +(53483, 53483, 1), +(53483, 53485, 2), + -- Mobility +(53554, 53554, 1), +(53554, 53555, 2), + -- Arcane Missiles +(7268, 7268, 1), +(7268, 7269, 2), +(7268, 7270, 3), +(7268, 8419, 4), +(7268, 8418, 5), +(7268, 10273, 6), +(7268, 10274, 7), +(7268, 25346, 8), +(7268, 27076, 9), +(7268, 38700, 10), +(7268, 38703, 11), +(7268, 42844, 12), +(7268, 42845, 13), + -- Entangling Roots +(19975, 19975, 1), +(19975, 19974, 2), +(19975, 19973, 3), +(19975, 19972, 4), +(19975, 19971, 5), +(19975, 19970, 6), +(19975, 27010, 7), +(19975, 53313, 8), + -- Death Coil +(47541, 47541, 1), +(47541, 49892, 2), +(47541, 49893, 3), +(47541, 49894, 4), +(47541, 49895, 5), + -- Intellect +(8096, 8096, 1), +(8096, 8097, 2), +(8096, 8098, 3), +(8096, 12176, 4), +(8096, 33078, 5), +(8096, 43195, 6), +(8096, 48099, 7), +(8096, 48100, 8), + -- Stamina +(8099, 8099, 1), +(8099, 8100, 2), +(8099, 8101, 3), +(8099, 12178, 4), +(8099, 33081, 5), +(8099, 48101, 6), +(8099, 48102, 7), +(8099, 43198, 8), + -- Mutilate +(5374, 5374, 1), +(5374, 34414, 2), +(5374, 34416, 3), +(5374, 34419, 4), +(5374, 48662, 5), +(5374, 48665, 6), + -- Mutilate +(27576, 27576, 1), +(27576, 34415, 2), +(27576, 34417, 3), +(27576, 34418, 4), +(27576, 48661, 5), +(27576, 48664, 6), + -- Immolation trap +(13797, 13797, 1), +(13797, 14298, 2), +(13797, 14299, 3), +(13797, 14300, 4), +(13797, 14301, 5), +(13797, 27024, 6), +(13797, 49053, 7), +(13797, 49054, 8), + -- Sniper Training +(64418, 64418, 1), +(64418, 64419, 2), +(64418, 64420, 3), + -- Blood Strike +(66215, 66215, 1), +(66215, 66975, 2), +(66215, 66976, 3), +(66215, 66977, 4), +(66215, 66978, 5), +(66215, 66979, 6), + -- Stoneclaw Totem Effect +(5729, 5729, 1), +(5729, 6393, 2), +(5729, 6394, 3), +(5729, 6395, 4), +(5729, 10423, 5), +(5729, 10424, 6), +(5729, 25512, 7), +(5729, 58586, 8), +(5729, 58587, 9), +(5729, 58588, 10); +/*!40000 ALTER TABLE `spell_ranks` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `spell_target_position` +-- + +DROP TABLE IF EXISTS `spell_target_position`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_target_position` ( + `id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier', + `target_map` smallint(5) unsigned NOT NULL DEFAULT '0', + `target_position_x` float NOT NULL DEFAULT '0', + `target_position_y` float NOT NULL DEFAULT '0', + `target_position_z` float NOT NULL DEFAULT '0', + `target_orientation` float NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_target_position` +-- + +LOCK TABLES `spell_target_position` WRITE; +/*!40000 ALTER TABLE `spell_target_position` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_target_position` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_threat` +-- + +DROP TABLE IF EXISTS `spell_threat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spell_threat` ( + `entry` mediumint(8) unsigned NOT NULL, + `Threat` smallint(6) NOT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_threat` +-- + +LOCK TABLES `spell_threat` WRITE; +/*!40000 ALTER TABLE `spell_threat` DISABLE KEYS */; +INSERT INTO `spell_threat` VALUES (78,20),(284,39),(285,59),(770,108),(1608,78),(1672,180),(1715,61),(6572,155),(6574,195),(6809,89),(7372,101),(7373,141),(7379,235),(7386,100),(7405,140),(8380,180),(8972,118),(9745,148),(9880,178),(9881,207),(11556,43),(11564,98),(11565,118),(11566,137),(11567,145),(11596,220),(11597,261),(11600,275),(11601,315),(11775,395),(14921,415),(17735,200),(17750,300),(17751,450),(17752,600),(20736,100),(23922,160),(23923,190),(23924,220),(23925,250),(24394,580),(24583,5),(25286,175),(25288,355),(25289,60),(20243,101),(30016,101),(30022,101),(29707,196),(30324,220),(26996,176),(25258,286),(30356,323),(25269,400),(30357,483),(29704,230),(25225,300),(20569,100),(25231,130),(33745,285),(16857,108),(6343,17),(8198,40),(8204,64),(8205,96),(11580,143),(11581,180),(25264,215),(33878,129),(33986,180),(33987,232),(20925,20),(20927,30),(20928,40),(27179,54),(2139,300); +/*!40000 ALTER TABLE `spell_threat` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_difficulty_dbc` +-- + +DROP TABLE IF EXISTS `spelldifficulty_dbc`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `spelldifficulty_dbc` ( + `id` int(11) unsigned NOT NULL DEFAULT '0', + `spellid0` int(11) unsigned NOT NULL DEFAULT '0', + `spellid1` int(11) unsigned NOT NULL DEFAULT '0', + `spellid2` int(11) unsigned NOT NULL DEFAULT '0', + `spellid3` int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spell_difficulty_dbc` +-- + +LOCK TABLES `spelldifficulty_dbc` WRITE; +/*!40000 ALTER TABLE `spelldifficulty_dbc` DISABLE KEYS */; +INSERT INTO `spelldifficulty_dbc` VALUES +(3000, 47772, 56935, 0, 0), -- Magus Telestra - Ice Nova +(3001, 47773, 56934, 0, 0), -- Magus Telestra - Fire Bomb +(3002, 44189, 46164, 0, 0), -- SPELL_FIREBALL_NORMAL / SPELL_FIREBALL_HEROIC +(3003, 44190, 46163, 0, 0), -- SPELL_FLAMESTRIKE1_NORMAL / SPELL_FLAMESTRIKE1_HEROIC +(3004, 44174, 46192, 0, 0), -- SPELL_RENEW_NORMAL / SPELL_RENEW_HEROIC +(3005, 14032, 15654, 0, 0), -- SPELL_SW_PAIN_NORMAL / SPELL_SW_PAIN_HEROIC +(3006, 44318, 46380, 0, 0), -- SPELL_CHAIN_LIGHTNING / SPELL_H_CHAIN_LIGHTNING +(3007, 44319, 46381, 0, 0), -- SPELL_ARCANE_SHOCK / SPELL_H_ARCANE_SHOCK +(3008, 52771, 58830, 0, 0), -- SPELL_WOUNDING_STRIKE / H_SPELL_WOUNDING_STRIKE +(3009, 52720, 58852, 0, 0), -- SPELL_CARRION_SWARM / H_SPELL_CARRION_SWARM +(3010, 52722, 58850, 0, 0), -- SPELL_MIND_BLAST / H_SPELL_MIND_BLAST +(3011, 52721, 58849, 0, 0), -- SPELL_SLEEP / H_SPELL_SLEEP +(3012, 52666, 58824, 0, 0), -- SPELL_DISEASE_EXPULSION / H_SPELL_DISEASE_EXPULSION +(3013, 52696, 58823, 0, 0), -- SPELL_CONSTRICTING_CHAINS / H_SPELL_CONSTRICTING_CHAINS +(3014, 57725, 58827, 0, 0), -- SPELL_SHADOW_BOLT / H_SPELL_SHADOW_BOLT +(3015, 52445, 58822, 0, 0), -- SPELL_EXORCISM_N / SPELL_EXORCISM_H +(3016, 31473, 39049, 0, 0), -- SPELL_SAND_BREATH / H_SPELL_SAND_BREATH +(3017, 31457, 38538, 0, 0), -- SPELL_ARCANE_BLAST / H_SPELL_ARCANE_BLAST +(3018, 31472, 38539, 0, 0), -- SPELL_ARCANE_DISCHARGE / H_SPELL_ARCANE_DISCHARGE +(3019, 31475, 38593, 0, 0), -- SPELL_WING_BUFFET / H_SPELL_WING_BUFFET +(3020, 56130, 59467, 0, 0), -- SPELL_BROOD_PLAGUE / H_SPELL_BROOD_PLAGUE +(3021, 57941, 59974, 0, 0), -- SPELL_MIND_FLAY / H_SPELL_MIND_FLAY +(3022, 57942, 59975, 0, 0), -- SPELL_SHADOW_BOLT_VOLLEY / H_SPELL_SHADOW_BOLT_VOLLEY +(3023, 57949, 59978, 0, 0), -- SPELL_SHIVER / H_SPELL_SHIVER +(3024, 56855, 60030, 0, 0), -- SPELL_CYCLONE_STRIKE / SPELL_CYCLONE_STRIKE_H +(3025, 55959, 59513, 0, 0), -- SPELL_EMBRACE_OF_THE_VAMPYR / H_SPELL_EMBRACE_OF_THE_VAMPYR +(3026, 55926, 59508, 0, 0), -- SPELL_FLAME_SPHERE_PERIODIC / H_SPELL_FLAME_SPHERE_PERIODIC +(3027, 53472, 59433, 0, 0), -- SPELL_POUND / H_SPELL_POUND +(3028, 53400, 59419, 0, 0), -- SPELL_ACID_CLOUD / H_SPELL_ACID_CLOUD +(3029, 53030, 59417, 0, 0), -- SPELL_LEECH_POISON / H_SPELL_LEECH_POISON +(3030, 57731, 59421, 0, 0), -- SPELL_WEB_GRAB / H_SPELL_WEB_GRAB +(3031, 52586, 59367, 0, 0), -- SPELL_MIND_FLAY / H_SPELL_MIND_FLAY +(3032, 52592, 59368, 0, 0), -- SPELL_CURSE_OF_FATIGUE / H_SPELL_CURSE_OF_FATIGUE +(3033, 52592, 59368, 0, 0), -- SPELL_CURSE_OF_FATIGUE / H_SPELL_CURSE_OF_FATIGUE +(3034, 59363, 52446, 0, 0), -- SPELL_ACID_SPLASH / H_SPELL_ACID_SPLASH +(3035, 52534, 59357, 0, 0), -- SPELL_SHADOW_BOLT / H_SPELL_SHADOW_BOLT +(3036, 52535, 59358, 0, 0), -- SPELL_SHADOW_NOVA / H_SPELL_SHADOW_NOVA +(3037, 52469, 59364, 0, 0), -- SPELL_INFECTED_BITE / H_SPELL_INFECTED_BITE +(3038, 52469, 59364, 0, 0), -- SPELL_INFECTED_BITE / H_SPELL_INFECTED_BITE +(3039, 52524, 59365, 0, 0), -- SPELL_BLINDING_WEBS / H_SPELL_BLINDING_WEBS +(3040, 52469, 59364, 0, 0), -- SPELL_INFECTED_BITE / H_SPELL_INFECTED_BITE +(3041, 52493, 59366, 0, 0), -- SPELL_POSION_SPRAY / H_SPELL_POSION_SPRAY +(3042, 66538, 67676, 0, 0), -- SPELL_HOLY_FIRE / SPELL_HOLY_FIRE_H +(3043, 66536, 67674, 0, 0), -- SPELL_SMITE / SPELL_SMITE_H +(3044, 66537, 67675, 0, 0), -- SPELL_RENEW / SPELL_RENEW_H +(3045, 66537, 67675, 0, 0), -- SPELL_RENEW / SPELL_RENEW_H +(3046, 66620, 67679, 0, 0), -- SPELL_OLD_WOUNDS / SPELL_OLD_WOUNDS_H +(3047, 66552, 67677, 0, 0), -- SPELL_WAKING_NIGHTMARE / SPELL_WAKING_NIGHTMARE_H +(3048, 66619, 67678, 0, 0), -- SPELL_SHADOWS_PAST / SPELL_SHADOWS_PAST_H +(3049, 67881, 67718, 0, 0), -- SPELL_ICY_TOUCH / SPELL_ICY_TOUCH_H +(3050, 67881, 67718, 0, 0), -- SPELL_ICY_TOUCH / SPELL_ICY_TOUCH_H +(3051, 67883, 67725, 0, 0), -- SPELL_OBLITERATE / SPELL_OBLITERATE_H +(3052, 67875, 67808, 0, 0), -- SPELL_DEATH_BITE / SPELL_DEATH_BITE_H +(3053, 67749, 67880, 0, 0), -- SPELL_LEAP / SPELL_LEAP_H +(3054, 68783, 68784, 0, 0), -- SPELL_MORTAL_STRIKE / SPELL_MORTAL_STRIKE_H +(3055, 66042, 68310, 0, 0), -- SPELL_FIREBALL / SPELL_FIREBALL_H +(3056, 66042, 68310, 0, 0), -- SPELL_FIREBALL / SPELL_FIREBALL_H +(3057, 66043, 68311, 0, 0), -- SPELL_POLYMORPH / SPELL_POLYMORPH_H +(3058, 66044, 68312, 0, 0), -- SPELL_BLAST_WAVE / SPELL_BLAST_WAVE_H +(3059, 67529, 68319, 0, 0), -- SPELL_CHAIN_LIGHTNING / SPELL_CHAIN_LIGHTNING_H +(3060, 67528, 68318, 0, 0), -- SPELL_HEALING_WAVE / SPELL_HEALING_WAVE_H +(3061, 67528, 68318, 0, 0), -- SPELL_HEALING_WAVE / SPELL_HEALING_WAVE_H +(3062, 65868, 67988, 0, 0), -- SPELL_SHOOT / SPELL_SHOOT_H +(3063, 67709, 68317, 0, 0), -- SPELL_EVISCERATE / SPELL_EVISCERATE_H +(3064, 48849, 59422, 0, 0), -- SPELL_FEARSOME_ROAR / H_SPELL_FEARSOME_ROAR +(3065, 49527, 59972, 0, 0), -- SPELL_CURSE_OF_LIFE / H_SPELL_CURSE_OF_LIFE +(3066, 49528, 59973, 0, 0), -- SPELL_SHADOW_VOLLEY / H_SPELL_SHADOW_VOLLEY +(3067, 49518, 59971, 0, 0), -- SPELL_RAIN_OF_FIRE / H_SPELL_RAIN_OF_FIRE +(3068, 49537, 59963, 0, 0), -- SPELL_LIGHTNING_BREATH / H_SPELL_LIGHTNING_BREATH +(3069, 49544, 59965, 0, 0), -- SPELL_EYE_BEAM / H_SPELL_EYE_BEAM +(3070, 49548, 59969, 0, 0), -- SPELL_POISON_CLOUD / H_SPELL_POISON_CLOUD +(3071, 59803, 49381, 0, 0), -- SPELL_CONSUME / H_SPELL_CONSUME +(3072, 49555, 59807, 0, 0), -- SPELL_CORPSE_EXPLODE / H_SPELL_CORPSE_EXPLODE +(3073, 68793, 69050, 0, 0), -- SPELL_MAGIC_S_BANE / H_SPELL_MAGIC_S_BANE +(3074, 68858, 69047, 0, 0), -- SPELL_CONSUME_SOUL / H_SPELL_CONSUME_SOUL +(3075, 68982, 70322, 0, 0), -- SPELL_PHANTOM_BLAST / H_SPELL_PHANTOM_BLAST +(3076, 68895, 70212, 0, 0), -- SPELL_SPITE / H_SPELL_SPITE +(3077, 69148, 70210, 0, 0), -- SPELL_WAIL_OF_SOULS / H_SPELL_WAIL_OF_SOULS +(3078, 69060, 70209, 0, 0), -- SPELL_FROST_NOVA / H_SPELL_FROST_NOVA +(3079, 69080, 70206, 0, 0), -- SPELL_BONE_VOLLEY / H_SPELL_BONE_VOLLEY +(3080, 69069, 70207, 0, 0), -- SPELL_SHIELD_OF_BONES / H_SPELL_SHIELD_OF_BONES +(3081, 69068, 70208, 0, 0), -- SPELL_SHADOW_BOLT / H_SPELL_SHADOW_BOLT +(3082, 69068, 70208, 0, 0), -- SPELL_SHADOW_BOLT / H_SPELL_SHADOW_BOLT +(3083, 69066, 70213, 0, 0), -- SPELL_DRAIN_LIFE / H_SPELL_DRAIN_LIFE +(3084, 69564, 70205, 0, 0), -- SPELL_SHADOW_MEND / H_SPELL_SHADOW_MEND +(3085, 69088, 70211, 0, 0), -- SPELL_SOUL_STRIKE / H_SPELL_SOUL_STRIKE +(3086, 68774, 70334, 0, 0), -- SPELL_FORGE_BLADE / H_SPELL_FORGE_BLADE +(3087, 68785, 70335, 0, 0), -- SPELL_FORGE_MACE / H_SPELL_FORGE_MACE +(3088, 70381, 72930, 0, 0), -- SPELL_DEEP_FREEZE / H_SPELL_DEEP_FREEZE +(3089, 68778, 70333, 0, 0), -- SPELL_CHILLING_WAVE / H_SPELL_CHILLING_WAVE +(3090, 68989, 70434, 0, 0), -- SPELL_POISON_NOVA / H_SPELL_POISON_NOVA +(3091, 69024, 70436, 0, 0), -- SPELL_TOXIC_WASTE / H_SPELL_TOXIC_WASTE +(3092, 69155, 69627, 0, 0), -- SPELL_FORCEFUL_SMASH / H_SPELL_FORCEFUL_SMASH +(3093, 69167, 69629, 0, 0), -- SPELL_DARK_MIGHT / H_SPELL_DARK_MIGHT +(3094, 69233, 69646, 0, 0), -- SPELL_ICY_BLAST / H_SPELL_ICY_BLAST +(3095, 69238, 69628, 0, 0), -- SPELL_ICY_BLAST_2 / H_SPELL_ICY_BLAST_2 +(3096, 55626, 58993, 0, 0), -- SPELL_MOJO_WAVE / H_SPELL_MOJO_WAVE +(3097, 55627, 58994, 0, 0), -- SPELL_MOJO_PUDDLE / H_SPELL_MOJO_PUDDLE +(3098, 55250, 59824, 0, 0), -- SPELL_WHIRLING_SLASH / H_SPELL_WHIRLING_SLASH +(3099, 55276, 59826, 0, 0), -- SPELL_PUNCTURE / H_SPELL_PUNCTURE +(3100, 55285, 59828, 0, 0), -- SPELL_ENRAGE / H_SPELL_ENRAGE +(3101, 55292, 59829, 0, 0), -- SPELL_STOMP / H_SPELL_STOMP +(3102, 54956, 59827, 0, 0), -- SPELL_IMPALING_CHARGE / H_SPELL_IMPALING_CHARGE +(3103, 55102, 59444, 0, 0), -- SPELL_DETERMINED_GORE / H_SPELL_DETERMINED_GORE +(3104, 55081, 59842, 0, 0), -- SPELL_POISON_NOVA / H_SPELL_POISON_NOVA +(3105, 48287, 59840, 0, 0), -- SPELL_POWERFULL_BITE / H_SPELL_POWERFULL_BITE +(3106, 54970, 59839, 0, 0), -- SPELL_VENOM_BOLT / H_SPELL_VENOM_BOLT +(3107, 54987, 58996, 0, 0), -- SPELL_VENOMOUS_BITE / H_SPELL_VENOMOUS_BITE +(3108, 47751, 57062, 0, 0), -- SPELL_SPARK / H_SPELL_SPARK +(3109, 48096, 57091, 0, 0), -- SPELL_CRYSTALFIRE_BREATH / H_SPELL_CRYSTALFIRE_BREATH +(3110, 48016, 57066, 0, 0), -- SPELL_TRAMPLE / H_SPELL_TRAMPLE +(3111, 47944, 57067, 0, 0), -- SPELL_CRYSTALL_SPIKE_DAMAGE / H_SPELL_CRYSTALL_SPIKE_DAMAGE +(3112, 50774, 59370, 0, 0), -- SPELL_THUNDERING_STOMP / SPELL_THUNDERING_STOMP_H +(3113, 52774, 59160, 0, 0), -- SPELL_RENEW_STEEL_N / SPELL_RENEW_STEEL_H +(3114, 52658, 59795, 0, 0), -- SPELL_STATIC_OVERLOAD / H_SPELL_STATIC_OVERLOAD +(3115, 52780, 59800, 0, 0), -- SPELL_BALL_LIGHTNING / H_SPELL_BALL_LIGHTNING +(3116, 52961, 59836, 0, 0), -- SPELL_PULSING_SHOCKWAVE_N / SPELL_PULSING_SHOCKWAVE_H +(3117, 52960, 59835, 0, 0), -- SPELL_LIGHTNING_NOVA_N / SPELL_LIGHTNING_NOVA_H +(3118, 52237, 59529, 0, 0), -- SPELL_SHATTERING_STOMP_N / SPELL_SHATTERING_STOMP_H +(3119, 52433, 59530, 0, 0), -- SPELL_IMMOLATION_STRIKE_N / SPELL_IMMOLATION_STRIKE_H +(3120, 50843, 59742, 0, 0), -- SPELL_BOULDER_TOSS / H_SPELL_BOULDER_TOSS +(3121, 48131, 59744, 0, 0), -- SPELL_STOMP / H_SPELL_STOMP +(3122, 50810, 61546, 0, 0), -- SPELL_SHATTER / H_SPELL_SHATTER +(3123, 50752, 59772, 0, 0), -- SPELL_STORM_OF_GRIEF_N / SPELL_STORM_OF_GRIEF_H +(3124, 50760, 59726, 0, 0), -- SPELL_SHOCK_OF_SORROW_N / SPELL_SHOCK_OF_SORROW_H +(3125, 50761, 59727, 0, 0), -- SPELL_PILLAR_OF_WOE_N / SPELL_PILLAR_OF_WOE_H +(3126, 50761, 59727, 0, 0), -- SPELL_PILLAR_OF_WOE_N / SPELL_PILLAR_OF_WOE_H +(3127, 50830, 59844, 0, 0), -- SPELL_CHAIN_LIGHTING / H_SPELL_CHAIN_LIGHTING +(3128, 50831, 59845, 0, 0), -- SPELL_LIGHTING_SHIELD / H_SPELL_LIGHTING_SHIELD +(3129, 50834, 59846, 0, 0), -- SPELL_STATIC_CHARGE / H_SPELL_STATIC_CHARGE +(3130, 51849, 59861, 0, 0), -- SPELL_LIGHTING_RING / H_SPELL_LIGHTING_RING +(3131, 42730, 59735, 0, 0), -- SPELL_WOE_STRIKE / H_SPELL_WOE_STRIKE +(3132, 42669, 59706, 0, 0), -- SPELL_SMASH / H_SPELL_SMASH +(3133, 42705, 59707, 0, 0), -- SPELL_ENRAGE / H_SPELL_ENRAGE +(3134, 42729, 59734, 0, 0), -- SPELL_DREADFUL_ROAR / H_SPELL_DREADFUL_ROAR +(3135, 42708, 59708, 0, 0), -- SPELL_STAGGERING_ROAR / H_SPELL_STAGGERING_ROAR +(3136, 42750, 59719, 0, 0), -- SPELL_SHADOW_AXE_DAMAGE / H_SPELL_SHADOW_AXE_DAMAGE +(3137, 43649, 59575, 0, 0), -- SPELL_SHADOW_BOLT / H_SPELL_SHADOW_BOLT +(3138, 48261, 59268, 0, 0), -- SPELL_IMPALE / H_SPELL_IMPALE +(3139, 48256, 59267, 0, 0), -- SPELL_WITHERING_ROAR / H_SPELL_WITHERING_ROAR +(3140, 48140, 59273, 0, 0), -- SPELL_CHAIN_LIGHTING / H_SPELL_CHAIN_LIGHTING +(3141, 48137, 59265, 0, 0), -- SPELL_MORTAL_WOUND / H_SPELL_MORTAL_WOUND +(3142, 48130, 59264, 0, 0), -- SPELL_GORE / H_SPELL_GORE +(3143, 48105, 59263, 0, 0), -- SPELL_GRIEVOUS_WOUND / H_SPELL_GRIEVOUS_WOUND +(3144, 48133, 59271, 0, 0), -- SPELL_POISON_BREATH / H_SPELL_POISON_BREATH +(3145, 48133, 59271, 0, 0), -- SPELL_POISON_BREATH / H_SPELL_POISON_BREATH +(3146, 50234, 59330, 0, 0), -- SPELL_CRUSH / H_SPELL_CRUSH +(3147, 50225, 59331, 0, 0), -- SPELL_POISONED_SPEAR / H_SPELL_POISONED_SPEAR +(3148, 15667, 59409, 0, 0), -- SPELL_SINSTER_STRIKE / H_SPELL_SINSTER_STRIKE +(3149, 48294, 59301, 0, 0), -- SPELL_BANE / H_SPELL_BANE +(3150, 48291, 59300, 0, 0), -- SPELL_FETID_ROT / H_SPELL_FETID_ROT +(3151, 48423, 59304, 0, 0), -- SPELL_SPIRIT_STRIKE / H_SPELL_SPIRIT_STRIKE +(3152, 48529, 59305, 0, 0), -- SPELL_SPIRIT_BURST / H_SPELL_SPIRIT_BURST +(3153, 58693, 59369, 0, 0), -- SPELL_BLIZZARD / H_SPELL_BLIZZARD +(3154, 58690, 59283, 0, 0), -- SPELL_TAIL_SWEEP / H_SPELL_TAIL_SWEEP +(3155, 58688, 59281, 0, 0), -- SPELL_UNCONTROLLABLE_ENERGY / H_SPELL_UNCONTROLLABLE_ENERGY +(3156, 54479, 59471, 0, 0), -- SPELL_EARTH_SHIELD / H_SPELL_EARTH_SHIELD +(3157, 54479, 59471, 0, 0), -- SPELL_EARTH_SHIELD / H_SPELL_EARTH_SHIELD +(3158, 54481, 59473, 0, 0), -- SPELL_CHAIN_HEAL / H_SPELL_CHAIN_HEAL +(3159, 54312, 59522, 0, 0), -- SPELL_FRENZY / SPELL_FRENZY_H +(3160, 54237, 59520, 0, 0), -- SPELL_WATER_BLAST / SPELL_WATER_BLAST_H +(3161, 54241, 59521, 0, 0), -- SPELL_WATER_BOLT_VOLLEY / SPELL_WATER_BOLT_VOLLEY_H +(3162, 54235, 59468, 0, 0), -- SPELL_FIREBOLT / H_SPELL_FIREBOLT +(3163, 54282, 59469, 0, 0), -- SPELL_FLAME_BREATH / H_SPELL_FLAME_BREATH +(3164, 54249, 59594, 0, 0), -- SPELL_LAVA_BURN / H_SPELL_LAVA_BURN +(3165, 54202, 59483, 0, 0), -- SPELL_ARCANE_BARRAGE_VOLLEY / SPELL_ARCANE_BARRAGE_VOLLEY_H +(3166, 54226, 59485, 0, 0), -- SPELL_ARCANE_BUFFET / SPELL_ARCANE_BUFFET_H +(3167, 54160, 59474, 0, 0), -- SPELL_ARCANE_POWER / H_SPELL_ARCANE_POWER +(3168, 54361, 59743, 0, 0), -- SPELL_VOID_SHIFT / H_SPELL_VOID_SHIFT +(3169, 54524, 59745, 0, 0), -- SPELL_SHROUD_OF_DARKNESS / H_SPELL_SHROUD_OF_DARKNESS +(3170, 54342, 59747, 0, 0), -- SPELL_ZURAMAT_ADD_2 / H_SPELL_ZURAMAT_ADD_2 +(3171, 32325, 38760, 0, 0), -- SPELL_VOID_BLAST / H_SPELL_VOID_BLAST +(3172, 32358, 38759, 0, 0), -- SPELL_DARK_SHELL / H_SPELL_DARK_SHELL +(3173, 38197, 40425, 0, 0), -- SPELL_ARCANE_EXPLOSION / H_SPELL_ARCANE_EXPLOSION +(3174, 35059, 40424, 0, 0), -- SPELL_ARCANE_VOLLEY / H_SPELL_ARCANE_VOLLEY +(3175, 38245, 43309, 0, 0), -- SPELL_POLYMORPH / H_SPELL_POLYMORPH +(3176, 33617, 39363, 0, 0), -- SPELL_RAIN_OF_FIRE / H_SPELL_RAIN_OF_FIRE +(3177, 34449, 37924, 0, 0), -- SPELL_WATER_BOLT_VOLLEY / H_SPELL_WATER_BOLT_VOLLEY +(3178, 31532, 37936, 0, 0), -- SPELL_REPAIR / H_SPELL_REPAIR +(3179, 33132, 37371, 0, 0), -- SPELL_FIRE_NOVA / H_SPELL_FIRE_NOVA +(3180, 28599, 40070, 0, 0), -- SPELL_SHADOW_BOLT_VOLLEY / H_SPELL_SHADOW_BOLT_VOLLEY +(3181, 49381, 59805, 0, 0), -- SPELL_CONSUME_AURA / H_SPELL_CONSUME_AURA +(3182, 30695, 37566, 0, 0), -- SPELL_TREACHEROUS_AURA / H_SPELL_BANE_OF_TREACHERY +(3183, 30686, 39297, 0, 0), -- SPELL_SHADOW_BOLT / H_SPELL_SHADOW_BOLT +(3184, 30641, 36814, 0, 0), -- SPELL_MORTAL_WOUND / H_SPELL_MORTAL_WOUND +(3185, 30495, 35953, 0, 0), -- SPELL_SHADOW_CLEAVE / H_SPELL_SHADOW_SLAM +(3186, 30598, 36056, 0, 0), -- SPELL_BURNING_MAUL / H_SPELL_BURNING_MAUL +(3187, 36924, 39017, 0, 0), -- SPELL_MIND_REND / H_SPELL_MIND_REND +(3188, 36924, 39017, 0, 0), -- SPELL_MIND_REND / H_SPELL_MIND_REND +(3189, 37162, 39019, 0, 0), -- SPELL_DOMINATION / H_SPELL_DOMINATION +(3190, 37162, 39019, 0, 0), -- SPELL_DOMINATION / H_SPELL_DOMINATION +(3191, 35322, 39193, 0, 0), -- SPELL_SHADOW_POWER / H_SPELL_SHADOW_POWER +(3192, 35327, 39194, 0, 0), -- SPELL_JACKHAMMER / H_SPELL_JACKHAMMER +(3193, 35275, 39084, 0, 0), -- SPELL_SUMMON_RAGIN_FLAMES / H_SPELL_SUMMON_RAGIN_FLAMES +(3194, 35268, 39346, 0, 0); -- SPELL_INFERNO / H_SPELL_INFERNO +/*!40000 ALTER TABLE `spelldifficulty_dbc` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `transports` +-- + +DROP TABLE IF EXISTS `transports`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `transports` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` text, + `period` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `transports` +-- + +LOCK TABLES `transports` WRITE; +/*!40000 ALTER TABLE `transports` DISABLE KEYS */; +/*!40000 ALTER TABLE `transports` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `trinity_string` +-- + +DROP TABLE IF EXISTS `trinity_string`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `trinity_string` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `trinity_string` +-- + +LOCK TABLES `trinity_string` WRITE; +/*!40000 ALTER TABLE `trinity_string` DISABLE KEYS */; +INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES +(1, 'You should select a character or a creature.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2, 'You should select a creature.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(3, '|cffff0000[System Message]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(4, '|cffff0000[Event Message]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5, 'There is no help for that command', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6, 'There is no such command', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(7, 'There is no such subcommand', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(8, 'Command %s have subcommands:%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(9, 'Commands available to you:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10, 'Incorrect syntax.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(11, 'Your account level is: %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(12, 'Active connections: %u (max: %u) Queued connections: %u (max: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(13, 'Server uptime: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(14, 'Player saved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(15, 'All players saved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(16, 'There are the following active GMs on this server:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(17, 'There are no GMs currently logged in on this server.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(18, 'Cannot do that while flying.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(19, 'Cannot do that in Battlegrounds.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(20, 'Target is flying you can''t do that.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(21, '%s is flying command failed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(22, 'You are not mounted so you can''t dismount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(23, 'Cannot do that while fighting.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(24, 'You used it recently.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(25, 'Password not changed (unknown error)!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(26, 'The password was changed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(27, 'The old password is wrong', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(28, 'Your account is now locked.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(29, 'Your account is now unlocked.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(30, ', rank ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(31, ' [known]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(32, ' [learn]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(33, ' [passive]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(34, ' [talent]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(35, ' [active]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(36, ' [complete]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(37, ' (offline)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(38, 'on', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(39, 'off', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(40, 'You are: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(41, 'visible', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(42, 'invisible', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(43, 'done', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(44, 'You', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(45, ' ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(46, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(47, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(48, 'UNKNOWN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(49, 'You must be at least level %u to enter.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(50, 'You must be at least level %u and have item %s to enter.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(51, 'Hello! Ready for some training?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(52, 'Invaid item count (%u) for item %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(53, 'Mail can''t have more %u item stacks', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(54, 'The new passwords do not match', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(55, 'Your password can''t be longer than 16 characters (client limit), password not changed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(56, 'Current Message of the day: \r\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(57, 'Using World DB: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(58, 'Using script library: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(59, 'Using creature EventAI: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(60, 'Online players: %u (max: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(61, 'Up to %u expansion allowed now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(62, 'One on more parameters have incorrect values', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(100, 'Global notify: ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(101, 'Map: %u (%s) Zone: %u (%s) Area: %u (%s) Phase: %u\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(102, '%s is already being teleported.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(103, 'You can summon a player to your instance only if he is in your party with you as leader.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(104, 'You cannot go to the player''s instance because you are in a party now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(105, 'You can go to the player''s instance while not being in his party only if your GM mode is on.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(106, 'You can not go to player %s from instance to instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(107, 'You can not summon player %s from instance to instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(108, 'You are summoning %s%s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(109, 'You are being summoned by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(110, 'You are teleporting %s%s to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(111, 'You are being teleported by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(112, 'Player (%s) does not exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(113, 'Appearing at %s''s location.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(114, '%s is appearing to your location.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(115, 'Incorrect values.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(116, 'No character selected.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(117, '%s is not in a group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(118, 'You changed HP of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(119, '%s changed your HP to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(120, 'You changed MANA of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(121, '%s changed your MANA to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(122, 'You changed ENERGY of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(123, '%s changed your ENERGY to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(124, 'Current energy: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(125, 'You changed rage of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(126, '%s changed your rage to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(127, 'You changed level of %s to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(128, 'GUID %i, faction is %i, flags is %i, npcflag is %i, DY flag is %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(129, 'Wrong faction: %u (not found in factiontemplate.dbc).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(130, 'You changed GUID=%i ''s Faction to %i, flags to %i, npcflag to %i, dyflag to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(131, 'You changed the spellflatid=%i, val= %i, mark =%i to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(132, '%s changed your spellflatid=%i, val= %i, mark =%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(133, '%s has access to all taxi nodes now (until logout).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(134, '%s has no more access to all taxi nodes now (only visited accessible).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(135, '%s has given you access to all taxi nodes (until logout).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(136, '%s has removed access to all taxi nodes (only visited still accessible).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(137, 'You set all speeds to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(138, '%s set all your speeds to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(139, 'You set the speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(140, '%s set your speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(141, 'You set the swim speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(142, '%s set your swim speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(143, 'You set the backwards run speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(144, '%s set your backwards run speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(145, 'You set the fly speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(146, '%s set your fly speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(147, 'You set the size %2.2f of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(148, '%s set your size to %2.2f.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(149, 'There is no such mount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(150, 'You give a mount to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(151, '%s gave you a mount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(152, 'USER1: %i, ADD: %i, DIF: %i\n', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(153, 'You take all copper of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(154, '%s took you all of your copper.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(155, 'You take %i copper from %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(156, '%s took %i copper from you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(157, 'You give %i copper to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(158, '%s gave you %i copper.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(159, 'You hear sound %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(160, 'USER2: %i, ADD: %i, RESULT: %i\n', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(161, 'Removed bit %i in field %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(162, 'Set bit %i in field %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(163, 'Teleport location table is empty!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(164, 'Teleport location not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(165, 'Requires search parameter.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(166, 'There are no teleport locations matching your request.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(168, 'Locations found are:\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(169, 'Mail sent to %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(170, 'You try to hear sound %u but it doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(171, 'You can''t teleport self to self!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(172, 'server console command', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(173, 'You changed runic power of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(174, '%s changed your runic power to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(175, 'Liquid level: %f, ground: %f, type: %d, status: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(200, 'No selection.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(201, 'Object GUID is: lowpart %u highpart %X', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(202, 'The name was too long by %i characters.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(203, 'Error, name can only contain characters A-Z and a-z.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(204, 'The subname was too long by %i characters.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(205, 'Not yet implemented', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(206, 'Item ''%i'' ''%s'' added to list with maxcount ''%i'' and incrtime ''%i'' and extendedcost ''%i''', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(207, 'Item ''%i'' not found in database.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(208, 'Item ''%i'' ''%s'' deleted from vendor list', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(209, 'Item ''%i'' not found in vendor list.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(210, 'Item ''%u'' (with extended cost %u) already in vendor list.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(211, 'Spells of %s reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(212, 'Spells of %s will reset at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(213, 'Talents of %s reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(214, 'Talents of %s will reset at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(215, 'Your spells have been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(216, 'Your talents have been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(217, 'Unknown case ''%s'' for .resetall command. Type full correct case name.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(218, 'Spells will reset for all players at login. Strongly recommend re-login!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(219, 'Talents will reset for all players at login. Strongly recommend re-login!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(220, 'Creature (GUID: %u) No waypoint found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(221, 'Creature (GUID: %u) Last waypoint not found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(222, 'Creature (GUID: %u) No waypoint found - used ''wpguid''. Now trying to find it by its position...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(223, 'Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(224, 'Selected creature is ignored - provided GUID is used', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(225, 'Creature (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(226, 'You must select a visual waypoint.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(227, 'No visual waypoints found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(228, 'Could not create visual waypoint with creatureID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(229, 'All visual waypoints removed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(230, 'Could not create waypoint-creature with ID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(231, 'No GUID provided.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(232, 'No waypoint number provided.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(233, 'Argument required for ''%s''.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(234, 'Waypoint %i added to GUID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(235, 'Waypoint %d added.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(236, 'Waypoint changed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(237, 'Waypoint %s modified.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(238, 'WP export successfull.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(239, 'No waypoints found inside the database.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(240, 'File imported.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(241, 'Waypoint removed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(242, 'Warning: Could not delete WP from the world with ID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(243, 'This happens if the waypoint is too far away from your char.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(244, 'The WP is deleted from the database, but not from the world here.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(245, 'They will disappear after a server restart.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(246, 'Waypoint %d: Info for creature: %s, GUID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(247, 'Waittime: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(248, 'Model %d: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(249, 'Emote: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(250, 'Spell: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(251, 'Text%d (ID: %i): %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(252, 'AIScript: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(253, 'Forced rename for player %s will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(254, 'Forced rename for player %s (GUID #%u) will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(255, 'Waypoint-Creature (GUID: %u) Not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(256, 'Could not find NPC...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(257, 'Creature movement type set to ''%s'', waypoints removed (if any).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(258, 'Creature movement type set to ''%s'', waypoints were not removed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(259, 'Incorrect value, use on or off', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(260, 'Value saved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(261, 'Value saved, you may need to rejoin or clean your client cache.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(262, 'Areatrigger ID %u not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(263, 'Target map or coordinates is invalid (X: %f Y: %f MapId: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(264, 'Zone coordinates is invalid (X: %f Y: %f AreaId: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(265, 'Zone %u (%s) is part of instanceable map %u (%s)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(266, 'Nothing found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(267, 'Object not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(268, 'Creature not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(269, 'Warning: Mob found more than once - you will be teleported to the first one found in DB.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(270, 'Creature Removed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(271, 'Creature moved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(272, 'Creature (GUID:%u) must be on the same map as player!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(273, 'Game Object (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(274, 'Game Object (GUID: %u) has references in not found creature %u GO list, can''t be deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(275, 'Game Object (GUID: %u) removed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(276, 'Game Object |cffffffff|Hgameobject:%d|h[%s]|h|r (GUID: %u) turned', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(277, 'Game Object |cffffffff|Hgameobject:%d|h[%s]|h|r (GUID: %u) moved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(278, 'You must select a vendor', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(279, 'You must send id for item', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(280, 'Vendor has too many items (max 128)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(281, 'You can''t kick self, logout instead', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(282, 'Player %s kicked.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(284, 'Accepting Whisper: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(285, 'Accepting Whisper: ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(286, 'Accepting Whisper: OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(287, 'Creature (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(288, 'Tickets count: %i show new tickets: %s\n', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(289, 'New ticket from %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(290, 'Ticket of %s (Last updated: %s):\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(291, 'New ticket show: ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(292, 'New ticket show: OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(293, 'Ticket %i doesn''t exist', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(294, 'All tickets deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(295, 'Character %s ticket deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(296, 'Ticket deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(297, 'Spawn distance changed to: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(298, 'Spawn time changed to: %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(299, 'The honor of %s was set to %u!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(300, 'Your chat has been disabled for %u minutes. Reason: %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(301, 'You have disabled %s''s chat for %u minutes. Reason: %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(302, 'Player''s chat is already enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(303, 'Your chat has been enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(304, 'You have enabled %s''s chat.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(305, 'Faction %s (%u) reputation of %s was set to %5d!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(306, 'The arena points of %s was set to %u!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(307, 'No faction found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(308, 'Faction %i unknown!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(309, 'Invalid parameter %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(310, 'delta must be between 0 and %d (inclusive)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(311, '%d - |cffffffff|Hfaction:%d|h[%s]|h|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(312, ' [visible]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(313, ' [at war]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(314, ' [peace forced]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(315, ' [hidden]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(316, ' [invisible forced]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(317, ' [inactive]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(318, 'Hated', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(319, 'Hostile', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(320, 'Unfriendly', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(321, 'Neutral', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(322, 'Friendly', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(323, 'Honored', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(324, 'Revered', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(325, 'Exalted', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(326, 'Faction %s (%u) can''nt have reputation.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(327, ' [no reputation]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(328, 'Characters at account %s (Id: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(329, ' %s (GUID %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(330, 'No players found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(331, 'Extended item cost %u not exist', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(332, 'GM mode is ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(333, 'GM mode is OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(334, 'GM Chat Badge is ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(335, 'GM Chat Badge is OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(336, 'You repair all %s''s items.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(337, 'All your items repaired by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(338, 'You set waterwalk mode %s for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(339, 'Your waterwalk mode %s by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(340, '%s is now following you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(341, '%s is not following you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(342, '%s is now not following you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(343, 'Creature (Entry: %u) cannot be tamed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(344, 'You already have pet.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(345, 'Forced customize for player %s will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(346, 'Forced customize for player %s (GUID #%u) will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(347, 'TaxiNode ID %u not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(348,'Game Object (Entry: %u) have invalid data and can''t be spawned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(349,'%d (idx:%d) - |cffffffff|Htitle:%d|h[%s %s]|h|r %s %s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(350,'%d (idx:%d) - [%s %s] %s %s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(351,'No titles found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(352,'Invalid title id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(353,'Title %u (%s) added to known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(354,'Title %u (%s) removed from known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(355,'Title %u (%s) set as current seelcted title for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(356,'Current selected title for player %s reset as not known now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(400, '|cffff0000[System Message]:|rScripts reloaded', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(401, 'You change security level of account %s to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(402, '%s changed your security level to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(403, 'You have low security level for this.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(404, 'Creature movement disabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(405, 'Creature movement enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(406, 'Weather can''t be changed for this zone.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(407, 'Weather system disabled at server.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(408, '%s is banned for %s. Reason: %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(409, '%s is banned permanently for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(410, '%s %s not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(411, '%s unbanned.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(412, 'There was an error removing the ban on %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(413, 'Account not exist: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(414, 'There is no such character.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(415, 'There is no such IP in banlist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(416, 'Account %s has never been banned', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(417, 'Ban history for account %s:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(418, 'Ban Date: %s Bantime: %s Still active: %s Reason: %s Set by: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(419, 'Inf.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(420, 'Never', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(421, 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(422, 'No', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(423, 'IP: %s\nBan Date: %s\nUnban Date: %s\nRemaining: %s\nReason: %s\nSet by: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(424, 'There is no matching IPban.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(425, 'There is no matching account.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(426, 'There is no banned account owning a character matching this part.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(427, 'The following IPs match your pattern:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(428, 'The following accounts match your query:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(429, 'You learned many spells/skills.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(430, 'You learned all spells for class.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(431, 'You learned all talents for class.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(432, 'You learned all languages.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(433, 'You learned all craft skills and recipes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(434, 'Could not find ''%s''', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(435, 'Invalid item id: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(436, 'No items found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(437, 'Invalid gameobject id: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(438, 'Found items %u: %u ( inventory %u mail %u auction %u guild %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(439, 'Found gameobjects %u: %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(440, 'Invalid creature id: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(441, 'Found creatures %u: %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(442, 'No area found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(443, 'No item sets found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(444, 'No skills found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(445, 'No spells found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(446, 'No quests found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(447, 'No creatures found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(448, 'No gameobjects found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(449, 'Graveyard #%u doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(450, 'Graveyard #%u already linked to zone #%u (current).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(451, 'Graveyard #%u linked to zone #%u (current).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(452, 'Graveyard #%u can''t be linked to subzone or not existed zone #%u (internal error).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(454, 'No faction in Graveyard with id= #%u , fix your DB', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(455, 'invalid team, please fix database', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(456, 'any', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(457, 'alliance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(458, 'horde', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(459, 'Graveyard #%u (faction: %s) is nearest from linked to zone #%u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(460, 'Zone #%u doesn''t have linked graveyards.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(461, 'Zone #%u doesn''t have linked graveyards for faction: %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(462, 'Teleport location already exists!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(463, 'Teleport location added.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(464, 'Teleport location NOT added: database error.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(465, 'Teleport location deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(466, 'No taxinodes found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(467, 'Target unit has %d auras:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(468, 'id: %d effmask: %d charges: %d stack: %d slot %d duration: %d maxduration: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(469, 'Target unit has %d auras of type %d:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(470, 'id: %d eff: %d amount: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(471, 'Quest %u not found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(472, 'Quest %u started from item. For correct work, please, add item to inventory and start quest in normal way: .additem %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(473, 'Quest removed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(474, ' [rewarded]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(475, ' [complete]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(476, ' [active]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(477, '%s''s Fly Mode %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(478, 'Opcode %u sent to %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(479, 'Character loaded successfully!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(480, 'Failed to load the character!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(481, 'Character dumped successfully!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(482, 'Character dump failed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(483, 'Spell %u broken and not allowed to cast or learn!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(484, 'Skill %u (%s) for player %s set to %u and current maximum set to %u (without permanent (talent) bonuses).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(485, 'Player %s must have skill %u (%s) before using this command.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(486, 'Invalid skill id (%u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(487, 'You learned default GM spells/skills.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(488, 'You already know that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(489, 'Target(%s) already know that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(490, '%s doesn''t know that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(491, 'You already forgot that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(492, 'All spell cooldowns removed for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(493, 'Spell %u cooldown removed for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(494, 'Command : Additem, itemId = %i, amount = %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(495, 'Command : Additemset, itemsetId = %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(496, 'Removed itemID = %i, amount = %i from %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(497, 'Cannot create item ''%i'' (amount: %i)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(498, 'You need to provide a guild name!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(499, 'Player not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(500, 'Player already has a guild!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(501, 'Guild not created! (already exists?)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(502, 'No items from itemset ''%u'' found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(503, 'The distance is: (3D) %f (2D) %f (Exact 3D) %f (Exact 2D) %f yards.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(504, 'Item ''%i'' ''%s'' Item Slot %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(505, 'Item ''%i'' doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(506, 'Item ''%i'' ''%s'' Added to Slot %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(507, 'Item save failed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(508, '%d - owner: %s (guid: %u account: %u ) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(509, '%d - sender: %s (guid: %u account: %u ) receiver: %s (guid: %u account: %u ) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(510, '%d - owner: %s (guid: %u account: %u ) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(511, 'Wrong link type!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(512, '%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0:0|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(513, '%d - |cffffffff|Hquest:%d:%d|h[%s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(514, '%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(515, '%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(516, '%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(517, '%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(518, '%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(519, '|cffffffff|Htele:%s|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(520, '%d - |cffffffff|Hspell:%d|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(521, '%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(522, 'Game Object (Entry: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(523, '>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(524, 'Selected object:\n|cffffffff|Hgameobject:%d|h[%s]|h|r GUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f\nPhasemask %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(525, '>> Add Game Object ''%i'' (%s) (GUID: %i) added at ''%f %f %f''.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(526, '%s (lowguid: %u) movement generators stack:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(527, ' Idle', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(528, ' Random', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(529, ' Waypoint', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(530, ' Animal random', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(531, ' Confused', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(532, ' Targeted to player %s (lowguid %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(533, ' Targeted to creature %s (lowguid %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(534, ' Targeted to ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(535, ' Home movement to (X:%f Y:%f Z:%f)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(536, ' Home movement used for player?!?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(537, ' Taxi flight', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(538, ' Unknown movement generator (%u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(539, 'Player selected NPC\nGUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(540, 'Level: %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(541, 'Health (base): %u. (max): %u. (current): %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(542, 'Field Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(543, 'Loot: %u Pickpocket: %u Skinning: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(544, 'Position: %f %f %f.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(545, '*** Is a vendor!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(546, '*** Is a trainer!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(547, 'InstanceID: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(548, 'Player%s %s (guid: %u) Account: %s (id: %u) Email: %s GMLevel: %u Last IP: %s Last login: %s Latency: %ums', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(549, 'Race: %s Class: %s Played time: %s Level: %u Money: %ug%us%uc', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(550, 'Command .pinfo doesn''t support ''rep'' option for offline players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(551, '%s has explored all zones now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(552, '%s has no more explored zones.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(553, '%s has explored all zones for you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(554, '%s has hidden all zones from you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(555, 'Hover enabled', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(556, 'Hover disabled', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(557, '%s level up you to (%i)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(558, '%s level down you to (%i)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(559, '%s reset your level progress.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(560, 'The area has been set as explored.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(561, 'The area has been set as not explored.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(562, 'GUID=%i ''s updateIndex: %i, value: %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(563, 'You change GUID=%i ''s UpdateIndex: %i value to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(564, 'The value index %u is too big to %u(count: %u).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(565, 'Set %u uint32 Value:[OPCODE]:%u [VALUE]:%u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(566, 'You Set %u Field:%u to uint32 Value: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(567, 'Set %u float Value:[OPCODE]:%u [VALUE]:%f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(568, 'You Set %u Field:%i to float Value: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(569, 'Get %u uint32 Value:[OPCODE]:%u [VALUE]:%u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(570, 'The uint32 value of %u in %u is: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(571, 'Get %u float Value:[OPCODE]:%u [VALUE]:%f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(572, 'The float of %u value in %u is: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(573, '.Set32Bit:[OPCODE]:%u [VALUE]:%u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(574, 'You set Bit of Field:%u to Value: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(575, '.Mod32Value:[OPCODE]:%u [VALUE]:%i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(576, 'You modified the value of Field:%u to Value: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(577, 'You are now invisible.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(578, 'You are now visible.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(579, 'Selected player or creature not have victim.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(580, 'Player %s learned all default spells for race/class and completed quests rewarded spells.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(581, 'Found near gameobjects (distance %f): %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(582, 'SpawnTime: Full:%s Remain:%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(583, '%d - |cffffffff|Hgameevent:%d|h[%s]|h|r%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(584, 'No event found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(585, 'Event not exist!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(586, 'Event %u: %s%s\nStart: %s End: %s Occurence: %s Length: %s\nNext state change: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(587, 'Event %u already active!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(588, 'Event %u not active!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(589, ' Point movement to (X:%f Y:%f Z:%f)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(590, ' Fear movement', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(591, ' Distract movement', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(592, 'You have learned all spells in craft: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(593, 'Currently Banned Accounts:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(594, '| Account | BanDate | UnbanDate | Banned By | Ban Reason |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(595, 'Currently Banned IPs:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(596, '| IP | BanDate | UnbanDate | Banned By | Ban Reason |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(597, 'Current gamemasters:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(598, '| Account | GM |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(599, 'No gamemasters.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(600, 'The Alliance wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(601, 'The Horde wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(602, 'The battle for Warsong Gulch begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(603, 'The battle for Warsong Gulch begins in 30 seconds. Prepare yourselves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(604, 'Let the battle for Warsong Gulch begin!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(605, '$n captured the Horde flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(606, '$n captured the Alliance flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(607, 'The Horde flag was dropped by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(608, 'The Alliance Flag was dropped by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(609, 'The Alliance Flag was returned to its base by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(610, 'The Horde flag was returned to its base by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(611, 'The Horde flag was picked up by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(612, 'The Alliance Flag was picked up by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(613, 'The flags are now placed at their bases.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(614, 'The Alliance flag is now placed at its base.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(615, 'The Horde flag is now placed at its base.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(636, 'The Battle for Eye of the Storm begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(637, 'The Battle for Eye of the Storm begins in 30 seconds.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(638, 'The Battle for Eye of the Storm has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(650, 'Alliance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(651, 'Horde', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(652, 'stables', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(653, 'blacksmith', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(654, 'farm', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(655, 'lumber mill', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(656, 'mine', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(657, 'The %s has taken the %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(658, '$n has defended the %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(659, '$n has assaulted the %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(660, '$n claims the %s! If left unchallenged, the %s will control it in 1 minute!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(661, 'The Battle for Arathi Basin begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(662, 'The Battle for Arathi Basin begins in 30 seconds. Prepare yourselves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(663, 'The Battle for Arathi Basin has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(664, 'The Alliance has gathered $1776W resources, and is near victory!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(665, 'The Horde has gathered $1777W resources, and is near victory!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(666, 'After your recent battle in %s our best attempts to award you a Mark of Honor failed. Enclosed you will find the Mark of Honor we were not able to deliver to you at the time. Thanks for fighting in %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(667, 'The Alliance has taken control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(668, 'The Horde has taken control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(669, 'The Alliance has taken control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(670, 'The Horde has taken control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(671, 'The Alliance has taken control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(672, 'The Horde has taken control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(673, 'The Alliance has taken control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(674, 'The Horde has taken control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(675, 'The Alliance has lost control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(676, 'The Horde has lost control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(677, 'The Alliance has lost control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(678, 'The Horde has lost control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(679, 'The Alliance has lost control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(680, 'The Horde has lost control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(681, 'The Alliance has lost control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(682, 'The Horde has lost control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(683, '%s has taken the flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(684, 'The Alliance have captured the flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(685, 'The Horde have captured the flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(686, 'The flag has been dropped.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(687, 'The flag has been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(700, 'You must be level %u to form an arena team', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(701, 'One minute until the Arena battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(702, 'Thirty seconds until the Arena battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(703, 'Fifteen seconds until the Arena battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(704, 'The Arena battle has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(705, 'You must wait %s before speaking again.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(706, 'This item(s) have problems with equipping/storing in inventory.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(707, '%s wishes to not be disturbed and cannot receive whisper messages: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(708, '%s is Away from Keyboard: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(709, 'Do not Disturb', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(710, 'Away from Keyboard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(711, 'Queue status for %s (Lvl: %u to %u)\nQueued alliances: %u (Need at least %u more)\nQueued hordes: %u (Need at least %u more)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(712, '|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u/%u, H: %u/%u|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(713, 'You must be level %u to join an arena team!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(715, 'You don''t meet Battleground level requirements', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(717, '|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] Started!|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(718, '|cffff0000[Arena Queue Announcer]:|r %s -- Joined : %ux%u : %u|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(719, '|cffff0000[Arena Queue Announcer]:|r %s -- Exited : %ux%u : %u|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(720, 'Your group is too large for this battleground. Please regroup to join.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(721, 'Your group is too large for this arena. Please regroup to join.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(722, 'Your group has members not in your arena team. Please regroup to join.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(723, 'Your group does not have enough players to join this match.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(724, 'The Gold Team wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(725, 'The Green Team wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(726, 'There aren''t enough players in this battleground. It will end soon unless some more players join to balance the fight.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(727, 'Your group has an offline member. Please remove him before joining.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(728, 'Your group has players from the opposing faction. You can''t join the battleground as a group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(729, 'Your group has players from different battleground brakets. You can''t join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(730, 'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(731, 'Someone in your party is Deserter. You can''t join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(732, 'Someone in your party is already in three battleground queues. You cannot join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(733, 'You cannot teleport to a battleground or arena map.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(734, 'You cannot summon players to a battleground or arena map.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(735, 'You must be in GM mode to teleport to a player in a battleground.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(736, 'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(737, 'Arenas are set to 1v1 for debugging. So, don''t join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(738, 'Arenas are set to normal playercount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(739, 'Battlegrounds are set to 1v0 for debugging.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(740, 'Battlegrounds are set to normal playercount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(741, 'Flushing Arena points based on team ratings, this may take a few minutes. Please stand by...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(742, 'Distributing arena points to players...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(743, 'Finished setting arena points for online players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(744, 'Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(745, 'Modification done.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(746, 'Done flushing Arena points.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(747, 'This Battleground have been disabled. You can''t join the queue.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(748, 'Arenas have been disabled. You can''t join the queue.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(750, 'Not enough players. This game will close in %u mins.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(751, 'Not enough players. This game will close in %u seconds.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(753, 'The battle for Warsong Gulch begins in 2 minutes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(754, 'The battle for Arathi Basin begins in 2 minutes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(755, 'The battle for Eye of the Storm begins in 2 minutes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(785, 'Arena testing turned %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(786, '|cffff0000[Automatic]:|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(787, '|cffffff00[|c1f40af20Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(800, 'Invalid name', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(801, 'You do not have enough gold', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(802, 'You do not have enough free slots', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(803, 'Your partner does not have enough free bag slots', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(804, 'You do not have permission to perform that function', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(805, 'Unknown language', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(806, 'You don''t know that language', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(807, 'Please provide character name', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(808, 'Player %s not found or offline', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(809, 'Account for character %s not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(810, '|Hplayer:$N|h[$N]|h has earned the achievement $a!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(811, 'Guild Master', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(812, 'Officer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(813, 'Veteran', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(814, 'Member', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(815, 'Initiate', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(816, 'Warning: You''ve entered a no-fly zone and are about to be dismounted!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(817, 'Entry %u not found in creature_template table.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(818, 'Entry %u not found in sCreatureStorage. Possible new line in creature_template, but you can not add new creatures without restarting. Only modifing is allowed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1000, 'Exiting daemon...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1001, 'Account deleted: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1002, 'Account %s NOT deleted (probably sql file format was updated)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1003, 'Account %s NOT deleted (unknown error)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1004, 'Account created: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1005, 'Account name can''t be longer than 16 characters (client limit), account not created!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1006, 'Account with this name already exist!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1007, 'Account %s NOT created (probably sql file format was updated)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1008, 'Account %s NOT created (unknown error)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1009, 'Player %s (Guid: %u) Account %s (Id: %u) deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1010, '[ Account][ Character][ IP][GMLev][Expansion][Map][Zone]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1011, '| | %20s | || |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1012, '==============================================================================', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1013, '-[%16s][%12s][%15s][%5d][%9d][%3d][%4d]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1014, 'No online players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1015, '============================== Characters Online =============================', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1100, 'Account %s (Id: %u) have up to %u expansion allowed now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1101, 'Message of the day changed to:\r\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1102, 'Message sent to %s: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1103, '%d - %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1104, '%d - %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1105, '%d - %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1106, '%d - %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1107, '%d - %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1108, '%d - %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1109, '%d - %s %s %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1110, '%d - %s X:%f Y:%f Z:%f MapId:%d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1111, '%d - %s X:%f Y:%f Z:%f MapId:%d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1112, 'Failed to open file: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1113, 'Account %s (%u) have max amount allowed characters (client limit)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1114, 'Dump file have broken data!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1115, 'Invalid character name!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1116, 'Invalid character guid!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1117, 'Character guid %u in use!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1118, '%d - guild: %s (guid: %u) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1119, 'You must use male or female as gender.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1120, 'You change gender of %s to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1121, 'Your gender changed to %s by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1122, '(%u/%u +perm %u +temp %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1123, 'Not pet found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1124, 'Wrong pet type', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1125, 'Your pet learned all talents', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1126, 'Your pet talents have been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1127, 'Talents of %s''s pet reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1128, '%d - |cffffffff|Htaxinode:%u|h[%s %s]|h|r (Map:%u X:%f Y:%f Z:%f)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1129, '%d - %s %s (Map:%u X:%f Y:%f Z:%f)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1200, 'You try to view cinemitic %u but it doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1201, 'You try to view movie %u but it doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1300, 'Alliance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1301, 'Horde', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1302, '%s was destroyed by the %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1303, 'The %s is under attack! If left unchecked, the %s will destroy it!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1304, 'The %s was taken by the %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1305, 'The %s was taken by the %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1306, 'The %s was taken by the %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1307, 'The %s is under attack! If left unchecked, the %s will capture it!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1308, 'The %s has taken the %s! Its supplies will now be used for reinforcements!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1309, 'Irondeep Mine', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1310, 'Coldtooth Mine', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1311, 'Stormpike Aid Station', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1312, 'Dun Baldar South Bunker', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1313, 'Dun Baldar North Bunker', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1314, 'Stormpike Graveyard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1315, 'Icewing Bunker', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1316, 'Stonehearth Graveyard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1317, 'Stonehearth Bunker', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1318, 'Snowfall Graveyard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1319, 'Iceblood Tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1320, 'Iceblood Graveyard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1321, 'Tower Point', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1322, 'Frostwolf Graveyard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1323, 'East Frostwolf Tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1324, 'West Frostwolf Tower', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1325, 'Frostwolf Relief Hut', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1326, 'The Battle for Alterac Valley begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1327, 'The Battle for Alterac Valley begins in 30 seconds. Prepare yourselves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1328, 'The Battle for Alterac Valley has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1329, 'The Alliance Team is running out of reinforcements!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1330, 'The Horde Team is running out of reinforcements!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1331, 'The Frostwolf General is Dead!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1332, 'The Stormpike General is Dead!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(1333, 'The Battle for Alterac Valley begins in 2 minutes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2000, '|cff00ff00New ticket from|r|cffff00ff %s.|r |cff00ff00Ticket entry:|r|cffff00ff %d.|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2001, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00edited his/her ticket:|r|cffff00ff %d.|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2002, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00abandoned ticket entry:|r|cffff00ff %d.|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2003, '|cff00ff00Closed by|r:|cff00ccff %s|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2004, '|cff00ff00Deleted by|r:|cff00ccff %s|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2005, 'Ticket not found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2006, 'Please close ticket before deleting it permanently.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2007, 'Ticket %d is already assigned.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2008, '%u Tickets succesfully reloaded from the database.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2009, 'Showing list of open tickets.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2010, 'Showing list of open tickets whose creator is online.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2011, 'Showing list of closed tickets.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2012, 'Invalid name specified. Name should be that of an online Gamemaster.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2013, 'This ticket is already assigned to yourself. To unassign use .ticket unassign %d and then reassign.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2014, 'Ticket %d is not assigned, you cannot unassign it.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2015, 'You cannot unassign tickets from staffmembers with a higher security level than yourself.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2016, 'Cannot close ticket %d, it is assigned to another GM.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2017, '|cffaaffaaTicket|r:|cffaaccff %d.|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2018, '|cff00ff00Created by|r:|cff00ccff %s|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2019, '|cff00ff00Last change|r:|cff00ccff %s ago|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2020, '|cff00ff00Assigned to|r:|cff00ccff %s|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2021, '|cff00ff00Unassigned by|r:|cff00ccff %s|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2022, '|cff00ff00Ticket Message|r: [%s]|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2023, '|cff00ff00GM Comment|r: [%s]|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2024, '|cff00ccff%s|r |cff00ff00Added comment|r: [%s]|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2025, '|cff00ff00Created|r:|cff00ccff %s ago|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5000, 'You froze player %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5001, 'It might be amusing but no... you cant freeze yourself!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5002, 'Invalid input check the name of target.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5003, 'You unfroze player %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5004, 'There are no frozen players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5005, 'Following players are frozen on the server:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5006, '- %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5007, 'You must be in a raid group to enter this instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5008, 'This instance is closed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5009, 'Sound %u Played to server', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5010, 'linkGUID: %u, Entry: %u (%s)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5011, 'You can''t teleport self to self!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5012, 'No maps found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5013, '[Continent]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5014, '[Instance]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5015, '[Battleground]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5016, '[Arena]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5017, '[Raid reset time: %s]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5018, '[Heroic reset time: %s]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5019, '[Mountable]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5020, 'Phasemask: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5021, 'Armor: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5022, 'Channel password not changed due to channel being marked public. GM Powers required.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5023, 'Channel: %s publicity set to: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5024, 'Entry: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5025, 'Type: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5026, 'DisplayID: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(5027, 'Name: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6604, 'You cannot say, yell or emote until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6605, 'You cannot whisper until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6606, 'You cannot write to channels until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6607, 'You cannot use auction until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6608, 'You cannot write tickets until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6609, 'You cannot trade until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6610, 'You cannot trade with characters lower than level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6611, 'You cannot send mail until you become level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6612, 'You cannot send mail to characters lower than level %d.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6613, '|cfff00000[GM Announcement]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6614, 'Notification to GM''s - ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(6616, 'Silence is ON for %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(7523, 'WORLD: Denying connections.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(7524, 'WORLD: Accepting connections.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10001, 'The Horde has taken The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10002, 'The Alliance has taken The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10003, 'The Horde has taken The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10004, 'The Alliance has taken The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10005, 'The Horde has taken Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10006, 'The Alliance has taken Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10007, 'The Horde lost The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10008, 'The Alliance lost The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10009, 'The Horde lost The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10010, 'The Alliance lost The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10011, 'The Horde lost Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10012, 'The Alliance lost Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10013, 'The Horde has taken the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10014, 'The Alliance has taken the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10015, 'The Horde has taken the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10016, 'The Alliance has taken the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10017, 'The Horde has captured the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10018, 'The Alliance has captured the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10019, 'The Horde lost the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10020, 'The Alliance lost the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10021, 'The Horde lost the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10022, 'The Alliance lost the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10023, 'The Horde lost the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10024, 'The Alliance lost the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10025, 'The Horde has captured Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10026, 'The Alliance has captured Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10027, 'The Horde lost Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10028, 'The Alliance lost Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10029, 'The Horde has taken a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10030, 'The Alliance has taken a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10031, 'The Horde lost a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10032, 'The Alliance lost a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10033, 'The Horde has taken the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10034, 'The Alliance has taken the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10035, 'The Horde has taken the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10036, 'The Alliance has taken the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10037, 'The Horde has taken the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10038, 'The Alliance has taken the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10039, 'The Horde has taken the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10040, 'The Alliance has taken the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10041, 'The Horde lost the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10042, 'The Alliance lost the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10043, 'The Horde lost the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10044, 'The Alliance lost the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10045, 'The Horde lost the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10046, 'The Alliance lost the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10047, 'The Horde lost the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10048, 'The Alliance lost the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10049, 'The Horde has collected 200 silithyst!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10050, 'The Alliance has collected 200 silithyst!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10051, 'Take me to Northpass Tower.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10052, 'Take me to Eastwall Tower.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10053, 'Take me to Crown Guard Tower.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10054, 'Give me the flag, I''ll take it to the central beacon for the glory of the Alliance!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10055, 'Give me the flag, I''ll take it to the central beacon for the glory of the Horde!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(10056,'The battle for Strand of the Ancients begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10057,'The battle for Strand of the Ancients begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10058,'The battle for Strand of the Ancients begins in 30 seconds. Prepare yourselves!.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10059,'Let the battle for Strand of the Ancients begin!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10060,'The %s is under attack!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10061,'The %s was destroyed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10062,'Round 1 - finished!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10063,'The Alliance captured the titan portal!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10064,'The Horde captured the titan portal!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10065,'Round 2 of the Battle for the Strand of the Ancients begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10066,'Round 2 begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10067,'The chamber has been breached! The titan relic is vulnerable!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10068,'The Alliance captured the South Graveyard!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10069,'The Alliance captured the West Graveyard!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10070,'The Alliance captured the East Graveyard!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10071,'The Horde captured the South Graveyard!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10072,'The Horde captured the West Graveyard!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(10073,'The Horde captured the East Graveyard!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(11000, '|cffffff00[|c00077766Autobroadcast|cffffff00]: |cFFF222FF%s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(11001, 'You have not chosen -1 or the current realmID that you are on.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +/*!40000 ALTER TABLE `trinity_string` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `vehicle_accessory` +-- + +DROP TABLE IF EXISTS `vehicle_accessory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vehicle_accessory` ( + `entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0, + `accessory_entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0, + `seat_id` TINYINT(1) SIGNED NOT NULL DEFAULT 0, + `minion` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + `description` TEXT NOT NULL, + PRIMARY KEY (`entry`, `seat_id`) +) +COLLATE=utf8_general_ci +ENGINE=MyISAM +ROW_FORMAT=FIXED +AVG_ROW_LENGTH=0; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `version` +-- + +LOCK TABLES `vehicle_accessory` WRITE; +/*!40000 ALTER TABLE `vehicle_accessory` DISABLE KEYS */; +/*!40000 ALTER TABLE `vehicle_accessory` ENABLE KEYS */; +UNLOCK TABLES; +-- +-- Table structure for table `version` +-- + +DROP TABLE IF EXISTS `version`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `version` ( + `core_version` varchar(120) DEFAULT NULL COMMENT 'Core revision dumped at startup.', + `core_revision` bigint(20) unsigned DEFAULT NULL, + `db_version` varchar(120) DEFAULT NULL COMMENT 'Version of world DB.', + `script_version` varchar(120) DEFAULT NULL COMMENT 'Version of scripts DB.', + `cache_id` int(10) DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Version Notes'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `version` +-- + +LOCK TABLES `version` WRITE; +/*!40000 ALTER TABLE `version` DISABLE KEYS */; +/*!40000 ALTER TABLE `version` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `waypoint_data` +-- + +DROP TABLE IF EXISTS `waypoint_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `waypoint_data` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature GUID', + `point` mediumint(8) unsigned NOT NULL DEFAULT '0', + `position_x` float NOT NULL DEFAULT '0', + `position_y` float NOT NULL DEFAULT '0', + `position_z` float NOT NULL DEFAULT '0', + `delay` int(10) unsigned NOT NULL DEFAULT '0', + `move_flag` tinyint(1) NOT NULL DEFAULT '0', + `action` int(11) NOT NULL DEFAULT '0', + `action_chance` smallint(3) NOT NULL DEFAULT '100', + `wpguid` int(11) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `waypoint_data` +-- + +LOCK TABLES `waypoint_data` WRITE; +/*!40000 ALTER TABLE `waypoint_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `waypoint_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `waypoint_scripts` +-- + +DROP TABLE IF EXISTS `waypoint_scripts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `waypoint_scripts` ( + `id` int(11) unsigned NOT NULL DEFAULT '0', + `delay` int(11) unsigned NOT NULL DEFAULT '0', + `command` int(11) unsigned NOT NULL DEFAULT '0', + `datalong` int(11) unsigned NOT NULL DEFAULT '0', + `datalong2` int(11) unsigned NOT NULL DEFAULT '0', + `dataint` int(11) unsigned NOT NULL DEFAULT '0', + `x` float NOT NULL DEFAULT '0', + `y` float NOT NULL DEFAULT '0', + `z` float NOT NULL DEFAULT '0', + `o` float NOT NULL DEFAULT '0', + `guid` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `waypoint_scripts` +-- + +LOCK TABLES `waypoint_scripts` WRITE; +/*!40000 ALTER TABLE `waypoint_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `waypoint_scripts` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2009-12-18 17:18:11 diff --git a/sql/create/CMakeLists.txt b/sql/create/CMakeLists.txt new file mode 100644 index 00000000000..91cb61ec84e --- /dev/null +++ b/sql/create/CMakeLists.txt @@ -0,0 +1,5 @@ +########### install files ############### + +FILE(GLOB _SQL *.sql) + +install(FILES ${_SQL} DESTINATION share/trinity/sql/tools) \ No newline at end of file diff --git a/sql/create/create_mysql.sql b/sql/create/create_mysql.sql new file mode 100644 index 00000000000..e182e06168f --- /dev/null +++ b/sql/create/create_mysql.sql @@ -0,0 +1,13 @@ +GRANT USAGE ON * . * TO 'trinity'@'localhost' IDENTIFIED BY 'trinity' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ; + +CREATE DATABASE `world` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; + +CREATE DATABASE `characters` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; + +CREATE DATABASE `auth` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; + +GRANT ALL PRIVILEGES ON `world` . * TO 'trinity'@'localhost' WITH GRANT OPTION; + +GRANT ALL PRIVILEGES ON `characters` . * TO 'trinity'@'localhost' WITH GRANT OPTION; + +GRANT ALL PRIVILEGES ON `auth` . * TO 'trinity'@'localhost' WITH GRANT OPTION; diff --git a/sql/create/drop_mysql.sql b/sql/create/drop_mysql.sql new file mode 100644 index 00000000000..ee05439df99 --- /dev/null +++ b/sql/create/drop_mysql.sql @@ -0,0 +1,21 @@ +REVOKE ALL PRIVILEGES ON * . * FROM 'trinity'@'localhost'; + +REVOKE ALL PRIVILEGES ON `world` . * FROM 'trinity'@'localhost'; + +REVOKE GRANT OPTION ON `world` . * FROM 'trinity'@'localhost'; + +REVOKE ALL PRIVILEGES ON `characters` . * FROM 'trinity'@'localhost'; + +REVOKE GRANT OPTION ON `characters` . * FROM 'trinity'@'localhost'; + +REVOKE ALL PRIVILEGES ON `auth` . * FROM 'trinity'@'localhost'; + +REVOKE GRANT OPTION ON `auth` . * FROM 'trinity'@'localhost'; + +DROP USER 'trinity'@'localhost'; + +DROP DATABASE IF EXISTS `world`; + +DROP DATABASE IF EXISTS `characters`; + +DROP DATABASE IF EXISTS `auth`; diff --git a/sql/full/CMakeLists.txt b/sql/full/CMakeLists.txt deleted file mode 100644 index 6c48ff4c8ca..00000000000 --- a/sql/full/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -########### install files ############### - -FILE(GLOB _SQL *.sql) -FILE(GLOB README readme.txt) - -install(FILES ${_SQL} DESTINATION share/trinity/sql/FULL) -install(FILES ${README} DESTINATION share/trinity/sql/FULL) \ No newline at end of file diff --git a/sql/scripts/CMakeLists.txt b/sql/scripts/CMakeLists.txt new file mode 100644 index 00000000000..554ff9ba184 --- /dev/null +++ b/sql/scripts/CMakeLists.txt @@ -0,0 +1,5 @@ +########### install files ############### + +FILE(GLOB _SQL *.sql) + +install(FILES ${README} DESTINATION share/trinity/sql/full) \ No newline at end of file diff --git a/sql/full/world_script_texts.sql b/sql/scripts/world_script_texts.sql similarity index 99% rename from sql/full/world_script_texts.sql rename to sql/scripts/world_script_texts.sql index 961f5731fa8..84e05311494 100644 --- a/sql/full/world_script_texts.sql +++ b/sql/scripts/world_script_texts.sql @@ -423,6 +423,9 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1` (23861,-1000471,'It was... terrible... the demon...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''), (23864,-1000472,'This land was mine long before your wretched kind set foot here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''), (23864,-1000473,'All who venture here belong to me, including you!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''), + (17375, -1000474, '[Fulborg] The Stillpine furbolgs will not soon forget your bravery!', 0, 0, 'Stillpine Capitive free say text 1'), + (17375, -1000475, '[Fulborg] Thank you, $N', 0, 0, 'Stillpine Capitive free say text 2'), + (17375, -1000476, '[Fulborg] Those remaining at Stillpine Hold will welcome you as a hero!', 0, 0, 'Stillpine Capitive free say text 3'); (26588,-1800001, 'Um... I think one of those wolves is back...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'), (26588,-1800002, 'He''s going for Mr. Floppy! ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'), (26588,-1800003, 'Oh, no! Look, it''s another wolf, and it''s a biiiiiig one!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'), @@ -1797,9 +1800,9 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1` -- Skadi the Ruthless voice (26693,-1575004,'What mongrels dare intrude here? Look alive, my brothers! A feast for the one that brings me their heads!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13497,1,0,0, 'Skadi - SAY_AGGRO'), (26693,-1575005,'Not so brash now, are you?' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13504,1,0,0, 'Skadi - SAY_KILL_1'), - (26693,-1575006,'I'll mount your skull from the highest tower!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13505,1,0,0, 'Skadi - SAY_KILL_2'), + (26693,-1575006,'I''ll mount your skull from the highest tower!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13505,1,0,0, 'Skadi - SAY_KILL_2'), (26693,-1575007,'%s in within range of the harpoon launchers!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,3,0,0, 'Skadi - EMOTE_RANGE'), - (26693,-1575008,'ARGH! You call that... an attack? I'll... show... aghhhh...' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13506,1,0,0, 'Skadi - SAY_DEATH'), + (26693,-1575008,'ARGH! You call that... an attack? I''ll... show... aghhhh...' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13506,1,0,0, 'Skadi - SAY_DEATH'), (26693,-1575009,'%s in within range of the harpoon launchers!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,3,0,0, 'Skadi - EMOTE_RANGE'), (26693,-1575010,'You motherless knaves! Your corpses will make fine morsels for my new drake!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13507,1,0,0, 'Skadi - SAY_DRAKE_DEATH'), (26693,-1575011,'Sear them to the bone!' ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13498,1,0,0, 'Skadi - SAY_DRAKE_BREATH_1'), diff --git a/sql/full/world_script_waypoints.sql b/sql/scripts/world_script_waypoints.sql similarity index 99% rename from sql/full/world_script_waypoints.sql rename to sql/scripts/world_script_waypoints.sql index 1c2dfe09eb4..3a5734d6d0e 100644 --- a/sql/full/world_script_waypoints.sql +++ b/sql/scripts/world_script_waypoints.sql @@ -2257,3 +2257,13 @@ INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`,`location_y`, `l (12717, 27, 3621.08, 1138.11, 10.369, 0, 'SAY_MUG_RETURN'), (12717, 28, 3615.48, 1145.53, 9.614, 0, ''), (12717, 29, 3607.19, 1152.72, 8.871, 0, ''); + +-- Waypoints for Mimiron Inferno +DELETE FROM `script_waypoint` WHERE `entry`=33370; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(33370, 1, 331.674, -68.6878, 409.804, 0, '0'), +(33370, 2, 274.578, -92.1829, 409.804, 0, '0'), +(33370, 3, 226.433, -66.6652, 409.793, 0, '0'), +(33370, 4, 206.092, -34.7447, 409.801, 0, '0'), +(33370, 5, 240.208, 1.10346, 409.802, 0, '0'), +(33370, 6, 337.199, 11.7051, 409.802, 0, '0'); diff --git a/sql/full/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql similarity index 97% rename from sql/full/world_scripts_full.sql rename to sql/scripts/world_scripts_full.sql index 1aaae94d91b..44a522a1b1a 100644 --- a/sql/full/world_scripts_full.sql +++ b/sql/scripts/world_scripts_full.sql @@ -36,7 +36,9 @@ INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES (1737, 'at_scent_larkorwi'), (1738, 'at_scent_larkorwi'), (1739, 'at_scent_larkorwi'), -(1740, 'at_scent_larkorwi'); +(1740, 'at_scent_larkorwi'), +(5369, 'at_RX_214_repair_o_matic_station'), +(5423, 'at_RX_214_repair_o_matic_station'); /* WORLD BOSS */ @@ -272,8 +274,9 @@ UPDATE `creature_template` SET `ScriptName`='npc_geezle' WHERE `entry`=17318; UPDATE `creature_template` SET `ScriptName`='npc_nestlewood_owlkin' WHERE `entry`=16518; UPDATE `creature_template` SET `ScriptName`='npc_draenei_survivor' WHERE `entry`=16483; UPDATE `creature_template` SET `ScriptName`='npc_death_ravager' WHERE `entry`=17556; +UPDATE `creature_template` SET `ScriptName`='npc_stillpine_capitive' where `entry`=17375; UPDATE `gameobject_template` SET `ScriptName`='go_ravager_cage' WHERE `entry`=181849; -UPDATE `gameobject_template` SET `ScriptName`='go_stillpine_cage' WHERE `entry`=181714; +UPDATE `gameobject_template` SET `ScriptName`='go_bristlelimb_cage' WHERE `entry`=181714; /* BADLANDS */ @@ -445,6 +448,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_magmoth_crusher' WHERE `entry`= UPDATE `creature_template` SET `ScriptName`='npc_valiance_keep_cannoneer' WHERE `entry`=25306; UPDATE `creature_template` SET `ScriptName`='npc_warmage_coldarra' WHERE `entry` IN (27173,27904,27906); UPDATE `creature_template` SET `ScriptName`='npc_valiance_keep_cannoneer' WHERE `entry`=25306; +UPDATE `creature_template` SET `ScriptName`= 'npc_seaforium_depth_charge' WHERE `entry`=25401; + /* BURNING STEPPES */ UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563; @@ -583,6 +588,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_inquisitor_hallard' WHERE `entr /* DESOLACE */ UPDATE `creature_template` SET `ScriptName`='npc_aged_dying_ancient_kodo' WHERE `entry` IN (4700,4701,4702,11627); UPDATE `gameobject_template` SET `ScriptName`='go_iruxos' WHERE `entry`=176581; +UPDATE `creature_template` SET `ScriptName`='npc_dalinda' WHERE `entry`=5644; /* DIRE MAUL */ @@ -1427,6 +1433,19 @@ UPDATE `creature_template` SET `ScriptName`='boss_kologarn' WHERE `entry`=32930; UPDATE `creature_template` SET `ScriptName`='boss_algalon' WHERE `entry`=32871; UPDATE `creature_template` SET `ScriptName`='mob_collapsing_star' WHERE `entry`=32955; UPDATE `gameobject_template` SET `ScriptName`='ulduar_teleporter' WHERE `entry`=194569; +UPDATE `creature_template` SET `ScriptName`= 'npc_thorims_hammer' WHERE `entry`=33365; +UPDATE `creature_template` SET `ScriptName`= 'npc_mimirons_inferno' WHERE `entry`=33370; +UPDATE `creature_template` SET `ScriptName`= 'npc_hodirs_fury' WHERE `entry`=33312; +UPDATE `creature_template` SET `ScriptName`= 'npc_freyas_ward' WHERE `entry`=33367; +UPDATE `creature_template` SET `ScriptName`= 'npc_lorekeeper' WHERE `entry`=33686; +UPDATE `creature_template` SET `ScriptName`= 'npc_brann_bronzebeard' WHERE `entry`=33579; +UPDATE `creature_template` SET `ScriptName`= 'npc_freya_ward_summon' WHERE `entry`=34275; +UPDATE `creature_template` SET `ScriptName`= 'npc_mechanolift' WHERE `entry`=33214; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194375; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194371; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194370; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194377; + /* UN'GORO CRATER */ UPDATE `creature_template` SET `ScriptName`='npc_ame' WHERE `entry`=9623; @@ -1491,6 +1510,19 @@ UPDATE `creature_template` SET `ScriptName`='boss_moragg' WHERE `entry`=29316; UPDATE `creature_template` SET `ScriptName`='boss_xevozz' WHERE `entry`=29266; UPDATE `creature_template` SET `ScriptName`='mob_ethereal_sphere' WHERE `entry`=29271; UPDATE `creature_template` SET `ScriptName`='boss_cyanigosa' WHERE `entry`=31134; +update `creature_template` SET `scriptname`='mob_azure_invader' WHERE `entry`=30661; +update `creature_template` SET `scriptname`='mob_azure_spellbreaker' WHERE `entry`=30662; +update `creature_template` SET `scriptname`='mob_azure_binder' WHERE `entry`=30663; +update `creature_template` SET `scriptname`='mob_azure_mage_slayer' WHERE `entry`=30664; +update `creature_template` SET `scriptname`='mob_azure_captain' WHERE `entry`=30666; +update `creature_template` SET `scriptname`='mob_azure_sorceror' WHERE `entry`=30667; +update `creature_template` SET `scriptname`='mob_azure_raider' WHERE `entry`=30668; +update `creature_template` SET `scriptname`='mob_azure_stalker' WHERE `entry`=32191; +update `creature_template` SET `scriptname`='mob_azure_invader' WHERE `entry`=30961; +update `creature_template` SET `scriptname`='mob_azure_spellbreaker' WHERE `entry`=30962; +update `creature_template` SET `scriptname`='mob_azure_binder' WHERE `entry`=30918; +update `creature_template` SET `scriptname`='mob_azure_mage_slayer' WHERE `entry`=30963; +UPDATE `creature_template` SET `scriptname`='mob_azure_saboteur' WHERE `entry`=31079; UPDATE `instance_template` SET `script`='instance_violet_hold' WHERE `map`=608; /* WAILING CAVERNS */ diff --git a/sql/tools/CMakeLists.txt b/sql/tools/CMakeLists.txt index 7f562ce1dfb..a56ba351ded 100644 --- a/sql/tools/CMakeLists.txt +++ b/sql/tools/CMakeLists.txt @@ -1,5 +1,7 @@ add_subdirectory(updates) -add_subdirectory(FULL) +add_subdirectory(scripts) +add_subdirectory(base) +add_subdirectory(create) ########### install files ############### diff --git a/sql/updates/2.4.3_old/CMakeLists.txt b/sql/updates/2.4.3_old/CMakeLists.txt index 229a6de626c..585813a934b 100644 --- a/sql/updates/2.4.3_old/CMakeLists.txt +++ b/sql/updates/2.4.3_old/CMakeLists.txt @@ -1,5 +1,3 @@ FILE(GLOB _SQL_243 *.sql) -INSTALL(FILES -${_SQL_243} -DESTINATION share/trinity/sql/updates/2.4.3_updates) \ No newline at end of file +INSTALL(FILES ${_SQL_243} DESTINATION share/trinity/sql/updates/2.4.3_old) \ No newline at end of file diff --git a/sql/updates/3.0.9_old/CMakeLists.txt b/sql/updates/3.0.9_old/CMakeLists.txt index 7d2b2d975d3..d09917d76f9 100644 --- a/sql/updates/3.0.9_old/CMakeLists.txt +++ b/sql/updates/3.0.9_old/CMakeLists.txt @@ -1,5 +1,3 @@ FILE(GLOB _SQL_309 *.sql) -INSTALL(FILES -${_SQL_309} -DESTINATION share/trinity/sql/updates/3.0.9_old) \ No newline at end of file +INSTALL(FILES ${_SQL_309} DESTINATION share/trinity/sql/updates/3.0.9_old) \ No newline at end of file diff --git a/sql/updates/3.1.3_old/CMakeLists.txt b/sql/updates/3.1.3_old/CMakeLists.txt index 1c99a2be619..5a99663dff5 100644 --- a/sql/updates/3.1.3_old/CMakeLists.txt +++ b/sql/updates/3.1.3_old/CMakeLists.txt @@ -1,5 +1,3 @@ FILE(GLOB _SQL_313 *.sql) -INSTALL(FILES -${_SQL_313} -DESTINATION share/trinity/sql/updates/3.1.3_old) \ No newline at end of file +INSTALL(FILES ${_SQL_313} DESTINATION share/trinity/sql/updates/3.1.3_old) \ No newline at end of file diff --git a/sql/updates/3.2.2a_old/CMakeLists.txt b/sql/updates/3.2.2a_old/CMakeLists.txt index e6193267b8a..391d4895850 100644 --- a/sql/updates/3.2.2a_old/CMakeLists.txt +++ b/sql/updates/3.2.2a_old/CMakeLists.txt @@ -1,5 +1,3 @@ FILE(GLOB _SQL_322 *.sql) -INSTALL(FILES -${_SQL_322} -DESTINATION share/trinity/sql/updates/3.2.2a_old) \ No newline at end of file +INSTALL(FILES ${_SQL_322} DESTINATION share/trinity/sql/updates/3.2.2a_old) \ No newline at end of file diff --git a/sql/updates/3.3.2_old/CMakeLists.txt b/sql/updates/3.3.2_old/CMakeLists.txt index 87734d93da3..75f051dcede 100644 --- a/sql/updates/3.3.2_old/CMakeLists.txt +++ b/sql/updates/3.3.2_old/CMakeLists.txt @@ -1,5 +1,3 @@ FILE(GLOB _SQL_332 *.sql) -INSTALL(FILES -${_SQL_332} -DESTINATION share/trinity/sql/updates/3.3.2_old) \ No newline at end of file +INSTALL(FILES ${_SQL_332} DESTINATION share/trinity/sql/updates/3.3.2_old) \ No newline at end of file diff --git a/sql/updates/8312_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8312_world_spell_proc_event.sql similarity index 100% rename from sql/updates/8312_world_spell_proc_event.sql rename to sql/updates/3.3.3a_old/8312_world_spell_proc_event.sql diff --git a/sql/updates/8313_world_spell_bonus_data.sql b/sql/updates/3.3.3a_old/8313_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/8313_world_spell_bonus_data.sql rename to sql/updates/3.3.3a_old/8313_world_spell_bonus_data.sql diff --git a/sql/updates/8315_world_spell_bonus_data.sql b/sql/updates/3.3.3a_old/8315_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/8315_world_spell_bonus_data.sql rename to sql/updates/3.3.3a_old/8315_world_spell_bonus_data.sql diff --git a/sql/updates/8316_world_spell_bonus_data.sql b/sql/updates/3.3.3a_old/8316_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/8316_world_spell_bonus_data.sql rename to sql/updates/3.3.3a_old/8316_world_spell_bonus_data.sql diff --git a/sql/updates/8318_world_spell_bonus_data.sql b/sql/updates/3.3.3a_old/8318_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/8318_world_spell_bonus_data.sql rename to sql/updates/3.3.3a_old/8318_world_spell_bonus_data.sql diff --git a/sql/updates/8319_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8319_world_spell_linked_spell.sql similarity index 100% rename from sql/updates/8319_world_spell_linked_spell.sql rename to sql/updates/3.3.3a_old/8319_world_spell_linked_spell.sql diff --git a/sql/updates/8327_world_scriptname.sql b/sql/updates/3.3.3a_old/8327_world_scriptname.sql similarity index 100% rename from sql/updates/8327_world_scriptname.sql rename to sql/updates/3.3.3a_old/8327_world_scriptname.sql diff --git a/sql/updates/8330_world_playercreateinfo_spell.sql b/sql/updates/3.3.3a_old/8330_world_playercreateinfo_spell.sql similarity index 100% rename from sql/updates/8330_world_playercreateinfo_spell.sql rename to sql/updates/3.3.3a_old/8330_world_playercreateinfo_spell.sql diff --git a/sql/updates/8334_world_scriptname.sql b/sql/updates/3.3.3a_old/8334_world_scriptname.sql similarity index 100% rename from sql/updates/8334_world_scriptname.sql rename to sql/updates/3.3.3a_old/8334_world_scriptname.sql diff --git a/sql/updates/8348_world_script_texts.sql b/sql/updates/3.3.3a_old/8348_world_script_texts.sql similarity index 100% rename from sql/updates/8348_world_script_texts.sql rename to sql/updates/3.3.3a_old/8348_world_script_texts.sql diff --git a/sql/updates/8348_world_scriptname.sql b/sql/updates/3.3.3a_old/8348_world_scriptname.sql similarity index 100% rename from sql/updates/8348_world_scriptname.sql rename to sql/updates/3.3.3a_old/8348_world_scriptname.sql diff --git a/sql/updates/8352_world_scriptname.sql b/sql/updates/3.3.3a_old/8352_world_scriptname.sql similarity index 100% rename from sql/updates/8352_world_scriptname.sql rename to sql/updates/3.3.3a_old/8352_world_scriptname.sql diff --git a/sql/updates/8352_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8352_world_spell_linked_spell.sql similarity index 99% rename from sql/updates/8352_world_spell_linked_spell.sql rename to sql/updates/3.3.3a_old/8352_world_spell_linked_spell.sql index 00462fce1ac..9feca78a3ff 100644 --- a/sql/updates/8352_world_spell_linked_spell.sql +++ b/sql/updates/3.3.3a_old/8352_world_spell_linked_spell.sql @@ -1,5 +1,4 @@ DELETE FROM `spell_linked_spell` WHERE `spell_effect` IN (52418, -52418); - INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (52415, 52418, 0, 'Carrying Seaforium - Add'), (52410, -52418, 0, 'Carrying Seaforium - Remove'); diff --git a/sql/updates/8358_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8358_world_spell_linked_spell.sql similarity index 100% rename from sql/updates/8358_world_spell_linked_spell.sql rename to sql/updates/3.3.3a_old/8358_world_spell_linked_spell.sql diff --git a/sql/updates/8361_world_trinity_string.sql b/sql/updates/3.3.3a_old/8361_world_trinity_string.sql similarity index 100% rename from sql/updates/8361_world_trinity_string.sql rename to sql/updates/3.3.3a_old/8361_world_trinity_string.sql diff --git a/sql/updates/8371_world_spell_bonus_data.sql b/sql/updates/3.3.3a_old/8371_world_spell_bonus_data.sql similarity index 100% rename from sql/updates/8371_world_spell_bonus_data.sql rename to sql/updates/3.3.3a_old/8371_world_spell_bonus_data.sql diff --git a/sql/updates/8372_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8372_world_spell_proc_event.sql similarity index 100% rename from sql/updates/8372_world_spell_proc_event.sql rename to sql/updates/3.3.3a_old/8372_world_spell_proc_event.sql diff --git a/sql/updates/8373_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8373_world_spell_proc_event.sql similarity index 100% rename from sql/updates/8373_world_spell_proc_event.sql rename to sql/updates/3.3.3a_old/8373_world_spell_proc_event.sql diff --git a/sql/updates/8374_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8374_world_spell_proc_event.sql similarity index 100% rename from sql/updates/8374_world_spell_proc_event.sql rename to sql/updates/3.3.3a_old/8374_world_spell_proc_event.sql diff --git a/sql/updates/8375_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8375_world_spell_proc_event.sql similarity index 100% rename from sql/updates/8375_world_spell_proc_event.sql rename to sql/updates/3.3.3a_old/8375_world_spell_proc_event.sql diff --git a/sql/updates/8391_world_conditions.sql b/sql/updates/3.3.3a_old/8391_world_conditions.sql similarity index 99% rename from sql/updates/8391_world_conditions.sql rename to sql/updates/3.3.3a_old/8391_world_conditions.sql index 2eb3d79fac9..fb5cc9fbc9e 100644 --- a/sql/updates/8391_world_conditions.sql +++ b/sql/updates/3.3.3a_old/8391_world_conditions.sql @@ -1,6 +1,7 @@ -- ---------------------------- -- Table structure for conditions -- ---------------------------- +DROP TABLE IF EXISTS `conditions`; CREATE TABLE `conditions` ( `SourceTypeOrReferenceId` mediumint(8) NOT NULL DEFAULT '0', `SourceGroup` mediumint(8) unsigned NOT NULL DEFAULT '0', diff --git a/sql/updates/8397_world_command.sql b/sql/updates/3.3.3a_old/8397_world_command.sql similarity index 100% rename from sql/updates/8397_world_command.sql rename to sql/updates/3.3.3a_old/8397_world_command.sql diff --git a/sql/updates/3.3.3a_old/8510_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8510_world_spell_proc_event.sql new file mode 100644 index 00000000000..c9d0a9cbc69 --- /dev/null +++ b/sql/updates/3.3.3a_old/8510_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE spell_proc_event SET SpellFamilyMask0 = SpellFamilyMask0 | 0x40000000, procEx = ProcEx | 0x0000001 WHERE entry IN(53569,53576); diff --git a/sql/updates/3.3.3a_old/8511_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8511_world_spell_proc_event.sql new file mode 100644 index 00000000000..91cc7841f97 --- /dev/null +++ b/sql/updates/3.3.3a_old/8511_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE spell_proc_event SET procEx = 0x0 WHERE entry IN(53569,53576); diff --git a/sql/updates/3.3.3a_old/8512_world_command.sql b/sql/updates/3.3.3a_old/8512_world_command.sql new file mode 100644 index 00000000000..6293503d492 --- /dev/null +++ b/sql/updates/3.3.3a_old/8512_world_command.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE `name`='reload creature_onkill_reputation'; +INSERT INTO `command` VALUES +('reload creature_onkill_reputation','3','Syntax: .reload creature_onkill_reputation\r\nReload creature_onkill_reputation table.'); diff --git a/sql/updates/3.3.3a_old/8565_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8565_world_spell_proc_event.sql new file mode 100644 index 00000000000..b4a378e458c --- /dev/null +++ b/sql/updates/3.3.3a_old/8565_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=70761; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +( 70761, 0x00, 10, 0x00000000, 0x80004000, 0x00000001, 0x00000400, 0x00000000, 0, 0, 0); -- Item - Paladin T10 Protection 4P Bonus diff --git a/sql/updates/3.3.3a_old/8568_world_npc_vendor.sql b/sql/updates/3.3.3a_old/8568_world_npc_vendor.sql new file mode 100644 index 00000000000..63645847ef6 --- /dev/null +++ b/sql/updates/3.3.3a_old/8568_world_npc_vendor.sql @@ -0,0 +1 @@ +ALTER TABLE npc_vendor CHANGE COLUMN `ExtendedCost` `ExtendedCost` mediumint(8) NOT NULL default '0' COMMENT 'negative if cost must exclude normal money cost'; diff --git a/sql/updates/3.3.3a_old/8568_world_trinity_string.sql b/sql/updates/3.3.3a_old/8568_world_trinity_string.sql new file mode 100644 index 00000000000..c4fdc2f8480 --- /dev/null +++ b/sql/updates/3.3.3a_old/8568_world_trinity_string.sql @@ -0,0 +1,3 @@ +DELETE FROM trinity_string WHERE entry IN (210); +INSERT INTO trinity_string VALUES +(210,'Item \'%i\' (with extended cost %i) already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/sql/updates/3.3.3a_old/8575_world_command.sql b/sql/updates/3.3.3a_old/8575_world_command.sql new file mode 100644 index 00000000000..8175ad3d453 --- /dev/null +++ b/sql/updates/3.3.3a_old/8575_world_command.sql @@ -0,0 +1,2 @@ +DELETE FROM command WHERE name = 'reload conditions'; +INSERT INTO command (name, security, help) VALUES ('reload conditions', 3, 'Reload conditions table.'); diff --git a/sql/updates/3.3.3a_old/8576_world_command.sql b/sql/updates/3.3.3a_old/8576_world_command.sql new file mode 100644 index 00000000000..4512dfe8a28 --- /dev/null +++ b/sql/updates/3.3.3a_old/8576_world_command.sql @@ -0,0 +1 @@ +DELETE FROM command WHERE name = 'reload spell_script_target'; diff --git a/sql/updates/3.3.3a_old/8586_world_command.sql b/sql/updates/3.3.3a_old/8586_world_command.sql new file mode 100644 index 00000000000..b554755df08 --- /dev/null +++ b/sql/updates/3.3.3a_old/8586_world_command.sql @@ -0,0 +1,4 @@ +DELETE FROM `command` WHERE `name` IN ('reload item_set_names','reload locales_item_set_name'); +INSERT INTO `command` VALUES +('reload item_set_names',3,'Syntax: .reload item_set_names\nReload item_set_names table.'), +('reload locales_item_set_name',3,'Syntax: .reload locales_item_set_name\nReload locales_item_set_name table.'); diff --git a/sql/updates/3.3.3a_old/8586_world_item_set_names.sql b/sql/updates/3.3.3a_old/8586_world_item_set_names.sql new file mode 100644 index 00000000000..f62df79678a --- /dev/null +++ b/sql/updates/3.3.3a_old/8586_world_item_set_names.sql @@ -0,0 +1,14 @@ +-- +-- Table structure for table `item_set_names` +-- + +DROP TABLE IF EXISTS `item_set_names`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_set_names` ( + `entry` mediumint(8) unsigned NOT NULL, + `name` varchar(255) character set utf8 NOT NULL default '', + `InventoryType` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/updates/3.3.3a_old/8586_world_locales_item_set_name.sql b/sql/updates/3.3.3a_old/8586_world_locales_item_set_name.sql new file mode 100644 index 00000000000..30d39f978a2 --- /dev/null +++ b/sql/updates/3.3.3a_old/8586_world_locales_item_set_name.sql @@ -0,0 +1,20 @@ +-- +-- Table structure for table `locales_item_set_name` +-- + +DROP TABLE IF EXISTS `locales_item_set_name`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `locales_item_set_name` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name_loc1` varchar(100) NOT NULL DEFAULT '', + `name_loc2` varchar(100) NOT NULL DEFAULT '', + `name_loc3` varchar(100) NOT NULL DEFAULT '', + `name_loc4` varchar(100) NOT NULL DEFAULT '', + `name_loc5` varchar(100) NOT NULL DEFAULT '', + `name_loc6` varchar(100) NOT NULL DEFAULT '', + `name_loc7` varchar(100) NOT NULL DEFAULT '', + `name_loc8` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/updates/3.3.3a_old/8589_world_item_set_names.sql b/sql/updates/3.3.3a_old/8589_world_item_set_names.sql new file mode 100644 index 00000000000..2edcc160c65 --- /dev/null +++ b/sql/updates/3.3.3a_old/8589_world_item_set_names.sql @@ -0,0 +1 @@ +ALTER TABLE `item_set_names` ADD COLUMN `WDBVerified` smallint(5) signed NOT NULL DEFAULT '1'; diff --git a/sql/updates/3.3.3a_old/8602_world_spell_proc_event.sql b/sql/updates/3.3.3a_old/8602_world_spell_proc_event.sql new file mode 100644 index 00000000000..ce7873f3a83 --- /dev/null +++ b/sql/updates/3.3.3a_old/8602_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `Cooldown`=30 WHERE `entry` IN (30886, 30885, 30884, 30883, 30881); diff --git a/sql/updates/3.3.3a_old/8605_world_playercreateinfo_item.sql b/sql/updates/3.3.3a_old/8605_world_playercreateinfo_item.sql new file mode 100644 index 00000000000..c5d423c1744 --- /dev/null +++ b/sql/updates/3.3.3a_old/8605_world_playercreateinfo_item.sql @@ -0,0 +1 @@ +ALTER TABLE `playercreateinfo_item` CHANGE `amount` `amount` tinyint(3) NOT NULL DEFAULT '1'; diff --git a/sql/updates/3.3.3a_old/8607_world_pool_creature.sql b/sql/updates/3.3.3a_old/8607_world_pool_creature.sql new file mode 100644 index 00000000000..400e54cc6b5 --- /dev/null +++ b/sql/updates/3.3.3a_old/8607_world_pool_creature.sql @@ -0,0 +1,2 @@ +UPDATE `pool_creature` SET `description` = `comment` WHERE `comment` <> '' AND `comment` IS NOT NULL AND (`description` = '' OR `description` IS NULL); +ALTER TABLE `pool_creature` DROP COLUMN `comment`; diff --git a/sql/updates/3.3.3a_old/8607_world_pool_template.sql b/sql/updates/3.3.3a_old/8607_world_pool_template.sql new file mode 100644 index 00000000000..ac1cbf70223 --- /dev/null +++ b/sql/updates/3.3.3a_old/8607_world_pool_template.sql @@ -0,0 +1,2 @@ +UPDATE `pool_template` SET `description` = `comment` WHERE `comment` <> '' AND `comment` IS NOT NULL AND (`description` = '' OR `description` IS NULL); +ALTER TABLE `pool_template` DROP COLUMN `comment`; diff --git a/sql/updates/3.3.3a_old/8625_world_pool_creature.sql b/sql/updates/3.3.3a_old/8625_world_pool_creature.sql new file mode 100644 index 00000000000..ade35efe138 --- /dev/null +++ b/sql/updates/3.3.3a_old/8625_world_pool_creature.sql @@ -0,0 +1 @@ +ALTER TABLE `pool_creature` DROP PRIMARY KEY, ADD PRIMARY KEY (`guid`); diff --git a/sql/updates/3.3.3a_old/8625_world_pool_gameobject.sql b/sql/updates/3.3.3a_old/8625_world_pool_gameobject.sql new file mode 100644 index 00000000000..720fbb76a0c --- /dev/null +++ b/sql/updates/3.3.3a_old/8625_world_pool_gameobject.sql @@ -0,0 +1 @@ +ALTER TABLE `pool_gameobject` DROP PRIMARY KEY, ADD PRIMARY KEY (`guid`); diff --git a/sql/updates/3.3.3a_old/8625_world_pool_pool.sql b/sql/updates/3.3.3a_old/8625_world_pool_pool.sql new file mode 100644 index 00000000000..1c8b9f3db8e --- /dev/null +++ b/sql/updates/3.3.3a_old/8625_world_pool_pool.sql @@ -0,0 +1 @@ +ALTER TABLE `pool_pool` DROP PRIMARY KEY, ADD PRIMARY KEY (`pool_id`); diff --git a/sql/updates/3.3.3a_old/8638_world_scriptname.sql b/sql/updates/3.3.3a_old/8638_world_scriptname.sql new file mode 100644 index 00000000000..d3f357f43bf --- /dev/null +++ b/sql/updates/3.3.3a_old/8638_world_scriptname.sql @@ -0,0 +1,12 @@ +update `creature_template` SET `scriptname`='mob_azure_invader' WHERE `entry`=30661; -- Azure Invader 1 +update `creature_template` SET `scriptname`='mob_azure_spellbreaker' WHERE `entry`=30662; -- Azure Spellbreaker +update `creature_template` SET `scriptname`='mob_azure_binder' WHERE `entry`=30663; -- Azure Binder 1 +update `creature_template` SET `scriptname`='mob_azure_mage_slayer' WHERE `entry`=30664; -- Azure Mage Slayer 1 +update `creature_template` SET `scriptname`='mob_azure_captain' WHERE `entry`=30666; -- Azure Captain +update `creature_template` SET `scriptname`='mob_azure_sorceror' WHERE `entry`=30667; -- Azure Sorceror +update `creature_template` SET `scriptname`='mob_azure_raider' WHERE `entry`=30668; -- Azure Raider +update `creature_template` SET `scriptname`='mob_azure_stalker' WHERE `entry`=32191; -- Azure Stalker +update `creature_template` SET `scriptname`='mob_azure_invader' WHERE `entry`=30961; -- Azure Invader 2 +update `creature_template` SET `scriptname`='mob_azure_spellbreaker' WHERE `entry`=30962; -- Azure Spellbreaker +update `creature_template` SET `scriptname`='mob_azure_binder' WHERE `entry`=30918; -- Azure Binder 2 +update `creature_template` SET `scriptname`='mob_azure_mage_slayer' WHERE `entry`=30963; -- Azure Mage Sl diff --git a/sql/updates/3.3.3a_old/8658_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8658_world_spell_linked_spell.sql new file mode 100644 index 00000000000..59e96ca2ac5 --- /dev/null +++ b/sql/updates/3.3.3a_old/8658_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=20066; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(20066, -61840, 0, 'Repentance'); diff --git a/sql/updates/3.3.3a_old/8671_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8671_world_spell_linked_spell.sql new file mode 100644 index 00000000000..d2572727e59 --- /dev/null +++ b/sql/updates/3.3.3a_old/8671_world_spell_linked_spell.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (54861,55004)AND `spell_effect` IN (-23335,-23333); +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(54861,-23335,0, 'Drop Flag on Nitro Boost WSG'), +(54861,-23333,0, 'Drop Flag on Nitro Boost WSG'), +(55004,-23335,0, 'Drop Flag on Nitro Boost WSG'), +(55004,-23333,0, 'Drop Flag on Nitro Boost WSG'); diff --git a/sql/updates/3.3.3a_old/8672_world_gossip_menu_option.sql b/sql/updates/3.3.3a_old/8672_world_gossip_menu_option.sql new file mode 100644 index 00000000000..2ba86951100 --- /dev/null +++ b/sql/updates/3.3.3a_old/8672_world_gossip_menu_option.sql @@ -0,0 +1,2 @@ +-- Drop forgotten fields after condition implementation +ALTER TABLE gossip_menu_option DROP COLUMN cond_3,DROP COLUMN cond_3_val_1,DROP COLUMN cond_3_val_2; diff --git a/sql/updates/3.3.3a_old/8674_world_spell_dbc.sql b/sql/updates/3.3.3a_old/8674_world_spell_dbc.sql new file mode 100644 index 00000000000..e1e9e8d2fe2 --- /dev/null +++ b/sql/updates/3.3.3a_old/8674_world_spell_dbc.sql @@ -0,0 +1,4 @@ +-- Add serverside spells place holders for future development +DELETE FROM `spell_dbc` WHERE `Id`=39616; +INSERT INTO `spell_dbc` (`Id`,`Comment`) VALUES +(39616, 'Quest 10966 reward serverside spell'); diff --git a/sql/updates/3.3.3a_old/8674_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8674_world_spell_linked_spell.sql new file mode 100644 index 00000000000..1333c728a8a --- /dev/null +++ b/sql/updates/3.3.3a_old/8674_world_spell_linked_spell.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (54861,55004)AND `spell_effect` IN (-34976); +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +( 54861,-34976, 0, 'Drop Flag on Nitro Boost EOS'), +( 55004,-34976, 0, 'Drop Flag on Nitro Boost EOS'); diff --git a/sql/updates/3.3.3a_old/8694_world_transport_events.sql b/sql/updates/3.3.3a_old/8694_world_transport_events.sql new file mode 100644 index 00000000000..0e8786f777f --- /dev/null +++ b/sql/updates/3.3.3a_old/8694_world_transport_events.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `transport_events`; diff --git a/sql/updates/3.3.3a_old/8752_world_scriptname.sql b/sql/updates/3.3.3a_old/8752_world_scriptname.sql new file mode 100644 index 00000000000..03bc1bb354c --- /dev/null +++ b/sql/updates/3.3.3a_old/8752_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `scriptname`='mob_azure_saboteur' WHERE `entry`=31079; -- Azure Saboteur diff --git a/sql/updates/3.3.3a_old/8770_world_areatrigger_scripts.sql b/sql/updates/3.3.3a_old/8770_world_areatrigger_scripts.sql new file mode 100644 index 00000000000..044725b3a5f --- /dev/null +++ b/sql/updates/3.3.3a_old/8770_world_areatrigger_scripts.sql @@ -0,0 +1,4 @@ +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (5369,5423); +INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES +(5369, 'at_RX_214_repair_o_matic_station'), +(5423, 'at_RX_214_repair_o_matic_station'); diff --git a/sql/updates/3.3.3a_old/8770_world_script_waypoints.sql b/sql/updates/3.3.3a_old/8770_world_script_waypoints.sql new file mode 100644 index 00000000000..c2418f6da33 --- /dev/null +++ b/sql/updates/3.3.3a_old/8770_world_script_waypoints.sql @@ -0,0 +1,9 @@ +-- Waypoints for Mimron Inferno +DELETE FROM `script_waypoint` WHERE `entry`=33370; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(33370, 1, 331.674, -68.6878, 409.804, 0, '0'), +(33370, 2, 274.578, -92.1829, 409.804, 0, '0'), +(33370, 3, 226.433, -66.6652, 409.793, 0, '0'), +(33370, 4, 206.092, -34.7447, 409.801, 0, '0'), +(33370, 5, 240.208, 1.10346, 409.802, 0, '0'), +(33370, 6, 337.199, 11.7051, 409.802, 0, '0'); diff --git a/sql/updates/3.3.3a_old/8770_world_scriptname.sql b/sql/updates/3.3.3a_old/8770_world_scriptname.sql new file mode 100644 index 00000000000..e173f7e41f2 --- /dev/null +++ b/sql/updates/3.3.3a_old/8770_world_scriptname.sql @@ -0,0 +1,12 @@ +UPDATE `creature_template` SET `ScriptName`= 'npc_thorims_hammer' WHERE `entry`=33365; +UPDATE `creature_template` SET `ScriptName`= 'npc_mimirons_inferno' WHERE `entry`=33370; +UPDATE `creature_template` SET `ScriptName`= 'npc_hodirs_fury' WHERE `entry`=33312; +UPDATE `creature_template` SET `ScriptName`= 'npc_freyas_ward' WHERE `entry`=33367; +UPDATE `creature_template` SET `ScriptName`= 'npc_lorekeeper' WHERE `entry`=33686; +UPDATE `creature_template` SET `ScriptName`= 'npc_brann_bronzebeard' WHERE `entry`=33579; +UPDATE `creature_template` SET `ScriptName`= 'npc_freya_ward_summon' WHERE `entry`=34275; +UPDATE `creature_template` SET `ScriptName`= 'npc_mechanolift' WHERE `entry`=33214; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194375; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194371; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194370; +UPDATE `gameobject_template` SET `ScriptName`= 'go_ulduar_tower' WHERE `entry`=194377; diff --git a/sql/updates/3.3.3a_old/8790_world_locales_item_set_names.sql b/sql/updates/3.3.3a_old/8790_world_locales_item_set_names.sql new file mode 100644 index 00000000000..4f6015ac749 --- /dev/null +++ b/sql/updates/3.3.3a_old/8790_world_locales_item_set_names.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS `locales_item_set_names`; +RENAME TABLE `locales_item_set_name` TO `locales_item_set_names`; diff --git a/sql/updates/3.3.3a_old/8816_world_spell_bonus_data.sql b/sql/updates/3.3.3a_old/8816_world_spell_bonus_data.sql new file mode 100644 index 00000000000..67d01d19b77 --- /dev/null +++ b/sql/updates/3.3.3a_old/8816_world_spell_bonus_data.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_bonus_data` WHERE `entry` IN (45284,45297); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(45284,0.357,-1,-1,-1,'Shaman - LO Lightning Bolt'), +(45297,0.285,-1,-1,-1,'Shaman - LO Chain Lightning'); diff --git a/sql/updates/3.3.3a_old/8821_world_spell_dbc.sql b/sql/updates/3.3.3a_old/8821_world_spell_dbc.sql new file mode 100644 index 00000000000..903a932edaf --- /dev/null +++ b/sql/updates/3.3.3a_old/8821_world_spell_dbc.sql @@ -0,0 +1,8 @@ +-- Add serverside spells place holders for future development +DELETE FROM `spell_dbc` WHERE `Id` IN (11202,25359,40145,45767,71098); +INSERT INTO `spell_dbc` (`Id`,`Comment`) VALUES +(11202, 'Item 3776 spellid_1 serverside spell'), +(25359, 'Item 21293 spellid_2 serverside spell'), +(40145, 'Quest 11000 RewSpellCast serverside spell'), +(45767, 'Quest 11670 RewSpellCast serverside spell'), +(71098, 'Quest 24451 RewSpellCast serverside spell'); diff --git a/sql/updates/3.3.3a_old/8836_world_spell_linked_spell.sql b/sql/updates/3.3.3a_old/8836_world_spell_linked_spell.sql new file mode 100644 index 00000000000..64c3c66c9e1 --- /dev/null +++ b/sql/updates/3.3.3a_old/8836_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +-- Make the Ardent Defender heal (66235) trigger the visuals (66233) +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=66235; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES (66235,66233,0, 'Ardent Defender Visuals'); diff --git a/sql/updates/3.3.3a_old/8842_world_script_texts.sql b/sql/updates/3.3.3a_old/8842_world_script_texts.sql new file mode 100644 index 00000000000..617b61a694f --- /dev/null +++ b/sql/updates/3.3.3a_old/8842_world_script_texts.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts where entry IN (-1000474, -1000475, -1000476); +INSERT INTO script_texts (`npc_entry`, `entry`, `content_default`, `type`, `language`, `comment`) VALUE +(17375, -1000474, '[Fulborg] The Stillpine furbolgs will not soon forget your bravery!', 0, 0, 'Stillpine Capitive free say text 1'), +(17375, -1000475, '[Fulborg] Thank you, $N', 0, 0, 'Stillpine Capitive free say text 2'), +(17375, -1000476, '[Fulborg] Those remaining at Stillpine Hold will welcome you as a hero!', 0, 0, 'Stillpine Capitive free say text 3'); diff --git a/sql/updates/3.3.3a_old/8842_world_scriptname.sql b/sql/updates/3.3.3a_old/8842_world_scriptname.sql new file mode 100644 index 00000000000..5ef8e4b6aa9 --- /dev/null +++ b/sql/updates/3.3.3a_old/8842_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_stillpine_capitive' where `entry`=17375; +UPDATE `gameobject_template` SET `ScriptName`='go_stillpine_cage' WHERE `entry`=181714; diff --git a/sql/updates/3.3.3a_old/8843_world_scriptname.sql b/sql/updates/3.3.3a_old/8843_world_scriptname.sql new file mode 100644 index 00000000000..4517544d99d --- /dev/null +++ b/sql/updates/3.3.3a_old/8843_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_bristlelimb_cage' WHERE `entry`=181714; + diff --git a/sql/updates/3.3.3a_old/CMakeLists.txt b/sql/updates/3.3.3a_old/CMakeLists.txt index 94143fe1e5b..8557b4d4bf3 100644 --- a/sql/updates/3.3.3a_old/CMakeLists.txt +++ b/sql/updates/3.3.3a_old/CMakeLists.txt @@ -1,5 +1,3 @@ FILE(GLOB _SQL_333 *.sql) -INSTALL(FILES -${_SQL_333} -DESTINATION share/trinity/sql/updates/3.3.3a_old) \ No newline at end of file +INSTALL(FILES ${_SQL_333} DESTINATION share/trinity/sql/updates/3.3.3a_old) \ No newline at end of file diff --git a/sql/updates/3.3.5a_old/8861_auth_realmlist.sql b/sql/updates/3.3.5a_old/8861_auth_realmlist.sql new file mode 100644 index 00000000000..c6622d5ce1e --- /dev/null +++ b/sql/updates/3.3.5a_old/8861_auth_realmlist.sql @@ -0,0 +1,3 @@ +UPDATE `realmlist` SET `gamebuild`=12340 WHERE `id`=1; +ALTER TABLE `realmlist` CHANGE COLUMN `gamebuild` `gamebuild` int(11) unsigned NOT NULL default '12340'; + diff --git a/sql/updates/3.3.5a_old/CMakeLists.txt b/sql/updates/3.3.5a_old/CMakeLists.txt new file mode 100644 index 00000000000..63cb6eab23e --- /dev/null +++ b/sql/updates/3.3.5a_old/CMakeLists.txt @@ -0,0 +1,3 @@ +FILE(GLOB _SQL_335 *.sql) + +INSTALL(FILES ${_SQL_333} DESTINATION share/trinity/sql/updates/3.3.5a_old) diff --git a/sql/updates/8890_world_spell_dbc.sql b/sql/updates/8890_world_spell_dbc.sql new file mode 100644 index 00000000000..a5e0927806f --- /dev/null +++ b/sql/updates/8890_world_spell_dbc.sql @@ -0,0 +1,3 @@ +ALTER TABLE `spell_dbc` + ADD COLUMN `Stances` int(10) unsigned NOT NULL DEFAULT '0' AFTER `AttributesEx5`, + ADD COLUMN `StancesNot` int(10) unsigned NOT NULL DEFAULT '0' AFTER `Stances`; diff --git a/sql/updates/8891_world_spell_dbc.sql b/sql/updates/8891_world_spell_dbc.sql new file mode 100644 index 00000000000..6adb4e5fd28 --- /dev/null +++ b/sql/updates/8891_world_spell_dbc.sql @@ -0,0 +1,2 @@ +UPDATE `spell_dbc` SET `Stances`=0x90 WHERE `Id`=24899; +UPDATE `spell_dbc` SET `Stances`=0x1 WHERE `Id`=24900; diff --git a/sql/updates/8897_world_npc_vendor.sql b/sql/updates/8897_world_npc_vendor.sql new file mode 100644 index 00000000000..0e1c793863d --- /dev/null +++ b/sql/updates/8897_world_npc_vendor.sql @@ -0,0 +1,5 @@ +-- Restore negative ExtendedCost, we now use FlagsExtra value instead +UPDATE `npc_vendor` SET `ExtendedCost`=-`ExtendedCost` WHERE `ExtendedCost`<0; + +-- Set field type to unsigned +ALTER TABLE npc_vendor CHANGE COLUMN `ExtendedCost` `ExtendedCost` mediumint(8) UNSIGNED NOT NULL default '0' COMMENT ''; diff --git a/sql/updates/8897_world_trinity_string.sql b/sql/updates/8897_world_trinity_string.sql new file mode 100644 index 00000000000..691b0723a5b --- /dev/null +++ b/sql/updates/8897_world_trinity_string.sql @@ -0,0 +1,2 @@ +-- UPDATE so we don't kill customized locale strings if user has any +UPDATE `trinity_string` SET `content_default`='Item ''%u'' (with extended cost %u) already in vendor list.' WHERE `entry`=210; diff --git a/sql/updates/8905_world_spell_proc_event.sql b/sql/updates/8905_world_spell_proc_event.sql new file mode 100644 index 00000000000..7429a6a06b4 --- /dev/null +++ b/sql/updates/8905_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN(67758); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(67758,0,0,0,0,0,0,2,0,0,2); diff --git a/sql/updates/8906_world_spell_proc_event.sql b/sql/updates/8906_world_spell_proc_event.sql new file mode 100644 index 00000000000..2d5c35c02a5 --- /dev/null +++ b/sql/updates/8906_world_spell_proc_event.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (47201,47202,47203,47204,47205); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(47201,0,5,0x00004009,0x00040000,0x00000000,0x00000000,0x0000000,0,0,0), +(47202,0,5,0x00004009,0x00040000,0x00000000,0x00000000,0x0000000,0,0,0), +(47203,0,5,0x00004009,0x00040000,0x00000000,0x00000000,0x0000000,0,0,0), +(47204,0,5,0x00004009,0x00040000,0x00000000,0x00000000,0x0000000,0,0,0), +(47205,0,5,0x00004009,0x00040000,0x00000000,0x00000000,0x0000000,0,0,0); \ No newline at end of file diff --git a/sql/updates/8915_world_trinity_string.sql b/sql/updates/8915_world_trinity_string.sql new file mode 100644 index 00000000000..3c882c98895 --- /dev/null +++ b/sql/updates/8915_world_trinity_string.sql @@ -0,0 +1,5 @@ +-- UPDATE so we don't kill customized locale strings if user has any +UPDATE `trinity_string` SET `content_default`='The old password is wrong' WHERE `entry`=27; +-- INSERT as this string has not been used before +DELETE FROM `trinity_string` WHERE `entry`=62; +INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES (62, 'One on more parameters have incorrect values', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/sql/updates/8920_world_spell_dbc.sql b/sql/updates/8920_world_spell_dbc.sql new file mode 100644 index 00000000000..a400139824a --- /dev/null +++ b/sql/updates/8920_world_spell_dbc.sql @@ -0,0 +1,4 @@ +-- Add serverside spells place holders for future development +DELETE FROM `spell_dbc` WHERE `Id` IN (70878); +INSERT INTO `spell_dbc` (`Id`,`Comment`) VALUES +(70878, 'Creature 40160 creature_addon serverside spell'); diff --git a/sql/updates/8920_world_spell_linked_spell.sql b/sql/updates/8920_world_spell_linked_spell.sql new file mode 100644 index 00000000000..2b6a4bcf9ed --- /dev/null +++ b/sql/updates/8920_world_spell_linked_spell.sql @@ -0,0 +1,4 @@ +-- For quest: Truce? +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=50141; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(50141,50001,0, 'Blood Oath to Blood Oath Aura'); diff --git a/sql/updates/8921_world_spell_dbc.sql b/sql/updates/8921_world_spell_dbc.sql new file mode 100644 index 00000000000..7e53fc4bbf2 --- /dev/null +++ b/sql/updates/8921_world_spell_dbc.sql @@ -0,0 +1 @@ +UPDATE `spell_dbc` SET `Effect1`=6,`EffectApplyAuraName1`=4 WHERE `Id` IN (70878); diff --git a/sql/updates/8925_world_spell_group.sql b/sql/updates/8925_world_spell_group.sql new file mode 100644 index 00000000000..0e7d2cf894e --- /dev/null +++ b/sql/updates/8925_world_spell_group.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_group` WHERE `id` = 1103; +-- Cast Speed Slow +INSERT INTO `spell_group` (`id`,`spell_id`) VALUES +(1103,-1100), +(1103,-1101), +(1103,-1102); diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index 68639a4b265..fca7e740f90 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -4,9 +4,8 @@ add_subdirectory(3.1.3_old) add_subdirectory(3.2.2a_old) add_subdirectory(3.3.2_old) add_subdirectory(3.3.3a_old) +add_subdirectory(3.3.5a_old) FILE(GLOB _SQL_UPDATES *.sql) -INSTALL(FILES -${_SQL_UPDATES} -DESTINATION share/trinity/sql/updates) +INSTALL(FILES ${_SQL_UPDATES} DESTINATION share/trinity/sql/updates) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 205a3961677..b7fd8c75336 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,16 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + add_subdirectory(server) if(DO_TOOLS) - add_subdirectory(tools) + add_subdirectory(tools) endif(DO_TOOLS) diff --git a/src/client/.soon b/src/client/.soon deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/genrevision/genrevision.cpp b/src/genrevision/genrevision.cpp index 7e304b25a7e..71ca1553689 100644 --- a/src/genrevision/genrevision.cpp +++ b/src/genrevision/genrevision.cpp @@ -203,6 +203,7 @@ void extractDataFromGit(FILE* EntriesFile, std::string path, bool url, RawData& strcpy(data.rev_str,hash_str); strcpy(data.hash_str,"*"); + time_t rev_time = 0; // extracting date/time FILE* LogFile = fopen((path+".git/logs/HEAD").c_str(), "r"); @@ -449,6 +450,7 @@ int main(int argc, char **argv) res = extractDataFromArchive(path+"_hg_archival.txt",path,use_url,data); } + else if(hg_prefered) { // HG data diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index fa0cd1acce2..5d9b3b2ef9f 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -1,7 +1,30 @@ -add_subdirectory(game) -if (DO_SCRIPTS) - add_subdirectory(scripts) -endif (DO_SCRIPTS) -add_subdirectory(shared) -add_subdirectory(worldserver) -add_subdirectory(authserver) +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +if(DO_WORLDSERVER) + add_subdirectory(shared) + add_subdirectory(game) + add_subdirectory(collision) + if(DO_SCRIPTS) + add_subdirectory(scripts) + endif() + add_subdirectory(worldserver) +else() + if(DO_TOOLS) + add_subdirectory(collision) + endif() +endif() + +if (DO_AUTHSERVER) + if(NOT DO_WORLDSERVER) + add_subdirectory(shared) + endif() + add_subdirectory(authserver) +endif() diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index eb6e4abfb08..802b7b78f1b 100644 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -80,7 +80,7 @@ enum LoginResult //3.3.2 build 11403 //3.3.3a build 11723 -#define POST_BC_ACCEPTED_CLIENT_BUILD {11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} +#define POST_BC_ACCEPTED_CLIENT_BUILD {12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} #define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} #define POST_BC_EXP_FLAG 0x2 diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt index 5a993be5377..82b36c8ab3e 100644 --- a/src/server/authserver/CMakeLists.txt +++ b/src/server/authserver/CMakeLists.txt @@ -1,60 +1,88 @@ -########### next target ############### +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SET(trinity-realm_SRCS -AuthCodes.cpp -AuthCodes.h -AuthSocket.cpp -AuthSocket.h -Main.cpp -RealmList.cpp -RealmList.h -RealmSocket.h -RealmSocket.cpp -RealmAcceptor.h +########### authserver ############### + +set(authserver_SRCS + Authentication/AuthCodes.cpp + Realms/RealmList.cpp + Server/AuthSocket.cpp + Server/RealmSocket.cpp + Main.cpp ) include_directories( ${ACE_INCLUDE_DIR} + ${MYSQL_INCLUDE_DIR} + ${OPENSSL_INCLUDE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Database - ${CMAKE_SOURCE_DIR}/src/server/framework - ${MYSQL_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/src/server/shared/Packets + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities + ${CMAKE_SOURCE_DIR}/src/server/authserver + ${CMAKE_SOURCE_DIR}/src/server/authserver/Authentication + ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms + ${CMAKE_SOURCE_DIR}/src/server/authserver/Server ) -SET(trinity-realm_LINK_FLAGS "") +set(authserver_LINK_FLAGS "") -add_executable(trinity-realm ${trinity-realm_SRCS}) -add_definitions( --D_TRINITY_REALM_CONFIG='"${CONF_DIR}/trinityrealm.conf"' -) -IF (DO_MYSQL) - SET(trinity-realm_LINK_FLAGS "-pthread ${trinity-realm_LINK_FLAGS}") -ENDIF(DO_MYSQL) - -IF (CMAKE_SYSTEM_NAME MATCHES "Darwin") - SET(trinity-realm_LINK_FLAGS "-framework Carbon ${trinity-realm_LINK_FLAGS}") -ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin") - -SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "${trinity-realm_LINK_FLAGS}") - -target_link_libraries( -trinity-realm -shared -trinityframework -trinitysockets -trinitydatabase -trinityauth -trinityconfig -zlib -${SSLLIB} -${MYSQL_LIBRARIES} -${OSX_LIBS} +add_executable(authserver + ${authserver_SRCS} ) -install(TARGETS trinity-realm DESTINATION bin) +add_dependencies(authserver revision.h) +if( NOT WIN32 ) + add_definitions(-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/authserver.conf"') +endif() -########### install files ############### +if( UNIX ) + set(authserver_LINK_FLAGS "-pthread ${authserver_LINK_FLAGS}") +endif() -install(FILES trinityrealm.conf.dist DESTINATION etc) +if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(authserver_LINK_FLAGS "-framework Carbon ${authserver_LINK_FLAGS}") +endif() + +set_target_properties(authserver PROPERTIES LINK_FLAGS "${authserver_LINK_FLAGS}") + +if( WIN32 ) + target_link_libraries( + authserver + shared + trinitydatabase + trinityauth + trinityconfig + ${MYSQL_LIBRARY} + ${OPENSSL_LIBRARIES} + ${OPENSSL_EXTRA_LIBRARIES} + ) +else() + target_link_libraries( + authserver + shared + trinitydatabase + trinityauth + trinityconfig + ${MYSQL_LIBRARY} + ${OPENSSL_LIBRARIES} + ${OSX_LIBS} + ) +endif() + +if( UNIX ) + install(TARGETS authserver DESTINATION bin) + install(FILES authserver.conf.dist DESTINATION etc) +endif() diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 09bae4908e0..28757e914e3 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -24,8 +24,9 @@ #include "Common.h" #include "Database/DatabaseEnv.h" +#include "Database/PreparedStatements.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Log.h" #include "SystemConfig.h" #include "Util.h" @@ -42,10 +43,10 @@ #include #ifndef _TRINITY_REALM_CONFIG -# define _TRINITY_REALM_CONFIG "TrinityRealm.conf" +# define _TRINITY_REALM_CONFIG "authserver.conf" #endif //_TRINITY_REALM_CONFIG -#ifdef WIN32 +#ifdef _WIN32 #include "ServiceWin32.h" char serviceName[] = "TrinityRealm"; char serviceLongName[] = "Trinity realm service"; @@ -92,7 +93,7 @@ void usage(const char *prog) { sLog.outString("Usage: \n %s []\n" " -c config_file use config_file as configuration file\n\r" - #ifdef WIN32 + #ifdef _WIN32 " Running as service functions:\n\r" " --service run as service\n\r" " -s install install service\n\r" @@ -122,7 +123,7 @@ extern int main(int argc, char **argv) cfg_file = argv[c]; } - #ifdef WIN32 + #ifdef _WIN32 //////////// //Services// //////////// @@ -243,7 +244,7 @@ extern int main(int argc, char **argv) #endif /* _WIN32 */(); ///- Handle affinity for multiple processors and process priority on Windows - #ifdef WIN32 + #ifdef _WIN32 { HANDLE hProcess = GetCurrentProcess(); @@ -313,9 +314,9 @@ extern int main(int argc, char **argv) { loopCounter = 0; sLog.outDetail("Ping MySQL to keep connection alive"); - LoginDatabase.Query("SELECT 1 FROM realmlist LIMIT 1"); + sPreparedStatement.Query(&LoginDatabase, "auth_ping"); } -#ifdef WIN32 +#ifdef _WIN32 if (m_ServiceStatus == 0) stopEvent = true; while (m_ServiceStatus == 2) Sleep(1000); #endif @@ -345,6 +346,10 @@ bool StartDB() return false; } LoginDatabase.ThreadStart(); + + uint32 count = 0; + sPreparedStatement.LoadAuthserver(&LoginDatabase, count); + sLog.outString("Loaded %u prepared MySQL statements for auth DB.", count); return true; } diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index cc293097977..c33f84a9669 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -25,13 +25,13 @@ #include "Common.h" #include "Database/DatabaseEnv.h" #include "ByteBuffer.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Log.h" #include "RealmList.h" #include "AuthSocket.h" #include "AuthCodes.h" #include -#include "Auth/Sha1.h" +#include "SHA1.h" //#include "Util.h" -- for commented utf8ToUpperOnlyLatin extern DatabaseType LoginDatabase; diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index bfd0fa4fdca..0ad40b6930b 100644 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -26,7 +26,7 @@ #define _AUTHSOCKET_H #include "Common.h" -#include "Auth/BigNumber.h" +#include "BigNumber.h" #include "RealmSocket.h" diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h index 13be8327533..8749fba9def 100644 --- a/src/server/authserver/Server/RealmSocket.h +++ b/src/server/authserver/Server/RealmSocket.h @@ -25,7 +25,6 @@ #ifndef __REALMSOCKET_H__ #define __REALMSOCKET_H__ -#include #include #include #include diff --git a/src/server/authserver/trinityrealm.conf.dist b/src/server/authserver/authserver.conf.dist similarity index 98% rename from src/server/authserver/trinityrealm.conf.dist rename to src/server/authserver/authserver.conf.dist index e98b9386878..33e2db43df3 100644 --- a/src/server/authserver/trinityrealm.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -125,14 +125,14 @@ # ############################################################################### -LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;realmd" +LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth" LogsDir = "" MaxPingTime = 30 RealmServerPort = 3724 BindIP = "0.0.0.0" PidFile = "" LogLevel = 0 -LogFile = "realmd.log" +LogFile = "auth.log" LogTimestamp = 0 LogFileLevel = 0 LogColors = "" diff --git a/src/server/authserver/TrinityRealm.ico b/src/server/authserver/authserver.ico similarity index 100% rename from src/server/authserver/TrinityRealm.ico rename to src/server/authserver/authserver.ico diff --git a/src/server/authserver/TrinityRealm.rc b/src/server/authserver/authserver.rc similarity index 86% rename from src/server/authserver/TrinityRealm.rc rename to src/server/authserver/authserver.rc index dfc548305fd..74ce7f43858 100644 --- a/src/server/authserver/TrinityRealm.rc +++ b/src/server/authserver/authserver.rc @@ -36,7 +36,7 @@ // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_APPICON ICON "TrinityRealm.ico" +IDI_APPICON ICON "authserver.ico" ///////////////////////////////////////////////////////////////////////////// // Neutre (Par défaut systčme) resources @@ -69,12 +69,12 @@ BEGIN BEGIN BLOCK "080004b0" BEGIN - VALUE "FileDescription", "TrinityRealm" + VALUE "FileDescription", "authserver" VALUE "FileVersion", STRFILEVER - VALUE "InternalName", "TrinityRealm" - VALUE "LegalCopyright", "Copyright (C) 2008-2009" - VALUE "OriginalFilename", "TrinityRealm.exe" - VALUE "ProductName", "TrinityRealm" + VALUE "InternalName", "authserver" + VALUE "LegalCopyright", "Copyright (C) 2008-2010" + VALUE "OriginalFilename", "authserver.exe" + VALUE "ProductName", "authserver" VALUE "ProductVersion", STRPRODUCTVER END END diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp index 4bd6b3c701e..7bb44a97e86 100644 --- a/src/server/collision/BoundingIntervalHierarchy.cpp +++ b/src/server/collision/BoundingIntervalHierarchy.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "BIH.h" +#include "BoundingIntervalHierarchy.h" void BIH::buildHierarchy(std::vector &tempTree, buildData &dat, BuildStats &stats) { diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h index 15ae90c23eb..1e1955641cf 100644 --- a/src/server/collision/BoundingIntervalHierarchy.h +++ b/src/server/collision/BoundingIntervalHierarchy.h @@ -19,11 +19,11 @@ #ifndef _BIH_H #define _BIH_H -#include -#include -#include +#include "G3D/Vector3.h" +#include "G3D/Ray.h" +#include "G3D/AABox.h" -#include +#include "Define.h" #include #include @@ -116,32 +116,36 @@ class BIH template void intersectRay(const Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const { - float intervalMin = 0.f; - float intervalMax = maxDist; + float intervalMin = -1.f; + float intervalMax = -1.f; Vector3 org = r.origin(); Vector3 dir = r.direction(); Vector3 invDir; - float t1, t2; - for(int i=0; i<3; ++i) + for (int i=0; i<3; ++i) { invDir[i] = 1.f / dir[i]; - t1 = (bounds.low()[i] - org[i]) * invDir[i]; - t2 = (bounds.high()[i] - org[i]) * invDir[i]; - if (invDir[i] > 0) { + if (dir[i] != 0.f) + { + float t1 = (bounds.low()[i] - org[i]) * invDir[i]; + float t2 = (bounds.high()[i] - org[i]) * invDir[i]; + if (t1 > t2) + std::swap(t1, t2); if (t1 > intervalMin) intervalMin = t1; - if (t2 < intervalMax) + if (t2 < intervalMax || intervalMax < 0.f) intervalMax = t2; - } else { - if (t2 > intervalMin) - intervalMin = t2; - if (t1 < intervalMax) - intervalMax = t1; + // intervalMax can only become smaller for other axis, + // and intervalMin only larger respectively, so stop early + if (intervalMax <= 0 || intervalMin >= maxDist) + return; } - if (intervalMin > intervalMax) - return; } + if (intervalMin > intervalMax) + return; + intervalMin = std::max(intervalMin, 0.f); + intervalMax = std::min(intervalMax, maxDist); + uint32 offsetFront[3]; uint32 offsetBack[3]; uint32 offsetFront3[3]; diff --git a/src/server/collision/CMakeLists.txt b/src/server/collision/CMakeLists.txt index 7d865d354e7..4749d88b100 100644 --- a/src/server/collision/CMakeLists.txt +++ b/src/server/collision/CMakeLists.txt @@ -1,30 +1,38 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -########### next target ############### +########### collision ############### -SET(vmaps_STAT_SRCS - BIH.h - BIH.cpp - IVMapManager.h - MapTree.cpp - MapTree.h - ModelInstance.cpp - ModelInstance.h - TileAssembler.cpp - TileAssembler.h - VMapDefinitions.h - VMapFactory.cpp - VMapFactory.h - VMapManager2.cpp - VMapManager2.h - VMapTools.h - WorldModel.cpp - WorldModel.h +set(collision_STAT_SRCS + BoundingIntervalHierarchy.cpp + Maps/MapTree.cpp + Maps/TileAssembler.cpp + Models/ModelInstance.cpp + Models/WorldModel.cpp + Management/VMapFactory.cpp + Management/VMapManager2.cpp ) include_directories( ${ACE_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/src/server/framework - ${CMAKE_SOURCE_DIR}/dep/include/g3dlite + ${CMAKE_SOURCE_DIR}/externals/g3dlite + ${CMAKE_SOURCE_DIR}/externals/mysql + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/collision + ${CMAKE_SOURCE_DIR}/src/server/collision/Management + ${CMAKE_SOURCE_DIR}/src/server/collision/Maps + ${CMAKE_SOURCE_DIR}/src/server/collision/Models + ${CMAKE_BINARY_DIR} ) -add_library(vmaps STATIC ${vmaps_STAT_SRCS}) +add_library(collision STATIC ${collision_STAT_SRCS}) diff --git a/src/server/collision/Management/IVMapManager.h b/src/server/collision/Management/IVMapManager.h index 00629eb122c..6a0e7179fa7 100644 --- a/src/server/collision/Management/IVMapManager.h +++ b/src/server/collision/Management/IVMapManager.h @@ -19,8 +19,8 @@ #ifndef _IVMAPMANAGER_H #define _IVMAPMANAGER_H -#include -#include +#include +#include "Define.h" //=========================================================== diff --git a/src/server/collision/Management/VMapFactory.cpp b/src/server/collision/Management/VMapFactory.cpp index 331acbace47..561bf0dfa02 100644 --- a/src/server/collision/Management/VMapFactory.cpp +++ b/src/server/collision/Management/VMapFactory.cpp @@ -122,15 +122,10 @@ namespace VMAP // delete all internal data structures void VMapFactory::clear() { - if(iIgnoreSpellIds) - { - delete iIgnoreSpellIds; - iIgnoreSpellIds = NULL; - } - if(gVMapManager) - { - delete gVMapManager; - gVMapManager = NULL; - } + delete iIgnoreSpellIds; + iIgnoreSpellIds = NULL; + + delete gVMapManager; + gVMapManager = NULL; } } diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 1e8a84aee52..61b202c9342 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include @@ -25,6 +25,7 @@ #include "ModelInstance.h" #include "WorldModel.h" #include "VMapDefinitions.h" +#include "Log.h" using G3D::Vector3; @@ -56,7 +57,7 @@ namespace VMAP Vector3 VMapManager2::convertPositionToInternalRep(float x, float y, float z) const { Vector3 pos; - const float mid = 0.5 * 64.0 * 533.33333333f; + const float mid = 0.5f * 64.0f * 533.33333333f; pos.x = mid - x; pos.y = mid - y; pos.z = z; @@ -69,7 +70,7 @@ namespace VMAP Vector3 VMapManager2::convertPositionToMangosRep(float x, float y, float z) const { Vector3 pos; - const float mid = 0.5 * 64.0 * 533.33333333f; + const float mid = 0.5f * 64.0f * 533.33333333f; pos.x = mid - x; pos.y = mid - y; pos.z = z; @@ -109,7 +110,7 @@ namespace VMAP ss2 >> map_num; if (map_num >= 0) { - std::cout << "ingoring Map " << map_num << " for VMaps\n"; + sLog.outDebug("Ignoring Map %i for VMaps", map_num); iIgnoreMapIds[map_num] = true; // unload map in case it is loaded unloadMap(map_num); @@ -279,6 +280,7 @@ namespace VMAP if (instanceTree->second->GetLocationInfo(pos, info)) { floor = info.ground_Z; + ASSERT(floor < std::numeric_limits::max()); type = info.hitModel->GetLiquidType(); if (ReqLiquidType && !(type & ReqLiquidType)) return false; @@ -299,11 +301,11 @@ namespace VMAP WorldModel *worldmodel = new WorldModel(); if (!worldmodel->readFile(basepath + filename + ".vmo")) { - std::cout << "VMapManager2: could not load '" << basepath << filename << ".vmo'!\n"; + sLog.outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); delete worldmodel; return NULL; } - std::cout << "VMapManager2: loading file '" << basepath << filename << "'.\n"; + sLog.outDebug("VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -316,12 +318,12 @@ namespace VMAP ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { - std::cout << "VMapManager2: trying to unload non-loaded file '" << filename << "'!\n"; + sLog.outError("VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); return; } if( model->second.decRefCount() == 0) { - std::cout << "VMapManager2: unloading file '" << filename << "'.\n"; + sLog.outDebug("VMapManager2: unloading file '%s'", filename.c_str()); delete model->second.getModel(); iLoadedModelFiles.erase(model); } diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 5f03b87b07f..953a8f11fa7 100644 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -20,8 +20,8 @@ #define _VMAPMANAGER2_H #include "IVMapManager.h" -#include "Utilities/UnorderedMap.h" -#include "Platform/Define.h" +#include "Dynamic/UnorderedMap.h" +#include "Define.h" #include //=========================================================== diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index 8c77ee109f3..b47e34b2b72 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -1,29 +1,37 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "MapTree.h" #include "ModelInstance.h" #include "VMapManager2.h" #include "VMapDefinitions.h" +#include "Log.h" #include #include #include +#include + +#ifndef NO_CORE_FUNCS + #include "Errors.h" +#else + #define ASSERT(x) +#endif using G3D::Vector3; @@ -33,13 +41,18 @@ namespace VMAP class MapRayCallback { public: - MapRayCallback(ModelInstance *val): prims(val) {} - ModelInstance *prims; + MapRayCallback(ModelInstance *val): prims(val), hit(false) {} bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool pStopAtFirstHit=true) { - return prims[entry].intersectRay(ray, distance, pStopAtFirstHit); - //std::cout << "trying to intersect '" << entity->name << "'\n"; + bool result = prims[entry].intersectRay(ray, distance, pStopAtFirstHit); + if (result) + hit = true; + return result; } + bool didHit() { return hit; } + protected: + ModelInstance *prims; + bool hit; }; class AreaInfoCallback @@ -49,7 +62,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - std::cout << "trying to intersect '" << prims[entry].name << "'\n"; + sLog.outDebug("AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); } @@ -65,7 +78,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - std::cout << "trying to intersect '" << prims[entry].name << "'\n"; + sLog.outDebug("LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) result = true; @@ -113,7 +126,7 @@ namespace VMAP } StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath): - iMapID(mapID), /* iTree(0), */ iTreeValues(0), iBasePath(basePath) + iMapID(mapID), iTreeValues(0), iBasePath(basePath) { if (iBasePath.length() > 0 && (iBasePath[iBasePath.length()-1] != '/' || iBasePath[iBasePath.length()-1] != '\\')) { @@ -130,33 +143,35 @@ namespace VMAP //========================================================= /** - return dist to hit or inf() if no hit + If intersection is found within pMaxDist, sets pMaxDist to intersection distance and returns true. + Else, pMaxDist is not modified and returns false; */ - float StaticMapTree::getIntersectionTime(const G3D::Ray& pRay, float pMaxDist, bool pStopAtFirstHit) const + bool StaticMapTree::getIntersectionTime(const G3D::Ray& pRay, float &pMaxDist, bool pStopAtFirstHit) const { float distance = pMaxDist; MapRayCallback intersectionCallBack(iTreeValues); iTree.intersectRay(pRay, intersectionCallBack, distance, pStopAtFirstHit); - return distance; + if (intersectionCallBack.didHit()) + pMaxDist = distance; + return intersectionCallBack.didHit(); } //========================================================= bool StaticMapTree::isInLineOfSight(const Vector3& pos1, const Vector3& pos2) const { - bool result = true; float maxDist = (pos2 - pos1).magnitude(); + // valid map coords should *never ever* produce float overflow, but this would produce NaNs too + ASSERT(maxDist < std::numeric_limits::max()); // prevent NaN values which can cause BIH intersection to enter infinite loop if (maxDist < 1e-10f) return true; // direction with length of 1 G3D::Ray ray = G3D::Ray::fromOriginAndDirection(pos1, (pos2 - pos1)/maxDist); - float resultDist = getIntersectionTime(ray, maxDist, true); - if (resultDist < maxDist) - { - result = false; - } - return result; + if (getIntersectionTime(ray, maxDist, true)) + return false; + + return true; } //========================================================= /** @@ -168,6 +183,8 @@ namespace VMAP { bool result=false; float maxDist = (pPos2 - pPos1).magnitude(); + // valid map coords should *never ever* produce float overflow, but this would produce NaNs too + ASSERT(maxDist < std::numeric_limits::max()); // prevent NaN values which can cause BIH intersection to enter infinite loop if (maxDist < 1e-10f) { @@ -176,8 +193,8 @@ namespace VMAP } Vector3 dir = (pPos2 - pPos1)/maxDist; // direction with length of 1 G3D::Ray ray(pPos1, dir); - float dist = getIntersectionTime(ray, maxDist, false); - if (dist < maxDist) + float dist = maxDist; + if (getIntersectionTime(ray, dist, false)) { pResultHitPos = pPos1 + dir * dist; if (pModifyDist < 0) @@ -213,10 +230,9 @@ namespace VMAP Vector3 dir = Vector3(0,0,-1); G3D::Ray ray(pPos, dir); // direction with length of 1 float maxDist = VMapDefinitions::getMaxCanFallDistance(); - float dist = getIntersectionTime(ray, maxDist, false); - if (dist < maxDist) + if (getIntersectionTime(ray, maxDist, false)) { - height = pPos.z - dist; + height = pPos.z - maxDist; } return(height); } @@ -248,7 +264,11 @@ namespace VMAP if (!tf) success = false; else + { + if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) + success = false; fclose(tf); + } } fclose(rf); return success; @@ -258,7 +278,7 @@ namespace VMAP bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm) { - std::cout << "Initializing StaticMapTree '" << fname << "'\n"; + sLog.outDebug("StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); bool success = true; std::string fullname = iBasePath + fname; FILE *rf = fopen(fullname.c_str(), "rb"); @@ -286,12 +306,12 @@ namespace VMAP // only non-tiled maps have them, and if so exactly one (so far at least...) ModelSpawn spawn; #ifdef VMAP_DEBUG - std::cout << "Map isTiled:" << bool(iIsTiled) << std::endl; + sLog.outDebug("StaticMapTree::InitMap() : map isTiled: %u", static_cast(iIsTiled)); #endif if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); - std::cout << "StaticMapTree::InitMap(): loading " << spawn.name << std::endl; + sLog.outDebug("StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); if (model) { // assume that global model always is the first and only tree value (could be improved...) @@ -301,7 +321,7 @@ namespace VMAP else { success = false; - std::cout << "error: could not acquire WorldModel pointer!\n"; + sLog.outError("StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); } } @@ -337,7 +357,7 @@ namespace VMAP } if (!iTreeValues) { - std::cout << "Tree has not been initialized!\n"; + sLog.outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u,%u]", tileX, tileY); return false; } bool result = true; @@ -346,8 +366,12 @@ namespace VMAP FILE* tf = fopen(tilefile.c_str(), "rb"); if (tf) { + char chunk[8]; + + if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) + result = false; uint32 numSpawns; - if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1) + if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1) result = false; for (uint32 i=0; iacquireModelInstance(iBasePath, spawn.name); - if (!model) std::cout << "error: could not acquire WorldModel pointer!\n"; + if (!model) + sLog.outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u,%u]", tileX, tileY); // update tree uint32 referencedVal; @@ -369,7 +394,7 @@ namespace VMAP #ifdef VMAP_DEBUG if (referencedVal > iNTreeValues) { - std::cout << "invalid tree element! (" << referencedVal << "/" << iNTreeValues << ")\n"; + sLog.outDebug("StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); continue; } #endif @@ -380,8 +405,10 @@ namespace VMAP { ++iLoadedSpawns[referencedVal]; #ifdef VMAP_DEBUG - if (iTreeValues[referencedVal].ID != spawn.ID) std::cout << "error: trying to load wrong spawn in node!\n"; - else if (iTreeValues[referencedVal].name != spawn.name) std::cout << "error: name collision on GUID="<< spawn.ID << "\n"; + if (iTreeValues[referencedVal].ID != spawn.ID) + sLog.outDebug("StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); + else if (iTreeValues[referencedVal].name != spawn.name) + sLog.outDebug("StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); #endif } } @@ -402,7 +429,7 @@ namespace VMAP loadedTileMap::iterator tile = iLoadedTiles.find(tileID); if (tile == iLoadedTiles.end()) { - std::cout << "WARNING: trying to unload non-loaded tile. Map:" << iMapID << " X:" << tileX << " Y:" << tileY << std::endl; + sLog.outError("StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY); return; } if (tile->second) // file associated with tile @@ -412,6 +439,9 @@ namespace VMAP if (tf) { bool result=true; + char chunk[8]; + if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) + result = false; uint32 numSpawns; if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1) result = false; @@ -431,11 +461,10 @@ namespace VMAP fread(&referencedNode, sizeof(uint32), 1, tf); if (!iLoadedSpawns.count(referencedNode)) { - std::cout << "error! trying to unload non-referenced model '" << spawn.name << "' (ID:" << spawn.ID << ")\n"; + sLog.outError("StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); } else if (--iLoadedSpawns[referencedNode] == 0) { - //std::cout << "MapTree: removing '" << spawn.name << "' from tree\n"; iTreeValues[referencedNode].setUnloaded(); iLoadedSpawns.erase(referencedNode); } diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h index 7955cb92d68..8f2242da5a6 100644 --- a/src/server/collision/Maps/MapTree.h +++ b/src/server/collision/Maps/MapTree.h @@ -19,9 +19,9 @@ #ifndef _MAPTREE_H #define _MAPTREE_H -#include "Platform/Define.h" -#include "Utilities/UnorderedMap.h" -#include "BIH.h" +#include "Define.h" +#include "Dynamic/UnorderedMap.h" +#include "BoundingIntervalHierarchy.h" namespace VMAP { @@ -57,7 +57,7 @@ namespace VMAP std::string iBasePath; private: - float getIntersectionTime(const G3D::Ray& pRay, float pMaxDist, bool pStopAtFirstHit) const; + bool getIntersectionTime(const G3D::Ray& pRay, float &pMaxDist, bool pStopAtFirstHit) const; //bool containsLoadedMapTile(unsigned int pTileIdent) const { return(iLoadedMapTiles.containsKey(pTileIdent)); } public: static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY); diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index d01b54a7564..c6798e70cc4 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -1,25 +1,25 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "WorldModel.h" #include "TileAssembler.h" #include "MapTree.h" -#include "BIH.h" +#include "BoundingIntervalHierarchy.h" #include "VMapDefinitions.h" #include @@ -82,6 +82,7 @@ namespace VMAP // build global map tree std::vector mapSpawns; UniqueEntryMap::iterator entry; + printf("Calculating model bounds for map %u...\n", map_iter->first); for (entry = map_iter->second->UniqueEntries.begin(); entry != map_iter->second->UniqueEntries.end(); ++entry) { // M2 models don't have a bound set in WDT/ADT placement data, i still think they're not used for LoS at all on retail @@ -100,6 +101,7 @@ namespace VMAP spawnedModelFiles.insert(entry->second.name); } + printf("Creating map tree...\n", map_iter->first); BIH pTree; pTree.build(mapSpawns, BoundsTrait::getBounds); @@ -107,8 +109,6 @@ namespace VMAP std::map modelNodeIdx; for (uint32 i=0; i(mapSpawns[i]->ID, i)); - if (!modelNodeIdx.empty()) - printf("min GUID: %u, max GUID: %u\n", modelNodeIdx.begin()->first, modelNodeIdx.rbegin()->first); // write map tree file std::stringstream mapfilename; @@ -158,6 +158,8 @@ namespace VMAP StaticMapTree::unpackTileID(tile->first, x, y); tilefilename << std::setw(2) << x << "_" << std::setw(2) << y << ".vmtile"; FILE *tilefile = fopen(tilefilename.str().c_str(), "wb"); + // file header + if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false; // write number of tile spawns if (success && fwrite(&nSpawns, sizeof(uint32), 1, tilefile) != 1) success = false; // write tile spawns diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index 677a08e147a..1ab6b363b22 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -1,24 +1,25 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "ModelInstance.h" #include "WorldModel.h" #include "MapTree.h" +#include "VMapDefinitions.h" using G3D::Vector3; using G3D::Ray; @@ -56,8 +57,11 @@ namespace VMAP Ray modRay(p, iInvRot * pRay.direction()); float distance = pMaxDist * iInvScale; bool hit = iModel->IntersectRay(modRay, distance, pStopAtFirstHit); - distance *= iScale; - pMaxDist = distance; + if(hit) + { + distance *= iScale; + pMaxDist = distance; + } return hit; } diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h index 97b3ab632a1..42b92c8fb89 100644 --- a/src/server/collision/Models/ModelInstance.h +++ b/src/server/collision/Models/ModelInstance.h @@ -24,7 +24,7 @@ #include #include -#include "Platform/Define.h" +#include "Define.h" namespace VMAP { diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index 690c77577ae..0bd156fedc2 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "WorldModel.h" @@ -148,15 +148,48 @@ namespace VMAP bool WmoLiquid::GetLiquidHeight(const Vector3 &pos, float &liqHeight) const { - uint32 tx = (pos.x - iCorner.x)/LIQUID_TILE_SIZE; + float tx_f = (pos.x - iCorner.x)/LIQUID_TILE_SIZE; + uint32 tx = uint32(tx_f); if (tx<0 || tx >= iTilesX) return false; - uint32 ty = (pos.y - iCorner.y)/LIQUID_TILE_SIZE; + float ty_f = (pos.y - iCorner.y)/LIQUID_TILE_SIZE; + uint32 ty = uint32(ty_f); if (ty<0 || ty >= iTilesY) return false; + + // check if tile shall be used for liquid level // checking for 0x08 *might* be enough, but disabled tiles always are 0x?F: if ((iFlags[tx + ty*iTilesX] & 0x0F) == 0x0F) return false; - //placeholder...use only lower left corner vertex - liqHeight = /* iCorner.z + */ iHeight[tx + ty*(iTilesX+1)]; + + // (dx, dy) coordinates inside tile, in [0,1]^2 + float dx = tx_f - (float)tx; + float dy = ty_f - (float)ty; + + /* Tesselate tile to two triangles (not sure if client does it exactly like this) + + ^ dy + | + 1 x---------x (1,1) + | (b) / | + | / | + | / | + | / (a) | + x---------x---> dx + 0 1 + */ + + const uint32 rowOffset = iTilesX + 1; + if (dx > dy) // case (a) + { + float sx = iHeight[tx+1 + ty * rowOffset] - iHeight[tx + ty * rowOffset]; + float sy = iHeight[tx+1 + (ty+1) * rowOffset] - iHeight[tx+1 + ty * rowOffset]; + liqHeight = iHeight[tx + ty * rowOffset] + dx * sx + dy * sy; + } + else // case (b) + { + float sx = iHeight[tx+1 + (ty+1) * rowOffset] - iHeight[tx + (ty+1) * rowOffset]; + float sy = iHeight[tx + (ty+1) * rowOffset] - iHeight[tx + ty * rowOffset]; + liqHeight = iHeight[tx + ty * rowOffset] + dx * sx + dy * sy; + } return true; } diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h index f12efed4f5d..7d5c921ef6e 100644 --- a/src/server/collision/Models/WorldModel.h +++ b/src/server/collision/Models/WorldModel.h @@ -23,9 +23,9 @@ #include #include #include -#include "BIH.h" +#include "BoundingIntervalHierarchy.h" -#include "Platform/Define.h" +#include "Define.h" namespace VMAP { diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h index e4a34cc1397..5f4a976ed2a 100644 --- a/src/server/collision/VMapDefinitions.h +++ b/src/server/collision/VMapDefinitions.h @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-YYYY TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef _VMAPDEFINITIONS_H diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 09ec8fae53f..cae50668a3a 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -231,7 +231,7 @@ void PetAI::UpdateAllies() Unit* owner = me->GetCharmerOrOwner(); Group *pGroup = NULL; - m_updateAlliesTimer = 10*IN_MILISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance + m_updateAlliesTimer = 10*IN_MILLISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance if (!owner) return; diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 62b7090a2d0..3033f0556db 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -21,7 +21,7 @@ #ifndef TRINITY_UNITAI_H #define TRINITY_UNITAI_H -#include "Platform/Define.h" +#include "Define.h" #include #include "Unit.h" diff --git a/src/server/game/AI/CreatureAIFactory.h b/src/server/game/AI/CreatureAIFactory.h index 6aa69eaaa29..bc3b9628010 100644 --- a/src/server/game/AI/CreatureAIFactory.h +++ b/src/server/game/AI/CreatureAIFactory.h @@ -21,8 +21,8 @@ #define TRINITY_CREATUREAIFACTORY_H //#include "Policies/Singleton.h" -#include "Dynamic/ObjectRegistry.h" -#include "Dynamic/FactoryHolder.h" +#include "ObjectRegistry.h" +#include "FactoryHolder.h" struct SelectableAI : public FactoryHolder, public Permissible { diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index d2f96ffcabc..0f05d233891 100644 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -19,7 +19,7 @@ #define CREATUREAIIMPL_H #include "Common.h" -#include "Platform/Define.h" +#include "Define.h" #include "TemporarySummon.h" #include "CreatureAI.h" #include "SpellMgr.h" diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index d3fd5a8aed9..8283baf87f9 100644 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -21,22 +21,19 @@ #include "Creature.h" #include "CreatureAISelector.h" #include "PassiveAI.h" -#include "Policies/SingletonImp.h" + #include "MovementGenerator.h" #include "Pet.h" #include "TemporarySummon.h" #include "CreatureAIFactory.h" #include "ScriptMgr.h" -INSTANTIATE_SINGLETON_1(CreatureAIRegistry); -INSTANTIATE_SINGLETON_1(MovementGeneratorRegistry); - namespace FactorySelector { CreatureAI* selectAI(Creature *creature) { const CreatureAICreator *ai_factory = NULL; - CreatureAIRegistry &ai_registry(CreatureAIRepository::Instance()); + CreatureAIRegistry& ai_registry(*CreatureAIRepository::instance()); if (creature->isPet()) ai_factory = ai_registry.GetRegistryItem("PetAI"); @@ -106,7 +103,7 @@ namespace FactorySelector MovementGenerator* selectMovementGenerator(Creature *creature) { - MovementGeneratorRegistry &mv_registry(MovementGeneratorRepository::Instance()); + MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); assert(creature->GetCreatureInfo() != NULL); const MovementGeneratorCreator *mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 47c8e9e6ad8..c70f471a82f 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -456,7 +456,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 caster = target; //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered - bool canCast = !caster->IsNonMeleeSpellCasted(false) || (action.cast.castFlags & (CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS)); + bool canCast = !caster->IsNonMeleeSpellCasted(false) || (action.cast.castFlags & (CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS)); // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them if (action.cast.castFlags & CAST_AURA_NOT_PRESENT) @@ -492,7 +492,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 else { //Interrupt any previous spell - if (caster->IsNonMeleeSpellCasted(false) && action.cast.castFlags & CAST_INTURRUPT_PREVIOUS) + if (caster->IsNonMeleeSpellCasted(false) && action.cast.castFlags & CAST_INTERRUPT_PREVIOUS) caster->InterruptNonMeleeSpells(false); caster->CastSpell(target, action.cast.spellId, (action.cast.castFlags & CAST_TRIGGERED)); @@ -1331,12 +1331,12 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote) if ((*itr).Event.receive_emote.emoteId != text_emote) return; - Condition* cond = new Condition(); - cond->mConditionType = ConditionType((*itr).Event.receive_emote.condition); - cond->mConditionValue1 = (*itr).Event.receive_emote.conditionValue1; - cond->mConditionValue2 = (*itr).Event.receive_emote.conditionValue2; + Condition cond; + cond.mConditionType = ConditionType((*itr).Event.receive_emote.condition); + cond.mConditionValue1 = (*itr).Event.receive_emote.conditionValue1; + cond.mConditionValue2 = (*itr).Event.receive_emote.conditionValue2; - if (cond->Meets(pPlayer)) + if (cond.Meets(pPlayer)) { sLog.outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing"); ProcessEvent(*itr, pPlayer); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h index 2fc5de46089..84b359787f5 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ b/src/server/game/AI/EventAI/CreatureEventAI.h @@ -150,7 +150,7 @@ enum Target enum CastFlags { - CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting + CAST_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index 83d62ca74dc..9f4105050ae 100644 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -17,19 +17,16 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" -#include "Database/SQLStorage.h" +#include "DatabaseEnv.h" +#include "SQLStorage.h" #include "CreatureEventAI.h" #include "CreatureEventAIMgr.h" #include "ObjectMgr.h" #include "ProgressBar.h" -#include "Policies/SingletonImp.h" #include "ObjectDefines.h" #include "GridDefines.h" #include "ConditionMgr.h" -INSTANTIATE_SINGLETON_1(CreatureEventAIMgr); - // ------------------- void CreatureEventAIMgr::LoadCreatureEventAI_Texts() { @@ -362,11 +359,11 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() } if (temp.receive_emote.condition) { - Condition* cond = new Condition(); - cond->mConditionType = ConditionType(temp.receive_emote.condition); - cond->mConditionValue1 = temp.receive_emote.conditionValue1; - cond->mConditionValue2 = temp.receive_emote.conditionValue2; - if (!sConditionMgr.isConditionTypeValid(cond)) + Condition cond; + cond.mConditionType = ConditionType(temp.receive_emote.condition); + cond.mConditionValue1 = temp.receive_emote.conditionValue1; + cond.mConditionValue2 = temp.receive_emote.conditionValue2; + if (!sConditionMgr.isConditionTypeValid(&cond)) { sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition); continue; diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.h b/src/server/game/AI/EventAI/CreatureEventAIMgr.h index ef191b22463..3c8181e9e74 100644 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.h +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.h @@ -24,8 +24,9 @@ class CreatureEventAIMgr { + friend class ACE_Singleton; + CreatureEventAIMgr(){}; public: - CreatureEventAIMgr(){}; ~CreatureEventAIMgr(){}; void LoadCreatureEventAI_Texts(); @@ -42,5 +43,5 @@ class CreatureEventAIMgr CreatureEventAI_TextMap m_CreatureEventAI_TextMap; }; -#define CreatureEAI_Mgr Trinity::Singleton::Instance() +#define CreatureEAI_Mgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 8c4ddd14f07..9ab9e06b624 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -5,7 +5,7 @@ * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "Item.h" #include "Spell.h" #include "ObjectMgr.h" @@ -153,7 +153,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId) if (!GetSoundEntriesStore()->LookupEntry(uiSoundId)) { - error_log("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow()); + sLog.outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow()); return; } @@ -398,7 +398,7 @@ void ScriptedAI::DoResetThreat() { if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty()) { - error_log("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry()); + sLog.outError("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry()); return; } @@ -441,7 +441,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, flo if (!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER) { if (pUnit) - error_log("TSCR: Creature %u (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: %u) to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO); + sLog.outError("TSCR: Creature %u (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: %u) to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO); return; } @@ -578,7 +578,7 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff) return false; break; default: - error_log("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", me->GetEntry()); + sLog.outError("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", me->GetEntry()); return false; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 8b7aca888e1..84e2cff7e2f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -9,7 +9,7 @@ SDComment: SDCategory: Npc EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" enum ePoints @@ -104,7 +104,7 @@ void npc_escortAI::MoveInLineOfSight(Unit* pWho) { if (!me->getVictim()) { - pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + pWho->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); AttackStart(pWho); } else if (me->GetMap()->IsDungeon()) @@ -177,7 +177,7 @@ void npc_escortAI::EnterEvadeMode() { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); - debug_log("TSCR: EscortAI has left combat and is now returning to last point"); + sLog.outDebug("TSCR: EscortAI has left combat and is now returning to last point"); } else { @@ -224,7 +224,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (DespawnAtEnd) { - debug_log("TSCR: EscortAI reached end of waypoints"); + sLog.outDebug("TSCR: EscortAI reached end of waypoints"); if (m_bCanReturnToStart) { @@ -235,7 +235,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) m_uiWPWaitTimer = 0; - debug_log("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); + sLog.outDebug("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); return; } @@ -251,7 +251,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) } else { - debug_log("TSCR: EscortAI reached end of waypoints with Despawn off"); + sLog.outDebug("TSCR: EscortAI reached end of waypoints with Despawn off"); return; } @@ -260,7 +260,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) if (!HasEscortState(STATE_ESCORT_PAUSED)) { me->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + sLog.outDebug("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); WaypointStart(CurrentWP->id); @@ -278,7 +278,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (DespawnAtFar && !IsPlayerOrGroupInRange()) { - debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); + sLog.outDebug("TSCR: EscortAI failed because player/group was to far away or not found"); if (m_bCanInstantRespawn) { @@ -316,7 +316,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) //Combat start position reached, continue waypoint movement if (uiPointId == POINT_LAST_POINT) { - debug_log("TSCR: EscortAI has returned to original position before combat"); + sLog.outDebug("TSCR: EscortAI has returned to original position before combat"); if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); @@ -330,7 +330,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) } else if (uiPointId == POINT_HOME) { - debug_log("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); + sLog.outDebug("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); CurrentWP = WaypointList.begin(); m_uiWPWaitTimer = 1; @@ -340,11 +340,11 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) //Make sure that we are still on the right waypoint if (CurrentWP->id != uiPointId) { - error_log("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", uiPointId, CurrentWP->id, me->GetEntry()); + sLog.outError("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", uiPointId, CurrentWP->id, me->GetEntry()); return; } - debug_log("TSCR: EscortAI Waypoint %u reached", CurrentWP->id); + sLog.outDebug("TSCR: EscortAI Waypoint %u reached", CurrentWP->id); //Call WP function WaypointReached(CurrentWP->id); @@ -415,14 +415,14 @@ void npc_escortAI::SetRun(bool bRun) if (!m_bIsRunning) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); else - debug_log("TSCR: EscortAI attempt to set run mode, but is already running."); + sLog.outDebug("TSCR: EscortAI attempt to set run mode, but is already running."); } else { if (m_bIsRunning) me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); else - debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking."); + sLog.outDebug("TSCR: EscortAI attempt to set walk mode, but is already walking."); } m_bIsRunning = bRun; } @@ -432,13 +432,13 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, { if (me->getVictim()) { - error_log("TSCR ERROR: EscortAI attempt to Start while in combat. Scriptname: %s, creature entry: %u", me->GetScriptName().c_str(), me->GetEntry()); + sLog.outError("TSCR ERROR: EscortAI attempt to Start while in combat. Scriptname: %s, creature entry: %u", me->GetScriptName().c_str(), me->GetEntry()); return; } if (HasEscortState(STATE_ESCORT_ESCORTING)) { - error_log("TSCR: EscortAI attempt to Start while already escorting."); + sLog.outError("TSCR: EscortAI attempt to Start while already escorting."); return; } @@ -454,7 +454,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, if (WaypointList.empty()) { - error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", pQuest ? pQuest->GetQuestId() : 0); + sLog.outErrorDb("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", pQuest ? pQuest->GetQuestId() : 0); return; } @@ -469,19 +469,19 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, m_bCanReturnToStart = bCanLoopPath; if (m_bCanReturnToStart && m_bCanInstantRespawn) - debug_log("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); + sLog.outDebug("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) { me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MoveIdle(); - debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); + sLog.outDebug("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); } //disable npcflags me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - debug_log("TSCR: EscortAI started with %u waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %u", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); + sLog.outDebug("TSCR: EscortAI started with %u waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %u", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); CurrentWP = WaypointList.begin(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 4f1543dc778..499e4611693 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -9,7 +9,7 @@ SDComment: This AI is under development SDCategory: Npc EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedFollowerAI.h" const float MAX_PLAYER_DISTANCE = 100.0f; @@ -102,7 +102,7 @@ void FollowerAI::MoveInLineOfSight(Unit* pWho) { if (!me->getVictim()) { - pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + pWho->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); AttackStart(pWho); } else if (me->GetMap()->IsDungeon()) @@ -164,7 +164,7 @@ void FollowerAI::EnterEvadeMode() if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - debug_log("TSCR: FollowerAI left combat, returning to CombatStartPosition."); + sLog.outDebug("TSCR: FollowerAI left combat, returning to CombatStartPosition."); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) { @@ -190,7 +190,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) { - debug_log("TSCR: FollowerAI is set completed, despawns."); + sLog.outDebug("TSCR: FollowerAI is set completed, despawns."); me->ForcedDespawn(); return; } @@ -201,7 +201,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_RETURNING)) { - debug_log("TSCR: FollowerAI is returning to leader."); + sLog.outDebug("TSCR: FollowerAI is returning to leader."); RemoveFollowState(STATE_FOLLOW_RETURNING); me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); @@ -230,7 +230,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) if (bIsMaxRangeExceeded) { - debug_log("TSCR: FollowerAI failed because player/group was to far away or not found"); + sLog.outDebug("TSCR: FollowerAI failed because player/group was to far away or not found"); me->ForcedDespawn(); return; } @@ -273,13 +273,13 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const { if (me->getVictim()) { - debug_log("TSCR: FollowerAI attempt to StartFollow while in combat."); + sLog.outDebug("TSCR: FollowerAI attempt to StartFollow while in combat."); return; } if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - error_log("TSCR: FollowerAI attempt to StartFollow while already following."); + sLog.outError("TSCR: FollowerAI attempt to StartFollow while already following."); return; } @@ -295,7 +295,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - debug_log("TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); + sLog.outDebug("TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); } me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); @@ -304,7 +304,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const me->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - debug_log("TSCR: FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID); + sLog.outDebug("TSCR: FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID); } Player* FollowerAI::GetLeaderForFollower() @@ -323,7 +323,7 @@ Player* FollowerAI::GetLeaderForFollower() if (pMember && pMember->isAlive() && me->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) { - debug_log("TSCR: FollowerAI GetLeader changed and returned new leader."); + sLog.outDebug("TSCR: FollowerAI GetLeader changed and returned new leader."); m_uiLeaderGUID = pMember->GetGUID(); return pMember; break; @@ -333,7 +333,7 @@ Player* FollowerAI::GetLeaderForFollower() } } - debug_log("TSCR: FollowerAI GetLeader can not find suitable leader."); + sLog.outDebug("TSCR: FollowerAI GetLeader can not find suitable leader."); return NULL; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp index 68dc8690470..4dd19547dda 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedGuardAI.cpp @@ -21,7 +21,7 @@ SDComment: SDCategory: Guards EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedGuardAI.h" // **** This script is for use within every single guard to save coding time **** diff --git a/src/server/game/AI/ScriptedAI/ScriptedInstance.h b/src/server/game/AI/ScriptedAI/ScriptedInstance.h index 25593e05300..8a9b8c4c5a3 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedInstance.h +++ b/src/server/game/AI/ScriptedAI/ScriptedInstance.h @@ -8,11 +8,11 @@ #include "InstanceData.h" #include "Map.h" -#define OUT_SAVE_INST_DATA debug_log("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -#define OUT_SAVE_INST_DATA_COMPLETE debug_log("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -#define OUT_LOAD_INST_DATA(a) debug_log("TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) -#define OUT_LOAD_INST_DATA_COMPLETE debug_log("TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -#define OUT_LOAD_INST_DATA_FAIL error_log("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_SAVE_INST_DATA sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_SAVE_INST_DATA_COMPLETE sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_LOAD_INST_DATA(a) sLog.outDebug("TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) +#define OUT_LOAD_INST_DATA_COMPLETE sLog.outDebug("TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_LOAD_INST_DATA_FAIL sLog.outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #define ScriptedInstance InstanceData diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp index 08797515837..7d86c8e54a6 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp @@ -21,7 +21,7 @@ SDComment: Base Class for SimpleAI creatures SDCategory: Creatures EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedSimpleAI.h" SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 52906fb5454..54f80114131 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -18,19 +18,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Database/DatabaseEnv.h" -#include "Policies/SingletonImp.h" +#include "DatabaseEnv.h" + #include "AccountMgr.h" #include "ObjectAccessor.h" #include "Player.h" #include "Util.h" -#include "Auth/Sha1.h" +#include "SHA1.h" extern DatabaseType LoginDatabase; -INSTANTIATE_SINGLETON_1(AccountMgr); - AccountMgr::AccountMgr() {} diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index b017bf1836a..a0e181cf4a0 100644 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -24,7 +24,6 @@ #include #include "Common.h" -#include "Policies/Singleton.h" enum AccountOpResult { @@ -59,6 +58,6 @@ class AccountMgr static bool normalizeString(std::string& utf8str); }; -#define accmgr Trinity::Singleton::Instance() +#define accmgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index e0a79fc71ed..bb156c40ca6 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -21,8 +21,8 @@ #include "ObjectMgr.h" #include "World.h" #include "WorldPacket.h" -#include "Database/DatabaseEnv.h" -#include "Policies/SingletonImp.h" +#include "DatabaseEnv.h" + #include "AchievementMgr.h" #include "ArenaTeam.h" @@ -41,8 +41,6 @@ #include "Map.h" #include "InstanceData.h" -INSTANTIATE_SINGLETON_1(AchievementGlobalMgr); - namespace Trinity { class AchievementChatBuilder @@ -873,6 +871,36 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui SetCriteriaProgress(achievementCriteria, counter); break; } + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: + { + time_t nextDailyResetTime = sWorld.GetNextDailyQuestsResetTime(); + CriteriaProgress *progress = GetCriteriaProgress(achievementCriteria); + + if (!miscvalue1) // Login case. + { + // reset if player missed one day. + if (progress && progress->date < (nextDailyResetTime - 2 * DAY)) + SetCriteriaProgress(achievementCriteria, 0, PROGRESS_SET); + continue; + } + + ProgressType progressType; + if (!progress) + // 1st time. Start count. + progressType = PROGRESS_SET; + else if (progress->date < (nextDailyResetTime - 2 * DAY)) + // last progress is older than 2 days. Player missed 1 day => Retart count. + progressType = PROGRESS_SET; + else if (progress->date < (nextDailyResetTime - DAY)) + // last progress is between 1 and 2 days. => 1st time of the day. + progressType = PROGRESS_ACCUMULATE; + else + // last progress is within the day before the reset => Already counted today. + continue; + + SetCriteriaProgress(achievementCriteria, 1, progressType); + break; + } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE: { // speedup for non-login case @@ -935,7 +963,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscvalue1) continue; - Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : MapManager::Instance().FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); + Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : sMapMgr.FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); if (!map || !map->IsDungeon()) continue; @@ -1428,7 +1456,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING: break; // FIXME: not triggered in code as result, need to implement - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: @@ -1483,11 +1510,10 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve return false; } - CriteriaProgressMap::const_iterator itr = m_criteriaProgress.find(achievementCriteria->ID); - if (itr == m_criteriaProgress.end()) + CriteriaProgress const* progress = GetCriteriaProgress(achievementCriteria); + if (!progress) return false; - CriteriaProgress const* progress = &itr->second; switch(achievementCriteria->requiredType) { @@ -1516,6 +1542,8 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve return progress->counter >= 1; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT: return progress->counter >= achievementCriteria->complete_quest_count.totalQuestCount; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: + return progress->counter >= achievementCriteria->complete_daily_quest_daily.numberOfDays; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE: return progress->counter >= achievementCriteria->complete_quests_in_zone.questCount; case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: @@ -1661,11 +1689,10 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) { AchievementCriteriaEntry const* criteria = *itr; - CriteriaProgressMap::const_iterator itrProgress = m_criteriaProgress.find(criteria->ID); - if (itrProgress == m_criteriaProgress.end()) + CriteriaProgress const* progress = GetCriteriaProgress(criteria); + if (!progress) continue; - CriteriaProgress const* progress = &itrProgress->second; count += progress->counter; // for counters, field4 contains the main count requirement @@ -1701,6 +1728,16 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) return false; } +CriteriaProgress* AchievementMgr::GetCriteriaProgress(AchievementCriteriaEntry const* entry) +{ + CriteriaProgressMap::iterator iter = m_criteriaProgress.find(entry->ID); + + if (iter == m_criteriaProgress.end()) + return NULL; + + return &(iter->second); +} + void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype) { // Don't allow to cheat - doing timed achievements without timer active @@ -1711,11 +1748,8 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) sLog.outDetail("AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); - CriteriaProgress *progress = NULL; - - CriteriaProgressMap::iterator iter = m_criteriaProgress.find(entry->ID); - - if (iter == m_criteriaProgress.end()) + CriteriaProgress* progress = GetCriteriaProgress(entry); + if (!progress) { // not create record for 0 counter but allow it for timed achievements // we will need to send 0 progress to client to start the timer @@ -1724,12 +1758,9 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, progress = &m_criteriaProgress[entry->ID]; progress->counter = changeValue; - progress->date = time(NULL); } else { - progress = &iter->second; - uint32 newValue = 0; switch(ptype) { @@ -1756,6 +1787,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, } progress->changed = true; + progress->date = time(NULL); // set the date to the latest update. uint32 timeElapsed = 0; bool timedCompleted = false; @@ -1765,7 +1797,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, //has to exist else we wouldn't be here timedCompleted = IsCompletedCriteria(entry, sAchievementStore.LookupEntry(entry->referredAchievement)); // Client expects this in packet - timeElapsed = entry->timeLimit - (timedIter->second/IN_MILISECONDS); + timeElapsed = entry->timeLimit - (timedIter->second/IN_MILLISECONDS); // Remove the timer, we wont need it anymore if (timedCompleted) @@ -1809,7 +1841,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u if (m_timedAchievements.find((*i)->ID) == m_timedAchievements.end() && !IsCompletedCriteria(*i, achievement)) { // Start the timer - m_timedAchievements[(*i)->ID] = (*i)->timeLimit * IN_MILISECONDS; + m_timedAchievements[(*i)->ID] = (*i)->timeLimit * IN_MILLISECONDS; // and at client too SetCriteriaProgress(*i, 0, PROGRESS_SET); diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index ea9e5e95142..0eedf971c20 100644 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -22,8 +22,8 @@ #include #include "Common.h" -#include "Policies/Singleton.h" -#include "Database/DatabaseEnv.h" +#include "ace/Singleton.h" +#include "DatabaseEnv.h" #include "DBCEnums.h" #include "DBCStores.h" @@ -36,7 +36,7 @@ typedef std::map AchievementListByReference struct CriteriaProgress { uint32 counter; - time_t date; + time_t date; // latest update time. bool changed; }; @@ -258,6 +258,7 @@ class AchievementMgr enum ProgressType { PROGRESS_SET, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST }; void SendAchievementEarned(AchievementEntry const* achievement); void SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted); + CriteriaProgress* GetCriteriaProgress(AchievementCriteriaEntry const* entry); void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET); void CompletedCriteriaFor(AchievementEntry const* achievement); bool IsCompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement); @@ -341,6 +342,6 @@ class AchievementGlobalMgr AchievementRewardLocales m_achievementRewardLocales; }; -#define achievementmgr Trinity::Singleton::Instance() +#define achievementmgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp index 66e4fbc8765..830d439bfdd 100644 --- a/src/server/game/Addons/AddonMgr.cpp +++ b/src/server/game/Addons/AddonMgr.cpp @@ -1,8 +1,7 @@ /* + * Copyright (C) 2008-2010 Trinity * Copyright (C) 2005-2009 MaNGOS * - * Copyright (C) 2008-2009 Trinity - * * 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 * the Free Software Foundation; either version 2 of the License, or @@ -18,20 +17,18 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Database/DatabaseEnv.h" -#include "Policies/SingletonImp.h" +#include "DatabaseEnv.h" + #include "AddonMgr.h" #include "ObjectAccessor.h" #include "Player.h" #include "Util.h" -#include "Auth/Sha1.h" +#include "SHA1.h" #include "ProgressBar.h" extern DatabaseType LoginDatabase; -INSTANTIATE_SINGLETON_1(AddonMgr); - AddonMgr::AddonMgr() { } diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h index 8f5eed4918f..112415e5b40 100644 --- a/src/server/game/Addons/AddonMgr.h +++ b/src/server/game/Addons/AddonMgr.h @@ -1,8 +1,7 @@ /* + * Copyright (C) 2008-2010 Trinity * Copyright (C) 2005-2009 MaNGOS * - * Copyright (C) 2008-2009 Trinity - * * 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 * the Free Software Foundation; either version 2 of the License, or @@ -22,7 +21,7 @@ #define _ADDONMGR_H #include "Common.h" -#include "Policies/Singleton.h" +#include "ace/Singleton.h" #include @@ -68,9 +67,10 @@ typedef std::list SavedAddonsList; class AddonMgr { + friend class ACE_Singleton; + AddonMgr(); public: - AddonMgr(); ~AddonMgr(); void LoadFromDB(); @@ -83,7 +83,7 @@ class AddonMgr SavedAddonsList m_knownAddons; // Known addons. }; -#define sAddonMgr Trinity::Singleton::Instance() +#define sAddonMgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp index ebbf48e6476..0a4b6c3f32e 100644 --- a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp @@ -1,11 +1,27 @@ +/* + * Copyright (C) 2008-2010 Trinity + * Copyright (C) 2005-2009 MaNGOS + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "ObjectMgr.h" #include "AuctionHouseMgr.h" #include "AuctionHouseBot.h" #include -#include "Policies/SingletonImp.h" -INSTANTIATE_SINGLETON_1(AuctionHouseBot); - using namespace std; vector npcItems; vector lootItems; @@ -23,6 +39,7 @@ vector blueItemsBin; vector purpleItemsBin; vector orangeItemsBin; vector yellowItemsBin; + AuctionHouseBot::AuctionHouseBot() { debug_Out = false; @@ -693,7 +710,7 @@ void AuctionHouseBot::Update() WorldSession _session(AHBplayerAccount, NULL, SEC_PLAYER, true, 0, LOCALE_enUS); Player _AHBplayer(&_session); _AHBplayer.Initialize(AHBplayerGUID); - ObjectAccessor::Instance().AddObject(&_AHBplayer); + sObjectAccessor.AddObject(&_AHBplayer); // Add New Bids if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) @@ -725,7 +742,7 @@ void AuctionHouseBot::Update() addNewAuctionBuyerBotBid(&_AHBplayer, &NeutralConfig, &_session); _lastrun_n = _newrun; } - ObjectAccessor::Instance().RemoveObject(&_AHBplayer); + sObjectAccessor.RemoveObject(&_AHBplayer); } void AuctionHouseBot::Initialize() @@ -1510,6 +1527,7 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char* uint32 maxItems = (uint32) strtoul(param1, NULL, 0); CharacterDatabase.PExecute("UPDATE auctionhousebot SET maxitems = '%u' WHERE auctionhouse = '%u'", maxItems, ahMapID); config->SetMaxItems(maxItems); + config->CalculatePercents(); } break; case 3: //min time Deprecated (Place holder for future commands) diff --git a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h index 208a09aa0b2..d1cec5f170e 100644 --- a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h +++ b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h @@ -1,8 +1,27 @@ +/* + * Copyright (C) 2008-2010 Trinity + * Copyright (C) 2005-2009 MaNGOS + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef AUCTION_HOUSE_BOT_H #define AUCTION_HOUSE_BOT_H #include "World.h" -#include "Config/ConfigEnv.h" +#include "ConfigEnv.h" #include "ItemPrototype.h" #define AHB_GREY 0 @@ -173,7 +192,8 @@ public: void SetMaxItems(uint32 value) { maxItems = value; - CalculatePercents(); + // CalculatePercents() needs to be called, but only if + // SetPercentages() has been called at least once already. } uint32 GetMaxItems() { @@ -1207,9 +1227,11 @@ private: inline uint32 minValue(uint32 a, uint32 b) { return a <= b ? a : b; }; void addNewAuctions(Player *AHBplayer, AHBConfig *config); void addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *config, WorldSession *session); + + friend class ACE_Singleton; + AuctionHouseBot(); public: - AuctionHouseBot(); ~AuctionHouseBot(); void Update(); void Initialize(); @@ -1220,6 +1242,6 @@ public: uint32 GetAHBplayerGUID() { return AHBplayerGUID; }; }; -#define auctionbot Trinity::Singleton::Instance() +#define auctionbot (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index ddd44bbefa2..95e1fb5e931 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2009 MaNGOS * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "Common.h" @@ -22,21 +22,19 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSession.h" -#include "Database/DatabaseEnv.h" -#include "Database/SQLStorage.h" -#include "Policies/SingletonImp.h" +#include "DatabaseEnv.h" +#include "SQLStorage.h" + #include "DBCStores.h" #include "AccountMgr.h" #include "AuctionHouseMgr.h" #include "Item.h" #include "Language.h" -#include "Log.h" +#include "Logging/Log.h" #include "ProgressBar.h" #include -INSTANTIATE_SINGLETON_1(AuctionHouseMgr); - using namespace std; AuctionHouseMgr::AuctionHouseMgr() @@ -483,7 +481,11 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 item_template) { auctionbot.DecrementItemCounts(auction, item_template); - return AuctionsMap.erase(auction->Id) ? true : false; + bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false; + + // we need to delete the entry, it is not referenced any more + delete auction; + return wasInMap; } void AuctionHouseObject::Update() @@ -711,7 +713,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const data << uint32(bid ? GetAuctionOutBid() : 0); //minimal outbid data << uint32(buyout); //auction->buyout - data << uint32((expire_time-time(NULL))*IN_MILISECONDS);//time left + data << uint32((expire_time-time(NULL))*IN_MILLISECONDS);//time left data << uint64(bidder) ; //auction->bidder current data << uint32(bid); //current bid return true; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index b92cec986c7..24c954a91e8 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -1,27 +1,25 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2009 MaNGOS * - * Copyright (C) 2008-2010 Trinity + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef _AUCTION_HOUSE_MGR_H #define _AUCTION_HOUSE_MGR_H -#include "Policies/Singleton.h" +#include "ace/Singleton.h" #include "SharedDefines.h" @@ -121,51 +119,53 @@ class AuctionHouseObject class AuctionHouseMgr { - public: + friend class ACE_Singleton; AuctionHouseMgr(); - ~AuctionHouseMgr(); + + public: + ~AuctionHouseMgr(); - typedef UNORDERED_MAP ItemMap; + typedef UNORDERED_MAP ItemMap; - AuctionHouseObject* GetAuctionsMap(uint32 factionTemplateId); - AuctionHouseObject* GetBidsMap(uint32 factionTemplateId); + AuctionHouseObject* GetAuctionsMap(uint32 factionTemplateId); + AuctionHouseObject* GetBidsMap(uint32 factionTemplateId); - Item* GetAItem(uint32 id) - { - ItemMap::const_iterator itr = mAitems.find(id); - if (itr != mAitems.end()) + Item* GetAItem(uint32 id) { - return itr->second; + ItemMap::const_iterator itr = mAitems.find(id); + if (itr != mAitems.end()) + { + return itr->second; + } + return NULL; } - return NULL; - } - //auction messages - void SendAuctionWonMail(AuctionEntry * auction); - void SendAuctionSalePendingMail(AuctionEntry * auction); - void SendAuctionSuccessfulMail(AuctionEntry * auction); - void SendAuctionExpiredMail(AuctionEntry * auction); - static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem); - static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); + //auction messages + void SendAuctionWonMail(AuctionEntry * auction); + void SendAuctionSalePendingMail(AuctionEntry * auction); + void SendAuctionSuccessfulMail(AuctionEntry * auction); + void SendAuctionExpiredMail(AuctionEntry * auction); + static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item *pItem); + static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); - public: + public: //load first auction items, because of check if item exists, when loading - void LoadAuctionItems(); - void LoadAuctions(); + void LoadAuctionItems(); + void LoadAuctions(); - void AddAItem(Item* it); - bool RemoveAItem(uint32 id); + void AddAItem(Item* it); + bool RemoveAItem(uint32 id); - void Update(); + void Update(); - private: - AuctionHouseObject mHordeAuctions; - AuctionHouseObject mAllianceAuctions; - AuctionHouseObject mNeutralAuctions; + private: + AuctionHouseObject mHordeAuctions; + AuctionHouseObject mAllianceAuctions; + AuctionHouseObject mNeutralAuctions; - ItemMap mAitems; + ItemMap mAitems; }; -#define auctionmgr Trinity::Singleton::Instance() +#define auctionmgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/BattleGrounds/BattleGround.cpp b/src/server/game/BattleGrounds/BattleGround.cpp index 5bfe2e139b6..d9d6dc98a58 100644 --- a/src/server/game/BattleGrounds/BattleGround.cpp +++ b/src/server/game/BattleGrounds/BattleGround.cpp @@ -323,7 +323,7 @@ void BattleGround::Update(uint32 diff) plr->ResurrectPlayer(1.0f); plr->CastSpell(plr, 6962, true); plr->CastSpell(plr, SPELL_SPIRIT_HEAL_MANA, true); - ObjectAccessor::Instance().ConvertCorpseForPlayer(*itr); + sObjectAccessor.ConvertCorpseForPlayer(*itr); } m_ResurrectQueue.clear(); } @@ -356,16 +356,16 @@ void BattleGround::Update(uint32 diff) { uint32 newtime = m_PrematureCountDownTimer - diff; // announce every minute - if (newtime > (MINUTE * IN_MILISECONDS)) + if (newtime > (MINUTE * IN_MILLISECONDS)) { - if (newtime / (MINUTE * IN_MILISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS)) - PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS))); + if (newtime / (MINUTE * IN_MILLISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILLISECONDS)) + PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILLISECONDS))); } else { //announce every 15 seconds - if (newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS)) - PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS)); + if (newtime / (15 * IN_MILLISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILLISECONDS)) + PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILLISECONDS)); } m_PrematureCountDownTimer = newtime; } @@ -436,7 +436,7 @@ void BattleGround::Update(uint32 diff) AuraApplication * aurApp = iter->second; Aura * aura = aurApp->GetBase(); if (!aura->IsPermanent() - && aura->GetDuration() <= 30*IN_MILISECONDS + && aura->GetDuration() <= 30*IN_MILLISECONDS && aurApp->IsPositive() && (!(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)) && (!aura->HasEffectType(SPELL_AURA_MOD_INVISIBILITY))) @@ -856,7 +856,7 @@ void BattleGround::EndBattleGround(uint32 winner) uint32 BattleGround::GetBonusHonorFromKill(uint32 kills) const { //variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill) - uint32 maxLevel = (GetMaxLevel()<80)?GetMaxLevel():80; + uint32 maxLevel = (GetMaxLevel() < 80) ? GetMaxLevel() : 80; return Trinity::Honor::hk_honor_at_level(maxLevel, kills); } @@ -1525,7 +1525,7 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f /* void BattleGround::SpawnBGCreature(uint32 type, uint32 respawntime) { - Map * map = MapManager::Instance().FindMap(GetMapId(),GetInstanceId()); + Map * map = sMapMgr.FindMap(GetMapId(),GetInstanceId()); if (!map) return false; @@ -1962,4 +1962,4 @@ void BattleGround::RewardXPAtKill(Player* plr, Player* victim) if (Pet* pet = plr->GetPet()) pet->GivePetXP(xp); } -} \ No newline at end of file +} diff --git a/src/server/game/BattleGrounds/BattleGroundMgr.cpp b/src/server/game/BattleGrounds/BattleGroundMgr.cpp index 3bbe8c3cf31..2450cfe6e24 100644 --- a/src/server/game/BattleGrounds/BattleGroundMgr.cpp +++ b/src/server/game/BattleGrounds/BattleGroundMgr.cpp @@ -22,7 +22,7 @@ #include "ObjectMgr.h" #include "World.h" #include "WorldPacket.h" -#include "Policies/SingletonImp.h" + #include "ArenaTeam.h" #include "BattleGroundMgr.h" @@ -49,8 +49,6 @@ #include "SharedDefines.h" #include "Formulas.h" -INSTANTIATE_SINGLETON_1(BattleGroundMgr); - /*********************************************************/ /*** BATTLEGROUND QUEUE SYSTEM ***/ /*********************************************************/ @@ -1271,8 +1269,8 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro *data << uint32(bg->GetTypeID()); *data << uint16(0x1F90); // End of uint64 segment, decomposed this way for simplicity - *data << uint8(0); // 3.3.0 - *data << uint8(0); // 3.3.0 + *data << uint8(0); // 3.3.0, some level, only saw 80... + *data << uint8(0); // 3.3.0, some level, only saw 80... *data << uint32(bg->GetClientInstanceID()); // alliance/horde for BG and skirmish/rated for Arenas // following displays the minimap-icon 0 = faction icon 1 = arenaicon @@ -1287,10 +1285,12 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro break; case STATUS_WAIT_JOIN: // status_invite *data << uint32(bg->GetMapId()); // map id + *data << uint64(0); // 3.3.5, unknown *data << uint32(Time1); // time to remove from queue, milliseconds break; case STATUS_IN_PROGRESS: // status_in_progress *data << uint32(bg->GetMapId()); // map id + *data << uint64(0); // 3.3.5, unknown *data << uint32(Time1); // time to bg auto leave, 0 at bg start, 120000 after bg end, milliseconds *data << uint32(Time2); // time from bg start, milliseconds *data << uint8(/*bg->isArena() ? 0 :*/ 1); // unk, possibly 0 == preparation phase, 1 == battle @@ -1629,8 +1629,11 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI return 0; } + // set battelground difficulty before initialization + bg->SetBracket(bracketEntry); + // generate a new instance id - bg->SetInstanceID(MapManager::Instance().GenerateInstanceId()); // set instance id + bg->SetInstanceID(sMapMgr.GenerateInstanceId()); // set instance id bg->SetClientInstanceID(CreateClientVisibleInstanceId(isRandom ? BATTLEGROUND_RB : bgTypeId, bracketEntry->GetBracketId())); // reset the new bg (set status to status_wait_queue from status_none) @@ -1638,7 +1641,6 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI // start the joining of the bg bg->SetStatus(STATUS_WAIT_JOIN); - bg->SetBracket(bracketEntry); bg->SetArenaType(arenaType); bg->SetRated(isRated); bg->SetRandom(isRandom); @@ -1893,8 +1895,8 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint6 uint32 win_arena = plr->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST; uint32 loos_kills = plr->GetRandomWinner() ? BG_REWARD_LOOSER_HONOR_LAST : BG_REWARD_LOOSER_HONOR_FIRST; - win_kills = (uint32)Trinity::Honor::hk_honor_at_level(plr->getLevel(), win_kills); - loos_kills = (uint32)Trinity::Honor::hk_honor_at_level(plr->getLevel(), loos_kills); + win_kills = Trinity::Honor::hk_honor_at_level(plr->getLevel(), win_kills); + loos_kills = Trinity::Honor::hk_honor_at_level(plr->getLevel(), loos_kills); data->Initialize(SMSG_BATTLEFIELD_LIST); *data << uint64(guid); // battlemaster guid diff --git a/src/server/game/BattleGrounds/BattleGroundMgr.h b/src/server/game/BattleGrounds/BattleGroundMgr.h index 569651a95b3..40dfc39b5e5 100644 --- a/src/server/game/BattleGrounds/BattleGroundMgr.h +++ b/src/server/game/BattleGrounds/BattleGroundMgr.h @@ -22,7 +22,7 @@ #define __BATTLEGROUNDMGR_H #include "Common.h" -#include "Policies/Singleton.h" +#include "ace/Singleton.h" #include "DBCEnums.h" #include "BattleGround.h" @@ -180,9 +180,12 @@ class BGQueueRemoveEvent : public BasicEvent class BattleGroundMgr { + /// Todo: Thread safety? + /* Construction */ + friend class ACE_Singleton; + BattleGroundMgr(); + public: - /* Construction */ - BattleGroundMgr(); ~BattleGroundMgr(); void Update(uint32 diff); @@ -271,6 +274,6 @@ class BattleGroundMgr bool m_Testing; }; -#define sBattleGroundMgr Trinity::Singleton::Instance() +#define sBattleGroundMgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp b/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp index 7f5482cbf16..b477d6723fe 100644 --- a/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp +++ b/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp @@ -23,9 +23,9 @@ #include "BattleGround.h" #include "BattleGroundAV.h" -#include "Formulas.h" +#include "Miscellaneous/Formulas.h" #include "GameObject.h" -#include "Language.h" +#include "Miscellaneous/Language.h" #include "Player.h" #include "SpellAuras.h" diff --git a/src/server/game/BattleGrounds/Zones/BattleGroundEY.h b/src/server/game/BattleGrounds/Zones/BattleGroundEY.h index 4fe23c4c821..6b1ec6ced59 100644 --- a/src/server/game/BattleGrounds/Zones/BattleGroundEY.h +++ b/src/server/game/BattleGrounds/Zones/BattleGroundEY.h @@ -25,8 +25,8 @@ class BattleGround; -#define BG_EY_FLAG_RESPAWN_TIME (8*IN_MILISECONDS) //8 seconds -#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILISECONDS) //2 seconds +#define BG_EY_FLAG_RESPAWN_TIME (8*IN_MILLISECONDS) //8 seconds +#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILLISECONDS) //2 seconds enum BG_EY_WorldStates { diff --git a/src/server/game/BattleGrounds/Zones/BattleGroundSA.h b/src/server/game/BattleGrounds/Zones/BattleGroundSA.h index 760be3ca02e..f1299fbb4a4 100644 --- a/src/server/game/BattleGrounds/Zones/BattleGroundSA.h +++ b/src/server/game/BattleGrounds/Zones/BattleGroundSA.h @@ -197,7 +197,7 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { 1431.3413f, -219.437f, 30.893f, 0.9736f }, { 1227.667f, -212.555f, 55.372f, 0.5023f }, { 1214.681f, 81.21f, 53.413f, 5.745f }, - { 878.555f, -108.989f, 119.835f, 0.0565f }, + { 878.555f, -108.2f, 117.845f, 0.0f }, { 836.5f, -108.8f, 120.219f, 0.0f }, //Ships { 2679.696777, -826.891235, 3.712860, 5.78367f}, //rot2 1 rot3 0.0002 diff --git a/src/server/game/BattleGrounds/Zones/BattleGroundWS.cpp b/src/server/game/BattleGrounds/Zones/BattleGroundWS.cpp index 71872511274..2521e93ebcf 100644 --- a/src/server/game/BattleGrounds/Zones/BattleGroundWS.cpp +++ b/src/server/game/BattleGrounds/Zones/BattleGroundWS.cpp @@ -70,7 +70,7 @@ void BattleGroundWS::Update(uint32 diff) if (GetStatus() == STATUS_IN_PROGRESS) { - if (GetStartTime() >= 25*MINUTE*IN_MILISECONDS) // Ňŕéěĺđ ňčęŕňü íŕ÷číŕĺň ďîńëĺ 25 ěčíóň + if (GetStartTime() >= 25*MINUTE*IN_MILLISECONDS) { if (GetTeamScore(ALLIANCE) == 0) { @@ -83,15 +83,15 @@ void BattleGroundWS::Update(uint32 diff) else if (GetTeamScore(HORDE) == 0) EndBattleGround(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins - else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the first flag - EndBattleGround(m_FirstFlagCaptureTeam); + else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the last flag + EndBattleGround(m_LastFlagCaptureTeam); else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE)) // Last but not least, check who has the higher score EndBattleGround(HORDE); else EndBattleGround(ALLIANCE); } - else if (GetStartTime() > m_minutesElapsed*MINUTE*IN_MILISECONDS) + else if (GetStartTime() > m_minutesElapsed*MINUTE*IN_MILLISECONDS) { ++m_minutesElapsed; UpdateWorldState(BG_WS_STATE_TIMER, 25-m_minutesElapsed); @@ -325,8 +325,8 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source) // only flag capture should be updated UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures - if (!m_FirstFlagCaptureTeam) - SetFirstFlagCapture(Source->GetTeam()); + // update last flag capture to be used if teamscore is equal + SetLastFlagCapture(Source->GetTeam()); if (GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE) winner = ALLIANCE; @@ -720,7 +720,7 @@ void BattleGroundWS::Reset() m_HonorEndKills = (isBGWeekend) ? 4 : 2; // For WorldState m_minutesElapsed = 0; - m_FirstFlagCaptureTeam = 0; + m_LastFlagCaptureTeam = 0; /* Spirit nodes is static at this BG and then not required deleting at BG reset. if (m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE]) diff --git a/src/server/game/BattleGrounds/Zones/BattleGroundWS.h b/src/server/game/BattleGrounds/Zones/BattleGroundWS.h index 1a733c14570..ff3a3c893ff 100644 --- a/src/server/game/BattleGrounds/Zones/BattleGroundWS.h +++ b/src/server/game/BattleGrounds/Zones/BattleGroundWS.h @@ -191,7 +191,7 @@ class BattleGroundWS : public BattleGround virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); void UpdateFlagState(uint32 team, uint32 value); - void SetFirstFlagCapture(uint32 team) { m_FirstFlagCaptureTeam = team; } + void SetLastFlagCapture(uint32 team) { m_LastFlagCaptureTeam = team; } void UpdateTeamScore(uint32 team); void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true); void SetDroppedFlagGUID(uint64 guid, uint32 TeamID) { m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)] = guid;} @@ -209,7 +209,7 @@ class BattleGroundWS : public BattleGround uint8 m_FlagState[2]; // for checking flag state int32 m_FlagsTimer[2]; int32 m_FlagsDropTimer[2]; - uint32 m_FirstFlagCaptureTeam; // Winner is based on this if score is equal + uint32 m_LastFlagCaptureTeam; // Winner is based on this if score is equal uint32 m_ReputationCapture; uint32 m_HonorWinKills; diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index 44fe870baa4..d1a9fac4f16 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -1,373 +1,263 @@ -# Enable precompiled headers when using the GCC compiler. -IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SET(game_STAT_SRCS - Account/AccountMgr.cpp - Account/AccountMgr.h - Achievements/AchievementMgr.h - Achievements/AchievementMgr.cpp - Addons/AddonMgr.cpp - Addons/AddonMgr.h - Addons/AddonHandler.cpp - Addons/AddonHandler.h - AI/AuctionHouseBot/AuctionHouseBot.cpp - AI/AuctionHouseBot/AuctionHouseBot.h - AI/EventAI/CreatureEventAI.cpp - AI/EventAI/CreatureEventAIMgr.cpp - AI/ScriptedAI/ScriptedSmartAI.cpp - AI/ScriptedAI/ScriptedSmartAI.h - AI/CombatAI.cpp - AI/CombatAI.h - AI/CreatureAI.cpp - AI/CreatureAI.h - AI/CreatureAIFactory.h - AI/CreatureAIImpl.h - AI/CreatureAIRegistry.cpp - AI/CreatureAIRegistry.h - AI/CreatureAISelector.cpp - AI/CreatureAISelector.h - AI/GuardAI.cpp - AI/GuardAI.h - AI/PassiveAI.cpp - AI/PassiveAI.h - AI/PetAI.cpp - AI/PetAI.h - AI/ReactorAI.cpp - AI/ReactorAI.h - AI/TotemAI.cpp - AI/TotemAI.h - AI/UnitAI.cpp - AI/UnitAI.h - AuctionHouse/AuctionHouseHandler.cpp - AuctionHouse/AuctionHouseMgr.cpp - AuctionHouse/AuctionHouseMgr.h - BattleGrounds/ArenaTeam.cpp - BattleGrounds/ArenaTeam.h - BattleGrounds/ArenaTeamHandler.cpp - BattleGrounds/BattleGround.cpp - BattleGrounds/BattleGroundAA.cpp - BattleGrounds/BattleGroundAB.cpp - BattleGrounds/BattleGroundRB.cpp - BattleGrounds/BattleGroundAV.cpp - BattleGrounds/BattleGroundBE.cpp - BattleGrounds/BattleGroundDS.cpp - BattleGrounds/BattleGroundEY.cpp - BattleGrounds/BattleGroundIC.cpp - BattleGrounds/BattleGroundNA.cpp - BattleGrounds/BattleGroundRL.cpp - BattleGrounds/BattleGroundRV.cpp - BattleGrounds/BattleGroundSA.cpp - BattleGrounds/BattleGroundWS.cpp - BattleGrounds/BattleGround.h - BattleGrounds/BattleGroundAA.h - BattleGrounds/BattleGroundAB.h - BattleGrounds/BattleGroundRB.h - BattleGrounds/BattleGroundAV.h - BattleGrounds/BattleGroundBE.h - BattleGrounds/BattleGroundDS.h - BattleGrounds/BattleGroundEY.h - BattleGrounds/BattleGroundIC.h - BattleGrounds/BattleGroundNA.h - BattleGrounds/BattleGroundRL.h - BattleGrounds/BattleGroundRV.h - BattleGrounds/BattleGroundSA.h - BattleGrounds/BattleGroundWS.h - BattleGrounds/BattleGroundHandler.cpp - BattleGrounds/BattleGroundMgr.cpp - BattleGrounds/BattleGroundMgr.h - Calendar/Calendar.cpp - Calendar/Calendar.h - Calendar/CalendarHandler.cpp - Chat/Channel.cpp - Chat/Channel.h - Chat/ChannelHandler.cpp - Chat/ChannelMgr.h - Chat/ChannelMgr.cpp - Chat/Chat.cpp - Chat/Chat.h - Chat/ChatHandler.cpp - Chat/Debugcmds.cpp - Chat/Level0.cpp - Chat/Level1.cpp - Chat/Level2.cpp - Chat/Level3.cpp - Combat/CombatHandler.cpp - Combat/HostileRefManager.cpp - Combat/HostileRefManager.h - Combat/ThreatManager.cpp - Combat/ThreatManager.h - ConditionMgr/ConditionMgr.cpp - ConditionMgr/ConditionMgr.h - DataStores/DBCEnums.h - DataStores/DBCStores.cpp - DataStores/DBCStores.h - DataStores/DBCStructure.h - DataStores/DBCfmt.h - Entities/Creature/Creature.cpp - Entities/Creature/Creature.h - Entities/Creature/CreatureGroups.cpp - Entities/Creature/CreatureGroups.h - Entities/Creature/GossipDef.cpp - Entities/Creature/GossipDef.h - Entities/Creature/NPCHandler.cpp - Entities/Creature/NPCHandler.h - Entities/Creature/TemporarySummon.cpp - Entities/Creature/TemporarySummon.h - Entities/GameObject/GameObject.cpp - Entities/GameObject/GameObject.h - Entities/Item/Bag.cpp - Entities/Item/Bag.h - Entities/Item/Item.cpp - Entities/Item/Item.h - Entities/Item/ItemEnchantmentMgr.cpp - Entities/Item/ItemEnchantmentMgr.h - Entities/Item/ItemHandler.cpp - Entities/Item/ItemPrototype.h - Entities/Object/Corpse.cpp - Entities/Object/Corpse.h - Entities/Object/DynamicObject.cpp - Entities/Object/DynamicObject.h - Entities/Object/ObjectAccessor.cpp - Entities/Object/ObjectAccessor.h - Entities/Object/Object.cpp - Entities/Object/ObjectDefines.h - Entities/Object/Object.h - Entities/Object/ObjectMgr.cpp - Entities/Object/ObjectMgr.h - Entities/Object/UpdateData.cpp - Entities/Object/UpdateData.h - Entities/Object/UpdateFields.h - Entities/Object/UpdateMask.h - Entities/Pet/Pet.cpp - Entities/Pet/Pet.h - Entities/Pet/PetHandler.cpp - Entities/Player/DuelHandler.cpp - Entities/Player/MiscHandler.cpp - Entities/Player/PetitionsHandler.cpp - Entities/Player/Player.cpp - Entities/Player/Player.h - Entities/Player/SocialMgr.cpp - Entities/Player/SocialMgr.h - Entities/Player/TicketHandler.cpp - Entities/Player/TradeHandler.cpp - Entities/Player/VoiceChatHandler.cpp - Entities/Player/CharacterHandler.cpp - Entities/Unit/StatSystem.cpp - Entities/Unit/Unit.cpp - Entities/Unit/Unit.h - Entities/Totem/Totem.cpp - Entities/Totem/Totem.h - Entities/Vehicle/Vehicle.cpp - Entities/Vehicle/Vehicle.h - Events/GameEventMgr.cpp - Events/GameEventMgr.h - Events/GlobalEvents.cpp - Events/GlobalEvents.h - Events/UnitEvents.h - Globals/Formulas.h - Globals/Language.h - Globals/SharedDefines.h - Groups/Group.cpp - Groups/Group.h - Groups/GroupHandler.cpp - Groups/GroupReference.cpp - Groups/GroupReference.h - Groups/GroupRefManager.h - Guilds/Guild.cpp - Guilds/Guild.h - Guilds/GuildHandler.cpp - Instances/InstanceData.cpp - Instances/InstanceData.h - Instances/InstanceSaveMgr.cpp - Instances/InstanceSaveMgr.h - LookingForGroup/LFG.h - LookingForGroup/LFGHandler.cpp - LookingForGroup/LFGMgr.cpp - LookingForGroup/LFGMgr.h - Loot/LootHandler.cpp - Loot/LootMgr.cpp - Loot/LootMgr.h - Mails/Mail.cpp - Mails/Mail.h - Map/Cell/Cell.h - Map/Cell/CellImpl.h - Map/Grid/GridDefines.h - Map/Grid/GridNotifiers.cpp - Map/Grid/GridNotifiers.h - Map/Grid/GridNotifiersImpl.h - Map/Grid/GridStates.cpp - Map/Grid/GridStates.h - Map/Grid/ObjectGridLoader.cpp - Map/Grid/ObjectGridLoader.h - Map/Map.cpp - Map/Map.h - Map/MapInstanced.cpp - Map/MapInstanced.h - Map/MapManager.cpp - Map/MapManager.h - Map/MapUpdater.cpp - Map/MapUpdater.h - Map/MapReference.h - Map/MapRefManager.h - Map/ObjectPosSelector.cpp - Map/ObjectPosSelector.h - Map/ZoneScript.h - Movement/MovementGenerators/ConfusedMovementGenerator.cpp - Movement/MovementGenerators/ConfusedMovementGenerator.h - Movement/MovementGenerators/FleeingMovementGenerator.cpp - Movement/MovementGenerators/FleeingMovementGenerator.h - Movement/MovementGenerators/HomeMovementGenerator.cpp - Movement/MovementGenerators/HomeMovementGenerator.h - Movement/MovementGenerators/IdleMovementGenerator.cpp - Movement/MovementGenerators/IdleMovementGenerator.h - Movement/MovementGenerators/MovementGenerator.cpp - Movement/MovementGenerators/MovementGenerator.h - Movement/MovementGenerators/MovementGeneratorImpl.h - Movement/MovementGenerators/PointMovementGenerator.cpp - Movement/MovementGenerators/PointMovementGenerator.h - Movement/MovementGenerators/RandomMovementGenerator.cpp - Movement/MovementGenerators/RandomMovementGenerator.h - Movement/MovementGenerators/TargetedMovementGenerator.cpp - Movement/MovementGenerators/TargetedMovementGenerator.h - Movement/MovementGenerators/WaypointMovementGenerator.cpp - Movement/MovementGenerators/WaypointMovementGenerator.h - Movement/DestinationHolder.cpp - Movement/DestinationHolder.h - Movement/DestinationHolderImp.h - Movement/FollowerReference.cpp - Movement/FollowerReference.h - Movement/FollowerRefManager.h - Movement/MotionMaster.cpp - Movement/MotionMaster.h - Movement/MovementHandler.cpp - Movement/Path.h - Movement/TaxiHandler.cpp - Movement/Transports.cpp - Movement/Transports.h - Movement/Traveller.h - Movement/WaypointManager.cpp - Movement/WaypointManager.h - Opcodes/Opcodes.cpp - Opcodes/Opcodes.h - OutdoorPvP/OutdoorPvP.cpp - OutdoorPvP/OutdoorPvP.h - OutdoorPvP/OutdoorPvPEP.cpp - OutdoorPvP/OutdoorPvPEP.h - OutdoorPvP/OutdoorPvPHP.cpp - OutdoorPvP/OutdoorPvPHP.h - OutdoorPvP/OutdoorPvPImpl.h - OutdoorPvP/OutdoorPvPMgr.cpp - OutdoorPvP/OutdoorPvPMgr.h - OutdoorPvP/OutdoorPvPNA.cpp - OutdoorPvP/OutdoorPvPNA.h - OutdoorPvP/OutdoorPvPSI.cpp - OutdoorPvP/OutdoorPvPSI.h - OutdoorPvP/OutdoorPvPTF.cpp - OutdoorPvP/OutdoorPvPTF.h - OutdoorPvP/OutdoorPvPZM.cpp - OutdoorPvP/OutdoorPvPZM.h - Pools/PoolHandler.cpp - Pools/PoolHandler.h - Quests/QueryHandler.cpp - Quests/QuestDef.cpp - Quests/QuestDef.h - Quests/QuestHandler.cpp - Reputation/ReputationMgr.cpp - Reputation/ReputationMgr.h - ScriptMgr/ScriptLoader.cpp - ScriptMgr/ScriptLoader.h - ScriptMgr/ScriptMgr.cpp - ScriptMgr/ScriptMgr.h - ScriptMgr/ScriptSystem.cpp - ScriptMgr/ScriptSystem.h - Skills/SkillHandler.cpp - Skills/SkillDiscovery.cpp - Skills/SkillDiscovery.h - Skills/SkillExtraItems.cpp - Skills/SkillExtraItems.h - Spells/Auras/SpellAuraDefines.h - Spells/Auras/SpellAuras.cpp - Spells/Auras/SpellAuras.h - Spells/Auras/SpellAuraEffects.cpp - Spells/Auras/SpellAuraEffects.h - Spells/Auras/SpellEffects.cpp - Spells/Spell.cpp - Spells/Spell.h - Spells/SpellHandler.cpp - Spells/SpellMgr.cpp - Spells/SpellMgr.h - Tools/PlayerDump.cpp - Tools/PlayerDump.h - Tools/Tools.cpp - Tools/Tools.h - Weather/Weather.cpp - Weather/Weather.h - World/World.cpp - World/World.h - World/WorldLog.cpp - World/WorldLog.h - World/WorldSession.cpp - World/WorldSession.h - World/WorldSocket.cpp - World/WorldSocket.h - World/WorldSocketMgr.cpp - World/WorldSocketMgr.h +######## game ######## + +# Enable precompiled headers when using the GCC compiler. +if(DO_PCH) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) +endif() + +# Create game-libary +set(game_STAT_SRCS + Accounts/AccountMgr.cpp + Achievements/AchievementMgr.cpp + Addons/AddonMgr.cpp + AI/CoreAI/CombatAI.cpp + AI/CoreAI/GuardAI.cpp + AI/CoreAI/PassiveAI.cpp + AI/CoreAI/PetAI.cpp + AI/CoreAI/ReactorAI.cpp + AI/CoreAI/TotemAI.cpp + AI/CoreAI/UnitAI.cpp + AI/EventAI/CreatureEventAI.cpp + AI/EventAI/CreatureEventAIMgr.cpp + AI/ScriptedAI/ScriptedSmartAI.cpp + AI/CreatureAIRegistry.cpp + AI/CreatureAISelector.cpp + AI/CreatureAI.cpp + AuctionHouse/AuctionHouseMgr.cpp + AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp + BattleGrounds/ArenaTeam.cpp + BattleGrounds/Zones/BattleGroundAA.cpp + BattleGrounds/Zones/BattleGroundAB.cpp + BattleGrounds/Zones/BattleGroundRB.cpp + BattleGrounds/Zones/BattleGroundAV.cpp + BattleGrounds/Zones/BattleGroundBE.cpp + BattleGrounds/Zones/BattleGroundDS.cpp + BattleGrounds/Zones/BattleGroundEY.cpp + BattleGrounds/Zones/BattleGroundIC.cpp + BattleGrounds/Zones/BattleGroundNA.cpp + BattleGrounds/Zones/BattleGroundRL.cpp + BattleGrounds/Zones/BattleGroundRV.cpp + BattleGrounds/Zones/BattleGroundSA.cpp + BattleGrounds/Zones/BattleGroundWS.cpp + BattleGrounds/BattleGround.cpp + BattleGrounds/BattleGroundMgr.cpp + Calendar/Calendar.cpp + Chat/Channels/Channel.cpp + Chat/Channels/ChannelMgr.cpp + Chat/Commands/Debugcmds.cpp + Chat/Commands/Level0.cpp + Chat/Commands/Level1.cpp + Chat/Commands/Level2.cpp + Chat/Commands/Level3.cpp + Chat/Chat.cpp + Combat/HostileRefManager.cpp + Combat/ThreatManager.cpp + Conditions/ConditionMgr.cpp + DataStores/DBCStores.cpp + DungeonFinding/LFGMgr.cpp + Entities/Corpse/Corpse.cpp + Entities/Creature/Creature.cpp + Entities/Creature/CreatureGroups.cpp + Entities/Creature/GossipDef.cpp + Entities/Creature/TemporarySummon.cpp + Entities/DynamicObject/DynamicObject.cpp + Entities/GameObject/GameObject.cpp + Entities/Item/Container/Bag.cpp + Entities/Item/Item.cpp + Entities/Item/ItemEnchantmentMgr.cpp + Entities/Object/Updates/UpdateData.cpp + Entities/Object/Object.cpp + Entities/Object/ObjectPosSelector.cpp + Entities/Pet/Pet.cpp + Entities/Player/Player.cpp + Entities/Player/SocialMgr.cpp + Entities/Unit/StatSystem.cpp + Entities/Unit/Unit.cpp + Entities/Totem/Totem.cpp + Entities/Transport/Transport.cpp + Entities/Vehicle/Vehicle.cpp + Events/GameEventMgr.cpp + Globals/GlobalEvents.cpp + Globals/ObjectAccessor.cpp + Globals/ObjectMgr.cpp + Grids/Notifiers/GridNotifiers.cpp + Grids/GridStates.cpp + Grids/ObjectGridLoader.cpp + Groups/Group.cpp + Groups/GroupReference.cpp + Guilds/Guild.cpp + Instances/InstanceData.cpp + Instances/InstanceSaveMgr.cpp + Loot/LootMgr.cpp + Mails/Mail.cpp + Maps/Map.cpp + Maps/MapInstanced.cpp + Maps/MapManager.cpp + Maps/MapUpdater.cpp + Movement/MovementGenerators/ConfusedMovementGenerator.cpp + Movement/MovementGenerators/FleeingMovementGenerator.cpp + Movement/MovementGenerators/HomeMovementGenerator.cpp + Movement/MovementGenerators/IdleMovementGenerator.cpp + Movement/MovementGenerators/PointMovementGenerator.cpp + Movement/MovementGenerators/RandomMovementGenerator.cpp + Movement/MovementGenerators/TargetedMovementGenerator.cpp + Movement/MovementGenerators/WaypointMovementGenerator.cpp + Movement/Waypoints/WaypointManager.cpp + Movement/DestinationHolder.cpp + Movement/FollowerReference.cpp + Movement/MotionMaster.cpp + Movement/MovementGenerator.cpp + OutdoorPvP/Zones/OutdoorPvPEP.cpp + OutdoorPvP/Zones/OutdoorPvPHP.cpp + OutdoorPvP/Zones/OutdoorPvPNA.cpp + OutdoorPvP/Zones/OutdoorPvPSI.cpp + OutdoorPvP/Zones/OutdoorPvPTF.cpp + OutdoorPvP/Zones/OutdoorPvPZM.cpp + OutdoorPvP/OutdoorPvP.cpp + OutdoorPvP/OutdoorPvPMgr.cpp + Pools/PoolMgr.cpp + Quests/QuestDef.cpp + Reputation/ReputationMgr.cpp + Scripting/ScriptLoader.cpp + Scripting/ScriptMgr.cpp + Scripting/ScriptSystem.cpp + Server/Protocol/Handlers/AddonHandler.cpp + Server/Protocol/Handlers/ArenaTeamHandler.cpp + Server/Protocol/Handlers/AuctionHouseHandler.cpp + Server/Protocol/Handlers/BattleGroundHandler.cpp + Server/Protocol/Handlers/CalendarHandler.cpp + Server/Protocol/Handlers/ChannelHandler.cpp + Server/Protocol/Handlers/CharacterHandler.cpp + Server/Protocol/Handlers/ChatHandler.cpp + Server/Protocol/Handlers/CombatHandler.cpp + Server/Protocol/Handlers/DuelHandler.cpp + Server/Protocol/Handlers/GroupHandler.cpp + Server/Protocol/Handlers/GuildHandler.cpp + Server/Protocol/Handlers/ItemHandler.cpp + Server/Protocol/Handlers/LFGHandler.cpp + Server/Protocol/Handlers/LootHandler.cpp + Server/Protocol/Handlers/MiscHandler.cpp + Server/Protocol/Handlers/MovementHandler.cpp + Server/Protocol/Handlers/NPCHandler.cpp + Server/Protocol/Handlers/PetHandler.cpp + Server/Protocol/Handlers/PetitionsHandler.cpp + Server/Protocol/Handlers/QueryHandler.cpp + Server/Protocol/Handlers/QuestHandler.cpp + Server/Protocol/Handlers/SkillHandler.cpp + Server/Protocol/Handlers/SpellHandler.cpp + Server/Protocol/Handlers/TaxiHandler.cpp + Server/Protocol/Handlers/TicketHandler.cpp + Server/Protocol/Handlers/TradeHandler.cpp + Server/Protocol/Handlers/VoiceChatHandler.cpp + Server/Protocol/Opcodes.cpp + Server/Protocol/WorldLog.cpp + Server/WorldSession.cpp + Server/WorldSocket.cpp + Server/WorldSocketMgr.cpp + Skills/SkillDiscovery.cpp + Skills/SkillExtraItems.cpp + Spells/Auras/SpellAuras.cpp + Spells/Auras/SpellAuraEffects.cpp + Spells/Auras/SpellEffects.cpp + Spells/Spell.cpp + Spells/SpellMgr.cpp + Tools/PlayerDump.cpp + Tools/Tools.cpp + Weather/Weather.cpp + World/World.cpp ) include_directories( - ${ACE_INCLUDE_DIR} ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/include - ${CMAKE_SOURCE_DIR}/src/server/framework + ${CMAKE_SOURCE_DIR}/externals/mersennetwister + ${CMAKE_SOURCE_DIR}/externals/zlib + ${CMAKE_SOURCE_DIR}/src/server/collision + ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/src/server/shared/vmap + ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication ${CMAKE_SOURCE_DIR}/src/server/shared/Database + ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores + ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/shared/Packets + ${CMAKE_SOURCE_DIR}/src/server/shared/Policies + ${CMAKE_SOURCE_DIR}/src/server/shared/Threading + ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities ${CMAKE_SOURCE_DIR}/src/server/game - ${CMAKE_SOURCE_DIR}/src/server/game/Account + ${CMAKE_SOURCE_DIR}/src/server/game/Accounts ${CMAKE_SOURCE_DIR}/src/server/game/Achievements ${CMAKE_SOURCE_DIR}/src/server/game/Addons ${CMAKE_SOURCE_DIR}/src/server/game/AI - ${CMAKE_SOURCE_DIR}/src/server/game/AI/AuctionHouseBot + ${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse + ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse/AuctionHouseBot ${CMAKE_SOURCE_DIR}/src/server/game/BattleGrounds + ${CMAKE_SOURCE_DIR}/src/server/game/BattleGrounds/Zones ${CMAKE_SOURCE_DIR}/src/server/game/Calendar ${CMAKE_SOURCE_DIR}/src/server/game/Chat + ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Channels + ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Commands ${CMAKE_SOURCE_DIR}/src/server/game/Combat - ${CMAKE_SOURCE_DIR}/src/server/game/ConditionMgr + ${CMAKE_SOURCE_DIR}/src/server/game/Conditions ${CMAKE_SOURCE_DIR}/src/server/game/DataStores + ${CMAKE_SOURCE_DIR}/src/server/game/DungeonFinding ${CMAKE_SOURCE_DIR}/src/server/game/Entities ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Creature + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Corpse + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/DynamicObject ${CMAKE_SOURCE_DIR}/src/server/game/Entities/GameObject ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object/Updates ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Pet ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Player ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Totem ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Unit ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Transport ${CMAKE_SOURCE_DIR}/src/server/game/Events ${CMAKE_SOURCE_DIR}/src/server/game/Globals + ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Cells + ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers + ${CMAKE_SOURCE_DIR}/src/server/game/Grids ${CMAKE_SOURCE_DIR}/src/server/game/Groups ${CMAKE_SOURCE_DIR}/src/server/game/Guilds ${CMAKE_SOURCE_DIR}/src/server/game/Instances - ${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup ${CMAKE_SOURCE_DIR}/src/server/game/Loot ${CMAKE_SOURCE_DIR}/src/server/game/Mails - ${CMAKE_SOURCE_DIR}/src/server/game/Map - ${CMAKE_SOURCE_DIR}/src/server/game/Map/Cell - ${CMAKE_SOURCE_DIR}/src/server/game/Map/Grid + ${CMAKE_SOURCE_DIR}/src/server/game/Maps + ${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous ${CMAKE_SOURCE_DIR}/src/server/game/Movement ${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators - ${CMAKE_SOURCE_DIR}/src/server/game/Opcodes + ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP + ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP/Zones ${CMAKE_SOURCE_DIR}/src/server/game/Pools + ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders ${CMAKE_SOURCE_DIR}/src/server/game/Quests ${CMAKE_SOURCE_DIR}/src/server/game/Reputation - ${CMAKE_SOURCE_DIR}/src/server/game/ScriptMgr + ${CMAKE_SOURCE_DIR}/src/server/game/Scripting + ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol + ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers + ${CMAKE_SOURCE_DIR}/src/server/game/Server ${CMAKE_SOURCE_DIR}/src/server/game/Skills ${CMAKE_SOURCE_DIR}/src/server/game/Spells ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras @@ -375,33 +265,37 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Weather ${CMAKE_SOURCE_DIR}/src/server/game/World ${MYSQL_INCLUDE_DIR} + ${ACE_INCLUDE_DIR} ) if(NOT DO_SCRIPTS) - SET(game_STAT_SRCS ${game_STAT_SRCS} - AI/ScriptedAI/ScriptedEscortAI.cpp - AI/ScriptedAI/ScriptedEscortAI.h - ScriptMgr/ScriptedPch.cpp - ScriptMgr/ScriptedPch.h - AI/ScriptedAI/ScriptedCreature.cpp - AI/ScriptedAI/ScriptedCreature.h - AI/ScriptedAI/ScriptedFollowerAI.cpp - AI/ScriptedAI/ScriptedFollowerAI.h - AI/ScriptedAI/ScriptedGossip.h - AI/ScriptedAI/ScriptedGuardAI.cpp - AI/ScriptedAI/ScriptedGuardAI.h - AI/ScriptedAI/ScriptedInstance.h - AI/ScriptedAI/ScriptedSimpleAI.cpp - AI/ScriptedAI/ScriptedSimpleAI.h - ) - message("-- Added Script Engine to GAME lib") -endif(NOT DO_SCRIPTS) + set(game_STAT_SRCS + ${game_STAT_SRCS} + AI/ScriptedAI/ScriptedEscortAI.cpp + AI/ScriptedAI/ScriptedCreature.cpp + AI/ScriptedAI/ScriptedFollowerAI.cpp + AI/ScriptedAI/ScriptedGuardAI.cpp + AI/ScriptedAI/ScriptedSimpleAI.cpp + ) + message("-- Added basic scriptAI-engines to GAME library") +endif() + +# Add gamePCH.cpp to project on Windows +if(MSVC) + set(game_STAT_SRCS + PrecompiledHeaders/gamePCH.cpp + ${game_STAT_SRCS}) +endif() add_library(game STATIC ${game_STAT_SRCS}) -ADD_DEPENDENCIES(game revision.h) + +add_dependencies(game revision.h) # Generate precompiled header -IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) - ADD_PRECOMPILED_HEADER(game ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/pchlinux.h) -ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) - +if(DO_PCH) + if(CMAKE_COMPILER_IS_GNUCXX) + add_precompiled_header(game ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/gamePCH.h) + elseif(MSVC) + add_native_precompiled_header(game ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/gamePCH) + endif() +endif() diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 0047892972b..bb70e54354c 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -707,6 +707,14 @@ void Channel::Invite(uint64 p, const char *newname) return; } + if (IsBanned(newp->GetGUID())) + { + WorldPacket data; + MakePlayerInviteBanned(&data, newname); + SendToOne(&data, p); + return; + } + Player *plr = objmgr.GetPlayer(p); if (!plr) return; @@ -983,10 +991,10 @@ void Channel::MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good) } // done 0x16 -void Channel::MakePlayerNotBanned(WorldPacket *data, uint64 guid) +void Channel::MakePlayerNotBanned(WorldPacket *data, const std::string &name) { MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE); - *data << uint64(guid); + *data << name; } // done 0x17 @@ -1035,10 +1043,10 @@ void Channel::MakePlayerInvited(WorldPacket *data, const std::string& name) } // done 0x1E -void Channel::MakePlayerInviteBanned(WorldPacket *data, uint64 guid) +void Channel::MakePlayerInviteBanned(WorldPacket *data, const std::string& name) { MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE); - *data << uint64(guid); + *data << name; } // done 0x1F diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h index d0b5923e30e..a52a697cba1 100644 --- a/src/server/game/Chat/Channels/Channel.h +++ b/src/server/game/Chat/Channels/Channel.h @@ -187,7 +187,7 @@ class Channel void MakeBanned(WorldPacket *data); //? 0x13 void MakePlayerBanned(WorldPacket *data, uint64 bad, uint64 good); //? 0x14 void MakePlayerUnbanned(WorldPacket *data, uint64 bad, uint64 good); //? 0x15 - void MakePlayerNotBanned(WorldPacket *data, uint64 guid); //? 0x16 + void MakePlayerNotBanned(WorldPacket *data, const std::string& name); //? 0x16 void MakePlayerAlreadyMember(WorldPacket *data, uint64 guid); //+ 0x17 void MakeInvite(WorldPacket *data, uint64 guid); //? 0x18 void MakeInviteWrongFaction(WorldPacket *data); //? 0x19 @@ -195,7 +195,7 @@ class Channel void MakeInvalidName(WorldPacket *data); //? 0x1B void MakeNotModerated(WorldPacket *data); //? 0x1C void MakePlayerInvited(WorldPacket *data, const std::string& name); //+ 0x1D - void MakePlayerInviteBanned(WorldPacket *data, uint64 guid); //? 0x1E + void MakePlayerInviteBanned(WorldPacket *data, const std::string &name);//? 0x1E void MakeThrottled(WorldPacket *data); //? 0x1F void MakeNotInArea(WorldPacket *data); //? 0x20 void MakeNotInLfg(WorldPacket *data); //? 0x21 diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index f31d3ffde50..b72a2698d3a 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -17,21 +17,18 @@ */ #include "ChannelMgr.h" -#include "Policies/SingletonImp.h" -#include "World.h" -INSTANTIATE_SINGLETON_1(AllianceChannelMgr); -INSTANTIATE_SINGLETON_1(HordeChannelMgr); +#include "World.h" ChannelMgr* channelMgr(uint32 team) { if (sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) - return &Trinity::Singleton::Instance(); // cross-faction + return ACE_Singleton::instance(); // cross-faction if (team == ALLIANCE) - return &Trinity::Singleton::Instance(); + return ACE_Singleton::instance(); if (team == HORDE) - return &Trinity::Singleton::Instance(); + return ACE_Singleton::instance(); return NULL; } diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h index 6f3b7c415ae..c4e872de6b6 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.h +++ b/src/server/game/Chat/Channels/ChannelMgr.h @@ -22,14 +22,11 @@ #include "Common.h" #include "Channel.h" -#include "Policies/Singleton.h" +#include "ace/Singleton.h" #include #include -#include "Policies/Singleton.h" - -#include "Channel.h" #include "World.h" class ChannelMgr diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 6e1adffa625..f62dee975da 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -23,7 +23,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSession.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "AccountMgr.h" #include "CellImpl.h" @@ -133,11 +133,13 @@ ChatCommand * ChatHandler::getCommandTable() static ChatCommand channelSetCommandTable[] = { { "public", SEC_ADMINISTRATOR, true, &ChatHandler::HandleChannelSetPublic, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand channelCommandTable[] = { { "set", SEC_ADMINISTRATOR, true, NULL, "", channelSetCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand debugPlayCommandTable[] = @@ -460,6 +462,7 @@ ChatCommand * ChatHandler::getCommandTable() { "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand,"",NULL }, { "creature_linked_respawn", SEC_GAMEMASTER, true, &ChatHandler::HandleReloadCreatureLinkedRespawnCommand, "", NULL }, { "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL }, + { "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadOnKillReputationCommand, "", NULL }, { "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL }, { "creature_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureTemplateCommand, "", NULL }, //{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL }, @@ -476,10 +479,12 @@ ChatCommand * ChatHandler::getCommandTable() { "gossip_menu_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuOptionCommand, "", NULL }, { "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL }, { "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL }, + { "item_set_names", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemSetNamesCommand, "", NULL }, { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesAchievementRewardCommand,"", NULL }, { "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL }, { "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL }, { "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL }, + { "locales_item_set_name", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemSetNameCommand, "", NULL }, { "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPointsOfInterestCommand, "", NULL }, diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 58e6f6214c8..6b102129c8a 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -364,6 +364,7 @@ class ChatHandler bool HandleReloadEventAISummonsCommand(const char* args); bool HandleReloadEventAIScriptsCommand(const char* args); bool HandleReloadCommandCommand(const char* args); + bool HandleReloadOnKillReputationCommand(const char* args); bool HandleReloadCreatureTemplateCommand(const char* args); bool HandleReloadCreatureQuestRelationsCommand(const char* args); bool HandleReloadCreatureQuestInvRelationsCommand(const char* args); @@ -377,10 +378,12 @@ class ChatHandler bool HandleReloadGOQuestRelationsCommand(const char* args); bool HandleReloadGOQuestInvRelationsCommand(const char* args); bool HandleReloadItemEnchantementsCommand(const char* args); + bool HandleReloadItemSetNamesCommand(const char* args); bool HandleReloadLocalesAchievementRewardCommand(const char* args); bool HandleReloadLocalesCreatureCommand(const char* args); bool HandleReloadLocalesGameobjectCommand(const char* args); bool HandleReloadLocalesItemCommand(const char* args); + bool HandleReloadLocalesItemSetNameCommand(const char* args); bool HandleReloadLocalesNpcTextCommand(const char* args); bool HandleReloadLocalesPageTextCommand(const char* args); bool HandleReloadLocalesPointsOfInterestCommand(const char* args); diff --git a/src/server/game/Chat/Commands/Debugcmds.cpp b/src/server/game/Chat/Commands/Debugcmds.cpp index ee8c623c3d0..a6c973ea002 100644 --- a/src/server/game/Chat/Commands/Debugcmds.cpp +++ b/src/server/game/Chat/Commands/Debugcmds.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "Vehicle.h" #include "Player.h" diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index ed021ac00d4..ff266caa328 100644 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "World.h" #include "Player.h" #include "Opcodes.h" @@ -87,7 +87,7 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/) } // cast spell Stuck - chr->CastSpell(chr,7355,false); + chr->CastSpell(chr, 7355, false); return true; } @@ -103,14 +103,6 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/) uint32 updateTime = sWorld.GetUpdateTime(); PSendSysMessage(_FULLVERSION); - //if (m_session) - // full = _FULLVERSION(REVISION_DATE,REVISION_TIME,"|cffffffff|Hurl:" REVISION_ID "|h" REVISION_ID "|h|r"); - //else - // full = _FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_ID); - - //SendSysMessage(full); - //PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion()); - //PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion()); PSendSysMessage(LANG_CONNECTED_PLAYERS, PlayersNum, MaxPlayersNum); PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); PSendSysMessage(LANG_UPTIME, uptime.c_str()); @@ -143,9 +135,9 @@ bool ChatHandler::HandleDismountCommand(const char* /*args*/) bool ChatHandler::HandleSaveCommand(const char* /*args*/) { - Player *player=m_session->GetPlayer(); + Player *player = m_session->GetPlayer(); - // save GM account without delay and output message (testing, etc) + // save GM account without delay and output message if (m_session->GetSecurity() > SEC_PLAYER) { player->SaveToDB(); @@ -153,9 +145,9 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) return true; } - // save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning + // save if the player has last been saved over 20 seconds ago uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE); - if ((save_interval == 0 || save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS)) + if ((save_interval == 0 || save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS)) player->SaveToDB(); return true; @@ -165,8 +157,8 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) { bool first = true; - ObjectAccessor::Guard guard(*HashMapHolder::GetLock()); - HashMapHolder::MapType &m = ObjectAccessor::Instance().GetPlayers(); + ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder::GetLock(), true); + HashMapHolder::MapType &m = sObjectAccessor.GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { AccountTypes itr_sec = itr->second->GetSession()->GetSecurity(); @@ -192,35 +184,42 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) bool ChatHandler::HandleAccountPasswordCommand(const char* args) { if (!*args) + { + SendSysMessage(LANG_CMD_SYNTAX); + SetSentErrorMessage(true); return false; + } - char *old_pass = strtok ((char*)args, " "); - char *new_pass = strtok (NULL, " "); - char *new_pass_c = strtok (NULL, " "); + char *old_pass = strtok((char*)args, " "); + char *new_pass = strtok(NULL, " "); + char *new_pass_c = strtok(NULL, " "); if (!old_pass || !new_pass || !new_pass_c) + { + SendSysMessage(LANG_CMD_SYNTAX); + SetSentErrorMessage(true); return false; + } std::string password_old = old_pass; std::string password_new = new_pass; std::string password_new_c = new_pass_c; - if (strcmp(new_pass, new_pass_c) != 0) + if (!accmgr.CheckPassword(m_session->GetAccountId(), password_old)) { - SendSysMessage (LANG_NEW_PASSWORDS_NOT_MATCH); - SetSentErrorMessage (true); + SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); + SetSentErrorMessage(true); return false; } - if (!accmgr.CheckPassword (m_session->GetAccountId(), password_old)) + if (strcmp(new_pass, new_pass_c) != 0) { - SendSysMessage (LANG_COMMAND_WRONGOLDPASSWORD); - SetSentErrorMessage (true); + SendSysMessage(LANG_NEW_PASSWORDS_NOT_MATCH); + SetSentErrorMessage(true); return false; } AccountOpResult result = accmgr.ChangePassword(m_session->GetAccountId(), password_new); - switch(result) { case AOR_OK: @@ -230,7 +229,6 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args) SendSysMessage(LANG_PASSWORD_TOO_LONG); SetSentErrorMessage(true); return false; - case AOR_NAME_NOT_EXIST: // not possible case, don't want get account name for output default: SendSysMessage(LANG_COMMAND_NOTCHANGEPASSWORD); SetSentErrorMessage(true); @@ -243,15 +241,23 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args) bool ChatHandler::HandleAccountAddonCommand(const char* args) { if (!*args) + { + SendSysMessage(LANG_CMD_SYNTAX); + SetSentErrorMessage(true); return false; + } - char *szExp = strtok((char*)args," "); + char *szExp = strtok((char*)args, " "); uint32 account_id = m_session->GetAccountId(); - int expansion=atoi(szExp); //get int anyway (0 if error) + int expansion = atoi(szExp); //get int anyway (0 if error) if (expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION)) - return false; + { + SendSysMessage(LANG_IMPROPER_VALUE); + SetSentErrorMessage(true); + return false; + } // No SQL injection LoginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'", expansion, account_id); @@ -264,7 +270,8 @@ bool ChatHandler::HandleAccountLockCommand(const char* args) if (!*args) { SendSysMessage(LANG_USE_BOL); - return true; + SetSentErrorMessage(true); + return false; } std::string argstr = (char*)args; @@ -283,7 +290,8 @@ bool ChatHandler::HandleAccountLockCommand(const char* args) } SendSysMessage(LANG_USE_BOL); - return true; + SetSentErrorMessage(true); + return false; } /// Display the 'Message of the day' for the realm diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 11189d519a0..771339645fe 100644 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "WorldSession.h" #include "World.h" @@ -817,7 +817,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args) if (pMap->IsBattleGroundOrArena()) { // only allow if gm mode is on - if (!target->isGameMaster()) + if (!_player->isGameMaster()) { PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,nameLink.c_str()); SetSentErrorMessage(true); @@ -2381,7 +2381,7 @@ bool ChatHandler::HandleWhispersCommand(const char* args) //Save all players in the world bool ChatHandler::HandleSaveAllCommand(const char* /*args*/) { - ObjectAccessor::Instance().SaveAllPlayers(); + sObjectAccessor.SaveAllPlayers(); SendSysMessage(LANG_PLAYERS_SAVED); return true; } @@ -2502,7 +2502,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args) PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), GetTrinityString(LANG_OFFLINE), tele->name.c_str()); Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation, - MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); + sMapMgr.GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); } return true; @@ -2768,7 +2768,7 @@ bool ChatHandler::HandleGoXYCommand(const char* args) else _player->SaveRecallPosition(); - Map const *map = MapManager::Instance().CreateBaseMap(mapid); + Map const *map = sMapMgr.CreateBaseMap(mapid); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); @@ -2861,7 +2861,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args) // update to parent zone if exist (client map show only zones without parents) AreaTableEntry const* zoneEntry = areaEntry->zone ? GetAreaEntryByAreaID(areaEntry->zone) : areaEntry; - Map const *map = MapManager::Instance().CreateBaseMap(zoneEntry->mapid); + Map const *map = sMapMgr.CreateBaseMap(zoneEntry->mapid); if (map->Instanceable()) { @@ -2936,7 +2936,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args) else _player->SaveRecallPosition(); - Map const *map = MapManager::Instance().CreateBaseMap(mapid); + Map const *map = sMapMgr.CreateBaseMap(mapid); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 4f299c932e8..77716e25954 100644 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "DBCStores.h" #include "ObjectMgr.h" #include "Player.h" @@ -32,7 +32,7 @@ #include "World.h" #include "GameEventMgr.h" #include "SpellMgr.h" -#include "PoolHandler.h" +#include "PoolMgr.h" #include "AccountMgr.h" #include "WaypointManager.h" #include "Util.h" @@ -1672,7 +1672,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/) if (/*creature->GetMotionMaster()->empty() ||*/ creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != TARGETED_MOTION_TYPE) { - PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU); + PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); SetSentErrorMessage(true); return false; } @@ -1682,7 +1682,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/) if (mgen->GetTarget() != player) { - PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU); + PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); SetSentErrorMessage(true); return false; } @@ -2844,7 +2844,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args) // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); wpCreature2->LoadFromDB(wpCreature2->GetDBTableGUIDLow(), map); map->Add(wpCreature2); - //MapManager::Instance().GetMap(npcCreature->GetMapId())->Add(wpCreature2); + //sMapMgr.GetMap(npcCreature->GetMapId())->Add(wpCreature2); } WorldDatabase.PExecuteLog("UPDATE waypoint_data SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'", diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 8ac26cc5e8f..3ddf9b84365 100644 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "WorldSession.h" #include "World.h" @@ -45,7 +45,7 @@ #include "SkillDiscovery.h" #include "SkillExtraItems.h" #include "SystemConfig.h" -#include "Config/ConfigEnv.h" +#include "ConfigEnv.h" #include "Util.h" #include "ItemEnchantmentMgr.h" #include "BattleGroundMgr.h" @@ -689,7 +689,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/) { sLog.outString("Re-Loading config settings..."); sWorld.LoadConfigSettings(true); - MapManager::Instance().InitializeVisibilityDistanceInfo(); + sMapMgr.InitializeVisibilityDistanceInfo(); SendGlobalGMSysMessage("World config settings reloaded."); return true; } @@ -749,6 +749,14 @@ bool ChatHandler::HandleReloadCommandCommand(const char*) return true; } +bool ChatHandler::HandleReloadOnKillReputationCommand(const char*) +{ + sLog.outString("Re-Loading creature award reputation definitions..."); + objmgr.LoadReputationOnKill(); + SendGlobalGMSysMessage("DB table `creature_onkill_reputation` reloaded."); + return true; +} + bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args) { if (!*args) @@ -787,24 +795,21 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args) size_t len = 0; if (const char* temp = fields[9].GetString()) { - if (cInfo->Name) - delete cInfo->Name; + delete[] cInfo->Name; len = strlen(temp)+1; const_cast(cInfo)->Name = new char[len]; strncpy(cInfo->Name, temp, len); } if (const char* temp = fields[10].GetString()) { - if (cInfo->SubName) - delete cInfo->SubName; + delete[] cInfo->SubName; len = strlen(temp)+1; const_cast(cInfo)->SubName = new char[len]; strncpy(cInfo->SubName, temp, len); } if (const char* temp = fields[11].GetString()) { - if (cInfo->IconName) - delete cInfo->IconName; + delete[] cInfo->IconName; len = strlen(temp)+1; const_cast(cInfo)->IconName = new char[len]; strncpy(cInfo->IconName, temp, len); @@ -863,8 +868,7 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args) const_cast(cInfo)->maxgold = fields[63].GetUInt32(); if (const char* temp = fields[64].GetString()) { - if (cInfo->AIName) - delete cInfo->AIName; + delete[] cInfo->AIName; len = strlen(temp)+1; const_cast(cInfo)->AIName = new char[len]; strncpy(const_cast(cInfo->AIName), temp, len); @@ -1276,6 +1280,14 @@ bool ChatHandler::HandleReloadItemEnchantementsCommand(const char*) return true; } +bool ChatHandler::HandleReloadItemSetNamesCommand(const char*) +{ + sLog.outString("Re-Loading Item set names..."); + LoadRandomEnchantmentsTable(); + SendGlobalGMSysMessage("DB table `item_set_names` reloaded."); + return true; +} + bool ChatHandler::HandleReloadGameObjectScriptsCommand(const char* arg) { if (sWorld.IsScriptScheduled()) @@ -1494,6 +1506,14 @@ bool ChatHandler::HandleReloadLocalesItemCommand(const char* /*arg*/) return true; } +bool ChatHandler::HandleReloadLocalesItemSetNameCommand(const char* /*arg*/) +{ + sLog.outString("Re-Loading Locales Item set name... "); + objmgr.LoadItemSetNameLocales(); + SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded."); + return true; +} + bool ChatHandler::HandleReloadLocalesNpcTextCommand(const char* /*arg*/) { sLog.outString("Re-Loading Locales NPC Text ... "); @@ -4493,7 +4513,7 @@ bool ChatHandler::HandleReviveCommand(const char *args) } else // will resurrected at login without corpse - ObjectAccessor::Instance().ConvertCorpseForPlayer(target_guid); + sObjectAccessor.ConvertCorpseForPlayer(target_guid); return true; } @@ -5513,8 +5533,8 @@ bool ChatHandler::HandleResetAllCommand(const char * args) CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin); - ObjectAccessor::Guard guard(*HashMapHolder::GetLock()); - HashMapHolder::MapType const& plist = ObjectAccessor::Instance().GetPlayers(); + ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder::GetLock(), true); + HashMapHolder::MapType const& plist = sObjectAccessor.GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) itr->second->SetAtLoginFlag(atLogin); @@ -7000,8 +7020,8 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args) bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/) { - PSendSysMessage("instances loaded: %d", MapManager::Instance().GetNumInstances()); - PSendSysMessage("players in instances: %d", MapManager::Instance().GetNumPlayersInInstances()); + PSendSysMessage("instances loaded: %d", sMapMgr.GetNumInstances()); + PSendSysMessage("players in instances: %d", sMapMgr.GetNumPlayersInInstances()); PSendSysMessage("instance saves: %d", sInstanceSaveManager.GetNumInstanceSaves()); PSendSysMessage("players bound: %d", sInstanceSaveManager.GetNumBoundPlayersTotal()); PSendSysMessage("groups bound: %d", sInstanceSaveManager.GetNumBoundGroupsTotal()); diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h index 80b676312a1..0a240ad44be 100644 --- a/src/server/game/Combat/HostileRefManager.h +++ b/src/server/game/Combat/HostileRefManager.h @@ -22,7 +22,7 @@ #define _HOSTILEREFMANAGER #include "Common.h" -#include "Utilities/LinkedReference/RefManager.h" +#include "RefManager.h" class Unit; class ThreatManager; diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 52f02f0f66d..fbf5a80d42b 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -36,8 +36,13 @@ float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float fThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell) { if (pThreatSpell) + { + if (pThreatSpell->AttributesEx & SPELL_ATTR_EX_NO_THREAT) + return 0.0f; + if (Player* modOwner = pHatedUnit->GetSpellModOwner()) modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, fThreat); + } return pHatedUnit->ApplyTotalThreatModifier(fThreat, schoolMask); } diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index 723a553e9d7..2903fe83c38 100644 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -23,7 +23,7 @@ #include "Common.h" #include "SharedDefines.h" -#include "Utilities/LinkedReference/Reference.h" +#include "LinkedReference/Reference.h" #include "UnitEvents.h" #include @@ -35,7 +35,7 @@ class Creature; class ThreatManager; struct SpellEntry; -#define THREAT_UPDATE_INTERVAL 1 * IN_MILISECONDS // Server should send threat update to client periodically each second +#define THREAT_UPDATE_INTERVAL 1 * IN_MILLISECONDS // Server should send threat update to client periodically each second //============================================================== // Class to calculate the real threat based diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 8e5a7e5677e..9164f55c6ce 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -19,7 +19,7 @@ */ -#include "Policies/SingletonImp.h" + #include "Player.h" #include "SpellAuras.h" #include "SpellMgr.h" @@ -29,12 +29,10 @@ #include "InstanceData.h" #include "ConditionMgr.h" -INSTANTIATE_SINGLETON_1(ConditionMgr); - // Checks if player meets the condition // Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: eventAI) bool Condition::Meets(Player * player, Unit* targetOverride) -{ +{ if (!player) { sLog.outDebug("Condition player not found"); @@ -126,7 +124,7 @@ bool Condition::Meets(Player * player, Unit* targetOverride) break; } case CONDITION_SPELL_SCRIPT_TARGET: - condMeets = true;//spell target condition is handled in spellsystem, here it is always true + condMeets = true;//spell target condition is handled in spellsystem, here it is always true refId = 0;//cant have references! use CONDITION_SOURCE_TYPE_SPELL for it break; case CONDITION_CREATURE_TARGET: @@ -165,7 +163,7 @@ bool Condition::Meets(Player * player, Unit* targetOverride) break; case CONDITION_ITEM_TARGET: { - condMeets = true;//handled in Item::IsTargetValidForItemUse + condMeets = true;//handled in Item::IsTargetValidForItemUse refId = 0;//cant have references for now break; } @@ -201,6 +199,7 @@ ConditionMgr::ConditionMgr() ConditionMgr::~ConditionMgr() { + Clean(); } ConditionList ConditionMgr::GetConditionReferences(uint32 refId) @@ -236,12 +235,12 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionLis }else{ sLog.outDebug("IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->mReferenceId);//checked at loading, should never happen } - + } else//handle normal condition { if (!(*i)->Meets(player, targetOverride)) ElseGroupMap[(*i)->mElseGroup] = false; - } + } } } for (std::map::const_iterator i = ElseGroupMap.begin(); i != ElseGroupMap.end(); ++i) @@ -273,7 +272,7 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType { ConditionMap::const_iterator itr = m_ConditionMap.find(sType); if (itr != m_ConditionMap.end()) - { + { ConditionTypeMap::const_iterator i = (*itr).second.find(uEntry); if (i != (*itr).second.end()) { @@ -287,8 +286,8 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType void ConditionMgr::LoadConditions(bool isReload) { - m_ConditionMap.clear(); // for reload case - m_ConditionReferenceMap.clear(); // for reload case + Clean(); + //must clear all custom handled cases (groupped types) before reload if (isReload) { @@ -336,11 +335,11 @@ void ConditionMgr::LoadConditions(bool isReload) Field *fields = result->Fetch(); Condition* cond = new Condition(); - int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); + int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); cond->mSourceGroup = fields[1].GetUInt32(); cond->mSourceEntry = fields[2].GetUInt32(); cond->mElseGroup = fields[3].GetUInt32(); - int32 iConditionTypeOrReference = fields[4].GetInt32(); + int32 iConditionTypeOrReference = fields[4].GetInt32(); cond->mConditionValue1 = fields[5].GetUInt32(); cond->mConditionValue2 = fields[6].GetUInt32(); cond->mConditionValue3 = fields[7].GetUInt32(); @@ -351,9 +350,10 @@ void ConditionMgr::LoadConditions(bool isReload) if (iConditionTypeOrReference < 0)//it has a reference { - if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skipp + if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip { sLog.outErrorDb("Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId); + delete cond; continue; } cond->mReferenceId = uint32(abs(iConditionTypeOrReference)); @@ -373,8 +373,10 @@ void ConditionMgr::LoadConditions(bool isReload) if (cond->mSourceEntry && iSourceTypeOrReferenceId < 0) sLog.outErrorDb("Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->mSourceEntry); }else if (!isConditionTypeValid(cond))//doesn't have reference, validate ConditionType - continue; - + { + delete cond; + continue; + } if (iSourceTypeOrReferenceId < 0)//it is a reference template { @@ -390,15 +392,19 @@ void ConditionMgr::LoadConditions(bool isReload) }//end of reference templates cond->mSourceType = ConditionSourceType(iSourceTypeOrReferenceId); - + //if not a reference and SourceType is invalid, skip if (iConditionTypeOrReference >= 0 && !isSourceTypeValid(cond)) + { + delete cond; continue; + } //Grouping is only allowed for some types (loot templates, gossip menus, gossip items) if (cond->mSourceGroup && !isGroupable(cond->mSourceType)) { sLog.outErrorDb("Condition type %u has not allowed grouping %u!", uint32(cond->mSourceType), cond->mSourceGroup); + delete cond; continue; }else if (cond->mSourceGroup) { @@ -450,9 +456,15 @@ void ConditionMgr::LoadConditions(bool isReload) break; } if (!bIsDone) + { sLog.outErrorDb("Not handled grouped condition, SourceGroup %u", cond->mSourceGroup); + delete cond; + } else + { + m_AllocatedMemory.push_back(cond); ++count; + } continue; } @@ -505,11 +517,10 @@ bool ConditionMgr::addToGossipMenus(Condition* cond) if ((*itr).second.entry == cond->mSourceGroup && (*itr).second.text_id == cond->mSourceEntry) { (*itr).second.conditions.push_back(cond); - sLog.outDebug("addToGossipMenus: entry %u textId %u", cond->mSourceGroup, cond->mSourceEntry); return true; } } - } + } sLog.outErrorDb("addToGossipMenus: GossipMenu %u not found", cond->mSourceGroup); return false; } @@ -524,12 +535,11 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond) if ((*itr).second.menu_id == cond->mSourceGroup && (*itr).second.id == cond->mSourceEntry) { (*itr).second.conditions.push_back(cond); - //sLog.outDebug("addToGossipMenuItems: menuId %u id %u", cond->mSourceGroup, cond->mSourceEntry); return true; } } } - sLog.outErrorDb("addToGossipMenuItems: GossipMenuIt %u Item %u not found", cond->mSourceGroup, cond->mSourceEntry); + sLog.outErrorDb("addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->mSourceGroup, cond->mSourceEntry); return false; } @@ -591,7 +601,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) break; } case CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE: - { + { if (!LootTemplates_Gameobject.HaveLootFor(cond->mSourceGroup)) { sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->mSourceGroup); @@ -607,7 +617,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) break; } case CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE: - { + { if (!LootTemplates_Item.HaveLootFor(cond->mSourceGroup)) { sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->mSourceGroup); @@ -776,7 +786,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) return false; } break; - } + } case CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE: { if (!sCreatureStorage.LookupEntry(cond->mSourceEntry)) @@ -1043,10 +1053,10 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { sLog.outErrorDb("SpellTarget condition has non existing spell target type (%u), skipped", cond->mConditionValue1); return false; - } + } switch(cond->mConditionValue1) { - case SPELL_TARGET_TYPE_GAMEOBJECT: + case SPELL_TARGET_TYPE_GAMEOBJECT: { if (cond->mConditionValue2 && !sGOStorage.LookupEntry(cond->mConditionValue2)) { @@ -1143,3 +1153,31 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } return true; } + +void ConditionMgr::Clean() +{ + for (ConditionReferenceMap::iterator itr = m_ConditionReferenceMap.begin(); itr != m_ConditionReferenceMap.end(); ++itr) + { + for (ConditionList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) + delete *it; + itr->second.clear(); + } + m_ConditionReferenceMap.clear(); + + for (ConditionMap::iterator itr = m_ConditionMap.begin(); itr != m_ConditionMap.end(); ++itr) + { + for (ConditionTypeMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + { + for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) + delete *i; + it->second.clear(); + } + itr->second.clear(); + } + m_ConditionMap.clear(); + + // this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;) + for (std::list::const_iterator itr = m_AllocatedMemory.begin(); itr != m_AllocatedMemory.end(); ++itr) + delete *itr; + m_AllocatedMemory.clear(); +} diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index bc2ce8d01a2..bb9fc2708fa 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -47,7 +47,7 @@ enum ConditionType CONDITION_CLASS = 15, // class 0 +referenceID true if player's class is equal to class CONDITION_RACE = 16, // race 0 +referenceID true if player's race is equal to race CONDITION_ACHIEVEMENT = 17, // achievement_id 0 +referenceID true if achievement is complete - CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0 + CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0 CONDITION_CREATURE_TARGET = 19, // creature entry 0 +referenceID true if current target is creature with value1 entry CONDITION_TARGET_HEALTH_BELOW_PCT = 20, // 0-100 0 +referenceID true if target's health is below value1 percent, false if over or no target CONDITION_TARGET_RANGE = 21, // minDistance maxDist +referenceID true if target is closer then minDist and further then maxDist or if max is 0 then max dist is infinit @@ -84,7 +84,7 @@ enum ConditionSourceType #define MAX_CONDITIONSOURCETYPE 19 struct Condition -{ +{ ConditionSourceType mSourceType; //SourceTypeOrReferenceId uint32 mSourceGroup; uint32 mSourceEntry; @@ -121,14 +121,16 @@ typedef std::map ConditionReferenceMap;//only used for r class ConditionMgr { + friend class ACE_Singleton; + ConditionMgr(); + public: - ConditionMgr(); ~ConditionMgr(); void LoadConditions(bool isReload = false); bool isConditionTypeValid(Condition* cond); ConditionList GetConditionReferences(uint32 refId); - + bool IsPlayerMeetToConditions(Player* player, ConditionList conditions, Unit* targetOverride = NULL); ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sType, uint32 uEntry); @@ -160,8 +162,11 @@ class ConditionMgr sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION); } + + void Clean(); // free up resources + std::list m_AllocatedMemory; // some garbage collection :) }; -#define sConditionMgr Trinity::Singleton::Instance() +#define sConditionMgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index ba0e3af9a64..4ddccd735f5 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -19,8 +19,8 @@ */ #include "DBCStores.h" -#include "Policies/SingletonImp.h" -#include "Log.h" + +#include "Logging/Log.h" #include "ProgressBar.h" #include "SharedDefines.h" #include "SpellMgr.h" @@ -235,15 +235,15 @@ inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList else errlist.push_back(dbc_filename); } - if (sql) - delete sql; + + delete sql; } void LoadDBCStores(const std::string& dataPath) { std::string dbcPath = dataPath+"dbc/"; - const uint32 DBCFilesCount = 87; + const uint32 DBCFilesCount = 89; barGoLink bar(DBCFilesCount); @@ -506,8 +506,7 @@ void LoadDBCStores(const std::string& dataPath) // fill data for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i) if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i)) - sTaxiPathNodesByPath[entry->path][entry->index] = TaxiPathNode(entry->mapid,entry->x,entry->y,entry->z,entry->actionFlag,entry->delay); - sTaxiPathNodeStore.Clear(); + sTaxiPathNodesByPath[entry->path].set(entry->index, entry); // Initialize global taxinodes mask // include existed nodes that have at least single not spell base (scripted) path @@ -579,7 +578,7 @@ void LoadDBCStores(const std::string& dataPath) // error checks if (bad_dbc_files.size() >= DBCFilesCount) { - sLog.outError("\nIncorrect DataDir value in Trinityd.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str()); + sLog.outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str()); exit(1); } else if (!bad_dbc_files.empty()) @@ -593,13 +592,13 @@ void LoadDBCStores(const std::string& dataPath) } // Check loaded DBC files proper version - if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.3a - !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.3a - !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.3a - !sItemStore.LookupEntry(54860) || // last gem property added in 3.3.3a - !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.3a - !sMapStore.LookupEntry(724) || // last map added in 3.3.3a - !sSpellStore.LookupEntry(76567) ) // last client known item added in 3.3.3a + if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a + !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a + !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a + !sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a + !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a + !sMapStore.LookupEntry(724) || // last map added in 3.3.5a + !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a { sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client."); exit(1); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index b14814e07a1..1bda56f38cc 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -20,7 +20,7 @@ #define TRINITY_DBCSTORES_H #include "Common.h" -#include "Database/DBCStore.h" +#include "DBCStore.h" #include "DBCStructure.h" #include diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 0fc0d1251f5..7663aaf3dcb 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -21,8 +21,10 @@ #ifndef TRINITY_DBCSTRUCTURE_H #define TRINITY_DBCSTRUCTURE_H +#include "Common.h" #include "DBCEnums.h" -#include "Platform/Define.h" +#include "Define.h" +#include "Path.h" #include "Util.h" #include @@ -1080,12 +1082,14 @@ struct ItemRandomSuffixEntry uint32 prefix[5]; // 22-24 m_allocationPct }; +#define MAX_ITEM_SET_ITEMS 10 struct ItemSetEntry { //uint32 id // 0 m_ID char* name[16]; // 1-16 m_name_lang // 17 string flags, unused - //uint32 itemId[17]; // 18-34 m_itemID + uint32 itemId[MAX_ITEM_SET_ITEMS]; // 18-27 m_itemID + //uint32 unknown[7]; // 28-34 unk, all 0 uint32 spells[8]; // 35-42 m_setSpellID uint32 items_to_triggerspell[8]; // 43-50 m_setThreshold uint32 required_skill_id; // 51 m_requiredSkill @@ -1509,9 +1513,6 @@ struct SpellEntry //uint32 spellDescriptionVariableID; // 232 3.2.0 //uint32 SpellDifficultyId; // 233 3.3.0 - // helpers - int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(1); } - private: // prevent creating custom entries (copy data from original in fact) SpellEntry(SpellEntry const&); // DON'T must have implementation @@ -1712,8 +1713,8 @@ struct TaxiPathNodeEntry float z; // 6 m_LocZ uint32 actionFlag; // 7 m_flags uint32 delay; // 8 m_delay - // 9 m_arrivalEventID - // 10 m_departureEventID + uint32 arrivalEventID; // 9 m_arrivalEventID + uint32 departureEventID; // 10 m_departureEventID }; struct TotemCategoryEntry @@ -1909,19 +1910,15 @@ struct TaxiPathBySourceAndDestination typedef std::map TaxiPathSetForSource; typedef std::map TaxiPathSetBySource; -struct TaxiPathNode +struct TaxiPathNodePtr { - TaxiPathNode() : mapid(0), x(0),y(0),z(0),actionFlag(0),delay(0) {} - TaxiPathNode(uint32 _mapid, float _x, float _y, float _z, uint32 _actionFlag, uint32 _delay) : mapid(_mapid), x(_x),y(_y),z(_z),actionFlag(_actionFlag),delay(_delay) {} - - uint32 mapid; - float x; - float y; - float z; - uint32 actionFlag; - uint32 delay; + TaxiPathNodePtr() : i_ptr(NULL) {} + TaxiPathNodePtr(TaxiPathNodeEntry const* ptr) : i_ptr(ptr) {} + TaxiPathNodeEntry const* i_ptr; + operator TaxiPathNodeEntry const& () const { return *i_ptr; } }; -typedef std::vector TaxiPathNodeList; + +typedef Path TaxiPathNodeList; typedef std::vector TaxiPathNodesByPath; #define TaxiMaskSize 12 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 1f1b010a6fd..80d8791bd01 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -72,7 +72,7 @@ const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix"; const char ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxix"; const char ItemRandomPropertiesfmt[]="nxiiiiissssssssssssssssx"; const char ItemRandomSuffixfmt[]="nssssssssssssssssxxiiiiiiiiii"; -const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii"; +const char ItemSetEntryfmt[]="dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; const char LFGDungeonEntryfmt[]="nxxxxxxxxxxxxxxxxxiiiiiiixixxixixxxxxxxxxxxxxxxxx"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx"; @@ -95,7 +95,7 @@ const std::string CustomSpellDifficultyfmt="ppppp"; const std::string CustomSpellDifficultyIndex="id"; const char SpellDurationfmt[]="niii"; const char SpellEntryfmt[]="niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxxx"; -const std::string CustomSpellEntryfmt="pappppppppaaaaaapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; +const std::string CustomSpellEntryfmt="pappppppppaapapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx"; const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiiiii"; @@ -110,7 +110,7 @@ const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx"; const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix"; const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii"; const char TaxiPathEntryfmt[]="niii"; -const char TaxiPathNodeEntryfmt[]="diiifffiixx"; +const char TaxiPathNodeEntryfmt[]="diiifffiiii"; const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; diff --git a/src/server/game/DungeonFinding/LFG.h b/src/server/game/DungeonFinding/LFG.h index c1b55443852..a5461029c8d 100644 --- a/src/server/game/DungeonFinding/LFG.h +++ b/src/server/game/DungeonFinding/LFG.h @@ -19,7 +19,7 @@ #ifndef _LFG_H #define _LFG_H -#include "Platform/Define.h" +#include "Define.h" #include "Object.h" enum LfgRoles diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index ba418cdb191..6c089a83bc3 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Policies/SingletonImp.h" + #include "Common.h" #include "SharedDefines.h" #include "Group.h" @@ -24,8 +24,6 @@ #include "ObjectMgr.h" #include "WorldPacket.h" -INSTANTIATE_SINGLETON_1(LFGMgr); - /*********************************************************/ /*** LFG QUEUES ***/ /*********************************************************/ @@ -46,8 +44,7 @@ LFGQueue::~LFGQueue() void LFGQueue::AddToQueue(uint64 guid, LfgQueueInfo* pqInfo) { - if (LfgQueueInfo* qInfo = m_LfgQueue[guid]) - delete qInfo; + delete m_LfgQueue[guid]; m_LfgQueue[guid] = pqInfo; // ATM will only add it to the queue... No find group implementation... yet (on purpose) } diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index b19da4e3d00..88d33743fa9 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -20,7 +20,7 @@ #define _LFGMGR_H #include "Common.h" -#include "Policies/Singleton.h" +#include "ace/Singleton.h" #include "Group.h" #include "LFG.h" @@ -237,43 +237,44 @@ typedef std::map LFGQueueMap; class LFGMgr { -public: + friend class ACE_Singleton; LFGMgr(); - ~LFGMgr(); + public: + ~LFGMgr(); - void InitLFG(); - void SendLfgPlayerInfo(Player *plr); - void SendLfgPartyInfo(Player *plr); - void Join(Player *plr); - void Leave(Player *plr, Group *grp = NULL); - void UpdateRoleCheck(Group *grp, Player *plr = NULL); - void Update(uint32 diff); + void InitLFG(); + void SendLfgPlayerInfo(Player *plr); + void SendLfgPartyInfo(Player *plr); + void Join(Player *plr); + void Leave(Player *plr, Group *grp = NULL); + void UpdateRoleCheck(Group *grp, Player *plr = NULL); + void Update(uint32 diff); -private: - void BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck); - void BuildAvailableRandomDungeonList(WorldPacket &data, Player *plr); - void BuildRewardBlock(WorldPacket &data, uint32 dungeon, Player *plr); - void BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet); - void BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap); - bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true); + private: + void BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck); + void BuildAvailableRandomDungeonList(WorldPacket &data, Player *plr); + void BuildRewardBlock(WorldPacket &data, uint32 dungeon, Player *plr); + void BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet); + void BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap); + bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true); - LfgLockStatusMap* GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons); - LfgLockStatusSet* GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons); - LfgDungeonSet* GetRandomDungeons(uint8 level, uint8 expansion); - LfgDungeonSet* GetDungeonsByRandom(uint32 randomdungeon); - LfgDungeonSet* GetAllDungeons(); - LfgReward* GetRandomDungeonReward(uint32 dungeon, bool done, uint8 level); - uint8 GetDungeonGroupType(uint32 dungeon); + LfgLockStatusMap* GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons); + LfgLockStatusSet* GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons); + LfgDungeonSet* GetRandomDungeons(uint8 level, uint8 expansion); + LfgDungeonSet* GetDungeonsByRandom(uint32 randomdungeon); + LfgDungeonSet* GetAllDungeons(); + LfgReward* GetRandomDungeonReward(uint32 dungeon, bool done, uint8 level); + uint8 GetDungeonGroupType(uint32 dungeon); - LfgRewardList m_RewardList; - LfgRewardList m_RewardDoneList; - LfgDungeonMap m_DungeonsMap; + LfgRewardList m_RewardList; + LfgRewardList m_RewardDoneList; + LfgDungeonMap m_DungeonsMap; - LFGQueueMap m_Queues; - LfgRoleCheckMap m_RoleChecks; - uint32 m_QueueTimer; - bool m_update; + LFGQueueMap m_Queues; + LfgRoleCheckMap m_RoleChecks; + uint32 m_QueueTimer; + bool m_update; }; -#define sLFGMgr Trinity::Singleton::Instance() +#define sLFGMgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 510ea13e78b..2811cfa129f 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -23,7 +23,7 @@ #include "Player.h" #include "UpdateMask.h" #include "ObjectAccessor.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Opcodes.h" #include "GossipDef.h" #include "World.h" @@ -54,7 +54,7 @@ void Corpse::AddToWorld() { ///- Register the corpse for guid lookup if (!IsInWorld()) - ObjectAccessor::Instance().AddObject(this); + sObjectAccessor.AddObject(this); Object::AddToWorld(); } @@ -63,7 +63,7 @@ void Corpse::RemoveFromWorld() { ///- Remove the corpse from the accessor if (IsInWorld()) - ObjectAccessor::Instance().RemoveObject(this); + sObjectAccessor.RemoveObject(this); Object::RemoveFromWorld(); } diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index bab95e99d14..3ba00cec3b1 100644 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -22,7 +22,7 @@ #define TRINITYCORE_CORPSE_H #include "Object.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "GridDefines.h" #include "LootMgr.h" diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index fbfae17a48b..7e79dc42664 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "World.h" #include "ObjectMgr.h" @@ -28,7 +28,7 @@ #include "QuestDef.h" #include "GossipDef.h" #include "Player.h" -#include "PoolHandler.h" +#include "PoolMgr.h" #include "Opcodes.h" #include "Log.h" #include "LootMgr.h" @@ -49,7 +49,7 @@ #include "Vehicle.h" #include "SpellAuraEffects.h" // apply implementation of the singletons -#include "Policies/SingletonImp.h" + TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const { @@ -171,11 +171,8 @@ Creature::~Creature() { m_vendorItemCounts.clear(); - if (i_AI) - { - delete i_AI; - i_AI = NULL; - } + delete i_AI; + i_AI = NULL; //if (m_uint32Values) // sLog.outError("Deconstruct Creature Entry = %u", GetEntry()); @@ -188,7 +185,7 @@ void Creature::AddToWorld() { if (m_zoneScript) m_zoneScript->OnCreatureCreate(this, true); - ObjectAccessor::Instance().AddObject(this); + sObjectAccessor.AddObject(this); Unit::AddToWorld(); SearchFormation(); AIM_Initialize(); @@ -206,7 +203,7 @@ void Creature::RemoveFromWorld() if (m_formation) formation_mgr.RemoveCreatureFromGroup(m_formation, this); Unit::RemoveFromWorld(); - ObjectAccessor::Instance().RemoveObject(this); + sObjectAccessor.RemoveObject(this); } } @@ -413,13 +410,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) if (isTrigger()) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (isTotem() || isTrigger() - || GetCreatureType() == CREATURE_TYPE_CRITTER) - SetReactState(REACT_PASSIVE); - /*else if (isCivilian()) - SetReactState(REACT_DEFENSIVE);*/ - else - SetReactState(REACT_AGGRESSIVE); + InitializeReactState(); if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_NO_TAUNT) { @@ -629,7 +620,7 @@ void Creature::RegenerateMana() if ((*i)->GetMiscValue() == POWER_MANA) addvalue *= ((*i)->GetAmount() + 100) / 100.0f; - addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) * CREATURE_REGEN_INTERVAL / (5 * IN_MILISECONDS); + addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) * CREATURE_REGEN_INTERVAL / (5 * IN_MILLISECONDS); ModifyPower(POWER_MANA, addvalue); } @@ -666,7 +657,7 @@ void Creature::RegenerateHealth() for (AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i) addvalue *= ((*i)->GetAmount() + 100) / 100.0f; - addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * CREATURE_REGEN_INTERVAL / (5 * IN_MILISECONDS); + addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * CREATURE_REGEN_INTERVAL / (5 * IN_MILLISECONDS); ModifyHealth(addvalue); } @@ -721,7 +712,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai) Motion_Initialize(); i_AI = ai ? ai : FactorySelector::selectAI(this); - if (oldAI) delete oldAI; + delete oldAI; IsAIEnabled = true; i_AI->InitializeAI(); return true; @@ -1271,16 +1262,26 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) } } - uint32 curhealth = data->curhealth; - if (curhealth) + uint32 curhealth; + + if (!m_regenHealth) { - curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank)); - if (curhealth < 1) - curhealth = 1; + curhealth = data->curhealth; + if (curhealth) + { + curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank)); + if (curhealth < 1) + curhealth = 1; + } + SetPower(POWER_MANA,data->curmana); + } + else + { + curhealth = GetMaxHealth(); + SetPower(POWER_MANA,GetMaxPower(POWER_MANA)); } SetHealth(m_deathState == ALIVE ? curhealth : 0); - SetPower(POWER_MANA,data->curmana); // checked at creature_template loading m_defaultMovementType = MovementGeneratorType(data->movementType); @@ -1472,7 +1473,7 @@ void Creature::setDeathState(DeathState s) { if ((s == JUST_DIED && !m_isDeadByDefault)||(s == JUST_ALIVED && m_isDeadByDefault)) { - m_deathTimer = m_corpseDelay*IN_MILISECONDS; + m_deathTimer = m_corpseDelay*IN_MILLISECONDS; // always save boss respawn time at death to prevent crash cheating if (sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss()) @@ -1605,6 +1606,9 @@ void Creature::Respawn(bool force) uint16 poolid = GetDBTableGUIDLow() ? poolhandler.IsPartOfAPool(GetDBTableGUIDLow()) : 0; if (poolid) poolhandler.UpdatePool(poolid, GetDBTableGUIDLow()); + + //Re-initialize reactstate that could be altered by movementgenerators + InitializeReactState(); } UpdateObjectVisibility(); @@ -1983,7 +1987,7 @@ void Creature::SaveRespawnTime() if (m_respawnTime > time(NULL)) // dead (no corpse) objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); else if (m_deathTimer > 0) // dead (corpse) - objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS); + objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILLISECONDS); } // this should not be called by petAI or @@ -2166,7 +2170,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid) modOwner->ApplySpellMod(spellid, SPELLMOD_COOLDOWN, cooldown); if (cooldown) - _AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILISECONDS); + _AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILLISECONDS); if (spellInfo->Category) _AddCreatureCategoryCooldown(spellInfo->Category, time(NULL)); @@ -2185,7 +2189,7 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const return true; CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category); - return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILISECONDS)) > time(NULL)); + return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILLISECONDS)) > time(NULL)); } bool Creature::HasSpellCooldown(uint32 spell_id) const @@ -2209,7 +2213,7 @@ time_t Creature::GetRespawnTimeEx() const if (m_respawnTime > now) // dead (no corpse) return m_respawnTime; else if (m_deathTimer > 0) // dead (corpse) - return now+m_respawnDelay+m_deathTimer/IN_MILISECONDS; + return now+m_respawnDelay+m_deathTimer/IN_MILLISECONDS; else return now; } @@ -2251,7 +2255,7 @@ void Creature::AllLootRemovedFromCorpse() // corpse was not skinnable -> apply corpse looted timer if (!cinfo || !cinfo->SkinLootId) - nDeathTimer = (uint32)((m_corpseDelay * IN_MILISECONDS) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED)); + nDeathTimer = (uint32)((m_corpseDelay * IN_MILLISECONDS) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED)); // corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update else nDeathTimer = 0; @@ -2413,7 +2417,7 @@ time_t Creature::GetLinkedCreatureRespawnTime() const if (data->mapid == GetMapId()) // look up on the same map targetMap = GetMap(); else // it shouldn't be instanceable map here - targetMap = MapManager::Instance().FindMap(data->mapid); + targetMap = sMapMgr.FindMap(data->mapid); } if (targetMap) return objmgr.GetCreatureRespawnTime(targetGuid,targetMap->GetInstanceId()); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index d2d93d787da..203106f635e 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -26,7 +26,7 @@ #include "UpdateMask.h" #include "ItemPrototype.h" #include "LootMgr.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Cell.h" #include @@ -66,7 +66,7 @@ enum CreatureFlagsExtra #endif #define MAX_KILL_CREDIT 2 -#define CREATURE_REGEN_INTERVAL 2 * IN_MILISECONDS +#define CREATURE_REGEN_INTERVAL 2 * IN_MILLISECONDS // from `creature_template` table struct CreatureInfo @@ -314,6 +314,9 @@ struct VendorItem int32 maxcount; // 0 for infinity item amount uint32 incrtime; // time for restore items amount if maxcount != 0 uint32 ExtendedCost; + + //helpers + bool IsGoldRequired(ItemPrototype const* pProto) const { return pProto->Flags2 & ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD || !ExtendedCost; } }; typedef std::vector VendorItemList; @@ -424,9 +427,20 @@ class Creature : public Unit, public GridObject bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } //bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } + void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } bool HasReactState(ReactStates state) const { return (m_reactState == state); } + void InitializeReactState() + { + if (isTotem() || isTrigger() || GetCreatureType() == CREATURE_TYPE_CRITTER) + SetReactState(REACT_PASSIVE); + else + SetReactState(REACT_AGGRESSIVE); + /*else if (isCivilian()) + SetReactState(REACT_DEFENSIVE);*/; + } + ///// TODO RENAME THIS!!!!! bool isCanTrainingOf(Player* player, bool msg) const; bool isCanInteractWithBattleMaster(Player* player, bool msg) const; @@ -607,10 +621,10 @@ class Creature : public Unit, public GridObject bool hasInvolvedQuest(uint32 quest_id) const; bool isRegeneratingHealth() { return m_regenHealth; } - virtual uint8 GetPetAutoSpellSize() const { return CREATURE_MAX_SPELLS; } + virtual uint8 GetPetAutoSpellSize() const { return MAX_SPELL_CHARM; } virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const { - if (pos >= CREATURE_MAX_SPELLS || m_charmInfo->GetCharmSpell(pos)->GetType() != ACT_ENABLED) + if (pos >= MAX_SPELL_CHARM || m_charmInfo->GetCharmSpell(pos)->GetType() != ACT_ENABLED) return 0; else return m_charmInfo->GetCharmSpell(pos)->GetAction(); @@ -696,7 +710,7 @@ class Creature : public Unit, public GridObject bool DisableReputationGain; - CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from ObjMgr::GetCreatureTemplate(GetEntry()) + CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from objmgr.::GetCreatureTemplate(GetEntry()) CreatureData const* m_creatureData; uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index c2af59458f7..7bd05123ec5 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -22,13 +22,11 @@ #include "CreatureGroups.h" #include "ObjectMgr.h" #include "ProgressBar.h" -#include "Policies/SingletonImp.h" + #include "CreatureAI.h" #define MAX_DESYNC 5.0f -INSTANTIATE_SINGLETON_1(CreatureGroupManager); - CreatureGroupInfoType CreatureGroupMap; void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member) diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index 521586b7457..4aa49571b5d 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -35,12 +35,15 @@ struct FormationInfo class CreatureGroupManager { + friend class ACE_Singleton; public: void AddCreatureToGroup(uint32 group_id, Creature *creature); void RemoveCreatureFromGroup(CreatureGroup *group, Creature *creature); void LoadCreatureFormations(); }; +#define formation_mgr (*ACE_Singleton::instance()) + typedef UNORDERED_MAP CreatureGroupInfoType; extern CreatureGroupInfoType CreatureGroupMap; @@ -73,6 +76,4 @@ class CreatureGroup void MemberAttackStart(Creature* member, Unit *target); }; -#define formation_mgr Trinity::Singleton::Instance() - #endif diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 3e0fec52bc7..cbbe7dc052b 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -522,7 +522,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, } // rewarded honor points. Multiply with 10 to satisfy client - data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); + data << 10 * Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()); data << float(0); // new 3.3.0, honor multiplier? data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << int32(pQuest->GetRewSpellCast()); // casted spell @@ -616,7 +616,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest) data << int32(pQuest->GetRewSpellCast()); // casted spell // rewarded honor points - data << uint32(Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); + data << Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()); data << float(0); // new reward honor (multipled by ~62 at client side) data << uint32(pQuest->GetSrcItemId()); // source item id data << uint32(pQuest->GetFlags() & 0xFFFF); // quest flags @@ -775,7 +775,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST)); // rewarded honor points. Multiply with 10 to satisfy client - data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); + data << 10 * Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()); data << float(0); // unk, honor multiplier? data << uint32(0x08); // unused by client? data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 48179190a6e..529710eda90 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -23,7 +23,7 @@ #include "Opcodes.h" #include "World.h" #include "ObjectAccessor.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "GridNotifiers.h" #include "CellImpl.h" #include "GridNotifiersImpl.h" @@ -46,7 +46,7 @@ void DynamicObject::AddToWorld() ///- Register the dynamicObject for guid lookup if (!IsInWorld()) { - ObjectAccessor::Instance().AddObject(this); + sObjectAccessor.AddObject(this); WorldObject::AddToWorld(); } } @@ -69,7 +69,7 @@ void DynamicObject::RemoveFromWorld() } } WorldObject::RemoveFromWorld(); - ObjectAccessor::Instance().RemoveObject(this); + sObjectAccessor.RemoveObject(this); } } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 596b156bd35..c2458a181a5 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -22,14 +22,14 @@ #include "QuestDef.h" #include "GameObject.h" #include "ObjectMgr.h" -#include "PoolHandler.h" +#include "PoolMgr.h" #include "SpellMgr.h" #include "Spell.h" #include "UpdateMask.h" #include "Opcodes.h" #include "WorldPacket.h" #include "World.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "LootMgr.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" @@ -117,7 +117,7 @@ void GameObject::AddToWorld() if (m_zoneScript) m_zoneScript->OnGameObjectCreate(this, true); - ObjectAccessor::Instance().AddObject(this); + sObjectAccessor.AddObject(this); WorldObject::AddToWorld(); } } @@ -139,7 +139,7 @@ void GameObject::RemoveFromWorld() sLog.outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid)); } WorldObject::RemoveFromWorld(); - ObjectAccessor::Instance().RemoveObject(this); + sObjectAccessor.RemoveObject(this); } } @@ -1626,7 +1626,7 @@ void GameObject::TakenDamage(uint32 damage, Unit *who) if (m_goValue->building.health <= m_goInfo->building.damagedNumHits) { if (!m_goInfo->building.destroyedDisplayId) - m_goValue->building.health = 0; + m_goValue->building.health = m_goInfo->building.damagedNumHits; else if (!m_goValue->building.health) m_goValue->building.health = 1; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 2154adf80c0..2c1765ea14e 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -25,7 +25,7 @@ #include "SharedDefines.h" #include "Object.h" #include "LootMgr.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform #if defined(__GNUC__) @@ -479,7 +479,7 @@ struct GameObjectInfo case GAMEOBJECT_TYPE_AREADAMAGE: autoCloseTime = areadamage.autoCloseTime; break; default: break; } - return autoCloseTime / IN_MILISECONDS; // prior to 3.0.3, conversion was / 0x10000; + return autoCloseTime / IN_MILLISECONDS; // prior to 3.0.3, conversion was / 0x10000; } uint32 GetLootId() const @@ -500,6 +500,16 @@ struct GameObjectInfo default: return 0; } } + uint32 GetEventScriptId() const + { + switch(type) + { + case GAMEOBJECT_TYPE_GOOBER: return goober.eventId; + case GAMEOBJECT_TYPE_CHEST: return chest.eventId; + case GAMEOBJECT_TYPE_CAMERA: return camera.eventID; + default: return 0; + } + } }; class OPvPCapturePoint; diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index aa78126b198..12fd9efee28 100644 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -20,7 +20,7 @@ #include "Common.h" #include "ObjectMgr.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Bag.h" #include "Log.h" @@ -117,11 +117,8 @@ bool Bag::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) { SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (i*2), 0); - if (m_bagslot[i]) - { - delete m_bagslot[i]; - m_bagslot[i] = NULL; - } + delete m_bagslot[i]; + m_bagslot[i] = NULL; } return true; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 5c2d94d399b..52d9daeb4c8 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -18,11 +18,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include + #include "Common.h" #include "Item.h" #include "ObjectMgr.h" #include "WorldPacket.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "ItemEnchantmentMgr.h" #include "SpellMgr.h" #include "ScriptMgr.h" @@ -633,7 +635,7 @@ void Item::SetState(ItemUpdateState state, Player *forplayer) { // pretend the item never existed RemoveFromUpdateQueueOf(forplayer); - forplayer->DeleteRefundReference(GetGUID()); + forplayer->DeleteRefundReference(GetGUIDLow()); delete this; return; } @@ -834,7 +836,7 @@ bool Item::IsTargetValidForItemUse(Unit* pUnitTarget) for (ConditionList::const_iterator itr = conditions.begin(); itr != conditions.end(); ++itr) { - ItemRequiredTarget *irt = new ItemRequiredTarget((ItemRequiredTargetType)(*itr)->mConditionValue1, (*itr)->mConditionValue2); + ACE_Auto_Ptr irt(new ItemRequiredTarget((ItemRequiredTargetType)(*itr)->mConditionValue1, (*itr)->mConditionValue2)); if (irt->IsFitToRequirements(pUnitTarget)) return true; } @@ -1035,20 +1037,11 @@ bool Item::IsBindedNotWith(Player const* player) const if (GetOwnerGUID() == player->GetGUID()) return false; - // not BOA item case - if (!IsBoundAccountWide()) - return true; - - // online - if (Player* owner = objmgr.GetPlayer(GetOwnerGUID())) - { - return owner->GetSession()->GetAccountId() != player->GetSession()->GetAccountId(); - } - // offline slow case - else - { - return objmgr.GetPlayerAccountIdByGUID(GetOwnerGUID()) != player->GetSession()->GetAccountId(); - } + // BOA item case + if (IsBoundAccountWide()) + return false; + + return true; } bool ItemRequiredTarget::IsFitToRequirements(Unit* pUnitTarget) const @@ -1106,7 +1099,7 @@ void Item::SetNotRefundable(Player *owner, bool changestate) SetPaidExtendedCost(0); DeleteRefundDataFromDB(); - owner->DeleteRefundReference(GetGUID()); + owner->DeleteRefundReference(GetGUIDLow()); } void Item::UpdatePlayedTime(Player *owner) @@ -1147,4 +1140,4 @@ uint32 Item::GetPlayedTime() bool Item::IsRefundExpired() { return (GetPlayedTime() > 2*HOUR); -} \ No newline at end of file +} diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 8594ea864ba..440ea0027e8 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -21,7 +21,7 @@ #include #include #include "ItemEnchantmentMgr.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "ObjectMgr.h" #include "ProgressBar.h" @@ -91,18 +91,10 @@ uint32 GetItemEnchantMod(int32 entry) if (!entry) return 0; - EnchantmentStore::const_iterator tab; - if (entry == -1) - { - tab = RandomItemEnch.begin(); - entry = urand(1, RandomItemEnch.size()) - 1; - for (uint32 i = 0; i < entry; ++i) - ++tab; - } - else - tab = RandomItemEnch.find(entry); - + return 0; + + EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry); if (tab == RandomItemEnch.end()) { sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry); diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 31025005a15..1a91ad10c6b 100644 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -111,8 +111,9 @@ enum ITEM_FLAGS ITEM_FLAGS_OPENABLE = 0x00000004, ITEM_FLAGS_WRAPPED = 0x00000008, ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability == 0) - ITEM_FLAGS_TOTEM = 0x00000020, // ? + ITEM_FLAGS_INDESTRUCTIBLE = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell and then allowed) ITEM_FLAGS_USABLE = 0x00000040, // ? + ITEM_FLAGS_NO_EQUIP_COOLDOWN = 0x00000080, // ? ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper ITEM_FLAGS_PARTY_LOOT = 0x00000800, // determines if item is party loot or not ITEM_FLAGS_REFUNDABLE = 0x00001000, // item cost can be refunded within 2 hours after purchase @@ -135,7 +136,7 @@ enum ItemFlagsExtra { ITEM_FLAGS_EXTRA_HORDE_ONLY = 0x00000001, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY = 0x00000002, - ITEM_FLAGS_EXTRA_REFUNDABLE = 0x00000004, + ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD = 0x00000004, // when item uses extended cost, gold is also required ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100 }; @@ -623,7 +624,7 @@ struct ItemPrototype uint32 GetMaxStackSize() const { - return (Stackable == 2147483647 || Stackable <= 0 || Stackable == 1000) ? uint32(0x7FFFFFFF-1) : uint32(Stackable); + return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable); } float getDPS() const @@ -661,6 +662,17 @@ struct ItemLocale std::vector Description; }; +struct ItemSetNameEntry +{ + std::string name; + uint32 InventoryType; +}; + +struct ItemSetNameLocale +{ + std::vector Name; +}; + // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack() diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2a7397db8b8..fe4b8673b8f 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -35,7 +35,7 @@ #include "MapManager.h" #include "ObjectAccessor.h" #include "Log.h" -#include "Transports.h" +#include "Transport.h" #include "TargetedMovementGenerator.h" #include "WaypointMovementGenerator.h" #include "VMapFactory.h" @@ -110,16 +110,12 @@ Object::~Object() { sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry()); assert(false); - ObjectAccessor::Instance().RemoveUpdateObject(this); + sObjectAccessor.RemoveUpdateObject(this); } - if (m_uint32Values) - { - //DEBUG_LOG("Object desctr 1 check (%p)",(void*)this); - delete [] m_uint32Values; - delete [] m_uint32Values_mirror; - //DEBUG_LOG("Object desctr 2 check (%p)",(void*)this); - } + delete [] m_uint32Values; + delete [] m_uint32Values_mirror; + } void Object::_InitValues() @@ -299,7 +295,11 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const { //WPAssert(this->ToPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE); - FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(const_cast(this->ToPlayer())->GetMotionMaster()->top()); + Player *player = const_cast(this)->ToPlayer(); + if (!player) + return; + + FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(player->GetMotionMaster()->top()); uint32 flags3 = MOVEFLAG_GLIDE; @@ -324,10 +324,10 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const } } - Path &path = fmg->GetPath(); + TaxiPathNodeList& path = const_cast(fmg->GetPath()); float x, y, z; - this->ToPlayer()->GetPosition(x, y, z); + player->GetPosition(x, y, z); uint32 inflighttime = uint32(path.GetPassedLength(fmg->GetCurrentNode(), x, y, z) * 32); uint32 traveltime = uint32(path.GetTotalLength() * 32); @@ -342,21 +342,21 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << uint32(0); // added in 3.1 - uint32 poscount = uint32(path.Size()); + uint32 poscount = uint32(path.size()); *data << uint32(poscount); // points count for (uint32 i = 0; i < poscount; ++i) { - *data << path.GetNodes()[i].x; - *data << path.GetNodes()[i].y; - *data << path.GetNodes()[i].z; + *data << float(path[i].x); + *data << float(path[i].y); + *data << float(path[i].z); } *data << uint8(0); // added in 3.0.8 - *data << path.GetNodes()[poscount-1].x; - *data << path.GetNodes()[poscount-1].y; - *data << path.GetNodes()[poscount-1].z; + *data << float(path[poscount-1].x); + *data << float(path[poscount-1].y); + *data << float(path[poscount-1].z); } } else @@ -731,7 +731,7 @@ void Object::ClearUpdateMask(bool remove) if (m_objectUpdated) { if (remove) - ObjectAccessor::Instance().RemoveUpdateObject(this); + sObjectAccessor.RemoveUpdateObject(this); m_objectUpdated = false; } } @@ -804,7 +804,7 @@ void Object::SetInt32Value(uint16 index, int32 value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -823,7 +823,7 @@ void Object::SetUInt32Value(uint16 index, uint32 value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -849,7 +849,7 @@ void Object::SetUInt64Value(uint16 index, const uint64 &value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -868,7 +868,7 @@ bool Object::AddUInt64Value(uint16 index, const uint64 &value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -889,7 +889,7 @@ bool Object::RemoveUInt64Value(uint16 index, const uint64 &value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -910,7 +910,7 @@ void Object::SetFloatValue(uint16 index, float value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -936,7 +936,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -962,7 +962,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -1031,7 +1031,7 @@ void Object::SetFlag(uint16 index, uint32 newFlag) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -1052,7 +1052,7 @@ void Object::RemoveFlag(uint16 index, uint32 oldFlag) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -1077,7 +1077,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -1102,7 +1102,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } @@ -1379,28 +1379,15 @@ bool Position::HasInArc(float arc, const Position *obj) const return true; // move arc to range 0.. 2*pi - while (arc >= 2.0f * M_PI) - arc -= 2.0f * M_PI; - while (arc < 0) - arc += 2.0f * M_PI; + arc = MapManager::NormalizeOrientation(arc); float angle = GetAngle(obj); angle -= m_orientation; - //if (angle > 100 || angle < -100) - //{ - // sLog.outCrash("Invalid Angle %f: this %u %u %f %f %f %f, that %u %u %f %f %f %f", angle, - // GetEntry(), GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), - // obj->GetEntry(), obj->GetGUIDLow(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); - // assert(false); - // return false; - //} - // move angle to range -pi ... +pi - while (angle > M_PI) - angle -= 2.0f * M_PI; - while (angle < -M_PI) - angle += 2.0f * M_PI; + angle = MapManager::NormalizeOrientation(angle); + if(angle > M_PI) + angle -= 2.0f*M_PI; float lborder = -1 * (arc/2.0f); // in range -pi..0 float rborder = (arc/2.0f); // in range 0..pi @@ -1515,7 +1502,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i) { if (!m_objectUpdated) { - ObjectAccessor::Instance().AddUpdateObject(this); + sObjectAccessor.AddUpdateObject(this); m_objectUpdated = true; } } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index c5a412c3ab7..ad7d0c072ab 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -24,7 +24,7 @@ #include "Common.h" #include "UpdateFields.h" #include "UpdateData.h" -#include "GameSystem/GridReference.h" +#include "GridReference.h" #include "ObjectDefines.h" #include "GridDefines.h" #include "Map.h" diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index a0e5ac1952d..15ce30d9a81 100644 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -21,7 +21,7 @@ #ifndef TRINITY_OBJECTDEFINES_H #define TRINITY_OBJECTDEFINES_H -#include "Platform/Define.h" +#include "Define.h" // used for creating values for respawn for example #define MAKE_PAIR64(l, h) uint64(uint32(l) | (uint64(h) << 32)) diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index 68f0501f304..0b7a553d666 100644 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -25,7 +25,7 @@ #include "Log.h" #include "Opcodes.h" #include "World.h" -#include +#include "zlib.h" UpdateData::UpdateData() : m_blockCount(0) { diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 5f819375677..ecef0276e7a 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -21,7 +21,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 3, 3, 3, 11723 +// Auto generated for version 3, 3, 5, 12340 enum EObjectFields { diff --git a/src/server/game/Entities/Object/Updates/UpdateMask.h b/src/server/game/Entities/Object/Updates/UpdateMask.h index 527bec42aa7..a18a044ee33 100644 --- a/src/server/game/Entities/Object/Updates/UpdateMask.h +++ b/src/server/game/Entities/Object/Updates/UpdateMask.h @@ -32,8 +32,7 @@ class UpdateMask ~UpdateMask() { - if (mUpdateMask) - delete [] mUpdateMask; + delete [] mUpdateMask; } void SetBit (uint32 index) @@ -58,8 +57,7 @@ class UpdateMask void SetCount (uint32 valuesCount) { - if (mUpdateMask) - delete [] mUpdateMask; + delete [] mUpdateMask; mCount = valuesCount; mBlocks = (valuesCount + 31) / 32; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 45b07e7bd96..1f0533ddcda 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "WorldPacket.h" #include "ObjectMgr.h" @@ -74,7 +74,7 @@ void Pet::AddToWorld() if (!IsInWorld()) { ///- Register the pet for guid lookup - ObjectAccessor::Instance().AddObject(this); + sObjectAccessor.AddObject(this); Unit::AddToWorld(); AIM_Initialize(); } @@ -98,7 +98,7 @@ void Pet::RemoveFromWorld() { ///- Don't call the function for Creature, normal mobs + totems go in a different storage Unit::RemoveFromWorld(); - ObjectAccessor::Instance().RemoveObject(this); + sObjectAccessor.RemoveObject(this); } } @@ -324,9 +324,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (result) { - if (m_declinedname) - delete m_declinedname; - + delete m_declinedname; m_declinedname = new DeclinedName; Field *fields2 = result->Fetch(); for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) @@ -621,7 +619,7 @@ void Creature::Regenerate(Powers power) if ((*i)->GetMiscValue() == power) addvalue *= ((*i)->GetAmount() + 100) / 100.0f; - addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * (isHunterPet()? PET_FOCUS_REGEN_INTERVAL : CREATURE_REGEN_INTERVAL) / (5 * IN_MILISECONDS); + addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * (isHunterPet()? PET_FOCUS_REGEN_INTERVAL : CREATURE_REGEN_INTERVAL) / (5 * IN_MILLISECONDS); ModifyPower(power, (int32)addvalue); } @@ -1114,7 +1112,7 @@ void Pet::_LoadSpellCooldowns() continue; data << uint32(spell_id); - data << uint32(uint32(db_time-curTime)*IN_MILISECONDS); + data << uint32(uint32(db_time-curTime)*IN_MILLISECONDS); _AddCreatureSpellCooldown(spell_id,db_time); @@ -1231,10 +1229,10 @@ void Pet::_LoadAuras(uint32 timediff) // negative effects should continue counting down after logout if (remaintime != -1 && !IsPositiveSpell(spellid)) { - if (remaintime/IN_MILISECONDS <= int32(timediff)) + if (remaintime/IN_MILLISECONDS <= int32(timediff)) continue; - remaintime -= timediff*IN_MILISECONDS; + remaintime -= timediff*IN_MILLISECONDS; } // prevent wrong values of remaincharges diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 16e80170cd4..2c9b72b4fa6 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -118,7 +118,7 @@ typedef std::vector AutoSpellList; #define PET_FOLLOW_DIST 1 #define PET_FOLLOW_ANGLE (M_PI/2) -#define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILISECONDS +#define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILLISECONDS class Player; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2221098a9be..5a8cb7b66fc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20,7 +20,7 @@ #include "Common.h" #include "Language.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "Opcodes.h" #include "SpellMgr.h" @@ -50,7 +50,7 @@ #include "Guild.h" #include "Pet.h" #include "Util.h" -#include "Transports.h" +#include "Transport.h" #include "Weather.h" #include "BattleGround.h" #include "BattleGroundAV.h" @@ -59,7 +59,7 @@ #include "OutdoorPvPMgr.h" #include "ArenaTeam.h" #include "Chat.h" -#include "Database/DatabaseImpl.h" +#include "DatabaseImpl.h" #include "Spell.h" #include "SocialMgr.h" #include "GameEventMgr.h" @@ -69,7 +69,7 @@ #include "ConditionMgr.h" #include -#define ZONE_UPDATE_INTERVAL (1*IN_MILISECONDS) +#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) #define PLAYER_SKILL_INDEX(x) (PLAYER_SKILL_INFO_1_1 + ((x)*3)) #define PLAYER_SKILL_VALUE_INDEX(x) (PLAYER_SKILL_INDEX(x)+1) @@ -280,6 +280,105 @@ std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi) return ss; } +//== TradeData ================================================= + +TradeData* TradeData::GetTraderData() const +{ + return m_trader->GetTradeData(); +} + +Item* TradeData::GetItem(TradeSlots slot) const +{ + return m_items[slot] ? m_player->GetItemByGuid(m_items[slot]) : NULL; +} + +bool TradeData::HasItem(uint64 item_guid) const +{ + for(uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) + if (m_items[i] == item_guid) + return true; + + return false; +} + +Item* TradeData::GetSpellCastItem() const +{ + return m_spellCastItem ? m_player->GetItemByGuid(m_spellCastItem) : NULL; +} + +void TradeData::SetItem(TradeSlots slot, Item* item) +{ + uint64 itemGuid = item ? item->GetGUID() : 0; + + if (m_items[slot] == itemGuid) + return; + + m_items[slot] = itemGuid; + + SetAccepted(false); + GetTraderData()->SetAccepted(false); + + Update(); + + // need remove possible trader spell applied to changed item + if (slot == TRADE_SLOT_NONTRADED) + GetTraderData()->SetSpell(0); + + // need remove possible player spell applied (possible move reagent) + SetSpell(0); +} + +void TradeData::SetSpell(uint32 spell_id, Item* castItem /*= NULL*/) +{ + uint64 itemGuid = castItem ? castItem->GetGUID() : 0; + + if (m_spell == spell_id && m_spellCastItem == itemGuid) + return; + + m_spell = spell_id; + m_spellCastItem = itemGuid; + + SetAccepted(false); + GetTraderData()->SetAccepted(false); + + Update(true); // send spell info to item owner + Update(false); // send spell info to caster self +} + +void TradeData::SetMoney(uint32 money) +{ + if (m_money == money) + return; + + m_money = money; + + SetAccepted(false); + GetTraderData()->SetAccepted(false); + + Update(true); +} + +void TradeData::Update(bool forTarget /*= true*/) +{ + if (forTarget) + m_trader->GetSession()->SendUpdateTrade(true); // player state for trader + else + m_player->GetSession()->SendUpdateTrade(false); // player state for player +} + +void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) +{ + m_accepted = state; + + if (!state) + { + if (crosssend) + m_trader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); + else + m_player->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); + } +} + // == Player ==================================================== UpdateMask Player::updateVisualBits; @@ -354,8 +453,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_bHasDelayedTeleport = false; m_teleport_options = 0; - pTrader = 0; - ClearTrade(); + m_trade = NULL; m_cinematic = 0; @@ -379,7 +477,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_swingErrorMsg = 0; - m_DetectInvTimer = 1*IN_MILISECONDS; + m_DetectInvTimer = 1*IN_MILLISECONDS; for (uint8 j = 0; j < PLAYER_MAX_BATTLEGROUND_QUEUES; ++j) { @@ -477,6 +575,8 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa //Default movement to run mode //m_unit_movement_flags = 0; + m_AreaID = 0; + m_mover = this; m_movedPlayer = this; m_seer = this; @@ -514,10 +614,7 @@ Player::~Player () // Note: buy back item already deleted from DB when player was saved for (uint8 i = 0; i < PLAYER_SLOTS_COUNT; ++i) - { - if (m_items[i]) - delete m_items[i]; - } + delete m_items[i]; for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) delete itr->second; @@ -539,8 +636,7 @@ Player::~Player () delete PlayerTalkClass; for (size_t x = 0; x < ItemSetEff.size(); x++) - if (ItemSetEff[x]) - delete ItemSetEff[x]; + delete ItemSetEff[x]; delete m_declinedname; delete m_runes; @@ -591,7 +687,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c return false; } - SetMap(MapManager::Instance().CreateMap(info->mapId, this, 0)); + SetMap(sMapMgr.CreateMap(info->mapId, this, 0)); uint8 powertype = cEntry->powerType; @@ -941,12 +1037,12 @@ int32 Player::getMaxTimer(MirrorTimerType timer) switch (timer) { case FATIGUE_TIMER: - return MINUTE*IN_MILISECONDS; + return MINUTE*IN_MILLISECONDS; case BREATH_TIMER: { if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING)) return DISABLED_MIRROR_TIMER; - int32 UnderWaterTime = 3*MINUTE*IN_MILISECONDS; + int32 UnderWaterTime = 3*MINUTE*IN_MILLISECONDS; AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING); for (AuraEffectList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i) UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetAmount()) / 100.0f); @@ -956,7 +1052,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer) { if (!isAlive()) return DISABLED_MIRROR_TIMER; - return 1*IN_MILISECONDS; + return 1*IN_MILLISECONDS; } default: return 0; @@ -990,7 +1086,7 @@ void Player::HandleDrowning(uint32 time_diff) // Timer limit - need deal damage if (m_MirrorTimer[BREATH_TIMER] < 0) { - m_MirrorTimer[BREATH_TIMER]+= 1*IN_MILISECONDS; + m_MirrorTimer[BREATH_TIMER]+= 1*IN_MILLISECONDS; // Calculate and deal damage // TODO: Check this formula uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1); @@ -1026,7 +1122,7 @@ void Player::HandleDrowning(uint32 time_diff) // Timer limit - need deal damage or teleport ghost to graveyard if (m_MirrorTimer[FATIGUE_TIMER] < 0) { - m_MirrorTimer[FATIGUE_TIMER]+= 1*IN_MILISECONDS; + m_MirrorTimer[FATIGUE_TIMER]+= 1*IN_MILLISECONDS; if (isAlive()) // Calculate and deal damage { uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1); @@ -1059,7 +1155,7 @@ void Player::HandleDrowning(uint32 time_diff) m_MirrorTimer[FIRE_TIMER]-=time_diff; if (m_MirrorTimer[FIRE_TIMER] < 0) { - m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILISECONDS; + m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILLISECONDS; // Calculate and deal damage // TODO: Check this formula uint32 damage = urand(600, 700); @@ -1394,7 +1490,7 @@ void Player::Update(uint32 p_time) { m_drunkTimer += p_time; - if (m_drunkTimer > 10*IN_MILISECONDS) + if (m_drunkTimer > 10*IN_MILLISECONDS) HandleSobering(); } @@ -1826,12 +1922,12 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // Check enter rights before map getting to avoid creating instance copy for player // this check not dependent from map instance copy and same for all instance copies of selected map - if (!MapManager::Instance().CanPlayerEnter(mapid, this, false)) + if (!sMapMgr.CanPlayerEnter(mapid, this, false)) return false; // If the map is not created, assume it is possible to enter it. // It will be created in the WorldPortAck. - Map *map = MapManager::Instance().FindMap(mapid); + Map *map = sMapMgr.FindMap(mapid); if (!map || map->CanEnter(this)) { //lets reset near teleport flag if it wasn't reset during chained teleports @@ -2147,7 +2243,7 @@ void Player::Regenerate(Powers power) // Butchery requires combat for this effect if (power != POWER_RUNIC_POWER || isInCombat()) - addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * ((power != POWER_ENERGY) ? m_regenTimerCount : m_regenTimer) / (5 * IN_MILISECONDS); + addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * ((power != POWER_ENERGY) ? m_regenTimerCount : m_regenTimer) / (5 * IN_MILLISECONDS); } if (addvalue < 0.0f) @@ -2225,7 +2321,7 @@ void Player::RegenerateHealth() for (AuraEffectList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i) addvalue *= (100.0f + (*i)->GetAmount()) / 100.0f; - addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2 * IN_MILISECONDS / (5 * IN_MILISECONDS); + addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2 * IN_MILLISECONDS / (5 * IN_MILLISECONDS); } else if (HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT)) addvalue *= GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT) / 100.0f; @@ -2533,13 +2629,6 @@ void Player::GiveXP(uint32 xp, Unit* victim) // XP resting bonus for kill uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0; - // Heirloom Experience Bonus - float heirloomModifier = 1.0f; - for (int i = 0; i < EQUIPMENT_SLOT_END; ++i) - if (m_items[i] && m_items[i]->GetProto()->Spells->SpellId == 57353) - heirloomModifier += 0.1f; - xp = uint32(xp * heirloomModifier); - SendLogXPGain(xp,victim,rested_bonus_xp); uint32 curXP = GetUInt32Value(PLAYER_XP); @@ -2889,7 +2978,7 @@ void Player::SendInitialSpells() continue; } - time_t cooldown = itr->second.end > curTime ? (itr->second.end-curTime)*IN_MILISECONDS : 0; + time_t cooldown = itr->second.end > curTime ? (itr->second.end-curTime)*IN_MILLISECONDS : 0; if (sEntry->Category) // may be wrong, but anyway better than nothing... { @@ -3342,7 +3431,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen if (!Has310Flyer(false) && pSkill->id == SKILL_MOUNTS) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - spellInfo->CalculateSimpleValue(i) == 310) + SpellMgr::CalculateSpellEffectAmount(spellInfo, i) == 310) SetHas310Flyer(true); if (HasSkill(pSkill->id)) @@ -3447,6 +3536,15 @@ void Player::learnSpell(uint32 spell_id, bool dependent) bool learning = addSpell(spell_id,active,true,dependent,false); + // prevent duplicated entires in spell book, also not send if not in world (loading) + if (learning && IsInWorld()) + { + WorldPacket data(SMSG_LEARNED_SPELL, 6); + data << uint32(spell_id); + data << uint16(0); + GetSession()->SendPacket(&data); + } + // learn all disabled higher ranks and required spells (recursive) if (disabled) { @@ -3466,15 +3564,6 @@ void Player::learnSpell(uint32 spell_id, bool dependent) learnSpell(itr2->second, false); } } - - // prevent duplicated entires in spell book, also not send if not in world (loading) - if (!learning || !IsInWorld()) - return; - - WorldPacket data(SMSG_LEARNED_SPELL, 6); - data << uint32(spell_id); - data << uint16(0); - GetSession()->SendPacket(&data); } void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) @@ -3616,7 +3705,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) SpellEntry const *pSpellInfo = sSpellStore.LookupEntry(spell_id); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (pSpellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - pSpellInfo->CalculateSimpleValue(i) == 310) + SpellMgr::CalculateSpellEffectAmount(pSpellInfo, i) == 310) Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag } } @@ -3710,7 +3799,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) pSpellInfo = sSpellStore.LookupEntry(itr->first); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (pSpellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - pSpellInfo->CalculateSimpleValue(i) == 310) + SpellMgr::CalculateSpellEffectAmount(pSpellInfo, i) == 310) { SetHas310Flyer(true); return true; @@ -3767,8 +3856,8 @@ void Player::RemoveArenaSpellCooldowns() SpellEntry const * entry = sSpellStore.LookupEntry(itr->first); // check if spellentry is present and if the cooldown is less than 10 mins if (entry && - entry->RecoveryTime <= 10 * MINUTE * IN_MILISECONDS && - entry->CategoryRecoveryTime <= 10 * MINUTE * IN_MILISECONDS) + entry->RecoveryTime <= 10 * MINUTE * IN_MILLISECONDS && + entry->CategoryRecoveryTime <= 10 * MINUTE * IN_MILLISECONDS) { // remove & notify RemoveSpellCooldown(itr->first, true); @@ -4259,7 +4348,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // convert corpse to bones if exist (to prevent exiting Corpse in World without DB entry) // bones will be deleted by corpse/bones deleting thread shortly - ObjectAccessor::Instance().ConvertCorpseForPlayer(playerguid); + sObjectAccessor.ConvertCorpseForPlayer(playerguid); // remove from guild uint32 guildId = GetGuildIdFromDB(playerguid); @@ -4556,7 +4645,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) if (Aura * aur = GetAura(15007, GetGUID())) { - aur->SetDuration(delta*IN_MILISECONDS); + aur->SetDuration(delta*IN_MILLISECONDS); } } } @@ -4609,7 +4698,7 @@ void Player::KillPlayer() ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable()); // 6 minutes until repop at graveyard - m_deathTimer = 6*MINUTE*IN_MILISECONDS; + m_deathTimer = 6*MINUTE*IN_MILLISECONDS; UpdateCorpseReclaimDelay(); // dependent at use SetDeathPvP() call before kill SendCorpseReclaimDelay(); @@ -4688,19 +4777,19 @@ void Player::CreateCorpse() corpse->SaveToDB(); // register for player, but not show - ObjectAccessor::Instance().AddCorpse(corpse); + sObjectAccessor.AddCorpse(corpse); } void Player::SpawnCorpseBones() { - if (ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID())) + if (sObjectAccessor.ConvertCorpseForPlayer(GetGUID())) if (!GetSession()->PlayerLogoutWithSave()) // at logout we will already store the player SaveToDB(); // prevent loading as ghost without corpse } Corpse* Player::GetCorpse() const { - return ObjectAccessor::Instance().GetCorpseForPlayerGUID(GetGUID()); + return sObjectAccessor.GetCorpseForPlayerGUID(GetGUID()); } void Player::DurabilityLossAll(double percent, bool inventory) @@ -6120,7 +6209,9 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); // code block for underwater state update - UpdateUnderwaterState(GetMap(), x, y, z); + // Unit::SetPosition() checks for validity and updates our coordinates + // so we re-fetch them instead of using "raw" coordinates from function params + UpdateUnderwaterState(GetMap(), GetPositionX(), GetPositionY(), GetPositionZ()); if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) GetSession()->SendCancelTrade(); @@ -6445,7 +6536,7 @@ void Player::RewardReputation(Quest const *pQuest) continue; if (pQuest->RewRepValue[i]) { - int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i], pQuest->RewRepFaction[i], true); + int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i]/100, pQuest->RewRepFaction[i], true); if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i])) GetReputationMgr().ModifyReputation(factionEntry, rep); } @@ -6506,7 +6597,7 @@ void Player::UpdateHonorFields() ///Calculate the amount of honor gained based on the victim ///and the size of the group for which the honor is divided ///An exact honor value can also be given (overriding the calcs) -bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvptoken) +bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvptoken) { // do not reward honor in arenas, but enable onkill spellproc if (InArena()) @@ -6526,8 +6617,6 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt uint64 victim_guid = 0; uint32 victim_rank = 0; - //uint32 rank_diff = 0; - //time_t now = time(NULL); // need call before fields update to have chance move yesterday data to appropriate fields before today data change. UpdateHonorFields(); @@ -6536,7 +6625,10 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt if (InBattleGround() && GetBattleGround() && GetBattleGround()->isArena()) return true; - if (honor <= 0) + // Promote to float for calculations + float honor_f = honor; + + if (honor_f <= 0) { if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) return false; @@ -6550,45 +6642,35 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt if (GetTeam() == pVictim->GetTeam() && !sWorld.IsFFAPvPRealm()) return false; - float f = 1; //need for total kills (?? need more info) - uint32 k_grey = 0; - uint32 k_level = getLevel(); - uint32 v_level = pVictim->getLevel(); - - { - // PLAYER_CHOSEN_TITLE VALUES DESCRIPTION - // [0] Just name - // [1..14] Alliance honor titles and player name - // [15..28] Horde honor titles and player name - // [29..38] Other title and player name - // [39+] Nothing - uint32 victim_title = pVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE); - // Get Killer titles, CharTitlesEntry::bit_index - // Ranks: - // title[1..14] -> rank[5..18] - // title[15..28] -> rank[5..18] - // title[other] -> 0 - if (victim_title == 0) - victim_guid = 0; // Don't show HK: message, only log. - else if (victim_title < 15) - victim_rank = victim_title + 4; - else if (victim_title < 29) - victim_rank = victim_title - 14 + 4; - else - victim_guid = 0; // Don't show HK: message, only log. - } - - k_grey = Trinity::XP::GetGrayLevel(k_level); + uint8 k_level = getLevel(); + uint8 k_grey = Trinity::XP::GetGrayLevel(k_level); + uint8 v_level = pVictim->getLevel(); if (v_level <= k_grey) return false; - float diff_level = (k_level == k_grey) ? 1 : ((float(v_level) - float(k_grey)) / (float(k_level) - float(k_grey))); + // PLAYER_CHOSEN_TITLE VALUES DESCRIPTION + // [0] Just name + // [1..14] Alliance honor titles and player name + // [15..28] Horde honor titles and player name + // [29..38] Other title and player name + // [39+] Nothing + uint32 victim_title = pVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE); + // Get Killer titles, CharTitlesEntry::bit_index + // Ranks: + // title[1..14] -> rank[5..18] + // title[15..28] -> rank[5..18] + // title[other] -> 0 + if (victim_title == 0) + victim_guid = 0; // Don't show HK: message, only log. + else if (victim_title < 15) + victim_rank = victim_title + 4; + else if (victim_title < 29) + victim_rank = victim_title - 14 + 4; + else + victim_guid = 0; // Don't show HK: message, only log. - int32 v_rank =1; //need more info - - honor = ((f * diff_level * (190 + v_rank*10))/6); - honor *= ((float)k_level) / 21.50537f; //factor of dependence on levels of the killer + honor_f = ceil(Trinity::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey)); // count the number of playerkills in one day ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true); @@ -6603,7 +6685,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt if (!uVictim->ToCreature()->isRacialLeader()) return false; - honor = 100; // ??? need more info + honor_f = 100.0f; // ??? need more info victim_rank = 19; // HK: Leader } } @@ -6611,35 +6693,37 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt if (uVictim != NULL) { if (groupsize > 1) - honor /= groupsize; + honor_f /= groupsize; // apply honor multiplier from aura (not stacking-get highest) - honor = int32(float(honor) * (float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN_PCT))+100.0f)/100.0f); + honor_f *= (GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN_PCT) + 100) / 100.0f; } - honor *= sWorld.getRate(RATE_HONOR); + honor_f *= sWorld.getRate(RATE_HONOR); + // Back to int now + honor = honor_f; // honor - for show honor points in log // victim_guid - for show victim name in log // victim_rank [1..4] HK: // victim_rank [5..19] HK: // victim_rank [0,20+] HK: <> WorldPacket data(SMSG_PVP_CREDIT,4+8+4); - data << (uint32) honor; - data << (uint64) victim_guid; - data << (uint32) victim_rank; + data << honor; + data << victim_guid; + data << victim_rank; GetSession()->SendPacket(&data); // add honor points - ModifyHonorPoints(int32(honor)); + ModifyHonorPoints(honor); - ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true); + ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, honor, true); if (InBattleGround() && honor > 0) { if (BattleGround *bg = GetBattleGround()) { - bg->UpdatePlayerScore(this, SCORE_BONUS_HONOR, uint32(honor), false);//false: prevent looping + bg->UpdatePlayerScore(this, SCORE_BONUS_HONOR, honor, false); //false: prevent looping } } @@ -6762,7 +6846,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) float posy = fields[2].GetFloat(); float posz = fields[3].GetFloat(); - zone = MapManager::Instance().GetZoneId(map,posx,posy,posz); + zone = sMapMgr.GetZoneId(map,posx,posy,posz); if (zone > 0) CharacterDatabase.PExecute("UPDATE characters SET zone='%u' WHERE guid='%u'", zone, guidLow); @@ -7725,6 +7809,10 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 // Apply spell mods ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance); + + // Shiv has 100% chance to apply the poison + if (FindCurrentSpellBySpellId(5938)) + chance = 100.0f; if (roll_chance_f(chance)) { @@ -7757,7 +7845,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c Spell *spell = new Spell(this, spellInfo,false); spell->m_CastItem = item; spell->m_cast_count = cast_count; //set count of casts - spell->m_currentBasePoints[0] = learning_spell_id; + spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(learning_spell_id); spell->prepare(&targets); return; } @@ -8017,7 +8105,7 @@ void Player::RemovedInsignia(Player* looterPlr) // We have to convert player corpse to bones, not to be able to resurrect there // SpawnCorpseBones isn't handy, 'cos it saves player while he in BG - Corpse *bones = ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID(),true); + Corpse *bones = sObjectAccessor.ConvertCorpseForPlayer(GetGUID(),true); if (!bones) return; @@ -9543,7 +9631,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) { Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); if (tempcount >= count) @@ -9553,7 +9641,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); if (tempcount >= count) @@ -9567,7 +9655,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const for (uint32 j = 0; j < pBag->GetBagSize(); j++) { Item* pItem = GetItemByPos(i, j); - if (pItem && pItem->GetEntry() == item) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); if (tempcount >= count) @@ -9582,7 +9670,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; i++) { Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); if (tempcount >= count) @@ -9596,7 +9684,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const for (uint32 j = 0; j < pBag->GetBagSize(); j++) { Item* pItem = GetItemByPos(i, j); - if (pItem && pItem->GetEntry() == item) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { tempcount += pItem->GetCount(); if (tempcount >= count) @@ -11817,7 +11905,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem->GetEntry() == item) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { if (pItem->GetCount() + remcount <= count) { @@ -11845,7 +11933,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem->GetEntry() == item) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { if (pItem->GetCount() + remcount <= count) { @@ -11878,7 +11966,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { if (Item* pItem = pBag->GetItemByPos(j)) { - if (pItem->GetEntry() == item) + if (pItem->GetEntry() == item && !pItem->IsInTrade()) { // all items in bags can be unequipped if (pItem->GetCount() + remcount <= count) @@ -11909,7 +11997,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ { if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - if (pItem && pItem->GetEntry() == item) + if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) { if (pItem->GetCount() + remcount <= count) { @@ -12155,7 +12243,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) BankItem(dest, pNewItem, true); if (isRefundable) { - AddRefundReference(pNewItem->GetGUID()); + AddRefundReference(pNewItem->GetGUIDLow()); pNewItem->SetPaidExtendedCost(pSrcItem->GetPaidExtendedCost()); pNewItem->SetPaidMoney(pSrcItem->GetPaidMoney()); pNewItem->SetRefundRecipient(GetGUIDLow()); @@ -12667,33 +12755,23 @@ void Player::SendSellError(uint8 msg, Creature* pCreature, uint64 guid, uint32 p GetSession()->SendPacket(&data); } -void Player::ClearTrade() -{ - tradeGold = 0; - acceptTrade = false; - for (uint8 i = 0; i < TRADE_SLOT_COUNT; i++) - tradeItems[i] = 0; -} - void Player::TradeCancel(bool sendback) { - if (pTrader) + if (m_trade) { + Player* trader = m_trade->GetTrader(); + // send yellow "Trade canceled" message to both traders - WorldSession* ws; - ws = GetSession(); if (sendback) - ws->SendCancelTrade(); - ws = pTrader->GetSession(); - if (!ws->PlayerLogout()) - ws->SendCancelTrade(); + GetSession()->SendCancelTrade(); + + trader->GetSession()->SendCancelTrade(); // cleanup - ClearTrade(); - pTrader->ClearTrade(); - // prevent loss of reference - pTrader->pTrader = NULL; - pTrader = NULL; + delete m_trade; + m_trade = NULL; + delete trader->m_trade; + trader->m_trade = NULL; } } @@ -13684,7 +13762,7 @@ void Player::PrepareQuestMenu(uint64 guid) { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); GameObject *pGameObject = _map->GetGameObject(guid); if (pGameObject) @@ -13859,7 +13937,7 @@ Quest const * Player::GetNextQuest(uint64 guid, Quest const *pQuest) { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); GameObject *pGameObject = _map->GetGameObject(guid); if (pGameObject) @@ -14135,10 +14213,10 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver) // shared timed quest if (questGiver && questGiver->GetTypeId() == TYPEID_PLAYER) - limittime = questGiver->ToPlayer()->getQuestStatusMap()[quest_id].m_timer / IN_MILISECONDS; + limittime = questGiver->ToPlayer()->getQuestStatusMap()[quest_id].m_timer / IN_MILLISECONDS; AddTimedQuest(quest_id); - questStatusData.m_timer = limittime * IN_MILISECONDS; + questStatusData.m_timer = limittime * IN_MILLISECONDS; qtime = static_cast(time(NULL)) + limittime; } else @@ -14316,7 +14394,8 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, if (pQuest->IsDaily()) { SetDailyQuestStatus(quest_id); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, 1); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, quest_id); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, quest_id); } if (pQuest->IsWeekly()) @@ -15089,7 +15168,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) continue; // just if !ingroup || !noraidgroup || raidgroup QuestStatusData& q_status = mQuestStatus[questid]; - if (q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->GetType() == QUEST_TYPE_RAID)) + if (q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) { if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) { @@ -15372,7 +15451,7 @@ bool Player::HasQuestForItem(uint32 itemid) const continue; // hide quest if player is in raid-group and quest is no raid quest - if (GetGroup() && GetGroup()->isRaidGroup() && qinfo->GetType() != QUEST_TYPE_RAID) + if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid()) if (!InBattleGround()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later continue; @@ -15439,7 +15518,7 @@ void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY))); } - data << uint32(10*Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills())); + data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills()); data << uint32(pQuest->GetBonusTalents()); // bonus talents data << uint32(pQuest->GetRewArenaPoints()); GetSession()->SendPacket(&data); @@ -15564,9 +15643,7 @@ void Player::_LoadDeclinedNames(QueryResult_AutoPtr result) if (!result) return; - if (m_declinedname) - delete m_declinedname; - + delete m_declinedname; m_declinedname = new DeclinedName; Field *fields = result->Fetch(); for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) @@ -15816,11 +15893,8 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0); SetVisibleItemSlot(slot, NULL); - if (m_items[slot]) - { - delete m_items[slot]; - m_items[slot] = NULL; - } + delete m_items[slot]; + m_items[slot] = NULL; } sLog.outDebug("Load Basic value of player %s is: ", m_name.c_str()); @@ -15943,6 +16017,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) // There are no transports on instances instanceId = 0; + m_movementInfo.t_guid = MAKE_NEW_GUID(transGUID, 0, HIGHGUID_TRANSPORT); m_movementInfo.t_x = fields[26].GetFloat(); m_movementInfo.t_y = fields[27].GetFloat(); m_movementInfo.t_z = fields[28].GetFloat(); @@ -15962,7 +16037,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) } else { - for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) + for (MapManager::TransportSet::iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) { if ((*iter)->GetGUIDLow() == transGUID) { @@ -16031,21 +16106,24 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) // Map could be changed before mapEntry = sMapStore.LookupEntry(mapId); // client without expansion support - if (mapEntry && GetSession()->Expansion() < mapEntry->Expansion()) + if (mapEntry) { - sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); - RelocateToHomebind(); - } + if (GetSession()->Expansion() < mapEntry->Expansion()) + { + sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); + RelocateToHomebind(); + } - // fix crash (because of if (Map *map = _FindMap(instanceId)) in MapInstanced::CreateInstance) - if (instanceId) - if (InstanceSave * save = GetInstanceSave(mapId, mapEntry->IsRaid())) - if (save->GetInstanceId() != instanceId) - instanceId = 0; + // fix crash (because of if (Map *map = _FindMap(instanceId)) in MapInstanced::CreateInstance) + if (instanceId) + if (InstanceSave * save = GetInstanceSave(mapId, mapEntry->IsRaid())) + if (save->GetInstanceId() != instanceId) + instanceId = 0; + } // NOW player must have valid map // load the player's map here if it's not already loaded - Map *map = MapManager::Instance().CreateMap(mapId, this, instanceId); + Map *map = sMapMgr.CreateMap(mapId, this, instanceId); if (!map) { @@ -16063,14 +16141,14 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) RelocateToHomebind(); } - map = MapManager::Instance().CreateMap(mapId, this, 0); + map = sMapMgr.CreateMap(mapId, this, 0); if (!map) { PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(), getClass()); mapId = info->mapId; Relocate(info->positionX,info->positionY,info->positionZ,0.0f); sLog.outError("ERROR: Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); - map = MapManager::Instance().CreateMap(mapId, this, 0); + map = sMapMgr.CreateMap(mapId, this, 0); if (!map) { sLog.outError("ERROR: Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); @@ -16472,10 +16550,10 @@ void Player::_LoadAuras(QueryResult_AutoPtr result, uint32 timediff) // negative effects should continue counting down after logout if (remaintime != -1 && !IsPositiveSpell(spellid)) { - if (remaintime/IN_MILISECONDS <= int32(timediff)) + if (remaintime/IN_MILLISECONDS <= int32(timediff)) continue; - remaintime -= timediff*IN_MILISECONDS; + remaintime -= timediff*IN_MILLISECONDS; } // prevent wrong values of remaincharges @@ -16539,7 +16617,7 @@ void Player::_LoadGlyphAuras() void Player::LoadCorpse() { if (isAlive()) - ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID()); + sObjectAccessor.ConvertCorpseForPlayer(GetGUID()); else { if (Corpse *corpse = GetCorpse()) @@ -16640,7 +16718,7 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff) item->SetRefundRecipient(fields[0].GetUInt32()); item->SetPaidMoney(fields[1].GetUInt32()); item->SetPaidExtendedCost(fields[2].GetUInt32()); - AddRefundReference(item->GetGUID()); + AddRefundReference(item->GetGUIDLow()); } } } @@ -16901,7 +16979,7 @@ void Player::_LoadQuestStatus(QueryResult_AutoPtr result) if (quest_time <= sWorld.GetGameTime()) questStatusData.m_timer = 1; else - questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * IN_MILISECONDS; + questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * IN_MILLISECONDS; } else quest_time = 0; @@ -17453,7 +17531,7 @@ bool Player::CheckInstanceLoginValid() } // do checks for satisfy accessreqs, instance full, encounter in progress (raid), perm bind group != perm bind player - return MapManager::Instance().CanPlayerEnter(GetMap()->GetId(), this, true); + return sMapMgr.CanPlayerEnter(GetMap()->GetId(), this, true); } bool Player::_LoadHomeBind(QueryResult_AutoPtr result) @@ -17801,14 +17879,14 @@ void Player::_SaveInventory() // the client auto counts down in real time after having received the initial played time on the first // SMSG_ITEM_REFUND_INFO_RESPONSE packet. // Item::UpdatePlayedTime is only called when needed, which is in DB saves, and item refund info requests. - std::set::iterator i_next; - for (std::set::iterator itr = m_refundableItems.begin(); itr!= m_refundableItems.end(); itr = i_next) + std::set::iterator i_next; + for (std::set::iterator itr = m_refundableItems.begin(); itr!= m_refundableItems.end(); itr = i_next) { // use copy iterator because itr may be invalid after operations in this loop i_next = itr; ++i_next; - Item* iPtr = GetItemByGuid(*itr); + Item* iPtr = GetItemByGuid(MAKE_NEW_GUID(*itr, 0, HIGHGUID_ITEM)); if (iPtr) { iPtr->UpdatePlayedTime(this); @@ -17816,7 +17894,7 @@ void Player::_SaveInventory() } else { - sLog.outError("Can't find item guid " UI64FMTD " but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow()); + sLog.outError("Can't find item guid %u but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow()); m_refundableItems.erase(itr); } } @@ -17945,11 +18023,11 @@ void Player::_SaveQuestStatus() case QUEST_NEW : CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) " "VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]); + GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILLISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]); break; case QUEST_CHANGED : CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" UI64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ", - i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first); + i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILLISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first); break; case QUEST_UNCHANGED: break; @@ -18292,7 +18370,7 @@ void Player::ResetInstances(uint8 method, bool isRaid) } // if the map is loaded, reset it - Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId()); + Map *map = sMapMgr.FindMap(p->GetMapId(), p->GetInstanceId()); if (map && map->IsDungeon()) if (!((InstanceMap*)map)->Reset(method)) { @@ -18647,7 +18725,7 @@ void Player::PetSpellInitialize() for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr) { - time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILISECONDS : 0; + time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILLISECONDS : 0; data << uint32(itr->first); // spellid data << uint16(0); // spell category? @@ -18657,7 +18735,7 @@ void Player::PetSpellInitialize() for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureCategoryCooldowns.begin(); itr != pet->m_CreatureCategoryCooldowns.end(); ++itr) { - time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILISECONDS : 0; + time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILLISECONDS : 0; data << uint32(itr->first); // spellid data << uint16(0); // spell category? @@ -18811,6 +18889,10 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo if (spell && mod->charges == -1 && spell->m_appliedMods.find(mod->ownerAura) == spell->m_appliedMods.end()) return false; + // +duration to infinite duration spells making them limited + if (mod->op == SPELLMOD_DURATION && GetSpellDuration(spellInfo) == -1) + return false; + return spellmgr.IsAffectedByMod(spellInfo, mod); } @@ -19372,8 +19454,8 @@ void Player::ContinueTaxiFlight() for (uint32 i = 1; i < nodeList.size(); ++i) { - TaxiPathNode const& node = nodeList[i]; - TaxiPathNode const& prevNode = nodeList[i-1]; + TaxiPathNodeEntry const& node = nodeList[i]; + TaxiPathNodeEntry const& prevNode = nodeList[i-1]; // skip nodes at another map if (node.mapid != GetMapId()) @@ -19431,7 +19513,7 @@ void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs) { data << uint32(unSpellId); data << uint32(unTimeMs); // in m.secs - AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/IN_MILISECONDS); + AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/IN_MILLISECONDS); } } GetSession()->SendPacket(&data); @@ -19615,10 +19697,11 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } } - int32 price = pProto->BuyPrice * count; + int32 price = crItem->IsGoldRequired(pProto) ? pProto->BuyPrice * count : 0; // reputation discount - price = uint32(floor(price * GetReputationPriceDiscount(pCreature))); + if (price) + price = uint32(floor(price * GetReputationPriceDiscount(pCreature))); if (GetMoney() < price) { @@ -19672,7 +19755,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 it->SetPaidMoney(price); it->SetPaidExtendedCost(crItem->ExtendedCost); it->SaveRefundDataToDB(); - AddRefundReference(it->GetGUID()); + AddRefundReference(it->GetGUIDLow()); } } } @@ -19730,7 +19813,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 it->SetPaidMoney(price); it->SetPaidExtendedCost(crItem->ExtendedCost); it->SaveRefundDataToDB(); - AddRefundReference(it->GetGUID()); + AddRefundReference(it->GetGUIDLow()); } } } @@ -19926,8 +20009,8 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it if (rec == 0 && catrec == 0) return; - catrecTime = catrec ? curTime+catrec/IN_MILISECONDS : 0; - recTime = rec ? curTime+rec/IN_MILISECONDS : catrecTime; + catrecTime = catrec ? curTime+catrec/IN_MILLISECONDS : 0; + recTime = rec ? curTime+rec/IN_MILLISECONDS : catrecTime; } // self spell cooldown @@ -20919,6 +21002,9 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 void Player::ApplyEquipCooldown(Item * pItem) { + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_NO_EQUIP_COOLDOWN)) + return; + for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { _Spell const& spellData = pItem->GetProto()->Spells[i]; @@ -21311,7 +21397,7 @@ bool Player::HasQuestForGO(int32 GOId) const if (!qinfo) continue; - if (GetGroup() && GetGroup()->isRaidGroup() && qinfo->GetType() != QUEST_TYPE_RAID) + if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid()) continue; for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) @@ -21646,7 +21732,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) continue; // member (alive or dead) or his corpse at req. distance // honor can be in PvP and !PvP (racial leader) cases (for alive) - if (pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count, -1, true) && pGroupGuy == this) + if (pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim, count, -1, true) && pGroupGuy == this) honored_kill = true; // xp and reputation only in !PvP case @@ -21690,7 +21776,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) xp = (PvP || GetVehicle()) ? 0 : Trinity::XP::Gain(this, pVictim); // honor can be in PvP and !PvP (racial leader) cases - if (RewardHonor(pVictim,1, -1, true)) + if (RewardHonor(pVictim, 1, -1, true)) honored_kill = true; // xp and reputation only in !PvP case @@ -21938,7 +22024,7 @@ void Player::SendCorpseReclaimDelay(bool load) //! corpse reclaim delay 30 * 1000ms or longer at often deaths WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4); - data << uint32(delay*IN_MILISECONDS); + data << uint32(delay*IN_MILLISECONDS); GetSession()->SendPacket(&data); } @@ -23121,6 +23207,9 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket *data) if (m_specsCount) { + if (m_specsCount > MAX_TALENT_SPECS) + m_specsCount = MAX_TALENT_SPECS; + // loop through all specs (only 1 for now) for (uint32 specIdx = 0; specIdx < m_specsCount; ++specIdx) { @@ -23751,14 +23840,14 @@ void Player::SendDuelCountdown(uint32 counter) GetSession()->SendPacket(&data); } -void Player::AddRefundReference(uint64 it) +void Player::AddRefundReference(uint32 it) { m_refundableItems.insert(it); } -void Player::DeleteRefundReference(uint64 it) +void Player::DeleteRefundReference(uint32 it) { - std::set::iterator itr = m_refundableItems.find(it); + std::set::iterator itr = m_refundableItems.find(it); if (itr != m_refundableItems.end()) { m_refundableItems.erase(itr); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d6de8679323..0b64d7e3821 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -26,7 +26,7 @@ #include "Unit.h" #include "Item.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "NPCHandler.h" #include "QuestDef.h" #include "Group.h" @@ -920,6 +920,55 @@ struct BGData bool HasTaxiPath() const { return taxiPath[0] && taxiPath[1]; } }; +class TradeData +{ + public: // constructors + TradeData(Player* player, Player* trader) : + m_player(player), m_trader(trader), m_accepted(false), m_acceptProccess(false), + m_money(0), m_spell(0) {} + + Player* GetTrader() const { return m_trader; } + TradeData* GetTraderData() const; + + Item* GetItem(TradeSlots slot) const; + bool HasItem(uint64 item_guid) const; + void SetItem(TradeSlots slot, Item* item); + + uint32 GetSpell() const { return m_spell; } + void SetSpell(uint32 spell_id, Item* castItem = NULL); + + Item* GetSpellCastItem() const; + bool HasSpellCastItem() const { return m_spellCastItem != 0; } + + uint32 GetMoney() const { return m_money; } + void SetMoney(uint32 money); + + bool IsAccepted() const { return m_accepted; } + void SetAccepted(bool state, bool crosssend = false); + + bool IsInAcceptProcess() const { return m_acceptProccess; } + void SetInAcceptProcess(bool state) { m_acceptProccess = state; } + + private: // internal functions + + void Update(bool for_trader = true); + + private: // fields + + Player* m_player; // Player who own of this TradeData + Player* m_trader; // Player who trade with m_player + + bool m_accepted; // m_player press accept for trade list + bool m_acceptProccess; // one from player/trader press accept and this processed + + uint32 m_money; // m_player place money to trade + + uint32 m_spell; // m_player apply spell to non-traded slot item + uint64 m_spellCastItem; // applied spell casted by item use + + uint64 m_items[TRADE_SLOT_COUNT]; // traded itmes from m_player side including non-traded slot +}; + class Player : public Unit, public GridObject { friend class WorldSession; @@ -1137,8 +1186,8 @@ class Player : public Unit, public GridObject uint8 _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; uint8 _CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item *pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const; - void AddRefundReference(uint64 it); - void DeleteRefundReference(uint64 it); + void AddRefundReference(uint32 it); + void DeleteRefundReference(uint32 it); void ApplyEquipCooldown(Item * pItem); void SetAmmo(uint32 item); @@ -1191,15 +1240,10 @@ class Player : public Unit, public GridObject bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot); float GetReputationPriceDiscount(Creature const* pCreature) const; - Player* GetTrader() const { return pTrader; } - void ClearTrade(); + + Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : NULL; } + TradeData* GetTradeData() const { return m_trade; } void TradeCancel(bool sendback); - Item *GetItemByTradeSlot(uint8 slot) const - { - if (slot < TRADE_SLOT_COUNT && tradeItems[slot]) - return GetItemByGuid(tradeItems[slot]); - return NULL; - } void UpdateEnchantTime(uint32 time); void UpdateItemDuration(uint32 time, bool realtimeonly=false); @@ -1395,11 +1439,19 @@ class Player : public Unit, public GridObject if (d < 0) SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0); else - SetMoney (GetMoney() < uint32(MAX_MONEY_AMOUNT - d) ? GetMoney() + d : MAX_MONEY_AMOUNT); - - // "At Gold Limit" - if (GetMoney() >= MAX_MONEY_AMOUNT) - SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD,NULL,NULL); + { + uint32 newAmount = 0; + if (GetMoney() < uint32(MAX_MONEY_AMOUNT - d)) + newAmount = GetMoney() + d; + else + { + // "At Gold Limit" + newAmount = MAX_MONEY_AMOUNT; + if (d) + SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL); + } + SetMoney (newAmount); + } } void SetMoney(uint32 value) { @@ -1874,7 +1926,7 @@ class Player : public Unit, public GridObject /*** PVP SYSTEM ***/ /*********************************************************/ void UpdateHonorFields(); - bool RewardHonor(Unit *pVictim, uint32 groupsize, float honor = -1, bool pvptoken = false); + bool RewardHonor(Unit *pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); uint32 GetHonorPoints() { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); } uint32 GetArenaPoints() { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); } void ModifyHonorPoints(int32 value); @@ -2074,7 +2126,7 @@ class Player : public Unit, public GridObject /*** REST SYSTEM ***/ /*********************************************************/ - bool isRested() const { return GetRestTime() >= 10*IN_MILISECONDS; } + bool isRested() const { return GetRestTime() >= 10*IN_MILLISECONDS; } uint32 GetXPRestBonus(uint32 xp); uint32 GetRestTime() const { return m_restTime;} void SetRestTime(uint32 v) { m_restTime = v;} @@ -2460,10 +2512,7 @@ class Player : public Unit, public GridObject int m_cinematic; - Player *pTrader; - bool acceptTrade; - uint64 tradeItems[TRADE_SLOT_COUNT]; - uint32 tradeGold; + TradeData* m_trade; bool m_DailyQuestChanged; bool m_WeeklyQuestChanged; @@ -2535,7 +2584,7 @@ class Player : public Unit, public GridObject uint8 _CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool merge, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const; Item* _StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool update); - std::set m_refundableItems; + std::set m_refundableItems; void SendRefundInfo(Item* item); void RefundItem(Item* item); diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index f0f27691007..0de95352d19 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -19,8 +19,8 @@ */ #include "SocialMgr.h" -#include "Policies/SingletonImp.h" -#include "Database/DatabaseEnv.h" + +#include "DatabaseEnv.h" #include "Opcodes.h" #include "WorldPacket.h" #include "Player.h" @@ -28,8 +28,6 @@ #include "World.h" #include "Util.h" -INSTANTIATE_SINGLETON_1(SocialMgr); - PlayerSocial::PlayerSocial() { m_playerGUID = 0; diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index 40f0066ec2e..1f40fcf28e9 100644 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -21,8 +21,8 @@ #ifndef __TRINITY_SOCIALMGR_H #define __TRINITY_SOCIALMGR_H -#include "Policies/Singleton.h" -#include "Database/DatabaseEnv.h" +#include "ace/Singleton.h" +#include "DatabaseEnv.h" #include "Common.h" class SocialMgr; @@ -43,7 +43,8 @@ enum SocialFlag { SOCIAL_FLAG_FRIEND = 0x01, SOCIAL_FLAG_IGNORED = 0x02, - SOCIAL_FLAG_MUTED = 0x04 // guessed + SOCIAL_FLAG_MUTED = 0x04, // guessed + SOCIAL_FLAG_RAF = 0x08 // Recruit A Friend }; struct FriendInfo @@ -112,7 +113,7 @@ enum FriendsResult }; #define SOCIALMGR_FRIEND_LIMIT 50 -#define SOCIALMGR_IGNORE_LIMIT 25 +#define SOCIALMGR_IGNORE_LIMIT 50 class PlayerSocial { @@ -139,8 +140,9 @@ class PlayerSocial class SocialMgr { + friend class ACE_Singleton; + SocialMgr(); public: - SocialMgr(); ~SocialMgr(); // Misc void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); } @@ -156,6 +158,6 @@ class SocialMgr SocialMap m_socialMap; }; -#define sSocialMgr Trinity::Singleton::Instance() +#define sSocialMgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 444e115f8b9..2a82b5c33df 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -20,7 +20,7 @@ #include "Common.h" -#include "Transports.h" +#include "Transport.h" #include "MapManager.h" #include "ObjectMgr.h" #include "Path.h" @@ -106,7 +106,7 @@ void MapManager::LoadTransports() m_TransportsByMap[*i].insert(t); //If we someday decide to use the grid to track transports, here: - t->SetMap(MapManager::Instance().CreateMap(mapid, t, 0)); + t->SetMap(sMapMgr.CreateMap(mapid, t, 0)); //t->GetMap()->Add((GameObject *)t); ++count; @@ -185,18 +185,13 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, struct keyFrame { - keyFrame(float _x, float _y, float _z, uint32 _mapid, int _actionflag, int _delay) - { - x = _x; y = _y; z = _z; mapid = _mapid; actionflag = _actionflag; delay = _delay; distFromPrev = -1; distSinceStop = -1; distUntilStop = -1; - tFrom = 0; tTo = 0; - } + explicit keyFrame(TaxiPathNodeEntry const& _node) : node(&_node), + distSinceStop(-1.0f), distUntilStop(-1.0f), distFromPrev(-1.0f), tFrom(0.0f), tTo(0.0f) + { + } + + TaxiPathNodeEntry const* node; - float x; - float y; - float z; - uint32 mapid; - int actionflag; - int delay; float distSinceStop; float distUntilStop; float distFromPrev; @@ -205,24 +200,24 @@ struct keyFrame bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) { - TransportPath path; - objmgr.GetTransportPathNodes(pathid, path); - - if (path.Empty()) + if (pathid >= sTaxiPathNodesByPath.size()) return false; + TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathid]; + std::vector keyFrames; int mapChange = 0; mapids.clear(); - for (size_t i = 1; i < path.Size() - 1; ++i) + for (size_t i = 1; i < path.size() - 1; ++i) { if (mapChange == 0) { - if ((path[i].mapid == path[i+1].mapid)) + TaxiPathNodeEntry const& node_i = path[i]; + if (node_i.mapid == path[i+1].mapid) { - keyFrame k(path[i].x, path[i].y, path[i].z, path[i].mapid, path[i].actionFlag, path[i].delay); + keyFrame k(node_i); keyFrames.push_back(k); - mapids.insert(k.mapid); + mapids.insert(k.node->mapid); } else { @@ -240,7 +235,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) // first cell is arrived at by teleportation :S keyFrames[0].distFromPrev = 0; - if (keyFrames[0].actionflag == 2) + if (keyFrames[0].node->actionFlag == 2) { lastStop = 0; } @@ -248,18 +243,18 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) // find the rest of the distances between key points for (size_t i = 1; i < keyFrames.size(); ++i) { - if ((keyFrames[i].actionflag == 1) || (keyFrames[i].mapid != keyFrames[i-1].mapid)) + if ((keyFrames[i].node->actionFlag == 1) || (keyFrames[i].node->mapid != keyFrames[i-1].node->mapid)) { keyFrames[i].distFromPrev = 0; } else { keyFrames[i].distFromPrev = - sqrt(pow(keyFrames[i].x - keyFrames[i - 1].x, 2) + - pow(keyFrames[i].y - keyFrames[i - 1].y, 2) + - pow(keyFrames[i].z - keyFrames[i - 1].z, 2)); + sqrt(pow(keyFrames[i].node->x - keyFrames[i - 1].node->x, 2) + + pow(keyFrames[i].node->y - keyFrames[i - 1].node->y, 2) + + pow(keyFrames[i].node->z - keyFrames[i - 1].node->z, 2)); } - if (keyFrames[i].actionflag == 2) + if (keyFrames[i].node->actionFlag == 2) { // remember first stop frame if (firstStop == -1) @@ -272,7 +267,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) for (size_t i = 0; i < keyFrames.size(); ++i) { int j = (i + lastStop) % keyFrames.size(); - if (keyFrames[j].actionflag == 2) + if (keyFrames[j].node->actionFlag == 2) tmpDist = 0; else tmpDist += keyFrames[j].distFromPrev; @@ -284,7 +279,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) int j = (i + (firstStop+1)) % keyFrames.size(); tmpDist += keyFrames[(j + 1) % keyFrames.size()].distFromPrev; keyFrames[j].distUntilStop = tmpDist; - if (keyFrames[j].actionflag == 2) + if (keyFrames[j].node->actionFlag == 2) tmpDist = 0; } @@ -312,14 +307,15 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) // speed = max(30, t) (remember x = 0.5s^2, and when accelerating, a = 1 unit/s^2 int t = 0; bool teleport = false; - if (keyFrames[keyFrames.size() - 1].mapid != keyFrames[0].mapid) + if (keyFrames[keyFrames.size() - 1].node->mapid != keyFrames[0].node->mapid) teleport = true; - WayPoint pos(keyFrames[0].mapid, keyFrames[0].x, keyFrames[0].y, keyFrames[0].z, teleport, 0); + WayPoint pos(keyFrames[0].node->mapid, keyFrames[0].node->x, keyFrames[0].node->y, keyFrames[0].node->z, teleport, 0, + keyFrames[0].node->arrivalEventID, keyFrames[0].node->departureEventID); m_WayPoints[0] = pos; - t += keyFrames[0].delay * 1000; + t += keyFrames[0].node->delay * 1000; - uint32 cM = keyFrames[0].mapid; + uint32 cM = keyFrames[0].node->mapid; for (size_t i = 0; i < keyFrames.size() - 1; ++i) { float d = 0; @@ -337,19 +333,19 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) if (d > 0) { float newX, newY, newZ; - newX = keyFrames[i].x + (keyFrames[i + 1].x - keyFrames[i].x) * d / keyFrames[i + 1].distFromPrev; - newY = keyFrames[i].y + (keyFrames[i + 1].y - keyFrames[i].y) * d / keyFrames[i + 1].distFromPrev; - newZ = keyFrames[i].z + (keyFrames[i + 1].z - keyFrames[i].z) * d / keyFrames[i + 1].distFromPrev; + newX = keyFrames[i].node->x + (keyFrames[i + 1].node->x - keyFrames[i].node->x) * d / keyFrames[i + 1].distFromPrev; + newY = keyFrames[i].node->y + (keyFrames[i + 1].node->y - keyFrames[i].node->y) * d / keyFrames[i + 1].distFromPrev; + newZ = keyFrames[i].node->z + (keyFrames[i + 1].node->z - keyFrames[i].node->z) * d / keyFrames[i + 1].distFromPrev; bool teleport = false; - if (keyFrames[i].mapid != cM) + if (keyFrames[i].node->mapid != cM) { teleport = true; - cM = keyFrames[i].mapid; + cM = keyFrames[i].node->mapid; } // sLog.outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ); - WayPoint pos(keyFrames[i].mapid, newX, newY, newZ, teleport, i); + WayPoint pos(keyFrames[i].node->mapid, newX, newY, newZ, teleport, 0); if (teleport) m_WayPoints[t] = pos; } @@ -389,14 +385,14 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) t += (long)keyFrames[i + 1].tTo % 100; bool teleport = false; - if ((keyFrames[i + 1].actionflag == 1) || (keyFrames[i + 1].mapid != keyFrames[i].mapid)) + if ((keyFrames[i + 1].node->actionFlag == 1) || (keyFrames[i + 1].node->mapid != keyFrames[i].node->mapid)) { teleport = true; - cM = keyFrames[i + 1].mapid; + cM = keyFrames[i + 1].node->mapid; } - WayPoint pos(keyFrames[i + 1].mapid, keyFrames[i + 1].x, keyFrames[i + 1].y, keyFrames[i + 1].z, teleport, i); - + WayPoint pos(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport, + 0, keyFrames[i + 1].node->arrivalEventID, keyFrames[i + 1].node->departureEventID); // sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport); /* if (keyFrames[i+1].delay > 5) @@ -405,7 +401,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) //if (teleport) m_WayPoints[t] = pos; - t += keyFrames[i + 1].delay * 1000; + t += keyFrames[i + 1].node->delay * 1000; // sLog.outString("------"); } @@ -459,7 +455,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) //yes, you're right ResetMap(); - Map * newMap = MapManager::Instance().CreateMap(newMapid, this, 0); + Map * newMap = sMapMgr.CreateMap(newMapid, this, 0); SetMap(newMap); assert (GetMap()); @@ -484,13 +480,6 @@ bool Transport::RemovePassenger(Player* passenger) return true; } -void Transport::CheckForEvent(uint32 entry, uint32 wp_id) -{ - uint32 key = entry*100+wp_id; - if (objmgr.TransportEventMap.find(key) != objmgr.TransportEventMap.end()) - GetMap()->ScriptsStart(sEventScripts, objmgr.TransportEventMap[key], this, NULL); -} - void Transport::Update(uint32 /*p_time*/) { if (m_WayPoints.size() <= 1) @@ -499,9 +488,13 @@ void Transport::Update(uint32 /*p_time*/) m_timer = getMSTime() % m_period; while (((m_timer - m_curr->first) % m_pathTime) > ((m_next->first - m_curr->first) % m_pathTime)) { + DoEventIfAny(*m_curr, true); + m_curr = GetNextWayPoint(); m_next = GetNextWayPoint(); + DoEventIfAny(*m_curr,false); + // first check help in case client-server transport coordinates de-synchronization if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport) { @@ -548,9 +541,6 @@ void Transport::Update(uint32 /*p_time*/) if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) sLog.outDetail("%s moved to %d %f %f %f %d", this->m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); - - //Transport Event System - CheckForEvent(this->GetEntry(), m_curr->second.id); } } @@ -587,3 +577,11 @@ void Transport::UpdateForMap(Map const* targetMap) } } +void Transport::DoEventIfAny(WayPointMap::value_type const& node, bool departure) +{ + if (uint32 eventid = departure ? node.second.departureEventID : node.second.arrivalEventID) + { + sLog.outDebug("Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.first, GetName()); + GetMap()->ScriptsStart(sEventScripts, eventid, this, this); + } +} diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index 25b9ade1461..7b93d3e28a8 100644 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -27,35 +27,6 @@ #include #include -class TransportPath -{ - public: - struct PathNode - { - uint32 mapid; - float x,y,z; - uint32 actionFlag; - uint32 delay; - }; - - void SetLength(const unsigned int sz) - { - i_nodes.resize(sz); - } - - unsigned int Size(void) const { return i_nodes.size(); } - bool Empty(void) const { return i_nodes.empty(); } - void Resize(unsigned int sz) { i_nodes.resize(sz); } - void Clear(void) { i_nodes.clear(); } - PathNode* GetNodes(void) { return static_cast(&i_nodes[0]); } - - PathNode& operator[](const unsigned int idx) { return i_nodes[idx]; } - const PathNode& operator()(const unsigned int idx) const { return i_nodes[idx]; } - - protected: - std::vector i_nodes; -}; - class Transport : public GameObject { public: @@ -66,7 +37,6 @@ class Transport : public GameObject void Update(uint32 p_time); bool AddPassenger(Player* passenger); bool RemovePassenger(Player* passenger); - void CheckForEvent(uint32 entry, uint32 wp_id); typedef std::set PlayerSet; PlayerSet const& GetPassengers() const { return m_passengers; } @@ -75,14 +45,20 @@ class Transport : public GameObject struct WayPoint { WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false), id(0) {} - WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, uint32 _id) : - mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), id(_id) {} + WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, uint32 _id = 0, + uint32 _arrivalEventID = 0, uint32 _departureEventID = 0) + : mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), id(_id), + arrivalEventID(_arrivalEventID), departureEventID(_departureEventID) + { + } uint32 mapid; float x; float y; float z; bool teleport; uint32 id; + uint32 arrivalEventID; + uint32 departureEventID; }; typedef std::map WayPointMap; @@ -102,6 +78,7 @@ class Transport : public GameObject private: void TeleportTransport(uint32 newMapid, float x, float y, float z); void UpdateForMap(Map const* map); + void DoEventIfAny(WayPointMap::value_type const& node, bool departure); WayPointMap::const_iterator GetNextWayPoint(); }; #endif diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 720e177075f..1fb662c43df 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -54,7 +54,7 @@ #include "Traveller.h" #include "TemporarySummon.h" #include "Vehicle.h" -#include "Transports.h" +#include "Transport.h" #include @@ -201,10 +201,8 @@ Unit::~Unit() RemoveAllDynObjects(); _DeleteRemovedAuras(); - if (m_charmInfo) - delete m_charmInfo; - if (m_vehicleKit) - delete m_vehicleKit; + delete m_charmInfo; + delete m_vehicleKit; assert(!m_attacking); assert(m_attackers.empty()); @@ -437,29 +435,6 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 M SendMessageToSet(&data, true); }*/ -void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end) -{ - uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32); - - uint32 pathSize = end - start; - - WorldPacket data(SMSG_MONSTER_MOVE, (GetPackGUID().size()+1+4+4+4+4+1+4+4+4+pathSize*4*3)); - data.append(GetPackGUID()); - data << uint8(0); - data << GetPositionX(); - data << GetPositionY(); - data << GetPositionZ(); - data << uint32(getMSTime()); - data << uint8(0); - data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight())? (MOVEFLAG_FLY|MOVEFLAG_WALK) : MOVEFLAG_WALK); - data << uint32(traveltime); - data << uint32(pathSize); - data.append((char*)path.GetNodes(start), pathSize * 4 * 3); - SendMessageToSet(&data, true); -//MONSTER_MOVE_SPLINE_FLY - addUnitState(UNIT_STAT_MOVE); -} - void Unit::SendMonsterMoveTransport(Unit *vehicleOwner) { WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, GetPackGUID().size()+vehicleOwner->GetPackGUID().size()); @@ -587,23 +562,6 @@ void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb) uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss) { - // if attacker is a player and spell is not empty/fail - if (GetTypeId() == TYPEID_PLAYER && spellProto) - { - // on divine storm dealed damage - heal - if (spellProto->SpellFamilyName == SPELLFAMILY_PALADIN && spellProto->SpellFamilyFlags[1] & 0x20000) - { - Unit *pRaidGrpMember = GetNextRandomRaidMemberOrPet(30.0f); - - int32 divineDmg = damage * (25 + (HasAura(63220) ? 15 : 0)) / 100; //25%, if has Glyph of Divine Storm -> 40% - - if (!pRaidGrpMember) - pRaidGrpMember = this; - - CastCustomSpell(pRaidGrpMember, 54172, &divineDmg, 0, 0, true); - } - } - if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsAIEnabled) pVictim->ToCreature()->AI()->DamageTaken(this, damage); @@ -611,8 +569,26 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa { // interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras) pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, spellProto ? spellProto->Id : 0); - } + // copy damage to casters of this aura + AuraEffectList const& vCopyDamage = pVictim->GetAuraEffectsByType(SPELL_AURA_SHARE_DAMAGE_PCT); + for (AuraEffectList::const_iterator i = vCopyDamage.begin(); i != vCopyDamage.end(); ++i) + { + // check damage school mask + if (((*i)->GetMiscValue() & damageSchoolMask) == 0) + continue; + + Unit * shareDamageTarget = (*i)->GetCaster(); + if (!shareDamageTarget) + continue; + SpellEntry const * spell = (*i)->GetSpellProto(); + + uint32 share = damage * (float((*i)->GetAmount()) / 100.0f); + // TODO: check packets if damage is done by pVictim, or by attacker of pVicitm + DealDamageMods(shareDamageTarget, share, NULL); + DealDamage(shareDamageTarget, share, NULL, NODAMAGE, GetSpellSchoolMask(spell), spell, false); + } + } // Rage from Damage made (only from direct weapon damage) if (cleanDamage && damagetype == DIRECT_DAMAGE && this != pVictim && getPowerType() == POWER_RAGE) @@ -1816,14 +1792,20 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff if (spellProto->SpellIconID == 2253) { //reduces all damage taken while Stunned - if (unitflag & UNIT_FLAG_STUNNED) + if (pVictim->m_form == FORM_CAT && (unitflag & UNIT_FLAG_STUNNED)) RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; } - // Savage Defense (amount store original percent of attack power applied) - if (spellProto->SpellIconID == 50) // only spell with this aura fit + // Savage Defense + if (spellProto->SpellIconID == 146) { - RemainingDamage -= int32(currentAbsorb * pVictim->GetTotalAttackPowerValue(BASE_ATTACK) / 100); + if (RemainingDamage < currentAbsorb) + currentAbsorb = RemainingDamage; + + (*i)->SetAmount(0); // guarantee removal + existExpired = true; // maybe hacky but not crashy + + RemainingDamage -= currentAbsorb; continue; } // Moonkin Form passive @@ -2211,6 +2193,71 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff } } +void Unit::CalcHealAbsorb(Unit *pVictim, const SpellEntry *healSpell, uint32 &healAmount, uint32 &absorb) +{ + if (!healAmount) + return; + + int32 RemainingHeal = healAmount; + // Get unit state (need for some absorb check) + uint32 unitflag = pVictim->GetUInt32Value(UNIT_FIELD_FLAGS); + // Need remove expired auras after + bool existExpired = false; + + // absorb without mana cost + AuraEffectList const& vHealAbsorb = pVictim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_HEAL_ABSORB); + for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && RemainingHeal > 0; ++i) + { + if (!((*i)->GetMiscValue() & healSpell->SchoolMask)) + continue; + + SpellEntry const* spellProto = (*i)->GetSpellProto(); + + // Max Amount can be absorbed by this aura + int32 currentAbsorb = (*i)->GetAmount(); + + // Found empty aura (impossible but..) + if (currentAbsorb <= 0) + { + existExpired = true; + continue; + } + + // currentAbsorb - damage can be absorbed by shield + // If need absorb less damage + if (RemainingHeal < currentAbsorb) + currentAbsorb = RemainingHeal; + + RemainingHeal -= currentAbsorb; + + // Reduce shield amount + (*i)->SetAmount((*i)->GetAmount() - currentAbsorb); + // Need remove it later + if ((*i)->GetAmount() <= 0) + existExpired = true; + } + + // Remove all expired absorb auras + if (existExpired) + { + for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end();) + { + AuraEffect *auraEff = *i; + ++i; + if (auraEff->GetAmount() <= 0) + { + uint32 removedAuras = pVictim->m_removedAurasCount; + auraEff->GetBase()->Remove(AURA_REMOVE_BY_ENEMY_SPELL); + if (removedAuras+1 < pVictim->m_removedAurasCount) + i = vHealAbsorb.begin(); + } + } + } + + absorb = RemainingHeal > 0 ? (healAmount - RemainingHeal) : healAmount; + healAmount = RemainingHeal; +} + void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool /*extra*/) { if (hasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) @@ -2846,11 +2893,12 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) return SPELL_MISS_MISS; // Chance resist mechanic (select max value from every mechanic spell effect) - int32 resist_chance = pVictim->GetMechanicResistChance(spell); + int32 resist_chance = pVictim->GetMechanicResistChance(spell)*100; tmp += resist_chance; // Chance resist debuff - tmp -= pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)); + tmp += pVictim->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; + tmp += pVictim->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; // Roll chance if (rand < tmp) @@ -3270,8 +3318,8 @@ void Unit::_UpdateAutoRepeatSpell() return; } - //apply delay - if (m_AutoRepeatFirstCast && getAttackTimer(RANGED_ATTACK) < 500) + //apply delay (Auto Shot (spellID 75) not affected) + if (m_AutoRepeatFirstCast && getAttackTimer(RANGED_ATTACK) < 500 && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) setAttackTimer(RANGED_ATTACK,500); m_AutoRepeatFirstCast = false; @@ -3521,7 +3569,18 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster) if (Aura * foundAura = GetOwnedAura(aura->GetId(), aura->GetCasterGUID(), 0, aura)) { if (aura->GetSpellProto()->StackAmount) + { aura->ModStackAmount(foundAura->GetStackAmount()); + } + // Update periodic timers from the previous aura + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + AuraEffect *existingEff = foundAura->GetEffect(i); + AuraEffect *newEff = aura->GetEffect(i); + if (!existingEff || !newEff) + continue; + newEff->SetPeriodicTimer(existingEff->GetPeriodicTimer()); + } // Use the new one to replace the old one // This is the only place where AURA_REMOVE_BY_STACK should be used @@ -4118,7 +4177,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit } else { - int32 dur = 2*MINUTE*IN_MILISECONDS < aura->GetDuration() ? 2*MINUTE*IN_MILISECONDS : aura->GetDuration(); + int32 dur = 2*MINUTE*IN_MILLISECONDS < aura->GetDuration() ? 2*MINUTE*IN_MILLISECONDS : aura->GetDuration(); newAura = Aura::TryCreate(aura->GetSpellProto(), effMask, stealer, NULL, &baseDamage[0], NULL, aura->GetCasterGUID()); if (!newAura) @@ -4335,16 +4394,14 @@ void Unit::RemoveAreaAurasDueToLeaveWorld() void Unit::RemoveAllAuras() { - while (!m_appliedAuras.empty() || !m_ownedAuras.empty()) - { - AuraApplicationMap::iterator aurAppIter = m_appliedAuras.begin(); - while (!m_appliedAuras.empty()) - _UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT); + AuraApplicationMap::iterator aurAppIter; + for (aurAppIter = m_appliedAuras.begin(); aurAppIter != m_appliedAuras.end();) + _UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT); + + AuraMap::iterator aurIter; + for (aurIter = m_ownedAuras.begin(); aurIter != m_ownedAuras.end();) + RemoveOwnedAura(aurIter); - AuraMap::iterator aurIter = m_ownedAuras.begin(); - while (!m_ownedAuras.empty()) - RemoveOwnedAura(aurIter); - } } void Unit::RemoveArenaAuras(bool onleave) @@ -6561,11 +6618,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger return false; // mana cost save - int32 mana = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; - basepoints0 = mana * 40/100; + basepoints0 = CalculatePowerCost(procSpell, this, SpellSchoolMask(procSpell->SchoolMask)) * 4/10; if (basepoints0 <= 0) return false; + basepoints0 += 1; // standard basepoint increase for CastCustomSpell target = this; triggered_spell_id = 34720; break; @@ -7285,27 +7342,25 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id); return false; } - // No thread generated mod - // TODO: exist special flag in spell attributes for this, need found and use! - SpellModifier *mod = new SpellModifier; - mod->op = SPELLMOD_THREAT; - mod->value = -100; - mod->type = SPELLMOD_PCT; - mod->spellId = dummySpell->Id; - mod->mask[0] = 0x02; - mod->mask[2] = 0x00; - this->ToPlayer()->AddSpellMod(mod, true); - // Remove cooldown (Chain Lightning - have Category Recovery time) + // Chain Lightning if (procSpell->SpellFamilyFlags[0] & 0x2) + { + // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit. + // A maxed LO would have a 33% / 3 = 11% chance to proc of each target. + // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets] + float chance = 100.0f / procSpell->EffectChainTarget[effIndex]; + if (!roll_chance_f(chance)) + return false; + + // Remove cooldown (Chain Lightning - have Category Recovery time) ToPlayer()->RemoveSpellCooldown(spellId); + } CastSpell(pVictim, spellId, true, castItem, triggeredByAura); - this->ToPlayer()->AddSpellMod(mod, false); - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); return true; } @@ -7744,12 +7799,35 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur // Used in case when access to whole aura is needed // All procs should be handled like this... -bool Unit::HandleAuraProc(Unit * /*pVictim*/, uint32 damage, Aura * triggeredByAura, SpellEntry const * procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 /*cooldown*/, bool * handled) +bool Unit::HandleAuraProc(Unit * pVictim, uint32 damage, Aura * triggeredByAura, SpellEntry const * procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 /*cooldown*/, bool * handled) { SpellEntry const *dummySpell = triggeredByAura->GetSpellProto(); switch(dummySpell->SpellFamilyName) { + case SPELLFAMILY_PALADIN: + { + // Infusion of Light + if (dummySpell->SpellIconID == 3021) + { + // Flash of Light HoT on Flash of Light when Sacred Shield active + if (procSpell->SpellFamilyFlags[0] & 0x40000000 && procSpell->SpellIconID == 242) + { + *handled = true; + if (pVictim->HasAura(53601)) + { + int32 bp0 = (damage/12) * SpellMgr::CalculateSpellEffectAmount(dummySpell, 2)/100; + CastCustomSpell(pVictim, 66922, &bp0, NULL, NULL, true); + return true; + } + } + // but should not proc on non-critical Holy Shocks + else if ((procSpell->SpellFamilyFlags[0] & 0x200000 || procSpell->SpellFamilyFlags[1] & 0x10000) && !(procEx & PROC_EX_CRITICAL_HIT)) + *handled = true; + break; + } + break; + } case SPELLFAMILY_MAGE: { // Combustion @@ -7783,7 +7861,7 @@ bool Unit::HandleAuraProc(Unit * /*pVictim*/, uint32 damage, Aura * triggeredByA if (!spInfo) return false; - int32 bp0 = this->GetCreateMana() * spInfo->CalculateSimpleValue(0) / 100; + int32 bp0 = this->GetCreateMana() * SpellMgr::CalculateSpellEffectAmount(spInfo, 0) / 100; this->CastCustomSpell(this, 67545, &bp0, NULL, NULL, true, NULL, triggeredByAura->GetEffect(0), this->GetGUID()); return true; } @@ -8137,6 +8215,24 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig target = pVictim; break; } + //Item - Coliseum 25 Heroic Caster Trinket + case 67758: + { + if(!pVictim || !pVictim->isAlive()) + return false; + // stacking + CastSpell(this, 67759, true, NULL, triggeredByAura); + + Aura * dummy = GetAura(67759); + // release at 3 aura in stack (cont contain in basepoint of trigger aura) + if(!dummy || dummy->GetStackAmount() < triggerAmount) + return false; + + RemoveAurasDueToSpell(67759); + trigger_spell_id = 67760; + target = pVictim; + break; + } default: // Illumination if (auraSpellInfo->SpellIconID == 241) @@ -8170,7 +8266,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig } // percent stored in effect 1 (class scripts) base points int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100; - basepoints0 = cost*auraSpellInfo->CalculateSimpleValue(1)/100; + basepoints0 = cost*SpellMgr::CalculateSpellEffectAmount(auraSpellInfo, 1)/100; trigger_spell_id = 20272; target = this; } @@ -9608,7 +9704,13 @@ void Unit::SetCharm(Unit* charm, bool apply) int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical) { - int32 gain = pVictim->ModifyHealth(int32(addhealth)); + uint32 absorb = 0; + // calculate heal absorb and reduce healing + CalcHealAbsorb(pVictim, spellProto, addhealth, absorb); + int32 gain = 0; + + if (addhealth) + gain = pVictim->ModifyHealth(int32(addhealth)); Unit* unit = this; @@ -9618,7 +9720,7 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro if (unit->GetTypeId() == TYPEID_PLAYER) { // overheal = addhealth - gain - unit->SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, critical); + unit->SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, absorb, critical); if (BattleGround *bg = unit->ToPlayer()->GetBattleGround()) bg->UpdatePlayerScore((Player*)unit, SCORE_HEALING_DONE, gain); @@ -9823,7 +9925,7 @@ void Unit::UnsummonAllTotems() } } -void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical) +void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical) { // we guess size WorldPacket data(SMSG_SPELLHEALLOG, (8+8+4+4+4+4+1)); @@ -9832,7 +9934,7 @@ void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 data << uint32(SpellID); data << uint32(Damage); data << uint32(OverHeal); - data << uint32(0); // Absorb amount + data << uint32(Absorb); // Absorb amount data << uint8(critical ? 1 : 0); SendMessageToSet(&data, true); } @@ -9955,7 +10057,8 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 case 5142: // Increased Lightning Damage case 5147: // Improved Consecration / Libram of Resurgence case 5148: // Idol of the Shooting Star - case 6008: // Increased Lightning Damage / Totem of Hex + case 6008: // Increased Lightning Damage + case 8627: // Totem of Hex { DoneTotal += (*i)->GetAmount(); break; @@ -10122,7 +10225,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 case 49638: { if (const SpellEntry *proto=sSpellStore.LookupEntry(itr->first)) - ApCoeffMod *= (100.0f + proto->CalculateSimpleValue(0)) / 100.0f; + ApCoeffMod *= (100.0f + SpellMgr::CalculateSpellEffectAmount(proto, 0)) / 100.0f; } break; } @@ -10371,6 +10474,10 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType) const { + // Mobs can't crit with spells. + if (IS_CREATURE_GUID(GetGUID())) + return false; + // not critting spell if ((spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_CRIT)) return false; @@ -10445,7 +10552,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM } } // Custom crit by class - switch(spellProto->SpellFamilyName) + switch (spellProto->SpellFamilyName) { case SPELLFAMILY_DRUID: // Starfire @@ -10458,6 +10565,11 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM break; } break; + case SPELLFAMILY_ROGUE: + // Shiv-applied poisons can't crit + if (FindCurrentSpellBySpellId(5938)) + crit_chance = 0.0f; + break; case SPELLFAMILY_PALADIN: // Flash of light if (spellProto->SpellFamilyFlags[0] & 0x40000000) @@ -10606,6 +10718,10 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint if (Unit* owner = GetOwner()) return owner->SpellHealingBonus(pVictim, spellProto, healamount, damagetype, stack); + // no bonus for heal potions/bandages + if (spellProto->SpellFamilyName == SPELLFAMILY_POTION /*|| spellProto->Mechanic == MECHANIC_BANDAGE*/ ) + return healamount; + // Healing Done // Taken/Done total percent damage auras float DoneTotalMod = 1.0f; @@ -10877,7 +10993,7 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) AuraEffectList const& mHealingDone = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE); for (AuraEffectList::const_iterator i = mHealingDone.begin(); i != mHealingDone.end(); ++i) - if (((*i)->GetMiscValue() & schoolMask) != 0) + if (!(*i)->GetMiscValue() || ((*i)->GetMiscValue() & schoolMask) != 0) AdvertisedBenefit += (*i)->GetAmount(); // Healing bonus of spirit, intellect and strength @@ -11094,17 +11210,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att // ..done (base at attack power for marked target and base at attack power for creature type) int32 APbonus = 0; - if (attType == RANGED_ATTACK && pVictim->GetTypeId() == TYPEID_UNIT) - { - APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS); - - // ..done (base at attack power and creature type) - AuraEffectList const& mCreatureAttackPower = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS); - for (AuraEffectList::const_iterator i = mCreatureAttackPower.begin(); i != mCreatureAttackPower.end(); ++i) - if (creatureTypeMask & uint32((*i)->GetMiscValue())) - APbonus += (*i)->GetAmount(); - } - else if (attType == RANGED_ATTACK) + if (attType == RANGED_ATTACK) { APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS); @@ -12419,7 +12525,7 @@ Unit* Creature::SelectVictim() //====================================================================== //====================================================================== -int32 Unit::ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value) +int32 Unit::ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value) const { if (Player* modOwner = GetSpellModOwner()) { @@ -12440,57 +12546,10 @@ int32 Unit::ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_inde return value; } -int32 Unit::CalculateSpellDamage(Unit const* /*target*/, SpellEntry const* spellProto, uint8 effect_index, int32 const* effBasePoints) +// function uses real base points (typically value - 1) +int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProto, uint8 effect_index, int32 const* basePoints) const { - int32 level = int32(getLevel()); - if (level > int32(spellProto->maxLevel) && spellProto->maxLevel > 0) - level = int32(spellProto->maxLevel); - else if (level < int32(spellProto->baseLevel)) - level = int32(spellProto->baseLevel); - level -= int32(spellProto->spellLevel); - - float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index]; - int32 basePoints = effBasePoints ? *effBasePoints - 1 : spellProto->EffectBasePoints[effect_index]; - basePoints += int32(level * basePointsPerLevel); - int32 randomPoints = int32(spellProto->EffectDieSides[effect_index]); - - switch(randomPoints) - { - case 0: // not used - case 1: basePoints += 1; break; // range 1..1 - default: - // range can have positive (1..rand) and negative (rand..1) values, so order its for irand - int32 randvalue = (randomPoints >= 1) - ? irand(1, randomPoints) - : irand(randomPoints, 1); - - basePoints += randvalue; - break; - } - - int32 value = basePoints; - - // random damage - //if (comboDamage != 0 && unitPlayer /*&& target && (target->GetGUID() == unitPlayer->GetComboTarget())*/) - if (m_movedPlayer) - if (uint8 comboPoints = m_movedPlayer->GetComboPoints()) - if (float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index]) - value += int32(comboDamage * comboPoints); - - value = ApplyEffectModifiers(spellProto, effect_index, value); - - if (!basePointsPerLevel && (spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel) && - spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && - spellProto->Effect[effect_index] != SPELL_EFFECT_KNOCK_BACK && - spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_SPEED_ALWAYS && - spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_SPEED_NOT_STACK && - spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_INCREASE_SPEED && - spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_DECREASE_SPEED) - //there are many more: slow speed, -healing pct - value = int32(value*0.25f*exp(getLevel()*(70-spellProto->spellLevel)/1000.0f)); - //value = int32(value * (int32)getLevel() / (int32)(spellProto->spellLevel ? spellProto->spellLevel : 1)); - - return value; + return SpellMgr::CalculateSpellEffectAmount(spellProto, effect_index, this, basePoints, target); } int32 Unit::CalcSpellDuration(SpellEntry const* spellProto) @@ -12575,7 +12634,7 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, i { // Glyph of Thorns if (AuraEffect * aurEff = GetAuraEffect(57862, 0)) - duration += aurEff->GetAmount() * MINUTE * IN_MILISECONDS; + duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS; } break; case SPELLFAMILY_PALADIN: @@ -12583,13 +12642,13 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, i { // Glyph of Blessing of Might if (AuraEffect * aurEff = GetAuraEffect(57958, 0)) - duration += aurEff->GetAmount() * MINUTE * IN_MILISECONDS; + duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS; } else if (spellProto->SpellFamilyFlags[0] & 0x00010000) { // Glyph of Blessing of Wisdom if (AuraEffect * aurEff = GetAuraEffect(57979, 0)) - duration += aurEff->GetAmount() * MINUTE * IN_MILISECONDS; + duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS; } break; } @@ -12607,11 +12666,10 @@ void Unit::ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spel if (!(spellProto->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_TRADESPELL)) && spellProto->SpellFamilyName) castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED)); - else - { - if (spellProto->Attributes & SPELL_ATTR_REQ_AMMO && !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)) - castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]); - } + else if (spellProto->Attributes & SPELL_ATTR_REQ_AMMO && !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)) + castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]); + else if (spellProto->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat. + castTime = 500; } DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) @@ -12654,10 +12712,10 @@ void Unit::IncrDiminishing(DiminishingGroup group) m_Diminishing.push_back(DiminishingReturn(group,getMSTime(),DIMINISHING_LEVEL_2)); } -void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level, int32 limitduration) +float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level, int32 limitduration) { if (duration == -1 || group == DIMINISHING_NONE || caster->IsFriendlyTo(this)) - return; + return 1.0f; // test pet/charm masters instead pets/charmeds Unit const* targetOwner = GetCharmerOrOwner(); @@ -12711,6 +12769,7 @@ void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Un } duration = int32(duration * mod); + return mod; } void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply) @@ -13277,8 +13336,7 @@ void Unit::UpdateCharmAI() { if (!isCharmed()) { - if (i_AI) - delete i_AI; + delete i_AI; i_AI = i_disabledAI; i_disabledAI = NULL; } @@ -13314,7 +13372,8 @@ void Unit::DeleteCharmInfo() } CharmInfo::CharmInfo(Unit* unit) -: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_petnumber(0), m_barInit(false) +: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_petnumber(0), m_barInit(false), + m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false) { for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i) m_charmspells[i].SetActionAndType(0,ACT_DISABLED); @@ -13623,7 +13682,6 @@ bool InitTriggerAuraData() isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true; isNonTriggerAura[SPELL_AURA_REDUCE_PUSHBACK]=true; - isTriggerAura[SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS] = true; return true; } @@ -14064,7 +14122,7 @@ void Unit::StopMoving() // send explicit stop packet // rely on vmaps here because for example stormwind is in air - //float z = MapManager::Instance().GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); + //float z = sMapMgr.GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); //if (fabs(GetPositionZ() - z) < 2.0f) // Relocate(GetPositionX(), GetPositionY(), z); //Relocate(GetPositionX(), GetPositionY(),GetPositionZ()); @@ -15146,6 +15204,10 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) if (!charmer) return false; + // unmount players when charmed + if (GetTypeId() == TYPEID_PLAYER) + Unmount(); + assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); assert((type == CHARM_TYPE_VEHICLE) == IsVehicle()); @@ -16272,7 +16334,7 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas bool Unit::SetPosition(float x, float y, float z, float orientation, bool teleport) { // prevent crash when a bad coord is sent by the client - if (!Trinity::IsValidMapCoord(x,y)) + if (!Trinity::IsValidMapCoord(x,y,z,orientation)) { sLog.outDebug("Unit::SetPosition(%f, %f, %f) .. bad coordinates!",x,y,z); return false; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index a2f4b2cd388..347a862b5d4 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -31,9 +31,12 @@ #include "HostileRefManager.h" #include "FollowerReference.h" #include "FollowerRefManager.h" -#include "Utilities/EventProcessor.h" +#include "EventProcessor.h" #include "MotionMaster.h" #include "DBCStructure.h" +#include "Path.h" +#include "WorldPacket.h" +#include "Timer.h" #include #define WORLD_TRIGGER 12999 @@ -324,7 +327,6 @@ class DynamicObject; class GameObject; class Item; class Pet; -class Path; class PetAura; class Minion; class Guardian; @@ -1104,7 +1106,7 @@ class Unit : public WorldObject DiminishingLevels GetDiminishing(DiminishingGroup group); void IncrDiminishing(DiminishingGroup group); - void ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration); + float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration); void ApplyDiminishingAura(DiminishingGroup group, bool apply); void ClearDiminishings() { m_Diminishing.clear(); } @@ -1397,7 +1399,7 @@ class Unit : public WorldObject virtual bool IsUnderWater() const; bool isInAccessiblePlaceFor(Creature const* c) const; - void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, bool critical = false); + void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype); void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype); uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage); @@ -1436,12 +1438,14 @@ class Unit : public WorldObject void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL); void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player = NULL); //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); - void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end); void SendMonsterMoveTransport(Unit *vehicleOwner); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL); void SendMovementFlagUpdate(); + template + void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end); + void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference); void SendClearThreatListOpcode(); void SendRemoveFromThreatListOpcode(HostileReference* pHostileReference); @@ -1525,7 +1529,7 @@ class Unit : public WorldObject void DeleteCharmInfo(); void UpdateCharmAI(); //Player * GetMoverSource() const; - Player *m_movedPlayer; + Player * m_movedPlayer; SharedVisionList const& GetSharedVisionList() { return m_sharedVision; } void AddPlayerToVision(Player* plr); void RemovePlayerFromVision(Player* plr); @@ -1831,6 +1835,7 @@ class Unit : public WorldObject uint32 CalcNotIgnoreDamageRedunction(uint32 damage, SpellSchoolMask damageSchoolMask); uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType=MAX_ATTACK); void CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellEntry const *spellInfo = NULL); + void CalcHealAbsorb(Unit *pVictim, const SpellEntry *spellProto, uint32 &healAmount, uint32 &absorb); void UpdateSpeed(UnitMoveType mtype, bool forced); float GetSpeed(UnitMoveType mtype) const; @@ -1841,8 +1846,8 @@ class Unit : public WorldObject void SetHover(bool on); bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); } - int32 ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value); - int32 CalculateSpellDamage(Unit const* target, SpellEntry const* spellProto, uint8 effect_index, int32 const* basePoints = NULL); + int32 ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value) const; + int32 CalculateSpellDamage(Unit const* target, SpellEntry const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const; int32 CalcSpellDuration(SpellEntry const* spellProto); int32 ModSpellDuration(SpellEntry const* spellProto, Unit const* target, int32 duration, bool positive); void ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spell * spell=NULL); @@ -2116,4 +2121,30 @@ namespace Trinity }; } +template +inline void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end) +{ + uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32); + uint32 pathSize = end - start; + WorldPacket data(SMSG_MONSTER_MOVE, (GetPackGUID().size()+1+4+4+4+4+1+4+4+4+pathSize*4*3)); + data.append(GetPackGUID()); + data << uint8(0); + data << GetPositionX(); + data << GetPositionY(); + data << GetPositionZ(); + data << uint32(getMSTime()); + data << uint8(0); + data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight()) ? (MOVEFLAG_FLY|MOVEFLAG_WALK) : MOVEFLAG_WALK); + data << uint32(traveltime); + data << uint32(pathSize); + + for (uint32 i = start; i < end; ++i) + { + data << float(path[i].x); + data << float(path[i].y); + data << float(path[i].z); + } + + SendMessageToSet(&data, true); +} #endif diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index a154c579605..850296aaafe 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -39,6 +39,27 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI ++m_usableSeatNum; } } + + // HACKY WAY, We must found a more generic way to handle this + // Set inmunities since db ones are rewritten with player's ones + switch (GetVehicleInfo()->m_ID) + { + case 160: + me->SetControlled(true, UNIT_STAT_ROOT); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + case 158: + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_FEAR, true); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_HEAL, true); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_ROOT, true); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); + me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); // Death Grip jump effect + break; + default: + break; + } assert(!m_Seats.empty()); } diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index a2c6f2f2422..f0500e177bb 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -22,18 +22,15 @@ #include "World.h" #include "ObjectMgr.h" #include "WorldPacket.h" -#include "PoolHandler.h" +#include "PoolMgr.h" #include "ProgressBar.h" #include "Language.h" #include "Log.h" #include "MapManager.h" -#include "Policies/SingletonImp.h" #include "GossipDef.h" #include "Player.h" #include "BattleGroundMgr.h" -INSTANTIATE_SINGLETON_1(GameEventMgr); - bool GameEventMgr::CheckOneGameEvent(uint16 entry) const { switch(mGameEvent[entry].state) @@ -1154,7 +1151,7 @@ uint32 GameEventMgr::Update() // return the next e for (std::set::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr) StopEvent(*itr); sLog.outDetail("Next game event check in %u seconds.", nextEventDelay + 1); - return (nextEventDelay + 1) * IN_MILISECONDS; // Add 1 second to be sure event has started/stopped at next call + return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call } void GameEventMgr::UnApplyEvent(uint16 event_id) @@ -1270,7 +1267,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) objmgr.AddCreatureToGrid(*itr, data); // Spawn if necessary (loaded grids only) - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(sMapMgr.CreateBaseMap(data->mapid)); // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -1298,7 +1295,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) objmgr.AddGameobjectToGrid(*itr, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(sMapMgr.CreateBaseMap(data->mapid)); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -1345,7 +1342,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { objmgr.RemoveCreatureFromGrid(*itr, data); - if (Creature* pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); } } @@ -1366,7 +1363,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { objmgr.RemoveGameobjectFromGrid(*itr, data); - if (GameObject* pGameobject = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); } } @@ -1392,7 +1389,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) continue; // Update if spawned - Creature* pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); + Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); if (pCreature) { if (activate) diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h index 2c3e41f5f20..656be331edc 100644 --- a/src/server/game/Events/GameEventMgr.h +++ b/src/server/game/Events/GameEventMgr.h @@ -23,8 +23,8 @@ #include "Common.h" #include "SharedDefines.h" -#include "Platform/Define.h" -#include "Policies/Singleton.h" +#include "Define.h" +#include "ace/Singleton.h" #define max_ge_check_delay DAY // 1 day in seconds @@ -92,9 +92,11 @@ class Creature; class GameEventMgr { + friend class ACE_Singleton; + GameEventMgr(); public: - GameEventMgr(); ~GameEventMgr() {}; + typedef std::set ActiveEvents; typedef std::vector GameEventDataMap; ActiveEvents const& GetActiveEventList() const { return m_ActiveEvents; } @@ -172,7 +174,7 @@ class GameEventMgr GameEventGuidMap mGameEventGameobjectGuids; }; -#define gameeventmgr Trinity::Singleton::Instance() +#define gameeventmgr (*ACE_Singleton::instance()) bool IsHolidayActive(HolidayIds id); bool IsEventActive(uint16 event_id); diff --git a/src/server/game/Globals/GlobalEvents.cpp b/src/server/game/Globals/GlobalEvents.cpp index 300527aad73..e83441cf3bb 100644 --- a/src/server/game/Globals/GlobalEvents.cpp +++ b/src/server/game/Globals/GlobalEvents.cpp @@ -23,9 +23,9 @@ */ #include "Log.h" -#include "Database/DatabaseEnv.h" -#include "Database/DatabaseImpl.h" -#include "Platform/Define.h" +#include "DatabaseEnv.h" +#include "DatabaseImpl.h" +#include "Define.h" #include "MapManager.h" #include "ObjectAccessor.h" #include "GlobalEvents.h" @@ -53,7 +53,7 @@ static void CorpsesEraseCallBack(QueryResult_AutoPtr result, bool bones) /// Resurrectable - convert corpses to bones if (!bones) { - if (!ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid)) + if (!sObjectAccessor.ConvertCorpseForPlayer(player_guid)) { sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow); CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); @@ -62,7 +62,7 @@ static void CorpsesEraseCallBack(QueryResult_AutoPtr result, bool bones) else ///- or delete bones { - MapManager::Instance().RemoveBonesFromMap(mapid, guid, positionX, positionY); + sMapMgr.RemoveBonesFromMap(mapid, guid, positionX, positionY); ///- remove bones from the database CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index cf5bc728c6e..b82944d8327 100644 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -20,7 +20,7 @@ #include "ObjectAccessor.h" #include "ObjectMgr.h" -#include "Policies/SingletonImp.h" + #include "Player.h" #include "Creature.h" #include "GameObject.h" @@ -41,10 +41,6 @@ #include -#define CLASS_LOCK Trinity::ClassLevelLockable -INSTANTIATE_SINGLETON_2(ObjectAccessor, CLASS_LOCK); -INSTANTIATE_CLASS_MUTEX(ObjectAccessor, ACE_Thread_Mutex); - ObjectAccessor::ObjectAccessor() { } @@ -151,7 +147,7 @@ Player* ObjectAccessor::FindPlayer(uint64 guid) Player* ObjectAccessor::FindPlayerByName(const char* name) { - Guard guard(*HashMapHolder::GetLock()); + ACE_GUARD_RETURN(LockType, g, *HashMapHolder::GetLock(), NULL); HashMapHolder::MapType& m = HashMapHolder::GetContainer(); for (HashMapHolder::MapType::iterator iter = m.begin(); iter != m.end(); ++iter) if (iter->second->IsInWorld() && strcmp(name, iter->second->GetName()) == 0) @@ -162,7 +158,7 @@ Player* ObjectAccessor::FindPlayerByName(const char* name) void ObjectAccessor::SaveAllPlayers() { - Guard guard(*HashMapHolder::GetLock()); + ACE_GUARD(LockType, g, *HashMapHolder::GetLock()); HashMapHolder::MapType& m = HashMapHolder::GetContainer(); for (HashMapHolder::MapType::iterator itr = m.begin(); itr != m.end(); ++itr) itr->second->SaveToDB(); @@ -175,7 +171,7 @@ Pet* ObjectAccessor::GetPet(uint64 guid) Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid) { - Guard guard(i_corpseGuard); + ACE_GUARD_RETURN(LockType, guard, i_corpseGuard, NULL); Player2CorpsesMapType::iterator iter = i_player2corpse.find(guid); if (iter == i_player2corpse.end()) @@ -197,7 +193,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse) // Critical section { - Guard guard(i_corpseGuard); + ACE_GUARD(LockType, g, i_corpseGuard); Player2CorpsesMapType::iterator iter = i_player2corpse.find(corpse->GetOwnerGUID()); if (iter == i_player2corpse.end()) // TODO: Fix this @@ -219,7 +215,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse) // Critical section { - Guard guard(i_corpseGuard); + ACE_GUARD(LockType, g, i_corpseGuard); assert(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end()); i_player2corpse[corpse->GetOwnerGUID()] = corpse; @@ -234,7 +230,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse) void ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair, GridType& grid, Map* map) { - Guard guard(i_corpseGuard); + ACE_GUARD(LockType, g, i_corpseGuard); for (Player2CorpsesMapType::iterator iter = i_player2corpse.begin(); iter != i_player2corpse.end(); ++iter) { @@ -274,7 +270,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign // done in removecorpse // remove resurrectable corpse from grid object registry (loaded state checked into call) // do not load the map if it's not loaded - //Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()); + //Map *map = sMapMgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId()); //if (map) // map->Remove(corpse, false); @@ -333,7 +329,7 @@ void ObjectAccessor::Update(uint32 /*diff*/) // Critical section { - Guard guard(i_updateGuard); + ACE_GUARD(LockType, g, i_updateGuard); while (!i_objects.empty()) { diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index 8e64eb48fa0..fc128d6a4e0 100644 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -21,11 +21,10 @@ #ifndef TRINITY_OBJECTACCESSOR_H #define TRINITY_OBJECTACCESSOR_H -#include "Platform/Define.h" -#include "Policies/Singleton.h" +#include "Define.h" +#include #include -#include "Utilities/UnorderedMap.h" -#include "Policies/ThreadingModel.h" +#include "UnorderedMap.h" #include "UpdateData.h" @@ -50,23 +49,22 @@ class HashMapHolder typedef UNORDERED_MAP MapType; typedef ACE_Thread_Mutex LockType; - typedef Trinity::GeneralLock Guard; static void Insert(T* o) { - Guard guard(i_lock); + ACE_GUARD(LockType, Guard, i_lock); m_objectMap[o->GetGUID()] = o; } static void Remove(T* o) { - Guard guard(i_lock); + ACE_GUARD(LockType, Guard, i_lock); m_objectMap.erase(o->GetGUID()); } static T* Find(uint64 guid) { - Guard guard(i_lock); + ACE_GUARD_RETURN(LockType, Guard, i_lock, NULL); typename MapType::iterator itr = m_objectMap.find(guid); return (itr != m_objectMap.end()) ? itr->second : NULL; } @@ -84,9 +82,9 @@ class HashMapHolder static MapType m_objectMap; }; -class ObjectAccessor : public Trinity::Singleton > +class ObjectAccessor { - friend class Trinity::OperatorNew; + friend class ACE_Singleton; ObjectAccessor(); ~ObjectAccessor(); ObjectAccessor(const ObjectAccessor&); @@ -220,13 +218,13 @@ class ObjectAccessor : public Trinity::Singleton Guard; private: @@ -254,4 +251,6 @@ class ObjectAccessor : public Trinity::Singleton::instance()) #endif diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ce86c2a4e77..71cd4c46b80 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -19,11 +19,9 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" -#include "Database/SQLStorage.h" -#include "Database/SQLStorageImpl.h" -#include "Policies/SingletonImp.h" - +#include "DatabaseEnv.h" +#include "SQLStorage.h" +#include "SQLStorageImpl.h" #include "Log.h" #include "MapManager.h" #include "ObjectMgr.h" @@ -33,7 +31,7 @@ #include "Group.h" #include "Guild.h" #include "ArenaTeam.h" -#include "Transports.h" +#include "Transport.h" #include "ProgressBar.h" #include "Language.h" #include "GameEventMgr.h" @@ -48,8 +46,6 @@ #include "Vehicle.h" #include "AchievementMgr.h" -INSTANTIATE_SINGLETON_1(ObjectMgr); - ScriptMapMap sQuestEndScripts; ScriptMapMap sQuestStartScripts; ScriptMapMap sSpellScripts; @@ -1177,14 +1173,14 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) if (!linkedGuid) // we're removing the linking { mCreatureLinkedRespawnMap.erase(guid); - WorldDatabase.DirectPExecute("DELETE FROM creature_linked_respawn WHERE guid = '%u'",guid); + WorldDatabase.PExecute("DELETE FROM creature_linked_respawn WHERE guid = '%u'",guid); return true; } if (CheckCreatureLinkedRespawn(guid,linkedGuid)) // we add/change linking { mCreatureLinkedRespawnMap[guid] = linkedGuid; - WorldDatabase.DirectPExecute("REPLACE INTO creature_linked_respawn (guid,linkedGuid) VALUES ('%u','%u')",guid,linkedGuid); + WorldDatabase.PExecute("REPLACE INTO creature_linked_respawn (guid,linkedGuid) VALUES ('%u','%u')",guid,linkedGuid); return true; } return false; @@ -1412,7 +1408,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float if (!goinfo) return 0; - Map* map = const_cast(MapManager::Instance().CreateBaseMap(mapId)); + Map* map = const_cast(sMapMgr.CreateBaseMap(mapId)); if (!map) return 0; @@ -1473,7 +1469,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos) AddCreatureToGrid(guid, &data); // Spawn if necessary (loaded grids only) - if (Map* map = const_cast(MapManager::Instance().CreateBaseMap(mapId))) + if (Map* map = const_cast(sMapMgr.CreateBaseMap(mapId))) { // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data.posX, data.posY)) @@ -1524,7 +1520,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float AddCreatureToGrid(guid, &data); // Spawn if necessary (loaded grids only) - if (Map* map = const_cast(MapManager::Instance().CreateBaseMap(mapId))) + if (Map* map = const_cast(sMapMgr.CreateBaseMap(mapId))) { // We use spawn coords to spawn if (!map->Instanceable() && !map->IsRemovalGrid(x, y)) @@ -2260,10 +2256,17 @@ void ObjectMgr::LoadItemPrototypes() const_cast(proto)->Sheath = SHEATHETYPE_NONE; } - if (proto->RandomProperty && !sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty))) + if (proto->RandomProperty) { - sLog.outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty); - const_cast(proto)->RandomProperty = 0; + // To be implemented later + if (proto->RandomProperty == -1) + const_cast(proto)->RandomProperty = 0; + + else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty))) + { + sLog.outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty); + const_cast(proto)->RandomProperty = 0; + } } if (proto->RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(proto->RandomSuffix))) @@ -2368,7 +2371,132 @@ void ObjectMgr::LoadItemPrototypes() } for (std::set::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr) - sLog.outErrorDb("Item (Entry: %u) not exist in `item_template` but referenced in `CharStartOutfit.dnc`", *itr); + sLog.outErrorDb("Item (Entry: %u) not exist in `item_template` but referenced in `CharStartOutfit.dbc`", *itr); +} + +void ObjectMgr::LoadItemSetNameLocales() +{ + mItemSetNameLocaleMap.clear(); // need for reload case + + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`name_loc1`,`name_loc2`,`name_loc3`,`name_loc4`,`name_loc5`,`name_loc6`,`name_loc7`,`name_loc8` FROM `locales_item_set_names`"); + + if (!result) + return; + + barGoLink bar(result->GetRowCount()); + + do + { + Field *fields = result->Fetch(); + bar.step(); + + uint32 entry = fields[0].GetUInt32(); + + ItemSetNameLocale& data = mItemSetNameLocaleMap[entry]; + + for (uint8 i = 1; i < MAX_LOCALE; ++i) + { + std::string str = fields[i].GetCppString(); + if (!str.empty()) + { + int idx = GetOrNewIndexForLocale(LocaleConstant(i)); + if (idx >= 0) + { + if (data.Name.size() <= idx) + data.Name.resize(idx+1); + + data.Name[idx] = str; + } + } + } + } while (result->NextRow()); + + sLog.outString(); + sLog.outString(">> Loaded %lu Item set name locale strings", (uint32)mItemSetNameLocaleMap.size()); +} + +void ObjectMgr::LoadItemSetNames() +{ + mItemSetNameMap.clear(); // needed for reload case + + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT `entry`,`name`,`InventoryType` FROM `item_set_names`"); + + uint32 count = 0; + std::set itemSetItems; + + // fill item set member ids + for (uint32 entryId = 0; entryId < sItemSetStore.GetNumRows(); ++entryId) + { + ItemSetEntry const* setEntry = sItemSetStore.LookupEntry(entryId); + if (!setEntry) + continue; + + for (uint32 i = 0; i < MAX_ITEM_SET_ITEMS; ++i) + if (setEntry->itemId[i]) + itemSetItems.insert(setEntry->itemId[i]); + } + + if (result) + { + barGoLink bar(result->GetRowCount()); + do + { + Field *fields = result->Fetch(); + bar.step(); + + uint32 entry = fields[0].GetUInt32(); + if (itemSetItems.find(entry) == itemSetItems.end()) + { + sLog.outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry); + continue; + } + + ItemSetNameEntry &data = mItemSetNameMap[entry]; + data.name = fields[1].GetCppString(); + + uint32 invType = fields[2].GetUInt32(); + if (invType >= MAX_INVTYPE) + { + sLog.outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); + invType = INVTYPE_NON_EQUIP; + } + + data.InventoryType = invType; + itemSetItems.erase(entry); + ++count; + } while (result->NextRow()); + } + else + { + barGoLink bar(1); + bar.step(); + + sLog.outString(); + sLog.outErrorDb(">> Loaded 0 item set names. DB table `item_set_names` is empty."); + } + + if (!itemSetItems.empty()) + { + ItemPrototype const* pProto; + for (std::set::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr) + { + uint32 entry = *itr; + // add data from item_template if available + if (pProto = GetItemPrototype(entry)) + { + sLog.outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); + ItemSetNameEntry &data = mItemSetNameMap[entry]; + data.name = pProto->Name1; + data.InventoryType = pProto->InventoryType; + ++count; + } + else + sLog.outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry); + } + } + + sLog.outString(); + sLog.outString(">> Loaded %u item set names", count); } void ObjectMgr::LoadVehicleAccessories() @@ -2462,7 +2590,7 @@ void ObjectMgr::LoadPetLevelInfo() sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); else { - sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `pet_levelstats` table, ignoring.",current_level); + sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.",current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -2535,6 +2663,47 @@ PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) return &itr->second[level-1]; // data for level 1 stored in [0] array element, ... } +void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count) +{ + if (count > 0) + playerInfo[race_][class_].item.push_back(PlayerCreateInfoItem(itemId, count)); + else + { + if (count < -1) + sLog.outErrorDb("Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId); + + uint32 RaceClass = (race_) | (class_ << 8); + bool doneOne = false; + for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i) + { + if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(i)) + { + if (entry->RaceClassGender == RaceClass || entry->RaceClassGender == (RaceClass | (1 << 16))) + { + bool found = false; + for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) + { + if (entry->ItemId[x] == itemId) + { + found = true; + const_cast(entry)->ItemId[x] = 0; + break; + } + } + + if (!found) + sLog.outErrorDb("Item %u specified to be removed from original create info not found in dbc!", itemId); + + if (!doneOne) + doneOne = true; + else + break; + } + } + } + } +} + void ObjectMgr::LoadPlayerInfo() { // Load playercreate @@ -2665,8 +2834,6 @@ void ObjectMgr::LoadPlayerInfo() continue; } - PlayerInfo* pInfo = &playerInfo[current_race][current_class]; - uint32 item_id = fields[2].GetUInt32(); if (!GetItemPrototype(item_id)) @@ -2675,7 +2842,7 @@ void ObjectMgr::LoadPlayerInfo() continue; } - uint32 amount = fields[3].GetUInt32(); + int32 amount = fields[3].GetInt32(); if (!amount) { @@ -2683,7 +2850,18 @@ void ObjectMgr::LoadPlayerInfo() continue; } - pInfo->item.push_back(PlayerCreateInfoItem(item_id, amount)); + if (!current_race || !current_class) + { + uint32 min_race = current_race ? current_race : 1; + uint32 max_race = current_race ? current_race + 1 : MAX_RACES; + uint32 min_class = current_class ? current_class : 1; + uint32 max_class = current_class ? current_class + 1 : MAX_CLASSES; + for (uint32 r = min_race; r < max_race; ++r) + for (uint32 c = min_class; c < max_class; ++c) + PlayerCreateInfoAddItemHelper(r, c, item_id, amount); + } + else + PlayerCreateInfoAddItemHelper(current_race, current_class, item_id, amount); bar.step(); ++count; @@ -2849,7 +3027,7 @@ void ObjectMgr::LoadPlayerInfo() sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); else { - sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level); + sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -2946,7 +3124,7 @@ void ObjectMgr::LoadPlayerInfo() sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); else { - sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_levelstats` table, ignoring.",current_level); + sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.",current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3056,7 +3234,7 @@ void ObjectMgr::LoadPlayerInfo() sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level); else { - sLog.outDetail("Unused (> MaxPlayerLevel in TrinityCore.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level); + sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3244,7 +3422,7 @@ void ObjectMgr::LoadGuilds() !newGuild->LoadMembersFromDB(guildMembersResult) || !newGuild->LoadBankRightsFromDB(guildBankTabRightsResult) || !newGuild->CheckGuildStructure() -) + ) { newGuild->Disband(); delete newGuild; @@ -4638,26 +4816,9 @@ void ObjectMgr::LoadEventScripts() // Load all possible script entries from gameobjects for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i) { - GameObjectInfo const * goInfo = sGOStorage.LookupEntry(i); - if (goInfo) - { - switch(goInfo->type) - { - case GAMEOBJECT_TYPE_GOOBER: - if (goInfo->goober.eventId) - evt_scripts.insert(goInfo->goober.eventId); - break; - case GAMEOBJECT_TYPE_CHEST: - if (goInfo->chest.eventId) - evt_scripts.insert(goInfo->chest.eventId); - break; - case GAMEOBJECT_TYPE_CAMERA: - if (goInfo->camera.eventID) - evt_scripts.insert(goInfo->camera.eventID); - default: - break; - } - } + if (GameObjectInfo const * goInfo = sGOStorage.LookupEntry(i)) + if (uint32 eventId = goInfo->GetEventScriptId()) + evt_scripts.insert(eventId); } // Load all possible script entries from spells for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) @@ -4676,6 +4837,20 @@ void ObjectMgr::LoadEventScripts() } } + for(size_t path_idx = 0; path_idx < sTaxiPathNodesByPath.size(); ++path_idx) + { + for(size_t node_idx = 0; node_idx < sTaxiPathNodesByPath[path_idx].size(); ++node_idx) + { + TaxiPathNodeEntry const& node = sTaxiPathNodesByPath[path_idx][node_idx]; + + if (node.arrivalEventID) + evt_scripts.insert(node.arrivalEventID); + + if (node.departureEventID) + evt_scripts.insert(node.departureEventID); + } + } + // Then check if all scripts are in above list of possible script entries for (ScriptMapMap::const_iterator itr = sEventScripts.begin(); itr != sEventScripts.end(); ++itr) { @@ -4693,7 +4868,7 @@ void ObjectMgr::LoadWaypointScripts() for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr) { - QueryResult_AutoPtr query = WorldDatabase.PQuery("SELECT * FROM waypoint_scripts WHERE id = %u", itr->first); + QueryResult_AutoPtr query = WorldDatabase.PQuery("SELECT * FROM waypoint_data WHERE action = %u", itr->first); if (!query || !query->GetRowCount()) sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", itr->first); } @@ -5307,46 +5482,6 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt return mount_id; } -void ObjectMgr::GetTaxiPathNodes(uint32 path, Path &pathnodes, std::vector& mapIds) -{ - if (path >= sTaxiPathNodesByPath.size()) - return; - - TaxiPathNodeList& nodeList = sTaxiPathNodesByPath[path]; - - pathnodes.Resize(nodeList.size()); - mapIds.resize(nodeList.size()); - - for (size_t i = 0; i < nodeList.size(); ++i) - { - pathnodes[ i ].x = nodeList[i].x; - pathnodes[ i ].y = nodeList[i].y; - pathnodes[ i ].z = nodeList[i].z; - - mapIds[i] = nodeList[i].mapid; - } -} - -void ObjectMgr::GetTransportPathNodes(uint32 path, TransportPath &pathnodes) -{ - if (path >= sTaxiPathNodesByPath.size()) - return; - - TaxiPathNodeList& nodeList = sTaxiPathNodesByPath[path]; - - pathnodes.Resize(nodeList.size()); - - for (size_t i = 0; i < nodeList.size(); ++i) - { - pathnodes[ i ].mapid = nodeList[i].mapid; - pathnodes[ i ].x = nodeList[i].x; - pathnodes[ i ].y = nodeList[i].y; - pathnodes[ i ].z = nodeList[i].z; - pathnodes[ i ].actionFlag = nodeList[i].actionFlag; - pathnodes[ i ].delay = nodeList[i].delay; - } -} - void ObjectMgr::LoadGraveyardZones() { mGraveYardMap.clear(); // need for reload case @@ -5415,7 +5550,7 @@ void ObjectMgr::LoadGraveyardZones() WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) { // search for zone associated closest graveyard - uint32 zoneId = MapManager::Instance().GetZoneId(MapId,x,y,z); + uint32 zoneId = sMapMgr.GetZoneId(MapId,x,y,z); // Simulate std. algorithm: // found some graveyard associated to (ghost_zone,ghost_map) @@ -6476,7 +6611,7 @@ void ObjectMgr::LoadCorpses() continue; } - ObjectAccessor::Instance().AddCorpse(corpse); + sObjectAccessor.AddCorpse(corpse); ++count; } @@ -6488,6 +6623,9 @@ void ObjectMgr::LoadCorpses() void ObjectMgr::LoadReputationOnKill() { + // For reload case + mRepOnKill.clear(); + uint32 count = 0; // 0 1 2 @@ -6529,7 +6667,7 @@ void ObjectMgr::LoadReputationOnKill() if (!GetCreatureTemplate(creature_id)) { - sLog.outErrorDb("Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped",creature_id); + sLog.outErrorDb("Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id); continue; } @@ -6538,7 +6676,7 @@ void ObjectMgr::LoadReputationOnKill() FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(repOnKill.repfaction1); if (!factionEntry1) { - sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`",repOnKill.repfaction1); + sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.repfaction1); continue; } } @@ -6548,7 +6686,7 @@ void ObjectMgr::LoadReputationOnKill() FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(repOnKill.repfaction2); if (!factionEntry2) { - sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`",repOnKill.repfaction2); + sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.repfaction2); continue; } } @@ -7953,12 +8091,12 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s uint32 incrtime = fields[2].GetUInt32(); uint32 ExtendedCost = fields[3].GetUInt32(); - if (!IsVendorItemValid(vendor,item_id,maxcount,incrtime,ExtendedCost,NULL,skip_vendors)) + if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, NULL, skip_vendors)) continue; VendorItemData& vList = m_mCacheVendorItemMap[vendor]; - vList.AddItem(item_id,maxcount,incrtime,ExtendedCost); + vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } @@ -8008,12 +8146,12 @@ void ObjectMgr::LoadVendors() uint32 incrtime = fields[3].GetUInt32(); uint32 ExtendedCost = fields[4].GetUInt32(); - if (!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost,NULL,&skip_vendors)) + if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, NULL, &skip_vendors)) continue; VendorItemData& vList = m_mCacheVendorItemMap[entry]; - vList.AddItem(item_id,maxcount,incrtime,ExtendedCost); + vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } @@ -8128,7 +8266,7 @@ void ObjectMgr::LoadGossipMenuItems() QueryResult_AutoPtr result = WorldDatabase.Query( "SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, " "action_menu_id, action_poi_id, action_script_id, box_coded, box_money, box_text " - "FROM gossip_menu_option"); + "FROM gossip_menu_option ORDER BY menu_id, id"); if (!result) { @@ -8223,9 +8361,10 @@ void ObjectMgr::LoadGossipMenuItems() void ObjectMgr::AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb) { VendorItemData& vList = m_mCacheVendorItemMap[entry]; - vList.AddItem(item,maxcount,incrtime,extendedcost); + vList.AddItem(item, maxcount, incrtime, extendedcost); - if (savetodb) WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost); + if (savetodb) + WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')", entry, item, maxcount, incrtime, extendedcost); } bool ObjectMgr::RemoveVendorItem(uint32 entry,uint32 item, bool savetodb) @@ -8273,16 +8412,16 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id); else - sLog.outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore",vendor_entry,item_id); + sLog.outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id); return false; } if (ExtendedCost && !sItemExtendedCostStore.LookupEntry(ExtendedCost)) { if (pl) - ChatHandler(pl).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST,ExtendedCost); + ChatHandler(pl).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost); else - sLog.outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore",item_id,ExtendedCost,vendor_entry); + sLog.outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry); return false; } @@ -8307,7 +8446,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (!vItems) return true; // later checks for non-empty lists - if(vItems->FindItemCostPair(item_id,ExtendedCost)) + if (vItems->FindItemCostPair(item_id, ExtendedCost)) { if (pl) ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost); @@ -8462,40 +8601,6 @@ CreatureInfo const *GetCreatureInfo(uint32 id) return objmgr.GetCreatureTemplate(id); } -void ObjectMgr::LoadTransportEvents() -{ - - QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events"); - - if (!result) - { - barGoLink bar1(1); - bar1.step(); - sLog.outString("\n>> Transport events table is empty \n"); - return; - } - - barGoLink bar1(result->GetRowCount()); - - do - { - bar1.step(); - - Field *fields = result->Fetch(); - - //Load event values - uint32 entry = fields[0].GetUInt32(); - uint32 waypoint_id = fields[1].GetUInt32(); - uint32 event_id = fields[2].GetUInt32(); - - uint32 event_count = (entry*100)+waypoint_id; - TransportEventMap[event_count] = event_id; - } - while (result->NextRow()); - - sLog.outString("\n>> Loaded %u transport events \n", result->GetRowCount()); -} - CreatureInfo const* GetCreatureTemplateStore(uint32 entry) { return sCreatureStorage.LookupEntry(entry); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 79b6ffdd0eb..7b7e0e2bdb9 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -30,16 +30,15 @@ #include "GameObject.h" #include "Corpse.h" #include "QuestDef.h" -#include "Path.h" #include "ItemPrototype.h" #include "NPCHandler.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Mail.h" #include "Map.h" #include "ObjectAccessor.h" #include "ObjectDefines.h" -#include "Policies/Singleton.h" -#include "Database/SQLStorage.h" +#include "ace/Singleton.h" +#include "SQLStorage.h" #include "Vehicle.h" #include "ObjectMgr.h" #include @@ -60,8 +59,6 @@ extern SQLStorage sInstanceTemplate; class Group; class Guild; class ArenaTeam; -class Path; -class TransportPath; class Item; struct GameTele @@ -164,6 +161,7 @@ typedef UNORDERED_MAP GameObjectDataMap; typedef UNORDERED_MAP CreatureLocaleMap; typedef UNORDERED_MAP GameObjectLocaleMap; typedef UNORDERED_MAP ItemLocaleMap; +typedef UNORDERED_MAP ItemSetNameLocaleMap; typedef UNORDERED_MAP QuestLocaleMap; typedef UNORDERED_MAP NpcTextLocaleMap; typedef UNORDERED_MAP PageTextLocaleMap; @@ -356,11 +354,11 @@ class PlayerDumpReader; class ObjectMgr { friend class PlayerDumpReader; - + friend class ACE_Singleton; + ObjectMgr(); + ~ObjectMgr(); + public: - ObjectMgr(); - ~ObjectMgr(); - typedef UNORDERED_MAP ItemMap; typedef std::set< Group * > GroupSet; @@ -384,9 +382,7 @@ class ObjectMgr typedef std::vector ScriptNameMap; - UNORDERED_MAP TransportEventMap; - - Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);} + Player* GetPlayer(const char* name) const { return sObjectAccessor.FindPlayerByName(name);} Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); } static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry(id); } @@ -431,6 +427,14 @@ class ObjectMgr static ItemPrototype const* GetItemPrototype(uint32 id) { return sItemStorage.LookupEntry(id); } + ItemSetNameEntry const* GetItemSetNameEntry(uint32 itemId) + { + ItemSetNameMap::iterator itr = mItemSetNameMap.find(itemId); + if(itr != mItemSetNameMap.end()) + return &itr->second; + return NULL; + } + static InstanceTemplate const* GetInstanceTemplate(uint32 map) { return sInstanceTemplate.LookupEntry(map); @@ -464,8 +468,6 @@ class ObjectMgr uint32 GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team); void GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uint32 &cost); uint32 GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt_team = false); - void GetTaxiPathNodes(uint32 path, Path &pathnodes, std::vector& mapIds); - void GetTransportPathNodes(uint32 path, TransportPath &pathnodes); Quest const* GetQuestTemplate(uint32 quest_id) const { @@ -585,8 +587,6 @@ class ObjectMgr void LoadGossipScripts(); void LoadWaypointScripts(); - void LoadTransportEvents(); - bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value); bool LoadTrinityStrings() { return LoadTrinityStrings(WorldDatabase,"trinity_string",MIN_TRINITY_STRING_ID,MAX_TRINITY_STRING_ID); } void LoadDbScriptStrings(); @@ -607,6 +607,8 @@ class ObjectMgr void LoadGameobjectRespawnTimes(); void LoadItemPrototypes(); void LoadItemLocales(); + void LoadItemSetNames(); + void LoadItemSetNameLocales(); void LoadQuestLocales(); void LoadNpcTextLocales(); void LoadPageTextLocales(); @@ -740,6 +742,12 @@ class ObjectMgr if (itr == mItemLocaleMap.end()) return NULL; return &itr->second; } + ItemSetNameLocale const* GetItemSetNameLocale(uint32 entry) const + { + ItemSetNameLocaleMap::const_iterator itr = mItemSetNameLocaleMap.find(entry); + if (itr == mItemSetNameLocaleMap.end())return NULL; + return &itr->second; + } QuestLocale const* GetQuestLocale(uint32 entry) const { QuestLocaleMap::const_iterator itr = mQuestLocaleMap.find(entry); @@ -875,7 +883,7 @@ class ObjectMgr return &iter->second; } void AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event - bool RemoveVendorItem(uint32 entry,uint32 item, bool savetodb = true); // for event + bool RemoveVendorItem(uint32 entry, uint32 item, bool savetodb = true); // for event bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set* skip_vendors = NULL, uint32 ORnpcflag = 0) const; void LoadScriptNames(); @@ -1018,6 +1026,7 @@ class ObjectMgr void LoadCreatureAddons(SQLStorage& creatureaddons, char const* entryName, char const* comment); void ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* table, char const* guidEntryStr); void LoadQuestRelationsHelper(QuestRelations& map,char const* table); + void PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint32 itemId, int32 count); MailLevelRewardMap m_mailLevelRewardMap; @@ -1045,6 +1054,9 @@ class ObjectMgr HalfNameMap PetHalfName0; HalfNameMap PetHalfName1; + typedef UNORDERED_MAP ItemSetNameMap; + ItemSetNameMap mItemSetNameMap; + MapObjectGuids mMapObjectGuids; CreatureDataMap mCreatureDataMap; CreatureLinkedRespawnMap mCreatureLinkedRespawnMap; @@ -1052,6 +1064,7 @@ class ObjectMgr GameObjectDataMap mGameObjectDataMap; GameObjectLocaleMap mGameObjectLocaleMap; ItemLocaleMap mItemLocaleMap; + ItemSetNameLocaleMap mItemSetNameLocaleMap; QuestLocaleMap mQuestLocaleMap; NpcTextLocaleMap mNpcTextLocaleMap; PageTextLocaleMap mPageTextLocaleMap; @@ -1070,7 +1083,7 @@ class ObjectMgr }; -#define objmgr Trinity::Singleton::Instance() +#define objmgr (*ACE_Singleton::instance()) // scripting access functions bool LoadTrinityStrings(DatabaseType& db, char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits::min()); diff --git a/src/server/game/Grids/Cells/Cell.h b/src/server/game/Grids/Cells/Cell.h index 49e0329ace6..4bc08e3b1b9 100644 --- a/src/server/game/Grids/Cells/Cell.h +++ b/src/server/game/Grids/Cells/Cell.h @@ -23,8 +23,8 @@ #include -#include "GameSystem/TypeContainer.h" -#include "GameSystem/TypeContainerVisitor.h" +#include "TypeContainer.h" +#include "TypeContainerVisitor.h" #include "GridDefines.h" diff --git a/src/server/game/Grids/Grid.h b/src/server/game/Grids/Grid.h index 65bf3c92f9d..2e300ac5e38 100644 --- a/src/server/game/Grids/Grid.h +++ b/src/server/game/Grids/Grid.h @@ -32,8 +32,7 @@ Grid's perspective, the loader meets its API requirement is suffice. */ -#include "Platform/Define.h" -#include "Policies/ThreadingModel.h" +#include "Define.h" #include "TypeContainer.h" #include "TypeContainerVisitor.h" @@ -44,8 +43,7 @@ template < class ACTIVE_OBJECT, class WORLD_OBJECT_TYPES, -class GRID_OBJECT_TYPES, -class ThreadModel = Trinity::SingleThreaded +class GRID_OBJECT_TYPES > class Grid { @@ -131,9 +129,6 @@ class Grid }*/ private: - typedef typename ThreadModel::Lock Guard; - typedef typename ThreadModel::VolatileType VolatileType; - TypeMapContainer i_container; TypeMapContainer i_objects; //typedef std::set ActiveGridObjects; diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 5269d0a094d..620b8dd2a03 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -22,7 +22,7 @@ #define TRINITY_GRIDDEFINES_H #include "Common.h" -#include "GameSystem/NGrid.h" +#include "NGrid.h" #include // Forward class definitions @@ -42,7 +42,7 @@ class Player; #define CENTER_GRID_OFFSET (SIZE_OF_GRIDS/2) -#define MIN_GRID_DELAY (MINUTE*IN_MILISECONDS) +#define MIN_GRID_DELAY (MINUTE*IN_MILLISECONDS) #define MIN_MAP_UPDATE_DELAY 50 #define SIZE_OF_GRID_CELL (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS) diff --git a/src/server/game/Grids/GridLoader.h b/src/server/game/Grids/GridLoader.h index 03fa0f5b813..ca80451e023 100644 --- a/src/server/game/Grids/GridLoader.h +++ b/src/server/game/Grids/GridLoader.h @@ -32,7 +32,7 @@ GridLoader manages the grid (both local and remote). */ -#include "Platform/Define.h" +#include "Define.h" #include "Grid.h" #include "TypeContainerVisitor.h" diff --git a/src/server/game/Grids/GridRefManager.h b/src/server/game/Grids/GridRefManager.h index 79799105fb7..44a6c9b802c 100644 --- a/src/server/game/Grids/GridRefManager.h +++ b/src/server/game/Grids/GridRefManager.h @@ -21,7 +21,7 @@ #ifndef _GRIDREFMANAGER #define _GRIDREFMANAGER -#include "Utilities/LinkedReference/RefManager.h" +#include "RefManager.h" template class GridReference; diff --git a/src/server/game/Grids/GridReference.h b/src/server/game/Grids/GridReference.h index d2e3a455895..0f5b46b4950 100644 --- a/src/server/game/Grids/GridReference.h +++ b/src/server/game/Grids/GridReference.h @@ -21,7 +21,7 @@ #ifndef _GRIDREFERENCE_H #define _GRIDREFERENCE_H -#include "Utilities/LinkedReference/Reference.h" +#include "LinkedReference/Reference.h" template class GridRefManager; diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp index 9d39531cfad..0f725539d00 100644 --- a/src/server/game/Grids/GridStates.cpp +++ b/src/server/game/Grids/GridStates.cpp @@ -20,7 +20,7 @@ #include "GridStates.h" #include "GridNotifiers.h" -#include "GameSystem/Grid.h" +#include "Grid.h" #include "Log.h" void diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h index 3810286e123..1411ac71c4a 100644 --- a/src/server/game/Grids/NGrid.h +++ b/src/server/game/Grids/NGrid.h @@ -24,8 +24,8 @@ /** NGrid is nothing more than a wrapper of the Grid with an NxN cells */ -#include "GameSystem/Grid.h" -#include "GameSystem/GridReference.h" +#include "Grid.h" +#include "GridReference.h" #include "Timer.h" #include "Util.h" @@ -74,14 +74,13 @@ template unsigned int N, class ACTIVE_OBJECT, class WORLD_OBJECT_TYPES, -class GRID_OBJECT_TYPES, -class ThreadModel = Trinity::SingleThreaded +class GRID_OBJECT_TYPES > class NGrid { public: - typedef Grid GridType; + typedef Grid GridType; NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) : i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false) { @@ -109,7 +108,7 @@ class NGrid int32 getX() const { return i_x; } int32 getY() const { return i_y; } - void link(GridRefManager >* pTo) + void link(GridRefManager >* pTo) { i_Reference.link(pTo, this); } @@ -178,7 +177,7 @@ class NGrid uint32 i_gridId; GridInfo i_GridInfo; - GridReference > i_Reference; + GridReference > i_Reference; int32 i_x; int32 i_y; grid_state_t i_cellstate; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index b10dfa8791e..88d17b0286f 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -25,7 +25,7 @@ #include "UpdateData.h" #include "Item.h" #include "Map.h" -#include "Transports.h" +#include "Transport.h" #include "ObjectAccessor.h" #include "CellImpl.h" diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index ab69d9a966b..f0da10975ac 100644 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -151,7 +151,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType uint32 player_guid = itr->first; - Corpse *obj = ObjectAccessor::Instance().GetCorpseForPlayerGUID(player_guid); + Corpse *obj = sObjectAccessor.GetCorpseForPlayerGUID(player_guid); if (!obj) continue; diff --git a/src/server/game/Grids/ObjectGridLoader.h b/src/server/game/Grids/ObjectGridLoader.h index e890bf8d482..c1a59cb4ecb 100644 --- a/src/server/game/Grids/ObjectGridLoader.h +++ b/src/server/game/Grids/ObjectGridLoader.h @@ -21,9 +21,9 @@ #ifndef TRINITY_OBJECTGRIDLOADER_H #define TRINITY_OBJECTGRIDLOADER_H -#include "Utilities/TypeList.h" -#include "Platform/Define.h" -#include "GameSystem/GridLoader.h" +#include "TypeList.h" +#include "Define.h" +#include "GridLoader.h" #include "GridDefines.h" #include "Cell.h" diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index acd19e02838..614c6a45143 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -79,8 +79,7 @@ Group::~Group() itr2->second.save->RemoveGroup(this); // Sub group counters clean up - if (m_subGroupsCounts) - delete[] m_subGroupsCounts; + delete[] m_subGroupsCounts; } bool Group::Create(const uint64 &guid, const char * name) @@ -486,13 +485,6 @@ void Group::Disband(bool hideDestroy) CharacterDatabase.CommitTransaction(); ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL); ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL); - // FIXME - Safe check! Debug purposes - Will remove after a time if got no reports - QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(1) FROM group_instance WHERE guid=%u", lowguid); - if (result) - { - sLog.outError("Group::Disband: %u instances are not being properly deleted from group %u", (*result)[0].GetUInt8(), lowguid); - CharacterDatabase.PExecute("DELETE FROM group_instance WHERE guid=%u", lowguid); - } } m_guid = 0; @@ -1200,7 +1192,7 @@ bool Group::_addMember(const uint64 &guid, const char* name) if (m_subGroupsCounts) { bool groupFound = false; - for (; groupid < MAXRAIDSIZE/MAXGROUPSIZE; ++groupid) + for (; groupid < MAX_RAID_SUBGROUPS; ++groupid) { if (m_subGroupsCounts[groupid] < MAXGROUPSIZE) { @@ -1453,17 +1445,20 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group) { if (!isRaidGroup()) return; + Player *player = objmgr.GetPlayer(guid); if (!player) { - uint8 prevSubGroup; - prevSubGroup = GetMemberGroup(guid); - - SubGroupCounterDecrease(prevSubGroup); + uint8 prevSubGroup = GetMemberGroup(guid); + if (prevSubGroup == group) + return; if (_setMembersGroup(guid, group)) + { + SubGroupCounterDecrease(prevSubGroup); SendUpdate(); + } } else // This methods handles itself groupcounter decrease @@ -1475,9 +1470,13 @@ void Group::ChangeMembersGroup(Player *player, const uint8 &group) { if (!player || !isRaidGroup()) return; + + uint8 prevSubGroup = player->GetSubGroup(); + if (prevSubGroup == group) + return; + if (_setMembersGroup(player->GetGUID(), group)) { - uint8 prevSubGroup = player->GetSubGroup(); if (player->GetGroup() == this) player->GetGroupRef().setSubGroup(group); //if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference @@ -1725,7 +1724,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) bool isEmpty = true; // if the map is loaded, reset it - Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId()); + Map *map = sMapMgr.FindMap(p->GetMapId(), p->GetInstanceId()); if (map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset())) { if (p->CanReset()) @@ -1761,21 +1760,7 @@ InstanceGroupBind* Group::GetBoundInstance(Player* player) { uint32 mapid = player->GetMapId(); MapEntry const* mapEntry = sMapStore.LookupEntry(mapid); - if (!mapEntry) - return NULL; - - Difficulty difficulty = player->GetDifficulty(mapEntry->IsRaid()); - - // some instances only have one difficulty - MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty); - if (!mapDiff) - difficulty = DUNGEON_DIFFICULTY_NORMAL; - - BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid); - if (itr != m_boundInstances[difficulty].end()) - return &itr->second; - else - return NULL; + return GetBoundInstance(mapEntry); } InstanceGroupBind* Group::GetBoundInstance(Map* aMap) @@ -1795,6 +1780,25 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap) return NULL; } +InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) +{ + if (!mapEntry) + return NULL; + + Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); + + // some instances only have one difficulty + MapDifficulty const* mapDiff = GetMapDifficultyData(mapEntry->MapID,difficulty); + if (!mapDiff) + difficulty = DUNGEON_DIFFICULTY_NORMAL; + + BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID); + if (itr != m_boundInstances[difficulty].end()) + return &itr->second; + else + return NULL; +} + InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, bool load) { diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 808de417b79..2b93b7b1d6e 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -33,6 +33,7 @@ #define MAXGROUPSIZE 5 #define MAXRAIDSIZE 40 +#define MAX_RAID_SUBGROUPS MAXRAIDSIZE/MAXGROUPSIZE #define TARGETICONCOUNT 8 enum RollVote @@ -260,7 +261,7 @@ class Group { member_citerator mslot = _getMemberCSlot(guid); if (mslot == m_memberSlots.end()) - return (MAXRAIDSIZE/MAXGROUPSIZE+1); + return (MAX_RAID_SUBGROUPS+1); return mslot->group; } @@ -357,6 +358,7 @@ class Group void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false); InstanceGroupBind* GetBoundInstance(Player* player); InstanceGroupBind* GetBoundInstance(Map* aMap); + InstanceGroupBind* GetBoundInstance(MapEntry const* mapEntry); BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; } // FG: evil hacks @@ -381,9 +383,9 @@ class Group { // Sub group counters initialization if (!m_subGroupsCounts) - m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE]; + m_subGroupsCounts = new uint8[MAX_RAID_SUBGROUPS]; - memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8)); + memset((void*)m_subGroupsCounts, 0, (MAX_RAID_SUBGROUPS)*sizeof(uint8)); for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) ++m_subGroupsCounts[itr->group]; diff --git a/src/server/game/Groups/GroupRefManager.h b/src/server/game/Groups/GroupRefManager.h index 4fdeba2dd8c..19c4c8122c1 100644 --- a/src/server/game/Groups/GroupRefManager.h +++ b/src/server/game/Groups/GroupRefManager.h @@ -21,7 +21,7 @@ #ifndef _GROUPREFMANAGER #define _GROUPREFMANAGER -#include "Utilities/LinkedReference/RefManager.h" +#include "RefManager.h" class Group; class Player; diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h index 76f54c5230f..56dc5a3375f 100644 --- a/src/server/game/Groups/GroupReference.h +++ b/src/server/game/Groups/GroupReference.h @@ -21,7 +21,7 @@ #ifndef _GROUPREFERENCE_H #define _GROUPREFERENCE_H -#include "Utilities/LinkedReference/Reference.h" +#include "LinkedReference/Reference.h" class Group; class Player; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 418e409998f..f1f3187bc32 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "WorldSession.h" #include "Player.h" @@ -30,7 +30,7 @@ #include "Util.h" #include "Language.h" #include "World.h" -#include "Config/ConfigEnv.h" +#include "ConfigEnv.h" Guild::Guild() { diff --git a/src/server/game/Instances/InstanceData.cpp b/src/server/game/Instances/InstanceData.cpp index 214c5ca2327..7408efe97e5 100644 --- a/src/server/game/Instances/InstanceData.cpp +++ b/src/server/game/Instances/InstanceData.cpp @@ -19,7 +19,7 @@ */ #include "InstanceData.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Map.h" #include "Player.h" #include "GameObject.h" @@ -43,7 +43,7 @@ void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go) if (go) go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); else - debug_log("TSCR: InstanceData: HandleGameObject failed"); + sLog.outDebug("TSCR: InstanceData: HandleGameObject failed"); } bool InstanceData::IsEncounterInProgress() const @@ -263,7 +263,7 @@ void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bo pGo->ResetDoorOrButton(); } else - error_log("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType()); + sLog.outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType()); } } @@ -294,7 +294,7 @@ void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) pPlayer->SendUpdateWorldState(uiStateId, uiStateData); } else - debug_log("TSCR: DoUpdateWorldState attempt send data but no players in map."); + sLog.outDebug("TSCR: DoUpdateWorldState attempt send data but no players in map."); } // Send Notify to all players in instance @@ -318,7 +318,7 @@ void InstanceData::DoCompleteAchievement(uint32 achievement) if (!pAE) { - error_log("TSCR: DoCompleteAchievement called for not existing achievement %u", achievement); + sLog.outError("TSCR: DoCompleteAchievement called for not existing achievement %u", achievement); return; } diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index d67364966d6..dd9001402a0 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -20,8 +20,7 @@ */ #include "Common.h" -#include "Database/SQLStorage.h" - +#include "SQLStorage.h" #include "Player.h" #include "GridNotifiers.h" #include "Log.h" @@ -33,21 +32,14 @@ #include "InstanceSaveMgr.h" #include "Timer.h" #include "GridNotifiersImpl.h" -#include "Config/ConfigEnv.h" -#include "Transports.h" +#include "ConfigEnv.h" +#include "Transport.h" #include "ObjectMgr.h" #include "World.h" #include "Group.h" #include "InstanceData.h" #include "ProgressBar.h" -#include "Policies/Singleton.h" -#include "Policies/SingletonImp.h" -INSTANTIATE_SINGLETON_1(InstanceSaveManager); - -InstanceSaveManager::InstanceSaveManager() : lock_instLists(false) -{ -} InstanceSaveManager::~InstanceSaveManager() { @@ -173,7 +165,7 @@ void InstanceSave::SaveToDB() // save instance data too std::string data; - Map *map = MapManager::Instance().FindMap(GetMapId(),m_instanceid); + Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid); if (map) { assert(map->IsDungeon()); @@ -251,7 +243,7 @@ void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const db.escape_string(fieldValue); ss << (i != 0 ? " AND " : "") << fieldTokens[i] << " = '" << fieldValue << "'"; } - db.DirectPExecute("DELETE FROM %s WHERE %s", table, ss.str().c_str()); + db.PExecute("DELETE FROM %s WHERE %s", table, ss.str().c_str()); } while (result->NextRow()); } } @@ -297,7 +289,7 @@ void InstanceSaveManager::CleanupInstances() { Field *fields = result->Fetch(); if (InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end()) - WorldDatabase.DirectPExecute("DELETE FROM creature_respawn WHERE instance = '%u'", fields[0].GetUInt32()); + WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE instance = '%u'", fields[0].GetUInt32()); } while (result->NextRow()); } @@ -310,7 +302,7 @@ void InstanceSaveManager::CleanupInstances() { Field *fields = result->Fetch(); if (InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end()) - WorldDatabase.DirectPExecute("DELETE FROM gameobject_respawn WHERE instance = '%u'", fields[0].GetUInt32()); + WorldDatabase.PExecute("DELETE FROM gameobject_respawn WHERE instance = '%u'", fields[0].GetUInt32()); } while (result->NextRow()); } @@ -441,7 +433,7 @@ void InstanceSaveManager::LoadResetTimes() InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance); if (itr != instResetTime.end() && itr->second.second != resettime) { - CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", uint64(resettime), instance); + CharacterDatabase.PExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", uint64(resettime), instance); itr->second.second = resettime; } } @@ -470,14 +462,14 @@ void InstanceSaveManager::LoadResetTimes() if (!mapDiff) { sLog.outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty); - CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid,difficulty); + CharacterDatabase.PExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid,difficulty); continue; } // update the reset time if the hour in the configs changes uint64 newresettime = (oldresettime / DAY) * DAY + diff; if (oldresettime != newresettime) - CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty = '%u'", newresettime, mapid, difficulty); + CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty = '%u'", newresettime, mapid, difficulty); SetResetTimeFor(mapid,difficulty,newresettime); } while (result->NextRow()); @@ -508,7 +500,7 @@ void InstanceSaveManager::LoadResetTimes() { // initialize the reset time t = today + period + diff; - CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','%u','"UI64FMTD"')", mapid, difficulty, (uint64)t); + CharacterDatabase.PExecute("INSERT INTO instance_reset VALUES ('%u','%u','"UI64FMTD"')", mapid, difficulty, (uint64)t); } if (t < now) @@ -517,7 +509,7 @@ void InstanceSaveManager::LoadResetTimes() // calculate the next reset time t = (t / DAY) * DAY; t += ((today - t) / period + 1) * period + diff; - CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, difficulty); + CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, difficulty); } SetResetTimeFor(mapid,difficulty,t); @@ -615,7 +607,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) { sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); - Map *map = (MapInstanced*)MapManager::Instance().CreateBaseMap(mapid); + Map *map = (MapInstanced*)sMapMgr.CreateBaseMap(mapid); if (!map->Instanceable()) return; @@ -679,7 +671,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b } // note: this isn't fast but it's meant to be executed very rarely - Map const *map = MapManager::Instance().CreateBaseMap(mapid); // _not_ include difficulty + Map const *map = sMapMgr.CreateBaseMap(mapid); // _not_ include difficulty MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps(); MapInstanced::InstancedMaps::iterator mitr; for (mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr) diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index 91cd3d9ebe6..66751cc4f10 100644 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -22,13 +22,13 @@ #ifndef __InstanceSaveMgr_H #define __InstanceSaveMgr_H -#include "Platform/Define.h" -#include "Policies/Singleton.h" +#include "Define.h" +#include "ace/Singleton.h" #include "ace/Thread_Mutex.h" #include #include -#include "Utilities/UnorderedMap.h" -#include "Database/DatabaseEnv.h" +#include "UnorderedMap.h" +#include "DatabaseEnv.h" #include "DBCEnums.h" #include "ObjectDefines.h" @@ -117,13 +117,14 @@ class InstanceSave typedef UNORDERED_MAP ResetTimeByMapDifficultyMap; -class InstanceSaveManager : public Trinity::Singleton > +class InstanceSaveManager { + friend class ACE_Singleton; friend class InstanceSave; public: - InstanceSaveManager(); + InstanceSaveManager() : lock_instLists(false) {}; ~InstanceSaveManager(); - + typedef UNORDERED_MAP InstanceSaveHashMap; typedef UNORDERED_MAP InstanceSaveMapMap; @@ -176,6 +177,7 @@ class InstanceSaveManager : public Trinity::Singleton::Instance() +#define sInstanceSaveManager (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 2137c8872b5..77b7f08fd5a 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -188,7 +188,6 @@ bool LootStore::HaveQuestLootForPlayer(uint32 loot_id,Player* player) const void LootStore::ResetConditions() { - LootTemplateMap m_LootTemplates; for (LootTemplateMap::iterator itr = m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr) { ConditionList empty; @@ -969,11 +968,11 @@ void LootTemplate::LootGroup::CopyConditions(ConditionList conditions) { for (LootStoreItemList::iterator i = ExplicitlyChanced.begin(); i != ExplicitlyChanced.end(); ++i) { - i->conditions = conditions; + i->conditions.clear(); } for (LootStoreItemList::iterator i = EqualChanced.begin(); i != EqualChanced.end(); ++i) { - i->conditions = conditions; + i->conditions.clear(); } } @@ -1146,7 +1145,7 @@ void LootTemplate::AddEntry(LootStoreItem& item) void LootTemplate::CopyConditions(ConditionList conditions) { for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i) - i->conditions = conditions; + i->conditions.clear(); for (LootGroups::iterator i = Groups.begin(); i != Groups.end(); ++i) i->CopyConditions(conditions); @@ -1197,8 +1196,6 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, bool rate, uint16 if (!Referenced) continue; // Error message already printed at loading stage - const_cast(Referenced)->CopyConditions(i->conditions);//copy conditions from referer template - for (uint32 loop = 0; loop < i->maxcount; ++loop) // Ref multiplicator Referenced->Process(loot, store, rate, lootMode, i->group); } diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 65fe3de22e1..00fe2a97888 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -23,7 +23,7 @@ #include "ItemEnchantmentMgr.h" #include "ByteBuffer.h" -#include "Utilities/LinkedReference/RefManager.h" +#include "RefManager.h" #include "SharedDefines.h" #include "ConditionMgr.h" diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 847009b83dc..77f971bf4d0 100644 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -375,8 +375,8 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) CharacterDatabase.CommitTransaction(); pl->RemoveMail(mailId); - // send back only to players and simple drop for other cases - if (m->messageType == MAIL_NORMAL) + // only return mail if the player exists (and delete if not existing) + if (m->messageType == MAIL_NORMAL && m->sender) { MailDraft draft(m->subject, m->body); if (m->mailTemplateId) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 11bfdcd6f99..6c9b505d6c9 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -28,8 +28,8 @@ #include "InstanceData.h" #include "Map.h" #include "GridNotifiersImpl.h" -#include "Config/ConfigEnv.h" -#include "Transports.h" +#include "ConfigEnv.h" +#include "Transport.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" #include "World.h" @@ -94,10 +94,9 @@ bool Map::ExistMap(uint32 mapid,int gx,int gy) map_fileheader header; fread(&header, sizeof(header), 1, pf); - if (header.mapMagic != uint32(MAP_MAGIC) || - header.versionMagic != uint32(MAP_VERSION_MAGIC)) + if (header.mapMagic != uint32(MAP_MAGIC) || header.versionMagic != uint32(MAP_VERSION_MAGIC)) { - sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp); + sLog.outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.",tmp); delete [] tmp; fclose(pf); //close file before return return false; @@ -114,7 +113,6 @@ bool Map::ExistVMap(uint32 mapid,int gx,int gy) { if (vmgr->isMapLoadingEnabled()) { - // x and y are swapped !! => fixed now bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, gx,gy); if (!exists) { @@ -326,7 +324,7 @@ void Map::DeleteFromWorld(T* obj) template<> void Map::DeleteFromWorld(Player* pl) { - ObjectAccessor::Instance().RemoveObject(pl); + sObjectAccessor.RemoveObject(pl); delete pl; } @@ -335,7 +333,7 @@ Map::EnsureGridCreated(const GridPair &p) { if (!getNGrid(p.x_coord, p.y_coord)) { - Guard guard(*this); + ACE_GUARD(ACE_Thread_Mutex, Guard, Lock); if (!getNGrid(p.x_coord, p.y_coord)) { sLog.outDebug("Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); @@ -396,7 +394,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) loader.LoadN(); // Add resurrectable corpses to world object list in grid - ObjectAccessor::Instance().AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); + sObjectAccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); return true; @@ -829,7 +827,7 @@ bool Map::RemoveBones(uint64 guid, float x, float y) { if (IsRemovalGrid(x, y)) { - Corpse * corpse = ObjectAccessor::Instance().GetObjectInWorld(GetId(), x, y, guid, (Corpse*)NULL); + Corpse * corpse = sObjectAccessor.GetObjectInWorld(GetId(), x, y, guid, (Corpse*)NULL); if (corpse && corpse->GetTypeId() == TYPEID_CORPSE && corpse->GetType() == CORPSE_BONES) corpse->DeleteBonesFromWorld(); else @@ -1209,8 +1207,7 @@ bool GridMap::loadData(char *filename) if (!in) return true; fread(&header, sizeof(header),1,in); - if (header.mapMagic == uint32(MAP_MAGIC) && - header.versionMagic == uint32(MAP_VERSION_MAGIC)) + if (header.mapMagic == uint32(MAP_MAGIC) && header.versionMagic == uint32(MAP_VERSION_MAGIC)) { // loadup area data if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize)) @@ -1236,18 +1233,18 @@ bool GridMap::loadData(char *filename) fclose(in); return true; } - sLog.outError("Map file '%s' is a non-compatible version (outdated?). Please, create new using the ad.exe program.", filename); + sLog.outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename); fclose(in); return false; } void GridMap::unloadData() { - if (m_area_map) delete[] m_area_map; - if (m_V9) delete[] m_V9; - if (m_V8) delete[] m_V8; - if (m_liquid_type) delete[] m_liquid_type; - if (m_liquid_map) delete[] m_liquid_map; + delete[] m_area_map; + delete[] m_V9; + delete[] m_V8; + delete[] m_liquid_type; + delete[] m_liquid_map; m_area_map = NULL; m_V9 = NULL; m_V8 = NULL; @@ -2071,7 +2068,7 @@ void Map::SendInitSelf(Player * player) void Map::SendInitTransports(Player * player) { // Hack to send out transports - MapManager::TransportMap& tmap = MapManager::Instance().m_TransportsByMap; + MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap; // no transports at map if (tmap.find(player->GetMapId()) == tmap.end()) @@ -2098,7 +2095,7 @@ void Map::SendInitTransports(Player * player) void Map::SendRemoveTransports(Player * player) { // Hack to send out transports - MapManager::TransportMap& tmap = MapManager::Instance().m_TransportsByMap; + MapManager::TransportMap& tmap = sMapMgr.m_TransportsByMap; // no transports at map if (tmap.find(player->GetMapId()) == tmap.end()) @@ -2198,7 +2195,7 @@ void Map::RemoveAllObjectsInRemoveList() { case TYPEID_CORPSE: { - Corpse* corpse = ObjectAccessor::Instance().GetCorpse(*obj, obj->GetGUID()); + Corpse* corpse = sObjectAccessor.GetCorpse(*obj, obj->GetGUID()); if (!corpse) sLog.outError("Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow()); else @@ -2352,11 +2349,8 @@ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 Spaw InstanceMap::~InstanceMap() { - if (i_data) - { - delete i_data; - i_data = NULL; - } + delete i_data; + i_data = NULL; } void InstanceMap::InitVisibilityDistance() @@ -2400,6 +2394,32 @@ bool InstanceMap::CanEnter(Player *player) return false; } + // cannot enter if instance is in use by another party/soloer that have a + // permanent save in the same instance id + + PlayerList const &playerList = GetPlayers(); + Player *firstInsidePlayer = NULL; + + if (!playerList.isEmpty()) + for (PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i) + if (Player *iPlayer = i->getSource()) + { + if (iPlayer->isGameMaster()) // bypass GMs + continue; + if (!player->GetGroup()) // player has not group and there is someone inside, deny entry + { + player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); + return false; + } + // player inside instance has no group or his groups is different to entering player's one, deny entry + if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup() ) + { + player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); + return false; + } + break; + } + return Map::CanEnter(player); } @@ -2413,7 +2433,7 @@ bool InstanceMap::Add(Player *player) // Is it needed? { - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, Lock, false); // Check moved to void WorldSession::HandleMoveWorldportAckOpcode() //if (!CanEnter(player)) //return false; @@ -2738,7 +2758,7 @@ bool BattleGroundMap::CanEnter(Player * player) bool BattleGroundMap::Add(Player * player) { { - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, Lock, false); //Check moved to void WorldSession::HandleMoveWorldportAckOpcode() //if (!CanEnter(player)) //return false; @@ -2882,7 +2902,7 @@ void Map::ScriptsProcess() source = HashMapHolder::Find(step.sourceGUID); break; case HIGHGUID_MO_TRANSPORT: - for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) + for (MapManager::TransportSet::iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == step.sourceGUID) { @@ -2941,8 +2961,9 @@ void Map::ScriptsProcess() break; } - Creature* cSource = NULL; - cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature(); + Creature* cSource = source->ToCreature(); + if (!cSource && target) + cSource = target->ToCreature(); if (!cSource) { @@ -2998,8 +3019,9 @@ void Map::ScriptsProcess() break; } - Creature* cSource = NULL; - cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature(); + Creature* cSource = source->ToCreature(); + if (!cSource && target) + target->ToCreature(); if (!cSource) { @@ -3023,7 +3045,10 @@ void Map::ScriptsProcess() break; } - Creature* cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature(); + Creature* cSource = source->ToCreature(); + if (!cSource && target) + cSource = target->ToCreature(); + if (!cSource) { sLog.outError("SCRIPT_COMMAND_FIELD_SET (script id: %u) call for non-creature source.", step.script->id); @@ -3049,7 +3074,10 @@ void Map::ScriptsProcess() break; } - Creature* cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature(); + Creature* cSource = source->ToCreature(); + if (!cSource && target) + cSource = target->ToCreature(); + if (!cSource) { sLog.outError("SCRIPT_COMMAND_MOVE_TO (script id: %u) call for non-creature (TypeId: %u, Entry: %u, GUID: %u), skipping.", @@ -3070,7 +3098,10 @@ void Map::ScriptsProcess() break; } - Creature* cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature(); + Creature* cSource = source->ToCreature(); + if (!cSource && target) + cSource = target->ToCreature(); + if (!cSource) { sLog.outError("SCRIPT_COMMAND_FLAG_SET (script id: %u) call for non-creature source.", step.script->id); @@ -3096,7 +3127,10 @@ void Map::ScriptsProcess() break; } - Creature* cSource = source->ToCreature() != NULL ? source->ToCreature() : target->ToCreature(); + Creature* cSource = source->ToCreature(); + if (!cSource && target) + cSource = target->ToCreature(); + if (!cSource) { sLog.outError("SCRIPT_COMMAND_FLAG_REMOVE (script id: %u) call for non-creature source.", step.script->id); @@ -3125,7 +3159,12 @@ void Map::ScriptsProcess() if (step.script->datalong2 == 0) { - Player* pSource = target->ToPlayer() != NULL ? target->ToPlayer() : source->ToPlayer(); + Player* pSource = NULL; + if (target) + pSource = target->ToPlayer(); + if (!pSource && source) + pSource = source->ToPlayer(); + // must be only Player if (!pSource) { @@ -3138,7 +3177,12 @@ void Map::ScriptsProcess() } else if (step.script->datalong2 == 1) { - Creature *cSource = target->ToCreature() != NULL ? target->ToCreature() : source->ToCreature(); + Creature *cSource = NULL; + if (target) + cSource = target->ToCreature(); + if (!cSource && source) + cSource = source->ToCreature(); + // must be only Creature if (!cSource) { @@ -3154,16 +3198,14 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_KILL_CREDIT: { + Player* pSource = NULL; // accept player in any one from target/source arg - if (!target && !source) - { - sLog.outError("SCRIPT_COMMAND_KILL_CREDIT (script id: %u) call for NULL object.", step.script->id); - break; - } - - Player* pSource = target->ToPlayer() != NULL ? target->ToPlayer() : source->ToPlayer(); - // must be only Player - if (!pSource) + if (target) + pSource = target->ToPlayer(); + if (!pSource && source) + pSource = source->ToPlayer(); + + if (!pSource) // must be only Player { sLog.outError("SCRIPT_COMMAND_KILL_CREDIT (script id: %u) call for non-player (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", step.script->id, source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0); @@ -3277,6 +3319,7 @@ void Map::ScriptsProcess() go->GetMap()->Add(go); break; } + case SCRIPT_COMMAND_OPEN_DOOR: { if (!step.script->datalong) // door not specified @@ -3334,6 +3377,7 @@ void Map::ScriptsProcess() ((GameObject*)target)->UseDoorOrButton(time_to_close); break; } + case SCRIPT_COMMAND_CLOSE_DOOR: { if (!step.script->datalong) // guid for door not specified @@ -3392,6 +3436,7 @@ void Map::ScriptsProcess() break; } + case SCRIPT_COMMAND_QUEST_EXPLORED: { if (!source) @@ -3408,7 +3453,7 @@ void Map::ScriptsProcess() // when script called for item spell casting then target == (unit or GO) and source is player WorldObject* worldObject; - Player* pTarget; + Player* pTarget = NULL; pTarget = target->ToPlayer(); if (pTarget) @@ -3577,7 +3622,7 @@ void Map::ScriptsProcess() } // bitmask: 0/1=anyone/target, 0/2=with distance dependent - Player* pTarget; + Player* pTarget = NULL; if (step.script->datalong2 & 1) { if (!target) @@ -3586,7 +3631,7 @@ void Map::ScriptsProcess() break; } - pTarget = target->ToPlayer(); + pTarget = target ? target->ToPlayer() : NULL; if (!pTarget) { sLog.outError("SCRIPT_COMMAND_PLAY_SOUND (script id: %u) in targeted mode call for non-player (TypeId: %u, Entry: %u, GUID: %u), skipping.", @@ -3605,13 +3650,19 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_CREATE_ITEM: { - if (!target && !source) + if (!source) { - sLog.outError("SCRIPT_COMMAND_CREATE_ITEM (script id: %u) call for NULL object.", step.script->id); + sLog.outError("SCRIPT_COMMAND_CREATE_ITEM (script id: %u) call for NULL source.", + step.script->id); break; } - Player *pReceiver = target->ToPlayer() != NULL ? target->ToPlayer() : source->ToPlayer(); + Player *pReceiver = NULL; + if (target) + pReceiver = target->ToPlayer(); + if (!pReceiver) + pReceiver = source->ToPlayer(); + // only Player if (!pReceiver) { @@ -3798,6 +3849,7 @@ void Map::ScriptsProcess() uSource->SendMovementFlagUpdate(); break; } + case SCRIPT_COMMAND_EQUIP: { if (!source) @@ -3816,6 +3868,7 @@ void Map::ScriptsProcess() cSource->LoadEquipment(step.script->datalong); break; } + case SCRIPT_COMMAND_MODEL: { if (!source) diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index ceb526b8244..4d25381fbe1 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -21,8 +21,7 @@ #ifndef TRINITY_MAP_H #define TRINITY_MAP_H -#include "Platform/Define.h" -#include "Policies/ThreadingModel.h" +#include "Define.h" #include "ace/RW_Thread_Mutex.h" #include "ace/Thread_Mutex.h" @@ -31,9 +30,9 @@ #include "Cell.h" #include "Timer.h" #include "SharedDefines.h" -#include "GameSystem/GridRefManager.h" +#include "GridRefManager.h" #include "MapRefManager.h" -#include "mersennetwister/MersenneTwister.h" +#include "MersenneTwister.h" #include #include @@ -57,7 +56,7 @@ class BattleGround; // Map file format defines //****************************************** #define MAP_MAGIC 'SPAM' -#define MAP_VERSION_MAGIC '0.1w' +#define MAP_VERSION_MAGIC '1.1v' #define MAP_AREA_MAGIC 'AERA' #define MAP_HEIGHT_MAGIC 'TGHM' #define MAP_LIQUID_MAGIC 'QILM' @@ -66,6 +65,7 @@ struct map_fileheader { uint32 mapMagic; uint32 versionMagic; + uint32 buildMagic; uint32 areaMapOffset; uint32 areaMapSize; uint32 heightMapOffset; @@ -238,7 +238,7 @@ typedef UNORDERED_MAP CreatureMoveList; typedef std::map CreatureGroupHolderType; -class Map : public GridRefManager, public Trinity::ObjectLevelLockable +class Map : public GridRefManager { friend class MapReference; public: @@ -489,7 +489,7 @@ class Map : public GridRefManager, public Trinity::ObjectLevelLockabl protected: void SetUnloadReferenceLock(const GridPair &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadReferenceLock(on); } - typedef Trinity::ObjectLevelLockable::Lock Guard; + ACE_Thread_Mutex Lock; MapEntry const* i_mapEntry; uint8 i_spawnMode; diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 0736bfa6fb3..008baeb79d9 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -170,7 +170,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player) { // if no instanceId via group members or instance saves is found // the instance will be created for the first time - NewInstanceId = MapManager::Instance().GenerateInstanceId(); + NewInstanceId = sMapMgr.GenerateInstanceId(); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); map = CreateInstance(NewInstanceId, NULL, diff); @@ -183,7 +183,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player) InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, Difficulty difficulty) { // load/create a map - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); // make sure we have a valid map id const MapEntry* entry = sMapStore.LookupEntry(GetId()); @@ -219,7 +219,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, BattleGroundMap* MapInstanced::CreateBattleGround(uint32 InstanceId, BattleGround* bg) { // load/create a map - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); sLog.outDebug("MapInstanced::CreateBattleGround: map bg %d for %d created.", InstanceId, GetId()); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index de3d0ebbaff..36999aab14f 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -20,16 +20,15 @@ #include "MapManager.h" #include "InstanceSaveMgr.h" -#include "Policies/SingletonImp.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "ObjectAccessor.h" -#include "Transports.h" +#include "Transport.h" #include "GridDefines.h" #include "MapInstanced.h" #include "InstanceData.h" #include "DestinationHolderImp.h" -#include "Config/ConfigEnv.h" +#include "ConfigEnv.h" #include "World.h" #include "CellImpl.h" #include "Corpse.h" @@ -37,10 +36,6 @@ #include "Language.h" #include "WorldPacket.h" -#define CLASS_LOCK Trinity::ClassLevelLockable -INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK); -INSTANTIATE_CLASS_MUTEX(MapManager, ACE_Thread_Mutex); - extern GridState* si_GridStates[]; // debugging code, should be deleted some day MapManager::MapManager() @@ -116,7 +111,7 @@ Map* MapManager::_createBaseMap(uint32 id) if (m == NULL) { - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); const MapEntry* entry = sMapStore.LookupEntry(id); if (entry && entry->Instanceable()) @@ -166,14 +161,35 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (!entry->IsDungeon()) return true; + InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid); + if (!instance) + return false; + + //The player has a heroic mode and tries to enter into instance which has no a heroic mode + MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID,player->GetDifficulty(entry->IsRaid())); + if (!mapDiff) + { + bool isNormalTargetMap = entry->IsRaid() + ? (player->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + : (player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL); + + // Send aborted message + // FIX ME: what about absent normal/heroic mode with specific players limit... + player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); + return false; + } + + //Bypass checks for GMs + if (player->isGameMaster()) + return true; + const char *mapName = entry->name[player->GetSession()->GetSessionDbcLocale()]; Group* pGroup = player->GetGroup(); if (entry->IsRaid()) { // can only enter in a raid group - // GMs can avoid raid limitations - if ((!pGroup || !pGroup->isRaidGroup()) && !player->isGameMaster() && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_RAID)) + if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_RAID)) { // probably there must be special opcode, because client has this string constant in GlobalStrings.lua // TODO: this is not a good place to send the message @@ -183,20 +199,6 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) } } - //The player has a heroic mode and tries to enter into instance which has no a heroic mode - MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID,player->GetDifficulty(entry->IsRaid())); - if (!mapDiff) - { - bool isNormalTargetMap = entry->IsRaid() - ? (player->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) - : (player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL); - - // Send aborted message - // FIX ME: what about absent normal/heroic mode with specific players limit... - player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); - return false; - } - if (!player->isAlive()) { if (Corpse *corpse = player->GetCorpse()) @@ -226,49 +228,24 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) sLog.outDebug("Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName()); } - InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid); - if (!instance) - return false; - //Get instance where player's group is bound & its map if (pGroup) { - InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(player); + InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(entry); if (boundedInstance && boundedInstance->save) - { - if (Map *boundedMap = MapManager::Instance().FindMap(mapid,boundedInstance->save->GetInstanceId())) - { + if (Map *boundedMap = sMapMgr.FindMap(mapid,boundedInstance->save->GetInstanceId())) + if (!loginCheck && !boundedMap->CanEnter(player)) + return false; + /* + This check has to be moved to InstanceMap::CanEnter() // Player permanently bounded to different instance than groups one - InstancePlayerBind* playerBoundedInstance = player->GetBoundInstance(mapid, player->GetDungeonDifficulty()); + InstancePlayerBind* playerBoundedInstance = player->GetBoundInstance(mapid, player->GetDifficulty(entry->IsRaid())); if (playerBoundedInstance && playerBoundedInstance->perm && playerBoundedInstance->save && boundedInstance->save->GetInstanceId() != playerBoundedInstance->save->GetInstanceId()) { //TODO: send some kind of error message to the player return false; - } - - // Encounters in progress - if (!loginCheck && entry->IsRaid() && ((InstanceMap*)boundedMap)->GetInstanceData() && ((InstanceMap*)boundedMap)->GetInstanceData()->IsEncounterInProgress()) - { - sLog.outDebug("MAP: Player '%s' cannot enter instance '%s' while an encounter is in progress.", player->GetName(), mapName); - player->SendTransferAborted(mapid, TRANSFER_ABORT_ZONE_IN_COMBAT); - return false; - } - - // Instance is full - MapDifficulty const* mapDiff = ((InstanceMap*)boundedMap)->GetMapDifficulty(); - int8 maxPlayers = mapDiff ? mapDiff->maxPlayers : 0; - if (maxPlayers != -1) //-1: unlimited access - { - if (boundedMap->GetPlayersCountExceptGMs() >= (loginCheck ? maxPlayers+1 : maxPlayers)) - { - sLog.outDebug("MAP: Player '%s' cannot enter instance '%s' because it is full.", player->GetName(), mapName); - player->SendTransferAborted(mapid, TRANSFER_ABORT_MAX_PLAYERS); - return false; - } - } - } - } + }*/ } //Other requirements @@ -307,7 +284,7 @@ void MapManager::Update(uint32 diff) for (iter = i_maps.begin(); iter != i_maps.end(); ++iter) iter->second->DelayedUpdate(i_timer.GetCurrent()); - ObjectAccessor::Instance().Update(i_timer.GetCurrent()); + sObjectAccessor.Update(i_timer.GetCurrent()); for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter) (*iter)->Update(i_timer.GetCurrent()); @@ -361,7 +338,7 @@ void MapManager::InitMaxInstanceId() uint32 MapManager::GetNumInstances() { - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); uint32 ret = 0; for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr) @@ -378,7 +355,7 @@ uint32 MapManager::GetNumInstances() uint32 MapManager::GetNumPlayersInInstances() { - Guard guard(*this); + ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); uint32 ret = 0; for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr) diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index d94f9fced0e..47cb9d2f795 100644 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -21,8 +21,8 @@ #ifndef TRINITY_MAPMANAGER_H #define TRINITY_MAPMANAGER_H -#include "Platform/Define.h" -#include "Policies/Singleton.h" +#include "Define.h" +#include "ace/Singleton.h" #include "ace/Thread_Mutex.h" #include "Common.h" #include "Map.h" @@ -31,10 +31,9 @@ class Transport; -class MapManager : public Trinity::Singleton > +class MapManager { - - friend class Trinity::OperatorNew; + friend class ACE_Singleton; typedef UNORDERED_MAP MapMapType; typedef std::pair::iterator, bool> MapMapPair; @@ -108,6 +107,21 @@ class MapManager : public Trinity::Singleton(M_PI)); + mod = -mod + 2.0f * M_PI; + return mod; + } + return fmod(o, 2.0f * static_cast(M_PI)); + } + void DoDelayedMovesAndRemoves(); void LoadTransports(); @@ -147,7 +161,7 @@ class MapManager : public Trinity::Singletonsecond); } - typedef Trinity::ClassLevelLockable::Lock Guard; + ACE_Thread_Mutex Lock; uint32 i_gridCleanUpDelay; MapMapType i_maps; IntervalTimer i_timer; @@ -155,4 +169,5 @@ class MapManager : public Trinity::Singleton::instance()) #endif diff --git a/src/server/game/Maps/MapRefManager.h b/src/server/game/Maps/MapRefManager.h index 4337aa75fd9..2cf38c1b000 100644 --- a/src/server/game/Maps/MapRefManager.h +++ b/src/server/game/Maps/MapRefManager.h @@ -19,7 +19,7 @@ #ifndef _MAPREFMANAGER #define _MAPREFMANAGER -#include "Utilities/LinkedReference/RefManager.h" +#include "RefManager.h" class MapReference; diff --git a/src/server/game/Maps/MapReference.h b/src/server/game/Maps/MapReference.h index 7cd4fcde76c..e74fdba229b 100644 --- a/src/server/game/Maps/MapReference.h +++ b/src/server/game/Maps/MapReference.h @@ -19,7 +19,7 @@ #ifndef _MAPREFERENCE_H #define _MAPREFERENCE_H -#include "Utilities/LinkedReference/Reference.h" +#include "Reference.h" #include "Map.h" class MapReference : public Reference diff --git a/src/server/game/Maps/MapUpdater.cpp b/src/server/game/Maps/MapUpdater.cpp index f9bb5e2bbbc..5720ed1eb50 100644 --- a/src/server/game/Maps/MapUpdater.cpp +++ b/src/server/game/Maps/MapUpdater.cpp @@ -1,7 +1,7 @@ #include "MapUpdater.h" #include "DelayExecutor.h" #include "Map.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include #include diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index e5961834a78..8244e344275 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -27,9 +27,14 @@ namespace Trinity { namespace Honor { + inline float hk_honor_at_level_f(uint8 level, uint32 count = 1) + { + return count * level * 1.55f; + } + inline uint32 hk_honor_at_level(uint8 level, uint32 count = 1) { - return uint32(ceil(count * (33.333f * ((float)level) / 21.50537f))); + return ceil(hk_honor_at_level_f(level, count)); } } namespace XP diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index c0c8fc486f3..435c6549f56 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -87,7 +87,8 @@ enum TrinityStrings LANG_USING_EVENT_AI = 59, LANG_CONNECTED_PLAYERS = 60, LANG_ACCOUNT_ADDON = 61, - // Room for more level 0 62-99 not used + LANG_IMPROPER_VALUE = 62, + // Room for more level 0 63-99 not used // level 1 chat LANG_GLOBAL_NOTIFY = 100, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 903dd4b09ca..0d5025a5d5f 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -21,7 +21,7 @@ #ifndef TRINITY_SHAREDDEFINES_H #define TRINITY_SHAREDDEFINES_H -#include "Platform/Define.h" +#include "Define.h" #include // loot modes for creatures and gameobjects, bitmask! @@ -287,7 +287,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7 #define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state #define SPELL_ATTR_EX_UNK9 0x00000200 // 9 melee spells -#define SPELL_ATTR_EX_UNK10 0x00000400 // 10 no generates threat on cast 100%? (old NO_INITIAL_AGGRO) +#define SPELL_ATTR_EX_NO_THREAT 0x00000400 // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO) #define SPELL_ATTR_EX_UNK11 0x00000800 // 11 aura #define SPELL_ATTR_EX_UNK12 0x00001000 // 12 #define SPELL_ATTR_EX_UNK13 0x00002000 // 13 @@ -643,7 +643,7 @@ enum SpellEffects SPELL_EFFECT_LANGUAGE = 39, SPELL_EFFECT_DUAL_WIELD = 40, SPELL_EFFECT_JUMP = 41, - SPELL_EFFECT_JUMP2 = 42, + SPELL_EFFECT_JUMP_DEST = 42, SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER= 43, SPELL_EFFECT_SKILL_STEP = 44, SPELL_EFFECT_ADD_HONOR = 45, @@ -750,7 +750,7 @@ enum SpellEffects SPELL_EFFECT_ACTIVATE_RUNE = 146, SPELL_EFFECT_QUEST_FAIL = 147, SPELL_EFFECT_148 = 148, - SPELL_EFFECT_149 = 149, + SPELL_EFFECT_CHARGE_DEST = 149, SPELL_EFFECT_150 = 150, SPELL_EFFECT_TRIGGER_SPELL_2 = 151, SPELL_EFFECT_152 = 152, @@ -2769,4 +2769,31 @@ enum SpellFamilyNames SPELLFAMILY_PET = 17 }; +enum TradeStatus +{ + TRADE_STATUS_BUSY = 0, + TRADE_STATUS_BEGIN_TRADE = 1, + TRADE_STATUS_OPEN_WINDOW = 2, + TRADE_STATUS_TRADE_CANCELED = 3, + TRADE_STATUS_TRADE_ACCEPT = 4, + TRADE_STATUS_BUSY_2 = 5, + TRADE_STATUS_NO_TARGET = 6, + TRADE_STATUS_BACK_TO_TRADE = 7, + TRADE_STATUS_TRADE_COMPLETE = 8, + // 9? + TRADE_STATUS_TARGET_TO_FAR = 10, + TRADE_STATUS_WRONG_FACTION = 11, + TRADE_STATUS_CLOSE_WINDOW = 12, + // 13? + TRADE_STATUS_IGNORE_YOU = 14, + TRADE_STATUS_YOU_STUNNED = 15, + TRADE_STATUS_TARGET_STUNNED = 16, + TRADE_STATUS_YOU_DEAD = 17, + TRADE_STATUS_TARGET_DEAD = 18, + TRADE_STATUS_YOU_LOGOUT = 19, + TRADE_STATUS_TARGET_LOGOUT = 20, + TRADE_STATUS_TRIAL_ACCOUNT = 21, // Trial accounts can not perform that action + TRADE_STATUS_ONLY_CONJURED = 22 // You can only trade conjured items... (cross realm BG related). +}; + #endif diff --git a/src/server/game/Movement/DestinationHolder.h b/src/server/game/Movement/DestinationHolder.h index e09a153615c..c0ee668eb99 100644 --- a/src/server/game/Movement/DestinationHolder.h +++ b/src/server/game/Movement/DestinationHolder.h @@ -21,7 +21,7 @@ #ifndef TRINITY_DESTINATION_HOLDER_H #define TRINITY_DESTINATION_HOLDER_H -#include "Platform/Define.h" +#include "Define.h" #include "Timer.h" class WorldObject; diff --git a/src/server/game/Movement/FollowerRefManager.h b/src/server/game/Movement/FollowerRefManager.h index c2068b36f81..e451cd4747a 100644 --- a/src/server/game/Movement/FollowerRefManager.h +++ b/src/server/game/Movement/FollowerRefManager.h @@ -21,7 +21,7 @@ #ifndef _FOLLOWERREFMANAGER #define _FOLLOWERREFMANAGER -#include "Utilities/LinkedReference/RefManager.h" +#include "RefManager.h" class Unit; class TargetedMovementGeneratorBase; diff --git a/src/server/game/Movement/FollowerReference.h b/src/server/game/Movement/FollowerReference.h index e468f79f017..72a6d4f463e 100644 --- a/src/server/game/Movement/FollowerReference.h +++ b/src/server/game/Movement/FollowerReference.h @@ -21,7 +21,7 @@ #ifndef _FOLLOWERREFERENCE_H #define _FOLLOWERREFERENCE_H -#include "Utilities/LinkedReference/Reference.h" +#include "Reference.h" class TargetedMovementGeneratorBase; class Unit; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 5c20494bfcc..46a4c806067 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -440,9 +440,17 @@ MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode) { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - DEBUG_LOG("Player (GUID: %u) taxi to (Path %u node %u)", i_owner->GetGUIDLow(), path, pathnode); - FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(path,pathnode); - Mutate(mgen, MOTION_SLOT_CONTROLLED); + if (path < sTaxiPathNodesByPath.size()) + { + DEBUG_LOG("%s taxi to (Path %u node %u)", i_owner->GetName(), path, pathnode); + FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(sTaxiPathNodesByPath[path],pathnode); + Mutate(mgen, MOTION_SLOT_CONTROLLED); + } + else + { + sLog.outError("%s attempt taxi to (not existed Path %u node %u)", + i_owner->GetName(), path, pathnode); + } } else { diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index ab7a52c483e..9699f6951c2 100644 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -21,10 +21,10 @@ #ifndef TRINITY_MOVEMENTGENERATOR_H #define TRINITY_MOVEMENTGENERATOR_H -#include "Platform/Define.h" -#include "Policies/Singleton.h" -#include "Dynamic/ObjectRegistry.h" -#include "Dynamic/FactoryHolder.h" +#include "Define.h" +#include "ace/Singleton.h" +#include "ObjectRegistry.h" +#include "FactoryHolder.h" #include "Common.h" #include "MotionMaster.h" diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 43c6052d2d3..73e24486768 100644 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -47,38 +47,44 @@ ConfusedMovementGenerator::Initialize(T &unit) bool is_water_ok, is_land_ok; _InitSpecific(unit, is_water_ok, is_land_ok); - VMAP::IVMapManager *vMaps = VMAP::VMapFactory::createOrGetVMapManager(); - for (uint8 idx = 0; idx <= MAX_CONF_WAYPOINTS; ++idx) { - const bool isInLoS = vMaps->isInLineOfSight(unit.GetMapId(), x, y, z + 2.0f, i_waypoints[idx][0], i_waypoints[idx][1], z + 2.0f); - if (isInLoS) + float wanderX = x + wander_distance*rand_norm() - wander_distance/2; + float wanderY = y + wander_distance*rand_norm() - wander_distance/2; + Trinity::NormalizeMapCoord(wanderX); + Trinity::NormalizeMapCoord(wanderY); + + float new_z = map->GetHeight(wanderX, wanderY, z, true); + if (new_z > INVALID_HEIGHT && unit.IsWithinLOS(wanderX, wanderY, new_z)) { - const float wanderX = wander_distance*rand_norm() - wander_distance/2; - const float wanderY = wander_distance*rand_norm() - wander_distance/2; - i_waypoints[idx][0] = x + wanderX; - i_waypoints[idx][1] = y + wanderY; + // Don't move in water if we're not already in + // Don't move on land if we're not already on it either + bool is_water_now = map->IsInWater(x, y, z); + bool is_water_next = map->IsInWater(wanderX, wanderY, new_z); + if ((is_water_now && !is_water_next && !is_land_ok) || (!is_water_now && is_water_next && !is_water_ok)) + { + i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; // Back to previous location + i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; + i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx-1][2] : z; + continue; + } + + // Taken from FleeingMovementGenerator + if (!(new_z - z) || wander_distance / fabs(new_z - z) > 1.0f) + { + i_waypoints[idx][0] = wanderX; + i_waypoints[idx][1] = wanderY; + i_waypoints[idx][2] = new_z; + continue; + } } - else - { - i_waypoints[idx][0] = x; - i_waypoints[idx][1] = y; - } - - // prevent invalid coordinates generation - Trinity::NormalizeMapCoord(i_waypoints[idx][0]); - Trinity::NormalizeMapCoord(i_waypoints[idx][1]); - - bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z); - // if generated wrong path just ignore - if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) + else // Back to previous location { i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; + i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx-1][2] : z; + continue; } - - unit.UpdateGroundPositionZ(i_waypoints[idx][0],i_waypoints[idx][1],z); - i_waypoints[idx][2] = z; } unit.SetUInt64Value(UNIT_FIELD_TARGET, 0); diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 2a0c7c0253d..416b775ef7e 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -229,24 +229,20 @@ template bool WaypointMovementGenerator::Update(Player &, const uint32 & template void WaypointMovementGenerator::MovementInform(Player &); //----------------------------------------------------// -void FlightPathMovementGenerator::LoadPath(Player &) -{ - objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds); -} uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const { - if (i_currentNode >= i_mapIds.size()) - return i_mapIds.size(); + if (i_currentNode >= i_path->size()) + return i_path->size(); - uint32 curMapId = i_mapIds[i_currentNode]; - for (uint32 i = i_currentNode; i < i_mapIds.size(); ++i) + uint32 curMapId = (*i_path)[i_currentNode].mapid; + for (uint32 i = i_currentNode; i < i_path->size(); ++i) { - if (i_mapIds[i] != curMapId) + if ((*i_path)[i].mapid != curMapId) return i; } - return i_mapIds.size(); + return i_path->size(); } void FlightPathMovementGenerator::Initialize(Player &player) @@ -254,23 +250,12 @@ void FlightPathMovementGenerator::Initialize(Player &player) player.getHostileRefManager().setOnlineOfflineState(false); player.addUnitState(UNIT_STAT_IN_FLIGHT); player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); - LoadPath(player); Traveller traveller(player); // do not send movement, it was sent already - i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false); - + i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false); + // For preloading end grid + InitEndGridInfo(); player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(), GetPathAtMapEnd()); - - // Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will - // be reinitialized for each flightmaster at the end of each spline (or stop) in the flight. - - uint32 nodeCount = i_mapIds.size(); // Get the number of nodes in the path. i_path and i_mapIds are the - // same size when loaded in ObjectMgr::GetTaxiPathNodes, called from LoadPath() - - m_endMapId = i_mapIds[nodeCount -1]; // Get the map ID from the last node - m_preloadTargetNode = nodeCount / 2; // Split the number of nodes in half to preload the flightmaster half-way through the flight - m_endGridX = i_path[nodeCount -1].x; // Get the X position from the last node - m_endGridY = i_path[nodeCount -1].y; // Get tye Y position from the last node } void FlightPathMovementGenerator::Finalize(Player & player) @@ -280,6 +265,7 @@ void FlightPathMovementGenerator::Finalize(Player & player) float x, y, z; i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z); player.SetPosition(x, y, z, player.GetOrientation()); + } bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) @@ -292,18 +278,22 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE); if (i_destinationHolder.HasArrived()) { - uint32 curMap = i_mapIds[i_currentNode]; + DoEventIfAny(player,(*i_path)[i_currentNode], false); + + uint32 curMap = (*i_path)[i_currentNode].mapid; ++i_currentNode; if (MovementInProgress()) { + DoEventIfAny(player,(*i_path)[i_currentNode], true); + DEBUG_LOG("loading node %u for player %s", i_currentNode, player.GetName()); - if (i_mapIds[i_currentNode] == curMap) + if ((*i_path)[i_currentNode].mapid == curMap) { // do not send movement, it was sent already - i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false); + i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false); } - - // check if it's time to preload the flightmaster grid at path end + + // check if it's time to preload the flightmaster grid at path end if (i_currentNode == m_preloadTargetNode) PreloadEndGrid(); @@ -324,13 +314,13 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() { - if (i_mapIds.empty()) + if (i_path->empty()) return; - uint32 map0 = i_mapIds[0]; - for (size_t i = 1; i < i_mapIds.size(); ++i) + uint32 map0 = (*i_path)[0].mapid; + for (size_t i = 1; i < i_path->size(); ++i) { - if (i_mapIds[i] != map0) + if ((*i_path)[i].mapid != map0) { i_currentNode = i; return; @@ -338,10 +328,22 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() } } +void FlightPathMovementGenerator::InitEndGridInfo() +{ + // Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will + // be reinitialized for each flightmaster at the end of each spline (or stop) in the flight. + + uint32 nodeCount = (*i_path).size(); // Get the number of nodes in the path. + m_endMapId = (*i_path)[nodeCount -1].mapid; // Get the map ID from the last node + m_preloadTargetNode = nodeCount - 3; // 2 nodes before the final node, we pre-load the grid + m_endGridX = (*i_path)[nodeCount -1].x; // Get the X position from the last node + m_endGridY = (*i_path)[nodeCount -1].y; // Get the Y position from the last node +} + void FlightPathMovementGenerator::PreloadEndGrid() { // used to preload the final grid where the flightmaster is - Map *endMap = MapManager::Instance().FindMap(m_endMapId); + Map *endMap = sMapMgr.FindMap(m_endMapId); // Load the grid if (endMap) @@ -353,6 +355,17 @@ void FlightPathMovementGenerator::PreloadEndGrid() sLog.outDetail("Unable to determine map to preload flightmaster grid"); } +void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure) +{ + if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID) + { + sLog.outDebug("Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName()); + player.GetMap()->ScriptsStart(sEventScripts, eventid, &player, &player); + } +} + + + // // Unique1's ASTAR Pathfinding Code... For future use & reference... // diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 4b74e80e168..cce0eff290e 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -39,21 +39,24 @@ #include #define FLIGHT_TRAVEL_UPDATE 100 -#define STOP_TIME_FOR_PLAYER 3 * MINUTE * IN_MILISECONDS // 3 Minutes +#define STOP_TIME_FOR_PLAYER 3 * MINUTE * IN_MILLISECONDS // 3 Minutes #define TIMEDIFF_NEXT_WP 250 -template +template class PathMovementBase { public: PathMovementBase() : i_currentNode(0) {} virtual ~PathMovementBase() {}; - bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); } + bool MovementInProgress(void) const { return i_currentNode < i_path->size(); } void LoadPath(T &); void ReloadPath(T &); uint32 GetCurrentNode() const { return i_currentNode; } + + bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + bool GetPosition(float& x, float& y, float& z) const { i_destinationHolder.GetLocationNowNoMicroMovement(x,y,z); return true; } protected: uint32 i_currentNode; @@ -64,7 +67,7 @@ class PathMovementBase template class WaypointMovementGenerator - : public MovementGeneratorMedium< T, WaypointMovementGenerator >, public PathMovementBase + : public MovementGeneratorMedium< T, WaypointMovementGenerator >, public PathMovementBase { public: WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : @@ -93,28 +96,31 @@ class WaypointMovementGenerator */ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, -public PathMovementBase +public PathMovementBase { - uint32 i_pathId; - std::vector i_mapIds; public: - explicit FlightPathMovementGenerator(uint32 id, uint32 startNode = 0) : i_pathId(id) { i_currentNode = startNode; } + explicit FlightPathMovementGenerator(TaxiPathNodeList const& pathnodes, uint32 startNode = 0) + { + i_path = &pathnodes; + i_currentNode = startNode; + } void Initialize(Player &); + void Reset(Player &u){}; void Finalize(Player &); - void Reset(Player &) {} bool Update(Player &, const uint32 &); MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } - void LoadPath(Player &); - void ReloadPath(Player &) { /* don't reload flight path */ } - - Path& GetPath() { return i_path; } + TaxiPathNodeList const& GetPath() { return *i_path; } uint32 GetPathAtMapEnd() const; - bool HasArrived() const { return (i_currentNode >= i_path.Size()); } + bool HasArrived() const { return (i_currentNode >= i_path->size()); } void SetCurrentNodeAfterTeleport(); void SkipCurrentNode() { ++i_currentNode; } - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure); + bool GetDestination(float& x, float& y, float& z) const { return PathMovementBase::GetDestination(x,y,z); } + + void PreloadEndGrid(); + void InitEndGridInfo(); private: // storage for preloading the flightmaster grid at end // before reaching final waypoint @@ -122,7 +128,6 @@ public PathMovementBase uint32 m_preloadTargetNode; float m_endGridX; float m_endGridY; - void PreloadEndGrid(); }; #endif diff --git a/src/server/game/Movement/Waypoints/Path.h b/src/server/game/Movement/Waypoints/Path.h index 9ec079f3c9c..de73d9270af 100644 --- a/src/server/game/Movement/Waypoints/Path.h +++ b/src/server/game/Movement/Waypoints/Path.h @@ -24,65 +24,64 @@ #include "Common.h" #include +struct SimplePathNode +{ + float x, y, z; +}; +template + class Path { public: - struct PathNode - { - float x,y,z; - }; + size_t size() const { return i_nodes.size(); } + bool empty() const { return i_nodes.empty(); } + void resize(unsigned int sz) { i_nodes.resize(sz); } + void clear() { i_nodes.clear(); } + void erase(uint32 idx) { i_nodes.erase(i_nodes.begin()+idx); } - void SetLength(const unsigned int sz) - { - i_nodes.resize(sz); - } - - unsigned int Size() const { return i_nodes.size(); } - bool Empty() const { return i_nodes.empty(); } - void Resize(unsigned int sz) { i_nodes.resize(sz); } - void Clear(void) { i_nodes.clear(); } - PathNode const* GetNodes(uint32 start = 0) const { return &i_nodes[start]; } - float GetTotalLength() const { return GetTotalLength(0,Size()); } float GetTotalLength(uint32 start, uint32 end) const { - float len = 0, xd, yd, zd; - for (unsigned int idx=start+1; idx < end; ++idx) + float len = 0.0f; + for (uint32 idx=start+1; idx < end; ++idx) { - xd = i_nodes[ idx ].x - i_nodes[ idx-1 ].x; - yd = i_nodes[ idx ].y - i_nodes[ idx-1 ].y; - zd = i_nodes[ idx ].z - i_nodes[ idx-1 ].z; + PathNode const& node = i_nodes[idx]; + PathNode const& prev = i_nodes[idx-1]; + float xd = node.x - prev.x; + float yd = node.y - prev.y; + float zd = node.z - prev.z; len += sqrtf(xd*xd + yd*yd + zd*zd); } return len; } + + float GetTotalLength() const { return GetTotalLength(0,size()); } float GetPassedLength(uint32 curnode, float x, float y, float z) { - float len = 0, xd, yd, zd; - for (unsigned int idx=1; idx < curnode; ++idx) - { - xd = i_nodes[ idx ].x - i_nodes[ idx-1 ].x; - yd = i_nodes[ idx ].y - i_nodes[ idx-1 ].y; - zd = i_nodes[ idx ].z - i_nodes[ idx-1 ].z; - len += sqrtf(xd*xd + yd*yd + zd*zd); - } + float len = GetTotalLength(0,curnode); if (curnode > 0) { - xd = x - i_nodes[curnode-1].x; - yd = y - i_nodes[curnode-1].y; - zd = z - i_nodes[curnode-1].z; + PathNode const& node = i_nodes[curnode-1]; + float xd = x - node.x; + float yd = y - node.y; + float zd = z - node.z; len += sqrtf(xd*xd + yd*yd + zd*zd); } return len; } - PathNode& operator[](const unsigned int idx) { return i_nodes[idx]; } - const PathNode& operator()(const unsigned int idx) const { return i_nodes[idx]; } + PathNode& operator[](size_t idx) { return i_nodes[idx]; } + PathNode const& operator[](size_t idx) const { return i_nodes[idx]; } + + void set(size_t idx, PathElem elem) { i_nodes[idx] = elem; } protected: - std::vector i_nodes; + std::vector i_nodes; }; + +typedef Path SimplePath; + #endif diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index 0cbdd0bf975..078d272f62a 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "GridDefines.h" #include "WaypointManager.h" #include "ProgressBar.h" diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 71659a20be7..b19dc01ccd9 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -165,7 +165,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) // explicit removal from map // beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted // so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed - //if (Map * map = MapManager::Instance().FindMap(cr->GetMapId())) + //if (Map * map = sMapMgr.FindMap(cr->GetMapId())) // map->Remove(cr,false); // delete respawn time for this creature WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid); diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 55ea98a2a1f..8aa19ef94df 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -19,7 +19,7 @@ #ifndef OUTDOOR_PVP_H_ #define OUTDOOR_PVP_H_ -#include "Util.h" +#include "Utilities/Util.h" #include "SharedDefines.h" #include "ZoneScript.h" diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 4a0baf49a04..1ec2bcb6a9c 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -25,9 +25,6 @@ #include "OutdoorPvPEP.h" #include "ObjectMgr.h" #include "Player.h" -#include "Policies/SingletonImp.h" - -INSTANTIATE_SINGLETON_1(OutdoorPvPMgr); OutdoorPvPMgr::OutdoorPvPMgr() { diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h index 1e314bfd169..2a18a602da9 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h @@ -22,7 +22,7 @@ #define OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL 1000 #include "OutdoorPvP.h" -#include "Policies/Singleton.h" +#include "ace/Singleton.h" class Player; class GameObject; @@ -79,7 +79,7 @@ private: uint32 m_UpdateTimer; }; -#define sOutdoorPvPMgr Trinity::Singleton::Instance() +#define sOutdoorPvPMgr (*ACE_Singleton::instance()) #endif /*OUTDOOR_PVP_MGR_H_*/ diff --git a/src/server/game/Pools/PoolHandler.cpp b/src/server/game/Pools/PoolMgr.cpp similarity index 89% rename from src/server/game/Pools/PoolHandler.cpp rename to src/server/game/Pools/PoolMgr.cpp index 0b5a55623e0..28fb67ad4dd 100644 --- a/src/server/game/Pools/PoolHandler.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -16,14 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "PoolHandler.h" +#include "PoolMgr.h" #include "ObjectMgr.h" #include "ProgressBar.h" #include "Log.h" #include "MapManager.h" -#include "Policies/SingletonImp.h" - -INSTANTIATE_SINGLETON_1(PoolHandler); //////////////////////////////////////////////////////////// // template class SpawnedPoolData @@ -121,10 +118,10 @@ void PoolGroup::AddEntry(PoolObject& poolitem, uint32 maxentries) template bool PoolGroup::CheckPool() const { - if (EqualChanced.size() == 0) + if (!EqualChanced.size()) { float chance = 0; - for (uint32 i=0; i::Despawn1Object(uint32 guid) { objmgr.RemoveCreatureFromGrid(guid, data); - if (Creature* pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); } } @@ -214,7 +211,7 @@ void PoolGroup::Despawn1Object(uint32 guid) { objmgr.RemoveGameobjectFromGrid(guid, data); - if (GameObject* pGameobject = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); } } @@ -297,7 +294,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) objmgr.AddCreatureToGrid(obj->guid, data); // Spawn if necessary (loaded grids only) - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(sMapMgr.CreateBaseMap(data->mapid)); // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -323,7 +320,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) objmgr.AddGameobjectToGrid(obj->guid, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(sMapMgr.CreateBaseMap(data->mapid)); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -355,7 +352,7 @@ template <> void PoolGroup::ReSpawn1Object(PoolObject* obj) { if (CreatureData const* data = objmgr.GetCreatureData(obj->guid)) - if (Creature* pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->GetMap()->Add(pCreature); } @@ -364,7 +361,7 @@ template <> void PoolGroup::ReSpawn1Object(PoolObject* obj) { if (GameObjectData const* data = objmgr.GetGOData(obj->guid)) - if (GameObject* pGameobject = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->GetMap()->Add(pGameobject); } @@ -375,13 +372,13 @@ void PoolGroup::ReSpawn1Object(PoolObject* /*obj*/) } //////////////////////////////////////////////////////////// -// Methods of class PoolHandler +// Methods of class PoolMgr -PoolHandler::PoolHandler() +PoolMgr::PoolMgr() { } -void PoolHandler::LoadFromDB() +void PoolMgr::LoadFromDB() { QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template"); if (!result) @@ -657,9 +654,9 @@ void PoolHandler::LoadFromDB() } // The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks -void PoolHandler::Initialize() +void PoolMgr::Initialize() { - QueryResult_AutoPtr result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL AND pool_pool.pool_id IS NULL"); + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry, pool_pool.pool_id, pool_pool.mother_pool FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL"); uint32 count=0; if (result) { @@ -667,13 +664,25 @@ void PoolHandler::Initialize() { Field *fields = result->Fetch(); uint16 pool_entry = fields[0].GetUInt16(); + uint16 pool_pool_id = fields[1].GetUInt16(); + if (!CheckPool(pool_entry)) { - sLog.outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", pool_entry); + if (pool_pool_id) + // The pool is a child pool in pool_pool table. Ideally we should remove it from the pool handler to ensure it never gets spawned, + // however that could recursively invalidate entire chain of mother pools. It can be done in the future but for now we'll do nothing. + sLog.outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt16()); + else + sLog.outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry); continue; } - SpawnPool(pool_entry);; - count++; + + // Don't spawn child pools, they are spawned recursively by their parent pools + if (!pool_pool_id) + { + SpawnPool(pool_entry);; + count++; + } } while (result->NextRow()); } @@ -683,7 +692,7 @@ void PoolHandler::Initialize() // Call to spawn a pool, if cache if true the method will spawn only if cached entry is different // If it's same, the creature is respawned only (added back to map) template<> -void PoolHandler::SpawnPool(uint16 pool_id, uint32 db_guid) +void PoolMgr::SpawnPool(uint16 pool_id, uint32 db_guid) { if (!mPoolCreatureGroups[pool_id].isEmpty()) mPoolCreatureGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); @@ -692,7 +701,7 @@ void PoolHandler::SpawnPool(uint16 pool_id, uint32 db_guid) // Call to spawn a pool, if cache if true the method will spawn only if cached entry is different // If it's same, the gameobject is respawned only (added back to map) template<> -void PoolHandler::SpawnPool(uint16 pool_id, uint32 db_guid) +void PoolMgr::SpawnPool(uint16 pool_id, uint32 db_guid) { if (!mPoolGameobjectGroups[pool_id].isEmpty()) mPoolGameobjectGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); @@ -701,13 +710,13 @@ void PoolHandler::SpawnPool(uint16 pool_id, uint32 db_guid) // Call to spawn a pool, if cache if true the method will spawn only if cached entry is different // If it's same, the pool is respawned only template<> -void PoolHandler::SpawnPool(uint16 pool_id, uint32 sub_pool_id) +void PoolMgr::SpawnPool(uint16 pool_id, uint32 sub_pool_id) { if (!mPoolPoolGroups[pool_id].isEmpty()) mPoolPoolGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, sub_pool_id); } -void PoolHandler::SpawnPool(uint16 pool_id) +void PoolMgr::SpawnPool(uint16 pool_id) { SpawnPool(pool_id, 0); SpawnPool(pool_id, 0); @@ -715,7 +724,7 @@ void PoolHandler::SpawnPool(uint16 pool_id) } // Call to despawn a pool, all gameobjects/creatures in this pool are removed -void PoolHandler::DespawnPool(uint16 pool_id) +void PoolMgr::DespawnPool(uint16 pool_id) { if (!mPoolCreatureGroups[pool_id].isEmpty()) mPoolCreatureGroups[pool_id].DespawnObject(mSpawnedData); @@ -728,7 +737,7 @@ void PoolHandler::DespawnPool(uint16 pool_id) } // Method that check chance integrity of the creatures and gameobjects in this pool -bool PoolHandler::CheckPool(uint16 pool_id) const +bool PoolMgr::CheckPool(uint16 pool_id) const { return pool_id <= max_pool_id && mPoolGameobjectGroups[pool_id].CheckPool() && @@ -740,7 +749,7 @@ bool PoolHandler::CheckPool(uint16 pool_id) const // Here we cache only the creature/gameobject whose guid is passed as parameter // Then the spawn pool call will use this cache to decide template -void PoolHandler::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id) +void PoolMgr::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id) { if (uint16 motherpoolid = IsPartOfAPool(pool_id)) SpawnPool(motherpoolid, pool_id); @@ -748,6 +757,6 @@ void PoolHandler::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id) SpawnPool(pool_id, db_guid_or_pool_id); } -template void PoolHandler::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id); -template void PoolHandler::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id); -template void PoolHandler::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id); \ No newline at end of file +template void PoolMgr::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id); +template void PoolMgr::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id); +template void PoolMgr::UpdatePool(uint16 pool_id, uint32 db_guid_or_pool_id); diff --git a/src/server/game/Pools/PoolHandler.h b/src/server/game/Pools/PoolMgr.h similarity index 92% rename from src/server/game/Pools/PoolHandler.h rename to src/server/game/Pools/PoolMgr.h index 0ba4cc7769f..71cae3e4a1b 100644 --- a/src/server/game/Pools/PoolHandler.h +++ b/src/server/game/Pools/PoolMgr.h @@ -19,8 +19,8 @@ #ifndef TRINITY_POOLHANDLER_H #define TRINITY_POOLHANDLER_H -#include "Platform/Define.h" -#include "Policies/Singleton.h" +#include "Define.h" +#include "ace/Singleton.h" #include "Creature.h" #include "GameObject.h" @@ -87,12 +87,13 @@ class PoolGroup PoolObjectList EqualChanced; }; -class PoolHandler +class PoolMgr { - public: - PoolHandler(); - ~PoolHandler() {}; + friend class ACE_Singleton; + PoolMgr(); + ~PoolMgr() {}; + public: void LoadFromDB(); void Initialize(); @@ -134,11 +135,11 @@ class PoolHandler SpawnedPoolData mSpawnedData; }; -#define poolhandler Trinity::Singleton::Instance() +#define poolhandler (*ACE_Singleton::instance()) // Method that tell if the creature is part of a pool and return the pool id if yes template<> -inline uint16 PoolHandler::IsPartOfAPool(uint32 db_guid) const +inline uint16 PoolMgr::IsPartOfAPool(uint32 db_guid) const { SearchMap::const_iterator itr = mCreatureSearchMap.find(db_guid); if (itr != mCreatureSearchMap.end()) @@ -149,7 +150,7 @@ inline uint16 PoolHandler::IsPartOfAPool(uint32 db_guid) const // Method that tell if the gameobject is part of a pool and return the pool id if yes template<> -inline uint16 PoolHandler::IsPartOfAPool(uint32 db_guid) const +inline uint16 PoolMgr::IsPartOfAPool(uint32 db_guid) const { SearchMap::const_iterator itr = mGameobjectSearchMap.find(db_guid); if (itr != mGameobjectSearchMap.end()) @@ -160,7 +161,7 @@ inline uint16 PoolHandler::IsPartOfAPool(uint32 db_guid) const // Method that tell if the pool is part of another pool and return the pool id if yes template<> -inline uint16 PoolHandler::IsPartOfAPool(uint32 pool_id) const +inline uint16 PoolMgr::IsPartOfAPool(uint32 pool_id) const { SearchMap::const_iterator itr = mPoolSearchMap.find(pool_id); if (itr != mPoolSearchMap.end()) diff --git a/src/server/game/PrecompiledHeaders/NixCorePCH.cpp b/src/server/game/PrecompiledHeaders/NixCorePCH.cpp deleted file mode 100644 index e588392689e..00000000000 --- a/src/server/game/PrecompiledHeaders/NixCorePCH.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pchdef.h" \ No newline at end of file diff --git a/src/server/game/PrecompiledHeaders/ScriptPCH.cpp b/src/server/game/PrecompiledHeaders/ScriptPCH.cpp index a80690d05da..41fecf3c60d 100644 --- a/src/server/game/PrecompiledHeaders/ScriptPCH.cpp +++ b/src/server/game/PrecompiledHeaders/ScriptPCH.cpp @@ -2,5 +2,5 @@ * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" diff --git a/src/server/game/PrecompiledHeaders/ScriptPCH.h b/src/server/game/PrecompiledHeaders/ScriptPCH.h index 1e83a88b87a..f8515e99f89 100644 --- a/src/server/game/PrecompiledHeaders/ScriptPCH.h +++ b/src/server/game/PrecompiledHeaders/ScriptPCH.h @@ -23,7 +23,7 @@ #include "DBCStores.h" #include "ObjectMgr.h" -#ifdef WIN32 +#ifdef _WIN32 #include #endif diff --git a/src/server/game/PrecompiledHeaders/WinCorePCH.cpp b/src/server/game/PrecompiledHeaders/WinCorePCH.cpp deleted file mode 100644 index e588392689e..00000000000 --- a/src/server/game/PrecompiledHeaders/WinCorePCH.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pchdef.h" \ No newline at end of file diff --git a/src/server/game/PrecompiledHeaders/WinCorePCH.h b/src/server/game/PrecompiledHeaders/WinCorePCH.h deleted file mode 100644 index cd1ea4a418a..00000000000 --- a/src/server/game/PrecompiledHeaders/WinCorePCH.h +++ /dev/null @@ -1,14 +0,0 @@ -//add here most rarely modified headers to speed up debug build compilation -#include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it -#include "Common.h" - -#include "MapManager.h" -#include "Log.h" -#include "ObjectAccessor.h" -#include "ObjectDefines.h" -#include "Database/SQLStorage.h" -#include "Opcodes.h" -#include "SharedDefines.h" -#include "ObjectMgr.h" - -#include "ScriptedPch.h" \ No newline at end of file diff --git a/src/server/game/PrecompiledHeaders/gamePCH.cpp b/src/server/game/PrecompiledHeaders/gamePCH.cpp new file mode 100644 index 00000000000..11e501ec7f2 --- /dev/null +++ b/src/server/game/PrecompiledHeaders/gamePCH.cpp @@ -0,0 +1 @@ +#include "gamePCH.h" diff --git a/src/server/game/PrecompiledHeaders/NixCorePCH.h b/src/server/game/PrecompiledHeaders/gamePCH.h similarity index 87% rename from src/server/game/PrecompiledHeaders/NixCorePCH.h rename to src/server/game/PrecompiledHeaders/gamePCH.h index 7252e980e7d..dd56e3fc16c 100644 --- a/src/server/game/PrecompiledHeaders/NixCorePCH.h +++ b/src/server/game/PrecompiledHeaders/gamePCH.h @@ -3,10 +3,10 @@ #include "Common.h" #include "MapManager.h" -#include "Log.h" +#include "Logging/Log.h" #include "ObjectAccessor.h" #include "ObjectDefines.h" -#include "Database/SQLStorage.h" +#include "SQLStorage.h" #include "Opcodes.h" #include "SharedDefines.h" #include "ObjectMgr.h" diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 2fdd1c58e9b..43ad7ffc114 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -175,7 +175,7 @@ uint32 Quest::XPValue(Player *pPlayer) const if (!xpentry) return 0; - int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20; + int32 diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20; if (diffFactor < 1) diffFactor = 1; else if (diffFactor > 10) @@ -204,3 +204,11 @@ int32 Quest::GetRewOrReqMoney() const return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY)); } + +bool Quest::IsAllowedInRaid() const +{ + if (IsRaidQuest()) + return true; + + return sWorld.getConfig(CONFIG_QUEST_IGNORE_RAID); +} diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 20d4ca3d28d..64c9b47627d 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -21,8 +21,9 @@ #ifndef TRINITYCORE_QUEST_H #define TRINITYCORE_QUEST_H -#include "Platform/Define.h" -#include "Database/DatabaseEnv.h" +#include "Define.h" +#include "DatabaseEnv.h" +#include "SharedDefines.h" #include #include @@ -244,6 +245,8 @@ class Quest bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; } bool IsDailyOrWeekly() const { return QuestFlags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } bool IsAutoAccept() const { return QuestFlags & QUEST_FLAGS_AUTO_ACCEPT; } + bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } + bool IsAllowedInRaid() const; // multiple values std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 2006c091287..cf378db2bac 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -14,11 +14,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "ScriptedPch.h" - -#ifdef WIN32 - #define DO_SCRIPTS -#endif +#include "ScriptPCH.h" #ifdef DO_SCRIPTS //custom diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 2dcfd258942..70b1ff6be64 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -2,17 +2,14 @@ * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ -#include "ScriptedPch.h" -#include "Config/Config.h" -#include "Database/DatabaseEnv.h" +#include "ScriptPCH.h" +#include "Config.h" +#include "DatabaseEnv.h" #include "DBCStores.h" #include "ObjectMgr.h" #include "ProgressBar.h" #include "ScriptLoader.h" #include "ScriptSystem.h" -#include "Policies/SingletonImp.h" - -INSTANTIATE_SINGLETON_1(ScriptMgr); int num_sc_scripts; Script *m_scripts[MAX_SCRIPTS]; @@ -45,22 +42,22 @@ ScriptMgr::~ScriptMgr() void ScriptMgr::ScriptsInit() { //Trinity Script startup - outstring_log(" _____ _ _ _ ____ _ _"); - outstring_log("|_ _| __(_)_ __ (_) |_ _ _/ ___| ___ _ __(_)_ __ | |_ "); - outstring_log(" | || '__| | '_ \\| | __| | | \\___ \\ / __| \'__| | \'_ \\| __|"); - outstring_log(" | || | | | | | | | |_| |_| |___) | (__| | | | |_) | |_ "); - outstring_log(" |_||_| |_|_| |_|_|\\__|\\__, |____/ \\___|_| |_| .__/ \\__|"); - outstring_log(" |___/ |_| "); - outstring_log(""); - outstring_log(""); + /*sLog.outString(" _____ _ _ _ ____ _ _"); + sLog.outString("|_ _| __(_)_ __ (_) |_ _ _/ ___| ___ _ __(_)_ __ | |_ "); + sLog.outString(" | || '__| | '_ \\| | __| | | \\___ \\ / __| \'__| | \'_ \\| __|"); + sLog.outString(" | || | | | | | | | |_| |_| |___) | (__| | | | |_) | |_ "); + sLog.outString(" |_||_| |_|_| |_|_|\\__|\\__, |____/ \\___|_| |_| .__/ \\__|"); + sLog.outString(" |___/ |_| "); + sLog.outString(""); + sLog.outString("");*/ //Load database (must be called after SD2Config.SetSource). LoadDatabase(); - outstring_log("TSCR: Loading C++ scripts"); + sLog.outString("Loading C++ scripts"); barGoLink bar(1); bar.step(); - outstring_log(""); + sLog.outString(""); for (uint16 i =0; i> Loaded %i C++ Scripts.", num_sc_scripts); + sLog.outString(">> Loaded %i C++ Scripts.", num_sc_scripts); - outstring_log(">> Load Overriden SQL Data."); + sLog.outString(">> Load Overriden SQL Data."); LoadOverridenSQLData(); } @@ -82,13 +79,13 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) { if (!pSource) { - error_log("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry); + sLog.outError("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry); return; } if (iTextEntry >= 0) { - error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); + sLog.outError("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); return; } @@ -96,11 +93,11 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (!pData) { - error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); + sLog.outError("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); return; } - debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); + sLog.outDebug("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); if (pData->uiSoundId) { @@ -109,7 +106,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) pSource->SendPlaySound(pData->uiSoundId, false); } else - error_log("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); + sLog.outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); } if (pData->uiEmote) @@ -117,7 +114,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) ((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote); else - error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId()); + sLog.outError("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId()); } switch(pData->uiType) @@ -139,7 +136,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID()); else - error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + sLog.outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); } break; case CHAT_TYPE_BOSS_WHISPER: @@ -147,7 +144,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true); else - error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + sLog.outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); } break; case CHAT_TYPE_ZONE_YELL: @@ -165,7 +162,7 @@ void Script::RegisterSelf() // somebody forgot to allocate memory for a script by a method like this: newscript = new Script if (m_scripts[i] == this) { - error_log("ScriptName: '%s' - Forgot to allocate memory, so this script and/or the script before that can't work.", Name.c_str()); + sLog.outError("ScriptName: '%s' - Forgot to allocate memory, so this script and/or the script before that can't work.", Name.c_str()); // don't register it // and don't delete it because its memory is used for another script return; @@ -200,14 +197,14 @@ void Script::RegisterSelf() else { // TODO: write a better error message than this one :) - error_log("ScriptName: '%s' already assigned with the same ScriptName, so the script can't work.", Name.c_str()); + sLog.outError("ScriptName: '%s' already assigned with the same ScriptName, so the script can't work.", Name.c_str()); delete this; } } else { if (Name.find("example") == std::string::npos) - error_db_log("TrinityScript: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str()); + sLog.outErrorDb("TrinityScript: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str()); delete this; } } @@ -326,7 +323,7 @@ bool ScriptMgr::GossipHello (Player * pPlayer, Creature* pCreature) bool ScriptMgr::GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) { - debug_log("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction); + sLog.outDebug("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction); Script *tmpscript = m_scripts[pCreature->GetScriptId()]; if (!tmpscript || !tmpscript->pGossipSelect) return false; @@ -337,7 +334,7 @@ bool ScriptMgr::GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSend bool ScriptMgr::GossipSelectWithCode(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode) { - debug_log("TSCR: Gossip selection with code, sender: %d, action: %d", uiSender, uiAction); + sLog.outDebug("TSCR: Gossip selection with code, sender: %d, action: %d", uiSender, uiAction); Script *tmpscript = m_scripts[pCreature->GetScriptId()]; if (!tmpscript || !tmpscript->pGossipSelectWithCode) return false; @@ -350,7 +347,7 @@ bool ScriptMgr::GOSelect(Player* pPlayer, GameObject* pGO, uint32 uiSender, uint { if (!pGO) return false; - debug_log("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction); + sLog.outDebug("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction); Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId]; if (!tmpscript || !tmpscript->pGOSelect) return false; @@ -363,7 +360,7 @@ bool ScriptMgr::GOSelectWithCode(Player* pPlayer, GameObject* pGO, uint32 uiSend { if (!pGO) return false; - debug_log("TSCR: Gossip selection, sender: %d, action: %d",uiSender, uiAction); + sLog.outDebug("TSCR: Gossip selection, sender: %d, action: %d",uiSender, uiAction); Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId]; if (!tmpscript || !tmpscript->pGOSelectWithCode) return false; diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index ed7200d5786..bcb26381809 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -9,9 +9,9 @@ #define SC_SCRIPTMGR_H #include "Common.h" -#include "Platform/CompilerDefs.h" +#include "CompilerDefs.h" #include "DBCStructure.h" -#include "Config/ConfigEnv.h" +#include "ConfigEnv.h" class Player; class Creature; @@ -94,8 +94,9 @@ struct Script class ScriptMgr { + friend class ACE_Singleton; + ScriptMgr(); public: - ScriptMgr(); ~ScriptMgr(); void ScriptsInit(); @@ -158,6 +159,6 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit *pTarget = NULL); #define FUNC_PTR(name, callconvention, returntype, parameters) typedef returntype(callconvention *name)parameters; #endif -#define sScriptMgr Trinity::Singleton::Instance() +#define sScriptMgr (*ACE_Singleton::instance()) #endif diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 0037b100412..54a14228bc1 100644 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -18,11 +18,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptSystem.h" #include "ProgressBar.h" #include "ObjectMgr.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" SystemMgr::SystemMgr() { @@ -43,24 +43,24 @@ void SystemMgr::LoadVersion() { Field* pFields = Result->Fetch(); - outstring_log("TSCR: Database version is: %s", pFields[0].GetString()); - outstring_log(""); + sLog.outString("TSCR: Database version is: %s", pFields[0].GetString()); + sLog.outString(""); } else { - error_log("TSCR: Missing `version`.`script_version` information."); - outstring_log(""); + sLog.outError("TSCR: Missing `version`.`script_version` information."); + sLog.outString(""); } } void SystemMgr::LoadScriptTexts() { - outstring_log("TSCR: Loading Script Texts..."); + sLog.outString("TSCR: Loading Script Texts..."); LoadTrinityStrings(WorldDatabase,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); QueryResult_AutoPtr Result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts"); - outstring_log("TSCR: Loading Script Texts additional data..."); + sLog.outString("TSCR: Loading Script Texts additional data..."); if (Result) { @@ -81,52 +81,52 @@ void SystemMgr::LoadScriptTexts() if (iId >= 0) { - error_db_log("TSCR: Entry %i in table `script_texts` is not a negative value.", iId); + sLog.outErrorDb("TSCR: Entry %i in table `script_texts` is not a negative value.", iId); continue; } if (iId > TEXT_SOURCE_RANGE || iId <= TEXT_SOURCE_RANGE*2) { - error_db_log("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId); + sLog.outErrorDb("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId); continue; } if (pTemp.uiSoundId) { if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) - error_db_log("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + sLog.outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); } if (!GetLanguageDescByID(pTemp.uiLanguage)) - error_db_log("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + sLog.outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); if (pTemp.uiType > CHAT_TYPE_ZONE_YELL) - error_db_log("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); + sLog.outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); m_mTextDataMap[iId] = pTemp; ++uiCount; } while (Result->NextRow()); - outstring_log(""); - outstring_log(">> Loaded %u additional Script Texts data.", uiCount); + sLog.outString(""); + sLog.outString(">> Loaded %u additional Script Texts data.", uiCount); } else { barGoLink bar(1); bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); + sLog.outString(""); + sLog.outString(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); } } void SystemMgr::LoadScriptTextsCustom() { - outstring_log("TSCR: Loading Custom Texts..."); + sLog.outString("TSCR: Loading Custom Texts..."); LoadTrinityStrings(WorldDatabase,"custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3)); QueryResult_AutoPtr Result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts"); - outstring_log("TSCR: Loading Custom Texts additional data..."); + sLog.outString("TSCR: Loading Custom Texts additional data..."); if (Result) { @@ -147,41 +147,41 @@ void SystemMgr::LoadScriptTextsCustom() if (iId >= 0) { - error_db_log("TSCR: Entry %i in table `custom_texts` is not a negative value.", iId); + sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` is not a negative value.", iId); continue; } if (iId > TEXT_SOURCE_RANGE*2 || iId <= TEXT_SOURCE_RANGE*3) { - error_db_log("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId); + sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId); continue; } if (pTemp.uiSoundId) { if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) - error_db_log("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); } if (!GetLanguageDescByID(pTemp.uiLanguage)) - error_db_log("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); if (pTemp.uiType > CHAT_TYPE_ZONE_YELL) - error_db_log("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); + sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); m_mTextDataMap[iId] = pTemp; ++uiCount; } while (Result->NextRow()); - outstring_log(""); - outstring_log(">> Loaded %u additional Custom Texts data.", uiCount); + sLog.outString(""); + sLog.outString(">> Loaded %u additional Custom Texts data.", uiCount); } else { barGoLink bar(1); bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); + sLog.outString(""); + sLog.outString(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); } } @@ -197,7 +197,7 @@ void SystemMgr::LoadScriptWaypoints() if (Result) uiCreatureCount = Result->GetRowCount(); - outstring_log("TSCR: Loading Script Waypoints for %u creature(s)...", uiCreatureCount); + sLog.outString("TSCR: Loading Script Waypoints for %u creature(s)...", uiCreatureCount); Result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); @@ -224,25 +224,25 @@ void SystemMgr::LoadScriptWaypoints() if (!pCInfo) { - error_db_log("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.uiCreatureEntry); + sLog.outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.uiCreatureEntry); continue; } if (!pCInfo->ScriptID) - error_db_log("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); + sLog.outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); m_mPointMoveMap[uiEntry].push_back(pTemp); ++uiNodeCount; } while (Result->NextRow()); - outstring_log(""); - outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount); + sLog.outString(""); + sLog.outString(">> Loaded %u Script Waypoint nodes.", uiNodeCount); } else { barGoLink bar(1); bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + sLog.outString(""); + sLog.outString(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); } } diff --git a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp b/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp index a9c8101d7b1..13fbd266ea4 100644 --- a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp @@ -18,17 +18,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "zlib/zlib.h" - +#include "zlib.h" #include "AddonHandler.h" -#include "Database/DatabaseEnv.h" -#include "Policies/SingletonImp.h" +#include "DatabaseEnv.h" #include "Opcodes.h" - #include "Log.h" -INSTANTIATE_SINGLETON_1( AddonHandler ); - AddonHandler::AddonHandler() { } diff --git a/src/server/game/Server/Protocol/Handlers/AddonHandler.h b/src/server/game/Server/Protocol/Handlers/AddonHandler.h index 999785339bc..68620751da3 100644 --- a/src/server/game/Server/Protocol/Handlers/AddonHandler.h +++ b/src/server/game/Server/Protocol/Handlers/AddonHandler.h @@ -22,20 +22,21 @@ #define __ADDONHANDLER_H #include "Common.h" -#include "Config/ConfigEnv.h" -#include "Policies/Singleton.h" - +#include "ConfigEnv.h" +#include "ace/Singleton.h" #include "WorldPacket.h" class AddonHandler { + /* Construction */ + friend class ACE_Singleton; + AddonHandler(); + public: - /* Construction */ - AddonHandler(); ~AddonHandler(); - //built addon packet + //build addon packet bool BuildAddonPacket(WorldPacket* Source, WorldPacket* Target); }; -#define sAddOnHandler Trinity::Singleton::Instance() +#define sAddOnHandler ACE_Singleton::instance() #endif diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp index 3a9a14524f9..3c26e17bddd 100644 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp @@ -22,7 +22,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSession.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "ArenaTeam.h" #include "Log.h" @@ -91,7 +91,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) if (!normalizePlayerName(Invitedname)) return; - player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str()); + player = sObjectAccessor.FindPlayerByName(Invitedname.c_str()); } if (!player) diff --git a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp index 0f615579cb6..442fe55b194 100644 --- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp @@ -18,8 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Policies/SingletonImp.h" - #include "ObjectMgr.h" // for normalizePlayerName #include "ChannelMgr.h" diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 416827d73ea..ca08d197c3f 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -25,9 +25,9 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSession.h" -#include "Auth/md5.h" -#include "Database/DatabaseEnv.h" -#include "Database/DatabaseImpl.h" +#include "MD5.h" +#include "DatabaseEnv.h" +#include "DatabaseImpl.h" #include "ArenaTeam.h" #include "Chat.h" @@ -719,7 +719,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation()); } - ObjectAccessor::Instance().AddObject(pCurrChar); + sObjectAccessor.AddObject(pCurrChar); //sLog.outDebug("Player %s added to Map.",pCurrChar->GetName()); pCurrChar->SendInitialPacketsAfterAddToMap(); diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index 88e2b5473a5..85f37b52478 100644 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -24,7 +24,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSession.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "CellImpl.h" #include "Chat.h" diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index f973bc24722..4f43ad3c30b 100644 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Opcodes.h" #include "Log.h" #include "WorldPacket.h" @@ -126,7 +126,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) if (group) { // not have permissions for invite - if (group->isRaidGroup() && !group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) + if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) { SendPartyResult(PARTY_OP_INVITE, "", ERR_NOT_LEADER); return; @@ -534,8 +534,10 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) std::string name; uint8 groupNr; recv_data >> name; - recv_data >> groupNr; + + if (groupNr >= MAX_RAID_SUBGROUPS) + return; /** error handling **/ uint64 senderGuid = GetPlayer()->GetGUID(); @@ -546,16 +548,18 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) return; /********************/ - Player *movedPlayer=objmgr.GetPlayer(name.c_str()); - if (!movedPlayer) - return; + Player *movedPlayer = objmgr.GetPlayer(name.c_str()); + if (movedPlayer) + { + //Do not allow leader to change group of player in combat + if (movedPlayer->isInCombat()) + return; - //Do not allow leader to change group of player in combat - if (movedPlayer->isInCombat()) - return; - - // everything's fine, do it - group->ChangeMembersGroup(movedPlayer, groupNr); + // everything's fine, do it + group->ChangeMembersGroup(movedPlayer, groupNr); + } + else + group->ChangeMembersGroup(objmgr.GetPlayerGUIDByName(name.c_str()), groupNr); } void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) @@ -593,7 +597,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) /** error handling **/ uint64 senderGuid = GetPlayer()->GetGUID(); - if (!group->IsLeader(senderGuid) && group->IsAssistant(senderGuid)) + if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid)) return; /********************/ diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index 6803fe63a86..4db1961e7af 100644 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -75,7 +75,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) recvPacket >> Invitedname; if (normalizePlayerName(Invitedname)) - player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str()); + player = sObjectAccessor.FindPlayerByName(Invitedname.c_str()); if (!player) { diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index 53aede43492..39c3b61a445 100644 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -263,6 +263,12 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) return; } + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_INDESTRUCTIBLE)) + { + _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); + return; + } + if (count) { uint32 i_count = count; @@ -766,7 +772,7 @@ void WorldSession::SendListInventory(uint64 vendorguid) ++count; // reputation discount - int32 price = uint32(floor(pProto->BuyPrice * discountMod)); + int32 price = crItem->IsGoldRequired(pProto) ? uint32(floor(pProto->BuyPrice * discountMod)) : 0; data << uint32(vendorslot+1); // client expects counting to start at 1 data << uint32(crItem->item); @@ -1003,40 +1009,25 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) recv_data.read_skip(); // guid sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); - ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid); - if (pProto) + ItemSetNameEntry const *pName = objmgr.GetItemSetNameEntry(itemid); + if (pName) { - std::string Name; - Name = pProto->Name1; - + std::string Name = pName->name; int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) { - ItemLocale const *il = objmgr.GetItemLocale(pProto->ItemId); - if (il) - { - if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty()) - Name = il->Name[loc_idx]; - } + ItemSetNameLocale const *isnl = objmgr.GetItemSetNameLocale(itemid); + if (isnl) + if (isnl->Name.size() > size_t(loc_idx) && !isnl->Name[loc_idx].empty()) + Name = isnl->Name[loc_idx]; } - // guess size - WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+10)); - data << uint32(pProto->ItemId); + + WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+Name.size()+1+4)); + data << uint32(itemid); data << Name; - data << uint32(pProto->InventoryType); + data << uint32(pName->InventoryType); SendPacket(&data); - return; } -// This is a BS check, there are lots of items listed in Item.dbc that do not even exist on official -- so we can NEVER get the data for them. -// If you *really* want to spam your error log -- uncomment this. -/* else - { - // listed in dbc or not expected to exist unknown item - if (sItemStore.LookupEntry(itemid)) - sLog.outErrorDb("WORLD: CMSG_ITEM_NAME_QUERY for item %u failed (item listed in Item.dbc but not exist in DB)", itemid); - else - sLog.outError("WORLD: CMSG_ITEM_NAME_QUERY for item %u failed (unknown item, not listed in Item.dbc)", itemid); - } */ } void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index ea6f892c126..4225a99c72b 100644 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -20,8 +20,8 @@ #include "Common.h" #include "Language.h" -#include "Database/DatabaseEnv.h" -#include "Database/DatabaseImpl.h" +#include "DatabaseEnv.h" +#include "DatabaseImpl.h" #include "WorldPacket.h" #include "Opcodes.h" #include "Log.h" @@ -30,12 +30,12 @@ #include "World.h" #include "ObjectMgr.h" #include "WorldSession.h" -#include "Auth/BigNumber.h" -#include "Auth/Sha1.h" +#include "BigNumber.h" +#include "SHA1.h" #include "UpdateData.h" #include "LootMgr.h" #include "Chat.h" -#include +#include "zlib.h" #include "ObjectAccessor.h" #include "Object.h" #include "BattleGround.h" @@ -232,8 +232,8 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) data << uint32(clientcount); // clientcount place holder, listed count data << uint32(clientcount); // clientcount place holder, online count - ObjectAccessor::Guard guard(*HashMapHolder::GetLock()); - HashMapHolder::MapType& m = ObjectAccessor::Instance().GetPlayers(); + ACE_GUARD(ACE_Thread_Mutex, g, *HashMapHolder::GetLock()); + HashMapHolder::MapType& m = sObjectAccessor.GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { if (security == SEC_PLAYER) @@ -374,7 +374,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) return; } - //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in TrinityCore.conf + //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || GetSecurity() >= sWorld.getConfig(CONFIG_INSTANT_LOGOUT)) { @@ -931,11 +931,13 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if (!at) return; - if (!GetPlayer()->Satisfy(objmgr.GetAccessRequirement(at->access_id), at->target_mapId, true)) - return; + // MapManager::CanPlayerEnter() calls players->Satisfy() so this is not needed here + // if (!GetPlayer()->Satisfy(objmgr.GetAccessRequirement(at->access_id), at->target_mapId, true)) + // return; + // Check only if target map != current player's map // check if player can enter instance : instance not full, and raid instance not in encounter fight - if (!MapManager::Instance().CanPlayerEnter(at->target_mapId, GetPlayer(), false)) + if (GetPlayer()->GetMapId() != at->target_mapId && !sMapMgr.CanPlayerEnter(at->target_mapId, GetPlayer(), false)) return; GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT); diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 1148fe174fc..a31361e9275 100644 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -28,7 +28,7 @@ #include "Vehicle.h" #include "SpellAuras.h" #include "MapManager.h" -#include "Transports.h" +#include "Transport.h" #include "BattleGround.h" #include "WaypointMovementGenerator.h" #include "InstanceSaveMgr.h" @@ -75,7 +75,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() } // relocate the player to the teleport destination - Map * newMap = MapManager::Instance().CreateMap(loc.GetMapId(), GetPlayer(), 0); + Map * newMap = sMapMgr.CreateMap(loc.GetMapId(), GetPlayer(), 0); // the CanEnter checks are done in TeleporTo but conditions may change // while the player is in transit, for example the map may get full if (!newMap || !newMap->CanEnter(GetPlayer())) @@ -198,7 +198,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) uint32 flags, time; recv_data >> flags >> time; DEBUG_LOG("Guid " UI64FMTD, guid); - DEBUG_LOG("Flags %u, time %u", flags, time/IN_MILISECONDS); + DEBUG_LOG("Flags %u, time %u", flags, time/IN_MILLISECONDS); Unit *mover = _player->m_mover; Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; @@ -302,7 +302,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) if (plMover && !plMover->GetTransport()) { // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list - for (MapManager::TransportSet::const_iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) + for (MapManager::TransportSet::const_iterator iter = sMapMgr.m_Transports.begin(); iter != sMapMgr.m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == movementInfo.t_guid) { diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index 4e73fb381af..00da860db89 100644 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -20,7 +20,7 @@ #include "Common.h" #include "Language.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "WorldSession.h" #include "Opcodes.h" diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index 1067ad49bc4..fc2c3baf735 100644 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -20,8 +20,8 @@ #include "Common.h" #include "Language.h" -#include "Database/DatabaseEnv.h" -#include "Database/DatabaseImpl.h" +#include "DatabaseEnv.h" +#include "DatabaseImpl.h" #include "WorldPacket.h" #include "WorldSession.h" #include "Opcodes.h" @@ -302,7 +302,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) if (corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0) { // if corpse map have entrance - if (Map const* entranceMap = MapManager::Instance().CreateBaseMap(corpseMapEntry->entrance_map)) + if (Map const* entranceMap = sMapMgr.CreateBaseMap(corpseMapEntry->entrance_map)) { mapid = corpseMapEntry->entrance_map; x = corpseMapEntry->entrance_x; @@ -536,4 +536,4 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) } SendPacket(&data); -} \ No newline at end of file +} diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 8043f5ed149..d513dc4b84c 100644 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -422,7 +422,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) if (!pOriginalPlayer) return; - if (pQuest->GetType() == QUEST_TYPE_RAID) + if (pQuest->IsRaidQuest()) { if (!_player->IsInSameRaidWith(pOriginalPlayer)) return; diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 312065f9f13..e6ad7a4c9e4 100644 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Opcodes.h" #include "Log.h" #include "Player.h" diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index b8a4a127824..a526c61a5e7 100644 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -538,11 +538,7 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data) // TODO: Unit::SetCharmedBy: 28782 is not in world but 0 is trying to charm it! -> crash if (!unit->IsInWorld()) - { - sLog.outCrash("Spell click target %u is not in world!", unit->GetEntry()); - assert(false); return; - } SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry()); for (SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp index b0660527f71..3402c99ce8b 100644 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "WorldSession.h" #include "Opcodes.h" @@ -222,7 +222,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) FlightPathMovementGenerator* flight = (FlightPathMovementGenerator*)(GetPlayer()->GetMotionMaster()->top()); flight->SetCurrentNodeAfterTeleport(); - Path::PathNode const& node = flight->GetPath()[flight->GetCurrentNode()]; + TaxiPathNodeEntry const& node = flight->GetPath()[flight->GetCurrentNode()]; flight->SkipCurrentNode(); GetPlayer()->TeleportTo(curDestNode->map_id,node.x,node.y,node.z,GetPlayer()->GetOrientation()); @@ -259,6 +259,8 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) GetPlayer()->m_taxi.ClearTaxiDestinations(); // clear problematic path and next return; } + else + GetPlayer()->m_taxi.ClearTaxiDestinations(); // not destinations, clear source node GetPlayer()->CleanupAfterTaxiFlight(); GetPlayer()->SetFallInformation(0, GetPlayer()->GetPositionZ()); diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index 448a6e0520d..6191b88587e 100644 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -27,37 +27,11 @@ #include "Opcodes.h" #include "Player.h" #include "Item.h" +#include "Spell.h" #include "SocialMgr.h" #include "Language.h" -enum TradeStatus -{ - TRADE_STATUS_BUSY = 0, - TRADE_STATUS_BEGIN_TRADE = 1, - TRADE_STATUS_OPEN_WINDOW = 2, - TRADE_STATUS_TRADE_CANCELED = 3, - TRADE_STATUS_TRADE_ACCEPT = 4, - TRADE_STATUS_BUSY_2 = 5, - TRADE_STATUS_NO_TARGET = 6, - TRADE_STATUS_BACK_TO_TRADE = 7, - TRADE_STATUS_TRADE_COMPLETE = 8, - // 9? - TRADE_STATUS_TARGET_TO_FAR = 10, - TRADE_STATUS_WRONG_FACTION = 11, - TRADE_STATUS_CLOSE_WINDOW = 12, - // 13? - TRADE_STATUS_IGNORE_YOU = 14, - TRADE_STATUS_YOU_STUNNED = 15, - TRADE_STATUS_TARGET_STUNNED = 16, - TRADE_STATUS_YOU_DEAD = 17, - TRADE_STATUS_TARGET_DEAD = 18, - TRADE_STATUS_YOU_LOGOUT = 19, - TRADE_STATUS_TARGET_LOGOUT = 20, - TRADE_STATUS_TRIAL_ACCOUNT = 21, // Trial accounts can not perform that action - TRADE_STATUS_ONLY_CONJURED = 22 // You can only trade conjured items... (cross realm BG related). -}; - -void WorldSession::SendTradeStatus(uint32 status) +void WorldSession::SendTradeStatus(TradeStatus status) { WorldPacket data; @@ -106,68 +80,50 @@ void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) // recvPacket.print_storage(); } -void WorldSession::SendUpdateTrade() +void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) { + TradeData* view_trade = trader_data ? _player->GetTradeData()->GetTraderData() : _player->GetTradeData(); + + WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, 1+4+4+4+4+4+7*(1+4+4+4+4+8+4+4+4+4+8+4+4+4+4+4+4)); + data << uint8(trader_data); // 1 means traders data, 0 means own + data << uint32(0); // added in 2.4.0, this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases + data << uint32(view_trade->GetMoney()); // trader gold + data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item + Item *item = NULL; - if (!_player || !_player->pTrader) - return; - - // reset trade status - if (_player->acceptTrade) - { - _player->acceptTrade = false; - SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - } - - if (_player->pTrader->acceptTrade) - { - _player->pTrader->acceptTrade = false; - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - } - - WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, (100)); // guess size - data << (uint8) 1; // can be different (only seen 0 and 1) - data << (uint32) 0; // added in 2.4.0, this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) - data << (uint32) TRADE_SLOT_COUNT; // trade slots count/number?, = next field in most cases - data << (uint32) TRADE_SLOT_COUNT; // trade slots count/number?, = prev field in most cases - data << (uint32) _player->pTrader->tradeGold; // trader gold - data << (uint32) 0; // spell casted on lowest slot item - for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) { - item = (_player->pTrader->tradeItems[i] != 0 ? _player->pTrader->GetItemByGuid(_player->pTrader->tradeItems[i]) : NULL); + data << uint8(i); // trade slot number, if not specified, then end of packet - data << (uint8) i; // trade slot number, if not specified, then end of packet - - if (item) + if (Item* item = view_trade->GetItem(TradeSlots(i))) { - data << (uint32) item->GetProto()->ItemId; // entry - // display id - data << (uint32) item->GetProto()->DisplayInfoID; - // stack count - data << (uint32) item->GetUInt32Value(ITEM_FIELD_STACK_COUNT); - data << (uint32) 0; // probably gift=1, created_by=0? - // gift creator - data << (uint64) item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR); - data << (uint32) item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT); - for (uint8 j = 0; j < 3; ++j) - data << (uint32) 0; // enchantment id (permanent/gems?) + data << uint32(item->GetProto()->ItemId); // entry + data << uint32(item->GetProto()->DisplayInfoID);// display id + data << uint32(item->GetCount()); // stack count + // wrapped: hide stats but show giftcreator name + data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED) ? 1 : 0); + data << uint64(item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR)); + // perm. enchantment and gems + data << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); + for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot) + data << uint32(item->GetEnchantmentId(EnchantmentSlot(enchant_slot))); // creator - data << (uint64) item->GetUInt64Value(ITEM_FIELD_CREATOR); - data << (uint32) item->GetSpellCharges(); // charges - data << (uint32) item->GetItemSuffixFactor(); // SuffixFactor - // random properties id - data << (int32) item->GetItemRandomPropertyId(); - data << (uint32) item->GetProto()->LockID; // lock id + data << uint64(item->GetUInt64Value(ITEM_FIELD_CREATOR)); + data << uint32(item->GetSpellCharges()); // charges + data << uint32(item->GetItemSuffixFactor()); // SuffixFactor + data << uint32(item->GetItemRandomPropertyId());// random properties id + data << uint32(item->GetProto()->LockID); // lock id // max durability - data << (uint32) item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY); + data << uint32(item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)); // durability - data << (uint32) item->GetUInt32Value(ITEM_FIELD_DURABILITY); + data << uint32(item->GetUInt32Value(ITEM_FIELD_DURABILITY)); } else { - for (uint8 j = 0; j < 18; j++) + for (uint8 j = 0; j < 18; ++j) data << uint32(0); } } @@ -179,11 +135,15 @@ void WorldSession::SendUpdateTrade() void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) { - for (int i=0; iGetTrader(); + if (!trader) + return; + + for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i) { ItemPosCountVec traderDst; ItemPosCountVec playerDst; - bool traderCanTrade = (myItems[i] == NULL || _player->pTrader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, myItems[i], false) == EQUIP_ERR_OK); + bool traderCanTrade = (myItems[i] == NULL || trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, myItems[i], false) == EQUIP_ERR_OK); bool playerCanTrade = (hisItems[i] == NULL || _player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, hisItems[i], false) == EQUIP_ERR_OK); if (traderCanTrade && playerCanTrade) { @@ -196,25 +156,25 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) sLog.outDebug("partner storing: %u",myItems[i]->GetGUIDLow()); if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", - _player->GetName(),_player->GetSession()->GetAccountId(), - myItems[i]->GetProto()->Name1,myItems[i]->GetEntry(),myItems[i]->GetCount(), - _player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId()); + sLog.outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", + _player->GetName(), _player->GetSession()->GetAccountId(), + myItems[i]->GetProto()->Name1, myItems[i]->GetEntry(), myItems[i]->GetCount(), + trader->GetName(), trader->GetSession()->GetAccountId()); } // store - _player->pTrader->MoveItemToInventory(traderDst, myItems[i], true, true); + trader->MoveItemToInventory(traderDst, myItems[i], true, true); } if (hisItems[i]) { // logging sLog.outDebug("player storing: %u",hisItems[i]->GetGUIDLow()); - if (_player->pTrader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) + if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(_player->pTrader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", - _player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId(), - hisItems[i]->GetProto()->Name1,hisItems[i]->GetEntry(),hisItems[i]->GetCount(), - _player->GetName(),_player->GetSession()->GetAccountId()); + sLog.outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", + trader->GetName(), trader->GetSession()->GetAccountId(), + hisItems[i]->GetProto()->Name1, hisItems[i]->GetEntry(), hisItems[i]->GetCount(), + _player->GetName(), _player->GetSession()->GetAccountId()); } // store @@ -239,8 +199,8 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) { if (!playerCanTrade) sLog.outError("player can't store item: %u",hisItems[i]->GetGUIDLow()); - if (_player->pTrader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK) - _player->pTrader->MoveItemToInventory(traderDst, hisItems[i], true, true); + if (trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK) + trader->MoveItemToInventory(traderDst, hisItems[i], true, true); else sLog.outError("trader can't take item back: %u",hisItems[i]->GetGUIDLow()); } @@ -250,135 +210,231 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) //============================================================== +static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item **myItems, Item **hisItems) +{ + myTrade->SetInAcceptProcess(true); + hisTrade->SetInAcceptProcess(true); + + // store items in local list and set 'in-trade' flag + for(uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i) + { + if (Item* item = myTrade->GetItem(TradeSlots(i))) + { + DEBUG_LOG("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); + //Can return NULL + myItems[i] = item; + myItems[i]->SetInTrade(); + } + + if (Item* item = hisTrade->GetItem(TradeSlots(i))) + { + DEBUG_LOG("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); + hisItems[i] = item; + hisItems[i]->SetInTrade(); + } + } +} + +static void clearAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade) +{ + myTrade->SetInAcceptProcess(false); + hisTrade->SetInAcceptProcess(false); +} + +static void clearAcceptTradeMode(Item **myItems, Item **hisItems) +{ + // clear 'in-trade' flag + for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i) + { + if (myItems[i]) + myItems[i]->SetInTrade(false); + if (hisItems[i]) + hisItems[i]->SetInTrade(false); + } +} + void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) { - Item *myItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL }; - Item *hisItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL }; - bool myCanCompleteTrade=true,hisCanCompleteTrade=true; - - if (!GetPlayer()->pTrader) + TradeData* my_trade = _player->m_trade; + if (!my_trade) return; + Player* trader = my_trade->GetTrader(); + + TradeData* his_trade = trader->m_trade; + if (!his_trade) + return; + + Item *myItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL }; + Item *hisItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL }; + bool myCanCompleteTrade = true, hisCanCompleteTrade = true; + + // set before checks for propertly undo at problems (it already set in to client) + my_trade->SetAccepted(true); + // not accept case incorrect money amount - if (_player->tradeGold > _player->GetMoney()) + if (my_trade->GetMoney() > _player->GetMoney()) { SendNotification(LANG_NOT_ENOUGH_GOLD); - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - _player->acceptTrade = false; + my_trade->SetAccepted(false, true); return; } // not accept case incorrect money amount - if (_player->pTrader->tradeGold > _player->pTrader->GetMoney()) + if (his_trade->GetMoney() > trader->GetMoney()) { - _player->pTrader->GetSession()->SendNotification(LANG_NOT_ENOUGH_GOLD); - SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - _player->pTrader->acceptTrade = false; + trader->GetSession()->SendNotification(LANG_NOT_ENOUGH_GOLD); + his_trade->SetAccepted(false, true); return; } // not accept if some items now can't be trade (cheating) - for (int i=0; itradeItems[i] != 0) + if (Item* item = my_trade->GetItem(TradeSlots(i))) { - if (Item* item =_player->GetItemByGuid(_player->tradeItems[i])) + if (!item->CanBeTraded()) { - if (!item->CanBeTraded()) - { - SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); - return; - } + SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); + return; } } - if (_player->pTrader->tradeItems[i] != 0) + + if (Item* item = his_trade->GetItem(TradeSlots(i))) { - if (Item* item =_player->pTrader->GetItemByGuid(_player->pTrader->tradeItems[i])) + if (!item->CanBeTraded()) { - if (!item->CanBeTraded()) - { - SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); - return; - } + SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); + return; } } } - _player->acceptTrade = true; - if (_player->pTrader->acceptTrade) + if (his_trade->IsAccepted()) { - // inform partner client - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT); + setAcceptTradeMode(my_trade, his_trade, myItems, hisItems); - // store items in local list and set 'in-trade' flag - for (int i=0; iGetSpell()) { - if (_player->tradeItems[i] != 0) + SpellEntry const* spellEntry = sSpellStore.LookupEntry(my_spell_id); + Item* castItem = my_trade->GetSpellCastItem(); + + if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) || + my_trade->HasSpellCastItem() && !castItem) { - //Can return NULL - myItems[i] = _player->GetItemByGuid(_player->tradeItems[i]); - if (myItems[i]) - { - myItems[i]->SetInTrade(); - sLog.outDebug("Player trade item bag: %u slot: %u", myItems[i]->GetBagSlot(), myItems[i]->GetSlot()); - } + clearAcceptTradeMode(my_trade, his_trade); + clearAcceptTradeMode(myItems, hisItems); + + my_trade->SetSpell(0); + return; } - if (_player->pTrader->tradeItems[i] != 0) + + my_spell = new Spell(_player, spellEntry, true); + my_spell->m_CastItem = castItem; + my_targets.setTradeItemTarget(_player); + my_spell->m_targets = my_targets; + + SpellCastResult res = my_spell->CheckCast(true); + if (res != SPELL_CAST_OK) { - //Can return NULL - hisItems[i]=_player->pTrader->GetItemByGuid(_player->pTrader->tradeItems[i]); - if (hisItems[i]) - { - hisItems[i]->SetInTrade(); - sLog.outDebug("Player trade item bag: %u slot: %u", hisItems[i]->GetBagSlot(), hisItems[i]->GetSlot()); - } + my_spell->SendCastResult(res); + + clearAcceptTradeMode(my_trade, his_trade); + clearAcceptTradeMode(myItems, hisItems); + + delete my_spell; + my_trade->SetSpell(0); + return; } } + // not accept if spell can't be casted now (cheating) + if (uint32 his_spell_id = his_trade->GetSpell()) + { + SpellEntry const* spellEntry = sSpellStore.LookupEntry(his_spell_id); + Item* castItem = his_trade->GetSpellCastItem(); + + if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || his_trade->HasSpellCastItem() && !castItem) + { + delete my_spell; + his_trade->SetSpell(0); + + clearAcceptTradeMode(my_trade, his_trade); + clearAcceptTradeMode(myItems, hisItems); + return; + } + + his_spell = new Spell(trader, spellEntry, true); + his_spell->m_CastItem = castItem; + his_targets.setTradeItemTarget(trader); + his_spell->m_targets = his_targets; + + SpellCastResult res = his_spell->CheckCast(true); + if (res != SPELL_CAST_OK) + { + his_spell->SendCastResult(res); + + clearAcceptTradeMode(my_trade, his_trade); + clearAcceptTradeMode(myItems, hisItems); + + delete my_spell; + delete his_spell; + + his_trade->SetSpell(0); + return; + } + } + + // inform partner client + trader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT); + // test if item will fit in each inventory - hisCanCompleteTrade = (_player->pTrader->CanStoreItems(myItems,TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); - myCanCompleteTrade = (_player->CanStoreItems(hisItems,TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); + hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); + myCanCompleteTrade = (_player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); - // clear 'in-trade' flag - for (int i=0; iSetInTrade(false); - if (hisItems[i]) hisItems[i]->SetInTrade(false); - } + clearAcceptTradeMode(myItems, hisItems); // in case of missing space report error if (!myCanCompleteTrade) { + clearAcceptTradeMode(my_trade, his_trade); + SendNotification(LANG_NOT_FREE_TRADE_SLOTS); - GetPlayer()->pTrader->GetSession()->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); - SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); + trader->GetSession()->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); + my_trade->SetAccepted(false); + his_trade->SetAccepted(false); return; } else if (!hisCanCompleteTrade) { + clearAcceptTradeMode(my_trade, his_trade); + SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); - GetPlayer()->pTrader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS); - SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); + trader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS); + my_trade->SetAccepted(false); + his_trade->SetAccepted(false); return; } // execute trade: 1. remove - for (int i=0; iSetUInt64Value(ITEM_FIELD_GIFTCREATOR, _player->GetGUID()); - iPtr = _player->GetItemByGuid(_player->tradeItems[i]); - _player->MoveItemFromInventory(iPtr->GetBagSlot(), iPtr->GetSlot(), true); + _player->MoveItemFromInventory(myItems[i]->GetBagSlot(), myItems[i]->GetSlot(), true); } if (hisItems[i]) { - hisItems[i]->SetUInt64Value(ITEM_FIELD_GIFTCREATOR,_player->pTrader->GetGUID()); - iPtr = _player->pTrader->GetItemByGuid(_player->pTrader->tradeItems[i]); - _player->pTrader->MoveItemFromInventory(iPtr->GetBagSlot(), iPtr->GetSlot(), true); + hisItems[i]->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, trader->GetGUID()); + trader->MoveItemFromInventory(hisItems[i]->GetBagSlot(), hisItems[i]->GetSlot(), true); } } @@ -388,72 +444,80 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // logging money if (sWorld.getConfig(CONFIG_GM_LOG_TRADE)) { - if (_player->GetSession()->GetSecurity() > SEC_PLAYER && _player->tradeGold > 0) + if (_player->GetSession()->GetSecurity() > SEC_PLAYER && my_trade->GetMoney() > 0) { sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", - _player->GetName(),_player->GetSession()->GetAccountId(), - _player->tradeGold, - _player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId()); + _player->GetName(), _player->GetSession()->GetAccountId(), + my_trade->GetMoney(), + trader->GetName(), trader->GetSession()->GetAccountId()); } - if (_player->pTrader->GetSession()->GetSecurity() > SEC_PLAYER && _player->pTrader->tradeGold > 0) + if (trader->GetSession()->GetSecurity() > SEC_PLAYER && his_trade->GetMoney() > 0) { - sLog.outCommand(_player->pTrader->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", - _player->pTrader->GetName(),_player->pTrader->GetSession()->GetAccountId(), - _player->pTrader->tradeGold, - _player->GetName(),_player->GetSession()->GetAccountId()); + sLog.outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + trader->GetName(), trader->GetSession()->GetAccountId(), + his_trade->GetMoney(), + _player->GetName(), _player->GetSession()->GetAccountId()); } } // update money - _player->ModifyMoney(-int32(_player->tradeGold)); - _player->ModifyMoney(_player->pTrader->tradeGold); - _player->pTrader->ModifyMoney(-int32(_player->pTrader->tradeGold)); - _player->pTrader->ModifyMoney(_player->tradeGold); + _player->ModifyMoney(-int32(my_trade->GetMoney())); + _player->ModifyMoney(his_trade->GetMoney()); + trader->ModifyMoney(-int32(his_trade->GetMoney())); + trader->ModifyMoney(my_trade->GetMoney()); - _player->ClearTrade(); - _player->pTrader->ClearTrade(); + if (my_spell) + my_spell->prepare(&my_targets); + + if (his_spell) + his_spell->prepare(&his_targets); + + // cleanup + clearAcceptTradeMode(my_trade, his_trade); + delete _player->m_trade; + _player->m_trade = NULL; + delete trader->m_trade; + trader->m_trade = NULL; // desynchronized with the other saves here (SaveInventoryAndGoldToDB() not have own transaction guards) CharacterDatabase.BeginTransaction(); _player->SaveInventoryAndGoldToDB(); - _player->pTrader->SaveInventoryAndGoldToDB(); + trader->SaveInventoryAndGoldToDB(); CharacterDatabase.CommitTransaction(); - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_COMPLETE); + trader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_COMPLETE); SendTradeStatus(TRADE_STATUS_TRADE_COMPLETE); - - _player->pTrader->pTrader = NULL; - _player->pTrader = NULL; } else { - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT); + trader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT); } } void WorldSession::HandleUnacceptTradeOpcode(WorldPacket& /*recvPacket*/) { - if (!GetPlayer()->pTrader) + TradeData* my_trade = _player->GetTradeData(); + if (!my_trade) return; - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); - _player->acceptTrade = false; + my_trade->SetAccepted(false, true); } void WorldSession::HandleBeginTradeOpcode(WorldPacket& /*recvPacket*/) { - if (!_player->pTrader) + TradeData* my_trade = _player->m_trade; + if (!my_trade) return; - _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_OPEN_WINDOW); - _player->pTrader->ClearTrade(); - + my_trade->GetTrader()->GetSession()->SendTradeStatus(TRADE_STATUS_OPEN_WINDOW); SendTradeStatus(TRADE_STATUS_OPEN_WINDOW); - _player->ClearTrade(); } void WorldSession::SendCancelTrade() { + if (m_playerRecentlyLogout) + return; + SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); } @@ -466,7 +530,7 @@ void WorldSession::HandleCancelTradeOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) { - if (GetPlayer()->pTrader) + if (GetPlayer()->m_trade) return; uint64 ID; @@ -511,7 +575,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther == GetPlayer() || pOther->pTrader) + if (pOther == GetPlayer() || pOther->m_trade) { SendTradeStatus(TRADE_STATUS_BUSY); return; @@ -566,35 +630,30 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) } // OK start trade - _player->pTrader = pOther; - pOther->pTrader =_player; + _player->m_trade = new TradeData(_player, pOther); + pOther->m_trade = new TradeData(pOther, _player); WorldPacket data(SMSG_TRADE_STATUS, 12); - data << (uint32) TRADE_STATUS_BEGIN_TRADE; - data << (uint64)_player->GetGUID(); - _player->pTrader->GetSession()->SendPacket(&data); + data << uint32(TRADE_STATUS_BEGIN_TRADE); + data << uint64(_player->GetGUID()); + pOther->GetSession()->SendPacket(&data); } void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket) { - if (!_player->pTrader) - return; - uint32 gold; - recvPacket >> gold; - // gold can be incorrect, but this is checked at trade finished. - _player->tradeGold = gold; + TradeData* my_trade = _player->GetTradeData(); + if (!my_trade) + return; - _player->pTrader->GetSession()->SendUpdateTrade(); + // gold can be incorrect, but this is checked at trade finished. + my_trade->SetMoney(gold); } void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) { - if (!_player->pTrader) - return; - // send update uint8 tradeSlot; uint8 bag; @@ -604,6 +663,10 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) recvPacket >> bag; recvPacket >> slot; + TradeData* my_trade = _player->GetTradeData(); + if (!my_trade) + return; + // invalid slot number if (tradeSlot >= TRADE_SLOT_COUNT) { @@ -612,7 +675,7 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) } // check cheating, can't fail with correct client operations - Item* item = _player->GetItemByPos(bag,slot); + Item* item = _player->GetItemByPos(bag, slot); if (!item || (tradeSlot != TRADE_SLOT_NONTRADED && !item->CanBeTraded())) { SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); @@ -622,35 +685,29 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) uint64 iGUID = item->GetGUID(); // prevent place single item into many trade slots using cheating and client bugs - for (int i = 0; i < TRADE_SLOT_COUNT; ++i) + if (my_trade->HasItem(iGUID)) { - if (_player->tradeItems[i] == iGUID) - { - // cheating attempt - SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); - return; - } + // cheating attempt + SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); + return; } - _player->tradeItems[tradeSlot] = iGUID; - - _player->pTrader->GetSession()->SendUpdateTrade(); + my_trade->SetItem(TradeSlots(tradeSlot), item); } void WorldSession::HandleClearTradeItemOpcode(WorldPacket& recvPacket) { - if (!_player->pTrader) - return; - uint8 tradeSlot; recvPacket >> tradeSlot; + TradeData* my_trade = _player->m_trade; + if (!my_trade) + return; + // invalid slot number if (tradeSlot >= TRADE_SLOT_COUNT) return; - _player->tradeItems[tradeSlot] = 0; - - _player->pTrader->GetSession()->SendUpdateTrade(); + my_trade->SetItem(TradeSlots(tradeSlot), NULL); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0b67199b4ea..8a45aa9e910 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -361,7 +361,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x14A*/ { "SMSG_ATTACKERSTATEUPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x14B*/ { "SMSG_BATTLEFIELD_PORT_DENIED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x14C*/ { "SMSG_DAMAGE_DONE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x14D*/ { "SMSG_DAMAGE_TAKEN_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x14D*/ { "SMSG_UNIT_SPELLCAST_START", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x14E*/ { "SMSG_CANCEL_COMBAT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x14F*/ { "SMSG_SPELLBREAKLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x150*/ { "SMSG_SPELLHEALLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -570,7 +570,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x21B*/ { "SMSG_GMTICKET_SYSTEMSTATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x21C*/ { "CMSG_SPIRIT_HEALER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleSpiritHealerActivateOpcode}, /*0x21D*/ { "CMSG_SET_STAT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x21E*/ { "SMSG_SET_REST_START_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x21E*/ { "SMSG_QUEST_FORCE_REMOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x21F*/ { "CMSG_SKILL_BUY_STEP", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x220*/ { "CMSG_SKILL_BUY_RANK", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x221*/ { "CMSG_XP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, @@ -1148,8 +1148,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x45D*/ { "CMSG_FORCE_PITCH_RATE_CHANGE_ACK", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x45E*/ { "SMSG_SPLINE_SET_PITCH_RATE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x45F*/ { "SMSG_MOVE_ABANDON_TRANSPORT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x460*/ { "MSG_MOVE_ABANDON_TRANSPORT", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x461*/ { "CMSG_MOVE_ABANDON_TRANSPORT_ACK", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x460*/ { "SMSG_CALENDAR_UPDATE_INVITE_LIST", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x461*/ { "SMSG_CALENDAR_UPDATE_INVITE_LIST2", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x462*/ { "CMSG_UPDATE_MISSILE_TRAJECTORY", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x463*/ { "SMSG_UPDATE_ACCOUNT_DATA_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x464*/ { "SMSG_TRIGGER_MOVIE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -1165,7 +1165,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x46E*/ { "CMSG_COMPLETE_ACHIEVEMENT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x46F*/ { "SMSG_QUESTUPDATE_ADD_PVP_KILL", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x470*/ { "CMSG_SET_CRITERIA_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x471*/ { "SMSG_GROUP_SWAP_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x471*/ { "SMSG_CALENDAR_UPDATE_INVITE_LIST3", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x472*/ { "CMSG_UNITANIMTIER_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x473*/ { "CMSG_CHAR_CUSTOMIZE", STATUS_AUTHED, &WorldSession::HandleCharCustomize }, /*0x474*/ { "SMSG_CHAR_CUSTOMIZE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, @@ -1258,13 +1258,13 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4CB*/ { "UMSG_UNKNOWN_1227", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4CC*/ { "UMSG_UNKNOWN_1228", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4CD*/ { "SMSG_MULTIPLE_PACKETS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4CE*/ { "SMSG_UNKNOWN_1230", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4CF*/ { "CMSG_UNKNOWN_1231_ACK", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4D0*/ { "SMSG_UNKNOWN_1232", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4D1*/ { "CMSG_UNKNOWN_1233_ACK", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4D2*/ { "SMSG_UNKNOWN_1234", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4D3*/ { "SMSG_UNKNOWN_1235", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4D4*/ { "SMSG_UNKNOWN_1236", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4CE*/ { "SMSG_FORCE_UNK1_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4CF*/ { "CMSG_FORCE_UNK1_SPEED_CHANGE_ACK", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4D0*/ { "SMSG_FORCE_UNK2_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4D1*/ { "CMSG_FORCE_UNK2_SPEED_CHANGE_ACK", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4D2*/ { "MSG_MOVE_UNKNOWN_1234", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4D3*/ { "SMSG_SPLINE_MOVE_UNKNOWN_1235", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4D4*/ { "SMSG_SPLINE_MOVE_UNKNOWN_1236", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4D5*/ { "CMSG_EQUIPMENT_SET_USE", STATUS_LOGGEDIN, &WorldSession::HandleEquipmentSetUse }, /*0x4D6*/ { "SMSG_EQUIPMENT_SET_USE_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4D7*/ { "UMSG_UNKNOWN_1239", STATUS_NEVER, &WorldSession::Handle_NULL }, @@ -1275,7 +1275,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4DC*/ { "UMSG_UNKNOWN_1244", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4DD*/ { "UMSG_UNKNOWN_1245", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4DE*/ { "SMSG_BATTLEFIELD_MGR_ENTRY_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONS", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4E0*/ { "SMSG_BATTLEFIELD_MGR_ENTERED", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4E1*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_NULL }, diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4ae6931c3f5..44a06ddb8d3 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1343,7 +1343,11 @@ enum Opcodes SMSG_UNKNOWN_1304 = 0x518, // something with player movement (move event 58?), speed packet UMSG_UNKNOWN_1305 = 0x519, // not found UMSG_UNKNOWN_1306 = 0x51A, // not found - NUM_MSG_TYPES = 0x51B + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B, // lua: CommentatorSetSkirmishMatchmakingMode/CommentatorRequestSkirmishQueueData/CommentatorRequestSkirmishMode/CommentatorStartSkirmishMatch + SMSG_UNKNOWN_1308 = 0x51C, // event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST, CGCommentator::QueueNode + SMSG_UNKNOWN_1309 = 0x51D, // event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST + SMSG_UNKNOWN_1310 = 0x51E, // some compressed packet? + NUM_MSG_TYPES = 0x51F }; /// Player state diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp index 7c6c4020336..e66bff0b504 100644 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ b/src/server/game/Server/Protocol/WorldLog.cpp @@ -23,14 +23,9 @@ */ #include "WorldLog.h" -#include "Policies/SingletonImp.h" -#include "Config/ConfigEnv.h" +#include "ConfigEnv.h" #include "Log.h" -#define CLASS_LOCK Trinity::ClassLevelLockable -INSTANTIATE_SINGLETON_2(WorldLog, CLASS_LOCK); -INSTANTIATE_CLASS_MUTEX(WorldLog, ACE_Thread_Mutex); - WorldLog::WorldLog() : i_file(NULL) { Initialize(); @@ -67,7 +62,7 @@ void WorldLog::outTimestampLog(char const *fmt, ...) { if (LogWorld()) { - Guard guard(*this); + ACE_GUARD(ACE_Thread_Mutex, Guard, Lock); ASSERT(i_file); Log::outTimestamp(i_file); @@ -95,7 +90,7 @@ void WorldLog::outLog(char const *fmt, ...) { if (LogWorld()) { - Guard guard(*this); + ACE_GUARD(ACE_Thread_Mutex, Guard, Lock); ASSERT(i_file); va_list args; @@ -117,6 +112,3 @@ void WorldLog::outLog(char const *fmt, ...) va_end(ap2); } } - -#define sWorldLog WorldLog::Instance() - diff --git a/src/server/game/Server/Protocol/WorldLog.h b/src/server/game/Server/Protocol/WorldLog.h index 4ee9bb178ec..fd228ce4559 100644 --- a/src/server/game/Server/Protocol/WorldLog.h +++ b/src/server/game/Server/Protocol/WorldLog.h @@ -26,19 +26,19 @@ #define TRINITY_WORLDLOG_H #include "Common.h" -#include "Policies/Singleton.h" +#include "ace/Singleton.h" #include "Errors.h" #include /// %Log packets to a file -class WorldLog : public Trinity::Singleton > +class WorldLog { - friend class Trinity::OperatorNew; + friend class ACE_Singleton; WorldLog(); WorldLog(const WorldLog &); WorldLog& operator=(const WorldLog &); - typedef Trinity::ClassLevelLockable::Lock Guard; + ACE_Thread_Mutex Lock; /// Close the file in destructor ~WorldLog(); @@ -57,7 +57,7 @@ class WorldLog : public Trinity::Singleton::instance()) #endif /// @} diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index bc737717840..6de0cb27381 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -24,7 +24,7 @@ #include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "Opcodes.h" #include "WorldPacket.h" @@ -40,7 +40,7 @@ #include "OutdoorPvPMgr.h" #include "MapManager.h" #include "SocialMgr.h" -#include "zlib/zlib.h" +#include "zlib.h" #include "ScriptMgr.h" #include "LFGMgr.h" @@ -82,7 +82,6 @@ WorldSession::~WorldSession() delete packet; LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); - CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = %u;", GetAccountId()); } void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index c17f3e3f3e6..dbcc94f071b 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -205,12 +205,12 @@ class WorldSession void SendBattlegGroundList(uint64 guid, BattleGroundTypeId bgTypeId); - void SendTradeStatus(uint32 status); + void SendTradeStatus(TradeStatus status); void SendCancelTrade(); void SendStablePet(uint64 guid); void SendPetitionQueryOpcode(uint64 petitionguid); - void SendUpdateTrade(); + void SendUpdateTrade(bool trader_data = true); //pet void SendPetNameQuery(uint64 guid, uint32 petnumber); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index c07b369d0b9..f7b128fb761 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -38,9 +38,9 @@ #include "SharedDefines.h" #include "ByteBuffer.h" #include "Opcodes.h" -#include "Database/DatabaseEnv.h" -#include "Auth/BigNumber.h" -#include "Auth/Sha1.h" +#include "DatabaseEnv.h" +#include "BigNumber.h" +#include "SHA1.h" #include "WorldSession.h" #include "WorldSocketMgr.h" #include "Log.h" @@ -120,8 +120,7 @@ m_LastPingTime(ACE_Time_Value::zero) WorldSocket::~WorldSocket (void) { - if (m_RecvWPct) - delete m_RecvWPct; + delete m_RecvWPct; if (m_OutBuffer) m_OutBuffer->release(); @@ -769,7 +768,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // NOTE: ATM the socket is singlethread, have this in mind ... uint8 digest[20]; uint32 clientSeed; - uint32 unk2, unk3; + uint32 unk2, unk3, unk5, unk6, unk7; uint64 unk4; uint32 BuiltNumberClient; uint32 id, security; @@ -798,6 +797,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) recvPacket >> account; recvPacket >> unk3; recvPacket >> clientSeed; + recvPacket >> unk5 >> unk6 >> unk7; recvPacket >> unk4; recvPacket.read (digest, 20); diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 70654274215..d07e9a3f2e4 100644 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -43,7 +43,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "Common.h" -#include "Auth/AuthCrypt.h" +#include "AuthCrypt.h" class ACE_Message_Block; class WorldPacket; diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index c23d08e6f78..6ccb30b64ef 100644 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -42,8 +42,8 @@ #include "Log.h" #include "Common.h" -#include "Config/ConfigEnv.h" -#include "Database/DatabaseEnv.h" +#include "ConfigEnv.h" +#include "DatabaseEnv.h" #include "WorldSocket.h" /** @@ -84,8 +84,7 @@ class ReactorRunnable : protected ACE_Task_Base Stop(); Wait(); - if (m_Reactor) - delete m_Reactor; + delete m_Reactor; } void Stop() @@ -220,11 +219,8 @@ WorldSocketMgr::WorldSocketMgr() : WorldSocketMgr::~WorldSocketMgr() { - if (m_NetThreads) - delete [] m_NetThreads; - - if (m_Acceptor) - delete m_Acceptor; + delete [] m_NetThreads; + delete m_Acceptor; } int diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 163f7a2bf7e..fb34cff150c 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -18,10 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "ProgressBar.h" -#include "Policies/SingletonImp.h" #include "World.h" #include "Util.h" #include "SkillDiscovery.h" diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index cc50d3683f4..982556c0557 100644 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -19,7 +19,7 @@ */ #include "SkillExtraItems.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "Log.h" #include "ProgressBar.h" #include "Player.h" diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 8b21062e371..a3a037ae5a8 100644 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -344,8 +344,8 @@ enum AuraType SPELL_AURA_297 = 297, SPELL_AURA_298 = 298, SPELL_AURA_299 = 299, - SPELL_AURA_300 = 300, - SPELL_AURA_301 = 301, + SPELL_AURA_SHARE_DAMAGE_PCT = 300, + SPELL_AURA_SCHOOL_HEAL_ABSORB = 301, SPELL_AURA_302 = 302, SPELL_AURA_303 = 303, SPELL_AURA_304 = 304, @@ -354,12 +354,12 @@ enum AuraType SPELL_AURA_307 = 307, SPELL_AURA_308 = 308, SPELL_AURA_309 = 309, - SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS = 310, + SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, SPELL_AURA_311 = 311, SPELL_AURA_312 = 312, SPELL_AURA_313 = 313, - SPELL_AURA_314 = 314, - SPELL_AURA_315 = 315, + SPELL_AURA_PREVENT_RESSURECTION = 314, + SPELL_AURA_UNDERWATER_WALKING = 315, SPELL_AURA_PERIODIC_HASTE = 316, TOTAL_AURAS = 317 }; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 6a3e52d9646..7a70155a23e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -271,7 +271,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //214 Tamed Pet Passive &AuraEffect::HandleArenaPreparation, //215 SPELL_AURA_ARENA_PREPARATION &AuraEffect::HandleModCastingSpeed, //216 SPELL_AURA_HASTE_SPELLS - &AuraEffect::HandleUnused, //217 unused (3.2.0) + &AuraEffect::HandleNULL, //217 69106 - killing spree helper - unknown use &AuraEffect::HandleAuraModRangedHaste, //218 SPELL_AURA_HASTE_RANGED &AuraEffect::HandleModManaRegen, //219 SPELL_AURA_MOD_MANA_REGEN_FROM_STAT &AuraEffect::HandleModRatingFromStat, //220 SPELL_AURA_MOD_RATING_FROM_STAT @@ -347,36 +347,36 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT &AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest &AuraEffect::HandleNULL, //292 call stabled pet - &AuraEffect::HandleNULL, //293 2 test spells + &AuraEffect::HandleNULL, //293 auras which probably add set of abilities to their target based on it's miscvalue &AuraEffect::HandleNoImmediateEffect, //294 SPELL_AURA_PREVENT_REGENERATE_POWER implemented in Player::Regenerate(Powers power) - &AuraEffect::HandleNULL, //296 2 spells - &AuraEffect::HandleNULL, //297 1 spell (counter spell school?) - &AuraEffect::HandleNULL, //298 unused + &AuraEffect::HandleNULL, //295 0 spells in 3.3.5 + &AuraEffect::HandleNULL, //296 6 spells, something vehicle or character display related + &AuraEffect::HandleNULL, //297 Spirit Burst spells + &AuraEffect::HandleNULL, //298 70569 - Strangulating, maybe prevents talk or cast &AuraEffect::HandleNULL, //299 unused - &AuraEffect::HandleNULL, //300 3 spells (share damage?) - &AuraEffect::HandleNULL, //301 5 spells - &AuraEffect::HandleNULL, //302 unused - &AuraEffect::HandleNULL, //303 17 spells - &AuraEffect::HandleNULL, //304 2 spells (alcohol effect?) + &AuraEffect::HandleNoImmediateEffect, //300 SPELL_AURA_SHARE_DAMAGE_PCT implemented in Unit::DealDamage + &AuraEffect::HandleNoImmediateEffect, //301 SPELL_AURA_SCHOOL_HEAL_ABSORB implemented in Unit::CalcHealAbsorb + &AuraEffect::HandleNULL, //302 0 spells in 3.3.5 + &AuraEffect::HandleNULL, //303 SPELL_AURA_MOD_DMG_VERSUS_AURASTATE_PCT? - 22 and 19 look like serverside aurastates (22 - dark, gas cloud, 19 light, ooze) + &AuraEffect::HandleUnused, //304 clientside &AuraEffect::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED - &AuraEffect::HandleNULL, //306 1 spell - &AuraEffect::HandleNULL, //307 absorb healing? + &AuraEffect::HandleNULL, //306 0 spells in 3.3.5 + &AuraEffect::HandleNULL, //307 0 spells in 3.3.5 &AuraEffect::HandleNULL, //308 new aura for hunter traps - &AuraEffect::HandleNULL, //309 absorb healing? - &AuraEffect::HandleNoImmediateEffect, //310 5 spells SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS implemented in Unit::MeleeDamageBonus - &AuraEffect::HandleNULL, //311 0 spells in 3.3 - &AuraEffect::HandleNULL, //312 0 spells in 3.3 - &AuraEffect::HandleNULL, //313 0 spells in 3.3 - &AuraEffect::HandleNULL, //314 1 test spell (reduce duration of silince/magic) - &AuraEffect::HandleNULL, //315 underwater walking + &AuraEffect::HandleNULL, //309 0 spells in 3.3.5 + &AuraEffect::HandleNoImmediateEffect, //310 SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE implemented in Spell::CalculateDamageDone + &AuraEffect::HandleNULL, //311 0 spells in 3.3.5 + &AuraEffect::HandleNULL, //312 0 spells in 3.3.5 + &AuraEffect::HandleNULL, //313 0 spells in 3.3.5 + &AuraEffect::HandleNoImmediateEffect, //314 SPELL_AURA_PREVENT_RESSURECTION todo + &AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo &AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic - &AuraEffect::HandleNULL }; AuraEffect::AuraEffect(Aura * base, uint8 effIndex, int32 *baseAmount, Unit * caster) : m_base(base), m_spellProto(base->GetSpellProto()), m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex), m_isPeriodic(false), m_canBeRecalculated(true), - m_baseAmount (baseAmount ? *baseAmount : m_spellProto->EffectBasePoints[m_effIndex] + 1) + m_baseAmount (baseAmount ? *baseAmount : m_spellProto->EffectBasePoints[m_effIndex]) { CalculatePeriodic(caster, true); @@ -387,8 +387,7 @@ AuraEffect::AuraEffect(Aura * base, uint8 effIndex, int32 *baseAmount, Unit * ca AuraEffect::~AuraEffect() { - if (m_spellmod) - delete m_spellmod; + delete m_spellmod; } void AuraEffect::GetTargetList(std::list & targetList) const @@ -406,10 +405,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster) { int32 amount; // default amount calculation - if (caster) - amount = caster->CalculateSpellDamage(NULL, m_spellProto, m_effIndex, &m_baseAmount); - else - amount = m_baseAmount + 1; + amount = SpellMgr::CalculateSpellEffectAmount(m_spellProto, m_effIndex, caster, &m_baseAmount, NULL); // check item enchant aura cast if (!amount && caster) @@ -483,16 +479,32 @@ int32 AuraEffect::CalculateAmount(Unit * caster) // Ice Barrier if (GetSpellProto()->SpellFamilyFlags[1] & 0x1 && GetSpellProto()->SpellFamilyFlags[2] & 0x8) { - // +80.67% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8067f; + // +80.68% from sp bonus + DoneActualBenefit += caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f; + // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) + // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage + if (Player* modOwner = caster->GetSpellModOwner()) + modOwner->ApplySpellMod(GetSpellProto()->Id, SPELLMOD_ALL_EFFECTS, DoneActualBenefit); + } + // Fire Ward + else if(GetSpellProto()->SpellFamilyFlags[0] & 0x8 && GetSpellProto()->SpellFamilyFlags[2] & 0x8) + { + // +80.68% from sp bonus + DoneActualBenefit += caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f; + } + // Frost Ward + else if(GetSpellProto()->SpellFamilyFlags[0] & 0x100 && GetSpellProto()->SpellFamilyFlags[2] & 0x8) + { + // +80.68% from sp bonus + DoneActualBenefit += caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f; } break; case SPELLFAMILY_WARLOCK: // Shadow Ward - if (m_spellProto->SpellFamilyFlags[2]& 0x40) + if (m_spellProto->SpellFamilyFlags[2] & 0x40) { - // +30% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f; + // +80.68% from sp bonus + DoneActualBenefit += caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.8068f; } break; case SPELLFAMILY_PRIEST: @@ -607,7 +619,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster) if (spellmgr.GetSpellRank(m_spellProto->Id) >= 9) { if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellProto, caster)) - amount += int32(amount * m_spellProto->CalculateSimpleValue(2) / 100.0f); + amount += int32(amount * SpellMgr::CalculateSpellEffectAmount(m_spellProto, 2, caster) / 100.0f); } } break; @@ -718,7 +730,7 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create) case SPELL_AURA_OBS_MOD_POWER: // 3 spells have no amplitude set if (!m_amplitude) - m_amplitude = 1 * IN_MILISECONDS; + m_amplitude = 1 * IN_MILLISECONDS; case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_PERIODIC_ENERGIZE: @@ -747,7 +759,7 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create) { m_isPeriodic = true; m_amplitude = irand (0, 60) + 30; - m_amplitude *= IN_MILISECONDS; + m_amplitude *= IN_MILLISECONDS; } break; } @@ -768,7 +780,8 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create) modOwner->ModSpellCastTime(m_spellProto, m_amplitude); } // For spells that can benefit from haste - else if (modOwner->HasAuraType(SPELL_AURA_PERIODIC_HASTE)) { + else if (modOwner->HasAuraType(SPELL_AURA_PERIODIC_HASTE)) + { const Unit::AuraEffectList &effList = modOwner->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HASTE); for (Unit::AuraEffectList::const_iterator itr = effList.begin(), end = effList.end(); itr != end; ++itr) { @@ -1032,7 +1045,7 @@ void AuraEffect::UpdatePeriodic(Unit * caster) if (GetId() == 7057) { m_amplitude = irand (0 , 60) + 30; - m_amplitude *= IN_MILISECONDS; + m_amplitude *= IN_MILLISECONDS; } break; case SPELL_AURA_PERIODIC_TRIGGER_SPELL: @@ -1296,10 +1309,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const bool crit = IsPeriodicTickCrit(target, caster); if (crit) - { damage = caster->SpellCriticalDamageBonus(m_spellProto, damage, target); - damage -= target->GetSpellCritDamageReduction(damage); - } // Reduce damage from resilience for players and pets only. // As of patch 3.3 pets inherit 100% of master resilience. @@ -1308,7 +1318,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const { if (crit) damage -= modOwner->GetSpellCritDamageReduction(damage); - damage -= modOwner->GetSpellDamageReduction(damage); + damage -= modOwner->GetSpellDamageReduction(damage); } caster->CalcAbsorbResist(target, GetSpellSchoolMask(GetSpellProto()), DOT, damage, &absorb, &resist, m_spellProto); @@ -1367,10 +1377,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const bool crit = IsPeriodicTickCrit(target, caster); if (crit) - { damage = caster->SpellCriticalDamageBonus(m_spellProto, damage, target); - damage -= target->GetSpellCritDamageReduction(damage); - } //Calculate armor mitigation if it is a physical spell if (GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_NORMAL) @@ -1470,7 +1477,37 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const int32 damage = m_amount > 0 ? m_amount : 0; if (GetAuraType() == SPELL_AURA_OBS_MOD_HEALTH) + { + // Taken mods + float TakenTotalMod = 1.0f; + + // Tenacity increase healing % taken + if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0)) + TakenTotalMod *= (Tenacity->GetAmount() + 100.0f) / 100.0f; + + // Healing taken percent + float minval = target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + if (minval) + TakenTotalMod *= (100.0f + minval) / 100.0f; + + float maxval = target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + if (maxval) + TakenTotalMod *= (100.0f + maxval) / 100.0f; + + // Healing over time taken percent + float minval_hot = target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); + if (minval_hot) + TakenTotalMod *= (100.0f + minval_hot) / 100.0f; + + float maxval_hot = target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); + if (maxval_hot) + TakenTotalMod *= (100.0f + maxval_hot) / 100.0f; + + TakenTotalMod = TakenTotalMod > 0.0f ? TakenTotalMod : 0.0f; + damage = uint32(target->GetMaxHealth() * damage / 100); + damage = uint32(damage * TakenTotalMod); + } else { // Wild Growth = amount + (6 - 2*doneTicks) * ticks* amount / 100 @@ -1811,13 +1848,6 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const else target->RemoveAurasDueToSpell(58670); break; - case 58600: // No fly Zone - Dalaran - if (GetTickNumber() == 10) - { - target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); - target->RemoveAurasByType(SPELL_AURA_FLY); - } - break; case 62292: // Blaze (Pool of Tar) // should we use custom damage? target->CastSpell((Unit*)NULL, m_spellProto->EffectTriggerSpell[m_effIndex], true); @@ -2473,14 +2503,14 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const } // Heart of the Wild if (HotWSpellId) - { + { // hacky, but the only way as spell family is not SPELLFAMILY_DRUID Unit::AuraEffectList const& mModTotalStatPct = target->GetAuraEffectsByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE); for (Unit::AuraEffectList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i) { // Heart of the Wild if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetMiscValue() == 3) { - int32 HotWMod = (*i)->GetSpellProto()->EffectBasePoints[1] + 1; + int32 HotWMod = (*i)->GetAmount(); target->CastCustomSpell(target, HotWSpellId, &HotWMod, NULL, NULL, true, NULL, this); break; @@ -2490,11 +2520,11 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const switch(GetMiscValue()) { case FORM_CAT: - // Savage Roar + // Savage Roar if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0 , 0x10000000, 0)) target->CastSpell(target, 62071, true); // Nurturing Instinct - if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELLFAMILY_DRUID, 2254,0)) + if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELLFAMILY_DRUID, 2254, 0)) { uint32 spellId = 0; switch (aurEff->GetId()) @@ -2524,9 +2554,9 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const target->CastCustomSpell(target, 48418, &bp, NULL, NULL, true); } // Survival of the Fittest - if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE,SPELLFAMILY_DRUID, 961, 0)) + if (AuraEffect const * aurEff = target->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DRUID, 961, 0)) { - int32 bp = 100 + aurEff->GetSpellProto()->CalculateSimpleValue(2); + int32 bp = 100 + SpellMgr::CalculateSpellEffectAmount(aurEff->GetSpellProto(), 2); target->CastCustomSpell(target, 62069, &bp, NULL, NULL, true, 0, this); } break; @@ -3093,7 +3123,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode, // for players, start regeneration after 1s (in polymorph fast regeneration case) // only if caster is Player (after patch 2.4.2) if (IS_PLAYER_GUID(GetCasterGUID())) - target->ToPlayer()->setRegenTimerCount(1*IN_MILISECONDS); + target->ToPlayer()->setRegenTimerCount(1*IN_MILLISECONDS); //dismount polymorphed target (after patch 2.4.2) if (target->IsMounted()) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index c2c99b167e0..d44e73f360f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -45,6 +45,9 @@ class AuraEffect int32 GetAmount() const { return m_amount; } void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;} + int32 GetPeriodicTimer() const { return m_periodicTimer; } + void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; } + int32 CalculateAmount(Unit * caster); void CalculatePeriodic(Unit * caster, bool create = false); void CalculateSpellMod(); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 1b75ab75473..3ebfa44492c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -77,14 +77,15 @@ AuraApplication::AuraApplication(Unit * target, Unit * caster, Aura * aura, uint else sLog.outDebug("Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); } - m_flags |= (_CheckPositive(caster) ? AFLAG_POSITIVE : AFLAG_NEGATIVE) | - (GetBase()->GetCasterGUID() == GetTarget()->GetGUID() ? AFLAG_CASTER : AFLAG_NONE); m_isNeedManyNegativeEffects = false; if (GetBase()->GetCasterGUID() == GetTarget()->GetGUID()) // caster == target - 1 negative effect is enough for aura to be negative m_isNeedManyNegativeEffects = false; else if (caster) m_isNeedManyNegativeEffects = caster->IsFriendlyTo(m_target); + + m_flags |= (_CheckPositive(caster) ? AFLAG_POSITIVE : AFLAG_NEGATIVE) | + (GetBase()->GetCasterGUID() == GetTarget()->GetGUID() ? AFLAG_CASTER : AFLAG_NONE); } void AuraApplication::_Remove() @@ -305,7 +306,7 @@ m_spellProto(spellproto), m_owner(owner), m_casterGuid(casterGUID ? casterGUID : m_procCharges(0), m_stackAmount(1), m_isRemoved(false), m_casterLevel(caster ? caster->getLevel() : m_spellProto->spellLevel) { if (m_spellProto->manaPerSecond || m_spellProto->manaPerSecondPerLevel) - m_timeCla = 1 * IN_MILISECONDS; + m_timeCla = 1 * IN_MILLISECONDS; Player* modOwner = NULL; @@ -342,8 +343,7 @@ Aura::~Aura() { // free effects memory for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i) - if (m_effects[i]) - delete m_effects[i]; + delete m_effects[i]; assert(m_applications.empty()); _DeleteRemovedApplications(); @@ -391,9 +391,17 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur assert(auraApp); ApplicationMap::iterator itr = m_applications.find(target->GetGUID()); + // TODO: Figure out why this happens. + if (itr == m_applications.end()) + { + sLog.outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!", + target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellProto()->Id); + } + else + m_applications.erase(itr); + // aura has to be already applied - assert(itr->second == auraApp); - m_applications.erase(itr); + //assert(itr->second == auraApp); m_removedApplications.push_back(auraApp); // reset cooldown state for spells @@ -412,7 +420,7 @@ void Aura::_Remove(AuraRemoveMode removeMode) assert (!m_isRemoved); m_isRemoved = true; ApplicationMap::iterator appItr = m_applications.begin(); - while (!m_applications.empty()) + for (appItr = m_applications.begin(); appItr != m_applications.end();) { AuraApplication * aurApp = appItr->second; Unit * target = aurApp->GetTarget(); @@ -459,8 +467,10 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) for (std::map::iterator itr = targets.begin(); itr!= targets.end();) { bool addUnit = true; - // check target immunities - if (itr->first->IsImmunedToSpell(GetSpellProto())) + // check target immunities + if (itr->first->IsImmunedToSpell(GetSpellProto()) + // check area target requirements + || (itr->first != GetOwner() && !CheckAreaTarget(itr->first))) addUnit = false; if (addUnit) @@ -532,7 +542,7 @@ void Aura::_ApplyEffectForTargets(uint8 effIndex) UnitList targetList; for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) { - if ((appIter->second->GetEffectsToApply() & (1<second->GetTarget()) && !appIter->second->HasEffect(effIndex)) + if ((appIter->second->GetEffectsToApply() & (1<second->HasEffect(effIndex)) targetList.push_back(appIter->second->GetTarget()); } @@ -632,45 +642,6 @@ void Aura::Update(uint32 diff, Unit * caster) } } -bool Aura::CheckTarget(Unit *target) -{ - // some special cases - switch(GetId()) - { - case 45828: // AV Marshal's HP/DMG auras - case 45829: - case 45830: - case 45821: - case 45822: // AV Warmaster's HP/DMG auras - case 45823: - case 45824: - case 45826: - switch(target->GetEntry()) - { - // alliance - case 14762: // Dun Baldar North Marshal - case 14763: // Dun Baldar South Marshal - case 14764: // Icewing Marshal - case 14765: // Stonehearth Marshal - case 11948: // Vandar Stormspike - // horde - case 14772: // East Frostwolf Warmaster - case 14776: // Tower Point Warmaster - case 14773: // Iceblood Warmaster - case 14777: // West Frostwolf Warmaster - case 11946: // Drek'thar - return true; - default: - return false; - break; - } - break; - default: - return true; - break; - } -} - void Aura::SetDuration(int32 duration, bool withMods) { if (withMods) @@ -691,7 +662,7 @@ void Aura::RefreshDuration() m_effects[i]->ResetPeriodic(); if (m_spellProto->manaPerSecond || m_spellProto->manaPerSecondPerLevel) - m_timeCla = 1 * IN_MILISECONDS; + m_timeCla = 1 * IN_MILLISECONDS; } void Aura::SetCharges(uint8 charges) @@ -781,33 +752,6 @@ bool Aura::CanBeSaved() const return true; } -bool Aura::HasEffectType(AuraType type) const -{ - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (m_effects[i] && m_effects[i]->GetAuraType() == type) - return true; - } - return false; -} - -void Aura::RecalculateAmountOfEffects() -{ - assert (!IsRemoved()); - Unit * caster = GetCaster(); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (m_effects[i]) - m_effects[i]->RecalculateAmount(caster); -} - -void Aura::HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply) -{ - assert (!IsRemoved()); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (m_effects[i] && !IsRemoved()) - m_effects[i]->HandleEffect(aurApp, mode, apply); -} - bool Aura::IsVisible() const { // Is this blizzlike? show totem passive auras @@ -842,6 +786,39 @@ void Aura::SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint } } +bool Aura::HasEffectType(AuraType type) const +{ + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (m_effects[i] && m_effects[i]->GetAuraType() == type) + return true; + } + return false; +} + +void Aura::RecalculateAmountOfEffects() +{ + assert (!IsRemoved()); + Unit * caster = GetCaster(); + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (m_effects[i]) + m_effects[i]->RecalculateAmount(caster); +} + +void Aura::HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply) +{ + assert (!IsRemoved()); + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (m_effects[i] && !IsRemoved()) + m_effects[i]->HandleEffect(aurApp, mode, apply); +} + +void Aura::SetNeedClientUpdateForTargets() const +{ + for (ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) + appIter->second->SetNeedClientUpdate(); +} + // trigger effects on real aura apply/remove void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, bool apply) { @@ -895,6 +872,10 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (GetStackAmount() >= 5 && !target->HasAura(33652)) target->CastSpell(target, 33652, true); break; + case 50836: //Petrifying Grip, becomes stoned + if (GetStackAmount() >= 5 && !target->HasAura(50812)) + target->CastSpell(target, 50812, true); + break; case 60970: // Heroic Fury (remove Intercept cooldown) if (target->GetTypeId() == TYPEID_PLAYER) target->ToPlayer()->RemoveSpellCooldown(20252, true); @@ -936,20 +917,17 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, // Arcane Potency if (AuraEffect const * aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, 2120, 0)) { - if (roll_chance_i(aurEff->GetAmount())) - { - uint32 spellId = 0; + uint32 spellId = 0; - switch (aurEff->GetId()) - { - case 31571: spellId = 57529; break; - case 31572: spellId = 57531; break; - default: - sLog.outError("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId()); - } - if (spellId) - caster->CastSpell(caster, spellId, true); + switch (aurEff->GetId()) + { + case 31571: spellId = 57529; break; + case 31572: spellId = 57531; break; + default: + sLog.outError("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId()); } + if (spellId) + caster->CastSpell(caster, spellId, true); } break; } @@ -1278,7 +1256,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, data << uint64(player->GetGUID()); data << uint8(0x0); // flags (0x1, 0x2) data << uint32(GetSpellProto()->Id); - data << uint32(aurEff->GetAmount()*IN_MILISECONDS); + data << uint32(aurEff->GetAmount()*IN_MILLISECONDS); player->SendDirectMessage(&data); } break; @@ -1514,10 +1492,44 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, } } -void Aura::SetNeedClientUpdateForTargets() const +bool Aura::CheckAreaTarget(Unit *target) { - for (ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) - appIter->second->SetNeedClientUpdate(); + // for owner check use Spell::CheckTarget + assert(GetOwner() != target); + + // some special cases + switch(GetId()) + { + case 45828: // AV Marshal's HP/DMG auras + case 45829: + case 45830: + case 45821: + case 45822: // AV Warmaster's HP/DMG auras + case 45823: + case 45824: + case 45826: + switch(target->GetEntry()) + { + // alliance + case 14762: // Dun Baldar North Marshal + case 14763: // Dun Baldar South Marshal + case 14764: // Icewing Marshal + case 14765: // Stonehearth Marshal + case 11948: // Vandar Stormspike + // horde + case 14772: // East Frostwolf Warmaster + case 14776: // Tower Point Warmaster + case 14773: // Iceblood Warmaster + case 14777: // West Frostwolf Warmaster + case 11946: // Drek'thar + return true; + default: + return false; + break; + } + break; + } + return true; } void Aura::_DeleteRemovedApplications() diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index be76b520bd9..97c0076fcd5 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -163,7 +163,7 @@ class Aura void SetNeedClientUpdateForTargets() const; void HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, bool apply); - bool CheckTarget(Unit *target); + bool CheckAreaTarget(Unit *target); private: void _DeleteRemovedApplications(); protected: diff --git a/src/server/game/Spells/Auras/SpellEffects.cpp b/src/server/game/Spells/Auras/SpellEffects.cpp index 2f7486d53d9..0b2191d5e48 100644 --- a/src/server/game/Spells/Auras/SpellEffects.cpp +++ b/src/server/game/Spells/Auras/SpellEffects.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "Opcodes.h" #include "Log.h" @@ -107,11 +107,11 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, // 39 SPELL_EFFECT_LANGUAGE &Spell::EffectDualWield, // 40 SPELL_EFFECT_DUAL_WIELD &Spell::EffectJump, // 41 SPELL_EFFECT_JUMP - &Spell::EffectJump, // 42 SPELL_EFFECT_JUMP2 + &Spell::EffectJumpDest, // 42 SPELL_EFFECT_JUMP_DEST &Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER &Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP &Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related - &Spell::EffectNULL, // 46 SPELL_EFFECT_SPAWN we must spawn pet there + &Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN clientside, unit appears as if it was just spawned &Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL &Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth &Spell::EffectUnused, // 49 SPELL_EFFECT_DETECT one spell: Detect @@ -154,7 +154,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectActivateObject, // 86 SPELL_EFFECT_ACTIVATE_OBJECT &Spell::EffectWMODamage, // 87 SPELL_EFFECT_WMO_DAMAGE &Spell::EffectWMORepair, // 88 SPELL_EFFECT_WMO_REPAIR - &Spell::EffectUnused, // 89 SPELL_EFFECT_WMO_CHANGE + &Spell::EffectUnused, // 89 SPELL_EFFECT_WMO_CHANGE // 0 intact // 1 damaged // 2 destroyed // 3 rebuilding &Spell::EffectKillCreditPersonal, // 90 SPELL_EFFECT_KILL_CREDIT Kill credit but only for single person &Spell::EffectUnused, // 91 SPELL_EFFECT_THREAT_ALL one spell: zzOLDBrainwash &Spell::EffectEnchantHeldItem, // 92 SPELL_EFFECT_ENCHANT_HELD_ITEM @@ -203,10 +203,10 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectNULL, //135 SPELL_EFFECT_CALL_PET &Spell::EffectHealPct, //136 SPELL_EFFECT_HEAL_PCT &Spell::EffectEnergizePct, //137 SPELL_EFFECT_ENERGIZE_PCT - &Spell::EffectJump2, //138 SPELL_EFFECT_LEAP_BACK Leap back - &Spell::EffectUnused, //139 SPELL_EFFECT_CLEAR_QUEST (misc - is quest ID) + &Spell::EffectLeapBack, //138 SPELL_EFFECT_LEAP_BACK Leap back + &Spell::EffectQuestClear, //139 SPELL_EFFECT_CLEAR_QUEST Reset quest status (miscValue - quest ID) &Spell::EffectForceCast, //140 SPELL_EFFECT_FORCE_CAST - &Spell::EffectNULL, //141 SPELL_EFFECT_141 damage and reduce speed? + &Spell::EffectForceCastWithValue, //141 SPELL_EFFECT_FORCE_CAST_WITH_VALUE &Spell::EffectTriggerSpellWithValue, //142 SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE &Spell::EffectApplyAreaAura, //143 SPELL_EFFECT_APPLY_AREA_AURA_OWNER &Spell::EffectKnockBack, //144 SPELL_EFFECT_KNOCK_BACK_2 Spectral Blast @@ -214,7 +214,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectActivateRune, //146 SPELL_EFFECT_ACTIVATE_RUNE &Spell::EffectQuestFail, //147 SPELL_EFFECT_QUEST_FAIL quest fail &Spell::EffectUnused, //148 SPELL_EFFECT_148 unused - &Spell::EffectCharge2, //149 SPELL_EFFECT_CHARGE2 swoop + &Spell::EffectChargeDest, //149 SPELL_EFFECT_CHARGE_DEST &Spell::EffectUnused, //150 SPELL_EFFECT_150 unused &Spell::EffectTriggerRitualOfSummoning, //151 SPELL_EFFECT_TRIGGER_SPELL_2 &Spell::EffectNULL, //152 SPELL_EFFECT_152 summon Refer-a-Friend @@ -303,7 +303,7 @@ void Spell::EffectEnvirinmentalDMG(uint32 i) // Note: this hack with damage replace required until GO casting not implemented // environment damage spells already have around enemies targeting but this not help in case not existed GO casting support // currently each enemy selected explicitly and self cast damage, we prevent apply self casted spell bonuses/etc - damage = m_spellInfo->CalculateSimpleValue(i); + damage = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, i, m_caster); m_caster->CalcAbsorbResist(m_caster, GetSpellSchoolMask(m_spellInfo), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist, m_spellInfo); @@ -391,8 +391,9 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) return; break; } - // gruul's shatter - case 33671: + case 33671: // gruul's shatter + case 50811: // krystallus shatter ( Normal ) + case 61547: // krystallus shatter ( Heroic ) { // don't damage self and only players if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER) @@ -430,6 +431,22 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) damage = (m_caster->getLevel() - 60) * 4 + 60; break; } + + // Loken Pulsing Shockwave + case 59837: + case 52942: + { + // don't damage self and only players + if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + + float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0])); + if (!radius) + return; + float distance = m_caster->GetDistance2d(unitTarget); + damage = (distance > radius) ? 0 : int32(m_spellInfo->EffectBasePoints[0]*distance); + break; + } } break; } @@ -504,7 +521,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) damage += pdamage * aura->GetTotalTicks() * pct_dir / 100; uint32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effect_idx + 2)) / 3; - m_currentBasePoints[1] = pdamage * aura->GetTotalTicks() * pct_dot / 100; + m_currentBasePoints[1] = SpellMgr::CalculateSpellEffectBaseAmount(pdamage * aura->GetTotalTicks() * pct_dot / 100); apply_direct_bonus = false; // Glyph of Conflagrate @@ -566,7 +583,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST && ((*i)->GetSpellProto()->SpellIconID == 95)) { - int chance = (*i)->GetSpellProto()->CalculateSimpleValue(1); + int chance = SpellMgr::CalculateSpellEffectAmount((*i)->GetSpellProto(), 1, m_caster); if (roll_chance_i(chance)) // Mind Trauma m_caster->CastSpell(unitTarget, 48301, true, 0); @@ -621,7 +638,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) { if ((*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellProto()->SpellIconID == 1960) { - uint32 chance = (*iter)->GetSpellProto()->CalculateSimpleValue(2); + uint32 chance = SpellMgr::CalculateSpellEffectAmount((*iter)->GetSpellProto(), 2, m_caster); if (chance && roll_chance_i(chance)) needConsume = false; @@ -710,7 +727,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) // Add main hand dps * effect[2] amount float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2; int32 count = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, 2); - damage += count * int32(average * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK); + damage += count * int32(average * IN_MILLISECONDS) / m_caster->GetAttackTime(BASE_ATTACK); } // Shield of Righteousness else if (m_spellInfo->SpellFamilyFlags[1]&0x00100000) @@ -769,33 +786,6 @@ void Spell::EffectDummy(uint32 i) { switch (m_spellInfo->Id) { - // Magic Pull - case 51336: - m_caster->CastSpell(unitTarget,50770,true); - break; - // Wrath of the Astromancer - case 42784: - { - uint32 count = 0; - for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) - if (ihit->effectMask & (1<::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) - if (ihit->effectMask & (1<targetGUID)) - m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false); - } - - return; - } case 8063: // Deviate Fish { if (m_caster->GetTypeId() != TYPEID_PLAYER) @@ -939,6 +929,46 @@ void Spell::EffectDummy(uint32 i) } return; } + case 14537: // Six Demon Bag + { + if( !unitTarget || !unitTarget->isAlive()) return; + + uint32 ClearSpellId[6] = + { + 15662, // Fireball + 11538, // Frostball + 21179, // Chain Lightning + 14621, // Polymorph + 25189, // Enveloping Winds + 14642 // Summon Felhund minion + }; + + uint32 effect = 0; + uint32 rand = urand(0, 100); + + if (rand >= 0 && rand < 25) // Fireball (25% chance) + effect = ClearSpellId[0]; + else if (rand >= 25 && rand < 50) // Frostball (25% chance) + effect = ClearSpellId[1]; + else if (rand >=50 && rand < 70) // Chain Lighting (25% chance) + effect = ClearSpellId[2]; + else if (rand >= 70 && rand < 80) // Polymorph (10% chance) + { + effect = ClearSpellId[3]; + if (urand(0, 100) <= 30) // 30% chance to self-cast + unitTarget = m_caster; + } + else if (rand >=80 && rand < 95) // Enveloping Winds (15% chance) + effect = ClearSpellId[4]; + else // Summon Felhund minion (5% chance) + { + effect = ClearSpellId[5]; + unitTarget = m_caster; + } + + m_caster->CastSpell(unitTarget, effect, true); + return; + } case 15998: // Capture Worg Pup case 29435: // Capture Female Kaliri Hatchling { @@ -1146,6 +1176,20 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, spell_id, true, NULL); return; } + case 34665: //Administer Antidote + { + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT + || unitTarget->GetEntry() != 16880 || unitTarget->ToCreature()->isPet()) + return; + + unitTarget->ToCreature()->UpdateEntry(16992); + m_caster->ToPlayer()->RewardPlayerAndGroupAtEvent(16992, unitTarget); + + if (unitTarget->IsAIEnabled) + unitTarget->ToCreature()->AI()->AttackStart(m_caster); + + return; + } case 35745: // Socrethar's Stone { uint32 spell_id; @@ -1206,6 +1250,29 @@ void Spell::EffectDummy(uint32 i) DoCreateItem(i, newitemid); return; } + // Wrath of the Astromancer + case 42784: + { + uint32 count = 0; + for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + if (ihit->effectMask & (1<::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + if (ihit->effectMask & (1<targetGUID)) + m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false); + } + + return; + } // Demon Broiled Surprise case 43723: { @@ -1238,20 +1305,6 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, 42337, true, NULL); return; } - case 34665: //Administer Antidote - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT - || unitTarget->GetEntry() != 16880 || unitTarget->ToCreature()->isPet()) - return; - - unitTarget->ToCreature()->UpdateEntry(16992); - m_caster->ToPlayer()->RewardPlayerAndGroupAtEvent(16992, unitTarget); - - if (unitTarget->IsAIEnabled) - unitTarget->ToCreature()->AI()->AttackStart(m_caster); - - return; - } case 44997: // Converting Sentry { //Converted Sentry Credit @@ -1310,6 +1363,10 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, 49378, true); } return; + // Magic Pull + case 51336: + m_caster->CastSpell(unitTarget,50770,true); + break; case 52845: // Brewfest Mount Transformation (Faction Swap) if (m_caster->GetTypeId() != TYPEID_PLAYER) return; @@ -1391,8 +1448,8 @@ void Spell::EffectDummy(uint32 i) { case 0: { - uint32 spellID = m_spellInfo->CalculateSimpleValue(0); - uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(1); + uint32 spellID = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0); + uint32 reqAuraID = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1); if (m_caster->HasAuraEffect(reqAuraID,0)) m_caster->CastSpell(m_caster,spellID,true,NULL); @@ -1415,6 +1472,11 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, 54586, true); return; } + case 54171: //Divine Storm + { + m_caster->CastCustomSpell(unitTarget, 54172, &damage, 0, 0, true); + return; + } case 58418: // Portal to Orgrimmar case 58420: // Portal to Stormwind return; // implemented in EffectScript[0] @@ -1721,41 +1783,14 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, 63848, true); break; } - switch(m_spellInfo->Id) + switch (m_spellInfo->Id) { case 5938: // Shiv { if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - Player *pCaster = m_caster->ToPlayer(); - - Item *item = pCaster->GetWeaponForAttack(OFF_ATTACK); - if (!item) - return; - - // all poison enchantments is temporary - uint32 enchant_id = item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT); - if (!enchant_id) - return; - - SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if (!pEnchant) - return; - - for (int s=0; s<3; s++) - { - if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) - continue; - - SpellEntry const* combatEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]); - if (!combatEntry || combatEntry->Dispel != DISPEL_POISON) - continue; - - m_caster->CastSpell(unitTarget, combatEntry, true, item); - } - - m_caster->CastSpell(unitTarget, 5940, true); + m_caster->CastSpell(unitTarget, 5940, true); return; } case 14185: // Preparation @@ -1850,7 +1885,7 @@ void Spell::EffectDummy(uint32 i) if (Pet *pPet = m_caster->ToPlayer()->GetPet()) if (pPet->isAlive()) - pPet->CastSpell(unitTarget, m_spellInfo->CalculateSimpleValue(i), true); + pPet->CastSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, i), true); return; } } @@ -1900,10 +1935,6 @@ void Spell::EffectDummy(uint32 i) switch(m_spellInfo->Id) { - case 54171: //Divine Storm - { - m_caster->CastCustomSpell(unitTarget, 54172, &damage, 0, 0, true); - } case 20425: // Judgement of command { if (!unitTarget) @@ -2131,7 +2162,7 @@ void Spell::EffectDummy(uint32 i) if (m_targets.HasDst()) targets.setDst(&m_targets.m_dstPos); - spell_id = m_currentBasePoints[0]; + spell_id = CalculateDamage(0, NULL); } // Corpse Explosion else if (m_spellInfo->SpellIconID == 1737) @@ -2150,7 +2181,7 @@ void Spell::EffectDummy(uint32 i) { bp = damage; } - m_caster->CastCustomSpell(unitTarget,m_spellInfo->CalculateSimpleValue(1),&bp,NULL,NULL,true); + m_caster->CastCustomSpell(unitTarget, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1), &bp,NULL,NULL,true); // Corpse Explosion (Suicide) unitTarget->CastCustomSpell(unitTarget,43999,&bp,NULL,NULL,true); // Set corpse look @@ -2183,7 +2214,7 @@ void Spell::EffectDummy(uint32 i) targets.setUnitTarget(unitTarget); Spell* spell = new Spell(m_caster, spellInfo, triggered, m_originalCasterGUID, NULL, true); - if (bp) spell->m_currentBasePoints[0] = bp; + if (bp) spell->m_currentBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(bp); spell->prepare(&targets); } @@ -2276,6 +2307,28 @@ void Spell::EffectForceCast(uint32 i) caster->CastSpell(unitTarget, spellInfo, true, NULL, NULL, m_originalCasterGUID); } +void Spell::EffectForceCastWithValue(uint32 i) +{ + if (!unitTarget) + return; + + uint32 triggered_spell_id = m_spellInfo->EffectTriggerSpell[i]; + + // normal case + SpellEntry const *spellInfo = sSpellStore.LookupEntry(triggered_spell_id); + + if (!spellInfo) + { + sLog.outError("EffectForceCastWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + return; + } + int32 bp = damage; + Unit * caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget); + + caster->CastCustomSpell(unitTarget, spellInfo->Id, &bp, &bp, &bp, true, NULL, NULL, m_originalCasterGUID); +} + + void Spell::EffectTriggerSpell(uint32 effIndex) { // only unit case known @@ -2476,6 +2529,33 @@ void Spell::EffectTriggerMissileSpell(uint32 effect_idx) } void Spell::EffectJump(uint32 i) +{ + if (m_caster->isInFlight()) + return; + + float x,y,z,o; + if (m_targets.getUnitTarget()) + { + m_targets.getUnitTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE); + o = m_caster->GetOrientation(); + } + else if (m_targets.getGOTarget()) + { + m_targets.getGOTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE); + o = m_caster->GetOrientation(); + } + else + { + sLog.outError("Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id); + return; + } + + float speedXY, speedZ; + CalculateJumpSpeeds(i, m_caster->GetExactDist2d(x, y), speedXY, speedZ); + m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ); +} + +void Spell::EffectJumpDest(uint32 i) { if (m_caster->isInFlight()) return; @@ -2503,32 +2583,26 @@ void Spell::EffectJump(uint32 i) else o = m_caster->GetOrientation(); } - else if (m_targets.getUnitTarget()) - { - m_targets.getUnitTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE); - o = m_caster->GetOrientation(); - } - else if (m_targets.getGOTarget()) - { - m_targets.getGOTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE); - o = m_caster->GetOrientation(); - } else { - sLog.outError("Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id); + sLog.outError("Spell::EffectJumpDest - unsupported target mode for spell ID %u", m_spellInfo->Id); return; } - //m_caster->NearTeleportTo(x,y,z,o,true); - float speedZ; + float speedXY, speedZ; + CalculateJumpSpeeds(i, m_caster->GetExactDist2d(x, y), speedXY, speedZ); + m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ); +} + +void Spell::CalculateJumpSpeeds(uint8 i, float dist, float & speedXY, float & speedZ) +{ if (m_spellInfo->EffectMiscValue[i]) speedZ = float(m_spellInfo->EffectMiscValue[i])/10; else if (m_spellInfo->EffectMiscValueB[i]) speedZ = float(m_spellInfo->EffectMiscValueB[i])/10; else speedZ = 10.0f; - float speedXY = m_caster->GetExactDist2d(x, y) * 10.0f / speedZ; - m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ); + speedXY = dist * 10.0f / speedZ; } void Spell::EffectTeleportUnits(uint32 /*i*/) @@ -2536,6 +2610,27 @@ void Spell::EffectTeleportUnits(uint32 /*i*/) if (!unitTarget || unitTarget->isInFlight()) return; + // Pre effects + uint8 uiMaxSafeLevel = 0; + switch (m_spellInfo->Id) + { + case 48129: // Scroll of Recall + uiMaxSafeLevel = 40; + case 60320: // Scroll of Recall II + if (!uiMaxSafeLevel) + uiMaxSafeLevel = 70; + case 60321: // Scroll of Recal III + if (!uiMaxSafeLevel) + uiMaxSafeLevel = 80; + + if (unitTarget->getLevel() > uiMaxSafeLevel) + { + unitTarget->AddAura(60444,unitTarget); //Apply Lost! Aura + return; + } + break; + } + // If not exist data for dest location - return if (!m_targets.HasDst()) { @@ -2912,6 +3007,10 @@ void Spell::SpellDamageHeal(uint32 /*i*/) else addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + // Remove Grievious bite if fully healed + if (unitTarget->HasAura(48920) && (unitTarget->GetHealth() + addhealth >= unitTarget->GetMaxHealth())) + unitTarget->RemoveAura(48920); + m_damage -= addhealth; } } @@ -3138,7 +3237,9 @@ void Spell::EffectCreateItem2(uint32 i) // create some random items player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell); - } + } + else + player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell); // create some random items } } @@ -3706,7 +3807,7 @@ void Spell::EffectSummonType(uint32 i) TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; - TempSummon * summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); + summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); if (!summon) continue; if (properties->Category == SUMMON_CATEGORY_ALLY) @@ -3736,7 +3837,7 @@ void Spell::EffectSummonType(uint32 i) if (m_spellInfo->EffectBasePoints[i]) { - SpellEntry const *spellProto = sSpellStore.LookupEntry(m_spellInfo->CalculateSimpleValue(i)); + SpellEntry const *spellProto = sSpellStore.LookupEntry(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, i)); if (spellProto) m_caster->CastSpell(summon, spellProto, true); } @@ -3747,7 +3848,10 @@ void Spell::EffectSummonType(uint32 i) } if (summon) + { summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); + summon->SetCreatorGUID(m_originalCaster->GetGUID()); + } } void Spell::EffectLearnSpell(uint32 i) @@ -3829,7 +3933,7 @@ void Spell::EffectDispel(uint32 i) bool success = false; // 2.4.3 Patch Notes: "Dispel effects will no longer attempt to remove effects that have 100% dispel resistance." - if (GetDispelChance(itr->first->GetCaster(), unitTarget, itr->first->GetId(), !unitTarget->IsFriendlyTo(m_caster), &success) > 99) + if (!GetDispelChance(itr->first->GetCaster(), unitTarget, itr->first->GetId(), !unitTarget->IsFriendlyTo(m_caster), &success)) { dispel_list.erase(itr); continue; @@ -3885,7 +3989,7 @@ void Spell::EffectDispel(uint32 i) // Devour Magic if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC) { - int32 heal_amount = m_spellInfo->CalculateSimpleValue(1); + int32 heal_amount = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1); m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true); } } @@ -3926,7 +4030,7 @@ void Spell::EffectDistract(uint32 /*i*/) // Set creature Distracted, Stop it, And turn it unitTarget->SetOrientation(angle); unitTarget->StopMoving(); - unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILISECONDS); + unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS); } } @@ -3998,7 +4102,7 @@ void Spell::EffectLearnSkill(uint32 i) uint32 skillid = m_spellInfo->EffectMiscValue[i]; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); - unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->CalculateSimpleValue(i), skillval?skillval:1, damage*75); + unitTarget->ToPlayer()->SetSkill(skillid, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, i), skillval?skillval:1, damage*75); } void Spell::EffectAddHonor(uint32 /*i*/) @@ -4853,7 +4957,7 @@ void Spell::EffectSummonObjectWild(uint32 i) int32 duration = GetSpellDuration(m_spellInfo); - pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); + pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); pGameObj->SetSpellId(m_spellInfo->Id); // Wild object not have owner and check clickable by players @@ -4896,7 +5000,7 @@ void Spell::EffectSummonObjectWild(uint32 i) if (linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map, m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { - linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); + linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); linkedGO->SetSpellId(m_spellInfo->Id); // Wild object not have owner and check clickable by players @@ -5015,7 +5119,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) case 55693: // Remove Collapsing Cave Aura if (!unitTarget) return; - unitTarget->RemoveAurasDueToSpell(m_spellInfo->CalculateSimpleValue(effIndex)); + unitTarget->RemoveAurasDueToSpell(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, effIndex)); break; // PX-238 Winter Wondervolt TRAP case 26275: @@ -5558,8 +5662,8 @@ void Spell::EffectScriptEffect(uint32 effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || effIndex != 0) return; - uint32 spellID = m_spellInfo->CalculateSimpleValue(0); - uint32 questID = m_spellInfo->CalculateSimpleValue(1); + uint32 spellID = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0); + uint32 questID = SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1); if (unitTarget->ToPlayer()->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE && !unitTarget->ToPlayer()->GetQuestRewardStatus (questID)) unitTarget->CastSpell(unitTarget, spellID, true); @@ -5980,6 +6084,17 @@ void Spell::EffectScriptEffect(uint32 effIndex) unitTarget->CastSpell(unitTarget, spellTarget[urand(0,4)], true); break; } + case 64142: // Upper Deck - Create Foam Sword + if (unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + Player *plr = unitTarget->ToPlayer(); + static uint32 const itemId[] = {45061, 45176, 45177, 45178, 45179, 0}; + // player can only have one of these items + for (uint32 const *itr = &itemId[0]; *itr; ++itr) + if (plr->HasItemCount(*itr, 1, true)) + return; + DoCreateItem(effIndex, itemId[urand(0,4)]); + return; } break; } @@ -6476,7 +6591,7 @@ void Spell::EffectDuel(uint32 i) pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->getFaction()); pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()+1); int32 duration = GetSpellDuration(m_spellInfo); - pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); + pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); pGameObj->SetSpellId(m_spellInfo->Id); m_caster->AddGameObject(pGameObj); @@ -6554,7 +6669,7 @@ void Spell::EffectSummonPlayer(uint32 /*i*/) WorldPacket data(SMSG_SUMMON_REQUEST, 8+4+4); data << uint64(m_caster->GetGUID()); // summoner guid data << uint32(m_caster->GetZoneId()); // summoner zone - data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILISECONDS); // auto decline after msecs + data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILLISECONDS); // auto decline after msecs unitTarget->ToPlayer()->GetSession()->SendPacket(&data); } @@ -6652,7 +6767,7 @@ void Spell::EffectEnchantHeldItem(uint32 i) return; // Apply the temporary enchantment - item->SetEnchantment(slot, enchant_id, duration*IN_MILISECONDS, 0); + item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0); item_owner->ApplyEnchantment(item, slot, true); } } @@ -6782,7 +6897,7 @@ void Spell::EffectSummonObject(uint32 i) //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL,m_caster->getLevel()); int32 duration = GetSpellDuration(m_spellInfo); - pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); + pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); pGameObj->SetSpellId(m_spellInfo->Id); m_caster->AddGameObject(pGameObj); @@ -6821,6 +6936,13 @@ void Spell::EffectResurrect(uint32 /*effIndex*/) return; } break; + // Defibrillate ( Gnomish Army Knife) have 67% chance on success_list + case 54732: + if (roll_chance_i(33)) + { + return; + } + break; default: break; } @@ -6955,7 +7077,14 @@ void Spell::EffectQuestComplete(uint32 i) return; uint32 quest_id = m_spellInfo->EffectMiscValue[i]; - pPlayer->AreaExploredOrEventHappens(quest_id); + if (quest_id) + { + uint16 log_slot = pPlayer->FindQuestSlot(quest_id); + if (log_slot < MAX_QUEST_LOG_SIZE) + pPlayer->AreaExploredOrEventHappens(quest_id); + else + pPlayer->CompleteQuest(quest_id); // quest not in log - for internal use + } } void Spell::EffectForceDeselect(uint32 /*i*/) @@ -7027,9 +7156,6 @@ void Spell::EffectSkinning(uint32 /*i*/) void Spell::EffectCharge(uint32 /*i*/) { - if (!m_caster) - return; - Unit *target = m_targets.getUnitTarget(); if (!target) return; @@ -7043,22 +7169,14 @@ void Spell::EffectCharge(uint32 /*i*/) m_caster->Attack(target, true); } -void Spell::EffectCharge2(uint32 /*i*/) +void Spell::EffectChargeDest(uint32 /*i*/) { - float x, y, z; if (m_targets.HasDst()) - m_targets.m_dstPos.GetPosition(x, y, z); - else if (Unit *target = m_targets.getUnitTarget()) { - target->GetContactPoint(m_caster, x, y, z); - // not all charge effects used in negative spells - if (!IsPositiveSpell(m_spellInfo->Id) && m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->Attack(target, true); + float x, y, z; + m_targets.m_dstPos.GetPosition(x, y, z); + m_caster->GetMotionMaster()->MoveCharge(x, y, z); } - else - return; - - m_caster->GetMotionMaster()->MoveCharge(x, y, z); } void Spell::EffectKnockBack(uint32 i) @@ -7101,7 +7219,7 @@ void Spell::EffectKnockBack(uint32 i) unitTarget->KnockbackFrom(x, y, speedxy, speedz); } -void Spell::EffectJump2(uint32 i) +void Spell::EffectLeapBack(uint32 i) { float speedxy = float(m_spellInfo->EffectMiscValue[i])/10; float speedz = float(damage/10); @@ -7117,6 +7235,50 @@ void Spell::EffectJump2(uint32 i) } } +void Spell::EffectQuestClear(uint32 i) +{ + Player *pPlayer = NULL; + if (m_caster->GetTypeId() == TYPEID_PLAYER) + pPlayer = m_caster->ToPlayer(); + else if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER) + pPlayer = unitTarget->ToPlayer(); + + if (!pPlayer) + return; + + uint32 quest_id = m_spellInfo->EffectMiscValue[i]; + + Quest const* pQuest = objmgr.GetQuestTemplate(quest_id); + + if (!pQuest) + return; + + QuestStatusMap::iterator qs_itr = pPlayer->getQuestStatusMap().find(quest_id); + // Player has never done this quest + if (qs_itr == pPlayer->getQuestStatusMap().end()) + return; + + // remove all quest entries for 'entry' from quest log + for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot) + { + uint32 quest = pPlayer->GetQuestSlotQuestId(slot); + if (quest == quest_id) + { + pPlayer->SetQuestSlot(slot, 0); + + // we ignore unequippable quest items in this case, its' still be equipped + pPlayer->TakeQuestSourceItem(quest, false); + } + } + + // set quest status to not started (will be updated in DB at next save) + pPlayer->SetQuestStatus(quest_id, QUEST_STATUS_NONE); + + // reset rewarded for restart repeatable quest + QuestStatusData &data = qs_itr->second; + data.m_rewarded = false; +} + void Spell::EffectSendTaxi(uint32 i) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) @@ -7152,7 +7314,7 @@ void Spell::EffectDispelMechanic(uint32 i) continue; bool success = false; GetDispelChance(aura->GetCaster(), unitTarget, aura->GetId(), !unitTarget->IsFriendlyTo(m_caster), &success); - if((GetAllSpellMechanicMask(aura->GetSpellProto()) & (1<<(mechanic))) && success) + if ((GetAllSpellMechanicMask(aura->GetSpellProto()) & (1 << mechanic)) && success) dispel_list.push(std::make_pair(aura->GetId(), aura->GetCasterGUID())); } @@ -7356,7 +7518,7 @@ void Spell::EffectTransmitted(uint32 effIndex) case 3: lastSec = 17; break; } - duration = duration - lastSec*IN_MILISECONDS + FISHING_BOBBER_READY_TIME*IN_MILISECONDS; + duration = duration - lastSec*IN_MILLISECONDS + FISHING_BOBBER_READY_TIME*IN_MILLISECONDS; break; } case GAMEOBJECT_TYPE_SUMMONING_RITUAL: @@ -7377,7 +7539,7 @@ void Spell::EffectTransmitted(uint32 effIndex) break; } - pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); + pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); pGameObj->SetOwnerGUID(m_caster->GetGUID()); @@ -7396,7 +7558,7 @@ void Spell::EffectTransmitted(uint32 effIndex) if (linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap, m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { - linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); + linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); //linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); linkedGO->SetSpellId(m_spellInfo->Id); linkedGO->SetOwnerGUID(m_caster->GetGUID()); @@ -7543,7 +7705,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i) bool success = false; // 2.4.3 Patch Notes: "Dispel effects will no longer attempt to remove effects that have 100% dispel resistance." - if (GetDispelChance(itr->first->GetCaster(), unitTarget, itr->first->GetId(), !unitTarget->IsFriendlyTo(m_caster), &success) > 99) + if (!GetDispelChance(itr->first->GetCaster(), unitTarget, itr->first->GetId(), !unitTarget->IsFriendlyTo(m_caster), &success)) { steal_list.erase(itr); continue; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5016e5ebc2b..510be691d18 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -19,7 +19,7 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" +#include "DatabaseEnv.h" #include "WorldPacket.h" #include "WorldSession.h" #include "GridNotifiers.h" @@ -41,7 +41,6 @@ #include "MapManager.h" #include "ObjectAccessor.h" #include "CellImpl.h" -#include "Policies/SingletonImp.h" #include "SharedDefines.h" #include "LootMgr.h" #include "VMapFactory.h" @@ -53,7 +52,7 @@ #include "ScriptMgr.h" #include "ConditionMgr.h" -#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILISECONDS) +#define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS) extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS]; @@ -149,6 +148,15 @@ void SpellCastTargets::setItemTarget(Item* item) m_targetMask |= TARGET_FLAG_ITEM; } +void SpellCastTargets::setTradeItemTarget(Player* caster) +{ + m_itemTargetGUID = uint64(TRADE_SLOT_NONTRADED); + m_itemTargetEntry = 0; + m_targetMask |= TARGET_FLAG_TRADE_ITEM; + + Update(caster); +} + void SpellCastTargets::setCorpseTarget(Corpse* corpse) { m_CorpseTargetGUID = corpse->GetGUID(); @@ -164,12 +172,13 @@ void SpellCastTargets::Update(Unit* caster) m_itemTarget = NULL; if (caster->GetTypeId() == TYPEID_PLAYER) { + Player *player = caster->ToPlayer(); if (m_targetMask & TARGET_FLAG_ITEM) - m_itemTarget = caster->ToPlayer()->GetItemByGuid(m_itemTargetGUID); + m_itemTarget = player->GetItemByGuid(m_itemTargetGUID); else if (m_targetMask & TARGET_FLAG_TRADE_ITEM) - if (m_itemTargetGUID == TRADE_SLOT_NONTRADED) // here it is not guid but slot. Also prevent hacking slots - if (Player* pTrader = caster->ToPlayer()->GetTrader()) - m_itemTarget = pTrader->GetItemByTradeSlot(m_itemTargetGUID); + if (m_itemTargetGUID == TRADE_SLOT_NONTRADED) // here it is not guid but slot. Also prevents hacking slots + if (TradeData* pTrade = player->GetTradeData()) + m_itemTarget = pTrade->GetTraderData()->GetItem(TRADE_SLOT_NONTRADED); if (m_itemTarget) m_itemTargetEntry = m_itemTarget->GetEntry(); @@ -390,13 +399,12 @@ Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 origin } for (int i=0; i <3; ++i) - m_currentBasePoints[i] = m_spellInfo->CalculateSimpleValue(i); + m_currentBasePoints[i] = m_spellInfo->EffectBasePoints[i]; m_spellState = SPELL_STATE_NULL; m_TriggerSpells.clear(); m_IsTriggeredSpell = triggered; - //m_AreaAura = false; m_CastItem = NULL; unitTarget = NULL; @@ -1336,7 +1344,15 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool // Now Reduce spell duration using data received at spell hit int32 duration = m_spellAura->GetMaxDuration(); int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup,aurSpellInfo); - unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel,limitduration); + float diminishMod = unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel,limitduration); + + // unit is immune to aura if it was diminished to 0 duration + if (diminishMod == 0.0f) + { + m_spellAura->Remove(); + return SPELL_MISS_IMMUNE; + } + ((UnitAura*)m_spellAura)->SetDiminishGroup(m_diminishGroup); bool positive = IsPositiveSpell(m_spellAura->GetId()); @@ -1350,12 +1366,6 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool if (IsChanneledSpell(m_spellInfo)) m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); - if (duration == 0 && !positive) - { - m_spellAura->Remove(); - return SPELL_MISS_IMMUNE; - } - if (duration != m_spellAura->GetMaxDuration()) { m_spellAura->SetMaxDuration(duration); @@ -1989,7 +1999,6 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) if (cur == TARGET_DST_TARGET_ENEMY || cur == TARGET_DEST_TARGET_ANY) { m_targets.setDst(target); - AddUnitTarget(target, i); break; } @@ -2018,9 +2027,6 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) Position pos; target->GetNearPosition(pos, dist, angle); m_targets.setDst(&pos); - // Teleports use this as destination - if (m_spellInfo->Effect[i] != SPELL_EFFECT_TELEPORT_UNITS) - AddUnitTarget(target, i); break; } @@ -2416,6 +2422,117 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) if (!unitList.empty()) { + // Special target selection for smart heals and energizes + uint32 maxSize = 0; + int32 power = -1; + switch (m_spellInfo->SpellFamilyName) + { + case SPELLFAMILY_GENERIC: + switch (m_spellInfo->Id) + { + case 52759: // Ancestral Awakening + case 71610: // Echoes of Light (Althor's Abacus normal version) + case 71641: // Echoes of Light (Althor's Abacus heroic version) + maxSize = 1; + power = POWER_HEALTH; + break; + case 54968: // Glyph of Holy Light + maxSize = m_spellInfo->MaxAffectedTargets; + power = POWER_HEALTH; + break; + case 57669: // Replenishment + // In arenas Replenishment may only affect the caster + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->InArena()) + { + unitList.clear(); + unitList.push_back(m_caster); + break; + } + maxSize = 10; + power = POWER_MANA; + break; + default: + break; + } + break; + case SPELLFAMILY_PRIEST: + if (m_spellInfo->SpellFamilyFlags[0] == 0x10000000) // Circle of Healing + { + maxSize = m_caster->HasAura(55675) ? 6 : 5; // Glyph of Circle of Healing + power = POWER_HEALTH; + } + else if (m_spellInfo->Id == 64844) // Divine Hymn + { + maxSize = 3; + power = POWER_HEALTH; + } + else if (m_spellInfo->Id == 64904) // Hymn of Hope + { + maxSize = 3; + power = POWER_MANA; + } + else + break; + + // Remove targets outside caster's raid + for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();) + { + if (!(*itr)->IsInRaidWith(m_caster)) + itr = unitList.erase(itr); + else + ++itr; + } + break; + case SPELLFAMILY_DRUID: + if (m_spellInfo->SpellFamilyFlags[1] == 0x04000000) // Wild Growth + { + maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth + power = POWER_HEALTH; + } + else + break; + + // Remove targets outside caster's raid + for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();) + { + if (!(*itr)->IsInRaidWith(m_caster)) + itr = unitList.erase(itr); + else + ++itr; + } + break; + default: + break; + } + + if (maxSize && power != -1) + { + if (power == POWER_HEALTH) + { + if (unitList.size() > maxSize) + { + unitList.sort(Trinity::HealthPctOrderPred()); + unitList.resize(maxSize); + } + } + else + { + for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();) + { + if ((*itr)->getPowerType() != (Powers)power) + itr = unitList.erase(itr); + else + ++itr; + } + if (unitList.size() > maxSize) + { + unitList.sort(Trinity::PowerPctOrderPred((Powers)power)); + unitList.resize(maxSize); + } + } + } + + // Other special target selection goes here if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) { Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); @@ -2438,56 +2555,6 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) case 59725: // Improved Spell Reflection - aoe aura unitList.remove(m_caster); break; - case 57669: //Replenishment (special target selection) 10 targets with lowest mana - { - for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();) - { - if ((*itr)->getPowerType() != POWER_MANA) - itr = unitList.erase(itr); - else - ++itr; - } - if (unitList.size() > 10) - { - unitList.sort(Trinity::PowerPctOrderPred(POWER_MANA)); - unitList.resize(10); - } - break; - } - case 52759: // Ancestral Awakening - { - if (unitList.size() > 1) - { - unitList.sort(Trinity::HealthPctOrderPred()); - unitList.resize(1); - } - break; - } - } - if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_TARGET_ANY - && m_spellInfo->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ALLY_DST)// Wild Growth, Circle of Healing, Glyph of holy light target special selection - { - for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();) - { - if (!(*itr)->IsInRaidWith(m_targets.getUnitTarget())) - itr = unitList.erase(itr); - else - ++itr; - } - - uint32 maxsize = 5; - - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x04000000) // Wild Growth - maxsize += m_caster->HasAura(62970) ? 1 : 0; // Glyph of Wild Growth - - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellInfo->SpellFamilyFlags[0] & 0x10000000 && m_spellInfo->SpellIconID == 2214) // Circle of Healing - maxsize += m_caster->HasAura(55675) ? 1 : 0; // Glyph of Circle of Healing - - if (unitList.size() > maxsize) - { - unitList.sort(Trinity::HealthPctOrderPred()); - unitList.resize(maxsize); - } } // Death Pact if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) @@ -2844,6 +2911,32 @@ void Spell::cast(bool skipCheck) SetExecutedCurrently(false); return; } + + // additional check after cast bar completes (must not be in CheckCast) + // if trade not complete then remember it in trade data + if (m_targets.getTargetMask() & TARGET_FLAG_TRADE_ITEM) + { + if (m_caster->GetTypeId() == TYPEID_PLAYER) + { + if (TradeData* my_trade = m_caster->ToPlayer()->GetTradeData()) + { + if (!my_trade->IsInAcceptProcess()) + { + // Spell will be casted at completing the trade. Silently ignore at this place + my_trade->SetSpell(m_spellInfo->Id, m_CastItem); + SendCastResult(SPELL_FAILED_DONT_REPORT); + SendInterrupted(0); + m_caster->ToPlayer()->RestoreSpellMods(this); + // cleanup after mod system + // triggered spell pointer can be not removed in some cases + m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + finish(false); + SetExecutedCurrently(false); + return; + } + } + } + } } SelectSpellTargets(); @@ -2909,6 +3002,12 @@ void Spell::cast(bool skipCheck) TakePower(); TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot } + else if (Item* targetItem = m_targets.getItemTarget()) + { + /// Not own traded item (in trader trade slot) req. reagents including triggered spell case + if (targetItem->GetOwnerGUID() != m_caster->GetGUID()) + TakeReagents(); + } // are there any spells need to be triggered after hit? // handle SPELL_AURA_ADD_TARGET_TRIGGER auras @@ -2938,8 +3037,9 @@ void Spell::cast(bool skipCheck) switch(m_spellInfo->Effect[i]) { case SPELL_EFFECT_CHARGE: + case SPELL_EFFECT_CHARGE_DEST: case SPELL_EFFECT_JUMP: - case SPELL_EFFECT_JUMP2: + case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: case SPELL_EFFECT_ACTIVATE_RUNE: HandleEffects(NULL,NULL,NULL,i); @@ -4274,7 +4374,12 @@ void Spell::TakeRunePower() void Spell::TakeReagents() { if (m_IsTriggeredSpell) // reagents used in triggered spell removed by original spell or don't must be removed. - return; + { + Item* targetItem = m_targets.getItemTarget(); + /// Not own traded item (in trader trade slot) req. reagents including triggered spell case + if (!(targetItem && targetItem->GetOwnerGUID() != m_caster->GetGUID())) + return; + } if (m_caster->GetTypeId() != TYPEID_PLAYER) return; @@ -4669,7 +4774,7 @@ SpellCastResult Spell::CheckCast(bool strict) // - with greater than 10 min CD without SPELL_ATTR_EX4_USABLE_IN_ARENA flag // - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag if ((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) || - GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA)) + GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA)) if (MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId())) if (mapEntry->IsBattleArena()) return SPELL_FAILED_NOT_IN_ARENA; @@ -5212,24 +5317,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_caster->ToPlayer()->IsInFeralForm()) return SPELL_FAILED_ONLY_SHAPESHIFT; break; - // Wild Growth - case 48438: - case 53248: - case 53249: - case 53251: - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_DONT_REPORT; - - Unit* target = m_targets.getUnitTarget(); - if (!target || target->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_BAD_TARGETS; - - if (!m_caster->ToPlayer()->IsInSameRaidWith(target->ToPlayer())) - return SPELL_FAILED_TARGET_NOT_IN_RAID; - - break; - } case 1515: { if (m_caster->GetTypeId() != TYPEID_PLAYER) @@ -5304,6 +5391,9 @@ SpellCastResult Spell::CheckCast(bool strict) if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->IsVehicle()) return SPELL_FAILED_BAD_IMPLICIT_TARGETS; + if (target->IsMounted()) + return SPELL_FAILED_CANT_BE_CHARMED; + if (target->GetCharmerGUID()) return SPELL_FAILED_CHARMED; @@ -5357,23 +5447,12 @@ SpellCastResult Spell::CheckCast(bool strict) // allow always ghost flight spells if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive()) { - // 4197 = Wintergrasp || 4395 = Dalaran && 4564 = Krasus Landing - if (m_originalCaster->GetZoneId() == 4197 || m_originalCaster->GetZoneId() == 4395 && m_originalCaster->GetAreaId() != 4564) - return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE; + if (AreaTableEntry const* pArea = GetAreaEntryByAreaID(m_originalCaster->GetAreaId())) + if (pArea->flags & AREA_FLAG_NO_FLY_ZONE) + return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE; } break; } - case SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS: - { - if (!m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetTypeId() != TYPEID_UNIT) - return SPELL_FAILED_BAD_IMPLICIT_TARGETS; - - // can be casted at non-friendly unit or own pet/charm - if (m_caster->IsFriendlyTo(m_targets.getUnitTarget())) - return SPELL_FAILED_TARGET_FRIENDLY; - - break; - } case SPELL_AURA_PERIODIC_MANA_LEECH: { if (!m_targets.getUnitTarget()) @@ -5392,6 +5471,26 @@ SpellCastResult Spell::CheckCast(bool strict) } } + // check trade slot case (last, for allow catch any another cast problems) + if (m_targets.getTargetMask() & TARGET_FLAG_TRADE_ITEM) + { + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_NOT_TRADING; + + TradeData* my_trade = m_caster->ToPlayer()->GetTradeData(); + + if (!my_trade) + return SPELL_FAILED_NOT_TRADING; + + TradeSlots slot = TradeSlots(m_targets.getItemTargetGUID()); + if (slot != TRADE_SLOT_NONTRADED) + return SPELL_FAILED_ITEM_NOT_READY; + + if (!m_IsTriggeredSpell) + if (my_trade->GetSpell()) + return SPELL_FAILED_ITEM_ALREADY_ENCHANTED; + } + // all ok return SPELL_CAST_OK; } @@ -5892,7 +5991,7 @@ SpellCastResult Spell::CheckItems() else if (!(p_caster->HasItemCount(m_spellInfo->EffectItemType[i],1))) return SPELL_FAILED_TOO_MANY_OF_ITEM; else - p_caster->CastSpell(m_caster,m_spellInfo->CalculateSimpleValue(1),false); // move this to anywhere + p_caster->CastSpell(m_caster,SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1),false); // move this to anywhere return SPELL_FAILED_DONT_REPORT; } } @@ -6346,6 +6445,8 @@ bool Spell::CheckTarget(Unit* target, uint32 eff) case SPELL_AURA_AOE_CHARM: if (target->GetTypeId() == TYPEID_UNIT && target->IsVehicle()) return false; + if (target->IsMounted()) + return false; if (target->GetCharmerGUID()) return false; if (int32 damage = CalculateDamage(eff, target)) @@ -6687,8 +6788,9 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul { if (IsAreaEffectTarget[m_spellInfo->EffectImplicitTargetA[i]] || IsAreaEffectTarget[m_spellInfo->EffectImplicitTargetB[i]]) { - if (int32 reducedPct = unit->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE)) - m_damage = m_damage * (100 + reducedPct) / 100; + m_damage = float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask); + if (m_caster->GetTypeId() == TYPEID_UNIT) + m_damage = float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask); if (m_caster->GetTypeId() == TYPEID_PLAYER) { @@ -6748,8 +6850,8 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk if (skillId != SKILL_NONE) { // skill bonus provided by casting spell (mostly item spells) - // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value) - uint32 spellSkillBonus = uint32(m_currentBasePoints[effIndex]); + // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) + uint32 spellSkillBonus = uint32(CalculateDamage(effIndex, NULL)); reqSkillValue = lockInfo->Skill[j]; // castitem check: rogue using skeleton keys. the skill values should not be added in this case. @@ -6778,15 +6880,15 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value) switch(mod) { case SPELLVALUE_BASE_POINT0: - m_spellValue->EffectBasePoints[0] = value - int32(1); + m_spellValue->EffectBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(value); m_currentBasePoints[0] = m_spellValue->EffectBasePoints[0]; //this should be removed in the future break; case SPELLVALUE_BASE_POINT1: - m_spellValue->EffectBasePoints[1] = value - int32(1); + m_spellValue->EffectBasePoints[1] = SpellMgr::CalculateSpellEffectBaseAmount(value); m_currentBasePoints[1] = m_spellValue->EffectBasePoints[1]; break; case SPELLVALUE_BASE_POINT2: - m_spellValue->EffectBasePoints[2] = value - int32(1); + m_spellValue->EffectBasePoints[2] = SpellMgr::CalculateSpellEffectBaseAmount(value); m_currentBasePoints[2] = m_spellValue->EffectBasePoints[2]; break; case SPELLVALUE_RADIUS_MOD: diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index a987e35e65d..ffbcfdb056d 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -180,6 +180,7 @@ class SpellCastTargets Item* getItemTarget() const { return m_itemTarget; } uint32 getItemTargetEntry() const { return m_itemTargetEntry; } void setItemTarget(Item* item); + void setTradeItemTarget(Player* caster); void updateTradeSlotItem() { if (m_itemTarget && (m_targetMask & TARGET_FLAG_TRADE_ITEM)) @@ -303,7 +304,9 @@ class Spell void EffectAddFarsight(uint32 i); void EffectHealMechanical(uint32 i); void EffectJump(uint32 i); - void EffectJump2(uint32 i); + void EffectJumpDest(uint32 i); + void EffectLeapBack(uint32 i); + void EffectQuestClear(uint32 i); void EffectTeleUnitsFaceCaster(uint32 i); void EffectLearnSkill(uint32 i); void EffectAddHonor(uint32 i); @@ -315,6 +318,7 @@ class Spell void EffectLearnPetSpell(uint32 i); void EffectWeaponDmg(uint32 i); void EffectForceCast(uint32 i); + void EffectForceCastWithValue(uint32 i); void EffectTriggerSpell(uint32 i); void EffectTriggerMissileSpell(uint32 i); void EffectThreat(uint32 i); @@ -345,7 +349,7 @@ class Spell void EffectSelfResurrect(uint32 i); void EffectSkinning(uint32 i); void EffectCharge(uint32 i); - void EffectCharge2(uint32 i); + void EffectChargeDest(uint32 i); void EffectProspecting(uint32 i); void EffectMilling(uint32 i); void EffectRenamePet(uint32 i); @@ -460,7 +464,7 @@ class Spell void HandleThreatSpells(uint32 spellId); const SpellEntry * const m_spellInfo; - int32 m_currentBasePoints[3]; // cache SpellEntry::EffectBasePoints and use for set custom base points + int32 m_currentBasePoints[3]; // overrides SpellEntry::EffectBasePoints IMPORTANT: base points != points calculated Item* m_CastItem; uint64 m_castItemGUID; uint8 m_cast_count; @@ -642,8 +646,10 @@ class Spell void SpellDamageWeaponDmg(uint32 i); void SpellDamageHeal(uint32 i); + // effect helpers void GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0); void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *properties); + void CalculateJumpSpeeds(uint8 i, float dist, float & speedxy, float & speedz); SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue); // ------------------------------------------- @@ -769,14 +775,14 @@ namespace Trinity } } - #ifdef WIN32 + #ifdef _WIN32 template<> inline void Visit(CorpseMapType &) {} template<> inline void Visit(GameObjectMapType &) {} template<> inline void Visit(DynamicObjectMapType &) {} #endif }; - #ifndef WIN32 + #ifndef _WIN32 template<> inline void SpellNotifierCreatureAndPlayer::Visit(CorpseMapType&) {} template<> inline void SpellNotifierCreatureAndPlayer::Visit(GameObjectMapType&) {} template<> inline void SpellNotifierCreatureAndPlayer::Visit(DynamicObjectMapType&) {} diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 510fdccb98a..55a421b7a57 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -83,8 +83,9 @@ SpellMgr::SpellMgr() case SPELL_EFFECT_APPLY_AREA_AURA_OWNER: case SPELL_EFFECT_APPLY_AREA_AURA_RAID: case SPELL_EFFECT_CHARGE: + case SPELL_EFFECT_CHARGE_DEST: case SPELL_EFFECT_JUMP: - case SPELL_EFFECT_JUMP2: + case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: EffectTargetType[i] = SPELL_REQUIRE_CASTER; break; @@ -290,7 +291,7 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo) return (du->Duration[2] == -1) ? -1 : abs(du->Duration[2]); } -int32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offensive, bool *result) +uint32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offensive, bool *result) { // we assume that aura dispel chance is 100% on start // need formula for level difference based chance @@ -310,7 +311,9 @@ int32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offen if (result) *result = !roll_chance_i(resist_chance); - return resist_chance; + resist_chance = resist_chance < 0 ? 0 : resist_chance; + resist_chance = resist_chance > 100 ? 100 : resist_chance; + return 100 - resist_chance; } uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell * spell) @@ -750,20 +753,47 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con if (spellproto->Attributes & SPELL_ATTR_NEGATIVE_1) return false; - switch(spellId) + switch (spellproto->SpellFamilyName) { - //case 37675: // Chaos Blast removed from mangos - case 34700: // Allergic Reaction - case 61987: // Avenging Wrath Marker - case 61988: // Divine Shield exclude aura - case 50524: // Runic Power Feed - return false; - case 12042: // Arcane Power - case 30877: // Tag Murloc - return true; + case SPELLFAMILY_GENERIC: + switch (spellId) + { + case 34700: // Allergic Reaction + case 61987: // Avenging Wrath Marker + case 61988: // Divine Shield exclude aura + return false; + case 30877: // Tag Murloc + return true; + default: + break; + } + break; + case SPELLFAMILY_MAGE: + // Amplify Magic, Dampen Magic + if (spellproto->SpellFamilyFlags[0] == 0x00002000) + return true; + break; + case SPELLFAMILY_PRIEST: + switch (spellId) + { + case 64844: // Divine Hymn + case 64904: // Hymn of Hope + case 47585: // Dispersion + return true; + default: + break; + } + break; + case SPELLFAMILY_HUNTER: + // Aspect of the Viper + if (spellId == 34074) + return true; + break; + default: + break; } - switch(spellproto->Mechanic) + switch (spellproto->Mechanic) { case MECHANIC_IMMUNE_SHIELD: return true; @@ -809,16 +839,16 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con case SPELL_AURA_MOD_HEALING_PCT: case SPELL_AURA_MOD_HEALING_DONE: case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: - if (spellproto->CalculateSimpleValue(effIndex) < 0) + if (SpellMgr::CalculateSpellEffectAmount(spellproto, effIndex) < 0) return false; break; case SPELL_AURA_MOD_DAMAGE_TAKEN: // dependent from bas point sign (positive -> negative) - if (spellproto->CalculateSimpleValue(effIndex) > 0) + if (SpellMgr::CalculateSpellEffectAmount(spellproto, effIndex) > 0) return false; break; case SPELL_AURA_MOD_CRIT_PCT: case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: - if (spellproto->CalculateSimpleValue(effIndex) > 0) + if (SpellMgr::CalculateSpellEffectAmount(spellproto, effIndex) > 0) return true; // some expected positive spells have SPELL_ATTR_EX_NEGATIVE break; case SPELL_AURA_ADD_TARGET_TRIGGER: @@ -861,6 +891,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con case SPELL_AURA_PERIODIC_LEECH: case SPELL_AURA_MOD_STALKED: case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: + case SPELL_AURA_PREVENT_RESSURECTION: return false; case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also. // part of negative spell if casted at self (prevent cancel) @@ -896,7 +927,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con switch(spellproto->EffectMiscValue[effIndex]) { case SPELLMOD_COST: // dependent from bas point sign (negative -> positive) - if (spellproto->CalculateSimpleValue(effIndex) > 0) + if (SpellMgr::CalculateSpellEffectAmount(spellproto, effIndex) > 0) { if (!deep) { @@ -1142,7 +1173,7 @@ void SpellMgr::LoadSpellTargetPositions() // additional requirements if (spellInfo->Effect[i]==SPELL_EFFECT_BIND && spellInfo->EffectMiscValue[i]) { - uint32 area_id = MapManager::Instance().GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); + uint32 area_id = sMapMgr.GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); if (area_id != uint32(spellInfo->EffectMiscValue[i])) { sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], area_id); @@ -1781,6 +1812,80 @@ bool SpellMgr::IsSkillBonusSpell(uint32 spellId) const return false; } +bool SpellMgr::IsSkillTypeSpell(uint32 spellId, SkillType type) const +{ + SkillLineAbilityMapBounds bounds = GetSkillLineAbilityMapBounds(spellId); + + for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) + if (_spell_idx->second->skillId == uint32(type)) + return true; + + return false; +} + +// basepoints provided here have to be valid basepoints (use SpellMgr::CalculateSpellEffectBaseAmount) +int32 SpellMgr::CalculateSpellEffectAmount(SpellEntry const * spellEntry, uint8 effIndex, Unit const * caster, int32 const * effBasePoints, Unit const * target) +{ + float basePointsPerLevel = spellEntry->EffectRealPointsPerLevel[effIndex]; + int32 basePoints = effBasePoints ? *effBasePoints : spellEntry->EffectBasePoints[effIndex]; + int32 randomPoints = int32(spellEntry->EffectDieSides[effIndex]); + + // base amount modification based on spell lvl vs caster lvl + if (caster) + { + int32 level = int32(caster->getLevel()); + if (level > int32(spellEntry->maxLevel) && spellEntry->maxLevel > 0) + level = int32(spellEntry->maxLevel); + else if (level < int32(spellEntry->baseLevel)) + level = int32(spellEntry->baseLevel); + level -= int32(spellEntry->spellLevel); + basePoints += int32(level * basePointsPerLevel); + } + + // roll in a range <1;EffectDieSides> as of patch 3.3.3 + switch(randomPoints) + { + case 0: // not used + case 1: basePoints += 1; break; // range 1..1 + default: + // range can have positive (1..rand) and negative (rand..1) values, so order its for irand + int32 randvalue = (randomPoints >= 1) + ? irand(1, randomPoints) + : irand(randomPoints, 1); + + basePoints += randvalue; + break; + } + + int32 value = basePoints; + + // random damage + if (caster) + { + // bonus amount from combo points + if (caster->m_movedPlayer) + if (uint8 comboPoints = caster->m_movedPlayer->GetComboPoints()) + if (float comboDamage = spellEntry->EffectPointsPerComboPoint[effIndex]) + value += int32(comboDamage * comboPoints); + + value = caster->ApplyEffectModifiers(spellEntry, effIndex, value); + + // amount multiplication based on caster's level + if (!basePointsPerLevel && (spellEntry->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellEntry->spellLevel) && + spellEntry->Effect[effIndex] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && + spellEntry->Effect[effIndex] != SPELL_EFFECT_KNOCK_BACK && + spellEntry->EffectApplyAuraName[effIndex] != SPELL_AURA_MOD_SPEED_ALWAYS && + spellEntry->EffectApplyAuraName[effIndex] != SPELL_AURA_MOD_SPEED_NOT_STACK && + spellEntry->EffectApplyAuraName[effIndex] != SPELL_AURA_MOD_INCREASE_SPEED && + spellEntry->EffectApplyAuraName[effIndex] != SPELL_AURA_MOD_DECREASE_SPEED) + //there are many more: slow speed, -healing pct + value = int32(value*0.25f*exp(caster->getLevel()*(70-spellEntry->spellLevel)/1000.0f)); + //value = int32(value * (int32)getLevel() / (int32)(spellProto->spellLevel ? spellProto->spellLevel : 1)); + } + + return value; +} + SpellEntry const* SpellMgr::SelectAuraRankForPlayerLevel(SpellEntry const* spellInfo, uint32 playerLevel) const { // ignore passive spells @@ -1843,7 +1948,7 @@ void SpellMgr::LoadSpellLearnSkills() { SpellLearnSkillNode dbc_node; dbc_node.skill = entry->EffectMiscValue[i]; - dbc_node.step = entry->CalculateSimpleValue(i); + dbc_node.step = SpellMgr::CalculateSpellEffectAmount(entry, i); if (dbc_node.skill != SKILL_RIDING) dbc_node.value = 1; else @@ -2030,7 +2135,7 @@ void SpellMgr::LoadSpellPetAuras() continue; } - PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[eff] == TARGET_UNIT_PET, spellInfo->CalculateSimpleValue(eff)); + PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[eff] == TARGET_UNIT_PET, SpellMgr::CalculateSpellEffectAmount(spellInfo, eff)); mSpellPetAuraMap[(spell<<8) + eff] = pa; } @@ -2847,38 +2952,38 @@ int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellEntry cons { // Wyvern Sting if (spellproto->SpellFamilyFlags[1] & 0x1000) - return 6 * IN_MILISECONDS; + return 6 * IN_MILLISECONDS; // Hunter's Mark if (spellproto->SpellFamilyFlags[0] & 0x400) - return 120 * IN_MILISECONDS; + return 120 * IN_MILLISECONDS; break; } case SPELLFAMILY_PALADIN: { // Repentance - limit to 6 seconds in PvP if (spellproto->SpellFamilyFlags[0] & 0x4) - return 6 * IN_MILISECONDS; + return 6 * IN_MILLISECONDS; break; } case SPELLFAMILY_DRUID: { // Faerie Fire - limit to 40 seconds in PvP (3.1) if (spellproto->SpellFamilyFlags[0] & 0x400) - return 40 * IN_MILISECONDS; + return 40 * IN_MILLISECONDS; break; } case SPELLFAMILY_PRIEST: { // Vampiric Embrace - limit to 60 seconds in PvP (3.1) if ((spellproto->SpellFamilyFlags[0] & 0x4) && spellproto->SpellIconID == 150) - return 60 * IN_MILISECONDS; + return 60 * IN_MILLISECONDS; break; } default: break; } - return 10 * IN_MILISECONDS; + return 10 * IN_MILLISECONDS; } bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group) @@ -2974,7 +3079,13 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 switch(spellId) { case 58600: // No fly Zone - Dalaran (Krasus Landing exception) - if (!player || player->GetAreaId() == 4564 || !player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY) || player->HasAura(44795)) + if (!player) + return false; + + AreaTableEntry const* pArea = GetAreaEntryByAreaID(player->GetAreaId()); + if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE)) + return false; + if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY) || player->HasAura(44795)) return false; break; } @@ -3018,6 +3129,7 @@ bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *sp { // DOT or HOT from different casters will stack case SPELL_AURA_PERIODIC_DAMAGE: + case SPELL_AURA_PERIODIC_DUMMY: case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_PERIODIC_TRIGGER_SPELL: case SPELL_AURA_PERIODIC_ENERGIZE: @@ -3350,8 +3462,9 @@ void SpellMgr::LoadSpellCustomAttr() count++; break; case SPELL_EFFECT_CHARGE: + case SPELL_EFFECT_CHARGE_DEST: case SPELL_EFFECT_JUMP: - case SPELL_EFFECT_JUMP2: + case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: if (!spellInfo->speed && !spellInfo->SpellFamilyName) spellInfo->speed = SPEED_CHARGE; @@ -3505,6 +3618,12 @@ void SpellMgr::LoadSpellCustomAttr() case 39365: // Thundering Storm case 41071: // Raise Dead (HACK) case 52124: // Sky Darkener Assault + case 42442: // Vengeance Landing Cannonfire + case 45863: // Cosmetic - Incinerate to Random Target + case 25425: // Shoot + case 45761: // Shoot + case 42611: // Shoot + case 62374: // Pursued spellInfo->MaxAffectedTargets = 1; count++; break; @@ -3526,6 +3645,8 @@ void SpellMgr::LoadSpellCustomAttr() case 54172: // Divine Storm (heal) case 29213: // Curse of the Plaguebringer - Noth case 28542: // Life Drain - Sapphiron + case 66588: // Flaming Spear + case 54171: // Divine Storm spellInfo->MaxAffectedTargets = 3; count++; break; @@ -3587,6 +3708,15 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->procCharges = 6; count++; break; + case 47201: // Everlasting Affliction + case 47202: + case 47203: + case 47204: + case 47205: + // add corruption to affected spells + spellInfo->EffectSpellClassMask[1][0] |= 2; + count++; + break; case 51852: // The Eye of Acherus (no spawn in phase 2 in db) spellInfo->EffectMiscValue[0] |= 1; count++; @@ -3650,10 +3780,6 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->rangeIndex = 13; count++; break; - case 62374: // Pursued - spellInfo->MaxAffectedTargets = 1; - count++; - break; case 48743: // Death Pact spellInfo->AttributesEx &= ~SPELL_ATTR_EX_CANT_TARGET_SELF; count++; @@ -3675,30 +3801,6 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->EffectMiscValue[0] = MECHANIC_IMMUNE_SHIELD; count++; break; - case 42442: // Vengeance Landing Cannonfire - spellInfo->MaxAffectedTargets = 1; - count++; - break; - case 45863: // Cosmetic - Incinerate to Random Target - spellInfo->MaxAffectedTargets = 1; - count++; - break; - case 25425: // Shoot - spellInfo->MaxAffectedTargets = 1; - count++; - break; - case 45761: // Shoot - spellInfo->MaxAffectedTargets = 1; - count++; - break; - case 42611: // Shoot - spellInfo->MaxAffectedTargets = 1; - count++; - break; - case 66588: // Flaming Spear - spellInfo->MaxAffectedTargets = 3; - count++; - break; case 53651: spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_NO_INITIAL_AGGRO; count++; @@ -3805,17 +3907,6 @@ void SpellMgr::LoadEnchantCustomAttr() sLog.outString(">> Loaded %u custom enchant attributes", count); } -bool SpellMgr::IsSkillTypeSpell(uint32 spellId, SkillType type) const -{ - SkillLineAbilityMapBounds bounds = GetSkillLineAbilityMapBounds(spellId); - - for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - if (_spell_idx->second->skillId == uint32(type)) - return true; - - return false; -} - void SpellMgr::LoadSpellLinked() { mSpellLinkedMap.clear(); // need for reload case diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 224760029e7..872a19a27f1 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -28,9 +28,9 @@ #include "SpellAuraDefines.h" #include "DBCStructure.h" #include "DBCStores.h" -#include "Database/SQLStorage.h" +#include "SQLStorage.h" -#include "Utilities/UnorderedMap.h" +#include "UnorderedMap.h" #include "Player.h" @@ -192,7 +192,7 @@ AuraState GetSpellAuraState(SpellEntry const * spellInfo); inline float GetSpellRadiusForHostile(SpellRadiusEntry const *radius) { return (radius ? radius->radiusHostile : 0); } inline float GetSpellRadiusForFriend(SpellRadiusEntry const *radius) { return (radius ? radius->radiusFriend : 0); } uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell * spell = NULL); -int32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offensive, bool *result); +uint32 GetDispelChance(Unit* auraCaster, Unit* target, uint32 spellId, bool offensive, bool *result); inline float GetSpellMinRangeForHostile(SpellRangeEntry const *range) { return (range ? range->minRangeHostile : 0); } inline float GetSpellMaxRangeForHostile(SpellRangeEntry const *range) { return (range ? range->maxRangeHostile : 0); } inline float GetSpellMinRangeForFriend(SpellRangeEntry const *range) { return (range ? range->minRangeFriend : 0); } @@ -1212,6 +1212,8 @@ class SpellMgr bool IsSkillBonusSpell(uint32 spellId) const; bool IsSkillTypeSpell(uint32 spellId, SkillType type) const; + static int32 CalculateSpellEffectAmount(SpellEntry const * spellEntry, uint8 effIndex, Unit const * caster = NULL, int32 const * basePoints = NULL, Unit const * target = NULL); + static int32 CalculateSpellEffectBaseAmount(int32 value) {return value-1;}; // Spell correctess for client using static bool IsSpellValid(SpellEntry const * spellInfo, Player* pl = NULL, bool msg = true); @@ -1322,21 +1324,20 @@ class SpellMgr } void SetSpellDifficultyId(uint32 spellId, uint32 id) { mSpellDifficultySearcherMap[spellId] = id; } - const SpellsRequiringSpellMap GetSpellsRequiringSpell() - { - return this->mSpellsReqSpell; - } + const SpellsRequiringSpellMap GetSpellsRequiringSpell() + { + return this->mSpellsReqSpell; + } - uint32 GetSpellRequired(uint32 spell_id) const - { - SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id); + uint32 GetSpellRequired(uint32 spell_id) const + { + SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id); - if (itr == mSpellReq.end()) - return NULL; - - return itr->second; - } + if (itr == mSpellReq.end()) + return NULL; + return itr->second; + } // Modifiers public: diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 8ebcbce50c8..964e7f9b3b1 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -20,8 +20,8 @@ #include "Common.h" #include "PlayerDump.h" -#include "Database/DatabaseEnv.h" -#include "Database/SQLStorage.h" +#include "DatabaseEnv.h" +#include "SQLStorage.h" #include "UpdateFields.h" #include "ObjectMgr.h" diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index d74f945fd5a..0bfb7f19345 100644 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -37,7 +37,7 @@ Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone m_type = WEATHER_TYPE_FINE; m_grade = 0; - sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILISECONDS))); + sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS))); } /// Launch a weather update diff --git a/src/server/game/World/TimeMgr.cpp b/src/server/game/World/TimeMgr.cpp deleted file mode 100644 index 42ecc77bbf9..00000000000 --- a/src/server/game/World/TimeMgr.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "TimeMgr.h" -#include "Policies/SingletonImp.h" - -INSTANTIATE_SINGLETON_1(GameTime); - -bool PeriodicTimer::Update(const uint32 &diff) -{ - if((i_expireTime -= diff) > 0) - return false; - - i_expireTime += i_period > diff ? i_period : diff; - return true; -} - -void PeriodicTimer::SetPeriodic(int32 period, int32 start_time) -{ - i_expireTime=start_time, i_period=period; -} diff --git a/src/server/game/World/TimeMgr.h b/src/server/game/World/TimeMgr.h deleted file mode 100644 index 5776bb1151c..00000000000 --- a/src/server/game/World/TimeMgr.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _TIMEMGR_H -#define _TIMEMGR_H - -#include "Timer.h" -#include "Policies/Singleton.h" - -struct IntervalTimer -{ - public: - IntervalTimer() : _interval(0), _current(0) {} - - void Update(time_t diff) { _current += diff; if(_current<0) _current=0;} - bool Passed() { return _current >= _interval; } - void Reset() { if(_current >= _interval) _current -= _interval; } - - void SetCurrent(time_t current) { _current = current; } - void SetInterval(time_t interval) { _interval = interval; } - time_t GetInterval() const { return _interval; } - time_t GetCurrent() const { return _current; } - - private: - time_t _interval; - time_t _current; -}; - -template struct TimeTrack -{ - public: - TimeTrack(T expire) : i_expireTime(expire) {} - void Update(T diff) { i_expireTime -= diff; } - bool Passed(void) const { return (i_expireTime <= 0); } - void Reset(T interval) { i_expireTime = interval; } - T GetExpireTime(void) const { return i_expireTime; } - private: - T i_expireTime; -}; - -typedef TimeTrack TimeTracker; -typedef TimeTrack TimeTrackerSmall; - -struct PeriodicTimer -{ - public: - PeriodicTimer(int32 period, int32 start_time) : - i_expireTime(start_time), i_period(period) {} - - bool Update(const uint32 &diff); - void SetPeriodic(int32 period, int32 start_time); - - private: - int32 i_period; - int32 i_expireTime; -}; - -class GameTime -{ - public: - /// When server started? - time_t const& GetStartTime() const { return m_startTime; } - /// What time is it? - time_t const& GetGameTime() const { return m_gameTime; } - /// Uptime (in secs) - uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); } - - void SetGameTime(void) { m_gameTime = time(NULL); } - void SetStartTime(void){ m_startTime = time(NULL); } - private: - time_t m_gameTime; - time_t m_startTime; -}; - -#define sGameTime Trinity::Singleton::Instance() - -#endif diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 0b00621dc72..05065140c35 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -23,8 +23,8 @@ */ #include "Common.h" -#include "Database/DatabaseEnv.h" -#include "Config/ConfigEnv.h" +#include "DatabaseEnv.h" +#include "ConfigEnv.h" #include "SystemConfig.h" #include "Log.h" #include "Opcodes.h" @@ -48,7 +48,6 @@ #include "ItemEnchantmentMgr.h" #include "MapManager.h" #include "CreatureAIRegistry.h" -#include "Policies/SingletonImp.h" #include "BattleGroundMgr.h" #include "OutdoorPvPMgr.h" #include "TemporarySummon.h" @@ -57,23 +56,21 @@ #include "VMapFactory.h" #include "GlobalEvents.h" #include "GameEventMgr.h" -#include "PoolHandler.h" -#include "Database/DatabaseImpl.h" +#include "PoolMgr.h" +#include "DatabaseImpl.h" #include "GridNotifiersImpl.h" #include "CellImpl.h" #include "InstanceSaveMgr.h" #include "Util.h" #include "Language.h" #include "CreatureGroups.h" -#include "Transports.h" +#include "Transport.h" #include "ProgressBar.h" #include "ScriptMgr.h" #include "AddonMgr.h" #include "LFGMgr.h" #include "ConditionMgr.h" -INSTANTIATE_SINGLETON_1(World); - volatile bool World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; volatile uint32 World::m_worldLoopCounter = 0; @@ -142,7 +139,7 @@ World::~World() VMAP::VMapFactory::clear(); - if (m_resultQueue) delete m_resultQueue; + delete m_resultQueue; //TODO free addSessQueue } @@ -316,17 +313,18 @@ int32 World::GetQueuePos(WorldSession* sess) void World::AddQueuedPlayer(WorldSession* sess) { sess->SetInQueue(true); - m_QueuedPlayer.push_back (sess); + m_QueuedPlayer.push_back(sess); // The 1st SMSG_AUTH_RESPONSE needs to contain other info too. - WorldPacket packet (SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 1); - packet << uint8 (AUTH_WAIT_QUEUE); - packet << uint32 (0); // BillingTimeRemaining - packet << uint8 (0); // BillingPlanFlags - packet << uint32 (0); // BillingTimeRested - packet << uint8 (sess->Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account - packet << uint32(GetQueuePos (sess)); - sess->SendPacket (&packet); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1+4+1+4+1); + packet << uint8(AUTH_WAIT_QUEUE); + packet << uint32(0); // BillingTimeRemaining + packet << uint8(0); // BillingPlanFlags + packet << uint32(0); // BillingTimeRested + packet << uint8(sess->Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account + packet << uint32(GetQueuePos(sess)); // Queue position + packet << uint8(0); // Unk 3.3.0 + sess->SendPacket(&packet); //sess->SendAuthWaitQue (GetQueuePos (sess)); } @@ -616,7 +614,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_MAIL_LEVEL_REQ] = sConfig.GetIntDefault("LevelReq.Mail", 1); m_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = sConfig.GetBoolDefault("AllowPlayerCommands", 1); m_configs[CONFIG_GRID_UNLOAD] = sConfig.GetBoolDefault("GridUnload", true); - m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILISECONDS); + m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); m_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfig.GetIntDefault("DisconnectToleranceInterval", 0); m_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfig.GetBoolDefault("PlayerSave.Stats.SaveOnlyOnLogout", true); @@ -627,14 +625,14 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0; } - m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILISECONDS); + m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS); if (m_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY) { sLog.outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.",m_configs[CONFIG_INTERVAL_GRIDCLEAN],MIN_GRID_DELAY); m_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY; } if (reload) - MapManager::Instance().SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]); + sMapMgr.SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]); m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100); if (m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) @@ -643,15 +641,15 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; } if (reload) - MapManager::Instance().SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]); + sMapMgr.SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]); - m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS); + m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); if (reload) { uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT); if (val != m_configs[CONFIG_PORT_WORLD]) - sLog.outError("WorldServerPort option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]); + sLog.outError("WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]); } else m_configs[CONFIG_PORT_WORLD] = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT); @@ -660,7 +658,7 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); if (val != m_configs[CONFIG_SOCKET_SELECTTIME]) - sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]); + sLog.outError("SocketSelectTime option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]); } else m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); @@ -669,7 +667,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_SESSION_ADD_DELAY] = sConfig.GetIntDefault("SessionAddDelay", 10000); m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74); - /// \todo Add MonsterSight and GuarderSight (with meaning) in Trinityd.conf or put them as define + /// \todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50); m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 50); @@ -677,7 +675,7 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig.GetIntDefault("GameType", 0); if (val != m_configs[CONFIG_GAME_TYPE]) - sLog.outError("GameType option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]); + sLog.outError("GameType option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]); } else m_configs[CONFIG_GAME_TYPE] = sConfig.GetIntDefault("GameType", 0); @@ -686,7 +684,7 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); if (val != m_configs[CONFIG_REALM_ZONE]) - sLog.outError("RealmZone option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]); + sLog.outError("RealmZone option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]); } else m_configs[CONFIG_REALM_ZONE] = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); @@ -865,7 +863,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_CAST_UNSTUCK] = sConfig.GetBoolDefault("CastUnstuck", true); m_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig.GetIntDefault("Instance.ResetTimeHour", 4); - m_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILISECONDS); + m_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); m_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig.GetIntDefault("MaxPrimaryTradeSkill", 2); m_configs[CONFIG_MIN_PETITION_SIGNS] = sConfig.GetIntDefault("MinPetitionSigns", 9); @@ -913,7 +911,7 @@ void World::LoadConfigSettings(bool reload) } if (reload) { - m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS); + m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILLISECONDS); m_timers[WUPDATE_UPTIME].Reset(); } @@ -926,7 +924,7 @@ void World::LoadConfigSettings(bool reload) } if (reload) { - m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILISECONDS); + m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILLISECONDS); m_timers[WUPDATE_CLEANDB].Reset(); } m_configs[CONFIG_LOGDB_CLEARTIME] = sConfig.GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default @@ -990,7 +988,7 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig.GetIntDefault("Expansion",1); if (val != m_configs[CONFIG_EXPANSION]) - sLog.outError("Expansion option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]); + sLog.outError("Expansion option can't be changed at worldserver.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]); } else m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",1); @@ -1015,6 +1013,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfig.GetIntDefault("Quests.HighLevelHideDiff", 7); if (m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL) m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL; + m_configs[CONFIG_QUEST_IGNORE_RAID] = sConfig.GetBoolDefault("Quests.IgnoreRaid", false); m_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfig.GetIntDefault("BattleGround.Random.ResetHour", 6); if (m_configs[CONFIG_RANDOM_BG_RESET_HOUR] < 0 || m_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23) @@ -1061,11 +1060,11 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", false); m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); m_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfig.GetIntDefault ("Battleground.InvitationType", 0); - m_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault ("BattleGround.PrematureFinishTimer", 5 * MINUTE * IN_MILISECONDS); - m_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfig.GetIntDefault ("BattleGround.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILISECONDS); + m_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault ("BattleGround.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); + m_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfig.GetIntDefault ("BattleGround.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); m_configs[CONFIG_BG_XP_FOR_KILL] = sConfig.GetBoolDefault("Battleground.GiveXPForKills", false); m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault ("Arena.MaxRatingDifference", 150); - m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILISECONDS); + m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig.GetBoolDefault("Arena.AutoDistributePoints", false); m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig.GetIntDefault ("Arena.AutoDistributeInterval", 7); m_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Arena.QueueAnnouncer.Enable", false); @@ -1180,7 +1179,7 @@ void World::LoadConfigSettings(bool reload) if (reload) { if (dataPath != m_dataPath) - sLog.outError("DataDir option can't be changed at Trinityd.conf reload, using current value (%s).",m_dataPath.c_str()); + sLog.outError("DataDir option can't be changed at worldserver.conf reload, using current value (%s).",m_dataPath.c_str()); } else { @@ -1273,7 +1272,7 @@ void World::SetInitialWorldSettings() ||m_configs[CONFIG_EXPANSION] && ( !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f))) { - sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the Trinityd.conf file.",m_dataPath.c_str(),m_dataPath.c_str()); + sLog.outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.",m_dataPath.c_str(),m_dataPath.c_str()); exit(1); } @@ -1319,6 +1318,7 @@ void World::SetInitialWorldSettings() objmgr.LoadCreatureLocales(); objmgr.LoadGameObjectLocales(); objmgr.LoadItemLocales(); + objmgr.LoadItemSetNameLocales(); objmgr.LoadQuestLocales(); objmgr.LoadNpcTextLocales(); objmgr.LoadPageTextLocales(); @@ -1331,7 +1331,7 @@ void World::SetInitialWorldSettings() sLog.outString("Loading Page Texts..."); objmgr.LoadPageTexts(); - sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts + sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts objmgr.LoadGameobjectInfo(); sLog.outString("Loading Spell Rank Data..."); @@ -1370,9 +1370,12 @@ void World::SetInitialWorldSettings() sLog.outString("Loading Item Random Enchantments Table..."); LoadRandomEnchantmentsTable(); - sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts + sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts objmgr.LoadItemPrototypes(); + sLog.outString("Loading Item set names..."); // must be after LoadItemPrototypes + objmgr.LoadItemSetNames(); + sLog.outString("Loading Creature Model Based Info Data..."); objmgr.LoadCreatureModelInfo(); @@ -1407,15 +1410,15 @@ void World::SetInitialWorldSettings() objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() sLog.outString("Loading Vehicle Accessories..."); - objmgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates() + objmgr.LoadVehicleAccessories(); // must be after LoadCreatureTemplates() - sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances() + sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances() objmgr.LoadCreatureRespawnTimes(); sLog.outString("Loading Gameobject Data..."); objmgr.LoadGameobjects(); - sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances() + sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances() objmgr.LoadGameobjectRespawnTimes(); sLog.outString("Loading Objects Pooling Data..."); @@ -1439,7 +1442,7 @@ void World::SetInitialWorldSettings() sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); objmgr.LoadNPCSpellClickSpells(); - sLog.outString("Loading SpellArea Data..."); // must be after quest load + sLog.outString("Loading SpellArea Data..."); // must be after quest load spellmgr.LoadSpellAreas(); sLog.outString("Loading AreaTrigger definitions..."); @@ -1602,7 +1605,7 @@ void World::SetInitialWorldSettings() sLog.outString(">>> Scripts loaded"); sLog.outString(); - sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls + sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls objmgr.LoadDbScriptStrings(); sLog.outString("Loading CreatureEventAI Texts..."); @@ -1635,24 +1638,24 @@ void World::SetInitialWorldSettings() static uint32 abtimer = 0; abtimer = sConfig.GetIntDefault("AutoBroadcast.Timer", 60000); - m_timers[WUPDATE_OBJECTS].SetInterval(IN_MILISECONDS/2); + m_timers[WUPDATE_OBJECTS].SetInterval(IN_MILLISECONDS/2); m_timers[WUPDATE_SESSIONS].SetInterval(0); - m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILISECONDS); - m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILISECONDS); - m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS); + m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS); + m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS); + m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILLISECONDS); //Update "uptime" table based on configuration entry in minutes. - m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*IN_MILISECONDS); + m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*IN_MILLISECONDS); //erase corpses every 20 minutes - m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL]*MINUTE*IN_MILISECONDS); + m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL]*MINUTE*IN_MILLISECONDS); // clean logs table every 14 days by default m_timers[WUPDATE_AUTOBROADCAST].SetInterval(abtimer); //to set mailtimer to return mails every day between 4 and 5 am //mailtimer is increased when updating auctions //one second is 1000 -(tested on win system) - mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval()); + mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval()); //1440 - mail_timer_expires = ((DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval())); + mail_timer_expires = ((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval())); sLog.outDebug("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires); ///- Initilize static helper structures @@ -1661,7 +1664,7 @@ void World::SetInitialWorldSettings() ///- Initialize MapManager sLog.outString("Starting Map System"); - MapManager::Instance().Initialize(); + sMapMgr.Initialize(); sLog.outString("Starting Game Event system..."); uint32 nextGameEvent = gameeventmgr.Initialize(); @@ -1670,7 +1673,7 @@ void World::SetInitialWorldSettings() sLog.outString("Starting Arena Season..."); gameeventmgr.StartArenaSeason(); - sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP + sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP LoadWorldStates(); ///- Initialize Looking For Group @@ -1688,10 +1691,7 @@ void World::SetInitialWorldSettings() //Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager sLog.outString("Loading Transports..."); - MapManager::Instance().LoadTransports(); - - sLog.outString("Loading Transports Events..."); - objmgr.LoadTransportEvents(); + sMapMgr.LoadTransports(); sLog.outString("Deleting expired bans..."); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); @@ -1943,12 +1943,12 @@ void World::Update(uint32 diff) ///
  • Handle all other objects ///- Update objects when the timer has passed (maps, transport, creatures,...) - MapManager::Instance().Update(diff); // As interval = 0 + sMapMgr.Update(diff); // As interval = 0 /*if (m_timers[WUPDATE_OBJECTS].Passed()) { m_timers[WUPDATE_OBJECTS].Reset(); - MapManager::Instance().DoDelayedMovesAndRemoves(); + sMapMgr.DoDelayedMovesAndRemoves(); }*/ static uint32 autobroadcaston = 0; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 1a95253fa03..07d7d3c51db 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -27,7 +27,7 @@ #include "Common.h" #include "Timer.h" -#include "Policies/Singleton.h" +#include #include "SharedDefines.h" #include "ace/Atomic_Op.h" #include "QueryResult.h" @@ -188,6 +188,7 @@ enum WorldConfigs CONFIG_WORLD_BOSS_LEVEL_DIFF, CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF, CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF, + CONFIG_QUEST_IGNORE_RAID, CONFIG_DETECT_POS_COLLISION, CONFIG_RESTRICTED_LFG_CHANNEL, CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL, @@ -779,6 +780,6 @@ class World extern uint32 realmID; -#define sWorld Trinity::Singleton::Instance() +#define sWorld (*ACE_Singleton::instance()) #endif /// @} diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index d29670e4fc9..1c55955c777 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -1,629 +1,119 @@ -# Enable precompiled headers when using the GCC compiler. -IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -SET(scripts_STAT_SRCS - ../game/ScriptMgr/ScriptedPch.cpp - ../game/ScriptMgr/ScriptedPch.h - ../game/AI/ScriptedAI/ScriptedEscortAI.cpp - ../game/AI/ScriptedAI/ScriptedEscortAI.h - ../game/AI/ScriptedAI/ScriptedCreature.cpp - ../game/AI/ScriptedAI/ScriptedCreature.h - ../game/AI/ScriptedAI/ScriptedFollowerAI.cpp - ../game/AI/ScriptedAI/ScriptedFollowerAI.h - ../game/AI/ScriptedAI/ScriptedGossip.h - ../game/AI/ScriptedAI/ScriptedGuardAI.cpp - ../game/AI/ScriptedAI/ScriptedGuardAI.h - ../game/AI/ScriptedAI/ScriptedInstance.h - ../game/AI/ScriptedAI/ScriptedSimpleAI.cpp - ../game/AI/ScriptedAI/ScriptedSimpleAI.h - custom/on_events.cpp - eastern_kingdoms/alterac_valley/alterac_valley.cpp - eastern_kingdoms/alterac_valley/boss_balinda.cpp - eastern_kingdoms/alterac_valley/boss_drekthar.cpp - eastern_kingdoms/alterac_valley/boss_galvangar.cpp - eastern_kingdoms/alterac_valley/boss_vanndar.cpp - eastern_kingdoms/blackrock_depths/blackrock_depths.cpp - eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp - eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp - eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp - eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp - eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp - eastern_kingdoms/blackrock_depths/boss_grizzle.cpp - eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp - eastern_kingdoms/blackrock_depths/boss_magmus.cpp - eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp - eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp - eastern_kingdoms/blackrock_depths/blackrock_depths.h - eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp - eastern_kingdoms/blackrock_spire/blackrock_spire.cpp - eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp - eastern_kingdoms/blackrock_spire/boss_gyth.cpp - eastern_kingdoms/blackrock_spire/boss_halycon.cpp - eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp - eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp - eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp - eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp - eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp - eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp - eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp - eastern_kingdoms/blackrock_spire/boss_the_beast.cpp - eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp - eastern_kingdoms/blackrock_spire/blackrock_spire.h - eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp - eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp - eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp - eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp - eastern_kingdoms/blackwing_lair/boss_firemaw.cpp - eastern_kingdoms/blackwing_lair/boss_flamegor.cpp - eastern_kingdoms/blackwing_lair/boss_nefarian.cpp - eastern_kingdoms/blackwing_lair/boss_razorgore.cpp - eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp - eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp - eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp - eastern_kingdoms/deadmines/boss_mr_smite.cpp - eastern_kingdoms/deadmines/deadmines.h - eastern_kingdoms/deadmines/deadmines.cpp - eastern_kingdoms/deadmines/instance_deadmines.cpp - eastern_kingdoms/gnomeregan/gnomeregan.h - eastern_kingdoms/gnomeregan/gnomeregan.cpp - eastern_kingdoms/gnomeregan/instance_gnomeregan.cpp - eastern_kingdoms/karazhan/boss_curator.cpp - eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp - eastern_kingdoms/karazhan/boss_midnight.cpp - eastern_kingdoms/karazhan/boss_moroes.cpp - eastern_kingdoms/karazhan/boss_netherspite.cpp - eastern_kingdoms/karazhan/boss_nightbane.cpp - eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp - eastern_kingdoms/karazhan/boss_shade_of_aran.cpp - eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp - eastern_kingdoms/karazhan/bosses_opera.cpp - eastern_kingdoms/karazhan/karazhan.h - eastern_kingdoms/karazhan/instance_karazhan.cpp - eastern_kingdoms/karazhan/karazhan.cpp - eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp - eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp - eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp - eastern_kingdoms/magisters_terrace/boss_vexallus.cpp - eastern_kingdoms/magisters_terrace/magisters_terrace.h - eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp - eastern_kingdoms/magisters_terrace/magisters_terrace.cpp - eastern_kingdoms/molten_core/boss_baron_geddon.cpp - eastern_kingdoms/molten_core/boss_garr.cpp - eastern_kingdoms/molten_core/boss_gehennas.cpp - eastern_kingdoms/molten_core/boss_golemagg.cpp - eastern_kingdoms/molten_core/boss_lucifron.cpp - eastern_kingdoms/molten_core/boss_magmadar.cpp - eastern_kingdoms/molten_core/boss_majordomo_executus.cpp - eastern_kingdoms/molten_core/boss_ragnaros.cpp - eastern_kingdoms/molten_core/boss_shazzrah.cpp - eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp - eastern_kingdoms/molten_core/molten_core.h - eastern_kingdoms/molten_core/instance_molten_core.cpp - eastern_kingdoms/molten_core/molten_core.cpp - eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp - eastern_kingdoms/scarlet_enclave/chapter1.cpp - eastern_kingdoms/scarlet_enclave/chapter2.cpp - eastern_kingdoms/scarlet_enclave/chapter5.cpp - eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp - eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp - eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp - eastern_kingdoms/scarlet_monastery/boss_herod.cpp - eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp - eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp - eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp - eastern_kingdoms/scarlet_monastery/boss_scorn.cpp - eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp - eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp - eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp - eastern_kingdoms/scarlet_monastery/scarlet_monastery.h - eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp - eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp - eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp - eastern_kingdoms/scholomance/boss_illucia_barov.cpp - eastern_kingdoms/scholomance/boss_instructor_malicia.cpp - eastern_kingdoms/scholomance/boss_jandice_barov.cpp - eastern_kingdoms/scholomance/boss_kormok.cpp - eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp - eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp - eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp - eastern_kingdoms/scholomance/boss_the_ravenian.cpp - eastern_kingdoms/scholomance/boss_vectus.cpp - eastern_kingdoms/scholomance/scholomance.h - eastern_kingdoms/scholomance/instance_scholomance.cpp - eastern_kingdoms/shadowfang_keep/shadowfang_keep.h - eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp - eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp - eastern_kingdoms/stratholme/boss_baron_rivendare.cpp - eastern_kingdoms/stratholme/boss_baroness_anastari.cpp - eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp - eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp - eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp - eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp - eastern_kingdoms/stratholme/boss_nerubenkan.cpp - eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp - eastern_kingdoms/stratholme/boss_postmaster_malown.cpp - eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp - eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp - eastern_kingdoms/stratholme/stratholme.h - eastern_kingdoms/stratholme/instance_stratholme.cpp - eastern_kingdoms/stratholme/stratholme.cpp - eastern_kingdoms/sunken_temple/sunken_temple.h - eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp - eastern_kingdoms/sunken_temple/sunken_temple.cpp - eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp - eastern_kingdoms/sunwell_plateau/boss_muru.cpp - eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp - eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp - eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp - eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp - eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp - eastern_kingdoms/sunwell_plateau/sunwell_plateau.h - eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp - eastern_kingdoms/uldaman/boss_archaedas.cpp - eastern_kingdoms/uldaman/instance_uldaman.cpp - eastern_kingdoms/uldaman/boss_ironaya.cpp - eastern_kingdoms/uldaman/uldaman.cpp - eastern_kingdoms/zulaman/boss_akilzon.cpp - eastern_kingdoms/zulaman/boss_halazzi.cpp - eastern_kingdoms/zulaman/boss_hexlord.cpp - eastern_kingdoms/zulaman/boss_janalai.cpp - eastern_kingdoms/zulaman/boss_nalorakk.cpp - eastern_kingdoms/zulaman/boss_zuljin.cpp - eastern_kingdoms/zulaman/zulaman.h - eastern_kingdoms/zulaman/instance_zulaman.cpp - eastern_kingdoms/zulaman/zulaman.cpp - eastern_kingdoms/zulgurub/boss_arlokk.cpp - eastern_kingdoms/zulgurub/boss_gahzranka.cpp - eastern_kingdoms/zulgurub/boss_grilek.cpp - eastern_kingdoms/zulgurub/boss_hakkar.cpp - eastern_kingdoms/zulgurub/boss_hazzarah.cpp - eastern_kingdoms/zulgurub/boss_jeklik.cpp - eastern_kingdoms/zulgurub/boss_jindo.cpp - eastern_kingdoms/zulgurub/boss_mandokir.cpp - eastern_kingdoms/zulgurub/boss_marli.cpp - eastern_kingdoms/zulgurub/boss_renataki.cpp - eastern_kingdoms/zulgurub/boss_thekal.cpp - eastern_kingdoms/zulgurub/boss_venoxis.cpp - eastern_kingdoms/zulgurub/boss_wushoolay.cpp - eastern_kingdoms/zulgurub/zulgurub.h - eastern_kingdoms/zulgurub/instance_zulgurub.cpp - eastern_kingdoms/alterac_mountains.cpp - eastern_kingdoms/arathi_highlands.cpp - eastern_kingdoms/blasted_lands.cpp - eastern_kingdoms/boss_kruul.cpp - eastern_kingdoms/burning_steppes.cpp - eastern_kingdoms/dun_morogh.cpp - eastern_kingdoms/duskwood.cpp - eastern_kingdoms/eastern_plaguelands.cpp - eastern_kingdoms/elwynn_forest.cpp - eastern_kingdoms/eversong_woods.cpp - eastern_kingdoms/ghostlands.cpp - eastern_kingdoms/hinterlands.cpp - eastern_kingdoms/ironforge.cpp - eastern_kingdoms/isle_of_queldanas.cpp - eastern_kingdoms/loch_modan.cpp - eastern_kingdoms/redridge_mountains.cpp - eastern_kingdoms/searing_gorge.cpp - eastern_kingdoms/silvermoon_city.cpp - eastern_kingdoms/silverpine_forest.cpp - eastern_kingdoms/stormwind_city.cpp - eastern_kingdoms/stranglethorn_vale.cpp - eastern_kingdoms/tirisfal_glades.cpp - eastern_kingdoms/undercity.cpp - eastern_kingdoms/western_plaguelands.cpp - eastern_kingdoms/westfall.cpp - eastern_kingdoms/wetlands.cpp - examples/example_creature.cpp - examples/example_escort.cpp - examples/example_gossip_codebox.cpp - examples/example_misc.cpp - kalimdor/blackfathom_depths/boss_gelihast.cpp - kalimdor/blackfathom_depths/boss_kelris.cpp - kalimdor/blackfathom_depths/boss_aku_mai.cpp - kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp - kalimdor/blackfathom_depths/blackfathom_deeps.cpp - kalimdor/blackfathom_depths/blackfathom_deeps.h - kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp - kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp - kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp - kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp - kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp - kalimdor/caverns_of_time/culling_of_stratholme/boss_infinite.cpp - kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp - kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h - kalimdor/caverns_of_time/dark_portal/dark_portal.h - kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp - kalimdor/caverns_of_time/dark_portal/dark_portal.cpp - kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp - kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp - kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp - kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp - kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp - kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp - kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp - kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp - kalimdor/caverns_of_time/hyjal/hyjal.h - kalimdor/caverns_of_time/hyjal/hyjal.cpp - kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp - kalimdor/caverns_of_time/hyjal/hyjal_trash.h - kalimdor/caverns_of_time/hyjal/hyjalAI.cpp - kalimdor/caverns_of_time/hyjal/hyjalAI.h - kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp - kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp - kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp - kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp - kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.h - kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp - kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp - kalimdor/maraudon/boss_celebras_the_cursed.cpp - kalimdor/maraudon/boss_landslide.cpp - kalimdor/maraudon/boss_noxxion.cpp - kalimdor/maraudon/boss_princess_theradras.cpp - kalimdor/onyxias_lair/boss_onyxia.cpp - kalimdor/onyxias_lair/instance_onyxias_lair.cpp - kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp - kalimdor/razorfen_downs/razorfen_downs.cpp - kalimdor/razorfen_downs/instance_razorfen_downs.cpp - kalimdor/razorfen_downs/razorfen_downs.h - kalimdor/razorfen_kraul/razorfen_kraul.h - kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp - kalimdor/razorfen_kraul/razorfen_kraul.cpp - kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp - kalimdor/ruins_of_ahnqiraj/boss_buru.cpp - kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp - kalimdor/ruins_of_ahnqiraj/boss_moam.cpp - kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp - kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp - kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h - kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp - kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp - kalimdor/temple_of_ahnqiraj/boss_cthun.cpp - kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp - kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp - kalimdor/temple_of_ahnqiraj/boss_ouro.cpp - kalimdor/temple_of_ahnqiraj/boss_sartura.cpp - kalimdor/temple_of_ahnqiraj/boss_skeram.cpp - kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp - kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp - kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.h - kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp - kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp - kalimdor/wailing_caverns/wailing_caverns.h - kalimdor/wailing_caverns/instance_wailing_caverns.cpp - kalimdor/wailing_caverns/wailing_caverns.cpp - kalimdor/zulfarrak/zulfarrak.cpp - kalimdor/zulfarrak/instance_zulfarrak.cpp - kalimdor/ashenvale.cpp - kalimdor/azshara.cpp - kalimdor/azuremyst_isle.cpp - kalimdor/bloodmyst_isle.cpp - kalimdor/boss_azuregos.cpp - kalimdor/darkshore.cpp - kalimdor/desolace.cpp - kalimdor/durotar.cpp - kalimdor/dustwallow_marsh.cpp - kalimdor/felwood.cpp - kalimdor/feralas.cpp - kalimdor/moonglade.cpp - kalimdor/mulgore.cpp - kalimdor/orgrimmar.cpp - kalimdor/silithus.cpp - kalimdor/stonetalon_mountains.cpp - kalimdor/tanaris.cpp - kalimdor/teldrassil.cpp - kalimdor/the_barrens.cpp - kalimdor/thousand_needles.cpp - kalimdor/thunder_bluff.cpp - kalimdor/ungoro_crater.cpp - kalimdor/winterspring.cpp - northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp - northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp - northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp - northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp - northrend/azjol_nerub/azjol_nerub/azjol_nerub.h - northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp - northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp - northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp - northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp - northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp - northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp - northrend/azjol_nerub/ahnkahet/ahnkahet.h - northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp - northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp - northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp - northrend/crusaders_coliseum/trial_of_the_champion/instance_trial_of_the_champion.cpp - northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp - northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.h - northrend/draktharon_keep/instance_drak_tharon_keep.cpp - northrend/draktharon_keep/boss_trollgore.cpp - northrend/draktharon_keep/boss_novos.cpp - northrend/draktharon_keep/boss_dred.cpp - northrend/draktharon_keep/boss_tharon_ja.cpp - northrend/draktharon_keep/drak_tharon_keep.h - northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp - northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp - northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp - northrend/frozen_halls/forge_of_souls/forge_of_souls.h - northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp - northrend/frozen_halls/halls_of_reflection/boss_falric.cpp - northrend/frozen_halls/halls_of_reflection/boss_marwyn.cpp - northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp - northrend/frozen_halls/halls_of_reflection/halls_of_reflection.cpp - northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h - northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp - northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp - northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp - northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp - northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp - northrend/frozen_halls/pit_of_saron/pit_of_saron.h - northrend/gundrak/instance_gundrak.cpp - northrend/gundrak/boss_slad_ran.cpp - northrend/gundrak/boss_moorabi.cpp - northrend/gundrak/boss_drakkari_colossus.cpp - northrend/gundrak/boss_gal_darah.cpp - northrend/gundrak/boss_eck.cpp - northrend/gundrak/gundrak.h - northrend/naxxramas/boss_anubrekhan.cpp - northrend/naxxramas/boss_faerlina.cpp - northrend/naxxramas/boss_gluth.cpp - northrend/naxxramas/boss_gothik.cpp - northrend/naxxramas/boss_grobbulus.cpp - northrend/naxxramas/boss_heigan.cpp - northrend/naxxramas/boss_kelthuzad.cpp - northrend/naxxramas/boss_four_horsemen.cpp - northrend/naxxramas/boss_loatheb.cpp - northrend/naxxramas/boss_maexxna.cpp - northrend/naxxramas/boss_noth.cpp - northrend/naxxramas/boss_patchwerk.cpp - northrend/naxxramas/boss_razuvious.cpp - northrend/naxxramas/boss_sapphiron.cpp - northrend/naxxramas/boss_thaddius.cpp - northrend/naxxramas/naxxramas.h - northrend/naxxramas/instance_naxxramas.cpp - northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp - northrend/nexus/eye_of_eternity/boss_malygos.cpp - northrend/nexus/eye_of_eternity/eye_of_eternity.h - northrend/nexus/nexus/instance_nexus.cpp - northrend/nexus/nexus/boss_magus_telestra.cpp - northrend/nexus/nexus/boss_anomalus.cpp - northrend/nexus/nexus/boss_ormorok.cpp - northrend/nexus/nexus/boss_keristrasza.cpp - northrend/nexus/nexus/commander_stoutbeard.cpp - northrend/nexus/nexus/commander_kolurg.cpp - northrend/nexus/nexus/nexus.h - northrend/nexus/oculus/instance_oculus.cpp - northrend/nexus/oculus/boss_drakos.cpp - northrend/nexus/oculus/boss_urom.cpp - northrend/nexus/oculus/boss_varos.cpp - northrend/nexus/oculus/boss_eregos.cpp - northrend/nexus/oculus/oculus.h - northrend/nexus/oculus/oculus.cpp - northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp - northrend/obsidian_sanctum/boss_sartharion.cpp - northrend/obsidian_sanctum/obsidian_sanctum.h - northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp - northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp - northrend/ulduar/halls_of_stone/boss_krystallus.cpp - northrend/ulduar/halls_of_stone/boss_sjonnir.cpp - northrend/ulduar/halls_of_stone/halls_of_stone.h - northrend/ulduar/halls_of_stone/halls_of_stone.cpp - northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp - northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp - northrend/ulduar/halls_of_lightning/boss_ionar.cpp - northrend/ulduar/halls_of_lightning/boss_volkhan.cpp - northrend/ulduar/halls_of_lightning/boss_loken.cpp - northrend/ulduar/halls_of_lightning/halls_of_lightning.h - northrend/ulduar/ulduar/boss_algalon.cpp - northrend/ulduar/ulduar/boss_assembly_of_iron.cpp - northrend/ulduar/ulduar/boss_auriaya.cpp - northrend/ulduar/ulduar/boss_flame_leviathan.cpp - northrend/ulduar/ulduar/boss_freya.cpp - northrend/ulduar/ulduar/boss_general_vezax.cpp - northrend/ulduar/ulduar/boss_hodir.cpp - northrend/ulduar/ulduar/boss_ignis.cpp - northrend/ulduar/ulduar/boss_kologarn.cpp - northrend/ulduar/ulduar/boss_mimiron.cpp - northrend/ulduar/ulduar/boss_razorscale.cpp - northrend/ulduar/ulduar/boss_thorim.cpp - northrend/ulduar/ulduar/boss_xt002.cpp - northrend/ulduar/ulduar/boss_yoggsaron.cpp - northrend/ulduar/ulduar/ulduar_teleporter.cpp - northrend/ulduar/ulduar/ulduar.h - northrend/ulduar/ulduar/instance_ulduar.cpp - northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp - northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp - northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp - northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp - northrend/utgarde_keep/utgarde_keep/utgarde_keep.h - northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp - northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp - northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp - northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp - northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp - northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp - northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h - northrend/vault_of_archavon/instance_vault_of_archavon.cpp - northrend/vault_of_archavon/boss_archavon.cpp - northrend/vault_of_archavon/boss_emalon.cpp - northrend/vault_of_archavon/boss_koralon.cpp - northrend/vault_of_archavon/boss_toravon.cpp - northrend/vault_of_archavon/vault_of_archavon.h - northrend/violet_hold/instance_violet_hold.cpp - northrend/violet_hold/boss_cyanigosa.cpp - northrend/violet_hold/boss_erekem.cpp - northrend/violet_hold/boss_ichoron.cpp - northrend/violet_hold/boss_lavanthor.cpp - northrend/violet_hold/boss_moragg.cpp - northrend/violet_hold/boss_xevozz.cpp - northrend/violet_hold/boss_zuramat.cpp - northrend/violet_hold/violet_hold.h - northrend/violet_hold/violet_hold.cpp - northrend/dalaran.cpp - northrend/borean_tundra.cpp - northrend/dragonblight.cpp - northrend/grizzly_hills.cpp - northrend/howling_fjord.cpp - northrend/icecrown.cpp - northrend/sholazar_basin.cpp - northrend/storm_peaks.cpp - northrend/zuldrak.cpp - northrend/crystalsong_forest.cpp - outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - outland/auchindoun/mana_tombs/boss_pandemonius.cpp - outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp - outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - outland/auchindoun/sethekk_halls/sethekk_halls.h - outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp - outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - outland/auchindoun/shadow_labyrinth/boss_murmur.cpp - outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h - outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp - outland/black_temple/black_temple.cpp - outland/black_temple/boss_bloodboil.cpp - outland/black_temple/boss_illidan.cpp - outland/black_temple/boss_mother_shahraz.cpp - outland/black_temple/boss_reliquary_of_souls.cpp - outland/black_temple/boss_shade_of_akama.cpp - outland/black_temple/boss_supremus.cpp - outland/black_temple/boss_teron_gorefiend.cpp - outland/black_temple/boss_warlord_najentus.cpp - outland/black_temple/black_temple.h - outland/black_temple/illidari_council.cpp - outland/black_temple/instance_black_temple.cpp - outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp - outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp - outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp - outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp - outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp - outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp - outland/coilfang_resevoir/serpent_shrine/serpent_shrine.h - outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp - outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp - outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp - outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp - outland/coilfang_resevoir/steam_vault/steam_vault.h - outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp - outland/coilfang_resevoir/underbog/boss_hungarfen.cpp - outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp - outland/gruuls_lair/boss_gruul.cpp - outland/gruuls_lair/boss_high_king_maulgar.cpp - outland/gruuls_lair/gruuls_lair.h - outland/gruuls_lair/instance_gruuls_lair.cpp - outland/hellfire_citadel/blood_furnace/boss_broggok.cpp - outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp - outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp - outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp - outland/hellfire_citadel/blood_furnace/blood_furnace.h - outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp - outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp - outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp - outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h - outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp - outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp - outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h - outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp - outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp - outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp - outland/hellfire_citadel/shattered_halls/shattered_halls.h - outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp - outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp - outland/tempest_keep/arcatraz/arcatraz.cpp - outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp - outland/tempest_keep/arcatraz/arcatraz.h - outland/tempest_keep/arcatraz/instance_arcatraz.cpp - outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp - outland/tempest_keep/botanica/boss_laj.cpp - outland/tempest_keep/botanica/boss_warp_splinter.cpp - outland/tempest_keep/the_eye/boss_alar.cpp - outland/tempest_keep/the_eye/boss_astromancer.cpp - outland/tempest_keep/the_eye/boss_kaelthas.cpp - outland/tempest_keep/the_eye/boss_void_reaver.cpp - outland/tempest_keep/the_eye/the_eye.h - outland/tempest_keep/the_eye/instance_the_eye.cpp - outland/tempest_keep/the_eye/the_eye.cpp - outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp - outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp - outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp - outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp - outland/tempest_keep/the_mechanar/mechanar.h - outland/tempest_keep/the_mechanar/instance_mechanar.cpp - outland/blades_edge_mountains.cpp - outland/boss_doomlord_kazzak.cpp - outland/boss_doomwalker.cpp - outland/hellfire_peninsula.cpp - outland/nagrand.cpp - outland/netherstorm.cpp - outland/shadowmoon_valley.cpp - outland/shattrath_city.cpp - outland/terokkar_forest.cpp - outland/zangarmarsh.cpp - world/areatrigger_scripts.cpp - world/boss_emeriss.cpp - world/boss_lethon.cpp - world/boss_taerar.cpp - world/boss_ysondre.cpp - world/go_scripts.cpp - world/guards.cpp - world/item_scripts.cpp - world/mob_generic_creature.cpp - world/npc_innkeeper.cpp - world/npc_professions.cpp - world/npcs_special.cpp - world/npc_taxi.cpp +file(GLOB_RECURSE scripts_easternkingdoms EasternKingdoms/*.cpp) +file(GLOB_RECURSE scripts_kalimdor Kalimdor/*.cpp) +file(GLOB_RECURSE scripts_northrend Northrend/*.cpp) +file(GLOB_RECURSE scripts_outland Outland/*.cpp) +file(GLOB_RECURSE scripts_world World/*.cpp) +file(GLOB_RECURSE scripts_examples Examples/*.cpp) + +# Enable precompiled headers when using the GCC compiler. +if(DO_PCH) + include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ) +endif() + +set(scripts_STAT_SRCS + ../game/AI/ScriptedAI/ScriptedEscortAI.cpp + ../game/AI/ScriptedAI/ScriptedCreature.cpp + ../game/AI/ScriptedAI/ScriptedFollowerAI.cpp + ../game/AI/ScriptedAI/ScriptedGuardAI.cpp + ../game/AI/ScriptedAI/ScriptedSimpleAI.cpp + Custom/on_events.cpp + ${scripts_easternkingdoms} + ${scripts_kalimdor} + ${scripts_northrend} + ${scripts_outland} + ${scripts_world} + ${scripts_examples} ) -message("-- Added Script Engine to SCRIPTS lib") +message("-- Added Scriptengine to SCRIPTS lib") include_directories( ${ACE_INCLUDE_DIR} ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/include + ${CMAKE_SOURCE_DIR}/externals/mersennetwister + ${CMAKE_SOURCE_DIR}/externals/zlib + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography + ${CMAKE_SOURCE_DIR}/src/server/shared/Database + ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores + ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/shared/Packets + ${CMAKE_SOURCE_DIR}/src/server/shared/Policies + ${CMAKE_SOURCE_DIR}/src/server/shared/Threading + ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities + ${CMAKE_SOURCE_DIR}/src/server/collision + ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/src/server/framework ${CMAKE_SOURCE_DIR}/src/server/shared/Database ${CMAKE_SOURCE_DIR}/src/server/game/Account ${CMAKE_SOURCE_DIR}/src/server/game/Achievements ${CMAKE_SOURCE_DIR}/src/server/game/Addons ${CMAKE_SOURCE_DIR}/src/server/game/AI + ${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI + ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse ${CMAKE_SOURCE_DIR}/src/server/game/BattleGrounds ${CMAKE_SOURCE_DIR}/src/server/game/Calendar ${CMAKE_SOURCE_DIR}/src/server/game/Chat - ${CMAKE_SOURCE_DIR}/src/server/game/ConditionMgr + ${CMAKE_SOURCE_DIR}/src/server/game/Conditions + ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration ${CMAKE_SOURCE_DIR}/src/server/game/Combat ${CMAKE_SOURCE_DIR}/src/server/game/DataStores + ${CMAKE_SOURCE_DIR}/src/server/game/DungeonFinding + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Corpse ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Creature + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/DynamicObject ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container ${CMAKE_SOURCE_DIR}/src/server/game/Entities/GameObject ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object/Updates ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Pet ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Player ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Unit ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle ${CMAKE_SOURCE_DIR}/src/server/game/Events ${CMAKE_SOURCE_DIR}/src/server/game/Globals + ${CMAKE_SOURCE_DIR}/src/server/game/Grids + ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Cells + ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers ${CMAKE_SOURCE_DIR}/src/server/game/Groups ${CMAKE_SOURCE_DIR}/src/server/game/Guilds ${CMAKE_SOURCE_DIR}/src/server/game/Instances ${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup ${CMAKE_SOURCE_DIR}/src/server/game/Loot ${CMAKE_SOURCE_DIR}/src/server/game/Mails - ${CMAKE_SOURCE_DIR}/src/server/game/Map - ${CMAKE_SOURCE_DIR}/src/server/game/Map/Cell - ${CMAKE_SOURCE_DIR}/src/server/game/Map/Grid + ${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous + ${CMAKE_SOURCE_DIR}/src/server/game/Maps ${CMAKE_SOURCE_DIR}/src/server/game/Movement + ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints ${CMAKE_SOURCE_DIR}/src/server/game/Opcodes ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP ${CMAKE_SOURCE_DIR}/src/server/game/Pools + ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders ${CMAKE_SOURCE_DIR}/src/server/game/Quests ${CMAKE_SOURCE_DIR}/src/server/game/Reputation - ${CMAKE_SOURCE_DIR}/src/server/game/ScriptMgr + ${CMAKE_SOURCE_DIR}/src/server/game/Scripting + ${CMAKE_SOURCE_DIR}/src/server/game/Server + ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol + ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers ${CMAKE_SOURCE_DIR}/src/server/game/Skills ${CMAKE_SOURCE_DIR}/src/server/game/Spells ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras @@ -633,9 +123,20 @@ include_directories( ${MYSQL_INCLUDE_DIR} ) +# Add ScriptPCH.cpp to project on Windows +if(MSVC) +set(scripts_STAT_SRCS + ../game/PrecompiledHeaders/ScriptPCH.cpp + ${scripts_STAT_SRCS}) +endif() + add_library(scripts STATIC ${scripts_STAT_SRCS}) # Generate precompiled header -IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) - ADD_PRECOMPILED_HEADER(scripts ${CMAKE_SOURCE_DIR}/src/server/game/ScriptMgr/ScriptedPch.h) -ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX) +if(DO_PCH) + if(CMAKE_COMPILER_IS_GNUCXX) + add_precompiled_header(scripts ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/ScriptPCH.h) + elseif(MSVC) + add_native_precompiled_header(scripts ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/ScriptPCH) + endif() +endif() diff --git a/src/server/scripts/Custom/custom_example.cpp b/src/server/scripts/Custom/custom_example.cpp index 0e230ba901d..d922dfed0aa 100644 --- a/src/server/scripts/Custom/custom_example.cpp +++ b/src/server/scripts/Custom/custom_example.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2008 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -89,7 +91,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI //*** HANDLED FUNCTION *** //Attack Start is called whenever someone hits us. - void Aggro(Unit *who) + void EnterCombat(Unit *who) { //Say some stuff DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL); diff --git a/src/server/scripts/Custom/custom_gossip_codebox.cpp b/src/server/scripts/Custom/custom_gossip_codebox.cpp index a00d2b7031f..e7dd58f0a33 100644 --- a/src/server/scripts/Custom/custom_gossip_codebox.cpp +++ b/src/server/scripts/Custom/custom_gossip_codebox.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2008 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData diff --git a/src/server/scripts/Custom/npc_acherus_taxi.cpp b/src/server/scripts/Custom/npc_acherus_taxi.cpp index 6e00e365e8e..dff5165ce70 100644 --- a/src/server/scripts/Custom/npc_acherus_taxi.cpp +++ b/src/server/scripts/Custom/npc_acherus_taxi.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "WorldPacket.h" #define GOSSIP_FLIGHT "I need a ride" diff --git a/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp b/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp index d4c2cb5ab74..cec34365c67 100644 --- a/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp +++ b/src/server/scripts/Custom/npc_wyrmresttempel_taxi.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "WorldPacket.h" #define GOSSIP_UP "My Lord, I must go to the upper floor of the temple." diff --git a/src/server/scripts/Custom/on_events.cpp b/src/server/scripts/Custom/on_events.cpp index 94e54a07fba..58cc8275a3a 100644 --- a/src/server/scripts/Custom/on_events.cpp +++ b/src/server/scripts/Custom/on_events.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include //This function is called when the player logs in (every login) diff --git a/src/server/scripts/Custom/test.cpp b/src/server/scripts/Custom/test.cpp index aa9e6879075..0e841d450ba 100644 --- a/src/server/scripts/Custom/test.cpp +++ b/src/server/scripts/Custom/test.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2008 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -85,7 +87,7 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI } } - void Aggro(Unit*) + void EnterCombat(Unit*) { if (HasEscortState(STATE_ESCORT_ESCORTING)) me->Say(SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp index a61fc21d5ba..7592742ef23 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { @@ -62,13 +63,13 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI void Reset() { - uiChargeTimer = urand(2*IN_MILISECONDS,12*IN_MILISECONDS); - uiCleaveTimer = urand(1*IN_MILISECONDS,11*IN_MILISECONDS); - uiDemoralizingShoutTimer = urand(2*IN_MILISECONDS,2*IN_MILISECONDS); - uiWhirlwind1Timer = urand(1*IN_MILISECONDS,12*IN_MILISECONDS); - uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiEnrageTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiResetTimer = 5*IN_MILISECONDS; + uiChargeTimer = urand(2*IN_MILLISECONDS,12*IN_MILLISECONDS); + uiCleaveTimer = urand(1*IN_MILLISECONDS,11*IN_MILLISECONDS); + uiDemoralizingShoutTimer = urand(2*IN_MILLISECONDS,2*IN_MILLISECONDS); + uiWhirlwind1Timer = urand(1*IN_MILLISECONDS,12*IN_MILLISECONDS); + uiWhirlwind2Timer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiEnrageTimer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiResetTimer = 5*IN_MILLISECONDS; bHasAura = false; } @@ -119,37 +120,37 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI if (uiChargeTimer <= diff) { DoCast(me->getVictim(), SPELL_CHARGE); - uiChargeTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + uiChargeTimer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS); } else uiChargeTimer -= diff; if (uiCleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS); + uiCleaveTimer = urand(10*IN_MILLISECONDS,16*IN_MILLISECONDS); } else uiCleaveTimer -= diff; if (uiDemoralizingShoutTimer <= diff) { DoCast(me->getVictim(), SPELL_DEMORALIZING_SHOUT); - uiDemoralizingShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiDemoralizingShoutTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiDemoralizingShoutTimer -= diff; if (uiWhirlwind1Timer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLWIND1); - uiWhirlwind1Timer = urand(6*IN_MILISECONDS,20*IN_MILISECONDS); + uiWhirlwind1Timer = urand(6*IN_MILLISECONDS,20*IN_MILLISECONDS); } else uiWhirlwind1Timer -= diff; if (uiWhirlwind2Timer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLWIND2); - uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + uiWhirlwind2Timer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS); } else uiWhirlwind2Timer -= diff; if (uiEnrageTimer <= diff) { DoCast(me->getVictim(), SPELL_ENRAGE); - uiEnrageTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS); + uiEnrageTimer = urand(10*IN_MILLISECONDS,30*IN_MILLISECONDS); }else uiEnrageTimer -= diff; @@ -158,7 +159,7 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI { if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) EnterEvadeMode(); - uiResetTimer = 5*IN_MILISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } else uiResetTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index ce2a81c864a..bfc0e418334 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { @@ -50,8 +51,8 @@ struct mob_water_elementalAI : public ScriptedAI void Reset() { - uiWaterBoltTimer = 3*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; + uiWaterBoltTimer = 3*IN_MILLISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -62,7 +63,7 @@ struct mob_water_elementalAI : public ScriptedAI if (uiWaterBoltTimer < diff) { DoCast(me->getVictim(), SPELL_WATERBOLT); - uiWaterBoltTimer = 5*IN_MILISECONDS; + uiWaterBoltTimer = 5*IN_MILLISECONDS; } else uiWaterBoltTimer -= diff; // check if creature is not outside of building @@ -71,7 +72,7 @@ struct mob_water_elementalAI : public ScriptedAI if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID)) if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50) EnterEvadeMode(); - uiResetTimer = 5*IN_MILISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } else uiResetTimer -= diff; DoMeleeAttackIfReady(); @@ -93,11 +94,11 @@ struct boss_balindaAI : public ScriptedAI void Reset() { - uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); - uiConeOfColdTimer = 8*IN_MILISECONDS; - uiFireBoltTimer = 1*IN_MILISECONDS; - uiFrostboltTimer = 4*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; + uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS); + uiConeOfColdTimer = 8*IN_MILLISECONDS; + uiFireBoltTimer = 1*IN_MILLISECONDS; + uiFrostboltTimer = 4*IN_MILLISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; uiWaterElementalTimer = 0; Summons.DespawnAll(); @@ -134,32 +135,32 @@ struct boss_balindaAI : public ScriptedAI if (uiWaterElementalTimer < diff) { if (Summons.empty()) - me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS); - uiWaterElementalTimer = 50*IN_MILISECONDS; + me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILLISECONDS); + uiWaterElementalTimer = 50*IN_MILLISECONDS; } else uiWaterElementalTimer -= diff; if (uiArcaneExplosionTimer < diff) { DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); + uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiArcaneExplosionTimer -= diff; if (uiConeOfColdTimer < diff) { DoCast(me->getVictim(), SPELL_CONE_OF_COLD); - uiConeOfColdTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS); + uiConeOfColdTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS); } else uiConeOfColdTimer -= diff; if (uiFireBoltTimer < diff) { DoCast(me->getVictim(), SPELL_FIREBALL); - uiFireBoltTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS); + uiFireBoltTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS); } else uiFireBoltTimer -= diff; if (uiFrostboltTimer < diff) { DoCast(me->getVictim(), SPELL_FROSTBOLT); - uiFrostboltTimer = urand(4*IN_MILISECONDS,12*IN_MILISECONDS); + uiFrostboltTimer = urand(4*IN_MILLISECONDS,12*IN_MILLISECONDS); } else uiFrostboltTimer -= diff; @@ -171,7 +172,7 @@ struct boss_balindaAI : public ScriptedAI EnterEvadeMode(); DoScriptText(YELL_EVADE, me); } - uiResetTimer = 5*IN_MILISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } else uiResetTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp index 6477ebe5eaf..385812c6776 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { @@ -53,15 +54,15 @@ struct boss_drektharAI : public ScriptedAI void Reset() { - uiWhirlwindTimer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS); - uiWhirlwind2Timer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS); - uiKnockdownTimer = 12*IN_MILISECONDS; - uiFrenzyTimer = 6*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds + uiWhirlwindTimer = urand(1*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiWhirlwind2Timer = urand(1*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiKnockdownTimer = 12*IN_MILLISECONDS; + uiFrenzyTimer = 6*IN_MILLISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; + uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds } - void Aggro(Unit * /*who*/) + void EnterCombat(Unit * /*who*/) { DoScriptText(YELL_AGGRO, me); } @@ -80,31 +81,31 @@ struct boss_drektharAI : public ScriptedAI if (uiWhirlwindTimer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLWIND); - uiWhirlwindTimer = urand(8*IN_MILISECONDS,18*IN_MILISECONDS); + uiWhirlwindTimer = urand(8*IN_MILLISECONDS,18*IN_MILLISECONDS); } else uiWhirlwindTimer -= diff; if (uiWhirlwind2Timer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLWIND2); - uiWhirlwind2Timer = urand(7*IN_MILISECONDS,25*IN_MILISECONDS); + uiWhirlwind2Timer = urand(7*IN_MILLISECONDS,25*IN_MILLISECONDS); } else uiWhirlwind2Timer -= diff; if (uiKnockdownTimer <= diff) { DoCast(me->getVictim(), SPELL_KNOCKDOWN); - uiKnockdownTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiKnockdownTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiKnockdownTimer -= diff; if (uiFrenzyTimer <= diff) { DoCast(me->getVictim(), SPELL_FRENZY); - uiFrenzyTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); + uiFrenzyTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiFrenzyTimer -= diff; if (uiYellTimer <= diff) { DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me); - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds + uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds } else uiYellTimer -= diff; // check if creature is not outside of building @@ -115,7 +116,7 @@ struct boss_drektharAI : public ScriptedAI EnterEvadeMode(); DoScriptText(YELL_EVADE, me); } - uiResetTimer = 5*IN_MILISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } else uiResetTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp index a12b9f267f9..380a841fb7c 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { @@ -46,15 +47,15 @@ struct boss_galvangarAI : public ScriptedAI void Reset() { - uiCleaveTimer = urand(1*IN_MILISECONDS,9*IN_MILISECONDS); - uiFrighteningShoutTimer = urand(2*IN_MILISECONDS,19*IN_MILISECONDS); - uiWhirlwind1Timer = urand(1*IN_MILISECONDS,13*IN_MILISECONDS); - uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiMortalStrikeTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiResetTimer = 5*IN_MILISECONDS; + uiCleaveTimer = urand(1*IN_MILLISECONDS,9*IN_MILLISECONDS); + uiFrighteningShoutTimer = urand(2*IN_MILLISECONDS,19*IN_MILLISECONDS); + uiWhirlwind1Timer = urand(1*IN_MILLISECONDS,13*IN_MILLISECONDS); + uiWhirlwind2Timer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiMortalStrikeTimer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiResetTimer = 5*IN_MILLISECONDS; } - void Aggro(Unit * /*who*/) + void EnterCombat(Unit * /*who*/) { DoScriptText(YELL_AGGRO, me); } @@ -72,31 +73,31 @@ struct boss_galvangarAI : public ScriptedAI if (uiCleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS); + uiCleaveTimer = urand(10*IN_MILLISECONDS,16*IN_MILLISECONDS); } else uiCleaveTimer -= diff; if (uiFrighteningShoutTimer <= diff) { DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT); - uiFrighteningShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiFrighteningShoutTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiFrighteningShoutTimer -= diff; if (uiWhirlwind1Timer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLWIND1); - uiWhirlwind1Timer = urand(6*IN_MILISECONDS,10*IN_MILISECONDS); + uiWhirlwind1Timer = urand(6*IN_MILLISECONDS,10*IN_MILLISECONDS); } else uiWhirlwind1Timer -= diff; if (uiWhirlwind2Timer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLWIND2); - uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + uiWhirlwind2Timer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS); } else uiWhirlwind2Timer -= diff; if (uiMortalStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - uiMortalStrikeTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS); + uiMortalStrikeTimer = urand(10*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiMortalStrikeTimer -= diff; // check if creature is not outside of building @@ -107,7 +108,7 @@ struct boss_galvangarAI : public ScriptedAI EnterEvadeMode(); DoScriptText(YELL_EVADE, me); } - uiResetTimer = 5*IN_MILISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } else uiResetTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp index 785827bc5d9..6ae75c0fa06 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Yells { @@ -52,14 +53,14 @@ struct boss_vanndarAI : public ScriptedAI void Reset() { - uiAvatarTimer = 3*IN_MILISECONDS; - uiThunderclapTimer = 4*IN_MILISECONDS; - uiStormboltTimer = 6*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); + uiAvatarTimer = 3*IN_MILLISECONDS; + uiThunderclapTimer = 4*IN_MILLISECONDS; + uiStormboltTimer = 6*IN_MILLISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; + uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); } - void Aggro(Unit * /*who*/) + void EnterCombat(Unit * /*who*/) { DoScriptText(YELL_AGGRO, me); } @@ -78,25 +79,25 @@ struct boss_vanndarAI : public ScriptedAI if (uiAvatarTimer <= diff) { DoCast(me->getVictim(), SPELL_AVATAR); - uiAvatarTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS); + uiAvatarTimer = urand(15*IN_MILLISECONDS,20*IN_MILLISECONDS); } else uiAvatarTimer -= diff; if (uiThunderclapTimer <= diff) { DoCast(me->getVictim(), SPELL_THUNDERCLAP); - uiThunderclapTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); + uiThunderclapTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiThunderclapTimer -= diff; if (uiStormboltTimer <= diff) { DoCast(me->getVictim(), SPELL_STORMBOLT); - uiStormboltTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + uiStormboltTimer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS); } else uiStormboltTimer -= diff; if (uiYellTimer <= diff) { DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me); - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds + uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds } else uiYellTimer -= diff; // check if creature is not outside of building @@ -107,7 +108,7 @@ struct boss_vanndarAI : public ScriptedAI EnterEvadeMode(); DoScriptText(YELL_EVADE, me); } - uiResetTimer = 5*IN_MILISECONDS; + uiResetTimer = 5*IN_MILLISECONDS; } else uiResetTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index e04fa8444b2..6b8d17b3f55 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -1,18 +1,18 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -36,7 +36,7 @@ npc_tobias_seecher npc_rocknot EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "blackrock_depths.h" @@ -214,7 +214,7 @@ struct npc_grimstoneAI : public npc_escortAI if (pInstance) { pInstance->SetData(TYPE_RING_OF_LAW,DONE); - debug_log("TSCR: npc_grimstone: event reached end and set complete."); + sLog.outDebug("TSCR: npc_grimstone: event reached end and set complete."); } break; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h index edb340252b2..a9228615604 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_BRD_H #define DEF_BRD_H diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp index a387e816951..df77770a410 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp index 60e1dec236c..e8277d9e931 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index 29fe219d6ec..d177e3c97ac 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Yells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp index 77d69263133..0c50893633b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp index 886bc3fc909..718278d3720 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index d3551d38790..f369e4d645a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Yells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp index 2af203826a1..53df13eee1f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index 2a0cf9be133..bc0181bbb9a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp index 1c0ed389287..fe81ad5eeac 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Healing of Emperor NYI SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Spells { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 94a37e8da7e..ac1795d5e43 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event. SDCategory: Blackrock Depths EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackrock_depths.h" enum Spells diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 7684aa6c6ac..9be222e8bb2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Instance_Blackrock_Depths @@ -29,7 +31,7 @@ update `creature_template` set `npcflag`='1',`ScriptName`='npc_tobias_seecher' w update `instance_template` set `script`='instance_blackrock_depths' where `map`='230'; */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackrock_depths.h" #define TIMER_TOMBOFTHESEVEN 15000 @@ -207,7 +209,7 @@ struct instance_blackrock_depths : public ScriptedInstance void SetData64(uint32 type, uint64 data) { - debug_log("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data); + sLog.outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data); switch(type) { @@ -223,7 +225,7 @@ struct instance_blackrock_depths : public ScriptedInstance void SetData(uint32 type, uint32 data) { - debug_log("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + sLog.outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); switch(type) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp index 2ea115e6e0b..86de9f60920 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackrock_spire.h" enum Creatures @@ -55,7 +56,7 @@ bool GOHello_rookey_egg(Player *pPlayer, GameObject * /*pGO*/) { Position pos; pPlayer->GetPosition(&pos); - pPlayer->SummonCreature(NPC_ROOKERY_WHELP, pos, TEMPSUMMON_TIMED_DESPAWN, 15*IN_MILISECONDS); + pPlayer->SummonCreature(NPC_ROOKERY_WHELP, pos, TEMPSUMMON_TIMED_DESPAWN, 15*IN_MILLISECONDS); //destroy gobject need to be implemented return true; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index 56b6e0cbe23..94ad1c24ef4 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -1,17 +1,18 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_BRS_H diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index b53ddaf23ef..612201efa1c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_FIRENOVA 23462 #define SPELL_CLEAVE 20691 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index fcd2ea1a6d0..676115b0595 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_CORROSIVEACID 20667 #define SPELL_FREEZE 18763 @@ -176,7 +178,7 @@ struct boss_gythAI : public ScriptedAI && me->GetHealth() > 0) { //summon Rend and Change model to normal Gyth - //Inturrupt any spell casting + //Interrupt any spell casting me->InterruptNonMeleeSpells(false); //Gyth model me->SetDisplayId(9806); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index 9e78667717a..679ec4d37a0 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_CROWDPUMMEL 10887 #define SPELL_MIGHTYBLOW 14099 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index 65f1e8081a0..1b40580572b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_WARSTOMP 24375 #define SPELL_CLEAVE 15579 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index 60dda5a5fab..1f7d9d1dd18 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Uncertain how often mother's milk is casted SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_CRYSTALIZE 16104 #define SPELL_MOTHERSMILK 16468 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index 8846442705b..dd93ef85325 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_BLASTWAVE 11130 #define SPELL_SHOUT 23511 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 6cbd6955665..267a590a307 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Event to activate Emberseer NYI SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_FIRENOVA 23462 #define SPELL_FLAMEBUFFET 23341 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 9058b35cd5c..4d46394a536 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Needs revision SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SHOOT 16496 #define SPELL_STUNBOMB 16497 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index 56de5dbb385..4973246df79 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Intro event NYI SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_WHIRLWIND 26038 #define SPELL_CLEAVE 20691 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index 73afc3b5afe..b3470b43e21 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_CURSEOFBLOOD 24673 #define SPELL_HEX 16708 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 499f9cf4ce5..4af0dbc3a73 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_FLAMEBREAK 16785 #define SPELL_IMMOLATE 20294 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index 50b47c94fc5..7e05dec67cf 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackrock Spire EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SNAPKICK 15618 #define SPELL_CLEAVE 15579 diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index f2e2b39fe87..53f2b730a80 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackrock_spire.h" enum Achievements @@ -34,7 +35,7 @@ struct instance_blackrock_spire : public ScriptedInstance void Initialize() { - uiLeeroyTimer = 15*IN_MILISECONDS; + uiLeeroyTimer = 15*IN_MILLISECONDS; uiWhelpCount = 0; bLeeeeeeeeroy = true; uiLeroyData = 0; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index 856e1236176..33e0ff49e5a 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1469000 #define SAY_LEASH -1469001 diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 08bebe95384..bc0e451932f 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Chromatic Mutation disabled due to lack of core support SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum Emotes { diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp index 49a999fc458..1eeb7b3a6ae 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Shadow of Ebonroc needs core support SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SHADOWFLAME 22539 #define SPELL_WINGBUFFET 18500 diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp index af62b1103bc..a9142a2049b 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SHADOWFLAME 22539 #define SPELL_WINGBUFFET 23339 diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index b29fe41f2b1..32fc2d52b37 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define EMOTE_FRENZY -1469031 diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 5ef05be519c..b78c999e0e5 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Some issues with class calls effecting more than one class SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1469007 #define SAY_XHEALTH -1469008 diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index a095756b18b..59c4d2a6730 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Needs additional review. Phase 1 NYI (Grethok the Controller) SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //Razorgore Phase 2 Script diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index f6e94307f2f..bba4cac82f1 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Burning Adrenaline not correctly implemented in core SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_LINE1 -1469026 #define SAY_LINE2 -1469027 diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index dfeb2519bae..d6a31cda4af 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong plac SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_GAMESBEGIN_1 -1469004 #define SAY_GAMESBEGIN_2 -1469005 @@ -189,9 +191,9 @@ struct boss_victor_nefariusAI : public ScriptedAI //Trinity::Singleton::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); /* - list ::const_iterator i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); + list ::const_iterator i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); - for (i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i) + for (i = sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != sMapMgr.GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i) { AttackStart((*i)); } @@ -288,9 +290,9 @@ struct boss_victor_nefariusAI : public ScriptedAI if (SpawnedAdds >= 42) { //Teleport Victor Nefarius way out of the map - //MapManager::Instance().GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0); + //sMapMgr.GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0); - //Inturrupt any spell casting + //Interrupt any spell casting me->InterruptNonMeleeSpells(false); //Root self @@ -312,7 +314,7 @@ struct boss_victor_nefariusAI : public ScriptedAI Nefarian->setFaction(103); NefarianGUID = Nefarian->GetGUID(); } - else error_log("TSCR: Blackwing Lair: Unable to spawn nefarian properly."); + else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly."); } AddSpawnTimer = 4000; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp index d6403fa1206..9d680b13cfe 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Instance_Blackwing_Lair @@ -21,5 +23,5 @@ SDComment: SDCategory: Blackwing Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 5c6bab46e5a..77fb826e9dd 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss Mr.Smite @@ -22,7 +21,7 @@ SD%Complete: SDComment: Timers and say taken from acid script EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "deadmines.h" enum eSpels diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index 5bc1121bead..0540ae7194d 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Placeholder SDCategory: Deadmines EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "deadmines.h" #include "Spell.h" diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h index 203494ad5b7..6f0e922b421 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -1,7 +1,24 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_DEADMINES_H #define DEF_DEADMINES_H -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum CannonState { diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index f1aa0c62b8a..153d7ed10e1 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2008 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Deadmines EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "deadmines.h" enum Sounds diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index c39bfb69910..776515891e4 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* Script Data Start @@ -23,7 +22,7 @@ SD%Complete: 90% SDComment: Some visual effects are not implemented. Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gnomeregan.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h index e46c811e9b1..cbb0d166fb0 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_GNOMEREGAN_H diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp index 980a6d3552b..c678fc55140 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gnomeregan.h" #define MAX_ENCOUNTER 1 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index 7105d27ca6a..ce6d4158fd7 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1532057 #define SAY_SUMMON1 -1532058 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index 21db1be1be3..19b6b203d4c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1532018 #define SAY_SLAY1 -1532019 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index a2f2a8b605e..939a5a1684a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_MIDNIGHT_KILL -1532000 #define SAY_APPEAR1 -1532001 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 6c8fabcca35..fc46d027d07 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2008 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" #define SAY_AGGRO -1532011 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index 004f1902bfc..3e3f7ffb9c4 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Not sure about timing and portals placing SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" #define EMOTE_PHASE_PORTAL -1532089 @@ -245,7 +247,7 @@ struct boss_netherspiteAI : public ScriptedAI Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); } - void Aggro(Unit * /*who*/) + void EnterCombat(Unit * /*who*/) { HandleDoors(false); SwitchToPortalPhase(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 2e8b6f51317..1cf397e2ce5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDComment: Timers may incorrect SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" //phase 1 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 1071eae78a0..aea8703f2f2 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" #define SAY_AGGRO -1532091 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 394cff3ccc5..37ea79fefbe 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Flame wreath missing cast animation, mods won't triggere. SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedSimpleAI.h" #include "karazhan.h" #include "GameObject.h" @@ -107,7 +109,7 @@ struct boss_aranAI : public ScriptedAI uint32 FireCooldown; uint32 FrostCooldown; - uint32 DrinkInturruptTimer; + uint32 DrinkInterruptTimer; bool ElementalsSpawned; bool Drinking; @@ -131,7 +133,7 @@ struct boss_aranAI : public ScriptedAI FireCooldown = 0; FrostCooldown = 0; - DrinkInturruptTimer = 10000; + DrinkInterruptTimer = 10000; ElementalsSpawned = false; Drinking = false; @@ -259,11 +261,11 @@ struct boss_aranAI : public ScriptedAI DoCast(me, SPELL_CONJURE, false); DoCast(me, SPELL_DRINK, false); me->SetStandState(UNIT_STAND_STATE_SIT); - DrinkInturruptTimer = 10000; + DrinkInterruptTimer = 10000; } } - //Drink Inturrupt + //Drink Interrupt if (Drinking && DrinkInturrupted) { Drinking = false; @@ -273,10 +275,10 @@ struct boss_aranAI : public ScriptedAI DoCast(me, SPELL_POTION, false); } - //Drink Inturrupt Timer + //Drink Interrupt Timer if (Drinking && !DrinkInturrupted) - if (DrinkInturruptTimer >= diff) - DrinkInturruptTimer -= diff; + if (DrinkInterruptTimer >= diff) + DrinkInterruptTimer -= diff; else { me->SetStandState(UNIT_STAND_STATE_STAND); @@ -474,13 +476,13 @@ struct boss_aranAI : public ScriptedAI void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell) { - //We only care about inturrupt effects and only if they are durring a spell currently being casted + //We only care about interrupt effects and only if they are durring a spell currently being casted if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST && Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST && Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false)) return; - //Inturrupt effect + //Interrupt effect me->InterruptNonMeleeSpells(false); //Normally we would set the cooldown equal to the spell duration @@ -534,7 +536,7 @@ CreatureAI* GetAI_water_elemental(Creature* pCreature) // CONVERT TO ACID CreatureAI* GetAI_shadow_of_aran(Creature* pCreature) { - outstring_log("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry()); + sLog.outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry()); SimpleAI* ai = new SimpleAI (pCreature); ai->Spell[0].Enabled = true; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 5305cc8d354..039b517bd9b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Complete! Needs adjustments to use spell though. SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" #define SAY_SLAY1 -1532065 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index ae6de9c1add..6498e48069a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing. SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" /***********************************/ @@ -92,7 +94,7 @@ void SummonCroneIfReady(ScriptedInstance* pInstance, Creature* pCreature) if (pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4) { - if (Creature* pCrone = pCreature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, pCreature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + if (Creature* pCrone = pCreature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, pCreature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) { if (pCreature->getVictim()) pCrone->AI()->AttackStart(pCreature->getVictim()); @@ -725,7 +727,7 @@ bool GossipSelect_npc_grandmother(Player* pPlayer, Creature* pCreature, uint32 / { if (uiAction == GOSSIP_ACTION_INFO_DEF) { - if (Creature* pBigBadWolf = pCreature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + if (Creature* pBigBadWolf = pCreature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) pBigBadWolf->AI()->AttackStart(pPlayer); pCreature->ForcedDespawn(); @@ -1154,7 +1156,7 @@ void boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) if (Phase == PHASE_ROMULO) { - error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); + sLog.outError("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); damage = 0; return; } @@ -1188,7 +1190,7 @@ void boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) return; } } - error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); + sLog.outError("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); } void boss_romuloAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) @@ -1242,7 +1244,7 @@ void boss_romuloAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) } } - error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); + sLog.outError("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); } void boss_julianneAI::UpdateAI(const uint32 diff) @@ -1283,7 +1285,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff) { if (SummonRomuloTimer <= diff) { - if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) { RomuloGUID = pRomulo->GetGUID(); CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = me->GetGUID(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 59c1236bcdc..7a7039b94fe 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Instance Script for Karazhan to help in various encounters. TODO: Gam SDCategory: Karazhan EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" #define MAX_ENCOUNTER 12 diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 5186a794b0d..29e22d36047 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_berthold npc_image_of_medivh EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "karazhan.h" #include "ScriptedEscortAI.h" @@ -220,7 +222,7 @@ struct npc_barnesAI : public npc_escortAI void PrepareEncounter() { - debug_log("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); + sLog.outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); uint8 index = 0; uint8 count = 0; @@ -245,7 +247,7 @@ struct npc_barnesAI : public npc_escortAI uint32 entry = ((uint32)Spawns[index][0]); float PosX = Spawns[index][1]; - if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) { // In case database has bad flags pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); @@ -371,17 +373,17 @@ bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 /*uiSe case GOSSIP_ACTION_INFO_DEF+3: pPlayer->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_OZ; - outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID()); + sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+4: pPlayer->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_HOOD; - outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID()); + sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+5: pPlayer->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_RAJ; - outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID()); + sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID()); break; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h index 56a6b106332..a24dba53e49 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_KARAZHAN_H #define DEF_KARAZHAN_H @@ -48,6 +62,6 @@ enum OperaEvents EVENT_RAJ = 3 }; -#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); +#define ERROR_INST_DATA(a) sLog.outError("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); #endif diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index b5835dfe0a1..3f0cffbacaa 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially fo SDCategory: Magisters' Terrace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magisters_terrace.h" #include "WorldPacket.h" diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 2112eaabc87..bc4049bb1fb 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: No Heroic support yet. Needs further testing. Several scripts for pet SDCategory: Magister's Terrace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magisters_terrace.h" struct Speech @@ -595,7 +597,7 @@ struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI boss_priestess_lackey_commonAI::Reset(); } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* /*pWho*/) { DoCast(me, SPELL_SUMMON_IMP); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index adb0700eabf..9636d596213 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Heroic and Normal Support. Needs further testing. SDCategory: Magister's Terrace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magisters_terrace.h" #define SAY_AGGRO -1585000 @@ -63,7 +65,7 @@ struct boss_selin_fireheartAI : public ScriptedAI for (uint8 i = 0; i < size; ++i) { uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL); - debug_log("TSCR: Selin: Adding Fel Crystal %u to list", guid); + sLog.outDebug("TSCR: Selin: Adding Fel Crystal %u to list", guid); Crystals.push_back(guid); } } @@ -108,7 +110,7 @@ struct boss_selin_fireheartAI : public ScriptedAI // Small door opened after event are expected to be closed by default // Set Inst data for encounter pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); - } else error_log(ERROR_INST_DATA); + } else sLog.outError(ERROR_INST_DATA); DrainLifeTimer = 3000 + rand()%4000; DrainManaTimer = DrainLifeTimer + 5000; @@ -208,7 +210,7 @@ struct boss_selin_fireheartAI : public ScriptedAI else { // Make an error message in case something weird happened here - error_log("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); + sLog.outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); DrainingCrystal = false; } } @@ -340,7 +342,7 @@ struct mob_fel_crystalAI : public ScriptedAI } } } - } else error_log(ERROR_INST_DATA); + } else sLog.outError(ERROR_INST_DATA); } }; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index bc8bd5cec30..c89c7683749 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Heroic and Normal support. Needs further testing. SDCategory: Magister's Terrace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magisters_terrace.h" enum eEnums diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 455c03739bc..ab1bf3b04d1 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Designed only for Selin Fireheart SDCategory: Magister's Terrace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magisters_terrace.h" #define MAX_ENCOUNTER 4 @@ -169,7 +171,7 @@ struct instance_magisters_terrace : public ScriptedInstance { if (FelCrystals.empty()) { - error_log("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data"); + sLog.outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data"); return 0; } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index e46da9cb1bf..f6f1631fa6a 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_kalecgos EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_kalecgos @@ -70,7 +72,7 @@ struct npc_kalecgosAI : public ScriptedAI return; if (uiPointId == POINT_ID_LAND) - m_uiTransformTimer = MINUTE*IN_MILISECONDS; + m_uiTransformTimer = MINUTE*IN_MILLISECONDS; } // some targeting issues with the spell, so use this workaround as temporary solution diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index d6419ea409c..a7de6da1c8e 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_MAGISTERS_TERRACE_H #define DEF_MAGISTERS_TERRACE_H diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index 77c6fafa10a..86894f75f73 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define EMOTE_SERVICE -1409000 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp index 75891cf8c43..18eef567088 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Adds NYI SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" // Garr spells #define SPELL_ANTIMAGICPULSE 19492 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp index 9ebe69c0c4e..a2e3550b87b 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Adds MC NYI SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SHADOWBOLT 19728 #define SPELL_RAINOFFIRE 19717 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index 2aba378d399..5ad9768d567 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "molten_core.h" enum eEnums @@ -53,9 +55,9 @@ struct boss_golemaggAI : public ScriptedAI void Reset() { - m_uiPyroblastTimer = 7*IN_MILISECONDS; // These timers are probably wrong - m_uiEarthquakeTimer = 3*IN_MILISECONDS; - m_uiBuffTimer = 2.5*IN_MILISECONDS; + m_uiPyroblastTimer = 7*IN_MILLISECONDS; // These timers are probably wrong + m_uiEarthquakeTimer = 3*IN_MILLISECONDS; + m_uiBuffTimer = 2.5*IN_MILLISECONDS; m_bEnraged = false; DoCast(me, SPELL_MAGMASPLASH, true); @@ -78,7 +80,7 @@ struct boss_golemaggAI : public ScriptedAI if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_PYROBLAST); - m_uiPyroblastTimer = 7*IN_MILISECONDS; + m_uiPyroblastTimer = 7*IN_MILLISECONDS; } else m_uiPyroblastTimer -= uiDiff; @@ -96,7 +98,7 @@ struct boss_golemaggAI : public ScriptedAI if (m_uiEarthquakeTimer <= uiDiff) { DoCast(me->getVictim(), SPELL_EARTHQUAKE); - m_uiEarthquakeTimer = 3*IN_MILISECONDS; + m_uiEarthquakeTimer = 3*IN_MILLISECONDS; } else m_uiEarthquakeTimer -= uiDiff; @@ -107,7 +109,7 @@ struct boss_golemaggAI : public ScriptedAI if (m_uiBuffTimer <= uidiff) { DoCast(me, SPELL_GOLEMAGG_TRUST); - m_uiBuffTimer = 2.5*IN_MILISECONDS; + m_uiBuffTimer = 2.5*IN_MILLISECONDS; } else m_uiBuffTimer -= uiDiff; @@ -130,7 +132,7 @@ struct mob_core_ragerAI : public ScriptedAI void Reset() { - m_uiMangleTimer = 7*IN_MILISECONDS; // These times are probably wrong + m_uiMangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong } void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) @@ -162,7 +164,7 @@ struct mob_core_ragerAI : public ScriptedAI if (m_uiMangleTimer <= uiDiff) { DoCast(me->getVictim(), SPELL_MANGLE); - m_uiMangleTimer = 10*IN_MILISECONDS; + m_uiMangleTimer = 10*IN_MILLISECONDS; } else m_uiMangleTimer -= uiDiff; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp index 50601f04147..761bfa97f81 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_IMPENDINGDOOM 19702 #define SPELL_LUCIFRONCURSE 19703 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp index f612003b076..fd64e42fed1 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Conflag on ground nyi, fear causes issues without VMAPs SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define EMOTE_FRENZY -1409001 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 11ae70befcf..3b8bf20256d 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Correct spawning and Event NYI SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1409003 #define SAY_SPAWN -1409004 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index 71c0b40de3f..fc7f9948f0a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Intro Dialog and event NYI SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_REINFORCEMENTS1 -1409013 #define SAY_REINFORCEMENTS2 -1409014 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp index 4b0774cdc54..f2b6b4a99f8 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Teleport NYI SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_ARCANEEXPLOSION 19712 #define SPELL_SHAZZRAHCURSE 19713 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index 83288fe003b..66d6d115b12 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Adds NYI SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "molten_core.h" #define SPELL_DARKSTRIKE 19777 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp index eb79c234134..fb313fba3ae 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Place Holder SDCategory: Molten Core EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "molten_core.h" #define MAX_ENCOUNTER 9 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp index f8fe5bf1477..5a77af76d63 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ mob_ancient_core_hound EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedSimpleAI.h" #define SPELL_CONE_OF_FIRE 19630 diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h index 5874d8b9408..419aeb4acbf 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_MOLTEN_CORE_H #define DEF_MOLTEN_CORE_H diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index bdbf6b7c081..609e8bd9322 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "Vehicle.h" #include "ObjectMgr.h" #include "ScriptedEscortAI.h" @@ -199,7 +198,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) anchorGUID = anchor->GetGUID(); } else - error_log("npc_unworthy_initiateAI: unable to find anchor!"); + sLog.outError("npc_unworthy_initiateAI: unable to find anchor!"); float dist = 99.0f; GameObject *prison = NULL; @@ -219,7 +218,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) if (prison) prison->ResetDoorOrButton(); else - error_log("npc_unworthy_initiateAI: unable to find prison!"); + sLog.outError("npc_unworthy_initiateAI: unable to find prison!"); } return; case PHASE_TO_EQUIP: @@ -230,7 +229,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) else { me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ()); - //debug_log("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); + //sLog.outDebug("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); phase = PHASE_EQUIPING; wait_timer = 0; } @@ -989,9 +988,9 @@ bool GOHello_go_inconspicuous_mine_car(Player* pPlayer, GameObject* /*pGO*/) { car->AI()->SetGUID(miner->GetGUID()); CAST_AI(npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer); - } else error_log("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct."); - } else error_log("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle."); - } else error_log("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script."); + } else sLog.outError("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct."); + } else sLog.outError("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle."); + } else sLog.outError("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script."); } return true; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 91f7e0e6cbe..bafb12d5606 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" //How to win friends and influence enemies diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 3b0ce186592..6d40618a936 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index cdfd69234fb..e39dace9920 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*#### ## npc_valkyr_battle_maiden diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index cb6ed1daf22..6659d1aaba8 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp index 6b6efa0f934..e30e527d567 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_CALLOFTHEGRAVE 17831 #define SPELL_TERRIFY 7399 diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index f7b6b7cce4b..2a53ce591db 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 17bbf0c23c6..50a4dd8f60e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "SpellMgr.h" #include "scarlet_monastery.h" diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index e0db29aa240..e6b535c1073 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Should in addition spawn Myrmidons in the hallway outside SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #define SAY_AGGRO -1189000 diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index b9b15f34508..e643e001ca6 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: TODO: if this guy not involved in some special event, remove (and let SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eSpells { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index 300e69611cd..324f28ccf6a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index b4b84fc8059..d804a680e76 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scarlet_monastery.h" enum eEnums diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index 32b85e214a0..2d4f7e8e244 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scarlet_monastery.h" enum eEnums diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp index 5d0a3b3792f..f37903d09e1 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_LICHSLAP 28873 #define SPELL_FROSTBOLTVOLLEY 8398 diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 33642d4511c..dd7a88dbc88 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Instance_Scarlet_Monastery @@ -21,7 +23,7 @@ SDComment: SDCategory: Scarlet Monastery EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scarlet_monastery.h" #define ENTRY_PUMPKIN_SHRINE 186267 diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h index 2b6399ae3e4..d34636df360 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SCARLET_M #define DEF_SCARLET_M diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 50a9e204566..1f2e2fe1429 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Doors missing in instance script. SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define SPELL_ARCANEMISSILES 22272 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp index 8bb9ec68aca..c021e9e677e 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" struct boss_death_knight_darkreaverAI : public ScriptedAI { diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 5ff01d48623..24b5bafd57c 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" enum eEnums diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index a038fc7a0b8..b2748fef22a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define SPELL_CURSEOFAGONY 18671 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index c4c0f95d8d1..d78b486d00f 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define SPELL_CALLOFGRAVES 17831 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index f8d8520e394..63ba5885573 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_jandicebarov @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_CURSEOFBLOOD 24673 //#define SPELL_ILLUSION 17773 @@ -91,7 +93,7 @@ struct boss_jandicebarovAI : public ScriptedAI if (!Invisible && Illusion_Timer <= diff) { - //Inturrupt any spell casting + //Interrupt any spell casting me->InterruptNonMeleeSpells(false); me->setFaction(35); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index c4ae5cc490e..9a41a16a2e7 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SHADOWBOLTVOLLEY 20741 #define SPELL_BONESHIELD 27688 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index 0956a04d824..9782475540f 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: aura applied/defined in database SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define SPELL_IMMOLATE 20294 // Old ID was 15570 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index d3b75900202..7d3dc7cf873 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define SPELL_VOLATILEINFECTION 24928 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 63837e04ad5..a5957995981 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_FROSTBOLT 21369 #define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index 6340f2b0e2d..e23bc4fdd97 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define SPELL_TRAMPLE 15550 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index a38369faab0..1aa278f1bce 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp index 992849cff1b..28ed326cefa 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Scholomance EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "scholomance.h" #define GO_GATE_KIRTONOS 175570 diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h index 83ce26c9687..463c848b9ef 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h +++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SCHOLOMANCE_H #define DEF_SCHOLOMANCE_H diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index 20959641889..be3cd67c8d6 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Shadowfang Keep EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shadowfang_keep.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 23b8ad89160..61f06276bb6 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_shadowfang_prisoner EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "shadowfang_keep.h" diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h index a1a59789632..fb5bf310589 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SHADOWFANG_H #define DEF_SHADOWFANG_H diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index de17717e289..ca2ca46d198 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Baron_Rivendare @@ -21,7 +23,7 @@ SDComment: aura applied/defined in database SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index cff4fe3fbae..ba2a49a1804 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Baroness_Anastari @@ -21,7 +23,7 @@ SDComment: MC disabled SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define SPELL_BANSHEEWAIL 16565 diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index c12f7b9ad04..0de4d122904 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_cannon_master_willey @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //front, left #define ADD_1X 3553.851807 diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index a8489a7f549..ec2fd370a16 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Dathrohan_Balnazzar @@ -21,7 +23,7 @@ SDComment: Possibly need to fix/improve summons after death SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { @@ -100,7 +102,7 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI for (uint8 i=0; iSummonCreature(NPC_ZOMBIE, m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient, - TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILISECONDS); + TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILLISECONDS); } void EnterCombat(Unit * /*who*/) diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index 89de7dbc207..4551a8c5118 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Magistrate_Barthilas @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define SPELL_DRAININGBLOW 16793 diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 0c1cf011d5e..f47da709578 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_maleki_the_pallid @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define SPELL_FROSTBOLT 17503 diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index ae7299071f4..1e39e4ef3e4 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Nerubenkan @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define SPELL_ENCASINGWEBS 4962 diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 905feb9fffc..c20ac90aae0 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Silver_Hand_Bosses @@ -21,7 +23,7 @@ SDComment: Basic script to have support for Horde paladin epic mount (quest 9737 SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" /*##### diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index c04bae15468..002cd963e2a 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_postmaster_malown @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //Spell ID to summon this guy is 24627 "Summon Postmaster Malown" //He should be spawned along with three other elites once the third postbox has been opened diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index 3a3ae60c9c9..809b62e68af 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Ramstein_The_Gorger @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define SPELL_TRAMPLE 5568 diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index f15eb59ba47..426e40e2db2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_timmy_the_cruel @@ -21,7 +23,7 @@ SDComment: SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_SPAWN "TIMMY!" diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index ffeaa070a26..797a3899806 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: instance_stratholme @@ -21,7 +23,7 @@ SDComment: In progress. Undead side 75% implemented. Save/load not implemented. SDCategory: Stratholme EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" #define GO_SERVICE_ENTRANCE 175368 @@ -112,7 +114,7 @@ struct instance_stratholme : public ScriptedInstance return true; } - debug_log("TSCR: Instance Stratholme: Cannot open slaugther square yet."); + sLog.outDebug("TSCR: Instance Stratholme: Cannot open slaugther square yet."); return false; } @@ -208,7 +210,7 @@ struct instance_stratholme : public ScriptedInstance break; Encounter[0] = data; BaronRun_Timer = 2700000; - debug_log("TSCR: Instance Stratholme: Baron run in progress."); + sLog.outDebug("TSCR: Instance Stratholme: Baron run in progress."); break; case FAIL: //may add code to remove aura from players, but in theory the time should be up already and removed. @@ -266,10 +268,10 @@ struct instance_stratholme : public ScriptedInstance //UpdateGoState(ziggurat4GUID,0,true); if (Creature* pBaron = instance->GetCreature(baronGUID)) pBaron->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - debug_log("TSCR: Instance Stratholme: Ramstein spawned."); + sLog.outDebug("TSCR: Instance Stratholme: Ramstein spawned."); } else - debug_log("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); + sLog.outDebug("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); } if (data == NOT_STARTED) @@ -278,7 +280,7 @@ struct instance_stratholme : public ScriptedInstance if (data == DONE) { SlaugtherSquare_Timer = 300000; - debug_log("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); + sLog.outDebug("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); } Encounter[4] = data; break; @@ -419,7 +421,7 @@ struct instance_stratholme : public ScriptedInstance if (GetData(TYPE_BARON_RUN) != DONE) SetData(TYPE_BARON_RUN, FAIL); BaronRun_Timer = 0; - debug_log("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); + sLog.outDebug("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); } else BaronRun_Timer -= diff; } @@ -434,7 +436,7 @@ struct instance_stratholme : public ScriptedInstance HandleGameObject(ziggurat4GUID, true); HandleGameObject(ziggurat5GUID, true); - debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); + sLog.outDebug("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); } SlaugtherSquare_Timer = 0; } else SlaugtherSquare_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 035fca68b95..ed87b7fdccb 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -28,7 +30,7 @@ mob_restless_soul mobs_spectral_ghostly_citizen EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "stratholme.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h index b9246091a7c..6198ea85723 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_STRATHOLME_H #define DEF_STRATHOLME_H diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index 6fe65cf963d..99c018161dc 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 kb_z - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment:Place Holder SDCategory: Sunken Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunken_temple.h" #define GO_ATALAI_STATUE1 148830 diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp index 7f0ca126d78..ca49cac4908 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 kb_z - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ at_malfurion_Stormrage_trigger EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunken_temple.h" /*##### diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h index 82245095c31..39fdee13ef3 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 kb_z - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SUNKEN_TEMPLE_H #define DEF_SUNKEN_TEMPLE_H diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 59e58d6df1a..5aa1daaad77 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -20,7 +22,7 @@ SD%Complete: 80 SDComment: Find a way to start the intro, best code for the intro EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" enum Quotes @@ -143,7 +145,7 @@ struct boss_brutallusAI : public ScriptedAI { if (!Intro || IsIntro) return; - error_log("Start Intro"); + sLog.outError("Start Intro"); Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); if (Madrigosa) { @@ -158,7 +160,7 @@ struct boss_brutallusAI : public ScriptedAI }else { //Madrigosa not found, end intro - error_log("Madrigosa was not found"); + sLog.outError("Madrigosa was not found"); EndIntro(); } } @@ -168,7 +170,7 @@ struct boss_brutallusAI : public ScriptedAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Intro = false; IsIntro = false; - error_log("End Intro"); + sLog.outError("End Intro"); } void AttackStart(Unit* pWho) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 602f12065fa..6ce5b933d6a 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -1,18 +1,19 @@ -/* Copyright (C) 2009 Trinity -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Eredar_Twins @@ -20,7 +21,7 @@ SD%Complete: 100 SDComment: EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" enum Quotes diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 88ad2dbab11..3c6efbb97fe 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -1,18 +1,19 @@ -/* Copyright (C) 2009 Trinity -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Felmyst @@ -20,7 +21,7 @@ SD%Complete: 0 SDComment: EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" enum Yells diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 146771325eb..e72e49c47b3 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Sunwell_Plateau EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" enum Yells @@ -260,7 +262,7 @@ struct boss_kalecgosAI : public ScriptedAI } else { - error_log("TSCR: Didn't find Shathrowar. Kalecgos event reseted."); + sLog.outError("TSCR: Didn't find Shathrowar. Kalecgos event reseted."); EnterEvadeMode(); return; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index f1c3a769b28..4bd5164bf9c 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -1,17 +1,18 @@ -/* Copyright (C) 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -23,7 +24,7 @@ EndScriptData */ //TODO rewrite Armageddon -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" #include @@ -727,7 +728,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI if (pRandomPlayer) DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false); else - error_log("try to cast SPELL_LEGION_LIGHTNING on invalid target"); + sLog.outError("try to cast SPELL_LEGION_LIGHTNING on invalid target"); Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE Timer[TIMER_SOUL_FLAY] = 2500; @@ -1341,7 +1342,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI DoMeleeAttackIfReady(); break; } - debug_log("Sinister-Timer"); + sLog.outDebug("Sinister-Timer"); for (uint8 i = 0; i < 3; ++i) uiTimer[i] -= diff; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 9dca453ade6..ca25828c484 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -1,18 +1,19 @@ -/* Copyright (C) 2009 Trinity -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Muru @@ -20,7 +21,7 @@ SD%Complete: 80 SDComment: all sounds, black hole effect triggers to often (46228) */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" // Muru & Entropius's spells diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index 94b7bf4b735..12a0bdfffff 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Instance_Sunwell_Plateau @@ -9,7 +23,7 @@ SDComment: VERIFY SCRIPT SDCategory: Sunwell_Plateau EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" #define MAX_ENCOUNTER 6 @@ -110,7 +124,7 @@ struct instance_sunwell_plateau : public ScriptedInstance } } - debug_log("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); + sLog.outDebug("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp index dbf67d5f26e..bb3a1b16a20 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp @@ -1,17 +1,18 @@ -/* Copyright (C) 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +26,7 @@ npc_prophet_velen npc_captain_selana EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sunwell_plateau.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h index 9f1a2480c96..bebee8f0f99 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SUNWELLPLATEAU_H #define DEF_SUNWELLPLATEAU_H diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index cd3bc5fc219..ba7fbd9ca8f 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006,2007 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2007 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_archaedas @@ -24,7 +26,7 @@ At 33%, he will awaken the Vault Walkers On his death the vault door opens. EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!" #define SOUND_AGGRO 5855 @@ -348,7 +350,7 @@ SDComment: After activating the altar of the keepers, the stone keepers will wake up one by one. EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SELF_DESTRUCT 9874 @@ -436,7 +438,7 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/) //if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE) //{ - //error_log("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); + //sLog.outError("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); // return false; // not enough people yet //} /* @@ -446,7 +448,7 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/) for (uint8 x = 0; x < 5; ++x) { pTarget = Unit::GetUnit(*pPlayer, altarOfTheKeeperCount[x]); - //error_log("number of people currently activating it: %d", x+1); + //sLog.outError("number of people currently activating it: %d", x+1); if (!pTarget) continue; if (pTarget->IsNonMeleeSpellCasted(true)) @@ -457,11 +459,11 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/) if (count < NUMBER_NEEDED_TO_ACTIVATE) { - //error_log("still not enough people"); + //sLog.outError("still not enough people"); return true; // not enough people } */ - //error_log ("activating stone keepers"); + //sLog.outError ("activating stone keepers"); pInstance->SetData(NULL,1); // activate the Stone Keepers return true; } diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp index 9b6d5dba642..71e1bf9d877 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Uldaman EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1070000 diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index a519ad678b7..579c01e7286 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -1,20 +1,22 @@ -/* Copyright (C) 2006,2007 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2007 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_ARCHAEDAS_AWAKEN 10347 #define SPELL_AWAKEN_VAULT_WALKER 10258 @@ -215,7 +217,7 @@ struct instance_uldaman : public ScriptedInstance void SetData (uint32 /*type*/, uint32 data) { - //error_log ("SetData: data = %d", data); + //sLog.outError ("SetData: data = %d", data); if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor); if (data == 0) OpenDoor (archaedasTempleDoor); if (data == 3) OpenDoor (ancientVaultDoor); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp index 2bd8387efa5..34cf68d0d21 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ mob_jadespine_basilisk npc_lore_keeper_of_norgannon EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## mob_jadespine_basilisk diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index f516065cc03..2be5b6caacb 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -1,18 +1,20 @@ -/* Copyright ?2006 - 2008 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_Akilzon @@ -23,7 +25,7 @@ SQLUpdate: EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" #include "Weather.h" @@ -94,7 +96,7 @@ struct boss_akilzonAI : public ScriptedAI GustOfWind_Timer = urand(20000,30000); //20 to 30 seconds(bosskillers) CallLighting_Timer = urand(10000,20000); //totaly random timer. can't find any info on this ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) - Enrage_Timer = 10*MINUTE*IN_MILISECONDS; //10 minutes till enrage(bosskillers) + Enrage_Timer = 10*MINUTE*IN_MILLISECONDS; //10 minutes till enrage(bosskillers) SummonEagles_Timer = 99999; TargetGUID = 0; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index aee0a8a59ea..a846e3f8779 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_Halazzi @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" //#include "spell.h" diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 7baa9292142..5fa14fb56ab 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -1,18 +1,20 @@ -/* Copyright ?2006,2007 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2007 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Hex_Lord_Malacrass @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" #define YELL_AGGRO "Da shadow gonna fall on you... " diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 9ac54976241..073fff60456 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -1,18 +1,20 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Janalai @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" #include "GridNotifiers.h" @@ -141,7 +143,7 @@ struct boss_janalaiAI : public ScriptedAI BombSequenceTimer = 1000; BombCount = 0; HatcherTimer = 10000; - EnrageTimer = MINUTE*5*IN_MILISECONDS; + EnrageTimer = MINUTE*5*IN_MILLISECONDS; noeggs = false; isBombing =false; @@ -242,7 +244,7 @@ struct boss_janalaiAI : public ScriptedAI cell.Visit(pair, cSearcher, *(me->GetMap())); } - //error_log("Eggs %d at middle", templist.size()); + //sLog.outError("Eggs %d at middle", templist.size()); if (!templist.size()) return false; @@ -508,7 +510,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI cell.Visit(pair, cSearcher, *(me->GetMap())); } - //error_log("Eggs %d at %d", templist.size(), side); + //sLog.outError("Eggs %d at %d", templist.size(), side); for (std::list::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i) if ((*i)->GetDisplayId() != 11686) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index ae5c6596d2d..42762fe7baa 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -1,18 +1,20 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Nalorakk @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" #include "GridNotifiers.h" diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index 91cfa728f89..fbd34c34228 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006,2007,2008 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_ZulJin @@ -20,7 +22,7 @@ SD%Complete: 85% SDComment: EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" //Speech diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 897330691a6..4a3096b302e 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -1,18 +1,20 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: instance_zulaman @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Aman EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" #define MAX_ENCOUNTER 6 @@ -172,7 +174,7 @@ struct instance_zulaman : public ScriptedInstance ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute; char* data = new char[ss.str().length()+1]; strcpy(data, ss.str().c_str()); - //error_log("TSCR: Zul'aman saved, %s.", data); + //sLog.outError("TSCR: Zul'aman saved, %s.", data); return data; } @@ -180,17 +182,17 @@ struct instance_zulaman : public ScriptedInstance { if (!load) return; std::istringstream ss(load); - //error_log("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); + //sLog.outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); char dataHead; // S uint16 data1, data2, data3; ss >> dataHead >> data1 >> data2 >> data3; - //error_log("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3); + //sLog.outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3); if (dataHead == 'S') { BossKilled = data1; ChestLooted = data2; QuestMinute = data3; - } else error_log("TSCR: Zul'aman: corrupted save data."); + } else sLog.outError("TSCR: Zul'aman: corrupted save data."); } void SetData(uint32 type, uint32 data) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 067ae687644..a27ae768dba 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Zulaman @@ -25,7 +27,7 @@ EndScriptData */ npc_forest_frog EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulaman.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 6fb0ef173bd..ad2d83f659f 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_ZULAMAN_H #define DEF_ZULAMAN_H diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index cbbe6c4dc4c..80d6d76da4d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Wrong cleave and red aura is missing. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" bool GOHello_go_gong_of_bethekk(Player* /*pPlayer*/, GameObject* pGo) @@ -170,7 +172,7 @@ struct boss_arlokkAI : public ScriptedAI MarkedTargetGUID = pMarkedTarget->GetGUID(); } else - error_log("TSCR: boss_arlokk could not accuire pMarkedTarget."); + sLog.outError("TSCR: boss_arlokk could not accuire pMarkedTarget."); m_uiMark_Timer = 15000; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 0201235be70..ee65b4f5e61 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Massive Geyser with knockback not working. Spell buggy. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_FROSTBREATH 16099 #define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 67de135674a..e2914b1e8e0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SPELL_AVARTAR 24646 //The Enrage Spell diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index d7dd5020b74..8ed073c56d3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Blood siphon spell buggy cause of Core Issue. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_AGGRO -1309020 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index ca67d0842c3..a079a451f43 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SPELL_MANABURN 26046 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index fae05fcf384..3642ffa6a1b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Problem in finding the right flying batriders for spawning and making SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_AGGRO -1309002 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 58f91f85a95..a192a1fcbf3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Mind Control not working because of core bug. Shades visible for all. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_AGGRO -1309014 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 4609605f3c1..2fdae639e46 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Ohgan function needs improvements. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_AGGRO -1309015 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 77e9f9b929f..76f89ebf6ca 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_AGGRO -1309005 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index f7b01b26e19..3d1d19bed40 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SPELL_AMBUSH 24337 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 179700d36e7..7e1aa2db350 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Almost finished. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_AGGRO -1309009 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index ec1a7a142b5..f7e1ae27296 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SAY_TRANSFORM -1309000 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index a71d7e0504a..051e556b698 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" #define SPELL_LIGHTNINGCLOUD 25033 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index aaed1c6df3a..89f30ff134e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing reset function after killing a boss for Ohgan, Thekal. SDCategory: Zul'Gurub EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "zulgurub.h" struct instance_zulgurub : public ScriptedInstance diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index bf55a54c1d5..9ca8d3e9fa1 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_ZULGURUB_H #define DEF_ZULGURUB_H diff --git a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp index 8695a73131c..e54f0840988 100644 --- a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -24,7 +26,7 @@ EndScriptData */ /* ContentData EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*void AddSC_alterac_mountains() { diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 86edbc2ed9d..5a5d229a109 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_professor_phizzlethorpe EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp index 768242fcd22..cbeb8d45ffe 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_deathly_usher npc_fallen_hero_of_horde EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_deathly_usher diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index 44a6431f9ea..d6a6cb76d59 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Highlord Kruul are presumably no longer in-game on regular bases, how SDCategory: Bosses EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_SHADOWVOLLEY 21341 #define SPELL_CLEAVE 20677 diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index 5a1e338b70f..de543258b40 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_ragged_john EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_ragged_john diff --git a/src/server/scripts/EasternKingdoms/dun_morogh.cpp b/src/server/scripts/EasternKingdoms/dun_morogh.cpp index 4c47cc8bbb8..c170529aa45 100644 --- a/src/server/scripts/EasternKingdoms/dun_morogh.cpp +++ b/src/server/scripts/EasternKingdoms/dun_morogh.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_narm_faulk EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_narm_faulk diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp index 89c0ebe4213..3dcf9a01f6a 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/duskwood.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 kb_z - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Quest Support:8735 SDCategory: Duskwood EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### # at_twilight_grove diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 0c1d3e9072c..32091439b1f 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -28,7 +30,7 @@ npc_darrowshire_spirit npc_tirion_fordring EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //id8530 - cannibal ghoul //id8531 - gibbering ghoul diff --git a/src/server/scripts/EasternKingdoms/elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/elwynn_forest.cpp index b978507c557..8b56c16f8fa 100644 --- a/src/server/scripts/EasternKingdoms/elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/elwynn_forest.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_henze_faulk EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_henze_faulk diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index d1c7b9a6bfe..beb7acb3217 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -29,7 +31,7 @@ npc_kelerun_bloodmourn go_harbinger_second_trial EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 67e4e764959..b429bd03ec7 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -28,7 +30,7 @@ npc_rathis_tomber npc_ranger_lilatha EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 59002936e14..12c5a3acda3 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_00x09hl npc_rinji EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -99,7 +101,7 @@ struct npc_00x09hlAI : public npc_escortAI } } - void Aggro(Unit* pWho) + void EnterCombat(Unit* pWho) { if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER) return; diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 5be56cc6c9c..da215065c6d 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_royal_historian_archesonus EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_royal_historian_archesonus diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index e5a70fcb1af..2bb7a723b06 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_converted_sentry npc_greengill_slave EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_converted_sentry diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index e99a13fb675..1a5dafb8b17 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_mountaineer_pebblebitty EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_mountaineer_pebblebitty diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index 2f0b5821e86..ac02be30aa7 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -1,18 +1,18 @@ -/* Copyright (C) 2008-2010 Trinity +/* + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* Script Data Start @@ -21,7 +21,7 @@ SD%Complete: 100% SDComment: Support for quest 219. Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" enum eCorporalKeeshan diff --git a/src/server/scripts/EasternKingdoms/searing_gorge.cpp b/src/server/scripts/EasternKingdoms/searing_gorge.cpp index 3ad51d033da..602fdeb2b59 100644 --- a/src/server/scripts/EasternKingdoms/searing_gorge.cpp +++ b/src/server/scripts/EasternKingdoms/searing_gorge.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_lothos_riftwaker npc_zamael_lunthistle EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_kalaran_windblade diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index 390f083be48..b636f20bb44 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_blood_knight_stillblade EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*####### # npc_blood_knight_stillblade diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index dd67f048f32..cd88974788e 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_deathstalker_erland pyrewood_ambush EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -231,7 +233,7 @@ struct pyrewood_ambushAI : public ScriptedAI } } - void Aggro(Unit * /*who*/){} + void EnterCombat(Unit * /*who*/){} void JustSummoned(Creature *pSummoned) { diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 36a7d116c3b..72d1a3b693b 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -32,7 +34,7 @@ npc_marzon_silent_blade npc_lord_gregor_lescovar EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp index 08d364d1808..503e27f993c 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ mob_yenniku EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## mob_yenniku diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 8b6d73df704..94fb836ca35 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ go_mausoleum_door go_mausoleum_trigger EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_calvin_montague diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index 22eb3241874..017dab5b63d 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_highborne_lamenter npc_parqual_fintallas EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_lady_sylvanas_windrunner diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 778bcea0b1e..3dddf3a3f80 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -28,7 +30,7 @@ npc_the_scourge_cauldron npc_andorhal_tower EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 6f2f439f7fb..e706594dcf5 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_daphne_stilwell npc_defias_traitor EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp index 02f7abdf4c2..084b673dacd 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_mikhail npc_tapoke_slim_jahn EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -61,7 +63,7 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI { case 2: if (me->HasStealthAura()) - me->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); SetRun(); me->setFaction(FACTION_ENEMY); @@ -69,7 +71,7 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI } } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* /*pWho*/) { Player* pPlayer = GetPlayerForEscort(); diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index 856b680e2e6..6c10644564d 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Short custom scripting example SDCategory: Script Examples EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" // **** This script is designed as an example for others to build on **** // **** Please modify whatever you'd like to as this script is only for developement **** diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index bf2b454bf8e..2b381c53451 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Script used for testing escortAI SDCategory: Script Examples EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" enum eEnums diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp index e208722784a..b86f1ffacdb 100644 --- a/src/server/scripts/Examples/example_gossip_codebox.cpp +++ b/src/server/scripts/Examples/example_gossip_codebox.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Show a codebox in gossip option SDCategory: Script Examples EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include enum eEnums diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp index 3c96cc0bae7..af17b922602 100644 --- a/src/server/scripts/Examples/example_misc.cpp +++ b/src/server/scripts/Examples/example_misc.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Item, Areatrigger and other small code examples SDCategory: Script Examples EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptMgr.h" enum eSay diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index a3fd42a0fe7..f217661871c 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackfathom_deeps.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h index e8bbab9f105..25e3806c624 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_BFD_H #define DEF_BFD_H diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index a4b7a160be8..9037fe25ff3 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackfathom_deeps.h" enum Spells diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 374a526f098..2525f949f89 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackfathom_deeps.h" enum Spells diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index bd7e1014d1a..a8183971a98 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackfathom_deeps.h" enum Spells diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp index a485684e699..99ddd5cdd82 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Blackfathom Deeps EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blackfathom_deeps.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 14ce4a59b37..e70eefe62d5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "hyjal_trash.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 8e1fa378e07..04a838d9adb 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Doomfires not completely offlike due to core limitations for random m SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "SpellAuras.h" #include "hyjal_trash.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 69e37f7f740..50b86c7fa30 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "hyjal_trash.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index b52d22842e3..2e9228b2f75 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "hyjal_trash.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 7465b997117..28b32e19063 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "hyjal_trash.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 16a050939cc..4f524587525 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_thrall npc_tyrande_whisperwind EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjalAI.h" #define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." @@ -105,7 +107,7 @@ bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uin break; case GOSSIP_ACTION_INFO_DEF: ai->Debug = !ai->Debug; - debug_log("TSCR: HyjalAI - Debug mode has been toggled"); + sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled"); break; } return true; @@ -175,7 +177,7 @@ bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 /*uiSe break; case GOSSIP_ACTION_INFO_DEF: ai->Debug = !ai->Debug; - debug_log("TSCR: HyjalAI - Debug mode has been toggled"); + sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled"); break; } return true; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index bfc9a54dfd9..6a57dc550fa 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_HYJAL_H #define DEF_HYJAL_H diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 3c12b54f3f4..dbd0696631e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjalAI.h" #include "hyjal_trash.h" #include "MapManager.h" @@ -400,7 +402,7 @@ void hyjalAI::Reset() pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); } - } else error_log(ERROR_INST_DATA); + } else sLog.outError(ERROR_INST_DATA); //Visibility DoHide = true; @@ -531,7 +533,7 @@ void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) if (!pInstance) { - error_log(ERROR_INST_DATA); + sLog.outError(ERROR_INST_DATA); return; } InfernalCount = 0;//reset infernal count every new wave @@ -561,7 +563,7 @@ void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) else { NextWaveTimer = 15000; - debug_log("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); + sLog.outDebug("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); } } else @@ -605,7 +607,7 @@ uint32 hyjalAI::GetInstanceData(uint32 Event) { if (pInstance) return pInstance->GetData(Event); - else error_log(ERROR_INST_DATA); + else sLog.outError(ERROR_INST_DATA); return 0; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index 5c75465b7b4..245e719295a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef SC_HYJALAI_H #define SC_HYJALAI_H diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index c4cf9ede397..dd889b9fee6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -1,5 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "hyjal_trash.h" #include "hyjalAI.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h index 21ee4bc06cc..b18fa74e6a4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef SC_HYJAL_TRASH_AI_H #define SC_HYJAL_TRASH_AI_H diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index e89d518c5bc..65579498210 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hyjal.h" #include "hyjal_trash.h" @@ -248,7 +250,7 @@ struct instance_mount_hyjal : public ScriptedInstance break; } - debug_log("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); + sLog.outDebug("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); if (data == DONE) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp index 287d3cf8e9b..7aa4b04a750 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* Script Data Start @@ -25,7 +24,7 @@ SDComment: TODO: Intro, consecutive attacks to a random target durin time wrap, SDCategory: Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" enum Spells diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 12cdf00f2a5..60a46159fa7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" enum Spells diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index a39f3289a5a..deabd11961f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* Script Data Start SDName: Boss mal_ganis @@ -27,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_mal_ganis' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" enum Spells diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index eba9733c745..4ab1c3023e6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* Script Data Start SDName: Boss meathook @@ -24,7 +23,7 @@ SDComment: It may need timer adjustment SDCategory: Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" enum Spells diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp index da1c8098517..98c8d34bb8a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* Script Data Start SDName: Boss salramm @@ -27,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_salramm' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" enum Spells diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index faaed2eb6db..4e340d13ea4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h index 4278ad46500..2f1816e5221 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_CULLING_OF_STRATHOLME_H #define DEF_CULLING_OF_STRATHOLME_H diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 73742a1e748..a64a0a03976 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "culling_of_stratholme.h" #define MAX_ENCOUNTER 5 diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp index 49cf7cd4433..e95c440a7aa 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Some spells not implemented SDCategory: Caverns of Time, The Dark Portal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "dark_portal.h" enum eEnums diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp index 1f2b4a80612..4845a39f2fe 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: All abilities not implemented SDCategory: Caverns of Time, The Dark Portal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "dark_portal.h" enum eEnums diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp index 04b4b020ead..61888422d60 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: More abilities need to be implemented SDCategory: Caverns of Time, The Dark Portal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "dark_portal.h" enum eEnums diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index b0432a9b57c..d0387eb5a34 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Dark_Portal @@ -27,7 +29,7 @@ npc_time_rift npc_saat EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "dark_portal.h" #define SAY_ENTER -1269020 //where does this belong? @@ -305,7 +307,7 @@ struct npc_time_riftAI : public ScriptedAI mRiftWaveCount = 0; entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - debug_log("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); + sLog.outDebug("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); ++mRiftWaveCount; @@ -330,7 +332,7 @@ struct npc_time_riftAI : public ScriptedAI if (me->IsNonMeleeSpellCasted(false)) return; - debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die."); + sLog.outDebug("TSCR: npc_time_rift: not casting anylonger, i need to die."); me->setDeathState(JUST_DIED); if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h index 7bfd8c917d7..301c174accf 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_DARKPORTAL_H #define DEF_DARKPORTAL_H diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp index d1280230808..b68310b4a18 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Instance_Dark_Portal @@ -21,7 +23,7 @@ SDComment: Quest support: 9836, 10297. Currently in progress. SDCategory: Caverns of Time, The Dark Portal EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "dark_portal.h" #define MAX_ENCOUNTER 2 @@ -178,7 +180,7 @@ struct instance_dark_portal : public ScriptedInstance { if (data == IN_PROGRESS) { - debug_log("TSCR: Instance Dark Portal: Starting event."); + sLog.outDebug("TSCR: Instance Dark Portal: Starting event."); InitWorldState(); m_auiEncounter[1] = IN_PROGRESS; NextPortal_Timer = 15000; @@ -187,7 +189,7 @@ struct instance_dark_portal : public ScriptedInstance if (data == DONE) { //this may be completed further out in the post-event - debug_log("TSCR: Instance Dark Portal: Event completed."); + sLog.outDebug("TSCR: Instance Dark Portal: Event completed."); Map::PlayerList const& players = instance->GetPlayers(); if (!players.isEmpty()) @@ -252,7 +254,7 @@ struct instance_dark_portal : public ScriptedInstance if (entry == RIFT_BOSS) entry = RandRiftBoss(); - debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); + sLog.outDebug("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); Position pos; me->GetRandomNearPosition(pos, 10.0f); @@ -263,7 +265,7 @@ struct instance_dark_portal : public ScriptedInstance if (Creature *summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) return summon; - debug_log("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); + sLog.outDebug("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); return NULL; } @@ -276,7 +278,7 @@ struct instance_dark_portal : public ScriptedInstance if (tmp >= CurrentRiftId) ++tmp; - debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + sLog.outDebug("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); CurrentRiftId = tmp; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 91c9e274b83..013846e576a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + s SDCategory: Caverns of Time, Old Hillsbrad Foothills EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "old_hillsbrad.h" #define SAY_ENTER -1560000 diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 2c2ad96ddb7..92e0ac31a2b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing spawns pre-event, missing speech to be coordinated with rest SDCategory: Caverns of Time, Old Hillsbrad Foothills EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "old_hillsbrad.h" #define SAY_ENTER1 -1560013 diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index dae0f5390b1..6fc67249925 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing proper code for patrolling area after being spawned. Script f SDCategory: Caverns of Time, Old Hillsbrad Foothills EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "old_hillsbrad.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index fa0b7c14595..85536bacd7e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: If thrall escort fail, all parts will reset. In future, save sub-part SDCategory: Caverns of Time, Old Hillsbrad Foothills EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "old_hillsbrad.h" #define MAX_ENCOUNTER 6 @@ -71,7 +73,7 @@ struct instance_old_hillsbrad : public ScriptedInstance } } - debug_log("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + sLog.outDebug("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -111,7 +113,7 @@ struct instance_old_hillsbrad : public ScriptedInstance if (!pPlayer) { - debug_log("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); + sLog.outDebug("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); return; } @@ -127,7 +129,7 @@ struct instance_old_hillsbrad : public ScriptedInstance ++mBarrelCount; DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); - debug_log("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); + sLog.outDebug("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); m_auiEncounter[0] = IN_PROGRESS; @@ -148,7 +150,7 @@ struct instance_old_hillsbrad : public ScriptedInstance { ++mThrallEventCount; m_auiEncounter[1] = NOT_STARTED; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); m_auiEncounter[2] = NOT_STARTED; m_auiEncounter[3] = NOT_STARTED; m_auiEncounter[4] = NOT_STARTED; @@ -161,29 +163,29 @@ struct instance_old_hillsbrad : public ScriptedInstance m_auiEncounter[3] = data; m_auiEncounter[4] = data; m_auiEncounter[5] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); } } else m_auiEncounter[1] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); break; } case TYPE_THRALL_PART1: m_auiEncounter[2] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); break; case TYPE_THRALL_PART2: m_auiEncounter[3] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); break; case TYPE_THRALL_PART3: m_auiEncounter[4] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); break; case TYPE_THRALL_PART4: m_auiEncounter[5] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); + sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); break; } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index 08c63954db5..400fca670e2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_thrall_old_hillsbrad npc_taretha EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "old_hillsbrad.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h index 5c398cc2647..c775d5243f9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_OLD_HILLSBRAD_H #define DEF_OLD_HILLSBRAD_H diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 6f6b9d1baa9..61cd06f0f1c 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_WRATH 21807 #define SPELL_ENTANGLINGROOTS 12747 diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp index d5b03ff218f..b7d89607857 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_KNOCKAWAY 18670 #define SPELL_TRAMPLE 5568 diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp index b49b1a5d71f..f2856e89fd1 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_TOXICVOLLEY 21687 #define SPELL_UPPERCUT 22916 @@ -94,7 +96,7 @@ struct boss_noxxionAI : public ScriptedAI //Adds_Timer if (!Invisible && Adds_Timer <= diff) { - //Inturrupt any spell casting + //Interrupt any spell casting //me->m_canMove = true; me->InterruptNonMeleeSpells(false); me->setFaction(35); diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index 963863e89c8..9bd8735f4d2 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Maraudon EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_DUSTFIELD 21909 #define SPELL_BOULDER 21832 diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 2d351d6c6a2..b346f848510 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -1,17 +1,18 @@ -/* Copyright (C) 2008 - 2010 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +26,7 @@ SDComment: SDCategory: Onyxia's Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "onyxias_lair.h" enum eYells diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index cfd66bf80f4..36a2712fe6d 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -1,17 +1,18 @@ -/* Copyright (C) 2008 - 2010 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +22,7 @@ SDComment: SDCategory: Onyxia's Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "onyxias_lair.h" struct instance_onyxias_lair : public ScriptedInstance @@ -136,7 +137,7 @@ struct instance_onyxias_lair : public ScriptedInstance { m_bAchievManyWhelpsHandleIt = false; m_uiManyWhelpsCounter = 0; - m_uiOnyxiaLiftoffTimer = 10*IN_MILISECONDS; + m_uiOnyxiaLiftoffTimer = 10*IN_MILLISECONDS; } break; case DATA_SHE_DEEP_BREATH_MORE: diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h index cadd5b5a2d5..9eccc6c42d1 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h +++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h @@ -1,17 +1,18 @@ -/* Copyright (C) 2008 - 2010 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_ONYXIAS_LAIR_H diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index 711c4f0b2c1..4157903bf75 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Razorfen Downs EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1129000 #define SAY_SUMMON60 -1129001 diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp index 04904f08a57..6e67569f6d8 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "razorfen_downs.h" #define MAX_ENCOUNTER 1 diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 3e8f4049a37..3eed9ee07f9 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_henry_stern EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "razorfen_downs.h" /*### diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h index a67b4223c4a..53f33eb5cea 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_RAZORFEN_DOWNS_H diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp index 8a92d3d4d89..691462e595d 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Razorfen Kraul EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "razorfen_kraul.h" #define WARD_KEEPERS_NR 2 @@ -53,7 +55,7 @@ struct instance_razorfen_kraul : public ScriptedInstance return plr; } } - debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); + sLog.outDebug("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 8470fa6c7ac..a2aa56fb2d2 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_willix EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "razorfen_kraul.h" diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h index e2219986f63..3944a3300be 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_RAZORFEN_KRAUL_H diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index f6dc75558c8..9e1c4e1af53 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: VERIFY SCRIPT SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" /* diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index 86a2c559543..d8f6bece646 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Place Holder SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" enum Yells diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index 44f11bf4b60..c1dba225462 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: VERIFY SCRIPT AND SQL SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" enum Spells diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 1882adc8fbb..361bb149ce7 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: TODO: Adjust timer, correct Stone phase buff SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" enum Emotes diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 57ba8d9da7f..9b4f0430c4a 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Place holder SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" enum Yells diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 5be60dc0ca0..3346e57685f 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Place Holder SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" enum Yells diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp index ba7471bdbd2..26ac218e298 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Place holder SDCategory: Ruins of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ruins_of_ahnqiraj.h" #define MAX_ENCOUNTER 6 diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h index 33fd75d557a..89fc66e686d 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_RUINS_OF_AHNQIRAJ_H #define DEF_RUINS_OF_AHNQIRAJ_H diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index f6e3b0c741b..fe7a66ddb1f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "temple_of_ahnqiraj.h" #define SPELL_CLEAVE 26350 diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 3e42d16be3a..40314e012e8 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Darkglare tracking issue SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "temple_of_ahnqiraj.h" /* @@ -168,7 +170,7 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI { pInst = c->GetInstanceData(); if (!pInst) - error_log("TSCR: No Instance eye_of_cthunAI"); + sLog.outError("TSCR: No Instance eye_of_cthunAI"); } ScriptedInstance* pInst; @@ -460,7 +462,7 @@ struct cthunAI : public Scripted_NoMovementAI pInst = c->GetInstanceData(); if (!pInst) - error_log("TSCR: No Instance eye_of_cthunAI"); + sLog.outError("TSCR: No Instance eye_of_cthunAI"); } ScriptedInstance* pInst; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 32d5ec1c3df..5bcc9598ebf 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: sound not implemented SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SOUND_SENTENCE_YOU 8588 #define SOUND_SERVE_TO 8589 diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index f0e3a425edd..468d535c48a 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define EMOTE_GENERIC_FRENZY_KILL -1000001 #define EMOTE_GENERIC_BERSERK -1000004 diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 1dd642c38f4..7a07c8f81a3 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: No model for submerging. Currently just invisible. SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "temple_of_ahnqiraj.h" #define SPELL_SWEEP 26103 diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index 282a25b7215..18bd1af71a5 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1531008 #define SAY_SLAY -1531009 diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 7e52bed750c..06b753bd5f5 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Mind Control buggy. SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "temple_of_ahnqiraj.h" #include "Group.h" diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 73f17485f7f..39938d64dc5 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "temple_of_ahnqiraj.h" #include "WorldPacket.h" diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index f5e71a35bae..a6cb13c5348 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: place holder SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_POISON_SHOCK 25993 #define SPELL_POISONBOLT_VOLLEY 25991 diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index 1125a0c8623..9f105e27a1d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "temple_of_ahnqiraj.h" struct instance_temple_of_ahnqiraj : public ScriptedInstance diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 074f9ed68ae..e0ce8834b6d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Shadow storm is not properly implemented in core it should only pTarg SDCategory: Temple of Ahn'Qiraj EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "WorldPacket.h" #include "Item.h" diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index 5d545ed7c74..143747e5b9d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_TEMPLE_OF_AHNQIRAJ_H #define DEF_TEMPLE_OF_AHNQIRAJ_H diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp index 287b5db6d57..6edcf9b72cf 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Everything seems to work, still need some checking SDCategory: Wailing Caverns EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "wailing_caverns.h" #define MAX_ENCOUNTER 9 diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 544c119fc93..18efcbfdd04 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Wailing Caverns @@ -24,7 +26,7 @@ EndScriptData */ /* ContentData EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "wailing_caverns.h" diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h index 6ef1a673c59..9d69bf6947c 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_WAILING_CAVERNS_H #define DEF_WAILING_CAVERNS_H diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 530ef30f44c..458111e464e 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define NPC_GAHZRILLA 7273 diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 2ca053c23b6..2b02146a6dc 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_sergeant_bly npc_weegli_blastfuse EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_sergeant_bly diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 13e8f442048..2d1b39de980 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Ashenvale @@ -26,7 +28,7 @@ npc_torek npc_ruul_snowhoof EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*#### @@ -323,7 +325,7 @@ struct npc_muglashAI : public npc_escortAI } } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* /*pWho*/) { if (HasEscortState(STATE_ESCORT_PAUSED)) { diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 937afe0ae5d..656730f687f 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -28,7 +30,7 @@ mob_rizzle_sprysprocket mob_depth_charge EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "World.h" #include "WorldPacket.h" diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index d31eaa9e84b..ca35b48b970 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -1,17 +1,19 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + /* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -32,7 +34,7 @@ go_ravager_cage npc_death_ravager EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include @@ -512,7 +514,7 @@ struct npc_geezleAI : public ScriptedAI else (*itr)->Respawn(); } - } else error_log("SD2 ERROR: FlagList is empty!"); + } else sLog.outError("SD2 ERROR: FlagList is empty!"); } void UpdateAI(const uint32 diff) @@ -667,6 +669,67 @@ CreatureAI* GetAI_npc_death_ravagerAI(Creature* pCreature) return new npc_death_ravagerAI(pCreature); } +/*######## +## Quest: The Prophecy of Akida +########*/ +enum BristlelimbCage +{ + QUEST_THE_PROPHECY_OF_AKIDA = 9544, + NPC_STILLPINE_CAPITIVE = 17375, + GO_BRISTELIMB_CAGE = 181714, + CAPITIVE_SAY_1 = -1000474, + CAPITIVE_SAY_2 = -1000475, + CAPITIVE_SAY_3 = -1000476 +}; + + +struct npc_stillpine_capitiveAI : public ScriptedAI +{ + npc_stillpine_capitiveAI(Creature *c) : ScriptedAI(c){} + + uint32 FleeTimer; + + void Reset() + { + FleeTimer = 0; + GameObject* cage = me->FindNearestGameObject(GO_BRISTELIMB_CAGE, 5.0f); + if(cage) + cage->ResetDoorOrButton(); + } + + void UpdateAI(const uint32 diff) + { + if(FleeTimer) + { + if(FleeTimer <= diff) + me->ForcedDespawn(); + else FleeTimer -= diff; + } + } +}; + +CreatureAI* GetAI_npc_stillpine_capitiveAI(Creature* pCreature) +{ + return new npc_stillpine_capitiveAI(pCreature); +} + +bool go_bristlelimb_cage(Player* pPlayer, GameObject* pGo) +{ + if(pPlayer->GetQuestStatus(QUEST_THE_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) + { + Creature* pCreature = pGo->FindNearestCreature(NPC_STILLPINE_CAPITIVE, 5.0f, true); + if(pCreature) + { + DoScriptText(RAND(CAPITIVE_SAY_1, CAPITIVE_SAY_2, CAPITIVE_SAY_3), pCreature, pPlayer); + pCreature->GetMotionMaster()->MoveFleeing(pPlayer, 3500); + pPlayer->KilledMonsterCredit(pCreature->GetEntry(), pCreature->GetGUID()); + CAST_AI(npc_stillpine_capitiveAI, pCreature->AI())->FleeTimer = 3500; + return false; + } + } + return true; +} + void AddSC_azuremyst_isle() { Script *newscript; @@ -714,5 +777,15 @@ void AddSC_azuremyst_isle() newscript->Name="go_ravager_cage"; newscript->pGOHello = &go_ravager_cage; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_stillpine_capitive"; + newscript->GetAI = &GetAI_npc_stillpine_capitiveAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_bristlelimb_cage"; + newscript->pGOHello = &go_bristlelimb_cage; + newscript->RegisterSelf(); } diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index 108d03b8976..9e8c7bbe563 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ mob_webbed_creature npc_captured_sunhawk_agent EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## mob_webbed_creature diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 8aeedfa199e..b8b40e3c510 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Teleport not included, spell reflect not effecting dots (Core problem SDCategory: Azshara EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_TELEPORT -1000100 diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 26b42a86422..8cdb8990dbd 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_prospector_remtravel npc_threshwackonator EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index 6b3ec8071dd..f9f79ffc917 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_aged_dying_ancient_kodo EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" enum eDyingKodo diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 9ca6074cad3..fd2ed655f05 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -1,22 +1,23 @@ -/* Copyright (C) 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ##Quest 5441: Lazy Peons diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index a80c514eed7..a5190cbdd30 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -31,7 +33,7 @@ npc_private_hendel npc_cassa_crimsonwing - handled by npc_taxi EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## mobs_risen_husk_spirit diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 01da356a63e..66757e0de36 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npcs_riverbreeze_and_silversky EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npcs_riverbreeze_and_silversky diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 2a87de1a67c..86117e80616 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer SDCategory: Feralas EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 16c78f20812..4fe0b3a5333 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -29,7 +31,7 @@ npc_clintar_spirit npc_clintar_dreamwalker EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index c87e5e36dad..ff06012cbf6 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_kyle_frenzied npc_plains_vision EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index 71fa4381e9d..5dd273d9be4 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_shenthul npc_thrall_warchief EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_neeru_fireblade diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 6383284011f..75c4e8d1158 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npcs_rutgar_and_frankal quest_a_pawn_on_the_eternal_pawn EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*### ## npc_highlord_demitrian diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index 6e627948788..17ad95c2cee 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ npc_braug_dimspirit npc_kaya_flathoof EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index bb82dea64cf..7ef9e5039d9 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -31,7 +33,7 @@ npc_OOX17 npc_tooga EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/teldrassil.cpp index 1607ab904a8..a6659dcd6d9 100644 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ b/src/server/scripts/Kalimdor/teldrassil.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_mist EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedFollowerAI.h" /*#### diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index 04daac96877..901e3b8b923 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -30,7 +32,7 @@ npc_twiggy_flathead npc_wizzlecrank_shredder EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -123,7 +125,7 @@ struct npc_giltharesAI : public npc_escortAI } } - void Aggro(Unit* pWho) + void EnterCombat(Unit* pWho) { //not always use if (rand()%4) diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 3f54a62dd0b..6aded229ddd 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -30,7 +32,7 @@ go_panther_cage npc_enraged_panther EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*##### diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index 288f00946f0..71c2c174fc7 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Quest support: 925 SDCategory: Thunder Bluff EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*##### # npc_cairne_bloodhoof diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 2be4a95eb4b..19181ba570f 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Ungoro Crater @@ -26,7 +28,7 @@ npc_a-me npc_ringo EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index a284f32aeaa..c07f80b7c91 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_rivern_frostwind npc_witch_doctor_mauari EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_lorax diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h index 4113885b6f4..d936d6a8c90 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_AZJOL_NERUB_H diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 6de6578f7bb..65c649c4225 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "azjol_nerub.h" //SQL: UPDATE creature_template SET mechanic_immune_mask = 1073741823 WHERE name like "anub'arak%"; @@ -118,10 +117,10 @@ struct boss_anub_arakAI : public ScriptedAI void Reset() { - uiCarrionBeetlesTimer = 8*IN_MILISECONDS; - uiLeechingSwarmTimer = 20*IN_MILISECONDS; - uiImpaleTimer = 9*IN_MILISECONDS; - uiPoundTimer = 15*IN_MILISECONDS; + uiCarrionBeetlesTimer = 8*IN_MILLISECONDS; + uiLeechingSwarmTimer = 20*IN_MILLISECONDS; + uiImpaleTimer = 9*IN_MILLISECONDS; + uiPoundTimer = 15*IN_MILLISECONDS; uiPhase = PHASE_MELEE; uiUndergroundPhase = 0; @@ -145,7 +144,7 @@ struct boss_anub_arakAI : public ScriptedAI Position targetPos; pTarget->GetPosition(&targetPos); - if (TempSummon* pImpaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILISECONDS)) + if (TempSummon* pImpaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS)) { uiImpaleTarget = pImpaleTarget->GetGUID(); pImpaleTarget->SetReactState(REACT_PASSIVE); @@ -184,7 +183,7 @@ struct boss_anub_arakAI : public ScriptedAI { if (Creature *pImpaleTarget = DoSummonImpaleTarget(target)) pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true); - uiImpaleTimer = 3*IN_MILISECONDS; + uiImpaleTimer = 3*IN_MILLISECONDS; uiImpalePhase = IMPALE_PHASE_ATTACK; } break; @@ -195,13 +194,13 @@ struct boss_anub_arakAI : public ScriptedAI pImpaleTarget->RemoveAurasDueToSpell(SPELL_IMPALE_SHAKEGROUND); } uiImpalePhase = IMPALE_PHASE_DMG; - uiImpaleTimer = 1*IN_MILISECONDS; + uiImpaleTimer = 1*IN_MILLISECONDS; break; case IMPALE_PHASE_DMG: if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget)) me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true); uiImpalePhase = IMPALE_PHASE_TARGET; - uiImpaleTimer = 9*IN_MILISECONDS; + uiImpaleTimer = 9*IN_MILLISECONDS; break; } } else uiImpaleTimer -= diff; @@ -275,12 +274,12 @@ struct boss_anub_arakAI : public ScriptedAI bVenomancerSummoned = false; bDatterSummoned = false; - uiUndergroundTimer = 40*IN_MILISECONDS; - uiVenomancerTimer = 25*IN_MILISECONDS; - uiDatterTimer = 32*IN_MILISECONDS; + uiUndergroundTimer = 40*IN_MILLISECONDS; + uiVenomancerTimer = 25*IN_MILLISECONDS; + uiDatterTimer = 32*IN_MILLISECONDS; uiImpalePhase = 0; - uiImpaleTimer = 9*IN_MILISECONDS; + uiImpaleTimer = 9*IN_MILLISECONDS; DoCast(me, SPELL_SUBMERGE, false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); @@ -299,13 +298,13 @@ struct boss_anub_arakAI : public ScriptedAI { bChanneling = true; DoCastVictim(SPELL_CARRION_BEETLES); - uiCarrionBeetlesTimer = 25*IN_MILISECONDS; + uiCarrionBeetlesTimer = 25*IN_MILLISECONDS; } else uiCarrionBeetlesTimer -= diff; if (uiLeechingSwarmTimer <= diff) { DoCast(me, SPELL_LEECHING_SWARM, true); - uiLeechingSwarmTimer = 19*IN_MILISECONDS; + uiLeechingSwarmTimer = 19*IN_MILLISECONDS; } else uiLeechingSwarmTimer -= diff; if (uiPoundTimer <= diff) @@ -315,7 +314,7 @@ struct boss_anub_arakAI : public ScriptedAI if (Creature *pImpaleTarget = DoSummonImpaleTarget(target)) me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false); } - uiPoundTimer = 16.5*IN_MILISECONDS; + uiPoundTimer = 16.5*IN_MILLISECONDS; } else uiPoundTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 0fc4e87d7c5..7b8a81013be 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* @@ -29,7 +28,7 @@ * Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn. */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "azjol_nerub.h" enum Spells @@ -72,12 +71,12 @@ struct boss_hadronoxAI : public ScriptedAI me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f); - uiAcidTimer = urand(10*IN_MILISECONDS,14*IN_MILISECONDS); - uiLeechTimer = urand(3*IN_MILISECONDS,9*IN_MILISECONDS); - uiPierceTimer = urand(1*IN_MILISECONDS,3*IN_MILISECONDS); - uiGrabTimer = urand(15*IN_MILISECONDS,19*IN_MILISECONDS); - uiDoorsTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); - uiCheckDistanceTimer = 2*IN_MILISECONDS; + uiAcidTimer = urand(10*IN_MILLISECONDS,14*IN_MILLISECONDS); + uiLeechTimer = urand(3*IN_MILLISECONDS,9*IN_MILLISECONDS); + uiPierceTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS); + uiGrabTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS); + uiDoorsTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); + uiCheckDistanceTimer = 2*IN_MILLISECONDS; if (pInstance && (pInstance->GetData(DATA_HADRONOX_EVENT) != DONE && !bFirstTime)) pInstance->SetData(DATA_HADRONOX_EVENT, FAIL); @@ -122,7 +121,7 @@ struct boss_hadronoxAI : public ScriptedAI me->GetRespawnCoord(x,y,z); if (uiCheckDistanceTimer <= uiDiff) - uiCheckDistanceTimer = 5*IN_MILISECONDS; + uiCheckDistanceTimer = 5*IN_MILLISECONDS; else { uiCheckDistanceTimer -= uiDiff; @@ -153,7 +152,7 @@ struct boss_hadronoxAI : public ScriptedAI if (uiPierceTimer <= diff) { DoCast(me->getVictim(), SPELL_PIERCE_ARMOR); - uiPierceTimer = 8*IN_MILISECONDS; + uiPierceTimer = 8*IN_MILLISECONDS; } else uiPierceTimer -= diff; if (uiAcidTimer <= diff) @@ -161,7 +160,7 @@ struct boss_hadronoxAI : public ScriptedAI if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_ACID_CLOUD); - uiAcidTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); + uiAcidTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiAcidTimer -= diff; if (uiLeechTimer <= diff) @@ -169,7 +168,7 @@ struct boss_hadronoxAI : public ScriptedAI if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_LEECH_POISON); - uiLeechTimer = urand(11*IN_MILISECONDS,14*IN_MILISECONDS); + uiLeechTimer = urand(11*IN_MILLISECONDS,14*IN_MILLISECONDS); } else uiLeechTimer -= diff; if (uiGrabTimer <= diff) @@ -177,13 +176,13 @@ struct boss_hadronoxAI : public ScriptedAI if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself. DoCast(pTarget, SPELL_WEB_GRAB); - uiGrabTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiGrabTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiGrabTimer -= diff; if (uiDoorsTimer <= diff) { //DoCast(me, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS)); - uiDoorsTimer = urand(30*IN_MILISECONDS,60*IN_MILISECONDS); + uiDoorsTimer = urand(30*IN_MILLISECONDS,60*IN_MILLISECONDS); } else uiDoorsTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index 4863bdcb032..9680863acad 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -1,26 +1,25 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* * Comment: Find in the future best timers and the event is not implemented. */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "azjol_nerub.h" enum Spells @@ -107,8 +106,8 @@ struct boss_krik_thirAI : public ScriptedAI void Reset() { - uiMindFlayTimer = 15*IN_MILISECONDS; - uiCurseFatigueTimer = 12*IN_MILISECONDS; + uiMindFlayTimer = 15*IN_MILLISECONDS; + uiCurseFatigueTimer = 12*IN_MILLISECONDS; if (pInstance) pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, NOT_STARTED); @@ -118,7 +117,7 @@ struct boss_krik_thirAI : public ScriptedAI { DoScriptText(SAY_AGGRO, me); Summon(); - uiSummonTimer = 15*IN_MILISECONDS; + uiSummonTimer = 15*IN_MILLISECONDS; if (pInstance) pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS); @@ -126,22 +125,22 @@ struct boss_krik_thirAI : public ScriptedAI void Summon() { - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); - me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); + me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS); } void UpdateAI(const uint32 diff) @@ -152,13 +151,13 @@ struct boss_krik_thirAI : public ScriptedAI if (uiSummonTimer <= diff) { Summon(); - uiSummonTimer = 15*IN_MILISECONDS; + uiSummonTimer = 15*IN_MILLISECONDS; } else uiSummonTimer -= diff; if (uiMindFlayTimer <= diff) { DoCast(me->getVictim(), SPELL_MIND_FLAY); - uiMindFlayTimer = 15*IN_MILISECONDS; + uiMindFlayTimer = 15*IN_MILLISECONDS; } else uiMindFlayTimer -= diff; if (uiCurseFatigueTimer <= diff) @@ -170,7 +169,7 @@ struct boss_krik_thirAI : public ScriptedAI DoCast(pTarget, SPELL_CURSE_OF_FATIGUE); DoCast(pTarget_1, SPELL_CURSE_OF_FATIGUE); - uiCurseFatigueTimer = 10*IN_MILISECONDS; + uiCurseFatigueTimer = 10*IN_MILLISECONDS; } else uiCurseFatigueTimer -= diff; if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10)) @@ -237,8 +236,8 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI void Reset() { - uiChargeTimer = 11*IN_MILISECONDS; - uiBackstabTimer = 7*IN_MILISECONDS; + uiChargeTimer = 11*IN_MILLISECONDS; + uiBackstabTimer = 7*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -254,13 +253,13 @@ struct npc_anub_ar_skirmisherAI : public ScriptedAI me->AddThreat(pTarget,1.0f); DoCast(pTarget, SPELL_CHARGE, true); } - uiChargeTimer = 15*IN_MILISECONDS; + uiChargeTimer = 15*IN_MILLISECONDS; } else uiChargeTimer -= diff; if (uiBackstabTimer <= diff) { DoCast(me->getVictim(), SPELL_BACKSTAB); - uiBackstabTimer = 12*IN_MILISECONDS; + uiBackstabTimer = 12*IN_MILLISECONDS; } else uiBackstabTimer -= diff; DoMeleeAttackIfReady(); @@ -277,8 +276,8 @@ struct npc_anub_ar_shadowcasterAI : public ScriptedAI void Reset() { - uiShadowBoltTimer = 6*IN_MILISECONDS; - uiShadowNovaTimer = 15*IN_MILISECONDS; + uiShadowBoltTimer = 6*IN_MILLISECONDS; + uiShadowNovaTimer = 15*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -290,13 +289,13 @@ struct npc_anub_ar_shadowcasterAI : public ScriptedAI { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_SHADOW_BOLT, true); - uiShadowBoltTimer = 15*IN_MILISECONDS; + uiShadowBoltTimer = 15*IN_MILLISECONDS; } else uiShadowBoltTimer -= diff; if (uiShadowNovaTimer <= diff) { DoCast(me->getVictim(), SPELL_SHADOW_NOVA, true); - uiShadowNovaTimer = 17*IN_MILISECONDS; + uiShadowNovaTimer = 17*IN_MILLISECONDS; } else uiShadowNovaTimer -= diff; DoMeleeAttackIfReady(); @@ -312,8 +311,8 @@ struct npc_anub_ar_warriorAI : public ScriptedAI void Reset() { - uiCleaveTimer = 11*IN_MILISECONDS; - uiStrikeTimer = 6*IN_MILISECONDS; + uiCleaveTimer = 11*IN_MILLISECONDS; + uiStrikeTimer = 6*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -324,13 +323,13 @@ struct npc_anub_ar_warriorAI : public ScriptedAI if (uiStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_STRIKE, true); - uiStrikeTimer = 15*IN_MILISECONDS; + uiStrikeTimer = 15*IN_MILLISECONDS; } else uiStrikeTimer -= diff; if (uiCleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE, true); - uiCleaveTimer = 17*IN_MILISECONDS; + uiCleaveTimer = 17*IN_MILLISECONDS; } else uiCleaveTimer -= diff; DoMeleeAttackIfReady(); @@ -348,8 +347,8 @@ struct npc_watcher_gashraAI : public ScriptedAI void Reset() { - uiWebWrapTimer = 11*IN_MILISECONDS; - uiInfectedBiteTimer = 4*IN_MILISECONDS; + uiWebWrapTimer = 11*IN_MILLISECONDS; + uiInfectedBiteTimer = 4*IN_MILLISECONDS; } void EnterCombat(Unit* /*who*/) @@ -366,13 +365,13 @@ struct npc_watcher_gashraAI : public ScriptedAI { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_WEB_WRAP, true); - uiWebWrapTimer = 17*IN_MILISECONDS; + uiWebWrapTimer = 17*IN_MILLISECONDS; } else uiWebWrapTimer -= diff; if (uiInfectedBiteTimer <= diff) { DoCast(me->getVictim(), SPELL_INFECTED_BITE, true); - uiInfectedBiteTimer = 15*IN_MILISECONDS; + uiInfectedBiteTimer = 15*IN_MILLISECONDS; } else uiInfectedBiteTimer -= diff; DoMeleeAttackIfReady(); @@ -389,9 +388,9 @@ struct npc_watcher_narjilAI : public ScriptedAI void Reset() { - uiWebWrapTimer = 11*IN_MILISECONDS; - uiInfectedBiteTimer = 4*IN_MILISECONDS; - uiBindingWebsTimer = 17*IN_MILISECONDS; + uiWebWrapTimer = 11*IN_MILLISECONDS; + uiInfectedBiteTimer = 4*IN_MILLISECONDS; + uiBindingWebsTimer = 17*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -403,19 +402,19 @@ struct npc_watcher_narjilAI : public ScriptedAI { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_WEB_WRAP, true); - uiWebWrapTimer = 15*IN_MILISECONDS; + uiWebWrapTimer = 15*IN_MILLISECONDS; } else uiWebWrapTimer -= diff; if (uiInfectedBiteTimer <= diff) { DoCast(me->getVictim(), SPELL_INFECTED_BITE, true); - uiInfectedBiteTimer = 11*IN_MILISECONDS; + uiInfectedBiteTimer = 11*IN_MILLISECONDS; } else uiInfectedBiteTimer -= diff; if (uiBindingWebsTimer <= diff) { DoCast(me->getVictim(), SPELL_BLINDING_WEBS, true); - uiBindingWebsTimer = 17*IN_MILISECONDS; + uiBindingWebsTimer = 17*IN_MILLISECONDS; } else uiBindingWebsTimer -= diff; DoMeleeAttackIfReady(); @@ -432,9 +431,9 @@ struct npc_watcher_silthikAI : public ScriptedAI void Reset() { - uiWebWrapTimer = 11*IN_MILISECONDS; - uiInfectedBiteTimer = 4*IN_MILISECONDS; - uiPoisonSprayTimer = 15*IN_MILISECONDS; + uiWebWrapTimer = 11*IN_MILLISECONDS; + uiInfectedBiteTimer = 4*IN_MILLISECONDS; + uiPoisonSprayTimer = 15*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -447,19 +446,19 @@ struct npc_watcher_silthikAI : public ScriptedAI if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_WEB_WRAP, true); - uiWebWrapTimer = 15*IN_MILISECONDS; + uiWebWrapTimer = 15*IN_MILLISECONDS; } else uiWebWrapTimer -= diff; if (uiInfectedBiteTimer <= diff) { DoCast(me->getVictim(), SPELL_INFECTED_BITE, true); - uiInfectedBiteTimer = 15*IN_MILISECONDS; + uiInfectedBiteTimer = 15*IN_MILLISECONDS; } else uiInfectedBiteTimer -= diff; if (uiPoisonSprayTimer <= diff) { DoCast(me->getVictim(), SPELL_POSION_SPRAY, true); - uiPoisonSprayTimer = 17*IN_MILISECONDS; + uiPoisonSprayTimer = 17*IN_MILLISECONDS; } else uiPoisonSprayTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index d12dbd604ba..90f96b21af3 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "azjol_nerub.h" #define MAX_ENCOUNTER 3 diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/ahnkahet.h b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/ahnkahet.h index 240ad77c74d..f324344228a 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/ahnkahet.h +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/ahnkahet.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_AHNKAHET_H diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp index 51c4bce0c2d..ee5dc6b297f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp @@ -1,26 +1,25 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* * Comment: Find correct mushrooms spell to make them visible - buffs of the mushrooms not ever applied to the users... */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ahnkahet.h" enum Spells @@ -61,9 +60,9 @@ struct boss_amanitarAI : public ScriptedAI void Reset() { - uiRootTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS); - uiBashTimer = urand(10*IN_MILISECONDS,14*IN_MILISECONDS); - uiBoltTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiRootTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS); + uiBashTimer = urand(10*IN_MILLISECONDS,14*IN_MILLISECONDS); + uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); uiSpawnTimer = 0; me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); @@ -107,9 +106,9 @@ struct boss_amanitarAI : public ScriptedAI Position pos; victim->GetPosition(&pos); me->GetRandomNearPosition(pos, float(urand(5,80))); - me->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILISECONDS); + me->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS); me->GetRandomNearPosition(pos, float(urand(5,80))); - me->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILISECONDS); + me->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS); } } } @@ -123,27 +122,27 @@ struct boss_amanitarAI : public ScriptedAI if (uiSpawnTimer <= diff) { SpawnAdds(); - uiSpawnTimer = urand(35*IN_MILISECONDS,40*IN_MILISECONDS); + uiSpawnTimer = urand(35*IN_MILLISECONDS,40*IN_MILLISECONDS); } else uiSpawnTimer -= diff; if (uiRootTimer <= diff) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_ENTANGLING_ROOTS); - uiRootTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiRootTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiRootTimer -= diff; if (uiBashTimer <= diff) { DoCastVictim(SPELL_BASH); - uiBashTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiBashTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiBashTimer -= diff; if (uiBoltTimer <= diff) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_VENOM_BOLT_VOLLEY); - uiBoltTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiBoltTimer -= diff; DoMeleeAttackIfReady(); @@ -165,7 +164,7 @@ struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true); uiAuraTimer = 0; - uiDeathTimer = 30*IN_MILISECONDS; + uiDeathTimer = 30*IN_MILLISECONDS; } void JustDied(Unit *killer) @@ -191,7 +190,7 @@ struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI { DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true); DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD, false); - uiAuraTimer = 7*IN_MILISECONDS; + uiAuraTimer = 7*IN_MILLISECONDS; } else uiAuraTimer -= diff; } if (uiDeathTimer <= diff) diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp index 2215d91c749..05c868708f2 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ahnkahet.h" bool DeadAhnkaharGuardian; // needed for achievement: Respect Your Elders(2038) @@ -76,13 +75,13 @@ struct boss_elder_nadoxAI : public ScriptedAI void Reset() { - uiPlagueTimer = 13*IN_MILISECONDS; - uiRagueTimer = 20*IN_MILISECONDS; + uiPlagueTimer = 13*IN_MILLISECONDS; + uiRagueTimer = 20*IN_MILLISECONDS; - uiSwarmerSpawnTimer = 10*IN_MILISECONDS; - uiGuardSpawnTimer = 25*IN_MILISECONDS; + uiSwarmerSpawnTimer = 10*IN_MILLISECONDS; + uiGuardSpawnTimer = 25*IN_MILLISECONDS; - uiEnragueTimer = 5*IN_MILISECONDS; + uiEnragueTimer = 5*IN_MILLISECONDS; DeadAhnkaharGuardian = false; bGuardSpawned = false; @@ -124,7 +123,7 @@ struct boss_elder_nadoxAI : public ScriptedAI if (uiPlagueTimer <= diff) { DoCast(me->getVictim(), SPELL_BROOD_PLAGUE); - uiPlagueTimer = 15*IN_MILISECONDS; + uiPlagueTimer = 15*IN_MILLISECONDS; } else uiPlagueTimer -= diff; if (IsHeroic()) @@ -133,7 +132,7 @@ struct boss_elder_nadoxAI : public ScriptedAI if (Creature *pSwarmer = me->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35)) { DoCast(pSwarmer, H_SPELL_BROOD_RAGE, true); - uiRagueTimer = 15*IN_MILISECONDS; + uiRagueTimer = 15*IN_MILLISECONDS; } } else uiRagueTimer -= diff; @@ -144,7 +143,7 @@ struct boss_elder_nadoxAI : public ScriptedAI if (urand(1,3) == 3) // 33% chance of dialog DoScriptText(RAND(SAY_EGG_SAC_1,SAY_EGG_SAC_2), me); - uiSwarmerSpawnTimer = 10*IN_MILISECONDS; + uiSwarmerSpawnTimer = 10*IN_MILLISECONDS; } else uiSwarmerSpawnTimer -= diff; if (!bGuardSpawned && uiGuardSpawnTimer <= diff) @@ -165,7 +164,7 @@ struct boss_elder_nadoxAI : public ScriptedAI if (!me->IsNonMeleeSpellCasted(false)) DoCast(me, SPELL_ENRAGE, true); - uiEnragueTimer = 5*IN_MILISECONDS; + uiEnragueTimer = 5*IN_MILLISECONDS; } else uiEnragueTimer -= diff; DoMeleeAttackIfReady(); @@ -197,7 +196,7 @@ struct mob_ahnkahar_nerubianAI : public ScriptedAI { if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) //magic numbers are bad! DoCast(me, SPELL_GUARDIAN_AURA, true); - uiSprintTimer = 10*IN_MILISECONDS; + uiSprintTimer = 10*IN_MILLISECONDS; } void JustDied(Unit * /*killer*/) @@ -230,7 +229,7 @@ struct mob_ahnkahar_nerubianAI : public ScriptedAI if (uiSprintTimer <= diff) { DoCast(me, SPELL_SPRINT); - uiSprintTimer = 25*IN_MILISECONDS; + uiSprintTimer = 25*IN_MILLISECONDS; } else uiSprintTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp index 16c291d6484..0e58217c584 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp @@ -1,26 +1,25 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* * Comment: Missing AI for Twisted Visages */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ahnkahet.h" enum Spells @@ -125,9 +124,6 @@ struct boss_volazjAI : public ScriptedAI // Summon clone if (Unit *summon = me->SummonCreature(MOB_TWISTED_VISAGE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,0)) { - // required for correct visual - // Fixme: allow mirror image query to send other guid to get rid of minion status - summon->SetUInt64Value(UNIT_FIELD_CREATEDBY, plr->GetGUID()); // clone plr->CastSpell(summon, SPELL_CLONE_PLAYER, true); // set phase @@ -150,9 +146,9 @@ struct boss_volazjAI : public ScriptedAI void Reset() { - uiMindFlayTimer = 8*IN_MILISECONDS; - uiShadowBoltVolleyTimer = 5*IN_MILISECONDS; - uiShiverTimer = 15*IN_MILISECONDS; + uiMindFlayTimer = 8*IN_MILLISECONDS; + uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS; + uiShiverTimer = 15*IN_MILLISECONDS; if (pInstance) { @@ -276,20 +272,20 @@ struct boss_volazjAI : public ScriptedAI if (uiMindFlayTimer <= diff) { DoCast(me->getVictim(), SPELL_MIND_FLAY); - uiMindFlayTimer = 20*IN_MILISECONDS; + uiMindFlayTimer = 20*IN_MILLISECONDS; } else uiMindFlayTimer -= diff; if (uiShadowBoltVolleyTimer <= diff) { DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); - uiShadowBoltVolleyTimer = 5*IN_MILISECONDS; + uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS; } else uiShadowBoltVolleyTimer -= diff; if (uiShiverTimer <= diff) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SHIVER); - uiShiverTimer = 15*IN_MILISECONDS; + uiShiverTimer = 15*IN_MILLISECONDS; } else uiShiverTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp index eb8046f63cd..3ea1c0bda4f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp @@ -1,26 +1,25 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* * Comment: Complete - BUT THE TRIGGER NEEDS DATA WHETHER THE PRISON OF TALDARAM IS OFFLINE ! */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ahnkahet.h" enum Yells @@ -90,11 +89,11 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI void Reset() { - uiOpFerTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS); + uiOpFerTimer = urand(15*IN_MILLISECONDS,20*IN_MILLISECONDS); - uiCycloneTimer = 3*IN_MILISECONDS; - uiBoltTimer = 7*IN_MILISECONDS; - uiThunderTimer = 12*IN_MILISECONDS; + uiCycloneTimer = 3*IN_MILLISECONDS; + uiBoltTimer = 7*IN_MILLISECONDS; + uiThunderTimer = 12*IN_MILLISECONDS; bOpFerok = false; bOpFerokFail = false; @@ -248,7 +247,7 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) OpferRufen(); bOnGround = false; - uiOpFerTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiOpFerTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } void OpferRufen() @@ -304,7 +303,7 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI if (uiCycloneTimer <= diff) { DoCast(me, SPELL_CYCLONE_STRIKE, false); - uiCycloneTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiCycloneTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiCycloneTimer -= diff; if (uiBoltTimer <= diff) @@ -312,7 +311,7 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) me->CastSpell(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false); - uiBoltTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiBoltTimer -= diff; if (uiThunderTimer <= diff) @@ -320,7 +319,7 @@ struct boss_jedoga_shadowseekerAI : public ScriptedAI if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) me->CastSpell(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false); - uiThunderTimer = urand(15*IN_MILISECONDS,30*IN_MILISECONDS); + uiThunderTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiThunderTimer -= diff; if (uiOpFerTimer <= diff) @@ -352,7 +351,7 @@ struct mob_jedoga_initiandAI : public ScriptedAI return; bWalking = false; - bCheckTimer = 2*IN_MILISECONDS; + bCheckTimer = 2*IN_MILLISECONDS; if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS) { @@ -467,7 +466,7 @@ struct mob_jedoga_initiandAI : public ScriptedAI me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); } } - bCheckTimer = 2*IN_MILISECONDS; + bCheckTimer = 2*IN_MILLISECONDS; } else bCheckTimer -= diff; //Return since we have no target diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp index 93a66ccfbca..995fccd8611 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ahnkahet.h" enum Spells @@ -98,10 +97,10 @@ struct boss_taldaramAI : public ScriptedAI void Reset() { - uiBloodthirstTimer = 10*IN_MILISECONDS; - uiVanishTimer = urand(25*IN_MILISECONDS,35*IN_MILISECONDS); - uiEmbraceTimer = 20*IN_MILISECONDS; - uiFlamesphereTimer = 5*IN_MILISECONDS; + uiBloodthirstTimer = 10*IN_MILLISECONDS; + uiVanishTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS); + uiEmbraceTimer = 20*IN_MILLISECONDS; + uiFlamesphereTimer = 5*IN_MILLISECONDS; uiEmbraceTakenDamage = 0; Phase = NORMAL; uiPhaseTimer = 0; @@ -130,7 +129,7 @@ struct boss_taldaramAI : public ScriptedAI Creature* pSpheres[3]; //DoCast(me, SPELL_FLAME_SPHERE_SUMMON_1); - pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILISECONDS); + pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS); Unit *pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (pSphereTarget && pSpheres[0]) { @@ -143,9 +142,9 @@ struct boss_taldaramAI : public ScriptedAI if (IsHeroic()) { //DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_1); - pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILISECONDS); + pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS); //DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_2); - pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILISECONDS); + pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS); if (pSphereTarget && pSpheres[1] && pSpheres[2]) { float angle,x,y; @@ -181,7 +180,7 @@ struct boss_taldaramAI : public ScriptedAI me->SetSpeed(MOVE_WALK, 1.0f, true); me->GetMotionMaster()->MoveChase(me->getVictim()); Phase = FEEDING; - uiPhaseTimer = 20*IN_MILISECONDS; + uiPhaseTimer = 20*IN_MILLISECONDS; break; case FEEDING: Phase = NORMAL; @@ -192,15 +191,15 @@ struct boss_taldaramAI : public ScriptedAI if (uiBloodthirstTimer <= diff) { DoCast(me->getVictim(), SPELL_BLOODTHIRST); - uiBloodthirstTimer = 10*IN_MILISECONDS; + uiBloodthirstTimer = 10*IN_MILLISECONDS; } else uiBloodthirstTimer -= diff; if (uiFlamesphereTimer <= diff) { DoCast(me, SPELL_CONJURE_FLAME_SPHERE); Phase = CASTING_FLAME_SPHERES; - uiPhaseTimer = 3*IN_MILISECONDS + diff; - uiFlamesphereTimer = 15*IN_MILISECONDS; + uiPhaseTimer = 3*IN_MILLISECONDS + diff; + uiFlamesphereTimer = 15*IN_MILLISECONDS; } else uiFlamesphereTimer -= diff; if (uiVanishTimer <= diff) @@ -228,7 +227,7 @@ struct boss_taldaramAI : public ScriptedAI uiEmbraceTarget = pEmbraceTarget->GetGUID(); } - uiVanishTimer = urand(25*IN_MILISECONDS,35*IN_MILISECONDS); + uiVanishTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS); } else uiVanishTimer -= diff; DoMeleeAttackIfReady(); @@ -339,7 +338,7 @@ struct mob_taldaram_flamesphereAI : public ScriptedAI DoCast(me, SPELL_FLAME_SPHERE_VISUAL); DoCast(me, SPELL_FLAME_SPHERE_SPAWN_EFFECT); DoCast(me, SPELL_FLAME_SPHERE_PERIODIC); - uiDespawnTimer = 10*IN_MILISECONDS; + uiDespawnTimer = 10*IN_MILLISECONDS; } void EnterCombat(Unit * /*who*/) {} diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp index 4e6e3ec8c9f..7d3fa8d5fba 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ahnkahet.h" /* Ahn'kahet encounters: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index c33ea69fa2d..adc3449862b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: AI for Argent Soldiers are not implemented. AI from bosses need more SDCategory: Trial of the Champion EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "trial_of_the_champion.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index e1f4586ca6c..14b44079719 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: missing yells. not sure about timers. SDCategory: Trial of the Champion EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "trial_of_the_champion.h" diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 4bf8143a210..53b71a5760e 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Is missing the ai to make the npcs look for a new mount and use it. SDCategory: Trial Of the Champion EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "Vehicle.h" #include "trial_of_the_champion.h" diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp index 04b671ec11c..45cab67c0f4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ @@ -23,7 +22,7 @@ SDComment: SDCategory: Trial Of the Champion EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "trial_of_the_champion.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index 090b64b96cc..0ebe340a691 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -27,7 +26,7 @@ EndScriptData */ npc_announcer_toc5 EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "trial_of_the_champion.h" #include "Vehicle.h" diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h index 221c7c0412f..5533a4a8690 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_TOC_H #define DEF_TOC_H diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp index ba64a4748dd..c03d3df15d8 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp @@ -1,26 +1,25 @@ /* - * Copyright (C) 2008 - 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* * Comment: MAYBE need more improve the "Raptor Call". */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "drak_tharon_keep.h" enum eSpells @@ -71,12 +70,12 @@ struct boss_dredAI : public ScriptedAI pInstance->SetData(DATA_KING_DRED_ACHIEV, 0); } - uiBellowingRoarTimer = 33*IN_MILISECONDS; - uiGrievousBiteTimer = 20*IN_MILISECONDS; - uiManglingSlashTimer = 18.5*IN_MILISECONDS; - uiFearsomeRoarTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS); - uiPiercingSlashTimer = 17*IN_MILISECONDS; - uiRaptorCallTimer = urand(20*IN_MILISECONDS,25*IN_MILISECONDS); + uiBellowingRoarTimer = 33*IN_MILLISECONDS; + uiGrievousBiteTimer = 20*IN_MILLISECONDS; + uiManglingSlashTimer = 18.5*IN_MILLISECONDS; + uiFearsomeRoarTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS); + uiPiercingSlashTimer = 17*IN_MILLISECONDS; + uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS); } void EnterCombat(Unit* /*who*/) @@ -94,31 +93,31 @@ struct boss_dredAI : public ScriptedAI if (uiBellowingRoarTimer < diff) { DoCastAOE(SPELL_BELLOWING_ROAR, false); - uiBellowingRoarTimer = 40*IN_MILISECONDS; + uiBellowingRoarTimer = 40*IN_MILLISECONDS; } else uiBellowingRoarTimer -=diff; if (uiGrievousBiteTimer < diff) { DoCastVictim(SPELL_GRIEVOUS_BITE ,false); - uiGrievousBiteTimer = 20*IN_MILISECONDS; + uiGrievousBiteTimer = 20*IN_MILLISECONDS; } else uiGrievousBiteTimer -=diff; if (uiManglingSlashTimer < diff) { DoCastVictim(SPELL_MANGLING_SLASH,false); - uiManglingSlashTimer = 20*IN_MILISECONDS; + uiManglingSlashTimer = 20*IN_MILLISECONDS; } else uiManglingSlashTimer -=diff; if (uiFearsomeRoarTimer < diff) { DoCastAOE(SPELL_FEARSOME_ROAR,false); - uiFearsomeRoarTimer = urand(16*IN_MILISECONDS,18*IN_MILISECONDS); + uiFearsomeRoarTimer = urand(16*IN_MILLISECONDS,18*IN_MILLISECONDS); } else uiFearsomeRoarTimer -=diff; if (uiPiercingSlashTimer < diff) { DoCastVictim(SPELL_PIERCING_SLASH,false); - uiPiercingSlashTimer = 20*IN_MILISECONDS; + uiPiercingSlashTimer = 20*IN_MILLISECONDS; } else uiPiercingSlashTimer -=diff; if (uiRaptorCallTimer < diff) @@ -128,9 +127,9 @@ struct boss_dredAI : public ScriptedAI float x,y,z; me->GetClosePoint(x,y,z,me->GetObjectSize()/3,10.0f); - me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILISECONDS); + me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILLISECONDS); - uiRaptorCallTimer = urand(20*IN_MILISECONDS,25*IN_MILISECONDS); + uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS); } else uiRaptorCallTimer -=diff; DoMeleeAttackIfReady(); @@ -214,7 +213,7 @@ struct npc_drakkari_scytheclawAI : public ScriptedAI void Reset() { - uiRendTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } void UpdateAI(const uint32 diff) @@ -226,7 +225,7 @@ struct npc_drakkari_scytheclawAI : public ScriptedAI if (uiRendTimer < diff) { DoCastVictim(SPELL_REND,false); - uiRendTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); }else uiRendTimer -=diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 5e8792c352d..e8abb804417 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "drak_tharon_keep.h" enum Spells @@ -118,8 +117,8 @@ struct boss_novosAI : public Scripted_NoMovementAI { DoScriptText(SAY_AGGRO, me); Phase = PHASE_1; - uiCrystalHandlerTimer = 30*IN_MILISECONDS; - uiTimer = 1*IN_MILISECONDS; + uiCrystalHandlerTimer = 30*IN_MILLISECONDS; + uiTimer = 1*IN_MILLISECONDS; DoCast(SPELL_ARCANE_FIELD); if (pInstance) { @@ -142,18 +141,18 @@ struct boss_novosAI : public Scripted_NoMovementAI case PHASE_1: if (uiTimer <= diff) { - Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS); + Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS); pSummon->GetMotionMaster()->MovePoint(0, AddDestinyPoint); //If spell is casted stops casting arcane field so no spell casting //DoCast(me, SPELL_SUMMON_MINIONS); - uiTimer = 3*IN_MILISECONDS; + uiTimer = 3*IN_MILLISECONDS; } else uiTimer -= diff; if (uiCrystalHandlerTimer <= diff) { DoScriptText(SAY_NECRO_ADD, me); - Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS); + Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS); pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint); - uiCrystalHandlerTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); + uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); } else uiCrystalHandlerTimer -= diff; break; case PHASE_2: @@ -162,7 +161,7 @@ struct boss_novosAI : public Scripted_NoMovementAI if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST,SPELL_BLIZZARD,SPELL_FROSTBOLT,SPELL_WRATH_OF_MISERY), RAND(H_SPELL_ARCANE_BLAST,H_SPELL_BLIZZARD,H_SPELL_FROSTBOLT,H_SPELL_WRATH_OF_MISERY))); - uiTimer = urand(1*IN_MILISECONDS,3*IN_MILISECONDS); + uiTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS); } else uiTimer -= diff; break; } @@ -208,7 +207,7 @@ struct boss_novosAI : public Scripted_NoMovementAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Phase = PHASE_2; - uiTimer = 1*IN_MILISECONDS; + uiTimer = 1*IN_MILLISECONDS; } } @@ -237,7 +236,7 @@ struct mob_crystal_handlerAI : public ScriptedAI void Reset() { - uiFlashOfDarknessTimer = 5*IN_MILISECONDS; + uiFlashOfDarknessTimer = 5*IN_MILLISECONDS; } void JustDied(Unit* /*killer*/) @@ -254,7 +253,7 @@ struct mob_crystal_handlerAI : public ScriptedAI if (uiFlashOfDarknessTimer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS)); - uiFlashOfDarknessTimer = 5*IN_MILISECONDS; + uiFlashOfDarknessTimer = 5*IN_MILLISECONDS; } else uiFlashOfDarknessTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 1e60dfc6135..46121f49849 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2008-2010 Trinity -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "drak_tharon_keep.h" enum Spells @@ -86,10 +85,10 @@ struct boss_tharon_jaAI : public ScriptedAI void Reset() { - uiPhaseTimer = 20*IN_MILISECONDS; - uiCurseOfLifeTimer = 1*IN_MILISECONDS; - uiRainOfFireTimer = urand(14*IN_MILISECONDS,18*IN_MILISECONDS); - uiShadowVolleyTimer = urand(8*IN_MILISECONDS,10*IN_MILISECONDS); + uiPhaseTimer = 20*IN_MILLISECONDS; + uiCurseOfLifeTimer = 1*IN_MILLISECONDS; + uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS); + uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS); Phase = SKELETAL; me->SetDisplayId(me->GetNativeDisplayId()); if (pInstance) @@ -117,26 +116,26 @@ struct boss_tharon_jaAI : public ScriptedAI { if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_CURSE_OF_LIFE); - uiCurseOfLifeTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiCurseOfLifeTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiCurseOfLifeTimer -= diff; if (uiShadowVolleyTimer < diff) { DoCastVictim(SPELL_SHADOW_VOLLEY); - uiShadowVolleyTimer = urand(8*IN_MILISECONDS,10*IN_MILISECONDS); + uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS); } else uiShadowVolleyTimer -= diff; if (uiRainOfFireTimer < diff) { DoCastAOE(SPELL_RAIN_OF_FIRE); - uiRainOfFireTimer = urand(14*IN_MILISECONDS,18*IN_MILISECONDS); + uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS); } else uiRainOfFireTimer -= diff; if (uiPhaseTimer < diff) { DoCast(SPELL_DECAY_FLESH); Phase = GOING_FLESH; - uiPhaseTimer = 6*IN_MILISECONDS; + uiPhaseTimer = 6*IN_MILLISECONDS; } else uiPhaseTimer -= diff; DoMeleeAttackIfReady(); @@ -156,10 +155,10 @@ struct boss_tharon_jaAI : public ScriptedAI pTemp->SetDisplayId(MODEL_SKELETON); } } - uiPhaseTimer = 20*IN_MILISECONDS; - uiLightningBreathTimer = urand(3*IN_MILISECONDS,4*IN_MILISECONDS); - uiEyeBeamTimer = urand(4*IN_MILISECONDS,8*IN_MILISECONDS); - uiPoisonCloudTimer = urand(6*IN_MILISECONDS,7*IN_MILISECONDS); + uiPhaseTimer = 20*IN_MILLISECONDS; + uiLightningBreathTimer = urand(3*IN_MILLISECONDS,4*IN_MILLISECONDS); + uiEyeBeamTimer = urand(4*IN_MILLISECONDS,8*IN_MILLISECONDS); + uiPoisonCloudTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS); Phase = FLESH; } else uiPhaseTimer -= diff; break; @@ -168,27 +167,27 @@ struct boss_tharon_jaAI : public ScriptedAI { if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_LIGHTNING_BREATH); - uiLightningBreathTimer = urand(6*IN_MILISECONDS,7*IN_MILISECONDS); + uiLightningBreathTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS); } else uiLightningBreathTimer -= diff; if (uiEyeBeamTimer < diff) { if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_EYE_BEAM); - uiEyeBeamTimer = urand(4*IN_MILISECONDS,6*IN_MILISECONDS); + uiEyeBeamTimer = urand(4*IN_MILLISECONDS,6*IN_MILLISECONDS); } else uiEyeBeamTimer -= diff; if (uiPoisonCloudTimer < diff) { DoCastAOE(SPELL_POISON_CLOUD); - uiPoisonCloudTimer = urand(10*IN_MILISECONDS,12*IN_MILISECONDS); + uiPoisonCloudTimer = urand(10*IN_MILLISECONDS,12*IN_MILLISECONDS); } else uiPoisonCloudTimer -= diff; if (uiPhaseTimer < diff) { DoCast(SPELL_RETURN_FLESH); Phase = GOING_SKELETAL; - uiPhaseTimer = 6*IN_MILISECONDS; + uiPhaseTimer = 6*IN_MILLISECONDS; } else uiPhaseTimer -= diff; DoMeleeAttackIfReady(); break; @@ -198,10 +197,10 @@ struct boss_tharon_jaAI : public ScriptedAI DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), me); me->DeMorph(); Phase = SKELETAL; - uiPhaseTimer = 20*IN_MILISECONDS; - uiCurseOfLifeTimer = 1*IN_MILISECONDS; - uiRainOfFireTimer = urand(14*IN_MILISECONDS,18*IN_MILISECONDS); - uiShadowVolleyTimer = urand(8*IN_MILISECONDS,10*IN_MILISECONDS); + uiPhaseTimer = 20*IN_MILLISECONDS; + uiCurseOfLifeTimer = 1*IN_MILLISECONDS; + uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS); + uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS); std::list& threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) { diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 03eac73385d..4281ab53463 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -1,26 +1,25 @@ /* - * Copyright (C) 2008-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* * Comment: TODO: spawn troll waves */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "drak_tharon_keep.h" enum Spells @@ -77,12 +76,12 @@ struct boss_trollgoreAI : public ScriptedAI void Reset() { - uiConsumeTimer = 15*IN_MILISECONDS; - uiAuraCountTimer = 15.5*IN_MILISECONDS; - uiCrushTimer = urand(1*IN_MILISECONDS,5*IN_MILISECONDS); - uiInfectedWoundTimer = urand(60*IN_MILISECONDS,10*IN_MILISECONDS); - uiExplodeCorpseTimer = 3*IN_MILISECONDS; - uiSpawnTimer = urand(30*IN_MILISECONDS,40*IN_MILISECONDS); + uiConsumeTimer = 15*IN_MILLISECONDS; + uiAuraCountTimer = 15.5*IN_MILLISECONDS; + uiCrushTimer = urand(1*IN_MILLISECONDS,5*IN_MILLISECONDS); + uiInfectedWoundTimer = urand(60*IN_MILLISECONDS,10*IN_MILLISECONDS); + uiExplodeCorpseTimer = 3*IN_MILLISECONDS; + uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS); bAchiev = IsHeroic(); @@ -113,14 +112,14 @@ struct boss_trollgoreAI : public ScriptedAI uint32 spawnNumber = urand(2,DUNGEON_MODE(3,5)); for (uint8 i = 0; i < spawnNumber; ++i) DoSummon(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN); - uiSpawnTimer = urand(30*IN_MILISECONDS,40*IN_MILISECONDS); + uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS); } else uiSpawnTimer -= diff; if (uiConsumeTimer <= diff) { DoScriptText(SAY_CONSUME, me); DoCast(SPELL_CONSUME); - uiConsumeTimer = 15*IN_MILISECONDS; + uiConsumeTimer = 15*IN_MILLISECONDS; } else uiConsumeTimer -= diff; if (bAchiev) @@ -133,20 +132,20 @@ struct boss_trollgoreAI : public ScriptedAI if (uiCrushTimer <= diff) { DoCastVictim(SPELL_CRUSH); - uiCrushTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + uiCrushTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS); } else uiCrushTimer -= diff; if (uiInfectedWoundTimer <= diff) { DoCastVictim(SPELL_INFECTED_WOUND); - uiInfectedWoundTimer = urand(25*IN_MILISECONDS,35*IN_MILISECONDS); + uiInfectedWoundTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS); } else uiInfectedWoundTimer -= diff; if (uiExplodeCorpseTimer <= diff) { DoCast(SPELL_CORPSE_EXPLODE); DoScriptText(SAY_EXPLODE, me); - uiExplodeCorpseTimer = urand(15*IN_MILISECONDS,19*IN_MILISECONDS); + uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS); } else uiExplodeCorpseTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h index 597971d17dd..11e6f1557db 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h +++ b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_DRAK_THARON_H #define DEF_DRAK_THARON_H diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index 9f4d2ee52a2..2c36217755d 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "drak_tharon_keep.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index 59db2842735..6ac11c81e2d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "forge_of_souls.h" /* diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 6811ba953e2..13d65619a13 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "forge_of_souls.h" /* diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index 5c85da69898..0e0c22c9b10 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "forge_of_souls.h" enum Spells diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h index e0479eb4d2b..df2c682eaa1 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h @@ -1,17 +1,18 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_FORGE_OF_SOULS_H diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp index 67a6cdb4579..074a9d40915 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "forge_of_souls.h" #define MAX_ENCOUNTER 2 diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index c9978faca6e..ddb6191c999 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_reflection.h" enum Yells diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index 95fb2737ce9..47af8fd19c0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_reflection.h" enum Yells diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index fb3d3d5d752..65f326e924f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_reflection.h" enum Yells diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h index 46ae0cb283c..0e4dc94b826 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h @@ -1,17 +1,18 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_HALLS_OF_REFLECTION_H diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 7a5d2479b7c..8a6ffb82fc2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_reflection.h" #define MAX_ENCOUNTER 3 diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 25c78c4a0d3..e854c767f63 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "pit_of_saron.h" enum Yells diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 8b8b03a3d4e..961451051a7 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "pit_of_saron.h" /* diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index 55ffa0b4e4b..6f45c3ef76f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "pit_of_saron.h" /* diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index 8512eca24c1..595b5d01228 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "pit_of_saron.h" #define MAX_ENCOUNTER 3 diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index bc53efc7033..b9b8504fcf0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "pit_of_saron.h" /***************************************SPELLS*************************************/ diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h index 4a221d17518..98ee73a6fe8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -1,17 +1,18 @@ -/* Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_PIT_OF_SARON_H diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 04603c68813..3bb998c7096 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -1,26 +1,25 @@ /* - * Copyright (C) 2009 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* * Comment: The event with the Living Mojos is not implemented, just is done that when one of the mojos around the boss take damage will make the boss enter in combat! */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gundrak.h" enum Spells @@ -59,7 +58,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT); me->SetReactState(REACT_PASSIVE); - MightyBlowTimer = 10*IN_MILISECONDS; + MightyBlowTimer = 10*IN_MILLISECONDS; bHealth = false; bHealth1 = false; } @@ -115,7 +114,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI if (MightyBlowTimer <= diff) { DoCast(me->getVictim(), SPELL_MIGHTY_BLOW, true); - MightyBlowTimer = 10*IN_MILISECONDS; + MightyBlowTimer = 10*IN_MILLISECONDS; } else MightyBlowTimer -= diff; if (!me->hasUnitState(UNIT_STAT_STUNNED)) @@ -153,7 +152,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI { if (Creature *pColossus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DRAKKARI_COLOSSUS) : 0)) CAST_AI(boss_drakkari_colossusAI, pColossus->AI())->CreatureState(me, true); - uiSurgeTimer = 7*IN_MILISECONDS; + uiSurgeTimer = 7*IN_MILLISECONDS; bGoToColossus = false; } @@ -196,7 +195,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI if (uiSurgeTimer <= diff) { DoCast(me->getVictim(), SPELL_SURGE); - uiSurgeTimer = 7*IN_MILISECONDS; + uiSurgeTimer = 7*IN_MILLISECONDS; } else uiSurgeTimer -= diff; DoMeleeAttackIfReady(); @@ -223,8 +222,8 @@ struct npc_living_mojoAI : public ScriptedAI void Reset() { - uiMojoWaveTimer = 2*IN_MILISECONDS; - uiMojoPuddleTimer = 7*IN_MILISECONDS; + uiMojoWaveTimer = 2*IN_MILLISECONDS; + uiMojoPuddleTimer = 7*IN_MILLISECONDS; } void EnterCombat(Unit* /*who*/) @@ -268,13 +267,13 @@ struct npc_living_mojoAI : public ScriptedAI if (uiMojoWaveTimer <= diff) { DoCast(me->getVictim(), SPELL_MOJO_WAVE); - uiMojoWaveTimer = 15*IN_MILISECONDS; + uiMojoWaveTimer = 15*IN_MILLISECONDS; } else uiMojoWaveTimer -= diff; if (uiMojoPuddleTimer <= diff) { DoCast(me->getVictim(), SPELL_MOJO_PUDDLE); - uiMojoPuddleTimer = 18*IN_MILISECONDS; + uiMojoPuddleTimer = 18*IN_MILLISECONDS; } else uiMojoPuddleTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index 3bf1a33da5a..8ddcc12ae49 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gundrak.h" enum Spells @@ -48,10 +47,10 @@ struct boss_eckAI : public ScriptedAI void Reset() { - uiBerserkTimer = urand(60*IN_MILISECONDS,90*IN_MILISECONDS); //60-90 secs according to wowwiki - uiBiteTimer = 5*IN_MILISECONDS; - uiSpitTimer = 10*IN_MILISECONDS; - uiSpringTimer = 8*IN_MILISECONDS; + uiBerserkTimer = urand(60*IN_MILLISECONDS,90*IN_MILLISECONDS); //60-90 secs according to wowwiki + uiBiteTimer = 5*IN_MILLISECONDS; + uiSpitTimer = 10*IN_MILLISECONDS; + uiSpringTimer = 8*IN_MILLISECONDS; bBerserk = false; @@ -74,13 +73,13 @@ struct boss_eckAI : public ScriptedAI if (uiBiteTimer <= diff) { DoCast(me->getVictim(), SPELL_ECK_BITE); - uiBiteTimer = urand(8*IN_MILISECONDS,12*IN_MILISECONDS); + uiBiteTimer = urand(8*IN_MILLISECONDS,12*IN_MILLISECONDS); } else uiBiteTimer -= diff; if (uiSpitTimer <= diff) { DoCast(me->getVictim(), SPELL_ECK_SPIT); - uiSpitTimer = urand(6*IN_MILISECONDS,14*IN_MILISECONDS); + uiSpitTimer = urand(6*IN_MILLISECONDS,14*IN_MILLISECONDS); } else uiSpitTimer -= diff; if (uiSpringTimer <= diff) @@ -89,7 +88,7 @@ struct boss_eckAI : public ScriptedAI if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { DoCast(pTarget, RAND(SPELL_ECK_SPRING_1, SPELL_ECK_SPRING_2)); - uiSpringTimer = urand(5*IN_MILISECONDS,10*IN_MILISECONDS); + uiSpringTimer = urand(5*IN_MILLISECONDS,10*IN_MILLISECONDS); } } else uiSpringTimer -= diff; @@ -142,7 +141,7 @@ struct npc_ruins_dwellerAI : public ScriptedAI { pInstance->SetData64(DATA_RUIN_DWELLER_DIED,me->GetGUID()); if (pInstance->GetData(DATA_ALIVE_RUIN_DWELLERS) == 0) - me->SummonCreature(CREATURE_ECK, EckSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300*IN_MILISECONDS); + me->SummonCreature(CREATURE_ECK, EckSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300*IN_MILLISECONDS); } } }; diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index c87a6600783..e90b244b118 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gundrak.h" //Spells @@ -95,13 +94,13 @@ struct boss_gal_darahAI : public ScriptedAI void Reset() { - uiStampedeTimer = 10*IN_MILISECONDS; - uiWhirlingSlashTimer = 21*IN_MILISECONDS; - uiPunctureTimer = 10*IN_MILISECONDS; - uiEnrageTimer = 15*IN_MILISECONDS; - uiImpalingChargeTimer = 21*IN_MILISECONDS; - uiStompTimer = 25*IN_MILISECONDS; - uiTransformationTimer = 9*IN_MILISECONDS; + uiStampedeTimer = 10*IN_MILLISECONDS; + uiWhirlingSlashTimer = 21*IN_MILLISECONDS; + uiPunctureTimer = 10*IN_MILLISECONDS; + uiEnrageTimer = 15*IN_MILLISECONDS; + uiImpalingChargeTimer = 21*IN_MILLISECONDS; + uiStompTimer = 25*IN_MILLISECONDS; + uiTransformationTimer = 9*IN_MILLISECONDS; uiPhaseCounter = 0; lImpaledPlayers.clear(); @@ -141,7 +140,7 @@ struct boss_gal_darahAI : public ScriptedAI Phase = RHINO; uiPhaseCounter = 0; DoScriptText(SAY_TRANSFORM_1, me); - uiTransformationTimer = 5*IN_MILISECONDS; + uiTransformationTimer = 5*IN_MILLISECONDS; bStartOfTransformation = true; me->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); me->SetReactState(REACT_AGGRESSIVE); @@ -164,13 +163,13 @@ struct boss_gal_darahAI : public ScriptedAI { DoCast(me, SPELL_STAMPEDE); DoScriptText(RAND(SAY_SUMMON_RHINO_1,SAY_SUMMON_RHINO_2,SAY_SUMMON_RHINO_3),me); - uiStampedeTimer = 15*IN_MILISECONDS; + uiStampedeTimer = 15*IN_MILLISECONDS; } else uiStampedeTimer -= diff; if (uiWhirlingSlashTimer <= diff) { DoCast(me->getVictim(), SPELL_WHIRLING_SLASH); - uiWhirlingSlashTimer = 21*IN_MILISECONDS; + uiWhirlingSlashTimer = 21*IN_MILLISECONDS; ++uiPhaseCounter; } else uiWhirlingSlashTimer -= diff; } @@ -184,7 +183,7 @@ struct boss_gal_darahAI : public ScriptedAI Phase = TROLL; uiPhaseCounter = 0; DoScriptText(SAY_TRANSFORM_2, me); - uiTransformationTimer = 9*IN_MILISECONDS; + uiTransformationTimer = 9*IN_MILLISECONDS; bStartOfTransformation = true; me->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); me->SetReactState(REACT_AGGRESSIVE); @@ -206,19 +205,19 @@ struct boss_gal_darahAI : public ScriptedAI if (uiPunctureTimer <= diff) { DoCast(me->getVictim(), SPELL_PUNCTURE); - uiPunctureTimer = 8*IN_MILISECONDS; + uiPunctureTimer = 8*IN_MILLISECONDS; } else uiPunctureTimer -= diff; if (uiEnrageTimer <= diff) { DoCast(me->getVictim(), SPELL_ENRAGE); - uiEnrageTimer = 20*IN_MILISECONDS; + uiEnrageTimer = 20*IN_MILLISECONDS; } else uiEnrageTimer -= diff; if (uiStompTimer <= diff) { DoCast(me->getVictim(), SPELL_STOMP); - uiStompTimer = 20*IN_MILISECONDS; + uiStompTimer = 20*IN_MILLISECONDS; } else uiStompTimer -= diff; if (uiImpalingChargeTimer <= diff) @@ -228,7 +227,7 @@ struct boss_gal_darahAI : public ScriptedAI DoCast(pTarget, SPELL_IMPALING_CHARGE); lImpaledPlayers.insert(pTarget->GetGUID()); } - uiImpalingChargeTimer = 31*IN_MILISECONDS; + uiImpalingChargeTimer = 31*IN_MILLISECONDS; ++uiPhaseCounter; } else uiImpalingChargeTimer -= diff; } diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp index 84a7d8bc654..7a9278b2fde 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gundrak.h" enum eSpells @@ -67,10 +66,10 @@ struct boss_moorabiAI : public ScriptedAI void Reset() { - uiGroundTremorTimer = 18*IN_MILISECONDS; - uiNumblingShoutTimer = 10*IN_MILISECONDS; - uiDeterminedStabTimer = 20*IN_MILISECONDS; - uiTransformationTImer = 12*IN_MILISECONDS; + uiGroundTremorTimer = 18*IN_MILLISECONDS; + uiNumblingShoutTimer = 10*IN_MILLISECONDS; + uiDeterminedStabTimer = 20*IN_MILLISECONDS; + uiTransformationTImer = 12*IN_MILLISECONDS; bPhase = false; if (pInstance) @@ -105,7 +104,7 @@ struct boss_moorabiAI : public ScriptedAI DoCast(me->getVictim(), SPELL_QUAKE, true); else DoCast(me->getVictim(), SPELL_GROUND_TREMOR, true); - uiGroundTremorTimer = 10*IN_MILISECONDS; + uiGroundTremorTimer = 10*IN_MILLISECONDS; } else uiGroundTremorTimer -= uiDiff; if (uiNumblingShoutTimer <= uiDiff) @@ -114,7 +113,7 @@ struct boss_moorabiAI : public ScriptedAI DoCast(me->getVictim(), SPELL_NUMBING_ROAR, true); else DoCast(me->getVictim(), SPELL_NUMBING_SHOUT, true); - uiNumblingShoutTimer = 10*IN_MILISECONDS; + uiNumblingShoutTimer = 10*IN_MILLISECONDS; } else uiNumblingShoutTimer -=uiDiff; if (uiDeterminedStabTimer <= uiDiff) @@ -123,7 +122,7 @@ struct boss_moorabiAI : public ScriptedAI DoCast(me->getVictim(), SPELL_DETERMINED_GORE); else DoCast(me->getVictim(), SPELL_DETERMINED_STAB, true); - uiDeterminedStabTimer = 8*IN_MILISECONDS; + uiDeterminedStabTimer = 8*IN_MILLISECONDS; } else uiDeterminedStabTimer -=uiDiff; if (!bPhase && uiTransformationTImer <= uiDiff) @@ -131,7 +130,7 @@ struct boss_moorabiAI : public ScriptedAI DoScriptText(EMOTE_TRANSFORM, me); DoScriptText(SAY_TRANSFORM, me); DoCast(me, SPELL_TRANSFORMATION, false); - uiTransformationTImer = 10*IN_MILISECONDS; + uiTransformationTImer = 10*IN_MILLISECONDS; } else uiTransformationTImer -= uiDiff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 1014beaeddd..47a55440b92 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gundrak.h" //Spells @@ -86,10 +85,10 @@ struct boss_slad_ranAI : public ScriptedAI void Reset() { - uiPoisonNovaTimer = 10*IN_MILISECONDS; - uiPowerfullBiteTimer = 3*IN_MILISECONDS; - uiVenomBoltTimer = 15*IN_MILISECONDS; - uiSpawnTimer = 5*IN_MILISECONDS; + uiPoisonNovaTimer = 10*IN_MILLISECONDS; + uiPowerfullBiteTimer = 3*IN_MILLISECONDS; + uiVenomBoltTimer = 15*IN_MILLISECONDS; + uiSpawnTimer = 5*IN_MILLISECONDS; uiPhase = 0; lSummons.DespawnAll(); @@ -115,19 +114,19 @@ struct boss_slad_ranAI : public ScriptedAI if (uiPoisonNovaTimer <= diff) { DoCast(me->getVictim(), SPELL_POISON_NOVA); - uiPoisonNovaTimer = 15*IN_MILISECONDS; + uiPoisonNovaTimer = 15*IN_MILLISECONDS; } else uiPoisonNovaTimer -= diff; if (uiPowerfullBiteTimer <= diff) { DoCast(me->getVictim(), SPELL_POWERFULL_BITE); - uiPowerfullBiteTimer = 10*IN_MILISECONDS; + uiPowerfullBiteTimer = 10*IN_MILLISECONDS; } else uiPowerfullBiteTimer -= diff; if (uiVenomBoltTimer <= diff) { DoCast(me->getVictim(), SPELL_VENOM_BOLT); - uiVenomBoltTimer = 10*IN_MILISECONDS; + uiVenomBoltTimer = 10*IN_MILLISECONDS; } else uiVenomBoltTimer -= diff; if (uiPhase) @@ -136,11 +135,11 @@ struct boss_slad_ranAI : public ScriptedAI { if (uiPhase == 1) for (uint8 i = 0; i < DUNGEON_MODE(3, 5); ++i) - me->SummonCreature(CREATURE_SNAKE, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS); + me->SummonCreature(CREATURE_SNAKE, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS); if (uiPhase == 2) for (uint8 i = 0; i < DUNGEON_MODE(3, 5); ++i) - me->SummonCreature(CREATURE_CONSTRICTORS, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS); - uiSpawnTimer = 5*IN_MILISECONDS; + me->SummonCreature(CREATURE_CONSTRICTORS, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS); + uiSpawnTimer = 5*IN_MILLISECONDS; } else uiSpawnTimer -= diff; } @@ -187,7 +186,7 @@ struct mob_slad_ran_constrictorAI : public ScriptedAI void Reset() { - uiGripOfSladRanTimer = 1*IN_MILISECONDS; + uiGripOfSladRanTimer = 1*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -197,7 +196,7 @@ struct mob_slad_ran_constrictorAI : public ScriptedAI if (uiGripOfSladRanTimer <= diff) { DoCast(me->getVictim(), SPELL_GRIP_OF_SLAD_RAN); - uiGripOfSladRanTimer = 5*IN_MILISECONDS; + uiGripOfSladRanTimer = 5*IN_MILLISECONDS; } else uiGripOfSladRanTimer -= diff; } @@ -214,7 +213,7 @@ struct mob_slad_ran_viperAI : public ScriptedAI void Reset() { - uiVenomousBiteTimer = 2*IN_MILISECONDS; + uiVenomousBiteTimer = 2*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -225,7 +224,7 @@ struct mob_slad_ran_viperAI : public ScriptedAI if (uiVenomousBiteTimer <= diff) { DoCast(me->getVictim(), SPELL_VENOMOUS_BITE); - uiVenomousBiteTimer = 10*IN_MILISECONDS; + uiVenomousBiteTimer = 10*IN_MILLISECONDS; } else uiVenomousBiteTimer -= diff; } }; diff --git a/src/server/scripts/Northrend/Gundrak/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h index a443aa4e698..c6858b8930c 100644 --- a/src/server/scripts/Northrend/Gundrak/gundrak.h +++ b/src/server/scripts/Northrend/Gundrak/gundrak.h @@ -1,20 +1,19 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_GUNDRAK_H #define DEF_GUNDRAK_H diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index 4dd896f74f2..6ca2e0886c6 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -1,22 +1,21 @@ /* -* Copyright (C) 2009 - 2010 TrinityCore -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gundrak.h" #define MAX_ENCOUNTER 5 diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 896eb068eb6..567f1f01c4d 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" #define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index aa5a940eb8f..b6a3760e6b6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Yells diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index f04b39040db..d04180aa037 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Horsemen diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index ab6fa6c46d3..a91fa207df7 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" #define SPELL_MORTAL_WOUND 25646 diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index d958ff24951..4fcf902714c 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Yells @@ -182,7 +183,7 @@ struct boss_gothikAI : public BossAI if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD) { - error_log("Script Gothik: cannot summon triggers!"); + sLog.outError("Script Gothik: cannot summon triggers!"); EnterEvadeMode(); return; } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 7df01e18483..1d96a2d70ab 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" #define SPELL_BOMBARD_SLIME 28280 diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 1de9c0e00c8..00b6f498ce0 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" #define SAY_AGGRO RAND(-1533109,-1533110,-1533111) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_highlord_mograine.cpp b/src/server/scripts/Northrend/Naxxramas/boss_highlord_mograine.cpp deleted file mode 100644 index 4eb72a3780e..00000000000 --- a/src/server/scripts/Northrend/Naxxramas/boss_highlord_mograine.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Highlord_Mograine -SD%Complete: 100 -SDComment: SCRIPT OBSOLETE -SDCategory: Naxxramas -EndScriptData */ - -#include "precompiled.h" - -//All horsemen -#define SPELL_SHIELDWALL 29061 -#define SPELL_BESERK 26662 - -// highlord mograine -#define SPELL_MARK_OF_MOGRAINE 28834 -#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. me->GetVictim() - -#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust." -#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough." -#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested." -#define SAY_AGGRO1 "You seek death?" -#define SAY_AGGRO2 "None shall pass!" -#define SAY_AGGRO3 "Be still!" -#define SAY_SLAY1 "You will find no peace in death." -#define SAY_SLAY2 "The master's will is done." -#define SAY_SPECIAL "Bow to the might of the Highlord!" -#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..." - -#define SOUND_TAUNT1 8842 -#define SOUND_TAUNT2 8843 -#define SOUND_TAUNT3 8844 -#define SOUND_AGGRO1 8835 -#define SOUND_AGGRO2 8836 -#define SOUND_AGGRO3 8837 -#define SOUND_SLAY1 8839 -#define SOUND_SLAY2 8840 -#define SOUND_SPECIAL 8841 -#define SOUND_DEATH 8838 - -#define SPIRIT_OF_MOGRAINE 16775 - -struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI -{ - boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mark_Timer; - uint32 RighteousFire_Timer; - bool ShieldWall1; - bool ShieldWall2; - - void Reset() - { - Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. - RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks - ShieldWall1 = true; - ShieldWall2 = true; - } - - void InitialYell() - { - if (!me->isInCombat()) - { - switch(rand()%3) - { - case 0: - DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me,SOUND_AGGRO1); - break; - case 1: - DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me,SOUND_AGGRO2); - break; - case 2: - DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me,SOUND_AGGRO3); - break; - } - } - } - - void KilledUnit() - { - switch(rand()%2) - { - case 0: - DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me,SOUND_SLAY1); - break; - case 1: - DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me,SOUND_SLAY2); - break; - } - } - - void JustDied(Unit* Killer) - { - DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me, SOUND_DEATH); - } - - void Aggro(Unit *who) - { - InitialYell(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Mark of Mograine - if (Mark_Timer < diff) - { - DoCast(me->getVictim(),SPELL_MARK_OF_MOGRAINE); - Mark_Timer = 12000; - }else Mark_Timer -= diff; - - // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50) - { - if (ShieldWall1) - { - DoCast(me,SPELL_SHIELDWALL); - ShieldWall1 = false; - } - } - if (ShieldWall2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20) - { - if (ShieldWall2) - { - DoCast(me,SPELL_SHIELDWALL); - ShieldWall2 = false; - } - } - - // Righteous Fire - if (RighteousFire_Timer < diff) - { - if (rand()%4 == 1) // 1/4 - { - DoCast(me->getVictim(),SPELL_RIGHTEOUS_FIRE); - } - RighteousFire_Timer = 2000; - }else RighteousFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_highlord_mograine(Creature* pCreature) -{ - return new boss_highlord_mograineAI (pCreature); -} - -void AddSC_boss_highlord_mograine() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_highlord_mograine"; - newscript->GetAI = &GetAI_boss_highlord_mograine; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index bfcd0636298..5188ab14d2f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: VERIFY SCRIPT SDCategory: Naxxramas EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Yells diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp index 0b0c8f5e4c5..c22bf236ec3 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Spells diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index 71d9cb86102..b7a61ad0aca 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Spells diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index b0cd4018955..6b93e5ea19d 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" #define SAY_AGGRO RAND(-1533075,-1533076,-1533077) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index e4472b299ce..bd30cb20471 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2009 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" enum Spells diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index d507df86e83..12d5b3057f5 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" //Razuvious - NO TEXT sound only diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index d75b3ab78b0..a646e6d8412 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" #define EMOTE_BREATH -1533082 diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 350cd450510..9d224f01022 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" //Stalagg diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 706789a73f1..6ece32054ae 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "naxxramas.h" const DoorData doorData[] = @@ -128,6 +129,8 @@ struct instance_naxxramas : public InstanceData uint64 uiKelthuzadTrigger; uint64 uiPortals[4]; + GOState gothikDoorState; + time_t minHorsemenDiedTime; time_t maxHorsemenDiedTime; @@ -171,7 +174,10 @@ struct instance_naxxramas : public InstanceData pSapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH); return; } - case GO_GOTHIK_GATE: GothikGateGUID = add ? pGo->GetGUID() : 0; break; + case GO_GOTHIK_GATE: + GothikGateGUID = add ? pGo->GetGUID() : 0; + pGo->SetGoState(gothikDoorState); + break; case GO_HORSEMEN_CHEST: HorsemenChestGUID = add ? pGo->GetGUID() : 0; break; case GO_HORSEMEN_CHEST_HERO: HorsemenChestGUID = add ? pGo->GetGUID() : 0; break; case GO_KELTHUZAD_PORTAL01: uiPortals[0] = pGo->GetGUID(); break; @@ -194,6 +200,7 @@ struct instance_naxxramas : public InstanceData case DATA_GOTHIK_GATE: if (GameObject *pGothikGate = instance->GetGameObject(GothikGateGUID)) pGothikGate->SetGoState(GOState(value)); + gothikDoorState = GOState(value); break; case DATA_HORSEMEN0: @@ -307,6 +314,21 @@ struct instance_naxxramas : public InstanceData } return false; } + + std::string GetSaveData() + { + std::ostringstream saveStream; + saveStream << GetBossSaveData() << " " << gothikDoorState; + return saveStream.str(); + } + + void Load(const char * data) + { + std::istringstream loadStream(LoadBossState(data)); + uint32 buff; + loadStream >> buff; + gothikDoorState = GOState(buff); + } }; InstanceData* GetInstanceData_instance_naxxramas(Map* pMap) diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h index 9b1fac2ff5b..d4e67ce1b81 100644 --- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h +++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008 - 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_NAXXRAMAS_H diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index bbb1df2731d..71e8ad69ff4 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss malygos SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = '' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //Spells #define SPELL_ARCANE_BREATH_N 56272 diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h index caa82a92e95..e56f760cb83 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_EYE_OF_ETERNITY_H #define DEF_EYE_OF_ETERNITY_H diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index d93ec415b42..e8ba3c89a67 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "eye_of_eternity.h" struct instance_eye_of_eternity : public ScriptedInstance diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index 02c39dc1232..767aeabcc42 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -1,21 +1,22 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "nexus.h" enum Spells @@ -77,7 +78,7 @@ struct boss_anomalusAI : public ScriptedAI void Reset() { Phase = 0; - uiSparkTimer = 5*IN_MILISECONDS; + uiSparkTimer = 5*IN_MILLISECONDS; uiChaoticRiftGUID = 0; bDeadChaoticRift = false; @@ -138,7 +139,7 @@ struct boss_anomalusAI : public ScriptedAI Phase = 1; DoScriptText(SAY_SHIELD, me); DoCast(me, SPELL_RIFT_SHIELD); - Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0,5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS); + Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0,5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILLISECONDS); if (Rift) { //DoCast(Rift, SPELL_CHARGE_RIFT); @@ -154,7 +155,7 @@ struct boss_anomalusAI : public ScriptedAI { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SPARK); - uiSparkTimer = 5*IN_MILISECONDS; + uiSparkTimer = 5*IN_MILLISECONDS; } else uiSparkTimer -= diff; DoMeleeAttackIfReady(); @@ -187,8 +188,8 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI void Reset() { - uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS; - uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS; + uiChaoticEnergyBurstTimer = 1*IN_MILLISECONDS; + uiSummonCrazedManaWraithTimer = 5*IN_MILLISECONDS; //me->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. //Model for ally (1126) does not show auras. Horde model works perfect. //Set model to horde number @@ -214,20 +215,20 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); else DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST); - uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS; + uiChaoticEnergyBurstTimer = 1*IN_MILLISECONDS; } else uiChaoticEnergyBurstTimer -= diff; if (uiSummonCrazedManaWraithTimer <= diff) { - Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX()+1, me->GetPositionY()+1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS); + Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX()+1, me->GetPositionY()+1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILLISECONDS); if (Wraith) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) Wraith->AI()->AttackStart(pTarget); Unit* Anomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0); if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) - uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS; + uiSummonCrazedManaWraithTimer = 5*IN_MILLISECONDS; else - uiSummonCrazedManaWraithTimer = 10*IN_MILISECONDS; + uiSummonCrazedManaWraithTimer = 10*IN_MILLISECONDS; } else uiSummonCrazedManaWraithTimer -= diff; } }; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index ff633c55eac..befa9fb068d 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -1,21 +1,22 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "nexus.h" enum Spells @@ -70,12 +71,12 @@ struct boss_keristraszaAI : public ScriptedAI void Reset() { - uiCrystalfireBreathTimer = 14*IN_MILISECONDS; - uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS); - uiTailSweepTimer = 5*IN_MILISECONDS; + uiCrystalfireBreathTimer = 14*IN_MILLISECONDS; + uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS,11*IN_MILLISECONDS); + uiTailSweepTimer = 5*IN_MILLISECONDS; bEnrage = false; - uiCheckIntenseColdTimer = 2*IN_MILISECONDS; + uiCheckIntenseColdTimer = 2*IN_MILLISECONDS; bMoreThanTwoIntenseCold = false; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); @@ -174,7 +175,7 @@ struct boss_keristraszaAI : public ScriptedAI break; } } - uiCheckIntenseColdTimer = 2*IN_MILISECONDS; + uiCheckIntenseColdTimer = 2*IN_MILLISECONDS; } else uiCheckIntenseColdTimer -= diff; if (!bEnrage && HealthBelowPct(25)) @@ -187,13 +188,13 @@ struct boss_keristraszaAI : public ScriptedAI if (uiCrystalfireBreathTimer <= diff) { DoCast(me->getVictim(), SPELL_CRYSTALFIRE_BREATH); - uiCrystalfireBreathTimer = 14*IN_MILISECONDS; + uiCrystalfireBreathTimer = 14*IN_MILLISECONDS; } else uiCrystalfireBreathTimer -= diff; if (uiTailSweepTimer <= diff) { DoCast(me, SPELL_TAIL_SWEEP); - uiTailSweepTimer = 5*IN_MILISECONDS; + uiTailSweepTimer = 5*IN_MILLISECONDS; } else uiTailSweepTimer -= diff; if (uiCrystalChainsCrystalizeTimer <= diff) @@ -203,7 +204,7 @@ struct boss_keristraszaAI : public ScriptedAI DoCast(me, SPELL_CRYSTALIZE); else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(pTarget, SPELL_CRYSTAL_CHAINS); - uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS); + uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS,11*IN_MILLISECONDS); } else uiCrystalChainsCrystalizeTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 0bf9fb07bb7..77dd3025451 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -1,21 +1,22 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "nexus.h" enum Spells @@ -49,7 +50,7 @@ enum Yells enum Achievements { ACHIEV_SPLIT_PERSONALITY = 2150, - ACHIEV_TIMER = 5*IN_MILISECONDS + ACHIEV_TIMER = 5*IN_MILLISECONDS }; const Position CenterOfRoom = {504.80, 89.07, -16.12, 6.27}; @@ -87,9 +88,9 @@ struct boss_magus_telestraAI : public ScriptedAI { Phase = 0; //These times are probably wrong - uiIceNovaTimer = 7*IN_MILISECONDS; + uiIceNovaTimer = 7*IN_MILLISECONDS; uiFireBombTimer = 0; - uiGravityWellTimer = 15*IN_MILISECONDS; + uiGravityWellTimer = 15*IN_MILLISECONDS; uiCooldown = 0; uiFireMagusGUID = 0; @@ -136,7 +137,7 @@ struct boss_magus_telestraAI : public ScriptedAI uint64 SplitPersonality(uint32 entry) { - if (Creature* Summoned = me->SummonCreature(entry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS)) + if (Creature* Summoned = me->SummonCreature(entry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILLISECONDS)) { switch (entry) { @@ -223,7 +224,7 @@ struct boss_magus_telestraAI : public ScriptedAI uiFrostMagusGUID = 0; uiArcaneMagusGUID = 0; bIsWaitingToAppear = true; - uiIsWaitingToAppearTimer = 4*IN_MILISECONDS; + uiIsWaitingToAppearTimer = 4*IN_MILLISECONDS; DoScriptText(SAY_MERGE, me); bIsAchievementTimerRunning = false; uiAchievementTimer = 0; @@ -282,9 +283,9 @@ struct boss_magus_telestraAI : public ScriptedAI if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_ICE_NOVA, false); - uiCooldown = 1.5*IN_MILISECONDS; + uiCooldown = 1.5*IN_MILLISECONDS; } - uiIceNovaTimer = 15*IN_MILISECONDS; + uiIceNovaTimer = 15*IN_MILLISECONDS; } else uiIceNovaTimer -= diff; if (uiGravityWellTimer <= diff) @@ -292,9 +293,9 @@ struct boss_magus_telestraAI : public ScriptedAI if (Unit *pTarget = me->getVictim()) { DoCast(pTarget, SPELL_GRAVITY_WELL); - uiCooldown = 6*IN_MILISECONDS; + uiCooldown = 6*IN_MILLISECONDS; } - uiGravityWellTimer = 15*IN_MILISECONDS; + uiGravityWellTimer = 15*IN_MILLISECONDS; } else uiGravityWellTimer -= diff; if (uiFireBombTimer <= diff) @@ -302,9 +303,9 @@ struct boss_magus_telestraAI : public ScriptedAI if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_FIREBOMB, false); - uiCooldown = 2*IN_MILISECONDS; + uiCooldown = 2*IN_MILLISECONDS; } - uiFireBombTimer = 2*IN_MILISECONDS; + uiFireBombTimer = 2*IN_MILLISECONDS; } else uiFireBombTimer -=diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 1304f95c7ac..c28aff66ed1 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -1,21 +1,22 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "nexus.h" enum Spells @@ -75,10 +76,10 @@ struct boss_ormorokAI : public ScriptedAI void Reset() { - uiCrystalSpikesTimer = 12*IN_MILISECONDS; - uiTrampleTimer = 10*IN_MILISECONDS; - uiSpellReflectionTimer = 30*IN_MILISECONDS; - uiSummonCrystallineTanglerTimer = 17*IN_MILISECONDS; + uiCrystalSpikesTimer = 12*IN_MILLISECONDS; + uiTrampleTimer = 10*IN_MILLISECONDS; + uiSpellReflectionTimer = 30*IN_MILLISECONDS; + uiSummonCrystallineTanglerTimer = 17*IN_MILLISECONDS; bFrenzy = false; bCrystalSpikes = false; @@ -125,7 +126,7 @@ struct boss_ormorokAI : public ScriptedAI fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2))); fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2))); for (uint8 i = 0; i < 4; ++i) - me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILISECONDS); + me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILLISECONDS); if (++uiCrystalSpikesCount >= 13) bCrystalSpikes = false; uiCrystalSpikesTimer2 = 200; @@ -140,14 +141,14 @@ struct boss_ormorokAI : public ScriptedAI if (uiTrampleTimer <= diff) { DoCast(me, SPELL_TRAMPLE); - uiTrampleTimer = 10*IN_MILISECONDS; + uiTrampleTimer = 10*IN_MILLISECONDS; } else uiTrampleTimer -= diff; if (uiSpellReflectionTimer <= diff) { DoScriptText(SAY_REFLECT, me); DoCast(me, SPELL_SPELL_REFLECTION); - uiSpellReflectionTimer = 30*IN_MILISECONDS; + uiSpellReflectionTimer = 30*IN_MILLISECONDS; } else uiSpellReflectionTimer -= diff; if (uiCrystalSpikesTimer <= diff) @@ -160,7 +161,7 @@ struct boss_ormorokAI : public ScriptedAI fBaseY = me->GetPositionY(); fBaseZ = me->GetPositionZ(); fBaseO = me->GetOrientation(); - uiCrystalSpikesTimer = 20*IN_MILISECONDS; + uiCrystalSpikesTimer = 20*IN_MILLISECONDS; } else uiCrystalSpikesTimer -= diff; if (IsHeroic() && (uiSummonCrystallineTanglerTimer <= diff)) @@ -200,7 +201,7 @@ struct boss_ormorokAI : public ScriptedAI Crystalline_Tangler->getThreatManager().addThreat(pTarget, 1000000000.0f); } } - uiSummonCrystallineTanglerTimer = 17*IN_MILISECONDS; + uiSummonCrystallineTanglerTimer = 17*IN_MILLISECONDS; } else uiSummonCrystallineTanglerTimer -= diff; DoMeleeAttackIfReady(); @@ -218,8 +219,8 @@ struct mob_crystal_spikeAI : public Scripted_NoMovementAI void Reset() { - SpellCrystalSpikeDamageTimer = 3.7*IN_MILISECONDS; - SpellCrystalSpikePrevisualTimer = 1*IN_MILISECONDS; + SpellCrystalSpikeDamageTimer = 3.7*IN_MILLISECONDS; + SpellCrystalSpikePrevisualTimer = 1*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -227,13 +228,13 @@ struct mob_crystal_spikeAI : public Scripted_NoMovementAI if (SpellCrystalSpikePrevisualTimer <= diff) { DoCast(me, SPELL_CRYSTAL_SPIKE_PREVISUAL); - SpellCrystalSpikePrevisualTimer = 10*IN_MILISECONDS; + SpellCrystalSpikePrevisualTimer = 10*IN_MILLISECONDS; } else SpellCrystalSpikePrevisualTimer -= diff; if (SpellCrystalSpikeDamageTimer <= diff) { DoCast(me, SPELL_CRYSTALL_SPIKE_DAMAGE); - SpellCrystalSpikeDamageTimer = 10*IN_MILISECONDS; + SpellCrystalSpikeDamageTimer = 10*IN_MILLISECONDS; } else SpellCrystalSpikeDamageTimer -= diff; } }; @@ -246,7 +247,7 @@ struct mob_crystalline_tanglerAI : public ScriptedAI void Reset() { - uiRootsTimer = 1*IN_MILISECONDS; + uiRootsTimer = 1*IN_MILLISECONDS; } void UpdateAI(const uint32 diff) @@ -256,7 +257,7 @@ struct mob_crystalline_tanglerAI : public ScriptedAI if (me->IsWithinDist(me->getVictim(), 5.0f, false)) { DoCast(me->getVictim(), SPELL_ROOTS); - uiRootsTimer = 15*IN_MILISECONDS; + uiRootsTimer = 15*IN_MILLISECONDS; } } else uiRootsTimer -= diff; } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp index 4bd9f55a013..2a95007a477 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss Commander Kolurg SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_commander_kolurg' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_BATTLE_SHOUT 31403 #define SPELL_CHARGE 60067 diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp index ef02baa38e6..a4e8f9559ce 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss Commander Stoutbeard SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_BATTLE_SHOUT 31403 #define SPELL_CHARGE 60067 diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index db70245e3a4..356a7eab12f 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -1,21 +1,22 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "nexus.h" #define NUMBER_OF_ENCOUNTERS 4 diff --git a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h index 66902bece30..237f5db46f5 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/nexus.h +++ b/src/server/scripts/Northrend/Nexus/Nexus/nexus.h @@ -1,17 +1,18 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ #ifndef DEF_NEXUS_H diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index 7d276206339..a1201b838c5 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "oculus.h" enum Spells @@ -188,7 +189,7 @@ struct npc_unstable_sphereAI : public ScriptedAI if (uiPulseTimer <= uiDiff) { DoCast(SPELL_UNSTABLE_SPHERE_PULSE); - uiPulseTimer = 3*IN_MILISECONDS; + uiPulseTimer = 3*IN_MILLISECONDS; } else uiPulseTimer -= uiDiff; if (uiDeathTimer <= uiDiff) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index 94fb90ab206..cde22d0268c 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "oculus.h" //Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 29435441d00..4333102c540 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -1,18 +1,19 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Urom @@ -21,7 +22,7 @@ SDComment: Is not working SPELL_ARCANE_SHIELD. SPELL_FROSTBOMB has some issues, SDCategory: Instance Script EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "oculus.h" enum Spells diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 79034250a43..1a67d07dcb0 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "oculus.h" enum Spells diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index 49be2385a3c..bc1ce7f58dd 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "oculus.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 685583532d5..b3572bd92ff 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2006 - 2010 TrinityCore -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "oculus.h" #define GOSSIP_ITEM_DRAKES "So where do we go from here?" diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h index b212c9b8b6a..8228cd10754 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.h +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_OCULUS_H #define DEF_OCULUS_H diff --git a/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp index 3e24aaeb6c0..65d870afc0d 100644 --- a/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp @@ -1,21 +1,21 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2006 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "obsidian_sanctum.h" enum eEnums @@ -53,6 +53,7 @@ enum eEnums SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) SPELL_TWILIGHT_REVENGE = 60639, + NPC_FIRE_CYCLONE = 30648, SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x Creature entry 30494) @@ -101,6 +102,7 @@ enum eEnums SPELL_HATCH_EGGS_EFFECT = 58685, NPC_TWILIHT_WHELP = 31214, NPC_TWILIGHT_EGG = 30882, + NPC_SARTHARION_TWILIGHT_EGG = 31204, //Whelps NPC_TWILIGHT_WHELP = 30890, @@ -110,7 +112,10 @@ enum eEnums //flame tsunami SPELL_FLAME_TSUNAMI = 57494, // the visual dummy SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction - SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // periodic damage, npc has this aura + + SPELL_FLAME_TSUNAMI_DMG_AURA = 57491, // periodic damage, npc has this aura + SPELL_FLAME_TSUNAMI_BUFF = 60430, + NPC_FLAME_TSUNAMI = 30616, // for the flame waves NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike @@ -132,6 +137,7 @@ struct Waypoint { float m_fX, m_fY, m_fZ; }; + struct Location { float x,y,z; @@ -171,20 +177,22 @@ Waypoint m_aDragonCommon[MAX_WAYPOINT]= {3250.479, 585.827, 98.652}, {3209.969, 566.523, 98.652} }; -static Location FlameRight1Spawn = { 3197.59, 495.336, 57.8462 }; -static Location FlameRight1Direction = { 3289.28, 521.569, 55.1526 }; -static Location FlameRight2Spawn = { 3201.94, 543.324, 56.7209 }; -static Location FlameRight2Direction = { 3288.98, 549.291, 55.1232 }; -static Location FlameLeft1Spawn = { 3290.24, 521.725, 55.1238 }; -static Location FlameLeft1Direction = { 3199.94, 516.891, 57.5112 }; -static Location FlameLeft2Spawn = { 3290.33, 586.51, 55.063 }; -static Location FlameLeft2Direction = { 3195.03, 479.135, 55.6331 }; -static Location AcolyteofShadron = { 3363.92, 534.703, 97.2683 }; -static Location AcolyteofShadron2 = { 3246.57, 551.263, 58.6164 }; -static Location AcolyteofVesperon = { 3145.68, 520.71, 89.7 }; -static Location AcolyteofVesperon2 = { 3246.57, 551.263, 58.6164 }; +static Location FlameRight1Spawn = { 3200.00, 573.211, 57.1551 }; +static Location FlameRight1Direction = { 3289.28, 573.211, 57.1551 }; +static Location FlameRight2Spawn = { 3200.00, 532.211, 57.1551 }; +static Location FlameRight2Direction = { 3289.28, 532.211, 57.1551 }; +static Location FlameRight3Spawn = { 3200.00, 491.211, 57.1551 }; +static Location FlameRight3Direction = { 3289.28, 491.211, 57.1551 }; +static Location FlameLeft1Spawn = { 3289.28, 511.711, 57.1551 }; +static Location FlameLeft1Direction = { 3200.00, 511.711, 57.1551 }; +static Location FlameLeft2Spawn = { 3289.28, 552.711, 57.1551 }; +static Location FlameLeft2Direction = { 3200.00, 552.711, 57.1551 }; +static Location AcolyteofShadron = { 3363.92, 534.703, 97.2683 }; +static Location AcolyteofShadron2 = { 3246.57, 551.263, 58.6164 }; +static Location AcolyteofVesperon = { 3145.68, 520.71, 89.7 }; +static Location AcolyteofVesperon2 = { 3246.57, 551.263, 58.6164 }; Locations TwilightEggs[] = { {3219.28, 669.121 , 88.5549}, @@ -196,9 +204,12 @@ Locations TwilightEggs[] = }; Locations TwilightEggsSarth[] = { - {3261.75, 539.14 , 58.6082}, - {3257.41, 512.939 , 58.5432}, - {3231.04, 498.281 , 58.6439} + {3252.73, 515.762 , 58.5501}, + {3256.56, 521.119 , 58.6061}, + {3255.63, 527.513 , 58.7568}, + {3264.90, 525.865 , 58.6436}, + {3264.26, 516.364 , 58.8011}, + {3257.54, 502.285 , 58.2077} }; /*###### @@ -241,7 +252,7 @@ struct boss_sartharionAI : public ScriptedAI m_bIsBerserk = false; m_bIsSoftEnraged = false; - m_uiEnrageTimer = 15*MINUTE*IN_MILISECONDS; + m_uiEnrageTimer = 15*MINUTE*IN_MILLISECONDS; m_bIsHardEnraged = false; m_uiTenebronTimer = 30000; @@ -262,8 +273,68 @@ struct boss_sartharionAI : public ScriptedAI me->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); me->ResetLootMode(); + me->SetHomePosition(3246.57, 551.263, 58.6164, 4.66003); achievProgress = 0; + + // Drakes respawning system + if (pInstance) + { + Creature* pTenebron = Unit::GetCreature(*me, pInstance->GetData64(DATA_TENEBRON)); + Creature* pShadron = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON)); + Creature* pVesperon = Unit::GetCreature(*me, pInstance->GetData64(DATA_VESPERON)); + if (pTenebron) + { + pTenebron->SetHomePosition(3239.07, 657.235, 86.8775, 4.74729); + if(pTenebron->isAlive()) + { + if (pTenebron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTenebron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pTenebron->GetMotionMaster()->MoveTargetedHome(); + }else + { + if(pInstance->GetData(TYPE_TENEBRON_PREKILLED) == false) + { + pTenebron->Respawn(); + pTenebron->GetMotionMaster()->MoveTargetedHome(); + } + } + } + if (pShadron) + { + pShadron->SetHomePosition(3363.06, 525.28, 98.362, 4.76475); + if(pShadron->isAlive()) + { + if (pShadron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pShadron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pShadron->GetMotionMaster()->MoveTargetedHome(); + }else + { + if(pInstance->GetData(TYPE_SHADRON_PREKILLED) == false) + { + pShadron->Respawn(); + pShadron->GetMotionMaster()->MoveTargetedHome(); + } + } + } + if (pVesperon) + { + pVesperon->SetHomePosition(3145.68, 520.71, 89.7, 4.64258); + if(pVesperon->isAlive()) + { + if (pVesperon->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pVesperon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pVesperon->GetMotionMaster()->MoveTargetedHome(); + }else + { + if(pInstance->GetData(TYPE_VESPERON_PREKILLED) == false) + { + pVesperon->Respawn(); + pVesperon->GetMotionMaster()->MoveTargetedHome(); + } + } + } + } } void JustReachedHome() @@ -272,7 +343,7 @@ struct boss_sartharionAI : public ScriptedAI pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED); } - void EnterCombat(Unit* /*pWho*/) + void EnterCombat(Unit* pWho) { DoScriptText(SAY_SARTHARION_AGGRO,me); DoZoneInCombat(); @@ -284,24 +355,41 @@ struct boss_sartharionAI : public ScriptedAI } } - void JustDied(Unit* /*pKiller*/) + void JustDied(Unit* pKiller) { DoScriptText(SAY_SARTHARION_DEATH,me); if (pInstance) { - if (achievProgress >= 1) - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ASSIST,H_ACHIEV_TWILIGHT_ASSIST)); - else if (achievProgress >= 2) - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_DUO,H_ACHIEV_TWILIGHT_DUO)); - else if (achievProgress == 3) - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ZONE,H_ACHIEV_TWILIGHT_ZONE)); + Creature* pTenebron = Unit::GetCreature(*me, pInstance->GetData64(DATA_TENEBRON)); + Creature* pShadron = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON)); + Creature* pVesperon = Unit::GetCreature(*me, pInstance->GetData64(DATA_VESPERON)); + if (pTenebron && pTenebron->isAlive()) + pTenebron->DisappearAndDie(); + if (pShadron && pShadron->isAlive()) + pShadron->DisappearAndDie(); + if (pVesperon && pVesperon->isAlive()) + pVesperon->DisappearAndDie(); + if (achievProgress == 1) + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ASSIST,H_ACHIEV_TWILIGHT_ASSIST)); + else if (achievProgress == 2) + { + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ASSIST,H_ACHIEV_TWILIGHT_ASSIST)); + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_DUO,H_ACHIEV_TWILIGHT_DUO)); + } + else if (achievProgress == 3) + { + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ASSIST,H_ACHIEV_TWILIGHT_ASSIST)); + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_DUO,H_ACHIEV_TWILIGHT_DUO)); + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ZONE,H_ACHIEV_TWILIGHT_ZONE)); + } + pInstance->SetData(TYPE_SARTHARION_EVENT, DONE); } } - void KilledUnit(Unit* /*pVictim*/) + void KilledUnit(Unit* pVictim) { DoScriptText(RAND(SAY_SARTHARION_SLAY_1,SAY_SARTHARION_SLAY_2,SAY_SARTHARION_SLAY_3), me); } @@ -314,14 +402,18 @@ struct boss_sartharionAI : public ScriptedAI me->AddLootMode(LOOT_MODE_HARD_MODE_3); // Add 3rd Drake loot mode else if (me->HasLootMode(LOOT_MODE_HARD_MODE_1)) // Has one Drake loot mode me->AddLootMode(LOOT_MODE_HARD_MODE_2); // Add 2nd Drake loot mode - else // Has no Drake loot modes + else // Has no Drake loot modes me->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode } void FetchDragons() { - if (!pInstance) + if(!pInstance) return; + + me->ResetLootMode(); + achievProgress = 0; + Creature* pFetchTene = Unit::GetCreature(*me, pInstance->GetData64(DATA_TENEBRON)); Creature* pFetchShad = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON)); Creature* pFetchVesp = Unit::GetCreature(*me, pInstance->GetData64(DATA_VESPERON)); @@ -332,6 +424,11 @@ struct boss_sartharionAI : public ScriptedAI if (pFetchTene && pFetchTene->isAlive() && !pFetchTene->getVictim()) { bCanUseWill = true; + if(!pFetchTene->isInCombat()) + { + AddDrakeLootMode(); + achievProgress++; + } pFetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); if (!pFetchTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) @@ -341,6 +438,11 @@ struct boss_sartharionAI : public ScriptedAI if (pFetchShad && pFetchShad->isAlive() && !pFetchShad->getVictim()) { bCanUseWill = true; + if(!pFetchShad->isInCombat()) + { + AddDrakeLootMode(); + achievProgress++; + } pFetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); if (!pFetchShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) @@ -350,6 +452,11 @@ struct boss_sartharionAI : public ScriptedAI if (pFetchVesp && pFetchVesp->isAlive() && !pFetchVesp->getVictim()) { bCanUseWill = true; + if(!pFetchVesp->isInCombat()) + { + AddDrakeLootMode(); + achievProgress++; + } pFetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); if (!pFetchVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) @@ -375,22 +482,22 @@ struct boss_sartharionAI : public ScriptedAI pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); int32 iTextId = 0; - AddDrakeLootMode(); - - achievProgress++; switch(pTemp->GetEntry()) { case NPC_TENEBRON: iTextId = SAY_SARTHARION_CALL_TENEBRON; + pTemp->AddAura(SPELL_POWER_OF_TENEBRON, pTemp); pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); break; case NPC_SHADRON: iTextId = SAY_SARTHARION_CALL_SHADRON; + pTemp->AddAura(SPELL_POWER_OF_SHADRON, pTemp); pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); break; case NPC_VESPERON: iTextId = SAY_SARTHARION_CALL_VESPERON; + pTemp->AddAura(SPELL_POWER_OF_VESPERON, pTemp); pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); break; } @@ -415,6 +522,27 @@ struct boss_sartharionAI : public ScriptedAI } } + // Selects a random Fire Cyclone and makes it cast Lava Strike. + // FIXME: Frequency of the casts reduced to compensate 100% chance of spawning a Lava Blaze add + void CastLavaStrikeOnTarget(Unit* target) + { + std::list pFireCyclonesList; + Trinity::AllCreaturesOfEntryInRange checker(me, NPC_FIRE_CYCLONE, 200.0f); + Trinity::CreatureListSearcher searcher(me, pFireCyclonesList, checker); + me->VisitNearbyObject(200.0f, searcher); + + if(pFireCyclonesList.empty()) + return; + + std::list::iterator itr = pFireCyclonesList.begin(); + uint32 rnd = rand()%pFireCyclonesList.size(); + + for(uint32 i = 0; i < rnd; ++i) + ++itr; + + (*itr)->CastSpell(target, SPELL_LAVA_STRIKE, true); + } + void UpdateAI(const uint32 uiDiff) { //Return since we have no target @@ -435,9 +563,9 @@ struct boss_sartharionAI : public ScriptedAI } //soft enrage - if (!m_bIsSoftEnraged && (me->GetHealth()*100 / me->GetMaxHealth()) <= 10) + if (!m_bIsSoftEnraged && HealthBelowPct(10)) { - // TODO + // m_bIsSoftEnraged is used while determining Lava Strike cooldown. m_bIsSoftEnraged = true; } @@ -461,18 +589,20 @@ struct boss_sartharionAI : public ScriptedAI { case 0: { - if (Creature *Right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn.x, FlameRight1Spawn.y , FlameRight1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000)) - Right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction.x, FlameRight1Direction.y, FlameRight1Direction.z); - if (Creature *Right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn.x, FlameRight2Spawn.y , FlameRight2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000)) - Right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction.x, FlameRight2Direction.y, FlameRight2Direction.z); + Creature *Right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn.x, FlameRight1Spawn.y , FlameRight1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000); + Creature *Right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn.x, FlameRight2Spawn.y , FlameRight2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000); + Creature *Right3 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight3Spawn.x, FlameRight3Spawn.y , FlameRight3Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000); + Right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction.x, FlameRight1Direction.y, FlameRight1Direction.z); + Right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction.x, FlameRight2Direction.y, FlameRight2Direction.z); + Right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction.x, FlameRight3Direction.y, FlameRight3Direction.z); break; } case 1: { - if (Creature *Left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn.x, FlameLeft1Spawn.y , FlameLeft1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000)) - Left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction.x, FlameLeft1Direction.y, FlameLeft1Direction.z); - if (Creature *Left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn.x, FlameLeft2Spawn.y , FlameLeft2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000)) - Left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction.x, FlameLeft2Direction.y, FlameLeft2Direction.z); + Creature *Left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn.x, FlameLeft1Spawn.y , FlameLeft1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000); + Creature *Left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn.x, FlameLeft2Spawn.y , FlameLeft2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN,12000); + Left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction.x, FlameLeft1Direction.y, FlameLeft1Direction.z); + Left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction.x, FlameLeft2Direction.y, FlameLeft2Direction.z); break; } } @@ -515,12 +645,12 @@ struct boss_sartharionAI : public ScriptedAI { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - DoCast(pTarget, SPELL_LAVA_STRIKE); + CastLavaStrikeOnTarget(pTarget); - if (urand(0,4) == 4) + if(urand(0,5) == 0) DoScriptText(RAND(SAY_SARTHARION_SPECIAL_1,SAY_SARTHARION_SPECIAL_2,SAY_SARTHARION_SPECIAL_3), me); } - m_uiLavaStrikeTimer = urand(5000,20000); + m_uiLavaStrikeTimer = (m_bIsSoftEnraged ? urand(1400, 2000) : urand(5000,20000)); } else m_uiLavaStrikeTimer -= uiDiff; @@ -552,6 +682,10 @@ struct boss_sartharionAI : public ScriptedAI else m_uiVesperonTimer -= uiDiff; + // Don't attack current target if he's not visible for us. + if(me->getVictim() && me->getVictim()->HasAura(57874, 0)) + me->getThreatManager().modifyThreatPercent(me->getVictim(), -100); + DoMeleeAttackIfReady(); EnterEvadeIfOutOfCombatArea(uiDiff); @@ -619,9 +753,6 @@ struct dummy_dragonAI : public ScriptedAI if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (GameObject* TwilightPortal = GameObject::GetGameObject((*me), pInstance->GetData64(GO_TWILIGHT_PORTAL))) - TwilightPortal->SetGoState(GO_STATE_READY); - m_uiWaypointId = 0; m_uiMoveNextTimer = 500; m_iPortalRespawnTime = 30000; @@ -633,7 +764,7 @@ struct dummy_dragonAI : public ScriptedAI if (!pInstance || uiType != POINT_MOTION_TYPE) return; - debug_log("dummy_dragonAI: %s reached point %u", me->GetName(), uiPointId); +// debug_log("dummy_dragonAI: %s reached point %u", me->GetName(), uiPointId); //if healers messed up the raid and we was already initialized if (pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) @@ -646,6 +777,14 @@ struct dummy_dragonAI : public ScriptedAI if (uiPointId == POINT_ID_LAND) { me->GetMotionMaster()->Clear(); + me->SetInCombatWithZone(); + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) + { + me->AddThreat(target, 1.0f); + me->Attack(target, true); + me->GetMotionMaster()->MoveChase(target); + } + m_bCanMoveFree = false; return; } @@ -695,39 +834,57 @@ struct dummy_dragonAI : public ScriptedAI //using a grid search here seem to be more efficient than caching all four guids //in instance script and calculate range to each. GameObject* pPortal = me->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f); - if (GameObject* TwilightPortal = GameObject::GetGameObject((*me), pInstance->GetData64(GO_TWILIGHT_PORTAL))) - TwilightPortal->SetGoState(GO_STATE_ACTIVE); switch(me->GetEntry()) { case NPC_TENEBRON: { iTextId = WHISPER_HATCH_EGGS; - if (pInstance && pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[0].x, TwilightEggs[0].y, TwilightEggs[0].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + { + for(uint32 i = 0; i < 6; ++i) + me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i].x, TwilightEggs[i].y, TwilightEggs[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + } else - me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggsSarth[0].x, TwilightEggsSarth[0].y, TwilightEggsSarth[0].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + { + for(uint32 i = 0; i < 6; ++i) + me->SummonCreature(NPC_SARTHARION_TWILIGHT_EGG, TwilightEggsSarth[i].x, TwilightEggsSarth[i].y, TwilightEggsSarth[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + } break; } case NPC_SHADRON: { iTextId = WHISPER_OPEN_PORTAL; - if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y , AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if(pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y , AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); else - me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y , AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y , AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); break; } case NPC_VESPERON: { - if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon.x, AcolyteofVesperon.y , AcolyteofVesperon.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); - else - me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2.x, AcolyteofVesperon2.y , AcolyteofVesperon2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); - iTextId = WHISPER_OPEN_PORTAL; - break; + if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + { + if(Creature* Acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon.x, AcolyteofVesperon.y , AcolyteofVesperon.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000)) + { + me->InterruptNonMeleeSpells(true); + Acolyte->InterruptNonMeleeSpells(true); + me->CastSpell(me, 32747, false); + } + } + else + { + if(Creature* Acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2.x, AcolyteofVesperon2.y , AcolyteofVesperon2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000)) + { + me->InterruptNonMeleeSpells(true); + Acolyte->InterruptNonMeleeSpells(true); + me->CastSpell(me, 32747, false); + } + } + + break; } } @@ -742,7 +899,7 @@ struct dummy_dragonAI : public ScriptedAI //Refresh respawnTime so time again are set to 30secs? } - void JustDied(Unit* /*pKiller*/) + void JustDied(Unit* pKiller) { int32 iTextId = 0; uint32 uiSpellId = 0; @@ -752,23 +909,39 @@ struct dummy_dragonAI : public ScriptedAI case NPC_TENEBRON: iTextId = SAY_TENEBRON_DEATH; uiSpellId = SPELL_POWER_OF_TENEBRON; + if(pInstance && pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + pInstance->SetData(TYPE_TENEBRON_PREKILLED, 1); break; case NPC_SHADRON: iTextId = SAY_SHADRON_DEATH; uiSpellId = SPELL_POWER_OF_SHADRON; + if(pInstance && pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + pInstance->SetData(TYPE_SHADRON_PREKILLED, 1); + if(Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f)) + { + pAcolyte->Kill(pAcolyte); + } break; case NPC_VESPERON: iTextId = SAY_VESPERON_DEATH; uiSpellId = SPELL_POWER_OF_VESPERON; + if(pInstance && pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + pInstance->SetData(TYPE_VESPERON_PREKILLED, 1); + if(Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f)) + { + pAcolyte->Kill(pAcolyte); + } break; } DoScriptText(iTextId, me); - me->RemoveOwnedAura(uiSpellId); + me->RemoveAurasDueToSpell(uiSpellId); if (pInstance) { + pInstance->DoRemoveAurasDueToSpellOnPlayers(uiSpellId); + // not if solo mini-boss fight if (pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) return; @@ -776,7 +949,10 @@ struct dummy_dragonAI : public ScriptedAI // Twilight Revenge to main boss if (Unit* pSartharion = Unit::GetUnit((*me), pInstance->GetData64(DATA_SARTHARION))) if (pSartharion->isAlive()) + { + pSartharion->RemoveAurasDueToSpell(uiSpellId); DoCast(pSartharion, SPELL_TWILIGHT_REVENGE, true); + } } } @@ -786,11 +962,11 @@ struct dummy_dragonAI : public ScriptedAI { if (m_uiMoveNextTimer <= uiDiff) { - if (m_uiWaypointId < MAX_WAYPOINT) + if(m_uiWaypointId < MAX_WAYPOINT) me->GetMotionMaster()->MovePoint(m_uiWaypointId, m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ); - debug_log("dummy_dragonAI: %s moving to point %u", me->GetName(), m_uiWaypointId); +// debug_log("dummy_dragonAI: %s moving to point %u", me->GetName(), m_uiWaypointId); m_uiMoveNextTimer = 0; } else @@ -811,25 +987,27 @@ struct mob_tenebronAI : public dummy_dragonAI uint32 m_uiShadowFissureTimer; uint32 m_uiHatchEggTimer; + bool m_bHasPortalOpen; + void Reset() { m_uiShadowBreathTimer = 20000; m_uiShadowFissureTimer = 5000; m_uiHatchEggTimer = 30000; + + m_bHasPortalOpen = false; } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* pWho) { DoScriptText(SAY_TENEBRON_AGGRO, me); DoZoneInCombat(); DoCast(me, SPELL_POWER_OF_TENEBRON); } - void KilledUnit(Unit* /*pVictim*/) + void KilledUnit(Unit* pVictim) { DoScriptText(RAND(SAY_TENEBRON_SLAY_1,SAY_TENEBRON_SLAY_2), me); - /*if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - achievProgress = 1;*/ } void UpdateAI(const uint32 uiDiff) @@ -852,7 +1030,7 @@ struct mob_tenebronAI : public dummy_dragonAI else m_uiShadowFissureTimer -= uiDiff; - // Hach Egg + // Hatch Egg if (m_uiHatchEggTimer <= uiDiff) { OpenPortal(); @@ -871,6 +1049,10 @@ struct mob_tenebronAI : public dummy_dragonAI else m_uiShadowBreathTimer -= uiDiff; + // Don't attack current target if he's not visible for us. + if(me->getVictim() && me->getVictim()->HasAura(57874, 0)) + me->getThreatManager().modifyThreatPercent(me->getVictim(), -100); + DoMeleeAttackIfReady(); } }; @@ -892,6 +1074,8 @@ struct mob_shadronAI : public dummy_dragonAI uint32 m_uiShadowFissureTimer; uint32 m_uiAcolyteShadronTimer; + bool m_bHasPortalOpen; + void Reset() { m_uiShadowBreathTimer = 20000; @@ -903,20 +1087,20 @@ struct mob_shadronAI : public dummy_dragonAI if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) me->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + + m_bHasPortalOpen = false; } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* pWho) { DoScriptText(SAY_SHADRON_AGGRO,me); DoZoneInCombat(); DoCast(me, SPELL_POWER_OF_SHADRON); } - void KilledUnit(Unit* /*pVictim*/) + void KilledUnit(Unit* pVictim) { DoScriptText(RAND(SAY_SHADRON_SLAY_1,SAY_SHADRON_SLAY_2), me); - /*if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - achievProgress = 2;*/ } void UpdateAI(const uint32 uiDiff) @@ -942,11 +1126,17 @@ struct mob_shadronAI : public dummy_dragonAI // Portal Event if (m_uiAcolyteShadronTimer <= uiDiff) { - if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) - return; + if(m_bHasPortalOpen) + m_uiAcolyteShadronTimer = 10000; + else + { + if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + return; - OpenPortal(); - m_uiAcolyteShadronTimer = urand(60000,65000); + OpenPortal(); + m_bHasPortalOpen = true; + m_uiAcolyteShadronTimer = urand(60000,65000); + } } else m_uiAcolyteShadronTimer -= uiDiff; @@ -961,6 +1151,10 @@ struct mob_shadronAI : public dummy_dragonAI else m_uiShadowBreathTimer -= uiDiff; + // Don't attack current target if he's not visible for us. + if(me->getVictim() && me->getVictim() && me->getVictim()->HasAura(57874, 0)) + me->getThreatManager().modifyThreatPercent(me->getVictim(), -100); + DoMeleeAttackIfReady(); } }; @@ -982,25 +1176,27 @@ struct mob_vesperonAI : public dummy_dragonAI uint32 m_uiShadowFissureTimer; uint32 m_uiAcolyteVesperonTimer; + bool m_bHasPortalOpen; + void Reset() { m_uiShadowBreathTimer = 20000; m_uiShadowFissureTimer = 5000; m_uiAcolyteVesperonTimer = 60000; + + m_bHasPortalOpen = false; } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* pWho) { DoScriptText(SAY_VESPERON_AGGRO,me); DoZoneInCombat(); DoCast(me, SPELL_POWER_OF_VESPERON); } - void KilledUnit(Unit* /*pVictim*/) + void KilledUnit(Unit* pVictim) { DoScriptText(RAND(SAY_VESPERON_SLAY_1,SAY_VESPERON_SLAY_2), me); - /*if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - achievProgress = 3;*/ } void UpdateAI(const uint32 uiDiff) @@ -1026,9 +1222,14 @@ struct mob_vesperonAI : public dummy_dragonAI // Portal Event if (m_uiAcolyteVesperonTimer <= uiDiff) { - OpenPortal(); - DoCast(me->getVictim(), SPELL_TWILIGHT_TORMENT_VESP); - m_uiAcolyteVesperonTimer = urand(60000,70000); + if(m_bHasPortalOpen) + m_uiAcolyteVesperonTimer = 10000; + else + { + OpenPortal(); + DoCast(me->getVictim(), SPELL_TWILIGHT_TORMENT_VESP); + m_uiAcolyteVesperonTimer = urand(60000,70000); + } } else m_uiAcolyteVesperonTimer -= uiDiff; @@ -1043,6 +1244,10 @@ struct mob_vesperonAI : public dummy_dragonAI else m_uiShadowBreathTimer -= uiDiff; + // Don't attack current target if he's not visible for us. + if(me->getVictim() && me->getVictim()->HasAura(57874, 0)) + me->getThreatManager().modifyThreatPercent(me->getVictim(), -100); + DoMeleeAttackIfReady(); } }; @@ -1061,43 +1266,49 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI mob_acolyte_of_shadronAI(Creature* pCreature) : ScriptedAI(pCreature) { pInstance = pCreature->GetInstanceData(); + Reset(); } ScriptedInstance* pInstance; - uint32 uiShiftEffectTimer; - + uint32 uiDespawnTimer; + void Reset() { - uiShiftEffectTimer = 1000; + uiDespawnTimer = 28000; if (pInstance) { - Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); - - Creature* pSartharion = Unit::GetCreature(*me, pInstance->GetData64(DATA_SARTHARION)); - if (Creature* pShadron = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON))) + Creature* pTarget = NULL; //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - pSartharion->CastSpell(me, SPELL_GIFT_OF_TWILIGTH_SAR, true); + { + if(pTarget = ((Creature*)Unit::GetUnit((*me), pInstance->GetData64(DATA_SARTHARION)))) + pTarget->AddAura(SPELL_GIFT_OF_TWILIGTH_SAR, pTarget); + } else { - pShadron->CastSpell(me, SPELL_GIFT_OF_TWILIGTH_SHA,true); - pShadron->AddThreat(pTarget, 100.0f); - AttackStart(pShadron->getVictim()); + if(pTarget = ((Creature*)Unit::GetUnit((*me), pInstance->GetData64(DATA_SHADRON)))) + pTarget->AddAura(SPELL_GIFT_OF_TWILIGTH_SHA, pTarget); } - } - me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me); + } + me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me); } - void JustDied(Unit* /*killer*/) + void JustDied(Unit* killer) { if (pInstance) { - //Creature* pDebuffTarget = NULL; + Creature* Shadron = pInstance->instance->GetCreature(pInstance->GetData64(DATA_SHADRON)); + if(Shadron) + { + ((mob_shadronAI*)Shadron->AI())->m_bHasPortalOpen = false; + } + + Creature* pDebuffTarget = NULL; Map *map = me->GetMap(); if (map->IsDungeon()) { Map::PlayerList const &PlayerList = map->GetPlayers(); - + if (PlayerList.isEmpty()) return; @@ -1110,28 +1321,31 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI i->getSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT); i->getSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER); } - } + } } - if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - { - //not solo fight, so main boss has deduff - Creature* pDebuffTarget = Unit::GetCreature(*me, pInstance->GetData64(DATA_SARTHARION)); - if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) - pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); - } - else - { - //event not in progress, then solo fight and must remove debuff mini-boss - Creature* pDebuffTarget = Unit::GetCreature(*me, pInstance->GetData64(DATA_SHADRON)); - if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) - pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); - } + //not solo fight, so main boss has deduff + pDebuffTarget = pInstance->instance->GetCreature(pInstance->GetData64(DATA_SARTHARION)); + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); + + //event not in progress, then solo fight and must remove debuff mini-boss + pDebuffTarget = pInstance->instance->GetCreature(pInstance->GetData64(DATA_SHADRON)); + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); } } - void UpdateAI(const uint32 /*uiDiff*/) + void UpdateAI(const uint32 uiDiff) { + if(uiDespawnTimer < uiDiff) + { + me->SetVisibility(VISIBILITY_OFF); + me->Kill(me); + uiDespawnTimer = 28000; + return; + }else uiDespawnTimer -= uiDiff; + if (!UpdateVictim()) return; @@ -1156,26 +1370,32 @@ struct mob_acolyte_of_vesperonAI : public ScriptedAI } ScriptedInstance* pInstance; + uint32 uiDespawnTimer; void Reset() { + uiDespawnTimer = 28000; if (pInstance) { - me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me); + me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me); } DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO); } - void JustDied(Unit* /*pKiller*/) + void JustDied(Unit* pKiller) { + me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO); + // remove twilight torment on Vesperon if (pInstance) { - Creature* pVesperon = Unit::GetCreature(*me, pInstance->GetData64(DATA_VESPERON)); + Creature* pVesperon = pInstance->instance->GetCreature(pInstance->GetData64(DATA_VESPERON)); + if (pVesperon) + ((mob_vesperonAI*)pVesperon->AI())->m_bHasPortalOpen = false; if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); - + Map *map = me->GetMap(); if (map->IsDungeon()) { @@ -1194,15 +1414,26 @@ struct mob_acolyte_of_vesperonAI : public ScriptedAI i->getSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER); } if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_TWILIGHT_TORMENT_VESP,0) && !i->getSource()->getVictim()) - i->getSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT); + i->getSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); } } + pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_TORMENT_VESP_ACO); + pInstance->DoRemoveAurasDueToSpellOnPlayers(57935); + pInstance->DoRemoveAurasDueToSpellOnPlayers(58835); // Components of spell Twilight Torment } } - void UpdateAI(const uint32 /*uiDiff*/) + void UpdateAI(const uint32 uiDiff) { + if(uiDespawnTimer < uiDiff) + { + me->SetVisibility(VISIBILITY_OFF); + me->Kill(me); + uiDespawnTimer = 28000; + return; + }else uiDespawnTimer -= uiDiff; + if (!UpdateVictim()) return; @@ -1222,9 +1453,10 @@ CreatureAI* GetAI_mob_acolyte_of_vesperon(Creature* pCreature) struct mob_twilight_eggsAI : public Scripted_NoMovementAI { mob_twilight_eggsAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) - { + { pInstance = pCreature->GetInstanceData(); } + uint32 m_uiFadeArmorTimer; uint32 m_uiHatchEggTimer; @@ -1232,28 +1464,46 @@ struct mob_twilight_eggsAI : public Scripted_NoMovementAI void Reset() { - m_uiHatchEggTimer = 20000; + if(pInstance) + { + me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me); + } m_uiFadeArmorTimer = 1000; + m_uiHatchEggTimer = 20000; } + void SpawnWhelps() { + me->RemoveAllAuras(); + if (!pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) me->SummonCreature(NPC_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - else + else me->SummonCreature(NPC_SHARTHARION_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); me->DealDamage(me, me->GetHealth()); } + + void JustSummoned(Creature* pWho) + { + pWho->SetInCombatWithZone(); + } + void UpdateAI(const uint32 uiDiff) { if (m_uiHatchEggTimer <= uiDiff) { + Creature* Tenebron = pInstance->instance->GetCreature(pInstance->GetData64(DATA_TENEBRON)); + if(Tenebron) + ((mob_tenebronAI*)Tenebron->AI())->m_bHasPortalOpen = false; SpawnWhelps(); } else - m_uiHatchEggTimer -= uiDiff; + m_uiHatchEggTimer -= uiDiff; } - void AttackStart(Unit* /*pWho*/) {} - void MoveInLineOfSight(Unit* /*pWho*/) {} + + + void AttackStart(Unit* pWho) {} + void MoveInLineOfSight(Unit* pWho) {} }; CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) @@ -1262,33 +1512,46 @@ CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) } /*###### -## Flame Tzunami +## Mob Flame Tsunami ######*/ struct npc_flame_tsunamiAI : public ScriptedAI { npc_flame_tsunamiAI(Creature* pCreature) : ScriptedAI(pCreature) { - me->HasAura(SPELL_FLAME_TSUNAMI_DMG_AURA); - DoCast(me, SPELL_FLAME_TSUNAMI); + me->SetDisplayId(11686); + me->AddAura(SPELL_FLAME_TSUNAMI, me); } uint32 Tsunami_Timer; + uint32 TsunamiBuff_timer; + uint32 entry; void Reset() { Tsunami_Timer = 100; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + TsunamiBuff_timer = 1000; + entry = 0; } - + void UpdateAI(const uint32 diff) { if (Tsunami_Timer <= diff) { - DoCast(me, SPELL_FLAME_TSUNAMI_DMG_AURA); - Tsunami_Timer = 1000; - } else Tsunami_Timer -= diff; + DoCast(me,SPELL_FLAME_TSUNAMI_DMG_AURA); + Tsunami_Timer = 500; + }else Tsunami_Timer -= diff; + + if(TsunamiBuff_timer <= diff) + { + if (Unit* LavaBlaze = GetClosestCreatureWithEntry(me,NPC_LAVA_BLAZE, 10.0f, true)) + LavaBlaze->CastSpell(LavaBlaze, SPELL_FLAME_TSUNAMI_BUFF, true); + TsunamiBuff_timer = 1000; + }else TsunamiBuff_timer -= diff; } }; + // Twilight Fissure struct npc_twilight_fissureAI : public Scripted_NoMovementAI { @@ -1301,6 +1564,10 @@ struct npc_twilight_fissureAI : public Scripted_NoMovementAI void Reset() { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AddAura( 46265 , me ); // Wrong, can't find proper visual + me->AddAura( 69422 , me ); VoidBlast_Timer = 5000; } @@ -1308,8 +1575,12 @@ struct npc_twilight_fissureAI : public Scripted_NoMovementAI { if (VoidBlast_Timer <= diff) { - DoCast(me->getVictim(), RAID_MODE(SPELL_VOID_BLAST, SPELL_VOID_BLAST_H)); + DoCastAOE(RAID_MODE(SPELL_VOID_BLAST, SPELL_VOID_BLAST_H)); + ////twilight realm + //DoCast(me->getVictim(), 57620, true); + //DoCast(me->getVictim(), 57874, true); VoidBlast_Timer = 9000; + me->RemoveAllAuras(); me->Kill(me); } else VoidBlast_Timer -= diff; } @@ -1332,12 +1603,17 @@ CreatureAI* GetAI_npc_twilight_fissure(Creature* pCreature) struct mob_twilight_whelpAI : public ScriptedAI { - mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) {} + mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } uint32 m_uiFadeArmorTimer; void Reset() { + me->RemoveAllAuras(); + me->SetInCombatWithZone(); m_uiFadeArmorTimer = 1000; } diff --git a/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp b/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp index 7ef8e03c779..4cb38db3a28 100644 --- a/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp +++ b/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "obsidian_sanctum.h" #define MAX_ENCOUNTER 1 @@ -17,6 +34,10 @@ struct instance_obsidian_sanctum : public ScriptedInstance uint64 m_uiShadronGUID; uint64 m_uiVesperonGUID; + bool m_bTenebronKilled; + bool m_bShadronKilled; + bool m_bVesperonKilled; + void Initialize() { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); @@ -25,6 +46,10 @@ struct instance_obsidian_sanctum : public ScriptedInstance m_uiTenebronGUID = 0; m_uiShadronGUID = 0; m_uiVesperonGUID = 0; + + m_bTenebronKilled = false; + m_bShadronKilled = false; + m_bVesperonKilled = false; } void OnCreatureCreate(Creature* pCreature, bool /*add*/) @@ -55,12 +80,24 @@ struct instance_obsidian_sanctum : public ScriptedInstance { if (uiType == TYPE_SARTHARION_EVENT) m_auiEncounter[0] = uiData; + else if(uiType == TYPE_TENEBRON_PREKILLED) + m_bTenebronKilled = true; + else if(uiType == TYPE_SHADRON_PREKILLED) + m_bShadronKilled = true; + else if(uiType == TYPE_VESPERON_PREKILLED) + m_bVesperonKilled = true; } uint32 GetData(uint32 uiType) { if (uiType == TYPE_SARTHARION_EVENT) return m_auiEncounter[0]; + else if(uiType == TYPE_TENEBRON_PREKILLED) + return m_bTenebronKilled; + else if(uiType == TYPE_SHADRON_PREKILLED) + return m_bShadronKilled; + else if(uiType == TYPE_VESPERON_PREKILLED) + return m_bVesperonKilled; return 0; } diff --git a/src/server/scripts/Northrend/ObsidianSanctum/obsidian_sanctum.h b/src/server/scripts/Northrend/ObsidianSanctum/obsidian_sanctum.h index 59013174795..43825d04f47 100644 --- a/src/server/scripts/Northrend/ObsidianSanctum/obsidian_sanctum.h +++ b/src/server/scripts/Northrend/ObsidianSanctum/obsidian_sanctum.h @@ -1,9 +1,29 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_OBSIDIAN_SANCTUM_H #define DEF_OBSIDIAN_SANCTUM_H enum eTypes { TYPE_SARTHARION_EVENT = 1, + TYPE_TENEBRON_PREKILLED = 2, + TYPE_SHADRON_PREKILLED = 3, + TYPE_VESPERON_PREKILLED = 4, DATA_SARTHARION = 10, DATA_TENEBRON = 11, diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index c2da2a24e71..aa0be07d7bd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieuten SDCategory: Halls of Lightning EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_lightning.h" enum eEnums diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index ecf61188b3e..88c240b49bd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -1,25 +1,26 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* * Comment: Timer check pending */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_lightning.h" enum Spells @@ -93,10 +94,10 @@ struct boss_ionarAI : public ScriptedAI bIsSplitPhase = true; bHasDispersed = false; - uiSplitTimer = 25*IN_MILISECONDS; + uiSplitTimer = 25*IN_MILLISECONDS; - uiStaticOverloadTimer = urand(5*IN_MILISECONDS, 6*IN_MILISECONDS); - uiBallLightningTimer = urand(10*IN_MILISECONDS, 11*IN_MILISECONDS); + uiStaticOverloadTimer = urand(5*IN_MILLISECONDS, 6*IN_MILLISECONDS); + uiBallLightningTimer = urand(10*IN_MILLISECONDS, 11*IN_MILLISECONDS); uiDisperseHealth = 45 + urand(0,10); @@ -199,7 +200,7 @@ struct boss_ionarAI : public ScriptedAI { if (uiSplitTimer <= uiDiff) { - uiSplitTimer = 2.5*IN_MILISECONDS; + uiSplitTimer = 2.5*IN_MILLISECONDS; // Return sparks to where Ionar splitted if (bIsSplitPhase) @@ -215,7 +216,7 @@ struct boss_ionarAI : public ScriptedAI DoCast(me, SPELL_SPARK_DESPAWN, false); - uiSplitTimer = 25*IN_MILISECONDS; + uiSplitTimer = 25*IN_MILLISECONDS; bIsSplitPhase = true; if (me->getVictim()) @@ -233,7 +234,7 @@ struct boss_ionarAI : public ScriptedAI if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_STATIC_OVERLOAD); - uiStaticOverloadTimer = urand(5*IN_MILISECONDS, 6*IN_MILISECONDS); + uiStaticOverloadTimer = urand(5*IN_MILLISECONDS, 6*IN_MILLISECONDS); } else uiStaticOverloadTimer -= uiDiff; @@ -241,7 +242,7 @@ struct boss_ionarAI : public ScriptedAI if (uiBallLightningTimer <= uiDiff) { DoCast(me->getVictim(), SPELL_BALL_LIGHTNING); - uiBallLightningTimer = urand(10*IN_MILISECONDS, 11*IN_MILISECONDS); + uiBallLightningTimer = urand(10*IN_MILLISECONDS, 11*IN_MILLISECONDS); } else uiBallLightningTimer -= uiDiff; @@ -309,7 +310,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI void Reset() { - uiCheckTimer = 2*IN_MILISECONDS; + uiCheckTimer = 2*IN_MILLISECONDS; me->SetReactState(REACT_PASSIVE); } @@ -357,7 +358,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI else me->ForcedDespawn(); } - uiCheckTimer = 2*IN_MILISECONDS; + uiCheckTimer = 2*IN_MILLISECONDS; } else uiCheckTimer -= uiDiff; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index f08c19efca2..e0a55a79ccd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. A SDCategory: Halls of Lightning EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_lightning.h" enum eEnums diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 184050e3103..cb5878defb3 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Not considered complete. Some events may fail and need further develo SDCategory: Halls of Lightning EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_lightning.h" enum eEnums diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h index d9739fdf888..2c270d5796e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_HALLS_OF_LIGHTNING_H #define DEF_HALLS_OF_LIGHTNING_H diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp index 46cd5c9cccc..8dbcf8da23f 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: All ready. SDCategory: Halls of Lightning EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_lightning.h" /* Halls of Lightning encounters: diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 0674b7c79eb..63b1de56c38 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss krystallus SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_krystallus' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_stone.h" enum Spells @@ -20,6 +37,9 @@ enum Spells SPELL_GROUND_SLAM = 50827, SPELL_SHATTER = 50810, H_SPELL_SHATTER = 61546, + SPELL_SHATTER_EFFECT = 50811, + H_SPELL_SHATTER_EFFECT = 61547, + SPELL_STONED = 50812, SPELL_STOMP = 48131, H_SPELL_STOMP = 59744 }; @@ -108,8 +128,7 @@ struct boss_krystallusAI : public ScriptedAI { if (uiShatterTimer <= diff) { - DoCast(me, SPELL_SHATTER); - bIsSlam = false; + DoCast(me, DUNGEON_MODE(SPELL_SHATTER, H_SPELL_SHATTER)); } else uiShatterTimer -= diff; } @@ -130,6 +149,32 @@ struct boss_krystallusAI : public ScriptedAI return; DoScriptText(SAY_KILL, me); } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + //this part should be in the core + if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER) + { + //this spell must have custom handling in the core, dealing damage based on distance + pTarget->CastSpell(pTarget, DUNGEON_MODE(SPELL_SHATTER_EFFECT, H_SPELL_SHATTER_EFFECT), true); + + if (pTarget->HasAura(SPELL_STONED)) + pTarget->RemoveAurasDueToSpell(SPELL_STONED); + + //clear this, if we are still performing + if (bIsSlam) + { + bIsSlam = false; + + //and correct movement, if not already + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (me->getVictim()) + me->GetMotionMaster()->MoveChase(me->getVictim()); + } + } + } + } }; CreatureAI* GetAI_boss_krystallus(Creature* pCreature) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index b3c3c675347..e7fde3dcea7 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss maiden_of_grief SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_stone.h" enum Spells diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 68c3e34e6bf..1cab83db949 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss sjonnir SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_sjonnir' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "halls_of_stone.h" enum Spells diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index 8febdaab879..d7e7f495cfb 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "halls_of_stone.h" diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h index b61e7057ddc..06a405390d2 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_HALLS_OF_STONE_H #define DEF_HALLS_OF_STONE_H enum Data diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp index 69bb3779e70..e4bbcdd9690 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "halls_of_stone.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp index e944543fb9e..5019bb29d21 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" #define GAMEOBJECT_GIVE_OF_THE_OBSERVER 194821 diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_assembly_of_iron.cpp index 8d3ae4d3431..98fac4f80d2 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_assembly_of_iron.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: Runes need DB support, chain lightning won't cast, supercharge won't SDCategory: Ulduar - Ulduar EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" // Any boss diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp index 41c0f317f4e..da3d671eb6d 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" //boss_auriaya diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp index b50f12805a4..0d462097213 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp @@ -1,29 +1,29 @@ /* - * Copyright (C) 2008 - 2010 TrinityCore + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* - * Comment: Tower Event support is not finished, there is missing code on triggers and - * Lore Keeper and Brann Bronzebeard are not scripted yet. Lore Keeper's script - * should activate the hard mode so is not possible to play hard-mode yet. Add a call to - * Leviathan's DoAction(0) from Lore Keeper's script to activate hard-mode + * Comment: there is missing code on triggers, + * brann bronzebeard needs correct gossip info. + * requires more work involving area triggers. + * if reached brann speaks through his radio.. */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" +#include "ScriptedEscortAI.h" #include "ulduar.h" #include "Vehicle.h" @@ -36,19 +36,32 @@ enum Spells SPELL_MISSILE_BARRAGE = 62400, SPELL_SYSTEMS_SHUTDOWN = 62475, - SPELL_FLAME_CANNON = 62395, -// SPELL_FLAME_CANNON = 64692, trigger the same spell - SPELL_OVERLOAD_CIRCUIT = 62399, + SPELL_START_THE_ENGINE = 62472, SPELL_SEARING_FLAME = 62402, SPELL_BLAZE = 62292, SPELL_SMOKE_TRAIL = 63575, SPELL_ELECTROSHOCK = 62522, - //TOWER BUFF SPELLS - SPELL_THORIM_S_HAMMER = 62912, // Tower of Storms - SPELL_MIMIRON_S_INFERNO = 62910, // Tower of Flames - SPELL_HODIR_S_FURY = 62297, // Tower of Frost - SPELL_FREYA_S_WARD = 62906 // Tower of Nature + //TOWER Additional SPELLS + SPELL_THORIM_S_HAMMER = 62911, // Tower of Storms + SPELL_MIMIRON_S_INFERNO = 62909, // Tower of Flames + SPELL_HODIR_S_FURY = 62533, // Tower of Frost + SPELL_FREYA_S_WARD = 62906, // Tower of Nature + SPELL_FREYA_SUMMONS = 62947, // Tower of Nature + //TOWER ap & health spells + SPELL_BUFF_TOWER_OF_STORMS = 65076, + SPELL_BUFF_TOWER_OF_FLAMES = 65075, + SPELL_BUFF_TOWER_OF_FR0ST = 65077, + SPELL_BUFF_TOWER_OF_LIFE = 64482, + //Additional Spells + SPELL_LASH = 65062, + SPELL_FREYA_S_WARD_EFFECT_1 = 62947, + SPELL_FREYA_S_WARD_EFFECT_2 = 62907, + SPELL_AUTO_REPAIR = 62705, + AURA_DUMMY_BLUE = 63294, + AURA_DUMMY_GREEN = 63295, + AURA_DUMMY_YELLOW = 63292, + SPELL_LIQUID_PYRITE = 62494, }; enum Creatures @@ -56,6 +69,25 @@ enum Creatures MOB_MECHANOLIFT = 33214, MOB_LIQUID = 33189, MOB_CONTAINER = 33218, + MOB_THORIM_BEACON = 33365, + MOB_MIMIRON_BEACON = 33370, + MOB_HODIR_BEACON = 33212, + MOB_FREYA_BEACON = 33367, + NPC_THORIM_TARGET_BEACON = 33364, + NPC_MIMIRON_TARGET_BEACON = 33369, + NPC_HODIR_TARGET_BEACON = 33108, + NPC_FREYA_TARGET_BEACON = 33366, + NPC_LOREKEEPER = 33686, //Hard mode starter + NPC_BRANZ_BRONZBEARD = 33579, + NPC_DELORAH = 33701, +}; + +enum Towers +{ + GO_TOWER_OF_STORMS = 194377, + GO_TOWER_OF_FLAMES = 194371, + GO_TOWER_OF_FROST = 194370, + GO_TOWER_OF_LIFE = 194375, }; enum Events @@ -66,10 +98,11 @@ enum Events EVENT_VENT, EVENT_SPEED, EVENT_SUMMON, + EVENT_SHUTDOWN, EVENT_THORIM_S_HAMMER, // Tower of Storms EVENT_MIMIRON_S_INFERNO, // Tower of Flames EVENT_HODIR_S_FURY, // Tower of Frost - EVENT_FREYA_S_WARD // Tower of Nature + EVENT_FREYA_S_WARD, // Tower of Nature }; enum Seats @@ -79,6 +112,17 @@ enum Seats SEAT_DEVICE = 2, }; +enum Vehicles +{ + VEHICLE_SIEGE = 33060, + VEHICLE_CHOPPER = 33062, + VEHICLE_DEMOLISHER = 33109, +}; + +#define EMOTE_PURSUE "Flame Leviathan pursues $N." +#define EMOTE_OVERLOAD "Flame Leviathan's circuits overloaded." +#define EMOTE_REPAIR "Automatic repair sequence initiated." + enum Yells { SAY_AGGRO = -1603060, @@ -101,24 +145,24 @@ enum Yells enum eAchievementData { - //ACHIEV_CHAMPION_OF_ULDUAR = 10042, - //ACHIEV_CONQUEROR_OF_ULDUAR = 10352, - ACHIEV_10_NUKED_FROM_ORBIT = 10058, - ACHIEV_25_NUKED_FROM_ORBIT = 10060, - ACHIEV_10_ORBITAL_BOMBARDMENT = 10056, - ACHIEV_25_ORBITAL_BOMBARDMENT = 10061, - ACHIEV_10_ORBITAL_DEVASTATION = 10057, - ACHIEV_25_ORBITAL_DEVASTATION = 10059, - ACHIEV_10_ORBIT_UARY = 10218, - ACHIEV_25_ORBIT_UARY = 10219, - ACHIEV_10_SHUTOUT = 10054, - ACHIEV_25_SHUTOUT = 10055, - ACHIEV_10_SIEGE_OF_ULDUAR = 9999, - ACHIEV_25_SIEGE_OF_ULDUAR = 10003, - //ACHIEV_10_THREE_CAR_GARAGE = 10046, 10047, 10048, - //ACHIEV_25_THREE_CAR_GARAGE = 10049, 10050, 10051, - ACHIEV_10_UNBROKEN = 10044, - ACHIEV_25_UNBROKEN = 10045, + //ACHIEV_CHAMPION_OF_ULDUAR = 2903, + //ACHIEV_CONQUEROR_OF_ULDUAR = 2904, + ACHIEV_10_NUKED_FROM_ORBIT = 2915, + ACHIEV_25_NUKED_FROM_ORBIT = 2917, + ACHIEV_10_ORBITAL_BOMBARDMENT = 2913, + ACHIEV_25_ORBITAL_BOMBARDMENT = 2918, + ACHIEV_10_ORBITAL_DEVASTATION = 2914, + ACHIEV_25_ORBITAL_DEVASTATION = 2916, + ACHIEV_10_ORBIT_UARY = 3056, + ACHIEV_25_ORBIT_UARY = 3057, + ACHIEV_10_SHUTOUT = 2911, + ACHIEV_25_SHUTOUT = 2912, + ACHIEV_10_SIEGE_OF_ULDUAR = 2886, + ACHIEV_25_SIEGE_OF_ULDUAR = 2887, + ACHIEV_10_THREE_CAR_GARAGE = 2907, //no core support for using a vehicle + ACHIEV_25_THREE_CAR_GARAGE = 2908, //no core support for using a vehicle + ACHIEV_10_UNBROKEN = 2905, + ACHIEV_25_UNBROKEN = 2906, }; static Position Center[]= @@ -126,38 +170,119 @@ static Position Center[]= {354.8771, -12.90240, 409.803650}, }; +const Position PosSiege[5] = +{ + {-814.59,-64.54,429.92,5.969}, + {-784.37,-33.31,429.92,5.096}, + {-808.99,-52.10,429.92,5.668}, + {-798.59,-44.00,429.92,5.663}, + {-812.83,-77.71,429.92,0.046}, +}; + +const Position PosChopper[5] = +{ + {-717.83,-106.56,430.02,0.122}, + {-717.83,-114.23,430.44,0.122}, + {-717.83,-109.70,430.22,0.122}, + {-718.45,-118.24,430.26,0.052}, + {-718.45,-123.58,430.41,0.085}, +}; + +const Position PosDemolisher[5] = +{ + {-724.12,-176.64,430.03,2.543}, + {-766.70,-225.03,430.50,1.710}, + {-729.54,-186.26,430.12,1.902}, + {-756.01,-219.23,430.50,2.369}, + {-798.01,-227.24,429.84,1.446}, +}; + struct boss_flame_leviathanAI : public BossAI { boss_flame_leviathanAI(Creature* pCreature) : BossAI(pCreature, TYPE_LEVIATHAN), vehicle(pCreature->GetVehicleKit()) { assert(vehicle); + pInstance = me->GetInstanceData(); + uiActiveTowers = 4; + ActiveTowers = false; + towerOfStorms = false; + towerOfLife = false; + towerOfFlames = false; + towerOfFrost = false; + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); //deathgrip - pInstance = pCreature->GetInstanceData(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + me->SetReactState(REACT_PASSIVE); } ScriptedInstance* pInstance; Vehicle* vehicle; uint8 uiActiveTowers; + bool ActiveTowers; + bool towerOfStorms; + bool towerOfLife; + bool towerOfFlames; + bool towerOfFrost; void Reset() { _Reset(); + /*me->SetLootMode(LOOT_MODE_HARD_MODE_4); + me->SetLootMode(LOOT_MODE_HARD_MODE_3); + me->SetLootMode(LOOT_MODE_HARD_MODE_2); + me->SetLootMode(LOOT_MODE_HARD_MODE_1);*/ + if (pInstance) + pInstance->SetData(TYPE_LEVIATHAN, NOT_STARTED); assert(vehicle); - uiActiveTowers = 0; - me->SetReactState(REACT_AGGRESSIVE); + me->GetVehicleKit(); + me->SetReactState(REACT_DEFENSIVE); } void EnterCombat(Unit* /*who*/) { _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - me->SetReactState(REACT_DEFENSIVE); + pInstance->SetData(TYPE_LEVIATHAN, IN_PROGRESS); //_Reset doesnt do this correctly + me->SetReactState(REACT_AGGRESSIVE); events.ScheduleEvent(EVENT_PURSUE, 0); events.ScheduleEvent(EVENT_MISSILE, 1500); events.ScheduleEvent(EVENT_VENT, 20000); events.ScheduleEvent(EVENT_SPEED, 15000); events.ScheduleEvent(EVENT_SUMMON, 0); + if (ActiveTowers) + { + if (towerOfStorms) + { + me->AddAura(SPELL_BUFF_TOWER_OF_STORMS, me); + events.ScheduleEvent(EVENT_THORIM_S_HAMMER, 35000); + } + + if (towerOfFlames) + { + me->AddAura(SPELL_BUFF_TOWER_OF_FLAMES, me); + events.ScheduleEvent(EVENT_MIMIRON_S_INFERNO,70000); + } + + if (towerOfFrost) + { + me->AddAura(SPELL_BUFF_TOWER_OF_FR0ST, me); + events.ScheduleEvent(EVENT_HODIR_S_FURY, 105000); + } + + if (towerOfLife) + { + me->AddAura(SPELL_BUFF_TOWER_OF_LIFE, me); + events.ScheduleEvent(EVENT_FREYA_S_WARD, 140000); + } + + if (!towerOfLife && !towerOfFrost && !towerOfFlames && !towerOfStorms) + DoScriptText(SAY_TOWER_NONE, me); + else + DoScriptText(SAY_HARDMODE, me); + } + else + DoScriptText(SAY_AGGRO, me); if (Creature *turret = CAST_CRE(vehicle->GetPassenger(SEAT_TURRET))) turret->AI()->DoZoneInCombat(); @@ -170,39 +295,40 @@ struct boss_flame_leviathanAI : public BossAI AttackStart(pTarget); } + void JustDied(Unit* /*victim*/) { _JustDied(); + pInstance->SetData(TYPE_LEVIATHAN, DONE); //_Reset doesnt do this correctly DoScriptText(SAY_DEATH, me); - if (pInstance) + + if (ActiveTowers) { - if (uiActiveTowers) + switch (uiActiveTowers) { - switch (uiActiveTowers) - { - case 4: - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_ORBIT_UARY, ACHIEV_25_ORBIT_UARY)); - break; - case 3: - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_NUKED_FROM_ORBIT, ACHIEV_25_NUKED_FROM_ORBIT)); - break; - case 2: - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_ORBITAL_DEVASTATION, ACHIEV_25_ORBITAL_DEVASTATION)); - break; - case 1: - pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_ORBITAL_BOMBARDMENT, ACHIEV_25_ORBITAL_BOMBARDMENT)); - break; - } + case 4: + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_ORBIT_UARY, ACHIEV_25_ORBIT_UARY)); + break; + case 3: + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_NUKED_FROM_ORBIT, ACHIEV_25_NUKED_FROM_ORBIT)); + break; + case 2: + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_ORBITAL_DEVASTATION, ACHIEV_25_ORBITAL_DEVASTATION)); + break; + case 1: + pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_10_ORBITAL_BOMBARDMENT, ACHIEV_25_ORBITAL_BOMBARDMENT)); + break; } } } void SpellHit(Unit* /*caster*/, const SpellEntry* pSpell) { - if (pSpell->Id == 62472) + if (pSpell->Id == SPELL_START_THE_ENGINE) vehicle->InstallAllAccessories(); - else if (pSpell->Id == SPELL_ELECTROSHOCK) - me->InterruptSpell(CURRENT_CHANNELED_SPELL); + else + if (pSpell->Id == SPELL_ELECTROSHOCK) + me->InterruptSpell(CURRENT_CHANNELED_SPELL); } void UpdateAI(const uint32 diff) @@ -221,60 +347,104 @@ struct boss_flame_leviathanAI : public BossAI if (me->hasUnitState(UNIT_STAT_CASTING)) return; + if (me->HasAura(SPELL_SYSTEMS_SHUTDOWN)) + { + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + return; + } + else + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + } + uint32 eventId = events.GetEvent(); if (!me->getVictim()) eventId = EVENT_PURSUE; switch(eventId) { - case 0: break; // this is a must - case EVENT_PURSUE: - DoCastAOE(SPELL_PURSUED, true); - //events.RepeatEvent(35000); // this should not be used because eventId may be overriden - events.RescheduleEvent(EVENT_PURSUE, 35000); - if (!me->getVictim()) // all siege engines and demolishers are dead - UpdateVictim(); // begin to kill other things - return; - case EVENT_MISSILE: - if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(pTarget, SPELL_MISSILE_BARRAGE); - events.RepeatEvent(1500); - return; - case EVENT_VENT: - DoCastAOE(SPELL_FLAME_VENTS); - events.RepeatEvent(20000); - return; - case EVENT_SPEED: - DoCastAOE(SPELL_GATHERING_SPEED); - events.RepeatEvent(15000); - return; - case EVENT_SUMMON: - if (summons.size() < 15) // 4seat+1turret+10lift - if (Creature* pLift = DoSummonFlyer(MOB_MECHANOLIFT, me, urand(20,40), 50, 0)) - pLift->GetMotionMaster()->MoveRandom(100); - events.RepeatEvent(2000); - return; - case EVENT_THORIM_S_HAMMER: // Tower of Storms - DoCast(me, SPELL_THORIM_S_HAMMER); - events.RepeatEvent(urand(60000, 120000)); - return; - case EVENT_MIMIRON_S_INFERNO: // Tower of Flames - DoCast(me->getVictim(), SPELL_MIMIRON_S_INFERNO); - events.RepeatEvent(urand(60000, 120000)); - return; - case EVENT_HODIR_S_FURY: // Tower of Frost - DoCast(me->getVictim(), SPELL_HODIR_S_FURY); - events.RepeatEvent(urand(60000, 120000)); - return; - case EVENT_FREYA_S_WARD: // Tower of Nature - DoCast(me, SPELL_FREYA_S_WARD); - events.RepeatEvent(urand(60000, 120000)); - return; - default: - events.PopEvent(); - break; + case 0: break; // this is a must + case EVENT_PURSUE: + DoCastAOE(SPELL_PURSUED, true); + DoScriptText(RAND(SAY_TARGET_1, SAY_TARGET_2, SAY_TARGET_3), me); + events.RescheduleEvent(EVENT_PURSUE, 30000); + UpdateVictim(); // begin to kill other things + if (me->getVictim()) + me->MonsterTextEmote(EMOTE_PURSUE, me->getVictim()->GetGUID(), true); + return; + case EVENT_MISSILE: + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(pTarget, SPELL_MISSILE_BARRAGE); + events.RepeatEvent(1500); + return; + case EVENT_VENT: + DoCastAOE(SPELL_FLAME_VENTS); + events.RepeatEvent(20000); + return; + case EVENT_SPEED: + DoCastAOE(SPELL_GATHERING_SPEED); + events.RepeatEvent(15000); + return; + case EVENT_SUMMON: + if (summons.size() < 15) // 4seat+1turret+10lift + if (Creature* pLift = DoSummonFlyer(MOB_MECHANOLIFT, me, urand(20,40), 50, 0)) + pLift->GetMotionMaster()->MoveRandom(100); + events.RepeatEvent(2000); + return; + case EVENT_SHUTDOWN: + DoScriptText(RAND(SAY_OVERLOAD_1, SAY_OVERLOAD_2, SAY_OVERLOAD_3), me); + me->MonsterTextEmote(EMOTE_OVERLOAD, 0, true); + DoCast(SPELL_SYSTEMS_SHUTDOWN); + me->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED); + me->MonsterTextEmote(EMOTE_REPAIR, 0, true); + events.CancelEvent(EVENT_SHUTDOWN); + return; + case EVENT_THORIM_S_HAMMER: // Tower of Storms + for (uint8 i = 0; i < 7; ++i) + { + if (Creature* pThorim = DoSummon(MOB_THORIM_BEACON, me, urand(20,60), 20000, TEMPSUMMON_TIMED_DESPAWN)) + pThorim->GetMotionMaster()->MoveRandom(100); + } + DoScriptText(SAY_TOWER_STORM, me); + events.CancelEvent(EVENT_THORIM_S_HAMMER); + return; + case EVENT_MIMIRON_S_INFERNO: // Tower of Flames + me->SummonCreature(MOB_MIMIRON_BEACON, 390.93, -13.91, 409.81); + DoScriptText(SAY_TOWER_FLAME, me); + events.CancelEvent(EVENT_MIMIRON_S_INFERNO); + return; + case EVENT_HODIR_S_FURY: // Tower of Frost + for (uint8 i = 0; i < 7; ++i) + { + if (Creature* pHodir = DoSummon(MOB_HODIR_BEACON, me, 50, 0)) + pHodir->GetMotionMaster()->MoveRandom(100); + } + DoScriptText(SAY_TOWER_FROST, me); + events.CancelEvent(EVENT_HODIR_S_FURY); + return; + case EVENT_FREYA_S_WARD: // Tower of Nature + DoScriptText(SAY_TOWER_NATURE, me); + StartFreyaEvent(); + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(pTarget, SPELL_FREYA_S_WARD); + events.CancelEvent(EVENT_FREYA_S_WARD); + return; + default: + events.PopEvent(); + break; } - DoSpellAttackIfReady(SPELL_BATTERING_RAM); + if (me->IsWithinMeleeRange(me->getVictim())) + DoSpellAttackIfReady(SPELL_BATTERING_RAM); + } + + void StartFreyaEvent()//summon these 4 on each corner wich wil spawn additional hostile mobs + { + me->SummonCreature(MOB_FREYA_BEACON, 377.02, -119.10, 409.81); + me->SummonCreature(MOB_FREYA_BEACON, 377.02, 54.78, 409.81); + me->SummonCreature(MOB_FREYA_BEACON, 185.62, 54.78, 409.81); + me->SummonCreature(MOB_FREYA_BEACON, 185.62, -119.10, 409.81); } void DoAction(const int32 uiAction) @@ -282,51 +452,62 @@ struct boss_flame_leviathanAI : public BossAI // Start encounter if (uiAction == 10) { - me->GetMotionMaster()->MovePoint(0, Center[0]); + me->SetHomePosition(354.8771, -12.90240, 409.803, 0); + me->GetMotionMaster()->MoveCharge(354.8771, -12.90240, 409.803); //position center me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + DoZoneInCombat(); return; } - /* - Tower event triggers - General TODO: - Yells - Actions: - DoAction(0): Activate hard-mode. Buff up leviathan's AP & health, schedule all the tower spells. - Should be triggered on Lore Keeper's script - DoAction(1-4): A tower have been destroyed, debuff leviathan's AP & health - DoAction(1); Tower of Storms has been destroyed, deschedule spell Thorim's Hammer - DoAction(2): Tower of Flames has been destroyed, deschedule spell Mimiron's Inferno - DoAction(3): Tower of Frost has been destroyed, deschedule spell Hodir's Fury - DoAction(4): Tower of Nature has been destroyed, deschedule spell Freya's Ward - */ - - if (uiAction) // Tower destruction, debuff leviathan AP & health + if (uiAction && uiAction <= 4) // Tower destruction, debuff leviathan loot and reduce active tower { - --uiActiveTowers; + if (me->HasLootMode(31) && uiActiveTowers == 4) + { + me->RemoveLootMode(LOOT_MODE_HARD_MODE_4); + --uiActiveTowers; + } + if (me->HasLootMode(15) && uiActiveTowers == 3) + { + me->RemoveLootMode(LOOT_MODE_HARD_MODE_3); + --uiActiveTowers; + } + if (me->HasLootMode(7) && uiActiveTowers == 2) + { + me->RemoveLootMode(LOOT_MODE_HARD_MODE_2); + --uiActiveTowers; + } + if (me->HasLootMode(3) && uiActiveTowers == 1) + { + me->RemoveLootMode(LOOT_MODE_HARD_MODE_1); + --uiActiveTowers; + } } switch (uiAction) { - case 0: // Activate hard-mode - events.ScheduleEvent(EVENT_THORIM_S_HAMMER, urand(30000,60000)); - events.ScheduleEvent(EVENT_MIMIRON_S_INFERNO, urand(30000,60000)); - events.ScheduleEvent(EVENT_HODIR_S_FURY, urand(30000,60000)); - events.ScheduleEvent(EVENT_FREYA_S_WARD, urand(30000,60000)); - uiActiveTowers=4; + case 0: // Activate hard-mode setting counter to 4 towers, enable all towers apply buffs on levithian + ActiveTowers = true; + towerOfStorms = true; + towerOfLife = true; + towerOfFlames = true; + towerOfFrost = true; + me->SetLootMode(31); break; case 1: // Tower of Storms destroyed - events.CancelEvent(EVENT_THORIM_S_HAMMER); + towerOfStorms = false; break; case 2: // Tower of Flames destroyed - events.CancelEvent(EVENT_MIMIRON_S_INFERNO); + towerOfFlames = false; break; case 3: // Tower of Frost destroyed - events.CancelEvent(EVENT_HODIR_S_FURY); + towerOfFrost = false; break; case 4: // Tower of Nature destroyed - events.CancelEvent(EVENT_FREYA_S_WARD); + towerOfLife = false; + break; + case 9: // Schedule event + events.ScheduleEvent(EVENT_SHUTDOWN, 0); break; } } @@ -336,7 +517,7 @@ struct boss_flame_leviathanAI : public BossAI struct boss_flame_leviathan_seatAI : public PassiveAI { - boss_flame_leviathan_seatAI(Creature *c) : PassiveAI(c), vehicle(c->GetVehicleKit()) + boss_flame_leviathan_seatAI(Creature* pCreature) : PassiveAI(pCreature), vehicle(pCreature->GetVehicleKit()) { assert(vehicle); #ifdef BOSS_DEBUG @@ -377,17 +558,17 @@ struct boss_flame_leviathan_seatAI : public PassiveAI device->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } - else if (seatId == SEAT_TURRET) - { - if (apply) - return; - - if (Unit* device = vehicle->GetPassenger(SEAT_DEVICE)) + else + if (seatId == SEAT_TURRET) { - device->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - device->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable + if (apply) + return; + if (Unit* device = vehicle->GetPassenger(SEAT_DEVICE)) + { + device->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + device->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable + } } - } } }; @@ -411,7 +592,12 @@ struct boss_flame_leviathan_defense_turretAI : public TurretAI struct boss_flame_leviathan_overload_deviceAI : public PassiveAI { - boss_flame_leviathan_overload_deviceAI(Creature* pCreature) : PassiveAI(pCreature) {} + boss_flame_leviathan_overload_deviceAI(Creature* pCreature) : PassiveAI(pCreature) + { + pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance *pInstance; void DoAction(const int32 param) { @@ -419,6 +605,7 @@ struct boss_flame_leviathan_overload_deviceAI : public PassiveAI { me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pInstance->instance->GetCreature(TYPE_LEVIATHAN)->AI()->DoAction(9); //should be called if all 3 overload devices are active if (me->GetVehicle()) { if (Unit* pPlayer = me->GetVehicle()->GetPassenger(SEAT_PLAYER)) @@ -435,28 +622,83 @@ struct boss_flame_leviathan_overload_deviceAI : public PassiveAI struct boss_flame_leviathan_safety_containerAI : public PassiveAI { - boss_flame_leviathan_safety_containerAI(Creature *c) : PassiveAI(c) {} - - void MovementInform(uint32 /*type*/, uint32 id) + boss_flame_leviathan_safety_containerAI(Creature* pCreature) : PassiveAI(pCreature) { - if (id == me->GetEntry()) + } + + void JustDied() + { + float x,y,z; + me->GetPosition(x,y,z); + z = me->GetMap()->GetHeight(x, y, z); + me->GetMotionMaster()->MovePoint(0,x,y,z); + me->GetMap()->CreatureRelocation(me, x,y,z,0); + } + + void UpdateAI(const uint32 diff) + { + } +}; +struct npc_mechanoliftAI : public PassiveAI +{ + npc_mechanoliftAI(Creature* pCreature) : PassiveAI(pCreature), vehicle(pCreature->GetVehicleKit()) + { + assert(vehicle); + } + + Vehicle* vehicle; + + uint32 MoveTimer; + + void Reset () + { + MoveTimer = 0; + me->GetMotionMaster()->MoveRandom(50); + } + + void JustDied(Unit* pKiller) + { + me->GetMotionMaster()->MoveTargetedHome(); + Creature* pLiquid = DoSummon(MOB_LIQUID, me, 0); + if (pLiquid) { - if (Creature* pLiquid = DoSummon(MOB_LIQUID, me, 0)) - pLiquid->CastSpell(pLiquid, 62494, true); - me->DisappearAndDie(); // this will relocate creature to sky + pLiquid->CastSpell(pLiquid, SPELL_LIQUID_PYRITE, true); + pLiquid->GetMotionMaster()->MoveFall(pKiller->GetPositionZ()); + } + + } + + void MovementInform(uint32 type, uint32 id) + { + if (id == 1) + { + Creature* pContainer = me->FindNearestCreature(MOB_CONTAINER, 5, true); + if (pContainer) + pContainer->EnterVehicle(me); } } - void UpdateAI(const uint32 /*diff*/) + void UpdateAI(const uint32 diff) { - if (!me->GetVehicle() && me->isSummon() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) - me->GetMotionMaster()->MoveFall(409.8f, me->GetEntry()); + if (MoveTimer <= diff) + { + if (me->GetVehicleKit()->HasEmptySeat(-1)) + { + Creature* pContainer = me->FindNearestCreature(MOB_CONTAINER, 50, true); + if (pContainer && !pContainer->GetVehicle()) + me->GetMotionMaster()->MovePoint(1,pContainer->GetPositionX(),pContainer->GetPositionY(),pContainer->GetPositionZ()); + } + MoveTimer = 30000; //check next 30 seconds + } + else + MoveTimer-=diff; } }; -struct spell_pool_of_tarAI : public TriggerAI + +struct spell_pool_of_tarAI : public PassiveAI { - spell_pool_of_tarAI(Creature *c) : TriggerAI(c) + spell_pool_of_tarAI(Creature* pCreature) : PassiveAI(pCreature) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -466,9 +708,9 @@ struct spell_pool_of_tarAI : public TriggerAI damage = 0; } - void SpellHit(Unit* /*caster*/, const SpellEntry *spell) + void SpellHit(Unit* /*caster*/, const SpellEntry* pSpell) { - if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE)) + if (pSpell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE)) me->CastSpell(me, SPELL_BLAZE, true); } }; @@ -481,7 +723,6 @@ struct npc_colossusAI : public ScriptedAI } ScriptedInstance *pInstance; - Position pPos; void JustDied(Unit* /*Who*/) { @@ -496,9 +737,339 @@ struct npc_colossusAI : public ScriptedAI { if (!UpdateVictim()) return; + DoMeleeAttackIfReady() ; } }; +struct npc_thorims_hammerAI : public ScriptedAI +{ + npc_thorims_hammerAI(Creature* pCreature) : ScriptedAI (pCreature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AddAura(AURA_DUMMY_BLUE, me); + } + + void MoveInLineOfSight(Unit* who) + { + if (who->GetTypeId() == TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who,0,10,false)) + { + if (Creature* pTrigger = DoSummonFlyer(NPC_THORIM_TARGET_BEACON, me, 20, 0, 1000, TEMPSUMMON_TIMED_DESPAWN)) + pTrigger->CastSpell(who, SPELL_THORIM_S_HAMMER, true); + } + } + + void Reset () + { + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(AURA_DUMMY_BLUE)) + me->AddAura(AURA_DUMMY_BLUE, me); + + if (!UpdateVictim()) + return; + } +}; + +struct npc_mimirons_infernoAI : public npc_escortAI +{ + npc_mimirons_infernoAI(Creature* pCreature) : npc_escortAI(pCreature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->AddAura(AURA_DUMMY_YELLOW, me); + me->SetReactState(REACT_PASSIVE); + } + + void WaypointReached(uint32 i) + { + } + + void Reset() + { + infernoTimer = 2000; + } + + uint32 infernoTimer; + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + Start(false,true,0,NULL,false,true); + } + else + { + if(infernoTimer <= diff) + { + if (Creature* pTrigger = DoSummonFlyer(NPC_MIMIRON_TARGET_BEACON, me, 20, 0, 1000, TEMPSUMMON_TIMED_DESPAWN)) + { + pTrigger->CastSpell(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), SPELL_MIMIRON_S_INFERNO, true); + infernoTimer = 2000; + } + } + else + infernoTimer -= diff; + + if (!me->HasAura(AURA_DUMMY_YELLOW)) + me->AddAura(AURA_DUMMY_YELLOW, me); + } + } +}; + + +struct npc_hodirs_furyAI : public ScriptedAI +{ + npc_hodirs_furyAI(Creature* pCreature) : ScriptedAI (pCreature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AddAura(AURA_DUMMY_GREEN, me); + } + + void MoveInLineOfSight(Unit* who) + { + if (who->GetTypeId() == TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who,0,5,false)) + { + if (Creature* pTrigger = DoSummonFlyer(NPC_HODIR_TARGET_BEACON, me, 20, 0, 1000, TEMPSUMMON_TIMED_DESPAWN)) + pTrigger->CastSpell(who, SPELL_HODIR_S_FURY, true); + } + } + + void Reset() + { + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(AURA_DUMMY_GREEN)) + me->AddAura(AURA_DUMMY_GREEN, me); + + if (!UpdateVictim()) + return; + } +}; + +struct npc_freyas_wardAI : public ScriptedAI +{ + npc_freyas_wardAI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->AddAura(AURA_DUMMY_GREEN, me); + } + + uint32 summonTimer ; + + void Reset() + { + summonTimer = 5000 ; + } + + void UpdateAI(const uint32 diff) + { + if(summonTimer <= diff) + { + DoCast(SPELL_FREYA_S_WARD_EFFECT_1) ; + DoCast(SPELL_FREYA_S_WARD_EFFECT_2) ; + summonTimer = 20000 ; + } + else + summonTimer -= diff ; + + if (!me->HasAura(AURA_DUMMY_GREEN)) + me->AddAura(AURA_DUMMY_GREEN, me); + + if (!UpdateVictim()) + return; + } +}; + +struct npc_freya_ward_summonAI : public ScriptedAI +{ + npc_freya_ward_summonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pCreature->GetMotionMaster()->MoveRandom(100); + } + + uint32 lashTimer ; + + void Reset() + { + lashTimer = 5000 ; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if(lashTimer <= diff) + { + DoCast(SPELL_LASH); + lashTimer = 20000; + } + else + lashTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; +//npc lore keeper +#define GOSSIP_ITEM_1 "Activate secondary defensive systems" +#define GOSSIP_ITEM_2 "Confirmed" +struct npc_lorekeeperAI : public ScriptedAI +{ + npc_lorekeeperAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + void DoAction(const int32 uiAction) + { + // Start encounter + if (uiAction == 0) + { + for(uint32 i = 0; i < (RAID_MODE(2,5)); ++i) + DoSummon(VEHICLE_SIEGE, PosSiege[i],3000,TEMPSUMMON_CORPSE_TIMED_DESPAWN); + for(uint32 i = 0; i < (RAID_MODE(2,5)); ++i) + DoSummon(VEHICLE_CHOPPER, PosChopper[i],3000,TEMPSUMMON_CORPSE_TIMED_DESPAWN); + for(uint32 i = 0; i < (RAID_MODE(2,5)); ++i) + DoSummon(VEHICLE_DEMOLISHER,PosDemolisher[i],3000,TEMPSUMMON_CORPSE_TIMED_DESPAWN); + return; + } + } +}; + +bool GossipHello_npc_lorekeeper(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + if (pInstance && pInstance->GetData(TYPE_LEVIATHAN) !=DONE && pPlayer) + { + pPlayer->PrepareGossipMenu(pCreature); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + return true; +} +//enable hardmode +bool GossipSelect_npc_lorekeeper(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + if (pPlayer) + { + pPlayer->PrepareGossipMenu(pCreature); + pInstance->instance->LoadGrid(364,-16); //make sure leviathan is loaded + + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_2,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF+2: + if (pPlayer) + pPlayer->CLOSE_GOSSIP_MENU(); + + if (Creature* pLeviathan = pInstance->instance->GetCreature(pInstance->GetData64(TYPE_LEVIATHAN))) + { + CAST_AI(boss_flame_leviathanAI, (pLeviathan->AI()))->DoAction(0); //enable hard mode activating the 4 additional events spawning additional vehicles + pCreature->SetVisibility(VISIBILITY_OFF); + pCreature->AI()->DoAction(0); // spawn the vehicles + pCreature->SetVisibility(VISIBILITY_OFF); + if (Creature* Delorah = pCreature->FindNearestCreature(NPC_DELORAH, 1000, true)) + { + if (Creature* Branz = pCreature->FindNearestCreature(NPC_BRANZ_BRONZBEARD, 1000, true)) + { + Delorah->GetMotionMaster()->MovePoint(0, Branz->GetPositionX()-4, Branz->GetPositionY(), Branz->GetPositionZ()); + //TODO DoScriptText(xxxx, Delorah, Branz); when reached at branz + } + } + } + break; + } + return true; +} +////npc_brann_bronzebeard this requires more work involving area triggers. if reached this guy speaks through his radio.. +//#define GOSSIP_ITEM_1 "xxxxx" +//#define GOSSIP_ITEM_2 "xxxxx" +// +//bool GossipHello_npc_brann_bronzebeard(Player* pPlayer, Creature* pCreature) +//{ +// ScriptedInstance* pInstance = pCreature->GetInstanceData(); +// if (pInstance && pInstance->GetData(TYPE_LEVIATHAN) !=DONE) +// { +// pPlayer->PrepareGossipMenu(pCreature); +// +// pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); +// pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); +// } +// return true; +//} +// +//bool GossipSelect_npc_brann_bronzebeard(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +//{ +// switch(uiAction) +// { +// case GOSSIP_ACTION_INFO_DEF+1: +// if (pPlayer) +// { +// pPlayer->PrepareGossipMenu(pCreature); +// +// pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_2,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2); +// pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); +// } +// break; +// case GOSSIP_ACTION_INFO_DEF+2: +// if (pPlayer) +// pPlayer->CLOSE_GOSSIP_MENU(); +// if (Creature* Lorekeeper = pCreature->FindNearestCreature(NPC_LOREKEEPER, 1000, true)) //lore keeper of lorgannon +// Lorekeeper->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); +// break; +// } +// return true; +//} + +void GODestroyed_go_ulduar_tower(Player* pPlayer, GameObject* pGO, uint32 value) +{ + ScriptedInstance* pInstance = pGO->GetInstanceData(); + if (pGO->GetGOValue()->building.health == 0) + { + switch(pGO->GetEntry()) + { + case GO_TOWER_OF_STORMS: + pInstance->ProcessEvent(pGO, EVENT_TOWER_OF_STORM_DESTROYED); + break; + case GO_TOWER_OF_FLAMES: + pInstance->ProcessEvent(pGO, EVENT_TOWER_OF_FLAMES_DESTROYED); + break; + case GO_TOWER_OF_FROST: + pInstance->ProcessEvent(pGO, EVENT_TOWER_OF_FROST_DESTROYED); + break; + case GO_TOWER_OF_LIFE: + pInstance->ProcessEvent(pGO, EVENT_TOWER_OF_LIFE_DESTROYED); + break; + } + } +} + +bool AreaTrigger_at_RX_214_repair_o_matic_station(Player* pPlayer, const AreaTriggerEntry* pAt) +{ + if(Creature* vehicle = pPlayer->GetVehicleCreatureBase()) + { + if(!vehicle->HasAura(SPELL_AUTO_REPAIR)) + { + pPlayer->MonsterTextEmote(EMOTE_REPAIR, pPlayer->GetGUID(), true); + pPlayer->CastSpell(vehicle, SPELL_AUTO_REPAIR, true); + } + } + return true; +} + CreatureAI* GetAI_boss_flame_leviathan(Creature* pCreature) { return new boss_flame_leviathanAI (pCreature); @@ -519,11 +1090,16 @@ CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature* pCreature) return new boss_flame_leviathan_overload_deviceAI (pCreature); } -CreatureAI* GetAI_boss_flame_leviathan_safety_containerAI(Creature* pCreature) +CreatureAI* GetAI_boss_flame_leviathan_safety_container(Creature* pCreature) { return new boss_flame_leviathan_safety_containerAI(pCreature); } +CreatureAI* GetAI_npc_mechanolift(Creature* pCreature) +{ + return new npc_mechanoliftAI(pCreature); +} + CreatureAI* GetAI_spell_pool_of_tar(Creature* pCreature) { return new spell_pool_of_tarAI (pCreature); @@ -534,6 +1110,35 @@ CreatureAI* GetAI_npc_colossus(Creature* pCreature) return new npc_colossusAI(pCreature); } +CreatureAI* GetAI_npc_thorims_hammer(Creature* pCreature) +{ + return new npc_thorims_hammerAI(pCreature); +} + +CreatureAI* GetAI_npc_mimirons_inferno(Creature* pCreature) +{ + return new npc_mimirons_infernoAI(pCreature); +} + +CreatureAI* GetAI_npc_hodirs_fury(Creature* pCreature) +{ + return new npc_hodirs_furyAI(pCreature); +} + +CreatureAI* GetAI_npc_freyas_ward(Creature* pCreature) +{ + return new npc_freyas_wardAI(pCreature); +} + +CreatureAI* GetAI_npc_freya_ward_summon(Creature* pCreature) +{ + return new npc_freya_ward_summonAI (pCreature); +} +CreatureAI* GetAI_npc_lorekeeper(Creature* pCreature) +{ + return new npc_lorekeeperAI (pCreature); +} + void AddSC_boss_flame_leviathan() { Script *newscript; @@ -559,7 +1164,12 @@ void AddSC_boss_flame_leviathan() newscript = new Script; newscript->Name = "boss_flame_leviathan_safety_container"; - newscript->GetAI = &GetAI_boss_flame_leviathan_safety_containerAI; + newscript->GetAI = &GetAI_boss_flame_leviathan_safety_container; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mechanolift"; + newscript->GetAI = &GetAI_npc_mechanolift; newscript->RegisterSelf(); newscript = new Script; @@ -571,4 +1181,52 @@ void AddSC_boss_flame_leviathan() newscript->Name = "npc_colossus"; newscript->GetAI = &GetAI_npc_colossus; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_thorims_hammer"; + newscript->GetAI = &GetAI_npc_thorims_hammer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mimirons_inferno"; + newscript->GetAI = &GetAI_npc_mimirons_inferno; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_hodirs_fury"; + newscript->GetAI = &GetAI_npc_hodirs_fury; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_freyas_ward"; + newscript->GetAI = &GetAI_npc_freyas_ward; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_freya_ward_summon"; + newscript->GetAI = &GetAI_npc_freya_ward_summon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lorekeeper"; + newscript->GetAI = &GetAI_npc_lorekeeper; + newscript->pGossipHello = &GossipHello_npc_lorekeeper; + newscript->pGossipSelect = &GossipSelect_npc_lorekeeper; + newscript->RegisterSelf(); + + /*newscript = new Script; + newscript->Name = "npc_brann_bronzebeard"; + newscript->pGossipHello = &GossipHello_npc_brann_bronzebeard; + newscript->pGossipSelect = &GossipSelect_npc_brann_bronzebeard; + newscript->RegisterSelf();*/ + + newscript = new Script; + newscript->Name = "go_ulduar_tower"; + newscript->pGODestroyed = &GODestroyed_go_ulduar_tower; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_RX_214_repair_o_matic_station"; + newscript->pAreaTrigger = &AreaTrigger_at_RX_214_repair_o_matic_station; + newscript->RegisterSelf(); } diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp index ee995878a0e..df1298eb3b7 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Yells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp index f84c638d3e3..7b573864ee0 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Yells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp index 6facd8ac639..b43dbe82b60 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Yells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp index 05f9ecd3c66..ac5414eaedf 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" #define SPELL_FLAME_JETS 62680 diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp index 2080b458a1b..710484de42c 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" #include "Vehicle.h" diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp index 2b9994d5d9b..85fab4d67db 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Yells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp index c61f1046474..bf4ddae9e99 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -22,7 +21,7 @@ SDAuthor: MaXiMiUS SD%Complete: 65 EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" //not in db diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp index bbab077e10e..a508457e62a 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Yells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp index 58123951d2f..600bb41a469 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* @@ -28,7 +27,7 @@ make the life sparks visible... */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Spells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp index 8f42f289204..57c0008536b 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum Sara_Yells diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp index 692dbf72473..27f59ebb835 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ulduar.h" enum eGameObjects @@ -64,8 +63,7 @@ struct instance_ulduar : public ScriptedInstance uint64 uiFreyaChestGUID; void Initialize() - { - uiLeviathanGUID = 0; + { uiIgnisGUID = 0; uiRazorscaleGUID = 0; uiXT002GUID = 0; @@ -106,7 +104,7 @@ struct instance_ulduar : public ScriptedInstance switch(pCreature->GetEntry()) { case NPC_LEVIATHAN: - uiLeviathanGUID = pCreature->GetGUID(); + uiLeviathanGUID = pCreature->GetGUID(); break; case NPC_IGNIS: uiIgnisGUID = pCreature->GetGUID(); @@ -187,22 +185,24 @@ struct instance_ulduar : public ScriptedInstance if (flag == 7) flag =0; break; - case GO_LEVIATHAN_GATE: - uiLeviathanGateGUID = pGO->GetGUID(); - HandleGameObject(NULL, false, pGO); - break; + case GO_LEVIATHAN_GATE: + uiLeviathanGateGUID = add ? pGO->GetGUID() : NULL; + HandleGameObject(NULL, false, pGO); + break; } } void ProcessEvent(GameObject* pGO, uint32 uiEventId) { // Flame Leviathan's Tower Event triggers - Creature* pFlameLeviathan = instance->GetCreature(NPC_LEVIATHAN); + Creature* pFlameLeviathan = instance->GetCreature(uiLeviathanGUID); + if (pFlameLeviathan && pFlameLeviathan->isAlive()) //No leviathan, no event triggering ;) switch(uiEventId) { case EVENT_TOWER_OF_STORM_DESTROYED: - pFlameLeviathan->AI()->DoAction(1); + //pGO->GetInstanceData()->SetData(DATA_TOWER_STORMS,DESTROYED); + pFlameLeviathan->AI()->DoAction(1); break; case EVENT_TOWER_OF_FROST_DESTROYED: pFlameLeviathan->AI()->DoAction(2); @@ -210,7 +210,7 @@ struct instance_ulduar : public ScriptedInstance case EVENT_TOWER_OF_FLAMES_DESTROYED: pFlameLeviathan->AI()->DoAction(3); break; - case EVENT_TOWER_OF_NATURE_DESTROYED: + case EVENT_TOWER_OF_LIFE_DESTROYED: pFlameLeviathan->AI()->DoAction(4); break; } @@ -218,9 +218,6 @@ struct instance_ulduar : public ScriptedInstance void SetData(uint32 type, uint32 data) { - if (type != TYPE_COLOSSUS) - uiEncounter[type] = data; - switch(type) { /*case TYPE_IGNIS: @@ -235,12 +232,12 @@ struct instance_ulduar : public ScriptedInstance case TYPE_LEVIATHAN: if (data == IN_PROGRESS) { - for (uint8 uiI = 0; uiI < 7; uiI++) + for (uint8 uiI = 0; uiI < 7; ++uiI) HandleGameObject(uiLeviathanDoor[uiI],false); } else { - for (uint8 uiI = 0; uiI < 7; uiI++) + for (uint8 uiI = 0; uiI < 7; ++uiI) HandleGameObject(uiLeviathanDoor[uiI],true); } break; @@ -265,32 +262,21 @@ struct instance_ulduar : public ScriptedInstance pGO->SetRespawnTime(pGO->GetRespawnDelay()); break; case TYPE_COLOSSUS: + uiEncounter[TYPE_COLOSSUS] = data; if (data == 2) { if (Creature* pBoss = instance->GetCreature(uiLeviathanGUID)) pBoss->AI()->DoAction(10); if (GameObject* pGate = instance->GetGameObject(uiLeviathanGateGUID)) - pGate->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); + pGate->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); } - break; + break; default: break; } if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - saveStream << uiEncounter[i] << " "; - - m_strInstData = saveStream.str(); - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } } uint64 GetData64(uint32 data) @@ -351,9 +337,9 @@ struct instance_ulduar : public ScriptedInstance std::ostringstream saveStream; saveStream << "U U " << uiEncounter[0] << " " << uiEncounter[1] << " " << uiEncounter[2] << " " << uiEncounter[3] - << uiEncounter[4] << " " << uiEncounter[5] << " " << uiEncounter[6] << " " << uiEncounter[7] - << uiEncounter[8] << " " << uiEncounter[9] << " " << uiEncounter[10] << " " << uiEncounter[11] - << uiEncounter[12] << " " << uiEncounter[13] << " " << uiEncounter[14]; + << " " << uiEncounter[4] << " " << uiEncounter[5] << " " << uiEncounter[6] << " " << uiEncounter[7] + << " " << uiEncounter[8] << " " << uiEncounter[9] << " " << uiEncounter[10] << " " << uiEncounter[11] + << " " << uiEncounter[12] << " " << uiEncounter[13] << " " << uiEncounter[14]; m_strInstData = saveStream.str(); diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h index cb11bcb579c..a6d1271ce0e 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_ULDUAR_H @@ -43,7 +42,7 @@ enum eTypes DATA_MOLGEIM = 21, DATA_BRUNDIR = 22, DATA_RUNEMASTER_MOLGEIM = 23, - DATA_STORMCALLER_BRUNDIR = 24, + DATA_STORMCALLER_BRUNDIR = 24, NPC_LEVIATHAN = 33113, NPC_IGNIS = 33118, @@ -65,7 +64,7 @@ enum eTypes EVENT_TOWER_OF_STORM_DESTROYED = 21031, EVENT_TOWER_OF_FROST_DESTROYED = 21032, EVENT_TOWER_OF_FLAMES_DESTROYED = 21033, - EVENT_TOWER_OF_NATURE_DESTROYED = 21030 + EVENT_TOWER_OF_LIFE_DESTROYED = 21030 }; #endif diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/ulduar_teleporter.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/ulduar_teleporter.cpp index 44f9e86b69c..102cb69a3b1 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/ulduar_teleporter.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/ulduar_teleporter.cpp @@ -1,4 +1,22 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "ulduar.h" /* diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 77f824c48d5..bc2270cf79f 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: Some Problems with Annhylde Movement, Blizzlike Timers SDCategory: Udgarde Keep EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_keep.h" enum Yells diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index d69f0eee846..31274403c0e 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs SDCategory: Utgarde Keep EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_keep.h" enum eEnums diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 2146d37635b..02fc594b74a 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB SDCategory: Utgarde Keep EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_keep.h" enum eEnums diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp index 03f97b1d27e..1a45b18326c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -23,7 +22,7 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter SDCategory: Utgarde Keep EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_keep.h" #define MAX_ENCOUNTER 3 @@ -109,7 +108,7 @@ struct instance_utgarde_keep : public ScriptedInstance } } - debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); + sLog.outDebug("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 95825aa49b6..4ee2059712d 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_keep.h" uint32 entry_search[3] = diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h index b630e156564..f65c54f540c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef DEF_UTGARDE_KEEP_H diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 297fe37b7d8..af20d156c15 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss palehoof SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_palehoof' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_pinnacle.h" enum Spells diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index a75eb3465be..964f30adb91 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -1,17 +1,18 @@ -/* Copyright (C) 2008 - 2010 Trinity - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* Script Data Start @@ -24,7 +25,7 @@ SDComment: SDCategory: Utgarde Pinnacle Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_pinnacle.h" //Yell @@ -252,7 +253,7 @@ struct boss_skadiAI : public ScriptedAI break; case CREATURE_TRIGGER: pSummoned->CastSpell((Unit*)NULL, SPELL_FREEZING_CLOUD, true); - pSummoned->ForcedDespawn(10*IN_MILISECONDS); + pSummoned->ForcedDespawn(10*IN_MILLISECONDS); break; } Summons.Summon(pSummoned); @@ -275,7 +276,7 @@ struct boss_skadiAI : public ScriptedAI Phase = SKADI; me->SetFlying(false); me->Unmount(); - if(Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILISECONDS)) + if(Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS)) { pGrauf->GetMotionMaster()->MoveFall(0); pGrauf->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index aae1015ddab..bd3cf42c502 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -1,20 +1,21 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_pinnacle.h" enum Spells @@ -104,7 +105,7 @@ struct boss_svalaAI : public ScriptedAI void Reset() { Phase = IDLE; - uiIntroTimer = 1*IN_MILISECONDS; + uiIntroTimer = 1*IN_MILLISECONDS; uiIntroPhase = 0; uiArthasGUID = 0; @@ -149,28 +150,28 @@ struct boss_svalaAI : public ScriptedAI case 0: DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, me); ++uiIntroPhase; - uiIntroTimer = 3.5*IN_MILISECONDS; + uiIntroTimer = 3.5*IN_MILLISECONDS; break; case 1: DoScriptText(SAY_DIALOG_OF_ARTHAS_1, pArthas); ++uiIntroPhase; - uiIntroTimer = 3.5*IN_MILISECONDS; + uiIntroTimer = 3.5*IN_MILLISECONDS; break; case 2: DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, me); ++uiIntroPhase; - uiIntroTimer = 3.5*IN_MILISECONDS; + uiIntroTimer = 3.5*IN_MILLISECONDS; break; case 3: DoScriptText(SAY_DIALOG_OF_ARTHAS_2, pArthas); ++uiIntroPhase; - uiIntroTimer = 3.5*IN_MILISECONDS; + uiIntroTimer = 3.5*IN_MILLISECONDS; break; case 4: DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, me); DoCast(me, SPELL_SVALA_TRANSFORMING1); ++uiIntroPhase; - uiIntroTimer = 2.8*IN_MILISECONDS; + uiIntroTimer = 2.8*IN_MILLISECONDS; break; case 5: DoCast(me, SPELL_SVALA_TRANSFORMING2); @@ -178,7 +179,7 @@ struct boss_svalaAI : public ScriptedAI uiIntroTimer = 200; break; case 6: - if (Creature* pSvalaSorrowgrave = me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILISECONDS)) + if (Creature* pSvalaSorrowgrave = me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILLISECONDS)) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); me->SetDisplayId(DATA_SVALA_DISPLAY_ID); @@ -243,10 +244,10 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI void Reset() { - uiSinsterStrikeTimer = 7*IN_MILISECONDS; - uiCallFlamesTimer = 10*IN_MILISECONDS; - uiRitualOfSwordTimer = 20*IN_MILISECONDS; - uiSacrificeTimer = 8*IN_MILISECONDS; + uiSinsterStrikeTimer = 7*IN_MILLISECONDS; + uiCallFlamesTimer = 10*IN_MILLISECONDS; + uiRitualOfSwordTimer = 20*IN_MILLISECONDS; + uiSacrificeTimer = 8*IN_MILLISECONDS; bSacrificed = false; @@ -293,7 +294,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI if (uiSinsterStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_SINSTER_STRIKE); - uiSinsterStrikeTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS); + uiSinsterStrikeTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS); } else uiSinsterStrikeTimer -= diff; if (uiCallFlamesTimer <= diff) @@ -301,7 +302,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { DoCast(pTarget, SPELL_CALL_FLAMES); - uiCallFlamesTimer = urand(8*IN_MILISECONDS,12*IN_MILISECONDS); + uiCallFlamesTimer = urand(8*IN_MILLISECONDS,12*IN_MILLISECONDS); } } else uiCallFlamesTimer -= diff; @@ -347,7 +348,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) me->GetMotionMaster()->MoveChase(pTarget); - uiSacrificeTimer = 8*IN_MILISECONDS; + uiSacrificeTimer = 8*IN_MILLISECONDS; } else uiSacrificeTimer -= diff; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 1a650f94101..62d297396ac 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + /* Script Data Start SDName: Boss ymiron SDAuthor: LordVanMartin @@ -9,7 +26,7 @@ Script Data End */ /*** SQL START *** update creature_template set scriptname = 'boss_ymiron' where entry = ''; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "utgarde_pinnacle.h" enum Spells diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp index cf042867707..dbbd7b058f2 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "utgarde_pinnacle.h" #define MAX_ENCOUNTER 4 diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h index a51d7aceda0..4592cb2f335 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_PINNACLE_H #define DEF_PINNACLE_H diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index 11d432e94c6..124a8f0b8b8 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /*** SQL START *** @@ -21,7 +20,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125 UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "vault_of_archavon.h" #define EMOTE_BERSERK -1590002 diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index 92a0331708e..6757d28a208 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "vault_of_archavon.h" //Emalon spells diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index 61843647136..f8bc8295f21 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /*** SQL START *** @@ -21,7 +20,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_koralon' WHERE `entry`='35013' UPDATE `creature_template` SET `ScriptName`='mob_flame_warder' WHERE `entry`='35143'; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "vault_of_archavon.h" enum Events diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 2e16f9211d2..eddf62700fe 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009-2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /*** SQL START *** @@ -23,7 +22,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb_stalker' WHERE `entr UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb' WHERE `entry`='38456'; *** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "vault_of_archavon.h" // Spells Toravon diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp index a7183921cce..e7449acafb4 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "vault_of_archavon.h" #define ENCOUNTERS 4 diff --git a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h index 6aa642ff701..1885235359e 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h +++ b/src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_ARCHAVON_H #define DEF_ARCHAVON_H diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index 589e69a6f18..8e760ba00c6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -1,15 +1,21 @@ -/* Script Data Start -SDName: Boss cyanigosa -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" enum Spells @@ -68,7 +74,6 @@ struct boss_cyanigosaAI : public ScriptedAI void EnterCombat(Unit* /*who*/) { DoScriptText(SAY_AGGRO, me); - DoCast(me, SPELL_TRANSFORM); if (pInstance) pInstance->SetData(DATA_CYANIGOSA_EVENT, IN_PROGRESS); diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index a9cc7393af4..d25f87ca230 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -1,15 +1,21 @@ -/* Script Data Start -SDName: Boss erekem -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" enum Spells diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index a28bfdffb7c..fe216d8db4e 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -1,28 +1,21 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -/* Script Data Start -SDName: Boss ichoron -SDAuthor: ckegg -SD%Complete: 80% -SDComment: TODO: better spawn location for adds -SDCategory: -Script Data End */ - -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" enum Spells @@ -298,15 +291,23 @@ struct boss_ichoronAI : public ScriptedAI void JustSummoned(Creature* pSummoned) { - pSummoned->SetSpeed(MOVE_RUN, 0.3f); - pSummoned->GetMotionMaster()->MoveFollow(me, 0, 0); - m_waterElements.push_back(pSummoned->GetGUID()); + if (pSummoned) + { + pSummoned->SetSpeed(MOVE_RUN, 0.3f); + pSummoned->GetMotionMaster()->MoveFollow(me, 0, 0); + m_waterElements.push_back(pSummoned->GetGUID()); + pInstance->SetData64(DATA_ADD_TRASH_MOB,pSummoned->GetGUID()); + } } void SummonedCreatureDespawn(Creature *pSummoned) { - m_waterElements.remove(pSummoned->GetGUID()); + if (pSummoned) + { + m_waterElements.remove(pSummoned->GetGUID()); + pInstance->SetData64(DATA_DEL_TRASH_MOB,pSummoned->GetGUID()); + } } void KilledUnit(Unit * victim) diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index d8cd3a4962f..7a86fedf849 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -1,15 +1,21 @@ -/* Script Data Start -SDName: Boss lavanthor -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" enum Spells diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index 6d283c7bfb4..0abcbbf720c 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -1,15 +1,21 @@ -/* Script Data Start -SDName: Boss moragg -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" //Spells diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index 2633705c1b7..8fb3f200852 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -1,27 +1,21 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ -/* Script Data Start -SDName: Boss xevozz -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" enum Spells diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index da75ed94fc2..ebe703aae38 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -1,11 +1,21 @@ -/* Script Data Start -SDName: Boss zuramat -SD%Complete: -SDComment: The phasemask for the voids dosen't work. -SDCategory: -Script Data End */ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "violet_hold.h" enum Spells diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 781511f940b..80051ace614 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -1,4 +1,21 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" #include "violet_hold.h" #define MAX_ENCOUNTER 3 @@ -32,14 +49,58 @@ enum GameObjects GO_ACTIVATION_CRYSTAL = 193611 }; +enum AzureSaboteurSpells +{ + SABOTEUR_SHIELD_DISRUPTION = 58291, + SABOTEUR_SHIELD_EFFECT = 45775 +}; + +enum CrystalSpells +{ + SPELL_ARCANE_LIGHTNING = 57912 +}; + +enum Events +{ + EVENT_ACTIVATE_CRYSTAL = 20001 +}; + const Position PortalLocation[] = { - {1936.07, 803.198, 53.3749, 3.12414}, - {1877.51, 850.104, 44.6599, 4.7822 }, - {1890.64, 753.471, 48.7224, 1.71042}, - {1908.31, 809.657, 38.7037, 3.08701}, - {1918.37, 853.437, 47.1624, 4.12294}, - {1927.61, 758.436, 51.4533, 2.20891} + {1877.51, 850.104, 44.6599, 4.7822 }, // WP 1 + {1918.37, 853.437, 47.1624, 4.12294}, // WP 2 + {1936.07, 803.198, 53.3749, 3.12414}, // WP 3 + {1927.61, 758.436, 51.4533, 2.20891}, // WP 4 + {1890.64, 753.471, 48.7224, 1.71042}, // WP 5 + {1908.31, 809.657, 38.7037, 3.08701} // WP 6 +}; + +const Position BossStartMove1 = {1894.684448, 739.390503, 47.668003}; +const Position BossStartMove2 = {1875.173950, 860.832703, 43.333565}; +const Position BossStartMove21 = {1858.854614, 855.071411, 43.333565}; +const Position BossStartMove22 = {1891.926636, 863.388977, 43.333565}; +const Position BossStartMove3 = {1916.138062, 778.152222, 35.772308}; +const Position BossStartMove4 = {1853.618286, 758.557617, 38.657505}; +const Position BossStartMove5 = {1906.683960, 842.348022, 38.637459}; +const Position BossStartMove6 = {1928.207031, 852.864441, 47.200813}; + +const Position CyanigosasSpawnLocation = {1930.281250, 804.407715, 52.410946, 3.139621}; +const Position MiddleRoomLocation = {1892.291260, 805.696838, 38.438862, 3.139621}; +const Position MiddleRoomPortalSaboLocation = {1896.622925, 804.854126, 38.504772, 3.139621}; + +//Cyanigosa's prefight event data +enum Yells +{ + CYANIGOSA_SAY_SPAWN = -1608005 +}; +enum Spells +{ + CYANIGOSA_SPELL_TRANSFORM = 58668, + CYANIGOSA_BLUE_AURA = 47759, +}; +enum Achievements +{ + ACHIEV_DEFENSELESS = 1816 }; struct instance_violet_hold : public ScriptedInstance @@ -65,10 +126,16 @@ struct instance_violet_hold : public ScriptedInstance uint64 uiXevozzCell; uint64 uiZuramatCell; uint64 uiMainDoor; + uint64 uiTeleportationPortal; + uint64 uiSaboteurPortal; uint64 uiActivationCrystal[3]; uint32 uiActivationTimer; + uint32 uiCyanigosaEventTimer; + uint32 uiDoorSpellTimer; + + std::set trashMobs; // to kill with crystal uint8 uiWaveCount; uint8 uiLocation; @@ -76,12 +143,20 @@ struct instance_violet_hold : public ScriptedInstance uint8 uiSecondBoss; uint8 uiRemoveNpc; + uint8 uiDoorIntegrity; + uint8 m_auiEncounter[MAX_ENCOUNTER]; uint8 uiCountErekemGuards; uint8 uiCountActivationCrystals; + uint8 uiCyanigosaEventPhase; + uint8 uiMainEventPhase; // SPECIAL: pre event animations, IN_PROGRESS: event itself bool bActive; bool bWiped; + bool bIsDoorSpellCasted; + bool bCrystalActivated; + + std::list NpcAtDoorCastingList; std::string str_data; @@ -105,19 +180,30 @@ struct instance_violet_hold : public ScriptedInstance uiXevozzCell = 0; uiZuramatCell = 0; uiMainDoor = 0; + uiTeleportationPortal = 0; + uiSaboteurPortal = 0; + + trashMobs.clear(); + uiRemoveNpc = 0; + uiDoorIntegrity = 100; + uiWaveCount = 0; uiLocation = urand(0,5); uiFirstBoss = 0; uiSecondBoss = 0; uiCountErekemGuards = 0; uiCountActivationCrystals = 0; + uiCyanigosaEventPhase = 1; uiActivationTimer = 5000; + uiDoorSpellTimer = 2000; + uiCyanigosaEventTimer = 3*IN_MILLISECONDS; bActive = false; - bWiped = false; + bIsDoorSpellCasted = false; + bCrystalActivated = false; memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); } @@ -161,6 +247,7 @@ struct instance_violet_hold : public ScriptedInstance break; case CREATURE_CYANIGOSA: uiCyanigosa = pCreature->GetGUID(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); break; case CREATURE_SINCLARI: uiSinclari = pCreature->GetGUID(); @@ -231,8 +318,11 @@ struct instance_violet_hold : public ScriptedInstance if (data == DONE) { SaveToDB(); + uiMainEventPhase = DONE; if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) pMainDoor->SetGoState(GO_STATE_ACTIVE); + if (!bCrystalActivated && uiDoorIntegrity == 100) + DoCompleteAchievement(ACHIEV_DEFENSELESS); } break; case DATA_WAVE_COUNT: @@ -242,6 +332,75 @@ struct instance_violet_hold : public ScriptedInstance case DATA_REMOVE_NPC: uiRemoveNpc = data; break; + case DATA_PORTAL_LOCATION: + uiLocation = (uint8)data; + break; + case DATA_DOOR_INTEGRITY: + uiDoorIntegrity = data; + DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, uiDoorIntegrity); + break; + case DATA_NPC_PRESENCE_AT_DOOR_ADD: + NpcAtDoorCastingList.push_back(data); + break; + case DATA_NPC_PRESENCE_AT_DOOR_REMOVE: + if(!NpcAtDoorCastingList.empty()) + NpcAtDoorCastingList.pop_back(); + break; + case DATA_MAIN_DOOR: + if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) + { + switch(data) + { + case GO_STATE_ACTIVE: + pMainDoor->SetGoState(GO_STATE_ACTIVE); + break; + case GO_STATE_READY: + pMainDoor->SetGoState(GO_STATE_READY); + break; + case GO_STATE_ACTIVE_ALTERNATIVE: + pMainDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); + break; + } + } + break; + case DATA_START_BOSS_ENCOUNTER: + switch(uiWaveCount) + { + case 6: + StartBossEncounter(uiFirstBoss); + break; + case 12: + StartBossEncounter(uiSecondBoss); + break; + } + break; + case DATA_ACTIVATE_CRYSTAL: + ActivateCrystal(); + break; + case DATA_MAIN_EVENT_PHASE: + uiMainEventPhase = data; + if (data == IN_PROGRESS) // Start event + { + if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) + pMainDoor->SetGoState(GO_STATE_READY); + uiWaveCount = 1; + bActive = true; + uiRemoveNpc = 0; // might not have been reset after a wipe on a boss. + } + break; + } + } + + void SetData64(uint32 type, uint64 data) + { + switch(type) + { + case DATA_ADD_TRASH_MOB: + trashMobs.insert(data); + break; + case DATA_DEL_TRASH_MOB: + trashMobs.erase(data); + break; } } @@ -254,136 +413,17 @@ struct instance_violet_hold : public ScriptedInstance case DATA_CYANIGOSA_EVENT: return m_auiEncounter[2]; case DATA_WAVE_COUNT: return uiWaveCount; case DATA_REMOVE_NPC: return uiRemoveNpc; + case DATA_PORTAL_LOCATION: return uiLocation; + case DATA_DOOR_INTEGRITY: return uiDoorIntegrity; + case DATA_NPC_PRESENCE_AT_DOOR: return NpcAtDoorCastingList.size(); + case DATA_FIRST_BOSS: return uiFirstBoss; + case DATA_SECOND_BOSS: return uiSecondBoss; + case DATA_MAIN_EVENT_PHASE: return uiMainEventPhase; } return 0; } - void SpawnPortal() - { - if (Creature *pSinclari = instance->GetCreature(uiSinclari)) - if (Creature *pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL,PortalLocation[uiLocation],TEMPSUMMON_CORPSE_DESPAWN)) - uiLocation = (uiLocation+urand(1,5))%6; - } - - void StartBossEncounter(uint8 uiBoss, bool bForceRespawn = true) - { - Creature* pBoss = NULL; - - switch(uiBoss) - { - case BOSS_MORAGG: - HandleGameObject(uiMoraggCell,bForceRespawn); - pBoss = instance->GetCreature(uiMoragg); - if (pBoss) - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - break; - case BOSS_EREKEM: - HandleGameObject(uiErekemCell, bForceRespawn); - HandleGameObject(uiErekemRightGuardCell, bForceRespawn); - HandleGameObject(uiErekemLeftGuardCell, bForceRespawn); - - pBoss = instance->GetCreature(uiErekem); - if (pBoss) - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - - if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0])) - { - if (bForceRespawn) - pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - else - pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - } - - if (Creature* pGuard2 = instance->GetCreature(uiErekemGuard[1])) - { - if (bForceRespawn) - pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - else - pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - } - break; - case BOSS_ICHORON: - HandleGameObject(uiIchoronCell,bForceRespawn); - pBoss = instance->GetCreature(uiIchoron); - if (pBoss) - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - break; - case BOSS_LAVANTHOR: - HandleGameObject(uiLavanthorCell,bForceRespawn); - pBoss = instance->GetCreature(uiLavanthor); - if (pBoss) - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - break; - case BOSS_XEVOZZ: - HandleGameObject(uiXevozzCell,bForceRespawn); - pBoss = instance->GetCreature(uiXevozz); - if (pBoss) - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - break; - case BOSS_ZURAMAT: - HandleGameObject(uiZuramatCell,bForceRespawn); - pBoss = instance->GetCreature(uiZuramat); - if (pBoss) - pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - break; - } - - if (!bForceRespawn && pBoss) - { - if (pBoss->isDead()) - { - // respawn but avoid to be looted again - pBoss->Respawn(); - pBoss->RemoveLootMode(1); - } - pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); - SetData(DATA_WAVE_COUNT,0); - uiWaveCount = 0; - } - } - - void AddWave() - { - DoUpdateWorldState(WORLD_STATE_VH, 1); - DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, uiWaveCount); - DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, 100); // TODO - - switch(uiWaveCount) - { - case 6: - if (uiFirstBoss == 0) - uiFirstBoss = urand(1,6); - StartBossEncounter(uiFirstBoss); - break; - case 12: - if (uiSecondBoss == 0) - do - { - uiSecondBoss = urand(1,6); - } while (uiSecondBoss == uiFirstBoss); - StartBossEncounter(uiSecondBoss); - break; - case 18: - { - Creature *pSinclari = instance->GetCreature(uiSinclari); - if (pSinclari) - pSinclari->SummonCreature(CREATURE_CYANIGOSA,PortalLocation[0],TEMPSUMMON_DEAD_DESPAWN); - break; - } - case 1: - { - if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) - pMainDoor->SetGoState(GO_STATE_READY); - } - default: - if (!bWiped) - SpawnPortal(); - bWiped = false; - break; - } - } - uint64 GetData64(uint32 identifier) { switch(identifier) @@ -407,11 +447,158 @@ struct instance_violet_hold : public ScriptedInstance case DATA_ZURAMAT_CELL: return uiZuramatCell; case DATA_MAIN_DOOR: return uiMainDoor; case DATA_SINCLARI: return uiSinclari; + case DATA_TELEPORTATION_PORTAL: return uiTeleportationPortal; + case DATA_SABOTEUR_PORTAL: return uiSaboteurPortal; } return 0; } + void SpawnPortal() + { + SetData(DATA_PORTAL_LOCATION, (GetData(DATA_PORTAL_LOCATION) + urand(1,5))%6); + if (Creature *pSinclari = instance->GetCreature(uiSinclari)) + if(Creature *portal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL,PortalLocation[GetData(DATA_PORTAL_LOCATION)],TEMPSUMMON_CORPSE_DESPAWN)) + uiTeleportationPortal = portal->GetGUID(); + } + + void StartBossEncounter(uint8 uiBoss, bool bForceRespawn = true) + { + Creature* pBoss = NULL; + + switch(uiBoss) + { + case BOSS_MORAGG: + HandleGameObject(uiMoraggCell,bForceRespawn); + pBoss = instance->GetCreature(uiMoragg); + if (pBoss) + pBoss->GetMotionMaster()->MovePoint(0, BossStartMove1); + break; + case BOSS_EREKEM: + HandleGameObject(uiErekemCell, bForceRespawn); + HandleGameObject(uiErekemRightGuardCell, bForceRespawn); + HandleGameObject(uiErekemLeftGuardCell, bForceRespawn); + + pBoss = instance->GetCreature(uiErekem); + + if (pBoss) + pBoss->GetMotionMaster()->MovePoint(0, BossStartMove2); + + if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0])) + { + if (bForceRespawn) + pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + else + pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard1->GetMotionMaster()->MovePoint(0, BossStartMove21); + } + + if (Creature* pGuard2 = instance->GetCreature(uiErekemGuard[1])) + { + if (bForceRespawn) + pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + else + pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pGuard2->GetMotionMaster()->MovePoint(0, BossStartMove22); + } + break; + case BOSS_ICHORON: + HandleGameObject(uiIchoronCell,bForceRespawn); + pBoss = instance->GetCreature(uiIchoron); + if (pBoss) + pBoss->GetMotionMaster()->MovePoint(0, BossStartMove3); + break; + case BOSS_LAVANTHOR: + HandleGameObject(uiLavanthorCell,bForceRespawn); + pBoss = instance->GetCreature(uiLavanthor); + if (pBoss) + pBoss->GetMotionMaster()->MovePoint(0, BossStartMove4); + break; + case BOSS_XEVOZZ: + HandleGameObject(uiXevozzCell,bForceRespawn); + pBoss = instance->GetCreature(uiXevozz); + if (pBoss) + pBoss->GetMotionMaster()->MovePoint(0, BossStartMove5); + break; + case BOSS_ZURAMAT: + HandleGameObject(uiZuramatCell,bForceRespawn); + pBoss = instance->GetCreature(uiZuramat); + if (pBoss) + pBoss->GetMotionMaster()->MovePoint(0, BossStartMove6); + break; + } + + // generic boss state changes + if (pBoss) + { + pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pBoss->SetReactState(REACT_AGGRESSIVE); + + if (!bForceRespawn) + { + if (pBoss->isDead()) + { + // respawn but avoid to be looted again + pBoss->Respawn(); + pBoss->RemoveLootMode(1); + } + pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + uiWaveCount = 0; + } + } + } + + void AddWave() + { + DoUpdateWorldState(WORLD_STATE_VH, 1); + DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, uiWaveCount); + + switch(uiWaveCount) + { + case 6: + if (uiFirstBoss == 0) + uiFirstBoss = urand(1,6); + if (Creature *pSinclari = instance->GetCreature(uiSinclari)) + { + if(Creature *pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL, MiddleRoomPortalSaboLocation, TEMPSUMMON_CORPSE_DESPAWN)) + uiSaboteurPortal = pPortal->GetGUID(); + if (Creature *pAzureSaboteur = pSinclari->SummonCreature(CREATURE_SABOTEOUR, MiddleRoomLocation, TEMPSUMMON_DEAD_DESPAWN)) + pAzureSaboteur->CastSpell(pAzureSaboteur, SABOTEUR_SHIELD_EFFECT, false); + } + break; + case 12: + if (uiSecondBoss == 0) + do + { + uiSecondBoss = urand(1,6); + } while (uiSecondBoss == uiFirstBoss); + if (Creature *pSinclari = instance->GetCreature(uiSinclari)) + { + if(Creature *pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL, MiddleRoomPortalSaboLocation, TEMPSUMMON_CORPSE_DESPAWN)) + uiSaboteurPortal = pPortal->GetGUID(); + if (Creature *pAzureSaboteur = pSinclari->SummonCreature(CREATURE_SABOTEOUR, MiddleRoomLocation, TEMPSUMMON_DEAD_DESPAWN)) + pAzureSaboteur->CastSpell(pAzureSaboteur, SABOTEUR_SHIELD_EFFECT, false); + } + break; + case 18: + { + Creature *pSinclari = instance->GetCreature(uiSinclari); + if (pSinclari) + pSinclari->SummonCreature(CREATURE_CYANIGOSA,CyanigosasSpawnLocation,TEMPSUMMON_DEAD_DESPAWN); + break; + } + case 1: + { + if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) + pMainDoor->SetGoState(GO_STATE_READY); + DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, 100); + } + default: + SpawnPortal(); + break; + } + } + std::string GetSaveData() { OUT_SAVE_INST_DATA; @@ -483,7 +670,8 @@ struct instance_violet_hold : public ScriptedInstance if (!instance->HavePlayers()) return; - if (bActive) + // portals should spawn if other portal is dead and doors are closed + if (bActive && uiMainEventPhase == IN_PROGRESS) { if (uiActivationTimer < diff) { @@ -493,24 +681,118 @@ struct instance_violet_hold : public ScriptedInstance } else uiActivationTimer -= diff; } - if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) - if (pMainDoor->GetGoState() != GO_STATE_ACTIVE && CheckWipe()) - { - SetData(DATA_REMOVE_NPC, 1); - StartBossEncounter(uiFirstBoss, false); - StartBossEncounter(uiSecondBoss, false); - bWiped = true; - if (Creature* pSinclari = instance->GetCreature(uiSinclari)) - { - pSinclari->DisappearAndDie(); - pSinclari->Respawn(true); - } + // if main event is in progress and players have wiped then reset instance + if ( uiMainEventPhase == IN_PROGRESS && CheckWipe()) + { + SetData(DATA_REMOVE_NPC, 1); + StartBossEncounter(uiFirstBoss, false); + StartBossEncounter(uiSecondBoss, false); - if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor)) - pMainDoor->SetGoState(GO_STATE_ACTIVE); - SetData(DATA_WAVE_COUNT, 0); + SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE); + SetData(DATA_WAVE_COUNT, 0); + uiMainEventPhase = NOT_STARTED; + + if (Creature* pSinclari = instance->GetCreature(uiSinclari)) + { + pSinclari->SetVisibility(VISIBILITY_ON); + + std::list GuardList; + pSinclari->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f); + if (!GuardList.empty()) + { + for (std::list::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr) + { + if (Creature* pGuard = *itr) + { + pGuard->SetVisibility(VISIBILITY_ON); + pGuard->SetReactState(REACT_AGGRESSIVE); + pGuard->GetMotionMaster()->MovePoint(1,pGuard->GetHomePosition()); + } + } + } + pSinclari->GetMotionMaster()->MovePoint(1,pSinclari->GetHomePosition()); + pSinclari->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); } + } + + // Cyanigosa is spawned but not tranformed, prefight event + Creature *pCyanigosa = instance->GetCreature(uiCyanigosa); + if (pCyanigosa && !pCyanigosa->HasAura(CYANIGOSA_SPELL_TRANSFORM)) + { + if (uiCyanigosaEventTimer <= diff) + { + switch(uiCyanigosaEventPhase) + { + case 1: + pCyanigosa->CastSpell(pCyanigosa, CYANIGOSA_BLUE_AURA, false); + DoScriptText(CYANIGOSA_SAY_SPAWN, pCyanigosa); + uiCyanigosaEventTimer = 7*IN_MILLISECONDS; + ++uiCyanigosaEventPhase; + break; + case 2: + pCyanigosa->GetMotionMaster()->MoveJump(MiddleRoomLocation.GetPositionX(), MiddleRoomLocation.GetPositionY(), MiddleRoomLocation.GetPositionZ(), 10.0f, 20.0f); + pCyanigosa->CastSpell(pCyanigosa, CYANIGOSA_BLUE_AURA, false); + uiCyanigosaEventTimer = 7*IN_MILLISECONDS; + ++uiCyanigosaEventPhase; + break; + case 3: + pCyanigosa->RemoveAurasDueToSpell(CYANIGOSA_BLUE_AURA); + pCyanigosa->CastSpell(pCyanigosa, CYANIGOSA_SPELL_TRANSFORM, 0); + pCyanigosa->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE); + pCyanigosa->SetReactState(REACT_AGGRESSIVE); + uiCyanigosaEventTimer = 2*IN_MILLISECONDS; + ++uiCyanigosaEventPhase; + break; + case 4: + uiCyanigosaEventPhase = 0; + break; + } + } else uiCyanigosaEventTimer -= diff; + } + + // if there are NPCs in front of the prison door, which are casting the door seal spell and doors are active + if (GetData(DATA_NPC_PRESENCE_AT_DOOR) && uiMainEventPhase == IN_PROGRESS) + { + // if door integrity is > 0 then decrase it's integrity state + if(GetData(DATA_DOOR_INTEGRITY)) + { + if(uiDoorSpellTimer < diff) + { + SetData(DATA_DOOR_INTEGRITY,GetData(DATA_DOOR_INTEGRITY)-1); + uiDoorSpellTimer =2000; + } else uiDoorSpellTimer -= diff; + } + // else set door state to active (means door will open and group have failed to sustain mob invasion on the door) + else + { + SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE); + uiMainEventPhase = FAIL; + } + } } + + void ActivateCrystal() + { + // Kill all mobs registered with SetData64(ADD_TRASH_MOB) + // TODO: All visual, spells etc + for (std::set::const_iterator itr = trashMobs.begin(); itr != trashMobs.end(); ++itr) + { + Creature* pCreature = instance->GetCreature(*itr); + if (pCreature && pCreature->isAlive()) + pCreature->CastSpell(pCreature,SPELL_ARCANE_LIGHTNING,true); // Who should cast the spell? + } + } + + void ProcessEvent(GameObject* pGO, uint32 uiEventId) + { + switch(uiEventId) + { + case EVENT_ACTIVATE_CRYSTAL: + bCrystalActivated = true; // Activation by player's will throw event signal + ActivateCrystal(); + break; + } +} }; InstanceData* GetInstanceData_instance_violet_hold(Map* pMap) diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 49883b5dbf3..1267ede8be6 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -1,36 +1,252 @@ -#include "ScriptedPch.h" +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + +#include "ScriptPCH.h" +#include "ScriptedEscortAI.h" #include "violet_hold.h" #define GOSSIP_START_EVENT "Get your people to safety, we'll keep the Blue Dragonflight's forces at bay." #define GOSSIP_ITEM_1 "Activate the crystals when we get in trouble, right" +#define GOSSIP_I_WANT_IN "Sorry, I'm late! Can I get in to help my friends?" #define SPAWN_TIME 20000 enum PortalCreatures { - CREATURE_AZURE_INVADER = 30661, - CREATURE_AZURE_SPELLBREAKER = 30662, - CREATURE_AZURE_BINDER = 30663, - CREATURE_AZURE_MAGE_SLAYER = 30664, + CREATURE_AZURE_INVADER_1 = 30661, + CREATURE_AZURE_INVADER_2 = 30961, + CREATURE_AZURE_SPELLBREAKER_1 = 30662, + CREATURE_AZURE_SPELLBREAKER_2 = 30962, + CREATURE_AZURE_BINDER_1 = 30663, + CREATURE_AZURE_BINDER_2 = 30918, + CREATURE_AZURE_MAGE_SLAYER_1 = 30664, + CREATURE_AZURE_MAGE_SLAYER_2 = 30963, CREATURE_AZURE_CAPTAIN = 30666, CREATURE_AZURE_SORCEROR = 30667, CREATURE_AZURE_RAIDER = 30668, CREATURE_AZURE_STALKER = 32191 }; +enum AzureInvaderSpells +{ + SPELL_CLEAVE = 15496, + SPELL_IMPALE = 58459, + H_SPELL_IMPALE = 59256, + SPELL_BRUTAL_STRIKE = 58460, + SPELL_SUNDER_ARMOR = 58461 +}; + +enum AzureSellbreakerSpells +{ + SPELL_ARCANE_BLAST = 58462, + H_SPELL_ARCANE_BLAST = 59257, + SPELL_SLOW = 25603, + SPELL_CHAINS_OF_ICE = 58464, + SPELL_CONE_OF_COLD = 58463, + H_SPELL_CONE_OF_COLD = 59258 +}; + +enum AzureBinderSpells +{ + SPELL_ARCANE_BARRAGE = 58456, + H_SPELL_ARCANE_BARRAGE = 59248, + SPELL_ARCANE_EXPLOSION = 58455, + H_SPELL_ARCANE_EXPLOSION = 59245, + SPELL_FROST_NOVA = 58458, + H_SPELL_FROST_NOVA = 59253, + SPELL_FROSTBOLT = 58457, + H_SPELL_FROSTBOLT = 59251, +}; + +enum AzureMageSlayerSpells +{ + SPELL_ARCANE_EMPOWERMENT = 58469, + SPELL_SPELL_LOCK = 30849 +}; + +enum AzureCaptainSpells +{ + SPELL_MORTAL_STRIKE = 32736, + SPELL_WHIRLWIND_OF_STEEL = 41057 +}; + +enum AzureSorcerorSpells +{ + SPELL_ARCANE_STREAM = 60181, + H_SPELL_ARCANE_STREAM = 60204, + SPELL_MANA_DETONATION = 60182, + H_SPELL_MANA_DETONATION = 60205 +}; + +enum AzureRaiderSpells +{ + SPELL_CONCUSSION_BLOW = 52719, + SPELL_MAGIC_REFLECTION = 60158 +}; + +enum AzureStalkerSpells +{ + SPELL_BACKSTAB = 58471, + SPELL_TACTICAL_BLINK = 58470 +}; + +enum AzureSaboteurSpells +{ + SABOTEUR_SHIELD_DISRUPTION = 58291, + SABOTEUR_SHIELD_EFFECT = 45775 +}; + +enum TrashDoorSpell +{ + SPELL_DESTROY_DOOR_SEAL = 58040 +}; + enum Spells { - SPELL_PORTAL_CHANNEL = 58012 + SPELL_PORTAL_CHANNEL = 58012, + SPELL_CRYSTALL_ACTIVATION = 57804 }; enum eSinclari { - NPC_VIOLET_HOLD_GUARD = 30659, - - SAY_SINCLARI_1 = -1608045, + SAY_SINCLARI_1 = -1608045 }; -const Position DoorPosition = { 1828.300049, 797.309021, 46.135502, 1.48353}; -const Position MovePosition = { 1806.955566, 803.851807, 44.363323}; +float FirstPortalWPs [6][3] = +{ + {1877.670288, 842.280273, 43.333591}, + {1877.338867, 834.615356, 38.762287}, + {1872.161011, 823.854309, 38.645401}, + {1864.860474, 815.787170, 38.784843}, + {1858.953735, 810.048950, 44.008759}, + {1843.707153, 805.807739, 44.135197} + //{1825.736084, 807.305847, 44.363785} +}; + +float SecondPortalFirstWPs [9][3] = +{ + {1902.561401, 853.334656, 47.106117}, + {1895.486084, 855.376404, 44.334591}, + {1882.805176, 854.993286, 43.333591}, + {1877.670288, 842.280273, 43.333591}, + {1877.338867, 834.615356, 38.762287}, + {1872.161011, 823.854309, 38.645401}, + {1864.860474, 815.787170, 38.784843}, + {1858.953735, 810.048950, 44.008759}, + {1843.707153, 805.807739, 44.135197} + //{1825.736084, 807.305847, 44.363785} +}; + +float SecondPortalSecondWPs [8][3] = +{ + {1929.392212, 837.614990, 47.136166}, + {1928.290649, 824.750427, 45.474411}, + {1915.544922, 826.919373, 38.642811}, + {1900.933960, 818.855652, 38.801647}, + {1886.810547, 813.536621, 38.490490}, + {1869.079712, 808.701538, 38.689003}, + {1860.843384, 806.645020, 44.008789}, + {1843.707153, 805.807739, 44.135197} + //{1825.736084, 807.305847, 44.363785} +}; + +float ThirdPortalWPs [8][3] = +{ + {1934.049438, 815.778503, 52.408699}, + {1928.290649, 824.750427, 45.474411}, + {1915.544922, 826.919373, 38.642811}, + {1900.933960, 818.855652, 38.801647}, + {1886.810547, 813.536621, 38.490490}, + {1869.079712, 808.701538, 38.689003}, + {1860.843384, 806.645020, 44.008789}, + {1843.707153, 805.807739, 44.135197} + //{1825.736084, 807.305847, 44.363785} +}; + +float FourthPortalWPs [9][3] = +{ + {1921.658447, 761.657043, 50.866741}, + {1910.559814, 755.780457, 47.701447}, + {1896.664673, 752.920898, 47.667004}, + {1887.398804, 763.633240, 47.666851}, + {1879.020386, 775.396973, 38.705990}, + {1872.439087, 782.568604, 38.808292}, + {1863.573364, 791.173584, 38.743660}, + {1857.811890, 796.765564, 43.950329}, + {1845.577759, 800.681152, 44.104248} + //{1827.100342, 801.605957, 44.363358} +}; + +float FifthPortalWPs [6][3] = +{ + {1887.398804, 763.633240, 47.666851}, + {1879.020386, 775.396973, 38.705990}, + {1872.439087, 782.568604, 38.808292}, + {1863.573364, 791.173584, 38.743660}, + {1857.811890, 796.765564, 43.950329}, + {1845.577759, 800.681152, 44.104248} + //{1827.100342, 801.605957, 44.363358} +}; + +float SixthPoralWPs [4][3] = +{ + {1888.861084, 805.074768, 38.375790}, + {1869.793823, 804.135804, 38.647018}, + {1861.541504, 804.149780, 43.968292}, + {1843.567017, 804.288208, 44.139091} + //{1826.889648, 803.929993, 44.363239} +}; + +const float SaboteurFinalPos1[3][3] = +{ + {1892.502319, 777.410767, 38.630402}, + {1891.165161, 762.969421, 47.666920}, + {1893.168091, 740.919189, 47.666920} +}; +const float SaboteurFinalPos2[3][3] = +{ + {1882.242676, 834.818726, 38.646786}, + {1879.220825, 842.224854, 43.333641}, + {1873.842896, 863.892456, 43.333641} +}; +const float SaboteurFinalPos3[2][3] = +{ + {1904.298340, 792.400391, 38.646782}, + {1935.716919, 758.437073, 30.627895} +}; +const float SaboteurFinalPos4[3] = +{ + 1855.006104, 760.641724, 38.655266 +}; +const float SaboteurFinalPos5[3] = +{ + 1906.667358, 841.705566, 38.637894 +}; +const float SaboteurFinalPos6[5][3] = +{ + {1911.437012, 821.289246, 38.684128}, + {1920.734009, 822.978027, 41.525414}, + {1928.262939, 830.836609, 44.668266}, + {1929.338989, 837.593933, 47.137596}, + {1931.063354, 848.468445, 47.190434} + }; + +const Position MovePosition = {1806.955566, 803.851807, 44.363323}; +const Position playerTeleportPosition = {1830.531006, 803.939758, 44.340508, 6.281611}; +const Position sinclariOutsidePosition = {1817.315674, 804.060608, 44.363998}; struct npc_sinclariAI : public ScriptedAI { @@ -49,7 +265,6 @@ struct npc_sinclariAI : public ScriptedAI uiPhase = 0; uiTimer = 0; - me->SetVisibility(VISIBILITY_ON); me->SetReactState(REACT_AGGRESSIVE); std::list GuardList; @@ -69,22 +284,6 @@ struct npc_sinclariAI : public ScriptedAI } } - void MovementInform(uint32 uiType, uint32 /*uiId*/) - { - if (uiType != POINT_MOTION_TYPE) - return; - - if (pInstance) - { - pInstance->SetData(DATA_WAVE_COUNT,1); - pInstance->SetData(DATA_REMOVE_NPC,0); // might not have been reset after a wipe on a boss. - } - - //She should not be despawned, she will be used by the instance to summon some npcs - me->SetVisibility(VISIBILITY_OFF); - me->SetReactState(REACT_PASSIVE); - } - void UpdateAI(const uint32 uiDiff) { ScriptedAI::UpdateAI(uiDiff); @@ -96,10 +295,10 @@ struct npc_sinclariAI : public ScriptedAI switch(uiPhase) { case 1: - DoScriptText(SAY_SINCLARI_1, me); - uiTimer = 4000; - uiPhase = 2; - break; + DoScriptText(SAY_SINCLARI_1, me); + uiTimer = 4000; + uiPhase = 2; + break; case 2: { std::list GuardList; @@ -135,7 +334,14 @@ struct npc_sinclariAI : public ScriptedAI break; } case 4: - me->GetMotionMaster()->MovePoint(0, MovePosition); + me->GetMotionMaster()->MovePoint(0, sinclariOutsidePosition); + uiTimer = 4000; + uiPhase = 5; + break; + case 5: + if (pInstance) + pInstance->SetData(DATA_MAIN_EVENT_PHASE,IN_PROGRESS); + me->SetReactState(REACT_PASSIVE); uiTimer = 0; uiPhase = 0; break; @@ -158,14 +364,24 @@ CreatureAI* GetAI_npc_sinclari(Creature* pCreature) bool GossipHello_npc_sinclari(Player* pPlayer, Creature* pCreature) { - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - if (pInstance && pInstance->GetData(DATA_CYANIGOSA_EVENT) != DONE && pInstance->GetData(DATA_WAVE_COUNT) == 0 && pPlayer) + if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_START_EVENT,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(13853, pCreature->GetGUID()); - }else - pPlayer->SEND_GOSSIP_MENU(13910, pCreature->GetGUID()); + switch (pInstance->GetData(DATA_MAIN_EVENT_PHASE)) + { + case NOT_STARTED: + case FAIL: // Allow to start event if not started or wiped + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_START_EVENT,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(13853, pCreature->GetGUID()); + break; + case IN_PROGRESS: // Allow to teleport inside if event is in progress + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_I_WANT_IN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(13853, pCreature->GetGUID()); + break; + default: + pPlayer->SEND_GOSSIP_MENU(13910, pCreature->GetGUID()); + } + } return true; } @@ -174,73 +390,235 @@ bool GossipSelect_npc_sinclari(Player* pPlayer, Creature* pCreature, uint32 /*ui switch(uiAction) { case GOSSIP_ACTION_INFO_DEF+1: - if (pPlayer) - pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CLOSE_GOSSIP_MENU(); CAST_AI(npc_sinclariAI, (pCreature->AI()))->uiPhase = 1; + if (ScriptedInstance *pInstance = pCreature->GetInstanceData()) + pInstance->SetData(DATA_MAIN_EVENT_PHASE,SPECIAL); break; case GOSSIP_ACTION_INFO_DEF+2: pPlayer->SEND_GOSSIP_MENU(13854, pCreature->GetGUID()); break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->NearTeleportTo(playerTeleportPosition.GetPositionX(),playerTeleportPosition.GetPositionY(),playerTeleportPosition.GetPositionZ(),playerTeleportPosition.GetOrientation(),true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; } return true; } +struct mob_azure_saboteurAI : public npc_escortAI +{ + mob_azure_saboteurAI(Creature *c):npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + bHasGotMovingPoints = false; + uiBoss = 0; + Reset(); + } + + ScriptedInstance* pInstance; + bool bHasGotMovingPoints; + uint32 uiBoss; + + void Reset() + { + if (pInstance && !uiBoss) + uiBoss = pInstance->GetData(DATA_WAVE_COUNT) == 6 ? pInstance->GetData(DATA_FIRST_BOSS) : pInstance->GetData(DATA_SECOND_BOSS); + } + + void WaypointReached(uint32 uiWPointId) + { + switch(uiBoss) + { + case 1: + if(uiWPointId == 2) + FinishPointReached(); + break; + case 2: + if(uiWPointId == 2) + FinishPointReached(); + break; + case 3: + if(uiWPointId == 1) + FinishPointReached(); + break; + case 4: + if(uiWPointId == 0) + FinishPointReached(); + break; + case 5: + if(uiWPointId == 0) + FinishPointReached(); + break; + case 6: + if(uiWPointId == 4) + FinishPointReached(); + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (pInstance && pInstance->GetData(DATA_MAIN_EVENT_PHASE != IN_PROGRESS)) + me->CastStop(); + + npc_escortAI::UpdateAI(diff); + + if(!bHasGotMovingPoints) + { + bHasGotMovingPoints = true; + switch(uiBoss) + { + case 1: + for(int i=0;i<3;i++) + AddWaypoint(i,SaboteurFinalPos1[i][0],SaboteurFinalPos1[i][1],SaboteurFinalPos1[i][2],0); + me->SetHomePosition(SaboteurFinalPos1[2][0],SaboteurFinalPos1[2][1],SaboteurFinalPos1[2][2],4.762346); + break; + case 2: + for(int i=0;i<3;i++) + AddWaypoint(i,SaboteurFinalPos2[i][0],SaboteurFinalPos2[i][1],SaboteurFinalPos2[i][2],0); + me->SetHomePosition(SaboteurFinalPos2[2][0],SaboteurFinalPos2[2][1],SaboteurFinalPos2[2][2],1.862674); + break; + case 3: + for(int i=0;i<2;i++) + AddWaypoint(i,SaboteurFinalPos3[i][0],SaboteurFinalPos3[i][1],SaboteurFinalPos3[i][2],0); + me->SetHomePosition(SaboteurFinalPos3[1][0],SaboteurFinalPos3[1][1],SaboteurFinalPos3[1][2],5.500638); + break; + case 4: + AddWaypoint(0,SaboteurFinalPos4[0],SaboteurFinalPos4[1],SaboteurFinalPos4[2],0); + me->SetHomePosition(SaboteurFinalPos4[0],SaboteurFinalPos4[1],SaboteurFinalPos4[2],3.991108); + break; + case 5: + AddWaypoint(0,SaboteurFinalPos5[0],SaboteurFinalPos5[1],SaboteurFinalPos5[2],0); + me->SetHomePosition(SaboteurFinalPos5[0],SaboteurFinalPos5[1],SaboteurFinalPos5[2],1.100841); + break; + case 6: + for(int i=0;i<5;i++) + AddWaypoint(i,SaboteurFinalPos6[i][0],SaboteurFinalPos6[i][1],SaboteurFinalPos6[i][2],0); + me->SetHomePosition(SaboteurFinalPos6[4][0],SaboteurFinalPos6[4][1],SaboteurFinalPos6[4][2],0.983031); + break; + } + + SetDespawnAtEnd(false); + Start(true,true); + } + } + + void FinishPointReached() + { + me->CastSpell(me, SABOTEUR_SHIELD_DISRUPTION, false); + me->DisappearAndDie(); + Creature* pSaboPort = Unit::GetCreature((*me),pInstance->GetData64(DATA_SABOTEUR_PORTAL)); + if (pSaboPort) + pSaboPort->DisappearAndDie(); + pInstance->SetData(DATA_START_BOSS_ENCOUNTER, 1); + } +}; + +CreatureAI* GetAI_mob_azure_saboteur(Creature* pCreature) +{ + return new mob_azure_saboteurAI (pCreature); +} + struct npc_teleportation_portalAI : public ScriptedAI { - npc_teleportation_portalAI(Creature *c) : ScriptedAI(c) + npc_teleportation_portalAI(Creature *c) : ScriptedAI(c), listOfMobs(me) { pInstance = c->GetInstanceData(); + uiTypeOfMobsPortal = urand(0,1); // 0 - elite mobs 1 - portal guardian or portal keeper with regular mobs + bPortalGuardianOrKeeperOrEliteSpawn = false; } uint32 uiSpawnTimer; - bool bPortalGuardianOrKeeperSpawn; + bool bPortalGuardianOrKeeperOrEliteSpawn; + uint8 uiTypeOfMobsPortal; + + SummonList listOfMobs; ScriptedInstance *pInstance; void Reset() { uiSpawnTimer = 10000; - bPortalGuardianOrKeeperSpawn = false; + bPortalGuardianOrKeeperOrEliteSpawn = false; } void EnterCombat(Unit * /*who*/) {} + void MoveInLineOfSight(Unit * /*who*/) {} void UpdateAI(const uint32 diff) { - if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1) + if (!pInstance) //Massive usage of pInstance, global check + return; + + if (pInstance->GetData(DATA_REMOVE_NPC) == 1) { me->ForcedDespawn(); pInstance->SetData(DATA_REMOVE_NPC, 0); } - if (uiSpawnTimer <= diff) - { - if (bPortalGuardianOrKeeperSpawn) - { - uint8 k = pInstance->GetData(DATA_WAVE_COUNT) < 12 ? 2 : 3; - for (uint8 i = 0; i < k; ++i) - { - uint32 entry = RAND(CREATURE_AZURE_CAPTAIN,CREATURE_AZURE_RAIDER,CREATURE_AZURE_STALKER,CREATURE_AZURE_SORCEROR); - if (Creature* pSummon = DoSummon(entry, me, 2.0f, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT)) - pSummon->GetMotionMaster()->MovePoint(0, DoorPosition); - } - } - else - { - bPortalGuardianOrKeeperSpawn = true; - uint32 entry = RAND(CREATURE_PORTAL_GUARDIAN, CREATURE_PORTAL_KEEPER); - if (Creature *pPortalKeeper = DoSummon(entry, me, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN)) - me->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL, false); - } - uiSpawnTimer = SPAWN_TIME; - } else uiSpawnTimer -= diff; - - if (bPortalGuardianOrKeeperSpawn && !me->IsNonMeleeSpellCasted(false)) - { - me->Kill(me, false); - me->RemoveCorpse(); + uint8 uiWaveCount = pInstance->GetData(DATA_WAVE_COUNT); + if ((uiWaveCount == 6) || (uiWaveCount == 12)) //Don't spawn mobs on boss encounters return; + + switch(uiTypeOfMobsPortal) + { + // spawn elite mobs and then set portals visibility to make it look like it dissapeard + case 0: + if (!bPortalGuardianOrKeeperOrEliteSpawn) + { + if (uiSpawnTimer <= diff) + { + bPortalGuardianOrKeeperOrEliteSpawn = true; + uint8 k = uiWaveCount < 12 ? 2 : 3; + for (uint8 i = 0; i < k; ++i) + { + uint32 entry = RAND(CREATURE_AZURE_CAPTAIN,CREATURE_AZURE_RAIDER,CREATURE_AZURE_STALKER,CREATURE_AZURE_SORCEROR); + DoSummon(entry, me, 2.0f, 20000, TEMPSUMMON_DEAD_DESPAWN); + } + me->SetVisibility(VISIBILITY_OFF); + } else uiSpawnTimer -= diff; + } + else + { + // if all spawned elites have died kill portal + if (listOfMobs.empty()) + { + me->Kill(me, false); + me->RemoveCorpse(); + } + } + break; + // spawn portal guardian or portal keeper with regular mobs + case 1: + if (uiSpawnTimer <= diff) + { + if (bPortalGuardianOrKeeperOrEliteSpawn) + { + uint8 k = pInstance->GetData(DATA_WAVE_COUNT) < 12 ? 3 : 4; + for (uint8 i = 0; i < k; ++i) + { + uint32 entry = RAND(CREATURE_AZURE_INVADER_1,CREATURE_AZURE_INVADER_2,CREATURE_AZURE_SPELLBREAKER_1,CREATURE_AZURE_SPELLBREAKER_2,CREATURE_AZURE_MAGE_SLAYER_1,CREATURE_AZURE_MAGE_SLAYER_2,CREATURE_AZURE_BINDER_1,CREATURE_AZURE_BINDER_2); + DoSummon(entry, me, 2.0f, 20000, TEMPSUMMON_DEAD_DESPAWN); + } + } + else + { + bPortalGuardianOrKeeperOrEliteSpawn = true; + uint32 entry = RAND(CREATURE_PORTAL_GUARDIAN, CREATURE_PORTAL_KEEPER); + if (Creature *pPortalKeeper = DoSummon(entry, me, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN)) + me->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL, false); + } + uiSpawnTimer = SPAWN_TIME; + } else uiSpawnTimer -= diff; + + if (bPortalGuardianOrKeeperOrEliteSpawn && !me->IsNonMeleeSpellCasted(false)) + { + me->Kill(me, false); + me->RemoveCorpse(); + } + break; } } @@ -249,6 +627,20 @@ struct npc_teleportation_portalAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_WAVE_COUNT,pInstance->GetData(DATA_WAVE_COUNT)+1); } + + void JustSummoned(Creature *pSummoned) + { + listOfMobs.Summon(pSummoned); + if (pSummoned) + pInstance->SetData64(DATA_ADD_TRASH_MOB,pSummoned->GetGUID()); + } + + void SummonedMobDied(Creature *pSummoned) + { + listOfMobs.Despawn(pSummoned); + if (pSummoned) + pInstance->SetData64(DATA_DEL_TRASH_MOB,pSummoned->GetGUID()); + } }; CreatureAI* GetAI_npc_teleportation_portal(Creature *pCreature) @@ -256,6 +648,596 @@ CreatureAI* GetAI_npc_teleportation_portal(Creature *pCreature) return new npc_teleportation_portalAI(pCreature); } +struct violet_hold_trashAI : public npc_escortAI +{ + violet_hold_trashAI(Creature *c):npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + bHasGotMovingPoints = false; + if (pInstance) + portalLocationID = pInstance->GetData(DATA_PORTAL_LOCATION); + Reset(); + } + + public: + ScriptedInstance* pInstance; + bool bHasGotMovingPoints; + uint32 portalLocationID; + uint32 secondPortalRouteID; + + void WaypointReached(uint32 uiPointId) + { + switch(portalLocationID) + { + case 0: + if (uiPointId == 5) + CreatureStartAttackDoor(me->GetGUID()); + break; + case 1: + if ((uiPointId == 8 && secondPortalRouteID == 0) || (uiPointId == 7 && secondPortalRouteID == 1)) + CreatureStartAttackDoor(me->GetGUID()); + break; + case 2: + if (uiPointId == 7) + CreatureStartAttackDoor(me->GetGUID()); + break; + case 3: + if (uiPointId == 8) + CreatureStartAttackDoor(me->GetGUID()); + break; + case 4: + if (uiPointId == 5) + CreatureStartAttackDoor(me->GetGUID()); + break; + case 5: + if (uiPointId == 3) + CreatureStartAttackDoor(me->GetGUID()); + break; + } + } + + void UpdateAI(const uint32) + { + if (pInstance && pInstance->GetData(DATA_MAIN_EVENT_PHASE != IN_PROGRESS)) + me->CastStop(); + + if (!bHasGotMovingPoints) + { + bHasGotMovingPoints = true; + switch(portalLocationID) + { + case 0: + for(int i=0;i<6;i++) + AddWaypoint(i,FirstPortalWPs[i][0]+irand(-1,1),FirstPortalWPs[i][1]+irand(-1,1),FirstPortalWPs[i][2]+irand(-1,1),0); + me->SetHomePosition(FirstPortalWPs[5][0],FirstPortalWPs[5][1],FirstPortalWPs[5][2],3.149439); + break; + case 1: + secondPortalRouteID = urand(0,1); + switch(secondPortalRouteID) + { + case 0: + for(int i=0;i<9;i++) + AddWaypoint(i,SecondPortalFirstWPs[i][0]+irand(-1,1),SecondPortalFirstWPs[i][1]+irand(-1,1),SecondPortalFirstWPs[i][2],0); + me->SetHomePosition(SecondPortalFirstWPs[8][0]+irand(-1,1),SecondPortalFirstWPs[8][1]+irand(-1,1),SecondPortalFirstWPs[8][2]+irand(-1,1),3.149439); + break; + case 1: + for(int i=0;i<8;i++) + AddWaypoint(i,SecondPortalSecondWPs[i][0]+irand(-1,1),SecondPortalSecondWPs[i][1]+irand(-1,1),SecondPortalSecondWPs[i][2],0); + me->SetHomePosition(SecondPortalSecondWPs[7][0],SecondPortalSecondWPs[7][1],SecondPortalSecondWPs[7][2],3.149439); + break; + } + break; + case 2: + for(int i=0;i<8;i++) + AddWaypoint(i,ThirdPortalWPs[i][0]+irand(-1,1),ThirdPortalWPs[i][1]+irand(-1,1),ThirdPortalWPs[i][2],0); + me->SetHomePosition(ThirdPortalWPs[7][0],ThirdPortalWPs[7][1],ThirdPortalWPs[7][2],3.149439); + break; + case 3: + for(int i=0;i<9;i++) + AddWaypoint(i,FourthPortalWPs[i][0]+irand(-1,1),FourthPortalWPs[i][1]+irand(-1,1),FourthPortalWPs[i][2],0); + me->SetHomePosition(FourthPortalWPs[8][0],FourthPortalWPs[8][1],FourthPortalWPs[8][2],3.149439); + break; + case 4: + for(int i=0;i<6;i++) + AddWaypoint(i,FifthPortalWPs[i][0]+irand(-1,1),FifthPortalWPs[i][1]+irand(-1,1),FifthPortalWPs[i][2],0); + me->SetHomePosition(FifthPortalWPs[5][0],FifthPortalWPs[5][1],FifthPortalWPs[5][2],3.149439); + break; + case 5: + for(int i=0;i<4;i++) + AddWaypoint(i,SixthPoralWPs[i][0]+irand(-1,1),SixthPoralWPs[i][1]+irand(-1,1),SixthPoralWPs[i][2],0); + me->SetHomePosition(SixthPoralWPs[3][0],SixthPoralWPs[3][1],SixthPoralWPs[3][2],3.149439); + break; + } + SetDespawnAtEnd(false); + Start(true,true); + } + } + + void JustDied(Unit *unit) + { + if (Creature* portal = Unit::GetCreature((*me),pInstance->GetData64(DATA_TELEPORTATION_PORTAL))) + CAST_AI(npc_teleportation_portalAI,portal->AI())->SummonedMobDied(me); + if (pInstance) + pInstance->SetData(DATA_NPC_PRESENCE_AT_DOOR_REMOVE,1); + } + + void CreatureStartAttackDoor(uint32 creature_guid) + { + me->SetReactState(REACT_PASSIVE); + DoCast(SPELL_DESTROY_DOOR_SEAL); + if (pInstance) + pInstance->SetData(DATA_NPC_PRESENCE_AT_DOOR_ADD,1); + } + +}; + +struct mob_azure_invaderAI : public violet_hold_trashAI +{ + mob_azure_invaderAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiCleaveTimer; + uint32 uiImpaleTimer; + uint32 uiBrutalStrikeTimer; + uint32 uiSunderArmorTimer; + + void Reset() + { + uiCleaveTimer = 5000; + uiImpaleTimer = 4000; + uiBrutalStrikeTimer = 5000; + uiSunderArmorTimer = 4000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (me->GetEntry() == CREATURE_AZURE_INVADER_1) + { + if (uiCleaveTimer <= diff) + { + DoCast(me->getVictim(),SPELL_CLEAVE); + uiCleaveTimer = 5000; + } else uiCleaveTimer -= diff; + + if (uiImpaleTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,SPELL_IMPALE); + uiImpaleTimer = 4000; + } else uiImpaleTimer -= diff; + } + + if (me->GetEntry() == CREATURE_AZURE_INVADER_2) + { + if (uiBrutalStrikeTimer <= diff) + { + DoCast(me->getVictim(),SPELL_BRUTAL_STRIKE); + uiBrutalStrikeTimer = 5000; + } else uiBrutalStrikeTimer -= diff; + + if (uiSunderArmorTimer <= diff) + { + DoCast(me->getVictim(),SPELL_SUNDER_ARMOR); + uiSunderArmorTimer = urand(8000,10000); + } else uiSunderArmorTimer -= diff; + + DoMeleeAttackIfReady(); + } + + DoMeleeAttackIfReady(); + } + +}; + +struct mob_azure_spellbreakerAI : public violet_hold_trashAI +{ + mob_azure_spellbreakerAI(Creature* c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiArcaneBlastTimer; + uint32 uiSlowTimer; + uint32 uiChainsOfIceTimer; + uint32 uiConeOfColdTimer; + + void Reset() + { + uiArcaneBlastTimer = 5000; + uiSlowTimer = 4000; + uiChainsOfIceTimer = 5000; + uiConeOfColdTimer = 4000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (me->GetEntry() == CREATURE_AZURE_SPELLBREAKER_1) + { + if (uiArcaneBlastTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,DUNGEON_MODE(SPELL_ARCANE_BLAST,H_SPELL_ARCANE_BLAST)); + uiArcaneBlastTimer = 6000; + } else uiArcaneBlastTimer -= diff; + + if (uiSlowTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,SPELL_SLOW); + uiSlowTimer = 5000; + } else uiSlowTimer -= diff; + } + + if (me->GetEntry() == CREATURE_AZURE_SPELLBREAKER_2) + { + if (uiChainsOfIceTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,SPELL_CHAINS_OF_ICE); + uiChainsOfIceTimer = 7000; + } else uiChainsOfIceTimer -= diff; + + if (uiConeOfColdTimer <= diff) + { + DoCast(DUNGEON_MODE(SPELL_CONE_OF_COLD,H_SPELL_CONE_OF_COLD)); + uiConeOfColdTimer = 5000; + } else uiConeOfColdTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct mob_azure_binderAI : public violet_hold_trashAI +{ + mob_azure_binderAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiArcaneExplosionTimer; + uint32 uiArcainBarrageTimer; + uint32 uiFrostNovaTimer; + uint32 uiFrostboltTimer; + + void Reset() + { + uiArcaneExplosionTimer = 5000; + uiArcainBarrageTimer = 4000; + uiFrostNovaTimer = 5000; + uiFrostboltTimer = 4000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (me->GetEntry() == CREATURE_AZURE_BINDER_1) + { + if (uiArcaneExplosionTimer <= diff) + { + DoCast(DUNGEON_MODE(SPELL_ARCANE_EXPLOSION,H_SPELL_ARCANE_EXPLOSION)); + uiArcaneExplosionTimer = 5000; + } else uiArcaneExplosionTimer -= diff; + + if (uiArcainBarrageTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,DUNGEON_MODE(SPELL_ARCANE_BARRAGE,H_SPELL_ARCANE_BARRAGE)); + uiArcainBarrageTimer = 6000; + } else uiArcainBarrageTimer -= diff; + } + + if (me->GetEntry() == CREATURE_AZURE_BINDER_2) + { + if (uiFrostNovaTimer <= diff) + { + DoCast(DUNGEON_MODE(SPELL_FROST_NOVA,H_SPELL_FROST_NOVA)); + uiFrostNovaTimer = 5000; + } else uiFrostNovaTimer -= diff; + + if (uiFrostboltTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,DUNGEON_MODE(SPELL_FROSTBOLT,H_SPELL_FROSTBOLT)); + uiFrostboltTimer = 6000; + } else uiFrostboltTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct mob_azure_mage_slayerAI : public violet_hold_trashAI +{ + mob_azure_mage_slayerAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiArcaneEmpowermentTimer; + uint32 uiSpellLockTimer; + + void Reset() + { + uiArcaneEmpowermentTimer = 5000; + uiSpellLockTimer = 5000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (me->GetEntry() == CREATURE_AZURE_MAGE_SLAYER_1) + { + if (uiArcaneEmpowermentTimer <= diff) + { + DoCast(me,SPELL_ARCANE_EMPOWERMENT); + uiArcaneEmpowermentTimer = 14000; + } else uiArcaneEmpowermentTimer -= diff; + } + + if (me->GetEntry() == CREATURE_AZURE_MAGE_SLAYER_2) + { + if (uiSpellLockTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,SPELL_SPELL_LOCK); + uiSpellLockTimer = 9000; + } else uiSpellLockTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct mob_azure_captainAI : public violet_hold_trashAI +{ + mob_azure_captainAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiMortalStrikeTimer; + uint32 uiWhirlwindTimer; + + void Reset() + { + uiMortalStrikeTimer = 5000; + uiWhirlwindTimer = 8000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (uiMortalStrikeTimer <= diff) + { + DoCast(me->getVictim(),SPELL_MORTAL_STRIKE); + uiMortalStrikeTimer = 5000; + } else uiMortalStrikeTimer -= diff; + + if (uiWhirlwindTimer <= diff) + { + DoCast(me,SPELL_WHIRLWIND_OF_STEEL); + uiWhirlwindTimer = 8000; + } else uiWhirlwindTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_azure_sorcerorAI : public violet_hold_trashAI +{ + mob_azure_sorcerorAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiArcaneStreamTimer; + uint32 uiArcaneStreamTimerStartingValueHolder; + uint32 uiManaDetonationTimer; + + void Reset() + { + uiArcaneStreamTimer = 4000; + uiArcaneStreamTimerStartingValueHolder = uiArcaneStreamTimer; + uiManaDetonationTimer = 5000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (uiArcaneStreamTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget,DUNGEON_MODE(SPELL_ARCANE_STREAM,H_SPELL_ARCANE_STREAM)); + uiArcaneStreamTimer = urand(0,5000)+5000; + uiArcaneStreamTimerStartingValueHolder = uiArcaneStreamTimer; + } else uiArcaneStreamTimer -= diff; + + if (uiManaDetonationTimer <= diff && uiArcaneStreamTimer >=1500 && uiArcaneStreamTimer <= uiArcaneStreamTimerStartingValueHolder/2) + { + DoCast(DUNGEON_MODE(SPELL_MANA_DETONATION,H_SPELL_MANA_DETONATION)); + uiManaDetonationTimer = urand(2000,6000); + } else uiManaDetonationTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_azure_raiderAI : public violet_hold_trashAI +{ + mob_azure_raiderAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 uiConcussionBlowTimer; + uint32 uiMagicReflectionTimer; + + void Reset() + { + uiConcussionBlowTimer = 5000; + uiMagicReflectionTimer = 8000; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (uiConcussionBlowTimer <= diff) + { + DoCast(me->getVictim(),SPELL_CONCUSSION_BLOW); + uiConcussionBlowTimer = 5000; + } else uiConcussionBlowTimer -= diff; + + if (uiMagicReflectionTimer <= diff) + { + DoCast(SPELL_MAGIC_REFLECTION); + uiMagicReflectionTimer = urand(10000,15000); + } else uiMagicReflectionTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_azure_stalkerAI : public violet_hold_trashAI +{ + mob_azure_stalkerAI(Creature *c) : violet_hold_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + uint32 uiBackstabTimer; + uint32 uiTacticalBlinkTimer; + bool TacticalBlinkCasted; + + void Reset() + { + uiBackstabTimer = 1300; + uiTacticalBlinkTimer = 8000; + TacticalBlinkCasted =false; + } + + void UpdateAI(const uint32 diff) + { + violet_hold_trashAI::UpdateAI(diff); + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (!TacticalBlinkCasted) + { + if (uiTacticalBlinkTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true); + if (pTarget) + DoCast(pTarget,SPELL_TACTICAL_BLINK); + uiTacticalBlinkTimer = 6000; + TacticalBlinkCasted = true; + } else uiTacticalBlinkTimer -= diff; + } + + else + { + if (uiBackstabTimer <= diff) + { + Unit* pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0, 10, true); + DoCast(pTarget,SPELL_BACKSTAB); + TacticalBlinkCasted = false; + uiBackstabTimer =1300; + } else uiBackstabTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_azure_invader(Creature* pCreature) +{ + return new mob_azure_invaderAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_spellbreaker(Creature* pCreature) +{ + return new mob_azure_spellbreakerAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_binder(Creature* pCreature) +{ + return new mob_azure_binderAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_mage_slayer(Creature* pCreature) +{ + return new mob_azure_mage_slayerAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_captain(Creature* pCreature) +{ + return new mob_azure_captainAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_sorceror(Creature* pCreature) +{ + return new mob_azure_sorcerorAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_raider(Creature* pCreature) +{ + return new mob_azure_raiderAI (pCreature); +} + +CreatureAI* GetAI_mob_azure_stalker(Creature* pCreature) +{ + return new mob_azure_stalkerAI (pCreature); +} + void AddSC_violet_hold() { Script *newscript; @@ -271,4 +1253,49 @@ void AddSC_violet_hold() newscript->Name = "npc_teleportation_portal_vh"; newscript->GetAI = &GetAI_npc_teleportation_portal; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_invader"; + newscript->GetAI = &GetAI_mob_azure_invader; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_spellbreaker"; + newscript->GetAI = &GetAI_mob_azure_invader; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_binder"; + newscript->GetAI = &GetAI_mob_azure_binder; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_mage_slayer"; + newscript->GetAI = &GetAI_mob_azure_mage_slayer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_captain"; + newscript->GetAI = &GetAI_mob_azure_captain; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_sorceror"; + newscript->GetAI = &GetAI_mob_azure_sorceror; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_raider"; + newscript->GetAI = &GetAI_mob_azure_raider; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_stalker"; + newscript->GetAI = &GetAI_mob_azure_stalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_azure_saboteur"; + newscript->GetAI = &GetAI_mob_azure_saboteur; + newscript->RegisterSelf(); } diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.h b/src/server/scripts/Northrend/VioletHold/violet_hold.h index 4476d5e823a..0d55b9bfae8 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.h +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.h @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_VIOLET_HOLD_H #define DEF_VIOLET_HOLD_H @@ -14,7 +31,9 @@ enum Creatures CREATURE_EREKEM_GUARD = 29395, CREATURE_MORAGG = 29316, CREATURE_CYANIGOSA = 31134, - CREATURE_SINCLARI = 30658 + CREATURE_SINCLARI = 30658, + CREATURE_SABOTEOUR = 31079, + NPC_VIOLET_HOLD_GUARD = 30659 }; enum Data @@ -23,7 +42,17 @@ enum Data DATA_2ND_BOSS_EVENT, DATA_CYANIGOSA_EVENT, DATA_WAVE_COUNT, - DATA_REMOVE_NPC + DATA_REMOVE_NPC, + DATA_PORTAL_LOCATION, + DATA_DOOR_INTEGRITY, + DATA_NPC_PRESENCE_AT_DOOR, + DATA_NPC_PRESENCE_AT_DOOR_ADD, + DATA_NPC_PRESENCE_AT_DOOR_REMOVE, + DATA_START_BOSS_ENCOUNTER, + DATA_FIRST_BOSS, + DATA_SECOND_BOSS, + DATA_ACTIVATE_CRYSTAL, + DATA_MAIN_EVENT_PHASE }; enum Data64 @@ -46,7 +75,11 @@ enum Data64 DATA_XEVOZZ_CELL, DATA_ZURAMAT_CELL, DATA_MAIN_DOOR, - DATA_SINCLARI + DATA_SINCLARI, + DATA_TELEPORTATION_PORTAL, + DATA_SABOTEUR_PORTAL, + DATA_ADD_TRASH_MOB, + DATA_DEL_TRASH_MOB }; enum Bosses diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 19d82dc9044..b2b975f54ab 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -35,7 +37,7 @@ npc_lurgglbr npc_nexus_drake_hatchling EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" @@ -2108,7 +2110,7 @@ struct npc_warmage_coldarraAI : public Scripted_NoMovementAI m_uiTimer = 0; } - void Aggro(Unit* /*pWho*/) {} + void EnterCombat(Unit* /*pWho*/) {} void AttackStart(Unit* /*pWho*/) {} diff --git a/src/server/scripts/Northrend/crystalsong_forest.cpp b/src/server/scripts/Northrend/crystalsong_forest.cpp index 208e9dea5b5..e8743b92db4 100644 --- a/src/server/scripts/Northrend/crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/crystalsong_forest.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2010 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* Script Data Start @@ -24,7 +23,7 @@ SDComment: SDCategory: CrystalsongForest Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /******************************************************* * npc_warmage_violetstand diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index 7d5e76ffe35..a602b84fcf0 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* Script Data Start @@ -24,7 +23,7 @@ SDComment: For what is 63990+63991? Same function but don't work correct... SDCategory: Dalaran Script Data End */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /******************************************************* * npc_mageguard_dalaran @@ -53,7 +52,7 @@ struct npc_mageguard_dalaranAI : public Scripted_NoMovementAI void Reset(){} - void Aggro(Unit* /*pWho*/){} + void EnterCombat(Unit* /*pWho*/){} void AttackStart(Unit* /*pWho*/){} diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 4f26ec1de1a..f79deb594b0 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_alexstrasza_wr_gate EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" enum eEnums diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index 4b6d65a9764..bb0971c8904 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_orsonn_and_kodian EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg." diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 172501e2faa..7b2fb06986e 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -1,18 +1,18 @@ -/* Copyright (C) 2008-2010 Trinity +/* + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -27,7 +27,7 @@ npc_plaguehound_tracker npc_apothecary_hanes EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp index 76608bdb73d..a40d363eeb8 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/icecrown.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_arete EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## npc_arete diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index b5df8998b4a..cae5012eb3a 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -1,18 +1,18 @@ -/* Copyright (C) 2008-2010 Trinity +/* + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -28,7 +28,7 @@ npc_vekjik avatar_of_freya EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 9275e24bd2f..bcc846be1dc 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -1,21 +1,21 @@ -/* Copyright (C) 2008-2010 Trinity +/* + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index a821ea4ffae..b1574b21f6b 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -1,22 +1,21 @@ /* - * Copyright (C) 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*#### diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index bfde95ffcb0..353da092dba 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ boss_exarch_maladaar mob_avatar_of_martyred EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_MOONFIRE 37328 #define SPELL_FIREBALL 37329 diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index c13e2905171..6c584e16744 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ Comment: InhibitMagic should stack slower far from the boss, proper Visual for F Category: Auchindoun, Auchenai Crypts EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_INHIBITMAGIC 32264 #define SPELL_ATTRACTMAGIC 32265 diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index 5b15178c33e..d38c6d03662 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ boss_nexusprince_shaffar mob_ethereal_beacon EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum ePrince { diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index 51ec2e83b46..da9c0c4a520 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Not known how void blast is done (amount of rapid cast seems to be re SDCategory: Auchindoun, Mana Tombs EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO_1 -1557008 #define SAY_AGGRO_2 -1557009 diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 9628fa1a98f..4a76d46904d 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Shock spells/times need more work. Heroic partly implemented. SDCategory: Auchindoun, Sethekk Halls EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_SUMMON -1556000 diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index 32b97293ca3..83cf669824f 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Heroic supported. Some details missing, but most are spell related. SDCategory: Auchindoun, Sethekk Halls EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sethekk_halls.h" #define SAY_INTRO -1556007 diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp index ee27da3cff5..61b891c7535 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Instance Data for Sethekk Halls instance SDCategory: Auchindoun, Sethekk Halls EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "sethekk_halls.h" enum eEnums @@ -66,7 +68,7 @@ struct instance_sethekk_halls : public ScriptedInstance { case DATA_IKISSDOOREVENT: if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILLISECONDS); break; case TYPE_ANZU_ENCOUNTER: AnzuEncounter = data; diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h index 79a6cd4952d..a1cbc7ce61f 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/sethekk_halls.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SETHEKK_HALLS_H #define DEF_SETHEKK_HALLS_H diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index 2bb6a717a5a..f039b7c7fab 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Enrage spell missing/not known SDCategory: Auchindoun, Shadow Labyrinth EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "shadow_labyrinth.h" diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index 52c60ae0d0e..817b71200f0 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Incite Chaos not functional since core lacks Mind Control support SDCategory: Auchindoun, Shadow Labyrinth EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shadow_labyrinth.h" #define SPELL_INCITE_CHAOS 33676 diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index 8b63b765b47..4234c0c1271 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Auchindoun, Shadow Labyrinth EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shadow_labyrinth.h" #define SAY_INTRO -1555028 diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index 14bf249c3b5..ef6565bb7cf 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Timers may be incorrect SDCategory: Auchindoun, Shadow Labyrinth EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shadow_labyrinth.h" #define EMOTE_SONIC_BOOM -1555036 diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp index 78340e5e132..b5b917547a6 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Some cleanup left along with save SDCategory: Auchindoun, Shadow Labyrinth EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shadow_labyrinth.h" #define MAX_ENCOUNTER 5 @@ -96,7 +98,7 @@ struct instance_shadow_labyrinth : public ScriptedInstance if (pCreature->isAlive()) { ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + sLog.outDebug("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); } break; } @@ -113,7 +115,7 @@ struct instance_shadow_labyrinth : public ScriptedInstance case TYPE_OVERSEER: if (uiData != DONE) { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + sLog.outError("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); return; } if (m_uiFelOverseerCount) @@ -121,11 +123,11 @@ struct instance_shadow_labyrinth : public ScriptedInstance --m_uiFelOverseerCount; if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + sLog.outDebug("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); else { m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + sLog.outDebug("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); } } break; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h index a78955368bf..4bbdbd76c59 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SHADOW_LABYRINTH_H #define DEF_SHADOW_LABYRINTH_H diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index c1e7f19fbb1..bae84641086 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ npc_spirit_of_olum EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" /*### diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h index b7432cd5b20..52ee510efd0 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.h +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_BLACK_TEMPLE_H #define DEF_BLACK_TEMPLE_H diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 1093ce06cb8..b7fee842206 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Bloodboil not working correctly, missing enrage SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" //Speech'n'Sound diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index b8e09c0e08e..7af3aba92f9 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_illidan_stormrage @@ -21,7 +23,7 @@ SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" #define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) @@ -2065,7 +2067,7 @@ void boss_illidan_stormrageAI::SummonMaiev() { EnterEvadeMode(); me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0); - error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); + sLog.outError("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 5949fc46511..cb72486972b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to dama SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" //Speech'n'Sounds diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 3e019a8dc35..1482cb84bd2 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Reliquary_of_Souls @@ -21,7 +23,7 @@ SDComment: SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" #include "Spell.h" diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 94f88d5715c..539b347e6fd 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Seems to be complete. SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" #define SAY_DEATH -1564013 @@ -276,7 +278,7 @@ struct boss_shade_of_akamaAI : public ScriptedAI GridSearcherSucceeded = true; } } - } else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); + } else sLog.outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); } } @@ -293,13 +295,13 @@ struct boss_shade_of_akamaAI : public ScriptedAI if (reseting) return; - debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); + sLog.outDebug("TSCR: Increasing Death Count for Shade of Akama encounter"); ++DeathCount; me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); if (guid) { if (Sorcerers.empty()) - error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); + sLog.outError("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); else Sorcerers.remove(guid); } } @@ -351,17 +353,17 @@ struct boss_shade_of_akamaAI : public ScriptedAI { CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID(); Channelers.push_back((*itr)->GetGUID()); - debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); + sLog.outDebug("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); } } - else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); + else sLog.outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); } void SetSelectableChannelers() { if (Channelers.empty()) { - error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); + sLog.outError("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); return; } @@ -485,7 +487,7 @@ void mob_ashtongue_channelerAI::JustDied(Unit* /*killer*/) Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); if (Shade && Shade->isAlive()) CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); - else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); + else sLog.outError("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); } void mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/) @@ -493,7 +495,7 @@ void mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/) Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); if (Shade && Shade->isAlive()) CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID()); - else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); + else sLog.outError("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); } struct npc_akamaAI : public ScriptedAI diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index bc1ea3ec673..7dc197994fe 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Need to implement molten punch SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" #define EMOTE_NEW_TARGET -1564010 diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 670edc4d869..92b5a0a6134 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Requires Mind Control support for Ghosts. SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" //Speech'n'sound diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 7d94b4b36a0..3f39cb0aea7 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" enum eEnums diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 82cc2876b5a..c5fb8159a41 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Circle of Healing not working properly. SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" //Speech'n'Sounds @@ -143,7 +145,7 @@ struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); Council[2] = pInstance->GetData64(DATA_LADYMALANDE); Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - } else error_log(ERROR_INST_DATA); + } else sLog.outError(ERROR_INST_DATA); } void EnterCombat(Unit* /*who*/) {} @@ -375,7 +377,7 @@ struct boss_illidari_councilAI : public ScriptedAI } else { - error_log(ERROR_INST_DATA); + sLog.outError(ERROR_INST_DATA); EnterEvadeMode(); return; } @@ -423,7 +425,7 @@ struct boss_illidari_councilAI : public ScriptedAI { if (!pInstance) { - error_log(ERROR_INST_DATA); + sLog.outError(ERROR_INST_DATA); return; } diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 88e25026a13..7d5c5a9a3af 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Instance_Black_Temple @@ -21,7 +23,7 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter SDCategory: Black Temple EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "black_temple.h" #define MAX_ENCOUNTER 9 @@ -124,7 +126,7 @@ struct instance_black_temple : public ScriptedInstance } } - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + sLog.outDebug("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 69a969adda0..a99aa661c97 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Cyclone workaround SDCategory: Coilfang Resevoir, Serpent Shrine Cavern EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 923fdf55f80..1e75a4e65fd 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Some details and adjustments left to do, probably nothing major. Spaw SDCategory: Coilfang Resevoir, Serpent Shrine Cavern EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" #define SAY_AGGRO -1548000 diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 2f0485d0e6c..ed3af2453d1 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing blizzlike Shield Generators coords SDCategory: Coilfang Resevoir, Serpent Shrine Cavern EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" #include "ScriptedSimpleAI.h" #include "Spell.h" diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 61c9ed9d527..0392ebaaad8 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Possesion Support SDCategory: Coilfang Resevoir, Serpent Shrine Cavern EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" // --- Spells used by Leotheras The Blind diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index b1c0c10bcce..7bfd50407a6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool SDCategory: The Lurker Below EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" #include "ScriptedSimpleAI.h" #include "Spell.h" diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index 14c87aee141..b040730f1a2 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Morogrim_Tidewalker @@ -21,7 +23,7 @@ SDComment: Water globules don't explode properly, remove hacks SDCategory: Coilfang Resevoir, Serpent Shrine Cavern EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" #define SAY_AGGRO -1548030 @@ -221,9 +223,8 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI { //Teleport 4 players under the waterfalls Unit *pTarget; - using std::set; - setlist; - set::const_iterator itr; + std::set list; + std::set::const_iterator itr; for (uint8 i = 0; i < 4; ++i) { counter = 0; @@ -251,7 +252,7 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI } else WateryGrave_Timer -= diff; //Start Phase2 - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25) + if (HealthBelowPct(25)) Phase2 = true; } else @@ -260,13 +261,13 @@ struct boss_morogrim_tidewalkerAI : public ScriptedAI if (WateryGlobules_Timer <= diff) { Unit* pGlobuleTarget; - using std::set; - setglobulelist; - set::const_iterator itr; + std::set globulelist; + std::set::const_iterator itr; for (uint8 g = 0; g < 4; g++) //one unit can't cast more than one spell per update, so some players have to cast for us XD { counter = 0; - do { + do + { pGlobuleTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); if (pGlobuleTarget) itr = globulelist.find(pGlobuleTarget->GetGUID()); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp index c80afae15c7..05944c1954e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Instance Data Scripts and functions to acquire mobs and set encounter SDCategory: Coilfang Resevoir, Serpent Shrine Cavern EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "serpent_shrine.h" #define MAX_ENCOUNTER 6 diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h index adfa39dc7e0..953e1f48eea 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SERPENT_SHRINE_H #define DEF_SERPENT_SHRINE_H diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index 8e1b438bdc5..a8969d18b8b 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ boss_hydromancer_thespia mob_coilfang_waterelemental EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "steam_vault.h" #define SAY_SUMMON -1545000 diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index f2da4058e44..1c25800e2e6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ boss_mekgineer_steamrigger mob_steamrigger_mechanic EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "steam_vault.h" #define SAY_MECHANICS -1545007 diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index f46956dda81..b6a9d628f06 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Contains workarounds regarding warlord's rage spells not acting as ex SDCategory: Coilfang Resevoir, The Steamvault EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "steam_vault.h" #define SAY_INTRO -1545016 diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp index 188a23738f5..3d089a3ecda 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Instance script and access panel GO SDCategory: Coilfang Resevoir, The Steamvault EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "steam_vault.h" #define MAX_ENCOUNTER 4 @@ -119,7 +121,7 @@ struct instance_steam_vault : public ScriptedInstance if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) HandleGameObject(MainChambersDoor, true); - debug_log("TSCR: Instance Steamvault: Access panel used."); + sLog.outDebug("TSCR: Instance Steamvault: Access panel used."); } m_auiEncounter[0] = data; break; @@ -131,7 +133,7 @@ struct instance_steam_vault : public ScriptedInstance if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) HandleGameObject(MainChambersDoor, true); - debug_log("TSCR: Instance Steamvault: Access panel used."); + sLog.outDebug("TSCR: Instance Steamvault: Access panel used."); } m_auiEncounter[1] = data; break; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h index 4b407ac4816..c15582c5b03 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/steam_vault.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_STEAM_VAULT_H #define DEF_STEAM_VAULT_H diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index fcfcc1b1a90..2fd078bc5ba 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Need confirmation if spell data are same in both modes. Summons shoul SDCategory: Coilfang Resevoir, Underbog EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_FOUL_SPORES 31673 #define SPELL_ACID_GEYSER 38739 diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index 3a78660389b..a005d52cd84 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Timers may be incorrect SDCategory: Coilfang Resevoir, Underbog EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SPELL_LEVITATE 31704 #define SPELL_SUSPENSION 31719 diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index a07ac910598..8d25155f14a 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Ground Slam need further development (knock back effect and shatter e SDCategory: Gruul's Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gruuls_lair.h" enum eEnums diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index 482af86225c..a2824a6fd16 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing SDCategory: Gruul's Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gruuls_lair.h" #define SAY_AGGRO -1565000 diff --git a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h index 7003dcb1e26..8dc06e35666 100644 --- a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h +++ b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_GRUULS_LAIR_H #define DEF_GRUULS_LAIR_H diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index bb790a5d4ea..2df6ad896da 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Gruul's Lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "gruuls_lair.h" #define MAX_ENCOUNTER 2 diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h index b845c66823f..e6d1bd14efd 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_BLOOD_FURNACE_H #define DEF_BLOOD_FURNACE_H diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index d5fb9bdba49..3a8fcee2975 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: pre-event not made SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blood_furnace.h" enum eEnums diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index a44ad9cc3c8..5b705708e9b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ boss_kelidan_the_breaker mob_shadowmoon_channeler EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blood_furnace.h" enum eKelidan diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index 45219b6509b..1c3ad6bf3f1 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Mind control no support SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blood_furnace.h" enum eEnums diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index 3a2eb8ba5ee..1b0f3f8aa25 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "blood_furnace.h" #define ENTRY_SEWER1 181823 diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index d6c0b2fd401..9cdab2399a7 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core s SDCategory: Hellfire Citadel, Hellfire Ramparts EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO_1 -1543009 #define SAY_AGGRO_2 -1543010 diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 181911f77a4..8dd705d3b3f 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,34 +23,45 @@ Comment: Category: Hellfire Citadel, Hellfire Ramparts EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" -#define SPELL_FIREBALL DUNGEON_MODE(34653, 36920) -#define SPELL_CONE_OF_FIRE DUNGEON_MODE(30926, 36921) -#define SPELL_SUMMON_LIQUID_FIRE DUNGEON_MODE(23971, 30928) -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_REVENGE DUNGEON_MODE(19130, 40392) -#define SPELL_KIDNEY_SHOT 30621 -#define SPELL_FIRE_NOVA_VISUAL 19823 +enum eSpells +{ + SPELL_FIREBALL = 34653, + SPELL_FIREBALL_H = 36920, + SPELL_CONE_OF_FIRE = 30926, + SPELL_CONE_OF_FIRE_H = 36921, + SPELL_SUMMON_LIQUID_FIRE = 23971, + SPELL_SUMMON_LIQUID_FIRE_H = 30928, + SPELL_BELLOWING_ROAR = 39427, + SPELL_REVENGE = 19130, + SPELL_REVENGE_H = 40392, + SPELL_KIDNEY_SHOT = 30621, + SPELL_FIRE_NOVA_VISUAL = 19823, +}; -#define ENTRY_HELLFIRE_SENTRY 17517 -#define ENTRY_VAZRUDEN_HERALD 17307 -#define ENTRY_VAZRUDEN 17537 -#define ENTRY_NAZAN 17536 -#define ENTRY_LIQUID_FIRE 22515 -#define ENTRY_REINFORCED_FEL_IRON_CHEST DUNGEON_MODE(185168, 185169) - -#define SAY_INTRO -1543017 -#define SAY_WIPE -1543018 -#define SAY_AGGRO_1 -1543019 -#define SAY_AGGRO_2 -1543020 -#define SAY_AGGRO_3 -1543021 -#define SAY_KILL_1 -1543022 -#define SAY_KILL_2 -1543023 -#define SAY_DIE -1543024 -#define EMOTE -1543025 - -#define PATH_ENTRY 2081 +enum eUnits +{ + ENTRY_HELLFIRE_SENTRY = 17517, + ENTRY_VAZRUDEN_HERALD = 17307, + ENTRY_VAZRUDEN = 17537, + ENTRY_NAZAN = 17536, + ENTRY_LIQUID_FIRE = 22515, + ENTRY_REINFORCED_FEL_IRON_CHEST = 185168, + ENTRY_REINFORCED_FEL_IRON_CHEST_H = 185169, +}; +enum eSays +{ + SAY_INTRO = -1543017, + SAY_WIPE = -1543018, + SAY_AGGRO_1 = -1543019, + SAY_AGGRO_2 = -1543020, + SAY_AGGRO_3 = -1543021, + SAY_KILL_1 = -1543022, + SAY_KILL_2 = -1543023, + SAY_DIE = -1543024, + EMOTE = -1543025, +}; const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; const float VazrudenRing[2][3] = @@ -59,10 +72,10 @@ const float VazrudenRing[2][3] = struct boss_nazanAI : public ScriptedAI { - boss_nazanAI(Creature *c) : ScriptedAI(c) + boss_nazanAI(Creature* pCreature) : ScriptedAI(pCreature) { VazrudenGUID = 0; - flight = true; + flight = true; } uint32 Fireball_Timer; @@ -70,7 +83,6 @@ struct boss_nazanAI : public ScriptedAI uint32 BellowingRoar_Timer; uint32 Fly_Timer; uint32 Turn_Timer; - uint32 UnsummonCheck; bool flight; uint64 VazrudenGUID; SpellEntry *liquid_fire; @@ -80,8 +92,7 @@ struct boss_nazanAI : public ScriptedAI Fireball_Timer = 4000; Fly_Timer = 45000; Turn_Timer = 0; - UnsummonCheck = 5000; - } + } void EnterCombat(Unit* /*who*/) {} @@ -91,7 +102,7 @@ struct boss_nazanAI : public ScriptedAI { summoned->SetLevel(me->getLevel()); summoned->setFaction(me->getFaction()); - summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); + summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE,SPELL_SUMMON_LIQUID_FIRE_H),true); summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); } } @@ -105,18 +116,12 @@ struct boss_nazanAI : public ScriptedAI void UpdateAI(const uint32 diff) { if (!UpdateVictim()) - { - if (UnsummonCheck < diff && me->isAlive()) - me->DisappearAndDie(); - else - UnsummonCheck -= diff; return; - } if (Fireball_Timer <= diff) { - if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(victim, SPELL_FIREBALL, true); + if (Unit* pVictim = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pVictim, DUNGEON_MODE(SPELL_FIREBALL, SPELL_FIREBALL_H), true); Fireball_Timer = urand(4000,7000); } else Fireball_Timer -= diff; @@ -127,12 +132,12 @@ struct boss_nazanAI : public ScriptedAI { flight = false; BellowingRoar_Timer = 6000; - ConeOfFire_Timer = 12000; + ConeOfFire_Timer = 12000; me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); me->GetMotionMaster()->Clear(); - if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) - me->AI()->AttackStart(victim); + if (Unit* pVictim = SelectUnit(SELECT_TARGET_NEAREST,0)) + me->AI()->AttackStart(pVictim); DoStartMovement(me->getVictim()); DoScriptText(EMOTE, me); return; @@ -141,7 +146,7 @@ struct boss_nazanAI : public ScriptedAI if (Turn_Timer <= diff) { uint32 waypoint = (Fly_Timer/10000)%2; - if (me->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) + if (!me->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) me->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); Turn_Timer = 10000; } else Turn_Timer -= diff; @@ -150,7 +155,7 @@ struct boss_nazanAI : public ScriptedAI { if (ConeOfFire_Timer <= diff) { - DoCast(me, SPELL_CONE_OF_FIRE); + DoCast(me, DUNGEON_MODE(SPELL_CONE_OF_FIRE, SPELL_CONE_OF_FIRE_H)); ConeOfFire_Timer = 12000; Fireball_Timer = 4000; } else ConeOfFire_Timer -= diff; @@ -169,7 +174,7 @@ struct boss_nazanAI : public ScriptedAI struct boss_vazrudenAI : public ScriptedAI { - boss_vazrudenAI(Creature *c) : ScriptedAI(c) + boss_vazrudenAI(Creature* pCreature) : ScriptedAI(pCreature) { } @@ -220,7 +225,7 @@ struct boss_vazrudenAI : public ScriptedAI if (Revenge_Timer <= diff) { if (Unit *victim = me->getVictim()) - DoCast(victim, SPELL_REVENGE); + DoCast(victim, DUNGEON_MODE(SPELL_REVENGE,SPELL_REVENGE_H)); Revenge_Timer = 5000; } else Revenge_Timer -= diff; @@ -230,7 +235,7 @@ struct boss_vazrudenAI : public ScriptedAI struct boss_vazruden_the_heraldAI : public ScriptedAI { - boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) + boss_vazruden_the_heraldAI(Creature* pCreature) : ScriptedAI(pCreature) { summoned = false; sentryDown = false; @@ -251,8 +256,7 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI phase = 0; waypoint = 0; check = 0; - UnsummonAdds(); - me->GetMotionMaster()->MovePath(PATH_ENTRY, true); + UnsummonAdds(); } void UnsummonAdds() @@ -288,15 +292,15 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI { if (Creature* Vazruden = me->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) VazrudenGUID = Vazruden->GetGUID(); - if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) - NazanGUID = Nazan->GetGUID(); + if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) + NazanGUID = Nazan->GetGUID(); summoned = true; me->SetVisibility(VISIBILITY_OFF); me->addUnitState(UNIT_STAT_ROOT); } } - void EnterCombat(Unit * /*who*/) + void EnterCombat(Unit* /*who*/) { if (phase == 0) { @@ -306,27 +310,29 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI } } - void JustSummoned(Creature *summoned) + void JustSummoned(Creature* pSummoned) { - if (!summoned) return; - Unit *victim = me->getVictim(); - if (summoned->GetEntry() == ENTRY_NAZAN) + if (!pSummoned) + return; + Unit* pVictim = me->getVictim(); + if (pSummoned->GetEntry() == ENTRY_NAZAN) { - CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - summoned->SetSpeed(MOVE_FLIGHT, 2.5); - if (victim) - AttackStartNoMove(victim); + CAST_AI(boss_nazanAI, pSummoned->AI())->VazrudenGUID = VazrudenGUID; + pSummoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + pSummoned->SetSpeed(MOVE_FLIGHT, 2.5); + if (pVictim) + AttackStartNoMove(pVictim); } - else if (victim) - summoned->AI()->AttackStart(victim); + else + if (pVictim) + pSummoned->AI()->AttackStart(pVictim); } - void SentryDownBy(Unit* killer) + void SentryDownBy(Unit* pKiller) { if (sentryDown) { - AttackStartNoMove(killer); + AttackStartNoMove(pKiller); sentryDown = false; } else @@ -375,9 +381,9 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI } else { - me->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); + me->SummonGameObject(DUNGEON_MODE(ENTRY_REINFORCED_FEL_IRON_CHEST, ENTRY_REINFORCED_FEL_IRON_CHEST_H),VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); me->SetLootRecipient(NULL); // don't think this is necessary.. - me->Kill(me); + //me->Kill(me); } check = 2000; } else check -= diff; @@ -388,7 +394,7 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI struct mob_hellfire_sentryAI : public ScriptedAI { - mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} + mob_hellfire_sentryAI(Creature* pCreature) : ScriptedAI(pCreature) {} uint32 KidneyShot_Timer; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index f0e813d3890..4feb83ec9cd 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Missing adds to heal him. Surge should be used on pTarget furthest aw SDCategory: Hellfire Citadel, Hellfire Ramparts EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_TAUNT -1543000 #define SAY_HEAL -1543001 diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h index 599aa237774..bbf61b4c45c 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_RAMPARTS_H #define DEF_RAMPARTS_H diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp index 29c58675e9c..56cbf1cabcb 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Hellfire Ramparts EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "hellfire_ramparts.h" struct instance_ramparts : public ScriptedInstance @@ -51,18 +53,18 @@ struct instance_ramparts : public ScriptedInstance void SetData(uint32 uiType, uint32 uiData) { - debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + sLog.outDebug("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); switch(uiType) { case TYPE_VAZRUDEN: if (uiData == DONE && m_auiEncounter[1] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS); m_auiEncounter[0] = uiData; break; case TYPE_NAZAN: if (uiData == DONE && m_auiEncounter[0] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS); m_auiEncounter[1] = uiData; break; } diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 5fb381f4065..123636a503c 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -1,18 +1,20 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Magtheridon @@ -21,7 +23,7 @@ SDComment: In Development SDCategory: Hellfire Citadel, Magtheridon's lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magtheridons_lair.h" struct Yell diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp index d5b459a1fa1..aa655588d3b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Hellfire Citadel, Magtheridon's lair EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "magtheridons_lair.h" #define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h index 1b3e525fc54..f2c5d97277a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_MAGTHERIDONS_LAIR_H #define DEF_MAGTHERIDONS_LAIR_H diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index e3ded52edc9..64ad5c7b130 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ mob_fel_orc_convert mob_lesser_shadow_fissure EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shattered_halls.h" struct Say diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 6fa1c9efe33..29119eb4015 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ mob_omrogg_heads boss_warbringer_omrogg EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shattered_halls.h" enum eEnums diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index b108077518a..3478f3b0434 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ boss_warchief_kargath_bladefist EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO1 -1540042 #define SAY_AGGRO2 -1540043 diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp index c29df4d6411..c7107cdb244 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: currently missing info about door. instance not complete SDCategory: Hellfire Citadel, Shattered Halls EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "shattered_halls.h" #define MAX_ENCOUNTER 2 diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h index cbfa23ec4e0..bfde60a86e4 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_SHATTERED_H #define DEF_SHATTERED_H diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index af5f1bd95c1..6230ec1a7fa 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -1,18 +1,20 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: boss_alar @@ -21,7 +23,7 @@ SDComment: SDCategory: Tempest Keep, The Eye EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "the_eye.h" #define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index e9e217a5c62..af311f7f5c2 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Tempest Keep, The Eye EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "the_eye.h" enum eEnums diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 05681fb7539..b6cfca4940a 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/ SDCategory: Tempest Keep, The Eye EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "the_eye.h" #include "WorldPacket.h" @@ -356,7 +358,7 @@ struct boss_kaelthasAI : public ScriptedAI if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) { - error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + sLog.outError("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); DoScriptText(SAY_PHASE4_INTRO2, me); @@ -399,7 +401,7 @@ struct boss_kaelthasAI : public ScriptedAI { if (!me->getVictim() && Phase >= 4) { - who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); AttackStart(who); } else if (me->GetMap()->IsDungeon()) @@ -414,7 +416,7 @@ struct boss_kaelthasAI : public ScriptedAI } } - void Aggro(Unit * /*who*/) + void EnterCombat(Unit * /*who*/) { if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); @@ -678,7 +680,7 @@ struct boss_kaelthasAI : public ScriptedAI Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]); if (!Advisor) - error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); + sLog.outError("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); else CAST_AI(advisorbase_ai, Advisor->AI())->Revive(pTarget); } @@ -763,7 +765,7 @@ struct boss_kaelthasAI : public ScriptedAI if (me->getThreatManager().getThreatList().size() >= 2) for (uint32 i = 0; i < 3; ++i) { - debug_log("SD2: Kael'Thas mind control not supported."); + sLog.outDebug("SD2: Kael'Thas mind control not supported."); //DoCast(pUnit, SPELL_MIND_CONTROL); } @@ -983,7 +985,7 @@ struct boss_thaladred_the_darkenerAI : public advisorbase_ai advisorbase_ai::Reset(); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1056,7 +1058,7 @@ struct boss_lord_sanguinarAI : public advisorbase_ai advisorbase_ai::Reset(); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1139,7 +1141,7 @@ struct boss_grand_astromancer_capernianAI : public advisorbase_ai } } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; @@ -1241,7 +1243,7 @@ struct boss_master_engineer_telonicusAI : public advisorbase_ai DoScriptText(SAY_TELONICUS_DEATH, me); } - void Aggro(Unit *who) + void EnterCombat(Unit *who) { if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index e1b60b20948..c22c9787a76 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Should reset if raid are out of room. SDCategory: Tempest Keep, The Eye EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "the_eye.h" enum eEnums diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp index 59c72071238..04c80a0a430 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Tempest Keep, The Eye EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "the_eye.h" #define MAX_ENCOUNTER 5 diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp index 97021fdc031..eb5e90bba90 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -25,7 +27,7 @@ EndScriptData */ mob_crystalcore_devastator EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "the_eye.h" #define SPELL_COUNTERCHARGE 35035 diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h index d0d3ea09061..44f9072917c 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h +++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_THE_EYE_H #define DEF_THE_EYE_H diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp index b9c365eda65..72f8a821aba 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Place Holder SDCategory: Tempest Keep, The Mechanar EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //not used #define SAY_AGGRO -1554000 diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index 50c3a6171ce..97dd2253081 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Gatewatcher_Ironhand @@ -21,7 +23,7 @@ SDComment: SDCategory: Tempest Keep, The Mechanar EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO_1 -1554006 #define SAY_HAMMER_1 -1554007 diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index ededec0196d..9e3b35c2590 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Nethermancer_Sepethrea @@ -21,7 +23,7 @@ SDComment: Need adjustments to initial summons SDCategory: Tempest Keep, The Mechanar EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "mechanar.h" #define SAY_AGGRO -1554013 diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index c0c06704db7..f6af93c9acc 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss Pathaleon the Calculator @@ -21,7 +23,7 @@ SDComment: Event missing. Script for himself 99% blizzlike. SDCategory: Tempest Keep, The Mechanar EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1554020 #define SAY_DOMINATION_1 -1554021 diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index c70da24ea3f..38c30c52ae5 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: SDCategory: Mechanar EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "mechanar.h" #define MAX_ENCOUNTER 1 diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h index d1b53eebf53..a89335bf51b 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DEF_MECHANAR_H #define DEF_MECHANAR_H diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 69dbc877d89..fa9576f476b 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -27,7 +29,7 @@ npc_warden_mellichar mob_zerekethvoidzone EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "arcatraz.h" /*##### diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h index 3f8dee8bbd0..b861099be3d 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ #ifndef DEF_ARCATRAZ_H #define DEF_ARCATRAZ_H diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index 6576974f3ff..5821e7e4f77 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -26,7 +28,7 @@ boss_harbinger_skyriss boss_harbinger_skyriss_illusion EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "arcatraz.h" #define SAY_INTRO -1552000 diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index d16975e2af6..4d257d4b4c2 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Mainly Harbringer Skyriss event SDCategory: Tempest Keep, The Arcatraz EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "arcatraz.h" #define MAX_ENCOUNTER 9 diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index 1a077036298..cf9346e1ce4 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: some strange visual related to tree form(if aura lost before normal d SDCategory: Tempest Keep, The Botanica EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1553000 #define SAY_KILL_1 -1553001 diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index cbf21c2f992..8fc44da614c 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Immunities are wrong, must be adjusted to use resistance from creatur SDCategory: Tempest Keep, The Botanica EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define EMOTE_SUMMON -1553006 diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 48eb03c16d3..d844b931a79 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Warp_Splinter @@ -21,7 +23,7 @@ SDComment: Includes Sapling (need some better control with these). SDCategory: Tempest Keep, The Botanica EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*##### # mob_treant (Sapling) diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index f5b4539edaf..6744045b896 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -30,7 +32,7 @@ npc_saikkal_the_elder go_legion_obelisk EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" //Support for quest: You're Fired! (10821) bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five; diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 9e9538f2d23..b158a1a6fd1 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Using incorrect spell for Mark of Kazzak SDCategory: Hellfire Peninsula EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_INTRO -1000147 #define SAY_AGGRO1 -1000148 diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index 60bcd7ee373..a51cab3426b 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -1,18 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Boss_Doomwalker @@ -21,7 +23,7 @@ SDComment: SDCategory: Shadowmoon Valley EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define SAY_AGGRO -1000159 #define SAY_EARTHQUAKE_1 -1000160 diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index fce8ac6f59e..c3710739926 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -31,7 +33,7 @@ npc_trollbane npc_wounded_blood_elf EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -140,7 +142,7 @@ struct npc_ancestral_wolfAI : public npc_escortAI if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER) Start(false, false, pCreature->GetOwner()->GetGUID()); else - error_log("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player."); + sLog.outError("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player."); pCreature->SetSpeed(MOVE_WALK, 1.5f); Reset(); diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 700ba2cc120..c2d76b0e9bb 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -33,7 +35,7 @@ npc_creditmarker_visit_with_ancestors mob_sparrowhawk EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -564,7 +566,7 @@ struct npc_maghar_captiveAI : public npc_escortAI m_uiFrostShockTimer = 6000; } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* /*pWho*/) { DoCast(me, SPELL_EARTHBIND_TOTEM, false); } diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index efe18ad1908..05481f84aa3 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -28,7 +30,7 @@ npc_commander_dawnforge npc_bessy EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### @@ -463,7 +465,7 @@ struct npc_commander_dawnforgeAI : public ScriptedAI return true; } - debug_log("TSCR: npc_commander_dawnforge event already in progress, need to wait."); + sLog.outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait."); return false; } diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 0e2eb34f0fe..b85959b34c8 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -39,7 +41,7 @@ go_crystal_prison npc_enraged_spirit EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*##### @@ -970,7 +972,7 @@ struct npc_earthmender_wildaAI : public npc_escortAI DoSummon(NPC_COILSKAR_ASSASSIN, me, 15.0f, 5000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT); } - void Aggro(Unit* pWho) + void EnterCombat(Unit* pWho) { //don't always use if (rand()%5) diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index 6acc050db48..74105af6428 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -32,7 +34,7 @@ npc_ishanah npc_khadgar EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index d593fdd8ca9..bb7e25de5a0 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -31,7 +33,7 @@ npc_isla_starmane npc_slim EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp index 5a07165595b..db50e255118 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -30,7 +32,7 @@ npc_kayra_longmane npc_timothy_daniels EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" /*###### diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 9a75263d35c..3d6f1a4e8d6 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -33,7 +35,7 @@ at_warsong_farms q11686 at_stormwright_shelf q12741 EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## AreaTrigger_at_aldurthar_gate diff --git a/src/server/scripts/World/boss_emeriss.cpp b/src/server/scripts/World/boss_emeriss.cpp index 3dc14969786..dc36e189f95 100644 --- a/src/server/scripts/World/boss_emeriss.cpp +++ b/src/server/scripts/World/boss_emeriss.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Teleport function & Mark of Nature missing SDCategory: Bosses EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { @@ -57,7 +59,7 @@ struct boss_emerissAI : public ScriptedAI m_uiCorruptionsCasted = 0; } - void Aggro(Unit* /*pWho*/) + void EnterCombat(Unit* /*pWho*/) { DoScriptText(SAY_AGGRO, me); } diff --git a/src/server/scripts/World/boss_lethon.cpp b/src/server/scripts/World/boss_lethon.cpp index cc316223a2f..b16060b43a7 100644 --- a/src/server/scripts/World/boss_lethon.cpp +++ b/src/server/scripts/World/boss_lethon.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,5 +23,5 @@ SDComment: Place Holder SDCategory: Bosses EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" diff --git a/src/server/scripts/World/boss_taerar.cpp b/src/server/scripts/World/boss_taerar.cpp index 079f7b387a8..e23400feda7 100644 --- a/src/server/scripts/World/boss_taerar.cpp +++ b/src/server/scripts/World/boss_taerar.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Mark of Nature & Teleport NYI. Fix the way to be banished. SDCategory: Bosses EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { @@ -171,7 +173,7 @@ struct boss_taerarAI : public ScriptedAI { if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - //Inturrupt any spell casting + //Interrupt any spell casting me->InterruptNonMeleeSpells(false); //horrible workaround, need to fix diff --git a/src/server/scripts/World/boss_ysondre.cpp b/src/server/scripts/World/boss_ysondre.cpp index 50b8f724e68..e9d7efc9d88 100644 --- a/src/server/scripts/World/boss_ysondre.cpp +++ b/src/server/scripts/World/boss_ysondre.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Mark of Nature & Teleport missing SDCategory: Bosses EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" enum eEnums { diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 6f06ac78fd7..ca7a136c2fb 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1,18 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 > -* Copyright (C) 2006 - 20010 TrinityCore - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -48,7 +49,7 @@ go_soulwell go_bashir_crystalforge EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /*###### ## go_cat_figurine @@ -259,7 +260,7 @@ bool GOHello_go_ethereum_prison(Player *pPlayer, GameObject *pGO) if (Spell) pCreature->CastSpell(pPlayer, Spell, false); else - error_log("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction()); + sLog.outError("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction()); } } } @@ -942,28 +943,6 @@ bool GOSelect_go_amberpine_outhouse(Player *pPlayer, GameObject *pGO, uint32 /*u return false; } -/*###### -## Quest 9544: The Prophecy of Akida -######*/ - -enum eProphecy -{ - QUEST_PROPHECY_OF_AKIDA = 9544, - NPC_STILLPINE_CAPTIVE = 17375 -}; - -bool GOHello_go_stillpine_cage(Player *pPlayer, GameObject *pGO) -{ - if (pPlayer->GetQuestStatus(QUEST_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) - if (Creature *pPrisoner = pGO->FindNearestCreature(NPC_STILLPINE_CAPTIVE,1.0f)) - { - pGO->UseDoorOrButton(); - pPrisoner->DisappearAndDie(); - pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0); - } - return true; -} - /*###### ## Quest 1126: Hive in the Tower ######*/ @@ -1159,11 +1138,6 @@ void AddSC_go_scripts() newscript->pGOHello = &GOHello_go_black_cage; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name = "go_stillpine_cage"; - newscript->pGOHello = &GOHello_go_stillpine_cage; - newscript->RegisterSelf(); - newscript = new Script; newscript->Name = "go_amberpine_outhouse"; newscript->pGOHello = &GOHello_go_amberpine_outhouse; diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 5faf9c73f7d..f475c276558 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -29,7 +31,7 @@ guard_shattrath_scryer guard_stormwind EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedGuardAI.h" /******************************************************* diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index dbf5f3c1a84..f7c6af53e44 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -29,7 +31,7 @@ item_gor_dreks_ointment(i30175) Protecting Our Own(q10488) item_only_for_flight Items which should only useable while flying EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "Spell.h" /*##### @@ -139,7 +141,7 @@ bool ItemUse_item_flying_machine(Player* pPlayer, Item* pItem, SpellCastTargets if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300) return false; - debug_log("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId); + sLog.outDebug("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId); pPlayer->SendEquipError(EQUIP_ERR_ERR_CANT_EQUIP_SKILL,pItem,NULL); return true; } diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index 3ab515d8206..9493d4e033a 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -1,19 +1,20 @@ - -/* Copyright (C) 2006 - 2009 ScriptDev2 -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ /* ScriptData SDName: Generic_Creature @@ -22,7 +23,7 @@ SDComment: Should be replaced with core based AI SDCategory: Creatures EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define GENERIC_CREATURE_COOLDOWN 5000 diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp index 9bda7a53516..29b27484fc8 100644 --- a/src/server/scripts/World/npc_innkeeper.cpp +++ b/src/server/scripts/World/npc_innkeeper.cpp @@ -1,19 +1,18 @@ /* - * Copyright (C) 2008 - 2009 Trinity + * Copyright (C) 2008-2010 TrinityCore * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* ScriptData @@ -24,7 +23,7 @@ SDComment: Complete SDCategory: NPCs EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define HALLOWEEN_EVENTID 12 #define SPELL_TRICK_OR_TREATED 24755 diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index ed22225d0d4..9a11c5773a0 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -21,7 +23,7 @@ SDComment: Provides learn/unlearn/relearn-options for professions. Not supported SDCategory: NPCs EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" /* A few notes for future developement: @@ -238,7 +240,7 @@ bool EquippedOk(Player* pPlayer, uint32 spellId) if (pItem->GetProto()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - debug_log("TSCR: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId); + sLog.outDebug("TSCR: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId); return false; } } diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp index 2a8efd4e0cb..1a296735b38 100644 --- a/src/server/scripts/World/npc_taxi.cpp +++ b/src/server/scripts/World/npc_taxi.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -22,7 +24,7 @@ SDCategory: NPCs EndScriptData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #define GOSSIP_SUSURRUS "I am ready." #define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!" diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index cfd1b7698fc..f6fa8f04258 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1,17 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . */ /* ScriptData @@ -40,7 +42,7 @@ npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die f npc_locksmith 75% list of keys needs to be confirmed EndContentData */ -#include "ScriptedPch.h" +#include "ScriptPCH.h" #include "ScriptedEscortAI.h" #include "ObjectMgr.h" #include "ScriptMgr.h" @@ -123,7 +125,7 @@ struct npc_air_force_botsAI : public ScriptedAI } if (!m_pSpawnAssoc) - error_db_log("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry()); + sLog.outErrorDb("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry()); else { CreatureInfo const* spawnedTemplate = GetCreatureTemplateStore(m_pSpawnAssoc->m_uiSpawnedCreatureEntry); @@ -131,7 +133,7 @@ struct npc_air_force_botsAI : public ScriptedAI if (!spawnedTemplate) { m_pSpawnAssoc = NULL; - error_db_log("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + sLog.outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); return; } } @@ -150,7 +152,7 @@ struct npc_air_force_botsAI : public ScriptedAI m_uiSpawnedGUID = pSummoned->GetGUID(); else { - error_db_log("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + sLog.outErrorDb("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); m_pSpawnAssoc = NULL; } @@ -787,7 +789,7 @@ void npc_doctorAI::UpdateAI(const uint32 diff) case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break; case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break; default: - error_log("TSCR: Invalid entry for Triage doctor. Please check your database"); + sLog.outError("TSCR: Invalid entry for Triage doctor. Please check your database"); return; } @@ -1689,7 +1691,7 @@ struct mob_mojoAI : public ScriptedAI if (Unit* own = me->GetOwner()) me->GetMotionMaster()->MoveFollow(own,0,0); } - void Aggro(Unit * /*who*/){} + void EnterCombat(Unit * /*who*/){} void UpdateAI(const uint32 diff) { if (me->HasAura(20372)) @@ -1848,7 +1850,7 @@ struct npc_ebon_gargoyleAI : CasterAI me->GetMotionMaster()->MovePoint(0, x, y, z); // Despawn as soon as possible - despawnTimer = 4 * IN_MILISECONDS; + despawnTimer = 4 * IN_MILLISECONDS; } void UpdateAI(const uint32 diff) diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index ed43a4eb6cd..2c474e61693 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -1,42 +1,125 @@ -add_subdirectory(vmap) -add_subdirectory(Auth) -add_subdirectory(Config) -add_subdirectory(Database) +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -########### next target ############### +########### shared ############### -SET(shared_STAT_SRCS - ByteBuffer.h - Common.cpp - Common.h - DelayExecutor.cpp - DelayExecutor.h - Errors.h - Log.cpp - Log.h - ProgressBar.cpp - ProgressBar.h - SignalHandler.h - Threading.cpp - Timer.h - Util.cpp - Util.h - WorldPacket.h - SystemConfig.h +set(shared_STAT_SRCS + Logging/Log.cpp + Threading/DelayExecutor.cpp + Threading/Threading.cpp + Utilities/ProgressBar.cpp + Utilities/Util.cpp + Utilities/EventProcessor.cpp + Common.cpp +) + +# Windows specific files +if(WIN32) + set(shared_STAT_SRCS + ${shared_STAT_SRCS} + Debugging/WheatyExceptionReport.cpp + Utilities/ServiceWin32.cpp + ) +endif() + +include_directories( + ${ACE_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/externals/mersennetwister + ${CMAKE_SOURCE_DIR}/externals/SFMT + ${CMAKE_SOURCE_DIR}/externals/sockets/include + ${CMAKE_SOURCE_DIR}/externals/utf8cpp + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography + ${CMAKE_SOURCE_DIR}/src/server/shared/Database + ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores + ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/shared/Packets + ${CMAKE_SOURCE_DIR}/src/server/shared/Threading + ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities + ${MYSQL_INCLUDE_DIR} +) + +add_library(shared STATIC ${shared_STAT_SRCS}) + +if(WIN32) +target_link_libraries( + shared + ace +) +else() +target_link_libraries( + shared + ${ACE_LIBRARY} +) +endif() + +########### trinityconfig ############### + +set(trinityconfig_STAT_SRCS + Configuration/dotconfpp/dotconfpp.cpp + Configuration/dotconfpp/mempool.cpp + Configuration/Config.cpp +) + +include_directories( + ${ACE_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src/server/shared +) + +add_library(trinityconfig STATIC ${trinityconfig_STAT_SRCS}) + +########### trinityauth ############### + +set(trinityauth_STAT_SRCS + Cryptography/Authentication/AuthCrypt.cpp + Cryptography/BigNumber.cpp + Cryptography/HMACSHA1.cpp + Cryptography/SHA1.cpp + Cryptography/MD5.c + Cryptography/ARC4.cpp ) include_directories( ${ACE_INCLUDE_DIR} ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/include - ${CMAKE_SOURCE_DIR}/dep/include/sockets - ${CMAKE_SOURCE_DIR}/src/server/framework ${CMAKE_SOURCE_DIR}/src/server/shared ${MYSQL_INCLUDE_DIR} ) -add_library(shared STATIC ${shared_STAT_SRCS}) -target_link_libraries( -shared -${ACE_LIBRARY} +add_library(trinityauth STATIC ${trinityauth_STAT_SRCS}) + +########### trinitydatabase ############### + +set(trinitydatabase_STAT_SRCS + DataStores/DBCFileLoader.cpp + Database/Database.cpp + Database/Field.cpp + Database/QueryResult.cpp + Database/SQLStorage.cpp + Database/SqlDelayThread.cpp + Database/SqlOperations.cpp + Database/PreparedStatements.cpp ) + +include_directories( + ${ACE_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Database + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object + ${MYSQL_INCLUDE_DIR} +) + +add_library(trinitydatabase STATIC ${trinitydatabase_STAT_SRCS}) diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index 4a6aac43390..f7407e78aac 100644 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -59,7 +59,7 @@ #undef VERSION #endif //HAVE_CONFIG_H -#include "Platform/Define.h" +#include "Define.h" #if COMPILER == COMPILER_MICROSOFT # pragma warning(disable:4996) // 'function': was declared deprecated @@ -76,7 +76,7 @@ #endif // __SHOW_STUPID_WARNINGS__ #endif // __GNUC__ -#include "Utilities/UnorderedMap.h" +#include "Dynamic/UnorderedMap.h" #include #include #include @@ -100,8 +100,8 @@ #include #include -#include "LockedQueue.h" -#include "Threading.h" +#include "Threading/LockedQueue.h" +#include "Threading/Threading.h" #include #include @@ -168,7 +168,7 @@ enum TimeConstants WEEK = DAY*7, MONTH = DAY*30, YEAR = MONTH*12, - IN_MILISECONDS = 1000 + IN_MILLISECONDS = 1000 }; enum AccountTypes diff --git a/src/server/shared/CompilerDefs.h b/src/server/shared/CompilerDefs.h index fb7dbfe4caa..d2d470e2097 100644 --- a/src/server/shared/CompilerDefs.h +++ b/src/server/shared/CompilerDefs.h @@ -26,7 +26,7 @@ #define PLATFORM_APPLE 2 #define PLATFORM_INTEL 3 -// must be first (win 64 also define WIN32) +// must be first (win 64 also define _WIN32) #if defined( _WIN64 ) # define PLATFORM PLATFORM_WINDOWS #elif defined( __WIN32__ ) || defined( WIN32 ) || defined( _WIN32 ) diff --git a/src/server/shared/Configuration/CMakeLists.txt b/src/server/shared/Configuration/CMakeLists.txt deleted file mode 100644 index da1c2e8aa3b..00000000000 --- a/src/server/shared/Configuration/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ - -########### next target ############### - -SET(trinityconfig_STAT_SRCS - dotconfpp/dotconfpp.cpp - dotconfpp/dotconfpp.h - dotconfpp/mempool.cpp - dotconfpp/mempool.h - Config.cpp - Config.h - ConfigEnv.h -) - -include_directories( - ${ACE_INCLUDE_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/src/server/framework -) - -add_library(trinityconfig STATIC ${trinityconfig_STAT_SRCS}) - diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp index 39830104a7c..3979cbc36aa 100644 --- a/src/server/shared/Configuration/Config.cpp +++ b/src/server/shared/Configuration/Config.cpp @@ -19,9 +19,6 @@ */ #include "ConfigEnv.h" -#include "Policies/SingletonImp.h" - -INSTANTIATE_SINGLETON_1(Config); Config::Config() : mIgnoreCase(true), mConf(NULL) { diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h index ccc76073e46..50cd4609b25 100644 --- a/src/server/shared/Configuration/Config.h +++ b/src/server/shared/Configuration/Config.h @@ -21,15 +21,16 @@ #ifndef CONFIG_H #define CONFIG_H -#include -#include "Platform/Define.h" +#include +#include "Define.h" class DOTCONFDocument; class Config { + friend class ACE_Singleton; + Config(); public: - Config(); ~Config(); bool SetSource(const char *file, bool ignorecase = true); @@ -47,7 +48,7 @@ class Config DOTCONFDocument *mConf; }; -#define sConfig Trinity::Singleton::Instance() +#define sConfig (*ACE_Singleton::instance()) #endif diff --git a/src/server/shared/Cryptography/ARC4.cpp b/src/server/shared/Cryptography/ARC4.cpp index 80cad4991e9..8427640ba2a 100644 --- a/src/server/shared/Cryptography/ARC4.cpp +++ b/src/server/shared/Cryptography/ARC4.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Auth/SARC4.h" +#include "ARC4.h" #include SARC4::SARC4(uint8 len) diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp index b34b922b16a..2dfcebfa932 100644 --- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp +++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp @@ -19,9 +19,9 @@ */ #include "AuthCrypt.h" -#include "Hmac.h" -#include "Log.h" -#include "BigNumber.h" +#include "Cryptography/HMACSHA1.h" +#include "Logging/Log.h" +#include "Cryptography/BigNumber.h" AuthCrypt::AuthCrypt() : _clientDecrypt(SHA_DIGEST_LENGTH), _serverEncrypt(SHA_DIGEST_LENGTH) { diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h index 6695dc580cc..5a2430611a4 100644 --- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h +++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h @@ -22,7 +22,7 @@ #define _AUTHCRYPT_H #include -#include "SARC4.h" +#include "Cryptography/ARC4.h" class BigNumber; diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp index 64e9ef21ccc..c05258c73a0 100644 --- a/src/server/shared/Cryptography/BigNumber.cpp +++ b/src/server/shared/Cryptography/BigNumber.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Auth/BigNumber.h" +#include "Cryptography/BigNumber.h" #include #include diff --git a/src/server/shared/Cryptography/CMakeLists.txt b/src/server/shared/Cryptography/CMakeLists.txt deleted file mode 100644 index 6e5d10d40e5..00000000000 --- a/src/server/shared/Cryptography/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ - -########### next target ############### - -SET(trinityauth_STAT_SRCS - AuthCrypt.cpp - AuthCrypt.h - BigNumber.cpp - BigNumber.h - Hmac.cpp - Hmac.h - Sha1.cpp - Sha1.h - md5.c - md5.h - SARC4.cpp - SARC4.h -) - -include_directories( - ${ACE_INCLUDE_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/src/server/framework - ${MYSQL_INCLUDE_DIR} -) - -add_library(trinityauth STATIC ${trinityauth_STAT_SRCS}) diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp index a30f1b2d1e2..aed8940372b 100644 --- a/src/server/shared/Cryptography/HMACSHA1.cpp +++ b/src/server/shared/Cryptography/HMACSHA1.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Auth/Hmac.h" +#include "HMACSHA1.h" #include "BigNumber.h" HmacHash::HmacHash(uint32 len, uint8 *seed) diff --git a/src/server/shared/Cryptography/MD5.c b/src/server/shared/Cryptography/MD5.c index 3e9735e2dbb..45897503455 100644 --- a/src/server/shared/Cryptography/MD5.c +++ b/src/server/shared/Cryptography/MD5.c @@ -51,7 +51,7 @@ self-checking. 1999-05-03 lpd Original version. */ -#include "md5.h" +#include "MD5.h" #include #undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp index b63deb2c5f3..b50f72af4d3 100644 --- a/src/server/shared/Cryptography/SHA1.cpp +++ b/src/server/shared/Cryptography/SHA1.cpp @@ -18,8 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Auth/Sha1.h" -#include "Auth/BigNumber.h" +#include "SHA1.h" +#include "BigNumber.h" #include Sha1Hash::Sha1Hash() diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h index a97ab4d60fa..f59ad038ce0 100644 --- a/src/server/shared/DataStores/DBCFileLoader.h +++ b/src/server/shared/DataStores/DBCFileLoader.h @@ -18,7 +18,7 @@ #ifndef DBC_FILE_LOADER_H #define DBC_FILE_LOADER_H -#include "Platform/Define.h" +#include "Define.h" #include "Utilities/ByteConverter.h" #include diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index 61e2f7a6d06..cd1d1881d68 100644 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -20,7 +20,7 @@ #define DBCSTORE_H #include "DBCFileLoader.h" -#include "Log.h" +#include "Logging/Log.h" struct SqlDbc { diff --git a/src/server/shared/Database/CMakeLists.txt b/src/server/shared/Database/CMakeLists.txt deleted file mode 100644 index e30c8ae3ca2..00000000000 --- a/src/server/shared/Database/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -SET(trinitydatabase_STAT_SRCS - DBCFileLoader.cpp - DBCFileLoader.h - DBCStore.h - Database.cpp - Database.h - DatabaseEnv.h - DatabaseImpl.h - Field.cpp - Field.h - QueryResult.cpp - QueryResult.h - SQLStorage.cpp - SQLStorage.h - SqlDelayThread.cpp - SqlDelayThread.h - SqlOperations.cpp - SqlOperations.h -) - -include_directories( - ${ACE_INCLUDE_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/src/server/shared/Database - ${CMAKE_SOURCE_DIR}/src/server/framework - ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object - ${MYSQL_INCLUDE_DIR} -) - -add_library(trinitydatabase STATIC ${trinitydatabase_STAT_SRCS}) diff --git a/src/server/shared/Database/Database.cpp b/src/server/shared/Database/Database.cpp index 7646a451eb4..1fb2f831a9f 100644 --- a/src/server/shared/Database/Database.cpp +++ b/src/server/shared/Database/Database.cpp @@ -19,18 +19,17 @@ */ #include "DatabaseEnv.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Common.h" -#include "UpdateFields.h" +#include "Updates/UpdateFields.h" -#include "Util.h" -#include "Policies/SingletonImp.h" -#include "Platform/Define.h" -#include "Threading.h" +#include "Utilities/Util.h" +#include "Define.h" +#include "Threading/Threading.h" #include "Database/SqlDelayThread.h" #include "Database/SqlOperations.h" -#include "Timer.h" +#include "Utilities/Timer.h" #include @@ -113,7 +112,7 @@ bool Database::Initialize(const char *infoString) database = *iter++; mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8"); - #ifdef WIN32 + #ifdef _WIN32 if (host==".") // named pipe use option (Windows) { unsigned int opt = MYSQL_PROTOCOL_PIPE; diff --git a/src/server/shared/Database/Database.h b/src/server/shared/Database/Database.h index 4ad5d29c993..762abfd2ede 100644 --- a/src/server/shared/Database/Database.h +++ b/src/server/shared/Database/Database.h @@ -21,14 +21,13 @@ #ifndef DATABASE_H #define DATABASE_H -#include "Threading.h" -#include "Utilities/UnorderedMap.h" +#include "Threading/Threading.h" +#include "Dynamic/UnorderedMap.h" #include "Database/SqlDelayThread.h" -#include "Policies/Singleton.h" #include "ace/Thread_Mutex.h" #include "ace/Guard_T.h" -#ifdef WIN32 +#ifdef _WIN32 #define FD_SETSIZE 1024 #include #include @@ -117,7 +116,7 @@ class Database bool _UpdateDataBlobValue(const uint32 guid, const uint32 field, const int32 value); bool _SetDataBlobValue(const uint32 guid, const uint32 field, const uint32 value); - // Writes SQL commands to a LOG file (see Trinityd.conf "LogSQL") + // Writes SQL commands to a LOG file (see worldserver.conf "LogSQL") bool PExecuteLog(const char *format,...) ATTR_PRINTF(2,3); bool BeginTransaction(); diff --git a/src/server/shared/Database/DatabaseEnv.h b/src/server/shared/Database/DatabaseEnv.h index 69236b076e9..15c1b1c599e 100644 --- a/src/server/shared/Database/DatabaseEnv.h +++ b/src/server/shared/Database/DatabaseEnv.h @@ -22,8 +22,8 @@ #define DATABASEENV_H #include "Common.h" -#include "Log.h" -#include "Errors.h" +#include "Logging/Log.h" +#include "Debugging/Errors.h" #include "Database/Field.h" #include "Database/QueryResult.h" diff --git a/src/server/shared/Database/PreparedStatements.cpp b/src/server/shared/Database/PreparedStatements.cpp new file mode 100644 index 00000000000..40a910acf9e --- /dev/null +++ b/src/server/shared/Database/PreparedStatements.cpp @@ -0,0 +1,93 @@ +#include "PreparedStatements.h" + +void PreparedStatementHolder::_prepareStatement(const char* name, const char* sql, Database *db, uint32 &count) +{ + const char prefix[] = "PREPARE "; + size_t querySize = 8 + strlen(name) + 6 + strlen(sql) + 2 + 1; + char* query = new char[querySize]; + strcpy(query, prefix); + strcat(query, name); + strcat(query, " FROM "); + strcat(query, "'"); + strcat(query, sql); + strcat(query, "'"); + + DEBUG_LOG("Preparing statement: %s", query); + db->Execute(query); + + delete[] query; + ++count; +} + +void PreparedStatementHolder::LoadAuthserver(Database *db, uint32 &count) +{ + _prepareStatement("auth_ping", "SELECT 1 FROM realmlist LIMIT 1", db, count); +}; + +void PreparedStatementHolder::Execute(Database *db, const char *name) +{ + const char prefix[] = "EXECUTE "; + size_t querySize = 8 + strlen(name) + 1; + char* query = new char[querySize]; + strcpy(query, prefix); + strcat(query, name); + + DEBUG_LOG("Prepared statement: %s", query); + db->Execute(query); + delete[] query; +} + +void PreparedStatementHolder::PExecute(Database *db, const char *name, const char* args) +{ + // NOTE: if args == NULL, we're crashing here. No need to waste performance on checking; + // devs must make sure they use PExecute for args and Execute for no args. + + const char prefix[] = "EXECUTE "; + size_t querySize = 8 + strlen(name) + 7 + strlen(args) + 1; + char* query = new char[querySize]; + strcpy(query, prefix); + strcat(query, name); + strcat(query, " USING "); + strcat(query, args); + + DEBUG_LOG("Prepared statement (parsed args): %s", query); + db->Execute(query); + delete[] query; +} + +QueryResult_AutoPtr PreparedStatementHolder::Query(Database *db, const char *name) +{ + QueryResult_AutoPtr _return = QueryResult_AutoPtr(NULL); + + const char prefix[] = "EXECUTE "; + size_t querySize = 8 + strlen(name) + 1; + char* query = new char[querySize]; + strcpy(query, prefix); + strcat(query, name); + + DEBUG_LOG("Prepared statement with resultset: %s", query); + _return = db->Query(query); + delete[] query; + return _return; +} + +QueryResult_AutoPtr PreparedStatementHolder::PQuery(Database *db, const char *name, const char *args) +{ + // NOTE: if args == NULL, we're crashing here. No need to waste performance on checking; + // devs must make sure they use PQuery for args and Query for no args. + + QueryResult_AutoPtr _return = QueryResult_AutoPtr(NULL); + + const char prefix[] = "EXECUTE "; + size_t querySize = 8 + strlen(name) + 7 + strlen(args) + 1; + char* query = new char[querySize]; + strcpy(query, prefix); + strcat(query, name); + strcat(query, " USING "); + strcat(query, args); + + DEBUG_LOG("Prepared statement with resultset (parsed args): %s", query); + _return = db->Query(query); + delete[] query; + return _return; +} \ No newline at end of file diff --git a/src/server/shared/Database/PreparedStatements.h b/src/server/shared/Database/PreparedStatements.h new file mode 100644 index 00000000000..c19119dcb3d --- /dev/null +++ b/src/server/shared/Database/PreparedStatements.h @@ -0,0 +1,30 @@ +#ifndef sPreparedStatement + +#include "ace/Singleton.h" +#include "Database/DatabaseEnv.h" + +class PreparedStatementHolder +{ + public: + ///- Load prepare statements on database $db and increase $count for every statement + void LoadCharacters(Database *db, uint32 &count); + void LoadAuthserver(Database *db, uint32 &count); + void LoadWorldserver(Database *db, uint32 &count); + + ///- Executes prepared statement that doesn't require feedback with name $name on database $db + void Execute(Database *db, const char* name); + ///- Executes prepared statement that doesn't require feedback with name $name and args $args + ///- on database $db + void PExecute(Database *db, const char* name, const char* args); + + ///- Executes a prepared statement without args on db $db with name $name and puts the result set in a pointer. + QueryResult_AutoPtr Query(Database* db, const char* name); + ///- Executes a prepared statement with args $args on db $db with name $name and put the result set in a pointer. + QueryResult_AutoPtr PQuery(Database* db, const char* name, const char* args); + + private: + void _prepareStatement(const char* name, const char* sql, Database *db, uint32 &count); + +}; +#define sPreparedStatement (*ACE_Singleton::instance()) +#endif \ No newline at end of file diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h index 4eec9915362..5562a9abfa4 100644 --- a/src/server/shared/Database/QueryResult.h +++ b/src/server/shared/Database/QueryResult.h @@ -26,7 +26,7 @@ #include "Field.h" -#ifdef WIN32 +#ifdef _WIN32 #define FD_SETSIZE 1024 #include #include diff --git a/src/server/shared/Database/SQLStorageImpl.h b/src/server/shared/Database/SQLStorageImpl.h index c74be48c34c..b3d06484e2e 100644 --- a/src/server/shared/Database/SQLStorageImpl.h +++ b/src/server/shared/Database/SQLStorageImpl.h @@ -16,9 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "ProgressBar.h" -#include "Log.h" -#include "DBCFileLoader.h" +#include "Utilities/ProgressBar.h" +#include "Logging/Log.h" +#include "DataStores/DBCFileLoader.h" template template diff --git a/src/server/shared/Database/SqlDelayThread.h b/src/server/shared/Database/SqlDelayThread.h index d603813c8fa..4ef9c67aa5b 100644 --- a/src/server/shared/Database/SqlDelayThread.h +++ b/src/server/shared/Database/SqlDelayThread.h @@ -23,7 +23,7 @@ #include "ace/Thread_Mutex.h" #include "ace/Activation_Queue.h" -#include "Threading.h" +#include "Threading/Threading.h" class Database; class SqlOperation; diff --git a/src/server/shared/Database/SqlOperations.h b/src/server/shared/Database/SqlOperations.h index f2e09c0c921..eb28a2c0790 100644 --- a/src/server/shared/Database/SqlOperations.h +++ b/src/server/shared/Database/SqlOperations.h @@ -25,9 +25,9 @@ #include "ace/Thread_Mutex.h" #include "ace/Method_Request.h" -#include "LockedQueue.h" +#include "Threading/LockedQueue.h" #include -#include "Utilities/Callback.h" +#include "Threading/Callback.h" #include "QueryResult.h" /// ---- BASE --- diff --git a/src/server/shared/Debugging/MemoryLeaks.cpp b/src/server/shared/Debugging/MemoryLeaks.cpp index ef7e36c3b57..c591dabb866 100644 --- a/src/server/shared/Debugging/MemoryLeaks.cpp +++ b/src/server/shared/Debugging/MemoryLeaks.cpp @@ -17,9 +17,6 @@ */ #include "MemoryLeaks.h" -#include "Policies/SingletonImp.h" - -INSTANTIATE_SINGLETON_1( MemoryManager ) ; MemoryManager::MemoryManager( ) { diff --git a/src/server/shared/Debugging/MemoryLeaks.h b/src/server/shared/Debugging/MemoryLeaks.h index c8b8fb8e1b1..4b13e4d3d90 100644 --- a/src/server/shared/Debugging/MemoryLeaks.h +++ b/src/server/shared/Debugging/MemoryLeaks.h @@ -19,7 +19,7 @@ #ifndef TRINITYSERVER_MEMORY_H #define TRINITYSERVER_MEMORY_H -#include "Platform/CompilerDefs.h" +#include "shared/CompilerDefs.h" #if COMPILER == COMPILER_MICROSOFT @@ -39,10 +39,11 @@ #endif -#include "Policies/Singleton.h" +#include "ace/Singleton.h" -struct MemoryManager : public Trinity::Singleton < MemoryManager > +struct MemoryManager { MemoryManager(); }; +#define sMemoryManager ACE_Singleton::instance() #endif diff --git a/src/server/shared/Define.h b/src/server/shared/Define.h index 9285bf289f9..980cf9023e1 100644 --- a/src/server/shared/Define.h +++ b/src/server/shared/Define.h @@ -26,7 +26,7 @@ #include #include -#include "Platform/CompilerDefs.h" +#include "CompilerDefs.h" #define TRINITY_LITTLEENDIAN 0 #define TRINITY_BIGENDIAN 1 diff --git a/src/server/shared/Dynamic/CountedReference/Reference.h b/src/server/shared/Dynamic/CountedReference/Reference.h deleted file mode 100644 index d3cfe55ffc0..00000000000 --- a/src/server/shared/Dynamic/CountedReference/Reference.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_REFERENCE_H -#define TRINITY_REFERENCE_H - -/** - * Referencer - * Referencer is an object that holds a reference holder that hold a reference - * counted object. When an object's reference count drop to zero, it removes - * the object. This is a non intrusive mechanism and any object at any point - * in time can be referenced. When and object is reference counted, do not - * pass the object directly to other methods but rather, pass its - * reference around. Objects can be reference counted in both single threaded - * model and multi-threaded model - */ - -#include -#include "Platform/Define.h" -#include "Policies/ThreadingModel.h" -#include "ReferenceHolder.h" - -template -< -typename T, -class THREADING_MODEL = Trinity::SingleThreaded -> -class Referencer -{ - typedef typename THREADING_MODEL::Lock Lock; - typedef ReferenceHolder ReferenceeHolder; - public: - - /// Constructs a referencer. - Referencer(T *ref = NULL); - - /// Copy constructor - Referencer(const Referencer &obj) : i_holder(NULL) { *this = obj; } - - /// Destructor - ~Referencer(); - - /// Referencee accessor - T* referencee(void) { return (i_holder == NULL ? NULL : i_holder->i_referencee); } - const T* referencee(void) const { return (i_holder == NULL ? NULL : i_holder->i_referencee); } - - //T& referencee(void){ return _referencee(); } - //const T& referencee(void) const { return const_cast(this)->_referencee(); } - operator T&(void) { return _referencee(); } - operator const T&(void) const { return *const_cast(this)->_referencee(); } - - /// cast operators - T* operator*() { return (i_holder == NULL ? NULL : i_holder->i_referencee); } - T const * operator*() const { return (i_holder == NULL ? NULL : i_holder->i_referencee); } - - /// overload operators - T* operator->() { return (i_holder == NULL ? NULL : i_holder->i_referencee); } - const T * operator->() const { return (i_holder == NULL ? NULL : i_holder->i_referencee); } - - /// operator = - Referencer& operator=(const Referencer &obj); - Referencer& operator=(T *); - - /// returns true if i_referencee is null - bool isNull(void) const { return i_holder == NULL; } - - private: - - T& _referencee(void) - { - if( i_holder == NULL ) - throw std::runtime_error("Invalid access to null pointer"); - return *i_holder->i_referencee; - } - - void deReference(ReferenceeHolder *); - void addReference(ReferenceeHolder *); - - // private data - ReferenceeHolder *i_holder; -}; -#endif - diff --git a/src/server/shared/Dynamic/CountedReference/ReferenceHolder.h b/src/server/shared/Dynamic/CountedReference/ReferenceHolder.h deleted file mode 100644 index 597e9854be0..00000000000 --- a/src/server/shared/Dynamic/CountedReference/ReferenceHolder.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_REFERENCEHOLDER_H -#define TRINITY_REFERENCEHOLDER_H - -/** ReferenceHolder holds the actualy referenced obejct as well the refence - count. The ReferenecHolder implements as a policy base object and - will decided by the Reference class to be consnsitent. - */ - -template -< -typename T, -class THREADING_MODEL -> -struct ReferenceHolder : public THREADING_MODEL -{ - explicit ReferenceHolder(T *ref) : i_referencee(ref), i_referenceCount(0) {} - T *i_referencee; - unsigned int i_referenceCount; - typedef typename THREADING_MODEL::Lock Lock; -}; -#endif - diff --git a/src/server/shared/Dynamic/CountedReference/ReferenceImpl.h b/src/server/shared/Dynamic/CountedReference/ReferenceImpl.h deleted file mode 100644 index cde330179e3..00000000000 --- a/src/server/shared/Dynamic/CountedReference/ReferenceImpl.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_REFERENCEIMPL_H -#define TRINITY_REFERENCEIMPL_H - -#include "Reference.h" - -template -< -typename T, -class THREADING_MODEL -> -Referencer::Referencer(T *ref) -: i_holder(NULL) -{ - if( ref != NULL ) - { - i_holder = new ReferenceeHolder(ref); - ++i_holder->i_referenceCount; - } -} - -template -< -typename T, -class THREADING_MODEL -> -Referencer::~Referencer() -{ - if( i_holder != NULL ) - deReference(i_holder); - i_holder = NULL; -} - -template -< -typename T, -class THREADING_MODEL -> -Referencer& -Referencer::operator=(const Referencer &obj) -{ - if( i_holder != NULL ) - deReference(i_holder); - if( obj.i_holder != NULL ) - addReference(obj.i_holder); - i_holder = obj.i_holder; - return *this; -} - -template -< -typename T, -class THREADING_MODEL -> -Referencer& -Referencer::operator=(T *ref) -{ - if( i_holder != NULL ) - deReference(i_holder); - i_holder = NULL; - if( ref != NULL ) - { - i_holder = new ReferenceeHolder(ref); - ++i_holder->i_referenceCount; - } - - return *this; -} - -template -< -typename T, -class THREADING_MODEL -> -void -Referencer::deReference(ReferenceHolder *holder) -{ - assert( holder != NULL && holder->i_referenceCount > 0); - bool delete_object = false; - - { - // The guard is within the scope due to the guard - // must release earlier than expected. - Lock guard(*holder); - Guard(&guard); - - --holder->i_referenceCount; - if( holder->i_referenceCount == 0 ) - delete_object = true; - } - - if( delete_object ) - { - delete holder->i_referencee; - delete holder; - } -} - -template -< -typename T, -class THREADING_MODEL -> -void -Referencer::addReference(ReferenceHolder *holder) -{ - assert( i_holder != NULL ); - Lock guard(*holder); - Guard(&guard); - - ++holder->i_referenceCount; -} -#endif - diff --git a/src/server/shared/Dynamic/FactoryHolder.h b/src/server/shared/Dynamic/FactoryHolder.h index 282968d6097..096bdad1783 100644 --- a/src/server/shared/Dynamic/FactoryHolder.h +++ b/src/server/shared/Dynamic/FactoryHolder.h @@ -21,10 +21,9 @@ #ifndef TRINITY_FACTORY_HOLDER #define TRINITY_FACTORY_HOLDER -#include "Platform/Define.h" -#include "Utilities/TypeList.h" +#include "Define.h" +#include "Dynamic/TypeList.h" #include "ObjectRegistry.h" -#include "Policies/SingletonImp.h" /** FactoryHolder holds a factory object of a specific type */ @@ -33,14 +32,15 @@ class FactoryHolder { public: typedef ObjectRegistry, Key > FactoryHolderRegistry; - typedef Trinity::Singleton FactoryHolderRepository; + friend class ACE_Singleton; + typedef ACE_Singleton FactoryHolderRepository; FactoryHolder(Key k) : i_key(k) {} virtual ~FactoryHolder() {} inline Key key() const { return i_key; } - void RegisterSelf(void) { FactoryHolderRepository::Instance().InsertItem(this, i_key); } - void DeregisterSelf(void) { FactoryHolderRepository::Instance().RemoveItem(this, false); } + void RegisterSelf(void) { FactoryHolderRepository::instance()->InsertItem(this, i_key); } + void DeregisterSelf(void) { FactoryHolderRepository::instance()->RemoveItem(this, false); } /// Abstract Factory create method virtual T* Create(void *data = NULL) const = 0; diff --git a/src/server/shared/Dynamic/LinkedReference/RefManager.h b/src/server/shared/Dynamic/LinkedReference/RefManager.h index 7e294b4f5f0..ea79d5e1784 100644 --- a/src/server/shared/Dynamic/LinkedReference/RefManager.h +++ b/src/server/shared/Dynamic/LinkedReference/RefManager.h @@ -22,8 +22,8 @@ #define _REFMANAGER_H //===================================================== -#include "Utilities/LinkedList.h" -#include "Utilities/LinkedReference/Reference.h" +#include "Dynamic/LinkedList.h" +#include "Dynamic/LinkedReference/Reference.h" template class RefManager : public LinkedListHead { diff --git a/src/server/shared/Dynamic/LinkedReference/Reference.h b/src/server/shared/Dynamic/LinkedReference/Reference.h index 4a1545f8f12..8891199a5eb 100644 --- a/src/server/shared/Dynamic/LinkedReference/Reference.h +++ b/src/server/shared/Dynamic/LinkedReference/Reference.h @@ -21,7 +21,7 @@ #ifndef _REFERENCE_H #define _REFERENCE_H -#include "Utilities/LinkedList.h" +#include "Dynamic/LinkedList.h" //===================================================== diff --git a/src/server/shared/Dynamic/ObjectRegistry.h b/src/server/shared/Dynamic/ObjectRegistry.h index e6619427885..11052a9f0a7 100644 --- a/src/server/shared/Dynamic/ObjectRegistry.h +++ b/src/server/shared/Dynamic/ObjectRegistry.h @@ -21,9 +21,9 @@ #ifndef TRINITY_OBJECTREGISTRY_H #define TRINITY_OBJECTREGISTRY_H -#include "Platform/Define.h" -#include "Utilities/UnorderedMap.h" -#include "Policies/Singleton.h" +#include "Define.h" +#include "Dynamic/UnorderedMap.h" +#include "ace/Singleton.h" #include #include @@ -94,11 +94,6 @@ class ObjectRegistry return i_registeredObjects; } - private: - RegistryMapType i_registeredObjects; - friend class Trinity::OperatorNew >; - - // protected for friend use since it should be a singleton ObjectRegistry() {} ~ObjectRegistry() { @@ -106,6 +101,9 @@ class ObjectRegistry delete iter->second; i_registeredObjects.clear(); } + private: + RegistryMapType i_registeredObjects; + }; #endif diff --git a/src/server/shared/Dynamic/TypeContainer.h b/src/server/shared/Dynamic/TypeContainer.h index c2c9b4fcdea..4ed07431ee3 100644 --- a/src/server/shared/Dynamic/TypeContainer.h +++ b/src/server/shared/Dynamic/TypeContainer.h @@ -28,9 +28,9 @@ #include #include -#include "Platform/Define.h" -#include "Utilities/TypeList.h" -#include "GameSystem/GridRefManager.h" +#include "Define.h" +#include "Dynamic/TypeList.h" +#include "GridRefManager.h" /* * @class ContainerMapList is a mulit-type container for map elements diff --git a/src/server/shared/Dynamic/TypeContainerFunctions.h b/src/server/shared/Dynamic/TypeContainerFunctions.h index edfbb40e659..7ab2151461e 100644 --- a/src/server/shared/Dynamic/TypeContainerFunctions.h +++ b/src/server/shared/Dynamic/TypeContainerFunctions.h @@ -27,8 +27,8 @@ * to access or mutate the container. */ -#include "Platform/Define.h" -#include "Utilities/TypeList.h" +#include "Define.h" +#include "Dynamic/TypeList.h" #include namespace Trinity diff --git a/src/server/shared/Dynamic/TypeContainerVisitor.h b/src/server/shared/Dynamic/TypeContainerVisitor.h index f15075e5afd..6057eb32fc3 100644 --- a/src/server/shared/Dynamic/TypeContainerVisitor.h +++ b/src/server/shared/Dynamic/TypeContainerVisitor.h @@ -27,8 +27,8 @@ * to overload its types as a visit method is called. */ -#include "Platform/Define.h" -#include "TypeContainer.h" +#include "Define.h" +#include "Dynamic/TypeContainer.h" // forward declaration template class TypeContainerVisitor; diff --git a/src/server/shared/Dynamic/UnorderedMap.h b/src/server/shared/Dynamic/UnorderedMap.h index fce5ec82bfc..d9f41fe4ab8 100644 --- a/src/server/shared/Dynamic/UnorderedMap.h +++ b/src/server/shared/Dynamic/UnorderedMap.h @@ -21,8 +21,8 @@ #ifndef TRINITY_UNORDERED_MAP_H #define TRINITY_UNORDERED_MAP_H -#include "Platform/CompilerDefs.h" -#include "Platform/Define.h" +#include "CompilerDefs.h" +#include "Define.h" #if COMPILER == COMPILER_INTEL #include @@ -62,7 +62,13 @@ namespace __gnu_cxx { size_t operator()(T * const &__x) const { return (size_t)__x; } }; - + template<> struct hash + { + size_t operator()(const std::string &__x) const + { + return hash()(__x.c_str()); + } + }; }; #else diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 187b9eaa79b..7a34eaa0c0d 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -20,15 +20,12 @@ #include "Common.h" #include "Log.h" -#include "Policies/SingletonImp.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Util.h" #include #include -INSTANTIATE_SINGLETON_1( Log ); - Log::Log() : raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), dberLogfile(NULL), chatLogfile(NULL), m_gmlog_per_account(false), @@ -450,7 +447,7 @@ void Log::outCrash(const char * err, ...) va_list ap; va_start(ap, err); - vutf8printf(stdout, err, &ap); + vutf8printf(stderr, err, &ap); va_end(ap); if (m_colored) @@ -530,7 +527,6 @@ void Log::outArena(const char * str, ...) va_end(ap); fflush(arenaLogFile); } - fflush(stdout); } void Log::outErrorDb(const char * err, ...) @@ -902,7 +898,6 @@ void Log::outRemote(const char * str, ...) va_end(ap); fflush(raLogfile); } - fflush(stdout); } void Log::outChat(const char * str, ...) @@ -930,76 +925,4 @@ void Log::outChat(const char * str, ...) fflush(chatLogfile); va_end(ap); } - fflush(stdout); } - -void outstring_log(const char * str, ...) -{ - if (!str) - return; - - char buf[256]; - va_list ap; - va_start(ap, str); - vsnprintf(buf,256, str, ap); - va_end(ap); - - Trinity::Singleton::Instance().outString(buf); -} - -void detail_log(const char * str, ...) -{ - if (!str) - return; - - char buf[256]; - va_list ap; - va_start(ap, str); - vsnprintf(buf,256, str, ap); - va_end(ap); - - Trinity::Singleton::Instance().outDetail(buf); -} - -void debug_log(const char * str, ...) -{ - if (!str) - return; - - char buf[256]; - va_list ap; - va_start(ap, str); - vsnprintf(buf,256, str, ap); - va_end(ap); - - Trinity::Singleton::Instance().outDebug(buf); -} - -void error_log(const char * str, ...) -{ - if (!str) - return; - - char buf[256]; - va_list ap; - va_start(ap, str); - vsnprintf(buf,256, str, ap); - va_end(ap); - - Trinity::Singleton::Instance().outError(buf); -} - -void error_db_log(const char * str, ...) -{ - if (!str) - return; - - char buf[256]; - va_list ap; - va_start(ap, str); - vsnprintf(buf,256, str, ap); - va_end(ap); - - Trinity::Singleton::Instance().outErrorDb(buf); -} - diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index deb6c55e4e0..fb584d42c27 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -22,7 +22,7 @@ #define TRINITYCORE_LOG_H #include "Common.h" -#include "Policies/Singleton.h" +#include #include "Database/DatabaseEnv.h" class Config; @@ -82,9 +82,9 @@ enum ColorTypes const int Colors = int(WHITE)+1; -class Log : public Trinity::Singleton > +class Log { - friend class Trinity::OperatorNew; + friend class ACE_Singleton; Log(); ~Log(); @@ -172,19 +172,13 @@ class Log : public Trinity::Singleton::Instance() +#define sLog (*ACE_Singleton::instance()) #ifdef TRINITY_DEBUG -#define DEBUG_LOG Trinity::Singleton::Instance().outDebug +#define DEBUG_LOG sLog.outDebug #else #define DEBUG_LOG #endif -// primary for script library -void outstring_log(const char * str, ...) ATTR_PRINTF(1,2); -void detail_log(const char * str, ...) ATTR_PRINTF(1,2); -void debug_log(const char * str, ...) ATTR_PRINTF(1,2); -void error_log(const char * str, ...) ATTR_PRINTF(1,2); -void error_db_log(const char * str, ...) ATTR_PRINTF(1,2); #endif diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index ba0240fb58b..98709a5b0e0 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -22,8 +22,8 @@ #define _BYTEBUFFER_H #include "Common.h" -#include "Errors.h" -#include "Log.h" +#include "Debugging/Errors.h" +#include "Logging/Log.h" #include "Utilities/ByteConverter.h" class ByteBufferException diff --git a/src/server/shared/Policies/CreationPolicy.h b/src/server/shared/Policies/CreationPolicy.h deleted file mode 100644 index 8552ce7da52..00000000000 --- a/src/server/shared/Policies/CreationPolicy.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_CREATIONPOLICY_H -#define TRINITY_CREATIONPOLICY_H - -#include -#include "Platform/Define.h" - -namespace Trinity -{ - /** - * OperatorNew policy creates an object on the heap using new. - */ - template - class OperatorNew - { - public: - static T* Create(void) { return (new T); } - static void Destroy(T *obj) { delete obj; } - }; - - /** - * LocalStaticCreation policy creates an object on the stack - * the first time call Create. - */ - template - class LocalStaticCreation - { - union MaxAlign - { - char t_[sizeof(T)]; - short int shortInt_; - int int_; - long int longInt_; - float float_; - double double_; - long double longDouble_; - struct Test; - int Test::* pMember_; - int (Test::*pMemberFn_)(int); - }; - public: - static T* Create(void) - { - static MaxAlign si_localStatic; - return new(&si_localStatic) T; - } - - static void Destroy(T *obj) { obj->~T(); } - }; - - /** - * CreateUsingMalloc by pass the memory manger. - */ - template - class CreateUsingMalloc - { - public: - static T* Create() - { - void* p = ::malloc(sizeof(T)); - if (!p) return 0; - return new(p) T; - } - - static void Destroy(T* p) - { - p->~T(); - ::free(p); - } - }; - - /** - * CreateOnCallBack creates the object base on the call back. - */ - template - class CreateOnCallBack - { - public: - static T* Create() - { - return CALL_BACK::createCallBack(); - } - - static void Destroy(T *p) - { - CALL_BACK::destroyCallBack(p); - } - }; -} -#endif - diff --git a/src/server/shared/Policies/ObjectLifeTime.cpp b/src/server/shared/Policies/ObjectLifeTime.cpp deleted file mode 100644 index fd16873ae92..00000000000 --- a/src/server/shared/Policies/ObjectLifeTime.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include "ObjectLifeTime.h" - -namespace Trinity -{ - extern "C" void external_wrapper(void *p) - { - std::atexit( (void (*)())p ); - } - - void at_exit( void (*func)() ) - { - external_wrapper((void*)func); - } -} - diff --git a/src/server/shared/Policies/ObjectLifeTime.h b/src/server/shared/Policies/ObjectLifeTime.h deleted file mode 100644 index 61b90b59f6e..00000000000 --- a/src/server/shared/Policies/ObjectLifeTime.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_OBJECTLIFETIME_H -#define TRINITY_OBJECTLIFETIME_H - -#include -#include "Platform/Define.h" - -typedef void (* Destroyer)(void); - -namespace Trinity -{ - void at_exit( void (*func)() ); - - template - class ObjectLifeTime - { - public: - static void ScheduleCall(void (*destroyer)() ) - { - at_exit( destroyer ); - } - - DECLSPEC_NORETURN static void OnDeadReference(void) ATTR_NORETURN; - - }; - - template - void ObjectLifeTime::OnDeadReference(void) // We don't handle Dead Reference for now - { - throw std::runtime_error("Dead Reference"); - } -} -#endif - diff --git a/src/server/shared/Policies/Singleton.h b/src/server/shared/Policies/Singleton.h deleted file mode 100644 index da898558ca5..00000000000 --- a/src/server/shared/Policies/Singleton.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_SINGLETON_H -#define TRINITY_SINGLETON_H - -/** - * @brief class Singleton - */ - -#include "CreationPolicy.h" -#include "ThreadingModel.h" -#include "ObjectLifeTime.h" - -namespace Trinity -{ - template - < - typename T, - class ThreadingModel = Trinity::SingleThreaded, - class CreatePolicy = Trinity::OperatorNew, - class LifeTimePolicy = Trinity::ObjectLifeTime - > - class Singleton - { - public: - static T& Instance(); - - protected: - Singleton() {}; - - private: - - // Prohibited actions...this does not prevent hijacking. - Singleton(const Singleton &); - Singleton& operator=(const Singleton &); - - // Singleton Helpers - static void DestroySingleton(); - - // data structure - typedef typename ThreadingModel::Lock Guard; - static T *si_instance; - static bool si_destroyed; - }; -} -#endif - diff --git a/src/server/shared/Policies/SingletonImp.h b/src/server/shared/Policies/SingletonImp.h deleted file mode 100644 index 3e985cd5c64..00000000000 --- a/src/server/shared/Policies/SingletonImp.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_SINGLETONIMPL_H -#define TRINITY_SINGLETONIMPL_H - -#include "Singleton.h" - -// avoid the using namespace here cuz -// its a .h file afterall - -template -< -typename T, -class ThreadingModel, -class CreatePolicy, -class LifeTimePolicy -> -T& -Trinity::Singleton::Instance() -{ - if( !si_instance ) - { - // double-checked Locking pattern - Guard(); - if( !si_instance ) - { - if( si_destroyed ) - { - si_destroyed = false; - LifeTimePolicy::OnDeadReference(); - } - si_instance = CreatePolicy::Create(); - LifeTimePolicy::ScheduleCall(&DestroySingleton); - } - } - - return *si_instance; -} - -template -< -typename T, -class ThreadingModel, -class CreatePolicy, -class LifeTimePolicy -> -void -Trinity::Singleton::DestroySingleton() -{ - CreatePolicy::Destroy(si_instance); - si_instance = NULL; - si_destroyed = true; -} - -#define INSTANTIATE_SINGLETON_1(TYPE) \ - template class Trinity::Singleton, Trinity::OperatorNew, Trinity::ObjectLifeTime >; \ - template<> TYPE* Trinity::Singleton, Trinity::OperatorNew, Trinity::ObjectLifeTime >::si_instance = 0; \ - template<> bool Trinity::Singleton, Trinity::OperatorNew, Trinity::ObjectLifeTime >::si_destroyed = false - -#define INSTANTIATE_SINGLETON_2(TYPE, THREADINGMODEL) \ - template class Trinity::Singleton, Trinity::ObjectLifeTime >; \ - template<> TYPE* Trinity::Singleton, Trinity::ObjectLifeTime >::si_instance = 0; \ - template<> bool Trinity::Singleton, Trinity::ObjectLifeTime >::si_destroyed = false - -#define INSTANTIATE_SINGLETON_3(TYPE, THREADINGMODEL, CREATIONPOLICY ) \ - template class Trinity::Singleton >; \ - template<> TYPE* Trinity::Singleton >::si_instance = 0; \ - template<> bool Trinity::Singleton >::si_destroyed = false - -#define INSTANTIATE_SINGLETON_4(TYPE, THREADINGMODEL, CREATIONPOLICY, OBJECTLIFETIME) \ - template class Trinity::Singleton; \ - template<> TYPE* Trinity::Singleton::si_instance = 0; \ - template<> bool Trinity::Singleton::si_destroyed = false -#endif - diff --git a/src/server/shared/Policies/ThreadingModel.h b/src/server/shared/Policies/ThreadingModel.h deleted file mode 100644 index d4c5e9a2333..00000000000 --- a/src/server/shared/Policies/ThreadingModel.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2005-2009 MaNGOS - * - * Copyright (C) 2008-2010 Trinity - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_THREADINGMODEL_H -#define TRINITY_THREADINGMODEL_H - -/** - * @class ThreadingModel - * - */ - -#include "Platform/Define.h" - -namespace Trinity -{ - inline void Guard(void *) {} - - template class GeneralLock - { - public: - GeneralLock(MUTEX &m) : i_mutex(m) - { - i_mutex.acquire(); - } - - ~GeneralLock() - { - i_mutex.release(); - } - private: - GeneralLock(const GeneralLock &); - GeneralLock& operator=(const GeneralLock &); - MUTEX &i_mutex; - }; - - template - class SingleThreaded - { - public: - - struct Lock // empty object - { - Lock() {} - Lock(const T &) {} - Lock(const SingleThreaded &) // for single threaded we ignore this - { - } - }; - - typedef T VolatileType; - }; - - // object level lockable - template - class ObjectLevelLockable - { - public: - ObjectLevelLockable() : i_mtx() {} - - friend class Lock; - - class Lock - { - public: - Lock(ObjectLevelLockable &host) : i_lock(host.i_mtx) - { - } - - private: - GeneralLock i_lock; - }; - - typedef volatile T VolatileType; - - private: - // prevent the compiler creating a copy construct - ObjectLevelLockable(const ObjectLevelLockable &); - ObjectLevelLockable& operator=(const ObjectLevelLockable &); - - MUTEX i_mtx; - }; - - template - class ClassLevelLockable - { - public: - class Lock; - friend class Lock; - typedef volatile T VolatileType; - - ClassLevelLockable() {} - - class Lock - { - public: - Lock(T& /*host*/) { ClassLevelLockable::si_mtx.acquire(); } - Lock(ClassLevelLockable &) { ClassLevelLockable::si_mtx.acquire(); } - Lock() { ClassLevelLockable::si_mtx.acquire(); } - ~Lock() { ClassLevelLockable::si_mtx.release(); } - }; - - private: - static MUTEX si_mtx; - }; - -} - -template MUTEX Trinity::ClassLevelLockable::si_mtx; - -#define INSTANTIATE_CLASS_MUTEX(CTYPE,MUTEX) \ - template class Trinity::ClassLevelLockable -#endif - diff --git a/src/server/shared/SystemConfig.h b/src/server/shared/SystemConfig.h index ac531cbbc94..fd380d72b79 100644 --- a/src/server/shared/SystemConfig.h +++ b/src/server/shared/SystemConfig.h @@ -24,7 +24,7 @@ #ifndef TRINITY_SYSTEMCONFIG_H #define TRINITY_SYSTEMCONFIG_H -#include "Platform/Define.h" +#include "Define.h" #include "revision.h" #define _PACKAGENAME "TrinityCore " diff --git a/src/server/shared/Threading/LockedQueue.h b/src/server/shared/Threading/LockedQueue.h index 9f8afae6c14..ff6056350f3 100644 --- a/src/server/shared/Threading/LockedQueue.h +++ b/src/server/shared/Threading/LockedQueue.h @@ -23,7 +23,7 @@ #include #include #include -#include "Errors.h" +#include "Debugging/Errors.h" namespace ACE_Based { diff --git a/src/server/shared/Utilities/ByteConverter.h b/src/server/shared/Utilities/ByteConverter.h index f8b6bd72498..24a89f464b8 100644 --- a/src/server/shared/Utilities/ByteConverter.h +++ b/src/server/shared/Utilities/ByteConverter.h @@ -25,7 +25,7 @@ for cross platform where they have different endians. */ -#include +#include "Define.h" #include namespace ByteConverter diff --git a/src/server/shared/Utilities/EventProcessor.h b/src/server/shared/Utilities/EventProcessor.h index 2712967e1b7..421f88b659a 100644 --- a/src/server/shared/Utilities/EventProcessor.h +++ b/src/server/shared/Utilities/EventProcessor.h @@ -21,7 +21,7 @@ #ifndef __EVENTPROCESSOR_H #define __EVENTPROCESSOR_H -#include "Platform/Define.h" +#include "Define.h" #include diff --git a/src/server/shared/Utilities/ProgressBar.h b/src/server/shared/Utilities/ProgressBar.h index e7565590278..cae23254f30 100644 --- a/src/server/shared/Utilities/ProgressBar.h +++ b/src/server/shared/Utilities/ProgressBar.h @@ -20,7 +20,7 @@ #ifndef TRINITYCORE_PROGRESSBAR_H #define TRINITYCORE_PROGRESSBAR_H -#include "Platform/Define.h" +#include "Define.h" class barGoLink { diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp index 2c1df2ff483..a50a4f9d039 100644 --- a/src/server/shared/Utilities/ServiceWin32.cpp +++ b/src/server/shared/Utilities/ServiceWin32.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef WIN32 +#ifdef _WIN32 #include "Common.h" #include "Log.h" @@ -26,6 +26,11 @@ #include #include +// stupid ACE define +#ifdef main +#undef main +#endif //main + #if !defined(WINADVAPI) #if !defined(_ADVAPI32_) #define WINADVAPI DECLSPEC_IMPORT diff --git a/src/server/shared/Utilities/ServiceWin32.h b/src/server/shared/Utilities/ServiceWin32.h index ddac785a0fb..4dbd329a5fa 100644 --- a/src/server/shared/Utilities/ServiceWin32.h +++ b/src/server/shared/Utilities/ServiceWin32.h @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef WIN32 +#ifdef _WIN32 #ifndef _WIN32_SERVICE_ #define _WIN32_SERVICE_ @@ -27,5 +27,5 @@ bool WinServiceUninstall(); bool WinServiceRun(); #endif // _WIN32_SERVICE_ -#endif // WIN32 +#endif // _WIN32 diff --git a/src/server/shared/Utilities/Timer.h b/src/server/shared/Utilities/Timer.h index 3e0a369b655..326df71bf50 100644 --- a/src/server/shared/Utilities/Timer.h +++ b/src/server/shared/Utilities/Timer.h @@ -21,7 +21,7 @@ #ifndef TRINITY_TIMER_H #define TRINITY_TIMER_H -#include "Platform/CompilerDefs.h" +#include "CompilerDefs.h" #if PLATFORM == PLATFORM_WINDOWS # include diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index a3c017fdbfd..97dfde6c92b 100644 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -20,9 +20,10 @@ #include "Util.h" -#include "sockets/socket_include.h" -#include "utf8cpp/utf8.h" -#include "mersennetwister/MersenneTwister.h" +#include "socket_include.h" +#include "utf8.h" +//#include "SFMT.h" +#include "MersenneTwister.h" #include typedef ACE_TSS MTRandTSS; @@ -194,7 +195,7 @@ uint32 CreatePIDFile(const std::string& filename) if (pid_file == NULL) return 0; -#ifdef WIN32 +#ifdef _WIN32 DWORD pid = GetCurrentProcessId(); #else pid_t pid = getpid(); diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 3adfbf0339f..e86422e2ce1 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -1,130 +1,189 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -########### next target ############### +########### worldserver ############### -SET(trinity-core_SRCS -CliRunnable.cpp -CliRunnable.h -Main.cpp -Master.cpp -Master.h -RASocket.cpp -RASocket.h -WorldRunnable.cpp -WorldRunnable.h +set(worldserver_SRCS + CommandLine/CliRunnable.cpp + RemoteAccess/RASocket.cpp + WorldThread/WorldRunnable.cpp + Main.cpp + Master.cpp ) include_directories( ${ACE_INCLUDE_DIR} + ${MYSQL_INCLUDE_DIR} + ${OPENSSL_INCLUDE_DIR} ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/externals/sockets/include + ${CMAKE_SOURCE_DIR}/externals/mersennetwister ${CMAKE_SOURCE_DIR}/dep/include + ${CMAKE_SOURCE_DIR}/src/server/collision + ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography + ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication ${CMAKE_SOURCE_DIR}/src/server/shared/Database - ${CMAKE_SOURCE_DIR}/src/server/shared/vmap - ${CMAKE_SOURCE_DIR}/src/server/framework + ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores + ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference + ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic + ${CMAKE_SOURCE_DIR}/src/server/shared/Logging + ${CMAKE_SOURCE_DIR}/src/server/shared/Packets + ${CMAKE_SOURCE_DIR}/src/server/shared/Policies + ${CMAKE_SOURCE_DIR}/src/server/shared/Threading + ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities ${CMAKE_SOURCE_DIR}/src/server/game - ${CMAKE_SOURCE_DIR}/src/server/game/Account + ${CMAKE_SOURCE_DIR}/src/server/game/Accounts ${CMAKE_SOURCE_DIR}/src/server/game/Achievements ${CMAKE_SOURCE_DIR}/src/server/game/Addons ${CMAKE_SOURCE_DIR}/src/server/game/AI - ${CMAKE_SOURCE_DIR}/src/server/game/AI/AuctionHouseBot + ${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse + ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse/AuctionHouseBot ${CMAKE_SOURCE_DIR}/src/server/game/BattleGrounds + ${CMAKE_SOURCE_DIR}/src/server/game/BattleGrounds/Zones ${CMAKE_SOURCE_DIR}/src/server/game/Calendar ${CMAKE_SOURCE_DIR}/src/server/game/Chat + ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Channels + ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Commands ${CMAKE_SOURCE_DIR}/src/server/game/Combat - ${CMAKE_SOURCE_DIR}/src/server/game/ConditionMgr + ${CMAKE_SOURCE_DIR}/src/server/game/Conditions ${CMAKE_SOURCE_DIR}/src/server/game/DataStores + ${CMAKE_SOURCE_DIR}/src/server/game/DungeonFinding ${CMAKE_SOURCE_DIR}/src/server/game/Entities ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Creature + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Corpse + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/DynamicObject ${CMAKE_SOURCE_DIR}/src/server/game/Entities/GameObject ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object/Updates ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Pet ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Player ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Totem ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Unit ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle + ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Transport ${CMAKE_SOURCE_DIR}/src/server/game/Events ${CMAKE_SOURCE_DIR}/src/server/game/Globals + ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Cells + ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers + ${CMAKE_SOURCE_DIR}/src/server/game/Grids ${CMAKE_SOURCE_DIR}/src/server/game/Groups ${CMAKE_SOURCE_DIR}/src/server/game/Guilds ${CMAKE_SOURCE_DIR}/src/server/game/Instances - ${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup ${CMAKE_SOURCE_DIR}/src/server/game/Loot ${CMAKE_SOURCE_DIR}/src/server/game/Mails - ${CMAKE_SOURCE_DIR}/src/server/game/Map - ${CMAKE_SOURCE_DIR}/src/server/game/Map/Cell - ${CMAKE_SOURCE_DIR}/src/server/game/Map/Grid + ${CMAKE_SOURCE_DIR}/src/server/game/Maps + ${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous ${CMAKE_SOURCE_DIR}/src/server/game/Movement ${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators - ${CMAKE_SOURCE_DIR}/src/server/game/Opcodes + ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP + ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP/Zones ${CMAKE_SOURCE_DIR}/src/server/game/Pools ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders ${CMAKE_SOURCE_DIR}/src/server/game/Quests ${CMAKE_SOURCE_DIR}/src/server/game/Reputation - ${CMAKE_SOURCE_DIR}/src/server/game/ScriptMgr + ${CMAKE_SOURCE_DIR}/src/server/game/Scripting + ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol + ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers + ${CMAKE_SOURCE_DIR}/src/server/game/Server ${CMAKE_SOURCE_DIR}/src/server/game/Skills ${CMAKE_SOURCE_DIR}/src/server/game/Spells ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras ${CMAKE_SOURCE_DIR}/src/server/game/Tools ${CMAKE_SOURCE_DIR}/src/server/game/Weather ${CMAKE_SOURCE_DIR}/src/server/game/World - ${MYSQL_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/src/server/worldserver + ${CMAKE_SOURCE_DIR}/src/server/worldserver/CommandLine + ${CMAKE_SOURCE_DIR}/src/server/worldserver/RemoteAccess + ${CMAKE_SOURCE_DIR}/src/server/worldserver/WorldThread ) -SET(trinity-core_LINK_FLAGS "") +set(worldserver_LINK_FLAGS "") -add_executable(trinity-core ${trinity-core_SRCS}) -add_definitions( --D_TRINITY_CORE_CONFIG='"${CONF_DIR}/trinitycore.conf"' -) -IF (DO_MYSQL) - SET(trinity-core_LINK_FLAGS "-pthread ${trinity-core_LINK_FLAGS}") -ENDIF(DO_MYSQL) +add_executable(worldserver ${worldserver_SRCS}) -IF (CMAKE_SYSTEM_NAME MATCHES "Darwin") - SET(trinity-core_LINK_FLAGS "-framework Carbon ${trinity-core_LINK_FLAGS}") - SET(SCRIPT_LIB "") -ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin") +if( NOT WIN32 ) + add_definitions(-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/worldserver.conf"') +endif() -SET_TARGET_PROPERTIES(trinity-core PROPERTIES LINK_FLAGS "${trinity-core_LINK_FLAGS}") +add_dependencies(worldserver revision.h) -if(DO_SCRIPTS) - SET(SCRIPT_LIB "scripts") -else(DO_SCRIPTS) - SET(SCRIPT_LIB "") -endif(DO_SCRIPTS) +if( UNIX ) + set(worldserver_LINK_FLAGS "-pthread ${worldserver_LINK_FLAGS}") +endif() -target_link_libraries( -trinity-core -game -shared -zlib -trinityframework -trinitysockets -trinitydatabase -trinityauth -trinityconfig -vmaps -g3dlite -jmalloc -${SCRIPT_LIB} -${READLINE_LIBRARY} -${TERMCAP_LIBRARY} -${MYSQL_LIBRARIES} -${SSLLIB} -${ACE_LIBRARY} -${ZLIB} -${OSX_LIBS} -) +if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(worldserver_LINK_FLAGS "-framework Carbon ${worldserver_LINK_FLAGS}") + set(SCRIPT_LIB "") +endif() -install(TARGETS trinity-core DESTINATION bin) +set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}") +if( DO_SCRIPTS ) + set(SCRIPT_LIB "scripts") +else() + set(SCRIPT_LIB "") +endif() -########### install files ############### - -install(FILES trinitycore.conf.dist DESTINATION etc) +if( WIN32 ) + target_link_libraries( + worldserver + game + shared + zlib + trinitysockets + trinitydatabase + trinityauth + trinityconfig + collision + g3dlib + ${SCRIPT_LIB} + ace + ${MYSQL_LIBRARY} + ${OPENSSL_LIBRARIES} + ${OPENSSL_EXTRA_LIBRARIES} + ) +else() + target_link_libraries( + worldserver + game + shared + trinitysockets + trinitydatabase + trinityauth + trinityconfig + collision + g3dlib + jemalloc + ${SCRIPT_LIB} + ${READLINE_LIBRARY} + ${TERMCAP_LIBRARY} + ${ACE_LIBRARY} + ${MYSQL_LIBRARY} + ${OPENSSL_LIBRARIES} + ${ZLIB_LIBRARIES} + ${OSX_LIBS} + ) +endif() +if( UNIX ) + install(TARGETS worldserver DESTINATION bin) + install(FILES worldserver.conf.dist DESTINATION etc) +endif() diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index b39faf694db..c72e454700c 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -26,7 +26,7 @@ #include "ObjectMgr.h" #include "World.h" #include "WorldSession.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "AccountMgr.h" #include "Chat.h" diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 95bb39eca91..5166ca741df 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -28,16 +28,16 @@ #include "Common.h" #include "Database/DatabaseEnv.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Log.h" #include "Master.h" #ifndef _TRINITY_CORE_CONFIG -# define _TRINITY_CORE_CONFIG "TrinityCore.conf" +# define _TRINITY_CORE_CONFIG "worldserver.conf" #endif //_TRINITY_CORE_CONFIG -#ifdef WIN32 +#ifdef _WIN32 #include "ServiceWin32.h" char serviceName[] = "TrinityCore"; char serviceLongName[] = "Trinity core service"; @@ -62,7 +62,7 @@ void usage(const char *prog) { sLog.outString("Usage: \n %s []\n" " -c config_file use config_file as configuration file\n\r" - #ifdef WIN32 + #ifdef _WIN32 " Running as service functions:\n\r" " --service run as service\n\r" " -s install install service\n\r" @@ -91,7 +91,7 @@ extern int main(int argc, char **argv) cfg_file = argv[c]; } - #ifdef WIN32 + #ifdef _WIN32 //////////// //Services// //////////// diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 8b34b512f57..f6f4260e303 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -31,9 +31,8 @@ #include "WorldRunnable.h" #include "WorldSocket.h" #include "WorldSocketMgr.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Database/DatabaseEnv.h" -#include "Policies/SingletonImp.h" #include "CliRunnable.h" #include "Log.h" @@ -42,26 +41,19 @@ #include "Timer.h" #include "Util.h" -#include "sockets/TcpSocket.h" -#include "sockets/Utility.h" -#include "sockets/Parse.h" -#include "sockets/Socket.h" -#include "sockets/SocketHandler.h" -#include "sockets/ListenSocket.h" -#include "Auth/BigNumber.h" +#include "TcpSocket.h" +#include "Utility.h" +#include "Parse.h" +#include "Socket.h" +#include "SocketHandler.h" +#include "ListenSocket.h" +#include "BigNumber.h" -#ifdef WIN32 +#ifdef _WIN32 #include "ServiceWin32.h" extern int m_ServiceStatus; #endif -/// \todo Warning disabling not useful under VC++2005. Can somebody say on which compiler it is useful? -#pragma warning(disable:4305) - -INSTANTIATE_SINGLETON_1( Master ); - -volatile uint32 Master::m_masterLoopCounter = 0; - /// Handle cored's termination signals class CoredSignalHandler : public Trinity::SignalHandler { @@ -94,42 +86,25 @@ public: void SetDelayTime(uint32 t) { _delaytime = t; } void run(void) { - if(!_delaytime) + if (!_delaytime) return; sLog.outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000); m_loops = 0; w_loops = 0; m_lastchange = 0; w_lastchange = 0; - while(!World::IsStopped()) + while (!World::IsStopped()) { ACE_Based::Thread::Sleep(1000); uint32 curtime = getMSTime(); - //DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter); - - // There is no Master anymore - // TODO: clear the rest of the code -// // normal work -// if(m_loops != Master::m_masterLoopCounter) -// { -// m_lastchange = curtime; -// m_loops = Master::m_masterLoopCounter; -// } -// // possible freeze -// else if(getMSTimeDiff(m_lastchange,curtime) > _delaytime) -// { -// sLog.outError("Main/Sockets Thread hangs, kicking out server!"); -// *((uint32 volatile*)NULL) = 0; // bang crash -// } - // normal work - if(w_loops != World::m_worldLoopCounter) + if (w_loops != World::m_worldLoopCounter) { w_lastchange = curtime; w_loops = World::m_worldLoopCounter; } // possible freeze - else if(getMSTimeDiff(w_lastchange,curtime) > _delaytime) + else if (getMSTimeDiff(w_lastchange,curtime) > _delaytime) { sLog.outError("World Thread hangs, kicking out server!"); *((uint32 volatile*)NULL) = 0; // bang crash @@ -285,7 +260,7 @@ int Master::Run() ACE_Based::Thread* cliThread = NULL; -#ifdef WIN32 +#ifdef _WIN32 if (sConfig.GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) #else if (sConfig.GetBoolDefault("Console.Enable", true)) @@ -298,7 +273,7 @@ int Master::Run() ACE_Based::Thread rar_thread(new RARunnable); ///- Handle affinity for multiple processors and process priority on Windows - #ifdef WIN32 + #ifdef _WIN32 { HANDLE hProcess = GetCurrentProcess(); @@ -386,7 +361,7 @@ int Master::Run() if (cliThread) { - #ifdef WIN32 + #ifdef _WIN32 // this only way to terminate CLI thread exist at Win32 (alt. way exist only in Windows Vista API) //_exit(1); @@ -450,14 +425,14 @@ bool Master::_StartDB() ///- Get world database info from configuration file dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", ""); - if(dbstring.empty()) + if (dbstring.empty()) { - sLog.outError("Database not specified in configuration file"); + sLog.outError("World database not specified in configuration file"); return false; } ///- Initialise the world database - if(!WorldDatabase.Initialize(dbstring.c_str())) + if( !WorldDatabase.Initialize(dbstring.c_str())) { sLog.outError("Cannot connect to world database %s",dbstring.c_str()); return false; @@ -465,14 +440,14 @@ bool Master::_StartDB() ///- Get character database info from configuration file dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", ""); - if(dbstring.empty()) + if (dbstring.empty()) { - sLog.outError("Character Database not specified in configuration file"); + sLog.outError("Character database not specified in configuration file"); return false; } ///- Initialise the Character database - if(!CharacterDatabase.Initialize(dbstring.c_str())) + if (!CharacterDatabase.Initialize(dbstring.c_str())) { sLog.outError("Cannot connect to Character database %s",dbstring.c_str()); return false; @@ -480,14 +455,14 @@ bool Master::_StartDB() ///- Get login database info from configuration file dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", ""); - if(dbstring.empty()) + if (dbstring.empty()) { sLog.outError("Login database not specified in configuration file"); return false; } ///- Initialise the login database - if(!LoginDatabase.Initialize(dbstring.c_str())) + if (!LoginDatabase.Initialize(dbstring.c_str())) { sLog.outError("Cannot connect to login database %s",dbstring.c_str()); return false; @@ -495,7 +470,7 @@ bool Master::_StartDB() ///- Get the realm Id from the configuration file realmID = sConfig.GetIntDefault("RealmID", 0); - if(!realmID) + if (!realmID) { sLog.outError("Realm ID not defined in configuration file"); return false; diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h index 76ff2af1457..e8105705435 100644 --- a/src/server/worldserver/Master.h +++ b/src/server/worldserver/Master.h @@ -26,7 +26,6 @@ #define _MASTER_H #include "Common.h" -#include "Policies/Singleton.h" /// Start the server class Master @@ -35,7 +34,6 @@ class Master Master(); ~Master(); int Run(); - static volatile uint32 m_masterLoopCounter; private: bool _StartDB(); @@ -43,6 +41,6 @@ class Master void clearOnlineAccounts(); }; -#define sMaster Trinity::Singleton::Instance() +#define sMaster (*ACE_Singleton::instance()) #endif /// @} diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index 32c16d9980f..35c2514b377 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -23,7 +23,7 @@ */ #include "Common.h" -#include "Config/ConfigEnv.h" +#include "Configuration/ConfigEnv.h" #include "Database/DatabaseEnv.h" #include "AccountMgr.h" #include "Log.h" @@ -254,7 +254,7 @@ void RASocket::zprint( const char * szText ) unsigned int sz=strlen(megabuffer); Encrypt(megabuffer,sz); send(r,megabuffer,sz,0); - delete [] megabuffer; + free(megabuffer); #else diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h index 5c13724f90d..25a21d52044 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.h +++ b/src/server/worldserver/RemoteAccess/RASocket.h @@ -25,7 +25,7 @@ #ifndef _RASOCKET_H #define _RASOCKET_H -#include "sockets/TcpSocket.h" +#include "TcpSocket.h" #include "Common.h" diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index c674ddbc06f..69639da62fa 100644 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -35,7 +35,7 @@ #define WORLD_SLEEP_CONST 50 -#ifdef WIN32 +#ifdef _WIN32 #include "ServiceWin32.h" extern int m_ServiceStatus; #endif @@ -76,7 +76,7 @@ void WorldRunnable::run() else prevSleepTime = 0; - #ifdef WIN32 + #ifdef _WIN32 if (m_ServiceStatus == 0) World::StopNow(SHUTDOWN_EXIT_CODE); while (m_ServiceStatus == 2) Sleep(1000); #endif @@ -90,7 +90,7 @@ void WorldRunnable::run() sWorldSocketMgr->StopNetwork(); - MapManager::Instance().UnloadAll(); // unload all grids (including locked in memory) + sMapMgr.UnloadAll(); // unload all grids (including locked in memory) ///- End the database thread WorldDatabase.ThreadEnd(); // free mySQL thread resources diff --git a/src/server/worldserver/trinitycore.conf.dist b/src/server/worldserver/worldserver.conf.dist similarity index 99% rename from src/server/worldserver/trinitycore.conf.dist rename to src/server/worldserver/worldserver.conf.dist index 3b6d20e093d..8c53993d3f0 100644 --- a/src/server/worldserver/trinitycore.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -48,7 +48,7 @@ RealmID = 1 DataDir = "." LogsDir = "" -LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;realmd" +LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth" WorldDatabaseInfo = "127.0.0.1;3306;trinity;trinity;world" CharacterDatabaseInfo = "127.0.0.1;3306;trinity;trinity;characters" MaxPingTime = 30 @@ -177,7 +177,7 @@ EAIErrorLevel = 2 # # vmap.enableIndoorCheck # Enable/Disable VMap based indoor check to remove outdoor-only auras (mounts etc.) -# Default: 0 (disabled) +# Default: 1 (enabled) # # DetectPosCollision # Check final move position, summon position, etc for visible collision @@ -244,10 +244,10 @@ PlayerSave.Stats.MinLevel = 0 PlayerSave.Stats.SaveOnlyOnLogout = 1 vmap.enableLOS = 0 vmap.enableHeight = 0 -vmap.ignoreMapIds = "369" +vmap.ignoreMapIds = "" vmap.ignoreSpellIds = "7720" vmap.petLOS = 0 -vmap.enableIndoorCheck = 0 +vmap.enableIndoorCheck = 1 DetectPosCollision = 1 TargetPosRecalculateRange = 1.5 UpdateUptimeInterval = 10 @@ -811,6 +811,11 @@ ChatLogTimestamp = 0 # Default: 7 # -1 (show all available quests marks) # +# Quests.IgnoreRaid +# Allow non-raid quests to be completed when in raid group +# Default: 0 (false) +# 1 (true) +# # Guild.EventLogRecordsCount # Count of guild event log records stored in guild_eventlog table # Increase to store more guild events in table, minimum is 100 @@ -928,6 +933,7 @@ Instance.ResetTimeHour = 4 Instance.UnloadDelay = 1800000 Quests.LowLevelHideDiff = 4 Quests.HighLevelHideDiff = 7 +Quests.IgnoreRaid = 0 Guild.EventLogRecordsCount = 100 Guild.BankEventLogRecordsCount = 25 MaxPrimaryTradeSkill = 2 diff --git a/src/server/worldserver/TrinityCore.ico b/src/server/worldserver/worldserver.ico similarity index 100% rename from src/server/worldserver/TrinityCore.ico rename to src/server/worldserver/worldserver.ico diff --git a/src/server/worldserver/TrinityCore.rc b/src/server/worldserver/worldserver.rc similarity index 87% rename from src/server/worldserver/TrinityCore.rc rename to src/server/worldserver/worldserver.rc index 151185f3cec..939d6bdd355 100644 --- a/src/server/worldserver/TrinityCore.rc +++ b/src/server/worldserver/worldserver.rc @@ -36,7 +36,7 @@ // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_APPICON ICON "TrinityCore.ico" +IDI_APPICON ICON "worldserver.ico" ///////////////////////////////////////////////////////////////////////////// // Neutre (Par défaut systčme) resources @@ -69,12 +69,12 @@ BEGIN BEGIN BLOCK "080004b0" BEGIN - VALUE "FileDescription", "TrinityCore" + VALUE "FileDescription", "worldserver" VALUE "FileVersion", STRFILEVER - VALUE "InternalName", "TrinityCore" - VALUE "LegalCopyright", "Copyright (C) 2008-2009" - VALUE "OriginalFilename", "TrinityCore.exe" - VALUE "ProductName", "TrinityCore" + VALUE "InternalName", "worldserver" + VALUE "LegalCopyright", "Copyright (C) 2008-2010" + VALUE "OriginalFilename", "worldserver.exe" + VALUE "ProductName", "worldserver" VALUE "ProductVersion", STRPRODUCTVER END END diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 1d891d39182..4121a9579ec 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,3 +1,13 @@ +# Copyright (C) 2008-2010 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + add_subdirectory(map_extractor) add_subdirectory(vmap3_assembler) add_subdirectory(vmap3_extractor) diff --git a/src/tools/ExtractorToolsVC90.sln b/src/tools/ExtractorToolsVC90.sln new file mode 100644 index 00000000000..7881797979a --- /dev/null +++ b/src/tools/ExtractorToolsVC90.sln @@ -0,0 +1,80 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpq", "..\..\externals\libmpq\win\VC90\libmpq.vcproj", "{03AB0F44-628E-4855-99A0-C98A1EB52C50}" + ProjectSection(ProjectDependencies) = postProject + {CE773400-763E-4B71-B5E2-C9B60A752EB1} = {CE773400-763E-4B71-B5E2-C9B60A752EB1} + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\..\externals\bzip2\win\VC90\bzip2.vcproj", "{CE773400-763E-4B71-B5E2-C9B60A752EB1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\..\externals\zlib\win\VC90\zlib.vcproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3dlite", "..\..\externals\g3dlite\win\VC90\g3dlite.vcproj", "{8072769E-CF10-48BF-B9E1-12752A5DAC6E}" + ProjectSection(ProjectDependencies) = postProject + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{69F789A6-BD04-454A-AC8E-A57AAE7FCF77}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapextractor", "map_extractor\VC90\VC90_mapextractor.vcproj", "{D7552D4F-408F-4F8E-859B-366659150CF4}" + ProjectSection(ProjectDependencies) = postProject + {03AB0F44-628E-4855-99A0-C98A1EB52C50} = {03AB0F44-628E-4855-99A0-C98A1EB52C50} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmap3assembler", "vmap3_assembler\VC90\VC90_vmap3assembler.vcproj", "{572FFF74-480C-4472-8ABF-81733BB4049D}" + ProjectSection(ProjectDependencies) = postProject + {8072769E-CF10-48BF-B9E1-12752A5DAC6E} = {8072769E-CF10-48BF-B9E1-12752A5DAC6E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmap3extractor", "vmap3_extractor\VC90\VC90_vmap3extractor.vcproj", "{502602CC-98EA-4335-B922-C5C1DBF37604}" + ProjectSection(ProjectDependencies) = postProject + {03AB0F44-628E-4855-99A0-C98A1EB52C50} = {03AB0F44-628E-4855-99A0-C98A1EB52C50} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.ActiveCfg = Debug|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Debug|Win32.Build.0 = Debug|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.ActiveCfg = Release|Win32 + {03AB0F44-628E-4855-99A0-C98A1EB52C50}.Release|Win32.Build.0 = Release|Win32 + {CE773400-763E-4B71-B5E2-C9B60A752EB1}.Debug|Win32.ActiveCfg = Debug|Win32 + {CE773400-763E-4B71-B5E2-C9B60A752EB1}.Debug|Win32.Build.0 = Debug|Win32 + {CE773400-763E-4B71-B5E2-C9B60A752EB1}.Release|Win32.ActiveCfg = Release|Win32 + {CE773400-763E-4B71-B5E2-C9B60A752EB1}.Release|Win32.Build.0 = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.ActiveCfg = Debug|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.Build.0 = Debug|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.ActiveCfg = Release|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.Build.0 = Release|Win32 + {D7552D4F-408F-4F8E-859B-366659150CF4}.Debug|Win32.ActiveCfg = Debug|Win32 + {D7552D4F-408F-4F8E-859B-366659150CF4}.Debug|Win32.Build.0 = Debug|Win32 + {D7552D4F-408F-4F8E-859B-366659150CF4}.Release|Win32.ActiveCfg = Release|Win32 + {D7552D4F-408F-4F8E-859B-366659150CF4}.Release|Win32.Build.0 = Release|Win32 + {572FFF74-480C-4472-8ABF-81733BB4049D}.Debug|Win32.ActiveCfg = Debug|Win32 + {572FFF74-480C-4472-8ABF-81733BB4049D}.Debug|Win32.Build.0 = Debug|Win32 + {572FFF74-480C-4472-8ABF-81733BB4049D}.Release|Win32.ActiveCfg = Release|Win32 + {572FFF74-480C-4472-8ABF-81733BB4049D}.Release|Win32.Build.0 = Release|Win32 + {502602CC-98EA-4335-B922-C5C1DBF37604}.Debug|Win32.ActiveCfg = Debug|Win32 + {502602CC-98EA-4335-B922-C5C1DBF37604}.Debug|Win32.Build.0 = Debug|Win32 + {502602CC-98EA-4335-B922-C5C1DBF37604}.Release|Win32.ActiveCfg = Release|Win32 + {502602CC-98EA-4335-B922-C5C1DBF37604}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {CE773400-763E-4B71-B5E2-C9B60A752EB1} = {69F789A6-BD04-454A-AC8E-A57AAE7FCF77} + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {69F789A6-BD04-454A-AC8E-A57AAE7FCF77} + {8072769E-CF10-48BF-B9E1-12752A5DAC6E} = {69F789A6-BD04-454A-AC8E-A57AAE7FCF77} + {03AB0F44-628E-4855-99A0-C98A1EB52C50} = {69F789A6-BD04-454A-AC8E-A57AAE7FCF77} + EndGlobalSection +EndGlobal diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 9052903b1ed..cb3778c7c6a 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -1,4 +1,5 @@ # Copyright (C) 2005-2009 MaNGOS project +# Copyright (C) 2008-2010 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -8,19 +9,30 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -cmake_minimum_required (VERSION 2.6) -project (MANGOS_MAP_EXTRACTOR) +file(GLOB sources *.cpp) -add_subdirectory (libmpq) -add_subdirectory (loadlib) +include_directories ( + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/loadlib +) -include_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/libmpq) -include_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/loadlib) +add_executable(mapextractor + ${sources} +) -link_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/libmpq) -link_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/loadlib) +if(WIN32) + target_link_libraries(mapextractor + mpq + bzip2 + ) +else() + target_link_libraries(mapextractor + mpq + ${BZIP2_LIBRARIES} + ) +endif() -add_executable (ad dbcfile.cpp mpq_libmpq.cpp System.cpp) - -target_link_libraries (ad libmpq) -target_link_libraries (ad loadlib) +if( UNIX ) + install(TARGETS mapextractor DESTINATION bin) +endif() diff --git a/src/tools/map_extractor/README.linux b/src/tools/map_extractor/README.linux deleted file mode 100644 index 1986831e751..00000000000 --- a/src/tools/map_extractor/README.linux +++ /dev/null @@ -1,7 +0,0 @@ -Linux instructions ------------------- - -1. install cmake -2. cmake -i -3. make -4. ./ad diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 683f89ac11e..2640b65d8b1 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -5,17 +5,17 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include "direct.h" #else #include #endif #include "dbcfile.h" -#include "mpq_libmpq.h" +#include "mpq_libmpq04.h" -#include "loadlib/adt.h" -#include "loadlib/wdt.h" +#include "adt.h" +#include "wdt.h" #include #if defined( __GNUC__ ) @@ -88,7 +88,7 @@ static char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "z void CreateDir( const std::string& Path ) { - #ifdef WIN32 + #ifdef _WIN32 _mkdir( Path.c_str()); #else mkdir( Path.c_str(), 0777 ); @@ -166,6 +166,43 @@ void HandleArgs(int argc, char * arg[]) } } +uint32 ReadBuild(int locale) +{ + // include build info file also + std::string filename = std::string("component.wow-")+langs[locale]+".txt"; + //printf("Read %s file... ", filename.c_str()); + + MPQFile m(filename.c_str()); + if(m.isEof()) + { + printf("Fatal error: Not found %s file!\n", filename.c_str()); + exit(1); + } + + std::string text = m.getPointer(); + m.close(); + + size_t pos = text.find("version=\""); + size_t pos1 = pos + strlen("version=\""); + size_t pos2 = text.find("\"",pos1); + if (pos == text.npos || pos2 == text.npos || pos1 >= pos2) + { + printf("Fatal error: Invalid %s file format!\n", filename.c_str()); + exit(1); + } + + std::string build_str = text.substr(pos1,pos2-pos1); + + int build = atoi(build_str.c_str()); + if (build <= 0) + { + printf("Fatal error: Invalid %s file format!\n", filename.c_str()); + exit(1); + } + + return build; +} + uint32 ReadMapDBC() { printf("Read Map.dbc file... "); @@ -238,16 +275,17 @@ void ReadLiquidTypeTableDBC() // // Map file format data -#define MAP_MAGIC 'SPAM' -#define MAP_VERSION_MAGIC '0.1w' -#define MAP_AREA_MAGIC 'AERA' -#define MAP_HEIGHT_MAGIC 'TGHM' -#define MAP_LIQUID_MAGIC 'QILM' +static char const* MAP_MAGIC = "MAPS"; +static char const* MAP_VERSION_MAGIC = "v1.1"; +static char const* MAP_AREA_MAGIC = "AREA"; +static char const* MAP_HEIGHT_MAGIC = "MHGT"; +static char const* MAP_LIQUID_MAGIC = "MLIQ"; struct map_fileheader { uint32 mapMagic; uint32 versionMagic; + uint32 buildMagic; uint32 areaMapOffset; uint32 areaMapSize; uint32 heightMapOffset; @@ -325,7 +363,7 @@ uint8 liquid_type[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x) +bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 build) { ADT_file adt; @@ -344,8 +382,9 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x) // Prepare map header map_fileheader map; - map.mapMagic = MAP_MAGIC; - map.versionMagic = MAP_VERSION_MAGIC; + map.mapMagic = *(uint32 const*)MAP_MAGIC; + map.versionMagic = *(uint32 const*)MAP_VERSION_MAGIC; + map.buildMagic = build; // Get area flags data for (int i=0;i dbcfiles; + std::set dbcfiles; // get DBC file list for(ArchiveSet::iterator i = gOpenArchives.begin(); i != gOpenArchives.end();++i) @@ -894,7 +949,7 @@ void ExtractDBCFiles(int locale, bool basicLocale) dbcfiles.insert(*iter); } - string path = output_path; + std::string path = output_path; path += "/dbc/"; CreateDir(path); if(!basicLocale) @@ -904,6 +959,14 @@ void ExtractDBCFiles(int locale, bool basicLocale) CreateDir(path); } + // extract Build info file + { + string mpq_name = std::string("component.wow-") + langs[locale] + ".txt"; + string filename = path + mpq_name; + + ExtractFile(mpq_name.c_str(), filename); + } + // extract DBCs int count = 0; for (set::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter) @@ -911,18 +974,8 @@ void ExtractDBCFiles(int locale, bool basicLocale) string filename = path; filename += (iter->c_str() + strlen("DBFilesClient\\")); - FILE *output = fopen(filename.c_str(), "wb"); - if(!output) - { - printf("Can't create the output file '%s'\n", filename.c_str()); - continue; - } - MPQFile m(iter->c_str()); - if(!m.isEof()) - fwrite(m.getPointer(), 1, m.getSize(), output); - - fclose(output); - ++count; + if(ExtractFile(iter->c_str(), filename)) + ++count; } printf("Extracted %u DBC files\n\n", count); } @@ -972,6 +1025,7 @@ int main(int argc, char * arg[]) HandleArgs(argc, arg); int FirstLocale = -1; + uint32 build = 0; for (int i = 0; i < LANG_COUNT; i++) { @@ -987,14 +1041,18 @@ int main(int argc, char * arg[]) if((CONF_extract & EXTRACT_DBC) == 0) { FirstLocale = i; + build = ReadBuild(FirstLocale); + printf("Detected client build: %u\n", build); break; } //Extract DBC files if(FirstLocale < 0) { - ExtractDBCFiles(i, true); FirstLocale = i; + build = ReadBuild(FirstLocale); + printf("Detected client build: %u\n", build); + ExtractDBCFiles(i, true); } else ExtractDBCFiles(i, false); @@ -1019,7 +1077,7 @@ int main(int argc, char * arg[]) LoadCommonMPQFiles(); // Extract maps - ExtractMapsFromMpq(); + ExtractMapsFromMpq(build); // Close MPQs CloseMPQFiles(); @@ -1027,4 +1085,3 @@ int main(int argc, char * arg[]) return 0; } - diff --git a/src/tools/map_extractor/VC90_ad.vcproj b/src/tools/map_extractor/VC90/VC90_mapextractor.vcproj similarity index 58% rename from src/tools/map_extractor/VC90_ad.vcproj rename to src/tools/map_extractor/VC90/VC90_mapextractor.vcproj index 9a039a0fbb0..3cc367f0fc8 100644 --- a/src/tools/map_extractor/VC90_ad.vcproj +++ b/src/tools/map_extractor/VC90/VC90_mapextractor.vcproj @@ -2,7 +2,7 @@ - - - - - - - - - - - - - - - - - - - - @@ -293,31 +250,19 @@ Filter="h;hpp;hxx;hm;inl" > - - - - - - diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp index fcbfc95a072..fde70681113 100644 --- a/src/tools/map_extractor/adt.cpp +++ b/src/tools/map_extractor/adt.cpp @@ -1,176 +1,11 @@ #define _CRT_SECURE_NO_DEPRECATE -#ifdef WIN32 -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - #include "adt.h" -#include "mpq_libmpq.h" -extern uint16 *areas; -extern uint16 *LiqType; -extern uint32 maxAreaId; - -vec wmoc; - -Cell *cell; -mcell *mcells; +// Helper int holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888}; int holetab_v[4] = {0x000F, 0x00F0, 0x0F00, 0xF000}; -bool LoadADT(char* filename) -{ - size_t size; - MPQFile mf(filename); - - if(mf.isEof()) - { - //printf("No such file %s\n", filename); - return false; - } - - MapLiqFlag = new uint8[256]; - for(uint32 j = 0; j < 256; ++j) - MapLiqFlag[j] = 0; // no water - - MapLiqHeight = new float[16384]; - for(uint32 j = 0; j < 16384; ++j) - MapLiqHeight[j] = -999999; // no water - - mcells = new mcell; - - wmoc.x = 65 * TILESIZE; - wmoc.z = 65 * TILESIZE; - - size_t mcnk_offsets[256], mcnk_sizes[256]; - - chunk_num = 0; - k = 0; - m = 0; - while (!mf.isEof()) - { - uint32 fourcc; - mf.read(&fourcc, 4); - mf.read(&size, 4); - - size_t nextpos = mf.getPos() + size; - - //if(fourcc==0x4d484452) // MHDR header - //if(fourcc==0x4d564552) // MVER - if(fourcc == 0x4d43494e) // MCIN - { - for (uint32 i = 0; i < 256; ++i) - { - mf.read(&mcnk_offsets[i], 4); - mf.read(&mcnk_sizes[i], 4); - mf.seekRelative(8); - } - } - //if(fourcc == 0x4d544558) // MTEX textures (strings) - //if(fourcc == 0x4d4d4458) // MMDX m2 models (strings) - //if(fourcc == 0x4d4d4944) // MMID offsets for strings in MMDX - //if(fourcc == 0x4d574d4f) // MWMO - //if(fourcc == 0x4d574944) // MWID offsets for strings in MWMO - //if(fourcc == 0x4d444446) // MDDF - //if(fourcc == 0x4d4f4446) // MODF - if(fourcc == 0x4d48324f) // MH2O new in WotLK - { - // çäĺń?íŕäî çŕďîěíčň?áŕçîâó?ďîçčöč??ôŕéë?ňę âń?ńěĺůĺí? áóäó?îň íĺăî - uint32 base_pos = mf.getPos(); - uint32 header_pos = 0; - MH2O_offsData *LiqOffsData = new MH2O_offsData; - MH2O_Data1 *LiqChunkData1 = new MH2O_Data1; - float *ChunkLiqHeight = new float[81]; - for(chunk_num = 0; chunk_num < 256; ++chunk_num) - { - mf.read(LiqOffsData, 0x0C); - header_pos = mf.getPos(); - if(LiqOffsData->offsData1 != 0) // ĺńëč äŕííűĺ ?Data1 ?âîäĺ ĺńňü, ňî čő íŕäî ęîíâĺđňčđîâŕňü - { - // ďĺđĺőî?ďî ńěĺůĺíčţ čç offsData1 ÎŇ ×Ŕ?ęóńę? - mf.seek(base_pos + LiqOffsData->offsData1); - mf.read(LiqChunkData1, 0x18); // ń÷čňűâŕĺ?ńŕěč äŕííűĺ ?ńňđóęňóđ?ňčďŕ MH2O_Data1 - // çŕíîńč?äŕííűĺ ôëŕă?äë˙ ęóńę? - if(LiqType[LiqChunkData1->LiquidTypeId] == 0xffff) - printf("\nCan't find Liquid type for map %s\nchunk %d\n", filename, chunk_num); - else if(LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_WATER || LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_OCEAN) - MapLiqFlag[chunk_num] |= 1; // water/ocean - else if(LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_MAGMA || LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_SLIME) - MapLiqFlag[chunk_num] |= 2; // magma/slime - // ďđĺäâŕđčňĺëüíî çŕďîëí˙ĺě âĺńü ęóńî?äŕííűě?- íĺ?âîäű - for(int j = 0; j < 81; ++j) - { - ChunkLiqHeight[j] = -999999; // no liquid/water - } - // ňĺďĺđü âű÷čńë˙ĺě ňĺ ÷ň??âîäî??ďĺđĺçŕďčńűâŕĺě čő ?ęóńę? - for(int b = 0; b <= LiqChunkData1->height; ++b) - { - for(int c = LiqChunkData1->xOffset; c <= (LiqChunkData1->xOffset + LiqChunkData1->width); ++c) - { - int n = (9 * (LiqChunkData1->yOffset + b)) + c; - ChunkLiqHeight[n] = LiqChunkData1->heightLevel1; - } - } - mf.seek(header_pos); // ?íĺ çŕáűňü âĺđíóňüń˙ íŕ čńőîäíóţ ďîçčöč?čěĺííî ?ŐČÄĹĐĹ - } - else // ĺńëč äŕííűő ?Data1 íĺ? ňî íŕäî çŕďîëíčň?âĺńü ęóńî? íî äŕííűě?- íĺ?âîäű - { - for(int j = 0; j < 81; ++j) - ChunkLiqHeight[j] = -999999; // no liquid/water - } - - if(!(chunk_num % 16)) - m = 1024 * (chunk_num / 16); // ńěĺůĺíčĺ ďî ?äŕ?ęóńęîâ ?ďĺđĺęđűňčĺ?= 1024 - k = m + (chunk_num % 16) * 8; // óńňŕíŕâëčâŕĺěń˙ íŕ íŕ÷ŕëüíű?číäĺęń äë˙ çŕďîëíĺí? ?äŕ - // çŕíîńč?äŕííűĺ ęóńę??ěŕńńčâ äë˙ ęŕđň? ?ďĺđĺęđűňčĺ??îáđĺçŕíčĺě ęóńęîâ ňę äŕííűő 81 - // ýň?ŕíŕëîă ńňŕđîă?îáđĺçŕíč˙ ăđŕíč÷íű?ďđŕâűő-áîęîâű??íčćíčő äŕííűő - for(int p = 0; p < 72; p += 9) // íčćíčĺ 8 íĺ çŕíîńč?ňę îí?äóáëčđóĺňń˙ ńëĺä ęóńęîě - { - for(int s = 0; s < 8; ++s) // 9 çíŕ÷ĺíčĺ ?ńňđîęĺ íĺ çŕíîńč?ňę îí?äóáëčđóĺňń˙ ńëĺä ęóńęîě, ??ďđâű?áîęîâű?îáđĺçŕĺň? äë˙ 128?28 - { - MapLiqHeight[k] = ChunkLiqHeight[p + s]; - ++k; - } - k = k + 120; - } - } - delete LiqOffsData; - delete LiqChunkData1; - delete []ChunkLiqHeight; - - } - //case 0x4d434e4b: // MCNK - //case 0x4d46424f: // MFBO new in BC - //case 0x4d545846: // MTXF new in WotLK - mf.seek(nextpos); - } - - //printf("Loading chunks info\n"); - // read individual map chunks - chunk_num = 0; - k = 0; - m = 0; - for (int j = 0; j < 16; ++j) - { - for (int i = 0; i < 16; ++i) - { - mf.seek((int)mcnk_offsets[j * 16 + i]); - LoadMapChunk(mf, &(mcells->ch[i][j])); - ++chunk_num; - } - } - mf.close(); - return true; -} - bool isHole(int holes, int i, int j) { int testi = i / 2; @@ -180,202 +15,117 @@ bool isHole(int holes, int i, int j) return (holes & holetab_h[testi] & holetab_v[testj]) != 0; } -inline void LoadMapChunk(MPQFile &mf, chunk *_chunk) +// +// Adt file loader class +// +ADT_file::ADT_file() { - float h; - uint32 fourcc; - uint32 size; - MapChunkHeader header; - - mf.seekRelative(4); - mf.read(&size, 4); - - size_t lastpos = mf.getPos() + size; - mf.read(&header, 0x80); // what if header size got changed? - _chunk->area_id = header.areaid; - - float xbase = header.xpos; - float ybase = header.ypos; - float zbase = header.zpos; - zbase = TILESIZE * 32 - zbase; - xbase = TILESIZE * 32 - xbase; - if(wmoc.x > xbase) wmoc.x = xbase; - if(wmoc.z > zbase) wmoc.z = zbase; - int chunkflags = header.flags; - //printf("LMC: flags %X\n", chunkflags); - float zmin = 999999999.0f; - float zmax = -999999999.0f; - // must be there, bl!zz uses some crazy format - while (mf.getPos() < lastpos) - { - mf.read(&fourcc, 4); - mf.read(&size, 4); - size_t nextpos = mf.getPos() + size; - if(fourcc == 0x4d435654) // MCVT - { - for (int j = 0; j < 17; ++j) - { - for (int i = 0; i < ((j % 2) ? 8 : 9); ++i) - { - mf.read(&h, 4); - float z = h + ybase; - if (j % 2) - { - if(isHole(header.holes, i, j)) - _chunk->v8[i][j / 2] = -1000; - else - _chunk->v8[i][j / 2] = z; - } - else - { - if(isHole(header.holes, i, j)) - _chunk->v9[i][j / 2] = -1000; - else - _chunk->v9[i][j / 2] = z; - } - - if(z > zmax) zmax = z; - //if(z < zmin) zmin = z; - } - } - } - else if(fourcc == 0x4d434e52) // MCNR - { - nextpos = mf.getPos() + 0x1C0; // size fix - } - else if(fourcc == 0x4d434c51) // íĺ áóäĺ?ó÷čňűâŕň?ĺńëč óć?áűëč äŕííűĺ ?MH2O, ďĺđĺńňđŕőîâę?:) // MCLQ - { - // liquid / water level - char fcc1[5]; - mf.read(fcc1, 4); - flipcc(fcc1); - fcc1[4] = 0; - float *ChunkLiqHeight = new float[81]; - - if (!strcmp(fcc1, "MCSE")) - { - for(int j = 0; j < 81; ++j) - { - ChunkLiqHeight[j] = -999999; // no liquid/water - } - } - else - { - float maxheight; - mf.read(&maxheight, 4); - for(int j = 0; j < 81; ++j) - { - LiqData liq; - mf.read(&liq, 8); - - if(liq.height > maxheight) - ChunkLiqHeight[j] = -999999; - else - ChunkLiqHeight[j] = h; - } - - if(chunkflags & 4 || chunkflags & 8) - MapLiqFlag[chunk_num] |= 1; // water - if(chunkflags & 16) - MapLiqFlag[chunk_num] |= 2; // magma/slime - } - // ŕďîëíĺ?ňŕ?ćĺ ęŕ??MH2O - if(!(chunk_num % 16)) - m = 1024 * (chunk_num / 16); - k = m + (chunk_num % 16) * 8; - - for(int p = 0; p < 72; p += 9) - { - for(int s = 0; s < 8; ++s) - { - MapLiqHeight[k] = ChunkLiqHeight[p + s]; - ++k; - } - k = k + 120; - } - delete []ChunkLiqHeight; - break; - } - mf.seek(nextpos); - } + a_grid = 0; } -inline void TransformData() +ADT_file::~ADT_file() { - cell = new Cell; - - for(uint32 x = 0; x < 128; ++x) - { - for(uint32 y = 0; y < 128; ++y) - { - cell->v8[y][x] = (float)mcells->ch[x / 8][y / 8].v8[x % 8][y % 8]; - cell->v9[y][x] = (float)mcells->ch[x / 8][y / 8].v9[x % 8][y % 8]; - } - - // extra 1 point on bounds - cell->v9[128][x] = (float)mcells->ch[x / 8][15].v9[x % 8][8]; - // x == y - cell->v9[x][128] = (float)mcells->ch[15][x / 8].v9[8][x % 8]; - } - - // and the last 1 - cell->v9[128][128] = (float)mcells->ch[15][15].v9[8][8]; - - delete mcells; + free(); } -const char MAP_MAGIC[] = "MAP_3.00"; - -bool ConvertADT(char *filename, char *filename2) +void ADT_file::free() { - if(!LoadADT(filename)) + a_grid = 0; + FileLoader::free(); +} + +// +// Adt file check function +// +bool ADT_file::prepareLoadedData() +{ + // Check parent + if (!FileLoader::prepareLoadedData()) return false; - FILE *output=fopen(filename2, "wb"); - if(!output) - { - printf("Can't create the output file '%s'\n", filename2); - delete [] MapLiqHeight; - delete [] MapLiqFlag; + // Check and prepare MHDR + a_grid = (adt_MHDR *)(GetData()+8+version->size); + if (!a_grid->prepareLoadedData()) return false; - } - // write magic header - fwrite(MAP_MAGIC, 1, 8, output); - - for(uint32 x = 0; x < 16; ++x) - { - for(uint32 y = 0; y < 16; ++y) - { - if(mcells->ch[y][x].area_id && mcells->ch[y][x].area_id <= maxAreaId) - { - if(areas[mcells->ch[y][x].area_id] == 0xffff) - printf("\nCan't find area flag for areaid %u.\n", mcells->ch[y][x].area_id); - - fwrite(&areas[mcells->ch[y][x].area_id], 1, 2, output); - } - else - { - uint16 flag = 0xffff; - fwrite(&flag, 1, 2, output); - } - } - } - - fwrite(MapLiqFlag, 1, 256, output); - delete [] MapLiqFlag; - - fwrite(MapLiqHeight, sizeof(float), 16384, output); - delete [] MapLiqHeight; - - TransformData(); - - - fwrite(&cell->v9, 1, sizeof(cell->v9), output); - fwrite(&cell->v8, 1, sizeof(cell->v8), output); - fclose(output); - delete cell; - return true; } +bool adt_MHDR::prepareLoadedData() +{ + if (fcc != 'MHDR') + return false; + + if (size!=sizeof(adt_MHDR)-8) + return false; + + // Check and prepare MCIN + if (offsMCIN && !getMCIN()->prepareLoadedData()) + return false; + + // Check and prepare MH2O + if (offsMH2O && !getMH2O()->prepareLoadedData()) + return false; + + return true; +} + +bool adt_MCIN::prepareLoadedData() +{ + if (fcc != 'MCIN') + return false; + + // Check cells data + for (int i=0; iprepareLoadedData()) + return false; + + return true; +} + +bool adt_MH2O::prepareLoadedData() +{ + if (fcc != 'MH2O') + return false; + + // Check liquid data +// for (int i=0; iprepareLoadedData()) + return false; + // Check liquid data + if (offsMCLQ && !getMCLQ()->prepareLoadedData()) + return false; + + return true; +} + +bool adt_MCVT::prepareLoadedData() +{ + if (fcc != 'MCVT') + return false; + + if (size != sizeof(adt_MCVT)-8) + return false; + + return true; +} + +bool adt_MCLQ::prepareLoadedData() +{ + if (fcc != 'MCLQ') + return false; + + return true; +} \ No newline at end of file diff --git a/src/tools/map_extractor/adt.h b/src/tools/map_extractor/adt.h index 516ed88a86e..725c5b994ee 100644 --- a/src/tools/map_extractor/adt.h +++ b/src/tools/map_extractor/adt.h @@ -1,116 +1,12 @@ #ifndef ADT_H #define ADT_H +#include "loadlib.h" + #define TILESIZE (533.33333f) #define CHUNKSIZE ((TILESIZE) / 16.0f) #define UNITSIZE (CHUNKSIZE / 8.0f) -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -class Liquid; -typedef struct -{ - float x; - float y; - float z; -} svec; - -typedef struct -{ - double x; - double y; - double z; -} vec; - -typedef struct -{ - vec v[3]; -} triangle; - -typedef struct -{ - float v9[16 * 8 + 1][16 * 8 + 1]; - float v8[16 * 8][16 * 8]; -} Cell; - -typedef struct -{ - double v9[9][9]; - double v8[8][8]; - uint16 area_id; -} chunk; - -typedef struct -{ - chunk ch[16][16]; -} mcell; - -struct MapChunkHeader -{ - uint32 flags; - uint32 ix; - uint32 iy; - uint32 nLayers; - uint32 nDoodadRefs; - uint32 ofsHeight; - uint32 ofsNormal; - uint32 ofsLayer; - uint32 ofsRefs; - uint32 ofsAlpha; - uint32 sizeAlpha; - uint32 ofsShadow; - uint32 sizeShadow; - uint32 areaid; - uint32 nMapObjRefs; - uint32 holes; - uint16 s1; - uint16 s2; - uint32 d1; - uint32 d2; - uint32 d3; - uint32 predTex; - uint32 nEffectDoodad; - uint32 ofsSndEmitters; - uint32 nSndEmitters; - uint32 ofsLiquid; // not use in WotLK - uint32 sizeLiquid; // not use in WotLK - float zpos; - float xpos; - float ypos; - uint32 textureId; // new offsColorValues in WotLK - uint32 props; - uint32 effectId; -}; - -typedef struct -{ - uint32 offsData1; - uint32 used; - uint32 offsData2; -} MH2O_offsData; - -typedef struct -{ - uint16 LiquidTypeId; - uint16 type; - float heightLevel1; - float heightLevel2; - uint8 xOffset; - uint8 yOffset; - uint8 width; - uint8 height; - uint32 ofsData2a; - uint32 ofsData2b; -} MH2O_Data1; - -typedef struct -{ - uint16 unk1; - uint16 unk2; - float height; -} LiqData; - enum LiquidType { LIQUID_TYPE_WATER = 0, @@ -119,12 +15,275 @@ enum LiquidType LIQUID_TYPE_SLIME = 3 }; -class MPQFile; +//************************************************************************************** +// ADT file class +//************************************************************************************** +#define ADT_CELLS_PER_GRID 16 +#define ADT_CELL_SIZE 8 +#define ADT_GRID_SIZE (ADT_CELLS_PER_GRID*ADT_CELL_SIZE) + +// +// Adt file height map chunk +// +class adt_MCVT +{ + union{ + uint32 fcc; + char fcc_txt[4]; + }; + uint32 size; +public: + float height_map[(ADT_CELL_SIZE+1)*(ADT_CELL_SIZE+1)+ADT_CELL_SIZE*ADT_CELL_SIZE]; + + bool prepareLoadedData(); +}; + +// +// Adt file liquid map chunk (old) +// +class adt_MCLQ +{ + union{ + uint32 fcc; + char fcc_txt[4]; + }; + uint32 size; +public: + float height1; + float height2; + struct liquid_data{ + uint32 light; + float height; + } liquid[ADT_CELL_SIZE+1][ADT_CELL_SIZE+1]; + + // 1<<0 - ochen + // 1<<1 - lava/slime + // 1<<2 - water + // 1<<6 - all water + // 1<<7 - dark water + // == 0x0F - not show liquid + uint8 flags[ADT_CELL_SIZE][ADT_CELL_SIZE]; + uint8 data[84]; + bool prepareLoadedData(); +}; + +// +// Adt file cell chunk +// +class adt_MCNK +{ + union{ + uint32 fcc; + char fcc_txt[4]; + }; + uint32 size; +public: + uint32 flags; + uint32 ix; + uint32 iy; + uint32 nLayers; + uint32 nDoodadRefs; + uint32 offsMCVT; // height map + uint32 offsMCNR; // Normal vectors for each vertex + uint32 offsMCLY; // Texture layer definitions + uint32 offsMCRF; // A list of indices into the parent file's MDDF chunk + uint32 offsMCAL; // Alpha maps for additional texture layers + uint32 sizeMCAL; + uint32 offsMCSH; // Shadow map for static shadows on the terrain + uint32 sizeMCSH; + uint32 areaid; + uint32 nMapObjRefs; + uint32 holes; + uint16 s[2]; + uint32 data1; + uint32 data2; + uint32 data3; + uint32 predTex; + uint32 nEffectDoodad; + uint32 offsMCSE; + uint32 nSndEmitters; + uint32 offsMCLQ; // Liqid level (old) + uint32 sizeMCLQ; // + float zpos; + float xpos; + float ypos; + uint32 offsMCCV; // offsColorValues in WotLK + uint32 props; + uint32 effectId; + + bool prepareLoadedData(); + adt_MCVT *getMCVT() + { + if (offsMCVT) + return (adt_MCVT *)((uint8 *)this + offsMCVT); + return 0; + } + adt_MCLQ *getMCLQ() + { + if (offsMCLQ) + return (adt_MCLQ *)((uint8 *)this + offsMCLQ); + return 0; + } +}; + +// +// Adt file grid chunk +// +class adt_MCIN +{ + union{ + uint32 fcc; + char fcc_txt[4]; + }; + uint32 size; +public: + struct adt_CELLS{ + uint32 offsMCNK; + uint32 size; + uint32 flags; + uint32 asyncId; + } cells[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; + + bool prepareLoadedData(); + // offset from begin file (used this-84) + adt_MCNK *getMCNK(int x, int y) + { + if (cells[x][y].offsMCNK) + return (adt_MCNK *)((uint8 *)this + cells[x][y].offsMCNK - 84); + return 0; + } +}; + +#define ADT_LIQUID_HEADER_FULL_LIGHT 0x01 +#define ADT_LIQUID_HEADER_NO_HIGHT 0x02 + +struct adt_liquid_header{ + uint16 liquidType; // Index from LiquidType.dbc + uint16 formatFlags; + float heightLevel1; + float heightLevel2; + uint8 xOffset; + uint8 yOffset; + uint8 width; + uint8 height; + uint32 offsData2a; + uint32 offsData2b; +}; + +// +// Adt file liquid data chunk (new) +// +class adt_MH2O +{ +public: + union{ + uint32 fcc; + char fcc_txt[4]; + }; + uint32 size; + + struct adt_LIQUID{ + uint32 offsData1; + uint32 used; + uint32 offsData2; + } liquid[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; + + bool prepareLoadedData(); + + adt_liquid_header *getLiquidData(int x, int y) + { + if (liquid[x][y].used && liquid[x][y].offsData1) + return (adt_liquid_header *)((uint8*)this + 8 + liquid[x][y].offsData1); + return 0; + } + + float *getLiquidHeightMap(adt_liquid_header *h) + { + if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT) + return 0; + if (h->offsData2b) + return (float *)((uint8*)this + 8 + h->offsData2b); + return 0; + } + + uint8 *getLiquidLightMap(adt_liquid_header *h) + { + if (h->formatFlags&ADT_LIQUID_HEADER_FULL_LIGHT) + return 0; + if (h->offsData2b) + { + if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT) + return (uint8 *)((uint8*)this + 8 + h->offsData2b); + return (uint8 *)((uint8*)this + 8 + h->offsData2b + (h->width+1)*(h->height+1)*4); + } + return 0; + } + + uint32 *getLiquidFullLightMap(adt_liquid_header *h) + { + if (!(h->formatFlags&ADT_LIQUID_HEADER_FULL_LIGHT)) + return 0; + if (h->offsData2b) + { + if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT) + return (uint32 *)((uint8*)this + 8 + h->offsData2b); + return (uint32 *)((uint8*)this + 8 + h->offsData2b + (h->width+1)*(h->height+1)*4); + } + return 0; + } + + uint64 getLiquidShowMap(adt_liquid_header *h) + { + if (h->offsData2a) + return *((uint64 *)((uint8*)this + 8 + h->offsData2a)); + else + return 0xFFFFFFFFFFFFFFFFLL; + } + +}; + +// +// Adt file header chunk +// +class adt_MHDR +{ + union{ + uint32 fcc; + char fcc_txt[4]; + }; + uint32 size; + + uint32 pad; + uint32 offsMCIN; // MCIN + uint32 offsTex; // MTEX + uint32 offsModels; // MMDX + uint32 offsModelsIds; // MMID + uint32 offsMapObejcts; // MWMO + uint32 offsMapObejctsIds; // MWID + uint32 offsDoodsDef; // MDDF + uint32 offsObjectsDef; // MODF + uint32 offsMFBO; // MFBO + uint32 offsMH2O; // MH2O + uint32 data1; + uint32 data2; + uint32 data3; + uint32 data4; + uint32 data5; +public: + bool prepareLoadedData(); + adt_MCIN *getMCIN(){ return (adt_MCIN *)((uint8 *)&pad+offsMCIN);} + adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : 0;} + +}; + +class ADT_file : public FileLoader{ +public: + bool prepareLoadedData(); + ADT_file(); + ~ADT_file(); + void free(); + + adt_MHDR *a_grid; +}; -float *MapLiqHeight; -uint8 *MapLiqFlag; -uint32 k, m, chunk_num; -void LoadMapChunk(MPQFile &, chunk*); #endif - - diff --git a/src/tools/map_extractor/dbcfile.cpp b/src/tools/map_extractor/dbcfile.cpp index dd58ac1b4a6..927d3d62b7f 100644 --- a/src/tools/map_extractor/dbcfile.cpp +++ b/src/tools/map_extractor/dbcfile.cpp @@ -1,7 +1,7 @@ #define _CRT_SECURE_NO_DEPRECATE #include "dbcfile.h" -#include "mpq_libmpq.h" +#include "mpq_libmpq04.h" DBCFile::DBCFile(const std::string &filename): filename(filename), diff --git a/src/tools/map_extractor/loadlib/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp similarity index 95% rename from src/tools/map_extractor/loadlib/loadlib.cpp rename to src/tools/map_extractor/loadlib.cpp index ed5bd9acb71..465eb04083f 100644 --- a/src/tools/map_extractor/loadlib/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -1,7 +1,8 @@ #define _CRT_SECURE_NO_DEPRECATE #include "loadlib.h" -#include "../mpq_libmpq.h" +#include "mpq_libmpq04.h" +#include class MPQFile; @@ -61,4 +62,4 @@ void FileLoader::free() data = 0; data_size = 0; version = 0; -} \ No newline at end of file +} diff --git a/src/tools/map_extractor/loadlib/adt.cpp b/src/tools/map_extractor/loadlib/adt.cpp deleted file mode 100644 index fde70681113..00000000000 --- a/src/tools/map_extractor/loadlib/adt.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#define _CRT_SECURE_NO_DEPRECATE - -#include "adt.h" - -// Helper -int holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888}; -int holetab_v[4] = {0x000F, 0x00F0, 0x0F00, 0xF000}; - -bool isHole(int holes, int i, int j) -{ - int testi = i / 2; - int testj = j / 4; - if(testi > 3) testi = 3; - if(testj > 3) testj = 3; - return (holes & holetab_h[testi] & holetab_v[testj]) != 0; -} - -// -// Adt file loader class -// -ADT_file::ADT_file() -{ - a_grid = 0; -} - -ADT_file::~ADT_file() -{ - free(); -} - -void ADT_file::free() -{ - a_grid = 0; - FileLoader::free(); -} - -// -// Adt file check function -// -bool ADT_file::prepareLoadedData() -{ - // Check parent - if (!FileLoader::prepareLoadedData()) - return false; - - // Check and prepare MHDR - a_grid = (adt_MHDR *)(GetData()+8+version->size); - if (!a_grid->prepareLoadedData()) - return false; - - return true; -} - -bool adt_MHDR::prepareLoadedData() -{ - if (fcc != 'MHDR') - return false; - - if (size!=sizeof(adt_MHDR)-8) - return false; - - // Check and prepare MCIN - if (offsMCIN && !getMCIN()->prepareLoadedData()) - return false; - - // Check and prepare MH2O - if (offsMH2O && !getMH2O()->prepareLoadedData()) - return false; - - return true; -} - -bool adt_MCIN::prepareLoadedData() -{ - if (fcc != 'MCIN') - return false; - - // Check cells data - for (int i=0; iprepareLoadedData()) - return false; - - return true; -} - -bool adt_MH2O::prepareLoadedData() -{ - if (fcc != 'MH2O') - return false; - - // Check liquid data -// for (int i=0; iprepareLoadedData()) - return false; - // Check liquid data - if (offsMCLQ && !getMCLQ()->prepareLoadedData()) - return false; - - return true; -} - -bool adt_MCVT::prepareLoadedData() -{ - if (fcc != 'MCVT') - return false; - - if (size != sizeof(adt_MCVT)-8) - return false; - - return true; -} - -bool adt_MCLQ::prepareLoadedData() -{ - if (fcc != 'MCLQ') - return false; - - return true; -} \ No newline at end of file diff --git a/src/tools/map_extractor/loadlib/adt.h b/src/tools/map_extractor/loadlib/adt.h deleted file mode 100644 index 725c5b994ee..00000000000 --- a/src/tools/map_extractor/loadlib/adt.h +++ /dev/null @@ -1,289 +0,0 @@ -#ifndef ADT_H -#define ADT_H - -#include "loadlib.h" - -#define TILESIZE (533.33333f) -#define CHUNKSIZE ((TILESIZE) / 16.0f) -#define UNITSIZE (CHUNKSIZE / 8.0f) - -enum LiquidType -{ - LIQUID_TYPE_WATER = 0, - LIQUID_TYPE_OCEAN = 1, - LIQUID_TYPE_MAGMA = 2, - LIQUID_TYPE_SLIME = 3 -}; - -//************************************************************************************** -// ADT file class -//************************************************************************************** -#define ADT_CELLS_PER_GRID 16 -#define ADT_CELL_SIZE 8 -#define ADT_GRID_SIZE (ADT_CELLS_PER_GRID*ADT_CELL_SIZE) - -// -// Adt file height map chunk -// -class adt_MCVT -{ - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; -public: - float height_map[(ADT_CELL_SIZE+1)*(ADT_CELL_SIZE+1)+ADT_CELL_SIZE*ADT_CELL_SIZE]; - - bool prepareLoadedData(); -}; - -// -// Adt file liquid map chunk (old) -// -class adt_MCLQ -{ - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; -public: - float height1; - float height2; - struct liquid_data{ - uint32 light; - float height; - } liquid[ADT_CELL_SIZE+1][ADT_CELL_SIZE+1]; - - // 1<<0 - ochen - // 1<<1 - lava/slime - // 1<<2 - water - // 1<<6 - all water - // 1<<7 - dark water - // == 0x0F - not show liquid - uint8 flags[ADT_CELL_SIZE][ADT_CELL_SIZE]; - uint8 data[84]; - bool prepareLoadedData(); -}; - -// -// Adt file cell chunk -// -class adt_MCNK -{ - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; -public: - uint32 flags; - uint32 ix; - uint32 iy; - uint32 nLayers; - uint32 nDoodadRefs; - uint32 offsMCVT; // height map - uint32 offsMCNR; // Normal vectors for each vertex - uint32 offsMCLY; // Texture layer definitions - uint32 offsMCRF; // A list of indices into the parent file's MDDF chunk - uint32 offsMCAL; // Alpha maps for additional texture layers - uint32 sizeMCAL; - uint32 offsMCSH; // Shadow map for static shadows on the terrain - uint32 sizeMCSH; - uint32 areaid; - uint32 nMapObjRefs; - uint32 holes; - uint16 s[2]; - uint32 data1; - uint32 data2; - uint32 data3; - uint32 predTex; - uint32 nEffectDoodad; - uint32 offsMCSE; - uint32 nSndEmitters; - uint32 offsMCLQ; // Liqid level (old) - uint32 sizeMCLQ; // - float zpos; - float xpos; - float ypos; - uint32 offsMCCV; // offsColorValues in WotLK - uint32 props; - uint32 effectId; - - bool prepareLoadedData(); - adt_MCVT *getMCVT() - { - if (offsMCVT) - return (adt_MCVT *)((uint8 *)this + offsMCVT); - return 0; - } - adt_MCLQ *getMCLQ() - { - if (offsMCLQ) - return (adt_MCLQ *)((uint8 *)this + offsMCLQ); - return 0; - } -}; - -// -// Adt file grid chunk -// -class adt_MCIN -{ - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; -public: - struct adt_CELLS{ - uint32 offsMCNK; - uint32 size; - uint32 flags; - uint32 asyncId; - } cells[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; - - bool prepareLoadedData(); - // offset from begin file (used this-84) - adt_MCNK *getMCNK(int x, int y) - { - if (cells[x][y].offsMCNK) - return (adt_MCNK *)((uint8 *)this + cells[x][y].offsMCNK - 84); - return 0; - } -}; - -#define ADT_LIQUID_HEADER_FULL_LIGHT 0x01 -#define ADT_LIQUID_HEADER_NO_HIGHT 0x02 - -struct adt_liquid_header{ - uint16 liquidType; // Index from LiquidType.dbc - uint16 formatFlags; - float heightLevel1; - float heightLevel2; - uint8 xOffset; - uint8 yOffset; - uint8 width; - uint8 height; - uint32 offsData2a; - uint32 offsData2b; -}; - -// -// Adt file liquid data chunk (new) -// -class adt_MH2O -{ -public: - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; - - struct adt_LIQUID{ - uint32 offsData1; - uint32 used; - uint32 offsData2; - } liquid[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; - - bool prepareLoadedData(); - - adt_liquid_header *getLiquidData(int x, int y) - { - if (liquid[x][y].used && liquid[x][y].offsData1) - return (adt_liquid_header *)((uint8*)this + 8 + liquid[x][y].offsData1); - return 0; - } - - float *getLiquidHeightMap(adt_liquid_header *h) - { - if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT) - return 0; - if (h->offsData2b) - return (float *)((uint8*)this + 8 + h->offsData2b); - return 0; - } - - uint8 *getLiquidLightMap(adt_liquid_header *h) - { - if (h->formatFlags&ADT_LIQUID_HEADER_FULL_LIGHT) - return 0; - if (h->offsData2b) - { - if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT) - return (uint8 *)((uint8*)this + 8 + h->offsData2b); - return (uint8 *)((uint8*)this + 8 + h->offsData2b + (h->width+1)*(h->height+1)*4); - } - return 0; - } - - uint32 *getLiquidFullLightMap(adt_liquid_header *h) - { - if (!(h->formatFlags&ADT_LIQUID_HEADER_FULL_LIGHT)) - return 0; - if (h->offsData2b) - { - if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT) - return (uint32 *)((uint8*)this + 8 + h->offsData2b); - return (uint32 *)((uint8*)this + 8 + h->offsData2b + (h->width+1)*(h->height+1)*4); - } - return 0; - } - - uint64 getLiquidShowMap(adt_liquid_header *h) - { - if (h->offsData2a) - return *((uint64 *)((uint8*)this + 8 + h->offsData2a)); - else - return 0xFFFFFFFFFFFFFFFFLL; - } - -}; - -// -// Adt file header chunk -// -class adt_MHDR -{ - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; - - uint32 pad; - uint32 offsMCIN; // MCIN - uint32 offsTex; // MTEX - uint32 offsModels; // MMDX - uint32 offsModelsIds; // MMID - uint32 offsMapObejcts; // MWMO - uint32 offsMapObejctsIds; // MWID - uint32 offsDoodsDef; // MDDF - uint32 offsObjectsDef; // MODF - uint32 offsMFBO; // MFBO - uint32 offsMH2O; // MH2O - uint32 data1; - uint32 data2; - uint32 data3; - uint32 data4; - uint32 data5; -public: - bool prepareLoadedData(); - adt_MCIN *getMCIN(){ return (adt_MCIN *)((uint8 *)&pad+offsMCIN);} - adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : 0;} - -}; - -class ADT_file : public FileLoader{ -public: - bool prepareLoadedData(); - ADT_file(); - ~ADT_file(); - void free(); - - adt_MHDR *a_grid; -}; - -#endif diff --git a/src/tools/map_extractor/loadlib/loadlib.h b/src/tools/map_extractor/loadlib/loadlib.h index 6acfd107ec7..49d5f590744 100644 --- a/src/tools/map_extractor/loadlib/loadlib.h +++ b/src/tools/map_extractor/loadlib/loadlib.h @@ -1,28 +1,30 @@ #ifndef LOAD_LIB_H #define LOAD_LIB_H -#ifdef WIN32 +#ifdef _WIN32 typedef __int64 int64; -typedef long int32; -typedef short int16; -typedef char int8; +typedef __int32 int32; +typedef __int16 int16; +typedef __int8 int8; typedef unsigned __int64 uint64; -typedef unsigned long uint32; -typedef unsigned short uint16; -typedef unsigned char uint8; +typedef unsigned __int32 uint32; +typedef unsigned __int16 uint16; +typedef unsigned __int8 uint8; #else #include #ifndef uint64_t +#ifdef __linux__ #include #endif +#endif typedef int64_t int64; -typedef long int32; -typedef short int16; -typedef char int8; +typedef int32_t int32; +typedef int16_t int16; +typedef int8_t int8; typedef uint64_t uint64; -typedef unsigned long uint32; -typedef unsigned short uint16; -typedef unsigned char uint8; +typedef uint32_t uint32; +typedef uint16_t uint16; +typedef uint8_t uint8; #endif #define FILE_FORMAT_VERSION 18 diff --git a/src/tools/map_extractor/mpq_libmpq.cpp b/src/tools/map_extractor/mpq_libmpq.cpp index 2a066a83b34..81aa8cc2894 100644 --- a/src/tools/map_extractor/mpq_libmpq.cpp +++ b/src/tools/map_extractor/mpq_libmpq.cpp @@ -1,44 +1,30 @@ -#include "mpq_libmpq.h" +#include "mpq_libmpq04.h" #include +#include ArchiveSet gOpenArchives; MPQArchive::MPQArchive(const char* filename) { - int result = libmpq_archive_open(&mpq_a, (unsigned char*)filename); + int result = libmpq__archive_open(&mpq_a, filename, -1); printf("Opening %s\n", filename); if(result) { switch(result) { - case LIBMPQ_EFILE : /* error on file operation */ - printf("Error opening archive '%s': File operation Error\n", filename); + case LIBMPQ_ERROR_OPEN : + printf("Error opening archive '%s': Does file really exist?\n", filename); break; - case LIBMPQ_EFILE_FORMAT : /* bad file format */ + case LIBMPQ_ERROR_FORMAT : /* bad file format */ printf("Error opening archive '%s': Bad file format\n", filename); break; - case LIBMPQ_EFILE_CORRUPT : /* file corrupt */ - printf("Error opening archive '%s': File corrupt\n", filename); + case LIBMPQ_ERROR_SEEK : /* seeking in file failed */ + printf("Error opening archive '%s': Seeking in file failed\n", filename); break; - case LIBMPQ_EFILE_NOT_FOUND : /* file in archive not found */ - printf("Error opening archive '%s': File in archive not found\n", filename); - break; - case LIBMPQ_EFILE_READ : /* Read error in archive */ + case LIBMPQ_ERROR_READ : /* Read error in archive */ printf("Error opening archive '%s': Read error in archive\n", filename); break; - case LIBMPQ_EALLOCMEM : /* maybe not enough memory? :) */ + case LIBMPQ_ERROR_MALLOC : /* maybe not enough memory? :) */ printf("Error opening archive '%s': Maybe not enough memory\n", filename); break; - case LIBMPQ_EFREEMEM : /* can not free memory */ - printf("Error opening archive '%s': Cannot free memory\n", filename); - break; - case LIBMPQ_EINV_RANGE : /* Given filenumber is out of range */ - printf("Error opening archive '%s': Given filenumber is out of range\n", filename); - break; - case LIBMPQ_EHASHTABLE : /* error in reading hashtable */ - printf("Error opening archive '%s': Error in reading hashtable\n", filename); - break; - case LIBMPQ_EBLOCKTABLE : /* error in reading blocktable */ - printf("Error opening archive '%s': Error in reading blocktable\n", filename); - break; default: printf("Error opening archive '%s': Unknown error\n", filename); break; @@ -51,7 +37,7 @@ MPQArchive::MPQArchive(const char* filename) void MPQArchive::close() { //gOpenArchives.erase(erase(&mpq_a); - libmpq_archive_close(&mpq_a); + libmpq__archive_close(mpq_a); } MPQFile::MPQFile(const char* filename): @@ -62,25 +48,16 @@ MPQFile::MPQFile(const char* filename): { for(ArchiveSet::iterator i=gOpenArchives.begin(); i!=gOpenArchives.end();++i) { - mpq_archive &mpq_a = (*i)->mpq_a; + mpq_archive *mpq_a = (*i)->mpq_a; - mpq_hash hash = (*i)->GetHashEntry(filename); - uint32 blockindex = hash.blockindex; + uint32_t filenum; + if(libmpq__file_number(mpq_a, filename, &filenum)) continue; + libmpq__off_t transferred; + libmpq__file_unpacked_size(mpq_a, filenum, &size); - if ((blockindex == 0xFFFFFFFF) || (blockindex == 0)) { - continue; //file not found - } - - uint32 fileno = blockindex; - - //int fileno = libmpq_file_number(&mpq_a, filename); - //if(fileno == LIBMPQ_EFILE_NOT_FOUND) - // continue; - - // Found! - size = libmpq_file_info(&mpq_a, LIBMPQ_FILE_UNCOMPRESSED_SIZE, fileno); // HACK: in patch.mpq some files don't want to open and give 1 for filesize if (size<=1) { +// printf("warning: file %s has size %d; cannot read.\n", filename, size); eof = true; buffer = 0; return; @@ -88,7 +65,8 @@ MPQFile::MPQFile(const char* filename): buffer = new char[size]; //libmpq_file_getdata - libmpq_file_getdata(&mpq_a, hash, fileno, (unsigned char*)buffer); + libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); + /*libmpq_file_getdata(&mpq_a, hash, fileno, (unsigned char*)buffer);*/ return; } @@ -131,4 +109,3 @@ void MPQFile::close() buffer = 0; eof = true; } - diff --git a/src/tools/map_extractor/mpq_libmpq.h b/src/tools/map_extractor/mpq_libmpq04.h similarity index 55% rename from src/tools/map_extractor/mpq_libmpq.h rename to src/tools/map_extractor/mpq_libmpq04.h index d61cda7f919..26008f5fba1 100644 --- a/src/tools/map_extractor/mpq_libmpq.h +++ b/src/tools/map_extractor/mpq_libmpq04.h @@ -18,50 +18,20 @@ class MPQArchive { public: - mpq_archive mpq_a; + mpq_archive_s *mpq_a; MPQArchive(const char* filename); void close(); - uint32 HashString(const char* Input, uint32 Offset) { - uint32 seed1 = 0x7fed7fed; - uint32 seed2 = 0xeeeeeeee; - - for (uint32 i = 0; i < strlen(Input); i++) { - uint32 val = toupper(Input[i]); - seed1 = mpq_a.buf[Offset + val] ^ (seed1 + seed2); - seed2 = val + seed1 + seed2 + (seed2 << 5) + 3; - } - - return seed1; - } - mpq_hash GetHashEntry(const char* Filename) { - uint32 index = HashString(Filename, 0); - index &= mpq_a.header->hashtablesize - 1; - uint32 name1 = HashString(Filename, 0x100); - uint32 name2 = HashString(Filename, 0x200); - - for(uint32 i = index; i < mpq_a.header->hashtablesize; ++i) { - mpq_hash hash = mpq_a.hashtable[i]; - if (hash.name1 == name1 && hash.name2 == name2) return hash; - } - - mpq_hash nullhash; - nullhash.blockindex = 0xFFFFFFFF; - return nullhash; - } - void GetFileListTo(vector& filelist) { - mpq_hash hash = GetHashEntry("(listfile)"); - uint32 blockindex = hash.blockindex; + uint32_t filenum; + if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; + libmpq__off_t size, transferred; + libmpq__file_unpacked_size(mpq_a, filenum, &size); - if ((blockindex == 0xFFFFFFFF) || (blockindex == 0)) - return; - - uint32 size = libmpq_file_info(&mpq_a, LIBMPQ_FILE_UNCOMPRESSED_SIZE, blockindex); char *buffer = new char[size]; - - libmpq_file_getdata(&mpq_a, hash, blockindex, (unsigned char*)buffer); + + libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); char seps[] = "\n"; char *token; @@ -87,7 +57,7 @@ class MPQFile //MPQHANDLE handle; bool eof; char *buffer; - size_t pointer,size; + libmpq__off_t pointer,size; // disable copying MPQFile(const MPQFile &f) {} @@ -119,4 +89,3 @@ inline void flipcc(char *fcc) } #endif - diff --git a/src/tools/map_extractor/loadlib/wdt.cpp b/src/tools/map_extractor/wdt.cpp similarity index 100% rename from src/tools/map_extractor/loadlib/wdt.cpp rename to src/tools/map_extractor/wdt.cpp diff --git a/src/tools/map_extractor/loadlib/wdt.h b/src/tools/map_extractor/wdt.h similarity index 100% rename from src/tools/map_extractor/loadlib/wdt.h rename to src/tools/map_extractor/wdt.h diff --git a/src/tools/vmap3_assembler/CMakeLists.txt b/src/tools/vmap3_assembler/CMakeLists.txt index fd4994b67ed..c920571c439 100644 --- a/src/tools/vmap3_assembler/CMakeLists.txt +++ b/src/tools/vmap3_assembler/CMakeLists.txt @@ -1,4 +1,5 @@ # Copyright (C) 2005-2009 MaNGOS project +# Copyright (C) 2008-2010 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -8,78 +9,34 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -cmake_minimum_required (VERSION 2.6) -project (MANGOS_VMAP_ASSEMB_IO) +include_directories( + ${ACE_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/externals/g3dlite + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging + ${CMAKE_SOURCE_DIR}/src/server/collision/Maps + ${CMAKE_SOURCE_DIR}/src/server/collision/Models +) -set(CMAKE_VERBOSE_MAKEFILE true) +add_definitions(-DNO_CORE_FUNCS) -# uncomment next line to disable debug mode -ADD_DEFINITIONS("-DIOMAP_DEBUG") +add_executable(vmap3assembler VMapAssembler.cpp) -ADD_DEFINITIONS("-Wall") -ADD_DEFINITIONS("-ggdb") -ADD_DEFINITIONS("-O3") - -include_directories(../../src/server/shared/vmap/) -include_directories(../../dep/include/g3dlite/) -include_directories(../../dep/ACE_wrappers/) -include_directories(../../objdir/dep/ACE_wrappers) -include_directories(../../src/server/framework/) - -add_library(g3dlite ../../dep/src/g3dlite/AABox.cpp - ../../dep/src/g3dlite/Box.cpp - ../../dep/src/g3dlite/Crypto.cpp - ../../dep/src/g3dlite/format.cpp - ../../dep/src/g3dlite/Matrix3.cpp - ../../dep/src/g3dlite/Plane.cpp - ../../dep/src/g3dlite/System.cpp - ../../dep/src/g3dlite/Triangle.cpp - ../../dep/src/g3dlite/Vector3.cpp - ../../dep/src/g3dlite/Vector4.cpp - ../../dep/src/g3dlite/debugAssert.cpp - ../../dep/src/g3dlite/fileutils.cpp - ../../dep/src/g3dlite/g3dmath.cpp - ../../dep/src/g3dlite/g3dfnmatch.cpp - ../../dep/src/g3dlite/prompt.cpp - ../../dep/src/g3dlite/stringutils.cpp - ../../dep/src/g3dlite/Any.cpp - ../../dep/src/g3dlite/BinaryFormat.cpp - ../../dep/src/g3dlite/BinaryInput.cpp - ../../dep/src/g3dlite/BinaryOutput.cpp - ../../dep/src/g3dlite/Capsule.cpp - ../../dep/src/g3dlite/CollisionDetection.cpp - ../../dep/src/g3dlite/CoordinateFrame.cpp - ../../dep/src/g3dlite/Cylinder.cpp - ../../dep/src/g3dlite/Line.cpp - ../../dep/src/g3dlite/LineSegment.cpp - ../../dep/src/g3dlite/Log.cpp - ../../dep/src/g3dlite/Matrix4.cpp - ../../dep/src/g3dlite/MemoryManager.cpp - ../../dep/src/g3dlite/Quat.cpp - ../../dep/src/g3dlite/Random.cpp - ../../dep/src/g3dlite/Ray.cpp - ../../dep/src/g3dlite/ReferenceCount.cpp - ../../dep/src/g3dlite/Sphere.cpp - ../../dep/src/g3dlite/TextInput.cpp - ../../dep/src/g3dlite/TextOutput.cpp - ../../dep/src/g3dlite/UprightFrame.cpp - ../../dep/src/g3dlite/Vector2.cpp - ) - -add_library(vmap - ../../src/shared/vmap/BIH.cpp - ../../src/shared/vmap/VMapManager2.cpp - ../../src/shared/vmap/MapTree.cpp - ../../src/shared/vmap/TileAssembler.cpp - ../../src/shared/vmap/WorldModel.cpp - ../../src/shared/vmap/ModelInstance.cpp - ) - -target_link_libraries(vmap g3dlite z) - -add_executable(vmap_assembler vmap_assembler.cpp) -target_link_libraries(vmap_assembler vmap) - -# add_executable(vmap_test coordinate_test.cpp) -# target_link_libraries(vmap_test vmap) +if(WIN32) + target_link_libraries(vmap3assembler + collision + g3dlib + zlib + ) +else() + target_link_libraries(vmap3assembler + collision + g3dlib + ${ZLIB_LIBRARIES} + ) +endif() +if( UNIX ) + install(TARGETS vmap3assembler DESTINATION bin) +endif() diff --git a/src/tools/vmap3_assembler/VC90/vmap_assembler.vcproj b/src/tools/vmap3_assembler/VC90/VC90_vmap3assembler.vcproj similarity index 54% rename from src/tools/vmap3_assembler/VC90/vmap_assembler.vcproj rename to src/tools/vmap3_assembler/VC90/VC90_vmap3assembler.vcproj index aff990d01cc..1f3376e71b7 100644 --- a/src/tools/vmap3_assembler/VC90/vmap_assembler.vcproj +++ b/src/tools/vmap3_assembler/VC90/VC90_vmap3assembler.vcproj @@ -1,8 +1,8 @@ @@ -191,57 +201,45 @@ Name="vmaplib" > - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/src/tools/vmap3_assembler/VMapAssembler.cpp b/src/tools/vmap3_assembler/VMapAssembler.cpp index 6666b54356c..d714db5ae45 100644 --- a/src/tools/vmap3_assembler/VMapAssembler.cpp +++ b/src/tools/vmap3_assembler/VMapAssembler.cpp @@ -76,11 +76,13 @@ A '#' at the beginning of a line defines a comment return(result); } */ //======================================================= + int main(int argc, char* argv[]) { if(argc != 3 && argc != 4) { - printf("\nusage: %s [config file name]\n", argv[0]); + //printf("\nusage: %s [config file name]\n", argv[0]); + printf("\nusage: %s \n", argv[0]); return 1; } diff --git a/src/tools/vmap3_assembler/splitConfig.txt b/src/tools/vmap3_assembler/splitConfig.txt deleted file mode 100644 index 8d217b8e967..00000000000 --- a/src/tools/vmap3_assembler/splitConfig.txt +++ /dev/null @@ -1,21 +0,0 @@ -# list of map names - -509 #AhnQiraj -469 #BlackwingLair -189 #MonasteryInstances -030 #PVPZone01 -037 #PVPZone02 -033 #Shadowfang -533 #Stratholme Raid -209 #TanarisInstance -309 #Zul'gurub -560 #HillsbradPast -534 #HyjalPast -532 #Karazahn -543 #HellfireRampart -568 #ZulAman -564 #BlackTemple -574 #UtgardeKeep -575 #UtgardePinnacle -609 #EbonHold -628 #IsleOfConquest \ No newline at end of file diff --git a/src/tools/vmap3_assembler/vmap_assemblerVC90.sln b/src/tools/vmap3_assembler/vmap_assemblerVC90.sln deleted file mode 100644 index 9e94e750661..00000000000 --- a/src/tools/vmap3_assembler/vmap_assemblerVC90.sln +++ /dev/null @@ -1,42 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmap_assembler", "VC90\vmap_assembler.vcproj", "{572FFF74-480C-4472-8ABF-81733BB4049D}" - ProjectSection(ProjectDependencies) = postProject - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} - {8072769E-CF10-48BF-B9E1-12752A5DAC6E} = {8072769E-CF10-48BF-B9E1-12752A5DAC6E} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\..\win\VC90\zlib.vcproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3dlite", "..\..\win\VC90\g3dlite.vcproj", "{8072769E-CF10-48BF-B9E1-12752A5DAC6E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_NoPCH|Win32 = Debug_NoPCH|Win32 - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {572FFF74-480C-4472-8ABF-81733BB4049D}.Debug_NoPCH|Win32.ActiveCfg = Debug|Win32 - {572FFF74-480C-4472-8ABF-81733BB4049D}.Debug_NoPCH|Win32.Build.0 = Debug|Win32 - {572FFF74-480C-4472-8ABF-81733BB4049D}.Debug|Win32.ActiveCfg = Debug|Win32 - {572FFF74-480C-4472-8ABF-81733BB4049D}.Debug|Win32.Build.0 = Debug|Win32 - {572FFF74-480C-4472-8ABF-81733BB4049D}.Release|Win32.ActiveCfg = Release|Win32 - {572FFF74-480C-4472-8ABF-81733BB4049D}.Release|Win32.Build.0 = Release|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug_NoPCH|Win32.ActiveCfg = Debug_NoPCH|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug_NoPCH|Win32.Build.0 = Debug_NoPCH|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug_NoPCH|Win32.ActiveCfg = Debug_NoPCH|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug_NoPCH|Win32.Build.0 = Debug_NoPCH|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.Build.0 = Debug|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.ActiveCfg = Release|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/tools/vmap3_extractor/CMakeLists.txt b/src/tools/vmap3_extractor/CMakeLists.txt index 51e867ec07e..62604f7ad3d 100644 --- a/src/tools/vmap3_extractor/CMakeLists.txt +++ b/src/tools/vmap3_extractor/CMakeLists.txt @@ -1,4 +1,5 @@ # Copyright (C) 2005-2009 MaNGOS project +# Copyright (C) 2008-2010 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -8,9 +9,33 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -cmake_minimum_required (VERSION 2.6) -project (MANGOS_IOMAP_EXTRACTOR) +file(GLOB sources *.cpp) -LINK_DIRECTORIES( ${LINK_DIRECTORIES} ../../libmpq/libmpq/.libs/ ) -add_executable(vmapextractor adtfile.cpp dbcfile.cpp model.cpp mpq_libmpq.cpp vmapexport.cpp wdtfile.cpp wmo.cpp) -target_link_libraries(vmapextractor mpq) +# uncomment next line to disable debug mode +add_definitions("-DIOMAP_DEBUG") + +# build setup currently only supports libmpq 0.4.x +add_definitions("-DUSE_LIBMPQ04") +add_definitions("-Wall") +add_definitions("-ggdb") +add_definitions("-O3") + +add_executable(vmap3extractor ${sources}) + +if(WIN32) + target_link_libraries(vmap3extractor + mpq + bzip2 + zlib + ) +else() + target_link_libraries(vmap3extractor + mpq + ${BZIP2_LIBRARIES} + ${ZLIB_LIBRARIES} + ) +endif() + +if( UNIX ) + install(TARGETS vmap3extractor DESTINATION bin) +endif() diff --git a/src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj b/src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj new file mode 100644 index 00000000000..3dd343f3845 --- /dev/null +++ b/src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tools/vmap3_extractor/adtfile.cpp b/src/tools/vmap3_extractor/adtfile.cpp index 055408edca6..58c1bb94b1c 100644 --- a/src/tools/vmap3_extractor/adtfile.cpp +++ b/src/tools/vmap3_extractor/adtfile.cpp @@ -1,9 +1,10 @@ +#include "vmapexport.h" #include "adtfile.h" #include #include -#ifdef WIN32 +#ifdef _WIN32 #define snprintf _snprintf #endif @@ -69,12 +70,12 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY) //printf("xMap = %s\n", xMap.c_str()); //printf("yMap = %s\n", yMap.c_str()); - const char dirname[] = "Buildings/dir_bin"; + std::string dirname = std::string(szWorkDirWmo) + "/dir_bin"; FILE *dirfile; - dirfile = fopen(dirname, "ab"); + dirfile = fopen(dirname.c_str(), "ab"); if(!dirfile) { - printf("Can't open dirfile!'%s'\n", dirname); + printf("Can't open dirfile!'%s'\n", dirname.c_str()); return false; } @@ -125,7 +126,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY) // nothing do char szLocalFile[1024]; - snprintf(szLocalFile, 1024, "./Buildings/%s", s); + snprintf(szLocalFile, 1024, "%s/%s", szWorkDirWmo, s); FILE * output = fopen(szLocalFile,"rb"); if(!output) { diff --git a/src/tools/vmap3_extractor/dbcfile.h b/src/tools/vmap3_extractor/dbcfile.h index 7381ab9f668..d405d6ffd60 100644 --- a/src/tools/vmap3_extractor/dbcfile.h +++ b/src/tools/vmap3_extractor/dbcfile.h @@ -1,13 +1,27 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2005-2010 MaNGOS + * + * 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 the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 . + */ + #ifndef DBCFILE_H #define DBCFILE_H -#define __STORMLIB_SELF__ #include #include -//#include "StormLib.h" -#undef min -#undef max class DBCFile { public: diff --git a/src/tools/vmap3_extractor/loadlib/loadlib.h b/src/tools/vmap3_extractor/loadlib/loadlib.h index 53731753425..49d5f590744 100644 --- a/src/tools/vmap3_extractor/loadlib/loadlib.h +++ b/src/tools/vmap3_extractor/loadlib/loadlib.h @@ -1,7 +1,7 @@ #ifndef LOAD_LIB_H #define LOAD_LIB_H -#ifdef WIN32 +#ifdef _WIN32 typedef __int64 int64; typedef __int32 int32; typedef __int16 int16; diff --git a/src/tools/vmap3_extractor/model.cpp b/src/tools/vmap3_extractor/model.cpp index b914ed96406..a2493f7e571 100644 --- a/src/tools/vmap3_extractor/model.cpp +++ b/src/tools/vmap3_extractor/model.cpp @@ -134,7 +134,7 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, sc = scale / 1024.0f; char tempname[512]; - sprintf(tempname, "./Buildings/%s", ModelInstName); + sprintf(tempname, "%s/%s", szWorkDirWmo, ModelInstName); FILE *input; input = fopen(tempname, "r+b"); diff --git a/src/tools/vmap3_extractor/mpq_libmpq.cpp b/src/tools/vmap3_extractor/mpq_libmpq.cpp index 4aa59417f81..528b9679a58 100644 --- a/src/tools/vmap3_extractor/mpq_libmpq.cpp +++ b/src/tools/vmap3_extractor/mpq_libmpq.cpp @@ -57,7 +57,7 @@ MPQFile::MPQFile(const char* filename): // HACK: in patch.mpq some files don't want to open and give 1 for filesize if (size<=1) { - printf("warning: file %s has size %d; cannot read.\n", filename, size); + // printf("info: file %s has size %d; considered dummy file.\n", filename, size); eof = true; buffer = 0; return; diff --git a/src/tools/vmap3_extractor/mpq_libmpq04.h b/src/tools/vmap3_extractor/mpq_libmpq04.h index ccbfe37cba7..4fe80f2759c 100644 --- a/src/tools/vmap3_extractor/mpq_libmpq04.h +++ b/src/tools/vmap3_extractor/mpq_libmpq04.h @@ -1,6 +1,3 @@ -#define _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_WARNINGS - #ifndef MPQ_H #define MPQ_H diff --git a/src/tools/vmap3_extractor/vmapexport.cpp b/src/tools/vmap3_extractor/vmapexport.cpp index 07d5d31d418..2be03d85d97 100644 --- a/src/tools/vmap3_extractor/vmapexport.cpp +++ b/src/tools/vmap3_extractor/vmapexport.cpp @@ -1,16 +1,3 @@ -/*****************************************************************************/ -/* StormLibTest.cpp Copyright (c) Ladislav Zezula 2003 */ -/*---------------------------------------------------------------------------*/ -/* This module uses very brutal test methods for StormLib. It extracts all */ -/* files from the archive with Storm.dll and with stormlib and compares them,*/ -/* then tries to build a copy of the entire archive, then removes a few files*/ -/* from the archive and adds them back, then compares the two archives, ... */ -/*---------------------------------------------------------------------------*/ -/* Date Ver Who Comment */ -/* -------- ---- --- ------- */ -/* 25.03.03 1.00 Lad The first version of StormLibTest.cpp */ -/*****************************************************************************/ - #define _CRT_SECURE_NO_DEPRECATE #include #include @@ -18,7 +5,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #include @@ -68,7 +55,7 @@ bool preciseVectorData = false; // Constants //static const char * szWorkDirMaps = ".\\Maps"; -static const char * szWorkDirWmo = "./Buildings"; +const char * szWorkDirWmo = "./Buildings"; // Local testing functions @@ -114,7 +101,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < LiqType_count; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%u LiqTypes loaded)\n", LiqType_count); + printf("Done! (%u LiqTypes loaded)\n", (unsigned int)LiqType_count); } int ExtractWmo() @@ -236,18 +223,22 @@ void ParsMapFiles() WDTFile WDT(fn,map_ids[i].name); if(WDT.init(id, map_ids[i].id)) { + printf("Processing Map %u\n[", map_ids[i].id); for (int x=0; x<64; ++x) { for (int y=0; y<64; ++y) { - if (ADTFile*ADT = WDT.GetMap(x,y)) + if (ADTFile *ADT = WDT.GetMap(x,y)) { //sprintf(id_filename,"%02u %02u %03u",x,y,map_ids[i].id);//!!!!!!!!! ADT->init(map_ids[i].id, x, y); delete ADT; } } + printf("#"); + fflush(stdout); } + printf("]\n"); } } } @@ -260,9 +251,8 @@ void getGamePath() LONG l; s = sizeof(input_path); memset(input_path,0,s); - l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key); - //l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\Burning Crusade Closed Beta",0,KEY_QUERY_VALUE,&key); - l = RegQueryValueEx(key,"InstallPath",0,&t,(LPBYTE)input_path,&s); + l = RegOpenKeyExA(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key); + l = RegQueryValueExA(key,"InstallPath",0,&t,(LPBYTE)input_path,&s); RegCloseKey(key); if (strlen(input_path) > 0) { @@ -321,6 +311,11 @@ bool fillArchiveNameVector(std::vector& pArchiveNames) searchLocales.push_back("esES"); searchLocales.push_back("frFR"); searchLocales.push_back("koKR"); + searchLocales.push_back("zhCN"); + searchLocales.push_back("zhTW"); + searchLocales.push_back("enCN"); + searchLocales.push_back("enTW"); + searchLocales.push_back("esMX"); searchLocales.push_back("ruRU"); for (std::vector::iterator i = searchLocales.begin(); i != searchLocales.end(); ++i) @@ -445,17 +440,33 @@ bool processArgv(int argc, char ** argv, const char *versionString) int main(int argc, char ** argv) { bool success=true; - const char *versionString = "V2.90 2010_05"; + const char *versionString = "V3.00 2010_07"; // Use command line arguments, when some if(!processArgv(argc, argv, versionString)) return 1; + // some simple check if working dir is dirty + else + { + std::string sdir = std::string(szWorkDirWmo) + "/dir"; + std::string sdir_bin = std::string(szWorkDirWmo) + "/dir_bin"; + struct stat status; + if (!stat(sdir.c_str(), &status) || !stat(sdir_bin.c_str(), &status)) + { + printf("Your output directory seems to be polluted, please use an empty directory!\n"); + printf(""); + char garbage[2]; + scanf("%c", garbage); + return 1; + } + } + printf("Extract %s. Beginning work ....\n",versionString); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // Create the working directory if(mkdir(szWorkDirWmo -#ifdef __linux__ +#ifdef _XOPEN_UNIX , 0711 #endif )) diff --git a/src/tools/vmap3_extractor/vmapexport.h b/src/tools/vmap3_extractor/vmapexport.h index 625bc930882..fa9a609abf5 100644 --- a/src/tools/vmap3_extractor/vmapexport.h +++ b/src/tools/vmap3_extractor/vmapexport.h @@ -8,4 +8,6 @@ enum ModelFlags MOD_HAS_BOUND = 1<<2 }; +extern const char * szWorkDirWmo; + #endif diff --git a/src/tools/vmap3_extractor/wdtfile.cpp b/src/tools/vmap3_extractor/wdtfile.cpp index 7f81af72931..cd24ef0346c 100644 --- a/src/tools/vmap3_extractor/wdtfile.cpp +++ b/src/tools/vmap3_extractor/wdtfile.cpp @@ -1,5 +1,4 @@ -#define __STORMLIB_SELF__ - +#include "vmapexport.h" #include "wdtfile.h" #include "adtfile.h" #include @@ -29,12 +28,12 @@ bool WDTFile::init(char *map_id, unsigned int mapID) char fourcc[5]; uint32 size; - const char dirname[] = "Buildings/dir_bin"; + std::string dirname = std::string(szWorkDirWmo) + "/dir_bin"; FILE *dirfile; - dirfile = fopen(dirname, "ab"); + dirfile = fopen(dirname.c_str(), "ab"); if(!dirfile) { - printf("Can't open dirfile!'%s'\n", dirname); + printf("Can't open dirfile!'%s'\n", dirname.c_str()); return false; } diff --git a/src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln b/src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln deleted file mode 100644 index 0c42d1e90f0..00000000000 --- a/src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor3", "VC90\vmapExtractor3.vcproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|Win32.ActiveCfg = Debug|Win32 - {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|Win32.Build.0 = Debug|Win32 - {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|Win32.ActiveCfg = Release|Win32 - {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/tools/vmap3_extractor/wmo.cpp b/src/tools/vmap3_extractor/wmo.cpp index 508391be675..216a2248953 100644 --- a/src/tools/vmap3_extractor/wmo.cpp +++ b/src/tools/vmap3_extractor/wmo.cpp @@ -1,4 +1,3 @@ - #include "vmapexport.h" #include "wmo.h" #include "vec3d.h" @@ -387,7 +386,7 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis if (rootWMO->liquidType & 4) liquidEntry = liquidType; else if (liquidType == 15) - liquidEntry = 0; + liquidEntry = 1; // first entry, generic "Water" else liquidEntry = liquidType + 1; // overwrite material type in header... @@ -443,7 +442,7 @@ WMOInstance::WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint3 //-----------add_in _dir_file---------------- char tempname[512]; - sprintf(tempname, "Buildings/%s", WmoInstName); + sprintf(tempname, "%s/%s", szWorkDirWmo, WmoInstName); FILE *input; input = fopen(tempname, "r+b"); diff --git a/win/TrinityCore&Script VC90.sln b/win/TrinityCore&Script VC90.sln index 52dd31caf53..4e82f96bae6 100644 --- a/win/TrinityCore&Script VC90.sln +++ b/win/TrinityCore&Script VC90.sln @@ -7,38 +7,38 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "game", "VC90\game.vcproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shared", "VC90\shared.vcproj", "{90297C34-F231-4DF4-848E-A74BCC0E40ED}" ProjectSection(ProjectDependencies) = postProject - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E} = {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E} {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} + {9DF7A84E-C644-4720-A79D-C98CB950E34C} = {9DF7A84E-C644-4720-A79D-C98CB950E34C} {803F488E-4C5A-4866-8D5C-1E6C03C007C2} = {803F488E-4C5A-4866-8D5C-1E6C03C007C2} {BD537C9A-FECA-1BAD-6757-8A6348EA12C8} = {BD537C9A-FECA-1BAD-6757-8A6348EA12C8} {8072769E-CF10-48BF-B9E1-12752A5DAC6E} = {8072769E-CF10-48BF-B9E1-12752A5DAC6E} + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5} = {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TrinityCore", "VC90\TrinityCore.vcproj", "{A3A04E47-43A2-4C08-90B3-029CEF558594}" - ProjectSection(ProjectDependencies) = postProject - {563E9905-3657-460C-AE63-0AC39D162E23} = {563E9905-3657-460C-AE63-0AC39D162E23} - {90297C34-F231-4DF4-848E-A74BCC0E40ED} = {90297C34-F231-4DF4-848E-A74BCC0E40ED} - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB} = {04BAF755-0D67-46F8-B1C6-77AE5368F3CB} - {1DC6C4DA-A028-41F3-877D-D5400C594F88} = {1DC6C4DA-A028-41F3-877D-D5400C594F88} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "VC90\zlib.vcproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "framework", "VC90\framework.vcproj", "{BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TrinityRealm", "VC90\TrinityRealm.vcproj", "{563E9905-3657-460C-AE63-0AC39D162E23}" - ProjectSection(ProjectDependencies) = postProject - {90297C34-F231-4DF4-848E-A74BCC0E40ED} = {90297C34-F231-4DF4-848E-A74BCC0E40ED} - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB} = {04BAF755-0D67-46F8-B1C6-77AE5368F3CB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3dlite", "VC90\g3dlite.vcproj", "{8072769E-CF10-48BF-B9E1-12752A5DAC6E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "VC90\sockets.vcproj", "{04BAF755-0D67-46F8-B1C6-77AE5368F3CB}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "genrevision", "VC90\genrevision.vcproj", "{803F488E-4C5A-4866-8D5C-1E6C03C007C2}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACE_Wrappers", "VC90\ACE_vc9.vcproj", "{BD537C9A-FECA-1BAD-6757-8A6348EA12C8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACE_Wrappers", "..\externals\ace\win\VC90\ace.vcproj", "{BD537C9A-FECA-1BAD-6757-8A6348EA12C8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\externals\zlib\win\VC90\zlib.vcproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3dlite", "..\externals\g3dlite\win\VC90\g3dlite.vcproj", "{8072769E-CF10-48BF-B9E1-12752A5DAC6E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\externals\sockets\win\VC90\sockets.vcproj", "{9DF7A84E-C644-4720-A79D-C98CB950E34C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysql", "..\externals\mysql\win\VC90\libmysql.vcproj", "{4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}" + ProjectSection(ProjectDependencies) = postProject + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "authserver", "VC90\authserver.vcproj", "{563E9905-3657-460C-AE63-0AC39D162E23}" + ProjectSection(ProjectDependencies) = postProject + {90297C34-F231-4DF4-848E-A74BCC0E40ED} = {90297C34-F231-4DF4-848E-A74BCC0E40ED} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "worldserver", "VC90\worldserver.vcproj", "{A3A04E47-43A2-4C08-90B3-029CEF558594}" + ProjectSection(ProjectDependencies) = postProject + {1DC6C4DA-A028-41F3-877D-D5400C594F88} = {1DC6C4DA-A028-41F3-877D-D5400C594F88} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -64,54 +64,6 @@ Global {90297C34-F231-4DF4-848E-A74BCC0E40ED}.Release|Win32.Build.0 = Release|Win32 {90297C34-F231-4DF4-848E-A74BCC0E40ED}.Release|x64.ActiveCfg = Release|x64 {90297C34-F231-4DF4-848E-A74BCC0E40ED}.Release|x64.Build.0 = Release|x64 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.ActiveCfg = Debug|Win32 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.Build.0 = Debug|Win32 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.ActiveCfg = Debug|x64 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.Build.0 = Debug|x64 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.ActiveCfg = Release|Win32 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.Build.0 = Release|Win32 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.ActiveCfg = Release|x64 - {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.Build.0 = Release|x64 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.ActiveCfg = Debug|x64 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.Build.0 = Debug|x64 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.ActiveCfg = Release|x64 - {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.Build.0 = Release|x64 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Debug|Win32.ActiveCfg = Debug|Win32 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Debug|Win32.Build.0 = Debug|Win32 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Debug|x64.ActiveCfg = Debug|x64 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Debug|x64.Build.0 = Debug|x64 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|Win32.ActiveCfg = Release|Win32 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|Win32.Build.0 = Release|Win32 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|x64.ActiveCfg = Release|x64 - {BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|x64.Build.0 = Release|x64 - {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|Win32.ActiveCfg = Debug|Win32 - {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|Win32.Build.0 = Debug|Win32 - {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|x64.ActiveCfg = Debug|x64 - {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|x64.Build.0 = Debug|x64 - {563E9905-3657-460C-AE63-0AC39D162E23}.Release|Win32.ActiveCfg = Release|Win32 - {563E9905-3657-460C-AE63-0AC39D162E23}.Release|Win32.Build.0 = Release|Win32 - {563E9905-3657-460C-AE63-0AC39D162E23}.Release|x64.ActiveCfg = Release|x64 - {563E9905-3657-460C-AE63-0AC39D162E23}.Release|x64.Build.0 = Release|x64 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.Build.0 = Debug|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.ActiveCfg = Debug|x64 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.Build.0 = Debug|x64 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.ActiveCfg = Release|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.Build.0 = Release|Win32 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.ActiveCfg = Release|x64 - {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.Build.0 = Release|x64 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|Win32.ActiveCfg = Debug|Win32 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|Win32.Build.0 = Debug|Win32 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|x64.ActiveCfg = Debug|x64 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|x64.Build.0 = Debug|x64 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|Win32.ActiveCfg = Release|Win32 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|Win32.Build.0 = Release|Win32 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|x64.ActiveCfg = Release|x64 - {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|x64.Build.0 = Release|x64 {803F488E-4C5A-4866-8D5C-1E6C03C007C2}.Debug|Win32.ActiveCfg = Debug|Win32 {803F488E-4C5A-4866-8D5C-1E6C03C007C2}.Debug|Win32.Build.0 = Debug|Win32 {803F488E-4C5A-4866-8D5C-1E6C03C007C2}.Debug|x64.ActiveCfg = Debug|x64 @@ -128,6 +80,54 @@ Global {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|Win32.Build.0 = Release|Win32 {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|x64.ActiveCfg = Release|x64 {BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Release|x64.Build.0 = Release|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.ActiveCfg = Debug|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.Build.0 = Debug|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.ActiveCfg = Release|x64 + {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.Build.0 = Release|x64 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.ActiveCfg = Debug|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.Build.0 = Debug|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.ActiveCfg = Debug|x64 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.Build.0 = Debug|x64 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.ActiveCfg = Release|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.Build.0 = Release|Win32 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.ActiveCfg = Release|x64 + {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.Build.0 = Release|x64 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Debug|Win32.ActiveCfg = Debug|Win32 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Debug|Win32.Build.0 = Debug|Win32 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Debug|x64.ActiveCfg = Debug|x64 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Debug|x64.Build.0 = Debug|x64 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Release|Win32.ActiveCfg = Release|Win32 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Release|Win32.Build.0 = Release|Win32 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Release|x64.ActiveCfg = Release|x64 + {9DF7A84E-C644-4720-A79D-C98CB950E34C}.Release|x64.Build.0 = Release|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|Win32.ActiveCfg = Debug|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|Win32.Build.0 = Debug|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|x64.ActiveCfg = Debug|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Debug|x64.Build.0 = Debug|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|Win32.ActiveCfg = Release|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|Win32.Build.0 = Release|Win32 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|x64.ActiveCfg = Release|x64 + {4FBE4FC1-22DE-41A0-9AEB-CFD00EBAC7E5}.Release|x64.Build.0 = Release|x64 + {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|Win32.ActiveCfg = Debug|Win32 + {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|Win32.Build.0 = Debug|Win32 + {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|x64.ActiveCfg = Debug|x64 + {563E9905-3657-460C-AE63-0AC39D162E23}.Debug|x64.Build.0 = Debug|x64 + {563E9905-3657-460C-AE63-0AC39D162E23}.Release|Win32.ActiveCfg = Release|Win32 + {563E9905-3657-460C-AE63-0AC39D162E23}.Release|Win32.Build.0 = Release|Win32 + {563E9905-3657-460C-AE63-0AC39D162E23}.Release|x64.ActiveCfg = Release|x64 + {563E9905-3657-460C-AE63-0AC39D162E23}.Release|x64.Build.0 = Release|x64 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.ActiveCfg = Debug|Win32 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.Build.0 = Debug|Win32 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.ActiveCfg = Debug|x64 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.Build.0 = Debug|x64 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.ActiveCfg = Release|Win32 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.Build.0 = Release|Win32 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.ActiveCfg = Release|x64 + {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/win/VC90/ACE_vc9.vcproj b/win/VC90/ACE_vc9.vcproj deleted file mode 100644 index ba5e969b5be..00000000000 --- a/win/VC90/ACE_vc9.vcproj +++ /dev/null @@ -1,5354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/VC90/TrinityCore.vcproj b/win/VC90/TrinityCore.vcproj deleted file mode 100644 index 8179e78cebc..00000000000 --- a/win/VC90/TrinityCore.vcproj +++ /dev/null @@ -1,507 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/VC90/TrinityRealm.vcproj b/win/VC90/authserver.vcproj similarity index 56% rename from win/VC90/TrinityRealm.vcproj rename to win/VC90/authserver.vcproj index 9fca65e3a53..af3b474ff69 100644 --- a/win/VC90/TrinityRealm.vcproj +++ b/win/VC90/authserver.vcproj @@ -2,7 +2,7 @@ @@ -418,19 +420,23 @@ + + - - diff --git a/win/VC90/framework.vcproj b/win/VC90/framework.vcproj deleted file mode 100644 index 4cf74a17a1e..00000000000 --- a/win/VC90/framework.vcproj +++ /dev/null @@ -1,491 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/VC90/g3dlite.vcproj b/win/VC90/g3dlite.vcproj deleted file mode 100644 index a926043efb3..00000000000 --- a/win/VC90/g3dlite.vcproj +++ /dev/null @@ -1,475 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index e41b4f5155f..b63f0383625 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -6,7 +6,7 @@ ProjectGUID="{1DC6C4DA-A028-41F3-877D-D5400C594F88}" RootNamespace="game" Keyword="Win32Proj" - AssemblyReferenceSearchPaths=""..\..\src\game"" + AssemblyReferenceSearchPaths=""..\..\src\server\game"" TargetFrameworkVersion="196613" > @@ -22,8 +22,8 @@ - - - - @@ -398,66 +395,6 @@ RelativePath="..\..\src\server\game\AI\CreatureAISelector.h" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -538,6 +475,66 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - @@ -602,10 +583,6 @@ RelativePath="..\..\src\server\game\Guilds\Guild.h" > - - - - - - - - - - @@ -646,75 +607,87 @@ RelativePath="..\..\src\server\game\OutdoorPvP\OutdoorPvPMgr.h" > - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - @@ -722,15 +695,15 @@ Name="Custom" > @@ -738,55 +711,55 @@ Name="World" > @@ -794,130 +767,130 @@ Name="Eastern Kingdoms" > @@ -925,55 +898,55 @@ Name="Blackrock Depths" > @@ -981,63 +954,63 @@ Name="Blackrock Spire" > @@ -1045,43 +1018,43 @@ Name="Blackwing Lair" > @@ -1089,19 +1062,19 @@ Name="Deadmines" > @@ -1109,15 +1082,15 @@ Name="Gnomeregan" > @@ -1125,55 +1098,55 @@ Name="Karazhan" > @@ -1181,31 +1154,31 @@ Name="Magister's Terrace" > @@ -1213,55 +1186,55 @@ Name="Molten Core" > @@ -1269,19 +1242,19 @@ Name="Scarlet Enclave" > @@ -1289,51 +1262,51 @@ Name="Scarlet Monastery" > @@ -1341,59 +1314,59 @@ Name="Scholomance" > @@ -1401,15 +1374,15 @@ Name="Shadowfang Keep" > @@ -1417,59 +1390,59 @@ Name="Stratholme" > @@ -1477,15 +1450,15 @@ Name="Sunken Temple" > @@ -1493,39 +1466,39 @@ Name="Sunwell Plateau" > @@ -1533,19 +1506,19 @@ Name="Uldaman" > @@ -1553,39 +1526,39 @@ Name="Zul'Aman" > @@ -1593,63 +1566,63 @@ Name="Zul'Gurub" > @@ -1658,19 +1631,19 @@ Name="Examples" > @@ -1678,122 +1651,122 @@ Name="Kalimdor" > @@ -1804,51 +1777,51 @@ Name="Battle for Mt. Hyjal" > @@ -1856,35 +1829,35 @@ Name="Culling of Stratholme" > @@ -1892,27 +1865,27 @@ Name="Old Hillsbrad" > @@ -1920,27 +1893,27 @@ Name="The Dark Portal" > @@ -1949,19 +1922,19 @@ Name="Maraudon" > @@ -1969,15 +1942,15 @@ Name="Onyxia's Lair" > @@ -1985,19 +1958,19 @@ Name="Razorfen Downs" > @@ -2005,15 +1978,15 @@ Name="Razorfen Kraul" > @@ -2021,35 +1994,35 @@ Name="Ruins of Ahn'Qiraj" > @@ -2057,51 +2030,51 @@ Name="Temple of Ahn'Qiraj" > @@ -2109,15 +2082,15 @@ Name="Wailing Caverns" > @@ -2125,11 +2098,11 @@ Name="Zul'Farrak" > @@ -2138,43 +2111,43 @@ Name="Northrend" > @@ -2216,23 +2189,23 @@ Name="Azjol-Nerub" > @@ -2241,27 +2214,27 @@ Name="Drak'Tharon Keep" > @@ -2272,23 +2245,23 @@ Name="Forge of Souls" > @@ -2296,23 +2269,23 @@ Name="Halls of Reflection" > @@ -2320,27 +2293,27 @@ Name="Pit of Saron" > @@ -2349,31 +2322,31 @@ Name="Gundrak" > @@ -2381,71 +2354,71 @@ Name="Naxxramas" > @@ -2453,15 +2426,15 @@ Name="Obsidian Sanctum" > @@ -2469,27 +2442,27 @@ Name="Trial of the Champion" > @@ -2500,27 +2473,27 @@ Name="Halls of Stone" > @@ -2528,27 +2501,27 @@ Name="Halls of Lightning" > @@ -2556,71 +2529,71 @@ Name="Ulduar" > @@ -2632,27 +2605,27 @@ Name="Utgarde Keep" > @@ -2660,27 +2633,27 @@ Name="Utgarde Pinnacle" > @@ -2689,27 +2662,27 @@ Name="Vault of Archavon" > @@ -2717,43 +2690,43 @@ Name="Violet Hold" > @@ -2764,15 +2737,15 @@ Name="Eye of Eternity" > @@ -2780,35 +2753,35 @@ Name="Nexus" > @@ -2816,31 +2789,31 @@ Name="Oculus" > @@ -2850,43 +2823,43 @@ Name="Outland" > @@ -2908,11 +2881,11 @@ Name="Mana Tombs" > @@ -2920,19 +2893,19 @@ Name="Sethekk Halls" > @@ -2940,27 +2913,27 @@ Name="Shadow Labyrinth" > @@ -2969,51 +2942,51 @@ Name="Black Temple" > @@ -3024,35 +2997,35 @@ Name="Serpent Shrine Cavern" > @@ -3060,23 +3033,23 @@ Name="Steam Vault" > @@ -3084,11 +3057,11 @@ Name="Underbog" > @@ -3097,19 +3070,19 @@ Name="Gruul's Lair" > @@ -3120,23 +3093,23 @@ Name="Blood Furnace" > @@ -3144,23 +3117,23 @@ Name="Hellfire Ramparts" > @@ -3168,15 +3141,15 @@ Name="Magtheridon's lair" > @@ -3184,23 +3157,23 @@ Name="Shattered Halls" > @@ -3212,19 +3185,19 @@ Name="Arcatraz" > @@ -3232,15 +3205,15 @@ Name="Botanica" > @@ -3248,31 +3221,31 @@ Name="The Eye" > @@ -3280,27 +3253,27 @@ Name="The Mechanar" > @@ -3308,14 +3281,14 @@ @@ -3334,14 +3307,6 @@ - - - - @@ -3354,10 +3319,6 @@ - - @@ -3366,6 +3327,18 @@ RelativePath="..\..\src\server\game\AuctionHouse\AuctionHouseMgr.h" > + + + + + + - - @@ -3390,66 +3359,6 @@ RelativePath="..\..\src\server\game\BattleGrounds\BattleGround.h" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3458,94 +3367,130 @@ RelativePath="..\..\src\server\game\BattleGrounds\BattleGroundMgr.h" > - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - @@ -3554,38 +3499,54 @@ RelativePath="..\..\src\server\game\Chat\Chat.h" > - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + - - @@ -3602,16 +3563,20 @@ RelativePath="..\..\src\server\game\Combat\ThreatManager.h" > + + @@ -3669,14 +3634,6 @@ RelativePath="..\..\src\server\game\Entities\Creature\GossipDef.h" > - - - - @@ -3686,6 +3643,18 @@ > + + + + + + @@ -3701,14 +3670,6 @@ - - - - @@ -3725,34 +3686,26 @@ RelativePath="..\..\src\server\game\Entities\Item\ItemEnchantmentMgr.h" > - - + + + + + + - - - - - - - - @@ -3761,42 +3714,38 @@ RelativePath="..\..\src\server\game\Entities\Object\Object.h" > - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - @@ -3849,18 +3778,6 @@ RelativePath="..\..\src\server\game\Entities\Player\SocialMgr.h" > - - - - - - + + + + + + + + + + + + @@ -3907,15 +3848,27 @@ Name="Globals" > + + + + + + @@ -3940,32 +3893,24 @@ - - - - @@ -3988,108 +3933,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4193,18 +4066,6 @@ RelativePath="..\..\src\server\game\Movement\MovementGenerators\IdleMovementGenerator.h" > - - - - - - @@ -4238,28 +4099,204 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4267,29 +4304,93 @@ Name="PrecompiledHeaders" > + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - @@ -4298,10 +4399,6 @@ RelativePath="..\..\src\server\game\Quests\QuestDef.h" > - - - - - - - - - - - - - - - - @@ -4386,6 +4455,30 @@ RelativePath="..\..\src\server\game\Spells\SpellMgr.h" > + + + + + + + + + + + + - - - - @@ -4438,38 +4523,178 @@ RelativePath="..\..\src\server\game\World\World.h" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win/VC90/genrevision.vcproj b/win/VC90/genrevision.vcproj index 6684660319b..662a3e9a9e2 100644 --- a/win/VC90/genrevision.vcproj +++ b/win/VC90/genrevision.vcproj @@ -21,8 +21,8 @@ @@ -44,10 +44,11 @@ @@ -117,10 +118,11 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -376,6 +472,14 @@ RelativePath="..\..\src\server\shared\Database\Field.h" > + + + + @@ -412,224 +516,176 @@ RelativePath="..\..\src\server\shared\Database\SQLStorageImpl.h" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -642,41 +698,73 @@ > + + + + + + + + + + + + + + - - - - - - - - diff --git a/win/VC90/sockets.vcproj b/win/VC90/sockets.vcproj deleted file mode 100644 index 0970a1d6fcb..00000000000 --- a/win/VC90/sockets.vcproj +++ /dev/null @@ -1,527 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/VC90/worldserver.vcproj b/win/VC90/worldserver.vcproj new file mode 100644 index 00000000000..40b5966a7a3 --- /dev/null +++ b/win/VC90/worldserver.vcproj @@ -0,0 +1,506 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +